/* * Copyright (C) Ascensio System SIA 2012-2021. All rights reserved * * https://www.onlyoffice.com/ * * Version: 0.0.0 (build:0) */ (function(window,undefined){(function(window,undefined){function FileHandler(){this.get=function(file){if(AscCommon.AscBrowser.isAppleDevices){var downloadWindow=window.open(file,"_parent","",false);window.focus()}else var frmWindow=getIFrameWindow(file)};var getIFrameWindow=function(file){var ifr=document.getElementById("fileFrame");if(null!=ifr)document.body.removeChild(ifr);createFrame(file);var wnd=window.frames["fileFrame"];return wnd};var createFrame=function(file){var frame=document.createElement("iframe"); frame.src=file;frame.name="fileFrame";frame.id="fileFrame";frame.style.width="0px";frame.style.height="0px";frame.style.border="0px";frame.style.display="none";document.body.appendChild(frame)}}function getFile(filePath){var fh=new FileHandler;fh.get(filePath)}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].getFile=getFile})(window);"use strict";(function(window,undefined){var CellValueType=AscCommon.CellValueType;var c_oAscNumFormatType=Asc.c_oAscNumFormatType;var gc_sFormatDecimalPoint= ".";var gc_sFormatThousandSeparator=",";var LocaleFormatSymbol={};var numFormat_Text=0;var numFormat_TextPlaceholder=1;var numFormat_Bracket=2;var numFormat_Digit=3;var numFormat_DigitNoDisp=4;var numFormat_DigitSpace=5;var numFormat_DecimalPoint=6;var numFormat_DecimalFrac=7;var numFormat_Thousand=8;var numFormat_Scientific=9;var numFormat_Repeat=10;var numFormat_Skip=11;var numFormat_Year=12;var numFormat_Month=13;var numFormat_Minute=14;var numFormat_Hour=15;var numFormat_Day=16;var numFormat_Second= 17;var numFormat_Milliseconds=18;var numFormat_AmPm=19;var numFormat_DateSeparator=20;var numFormat_TimeSeparator=21;var numFormat_DecimalPointText=22;var numFormat_MonthMinute=101;var numFormat_Percent=102;var numFormat_General=103;var numFormat_DigitDrop=104;var numFormat_Plus=105;var numFormat_Minus=106;var numFormat_ThousandText=107;var FormatStates={Decimal:1,Frac:2,Scientific:3,Slash:4,SlashFrac:5};var SignType={Negative:1,Null:2,Positive:3};var gc_nMaxDigCount=15;var gc_nMaxDigCountView=11; var gc_nMaxMantissa=Math.pow(10,gc_nMaxDigCount);var gc_aTimeFormats=["[$-F400]h:mm:ss AM/PM","h:mm;@","h:mm AM/PM;@","h:mm:ss;@","h:mm:ss AM/PM;@","mm:ss.0;@","[h]:mm:ss;@"];var gc_aFractionFormats=["# ?/?","# ??/??","# ???/???","# ?/2","# ?/4","# ?/8","# ??/16","# ?/10","# ??/100"];var NumComporationOperators={equal:1,greater:2,less:3,greaterorequal:4,lessorequal:5,notequal:6};var NumFormatType={Excel:1,WordFieldDate:2,WordFieldNumeric:3};function getNumberParts(x){var sig=SignType.Null;if(!isFinite(x))x= 0;if(x>0)sig=SignType.Positive;else if(x<0){sig=SignType.Negative;x=Math.abs(x)}var exp=-gc_nMaxDigCount;var man=0;if(SignType.Null!=sig){exp=Math.floor(Math.log(x)*Math.LOG10E)-gc_nMaxDigCount+1;man=Math.round(x/Math.pow(10,exp));if(man>=gc_nMaxMantissa){exp++;man/=10}}return{mantissa:man,exponent:exp,sign:sig}}function compareNumbers(val1,val2){var res=0;var parts1=getNumberParts(val1);var parts2=getNumberParts(val2);if(parts1.sign===parts2.sign){if(parts1.exponent===parts2.exponent)res=parts1.mantissa- parts2.mantissa;else res=parts1.exponent-parts2.exponent;if(SignType.Negative===parts1.sign)res=-res}else res=parts1.sign-parts2.sign;return res}function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function round10(value,exp1,exp2){value=value.toString().split("e");value=Math.round(+(value[0]+"e"+(value[1]?+value[1]+exp1:exp1)));value=value.toString().split("e");return+(value[0]+"e"+(value[1]?+value[1]-exp2:-exp2))}function FormatObj(type,val){this.type=type;this.val=val}function FormatObjScientific(val, format,sign){this.type=numFormat_Scientific;this.val=val;this.format=format;this.sign=sign}function FormatObjDecimalFrac(aLeft,aRight){this.type=numFormat_DecimalFrac;this.aLeft=aLeft;this.aRight=aRight;this.bNumRight=false;this.numerator=0;this.denominator=0}function FormatObjDateVal(type,nCount,bElapsed){this.type=type;this.val=nCount;this.bElapsed=bElapsed}function FormatObjBracket(sData){this.type=numFormat_Bracket;this.val=sData;this.parse=function(data){var length=data.length;if(length>0){var first= data[0];if("$"==first){var aParams=data.substring(1).split("-");if(aParams[0].length>0)this.CurrencyString=aParams[0];if(aParams.length>1&&aParams[1].length>0)this.Lid=aParams[1]}else if("="==first||">"==first||"<"==first){var nIndex=1;var sOperator=first;if(length>1&&(">"==first||"<"==first)){var second=data[1];if("="==second||">"==second&&"<"==first){sOperator+=second;nIndex=2}}switch(sOperator){case "=":this.operator=NumComporationOperators.equal;break;case ">":this.operator=NumComporationOperators.greater; break;case "<":this.operator=NumComporationOperators.less;break;case ">=":this.operator=NumComporationOperators.greaterorequal;break;case "<=":this.operator=NumComporationOperators.lessorequal;break;case "<>":this.operator=NumComporationOperators.notequal;break}this.operatorValue=parseInt(data.substring(nIndex))}else{var sLowerColor=data.toLowerCase();if("black"==sLowerColor)this.color=0;else if("blue"==sLowerColor)this.color=255;else if("cyan"==sLowerColor)this.color=65535;else if("green"==sLowerColor)this.color= 65280;else if("magenta"==sLowerColor)this.color=16711935;else if("red"==sLowerColor)this.color=16711680;else if("white"==sLowerColor)this.color=16777215;else if("yellow"==sLowerColor)this.color=16776960;else if("y"==first||"m"==first||"d"==first||"h"==first||"s"==first||"Y"==first||"M"==first||"D"==first||"H"==first||"S"==first){var bSame=true;var nCount=1;for(var i=1;i<length;++i){if(first!=data[i]){bSame=false;break}nCount++}if(true==bSame)switch(first){case "Y":case "y":this.dataObj=new FormatObjDateVal(numFormat_Year, nCount,true);break;case "M":case "m":this.dataObj=new FormatObjDateVal(numFormat_MonthMinute,nCount,true);break;case "D":case "d":this.dataObj=new FormatObjDateVal(numFormat_Day,nCount,true);break;case "H":case "h":this.dataObj=new FormatObjDateVal(numFormat_Hour,nCount,true);break;case "S":case "s":this.dataObj=new FormatObjDateVal(numFormat_Second,nCount,true);break}}}}};this.parse(sData)}function ParseLocalFormatSymbol(Name){LocaleFormatSymbol["Y"]="Y";LocaleFormatSymbol["y"]="y";LocaleFormatSymbol["M"]= "M";LocaleFormatSymbol["m"]="m";LocaleFormatSymbol["D"]="D";LocaleFormatSymbol["d"]="d";LocaleFormatSymbol["H"]="H";LocaleFormatSymbol["h"]="h";LocaleFormatSymbol["Minute"]="M";LocaleFormatSymbol["minute"]="m";LocaleFormatSymbol["S"]="S";LocaleFormatSymbol["s"]="s";LocaleFormatSymbol["general"]="General";switch(Name){case "fi":case "smn":case "sms":case "fi-FI":case "se-FI":case "smn-FI":case "sms-FI":case "sv-AX":case "sv-FI":case "en-FI":{LocaleFormatSymbol["Y"]="V";LocaleFormatSymbol["y"]="v"; LocaleFormatSymbol["M"]="K";LocaleFormatSymbol["m"]="k";LocaleFormatSymbol["D"]="P";LocaleFormatSymbol["d"]="p";LocaleFormatSymbol["H"]="T";LocaleFormatSymbol["h"]="t";LocaleFormatSymbol["general"]="Yleinen";break}case "fy":case "nds":case "nl":case "en-NL":case "fy-NL":case "nds-NL":case "nl-BE":case "nl-NL":{LocaleFormatSymbol["Y"]="J";LocaleFormatSymbol["y"]="j";LocaleFormatSymbol["H"]="U";LocaleFormatSymbol["h"]="u";LocaleFormatSymbol["general"]="Standaard";break}case "ast":case "eu":case "gl":case "ast-ES":case "ca-ES":case "es-ES":case "es-MX":case "eu-ES":case "gl-ES":case "ca-ES-valencia":{LocaleFormatSymbol["Y"]= "A";LocaleFormatSymbol["y"]="a";LocaleFormatSymbol["general"]="Est\u00e1ndar";break}case "pt-BR":case "es-BR":{LocaleFormatSymbol["Y"]="A";LocaleFormatSymbol["y"]="a";LocaleFormatSymbol["general"]="Geral";break}case "pt":case "pt-PT":{LocaleFormatSymbol["Y"]="A";LocaleFormatSymbol["y"]="a";LocaleFormatSymbol["general"]="\u00c9standar";break}case "ba":case "ce":case "cu":case "kk":case "os":case "rm":case "ru":case "sah":case "tt":case "wae":case "ba-RU":case "ce-RU":case "cu-RU":case "de-BE":case "en-BE":case "en-CH":case "kk-KZ":case "os-RU":case "pt-CH":case "rm-CH":case "ru-KZ":case "ru-RU":case "sah-RU":case "tt-RU":case "wae-CH":{LocaleFormatSymbol["Y"]= "\u0413";LocaleFormatSymbol["y"]="\u0433";LocaleFormatSymbol["M"]="\u041c";LocaleFormatSymbol["m"]="\u041c";LocaleFormatSymbol["D"]="\u0414";LocaleFormatSymbol["d"]="\u0434";LocaleFormatSymbol["H"]="\u0427";LocaleFormatSymbol["h"]="\u0447";LocaleFormatSymbol["Minute"]="\u041c";LocaleFormatSymbol["minute"]="\u043c";LocaleFormatSymbol["S"]="C";LocaleFormatSymbol["s"]="\u0441";LocaleFormatSymbol["general"]="\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439";break}case "oc":case "br":case "co":case "fr":case "br-FR":case "ca-FR":case "co-FR":case "fr-BE":case "fr-CA":case "fr-CH":case "fr-FR":case "gsw-FR":{LocaleFormatSymbol["Y"]= "A";LocaleFormatSymbol["y"]="a";LocaleFormatSymbol["D"]="J";LocaleFormatSymbol["d"]="j";LocaleFormatSymbol["general"]="Standard";break}case "de":case "ksh":case "dsb":case "hsb":case "de-AT":case "de-CH":case "de-DE":case "dsb-DE":case "en-AT":case "en-DE":case "hsb-DE":case "ksh-DE":case "nds-DE":{LocaleFormatSymbol["Y"]="J";LocaleFormatSymbol["y"]="j";LocaleFormatSymbol["M"]="M";LocaleFormatSymbol["m"]="M";LocaleFormatSymbol["Minute"]="M";LocaleFormatSymbol["minute"]="m";LocaleFormatSymbol["D"]= "T";LocaleFormatSymbol["d"]="t";LocaleFormatSymbol["general"]="Standard";break}case "ca":case "it":case "fur":case "ca-IT":case "de-IT":case "fur-IT":case "it-CH":case "it-IT":case "it-VA":{LocaleFormatSymbol["Y"]="A";LocaleFormatSymbol["y"]="a";LocaleFormatSymbol["D"]="G";LocaleFormatSymbol["d"]="g";LocaleFormatSymbol["general"]="Standard";break}case "sv":case "en-SE":case "se-SE":case "sma-SE":case "smj-SE":case "sv-SE":{LocaleFormatSymbol["Y"]="\u00c5";LocaleFormatSymbol["y"]="\u00e5";LocaleFormatSymbol["m"]= "M";LocaleFormatSymbol["M"]="M";LocaleFormatSymbol["Minute"]="M";LocaleFormatSymbol["minute"]="m";LocaleFormatSymbol["H"]="T";LocaleFormatSymbol["h"]="t";LocaleFormatSymbol["general"]="Standard";break}case "nb":case "nn":case "se":case "smj":case "sma":case "fo":case "da":case "smj-NO":case "sma-NO":case "se-NO":case "nn-NO":case "nb-SJ":case "nb-NO":case "fo-DK":case "da-DK":{LocaleFormatSymbol["Y"]="\u00c5";LocaleFormatSymbol["y"]="\u00e5";LocaleFormatSymbol["H"]="T";LocaleFormatSymbol["h"]="t"; LocaleFormatSymbol["general"]="Standard";break}case "bo":case "ii":case "ug":case "zh":case "bo-CN":case "ii-CN":case "mn-Mong-CN":case "ug-CN":case "zh-CN":case "zh-Hans":case "zh-TW":{LocaleFormatSymbol["general"]="G/\u901a\u7528\u683c\u5f0f";break}case "el":case "el-GR":{LocaleFormatSymbol["Y"]="\u0395";LocaleFormatSymbol["y"]="\u03b5";LocaleFormatSymbol["M"]="\u039c";LocaleFormatSymbol["m"]="\u03bc";LocaleFormatSymbol["D"]="\u0397";LocaleFormatSymbol["d"]="\u03b7";LocaleFormatSymbol["H"]="\u03a9"; LocaleFormatSymbol["h"]="\u03c9";LocaleFormatSymbol["Minute"]="\u039b";LocaleFormatSymbol["minute"]="\u03bb";LocaleFormatSymbol["S"]="\u0394";LocaleFormatSymbol["s"]="\u03b4";LocaleFormatSymbol["general"]="\u0393\u03b5\u03bd\u03b9\u03ba\u03cc\u03c2 \u03c4\u03cd\u03c0\u03bf\u03c2";break}case "hu":case "hu-HU":{LocaleFormatSymbol["Y"]="\u00c9";LocaleFormatSymbol["y"]="\u00e9";LocaleFormatSymbol["M"]="H";LocaleFormatSymbol["m"]="h";LocaleFormatSymbol["D"]="N";LocaleFormatSymbol["d"]="n";LocaleFormatSymbol["H"]= "\u00d3";LocaleFormatSymbol["h"]="\u00f3";LocaleFormatSymbol["Minute"]="P";LocaleFormatSymbol["minute"]="p";LocaleFormatSymbol["S"]="M";LocaleFormatSymbol["s"]="m";LocaleFormatSymbol["general"]="Norm\u00e1l";break}case "tr":case "tr-TR":{LocaleFormatSymbol["M"]="A";LocaleFormatSymbol["m"]="a";LocaleFormatSymbol["D"]="G";LocaleFormatSymbol["d"]="g";LocaleFormatSymbol["H"]="S";LocaleFormatSymbol["h"]="s";LocaleFormatSymbol["Minute"]="D";LocaleFormatSymbol["minute"]="d";LocaleFormatSymbol["S"]="N";LocaleFormatSymbol["s"]= "n";LocaleFormatSymbol["general"]="Genel";break}case "pl":case "pl-PL":{LocaleFormatSymbol["Y"]="R";LocaleFormatSymbol["y"]="r";LocaleFormatSymbol["H"]="G";LocaleFormatSymbol["h"]="g";LocaleFormatSymbol["general"]="Standardowy";break}case "cs":case "cs-CZ":{LocaleFormatSymbol["Y"]="R";LocaleFormatSymbol["y"]="r";LocaleFormatSymbol["general"]="V\u0119eobecn\u00fd";break}case "ja":case "ja-JP":{LocaleFormatSymbol["general"]="G/\u6a19\u6e96";break}case "ko":case "ko-KR":{LocaleFormatSymbol["general"]= "G/\ud45c\uc900";break}}return true}function NumFormat(bAddMinusIfNes){this.formatString="";this.length=this.formatString.length;this.index=0;this.EOF=-1;this.aRawFormat=[];this.aDecFormat=[];this.aFracFormat=[];this.bDateTime=false;this.bDate=false;this.bTime=false;this.bDay=false;this.nPercent=0;this.bScientific=false;this.bThousandSep=false;this.nThousandScale=0;this.bTextFormat=false;this.bTimePeriod=false;this.bMillisec=false;this.bSlash=false;this.bWhole=false;this.bCurrency=false;this.bRepeat= false;this.Color=-1;this.ComporationOperator=null;this.LCID=null;this.bGeneralChart=false;this.bAddMinusIfNes=bAddMinusIfNes}NumFormat.prototype={_getChar:function(){if(this.index<this.length)return this.formatString[this.index];return this.EOF},_readChar:function(){var curChar=this._getChar();if(this.index<this.length)this.index++;return curChar},_skip:function(val){var nNewIndex=this.index+val;if(nNewIndex>=0)this.index=nNewIndex},_addToFormat:function(type,val){var oFormatObj=new FormatObj(type, val);this.aRawFormat.push(oFormatObj)},_addToFormat2:function(oFormatObj){this.aRawFormat.push(oFormatObj)},_ReadText:function(endChar){var sText="";while(true){var next=this._readChar();if(this.EOF==next||endChar==next)break;else sText+=next}this._addToFormat(numFormat_Text,sText)},_GetText:function(len){return this.formatString.substr(this.index,len)},_ReadChar:function(){var next=this._readChar();if(this.EOF!=next)this._addToFormat(numFormat_Text,next)},_ReadBracket:function(){var sBracket=""; while(true){var next=this._readChar();if(this.EOF==next||"]"==next)break;else sBracket+=next}var oFormatObjBracket=new FormatObjBracket(sBracket);if(null!=oFormatObjBracket.operator)this.ComporationOperator=oFormatObjBracket;this._addToFormat2(oFormatObjBracket)},_ReadAmPm:function(next){var sAm=next;var sPm="";var bAm=true;while(true){next=this._readChar();if(this.EOF==next)break;else if("/"==next)bAm=false;else if("A"==next||"a"==next||"P"==next||"p"==next||"M"==next||"m"==next)if(true==bAm)sAm+= next;else sPm+=next;else{this._skip(-1);break}}if(""!=sAm&&""!=sPm){this._addToFormat2(new FormatObj(numFormat_AmPm));this.bTimePeriod=true;this.bDateTime=true}},_parseFormat:function(digitSpaceSymbol,useLocaleFormat){var sGeneral;var DecimalSeparator;var GroupSeparator;var TimeSeparator;var Year;var Month;var Day;var Hour;var year;var month;var day;var hour;var Minute;var minute;var Second;var second;if(useLocaleFormat){sGeneral=LocaleFormatSymbol["general"].toLowerCase();DecimalSeparator=g_oDefaultCultureInfo.NumberDecimalSeparator; TimeSeparator=g_oDefaultCultureInfo.TimeSeparator;GroupSeparator=g_oDefaultCultureInfo.NumberGroupSeparator;Year=LocaleFormatSymbol["Y"];year=LocaleFormatSymbol["y"];Month=LocaleFormatSymbol["M"];month=LocaleFormatSymbol["m"];Day=LocaleFormatSymbol["D"];day=LocaleFormatSymbol["d"];Hour=LocaleFormatSymbol["H"];hour=LocaleFormatSymbol["h"];Minute=LocaleFormatSymbol["Minute"];minute=LocaleFormatSymbol["minute"];Second=LocaleFormatSymbol["S"];second=LocaleFormatSymbol["s"]}else{sGeneral=AscCommon.g_cGeneralFormat.toLowerCase(); DecimalSeparator=gc_sFormatDecimalPoint;TimeSeparator=":";GroupSeparator=gc_sFormatThousandSeparator;Year="Y";year="y";Month="M";month="m";Day="D";day="d";Hour="H";hour="h";Minute="M";minute="m";Second="S";second="s"}var sGeneralFirst=sGeneral[0];this.bGeneralChart=true;while(true){var next=this._readChar();var bNoFormat=false;if(this.EOF==next)break;else if("["==next)this._ReadBracket();else if('"'==next)this._ReadText('"');else if("\\"==next)this._ReadChar();else if("%"==next)this._addToFormat(numFormat_Percent); else if(TimeSeparator==next)this._addToFormat(numFormat_TimeSeparator);else if("0"<=next&&next<="9")this._addToFormat(numFormat_Digit,next-0);else if("#"==next)this._addToFormat(numFormat_DigitNoDisp);else if(digitSpaceSymbol==next)this._addToFormat(numFormat_DigitSpace);else if(DecimalSeparator==next)this._addToFormat(numFormat_DecimalPoint);else if("/"==next)this._addToFormat2(new FormatObjDecimalFrac([],[]));else if(GroupSeparator==next)this._addToFormat(numFormat_Thousand,1);else if("$"==next|| "+"==next||"-"==next||"("==next||")"==next||" "==next)this._addToFormat(numFormat_Text,next);else if(sGeneralFirst===next.toLowerCase()&&sGeneral===(next+this._GetText(sGeneral.length-1)).toLowerCase()){this._addToFormat(numFormat_General);this._skip(sGeneral.length-1)}else if("E"==next||"e"==next){var nextnext=this._readChar();if(this.EOF!=nextnext&&"+"==nextnext||"-"==nextnext){var sign="+"==nextnext?SignType.Positive:SignType.Negative;this._addToFormat2(new FormatObjScientific(next,"",sign))}}else if("*"== next){var nextnext=this._readChar();if(this.EOF!=nextnext)this._addToFormat(numFormat_Repeat,nextnext)}else if("_"==next){var nextnext=this._readChar();if(this.EOF!=nextnext)this._addToFormat(numFormat_Skip,nextnext)}else if("@"==next)this._addToFormat(numFormat_TextPlaceholder);else if(Year==next||year==next)this._addToFormat2(new FormatObjDateVal(numFormat_Year,1,false));else if(Month==next||month==next)if(Month===Minute)this._addToFormat2(new FormatObjDateVal(numFormat_MonthMinute,1,false));else this._addToFormat2(new FormatObjDateVal(numFormat_Month, 1,false));else if(Day==next||day==next)this._addToFormat2(new FormatObjDateVal(numFormat_Day,1,false));else if(Hour==next||hour==next)this._addToFormat2(new FormatObjDateVal(numFormat_Hour,1,false));else if(Minute==next||minute==next)this._addToFormat2(new FormatObjDateVal(numFormat_Minute,1,false));else if(Second==next||second==next)this._addToFormat2(new FormatObjDateVal(numFormat_Second,1,false));else if("A"==next||"a"==next)this._ReadAmPm(next);else{bNoFormat=true;this._addToFormat(numFormat_Text, next)}if(!bNoFormat)this.bGeneralChart=false}return true},_parseFormatWordDateTime:function(){while(true){var next=this._readChar();if(this.EOF==next)break;else if("'"==next)this._ReadText("'");else if("Y"==next||"y"==next)this._addToFormat2(new FormatObjDateVal(numFormat_Year,1,false));else if("M"==next||"m"==next)this._addToFormat2(new FormatObjDateVal(numFormat_MonthMinute,1,false));else if("D"==next||"d"==next)this._addToFormat2(new FormatObjDateVal(numFormat_Day,1,false));else if("H"==next|| "h"==next)this._addToFormat2(new FormatObjDateVal(numFormat_Hour,1,false));else if("S"==next||"s"==next)this._addToFormat2(new FormatObjDateVal(numFormat_Second,1,false));else if("A"==next||"a"==next)this._ReadAmPm(next);else this._addToFormat(numFormat_Text,next)}return true},_parseFormatWordNumeric:function(digitSpaceSymbol){while(true){var next=this._readChar();if(this.EOF==next)break;else if("'"===next)this._ReadText("'");else if("0"===next)this._addToFormat(numFormat_Digit,0);else if(digitSpaceSymbol=== next)this._addToFormat(numFormat_DigitSpace);else if("x"===next||"X"===next)this._addToFormat(numFormat_DigitDrop);else if(gc_sFormatDecimalPoint===next)this._addToFormat(numFormat_DecimalPoint);else if(gc_sFormatThousandSeparator===next)this._addToFormat(numFormat_Thousand,1);else if("+"===next)this._addToFormat(numFormat_Plus);else if("-"===next)this._addToFormat(numFormat_Minus);else this._addToFormat(numFormat_Text,next)}return true},_isDigitType:function(type){return numFormat_Digit===type|| numFormat_DigitNoDisp===type||numFormat_DigitSpace===type||numFormat_DigitDrop===type},_prepareFormat:function(){for(var i=0,length=this.aRawFormat.length;i<length;++i){var oCurItem=this.aRawFormat[i];if(numFormat_Bracket==oCurItem.type&&null!=oCurItem.color)this.Color=oCurItem.color}this.bRepeat=false;var nFormatLength=this.aRawFormat.length;for(var i=0;i<nFormatLength;++i){var item=this.aRawFormat[i];if(numFormat_Repeat==item.type)if(false==this.bRepeat)this.bRepeat=true;else{this.aRawFormat.splice(i, 1);nFormatLength--}else if(numFormat_Bracket==item.type){var oNewObj=item.dataObj;if(null!=oNewObj){this.aRawFormat.splice(i,1,oNewObj);this.bDateTime=true;if(numFormat_Hour==oNewObj.type||numFormat_Minute==oNewObj.type||numFormat_Second==oNewObj.type||numFormat_Milliseconds==oNewObj.type)this.bTime=true;else if(numFormat_Year==oNewObj.type||numFormat_Month==oNewObj.type||numFormat_Day==oNewObj.type){this.bDate=true;if(numFormat_Day==oNewObj.type)this.bDay=true}}}else if(numFormat_Year==item.type|| numFormat_MonthMinute==item.type||numFormat_Month==item.type||numFormat_Day==item.type||numFormat_Hour==item.type||numFormat_Minute==item.type||numFormat_Second==item.type||numFormat_Thousand==item.type){var nStartType=item.type;var nEndIndex=i;for(var j=i+1;j<nFormatLength;++j)if(nStartType==this.aRawFormat[j].type)nEndIndex=j;else break;if(i!=nEndIndex){item.val=nEndIndex-i+1;var nDelCount=item.val-1;this.aRawFormat.splice(i+1,nDelCount);nFormatLength-=nDelCount}if(numFormat_Thousand!=item.type){this.bDateTime= true;if(numFormat_Hour==item.type||numFormat_Minute==item.type||numFormat_Second==item.type||numFormat_Milliseconds==item.type)this.bTime=true;else if(numFormat_Year==item.type||numFormat_Month==item.type||numFormat_Day==item.type){this.bDate=true;if(numFormat_Day==item.type)this.bDay=true}}}else if(numFormat_Scientific==item.type){var bAsText=false;if(true==this.bScientific)bAsText=true;else{var aDigitArray=[];for(var j=i+1;j<nFormatLength;++j){var nextItem=this.aRawFormat[j];if(this._isDigitType(nextItem.type))aDigitArray.push(nextItem)}if(aDigitArray.length> 0){item.format=aDigitArray;this.bScientific=true}else bAsText=true}if(false!=bAsText){item.type=numFormat_Text;item.val=item.val+"+"}}else if(numFormat_DecimalFrac==item.type){var bValid=false;var nLeft=i;for(var j=i-1;j>=0;--j){var subitem=this.aRawFormat[j];if(this._isDigitType(subitem.type))nLeft=j;else break}var nRight=i;if(nLeft<i){for(var j=i+1;j<nFormatLength;++j){var subitem=this.aRawFormat[j];if(this._isDigitType(subitem.type))nRight=j;else break}if(nRight>i){bValid=true;item.aRight=this.aRawFormat.splice(i+ 1,nRight-i);item.aLeft=this.aRawFormat.splice(nLeft,i-nLeft);nFormatLength-=nRight-nLeft;i-=i-nLeft;this.bSlash=true;var flag=item.aRight.length>0&&item.aRight[0].type==numFormat_Digit&&item.aRight[0].val>0;if(flag){var rPart=0;for(var j=0;j<item.aRight.length;j++)if(item.aRight[j].type==numFormat_Digit)rPart=rPart*10+item.aRight[j].val;else{bValid=false;this.bSlash=false;break}if(bValid==true){item.aRight=[];item.aRight.push(new FormatObj(numFormat_Digit,rPart));item.bNumRight=true}}}}if(false== bValid)item.type=numFormat_DateSeparator}}var nReadState=FormatStates.Decimal;var bDecimal=true;nFormatLength=this.aRawFormat.length;for(var i=0;i<nFormatLength;++i){var item=this.aRawFormat[i];if(numFormat_DecimalPoint==item.type)if(this.bDateTime){var nStartIndex=i;var nEndIndex=nStartIndex;for(var j=i+1;j<nFormatLength;++j){var subItem=this.aRawFormat[j];if(numFormat_Digit==subItem.type)nEndIndex=j;else break}if(nStartIndex<nEndIndex){var nDigCount=nEndIndex-nStartIndex;var oNewItem=new FormatObjDateVal(numFormat_Milliseconds, nDigCount,false);var nDelCount=nDigCount;oNewItem.format=this.aRawFormat.splice(i+1,nDelCount,oNewItem);nFormatLength-=nDigCount-1;i++;this.bMillisec=true}item.type=numFormat_DecimalPointText;item.val=null}else{if(FormatStates.Decimal==nReadState)nReadState=FormatStates.Frac}else if(numFormat_MonthMinute==item.type){var bRightCond=false;for(var j=i+1;j<nFormatLength;++j){var subItem=this.aRawFormat[j];if(numFormat_Year==subItem.type||numFormat_Month==subItem.type||numFormat_Day==subItem.type||numFormat_MonthMinute== subItem.type||numFormat_Hour==subItem.type||numFormat_Minute==subItem.type||numFormat_Second==subItem.type||numFormat_Milliseconds==subItem.type){if(numFormat_Second==subItem.type)bRightCond=true;break}}var bLeftCond=false;if(false==bRightCond){var bFindSec=false;for(var j=i-1;j>=0;--j){var subItem=this.aRawFormat[j];if(numFormat_Hour==subItem.type){bLeftCond=true;break}else if(numFormat_Second==subItem.type)bFindSec=true;else if(numFormat_Minute==subItem.type||numFormat_Month==subItem.type||numFormat_MonthMinute== subItem.type){if(true==bFindSec&&numFormat_Minute==subItem.type)bFindSec=false;break}else if(numFormat_Year==subItem.type||numFormat_Day==subItem.type||numFormat_Hour==subItem.type||numFormat_Second==subItem.type||numFormat_Milliseconds==subItem.type)if(true==bFindSec)break}if(true==bFindSec)bLeftCond=true}if((true==bLeftCond||true==bRightCond)&&item.val<=2){item.type=numFormat_Minute;this.bTime=true}else{item.type=numFormat_Month;this.bDate=true}}else if(numFormat_Percent==item.type){this.nPercent++; item.type=numFormat_Text;item.val="%"}else if(numFormat_Thousand==item.type){var isPrevDigit=i>0&&this._isDigitType(this.aRawFormat[i-1].type);var isPrevDecimalPoint=i>0&&numFormat_DecimalPoint===this.aRawFormat[i-1].type;var isNextDigit=i+1<nFormatLength&&this._isDigitType(this.aRawFormat[i+1].type);if(isPrevDigit&&isNextDigit){if(FormatStates.Decimal==nReadState)this.bThousandSep=true}else if(isPrevDigit||isPrevDecimalPoint)this.nThousandScale=item.val;else item.type=numFormat_ThousandText}else if(this._isDigitType(item.type)){this.nThousandScale= 0;if(FormatStates.Decimal==nReadState){this.aDecFormat.push(item);if(this.bSlash===true)this.bWhole=true}else if(FormatStates.Frac==nReadState)this.aFracFormat.push(item)}else if(numFormat_Scientific==item.type)nReadState=FormatStates.Scientific;else if(numFormat_TextPlaceholder==item.type)this.bTextFormat=true}return true},_calsScientific:function(nDecLen,nRealExp){var nKoef=0;if(true==this.bThousandSep)nKoef=4;if(nDecLen>nKoef)nKoef=nDecLen;if(nRealExp>0&&nKoef>0){var nTemp=nRealExp%nKoef;if(0== nTemp)nTemp=nKoef;nKoef=nTemp}return nKoef},_parseNumber:function(number,aDecFormat,nFracLen,nValType){var res={bDigit:false,dec:0,frac:0,fraction:0,exponent:0,exponentFrac:0,scientific:0,sign:SignType.Positive,date:{}};if(CellValueType.String!=nValType)res.bDigit=number==number-0;if(res.bDigit){var numberAbs=Math.abs(number);res.fraction=numberAbs-Math.floor(numberAbs);var parts=getNumberParts(number);res.sign=parts.sign;var nRealExp=gc_nMaxDigCount+parts.exponent;if(SignType.Null!=parts.sign){if(true== this.bScientific){var nKoef=this._calsScientific(aDecFormat.length,nRealExp);res.scientific=nRealExp-nKoef;nRealExp=nKoef}else{for(var i=0;i<this.nPercent;++i)nRealExp+=2;for(var i=0;i<this.nThousandScale;++i)nRealExp-=3}if(false==this.bSlash){var nOldRealExp=nRealExp;parts=getNumberParts(round10(parts.mantissa,nFracLen+nRealExp-gc_nMaxDigCount,nFracLen));if(SignType.Null!=parts.sign){nRealExp=gc_nMaxDigCount+parts.exponent;if(nOldRealExp!=nRealExp&&true==this.bScientific){var nKoef=this._calsScientific(aDecFormat.length, nRealExp);res.scientific+=nRealExp-nOldRealExp;nRealExp=nKoef}}}res.exponent=nRealExp;res.exponentFrac=nRealExp;if(nRealExp>0&&nRealExp<gc_nMaxDigCount){var sNumber=parts.mantissa.toString();var nExponentFrac=0;for(var i=nRealExp,length=sNumber.length;i<length;++i)if("0"==sNumber[i])nExponentFrac++;else break;if(nRealExp+nExponentFrac<sNumber.length)res.exponentFrac=-nExponentFrac}if(SignType.Null!=parts.sign)if(nRealExp<=0)if(this.bSlash==true){res.dec=0;res.frac=parts.mantissa}else if(nFracLen> 0){res.dec=0;res.frac=0;if(nFracLen+nRealExp>0){var sTemp=parts.mantissa.toString();res.frac=sTemp.substring(0,nFracLen+nRealExp)-0}}else{res.dec=0;res.frac=0}else if(nRealExp>=gc_nMaxDigCount){res.dec=parts.mantissa;res.frac=0}else{var sTemp=parts.mantissa.toString();if(this.bSlash==true){res.dec=sTemp.substring(0,nRealExp)-0;if(nRealExp<sTemp.length)res.frac=sTemp.substring(nRealExp)-0;else res.frac=0}else if(nFracLen>0){res.dec=sTemp.substring(0,nRealExp)-0;res.frac=0;var nStart=nRealExp;var nEnd= nRealExp+nFracLen;if(nStart<sTemp.length)res.frac=sTemp.substring(nStart,nEnd)-0}else{res.dec=sTemp.substring(0,nRealExp)-0;res.frac=0}}if(0==res.frac&&0==res.dec&&false===this.bDateTime)res.sign=SignType.Null}if(this.bDateTime===true)res.date=this.parseDate(number)}return res},parseDate:function(number){var d={val:0,coeff:1},h={val:0,coeff:24},min={val:0,coeff:60},s={val:0,coeff:60},ms={val:0,coeff:1E3};var numberAbs=Math.abs(number);var tmp=numberAbs;var ttimes=[d,h,min,s,ms];for(var i=0;i<4;i++){var v= tmp*ttimes[i].coeff;ttimes[i].val=Math.floor(v);tmp=v-ttimes[i].val}ms.val=Math.round(tmp*1E3);for(i=4;i>0&&ttimes[i].val===ttimes[i].coeff;i--){ttimes[i].val=0;ttimes[i-1].val++}var stDate,day,month,year,dayWeek;if(AscCommon.bDate1904){stDate=new Date(Date.UTC(1904,0,1,0,0,0));if(d.val)stDate.setUTCDate(stDate.getUTCDate()+d.val);day=stDate.getUTCDate();dayWeek=stDate.getUTCDay();month=stDate.getUTCMonth();year=stDate.getUTCFullYear()}else if(numberAbs===60){day=29;month=1;year=1900;dayWeek=3}else if(numberAbs=== 0){stDate=new Asc.cDate(Date.UTC(1899,11,31,0,0,0));day=stDate.getUTCDate();dayWeek=stDate.getUTCDay()>0?stDate.getUTCDay()-1:6;month=stDate.getUTCMonth();year=stDate.getUTCFullYear()}else if(numberAbs<60){stDate=new Date(Date.UTC(1899,11,31,0,0,0));if(d.val)stDate.setUTCDate(stDate.getUTCDate()+d.val);day=stDate.getUTCDate();dayWeek=stDate.getUTCDay()>0?stDate.getUTCDay()-1:6;month=stDate.getUTCMonth();year=stDate.getUTCFullYear()}else{stDate=new Date(Date.UTC(1899,11,30,0,0,0));if(d.val)stDate.setUTCDate(stDate.getUTCDate()+ d.val);day=stDate.getUTCDate();dayWeek=stDate.getUTCDay();month=stDate.getUTCMonth();year=stDate.getUTCFullYear()}return{d:day,month:month,year:year,dayWeek:dayWeek,hour:h.val,min:min.val,sec:s.val,ms:ms.val,countDay:d.val}},_FormatNumber:function(number,exponent,format,nReadState,cultureInfo,opt_forceNull){var aRes=[];var nFormatLen=format.length;if(nFormatLen>0)if(FormatStates.Frac!=nReadState&&FormatStates.SlashFrac!=nReadState){var sNumber=number+"";var nNumberLen=sNumber.length;if(exponent>nNumberLen){for(var i= 0;i<exponent-nNumberLen;++i)sNumber+="0";nNumberLen=sNumber.length}var bIsNUll=false;if("0"==sNumber&&!opt_forceNull)bIsNUll=true;if(nNumberLen>nFormatLen){if(false===bIsNUll){var item=format.shift();if(numFormat_DigitDrop!==item.type){var nSplitIndex=nNumberLen-nFormatLen+1;aRes.push(new FormatObj(numFormat_Text,sNumber.slice(0,nSplitIndex)));sNumber=sNumber.substring(nSplitIndex)}else sNumber=sNumber.substring(nNumberLen-nFormatLen)}}else if(nNumberLen<nFormatLen)for(var i=0,length=nFormatLen-nNumberLen;i< length;++i){var item=format.shift();aRes.push(new FormatObj(item.type))}for(var i=0,length=sNumber.length;i<length;++i){var sCurNumber=sNumber[i];var numFormat=numFormat_Text;var item=format.shift();if(true==bIsNUll&&null!=item&&FormatStates.Scientific!=nReadState)if(numFormat_DigitNoDisp==item.type)sCurNumber="";else if(numFormat_DigitSpace==item.type){numFormat=numFormat_DigitSpace;sCurNumber=null}aRes.push(new FormatObj(numFormat,sCurNumber))}if(true==this.bThousandSep&&FormatStates.Slash!=nReadState){var sThousandSep= cultureInfo.NumberGroupSeparator;var aGroupSize=cultureInfo.NumberGroupSizes;var nCurGroupIndex=0;var nCurGroupSize=0;if(nCurGroupIndex<aGroupSize.length)nCurGroupSize=aGroupSize[nCurGroupIndex++];else nCurGroupSize=0;var nIndex=0;for(var i=aRes.length-1;i>=0;--i){var item=aRes[i];if(numFormat_Text==item.type){var aNewText=[];var nTextLength=item.val.length;for(var j=nTextLength-1;j>=0;--j){if(nCurGroupSize==nIndex){aNewText.push(sThousandSep);nTextLength++}aNewText.push(item.val[j]);if(0!=j){nIndex++; if(nCurGroupSize+1==nIndex){nIndex=1;if(nCurGroupIndex<aGroupSize.length)nCurGroupSize=aGroupSize[nCurGroupIndex++]}}}if(nTextLength>1)aNewText.reverse();item.val=aNewText.join("")}else if(numFormat_DigitNoDisp!=item.type)if(nCurGroupSize==nIndex){item.val=sThousandSep;aRes[i]=item}nIndex++;if(nCurGroupSize+1==nIndex){nIndex=1;if(nCurGroupIndex<aGroupSize.length)nCurGroupSize=aGroupSize[nCurGroupIndex++]}}}}else{var val=number;var exp=exponent;var nStartNulls=0;if(exp<0)nStartNulls=Math.abs(exp); var sNumber=val.toString();var nNumberLen=sNumber.length;var nLastNoNull=nNumberLen;for(var i=nNumberLen-1;i>=0;--i){if("0"!=sNumber[i])break;nLastNoNull=i}if(nLastNoNull<nNumberLen&&(FormatStates.SlashFrac!=nReadState||0==nLastNoNull)){sNumber=sNumber.substring(0,nLastNoNull);nNumberLen=sNumber.length}for(var i=0;i<nStartNulls;++i)aRes.push(new FormatObj(numFormat_Text,"0"));for(var i=0,length=nNumberLen;i<length;++i)aRes.push(new FormatObj(numFormat_Text,sNumber[i]));for(var i=nNumberLen+nStartNulls;i< nFormatLen;++i){var item=format[i];aRes.push(new FormatObj(item.type))}}return aRes},_AddDigItem:function(res,oCurText,item){if(numFormat_Text==item.type)oCurText.text+=item.val;else if(numFormat_Digit==item.type){oCurText.text+="0";if(null!=item.val)oCurText.text+=item.val}else if(numFormat_DigitNoDisp==item.type){oCurText.text+="";if(null!=item.val)oCurText.text+=item.val}else if(numFormat_DigitSpace==item.type||numFormat_DigitDrop==item.type){var oNewFont=new AscCommonExcel.Font;oNewFont.skip= true;this._CommitText(res,oCurText,"0",oNewFont);if(null!=item.val)oCurText.text+=item.val}},_ZeroPad:function(n){return n<10?"0"+n:n},_CommitText:function(res,oCurText,textVal,format){if(null!=oCurText&&oCurText.text.length>0){this._CommitText(res,null,oCurText.text,null);oCurText.text=""}if(null!=textVal&&textVal.length>0){var length=res.length;var prev=null;if(length>0)prev=res[length-1];if(-1!=this.Color){if(null==format)format=new AscCommonExcel.Font;format.c=new AscCommonExcel.RgbColor(this.Color)}if(null!= prev&&(null==prev.format&&null==format||null!=prev.format&&null!=format&&format.isEqual(prev.format)))prev.text+=textVal;else{if(null==format)prev={text:textVal};else prev={text:textVal,format:format};res.push(prev)}}},setFormat:function(format,cultureInfo,formatType,useLocaleFormat){if(null==cultureInfo)cultureInfo=g_oDefaultCultureInfo;this.formatString=format;this.length=this.formatString.length;if(NumFormatType.WordFieldDate===formatType)this.valid=this._parseFormatWordDateTime();else if(NumFormatType.WordFieldNumeric=== formatType)this.valid=this._parseFormatWordNumeric("#");else this.valid=this._parseFormat("?",useLocaleFormat);if(true==this.valid){this.valid=this._prepareFormat();if(this.valid){var aCurrencySymbols=["$","\u20ac","\u00a3","\u00a5","\u0440.",cultureInfo.CurrencySymbol];var sText="";for(var i=0,length=this.aRawFormat.length;i<length;++i){var item=this.aRawFormat[i];if(numFormat_Text==item.type)sText+=item.val;else if(numFormat_Bracket==item.type){if(null!=item.CurrencyString){this.bCurrency=true; sText+=item.CurrencyString}if(null!=item.Lid)this.LCID=parseInt(item.Lid,16)&65535}else if(numFormat_DecimalPoint==item.type)sText+=gc_sFormatDecimalPoint;else if(numFormat_DecimalPointText==item.type)sText+=gc_sFormatDecimalPoint}if(""!=sText)for(var i=0,length=aCurrencySymbols.length;i<length;++i)if(-1!=sText.indexOf(aCurrencySymbols[i])){this.bCurrency=true;break}}}return this.valid},isInvalidDateValue:function(number){return number==number-0&&(number<0&&!AscCommon.bDate1904||number>2958465.9999884)}, _applyGeneralFormat:function(number,nValType,dDigitsCount,bChart,cultureInfo){var res=null;var sGeneral=DecodeGeneralFormat(number,nValType,dDigitsCount);if(null!=sGeneral){var numFormat=oNumFormatCache.get(sGeneral);if(null!=numFormat)res=numFormat.format(number,nValType,dDigitsCount,bChart,cultureInfo,true)}if(!res)res=[{text:number.toString()}];if(-1!=this.Color)for(var i=0;i<res.length;++i){var elem=res[i];if(null==elem.format)elem.format=new AscCommonExcel.Font;elem.format.c=new AscCommonExcel.RgbColor(this.Color)}return res}, _formatDecimalFrac:function(oParsedNumber){var forceNull=false;for(var i=0;i<this.aRawFormat.length;++i){var item=this.aRawFormat[i];if(numFormat_DecimalFrac==item.type){var frac=oParsedNumber.fraction;var numerator=0;var denominator=0;if(item.bNumRight===true){denominator=item.aRight[0].val;numerator=Math.round(denominator*frac)}else if(frac>0){var denominatorLen=Math.min(7,item.aRight.length);var denominatorBound=Math.pow(10,denominatorLen);var an=Math.floor(frac);var xn1=frac-an;var pn1=an;var qn1= 1;var pn2=1;var qn2=0;do{an=Math.floor(1/xn1);xn1=1/xn1-an;var pn=an*pn1+pn2;var qn=an*qn1+qn2;pn2=pn1;pn1=pn;qn2=qn1;qn1=qn}while(qn<denominatorBound);numerator=pn2;denominator=qn2}if(numerator<=0){numerator=0;if(this.bWhole===false){if(denominator<=0)denominator=1}else denominator=0}if(this.bWhole===false)numerator+=denominator*oParsedNumber.dec;else if(numerator===denominator&&0!==numerator){oParsedNumber.dec++;numerator=0;denominator=0}if(0===numerator&&0===denominator)forceNull=true;item.numerator= numerator;item.denominator=denominator}}return forceNull},format:function(number,nValType,dDigitsCount,cultureInfo,bChart,opt_forceNull){if(null==cultureInfo)cultureInfo=g_oDefaultCultureInfo;var cultureInfoLCID=cultureInfo;if(null!=this.LCID)cultureInfoLCID=g_aCultureInfos[this.LCID]||cultureInfo;if(null==nValType)nValType=CellValueType.Number;var res=[];var oCurText={text:""};if(true==this.valid){if(true===this.bDateTime)if(this.isInvalidDateValue(number)){var oNewFont=new AscCommonExcel.Font;oNewFont.repeat= true;this._CommitText(res,null,"#",oNewFont);return res}var oParsedNumber=this._parseNumber(number,this.aDecFormat,this.aFracFormat.length,nValType);if(true==this.isGeneral()||true==oParsedNumber.bDigit&&true==this.bTextFormat||false==oParsedNumber.bDigit&&false==this.bTextFormat||bChart&&this.bGeneralChart)return this._applyGeneralFormat(number,nValType,dDigitsCount,bChart,cultureInfo);var forceNull=!!opt_forceNull;if(this.bSlash)forceNull=this._formatDecimalFrac(oParsedNumber);var aDec=[];var aFrac= [];var aScientific=[];if(true==oParsedNumber.bDigit){aDec=this._FormatNumber(oParsedNumber.dec,oParsedNumber.exponent,this.aDecFormat.concat(),FormatStates.Decimal,cultureInfo,forceNull);aFrac=this._FormatNumber(oParsedNumber.frac,oParsedNumber.exponentFrac,this.aFracFormat.concat(),FormatStates.Frac,cultureInfo)}var bNoDecFormat=false;if((null==aDec||0==aDec.length)&&0!=oParsedNumber.dec)bNoDecFormat=true;var hasSign=false;var nReadState=FormatStates.Decimal;var nFormatLength=this.aRawFormat.length; for(var i=0;i<nFormatLength;++i){var item=this.aRawFormat[i];if(numFormat_Bracket==item.type){if(null!=item.CurrencyString)oCurText.text+=item.CurrencyString}else if(numFormat_DecimalPoint==item.type){if(bNoDecFormat&&null!=oParsedNumber.dec&&FormatStates.Decimal==nReadState)oCurText.text+=oParsedNumber.dec;oCurText.text+=cultureInfo.NumberDecimalSeparator;nReadState=FormatStates.Frac}else if(numFormat_DecimalPointText==item.type)oCurText.text+=cultureInfo.NumberDecimalSeparator;else if(numFormat_ThousandText== item.type)oCurText.text+=cultureInfo.NumberGroupSeparator;else if(this._isDigitType(item.type)){var text=null;if(nReadState==FormatStates.Decimal)text=aDec.shift();else if(nReadState==FormatStates.Frac)text=aFrac.shift();else if(nReadState==FormatStates.Scientific)text=aScientific.shift();if(null!=text)this._AddDigItem(res,oCurText,text)}else if(numFormat_Text==item.type)oCurText.text+=item.val;else if(numFormat_TextPlaceholder==item.type)oCurText.text+=number;else if(numFormat_Scientific==item.type){if(null!= item.format){oCurText.text+=item.val;if(oParsedNumber.scientific<0)oCurText.text+="-";else if(item.sign==SignType.Positive)oCurText.text+="+";aScientific=this._FormatNumber(Math.abs(oParsedNumber.scientific),0,item.format.concat(),FormatStates.Scientific,cultureInfo);nReadState=FormatStates.Scientific}}else if(numFormat_DecimalFrac==item.type){var curForceNull=this.bWhole===false;var aLeft=this._FormatNumber(item.numerator,0,item.aLeft.concat(),FormatStates.Slash,cultureInfo,curForceNull);for(var j= 0,length=aLeft.length;j<length;++j){var subitem=aLeft[j];if(subitem)this._AddDigItem(res,oCurText,subitem)}if(item.numerator>0&&item.denominator>0||curForceNull)oCurText.text+="/";else{var oNewFont=new AscCommonExcel.Font;oNewFont.skip=true;this._CommitText(res,oCurText,"/",oNewFont)}if(item.bNumRight===true){var rightVal=item.aRight[0].val;if(rightVal)if(item.denominator>0)oCurText.text+=rightVal;else for(var rightIdx=0;rightIdx<rightVal.toString().length;++rightIdx){var oNewFont=new AscCommonExcel.Font; oNewFont.skip=true;this._CommitText(res,oCurText,"0",oNewFont)}}else{var aRight=this._FormatNumber(item.denominator,0,item.aRight.concat(),FormatStates.SlashFrac,cultureInfo);for(var j=0,length=aRight.length;j<length;++j){var subitem=aRight[j];if(subitem)this._AddDigItem(res,oCurText,subitem)}}}else if(numFormat_Repeat==item.type){var oNewFont=new AscCommonExcel.Font;oNewFont.repeat=true;this._CommitText(res,oCurText,item.val,oNewFont)}else if(numFormat_Skip==item.type){var oNewFont=new AscCommonExcel.Font; oNewFont.skip=true;this._CommitText(res,oCurText,item.val,oNewFont)}else if(numFormat_DateSeparator==item.type)oCurText.text+=cultureInfo.DateSeparator;else if(numFormat_TimeSeparator==item.type)oCurText.text+=cultureInfo.TimeSeparator;else if(numFormat_Year==item.type){if(item.val>0)if(item.val<=2)oCurText.text+=(oParsedNumber.date.year+"").substring(2);else oCurText.text+=oParsedNumber.date.year}else if(numFormat_Month==item.type){var m=oParsedNumber.date.month;if(item.val==1)oCurText.text+=m+1; else if(item.val==2)oCurText.text+=this._ZeroPad(m+1);else if(item.val==3)if(this.bDay&&cultureInfoLCID.AbbreviatedMonthGenitiveNames.length>0)oCurText.text+=cultureInfoLCID.AbbreviatedMonthGenitiveNames[m];else oCurText.text+=cultureInfoLCID.AbbreviatedMonthNames[m];else if(item.val==5){var sMonthName=cultureInfoLCID.MonthNames[m];if(sMonthName.length>0)oCurText.text+=sMonthName[0]}else if(item.val>0)if(this.bDay&&cultureInfoLCID.MonthGenitiveNames.length>0)oCurText.text+=cultureInfoLCID.MonthGenitiveNames[m]; else oCurText.text+=cultureInfoLCID.MonthNames[m]}else if(numFormat_Day==item.type)if(item.val==1)oCurText.text+=oParsedNumber.date.d;else if(item.val==2)oCurText.text+=this._ZeroPad(oParsedNumber.date.d);else if(item.val==3)oCurText.text+=cultureInfoLCID.AbbreviatedDayNames[oParsedNumber.date.dayWeek];else{if(item.val>0)oCurText.text+=cultureInfoLCID.DayNames[oParsedNumber.date.dayWeek]}else if(numFormat_Hour==item.type){var h=oParsedNumber.date.hour;if(item.bElapsed===true)h=oParsedNumber.date.countDay* 24+oParsedNumber.date.hour;if(this.bTimePeriod===true)h=h%12||12;if(item.val==1)oCurText.text+=h;else if(item.val>0)oCurText.text+=this._ZeroPad(h)}else if(numFormat_Minute==item.type){var min=oParsedNumber.date.min;if(item.bElapsed===true)min=oParsedNumber.date.countDay*24*60+oParsedNumber.date.hour*60+oParsedNumber.date.min;if(item.val==1)oCurText.text+=min;else if(item.val>0)oCurText.text+=this._ZeroPad(min)}else if(numFormat_Second==item.type){var s=oParsedNumber.date.sec;if(this.bMillisec=== false)s=oParsedNumber.date.sec+Math.round(oParsedNumber.date.ms/1E3);if(item.bElapsed===true)s=oParsedNumber.date.countDay*24*60*60+oParsedNumber.date.hour*60*60+oParsedNumber.date.min*60+s;if(item.val==1)oCurText.text+=s;else if(item.val>0)oCurText.text+=this._ZeroPad(s)}else if(numFormat_AmPm==item.type)if(cultureInfoLCID.AMDesignator.length>0&&cultureInfoLCID.PMDesignator.length>0)oCurText.text+=oParsedNumber.date.hour<12?cultureInfoLCID.AMDesignator:cultureInfoLCID.PMDesignator;else oCurText.text+= oParsedNumber.date.hour<12?"AM":"PM";else if(numFormat_Milliseconds==item.type){var nMsFormatLength=item.format.length;var dMs=oParsedNumber.date.ms;if(nMsFormatLength<3){var dTemp=dMs/Math.pow(10,3-nMsFormatLength);dTemp=Math.round(dTemp);dMs=dTemp*Math.pow(10,3-nMsFormatLength)}var nExponent=0;if(0==dMs)nExponent=-1;else if(dMs<10)nExponent=-2;else if(dMs<100)nExponent=-1;var aMilSec=this._FormatNumber(dMs,nExponent,item.format.concat(),FormatStates.Frac,cultureInfo);for(var k=0;k<aMilSec.length;k++)this._AddDigItem(res, oCurText,aMilSec[k])}else if(numFormat_General==item.type){this._CommitText(res,oCurText,null,null);res=res.concat(this._applyGeneralFormat(Math.abs(number),nValType,dDigitsCount,bChart,cultureInfo))}else if(numFormat_Plus==item.type){hasSign=true;if(number>0)oCurText.text+="+";else if(number<0)oCurText.text+="-";else oCurText.text+=" "}else if(numFormat_Minus==item.type){hasSign=true;if(number<0)oCurText.text+="-";else oCurText.text+=" "}}if(true==this.bAddMinusIfNes&&SignType.Negative==oParsedNumber.sign&& !hasSign)res.unshift({text:"-"});this._CommitText(res,oCurText,null,null);if(0==res.length)res=[{text:""}]}else if(0==res.length)res=[{text:number.toString()}];var nLen=0;for(var i=0;i<res.length;++i){var elem=res[i];if(elem.text)nLen+=elem.text.length}if(nLen>Asc.c_oAscMaxColumnWidth){var oNewFont=new AscCommonExcel.Font;oNewFont.repeat=true;res=[{text:"#",format:oNewFont}]}return res},shiftFormat:function(output,nShift,useLocaleFormat){if(this.bDateTime||this.bSlash||this.bTextFormat||nShift<0&& 0==this.aFracFormat.length)return false;output.format=this.toString(nShift,useLocaleFormat);return true},toString:function(nShift,useLocaleFormat){var sGeneral;var DecimalSeparator;var GroupSeparator;var TimeSeparator;var year;var month;var day;var hour;var minute;var second;if(useLocaleFormat){sGeneral=LocaleFormatSymbol["general"];DecimalSeparator=g_oDefaultCultureInfo.NumberDecimalSeparator;TimeSeparator=g_oDefaultCultureInfo.TimeSeparator;GroupSeparator=g_oDefaultCultureInfo.NumberGroupSeparator; if(LocaleFormatSymbol["M"]===LocaleFormatSymbol["m"]){year=LocaleFormatSymbol["Y"];month=LocaleFormatSymbol["M"];day=LocaleFormatSymbol["D"]}else{year=LocaleFormatSymbol["y"];month=LocaleFormatSymbol["m"];day=LocaleFormatSymbol["d"]}hour=LocaleFormatSymbol["h"];minute=LocaleFormatSymbol["minute"];second=LocaleFormatSymbol["s"]}else{sGeneral=AscCommon.g_cGeneralFormat;DecimalSeparator=gc_sFormatDecimalPoint;TimeSeparator=":";GroupSeparator=gc_sFormatThousandSeparator;year="y";month="m";day="d";hour= "h";minute="m";second="s"}var nDecLength=this.aDecFormat.length;var nDecIndex=0;var nFracLength=this.aFracFormat.length;var nFracIndex=0;var nNewFracLength=nFracLength+nShift;if(nNewFracLength<0)nNewFracLength=0;var nReadState=FormatStates.Decimal;var res="";var fFormatToString=function(aFormat){var res="";for(var i=0,length=aFormat.length;i<length;++i){var item=aFormat[i];if(numFormat_Digit==item.type)if(null!=item.val)res+=item.val;else res+="0";else if(numFormat_DigitNoDisp==item.type)res+="#"; else if(numFormat_DigitSpace==item.type)res+="?";else if(numFormat_DigitDrop==item.type)res+="x"}return res};if(null!=this.Color)switch(this.Color){case 0:res+="[Black]";break;case 255:res+="[Blue]";break;case 65535:res+="[Cyan]";break;case 65280:res+="[Green]";break;case 16711935:res+="[Magenta]";break;case 16711680:res+="[Red]";break;case 16777215:res+="[White]";break;case 16776960:res+="[Yellow]";break}if(null!=this.ComporationOperator)switch(this.ComporationOperator.operator){case NumComporationOperators.equal:res+= "[="+this.ComporationOperator.operatorValue+"]";break;case NumComporationOperators.greater:res+="[>"+this.ComporationOperator.operatorValue+"]";break;case NumComporationOperators.less:res+="[<"+this.ComporationOperator.operatorValue+"]";break;case NumComporationOperators.greaterorequal:res+="[>="+this.ComporationOperator.operatorValue+"]";break;case NumComporationOperators.lessorequal:res+="[<="+this.ComporationOperator.operatorValue+"]";break;case NumComporationOperators.notequal:res+="[<>"+this.ComporationOperator.operatorValue+ "]";break}var nFormatLength=this.aRawFormat.length;for(var i=0;i<nFormatLength;++i){var item=this.aRawFormat[i];if(numFormat_Bracket==item.type){if(null!=item.CurrencyString||null!=item.Lid){res+="[$";if(null!=item.CurrencyString)res+=item.CurrencyString;if(null!=item.Lid){res+="-";res+=item.Lid}res+="]"}}else if(numFormat_DecimalPoint==item.type){nReadState=FormatStates.Frac;if(0!=nNewFracLength)res+=DecimalSeparator}else if(numFormat_DecimalPointText==item.type)res+=DecimalSeparator;else if(numFormat_Thousand== item.type||numFormat_ThousandText==item.type)for(var j=0;j<item.val;++j)res+=GroupSeparator;else if(this._isDigitType(item.type)){if(FormatStates.Decimal==nReadState)nDecIndex++;else nFracIndex++;if(nReadState==FormatStates.Frac&&nFracIndex>nNewFracLength);else{var sCurSimbol;if(numFormat_Digit==item.type)sCurSimbol="0";else if(numFormat_DigitNoDisp==item.type)sCurSimbol="#";else if(numFormat_DigitSpace==item.type)sCurSimbol="?";else if(numFormat_DigitDrop==item.type)sCurSimbol="x";res+=sCurSimbol; if(nReadState==FormatStates.Frac&&nFracIndex==nFracLength)for(var j=0;j<nShift;++j)res+=sCurSimbol}if(0==nFracLength&&nShift>0&&FormatStates.Decimal==nReadState&&nDecIndex==nDecLength){res+=gc_sFormatDecimalPoint;for(var j=0;j<nShift;++j)res+="0"}}else if(numFormat_Text==item.type)if("%"==item.val)res+=item.val;else res+='"'+item.val+'"';else if(numFormat_TextPlaceholder==item.type)res+="@";else if(numFormat_Scientific==item.type){nReadState=FormatStates.Scientific;res+=item.val;if(item.sign==SignType.Positive)res+= "+";else res+="-"}else if(numFormat_DecimalFrac==item.type){res+=fFormatToString(item.aLeft);res+="/";res+=fFormatToString(item.aRight)}else if(numFormat_Repeat==item.type)res+="*"+item.val;else if(numFormat_Skip==item.type)res+="_"+item.val;else if(numFormat_DateSeparator==item.type)res+="/";else if(numFormat_TimeSeparator==item.type)res+=TimeSeparator;else if(numFormat_Year==item.type)for(var j=0;j<item.val;++j)res+=year;else if(numFormat_Month==item.type)for(var j=0;j<item.val;++j)res+=month;else if(numFormat_Day== item.type)for(var j=0;j<item.val;++j)res+=day;else if(numFormat_Hour==item.type)for(var j=0;j<item.val;++j)res+=hour;else if(numFormat_Minute==item.type)for(var j=0;j<item.val;++j)res+=minute;else if(numFormat_Second==item.type)for(var j=0;j<item.val;++j)res+=second;else if(numFormat_AmPm==item.type)res+="AM/PM";else if(numFormat_Milliseconds==item.type)res+=fFormatToString(item.format);else if(numFormat_Plus==item.type)res+="+";else if(numFormat_Minus==item.type)res+="-";else if(numFormat_General== item.type)res+=sGeneral}return res},getFormatCellsInfo:function(){var info=new Asc.asc_CFormatCellsInfo;info.asc_setDecimalPlaces(this.aFracFormat.length);info.asc_setSeparator(this.bThousandSep);info.asc_setSymbol(this.LCID);return info},isGeneral:function(){return 1==this.aRawFormat.length&&numFormat_General==this.aRawFormat[0].type}};function NumFormatCache(){this.oNumFormats={}}NumFormatCache.prototype={cleanCache:function(){this.oNumFormats={}},get:function(format,formatType){var key=format+ String.fromCharCode(5)+formatType;var res=this.oNumFormats[key];if(null==res){res=new CellFormat(format,formatType,false);this.oNumFormats[key]=res}return res}};var oNumFormatCache=new NumFormatCache;function CellFormat(format,formatType,useLocaleFormat){this.sFormat=format;this.oPositiveFormat=null;this.oNegativeFormat=null;this.oNullFormat=null;this.oTextFormat=null;this.aComporationFormats=null;var aFormats=format.split(";");var aParsedFormats=[];for(var i=0;i<aFormats.length;++i){var sNewFormat= aFormats[i];while(true){var formatTail=sNewFormat.match(/\\+$/g);if(formatTail&&formatTail.length>0&&1===formatTail[0].length%2&&i+1<aFormats.length){sNewFormat+=";";sNewFormat+=aFormats[++i]}else break}var oNewFormat=new NumFormat(false);oNewFormat.setFormat(sNewFormat,undefined,formatType,useLocaleFormat);aParsedFormats.push(oNewFormat)}var nFormatsLength=aParsedFormats.length;var bComporationOperator=false;if(nFormatsLength>0){var oFirstFormat=aParsedFormats[0];if(null!=oFirstFormat.ComporationOperator){bComporationOperator= true;if(3==nFormatsLength){var oPositive=null;var oNegative=null;var oNull=null;for(var i=0;i<nFormatsLength;++i){var oCurFormat=aParsedFormats[i];if(null==oCurFormat.ComporationOperator)if(null==oPositive)oPositive=oCurFormat;else if(null==oNegative)oNegative=oCurFormat;else{if(null==oNull)oNull=oCurFormat}else{var oComporationOperator=oCurFormat.ComporationOperator;if(0==oComporationOperator.operatorValue)switch(oComporationOperator.operator){case NumComporationOperators.greater:oPositive=oCurFormat; break;case NumComporationOperators.less:oNegative=oCurFormat;break;case NumComporationOperators.equal:oNull=oCurFormat;break}else{oPositive=oNegative=oNull=null;break}}}}this.oTextFormat=new NumFormat(false);this.oTextFormat.setFormat("@",undefined,undefined,useLocaleFormat);if(null==oPositive||null==oNegative||null==oNull){for(var i=0,length=aParsedFormats.length;i<length;++i){var oCurFormat=aParsedFormats[i];if(null==oCurFormat.ComporationOperator)oCurFormat.bAddMinusIfNes=true;else{var oComporationOperator= oCurFormat.ComporationOperator;if(0<oComporationOperator.operatorValue&&(oComporationOperator.operator==NumComporationOperators.less||oComporationOperator.operator==NumComporationOperators.lessorequal))oCurFormat.bAddMinusIfNes=true;else if(0>oComporationOperator.operatorValue&&(oComporationOperator.operator==NumComporationOperators.greater||oComporationOperator.operator==NumComporationOperators.greaterorequal))oCurFormat.bAddMinusIfNes=true}}this.aComporationFormats=aParsedFormats}else{this.oPositiveFormat= oPositive;this.oNegativeFormat=oNegative;this.oNullFormat=oNull}}}if(false==bComporationOperator)if(4<=nFormatsLength){this.oPositiveFormat=aParsedFormats[0];this.oNegativeFormat=aParsedFormats[1];this.oNullFormat=aParsedFormats[2];this.oTextFormat=aParsedFormats[3];this.oTextFormat.bTextFormat=true}else if(3==nFormatsLength){this.oPositiveFormat=aParsedFormats[0];this.oNegativeFormat=aParsedFormats[1];this.oNullFormat=aParsedFormats[2];this.oTextFormat=this.oPositiveFormat;if(this.oNullFormat.bTextFormat){this.oTextFormat= this.oNullFormat;this.oNullFormat=this.oPositiveFormat}}else if(2==nFormatsLength){this.oPositiveFormat=aParsedFormats[0];this.oNegativeFormat=aParsedFormats[1];this.oNullFormat=this.oPositiveFormat;this.oTextFormat=this.oPositiveFormat;if(this.oNegativeFormat.bTextFormat){this.oTextFormat=this.oNegativeFormat;this.oNegativeFormat=this.oPositiveFormat;this.oPositiveFormat.bAddMinusIfNes=true}}else{this.oPositiveFormat=aParsedFormats[0];this.oPositiveFormat.bAddMinusIfNes=true;this.oNegativeFormat= this.oPositiveFormat;this.oNullFormat=this.oPositiveFormat;this.oTextFormat=this.oPositiveFormat}this.formatCache={}}CellFormat.prototype={isTextFormat:function(){if(null!=this.oPositiveFormat)return this.oPositiveFormat.bTextFormat;else if(null!=this.aComporationFormats&&this.aComporationFormats.length>0)return this.aComporationFormats[0].bTextFormat;return false},isGeneralFormat:function(){if(null!=this.oPositiveFormat)return this.oPositiveFormat.isGeneral();else if(null!=this.aComporationFormats&& this.aComporationFormats.length>0)return this.aComporationFormats[0].isGeneral();return false},isDateTimeFormat:function(){if(null!=this.oPositiveFormat)return this.oPositiveFormat.bDateTime;else if(null!=this.aComporationFormats&&this.aComporationFormats.length>0)return this.aComporationFormats[0].bDateTime;return false},getTextFormat:function(){var oRes=null;if(null==this.aComporationFormats){if(null!=this.oTextFormat&&this.oTextFormat.bTextFormat)oRes=this.oTextFormat}else for(var i=0,length=this.aComporationFormats.length;i< length;++i){var oCurFormat=this.aComporationFormats[i];if(null==oCurFormat.ComporationOperator&&oCurFormat.bTextFormat){oRes=oCurFormat;break}}return oRes},getFormatByValue:function(dNumber){var oRes=null;if(null==this.aComporationFormats)if(dNumber>0&&null!=this.oPositiveFormat)oRes=this.oPositiveFormat;else if(dNumber<0&&null!=this.oNegativeFormat)oRes=this.oNegativeFormat;else{if(null!=this.oNullFormat)oRes=this.oNullFormat}else{var nLength=this.aComporationFormats.length;var oDefaultComporationFormat= null;for(var i=0,length=nLength;i<length;++i){var oCurFormat=this.aComporationFormats[i];if(null!=oCurFormat.ComporationOperator){var bOperationResult=false;var oOperationValue=oCurFormat.ComporationOperator.operatorValue;switch(oCurFormat.ComporationOperator.operator){case NumComporationOperators.equal:bOperationResult=dNumber==oOperationValue;break;case NumComporationOperators.greater:bOperationResult=dNumber>oOperationValue;break;case NumComporationOperators.less:bOperationResult=dNumber<oOperationValue; break;case NumComporationOperators.greaterorequal:bOperationResult=dNumber>=oOperationValue;break;case NumComporationOperators.lessorequal:bOperationResult=dNumber<=oOperationValue;break;case NumComporationOperators.notequal:bOperationResult=dNumber!=oOperationValue;break}if(true==bOperationResult)oRes=oCurFormat}else if(null==oDefaultComporationFormat)oDefaultComporationFormat=oCurFormat}if(null==oRes&&null!=oDefaultComporationFormat)oRes=oDefaultComporationFormat}return oRes},format:function(number, nValType,dDigitsCount,bChart,cultureInfo,opt_withoutCache,opt_forceNull){var res=null;if(null==bChart)bChart=false;var lcid=cultureInfo?cultureInfo.LCID:0;var cacheKey,cacheVal;if(!opt_withoutCache){cacheKey=number+"-"+nValType+"-"+dDigitsCount+"-"+lcid;cacheVal=this.formatCache[cacheKey];if(null!=cacheVal){if(bChart)res=cacheVal.chart;else res=cacheVal.nochart;if(null!=res)return res}}res=[{text:number.toString()}];var dNumber=number-0;var oFormat=null;if(CellValueType.String!=nValType&&number== dNumber){oFormat=this.getFormatByValue(dNumber);if(null!=oFormat)res=oFormat.format(number,nValType,dDigitsCount,cultureInfo,bChart,opt_forceNull);else if(null!=this.aComporationFormats){var oNewFont=new AscCommonExcel.Font;oNewFont.repeat=true;res=[{text:"#",format:oNewFont}]}}else if(null!=this.oTextFormat){oFormat=this.oTextFormat;res=oFormat.format(number,nValType,dDigitsCount,cultureInfo,bChart,opt_forceNull)}if(!opt_withoutCache){if(null==cacheVal){cacheVal={chart:null,nochart:null};this.formatCache[cacheKey]= cacheVal}if(null!=oFormat&&oFormat.bGeneralChart)if(bChart)cacheVal.chart=res;else cacheVal.nochart=res;else{cacheVal.chart=res;cacheVal.nochart=res}}return res},shiftFormat:function(output,nShift,useLocaleFormat){var bRes=false;var bCurRes=true;if(null==this.aComporationFormats){bCurRes=this.oPositiveFormat.shiftFormat(output,nShift,useLocaleFormat);if(false==bCurRes)output.format=this.oPositiveFormat.formatString;bRes|=bCurRes;if(null!=this.oNegativeFormat&&this.oPositiveFormat!=this.oNegativeFormat){var oTempOutput= {};bCurRes=this.oNegativeFormat.shiftFormat(oTempOutput,nShift,useLocaleFormat);if(false==bCurRes)output.format+=";"+this.oNegativeFormat.formatString;else output.format+=";"+oTempOutput.format;bRes|=bCurRes}if(null!=this.oNullFormat&&this.oPositiveFormat!=this.oNullFormat){var oTempOutput={};bCurRes=this.oNullFormat.shiftFormat(oTempOutput,nShift,useLocaleFormat);if(false==bCurRes)output.format+=";"+this.oNullFormat.formatString;else output.format+=";"+oTempOutput.format;bRes|=bCurRes}if(null!=this.oTextFormat&& this.oPositiveFormat!=this.oTextFormat){var oTempOutput={};bCurRes=this.oTextFormat.shiftFormat(oTempOutput,nShift,useLocaleFormat);if(false==bCurRes)output.format+=";"+this.oTextFormat.formatString;else output.format+=";"+oTempOutput.format;bRes|=bCurRes}}else{var length=this.aComporationFormats.length;output.format="";for(var i=0;i<length;++i){var oTempOutput={};var oCurFormat=this.aComporationFormats[i];var bCurRes=oCurFormat.shiftFormat(oTempOutput,nShift,useLocaleFormat);if(0!=i)output.format+= ";";if(false==bCurRes)output.format+=oCurFormat.formatString;else output.format+=oTempOutput.format;bRes|=bCurRes}}return bRes},toString:function(nShift,useLocaleFormat){var res="";if(null==this.aComporationFormats){res+=this.oPositiveFormat.toString(nShift,useLocaleFormat);if(null!=this.oNegativeFormat&&this.oPositiveFormat!=this.oNegativeFormat)res+=";"+this.oNegativeFormat.toString(nShift,useLocaleFormat);if(null!=this.oNullFormat&&this.oPositiveFormat!=this.oNullFormat)res+=";"+this.oNullFormat.toString(nShift, useLocaleFormat);if(null!=this.oTextFormat&&this.oPositiveFormat!=this.oTextFormat)res+=";"+this.oTextFormat.toString(nShift,useLocaleFormat)}else{var length=this.aComporationFormats.length;for(var i=0;i<length;++i){var oCurFormat=this.aComporationFormats[i];if(0!=i)res+=";";else res+=oCurFormat.toString(nShift,useLocaleFormat)}}return res},formatToMathInfo:function(number,nValType,dDigitsCount){return this._formatToText(number,nValType,dDigitsCount,false)},formatToChart:function(number,dDigitsCount, cultureInfo){return this._formatToText(number,CellValueType.Number,dDigitsCount||gc_nMaxDigCount,true,cultureInfo)},formatToWord:function(number,dDigitsCount,cultureInfo){return this._formatToText(number,CellValueType.Number,dDigitsCount||gc_nMaxDigCount,false,cultureInfo,true)},_formatToText:function(number,nValType,dDigitsCount,bChart,cultureInfo,opt_forceNull){var result="";var arrFormat=this.format(number,nValType,dDigitsCount,bChart,cultureInfo,undefined,opt_forceNull);for(var i=0,item;i<arrFormat.length;++i){item= arrFormat[i];if(item.format){if(item.format.repeat)continue;if(item.format.skip){result+=" ";continue}}if(item.text)result+=item.text}return result},getType:function(){return this.getTypeInfo().type},getTypeInfo:function(){var info;if(null!=this.oPositiveFormat){info=this.oPositiveFormat.getFormatCellsInfo();info.asc_setType(this._getType(this.oPositiveFormat))}else if(null!=this.aComporationFormats&&this.aComporationFormats.length>0){info=this.aComporationFormats[0].getFormatCellsInfo();info.asc_setType(this._getType(this.aComporationFormats[0]))}else{info= new Asc.asc_CFormatCellsInfo;info.asc_setType(c_oAscNumFormatType.General);info.asc_setDecimalPlaces(0);info.asc_setSeparator(false);info.asc_setSymbol(null)}return info},_getType:function(format){var nType=c_oAscNumFormatType.Custom;if(format.isGeneral())nType=c_oAscNumFormatType.General;else if(format.bDateTime)if(format.bDate)nType=c_oAscNumFormatType.Date;else nType=c_oAscNumFormatType.Time;else if(format.bCurrency)if(format.bRepeat)nType=c_oAscNumFormatType.Accounting;else nType=c_oAscNumFormatType.Currency; else{var info=format.getFormatCellsInfo();var types=[c_oAscNumFormatType.Text,c_oAscNumFormatType.Percent,c_oAscNumFormatType.Scientific,c_oAscNumFormatType.Number,c_oAscNumFormatType.Fraction,c_oAscNumFormatType.Currency,c_oAscNumFormatType.Accounting];for(var i=0;i<types.length;++i){var type=types[i];info.asc_setType(type);var formats=getFormatCells(info);if(-1!=formats.indexOf(this.sFormat)){nType=type;break}}}return nType},checkCultureInfoFontPicker:function(){if(null!==this.sFormat)AscFonts.FontPickerByCharacter.getFontsByString(this.sFormat); if(null!==this.oPositiveFormat&&null!==this.oPositiveFormat.LCID)checkCultureInfoFontPicker(this.oPositiveFormat.LCID);if(null!==this.oNegativeFormat&&null!==this.oNegativeFormat.LCID)checkCultureInfoFontPicker(this.oNegativeFormat.LCID);if(null!==this.oNullFormat&&null!==this.oNullFormat.LCID)checkCultureInfoFontPicker(this.oNullFormat.LCID);if(null!==this.oTextFormat&&null!==this.oTextFormat.LCID)checkCultureInfoFontPicker(this.oTextFormat.LCID);if(this.aComporationFormats)for(var i=0,length=this.aComporationFormats.length;i< length;++i){var oCurFormat=this.aComporationFormats[i];if(null!==oCurFormat.LCID)checkCultureInfoFontPicker(oCurFormat.LCID)}}};var oDecodeGeneralFormatCache={};function DecodeGeneralFormat(val,nValType,dDigitsCount){var cacheVal=oDecodeGeneralFormatCache[val];if(null!=cacheVal){cacheVal=cacheVal[nValType];if(null!=cacheVal){cacheVal=cacheVal[dDigitsCount];if(null!=cacheVal)return cacheVal}}var res=DecodeGeneralFormat_Raw(val,nValType,dDigitsCount);var cacheVal=oDecodeGeneralFormatCache[val];if(null== cacheVal){cacheVal={};oDecodeGeneralFormatCache[val]=cacheVal}var cacheType=cacheVal[nValType];if(null==cacheType){cacheType={};cacheVal[nValType]=cacheType}cacheType[dDigitsCount]=res;return res}function DecodeGeneralFormat_Raw(val,nValType,dDigitsCount){if(CellValueType.String==nValType)return"@";var number=val-0;if(number!=val)return"@";if(0==number)return"0";var nDigitsCount;if(null==dDigitsCount||dDigitsCount>gc_nMaxDigCountView)nDigitsCount=gc_nMaxDigCountView;else nDigitsCount=parseInt(dDigitsCount); if(number<0)number=-number;if(nDigitsCount<1)return"0";var bContinue=true;var parts=getNumberParts(number);while(bContinue){bContinue=false;var nRealExp=gc_nMaxDigCount+parts.exponent;var nRealExpAbs=Math.abs(nRealExp);var nExpMinDigitsCount;if(nRealExpAbs<100)nExpMinDigitsCount=4;else nExpMinDigitsCount=2+nRealExpAbs.toString().length;var suffix="";if(nRealExp>0){if(nRealExp>nDigitsCount)if(nDigitsCount>=nExpMinDigitsCount+1){suffix="E+";for(var i=2;i<nExpMinDigitsCount;++i)suffix+="0";nDigitsCount-= nExpMinDigitsCount}else return"0"}else{var nVarian1=nDigitsCount-2+nRealExp;var nVarian2=nDigitsCount-nExpMinDigitsCount;if(nVarian2>2)nVarian2--;else if(nVarian2>0)nVarian2=1;if(nVarian1<=0&&nVarian2<=0)return"0";if(nVarian1<nVarian2){var bUseVarian1=false;if(nVarian1>0&&0==parts.mantissa%Math.pow(10,gc_nMaxDigCount-nVarian1))bUseVarian1=true;if(false==bUseVarian1)if(nDigitsCount>=nExpMinDigitsCount+1){suffix="E+";for(var i=2;i<nExpMinDigitsCount;++i)suffix+="0";nDigitsCount-=nExpMinDigitsCount}else return"0"}}var dec_num_digits= nRealExp;if(suffix)dec_num_digits=1;var nRoundDigCount=0;if(dec_num_digits<=0){var nTemp=nDigitsCount+dec_num_digits-2;if(nTemp>0)nRoundDigCount=nTemp}else if(dec_num_digits<gc_nMaxDigCount)if(dec_num_digits<=nDigitsCount)if(dec_num_digits+1<nDigitsCount)nRoundDigCount=nDigitsCount-1;else nRoundDigCount=dec_num_digits;if(nRoundDigCount>0){var nTemp=Math.pow(10,gc_nMaxDigCount-nRoundDigCount);number=Math.round(parts.mantissa/nTemp)*nTemp*Math.pow(10,parts.exponent);var oNewParts=getNumberParts(number); if(oNewParts.exponent!=parts.exponent)bContinue=true;else bContinue=false;parts=oNewParts}}var frac_num_digits;if(dec_num_digits>0)frac_num_digits=nDigitsCount-1-dec_num_digits;else frac_num_digits=nDigitsCount-2+dec_num_digits;if(frac_num_digits>0){var sTempNumber=parts.mantissa.toString();var sTempNumber;if(dec_num_digits>0)sTempNumber=sTempNumber.substring(dec_num_digits,dec_num_digits+frac_num_digits);else sTempNumber=sTempNumber.substring(0,frac_num_digits);var nTempNumberLength=sTempNumber.length; var nreal_frac_num_digits=frac_num_digits;for(var i=frac_num_digits-1;i>=0;--i)if("0"==sTempNumber[i])nreal_frac_num_digits--;else break;frac_num_digits=nreal_frac_num_digits;if(dec_num_digits<0)frac_num_digits+=-dec_num_digits}if(frac_num_digits<=0)return"0"+suffix;var number_format_string="0"+gc_sFormatDecimalPoint;for(var i=0;i<frac_num_digits;++i)number_format_string+="0";number_format_string+=suffix;return number_format_string}function GeneralEditFormatCache(){this.oCache={}}GeneralEditFormatCache.prototype= {cleanCache:function(){this.oCache={}},format:function(number,cultureInfo){if(null==cultureInfo)cultureInfo=g_oDefaultCultureInfo;var value=this.oCache[number];if(null==value){if(0==number)value="0";else{var sRes="";var parts=getNumberParts(number);var nRealExp=gc_nMaxDigCount+parts.exponent;if(parts.exponent>=0)if(nRealExp<=21){sRes=parts.mantissa.toString();for(var i=0;i<parts.exponent;++i)sRes+="0"}else{sRes=this._removeTileZeros(parts.mantissa.toString(),cultureInfo);if(sRes.length>1){var temp= sRes.substring(0,1);temp+=cultureInfo.NumberDecimalSeparator;temp+=sRes.substring(1);sRes=temp}sRes+="E+"+(nRealExp-1)}else if(nRealExp>0){sRes=parts.mantissa.toString();if(sRes.length>nRealExp){var temp=sRes.substring(0,nRealExp);temp+=cultureInfo.NumberDecimalSeparator;temp+=sRes.substring(nRealExp);sRes=temp}sRes=this._removeTileZeros(sRes,cultureInfo)}else if(nRealExp>=-18){sRes="0";sRes+=cultureInfo.NumberDecimalSeparator;for(var i=0;i<-nRealExp;++i)sRes+="0";var sTemp=parts.mantissa.toString(); sTemp=sTemp.substring(0,19+nRealExp);sRes+=this._removeTileZeros(sTemp,cultureInfo)}else{sRes=parts.mantissa.toString();if(sRes.length>1){var temp=sRes.substring(0,1);temp+=cultureInfo.NumberDecimalSeparator;temp+=sRes.substring(1);temp=this._removeTileZeros(temp,cultureInfo);sRes=temp}sRes+="E-"+(1-nRealExp)}if(SignType.Negative==parts.sign)value="-"+sRes;else value=sRes}this.oCache[number]=value}return value},_removeTileZeros:function(val,cultureInfo){var res=val;var nLength=val.length;var nLastNoZero= nLength-1;for(var i=val.length-1;i>=0;--i){nLastNoZero=i;if("0"!=val[i])break}if(nLastNoZero!=nLength-1)if(cultureInfo.NumberDecimalSeparator==res[nLastNoZero])res=res.substring(0,nLastNoZero);else res=res.substring(0,nLastNoZero+1);return res}};var oGeneralEditFormatCache=new GeneralEditFormatCache;function FormatParser(){this.days=[31,28,31,30,31,30,31,31,30,31,30,31];this.daysLeap=[31,29,31,30,31,30,31,31,30,31,30,31]}FormatParser.prototype={isLocaleNumber:function(val,cultureInfo){if(null==cultureInfo)cultureInfo= g_oDefaultCultureInfo;if("."!=cultureInfo.NumberDecimalSeparator){val=val.replace(".","q");val=val.replace(cultureInfo.NumberDecimalSeparator,".")}return AscCommonExcel.parseNum(val)&&Asc.isNumberInfinity(val)},parseLocaleNumber:function(val,cultureInfo){if(null==cultureInfo)cultureInfo=g_oDefaultCultureInfo;if("."!=cultureInfo.NumberDecimalSeparator){val=val.replace(".","q");val=val.replace(cultureInfo.NumberDecimalSeparator,".")}return val-0},parse:function(value,cultureInfo){if(null==cultureInfo)cultureInfo= g_oDefaultCultureInfo;var res=null;var bError=false;if(" "==cultureInfo.NumberGroupSeparator)value=value.replace(new RegExp(String.fromCharCode(160),"g"));var rx_thouthand=new RegExp("^(([ \\+\\-%\\$\u20ac\u00a3\u00a5\\(]|"+escapeRegExp(cultureInfo.CurrencySymbol)+")*)((\\d+"+escapeRegExp(cultureInfo.NumberGroupSeparator)+"\\d+)*\\d*"+escapeRegExp(cultureInfo.NumberDecimalSeparator)+"?\\d*)(([ %\\)]|\u0440.|"+escapeRegExp(cultureInfo.CurrencySymbol)+")*)$");var match=value.match(rx_thouthand);if(null!= match){var sBefore=match[1];var sVal=match[3];var sAfter=match[5];var oChartCount={};if(null!=sBefore)this._parseStringLetters(sBefore,cultureInfo.CurrencySymbol,true,oChartCount);if(null!=sAfter)this._parseStringLetters(sAfter,cultureInfo.CurrencySymbol,false,oChartCount);var bMinus=false;var bPercent=false;var sCurrency=null;var oCurrencyElem=null;var nBracket=0;for(var sChar in oChartCount){var elem=oChartCount[sChar];if(" "==sChar)continue;else if("+"==sChar){if(elem.all>1)bError=true}else if("-"== sChar)if(elem.all>1)bError=true;else bMinus=true;else if("-"==sChar)if(elem.all>1)bError=true;else bMinus=true;else if("("==sChar)if(1==elem.all&&1==elem.before)nBracket++;else bError=true;else if(")"==sChar)if(1==elem.all&&1==elem.after)nBracket++;else bError=true;else if("%"==sChar)if(1==elem.all)bPercent=true;else bError=true;else if(null==sCurrency&&1==elem.all){sCurrency=sChar;oCurrencyElem=elem}else bError=true}if(nBracket>0)if(2==nBracket)bMinus=true;else bError=true;var CurrencyNegativePattern= cultureInfo.CurrencyNegativePattern;if(null!=sCurrency)if(sCurrency==cultureInfo.CurrencySymbol){var nPattern=cultureInfo.CurrencyNegativePattern;if(0==nPattern||1==nPattern||2==nPattern||3==nPattern||9==nPattern||11==nPattern||12==nPattern||14==nPattern){if(1!=oCurrencyElem.before)bError=true}else if(1!=oCurrencyElem.after)bError=true}else if(-1!="$\u20ac\u00a3\u00a5".indexOf(sCurrency))if(1==oCurrencyElem.before)CurrencyNegativePattern=0;else bError=true;else if(-1!="\u0440.".indexOf(sCurrency))if(1== oCurrencyElem.after)CurrencyNegativePattern=5;else bError=true;else bError=true;if(!bError){var oVal=this._parseThouthand(sVal,cultureInfo);if(oVal){res={format:null,value:null,bDateTime:false,bDate:false,bTime:false,bPercent:false,bCurrency:false};var dVal=oVal.number;if(bMinus)dVal=-dVal;var sFracFormat="";if(parseInt(dVal)!=dVal)sFracFormat=gc_sFormatDecimalPoint+"00";var sFormat=null;if(bPercent){res.bPercent=true;dVal/=100;sFormat="0"+sFracFormat+"%"}else if(sCurrency){res.bCurrency=true;var sNumberFormat= "#"+gc_sFormatThousandSeparator+"##0"+sFracFormat;var sCurrencyFormat;if(sCurrency.length>1)sCurrencyFormat='"'+sCurrency+'"';else sCurrencyFormat="\\"+sCurrency;var sPositivePattern;var sNegativePattern;switch(CurrencyNegativePattern){case 0:sPositivePattern=sCurrencyFormat+sNumberFormat+"_)";sNegativePattern="[Red]("+sCurrencyFormat+sNumberFormat+")";break;case 1:sPositivePattern=sCurrencyFormat+sNumberFormat;sNegativePattern="[Red]-"+sCurrencyFormat+sNumberFormat;break;case 2:sPositivePattern= sCurrencyFormat+sNumberFormat;sNegativePattern="[Red]"+sCurrencyFormat+"-"+sNumberFormat;break;case 3:sPositivePattern=sCurrencyFormat+sNumberFormat+"_-";sNegativePattern="[Red]"+sCurrencyFormat+sNumberFormat+"-";break;case 4:sPositivePattern=sNumberFormat+sCurrencyFormat+"_)";sNegativePattern="[Red]("+sNumberFormat+sCurrencyFormat+")";break;case 5:sPositivePattern=sNumberFormat+sCurrencyFormat;sNegativePattern="[Red]-"+sNumberFormat+sCurrencyFormat;break;case 6:sPositivePattern=sNumberFormat+"-"+ sCurrencyFormat;sNegativePattern="[Red]"+sNumberFormat+"-"+sCurrencyFormat;break;case 7:sPositivePattern=sNumberFormat+sCurrencyFormat+"_-";sNegativePattern="[Red]"+sNumberFormat+sCurrencyFormat+"-";break;case 8:sPositivePattern=sNumberFormat+" "+sCurrencyFormat;sNegativePattern="[Red]-"+sNumberFormat+" "+sCurrencyFormat;break;case 9:sPositivePattern=sCurrencyFormat+" "+sNumberFormat;sNegativePattern="[Red]-"+sCurrencyFormat+" "+sNumberFormat;break;case 10:sPositivePattern=sNumberFormat+" "+sCurrencyFormat+ "_-";sNegativePattern="[Red]"+sNumberFormat+" "+sCurrencyFormat+"-";break;case 11:sPositivePattern=sCurrencyFormat+" "+sNumberFormat+"_-";sNegativePattern="[Red]"+sCurrencyFormat+" "+sNumberFormat+"-";break;case 12:sPositivePattern=sCurrencyFormat+" "+sNumberFormat;sNegativePattern="[Red]"+sCurrencyFormat+" -"+sNumberFormat;break;case 13:sPositivePattern=sNumberFormat+" "+sCurrencyFormat;sNegativePattern="[Red]"+sNumberFormat+"- "+sCurrencyFormat;break;case 14:sPositivePattern=sCurrencyFormat+" "+ sNumberFormat+"_)";sNegativePattern="[Red]("+sCurrencyFormat+" "+sNumberFormat+")";break;case 15:sPositivePattern=sNumberFormat+" "+sCurrencyFormat+"_)";sNegativePattern="[Red]("+sNumberFormat+" "+sCurrencyFormat+")";break}sFormat=sPositivePattern+";"+sNegativePattern}else if(oVal.thouthand)sFormat="#"+gc_sFormatThousandSeparator+"##0"+sFracFormat;else sFormat=AscCommon.g_cGeneralFormat;res.format=sFormat;res.value=dVal}}}if(null==res&&!bError)res=this.parseDate(value,cultureInfo);return res},_parseStringLetters:function(sVal, currencySymbol,bBefore,oRes){var aTemp=["\u0440.",currencySymbol];for(var i=0,length=aTemp.length;i<length;i++){var sChar=aTemp[i];var nIndex=-1;var nCount=0;while(-1!=(nIndex=sVal.indexOf(sChar,nIndex+1)))nCount++;if(nCount>0){sVal=sVal.replace(new RegExp(escapeRegExp(sChar),"g"),"");var elem=oRes[sChar];if(!elem){elem={before:0,after:0,all:0};oRes[sChar]=elem}if(bBefore)elem.before+=nCount;else elem.after+=nCount;elem.all+=nCount}}for(var i=0,length=sVal.length;i<length;i++){var sChar=sVal[i];var elem= oRes[sChar];if(!elem){elem={before:0,after:0,all:0};oRes[sChar]=elem}if(bBefore)elem.before++;else elem.after++;elem.all++}},_parseThouthand:function(val,cultureInfo){var oRes=null;var bThouthand=false;var sReverseVal="";for(var i=val.length-1;i>=0;--i)sReverseVal+=val[i];var nGroupSizeIndex=0;var nGroupSize=cultureInfo.NumberGroupSizes[nGroupSizeIndex];var nPrevIndex=0;var nIndex=-1;var bError=false;while(-1!=(nIndex=sReverseVal.indexOf(cultureInfo.NumberGroupSeparator,nIndex+1))){var nCurLength= nIndex-nPrevIndex;if(nCurLength<nGroupSize){bError=true;break}if(nGroupSizeIndex<cultureInfo.NumberGroupSizes.length-1){nGroupSizeIndex++;nGroupSize=cultureInfo.NumberGroupSizes[nGroupSizeIndex]}nPrevIndex=nIndex+1}if(!bError){if(0!=nPrevIndex)if(nPrevIndex<val.length&&parseInt(val.substr(0,val.length-nPrevIndex))>0){val=val.replace(new RegExp(escapeRegExp(cultureInfo.NumberGroupSeparator),"g"),"");bThouthand=true}if(g_oFormatParser.isLocaleNumber(val,cultureInfo)){var dNumber=g_oFormatParser.parseLocaleNumber(val, cultureInfo);oRes={number:dNumber,thouthand:bThouthand}}}return oRes},_parseDateFromArray:function(match,oDataTypes,cultureInfo){var res=null;var bError=false;for(var i=0,length=match.length;i<length;i++){var elem=match[i];if(elem.type==oDataTypes.delimiter){bError=true;if(i-1>=0&&i+1<length){var prev=match[i-1];var next=match[i+1];if(prev.type!=oDataTypes.delimiter&&next.type!=oDataTypes.delimite)if(cultureInfo.TimeSeparator==elem.val||":"==elem.val&&cultureInfo.DateSeparator!=elem.val){if(false== prev.date&&false==next.date){bError=false;prev.time=true;next.time=true}}else if(false==prev.time&&false==next.time){bError=false;prev.date=true;next.date=true}}else if(i-1>=0&&i+1==length){var prev=match[i-1];if(prev.type!=oDataTypes.delimiter)if(cultureInfo.TimeSeparator==elem.val||":"==elem.val&&cultureInfo.DateSeparator!=elem.val)if(false==prev.date){bError=false;prev.time=true}}if(bError)break}}if(!bError)for(var i=0,length=match.length;i<length;i++){var elem=match[i];if(elem.type==oDataTypes.letter){var valLower= elem.val.toLowerCase();if(elem.am||elem.pm){if(i-1>=0){var prev=match[i-1];if(oDataTypes.digit==prev.type&&false==prev.date)prev.time=true}if(i+1!=length)bError=true}else if(null!=elem.month){if(i-1>=0){var prev=match[i-1];if(oDataTypes.digit==prev.type&&false==prev.time)prev.date=true}if(i+1<length){var next=match[i+1];if(oDataTypes.digit==next.type&&false==next.time)next.date=true}}else bError=true}if(bError)break}if(!bError){var aDate=[];var nMonthIndex=null;var sMonthFormat=null;var aTime=[]; var am=false;var pm=false;for(var i=0,length=match.length;i<length;i++){var elem=match[i];if(elem.date)if(elem.type==oDataTypes.digit)aDate.push(elem.val);else if(elem.type==oDataTypes.letter&&null!=elem.month){nMonthIndex=aDate.length;sMonthFormat=elem.month.format;aDate.push(elem.month.val)}else bError=true;else if(elem.time)if(elem.type==oDataTypes.digit)aTime.push(elem.val);else if(elem.type==oDataTypes.letter&&(elem.am||elem.pm)){am=elem.am;pm=elem.pm}else bError=true;else if(oDataTypes.digit== elem.type)bError=true}var nDateLength=aDate.length;if(nDateLength>0&&!(2<=nDateLength&&nDateLength<=3&&(null==nMonthIndex||3==nDateLength&&1==nMonthIndex||2==nDateLength)))bError=true;var nTimeLength=aTime.length;if(nTimeLength>3)bError=true;if(!bError){res={d:null,m:null,y:null,h:null,min:null,s:null,am:am,pm:pm,sDateFormat:null};if(nDateLength>0){var nIndexD=Math.max(cultureInfo.ShortDatePattern.indexOf("0"),cultureInfo.ShortDatePattern.indexOf("1"));var nIndexM=Math.max(cultureInfo.ShortDatePattern.indexOf("2"), cultureInfo.ShortDatePattern.indexOf("3"));var nIndexY=Math.max(cultureInfo.ShortDatePattern.indexOf("4"),cultureInfo.ShortDatePattern.indexOf("5"));if(null!=nMonthIndex)if(2==nDateLength){res.d=aDate[nDateLength-1-nMonthIndex];res.m=aDate[nMonthIndex];if(this.isValidDate((new Date).getFullYear(),res.m-1,res.d))res.sDateFormat="d-mmm";else if(!isDMY(cultureInfo)&&this.isValidDate((new Date).getFullYear(),res.d-1,res.m)){res.sDateFormat="d-mmm";var temp=res.d;res.d=res.m;res.m=temp}else if(0==nMonthIndex){res.sDateFormat= "mmm-yy";res.d=null;res.m=aDate[0];res.y=aDate[1]}else bError=true}else{res.sDateFormat="d-mmm-yy";res.d=aDate[0];res.m=aDate[1];res.y=aDate[2]}else if(2==nDateLength){if(nIndexD<nIndexM){res.d=aDate[0];res.m=aDate[1]}else{res.m=aDate[0];res.d=aDate[1]}if(this.isValidDate((new Date).getFullYear(),res.m-1,res.d))res.sDateFormat="d-mmm";else if(isYMD(cultureInfo)&&this.isValidDate((new Date).getFullYear(),res.d-1,res.m)){res.sDateFormat="d-mmm";var temp=res.d;res.d=res.m;res.m=temp}else{res.sDateFormat= "mmm-yy";res.d=null;if(nIndexM<nIndexY){res.m=aDate[0];res.y=aDate[1]}else{res.y=aDate[0];res.m=aDate[1]}}}else{for(var i=0,length=cultureInfo.ShortDatePattern.length;i<length;i++){var nIndex=cultureInfo.ShortDatePattern[i]-0;var val=aDate[i];if(0==nIndex||1==nIndex)res.d=val;else if(2==nIndex||3==nIndex)res.m=val;else if(4==nIndex||5==nIndex)res.y=val}res.sDateFormat=getShortDateFormat(cultureInfo)}if(null!=res.y)if(res.y<30)res.y=2E3+res.y;else if(res.y<100)res.y=1900+res.y}if(nTimeLength>0){res.h= aTime[0];if(nTimeLength>1)res.min=aTime[1];if(nTimeLength>2)res.s=aTime[2]}if(bError)res=null}}return res},strcmp:function(s1,s2,index1,length,index2){if(null==index2)index2=0;var bRes=true;for(var i=0;i<length;++i)if(s1[index1+i]!=s2[index2+i]){bRes=false;break}return bRes},parseDate:function(value,cultureInfo){var res=null;var match=[];var sCurValue=null;var oCurDataType=null;var oPrevType=null;var bAmPm=false;var bMonth=false;var bError=false;var oDataTypes={letter:{id:0,min:2,max:9},digit:{id:1, min:1,max:4},delimiter:{id:2,min:1,max:1},space:{id:3,min:null,max:null}};var valueLower=value.toLowerCase();for(var i=0,length=value.length;i<length;i++){var sChar=value[i];var oDataType=null;if("0"<=sChar&&sChar<="9")oDataType=oDataTypes.digit;else if(" "==sChar)oDataType=oDataTypes.space;else if("/"==sChar||"-"==sChar||":"==sChar||cultureInfo.DateSeparator==sChar||cultureInfo.TimeSeparator==sChar)oDataType=oDataTypes.delimiter;else oDataType=oDataTypes.letter;if(null!=oDataType){if(null==oCurDataType)sCurValue= sChar;else if(oCurDataType==oDataType)if(null==oCurDataType.max||sCurValue.length<oCurDataType.max)sCurValue+=sChar;else bError=true;else if(null==oCurDataType.min||sCurValue.length>=oCurDataType.min){if(oDataTypes.space!=oCurDataType){var oNewElem={val:sCurValue,type:oCurDataType,month:null,am:false,pm:false,date:false,time:false};if(oDataTypes.digit==oCurDataType)oNewElem.val=oNewElem.val-0;match.push(oNewElem)}sCurValue=sChar;oPrevType=oCurDataType}else bError=true;oCurDataType=oDataType}else bError= true;if(oDataTypes.letter==oDataType){var oNewElem={val:sCurValue,type:oCurDataType,month:null,am:false,pm:false,date:false,time:false};var bAm=false;var bPm=false;if(!bAmPm&&((bAm=this.strcmp(valueLower,"am",i,2))||(bPm=this.strcmp(valueLower,"pm",i,2)))){bAmPm=true;oNewElem.am=bAm;oNewElem.pm=bPm;oNewElem.time=true;match.push(oNewElem);i+=2-1;if(oPrevType!=oDataTypes.space)bError=true}else if(!bMonth){bMonth=true;var aArraysToCheck=[{arr:cultureInfo.AbbreviatedMonthNames,format:"mmm"},{arr:cultureInfo.MonthNames, format:"mmmm"}];var bFound=false;for(var index in aArraysToCheck){var aArrayTemp=aArraysToCheck[index];for(var j=0,length2=aArrayTemp.arr.length;j<length2;j++){var sCmpVal=aArrayTemp.arr[j].toLowerCase();var sCmpValCrop=sCmpVal.replace(/\./g,"");var bCrop=false;if(this.strcmp(valueLower,sCmpVal,i,sCmpVal.length)||(bCrop=sCmpVal!=sCmpValCrop&&this.strcmp(valueLower,sCmpValCrop,i,sCmpValCrop.length))){bFound=true;oNewElem.month={val:j+1,format:aArrayTemp.format};oNewElem.date=true;if(bCrop)i+=sCmpValCrop.length- 1;else i+=sCmpVal.length-1;break}}if(bFound)break}if(bFound)match.push(oNewElem);else bError=true}else bError=true;oCurDataType=null;sCurValue=null}if(bError){match=null;break}}if(null!=match&&null!=sCurValue)if(oDataTypes.space!=oCurDataType){var oNewElem={val:sCurValue,type:oCurDataType,month:null,am:false,pm:false,date:false,time:false};if(oDataTypes.digit==oCurDataType)oNewElem.val=oNewElem.val-0;match.push(oNewElem)}if(null!=match&&match.length>0){var oParsedDate=this._parseDateFromArray(match, oDataTypes,cultureInfo);if(null!=oParsedDate){var d=oParsedDate.d;var m=oParsedDate.m;var y=oParsedDate.y;var h=oParsedDate.h;var min=oParsedDate.min;var s=oParsedDate.s;var am=oParsedDate.am;var pm=oParsedDate.pm;var sDateFormat=oParsedDate.sDateFormat;var bDate=false;var bTime=false;var nDay;var nMounth;var nYear;if(AscCommon.bDate1904){nDay=1;nMounth=0;nYear=1904}else{nDay=31;nMounth=11;nYear=1899}var nHour=0;var nMinute=0;var nSecond=0;var dValue=0;var bValidDate=true;if(null!=m&&(null!=d||null!= y)){bDate=true;var oNowDate;if(null!=d)nDay=d-0;else nDay=1;nMounth=m-1;if(null!=y)nYear=y-0;else{oNowDate=new Date;nYear=oNowDate.getFullYear()}bValidDate=this.isValidDate(nYear,nMounth,nDay)}if(null!=h){bTime=true;nHour=h-0;if(am||pm)if(nHour<=23){nHour=nHour%12;if(pm)nHour+=12}else bValidDate=false;if(null!=min){nMinute=min-0;if(nMinute>59)bValidDate=false}if(null!=s){nSecond=s-0;if(nSecond>59)bValidDate=false}}if(true==bValidDate&&(true==bDate||true==bTime)){if(AscCommon.bDate1904)dValue=(Date.UTC(nYear, nMounth,nDay,nHour,nMinute,nSecond)-Date.UTC(1904,0,1,0,0,0))/(86400*1E3);else if(1900<nYear||1900==nYear&&1<nMounth)dValue=(Date.UTC(nYear,nMounth,nDay,nHour,nMinute,nSecond)-Date.UTC(1899,11,30,0,0,0))/(86400*1E3);else if(1900==nYear&&1==nMounth&&29==nDay)dValue=60;else dValue=(Date.UTC(nYear,nMounth,nDay,nHour,nMinute,nSecond)-Date.UTC(1899,11,31,0,0,0))/(86400*1E3);if(dValue>=0){var sFormat;if(true==bDate&&true==bTime){sFormat=sDateFormat+" h:mm:ss";if(am||pm)sFormat+=" AM/PM"}else if(true==bDate)sFormat= sDateFormat;else if(dValue>1)sFormat="[h]:mm:ss";else if(am||pm)sFormat="h:mm:ss AM/PM";else sFormat="h:mm:ss";res={format:sFormat,value:dValue,bDateTime:true,bDate:bDate,bTime:bTime,bPercent:false,bCurrency:false}}}}}return res},isValidDate:function(nYear,nMounth,nDay){if(nYear<1900&&!(1899===nYear&&11==nMounth&&31==nDay))return false;else if(nMounth<0||nMounth>11)return false;else if(this.isValidDay(nYear,nMounth,nDay))return true;else if(1900==nYear&&1==nMounth&&29==nDay)return true;return false}, isValidDay:function(nYear,nMounth,nDay){if(this.isLeapYear(nYear)){if(nDay<=0||nDay>this.daysLeap[nMounth])return false}else if(nDay<=0||nDay>this.days[nMounth])return false;return true},isLeapYear:function(year){return 0==year%4&&(0!=year%100||0==year%400)}};var g_oFormatParser=new FormatParser;function escapeRegExp(string){return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function setCurrentCultureInfo(LCID,decimalSeparator,groupSeparator){var res=false;var cultureInfoNew=g_aCultureInfos[LCID]; if(cultureInfoNew){if(LCID!==g_oLCID){g_oLCID=LCID;AscCommon.g_oDefaultCultureInfo=g_oDefaultCultureInfo=JSON.parse(JSON.stringify(cultureInfoNew));res=true}ParseLocalFormatSymbol(g_oDefaultCultureInfo.Name);decimalSeparator=null!=decimalSeparator?decimalSeparator:cultureInfoNew.NumberDecimalSeparator;if(decimalSeparator!==g_oDefaultCultureInfo.NumberDecimalSeparator){g_oDefaultCultureInfo.NumberDecimalSeparator=decimalSeparator;res=true}groupSeparator=null!=groupSeparator?groupSeparator:cultureInfoNew.NumberGroupSeparator; if(groupSeparator!==g_oDefaultCultureInfo.NumberGroupSeparator){g_oDefaultCultureInfo.NumberGroupSeparator=groupSeparator;res=true}}return res}function checkCultureInfoFontPicker(LCID){var ci=g_aCultureInfos[LCID]||g_oDefaultCultureInfo;AscFonts.FontPickerByCharacter.getFontsByString(ci.CurrencySymbol);AscFonts.FontPickerByCharacter.getFontsByString(ci.NumberDecimalSeparator);AscFonts.FontPickerByCharacter.getFontsByString(ci.NumberGroupSeparator);AscFonts.FontPickerByCharacter.getFontsByString(ci.AMDesignator); AscFonts.FontPickerByCharacter.getFontsByString(ci.PMDesignator);AscFonts.FontPickerByCharacter.getFontsByString(ci.DateSeparator);AscFonts.FontPickerByCharacter.getFontsByString(ci.TimeSeparator);var arrays=[ci.DayNames,ci.AbbreviatedDayNames,ci.MonthNames,ci.AbbreviatedMonthNames,ci.MonthGenitiveNames,ci.AbbreviatedMonthGenitiveNames];arrays.forEach(function(arr){arr.forEach(function(text){AscFonts.FontPickerByCharacter.getFontsByString(text)})})}function isDMY(cultureInfo){var res=true;for(var i= 0;i<cultureInfo.ShortDatePattern.length-1;++i)if(cultureInfo.ShortDatePattern.charCodeAt(i)>cultureInfo.ShortDatePattern.charCodeAt(i+1))return false;return true}function isYMD(cultureInfo){var res=true;for(var i=0;i<cultureInfo.ShortDatePattern.length-1;++i)if(cultureInfo.ShortDatePattern.charCodeAt(i)<cultureInfo.ShortDatePattern.charCodeAt(i+1))return false;return true}function getShortDateMonthFormat(bDate,bYear,opt_cultureInfo){var cultureInfo=opt_cultureInfo?opt_cultureInfo:g_oDefaultCultureInfo; var separator;if("/"==g_oDefaultCultureInfo.DateSeparator)separator="-";else separator="/";var sRes="";if(bDate){if(-1!=cultureInfo.ShortDatePattern.indexOf("1"))sRes+="dd";else sRes+="d";sRes+=separator}sRes+="mmm";if(bYear){sRes+=separator;sRes+="yy"}return sRes}function getShortDateFormat(opt_cultureInfo){var cultureInfo=opt_cultureInfo?opt_cultureInfo:g_oDefaultCultureInfo;var dateElems=[];for(var i=0;i<cultureInfo.ShortDatePattern.length;++i)switch(cultureInfo.ShortDatePattern[i]){case "0":dateElems.push("d"); break;case "1":dateElems.push("dd");break;case "2":dateElems.push("m");break;case "3":dateElems.push("mm");break;case "4":dateElems.push("yy");break;case "5":dateElems.push("yyyy");break}return dateElems.join("/")}function getShortDateFormat2(day,month,year,opt_cultureInfo){var cultureInfo=opt_cultureInfo?opt_cultureInfo:g_oDefaultCultureInfo;var dateElems=[];for(var i=0;i<cultureInfo.ShortDatePattern.length;++i)switch(cultureInfo.ShortDatePattern[i]){case "0":case "1":if(day>0)dateElems.push("d".repeat(day)); break;case "2":case "3":if(month>0)dateElems.push("m".repeat(month));break;case "4":case "5":if(year>0)dateElems.push("y".repeat(year));break}return dateElems.join("/")}function getShortTimeFormat(opt_cultureInfo){var cultureInfo=opt_cultureInfo?opt_cultureInfo:g_oDefaultCultureInfo;if(cultureInfo.AMDesignator.length>0&&cultureInfo.PMDesignator.length>0)return"h:mm AM/PM;@";else return"h:mm;@"}function getNumberFormatSimple(opt_separate,opt_fraction){var numberFormat=opt_separate?"#,##0":"0";if(opt_fraction> 0)numberFormat+="."+"0".repeat(opt_fraction);return numberFormat}function getNumberFormat(opt_cultureInfo,opt_separate,opt_fraction,opt_red){var cultureInfo=opt_cultureInfo?opt_cultureInfo:g_oDefaultCultureInfo;var numberFormat=getNumberFormatSimple(opt_separate,opt_fraction);var red=opt_red?"[Red]":"";var positiveFormat;var negativeFormat;switch(cultureInfo.CurrencyNegativePattern){case 0:case 4:case 14:case 15:positiveFormat=numberFormat+"_)";negativeFormat="\\("+numberFormat+"\\)";break;default:positiveFormat= numberFormat+"_ ";negativeFormat="\\-"+numberFormat+"\\ ";break}return positiveFormat+";"+red+negativeFormat}function getLocaleFormat(opt_cultureInfo,opt_currency){var cultureInfo=opt_cultureInfo?opt_cultureInfo:g_oDefaultCultureInfo;var symbol=opt_currency?cultureInfo.CurrencySymbol:"";return"[$"+symbol+"-"+cultureInfo.LCID.toString(16).toUpperCase()+"]"}function getCurrencyFormatSimple(opt_cultureInfo,opt_fraction,opt_currency,opt_currencyLocale,opt_red){var cultureInfo=opt_cultureInfo?opt_cultureInfo: g_oDefaultCultureInfo;var numberFormat=getNumberFormatSimple(true,opt_fraction);var signCurrencyFormat;var signCurrencyFormatEnd;var signCurrencyFormatSpace;if(opt_currency){if(opt_currencyLocale)signCurrencyFormat=getLocaleFormat(cultureInfo,true);else signCurrencyFormat='"'+cultureInfo.CurrencySymbol+'"';signCurrencyFormatEnd=signCurrencyFormat;signCurrencyFormatSpace=signCurrencyFormat+"\\ "}else{signCurrencyFormatEnd=signCurrencyFormat=signCurrencyFormatSpace="";for(var i=0;i<cultureInfo.CurrencySymbol.length;++i)signCurrencyFormatEnd+= "_"+cultureInfo.CurrencySymbol[i]}var red=opt_red?"[Red]":"";var prefixs=["_ ","_-","_(","_)"];var postfix="";var positiveFormat;var negativeFormat;switch(cultureInfo.CurrencyNegativePattern){case 0:postfix=prefixs[3];negativeFormat="\\("+signCurrencyFormat+numberFormat+"\\)";break;case 1:negativeFormat="\\-"+signCurrencyFormat+numberFormat;break;case 2:negativeFormat=signCurrencyFormatSpace+"\\-"+numberFormat;break;case 3:postfix=prefixs[1];negativeFormat=signCurrencyFormatSpace+numberFormat+"\\-"; break;case 4:postfix=prefixs[3];negativeFormat="\\("+numberFormat+signCurrencyFormatEnd+"\\)";break;case 5:negativeFormat="\\-"+numberFormat+signCurrencyFormatEnd;break;case 6:negativeFormat=numberFormat+"\\-"+signCurrencyFormatEnd;break;case 7:postfix=prefixs[1];negativeFormat=numberFormat+signCurrencyFormatEnd+"\\-";break;case 8:negativeFormat="\\-"+numberFormat+"\\ "+signCurrencyFormatEnd;break;case 9:negativeFormat="\\-"+signCurrencyFormatSpace+numberFormat;break;case 10:postfix=prefixs[1];negativeFormat= numberFormat+"\\ "+signCurrencyFormatEnd+"\\-";break;case 11:postfix=prefixs[1];negativeFormat=signCurrencyFormatSpace+numberFormat+"\\-";break;case 12:negativeFormat=signCurrencyFormatSpace+"\\-"+numberFormat;break;case 13:negativeFormat=numberFormat+"\\-\\ "+signCurrencyFormatEnd;break;case 14:postfix=prefixs[3];negativeFormat="("+signCurrencyFormat+numberFormat+"\\)";break;case 15:postfix=prefixs[3];negativeFormat="\\("+numberFormat+signCurrencyFormatEnd+"\\)";break}switch(cultureInfo.CurrencyPositivePattern){case 0:positiveFormat= signCurrencyFormat+numberFormat;break;case 1:positiveFormat=numberFormat+signCurrencyFormatEnd;break;case 2:positiveFormat=signCurrencyFormatSpace+numberFormat;break;case 3:positiveFormat=numberFormat+"\\ "+signCurrencyFormatEnd;break}positiveFormat=positiveFormat+postfix;return positiveFormat+";"+red+negativeFormat}function getCurrencyFormatSimple2(opt_cultureInfo,opt_fraction,opt_currency,opt_negative){var cultureInfo=opt_cultureInfo?opt_cultureInfo:g_oDefaultCultureInfo;var numberFormat=getNumberFormatSimple(true, opt_fraction);var signCurrencyFormat;var signCurrencyFormatEnd;var signCurrencyFormatSpace;if(opt_currency){signCurrencyFormat=signCurrencyFormatEnd=getLocaleFormat(cultureInfo,true);signCurrencyFormatSpace=signCurrencyFormat+"\\ "}else{signCurrencyFormatEnd=signCurrencyFormat=signCurrencyFormatSpace="";for(var i=0;i<cultureInfo.CurrencySymbol.length;++i)signCurrencyFormatEnd+="_"+cultureInfo.CurrencySymbol[i]}var positiveFormat;switch(cultureInfo.CurrencyNegativePattern){case 0:case 1:case 14:positiveFormat= signCurrencyFormat+numberFormat;break;case 2:case 3:case 9:case 10:case 11:case 12:positiveFormat=signCurrencyFormatSpace+numberFormat;break;case 4:case 5:case 6:case 7:case 15:positiveFormat=numberFormat+signCurrencyFormatEnd;break;case 8:case 13:positiveFormat=numberFormat+"\\ "+signCurrencyFormatEnd;break}return opt_negative?positiveFormat+";[Red]"+positiveFormat:positiveFormat}function getCurrencyFormat(opt_cultureInfo,opt_fraction,opt_currency,opt_currencyLocale){var cultureInfo=opt_cultureInfo? opt_cultureInfo:g_oDefaultCultureInfo;var numberFormat=getNumberFormatSimple(true,opt_fraction);var nullSignFormat='* "-"';if(opt_fraction)nullSignFormat+="?".repeat(opt_fraction);var signCurrencyFormat;var signCurrencyFormatEnd;var signCurrencyFormatSpace;if(opt_currency){if(opt_currencyLocale)signCurrencyFormat=getLocaleFormat(cultureInfo,true);else signCurrencyFormat='"'+cultureInfo.CurrencySymbol+'"';signCurrencyFormatEnd=signCurrencyFormat;signCurrencyFormatSpace=signCurrencyFormat+"\\ "}else{signCurrencyFormatEnd= signCurrencyFormat=signCurrencyFormatSpace="";for(var i=0;i<cultureInfo.CurrencySymbol.length;++i)signCurrencyFormatEnd+="_"+cultureInfo.CurrencySymbol[i]}var prefixs=["_ ","_-","_(","_)"];var prefix=prefixs[0];var postfix=prefixs[0];var positiveNumberFormat="* "+numberFormat;var positiveFormat;var negativeFormat;var nullFormat;switch(cultureInfo.CurrencyNegativePattern){case 0:prefix=prefixs[2];postfix=prefixs[3];negativeFormat=prefix+signCurrencyFormat+"* \\("+numberFormat+"\\)";break;case 1:prefix= postfix=prefixs[1];negativeFormat="\\-"+signCurrencyFormat+"* "+numberFormat+postfix;break;case 2:negativeFormat=prefix+signCurrencyFormatSpace+"* \\-"+numberFormat+postfix;break;case 3:prefix=postfix=prefixs[1];negativeFormat=prefix+signCurrencyFormatSpace+"* "+numberFormat+"\\-";break;case 4:prefix=prefixs[2];postfix=prefixs[3];negativeFormat=prefix+"* \\("+numberFormat+"\\)"+signCurrencyFormatEnd+postfix;break;case 5:prefix=postfix=prefixs[1];negativeFormat="\\-* "+numberFormat+signCurrencyFormatEnd+ postfix;break;case 6:negativeFormat=prefix+"* "+numberFormat+"\\-"+signCurrencyFormatEnd+postfix;break;case 7:negativeFormat=prefix+"* "+numberFormat+signCurrencyFormatEnd+"\\-";break;case 8:prefix=postfix=prefixs[1];negativeFormat="\\-* "+numberFormat+"\\ "+signCurrencyFormatEnd+postfix;break;case 9:prefix=postfix=prefixs[1];negativeFormat="\\-"+signCurrencyFormatSpace+"* "+numberFormat+postfix;break;case 10:negativeFormat=prefix+"* "+numberFormat+"\\ "+signCurrencyFormatEnd+"\\-";break;case 11:negativeFormat= prefix+signCurrencyFormatSpace+"* "+numberFormat+"\\-";break;case 12:negativeFormat=prefix+signCurrencyFormatSpace+"* \\-"+numberFormat+postfix;break;case 13:negativeFormat=prefix+"* "+numberFormat+"\\-\\ "+signCurrencyFormatEnd+postfix;break;case 14:prefix=prefixs[2];postfix=prefixs[3];negativeFormat=prefix+signCurrencyFormatSpace+"* \\("+numberFormat+"\\)";break;case 15:prefix=prefixs[2];postfix=prefixs[3];negativeFormat=prefix+"* \\("+numberFormat+"\\)\\ "+signCurrencyFormatEnd+postfix;break}switch(cultureInfo.CurrencyPositivePattern){case 0:positiveFormat= signCurrencyFormat+positiveNumberFormat;nullFormat=signCurrencyFormat+nullSignFormat;break;case 1:positiveFormat=positiveNumberFormat+signCurrencyFormatEnd;nullFormat=nullSignFormat+signCurrencyFormatEnd;break;case 2:positiveFormat=signCurrencyFormatSpace+positiveNumberFormat;nullFormat=signCurrencyFormatSpace+nullSignFormat;break;case 3:positiveFormat=positiveNumberFormat+"\\ "+signCurrencyFormatEnd;nullFormat=nullSignFormat+"\\ "+signCurrencyFormatEnd;break}positiveFormat=prefix+positiveFormat+ postfix;nullFormat=prefix+nullFormat+postfix;var textFormat=prefix+"@"+postfix;return positiveFormat+";"+negativeFormat+";"+nullFormat+";"+textFormat}function getFormatCells(info){var res=[];if(info){var format;var i;var cultureInfo=g_aCultureInfos[info.symbol];var currency=!!cultureInfo;if(Asc.c_oAscNumFormatType.General===info.type)res.push(AscCommon.g_cGeneralFormat);else if(Asc.c_oAscNumFormatType.Number===info.type){var numberFormat=getNumberFormatSimple(info.separator,info.decimalPlaces);res.push(numberFormat); res.push(numberFormat+";[Red]"+numberFormat);res.push(getNumberFormat(cultureInfo,info.separator,info.decimalPlaces,false));res.push(getNumberFormat(cultureInfo,info.separator,info.decimalPlaces,true))}else if(Asc.c_oAscNumFormatType.Currency===info.type){res.push(getCurrencyFormatSimple2(cultureInfo,info.decimalPlaces,currency,false));res.push(getCurrencyFormatSimple2(cultureInfo,info.decimalPlaces,currency,true));res.push(getCurrencyFormatSimple(cultureInfo,info.decimalPlaces,currency,currency, false));res.push(getCurrencyFormatSimple(cultureInfo,info.decimalPlaces,currency,currency,true))}else if(Asc.c_oAscNumFormatType.Accounting===info.type)res.push(getCurrencyFormat(cultureInfo,info.decimalPlaces,currency,currency));else if(Asc.c_oAscNumFormatType.Date===info.type){if(info.symbol==g_oDefaultCultureInfo.LCID){res.push(getShortDateFormat(cultureInfo));res.push("[$-F800]dddd, mmmm dd, yyyy")}res.push(getShortDateFormat2(1,1,0,cultureInfo)+";@");res.push(getShortDateFormat2(2,2,0,cultureInfo)+ ";@");res.push(getShortDateFormat2(1,1,2,cultureInfo)+";@");res.push(getShortDateFormat2(2,2,2,cultureInfo)+";@");res.push(getShortDateFormat2(1,1,4,cultureInfo)+";@");res.push(getShortDateFormat2(2,2,4,cultureInfo)+";@");res.push(getShortDateFormat2(1,1,2,cultureInfo)+" h:mm;@");res.push(getShortDateFormat2(2,2,2,cultureInfo)+" h:mm;@");res.push("[$-409]"+getShortDateFormat2(1,1,2,cultureInfo)+" h:mm AM/PM;@");var locale=getLocaleFormat(cultureInfo,false);res.push(locale+"mmmmm;@");res.push(locale+ "mmmm d, yyyy;@");var separators=["-","/"," "];for(i=0;i<separators.length;++i){var separator=separators[i];res.push(locale+"d"+separator+"mmm;@");res.push(locale+"d"+separator+"mmm"+separator+"yy;@");res.push(locale+"dd"+separator+"mmm"+separator+"yy;@");res.push(locale+"mmm"+separator+"yy;@");res.push(locale+"mmmm"+separator+"yy;@");res.push(locale+"mmmmm"+separator+"yy;@");res.push(locale+"yy"+separator+"mmm;@");res.push(locale+"d"+separator+"mmm"+separator+"yyyy;@");res.push(locale+"yyyy"+separator+ "mmm"+separator+"d;@");res.push(locale+"yy"+separator+"mmm"+separator+"d;@")}res.push("yy/m/d;@");res.push("yy/mm/dd;@");res.push("yyyy/m/d;@")}else if(Asc.c_oAscNumFormatType.Time===info.type)res=gc_aTimeFormats;else if(Asc.c_oAscNumFormatType.Percent===info.type){format="0";if(info.decimalPlaces>0)format+="."+"0".repeat(info.decimalPlaces);format+="%";res.push(format)}else if(Asc.c_oAscNumFormatType.Fraction===info.type)res=gc_aFractionFormats;else if(Asc.c_oAscNumFormatType.Scientific===info.type){format= "0."+"0".repeat(info.decimalPlaces)+"E+00";res.push(format)}else if(Asc.c_oAscNumFormatType.Text===info.type)res.push("@");else if(Asc.c_oAscNumFormatType.Custom===info.type){for(i=0;i<=4;++i)res.push(AscCommonExcel.aStandartNumFormats[i]);res.push(getCurrencyFormatSimple(null,0,false,false,false));res.push(getCurrencyFormatSimple(null,0,false,false,true));res.push(getCurrencyFormatSimple(null,2,false,false,false));res.push(getCurrencyFormatSimple(null,2,false,false,true));res.push(getCurrencyFormatSimple(null, 0,true,false,false));res.push(getCurrencyFormatSimple(null,0,true,false,true));res.push(getCurrencyFormatSimple(null,2,true,false,false));res.push(getCurrencyFormatSimple(null,2,true,false,true));for(i=9;i<=13;++i)res.push(AscCommonExcel.aStandartNumFormats[i]);res.push(getShortDateFormat(null));res.push(getShortDateMonthFormat(true,true,null));res.push(getShortDateMonthFormat(true,false,null));res.push(getShortDateMonthFormat(false,true,null));for(i=18;i<=21;++i)res.push(AscCommonExcel.aStandartNumFormats[i]); res.push(getShortDateFormat(null)+" h:mm");for(i=45;i<=49;++i)res.push(AscCommonExcel.aStandartNumFormats[i]);res.push(AscCommon.getCurrencyFormat(null,0,true,false));res.push(AscCommon.getCurrencyFormat(null,0,false,false));res.push(AscCommon.getCurrencyFormat(null,2,true,false));res.push(AscCommon.getCurrencyFormat(null,2,false,false))}else{res.push(AscCommon.g_cGeneralFormat);res.push("0.00");res.push("0.00E+00");res.push(getCurrencyFormat(cultureInfo,2,currency,true));res.push(getCurrencyFormatSimple2(cultureInfo, 2,currency,false));res.push(getShortDateFormat(cultureInfo));res.push("[$-F400]h:mm:ss AM/PM");res.push("0.00%");res.push("# ?/?");res.push("@")}}return res}function getFormatByStandardId(id){var res=null;if(15<=id&&id<=17)switch(id){case 15:res=AscCommon.getShortDateMonthFormat(true,true,null);break;case 16:res=AscCommon.getShortDateMonthFormat(true,false,null);break;case 17:res=AscCommon.getShortDateMonthFormat(false,true,null);break}else{var currencyLocale=true;switch(id){case 5:res=AscCommon.getCurrencyFormatSimple(null, 0,true,currencyLocale,false);break;case 6:res=AscCommon.getCurrencyFormatSimple(null,0,true,currencyLocale,true);break;case 7:res=AscCommon.getCurrencyFormatSimple(null,2,true,currencyLocale,false);break;case 8:res=AscCommon.getCurrencyFormatSimple(null,2,true,currencyLocale,true);break;case 14:res=AscCommon.getShortDateFormat(null);break;case 22:res=AscCommon.getShortDateFormat(null)+" h:mm";break;case 27:case 28:case 29:case 30:case 31:case 36:res=AscCommon.getShortDateFormat(null);break;case 37:res= AscCommon.getCurrencyFormatSimple(null,0,false,currencyLocale,false);break;case 38:res=AscCommon.getCurrencyFormatSimple(null,0,false,currencyLocale,true);break;case 39:res=AscCommon.getCurrencyFormatSimple(null,2,false,currencyLocale,false);break;case 40:res=AscCommon.getCurrencyFormatSimple(null,2,false,currencyLocale,true);break;case 41:res=AscCommon.getCurrencyFormat(null,0,false,currencyLocale);break;case 42:res=AscCommon.getCurrencyFormat(null,0,true,currencyLocale);break;case 43:res=AscCommon.getCurrencyFormat(null, 2,false,currencyLocale);break;case 44:res=AscCommon.getCurrencyFormat(null,2,true,currencyLocale);break;default:res=AscCommonExcel.aStandartNumFormats[id];break}}return res}var g_aCultureInfos={4:{LCID:4,Name:"zh-Hans",CurrencyPositivePattern:0,CurrencyNegativePattern:2,CurrencySymbol:"\u00a5",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94", "\u661f\u671f\u516d"],AbbreviatedDayNames:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],MonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],AbbreviatedMonthNames:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708", ""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u4e0a\u5348",PMDesignator:"\u4e0b\u5348",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"520"},5:{LCID:5,Name:"cs",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"K\u010d",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["ned\u011ble","pond\u011bl\u00ed","\u00fater\u00fd","st\u0159eda","\u010dtvrtek","p\u00e1tek","sobota"],AbbreviatedDayNames:["ne","po","\u00fat","st", "\u010dt","p\u00e1","so"],MonthNames:["leden","\u00fanor","b\u0159ezen","duben","kv\u011bten","\u010derven","\u010dervenec","srpen","z\u00e1\u0159\u00ed","\u0159\u00edjen","listopad","prosinec",""],AbbreviatedMonthNames:["led","\u00fano","b\u0159e","dub","kv\u011b","\u010dvn","\u010dvc","srp","z\u00e1\u0159","\u0159\u00edj","lis","pro",""],MonthGenitiveNames:["ledna","\u00fanora","b\u0159ezna","dubna","kv\u011btna","\u010dervna","\u010dervence","srpna","z\u00e1\u0159\u00ed","\u0159\u00edjna","listopadu", "prosince",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"dop.",PMDesignator:"odp.",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},7:{LCID:7,Name:"de",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],AbbreviatedDayNames:["So","Mo","Di","Mi","Do","Fr","Sa"],MonthNames:["Januar","Februar","M\u00e4rz", "April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],AbbreviatedMonthNames:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},8:{LCID:8,Name:"el",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae", "\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],AbbreviatedDayNames:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9","\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],MonthNames:["\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2", "\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2","\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2","\u039c\u03ac\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2","\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2","\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2","\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2", "\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2",""],AbbreviatedMonthNames:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u03ca","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba",""],MonthGenitiveNames:["\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5", "\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5","\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5","\u039c\u03b1\u0390\u03bf\u03c5","\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5","\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5","\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5","\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5","\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5", ""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u03c0\u03bc",PMDesignator:"\u03bc\u03bc",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},9:{LCID:9,Name:"en",CurrencyPositivePattern:0,CurrencyNegativePattern:0,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March", "April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"205"},10:{LCID:10,Name:"es",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3], DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["do.","lu.","ma.","mi.","ju.","vi.","s\u00e1."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/", TimeSeparator:":",ShortDatePattern:"135"},11:{LCID:11,Name:"fi",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],AbbreviatedDayNames:["su","ma","ti","ke","to","pe","la"],MonthNames:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kes\u00e4kuu","hein\u00e4kuu","elokuu","syyskuu","lokakuu","marraskuu", "joulukuu",""],AbbreviatedMonthNames:["tammi","helmi","maalis","huhti","touko","kes\u00e4","hein\u00e4","elo","syys","loka","marras","joulu",""],MonthGenitiveNames:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta",""],AbbreviatedMonthGenitiveNames:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kes\u00e4k.","hein\u00e4k.","elok.","syysk.","lokak.","marrask.","jouluk.",""],AMDesignator:"ap.", PMDesignator:"ip.",DateSeparator:".",TimeSeparator:".",ShortDatePattern:"025"},12:{LCID:12,Name:"fr",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre", "novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},14:{LCID:14,Name:"hu",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"Ft",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["vas\u00e1rnap","h\u00e9tf\u0151", "kedd","szerda","cs\u00fct\u00f6rt\u00f6k","p\u00e9ntek","szombat"],AbbreviatedDayNames:["V","H","K","Sze","Cs","P","Szo"],MonthNames:["janu\u00e1r","febru\u00e1r","m\u00e1rcius","\u00e1prilis","m\u00e1jus","j\u00fanius","j\u00falius","augusztus","szeptember","okt\u00f3ber","november","december",""],AbbreviatedMonthNames:["jan.","febr.","m\u00e1rc.","\u00e1pr.","m\u00e1j.","j\u00fan.","j\u00fal.","aug.","szept.","okt.","nov.","dec.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"de.", PMDesignator:"du.",DateSeparator:". ",TimeSeparator:":",ShortDatePattern:"531"},16:{LCID:16,Name:"it",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domenica","luned\u00ec","marted\u00ec","mercoled\u00ec","gioved\u00ec","venerd\u00ec","sabato"],AbbreviatedDayNames:["dom","lun","mar","mer","gio","ven","sab"],MonthNames:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto", "settembre","ottobre","novembre","dicembre",""],AbbreviatedMonthNames:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},17:{LCID:17,Name:"ja",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u00a5",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5", "\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],AbbreviatedDayNames:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],MonthNames:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708",""],AbbreviatedMonthNames:["1","2","3","4","5","6","7","8","9","10","11","12",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u5348\u524d",PMDesignator:"\u5348\u5f8c", DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"531"},18:{LCID:18,Name:"ko",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u20a9",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],AbbreviatedDayNames:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],MonthNames:["1\uc6d4","2\uc6d4", "3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4",""],AbbreviatedMonthNames:["1","2","3","4","5","6","7","8","9","10","11","12",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\uc624\uc804",PMDesignator:"\uc624\ud6c4",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"531"},21:{LCID:21,Name:"pl",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"z\u0142",NumberDecimalSeparator:",",NumberGroupSeparator:" ", NumberGroupSizes:[3],DayNames:["niedziela","poniedzia\u0142ek","wtorek","\u015broda","czwartek","pi\u0105tek","sobota"],AbbreviatedDayNames:["niedz.","pon.","wt.","\u015br.","czw.","pt.","sob."],MonthNames:["stycze\u0144","luty","marzec","kwiecie\u0144","maj","czerwiec","lipiec","sierpie\u0144","wrzesie\u0144","pa\u017adziernik","listopad","grudzie\u0144",""],AbbreviatedMonthNames:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","pa\u017a","lis","gru",""],MonthGenitiveNames:["stycznia","lutego", "marca","kwietnia","maja","czerwca","lipca","sierpnia","wrze\u015bnia","pa\u017adziernika","listopada","grudnia",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},22:{LCID:22,Name:"pt",CurrencyPositivePattern:2,CurrencyNegativePattern:9,CurrencySymbol:"R$",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","segunda-feira","ter\u00e7a-feira","quarta-feira","quinta-feira","sexta-feira", "s\u00e1bado"],AbbreviatedDayNames:["dom","seg","ter","qua","qui","sex","s\u00e1b"],MonthNames:["janeiro","fevereiro","mar\u00e7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],AbbreviatedMonthNames:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},25:{LCID:25,Name:"ru",CurrencyPositivePattern:3, CurrencyNegativePattern:8,CurrencySymbol:"\u20bd",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"],AbbreviatedDayNames:["\u0412\u0441", "\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],MonthNames:["\u042f\u043d\u0432\u0430\u0440\u044c","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c", "\u0414\u0435\u043a\u0430\u0431\u0440\u044c",""],AbbreviatedMonthNames:["\u044f\u043d\u0432","\u0444\u0435\u0432","\u043c\u0430\u0440","\u0430\u043f\u0440","\u043c\u0430\u0439","\u0438\u044e\u043d","\u0438\u044e\u043b","\u0430\u0432\u0433","\u0441\u0435\u043d","\u043e\u043a\u0442","\u043d\u043e\u044f","\u0434\u0435\u043a",""],MonthGenitiveNames:["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f", "\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f",""],AbbreviatedMonthGenitiveNames:["\u044f\u043d\u0432","\u0444\u0435\u0432","\u043c\u0430\u0440","\u0430\u043f\u0440","\u043c\u0430\u044f","\u0438\u044e\u043d","\u0438\u044e\u043b","\u0430\u0432\u0433", "\u0441\u0435\u043d","\u043e\u043a\u0442","\u043d\u043e\u044f","\u0434\u0435\u043a",""],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},29:{LCID:29,Name:"sv",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"kr",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["s\u00f6ndag","m\u00e5ndag","tisdag","onsdag","torsdag","fredag","l\u00f6rdag"],AbbreviatedDayNames:["s\u00f6n","m\u00e5n","tis","ons","tor","fre", "l\u00f6r"],MonthNames:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december",""],AbbreviatedMonthNames:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"531"},31:{LCID:31,Name:"tr",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u20ba",NumberDecimalSeparator:",", NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["Pazar","Pazartesi","Sal\u0131","\u00c7ar\u015famba","Per\u015fembe","Cuma","Cumartesi"],AbbreviatedDayNames:["Paz","Pzt","Sal","\u00c7ar","Per","Cum","Cmt"],MonthNames:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\u00fcl","Ekim","Kas\u0131m","Aral\u0131k",""],AbbreviatedMonthNames:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[], AMDesignator:"\u00d6\u00d6",PMDesignator:"\u00d6S",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"035"},34:{LCID:34,Name:"uk",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20b4",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u043d\u0435\u0434\u0456\u043b\u044f","\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a","\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a","\u0441\u0435\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440", "\u043f'\u044f\u0442\u043d\u0438\u0446\u044f","\u0441\u0443\u0431\u043e\u0442\u0430"],AbbreviatedDayNames:["\u041d\u0434","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],MonthNames:["\u0441\u0456\u0447\u0435\u043d\u044c","\u043b\u044e\u0442\u0438\u0439","\u0431\u0435\u0440\u0435\u0437\u0435\u043d\u044c","\u043a\u0432\u0456\u0442\u0435\u043d\u044c","\u0442\u0440\u0430\u0432\u0435\u043d\u044c","\u0447\u0435\u0440\u0432\u0435\u043d\u044c","\u043b\u0438\u043f\u0435\u043d\u044c", "\u0441\u0435\u0440\u043f\u0435\u043d\u044c","\u0432\u0435\u0440\u0435\u0441\u0435\u043d\u044c","\u0436\u043e\u0432\u0442\u0435\u043d\u044c","\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434","\u0433\u0440\u0443\u0434\u0435\u043d\u044c",""],AbbreviatedMonthNames:["\u0421\u0456\u0447","\u041b\u044e\u0442","\u0411\u0435\u0440","\u041a\u0432\u0456","\u0422\u0440\u0430","\u0427\u0435\u0440","\u041b\u0438\u043f","\u0421\u0435\u0440","\u0412\u0435\u0440","\u0416\u043e\u0432","\u041b\u0438\u0441","\u0413\u0440\u0443", ""],MonthGenitiveNames:["\u0441\u0456\u0447\u043d\u044f","\u043b\u044e\u0442\u043e\u0433\u043e","\u0431\u0435\u0440\u0435\u0437\u043d\u044f","\u043a\u0432\u0456\u0442\u043d\u044f","\u0442\u0440\u0430\u0432\u043d\u044f","\u0447\u0435\u0440\u0432\u043d\u044f","\u043b\u0438\u043f\u043d\u044f","\u0441\u0435\u0440\u043f\u043d\u044f","\u0432\u0435\u0440\u0435\u0441\u043d\u044f","\u0436\u043e\u0432\u0442\u043d\u044f","\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430","\u0433\u0440\u0443\u0434\u043d\u044f", ""],AbbreviatedMonthGenitiveNames:["\u0441\u0456\u0447","\u043b\u044e\u0442","\u0431\u0435\u0440","\u043a\u0432\u0456","\u0442\u0440\u0430","\u0447\u0435\u0440","\u043b\u0438\u043f","\u0441\u0435\u0440","\u0432\u0435\u0440","\u0436\u043e\u0432","\u043b\u0438\u0441","\u0433\u0440\u0443",""],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},36:{LCID:36,Name:"sl",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",", NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["nedelja","ponedeljek","torek","sreda","\u010detrtek","petek","sobota"],AbbreviatedDayNames:["ned.","pon.","tor.","sre.","\u010det.","pet.","sob."],MonthNames:["januar","februar","marec","april","maj","junij","julij","avgust","september","oktober","november","december",""],AbbreviatedMonthNames:["jan.","feb.","mar.","apr.","maj","jun.","jul.","avg.","sep.","okt.","nov.","dec.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"dop.", PMDesignator:"pop.",DateSeparator:". ",TimeSeparator:":",ShortDatePattern:"035"},38:{LCID:38,Name:"lv",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["sv\u0113tdiena","pirmdiena","otrdiena","tre\u0161diena","ceturtdiena","piektdiena","sestdiena"],AbbreviatedDayNames:["sv\u0113td.","pirmd.","otrd.","tre\u0161d.","ceturtd.","piektd.","sestd."],MonthNames:["janv\u0101ris","febru\u0101ris", "marts","apr\u012blis","maijs","j\u016bnijs","j\u016blijs","augusts","septembris","oktobris","novembris","decembris",""],AbbreviatedMonthNames:["janv.","febr.","marts","apr.","maijs","j\u016bn.","j\u016bl.","aug.","sept.","okt.","nov.","dec.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"priek\u0161p.",PMDesignator:"p\u0113cp.",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},42:{LCID:42,Name:"vi",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ab", NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["Chu\u0309 Nh\u00e2\u0323t","Th\u01b0\u0301 Hai","Th\u01b0\u0301 Ba","Th\u01b0\u0301 T\u01b0","Th\u01b0\u0301 N\u0103m","Th\u01b0\u0301 Sa\u0301u","Th\u01b0\u0301 Ba\u0309y"],AbbreviatedDayNames:["CN","T2","T3","T4","T5","T6","T7"],MonthNames:["Tha\u0301ng Gi\u00eang","Tha\u0301ng Hai","Tha\u0301ng Ba","Tha\u0301ng T\u01b0","Tha\u0301ng N\u0103m","Tha\u0301ng Sa\u0301u","Tha\u0301ng Ba\u0309y","Tha\u0301ng Ta\u0301m", "Tha\u0301ng Chi\u0301n","Tha\u0301ng M\u01b0\u01a1\u0300i","Tha\u0301ng M\u01b0\u01a1\u0300i M\u00f4\u0323t","Tha\u0301ng M\u01b0\u01a1\u0300i Hai",""],AbbreviatedMonthNames:["Thg1","Thg2","Thg3","Thg4","Thg5","Thg6","Thg7","Thg8","Thg9","Thg10","Thg11","Thg12",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"SA",PMDesignator:"CH",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},44:{LCID:44,Name:"az",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20bc", NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["bazar","bazar ert\u0259si","\u00e7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131","\u00e7\u0259r\u015f\u0259nb\u0259","c\u00fcm\u0259 ax\u015fam\u0131","c\u00fcm\u0259","\u015f\u0259nb\u0259"],AbbreviatedDayNames:["B.","B.E.","\u00c7.A.","\u00c7.","C.A.","C.","\u015e."],MonthNames:["Yanvar","Fevral","Mart","Aprel","May","\u0130yun","\u0130yul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],AbbreviatedMonthNames:["yan", "fev","mar","apr","may","iyn","iyl","avq","sen","okt","noy","dek",""],MonthGenitiveNames:["yanvar","fevral","mart","aprel","may","iyun","iyul","avqust","sentyabr","oktyabr","noyabr","dekabr",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},63:{LCID:63,Name:"kk",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20b8",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u0436\u0435\u043a\u0441\u0435\u043d\u0431\u0456", "\u0434\u04af\u0439\u0441\u0435\u043d\u0431\u0456","\u0441\u0435\u0439\u0441\u0435\u043d\u0431\u0456","\u0441\u04d9\u0440\u0441\u0435\u043d\u0431\u0456","\u0431\u0435\u0439\u0441\u0435\u043d\u0431\u0456","\u0436\u04b1\u043c\u0430","\u0441\u0435\u043d\u0431\u0456"],AbbreviatedDayNames:["\u0436\u0441","\u0434\u0441","\u0441\u0441","\u0441\u0440","\u0431\u0441","\u0436\u043c","\u0441\u0431"],MonthNames:["\u049a\u0430\u04a3\u0442\u0430\u0440","\u0410\u049b\u043f\u0430\u043d","\u041d\u0430\u0443\u0440\u044b\u0437", "\u0421\u04d9\u0443\u0456\u0440","\u041c\u0430\u043c\u044b\u0440","\u041c\u0430\u0443\u0441\u044b\u043c","\u0428\u0456\u043b\u0434\u0435","\u0422\u0430\u043c\u044b\u0437","\u049a\u044b\u0440\u043a\u04af\u0439\u0435\u043a","\u049a\u0430\u0437\u0430\u043d","\u049a\u0430\u0440\u0430\u0448\u0430","\u0416\u0435\u043b\u0442\u043e\u049b\u0441\u0430\u043d",""],AbbreviatedMonthNames:["\u049b\u0430\u04a3.","\u0430\u049b\u043f.","\u043d\u0430\u0443.","\u0441\u04d9\u0443.","\u043c\u0430\u043c.","\u043c\u0430\u0443.", "\u0448\u0456\u043b.","\u0442\u0430\u043c.","\u049b\u044b\u0440.","\u049b\u0430\u0437.","\u049b\u0430\u0440.","\u0436\u0435\u043b.",""],MonthGenitiveNames:["\u049b\u0430\u04a3\u0442\u0430\u0440","\u0430\u049b\u043f\u0430\u043d","\u043d\u0430\u0443\u0440\u044b\u0437","\u0441\u04d9\u0443\u0456\u0440","\u043c\u0430\u043c\u044b\u0440","\u043c\u0430\u0443\u0441\u044b\u043c","\u0448\u0456\u043b\u0434\u0435","\u0442\u0430\u043c\u044b\u0437","\u049b\u044b\u0440\u043a\u04af\u0439\u0435\u043a","\u049b\u0430\u0437\u0430\u043d", "\u049b\u0430\u0440\u0430\u0448\u0430","\u0436\u0435\u043b\u0442\u043e\u049b\u0441\u0430\u043d",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},1026:{LCID:1026,Name:"bg-BG",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u043b\u0432.",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u043d\u0435\u0434\u0435\u043b\u044f","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a", "\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u044f\u0434\u0430","\u0447\u0435\u0442\u0432\u044a\u0440\u0442\u044a\u043a","\u043f\u0435\u0442\u044a\u043a","\u0441\u044a\u0431\u043e\u0442\u0430"],AbbreviatedDayNames:["\u043d\u0435\u0434","\u043f\u043e\u043d","\u0432\u0442","\u0441\u0440","\u0447\u0435\u0442\u0432","\u043f\u0435\u0442","\u0441\u044a\u0431"],MonthNames:["\u044f\u043d\u0443\u0430\u0440\u0438","\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440\u0438\u043b", "\u043c\u0430\u0439","\u044e\u043d\u0438","\u044e\u043b\u0438","\u0430\u0432\u0433\u0443\u0441\u0442","\u0441\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438","\u043e\u043a\u0442\u043e\u043c\u0432\u0440\u0438","\u043d\u043e\u0435\u043c\u0432\u0440\u0438","\u0434\u0435\u043a\u0435\u043c\u0432\u0440\u0438",""],AbbreviatedMonthNames:["\u044f\u043d\u0443","\u0444\u0435\u0432","\u043c\u0430\u0440","\u0430\u043f\u0440","\u043c\u0430\u0439","\u044e\u043d\u0438","\u044e\u043b\u0438","\u0430\u0432\u0433", "\u0441\u0435\u043f","\u043e\u043a\u0442","\u043d\u043e\u0435","\u0434\u0435\u043a",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"025"},1028:{LCID:1028,Name:"zh-TW",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"NT$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09", "\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],AbbreviatedDayNames:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],MonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],AbbreviatedMonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708", "\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u4e0a\u5348",PMDesignator:"\u4e0b\u5348",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"520"},1029:{LCID:1029,Name:"cs-CZ",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"K\u010d",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["ned\u011ble","pond\u011bl\u00ed","\u00fater\u00fd", "st\u0159eda","\u010dtvrtek","p\u00e1tek","sobota"],AbbreviatedDayNames:["ne","po","\u00fat","st","\u010dt","p\u00e1","so"],MonthNames:["leden","\u00fanor","b\u0159ezen","duben","kv\u011bten","\u010derven","\u010dervenec","srpen","z\u00e1\u0159\u00ed","\u0159\u00edjen","listopad","prosinec",""],AbbreviatedMonthNames:["led","\u00fano","b\u0159e","dub","kv\u011b","\u010dvn","\u010dvc","srp","z\u00e1\u0159","\u0159\u00edj","lis","pro",""],MonthGenitiveNames:["ledna","\u00fanora","b\u0159ezna","dubna", "kv\u011btna","\u010dervna","\u010dervence","srpna","z\u00e1\u0159\u00ed","\u0159\u00edjna","listopadu","prosince",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"dop.",PMDesignator:"odp.",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},1031:{LCID:1031,Name:"de-DE",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag", "Samstag"],AbbreviatedDayNames:["So","Mo","Di","Mi","Do","Fr","Sa"],MonthNames:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],AbbreviatedMonthNames:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},1032:{LCID:1032,Name:"el-GR",CurrencyPositivePattern:3,CurrencyNegativePattern:8, CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],AbbreviatedDayNames:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9", "\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],MonthNames:["\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2","\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2","\u039c\u03ac\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2","\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2", "\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2","\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2",""],AbbreviatedMonthNames:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u03ca","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5", "\u0394\u03b5\u03ba",""],MonthGenitiveNames:["\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5","\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5","\u039c\u03b1\u0390\u03bf\u03c5","\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5","\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5","\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5","\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5", "\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5","\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u03c0\u03bc",PMDesignator:"\u03bc\u03bc",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},1033:{LCID:1033,Name:"en-US",CurrencyPositivePattern:0,CurrencyNegativePattern:0,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3], DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"205"}, 1035:{LCID:1035,Name:"fi-FI",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],AbbreviatedDayNames:["su","ma","ti","ke","to","pe","la"],MonthNames:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kes\u00e4kuu","hein\u00e4kuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu",""],AbbreviatedMonthNames:["tammi", "helmi","maalis","huhti","touko","kes\u00e4","hein\u00e4","elo","syys","loka","marras","joulu",""],MonthGenitiveNames:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta",""],AbbreviatedMonthGenitiveNames:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kes\u00e4k.","hein\u00e4k.","elok.","syysk.","lokak.","marrask.","jouluk.",""],AMDesignator:"ap.",PMDesignator:"ip.",DateSeparator:".", TimeSeparator:".",ShortDatePattern:"025"},1036:{LCID:1036,Name:"fr-FR",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre", ""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},1038:{LCID:1038,Name:"hu-HU",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"Ft",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["vas\u00e1rnap","h\u00e9tf\u0151","kedd", "szerda","cs\u00fct\u00f6rt\u00f6k","p\u00e9ntek","szombat"],AbbreviatedDayNames:["V","H","K","Sze","Cs","P","Szo"],MonthNames:["janu\u00e1r","febru\u00e1r","m\u00e1rcius","\u00e1prilis","m\u00e1jus","j\u00fanius","j\u00falius","augusztus","szeptember","okt\u00f3ber","november","december",""],AbbreviatedMonthNames:["jan.","febr.","m\u00e1rc.","\u00e1pr.","m\u00e1j.","j\u00fan.","j\u00fal.","aug.","szept.","okt.","nov.","dec.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"de.", PMDesignator:"du.",DateSeparator:". ",TimeSeparator:":",ShortDatePattern:"531"},1040:{LCID:1040,Name:"it-IT",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domenica","luned\u00ec","marted\u00ec","mercoled\u00ec","gioved\u00ec","venerd\u00ec","sabato"],AbbreviatedDayNames:["dom","lun","mar","mer","gio","ven","sab"],MonthNames:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio", "agosto","settembre","ottobre","novembre","dicembre",""],AbbreviatedMonthNames:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},1041:{LCID:1041,Name:"ja-JP",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u00a5",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u65e5\u66dc\u65e5", "\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],AbbreviatedDayNames:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],MonthNames:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708",""],AbbreviatedMonthNames:["1","2","3","4","5","6","7","8","9","10","11","12",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u5348\u524d", PMDesignator:"\u5348\u5f8c",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"531"},1042:{LCID:1042,Name:"ko-KR",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u20a9",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],AbbreviatedDayNames:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"], MonthNames:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4",""],AbbreviatedMonthNames:["1","2","3","4","5","6","7","8","9","10","11","12",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\uc624\uc804",PMDesignator:"\uc624\ud6c4",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"531"},1043:{LCID:1043,Name:"nl-NL",CurrencyPositivePattern:2,CurrencyNegativePattern:12,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",", NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],AbbreviatedDayNames:["zo","ma","di","wo","do","vr","za"],MonthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december",""],AbbreviatedMonthNames:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"", DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"025"},1045:{LCID:1045,Name:"pl-PL",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"z\u0142",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["niedziela","poniedzia\u0142ek","wtorek","\u015broda","czwartek","pi\u0105tek","sobota"],AbbreviatedDayNames:["niedz.","pon.","wt.","\u015br.","czw.","pt.","sob."],MonthNames:["stycze\u0144","luty","marzec","kwiecie\u0144","maj","czerwiec","lipiec","sierpie\u0144", "wrzesie\u0144","pa\u017adziernik","listopad","grudzie\u0144",""],AbbreviatedMonthNames:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","pa\u017a","lis","gru",""],MonthGenitiveNames:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","wrze\u015bnia","pa\u017adziernika","listopada","grudnia",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},1046:{LCID:1046,Name:"pt-BR",CurrencyPositivePattern:2, CurrencyNegativePattern:9,CurrencySymbol:"R$",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","segunda-feira","ter\u00e7a-feira","quarta-feira","quinta-feira","sexta-feira","s\u00e1bado"],AbbreviatedDayNames:["dom","seg","ter","qua","qui","sex","s\u00e1b"],MonthNames:["janeiro","fevereiro","mar\u00e7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],AbbreviatedMonthNames:["jan","fev","mar","abr","mai","jun","jul", "ago","set","out","nov","dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},1049:{LCID:1049,Name:"ru-RU",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20bd",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a", "\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"],AbbreviatedDayNames:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],MonthNames:["\u042f\u043d\u0432\u0430\u0440\u044c","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c", "\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c","\u0414\u0435\u043a\u0430\u0431\u0440\u044c",""],AbbreviatedMonthNames:["\u044f\u043d\u0432","\u0444\u0435\u0432","\u043c\u0430\u0440","\u0430\u043f\u0440","\u043c\u0430\u0439","\u0438\u044e\u043d","\u0438\u044e\u043b","\u0430\u0432\u0433","\u0441\u0435\u043d", "\u043e\u043a\u0442","\u043d\u043e\u044f","\u0434\u0435\u043a",""],MonthGenitiveNames:["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f", ""],AbbreviatedMonthGenitiveNames:["\u044f\u043d\u0432","\u0444\u0435\u0432","\u043c\u0430\u0440","\u0430\u043f\u0440","\u043c\u0430\u044f","\u0438\u044e\u043d","\u0438\u044e\u043b","\u0430\u0432\u0433","\u0441\u0435\u043d","\u043e\u043a\u0442","\u043d\u043e\u044f","\u0434\u0435\u043a",""],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},1050:{LCID:1050,Name:"hr-HR",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"kn",NumberDecimalSeparator:",", NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["nedjelja","ponedjeljak","utorak","srijeda","\u010detvrtak","petak","subota"],AbbreviatedDayNames:["ned","pon","uto","sri","\u010det","pet","sub"],MonthNames:["sije\u010danj","velja\u010da","o\u017eujak","travanj","svibanj","lipanj","srpanj","kolovoz","rujan","listopad","studeni","prosinac",""],AbbreviatedMonthNames:["sij","vlj","o\u017eu","tra","svi","lip","srp","kol","ruj","lis","stu","pro",""],MonthGenitiveNames:["sije\u010dnja","velja\u010de", "o\u017eujka","travnja","svibnja","lipnja","srpnja","kolovoza","rujna","listopada","studenog","prosinca",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"025"},1051:{LCID:1051,Name:"sk-SK",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["nede\u013ea","pondelok","utorok","streda","\u0161tvrtok","piatok","sobota"],AbbreviatedDayNames:["ne", "po","ut","st","\u0161t","pi","so"],MonthNames:["janu\u00e1r","febru\u00e1r","marec","apr\u00edl","m\u00e1j","j\u00fan","j\u00fal","august","september","okt\u00f3ber","november","december",""],AbbreviatedMonthNames:["jan","feb","mar","apr","m\u00e1j","j\u00fan","j\u00fal","aug","sep","okt","nov","dec",""],MonthGenitiveNames:["janu\u00e1ra","febru\u00e1ra","marca","apr\u00edla","m\u00e1ja","j\u00fana","j\u00fala","augusta","septembra","okt\u00f3bra","novembra","decembra",""],AbbreviatedMonthGenitiveNames:[], AMDesignator:"AM",PMDesignator:"PM",DateSeparator:". ",TimeSeparator:":",ShortDatePattern:"025"},1053:{LCID:1053,Name:"sv-SE",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"kr",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["s\u00f6ndag","m\u00e5ndag","tisdag","onsdag","torsdag","fredag","l\u00f6rdag"],AbbreviatedDayNames:["s\u00f6n","m\u00e5n","tis","ons","tor","fre","l\u00f6r"],MonthNames:["januari","februari","mars","april","maj","juni", "juli","augusti","september","oktober","november","december",""],AbbreviatedMonthNames:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"531"},1055:{LCID:1055,Name:"tr-TR",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u20ba",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["Pazar", "Pazartesi","Sal\u0131","\u00c7ar\u015famba","Per\u015fembe","Cuma","Cumartesi"],AbbreviatedDayNames:["Paz","Pzt","Sal","\u00c7ar","Per","Cum","Cmt"],MonthNames:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\u00fcl","Ekim","Kas\u0131m","Aral\u0131k",""],AbbreviatedMonthNames:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u00d6\u00d6",PMDesignator:"\u00d6S", DateSeparator:".",TimeSeparator:":",ShortDatePattern:"035"},1058:{LCID:1058,Name:"uk-UA",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20b4",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u043d\u0435\u0434\u0456\u043b\u044f","\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a","\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a","\u0441\u0435\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440","\u043f'\u044f\u0442\u043d\u0438\u0446\u044f", "\u0441\u0443\u0431\u043e\u0442\u0430"],AbbreviatedDayNames:["\u041d\u0434","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],MonthNames:["\u0441\u0456\u0447\u0435\u043d\u044c","\u043b\u044e\u0442\u0438\u0439","\u0431\u0435\u0440\u0435\u0437\u0435\u043d\u044c","\u043a\u0432\u0456\u0442\u0435\u043d\u044c","\u0442\u0440\u0430\u0432\u0435\u043d\u044c","\u0447\u0435\u0440\u0432\u0435\u043d\u044c","\u043b\u0438\u043f\u0435\u043d\u044c","\u0441\u0435\u0440\u043f\u0435\u043d\u044c", "\u0432\u0435\u0440\u0435\u0441\u0435\u043d\u044c","\u0436\u043e\u0432\u0442\u0435\u043d\u044c","\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434","\u0433\u0440\u0443\u0434\u0435\u043d\u044c",""],AbbreviatedMonthNames:["\u0421\u0456\u0447","\u041b\u044e\u0442","\u0411\u0435\u0440","\u041a\u0432\u0456","\u0422\u0440\u0430","\u0427\u0435\u0440","\u041b\u0438\u043f","\u0421\u0435\u0440","\u0412\u0435\u0440","\u0416\u043e\u0432","\u041b\u0438\u0441","\u0413\u0440\u0443",""],MonthGenitiveNames:["\u0441\u0456\u0447\u043d\u044f", "\u043b\u044e\u0442\u043e\u0433\u043e","\u0431\u0435\u0440\u0435\u0437\u043d\u044f","\u043a\u0432\u0456\u0442\u043d\u044f","\u0442\u0440\u0430\u0432\u043d\u044f","\u0447\u0435\u0440\u0432\u043d\u044f","\u043b\u0438\u043f\u043d\u044f","\u0441\u0435\u0440\u043f\u043d\u044f","\u0432\u0435\u0440\u0435\u0441\u043d\u044f","\u0436\u043e\u0432\u0442\u043d\u044f","\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430","\u0433\u0440\u0443\u0434\u043d\u044f",""],AbbreviatedMonthGenitiveNames:["\u0441\u0456\u0447", "\u043b\u044e\u0442","\u0431\u0435\u0440","\u043a\u0432\u0456","\u0442\u0440\u0430","\u0447\u0435\u0440","\u043b\u0438\u043f","\u0441\u0435\u0440","\u0432\u0435\u0440","\u0436\u043e\u0432","\u043b\u0438\u0441","\u0433\u0440\u0443",""],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},1060:{LCID:1060,Name:"sl-SI",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3], DayNames:["nedelja","ponedeljek","torek","sreda","\u010detrtek","petek","sobota"],AbbreviatedDayNames:["ned.","pon.","tor.","sre.","\u010det.","pet.","sob."],MonthNames:["januar","februar","marec","april","maj","junij","julij","avgust","september","oktober","november","december",""],AbbreviatedMonthNames:["jan.","feb.","mar.","apr.","maj","jun.","jul.","avg.","sep.","okt.","nov.","dec.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"dop.",PMDesignator:"pop.",DateSeparator:". ", TimeSeparator:":",ShortDatePattern:"035"},1062:{LCID:1062,Name:"lv-LV",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["sv\u0113tdiena","pirmdiena","otrdiena","tre\u0161diena","ceturtdiena","piektdiena","sestdiena"],AbbreviatedDayNames:["sv\u0113td.","pirmd.","otrd.","tre\u0161d.","ceturtd.","piektd.","sestd."],MonthNames:["janv\u0101ris","febru\u0101ris","marts","apr\u012blis","maijs","j\u016bnijs", "j\u016blijs","augusts","septembris","oktobris","novembris","decembris",""],AbbreviatedMonthNames:["janv.","febr.","marts","apr.","maijs","j\u016bn.","j\u016bl.","aug.","sept.","okt.","nov.","dec.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"priek\u0161p.",PMDesignator:"p\u0113cp.",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},1066:{LCID:1066,Name:"vi-VN",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ab",NumberDecimalSeparator:",", NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["Chu\u0309 Nh\u00e2\u0323t","Th\u01b0\u0301 Hai","Th\u01b0\u0301 Ba","Th\u01b0\u0301 T\u01b0","Th\u01b0\u0301 N\u0103m","Th\u01b0\u0301 Sa\u0301u","Th\u01b0\u0301 Ba\u0309y"],AbbreviatedDayNames:["CN","T2","T3","T4","T5","T6","T7"],MonthNames:["Tha\u0301ng Gi\u00eang","Tha\u0301ng Hai","Tha\u0301ng Ba","Tha\u0301ng T\u01b0","Tha\u0301ng N\u0103m","Tha\u0301ng Sa\u0301u","Tha\u0301ng Ba\u0309y","Tha\u0301ng Ta\u0301m","Tha\u0301ng Chi\u0301n", "Tha\u0301ng M\u01b0\u01a1\u0300i","Tha\u0301ng M\u01b0\u01a1\u0300i M\u00f4\u0323t","Tha\u0301ng M\u01b0\u01a1\u0300i Hai",""],AbbreviatedMonthNames:["Thg1","Thg2","Thg3","Thg4","Thg5","Thg6","Thg7","Thg8","Thg9","Thg10","Thg11","Thg12",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"SA",PMDesignator:"CH",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},1068:{LCID:1068,Name:"az-Latn-AZ",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20bc", NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["bazar","bazar ert\u0259si","\u00e7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131","\u00e7\u0259r\u015f\u0259nb\u0259","c\u00fcm\u0259 ax\u015fam\u0131","c\u00fcm\u0259","\u015f\u0259nb\u0259"],AbbreviatedDayNames:["B.","B.E.","\u00c7.A.","\u00c7.","C.A.","C.","\u015e."],MonthNames:["Yanvar","Fevral","Mart","Aprel","May","\u0130yun","\u0130yul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],AbbreviatedMonthNames:["yan", "fev","mar","apr","may","iyn","iyl","avq","sen","okt","noy","dek",""],MonthGenitiveNames:["yanvar","fevral","mart","aprel","may","iyun","iyul","avqust","sentyabr","oktyabr","noyabr","dekabr",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},1087:{LCID:1087,Name:"kk-KZ",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20b8",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3], DayNames:["\u0436\u0435\u043a\u0441\u0435\u043d\u0431\u0456","\u0434\u04af\u0439\u0441\u0435\u043d\u0431\u0456","\u0441\u0435\u0439\u0441\u0435\u043d\u0431\u0456","\u0441\u04d9\u0440\u0441\u0435\u043d\u0431\u0456","\u0431\u0435\u0439\u0441\u0435\u043d\u0431\u0456","\u0436\u04b1\u043c\u0430","\u0441\u0435\u043d\u0431\u0456"],AbbreviatedDayNames:["\u0436\u0441","\u0434\u0441","\u0441\u0441","\u0441\u0440","\u0431\u0441","\u0436\u043c","\u0441\u0431"],MonthNames:["\u049a\u0430\u04a3\u0442\u0430\u0440", "\u0410\u049b\u043f\u0430\u043d","\u041d\u0430\u0443\u0440\u044b\u0437","\u0421\u04d9\u0443\u0456\u0440","\u041c\u0430\u043c\u044b\u0440","\u041c\u0430\u0443\u0441\u044b\u043c","\u0428\u0456\u043b\u0434\u0435","\u0422\u0430\u043c\u044b\u0437","\u049a\u044b\u0440\u043a\u04af\u0439\u0435\u043a","\u049a\u0430\u0437\u0430\u043d","\u049a\u0430\u0440\u0430\u0448\u0430","\u0416\u0435\u043b\u0442\u043e\u049b\u0441\u0430\u043d",""],AbbreviatedMonthNames:["\u049b\u0430\u04a3.","\u0430\u049b\u043f.","\u043d\u0430\u0443.", "\u0441\u04d9\u0443.","\u043c\u0430\u043c.","\u043c\u0430\u0443.","\u0448\u0456\u043b.","\u0442\u0430\u043c.","\u049b\u044b\u0440.","\u049b\u0430\u0437.","\u049b\u0430\u0440.","\u0436\u0435\u043b.",""],MonthGenitiveNames:["\u049b\u0430\u04a3\u0442\u0430\u0440","\u0430\u049b\u043f\u0430\u043d","\u043d\u0430\u0443\u0440\u044b\u0437","\u0441\u04d9\u0443\u0456\u0440","\u043c\u0430\u043c\u044b\u0440","\u043c\u0430\u0443\u0441\u044b\u043c","\u0448\u0456\u043b\u0434\u0435","\u0442\u0430\u043c\u044b\u0437", "\u049b\u044b\u0440\u043a\u04af\u0439\u0435\u043a","\u049b\u0430\u0437\u0430\u043d","\u049b\u0430\u0440\u0430\u0448\u0430","\u0436\u0435\u043b\u0442\u043e\u049b\u0441\u0430\u043d",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},2052:{LCID:2052,Name:"zh-CN",CurrencyPositivePattern:0,CurrencyNegativePattern:2,CurrencySymbol:"\u00a5",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u661f\u671f\u65e5", "\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],AbbreviatedDayNames:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],MonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],AbbreviatedMonthNames:["1\u6708","2\u6708", "3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u4e0a\u5348",PMDesignator:"\u4e0b\u5348",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"520"},2055:{LCID:2055,Name:"de-CH",CurrencyPositivePattern:2,CurrencyNegativePattern:2,CurrencySymbol:"CHF",NumberDecimalSeparator:".",NumberGroupSeparator:"\u2019",NumberGroupSizes:[3],DayNames:["Sonntag","Montag","Dienstag","Mittwoch", "Donnerstag","Freitag","Samstag"],AbbreviatedDayNames:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],MonthNames:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],AbbreviatedMonthNames:["Jan","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:["Jan.","Feb.","M\u00e4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez.",""],AMDesignator:"AM",PMDesignator:"PM", DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},2057:{LCID:2057,Name:"en-GB",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u00a3",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December", ""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},2058:{LCID:2058,Name:"es-MX",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"], AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a. m.",PMDesignator:"p. m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},2060:{LCID:2060,Name:"fr-BE", CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai", "juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"134"},2064:{LCID:2064,Name:"it-CH",CurrencyPositivePattern:2,CurrencyNegativePattern:2,CurrencySymbol:"CHF",NumberDecimalSeparator:".",NumberGroupSeparator:"\u2019",NumberGroupSizes:[3],DayNames:["domenica","luned\u00ec","marted\u00ec","mercoled\u00ec","gioved\u00ec","venerd\u00ec","sabato"],AbbreviatedDayNames:["dom", "lun","mar","mer","gio","ven","sab"],MonthNames:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre",""],AbbreviatedMonthNames:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},2070:{LCID:2070,Name:"pt-PT",CurrencyPositivePattern:3,CurrencyNegativePattern:8, CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["domingo","segunda-feira","ter\u00e7a-feira","quarta-feira","quinta-feira","sexta-feira","s\u00e1bado"],AbbreviatedDayNames:["dom","seg","ter","qua","qui","sex","s\u00e1b"],MonthNames:["janeiro","fevereiro","mar\u00e7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],AbbreviatedMonthNames:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov", "dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},2073:{LCID:2073,Name:"ru-MD",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"L",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a", "\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"],AbbreviatedDayNames:["\u0432\u0441","\u043f\u043d","\u0432\u0442","\u0441\u0440","\u0447\u0442","\u043f\u0442","\u0441\u0431"],MonthNames:["\u044f\u043d\u0432\u0430\u0440\u044c","\u0444\u0435\u0432\u0440\u0430\u043b\u044c","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440\u0435\u043b\u044c","\u043c\u0430\u0439","\u0438\u044e\u043d\u044c", "\u0438\u044e\u043b\u044c","\u0430\u0432\u0433\u0443\u0441\u0442","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u043e\u043a\u0442\u044f\u0431\u0440\u044c","\u043d\u043e\u044f\u0431\u0440\u044c","\u0434\u0435\u043a\u0430\u0431\u0440\u044c",""],AbbreviatedMonthNames:["\u044f\u043d\u0432.","\u0444\u0435\u0432\u0440.","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440.","\u043c\u0430\u0439","\u0438\u044e\u043d\u044c","\u0438\u044e\u043b\u044c","\u0430\u0432\u0433.","\u0441\u0435\u043d\u0442.","\u043e\u043a\u0442.", "\u043d\u043e\u044f\u0431.","\u0434\u0435\u043a.",""],MonthGenitiveNames:["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f", ""],AbbreviatedMonthGenitiveNames:["\u044f\u043d\u0432.","\u0444\u0435\u0432\u0440.","\u043c\u0430\u0440.","\u0430\u043f\u0440.","\u043c\u0430\u044f","\u0438\u044e\u043d.","\u0438\u044e\u043b.","\u0430\u0432\u0433.","\u0441\u0435\u043d\u0442.","\u043e\u043a\u0442.","\u043d\u043e\u044f\u0431.","\u0434\u0435\u043a.",""],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},2077:{LCID:2077,Name:"sv-FI",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac", NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["s\u00f6ndag","m\u00e5ndag","tisdag","onsdag","torsdag","fredag","l\u00f6rdag"],AbbreviatedDayNames:["s\u00f6n","m\u00e5n","tis","ons","tors","fre","l\u00f6r"],MonthNames:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december",""],AbbreviatedMonthNames:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec.",""],MonthGenitiveNames:[], AbbreviatedMonthGenitiveNames:[],AMDesignator:"fm",PMDesignator:"em",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"135"},2092:{LCID:2092,Name:"az-Cyrl-AZ",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20bc",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u0431\u0430\u0437\u0430\u0440","\u0431\u0430\u0437\u0430\u0440\u00a0\u0435\u0440\u0442\u04d9\u0441\u0438","\u0447\u04d9\u0440\u0448\u04d9\u043d\u0431\u04d9\u00a0\u0430\u0445\u0448\u0430\u043c\u044b", "\u0447\u04d9\u0440\u0448\u04d9\u043d\u0431\u04d9","\u04b9\u04af\u043c\u04d9\u00a0\u0430\u0445\u0448\u0430\u043c\u044b","\u04b9\u04af\u043c\u04d9","\u0448\u04d9\u043d\u0431\u04d9"],AbbreviatedDayNames:["\u0411","\u0411\u0435","\u0427\u0430","\u0427","\u04b8\u0430","\u04b8","\u0428"],MonthNames:["j\u0430\u043d\u0432\u0430\u0440","\u0444\u0435\u0432\u0440\u0430\u043b","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440\u0435\u043b","\u043c\u0430\u0458","\u0438\u0458\u0443\u043d","\u0438\u0458\u0443\u043b", "\u0430\u0432\u0433\u0443\u0441\u0442","\u0441\u0435\u043d\u0442\u0458\u0430\u0431\u0440","\u043e\u043a\u0442\u0458\u0430\u0431\u0440","\u043d\u043e\u0458\u0430\u0431\u0440","\u0434\u0435\u043a\u0430\u0431\u0440",""],AbbreviatedMonthNames:["\u0408\u0430\u043d","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0458","\u0418\u0458\u0443\u043d","\u0418\u0458\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043d","\u041e\u043a\u0442","\u041d\u043e\u044f","\u0414\u0435\u043a", ""],MonthGenitiveNames:["\u0458\u0430\u043d\u0432\u0430\u0440","\u0444\u0435\u0432\u0440\u0430\u043b","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440\u0435\u043b","\u043c\u0430\u0458","\u0438\u0458\u0443\u043d","\u0438\u0458\u0443\u043b","\u0430\u0432\u0433\u0443\u0441\u0442","\u0441\u0435\u043d\u0442\u0458\u0430\u0431\u0440","\u043e\u043a\u0442\u0458\u0430\u0431\u0440","\u043d\u043e\u0458\u0430\u0431\u0440","\u0434\u0435\u043a\u0430\u0431\u0440",""],AbbreviatedMonthGenitiveNames:["\u0408\u0430\u043d", "\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u043c\u0430\u044f","\u0438\u0458\u0443\u043d","\u0438\u0458\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043d","\u041e\u043a\u0442","\u041d\u043e\u044f","\u0414\u0435\u043a",""],AMDesignator:"",PMDesignator:"",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},3076:{LCID:3076,Name:"zh-HK",CurrencyPositivePattern:0,CurrencyNegativePattern:0,CurrencySymbol:"HK$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3], DayNames:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],AbbreviatedDayNames:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],MonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],AbbreviatedMonthNames:["\u4e00\u6708", "\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u4e0a\u5348",PMDesignator:"\u4e0b\u5348",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},3079:{LCID:3079,Name:"de-AT",CurrencyPositivePattern:2,CurrencyNegativePattern:9,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ", NumberGroupSizes:[3],DayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],AbbreviatedDayNames:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],MonthNames:["J\u00e4nner","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],AbbreviatedMonthNames:["J\u00e4n","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:["J\u00e4n.","Feb.","M\u00e4rz","Apr.", "Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez.",""],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},3081:{LCID:3081,Name:"en-AU",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February", "March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"035"},3082:{LCID:3082,Name:"es-ES",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3], DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["do.","lu.","ma.","mi.","ju.","vi.","s\u00e1."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"/", TimeSeparator:":",ShortDatePattern:"135"},3084:{LCID:3084,Name:"fr-CA",CurrencyPositivePattern:3,CurrencyNegativePattern:15,CurrencySymbol:"$",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""], AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"",PMDesignator:"",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"531"},4100:{LCID:4100,Name:"zh-SG",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u661f\u671f\u65e5","\u661f\u671f\u4e00", "\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],AbbreviatedDayNames:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],MonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],AbbreviatedMonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708", "\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u4e0a\u5348",PMDesignator:"\u4e0b\u5348",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},4103:{LCID:4103,Name:"de-LU",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["Sonntag", "Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],AbbreviatedDayNames:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],MonthNames:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],AbbreviatedMonthNames:["Jan","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:["Jan.","Feb.","M\u00e4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez.", ""],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},4105:{LCID:4105,Name:"en-CA",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September", "October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"531"},4106:{LCID:4106,Name:"es-GT",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"Q",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles", "jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"035"}, 4108:{LCID:4108,Name:"fr-CH",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"CHF",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.", "mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},4122:{LCID:4122,Name:"hr-BA",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"KM",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["nedjelja","ponedjeljak","utorak","srijeda","\u010detvrtak","petak","subota"],AbbreviatedDayNames:["ned", "pon","uto","sri","\u010det","pet","sub"],MonthNames:["sije\u010danj","velja\u010da","o\u017eujak","travanj","svibanj","lipanj","srpanj","kolovoz","rujan","listopad","studeni","prosinac",""],AbbreviatedMonthNames:["sij","velj","o\u017eu","tra","svi","lip","srp","kol","ruj","lis","stu","pro",""],MonthGenitiveNames:["sije\u010dnja","velja\u010de","o\u017eujka","travnja","svibnja","lipnja","srpnja","kolovoza","rujna","listopada","studenoga","prosinca",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM", PMDesignator:"PM",DateSeparator:". ",TimeSeparator:":",ShortDatePattern:"025"},5124:{LCID:5124,Name:"zh-MO",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"MOP",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],AbbreviatedDayNames:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db", "\u9031\u4e94","\u9031\u516d"],MonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],AbbreviatedMonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[], AMDesignator:"\u4e0a\u5348",PMDesignator:"\u4e0b\u5348",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},5127:{LCID:5127,Name:"de-LI",CurrencyPositivePattern:2,CurrencyNegativePattern:9,CurrencySymbol:"CHF",NumberDecimalSeparator:".",NumberGroupSeparator:"\u2019",NumberGroupSizes:[3],DayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],AbbreviatedDayNames:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],MonthNames:["Januar","Februar","M\u00e4rz","April","Mai", "Juni","Juli","August","September","Oktober","November","Dezember",""],AbbreviatedMonthNames:["Jan","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:["Jan.","Feb.","M\u00e4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez.",""],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},5129:{LCID:5129,Name:"en-NZ",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$", NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am", PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"035"},5130:{LCID:5130,Name:"es-CR",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u20a1",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto", "septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},5132:{LCID:5132,Name:"fr-LU",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3], DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM", DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},6153:{LCID:6153,Name:"en-IE",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u20ac",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December", ""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},6154:{LCID:6154,Name:"es-PA",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"B/.",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes", "s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"315"}, 6156:{LCID:6156,Name:"fr-MC",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.", "mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},7177:{LCID:7177,Name:"en-ZA",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"R",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun", "Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"531"},7178:{LCID:7178,Name:"es-DO",CurrencyPositivePattern:0,CurrencyNegativePattern:0,CurrencySymbol:"$", NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[], AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},7180:{LCID:7180,Name:"fr-029",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"EC$",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["Janvier","F\u00e9vrier", "Mars","Avril","Mai","Juin","Juillet","Ao\u00fbt","Septembre","Octobre","Novembre","D\u00e9cembre",""],AbbreviatedMonthNames:["Janv.","F\u00e9vr.","Mars","Avr.","Mai","Juin","Juil.","Ao\u00fbt","Sept.","Oct.","Nov.","D\u00e9c.",""],MonthGenitiveNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthGenitiveNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.", "d\u00e9c.",""],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},8201:{LCID:8201,Name:"en-JM",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August", "September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},8202:{LCID:8202,Name:"es-VE",CurrencyPositivePattern:0,CurrencyNegativePattern:2,CurrencySymbol:"Bs.S",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","lunes", "martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/", TimeSeparator:":",ShortDatePattern:"025"},8204:{LCID:8204,Name:"fr-RE",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20ac",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre", ""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},9225:{LCID:9225,Name:"en-029",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"EC$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},9226:{LCID:9226,Name:"es-CO", CurrencyPositivePattern:2,CurrencyNegativePattern:9,CurrencySymbol:"$",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.", "jul.","ago.","sept.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"035"},9228:{LCID:9228,Name:"fr-CD",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"FC",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi", "mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":", ShortDatePattern:"135"},10249:{LCID:10249,Name:"en-BZ",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb", "Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},10250:{LCID:10250,Name:"es-PE",CurrencyPositivePattern:2,CurrencyNegativePattern:9,CurrencySymbol:"S/",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.", "lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Setiembre","Octubre","Noviembre","Diciembre",""],AbbreviatedMonthNames:["Ene.","Feb.","Mar.","Abr.","May.","Jun.","Jul.","Ago.","Set.","Oct.","Nov.","Dic.",""],MonthGenitiveNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","setiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthGenitiveNames:["ene.","feb.","mar.","abr.","may.","jun.", "jul.","ago.","set.","oct.","nov.","dic.",""],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"035"},10252:{LCID:10252,Name:"fr-SN",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"CFA",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier", "f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},11273:{LCID:11273,Name:"en-TT",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".", NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm", DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},11274:{LCID:11274,Name:"es-AR",CurrencyPositivePattern:2,CurrencyNegativePattern:9,CurrencySymbol:"$",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre", "noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},11276:{LCID:11276,Name:"fr-CM",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"FCFA",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche", "lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"mat.",PMDesignator:"soir",DateSeparator:"/", TimeSeparator:":",ShortDatePattern:"135"},12297:{LCID:12297,Name:"en-ZW",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"US$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan", "Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},12298:{LCID:12298,Name:"es-EC",CurrencyPositivePattern:0,CurrencyNegativePattern:2,CurrencySymbol:"$",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.", "lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},12300:{LCID:12300,Name:"fr-CI",CurrencyPositivePattern:3, CurrencyNegativePattern:8,CurrencySymbol:"CFA",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.", "oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},13321:{LCID:13321,Name:"en-PH",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"\u20b1",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"], MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},13322:{LCID:13322,Name:"es-CL",CurrencyPositivePattern:0,CurrencyNegativePattern:2,CurrencySymbol:"$",NumberDecimalSeparator:",", NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:["ene.", "feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"135"},13324:{LCID:13324,Name:"fr-ML",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"CFA",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.", "ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},14345:{LCID:14345,Name:"en-ID",CurrencyPositivePattern:0,CurrencyNegativePattern:1, CurrencySymbol:"Rp",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[], AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},14346:{LCID:14346,Name:"es-UY",CurrencyPositivePattern:2,CurrencyNegativePattern:9,CurrencySymbol:"$",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio", "Julio","Agosto","Setiembre","Octubre","Noviembre","Diciembre",""],AbbreviatedMonthNames:["Ene.","Feb.","Mar.","Abr.","May.","Jun.","Jul.","Ago.","Set.","Oct.","Nov.","Dic.",""],MonthGenitiveNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","setiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthGenitiveNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","set.","oct.","nov.","dic.",""],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/", TimeSeparator:":",ShortDatePattern:"025"},14348:{LCID:14348,Name:"fr-MA",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"DH",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre", ""],AbbreviatedMonthNames:["jan.","f\u00e9v.","mar.","avr.","mai","jui.","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},15369:{LCID:15369,Name:"en-HK",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},15370:{LCID:15370,Name:"es-PY", CurrencyPositivePattern:2,CurrencyNegativePattern:12,CurrencySymbol:"\u20b2",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.", "jun.","jul.","ago.","sept.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},15372:{LCID:15372,Name:"fr-HT",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"G",NumberDecimalSeparator:",",NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],AbbreviatedDayNames:["dim.", "lun.","mar.","mer.","jeu.","ven.","sam."],MonthNames:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre",""],AbbreviatedMonthNames:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"135"},16393:{LCID:16393,Name:"en-IN",CurrencyPositivePattern:2, CurrencyNegativePattern:12,CurrencySymbol:"\u20b9",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3,2],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[], AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"-",TimeSeparator:":",ShortDatePattern:"135"},16394:{LCID:16394,Name:"es-BO",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"Bs",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero", "marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},17417:{LCID:17417,Name:"en-MY",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"RM",NumberDecimalSeparator:".", NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM", DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},17418:{LCID:17418,Name:"es-SV",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre", "noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},18441:{LCID:18441,Name:"en-SG",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["Sunday","Monday", "Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"am",PMDesignator:"pm",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},18442:{LCID:18442, Name:"es-HN",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"L",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.", "may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},19466:{LCID:19466,Name:"es-NI",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"C$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.", "lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},20490:{LCID:20490,Name:"es-PR",CurrencyPositivePattern:0, CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.", "oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.\u00a0m.",PMDesignator:"p.\u00a0m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"315"},21514:{LCID:21514,Name:"es-US",CurrencyPositivePattern:0,CurrencyNegativePattern:0,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom","lun","mar","mi\u00e9", "jue","vie","s\u00e1b"],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"205"},22538:{LCID:22538,Name:"es-419",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"XDR", NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[], AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.m.",PMDesignator:"p.m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},23562:{LCID:23562,Name:"es-CU",CurrencyPositivePattern:0,CurrencyNegativePattern:1,CurrencySymbol:"$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],AbbreviatedDayNames:["dom.","lun.","mar.","mi\u00e9.","jue.","vie.","s\u00e1b."],MonthNames:["enero","febrero", "marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],AbbreviatedMonthNames:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"a.m.",PMDesignator:"p.m.",DateSeparator:"/",TimeSeparator:":",ShortDatePattern:"025"},29740:{LCID:29740,Name:"az-Cyrl",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20bc",NumberDecimalSeparator:",", NumberGroupSeparator:" ",NumberGroupSizes:[3],DayNames:["\u0431\u0430\u0437\u0430\u0440","\u0431\u0430\u0437\u0430\u0440\u00a0\u0435\u0440\u0442\u04d9\u0441\u0438","\u0447\u04d9\u0440\u0448\u04d9\u043d\u0431\u04d9\u00a0\u0430\u0445\u0448\u0430\u043c\u044b","\u0447\u04d9\u0440\u0448\u04d9\u043d\u0431\u04d9","\u04b9\u04af\u043c\u04d9\u00a0\u0430\u0445\u0448\u0430\u043c\u044b","\u04b9\u04af\u043c\u04d9","\u0448\u04d9\u043d\u0431\u04d9"],AbbreviatedDayNames:["\u0411","\u0411\u0435","\u0427\u0430","\u0427", "\u04b8\u0430","\u04b8","\u0428"],MonthNames:["j\u0430\u043d\u0432\u0430\u0440","\u0444\u0435\u0432\u0440\u0430\u043b","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440\u0435\u043b","\u043c\u0430\u0458","\u0438\u0458\u0443\u043d","\u0438\u0458\u0443\u043b","\u0430\u0432\u0433\u0443\u0441\u0442","\u0441\u0435\u043d\u0442\u0458\u0430\u0431\u0440","\u043e\u043a\u0442\u0458\u0430\u0431\u0440","\u043d\u043e\u0458\u0430\u0431\u0440","\u0434\u0435\u043a\u0430\u0431\u0440",""],AbbreviatedMonthNames:["\u0408\u0430\u043d", "\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0458","\u0418\u0458\u0443\u043d","\u0418\u0458\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043d","\u041e\u043a\u0442","\u041d\u043e\u044f","\u0414\u0435\u043a",""],MonthGenitiveNames:["\u0458\u0430\u043d\u0432\u0430\u0440","\u0444\u0435\u0432\u0440\u0430\u043b","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440\u0435\u043b","\u043c\u0430\u0458","\u0438\u0458\u0443\u043d","\u0438\u0458\u0443\u043b","\u0430\u0432\u0433\u0443\u0441\u0442", "\u0441\u0435\u043d\u0442\u0458\u0430\u0431\u0440","\u043e\u043a\u0442\u0458\u0430\u0431\u0440","\u043d\u043e\u0458\u0430\u0431\u0440","\u0434\u0435\u043a\u0430\u0431\u0440",""],AbbreviatedMonthGenitiveNames:["\u0408\u0430\u043d","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u043c\u0430\u044f","\u0438\u0458\u0443\u043d","\u0438\u0458\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043d","\u041e\u043a\u0442","\u041d\u043e\u044f","\u0414\u0435\u043a",""],AMDesignator:"",PMDesignator:"", DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},30724:{LCID:30724,Name:"zh",CurrencyPositivePattern:0,CurrencyNegativePattern:2,CurrencySymbol:"\u00a5",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],AbbreviatedDayNames:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94", "\u5468\u516d"],MonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],AbbreviatedMonthNames:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u4e0a\u5348",PMDesignator:"\u4e0b\u5348",DateSeparator:"/", TimeSeparator:":",ShortDatePattern:"520"},30764:{LCID:30764,Name:"az-Latn",CurrencyPositivePattern:3,CurrencyNegativePattern:8,CurrencySymbol:"\u20bc",NumberDecimalSeparator:",",NumberGroupSeparator:".",NumberGroupSizes:[3],DayNames:["bazar","bazar ert\u0259si","\u00e7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131","\u00e7\u0259r\u015f\u0259nb\u0259","c\u00fcm\u0259 ax\u015fam\u0131","c\u00fcm\u0259","\u015f\u0259nb\u0259"],AbbreviatedDayNames:["B.","B.E.","\u00c7.A.","\u00c7.","C.A.","C.","\u015e."], MonthNames:["Yanvar","Fevral","Mart","Aprel","May","\u0130yun","\u0130yul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],AbbreviatedMonthNames:["yan","fev","mar","apr","may","iyn","iyl","avq","sen","okt","noy","dek",""],MonthGenitiveNames:["yanvar","fevral","mart","aprel","may","iyun","iyul","avqust","sentyabr","oktyabr","noyabr","dekabr",""],AbbreviatedMonthGenitiveNames:[],AMDesignator:"AM",PMDesignator:"PM",DateSeparator:".",TimeSeparator:":",ShortDatePattern:"135"},31748:{LCID:31748,Name:"zh-Hant", CurrencyPositivePattern:0,CurrencyNegativePattern:0,CurrencySymbol:"HK$",NumberDecimalSeparator:".",NumberGroupSeparator:",",NumberGroupSizes:[3],DayNames:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],AbbreviatedDayNames:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],MonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708", "\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],AbbreviatedMonthNames:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",""],MonthGenitiveNames:[],AbbreviatedMonthGenitiveNames:[],AMDesignator:"\u4e0a\u5348",PMDesignator:"\u4e0b\u5348",DateSeparator:"/",TimeSeparator:":", ShortDatePattern:"025"}};var g_oDefaultCultureInfo,g_oLCID;setCurrentCultureInfo(1033);window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].isNumber=isNumber;window["AscCommon"].NumFormat=NumFormat;window["AscCommon"].CellFormat=CellFormat;window["AscCommon"].DecodeGeneralFormat=DecodeGeneralFormat;window["AscCommon"].setCurrentCultureInfo=setCurrentCultureInfo;window["AscCommon"].checkCultureInfoFontPicker=checkCultureInfoFontPicker;window["AscCommon"].getShortDateFormat=getShortDateFormat; window["AscCommon"].getShortDateFormat2=getShortDateFormat2;window["AscCommon"].getShortTimeFormat=getShortTimeFormat;window["AscCommon"].getShortDateMonthFormat=getShortDateMonthFormat;window["AscCommon"].getNumberFormatSimple=getNumberFormatSimple;window["AscCommon"].getNumberFormat=getNumberFormat;window["AscCommon"].getLocaleFormat=getLocaleFormat;window["AscCommon"].getCurrencyFormatSimple=getCurrencyFormatSimple;window["AscCommon"].getCurrencyFormatSimple2=getCurrencyFormatSimple2;window["AscCommon"].getCurrencyFormat= getCurrencyFormat;window["AscCommon"].getFormatCells=getFormatCells;window["AscCommon"].getFormatByStandardId=getFormatByStandardId;window["AscCommon"].compareNumbers=compareNumbers;window["AscCommon"].gc_nMaxDigCount=gc_nMaxDigCount;window["AscCommon"].gc_nMaxDigCountView=gc_nMaxDigCountView;window["AscCommon"].oNumFormatCache=oNumFormatCache;window["AscCommon"].oGeneralEditFormatCache=oGeneralEditFormatCache;window["AscCommon"].g_oFormatParser=g_oFormatParser;window["AscCommon"].g_aCultureInfos= g_aCultureInfos;window["AscCommon"].g_oDefaultCultureInfo=g_oDefaultCultureInfo;window["AscCommon"].NumFormatType=NumFormatType})(window);"use strict";(function(window,undefined){var c_oSerConstants=AscCommon.c_oSerConstants;var c_oAscTickMark=Asc.c_oAscTickMark;var c_oAscTickLabelsPos=Asc.c_oAscTickLabelsPos;var c_oAscChartDataLabelsPos=Asc.c_oAscChartDataLabelsPos;var c_oAscValAxUnits=Asc.c_oAscValAxUnits;var c_oAscChartLegendShowSettings=Asc.c_oAscChartLegendShowSettings;var st_pagesetuporientationDEFAULT= 0;var st_pagesetuporientationPORTRAIT=1;var st_pagesetuporientationLANDSCAPE=2;var st_dispblanksasSPAN=0;var st_dispblanksasGAP=1;var st_dispblanksasZERO=2;var st_legendposB=0;var st_legendposTR=1;var st_legendposL=2;var st_legendposR=3;var st_legendposT=4;var st_layouttargetINNER=0;var st_layouttargetOUTER=1;var st_layoutmodeEDGE=0;var st_layoutmodeFACTOR=1;var st_orientationMAXMIN=0;var st_orientationMINMAX=1;var st_axposB=0;var st_axposL=1;var st_axposR=2;var st_axposT=3;var st_tickmarkCROSS=0; var st_tickmarkIN=1;var st_tickmarkNONE=2;var st_tickmarkOUT=3;var st_ticklblposHIGH=0;var st_ticklblposLOW=1;var st_ticklblposNEXTTO=2;var st_ticklblposNONE=3;var st_crossesAUTOZERO=0;var st_crossesMAX=1;var st_crossesMIN=2;var st_timeunitDAYS=0;var st_timeunitMONTHS=1;var st_timeunitYEARS=2;var st_lblalgnCTR=0;var st_lblalgnL=1;var st_lblalgnR=2;var st_builtinunitHUNDREDS=0;var st_builtinunitTHOUSANDS=1;var st_builtinunitTENTHOUSANDS=2;var st_builtinunitHUNDREDTHOUSANDS=3;var st_builtinunitMILLIONS= 4;var st_builtinunitTENMILLIONS=5;var st_builtinunitHUNDREDMILLIONS=6;var st_builtinunitBILLIONS=7;var st_builtinunitTRILLIONS=8;var st_crossbetweenBETWEEN=0;var st_crossbetweenMIDCAT=1;var st_sizerepresentsAREA=0;var st_sizerepresentsW=1;var st_markerstyleCIRCLE=0;var st_markerstyleDASH=1;var st_markerstyleDIAMOND=2;var st_markerstyleDOT=3;var st_markerstyleNONE=4;var st_markerstylePICTURE=5;var st_markerstylePLUS=6;var st_markerstyleSQUARE=7;var st_markerstyleSTAR=8;var st_markerstyleTRIANGLE=9; var st_markerstyleX=10;var st_markerstyleAUTO=11;var st_pictureformatSTRETCH=0;var st_pictureformatSTACK=1;var st_pictureformatSTACKSCALE=2;var st_dlblposBESTFIT=0;var st_dlblposB=1;var st_dlblposCTR=2;var st_dlblposINBASE=3;var st_dlblposINEND=4;var st_dlblposL=5;var st_dlblposOUTEND=6;var st_dlblposR=7;var st_dlblposT=8;var st_trendlinetypeEXP=0;var st_trendlinetypeLINEAR=1;var st_trendlinetypeLOG=2;var st_trendlinetypeMOVINGAVG=3;var st_trendlinetypePOLY=4;var st_trendlinetypePOWER=5;var st_errdirX= 0;var st_errdirY=1;var st_errbartypeBOTH=0;var st_errbartypeMINUS=1;var st_errbartypePLUS=2;var st_errvaltypeCUST=0;var st_errvaltypeFIXEDVAL=1;var st_errvaltypePERCENTAGE=2;var st_errvaltypeSTDDEV=3;var st_errvaltypeSTDERR=4;var st_splittypeAUTO=0;var st_splittypeCUST=1;var st_splittypePERCENT=2;var st_splittypePOS=3;var st_splittypeVAL=4;var st_ofpietypePIE=0;var st_ofpietypeBAR=1;var st_bardirBAR=0;var st_bardirCOL=1;var st_bargroupingPERCENTSTACKED=0;var st_bargroupingCLUSTERED=1;var st_bargroupingSTANDARD= 2;var st_bargroupingSTACKED=3;var st_shapeCONE=0;var st_shapeCONETOMAX=1;var st_shapeBOX=2;var st_shapeCYLINDER=3;var st_shapePYRAMID=4;var st_shapePYRAMIDTOMAX=5;var st_scatterstyleNONE=0;var st_scatterstyleLINE=1;var st_scatterstyleLINEMARKER=2;var st_scatterstyleMARKER=3;var st_scatterstyleSMOOTH=4;var st_scatterstyleSMOOTHMARKER=5;var st_radarstyleSTANDARD=0;var st_radarstyleMARKER=1;var st_radarstyleFILLED=2;var st_groupingPERCENTSTACKED=0;var st_groupingSTANDARD=1;var st_groupingSTACKED=2;var c_oserct_extlstEXT= 0;var c_oserct_chartspaceDATE1904=0;var c_oserct_chartspaceLANG=1;var c_oserct_chartspaceROUNDEDCORNERS=2;var c_oserct_chartspaceALTERNATECONTENT=3;var c_oserct_chartspaceSTYLE=4;var c_oserct_chartspaceCLRMAPOVR=5;var c_oserct_chartspacePIVOTSOURCE=6;var c_oserct_chartspacePROTECTION=7;var c_oserct_chartspaceCHART=8;var c_oserct_chartspaceSPPR=9;var c_oserct_chartspaceTXPR=10;var c_oserct_chartspaceEXTERNALDATA=11;var c_oserct_chartspacePRINTSETTINGS=12;var c_oserct_chartspaceUSERSHAPES=13;var c_oserct_chartspaceEXTLST= 14;var c_oserct_chartspaceTHEMEOVERRIDE=15;var c_oserct_usershapes_COUNT=0;var c_oserct_usershapes_SHAPE_REL=1;var c_oserct_usershapes_SHAPE_ABS=2;var c_oserct_booleanVAL=0;var c_oserct_relidID=0;var c_oserct_pagesetupPAPERSIZE=0;var c_oserct_pagesetupPAPERHEIGHT=1;var c_oserct_pagesetupPAPERWIDTH=2;var c_oserct_pagesetupFIRSTPAGENUMBER=3;var c_oserct_pagesetupORIENTATION=4;var c_oserct_pagesetupBLACKANDWHITE=5;var c_oserct_pagesetupDRAFT=6;var c_oserct_pagesetupUSEFIRSTPAGENUMBER=7;var c_oserct_pagesetupHORIZONTALDPI= 8;var c_oserct_pagesetupVERTICALDPI=9;var c_oserct_pagesetupCOPIES=10;var c_oserct_pagemarginsL=0;var c_oserct_pagemarginsR=1;var c_oserct_pagemarginsT=2;var c_oserct_pagemarginsB=3;var c_oserct_pagemarginsHEADER=4;var c_oserct_pagemarginsFOOTER=5;var c_oserct_headerfooterODDHEADER=0;var c_oserct_headerfooterODDFOOTER=1;var c_oserct_headerfooterEVENHEADER=2;var c_oserct_headerfooterEVENFOOTER=3;var c_oserct_headerfooterFIRSTHEADER=4;var c_oserct_headerfooterFIRSTFOOTER=5;var c_oserct_headerfooterALIGNWITHMARGINS= 6;var c_oserct_headerfooterDIFFERENTODDEVEN=7;var c_oserct_headerfooterDIFFERENTFIRST=8;var c_oserct_printsettingsHEADERFOOTER=0;var c_oserct_printsettingsPAGEMARGINS=1;var c_oserct_printsettingsPAGESETUP=2;var c_oserct_externaldataAUTOUPDATE=0;var c_oserct_externaldataID=1;var c_oserct_dispblanksasVAL=0;var c_oserct_legendentryIDX=0;var c_oserct_legendentryDELETE=1;var c_oserct_legendentryTXPR=2;var c_oserct_legendentryEXTLST=3;var c_oserct_unsignedintVAL=0;var c_oserct_extensionANY=0;var c_oserct_extensionURI= 1;var c_oserct_legendposVAL=0;var c_oserct_legendLEGENDPOS=0;var c_oserct_legendLEGENDENTRY=1;var c_oserct_legendLAYOUT=2;var c_oserct_legendOVERLAY=3;var c_oserct_legendSPPR=4;var c_oserct_legendTXPR=5;var c_oserct_legendEXTLST=6;var c_oserct_layoutMANUALLAYOUT=0;var c_oserct_layoutEXTLST=1;var c_oserct_manuallayoutLAYOUTTARGET=0;var c_oserct_manuallayoutXMODE=1;var c_oserct_manuallayoutYMODE=2;var c_oserct_manuallayoutWMODE=3;var c_oserct_manuallayoutHMODE=4;var c_oserct_manuallayoutX=5;var c_oserct_manuallayoutY= 6;var c_oserct_manuallayoutW=7;var c_oserct_manuallayoutH=8;var c_oserct_manuallayoutEXTLST=9;var c_oserct_layouttargetVAL=0;var c_oserct_layoutmodeVAL=0;var c_oserct_doubleVAL=0;var c_oserct_dtableSHOWHORZBORDER=0;var c_oserct_dtableSHOWVERTBORDER=1;var c_oserct_dtableSHOWOUTLINE=2;var c_oserct_dtableSHOWKEYS=3;var c_oserct_dtableSPPR=4;var c_oserct_dtableTXPR=5;var c_oserct_dtableEXTLST=6;var c_oserct_seraxAXID=0;var c_oserct_seraxSCALING=1;var c_oserct_seraxDELETE=2;var c_oserct_seraxAXPOS=3;var c_oserct_seraxMAJORGRIDLINES= 4;var c_oserct_seraxMINORGRIDLINES=5;var c_oserct_seraxTITLE=6;var c_oserct_seraxNUMFMT=7;var c_oserct_seraxMAJORTICKMARK=8;var c_oserct_seraxMINORTICKMARK=9;var c_oserct_seraxTICKLBLPOS=10;var c_oserct_seraxSPPR=11;var c_oserct_seraxTXPR=12;var c_oserct_seraxCROSSAX=13;var c_oserct_seraxCROSSES=14;var c_oserct_seraxCROSSESAT=15;var c_oserct_seraxTICKLBLSKIP=16;var c_oserct_seraxTICKMARKSKIP=17;var c_oserct_seraxEXTLST=18;var c_oserct_scalingLOGBASE=0;var c_oserct_scalingORIENTATION=1;var c_oserct_scalingMAX= 2;var c_oserct_scalingMIN=3;var c_oserct_scalingEXTLST=4;var c_oserct_logbaseVAL=0;var c_oserct_orientationVAL=0;var c_oserct_axposVAL=0;var c_oserct_chartlinesSPPR=0;var c_oserct_titleTX=0;var c_oserct_titleLAYOUT=1;var c_oserct_titleOVERLAY=2;var c_oserct_titleSPPR=3;var c_oserct_titleTXPR=4;var c_oserct_titleEXTLST=5;var c_oserct_txRICH=0;var c_oserct_txSTRREF=1;var c_oserct_strrefF=0;var c_oserct_strrefSTRCACHE=1;var c_oserct_strrefEXTLST=2;var c_oserct_strdataPTCOUNT=0;var c_oserct_strdataPT= 1;var c_oserct_strdataEXTLST=2;var c_oserct_strvalV=0;var c_oserct_strvalIDX=1;var c_oserct_numfmtFORMATCODE=0;var c_oserct_numfmtSOURCELINKED=1;var c_oserct_tickmarkVAL=0;var c_oserct_ticklblposVAL=0;var c_oserct_crossesVAL=0;var c_oserct_skipVAL=0;var c_oserct_timeunitVAL=0;var c_oserct_dateaxAXID=0;var c_oserct_dateaxSCALING=1;var c_oserct_dateaxDELETE=2;var c_oserct_dateaxAXPOS=3;var c_oserct_dateaxMAJORGRIDLINES=4;var c_oserct_dateaxMINORGRIDLINES=5;var c_oserct_dateaxTITLE=6;var c_oserct_dateaxNUMFMT= 7;var c_oserct_dateaxMAJORTICKMARK=8;var c_oserct_dateaxMINORTICKMARK=9;var c_oserct_dateaxTICKLBLPOS=10;var c_oserct_dateaxSPPR=11;var c_oserct_dateaxTXPR=12;var c_oserct_dateaxCROSSAX=13;var c_oserct_dateaxCROSSES=14;var c_oserct_dateaxCROSSESAT=15;var c_oserct_dateaxAUTO=16;var c_oserct_dateaxLBLOFFSET=17;var c_oserct_dateaxBASETIMEUNIT=18;var c_oserct_dateaxMAJORUNIT=19;var c_oserct_dateaxMAJORTIMEUNIT=20;var c_oserct_dateaxMINORUNIT=21;var c_oserct_dateaxMINORTIMEUNIT=22;var c_oserct_dateaxEXTLST= 23;var c_oserct_lbloffsetVAL=0;var c_oserct_axisunitVAL=0;var c_oserct_lblalgnVAL=0;var c_oserct_cataxAXID=0;var c_oserct_cataxSCALING=1;var c_oserct_cataxDELETE=2;var c_oserct_cataxAXPOS=3;var c_oserct_cataxMAJORGRIDLINES=4;var c_oserct_cataxMINORGRIDLINES=5;var c_oserct_cataxTITLE=6;var c_oserct_cataxNUMFMT=7;var c_oserct_cataxMAJORTICKMARK=8;var c_oserct_cataxMINORTICKMARK=9;var c_oserct_cataxTICKLBLPOS=10;var c_oserct_cataxSPPR=11;var c_oserct_cataxTXPR=12;var c_oserct_cataxCROSSAX=13;var c_oserct_cataxCROSSES= 14;var c_oserct_cataxCROSSESAT=15;var c_oserct_cataxAUTO=16;var c_oserct_cataxLBLALGN=17;var c_oserct_cataxLBLOFFSET=18;var c_oserct_cataxTICKLBLSKIP=19;var c_oserct_cataxTICKMARKSKIP=20;var c_oserct_cataxNOMULTILVLLBL=21;var c_oserct_cataxEXTLST=22;var c_oserct_dispunitslblLAYOUT=0;var c_oserct_dispunitslblTX=1;var c_oserct_dispunitslblSPPR=2;var c_oserct_dispunitslblTXPR=3;var c_oserct_builtinunitVAL=0;var c_oserct_dispunitsBUILTINUNIT=0;var c_oserct_dispunitsCUSTUNIT=1;var c_oserct_dispunitsDISPUNITSLBL= 2;var c_oserct_dispunitsEXTLST=3;var c_oserct_crossbetweenVAL=0;var c_oserct_valaxAXID=0;var c_oserct_valaxSCALING=1;var c_oserct_valaxDELETE=2;var c_oserct_valaxAXPOS=3;var c_oserct_valaxMAJORGRIDLINES=4;var c_oserct_valaxMINORGRIDLINES=5;var c_oserct_valaxTITLE=6;var c_oserct_valaxNUMFMT=7;var c_oserct_valaxMAJORTICKMARK=8;var c_oserct_valaxMINORTICKMARK=9;var c_oserct_valaxTICKLBLPOS=10;var c_oserct_valaxSPPR=11;var c_oserct_valaxTXPR=12;var c_oserct_valaxCROSSAX=13;var c_oserct_valaxCROSSES=14; var c_oserct_valaxCROSSESAT=15;var c_oserct_valaxCROSSBETWEEN=16;var c_oserct_valaxMAJORUNIT=17;var c_oserct_valaxMINORUNIT=18;var c_oserct_valaxDISPUNITS=19;var c_oserct_valaxEXTLST=20;var c_oserct_sizerepresentsVAL=0;var c_oserct_bubblescaleVAL=0;var c_oserct_bubbleserIDX=0;var c_oserct_bubbleserORDER=1;var c_oserct_bubbleserTX=2;var c_oserct_bubbleserSPPR=3;var c_oserct_bubbleserINVERTIFNEGATIVE=4;var c_oserct_bubbleserDPT=5;var c_oserct_bubbleserDLBLS=6;var c_oserct_bubbleserTRENDLINE=7;var c_oserct_bubbleserERRBARS= 8;var c_oserct_bubbleserXVAL=9;var c_oserct_bubbleserYVAL=10;var c_oserct_bubbleserBUBBLESIZE=11;var c_oserct_bubbleserBUBBLE3D=12;var c_oserct_bubbleserEXTLST=13;var c_oserct_sertxSTRREF=0;var c_oserct_sertxV=1;var c_oserct_dptIDX=0;var c_oserct_dptINVERTIFNEGATIVE=1;var c_oserct_dptMARKER=2;var c_oserct_dptBUBBLE3D=3;var c_oserct_dptEXPLOSION=4;var c_oserct_dptSPPR=5;var c_oserct_dptPICTUREOPTIONS=6;var c_oserct_dptEXTLST=7;var c_oserct_markerSYMBOL=0;var c_oserct_markerSIZE=1;var c_oserct_markerSPPR= 2;var c_oserct_markerEXTLST=3;var c_oserct_markerstyleVAL=0;var c_oserct_markersizeVAL=0;var c_oserct_pictureoptionsAPPLYTOFRONT=0;var c_oserct_pictureoptionsAPPLYTOSIDES=1;var c_oserct_pictureoptionsAPPLYTOEND=2;var c_oserct_pictureoptionsPICTUREFORMAT=3;var c_oserct_pictureoptionsPICTURESTACKUNIT=4;var c_oserct_pictureformatVAL=0;var c_oserct_picturestackunitVAL=0;var c_oserct_dlblsDLBL=0;var c_oserct_dlblsITEMS=1;var c_oserct_dlblsDLBLPOS=2;var c_oserct_dlblsDELETE=3;var c_oserct_dlblsLEADERLINES= 4;var c_oserct_dlblsNUMFMT=5;var c_oserct_dlblsSEPARATOR=6;var c_oserct_dlblsSHOWBUBBLESIZE=7;var c_oserct_dlblsSHOWCATNAME=8;var c_oserct_dlblsSHOWLEADERLINES=9;var c_oserct_dlblsSHOWLEGENDKEY=10;var c_oserct_dlblsSHOWPERCENT=11;var c_oserct_dlblsSHOWSERNAME=12;var c_oserct_dlblsSHOWVAL=13;var c_oserct_dlblsSPPR=14;var c_oserct_dlblsTXPR=15;var c_oserct_dlblsEXTLST=16;var c_oserct_dlblIDX=0;var c_oserct_dlblITEMS=1;var c_oserct_dlblDLBLPOS=2;var c_oserct_dlblDELETE=3;var c_oserct_dlblLAYOUT=4;var c_oserct_dlblNUMFMT= 5;var c_oserct_dlblSEPARATOR=6;var c_oserct_dlblSHOWBUBBLESIZE=7;var c_oserct_dlblSHOWCATNAME=8;var c_oserct_dlblSHOWLEGENDKEY=9;var c_oserct_dlblSHOWPERCENT=10;var c_oserct_dlblSHOWSERNAME=11;var c_oserct_dlblSHOWVAL=12;var c_oserct_dlblSPPR=13;var c_oserct_dlblTX=14;var c_oserct_dlblTXPR=15;var c_oserct_dlblEXTLST=16;var c_oserct_dlblposVAL=0;var c_oserct_trendlineNAME=0;var c_oserct_trendlineSPPR=1;var c_oserct_trendlineTRENDLINETYPE=2;var c_oserct_trendlineORDER=3;var c_oserct_trendlinePERIOD= 4;var c_oserct_trendlineFORWARD=5;var c_oserct_trendlineBACKWARD=6;var c_oserct_trendlineINTERCEPT=7;var c_oserct_trendlineDISPRSQR=8;var c_oserct_trendlineDISPEQ=9;var c_oserct_trendlineTRENDLINELBL=10;var c_oserct_trendlineEXTLST=11;var c_oserct_trendlinetypeVAL=0;var c_oserct_orderVAL=0;var c_oserct_periodVAL=0;var c_oserct_trendlinelblLAYOUT=0;var c_oserct_trendlinelblTX=1;var c_oserct_trendlinelblNUMFMT=2;var c_oserct_trendlinelblSPPR=3;var c_oserct_trendlinelblTXPR=4;var c_oserct_trendlinelblEXTLST= 5;var c_oserct_errbarsERRDIR=0;var c_oserct_errbarsERRBARTYPE=1;var c_oserct_errbarsERRVALTYPE=2;var c_oserct_errbarsNOENDCAP=3;var c_oserct_errbarsPLUS=4;var c_oserct_errbarsMINUS=5;var c_oserct_errbarsVAL=6;var c_oserct_errbarsSPPR=7;var c_oserct_errbarsEXTLST=8;var c_oserct_errdirVAL=0;var c_oserct_errbartypeVAL=0;var c_oserct_errvaltypeVAL=0;var c_oserct_numdatasourceNUMLIT=0;var c_oserct_numdatasourceNUMREF=1;var c_oserct_numdataFORMATCODE=0;var c_oserct_numdataPTCOUNT=1;var c_oserct_numdataPT= 2;var c_oserct_numdataEXTLST=3;var c_oserct_numvalV=0;var c_oserct_numvalIDX=1;var c_oserct_numvalFORMATCODE=2;var c_oserct_numrefF=0;var c_oserct_numrefNUMCACHE=1;var c_oserct_numrefEXTLST=2;var c_oserct_axdatasourceMULTILVLSTRREF=0;var c_oserct_axdatasourceNUMLIT=1;var c_oserct_axdatasourceNUMREF=2;var c_oserct_axdatasourceSTRLIT=3;var c_oserct_axdatasourceSTRREF=4;var c_oserct_multilvlstrrefF=0;var c_oserct_multilvlstrrefMULTILVLSTRCACHE=1;var c_oserct_multilvlstrrefEXTLST=2;var c_oserct_lvlPT= 0;var c_oserct_multilvlstrdataPTCOUNT=0;var c_oserct_multilvlstrdataLVL=1;var c_oserct_multilvlstrdataEXTLST=2;var c_oserct_bubblechartVARYCOLORS=0;var c_oserct_bubblechartSER=1;var c_oserct_bubblechartDLBLS=2;var c_oserct_bubblechartBUBBLE3D=3;var c_oserct_bubblechartBUBBLESCALE=4;var c_oserct_bubblechartSHOWNEGBUBBLES=5;var c_oserct_bubblechartSIZEREPRESENTS=6;var c_oserct_bubblechartAXID=7;var c_oserct_bubblechartEXTLST=8;var c_oserct_bandfmtsBANDFMT=0;var c_oserct_surface3dchartWIREFRAME=0;var c_oserct_surface3dchartSER= 1;var c_oserct_surface3dchartBANDFMTS=2;var c_oserct_surface3dchartAXID=3;var c_oserct_surface3dchartEXTLST=4;var c_oserct_surfaceserIDX=0;var c_oserct_surfaceserORDER=1;var c_oserct_surfaceserTX=2;var c_oserct_surfaceserSPPR=3;var c_oserct_surfaceserCAT=4;var c_oserct_surfaceserVAL=5;var c_oserct_surfaceserEXTLST=6;var c_oserct_bandfmtIDX=0;var c_oserct_bandfmtSPPR=1;var c_oserct_surfacechartWIREFRAME=0;var c_oserct_surfacechartSER=1;var c_oserct_surfacechartBANDFMTS=2;var c_oserct_surfacechartAXID= 3;var c_oserct_surfacechartEXTLST=4;var c_oserct_secondpiesizeVAL=0;var c_oserct_splittypeVAL=0;var c_oserct_ofpietypeVAL=0;var c_oserct_custsplitSECONDPIEPT=0;var c_oserct_ofpiechartOFPIETYPE=0;var c_oserct_ofpiechartVARYCOLORS=1;var c_oserct_ofpiechartSER=2;var c_oserct_ofpiechartDLBLS=3;var c_oserct_ofpiechartGAPWIDTH=4;var c_oserct_ofpiechartSPLITTYPE=5;var c_oserct_ofpiechartSPLITPOS=6;var c_oserct_ofpiechartCUSTSPLIT=7;var c_oserct_ofpiechartSECONDPIESIZE=8;var c_oserct_ofpiechartSERLINES=9; var c_oserct_ofpiechartEXTLST=10;var c_oserct_pieserIDX=0;var c_oserct_pieserORDER=1;var c_oserct_pieserTX=2;var c_oserct_pieserSPPR=3;var c_oserct_pieserEXPLOSION=4;var c_oserct_pieserDPT=5;var c_oserct_pieserDLBLS=6;var c_oserct_pieserCAT=7;var c_oserct_pieserVAL=8;var c_oserct_pieserEXTLST=9;var c_oserct_gapamountVAL=0;var c_oserct_bar3dchartBARDIR=0;var c_oserct_bar3dchartGROUPING=1;var c_oserct_bar3dchartVARYCOLORS=2;var c_oserct_bar3dchartSER=3;var c_oserct_bar3dchartDLBLS=4;var c_oserct_bar3dchartGAPWIDTH= 5;var c_oserct_bar3dchartGAPDEPTH=6;var c_oserct_bar3dchartSHAPE=7;var c_oserct_bar3dchartAXID=8;var c_oserct_bar3dchartEXTLST=9;var c_oserct_bardirVAL=0;var c_oserct_bargroupingVAL=0;var c_oserct_barserIDX=0;var c_oserct_barserORDER=1;var c_oserct_barserTX=2;var c_oserct_barserSPPR=3;var c_oserct_barserINVERTIFNEGATIVE=4;var c_oserct_barserPICTUREOPTIONS=5;var c_oserct_barserDPT=6;var c_oserct_barserDLBLS=7;var c_oserct_barserTRENDLINE=8;var c_oserct_barserERRBARS=9;var c_oserct_barserCAT=10;var c_oserct_barserVAL= 11;var c_oserct_barserSHAPE=12;var c_oserct_barserEXTLST=13;var c_oserct_shapeVAL=0;var c_oserct_overlapVAL=0;var c_oserct_barchartBARDIR=0;var c_oserct_barchartGROUPING=1;var c_oserct_barchartVARYCOLORS=2;var c_oserct_barchartSER=3;var c_oserct_barchartDLBLS=4;var c_oserct_barchartGAPWIDTH=5;var c_oserct_barchartOVERLAP=6;var c_oserct_barchartSERLINES=7;var c_oserct_barchartAXID=8;var c_oserct_barchartEXTLST=9;var c_oserct_holesizeVAL=0;var c_oserct_doughnutchartVARYCOLORS=0;var c_oserct_doughnutchartSER= 1;var c_oserct_doughnutchartDLBLS=2;var c_oserct_doughnutchartFIRSTSLICEANG=3;var c_oserct_doughnutchartHOLESIZE=4;var c_oserct_doughnutchartEXTLST=5;var c_oserct_firstsliceangVAL=0;var c_oserct_pie3dchartVARYCOLORS=0;var c_oserct_pie3dchartSER=1;var c_oserct_pie3dchartDLBLS=2;var c_oserct_pie3dchartEXTLST=3;var c_oserct_piechartVARYCOLORS=0;var c_oserct_piechartSER=1;var c_oserct_piechartDLBLS=2;var c_oserct_piechartFIRSTSLICEANG=3;var c_oserct_piechartEXTLST=4;var c_oserct_scatterserIDX=0;var c_oserct_scatterserORDER= 1;var c_oserct_scatterserTX=2;var c_oserct_scatterserSPPR=3;var c_oserct_scatterserMARKER=4;var c_oserct_scatterserDPT=5;var c_oserct_scatterserDLBLS=6;var c_oserct_scatterserTRENDLINE=7;var c_oserct_scatterserERRBARS=8;var c_oserct_scatterserXVAL=9;var c_oserct_scatterserYVAL=10;var c_oserct_scatterserSMOOTH=11;var c_oserct_scatterserEXTLST=12;var c_oserct_scatterstyleVAL=0;var c_oserct_scatterchartSCATTERSTYLE=0;var c_oserct_scatterchartVARYCOLORS=1;var c_oserct_scatterchartSER=2;var c_oserct_scatterchartDLBLS= 3;var c_oserct_scatterchartAXID=4;var c_oserct_scatterchartEXTLST=5;var c_oserct_radarserIDX=0;var c_oserct_radarserORDER=1;var c_oserct_radarserTX=2;var c_oserct_radarserSPPR=3;var c_oserct_radarserMARKER=4;var c_oserct_radarserDPT=5;var c_oserct_radarserDLBLS=6;var c_oserct_radarserCAT=7;var c_oserct_radarserVAL=8;var c_oserct_radarserEXTLST=9;var c_oserct_radarstyleVAL=0;var c_oserct_radarchartRADARSTYLE=0;var c_oserct_radarchartVARYCOLORS=1;var c_oserct_radarchartSER=2;var c_oserct_radarchartDLBLS= 3;var c_oserct_radarchartAXID=4;var c_oserct_radarchartEXTLST=5;var c_oserct_stockchartSER=0;var c_oserct_stockchartDLBLS=1;var c_oserct_stockchartDROPLINES=2;var c_oserct_stockchartHILOWLINES=3;var c_oserct_stockchartUPDOWNBARS=4;var c_oserct_stockchartAXID=5;var c_oserct_stockchartEXTLST=6;var c_oserct_lineserIDX=0;var c_oserct_lineserORDER=1;var c_oserct_lineserTX=2;var c_oserct_lineserSPPR=3;var c_oserct_lineserMARKER=4;var c_oserct_lineserDPT=5;var c_oserct_lineserDLBLS=6;var c_oserct_lineserTRENDLINE= 7;var c_oserct_lineserERRBARS=8;var c_oserct_lineserCAT=9;var c_oserct_lineserVAL=10;var c_oserct_lineserSMOOTH=11;var c_oserct_lineserEXTLST=12;var c_oserct_updownbarsGAPWIDTH=0;var c_oserct_updownbarsUPBARS=1;var c_oserct_updownbarsDOWNBARS=2;var c_oserct_updownbarsEXTLST=3;var c_oserct_updownbarSPPR=0;var c_oserct_line3dchartGROUPING=0;var c_oserct_line3dchartVARYCOLORS=1;var c_oserct_line3dchartSER=2;var c_oserct_line3dchartDLBLS=3;var c_oserct_line3dchartDROPLINES=4;var c_oserct_line3dchartGAPDEPTH= 5;var c_oserct_line3dchartAXID=6;var c_oserct_line3dchartEXTLST=7;var c_oserct_groupingVAL=0;var c_oserct_linechartGROUPING=0;var c_oserct_linechartVARYCOLORS=1;var c_oserct_linechartSER=2;var c_oserct_linechartDLBLS=3;var c_oserct_linechartDROPLINES=4;var c_oserct_linechartHILOWLINES=5;var c_oserct_linechartUPDOWNBARS=6;var c_oserct_linechartMARKER=7;var c_oserct_linechartSMOOTH=8;var c_oserct_linechartAXID=9;var c_oserct_linechartEXTLST=10;var c_oserct_area3dchartGROUPING=0;var c_oserct_area3dchartVARYCOLORS= 1;var c_oserct_area3dchartSER=2;var c_oserct_area3dchartDLBLS=3;var c_oserct_area3dchartDROPLINES=4;var c_oserct_area3dchartGAPDEPTH=5;var c_oserct_area3dchartAXID=6;var c_oserct_area3dchartEXTLST=7;var c_oserct_areaserIDX=0;var c_oserct_areaserORDER=1;var c_oserct_areaserTX=2;var c_oserct_areaserSPPR=3;var c_oserct_areaserPICTUREOPTIONS=4;var c_oserct_areaserDPT=5;var c_oserct_areaserDLBLS=6;var c_oserct_areaserTRENDLINE=7;var c_oserct_areaserERRBARS=8;var c_oserct_areaserCAT=9;var c_oserct_areaserVAL= 10;var c_oserct_areaserEXTLST=11;var c_oserct_areachartGROUPING=0;var c_oserct_areachartVARYCOLORS=1;var c_oserct_areachartSER=2;var c_oserct_areachartDLBLS=3;var c_oserct_areachartDROPLINES=4;var c_oserct_areachartAXID=5;var c_oserct_areachartEXTLST=6;var c_oserct_plotareaLAYOUT=0;var c_oserct_plotareaITEMS=1;var c_oserct_plotareaAREA3DCHART=2;var c_oserct_plotareaAREACHART=3;var c_oserct_plotareaBAR3DCHART=4;var c_oserct_plotareaBARCHART=5;var c_oserct_plotareaBUBBLECHART=6;var c_oserct_plotareaDOUGHNUTCHART= 7;var c_oserct_plotareaLINE3DCHART=8;var c_oserct_plotareaLINECHART=9;var c_oserct_plotareaOFPIECHART=10;var c_oserct_plotareaPIE3DCHART=11;var c_oserct_plotareaPIECHART=12;var c_oserct_plotareaRADARCHART=13;var c_oserct_plotareaSCATTERCHART=14;var c_oserct_plotareaSTOCKCHART=15;var c_oserct_plotareaSURFACE3DCHART=16;var c_oserct_plotareaSURFACECHART=17;var c_oserct_plotareaITEMS1=18;var c_oserct_plotareaCATAX=19;var c_oserct_plotareaDATEAX=20;var c_oserct_plotareaSERAX=21;var c_oserct_plotareaVALAX= 22;var c_oserct_plotareaDTABLE=23;var c_oserct_plotareaSPPR=24;var c_oserct_plotareaEXTLST=25;var c_oserct_thicknessVAL=0;var c_oserct_surfaceTHICKNESS=0;var c_oserct_surfaceSPPR=1;var c_oserct_surfacePICTUREOPTIONS=2;var c_oserct_surfaceEXTLST=3;var c_oserct_perspectiveVAL=0;var c_oserct_depthpercentVAL=0;var c_oserct_rotyVAL=0;var c_oserct_hpercentVAL=0;var c_oserct_rotxVAL=0;var c_oserct_view3dROTX=0;var c_oserct_view3dHPERCENT=1;var c_oserct_view3dROTY=2;var c_oserct_view3dDEPTHPERCENT=3;var c_oserct_view3dRANGAX= 4;var c_oserct_view3dPERSPECTIVE=5;var c_oserct_view3dEXTLST=6;var c_oserct_pivotfmtIDX=0;var c_oserct_pivotfmtSPPR=1;var c_oserct_pivotfmtTXPR=2;var c_oserct_pivotfmtMARKER=3;var c_oserct_pivotfmtDLBL=4;var c_oserct_pivotfmtEXTLST=5;var c_oserct_pivotfmtsPIVOTFMT=0;var c_oserct_chartTITLE=0;var c_oserct_chartAUTOTITLEDELETED=1;var c_oserct_chartPIVOTFMTS=2;var c_oserct_chartVIEW3D=3;var c_oserct_chartFLOOR=4;var c_oserct_chartSIDEWALL=5;var c_oserct_chartBACKWALL=6;var c_oserct_chartPLOTAREA=7;var c_oserct_chartLEGEND= 8;var c_oserct_chartPLOTVISONLY=9;var c_oserct_chartDISPBLANKSAS=10;var c_oserct_chartSHOWDLBLSOVERMAX=11;var c_oserct_chartEXTLST=12;var c_oserct_protectionCHARTOBJECT=0;var c_oserct_protectionDATA=1;var c_oserct_protectionFORMATTING=2;var c_oserct_protectionSELECTION=3;var c_oserct_protectionUSERINTERFACE=4;var c_oserct_pivotsourceNAME=0;var c_oserct_pivotsourceFMTID=1;var c_oserct_pivotsourceEXTLST=2;var c_oserct_style1VAL=0;var c_oserct_styleVAL=0;var c_oserct_textlanguageidVAL=0;var c_oseralternatecontentCHOICE= 0;var c_oseralternatecontentFALLBACK=1;var c_oseralternatecontentchoiceSTYLE=0;var c_oseralternatecontentchoiceREQUIRES=1;var c_oseralternatecontentfallbackSTYLE=0;var SIZE_REPRESENTS_AREA=0;var SIZE_REPRESENTS_W=1;var ERR_BAR_TYPE_BOTH=0;var ERR_BAR_TYPE_MINUS=1;var ERR_BAR_TYPE_PLUS=2;var ERR_DIR_X=0;var ERR_DIR_Y=1;var ERR_VAL_TYPE_CUST=0;var ERR_VAL_TYPE_FIXED_VAL=1;var ERR_VAL_TYPE_PERCENTAGE=2;var ERR_VAL_TYPE_STD_DEV=3;var ERR_VAL_TYPE_STD_ERR=4;var LAYOUT_TARGET_INNER=0;var LAYOUT_TARGET_OUTER= 1;var LAYOUT_MODE_EDGE=0;var LAYOUT_MODE_FACTOR=1;var OF_PIE_TYPE_BAR=0;var OF_PIE_TYPE_PIE=1;var SPLIT_TYPE_AUTO=0;var SPLIT_TYPE_CUST=1;var SPLIT_TYPE_PERCENT=2;var SPLIT_TYPE_POS=3;var SPLIT_TYPE_VAL=4;var PICTURE_FORMAT_STACK=0;var PICTURE_FORMAT_STACK_SCALE=1;var PICTURE_FORMAT_STACK_STRETCH=2;var RADAR_STYLE_STANDARD=0;var RADAR_STYLE_MARKER=1;var RADAR_STYLE_FILLED=2;var TRENDLINE_TYPE_EXP=0;var TRENDLINE_TYPE_LINEAR=1;var TRENDLINE_TYPE_LOG=2;var TRENDLINE_TYPE_MOVING_AVG=3;var TRENDLINE_TYPE_POLY= 4;var TRENDLINE_TYPE_POWER=5;function BinaryChartWriter(memory){this.memory=memory;this.bs=new AscCommon.BinaryCommonWriter(this.memory)}BinaryChartWriter.prototype.WriteCT_extLst=function(oVal){var oThis=this;if(null!=oVal.m_ext)for(var i=0,length=oVal.m_ext.length;i<length;++i){var oCurVal=oVal.m_ext[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_extlstEXT,function(){oThis.WriteCT_Extension(oCurVal)})}};BinaryChartWriter.prototype.WriteCT_ChartSpace=function(oVal){var oThis=this;if(null!=oVal.date1904)this.bs.WriteItem(c_oserct_chartspaceDATE1904, function(){oThis.WriteCT_Boolean(oVal.date1904)});if(null!=oVal.lang)this.bs.WriteItem(c_oserct_chartspaceLANG,function(){oThis.WriteCT_TextLanguageID(oVal.lang)});if(null!=oVal.roundedCorners)this.bs.WriteItem(c_oserct_chartspaceROUNDEDCORNERS,function(){oThis.WriteCT_Boolean(oVal.roundedCorners)});if(null!=oVal.style)this.bs.WriteItem(c_oserct_chartspaceALTERNATECONTENT,function(){oThis.bs.WriteItem(c_oseralternatecontentCHOICE,function(){oThis.bs.WriteItem(c_oseralternatecontentchoiceREQUIRES, function(){oThis.memory.WriteString3("c14")});oThis.bs.WriteItem(c_oseralternatecontentchoiceSTYLE,function(){oThis.WriteCT_Style(100+oVal.style)})});oThis.bs.WriteItem(c_oseralternatecontentFALLBACK,function(){oThis.bs.WriteItem(c_oseralternatecontentfallbackSTYLE,function(){oThis.WriteCT_Style1(oVal.style)})})});var oCurVal=oVal.clrMapOvr;if(null!=oCurVal)this.bs.WriteItem(c_oserct_chartspaceCLRMAPOVR,function(){oThis.WriteClrMapOverride(oCurVal)});if(null!=oVal.pivotSource)this.bs.WriteItem(c_oserct_chartspacePIVOTSOURCE, function(){oThis.WriteCT_PivotSource(oVal.pivotSource)});if(null!=oVal.protection)this.bs.WriteItem(c_oserct_chartspacePROTECTION,function(){oThis.WriteCT_Protection(oVal.protection)});if(null!=oVal.chart)this.bs.WriteItem(c_oserct_chartspaceCHART,function(){oThis.WriteCT_Chart(oVal.chart)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_chartspaceSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_chartspaceTXPR,function(){oThis.WriteTxPr(oVal.txPr)});if(null!= oVal.printSettings)this.bs.WriteItem(c_oserct_chartspacePRINTSETTINGS,function(){oThis.WriteCT_PrintSettings(oVal.printSettings)});if(oVal.userShapes.length>0)this.bs.WriteItem(c_oserct_chartspaceUSERSHAPES,function(){oThis.WriteCT_UserShapes(oVal.userShapes)});if(null!=oVal.themeOverride)this.bs.WriteItem(c_oserct_chartspaceTHEMEOVERRIDE,function(){AscCommon.pptx_content_writer.WriteTheme(oThis.memory,oVal.themeOverride)})};BinaryChartWriter.prototype.WriteCT_FromTo=function(oVal){this.memory.WriteByte(Asc.c_oSer_DrawingPosType.X); this.memory.WriteByte(AscCommon.c_oSerPropLenType.Double);this.memory.WriteDouble2(oVal.x);this.memory.WriteByte(Asc.c_oSer_DrawingPosType.Y);this.memory.WriteByte(AscCommon.c_oSerPropLenType.Double);this.memory.WriteDouble2(oVal.y)};BinaryChartWriter.prototype.WriteCT_UserShape=function(oVal){var oThis=this;var res=c_oSerConstants.ReadOk;if(AscFormat.isRealNumber(oVal.fromX)&&AscFormat.isRealNumber(oVal.fromY)){var oNewVal={x:oVal.fromX,y:oVal.fromY};this.bs.WriteItem(Asc.c_oSer_DrawingType.From, function(){oThis.WriteCT_FromTo(oNewVal)})}if(AscFormat.isRealNumber(oVal.toX)&&AscFormat.isRealNumber(oVal.toY)){var oNewVal={x:oVal.toX,y:oVal.toY};var type=oVal.getObjectType()===AscDFH.historyitem_type_AbsSizeAnchor?Asc.c_oSer_DrawingType.Ext:Asc.c_oSer_DrawingType.To;this.bs.WriteItem(type,function(){oThis.WriteCT_FromTo(oNewVal)})}this.bs.WriteItem(Asc.c_oSer_DrawingType.pptxDrawing,function(){pptx_content_writer.WriteDrawing(oThis.memory,oVal.object,null,null,null)})};BinaryChartWriter.prototype.WriteCT_UserShapes= function(oVal){var oThis=this;this.bs.WriteItem(c_oserct_usershapes_COUNT,function(){oThis.memory.WriteLong(oVal.length)});for(var i=0;i<oVal.length;++i)if(oVal[i]instanceof AscFormat.CRelSizeAnchor)this.bs.WriteItem(c_oserct_usershapes_SHAPE_REL,function(t,l){oThis.WriteCT_UserShape(oVal[i])});else this.bs.WriteItem(c_oserct_usershapes_SHAPE_ABS,function(t,l){oThis.WriteCT_UserShape(oVal[i])})};BinaryChartWriter.prototype.WriteSpPr=function(oVal){AscCommon.pptx_content_writer.WriteSpPr(this.memory, oVal)};BinaryChartWriter.prototype.WriteClrMapOverride=function(oVal){AscCommon.pptx_content_writer.WriteClrMapOverride(this.memory,oVal)};BinaryChartWriter.prototype.WriteTxPr=function(oVal){AscCommon.pptx_content_writer.WriteTextBody(this.memory,oVal)};BinaryChartWriter.prototype.percentToString=function(val,bInteger,bSign){var sRes;if(bInteger)sRes=parseInt(val).toString();else sRes=val.toString();if(bSign)sRes+="%";return sRes};BinaryChartWriter.prototype.metricToString=function(val,bInteger){var sRes; if(bInteger)sRes=parseInt(val).toString();else sRes=val.toString();sRes+="mm";return sRes};BinaryChartWriter.prototype.WriteCT_Boolean=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_booleanVAL,function(){oThis.memory.WriteBool(oVal)})};BinaryChartWriter.prototype.WriteCT_RelId=function(oVal){var oThis=this;var oCurVal=oVal.m_id;if(null!=oCurVal)this.bs.WriteItem(c_oserct_relidID,function(){oThis.memory.WriteString3(oCurVal)})};BinaryChartWriter.prototype.WriteCT_PageSetup= function(oVal){var oThis=this;if(null!=oVal.paperSize)this.bs.WriteItem(c_oserct_pagesetupPAPERSIZE,function(){oThis.memory.WriteLong(oVal.paperSize)});if(null!=oVal.paperHeight)this.bs.WriteItem(c_oserct_pagesetupPAPERHEIGHT,function(){oThis.memory.WriteString3(oThis.metricToString(oVal.paperHeight,false))});if(null!=oVal.paperWidth)this.bs.WriteItem(c_oserct_pagesetupPAPERWIDTH,function(){oThis.memory.WriteString3(oThis.metricToString(oVal.paperWidth,false))});if(null!=oVal.firstPageNumber)this.bs.WriteItem(c_oserct_pagesetupFIRSTPAGENUMBER, function(){oThis.memory.WriteLong(oVal.firstPageNumber)});if(null!=oVal.orientation){var nVal=null;switch(oVal.orientation){case AscFormat.PAGE_SETUP_ORIENTATION_DEFAULT:nVal=st_pagesetuporientationDEFAULT;break;case AscFormat.PAGE_SETUP_ORIENTATION_PORTRAIT:nVal=st_pagesetuporientationPORTRAIT;break;case AscFormat.PAGE_SETUP_ORIENTATION_LANDSCAPE:nVal=st_pagesetuporientationLANDSCAPE;break}if(null!=nVal)this.bs.WriteItem(c_oserct_pagesetupORIENTATION,function(){oThis.memory.WriteByte(nVal)})}if(null!= oVal.blackAndWhite)this.bs.WriteItem(c_oserct_pagesetupBLACKANDWHITE,function(){oThis.memory.WriteBool(oVal.blackAndWhite)});if(null!=oVal.draft)this.bs.WriteItem(c_oserct_pagesetupDRAFT,function(){oThis.memory.WriteBool(oVal.draft)});if(null!=oVal.useFirstPageNumb)this.bs.WriteItem(c_oserct_pagesetupUSEFIRSTPAGENUMBER,function(){oThis.memory.WriteBool(oVal.useFirstPageNumb)});if(null!=oVal.horizontalDpi)this.bs.WriteItem(c_oserct_pagesetupHORIZONTALDPI,function(){oThis.memory.WriteLong(oVal.horizontalDpi)}); if(null!=oVal.verticalDpi)this.bs.WriteItem(c_oserct_pagesetupVERTICALDPI,function(){oThis.memory.WriteLong(oVal.verticalDpi)});if(null!=oVal.copies)this.bs.WriteItem(c_oserct_pagesetupCOPIES,function(){oThis.memory.WriteLong(oVal.copies)})};BinaryChartWriter.prototype.WriteCT_PageMargins=function(oVal){var oThis=this;if(null!=oVal.l)this.bs.WriteItem(c_oserct_pagemarginsL,function(){oThis.memory.WriteDouble2(oVal.l)});if(null!=oVal.r)this.bs.WriteItem(c_oserct_pagemarginsR,function(){oThis.memory.WriteDouble2(oVal.r)}); if(null!=oVal.t)this.bs.WriteItem(c_oserct_pagemarginsT,function(){oThis.memory.WriteDouble2(oVal.t)});if(null!=oVal.b)this.bs.WriteItem(c_oserct_pagemarginsB,function(){oThis.memory.WriteDouble2(oVal.b)});if(null!=oVal.header)this.bs.WriteItem(c_oserct_pagemarginsHEADER,function(){oThis.memory.WriteDouble2(oVal.header)});if(null!=oVal.footer)this.bs.WriteItem(c_oserct_pagemarginsFOOTER,function(){oThis.memory.WriteDouble2(oVal.footer)})};BinaryChartWriter.prototype.WriteCT_HeaderFooter=function(oVal){var oThis= this;if(null!=oVal.oddHeader)this.bs.WriteItem(c_oserct_headerfooterODDHEADER,function(){oThis.memory.WriteString3(oVal.oddHeader)});if(null!=oVal.oddFooter)this.bs.WriteItem(c_oserct_headerfooterODDFOOTER,function(){oThis.memory.WriteString3(oVal.oddFooter)});if(null!=oVal.evenHeader)this.bs.WriteItem(c_oserct_headerfooterEVENHEADER,function(){oThis.memory.WriteString3(oVal.evenHeader)});if(null!=oVal.evenFooter)this.bs.WriteItem(c_oserct_headerfooterEVENFOOTER,function(){oThis.memory.WriteString3(oVal.evenFooter)}); if(null!=oVal.firstHeader)this.bs.WriteItem(c_oserct_headerfooterFIRSTHEADER,function(){oThis.memory.WriteString3(oVal.firstHeader)});if(null!=oVal.firstFooter)this.bs.WriteItem(c_oserct_headerfooterFIRSTFOOTER,function(){oThis.memory.WriteString3(oVal.firstFooter)});if(null!=oVal.alignWithMargins)this.bs.WriteItem(c_oserct_headerfooterALIGNWITHMARGINS,function(){oThis.memory.WriteBool(oVal.alignWithMargins)});if(null!=oVal.differentOddEven)this.bs.WriteItem(c_oserct_headerfooterDIFFERENTODDEVEN, function(){oThis.memory.WriteBool(oVal.differentOddEven)});if(null!=oVal.differentFirst)this.bs.WriteItem(c_oserct_headerfooterDIFFERENTFIRST,function(){oThis.memory.WriteBool(oVal.differentFirst)})};BinaryChartWriter.prototype.WriteCT_PrintSettings=function(oVal){var oThis=this;if(null!=oVal.headerFooter)this.bs.WriteItem(c_oserct_printsettingsHEADERFOOTER,function(){oThis.WriteCT_HeaderFooter(oVal.headerFooter)});if(null!=oVal.pageMargins)this.bs.WriteItem(c_oserct_printsettingsPAGEMARGINS,function(){oThis.WriteCT_PageMargins(oVal.pageMargins)}); if(null!=oVal.pageSetup)this.bs.WriteItem(c_oserct_printsettingsPAGESETUP,function(){oThis.WriteCT_PageSetup(oVal.pageSetup)})};BinaryChartWriter.prototype.WriteCT_ExternalData=function(oVal){var oThis=this;var oCurVal=oVal.m_autoUpdate;if(null!=oCurVal)this.bs.WriteItem(c_oserct_externaldataAUTOUPDATE,function(){oThis.WriteCT_Boolean(oCurVal)});var oCurVal=oVal.m_id;if(null!=oCurVal)this.bs.WriteItem(c_oserct_externaldataID,function(){oThis.memory.WriteString3(oCurVal)})};BinaryChartWriter.prototype.WriteCT_DispBlanksAs= function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.DISP_BLANKS_AS_SPAN:nVal=st_dispblanksasSPAN;break;case AscFormat.DISP_BLANKS_AS_GAP:nVal=st_dispblanksasGAP;break;case AscFormat.DISP_BLANKS_AS_ZERO:nVal=st_dispblanksasZERO;break}if(null!=nVal)this.bs.WriteItem(c_oserct_dispblanksasVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_LegendEntry=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_legendentryIDX, function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.bDelete)this.bs.WriteItem(c_oserct_legendentryDELETE,function(){oThis.WriteCT_Boolean(oVal.bDelete)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_legendentryTXPR,function(){oThis.WriteTxPr(oVal.txPr)})};BinaryChartWriter.prototype.WriteCT_UnsignedInt=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_unsignedintVAL,function(){oThis.memory.WriteLong(oVal)})};BinaryChartWriter.prototype.WriteCT_Extension=function(oVal){var oThis= this;var oCurVal=oVal.m_Any;if(null!=oCurVal)this.bs.WriteItem(c_oserct_extensionANY,function(){oThis.memory.WriteString3(oCurVal)});var oCurVal=oVal.m_uri;if(null!=oCurVal)this.bs.WriteItem(c_oserct_extensionURI,function(){oThis.memory.WriteString3(oCurVal)})};BinaryChartWriter.prototype.WriteCT_LegendPos=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case c_oAscChartLegendShowSettings.bottom:nVal=st_legendposB;break;case c_oAscChartLegendShowSettings.topRight:nVal=st_legendposTR; break;case c_oAscChartLegendShowSettings.left:case c_oAscChartLegendShowSettings.leftOverlay:nVal=st_legendposL;break;case c_oAscChartLegendShowSettings.right:case c_oAscChartLegendShowSettings.rightOverlay:nVal=st_legendposR;break;case c_oAscChartLegendShowSettings.top:nVal=st_legendposT;break}if(null!=nVal)this.bs.WriteItem(c_oserct_legendposVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_Legend=function(oVal){var oThis=this;if(null!=oVal.legendPos)this.bs.WriteItem(c_oserct_legendLEGENDPOS, function(){oThis.WriteCT_LegendPos(oVal.legendPos)});if(null!=oVal.legendEntryes)for(var i=0,length=oVal.legendEntryes.length;i<length;++i){var oCurVal=oVal.legendEntryes[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_legendLEGENDENTRY,function(){oThis.WriteCT_LegendEntry(oCurVal)})}this.bs.WriteItem(c_oserct_legendLAYOUT,function(){oThis.WriteCT_Layout(oVal)});if(null!=oVal.overlay)this.bs.WriteItem(c_oserct_legendOVERLAY,function(){oThis.WriteCT_Boolean(oVal.overlay)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_legendSPPR, function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_legendTXPR,function(){oThis.WriteTxPr(oVal.txPr)})};BinaryChartWriter.prototype.WriteCT_Layout=function(oVal){var oThis=this;if(null!=oVal.layout)this.bs.WriteItem(c_oserct_layoutMANUALLAYOUT,function(){oThis.WriteCT_ManualLayout(oVal.layout)})};BinaryChartWriter.prototype.WriteCT_ManualLayout=function(oVal){var oThis=this;if(null!=oVal.layoutTarget)this.bs.WriteItem(c_oserct_manuallayoutLAYOUTTARGET,function(){oThis.WriteCT_LayoutTarget(oVal.layoutTarget)}); if(null!=oVal.xMode)this.bs.WriteItem(c_oserct_manuallayoutXMODE,function(){oThis.WriteCT_LayoutMode(oVal.xMode)});if(null!=oVal.yMode)this.bs.WriteItem(c_oserct_manuallayoutYMODE,function(){oThis.WriteCT_LayoutMode(oVal.yMode)});if(null!=oVal.wMode)this.bs.WriteItem(c_oserct_manuallayoutWMODE,function(){oThis.WriteCT_LayoutMode(oVal.wMode)});if(null!=oVal.hMode)this.bs.WriteItem(c_oserct_manuallayoutHMODE,function(){oThis.WriteCT_LayoutMode(oVal.hMode)});if(null!=oVal.x)this.bs.WriteItem(c_oserct_manuallayoutX, function(){oThis.WriteCT_Double(oVal.x)});if(null!=oVal.y)this.bs.WriteItem(c_oserct_manuallayoutY,function(){oThis.WriteCT_Double(oVal.y)});if(null!=oVal.w)this.bs.WriteItem(c_oserct_manuallayoutW,function(){oThis.WriteCT_Double(oVal.w)});if(null!=oVal.h)this.bs.WriteItem(c_oserct_manuallayoutH,function(){oThis.WriteCT_Double(oVal.h)})};BinaryChartWriter.prototype.WriteCT_LayoutTarget=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case LAYOUT_TARGET_INNER:nVal=st_layouttargetINNER; break;case LAYOUT_TARGET_OUTER:nVal=st_layouttargetOUTER;break}if(null!=nVal)this.bs.WriteItem(c_oserct_layouttargetVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_LayoutMode=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case LAYOUT_MODE_EDGE:nVal=st_layoutmodeEDGE;break;case LAYOUT_MODE_FACTOR:nVal=st_layoutmodeFACTOR;break}if(null!=nVal)this.bs.WriteItem(c_oserct_layoutmodeVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_Double= function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_doubleVAL,function(){oThis.memory.WriteDouble2(oVal)})};BinaryChartWriter.prototype.WriteCT_DTable=function(oVal){var oThis=this;if(null!=oVal.showHorzBorder)this.bs.WriteItem(c_oserct_dtableSHOWHORZBORDER,function(){oThis.WriteCT_Boolean(oVal.showHorzBorder)});if(null!=oVal.showVertBorder)this.bs.WriteItem(c_oserct_dtableSHOWVERTBORDER,function(){oThis.WriteCT_Boolean(oVal.showVertBorder)});if(null!=oVal.showOutline)this.bs.WriteItem(c_oserct_dtableSHOWOUTLINE, function(){oThis.WriteCT_Boolean(oVal.showOutline)});if(null!=oVal.showKeys)this.bs.WriteItem(c_oserct_dtableSHOWKEYS,function(){oThis.WriteCT_Boolean(oVal.showKeys)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_dtableSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_dtableTXPR,function(){oThis.WriteTxPr(oVal.txPr)})};BinaryChartWriter.prototype.WriteCT_SerAx=function(oVal){var oThis=this;if(null!=oVal.axId)this.bs.WriteItem(c_oserct_seraxAXID,function(){oThis.WriteCT_UnsignedInt(oVal.axId)}); if(null!=oVal.scaling)this.bs.WriteItem(c_oserct_seraxSCALING,function(){oThis.WriteCT_Scaling(oVal.scaling)});if(null!=oVal.bDelete)this.bs.WriteItem(c_oserct_seraxDELETE,function(){oThis.WriteCT_Boolean(oVal.bDelete)});if(null!=oVal.axPos)this.bs.WriteItem(c_oserct_seraxAXPOS,function(){oThis.WriteCT_AxPos(oVal.axPos)});if(null!=oVal.majorGridlines)this.bs.WriteItem(c_oserct_seraxMAJORGRIDLINES,function(){oThis.WriteCT_ChartLines(oVal.majorGridlines)});if(null!=oVal.minorGridlines)this.bs.WriteItem(c_oserct_seraxMINORGRIDLINES, function(){oThis.WriteCT_ChartLines(oVal.minorGridlines)});if(null!=oVal.title)this.bs.WriteItem(c_oserct_seraxTITLE,function(){oThis.WriteCT_Title(oVal.title)});if(null!=oVal.numFmt)this.bs.WriteItem(c_oserct_seraxNUMFMT,function(){oThis.WriteCT_NumFmt(oVal.numFmt)});if(null!=oVal.majorTickMark)this.bs.WriteItem(c_oserct_seraxMAJORTICKMARK,function(){oThis.WriteCT_TickMark(oVal.majorTickMark)});if(null!=oVal.minorTickMark)this.bs.WriteItem(c_oserct_seraxMINORTICKMARK,function(){oThis.WriteCT_TickMark(oVal.minorTickMark)}); if(null!=oVal.tickLblPos)this.bs.WriteItem(c_oserct_seraxTICKLBLPOS,function(){oThis.WriteCT_TickLblPos(oVal.tickLblPos)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_seraxSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_seraxTXPR,function(){oThis.WriteTxPr(oVal.txPr)});if(null!=oVal.crossAx)this.bs.WriteItem(c_oserct_seraxCROSSAX,function(){oThis.WriteCT_UnsignedInt(oVal.crossAx.axId)});if(null!=oVal.crosses)this.bs.WriteItem(c_oserct_seraxCROSSES,function(){oThis.WriteCT_Crosses(oVal.crosses)}); if(null!=oVal.crossesAt)this.bs.WriteItem(c_oserct_seraxCROSSESAT,function(){oThis.WriteCT_Double(oVal.crossesAt)});if(null!=oVal.tickLblSkip)this.bs.WriteItem(c_oserct_seraxTICKLBLSKIP,function(){oThis.WriteCT_Skip(oVal.tickLblSkip)});if(null!=oVal.tickMarkSkip)this.bs.WriteItem(c_oserct_seraxTICKMARKSKIP,function(){oThis.WriteCT_Skip(oVal.tickMarkSkip)})};BinaryChartWriter.prototype.WriteCT_Scaling=function(oVal){var oThis=this;if(null!=oVal.logBase)this.bs.WriteItem(c_oserct_scalingLOGBASE,function(){oThis.WriteCT_LogBase(oVal.logBase)}); if(null!=oVal.orientation)this.bs.WriteItem(c_oserct_scalingORIENTATION,function(){oThis.WriteCT_Orientation(oVal.orientation)});if(null!=oVal.max)this.bs.WriteItem(c_oserct_scalingMAX,function(){oThis.WriteCT_Double(oVal.max)});if(null!=oVal.min)this.bs.WriteItem(c_oserct_scalingMIN,function(){oThis.WriteCT_Double(oVal.min)})};BinaryChartWriter.prototype.WriteCT_LogBase=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_logbaseVAL,function(){oThis.memory.WriteDouble2(oVal)})}; BinaryChartWriter.prototype.WriteCT_Orientation=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.ORIENTATION_MAX_MIN:nVal=st_orientationMAXMIN;break;case AscFormat.ORIENTATION_MIN_MAX:nVal=st_orientationMINMAX;break}if(null!=nVal)this.bs.WriteItem(c_oserct_orientationVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_AxPos=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.AX_POS_B:nVal=st_axposB; break;case AscFormat.AX_POS_L:nVal=st_axposL;break;case AscFormat.AX_POS_R:nVal=st_axposR;break;case AscFormat.AX_POS_T:nVal=st_axposT;break}if(null!=nVal)this.bs.WriteItem(c_oserct_axposVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_ChartLines=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_chartlinesSPPR,function(){oThis.WriteSpPr(oVal)})};BinaryChartWriter.prototype.WriteCT_Title=function(oVal){var oThis=this;if(null!=oVal.tx)this.bs.WriteItem(c_oserct_titleTX, function(){oThis.WriteCT_Tx(oVal.tx)});this.bs.WriteItem(c_oserct_titleLAYOUT,function(){oThis.WriteCT_Layout(oVal)});if(null!=oVal.overlay)this.bs.WriteItem(c_oserct_titleOVERLAY,function(){oThis.WriteCT_Boolean(oVal.overlay)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_titleSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_titleTXPR,function(){oThis.WriteTxPr(oVal.txPr)})};BinaryChartWriter.prototype.WriteCT_Tx=function(oVal){var oThis=this;if(null!=oVal.rich)this.bs.WriteItem(c_oserct_txRICH, function(){oThis.WriteTxPr(oVal.rich)});if(null!=oVal.strRef)this.bs.WriteItem(c_oserct_txSTRREF,function(){oThis.WriteCT_StrRef(oVal.strRef)})};BinaryChartWriter.prototype.WriteCT_StrRef=function(oVal){var oThis=this;if(null!=oVal.f)this.bs.WriteItem(c_oserct_strrefF,function(){oThis.memory.WriteString3(oVal.f)});if(null!=oVal.strCache)this.bs.WriteItem(c_oserct_strrefSTRCACHE,function(){oThis.WriteCT_StrData(oVal.strCache)})};BinaryChartWriter.prototype.WriteCT_StrData=function(oVal){var oThis= this;if(null!=oVal.ptCount)this.bs.WriteItem(c_oserct_strdataPTCOUNT,function(){oThis.WriteCT_UnsignedInt(oVal.ptCount)});if(null!=oVal.pts)for(var i=0,length=oVal.pts.length;i<length;++i){var oCurVal=oVal.pts[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_strdataPT,function(){oThis.WriteCT_StrVal(oCurVal)})}};BinaryChartWriter.prototype.WriteCT_StrVal=function(oVal){var oThis=this;if(null!=oVal.val)this.bs.WriteItem(c_oserct_strvalV,function(){oThis.memory.WriteString3(oVal.val)});if(null!=oVal.idx)this.bs.WriteItem(c_oserct_strvalIDX, function(){oThis.memory.WriteLong(oVal.idx)})};BinaryChartWriter.prototype.WriteCT_NumFmt=function(oVal){var oThis=this;if(null!=oVal.formatCode)this.bs.WriteItem(c_oserct_numfmtFORMATCODE,function(){oThis.memory.WriteString3(oVal.formatCode)});if(null!=oVal.sourceLinked)this.bs.WriteItem(c_oserct_numfmtSOURCELINKED,function(){oThis.memory.WriteBool(oVal.sourceLinked)})};BinaryChartWriter.prototype.WriteCT_TickMark=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case c_oAscTickMark.TICK_MARK_CROSS:nVal= st_tickmarkCROSS;break;case c_oAscTickMark.TICK_MARK_IN:nVal=st_tickmarkIN;break;case c_oAscTickMark.TICK_MARK_NONE:nVal=st_tickmarkNONE;break;case c_oAscTickMark.TICK_MARK_OUT:nVal=st_tickmarkOUT;break}if(null!=nVal)this.bs.WriteItem(c_oserct_tickmarkVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_TickLblPos=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH:nVal=st_ticklblposHIGH;break;case c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW:nVal= st_ticklblposLOW;break;case c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO:nVal=st_ticklblposNEXTTO;break;case c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE:nVal=st_ticklblposNONE;break}if(null!=nVal)this.bs.WriteItem(c_oserct_ticklblposVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_Crosses=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.CROSSES_AUTO_ZERO:nVal=st_crossesAUTOZERO;break;case AscFormat.CROSSES_MAX:nVal=st_crossesMAX; break;case AscFormat.CROSSES_MIN:nVal=st_crossesMIN;break}if(null!=nVal)this.bs.WriteItem(c_oserct_crossesVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_Skip=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_skipVAL,function(){oThis.memory.WriteLong(oVal)})};BinaryChartWriter.prototype.WriteCT_TimeUnit=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.TIME_UNIT_DAYS:nVal=st_timeunitDAYS;break;case AscFormat.TIME_UNIT_MONTHS:nVal= st_timeunitMONTHS;break;case AscFormat.TIME_UNIT_YEARS:nVal=st_timeunitYEARS;break}if(null!=nVal)this.bs.WriteItem(c_oserct_timeunitVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_DateAx=function(oVal){var oThis=this;if(null!=oVal.axId)this.bs.WriteItem(c_oserct_dateaxAXID,function(){oThis.WriteCT_UnsignedInt(oVal.axId)});if(null!=oVal.scaling)this.bs.WriteItem(c_oserct_dateaxSCALING,function(){oThis.WriteCT_Scaling(oVal.scaling)});if(null!=oVal.bDelete)this.bs.WriteItem(c_oserct_dateaxDELETE, function(){oThis.WriteCT_Boolean(oVal.bDelete)});if(null!=oVal.axPos)this.bs.WriteItem(c_oserct_dateaxAXPOS,function(){oThis.WriteCT_AxPos(oVal.axPos)});if(null!=oVal.majorGridlines)this.bs.WriteItem(c_oserct_dateaxMAJORGRIDLINES,function(){oThis.WriteCT_ChartLines(oVal.majorGridlines)});if(null!=oVal.minorGridlines)this.bs.WriteItem(c_oserct_dateaxMINORGRIDLINES,function(){oThis.WriteCT_ChartLines(oVal.minorGridlines)});if(null!=oVal.title)this.bs.WriteItem(c_oserct_dateaxTITLE,function(){oThis.WriteCT_Title(oVal.title)}); if(null!=oVal.numFmt)this.bs.WriteItem(c_oserct_dateaxNUMFMT,function(){oThis.WriteCT_NumFmt(oVal.numFmt)});if(null!=oVal.majorTickMark)this.bs.WriteItem(c_oserct_dateaxMAJORTICKMARK,function(){oThis.WriteCT_TickMark(oVal.majorTickMark)});if(null!=oVal.minorTickMark)this.bs.WriteItem(c_oserct_dateaxMINORTICKMARK,function(){oThis.WriteCT_TickMark(oVal.minorTickMark)});if(null!=oVal.tickLblPos)this.bs.WriteItem(c_oserct_dateaxTICKLBLPOS,function(){oThis.WriteCT_TickLblPos(oVal.tickLblPos)});if(null!= oVal.spPr)this.bs.WriteItem(c_oserct_dateaxSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_dateaxTXPR,function(){oThis.WriteTxPr(oVal.txPr)});if(null!=oVal.crossAx)this.bs.WriteItem(c_oserct_dateaxCROSSAX,function(){oThis.WriteCT_UnsignedInt(oVal.crossAx.axId)});if(null!=oVal.crosses)this.bs.WriteItem(c_oserct_dateaxCROSSES,function(){oThis.WriteCT_Crosses(oVal.crosses)});if(null!=oVal.crossesAt)this.bs.WriteItem(c_oserct_dateaxCROSSESAT,function(){oThis.WriteCT_Double(oVal.crossesAt)}); if(null!=oVal.auto)this.bs.WriteItem(c_oserct_dateaxAUTO,function(){oThis.WriteCT_Boolean(oVal.auto)});if(null!=oVal.lblOffset)this.bs.WriteItem(c_oserct_dateaxLBLOFFSET,function(){oThis.WriteCT_LblOffset(oVal.lblOffset)});if(null!=oVal.baseTimeUnit)this.bs.WriteItem(c_oserct_dateaxBASETIMEUNIT,function(){oThis.WriteCT_TimeUnit(oVal.baseTimeUnit)});if(null!=oVal.majorUnit)this.bs.WriteItem(c_oserct_dateaxMAJORUNIT,function(){oThis.WriteCT_AxisUnit(oVal.majorUnit)});if(null!=oVal.majorTimeUnit)this.bs.WriteItem(c_oserct_dateaxMAJORTIMEUNIT, function(){oThis.WriteCT_TimeUnit(oVal.majorTimeUnit)});if(null!=oVal.minorUnit)this.bs.WriteItem(c_oserct_dateaxMINORUNIT,function(){oThis.WriteCT_AxisUnit(oVal.minorUnit)});if(null!=oVal.minorTimeUnit)this.bs.WriteItem(c_oserct_dateaxMINORTIMEUNIT,function(){oThis.WriteCT_TimeUnit(oVal.minorTimeUnit)})};BinaryChartWriter.prototype.WriteCT_LblOffset=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_lbloffsetVAL,function(){oThis.memory.WriteString3(oThis.percentToString(oVal, true,false))})};BinaryChartWriter.prototype.WriteCT_AxisUnit=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_axisunitVAL,function(){oThis.memory.WriteDouble2(oVal)})};BinaryChartWriter.prototype.WriteCT_LblAlgn=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.LBL_ALG_CTR:nVal=st_lblalgnCTR;break;case AscFormat.LBL_ALG_L:nVal=st_lblalgnL;break;case AscFormat.LBL_ALG_R:nVal=st_lblalgnR;break}if(null!=nVal)this.bs.WriteItem(c_oserct_lblalgnVAL, function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_CatAx=function(oVal){var oThis=this;if(null!=oVal.axId)this.bs.WriteItem(c_oserct_cataxAXID,function(){oThis.WriteCT_UnsignedInt(oVal.axId)});if(null!=oVal.scaling)this.bs.WriteItem(c_oserct_cataxSCALING,function(){oThis.WriteCT_Scaling(oVal.scaling)});if(null!=oVal.bDelete)this.bs.WriteItem(c_oserct_cataxDELETE,function(){oThis.WriteCT_Boolean(oVal.bDelete)});if(null!=oVal.axPos)this.bs.WriteItem(c_oserct_cataxAXPOS, function(){oThis.WriteCT_AxPos(oVal.axPos)});if(null!=oVal.majorGridlines)this.bs.WriteItem(c_oserct_cataxMAJORGRIDLINES,function(){oThis.WriteCT_ChartLines(oVal.majorGridlines)});if(null!=oVal.minorGridlines)this.bs.WriteItem(c_oserct_cataxMINORGRIDLINES,function(){oThis.WriteCT_ChartLines(oVal.minorGridlines)});if(null!=oVal.title)this.bs.WriteItem(c_oserct_cataxTITLE,function(){oThis.WriteCT_Title(oVal.title)});if(null!=oVal.numFmt)this.bs.WriteItem(c_oserct_cataxNUMFMT,function(){oThis.WriteCT_NumFmt(oVal.numFmt)}); if(null!=oVal.majorTickMark)this.bs.WriteItem(c_oserct_cataxMAJORTICKMARK,function(){oThis.WriteCT_TickMark(oVal.majorTickMark)});if(null!=oVal.minorTickMark)this.bs.WriteItem(c_oserct_cataxMINORTICKMARK,function(){oThis.WriteCT_TickMark(oVal.minorTickMark)});if(null!=oVal.tickLblPos)this.bs.WriteItem(c_oserct_cataxTICKLBLPOS,function(){oThis.WriteCT_TickLblPos(oVal.tickLblPos)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_cataxSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_cataxTXPR, function(){oThis.WriteTxPr(oVal.txPr)});if(null!=oVal.crossAx)this.bs.WriteItem(c_oserct_cataxCROSSAX,function(){oThis.WriteCT_UnsignedInt(oVal.crossAx.axId)});if(null!=oVal.crosses)this.bs.WriteItem(c_oserct_cataxCROSSES,function(){oThis.WriteCT_Crosses(oVal.crosses)});if(null!=oVal.crossesAt)this.bs.WriteItem(c_oserct_cataxCROSSESAT,function(){oThis.WriteCT_Double(oVal.crossesAt)});if(null!=oVal.auto)this.bs.WriteItem(c_oserct_cataxAUTO,function(){oThis.WriteCT_Boolean(oVal.auto)});if(null!=oVal.lblAlgn)this.bs.WriteItem(c_oserct_cataxLBLALGN, function(){oThis.WriteCT_LblAlgn(oVal.lblAlgn)});if(null!=oVal.lblOffset)this.bs.WriteItem(c_oserct_cataxLBLOFFSET,function(){oThis.WriteCT_LblOffset(oVal.lblOffset)});if(null!=oVal.tickLblSkip)this.bs.WriteItem(c_oserct_cataxTICKLBLSKIP,function(){oThis.WriteCT_Skip(oVal.tickLblSkip)});if(null!=oVal.tickMarkSkip)this.bs.WriteItem(c_oserct_cataxTICKMARKSKIP,function(){oThis.WriteCT_Skip(oVal.tickMarkSkip)});if(null!=oVal.noMultiLvlLbl)this.bs.WriteItem(c_oserct_cataxNOMULTILVLLBL,function(){oThis.WriteCT_Boolean(oVal.noMultiLvlLbl)})}; BinaryChartWriter.prototype.WriteCT_DispUnitsLbl=function(oVal){var oThis=this;this.bs.WriteItem(c_oserct_dispunitslblLAYOUT,function(){oThis.WriteCT_Layout(oVal)});if(null!=oVal.tx)this.bs.WriteItem(c_oserct_dispunitslblTX,function(){oThis.WriteCT_Tx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_dispunitslblSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_dispunitslblTXPR,function(){oThis.WriteTxPr(oVal.txPr)})};BinaryChartWriter.prototype.WriteCT_BuiltInUnit= function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case c_oAscValAxUnits.HUNDREDS:nVal=st_builtinunitHUNDREDS;break;case c_oAscValAxUnits.THOUSANDS:nVal=st_builtinunitTHOUSANDS;break;case c_oAscValAxUnits.TEN_THOUSANDS:nVal=st_builtinunitTENTHOUSANDS;break;case c_oAscValAxUnits.HUNDRED_THOUSANDS:nVal=st_builtinunitHUNDREDTHOUSANDS;break;case c_oAscValAxUnits.MILLIONS:nVal=st_builtinunitMILLIONS;break;case c_oAscValAxUnits.TEN_MILLIONS:nVal=st_builtinunitTENMILLIONS;break;case c_oAscValAxUnits.HUNDRED_MILLIONS:nVal= st_builtinunitHUNDREDMILLIONS;break;case c_oAscValAxUnits.BILLIONS:nVal=st_builtinunitBILLIONS;break;case c_oAscValAxUnits.TRILLIONS:nVal=st_builtinunitTRILLIONS;break}if(null!=nVal)this.bs.WriteItem(c_oserct_builtinunitVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_DispUnits=function(oVal){var oThis=this;if(null!=oVal.builtInUnit)this.bs.WriteItem(c_oserct_dispunitsBUILTINUNIT,function(){oThis.WriteCT_BuiltInUnit(oVal.builtInUnit)});if(null!=oVal.custUnit)this.bs.WriteItem(c_oserct_dispunitsCUSTUNIT, function(){oThis.WriteCT_Double(oVal.custUnit)});if(null!=oVal.dispUnitsLbl)this.bs.WriteItem(c_oserct_dispunitsDISPUNITSLBL,function(){oThis.WriteCT_DispUnitsLbl(oVal.dispUnitsLbl)})};BinaryChartWriter.prototype.WriteCT_CrossBetween=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.CROSS_BETWEEN_BETWEEN:nVal=st_crossbetweenBETWEEN;break;case AscFormat.CROSS_BETWEEN_MID_CAT:nVal=st_crossbetweenMIDCAT;break}if(null!=nVal)this.bs.WriteItem(c_oserct_crossbetweenVAL, function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_ValAx=function(oVal){var oThis=this;if(null!=oVal.axId)this.bs.WriteItem(c_oserct_valaxAXID,function(){oThis.WriteCT_UnsignedInt(oVal.axId)});if(null!=oVal.scaling)this.bs.WriteItem(c_oserct_valaxSCALING,function(){oThis.WriteCT_Scaling(oVal.scaling)});if(null!=oVal.bDelete)this.bs.WriteItem(c_oserct_valaxDELETE,function(){oThis.WriteCT_Boolean(oVal.bDelete)});if(null!=oVal.axPos)this.bs.WriteItem(c_oserct_valaxAXPOS, function(){oThis.WriteCT_AxPos(oVal.axPos)});if(null!=oVal.majorGridlines)this.bs.WriteItem(c_oserct_valaxMAJORGRIDLINES,function(){oThis.WriteCT_ChartLines(oVal.majorGridlines)});if(null!=oVal.minorGridlines)this.bs.WriteItem(c_oserct_valaxMINORGRIDLINES,function(){oThis.WriteCT_ChartLines(oVal.minorGridlines)});if(null!=oVal.title)this.bs.WriteItem(c_oserct_valaxTITLE,function(){oThis.WriteCT_Title(oVal.title)});if(null!=oVal.numFmt)this.bs.WriteItem(c_oserct_valaxNUMFMT,function(){oThis.WriteCT_NumFmt(oVal.numFmt)}); if(null!=oVal.majorTickMark)this.bs.WriteItem(c_oserct_valaxMAJORTICKMARK,function(){oThis.WriteCT_TickMark(oVal.majorTickMark)});if(null!=oVal.minorTickMark)this.bs.WriteItem(c_oserct_valaxMINORTICKMARK,function(){oThis.WriteCT_TickMark(oVal.minorTickMark)});if(null!=oVal.tickLblPos)this.bs.WriteItem(c_oserct_valaxTICKLBLPOS,function(){oThis.WriteCT_TickLblPos(oVal.tickLblPos)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_valaxSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_valaxTXPR, function(){oThis.WriteTxPr(oVal.txPr)});if(null!=oVal.crossAx)this.bs.WriteItem(c_oserct_valaxCROSSAX,function(){oThis.WriteCT_UnsignedInt(oVal.crossAx.axId)});if(null!=oVal.crosses)this.bs.WriteItem(c_oserct_valaxCROSSES,function(){oThis.WriteCT_Crosses(oVal.crosses)});if(null!=oVal.crossesAt)this.bs.WriteItem(c_oserct_valaxCROSSESAT,function(){oThis.WriteCT_Double(oVal.crossesAt)});if(null!=oVal.crossBetween)this.bs.WriteItem(c_oserct_valaxCROSSBETWEEN,function(){oThis.WriteCT_CrossBetween(oVal.crossBetween)}); if(null!=oVal.majorUnit)this.bs.WriteItem(c_oserct_valaxMAJORUNIT,function(){oThis.WriteCT_AxisUnit(oVal.majorUnit)});if(null!=oVal.minorUnit)this.bs.WriteItem(c_oserct_valaxMINORUNIT,function(){oThis.WriteCT_AxisUnit(oVal.minorUnit)});if(null!=oVal.dispUnits)this.bs.WriteItem(c_oserct_valaxDISPUNITS,function(){oThis.WriteCT_DispUnits(oVal.dispUnits)})};BinaryChartWriter.prototype.WriteCT_SizeRepresents=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case SIZE_REPRESENTS_AREA:nVal= st_sizerepresentsAREA;break;case SIZE_REPRESENTS_W:nVal=st_sizerepresentsW;break}if(null!=nVal)this.bs.WriteItem(c_oserct_sizerepresentsVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_BubbleScale=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_bubblescaleVAL,function(){oThis.memory.WriteString3(oThis.percentToString(oVal,true,false))})};BinaryChartWriter.prototype.WriteCT_BubbleSer=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_bubbleserIDX, function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.order)this.bs.WriteItem(c_oserct_bubbleserORDER,function(){oThis.WriteCT_UnsignedInt(oVal.order)});if(null!=oVal.tx&&oVal.tx.isValid&&oVal.tx.isValid())this.bs.WriteItem(c_oserct_bubbleserTX,function(){oThis.WriteCT_SerTx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_bubbleserSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.invertIfNegative)this.bs.WriteItem(c_oserct_bubbleserINVERTIFNEGATIVE,function(){oThis.WriteCT_Boolean(oVal.invertIfNegative)}); if(null!=oVal.dPt)for(var i=0,length=oVal.dPt.length;i<length;++i){var oCurVal=oVal.dPt[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_bubbleserDPT,function(){oThis.WriteCT_DPt(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_bubbleserDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.trendline)this.bs.WriteItem(c_oserct_bubbleserTRENDLINE,function(){oThis.WriteCT_Trendline(oVal.trendline)});if(null!=oVal.errBars)this.bs.WriteItem(c_oserct_bubbleserERRBARS,function(){oThis.WriteCT_ErrBars(oVal.errBars)}); if(null!=oVal.xVal&&oVal.xVal.isValid&&oVal.xVal.isValid())this.bs.WriteItem(c_oserct_bubbleserXVAL,function(){oThis.WriteCT_AxDataSource(oVal.xVal)});if(null!=oVal.yVal&&oVal.yVal.isValid&&oVal.yVal.isValid())this.bs.WriteItem(c_oserct_bubbleserYVAL,function(){oThis.WriteCT_NumDataSource(oVal.yVal)});if(null!=oVal.bubbleSize&&oVal.bubbleSize.isValid&&oVal.bubbleSize.isValid())this.bs.WriteItem(c_oserct_bubbleserBUBBLESIZE,function(){oThis.WriteCT_NumDataSource(oVal.bubbleSize)});if(null!=oVal.bubble3D)this.bs.WriteItem(c_oserct_bubbleserBUBBLE3D, function(){oThis.WriteCT_Boolean(oVal.bubble3D)})};BinaryChartWriter.prototype.WriteCT_SerTx=function(oVal){var oThis=this;if(null!=oVal.strRef)this.bs.WriteItem(c_oserct_sertxSTRREF,function(){oThis.WriteCT_StrRef(oVal.strRef)});if(null!=oVal.val)this.bs.WriteItem(c_oserct_sertxV,function(){oThis.memory.WriteString3(oVal.val)})};BinaryChartWriter.prototype.WriteCT_DPt=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_dptIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)}); if(null!=oVal.invertIfNegative)this.bs.WriteItem(c_oserct_dptINVERTIFNEGATIVE,function(){oThis.WriteCT_Boolean(oVal.invertIfNegative)});if(null!=oVal.marker)this.bs.WriteItem(c_oserct_dptMARKER,function(){oThis.WriteCT_Marker(oVal.marker)});if(null!=oVal.bubble3D)this.bs.WriteItem(c_oserct_dptBUBBLE3D,function(){oThis.WriteCT_Boolean(oVal.bubble3D)});if(null!=oVal.explosion)this.bs.WriteItem(c_oserct_dptEXPLOSION,function(){oThis.WriteCT_UnsignedInt(oVal.explosion)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_dptSPPR, function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.pictureOptions)this.bs.WriteItem(c_oserct_dptPICTUREOPTIONS,function(){oThis.WriteCT_PictureOptions(oVal.pictureOptions)})};BinaryChartWriter.prototype.WriteCT_Marker=function(oVal){var oThis=this;if(null!=oVal.symbol)this.bs.WriteItem(c_oserct_markerSYMBOL,function(){oThis.WriteCT_MarkerStyle(oVal.symbol)});if(null!=oVal.size)this.bs.WriteItem(c_oserct_markerSIZE,function(){oThis.WriteCT_MarkerSize(oVal.size)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_markerSPPR, function(){oThis.WriteSpPr(oVal.spPr)})};BinaryChartWriter.prototype.WriteCT_MarkerStyle=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.SYMBOL_CIRCLE:nVal=st_markerstyleCIRCLE;break;case AscFormat.SYMBOL_DASH:nVal=st_markerstyleDASH;break;case AscFormat.SYMBOL_DIAMOND:nVal=st_markerstyleDIAMOND;break;case AscFormat.SYMBOL_DOT:nVal=st_markerstyleDOT;break;case AscFormat.SYMBOL_NONE:nVal=st_markerstyleNONE;break;case AscFormat.SYMBOL_PICTURE:nVal=st_markerstylePICTURE; break;case AscFormat.SYMBOL_PLUS:nVal=st_markerstylePLUS;break;case AscFormat.SYMBOL_SQUARE:nVal=st_markerstyleSQUARE;break;case AscFormat.SYMBOL_STAR:nVal=st_markerstyleSTAR;break;case AscFormat.SYMBOL_TRIANGLE:nVal=st_markerstyleTRIANGLE;break;case AscFormat.SYMBOL_X:nVal=st_markerstyleX;break}if(null!=nVal)this.bs.WriteItem(c_oserct_markerstyleVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_MarkerSize=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_markersizeVAL, function(){oThis.memory.WriteByte(oVal)})};BinaryChartWriter.prototype.WriteCT_PictureOptions=function(oVal){var oThis=this;if(null!=oVal.applyToFront)this.bs.WriteItem(c_oserct_pictureoptionsAPPLYTOFRONT,function(){oThis.WriteCT_Boolean(oVal.applyToFront)});if(null!=oVal.applyToSides)this.bs.WriteItem(c_oserct_pictureoptionsAPPLYTOSIDES,function(){oThis.WriteCT_Boolean(oVal.applyToSides)});if(null!=oVal.applyToEnd)this.bs.WriteItem(c_oserct_pictureoptionsAPPLYTOEND,function(){oThis.WriteCT_Boolean(oVal.applyToEnd)}); if(null!=oVal.pictureFormat)this.bs.WriteItem(c_oserct_pictureoptionsPICTUREFORMAT,function(){oThis.WriteCT_PictureFormat(oVal.pictureFormat)});if(null!=oVal.pictureStackUnit)this.bs.WriteItem(c_oserct_pictureoptionsPICTURESTACKUNIT,function(){oThis.WriteCT_PictureStackUnit(oVal.pictureStackUnit)})};BinaryChartWriter.prototype.WriteCT_PictureFormat=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case PICTURE_FORMAT_STACK_STRETCH:nVal=st_pictureformatSTRETCH;break;case PICTURE_FORMAT_STACK:nVal= st_pictureformatSTACK;break;case PICTURE_FORMAT_STACK_SCALE:nVal=st_pictureformatSTACKSCALE;break}if(null!=nVal)this.bs.WriteItem(c_oserct_pictureformatVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_PictureStackUnit=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_picturestackunitVAL,function(){oThis.memory.WriteDouble2(oVal)})};BinaryChartWriter.prototype.WriteCT_DLbls=function(oVal){var oThis=this;if(null!=oVal.dLbl)for(var i=0,length=oVal.dLbl.length;i< length;++i){var oCurVal=oVal.dLbl[i];if(null!=oCurVal&&null!=oCurVal.idx)this.bs.WriteItem(c_oserct_dlblsDLBL,function(){oThis.WriteCT_DLbl(oCurVal)})}if(null!=oVal.dLblPos)this.bs.WriteItem(c_oserct_dlblsDLBLPOS,function(){oThis.WriteCT_DLblPos(oVal.dLblPos)});if(null!=oVal.bDelete)this.bs.WriteItem(c_oserct_dlblsDELETE,function(){oThis.WriteCT_Boolean(oVal.bDelete)});if(null!=oVal.leaderLines)this.bs.WriteItem(c_oserct_dlblsLEADERLINES,function(){oThis.WriteCT_ChartLines(oVal.leaderLines)});if(null!= oVal.numFmt)this.bs.WriteItem(c_oserct_dlblsNUMFMT,function(){oThis.WriteCT_NumFmt(oVal.numFmt)});if(null!=oVal.separator)this.bs.WriteItem(c_oserct_dlblsSEPARATOR,function(){oThis.memory.WriteString3(oVal.separator)});if(null!=oVal.showBubbleSize)this.bs.WriteItem(c_oserct_dlblsSHOWBUBBLESIZE,function(){oThis.WriteCT_Boolean(oVal.showBubbleSize)});if(null!=oVal.showCatName)this.bs.WriteItem(c_oserct_dlblsSHOWCATNAME,function(){oThis.WriteCT_Boolean(oVal.showCatName)});if(null!=oVal.showLeaderLines)this.bs.WriteItem(c_oserct_dlblsSHOWLEADERLINES, function(){oThis.WriteCT_Boolean(oVal.showLeaderLines)});if(null!=oVal.showLegendKey)this.bs.WriteItem(c_oserct_dlblsSHOWLEGENDKEY,function(){oThis.WriteCT_Boolean(oVal.showLegendKey)});if(null!=oVal.showPercent)this.bs.WriteItem(c_oserct_dlblsSHOWPERCENT,function(){oThis.WriteCT_Boolean(oVal.showPercent)});if(null!=oVal.showSerName)this.bs.WriteItem(c_oserct_dlblsSHOWSERNAME,function(){oThis.WriteCT_Boolean(oVal.showSerName)});if(null!=oVal.showVal)this.bs.WriteItem(c_oserct_dlblsSHOWVAL,function(){oThis.WriteCT_Boolean(oVal.showVal)}); if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_dlblsSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_dlblsTXPR,function(){oThis.WriteTxPr(oVal.txPr)})};BinaryChartWriter.prototype.WriteCT_DLbl=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_dlblIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.dLblPos)this.bs.WriteItem(c_oserct_dlblDLBLPOS,function(){oThis.WriteCT_DLblPos(oVal.dLblPos)});if(null!=oVal.bDelete)this.bs.WriteItem(c_oserct_dlblDELETE, function(){oThis.WriteCT_Boolean(oVal.bDelete)});this.bs.WriteItem(c_oserct_dlblLAYOUT,function(){oThis.WriteCT_Layout(oVal)});if(null!=oVal.numFmt)this.bs.WriteItem(c_oserct_dlblNUMFMT,function(){oThis.WriteCT_NumFmt(oVal.numFmt)});if(null!=oVal.separator)this.bs.WriteItem(c_oserct_dlblSEPARATOR,function(){oThis.memory.WriteString3(oVal.separator)});if(null!=oVal.showBubbleSize)this.bs.WriteItem(c_oserct_dlblSHOWBUBBLESIZE,function(){oThis.WriteCT_Boolean(oVal.showBubbleSize)});if(null!=oVal.showCatName)this.bs.WriteItem(c_oserct_dlblSHOWCATNAME, function(){oThis.WriteCT_Boolean(oVal.showCatName)});if(null!=oVal.showLegendKey)this.bs.WriteItem(c_oserct_dlblSHOWLEGENDKEY,function(){oThis.WriteCT_Boolean(oVal.showLegendKey)});if(null!=oVal.showPercent)this.bs.WriteItem(c_oserct_dlblSHOWPERCENT,function(){oThis.WriteCT_Boolean(oVal.showPercent)});if(null!=oVal.showSerName)this.bs.WriteItem(c_oserct_dlblSHOWSERNAME,function(){oThis.WriteCT_Boolean(oVal.showSerName)});if(null!=oVal.showVal)this.bs.WriteItem(c_oserct_dlblSHOWVAL,function(){oThis.WriteCT_Boolean(oVal.showVal)}); if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_dlblSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.tx)this.bs.WriteItem(c_oserct_dlblTX,function(){oThis.WriteCT_Tx(oVal.tx)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_dlblTXPR,function(){oThis.WriteTxPr(oVal.txPr)})};BinaryChartWriter.prototype.WriteCT_DLblPos=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case c_oAscChartDataLabelsPos.bestFit:nVal=st_dlblposBESTFIT;break;case c_oAscChartDataLabelsPos.b:nVal= st_dlblposB;break;case c_oAscChartDataLabelsPos.ctr:nVal=st_dlblposCTR;break;case c_oAscChartDataLabelsPos.inBase:nVal=st_dlblposINBASE;break;case c_oAscChartDataLabelsPos.inEnd:nVal=st_dlblposINEND;break;case c_oAscChartDataLabelsPos.l:nVal=st_dlblposL;break;case c_oAscChartDataLabelsPos.outEnd:nVal=st_dlblposOUTEND;break;case c_oAscChartDataLabelsPos.r:nVal=st_dlblposR;break;case c_oAscChartDataLabelsPos.t:nVal=st_dlblposT;break}if(null!=nVal)this.bs.WriteItem(c_oserct_dlblposVAL,function(){oThis.memory.WriteByte(nVal)})}}; BinaryChartWriter.prototype.WriteCT_Trendline=function(oVal){var oThis=this;if(null!=oVal.name)this.bs.WriteItem(c_oserct_trendlineNAME,function(){oThis.memory.WriteString3(oVal.name)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_trendlineSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.trendlineType)this.bs.WriteItem(c_oserct_trendlineTRENDLINETYPE,function(){oThis.WriteCT_TrendlineType(oVal.trendlineType)});if(null!=oVal.order)this.bs.WriteItem(c_oserct_trendlineORDER,function(){oThis.WriteCT_Order(oVal.order)}); if(null!=oVal.period)this.bs.WriteItem(c_oserct_trendlinePERIOD,function(){oThis.WriteCT_Period(oVal.period)});if(null!=oVal.forward)this.bs.WriteItem(c_oserct_trendlineFORWARD,function(){oThis.WriteCT_Double(oVal.forward)});if(null!=oVal.backward)this.bs.WriteItem(c_oserct_trendlineBACKWARD,function(){oThis.WriteCT_Double(oVal.backward)});if(null!=oVal.intercept)this.bs.WriteItem(c_oserct_trendlineINTERCEPT,function(){oThis.WriteCT_Double(oVal.intercept)});if(null!=oVal.dispRSqr)this.bs.WriteItem(c_oserct_trendlineDISPRSQR, function(){oThis.WriteCT_Boolean(oVal.dispRSqr)});if(null!=oVal.dispEq)this.bs.WriteItem(c_oserct_trendlineDISPEQ,function(){oThis.WriteCT_Boolean(oVal.dispEq)});if(null!=oVal.trendlineLbl)this.bs.WriteItem(c_oserct_trendlineTRENDLINELBL,function(){oThis.WriteCT_TrendlineLbl(oVal.trendlineLbl)})};BinaryChartWriter.prototype.WriteCT_TrendlineType=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case TRENDLINE_TYPE_EXP:nVal=st_trendlinetypeEXP;break;case TRENDLINE_TYPE_LINEAR:nVal= st_trendlinetypeLINEAR;break;case TRENDLINE_TYPE_LOG:nVal=st_trendlinetypeLOG;break;case TRENDLINE_TYPE_MOVING_AVG:nVal=st_trendlinetypeMOVINGAVG;break;case TRENDLINE_TYPE_POLY:nVal=st_trendlinetypePOLY;break;case TRENDLINE_TYPE_POWER:nVal=st_trendlinetypePOWER;break}if(null!=nVal)this.bs.WriteItem(c_oserct_trendlinetypeVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_Order=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_orderVAL,function(){oThis.memory.WriteByte(oVal)})}; BinaryChartWriter.prototype.WriteCT_Period=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_periodVAL,function(){oThis.memory.WriteLong(oVal)})};BinaryChartWriter.prototype.WriteCT_TrendlineLbl=function(oVal){var oThis=this;this.bs.WriteItem(c_oserct_trendlinelblLAYOUT,function(){oThis.WriteCT_Layout(oVal)});if(null!=oVal.tx)this.bs.WriteItem(c_oserct_trendlinelblTX,function(){oThis.WriteCT_Tx(oVal.tx)});if(null!=oVal.numFmt)this.bs.WriteItem(c_oserct_trendlinelblNUMFMT,function(){oThis.WriteCT_NumFmt(oVal.numFmt)}); if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_trendlinelblSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_trendlinelblTXPR,function(){oThis.WriteTxPr(oVal.txPr)})};BinaryChartWriter.prototype.WriteCT_ErrBars=function(oVal){var oThis=this;if(null!=oVal.errDir)this.bs.WriteItem(c_oserct_errbarsERRDIR,function(){oThis.WriteCT_ErrDir(oVal.errDir)});if(null!=oVal.errBarType)this.bs.WriteItem(c_oserct_errbarsERRBARTYPE,function(){oThis.WriteCT_ErrBarType(oVal.errBarType)}); if(null!=oVal.errValType)this.bs.WriteItem(c_oserct_errbarsERRVALTYPE,function(){oThis.WriteCT_ErrValType(oVal.errValType)});if(null!=oVal.noEndCap)this.bs.WriteItem(c_oserct_errbarsNOENDCAP,function(){oThis.WriteCT_Boolean(oVal.noEndCap)});if(null!=oVal.plus&&oVal.plus.isValid&&oVal.plus.isValid())this.bs.WriteItem(c_oserct_errbarsPLUS,function(){oThis.WriteCT_NumDataSource(oVal.plus)});if(null!=oVal.minus&&oVal.minus.isValid&&oVal.minus.isValid())this.bs.WriteItem(c_oserct_errbarsMINUS,function(){oThis.WriteCT_NumDataSource(oVal.minus)}); if(null!=oVal.val)this.bs.WriteItem(c_oserct_errbarsVAL,function(){oThis.WriteCT_Double(oVal.val)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_errbarsSPPR,function(){oThis.WriteSpPr(oVal.spPr)})};BinaryChartWriter.prototype.WriteCT_ErrDir=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case ERR_DIR_X:nVal=st_errdirX;break;case ERR_DIR_Y:nVal=st_errdirY;break}if(null!=nVal)this.bs.WriteItem(c_oserct_errdirVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_ErrBarType= function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case ERR_BAR_TYPE_BOTH:nVal=st_errbartypeBOTH;break;case ERR_BAR_TYPE_MINUS:nVal=st_errbartypeMINUS;break;case ERR_BAR_TYPE_PLUS:nVal=st_errbartypePLUS;break}if(null!=nVal)this.bs.WriteItem(c_oserct_errbartypeVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_ErrValType=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case ERR_VAL_TYPE_CUST:nVal=st_errvaltypeCUST;break;case ERR_VAL_TYPE_FIXED_VAL:nVal= st_errvaltypeFIXEDVAL;break;case ERR_VAL_TYPE_PERCENTAGE:nVal=st_errvaltypePERCENTAGE;break;case ERR_VAL_TYPE_STD_DEV:nVal=st_errvaltypeSTDDEV;break;case ERR_VAL_TYPE_STD_ERR:nVal=st_errvaltypeSTDERR;break}if(null!=nVal)this.bs.WriteItem(c_oserct_errvaltypeVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_NumDataSource=function(oVal){var oThis=this;if(null!=oVal.numLit)this.bs.WriteItem(c_oserct_numdatasourceNUMLIT,function(){oThis.WriteCT_NumData(oVal.numLit)}); if(null!=oVal.numRef)this.bs.WriteItem(c_oserct_numdatasourceNUMREF,function(){oThis.WriteCT_NumRef(oVal.numRef)})};BinaryChartWriter.prototype.WriteCT_NumData=function(oVal){var oThis=this;if(null!=oVal.formatCode)this.bs.WriteItem(c_oserct_numdataFORMATCODE,function(){oThis.memory.WriteString3(oVal.formatCode)});if(null!=oVal.ptCount)this.bs.WriteItem(c_oserct_numdataPTCOUNT,function(){oThis.WriteCT_UnsignedInt(oVal.ptCount)});if(null!=oVal.pts)for(var i=0,length=oVal.pts.length;i<length;++i){var oCurVal= oVal.pts[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_numdataPT,function(){oThis.WriteCT_NumVal(oCurVal)})}};BinaryChartWriter.prototype.WriteCT_NumVal=function(oVal){var oThis=this;if(null!=oVal.val)this.bs.WriteItem(c_oserct_numvalV,function(){oThis.memory.WriteString3(oVal.val)});if(null!=oVal.idx)this.bs.WriteItem(c_oserct_numvalIDX,function(){oThis.memory.WriteLong(oVal.idx)});if(null!=oVal.formatCode)this.bs.WriteItem(c_oserct_numvalFORMATCODE,function(){oThis.memory.WriteString3(oVal.formatCode)})}; BinaryChartWriter.prototype.WriteCT_NumRef=function(oVal){var oThis=this;if(null!=oVal.f)this.bs.WriteItem(c_oserct_numrefF,function(){oThis.memory.WriteString3(oVal.f)});if(null!=oVal.numCache)this.bs.WriteItem(c_oserct_numrefNUMCACHE,function(){oThis.WriteCT_NumData(oVal.numCache)})};BinaryChartWriter.prototype.WriteCT_AxDataSource=function(oVal){var oThis=this;if(null!=oVal.multiLvlStrRef)this.bs.WriteItem(c_oserct_axdatasourceMULTILVLSTRREF,function(){oThis.WriteCT_MultiLvlStrRef(oVal.multiLvlStrRef)}); if(null!=oVal.numLit)this.bs.WriteItem(c_oserct_axdatasourceNUMLIT,function(){oThis.WriteCT_NumData(oVal.numLit)});if(null!=oVal.numRef)this.bs.WriteItem(c_oserct_axdatasourceNUMREF,function(){oThis.WriteCT_NumRef(oVal.numRef)});if(null!=oVal.strLit)this.bs.WriteItem(c_oserct_axdatasourceSTRLIT,function(){oThis.WriteCT_StrData(oVal.strLit)});if(null!=oVal.strRef)this.bs.WriteItem(c_oserct_axdatasourceSTRREF,function(){oThis.WriteCT_StrRef(oVal.strRef)})};BinaryChartWriter.prototype.WriteCT_MultiLvlStrRef= function(oVal){var oThis=this;if(null!=oVal.f)this.bs.WriteItem(c_oserct_multilvlstrrefF,function(){oThis.memory.WriteString3(oVal.f)});if(null!=oVal.multiLvlStrCache)this.bs.WriteItem(c_oserct_multilvlstrrefMULTILVLSTRCACHE,function(){oThis.WriteCT_MultiLvlStrData(oVal.multiLvlStrCache)})};BinaryChartWriter.prototype.WriteCT_lvl=function(oVal){var oThis=this;if(null!=oVal)for(var i=0,length=oVal.pts.length;i<length;++i){var oCurVal=oVal.pts[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_lvlPT,function(){oThis.WriteCT_StrVal(oCurVal)})}}; BinaryChartWriter.prototype.WriteCT_MultiLvlStrData=function(oVal){var oThis=this;if(null!=oVal.ptCount)this.bs.WriteItem(c_oserct_multilvlstrdataPTCOUNT,function(){oThis.WriteCT_UnsignedInt(oVal.ptCount)});var nLvl;for(nLvl=0;nLvl<oVal.lvl.length;++nLvl)this.bs.WriteItem(c_oserct_multilvlstrdataLVL,function(){oThis.WriteCT_lvl(oVal.lvl[nLvl])})};BinaryChartWriter.prototype.WriteCT_BubbleChart=function(oVal){var oThis=this;if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_bubblechartVARYCOLORS, function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_bubblechartSER,function(){oThis.WriteCT_BubbleSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_bubblechartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.bubble3D)this.bs.WriteItem(c_oserct_bubblechartBUBBLE3D,function(){oThis.WriteCT_Boolean(oVal.bubble3D)});if(null!=oVal.bubbleScale)this.bs.WriteItem(c_oserct_bubblechartBUBBLESCALE, function(){oThis.WriteCT_BubbleScale(oVal.bubbleScale)});if(null!=oVal.showNegBubbles)this.bs.WriteItem(c_oserct_bubblechartSHOWNEGBUBBLES,function(){oThis.WriteCT_Boolean(oVal.showNegBubbles)});if(null!=oVal.sizeRepresents)this.bs.WriteItem(c_oserct_bubblechartSIZEREPRESENTS,function(){oThis.WriteCT_SizeRepresents(oVal.sizeRepresents)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_bubblechartAXID, function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_bandFmts=function(oVal){var oThis=this;if(null!=oVal)for(var i=0,length=oVal.length;i<length;++i){var oCurVal=oVal[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_bandfmtsBANDFMT,function(){oThis.WriteCT_BandFmt(oCurVal)})}};BinaryChartWriter.prototype.WriteCT_Surface3DChart=function(oVal){var oThis=this;if(null!=oVal.wireframe)this.bs.WriteItem(c_oserct_surface3dchartWIREFRAME,function(){oThis.WriteCT_Boolean(oVal.wireframe)}); if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_surface3dchartSER,function(){oThis.WriteCT_SurfaceSer(oCurVal)})}if(null!=oVal.bandFmts&&oVal.bandFmts.length>0)this.bs.WriteItem(c_oserct_surface3dchartBANDFMTS,function(){oThis.WriteCT_bandFmts(oVal.bandFmts)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_surface3dchartAXID, function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_SurfaceSer=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_surfaceserIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.order)this.bs.WriteItem(c_oserct_surfaceserORDER,function(){oThis.WriteCT_UnsignedInt(oVal.order)});if(null!=oVal.tx&&oVal.tx.isValid&&oVal.tx.isValid())this.bs.WriteItem(c_oserct_surfaceserTX,function(){oThis.WriteCT_SerTx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_surfaceserSPPR, function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.cat&&oVal.cat.isValid&&oVal.cat.isValid())this.bs.WriteItem(c_oserct_surfaceserCAT,function(){oThis.WriteCT_AxDataSource(oVal.cat)});if(null!=oVal.val&&oVal.val.isValid&&oVal.val.isValid())this.bs.WriteItem(c_oserct_surfaceserVAL,function(){oThis.WriteCT_NumDataSource(oVal.val)})};BinaryChartWriter.prototype.WriteCT_BandFmt=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_bandfmtIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)}); if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_bandfmtSPPR,function(){oThis.WriteSpPr(oVal.spPr)})};BinaryChartWriter.prototype.WriteCT_SurfaceChart=function(oVal){var oThis=this;if(null!=oVal.wireframe)this.bs.WriteItem(c_oserct_surfacechartWIREFRAME,function(){oThis.WriteCT_Boolean(oVal.wireframe)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_surfacechartSER,function(){oThis.WriteCT_SurfaceSer(oCurVal)})}if(null!= oVal.bandFmts&&oVal.bandFmts.length>0)this.bs.WriteItem(c_oserct_surfacechartBANDFMTS,function(){oThis.WriteCT_bandFmts(oVal.bandFmts)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_surfacechartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_SecondPieSize=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_secondpiesizeVAL, function(){oThis.memory.WriteString3(oThis.percentToString(oVal,true,false))})};BinaryChartWriter.prototype.WriteCT_SplitType=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case SPLIT_TYPE_AUTO:nVal=st_splittypeAUTO;break;case SPLIT_TYPE_CUST:nVal=st_splittypeCUST;break;case SPLIT_TYPE_PERCENT:nVal=st_splittypePERCENT;break;case SPLIT_TYPE_POS:nVal=st_splittypePOS;break;case SPLIT_TYPE_VAL:nVal=st_splittypeVAL;break}if(null!=nVal)this.bs.WriteItem(c_oserct_splittypeVAL,function(){oThis.memory.WriteByte(nVal)})}}; BinaryChartWriter.prototype.WriteCT_OfPieType=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case OF_PIE_TYPE_PIE:nVal=st_ofpietypePIE;break;case OF_PIE_TYPE_BAR:nVal=st_ofpietypeBAR;break}if(null!=nVal)this.bs.WriteItem(c_oserct_ofpietypeVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_custSplit=function(oVal){var oThis=this;if(null!=oVal)for(var i=0,length=oVal.length;i<length;++i){var oCurVal=oVal[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_custsplitSECONDPIEPT, function(){oThis.WriteCT_UnsignedInt(oCurVal)})}};BinaryChartWriter.prototype.WriteCT_OfPieChart=function(oVal){var oThis=this;if(null!=oVal.ofPieType)this.bs.WriteItem(c_oserct_ofpiechartOFPIETYPE,function(){oThis.WriteCT_OfPieType(oVal.ofPieType)});if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_ofpiechartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_ofpiechartSER, function(){oThis.WriteCT_PieSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_ofpiechartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.gapWidth)this.bs.WriteItem(c_oserct_ofpiechartGAPWIDTH,function(){oThis.WriteCT_GapAmount(oVal.gapWidth)});if(null!=oVal.splitType)this.bs.WriteItem(c_oserct_ofpiechartSPLITTYPE,function(){oThis.WriteCT_SplitType(oVal.splitType)});if(null!=oVal.splitPos)this.bs.WriteItem(c_oserct_ofpiechartSPLITPOS,function(){oThis.WriteCT_Double(oVal.splitPos)}); if(null!=oVal.custSplit&&oVal.custSplit.length>0)this.bs.WriteItem(c_oserct_ofpiechartCUSTSPLIT,function(){oThis.WriteCT_custSplit(oVal.custSplit)});if(null!=oVal.secondPieSize)this.bs.WriteItem(c_oserct_ofpiechartSECONDPIESIZE,function(){oThis.WriteCT_SecondPieSize(oVal.secondPieSize)});if(null!=oVal.serLines)this.bs.WriteItem(c_oserct_ofpiechartSERLINES,function(){oThis.WriteCT_ChartLines(oVal.serLines)})};BinaryChartWriter.prototype.WriteCT_PieSer=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_pieserIDX, function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.order)this.bs.WriteItem(c_oserct_pieserORDER,function(){oThis.WriteCT_UnsignedInt(oVal.order)});if(null!=oVal.tx&&oVal.tx.isValid&&oVal.tx.isValid())this.bs.WriteItem(c_oserct_pieserTX,function(){oThis.WriteCT_SerTx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_pieserSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.explosion)this.bs.WriteItem(c_oserct_pieserEXPLOSION,function(){oThis.WriteCT_UnsignedInt(oVal.explosion)}); if(null!=oVal.dPt)for(var i=0,length=oVal.dPt.length;i<length;++i){var oCurVal=oVal.dPt[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_pieserDPT,function(){oThis.WriteCT_DPt(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_pieserDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.cat&&oVal.cat.isValid&&oVal.cat.isValid())this.bs.WriteItem(c_oserct_pieserCAT,function(){oThis.WriteCT_AxDataSource(oVal.cat)});if(null!=oVal.val&&oVal.val.isValid&&oVal.val.isValid())this.bs.WriteItem(c_oserct_pieserVAL, function(){oThis.WriteCT_NumDataSource(oVal.val)})};BinaryChartWriter.prototype.WriteCT_GapAmount=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_gapamountVAL,function(){oThis.memory.WriteString3(oThis.percentToString(oVal,true,false))})};BinaryChartWriter.prototype.WriteCT_Bar3DChart=function(oVal){var oThis=this;if(null!=oVal.barDir)this.bs.WriteItem(c_oserct_bar3dchartBARDIR,function(){oThis.WriteCT_BarDir(oVal.barDir)});if(null!=oVal.grouping)this.bs.WriteItem(c_oserct_bar3dchartGROUPING, function(){oThis.WriteCT_BarGrouping(oVal.grouping)});if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_bar3dchartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_bar3dchartSER,function(){oThis.WriteCT_BarSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_bar3dchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.gapWidth)this.bs.WriteItem(c_oserct_bar3dchartGAPWIDTH, function(){oThis.WriteCT_GapAmount(oVal.gapWidth)});if(null!=oVal.gapDepth)this.bs.WriteItem(c_oserct_bar3dchartGAPDEPTH,function(){oThis.WriteCT_GapAmount(oVal.gapDepth)});if(null!=oVal.shape)this.bs.WriteItem(c_oserct_bar3dchartSHAPE,function(){oThis.WriteCT_Shape(oVal.shape)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_bar3dchartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}}; BinaryChartWriter.prototype.WriteCT_BarDir=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.BAR_DIR_BAR:nVal=st_bardirBAR;break;case AscFormat.BAR_DIR_COL:nVal=st_bardirCOL;break}if(null!=nVal)this.bs.WriteItem(c_oserct_bardirVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_BarGrouping=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.BAR_GROUPING_PERCENT_STACKED:nVal=st_bargroupingPERCENTSTACKED; break;case AscFormat.BAR_GROUPING_CLUSTERED:nVal=st_bargroupingCLUSTERED;break;case AscFormat.BAR_GROUPING_STANDARD:nVal=st_bargroupingSTANDARD;break;case AscFormat.BAR_GROUPING_STACKED:nVal=st_bargroupingSTACKED;break}if(null!=nVal)this.bs.WriteItem(c_oserct_bargroupingVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_BarSer=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_barserIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!= oVal.order)this.bs.WriteItem(c_oserct_barserORDER,function(){oThis.WriteCT_UnsignedInt(oVal.order)});if(null!=oVal.tx&&oVal.tx.isValid&&oVal.tx.isValid())this.bs.WriteItem(c_oserct_barserTX,function(){oThis.WriteCT_SerTx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_barserSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.invertIfNegative)this.bs.WriteItem(c_oserct_barserINVERTIFNEGATIVE,function(){oThis.WriteCT_Boolean(oVal.invertIfNegative)});if(null!=oVal.pictureOptions)this.bs.WriteItem(c_oserct_barserPICTUREOPTIONS, function(){oThis.WriteCT_PictureOptions(oVal.pictureOptions)});if(null!=oVal.dPt)for(var i=0,length=oVal.dPt.length;i<length;++i){var oCurVal=oVal.dPt[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_barserDPT,function(){oThis.WriteCT_DPt(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_barserDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.trendline)this.bs.WriteItem(c_oserct_barserTRENDLINE,function(){oThis.WriteCT_Trendline(oVal.trendline)});if(null!=oVal.errBars)this.bs.WriteItem(c_oserct_barserERRBARS, function(){oThis.WriteCT_ErrBars(oVal.errBars)});if(null!=oVal.cat&&oVal.cat.isValid&&oVal.cat.isValid())this.bs.WriteItem(c_oserct_barserCAT,function(){oThis.WriteCT_AxDataSource(oVal.cat)});if(null!=oVal.val&&oVal.val.isValid&&oVal.val.isValid())this.bs.WriteItem(c_oserct_barserVAL,function(){oThis.WriteCT_NumDataSource(oVal.val)});if(null!=oVal.shape)this.bs.WriteItem(c_oserct_barserSHAPE,function(){oThis.WriteCT_Shape(oVal.shape)})};BinaryChartWriter.prototype.WriteCT_Shape=function(oVal){var oThis= this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.BAR_SHAPE_CONE:nVal=st_shapeCONE;break;case AscFormat.BAR_SHAPE_CONETOMAX:nVal=st_shapeCONETOMAX;break;case AscFormat.BAR_SHAPE_BOX:nVal=st_shapeBOX;break;case AscFormat.BAR_SHAPE_CYLINDER:nVal=st_shapeCYLINDER;break;case AscFormat.BAR_SHAPE_PYRAMID:nVal=st_shapePYRAMID;break;case AscFormat.BAR_SHAPE_PYRAMIDTOMAX:nVal=st_shapePYRAMIDTOMAX;break}if(null!=nVal)this.bs.WriteItem(c_oserct_shapeVAL,function(){oThis.memory.WriteByte(nVal)})}}; BinaryChartWriter.prototype.WriteCT_Overlap=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_overlapVAL,function(){oThis.memory.WriteString3(oThis.percentToString(oVal,true,false))})};BinaryChartWriter.prototype.WriteCT_BarChart=function(oVal){var oThis=this;if(null!=oVal.barDir)this.bs.WriteItem(c_oserct_barchartBARDIR,function(){oThis.WriteCT_BarDir(oVal.barDir)});if(null!=oVal.grouping)this.bs.WriteItem(c_oserct_barchartGROUPING,function(){oThis.WriteCT_BarGrouping(oVal.grouping)}); if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_barchartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_barchartSER,function(){oThis.WriteCT_BarSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_barchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.gapWidth)this.bs.WriteItem(c_oserct_barchartGAPWIDTH,function(){oThis.WriteCT_GapAmount(oVal.gapWidth)}); if(null!=oVal.overlap)this.bs.WriteItem(c_oserct_barchartOVERLAP,function(){oThis.WriteCT_Overlap(oVal.overlap)});if(null!=oVal.serLines)this.bs.WriteItem(c_oserct_barchartSERLINES,function(){oThis.WriteCT_ChartLines(oVal.serLines)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_barchartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_HoleSize= function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_holesizeVAL,function(){oThis.memory.WriteString3(oThis.percentToString(oVal,true,false))})};BinaryChartWriter.prototype.WriteCT_DoughnutChart=function(oVal){var oThis=this;if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_doughnutchartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_doughnutchartSER, function(){oThis.WriteCT_PieSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_doughnutchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.firstSliceAng)this.bs.WriteItem(c_oserct_doughnutchartFIRSTSLICEANG,function(){oThis.WriteCT_FirstSliceAng(oVal.firstSliceAng)});if(null!=oVal.holeSize)this.bs.WriteItem(c_oserct_doughnutchartHOLESIZE,function(){oThis.WriteCT_HoleSize(oVal.holeSize)})};BinaryChartWriter.prototype.WriteCT_FirstSliceAng=function(oVal){var oThis=this; if(null!=oVal)this.bs.WriteItem(c_oserct_firstsliceangVAL,function(){oThis.memory.WriteLong(oVal)})};BinaryChartWriter.prototype.WriteCT_Pie3DChart=function(oVal){var oThis=this;if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_pie3dchartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_pie3dchartSER,function(){oThis.WriteCT_PieSer(oCurVal)})}if(null!= oVal.dLbls)this.bs.WriteItem(c_oserct_pie3dchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)})};BinaryChartWriter.prototype.WriteCT_PieChart=function(oVal){var oThis=this;if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_piechartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_piechartSER,function(){oThis.WriteCT_PieSer(oCurVal)})}if(null!= oVal.dLbls)this.bs.WriteItem(c_oserct_piechartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.firstSliceAng)this.bs.WriteItem(c_oserct_piechartFIRSTSLICEANG,function(){oThis.WriteCT_FirstSliceAng(oVal.firstSliceAng)})};BinaryChartWriter.prototype.WriteCT_ScatterSer=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_scatterserIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.order)this.bs.WriteItem(c_oserct_scatterserORDER,function(){oThis.WriteCT_UnsignedInt(oVal.order)}); if(null!=oVal.tx&&oVal.tx.isValid&&oVal.tx.isValid())this.bs.WriteItem(c_oserct_scatterserTX,function(){oThis.WriteCT_SerTx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_scatterserSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.marker)this.bs.WriteItem(c_oserct_scatterserMARKER,function(){oThis.WriteCT_Marker(oVal.marker)});if(null!=oVal.dPt)for(var i=0,length=oVal.dPt.length;i<length;++i){var oCurVal=oVal.dPt[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_scatterserDPT,function(){oThis.WriteCT_DPt(oCurVal)})}if(null!= oVal.dLbls)this.bs.WriteItem(c_oserct_scatterserDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.trendline)this.bs.WriteItem(c_oserct_scatterserTRENDLINE,function(){oThis.WriteCT_Trendline(oVal.trendline)});if(null!=oVal.errBars)this.bs.WriteItem(c_oserct_scatterserERRBARS,function(){oThis.WriteCT_ErrBars(oVal.errBars)});if(null!=oVal.xVal&&oVal.xVal.isValid&&oVal.xVal.isValid())this.bs.WriteItem(c_oserct_scatterserXVAL,function(){oThis.WriteCT_AxDataSource(oVal.xVal)});if(null!=oVal.yVal&& oVal.yVal.isValid&&oVal.yVal.isValid())this.bs.WriteItem(c_oserct_scatterserYVAL,function(){oThis.WriteCT_NumDataSource(oVal.yVal)});if(null!=oVal.smooth)this.bs.WriteItem(c_oserct_scatterserSMOOTH,function(){oThis.WriteCT_Boolean(oVal.smooth)})};BinaryChartWriter.prototype.WriteCT_ScatterStyle=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.SCATTER_STYLE_NONE:nVal=st_scatterstyleNONE;break;case AscFormat.SCATTER_STYLE_LINE:nVal=st_scatterstyleLINE;break;case AscFormat.SCATTER_STYLE_LINE_MARKER:nVal= st_scatterstyleLINEMARKER;break;case AscFormat.SCATTER_STYLE_MARKER:nVal=st_scatterstyleMARKER;break;case AscFormat.SCATTER_STYLE_SMOOTH:nVal=st_scatterstyleSMOOTH;break;case AscFormat.SCATTER_STYLE_SMOOTH_MARKER:nVal=st_scatterstyleSMOOTHMARKER;break}if(null!=nVal)this.bs.WriteItem(c_oserct_scatterstyleVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_ScatterChart=function(oVal){var oThis=this;if(null!=oVal.scatterStyle)this.bs.WriteItem(c_oserct_scatterchartSCATTERSTYLE, function(){oThis.WriteCT_ScatterStyle(oVal.scatterStyle)});if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_scatterchartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_scatterchartSER,function(){oThis.WriteCT_ScatterSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_scatterchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)}); if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_scatterchartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_RadarSer=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_radarserIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.order)this.bs.WriteItem(c_oserct_radarserORDER,function(){oThis.WriteCT_UnsignedInt(oVal.order)}); if(null!=oVal.tx&&oVal.tx.isValid&&oVal.tx.isValid())this.bs.WriteItem(c_oserct_radarserTX,function(){oThis.WriteCT_SerTx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_radarserSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.marker)this.bs.WriteItem(c_oserct_radarserMARKER,function(){oThis.WriteCT_Marker(oVal.marker)});if(null!=oVal.dPt)for(var i=0,length=oVal.dPt.length;i<length;++i){var oCurVal=oVal.dPt[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_radarserDPT,function(){oThis.WriteCT_DPt(oCurVal)})}if(null!= oVal.dLbls)this.bs.WriteItem(c_oserct_radarserDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.cat&&oVal.cat.isValid&&oVal.cat.isValid())this.bs.WriteItem(c_oserct_radarserCAT,function(){oThis.WriteCT_AxDataSource(oVal.cat)});if(null!=oVal.val&&oVal.val.isValid&&oVal.val.isValid())this.bs.WriteItem(c_oserct_radarserVAL,function(){oThis.WriteCT_NumDataSource(oVal.val)})};BinaryChartWriter.prototype.WriteCT_RadarStyle=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case RADAR_STYLE_STANDARD:nVal= st_radarstyleSTANDARD;break;case RADAR_STYLE_MARKER:nVal=st_radarstyleMARKER;break;case RADAR_STYLE_FILLED:nVal=st_radarstyleFILLED;break}if(null!=nVal)this.bs.WriteItem(c_oserct_radarstyleVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_RadarChart=function(oVal){var oThis=this;if(null!=oVal.radarStyle)this.bs.WriteItem(c_oserct_radarchartRADARSTYLE,function(){oThis.WriteCT_RadarStyle(oVal.radarStyle)});if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_radarchartVARYCOLORS, function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_radarchartSER,function(){oThis.WriteCT_RadarSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_radarchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_radarchartAXID, function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_StockChart=function(oVal){var oThis=this;if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_stockchartSER,function(){oThis.WriteCT_LineSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_stockchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.dropLines)this.bs.WriteItem(c_oserct_stockchartDROPLINES, function(){oThis.WriteCT_ChartLines(oVal.dropLines)});if(null!=oVal.hiLowLines)this.bs.WriteItem(c_oserct_stockchartHILOWLINES,function(){oThis.WriteCT_ChartLines(oVal.hiLowLines)});if(null!=oVal.upDownBars)this.bs.WriteItem(c_oserct_stockchartUPDOWNBARS,function(){oThis.WriteCT_UpDownBars(oVal.upDownBars)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_stockchartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}}; BinaryChartWriter.prototype.WriteCT_LineSer=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_lineserIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.order)this.bs.WriteItem(c_oserct_lineserORDER,function(){oThis.WriteCT_UnsignedInt(oVal.order)});if(null!=oVal.tx&&oVal.tx.isValid&&oVal.tx.isValid())this.bs.WriteItem(c_oserct_lineserTX,function(){oThis.WriteCT_SerTx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_lineserSPPR,function(){oThis.WriteSpPr(oVal.spPr)}); if(null!=oVal.marker)this.bs.WriteItem(c_oserct_lineserMARKER,function(){oThis.WriteCT_Marker(oVal.marker)});if(null!=oVal.dPt)for(var i=0,length=oVal.dPt.length;i<length;++i){var oCurVal=oVal.dPt[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_lineserDPT,function(){oThis.WriteCT_DPt(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_lineserDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.trendline)this.bs.WriteItem(c_oserct_lineserTRENDLINE,function(){oThis.WriteCT_Trendline(oVal.trendline)}); if(null!=oVal.errBars)this.bs.WriteItem(c_oserct_lineserERRBARS,function(){oThis.WriteCT_ErrBars(oVal.errBars)});if(null!=oVal.cat&&oVal.cat.isValid&&oVal.cat.isValid())this.bs.WriteItem(c_oserct_lineserCAT,function(){oThis.WriteCT_AxDataSource(oVal.cat)});if(null!=oVal.val&&oVal.val.isValid&&oVal.val.isValid())this.bs.WriteItem(c_oserct_lineserVAL,function(){oThis.WriteCT_NumDataSource(oVal.val)});if(null!=oVal.smooth)this.bs.WriteItem(c_oserct_lineserSMOOTH,function(){oThis.WriteCT_Boolean(oVal.smooth)})}; BinaryChartWriter.prototype.WriteCT_UpDownBars=function(oVal){var oThis=this;if(null!=oVal.gapWidth)this.bs.WriteItem(c_oserct_updownbarsGAPWIDTH,function(){oThis.WriteCT_GapAmount(oVal.gapWidth)});if(null!=oVal.upBars)this.bs.WriteItem(c_oserct_updownbarsUPBARS,function(){oThis.WriteCT_UpDownBar(oVal.upBars)});if(null!=oVal.downBars)this.bs.WriteItem(c_oserct_updownbarsDOWNBARS,function(){oThis.WriteCT_UpDownBar(oVal.downBars)})};BinaryChartWriter.prototype.WriteCT_UpDownBar=function(oVal){var oThis= this;if(null!=oVal)this.bs.WriteItem(c_oserct_updownbarSPPR,function(){oThis.WriteSpPr(oVal)})};BinaryChartWriter.prototype.WriteCT_Line3DChart=function(oVal){var oThis=this;if(null!=oVal.grouping)this.bs.WriteItem(c_oserct_line3dchartGROUPING,function(){oThis.WriteCT_Grouping(oVal.grouping)});if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_line3dchartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal= oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_line3dchartSER,function(){oThis.WriteCT_LineSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_line3dchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.dropLines)this.bs.WriteItem(c_oserct_line3dchartDROPLINES,function(){oThis.WriteCT_ChartLines(oVal.dropLines)});if(null!=oVal.gapDepth)this.bs.WriteItem(c_oserct_line3dchartGAPDEPTH,function(){oThis.WriteCT_GapAmount(oVal.gapDepth)});if(null!=oVal.axId)for(var i= 0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_line3dchartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_Grouping=function(oVal){var oThis=this;if(null!=oVal){var nVal=null;switch(oVal){case AscFormat.GROUPING_PERCENT_STACKED:nVal=st_groupingPERCENTSTACKED;break;case AscFormat.GROUPING_STANDARD:nVal=st_groupingSTANDARD;break;case AscFormat.GROUPING_STACKED:nVal=st_groupingSTACKED; break}if(null!=nVal)this.bs.WriteItem(c_oserct_groupingVAL,function(){oThis.memory.WriteByte(nVal)})}};BinaryChartWriter.prototype.WriteCT_LineChart=function(oVal){var oThis=this;if(null!=oVal.grouping)this.bs.WriteItem(c_oserct_linechartGROUPING,function(){oThis.WriteCT_Grouping(oVal.grouping)});if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_linechartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal= oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_linechartSER,function(){oThis.WriteCT_LineSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_linechartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.dropLines)this.bs.WriteItem(c_oserct_linechartDROPLINES,function(){oThis.WriteCT_ChartLines(oVal.dropLines)});if(null!=oVal.hiLowLines)this.bs.WriteItem(c_oserct_linechartHILOWLINES,function(){oThis.WriteCT_ChartLines(oVal.hiLowLines)});if(null!=oVal.upDownBars)this.bs.WriteItem(c_oserct_linechartUPDOWNBARS, function(){oThis.WriteCT_UpDownBars(oVal.upDownBars)});if(null!=oVal.marker)this.bs.WriteItem(c_oserct_linechartMARKER,function(){oThis.WriteCT_Boolean(oVal.marker)});if(null!=oVal.smooth)this.bs.WriteItem(c_oserct_linechartSMOOTH,function(){oThis.WriteCT_Boolean(oVal.smooth)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_linechartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}}; BinaryChartWriter.prototype.WriteCT_Area3DChart=function(oVal){var oThis=this;if(null!=oVal.grouping)this.bs.WriteItem(c_oserct_area3dchartGROUPING,function(){oThis.WriteCT_Grouping(oVal.grouping)});if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_area3dchartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_area3dchartSER,function(){oThis.WriteCT_AreaSer(oCurVal)})}if(null!= oVal.dLbls)this.bs.WriteItem(c_oserct_area3dchartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.dropLines)this.bs.WriteItem(c_oserct_area3dchartDROPLINES,function(){oThis.WriteCT_ChartLines(oVal.dropLines)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_area3dchartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_AreaSer=function(oVal){var oThis= this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_areaserIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.order)this.bs.WriteItem(c_oserct_areaserORDER,function(){oThis.WriteCT_UnsignedInt(oVal.order)});if(null!=oVal.tx&&oVal.tx.isValid&&oVal.tx.isValid())this.bs.WriteItem(c_oserct_areaserTX,function(){oThis.WriteCT_SerTx(oVal.tx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_areaserSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.pictureOptions)this.bs.WriteItem(c_oserct_areaserPICTUREOPTIONS, function(){oThis.WriteCT_PictureOptions(oVal.pictureOptions)});if(null!=oVal.dPt)for(var i=0,length=oVal.dPt.length;i<length;++i){var oCurVal=oVal.dPt[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_areaserDPT,function(){oThis.WriteCT_DPt(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_areaserDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.trendline)this.bs.WriteItem(c_oserct_areaserTRENDLINE,function(){oThis.WriteCT_Trendline(oVal.trendline)});if(null!=oVal.errBars)this.bs.WriteItem(c_oserct_areaserERRBARS, function(){oThis.WriteCT_ErrBars(oVal.errBars)});if(null!=oVal.cat&&oVal.cat.isValid&&oVal.cat.isValid())this.bs.WriteItem(c_oserct_areaserCAT,function(){oThis.WriteCT_AxDataSource(oVal.cat)});if(null!=oVal.val&&oVal.val.isValid&&oVal.val.isValid())this.bs.WriteItem(c_oserct_areaserVAL,function(){oThis.WriteCT_NumDataSource(oVal.val)})};BinaryChartWriter.prototype.WriteCT_AreaChart=function(oVal){var oThis=this;if(null!=oVal.grouping)this.bs.WriteItem(c_oserct_areachartGROUPING,function(){oThis.WriteCT_Grouping(oVal.grouping)}); if(null!=oVal.varyColors)this.bs.WriteItem(c_oserct_areachartVARYCOLORS,function(){oThis.WriteCT_Boolean(oVal.varyColors)});if(null!=oVal.series)for(var i=0,length=oVal.series.length;i<length;++i){var oCurVal=oVal.series[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_areachartSER,function(){oThis.WriteCT_AreaSer(oCurVal)})}if(null!=oVal.dLbls)this.bs.WriteItem(c_oserct_areachartDLBLS,function(){oThis.WriteCT_DLbls(oVal.dLbls)});if(null!=oVal.dropLines)this.bs.WriteItem(c_oserct_areachartDROPLINES, function(){oThis.WriteCT_ChartLines(oVal.dropLines)});if(null!=oVal.axId)for(var i=0,length=oVal.axId.length;i<length;++i){var oCurVal=oVal.axId[i];if(null!=oCurVal&&null!=oCurVal.axId)this.bs.WriteItem(c_oserct_areachartAXID,function(){oThis.WriteCT_UnsignedInt(oCurVal.axId)})}};BinaryChartWriter.prototype.WriteCT_PlotArea=function(oVal,oChart){var oThis=this;this.bs.WriteItem(c_oserct_plotareaLAYOUT,function(){oThis.WriteCT_Layout(oVal)});for(var i=0,length=oVal.charts.length;i<length;++i){var chart= oVal.charts[i];if(chart instanceof AscFormat.CAreaChart)this.bs.WriteItem(c_oserct_plotareaAREACHART,function(){oThis.WriteCT_AreaChart(chart)});else if(chart instanceof AscFormat.CBarChart)if(chart.b3D)this.bs.WriteItem(c_oserct_plotareaBAR3DCHART,function(){oThis.WriteCT_Bar3DChart(chart)});else this.bs.WriteItem(c_oserct_plotareaBARCHART,function(){oThis.WriteCT_BarChart(chart)});else if(chart instanceof AscFormat.CBubbleChart)this.bs.WriteItem(c_oserct_plotareaBUBBLECHART,function(){oThis.WriteCT_BubbleChart(chart)}); else if(chart instanceof AscFormat.CDoughnutChart)this.bs.WriteItem(c_oserct_plotareaDOUGHNUTCHART,function(){oThis.WriteCT_DoughnutChart(chart)});else if(chart instanceof AscFormat.CLineChart)if(!oChart.view3D)this.bs.WriteItem(c_oserct_plotareaLINECHART,function(){oThis.WriteCT_LineChart(chart)});else this.bs.WriteItem(c_oserct_plotareaLINE3DCHART,function(){oThis.WriteCT_Line3DChart(chart)});else if(chart instanceof AscFormat.COfPieChart)this.bs.WriteItem(c_oserct_plotareaOFPIECHART,function(){oThis.WriteCT_OfPieChart(chart)}); else if(chart instanceof AscFormat.CPieChart)if(!oChart.view3D&&!chart.b3D)this.bs.WriteItem(c_oserct_plotareaPIECHART,function(){oThis.WriteCT_PieChart(chart)});else this.bs.WriteItem(c_oserct_plotareaPIE3DCHART,function(){oThis.WriteCT_Pie3DChart(chart)});else if(chart instanceof AscFormat.CRadarChart)this.bs.WriteItem(c_oserct_plotareaRADARCHART,function(){oThis.WriteCT_RadarChart(chart)});else if(chart instanceof AscFormat.CScatterChart)this.bs.WriteItem(c_oserct_plotareaSCATTERCHART,function(){oThis.WriteCT_ScatterChart(chart)}); else if(chart instanceof AscFormat.CStockChart)this.bs.WriteItem(c_oserct_plotareaSTOCKCHART,function(){oThis.WriteCT_StockChart(chart)});else if(chart instanceof AscFormat.CSurfaceChart)this.bs.WriteItem(c_oserct_plotareaSURFACECHART,function(){oThis.WriteCT_SurfaceChart(chart)})}for(var i=0,length=oVal.axId.length;i<length;++i){var axis=oVal.axId[i];if(axis instanceof AscFormat.CCatAx)this.bs.WriteItem(c_oserct_plotareaCATAX,function(){oThis.WriteCT_CatAx(axis)});else if(axis instanceof AscFormat.CValAx)this.bs.WriteItem(c_oserct_plotareaVALAX, function(){oThis.WriteCT_ValAx(axis)});else if(axis instanceof AscFormat.CDateAx)this.bs.WriteItem(c_oserct_plotareaDATEAX,function(){oThis.WriteCT_DateAx(axis)});else if(axis instanceof AscFormat.CSerAx)this.bs.WriteItem(c_oserct_plotareaSERAX,function(){oThis.WriteCT_SerAx(axis)})}if(null!=oVal.dTable)this.bs.WriteItem(c_oserct_plotareaDTABLE,function(){oThis.WriteCT_DTable(oVal.dTable)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_plotareaSPPR,function(){oThis.WriteSpPr(oVal.spPr)})};BinaryChartWriter.prototype.WriteCT_Thickness= function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_thicknessVAL,function(){oThis.memory.WriteString3(oThis.percentToString(oVal,true,false))})};BinaryChartWriter.prototype.WriteCT_Surface=function(oVal){var oThis=this;if(null!=oVal.thickness)this.bs.WriteItem(c_oserct_surfaceTHICKNESS,function(){oThis.WriteCT_Thickness(oVal.thickness)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_surfaceSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.pictureOptions)this.bs.WriteItem(c_oserct_surfacePICTUREOPTIONS, function(){oThis.WriteCT_PictureOptions(oVal.pictureOptions)})};BinaryChartWriter.prototype.WriteCT_Perspective=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_perspectiveVAL,function(){oThis.memory.WriteByte(oVal)})};BinaryChartWriter.prototype.WriteCT_DepthPercent=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_depthpercentVAL,function(){oThis.memory.WriteString3(oVal)})};BinaryChartWriter.prototype.WriteCT_RotY=function(oVal){var oThis=this;if(null!= oVal)this.bs.WriteItem(c_oserct_rotyVAL,function(){oThis.memory.WriteLong(oVal)})};BinaryChartWriter.prototype.WriteCT_HPercent=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_hpercentVAL,function(){oThis.memory.WriteString3(oThis.percentToString(oVal,true,false))})};BinaryChartWriter.prototype.WriteCT_RotX=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_rotxVAL,function(){oThis.memory.WriteSByte(oVal)})};BinaryChartWriter.prototype.WriteCT_View3D=function(oVal){var oThis= this;if(null!=oVal.rotX)this.bs.WriteItem(c_oserct_view3dROTX,function(){oThis.WriteCT_RotX(oVal.rotX)});if(null!=oVal.hPercent)this.bs.WriteItem(c_oserct_view3dHPERCENT,function(){oThis.WriteCT_HPercent(oVal.hPercent)});if(null!=oVal.rotY)this.bs.WriteItem(c_oserct_view3dROTY,function(){oThis.WriteCT_RotY(oVal.rotY)});if(null!=oVal.depthPercent)this.bs.WriteItem(c_oserct_view3dDEPTHPERCENT,function(){oThis.WriteCT_DepthPercent(oVal.depthPercent)});if(null!=oVal.rAngAx)this.bs.WriteItem(c_oserct_view3dRANGAX, function(){oThis.WriteCT_Boolean(oVal.rAngAx)});if(null!=oVal.perspective)this.bs.WriteItem(c_oserct_view3dPERSPECTIVE,function(){oThis.WriteCT_Perspective(oVal.perspective)})};BinaryChartWriter.prototype.WriteCT_PivotFmt=function(oVal){var oThis=this;if(null!=oVal.idx)this.bs.WriteItem(c_oserct_pivotfmtIDX,function(){oThis.WriteCT_UnsignedInt(oVal.idx)});if(null!=oVal.spPr)this.bs.WriteItem(c_oserct_pivotfmtSPPR,function(){oThis.WriteSpPr(oVal.spPr)});if(null!=oVal.txPr)this.bs.WriteItem(c_oserct_pivotfmtTXPR, function(){oThis.WriteTxPr(oVal.txPr)});if(null!=oVal.marker)this.bs.WriteItem(c_oserct_pivotfmtMARKER,function(){oThis.WriteCT_Marker(oVal.marker)});if(null!=oVal.dLbl&&null!=oVal.dLbl.idx)this.bs.WriteItem(c_oserct_pivotfmtDLBL,function(){oThis.WriteCT_DLbl(oVal.dLbl)})};BinaryChartWriter.prototype.WriteCT_pivotFmts=function(oVal){var oThis=this;if(null!=oVal)for(var i=0,length=oVal.length;i<length;++i){var oCurVal=oVal[i];if(null!=oCurVal)this.bs.WriteItem(c_oserct_pivotfmtsPIVOTFMT,function(){oThis.WriteCT_PivotFmt(oCurVal)})}}; BinaryChartWriter.prototype.WriteCT_Chart=function(oVal){var oThis=this;if(null!=oVal.title)this.bs.WriteItem(c_oserct_chartTITLE,function(){oThis.WriteCT_Title(oVal.title)});if(null!=oVal.autoTitleDeleted)this.bs.WriteItem(c_oserct_chartAUTOTITLEDELETED,function(){oThis.WriteCT_Boolean(oVal.autoTitleDeleted)});if(null!=oVal.pivotFmts&&oVal.pivotFmts.length>0)this.bs.WriteItem(c_oserct_chartPIVOTFMTS,function(){oThis.WriteCT_pivotFmts(oVal.pivotFmts)});if(null!=oVal.view3D)this.bs.WriteItem(c_oserct_chartVIEW3D, function(){oThis.WriteCT_View3D(oVal.view3D)});if(null!=oVal.floor)this.bs.WriteItem(c_oserct_chartFLOOR,function(){oThis.WriteCT_Surface(oVal.floor)});if(null!=oVal.sideWall)this.bs.WriteItem(c_oserct_chartSIDEWALL,function(){oThis.WriteCT_Surface(oVal.sideWall)});if(null!=oVal.backWall)this.bs.WriteItem(c_oserct_chartBACKWALL,function(){oThis.WriteCT_Surface(oVal.backWall)});if(null!=oVal.plotArea)this.bs.WriteItem(c_oserct_chartPLOTAREA,function(){oThis.WriteCT_PlotArea(oVal.plotArea,oVal)});if(null!= oVal.legend)this.bs.WriteItem(c_oserct_chartLEGEND,function(){oThis.WriteCT_Legend(oVal.legend)});if(null!=oVal.plotVisOnly)this.bs.WriteItem(c_oserct_chartPLOTVISONLY,function(){oThis.WriteCT_Boolean(oVal.plotVisOnly)});if(null!=oVal.dispBlanksAs)this.bs.WriteItem(c_oserct_chartDISPBLANKSAS,function(){oThis.WriteCT_DispBlanksAs(oVal.dispBlanksAs)});if(null!=oVal.showDLblsOverMax)this.bs.WriteItem(c_oserct_chartSHOWDLBLSOVERMAX,function(){oThis.WriteCT_Boolean(oVal.showDLblsOverMax)})};BinaryChartWriter.prototype.WriteCT_Protection= function(oVal){var oThis=this;if(null!=oVal.chartObject)this.bs.WriteItem(c_oserct_protectionCHARTOBJECT,function(){oThis.WriteCT_Boolean(oVal.chartObject)});if(null!=oVal.data)this.bs.WriteItem(c_oserct_protectionDATA,function(){oThis.WriteCT_Boolean(oVal.data)});if(null!=oVal.formatting)this.bs.WriteItem(c_oserct_protectionFORMATTING,function(){oThis.WriteCT_Boolean(oVal.formatting)});if(null!=oVal.selection)this.bs.WriteItem(c_oserct_protectionSELECTION,function(){oThis.WriteCT_Boolean(oVal.selection)}); if(null!=oVal.userInterface)this.bs.WriteItem(c_oserct_protectionUSERINTERFACE,function(){oThis.WriteCT_Boolean(oVal.userInterface)})};BinaryChartWriter.prototype.WriteCT_PivotSource=function(oVal){var oThis=this;if(null!=oVal.name)this.bs.WriteItem(c_oserct_pivotsourceNAME,function(){oThis.memory.WriteString3(oVal.name)});if(null!=oVal.fmtId)this.bs.WriteItem(c_oserct_pivotsourceFMTID,function(){oThis.WriteCT_UnsignedInt(oVal.fmtId)})};BinaryChartWriter.prototype.WriteCT_Style1=function(oVal){var oThis= this;if(null!=oVal)this.bs.WriteItem(c_oserct_style1VAL,function(){oThis.memory.WriteByte(oVal)})};BinaryChartWriter.prototype.WriteCT_Style=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_styleVAL,function(){oThis.memory.WriteByte(oVal)})};BinaryChartWriter.prototype.WriteCT_TextLanguageID=function(oVal){var oThis=this;if(null!=oVal)this.bs.WriteItem(c_oserct_textlanguageidVAL,function(){oThis.memory.WriteString3(oVal)})};BinaryChartWriter.prototype.WriteAlternateContent=function(oVal){var oThis= this;if(null!=oVal.m_Choice)for(var i=0,length=oVal.m_Choice.length;i<length;++i){var oCurVal=oVal.m_Choice[i];if(null!=oCurVal)this.bs.WriteItem(c_oseralternatecontentCHOICE,function(){oThis.WriteAlternateContentChoice(oCurVal)})}var oCurVal=oVal.m_Fallback;if(null!=oCurVal)this.bs.WriteItem(c_oseralternatecontentFALLBACK,function(){oThis.WriteAlternateContentFallback(oCurVal)})};BinaryChartWriter.prototype.WriteAlternateContentChoice=function(oVal){var oThis=this;var oCurVal=oVal.m_style;if(null!= oCurVal)this.bs.WriteItem(c_oseralternatecontentchoiceSTYLE,function(){oThis.WriteCT_Style(oCurVal)});var oCurVal=oVal.m_Requires;if(null!=oCurVal)this.bs.WriteItem(c_oseralternatecontentchoiceREQUIRES,function(){oThis.memory.WriteString3(oCurVal)})};BinaryChartWriter.prototype.WriteAlternateContentFallback=function(oVal){var oThis=this;var oCurVal=oVal.m_style;if(null!=oCurVal)this.bs.WriteItem(c_oseralternatecontentfallbackSTYLE,function(){oThis.WriteCT_Style1(oCurVal)})};function BinaryChartReader(stream){this.stream= stream;this.bcr=new AscCommon.Binary_CommonReader(this.stream);this.drawingDocument=null}BinaryChartReader.prototype.ReadCT_extLst=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_extlstEXT===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Extension(t,l,oNewVal)});if(null==val.m_ext)val.m_ext=[];val.m_ext.push(oNewVal)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ExternalReadCT_ChartSpace=function(length, val,curWorksheet){var res=c_oSerConstants.ReadOk;this.curWorksheet=curWorksheet;this.drawingDocument=null;if(this.curWorksheet)if(this.curWorksheet.getDrawingDocument)this.drawingDocument=this.curWorksheet.getDrawingDocument();else if(this.curWorksheet.DrawingDocument)this.drawingDocument=this.curWorksheet.DrawingDocument;var oThis=this;this.curChart=val;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartSpace(t,l,val)});if(val){if(null===val.date1904)val.setDate1904(false);if(null=== val.roundedCorners)val.setRoundedCorners(false)}return res};BinaryChartReader.prototype.ReadCT_ChartSpace=function(type,length,val,curWorksheet){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_chartspaceDATE1904===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDate1904(oNewVal.m_val);else val.setDate1904(true)}else if(c_oserct_chartspaceLANG===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_TextLanguageID(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setLang(oNewVal.m_val)}else if(c_oserct_chartspaceROUNDEDCORNERS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setRoundedCorners(oNewVal.m_val)}else if(c_oserct_chartspaceALTERNATECONTENT===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadAlternateContent(t,l,oNewVal)});var nNewStyle= null;if(null!=oNewVal.m_Choice&&oNewVal.m_Choice.length>0){var choice=oNewVal.m_Choice[0];if(null!=choice.m_style&&null!=choice.m_style.m_val)nNewStyle=choice.m_style.m_val-100}if(null==nNewStyle&&null!=oNewVal.m_Fallback&&null!=oNewVal.m_Fallback.m_style&&null!=oNewVal.m_Fallback.m_style.m_val)nNewStyle=oNewVal.m_Fallback.m_style.m_val;if(null!=nNewStyle)val.setStyle(nNewStyle)}else if(c_oserct_chartspaceSTYLE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Style1(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setStyle(oNewVal.m_val)}else if(c_oserct_chartspaceCLRMAPOVR===type)val.setClrMapOvr(this.ReadClrOverride(length));else if(c_oserct_chartspacePIVOTSOURCE===type){var oNewVal=new AscFormat.CPivotSource;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PivotSource(t,l,oNewVal)});val.setPivotSource(oNewVal)}else if(c_oserct_chartspacePROTECTION===type){var oNewVal=new AscFormat.CProtection;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Protection(t, l,oNewVal)});val.setProtection(oNewVal)}else if(c_oserct_chartspaceCHART===type){var oNewVal=new AscFormat.CChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Chart(t,l,oNewVal)});val.setChart(oNewVal);if(null===oNewVal.showDLblsOverMax)oNewVal.setShowDLblsOverMax(false)}else if(c_oserct_chartspaceSPPR===type){val.setSpPr(this.ReadSpPr(length));val.spPr.setParent(val)}else if(c_oserct_chartspaceTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_chartspacePRINTSETTINGS=== type){var oNewVal=new AscFormat.CPrintSettings;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PrintSettings(t,l,oNewVal)});val.setPrintSettings(oNewVal)}else if(c_oserct_chartspaceUSERSHAPES===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UserShapes(t,l,val)});else if(c_oserct_chartspaceEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else if(c_oserct_chartspaceTHEMEOVERRIDE===type){var theme=AscCommon.pptx_content_loader.ReadTheme(this, this.stream);if(null!=theme)val.setThemeOverride(theme);res=c_oSerConstants.ReadUnknown}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadSpPr=function(length){return AscCommon.pptx_content_loader.ReadShapeProperty(this.stream)};BinaryChartReader.prototype.ReadClrOverride=function(lenght){var loader=new AscCommon.BinaryPPTYLoader;loader.stream=new AscCommon.FileStream;loader.stream.obj=this.stream.obj;loader.stream.data=this.stream.data;loader.stream.size=this.stream.size; loader.stream.pos=this.stream.pos;loader.stream.cur=this.stream.cur;var s=loader.stream;var _main_type=s.GetUChar();var clr_map=new AscFormat.ClrMap;loader.ReadClrMap(clr_map);this.stream.pos=s.pos;this.stream.cur=s.cur;return clr_map};BinaryChartReader.prototype.ReadTxPr=function(length){var cur=this.stream.cur;var ret=AscCommon.pptx_content_loader.ReadTextBody(null,this.stream,null,this.curWorksheet,this.drawingDocument);this.stream.cur=cur+length;return ret};BinaryChartReader.prototype.ParsePersent= function(val){var nVal=parseFloat(val);if(!isNaN(nVal))return nVal;else return null};BinaryChartReader.prototype.ParseMetric=function(val){var nVal=parseFloat(val);var nRes=null;if(!isNaN(nVal))if(-1!=val.indexOf("mm"))nRes=nVal;else if(-1!=val.indexOf("cm"))nRes=nVal*10;else if(-1!=val.indexOf("in"))nRes=nVal*2.54*10;else if(-1!=val.indexOf("pt"))nRes=nVal*2.54*10/72;else if(-1!=val.indexOf("pc")||-1!=val.indexOf("pi"))nRes=nVal*12*2.54*10/72;return nRes};BinaryChartReader.prototype.ConvertSurfaceToLine= function(oSurface,aChartWithAxis){var oLine=new AscFormat.CLineChart;oLine.setGrouping(AscFormat.GROUPING_STANDARD);oLine.setVaryColors(false);for(var i=0,length=oSurface.series.length;i<length;++i){var surfaceSer=oSurface.series[i];var lineSer=new AscFormat.CLineSeries;if(null!=surfaceSer.idx)lineSer.setIdx(surfaceSer.idx);if(null!=surfaceSer.order)lineSer.setOrder(surfaceSer.order);if(null!=surfaceSer.tx)lineSer.setTx(surfaceSer.tx);if(null!=surfaceSer.spPr)lineSer.setSpPr(surfaceSer.spPr);if(null!= surfaceSer.cat)lineSer.setCat(surfaceSer.cat);if(null!=surfaceSer.val)lineSer.setVal(surfaceSer.val);var marker=new AscFormat.CMarker;marker.setSymbol(AscFormat.SYMBOL_NONE);lineSer.setMarker(marker);lineSer.setSmooth(false);oLine.addSer(lineSer)}var dLbls=new AscFormat.CDLbls;dLbls.setShowLegendKey(false);dLbls.setShowVal(false);dLbls.setShowCatName(false);dLbls.setShowSerName(false);dLbls.setShowPercent(false);dLbls.setShowBubbleSize(false);oLine.setDLbls(dLbls);oLine.setMarker(true);oLine.setSmooth(false); this.CorrectChartWithAxis(oSurface,oLine,aChartWithAxis);return oLine};BinaryChartReader.prototype.ConvertSurfaceValAxToLineValAx=function(oSurfaceValAx){oSurfaceValAx.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN);oSurfaceValAx.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO)};BinaryChartReader.prototype.ConvertRadarToLine=function(oRadar,aChartWithAxis){var bMarkerNull=RADAR_STYLE_FILLED==oRadar.radarStyle;var oLine=new AscFormat.CLineChart;oLine.setGrouping(AscFormat.GROUPING_STANDARD); if(null!=oRadar.varyColors)oLine.setVaryColors(oRadar.varyColors);if(null!=oRadar.dLbls)oLine.setDLbls(oRadar.dLbls);for(var i=0,length=oRadar.series.length;i<length;++i){var radarSer=oRadar.series[i];var lineSer=new AscFormat.CLineSeries;if(null!=radarSer.idx)lineSer.setIdx(radarSer.idx);if(null!=radarSer.order)lineSer.setOrder(radarSer.order);if(null!=radarSer.tx)lineSer.setTx(radarSer.tx);if(null!=radarSer.spPr)lineSer.setSpPr(radarSer.spPr);if(null!=radarSer.marker)lineSer.setMarker(radarSer.marker); else if(bMarkerNull){var marker=new AscFormat.CMarker;marker.setSymbol(AscFormat.SYMBOL_NONE);lineSer.setMarker(marker)}for(var j=0,length2=radarSer.dPt.length;j<length2;++j)lineSer.addDPt(radarSer.dPt[j]);if(null!=radarSer.dLbls)lineSer.setDLbls(radarSer.dLbls);if(null!=radarSer.cat)lineSer.setCat(radarSer.cat);if(null!=radarSer.val)lineSer.setVal(radarSer.val);lineSer.setSmooth(false);oLine.addSer(lineSer)}oLine.setMarker(true);oLine.setSmooth(false);this.CorrectChartWithAxis(oRadar,oLine,aChartWithAxis); return oLine};BinaryChartReader.prototype.ConvertBubbleToScatter=function(oBubble,aChartWithAxis){var oScatter=new AscFormat.CScatterChart;oScatter.setScatterStyle(AscFormat.SCATTER_STYLE_LINE_MARKER);if(null!=oBubble.varyColors)oScatter.setVaryColors(oBubble.varyColors);if(null!=oBubble.dLbls)oScatter.setDLbls(oBubble.dLbls);for(var i=0,length=oBubble.series.length;i<length;++i){var bubbleSer=oBubble.series[i];var scatterSer=new AscFormat.CScatterSeries;if(null!=bubbleSer.idx)scatterSer.setIdx(bubbleSer.idx); if(null!=bubbleSer.order)scatterSer.setOrder(bubbleSer.order);if(null!=bubbleSer.tx)scatterSer.setTx(bubbleSer.tx);for(var j=0,length2=bubbleSer.dPt.length;j<length2;++j)scatterSer.addDPt(bubbleSer.dPt[j]);if(null!=bubbleSer.dLbls)scatterSer.setDLbls(bubbleSer.dLbls);if(null!=bubbleSer.trendline)scatterSer.setTrendline(bubbleSer.trendline);if(null!=bubbleSer.errBars)scatterSer.setErrBars(bubbleSer.errBars);if(null!=bubbleSer.xVal)scatterSer.setXVal(bubbleSer.xVal);if(null!=bubbleSer.yVal)scatterSer.setYVal(bubbleSer.yVal); var spPr=new AscFormat.CSpPr;var ln=new AscFormat.CLn;ln.setW(28575);var uni_fill=new AscFormat.CUniFill;uni_fill.setFill(new AscFormat.CNoFill);ln.setFill(uni_fill);spPr.setLn(ln);scatterSer.setSpPr(spPr);scatterSer.setSmooth(false);oScatter.addSer(scatterSer)}this.CorrectChartWithAxis(oBubble,oScatter,aChartWithAxis);return oScatter};BinaryChartReader.prototype.ConvertOfPieToPie=function(oOfPie,aChartWithAxis){var oPie=new AscFormat.CPieChart;if(null!=oOfPie.varyColors)oPie.setVaryColors(oOfPie.varyColors); if(null!=oOfPie.dLbls)oPie.setDLbls(oOfPie.dLbls);for(var i=0,length=oOfPie.series.length;i<length;++i)oPie.addSer(oOfPie.series[i]);oPie.setFirstSliceAng(0);this.CorrectChartWithAxis(oOfPie,oPie,aChartWithAxis);return oPie};BinaryChartReader.prototype.CorrectChartWithAxis=function(chartOld,chartNew,aChartWithAxis){for(var i=0,length=aChartWithAxis.length;i<length;++i){var item=aChartWithAxis[i];if(item.chart==chartOld)item.chart=chartNew}};BinaryChartReader.prototype.ReadCT_Boolean=function(type, length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_booleanVAL===type){var oNewVal;oNewVal=this.stream.GetBool();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ExternalReadCT_RelId=function(length,val){var res=c_oSerConstants.ReadOk;var oThis=this;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_RelId(t,l,val)});return res};BinaryChartReader.prototype.ReadCT_RelId=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_relidID===type){var oNewVal;oNewVal=this.stream.GetString2LE(length);val.m_id=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_UserShapes=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;var nCount;if(c_oserct_usershapes_COUNT===type)nCount=this.stream.GetULongLE();else if(c_oserct_usershapes_SHAPE_REL){var oNewVal=new AscFormat.CRelSizeAnchor;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_userShape(t, l,oNewVal)});val.addUserShape(undefined,oNewVal)}else if(c_oserct_usershapes_SHAPE_ABS){var oNewVal=new AscFormat.CAbsSizeAnchor;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_userShape(t,l,oNewVal)});val.addUserShape(undefined,oNewVal)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_FromTo=function(type,length,poResult){var res=c_oSerConstants.ReadOk;if(Asc.c_oSer_DrawingPosType.X==type)poResult.x=this.stream.GetDoubleLE();else if(Asc.c_oSer_DrawingPosType.Y== type)poResult.y=this.stream.GetDoubleLE();else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_userShape=function(type,length,poResult){var oThis=this;var res=c_oSerConstants.ReadOk;if(Asc.c_oSer_DrawingType.From==type){var oNewVal={};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadCT_FromTo(t,l,oNewVal)});poResult.setFromTo(oNewVal.x,oNewVal.y,poResult.toX,poResult.toY)}else if(Asc.c_oSer_DrawingType.To==type){var oNewVal={};res=this.bcr.Read2Spreadsheet(length, function(t,l){return oThis.ReadCT_FromTo(t,l,oNewVal)});poResult.setFromTo(poResult.fromX,poResult.fromY,oNewVal.x,oNewVal.y)}else if(Asc.c_oSer_DrawingType.Ext==type){var oNewVal={};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadCT_FromTo(t,l,oNewVal)});poResult.setFromTo(poResult.fromX,poResult.fromY,oNewVal.x,oNewVal.y)}else if(Asc.c_oSer_DrawingType.pptxDrawing==type){var oGraphicObject=AscCommon.pptx_content_loader.ReadGraphicObject(this.stream,this.curWorksheet,this.drawingDocument); poResult.setObject(oGraphicObject)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PageSetup=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pagesetupPAPERSIZE===type)val.setPaperSize(this.stream.GetULongLE());else if(c_oserct_pagesetupPAPERHEIGHT===type){var mm=this.ParseMetric(this.stream.GetString2LE(length));if(null!=mm)val.setPaperHeight(mm)}else if(c_oserct_pagesetupPAPERWIDTH===type){var mm=this.ParseMetric(this.stream.GetString2LE(length)); if(null!=mm)val.setPaperWidth(mm)}else if(c_oserct_pagesetupFIRSTPAGENUMBER===type)val.setFirstPageNumber(this.stream.GetULongLE());else if(c_oserct_pagesetupORIENTATION===type)switch(this.stream.GetUChar()){case st_pagesetuporientationDEFAULT:val.setOrientation(AscFormat.PAGE_SETUP_ORIENTATION_DEFAULT);break;case st_pagesetuporientationPORTRAIT:val.setOrientation(AscFormat.PAGE_SETUP_ORIENTATION_PORTRAIT);break;case st_pagesetuporientationLANDSCAPE:val.setOrientation(AscFormat.PAGE_SETUP_ORIENTATION_LANDSCAPE); break}else if(c_oserct_pagesetupBLACKANDWHITE===type)val.setBlackAndWhite(this.stream.GetBool());else if(c_oserct_pagesetupDRAFT===type)val.setBlackAndWhite(this.stream.GetBool());else if(c_oserct_pagesetupUSEFIRSTPAGENUMBER===type)val.setUseFirstPageNumb(this.stream.GetBool());else if(c_oserct_pagesetupHORIZONTALDPI===type)val.setHorizontalDpi(this.stream.GetULongLE());else if(c_oserct_pagesetupVERTICALDPI===type)val.setVerticalDpi(this.stream.GetULongLE());else if(c_oserct_pagesetupCOPIES===type)val.setCopies(this.stream.GetULongLE()); else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PageMargins=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pagemarginsL===type)val.setL(this.stream.GetDoubleLE());else if(c_oserct_pagemarginsR===type)val.setR(this.stream.GetDoubleLE());else if(c_oserct_pagemarginsT===type)val.setT(this.stream.GetDoubleLE());else if(c_oserct_pagemarginsB===type)val.setB(this.stream.GetDoubleLE());else if(c_oserct_pagemarginsHEADER===type)val.setHeader(this.stream.GetDoubleLE()); else if(c_oserct_pagemarginsFOOTER===type)val.setFooter(this.stream.GetDoubleLE());else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_HeaderFooter=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_headerfooterODDHEADER===type)val.setOddHeader(this.stream.GetString2LE(length));else if(c_oserct_headerfooterODDFOOTER===type)val.setOddFooter(this.stream.GetString2LE(length));else if(c_oserct_headerfooterEVENHEADER===type)val.setEvenHeader(this.stream.GetString2LE(length)); else if(c_oserct_headerfooterEVENFOOTER===type)val.setEvenFooter(this.stream.GetString2LE(length));else if(c_oserct_headerfooterFIRSTHEADER===type)val.setFirstHeader(this.stream.GetString2LE(length));else if(c_oserct_headerfooterFIRSTFOOTER===type)val.setFirstFooter(this.stream.GetString2LE(length));else if(c_oserct_headerfooterALIGNWITHMARGINS===type)val.setAlignWithMargins(this.stream.GetBool());else if(c_oserct_headerfooterDIFFERENTODDEVEN===type)val.setDifferentOddEven(this.stream.GetBool()); else if(c_oserct_headerfooterDIFFERENTFIRST===type)val.setDifferentFirst(this.stream.GetBool());else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PrintSettings=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_printsettingsHEADERFOOTER===type){var oNewVal=new AscFormat.CHeaderFooterChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_HeaderFooter(t,l,oNewVal)});val.setHeaderFooter(oNewVal)}else if(c_oserct_printsettingsPAGEMARGINS=== type){var oNewVal=new AscFormat.CPageMarginsChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PageMargins(t,l,oNewVal)});val.setPageMargins(oNewVal)}else if(c_oserct_printsettingsPAGESETUP===type){var oNewVal=new AscFormat.CPageSetup;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PageSetup(t,l,oNewVal)});val.setPageSetup(oNewVal)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ExternalData=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_externaldataAUTOUPDATE===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});val.m_autoUpdate=oNewVal}else if(c_oserct_externaldataID===type){var oNewVal;oNewVal=this.stream.GetString2LE(length);val.m_id=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_DispBlanksAs=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_dispblanksasVAL===type)switch(this.stream.GetUChar()){case st_dispblanksasSPAN:val.m_val= AscFormat.DISP_BLANKS_AS_SPAN;break;case st_dispblanksasGAP:val.m_val=AscFormat.DISP_BLANKS_AS_GAP;break;case st_dispblanksasZERO:val.m_val=AscFormat.DISP_BLANKS_AS_ZERO;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LegendEntry=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_legendentryIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_legendentryDELETE=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDelete(oNewVal.m_val);else val.setDelete(true)}else if(c_oserct_legendentryTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_legendentryEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_UnsignedInt= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_unsignedintVAL===type){var oNewVal;oNewVal=this.stream.GetULongLE();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Extension=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_extensionANY===type){var oNewVal;oNewVal=this.stream.GetString2LE(length);val.m_Any=oNewVal}else if(c_oserct_extensionURI===type){var oNewVal;oNewVal=this.stream.GetString2LE(length); val.m_uri=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LegendPos=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_legendposVAL===type)switch(this.stream.GetUChar()){case st_legendposB:val.m_val=c_oAscChartLegendShowSettings.bottom;break;case st_legendposTR:val.m_val=c_oAscChartLegendShowSettings.topRight;break;case st_legendposL:val.m_val=c_oAscChartLegendShowSettings.left;break;case st_legendposR:val.m_val=c_oAscChartLegendShowSettings.right; break;case st_legendposT:val.m_val=c_oAscChartLegendShowSettings.top;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Legend=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_legendLEGENDPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LegendPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setLegendPos(oNewVal.m_val)}else if(c_oserct_legendLEGENDENTRY===type){var oNewVal=new AscFormat.CLegendEntry; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LegendEntry(t,l,oNewVal)});val.addLegendEntry(oNewVal)}else if(c_oserct_legendLAYOUT===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Layout(t,l,val)});else if(c_oserct_legendOVERLAY===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOverlay(oNewVal.m_val)}else if(c_oserct_legendSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_legendTXPR=== type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_legendEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Layout=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_layoutMANUALLAYOUT===type){var oNewVal=new AscFormat.CLayout;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ManualLayout(t, l,oNewVal)});val.setLayout(oNewVal)}else if(c_oserct_layoutEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ManualLayout=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_manuallayoutLAYOUTTARGET===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LayoutTarget(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setLayoutTarget(oNewVal.m_val)}else if(c_oserct_manuallayoutXMODE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LayoutMode(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setXMode(oNewVal.m_val)}else if(c_oserct_manuallayoutYMODE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LayoutMode(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setYMode(oNewVal.m_val)}else if(c_oserct_manuallayoutWMODE=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LayoutMode(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setWMode(oNewVal.m_val)}else if(c_oserct_manuallayoutHMODE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LayoutMode(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setHMode(oNewVal.m_val)}else if(c_oserct_manuallayoutX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setX(oNewVal.m_val)}else if(c_oserct_manuallayoutY===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setY(oNewVal.m_val)}else if(c_oserct_manuallayoutW===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setW(oNewVal.m_val)}else if(c_oserct_manuallayoutH===type){var oNewVal={m_val:null}; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setH(oNewVal.m_val)}else if(c_oserct_manuallayoutEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LayoutTarget=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_layouttargetVAL===type)switch(this.stream.GetUChar()){case st_layouttargetINNER:val.m_val= LAYOUT_TARGET_INNER;break;case st_layouttargetOUTER:val.m_val=LAYOUT_TARGET_OUTER;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LayoutMode=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_layoutmodeVAL===type)switch(this.stream.GetUChar()){case st_layoutmodeEDGE:val.m_val=LAYOUT_MODE_EDGE;break;case st_layoutmodeFACTOR:val.m_val=LAYOUT_MODE_FACTOR;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Double= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_doubleVAL===type){var oNewVal;oNewVal=this.stream.GetDoubleLE();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_DTable=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_dtableSHOWHORZBORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowHorzBorder(oNewVal.m_val)}else if(c_oserct_dtableSHOWVERTBORDER=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowVertBorder(oNewVal.m_val)}else if(c_oserct_dtableSHOWOUTLINE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowOutline(oNewVal.m_val)}else if(c_oserct_dtableSHOWKEYS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setShowKeys(oNewVal.m_val)}else if(c_oserct_dtableSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_dtableTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_dtableEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_SerAx=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_seraxAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAxId(oNewVal.m_val)}else if(c_oserct_seraxSCALING===type){var oNewVal=new AscFormat.CScaling;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Scaling(t,l,oNewVal)});val.setScaling(oNewVal)}else if(c_oserct_seraxDELETE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setDelete(oNewVal.m_val);else val.setDelete(true)}else if(c_oserct_seraxAXPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAxPos(oNewVal.m_val)}else if(c_oserct_seraxMAJORGRIDLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setMajorGridlines(oNewVal.spPr);else val.setMajorGridlines(new AscFormat.CSpPr)}else if(c_oserct_seraxMINORGRIDLINES=== type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setMinorGridlines(oNewVal.spPr);else val.setMinorGridlines(new AscFormat.CSpPr)}else if(c_oserct_seraxTITLE===type){var oNewVal=new AscFormat.CTitle;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Title(t,l,oNewVal)});if(!AscFormat.isRealBool(oNewVal.overlay))oNewVal.setOverlay(false);val.setTitle(oNewVal)}else if(c_oserct_seraxNUMFMT===type){var oNewVal= new AscFormat.CNumFmt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumFmt(t,l,oNewVal)});val.setNumFmt(oNewVal)}else if(c_oserct_seraxMAJORTICKMARK===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickMark(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMajorTickMark(oNewVal.m_val);else val.setMajorTickMark(c_oAscTickMark.TICK_MARK_CROSS)}else if(c_oserct_seraxMINORTICKMARK===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t, l){return oThis.ReadCT_TickMark(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMinorTickMark(oNewVal.m_val);else val.setMajorTickMark(c_oAscTickMark.TICK_MARK_CROSS)}else if(c_oserct_seraxTICKLBLPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickLblPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setTickLblPos(oNewVal.m_val)}else if(c_oserct_seraxSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_seraxTXPR===type){val.setTxPr(this.ReadTxPr(length)); val.txPr.setParent(val)}else if(c_oserct_seraxCROSSAX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.crossAxId=oNewVal.m_val}else if(c_oserct_seraxCROSSES===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Crosses(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setCrosses(oNewVal.m_val)}else if(c_oserct_seraxCROSSESAT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setCrossesAt(oNewVal.m_val)}else if(c_oserct_seraxTICKLBLSKIP===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Skip(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setTickLblSkip(oNewVal.m_val)}else if(c_oserct_seraxTICKMARKSKIP===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Skip(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setTickMarkSkip(oNewVal.m_val)}else if(c_oserct_seraxEXTLST=== type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Scaling=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_scalingLOGBASE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LogBase(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setLogBase(oNewVal.m_val)}else if(c_oserct_scalingORIENTATION=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Orientation(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOrientation(oNewVal.m_val)}else if(c_oserct_scalingMAX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMax(oNewVal.m_val)}else if(c_oserct_scalingMIN===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setMin(oNewVal.m_val)}else if(c_oserct_scalingEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LogBase=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_logbaseVAL===type){var oNewVal;oNewVal=this.stream.GetDoubleLE();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res}; BinaryChartReader.prototype.ReadCT_Orientation=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_orientationVAL===type)switch(this.stream.GetUChar()){case st_orientationMAXMIN:val.m_val=AscFormat.ORIENTATION_MAX_MIN;break;case st_orientationMINMAX:val.m_val=AscFormat.ORIENTATION_MIN_MAX;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_AxPos=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_axposVAL=== type)switch(this.stream.GetUChar()){case st_axposB:val.m_val=AscFormat.AX_POS_B;break;case st_axposL:val.m_val=AscFormat.AX_POS_L;break;case st_axposR:val.m_val=AscFormat.AX_POS_R;break;case st_axposT:val.m_val=AscFormat.AX_POS_T;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ChartLines=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_chartlinesSPPR===type)val.spPr=this.ReadSpPr(length);else res=c_oSerConstants.ReadUnknown; return res};BinaryChartReader.prototype.ReadCT_Title=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_titleTX===type){var oNewVal=new AscFormat.CChartText;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Tx(t,l,oNewVal)});oNewVal.setChart(this.curChart);val.setTx(oNewVal)}else if(c_oserct_titleLAYOUT===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Layout(t,l,val)});else if(c_oserct_titleOVERLAY===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOverlay(oNewVal.m_val)}else if(c_oserct_titleSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_titleTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_titleEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Tx= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_txRICH===type){val.setRich(this.ReadTxPr(length));val.rich.setParent(val)}else if(c_oserct_txSTRREF===type){var oNewVal=new AscFormat.CStrRef;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_StrRef(t,l,oNewVal)});val.setStrRef(oNewVal)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_StrRef=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_strrefF=== type)val.setF(this.stream.GetString2LE(length));else if(c_oserct_strrefSTRCACHE===type){var oNewVal=new AscFormat.CStrCache;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_StrData(t,l,oNewVal)});val.setStrCache(oNewVal)}else if(c_oserct_strrefEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_StrData=function(type,length,val){var res= c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_strdataPTCOUNT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setPtCount(oNewVal.m_val)}else if(c_oserct_strdataPT===type){var oNewVal=new AscFormat.CStringPoint;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_StrVal(t,l,oNewVal)});val.addPt(oNewVal)}else if(c_oserct_strdataEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_StrVal=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_strvalV===type)val.setVal(this.stream.GetString2LE(length));else if(c_oserct_strvalIDX===type)val.setIdx(this.stream.GetULongLE());else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_NumFmt=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_numfmtFORMATCODE===type)val.setFormatCode(this.stream.GetString2LE(length));else if(c_oserct_numfmtSOURCELINKED===type)val.setSourceLinked(this.stream.GetBool());else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_TickMark=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_tickmarkVAL===type)switch(this.stream.GetUChar()){case st_tickmarkCROSS:val.m_val=c_oAscTickMark.TICK_MARK_CROSS;break;case st_tickmarkIN:val.m_val= c_oAscTickMark.TICK_MARK_IN;break;case st_tickmarkNONE:val.m_val=c_oAscTickMark.TICK_MARK_NONE;break;case st_tickmarkOUT:val.m_val=c_oAscTickMark.TICK_MARK_OUT;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_TickLblPos=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_ticklblposVAL===type)switch(this.stream.GetUChar()){case st_ticklblposHIGH:val.m_val=c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH;break;case st_ticklblposLOW:val.m_val= c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW;break;case st_ticklblposNEXTTO:val.m_val=c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO;break;case st_ticklblposNONE:val.m_val=c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Crosses=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_crossesVAL===type)switch(this.stream.GetUChar()){case st_crossesAUTOZERO:val.m_val=AscFormat.CROSSES_AUTO_ZERO; break;case st_crossesMAX:val.m_val=AscFormat.CROSSES_MAX;break;case st_crossesMIN:val.m_val=AscFormat.CROSSES_MIN;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Skip=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_skipVAL===type){var oNewVal;oNewVal=this.stream.GetULongLE();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_TimeUnit=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_timeunitVAL===type)switch(this.stream.GetUChar()){case st_timeunitDAYS:val.m_val=AscFormat.TIME_UNIT_DAYS;break;case st_timeunitMONTHS:val.m_val=AscFormat.TIME_UNIT_MONTHS;break;case st_timeunitYEARS:val.m_val=AscFormat.TIME_UNIT_YEARS;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_DateAx=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_dateaxAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAxId(oNewVal.m_val)}else if(c_oserct_dateaxSCALING===type){var oNewVal=new AscFormat.CScaling;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Scaling(t,l,oNewVal)});val.setScaling(oNewVal)}else if(c_oserct_dateaxDELETE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDelete(oNewVal.m_val);else val.setDelete(true)}else if(c_oserct_dateaxAXPOS=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAxPos(oNewVal.m_val)}else if(c_oserct_dateaxMAJORGRIDLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setMajorGridlines(oNewVal.spPr);else val.setMajorGridlines(new AscFormat.CSpPr)}else if(c_oserct_dateaxMINORGRIDLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setMinorGridlines(oNewVal.spPr);else val.setMinorGridlines(new AscFormat.CSpPr)}else if(c_oserct_dateaxTITLE===type){var oNewVal=new AscFormat.CTitle;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Title(t,l,oNewVal)});if(!AscFormat.isRealBool(oNewVal.overlay))oNewVal.setOverlay(false);val.setTitle(oNewVal)}else if(c_oserct_dateaxNUMFMT===type){var oNewVal=new AscFormat.CNumFmt;res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_NumFmt(t,l,oNewVal)});val.setNumFmt(oNewVal)}else if(c_oserct_dateaxMAJORTICKMARK===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickMark(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMajorTickMark(oNewVal.m_val);else val.setMajorTickMark(c_oAscTickMark.TICK_MARK_CROSS)}else if(c_oserct_dateaxMINORTICKMARK===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickMark(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setMinorTickMark(oNewVal.m_val);else val.setMajorTickMark(c_oAscTickMark.TICK_MARK_CROSS)}else if(c_oserct_dateaxTICKLBLPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickLblPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setTickLblPos(oNewVal.m_val)}else if(c_oserct_dateaxSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_dateaxTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_dateaxCROSSAX=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.crossAxId=oNewVal.m_val}else if(c_oserct_dateaxCROSSES===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Crosses(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setCrosses(oNewVal.m_val)}else if(c_oserct_dateaxCROSSESAT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setCrossesAt(oNewVal.m_val)}else if(c_oserct_dateaxAUTO===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAuto(oNewVal.m_val)}else if(c_oserct_dateaxLBLOFFSET===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LblOffset(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setLblOffset(oNewVal.m_val)}else if(c_oserct_dateaxBASETIMEUNIT=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TimeUnit(t,l,oNewVal)})}else if(c_oserct_dateaxMAJORUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxisUnit(t,l,oNewVal)})}else if(c_oserct_dateaxMAJORTIMEUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TimeUnit(t,l,oNewVal)})}else if(c_oserct_dateaxMINORUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_AxisUnit(t,l,oNewVal)})}else if(c_oserct_dateaxMINORTIMEUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TimeUnit(t,l,oNewVal)})}else if(c_oserct_dateaxEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LblOffset=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_lbloffsetVAL===type)val.m_val=this.ParsePersent(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_AxisUnit=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_axisunitVAL===type){var oNewVal;oNewVal=this.stream.GetDoubleLE();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LblAlgn=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_lblalgnVAL===type)switch(this.stream.GetUChar()){case st_lblalgnCTR:val.m_val=AscFormat.LBL_ALG_CTR;break;case st_lblalgnL:val.m_val=AscFormat.LBL_ALG_L;break;case st_lblalgnR:val.m_val=AscFormat.LBL_ALG_R;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_CatAx=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_cataxAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setAxId(oNewVal.m_val)}else if(c_oserct_cataxSCALING===type){var oNewVal=new AscFormat.CScaling;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Scaling(t,l,oNewVal)});val.setScaling(oNewVal)}else if(c_oserct_cataxDELETE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDelete(oNewVal.m_val);else val.setDelete(true)}else if(c_oserct_cataxAXPOS===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAxPos(oNewVal.m_val)}else if(c_oserct_cataxMAJORGRIDLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setMajorGridlines(oNewVal.spPr);else val.setMajorGridlines(new AscFormat.CSpPr)}else if(c_oserct_cataxMINORGRIDLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setMinorGridlines(oNewVal.spPr);else val.setMinorGridlines(new AscFormat.CSpPr)}else if(c_oserct_cataxTITLE===type){var oNewVal=new AscFormat.CTitle;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Title(t,l,oNewVal)});if(!AscFormat.isRealBool(oNewVal.overlay))oNewVal.setOverlay(true);val.setTitle(oNewVal)}else if(c_oserct_cataxNUMFMT===type){var oNewVal=new AscFormat.CNumFmt;res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_NumFmt(t,l,oNewVal)});val.setNumFmt(oNewVal)}else if(c_oserct_cataxMAJORTICKMARK===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickMark(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMajorTickMark(oNewVal.m_val);else val.setMajorTickMark(c_oAscTickMark.TICK_MARK_CROSS)}else if(c_oserct_cataxMINORTICKMARK===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickMark(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setMinorTickMark(oNewVal.m_val);else val.setMajorTickMark(c_oAscTickMark.TICK_MARK_CROSS)}else if(c_oserct_cataxTICKLBLPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickLblPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setTickLblPos(oNewVal.m_val)}else if(c_oserct_cataxSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_cataxTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_cataxCROSSAX=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.crossAxId=oNewVal.m_val}else if(c_oserct_cataxCROSSES===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Crosses(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setCrosses(oNewVal.m_val)}else if(c_oserct_cataxCROSSESAT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setCrossesAt(oNewVal.m_val)}else if(c_oserct_cataxAUTO===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAuto(oNewVal.m_val)}else if(c_oserct_cataxLBLALGN===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LblAlgn(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setLblAlgn(oNewVal.m_val)}else if(c_oserct_cataxLBLOFFSET===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LblOffset(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setLblOffset(oNewVal.m_val)}else if(c_oserct_cataxTICKLBLSKIP===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Skip(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setTickLblSkip(oNewVal.m_val)}else if(c_oserct_cataxTICKMARKSKIP===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Skip(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setTickMarkSkip(oNewVal.m_val)}else if(c_oserct_cataxNOMULTILVLLBL===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setNoMultiLvlLbl(oNewVal.m_val)}else if(c_oserct_cataxEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_DispUnitsLbl= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_dispunitslblLAYOUT===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Layout(t,l,val)});else if(c_oserct_dispunitslblTX===type){var oNewVal=new AscFormat.CChartText;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Tx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_dispunitslblSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_dispunitslblTXPR===type){val.setTxPr(this.ReadTxPr(length)); val.txPr.setParent(val)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_BuiltInUnit=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_builtinunitVAL===type)switch(this.stream.GetUChar()){case st_builtinunitHUNDREDS:val.m_val=c_oAscValAxUnits.HUNDREDS;break;case st_builtinunitTHOUSANDS:val.m_val=c_oAscValAxUnits.THOUSANDS;break;case st_builtinunitTENTHOUSANDS:val.m_val=c_oAscValAxUnits.TEN_THOUSANDS;break;case st_builtinunitHUNDREDTHOUSANDS:val.m_val= c_oAscValAxUnits.HUNDRED_THOUSANDS;break;case st_builtinunitMILLIONS:val.m_val=c_oAscValAxUnits.MILLIONS;break;case st_builtinunitTENMILLIONS:val.m_val=c_oAscValAxUnits.TEN_MILLIONS;break;case st_builtinunitHUNDREDMILLIONS:val.m_val=c_oAscValAxUnits.HUNDRED_MILLIONS;break;case st_builtinunitBILLIONS:val.m_val=c_oAscValAxUnits.BILLIONS;break;case st_builtinunitTRILLIONS:val.m_val=c_oAscValAxUnits.TRILLIONS;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_DispUnits= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_dispunitsBUILTINUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BuiltInUnit(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setBuiltInUnit(oNewVal.m_val)}else if(c_oserct_dispunitsCUSTUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setCustUnit(oNewVal.m_val)}else if(c_oserct_dispunitsDISPUNITSLBL=== type){var oNewVal=new AscFormat.CDLbl;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DispUnitsLbl(t,l,oNewVal)});val.setDispUnitsLbl(oNewVal)}else if(c_oserct_dispunitsEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_CrossBetween=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_crossbetweenVAL===type)switch(this.stream.GetUChar()){case st_crossbetweenBETWEEN:val.m_val= AscFormat.CROSS_BETWEEN_BETWEEN;break;case st_crossbetweenMIDCAT:val.m_val=AscFormat.CROSS_BETWEEN_MID_CAT;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ValAx=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_valaxAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAxId(oNewVal.m_val)}else if(c_oserct_valaxSCALING===type){var oNewVal= new AscFormat.CScaling;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Scaling(t,l,oNewVal)});val.setScaling(oNewVal)}else if(c_oserct_valaxDELETE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDelete(oNewVal.m_val);else val.setDelete(true)}else if(c_oserct_valaxAXPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxPos(t,l,oNewVal)});if(null!= oNewVal.m_val)val.setAxPos(oNewVal.m_val)}else if(c_oserct_valaxMAJORGRIDLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setMajorGridlines(oNewVal.spPr);else val.setMajorGridlines(new AscFormat.CSpPr)}else if(c_oserct_valaxMINORGRIDLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setMinorGridlines(oNewVal.spPr); else val.setMinorGridlines(new AscFormat.CSpPr)}else if(c_oserct_valaxTITLE===type){var oNewVal=new AscFormat.CTitle;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Title(t,l,oNewVal)});if(!AscFormat.isRealBool(oNewVal.overlay))oNewVal.setOverlay(true);val.setTitle(oNewVal)}else if(c_oserct_valaxNUMFMT===type){var oNewVal=new AscFormat.CNumFmt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumFmt(t,l,oNewVal)});val.setNumFmt(oNewVal)}else if(c_oserct_valaxMAJORTICKMARK=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickMark(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMajorTickMark(oNewVal.m_val);else val.setMajorTickMark(c_oAscTickMark.TICK_MARK_CROSS)}else if(c_oserct_valaxMINORTICKMARK===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickMark(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMinorTickMark(oNewVal.m_val);else val.setMajorTickMark(c_oAscTickMark.TICK_MARK_CROSS)}else if(c_oserct_valaxTICKLBLPOS=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TickLblPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setTickLblPos(oNewVal.m_val)}else if(c_oserct_valaxSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_valaxTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_valaxCROSSAX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.crossAxId= oNewVal.m_val}else if(c_oserct_valaxCROSSES===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Crosses(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setCrosses(oNewVal.m_val);else val.setCrosses(AscFormat.CROSSES_AUTO_ZERO)}else if(c_oserct_valaxCROSSESAT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setCrossesAt(oNewVal.m_val)}else if(c_oserct_valaxCROSSBETWEEN=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_CrossBetween(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setCrossBetween(oNewVal.m_val)}else if(c_oserct_valaxMAJORUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxisUnit(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMajorUnit(oNewVal.m_val)}else if(c_oserct_valaxMINORUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxisUnit(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setMinorUnit(oNewVal.m_val)}else if(c_oserct_valaxDISPUNITS===type){var oNewVal=new AscFormat.CDispUnits;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DispUnits(t,l,oNewVal)});val.setDispUnits(oNewVal)}else if(c_oserct_valaxEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_SizeRepresents=function(type, length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_sizerepresentsVAL===type)switch(this.stream.GetUChar()){case st_sizerepresentsAREA:val.m_val=SIZE_REPRESENTS_AREA;break;case st_sizerepresentsW:val.m_val=SIZE_REPRESENTS_W;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_BubbleScale=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_bubblescaleVAL===type)val.m_val=this.ParsePersent(this.stream.GetString2LE(length)); else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_BubbleSer=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_bubbleserIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_bubbleserORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l, oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_bubbleserTX===type){var oNewVal=new AscFormat.CTx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerTx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_bubbleserSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_bubbleserINVERTIFNEGATIVE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setInvertIfNegative(oNewVal.m_val)}else if(c_oserct_bubbleserDPT=== type){var oNewVal=new AscFormat.CDPt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DPt(t,l,oNewVal)});val.addDPt(oNewVal)}else if(c_oserct_bubbleserDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_bubbleserTRENDLINE===type){var oNewVal=new AscFormat.CTrendLine;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Trendline(t,l,oNewVal)}); val.setTrendline(oNewVal)}else if(c_oserct_bubbleserERRBARS===type){var oNewVal=new AscFormat.CErrBars;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ErrBars(t,l,oNewVal)});val.setErrBars(oNewVal)}else if(c_oserct_bubbleserXVAL===type){var oNewVal=new AscFormat.CCat;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxDataSource(t,l,oNewVal)});val.setXVal(oNewVal)}else if(c_oserct_bubbleserYVAL===type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t, l,oNewVal)});val.setYVal(oNewVal)}else if(c_oserct_bubbleserBUBBLESIZE===type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t,l,oNewVal)});val.setBubbleSize(oNewVal)}else if(c_oserct_bubbleserBUBBLE3D===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setBubble3D(oNewVal.m_val)}else if(c_oserct_bubbleserEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_SerTx=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_sertxSTRREF===type){var oNewVal=new AscFormat.CStrRef;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_StrRef(t,l,oNewVal)});val.setStrRef(oNewVal)}else if(c_oserct_sertxV===type)val.setVal(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown; return res};BinaryChartReader.prototype.ReadCT_DPt=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_dptIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_dptINVERTIFNEGATIVE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setInvertIfNegative(oNewVal.m_val)}else if(c_oserct_dptMARKER=== type){var oNewVal=new AscFormat.CMarker;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Marker(t,l,oNewVal)});val.setMarker(oNewVal)}else if(c_oserct_dptBUBBLE3D===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setBubble3D(oNewVal.m_val)}else if(c_oserct_dptEXPLOSION===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!= oNewVal.m_val)val.setExplosion(oNewVal.m_val)}else if(c_oserct_dptSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_dptPICTUREOPTIONS===type){var oNewVal=new AscFormat.CPictureOptions;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PictureOptions(t,l,oNewVal)});val.setPictureOptions(oNewVal)}else if(c_oserct_dptEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res}; BinaryChartReader.prototype.ReadCT_Marker=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_markerSYMBOL===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_MarkerStyle(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSymbol(oNewVal.m_val)}else if(c_oserct_markerSIZE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_MarkerSize(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSize(oNewVal.m_val)}else if(c_oserct_markerSPPR=== type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_markerEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_MarkerStyle=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_markerstyleVAL===type)switch(this.stream.GetUChar()){case st_markerstyleCIRCLE:val.m_val=AscFormat.SYMBOL_CIRCLE;break;case st_markerstyleDASH:val.m_val= AscFormat.SYMBOL_DASH;break;case st_markerstyleDIAMOND:val.m_val=AscFormat.SYMBOL_DIAMOND;break;case st_markerstyleDOT:val.m_val=AscFormat.SYMBOL_DOT;break;case st_markerstyleNONE:val.m_val=AscFormat.SYMBOL_NONE;break;case st_markerstylePICTURE:val.m_val=AscFormat.SYMBOL_PICTURE;break;case st_markerstylePLUS:val.m_val=AscFormat.SYMBOL_PLUS;break;case st_markerstyleSQUARE:val.m_val=AscFormat.SYMBOL_SQUARE;break;case st_markerstyleSTAR:val.m_val=AscFormat.SYMBOL_STAR;break;case st_markerstyleTRIANGLE:val.m_val= AscFormat.SYMBOL_TRIANGLE;break;case st_markerstyleX:val.m_val=AscFormat.SYMBOL_X;break;case st_markerstyleAUTO:break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_MarkerSize=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_markersizeVAL===type){var oNewVal;oNewVal=this.stream.GetUChar();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PictureOptions=function(type,length,val){var res= c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pictureoptionsAPPLYTOFRONT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setApplyToFront(oNewVal.m_val)}else if(c_oserct_pictureoptionsAPPLYTOSIDES===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setApplyToSides(oNewVal.m_val)}else if(c_oserct_pictureoptionsAPPLYTOEND=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setApplyToEnd(oNewVal.m_val)}else if(c_oserct_pictureoptionsPICTUREFORMAT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PictureFormat(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setPictureFormat(oNewVal.m_val)}else if(c_oserct_pictureoptionsPICTURESTACKUNIT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_PictureStackUnit(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setPictureStackUnit(oNewVal.m_val)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PictureFormat=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pictureformatVAL===type)switch(this.stream.GetUChar()){case st_pictureformatSTRETCH:val.m_val=PICTURE_FORMAT_STACK_STRETCH;break;case st_pictureformatSTACK:val.m_val=PICTURE_FORMAT_STACK;break; case st_pictureformatSTACKSCALE:val.m_val=PICTURE_FORMAT_STACK_SCALE;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PictureStackUnit=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_picturestackunitVAL===type){var oNewVal;oNewVal=this.stream.GetDoubleLE();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.CorrectDlbls=function(oLbls){if(oLbls&&oLbls.bDelete!==true){if(null===oLbls.showLegendKey)oLbls.setShowLegendKey(false); if(null===oLbls.showVal)oLbls.setShowVal(false);if(null===oLbls.showCatName)oLbls.setShowCatName(false);if(null===oLbls.showSerName)oLbls.setShowSerName(false);if(null===oLbls.showPercent)oLbls.setShowPercent(false);if(null===oLbls.showBubbleSize)oLbls.setShowBubbleSize(false);if(oLbls.setShowLeaderLines&&null===oLbls.showLeaderLines)oLbls.setShowLeaderLines(false)}};BinaryChartReader.prototype.ReadCT_DLbls=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_dlblsDLBL=== type){var oNewVal=new AscFormat.CDLbl;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbl(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.addDLbl(oNewVal)}else if(c_oserct_dlblsDLBLPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLblPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDLblPos(oNewVal.m_val)}else if(c_oserct_dlblsDELETE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setDelete(oNewVal.m_val);else val.setDelete(true)}else if(c_oserct_dlblsLEADERLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setLeaderLines(oNewVal.spPr);else val.setLeaderLines(new AscFormat.CSpPr)}else if(c_oserct_dlblsNUMFMT===type){var oNewVal=new AscFormat.CNumFmt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumFmt(t,l,oNewVal)});val.setNumFmt(oNewVal)}else if(c_oserct_dlblsSEPARATOR=== type)val.setSeparator(this.stream.GetString2LE(length));else if(c_oserct_dlblsSHOWBUBBLESIZE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowBubbleSize(oNewVal.m_val);else val.setShowBubbleSize(true)}else if(c_oserct_dlblsSHOWCATNAME===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowCatName(oNewVal.m_val); else val.setShowCatName(true)}else if(c_oserct_dlblsSHOWLEADERLINES===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowLeaderLines(oNewVal.m_val);else val.setShowLeaderLines(true)}else if(c_oserct_dlblsSHOWLEGENDKEY===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowLegendKey(oNewVal.m_val);else val.setShowLegendKey(true)}else if(c_oserct_dlblsSHOWPERCENT=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowPercent(oNewVal.m_val);else val.setShowPercent(true)}else if(c_oserct_dlblsSHOWSERNAME===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowSerName(oNewVal.m_val);else val.setShowSerName(true)}else if(c_oserct_dlblsSHOWVAL===type){var oNewVal={m_val:null}; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowVal(oNewVal.m_val);else val.setShowVal(true)}else if(c_oserct_dlblsSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_dlblsTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_dlblsEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown; return res};BinaryChartReader.prototype.ReadCT_DLbl=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_dlblIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_dlblDLBLPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLblPos(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDLblPos(oNewVal.m_val)}else if(c_oserct_dlblDELETE=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDelete(oNewVal.m_val);else val.setDelete(true)}else if(c_oserct_dlblLAYOUT===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Layout(t,l,val)});else if(c_oserct_dlblNUMFMT===type){var oNewVal=new AscFormat.CNumFmt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumFmt(t,l,oNewVal)});val.setNumFmt(oNewVal)}else if(c_oserct_dlblSEPARATOR=== type)val.setSeparator(this.stream.GetString2LE(length));else if(c_oserct_dlblSHOWBUBBLESIZE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowBubbleSize(oNewVal.m_val);else val.setShowBubbleSize(true)}else if(c_oserct_dlblSHOWCATNAME===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowCatName(oNewVal.m_val); else val.setShowCatName(true)}else if(c_oserct_dlblSHOWLEGENDKEY===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowLegendKey(oNewVal.m_val);else val.setShowLegendKey(true)}else if(c_oserct_dlblSHOWPERCENT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowPercent(oNewVal.m_val);else val.setShowPercent(true)}else if(c_oserct_dlblSHOWSERNAME=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowSerName(oNewVal.m_val);else val.setShowSerName(true)}else if(c_oserct_dlblSHOWVAL===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowVal(oNewVal.m_val);else val.setShowVal(true)}else if(c_oserct_dlblSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_dlblTX=== type){var oNewVal=new AscFormat.CChartText;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Tx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_dlblTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_dlblEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_DLblPos=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_dlblposVAL===type)switch(this.stream.GetUChar()){case st_dlblposBESTFIT:val.m_val=c_oAscChartDataLabelsPos.bestFit;break;case st_dlblposB:val.m_val=c_oAscChartDataLabelsPos.b;break;case st_dlblposCTR:val.m_val=c_oAscChartDataLabelsPos.ctr;break;case st_dlblposINBASE:val.m_val=c_oAscChartDataLabelsPos.inBase;break;case st_dlblposINEND:val.m_val=c_oAscChartDataLabelsPos.inEnd;break;case st_dlblposL:val.m_val=c_oAscChartDataLabelsPos.l;break;case st_dlblposOUTEND:val.m_val= c_oAscChartDataLabelsPos.outEnd;break;case st_dlblposR:val.m_val=c_oAscChartDataLabelsPos.r;break;case st_dlblposT:val.m_val=c_oAscChartDataLabelsPos.t;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Trendline=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_trendlineNAME===type)val.setName(this.stream.GetString2LE(length));else if(c_oserct_trendlineSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_trendlineTRENDLINETYPE=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TrendlineType(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setTrendlineType(oNewVal.m_val)}else if(c_oserct_trendlineORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Order(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_trendlinePERIOD===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Period(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setPeriod(oNewVal.m_val)}else if(c_oserct_trendlineFORWARD===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setForward(oNewVal.m_val)}else if(c_oserct_trendlineBACKWARD===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setBackward(oNewVal.m_val)}else if(c_oserct_trendlineINTERCEPT=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIntercept(oNewVal.m_val)}else if(c_oserct_trendlineDISPRSQR===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDispRSqr(oNewVal.m_val)}else if(c_oserct_trendlineDISPEQ===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setDispEq(oNewVal.m_val)}else if(c_oserct_trendlineTRENDLINELBL===type){var oNewVal=new AscFormat.CDLbl;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_TrendlineLbl(t,l,oNewVal)});val.setTrendlineLbl(oNewVal)}else if(c_oserct_trendlineEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_TrendlineType= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_trendlinetypeVAL===type)switch(this.stream.GetUChar()){case st_trendlinetypeEXP:val.m_val=TRENDLINE_TYPE_EXP;break;case st_trendlinetypeLINEAR:val.m_val=TRENDLINE_TYPE_LINEAR;break;case st_trendlinetypeLOG:val.m_val=TRENDLINE_TYPE_LOG;break;case st_trendlinetypeMOVINGAVG:val.m_val=TRENDLINE_TYPE_MOVING_AVG;break;case st_trendlinetypePOLY:val.m_val=TRENDLINE_TYPE_POLY;break;case st_trendlinetypePOWER:val.m_val=TRENDLINE_TYPE_POWER; break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Order=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_orderVAL===type){var oNewVal;oNewVal=this.stream.GetUChar();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Period=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_periodVAL===type){var oNewVal;oNewVal=this.stream.GetULongLE();val.m_val= oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_TrendlineLbl=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_trendlinelblLAYOUT===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Layout(t,l,val)});else if(c_oserct_trendlinelblTX===type){var oNewVal=new AscFormat.CChartText;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Tx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_trendlinelblNUMFMT=== type){var oNewVal=new AscFormat.CNumFmt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumFmt(t,l,oNewVal)});val.setNumFmt(oNewVal)}else if(c_oserct_trendlinelblSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_trendlinelblTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_trendlinelblEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown; return res};BinaryChartReader.prototype.ReadCT_ErrBars=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_errbarsERRDIR===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ErrDir(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setErrDir(oNewVal.m_val)}else if(c_oserct_errbarsERRBARTYPE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ErrBarType(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setErrBarType(oNewVal.m_val)}else if(c_oserct_errbarsERRVALTYPE=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ErrValType(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setErrValType(oNewVal.m_val)}else if(c_oserct_errbarsNOENDCAP===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setNoEndCap(oNewVal.m_val)}else if(c_oserct_errbarsPLUS===type){var oNewVal=new AscFormat.CMinusPlus;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t, l,oNewVal)});val.setPlus(oNewVal)}else if(c_oserct_errbarsMINUS===type){var oNewVal=new AscFormat.CMinusPlus;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t,l,oNewVal)});val.setMinus(oNewVal)}else if(c_oserct_errbarsVAL===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVal(oNewVal.m_val)}else if(c_oserct_errbarsSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_errbarsEXTLST=== type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ErrDir=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_errdirVAL===type)switch(this.stream.GetUChar()){case st_errdirX:val.m_val=ERR_DIR_X;break;case st_errdirY:val.m_val=ERR_DIR_Y;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ErrBarType= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_errbartypeVAL===type)switch(this.stream.GetUChar()){case st_errbartypeBOTH:val.m_val=ERR_BAR_TYPE_BOTH;break;case st_errbartypeMINUS:val.m_val=ERR_BAR_TYPE_MINUS;break;case st_errbartypePLUS:val.m_val=ERR_BAR_TYPE_PLUS;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ErrValType=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_errvaltypeVAL=== type)switch(this.stream.GetUChar()){case st_errvaltypeCUST:val.m_val=ERR_VAL_TYPE_CUST;break;case st_errvaltypeFIXEDVAL:val.m_val=ERR_VAL_TYPE_FIXED_VAL;break;case st_errvaltypePERCENTAGE:val.m_val=ERR_VAL_TYPE_PERCENTAGE;break;case st_errvaltypeSTDDEV:val.m_val=ERR_VAL_TYPE_STD_DEV;break;case st_errvaltypeSTDERR:val.m_val=ERR_VAL_TYPE_STD_ERR;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_NumDataSource=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_numdatasourceNUMLIT===type){var oNewVal=new AscFormat.CNumLit;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumData(t,l,oNewVal)});val.setNumLit(oNewVal)}else if(c_oserct_numdatasourceNUMREF===type){var oNewVal=new AscFormat.CNumRef;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumRef(t,l,oNewVal)});val.setNumRef(oNewVal)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_NumData=function(type,length,val){var res= c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_numdataFORMATCODE===type)val.setFormatCode(this.stream.GetString2LE(length));else if(c_oserct_numdataPTCOUNT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setPtCount(oNewVal.m_val)}else if(c_oserct_numdataPT===type){var oNewVal=new AscFormat.CNumericPoint;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumVal(t,l,oNewVal)});val.addPt(oNewVal)}else if(c_oserct_numdataEXTLST=== type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_NumVal=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_numvalV===type){var nVal=parseFloat(this.stream.GetString2LE(length));if(isNaN(nVal))nVal=0;val.setVal(nVal)}else if(c_oserct_numvalIDX===type)val.setIdx(this.stream.GetULongLE());else if(c_oserct_numvalFORMATCODE=== type)val.setFormatCode(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_NumRef=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_numrefF===type)val.setF(this.stream.GetString2LE(length));else if(c_oserct_numrefNUMCACHE===type){var oNewVal=new AscFormat.CNumLit;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumData(t,l,oNewVal)});val.setNumCache(oNewVal)}else if(c_oserct_numrefEXTLST=== type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_AxDataSource=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_axdatasourceMULTILVLSTRREF===type){var oNewVal=new AscFormat.CMultiLvlStrRef;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_MultiLvlStrRef(t,l,oNewVal)});val.setMultiLvlStrRef(oNewVal)}else if(c_oserct_axdatasourceNUMLIT=== type){var oNewVal=new AscFormat.CNumLit;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumData(t,l,oNewVal)});val.setNumLit(oNewVal)}else if(c_oserct_axdatasourceNUMREF===type){var oNewVal=new AscFormat.CNumRef;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumRef(t,l,oNewVal)});val.setNumRef(oNewVal)}else if(c_oserct_axdatasourceSTRLIT===type){var oNewVal=new AscFormat.CStrCache;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_StrData(t,l,oNewVal)});val.setStrLit(oNewVal)}else if(c_oserct_axdatasourceSTRREF=== type){var oNewVal=new AscFormat.CStrRef;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_StrRef(t,l,oNewVal)});val.setStrRef(oNewVal)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_MultiLvlStrRef=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_multilvlstrrefF===type)val.setF(this.stream.GetString2LE(length));else if(c_oserct_multilvlstrrefMULTILVLSTRCACHE===type){var oNewVal=new AscFormat.CMultiLvlStrCache;res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_MultiLvlStrData(t,l,oNewVal)});val.setMultiLvlStrCache(oNewVal)}else if(c_oserct_multilvlstrrefEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_lvl=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_lvlPT===type){var oNewVal=new AscFormat.CStringPoint;res=this.bcr.Read1(length,function(t, l){return oThis.ReadCT_StrVal(t,l,oNewVal)});val.addPt(oNewVal)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_MultiLvlStrData=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_multilvlstrdataPTCOUNT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setPtCount(oNewVal.m_val)}else if(c_oserct_multilvlstrdataLVL===type){var oNewVal=new AscFormat.CStrCache; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_lvl(t,l,oNewVal)});val.addLvl(oNewVal)}else if(c_oserct_multilvlstrdataEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_BubbleChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_bubblechartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_bubblechartSER===type){var oNewVal=new AscFormat.CBubbleSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BubbleSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_bubblechartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_bubblechartBUBBLE3D=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setBubble3D(oNewVal.m_val)}else if(c_oserct_bubblechartBUBBLESCALE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BubbleScale(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setBubbleScale(oNewVal.m_val)}else if(c_oserct_bubblechartSHOWNEGBUBBLES===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setShowNegBubbles(oNewVal.m_val)}else if(c_oserct_bubblechartSIZEREPRESENTS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SizeRepresents(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSizeRepresents(oNewVal.m_val)}else if(c_oserct_bubblechartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val, chart:val})}else if(c_oserct_bubblechartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_bandFmts=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_bandfmtsBANDFMT===type){var oNewVal=new AscFormat.CBandFmt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BandFmt(t,l,oNewVal)});val.addBandFmt(oNewVal)}else res= c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Surface3DChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_surface3dchartWIREFRAME===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setWireframe(oNewVal.m_val)}else if(c_oserct_surface3dchartSER===type){var oNewVal=new AscFormat.CSurfaceSeries;res=this.bcr.Read1(length,function(t, l){return oThis.ReadCT_SurfaceSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_surface3dchartBANDFMTS===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_bandFmts(t,l,val)});else if(c_oserct_surface3dchartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val,surface:true})}else if(c_oserct_surface3dchartEXTLST===type){var oNewVal={}; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_SurfaceSer=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_surfaceserIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_surfaceserORDER===type){var oNewVal={m_val:null}; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_surfaceserTX===type){var oNewVal=new AscFormat.CTx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerTx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_surfaceserSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_surfaceserCAT===type){var oNewVal=new AscFormat.CCat;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxDataSource(t, l,oNewVal)});val.setCat(oNewVal)}else if(c_oserct_surfaceserVAL===type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t,l,oNewVal)});val.setVal(oNewVal)}else if(c_oserct_surfaceserEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_BandFmt=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oserct_bandfmtIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_bandfmtSPPR===type)val.setSpPr(this.ReadSpPr(length));else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_SurfaceChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_surfacechartWIREFRAME===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setWireframe(oNewVal.m_val)}else if(c_oserct_surfacechartSER===type){var oNewVal=new AscFormat.CSurfaceSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SurfaceSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_surfacechartBANDFMTS===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_bandFmts(t,l,val)});else if(c_oserct_surfacechartAXID===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val,surface:true})}else if(c_oserct_surfacechartEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_SecondPieSize=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis= this;if(c_oserct_secondpiesizeVAL===type)val.m_val=this.ParsePersent(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_SplitType=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_splittypeVAL===type)switch(this.stream.GetUChar()){case st_splittypeAUTO:val.m_val=SPLIT_TYPE_AUTO;break;case st_splittypeCUST:val.m_val=SPLIT_TYPE_CUST;break;case st_splittypePERCENT:val.m_val=SPLIT_TYPE_PERCENT;break;case st_splittypePOS:val.m_val= SPLIT_TYPE_POS;break;case st_splittypeVAL:val.m_val=SPLIT_TYPE_VAL;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_OfPieType=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_ofpietypeVAL===type)switch(this.stream.GetUChar()){case st_ofpietypePIE:val.m_val=OF_PIE_TYPE_PIE;break;case st_ofpietypeBAR:val.m_val=OF_PIE_TYPE_BAR;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_custSplit= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_custsplitSECONDPIEPT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.addCustSplit(oNewVal.m_val)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_OfPieChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_ofpiechartOFPIETYPE===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_OfPieType(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOfPieType(oNewVal.m_val)}else if(c_oserct_ofpiechartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_ofpiechartSER===type){var oNewVal=new AscFormat.CPieSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PieSer(t, l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_ofpiechartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_ofpiechartGAPWIDTH===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_GapAmount(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGapWidth(oNewVal.m_val)}else if(c_oserct_ofpiechartSPLITTYPE===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SplitType(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSplitType(oNewVal.m_val)}else if(c_oserct_ofpiechartSPLITPOS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Double(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSplitPos(oNewVal.m_val)}else if(c_oserct_ofpiechartCUSTSPLIT===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_custSplit(t,l,val)});else if(c_oserct_ofpiechartSECONDPIESIZE=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SecondPieSize(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSecondPieSize(oNewVal.m_val)}else if(c_oserct_ofpiechartSERLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setSerLines(oNewVal.spPr);else val.setSerLines(new AscFormat.CSpPr)}else if(c_oserct_ofpiechartEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PieSer=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pieserIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_pieserORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t, l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_pieserTX===type){var oNewVal=new AscFormat.CTx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerTx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_pieserSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_pieserEXPLOSION===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setExplosion(oNewVal.m_val)}else if(c_oserct_pieserDPT=== type){var oNewVal=new AscFormat.CDPt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DPt(t,l,oNewVal)});val.addDPt(oNewVal)}else if(c_oserct_pieserDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_pieserCAT===type){var oNewVal=new AscFormat.CCat;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxDataSource(t,l,oNewVal)});val.setCat(oNewVal)}else if(c_oserct_pieserVAL=== type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t,l,oNewVal)});val.setVal(oNewVal)}else if(c_oserct_pieserEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_GapAmount=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_gapamountVAL===type)val.m_val=this.ParsePersent(this.stream.GetString2LE(length)); else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Bar3DChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_bar3dchartBARDIR===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BarDir(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setBarDir(oNewVal.m_val)}else if(c_oserct_bar3dchartGROUPING===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BarGrouping(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setGrouping(oNewVal.m_val)}else if(c_oserct_bar3dchartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_bar3dchartSER===type){var oNewVal=new AscFormat.CBarSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BarSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_bar3dchartDLBLS===type){var oNewVal= new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_bar3dchartGAPWIDTH===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_GapAmount(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGapWidth(oNewVal.m_val)}else if(c_oserct_bar3dchartGAPDEPTH===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_GapAmount(t,l, oNewVal)});if(null!=oNewVal.m_val)val.setGapDepth(oNewVal.m_val)}else if(c_oserct_bar3dchartSHAPE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Shape(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShape(oNewVal.m_val)}else if(c_oserct_bar3dchartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val})}else if(c_oserct_bar3dchartEXTLST=== type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_BarDir=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_bardirVAL===type)switch(this.stream.GetUChar()){case st_bardirBAR:val.m_val=AscFormat.BAR_DIR_BAR;break;case st_bardirCOL:val.m_val=AscFormat.BAR_DIR_COL;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_BarGrouping= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_bargroupingVAL===type)switch(this.stream.GetUChar()){case st_bargroupingPERCENTSTACKED:val.m_val=AscFormat.BAR_GROUPING_PERCENT_STACKED;break;case st_bargroupingCLUSTERED:val.m_val=AscFormat.BAR_GROUPING_CLUSTERED;break;case st_bargroupingSTANDARD:val.m_val=AscFormat.BAR_GROUPING_STANDARD;break;case st_bargroupingSTACKED:val.m_val=AscFormat.BAR_GROUPING_STACKED;break}else res=c_oSerConstants.ReadUnknown;return res}; BinaryChartReader.prototype.ReadCT_BarSer=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_barserIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_barserORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_barserTX=== type){var oNewVal=new AscFormat.CTx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerTx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_barserSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_barserINVERTIFNEGATIVE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setInvertIfNegative(oNewVal.m_val)}else if(c_oserct_barserPICTUREOPTIONS===type){var oNewVal=new AscFormat.CPictureOptions; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PictureOptions(t,l,oNewVal)});val.setPictureOptions(oNewVal)}else if(c_oserct_barserDPT===type){var oNewVal=new AscFormat.CDPt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DPt(t,l,oNewVal)});val.addDPt(oNewVal)}else if(c_oserct_barserDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_barserTRENDLINE=== type){var oNewVal=new AscFormat.CTrendLine;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Trendline(t,l,oNewVal)});val.setTrendline(oNewVal)}else if(c_oserct_barserERRBARS===type){var oNewVal=new AscFormat.CErrBars;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ErrBars(t,l,oNewVal)});val.setErrBars(oNewVal)}else if(c_oserct_barserCAT===type){var oNewVal=new AscFormat.CCat;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxDataSource(t,l,oNewVal)});val.setCat(oNewVal)}else if(c_oserct_barserVAL=== type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t,l,oNewVal)});val.setVal(oNewVal)}else if(c_oserct_barserSHAPE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Shape(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShape(oNewVal.m_val)}else if(c_oserct_barserEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown; return res};BinaryChartReader.prototype.ReadCT_Shape=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_shapeVAL===type)switch(this.stream.GetUChar()){case st_shapeCONE:val.m_val=AscFormat.BAR_SHAPE_CONE;break;case st_shapeCONETOMAX:val.m_val=AscFormat.BAR_SHAPE_CONETOMAX;break;case st_shapeBOX:val.m_val=AscFormat.BAR_SHAPE_BOX;break;case st_shapeCYLINDER:val.m_val=AscFormat.BAR_SHAPE_CYLINDER;break;case st_shapePYRAMID:val.m_val=AscFormat.BAR_SHAPE_PYRAMID;break; case st_shapePYRAMIDTOMAX:val.m_val=AscFormat.BAR_SHAPE_PYRAMIDTOMAX;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Overlap=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_overlapVAL===type)val.m_val=this.ParsePersent(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_BarChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis= this;if(c_oserct_barchartBARDIR===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BarDir(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setBarDir(oNewVal.m_val)}else if(c_oserct_barchartGROUPING===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BarGrouping(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGrouping(oNewVal.m_val)}else if(c_oserct_barchartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_barchartSER===type){var oNewVal=new AscFormat.CBarSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BarSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_barchartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_barchartGAPWIDTH=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_GapAmount(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGapWidth(oNewVal.m_val)}else if(c_oserct_barchartOVERLAP===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Overlap(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOverlap(oNewVal.m_val)}else if(c_oserct_barchartSERLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t, l,oNewVal)});if(null!=oNewVal.spPr)val.setSerLines(oNewVal.spPr);else val.setSerLines(new AscFormat.CSpPr)}else if(c_oserct_barchartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val})}else if(c_oserct_barchartEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown; return res};BinaryChartReader.prototype.ReadCT_HoleSize=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_holesizeVAL===type)val.m_val=this.ParsePersent(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_DoughnutChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_doughnutchartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_doughnutchartSER===type){var oNewVal=new AscFormat.CPieSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PieSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_doughnutchartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_doughnutchartFIRSTSLICEANG=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_FirstSliceAng(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setFirstSliceAng(oNewVal.m_val)}else if(c_oserct_doughnutchartHOLESIZE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_HoleSize(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setHoleSize(oNewVal.m_val)}else if(c_oserct_doughnutchartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t, l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_FirstSliceAng=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_firstsliceangVAL===type){var oNewVal;oNewVal=this.stream.GetULongLE();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Pie3DChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pie3dchartVARYCOLORS===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_pie3dchartSER===type){var oNewVal=new AscFormat.CPieSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PieSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_pie3dchartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal); val.setDLbls(oNewVal)}else if(c_oserct_pie3dchartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PieChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_piechartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_piechartSER=== type){var oNewVal=new AscFormat.CPieSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PieSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_piechartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_piechartFIRSTSLICEANG===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_FirstSliceAng(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setFirstSliceAng(oNewVal.m_val)}else if(c_oserct_piechartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ScatterSer=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_scatterserIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_scatterserORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_scatterserTX===type){var oNewVal=new AscFormat.CTx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerTx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_scatterserSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_scatterserMARKER=== type){var oNewVal=new AscFormat.CMarker;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Marker(t,l,oNewVal)});val.setMarker(oNewVal)}else if(c_oserct_scatterserDPT===type){var oNewVal=new AscFormat.CDPt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DPt(t,l,oNewVal)});val.addDPt(oNewVal)}else if(c_oserct_scatterserDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_scatterserTRENDLINE=== type){var oNewVal=new AscFormat.CTrendLine;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Trendline(t,l,oNewVal)});val.setTrendline(oNewVal)}else if(c_oserct_scatterserERRBARS===type){var oNewVal=new AscFormat.CErrBars;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ErrBars(t,l,oNewVal)});val.setErrBars(oNewVal)}else if(c_oserct_scatterserXVAL===type){var oNewVal=new AscFormat.CCat;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxDataSource(t,l,oNewVal)});val.setXVal(oNewVal)}else if(c_oserct_scatterserYVAL=== type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t,l,oNewVal)});val.setYVal(oNewVal)}else if(c_oserct_scatterserSMOOTH===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSmooth(oNewVal.m_val);else val.setSmooth(true)}else if(c_oserct_scatterserEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t, l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ScatterStyle=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_scatterstyleVAL===type)switch(this.stream.GetUChar()){case st_scatterstyleNONE:val.m_val=AscFormat.SCATTER_STYLE_NONE;break;case st_scatterstyleLINE:val.m_val=AscFormat.SCATTER_STYLE_LINE;break;case st_scatterstyleLINEMARKER:val.m_val=AscFormat.SCATTER_STYLE_LINE_MARKER;break;case st_scatterstyleMARKER:val.m_val= AscFormat.SCATTER_STYLE_MARKER;break;case st_scatterstyleSMOOTH:val.m_val=AscFormat.SCATTER_STYLE_SMOOTH;break;case st_scatterstyleSMOOTHMARKER:val.m_val=AscFormat.SCATTER_STYLE_SMOOTH_MARKER;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_ScatterChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_scatterchartSCATTERSTYLE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ScatterStyle(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setScatterStyle(oNewVal.m_val)}else if(c_oserct_scatterchartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_scatterchartSER===type){var oNewVal=new AscFormat.CScatterSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ScatterSer(t,l,oNewVal)});val.addSer(oNewVal);if(oNewVal.smooth===null)oNewVal.setSmooth(false)}else if(c_oserct_scatterchartDLBLS=== type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_scatterchartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val})}else if(c_oserct_scatterchartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t, l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_RadarSer=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_radarserIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_radarserORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_radarserTX===type){var oNewVal=new AscFormat.CTx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerTx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_radarserSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_radarserMARKER===type){var oNewVal=new AscFormat.CMarker;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Marker(t,l,oNewVal)});val.setMarker(oNewVal)}else if(c_oserct_radarserDPT=== type){var oNewVal=new AscFormat.CDPt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DPt(t,l,oNewVal)});val.addDPt(oNewVal)}else if(c_oserct_radarserDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_radarserCAT===type){var oNewVal=new AscFormat.CCat;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxDataSource(t,l,oNewVal)});val.setCat(oNewVal)}else if(c_oserct_radarserVAL=== type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t,l,oNewVal)});val.setVal(oNewVal)}else if(c_oserct_radarserEXTLST===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_RadarStyle=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_radarstyleVAL===type)switch(this.stream.GetUChar()){case st_radarstyleSTANDARD:val.m_val= RADAR_STYLE_STANDARD;break;case st_radarstyleMARKER:val.m_val=RADAR_STYLE_MARKER;break;case st_radarstyleFILLED:val.m_val=RADAR_STYLE_FILLED;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_RadarChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_radarchartRADARSTYLE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_RadarStyle(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setRadarStyle(oNewVal.m_val)}else if(c_oserct_radarchartVARYCOLORS=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_radarchartSER===type){var oNewVal=new AscFormat.CRadarSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_RadarSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_radarchartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)}); oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_radarchartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val})}else if(c_oserct_radarchartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_StockChart= function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_stockchartSER===type){var oNewVal=new AscFormat.CLineSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LineSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_stockchartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_stockchartDROPLINES=== type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setDropLines(oNewVal.spPr);else val.setDropLines(new AscFormat.CSpPr)}else if(c_oserct_stockchartHILOWLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setHiLowLines(oNewVal.spPr);else val.setHiLowLines(new AscFormat.CSpPr)}else if(c_oserct_stockchartUPDOWNBARS=== type){var oNewVal=new AscFormat.CUpDownBars;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UpDownBars(t,l,oNewVal)});val.setUpDownBars(oNewVal)}else if(c_oserct_stockchartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val})}else if(c_oserct_stockchartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t, l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LineSer=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_lineserIDX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_lineserORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_lineserTX===type){var oNewVal=new AscFormat.CTx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerTx(t,l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_lineserSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_lineserMARKER===type){var oNewVal=new AscFormat.CMarker;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Marker(t,l,oNewVal)});val.setMarker(oNewVal)}else if(c_oserct_lineserDPT=== type){var oNewVal=new AscFormat.CDPt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DPt(t,l,oNewVal)});val.addDPt(oNewVal)}else if(c_oserct_lineserDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_lineserTRENDLINE===type){var oNewVal=new AscFormat.CTrendLine;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Trendline(t,l,oNewVal)}); val.setTrendline(oNewVal)}else if(c_oserct_lineserERRBARS===type){var oNewVal=new AscFormat.CErrBars;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ErrBars(t,l,oNewVal)});val.setErrBars(oNewVal)}else if(c_oserct_lineserCAT===type){var oNewVal=new AscFormat.CCat;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxDataSource(t,l,oNewVal)});val.setCat(oNewVal)}else if(c_oserct_lineserVAL===type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t, l,oNewVal)});val.setVal(oNewVal)}else if(c_oserct_lineserSMOOTH===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSmooth(oNewVal.m_val);else val.setSmooth(true)}else if(c_oserct_lineserEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_UpDownBars=function(type, length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_updownbarsGAPWIDTH===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_GapAmount(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGapWidth(oNewVal.m_val)}else if(c_oserct_updownbarsUPBARS===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UpDownBar(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setUpBars(oNewVal.spPr);else val.setUpBars(new AscFormat.CSpPr)}else if(c_oserct_updownbarsDOWNBARS=== type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UpDownBar(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setDownBars(oNewVal.spPr);else val.setDownBars(new AscFormat.CSpPr)}else if(c_oserct_updownbarsEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_UpDownBar=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis= this;if(c_oserct_updownbarSPPR===type)val.spPr=this.ReadSpPr(length);else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Line3DChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_line3dchartGROUPING===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Grouping(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGrouping(oNewVal.m_val)}else if(c_oserct_line3dchartVARYCOLORS===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_line3dchartSER===type){var oNewVal=new AscFormat.CLineSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LineSer(t,l,oNewVal)});if(oNewVal.smooth===null)oNewVal.setSmooth(false);val.addSer(oNewVal)}else if(c_oserct_line3dchartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t, l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_line3dchartDROPLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setDropLines(oNewVal.spPr);else val.setDropLines(new AscFormat.CSpPr)}else if(c_oserct_line3dchartGAPDEPTH===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_GapAmount(t,l,oNewVal)})}else if(c_oserct_line3dchartAXID=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val})}else if(c_oserct_line3dchartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Grouping=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_groupingVAL=== type)switch(this.stream.GetUChar()){case st_groupingPERCENTSTACKED:val.m_val=AscFormat.GROUPING_PERCENT_STACKED;break;case st_groupingSTANDARD:val.m_val=AscFormat.GROUPING_STANDARD;break;case st_groupingSTACKED:val.m_val=AscFormat.GROUPING_STACKED;break}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_LineChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_linechartGROUPING===type){var oNewVal={m_val:null};res= this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Grouping(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGrouping(oNewVal.m_val)}else if(c_oserct_linechartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_linechartSER===type){var oNewVal=new AscFormat.CLineSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LineSer(t,l,oNewVal)}); val.addSer(oNewVal);if(oNewVal.smooth===null)oNewVal.setSmooth(false)}else if(c_oserct_linechartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_linechartDROPLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setDropLines(oNewVal.spPr);else val.setDropLines(new AscFormat.CSpPr)}else if(c_oserct_linechartHILOWLINES=== type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setHiLowLines(oNewVal.spPr);else val.setHiLowLines(new AscFormat.CSpPr)}else if(c_oserct_linechartUPDOWNBARS===type){var oNewVal=new AscFormat.CUpDownBars;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UpDownBars(t,l,oNewVal)});val.setUpDownBars(oNewVal)}else if(c_oserct_linechartMARKER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setMarker(oNewVal.m_val)}else if(c_oserct_linechartSMOOTH===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSmooth(oNewVal.m_val);else val.setSmooth(true)}else if(c_oserct_linechartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val, chart:val})}else if(c_oserct_linechartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Area3DChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_area3dchartGROUPING===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Grouping(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGrouping(oNewVal.m_val)}else if(c_oserct_area3dchartVARYCOLORS=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_area3dchartSER===type){var oNewVal=new AscFormat.CAreaSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AreaSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_area3dchartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)}); oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_area3dchartDROPLINES===type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setDropLines(oNewVal.spPr);else val.setDropLines(new AscFormat.CSpPr)}else if(c_oserct_area3dchartGAPDEPTH===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_GapAmount(t,l,oNewVal)})}else if(c_oserct_area3dchartAXID===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val})}else if(c_oserct_area3dchartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_AreaSer=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_areaserIDX=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_areaserORDER===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setOrder(oNewVal.m_val)}else if(c_oserct_areaserTX===type){var oNewVal=new AscFormat.CTx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerTx(t, l,oNewVal)});val.setTx(oNewVal)}else if(c_oserct_areaserSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_areaserPICTUREOPTIONS===type){var oNewVal=new AscFormat.CPictureOptions;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PictureOptions(t,l,oNewVal)});val.setPictureOptions(oNewVal)}else if(c_oserct_areaserDPT===type){var oNewVal=new AscFormat.CDPt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DPt(t,l,oNewVal)});val.addDPt(oNewVal)}else if(c_oserct_areaserDLBLS=== type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_areaserTRENDLINE===type){var oNewVal=new AscFormat.CTrendLine;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Trendline(t,l,oNewVal)});val.setTrendline(oNewVal)}else if(c_oserct_areaserERRBARS===type){var oNewVal=new AscFormat.CErrBars;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ErrBars(t, l,oNewVal)});val.setErrBars(oNewVal)}else if(c_oserct_areaserCAT===type){var oNewVal=new AscFormat.CCat;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AxDataSource(t,l,oNewVal)});val.setCat(oNewVal)}else if(c_oserct_areaserVAL===type){var oNewVal=new AscFormat.CYVal;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_NumDataSource(t,l,oNewVal)});val.setVal(oNewVal)}else if(c_oserct_areaserEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t, l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_AreaChart=function(type,length,val,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_areachartGROUPING===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Grouping(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setGrouping(oNewVal.m_val)}else if(c_oserct_areachartVARYCOLORS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t, l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setVaryColors(oNewVal.m_val)}else if(c_oserct_areachartSER===type){var oNewVal=new AscFormat.CAreaSeries;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AreaSer(t,l,oNewVal)});val.addSer(oNewVal)}else if(c_oserct_areachartDLBLS===type){var oNewVal=new AscFormat.CDLbls;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbls(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setDLbls(oNewVal)}else if(c_oserct_areachartDROPLINES=== type){var oNewVal={spPr:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ChartLines(t,l,oNewVal)});if(null!=oNewVal.spPr)val.setDropLines(oNewVal.spPr);else val.setDropLines(new AscFormat.CSpPr)}else if(c_oserct_areachartAXID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)aChartWithAxis.push({axisId:oNewVal.m_val,chart:val})}else if(c_oserct_areachartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PlotArea=function(type,length,val,oIdToAxisMap,aChartWithAxis){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_plotareaLAYOUT===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Layout(t,l,val)});else if(c_oserct_plotareaAREA3DCHART===type){var oNewVal=new AscFormat.CAreaChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Area3DChart(t, l,oNewVal,aChartWithAxis)});val.addChart(oNewVal)}else if(c_oserct_plotareaAREACHART===type){var oNewVal=new AscFormat.CAreaChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_AreaChart(t,l,oNewVal,aChartWithAxis)});val.addChart(oNewVal)}else if(c_oserct_plotareaBAR3DCHART===type){var oNewVal=new AscFormat.CBarChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Bar3DChart(t,l,oNewVal,aChartWithAxis)});oNewVal.set3D(true);val.addChart(oNewVal)}else if(c_oserct_plotareaBARCHART=== type){var oNewVal=new AscFormat.CBarChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BarChart(t,l,oNewVal,aChartWithAxis)});val.addChart(oNewVal)}else if(c_oserct_plotareaBUBBLECHART===type){var oNewVal=new AscFormat.CBubbleChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_BubbleChart(t,l,oNewVal,aChartWithAxis)});var scatter=this.ConvertBubbleToScatter(oNewVal,aChartWithAxis);val.addChart(scatter)}else if(c_oserct_plotareaDOUGHNUTCHART===type){var oNewVal=new AscFormat.CDoughnutChart; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DoughnutChart(t,l,oNewVal,aChartWithAxis)});val.addChart(oNewVal)}else if(c_oserct_plotareaLINE3DCHART===type){var oNewVal=new AscFormat.CLineChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Line3DChart(t,l,oNewVal,aChartWithAxis)});oNewVal.setMarker(true);oNewVal.setSmooth(false);for(var i=0,length=oNewVal.series.length;i<length;++i){var seria=oNewVal.series[i];if(null==seria.marker){var marker=new AscFormat.CMarker;marker.setSymbol(AscFormat.SYMBOL_NONE); seria.setMarker(marker)}}val.addChart(oNewVal)}else if(c_oserct_plotareaLINECHART===type){var oNewVal=new AscFormat.CLineChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_LineChart(t,l,oNewVal,aChartWithAxis)});val.addChart(oNewVal);if(oNewVal.smooth===null)oNewVal.setSmooth(false)}else if(c_oserct_plotareaOFPIECHART===type){var oNewVal=new AscFormat.COfPieChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_OfPieChart(t,l,oNewVal,aChartWithAxis)});var pie=this.ConvertOfPieToPie(oNewVal, aChartWithAxis);val.addChart(pie)}else if(c_oserct_plotareaPIE3DCHART===type){var oNewVal=new AscFormat.CPieChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Pie3DChart(t,l,oNewVal,aChartWithAxis)});oNewVal.set3D(true);val.addChart(oNewVal)}else if(c_oserct_plotareaPIECHART===type){var oNewVal=new AscFormat.CPieChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PieChart(t,l,oNewVal,aChartWithAxis)});val.addChart(oNewVal)}else if(c_oserct_plotareaRADARCHART===type){var oNewVal= new AscFormat.CRadarChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_RadarChart(t,l,oNewVal,aChartWithAxis)});var line=this.ConvertRadarToLine(oNewVal,aChartWithAxis);val.addChart(line)}else if(c_oserct_plotareaSCATTERCHART===type){var oNewVal=new AscFormat.CScatterChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ScatterChart(t,l,oNewVal,aChartWithAxis)});val.addChart(oNewVal)}else if(c_oserct_plotareaSTOCKCHART===type){var oNewVal=new AscFormat.CStockChart;res=this.bcr.Read1(length, function(t,l){return oThis.ReadCT_StockChart(t,l,oNewVal,aChartWithAxis)});val.addChart(oNewVal)}else if(c_oserct_plotareaSURFACE3DCHART===type){var oNewVal=new AscFormat.CSurfaceChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Surface3DChart(t,l,oNewVal,aChartWithAxis)});val.addChart(oNewVal)}else if(c_oserct_plotareaSURFACECHART===type){var oNewVal=new AscFormat.CSurfaceChart;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SurfaceChart(t,l,oNewVal,aChartWithAxis)}); val.addChart(oNewVal)}else if(c_oserct_plotareaCATAX===type){var oNewVal=new AscFormat.CCatAx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_CatAx(t,l,oNewVal)});if(null!=oNewVal.axId)oIdToAxisMap[oNewVal.axId]=oNewVal;val.addAxis(oNewVal);if(oNewVal.majorTickMark===null)oNewVal.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);if(oNewVal.minorTickMark===null)oNewVal.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);if(oNewVal.crosses===null)oNewVal.setCrosses(AscFormat.CROSSES_AUTO_ZERO); if(oNewVal.noMultiLvlLbl===null)oNewVal.setNoMultiLvlLbl(false);if(oNewVal.bDelete===null)oNewVal.setDelete(false)}else if(c_oserct_plotareaDATEAX===type){var oNewVal=new AscFormat.CDateAx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DateAx(t,l,oNewVal)});if(null!=oNewVal.axId)oIdToAxisMap[oNewVal.axId]=oNewVal;val.addAxis(oNewVal);if(oNewVal.majorTickMark===null)oNewVal.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);if(oNewVal.minorTickMark===null)oNewVal.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE); if(oNewVal.crosses===null)oNewVal.setCrosses(AscFormat.CROSSES_AUTO_ZERO);if(oNewVal.bDelete===null)oNewVal.setDelete(false)}else if(c_oserct_plotareaSERAX===type){var oNewVal=new AscFormat.CSerAx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_SerAx(t,l,oNewVal)});if(null!=oNewVal.axId)oIdToAxisMap[oNewVal.axId]=oNewVal;val.addAxis(oNewVal);if(oNewVal.majorTickMark===null)oNewVal.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);if(oNewVal.minorTickMark===null)oNewVal.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE); if(oNewVal.crosses===null)oNewVal.setCrosses(AscFormat.CROSSES_AUTO_ZERO);if(oNewVal.bDelete===null)oNewVal.setDelete(false)}else if(c_oserct_plotareaVALAX===type){var oNewVal=new AscFormat.CValAx;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_ValAx(t,l,oNewVal)});if(null!=oNewVal.axId)oIdToAxisMap[oNewVal.axId]=oNewVal;val.addAxis(oNewVal);if(oNewVal.majorTickMark===null)oNewVal.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);if(oNewVal.minorTickMark===null)oNewVal.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE); if(oNewVal.crosses===null)oNewVal.setCrosses(AscFormat.CROSSES_AUTO_ZERO);if(oNewVal.bDelete===null)oNewVal.setDelete(false)}else if(c_oserct_plotareaDTABLE===type){var oNewVal=new AscFormat.CDTable;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DTable(t,l,oNewVal)});val.setDTable(oNewVal)}else if(c_oserct_plotareaSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_plotareaEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l, oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Thickness=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_thicknessVAL===type)val.m_val=this.ParsePersent(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Surface=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_surfaceTHICKNESS===type){var oNewVal={m_val:null};res= this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Thickness(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setThickness(oNewVal.m_val)}else if(c_oserct_surfaceSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_surfacePICTUREOPTIONS===type){var oNewVal=new AscFormat.CPictureOptions;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PictureOptions(t,l,oNewVal)});val.setPictureOptions(oNewVal)}else if(c_oserct_surfaceEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t, l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Perspective=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_perspectiveVAL===type){var oNewVal;oNewVal=this.stream.GetUChar();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_DepthPercent=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_depthpercentVAL=== type){var oNewVal;oNewVal=this.stream.GetString2LE(length);val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_RotY=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_rotyVAL===type){var oNewVal;oNewVal=this.stream.GetULongLE();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_HPercent=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_hpercentVAL=== type)val.m_val=this.ParsePersent(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_RotX=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_rotxVAL===type){var oNewVal;oNewVal=this.stream.GetChar();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_View3D=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_view3dROTX=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_RotX(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setRotX(oNewVal.m_val)}else if(c_oserct_view3dHPERCENT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_HPercent(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setHPercent(oNewVal.m_val)}else if(c_oserct_view3dROTY===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_RotY(t,l,oNewVal)}); if(null!=oNewVal.m_val)val.setRotY(oNewVal.m_val)}else if(c_oserct_view3dDEPTHPERCENT===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DepthPercent(t,l,oNewVal)});if(null!=oNewVal.m_val){var nPercent=parseInt(oNewVal.m_val);if(AscFormat.isRealNumber(nPercent))val.setDepthPercent(nPercent)}}else if(c_oserct_view3dRANGAX===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setRAngAx(oNewVal.m_val)}else if(c_oserct_view3dPERSPECTIVE=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Perspective(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setPerspective(oNewVal.m_val)}else if(c_oserct_view3dEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PivotFmt=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pivotfmtIDX=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setIdx(oNewVal.m_val)}else if(c_oserct_pivotfmtSPPR===type)val.setSpPr(this.ReadSpPr(length));else if(c_oserct_pivotfmtTXPR===type){val.setTxPr(this.ReadTxPr(length));val.txPr.setParent(val)}else if(c_oserct_pivotfmtMARKER===type){var oNewVal=new AscFormat.CMarker;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Marker(t,l,oNewVal)});val.setMarker(oNewVal)}else if(c_oserct_pivotfmtDLBL=== type){var oNewVal=new AscFormat.CDLbl;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DLbl(t,l,oNewVal)});oThis.CorrectDlbls(oNewVal);val.setLbl(oNewVal)}else if(c_oserct_pivotfmtEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_pivotFmts=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pivotfmtsPIVOTFMT=== type){var oNewVal=new AscFormat.CPivotFmt;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PivotFmt(t,l,oNewVal)});val.setPivotFmts(oNewVal)}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Chart=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_chartTITLE===type){var oNewVal=new AscFormat.CTitle;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Title(t,l,oNewVal)});if(!AscFormat.isRealBool(oNewVal.overlay))oNewVal.setOverlay(false); val.setTitle(oNewVal)}else if(c_oserct_chartAUTOTITLEDELETED===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setAutoTitleDeleted(oNewVal.m_val);else val.setAutoTitleDeleted(true)}else if(c_oserct_chartPIVOTFMTS===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_pivotFmts(t,l,val)});else if(c_oserct_chartVIEW3D===type){var oNewVal=new AscFormat.CView3d;res=this.bcr.Read1(length,function(t, l){return oThis.ReadCT_View3D(t,l,oNewVal)});val.setView3D(oNewVal)}else if(c_oserct_chartFLOOR===type){var oNewVal=new AscFormat.CChartWall;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Surface(t,l,oNewVal)});val.setFloor(oNewVal)}else if(c_oserct_chartSIDEWALL===type){var oNewVal=new AscFormat.CChartWall;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Surface(t,l,oNewVal)});val.setSideWall(oNewVal)}else if(c_oserct_chartBACKWALL===type){var oNewVal=new AscFormat.CChartWall; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Surface(t,l,oNewVal)});val.setBackWall(oNewVal)}else if(c_oserct_chartPLOTAREA===type){var oNewVal=new AscFormat.CPlotArea;var oIdToAxisMap={};var aChartWithAxis=[];res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_PlotArea(t,l,oNewVal,oIdToAxisMap,aChartWithAxis)});for(var nAxIndex=0;nAxIndex<oNewVal.axId.length;++nAxIndex){var oCurAxis=oNewVal.axId[nAxIndex];oCurAxis.setCrossAx(oIdToAxisMap[oCurAxis.crossAxId]);delete oCurAxis.crossAxId}for(var nChartIndex= 0;nChartIndex<aChartWithAxis.length;++nChartIndex){var oCurChartWithAxis=aChartWithAxis[nChartIndex];var axis=oIdToAxisMap[oCurChartWithAxis.axisId];oCurChartWithAxis.chart.addAxId(axis);if(axis&&axis.getObjectType()===AscDFH.historyitem_type_ValAx&&!AscFormat.isRealNumber(axis.crossBetween))if(oCurChartWithAxis.chart.getObjectType()===AscDFH.historyitem_type_AreaChart)axis.setCrossBetween(AscFormat.CROSS_BETWEEN_MID_CAT);else axis.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN)}val.setPlotArea(oNewVal); for(var _i=oNewVal.charts.length-1;_i>-1;--_i){var oChart=oNewVal.charts[_i];if(oChart){if(oChart.getObjectType()!==AscDFH.historyitem_type_ScatterChart&&oChart.getObjectType()!==AscDFH.historyitem_type_PieChart&&oChart.getObjectType()!==AscDFH.historyitem_type_DoughnutChart){var axis_by_types=oChart.getAxisByTypes();if(axis_by_types.valAx.length===0||axis_by_types.catAx.length===0){oNewVal.removeCharts(_i,_i);if(oChart.axId){oChart.axId.length=0;oChart=oChart.createDuplicate();if(oChart.setParent)oChart.setParent(oNewVal)}var sDefaultValAxFormatCode= null;if(oChart&&oChart.series[0]){var aPoints=AscFormat.getPtsFromSeries(oChart.series[0]);if(aPoints[0]&&typeof aPoints[0].formatCode==="string"&&aPoints[0].formatCode.length>0)sDefaultValAxFormatCode=aPoints[0].formatCode}var need_num_fmt=sDefaultValAxFormatCode;var axis_obj=AscFormat.CreateDefaultAxises(need_num_fmt?need_num_fmt:"General");var cat_ax=axis_obj.catAx;var val_ax=axis_obj.valAx;if(oChart.getObjectType()===AscDFH.historyitem_type_BarChart&&oChart.barDir===AscFormat.BAR_DIR_BAR){if(cat_ax.axPos!== AscFormat.AX_POS_L)cat_ax.setAxPos(AscFormat.AX_POS_L);if(val_ax.axPos!==AscFormat.AX_POS_B)val_ax.setAxPos(AscFormat.AX_POS_B)}else{if(cat_ax.axPos!==AscFormat.AX_POS_B)cat_ax.setAxPos(AscFormat.AX_POS_B);if(val_ax.axPos!==AscFormat.AX_POS_L)val_ax.setAxPos(AscFormat.AX_POS_L)}oNewVal.addChart(oChart);oChart.addAxId(cat_ax);oChart.addAxId(val_ax);oNewVal.addAxis(cat_ax);oNewVal.addAxis(val_ax)}else if(oChart.getObjectType()===AscDFH.historyitem_type_BarChart&&oChart.barDir===AscFormat.BAR_DIR_BAR){for(var _c= 0;_c<axis_by_types.valAx.length;++_c){var val_ax=axis_by_types.valAx[_c];if(val_ax.axPos!==AscFormat.AX_POS_B&&val_ax.axPos!==AscFormat.AX_POS_T)val_ax.setAxPos(AscFormat.AX_POS_B)}for(var _c=0;_c<axis_by_types.catAx.length;++_c){var cat_ax=axis_by_types.catAx[_c];if(cat_ax.axPos!==AscFormat.AX_POS_L&&cat_ax.axPos!==AscFormat.AX_POS_R)cat_ax.setAxPos(AscFormat.AX_POS_L)}}}if(oChart.setVaryColors&&oChart.varyColors===null)oChart.setVaryColors(false);if(oChart.setSmooth&&oChart.smooth===null);if(oChart.setGapWidth&& oChart.gapWidth===null)oChart.setGapWidth(150);var oDlbls;if(oChart.setDLbls&&oChart.dLbls===null){oDlbls=new AscFormat.CDLbls;oDlbls.setShowLegendKey(false);oDlbls.setShowVal(false);oDlbls.setShowCatName(false);oDlbls.setShowSerName(false);oDlbls.setShowPercent(false);oDlbls.setShowBubbleSize(false);oChart.setDLbls(oDlbls)}}}}else if(c_oserct_chartLEGEND===type){var oNewVal=new AscFormat.CLegend;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Legend(t,l,oNewVal)});oNewVal.updateLegendPos(); val.setLegend(oNewVal)}else if(c_oserct_chartPLOTVISONLY===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setPlotVisOnly(oNewVal.m_val)}else if(c_oserct_chartDISPBLANKSAS===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_DispBlanksAs(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setDispBlanksAs(oNewVal.m_val)}else if(c_oserct_chartSHOWDLBLSOVERMAX===type){var oNewVal= {m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setShowDLblsOverMax(oNewVal.m_val);else val.setShowDLblsOverMax(true)}else if(c_oserct_chartEXTLST===type){var oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Protection=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_protectionCHARTOBJECT=== type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setChartObject(oNewVal.m_val)}else if(c_oserct_protectionDATA===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setData(oNewVal.m_val)}else if(c_oserct_protectionFORMATTING===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t, l,oNewVal)});if(null!=oNewVal.m_val)val.setFormatting(oNewVal.m_val)}else if(c_oserct_protectionSELECTION===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setSelection(oNewVal.m_val)}else if(c_oserct_protectionUSERINTERFACE===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Boolean(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setUserInterface(oNewVal.m_val)}else res= c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_PivotSource=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_pivotsourceNAME===type)val.setName(this.stream.GetString2LE(length));else if(c_oserct_pivotsourceFMTID===type){var oNewVal={m_val:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_UnsignedInt(t,l,oNewVal)});if(null!=oNewVal.m_val)val.setFmtId(oNewVal.m_val)}else if(c_oserct_pivotsourceEXTLST===type){var oNewVal={}; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_extLst(t,l,oNewVal)})}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Style1=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_style1VAL===type){var oNewVal;oNewVal=this.stream.GetUChar();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_Style=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_styleVAL=== type){var oNewVal;oNewVal=this.stream.GetUChar();val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadCT_TextLanguageID=function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oserct_textlanguageidVAL===type){var oNewVal;oNewVal=this.stream.GetString2LE(length);val.m_val=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadAlternateContent=function(type,length,val){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oseralternatecontentCHOICE===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadAlternateContentChoice(t,l,oNewVal)});if(null==val.m_Choice)val.m_Choice=[];val.m_Choice.push(oNewVal)}else if(c_oseralternatecontentFALLBACK===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadAlternateContentFallback(t,l,oNewVal)});val.m_Fallback=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadAlternateContentChoice= function(type,length,val){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oseralternatecontentchoiceSTYLE===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Style(t,l,oNewVal)});val.m_style=oNewVal}else if(c_oseralternatecontentchoiceREQUIRES===type){var oNewVal;oNewVal=this.stream.GetString2LE(length);val.m_Requires=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};BinaryChartReader.prototype.ReadAlternateContentFallback=function(type,length,val){var res= c_oSerConstants.ReadOk;var oThis=this;if(c_oseralternatecontentfallbackSTYLE===type){var oNewVal;oNewVal={};res=this.bcr.Read1(length,function(t,l){return oThis.ReadCT_Style1(t,l,oNewVal)});val.m_style=oNewVal}else res=c_oSerConstants.ReadUnknown;return res};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].BinaryChartWriter=BinaryChartWriter;window["AscCommon"].BinaryChartReader=BinaryChartReader;window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].LAYOUT_MODE_EDGE=LAYOUT_MODE_EDGE; window["AscFormat"].LAYOUT_MODE_FACTOR=LAYOUT_MODE_FACTOR;window["AscFormat"].LAYOUT_TARGET_INNER=LAYOUT_TARGET_INNER;window["AscFormat"].LAYOUT_TARGET_OUTER=LAYOUT_TARGET_OUTER})(window);"use strict";(function(window,undefined){var FT_Common=AscFonts.FT_Common;var FontStyle={FontStyleRegular:0,FontStyleBold:1,FontStyleItalic:2,FontStyleBoldItalic:3,FontStyleUnderline:4,FontStyleStrikeout:8};var charA="A".charCodeAt(0);var charZ="Z".charCodeAt(0);var chara="a".charCodeAt(0);var charz="z".charCodeAt(0); var char0="0".charCodeAt(0);var char9="9".charCodeAt(0);var charp="+".charCodeAt(0);var chars="/".charCodeAt(0);function DecodeBase64Char(ch){if(ch>=charA&&ch<=charZ)return ch-charA+0;if(ch>=chara&&ch<=charz)return ch-chara+26;if(ch>=char0&&ch<=char9)return ch-char0+52;if(ch==charp)return 62;if(ch==chars)return 63;return-1}var b64_decode=[];(function(){var i;for(i=charA;i<=charZ;i++)b64_decode[i]=i-charA+0;for(i=chara;i<=charz;i++)b64_decode[i]=i-chara+26;for(i=char0;i<=char9;i++)b64_decode[i]=i- char0+52})();b64_decode[charp]=62;b64_decode[chars]=63;function CreateFontData2(szSrc,dstLen){var srcLen=szSrc.length;var nWritten=0;if(dstLen===undefined)dstLen=srcLen;var stream=new AscFonts.FontStream(AscFonts.allocate(dstLen),dstLen);var dstPx=stream.data;var index=0;if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24- nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream}function CreateFontData3(szSrc){var srcLen=szSrc.length;var stream=new AscFonts.FontStream(AscFonts.allocate(srcLen), srcLen);var dstPx=stream.data;var index=0;while(index<srcLen){dstPx[index]=szSrc.charCodeAt(index)&255;index++}return stream}function CreateFontData4(szSrc){var srcLen=szSrc.length;var nWritten=0;var index=0;var dst_len="";while(true){var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0))break;dst_len+=String.fromCharCode(_c);index++}index++;var dstLen=parseInt(dst_len);if(dstLen<=0)return null;var stream=new AscFonts.FontStream(AscFonts.allocate(dstLen),dstLen);var dstPx=stream.data;if(window.chrome)while(index< srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<= 24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream}var FD_UNKNOWN_CHARSET=3;function FD_FontInfo(){this.Name="";this.IndexR=-1;this.IndexI=-1;this.IndexB=-1;this.IndexBI=-1}function FD_FontDictionary(){this.FONTS_DICT_ASCII_NAMES_COUNT=0;this.FD_Ascii_Names=[];this.FD_Ascii_Names_Offsets=null;if(typeof Int32Array!="undefined"&&!window.opera)this.FD_Ascii_Names_Offsets=new Int32Array(256);else this.FD_Ascii_Names_Offsets=new Array(256);for(var i=0;i< 256;i++)this.FD_Ascii_Names_Offsets[i]=-1;this.FONTS_DICT_UNICODE_NAMES_COUNT=0;this.FD_Unicode_Names=[];this.FONTS_DICT_ASCII_FONTS_COUNT=0;this.FD_Ascii_Files=[];this.FD_Ascii_Font_Like_Names=[["Cambria Math","Asana Math","XITS Math","Latin Modern"],["OpenSymbol"],["Arial","Liberation Sans","Helvetica","Nimbus Sans L"],["Times New Roman","Liberation Serif"],["Courier New","Liberation Mono"],["Segoe","Segoe UI"],["Cambria","Caladea"]];this.FD_Ascii_Font_Like_Main={"Cambria Math":0,"Asana Math":0, "XITS Math":0,"Latin Modern":0,"Symbol":1,"Wingdings":1,"Arial":2,"Liberation Sans":2,"Helvetica":2,"Nimbus Sans L":2,"Times New Roman":3,"Liberation Serif":3,"Courier New":4,"Liberation Mono":4,"Segoe":5,"Segoe UI":5,"Cambria":6,"Caladea":6};this.ChangeGlyphsMap={"Symbol":{Name:"OpenSymbol",IsSymbolSrc:true,MapSrc:[183,168],MapDst:[57644,58434]},"Wingdings":{Name:"OpenSymbol",IsSymbolSrc:true,MapSrc:[118,119,216,167,252,113],MapDst:[58433,58434,57951,58479,58160,10065]}};this.MainUnicodeRanges={48:3E3, 49:3E3,50:3E3,55:3E3,59:3E3,28:3E3,13:3E3,63:3E3,67:3E3}}FD_FontDictionary.prototype={Init:function(){var _base64_data="qwEAAA0AAABBR0EgQXJhYmVzcXVlGAAAAP///////////////xUAAABBR0EgQXJhYmVzcXVlIERlc2t0b3AbAAAA////////////////CQAAAEFnZW5jeSBGQgEAAAD/////AAAAAP////8HAAAAQWhhcm9uaf//////////AwAAAP////8JAAAAQWtoYmFyIE1U/////wQAAAD/////BQAAAAcAAABBbGRoYWJpBgAAAP///////////////wgAAABBbGdlcmlhbgcAAAD///////////////8FAAAAQW1pIFJZAQAA////////////////BwAAAEFuZGFsdXMIAAAA////////////////CwAAAEFuZ3NhbmEgTmV3CQAAAAsAAAAKAAAAEAAAAAoAAABBbmdzYW5hVVBDDAAAAA4AAAANAAAADwAAAAkAAABBcGFyYWppdGEUAAAAFwAAABUAAAAWAAAAEgAAAEFyYWJpYyBUcmFuc3BhcmVudCgAAAD/////JwAAAP////8SAAAAQXJhYmljIFR5cGVzZXR0aW5nGQAAAP///////////////wUAAABBcmlhbBwAAAAfAAAAHQAAAB4AAAALAAAAQXJpYWwgQmxhY2slAAAA////////////////DAAAAEFyaWFsIE5hcnJvdyAAAAAjAAAAIQAAACIAAAAVAAAAQXJpYWwgUm91bmRlZCBNVCBCb2xkJgAAAP///////////////xAAAABBcmlhbCBVbmljb2RlIE1TJAAAAP///////////////wQAAABBcnZvLAAAACsAAAApAAAAKgAAAAgAAABBc3Rvbi1GMS0AAAD///////////////8UAAAAQmFza2VydmlsbGUgT2xkIEZhY2UuAAAA////////////////BgAAAEJhdGFuZy8AAAD///////////////8JAAAAQmF0YW5nQ2hlMAAAAP///////////////woAAABCYXVoYXVzIDkzMwAAAP///////////////wcAAABCZWxsIE1UNAAAADYAAAA1AAAA/////w4AAABCZXJsaW4gU2FucyBGQk4AAAD/////TAAAAP////8TAAAAQmVybGluIFNhbnMgRkIgRGVtaf//////////TQAAAP////8UAAAAQmVybmFyZCBNVCBDb25kZW5zZWQ3AAAA////////////////EgAAAEJpY2toYW0gU2NyaXB0IFByb///////////OAAAAP////8aAAAAQmlja2hhbSBTY3JpcHQgUHJvIFJlZ3VsYXL//////////zgAAAD/////DgAAAEJsYWNrYWRkZXIgSVRDYwEAAP///////////////wkAAABCb2RvbmkgTVRFAAAAQwAAADsAAAA8AAAADwAAAEJvZG9uaSBNVCBCbGFjaz4AAAA9AAAA//////////8TAAAAQm9kb25pIE1UIENvbmRlbnNlZEIAAABBAAAAPwAAAEAAAAAbAAAAQm9kb25pIE1UIFBvc3RlciBDb21wcmVzc2VkRAAAAP///////////////w8AAABCb2xkIEl0YWxpYyBBcnQ6AAAA////////////////DAAAAEJvb2sgQW50aXF1YTkAAAATAAAAEQAAABIAAAARAAAAQm9va21hbiBPbGQgU3R5bGVGAAAASQAAAEcAAABIAAAAEgAAAEJvb2tzaGVsZiBTeW1ib2wgN1kAAAD///////////////8QAAAAQnJhZGxleSBIYW5kIElUQ0oAAAD///////////////8OAAAAQnJpdGFubmljIEJvbGRLAAAA////////////////CAAAAEJyb2Fkd2F5TwAAAP///////////////w0AAABCcm93YWxsaWEgTmV3UAAAAFIAAABRAAAAVwAAAAwAAABCcm93YWxsaWFVUENTAAAAVQAAAFQAAABWAAAADwAAAEJydXNoIFNjcmlwdCBNVP////9YAAAA//////////8HAAAAQ2FsaWJyaVoAAABcAAAAWwAAAF8AAAANAAAAQ2FsaWJyaSBMaWdodF0AAABeAAAA//////////8UAAAAQ2FsaWJyaSBMaWdodCBJdGFsaWP/////XgAAAP//////////DgAAAENhbGlmb3JuaWFuIEZCYgAAAGEAAABgAAAA/////woAAABDYWxpc3RvIE1UYwAAAGYAAABkAAAAZQAAAAcAAABDYW1icmlhZwAAAGoAAABpAAAAawAAAAwAAABDYW1icmlhIE1hdGhoAAAA////////////////BwAAAENhbmRhcmFsAAAAbgAAAG0AAABvAAAACQAAAENhc3RlbGxhcnAAAAD///////////////8HAAAAQ2VudGF1cnIAAAD///////////////8HAAAAQ2VudHVyeXMAAAD///////////////8OAAAAQ2VudHVyeSBHb3RoaWMYAQAAGwEAABkBAAAaAQAAEgAAAENlbnR1cnkgU2Nob29sYm9va3EAAAAmAgAAJAIAACUCAAAHAAAAQ2hpbGxlcnQAAAD///////////////8KAAAAQ29sb25uYSBNVHUAAAD///////////////8NAAAAQ29taWMgU2FucyBNU3YAAAB4AAAAdwAAAHkAAAAIAAAAQ29uc29sYXN6AAAAfAAAAHsAAAB9AAAACgAAAENvbnN0YW50aWF+AAAAgAAAAH8AAACBAAAADAAAAENvb3BlciBCbGFja4IAAAD///////////////8XAAAAQ29wcGVycGxhdGUgR290aGljIEJvbGSDAAAA////////////////GAAAAENvcHBlcnBsYXRlIEdvdGhpYyBMaWdodIQAAAD///////////////8GAAAAQ29yYmVshQAAAIcAAACGAAAAiAAAAAoAAABDb3JkaWEgTmV3iQAAAIsAAACKAAAAkAAAAAkAAABDb3JkaWFVUEOMAAAAjgAAAI0AAACPAAAACwAAAENvdXJpZXIgTmV3kQAAAJQAAACSAAAAkwAAAAYAAABDdXBydW2YAAAAlwAAAJUAAACWAAAACAAAAEN1cmx6IE1UmQAAAP///////////////wgAAABERkthaS1TQmkBAAD///////////////8OAAAARGFuY2luZyBTY3JpcHSbAAAA/////5oAAAD/////CAAAAERhdW5QZW5onAAAAP///////////////wUAAABEYXZpZJ0AAAD/////ngAAAP////8RAAAARGF2aWQgVHJhbnNwYXJlbnSfAAAA////////////////DgAAAERlY29UeXBlIE5hc2towwAAAP///////////////xkAAABEZWNvVHlwZSBOYXNraCBFeHRlbnNpb25zxgAAAP///////////////xYAAABEZWNvVHlwZSBOYXNraCBTcGVjaWFsxAAAAP///////////////xYAAABEZWNvVHlwZSBOYXNraCBTd2FzaGVzxwAAAP///////////////xcAAABEZWNvVHlwZSBOYXNraCBWYXJpYW50c8UAAAD///////////////8QAAAARGVjb1R5cGUgVGh1bHV0aMIAAAD///////////////8LAAAARGVqYVZ1IFNhbnOgAAAArAAAAKEAAACiAAAAFQAAAERlamFWdSBTYW5zIENvbmRlbnNlZKYAAAClAAAAowAAAKQAAAARAAAARGVqYVZ1IFNhbnMgTGlnaHSnAAAA////////////////EAAAAERlamFWdSBTYW5zIE1vbm+rAAAAqgAAAKgAAACpAAAADAAAAERlamFWdSBTZXJpZq0AAAC0AAAArgAAAK8AAAAWAAAARGVqYVZ1IFNlcmlmIENvbmRlbnNlZLMAAACyAAAAsAAAALEAAAALAAAARGlsbGVuaWFVUEN/AgAAfgIAAHwCAAB9AgAACAAAAERpbmdiYXRztQAAAP///////////////wsAAABEaXdhbmkgQmVudLYAAAD///////////////8NAAAARGl3YW5pIExldHRlcrcAAAD///////////////8VAAAARGl3YW5pIE91dGxpbmUgU2hhZGVkyAAAAP///////////////xUAAABEaXdhbmkgU2ltcGxlIE91dGxpbmXKAAAA////////////////FwAAAERpd2FuaSBTaW1wbGUgT3V0bGluZSAyyQAAAP///////////////xUAAABEaXdhbmkgU2ltcGxlIFN0cmlwZWTLAAAA////////////////CQAAAERva0NoYW1wYbgAAAD///////////////8FAAAARG90dW0iAQAA////////////////CAAAAERvdHVtQ2hlIwEAAP///////////////woAAABEcm9pZCBTYW5zvAAAAP////+7AAAA/////w8AAABEcm9pZCBTYW5zIE1vbm+9AAAA////////////////CwAAAERyb2lkIFNlcmlmwQAAAMAAAAC+AAAAvwAAAAYAAABFYnJpbWHMAAAA/////80AAAD/////FAAAAEVkd2FyZGlhbiBTY3JpcHQgSVRDZAEAAP///////////////wgAAABFbGVwaGFudM4AAADPAAAA//////////8MAAAARW5ncmF2ZXJzIE1U0AAAAP///////////////w0AAABFcmFzIEJvbGQgSVRD0QAAAP///////////////w0AAABFcmFzIERlbWkgSVRD0gAAAP///////////////w4AAABFcmFzIExpZ2h0IElUQ9MAAAD///////////////8PAAAARXJhcyBNZWRpdW0gSVRD1AAAAP///////////////xEAAABFc3RyYW5nZWxvIEVkZXNzYdUAAAD///////////////8LAAAARXVjcm9zaWFVUEODAgAAggIAAIACAACBAgAACAAAAEV1cGhlbWlh1gAAAP///////////////wYAAABFeHBvIE1WAQAA////////////////BwAAAEZaU2h1VGnsAAAA////////////////BwAAAEZaWWFvVGntAAAA////////////////CAAAAEZhbmdTb25nPAIAAP///////////////xEAAABGYXJzaSBTaW1wbGUgQm9sZOkAAAD///////////////8UAAAARmFyc2kgU2ltcGxlIE91dGxpbmXqAAAA////////////////DQAAAEZlbGl4IFRpdGxpbmfXAAAA////////////////GAAAAEZpeGVkIE1pcmlhbSBUcmFuc3BhcmVudMIBAAD///////////////8QAAAARmxlbWlzaFNjcmlwdCBCVNgAAAD///////////////8SAAAARm9vdGxpZ2h0IE1UIExpZ2h06wAAAP///////////////wUAAABGb3J0ZdkAAAD///////////////8KAAAARnJhbmtSdWVobOQAAAD///////////////8UAAAARnJhbmtsaW4gR290aGljIEJvb2vaAAAA2wAAAP//////////FAAAAEZyYW5rbGluIEdvdGhpYyBEZW1p3AAAAN4AAAD//////////xkAAABGcmFua2xpbiBHb3RoaWMgRGVtaSBDb25k3QAAAP///////////////xUAAABGcmFua2xpbiBHb3RoaWMgSGVhdnnfAAAA4AAAAP//////////FgAAAEZyYW5rbGluIEdvdGhpYyBNZWRpdW3hAAAA4wAAAP//////////GwAAAEZyYW5rbGluIEdvdGhpYyBNZWRpdW0gQ29uZOIAAAD///////////////8KAAAARnJlZXNpYVVQQ4cCAACGAgAAhAIAAIUCAAAQAAAARnJlZXN0eWxlIFNjcmlwdOYAAAD///////////////8QAAAARnJlbmNoIFNjcmlwdCBNVOgAAAD///////////////8LAAAAR09TVCB0eXBlIEEWAQAA////////////////CwAAAEdPU1QgdHlwZSBCFwEAAP///////////////wgAAABHYWJyaW9sYe4AAAD///////////////8GAAAAR2FkdWdp7wAAAP/////wAAAA/////wgAAABHYXJhbW9uZPIAAAD0AAAA8wAAAP////8HAAAAR2F1dGFtafUAAAD/////9gAAAP////8NAAAAR2VudGl1bSBCYXNpY/oAAAD5AAAA9wAAAPgAAAASAAAAR2VudGl1bSBCb29rIEJhc2lj/gAAAP0AAAD7AAAA/AAAAAcAAABHZW9yZ2lh/wAAAAEBAAAAAQAAAgEAAAQAAABHaWdpBgEAAP///////////////wwAAABHaWxsIFNhbnMgTVQNAQAACgEAAAgBAAAHAQAAFgAAAEdpbGwgU2FucyBNVCBDb25kZW5zZWQJAQAA////////////////HwAAAEdpbGwgU2FucyBNVCBFeHQgQ29uZGVuc2VkIEJvbGQUAQAA////////////////FAAAAEdpbGwgU2FucyBVbHRyYSBCb2xkDAEAAP///////////////x4AAABHaWxsIFNhbnMgVWx0cmEgQm9sZCBDb25kZW5zZWQLAQAA////////////////BQAAAEdpc2hhDgEAAP////8PAQAA/////x0AAABHbG91Y2VzdGVyIE1UIEV4dHJhIENvbmRlbnNlZBMBAAD///////////////8PAAAAR291ZHkgT2xkIFN0eWxlHAEAAB4BAAAdAQAA/////wsAAABHb3VkeSBTdG91dB8BAAD///////////////8FAAAAR3VsaW0gAQAA////////////////CAAAAEd1bGltQ2hlIQEAAP///////////////wcAAABHdW5nc3VoMQAAAP///////////////woAAABHdW5nc3VoQ2hlMgAAAP///////////////w8AAABHdXR0bWFuIEFoYXJvbmnxAAAA////////////////EAAAAEd1dHRtYW4gRHJvZ29saW66AAAA/////7kAAAD/////DQAAAEd1dHRtYW4gRnJhbmsDAQAA/////+UAAAD/////DQAAAEd1dHRtYW4gRnJuZXfnAAAA////////////////DAAAAEd1dHRtYW4gSGFpbQQBAAD///////////////8WAAAAR3V0dG1hbiBIYWltLUNvbmRlbnNlZAUBAAD///////////////8OAAAAR3V0dG1hbiBIYXR6dml2AgAA/////3UCAAD/////CwAAAEd1dHRtYW4gS2F2EgEAAP////8QAQAA/////xEAAABHdXR0bWFuIEthdi1MaWdodBEBAAD///////////////8NAAAAR3V0dG1hbiBMb2dvMY8BAAD///////////////8PAAAAR3V0dG1hbiBNYW50b3ZhpgEAAP////+kAQAA/////xUAAABHdXR0bWFuIE1hbnRvdmEtRGVjb3KlAQAA////////////////DgAAAEd1dHRtYW4gTWlyeWFtugEAAP////+4AQAA/////w8AAABHdXR0bWFuIE15YW1maXgVAQAA////////////////DQAAAEd1dHRtYW4gUmFzaGkWAgAA/////xcCAAD/////DAAAAEd1dHRtYW4gU3RhbU0CAAD///////////////8NAAAAR3V0dG1hbiBTdGFtMU4CAAD///////////////8NAAAAR3V0dG1hbiBWaWxuYaUCAAD/////pgIAAP////8LAAAAR3V0dG1hbiBZYWQlAQAA////////////////EQAAAEd1dHRtYW4gWWFkLUJydXNoJAEAAP///////////////xEAAABHdXR0bWFuIFlhZC1MaWdodCYBAAD///////////////8PAAAAR3V0dG1hbi1BaGFyb25p//////////8CAAAA/////wwAAABHdXR0bWFuLUFyYW0aAAAA////////////////DwAAAEd1dHRtYW4tQ291ck1pcrkBAAD///////////////8JAAAASEdHb3RoaWNFNwEAAP///////////////wkAAABIR0dvdGhpY006AQAA////////////////CwAAAEhHR3lvc2hvdGFpPQEAAP///////////////w0AAABIR0t5b2thc2hvdGFpQAEAAP///////////////xAAAABIR01hcnVHb3RoaWNNUFJPUwEAAP///////////////wkAAABIR01pbmNob0JDAQAA////////////////CQAAAEhHTWluY2hvRUYBAAD///////////////8KAAAASEdQR290aGljRTgBAAD///////////////8KAAAASEdQR290aGljTTsBAAD///////////////8MAAAASEdQR3lvc2hvdGFpPgEAAP///////////////w4AAABIR1BLeW9rYXNob3RhaUEBAAD///////////////8KAAAASEdQTWluY2hvQkQBAAD///////////////8KAAAASEdQTWluY2hvRUcBAAD///////////////8TAAAASEdQU29laUtha3Vnb3RoaWNVQlABAAD///////////////8RAAAASEdQU29laUtha3Vwb3B0YWlKAQAA////////////////EQAAAEhHUFNvZWlQcmVzZW5jZUVCTQEAAP///////////////woAAABIR1NHb3RoaWNFOQEAAP///////////////woAAABIR1NHb3RoaWNNPAEAAP///////////////wwAAABIR1NHeW9zaG90YWk/AQAA////////////////DgAAAEhHU0t5b2thc2hvdGFpQgEAAP///////////////woAAABIR1NNaW5jaG9CRQEAAP///////////////woAAABIR1NNaW5jaG9FSAEAAP///////////////xMAAABIR1NTb2VpS2FrdWdvdGhpY1VCUQEAAP///////////////xEAAABIR1NTb2VpS2FrdXBvcHRhaUsBAAD///////////////8RAAAASEdTU29laVByZXNlbmNlRUJOAQAA////////////////EQAAAEhHU2Vpa2Fpc2hvdGFpUFJPUgEAAP///////////////xIAAABIR1NvZWlLYWt1Z290aGljVUJPAQAA////////////////EAAAAEhHU29laUtha3Vwb3B0YWlJAQAA////////////////EAAAAEhHU29laVByZXNlbmNlRUJMAQAA////////////////DgAAAEhZR290aGljLUV4dHJhKQEAAP///////////////w8AAABIWUdvdGhpYy1NZWRpdW0qAQAA////////////////EAAAAEhZR3JhcGhpYy1NZWRpdW0nAQAA////////////////DQAAAEhZR3VuZ1NvLUJvbGQoAQAA////////////////EQAAAEhZSGVhZExpbmUtTWVkaXVtKwEAAP///////////////xAAAABIWU15ZW9uZ0pvLUV4dHJhLAEAAP///////////////w4AAABIWVBNb2tHYWstQm9sZC4BAAD///////////////8MAAAASFlQb3N0LUxpZ2h0LwEAAP///////////////w0AAABIWVBvc3QtTWVkaXVtMAEAAP///////////////xMAAABIWVNob3J0U2FtdWwtTWVkaXVtMQEAAP///////////////xQAAABIWVNpbk15ZW9uZ0pvLU1lZGl1bS0BAAD///////////////8QAAAASGFldHRlbnNjaHdlaWxlcjQBAAD///////////////8RAAAASGFuV2FuZ01pbmdNZWRpdW2wAgAA////////////////EwAAAEhhcmxvdyBTb2xpZCBJdGFsaWP/////MgEAAP//////////CgAAAEhhcnJpbmd0b24zAQAA////////////////CgAAAEhlYWRsaW5lIFJbAQAA////////////////DwAAAEhpZ2ggVG93ZXIgVGV4dFwBAABdAQAA//////////8GAAAASW1wYWN0XgEAAP///////////////xEAAABJbXByaW50IE1UIFNoYWRvd18BAAD///////////////8OAAAASW5mb3JtYWwgUm9tYW5gAQAA////////////////BwAAAElyaXNVUEOLAgAAigIAAIgCAACJAgAADAAAAElza29vbGEgUG90YWEBAAD/////YgEAAP////8SAAAASXRhbGljIE91dGxpbmUgQXJ0ZgEAAP///////////////woAAABKYXNtaW5lVVBDjwIAAI4CAACMAgAAjQIAAAgAAABKb2tlcm1hbmcBAAD///////////////8JAAAASnVpY2UgSVRDaAEAAP///////////////wUAAABLYWlUaT4CAAD///////////////8HAAAAS2FsaW5nYWoBAAD/////awEAAP////8HAAAAS2FydGlrYWwBAAD/////bQEAAP////8IAAAAS2htZXIgVUlwAQAA/////3EBAAD/////DAAAAEtvZGNoaWFuZ1VQQ5MCAACSAgAAkAIAAJECAAAGAAAAS29raWxhcgEAAHUBAABzAQAAdAEAAAsAAABLcmlzdGVuIElUQ2UBAAD///////////////8VAAAAS3VmaSBFeHRlbmRlZCBPdXRsaW5lbgEAAP///////////////xMAAABLdWZpIE91dGxpbmUgU2hhZGVkbwEAAP///////////////w8AAABLdW5zdGxlciBTY3JpcHR3AQAA////////////////BgAAAExhbyBVSXgBAAD/////eQEAAP////8FAAAATGF0aGF6AQAA/////3sBAAD/////DwAAAExlZCBJdGFsaWMgRm9udIIBAAD///////////////8KAAAATGVlbGF3YWRlZYMBAAD/////hAEAAP////8KAAAATGV2ZW5pbSBNVJkBAAD/////mgEAAP////8EAAAATGlTdT8CAAD///////////////8HAAAATGlseVVQQ5cCAACWAgAAlAIAAJUCAAAHAAAATG9ic3RlcooBAAD///////////////8LAAAATG9ic3RlciAxLjSKAQAA////////////////CwAAAExvYnN0ZXIgVHdvjgEAAI0BAACLAQAAjAEAAA0AAABMdWNpZGEgQnJpZ2h0fQEAAIABAAB+AQAAfwEAABIAAABMdWNpZGEgQ2FsbGlncmFwaHmBAQAA////////////////DgAAAEx1Y2lkYSBDb25zb2xlmAEAAP///////////////woAAABMdWNpZGEgRmF4hQEAAIgBAACGAQAAhwEAABIAAABMdWNpZGEgSGFuZHdyaXRpbmeJAQAA////////////////CwAAAEx1Y2lkYSBTYW5zkAEAAJMBAACRAQAAkgEAABYAAABMdWNpZGEgU2FucyBUeXBld3JpdGVylAEAAJcBAACVAQAAlgEAABMAAABMdWNpZGEgU2FucyBVbmljb2RlmwEAAP///////////////wkAAABNUyBHb3RoaWPEAQAA////////////////CQAAAE1TIE1pbmNob8sBAAD///////////////8KAAAATVMgT3V0bG9va/MBAAD///////////////8KAAAATVMgUEdvdGhpY8YBAAD///////////////8KAAAATVMgUE1pbmNob8wBAAD///////////////8XAAAATVMgUmVmZXJlbmNlIFNhbnMgU2VyaWYZAgAA////////////////FgAAAE1TIFJlZmVyZW5jZSBTcGVjaWFsdHkaAgAA////////////////DAAAAE1TIFVJIEdvdGhpY8UBAAD///////////////8HAAAATVYgQm9sadcBAAD///////////////8HAAAATWFnaWMgUloBAAD///////////////8HAAAATWFnbmV0b///////////nAEAAP////8LAAAATWFpYW5kcmEgR0SdAQAA////////////////DQAAAE1hbGd1biBHb3RoaWOgAQAA/////6EBAAD/////BgAAAE1hbmdhbKIBAAD/////owEAAP////8HAAAATWFybGV0dKcBAAD///////////////8ZAAAATWF0dXJhIE1UIFNjcmlwdCBDYXBpdGFsc6gBAAD///////////////8GAAAATWVpcnlvqQEAAKoBAACtAQAArgEAAAkAAABNZWlyeW8gVUmrAQAArAEAAK8BAACwAQAAEgAAAE1pY3Jvc29mdCBIaW1hbGF5YVQBAAD///////////////8SAAAATWljcm9zb2Z0IEpoZW5nSGVpxwEAAP/////JAQAA/////xUAAABNaWNyb3NvZnQgSmhlbmdIZWkgVUnIAQAA/////8oBAAD/////FQAAAE1pY3Jvc29mdCBOZXcgVGFpIEx1Zd4BAAD/////3wEAAP////8RAAAATWljcm9zb2Z0IFBoYWdzUGECAgAA/////wMCAAD/////FAAAAE1pY3Jvc29mdCBTYW5zIFNlcmlmsQEAAP///////////////xAAAABNaWNyb3NvZnQgVGFpIExlXgIAAP////9fAgAA/////xAAAABNaWNyb3NvZnQgVWlnaHVyzgEAAP/////NAQAA/////w8AAABNaWNyb3NvZnQgWWFIZWnPAQAA/////9EBAAD/////EgAAAE1pY3Jvc29mdCBZYUhlaSBVSdABAAD/////0gEAAP////8SAAAATWljcm9zb2Z0IFlpIEJhaXRp0wEAAP///////////////wcAAABNaW5nTGlVsgEAAP///////////////wwAAABNaW5nTGlVLUV4dEK1AQAA////////////////DQAAAE1pbmdMaVVfSEtTQ1O0AQAA////////////////EgAAAE1pbmdMaVVfSEtTQ1MtRXh0QrcBAAD///////////////8GAAAATWlyaWFtwAEAAP///////////////wwAAABNaXJpYW0gRml4ZWTBAQAA////////////////EgAAAE1pcmlhbSBUcmFuc3BhcmVudMMBAAD///////////////8HAAAATWlzdHJhbLsBAAD///////////////8NAAAATW9kZXJuIE5vLiAyML0BAAD///////////////8IAAAATW9ldW1UIFJVAQAA////////////////DwAAAE1vbmdvbGlhbiBCYWl0ab4BAAD///////////////8QAAAATW9ub3R5cGUgQ29yc2l2Yf/////UAQAA//////////8RAAAATW9ub3R5cGUgSGFkYXNzYWg1AQAA/////zYBAAD/////DgAAAE1vbm90eXBlIEtvdWZp/////3YBAAD//////////w4AAABNb25vdHlwZSBTb3J0c9UBAAD///////////////8JAAAATW9vbEJvcmFuvwEAAP///////////////wgAAABNdWRpciBNVP/////WAQAA//////////8MAAAATXlhbm1hciBUZXh0vAEAAP///////////////wcAAABOU2ltU3VuRAIAAP///////////////wgAAABOYXJraXNpbd0BAAD///////////////8JAAAATmV3IEd1bGlt2AEAAP///////////////xAAAABOaWFnYXJhIEVuZ3JhdmVk2QEAAP///////////////w0AAABOaWFnYXJhIFNvbGlk2gEAAP///////////////woAAABOaXJtYWxhIFVJ2wEAAP/////cAQAA/////wUAAABOeWFsYeABAAD///////////////8OAAAAT0NSIEEgRXh0ZW5kZWThAQAA////////////////BAAAAE9DUkLiAQAA////////////////DgAAAE9sZCBBbnRpYyBCb2xk4wEAAP///////////////xQAAABPbGQgQW50aWMgRGVjb3JhdGl2ZeQBAAD///////////////8RAAAAT2xkIEFudGljIE91dGxpbmXlAQAA////////////////GAAAAE9sZCBBbnRpYyBPdXRsaW5lIFNoYWRlZOcBAAD///////////////8TAAAAT2xkIEVuZ2xpc2ggVGV4dCBNVOYBAAD///////////////8EAAAAT255eOgBAAD///////////////8JAAAAT3BlbiBTYW5z7wEAAO4BAADpAQAA6gEAABMAAABPcGVuIFNhbnMgQ29uZGVuc2Vk///////////rAQAA/////xkAAABPcGVuIFNhbnMgQ29uZGVuc2VkIExpZ2h07AEAAO0BAAD//////////woAAABPcGVuU3ltYm9s8AEAAP///////////////wYAAABPc3dhbGTyAQAA//////EBAAD/////CAAAAFBNaW5nTGlVswEAAP///////////////w0AAABQTWluZ0xpVS1FeHRCtgEAAP///////////////wwAAABQVCBCb2xkIEFyY2gIAgAA////////////////DgAAAFBUIEJvbGQgQnJva2VuCQIAAP///////////////w0AAABQVCBCb2xkIER1c2t5CgIAAP///////////////w8AAABQVCBCb2xkIEhlYWRpbmcLAgAA////////////////DgAAAFBUIEJvbGQgTWlycm9yDAIAAP///////////////w0AAABQVCBCb2xkIFN0YXJzDQIAAP///////////////wcAAABQVCBTYW5zEgIAABECAAAPAgAAEAIAABMAAABQVCBTZXBhcmF0ZWQgQmFsb29uDgIAAP///////////////xQAAABQVCBTaW1wbGUgQm9sZCBSdWxlZEkCAAD///////////////8IAAAAUGFjaWZpY2/0AQAA////////////////EAAAAFBhbGFjZSBTY3JpcHQgTVT/////+QEAAP//////////EQAAAFBhbGF0aW5vIExpbm90eXBl9QEAAPgBAAD2AQAA9wEAAAcAAABQYXB5cnVz+gEAAP///////////////wkAAABQYXJjaG1lbnT7AQAA////////////////CAAAAFBlcnBldHVhAQIAAP4BAAD9AQAA/AEAABMAAABQZXJwZXR1YSBUaXRsaW5nIE1UAAIAAP//////AQAA/////xQAAABQbGFudGFnZW5ldCBDaGVyb2tlZQQCAAD///////////////8IAAAAUGxheWJpbGwFAgAA////////////////DAAAAFBvb3IgUmljaGFyZAYCAAD///////////////8IAAAAUHJpc3RpbmEHAgAA////////////////CAAAAFB5dW5qaSBSWAEAAP///////////////wUAAABSYWF2aRMCAAD/////FAIAAP////8LAAAAUmFnZSBJdGFsaWMVAgAA////////////////BQAAAFJhdmllGAIAAP///////////////wgAAABSb2Nrd2VsbB0CAAAhAgAAHgIAAB8CAAASAAAAUm9ja3dlbGwgQ29uZGVuc2VkHAIAAP////8bAgAA/////xMAAABSb2Nrd2VsbCBFeHRyYSBCb2xkIAIAAP///////////////wMAAABSb2QiAgAA////////////////DwAAAFJvZCBUcmFuc3BhcmVudCMCAAD///////////////8IAAAAU1RDYWl5dW5PAgAA////////////////CgAAAFNURmFuZ3NvbmdRAgAA////////////////BgAAAFNUSHVwb1ICAAD///////////////8HAAAAU1RLYWl0aVMCAAD///////////////8GAAAAU1RMaXRpVAIAAP///////////////wYAAABTVFNvbmdVAgAA////////////////BwAAAFNUWGloZWlWAgAA////////////////CQAAAFNUWGluZ2thaVcCAAD///////////////8IAAAAU1RYaW53ZWlYAgAA////////////////CwAAAFNUWmhvbmdzb25nWQIAAP///////////////w4AAABTYWtrYWwgTWFqYWxsYZ4BAAD/////nwEAAP////8OAAAAU2NyaXB0IE1UIEJvbGQnAgAA////////////////CwAAAFNlZ29lIFByaW50KAIAAP////8pAgAA/////wwAAABTZWdvZSBTY3JpcHQqAgAA/////ysCAAD/////CAAAAFNlZ29lIFVJLAIAAC4CAAAtAgAAMQIAAA4AAABTZWdvZSBVSSBMaWdodC8CAAAyAgAA//////////8RAAAAU2Vnb2UgVUkgU2VtaWJvbGQzAgAANAIAAP//////////EgAAAFNlZ29lIFVJIFNlbWlsaWdodDACAAA1AgAA//////////8PAAAAU2Vnb2UgVUkgU3ltYm9sNgIAAP///////////////w0AAABTaG9uYXIgQmFuZ2xhNwIAAP////84AgAA/////w8AAABTaG93Y2FyZCBHb3RoaWM5AgAA////////////////BgAAAFNocnV0aToCAAD/////OwIAAP////8GAAAAU2ltSGVpPQIAAP///////////////wYAAABTaW1TdW5DAgAA////////////////CwAAAFNpbVN1bi1FeHRCRQIAAP///////////////xMAAABTaW1wbGUgQm9sZCBKdXQgT3V0SAIAAP///////////////xUAAABTaW1wbGUgSW5kdXN0IE91dGxpbmVKAgAA////////////////FAAAAFNpbXBsZSBJbmR1c3QgU2hhZGVkSwIAAP///////////////xIAAABTaW1wbGUgT3V0bGluZSBQYXRMAgAA////////////////EQAAAFNpbXBsaWZpZWQgQXJhYmljQgIAAP////9AAgAA/////xcAAABTaW1wbGlmaWVkIEFyYWJpYyBGaXhlZEECAAD///////////////8IAAAAU25hcCBJVENHAgAA////////////////BwAAAFN0ZW5jaWxQAgAA////////////////BwAAAFN5bGZhZW5aAgAA////////////////BgAAAFN5bWJvbFsCAAD///////////////8GAAAAVGFob21hXAIAAP////9dAgAA/////wkAAABUYWxsIFBhdWxgAgAA////////////////DwAAAFRlbXB1cyBTYW5zIElUQ2gCAAD///////////////8PAAAAVGltZXMgTmV3IFJvbWFuaQIAAGwCAABqAgAAawIAABIAAABUcmFkaXRpb25hbCBBcmFiaWNuAgAA/////20CAAD/////DAAAAFRyZWJ1Y2hldCBNU28CAAByAgAAcAIAAHECAAAFAAAAVHVuZ2FzAgAA/////3QCAAD/////CQAAAFR3IENlbiBNVGcCAABmAgAAYgIAAGECAAATAAAAVHcgQ2VuIE1UIENvbmRlbnNlZGUCAAD/////YwIAAP////8eAAAAVHcgQ2VuIE1UIENvbmRlbnNlZCBFeHRyYSBCb2xkZAIAAP///////////////wYAAABVYnVudHV6AgAAeQIAAHcCAAB4AgAAEAAAAFVidW50dSBDb25kZW5zZWR7AgAA////////////////EAAAAFVyZHUgVHlwZXNldHRpbmeYAgAA////////////////BgAAAFV0c2FhaJkCAACcAgAAmgIAAJsCAAAEAAAAVmFuaZ0CAAD/////ngIAAP////8HAAAAVmVyZGFuYZ8CAAChAgAAoAIAAKICAAAGAAAAVmlqYXlhowIAAP////+kAgAA/////w4AAABWaW5lciBIYW5kIElUQ6cCAAD///////////////8HAAAAVml2YWxkaf////+oAgAA//////////8PAAAAVmxhZGltaXIgU2NyaXB0qQIAAP///////////////wYAAABWcmluZGGqAgAA/////6sCAAD/////CAAAAFdlYmRpbmdzrAIAAP///////////////woAAABXaWRlIExhdGlufAEAAP///////////////wkAAABXaW5nZGluZ3OtAgAA////////////////CwAAAFdpbmdkaW5ncyAyrgIAAP///////////////wsAAABXaW5nZGluZ3MgM68CAAD///////////////8FAAAAWWV0IFJXAQAA////////////////BwAAAFlvdVl1YW5GAgAA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAAAAFQAAAC4AAABJAAAAaAAAAHQAAACIAAAAtwAAAOUAAADrAAAA7gAAAPgAAAAKAQAAOQEAAEABAABNAQAA/////2QBAABsAQAAjwEAAJkBAACdAQAApAEAAP////+pAQAA/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////1sAAAAdAAAASEdQ5Ym16Iux6KeS7726776e7728772v7724VUJQAQAA////////////////HgAAAEhHUOWJteiLseinku++ju++n++9r+++jO++n+S9k0oBAAD///////////////8gAAAASEdQ5Ym16Iux776M776f776a772+776e776d7729RUJNAQAA////////////////DwAAAEhHUOaVmeenkeabuOS9k0EBAAD///////////////8KAAAASEdQ5piO5pydQkQBAAD///////////////8KAAAASEdQ5piO5pydRUcBAAD///////////////8MAAAASEdQ6KGM5pu45L2TPgEAAP///////////////xMAAABIR1Dvvbrvvp7vvbzvva/vvbhFOAEAAP///////////////xMAAABIR1Dvvbrvvp7vvbzvva/vvbhNOwEAAP///////////////x0AAABIR1PlibXoi7Hop5Lvvbrvvp7vvbzvva/vvbhVQlEBAAD///////////////8eAAAASEdT5Ym16Iux6KeS776O776f772v776M776f5L2TSwEAAP///////////////yAAAABIR1PlibXoi7Hvvozvvp/vvprvvb7vvp7vvp3vvb1FQk4BAAD///////////////8PAAAASEdT5pWZ56eR5pu45L2TQgEAAP///////////////woAAABIR1PmmI7mnJ1CRQEAAP///////////////woAAABIR1PmmI7mnJ1FSAEAAP///////////////wwAAABIR1PooYzmm7jkvZM/AQAA////////////////EwAAAEhHU++9uu++nu+9vO+9r++9uEU5AQAA////////////////EwAAAEhHU++9uu++nu+9vO+9r++9uE08AQAA////////////////GQAAAEhH5Li47726776e7728772v7724TS1QUk9TAQAA////////////////HAAAAEhH5Ym16Iux6KeS7726776e7728772v7724VUJPAQAA////////////////HQAAAEhH5Ym16Iux6KeS776O776f772v776M776f5L2TSQEAAP///////////////x8AAABIR+WJteiLse++jO++n+++mu+9vu++nu++ne+9vUVCTAEAAP///////////////w4AAABIR+aVmeenkeabuOS9k0ABAAD///////////////8JAAAASEfmmI7mnJ1CQwEAAP///////////////wkAAABIR+aYjuacnUVGAQAA////////////////EgAAAEhH5q2j5qW35pu45L2TLVBST1IBAAD///////////////8LAAAASEfooYzmm7jkvZM9AQAA////////////////EgAAAEhH7726776e7728772v7724RTcBAAD///////////////8SAAAASEfvvbrvvp7vvbzvva/vvbhNOgEAAP///////////////wsAAABIWeqyrOqzoOuUlSkBAAD///////////////8LAAAASFnqsqzrqoXsobAsAQAA////////////////CQAAAEhZ6raB7IScQigBAAD///////////////8MAAAASFnqt7jrnpjtlL1NJwEAAP///////////////w8AAABIWeuqqeqwge2MjOyehEIuAQAA////////////////CwAAAEhZ7Iug66qF7KGwLQEAAP///////////////w8AAABIWeyWleydgOyDmOusvE0xAQAA////////////////CQAAAEhZ7Je97IScTC8BAAD///////////////8JAAAASFnsl73shJxNMAEAAP///////////////wsAAABIWeykkeqzoOuUlSoBAAD///////////////8PAAAASFntl6Trk5zrnbzsnbhNKwEAAP///////////////wwAAADjg6HjgqTjg6rjgqqpAQAAqgEAAK0BAACuAQAABgAAAOS7v+WuizwCAAD///////////////8MAAAA5Y2O5paH5Lit5a6LWQIAAP///////////////wwAAADljY7mlofku7/lrotRAgAA////////////////DAAAAOWNjuaWh+Wui+S9k1UCAAD///////////////8MAAAA5Y2O5paH5b2p5LqRTwIAAP///////////////wwAAADljY7mlofmlrDprY9YAgAA////////////////DAAAAOWNjuaWh+alt+S9k1MCAAD///////////////8MAAAA5Y2O5paH55Cl54+AUgIAAP///////////////wwAAADljY7mlofnu4bpu5FWAgAA////////////////DAAAAOWNjuaWh+ihjOalt1cCAAD///////////////8MAAAA5Y2O5paH6Zq25LmmVAIAAP///////////////wYAAADlrovkvZNDAgAA////////////////BgAAAOW5vOWchkYCAAD///////////////8PAAAA5b6u6Luf5q2j6buR6auUxwEAAP/////JAQAA/////wwAAADlvq7ova/pm4Xpu5HPAQAA/////9EBAAD/////CQAAAOaWsOWui+S9k0QCAAD///////////////8MAAAA5paw57Sw5piO6auUswEAAP///////////////xEAAADmlrDntLDmmI7pq5QtRXh0QrYBAAD///////////////8MAAAA5pa55q2j5aea5L2T7QAAAP///////////////wwAAADmlrnmraPoiJLkvZPsAAAA////////////////BgAAAOalt+S9kz4CAAD///////////////8JAAAA5qiZ5qW36auUaQEAAP///////////////xUAAADnjovmvKLlrpfkuK3mmI7pq5TnuYGwAgAA////////////////CQAAAOe0sOaYjumrlLIBAAD///////////////8OAAAA57Sw5piO6auULUV4dEK1AQAA////////////////DwAAAOe0sOaYjumrlF9IS1NDU7QBAAD///////////////8UAAAA57Sw5piO6auUX0hLU0NTLUV4dEK3AQAA////////////////BgAAAOmatuS5pj8CAAD///////////////8GAAAA6buR5L2TPQIAAP///////////////wYAAADqtbTrprwgAQAA////////////////CQAAAOq1tOumvOyytCEBAAD///////////////8GAAAA6raB7IScMQAAAP///////////////wkAAADqtoHshJzssrQyAAAA////////////////BgAAAOuPi+ybgCIBAAD///////////////8JAAAA64+L7JuA7LK0IwEAAP///////////////w0AAADrp5HsnYAg6rOg65SVoAEAAP////+hAQAA/////wYAAADrsJTtg5UvAAAA////////////////CQAAAOuwlO2DleyytDAAAAD///////////////8JAAAA7IOI6rW066a82AEAAP///////////////xgAAADtnLTrqLzrkaXqt7ztl6Trk5zrnbzsnbhbAQAA////////////////DwAAAO2ctOuovOunpOyngeyytFoBAAD///////////////8NAAAA7Zy066i866qo7J2MVFUBAAD///////////////8PAAAA7Zy066i87JWE66+47LK0WQEAAP///////////////w8AAADtnLTrqLzsl5HsiqTtj6xWAQAA////////////////DAAAAO2ctOuovOyYm+yytFcBAAD///////////////8PAAAA7Zy066i87Y647KeA7LK0WAEAAP///////////////xMAAADvvK3vvLMg44K044K344OD44KvxAEAAP///////////////w0AAADvvK3vvLMg5piO5pydywEAAP///////////////xYAAADvvK3vvLMg77yw44K044K344OD44KvxgEAAP///////////////xAAAADvvK3vvLMg77yw5piO5pydzAEAAP///////////////7ECAAAJAAAAQWdlbmN5IEZCAAAAAAEAAAAAAAAAAAAAAAILCAQCAgICAgQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgMAAAgBAFUB/AJM/1AAAAAAAAkAAABBZ2VuY3kgRkIAAAAAAAAAAAAAAAAAAAAAAgsFAwICAgICBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABAwAACAEAPAH8Akz/UAAAAAAADwAAAEd1dHRtYW4tQWhhcm9uaQAAAAABAAAAAAAAAAAAAAACAQcBAQEBAQEBABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAvAIFAAAAAQCMAeoCsP4AAAAAAAAHAAAAQWhhcm9uaQAAAAABAAAAAAAAAAAAAAACAQgDAgEEAwIDAQgAAAAAAAAAAAAAAAAAACAAAAAAACAAvAIFAAAAAQDdAd4C9/4AAAAAAAAJAAAAQWtoYmFyIE1UAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAACQAQUAAAABAJgBEQJi/n0AAAAAAAkAAABBa2hiYXIgTVQAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAALwCBQAAAAEAqQErApH+kwAAAAAABwAAAEFsZGhhYmkAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAG8gAKBLgACQAAAAAAAAAABBAAAAAAAAAJABBQAAAAEA/wGDApz+7gIGAYIBCAAAAEFsZ2VyaWFuAAAAAAAAAAAAAAAAAAAAAAQCBwUECgIGBwIDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQIAAAABAB0CeAMh/9AAAAAAAAcAAABBbmRhbHVzAAAAAAAAAAAAAAAAAAAAAAICBgMFBAUCAwQDIAAAAAAAgAgAAAAAAAAAQQAAAAAACCCQAQUAAAABANkBUARb/gAA/gHHAgsAAABBbmdzYW5hIE5ldwAAAAAAAAAAAAAAAAAAAAACAgYDBQQFAgMEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAUBAQAIAZoDEf8AABsBtQELAAAAQW5nc2FuYSBOZXcAAAAAAQAAAAAAAAAAAAAAAgIIAwcFBQIDBAMAAIEAAAAAAAAAAAAAAAABAAEAAAAAALwCBQAFAQEAGQF4AxH/AAAbAbUBCwAAAEFuZ3NhbmEgTmV3AAAAAAAAAAABAAAAAAAAAAICBQMFBAUJAwQDAACBAAAAAAAAAAAAAAAAAQABAAAAAACQAQUABQEBAAkBmwMR/wAAGwG1AQoAAABBbmdzYW5hVVBDAAAAAAAAAAAAAAAAAAAAAAICBgMFBAUCAwQDAACBAAAAAAAAAAAAAAAAAQABAAAAAACQAQUABQEBAAgBmgMR/wAAGwG1AQoAAABBbmdzYW5hVVBDAAAAAAEAAAAAAAAAAAAAAAICCAMHBQUCAwQDAACBAAAAAAAAAAAAAAAAAQABAAAAAAC8AgUABQEBABkBeAMR/wAAGwG1AQoAAABBbmdzYW5hVVBDAAAAAAAAAAABAAAAAAAAAAICBQMFBAUJAwQDAACBAAAAAAAAAAAAAAAAAQABAAAAAACQAQUABQEBAAkBmwMR/wAAGwG1AQoAAABBbmdzYW5hVVBDAAAAAAEAAAABAAAAAAAAAAICBwMGBQUJAwQDAACBAAAAAAAAAAAAAAAAAQABAAAAAAC8AgUABQEBAA8BnwMy/wAAGwG1AQsAAABBbmdzYW5hIE5ldwAAAAABAAAAAQAAAAAAAAACAgcDBgUFCQMEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAvAIFAAUBAQAPAZ8DMv8AABsBtQEMAAAAQm9vayBBbnRpcXVhAAAAAAEAAAAAAAAAAAAAAAIEBwIFAwUDAwSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+8AgUABAEBAMoB1gL3/k4AAAAAAAwAAABCb29rIEFudGlxdWEAAAAAAQAAAAEAAAAAAAAAAgQHAgYDBQoCBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX37wCBQAEAQEAvgHZAu7+QAAAAAAADAAAAEJvb2sgQW50aXF1YQAAAAAAAAAAAQAAAAAAAAACBAUCBQMFCgMEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffkAEFAAQBAQCQAdUC6f5AAAAAAAAJAAAAQXBhcmFqaXRhAAAAAAAAAAAAAAAAAAAAAAILBgQCAgICAgQDgAAAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAO8B3AIO/18AZwEVAgkAAABBcGFyYWppdGEAAAAAAQAAAAAAAAAAAAAAAgsIBAICAgICBAOAAAAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAAAAEACgLcAg7/XwBvARUCCQAAAEFwYXJhaml0YQAAAAABAAAAAQAAAAAAAAACCwgEAgICAgIEA4AAAAAAAAAAAAAAAAAAAAEAAAAAAAAAvAIFAAAAAQAGAtwCDv9fAGwBFQIJAAAAQXBhcmFqaXRhAAAAAAAAAAABAAAAAAAAAAILBgQCAgICAgQDgAAAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAO0B3AIO/18AYwEVAg0AAABBR0EgQXJhYmVzcXVlAAAAAAAAAAAAAAAAAAAAAAUBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAACQAQUAAAwBACcCAgPNABcAAAAAABIAAABBcmFiaWMgVHlwZXNldHRpbmcAAAAAAAAAAAAAAAAAAAAAAwIEAgQEBgMCA28gAKAAAADACAAAAAAAAADTAAAgAAAAAJABBQAAAAEAGwEPAqv+AAD0AbwCDAAAAEd1dHRtYW4tQXJhbQAAAAAAAAAAAAAAAAAAAAACAQQBAQEBAQEBABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAkAEFAAAAAQB2AeoCsP4AAAAAAAAVAAAAQUdBIEFyYWJlc3F1ZSBEZXNrdG9wAAAAAAAAAAAAAAAAAAAAAAUBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAACQAQUAAAABAK4D9AH0AQAAAAAAAAUAAABBcmlhbAAAAAAAAAAAAAAAAAAAAAACCwYEAgICAgIE/yoA4EN4AMAJAAAAAAAAAP8BAEAAAP//kAEFAAUIAQC5AdgCLv+VAAYCzAIFAAAAQXJpYWwAAAAAAQAAAAAAAAAAAAAAAgsHBAICAgICBP8qAOBDeADACQAAAAAAAAD/AQBAAAD//7wCBQAFCAEA3gHYAi7/lQAGAssCBQAAAEFyaWFsAAAAAAEAAAABAAAAAAAAAAILBwQCAgIJAgT/CgDgQ3gAAAEAAAAAAAAAvwEAQAAA99+8AgUABQgBAN4B2AIu/5UABgLLAgUAAABBcmlhbAAAAAAAAAAAAQAAAAAAAAACCwYEAgICCQIE/woA4EN4AAABAAAAAAAAAL8BAEAAAPffkAEFAAUIAQC5AdgCMf+VAAYCywIMAAAAQXJpYWwgTmFycm93AAAAAAAAAAAAAAAAAAAAAAILBgYCAgIDAgSHAgAAAAgAAAAAAAAAAAAAnwAAIAAA19+QAQMABQgBAGkB2AIu/4MAAAAAAAwAAABBcmlhbCBOYXJyb3cAAAAAAQAAAAAAAAAAAAAAAgsHBgICAgMCBIcCAAAACAAAAAAAAAAAAACfAAAgAADX37wCAwAFCAEAiAHYAi7/gwAAAAAADAAAAEFyaWFsIE5hcnJvdwAAAAABAAAAAQAAAAAAAAACCwcGAgICCgIEhwIAAAAIAAAAAAAAAAAAAJ8AACAAANffvAIDAAUIAQCIAdgCLv+DAAAAAAAMAAAAQXJpYWwgTmFycm93AAAAAAAAAAABAAAAAAAAAAILBgYCAgIKAgSHAgAAAAgAAAAAAAAAAAAAnwAAIAAA19+QAQMABQgBAGkB2AIx/4YAAAAAABAAAABBcmlhbCBVbmljb2RlIE1TAAAAAAAAAAAAAAAAAAAAAAILBgQCAgICAgT/////////6T8AAAAAAAAA/wE/YAAA//+QAQUABQgBALkB2AIv/4MAAAAAAAsAAABBcmlhbCBCbGFjawAAAAAAAAAAAAAAAAAAAAACCwoEAgECAgIErwIAoPt4AEAAAAAAAAAAAJ8AAGAAANffhAMFAAUIAQAoAssC0wCOAAYCywIVAAAAQXJpYWwgUm91bmRlZCBNVCBCb2xkAAAAAAAAAAAAAAAAAAAAAAIPBwQDBQQDAgQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUABQgBAOMB2AIv/4MAAAAAABIAAABBcmFiaWMgVHJhbnNwYXJlbnQAAAAAAQAAAAAAAAAAAAAAAgEAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAABAAAAAAAAAALwCBQAAAAEAuQFRA7r+AAAAAAAAEgAAAEFyYWJpYyBUcmFuc3BhcmVudAAAAAAAAAAAAAAAAAAAAAACAQAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQCYAVEDuv4AAAAAAAAEAAAAQXJ2bwAAAAABAAAAAAAAAAAAAAACAAAAAAAAAAAAJwAAgEAAAAgAAAAUAAAAAAEAAAAAAAAAvAIFAAAAAQAFAvcCG/81APkB5AIEAAAAQXJ2bwAAAAABAAAAAQAAAAAAAAACAAAAAAAAAAAAJwAAgEEAAAAAAAAAAAAAABEBACAAAABAvAIFAAAAAQAGAvcCG/81APkB5AIEAAAAQXJ2bwAAAAAAAAAAAQAAAAAAAAACAAAAAAAAAAAApwAAgEEAAAAAAAAAAAAAABEBACAAAABAkAEFAAAAAQD0AfcCG/81APkB5AIEAAAAQXJ2bwAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAApwAAgEEAAAAAAAAAAAAAABEBACAAAABAkAEFAAAAAQDYAfcCG/81APkB5AIIAAAAQXN0b24tRjEAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJABBQAAAAEAWgDVAQAAAAAAAAAAFAAAAEJhc2tlcnZpbGxlIE9sZCBGYWNlAAAAAAAAAAAAAAAAAAAAAAICBgIIBQUCAwMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAAABAIgBrwJO/8sAAAAAAAYAAABCYXRhbmcAAAAAAAAAAAAAAAAAAAAAAgMGAAABAQEBAa8CALD7fNdpMAAAAAAAAACfAAhAAADX35ABBQAFAQEA9AFaA3P/lAAAAAAACQAAAEJhdGFuZ0NoZQEAAAAAAAAAAAAAAAQAAAACAwYJAAEBAQEBrwIAsPt812kwAAAAAAAAAJ8ACEAAANffkAEFAAUBAQD0AVoDc/+UAAAAAAAHAAAAR3VuZ3N1aAIAAAAAAAAAAAAAAAAAAAACAwYAAAEBAQEBrwIAsPt812kwAAAAAAAAAJ8ACEAAANffkAEFAAUBAQD0AVoDc/+UAAAAAAAKAAAAR3VuZ3N1aENoZQMAAAAAAAAAAAAAAAQAAAACAwYJAAEBAQEBrwIAsPt812kwAAAAAAAAAJ8ACEAAANffkAEFAAUBAQD0AVoDc/+UAAAAAAAKAAAAQmF1aGF1cyA5MwAAAAAAAAAAAAAAAAAAAAAEAwkFAgsCAgwCAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAAAAQC7AYIDGP9IAQAAAAAHAAAAQmVsbCBNVAAAAAAAAAAAAAAAAAAAAAACAgUDBgMFAgMDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAECAQCXAZwC9v6GAAAAAAAHAAAAQmVsbCBNVAAAAAABAAAAAAAAAAAAAAACAwcDBgUKAgMDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAvAIFAAECAQC2AZsC+P6JAAAAAAAHAAAAQmVsbCBNVAAAAAAAAAAAAQAAAAAAAAACAwYDBgUKCQIDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAECAQBuAZ0C9v6GAAAAAAAUAAAAQmVybmFyZCBNVCBDb25kZW5zZWQAAAAAAAAAAAAAAAAAAAAAAgUIBgYJBQIEBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABAwAFBAEAgwElA4j/jwAAAAAAGgAAAEJpY2toYW0gU2NyaXB0IFBybyBSZWd1bGFyAAAAAAEAAAAAAAAAAAAAAAMDCAIEBwcNDQavAACASyAAUAAAAAAAAAAAkwAAAAAAAAC8AgUAAAACABUCqALA/sgAfgLuAgwAAABCb29rIEFudGlxdWEAAAAAAAAAAAAAAAAAAAAAAgQGAgUDBQMDBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABBQAEAQEAvQHXAub+PAAAAAAADwAAAEJvbGQgSXRhbGljIEFydAAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQCNAu0FOAIAAAAAAAAJAAAAQm9kb25pIE1UAAAAAAEAAAAAAAAAAAAAAAIHCAMIBgYCAgMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgUAAQMBAJgBmAIA/5QAAAAAAAkAAABCb2RvbmkgTVQAAAAAAQAAAAEAAAAAAAAAAgcIAwgGBgkCAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAALwCBQABAwEAywGaAgH/kgAAAAAADwAAAEJvZG9uaSBNVCBCbGFjawAAAAAAAAAAAQAAAAAAAAACBwoDCAYGCQIDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAhAMFAAEDAQAfApQCL//HAAAAAAAPAAAAQm9kb25pIE1UIEJsYWNrAAAAAAAAAAAAAAAAAAAAAAIHCgMIBgYCAgMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACEAwUAAQMBAP0BnQIc/6sAAAAAABMAAABCb2RvbmkgTVQgQ29uZGVuc2VkAAAAAAEAAAAAAAAAAAAAAAIHCAYIBgYCAgMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgMAAQMBAFABgwIt/9YAAAAAABMAAABCb2RvbmkgTVQgQ29uZGVuc2VkAAAAAAEAAAABAAAAAAAAAAIHCAYIBgYJAgMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgMAAQMBAFIBgwIt/9YAAAAAABMAAABCb2RvbmkgTVQgQ29uZGVuc2VkAAAAAAAAAAABAAAAAAAAAAIHBgYIBgYJAgMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQMAAQMBAB8BgwIt/9YAAAAAABMAAABCb2RvbmkgTVQgQ29uZGVuc2VkAAAAAAAAAAAAAAAAAAAAAAIHBgYIBgYCAgMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQMAAQMBABwBgwIt/9YAAAAAAAkAAABCb2RvbmkgTVQAAAAAAAAAAAEAAAAAAAAAAgcGAwgGBgkCAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQABAwEAhQGaAgb/lwAAAAAAGwAAAEJvZG9uaSBNVCBQb3N0ZXIgQ29tcHJlc3NlZAAAAAAAAAAAAAAAAAAAAAACBwcGCAYBBQIEAwAAAAAAAAAAAAAAAAAAABEAACAAAAAALAECAAEDAQDvAOQCS/+TAAAAAAAJAAAAQm9kb25pIE1UAAAAAAAAAAAAAAAAAAAAAAIHBgMIBgYCAgMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAQMBAKEBlgL+/pQAAAAAABEAAABCb29rbWFuIE9sZCBTdHlsZQAAAAAAAAAAAAAAAAAAAAACBQYEBQUFAgIEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffLAEFAAUBAQDsAcwCH/+AAAAAAAARAAAAQm9va21hbiBPbGQgU3R5bGUAAAAAAQAAAAAAAAAAAAAAAgUIBAQFBQICBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX31gCBQAFAQEADgLMAiH/gQAAAAAAEQAAAEJvb2ttYW4gT2xkIFN0eWxlAAAAAAEAAAABAAAAAAAAAAIFCAQEBQUJAgSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA199YAgUABQEBABoCzAIh/4IAAAAAABEAAABCb29rbWFuIE9sZCBTdHlsZQAAAAAAAAAAAQAAAAAAAAACBQYEBQUFCQIEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffLAEFAAUBAQDiAcwCGv97AAAAAAAQAAAAQnJhZGxleSBIYW5kIElUQwAAAAAAAAAAAAAAAAAAAAADBwQCBQMCAwIDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAYKAQCiAboC8/5mAAAAAAAOAAAAQnJpdGFubmljIEJvbGQAAAAAAAAAAAAAAAAAAAAAAgsJAwYHAwICBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAAAAEAvgGkAlr/AAEAAAAADgAAAEJlcmxpbiBTYW5zIEZCAAAAAAEAAAAAAAAAAAAAAAIOCQICBQICAwYDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgUAAggBANwBigO1/mgAAAAAABMAAABCZXJsaW4gU2FucyBGQiBEZW1pAAAAAAEAAAAAAAAAAAAAAAIOCAICBQICAwYDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgUAAggBALwBnAM0/2AAAAAAAA4AAABCZXJsaW4gU2FucyBGQgAAAAAAAAAAAAAAAAAAAAACDgYCAgUCAgMGAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAIIAQCdAX8DNf9cAAAAAAAIAAAAQnJvYWR3YXkAAAAAAAAAAAAAAAAAAAAABAQJBQgLAgIFAgMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAACQEAHwLBAun/AAAAAAAADQAAAEJyb3dhbGxpYSBOZXcAAAAAAAAAAAAAAAAAAAAAAgsGBAICAgICBAMAAIEAAAAAAAAAAAAAAAABAAEAAAAAAJABBQAFCAEAJgFIA9/+AABSAdMBDQAAAEJyb3dhbGxpYSBOZXcAAAAAAQAAAAAAAAAAAAAAAgsHBAICAgICBAMAAIEAAAAAAAAAAAAAAAABAAEAAAAAALwCBQAFCAEAOAFoAwD/AABSAdMBDQAAAEJyb3dhbGxpYSBOZXcAAAAAAAAAAAEAAAAAAAAAAgsDBAICAgkCBAMAAIEAAAAAAAAAAAAAAAABAAEAAAAAAJABBQAFCAEAIAFHA9r+AABSAdMBDAAAAEJyb3dhbGxpYVVQQwAAAAAAAAAAAAAAAAAAAAACCwYEAgICAgIEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAUIAQAmAUgD3/4AAFIB0wEMAAAAQnJvd2FsbGlhVVBDAAAAAAEAAAAAAAAAAAAAAAILBwQCAgICAgQDAACBAAAAAAAAAAAAAAAAAQABAAAAAAC8AgUABQgBADgBaAMA/wAAUgHTAQwAAABCcm93YWxsaWFVUEMAAAAAAAAAAAEAAAAAAAAAAgsDBAICAgkCBAMAAIEAAAAAAAAAAAAAAAABAAEAAAAAAJABBQAFCAEAIAFHA9r+AABSAdMBDAAAAEJyb3dhbGxpYVVQQwAAAAABAAAAAQAAAAAAAAACCwcEAgICCQIEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAvAIFAAUIAQA/AWgDAP8AAFIB0wENAAAAQnJvd2FsbGlhIE5ldwAAAAABAAAAAQAAAAAAAAACCwcEAgICCQIEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAvAIFAAUIAQA/AWgDAP8AAFIB0wEPAAAAQnJ1c2ggU2NyaXB0IE1UAAAAAAAAAAABAAAAAAAAAAMGCAIEBAYHAwQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAgoBAD8BWAIJ/94AAAAAABIAAABCb29rc2hlbGYgU3ltYm9sIDcAAAAAAAAAAAAAAAAAAAAABQEBAQEBAQEBAQAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAJABBQAFCAEAkAJbA3T/AAAAAAAABwAAAENhbGlicmkAAAAAAAAAAAAAAAAAAAAAAg8FAgICBAMCBP8CAOD/rABAAQAAAAAAAACfAQAgAAAAAJABBQAACAEACALuAgb/3ADQAXcCBwAAAENhbGlicmkAAAAAAQAAAAAAAAAAAAAAAg8HAgMEBAMCBP8CAOD/rABAAQAAAAAAAACfAQAgAAAAALwCBQAACAEAGALuAgb/3ADUAXcCBwAAAENhbGlicmkAAAAAAAAAAAEAAAAAAAAAAg8FAgICBAoCBP8CAOD/rABAAQAAAAAAAACfAQAgAAAAAJABBQAACAEACALuAgb/3ADTAXkCDQAAAENhbGlicmkgTGlnaHQAAAAAAAAAAAAAAAAAAAAAAg8DAgICBAMCBO8CAKB7IABAAAAAAAAAAACfAQAgAAAAACwBBQAACAEACALuAgb/3ADNAXcCDQAAAENhbGlicmkgTGlnaHQAAAAAAAAAAAEAAAAAAAAAAg8DAgICBAMCBO8CAKB7IABAAAAAAAAAAACfAQAgAAAAACwBBQAACAEACALuAgb/3ADQAXcCBwAAAENhbGlicmkAAAAAAQAAAAEAAAAAAAAAAg8HAgMEBAoCBP8CAOD/rABAAQAAAAAAAACfAQAgAAAAALwCBQAACAEAGALuAgb/3ADUAXcCDgAAAENhbGlmb3JuaWFuIEZCAAAAAAEAAAAAAAAAAAAAAAIHBgMGCAsDAgQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgUAAwEBAKsB6QIC/1QAAAAAAA4AAABDYWxpZm9ybmlhbiBGQgAAAAAAAAAAAQAAAAAAAAACBwQDBggLCgIEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAABAQBRAekCAv9UAAAAAAAOAAAAQ2FsaWZvcm5pYW4gRkIAAAAAAAAAAAAAAAAAAAAAAgcEAwYICwMCBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQADAQEAlAHpAgL/VAAAAAAACgAAAENhbGlzdG8gTVQAAAAAAAAAAAAAAAAAAAAAAgQGAwUFBQMDBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQACAQEApQHIAi//kwAAAAAACgAAAENhbGlzdG8gTVQAAAAAAQAAAAAAAAAAAAAAAgQHAwYFBQIDBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAALwCBQACAQEAtAHIAi//kwAAAAAACgAAAENhbGlzdG8gTVQAAAAAAQAAAAEAAAAAAAAAAgQHAwUFBQkDBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAALwCBQACAQEAiQHIAi//kwAAAAAACgAAAENhbGlzdG8gTVQAAAAAAAAAAAEAAAAAAAAAAgQGAwUFBQkDBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAFBAEAdQHHAi//kwAAAAAABwAAAENhbWJyaWEAAAAAAAAAAAAAAAAAAAAAAgQFAwUEBgMCBP8CAOD/BABAAAAAAAAAAACfAQAgAAAAAJABBQAPAgEAZwIJAyL/rADSAZoCDAAAAENhbWJyaWEgTWF0aAEAAAAAAAAAAAAAAAAAAAACBAUDBQQGAwIE/wIA4P8kAEIAAAAAAAAAAJ8BACAAAAAAkAEFAA8CAQBnAgkDIv+sANIBmgIHAAAAQ2FtYnJpYQAAAAABAAAAAAAAAAAAAAACBAgDBQQGAwIE/wIA4F8EAEAAAAAAAAAAAJ8BACAAAAAAvAIFAA8CAQBXAgkDIv+sAOQBmgIHAAAAQ2FtYnJpYQAAAAAAAAAAAQAAAAAAAAACBAUDBQQGCgIE/wIA4F8EAEAAAAAAAAAAAJ8BACAAAAAAkAEFAA8CAQAeAgkDIv+sANIBmgIHAAAAQ2FtYnJpYQAAAAABAAAAAQAAAAAAAAACBAgDBQQGCgIE/wIA4F8EAEAAAAAAAAAAAJ8BACAAAAAAvAIFAA8CAQBIAgkDIv+sAOQBmgIHAAAAQ2FuZGFyYQAAAAAAAAAAAAAAAAAAAAACDgUCAwMDAgIE7wIAoEukAEAAAAAAAAAAAJ8BACAAAAAAkAEFAAIIAQAJAtQC7f7cAM8BfgIHAAAAQ2FuZGFyYQAAAAABAAAAAAAAAAAAAAACDgcCAwMDAgIE7wIAoEukAEAAAAAAAAAAAJ8BACAAAAAAvAIFAAIIAQAQAtQC7f7cAM8BfgIHAAAAQ2FuZGFyYQAAAAAAAAAAAQAAAAAAAAACDgUCAwMDCQIE7wIAoEukAEAAAAAAAAAAAJ8BACAAAAAAkAEFAAIIAQD3AdQC7f7cANUBfgIHAAAAQ2FuZGFyYQAAAAABAAAAAQAAAAAAAAACDgcCAwMDCQIE7wIAoEukAEAAAAAAAAAAAJ8BACAAAAAAvAIFAAIIAQAFAtQC7f7cANUBfgIJAAAAQ2FzdGVsbGFyAAAAAAAAAAAAAAAAAAAAAAIKBAIGBAYBAwEDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUABAkBAJoCygL9/18BAAAAABIAAABDZW50dXJ5IFNjaG9vbGJvb2sAAAAAAAAAAAAAAAAAAAAAAgQGBAUFBQIDBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABBQACBAEA0AHkAj7/hgAAAAAABwAAAENlbnRhdXIAAAAAAAAAAAAAAAAAAAAAAgMFBAUCBQIDBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQACBAEAagGgAuv+dwAAAAAABwAAAENlbnR1cnkAAAAAAAAAAAAAAAAAAAAAAgQGBAUFBQIDBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABBQACBAEA0AHkAj7/hgAAAAAABwAAAENoaWxsZXIAAAAAAAAAAAAAAAAAAAAABAIEBAMQBwIGAgMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBgAPCgEAJQFQA8/+AAAAAAAACgAAAENvbG9ubmEgTVQAAAAAAAAAAAAAAAAAAAAABAIIBQYCAgMCAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQABCQEAowFTArP+jQAAAAAADQAAAENvbWljIFNhbnMgTVMAAAAAAAAAAAAAAAAAAAAAAw8HAgMDAgICBIcCAAATAABAAAAAAAAAAACfAAAgAAAAAJABBQAICgEA1AEfA93+AAAbAvYCDQAAAENvbWljIFNhbnMgTVMAAAAAAQAAAAAAAAAAAAAAAw8JAgMDAgICBIcCAAATAABAAAAAAAAAAACfAAAgAAAAALwCBQAICgEA7wEfA+3+AAAbAvYCDQAAAENvbWljIFNhbnMgTVMAAAAAAAAAAAEAAAAAAAAAAw8HAgMDAgYCBIcCAAATAAAAAAAAAAAAAACfAAAgAAAAAJABBQAICgEAhgIfA+3+AAAbAvYCDQAAAENvbWljIFNhbnMgTVMAAAAAAQAAAAEAAAAAAAAAAw8JAgMDAgYCBIcCAAATAAAAAAAAAAAAAACfAAAgAAAAALwCBQAICgEAjwIfA+3+AAAbAvYCCAAAAENvbnNvbGFzAAAAAAAAAAAAAAAABAAAAAILBgkCAgQDAgT/AgDh//wAQAkAAAAAAAAAnwEAYAAA19+QAQUACQgBACUC5gL//qoA6gF+AggAAABDb25zb2xhcwAAAAABAAAAAAAAAAQAAAACCwcJAgIEAwIE/wIA4f/8AEAJAAAAAAAAAJ8BAGAAANffvAIFAAkIAQAlAuYC//6qAPABfgIIAAAAQ29uc29sYXMAAAAAAAAAAAEAAAAEAAAAAgsGCQICBAoCBP8CAOH//ABACQAAAAAAAACfAQBgAADX35ABBQAJCAEAJQLmAv/+qgDqAX4CCAAAAENvbnNvbGFzAAAAAAEAAAABAAAABAAAAAILBwkCAgQKAgT/AgDh//wAQAkAAAAAAAAAnwEAYAAA19+8AgUACQgBACUC5gL//qoA8AF+AgoAAABDb25zdGFudGlhAAAAAAAAAAAAAAAAAAAAAAIDBgIFAwYDAwPvAgCgSyAAQAAAAAAAAAAAnwEAIAAAAACQAQUAAAABAB0C7gIH/9wAxQGuAgoAAABDb25zdGFudGlhAAAAAAEAAAAAAAAAAAAAAAIDBwIGAwYDAwPvAgCgSyAAQAAAAAAAAAAAnwEAIAAAAAC8AgUAAAABAD4C7gIH/9wAyAGuAgoAAABDb25zdGFudGlhAAAAAAAAAAABAAAAAAAAAAIDBgIFAwYKAwPvAgCgSyAAQAAAAAAAAAAAnwEAIAAAAACQAQUAAAABABUC7gIH/9wAygGuAgoAAABDb25zdGFudGlhAAAAAAEAAAABAAAAAAAAAAIDBwIGAwYKAwPvAgCgSyAAQAAAAAAAAAAAnwEAIAAAAAC8AgUAAAABADkC7gIH/9wA0AGuAgwAAABDb29wZXIgQmxhY2sAAAAAAAAAAAAAAAAAAAAAAggJBAQDCwIEBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAACQEA/wGfAkD/AAAAAAAAFwAAAENvcHBlcnBsYXRlIEdvdGhpYyBCb2xkAAAAAAAAAAAAAAAAAAAAAAIOBwUCAgYCBAQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAQkBAEMCQgL1/wAAAAAAABgAAABDb3BwZXJwbGF0ZSBHb3RoaWMgTGlnaHQAAAAAAAAAAAAAAAAAAAAAAg4FBwICBgIEBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQABCQEAKQJCAvX/AAAAAAAABgAAAENvcmJlbAAAAAAAAAAAAAAAAAAAAAACCwUDAgIEAgIE7wIAoEukAEAAAAAAAAAAAJ8BACAAAAAAkAEFAAAAAQARAucCAP/PAM8BjQIGAAAAQ29yYmVsAAAAAAEAAAAAAAAAAAAAAAILBwMCAgQCAgTvAgCgS6QAQAAAAAAAAAAAnwEAIAAAAAC8AgUAAAABACgC5wIA/88A2QGNAgYAAABDb3JiZWwAAAAAAAAAAAEAAAAAAAAAAgsFAwICBAkCBO8CAKBLpABAAAAAAAAAAACfAQAgAAAAAJABBQAAAAEAAwLnAgD/zwDPAY0CBgAAAENvcmJlbAAAAAABAAAAAQAAAAAAAAACCwcDAgIECQIE7wIAoEukAEAAAAAAAAAAAJ8BACAAAAAAvAIFAAAAAQAeAucCAP/PANkBjQIKAAAAQ29yZGlhIE5ldwAAAAAAAAAAAAAAAAAAAAACCwMEAgICAgIEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAUIAQAlAX0DA/8AAFMB1AEKAAAAQ29yZGlhIE5ldwAAAAABAAAAAAAAAAAAAAACCwYEAgICAgIEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAvAIFAAUIAQAoAUED+/4AAFMB1AEKAAAAQ29yZGlhIE5ldwAAAAAAAAAAAQAAAAAAAAACCwMEAgICCQIEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAUIAQArAX0DA/8AAFMB1AEJAAAAQ29yZGlhVVBDAAAAAAAAAAAAAAAAAAAAAAILAwQCAgICAgQDAACBAAAAAAAAAAAAAAAAAQABAAAAAACQAQUABQgBACUBfQMD/wAAUwHUAQkAAABDb3JkaWFVUEMAAAAAAQAAAAAAAAAAAAAAAgsGBAICAgICBAMAAIEAAAAAAAAAAAAAAAABAAEAAAAAALwCBQAFCAEAKAFBA/v+AABTAdQBCQAAAENvcmRpYVVQQwAAAAAAAAAAAQAAAAAAAAACCwMEAgICCQIEAwAAgQAAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAUIAQArAX0DA/8AAFMB1AEJAAAAQ29yZGlhVVBDAAAAAAEAAAABAAAAAAAAAAILBgQCAgIJAgQDAACBAAAAAAAAAAAAAAAAAQABAAAAAAC8AgUABQgBACEBQQP7/gAAUwHUAQoAAABDb3JkaWEgTmV3AAAAAAEAAAABAAAAAAAAAAILBgQCAgIJAgQDAACBAAAAAAAAAAAAAAAAAQABAAAAAAC8AgUABQgBACEBQQP7/gAAUwHUAQsAAABDb3VyaWVyIE5ldwAAAAAAAAAAAAAAAAQAAAACBwMJAgIFAgQE/yoA4EN4AMAJAAAAAAAAAP8BAEAAAP//kAEFAAUFAQBYAmQCRP8AAKYBOwILAAAAQ291cmllciBOZXcAAAAAAQAAAAAAAAAEAAAAAgcGCQICBQIEBP8qAOBDeADACQAAAAAAAAD/AQBAAAD//7wCBQAFBQEAWAJ5AjD/AAC7AU8CCwAAAENvdXJpZXIgTmV3AAAAAAEAAAABAAAABAAAAAIHBgkCAgUJBAT/CgDgQ3gAQAEAAAAAAAAAvwEAQAAA99+8AgUABQUBAFgCeQIw/wAAuwFPAgsAAABDb3VyaWVyIE5ldwAAAAAAAAAAAQAAAAQAAAACBwQJAgIFCQQE/woA4EN4AEABAAAAAAAAAL8BAEAAAPffkAEFAAUFAQBYAmQCRP8AAKYBOwIGAAAAQ3VwcnVtAAAAAAEAAAAAAAAAAAAAAAIACAYAAAACAAQvAgCACgAAAAAAAAAAAAAAlQAAAAAAAAC8AgUAAAABAM8BfwP8/gAA9AHGAgYAAABDdXBydW0AAAAAAQAAAAEAAAAAAAAAAgAIBgAAAAkABC8CAIAKAAAAAAAAAAAAAACVAAAAAAAAALwCBQAAAAEA0AF/A/z+AAD0AcYCBgAAAEN1cHJ1bQAAAAAAAAAAAQAAAAAAAAACAAUGAAAACQAELwIAgAoAAAAAAAAAAAAAAJUAAAAAAAAAkAEFAAAAAQC3AX8D/P4AAPQBxgIGAAAAQ3VwcnVtAAAAAAAAAAAAAAAAAAAAAAIABQYAAAACAAQvAgCACgAAAAAAAAAAAAAAlQAAAAAAAACQAQUAAAABALUBfwP8/gAA9AHGAggAAABDdXJseiBNVAAAAAAAAAAAAAAAAAAAAAAEBAQEBQcCAgICAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAA8HAQB8AcoCQv+kAAAAAAAOAAAARGFuY2luZyBTY3JpcHQAAAAAAQAAAAAAAAAAAAAAAwgIAAQFBwANAC8AAIALAABAAAAAAAAAAAABAAAAAAAAALwCBQACCgEA7gGYA+j+AABMAdACDgAAAERhbmNpbmcgU2NyaXB0AAAAAAAAAAAAAAAAAAAAAAMIBgAEBQcADQAvAACACwAAQAAAAAAAAAAAAQAAAAAAAACQAQUAAgoBANMBmAPo/gAATAHQAggAAABEYXVuUGVuaAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAwAAAAAAAAAAAAEAAAAAAAEAAAAAAAAAkAEFAAAAAQCEAaoCbf0eABYB1AEFAAAARGF2aWQAAAAAAAAAAAAAAAAAAAAAAg4FAgYEAQEBAQEIAAAAAAAAAAAAAAAAAAAgAAAAAAAgAJABBQAAAAEAjAHeAvf+AAAAAAAABQAAAERhdmlkAAAAAAEAAAAAAAAAAAAAAAIOCAIGBAEBAQEBCAAAAAAAAAAAAAAAAAAAIAAAAAAAIAC8AgUAAAABAKUB3gL3/gAAAAAAABEAAABEYXZpZCBUcmFuc3BhcmVudAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAACAAAAAAAAAAkAEFAAAAAQCXAZsD9v4AAAAAAAALAAAARGVqYVZ1IFNhbnMAAAAAAAAAAAAAAAAAAAAAAgsGAwMIBAICBP8uAOf//QDSKSAECgAAAAD/AQDgAAD/v5ABBQAAAAEA+gH3AhD/yAAAAAAACwAAAERlamFWdSBTYW5zAAAAAAEAAAAAAAAAAAAAAAILCAMDBgQCAgT/LgDn//UA0ikgBAoAAAAA/wEAYAAA/7+8AgUAAAABADwC9wIQ/8gAAAAAAAsAAABEZWphVnUgU2FucwAAAAABAAAAAQAAAAAAAAACCwgDAwMECwIE/w4A5//1AFIhIAQKAAAAAL8BAGAAAPefvAIFAAAAAQA8AvcCEP/IAAAAAAAVAAAARGVqYVZ1IFNhbnMgQ29uZGVuc2VkAAAAAAEAAAAAAAAAAAAAAAILCAYDBgQCAgT/LgDn//UA0ilgBAoAAAAA/wEAYAAACAC8AgQAAAABAAMC9wIQ/8gAAAAAABUAAABEZWphVnUgU2FucyBDb25kZW5zZWQAAAAAAQAAAAEAAAAAAAAAAgsIBgMDBAsCBP8OAOf/9QBSISAECgAAAAC/AQBgAAAAALwCBAAAAAEAAwL3AhD/yAAAAAAAFQAAAERlamFWdSBTYW5zIENvbmRlbnNlZAAAAAAAAAAAAQAAAAAAAAACCwYGAwMECwIE/w4A5//9AFIhIAQKAAAAAL8BAGAAAPffkAEEAAAAAQDIAfcCEP/IAAAAAAAVAAAARGVqYVZ1IFNhbnMgQ29uZGVuc2VkAAAAAAAAAAAAAAAAAAAAAAILBgYDCAQCAgT/LgDn//0A0ilgBAoAAAAA/wEAYAAA/9+QAQQAAAABAMgB9wIQ/8gAAAAAABEAAABEZWphVnUgU2FucyBMaWdodAAAAAAAAAAAAAAAAAAAAAACCwIDAwgEAgIE/yYA4HsAAFAgAAAIAAAAAJ8BAGAAANefyAAFAAAAAQD6AfcCEP8AAAAAAAAQAAAARGVqYVZ1IFNhbnMgTW9ubwAAAAABAAAAAAAAAAQAAAACCwcJAwYEAgIE/yIA5vvxANAoAAAAAAAAAN8BAGAAAAgAvAIFAAAAAQBaAvcCEP/IAAAAAAAQAAAARGVqYVZ1IFNhbnMgTW9ubwAAAAABAAAAAQAAAAQAAAACCwcJAwMECwIE/wIA5vtxAFAgAAAAAAAAAJ8BAGAAAAAAvAIFAAAAAQBaAvcCEP/IAAAAAAAQAAAARGVqYVZ1IFNhbnMgTW9ubwAAAAAAAAAAAQAAAAQAAAACCwYJAwMECwIE/wIA5vt5AFAgAAAAAAAAAJ8BAGAAANffkAEFAAAAAQBaAvcCEP/IAAAAAAAQAAAARGVqYVZ1IFNhbnMgTW9ubwAAAAAAAAAAAAAAAAQAAAACCwYJAwgEAgIE/yIA5vv5ANIoAAACAAAAAN8BAGAAAN/fkAEFAAAAAQBaAvcCEP/IAAAAAAALAAAARGVqYVZ1IFNhbnMAAAAAAAAAAAEAAAAAAAAAAgsGAwMDBAsCBP8OAOf//QBSISAECgAAAAC/AQBgAAD3n5ABBQAAAAEA+gH3AhD/yAAAAAAADAAAAERlamFWdSBTZXJpZgAAAAAAAAAAAAAAAAAAAAACBgYDBQYFAgIE/wIA5Pt5AFAgAAQIAAAAAJ8AAGAAANefkAEFAAAAAQAAAvcCEP/IAAAAAAAMAAAARGVqYVZ1IFNlcmlmAAAAAAEAAAAAAAAAAAAAAAIGCAMFBgUCAgT/AgDk+3EAUCAABAgAAAAAnwAAYAAA15+8AgUAAAABADUC9wIQ/8gAAAAAAAwAAABEZWphVnUgU2VyaWYAAAAAAQAAAAEAAAAAAAAAAgYIAwUDBQsCBP8CAOT7cQBQIAAECAAAAACfAABgAADXn7wCBQAAAAEANQL3AhD/yAAAAAAAFgAAAERlamFWdSBTZXJpZiBDb25kZW5zZWQAAAAAAQAAAAAAAAAAAAAAAgYIBgUGBQICBP8CAOT78QBSIAAECgAAAACfAABgAAAAALwCBAAAAAEA/QH3AhD/yAAAAAAAFgAAAERlamFWdSBTZXJpZiBDb25kZW5zZWQAAAAAAQAAAAEAAAAAAAAAAgYIBgUDBQsCBP8CAOT78QBSIAAECgAAAACfAABgAAAAALwCBAAAAAEA/QH3AhD/yAAAAAAAFgAAAERlamFWdSBTZXJpZiBDb25kZW5zZWQAAAAAAAAAAAEAAAAAAAAAAgYGBgUDBQsCBP8CAOT7+QBSIAAECgAAAACfAABgAADX35ABBAAAAAEAzAH3AhD/yAAAAAAAFgAAAERlamFWdSBTZXJpZiBDb25kZW5zZWQAAAAAAAAAAAAAAAAAAAAAAgYGBgUGBQICBP8CAOT7+QBSIAAECgAAAACfAABgAADX35ABBAAAAAEAzAH3AhD/yAAAAAAADAAAAERlamFWdSBTZXJpZgAAAAAAAAAAAQAAAAAAAAACBgYDBQMFCwIE/wIA5Pt5AFAgAAQIAAAAAJ8AAGAAANefkAEFAAAAAQAAAvcCEP/IAAAAAAAIAAAARGluZ2JhdHMAAAAAAAAAAAAAAAAAAAAAAgAFAwAAAAAAAAMAAIAAAAAAAAAAAAAAAAABAAAAAAAAAJABBQAAAAEAsAIzA3H/WgAAAAAACwAAAERpd2FuaSBCZW50AAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAHEBCgbl/QAAAAAAAA0AAABEaXdhbmkgTGV0dGVyAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAGgB9AXl/QAAAAAAAAkAAABEb2tDaGFtcGEAAAAAAAAAAAAAAAAAAAAAAgsGBAICAgICBAMAAAMAAAAAAAAAAAAAAAABAAFAAAAAAJABBQAFCAEATQLQA/L+YQAuAtgCEAAAAEd1dHRtYW4gRHJvZ29saW4AAAAAAQAAAAAAAAAAAAAAAgEHAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAALwCBQAAAAEAhwHqArD+AAAAAAAAEAAAAEd1dHRtYW4gRHJvZ29saW4AAAAAAAAAAAAAAAAAAAAAAgEEAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEAfwHqArD+AAAAAAAACgAAAERyb2lkIFNhbnMAAAAAAQAAAAAAAAAAAAAAAgsIBgMIBAICBO8CAOBbIABAKAAAAAAAAACfAQAgAAAAALwCBQAAAAEAJAL9AhD/QAAhAskCCgAAAERyb2lkIFNhbnMAAAAAAAAAAAAAAAAAAAAAAgsGBgMIBAICBO8CAOBbIABAKAAAAAAAAACfAQAgAAAAAJABBQAAAAEABgL9AhD/QAAYAskCDwAAAERyb2lkIFNhbnMgTW9ubwAAAAAAAAAAAAAAAAQAAAACCwYJAwgEAgIE7wIA4FsgAEAoAAAAAAAAAJ8BACAAAAAAkAEFAAAAAQBYAv0CEP9AABgCyQILAAAARHJvaWQgU2VyaWYAAAAAAQAAAAAAAAAAAAAAAgIIAAYFAAICAO8CAOBbIABAKAAAAAAAAACfAQAgAAAAALwCBQAAAgEAQwIBAxD/PAAYAskCCwAAAERyb2lkIFNlcmlmAAAAAAEAAAABAAAAAAAAAAICCAAGBQAJAgDvAgDgWyAAQCgAAAAAAAAAnwEAIAAAAAC8AgUAAAIBAEQCAgMQ/zsAGALJAgsAAABEcm9pZCBTZXJpZgAAAAAAAAAAAQAAAAAAAAACAgYABgUACQIA7wIA4FsgAEAoAAAAAAAAAJ8BACAAAAAAkAEFAAACAQAjAgIDEP87ABgCyQILAAAARHJvaWQgU2VyaWYAAAAAAAAAAAAAAAAAAAAAAgIGAAYFAAICAO8CAOBbIABAKAAAAAAAAACfAQAgAAAAAJABBQAAAgEAKAICAxD/OwAYAskCEAAAAERlY29UeXBlIFRodWx1dGgAAAAAAAAAAAAAAAAAAAAAAgEAAAAAAAAAAABgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEArAHiAwz+AAAAAAAADgAAAERlY29UeXBlIE5hc2toAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAJEB4gMM/gAAAAAAABYAAABEZWNvVHlwZSBOYXNraCBTcGVjaWFsAAAAAAAAAAAAAAAAAAAAAAIBAAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAJQB4gMM/gAAAAAAABcAAABEZWNvVHlwZSBOYXNraCBWYXJpYW50cwAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQChAeIDDP4AAAAAAAAZAAAARGVjb1R5cGUgTmFza2ggRXh0ZW5zaW9ucwAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQDRAeIDDP4AAAAAAAAWAAAARGVjb1R5cGUgTmFza2ggU3dhc2hlcwAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQCQAeIDDP4AAAAAAAAVAAAARGl3YW5pIE91dGxpbmUgU2hhZGVkAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAJgBNgaJ/QAAAAAAABcAAABEaXdhbmkgU2ltcGxlIE91dGxpbmUgMgAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQB4ATYG1/0AAAAAAAAVAAAARGl3YW5pIFNpbXBsZSBPdXRsaW5lAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAHgBHAbU/QAAAAAAABUAAABEaXdhbmkgU2ltcGxlIFN0cmlwZWQAAAAAAAAAAAAAAAAAAAAAAgEEAAAAAAAAAABgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEAcQEtBuX9AAAAAAAABgAAAEVicmltYQAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAX1AAoEEAAAIACAAABAQAAJMAAAAAAAAAkAEFAAUIAQBcAtgCLv+DAPQBvAIGAAAARWJyaW1hAAAAAAEAAAAAAAAAAAAAAAIAAAAAAAAAAABfUACgQQAAAgAIAAAEBAAAkwAAAAAAAAC8AgUABQgBAI4C5AIb/zkA9AG8AggAAABFbGVwaGFudAAAAAAAAAAAAAAAAAAAAAACAgkECQUFAgMDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAAAAQDoAcID9/4AAAAAAAAIAAAARWxlcGhhbnQAAAAAAAAAAAEAAAAAAAAAAgIJBwkJBQkJBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAAAAEA7wHHA/j+AAAAAAAADAAAAEVuZ3JhdmVycyBNVAAAAAAAAAAAAAAAAAAAAAACCQcHCAUFAgMEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAA9AEHAAEDAQAXA7cC8/9oAQAAAAANAAAARXJhcyBCb2xkIElUQwAAAAAAAAAAAAAAAAAAAAACCwkHAwUEAgIEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAQIAQD7AbgCE/8AAAAAAAANAAAARXJhcyBEZW1pIElUQwAAAAAAAAAAAAAAAAAAAAACCwgFAwUEAggEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAQIAQDaAa0CFP8AAAAAAAAOAAAARXJhcyBMaWdodCBJVEMAAAAAAAAAAAAAAAAAAAAAAgsEAgMFBAIIBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAECAEAnwGpAhT/AAAAAAAADwAAAEVyYXMgTWVkaXVtIElUQwAAAAAAAAAAAAAAAAAAAAACCwYCAwUEAggEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAUIAQC7Aa0CFP8AAAAAAAARAAAARXN0cmFuZ2VsbyBFZGVzc2EAAAAAAAAAAAAAAAAAAAAAAwgGAAAAAAAAAEMgAIAAAAAAgAAAAAAAAAABAAAAAAAAAJABBQAAAAEA9QG8AtX+AACQAXcCCAAAAEV1cGhlbWlhAAAAAAAAAAAAAAAAAAAAAAILBQMEAQICAQRvAACASgAAAAAgAAAAAAAAAQAAAAAAAACQAQUABggBALoC/QIj/1EADwL9Ag0AAABGZWxpeCBUaXRsaW5nAAAAAAAAAAAAAAAAAAAAAAQGBQUGAgICCgQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAgEBAEwCzwIAAF4BAAAAABAAAABGbGVtaXNoU2NyaXB0IEJUAAAAAAAAAAAAAAAAAAAAAAMDBgIFBQcPCgUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAQUAAwoBAA4B9wIQ/8gAAAAAAAUAAABGb3J0ZQAAAAAAAAAAAAAAAAAAAAADBgkCBAUCBwIDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAYKAQCqAaACK/+3AAAAAAAUAAAARnJhbmtsaW4gR290aGljIEJvb2sAAAAAAAAAAAAAAAAAAAAAAgsFAwIBAgICBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABBQAGCAEApQG8AkP/swAAAAAAFAAAAEZyYW5rbGluIEdvdGhpYyBCb29rAAAAAAAAAAABAAAAAAAAAAILBQMCAQIJAgSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+QAQUABggBAKcBvAJD/7MAAAAAABQAAABGcmFua2xpbiBHb3RoaWMgRGVtaQAAAAAAAAAAAAAAAAAAAAACCwcDAgECAgIEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffkAEFAAYIAQC2AbwCQ/+zAAAAAAAZAAAARnJhbmtsaW4gR290aGljIERlbWkgQ29uZAAAAAAAAAAAAAAAAAAAAAACCwcGAwQCAgIEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffkAEDAAYIAQB3AbwCQ/+zAAAAAAAUAAAARnJhbmtsaW4gR290aGljIERlbWkAAAAAAAAAAAEAAAAAAAAAAgsHAwIBAgkCBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABBQAGCAEAtQG8AkP/swAAAAAAFQAAAEZyYW5rbGluIEdvdGhpYyBIZWF2eQAAAAAAAAAAAAAAAAAAAAACCwkDAgECAgIEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffkAEFAAYIAQDZAbwCQ/+zAAAAAAAVAAAARnJhbmtsaW4gR290aGljIEhlYXZ5AAAAAAAAAAABAAAAAAAAAAILCQMCAQIJAgSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+QAQUABggBANUBvAJD/7MAAAAAABYAAABGcmFua2xpbiBHb3RoaWMgTWVkaXVtAAAAAAAAAAAAAAAAAAAAAAILBgMCAQICAgSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+QAQUABggBAKwBvAJD/7MAAAAAABsAAABGcmFua2xpbiBHb3RoaWMgTWVkaXVtIENvbmQAAAAAAAAAAAAAAAAAAAAAAgsGBgMEAgICBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABAwAGCAEAaAG8AkP/swAAAAAAFgAAAEZyYW5rbGluIEdvdGhpYyBNZWRpdW0AAAAAAAAAAAEAAAAAAAAAAgsGAwIBAgkCBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABBQAGCAEAqwG8AkP/swAAAAAACgAAAEZyYW5rUnVlaGwAAAAAAAAAAAAAAAAAAAAAAg4FAwYBAQEBAQEIAAAAAAAAAAAAAAAAAAAgAAAAAAAgAJABBQAAAAEAigHeAvf+AAAAAAAADQAAAEd1dHRtYW4gRnJhbmsAAAAAAQAAAAAAAAAAAAAAAgEHAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAALwCBQAAAAEAegHqArD+AAAAAAAAEAAAAEZyZWVzdHlsZSBTY3JpcHQAAAAAAAAAAAAAAAAAAAAAAwgEAgMCBQsEBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAECgEAAgGqAsP+AAAAAAAADQAAAEd1dHRtYW4gRnJuZXcAAAAAAAAAAAAAAAAAAAAAAgEEAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEAbQHqArD+AAAAAAAAEAAAAEZyZW5jaCBTY3JpcHQgTVQAAAAAAAAAAAAAAAAAAAAAAwIEAgQGBwQGBQMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQADCgEAFwE+AtX+wwAAAAAAEQAAAEZhcnNpIFNpbXBsZSBCb2xkAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAMABOAWF/AAAAAAAABQAAABGYXJzaSBTaW1wbGUgT3V0bGluZQAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQDYAUAFfvwAAAAAAAASAAAARm9vdGxpZ2h0IE1UIExpZ2h0AAAAAAAAAAAAAAAAAAAAAAIEBgIGAwoCAwQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAAsAQUAAwEBAJsBswIh/2b/AAAAAAcAAABGWlNodVRpAAAAAAAAAAAAAAAAAAAAAAIBBgEDAQEBAQEDAAAAAAAOCAAAAAAAAAAAAAAEAAAAAACQAQQAAAABAPQBjgNw/5AAAAAAAAcAAABGWllhb1RpAAAAAAAAAAAAAAAAAAAAAAIBBgEDAQEBAQEDAAAAAAAOCAAAAAAAAAAAAAAEAAAAAACQAQQAAAABAPQB3ANs/5QAAAAAAAgAAABHYWJyaW9sYQAAAAAAAAAAAAAAAAAAAAAEBAYFBRACAg0C7wIA4EsgAFAAAAAAAAAAAJ8AACAAAAAAkAEFAAAAAQDsAasCxP67AlcBLgIGAAAAR2FkdWdpAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMDAAAAAAAAAAAwAAAAAAAAAQAAAAAAAACQAQUABQgBADQC2AIu/4MA9AG8AgYAAABHYWR1Z2kAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICAwMAAAAAAAAAADAAAAAAAAABAAAAAAAAALwCBQAFCAEArgLYAi7/gwD0AbwCDwAAAEd1dHRtYW4gQWhhcm9uaQAAAAAAAAAAAAAAAAAAAAACAQQBAQEBAQEBABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAkAEFAAAAAQCPAeoCUAEAAAAAAAAIAAAAR2FyYW1vbmQAAAAAAAAAAAAAAAAAAAAAAgIEBAMDAQEIA4cCAAAAAAAAAAAAAAAAAACfAAAAAADX35ABBQACAQEAgwGNAvn+mAAAAAAACAAAAEdhcmFtb25kAAAAAAEAAAAAAAAAAAAAAAICCAQDAwcBCAOHAgAAAAAAAAAAAAAAAAAAnwAAAAAA19+8AgUAAgEBAKYBjQL5/pgAAAAAAAgAAABHYXJhbW9uZAAAAAAAAAAAAQAAAAAAAAACAgQEAwMBAQgDhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffkAEFAAIBAQBEAY0C+f6YAAAAAAAHAAAAR2F1dGFtaQAAAAAAAAAAAAAAAAAAAAACCwUCBAIEAgIDAwAgAAAAAAAAAAAAAAAAAAEAAAAAAAAAkAEFAAAAAQA5ApsD1PypAN4BlAIHAAAAR2F1dGFtaQAAAAABAAAAAAAAAAAAAAACCwgCBAIEAgIDAwAgAAAAAAAAAAAAAAAAAAEAAAAAAAAAvAIFAAAAAQA9ApsD1PypAN4BlAINAAAAR2VudGl1bSBCYXNpYwAAAAABAAAAAAAAAAAAAAACAAUDBgAAAgAEfwAAoEogAEAAAAAAAAAAABMAACAAAAAAvAIFAAAAAQARAmoD5f4AAMYBZwINAAAAR2VudGl1bSBCYXNpYwAAAAABAAAAAQAAAAAAAAACAAYGCAAAAgAEfwAAoEogAEAAAAAAAAAAABMAACAAAAAAvAIFAAAAAQDlAWoD5f4AAMYBZwINAAAAR2VudGl1bSBCYXNpYwAAAAAAAAAAAQAAAAAAAAACAAYGCAAAAgAEfwAAoEogAEAAAAAAAAAAABMAACAAAAAAkAEFAAAAAQDIAWoD5f4AAMYBZwINAAAAR2VudGl1bSBCYXNpYwAAAAAAAAAAAAAAAAAAAAACAAUDBgAAAgAEfwAAoEogAEAAAAAAAAAAABMAACAAAAAAkAEFAAAAAQD0AWoD5f4AAMYBZwISAAAAR2VudGl1bSBCb29rIEJhc2ljAAAAAAEAAAAAAAAAAAAAAAIABQMGAAACAAR/AACgSiAAQAAAAAAAAAAAEwAAIAAAAAC8AgUAAAABABoCagPl/gAAxgFnAhIAAABHZW50aXVtIEJvb2sgQmFzaWMAAAAAAQAAAAEAAAAAAAAAAgAGBggAAAIABH8AAKBKIABAAAAAAAAAAAATAAAgAAAAALwCBQAAAAEA7wFqA+X+AADGAWcCEgAAAEdlbnRpdW0gQm9vayBCYXNpYwAAAAAAAAAAAQAAAAAAAAACAAYGCAAAAgAEfwAAoEogAEAAAAAAAAAAABMAACAAAAAAkAEFAAAAAQDSAWoD5f4AAMYBZwISAAAAR2VudGl1bSBCb29rIEJhc2ljAAAAAAAAAAAAAAAAAAAAAAIABQMGAAACAAR/AACgSiAAQAAAAAAAAAAAEwAAIAAAAACQAQUAAAABAP4BagPl/gAAxgFnAgcAAABHZW9yZ2lhAAAAAAAAAAAAAAAAAAAAAAIEBQIFBAUCAwOHAgAAAAAAAAAAAAAAAAAAnwAAIAAAAACQAQUAAwQBALcB9AIo/2AA4QG0AgcAAABHZW9yZ2lhAAAAAAEAAAAAAAAAAAAAAAIECAIFBAUCAgOHAgAAAAAAAAAAAAAAAAAAnwAAIAAAAAC8AgUAAwQBAAEC9AIo/2AA5AG0AgcAAABHZW9yZ2lhAAAAAAAAAAABAAAAAAAAAAIEBQIFBAUJAwOHAgAAAAAAAAAAAAAAAAAAnwAAIAAAAACQAQUAAwQBAMEB9AIo/2AA6AG0AgcAAABHZW9yZ2lhAAAAAAEAAAABAAAAAAAAAAIECAIFBAUJAgOHAgAAAAAAAAAAAAAAAAAAnwAAIAAAAAC8AgUAAwQBAAsC9AIo/2AA7wG0Ag0AAABHdXR0bWFuIEZyYW5rAAAAAAAAAAAAAAAAAAAAAAIBBAEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAACQAQUAAAABAHsB6gKw/gAAAAAAAAwAAABHdXR0bWFuIEhhaW0AAAAAAAAAAAAAAAAAAAAAAgEEAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEAlgHqArD+AAAAAAAAFgAAAEd1dHRtYW4gSGFpbS1Db25kZW5zZWQAAAAAAAAAAAAAAAAAAAAAAgEEAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEATwHqArD+AAAAAAAABAAAAEdpZ2kAAAAAAAAAAAAAAAAAAAAABAQFBAYQBwINAgMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAPCgEAigEbA3z+AAAAAAAADAAAAEdpbGwgU2FucyBNVAAAAAABAAAAAQAAAAAAAAACCwgCAgEECQIDAwAAAAAAAAAAAAAAAAAAAAMAACAAAAAAvAIFAAIIAQC3AbICG/+UAAAAAAAMAAAAR2lsbCBTYW5zIE1UAAAAAAEAAAAAAAAAAAAAAAILCAICAQQCAgMDAAAAAAAAAAAAAAAAAAAAAwAAIAAAAAC8AgUAAggBANIBsgIb/5QAAAAAABYAAABHaWxsIFNhbnMgTVQgQ29uZGVuc2VkAAAAAAAAAAAAAAAAAAAAAAILBQYCAQQCAgMDAAAAAAAAAAAAAAAAAAAAAwAAIAAAAACQAQMAAggBADABswIL/4QAAAAAAAwAAABHaWxsIFNhbnMgTVQAAAAAAAAAAAEAAAAAAAAAAgsFAgIBBAkCAwMAAAAAAAAAAAAAAAAAAAADAAAgAAAAAJABBQACCAEAdwGyAhv/lAAAAAAAHgAAAEdpbGwgU2FucyBVbHRyYSBCb2xkIENvbmRlbnNlZAAAAAAAAAAAAAAAAAAAAAACCwoGAgEEAgIDAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAkAEDAAIIAQC9AfECXP+XAAAAAAAUAAAAR2lsbCBTYW5zIFVsdHJhIEJvbGQAAAAAAAAAAAAAAAAAAAAAAgsKAgIBBAICAwMAAAAAAAAAAAAAAAAAAAADAAAgAAAAAJABBQACCAEAdQL0Alv/kwAAAAAADAAAAEdpbGwgU2FucyBNVAAAAAAAAAAAAAAAAAAAAAACCwUCAgEEAgIDAwAAAAAAAAAAAAAAAAAAAAMAACAAAAAAkAEFAAIIAQCXAbICG/+UAAAAAAAFAAAAR2lzaGEAAAAAAAAAAAAAAAAAAAAAAgsFAgQCBAICAwcIAIBCAABAAAAAAAAAAAAhAAAAAAAAAJABBQAFCAEA/gHuAhX/UwD0AbwCBQAAAEdpc2hhAAAAAAEAAAAAAAAAAAAAAAILCAIEAgQCAgMHCACAQgAAQAAAAAAAAAAAIQAAAAAAAAC8AgUABQgBACYC7wIW/1MA9AG8AgsAAABHdXR0bWFuIEthdgAAAAABAAAAAAAAAAAAAAACAQcBAQEBAQEBABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAvAIFAAAAAQCNAeoCsP4AAAAAAAARAAAAR3V0dG1hbiBLYXYtTGlnaHQAAAAAAAAAAAAAAAAAAAAAAgEEAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEAdAHqArD+AAAAAAAACwAAAEd1dHRtYW4gS2F2AAAAAAAAAAAAAAAAAAAAAAIBBAEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAACQAQUAAAABAI8B6gKw/gAAAAAAAB0AAABHbG91Y2VzdGVyIE1UIEV4dHJhIENvbmRlbnNlZAAAAAAAAAAAAAAAAAAAAAACAwgIAgYBAQEBAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAECAAUEAQAUAQEDYP+MAAAAAAAfAAAAR2lsbCBTYW5zIE1UIEV4dCBDb25kZW5zZWQgQm9sZAAAAAAAAAAAAAAAAAAAAAACCwkCAgEEAgIDAwAAAAAAAAAAAAAAAAAAAAMAACAAAAAAkAECAAIIAQDlACIDjP+WAAAAAAAPAAAAR3V0dG1hbiBNeWFtZml4AAAAAAAAAAAAAAAABAAAAAIBBAkBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAACQAQUAAAABAK0B5AOG/gAAAAAAAAsAAABHT1NUIHR5cGUgQQAAAAAAAAAAAAAAAAAAAAACCwUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAEFAAAAAQBcAa8CJv8AAAAAAAALAAAAR09TVCB0eXBlIEIAAAAAAAAAAAAAAAAAAAAAAgsFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJABBQAAAAEAsgGyAjP/AAAAAAAADgAAAENlbnR1cnkgR290aGljAAAAAAAAAAAAAAAAAAAAAAILBQICAgICAgSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+QAQUABAIBAOUB7gIw/28AAAAAAA4AAABDZW50dXJ5IEdvdGhpYwAAAAABAAAAAAAAAAAAAAACCwcCAgICAgIEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffvAIFAAQCAQDlAe4CMP9vAAAAAAAOAAAAQ2VudHVyeSBHb3RoaWMAAAAAAQAAAAEAAAAAAAAAAgsGAgICAgkCBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX37wCBQAEAgEA5QHuAjD/bwAAAAAADgAAAENlbnR1cnkgR290aGljAAAAAAAAAAABAAAAAAAAAAILBQICAgIJAgSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+QAQUABAIBAOUB7gIw/28AAAAAAA8AAABHb3VkeSBPbGQgU3R5bGUAAAAAAAAAAAAAAAAAAAAAAgIFAgUDBQIDAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBgADAQEAiQF+AxP/RAAAAAAADwAAAEdvdWR5IE9sZCBTdHlsZQAAAAABAAAAAAAAAAAAAAACAgYCBgMFAgMDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAvAIGAAMBAQCUAX4DE/9EAAAAAAAPAAAAR291ZHkgT2xkIFN0eWxlAAAAAAAAAAABAAAAAAAAAAICBQIFAwUJAwMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAwEBAF4BfgMT/0QAAAAAAAsAAABHb3VkeSBTdG91dAAAAAAAAAAAAAAAAAAAAAACAgkEBwMLAgQBAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAAAAQBVBOkC7v8AAAAAAAAFAAAAR3VsaW0AAAAAAAAAAAAAAAAAAAAAAgsGAAABAQEBAa8CALD7fNdpMAAAAAAAAACfAAhAAADX35ABBQAFCAEA9AFaA3P/lAAAAAAACAAAAEd1bGltQ2hlAQAAAAAAAAAAAAAABAAAAAILBgkAAQEBAQGvAgCw+3zXaTAAAAAAAAAAnwAIQAAA19+QAQUABQgBAPQBWgNz/5QAAAAAAAUAAABEb3R1bQIAAAAAAAAAAAAAAAAAAAACCwYAAAEBAQEBrwIAsPt812kwAAAAAAAAAJ8ACEAAANffkAEFAAUIAQD0AVoDc/+UAAAAAAAIAAAARG90dW1DaGUDAAAAAAAAAAAAAAAEAAAAAgsGCQABAQEBAa8CALD7fNdpMAAAAAAAAACfAAhAAADX35ABBQAFCAEA9AFaA3P/lAAAAAAAEQAAAEd1dHRtYW4gWWFkLUJydXNoAAAAAAAAAAAAAAAAAAAAAAIBBAEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAACQAQUAAAABALYB6gKx/gAAAAAAAAsAAABHdXR0bWFuIFlhZAAAAAAAAAAAAAAAAAAAAAACAQQBAQEBAQEBABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAkAEFAAAAAQCTAeoCsf4AAAAAAAARAAAAR3V0dG1hbiBZYWQtTGlnaHQAAAAAAAAAAAAAAAAAAAAAAgEEAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEAlQHqArD+AAAAAAAAEAAAAEhZR3JhcGhpYy1NZWRpdW0AAAAAAAAAAAAAAAAAAAAAAgMGAAABAQEBAacCAJD5fNcBEAAAAAAAAAAAAAgAAAAAAJABBQAFAQEA9AFaA3P/lAAAAAAADQAAAEhZR3VuZ1NvLUJvbGQAAAAAAAAAAAAAAAAAAAAAAgMGAAABAQEBAacCAJD5fNcBEAAAAAAAAAAAAAgAAAAAAJABBQAFAQEA9AFaA3P/lAAAAAAADgAAAEhZR290aGljLUV4dHJhAAAAAAAAAAAAAAAAAAAAAAIDBgAAAQEBAQGnAgCQ+XzXKRAAAAAAAAAAAAAIAAAAAACQAQUABQEBAPQBWgNz/5QAAAAAAA8AAABIWUdvdGhpYy1NZWRpdW0AAAAAAAAAAAAAAAAAAAAAAgMGAAABAQEBAacCAJD5fNcpEAAAAAAAAAAAAAgAAAAAAJABBQAFAQEA9AFaA3P/lAAAAAAAEQAAAEhZSGVhZExpbmUtTWVkaXVtAAAAAAAAAAAAAAAAAAAAAAIDBgAAAQEBAQGnAgCQ+XzXARAAAAAAAAAAAAAIAAAAAACQAQUABQEBAPQBWgNz/5QAAAAAABAAAABIWU15ZW9uZ0pvLUV4dHJhAAAAAAAAAAAAAAAAAAAAAAIDBgAAAQEBAQGnAgCQ+XzXKRAAAAAAAAAAAAAIAAAAAACQAQUABQEBAPQBWgNz/5QAAAAAABQAAABIWVNpbk15ZW9uZ0pvLU1lZGl1bQAAAAAAAAAAAAAAAAAAAAACAwYAAAEBAQEBpwIAkPl81ykQAAAAAAAAAAAACAAAAAAAkAEFAAUBAQD0AVoDc/+UAAAAAAAOAAAASFlQTW9rR2FrLUJvbGQAAAAAAAAAAAAAAAAAAAAAAgMGAAABAQEBAacCAJD5fNcBEAAAAAAAAAAAAAgAAAAAAJABBQAFAQEA9AFaA3P/lAAAAAAADAAAAEhZUG9zdC1MaWdodAAAAAAAAAAAAAAAAAAAAAACAwYAAAEBAQEBpwIAkPl81wEQAAAAAAAAAAAACAAAAAAAkAEFAAUBAQD0AVoDc/+UAAAAAAANAAAASFlQb3N0LU1lZGl1bQAAAAAAAAAAAAAAAAAAAAACAwYAAAEBAQEBpwIAkPl81wEQAAAAAAAAAAAACAAAAAAAkAEFAAUBAQD0AVoDc/+UAAAAAAATAAAASFlTaG9ydFNhbXVsLU1lZGl1bQAAAAAAAAAAAAAAAAAAAAACAwYAAAEBAQEBpwIAkPl81wEQAAAAAAAAAAAACAAAAAAAkAEFAAUBAQD0AVoDc/+UAAAAAAATAAAASGFybG93IFNvbGlkIEl0YWxpYwAAAAAAAAAAAQAAAAAAAAAEAwYEAg8CAg0CAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEGAAAAAQB9AWoDfP4AAAAAAAAKAAAASGFycmluZ3RvbgAAAAAAAAAAAAAAAAAAAAAEBAUFBQoCAgcCAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAA8HAQCyAbEDGv8AAAAAAAAQAAAASGFldHRlbnNjaHdlaWxlcgAAAAAAAAAAAAAAAAAAAAACCwcGBAkCBgIEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffkAEFAAUIAQA3AbwCeABCAAAAAAARAAAATW9ub3R5cGUgSGFkYXNzYWgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAJABBQAAAAEA9gFYAyz/AAAAAAAAEQAAAE1vbm90eXBlIEhhZGFzc2FoAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAC8AgUAAAABAAQCWAMs/wAAAAAAAAkAAABIR0dvdGhpY0UAAAAAAAAAAAAAAAAEAAAAAgsJCQAAAAAAAP8CAOD7/cdqEgAAAAAAAACfAAJAAADX35ABBQABCAEA9AFbA3T/AAAyAg0DCgAAAEhHUEdvdGhpY0UBAAAAAAAAAAAAAAAAAAAAAgsJAAAAAAAAAP8CAOD7/cdqEgAAAAAAAACfAAJAAADX35ABBQABCAEA9AFbA3T/AAAyAg0DCgAAAEhHU0dvdGhpY0UCAAAAAAAAAAAAAAAAAAAAAgsJAAAAAAAAAP8CAOD7/cdqEgAAAAAAAACfAAJAAADX35ABBQABCAEA9AFbA3T/AAAyAg0DCQAAAEhHR290aGljTQAAAAAAAAAAAAAAAAAAAAACCwYJAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAEIAQD0AVsDdP8AAAAAAAAKAAAASEdQR290aGljTQEAAAAAAAAAAAAAAAAAAAACCwYAAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAEIAQD0AVsDdP8AAAAAAAAKAAAASEdTR290aGljTQIAAAAAAAAAAAAAAAAAAAACCwYAAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAEIAQD0AVsDdP8AAAAAAAALAAAASEdHeW9zaG90YWkAAAAAAAAAAAAAAAAAAAAAAwAGCQAAAAAAAIECAID4bMcoEAAAAAAAAAAAAAIAAAAAAJABBQAGCgEA9AFbA3T/AAAAAAAADAAAAEhHUEd5b3Nob3RhaQEAAAAAAAAAAAAAAAAAAAADAAYAAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAYKAQD0AVsDdP8AAAAAAAAMAAAASEdTR3lvc2hvdGFpAgAAAAAAAAAAAAAAAAAAAAMABgAAAAAAAACBAgCA+GzHKBAAAAAAAAAAAAACAAAAAACQAQUABgoBAPQBWwN0/wAAAAAAAA0AAABIR0t5b2thc2hvdGFpAAAAAAAAAAAAAAAAAAAAAAICBgkAAAAAAACBAgCA+GzHKBAAAAAAAAAAAAACAAAAAACQAQUACAEBAPQBWwN0/wAAAAAAAA4AAABIR1BLeW9rYXNob3RhaQEAAAAAAAAAAAAAAAAAAAACAgYAAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAgBAQD0AVsDdP8AAAAAAAAOAAAASEdTS3lva2FzaG90YWkCAAAAAAAAAAAAAAAAAAAAAgIGAAAAAAAAAIECAID4bMcoEAAAAAAAAAAAAAIAAAAAAJABBQAIAQEA9AFbA3T/AAAAAAAACQAAAEhHTWluY2hvQgAAAAAAAAAAAAAAAAAAAAACAggJAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAUBAQD0AVsDdP8AAAAAAAAKAAAASEdQTWluY2hvQgEAAAAAAAAAAAAAAAAAAAACAggAAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAUBAQD0AVsDdP8AAAAAAAAKAAAASEdTTWluY2hvQgIAAAAAAAAAAAAAAAAAAAACAggAAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAUBAQD0AVsDdP8AAAAAAAAJAAAASEdNaW5jaG9FAAAAAAAAAAAAAAAABAAAAAICCQkAAAAAAAD/AgDg+/3HahIAAAAAAAAAnwACQAAA19+QAQUABQEBAPQBWwN0/wAA8AHeAgoAAABIR1BNaW5jaG9FAQAAAAAAAAAAAAAAAAAAAAICCQAAAAAAAAD/AgDg+/3HahIAAAAAAAAAnwACQAAA19+QAQUABQEBAPQBWwN0/wAA7AHWAgoAAABIR1NNaW5jaG9FAgAAAAAAAAAAAAAAAAAAAAICCQAAAAAAAAD/AgDg+/3HahIAAAAAAAAAnwACQAAA19+QAQUABQEBAPQBWwN0/wAA7AHWAhAAAABIR1NvZWlLYWt1cG9wdGFpAAAAAAAAAAAAAAAABAAAAAQLCgkAAAAAAAD/AgDg+/3HahIAAAAAAAAAnwACQAAA19+QAQUAAwkBAPQBWwN0/wAAJgIgAxEAAABIR1BTb2VpS2FrdXBvcHRhaQEAAAAAAAAAAAAAAAAAAAAECwoAAAAAAAAA/wIA4Pv9x2oSAAAAAAAAAJ8AAkAAANffkAEFAAMJAQD0AVsDdP8AAE0CKAMRAAAASEdTU29laUtha3Vwb3B0YWkCAAAAAAAAAAAAAAAAAAAABAsKAAAAAAAAAP8CAOD7/cdqEgAAAAAAAACfAAJAAADX35ABBQADCQEA9AFbA3T/AABNAigDEAAAAEhHU29laVByZXNlbmNlRUIAAAAAAAAAAAAAAAAAAAAAAgIICQAAAAAAAIECAID4bMcoEAAAAAAAAAAAAAIAAAAAAJABBQAFAQEA9AFbA3T/AAAAAAAAEQAAAEhHUFNvZWlQcmVzZW5jZUVCAQAAAAAAAAAAAAAAAAAAAAICCAAAAAAAAACBAgCA+GzHKBAAAAAAAAAAAAACAAAAAACQAQUABQEBAPQBWwN0/wAAAAAAABEAAABIR1NTb2VpUHJlc2VuY2VFQgIAAAAAAAAAAAAAAAAAAAACAggAAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAUBAQD0AVsDdP8AAAAAAAASAAAASEdTb2VpS2FrdWdvdGhpY1VCAAAAAAAAAAAAAAAABAAAAAILCQkAAAAAAAD/AgDg+/3HahIAAAAAAAAAnwACQAAA19+QAQUAAQgBAPQBWwN0/wAAOgIBAxMAAABIR1BTb2VpS2FrdWdvdGhpY1VCAQAAAAAAAAAAAAAAAAAAAAILCQAAAAAAAAD/AgDg+/3HahIAAAAAAAAAnwACQAAA19+QAQUAAQgBAPQBWwN0/wAAOgIFAxMAAABIR1NTb2VpS2FrdWdvdGhpY1VCAgAAAAAAAAAAAAAAAAAAAAILCQAAAAAAAAD/AgDg+/3HahIAAAAAAAAAnwACQAAA19+QAQUAAQgBAPQBWwN0/wAAOgIFAxEAAABIR1NlaWthaXNob3RhaVBSTwAAAAAAAAAAAAAAAAAAAAADAAYAAAAAAAAAgQIAgPhsxygQAAAAAAAAAAAAAgAAAAAAkAEFAAcKAQD0AVsDdP8AAAAAAAAQAAAASEdNYXJ1R290aGljTVBSTwAAAAAAAAAAAAAAAAAAAAACDwYAAAAAAAAA/wIA4Pv9x2oSAAAAAAAAAJ8AAkAAANffkAEFAAkIAQD0AVsDdP8AAA8C9QISAAAATWljcm9zb2Z0IEhpbWFsYXlhAAAAAAAAAAAAAAAAAAAAAAEBAQABAQEBAQEDAACAAAABAEAAAAAAAAAAAQAAAAAAAACQAQUAAAoBAJoBTwJo/lQAKwG7AQgAAABNb2V1bVQgUgAAAAAAAAAAAAAAAAAAAAACAwUEAAEBAQEBpwIAgPt81ykQAAAAAAAAAAAACAAAAAAAkAEFAAAAAQD0AVsDdP+UAAAAAAAGAAAARXhwbyBNAQAAAAAAAAAAAAAAAAAAAAIDBQQAAQEBAQGnAgCA+3zXKRAAAAAAAAAAAAAIAAAAAACQAQUAAAABAPQBWwN0/5QAAAAAAAUAAABZZXQgUgAAAAAAAAAAAAAAAAAAAAACAwUEAAEBAQEBpwIAgPt81ykQAAAAAAAAAAAACAAAAAAAkAEFAAAAAQD0AVsDdP+UAAAAAAAIAAAAUHl1bmppIFIAAAAAAAAAAAAAAAAAAAAAAgMFBAABAQEBAacCAID7fNcpEAAAAAAAAAAAAAgAAAAAAJABBQAAAAEA9AFbA3T/lAAAAAAABQAAAEFtaSBSAAAAAAAAAAAAAAAAAAAAAAIDBQQAAQEBAQGnAgCA+3zXARAAAAAAAAAAAAAIAAAAAACQAQUAAAABAPQBWwN0/5QAAAAAAAcAAABNYWdpYyBSAAAAAAAAAAAAAAAAAAAAAAIDBQQAAQEBAQGnAgCA+3zXARAAAAAAAAAAAAAIAAAAAACQAQUAAAABAPQBWwN0/5QAAAAAAAoAAABIZWFkbGluZSBSAAAAAAAAAAAAAAAAAAAAAAIDBQQAAQEBAQGnAgCA+3zXARAAAAAAAAAAAAAIAAAAAACQAQUAAAABAPQBWwN0/5QAAAAAAA8AAABIaWdoIFRvd2VyIFRleHQAAAAAAAAAAAAAAAAAAAAAAgQFAgUFBgMDAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQADAQEAogHkAv3+VAAAAAAADwAAAEhpZ2ggVG93ZXIgVGV4dAAAAAAAAAAAAQAAAAAAAAACBAUCBQUGCgMDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAMBAQB3AR8DOP9UAAAAAAAGAAAASW1wYWN0AAAAAAAAAAAAAAAAAAAAAAILCAYDCQIFAgSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+QAQMABQgBAFQCFgOR/6cAhwIWAxEAAABJbXByaW50IE1UIFNoYWRvdwAAAAAAAAAAAAAAAAAAAAAEAgYFBgMDAwICAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAMEAQCkAb0CEP+AAAAAAAAOAAAASW5mb3JtYWwgUm9tYW4AAAAAAAAAAAAAAAAAAAAAAwYEAgMEBgsCBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAPBwEAaQHuAgb/AAAAAAAADAAAAElza29vbGEgUG90YQAAAAAAAAAAAAAAAAAAAAACCwUCBAIEAgIDAwAAAAAAAAAAAgAAAAAAAAEAACAAAAAAkAEFAAUBAQCvArUCDP/FAL8BlgIMAAAASXNrb29sYSBQb3RhAAAAAAEAAAAAAAAAAAAAAAILCAIEAgQCAgMDAAAAAAAAAAACAAAAAAAAAQAAIAAAAAC8AgUABQEBAL0CtQIM/8UAwAGWAg4AAABCbGFja2FkZGVyIElUQwAAAAAAAAAAAAAAAAAAAAAEAgUFBRAHAg0CAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAYKAQA4AYADfv4AAAAAAAAUAAAARWR3YXJkaWFuIFNjcmlwdCBJVEMAAAAAAAAAAAAAAAAAAAAAAwMDAgQHBw0IBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBgADCgEA/gBQA7j+AAAAAAAACwAAAEtyaXN0ZW4gSVRDAAAAAAAAAAAAAAAAAAAAAAMFBQIEAgIDAgIDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQYABgoBAOoBAwS0/gAAAAAAABIAAABJdGFsaWMgT3V0bGluZSBBcnQAAAAAAAAAAAAAAAAAAAAAAgEEAAAAAAAAAABgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEAkgLtBbT9AAAAAAAACAAAAEpva2VybWFuAAAAAAAAAAAAAAAAAAAAAAQJBgUGDQYCBwIDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAwkBAOgBYwPC/gAAAAAAAAkAAABKdWljZSBJVEMAAAAAAAAAAAAAAAAAAAAABAQEAwQKAgICAgMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAICgEAIwH3AhD/yAAAAAAACAAAAERGS2FpLVNCAAAAAAAAAAAAAAAABAAAAAMABQkAAAAAAAADAAAAAAAuCBYAAAAAAAAAAQAQAAAAAACQAQUABwoBAPQBIAM5/8cAAAAAAAcAAABLYWxpbmdhAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMDAAgAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAEgC5AMY/nICAgLFAgcAAABLYWxpbmdhAAAAAAEAAAAAAAAAAAAAAAILCAIEAgQCAgMDAAgAAAAAAAAAAAAAAAAAAQAAAAAAAAC8AgUAAAABAE4C5AMY/nICAALFAgcAAABLYXJ0aWthAAAAAAAAAAAAAAAAAAAAAAICBQMDBAQGAgMDAIAAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAEED1gNF/gAAGQLkAgcAAABLYXJ0aWthAAAAAAEAAAAAAAAAAAAAAAICCAMDBAQGAgMDAIAAAAAAAAAAAAAAAAAAAQAAAAAAAAC8AgUAAAABAEgD1gNF/gAAGQLkAhUAAABLdWZpIEV4dGVuZGVkIE91dGxpbmUAAAAAAAAAAAAAAAAAAAAABAEEAQEBAQEBAQBgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEAVQJWBdb9AAAAAAAAEwAAAEt1ZmkgT3V0bGluZSBTaGFkZWQAAAAAAAAAAAAAAAAAAAAABAEEAQEBAQEBAQBgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEAAQL4BOX9AAAAAAAACAAAAEtobWVyIFVJAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMvAACASiAAAAAAAQAAAAAAAQAAAAAAAACQAQUABQgBAJUC2AIu/4MA9AG8AggAAABLaG1lciBVSQAAAAABAAAAAAAAAAAAAAACCwcCBAIEAgIDLwAAgEogAAAAAAEAAAAAAAEAAAAAAAAAvAIFAAUIAQDAAtgCLv+DAPQBvAIGAAAAS29raWxhAAAAAAAAAAAAAAAAAAAAAAILBgQCAgICAgQDgAAAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAKABGAJa/24BWgEAAgYAAABLb2tpbGEAAAAAAQAAAAAAAAAAAAAAAgsIBAICAgICBAOAAAAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAAAAEAwAEMAlr/egFhAQACBgAAAEtva2lsYQAAAAABAAAAAQAAAAAAAAACCwgEAgICAgIEA4AAAAAAAAAAAAAAAAAAAAEAAAAAAAAAvAIFAAAAAQC8AQwCWv96AV4BAAIGAAAAS29raWxhAAAAAAAAAAABAAAAAAAAAAILBgQCAgICAgQDgAAAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAJ8BGQJa/20BVQEAAg4AAABNb25vdHlwZSBLb3VmaQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAACUAgYA9AMAAGICBwCIBgAAAIAAAAAAvAIFAAAAAQCoAQAAAADoAwAAAAAPAAAAS3Vuc3RsZXIgU2NyaXB0AAAAAAAAAAAAAAAAAAAAAAMDBAICBgcNDQYDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAwoBAPUAFgIQ/xEBAAAAAAYAAABMYW8gVUkAAAAAAAAAAAAAAAAAAAAAAgsFAgQCBAICAwMAAAIAAAAAAAAAAAAAAAABAAAAAAAAAJABBQAFCAEAKgLYAi7/gwD0AbwCBgAAAExhbyBVSQAAAAABAAAAAAAAAAAAAAACCwgCBAIEAgIDAwAAAgAAAAAAAAAAAAAAAAEAAAAAAAAAvAIFAAUIAQBLAtgCLv+DAPQBvAIFAAAATGF0aGEAAAAAAAAAAAAAAAAAAAAAAgsGBAICAgICBAMAEAAAAAAAAAAAAAAAAAABAAAAAAAAAJABBQAAAAEA0wLoA2z9AADSAYQCBQAAAExhdGhhAAAAAAEAAAAAAAAAAAAAAAILBwQCAgICAgQDABAAAAAAAAAAAAAAAAAAAQAAAAAAAAC8AgUAAAABAPAC6ANs/QAA0gGEAgoAAABXaWRlIExhdGluAAAAAAAAAAAAAAAAAAAAAAIKCgcFBQUCBAQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQkAAAABADoDvAIi/5MAAAAAAA0AAABMdWNpZGEgQnJpZ2h0AAAAAAAAAAAAAAAAAAAAAAIEBgIFBQUCAwQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAAIBAOsBAgMz/xcAAAAAAA0AAABMdWNpZGEgQnJpZ2h0AAAAAAEAAAAAAAAAAAAAAAIEBwIGBQUCAwQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAABYAgUAAAIBAP8BAgMz/xcAAAAAAA0AAABMdWNpZGEgQnJpZ2h0AAAAAAEAAAABAAAAAAAAAAIEBwIFBQUJAwQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAABYAgUAAAIBAPsBAgMz/xcAAAAAAA0AAABMdWNpZGEgQnJpZ2h0AAAAAAAAAAABAAAAAAAAAAIEBgIFBQUJAwQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAAIBAOIBAgMz/xcAAAAAABIAAABMdWNpZGEgQ2FsbGlncmFwaHkAAAAAAAAAAAAAAAAAAAAAAwEBAQEBAQEBAQMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAFCgEAGQJXA7v+TP8AAAAADwAAAExlZCBJdGFsaWMgRm9udAAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQDHAu0F7QEAAAAAAAAKAAAATGVlbGF3YWRlZQAAAAAAAAAAAAAAAAAAAAACCwUCBAIEAgIDAQAAAQAAAAAAAAAAAAAAAAEAASAAAAAAkAEFAAUIAQAWAr0DEv9TAPQBvAIKAAAATGVlbGF3YWRlZQAAAAABAAAAAAAAAAAAAAACCwgCBAIEAgIDAQAAAQAAAAAAAAAAAAAAAAEAASAAAAAAvAIFAAUIAQBFAr0DEv9TAPQBvAIKAAAATHVjaWRhIEZheAAAAAAAAAAAAAAAAAAAAAACBgYCBQUFAgIEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAIFAQACAgIDzQAXAAAAAAAKAAAATHVjaWRhIEZheAAAAAABAAAAAAAAAAAAAAACBgcCBQUFAwIEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAWAIFAAIFAQAbAgIDzQAXAAAAAAAKAAAATHVjaWRhIEZheAAAAAABAAAAAQAAAAAAAAACBgcCBAMFCQIEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAWAIFAAIFAQASAgIDzQAXAAAAAAAKAAAATHVjaWRhIEZheAAAAAAAAAAAAQAAAAAAAAACBgYCBQMFCgMEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAIFAQD5AQIDzQAXAAAAAAASAAAATHVjaWRhIEhhbmR3cml0aW5nAAAAAAAAAAAAAAAAAAAAAAMBAQEBAQEBAQEDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUABAoBADoCVwNFAUz/AAAAAAcAAABMb2JzdGVyAAAAAAAAAAAAAAAAAAAAAAIABQYAAAACAAMvAACASgAAQAAAAAAAAAAABQAAAAAAAACQAQUAAgoBAIEB6AMG/wAA9AHtAgsAAABMb2JzdGVyIFR3bwAAAAABAAAAAAAAAAAAAAACAAUGAAAAAgADLwAAgEoAAEAAAAAAAAAAAAEAAAAAAAAAvAIFAAIKAQAiAugDBv8AAPQB8AILAAAATG9ic3RlciBUd28AAAAAAQAAAAEAAAAAAAAAAgAFBgAAAAIAAy8AAIBKAABAAAAAAAAAAAABAAAAAAAAALwCBQACCgEAIQLoAwb/AAD0AfACCwAAAExvYnN0ZXIgVHdvAAAAAAAAAAABAAAAAAAAAAIABQYAAAACAAMvAACASgAAQAAAAAAAAAAAAQAAAAAAAACQAQUAAgoBAAgC6AMG/wAA9AHyAgsAAABMb2JzdGVyIFR3bwAAAAAAAAAAAAAAAAAAAAACAAUGAAAAAgADLwAAgEoAAEAAAAAAAAAAAAEAAAAAAAAAkAEFAAIKAQAIAugDBv8AAPQB8gINAAAAR3V0dG1hbiBMb2dvMQAAAAAAAAAAAAAAAAAAAAAFAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAkAEFAAAAAQDcAiADyAAAAAAAAAALAAAATHVjaWRhIFNhbnMAAAAAAAAAAAAAAAAAAAAAAgsGAgMFBAICBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQACCAEA6QECA80AFwAAAAAACwAAAEx1Y2lkYSBTYW5zAAAAAAEAAAAAAAAAAAAAAAILBwMEBQQCAgQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAABYAgUAAggBAAkCAgPNABcAAAAAAAsAAABMdWNpZGEgU2FucwAAAAABAAAAAQAAAAAAAAACCwcDBAUECgIEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAWAIFAAIIAQAHAgIDzQAXAAAAAAALAAAATHVjaWRhIFNhbnMAAAAAAAAAAAEAAAAAAAAAAgsGAgMFBAkCBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQACCAEA6QECA80AFwAAAAAAFgAAAEx1Y2lkYSBTYW5zIFR5cGV3cml0ZXIAAAAAAAAAAAAAAAAEAAAAAgsFCQMFBAMCBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBAAJCAEAWgICA80AFwAAAAAAFgAAAEx1Y2lkYSBTYW5zIFR5cGV3cml0ZXIAAAAAAQAAAAAAAAAEAAAAAgsHCQQFBAMCBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAFgCBAAJCAEAWgICA80AFwAAAAAAFgAAAEx1Y2lkYSBTYW5zIFR5cGV3cml0ZXIAAAAAAQAAAAEAAAAEAAAAAgsHCQQFBAoCBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAFgCBAAJCAEAWgICA80AFwAAAAAAFgAAAEx1Y2lkYSBTYW5zIFR5cGV3cml0ZXIAAAAAAAAAAAEAAAAEAAAAAgsFCQMFBAMCBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBAAJCAEAWgICA80AFwAAAAAADgAAAEx1Y2lkYSBDb25zb2xlAAAAAAAAAAAAAAAABAAAAAILBgkEBQQCAgSPAgCAABgAAAAAAAAAAAAAHwAAAAAA19eQAQQACQgBAFoCDwMz/1EAAAAAAAoAAABMZXZlbmltIE1UAAAAAAAAAAAAAAAAAAAAAAIBBQIGAQEBAQEBCAAAAAAAAAAAAAAAAAAAIAAAAAAAIACQAQUAAAABAO8BsAM5/gAAAAAAAAoAAABMZXZlbmltIE1UAAAAAAEAAAAAAAAAAAAAAAIBCAIGAQEBAQEBCAAAAAAAAAAAAAAAAAAAIAAAAAAAIAC8AgUAAAABAO4BsAM5/gAAAAAAABMAAABMdWNpZGEgU2FucyBVbmljb2RlAAAAAAAAAAAAAAAAAAAAAAILBgIDBQQCAgT/GgCAazkAAAAAAAAAAAAAvwAAIAAA99eQAQUAAAABAOkBDwM0/1IAAAAAAAcAAABNYWduZXRvAAAAAAEAAAAAAAAAAAAAAAQDCAUFCAICDQIDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgYABAoBACQCHQM2/1QAAAAAAAsAAABNYWlhbmRyYSBHRAAAAAAAAAAAAAAAAAAAAAACDgUCAwMIAgIEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAgKAQC1AfcC8ADIAAAAAAAOAAAAU2Fra2FsIE1hamFsbGEAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAH8gAKBLIADACAAAAAAAAADTAAAgAAAAAJABBQAAAAEA+wGpAsL+WwFWAfYBDgAAAFNha2thbCBNYWphbGxhAAAAAAEAAAAAAAAAAAAAAAIAAAAAAAAAAAB/IACgSyAAwAgAAAAAAAAA0wAAIAAAAAC8AgUAAAABAAsCqQLC/lsBVQH2AQ0AAABNYWxndW4gR290aGljAAAAAAAAAAAAAAAAAAAAAAILBQMCAAACAASvAgCQ+3zXKRIAAAAAAAAAjQAIAAAAAACQAQUABQgBAM8BHwM4/wAAAALOAg0AAABNYWxndW4gR290aGljAAAAAAEAAAAAAAAAAAAAAAILCAMCAAACAASvAgCQ+3zXKRIAAAAAAAAAjQAIAAAAAAC8AgUABQgBAOgBHwM4/wAAAALNAgYAAABNYW5nYWwAAAAAAAAAAAAAAAAAAAAAAgQFAwUCAwMCAgOAAAAAAAAAAAAAAAAAAAABAAAAAAAAAJABBQAAAAEARQLZBEr+AAAYAuUCBgAAAE1hbmdhbAAAAAABAAAAAAAAAAAAAAACBAUDBQIDAwICA4AAAAAAAAAAAAAAAAAAAAEAAAAAAAAAvAIFAAAAAQBHAtkESv4AABgC5QIPAAAAR3V0dG1hbiBNYW50b3ZhAAAAAAEAAAAAAAAAAAAAAAIBBwEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAAC8AgUAAAABAIAB6gKw/gAAAAAAABUAAABHdXR0bWFuIE1hbnRvdmEtRGVjb3IAAAAAAAAAAAAAAAAAAAAAAgEEAQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEAkwHqArD+AAAAAAAADwAAAEd1dHRtYW4gTWFudG92YQAAAAAAAAAAAAAAAAAAAAACAQQBAQEBAQEBABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAkAEFAAAAAQB/AeoCsf4AAAAAAAAHAAAATWFybGV0dAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAA9AEFAAAAAQC+A+gDAAAAAAAAAAAZAAAATWF0dXJhIE1UIFNjcmlwdCBDYXBpdGFscwAAAAAAAAAAAAAAAAAAAAADAggCBgYCBwICAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAcKAQCsAXIC6/6lAAAAAAAGAAAATWVpcnlvAAAAAAAAAAAAAAAAAAAAAAILBgQDBQQEAgT/AgDg///HahIAAAgAAAAAnwACYAAA19+QAQUAAAgBALwDbQOG//QBJwLfAgYAAABNZWlyeW8BAAAAAAAAAAEAAAAAAAAAAgsGBAMFBAsCBP8CAOD//8dqEgAACAAAAACfAAJgAADX35ABBQAACAEAvANtA4b/9AEnAt8CCQAAAE1laXJ5byBVSQIAAAAAAAAAAAAAAAAAAAACCwYEAwUEBAIE/wIA4P//x2oSAAAIAAAAAJ8AAmAAANffkAEFAAAIAQAYAm0Dhv/0AScC3wIJAAAATWVpcnlvIFVJAwAAAAAAAAABAAAAAAAAAAILBgQDBQQLAgT/AgDg///HahIAAAgAAAAAnwACYAAA19+QAQUAAAgBABgCbQOG//QBJwLfAgYAAABNZWlyeW8AAAAAAQAAAAAAAAAAAAAAAgsIBAMFBAQCBP8CAOD//8dqEgAACAAAAACfAAJgAADX37wCBQAACAEAwANtA4b/9AE1At8CBgAAAE1laXJ5bwEAAAABAAAAAQAAAAAAAAACCwgEAwUECwIE/wIA4P//x2oSAAAIAAAAAJ8AAmAAANffvAIFAAAIAQDAA20Dhv/0ATUC3wIJAAAATWVpcnlvIFVJAgAAAAEAAAAAAAAAAAAAAAILCAQDBQQEAgT/AgDg///HahIAAAgAAAAAnwACYAAA19+8AgUAAAgBABgCbQOG//QBNQLfAgkAAABNZWlyeW8gVUkDAAAAAQAAAAEAAAAAAAAAAgsIBAMFBAsCBP8CAOD//8dqEgAACAAAAACfAAJgAADX37wCBQAACAEAGAJtA4b/9AE1At8CFAAAAE1pY3Jvc29mdCBTYW5zIFNlcmlmAAAAAAAAAAAAAAAAAAAAAAILBgQCAgICAgT/KgDhAgAAwAgAAAAAAAAA/wEBIAAAKCCQAQUABQgBALcB2AIu/4MABgLLAgcAAABNaW5nTGlVAAAAAAAAAAAAAAAABAAAAAICBQkAAAAAAAD/AgCg+vzPKBYAAAAAAAAAAQAQAAAAAACQAQUABQEBAPQBIAM5/8cArQGTAggAAABQTWluZ0xpVQEAAAAAAAAAAAAAAAAAAAACAgUAAAAAAAAA/wIAoPr8zygWAAAAAAAAAAEAEAAAAAAAkAEFAAUBAQD0ASADOf/HAK0BkwINAAAATWluZ0xpVV9IS1NDUwIAAAAAAAAAAAAAAAAAAAACAgUAAAAAAAAA/wIAoPr8zzgWAAAAAAAAAAEAEAAAAAAAkAEFAAUBAQD0ASADOf/HAK0BkwIMAAAATWluZ0xpVS1FeHRCAAAAAAAAAAAAAAAAAAAAAAICBQAAAAAAAAAvAACACAAAAgAAAAAAAAAAAQAQAAAAAACQAQUABQEBAPQBIAM5/8cArQGTAg0AAABQTWluZ0xpVS1FeHRCAQAAAAAAAAAAAAAAAAAAAAICBQAAAAAAAAAvAACACAAAAgAAAAAAAAAAAQAQAAAAAACQAQUABQEBAPQBIAM5/8cArQGTAhIAAABNaW5nTGlVX0hLU0NTLUV4dEICAAAAAAAAAAAAAAAAAAAAAgIFAAAAAAAAAC8AAIAIAAACAAAAAAAAAAABABAAAAAAAJABBQAFAQEA9AEgAzn/xwCtAZMCDgAAAEd1dHRtYW4gTWlyeWFtAAAAAAEAAAAAAAAAAAAAAAIBBwEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAAC8AgUAAAABAHIB6gKw/gAAAAAAAA8AAABHdXR0bWFuLUNvdXJNaXIAAAAAAAAAAAAAAAAEAAAAAgEECQEBAQEBAQAYAAAAAABAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEABAIgA4b+AAAAAAAADgAAAEd1dHRtYW4gTWlyeWFtAAAAAAAAAAAAAAAAAAAAAAIBAwEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAAAsAQUAAAABAHEB6gKw/gAAAAAAAAcAAABNaXN0cmFsAAAAAAAAAAAAAAAAAAAAAAMJBwIDBAcCBAOHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+QAQUAAAABAEIBkAIK/2EAAAAAAAwAAABNeWFubWFyIFRleHQAAAAAAAAAAAAAAAAAAAAAAgsFAgQCBAICAwMAAAAAAAAAAAQAAAAAAAABAAAAAAAAAJABBQAFCAEAJQKeArf+XAP0AbwCDQAAAE1vZGVybiBOby4gMjAAAAAAAAAAAAAAAAAAAAAAAgcHBAcFBQIDAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQABAgEAkAGNAi//RgAAAAAADwAAAE1vbmdvbGlhbiBCYWl0aQAAAAAAAAAAAAAAAAAAAAADAAUAAAAAAAAAIwAAgAAAAAAAAAIAAAAAAAEAAAAAAAAAkAEFAAcKAQCuAUwDJf9ZAKsB0gIJAAAATW9vbEJvcmFuAAAAAAAAAAAAAAAAAAAAAAILAQABAQEBAQEPAACASiAAAAAAAQAAAAAAAQAAAAAAAACQAQUABQgBAJABqgJt/R4AFgHYAQYAAABNaXJpYW0AAAAAAAAAAAAAAAAAAAAAAgsFAgUBAQEBAQEIAAAAAAAAAAAAAAAAAAAgAAAAAAAgAJABBQAAAAEAkQHyAvf+AAAAAAAADAAAAE1pcmlhbSBGaXhlZAAAAAAAAAAAAAAAAAQAAAACCwUJBQEBAQEBAQgAAAAAAAAAAAAAAAAAACAAAAAAACAAkAEFAAAAAQBYAuEC9/4AAAAAAAAYAAAARml4ZWQgTWlyaWFtIFRyYW5zcGFyZW50AAAAAAAAAAAAAAAABAAAAAAAAAkAAAAAAAAACAAAAAAAAAAAAAAAAAAAIAAAAAAAAACQAQUAAAABAFgCQAPU/gAAAAAAABIAAABNaXJpYW0gVHJhbnNwYXJlbnQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEAnQGJAy3/AAAAAAAACQAAAE1TIEdvdGhpYwAAAAAAAAAAAAAAAAQAAAACCwYJBwIFCAIE/wIA4Pv9x2oSAAAIAAAAAJ8AAkAAANffkAEFAAEIAQD0AVsDdP8AAMEBpwIMAAAATVMgVUkgR290aGljAQAAAAAAAAAAAAAAAAAAAAILBgAHAgUIAgT/AgDg+/3HahIAAAgAAAAAnwACQAAA19+QAQUAAQgBAKEBWwN0/wAAwQGnAgoAAABNUyBQR290aGljAgAAAAAAAAAAAAAAAAAAAAILBgAHAgUIAgT/AgDg+/3HahIAAAgAAAAAnwACQAAA19+QAQUAAQgBAKEBWwN0/wAAwQGnAhIAAABNaWNyb3NvZnQgSmhlbmdIZWkAAAAAAAAAAAAAAAAAAAAAAgsGBAMFBAQCBIcAAAAAQK8oFgAAAAAAAAAJABAAAAAAAJABBQACCAEA1AF6A5P/AAAcAvQCFQAAAE1pY3Jvc29mdCBKaGVuZ0hlaSBVSQEAAAAAAAAAAAAAAAAAAAACCwYEAwUEBAIEhwAAAABArygWAAAAAAAAAAkAEAAAAAAAkAEFAAIIAQDUAXoDk/8AABwC9AISAAAATWljcm9zb2Z0IEpoZW5nSGVpAAAAAAEAAAAAAAAAAAAAAAILCAMCBQQEAgSHAAAAAECvKBYAAAAAAAAACQAQAAAAAAC8AgUAAggBAOEBegOT/wAAHAL0AhUAAABNaWNyb3NvZnQgSmhlbmdIZWkgVUkBAAAAAQAAAAAAAAAAAAAAAgsIAwIFBAQCBIcAAAAAQK8oFgAAAAAAAAAJABAAAAAAALwCBQACCAEA4QF6A5P/AAAcAvQCCQAAAE1TIE1pbmNobwAAAAAAAAAAAAAAAAQAAAACAgYJBAIFCAME/wIA4Pv9x2oSAAAIAAAAAJ8AAkAAANffkAEFAAUBAQD0AVsDdP8AAMEBpwIKAAAATVMgUE1pbmNobwEAAAAAAAAAAAAAAAAAAAACAgYABAIFCAME/wIA4Pv9x2oSAAAIAAAAAJ8AAkAAANffkAEFAAUBAQCaAVsDdP8AAMEBpwIQAAAATWljcm9zb2Z0IFVpZ2h1cgAAAAABAAAAAAAAAAAAAAACAAAAAAAAAAAAIyAAgAIAAIAIAAAAAAAAAEEAAAAAAAAAvAIFAAACAQCYAasCxP5RABYB2AEQAAAATWljcm9zb2Z0IFVpZ2h1cgAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAIyAAgAIAAIAIAAAAAAAAAEEAAAAAAAAAkAEFAAAAAQCLAasCxP5RABcB1wEPAAAATWljcm9zb2Z0IFlhSGVpAAAAAAAAAAAAAAAAAAAAAAILBQMCAgQCAgSHAgCAUjzPKBYAAAAAAAAAHwAEAAAAAACQAQUABQgBAOEBLAMD/wQAHAL0AhIAAABNaWNyb3NvZnQgWWFIZWkgVUkBAAAAAAAAAAAAAAAAAAAAAgsFAwICBAICBIcCAIBSPM8oFgAAAAAAAAAfAAQAAAAAAJABBQAFCAEA4QEsAwP/BAAcAvQCDwAAAE1pY3Jvc29mdCBZYUhlaQAAAAABAAAAAAAAAAAAAAACCwcDAgIEAgIBhwIAgFI8zygWAAAAAAAAAB8ABAAAAAAAvAIFAAUIAQD7ASwDA/8EABwC9AISAAAATWljcm9zb2Z0IFlhSGVpIFVJAQAAAAEAAAAAAAAAAAAAAAILBwMCAgQCAgGHAgCAUjzPKBYAAAAAAAAAHwAEAAAAAAC8AgUABQgBAPsBLAMD/wQAHAL0AhIAAABNaWNyb3NvZnQgWWkgQmFpdGkAAAAAAAAAAAAAAAAAAAAAAwAFAAAAAAAAAAMAAIACBAEAAgAIAAAAAAABAAAAAAAAAJABBQAHCgEAhgJbA3P/MgB8ARsCEAAAAE1vbm90eXBlIENvcnNpdmEAAAAAAAAAAAEAAAAAAAAAAwEBAQECAQEBAYcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABBQAGCgEAXgGwAv7+egAAAAAADgAAAE1vbm90eXBlIFNvcnRzAAAAAAAAAAAAAAAAAAAAAAUBBgEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAACQAQUAAwwBAOsCAAAAAC0EAAAAAAgAAABNdWRpciBNVAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAWAIFAAAAAQBAApkD5QEAAAAAAAAHAAAATVYgQm9saQAAAAAAAAAAAAAAAAAAAAACAAUAAwIACQAAAwAAAAAAAAAAAQAAAAAAAAEAAAAAAAAAkAEFAAYKAQAyAsoCHv+AAJIBygIJAAAATmV3IEd1bGltAAAAAAAAAAAAAAAAAAAAAAIDBgAAAQEBAQGvAgCw+3zXfzAAAAAAAAAAnwAIQAAA19+QAQUABQEBAPQBWgNz/5QAAAAAABAAAABOaWFnYXJhIEVuZ3JhdmVkAAAAAAAAAAAAAAAAAAAAAAQCBQIHBwMDAgIDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQMAAAIBAO0AHwM4/1QAAAAAAA0AAABOaWFnYXJhIFNvbGlkAAAAAAAAAAAAAAAAAAAAAAQCBQIHBwICAgIDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQMAAAIBAO0AHwM4/1QAAAAAAAoAAABOaXJtYWxhIFVJAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMjgP+ASgAAAAACAAAAAAQAAQAAAAAAAACQAQUABQgBAMwD2AIu/4MA9AG8AgoAAABOaXJtYWxhIFVJAAAAAAEAAAAAAAAAAAAAAAILCAIEAgQCAgMjgP+ASgAAAAACAAAAAAQAAQAAAAAAAAC8AgUABQgBACcE2AIu/4MA9AG8AggAAABOYXJraXNpbQAAAAAAAAAAAAAAAAAAAAACDgUCBQEBAQEBAQgAAAAAAAAAAAAAAAAAACAAAAAAACAAkAEFAAAAAQCAAd4C9/4AAAAAAAAVAAAATWljcm9zb2Z0IE5ldyBUYWkgTHVlAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMDAAAAAAAAAAAAAIAAAAAAAQAAAAAAAACQAQUABQgBAEgC7gIV/1MA9AG8AhUAAABNaWNyb3NvZnQgTmV3IFRhaSBMdWUAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICAwMAAAAAAAAAAAAAgAAAAAABAAAAAAAAALwCBQAFCAEAbALvAhb/UwD0AbwCBQAAAE55YWxhAAAAAAAAAAAAAAAAAAAAAAIABQQHAwACAANvAACgAAAAAAAIAAAAAAAAkwAAAAAAAACQAQUAAAABAC4C7gJX/30AbQFAAg4AAABPQ1IgQSBFeHRlbmRlZAAAAAAAAAAAAAAAAAAAAAACAQUJAgECAQMDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAA8IAQBcAogCUf/1AAAAAAAEAAAAT0NSQgAAAAAAAAAAAAAAAAQAAAACCwYJAgICAgIEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEIAAAIAQBaAsICXP8rAgAAAAAOAAAAT2xkIEFudGljIEJvbGQAAAAAAAAAAAAAAAAAAAAAAgEEAAAAAAAAAABgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEArAGoBeX9AAAAAAAAFAAAAE9sZCBBbnRpYyBEZWNvcmF0aXZlAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAKYB7QXl/QAAAAAAABEAAABPbGQgQW50aWMgT3V0bGluZQAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQDQAQoG5f0AAAAAAAATAAAAT2xkIEVuZ2xpc2ggVGV4dCBNVAAAAAAAAAAAAAAAAAAAAAADBAkCBAUIAwgGAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAIJAQCFAbsCdv/nAAAAAAAYAAAAT2xkIEFudGljIE91dGxpbmUgU2hhZGVkAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABACsCCgbl/QAAAAAAAAQAAABPbnl4AAAAAAAAAAAAAAAAAAAAAAQFBgIIBwICAgMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAAABAO8A5AJL/5MAAAAAAAkAAABPcGVuIFNhbnMAAAAAAQAAAAAAAAAAAAAAAgsIBgMFBAICBO8CAOBbIABAKAAAAAAAAACfAQAgAAAAALwCBQACCAEAeAL9AhD/QAAhAskCCQAAAE9wZW4gU2FucwAAAAABAAAAAQAAAAAAAAACCwgGAwUEAgIE7wIA4FsgAEAoAAAAAAAAAJ8BACAAAAAAvAIFAAAAAQBTAv0CEP9AACECyQITAAAAT3BlbiBTYW5zIENvbmRlbnNlZAAAAAABAAAAAAAAAAAAAAACCwgGAwUEAgIE7wIA4FsgAEAoAAAAAAAAAJ8BACAAAAAAvAIDAAIIAQD0Af0CEP9AAB8CyQIZAAAAT3BlbiBTYW5zIENvbmRlbnNlZCBMaWdodAAAAAAAAAAAAAAAAAAAAAACCwMGAwUEAgIE7wIA4FsgAEAoAAAAAAAAAJ8BACAAAAAALAEDAAABAQCfAf0CEP9AABECyQIZAAAAT3BlbiBTYW5zIENvbmRlbnNlZCBMaWdodAAAAAAAAAAAAQAAAAAAAAACCwMGAwUEAgIE7wIA4FsgAEAoAAAAAAAAAJ8BACAAAAAALAEDAAABAQB6Af0CEP9AABECyQIJAAAAT3BlbiBTYW5zAAAAAAAAAAABAAAAAAAAAAILBgYDBQQCAgTvAgDgWyAAQCgAAAAAAAAAnwEAIAAAAACQAQUAAAABACgC/QIQ/0AAFwLJAgkAAABPcGVuIFNhbnMAAAAAAAAAAAAAAAAAAAAAAgsGBgMFBAICBO8CAOBbIABAKAAAAAAAAACfAQAgAAAAAJABBQACCAEATAL9AhD/QAAXAskCCgAAAE9wZW5TeW1ib2wAAAAAAAAAAAAAAAAAAAAABQEAAAAAAAAAAK8AAIDq7AEQAAAAAAAAAAABAAAAAAAAAJABBQAAAAEA3gIfA8gAAAAAAAAABgAAAE9zd2FsZAAAAAABAAAAAAAAAAAAAAACAAgDAAAAAAAA7wAAoEsAAEAAAAAAAAAAAJMAAAAAAAAAvAIFAAAAAQCHAakE4P4AAAAAAAAGAAAAT3N3YWxkAAAAAAAAAAAAAAAAAAAAAAIABQMAAAAAAABvAACgSwAAQAAAAAAAAAAAkwAAAAAAAACQAQUAAAABAIUBqQTg/gAAAAAAAAoAAABNUyBPdXRsb29rAAAAAAAAAAAAAAAAAAAAAAUBAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAACQAQUAAAwBALoDHwM4/wAAAAAAAAgAAABQYWNpZmljbwAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAALwAAgEsAAEAAAAAAAAAAAAEAAAAAAAAAkAEFAAAAAQA5AhYFO/4AALQAMgIRAAAAUGFsYXRpbm8gTGlub3R5cGUAAAAAAAAAAAAAAAAAAAAAAgQFAgUFBQMDBIcCAOATAABAAAAAAAAAAACfAQAgAAAAAJABBQAEAQEAvQHbAuT+TQEGAssCEQAAAFBhbGF0aW5vIExpbm90eXBlAAAAAAEAAAAAAAAAAAAAAAIEBwIGAwUKAgSHAgDgEwAAQAAAAAAAAAAAnwEAIAAAAAC8AgUABAEBAMoB2wLk/k0BBgLLAhEAAABQYWxhdGlubyBMaW5vdHlwZQAAAAABAAAAAQAAAAAAAAACBAcCBgMFCgIEhwIA4BMAAEAAAAAAAAAAAJ8BACAAAAAAvAIFAAQBAQC+AdsC5P5NAQYCywIRAAAAUGFsYXRpbm8gTGlub3R5cGUAAAAAAAAAAAEAAAAAAAAAAgQFAgUDBQoDBIcCAOATAABAAAAAAAAAAACfAQAgAAAAAJABBQAEAQEAkAHbAuT+TQEGAssCEAAAAFBhbGFjZSBTY3JpcHQgTVQAAAAAAAAAAAEAAAAAAAAAAwMDAgIGBwwLBQMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQADCgEA4ADuAQz/SwEAAAAABwAAAFBhcHlydXMAAAAAAAAAAAAAAAAAAAAAAwcFAgYFAgMCBQMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAFCgEAnAEvA2L+AAAAAAAACQAAAFBhcmNobWVudAAAAAAAAAAAAAAAAAAAAAADBAYCBAcIBAgEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAIJAQCtAJYBdP9PAAAAAAAIAAAAUGVycGV0dWEAAAAAAQAAAAEAAAAAAAAAAgIIAgYEAQkDAwMAAAAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAGAQEAhAFzAtH+igAAAAAACAAAAFBlcnBldHVhAAAAAAEAAAAAAAAAAAAAAAICCAIGBAECAwMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgUABgEBAKoBcwLR/ooAAAAAAAgAAABQZXJwZXR1YQAAAAAAAAAAAQAAAAAAAAACAgUCBgQBCQMDAwAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAkAEFAAYBAQA+AXMC0f6KAAAAAAATAAAAUGVycGV0dWEgVGl0bGluZyBNVAAAAAABAAAAAAAAAAAAAAACAggCBgUFAggEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAvAIFAAECAQCJAs8Cbv/LAAAAAAATAAAAUGVycGV0dWEgVGl0bGluZyBNVAAAAAAAAAAAAAAAAAAAAAACAgUCBgUFAggEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAALAEFAAECAQBTAs8Cd//VAAAAAAAIAAAAUGVycGV0dWEAAAAAAAAAAAAAAAAAAAAAAgIFAgYEAQIDAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAGAQEAZwFzAtH+igAAAAAAEQAAAE1pY3Jvc29mdCBQaGFnc1BhAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMDAAAAAAAgAAAAAAgAAAAAAQAAAAAAAACQAQUABQgBAPgC2AIu/4MA9AG8AhEAAABNaWNyb3NvZnQgUGhhZ3NQYQAAAAABAAAAAAAAAAAAAAACCwgCBAIEAgIDAwAAAAAAIAAAAAAIAAAAAAEAAAAAAAAAvAIFAAAIAQAPA9gCLv+DAPQBvAIUAAAAUGxhbnRhZ2VuZXQgQ2hlcm9rZWUAAAAAAAAAAAAAAAAAAAAAAgIGAgcBAAAAAAMAAAAAAAAAABAAAAAAAAABAAAAAAAAAJABBQAAAgEAuQG4Aub+MADDAaMCCAAAAFBsYXliaWxsAAAAAAAAAAAAAAAAAAAAAAQFBgMKBgICAgIDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQEAAAABAPUAmgJV/2oBAAAAAAwAAABQb29yIFJpY2hhcmQAAAAAAAAAAAAAAAAAAAAAAggFAgUFBQIHAgMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAEAQEAbwG4Ajj/TwAAAAAACAAAAFByaXN0aW5hAAAAAAAAAAAAAAAAAAAAAAMGBAIEBAYIAgQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUABgoBADEBLQNI/gAAAAAAAAwAAABQVCBCb2xkIEFyY2gAAAAAAAAAAAAAAAAAAAAAAgEEAAAAAAAAAABgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEAKQIWBeX9AAAAAAAADgAAAFBUIEJvbGQgQnJva2VuAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABABoCFgXl/QAAAAAAAA0AAABQVCBCb2xkIER1c2t5AAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABACACFgXl/QAAAAAAAA8AAABQVCBCb2xkIEhlYWRpbmcAAAAAAAAAAAAAAAAAAAAAAgEEAAAAAAAAAABgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEAGwIWBeX9AAAAAAAADgAAAFBUIEJvbGQgTWlycm9yAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABABoCQgUJ/gAAAAAAAA0AAABQVCBCb2xkIFN0YXJzAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABACYCFgXl/QAAAAAAABMAAABQVCBTZXBhcmF0ZWQgQmFsb29uAAAAAAAAAAAAAAAAAAAAAAIBBAAAAAAAAAAAYAAAAAAAgAgAAAAAAAAAQAAAAAAAAACQAQUAAAABAFMCFgXl/QAAAAAAAAcAAABQVCBTYW5zAAAAAAEAAAAAAAAAAAAAAAILBwMCAgMCAgTvAgCgSyAAUAAAAAAAAAAAlwAAIAAAAAC8AgUAAggBABkC+gPs/gAA9AG8AgcAAABQVCBTYW5zAAAAAAEAAAABAAAAAAAAAAILBwMCAgMJAgTvAgCgSyAAUAAAAAAAAAAAlwAAIAAAAAC8AgUAAggBAAMC+gPs/gAA9AG8AgcAAABQVCBTYW5zAAAAAAAAAAABAAAAAAAAAAILBQMCAgMJAgTvAgCgSyAAUAAAAAAAAAAAlwAAIAAAAACQAQUAAggBAPcB+gPs/gAA9AG8AgcAAABQVCBTYW5zAAAAAAAAAAAAAAAAAAAAAAILBQMCAgMCAgTvAgCgSyAAUAAAAAAAAAAAlwAAIAAAAACQAQUAAggBAA8C+gPs/gAA9AG8AgUAAABSYWF2aQAAAAAAAAAAAAAAAAAAAAACCwUCBAIEAgIDAwACAAAAAAAAAAAAAAAAAAEAAAAAAAAAkAEFAAAAAQCYAdUDbP19ANIBhAIFAAAAUmFhdmkAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICAwMAAgAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAAAAEARwLVA2z9fQDSAYQCCwAAAFJhZ2UgSXRhbGljAAAAAAAAAAAAAAAAAAAAAAMHBQIEBQcHAwQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQUAAgoBAGABgwL3/gAAAAAAAA0AAABHdXR0bWFuIFJhc2hpAAAAAAAAAAAAAAAAAAAAAAIBBAEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAACQAQUAAAABAGUB6gKw/gAAAAAAAA0AAABHdXR0bWFuIFJhc2hpAAAAAAEAAAAAAAAAAAAAAAIBBwEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAAC8AgUAAAABAHMB6gKw/gAAAAAAAAUAAABSYXZpZQAAAAAAAAAAAAAAAAAAAAAEBAgFBQgJAgYCAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEGAAAKAQCxAh8DOP9UAAAAAAAXAAAATVMgUmVmZXJlbmNlIFNhbnMgU2VyaWYAAAAAAAAAAAAAAAAAAAAAAgsGBAMFBAQCBIcCAAAAAAAAAAAAAAAAAACfAQAgAAAAAJABBQAACAEA/AH8AjL/YgAAAAAAFgAAAE1TIFJlZmVyZW5jZSBTcGVjaWFsdHkAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAJABBQAFCAEAywIAAAAALQQAAAAAEgAAAFJvY2t3ZWxsIENvbmRlbnNlZAAAAAABAAAAAAAAAAAAAAACBgkCAgEFAgQDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAvAIDAAMFAQCeAewCIP9hAAAAAAASAAAAUm9ja3dlbGwgQ29uZGVuc2VkAAAAAAAAAAAAAAAAAAAAAAIGBgMFBAUCAQQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAACQAQMAAwUBAE4B7AIg/2EAAAAAAAgAAABSb2Nrd2VsbAAAAAAAAAAAAAAAAAAAAAACBgYDAgIFAgQDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAMFAQDMAbQCIv+aAAAAAAAIAAAAUm9ja3dlbGwAAAAAAQAAAAAAAAAAAAAAAgYIAwMFBQIEAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAALwCBQADBQEA6wGyAiX/nwAAAAAACAAAAFJvY2t3ZWxsAAAAAAEAAAABAAAAAAAAAAIGCAMDBQUJBAMDAAAAAAAAAAAAAAAAAAAAAwAAIAAAAAC8AgUAAwUBANoBtAIi/5oAAAAAABMAAABSb2Nrd2VsbCBFeHRyYSBCb2xkAAAAAAAAAAAAAAAAAAAAAAIGCQMEBQUCBAMDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAAgAwUAAwUBAFoCtAIq/6IAAAAAAAgAAABSb2Nrd2VsbAAAAAAAAAAAAQAAAAAAAAACBgYDAwUFCQQDAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAMFAQC9AbICIv+cAAAAAAADAAAAUm9kAAAAAAAAAAAAAAAABAAAAAIDBQkFAQEBAQEBCAAAAAAAAAAAAAAAAAAAIAAAAAAAIACQAQUAAAABAFgC3gL3/gAAAAAAAA8AAABSb2QgVHJhbnNwYXJlbnQAAAAAAAAAAAAAAAAEAAAAAAAACQAAAAAAAAAIAAAAAAAAAAAAAAAAAAAgAAAAAAAAAJABBQAAAAEAWAJAA9T+AAAAAAAAEgAAAENlbnR1cnkgU2Nob29sYm9vawAAAAABAAAAAAAAAAAAAAACBAgEBgUFAgMEhwIAAAAAAAAAAAAAAAAAAJ8AACAAANffvAIFAAIEAQALAuQCPf+FAAAAAAASAAAAQ2VudHVyeSBTY2hvb2xib29rAAAAAAEAAAABAAAAAAAAAAIECAQGBQUJAwSHAgAAAAAAAAAAAAAAAAAAnwAAIAAA19+8AgUAAgQBAAIC4wJA/4oAAAAAABIAAABDZW50dXJ5IFNjaG9vbGJvb2sAAAAAAAAAAAEAAAAAAAAAAgQGBAUFBQkDBIcCAAAAAAAAAAAAAAAAAACfAAAgAADX35ABBQACBAEAygHjAj3/hgAAAAAADgAAAFNjcmlwdCBNVCBCb2xkAAAAAAAAAAAAAAAAAAAAAAMEBgIEBgcICQQDAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAC8AgUAAgoBAIkBtwIG/3sAAAAAAAsAAABTZWdvZSBQcmludAAAAAAAAAAAAAAAAAAAAAACAAYAAAAAAAAAjwIAAAAAAAAAAAAAAAAAAJ8AACAAAAFHkAEFAAAKAQCBAlcDyP6e//IBpwILAAAAU2Vnb2UgUHJpbnQAAAAAAQAAAAAAAAAAAAAAAgAIAAAAAAAAAI8CAAAAAAAAAAAAAAAAAACfAAAgAAABR7wCBQAACgEAgAJRA8n+pf/6AagCDAAAAFNlZ29lIFNjcmlwdAAAAAAAAAAAAAAAAAAAAAACCwUEAgAAAAADjwIAAAAAAAAAAAAAAAAAAJ8AAAAAAAAAkAEFAAAKAQCoAukCD/9TAAACoQIMAAAAU2Vnb2UgU2NyaXB0AAAAAAEAAAAAAAAAAAAAAAILCAQCAAAAAAOPAgAAAAAAAAAAAAAAAAAAnwAAAAAAAAC8AgUAAAoBAKYC6gIP/1IACAKoAggAAABTZWdvZSBVSQAAAAAAAAAAAAAAAAAAAAACCwUCBAIEAgID/y4A5H/kAMAJAAAAAAAAAP8BACAAAAAAkAEFAAUIAQAaAtgCLv+DAPQBvAIIAAAAU2Vnb2UgVUkAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICA/8uAOR/5ADACQAAAAAAAAD/AQAgAAAAALwCBQAFCAEATQLYAi7/gwD0AbwCCAAAAFNlZ29lIFVJAAAAAAAAAAABAAAAAAAAAAILBQIEAgQJAgP/BgDke+QAQAEAAAAAAAAAnwEAIAAAAACQAQUAAggBAB8C2AIu/4MA9AG8Ag4AAABTZWdvZSBVSSBMaWdodAAAAAAAAAAAAAAAAAAAAAACCwUCBAIEAgID/y4A5H/kAMAJAAAAAAAAAP8BACAAAAAALAEFAAUIAQAPAtgCLv+DAPQBvAISAAAAU2Vnb2UgVUkgU2VtaWxpZ2h0AAAAAAAAAAAAAAAAAAAAAAILBAIEAgQCAgP/LgDkf+QAwAkAAAAAAAAA/wEAIAAAAABeAQUABQgBABYC2AIu/4MA9AG8AggAAABTZWdvZSBVSQAAAAABAAAAAQAAAAAAAAACCwgCBAIECQID/wYA5HvkAEABAAAAAAAAAJ8BACAAAAAAvAIFAAUIAQBMAtgCLv+DAPQBvAIOAAAAU2Vnb2UgVUkgTGlnaHQAAAAAAAAAAAEAAAAAAAAAAgsDAgQFBAkCA/8GAOR75ABAAQAAAAAAAACfAQAgAAAAACwBBQAFCAEADgLYAi7/gwD0AbwCEQAAAFNlZ29lIFVJIFNlbWlib2xkAAAAAAAAAAAAAAAAAAAAAAILBwIEAgQCAgP/LgDkf+QAwAkAAAAAAAAA/wEAIAAAAABYAgUABQgBADQC2AIu/4MA9AG8AhEAAABTZWdvZSBVSSBTZW1pYm9sZAAAAAAAAAAAAQAAAAAAAAACCwcCBAIECQID/wYA5HvkAEABAAAAAAAAAJ8BACAAAAAAWAIFAAUIAQA/AtgCLv+DAPQBvAISAAAAU2Vnb2UgVUkgU2VtaWxpZ2h0AAAAAAAAAAABAAAAAAAAAAILBAIEAgQJAgP/BgDke+QAQAEAAAAAAAAAnwEAIAAAAABeAQUABQgBABkC2AIu/4MA9AG8Ag8AAABTZWdvZSBVSSBTeW1ib2wAAAAAAAAAAAAAAAAAAAAAAgsFAgQCBAICA2MAAIDv/wASAMAkAAAAAAQBAAAAAAAAQJABBQAFCAEAwQLYAi7/gwD0AbwCDQAAAFNob25hciBCYW5nbGEAAAAAAAAAAAAAAAAAAAAAAgsFAgQCBAICAwMAAQAAAAAAAAAAAAAAAAABAAAAAAAAAJABBQAAAAEA+AEoA1X/EQBaARoCDQAAAFNob25hciBCYW5nbGEAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICAwMAAQAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAAAAEAJwIwAk7/SgF5ASMCDwAAAFNob3djYXJkIEdvdGhpYwAAAAAAAAAAAAAAAAAAAAAEAgkEAgECAgYEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAAAAQApAh0DNv9UAAAAAAAGAAAAU2hydXRpAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMDAAQAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAK4B/ANs/ZwA3gGXAgYAAABTaHJ1dGkAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICAwMABAAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAAAAEAbAL8A2z9nADeAZcCCAAAAEZhbmdTb25nAAAAAAAAAAAAAAAAAAAAAAIBBgkGAQEBAQG/AgCA+nzPOBYAAAAAAAAAAQAEAAAAAACQAQUAAAABAPQBWwN0/4wAuQGbAgYAAABTaW1IZWkAAAAAAAAAAAAAAAAAAAAAAgEGCQYBAQEBAb8CAID6fM84FgAAAAAAAAABAAQAAAAAAJABBQAAAAEA9AFbA3T/jADJAa8CBQAAAEthaVRpAAAAAAAAAAAAAAAAAAAAAAIBBgkGAQEBAQG/AgCA+nzPOBYAAAAAAAAAAQAEAAAAAACQAQUAAAABAPQBWwN0/4wAzAGvAgQAAABMaVN1AAAAAAAAAAAAAAAABAAAAAIBBQkGAQEBAQEBAAAAAAAOCAAAAAAAAAAAAAAEAAAAAACQAQUAAAABAPQBWwN0/4wAAAAAABEAAABTaW1wbGlmaWVkIEFyYWJpYwAAAAABAAAAAAAAAAAAAAACAggDBQQFAgMEAyAAAAAAAAAAAAAAAAAAAEEAAAAAAAggvAIFAAAAAQDgAZsEHv4AABECwwIXAAAAU2ltcGxpZmllZCBBcmFiaWMgRml4ZWQAAAAAAAAAAAAAAAAEAAAAAgcDCQICBQIEBAMgAAAAAAAAAAAAAAAAAABBAAAAAAAIIJABBQAAAAEAVwIfA93+AAAAAAAAEQAAAFNpbXBsaWZpZWQgQXJhYmljAAAAAAAAAAAAAAAAAAAAAAICBgMFBAUCAwQDIAAAAAAAAAAAAAAAAAAAQQAAAAAACCCQAQUAAAABAJgBmwQi/gAAEQLDAgYAAABTaW1TdW4AAAAAAAAAAAAAAAAAAAAAAgEGAAMBAQEBAQMAAAAAAI8oBgAAAAAAAAABAAQAAAAAAJABBQAAAAEA9AFbA3T/jADFAasCBwAAAE5TaW1TdW4BAAAAAAAAAAAAAAAEAAAAAgEGCQMBAQEBAQMAAAAAAI8oBgAAAAAAAAABAAQAAAAAAJABBQAAAAEA9AFbA3T/jADFAasCCwAAAFNpbVN1bi1FeHRCAAAAAAAAAAAAAAAABAAAAAIBBgkGAQEBAQEBAAAAAAAAAgAAAAAAAAAAAQAEAAAAAACQAQUAAAABAPQBWwN0/4wAAAAAAAcAAABZb3VZdWFuAAAAAAAAAAAAAAAABAAAAAIBBQkGAQEBAQEBAAAAAAAOCAAAAAAAAAAAAAAEAAAAAACQAQUAAAABAPQBWwN0/4wAAAAAAAgAAABTbmFwIElUQwAAAAAAAAAAAAAAAAAAAAAEBAoHBgoCAgICAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAgKAQBGAvcCEP/IAAAAAAATAAAAU2ltcGxlIEJvbGQgSnV0IE91dAAAAAAAAAAAAAAAAAAAAAACAQQBAQEBAQEBAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQBOAuIDDP4AAAAAAAAUAAAAUFQgU2ltcGxlIEJvbGQgUnVsZWQAAAAAAAAAAAAAAAAAAAAAAgEEAAAAAAAAAABgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEAGwJHBeX9AAAAAAAAFQAAAFNpbXBsZSBJbmR1c3QgT3V0bGluZQAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQAyAikF5f0AAAAAAAAUAAAAU2ltcGxlIEluZHVzdCBTaGFkZWQAAAAAAAAAAAAAAAAAAAAAAgEEAAAAAAAAAABgAAAAAACACAAAAAAAAABAAAAAAAAAAJABBQAAAAEAngIpBeX9AAAAAAAAEgAAAFNpbXBsZSBPdXRsaW5lIFBhdAAAAAAAAAAAAAAAAAAAAAACAQQAAAAAAAAAAGAAAAAAAIAIAAAAAAAAAEAAAAAAAAAAkAEFAAAAAQASArQE5f0AAAAAAAAMAAAAR3V0dG1hbiBTdGFtAAAAAAAAAAAAAAAAAAAAAAIBBAEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAACQAQUAAAABAKcB6gKw/gAAAAAAAA0AAABHdXR0bWFuIFN0YW0xAAAAAAAAAAAAAAAAAAAAAAIBBAEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAACQAQUAAAABAKcB6gKw/gAAAAAAAAgAAABTVENhaXl1bgAAAAAAAAAAAAAAAAAAAAACAQgABAEBAQEBAQAAAAAADwgAAAAAAAAAAAAABAAAAAAAkAEFAAAAAQC7ASADOP+QAAAAAAAHAAAAU3RlbmNpbAAAAAAAAAAAAAAAAAAAAAAEBAkFDQgCAgQEAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAAAAQAqApoCAABNAQAAAAAKAAAAU1RGYW5nc29uZwAAAAAAAAAAAAAAAAAAAAACAQYABAEBAQEBhwIAAAAADwgAAAAAAAAAAJ8ABAAAANffkAEFAAAAAQCDASADOP+QAAAAAAAGAAAAU1RIdXBvAAAAAAAAAAAAAAAAAAAAAAIBCAAEAQEBAQEBAAAAAAAPCAAAAAAAAAAAAAAEAAAAAACQAQUAAAABALsBIAM4/5AAAAAAAAcAAABTVEthaXRpAAAAAAAAAAAAAAAAAAAAAAIBBgAEAQEBAQGHAgAAAAAPCAAAAAAAAAAAnwAEAAAA19+QAQUAAAABAIMBIAM4/5AAAAAAAAYAAABTVExpdGkAAAAAAAAAAAAAAAAAAAAAAgEIAAQBAQEBAQEAAAAAAA8IAAAAAAAAAAAAAAQAAAAAAJABBQAAAAEAYgGxAv3+kAAAAAAABgAAAFNUU29uZwAAAAAAAAAAAAAAAAAAAAACAQYABAEBAQEBhwIAAAAADwgAAAAAAAAAAJ8ABAAAANffkAEFAAAAAQCDASADOP+QAAAAAAAHAAAAU1RYaWhlaQAAAAAAAAAAAAAAAAAAAAACAQYABAEBAQEBhwIAAAAADwgAAAAAAAAAAJ8ABAAAANffkAEFAAAAAQDhASADOP+QAAAAAAAJAAAAU1RYaW5na2FpAAAAAAAAAAAAAAAAAAAAAAIBCAAEAQEBAQEBAAAAAAAPCAAAAAAAAAAAAAAEAAAAAACQAQUAAAABADkBIAM4/5AAAAAAAAgAAABTVFhpbndlaQAAAAAAAAAAAAAAAAAAAAACAQgABAEBAQEBAQAAAAAADwgAAAAAAAAAAAAABAAAAAAAkAEFAAAAAQCtASADOP+QAAAAAAALAAAAU1RaaG9uZ3NvbmcAAAAAAAAAAAAAAAAAAAAAAgEGAAQBAQEBAYcCAAAAAA8IAAAAAAAAAACfAAQAAADX35ABBQAAAAEA7AEgAzj/kAAAAAAABwAAAFN5bGZhZW4AAAAAAAAAAAAAAAAAAAAAAQoFAgUDBgMDA4cGAAQAAAAAAAAAAAAAAACfAAAgAAAAAJABBQACBQEAowHhAuf+KgGyAaACBgAAAFN5bWJvbAAAAAAAAAAAAAAAAAAAAAAFBQECAQcGAgUHAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAkAEFAAMMAQBYArUCKf+VAAAAAAAGAAAAVGFob21hAAAAAAAAAAAAAAAAAAAAAAILBgQDBQQEAgT/LgDhW2AAwCkAAAAAAAAA/wEBIAAAKCCQAQUAAAgBALwB/AIy/xwAIQLXAgYAAABUYWhvbWEAAAAAAQAAAAAAAAAAAAAAAgsIBAMFBAQCBP8uAOFbYADAKQAAAAAAAAD/AQEgAAAoILwCBQAACAEA+QH8AjL/HAAkAtcCEAAAAE1pY3Jvc29mdCBUYWkgTGUAAAAAAAAAAAAAAAAAAAAAAgsFAgQCBAICAwMAAAAAAAAAAAAAQAAAAAABAAAAAAAAAJABBQAFCAEASgLuAhX/UwD0AbwCEAAAAE1pY3Jvc29mdCBUYWkgTGUAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICAwMAAAAAAAAAAAAAQAAAAAABAAAAAAAAALwCBQAFCAEAawLvAhb/UwD0AbwCCQAAAFRhbGwgUGF1bAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAkAEFAAAAAQAbAWsCnP4AAAAAAAAJAAAAVHcgQ2VuIE1UAAAAAAEAAAABAAAAAAAAAAILCAICAQQJBgMDAAAAAAAAAAAAAAAAAAAAAwAAIAAAAAC8AgUABAgBAH0BsQJE/74AAAAAAAkAAABUdyBDZW4gTVQAAAAAAQAAAAAAAAAAAAAAAgsIAgIBBAIGAwMAAAAAAAAAAAAAAAAAAAADAAAgAAAAALwCBQAECAEAowGxAkT/vgAAAAAAEwAAAFR3IENlbiBNVCBDb25kZW5zZWQAAAAAAQAAAAAAAAAAAAAAAgsIBgIBBAICAwMAAAAAAAAAAAAAAAAAAAADAAAgAAAAALwCBQAECAEAYQGMAkf/5wAAAAAAHgAAAFR3IENlbiBNVCBDb25kZW5zZWQgRXh0cmEgQm9sZAAAAAAAAAAAAAAAAAAAAAACCwgDAgICAgIEAwAAAAAAAAAAAAAAAAAAAAMAACAAAAAAkAEFAAQIAQB8Aa8CR//EAAAAAAATAAAAVHcgQ2VuIE1UIENvbmRlbnNlZAAAAAAAAAAAAAAAAAAAAAACCwYGAgEEAgIDAwAAAAAAAAAAAAAAAAAAAAMAACAAAAAAkAEFAAQIAQAsAYwCR//nAAAAAAAJAAAAVHcgQ2VuIE1UAAAAAAAAAAABAAAAAAAAAAILBgICAQQJBgMDAAAAAAAAAAAAAAAAAAAAAwAAIAAAAACQAQUABAgBAH8BsQJE/74AAAAAAAkAAABUdyBDZW4gTVQAAAAAAAAAAAAAAAAAAAAAAgsGAgIBBAIGAwMAAAAAAAAAAAAAAAAAAAADAAAgAAAAAJABBQAECAEAjgGxAkT/vgAAAAAADwAAAFRlbXB1cyBTYW5zIElUQwAAAAAAAAAAAAAAAAAAAAAEAgQEAw0HAgICAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAUKAQCgAXQD2P6R/wAAAAAPAAAAVGltZXMgTmV3IFJvbWFuAAAAAAAAAAAAAAAAAAAAAAICBgMFBAUCAwT/KgDgQ3gAwAkAAAAAAAAA/wEAQAAA//+QAQUABQEBAJABtQIp/5UAvwGWAg8AAABUaW1lcyBOZXcgUm9tYW4AAAAAAQAAAAAAAAAAAAAAAgIIAwcFBQIDBP8qAOBDeADACQAAAAAAAAD/AQBAAAD//7wCBQAFAQEAqgGlAin/lQDIAZYCDwAAAFRpbWVzIE5ldyBSb21hbgAAAAABAAAAAQAAAAAAAAACAgcDBgUFCQME/woA4EN4AEABAAAAAAAAAL8BAEAAAPffvAIFAAUBAQCcAaUCKf+VALYBlgIPAAAAVGltZXMgTmV3IFJvbWFuAAAAAAAAAAABAAAAAAAAAAICBQMFBAUJAwT/CgDgQ3gAQAEAAAAAAAAAvwEAQAAA99+QAQUABQEBAJEBtgIp/5UArgGWAhIAAABUcmFkaXRpb25hbCBBcmFiaWMAAAAAAQAAAAAAAAAAAAAAAgIIAwcFBQIDBAMgAAAAAACACAAAAAAAAABBAAAAAAAIILwCBQAAAAEA4QH+AwP+AADXAbwCEgAAAFRyYWRpdGlvbmFsIEFyYWJpYwAAAAAAAAAAAAAAAAAAAAACAgYDBQQFAgMEAyAAAAAAAIAIAAAAAAAAAEEAAAAAAAggkAEFAAAAAQDLAeIDDP4AAMoBtQIMAAAAVHJlYnVjaGV0IE1TAAAAAAAAAAAAAAAAAAAAAAILBgMCAgICAgSHAgAAAwAAAAAAAAAAAAAAnwAAIAAAAACQAQUAAggBAMUB4QIz/wAACgLLAgwAAABUcmVidWNoZXQgTVMAAAAAAQAAAAAAAAAAAAAAAgsHAwICAgICBIcCAAADAAAAAAAAAAAAAACfAAAgAAAAALwCBQACCAEA2QHhAjP/AAAKAssCDAAAAFRyZWJ1Y2hldCBNUwAAAAABAAAAAQAAAAAAAAACCwcDAgICCQIEhwIAAAMAAAAAAAAAAAAAAJ8AACAAAAAAvAIFAAIIAQDhAeECM/8AAAoCywIMAAAAVHJlYnVjaGV0IE1TAAAAAAAAAAABAAAAAAAAAAILBgMCAgIJAgSHAgAAAwAAAAAAAAAAAAAAnwAAIAAAAACQAQUAAggBAMoB4QIz/wAACgLLAgUAAABUdW5nYQAAAAAAAAAAAAAAAAAAAAACCwUCBAIEAgIDAwBAAAAAAAAAAAAAAAAAAAEAAAAAAAAAkAEFAAAAAQAkAiUDav1tAJIBLgIFAAAAVHVuZ2EAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICAwMAQAAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAFCAEAKwIlA2r9bQCSAS4CDgAAAEd1dHRtYW4gSGF0enZpAAAAAAEAAAAAAAAAAAAAAAIBBwEBAQEBAQEAGAAAAAAAQAAAAAAAAAAAIAAAAAAAAAC8AgUAAAABAJ0B6gKw/gAAAAAAAA4AAABHdXR0bWFuIEhhdHp2aQAAAAAAAAAAAAAAAAAAAAACAQQBAQEBAQEBABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAkAEFAAAAAQCsAeoCsP4AAAAAAAAGAAAAVWJ1bnR1AAAAAAEAAAAAAAAAAAAAAAILCAQDBgIDAgT/AgDgWyAAUAAAAAAAAAAAnwAAIAAAAVa8AgUAAAABAIMCCANH/zgADgK1AgYAAABVYnVudHUAAAAAAQAAAAEAAAAAAAAAAgsIBAMGAgoCBP8CAOBbIABQAAAAAAAAAACfAAAgAAABVrwCBQAAAAEAegIIA0f/OAAOArUCBgAAAFVidW50dQAAAAAAAAAAAQAAAAAAAAACCwUEAwYCCgIE/wIA4FsgAFAAAAAAAAAAAJ8AACAAAAFWkAEFAAAAAQBIAggDR/84AAgCtQIGAAAAVWJ1bnR1AAAAAAAAAAAAAAAAAAAAAAILBQQDBgIDAgT/AgDgWyAAUAAAAAAAAAAAnwAAIAAAAVaQAQUAAAABAFoCCANH/zgACAK1AhAAAABVYnVudHUgQ29uZGVuc2VkAAAAAAAAAAAAAAAAAAAAAAILBQYDBgIDAgT/AgDgWyAAUAAAAAAAAAAAnwAAIAAAAVaQAQUAAAABAOQBCANH/zgACAK1AgsAAABEaWxsZW5pYVVQQwAAAAABAAAAAAAAAAAAAAACAggDBwUFAgMEJwAAgQIAAAAAAAAAAAAAAAEAAQAAAAAAvAIFAAAAAQAiAXgDBP8AAD8B0AELAAAARGlsbGVuaWFVUEMAAAAAAQAAAAEAAAAAAAAAAgIHAwYFBQkDBCcAAIECAAAAAAAAAAAAAAABAAEAAAAAALwCBQAAAAEAIgF2AwT/AAA/AdABCwAAAERpbGxlbmlhVVBDAAAAAAAAAAABAAAAAAAAAAICBQMFBAUJAwQnAACBAgAAAAAAAAAAAAAAAQABAAAAAACQAQUAAAABABwBbAME/wAAPwHQAQsAAABEaWxsZW5pYVVQQwAAAAAAAAAAAAAAAAAAAAACAgYDBQQFAgMEJwAAgQIAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAAAAQAcAWwDBP8AAD8B0AELAAAARXVjcm9zaWFVUEMAAAAAAQAAAAAAAAAAAAAAAgIIAwcFBQIDBCcAAIECAAAAAAAAAAAAAAABAAEAAAAAALwCBQAAAAEAHwE/AwD/AAAxAcIBCwAAAEV1Y3Jvc2lhVVBDAAAAAAEAAAABAAAAAAAAAAICBwMGBQUJAwQnAACBAgAAAAAAAAAAAAAAAQABAAAAAAC8AgUAAAABAB8BPwMA/wAAMQHCAQsAAABFdWNyb3NpYVVQQwAAAAAAAAAAAQAAAAAAAAACAgUDBQQFCQMEJwAAgQIAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAAAAQAZAUcDG/8AADEBwgELAAAARXVjcm9zaWFVUEMAAAAAAAAAAAAAAAAAAAAAAgIGAwUEBQIDBCcAAIECAAAAAAAAAAAAAAABAAEAAAAAAJABBQAAAAEAGQFHAxj/AAAxAcIBCgAAAEZyZWVzaWFVUEMAAAAAAQAAAAAAAAAAAAAAAgsHBAICAgICBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAALwCBQAAAAEAIQFHAwD/AAAAAAAACgAAAEZyZWVzaWFVUEMAAAAAAQAAAAEAAAAAAAAAAgsHBAICAgkCBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAALwCBQAAAAEAIQFHAwD/AAAAAAAACgAAAEZyZWVzaWFVUEMAAAAAAAAAAAEAAAAAAAAAAgsGBAICAgkCBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAAJABBQAAAAEAIwEwAy7/AAAAAAAACgAAAEZyZWVzaWFVUEMAAAAAAAAAAAAAAAAAAAAAAgsGBAICAgICBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAAJABBQAAAAEAIwEwAy7/AAAAAAAABwAAAElyaXNVUEMAAAAAAQAAAAAAAAAAAAAAAgsHBAICAgICBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAALwCBQAAAAEAIwFIAzT/AAAAAAAABwAAAElyaXNVUEMAAAAAAQAAAAEAAAAAAAAAAgsHBAICAgkCBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAALwCBQAAAAEAIwFIAzT/AAAAAAAABwAAAElyaXNVUEMAAAAAAAAAAAEAAAAAAAAAAgsGBAICAgkCBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAAJABBQAAAAEAGwEvAxv/AAAAAAAABwAAAElyaXNVUEMAAAAAAAAAAAAAAAAAAAAAAgsGBAICAgICBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAAJABBQAAAAEAGwEvAxv/AAAAAAAACgAAAEphc21pbmVVUEMAAAAAAQAAAAAAAAAAAAAAAgIIAwcFBQIDBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAALwCBQAAAAEAMgEHA07/AAAAAAAACgAAAEphc21pbmVVUEMAAAAAAQAAAAEAAAAAAAAAAgIHAwYFBQkDBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAALwCBQAAAAEAMgEHA07/AAAAAAAACgAAAEphc21pbmVVUEMAAAAAAAAAAAEAAAAAAAAAAgIFAwUEBQkDBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAAJABBQAAAAEAEAHOAlf/AAAAAAAACgAAAEphc21pbmVVUEMAAAAAAAAAAAAAAAAAAAAAAgIGAwUEBQIDBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAAJABBQAAAAEAEAHOAlf/AAAAAAAADAAAAEtvZGNoaWFuZ1VQQwAAAAABAAAAAAAAAAAAAAACAggDBwUFAgMEBwAAAQIAAAAAAAAAAAAAAAEAAQAAAAAAvAIFAAAAAQAaAa8CN/8AAAAAAAAMAAAAS29kY2hpYW5nVVBDAAAAAAEAAAABAAAAAAAAAAICBwMGBQUJAwQHAAABAgAAAAAAAAAAAAAAAQABAAAAAAC8AgUAAAABABoBrwI3/wAAAAAAAAwAAABLb2RjaGlhbmdVUEMAAAAAAAAAAAEAAAAAAAAAAgIFAwUEBQkDBAcAAAECAAAAAAAAAAAAAAABAAEAAAAAAJABBQAAAAEAEQGyAj7/AAAAAAAADAAAAEtvZGNoaWFuZ1VQQwAAAAAAAAAAAAAAAAAAAAACAgYDBQQFAgMEBwAAAQIAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAAAAQARAbICPv8AAAAAAAAHAAAATGlseVVQQwAAAAABAAAAAAAAAAAAAAACCwcEAgICAgIEBwAAAQIAAAAAAAAAAAAAAAEAAQAAAAAAvAIFAAAAAQBCAeICTv8AAAAAAAAHAAAATGlseVVQQwAAAAABAAAAAQAAAAAAAAACCwcEAgICCQIEBwAAAQIAAAAAAAAAAAAAAAEAAQAAAAAAvAIFAAAAAQBCAeICTv8AAAAAAAAHAAAATGlseVVQQwAAAAAAAAAAAQAAAAAAAAACCwYEAgICCQIEBwAAAQIAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAAAAQAdAaYCb/8AAAAAAAAHAAAATGlseVVQQwAAAAAAAAAAAAAAAAAAAAACCwYEAgICAgIEBwAAAQIAAAAAAAAAAAAAAAEAAQAAAAAAkAEFAAAAAQAdAaYCb/8AAAAAAAAQAAAAVXJkdSBUeXBlc2V0dGluZwAAAAAAAAAAAAAAAAAAAAADAgQCBAQGAwIDAyAAAAAAAIAIAAAAAAAAANMAACAAAAAAkAEFAAAAAQCSAckC4/5GAIwBaAIGAAAAVXRzYWFoAAAAAAAAAAAAAAAAAAAAAAILBgQCAgICAgQDgAAAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAKUBCQJq/40BcwEAAgYAAABVdHNhYWgAAAAAAQAAAAAAAAAAAAAAAgsIBAICAgICBAOAAAAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAAAAEAuQEJAmr/jQFzAQACBgAAAFV0c2FhaAAAAAABAAAAAQAAAAAAAAACCwgEAgICAgIEA4AAAAAAAAAAAAAAAAAAAAEAAAAAAAAAvAIFAAAAAQC5AQkCav+NAXMBAAIGAAAAVXRzYWFoAAAAAAAAAAABAAAAAAAAAAILBgQCAgICAgQDgAAAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAKUBCQJs/48BcwEAAgQAAABWYW5pAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMDACAAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAwQBANAC9AIo/2AA4QG0AgQAAABWYW5pAAAAAAEAAAAAAAAAAAAAAAILCAIEAgQCAgMDACAAAAAAAAAAAAAAAAAAAQAAAAAAAAC8AgUAAwQBABID9AIo/2AA5AG0AgcAAABWZXJkYW5hAAAAAAAAAAAAAAAAAAAAAAILBgQDBQQEAgT/BgChWyAAQBAAAAAAAAAAnwEAIAAAAACQAQUAAAgBAPwB/AIy/2IAIQLXAgcAAABWZXJkYW5hAAAAAAEAAAAAAAAAAAAAAAILCAQDBQQEAgT/BgChWyAAQBAAAAAAAAAAnwEAIAAAAAC8AgUAAAgBADcC/AIy/2IAJALXAgcAAABWZXJkYW5hAAAAAAAAAAABAAAAAAAAAAILBgQDBQQLAgT/BgChWyAAQBAAAAAAAAAAnwEAIAAAAACQAQUAAAgBAPwB/AIy/2IAIQLXAgcAAABWZXJkYW5hAAAAAAEAAAABAAAAAAAAAAILCAQDBQQLAgT/BgChWyAAQBAAAAAAAAAAnwEAIAAAAAC8AgUAAAgBADcC/AIy/2IAJALXAgYAAABWaWpheWEAAAAAAAAAAAAAAAAAAAAAAgsGBAICAgICBAMAEAAAAAAAAAAAAAAAAAABAAAAAAAAAJABBQAAAAEAXwIvAlP/UAFjARUCBgAAAFZpamF5YQAAAAABAAAAAAAAAAAAAAACCwgEAgICAgIEAwAQAAAAAAAAAAAAAAAAAAEAAAAAAAAAvAIFAAAAAQBjAiECU/9eAWwBFQINAAAAR3V0dG1hbiBWaWxuYQAAAAAAAAAAAAAAAAAAAAACAQQBAQEBAQEBABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAkAEFAAAAAQCFAeoCsP4AAAAAAAANAAAAR3V0dG1hbiBWaWxuYQAAAAABAAAAAAAAAAAAAAACAQcAAAAAAAAAABgAAAAAAEAAAAAAAAAAACAAAAAAAAAAvAIFAAAAAQCOAeoCsP4AAAAAAAAOAAAAVmluZXIgSGFuZCBJVEMAAAAAAAAAAAAAAAAAAAAAAwcFAgMFAgICAwMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABBQAFCgEAyAEJA5n9vf4AAAAABwAAAFZpdmFsZGkAAAAAAAAAAAEAAAAAAAAAAwIGAgUFBgkIBAMAAAAAAAAAAAAAAAAAAAABAAAgAAAAAJABAwAAAAEAJgGHA+P+HgAAAAAADwAAAFZsYWRpbWlyIFNjcmlwdAAAAAAAAAAAAAAAAAAAAAADBQQCBAQHBwMFAwAAAAAAAAAAAAAAAAAAAAEAACAAAAAAkAEFAAMKAQBFAVoC1v5jAAAAAAAGAAAAVnJpbmRhAAAAAAAAAAAAAAAAAAAAAAILBQIEAgQCAgMDAAEAAAAAAAAAAAAAAAAAAQAAAAAAAACQAQUAAAABAHoC2AOF/ikA0AGCAgYAAABWcmluZGEAAAAAAQAAAAAAAAAAAAAAAgsIAgQCBAICAwMAAQAAAAAAAAAAAAAAAAABAAAAAAAAALwCBQAAAAEArgLYA4X+KQDQAYQCCAAAAFdlYmRpbmdzAAAAAAAAAAAAAAAAAAAAAAUDAQIBBQkGBwMAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAACQAQUAAAwBAMsDHwM4/wAAAAAAAAkAAABXaW5nZGluZ3MAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAJABBQAADAEAeQMCA80AFwAAAAAACwAAAFdpbmdkaW5ncyAyAAAAAAAAAAAAAAAAAAAAAAUCAQIBBQcHBwcAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAACQAQUAAAwBAD4DAgPNABcAAAAAAAsAAABXaW5nZGluZ3MgMwAAAAAAAAAAAAAAAAAAAAAFBAECAQgHBwcHAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAkAEFAAAMAQAFAwIDzQAXAAAAAAARAAAASGFuV2FuZ01pbmdNZWRpdW0AAAAAAAAAAAAAAAAAAAAAAgIDAAAAAAAAAOMAAIB6eMk4FgAAAAAAAAAAABAAAAAAAJABBQAAAAEA5AMgAzn/xwAAAAAA"; var _ft_stream=CreateFontData2(_base64_data);var _file_stream=new AscCommon.FileStream(_ft_stream.data,_ft_stream.size);var i=0;this.FONTS_DICT_ASCII_NAMES_COUNT=_file_stream.GetLong();for(i=0;i<this.FONTS_DICT_ASCII_NAMES_COUNT;i++){var _nameInfo=new FD_FontInfo;var _name_len=_file_stream.GetLong();_nameInfo.Name=_file_stream.GetString1(_name_len);_nameInfo.IndexR=_file_stream.GetLong();_nameInfo.IndexI=_file_stream.GetLong();_nameInfo.IndexB=_file_stream.GetLong();_nameInfo.IndexBI=_file_stream.GetLong(); this.FD_Ascii_Names.push(_nameInfo)}for(i=0;i<256;i++)this.FD_Ascii_Names_Offsets[i]=_file_stream.GetLong();this.FONTS_DICT_UNICODE_NAMES_COUNT=_file_stream.GetLong();for(i=0;i<this.FONTS_DICT_UNICODE_NAMES_COUNT;i++){var _nameInfo=new FD_FontInfo;_nameInfo.Name=this.GetString16(_file_stream);_nameInfo.IndexR=_file_stream.GetLong();_nameInfo.IndexI=_file_stream.GetLong();_nameInfo.IndexB=_file_stream.GetLong();_nameInfo.IndexBI=_file_stream.GetLong();this.FD_Unicode_Names.push(_nameInfo)}this.FONTS_DICT_ASCII_FONTS_COUNT= _file_stream.GetLong();for(i=0;i<this.FONTS_DICT_ASCII_FONTS_COUNT;i++){var _nameInfo=new CFontSelect;_nameInfo.fromStream(_file_stream,false);this.FD_Ascii_Files.push(_nameInfo)}},GetString16:function(_file_stream){var _len=_file_stream.GetLong();var _ret=this.GetUTF16_fromUTF8(_file_stream.data,_file_stream.cur,_len);_file_stream.cur+=_len;return _ret},GetUTF16_fromUnicodeChar:function(code){if(code<65536)return String.fromCharCode(code);else{code-=65536;return String.fromCharCode(55296|code>>10& 1023)+String.fromCharCode(56320|code&1023)}},GetUTF16_fromUTF8:function(pBuffer,start,count){var _res="";var lIndex=start;var end=start+count;var val=0;while(lIndex<end){var byteMain=pBuffer[lIndex];if(0==(byteMain&128)){_res+=this.GetUTF16_fromUnicodeChar(byteMain);++lIndex}else if(0==(byteMain&32)){val=(byteMain&31)<<6|pBuffer[lIndex+1]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=2}else if(0==(byteMain&16)){val=(byteMain&15)<<12|(pBuffer[lIndex+1]&63)<<6|pBuffer[lIndex+2]&63;_res+=this.GetUTF16_fromUnicodeChar(val); lIndex+=3}else if(0==(byteMain&8)){val=(byteMain&7)<<18|(pBuffer[lIndex+1]&63)<<12|(pBuffer[lIndex+2]&63)<<6|pBuffer[lIndex+3]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=4}else if(0==(byteMain&4)){val=(byteMain&3)<<24|(pBuffer[lIndex+1]&63)<<18|(pBuffer[lIndex+2]&63)<<12|(pBuffer[lIndex+3]&63)<<6|pBuffer[lIndex+4]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=5}else{val=(byteMain&1)<<30|(pBuffer[lIndex+1]&63)<<24|(pBuffer[lIndex+2]&63)<<18|(pBuffer[lIndex+3]&63)<<12|(pBuffer[lIndex+ 4]&63)<<6|pBuffer[lIndex+5]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=5}}return _res},CorrectParamsFromDictionary:function(oFormat){if(undefined==oFormat.wsName)return false;var nNameLen=oFormat.wsName.length;if(nNameLen==0)return false;var bIsAscii=true;var i=0;for(i=0;i<nNameLen;++i){var _char_code=oFormat.wsName.charCodeAt(i);if(_char_code>255||_char_code<0){bIsAscii=false;break}}var pFont=null;if(bIsAscii){var nStartIndex=this.FD_Ascii_Names_Offsets[oFormat.wsName.charCodeAt(0)];if(-1!= nStartIndex){var nIndex=-1;for(i=nStartIndex;i<this.FONTS_DICT_ASCII_NAMES_COUNT;i++)if(this.FD_Ascii_Names[i].Name==oFormat.wsName){nIndex=i;break}if(nIndex!=-1){var pRec=this.FD_Ascii_Names[nIndex];var nFontIndex=-1;var nStyle=0;if(oFormat.bItalic===true)nStyle|=1;if(oFormat.bBold===true)nStyle|=2;switch(nStyle){case 1:{if(pRec.IndexI!=-1)nFontIndex=pRec.IndexI;else if(pRec.IndexBI!=-1)nFontIndex=pRec.IndexBI;else if(pRec.IndexR!=-1)nFontIndex=pRec.IndexR;else nFontIndex=pRec.IndexB;break}case 2:{if(pRec.IndexB!= -1)nFontIndex=pRec.IndexB;else if(pRec.IndexBI!=-1)nFontIndex=pRec.IndexBI;else if(pRec.IndexR!=-1)nFontIndex=pRec.IndexR;else nFontIndex=pRec.IndexI;break}case 3:{if(pRec.IndexBI!=-1)nFontIndex=pRec.IndexBI;else if(pRec.IndexB!=-1)nFontIndex=pRec.IndexB;else if(pRec.IndexI!=-1)nFontIndex=pRec.IndexI;else nFontIndex=pRec.IndexR;break}case 0:default:{if(pRec.IndexR!=-1)nFontIndex=pRec.IndexR;else if(pRec.IndexI!=-1)nFontIndex=pRec.IndexI;else if(pRec.IndexB!=-1)nFontIndex=pRec.IndexB;else nFontIndex= pRec.IndexBI;break}}if(nFontIndex!=-1)pFont=this.FD_Ascii_Files[nFontIndex]}}}else{var nIndex=-1;for(i=0;i<this.FONTS_DICT_UNICODE_NAMES_COUNT;i++)if(this.FD_Unicode_Names[i].Name==oFormat.wsName){nIndex=i;break}if(nIndex!=-1){var pRec=this.FD_Unicode_Names[nIndex];var nFontIndex=-1;var nStyle=0;if(oFormat.bItalic===true)nStyle|=1;if(oFormat.bBold===true)nStyle|=2;switch(nStyle){case 1:{if(pRec.IndexI!=-1)nFontIndex=pRec.IndexI;else if(pRec.IndexBI!=-1)nFontIndex=pRec.IndexBI;else if(pRec.IndexR!= -1)nFontIndex=pRec.IndexR;else nFontIndex=pRec.IndexB;break}case 2:{if(pRec.IndexB!=-1)nFontIndex=pRec.IndexB;else if(pRec.IndexBI!=-1)nFontIndex=pRec.IndexBI;else if(pRec.IndexR!=-1)nFontIndex=pRec.IndexR;else nFontIndex=pRec.IndexI;break}case 3:{if(pRec.IndexBI!=-1)nFontIndex=pRec.IndexBI;else if(pRec.IndexB!=-1)nFontIndex=pRec.IndexB;else if(pRec.IndexI!=-1)nFontIndex=pRec.IndexI;else nFontIndex=pRec.IndexR;break}case 0:default:{if(pRec.IndexR!=-1)nFontIndex=pRec.IndexR;else if(pRec.IndexI!=-1)nFontIndex= pRec.IndexI;else if(pRec.IndexB!=-1)nFontIndex=pRec.IndexB;else nFontIndex=pRec.IndexBI;break}}if(nFontIndex!=-1)pFont=this.FD_Ascii_Files[nFontIndex]}}if(null==pFont)return false;oFormat.wsName=pFont.m_wsFontName;oFormat.bFixedWidth=pFont.m_bIsFixed==1?true:false;oFormat.pPanose=pFont.m_aPanose;oFormat.ulRange1=pFont.m_ulUnicodeRange1;oFormat.ulRange2=pFont.m_ulUnicodeRange2;oFormat.ulRange3=pFont.m_ulUnicodeRange3;oFormat.ulRange4=pFont.m_ulUnicodeRange4;oFormat.ulCodeRange1=pFont.m_ulCodePageRange1; oFormat.ulCodeRange2=pFont.m_ulCodePageRange2;oFormat.usWeight=pFont.m_usWeigth;oFormat.usWidth=pFont.m_usWidth;oFormat.shAvgCharWidth=pFont.m_shAvgCharWidth;oFormat.shAscent=pFont.m_shAscent;oFormat.shDescent=pFont.m_shDescent;oFormat.shXHeight=pFont.m_shXHeight;oFormat.shCapHeight=pFont.m_shCapHeight;return true},GetFontIndex:function(oSelect,oList,DefaultIndex,isName0){this.CorrectParamsFromDictionary(oSelect);var nMinIndex=0;var nMinPenalty=0;var nDefPenalty=2147483647;var nFontsCount=oList.length; for(var nIndex=0;nIndex<nFontsCount;nIndex++){var nCurPenalty=oList[nIndex].GetPenalty(oSelect,isName0,this.MainUnicodeRanges);if(0==nIndex){nMinIndex=0;nMinPenalty=nCurPenalty}else if(nCurPenalty<nMinPenalty){nMinIndex=nIndex;nMinPenalty=nCurPenalty}if(undefined!=DefaultIndex&&nIndex==DefaultIndex)nDefPenalty=nCurPenalty;if(0==nCurPenalty)break}if(undefined!=DefaultIndex&&nDefPenalty==nMinPenalty)nMinIndex=DefaultIndex;if(undefined==DefaultIndex)return nMinIndex;return oList[nMinIndex]},CheckLikeFonts:function(sFontName, sReqName){var _index=this.FD_Ascii_Font_Like_Main[sReqName];if(undefined===_index)return false;var _arr=this.FD_Ascii_Font_Like_Names[_index];var _len=_arr.length;for(var i=0;i<_len;i++)if(_arr[i]==sFontName)return true;return false}};function CFontSelectFormat(){this.wsName=undefined;this.wsAltName=undefined;this.wsFamilyClass=undefined;this.sFamilyClass=undefined;this.bBold=undefined;this.bItalic=undefined;this.bFixedWidth=undefined;this.pPanose=undefined;this.ulRange1=undefined;this.ulRange2=undefined; this.ulRange3=undefined;this.ulRange4=undefined;this.ulCodeRange1=undefined;this.ulCodeRange2=undefined;this.usWeight=undefined;this.usWidth=undefined;this.nFontFormat=undefined;this.unCharset=undefined;this.shAvgCharWidth=undefined;this.shAscent=undefined;this.shDescent=undefined;this.shLineGap=undefined;this.shXHeight=undefined;this.shCapHeight=undefined}function CFontSelect(){this.m_wsFontName="";this.m_wsFontPath="";this.m_lIndex=0;this.m_bBold=false;this.m_bItalic=false;this.m_bIsFixed=false; this.m_aPanose=null;if(typeof Int8Array!="undefined"&&!window.opera)this.m_aPanose=new Int8Array(10);else this.m_aPanose=new Array(10);this.m_ulUnicodeRange1=0;this.m_ulUnicodeRange2=0;this.m_ulUnicodeRange3=0;this.m_ulUnicodeRange4=0;this.m_ulCodePageRange1=0;this.m_ulCodePageRange2=0;this.m_usWeigth=0;this.m_usWidth=0;this.m_sFamilyClass=0;this.m_eFontFormat=0;this.m_shAvgCharWidth=0;this.m_shAscent=0;this.m_shDescent=0;this.m_shLineGap=0;this.m_shXHeight=0;this.m_shCapHeight=0;this.m_names=null} CFontSelect.prototype={_readStringUtf8:function(stream,len){if(undefined===len)len=stream.GetLong();return AscCommon.GetStringUtf8(stream,len)},fromStream:function(fs,bIsDictionary){var _version=window["__all_fonts_js_version__"];if(undefined===_version)_version=0;var _len=fs.GetLong();if(bIsDictionary===false)this.m_wsFontName=fs.GetString1(_len);else switch(_version){case 0:{this.m_wsFontName=fs.GetString(_len>>1);break}default:{this.m_wsFontName=this._readStringUtf8(fs,_len);var _count=fs.GetLong(); if(0<_count)this.m_names=[];for(var nameI=0;nameI<_count;nameI++)this.m_names.push(this._readStringUtf8(fs));break}}if(bIsDictionary!==false){switch(_version){case 0:{_len=fs.GetLong();this.m_wsFontPath=fs.GetString(_len>>1);break}default:{this.m_wsFontPath=this._readStringUtf8(fs);break}}if(undefined===window["AscDesktopEditor"]){var _found1=this.m_wsFontPath.lastIndexOf("/");var _found2=this.m_wsFontPath.lastIndexOf("\\");var _found=Math.max(_found1,_found2);if(0<=_found)this.m_wsFontPath=this.m_wsFontPath.substring(_found+ 1)}else{this.m_wsFontPath=this.m_wsFontPath.replace(/\\\\/g,"\\");this.m_wsFontPath=this.m_wsFontPath.replace(/\\/g,"/")}}this.m_lIndex=fs.GetLong();this.m_bItalic=1==fs.GetLong();this.m_bBold=1==fs.GetLong();this.m_bIsFixed=1==fs.GetLong();var _panose_len=10;if(bIsDictionary!==false)_panose_len=fs.GetLong();for(var i=0;i<_panose_len;i++)this.m_aPanose[i]=fs.GetUChar();this.m_ulUnicodeRange1=fs.GetULong();this.m_ulUnicodeRange2=fs.GetULong();this.m_ulUnicodeRange3=fs.GetULong();this.m_ulUnicodeRange4= fs.GetULong();this.m_ulCodePageRange1=fs.GetULong();this.m_ulCodePageRange2=fs.GetULong();this.m_usWeigth=fs.GetUShort();this.m_usWidth=fs.GetUShort();this.m_sFamilyClass=FT_Common.UShort_To_Short(fs.GetUShort());this.m_eFontFormat=FT_Common.UShort_To_Short(fs.GetUShort());this.m_shAvgCharWidth=FT_Common.UShort_To_Short(fs.GetUShort());this.m_shAscent=FT_Common.UShort_To_Short(fs.GetUShort());this.m_shDescent=FT_Common.UShort_To_Short(fs.GetUShort());this.m_shLineGap=FT_Common.UShort_To_Short(fs.GetUShort()); this.m_shXHeight=FT_Common.UShort_To_Short(fs.GetUShort());this.m_shCapHeight=FT_Common.UShort_To_Short(fs.GetUShort())},GetStyle:function(){if(this.m_bBold&&this.m_bItalic)return 3;else if(this.Bold)return 1;else if(this.m_bItalic)return 2;else return 0},GetPenalty:function(oSelect,isName0,_main_ranges){var nCurPenalty=0;if(undefined!==oSelect.pPanose)nCurPenalty+=this.GetPanosePenalty(oSelect.pPanose);if(true)if(undefined!==oSelect.ulRange1&&undefined!==oSelect.ulRange2&&undefined!==oSelect.ulRange3&& undefined!==oSelect.ulRange4&&undefined!==oSelect.ulCodeRange1&&undefined!==oSelect.ulCodeRange2)nCurPenalty+=this.GetSigPenalty(oSelect,nCurPenalty>=1E3?50:10,10,_main_ranges);var unCharset=FD_UNKNOWN_CHARSET;if(undefined!==oSelect.unCharset)unCharset=oSelect.unCharset;if(undefined!==oSelect.bFixedWidth)nCurPenalty+=this.GetFixedPitchPenalty(oSelect.bFixedWidth);var nNamePenalty=0;if(oSelect.wsName!==undefined&&oSelect.wsAltName!==undefined)nNamePenalty+=Math.min(this.GetFaceNamePenalty(oSelect.wsName), this.GetFaceNamePenalty(oSelect.wsAltName));else if(oSelect.wsName!==undefined)nNamePenalty+=this.GetFaceNamePenalty(oSelect.wsName);else if(oSelect.wsAltName!==undefined)nNamePenalty+=this.GetFaceNamePenalty(oSelect.wsAltName);if(true===isName0&&0==nNamePenalty)return 0;nCurPenalty+=nNamePenalty;if(undefined!=oSelect.usWidth)nCurPenalty+=this.GetWidthPenalty(oSelect.usWidth);if(undefined!==oSelect.usWeight)nCurPenalty+=this.GetWeightPenalty(oSelect.usWeight);if(undefined!==oSelect.bBold)nCurPenalty+= this.GetBoldPenalty(oSelect.bBold);if(undefined!==oSelect.bItalic)nCurPenalty+=this.GetItalicPenalty(oSelect.bItalic);if(undefined!==oSelect.wsFamilyClass)nCurPenalty+=this.GetFamilyUnlikelyPenalty(oSelect.wsFamilyClass);else if(undefined!==oSelect.sFamilyClass)nCurPenalty+=this.GetFamilyUnlikelyPenalty1(oSelect.sFamilyClass);nCurPenalty+=this.GetCharsetPenalty(unCharset);if(undefined!==oSelect.shAvgCharWidth)nCurPenalty+=this.GetAvgWidthPenalty(oSelect.shAvgCharWidth);if(undefined!==oSelect.shAscent)nCurPenalty+= this.GetAscentPenalty(oSelect.shAscent);if(undefined!==oSelect.shDescent)nCurPenalty+=this.GetDescentPenalty(oSelect.shDescent);if(undefined!==oSelect.shLineGap)nCurPenalty+=this.GetLineGapPenalty(oSelect.shLineGap);if(undefined!==oSelect.shXHeight)nCurPenalty+=this.GetXHeightPenalty(oSelect.shXHeight);if(undefined!==oSelect.shCapHeight)nCurPenalty+=this.GetCapHeightPenalty(oSelect.shCapHeight);return nCurPenalty},GetPanosePenalty:function(pReqPanose){var nPenalty=0;for(var nIndex=0;nIndex<10;nIndex++)if(this.m_aPanose[nIndex]!= pReqPanose[nIndex]&&0!=pReqPanose[nIndex]){var nKoef=Math.abs(this.m_aPanose[nIndex]-pReqPanose[nIndex]);switch(nIndex){case 0:nPenalty+=1E3*nKoef;break;case 1:nPenalty+=100*nKoef;break;case 2:nPenalty+=100*nKoef;break;case 3:nPenalty+=100*nKoef;break;case 4:nPenalty+=100*nKoef;break;case 5:nPenalty+=100*nKoef;break;case 6:nPenalty+=100*nKoef;break;case 7:nPenalty+=100*nKoef;break;case 8:nPenalty+=100*nKoef;break;case 9:nPenalty+=100*nKoef;break}}return nPenalty},GetSigPenalty:function(format,dRangeWeight, dRangeWeightSuferflouous,_main_ranges){var dPenalty=0;var arrCandidate=typeof Int8Array!="undefined"&&!window.opera?new Uint8Array(192):new Array(192);var arrRequest=typeof Int8Array!="undefined"&&!window.opera?new Uint8Array(192):new Array(192);for(var i=0;i<192;i++){arrCandidate[i]=0;arrRequest[i]=0}var nRangesCount=0;var nAddCount=0;var ulCandRanges=[this.m_ulUnicodeRange1,this.m_ulUnicodeRange2,this.m_ulUnicodeRange3,this.m_ulUnicodeRange4,this.m_ulCodePageRange1,this.m_ulCodePageRange2];var ulReqRanges= [format.ulRange1,format.ulRange2,format.ulRange3,format.ulRange4,format.ulCodeRange1,format.ulCodeRange2];var nIndex=0;for(var nIndex=0;nIndex<6;nIndex++)for(var nBitCount=0,nBit=1;nBitCount<32;nBitCount++,nBit*=2){var bReqAdd=false;if((ulReqRanges[nIndex]&nBit)!=0){arrRequest[nIndex*32+nBitCount]=1;nRangesCount++;bReqAdd=true}if((ulCandRanges[nIndex]&nBit)!=0){arrCandidate[nIndex*32+nBitCount]=1;if(!bReqAdd)nAddCount++}}if(0==nRangesCount)return 0;for(nIndex=0;nIndex<192;nIndex++)if(1==arrRequest[nIndex]&& 0==arrCandidate[nIndex])if(undefined!==_main_ranges&&undefined!==_main_ranges[""+nIndex])dPenalty+=Math.max(_main_ranges[""+nIndex],dRangeWeight);else dPenalty+=dRangeWeight;else if(dRangeWeightSuferflouous!=0&&0==arrRequest[nIndex]&&1==arrCandidate[nIndex])dPenalty+=dRangeWeightSuferflouous;return dPenalty},GetFixedPitchPenalty:function(bReqFixed){var nPenalty=0;if(bReqFixed&&!this.m_bIsFixed)nPenalty=15E3;if(!bReqFixed&&this.m_bIsFixed)nPenalty=350;return nPenalty},GetFaceNamePenalty_private:function(sReqName, sMyName){if(0==sReqName.length)return 0;if(0==sMyName.length)return 1E4;if(sReqName==sMyName)return 0;if(sReqName.replace(/[\s-,]/g,"").toLowerCase()==sMyName.replace(/[\s-,]/g,"").toLowerCase())return 100;if(-1!=sReqName.indexOf(sMyName)||-1!=sMyName.indexOf(sReqName)){if(g_fontApplication.g_fontDictionary.CheckLikeFonts(sMyName,sReqName))return 700;return 1E3}if(g_fontApplication.g_fontDictionary.CheckLikeFonts(sMyName,sReqName))return 1E3;return this.CheckEqualFonts2(sReqName,sMyName)},GetFaceNamePenalty:function(sReqName){var min= this.GetFaceNamePenalty_private(sReqName,this.m_wsFontName);if(this.m_names){var tmpMin=0;for(var i=0,len=this.m_names.length;i<len;i++){tmpMin=this.GetFaceNamePenalty_private(sReqName,this.m_names[i]);if(tmpMin<min)min=tmpMin}}return min},GetWidthPenalty:function(usReqWidth){return Math.abs(this.m_usWidth-usReqWidth)*50},GetWeightPenalty:function(usReqWeight){return 3*(Math.abs(this.m_usWeigth-usReqWeight)/10)},GetItalicPenalty:function(bReqItalic){if(this.m_bItalic!=bReqItalic)return 4;return 0}, GetBoldPenalty:function(bReqBold){if(this.m_bBold!=bReqBold)return 1;return 0},GetFamilyUnlikelyPenalty1:function(nReqFamilyClass){var nReqClassID=nReqFamilyClass>>8;var nCandClassID=this.m_sFamilyClass>>8;if(0==nReqClassID)return 0;if(0==nCandClassID)return 50;if(nReqClassID<=8&&nCandClassID>8||nReqClassID>8&&nCandClassID<=8)return 50;return 0},GetFamilyUnlikelyPenalty:function(sReqFamilyClass){var nCandClassID=this.m_sFamilyClass>>8;if("any"==sReqFamilyClass||"unknown"==sReqFamilyClass)return 0; else if(0==nCandClassID)return 50;else if(("swiss"==sReqFamilyClass||"roman"==sReqFamilyClass||"modern"==sReqFamilyClass)&&nCandClassID>8||("decorative"==sReqFamilyClass||"script"==sReqFamilyClass)&&nCandClassID<=8)return 50;return 0},GetCharsetPenalty:function(unReqCharset){if(FD_UNKNOWN_CHARSET==unReqCharset)return 0;var _ret=this.GetCodePageByCharset(unReqCharset);var nMult=1<<_ret.ulBit;if(nMult<0)nMult+=4294967296;var ulCandRanges=[this.m_ulUnicodeRange1,this.m_ulUnicodeRange2,this.m_ulUnicodeRange3, this.m_ulUnicodeRange4,this.m_ulCodePageRange1,this.m_ulCodePageRange2];if((ulCandRanges[_ret.unLongIndex]&nMult)==0)return 65E3;return 0},GetAvgWidthPenalty:function(shReqWidth){if(0==this.m_shAvgCharWidth&&0!=shReqWidth)return 4E3;return Math.abs(this.m_shAvgCharWidth-shReqWidth)*4},GetAscentPenalty:function(shReqAscent){if(0==this.m_shAscent&&0!=shReqAscent)return 100;return Math.abs(this.m_shAscent-shReqAscent)/10>>0},GetDescentPenalty:function(shReqDescent){if(0==this.m_shDescent&&0!=shReqDescent)return 100; return Math.abs(this.m_shDescent-shReqDescent)/10>>0},GetLineGapPenalty:function(shReqLineGap){if(0==this.m_shLineGap&&0!=shReqLineGap)return 100;return Math.abs(this.m_shLineGap-shReqLineGap)/10>>0},GetXHeightPenalty:function(shReqXHeight){if(0==this.shXHeight&&0!=shReqXHeight)return 50;return Math.abs(this.m_shXHeight-shReqXHeight)/20>>0},GetCapHeightPenalty:function(shReqCapHeight){if(0==this.m_shCapHeight&&0!=shReqCapHeight)return 50;return Math.abs(this.m_shCapHeight-shReqCapHeight)/20>>0},GetCodePageByCharset:function(unCharset){var ret= {ulBit:0,unLongIndex:4};if(unCharset==1)unCharset=this.GetDefaultCharset();if(true)switch(unCharset){case 0:ret.ulBit=0;break;case 238:ret.ulBit=1;break;case 204:ret.ulBit=2;break;case 161:ret.ulBit=3;break;case 162:ret.ulBit=4;break;case 177:ret.ulBit=5;break;case 178:ret.ulBit=6;break;case 186:ret.ulBit=7;break;case 163:ret.ulBit=8;break;case 222:ret.ulBit=16;break;case 128:ret.ulBit=17;break;case 134:ret.ulBit=18;break;case 129:ret.ulBit=19;break;case 136:ret.ulBit=20;break;case 130:ret.ulBit= 21;break;case 77:ret.ulBit=29;break;case 2:ret.ulBit=31;break;case 255:ret.ulBit=30;break;default:ret.ulBit=0;break}},GetDefaultCharset:function(bUseDefCharset){if(!bUseDefCharset)return FD_UNKNOWN_CHARSET;return 0},CheckEqualFonts2:function(name1,name2){var _res1=name1.toLowerCase();var _res2=name2.toLowerCase();if(_res1==_res2)return 1500;if(_res1.replace(/[\s-]/g,"")==_res2.replace(/[\s-]/g,""))return 3E3;return 1E4},Serialize:function(){var _obj={};_obj["m_wsFontName"]=this.m_wsFontName;_obj["m_wsFontPath"]= this.m_wsFontPath;_obj["m_lIndex"]=this.m_lIndex;_obj["m_bBold"]=this.m_bBold;_obj["m_bItalic"]=this.m_bItalic;_obj["m_bIsFixed"]=this.m_bIsFixed;_obj["m_aPanose"]=new Array(10);for(var i=0;i<10;i++)_obj["m_aPanose"][i]=this.m_aPanose[i];_obj["m_ulUnicodeRange1"]=this.m_ulUnicodeRange1;_obj["m_ulUnicodeRange2"]=this.m_ulUnicodeRange2;_obj["m_ulUnicodeRange3"]=this.m_ulUnicodeRange3;_obj["m_ulUnicodeRange4"]=this.m_ulUnicodeRange4;_obj["m_ulCodePageRange1"]=this.m_ulCodePageRange1;_obj["m_ulCodePageRange2"]= this.m_ulCodePageRange2;_obj["m_usWeigth"]=this.m_usWeigth;_obj["m_usWidth"]=this.m_usWidth;_obj["m_sFamilyClass"]=this.m_sFamilyClass;_obj["m_eFontFormat"]=this.m_eFontFormat;_obj["m_shAvgCharWidth"]=this.m_shAvgCharWidth;_obj["m_shAscent"]=this.m_shAscent;_obj["m_shDescent"]=this.m_shDescent;_obj["m_shLineGap"]=this.m_shLineGap;_obj["m_shXHeight"]=this.m_shXHeight;_obj["m_shCapHeight"]=this.m_shCapHeight;return _obj}};function CLanguageFontSelect(){this.Type=0;this.Ranges=[];this.CodePage1Mask= 0;this.CodePage2Mask=0;this.DefaultFont="Arial";this.FullSupportPages=false}CLanguageFontSelect.prototype={checkChar:function(_code){var _len=this.Ranges.length;for(var i=0;i<_len;i+=2)if(_code>=this.Ranges[i]&&_code<=this.Ranges[i+1])return true;return false}};var LanguagesFontSelectTypes={Unknown:-1,Arabic:1,Korean:2,Japan:3,Chinese:4,EastAsiaStart:2,EastAsiaEnd:4};function CFontSelectList(){this.List=[];this.ListMap={};this.Languages=[];this.m_pRanges=null;this.m_pRangesNums=null;this.IsInit=false; this.CurrentLoadedObj=null}function memset(p,start,val,count){var _data=p.data;for(var i=0;i<count;i++)_data[i+start]=val}CFontSelectList.prototype={SerializeList:function(){var _list=[];var _len=this.List.length;for(var k=0;k<_len;k++)_list.push(this.List[k].Serialize());return _list},Init:function(){if(true==this.IsInit)return;this.IsInit=true;if(window["g_fonts_selection_bin"]!=""){var _ft_stream=CreateFontData2(window["g_fonts_selection_bin"]);var _file_stream=new AscCommon.FileStream(_ft_stream.data, _ft_stream.size);var count=_file_stream.GetLong();for(var i=0;i<count;i++){var _fs=new CFontSelect;_fs.fromStream(_file_stream);if(_fs.m_wsFontName=="Droid Sans Fallback")if((_fs.m_ulCodePageRange1&1<<19)==1<<19)_fs.m_ulCodePageRange1-=1<<19;this.List.push(_fs);this.ListMap[_fs.m_wsFontPath]=this.List.length-1}}var _arabic_lang=new CLanguageFontSelect;_arabic_lang.Type=LanguagesFontSelectTypes.Arabic;_arabic_lang.Ranges.push(1536);_arabic_lang.Ranges.push(1791);_arabic_lang.Ranges.push(1872);_arabic_lang.Ranges.push(1919); _arabic_lang.Ranges.push(2208);_arabic_lang.Ranges.push(2303);_arabic_lang.Ranges.push(64336);_arabic_lang.Ranges.push(65023);_arabic_lang.Ranges.push(65136);_arabic_lang.Ranges.push(65279);_arabic_lang.CodePage1Mask=1<<6;_arabic_lang.CodePage2Mask=1<<19|1<<29;_arabic_lang.DefaultFont="Tahoma";this.Languages.push(_arabic_lang);var _korean_lang=new CLanguageFontSelect;_korean_lang.Type=LanguagesFontSelectTypes.Korean;_korean_lang.Ranges.push(4352);_korean_lang.Ranges.push(4607);_korean_lang.Ranges.push(12592); _korean_lang.Ranges.push(12687);_korean_lang.Ranges.push(44032);_korean_lang.Ranges.push(55215);_korean_lang.Ranges.push(65280);_korean_lang.Ranges.push(65519);_korean_lang.CodePage1Mask=1<<19;_korean_lang.CodePage2Mask=0;_korean_lang.DefaultFont="Batang";this.Languages.push(_korean_lang);var _japan_lang=new CLanguageFontSelect;_japan_lang.Type=LanguagesFontSelectTypes.Japan;_japan_lang.Ranges.push(19968);_japan_lang.Ranges.push(40895);_japan_lang.Ranges.push(12288);_japan_lang.Ranges.push(12543); _japan_lang.Ranges.push(65280);_japan_lang.Ranges.push(65519);_japan_lang.CodePage1Mask=1<<17|1<<30;_japan_lang.CodePage2Mask=0;_japan_lang.DefaultFont="MS Mincho";_japan_lang.FullSupportPages=true;this.Languages.push(_japan_lang);var _chinese_lang=new CLanguageFontSelect;_chinese_lang.Type=LanguagesFontSelectTypes.Chinese;_chinese_lang.Ranges.push(19968);_chinese_lang.Ranges.push(40959);_chinese_lang.Ranges.push(13312);_chinese_lang.Ranges.push(19967);_chinese_lang.Ranges.push(131072);_chinese_lang.Ranges.push(173791); _chinese_lang.Ranges.push(63744);_chinese_lang.Ranges.push(64255);_chinese_lang.Ranges.push(194560);_chinese_lang.Ranges.push(195103);_chinese_lang.Ranges.push(65280);_chinese_lang.Ranges.push(65519);_chinese_lang.CodePage1Mask=1<<18|1<<20;_chinese_lang.CodePage2Mask=0;_chinese_lang.DefaultFont="SimSun";this.Languages.push(_chinese_lang);var _fs=new CFontSelect;_fs.m_wsFontName="ASCW3";this.List.push(_fs);delete window["g_fonts_selection_bin"]},isEnglishChar:function(_code){if(97<=_code&&_code<=122)return true; if(65<=_code&&_code<=90)return true;return false},isMultiLanguageSymbol:function(_code){switch(_code){case 32:case 96:case 126:case 62:case 60:case 46:case 44:case 58:case 59:case 63:case 33:case 47:case 92:case 124:case 91:case 93:case 40:case 41:case 123:case 125:case 36:case 37:case 35:case 64:case 38:case 39:case 34:case 61:case 43:case 45:case 42:case 94:case 95:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 48:return true;default:{if(_code>=8192&&_code<=8303)return true; if(_code>=8352&&_code<=8399)return true;break}}return false},checkText:function(text){var _text_len=text.length;if(_text_len==0)return LanguagesFontSelectTypes.Unknown;var _array_detect_languages=[];var _detect_languages_length=this.Languages.length;for(var _lang=0;_lang<_detect_languages_length;_lang++){var _language=this.Languages[_lang];var _is_support=true;var _no_multi_symbols=0;var _percent_by_english=0;for(var i=0;i<_text_len;i++){var _code=text.charCodeAt(i);if(!this.isMultiLanguageSymbol(_code)){_no_multi_symbols++; if(!_language.checkChar(_code))if(this.isEnglishChar(_code))_percent_by_english--;else{_is_support=false;break}else _percent_by_english++}}if(0==_no_multi_symbols)return LanguagesFontSelectTypes.Unknown;if(_is_support&&_percent_by_english>0)_array_detect_languages.push(_language.Type)}var _len=_array_detect_languages.length;if(0==_len)return LanguagesFontSelectTypes.Unknown;return _array_detect_languages[_len-1]},checkPasteText:function(textPr,langId){var _ret_obj={is_async:false,name:"",fontSlot:fontslot_ASCII}; if(!textPr.RFonts)return _ret_obj;var _lang=null;for(var i=0;i<this.Languages.length;i++){_lang=this.Languages[i];if(_lang.Type==langId)break}if(null==_lang)return _ret_obj;_ret_obj.fontSlot=fontslot_ASCII;if(langId>=LanguagesFontSelectTypes.EastAsiaStart&&langId<=LanguagesFontSelectTypes.EastAsiaEnd)_ret_obj.fontSlot=fontslot_EastAsia;if(langId==LanguagesFontSelectTypes.Arabic)if(textPr.CS||textPr.RTL)_ret_obj.fontSlot=fontslot_CS;var _fontFamily=undefined;var bold=undefined;var italic=undefined; switch(_ret_obj.fontSlot){case fontslot_ASCII:{_fontFamily=textPr.RFonts.Ascii;bold=textPr.Bold;italic=textPr.Italic;break}case fontslot_HAnsi:{_fontFamily=textPr.RFonts.HAnsi;bold=textPr.Bold;italic=textPr.Italic;break}case fontslot_CS:{_fontFamily=textPr.RFonts.CS;bold=textPr.BoldCS;italic=textPr.ItalicCS;break}case fontslot_EastAsia:{_fontFamily=textPr.RFonts.EastAsia;bold=textPr.Bold;italic=textPr.Italic;break}default:break}if(undefined==_fontFamily)return _ret_obj;var oFontStyle=FontStyle.FontStyleRegular; if(!italic&&bold)oFontStyle=FontStyle.FontStyleBold;else if(italic&&!bold)oFontStyle=FontStyle.FontStyleItalic;else if(italic&&bold)oFontStyle=FontStyle.FontStyleBoldItalic;var _info=g_fontApplication.GetFontInfo(_fontFamily.Name,oFontStyle);var _id=_info.GetFontID(AscCommon.g_font_loader,oFontStyle);var _select=this.List[this.ListMap[_id.id]];if(0!=_lang.CodePage1Mask)if(!_lang.FullSupportPages){if(0==(_lang.CodePage1Mask&_select.m_ulCodePageRange1))_ret_obj.is_async=true}else if(_lang.CodePage1Mask!= (_lang.CodePage1Mask&_select.m_ulCodePageRange1))_ret_obj.is_async=true;if(0!=_lang.CodePage2Mask)if(!_lang.FullSupportPages){if(0==(_lang.CodePage2Mask&_select.m_ulCodePageRange2))_ret_obj.is_async=true}else if(_lang.CodePage2Mask!=(_lang.CodePage2Mask&_select.m_ulCodePageRange2))_ret_obj.is_async=true;if(!_ret_obj.is_async)return _ret_obj;_ret_obj.name=this.selectNeedFont(_lang,oFontStyle);if(_ret_obj.name=="")_ret_obj.is_async=false;return _ret_obj},getSetupRFonts:function(obj){var _rfonts=new CRFonts; switch(obj.fontSlot){case fontslot_EastAsia:{_rfonts.EastAsia={Name:obj.name,Index:-1};break}case fontslot_CS:{_rfonts.CS={Name:obj.name,Index:-1};break}case fontslot_HAnsi:{_rfonts.HAnsi={Name:obj.name,Index:-1};break}case fontslot_ASCII:default:{_rfonts.Ascii={Name:obj.name,Index:-1};break}}return _rfonts},selectNeedFont:function(_lang,_style){var _error=16777216;var _name="";var _len=AscFonts.g_font_infos.length;for(var i=0;i<_len;i++){var _info=AscFonts.g_font_infos[i];var _id=_info.GetFontID(AscCommon.g_font_loader, _style);var _select=this.List[this.ListMap[_id.id]];if(!_select)continue;var _bIsNeed=false;if(0!=_lang.CodePage1Mask)if(!_lang.FullSupportPages){if(0==(_lang.CodePage1Mask&_select.m_ulCodePageRange1))_bIsNeed=true}else if(_lang.CodePage1Mask!=(_lang.CodePage1Mask&_select.m_ulCodePageRange1))_bIsNeed=true;if(0!=_lang.CodePage2Mask)if(!_lang.FullSupportPages){if(0==(_lang.CodePage2Mask&_select.m_ulCodePageRange2))_bIsNeed=true}else if(_lang.CodePage2Mask!=(_lang.CodePage2Mask&_select.m_ulCodePageRange2))_bIsNeed= true;if(!_bIsNeed){var _tmp_error=0;if(_id.file.Status!=0)_tmp_error+=65536;if(_info.Name!=_lang.DefaultFont)_tmp_error+=256;if(_tmp_error<_error){_error=_tmp_error;_name=_info.Name}}}if(_name=="")_name=g_fontApplication.GetFontInfoName(_lang.DefaultFont);return _name},checkText2:function(text){var r1=0;var r2=0;var r3=0;var r4=0;var codePage1=0;var codePage2=0;var len=text.length;for(var i=0;i<len;i++){var _code=text.charCodeAt(i);var lRangeNum=this.m_pRangesNums.data[_code];var lRange=this.m_pRanges.data[_code]; if(255!=lRangeNum)if(i==0&&(lRangeNum==1&&lRange==28))codePage1=2147483648;else if(lRangeNum==2&&lRange==3||lRangeNum==1&&lRange==31||lRangeNum==0&&lRange==13){r1|=1<<13;r2|=1<<31;r3|=1<<3}else if(0==lRangeNum)r1|=1<<lRange;else if(1==lRangeNum)r2|=1<<lRange;else if(2==lRangeNum)r3|=1<<lRange;else r4|=1<<lRange}var _array_results=[];var _count_fonts=this.List.length;for(var i=0;i<_count_fonts;i++){var f=this.List[i];if((f.m_ulUnicodeRange1&r1)==r1&&(f.m_ulUnicodeRange2&r2)==r2&&(f.m_ulUnicodeRange3& r3)==r3&&(f.m_ulUnicodeRange4&r4)==r4&&(f.m_ulCodePageRange1&codePage1)==codePage1&&(f.m_ulCodePageRange2&codePage2)==codePage2)_array_results.push(f.m_wsFontPath)}},initRanges:function(){}};function CApplicationFonts(){this.FontPickerMap={};this.g_fontDictionary=new FD_FontDictionary;this.g_fontSelections=new CFontSelectList;this.DefaultIndex=0;this.Init=function(){this.g_fontDictionary.Init();this.g_fontSelections.Init();var oSelect=new CFontSelectFormat;oSelect.wsName="Arial";this.DefaultIndex= this.g_fontDictionary.GetFontIndex(oSelect,this.g_fontSelections.List,undefined)};this.LoadFont=function(name,font_loader,fontManager,fEmSize,lStyle,dHorDpi,dVerDpi,transform,objDst){var _font=this.GetFontFileWeb(name,lStyle);var font_name_index=AscFonts.g_map_font_index[_font.m_wsFontName];if(undefined!==objDst){objDst.Name=_font.m_wsFontName;objDst.Replace=this.CheckReplaceGlyphsMap(name,objDst)}return AscFonts.g_font_infos[font_name_index].LoadFont(AscCommon.g_font_loader,fontManager,fEmSize,lStyle, dHorDpi,dVerDpi,transform)};this.CheckReplaceGlyphsMap=function(name,objDst){var _replaceInfo=this.g_fontDictionary.ChangeGlyphsMap[name];if(!_replaceInfo)return null;if(_replaceInfo.Name!=objDst.Name)return null;return _replaceInfo};this.GetReplaceGlyph=function(src,objDst){var _arr=objDst.MapSrc;var _arrLen=_arr.length;for(var i=0;i<_arrLen;i++){if(_arr[i]==src)return objDst.MapDst[i];if(objDst.IsSymbolSrc&&src==61440+_arr[i])return objDst.MapDst[i]}return src};this.GetFontFile=function(name,lStyle){if(lStyle=== undefined)lStyle=0;var _key="s"+lStyle+"_";_key+=name;if(undefined!==this.FontPickerMap[_key])return this.FontPickerMap[_key];else{var oSelect=new CFontSelectFormat;oSelect.wsName=name;oSelect.bItalic=false;oSelect.bBold=false;var _font=this.GetFontIndex(oSelect);this.FontPickerMap[_key]=_font;return _font}};this.GetFontFileWeb=function(name,lStyle){if(undefined!==this.FontPickerMap[name])return this.FontPickerMap[name];else{var oSelect=new CFontSelectFormat;oSelect.wsName=name;var _font=this.GetFontIndex(oSelect, true);this.FontPickerMap[name]=_font;return _font}};this.GetFontInfo=function(name,lStyle,objDst){var _font=this.GetFontFileWeb(name,lStyle);var font_name_index=AscFonts.g_map_font_index[_font.m_wsFontName];if(undefined!==objDst){objDst.Name=_font.m_wsFontName;objDst.Replace=this.CheckReplaceGlyphsMap(name,objDst)}return AscFonts.g_font_infos[font_name_index]};this.GetFontInfoName=function(name,objDst){var _font=this.GetFontFileWeb(name);if(undefined!==objDst){objDst.Name=_font.m_wsFontName;objDst.Replace= this.CheckReplaceGlyphsMap(name,objDst)}return _font.m_wsFontName};this.GetFontIndex=function(oSelect,isName0){return this.g_fontDictionary.GetFontIndex(oSelect,this.g_fontSelections.List,this.DefaultIndex,isName0)};this.GetFontNameDictionary=function(sFontFamily,bDontReturnDef){var sFontname;var nIndex=sFontFamily.indexOf(",");if(-1!=nIndex)sFontname=sFontFamily.substring(0,nIndex);else sFontname=sFontFamily;sFontname=sFontname.replace(/^[\s'"]+|[\s'"]+$/g,"");if(0==sFontname.length){if(true===bDontReturnDef)sFontname= "Arial"}else{var sFontnameLower=sFontname.toLowerCase();if("serif"==sFontnameLower)sFontname="Times New Roman";else if("sans-serif"==sFontnameLower)sFontname="Arial";else if("cursive"==sFontnameLower)sFontname="Comic Sans MS";else if("fantasy"==sFontnameLower)sFontname="Impact";else if("monospace"==sFontnameLower)sFontname="Courier New";else{var oSelect=new CFontSelectFormat;oSelect.wsName=sFontname;this.g_fontDictionary.CorrectParamsFromDictionary(oSelect);if(null!=oSelect.pPanose)return oSelect.wsName; else return this.GetFontInfoName(sFontname)}}return sFontname}}var g_fontApplication=new CApplicationFonts;window["AscFonts"]=window["AscFonts"]||{};window["AscFonts"].FontStyle=FontStyle;window["AscFonts"].DecodeBase64Char=DecodeBase64Char;window["AscFonts"].b64_decode=b64_decode;window["AscFonts"].CreateFontData2=CreateFontData2;window["AscFonts"].CreateFontData3=CreateFontData3;window["AscFonts"].CreateFontData4=CreateFontData4;window["AscFonts"].LanguagesFontSelectTypes=LanguagesFontSelectTypes; window["AscFonts"].g_fontApplication=g_fontApplication})(window);"use strict";(function(window,undefined){function CRasterHeapLineFree(){this.Y=0;this.Height=0}function CRasterDataInfo(){this.Chunk=null;this.Line=null;this.Index=0}function CRasterHeapLine(){this.Y=0;this.Height=0;this.Count=0;this.CountBusy=0;this.Images=null;this.Index=0}CRasterHeapLine.prototype={CreatePlaces:function(width,height,widthLine){this.Height=height;this.Count=widthLine/width>>0;var _size=this.Count;var arr=null;if(typeof Int8Array!= "undefined"&&!window.opera)arr=new Int8Array(_size);else arr=new Array(_size);for(var i=0;i<_size;i++)arr[i]=0;this.Images=arr},Alloc:function(){if(this.Count==this.CountBusy)return-1;var arr=this.Images;if(arr[this.CountBusy]==0){arr[this.CountBusy]=1;this.CountBusy+=1;return this.CountBusy-1}var _len=this.Count;for(var i=0;i<_len;i++)if(arr[i]==0){arr[i]=1;this.CountBusy+=1;return i}return-1},Free:function(index){if(this.Images[index]==1){this.Images[index]=0;this.CountBusy-=1}return this.CountBusy}}; function CRasterHeapChuck(){this.CanvasImage=null;this.CanvasCtx=null;this.Width=0;this.Height=0;this.LinesFree=[];this.LinesBusy=[];this.CurLine=null;this.FindOnlyEqualHeight=false}CRasterHeapChuck.prototype={Create:function(width,height){this.Width=width;this.Height=height;this.CanvasImage=document.createElement("canvas");this.CanvasImage.width=width;this.CanvasImage.height=height;this.CanvasCtx=this.CanvasImage.getContext("2d");this.CanvasCtx.globalCompositeOperation="source-atop";var _freeLine= new CRasterHeapLineFree;_freeLine.Y=0;_freeLine.Height=this.Height;this.LinesFree[0]=_freeLine},Clear:function(){this.LinesBusy.splice(0,this.LinesBusy.length);this.LinesFree.splice(0,this.LinesFree.length);var _freeLine=new CRasterHeapLineFree;_freeLine.Y=0;_freeLine.Height=this.Height;this.LinesFree[0]=_freeLine},Alloc:function(width,height){var _need_height=Math.max(width,height);var _busy_len=this.LinesBusy.length;for(var i=0;i<_busy_len;i++){var _line=this.LinesBusy[i];if(_line.Height>=_need_height){var _index= _line.Alloc();if(-1!=_index){var _ret=new CRasterDataInfo;_ret.Chunk=this;_ret.Line=_line;_ret.Index=_index;return _ret}}}var _need_height1=3*_need_height>>1;if(this.FindOnlyEqualHeight)_need_height1=_need_height;var _free_len=this.LinesFree.length;var _index_found_koef1=-1;for(var i=0;i<_free_len;i++){var _line=this.LinesFree[i];if(_line.Height>=_need_height1){var _new_line=new CRasterHeapLine;_new_line.CreatePlaces(_need_height1,_need_height1,this.Width);_new_line.Y=_line.Y;_new_line.Index=this.LinesBusy.length; this.LinesBusy.push(_new_line);_line.Y+=_need_height1;_line.Height-=_need_height1;if(_line.Height==0)this.LinesFree.splice(i,1);var _ret=new CRasterDataInfo;_ret.Chunk=this;_ret.Line=_new_line;_ret.Index=_new_line.Alloc();return _ret}else if(_line.Height>=_need_height&&-1==_index_found_koef1)_index_found_koef1=i}if(-1!=_index_found_koef1){var _line=this.LinesFree[_index_found_koef1];var _new_line=new CRasterHeapLine;_new_line.CreatePlaces(_need_height,_need_height,this.Width);_new_line.Y=_line.Y; _new_line.Index=this.LinesBusy.length;this.LinesBusy.push(_new_line);_line.Y+=_need_height;_line.Height-=_need_height;if(_line.Height==0)this.LinesFree.splice(i,1);var _ret=new CRasterDataInfo;_ret.Chunk=this;_ret.Line=_new_line;_ret.Index=_new_line.Alloc();return _ret}return null},Free:function(obj){var _refs=obj.Line.Free(obj.Index);if(_refs==0){var _line=obj.Line;this.LinesBusy.splice(_line.Index,1);var _lines_busy=this.LinesBusy;var _busy_len=_lines_busy.length;for(var i=_line.Index;i<_busy_len;i++)_lines_busy[i].Index= i;var y1=_line.Y;var y2=_line.Y+_line.Height;var _lines_free=this.LinesFree;var _free_len=_lines_free.length;var _ind_prev=-1;var _ind_next=-1;for(var i=0;i<_free_len;i++){var _line_f=_lines_free[i];if(-1==_ind_prev){if(y1==_line_f.Y+_line_f.Height)_ind_prev=i}else if(-1==_ind_next){if(y2==_line_f.Y)_ind_next=i}else break}if(-1!=_ind_prev&&-1!=_ind_next){_lines_free[_ind_prev].Height+=_line.Height+_lines_free[_ind_next].Height;_lines_free.splice(_ind_next,1)}else if(-1!=_ind_prev)_lines_free[_ind_prev].Height+= _line.Height;else if(-1!=_ind_next){_lines_free[_ind_next].Y-=_line.Height;_lines_free[_ind_next].Height+=_line.Height}else{var _new_line=new CRasterHeapLineFree;_new_line.Y=_line.Y;_new_line.Height=_line.Height;_lines_free.push(_new_line)}_line=null}}};function CRasterHeapTotal(_size){this.ChunkHeapSize=undefined===_size?3E3:_size;this.Chunks=[]}CRasterHeapTotal.prototype={Clear:function(){var _len=this.Chunks.length;for(var i=0;i<_len;i++)this.Chunks[i].Clear();if(_len>1)this.Chunks.splice(1,_len- 1)},Alloc:function(width,height){var _len=this.Chunks.length;for(var i=0;i<_len;i++){var _ret=this.Chunks[i].Alloc(width,height);if(null!=_ret)return _ret}this.HeapAlloc(this.ChunkHeapSize,this.ChunkHeapSize);return this.Chunks[_len].Alloc(width,height)},HeapAlloc:function(width,height){var _chunk=new CRasterHeapChuck;_chunk.Create(width,height);this.Chunks[this.Chunks.length]=_chunk},CreateFirstChuck:function(_w,_h){if(0==this.Chunks.length){this.Chunks[0]=new CRasterHeapChuck;this.Chunks[0].Create(undefined== _w?this.ChunkHeapSize:_w,undefined==_h?this.ChunkHeapSize:_h)}}};window["AscFonts"]=window["AscFonts"]||{};window["AscFonts"].CRasterHeapTotal=CRasterHeapTotal})(window,undefined);"use strict";(function(window,undefined){function CGlyphRect(){this.fX=0;this.fY=0;this.fWidth=0;this.fHeight=0}function CGlyphBounds(){this.fLeft=0;this.fTop=0;this.fRight=0;this.fBottom=0}CGlyphBounds.prototype={checkPoint:function(x,y){if(x<this.fLeft)this.fLeft=x;if(x>this.fRight)this.fRight=x;if(y<this.fTop)this.fTop= y;if(y>this.fBottom)this.fBottom=y}};function CGlyph(){this.lUnicode=0;this.fX=0;this.fY=0;this.fLeft=0;this.fTop=0;this.fRight=0;this.fBottom=0;this.oMetrics=null;this.eState=AscFonts.EGlyphState.glyphstateNormal;this.bBitmap=false;this.oBitmap=null;this.Clear=function(){this.bBitmap=false;this.eState=AscFonts.EGlyphState.glyphstateNormal}}function CGlyphString(){this.m_fX=0;this.m_fY=0;this.m_fEndX=0;this.m_fEndY=0;this.m_nGlyphIndex=-1;this.m_nGlyphsCount=0;this.m_pGlyphsBuffer=new Array(100); this.m_arrCTM=[];this.m_dIDet=1;this.m_fTransX=0;this.m_fTransY=0;this.GetFirstGlyph=function(){if(!this.m_pGlyphsBuffer[0])this.m_pGlyphsBuffer[0]=new CGlyph;return this.m_pGlyphsBuffer[0]};this.SetString=function(wsString,fX,fY){this.m_fX=fX+this.m_fTransX;this.m_fY=fY+this.m_fTransY;this.m_nGlyphsCount=wsString.length;this.m_nGlyphIndex=0;for(var nIndex=0;nIndex<this.m_nGlyphsCount;++nIndex){if(undefined==this.m_pGlyphsBuffer[nIndex])this.m_pGlyphsBuffer[nIndex]=new CGlyph;else this.m_pGlyphsBuffer[nIndex].Clear(); this.m_pGlyphsBuffer[nIndex].lUnicode=wsString.charCodeAt(nIndex)}};this.SetStringGID=function(gid,fX,fY){this.m_fX=fX+this.m_fTransX;this.m_fY=fY+this.m_fTransY;this.m_nGlyphsCount=1;this.m_nGlyphIndex=0;if(undefined==this.m_pGlyphsBuffer[0])this.m_pGlyphsBuffer[0]=new CGlyph;else this.m_pGlyphsBuffer[0].Clear();this.m_pGlyphsBuffer[0].lUnicode=gid};this.GetLength=function(){return this.m_nGlyphsCount};this.GetAt=function(nIndex){if(this.m_nGlyphsCount<=0)return null;var nCurIndex=nIndex<0?0:nIndex; if(nCurIndex>=this.m_nGlyphsCount)nCurIndex=this.m_nGlyphsCount-1;return this.m_pGlyphsBuffer[nCurIndex]};this.SetStartPoint=function(nIndex,fX,fY){if(this.m_nGlyphsCount<=0)return;var nCurIndex=nIndex<0?0:nIndex;if(nCurIndex>=this.m_nGlyphsCount)nCurIndex=this.m_nGlyphsCount-1;this.m_pGlyphsBuffer[nCurIndex].fX=fX;this.m_pGlyphsBuffer[nCurIndex].fY=fY};this.SetState=function(nIndex,eState){if(this.m_nGlyphsCount<=0)return;var nCurIndex=nIndex<0?0:nIndex;if(nCurIndex>=this.m_nGlyphsCount)nCurIndex= this.m_nGlyphsCount-1;this.m_pGlyphsBuffer[nCurIndex].eState=eState};this.SetBBox=function(nIndex,fLeft,fTop,fRight,fBottom){if(this.m_nGlyphsCount<=0)return;var nCurIndex=nIndex<0?0:nIndex;if(nCurIndex>=this.m_nGlyphsCount)nCurIndex=this.m_nGlyphsCount-1;var _g=this.m_pGlyphsBuffer[nCurIndex];_g.fLeft=fLeft;_g.fTop=fTop;_g.fRight=fRight;_g.fBottom=fBottom};this.SetMetrics=function(nIndex,fWidth,fHeight,fHoriAdvance,fHoriBearingX,fHoriBearingY,fVertAdvance,fVertBearingX,fVertBearingY){if(this.m_nGlyphsCount<= 0)return;var nCurIndex=nIndex<0?0:nIndex;if(nCurIndex>=this.m_nGlyphsCount)nCurIndex=this.m_nGlyphsCount-1;var _g=this.m_pGlyphsBuffer[nCurIndex];_g.oMetrics.fHeight=fHeight;_g.oMetrics.fHoriAdvance=fHoriAdvance;_g.oMetrics.fHoriBearingX=fHoriBearingX;_g.oMetrics.fHoriBearingY=fHoriBearingY;_g.oMetrics.fVertAdvance=fVertAdvance;_g.oMetrics.fVertBearingX=fVertBearingX;_g.oMetrics.fVertBearingY=fVertBearingY;_g.oMetrics.fWidth=fWidth};this.ResetCTM=function(){var m=this.m_arrCTM;m[0]=1;m[1]=0;m[2]= 0;m[3]=1;m[4]=0;m[5]=0;this.m_dIDet=1};this.GetBBox=function(nIndex,nType){var oPoint=new CGlyphBounds;if(typeof nIndex=="undefined")nIndex=-1;if(typeof nType=="undefined")nType=0;var nCurIndex=0;if(nIndex<0){if(this.m_nGlyphsCount<=0||this.m_nGlyphIndex<1||this.m_nGlyphIndex>this.m_nGlyphsCount)return oPoint;nCurIndex=this.m_nGlyphIndex-1}else{if(this.m_nGlyphsCount<=0)return oPoint;nCurIndex=nIndex<0?0:nIndex;if(nCurIndex>=this.m_nGlyphsCount)nCurIndex=this.m_nGlyphsCount-1}var _g=this.m_pGlyphsBuffer[nCurIndex]; var m=this.m_arrCTM;var fBottom=-_g.fBottom;var fRight=_g.fRight;var fLeft=_g.fLeft;var fTop=-_g.fTop;if(0==nType&&!(1==m[0]&&0==m[1]&&0==m[2]&&1==m[3]&&0==m[4]&&0==m[5])){var arrfX=[fLeft,fLeft,fRight,fRight];var arrfY=[fTop,fBottom,fBottom,fTop];var fMinX=arrfX[0]*m[0]+arrfY[0]*m[2];var fMinY=arrfX[0]*m[1]+arrfY[0]*m[3];var fMaxX=fMinX;var fMaxY=fMinY;for(var nIndex=1;nIndex<4;++nIndex){var fX=arrfX[nIndex]*m[0]+arrfY[nIndex]*m[2];var fY=arrfX[nIndex]*m[1]+arrfY[nIndex]*m[3];fMaxX=Math.max(fMaxX, fX);fMinX=Math.min(fMinX,fX);fMaxY=Math.max(fMaxY,fY);fMinY=Math.min(fMinY,fY)}fLeft=fMinX;fRight=fMaxX;fTop=fMinY;fBottom=fMaxY}oPoint.fLeft=fLeft+_g.fX+this.m_fX;oPoint.fRight=fRight+_g.fX+this.m_fX;oPoint.fTop=fTop+_g.fY+this.m_fY;oPoint.fBottom=fBottom+_g.fY+this.m_fY;return oPoint};this.GetBBox2=function(){var oPoint=new CGlyphBounds;if(this.m_nGlyphsCount<=0)return oPoint;var fBottom=0;var fRight=0;var fLeft=0;var fTop=0;for(var nIndex=0;nIndex<this.m_nGlyphsCount;++nIndex){fBottom=Math.max(fBottom, -this.m_pGlyphsBuffer[nIndex].fBottom);fTop=Math.min(fTop,-this.m_pGlyphsBuffer[nIndex].fTop)}var m=this.m_arrCTM;if(!(1==m[0]&&0==m[1]&&0==m[2]&&1==m[3]&&0==m[4]&&0==m[5])){var arrfX=[fLeft,fLeft,fRight,fRight];var arrfY=[fTop,fBottom,fBottom,fTop];var fMinX=arrfX[0]*m[0]+arrfY[0]*m[2];var fMinY=arrfX[0]*m[1]+arrfY[0]*m[3];var fMaxX=fMinX;var fMaxY=fMinY;for(var nIndex=1;nIndex<4;++nIndex){var fX=arrfX[nIndex]*m[0]+arrfY[nIndex]*m[2];var fY=arrfX[nIndex]*m[1]+arrfY[nIndex]*m[3];fMaxX=Math.max(fMaxX, fX);fMinX=Math.min(fMinX,fX);fMaxY=Math.max(fMaxY,fY);fMinY=Math.min(fMinY,fY)}fLeft=fMinX;fRight=fMaxX;fTop=fMinY;fBottom=fMaxY}fLeft+=this.m_fX;fRight+=this.m_fX;fTop+=this.m_fY;fBottom+=this.m_fY;oPoint.fLeft=Math.min(fLeft,Math.min(this.m_fX,this.m_fEndX));oPoint.fRight=Math.max(fRight,Math.max(this.m_fX,this.m_fEndX));oPoint.fTop=Math.min(fTop,Math.min(this.m_fY,this.m_fEndY));oPoint.fBottom=Math.max(fBottom,Math.max(this.m_fY,this.m_fEndY));return oPoint};this.GetNext=function(){if(this.m_nGlyphIndex>= this.m_nGlyphsCount||this.m_nGlyphIndex<0)return undefined;return this.m_pGlyphsBuffer[this.m_nGlyphIndex++]};this.SetTrans=function(fX,fY){var m=this.m_arrCTM;this.m_fTransX=this.m_dIDet*(fX*m[3]-m[2]*fY);this.m_fTransY=this.m_dIDet*(fY*m[0]-m[1]*fX)};this.SetCTM=function(fA,fB,fC,fD,fE,fF){var m=this.m_arrCTM;m[0]=fA;m[1]=fB;m[2]=fC;m[3]=fD;m[4]=fE;m[5]=fF;var dDet=fA*fD-fB*fC;if(dDet<.001&&dDet>=0)dDet=.001;else if(dDet>-.001&&dDet<0)dDet=-.001;this.m_dIDet=1/dDet}}window["AscFonts"]=window["AscFonts"]|| {};window["AscFonts"].CGlyphRect=CGlyphRect;window["AscFonts"].CGlyphBounds=CGlyphBounds;window["AscFonts"].CGlyphString=CGlyphString})(window,undefined);"use strict";(function(window,undefined){function CSymbolRange(_start,_end,_name){this.Start=_start;this.End=_end;this.Name=_name}function CFontByCharacter(){this.Ranges=[];this.UsedRanges=[];this.LastRange=null;this.FontsByRange={};this.FontsByRangeCount=0;this.ExtendFontsByRangeCount=0;this.IsUseNoSquaresMode=true;this.CallbackObj={_this:null, _callback:null}}CFontByCharacter.prototype={init:function(infos){var fonts=window["__fonts_ranges"];if(!fonts)return;var index=0;var count=fonts.length/3;for(var i=0;i<count;i++){if(!infos[fonts[index+2]]){this.Ranges.splice(0,this.Ranges.length);return}this.Ranges.push(new CSymbolRange(fonts[index],fonts[index+1],infos[fonts[index+2]][0]));index+=3}fonts=null;delete window["__fonts_ranges"]},getRangeBySymbol:function(_char,_array){var _start=0;var _end=_array.length-1;var _center=0;var _range=null; if(_start>_end)return null;while(_start<_end){_center=_start+_end>>1;_range=_array[_center];if(_range.Start>_char)_end=_center-1;else if(_range.End<_char)_start=_center+1;else return _array[_center]}if(_start>_end)return null;_range=_array[_start];if(_range.Start>_char||_range.End<_char)return null;return _array[_start]},getFontBySymbol:function(_char){if(!this.IsUseNoSquaresMode)return"";if(undefined===_char||0==_char)return"";if(this.LastRange)if(this.LastRange.Start<=_char&&_char<=this.LastRange.End)return this.LastRange.Name; var _range=this.getRangeBySymbol(_char,this.UsedRanges);if(_range!=null){this.LastRange=_range;return _range.Name}_range=this.getRangeBySymbol(_char,this.Ranges);if(!_range)return"";this.UsedRanges.push(_range);this.LastRange=_range;if(!this.FontsByRange[_range.Name]){this.FontsByRange[_range.Name]=_range.Name;this.FontsByRangeCount++}return _range.Name},getFontsByString:function(_text){if(!this.IsUseNoSquaresMode)return false;if(!_text)return false;var oldCount=this.FontsByRangeCount;for(var i=_text.getUnicodeIterator();i.check();i.next())AscFonts.FontPickerByCharacter.getFontBySymbol(i.value()); return this.FontsByRangeCount!=oldCount},getFontsByString2:function(_array){if(!this.IsUseNoSquaresMode)return false;if(!_array)return false;var oldCount=this.FontsByRangeCount;for(var i=0;i<_array.length;++i)AscFonts.FontPickerByCharacter.getFontBySymbol(_array[i]);return this.FontsByRangeCount!=oldCount},isExtendFonts:function(){return this.ExtendFontsByRangeCount!=this.FontsByRangeCount},extendFonts:function(fonts,isNoRealExtend){if(this.ExtendFontsByRangeCount==this.FontsByRangeCount)return;var isFound; for(var i in this.FontsByRange){isFound=false;for(var j in fonts)if(fonts[j].name==this.FontsByRange[i]){isFound=true;break}if(!isFound)fonts[fonts.length]=new AscFonts.CFont(this.FontsByRange[i],0,"",0,null)}if(true!==isNoRealExtend)this.ExtendFontsByRangeCount=this.FontsByRangeCount},checkTextLight:function(text,isCodes){if(isCodes!==true){if(!this.getFontsByString(text))return false}else if(!this.getFontsByString2(text))return false;var fonts=[];this.extendFonts(fonts,true);if(false===AscCommon.g_font_loader.CheckFontsNeedLoading(fonts))return false; return true},loadFonts:function(_this,_callback){var fonts=[];this.extendFonts(fonts);this.CallbackObj._this=_this;this.CallbackObj._callback=_callback;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.asyncMethodCallback=function(){var _t=AscFonts.FontPickerByCharacter.CallbackObj;_t._callback.call(_t._this);_t._this=null;_t._callback=null};AscCommon.g_font_loader.LoadDocumentFonts2(fonts);return true},checkText:function(text,_this,_callback,isCodes,isOnlyAsync,isCheckSymbols){if(window["NATIVE_EDITOR_ENJINE"]){_callback.call(_this); return false}if(isCheckSymbols!==false)if(isCodes!==true){if(!this.getFontsByString(text)){if(!isOnlyAsync)_callback.call(_this);return false}}else if(!this.getFontsByString2(text)){if(!isOnlyAsync)_callback.call(_this);return false}var fonts=[];this.extendFonts(fonts);if(false===AscCommon.g_font_loader.CheckFontsNeedLoading(fonts)){if(!isOnlyAsync)_callback.call(_this);return false}this.CallbackObj._this=_this;this.CallbackObj._callback=_callback;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]: window.editor;_editor.asyncMethodCallback=function(){var _t=AscFonts.FontPickerByCharacter.CallbackObj;_t._callback.call(_t._this);_t._this=null;_t._callback=null};AscCommon.g_font_loader.LoadDocumentFonts2(fonts);return true}};window["AscFonts"]=window["AscFonts"]||{};window["AscFonts"].IsCheckSymbols=false;window["AscFonts"].FontPickerByCharacter=new CFontByCharacter})(window);"use strict";(function(window,undefined){function CFontFilesCache(){this.m_lMaxSize=1E3;this.m_lCurrentSize=0;this.Fonts= {};this.LoadFontFile=function(stream_index,name,faceindex,fontManager){if(!fontManager._engine)AscFonts.engine_Create(fontManager);if(AscFonts.CreateNativeStreamByIndex)AscFonts.CreateNativeStreamByIndex(stream_index);if(!AscFonts.g_fonts_streams[stream_index])return null;return fontManager._engine.openFont(AscFonts.g_fonts_streams[stream_index],faceindex)};this.LockFont=function(stream_index,fontName,faceIndex,fontSize,_ext,fontManager){var key=fontName+faceIndex+fontSize;if(undefined!==_ext)key+= _ext;var pFontFile=this.Fonts[key];if(pFontFile)return pFontFile;pFontFile=this.Fonts[key]=this.LoadFontFile(stream_index,fontName,faceIndex,fontManager);return pFontFile}}function CFontManager(params){this._engine=null;this.m_pFont=null;this.m_oGlyphString=new AscFonts.CGlyphString;this.error=0;this.fontName=undefined;this.m_fCharSpacing=0;this.m_bStringGID=false;this.m_oFontsCache=null;this.m_lUnits_Per_Em=0;this.m_lAscender=0;this.m_lDescender=0;this.m_lLineHeight=0;this.RasterMemory=null;this.IsCellMode= params&¶ms.mode=="cell"?true:false;this.IsAdvanceNeedBoldFonts=this.IsCellMode;this.IsUseWinOS2Params=true;this.bIsHinting=false;this.bIsSubpixHinting=false;this.LOAD_MODE=40970}CFontManager.prototype={AfterLoad:function(){if(null==this.m_pFont){this.m_lUnits_Per_Em=0;this.m_lAscender=0;this.m_lDescender=0;this.m_lLineHeight=0}else{var f=this.m_pFont;this.m_lUnits_Per_Em=f.m_lUnits_Per_Em;this.m_lAscender=f.m_lAscender;this.m_lDescender=f.m_lDescender;this.m_lLineHeight=f.m_lLineHeight;f.CheckHintsSupport()}}, Initialize:function(is_init_raster_memory){this.m_oFontsCache=new CFontFilesCache;if(is_init_raster_memory===true){AscFonts.registeredFontManagers.push(this);this.InitializeRasterMemory()}},InitializeRasterMemory:function(){if(AscFonts.use_map_blitting){if(!this.RasterMemory){this.RasterMemory=new AscFonts.CRasterHeapTotal;this.RasterMemory.CreateFirstChuck()}}else if(this.RasterMemory)this.RasterMemory=null},ClearFontsRasterCache:function(){for(var i in this.m_oFontsCache.Fonts)if(this.m_oFontsCache.Fonts[i])this.m_oFontsCache.Fonts[i].ClearCache(); this.ClearRasterMemory()},ClearRasterMemory:function(){if(null==this.RasterMemory||null==this.m_oFontsCache)return;var _fonts=this.m_oFontsCache.Fonts;for(var i in _fonts)if(_fonts[i]!==undefined&&_fonts[i]!=null)_fonts[i].ClearCacheNoAttack();this.RasterMemory.Clear()},UpdateSize:function(dOldSize,dDpi,dNewDpi){if(0==dNewDpi)dNewDpi=72;if(0==dDpi)dDpi=72;return dOldSize*dDpi/dNewDpi},LoadString:function(wsBuffer,fX,fY){if(!this.m_pFont)return false;this.m_oGlyphString.SetString(wsBuffer,fX,fY);this.m_pFont.GetString(this.m_oGlyphString); return true},LoadString2:function(wsBuffer,fX,fY){if(!this.m_pFont)return false;this.m_oGlyphString.SetString(wsBuffer,fX,fY);this.m_pFont.GetString2(this.m_oGlyphString);return true},LoadString3:function(gid,fX,fY){if(!this.m_pFont)return false;this.SetStringGID(true);this.m_oGlyphString.SetStringGID(gid,fX,fY);this.m_pFont.GetString2(this.m_oGlyphString);this.SetStringGID(false);return true},LoadString3C:function(gid,fX,fY){if(!this.m_pFont)return false;this.SetStringGID(true);var string=this.m_oGlyphString; string.m_fX=fX+string.m_fTransX;string.m_fY=fY+string.m_fTransY;string.m_nGlyphsCount=1;string.m_nGlyphIndex=0;var _g=string.GetFirstGlyph();_g.bBitmap=false;_g.oBitmap=null;_g.eState=AscFonts.EGlyphState.glyphstateNormal;_g.lUnicode=gid;this.m_pFont.GetString2C(string);this.SetStringGID(false);return true},LoadString2C:function(wsBuffer,fX,fY){if(!this.m_pFont)return false;var string=this.m_oGlyphString;string.m_fX=fX+string.m_fTransX;string.m_fY=fY+string.m_fTransY;string.m_nGlyphsCount=1;string.m_nGlyphIndex= 0;var _g=string.GetFirstGlyph();_g.bBitmap=false;_g.oBitmap=null;_g.eState=AscFonts.EGlyphState.glyphstateNormal;_g.lUnicode=wsBuffer.charCodeAt(0);this.m_pFont.GetString2C(string);return string.m_fEndX},LoadString4C:function(lUnicode,fX,fY){if(!this.m_pFont)return false;var string=this.m_oGlyphString;string.m_fX=fX+string.m_fTransX;string.m_fY=fY+string.m_fTransY;string.m_nGlyphsCount=1;string.m_nGlyphIndex=0;var _g=string.GetFirstGlyph();_g.bBitmap=false;_g.oBitmap=null;_g.eState=AscFonts.EGlyphState.glyphstateNormal; _g.lUnicode=lUnicode;this.m_pFont.GetString2C(string);return string.m_fEndX},LoadStringPathCode:function(code,isGid,fX,fY,worker){if(!this.m_pFont)return false;this.SetStringGID(isGid);var string=this.m_oGlyphString;string.m_fX=fX+string.m_fTransX;string.m_fY=fY+string.m_fTransY;string.m_nGlyphsCount=1;string.m_nGlyphIndex=0;var _g=string.GetFirstGlyph();_g.bBitmap=false;_g.oBitmap=null;_g.eState=AscFonts.EGlyphState.glyphstateNormal;_g.lUnicode=code;this.m_pFont.GetStringPath(string,worker);this.SetStringGID(false); return true},LoadChar:function(lUnicode){if(!this.m_pFont)return false;return this.m_pFont.GetChar2(lUnicode)},MeasureChar:function(lUnicode,is_raster_distances){if(!this.m_pFont)return;return this.m_pFont.GetChar(lUnicode,is_raster_distances)},GetKerning:function(unPrevGID,unGID){if(!this.m_pFont)return;return this.m_pFont.GetKerning(unPrevGID,unGID)},MeasureString:function(){var oPoint=new AscFonts.CGlyphRect;var len=this.m_oGlyphString.GetLength();if(len<=0)return oPoint;var fTop=65535,fBottom= -65535,fLeft=65535,fRight=-65535;for(var nIndex=0;nIndex<len;++nIndex){var oSizeTmp=this.m_oGlyphString.GetBBox(nIndex);if(fBottom<oSizeTmp.fBottom)fBottom=oSizeTmp.fBottom;if(fTop>oSizeTmp.fTop)fTop=oSizeTmp.fTop;if(fLeft>oSizeTmp.fLeft)fLeft=oSizeTmp.fLeft;if(fRight<oSizeTmp.fRight)fRight=oSizeTmp.fRight}oPoint.fX=fLeft;oPoint.fY=fTop;oPoint.fWidth=Math.abs(fRight-fLeft);oPoint.fHeight=Math.abs(fTop-fBottom);return oPoint},MeasureString2:function(){var oPoint=new AscFonts.CGlyphRect;if(this.m_oGlyphString.GetLength()<= 0)return oPoint;var oSizeTmp=this.m_oGlyphString.GetBBox2();oPoint.fX=oSizeTmp.fLeft;oPoint.fY=oSizeTmp.fTop;oPoint.fWidth=Math.abs(oSizeTmp.fRight-oSizeTmp.fLeft);oPoint.fHeight=Math.abs(oSizeTmp.fTop-oSizeTmp.fBottom);return oPoint},GetNextChar2:function(){return this.m_oGlyphString.GetNext()},IsSuccess:function(){return 0==this.error},SetTextMatrix:function(fA,fB,fC,fD,fE,fF){if(!this.m_pFont)return false;if(this.m_pFont.SetTextMatrix(fA,fB,fC,fD,0,0))this.m_oGlyphString.SetCTM(fA,fB,fC,fD,0,0); this.m_oGlyphString.SetTrans(fE,fF);return true},SetTextMatrix2:function(fA,fB,fC,fD,fE,fF){if(!this.m_pFont)return false;this.m_pFont.SetTextMatrix(fA,fB,fC,fD,0,0);this.m_oGlyphString.SetCTM(fA,fB,fC,fD,0,0);this.m_oGlyphString.SetTrans(fE,fF);return true},SetStringGID:function(bStringGID){this.m_bStringGID=bStringGID;if(!this.m_pFont)return;this.m_pFont.SetStringGID(this.m_bStringGID)},SetHintsProps:function(bIsHinting,bIsSubpixHinting){this.bIsHinting=bIsHinting;this.bIsSubpixHinting=bIsSubpixHinting; if(this._engine)this._engine.setHintsProps(bIsHinting,bIsSubpixHinting);this.ClearFontsRasterCache()},SetAdvanceNeedBoldFonts:function(value){this.IsAdvanceNeedBoldFonts=value},LoadFont:function(fontFile,faceIndex,size,isBold,isItalic,needBold,needItalic,isNoSetupToManager){var _ext="";if(needBold)_ext+="nbold";if(needItalic)_ext+="nitalic";var pFontFile=this.m_oFontsCache.LockFont(fontFile.stream_index,fontFile.Id,faceIndex,size,_ext,this);if(!pFontFile)return null;pFontFile.m_oFontManager=this; pFontFile.SetNeedBold(needBold);pFontFile.SetNeedItalic(needItalic);pFontFile.SetStringGID(this.m_bStringGID);pFontFile.SetCharSpacing(this.m_fCharSpacing);if(isNoSetupToManager!==true){this.m_pFont=pFontFile;this.m_oGlyphString.ResetCTM();this.AfterLoad()}return pFontFile}};window["AscFonts"].CFontManager=CFontManager;window["AscFonts"].CFontFilesCache=CFontFilesCache;window["AscFonts"].onLoadModule()})(window);"use strict";var fontslot_ASCII=0;var fontslot_EastAsia=1;var fontslot_CS=2;var fontslot_HAnsi= 3;var fonthint_Default=0;var fonthint_CS=1;var fonthint_EastAsia=2;var lcid_unknown=0;var lcid_ar=1;var lcid_bg=2;var lcid_ca=3;var lcid_zhHans=4;var lcid_cs=5;var lcid_da=6;var lcid_de=7;var lcid_el=8;var lcid_en=9;var lcid_es=10;var lcid_fi=11;var lcid_fr=12;var lcid_he=13;var lcid_hu=14;var lcid_is=15;var lcid_it=16;var lcid_ja=17;var lcid_ko=18;var lcid_nl=19;var lcid_no=20;var lcid_pl=21;var lcid_pt=22;var lcid_rm=23;var lcid_ro=24;var lcid_ru=25;var lcid_hr=26;var lcid_sk=27;var lcid_sq=28; var lcid_sv=29;var lcid_th=30;var lcid_tr=31;var lcid_ur=32;var lcid_id=33;var lcid_uk=34;var lcid_be=35;var lcid_sl=36;var lcid_et=37;var lcid_lv=38;var lcid_lt=39;var lcid_tg=40;var lcid_fa=41;var lcid_vi=42;var lcid_hy=43;var lcid_az=44;var lcid_eu=45;var lcid_hsb=46;var lcid_mk=47;var lcid_tn=50;var lcid_xh=52;var lcid_zu=53;var lcid_af=54;var lcid_ka=55;var lcid_fo=56;var lcid_hi=57;var lcid_mt=58;var lcid_se=59;var lcid_ga=60;var lcid_ms=62;var lcid_kk=63;var lcid_ky=64;var lcid_sw=65;var lcid_tk= 66;var lcid_uz=67;var lcid_tt=68;var lcid_bn=69;var lcid_pa=70;var lcid_gu=71;var lcid_or=72;var lcid_ta=73;var lcid_te=74;var lcid_kn=75;var lcid_ml=76;var lcid_as=77;var lcid_mr=78;var lcid_sa=79;var lcid_mn=80;var lcid_bo=81;var lcid_cy=82;var lcid_km=83;var lcid_lo=84;var lcid_gl=86;var lcid_kok=87;var lcid_syr=90;var lcid_si=91;var lcid_iu=93;var lcid_am=94;var lcid_tzm=95;var lcid_ne=97;var lcid_fy=98;var lcid_ps=99;var lcid_fil=100;var lcid_dv=101;var lcid_ha=104;var lcid_yo=106;var lcid_quz= 107;var lcid_nso=108;var lcid_ba=109;var lcid_lb=110;var lcid_kl=111;var lcid_ig=112;var lcid_ii=120;var lcid_arn=122;var lcid_moh=124;var lcid_br=126;var lcid_ug=128;var lcid_mi=129;var lcid_oc=130;var lcid_co=131;var lcid_gsw=132;var lcid_sah=133;var lcid_qut=134;var lcid_rw=135;var lcid_wo=136;var lcid_prs=140;var lcid_gd=145;var lcid_arSA=1025;var lcid_bgBG=1026;var lcid_caES=1027;var lcid_zhTW=1028;var lcid_csCZ=1029;var lcid_daDK=1030;var lcid_deDE=1031;var lcid_elGR=1032;var lcid_enUS=1033; var lcid_esES_tradnl=1034;var lcid_fiFI=1035;var lcid_frFR=1036;var lcid_heIL=1037;var lcid_huHU=1038;var lcid_isIS=1039;var lcid_itIT=1040;var lcid_jaJP=1041;var lcid_koKR=1042;var lcid_nlNL=1043;var lcid_nbNO=1044;var lcid_plPL=1045;var lcid_ptBR=1046;var lcid_rmCH=1047;var lcid_roRO=1048;var lcid_ruRU=1049;var lcid_hrHR=1050;var lcid_skSK=1051;var lcid_sqAL=1052;var lcid_svSE=1053;var lcid_thTH=1054;var lcid_trTR=1055;var lcid_urPK=1056;var lcid_idID=1057;var lcid_ukUA=1058;var lcid_beBY=1059; var lcid_slSI=1060;var lcid_etEE=1061;var lcid_lvLV=1062;var lcid_ltLT=1063;var lcid_tgCyrlTJ=1064;var lcid_faIR=1065;var lcid_viVN=1066;var lcid_hyAM=1067;var lcid_azLatnAZ=1068;var lcid_euES=1069;var lcid_wenDE=1070;var lcid_mkMK=1071;var lcid_stZA=1072;var lcid_tsZA=1073;var lcid_tnZA=1074;var lcid_venZA=1075;var lcid_xhZA=1076;var lcid_zuZA=1077;var lcid_afZA=1078;var lcid_kaGE=1079;var lcid_foFO=1080;var lcid_hiIN=1081;var lcid_mtMT=1082;var lcid_seNO=1083;var lcid_msMY=1086;var lcid_kkKZ=1087; var lcid_kyKG=1088;var lcid_swKE=1089;var lcid_tkTM=1090;var lcid_uzLatnUZ=1091;var lcid_ttRU=1092;var lcid_bnIN=1093;var lcid_paIN=1094;var lcid_guIN=1095;var lcid_orIN=1096;var lcid_taIN=1097;var lcid_teIN=1098;var lcid_knIN=1099;var lcid_mlIN=1100;var lcid_asIN=1101;var lcid_mrIN=1102;var lcid_saIN=1103;var lcid_mnMN=1104;var lcid_boCN=1105;var lcid_cyGB=1106;var lcid_kmKH=1107;var lcid_loLA=1108;var lcid_myMM=1109;var lcid_glES=1110;var lcid_kokIN=1111;var lcid_mni=1112;var lcid_sdIN=1113;var lcid_syrSY= 1114;var lcid_siLK=1115;var lcid_chrUS=1116;var lcid_iuCansCA=1117;var lcid_amET=1118;var lcid_tmz=1119;var lcid_neNP=1121;var lcid_fyNL=1122;var lcid_psAF=1123;var lcid_filPH=1124;var lcid_dvMV=1125;var lcid_binNG=1126;var lcid_fuvNG=1127;var lcid_haLatnNG=1128;var lcid_ibbNG=1129;var lcid_yoNG=1130;var lcid_quzBO=1131;var lcid_nsoZA=1132;var lcid_baRU=1133;var lcid_lbLU=1134;var lcid_klGL=1135;var lcid_igNG=1136;var lcid_krNG=1137;var lcid_gazET=1138;var lcid_tiER=1139;var lcid_gnPY=1140;var lcid_hawUS= 1141;var lcid_soSO=1143;var lcid_iiCN=1144;var lcid_papAN=1145;var lcid_arnCL=1146;var lcid_mohCA=1148;var lcid_brFR=1150;var lcid_ugCN=1152;var lcid_miNZ=1153;var lcid_ocFR=1154;var lcid_coFR=1155;var lcid_gswFR=1156;var lcid_sahRU=1157;var lcid_qutGT=1158;var lcid_rwRW=1159;var lcid_woSN=1160;var lcid_prsAF=1164;var lcid_pltMG=1165;var lcid_gdGB=1169;var lcid_arIQ=2049;var lcid_zhCN=2052;var lcid_deCH=2055;var lcid_enGB=2057;var lcid_esMX=2058;var lcid_frBE=2060;var lcid_itCH=2064;var lcid_nlBE= 2067;var lcid_nnNO=2068;var lcid_ptPT=2070;var lcid_roMO=2072;var lcid_ruMO=2073;var lcid_srLatnCS=2074;var lcid_svFI=2077;var lcid_urIN=2080;var lcid_azCyrlAZ=2092;var lcid_dsbDE=2094;var lcid_seSE=2107;var lcid_gaIE=2108;var lcid_msBN=2110;var lcid_uzCyrlUZ=2115;var lcid_bnBD=2117;var lcid_paPK=2118;var lcid_mnMongCN=2128;var lcid_boBT=2129;var lcid_sdPK=2137;var lcid_iuLatnCA=2141;var lcid_tzmLatnDZ=2143;var lcid_neIN=2145;var lcid_quzEC=2155;var lcid_tiET=2163;var lcid_arEG=3073;var lcid_zhHK= 3076;var lcid_deAT=3079;var lcid_enAU=3081;var lcid_esES=3082;var lcid_frCA=3084;var lcid_srCyrlCS=3098;var lcid_seFI=3131;var lcid_tmzMA=3167;var lcid_quzPE=3179;var lcid_arLY=4097;var lcid_zhSG=4100;var lcid_deLU=4103;var lcid_enCA=4105;var lcid_esGT=4106;var lcid_frCH=4108;var lcid_hrBA=4122;var lcid_smjNO=4155;var lcid_arDZ=5121;var lcid_zhMO=5124;var lcid_deLI=5127;var lcid_enNZ=5129;var lcid_esCR=5130;var lcid_frLU=5132;var lcid_bsLatnBA=5146;var lcid_smjSE=5179;var lcid_arMA=6145;var lcid_enIE= 6153;var lcid_esPA=6154;var lcid_frMC=6156;var lcid_srLatnBA=6170;var lcid_smaNO=6203;var lcid_arTN=7169;var lcid_enZA=7177;var lcid_esDO=7178;var lcid_frWest=7180;var lcid_srCyrlBA=7194;var lcid_smaSE=7227;var lcid_arOM=8193;var lcid_enJM=8201;var lcid_esVE=8202;var lcid_frRE=8204;var lcid_bsCyrlBA=8218;var lcid_smsFI=8251;var lcid_arYE=9217;var lcid_enCB=9225;var lcid_esCO=9226;var lcid_frCG=9228;var lcid_srLatnRS=9242;var lcid_smnFI=9275;var lcid_arSY=10241;var lcid_enBZ=10249;var lcid_esPE=10250; var lcid_frSN=10252;var lcid_srCyrlRS=10266;var lcid_arJO=11265;var lcid_enTT=11273;var lcid_esAR=11274;var lcid_frCM=11276;var lcid_srLatnME=11290;var lcid_arLB=12289;var lcid_enZW=12297;var lcid_esEC=12298;var lcid_frCI=12300;var lcid_srCyrlME=12314;var lcid_arKW=13313;var lcid_enPH=13321;var lcid_esCL=13322;var lcid_frML=13324;var lcid_arAE=14337;var lcid_enID=14345;var lcid_esUY=14346;var lcid_frMA=14348;var lcid_arBH=15361;var lcid_enHK=15369;var lcid_esPY=15370;var lcid_frHT=15372;var lcid_arQA= 16385;var lcid_enIN=16393;var lcid_esBO=16394;var lcid_enMY=17417;var lcid_esSV=17418;var lcid_enSG=18441;var lcid_esHN=18442;var lcid_esNI=19466;var lcid_esPR=20490;var lcid_esUS=21514;var lcid_bsCyrl=25626;var lcid_bsLatn=26650;var lcid_srCyrl=27674;var lcid_srLatn=28698;var lcid_smn=28731;var lcid_azCyrl=29740;var lcid_sms=29755;var lcid_zh=30724;var lcid_nn=30740;var lcid_bs=30746;var lcid_azLatn=30764;var lcid_sma=30779;var lcid_uzCyrl=30787;var lcid_mnCyrl=30800;var lcid_iuCans=30813;var lcid_zhHant= 31748;var lcid_nb=31764;var lcid_sr=31770;var lcid_tgCyrl=31784;var lcid_dsb=31790;var lcid_smj=31803;var lcid_uzLatn=31811;var lcid_mnMong=31824;var lcid_iuLatn=31837;var lcid_tzmLatn=31839;var lcid_haLatn=31848;(function(){function CDetectFontUse(){this.DetectData=null;this.TableChunkLen=65536;this.TableChunks=4;this.TableChunkMain=0;this.TableChunkHintEA=this.TableChunkLen;this.TableChunkHintZH=2*this.TableChunkLen;this.TableChunkHintEACS=3*this.TableChunkLen;this.Init=function(){this.DetectData= AscFonts.allocate(this.TableChunkLen*this.TableChunks);var _data=this.DetectData;var i,j;j=0;for(i=0;i<=127;i++)_data[i+j]=fontslot_ASCII;for(i=160;i<=1279;i++)_data[i+j]=fontslot_HAnsi;for(i=1424;i<=1983;i++)_data[i+j]=fontslot_ASCII;for(i=4352;i<=4607;i++)_data[i+j]=fontslot_EastAsia;for(i=7680;i<=7935;i++)_data[i+j]=fontslot_HAnsi;for(i=7936;i<=10175;i++)_data[i+j]=fontslot_HAnsi;for(i=11904;i<=12703;i++)_data[i+j]=fontslot_EastAsia;for(i=12800;i<=19855;i++)_data[i+j]=fontslot_EastAsia;for(i=19968;i<= 40879;i++)_data[i+j]=fontslot_EastAsia;for(i=40960;i<=42191;i++)_data[i+j]=fontslot_EastAsia;for(i=44032;i<=55215;i++)_data[i+j]=fontslot_EastAsia;for(i=55296;i<=57343;i++)_data[i+j]=fontslot_EastAsia;for(i=57344;i<=63743;i++)_data[i+j]=fontslot_HAnsi;for(i=63744;i<=64255;i++)_data[i+j]=fontslot_EastAsia;for(i=64256;i<=64284;i++)_data[i+j]=fontslot_HAnsi;for(i=64285;i<=65023;i++)_data[i+j]=fontslot_ASCII;for(i=65072;i<=65135;i++)_data[i+j]=fontslot_EastAsia;for(i=65136;i<=65278;i++)_data[i+j]=fontslot_ASCII; for(i=65280;i<=65519;i++)_data[i+j]=fontslot_EastAsia;j=this.TableChunkHintEA;for(i=0;i<=127;i++)_data[i+j]=fontslot_ASCII;for(i=160;i<=1279;i++)_data[i+j]=fontslot_HAnsi;_data[161+j]=fontslot_EastAsia;_data[164+j]=fontslot_EastAsia;_data[167+j]=fontslot_EastAsia;_data[168+j]=fontslot_EastAsia;_data[170+j]=fontslot_EastAsia;_data[173+j]=fontslot_EastAsia;_data[175+j]=fontslot_EastAsia;_data[176+j]=fontslot_EastAsia;_data[177+j]=fontslot_EastAsia;_data[178+j]=fontslot_EastAsia;_data[179+j]=fontslot_EastAsia; _data[180+j]=fontslot_EastAsia;_data[182+j]=fontslot_EastAsia;_data[183+j]=fontslot_EastAsia;_data[184+j]=fontslot_EastAsia;_data[185+j]=fontslot_EastAsia;_data[186+j]=fontslot_EastAsia;_data[188+j]=fontslot_EastAsia;_data[189+j]=fontslot_EastAsia;_data[190+j]=fontslot_EastAsia;_data[191+j]=fontslot_EastAsia;_data[215+j]=fontslot_EastAsia;_data[247+j]=fontslot_EastAsia;for(i=688;i<=1279;i++)_data[i+j]=fontslot_EastAsia;for(i=1424;i<=1983;i++)_data[i+j]=fontslot_ASCII;for(i=4352;i<=4607;i++)_data[i+ j]=fontslot_EastAsia;for(i=7680;i<=7935;i++)_data[i+j]=fontslot_HAnsi;for(i=7936;i<=8191;i++)_data[i+j]=fontslot_HAnsi;for(i=8192;i<=10175;i++)_data[i+j]=fontslot_EastAsia;for(i=11904;i<=12703;i++)_data[i+j]=fontslot_EastAsia;for(i=12800;i<=19855;i++)_data[i+j]=fontslot_EastAsia;for(i=19968;i<=40879;i++)_data[i+j]=fontslot_EastAsia;for(i=40960;i<=42191;i++)_data[i+j]=fontslot_EastAsia;for(i=44032;i<=55215;i++)_data[i+j]=fontslot_EastAsia;for(i=55296;i<=57343;i++)_data[i+j]=fontslot_EastAsia;for(i= 57344;i<=63743;i++)_data[i+j]=fontslot_EastAsia;for(i=63744;i<=64255;i++)_data[i+j]=fontslot_EastAsia;for(i=64256;i<=64284;i++)_data[i+j]=fontslot_EastAsia;for(i=64285;i<=65023;i++)_data[i+j]=fontslot_ASCII;for(i=65072;i<=65135;i++)_data[i+j]=fontslot_EastAsia;for(i=65136;i<=65278;i++)_data[i+j]=fontslot_ASCII;for(i=65280;i<=65519;i++)_data[i+j]=fontslot_EastAsia;j=this.TableChunkHintZH;for(i=0;i<=127;i++)_data[i+j]=fontslot_ASCII;for(i=160;i<=255;i++)_data[i+j]=fontslot_HAnsi;_data[161+j]=fontslot_EastAsia; _data[164+j]=fontslot_EastAsia;_data[167+j]=fontslot_EastAsia;_data[168+j]=fontslot_EastAsia;_data[170+j]=fontslot_EastAsia;_data[173+j]=fontslot_EastAsia;_data[175+j]=fontslot_EastAsia;_data[176+j]=fontslot_EastAsia;_data[177+j]=fontslot_EastAsia;_data[178+j]=fontslot_EastAsia;_data[179+j]=fontslot_EastAsia;_data[180+j]=fontslot_EastAsia;_data[182+j]=fontslot_EastAsia;_data[183+j]=fontslot_EastAsia;_data[184+j]=fontslot_EastAsia;_data[185+j]=fontslot_EastAsia;_data[186+j]=fontslot_EastAsia;_data[188+ j]=fontslot_EastAsia;_data[189+j]=fontslot_EastAsia;_data[190+j]=fontslot_EastAsia;_data[191+j]=fontslot_EastAsia;_data[215+j]=fontslot_EastAsia;_data[247+j]=fontslot_EastAsia;_data[224+j]=fontslot_EastAsia;_data[225+j]=fontslot_EastAsia;_data[232+j]=fontslot_EastAsia;_data[233+j]=fontslot_EastAsia;_data[234+j]=fontslot_EastAsia;_data[236+j]=fontslot_EastAsia;_data[237+j]=fontslot_EastAsia;_data[242+j]=fontslot_EastAsia;_data[243+j]=fontslot_EastAsia;_data[249+j]=fontslot_EastAsia;_data[250+j]=fontslot_EastAsia; _data[252+j]=fontslot_EastAsia;for(i=256;i<=687;i++)_data[i+j]=fontslot_EastAsia;for(i=688;i<=1279;i++)_data[i+j]=fontslot_EastAsia;for(i=1424;i<=1983;i++)_data[i+j]=fontslot_ASCII;for(i=4352;i<=4607;i++)_data[i+j]=fontslot_EastAsia;for(i=7680;i<=7935;i++)_data[i+j]=fontslot_EastAsia;for(i=7936;i<=8191;i++)_data[i+j]=fontslot_HAnsi;for(i=8192;i<=10175;i++)_data[i+j]=fontslot_EastAsia;for(i=11904;i<=12703;i++)_data[i+j]=fontslot_EastAsia;for(i=12800;i<=19855;i++)_data[i+j]=fontslot_EastAsia;for(i= 19968;i<=40879;i++)_data[i+j]=fontslot_EastAsia;for(i=40960;i<=42191;i++)_data[i+j]=fontslot_EastAsia;for(i=44032;i<=55215;i++)_data[i+j]=fontslot_EastAsia;for(i=55296;i<=57343;i++)_data[i+j]=fontslot_EastAsia;for(i=57344;i<=63743;i++)_data[i+j]=fontslot_EastAsia;for(i=63744;i<=64255;i++)_data[i+j]=fontslot_EastAsia;for(i=64256;i<=64284;i++)_data[i+j]=fontslot_EastAsia;for(i=64285;i<=65023;i++)_data[i+j]=fontslot_ASCII;for(i=65072;i<=65135;i++)_data[i+j]=fontslot_EastAsia;for(i=65136;i<=65278;i++)_data[i+ j]=fontslot_ASCII;for(i=65280;i<=65519;i++)_data[i+j]=fontslot_EastAsia;j=this.TableChunkHintEACS;for(i=0;i<=127;i++)_data[i+j]=fontslot_ASCII;for(i=160;i<=255;i++)_data[i+j]=fontslot_HAnsi;_data[161+j]=fontslot_EastAsia;_data[164+j]=fontslot_EastAsia;_data[167+j]=fontslot_EastAsia;_data[168+j]=fontslot_EastAsia;_data[170+j]=fontslot_EastAsia;_data[173+j]=fontslot_EastAsia;_data[175+j]=fontslot_EastAsia;_data[176+j]=fontslot_EastAsia;_data[177+j]=fontslot_EastAsia;_data[178+j]=fontslot_EastAsia;_data[179+ j]=fontslot_EastAsia;_data[180+j]=fontslot_EastAsia;_data[182+j]=fontslot_EastAsia;_data[183+j]=fontslot_EastAsia;_data[184+j]=fontslot_EastAsia;_data[185+j]=fontslot_EastAsia;_data[186+j]=fontslot_EastAsia;_data[188+j]=fontslot_EastAsia;_data[189+j]=fontslot_EastAsia;_data[190+j]=fontslot_EastAsia;_data[191+j]=fontslot_EastAsia;_data[215+j]=fontslot_EastAsia;_data[247+j]=fontslot_EastAsia;for(i=256;i<=687;i++)_data[i+j]=fontslot_EastAsia;for(i=688;i<=1279;i++)_data[i+j]=fontslot_EastAsia;for(i=1424;i<= 1983;i++)_data[i+j]=fontslot_ASCII;for(i=4352;i<=4607;i++)_data[i+j]=fontslot_EastAsia;for(i=7680;i<=7935;i++)_data[i+j]=fontslot_HAnsi;for(i=7936;i<=8191;i++)_data[i+j]=fontslot_HAnsi;for(i=8192;i<=10175;i++)_data[i+j]=fontslot_EastAsia;for(i=11904;i<=12703;i++)_data[i+j]=fontslot_EastAsia;for(i=12800;i<=19855;i++)_data[i+j]=fontslot_EastAsia;for(i=19968;i<=40879;i++)_data[i+j]=fontslot_EastAsia;for(i=40960;i<=42191;i++)_data[i+j]=fontslot_EastAsia;for(i=44032;i<=55215;i++)_data[i+j]=fontslot_EastAsia; for(i=55296;i<=57343;i++)_data[i+j]=fontslot_EastAsia;for(i=57344;i<=63743;i++)_data[i+j]=fontslot_EastAsia;for(i=63744;i<=64255;i++)_data[i+j]=fontslot_EastAsia;for(i=64256;i<=64284;i++)_data[i+j]=fontslot_EastAsia;for(i=64285;i<=65023;i++)_data[i+j]=fontslot_ASCII;for(i=65072;i<=65135;i++)_data[i+j]=fontslot_EastAsia;for(i=65136;i<=65278;i++)_data[i+j]=fontslot_ASCII;for(i=65280;i<=65519;i++)_data[i+j]=fontslot_EastAsia};this.Get_FontClass=function(nUnicode,nHint,nEastAsia_lcid,bCS,bRTL){var _glyph_slot= fontslot_ASCII;if(nUnicode>65535)if(nUnicode>=131072&&nUnicode<=173791||nUnicode>=194560&&nUnicode<=195103)_glyph_slot=fontslot_EastAsia;else if(nUnicode>=119808&&nUnicode<=120831)_glyph_slot=fontslot_ASCII;else _glyph_slot=fontslot_HAnsi;else if(nHint!=fonthint_EastAsia)_glyph_slot=this.DetectData[nUnicode];else{if(nEastAsia_lcid==lcid_zh)_glyph_slot=this.DetectData[this.TableChunkHintZH+nUnicode];else _glyph_slot=this.DetectData[this.TableChunkHintEA+nUnicode];if(_glyph_slot==fontslot_EastAsia)return _glyph_slot}if(bCS|| bRTL)return fontslot_CS;return _glyph_slot}}window.CDetectFontUse=CDetectFontUse;window.CDetectFontUse})();var g_font_detector=new window.CDetectFontUse;g_font_detector.Init();"use strict";(function(window,undefined){var g_fontApplication=AscFonts.g_fontApplication;function CGrRFonts(){this.Ascii={Name:"Empty",Index:-1};this.EastAsia={Name:"Empty",Index:-1};this.HAnsi={Name:"Empty",Index:-1};this.CS={Name:"Empty",Index:-1}}CGrRFonts.prototype={checkFromTheme:function(fontScheme,rFonts){this.Ascii.Name= fontScheme.checkFont(rFonts.Ascii.Name);this.EastAsia.Name=fontScheme.checkFont(rFonts.EastAsia.Name);this.HAnsi.Name=fontScheme.checkFont(rFonts.HAnsi.Name);this.CS.Name=fontScheme.checkFont(rFonts.CS.Name);this.Ascii.Index=-1;this.EastAsia.Index=-1;this.HAnsi.Index=-1;this.CS.Index=-1},fromRFonts:function(rFonts){this.Ascii.Name=rFonts.Ascii.Name;this.EastAsia.Name=rFonts.EastAsia.Name;this.HAnsi.Name=rFonts.HAnsi.Name;this.CS.Name=rFonts.CS.Name;this.Ascii.Index=-1;this.EastAsia.Index=-1;this.HAnsi.Index= -1;this.CS.Index=-1}};var gr_state_pen=0;var gr_state_brush=1;var gr_state_pen_brush=2;var gr_state_state=3;var gr_state_all=4;function CFontSetup(){this.Name="";this.Index=-1;this.Size=12;this.Bold=false;this.Italic=false;this.SetUpName="";this.SetUpIndex=-1;this.SetUpSize=12;this.SetUpStyle=-1;this.SetUpMatrix=new CMatrix}CFontSetup.prototype={Clear:function(){this.Name="";this.Index=-1;this.Size=12;this.Bold=false;this.Italic=false;this.SetUpName="";this.SetUpIndex=-1;this.SetUpSize=12;this.SetUpStyle= -1;this.SetUpMatrix=new CMatrix}};function CGrState_Pen(){this.Type=gr_state_pen;this.Pen=null}CGrState_Pen.prototype={Init:function(_pen){if(_pen!==undefined)this.Pen=_pen.CreateDublicate()}};function CGrState_Brush(){this.Type=gr_state_brush;this.Brush=null}CGrState_Brush.prototype={Init:function(_brush){if(undefined!==_brush)this.Brush=_brush.CreateDublicate()}};function CGrState_PenBrush(){this.Type=gr_state_pen_brush;this.Pen=null;this.Brush=null}CGrState_PenBrush.prototype={Init:function(_pen, _brush){if(undefined!==_pen&&undefined!==_brush){this.Pen=_pen.CreateDublicate();this.Brush=_brush.CreateDublicate()}}};function CHist_Clip(){this.Path=null;this.Rect=null;this.IsIntegerGrid=false;this.Transform=new CMatrix}CHist_Clip.prototype={Init:function(path,rect,isIntegerGrid,transform){this.Path=path;if(rect!==undefined){this.Rect=new _rect;this.Rect.x=rect.x;this.Rect.y=rect.y;this.Rect.w=rect.w;this.Rect.h=rect.h}if(undefined!==isIntegerGrid)this.IsIntegerGrid=isIntegerGrid;if(undefined!== transform)this.Transform=transform.CreateDublicate()},ToRenderer:function(renderer){if(this.Rect!=null){var r=this.Rect;renderer.StartClipPath();renderer.rect(r.x,r.y,r.w,r.h);renderer.EndClipPath()}else;}};function CGrState_State(){this.Type=gr_state_state;this.Transform=null;this.IsIntegerGrid=false;this.Clips=null}CGrState_State.prototype={Init:function(_transform,_isIntegerGrid,_clips){if(undefined!==_transform)this.Transform=_transform.CreateDublicate();if(undefined!==_isIntegerGrid)this.IsIntegerGrid= _isIntegerGrid;if(undefined!==_clips)this.Clips=_clips},ApplyClips:function(renderer){var _len=this.Clips.length;for(var i=0;i<_len;i++)this.Clips[i].ToRenderer(renderer)}};function CGrState(){this.Parent=null;this.States=[];this.Clips=[]}CGrState.prototype={SavePen:function(){if(null==this.Parent)return;var _state=new CGrState_Pen;_state.Init(this.Parent.m_oPen);this.States.push(_state)},SaveBrush:function(){if(null==this.Parent)return;var _state=new CGrState_Brush;_state.Init(this.Parent.m_oBrush); this.States.push(_state)},SavePenBrush:function(){if(null==this.Parent)return;var _state=new CGrState_PenBrush;_state.Init(this.Parent.m_oPen,this.Parent.m_oBrush);this.States.push(_state)},RestorePen:function(){var _ind=this.States.length-1;if(null==this.Parent||-1==_ind)return;var _state=this.States[_ind];if(_state.Type==gr_state_pen){this.States.splice(_ind,1);var _c=_state.Pen.Color;this.Parent.p_color(_c.R,_c.G,_c.B,_c.A)}},RestoreBrush:function(){var _ind=this.States.length-1;if(null==this.Parent|| -1==_ind)return;var _state=this.States[_ind];if(_state.Type==gr_state_brush){this.States.splice(_ind,1);var _c=_state.Brush.Color1;this.Parent.b_color1(_c.R,_c.G,_c.B,_c.A)}},RestorePenBrush:function(){var _ind=this.States.length-1;if(null==this.Parent||-1==_ind)return;var _state=this.States[_ind];if(_state.Type==gr_state_pen_brush){this.States.splice(_ind,1);var _cb=_state.Brush.Color1;var _cp=_state.Pen.Color;this.Parent.b_color1(_cb.R,_cb.G,_cb.B,_cb.A);this.Parent.p_color(_cp.R,_cp.G,_cp.B,_cp.A)}}, SaveGrState:function(){if(null==this.Parent)return;var _state=new CGrState_State;_state.Init(this.Parent.m_oTransform,!!this.Parent.m_bIntegerGrid,this.Clips);this.States.push(_state);this.Clips=[]},RestoreGrState:function(){var _ind=this.States.length-1;if(null==this.Parent||-1==_ind)return;var _state=this.States[_ind];if(_state.Type==gr_state_state){if(this.Clips.length>0){this.Parent.RemoveClip();for(var i=0;i<=_ind;i++){var _s=this.States[i];if(_s.Type==gr_state_state){var _c=_s.Clips;var _l= _c.length;for(var j=0;j<_l;j++){this.Parent.transform3(_c[j].Transform);this.Parent.SetIntegerGrid(_c[j].IsIntegerGrid);var _r=_c[j].Rect;this.Parent.StartClipPath();this.Parent._s();this.Parent._m(_r.x,_r.y);this.Parent._l(_r.x+_r.w,_r.y);this.Parent._l(_r.x+_r.w,_r.y+_r.h);this.Parent._l(_r.x,_r.y+_r.h);this.Parent._l(_r.x,_r.y);this.Parent.EndClipPath()}}}}this.Clips=_state.Clips;this.States.splice(_ind,1);this.Parent.transform3(_state.Transform);this.Parent.SetIntegerGrid(_state.IsIntegerGrid)}}, Save:function(){this.SavePen();this.SaveBrush();this.SaveGrState()},Restore:function(){this.RestoreGrState();this.RestoreBrush();this.RestorePen()},StartClipPath:function(){},EndClipPath:function(){},AddClipRect:function(_r){var _histClip=new CHist_Clip;_histClip.Transform=this.Parent.m_oTransform.CreateDublicate();_histClip.IsIntegerGrid=!!this.Parent.m_bIntegerGrid;_histClip.Rect=new _rect;_histClip.Rect.x=_r.x;_histClip.Rect.y=_r.y;_histClip.Rect.w=_r.w;_histClip.Rect.h=_r.h;this.Clips.push(_histClip); this.Parent.StartClipPath();this.Parent._s();this.Parent._m(_r.x,_r.y);this.Parent._l(_r.x+_r.w,_r.y);this.Parent._l(_r.x+_r.w,_r.y+_r.h);this.Parent._l(_r.x,_r.y+_r.h);this.Parent._l(_r.x,_r.y);this.Parent.EndClipPath()}};var g_stringBase64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var g_arrayBase64=[];for(var index64=0;index64<g_stringBase64.length;index64++)g_arrayBase64.push(g_stringBase64.charAt(index64));function Base64Encode(srcData,nSrcLen,nOffset){if("undefined"=== typeof nOffset)nOffset=0;var nWritten=0;var nLen1=(nSrcLen/3>>0)*4;var nLen2=nLen1/76>>0;var nLen3=19;var srcInd=0;var dstStr=[];var _s="";for(var i=0;i<=nLen2;i++){if(i==nLen2)nLen3=nLen1%76/4>>0;for(var j=0;j<nLen3;j++){var dwCurr=0;for(var n=0;n<3;n++){dwCurr|=srcData[srcInd++ +nOffset];dwCurr<<=8}_s="";for(var k=0;k<4;k++){var b=dwCurr>>>26&255;_s+=g_arrayBase64[b];dwCurr<<=6;dwCurr&=4294967295}dstStr.push(_s)}}nLen2=nSrcLen%3!=0?nSrcLen%3+1:0;if(nLen2){var dwCurr=0;for(var n=0;n<3;n++){if(n< nSrcLen%3)dwCurr|=srcData[srcInd++ +nOffset];dwCurr<<=8}_s="";for(var k=0;k<nLen2;k++){var b=dwCurr>>>26&255;_s+=g_arrayBase64[b];dwCurr<<=6}nLen3=nLen2!=0?4-nLen2:0;for(var j=0;j<nLen3;j++)_s+="=";dstStr.push(_s)}return dstStr.join("")}function CMemory(bIsNoInit){this.Init=function(){var _canvas=document.createElement("canvas");var _ctx=_canvas.getContext("2d");this.len=1024*1024*5;this.ImData=_ctx.createImageData(this.len/4,1);this.data=this.ImData.data;this.pos=0};this.ImData=null;this.data=null; this.len=0;this.pos=0;if(true!==bIsNoInit)this.Init();this.Copy=function(oMemory,nPos,nLen){for(var Index=0;Index<nLen;Index++){this.CheckSize(1);this.data[this.pos++]=oMemory.data[Index+nPos]}};this.CheckSize=function(count){if(this.pos+count>=this.len){var _canvas=document.createElement("canvas");var _ctx=_canvas.getContext("2d");var oldImData=this.ImData;var oldData=this.data;var oldPos=this.pos;this.len=Math.max(this.len*2,this.pos+(3*count/2>>0));this.ImData=_ctx.createImageData(this.len/4,1); this.data=this.ImData.data;var newData=this.data;for(var i=0;i<this.pos;i++)newData[i]=oldData[i]}};this.GetBase64Memory=function(){return Base64Encode(this.data,this.pos,0)};this.GetBase64Memory2=function(nPos,nLen){return Base64Encode(this.data,nLen,nPos)};this.GetData=function(nPos,nLen){var _canvas=document.createElement("canvas");var _ctx=_canvas.getContext("2d");var len=this.GetCurPosition();var ImData=_ctx.createImageData(Math.ceil(len/4),1);var res=ImData.data;for(var i=0;i<len;i++)res[i]= this.data[i];return res};this.GetCurPosition=function(){return this.pos};this.Seek=function(nPos){this.pos=nPos};this.Skip=function(nDif){this.pos+=nDif};this.WriteBool=function(val){this.CheckSize(1);if(false==val)this.data[this.pos++]=0;else this.data[this.pos++]=1};this.WriteByte=function(val){this.CheckSize(1);this.data[this.pos++]=val};this.WriteSByte=function(val){this.CheckSize(1);if(val<0)val+=256;this.data[this.pos++]=val};this.WriteShort=function(val){this.CheckSize(2);this.data[this.pos++]= val&255;this.data[this.pos++]=val>>>8&255};this.WriteUShort=function(val){this.WriteShort(AscFonts.FT_Common.UShort_To_Short(val))};this.WriteLong=function(val){this.CheckSize(4);this.data[this.pos++]=val&255;this.data[this.pos++]=val>>>8&255;this.data[this.pos++]=val>>>16&255;this.data[this.pos++]=val>>>24&255};this.WriteULong=function(val){this.WriteLong(AscFonts.FT_Common.UintToInt(val))};this.WriteDouble=function(val){this.CheckSize(4);var lval=val*1E5>>0&4294967295;this.data[this.pos++]=lval& 255;this.data[this.pos++]=lval>>>8&255;this.data[this.pos++]=lval>>>16&255;this.data[this.pos++]=lval>>>24&255};var tempHelp=new ArrayBuffer(8);var tempHelpUnit=new Uint8Array(tempHelp);var tempHelpFloat=new Float64Array(tempHelp);this.WriteDouble2=function(val){this.CheckSize(8);tempHelpFloat[0]=val;this.data[this.pos++]=tempHelpUnit[0];this.data[this.pos++]=tempHelpUnit[1];this.data[this.pos++]=tempHelpUnit[2];this.data[this.pos++]=tempHelpUnit[3];this.data[this.pos++]=tempHelpUnit[4];this.data[this.pos++]= tempHelpUnit[5];this.data[this.pos++]=tempHelpUnit[6];this.data[this.pos++]=tempHelpUnit[7]};this._doubleEncodeLE754=function(v){var s,e,m,i,d,c,mLen,eLen,eBias,eMax;var el={len:8,mLen:52,rt:0};mLen=el.mLen,eLen=el.len*8-el.mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1;s=v<0?1:0;v=Math.abs(v);if(isNaN(v)||v==Infinity){m=isNaN(v)?1:0;e=eMax}else{e=Math.floor(Math.log(v)/Math.LN2);if(v*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1)v+=el.rt/c;else v+=el.rt*Math.pow(2,1-eBias);if(v*c>=2){e++;c/=2}if(e+eBias>= eMax){m=0;e=eMax}else if(e+eBias>=1){m=(v*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=v*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}var a=new Array(8);for(i=0,d=1;mLen>=8;a[i]=m&255,i+=d,m/=256,mLen-=8);for(e=e<<mLen|m,eLen+=mLen;eLen>0;a[i]=e&255,i+=d,e/=256,eLen-=8);a[i-d]|=s*128;return a};this.WriteStringBySymbol=function(code){if(code<65535){this.CheckSize(4);this.data[this.pos++]=1;this.data[this.pos++]=0;this.data[this.pos++]=code&255;this.data[this.pos++]=code>>>8&255}else{this.CheckSize(6);this.data[this.pos++]= 2;this.data[this.pos++]=0;var codePt=code-65536;var c1=55296|codePt>>10;var c2=56320|codePt&1023;this.data[this.pos++]=c1&255;this.data[this.pos++]=c1>>>8&255;this.data[this.pos++]=c2&255;this.data[this.pos++]=c2>>>8&255}};this.WriteString=function(text){if("string"!=typeof text)text=text+"";var count=text.length&65535;this.CheckSize(2*count+2);this.data[this.pos++]=count&255;this.data[this.pos++]=count>>>8&255;for(var i=0;i<count;i++){var c=text.charCodeAt(i)&65535;this.data[this.pos++]=c&255;this.data[this.pos++]= c>>>8&255}};this.WriteString2=function(text){if("string"!=typeof text)text=text+"";var count=text.length&2147483647;var countWrite=2*count;this.WriteLong(countWrite);this.CheckSize(countWrite);for(var i=0;i<count;i++){var c=text.charCodeAt(i)&65535;this.data[this.pos++]=c&255;this.data[this.pos++]=c>>>8&255}};this.WriteString3=function(text){if("string"!=typeof text)text=text+"";var count=text.length&2147483647;var countWrite=2*count;this.CheckSize(countWrite);for(var i=0;i<count;i++){var c=text.charCodeAt(i)& 65535;this.data[this.pos++]=c&255;this.data[this.pos++]=c>>>8&255}};this.WriteString4=function(text){if("string"!=typeof text)text=text+"";var count=text.length&2147483647;this.WriteLong(count);this.CheckSize(2*count);for(var i=0;i<count;i++){var c=text.charCodeAt(i)&65535;this.data[this.pos++]=c&255;this.data[this.pos++]=c>>>8&255}};this.ClearNoAttack=function(){this.pos=0};this.WriteLongAt=function(_pos,val){this.data[_pos++]=val&255;this.data[_pos++]=val>>>8&255;this.data[_pos++]=val>>>16&255; this.data[_pos++]=val>>>24&255};this.WriteBuffer=function(data,_pos,count){this.CheckSize(count);for(var i=0;i<count;i++)this.data[this.pos++]=data[_pos+i]};this.WriteUtf8Char=function(code){this.CheckSize(1);if(code<128)this.data[this.pos++]=code;else if(code<2048){this.data[this.pos++]=192|code>>6;this.data[this.pos++]=128|code&63}else if(code<65536){this.data[this.pos++]=224|code>>12;this.data[this.pos++]=128|code>>6&63;this.data[this.pos++]=128|code&63}else if(code<2097151){this.data[this.pos++]= 240|code>>18;this.data[this.pos++]=128|code>>12&63;this.data[this.pos++]=128|code>>6&63;this.data[this.pos++]=128|code&63}else if(code<67108863){this.data[this.pos++]=248|code>>24;this.data[this.pos++]=128|code>>18&63;this.data[this.pos++]=128|code>>12&63;this.data[this.pos++]=128|code>>6&63;this.data[this.pos++]=128|code&63}else if(code<2147483647){this.data[this.pos++]=252|code>>30;this.data[this.pos++]=128|code>>24&63;this.data[this.pos++]=128|code>>18&63;this.data[this.pos++]=128|code>>12&63; this.data[this.pos++]=128|code>>6&63;this.data[this.pos++]=128|code&63}};this.WriteXmlString=function(val){var pCur=0;var pEnd=val.length;while(pCur<pEnd){var code=val.charCodeAt(pCur++);if(code>=55296&&code<=57343&&pCur<pEnd)code=65536+((code&1023)<<10|1023&val.charCodeAt(pCur++));this.WriteUtf8Char(code)}};this.WriteXmlStringEncode=function(val){var pCur=0;var pEnd=val.length;while(pCur<pEnd){var code=val.charCodeAt(pCur++);if(code>=55296&&code<=57343&&pCur<pEnd)code=65536+((code&1023)<<10|1023& val.charCodeAt(pCur++));switch(code){case 38:this.WriteUtf8Char(38);this.WriteUtf8Char(97);this.WriteUtf8Char(109);this.WriteUtf8Char(112);this.WriteUtf8Char(59);break;case 39:this.WriteUtf8Char(38);this.WriteUtf8Char(97);this.WriteUtf8Char(112);this.WriteUtf8Char(111);this.WriteUtf8Char(115);this.WriteUtf8Char(59);break;case 60:this.WriteUtf8Char(38);this.WriteUtf8Char(108);this.WriteUtf8Char(116);this.WriteUtf8Char(59);break;case 62:this.WriteUtf8Char(38);this.WriteUtf8Char(103);this.WriteUtf8Char(116); this.WriteUtf8Char(59);break;case 34:this.WriteUtf8Char(38);this.WriteUtf8Char(113);this.WriteUtf8Char(117);this.WriteUtf8Char(111);this.WriteUtf8Char(116);this.WriteUtf8Char(59);break;default:this.WriteUtf8Char(code);break}}};this.WriteXmlBool=function(val){this.WriteXmlString(val?"1":"0")};this.WriteXmlNumber=function(val){this.WriteXmlString(val.toString())};this.WriteXmlNodeStart=function(name,isClose){this.WriteUtf8Char(60);this.WriteXmlString(name);if(isClose)this.WriteUtf8Char(62)};this.WriteXmlNodeEnd= function(name,isEmpty,isEnd){if(isEmpty){if(isEnd)this.WriteUtf8Char(47);this.WriteUtf8Char(62)}else{this.WriteUtf8Char(60);this.WriteUtf8Char(47);this.WriteXmlString(name);this.WriteUtf8Char(62)}};this.WriteXmlAttributesEnd=function(name){this.WriteUtf8Char(62)};this.WriteXmlAttributeString=function(name,val){this.WriteUtf8Char(32);this.WriteXmlString(name);this.WriteUtf8Char(61);this.WriteUtf8Char(34);this.WriteXmlString(val);this.WriteUtf8Char(34)};this.WriteXmlAttributeStringEncode=function(name, val){this.WriteUtf8Char(32);this.WriteXmlString(name);this.WriteUtf8Char(61);this.WriteUtf8Char(34);this.WriteXmlStringEncode(val);this.WriteUtf8Char(34)};this.WriteXmlAttributeBool=function(name,val){this.WriteXmlAttributeString(name,val?"1":"0")};this.WriteXmlAttributeNumber=function(name,val){this.WriteXmlAttributeString(name,val.toString())};this.XlsbStartRecord=function(type,len){if(type<128)this.WriteByte(type);else{this.WriteByte(type&127|128);this.WriteByte(type>>7)}for(var i=0;i<4;++i){var part= len&127;len=len>>7;if(len===0){this.WriteByte(part);break}else this.WriteByte(part|128)}};this.XlsbEndRecord=function(){}}function CCommandsType(){this.ctPenXML=0;this.ctPenColor=1;this.ctPenAlpha=2;this.ctPenSize=3;this.ctPenDashStyle=4;this.ctPenLineStartCap=5;this.ctPenLineEndCap=6;this.ctPenLineJoin=7;this.ctPenDashPatern=8;this.ctPenDashPatternCount=9;this.ctPenDashOffset=10;this.ctPenAlign=11;this.ctPenMiterLimit=12;this.ctBrushXML=20;this.ctBrushType=21;this.ctBrushColor1=22;this.ctBrushColor2= 23;this.ctBrushAlpha1=24;this.ctBrushAlpha2=25;this.ctBrushTexturePath=26;this.ctBrushTextureAlpha=27;this.ctBrushTextureMode=28;this.ctBrushRectable=29;this.ctBrushRectableEnabled=30;this.ctBrushGradient=31;this.ctFontXML=40;this.ctFontName=41;this.ctFontSize=42;this.ctFontStyle=43;this.ctFontPath=44;this.ctFontGID=45;this.ctFontCharSpace=46;this.ctShadowXML=50;this.ctShadowVisible=51;this.ctShadowDistanceX=52;this.ctShadowDistanceY=53;this.ctShadowBlurSize=54;this.ctShadowColor=55;this.ctShadowAlpha= 56;this.ctEdgeXML=70;this.ctEdgeVisible=71;this.ctEdgeDistance=72;this.ctEdgeColor=73;this.ctEdgeAlpha=74;this.ctDrawText=80;this.ctDrawTextEx=81;this.ctDrawTextCode=82;this.ctDrawTextCodeGid=83;this.ctPathCommandMoveTo=91;this.ctPathCommandLineTo=92;this.ctPathCommandLinesTo=93;this.ctPathCommandCurveTo=94;this.ctPathCommandCurvesTo=95;this.ctPathCommandArcTo=96;this.ctPathCommandClose=97;this.ctPathCommandEnd=98;this.ctDrawPath=99;this.ctPathCommandStart=100;this.ctPathCommandGetCurrentPoint=101; this.ctPathCommandText=102;this.ctPathCommandTextEx=103;this.ctDrawImage=110;this.ctDrawImageFromFile=111;this.ctSetParams=120;this.ctBeginCommand=121;this.ctEndCommand=122;this.ctSetTransform=130;this.ctResetTransform=131;this.ctClipMode=140;this.ctCommandLong1=150;this.ctCommandDouble1=151;this.ctCommandString1=152;this.ctCommandLong2=153;this.ctCommandDouble2=154;this.ctCommandString2=155;this.ctHyperlink=160;this.ctLink=161;this.ctPageWidth=200;this.ctPageHeight=201;this.ctPageStart=202;this.ctPageEnd= 203;this.ctError=255}var CommandType=new CCommandsType;var MetaBrushType={Solid:0,Gradient:1,Texture:2};var DashPatternPresets=[[4,3],[4,3,1,3],[1,3],[8,3],[8,3,1,3],[8,3,1,3,1,3],undefined,[3,1],[3,1,1,1],[3,1,1,1,1,1],[1,1]];function CMetafileFontPicker(manager){this.Manager=manager;if(!this.Manager){this.Manager=new AscFonts.CFontManager;this.Manager.Initialize(false)}this.FontsInCache={};this.LastPickFont=null;this.LastPickFontNameOrigin="";this.LastPickFontName="";this.Metafile=null;this.SetFont= function(setFont){var name=setFont.FontFamily.Name;var size=setFont.FontSize;var style=0;if(setFont.Italic==true)style+=2;if(setFont.Bold==true)style+=1;var name_check=name+"_"+style;if(this.FontsInCache[name_check])this.LastPickFont=this.FontsInCache[name_check];else{var font=g_fontApplication.GetFontFileWeb(name,style);var font_name_index=AscFonts.g_map_font_index[font.m_wsFontName];var fontId=AscFonts.g_font_infos[font_name_index].GetFontID(AscCommon.g_font_loader,style);var test_id=fontId.id+ fontId.faceIndex+size;var cache=this.Manager.m_oFontsCache;this.LastPickFont=cache.Fonts[test_id];if(!this.LastPickFont)this.LastPickFont=cache.Fonts[test_id+"nbold"];if(!this.LastPickFont)this.LastPickFont=cache.Fonts[test_id+"nitalic"];if(!this.LastPickFont)this.LastPickFont=cache.Fonts[test_id+"nboldnitalic"];if(!this.LastPickFont){if(window["NATIVE_EDITOR_ENJINE"]&&fontId.file.Status!=0)fontId.file.LoadFontNative();this.LastPickFont=cache.LockFont(fontId.file.stream_index,fontId.id,fontId.faceIndex, size,"",this.Manager)}this.FontsInCache[name_check]=this.LastPickFont}this.LastPickFontNameOrigin=name;this.LastPickFontName=name;this.Metafile.SetFont(setFont,true)};this.FillTextCode=function(glyph){if(this.LastPickFont.GetGIDByUnicode(glyph)){if(this.LastPickFontName!=this.LastPickFontNameOrigin){this.LastPickFontName=this.LastPickFontNameOrigin;this.Metafile.SetFontName(this.LastPickFontName)}}else{var name=AscFonts.FontPickerByCharacter.getFontBySymbol(glyph);if(name!=this.LastPickFontName){this.LastPickFontName= name;this.Metafile.SetFontName(this.LastPickFontName)}}}}function CMetafile(width,height){this.Width=width;this.Height=height;this.m_oPen=new CPen;this.m_oBrush=new CBrush;this.m_oFont={Name:"",FontSize:-1,Style:-1};this.m_oPen.Color.R=-1;this.m_oBrush.Color1.R=-1;this.m_oBrush.Color2.R=-1;this.m_oTransform=new CMatrix;this.m_arrayCommands=[];this.Memory=null;this.VectorMemoryForPrint=null;this.BrushType=MetaBrushType.Solid;this.m_oTextPr=null;this.m_oGrFonts=new CGrRFonts;this.m_oFontSlotFont=new CFontSetup; this.LastFontOriginInfo={Name:"",Replace:null};this.m_oFontTmp={FontFamily:{Name:"arial"},Bold:false,Italic:false};this.StartOffset=0;this.m_bIsPenDash=false;this.FontPicker=null}CMetafile.prototype={p_color:function(r,g,b,a){if(this.m_oPen.Color.R!=r||this.m_oPen.Color.G!=g||this.m_oPen.Color.B!=b){this.m_oPen.Color.R=r;this.m_oPen.Color.G=g;this.m_oPen.Color.B=b;var value=b<<16|g<<8|r;this.Memory.WriteByte(CommandType.ctPenColor);this.Memory.WriteLong(value)}if(this.m_oPen.Color.A!=a){this.m_oPen.Color.A= a;this.Memory.WriteByte(CommandType.ctPenAlpha);this.Memory.WriteByte(a)}},p_width:function(w){var val=w/1E3;if(this.m_oPen.Size!=val){this.m_oPen.Size=val;this.Memory.WriteByte(CommandType.ctPenSize);this.Memory.WriteDouble(val)}},p_dash:function(params){var bIsDash=params&¶ms.length>0?true:false;if(false==this.m_bIsPenDash&&bIsDash==this.m_bIsPenDash)return;this.m_bIsPenDash=bIsDash;if(!this.m_bIsPenDash){this.Memory.WriteByte(CommandType.ctPenDashStyle);this.Memory.WriteByte(0)}else{this.Memory.WriteByte(CommandType.ctPenDashStyle); this.Memory.WriteByte(5);this.Memory.WriteLong(params.length);for(var i=0;i<params.length;i++)this.Memory.WriteDouble(params[i])}},b_color1:function(r,g,b,a){if(this.BrushType!=MetaBrushType.Solid){this.Memory.WriteByte(CommandType.ctBrushType);this.Memory.WriteLong(1E3);this.BrushType=MetaBrushType.Solid}if(this.m_oBrush.Color1.R!=r||this.m_oBrush.Color1.G!=g||this.m_oBrush.Color1.B!=b){this.m_oBrush.Color1.R=r;this.m_oBrush.Color1.G=g;this.m_oBrush.Color1.B=b;var value=b<<16|g<<8|r;this.Memory.WriteByte(CommandType.ctBrushColor1); this.Memory.WriteLong(value)}if(this.m_oBrush.Color1.A!=a){this.m_oBrush.Color1.A=a;this.Memory.WriteByte(CommandType.ctBrushAlpha1);this.Memory.WriteByte(a)}},b_color2:function(r,g,b,a){if(this.m_oBrush.Color2.R!=r||this.m_oBrush.Color2.G!=g||this.m_oBrush.Color2.B!=b){this.m_oBrush.Color2.R=r;this.m_oBrush.Color2.G=g;this.m_oBrush.Color2.B=b;var value=b<<16|g<<8|r;this.Memory.WriteByte(CommandType.ctBrushColor2);this.Memory.WriteLong(value)}if(this.m_oBrush.Color2.A!=a){this.m_oBrush.Color2.A=a; this.Memory.WriteByte(CommandType.ctBrushAlpha2);this.Memory.WriteByte(a)}},put_brushTexture:function(src,mode){var isLocalUse=true;if(window["AscDesktopEditor"]&&window["AscDesktopEditor"]["IsLocalFile"]&&window["AscDesktopEditor"]["IsFilePrinting"])isLocalUse=!window["AscDesktopEditor"]["IsLocalFile"]()&&window["AscDesktopEditor"]["IsFilePrinting"]()?false:true;if(window["AscDesktopEditor"]&&!isLocalUse)if(undefined!==window["AscDesktopEditor"]["CryptoMode"]&&0<window["AscDesktopEditor"]["CryptoMode"])isLocalUse= true;if(this.BrushType!=MetaBrushType.Texture){this.Memory.WriteByte(CommandType.ctBrushType);this.Memory.WriteLong(3008);this.BrushType=MetaBrushType.Texture}this.m_oBrush.Color1.R=-1;this.m_oBrush.Color1.G=-1;this.m_oBrush.Color1.B=-1;this.m_oBrush.Color1.A=-1;this.Memory.WriteByte(CommandType.ctBrushTexturePath);var _src=src;var srcLocal=AscCommon.g_oDocumentUrls.getLocal(_src);if(srcLocal&&isLocalUse)_src=srcLocal;this.Memory.WriteString(_src);this.Memory.WriteByte(CommandType.ctBrushTextureMode); this.Memory.WriteByte(mode)},put_BrushTextureAlpha:function(alpha){var write=alpha;if(null==alpha||undefined==alpha)write=255;this.Memory.WriteByte(CommandType.ctBrushTextureAlpha);this.Memory.WriteByte(write)},put_BrushGradient:function(gradFill,points,transparent){this.BrushType=MetaBrushType.Gradient;this.Memory.WriteByte(CommandType.ctBrushGradient);this.Memory.WriteByte(AscCommon.g_nodeAttributeStart);if(gradFill.path!=null&&(gradFill.lin==null||gradFill.lin==undefined)){this.Memory.WriteByte(1); this.Memory.WriteByte(gradFill.path);this.Memory.WriteDouble(points.x0);this.Memory.WriteDouble(points.y0);this.Memory.WriteDouble(points.x1);this.Memory.WriteDouble(points.y1);this.Memory.WriteDouble(points.r0);this.Memory.WriteDouble(points.r1)}else{this.Memory.WriteByte(0);if(null==gradFill.lin){this.Memory.WriteLong(90*6E4);this.Memory.WriteBool(false)}else{this.Memory.WriteLong(gradFill.lin.angle);this.Memory.WriteBool(gradFill.lin.scale)}this.Memory.WriteDouble(points.x0);this.Memory.WriteDouble(points.y0); this.Memory.WriteDouble(points.x1);this.Memory.WriteDouble(points.y1)}var _colors=gradFill.colors;this.Memory.WriteByte(2);this.Memory.WriteLong(_colors.length);for(var i=0;i<_colors.length;i++){this.Memory.WriteLong(_colors[i].pos);this.Memory.WriteByte(_colors[i].color.RGBA.R);this.Memory.WriteByte(_colors[i].color.RGBA.G);this.Memory.WriteByte(_colors[i].color.RGBA.B);if(null==transparent)this.Memory.WriteByte(_colors[i].color.RGBA.A);else this.Memory.WriteByte(transparent)}this.Memory.WriteByte(AscCommon.g_nodeAttributeEnd)}, transform:function(sx,shy,shx,sy,tx,ty){if(this.m_oTransform.sx!=sx||this.m_oTransform.shx!=shx||this.m_oTransform.shy!=shy||this.m_oTransform.sy!=sy||this.m_oTransform.tx!=tx||this.m_oTransform.ty!=ty){this.m_oTransform.sx=sx;this.m_oTransform.shx=shx;this.m_oTransform.shy=shy;this.m_oTransform.sy=sy;this.m_oTransform.tx=tx;this.m_oTransform.ty=ty;this.Memory.WriteByte(CommandType.ctSetTransform);this.Memory.WriteDouble(sx);this.Memory.WriteDouble(shy);this.Memory.WriteDouble(shx);this.Memory.WriteDouble(sy); this.Memory.WriteDouble(tx);this.Memory.WriteDouble(ty)}},_s:function(){if(this.VectorMemoryForPrint!=null)this.VectorMemoryForPrint.ClearNoAttack();var _memory=null==this.VectorMemoryForPrint?this.Memory:this.VectorMemoryForPrint;_memory.WriteByte(CommandType.ctPathCommandStart)},_e:function(){this.Memory.WriteByte(CommandType.ctPathCommandEnd)},_z:function(){var _memory=null==this.VectorMemoryForPrint?this.Memory:this.VectorMemoryForPrint;_memory.WriteByte(CommandType.ctPathCommandClose)},_m:function(x, y){var _memory=null==this.VectorMemoryForPrint?this.Memory:this.VectorMemoryForPrint;_memory.WriteByte(CommandType.ctPathCommandMoveTo);_memory.WriteDouble(x);_memory.WriteDouble(y)},_l:function(x,y){var _memory=null==this.VectorMemoryForPrint?this.Memory:this.VectorMemoryForPrint;_memory.WriteByte(CommandType.ctPathCommandLineTo);_memory.WriteDouble(x);_memory.WriteDouble(y)},_c:function(x1,y1,x2,y2,x3,y3){var _memory=null==this.VectorMemoryForPrint?this.Memory:this.VectorMemoryForPrint;_memory.WriteByte(CommandType.ctPathCommandCurveTo); _memory.WriteDouble(x1);_memory.WriteDouble(y1);_memory.WriteDouble(x2);_memory.WriteDouble(y2);_memory.WriteDouble(x3);_memory.WriteDouble(y3)},_c2:function(x1,y1,x2,y2){var _memory=null==this.VectorMemoryForPrint?this.Memory:this.VectorMemoryForPrint;_memory.WriteByte(CommandType.ctPathCommandCurveTo);_memory.WriteDouble(x1);_memory.WriteDouble(y1);_memory.WriteDouble(x1);_memory.WriteDouble(y1);_memory.WriteDouble(x2);_memory.WriteDouble(y2)},ds:function(){if(null==this.VectorMemoryForPrint){this.Memory.WriteByte(CommandType.ctDrawPath); this.Memory.WriteLong(1)}else{this.Memory.Copy(this.VectorMemoryForPrint,0,this.VectorMemoryForPrint.pos);this.Memory.WriteByte(CommandType.ctDrawPath);this.Memory.WriteLong(1)}},df:function(){if(null==this.VectorMemoryForPrint){this.Memory.WriteByte(CommandType.ctDrawPath);this.Memory.WriteLong(256)}else{this.Memory.Copy(this.VectorMemoryForPrint,0,this.VectorMemoryForPrint.pos);this.Memory.WriteByte(CommandType.ctDrawPath);this.Memory.WriteLong(256)}},WriteVectorMemoryForPrint:function(){if(null!= this.VectorMemoryForPrint)this.Memory.Copy(this.VectorMemoryForPrint,0,this.VectorMemoryForPrint.pos)},drawpath:function(type){if(null==this.VectorMemoryForPrint){this.Memory.WriteByte(CommandType.ctDrawPath);this.Memory.WriteLong(type)}else{this.Memory.Copy(this.VectorMemoryForPrint,0,this.VectorMemoryForPrint.pos);this.Memory.WriteByte(CommandType.ctDrawPath);this.Memory.WriteLong(type)}},save:function(){},restore:function(){},clip:function(){},drawImage:function(img,x,y,w,h,isUseOriginUrl){var isLocalUse= true;if(window["AscDesktopEditor"]&&window["AscDesktopEditor"]["IsLocalFile"]&&window["AscDesktopEditor"]["IsFilePrinting"])isLocalUse=!window["AscDesktopEditor"]["IsLocalFile"]()&&window["AscDesktopEditor"]["IsFilePrinting"]()?false:true;if(window["AscDesktopEditor"]&&!isLocalUse)if(undefined!==window["AscDesktopEditor"]["CryptoMode"]&&0<window["AscDesktopEditor"]["CryptoMode"])isLocalUse=true;if(!window.editor){this.Memory.WriteByte(CommandType.ctDrawImageFromFile);var imgLocal=AscCommon.g_oDocumentUrls.getLocal(img); if(imgLocal&&isLocalUse&&true!==isUseOriginUrl)this.Memory.WriteString2(imgLocal);else this.Memory.WriteString2(img);this.Memory.WriteDouble(x);this.Memory.WriteDouble(y);this.Memory.WriteDouble(w);this.Memory.WriteDouble(h);return}var _src="";if(!window["NATIVE_EDITOR_ENJINE"]&&true!==isUseOriginUrl){var _img=window.editor.ImageLoader.map_image_index[img];if(_img==undefined||_img.Image==null)return;_src=_img.src}else _src=img;var srcLocal=AscCommon.g_oDocumentUrls.getLocal(_src);if(srcLocal&&isLocalUse)_src= srcLocal;this.Memory.WriteByte(CommandType.ctDrawImageFromFile);this.Memory.WriteString2(_src);this.Memory.WriteDouble(x);this.Memory.WriteDouble(y);this.Memory.WriteDouble(w);this.Memory.WriteDouble(h)},SetFontName:function(name){var fontinfo=g_fontApplication.GetFontInfo(name,0,this.LastFontOriginInfo);if(this.m_oFont.Name!=fontinfo.Name){this.m_oFont.Name=fontinfo.Name;this.Memory.WriteByte(CommandType.ctFontName);this.Memory.WriteString(this.m_oFont.Name)}},SetFont:function(font,isFromPicker){if(this.FontPicker&& !isFromPicker)return this.FontPicker.SetFont(font);if(null==font)return;var style=0;if(font.Italic==true)style+=2;if(font.Bold==true)style+=1;var fontinfo=g_fontApplication.GetFontInfo(font.FontFamily.Name,style,this.LastFontOriginInfo);if(this.m_oFont.Name!=fontinfo.Name){this.m_oFont.Name=fontinfo.Name;this.Memory.WriteByte(CommandType.ctFontName);this.Memory.WriteString(this.m_oFont.Name)}if(this.m_oFont.FontSize!=font.FontSize){this.m_oFont.FontSize=font.FontSize;this.Memory.WriteByte(CommandType.ctFontSize); this.Memory.WriteDouble(this.m_oFont.FontSize)}if(this.m_oFont.Style!=style){this.m_oFont.Style=style;this.Memory.WriteByte(CommandType.ctFontStyle);this.Memory.WriteLong(style)}},FillText:function(x,y,text){if(1==text.length)return this.FillTextCode(x,y,text.charCodeAt(0));this.Memory.WriteByte(CommandType.ctDrawText);this.Memory.WriteString(text);this.Memory.WriteDouble(x);this.Memory.WriteDouble(y)},FillTextCode:function(x,y,code){var _code=code;if(null!=this.LastFontOriginInfo.Replace)_code=g_fontApplication.GetReplaceGlyph(_code, this.LastFontOriginInfo.Replace);if(this.FontPicker)this.FontPicker.FillTextCode(_code);this.Memory.WriteByte(CommandType.ctDrawText);this.Memory.WriteStringBySymbol(_code);this.Memory.WriteDouble(x);this.Memory.WriteDouble(y)},tg:function(gid,x,y){if(window["native"]!==undefined)return;var _old_pos=this.Memory.pos;g_fontApplication.LoadFont(this.m_oFont.Name,AscCommon.g_font_loader,AscCommon.g_oTextMeasurer.m_oManager,this.m_oFont.FontSize,Math.max(this.m_oFont.Style,0),72,72);AscCommon.g_oTextMeasurer.m_oManager.LoadStringPathCode(gid, true,x,y,this);if(this.Memory.pos-_old_pos<8)this.Memory.pos=_old_pos},charspace:function(space){},beginCommand:function(command){this.Memory.WriteByte(CommandType.ctBeginCommand);this.Memory.WriteLong(command)},endCommand:function(command){if(32==command){if(null==this.VectorMemoryForPrint){this.Memory.WriteByte(CommandType.ctEndCommand);this.Memory.WriteLong(command)}else{this.Memory.Copy(this.VectorMemoryForPrint,0,this.VectorMemoryForPrint.pos);this.Memory.WriteByte(CommandType.ctEndCommand); this.Memory.WriteLong(command)}return}this.Memory.WriteByte(CommandType.ctEndCommand);this.Memory.WriteLong(command)},put_PenLineJoin:function(_join){this.Memory.WriteByte(CommandType.ctPenLineJoin);this.Memory.WriteByte(_join&255)},put_TextureBounds:function(x,y,w,h){this.Memory.WriteByte(CommandType.ctBrushRectable);this.Memory.WriteDouble(x);this.Memory.WriteDouble(y);this.Memory.WriteDouble(w);this.Memory.WriteDouble(h)},put_TextureBoundsEnabled:function(bIsEnabled){this.Memory.WriteByte(CommandType.ctBrushRectableEnabled); this.Memory.WriteBool(bIsEnabled)},SetFontSlot:function(slot,fontSizeKoef){var _rfonts=this.m_oGrFonts;var _lastFont=this.m_oFontSlotFont;switch(slot){case fontslot_ASCII:{_lastFont.Name=_rfonts.Ascii.Name;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}case fontslot_CS:{_lastFont.Name=_rfonts.CS.Name;_lastFont.Size=this.m_oTextPr.FontSizeCS;_lastFont.Bold=this.m_oTextPr.BoldCS;_lastFont.Italic=this.m_oTextPr.ItalicCS;break}case fontslot_EastAsia:{_lastFont.Name= _rfonts.EastAsia.Name;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}case fontslot_HAnsi:default:{_lastFont.Name=_rfonts.HAnsi.Name;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}}if(undefined!==fontSizeKoef)_lastFont.Size*=fontSizeKoef;this.m_oFontTmp.FontFamily.Name=_lastFont.Name;this.m_oFontTmp.Bold=_lastFont.Bold;this.m_oFontTmp.Italic=_lastFont.Italic; this.m_oFontTmp.FontSize=_lastFont.Size;this.SetFont(this.m_oFontTmp)},AddHyperlink:function(x,y,w,h,url,tooltip){this.Memory.WriteByte(CommandType.ctHyperlink);this.Memory.WriteDouble(x);this.Memory.WriteDouble(y);this.Memory.WriteDouble(w);this.Memory.WriteDouble(h);this.Memory.WriteString(url);this.Memory.WriteString(tooltip)},AddLink:function(x,y,w,h,dx,dy,dPage){this.Memory.WriteByte(CommandType.ctLink);this.Memory.WriteDouble(x);this.Memory.WriteDouble(y);this.Memory.WriteDouble(w);this.Memory.WriteDouble(h); this.Memory.WriteDouble(dx);this.Memory.WriteDouble(dy);this.Memory.WriteLong(dPage)}};function CDocumentRenderer(){this.m_arrayPages=[];this.m_lPagesCount=0;this.Memory=new CMemory;this.VectorMemoryForPrint=null;this.ClipManager=new CClipManager;this.ClipManager.BaseObject=this;this.RENDERER_PDF_FLAG=true;this.ArrayPoints=null;this.GrState=new CGrState;this.GrState.Parent=this;this.m_oPen=null;this.m_oBrush=null;this.m_oTransform=null;this._restoreDumpedVectors=null;this.m_oBaseTransform=null;this.UseOriginImageUrl= false;this.FontPicker=null}CDocumentRenderer.prototype={InitPicker:function(_manager){this.FontPicker=new CMetafileFontPicker(_manager)},SetBaseTransform:function(_matrix){this.m_oBaseTransform=_matrix},BeginPage:function(width,height){this.m_arrayPages[this.m_arrayPages.length]=new CMetafile(width,height);this.m_lPagesCount=this.m_arrayPages.length;this.m_arrayPages[this.m_lPagesCount-1].Memory=this.Memory;this.m_arrayPages[this.m_lPagesCount-1].StartOffset=this.Memory.pos;this.m_arrayPages[this.m_lPagesCount- 1].VectorMemoryForPrint=this.VectorMemoryForPrint;this.m_arrayPages[this.m_lPagesCount-1].FontPicker=this.FontPicker;if(this.FontPicker)this.m_arrayPages[this.m_lPagesCount-1].FontPicker.Metafile=this.m_arrayPages[this.m_lPagesCount-1];this.Memory.WriteByte(CommandType.ctPageStart);this.Memory.WriteByte(CommandType.ctPageWidth);this.Memory.WriteDouble(width);this.Memory.WriteByte(CommandType.ctPageHeight);this.Memory.WriteDouble(height);var _page=this.m_arrayPages[this.m_lPagesCount-1];this.m_oPen= _page.m_oPen;this.m_oBrush=_page.m_oBrush;this.m_oTransform=_page.m_oTransform},EndPage:function(){this.Memory.WriteByte(CommandType.ctPageEnd)},p_color:function(r,g,b,a){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].p_color(r,g,b,a)},p_width:function(w){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].p_width(w)},p_dash:function(params){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].p_dash(params)},b_color1:function(r,g,b,a){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount- 1].b_color1(r,g,b,a)},b_color2:function(r,g,b,a){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].b_color2(r,g,b,a)},transform:function(sx,shy,shx,sy,tx,ty){if(0!=this.m_lPagesCount)if(null==this.m_oBaseTransform)this.m_arrayPages[this.m_lPagesCount-1].transform(sx,shy,shx,sy,tx,ty);else{var _transform=new CMatrix;_transform.sx=sx;_transform.shy=shy;_transform.shx=shx;_transform.sy=sy;_transform.tx=tx;_transform.ty=ty;AscCommon.global_MatrixTransformer.MultiplyAppend(_transform,this.m_oBaseTransform); this.m_arrayPages[this.m_lPagesCount-1].transform(_transform.sx,_transform.shy,_transform.shx,_transform.sy,_transform.tx,_transform.ty)}},transform3:function(m){this.transform(m.sx,m.shy,m.shx,m.sy,m.tx,m.ty)},reset:function(){this.transform(1,0,0,1,0,0)},_s:function(){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1]._s()},_e:function(){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1]._e()},_z:function(){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount- 1]._z()},_m:function(x,y){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1]._m(x,y);if(this.ArrayPoints!=null)this.ArrayPoints[this.ArrayPoints.length]={x:x,y:y}},_l:function(x,y){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1]._l(x,y);if(this.ArrayPoints!=null)this.ArrayPoints[this.ArrayPoints.length]={x:x,y:y}},_c:function(x1,y1,x2,y2,x3,y3){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1]._c(x1,y1,x2,y2,x3,y3);if(this.ArrayPoints!=null){this.ArrayPoints[this.ArrayPoints.length]= {x:x1,y:y1};this.ArrayPoints[this.ArrayPoints.length]={x:x2,y:y2};this.ArrayPoints[this.ArrayPoints.length]={x:x3,y:y3}}},_c2:function(x1,y1,x2,y2){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1]._c2(x1,y1,x2,y2);if(this.ArrayPoints!=null){this.ArrayPoints[this.ArrayPoints.length]={x:x1,y:y1};this.ArrayPoints[this.ArrayPoints.length]={x:x2,y:y2}}},ds:function(){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].ds()},df:function(){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount- 1].df()},drawpath:function(type){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].drawpath(type)},save:function(){},restore:function(){},clip:function(){},drawImage:function(img,x,y,w,h,alpha,srcRect){if(img==null||img==undefined||img=="")return;if(0!=this.m_lPagesCount)if(!srcRect)this.m_arrayPages[this.m_lPagesCount-1].drawImage(img,x,y,w,h,this.UseOriginImageUrl);else{var bIsClip=false;if(srcRect.l>0||srcRect.t>0||srcRect.r<100||srcRect.b<100)bIsClip=true;if(bIsClip){this.SaveGrState(); this.AddClipRect(x,y,w,h)}var __w=w;var __h=h;var _delW=Math.max(0,-srcRect.l)+Math.max(0,srcRect.r-100)+100;var _delH=Math.max(0,-srcRect.t)+Math.max(0,srcRect.b-100)+100;if(srcRect.l<0){var _off=-srcRect.l/_delW*__w;x+=_off;w-=_off}if(srcRect.t<0){var _off=-srcRect.t/_delH*__h;y+=_off;h-=_off}if(srcRect.r>100){var _off=(srcRect.r-100)/_delW*__w;w-=_off}if(srcRect.b>100){var _off=(srcRect.b-100)/_delH*__h;h-=_off}var _wk=100;if(srcRect.l>0)_wk-=srcRect.l;if(srcRect.r<100)_wk-=100-srcRect.r;_wk=100/ _wk;var _hk=100;if(srcRect.t>0)_hk-=srcRect.t;if(srcRect.b<100)_hk-=100-srcRect.b;_hk=100/_hk;var _r=x+w;var _b=y+h;if(srcRect.l>0)x-=srcRect.l*_wk*w/100;if(srcRect.t>0)y-=srcRect.t*_hk*h/100;if(srcRect.r<100)_r+=(100-srcRect.r)*_wk*w/100;if(srcRect.b<100)_b+=(100-srcRect.b)*_hk*h/100;this.m_arrayPages[this.m_lPagesCount-1].drawImage(img,x,y,_r-x,_b-y);if(bIsClip)this.RestoreGrState()}},SetFont:function(font){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].SetFont(font)},FillText:function(x, y,text,cropX,cropW){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].FillText(x,y,text)},FillTextCode:function(x,y,text,cropX,cropW){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].FillTextCode(x,y,text)},tg:function(gid,x,y){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].tg(gid,x,y)},FillText2:function(x,y,text){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].FillText(x,y,text)},charspace:function(space){},SetIntegerGrid:function(param){}, GetIntegerGrid:function(){},GetFont:function(){if(0!=this.m_lPagesCount)return this.m_arrayPages[this.m_lPagesCount-1].m_oFont;return null},put_GlobalAlpha:function(enable,alpha){},Start_GlobalAlpha:function(){},End_GlobalAlpha:function(){},DrawHeaderEdit:function(yPos){},DrawFooterEdit:function(yPos){},drawCollaborativeChanges:function(x,y,w,h){},drawSearchResult:function(x,y,w,h){},DrawEmptyTableLine:function(x1,y1,x2,y2){},DrawLockParagraph:function(lock_type,x,y1,y2){},DrawLockObjectRect:function(lock_type, x,y,w,h){},DrawSpellingLine:function(y0,x0,x1,w){},drawHorLine:function(align,y,x,r,penW){this.p_width(1E3*penW);this._s();var _y=y;switch(align){case 0:{_y=y+penW/2;break}case 1:{break}case 2:{_y=y-penW/2}}this._m(x,y);this._l(r,y);this.ds();this._e()},drawHorLine2:function(align,y,x,r,penW){this.p_width(1E3*penW);var _y=y;switch(align){case 0:{_y=y+penW/2;break}case 1:{break}case 2:{_y=y-penW/2;break}}this._s();this._m(x,_y-penW);this._l(r,_y-penW);this.ds();this._s();this._m(x,_y+penW);this._l(r, _y+penW);this.ds();this._e()},drawVerLine:function(align,x,y,b,penW){this.p_width(1E3*penW);this._s();var _x=x;switch(align){case 0:{_x=x+penW/2;break}case 1:{break}case 2:{_x=x-penW/2}}this._m(_x,y);this._l(_x,b);this.ds()},drawHorLineExt:function(align,y,x,r,penW,leftMW,rightMW){this.drawHorLine(align,y,x+leftMW,r+rightMW,penW)},rect:function(x,y,w,h){var _x=x;var _y=y;var _r=x+w;var _b=y+h;this._s();this._m(_x,_y);this._l(_r,_y);this._l(_r,_b);this._l(_x,_b);this._l(_x,_y)},TableRect:function(x, y,w,h){this.rect(x,y,w,h);this.df()},put_PenLineJoin:function(_join){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].put_PenLineJoin(_join)},put_TextureBounds:function(x,y,w,h){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].put_TextureBounds(x,y,w,h)},put_TextureBoundsEnabled:function(val){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].put_TextureBoundsEnabled(val)},put_brushTexture:function(src,mode){if(src==null||src==undefined)src="";if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount- 1].put_brushTexture(src,mode)},put_BrushTextureAlpha:function(alpha){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].put_BrushTextureAlpha(alpha)},put_BrushGradient:function(gradFill,points,transparent){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].put_BrushGradient(gradFill,points,transparent)},AddClipRect:function(x,y,w,h){var __rect=new _rect;__rect.x=x;__rect.y=y;__rect.w=w;__rect.h=h;this.GrState.AddClipRect(__rect)},RemoveClipRect:function(){},SetClip:function(r){if(0!= this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].beginCommand(32);this.rect(r.x,r.y,r.w,r.h);if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].endCommand(32)},RemoveClip:function(){if(0!=this.m_lPagesCount){this.m_arrayPages[this.m_lPagesCount-1].beginCommand(64);this.m_arrayPages[this.m_lPagesCount-1].endCommand(64)}},GetTransform:function(){if(0!=this.m_lPagesCount)return this.m_arrayPages[this.m_lPagesCount-1].m_oTransform;return null},GetLineWidth:function(){if(0!=this.m_lPagesCount)return this.m_arrayPages[this.m_lPagesCount- 1].m_oPen.Size;return 0},GetPen:function(){if(0!=this.m_lPagesCount)return this.m_arrayPages[this.m_lPagesCount-1].m_oPen;return 0},GetBrush:function(){if(0!=this.m_lPagesCount)return this.m_arrayPages[this.m_lPagesCount-1].m_oBrush;return 0},drawFlowAnchor:function(x,y){},SavePen:function(){this.GrState.SavePen()},RestorePen:function(){this.GrState.RestorePen()},SaveBrush:function(){this.GrState.SaveBrush()},RestoreBrush:function(){this.GrState.RestoreBrush()},SavePenBrush:function(){this.GrState.SavePenBrush()}, RestorePenBrush:function(){this.GrState.RestorePenBrush()},SaveGrState:function(){this.GrState.SaveGrState()},RestoreGrState:function(){var _t=this.m_oBaseTransform;this.m_oBaseTransform=null;this.GrState.RestoreGrState();this.m_oBaseTransform=_t},StartClipPath:function(){this.private_removeVectors();if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].beginCommand(32)},EndClipPath:function(){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].endCommand(32);this.private_restoreVectors()}, SetTextPr:function(textPr,theme){if(0!=this.m_lPagesCount){var _page=this.m_arrayPages[this.m_lPagesCount-1];_page.m_oTextPr=textPr;if(theme)_page.m_oGrFonts.checkFromTheme(theme.themeElements.fontScheme,_page.m_oTextPr.RFonts);else _page.m_oGrFonts=_page.m_oTextPr.RFonts}},SetFontSlot:function(slot,fontSizeKoef){if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].SetFontSlot(slot,fontSizeKoef)},GetTextPr:function(){if(0!=this.m_lPagesCount)return this.m_arrayPages[this.m_lPagesCount- 1].m_oTextPr;return null},DrawPresentationComment:function(type,x,y,w,h){},private_removeVectors:function(){this._restoreDumpedVectors=this.VectorMemoryForPrint;if(this._restoreDumpedVectors!=null){this.VectorMemoryForPrint=null;if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].VectorMemoryForPrint=null}},private_restoreVectors:function(){if(null!=this._restoreDumpedVectors){this.VectorMemoryForPrint=this._restoreDumpedVectors;if(0!=this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount- 1].VectorMemoryForPrint=this._restoreDumpedVectors}this._restoreDumpedVectors=null},AddHyperlink:function(x,y,w,h,url,tooltip){if(0!==this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].AddHyperlink(x,y,w,h,url,tooltip)},AddLink:function(x,y,w,h,dx,dy,dPage){if(0!==this.m_lPagesCount)this.m_arrayPages[this.m_lPagesCount-1].AddLink(x,y,w,h,dx,dy,dPage)}};var MATRIX_ORDER_PREPEND=0;var MATRIX_ORDER_APPEND=1;function deg2rad(deg){return deg*Math.PI/180}function rad2deg(rad){return rad*180/Math.PI} function CMatrix(){this.sx=1;this.shx=0;this.shy=0;this.sy=1;this.tx=0;this.ty=0}CMatrix.prototype={Reset:function(){this.sx=1;this.shx=0;this.shy=0;this.sy=1;this.tx=0;this.ty=0},Multiply:function(matrix,order){if(MATRIX_ORDER_PREPEND==order){var m=new CMatrix;m.sx=matrix.sx;m.shx=matrix.shx;m.shy=matrix.shy;m.sy=matrix.sy;m.tx=matrix.tx;m.ty=matrix.ty;m.Multiply(this,MATRIX_ORDER_APPEND);this.sx=m.sx;this.shx=m.shx;this.shy=m.shy;this.sy=m.sy;this.tx=m.tx;this.ty=m.ty}else{var t0=this.sx*matrix.sx+ this.shy*matrix.shx;var t2=this.shx*matrix.sx+this.sy*matrix.shx;var t4=this.tx*matrix.sx+this.ty*matrix.shx+matrix.tx;this.shy=this.sx*matrix.shy+this.shy*matrix.sy;this.sy=this.shx*matrix.shy+this.sy*matrix.sy;this.ty=this.tx*matrix.shy+this.ty*matrix.sy+matrix.ty;this.sx=t0;this.shx=t2;this.tx=t4}return this},Translate:function(x,y,order){var m=new CMatrix;m.tx=x;m.ty=y;this.Multiply(m,order)},Scale:function(x,y,order){var m=new CMatrix;m.sx=x;m.sy=y;this.Multiply(m,order)},Rotate:function(a,order){var m= new CMatrix;var rad=deg2rad(a);m.sx=Math.cos(rad);m.shx=Math.sin(rad);m.shy=-Math.sin(rad);m.sy=Math.cos(rad);this.Multiply(m,order)},RotateAt:function(a,x,y,order){this.Translate(-x,-y,order);this.Rotate(a,order);this.Translate(x,y,order)},Determinant:function(){return this.sx*this.sy-this.shy*this.shx},Invert:function(){var det=this.Determinant();if(1E-4>Math.abs(det))return;var d=1/det;var t0=this.sy*d;this.sy=this.sx*d;this.shy=-this.shy*d;this.shx=-this.shx*d;var t4=-this.tx*t0-this.ty*this.shx; this.ty=-this.tx*this.shy-this.ty*this.sy;this.sx=t0;this.tx=t4;return this},TransformPointX:function(x,y){return x*this.sx+y*this.shx+this.tx},TransformPointY:function(x,y){return x*this.shy+y*this.sy+this.ty},GetRotation:function(){var x1=0;var y1=0;var x2=1;var y2=0;var _x1=this.TransformPointX(x1,y1);var _y1=this.TransformPointY(x1,y1);var _x2=this.TransformPointX(x2,y2);var _y2=this.TransformPointY(x2,y2);var _y=_y2-_y1;var _x=_x2-_x1;if(Math.abs(_y)<.001)if(_x>0)return 0;else return 180;if(Math.abs(_x)< .001)if(_y>0)return 90;else return 270;var a=Math.atan2(_y,_x);a=rad2deg(a);if(a<0)a+=360;return a},CreateDublicate:function(){var m=new CMatrix;m.sx=this.sx;m.shx=this.shx;m.shy=this.shy;m.sy=this.sy;m.tx=this.tx;m.ty=this.ty;return m},IsIdentity:function(){if(this.sx==1&&this.shx==0&&this.shy==0&&this.sy==1&&this.tx==0&&this.ty==0)return true;return false},IsIdentity2:function(){if(this.sx==1&&this.shx==0&&this.shy==0&&this.sy==1)return true;return false},GetScaleValue:function(){var x1=this.TransformPointX(0, 0);var y1=this.TransformPointY(0,0);var x2=this.TransformPointX(1,1);var y2=this.TransformPointY(1,1);return Math.sqrt(((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))/2)}};function GradientGetAngleNoRotate(_angle,_transform){var x1=0;var y1=0;var x2=1;var y2=0;var _matrixRotate=new CMatrix;_matrixRotate.Rotate(-_angle/6E4);var _x11=_matrixRotate.TransformPointX(x1,y1);var _y11=_matrixRotate.TransformPointY(x1,y1);var _x22=_matrixRotate.TransformPointX(x2,y2);var _y22=_matrixRotate.TransformPointY(x2,y2);_matrixRotate= global_MatrixTransformer.Invert(_transform);var _x1=_matrixRotate.TransformPointX(_x11,_y11);var _y1=_matrixRotate.TransformPointY(_x11,_y11);var _x2=_matrixRotate.TransformPointX(_x22,_y22);var _y2=_matrixRotate.TransformPointY(_x22,_y22);var _y=_y2-_y1;var _x=_x2-_x1;var a=0;if(Math.abs(_y)<.001)if(_x>0)a=0;else a=180;else if(Math.abs(_x)<.001)if(_y>0)a=90;else a=270;else{a=Math.atan2(_y,_x);a=rad2deg(a)}if(a<0)a+=360;return a*6E4}var CMatrixL=CMatrix;function CGlobalMatrixTransformer(){this.TranslateAppend= function(m,_tx,_ty){m.tx+=_tx;m.ty+=_ty};this.ScaleAppend=function(m,_sx,_sy){m.sx*=_sx;m.shx*=_sx;m.shy*=_sy;m.sy*=_sy;m.tx*=_sx;m.ty*=_sy};this.RotateRadAppend=function(m,_rad){var _sx=Math.cos(_rad);var _shx=Math.sin(_rad);var _shy=-Math.sin(_rad);var _sy=Math.cos(_rad);var t0=m.sx*_sx+m.shy*_shx;var t2=m.shx*_sx+m.sy*_shx;var t4=m.tx*_sx+m.ty*_shx;m.shy=m.sx*_shy+m.shy*_sy;m.sy=m.shx*_shy+m.sy*_sy;m.ty=m.tx*_shy+m.ty*_sy;m.sx=t0;m.shx=t2;m.tx=t4};this.MultiplyAppend=function(m1,m2){var t0=m1.sx* m2.sx+m1.shy*m2.shx;var t2=m1.shx*m2.sx+m1.sy*m2.shx;var t4=m1.tx*m2.sx+m1.ty*m2.shx+m2.tx;m1.shy=m1.sx*m2.shy+m1.shy*m2.sy;m1.sy=m1.shx*m2.shy+m1.sy*m2.sy;m1.ty=m1.tx*m2.shy+m1.ty*m2.sy+m2.ty;m1.sx=t0;m1.shx=t2;m1.tx=t4};this.Invert=function(m){var newM=m.CreateDublicate();var det=newM.sx*newM.sy-newM.shy*newM.shx;if(1E-4>Math.abs(det))return newM;var d=1/det;var t0=newM.sy*d;newM.sy=newM.sx*d;newM.shy=-newM.shy*d;newM.shx=-newM.shx*d;var t4=-newM.tx*t0-newM.ty*newM.shx;newM.ty=-newM.tx*newM.shy- newM.ty*newM.sy;newM.sx=t0;newM.tx=t4;return newM};this.MultiplyAppendInvert=function(m1,m2){var m=this.Invert(m2);this.MultiplyAppend(m1,m)};this.MultiplyPrepend=function(m1,m2){var m=new CMatrixL;m.sx=m2.sx;m.shx=m2.shx;m.shy=m2.shy;m.sy=m2.sy;m.tx=m2.tx;m.ty=m2.ty;this.MultiplyAppend(m,m1);m1.sx=m.sx;m1.shx=m.shx;m1.shy=m.shy;m1.sy=m.sy;m1.tx=m.tx;m1.ty=m.ty};this.CreateDublicateM=function(matrix){var m=new CMatrixL;m.sx=matrix.sx;m.shx=matrix.shx;m.shy=matrix.shy;m.sy=matrix.sy;m.tx=matrix.tx; m.ty=matrix.ty;return m};this.IsIdentity=function(m){if(m.sx==1&&m.shx==0&&m.shy==0&&m.sy==1&&m.tx==0&&m.ty==0)return true;return false};this.IsIdentity2=function(m){if(m.sx==1&&m.shx==0&&m.shy==0&&m.sy==1)return true;return false}}function CClipManager(){this.clipRects=[];this.curRect=new _rect;this.BaseObject=null;this.AddRect=function(x,y,w,h){var _count=this.clipRects.length;if(0==_count){this.curRect.x=x;this.curRect.y=y;this.curRect.w=w;this.curRect.h=h;var _r=new _rect;_r.x=x;_r.y=y;_r.w=w; _r.h=h;this.clipRects[_count]=_r;this.BaseObject.SetClip(this.curRect)}else{this.BaseObject.RemoveClip();var _r=new _rect;_r.x=x;_r.y=y;_r.w=w;_r.h=h;this.clipRects[_count]=_r;this.curRect=this.IntersectRect(this.curRect,_r);this.BaseObject.SetClip(this.curRect)}};this.RemoveRect=function(){var _count=this.clipRects.length;if(0!=_count){this.clipRects.splice(_count-1,1);--_count;this.BaseObject.RemoveClip();if(0!=_count){this.curRect.x=this.clipRects[0].x;this.curRect.y=this.clipRects[0].y;this.curRect.w= this.clipRects[0].w;this.curRect.h=this.clipRects[0].h;for(var i=1;i<_count;i++)this.curRect=this.IntersectRect(this.curRect,this.clipRects[i]);this.BaseObject.SetClip(this.curRect)}}};this.IntersectRect=function(r1,r2){var res=new _rect;res.x=Math.max(r1.x,r2.x);res.y=Math.max(r1.y,r2.y);res.w=Math.min(r1.x+r1.w,r2.x+r2.w)-res.x;res.h=Math.min(r1.y+r1.h,r2.y+r2.h)-res.y;if(0>res.w)res.w=0;if(0>res.h)res.h=0;return res}}function CPen(){this.Color={R:255,G:255,B:255,A:255};this.Style=0;this.LineCap= 0;this.LineJoin=0;this.LineWidth=1}function CBrush(){this.Color1={R:255,G:255,B:255,A:255};this.Color2={R:255,G:255,B:255,A:255};this.Type=0}function CTableMarkup(Table){this.Internal={RowIndex:0,CellIndex:0,PageNum:0};this.Table=Table;this.X=0;this.Cols=[];this.Margins=[];this.Rows=[];this.CurCol=0;this.CurRow=0;this.TransformX=0;this.TransformY=0}CTableMarkup.prototype={CreateDublicate:function(){var obj=new CTableMarkup(this.Table);obj.Internal={RowIndex:this.Internal.RowIndex,CellIndex:this.Internal.CellIndex, PageNum:this.Internal.PageNum};obj.X=this.X;var len=this.Cols.length;for(var i=0;i<len;i++)obj.Cols[i]=this.Cols[i];len=this.Margins.length;for(var i=0;i<len;i++)obj.Margins[i]={Left:this.Margins[i].Left,Right:this.Margins[i].Right};len=this.Rows.length;for(var i=0;i<len;i++)obj.Rows[i]={Y:this.Rows[i].Y,H:this.Rows[i].H};obj.CurRow=this.CurRow;obj.CurCol=this.CurCol;return obj},CorrectFrom:function(){this.X+=this.TransformX;var _len=this.Rows.length;for(var i=0;i<_len;i++)this.Rows[i].Y+=this.TransformY}, CorrectTo:function(){this.X-=this.TransformX;var _len=this.Rows.length;for(var i=0;i<_len;i++)this.Rows[i].Y-=this.TransformY},Get_X:function(){return this.X},Get_Y:function(){var _Y=0;if(this.Rows.length>0)_Y=this.Rows[0].Y;return _Y}};function CTableOutline(Table,PageNum,X,Y,W,H){this.Table=Table;this.PageNum=PageNum;this.X=X;this.Y=Y;this.W=W;this.H=H}var g_fontManager=new AscFonts.CFontManager;g_fontManager.Initialize(true);g_fontManager.SetHintsProps(true,true);var g_dDpiX=96;var g_dDpiY=96; var g_dKoef_mm_to_pix=g_dDpiX/25.4;var g_dKoef_pix_to_mm=25.4/g_dDpiX;function _rect(){this.x=0;this.y=0;this.w=0;this.h=0}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CGrRFonts=CGrRFonts;window["AscCommon"].CFontSetup=CFontSetup;window["AscCommon"].CGrState=CGrState;window["AscCommon"].Base64Encode=Base64Encode;window["AscCommon"].CMemory=CMemory;window["AscCommon"].CDocumentRenderer=CDocumentRenderer;window["AscCommon"].MATRIX_ORDER_PREPEND=MATRIX_ORDER_PREPEND;window["AscCommon"].MATRIX_ORDER_APPEND= MATRIX_ORDER_APPEND;window["AscCommon"].deg2rad=deg2rad;window["AscCommon"].rad2deg=rad2deg;window["AscCommon"].CMatrix=CMatrix;window["AscCommon"].CMatrixL=CMatrixL;window["AscCommon"].CGlobalMatrixTransformer=CGlobalMatrixTransformer;window["AscCommon"].CClipManager=CClipManager;window["AscCommon"].CPen=CPen;window["AscCommon"].CBrush=CBrush;window["AscCommon"].CTableMarkup=CTableMarkup;window["AscCommon"].CTableOutline=CTableOutline;window["AscCommon"]._rect=_rect;window["AscCommon"].global_MatrixTransformer= new CGlobalMatrixTransformer;window["AscCommon"].g_fontManager=g_fontManager;window["AscCommon"].g_dDpiX=g_dDpiX;window["AscCommon"].g_dKoef_mm_to_pix=g_dKoef_mm_to_pix;window["AscCommon"].g_dKoef_pix_to_mm=g_dKoef_pix_to_mm;window["AscCommon"].GradientGetAngleNoRotate=GradientGetAngleNoRotate;window["AscCommon"].DashPatternPresets=DashPatternPresets;window["AscCommon"].CommandType=CommandType})(window);"use strict";(function(window,undefined){function CTextMeasurer(){this.m_oManager=new AscFonts.CFontManager; this.m_oFont=null;this.m_oTextPr=null;this.m_oGrFonts=new AscCommon.CGrRFonts;this.m_oLastFont=new AscCommon.CFontSetup;this.LastFontOriginInfo={Name:"",Replace:null}}CTextMeasurer.prototype={Init:function(){this.m_oManager.Initialize()},SetStringGid:function(bGID){this.m_oManager.SetStringGID(bGID)},SetFont:function(font){if(!font)return;this.m_oFont=font;var bItalic=true===font.Italic;var bBold=true===font.Bold;var oFontStyle=FontStyle.FontStyleRegular;if(!bItalic&&bBold)oFontStyle=FontStyle.FontStyleBold; else if(bItalic&&!bBold)oFontStyle=FontStyle.FontStyleItalic;else if(bItalic&&bBold)oFontStyle=FontStyle.FontStyleBoldItalic;var _lastSetUp=this.m_oLastFont;if(_lastSetUp.SetUpName!=font.FontFamily.Name||_lastSetUp.SetUpSize!=font.FontSize||_lastSetUp.SetUpStyle!=oFontStyle){_lastSetUp.SetUpName=font.FontFamily.Name;_lastSetUp.SetUpSize=font.FontSize;_lastSetUp.SetUpStyle=oFontStyle;g_fontApplication.LoadFont(_lastSetUp.SetUpName,AscCommon.g_font_loader,this.m_oManager,_lastSetUp.SetUpSize,_lastSetUp.SetUpStyle, 72,72,undefined,this.LastFontOriginInfo)}},SetFontInternal:function(_name,_size,_style){var _lastSetUp=this.m_oLastFont;if(_lastSetUp.SetUpName!=_name||_lastSetUp.SetUpSize!=_size||_lastSetUp.SetUpStyle!=_style){_lastSetUp.SetUpName=_name;_lastSetUp.SetUpSize=_size;_lastSetUp.SetUpStyle=_style;g_fontApplication.LoadFont(_lastSetUp.SetUpName,AscCommon.g_font_loader,this.m_oManager,_lastSetUp.SetUpSize,_lastSetUp.SetUpStyle,72,72,undefined,this.LastFontOriginInfo)}},SetTextPr:function(textPr,theme){this.m_oTextPr= textPr;if(theme)this.m_oGrFonts.checkFromTheme(theme.themeElements.fontScheme,this.m_oTextPr.RFonts);else this.m_oGrFonts.fromRFonts(this.m_oTextPr.RFonts)},SetFontSlot:function(slot,fontSizeKoef){var _rfonts=this.m_oGrFonts;var _lastFont=this.m_oLastFont;switch(slot){case fontslot_ASCII:{_lastFont.Name=_rfonts.Ascii.Name;_lastFont.Index=_rfonts.Ascii.Index;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}case fontslot_CS:{_lastFont.Name= _rfonts.CS.Name;_lastFont.Index=_rfonts.CS.Index;_lastFont.Size=this.m_oTextPr.FontSizeCS;_lastFont.Bold=this.m_oTextPr.BoldCS;_lastFont.Italic=this.m_oTextPr.ItalicCS;break}case fontslot_EastAsia:{_lastFont.Name=_rfonts.EastAsia.Name;_lastFont.Index=_rfonts.EastAsia.Index;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}case fontslot_HAnsi:default:{_lastFont.Name=_rfonts.HAnsi.Name;_lastFont.Index=_rfonts.HAnsi.Index;_lastFont.Size= this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}}if(undefined!==fontSizeKoef)_lastFont.Size*=fontSizeKoef;var _style=0;if(_lastFont.Italic)_style+=2;if(_lastFont.Bold)_style+=1;if(_lastFont.Name!=_lastFont.SetUpName||_lastFont.Size!=_lastFont.SetUpSize||_style!=_lastFont.SetUpStyle){_lastFont.SetUpName=_lastFont.Name;_lastFont.SetUpSize=_lastFont.Size;_lastFont.SetUpStyle=_style;g_fontApplication.LoadFont(_lastFont.SetUpName,AscCommon.g_font_loader, this.m_oManager,_lastFont.SetUpSize,_lastFont.SetUpStyle,72,72,undefined,this.LastFontOriginInfo)}},GetTextPr:function(){return this.m_oTextPr},GetFont:function(){return this.m_oFont},Measure:function(text){var Width=0;var Height=0;var _code=text.charCodeAt(0);if(null!=this.LastFontOriginInfo.Replace)_code=g_fontApplication.GetReplaceGlyph(_code,this.LastFontOriginInfo.Replace);var Temp=this.m_oManager.MeasureChar(_code);Width=Temp.fAdvanceX*25.4/72;Height=0;return{Width:Width,Height:Height}},Measure2:function(text){var Width= 0;var _code=text.charCodeAt(0);if(null!=this.LastFontOriginInfo.Replace)_code=g_fontApplication.GetReplaceGlyph(_code,this.LastFontOriginInfo.Replace);var Temp=this.m_oManager.MeasureChar(_code,true);Width=Temp.fAdvanceX*25.4/72;if(Temp.oBBox.rasterDistances==null)return{Width:Width,Ascent:Temp.oBBox.fMaxY*25.4/72,Height:(Temp.oBBox.fMaxY-Temp.oBBox.fMinY)*25.4/72,WidthG:(Temp.oBBox.fMaxX-Temp.oBBox.fMinX)*25.4/72,rasterOffsetX:0,rasterOffsetY:0};return{Width:Width,Ascent:Temp.oBBox.fMaxY*25.4/72, Height:(Temp.oBBox.fMaxY-Temp.oBBox.fMinY)*25.4/72,WidthG:(Temp.oBBox.fMaxX-Temp.oBBox.fMinX)*25.4/72,rasterOffsetX:Temp.oBBox.rasterDistances.dist_l*25.4/72,rasterOffsetY:Temp.oBBox.rasterDistances.dist_t*25.4/72}},MeasureCode:function(lUnicode){var Width=0;var Height=0;if(null!=this.LastFontOriginInfo.Replace)lUnicode=g_fontApplication.GetReplaceGlyph(lUnicode,this.LastFontOriginInfo.Replace);var Temp=this.m_oManager.MeasureChar(lUnicode);Width=Temp.fAdvanceX*25.4/72;Height=(Temp.oBBox.fMaxY-Temp.oBBox.fMinY)* 25.4/72;return{Width:Width,Height:Height,Ascent:Temp.oBBox.fMaxY*25.4/72}},Measure2Code:function(lUnicode){var Width=0;if(null!=this.LastFontOriginInfo.Replace)lUnicode=g_fontApplication.GetReplaceGlyph(lUnicode,this.LastFontOriginInfo.Replace);var Temp=this.m_oManager.MeasureChar(lUnicode,true);Width=Temp.fAdvanceX*25.4/72;if(Temp.oBBox.rasterDistances==null)return{Width:Width,Ascent:Temp.oBBox.fMaxY*25.4/72,Height:(Temp.oBBox.fMaxY-Temp.oBBox.fMinY)*25.4/72,WidthG:(Temp.oBBox.fMaxX-Temp.oBBox.fMinX)* 25.4/72,rasterOffsetX:0,rasterOffsetY:0};return{Width:Width,Ascent:Temp.oBBox.fMaxY*25.4/72,Height:(Temp.oBBox.fMaxY-Temp.oBBox.fMinY)*25.4/72,WidthG:(Temp.oBBox.fMaxX-Temp.oBBox.fMinX)*25.4/72,rasterOffsetX:(Temp.oBBox.rasterDistances.dist_l+Temp.oBBox.fMinX)*25.4/72,rasterOffsetY:Temp.oBBox.rasterDistances.dist_t*25.4/72}},GetAscender:function(){var UnitsPerEm=this.m_oManager.m_lUnits_Per_Em;var Ascender=this.m_oManager.m_lAscender;return Ascender*this.m_oLastFont.SetUpSize/UnitsPerEm*g_dKoef_pt_to_mm}, GetDescender:function(){var UnitsPerEm=this.m_oManager.m_lUnits_Per_Em;var Descender=this.m_oManager.m_lDescender;return Descender*this.m_oLastFont.SetUpSize/UnitsPerEm*g_dKoef_pt_to_mm},GetHeight:function(){var UnitsPerEm=this.m_oManager.m_lUnits_Per_Em;var Height=this.m_oManager.m_lLineHeight;return Height*this.m_oLastFont.SetUpSize/UnitsPerEm*g_dKoef_pt_to_mm}};var g_oTextMeasurer=new CTextMeasurer;g_oTextMeasurer.Init();window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CTextMeasurer= CTextMeasurer;window["AscCommon"].g_oTextMeasurer=g_oTextMeasurer})(window);"use strict";(function(window,undefined){AscCommon.isTouch=false;AscCommon.isTouchMove=false;AscCommon.TouchStartTime=-1;var AscBrowser=AscCommon.AscBrowser;var g_mouse_event_type_down=0;var g_mouse_event_type_move=1;var g_mouse_event_type_up=2;var g_mouse_event_type_wheel=3;var g_mouse_button_left=0;var g_mouse_button_center=1;var g_mouse_button_right=2;var MouseUpLock={MouseUpLockedSend:false};AscCommon.stopEvent=function(e){if(!e)return; if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation()};var isUsePointerEvents=AscBrowser.isChrome&&AscBrowser.chromeVersion>70?true:false;AscCommon.addMouseEvent=function(elem,type,handler){var _type=(isUsePointerEvents?"onpointer":"onmouse")+type;elem[_type]=handler};AscCommon.removeMouseEvent=function(elem,type){var _type=(isUsePointerEvents?"onpointer":"onmouse")+type;if(elem[_type])delete elem[_type]};AscCommon.getMouseEvent=function(elem,type){var _type=(isUsePointerEvents? "onpointer":"onmouse")+type;return elem[_type]};function CMouseEventHandler(){this.X=0;this.Y=0;this.Button=g_mouse_button_left;this.Type=g_mouse_event_type_move;this.AltKey=false;this.CtrlKey=false;this.ShiftKey=false;this.Sender=null;this.LastClickTime=-1;this.ClickCount=0;this.WheelDelta=0;this.IsPressed=false;this.LastX=0;this.LastY=0;this.KoefPixToMM=1;this.IsLocked=false;this.IsLockedEvent=false;this.buttonObject=null;this.AscHitToHandlesEpsilon=0;this.LockMouse=function(){if(!this.IsLocked){this.IsLocked= true;if(window.captureEvents)window.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);if(window.g_asc_plugins)window.g_asc_plugins.disablePointerEvents();return true}return false};this.UnLockMouse=function(){if(this.IsLocked){this.IsLocked=false;if(window.releaseEvents)window.releaseEvents(Event.MOUSEMOVE);if(window.g_asc_plugins)window.g_asc_plugins.enablePointerEvents();return true}return false}}function CKeyboardEvent(){this.AltKey=false;this.CtrlKey=false;this.ShiftKey=false;this.MacCmdKey=false;this.AltGr= false;this.Sender=null;this.CharCode=0;this.KeyCode=0}CKeyboardEvent.prototype.Up=function(){this.AltKey=false;this.CtrlKey=false;this.ShiftKey=false;this.AltGr=false;this.MacCmdKey=false};CKeyboardEvent.prototype.IsCtrl=function(){return this.CtrlKey||this.AltKey&&this.AltGr};CKeyboardEvent.prototype.IsShift=function(){return this.ShiftKey};CKeyboardEvent.prototype.IsAlt=function(){return this.AltKey};CKeyboardEvent.prototype.GetKeyCode=function(){return this.KeyCode};var global_mouseEvent=new CMouseEventHandler; var global_keyboardEvent=new CKeyboardEvent;function check_KeyboardEvent(e){global_keyboardEvent.AltKey=e.altKey;global_keyboardEvent.AltGr=AscCommon.getAltGr(e);global_keyboardEvent.CtrlKey=!global_keyboardEvent.AltGr&&(e.metaKey||e.ctrlKey);global_keyboardEvent.MacCmdKey=AscCommon.AscBrowser.isMacOs&&e.metaKey;global_keyboardEvent.ShiftKey=e.shiftKey;global_keyboardEvent.Sender=e.srcElement?e.srcElement:e.target;global_keyboardEvent.CharCode=e.charCode;global_keyboardEvent.KeyCode=e.keyCode;global_keyboardEvent.Which= e.which}function check_KeyboardEvent2(e){global_keyboardEvent.AltKey=e.altKey;if(e.metaKey!==undefined)global_keyboardEvent.CtrlKey=e.ctrlKey||e.metaKey;else global_keyboardEvent.CtrlKey=e.ctrlKey;global_keyboardEvent.MacCmdKey=AscCommon.AscBrowser.isMacOs&&e.metaKey;global_keyboardEvent.ShiftKey=e.shiftKey;global_keyboardEvent.AltGr=global_keyboardEvent.CtrlKey&&global_keyboardEvent.AltKey?true:false;if(global_keyboardEvent.CtrlKey&&global_keyboardEvent.AltKey)global_keyboardEvent.CtrlKey=false} function check_MouseMoveEvent(e){if(e.IsLocked&&!e.IsLockedEvent)return;if(e.pageX||e.pageY){global_mouseEvent.X=e.pageX;global_mouseEvent.Y=e.pageY}else if(e.clientX||e.clientY){global_mouseEvent.X=e.clientX;global_mouseEvent.Y=e.clientY}global_mouseEvent.X=global_mouseEvent.X*AscBrowser.zoom>>0;global_mouseEvent.Y=global_mouseEvent.Y*AscBrowser.zoom>>0;global_mouseEvent.AltKey=e.altKey;global_mouseEvent.ShiftKey=e.shiftKey;global_mouseEvent.CtrlKey=e.ctrlKey||e.metaKey;global_mouseEvent.Type=g_mouse_event_type_move; if(!global_mouseEvent.IsLocked)global_mouseEvent.Sender=e.srcElement?e.srcElement:e.target;var _eps=3*global_mouseEvent.KoefPixToMM;if(Math.abs(global_mouseEvent.X-global_mouseEvent.LastX)>_eps||Math.abs(global_mouseEvent.Y-global_mouseEvent.LastY)>_eps){global_mouseEvent.LastClickTime=-1;global_mouseEvent.ClickCount=0}}function CreateMouseUpEventObject(x,y){var e={};e.PageX=x;e.PageY=y;e.altKey=global_mouseEvent.AltKey;e.shiftKey=global_mouseEvent.ShiftKey;e.ctrlKey=global_mouseEvent.CtrlKey;e.srcElement= global_mouseEvent.Sender;e.button=0;return e}function getMouseButton(e){var res=e.button;return res&&-1!==res?res:0}function check_MouseUpEvent(e){if(e.pageX||e.pageY){global_mouseEvent.X=e.pageX;global_mouseEvent.Y=e.pageY}else if(e.clientX||e.clientY){global_mouseEvent.X=e.clientX;global_mouseEvent.Y=e.clientY}global_mouseEvent.X=global_mouseEvent.X*AscBrowser.zoom>>0;global_mouseEvent.Y=global_mouseEvent.Y*AscBrowser.zoom>>0;global_mouseEvent.AltKey=e.altKey;global_mouseEvent.ShiftKey=e.shiftKey; global_mouseEvent.CtrlKey=e.ctrlKey||e.metaKey;global_keyboardEvent.AltKey=global_mouseEvent.AltKey;global_keyboardEvent.ShiftKey=global_mouseEvent.ShiftKey;global_keyboardEvent.CtrlKey=global_mouseEvent.CtrlKey;global_mouseEvent.Type=g_mouse_event_type_up;global_mouseEvent.Button=getMouseButton(e);var lockedElement=null;var newSender=e.srcElement?e.srcElement:e.target;if(!newSender)newSender={id:"emulation_oo_id"};if(global_mouseEvent.Sender&&global_mouseEvent.Sender.id==newSender.id)lockedElement= global_mouseEvent.Sender;if(global_mouseEvent.IsLocked==true&&global_mouseEvent.Sender!=newSender&&false===MouseUpLock.MouseUpLockedSend)Window_OnMouseUp(e);MouseUpLock.MouseUpLockedSend=true;global_mouseEvent.Sender=newSender;global_mouseEvent.UnLockMouse();global_mouseEvent.IsPressed=false;return lockedElement}function check_MouseClickOnUp(){if(0==global_mouseEvent.ClickCount)return false;var _eps=3*global_mouseEvent.KoefPixToMM;if(Math.abs(global_mouseEvent.X-global_mouseEvent.LastX)>_eps||Math.abs(global_mouseEvent.Y- global_mouseEvent.LastY)>_eps)return false;var CurTime=(new Date).getTime();if(500<CurTime-global_mouseEvent.LastClickTime)return false;return true}function check_MouseDownEvent(e,isClicks){if(e.pageX||e.pageY){global_mouseEvent.X=e.pageX;global_mouseEvent.Y=e.pageY}else if(e.clientX||e.clientY){global_mouseEvent.X=e.clientX;global_mouseEvent.Y=e.clientY}global_mouseEvent.X=global_mouseEvent.X*AscBrowser.zoom>>0;global_mouseEvent.Y=global_mouseEvent.Y*AscBrowser.zoom>>0;var _eps=3*global_mouseEvent.KoefPixToMM; if(Math.abs(global_mouseEvent.X-global_mouseEvent.LastX)>_eps||Math.abs(global_mouseEvent.Y-global_mouseEvent.LastY)>_eps){global_mouseEvent.LastClickTime=-1;global_mouseEvent.ClickCount=0}global_mouseEvent.LastX=global_mouseEvent.X;global_mouseEvent.LastY=global_mouseEvent.Y;global_mouseEvent.AltKey=e.altKey;global_mouseEvent.ShiftKey=e.shiftKey;global_mouseEvent.CtrlKey=e.ctrlKey||e.metaKey;global_keyboardEvent.AltKey=global_mouseEvent.AltKey;global_keyboardEvent.ShiftKey=global_mouseEvent.ShiftKey; global_keyboardEvent.CtrlKey=global_mouseEvent.CtrlKey;global_mouseEvent.Type=g_mouse_event_type_down;global_mouseEvent.Button=getMouseButton(e);if(!global_mouseEvent.IsLocked||!global_mouseEvent.Sender)global_mouseEvent.Sender=e.srcElement?e.srcElement:e.target;if(isClicks){var CurTime=(new Date).getTime();if(0==global_mouseEvent.ClickCount){global_mouseEvent.ClickCount=1;global_mouseEvent.LastClickTime=CurTime}else if(500>CurTime-global_mouseEvent.LastClickTime){global_mouseEvent.LastClickTime= CurTime;global_mouseEvent.ClickCount++}else{global_mouseEvent.ClickCount=1;global_mouseEvent.LastClickTime=CurTime}}else{global_mouseEvent.LastClickTime=-1;global_mouseEvent.ClickCount=1}MouseUpLock.MouseUpLockedSend=false}function check_MouseDownEvent2(x,y){global_mouseEvent.X=x;global_mouseEvent.Y=y;global_mouseEvent.LastX=global_mouseEvent.X;global_mouseEvent.LastY=global_mouseEvent.Y;global_mouseEvent.Type=g_mouse_event_type_down;global_mouseEvent.Sender=editor.WordControl.m_oEditor.HtmlElement; global_mouseEvent.LastClickTime=-1;global_mouseEvent.ClickCount=1;MouseUpLock.MouseUpLockedSend=false}function global_OnMouseWheel(e){global_mouseEvent.AltKey=e.altKey;global_mouseEvent.ShiftKey=e.shiftKey;global_mouseEvent.CtrlKey=e.ctrlKey||e.metaKey;if(undefined!=e.wheelDelta)global_mouseEvent.WheelDelta=e.wheelDelta>0?-45:45;else global_mouseEvent.WheelDelta=e.detail>0?45:-45;global_mouseEvent.type=g_mouse_event_type_wheel;global_mouseEvent.Sender=e.srcElement?e.srcElement:e.target;global_mouseEvent.LastClickTime= -1;global_mouseEvent.ClickCount=0}function InitCaptureEvents(){AscCommon.addMouseEvent(window,"move",Window_OnMouseMove);AscCommon.addMouseEvent(window,"up",Window_OnMouseUp)}function Window_OnMouseMove(e){if(!global_mouseEvent.IsLocked||!global_mouseEvent.Sender)return;var types=isUsePointerEvents?["onpointermove","onmousemove"]:["onmousemove","onpointermove"];for(var i=0;i<2;i++)if(global_mouseEvent.Sender[types[i]]){global_mouseEvent.IsLockedEvent=true;global_mouseEvent.Sender[types[i]](e);global_mouseEvent.IsLockedEvent= false;break}}function Window_OnMouseUp(e){if(false===MouseUpLock.MouseUpLockedSend){MouseUpLock.MouseUpLockedSend=true;if(global_mouseEvent.IsLocked&&global_mouseEvent.Sender){var types=isUsePointerEvents?["onpointerup","onmouseup"]:["onmouseup","onpointerup"];for(var i=0;i<2;i++)if(global_mouseEvent.Sender[types[i]]){global_mouseEvent.Sender[types[i]](e,true);if(global_mouseEvent.IsLocked)global_mouseEvent.UnLockMouse();break}}}if(window.g_asc_plugins)window.g_asc_plugins.onExternalMouseUp()}InitCaptureEvents(); function button_eventHandlers(disable_pos,norm_pos,over_pos,down_pos,control,click_func_delegate){this.state_normal=norm_pos;this.state_over=over_pos;this.state_down=down_pos;this.Click_func=click_func_delegate;this.Control=control;this.IsPressed=false;var oThis=this;this.Control.HtmlElement.onmouseover=function(e){check_MouseMoveEvent(e);if(global_mouseEvent.IsLocked){if(global_mouseEvent.Sender.id!=oThis.Control.HtmlElement.id)return;oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_down; return}oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_over};this.Control.HtmlElement.onmouseout=function(e){check_MouseMoveEvent(e);if(global_mouseEvent.IsLocked){if(global_mouseEvent.Sender.id!=oThis.Control.HtmlElement.id)return;oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_over;return}oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_normal};this.Control.HtmlElement.onmousedown=function(e){check_MouseDownEvent(e);global_mouseEvent.LockMouse();global_mouseEvent.buttonObject= oThis;AscCommon.stopEvent(e);if(global_mouseEvent.IsLocked){if(global_mouseEvent.Sender.id!=oThis.Control.HtmlElement.id)return;oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_down;return}oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_down};this.Control.HtmlElement.onmouseup=function(e){var lockedElement=check_MouseUpEvent(e);if(e.preventDefault)e.preventDefault();else e.returnValue=false;if(null!=lockedElement&&global_mouseEvent.buttonObject!=null)oThis.Click_func(); if(null!=lockedElement)oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_over;else{if(null!=global_mouseEvent.buttonObject)global_mouseEvent.buttonObject.Control.HtmlElement.style.backgroundPosition=global_mouseEvent.buttonObject.state_normal;if(global_mouseEvent.buttonObject==null||oThis.Control.HtmlElement.id!=global_mouseEvent.buttonObject.Control.HtmlElement.id)oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_over}global_mouseEvent.buttonObject=null};this.Control.HtmlElement.ontouchstart= function(e){oThis.Control.HtmlElement.onmousedown(e.touches[0]);return false};this.Control.HtmlElement.ontouchend=function(e){var lockedElement=check_MouseUpEvent(e.changedTouches[0]);if(null!=lockedElement){oThis.Click_func();oThis.Control.HtmlElement.style.backgroundPosition=oThis.state_normal}else{if(null!=global_mouseEvent.buttonObject)global_mouseEvent.buttonObject.Control.HtmlElement.style.backgroundPosition=global_mouseEvent.buttonObject.state_normal;if(oThis.Control.HtmlElement.id!=global_mouseEvent.buttonObject.Control.HtmlElement.id)oThis.Control.HtmlElement.style.backgroundPosition= oThis.state_normal}global_mouseEvent.buttonObject=null;return false}}function emulateKeyDown(_code,_element){var oEvent=document.createEvent("KeyboardEvent");Object.defineProperty(oEvent,"keyCode",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"which",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"shiftKey",{get:function(){return false}});Object.defineProperty(oEvent,"altKey",{get:function(){return false}});Object.defineProperty(oEvent,"metaKey",{get:function(){return false}}); Object.defineProperty(oEvent,"ctrlKey",{get:function(){return false}});if(AscCommon.AscBrowser.isIE)oEvent.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return true}})};if(oEvent.initKeyboardEvent)oEvent.initKeyboardEvent("keydown",true,true,window,false,false,false,false,_code,_code);else oEvent.initKeyEvent("keydown",true,true,window,false,false,false,false,_code,0);oEvent.keyCodeVal=_code;_element.dispatchEvent(oEvent);return oEvent.defaultPrevented}window["AscCommon"]= window["AscCommon"]||{};window["AscCommon"].g_mouse_event_type_down=g_mouse_event_type_down;window["AscCommon"].g_mouse_event_type_move=g_mouse_event_type_move;window["AscCommon"].g_mouse_event_type_up=g_mouse_event_type_up;window["AscCommon"].g_mouse_button_left=g_mouse_button_left;window["AscCommon"].g_mouse_button_center=g_mouse_button_center;window["AscCommon"].g_mouse_button_right=g_mouse_button_right;window["AscCommon"].MouseUpLock=MouseUpLock;window["AscCommon"].CMouseEventHandler=CMouseEventHandler; window["AscCommon"].CKeyboardEvent=CKeyboardEvent;window["AscCommon"].global_mouseEvent=global_mouseEvent;window["AscCommon"].global_keyboardEvent=global_keyboardEvent;window["AscCommon"].check_KeyboardEvent=check_KeyboardEvent;window["AscCommon"].check_KeyboardEvent2=check_KeyboardEvent2;window["AscCommon"].check_MouseMoveEvent=check_MouseMoveEvent;window["AscCommon"].CreateMouseUpEventObject=CreateMouseUpEventObject;window["AscCommon"].getMouseButton=getMouseButton;window["AscCommon"].check_MouseUpEvent= check_MouseUpEvent;window["AscCommon"].check_MouseDownEvent=check_MouseDownEvent;window["AscCommon"].Window_OnMouseUp=Window_OnMouseUp;window["AscCommon"].button_eventHandlers=button_eventHandlers;window["AscCommon"].emulateKeyDown=emulateKeyDown;window["AscCommon"].check_MouseClickOnUp=check_MouseClickOnUp})(window);"use strict";(function(window,undefined){window["AscCH"]=window["AscCH"]||{};window["AscCH"].historyitem_Unknown=0;window["AscCH"].historyitem_Workbook_SheetAdd=1;window["AscCH"].historyitem_Workbook_SheetRemove= 2;window["AscCH"].historyitem_Workbook_SheetMove=3;window["AscCH"].historyitem_Workbook_ChangeColorScheme=5;window["AscCH"].historyitem_Workbook_DefinedNamesChange=7;window["AscCH"].historyitem_Workbook_DefinedNamesChangeUndo=8;window["AscCH"].historyitem_Workbook_Calculate=9;window["AscCH"].historyitem_Workbook_PivotWorksheetSource=10;window["AscCH"].historyitem_Worksheet_RemoveCell=1;window["AscCH"].historyitem_Worksheet_RemoveRows=2;window["AscCH"].historyitem_Worksheet_RemoveCols=3;window["AscCH"].historyitem_Worksheet_AddRows= 4;window["AscCH"].historyitem_Worksheet_AddCols=5;window["AscCH"].historyitem_Worksheet_ShiftCellsLeft=6;window["AscCH"].historyitem_Worksheet_ShiftCellsTop=7;window["AscCH"].historyitem_Worksheet_ShiftCellsRight=8;window["AscCH"].historyitem_Worksheet_ShiftCellsBottom=9;window["AscCH"].historyitem_Worksheet_ColProp=10;window["AscCH"].historyitem_Worksheet_RowProp=11;window["AscCH"].historyitem_Worksheet_Sort=12;window["AscCH"].historyitem_Worksheet_MoveRange=13;window["AscCH"].historyitem_Worksheet_Rename= 18;window["AscCH"].historyitem_Worksheet_Hide=19;window["AscCH"].historyitem_Worksheet_Null=20;window["AscCH"].historyitem_Worksheet_ChangeMerge=25;window["AscCH"].historyitem_Worksheet_ChangeHyperlink=26;window["AscCH"].historyitem_Worksheet_SetTabColor=27;window["AscCH"].historyitem_Worksheet_RowHide=28;window["AscCH"].historyitem_Worksheet_ChangeFrozenCell=30;window["AscCH"].historyitem_Worksheet_SetDisplayGridlines=31;window["AscCH"].historyitem_Worksheet_SetDisplayHeadings=32;window["AscCH"].historyitem_Worksheet_GroupRow= 33;window["AscCH"].historyitem_Worksheet_CollapsedRow=34;window["AscCH"].historyitem_Worksheet_CollapsedCol=35;window["AscCH"].historyitem_Worksheet_GroupCol=36;window["AscCH"].historyitem_Worksheet_SetSummaryRight=37;window["AscCH"].historyitem_Worksheet_SetSummaryBelow=38;window["AscCH"].historyitem_Worksheet_SetFitToPage=39;window["AscCH"].historyitem_Worksheet_PivotAdd=40;window["AscCH"].historyitem_Worksheet_PivotDelete=41;window["AscCH"].historyitem_Worksheet_PivotReplace=42;window["AscCH"].historyitem_Worksheet_SlicerAdd= 43;window["AscCH"].historyitem_Worksheet_SlicerDelete=44;window["AscCH"].historyitem_Worksheet_SetActiveNamedSheetView=45;window["AscCH"].historyitem_Worksheet_SheetViewAdd=46;window["AscCH"].historyitem_Worksheet_SheetViewDelete=47;window["AscCH"].historyitem_Worksheet_DataValidationAdd=48;window["AscCH"].historyitem_Worksheet_DataValidationChange=49;window["AscCH"].historyitem_Worksheet_DataValidationDelete=50;window["AscCH"].historyitem_RowCol_Fontname=1;window["AscCH"].historyitem_RowCol_Fontsize= 2;window["AscCH"].historyitem_RowCol_Fontcolor=3;window["AscCH"].historyitem_RowCol_Bold=4;window["AscCH"].historyitem_RowCol_Italic=5;window["AscCH"].historyitem_RowCol_Underline=6;window["AscCH"].historyitem_RowCol_Strikeout=7;window["AscCH"].historyitem_RowCol_FontAlign=8;window["AscCH"].historyitem_RowCol_AlignVertical=9;window["AscCH"].historyitem_RowCol_AlignHorizontal=10;window["AscCH"].historyitem_RowCol_Fill=11;window["AscCH"].historyitem_RowCol_Border=12;window["AscCH"].historyitem_RowCol_ShrinkToFit= 13;window["AscCH"].historyitem_RowCol_Wrap=14;window["AscCH"].historyitem_RowCol_SetFont=16;window["AscCH"].historyitem_RowCol_Angle=17;window["AscCH"].historyitem_RowCol_SetStyle=18;window["AscCH"].historyitem_RowCol_SetCellStyle=19;window["AscCH"].historyitem_RowCol_Num=20;window["AscCH"].historyitem_Cell_Fontname=1;window["AscCH"].historyitem_Cell_Fontsize=2;window["AscCH"].historyitem_Cell_Fontcolor=3;window["AscCH"].historyitem_Cell_Bold=4;window["AscCH"].historyitem_Cell_Italic=5;window["AscCH"].historyitem_Cell_Underline= 6;window["AscCH"].historyitem_Cell_Strikeout=7;window["AscCH"].historyitem_Cell_FontAlign=8;window["AscCH"].historyitem_Cell_AlignVertical=9;window["AscCH"].historyitem_Cell_AlignHorizontal=10;window["AscCH"].historyitem_Cell_Fill=11;window["AscCH"].historyitem_Cell_Border=12;window["AscCH"].historyitem_Cell_ShrinkToFit=13;window["AscCH"].historyitem_Cell_Wrap=14;window["AscCH"].historyitem_Cell_ChangeValue=16;window["AscCH"].historyitem_Cell_ChangeArrayValueFormat=17;window["AscCH"].historyitem_Cell_SetStyle= 18;window["AscCH"].historyitem_Cell_SetFont=19;window["AscCH"].historyitem_Cell_SetQuotePrefix=20;window["AscCH"].historyitem_Cell_Angle=21;window["AscCH"].historyitem_Cell_Style=22;window["AscCH"].historyitem_Cell_ChangeValueUndo=23;window["AscCH"].historyitem_Cell_Num=24;window["AscCH"].historyitem_Cell_SetPivotButton=25;window["AscCH"].historyitem_Cell_RemoveSharedFormula=26;window["AscCH"].historyitem_Comment_Add=1;window["AscCH"].historyitem_Comment_Remove=2;window["AscCH"].historyitem_Comment_Change= 3;window["AscCH"].historyitem_Comment_Coords=4;window["AscCH"].historyitem_AutoFilter_Add=1;window["AscCH"].historyitem_AutoFilter_Sort=2;window["AscCH"].historyitem_AutoFilter_Empty=3;window["AscCH"].historyitem_AutoFilter_Apply=5;window["AscCH"].historyitem_AutoFilter_Move=6;window["AscCH"].historyitem_AutoFilter_CleanAutoFilter=7;window["AscCH"].historyitem_AutoFilter_Delete=8;window["AscCH"].historyitem_AutoFilter_ChangeTableStyle=9;window["AscCH"].historyitem_AutoFilter_Change=10;window["AscCH"].historyitem_AutoFilter_ChangeTableInfo= 12;window["AscCH"].historyitem_AutoFilter_ChangeTableRef=13;window["AscCH"].historyitem_AutoFilter_ChangeTableName=14;window["AscCH"].historyitem_AutoFilter_ClearFilterColumn=15;window["AscCH"].historyitem_AutoFilter_ChangeColumnName=16;window["AscCH"].historyitem_AutoFilter_ChangeTotalRow=17;window["AscCH"].historyitem_PivotTable_StyleName=1;window["AscCH"].historyitem_PivotTable_StyleShowRowHeaders=2;window["AscCH"].historyitem_PivotTable_StyleShowColHeaders=3;window["AscCH"].historyitem_PivotTable_StyleShowRowStripes= 4;window["AscCH"].historyitem_PivotTable_StyleShowColStripes=5;window["AscCH"].historyitem_PivotTable_SetName=6;window["AscCH"].historyitem_PivotTable_SetRowGrandTotals=7;window["AscCH"].historyitem_PivotTable_SetColGrandTotals=8;window["AscCH"].historyitem_PivotTable_SetPageOverThenDown=9;window["AscCH"].historyitem_PivotTable_SetPageWrap=10;window["AscCH"].historyitem_PivotTable_SetShowHeaders=11;window["AscCH"].historyitem_PivotTable_SetCompact=12;window["AscCH"].historyitem_PivotTable_SetOutline= 13;window["AscCH"].historyitem_PivotTable_SetFillDownLabelsDefault=14;window["AscCH"].historyitem_PivotTable_SetDataOnRows=15;window["AscCH"].historyitem_PivotTable_SetAltText=16;window["AscCH"].historyitem_PivotTable_SetAltTextSummary=17;window["AscCH"].historyitem_PivotTable_AddPageField=18;window["AscCH"].historyitem_PivotTable_AddRowField=19;window["AscCH"].historyitem_PivotTable_AddColField=20;window["AscCH"].historyitem_PivotTable_AddDataField=21;window["AscCH"].historyitem_PivotTable_RemovePageField= 22;window["AscCH"].historyitem_PivotTable_RemoveRowField=23;window["AscCH"].historyitem_PivotTable_RemoveColField=24;window["AscCH"].historyitem_PivotTable_RemoveDataField=25;window["AscCH"].historyitem_PivotTable_MovePageField=26;window["AscCH"].historyitem_PivotTable_MoveRowField=27;window["AscCH"].historyitem_PivotTable_MoveColField=28;window["AscCH"].historyitem_PivotTable_MoveDataField=29;window["AscCH"].historyitem_PivotTable_PivotFieldSetName=30;window["AscCH"].historyitem_PivotTable_PivotFieldSetOutline= 31;window["AscCH"].historyitem_PivotTable_PivotFieldSetCompact=32;window["AscCH"].historyitem_PivotTable_PivotFieldFillDownLabelsDefault=33;window["AscCH"].historyitem_PivotTable_PivotFieldSetInsertBlankRow=34;window["AscCH"].historyitem_PivotTable_PivotFieldSetDefaultSubtotal=35;window["AscCH"].historyitem_PivotTable_PivotFieldSetSubtotalTop=36;window["AscCH"].historyitem_PivotTable_PivotFieldSetShowAll=37;window["AscCH"].historyitem_PivotTable_PivotFieldSetSubtotals=38;window["AscCH"].historyitem_PivotTable_DataFieldSetName= 39;window["AscCH"].historyitem_PivotTable_DataFieldSetSubtotal=40;window["AscCH"].historyitem_PivotTable_RowItems=41;window["AscCH"].historyitem_PivotTable_ColItems=42;window["AscCH"].historyitem_PivotTable_Location=43;window["AscCH"].historyitem_PivotTable_SetDataPosition=44;window["AscCH"].historyitem_PivotTable_CacheField=45;window["AscCH"].historyitem_PivotTable_PivotField=46;window["AscCH"].historyitem_PivotTable_PivotFilter=47;window["AscCH"].historyitem_PivotTable_PivotFilterDataField=48;window["AscCH"].historyitem_PivotTable_PivotFilterMeasureFld= 49;window["AscCH"].historyitem_PivotTable_PageFilter=50;window["AscCH"].historyitem_PivotTable_SetGridDropZones=51;window["AscCH"].historyitem_PivotTable_WorksheetSource=52;window["AscCH"].historyitem_PivotTable_PivotCacheId=53;window["AscCH"].historyitem_SharedFormula_ChangeFormula=1;window["AscCH"].historyitem_SharedFormula_ChangeShared=2;window["AscCH"].historyitem_Layout_Left=1;window["AscCH"].historyitem_Layout_Right=2;window["AscCH"].historyitem_Layout_Top=3;window["AscCH"].historyitem_Layout_Bottom= 4;window["AscCH"].historyitem_Layout_Width=5;window["AscCH"].historyitem_Layout_Height=6;window["AscCH"].historyitem_Layout_FitToWidth=7;window["AscCH"].historyitem_Layout_FitToHeight=8;window["AscCH"].historyitem_Layout_GridLines=9;window["AscCH"].historyitem_Layout_Headings=10;window["AscCH"].historyitem_Layout_Orientation=11;window["AscCH"].historyitem_Layout_Scale=12;window["AscCH"].historyitem_ArrayFromula_AddFormula=1;window["AscCH"].historyitem_ArrayFromula_DeleteFormula=2;window["AscCH"].historyitem_Header_First= 1;window["AscCH"].historyitem_Header_Even=2;window["AscCH"].historyitem_Header_Odd=3;window["AscCH"].historyitem_Footer_First=4;window["AscCH"].historyitem_Footer_Even=5;window["AscCH"].historyitem_Footer_Odd=6;window["AscCH"].historyitem_Align_With_Margins=7;window["AscCH"].historyitem_Scale_With_Doc=8;window["AscCH"].historyitem_Different_First=9;window["AscCH"].historyitem_Different_Odd_Even=10;window["AscCH"].historyitem_SortState_Add=1;window["AscCH"].historyitem_Slicer_SetCaption=1;window["AscCH"].historyitem_Slicer_SetCacheSourceName= 2;window["AscCH"].historyitem_Slicer_SetTableColName=3;window["AscCH"].historyitem_Slicer_SetTableName=4;window["AscCH"].historyitem_Slicer_SetCacheName=5;window["AscCH"].historyitem_Slicer_SetName=6;window["AscCH"].historyitem_Slicer_SetStartItem=7;window["AscCH"].historyitem_Slicer_SetColumnCount=8;window["AscCH"].historyitem_Slicer_SetShowCaption=9;window["AscCH"].historyitem_Slicer_SetLevel=10;window["AscCH"].historyitem_Slicer_SetStyle=11;window["AscCH"].historyitem_Slicer_SetLockedPosition= 12;window["AscCH"].historyitem_Slicer_SetRowHeight=13;window["AscCH"].historyitem_Slicer_SetCacheSortOrder=14;window["AscCH"].historyitem_Slicer_SetCacheCustomListSort=15;window["AscCH"].historyitem_Slicer_SetCacheCrossFilter=16;window["AscCH"].historyitem_Slicer_SetCacheHideItemsWithNoData=17;window["AscCH"].historyitem_Slicer_SetCacheData=18;window["AscCH"].historyitem_Slicer_SetCacheMovePivot=19;window["AscCH"].historyitem_Slicer_SetCacheCopySheet=20;window["AscCH"].historyitem_NamedSheetView_SetName= 1;window["AscCH"].historyitem_NamedSheetView_DeleteFilter=2;function CHistory(){this.workbook=null;this.Index=-1;this.Points=[];this.TurnOffHistory=0;this.Transaction=0;this.LocalChange=false;this.RecIndex=-1;this.lastDrawingObjects=null;this.LastState=null;this.CanNotAddChanges=false;this.SavedIndex=null;this.ForceSave=false;this.UserSaveMode=false;this.UserSavedIndex=null;this.PosInCurPoint=null}CHistory.prototype.init=function(workbook){this.workbook=workbook};CHistory.prototype.Is_UserSaveMode= function(){return this.UserSaveMode};CHistory.prototype.Is_Clear=function(){if(this.Points.length<=0)return true;return false};CHistory.prototype.Clear=function(){this.Index=-1;this.Points.length=0;this.TurnOffHistory=0;this.Transaction=0;this.SavedIndex=null;this.ForceSave=false;this.UserSavedIndex=null;window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();this.workbook.handlers.trigger("toggleAutoCorrectOptions",null,true);this._sendCanUndoRedo()};CHistory.prototype.Can_Undo=function(){return this.Index>= 0};CHistory.prototype.Can_Redo=function(){return this.Points.length>0&&this.Index<this.Points.length-1};CHistory.prototype.Undo=function(){if(true!==this.Can_Undo())return false;if(this.Index===this.Points.length-1)this.LastState=this.workbook.handlers.trigger("getSelectionState");var Point=this.Points[this.Index--];var oRedoObjectParam=new AscCommonExcel.RedoObjectParam;this.UndoRedoPrepare(oRedoObjectParam,true);for(var Index=Point.Items.length-1;Index>=0;Index--){var Item=Point.Items[Index];if(!Item.Class.RefreshRecalcData)Item.Class.Undo(Item.Type, Item.Data,Item.SheetId);else if(Item.Class){Item.Class.Undo();Item.Class.RefreshRecalcData()}this._addRedoObjectParam(oRedoObjectParam,Item)}this.UndoRedoEnd(Point,oRedoObjectParam,true);return true};CHistory.prototype.UndoRedoPrepare=function(oRedoObjectParam,bUndo){if(this.Is_On()){oRedoObjectParam.bIsOn=true;this.TurnOff()}this.workbook.dependencyFormulas.lockRecal();if(bUndo)this.workbook.bUndoChanges=true;else this.workbook.bRedoChanges=true;if(!window["NATIVE_EDITOR_ENJINE"]){var wsViews=Asc["editor"].wb.wsViews; for(var i=0;i<wsViews.length;++i)if(wsViews[i]){if(wsViews[i].objectRender&&wsViews[i].objectRender.controller)wsViews[i].objectRender.controller.resetSelection(undefined,true);wsViews[i].endEditChart()}}if(window["NATIVE_EDITOR_ENJINE"]||!this.workbook.oApi.isDocumentLoadComplete)oRedoObjectParam.bChangeActive=true};CHistory.prototype.RedoAdd=function(oRedoObjectParam,Class,Type,sheetid,range,Data,LocalChange){var bNeedOff=false;if(false==this.Is_On()){this.TurnOn();bNeedOff=true}this.Add(Class, Type,sheetid,range,Data,LocalChange);if(bNeedOff)this.TurnOff();var bChangeActive=oRedoObjectParam.bChangeActive&&(AscCommonExcel.g_oUndoRedoWorkbook===Class||AscCommonExcel.g_oUndoRedoWorksheet===Class&&AscCH.historyitem_Worksheet_Hide===Type);if(bChangeActive&&null!=oRedoObjectParam.activeSheet)this.workbook.setActiveById(oRedoObjectParam.activeSheet);if(Class&&!Class.Load)Class.Redo(Type,Data,sheetid);else if(Class&&Data&&!Data.isDrawingCollaborativeData)Class.Redo(Data);else if(!Class)if(Data.isDrawingCollaborativeData){Data.oBinaryReader.Seek2(Data.nPos); var nChangesType=Data.oBinaryReader.GetLong();var changedObject=AscCommon.g_oTableId.Get_ById(Data.sChangedObjectId);if(changedObject){var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(changedObject);oChange.ReadFromBinary(Data.oBinaryReader);oChange.Load(new CDocumentColor(255,255,255))}}}var curPoint=this.Points[this.Index];if(curPoint)this._addRedoObjectParam(oRedoObjectParam,curPoint.Items[curPoint.Items.length-1]);if(bChangeActive)oRedoObjectParam.activeSheet= this.workbook.getActiveWs().getId()};CHistory.prototype.Remove_LastPoint=function(){if(this.Index>-1){this.Index--;this.Points.length=this.Index+1}};CHistory.prototype.RemoveLastPoint=function(){this.Remove_LastPoint()};CHistory.prototype.Clear_Redo=function(){this.Points.length=this.Index+1};CHistory.prototype.RedoExecute=function(Point,oRedoObjectParam){for(var Index=0;Index<Point.Items.length;Index++){var Item=Point.Items[Index];if(!Item.Class.RefreshRecalcData)Item.Class.Redo(Item.Type,Item.Data, Item.SheetId);else{Item.Class.Redo();Item.Class.RefreshRecalcData()}this._addRedoObjectParam(oRedoObjectParam,Item)}AscCommon.CollaborativeEditing.Apply_LinkData();var wsViews=Asc["editor"].wb.wsViews;this.Get_RecalcData(Point);for(var i=0;i<wsViews.length;++i)if(wsViews[i]&&wsViews[i].objectRender&&wsViews[i].objectRender.controller)wsViews[i].objectRender.controller.recalculate2(undefined)};CHistory.prototype.UndoRedoEnd=function(Point,oRedoObjectParam,bUndo){var wsViews,i,oState=null,bCoaut=false, t=this;if(!bUndo&&null==Point){Point=this.Points[this.Index];AscCommon.CollaborativeEditing.Apply_LinkData();bCoaut=true;if(!window["NATIVE_EDITOR_ENJINE"]||window["IS_NATIVE_EDITOR"]){this.Get_RecalcData(Point);wsViews=Asc["editor"].wb.wsViews;for(i=0;i<wsViews.length;++i)if(wsViews[i]&&wsViews[i].objectRender&&wsViews[i].objectRender.controller)wsViews[i].objectRender.controller.recalculate2(true)}}AscCommonExcel.executeInR1C1Mode(false,function(){t.workbook.dependencyFormulas.unlockRecal()});if(null!= Point){if(oRedoObjectParam.bChangeColorScheme){t.workbook.rebuildColors();t.workbook.oApi.asc_AfterChangeColorScheme()}if(oRedoObjectParam.bUpdateWorksheetByModel)this.workbook.handlers.trigger("updateWorksheetByModel");t.workbook.oApi.updatePivotTables();if(!bCoaut)oState=bUndo?Point.SelectionState:this.Index===this.Points.length-1?this.LastState:this.Points[this.Index+1].SelectionState;if(this.workbook.bCollaborativeChanges){var ws=this.workbook.getActiveWs();this.workbook.handlers.trigger("showWorksheet", ws.getId())}else{var nSheetId=null!==oState?oState[0].worksheetId:this.workbook.bRedoChanges&&null!=Point.RedoSheetId?Point.RedoSheetId:Point.UndoSheetId;if(null!==nSheetId)this.workbook.handlers.trigger("showWorksheet",nSheetId)}for(i in oRedoObjectParam.oChangeWorksheetUpdate)this.workbook.handlers.trigger("changeWorksheetUpdate",oRedoObjectParam.oChangeWorksheetUpdate[i],{lockDraw:true,reinitRanges:true});for(i in Point.UpdateRigions){this.workbook.handlers.trigger("cleanCellCache",i,[Point.UpdateRigions[i]]); var curSheet=this.workbook.getWorksheetById(i);if(curSheet)this.workbook.getWorksheetById(i).updateSlicersByRange(Point.UpdateRigions[i])}if(oRedoObjectParam.bOnSheetsChanged)this.workbook.handlers.trigger("asc_onSheetsChanged");for(i in oRedoObjectParam.oOnUpdateTabColor){var curSheet=this.workbook.getWorksheetById(i);if(curSheet)this.workbook.handlers.trigger("asc_onUpdateTabColor",curSheet.getIndex())}if(!window["NATIVE_EDITOR_ENJINE"]||window["IS_NATIVE_EDITOR"]){this.Get_RecalcData(Point);wsViews= Asc["editor"].wb.wsViews;for(i=0;i<wsViews.length;++i)if(wsViews[i]&&wsViews[i].objectRender&&wsViews[i].objectRender.controller)wsViews[i].objectRender.controller.recalculate2(undefined)}if(oRedoObjectParam.oOnUpdateSheetViewSettings[this.workbook.getWorksheet(this.workbook.getActive()).getId()])this.workbook.handlers.trigger("asc_onUpdateSheetViewSettings");this._sendCanUndoRedo();if(bUndo)this.workbook.bUndoChanges=false;else this.workbook.bRedoChanges=false;this.workbook.handlers.trigger("updateGroupData"); this.workbook.handlers.trigger("drawWS");if(bUndo)if(Point.SelectionState)this.workbook.handlers.trigger("setSelectionState",Point.SelectionState);else this.workbook.handlers.trigger("setSelection",Point.SelectRange.clone());else if(null!==oState&&oState[0]&&oState[0].focus)this.workbook.handlers.trigger("setSelectionState",oState);else{var oSelectRange=null;if(null!=Point.SelectRangeRedo)oSelectRange=Point.SelectRangeRedo;else if(null!=Point.SelectRange)oSelectRange=Point.SelectRange;if(null!=oSelectRange)this.workbook.handlers.trigger("setSelection", oSelectRange.clone())}if(bUndo)if(AscCommon.isRealObject(this.lastDrawingObjects)){this.lastDrawingObjects.sendGraphicObjectProps();this.lastDrawingObjects=null}if(oRedoObjectParam.bChangeActive&&null!=oRedoObjectParam.activeSheet){this.workbook.setActiveById(oRedoObjectParam.activeSheet);this.workbook.handlers.trigger("updateWorksheetByModel")}}if(!window["NATIVE_EDITOR_ENJINE"]){var wsView=window["Asc"]["editor"].wb.getWorksheet();if(wsView&&wsView.objectRender&&wsView.objectRender.controller){wsView.objectRender.controller.updateOverlay(); wsView.objectRender.controller.updateSelectionState()}}if(oRedoObjectParam.bIsOn)this.TurnOn();window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();this.workbook.handlers.trigger("toggleAutoCorrectOptions",null,true)};CHistory.prototype.Redo=function(){if(true!=this.Can_Redo())return;var oRedoObjectParam=new AscCommonExcel.RedoObjectParam;this.UndoRedoPrepare(oRedoObjectParam,false);var Point=this.Points[++this.Index];this.RedoExecute(Point,oRedoObjectParam);this.UndoRedoEnd(Point,oRedoObjectParam, false)};CHistory.prototype._addRedoObjectParam=function(oRedoObjectParam,Point){if(AscCommonExcel.g_oUndoRedoWorksheet===Point.Class&&(AscCH.historyitem_Worksheet_SetDisplayGridlines===Point.Type||AscCH.historyitem_Worksheet_SetDisplayHeadings===Point.Type))oRedoObjectParam.oOnUpdateSheetViewSettings[Point.SheetId]=Point.SheetId;else if(AscCommonExcel.g_oUndoRedoWorksheet===Point.Class&&(AscCH.historyitem_Worksheet_RowProp==Point.Type||AscCH.historyitem_Worksheet_ColProp==Point.Type||AscCH.historyitem_Worksheet_RowHide== Point.Type))oRedoObjectParam.oChangeWorksheetUpdate[Point.SheetId]=Point.SheetId;else if(AscCommonExcel.g_oUndoRedoWorkbook===Point.Class&&(AscCH.historyitem_Workbook_SheetAdd===Point.Type||AscCH.historyitem_Workbook_SheetRemove===Point.Type||AscCH.historyitem_Workbook_SheetMove===Point.Type)){oRedoObjectParam.bUpdateWorksheetByModel=true;oRedoObjectParam.bOnSheetsChanged=true}else if(AscCommonExcel.g_oUndoRedoWorksheet===Point.Class&&(AscCH.historyitem_Worksheet_Rename===Point.Type||AscCH.historyitem_Worksheet_Hide=== Point.Type))oRedoObjectParam.bOnSheetsChanged=true;else if(AscCommonExcel.g_oUndoRedoWorksheet===Point.Class&&AscCH.historyitem_Worksheet_SetTabColor===Point.Type)oRedoObjectParam.oOnUpdateTabColor[Point.SheetId]=Point.SheetId;else if(AscCommonExcel.g_oUndoRedoWorksheet===Point.Class&&AscCH.historyitem_Worksheet_ChangeFrozenCell===Point.Type)oRedoObjectParam.oOnUpdateSheetViewSettings[Point.SheetId]=Point.SheetId;else if(AscCommonExcel.g_oUndoRedoWorksheet===Point.Class&&(AscCH.historyitem_Worksheet_RemoveRows=== Point.Type||AscCH.historyitem_Worksheet_RemoveCols===Point.Type||AscCH.historyitem_Worksheet_AddRows===Point.Type||AscCH.historyitem_Worksheet_AddCols===Point.Type))oRedoObjectParam.bAddRemoveRowCol=true;else if(AscCommonExcel.g_oUndoRedoAutoFilters===Point.Class&&AscCH.historyitem_AutoFilter_ChangeTableInfo===Point.Type)oRedoObjectParam.oChangeWorksheetUpdate[Point.SheetId]=Point.SheetId;else if(AscCommonExcel.g_oUndoRedoWorkbook===Point.Class&&AscCH.historyitem_Workbook_ChangeColorScheme===Point.Type)oRedoObjectParam.bChangeColorScheme= true;if(null!=Point.SheetId)oRedoObjectParam.activeSheet=Point.SheetId};CHistory.prototype.Get_RecalcData=function(Point2){{{var Point;if(Point2)Point=Point2;else Point=this.Points[this.Index];if(Point)for(var Index=0;Index<Point.Items.length;Index++){var Item=Point.Items[Index];if(Item.Class&&Item.Class.Refresh_RecalcData)Item.Class.Refresh_RecalcData(Item.Type);else if(Item.Class&&Item.Class.RefreshRecalcData)Item.Class.RefreshRecalcData();if(Item.Type===AscCH.historyitem_Workbook_ChangeColorScheme&& Item.Class===AscCommonExcel.g_oUndoRedoWorkbook){var wsViews=Asc["editor"].wb.wsViews;for(var i=0;i<wsViews.length;++i)if(wsViews[i]&&wsViews[i].objectRender&&wsViews[i].objectRender.controller)wsViews[i].objectRender.controller.RefreshAfterChangeColorScheme()}}}}};CHistory.prototype.Reset_RecalcIndex=function(){this.RecIndex=this.Index};CHistory.prototype.Add_RecalcNumPr=function(){};CHistory.prototype.Set_Additional_ExtendDocumentToPos=function(){};CHistory.prototype.CheckUnionLastPoints=function(){if(this.Points.length< 2)return;var Point1=this.Points[this.Points.length-2];var Point2=this.Points[this.Points.length-1];if(Point1.Items.length>63)return;var PrevItem=null;var Class=null;for(var Index=0;Index<Point1.Items.length;Index++){var Item=Point1.Items[Index];if(null===Class)Class=Item.Class;else if(Class!=Item.Class||"undefined"===typeof Class.Check_HistoryUninon||false===Class.Check_HistoryUninon(PrevItem.Data,Item.Data))return;PrevItem=Item}for(var Index=0;Index<Point2.Items.length;Index++){var Item=Point2.Items[Index]; if(Class!=Item.Class||"undefined"===typeof Class.Check_HistoryUninon||false===Class.Check_HistoryUninon(PrevItem.Data,Item.Data))return;PrevItem=Item}var NewPoint={State:Point1.State,Items:Point1.Items.concat(Point2.Items),Time:Point1.Time,Additional:{}};if(this.SavedIndex>=this.Points.length-2&&null!==this.SavedIndex)this.Set_SavedIndex(this.Points.length-3);this.Points.splice(this.Points.length-2,2,NewPoint);if(this.Index>=this.Points.length){var DiffIndex=-this.Index+(this.Points.length-1);this.Index+= DiffIndex;this.RecIndex+=Math.max(-1,this.RecIndex+DiffIndex)}};CHistory.prototype.Add_RecalcTableGrid=function(){};CHistory.prototype.Create_NewPoint=function(){if(0!==this.TurnOffHistory||0!==this.Transaction)return false;this.CanNotAddChanges=false;if(null!==this.SavedIndex&&this.Index<this.SavedIndex)this.Set_SavedIndex(this.Index);var Items=[];var UpdateRigions={};var Time=(new Date).getTime();var UndoSheetId=null,oSelectionState=this.workbook.handlers.trigger("getSelectionState");var oSelectRange= null;var wsActive=this.workbook.getActiveWs();if(wsActive){UndoSheetId=wsActive.getId();oSelectRange=wsActive.getSelection().getLast()}this.Points[++this.Index]={Items:Items,UpdateRigions:UpdateRigions,UndoSheetId:UndoSheetId,RedoSheetId:null,SelectRange:oSelectRange,SelectRangeRedo:oSelectRange,Time:Time,SelectionState:oSelectionState};this.Points.length=this.Index+1;window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();this.workbook.handlers.trigger("toggleAutoCorrectOptions",null, true);return true};CHistory.prototype.Add=function(Class,Type,sheetid,range,Data,LocalChange){if(!this.CanAddChanges())return;this._CheckCanNotAddChanges();var Item;if(this.RecIndex>=this.Index)this.RecIndex=this.Index-1;Item={Class:Class,Type:Type,SheetId:sheetid,Range:null,Data:Data,LocalChange:this.LocalChange};if(null!=range)Item.Range=range.clone();if(null!=LocalChange)Item.LocalChange=LocalChange;var curPoint=this.Points[this.Index];curPoint.Items.push(Item);if(null!=range&&null!=sheetid){var updateRange= curPoint.UpdateRigions[sheetid];if(null!=updateRange)updateRange.union2(range);else updateRange=range.clone();curPoint.UpdateRigions[sheetid]=updateRange}if(null!=sheetid)curPoint.UndoSheetId=sheetid;if(1==curPoint.Items.length)this._sendCanUndoRedo();if(Class)if(Class.IsContentChange&&Class.IsContentChange()){var bAdd=Class.IsAdd();var Count=Class.GetItemsCount();var ContentChanges=new AscCommon.CContentChangesElement(bAdd==true?AscCommon.contentchanges_Add:AscCommon.contentchanges_Remove,Class.Pos, Count,Class);Class.Class.Add_ContentChanges(ContentChanges);AscCommon.CollaborativeEditing.Add_NewDC(Class.Class)}};CHistory.prototype.CanAddChanges=function(){return 0===this.TurnOffHistory&&this.Index>=0};CHistory.prototype._sendCanUndoRedo=function(){if(this.workbook.bCollaborativeChanges)return;this.workbook.handlers.trigger("setCanUndo",this.Can_Undo());this.workbook.handlers.trigger("setCanRedo",this.Can_Redo());this.workbook.handlers.trigger("setDocumentModified",this.Have_Changes())};CHistory.prototype.SetSelection= function(range){if(0!==this.TurnOffHistory)return;var curPoint=this.Points[this.Index];if(curPoint)curPoint.SelectRange=range};CHistory.prototype.SetSelectionRedo=function(range){if(0!==this.TurnOffHistory)return;var curPoint=this.Points[this.Index];if(curPoint)curPoint.SelectRangeRedo=range};CHistory.prototype.GetSelection=function(){var oRes=null;var curPoint=this.Points[this.Index];if(curPoint)oRes=curPoint.SelectRange;return oRes};CHistory.prototype.GetSelectionRedo=function(){var oRes=null;var curPoint= this.Points[this.Index];if(curPoint)oRes=curPoint.SelectRangeRedo;return oRes};CHistory.prototype.SetSheetRedo=function(sheetId){if(0!==this.TurnOffHistory)return;var curPoint=this.Points[this.Index];if(curPoint)curPoint.RedoSheetId=sheetId};CHistory.prototype.SetSheetUndo=function(sheetId){if(0!==this.TurnOffHistory)return;var curPoint=this.Points[this.Index];if(curPoint)curPoint.UndoSheetId=sheetId};CHistory.prototype.TurnOff=function(){this.TurnOffHistory++};CHistory.prototype.TurnOn=function(){this.TurnOffHistory--; if(this.TurnOffHistory<0)this.TurnOffHistory=0};CHistory.prototype.StartTransaction=function(){if(this.IsEndTransaction()&&this.workbook)this.workbook.dependencyFormulas.lockRecal();this.Transaction++};CHistory.prototype.EndTransaction=function(){this.Transaction--;if(this.Transaction<0)this.Transaction=0;if(this.IsEndTransaction()&&this.workbook)this.workbook.dependencyFormulas.unlockRecal()};CHistory.prototype.IsEndTransaction=function(){return 0===this.Transaction};CHistory.prototype.Is_On=function(){return 0=== this.TurnOffHistory};CHistory.prototype.IsOn=function(){return 0===this.TurnOffHistory};CHistory.prototype.Reset_SavedIndex=function(IsUserSave){this.SavedIndex=null===this.SavedIndex&&-1===this.Index?null:this.Index;if(this.Is_UserSaveMode()){if(IsUserSave){this.UserSavedIndex=this.Index;this.ForceSave=false}}else this.ForceSave=false};CHistory.prototype.Set_SavedIndex=function(Index){this.SavedIndex=Index;if(this.Is_UserSaveMode()){if(null!==this.UserSavedIndex&&this.UserSavedIndex>this.SavedIndex){this.UserSavedIndex= Index;this.ForceSave=true}}else this.ForceSave=true};CHistory.prototype.GetDeleteIndex=function(){var DeletePointIndex=this.GetDeletePointIndex();if(null===DeletePointIndex)return null;var DeleteIndex=0;for(var i=0;i<DeletePointIndex;++i){var point=this.Points[i];for(var j=0;j<point.Items.length;++j)if(!point.Items[j].LocalChange)DeleteIndex+=1}return DeleteIndex};CHistory.prototype.GetDeletePointIndex=function(){return null!==this.SavedIndex?Math.min(this.SavedIndex+1,this.Index+1):null};CHistory.prototype.Have_Changes= function(IsNotUserSave){var checkIndex=this.Is_UserSaveMode()&&!IsNotUserSave?this.UserSavedIndex:this.SavedIndex;if(-1===this.Index&&null===checkIndex&&false===this.ForceSave)return false;return this.Index!=checkIndex||true===this.ForceSave};CHistory.prototype.GetSerializeArray=function(){var aRes=[];var i=0;if(null!=this.SavedIndex)i=this.SavedIndex+1;for(;i<=this.Index;++i){var point=this.Points[i];var aPointChanges=[];for(var j=0,length2=point.Items.length;j<length2;++j){var elem=point.Items[j]; aPointChanges.push(new AscCommonExcel.UndoRedoItemSerializable(elem.Class,elem.Type,elem.SheetId,elem.Range,elem.Data,elem.LocalChange))}aRes.push(aPointChanges)}return aRes};CHistory.prototype._CheckCanNotAddChanges=function(){try{if(this.CanNotAddChanges){var tmpErr=new Error;if(tmpErr.stack)this.workbook.oApi.CoAuthoringApi.sendChangesError(tmpErr.stack)}}catch(e){}};CHistory.prototype.RemovePointsByDeleteIndex=function(){var DeletePointIndex=this.GetDeletePointIndex();if(null===DeletePointIndex)return; this.Points.splice(0,DeletePointIndex);this.Index=Math.max(this.Index-DeletePointIndex,-1);this.RecIndex=Math.max(this.RecIndex-DeletePointIndex,-1);if(null!==this.SavedIndex){this.SavedIndex=this.SavedIndex-DeletePointIndex;if(this.SavedIndex<0)this.SavedIndex=null}};CHistory.prototype.SavePointIndex=function(){var oPoint=this.Points[this.Index];if(oPoint)this.PosInCurPoint=oPoint.Items.length;else this.PosInCurPoint=null};CHistory.prototype.ClearPointIndex=function(){this.PosInCurPoint=null};CHistory.prototype.UndoToPointIndex= function(){var oPoint=this.Points[this.Index];if(oPoint)if(this.PosInCurPoint!==null){for(var Index=oPoint.Items.length-1;Index>=this.PosInCurPoint;Index--){var Item=oPoint.Items[Index];if(!Item.Class.RefreshRecalcData)Item.Class.Undo(Item.Type,Item.Data,Item.SheetId);else if(Item.Class){Item.Class.Undo();Item.Class.RefreshRecalcData()}}oPoint.Items.splice(this.PosInCurPoint)}this.PosInCurPoint=null};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CHistory=CHistory;window["AscCommon"].History= new CHistory})(window);"use strict";(function(window,undefined){var CAscColorScheme=AscCommon.CAscColorScheme;var CColor=AscCommon.CColor;var g_oAutoShapesGroups=["Basic shapes","Figured arrows","Math","Charts","Stars & Ribbons","Callouts","Buttons","Rectangles","Lines"];var autoShapes=[["textRect","rect","ellipse","triangle","rtTriangle","parallelogram","trapezoid","diamond","pentagon","hexagon","heptagon","octagon","decagon","dodecagon","pie","chord","teardrop","frame","halfFrame","corner","diagStripe", "plus","plaque","can","cube","bevel","donut","noSmoking","blockArc","foldedCorner","smileyFace","heart","lightningBolt","sun","moon","cloud","arc","bracePair","leftBracket","rightBracket","leftBrace","rightBrace"],["rightArrow","leftArrow","upArrow","downArrow","leftRightArrow","upDownArrow","quadArrow","leftRightUpArrow","bentArrow","uturnArrow","leftUpArrow","bentUpArrow","curvedRightArrow","curvedLeftArrow","curvedUpArrow","curvedDownArrow","stripedRightArrow","notchedRightArrow","homePlate","chevron", "rightArrowCallout","downArrowCallout","leftArrowCallout","upArrowCallout","leftRightArrowCallout","quadArrowCallout","circularArrow"],["mathPlus","mathMinus","mathMultiply","mathDivide","mathEqual","mathNotEqual"],["flowChartProcess","flowChartAlternateProcess","flowChartDecision","flowChartInputOutput","flowChartPredefinedProcess","flowChartInternalStorage","flowChartDocument","flowChartMultidocument","flowChartTerminator","flowChartPreparation","flowChartManualInput","flowChartManualOperation", "flowChartConnector","flowChartOffpageConnector","flowChartPunchedCard","flowChartPunchedTape","flowChartSummingJunction","flowChartOr","flowChartCollate","flowChartSort","flowChartExtract","flowChartMerge","flowChartOnlineStorage","flowChartDelay","flowChartMagneticTape","flowChartMagneticDisk","flowChartMagneticDrum","flowChartDisplay"],["irregularSeal1","irregularSeal2","star4","star5","star6","star7","star8","star10","star12","star16","star24","star32","ribbon2","ribbon","ellipseRibbon2","ellipseRibbon", "verticalScroll","horizontalScroll","wave","doubleWave"],["wedgeRectCallout","wedgeRoundRectCallout","wedgeEllipseCallout","cloudCallout","borderCallout1","borderCallout2","borderCallout3","accentCallout1","accentCallout2","accentCallout3","callout1","callout2","callout3","accentBorderCallout1","accentBorderCallout2","accentBorderCallout3"],["actionButtonBackPrevious","actionButtonForwardNext","actionButtonBeginning","actionButtonEnd","actionButtonHome","actionButtonInformation","actionButtonReturn", "actionButtonMovie","actionButtonDocument","actionButtonSound","actionButtonHelp","actionButtonBlank"],["rect","roundRect","snip1Rect","snip2SameRect","snip2DiagRect","snipRoundRect","round1Rect","round2SameRect","round2DiagRect"],["line","lineWithArrow","lineWithTwoArrows","bentConnector5","bentConnector5WithArrow","bentConnector5WithTwoArrows","curvedConnector3","curvedConnector3WithArrow","curvedConnector3WithTwoArrows","spline","polyline1","polyline2"]];var g_oAutoShapesTypes=[];for(var i=0,length= autoShapes.length;i<length;i++){g_oAutoShapesTypes[i]=[];for(var j=0,length_group=autoShapes[i].length;j<length_group;j++)g_oAutoShapesTypes[i].push({"Type":autoShapes[i][j]})}var g_oStandartColors=[{R:192,G:0,B:0},{R:255,G:0,B:0},{R:255,G:192,B:0},{R:255,G:255,B:0},{R:146,G:208,B:80},{R:0,G:176,B:80},{R:0,G:176,B:240},{R:0,G:112,B:192},{R:0,G:32,B:96},{R:112,G:48,B:160}];var g_oThemeColorsDefaultModsWord=[[{name:"wordShade",val:242},{name:"wordShade",val:217},{name:"wordShade",val:191},{name:"wordShade", val:166},{name:"wordShade",val:128}],[{name:"wordShade",val:230},{name:"wordShade",val:191},{name:"wordShade",val:128},{name:"wordShade",val:64},{name:"wordShade",val:26}],[{name:"wordTint",val:51},{name:"wordTint",val:102},{name:"wordTint",val:153},{name:"wordShade",val:191},{name:"wordShade",val:128}],[{name:"wordTint",val:26},{name:"wordTint",val:64},{name:"wordTint",val:128},{name:"wordTint",val:191},{name:"wordTint",val:230}],[{name:"wordTint",val:128},{name:"wordTint",val:166},{name:"wordTint", val:191},{name:"wordTint",val:217},{name:"wordTint",val:242}]];var g_oThemeColorsDefaultModsPowerPoint=[[{lumMod:95E3,lumOff:-1},{lumMod:85E3,lumOff:-1},{lumMod:75E3,lumOff:-1},{lumMod:65E3,lumOff:-1},{lumMod:5E4,lumOff:-1}],[{lumMod:9E4,lumOff:-1},{lumMod:75E3,lumOff:-1},{lumMod:5E4,lumOff:-1},{lumMod:25E3,lumOff:-1},{lumMod:1E4,lumOff:-1}],[{lumMod:2E4,lumOff:8E4},{lumMod:4E4,lumOff:6E4},{lumMod:6E4,lumOff:4E4},{lumMod:75E3,lumOff:-1},{lumMod:5E4,lumOff:-1}],[{lumMod:1E4,lumOff:9E4},{lumMod:25E3, lumOff:75E3},{lumMod:5E4,lumOff:5E4},{lumMod:75E3,lumOff:25E3},{lumMod:9E4,lumOff:1E4}],[{lumMod:5E4,lumOff:5E4},{lumMod:65E3,lumOff:35E3},{lumMod:75E3,lumOff:25E3},{lumMod:85E3,lumOff:15E3},{lumMod:9E4,lumOff:5E3}]];function GetDefaultColorModsIndex(r,g,b){var L=(Math.max(r,Math.max(g,b))+Math.min(r,Math.min(g,b)))/2;L/=255;if(L==1)return 0;if(L>=.8)return 1;if(L>=.2)return 2;if(L>0)return 3;return 4}function GetDefaultMods(r,g,b,pos,editor_id){if(pos<1||pos>5)return[];var index=GetDefaultColorModsIndex(r, g,b);var _obj,_mods=[],_mod;if(editor_id==0){_obj=g_oThemeColorsDefaultModsPowerPoint[index][pos-1];if(_obj.lumMod!==-1){_mod=new AscFormat.CColorMod;_mod["name"]="lumMod";_mod["val"]=_obj.lumMod;_mods.push(_mod)}if(_obj.lumOff!==-1){_mod=new AscFormat.CColorMod;_mod.name="lumOff";_mod.val=_obj.lumOff;_mods.push(_mod)}return _mods}if(editor_id==1){_obj=g_oThemeColorsDefaultModsWord[index][pos-1];_mod=new AscFormat.CColorMod;_mod.name=_obj.name;_mod.val=_obj.val;_mods.push(_mod);return _mods}return[]} var g_oUserColorScheme=[];var elem;elem=new CAscColorScheme;elem.name="Office";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(31,73,125));elem.putColor(new CColor(238,236,225));elem.putColor(new CColor(79,129,189));elem.putColor(new CColor(192,80,77));elem.putColor(new CColor(155,187,89));elem.putColor(new CColor(128,100,162));elem.putColor(new CColor(75,172,198));elem.putColor(new CColor(247,150,70));elem.putColor(new CColor(0,0,255));elem.putColor(new CColor(128, 0,128));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Grayscale";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(248,248,248));elem.putColor(new CColor(221,221,221));elem.putColor(new CColor(178,178,178));elem.putColor(new CColor(150,150,150));elem.putColor(new CColor(128,128,128));elem.putColor(new CColor(95,95,95));elem.putColor(new CColor(77,77,77));elem.putColor(new CColor(95,95,95));elem.putColor(new CColor(145, 145,145));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Apex";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(105,103,109));elem.putColor(new CColor(201,194,209));elem.putColor(new CColor(206,185,102));elem.putColor(new CColor(156,176,132));elem.putColor(new CColor(107,177,201));elem.putColor(new CColor(101,133,207));elem.putColor(new CColor(126,107,201));elem.putColor(new CColor(163,121,187));elem.putColor(new CColor(65,0,130)); elem.putColor(new CColor(147,41,104));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Aspect";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(50,50,50));elem.putColor(new CColor(227,222,209));elem.putColor(new CColor(240,127,9));elem.putColor(new CColor(159,41,54));elem.putColor(new CColor(27,88,124));elem.putColor(new CColor(78,133,66));elem.putColor(new CColor(96,72,120));elem.putColor(new CColor(193,152,89));elem.putColor(new CColor(107, 159,37));elem.putColor(new CColor(178,107,2));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Civic";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(100,107,134));elem.putColor(new CColor(197,209,215));elem.putColor(new CColor(209,99,73));elem.putColor(new CColor(204,180,0));elem.putColor(new CColor(140,173,174));elem.putColor(new CColor(140,123,112));elem.putColor(new CColor(143,176,140));elem.putColor(new CColor(209,144,73));elem.putColor(new CColor(0, 163,214));elem.putColor(new CColor(105,79,7));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Concourse";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(70,70,70));elem.putColor(new CColor(222,245,250));elem.putColor(new CColor(45,162,191));elem.putColor(new CColor(218,31,40));elem.putColor(new CColor(235,100,27));elem.putColor(new CColor(57,99,157));elem.putColor(new CColor(71,75,120));elem.putColor(new CColor(125,60,74));elem.putColor(new CColor(255, 129,25));elem.putColor(new CColor(68,185,232));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Equity";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(105,100,100));elem.putColor(new CColor(233,229,220));elem.putColor(new CColor(211,72,23));elem.putColor(new CColor(155,45,31));elem.putColor(new CColor(162,142,106));elem.putColor(new CColor(149,98,81));elem.putColor(new CColor(145,132,133));elem.putColor(new CColor(133,93,93));elem.putColor(new CColor(204, 153,0));elem.putColor(new CColor(150,169,169));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Flow";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(4,97,123));elem.putColor(new CColor(219,245,249));elem.putColor(new CColor(15,111,198));elem.putColor(new CColor(0,157,217));elem.putColor(new CColor(11,208,217));elem.putColor(new CColor(16,207,155));elem.putColor(new CColor(124,202,98));elem.putColor(new CColor(165,194,73));elem.putColor(new CColor(244, 145,0));elem.putColor(new CColor(133,223,208));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Foundry";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(103,106,85));elem.putColor(new CColor(234,235,222));elem.putColor(new CColor(114,163,118));elem.putColor(new CColor(176,204,176));elem.putColor(new CColor(168,205,215));elem.putColor(new CColor(192,190,175));elem.putColor(new CColor(206,197,151));elem.putColor(new CColor(232,183,183)); elem.putColor(new CColor(219,83,83));elem.putColor(new CColor(144,54,56));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Median";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(119,95,85));elem.putColor(new CColor(235,221,195));elem.putColor(new CColor(148,182,210));elem.putColor(new CColor(221,128,71));elem.putColor(new CColor(165,171,129));elem.putColor(new CColor(216,178,92));elem.putColor(new CColor(123,167,157));elem.putColor(new CColor(150, 140,140));elem.putColor(new CColor(247,182,21));elem.putColor(new CColor(112,68,4));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Metro";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(78,91,111));elem.putColor(new CColor(214,236,255));elem.putColor(new CColor(127,209,59));elem.putColor(new CColor(234,21,122));elem.putColor(new CColor(254,184,10));elem.putColor(new CColor(0,173,220));elem.putColor(new CColor(115,138,200));elem.putColor(new CColor(26, 179,159));elem.putColor(new CColor(235,136,3));elem.putColor(new CColor(95,119,145));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Module";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(90,99,120));elem.putColor(new CColor(212,212,214));elem.putColor(new CColor(240,173,0));elem.putColor(new CColor(96,181,204));elem.putColor(new CColor(230,108,125));elem.putColor(new CColor(107,183,109));elem.putColor(new CColor(232,134,81));elem.putColor(new CColor(198, 72,71));elem.putColor(new CColor(22,139,186));elem.putColor(new CColor(104,0,0));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Opulent";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(177,63,154));elem.putColor(new CColor(244,231,237));elem.putColor(new CColor(184,61,104));elem.putColor(new CColor(172,102,187));elem.putColor(new CColor(222,108,54));elem.putColor(new CColor(249,182,57));elem.putColor(new CColor(207,109,164));elem.putColor(new CColor(250, 141,61));elem.putColor(new CColor(255,222,102));elem.putColor(new CColor(212,144,197));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Oriel";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(87,95,109));elem.putColor(new CColor(255,243,157));elem.putColor(new CColor(254,134,55));elem.putColor(new CColor(117,152,217));elem.putColor(new CColor(179,44,22));elem.putColor(new CColor(245,205,45));elem.putColor(new CColor(174,186,213));elem.putColor(new CColor(119, 124,132));elem.putColor(new CColor(210,97,28));elem.putColor(new CColor(59,67,91));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Origin";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(70,70,83));elem.putColor(new CColor(221,233,236));elem.putColor(new CColor(114,124,163));elem.putColor(new CColor(159,184,205));elem.putColor(new CColor(210,218,122));elem.putColor(new CColor(250,218,122));elem.putColor(new CColor(184,132,114));elem.putColor(new CColor(142, 115,106));elem.putColor(new CColor(178,146,202));elem.putColor(new CColor(107,86,128));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Paper";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(68,77,38));elem.putColor(new CColor(254,250,201));elem.putColor(new CColor(165,181,146));elem.putColor(new CColor(243,164,71));elem.putColor(new CColor(231,188,41));elem.putColor(new CColor(208,146,167));elem.putColor(new CColor(156,133,192));elem.putColor(new CColor(128, 158,194));elem.putColor(new CColor(142,88,182));elem.putColor(new CColor(127,111,111));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Solstice";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(79,39,28));elem.putColor(new CColor(231,222,201));elem.putColor(new CColor(56,145,167));elem.putColor(new CColor(254,184,10));elem.putColor(new CColor(195,45,46));elem.putColor(new CColor(132,170,51));elem.putColor(new CColor(150,67,5));elem.putColor(new CColor(71, 90,141));elem.putColor(new CColor(141,199,101));elem.putColor(new CColor(170,138,20));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Technic";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(59,59,59));elem.putColor(new CColor(212,210,208));elem.putColor(new CColor(110,160,176));elem.putColor(new CColor(204,175,10));elem.putColor(new CColor(141,137,164));elem.putColor(new CColor(116,133,96));elem.putColor(new CColor(158,146,115)); elem.putColor(new CColor(126,132,141));elem.putColor(new CColor(0,200,195));elem.putColor(new CColor(161,22,224));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Trek";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(78,59,48));elem.putColor(new CColor(251,238,201));elem.putColor(new CColor(240,162,46));elem.putColor(new CColor(165,100,78));elem.putColor(new CColor(181,139,128));elem.putColor(new CColor(195,152,109));elem.putColor(new CColor(161, 149,116));elem.putColor(new CColor(193,117,41));elem.putColor(new CColor(173,31,31));elem.putColor(new CColor(255,196,47));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Urban";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(66,68,86));elem.putColor(new CColor(222,222,222));elem.putColor(new CColor(83,84,138));elem.putColor(new CColor(67,128,134));elem.putColor(new CColor(160,77,163));elem.putColor(new CColor(196,101,45));elem.putColor(new CColor(139, 93,61));elem.putColor(new CColor(92,146,181));elem.putColor(new CColor(103,175,189));elem.putColor(new CColor(194,168,116));g_oUserColorScheme.push(elem);elem=new CAscColorScheme;elem.name="Verve";elem.putColor(new CColor(0,0,0));elem.putColor(new CColor(255,255,255));elem.putColor(new CColor(102,102,102));elem.putColor(new CColor(210,210,210));elem.putColor(new CColor(255,56,140));elem.putColor(new CColor(228,0,89));elem.putColor(new CColor(156,0,127));elem.putColor(new CColor(104,0,127));elem.putColor(new CColor(0, 91,211));elem.putColor(new CColor(0,52,158));elem.putColor(new CColor(23,187,253));elem.putColor(new CColor(255,121,194));g_oUserColorScheme.push(elem);var g_oUserTexturePresets=["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEENJREFUeNp0Wcl25DByxA5wK0nd47F98f9/hi8++OifmIM93VKVaiGxOgIoadoH82lBgSCYQEZGRqLk/uvfvQ4iikep/sdJarX//j0pLbY13W41F+eMdO7+8TtYp5QSfmr7fuQkhfavL/HzJqR06yp0e/x6d8ZqH+r9nlr16yK0bOdzdtacXjDV8X7xrejFFlFSVGFd4/UmRBWtOW9FqTklaRb9tpnjOKzV+/X4TPnn6ypEu91u2lh32h6Px/HYt20JWu/7no8Is1ZlMCAWvCv4BMu7Wd6XlDE+ymOO7KxKYoXC6vv5rLd1WtZWK95VcnTSZtXiIa21GFlKMlpbu+UYL5eLm+S6TUYITCu//46L7dZGu6HxZ/ur8Wc/Lt0vo/pfY4pkD36/B7c/Bo9XjOvPj2MeiZ9y+Q9lJpFkyQW7J6Qq53fMLKYg9r3lIrUU3ufLB3aQdkwL+ktOoin9+tKud04JJ4ocf384jPFB3O+lVb3MQglxvQpnxbqJ2vLHp2lFzEa0XLNR2yY+r8OJIjiRi0ipNqdeV5NzRocoqpSichZKokcLKXIuGQ8X3SS2AHeNwrsqbuMWLm5Hb8Asi78t8UGMNcBIzjALf5SQBdNIzNx6t4EReFvLOTVgANcwy2LxGf5MuUmHYfCuCeq4xktMb4tvUsDBr0Cgo+PjfoTgFiHQPuQDjnhR5vPzE5AHtlzwGAyzfhjTdAN0sIy5APF3mKmMbkbd39/lMnvnsVsAX8rRFhM75HGdz+eBrVd1SvuB2ab1pxPCeO8VfpP0UjnnGj0Gmzz+hRCwWnySgZeRqtbK294LrZx9jqETQ5A1AlIG6OI/QLbhb9V8dAzDblXMhfseO1O00jaEaZqwxTBLh4CdjpGTAFvswbxqmhbr+FYl+VZAJCVYCQg/N5mXa/SycjACfoaHFFeEx/ljDEYErGeag4CbKmgF/KCXpRjNmRsNhVnCw88R6xLWwiwhPLHVZzidTkVgswQ8cvEn/bjs5yP988u/AVTn8/vJ2PCv//Lx8ft+vZ1e1tWod/iiFRhxsubX77+nkq3xP7fp77//By/7yxrEo94+r3d1nqOHE2tppwosTH/777+BHd7CLJo8f37UcpxiULVcc/vp1OX8C6iVtf3461/36/V2vdrp9XSaSRC8gQ1TCuAAINBgrEY6H69kYJcyQhc9ADD+IvS5AYiAHtUVg+vgBjVC3dANGiHSHYowzY1hKVS/Wsl8sNavV0sagZhTnARvNPM8068KU2d4TVmzbZvHex2oewXKtCHc0EawwE2I/60hvhFgIIsJ/ZwX/Y2oM1YYy1g2GnQPmIuXFwSJFfC7UMuyKFn85MWxawkO4gW7FRgNrVKctVUZrgo2wmqRe1DjqhVB6zWpsjBgk5Da9GUB/liutZ6sUEst4nuJHRyqE+aTJJ/kKeVgDduxhcGdHsASNdVk8bHyvTDLfLcdt9Qgqyw27PfjHvPc3vAkkAFnTNuKeAa2ppmRiWFR0COb9YzzQgY4xYg2Ote+sB7/YhIOAQVsMaNYf71eXZjCHGuTGAB669SV7rnNy4KRXBjYdJrQvt9uQQYPJ6ruz4EnxJLo2OAGGDM6GaodKZLhIsdg1QAHPTIO0YMHcxl55mu3auvxNeCCkarJjrbCj62CbMa0GEYn9jYGdyauT4Ig1RR6sOPEgn6wz1wsWE0RqkRAx2v3I62nE/uD7MQ7tB7YskBoRpwKR3pjp+6ZUfQVSm17GFWLVXX4Yzgi8R9ta7EUkg0eNuBUQXAAPpyIdMWGJFqq6A8wP/RY4uub3R9xvPWZ12vVdJsa6AIhYinQKggpZC/B9XASDURz2hpguHleNGs0EBk2CDggPvZFh/1zvx1p/vmK7PF5vmjn3TRd3j8AqXkOTpnH9Ra5U2IzDskH2KITU0K6IEVDWsl8vV3CbrdlOs4PKKoTMKCZXozzL+AtpUFAwJai8tr3ZF7tst9irXfs09s04S6AaHx7RaomvXa0PKVFRwMb2B6LWCnDy52fGKmy3+UYocZgOpEPdj8YwohoG4+AD5DjucdMR4jrVmPz9KOudCLdKhtnUAPkDBPmA761T8c97C+A9wcannBF29LXIDCieDAezXjOO4wQfQpOapyGkqmaJjKVTVrxTWB5vgIZ3NiWquyRhA+yr0CAxpGYLJE6SNiM9WnLV4rO7PjFRGMnKDI1n8EjNGsYquQwywxTSF2YC6qaJmI0ZJtEuwORDa5TARnYPkCMQGxPyItu19h4M0Ie/44UJ3j6SAd+Hg9q+RR9qS6nmLsekhWPgswOLcF4r4YcxtBoasFzxwFb0YXAxFSATQBYHveKMLBwqCJv+cUjJYjSeasYWZCLHjFNO1T53qm3hd3f98cRj1qdg99p3TCzYLeIM+6W5m4RQyNF6uEsCpsnyWEL23Nr6ZruB2yS6ksHQiQW03cLbUZKBZviPQxmDCw1sv8LW4PtvhNiz4nbKgLyXVlt8hDEGLtt1DPzNLXqYgKokLBORK0mP83LCrk5zJpmFC8gNwxWVWy1deZUoK4KsyC7LaCB8EdWDbB2XQ/izRtzhwVOIEfGQ3cniHWd4XEIpwLq8qx8QCAtoixJOu7AEDZ2k1p4kCJ1M1IZIIP9h30Iq6nnK5rY1JTi04lQAFU+4gEphdCIkOSQgfoQWSYMRtrucgOTYDs36bF9VHzACXUK7lRzOMxFBY9dhF7db/dFuf2KrEjeQk3xuFxRKfhtJZ7ujyk4MMT+eYvkVpQC0JM5HQTTtC4U08fx5h3Syn49A+dzmB7QW6LNEvnT3X//3Zw2pzco9cf1YluOak2q7DczT/tx/2xM3nW2Kt32dOTDtLcfJ9PZRfV8VIZ4+qYi9QUd3bWp6Swv+2C8dVRPI3bQhVSNBspXJiyonp77upwOoos2tCm3KY5sAqjNk+WZR1QnD8OyCBIWGtiMRAudY5Hz0VYcAHAMEQxcuN7u1vUU3k0EtqCKkZ4o0XqnoOjtZDEGVOY1sBEG1M44AKPr+Q+GGZllfY5kPkfyYRMSi6VwJwgkhBjTuGJslKUxIWGPTvheNngPDh1mnQIVCKQ6zUoDHGo+DqQ5tFGVzbXde50oQXXCwcvAEyq2kkZFVBbdUktxl/POC06EWUg9aMOJqmkSxLe/vpKPeAqbryTzJNXvPPP/XfL/XEo+J/x+/Lt/6KLvhEMx3eo/kl6/zCiYDAqyyg8ENTQ0HEeMeAq04GWYEMs9MSjqihgBHe6Wc0P5SOpjFiCTdQqsAdlUiyWqQAprxQwGRVTDJAEwmhDkSBHTEM0D8mgHJCRpmqEcMuRx/B4HnIZcCmzRR1DKmcGPfjBUULpnWS43+EDnQslXufCpSK5iqd0dCneAIDAXJAaCpBIkkIwGLswN/cBRsDIVlLEayyOEQPqlos3nY6qFNXrX8vl5sd2Y8ynAu7ImulBZ9DflkSXWrXZp/63lRw1Tu/CX5ZmpyFsBEk4CWzAPD2I28FZuWTEeCESiGH+7WS2OK4GBZY9ShwjUnnFZRIRbQdJasWixLiCukaK1ZRmNnDKjOqV0UaJIFDBQBRQLHSWYzkzeIv5Qf6OCRqb3KGMkXJp4LEFt56fZIici6bUsna5Q4A7p9wBLgvBYM1meSaHIkfn2n9oFEREpSb8gx5j2eWF2fllEBLsdUB5iWcXlAzqOAobl1NG4SZrnMA8eTMgZWavkDyo+VAuIW0ANGYml4Z5qK2peKXPPVwWiQHG63xrodlnE7aPWgykYA/bEHz+LCanmdl/h0JhuKWGdIBpw9IxleoUEj6BF+l2Uxv7rXpC5VtBJ3ykz93MzmLUy37JkCim72tLtBuihhkdUyCukRz+wqO32+TnJ5krIFTmprFqjjC55h9PmItKRIMTNnpzaRkHmgT3YEN5O8D3e5Oxke5GN5GOQcQtyxZ02WevW5egXxBMAATENn67bhsKR2KosY4gt6AT4F8Lm/UOdkIZRedZ0oFCLiLaiBUgKbBf3AwoaAWC16wEGr4nJvPXTwL4Nres+fqrkT9Ep5bsKHdXHqLEwgD/o7gN0b2IwK7Z+S/bCXvaeXoRRLst+XADiR4iUnIxyI7W1+pS4LcPcothTzQZYODeFCXeJDMli30gs1PA4pTaPRTt/2jbmQCp2jWKGhznGUfCsG+2l4CbhgbekD+At0Bp5S4qX7RRdz2ZAkw/IOEjmusZDsdifj+lQtdc8k5Oo3oWbFmkdneiViTuk4eH3Hes5HsBTMT0zwFnYHLvvLLUFC70ABfLgSTPTqGeF3fPxDj5B+kAROzcBQKDohgfBWBmJqDrwnujHcVAtK2SULFAeYZ7Qs+83LlG7uKfHDQyi5sX3ZOJc148VoSvHeSSIA/TdE8pI1YPM6OWeCUAmI3uUfpiD6AMzUEoQA6ynZa/8IJAGDKg88ZHFphmPu6+kPq7RHpIATn3mfLcsE2UvCwE3B75bVT85y+MA9Df3ukE9SvK/gKD165wh9ZZlPR20D5oHZXSw3jp4fFINuyU9izD/cwGJyX40aldfsxKnOdxuGv70PF6YTRfD4EXb5s2CzChGmHyg9K9X7OaSIsKeUZaFe2EpURCe0kNNoFIAU3lwZC8yR04Mx45SFpv0hmgV/WjkiNtEZyHkVqRlZ1G+gi19L7vZvz9obSngjTf4ft9j2iFNVqQB3IMGDpp70foD3xfD7OsMvZ8XlZHSR5YRXW7QoSUj0YmeUkaoAks8fn6eNsgyzpiE7dKFp2q4G3sS5OEeM1sZI3kWIp/agY/0N/ac2I8YTD/fGnZQnSEq/vgmYdQ3Wj5rw+/ylWVtL4BrLH8e74xDQEzOozZtxrkIz4UV9WpmbJEwRrUDJ35Vyvp5VMMzWe81MJgzaxjBglN1mHfVoYe6pQTBaB41Ks4+TgPBLNP0VE59DLHVYRu0CtOEzQeb1M6CrFq8t5rSCJsR9NcpcAvEFvDeClWWZn31PAYq/fiLvujnNq2zH25By7A2LE+p0FKxEDVdP8DDorfp8a6IZB88tG7TI44FGUTpQDVCBVFQLTvVFQi/kUh9BrJjlyv9bLGRE+D7SRMByH+RUxg87ExzkaRS7wfiC8ajjSIBahtvpfbth5Qvx8HvrVBZTCgDmRPpjsCzF0Yig4sBhHAf8E1PYedg0O0RoRB5Avi44SlsG6CH2ZbTQsywPgkBQRw7UFp34oQ03msH2QGh5tnfb0GpCTDfNiw95kTIox8egS+QA+IdDTjRrOum1O1gAmaB4RzNYimieYCrunTh4Rm/KVqh8SoSkXbr6iJpgZwHGOfzf2mdBRBbql5/ChXq+V2JJE5r2yPIhjEGxNyvKGh5cD2fBL9/4wm2Op3q5cI9n2c4se0HkykGY7dKNutCkb5fqYimTfSYRehKp8Sxi2YFv4r6FKM8MPQpgbUL8XPjFzivq72d368x/dP8hor2169fPyajXzZQTt6P13XBatCmU4zelLtcLth8rP+kNdqw7yUEqIDP8xn0fVroGlTYG/ba2c+PD5DmyS/AzcfHB0D8lx+nmuL1fnu1FhSIxAYvvfx4Sf37xMVu9nX6XwEGAL7UsCPVcUyLAAAAAElFTkSuQmCC", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAClNJREFUeNpkmdmO3DYQRbVQUm9jGEbgR7/5//8myS84BuzJTHerN0m5xcO+Fhw9CGyKLNZya2PXp39/LMvSNM3tdtN7nufz+bzZbF5eXk6nU9/3mhy222qev3371nXddrdJKV3z07atvtZ1rWXj6fz29rbf7w+Hw/F4FB0NqqoathsRvFwuWqmNWqyBNm764efPn4/HQ5M6Syu1XXQ00DvWaZuoaOl2u9UicanBIz8aa4GW8oaPOT/6pLfmNRjHUVINwyC+oatJDaZpen19Fc3dbmc6DCRVnx+t0UGa0VtjPiWN0BYU9Q3pJbEGoqiz7/e7xlogLVbVop+aRE9aACGxlb9WUoze+soxWqk1IqgBZ+ktCvdrrMdKWimB+SQd6x1speeDAkRUu6rnY/n0jsVdC4tajJSoUOYTBY052+OuWuCVee3VEdooRqVdrKRJbOWNCaERRWP0Lyr6LDk0YA/S6Oeh28OHSHMAcBFgoKBHUjEOW9cV+kCFKFh6Sk1wo5VgDmBgd2aSFa79OhKFawVmZV5rREszgFcUYYuxPgnysIhSUbw2pr5DJQimRwPp6XIecS8dpxnAyqNDE7CFelj8etXZ6B89wXT4jkQchuvtAk8ADhNItnDSbAU8FJ8CwkiOc+gnawwPe6h4xXtEOSwFjwIHDgiK9Y1POm/IT5h1HOXMIqHYgWrxEgzU73b3MR74QDFztZi/Lj8aS+X77Q7sogvwClJDI49LHCBl6oPY0gd8Z7zEjDaIuliRqowYEQWC+on+NRi6Xgve39/F5YcPHySGfmrc9RE1AAn2wg5NeFHADp+D12A9BVSKETVCpfAemg9LBgjwZ/abdRTMRhBGHNFewItrR4BYKvwAvBoY06M4O1+JSgWyS51YDUQwP4Dd7beY3OAFJbg6NrIXh8MHujqFTauQaF4vvw5GsHV8Xr8BjwSJMci1TxGQkMkclwMyPIsJsvR6g63wuCZ8AtRP+SkL6gakgzAmw7ip5SDEthtyXCJE8ZtQBvTMK2ETDemrPANeCTmcp41aQxCRQNPTXeK8qvj8OvlohlTBdiKLgSGMpHVAB2cEpOvtV9LgjPDGzWbJJiORsZiQ3dahA7mh9Q3a2tTZFMQCUD+eT+t4ZvuUJEGUIg6xCKxcruUA/cTnwzqrnIo1WSwlDf0AESRkYySffsB2NhbyMzY3K7fQfJVAA0KDVmTaNluWkqdwk8jtmT/SlGakyDUQ7QSgAplhAkngiZiHw6ItC8PPpEiD28uJqKI4r2Crbje77dCHGsbzRawPmx4wQUuGxShTNT3mKUMhG6sNH9dMfQtJ0tDbOe63q87vNhHTpYnb5Q5BYXu/OUz3OCu0RfZwacUAPVlKw9POaIfHVwAKC4A2KXl+TCYLZeKOs9b0fOR8Yno75HDqkoZoy/GEEBvFtLKTLmaRHCCFEYfX9Qxchmz1DE94iWFOnq3/9+DRic/IR60I9bWHogCWKVUDEYxC/UiV4byGjoFUvRT4e9KmQNmuclHQ+XgKvZCbHVSwkam4+nP0b9rGD+JCF73CE9U2T1OVMsG6L3vrEsnsB+wik5ZUb+k5A17xOBfvJdl1vTsF8M5hpB1kWKtkmWZnw3WLcb9ebDgfQdAObZGMkcyVIfByODGKy0nPGG2wr5OxKaCDNu91lDL8jQQmiQtBKhUoJ5BIUBa8qCZQJhsgUaqr6Y4+IlQ+keRC2VEbggLcYbe3L685U9WKEzgPPsWeoyGjbKUDwXyKZMHBstCEaEFE1xx1KV00ryx0GUd1dppRFAi+o2qvlII0UOyJtkx+3rTd0N9Opz///ktW/vr16y+oPCaFAZlYcSx2ycGXiK4iVFK16y0CRmkNsnBIGbko1zNxfF2pNEVV4g9Nh8R1gwwomBIvep63CNGCitgCc5HO6/r93ze0q5pRJ2oNwCiBsHs+KN85UdqKiJzDhCNIWK2J7oqC/VkhxaMeygGWIEkKr5dZmv7y5YvYWjJNsogYjXIo20EDSniaADESkIe0o9k9P0OuHajl6RcYL/UC8AET7Lp04UgDLhyiWmBCk9+/f5dI+Mrjdicaiya1PD09hVb4EVWyPhO0YBEPdZP4C9FdS2Xh8poe3wGaCG5f0VuWRXJZv30+l8foLsjdbHYdEWkLZ8SIdXQhmdjPnbnmakbbBAXwG4xOJR6WwJPtK9PsDntr+vPnz1SwoqBy0nUUkBJxsVi20wA6Yfkm4ng8ur9b5wAleKpC9qMqQqFI3fLDeYjET6TFxDKT2Ora5DIEkFDnRD0rtiQQJSicshMusQiyuuolnNK/iyGuHmQd5T7o4NpgK9qy6QGwqGocHW0BUYOtctUz5wpvnh5N3Y/Xy+16+fjxY98Fo+qWPv3xiVbsei+9Zd9FeOurTn26+pwh/xRy9TO8NYsekfAZ9/HoaODmxdWvLKPGNa4zbtfb445XPS4T0aBum9N4jDiFW2lz9PIp4agAUFC1ZVGn3rtNqc/c/GALTtUu6Y8aiUoEwIE2IEuK+y3uu5EpBRKAIAhF5T+OkNNApqGBxppuQKyVKCOfPFF2g3SKJcDnNgv/xY6ESZcVvqFYcmoJOs59bqz18/X1Vfr0LY/rSa05vR85lX7fly109OQD4qRDhjHq+jHQ3XeGLPy5YoiOBoVbRFmBtLh/OWzy456M2IaS3aO6QiRqG7ncCTjy4ZIuy367NnJfVKAmbSknQFGs4KL4F1ksivHsO1zLWOdA2FHevR4A4IYHlyQDYhCIr4Mi3v3bZUSi9Hb96fAY6TO1AJZLEcj5ZoELIF8j4hOuUqSt6JRyK0vQR69OJNR8hDfXcL6nCNkUNqmWuNgQLUkpE+y3B8xM78p1Lc6IE1hJTGoLnHGSvFjz0rrTMKWsFpRioSrZdt0nskD1UrmkRFxCAy7GpTxqN0rocwjleJkkCT9QqbPMipzRT9TV+TIqJg3bTfSJS0E6MBBNbaEfodJXcfasKBe18lWTjUi94QLSdbf7xHX+CQFS5x6aPlsDLuUQd90AalLVqZscl8vwgec2qycskJIgVBov5wEz4TsSly7rex8yDzFPY0KoK3q7Vb42GSBLeHOiBLiIug5ypUUAub749wMVPAtoO8/jBECbIMkFJKEVYRwXuHr0bcz6On19n+vL6a6NXjWw7DbfISQGVdENOnCd2DatLYWjiKHw/+cB7gRLhJyK8wIS3+q654GO7/e4dE3rSzpbMHxzevge0D6MFvESQgD1E38cuRdyKwtW3Ak6IhDDHWbJp8QgeU+katyV7OHL0lzuLb/dpj4dqpztSx9RAJrGg0NlWD/fha7bfy0jBvni05FC88fz6eXlJVnhvhsu0OmSge+MS5fsv9f40yYKoWkS6tf9PkaJlH8622msNlKntoNIJz1qvmD3/cc//v8NIPs6nijqf7DIiRpIz/rK/1t2OmnXRem6Ymmb5P+2pCF6r8iPuTx010osDKma7AdrhbsqWqd6JsG1b37t5+CJDgc1ODuVWDgtLodQTKlZqpLvwRYbo0nOlP8TYAD8wdiTL7IMZAAAAABJRU5ErkJggg==", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABs9JREFUeNp8mVlW3EoQRB90gYdfL8X735bBYOCFdMUlSLVdHzoldQ05Rg598/Pnz8vl8vr6+vb2xuTl5SWTtdbrPvL95ubm9vb2v31kkgU888oWnhn5ko1PT0/39/d5fvv27fn5OV9yCOvzzLK7uztOyzxHZTHb8z0r2bIGWSEik6y+2QdkZXBQ1kONr7kpz8fHR1bmYyaw9+fPH3jgC3QwcrdkuT4jJ2xk3e6Ds8Yk4+Z98F0S/egcRpnkjhAamnLO3T48EyLWPqCGNUhRFS3p7QFn0pFny0C+VUqeYdHFSCJkIVTOR4mo5cw5a2R1eX0PfvvvfUiZi5n0l9gHKoBjJBTb+vXrl1t6hGi4Ql1qEOPZlBieMkNsUMNHxaZ5ypaq9/X3799KMcbOxeiRNZ7Depkf0mIspaKBM886VemvfdB4RUg4Ab4J9yGRE3hFidpAuxrzGECYWW9/Ga81WqFD185zq8ahteHRSlTXOUsLQaiEy48fP7JfS8wkxEYjaAF3zdIwDa8Ql1fgTSeIkI4TL5f8CvKxWDRhAQAEdnz58iUTPZHJ5qoxVfeoDrhsZcMHktMUMEoGJqzS4VDfPI94QxaErBz19etXDswrW5b6HrD59vfRBtdG2Qy03ntovg8PD1gIxpcnikJ1q/28z2qP+6T1XULNhijKgog/R6uOTARJTRuFoMTszRMCspfFq4Ndh478jBEwB5oNZwMSNURIBCAwRGMiAIRmMDtIBLF0L8R2eHVf0KtFPN27Iy50QJA2Grrv9yFZQKBQiVEiyxHiPiLviDMdTbn49fOQrI5ReQbN1SkcIxgl5GJ+CjM8X94HP+G2R8jUWqUdW4FRFHdofS11jYT0R9bHrVCTqhGlIFGfaKxqbNs8EQjhxahkWgJDG+yuFTCDvhYbuIxQsybzfAfVWn2IClkiGJ64oTCZ85/3sRSgsGSgULBGD0GByxA4LCXfGpHgaoLgAKKgGw/ImnwEh49QPfAzi6ILMpM8IZpXsdtD2ZUTdVUoZhAkWCa4mHh2HqU5boRidPo/2s2XcD/I4oLv378jcBEcG4giOCGvUQ0KRZwNwgarM0SDpZjBOsdgs2GdwOAqUmjC6qgzLSNYRshtk+9E2WONFpxz6LEv0DtMw5UWtgW5Ar0yICZinczxmM65BziNGNqELjyO1fAB1pFeOiQX4jrp6O3ah7DnynZhEYFdMNlVxjJ9U4wDQlrC2GwnysgGoapE4U3lQhaWrslezShZGTR60Hh3PvJzLOD1nNF3FBd4tUXwJYSKVa1lZNwhznRIPk3LNiVyiiIFMhCMybsJxdXUu5cN1s9ZvKls5yM6FrF1I2s4YGdwPBv6rbGuejhbNLKRnHngubhqwzjyFy1ppDcAbFsVV3boYCW2ZYSReqHknDziKKa4Bm9jzDJF6W1xn73s+0gWtIOudUe1eH526txMdp03LPjIIIb6e6kyaJNSilpkdwmMOeYFktUe3dS42JM3OE3sQx6HZ+4mT4wTc7mPnZYSVx27cxVvNfk2jxi72kUIWYswpF6AokSMy+XOgsxyVDRqBXUi2R+tZoXA4VVNaENxvifyRG4Rw+17CcS9W6FmFEcvto1GgaQALBVTbJkk2nuyq2OvyrhnopEFlBtL5oSi4TVnIq4OQucoDKGpd6ksePZk230HJ+eyfXjlUMFYP9Q3orjkjjaHKlYKhstD9efaY9iBlP1bWjrUSA0IlJ3YdBHKRqsBc8zVjtPjXAkOjBnh0qNH6qYhd4Vs/NFFqBg+zHTQNGxoqLUNrtO30ZeTDlKg0UkYPstPndJsZA2/lb+rKat0nFsP7ZINmCPGe767IuY4INJi/mFbV235LLBzh8PviLyVbg09SmqLP7PZlh9916OyU99gj70Ay1zjLp5li6BFS3e5mxGBriAziJjaxBBOpn+Op3rJMsES5e2bdZraVmVCayuBydWg1B0e/J82JHK1RLVcpf75FKrNWOTY5OLcQelG5oDf7kGeG9iSayZtDgfQb/kW9Yk0QUekBRAb/4fW/tHpO5tjF1R2pjpr4i7iz/EvhtGRT3REPKVrtc6tz8mjDfCRbLUNWN4MTBlSh+7lBQ3oAxFGm2mEnZEANtZgD5h55xo2CuwLWahtUbyRzVYYJn/GPdM9X+VSoTYmncnVtugYEp6hm3Mi9Y0HWjn6y/hnQS1Y3tgL7VZ7d3tGSCVR6XaGerS2s2fG+UcDXBwC+OmzWSPYeDGp72qCi8Ob5Pp/GJOjZFgLKAexMOLHx8eu/xT5tv5voRSd4ozW+Ajf/kArzq4L3gCufvoHYAdbQedpH7SW3WvX+X8BBgAdQTe+hA31AQAAAABJRU5ErkJggg==", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABlZJREFUeNp0mclS3EAQRDGIzeH//0pOEIHN7tK88SMjW9aBEN2t6lqzlvnx9PT0/v7++fl5eXn59fX18fFxcXFxdXU1KxfxfJ0etnif89u2zcp8MhTm5ce/x094yfUhy+fz71CYb9/e3mb95uYGBob+/Ltx/RzydHFTdIeVj9MzHw43Q2vWZ1E6PJCav4ficT1b19fXrM+/8wl62e9QDuj6nrS43vuQDFpuybqyzYukVB4PqkLO2cJivJ+1NYxzH6dhS2NJlMtG55enRxGh7oqk0oIaJE28qoB7d7ZKiCQnrfQtVO27RMul/JdrPJPGReWjJ2yKaiG4sYddVm2n6HCGmxMckEjlHQq2sosP6QkwAFv39/ffbBlic5pDmKY4g4kMpdVMK2fyVLtnxZzk5OTw8PLycmYLVlJbumrFvLvzIAZqHwpQzwOGSLEFNe6dvwMNuKzocHb52ZZNNrgV5uCYMAYaWMEtttMzRMELYxbXmS1IcQBJ5thQ48DQnHsz2uZ9GN24WOsgSsIVJsOmHmZXaFAeAgJqBlphIdcPo0k/7f7nz58tb5KWnOlJsuWthWfFKBKqpxTGCK3rtPtuhP9huk5tukiwSbcziFJofMCL0wh4pLCuwnju7u7GxJsfJCClQdPl15WEtBQdaoJTsa5jZQjz1e/fv3cYQh+H+SHDJ6mX3KZYtoQYrh//TZflwzlDDFVgzvvg1th9O8z8Klm5S4VcKbYBE0LMSi2tCShSOOiRGnECc0+O6l9cTYYEiML99Rk/xYs5j/Iyz1SW9DoPc9fQ2QFC9oUZ/s1KgfTC9abqq9PDrSK1KQ8snPWJdvRNVAK8oAnohdZ5ma2hvEeizqixtIiFoWWTCoAQfCPr0Kpaj5U18WW8Y1yLHLPLlk6A07GhYuWj6qqUwSs9AxHLPd1LwMuqs+L6uLBJ3yyFzb+vr69aENNwhvX6PONDD6vClXXRkQjdqt4oCDAA/ezXr18U78OHDovF18SldaDASSENJ1avCHkuWVcwLIBN/5j14cYt1YbvV7WelDWZ7Ylqzkj/Zsu7E2ZQAxoy1JVeN+f8xNfwmohQFrBcEXSyIs84sOPYDtsSuEmtiG34WWZW0AHgQAeHVXLW2cRp3ihAArPbmp5M48aU3dG8DNZRshmh8zIiopIEZG6aLdGEk6o8oZiSbiQcxX/D6ersXJNeJWdrAs3FTBsV3Yl/GVKuIOQOuVmPZ41btVtyUKjIIpFYReLab1XJoMty6ajt9vZ2h/vM7Wu5Ut2YCKmGoGizXwW7lUxmUnF1hUxS9RnlK5hTydlzmllTWybNHCvo3U4DCgsz0tdSb3eytUQsgM7Kovqf5LWA5rDlTBgCgXNSwnNGadM72VtChlJlrgL9rHwSX9BcVWCJdln7p59MGO7MZNzlgEWAyICCAyFRZ69aTTWnnEq1aqigdY+qx8dHpiVs47zkExCLBn/sbf9TvVqW5+UMcAZuZSNOM0jih/KUZfSxpPxNmWz37Jh5l5Usfg4dKGsEeS3H8jDV7JoJSBWbKq3hnbVirmc/vvpclVMco01d12nBK+QFto2KoO6mqaeGLlQzyx4mq6ojDi2u2FWX5uxjs7RNxMKrKnPpsJVk0kA18lSLBY05eMoGTvfYsu+u3Fxjywz4FclKi1q/hjbK4I0EGeNJW86txPV94sK+Q3FztFfl3ue/p/RBoNVMRqgbgrCV1jxrS1SsqV8Oxo1w284qlX7+/JljpnW2mDOczNmV387MPTw8iBECVc0814QqWmbX4AAsZ4s0+zUtqpmgerKj2Q4HMt9cL2PttfNOv0mvz1KskmONhvUzXs7J5zBDr+NrX7KEqjit6iPnLtXtJYbXoGt3oeQjxz3+uFB/c4i//jDhoMCbUlt5F6Gny2oBktLG9tqTrQxVwKuekqpG+fZqJUl95crz8/PetiRg5ukc9CQJY6LK3+yS8z1bj3zAhRrf2zttq6OUk/2vqC+5axJmaAs9ZZAsG6so331LWlUqTalfhUAaZf3hIxNI9tlZgJStzUv5Iw293VlpjoTv7u78ldB2mWzPxfOZDE07MAeYR8w6/eNsvZweB/fclAUqs7UEatz8+vQMtfOYa06PeuBmVrNjzp85+DGxMFpEHaDH+Sghh0vucHZiVUi5V3UYwnP+rwADAN6ZnhHCe04NAAAAAElFTkSuQmCC", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAE0pJREFUeNo8mVlsVdd6x/c+e5959Dk+Ho5njG08AZchIYloGkhEm6SB5uHm5aa6La1Stbq6adVIVdW39qVSW6m60Ic+ZJCiDKhNQiCRAomIIAGMTRwwBo6xsY1nH595Hnd/a6+qW9bWPmuv9Q3/7/9961vb6oXz3+7Zs8disaRSKV3Xw+Gw1+tNp9OGaikUCrVarbW1NR6P1+t1h8OxsbER6euxWjR+aoby2X//z8527PgLL7B8M72TzWbtdjtrx8bGurq6EokEotwO59LSktu8UGEYRigUampqyhfLW1tbvb29Dx8+TCaTkUhEVVWPx9NQjEAgoP3Jm39ms9kY4gfS5+fnma1pWr1hoGNlZeXDDz+sVqvDw8ONRmNgoK9WN5BSq1Qr5fJcNGqz2jo6O3l2et0YMT4+jhuVSmV7exsLdu3aNXVrMp/Pt7W1IRM/XS4XzvNgszusVivuNTc3O53Ob775ZnZ2FmcUVeWn9td/9VvMZyXGIVGorNVwolAssvj7778/e/bs4ODgkSNHNjc3a7WGoSqaamGOzWodGx8/cOCAVdeDoZDT6wIPdPt8PvThEpA8ePAgl81mMplisdjX17e4uDg9Pb17927ebm5t83ZiYoLnzs5O4OAn6IwMD1crVe25Z38fIxBEgBRFCQaDLS0taNWtVhT4/X6UPf/88zyUSiUMVRoNi6ryBx47OzulcglPOrs6V9ZWHj9+zFqgIuhggDQAK+TzSIMbcAAn0UKIeTVzb/bMmTMIxDEg7O/vB2kscbkdhtLQjr1wgknSRcJEvHjAP4LIM34AFXd4EzSvQi7vcjobhsEI2OBfPBEPt4Qzucz6+jo+wA+WYxzwY1xPVzd3nmEINIIhCESOP9CEQa+88grkWV5eJrJMYGY+n8NK9aepB8wGZH4MDAxgCqjidN1QIBZeMhspFfPi2a5Z5+bmmkJBX8APWs0tLQxm8zmjUSuXyyCHx4CEh5g4MzOTTiQRAtL79+/Hpu+++27v3r1wLhRuZVoul0P1nTt3eMB0kk9TDUZ0FmMK6bO6uor3HR0dmMWDCLCmAQm0A2rGWYn0hQdRh8vFHIjIYCaXS2XSGKEYdbIJ1FmCQIhF3jGNQQxlHHbD6DfeeIO3KI3FYuBE3LFmZGQEjDEaqqQS2/F4THvx+B+A1ssvv3z8+HHMx2MyAABqZkUAW8QxDrwgQbIkd+Lk3eTUVLFU6untVTQLTKoZDa/bxaq1tbUd84JDiAIVzWLBaPzhjqEYTaIhkyBiB3Yzh5nhcEhRVN5aVINYWfAGVBGULxZweebh/Vy5qFg1RWlUKiWbTbfbSSvr4uJCsZgfHh7KVQrfXbuSzqfbIhSCUq1U9LtdmVismMvqquKw6ppi8DwffZhNJRkhT548WSoUchaLEo0+uHNnemnpcb1eTSfjtUrJqFeT8VilVNhYWwsGfC3NQWADBe2ZI793+fLlffv2DY8Mut3e5pYwrlAJW1taiDFI4BCYkxYskBWO2EEUwgQdKZUwj5xYXV2xmskLGNQCqoDMROKCECKOHAoEKAAP8svlyuTkJKKYD1m95gV+Pp9X1K13/u4fAB81VpsdnDVd585io944d+4cDCWf0UqSE1PU7N07GggEQRfAuUejUUIDS8Lhlmh0bmrqtt8vnhcXl3K5fHd3Tzqd4c9udzidLl41N4dTqfT2dqy9vZ1gQTtQgLtYj93Ir1TKGK3j39GjR9EK5UEimUnDLVi5tb5BfUM3Tou9yDAkVMvLq0+IytISQkmxoaEhvOIVLo6OjiJa7mM184K1vf27RsbHSJfVDVE+tnZi0A43sAYJPAM56FJTWAU1oYrYCUAY8NkcWpoCWOPyejAUOx49egQTGUclCoAQa7ADV7788ktWMq27uxs7WI4QygfPlCImkBz4gwSmDY0Mky68xW0GWUXeMa4pKiHDFLhBJWICRIIYwWAA57X/PPtfGEHU8oU8djhcTuKCc6qisBgRsESmN64DCT+x/sSJE1Dh3r17YAkGCCoUSoah2GzYRrSdgUBTS0trJNLhcnt0zVqr1nnFIG9xvFKu2qw66YkQfAY2SiZFdWpq6tq1q8SXzef5hYUFXlO4xW6taz/88ANgnjp5ku0ZOlMS79+/zwSshAG3bt3CS17hKA5ADoDESzAiRdCE9+BH0HEGc1VdQ7JCkjod7Jq5fK5aq6kWS6mQBw52MEoXrgB83rxIHWKiy9xBpdVuI8DUIeiPdCxDK2uoVehgKlnD9sLI119/jbn4RCp89tlnDJ4+fbqvr5/wgRwLAZvJPONnsVrBXMPcrDASRQwyAV34j7cHDx7EMUgGKfEZjt24cUPv6dtFILAM9dyZ1xJqoYpWG1VMtDkd+w78QuRuwJ/KZixW/cTLJ/Yd2Afyw2PDKKsrdVVXucdT8faOdgBIpBOUA7fPje7p69Pt4e7W1rDb5dS98KJRb5QL2Z0qBXlyEpCefvrpwcGB9fWNrNlosF2ynAioly/fwAORI1tbEFxskyrrlVwxh9+wlUHAAy2WEf6bN6+zJYAT+EM4LHA6HZubW+xSrGJELod/mH779m1LQ3vttdd0q4bF7OwUVSiBrqGhYTiIXqDCJgktirbj22KbAWEUo4bWgrggV7YGsgrwVjYXRF3sGH5/UxNbEzuS4XC4uM/PP67VDPor1iKHyfAMs+ArMYWCTpdeLGV2djZ3drYdgl1+v6/ZYfcyGYJfvHiR8JGGuEHKsxD5mmbVZbEmB4lgIOCs1XxV82L8iy++YB6icZSfcJkyjX3gJPscgMF6YiE3csoE1gASbkAD8gvdkbZQqZy3WPBUQ/1c9FF7e0dXV59urVPn7t69i2okACGhoHSzEKU6KQCMkoyxWAahZtOTxwiSljtOY6VUSR+HQRiKlcAO5YCZKgWQWIAQ3uIDEtAEDMyhxrOQutDV2QcXGaQIhkLhnfgaRQ6MKfE0NtevX5duwGbRxm1t5SkBWNbT04NuOASY9LIwmjWyhUIHjl67do0J42P7SFXsUMzCxgg+EFybnU3djleEHhaKzslkQqSVjWjxp59+6u8fiEQ6EagqooGrNyqXLl1i/NSpUxRS2TUJlntFG6ydOvVLGUGGxGZkdolEwe11W81LNS9oCAZU10h7BwbhIqVZgJHJ8BYJsZ3tjz76iIdnnnkGdPGTJcDjcnhHRgYdTi8bJYkbCHgNpV6pQFk/En788UeYzuaNe3CDXoaGh4qozswsghNqYDetmeyD2aSSmaTcsMAW89GEBYiolAUeHDfIMiDhaEAyAnCkow2kmUB+4R4LcRWZuVR5z57BjY21VDpJexMM+WhdCevI8D4YiRzZUrME+fSJLo+PWGm//vWfu92uhYX5iYmbXq+n0cAhv81mpX1LJZPrq2sOm/1RdK4pEFhdWUnE46FwqFwueX2e/fv35fLZ7p6uvXvHz5//wu2wh0Mht8vd3trW0R5ZX9vQVK3J37S5ter3s896kkkRirbWSFNTc1dXr9/r4/ShGApLlpeWdU0fHBjY3Ni0Oqxuj0u9e1ccDGH3hQsXYM/Jkyefe+45+CSPLrJ/B1XBCVUFOSgJBoTPrEMaJIVbUCS+TSkags5UO7OAGbwyDzw2kEMO80GdYCGQYCkN4+bNm/yU7QO5RfIhuaO3m6CpDx8+Yfeg3sADVlJhyTKkkFMQGQrLIyStFbYyc2DPEIRlDoYSWTTBP9G4KQb6EokU7RCraAKYwAiNCvrIHlSQE0ggXuIYUm/wDH4sZ0PDB2IqGq/mIAt1dPNONEa9vfQRZATuYgprKLDAAzBMgH8o4620BqPlfsxybCKXd7Y2mRkOtx46dCgcbo7FEsiBdh6P6PHhEO0GkxmRBz4m9/SJ8yn74MTkrcOHD3f39oRbW2j4RNvzq1/9KbNhN5CCFmBiEDmC0/KgJ/LCPIDLcxydCzY1zAsIeQXHcYMEpsHKZLIAyfGW+okooryxsS6XMw19yGRQFnBiLb3COMguuphGA/TE1xDSGDUE+P93NPKLGLMY/PAJ+4ANnMAGbbpdyGUCocQs8hEgRUdkNJ566ineoxIri8WyPKMjUJ4ZuaABpZxxtmQOS0wzEvHWSPuzfp/cA0ARUKgaFsW8sJcIIh3MAF+eV4kd1MFWwCMKMAMFOA1m8AMFOAohGCThwRuCI4oEEkfteJyoIQGxOIMc7mADh7hLJsizDHfkMAFXeQYCqr92+vRfym4YEZiCT9TM6elpjEMimDMCJKwBZ+6pdJo743gC8xgEc56HBgfMD0kORH/11VdXr15DNzRHHSoRAtjYKgOHhxnzYAx+QIBAWM9CQoeJVFc2nyyEZQE7AH5THs08rxUrRYJtGGpnZwfn6nyuKPeAgM8jPwARVn6imOoMnzaWlwvlEgElHHfvzfDKbp5+fb4AiMpmX+6wMsqbsW2aLYu5h4M0OYjMd999t6e94/XXX9eOHTsBboQGZbRmH3/8MbJo2D0+D4aTvwsLjwlHR0cnunHL6bADFWGVbEMB+sAglUoCntj1NQvqW81mCQsaDVF3RAURXxIYbC6VKB8qSSdN4Z42I8AZhIo10L8be7SxsV9AVZCUK9FNd0EaT9+ZRijO/Pzzz1CHw4IMHLhRTWAhlkEjBjl8woHB3YNer29tfYOWsFar50SACG9abupEhwcyAa5iumhSigUCB8Oc5kVkGTxy5Mjg8B6rw65euTJBicdveW6mFaCbEqmez0AOOjIUg+XQoPgaCDDFfJZMMWf6sYZsJQSwSlctbKuS3cHmEMEl11jo94hPnnADOfILKBAQU8OiynyHdkKs2e/LPg/8LEBNOHghThlWay5XxybgoS4TIHRANfwgbyGcJCymsB6yU74ZJDNA7vK337IFER1fwC++EqSS2IQR4nuk2XZyRzEcxyZgli0Gl6xn+Al5WEiNoO6ITOQda2TtxhTMx9ZIRwQrzXO6XVis2zAIrblsRrYiMAllmEUXTNrbbY4Q4PX10cBsbscmJ6fcHq/H43WYYIsTqMPBctiDh+LoVinjvNygiK/8zoOfWkN8BNV+85u/ldVIfjCSkRIfIy2KmThJ2R9z/pSfSTh2ggEo4jdqcEbWYT8dt9m0KRYL90xOlHvEriwvkzHvvfee/HyKqywX6hoNgBEnXacTIdQj2eRotQYbBo3NX3z66ac4Ib/MEGzza1PY6Xaa4BXc4lTgf7ywSJ4y0t7WynrYKg+9IAd1sJicNTNXfzQ/D9g9vT0AD6UWF+bBFcvGx8chHMeKXvNSzK4OCajDViKG8yxXK/WvLl7U3vn7fyQpOGu0trc1BYMPog9xuVqvVUsVm9VmUdV8Nsduz8DG+loqmfD6mwJNwYahjI6NF4qlR/MLXh8dJU2wQQmiVuEqlFiYX5i9N5uIJ0b37o10dr7yR68Nj44uLi8bqtrd21cokUwWbKKjBDDqOQ4QAUpDdWfxyqUvxce+o0eP4jRIEkRYIitybHOL2sg8igXA4MqLL74IHob6f18uQVduDDy0tTUnk+LjJ7WDFKG9fP/999966y2ApIvMZbKqoZAZ46NjovXQdDOIVWiABJCGVTKv4UOmaDnw9DHt1B//0mKygSGUybOUoEu1hq3y+xH1R6YMgjTdiim8wlf50QaKzMzM8otx+bkGD3GGdlJsUMEQ++7EjZvcbUhuNDwu99rKKtzlLXLK5kWRAgXAm7h1N57Oa//0z/8Cn+S3KxgAb+SZoqujkzs/SQLWy4/y4sNVvcGmyRLZ/WEKr+Rxr1qtyLZMpwUW23yRdqZRLZ8587t//7d/9Xk9wabA3FyU/eDwoYOlasUssHlZS+UuREW8fWfGypnst3/zDpsaLmIZOuTRj0nwiWf8BmGSiHDIBOzu6QVadAMMoKpmb8XJkbS9evXqJ598gmVAS/9N3LHVpmvEFESh+fnz5z/44AP8AZuV9TXxHyHOEeanBoQgAYHZYrZYLqj3o09IK9azVYM8kBA4DE3EdrAJeIiU/AiAXJjx440JdifAxyBYhSAkUujtDit9B2cyTHzzzTcZh0z0aomtGBmHfNz4/PPPcezVV19FYLqQY4IoJZkMwhHCHOx7OHePaKjReXEi0M2LSkOt47X4ZBhPwPRoNPrSSy9hB+MsRtx//O4sM99++23AB0hqfcm8rDbRjjKHPgwH5DdwWJxKJVCDn9QXGkzsuHLlCmlx8OBh5HOyZZXsFllIi1Az+0ft0OFnwZzokkTQSG7YbCZQ/tixYzKmDGKr+JdEOt3WHjl37hyQjI4OU9WIO6+oTJwL2VLkPyNwXYYemf0D/bAmnognU8nOrq5EMjF1+3ZHZ6diiOjLeim2LPMbHSaG/C1379xT5+fXIRboyXJKECXHUYYTLAMbZst/BZApbW0R8kB+4eEVhoIo1RlHiTgUloVbfvCYnZ3Vbfb21pZykQMwx/xGvVq2ahrUvHDpMrv1iRN/CPXjySSFqVAiwYNBv020CFR5CIijtDvAppkXlsEw1KCPBxJNNq7m/8nKnG3kbo90eV4AfyZATfCX/61gITKhIEcGv8+38oRj35pmUculYjaTEZ88+gWKu3b1NzeHyVv8SSRTu3cP2HSRRv8rwACeH6Q1grmypQAAAABJRU5ErkJggg==", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB8JJREFUeNpkmdlWIzEMREkwO/n/T+QRDvvOlPuGm5rGDxzj9iJLpZLkbG5ubrbb7c/Svr+/8/f4+Pjo6Cj9r6+vy8vL9/f3DH5+fqb/8fGRwUx4eXkZY5ydneXfo6Wlc3Fxka1eX18zLV/Tz+DJyUn6WZ45n0vLqs1mk8kPDw85JV+zfyZnMF9PT0/ZfCAELRvlW+ZlWcbTyV/kzmH8i+g5L50IkR3Oz885NTvkb+Zn8HhpP79ts7R8YofcNv1MyGAOzebbpWWHjIy3tzd6HI/sm9/GLbM4n9LP1wyiVJZwmXQcz3U5DN1wbSYgJapFQ3zCPmnodUqXS3MtjmF3DlBDXItl7KU0LM9eWYis6AlI9B04BcVrekTPuJfZaweVqj0AoRzYHnG9KF+RjIspFihkz4zHuPf394jFfUAIsjKNDelrpfH09BSVZH2mcqHIEdlbiEzwchkBTJkfAGQwk8EHquJiLNS+LEdu9ME+ET1znp+fMSUyzQknS0OHLNaCaBFUYQWUh9eIVs5Gc2NpYjHnteHwCaRHu0iGNOkowIjHZSWuJPYBLDdDZ6okM6EJUIVYyE1HFKsknQOxshBFsj8KQz6gPG+YXpaFKjggdkHq7BuCyUg+7XY7TJm/d3d3WXl9fY16MicTkFgIZpMQBxIgjQbKrRAL9np8fAx7ob9MgxamwtEzqmYlCgccURJkxr+gKoNMRhnbahhUUmhXsLEh83GXvYa2WyA7YYfsHMOQ7Id6MCjLQIPEQ+NKhgphh1c2R3gZ6VSQETxwhak8proj89KiT5lX8sTiiKVnIERzrHsaxOQ8HSti4R/omAYYYt/xlzMap5q1R7CUsGUCd5DtpHXpTYFwSbXuiTLo1M7qeP0FyKPVle1pUjlz9GI9GqsxrSMVYsVpgKz2laWn0MYBL6RW6YAPbqavAQVNL8LU64EYf4MVVKwiubxGQE8Beow7IX91deUCRDGmkiDka5TERlmDKxBQVRKglMRFtyyK3JiMCyS6GAr1fZlvQCqYA7wjL04XO6LCDvhwqexM+BMlHSRyAbhav8NpyIsyng6XZB/YbjoCHoHCTIDSeV+a5oDZWyyVD/fqpHoP481YOimO2dgyjrHzIKp8VzPdI5pGYVADCuP4hjDqwbP+YqsZTvti02yF6+iVuuQAHNKg9gr7t5NGemimAyWHYb5YhL7BTrz3NcS7/qED0tljyy0aGQpHgNMihjnBHkFVWAtk9tYxQBVwJW2KWxi1pu5b4VgQJyCXdxcTKSabmgIRooJe2abUcAbWFtoYhQVluIGPYGxzbSCVkzqHZIJEqjq5tImQ4bVDQourNHbQutF9oo1Q3RmfiIm76vxmEEY31M4neUt7KQqgMbY06rv0IJvKnqRYBx4HRpmRepA0y8QmBoWE0HaYkLSMtWROCEdqoLcieraSLMCJqOAmJlvp5/Q50pGyqQjx+6JwRKIC0nAk9JsdE+NQ2CplcAQgmnSo6VanScDo6N0E4+x9SF+grTch08xAloua7EpmDXYxzmRBaeLKNZxz4CEdoam8MyG9IbqBYBkUKIReaazh3H0zRIToAgRFZP8JeYvMroylHGaTS+l98DJmZWFDhxqGpwDZyJ073UUvqAMtqqahyVQ4hqM2lPfEDVIyLa5KUaRzmCxwpUaSF+hXCU0sliioDnSqObhHjuwUhYKWNwyQBIfBIOZ6RA+zia476Pj6YGzgCLBrmBkrLjYj0BBCGD1RpekEPpyEBbQjDdezVuMr6kwAVUrSYLG7Lx1ub29TrJHrwZzEUYnYAsY4Su4hGjg4HBHuIAXSTKCHrxGCbAUMmE8jMbxlBToMkJ19q0zLB+iAkBBnQVDfUQjY/ZLTmaBUblIunozxhvn9C5nZn+zAMkgSW1BrkDTjDWSI+IFwAXkGbJM79IGtj/5vLRDXw/TDQAEXeFICTowbxKz4BlW73krGi7brGDy6rBISqkMtcue5P6xozFmVoJpSZ45YPss0Xzunhfj50yRnJfYJUuI8PPpYHBtwyP54cTCt8MUHkMquKMBxBWqArrRCBWseseL9rTdbhWqxT61BZPDVoFnngNNfo/jiunpO8rFDy7T0ijGrHuORMrW2TYagmaiQwlrH9ulWdYJxlnAGxNt5uWzX/G7RkDJiz8Lm+f0MhI1IgKjgOB5tEXMynoVhrKyKiwSwIR4e6JHYVDZLqEAViDfO/AvjANy0Wc5Yl5r/exvTVGTVGc3xey0/HZAG+jTfkadNgTqNUQCDZ1hOGYjf6RiCN1CMvorVtmAJW1uBEal0OqvWLgZ9mSLl1FaTIMx6jabm0KvcyIClHZHDdNQnRfG64p3OHQAoeiUP4GWAXH5Ybq/SVEFgiGhOgtNXL9Odolgh8pORwd4kUZY2blqSzMDTrwZeurlEJPme069wjANb9eePHc04HW18fPN1yBdUasGtaZOvD7CiFRKnIlA/o/UzhPm45ORvC50B/H28lI0tWEDk6NoG5FrUUzvwGtavmPb7VRcn8oGq43cnJp7FtU+XRinG0WGcrRABervdjuKE7DSLM5IJ8Fs/Q3AzEimfuPglEdPgYpkQSstfQgUVWIgNDSEHM/lpTe3uH5J8tmtAYHiSdAsyXzJUQKtNsDeWu5po4He9JFGjzn8CDADdTKgo2oIe5AAAAABJRU5ErkJggg==", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADYFJREFUeNo82VernNcVxnGdGXXJ6r33XgzG+jKxY4eQkIvUixACIeTDBXIhJIzKUT3qVpesZhWr5ffOH85cDO/sd5VnPWvttctMzVyaXrFixd27d5cuXfrp06enT58uWbJk48aNFy5cOHTo0OvXr1+8eGHk5cuXHz9+3LRp0/3793/55Zc9e/Zcv36d/BdffPHgwYPly5evX79+ZmZm586dT548GY1GP//8s+/xeLxo0aJ58+axs2rVqnfv3t27d4+wt58/f2bkypUr69atmz9/vnEA3rx5A8C2bdumzv1w6u3bt3RIG4XAi0ePHq1evZrXhQsXkmaOlTlz5sDkYfv27aBMTU0xB66fIMI6d+5c8q9evdq6dSsjnlnjD3RvgWNnw4YNdLds2fL48WNYhcr11atXQXz//j0LYGBk5AdlIOhAIz7PK1euZMiIn9zz5Cd8xhnCh8E1a9YsXrxYJCzs2LFj2bJl5EVIHf0fPnwwTgaL3PspKph8J+aZup8//fSTwNauXcvm8+fPgUH5SEyU/RYf99euXUOAZJEGnJrgjD979oyMyHBe0DwZQR4VCDCPXZigRyoogrx58yZJwUglL8gwQljuGNy8eTO+cSkqpqgbPH36tMEptcUNx8LFhDjib9a32uJbCjBn0CvWwWXCWwVkxLMYBMYTU0rHIDvEUAKTUCH+8ccfybPGFDGphEYd37lzhzBJg2zyNdSWROCQAgSE+CDHSpluHiyffBDTDOCPCn12xcorAshzKYPoER5FgZkHCgCOBQsWwMe3apM1AphjxyuS/IJhcN++fTdu3BhhSPoZglfivPAsjqZSxHjFMWXjkl5+sUvAKynzU96rG+OyoKJv377NmuRyHEPy+GzyURi80KIusL1790ql2iLWnB0pBfGhx29uzpw5c+vWLUz4SdO34PhTKCYITWmihktiJiAVzcUrNcexoAl7lYNLly4BKmzBU0EDhoQnEo6Ywt+RI0eYlQekYvTixYtSOXXv9g1DwALx8OFDJFenIkYMfeZ4IiCVeCIACn187N69Gx8YrWhE6LnwqIu2LgBH1EoThkDkS0iEK/kAEfs8+QzWODbEATUupemrr76iD4HXoteEwBLBwYMH620IUGHHjh1jl5jUaLyevZIRMpoQ62QUSs1CSbCgCuUBHwwePny4Bk4MW4B6hg8LxEZhCgRlBcHKrl27SItDvlD4ZvJRvBQA5dKDoGn55sZbzQYyrHBgXLRqCPEsFJiAZRlJEqe2qDCFbJhgFaryFZWmyMKoaam2ZrtDFVMV167EYdIpFOYIYJ5paOADXRigs8sULfKqralHXhI5RoySMM43lAJQjvxCgB5hNCuJyfvly5enbly9hKehsU6KVzoUozJXpzXxAwcOCL1Sm56eJgYucDU2ugS491DDFJsHikCjgU2gTQj4GFTmlhpTDxTTyAjLgqdCni4Kz58/PzIEssgYIiF3dKA0LhopaDWUX6alGw3M4c/Mb1Vha9Pk44Ewu1JZRvAEOiMZRwwBzygxrnuR4Ygpr1IhoIiH2pL1J5OPikMgNJDhk4M2F/x5JWu1tLofTKw0pcmgQaIBKnecodMcxx9h+CpKyZJ3/KlUcHmhIlQ9hcGsKaepKxfOgU+t3QsdGaRgBMOagm9yigbu5jD3BrlUJXEJVg1WomUzgdojm7wa57J9hCChgTsKpY8KAYRhMRgjkQl62eTDkExx9nzykSyARNmCiPMFkw9btMxw6PkwK1UkSeFyxvr+/fuJUVEMHtrAcOaZfc9qTuKkRZy+5UTixCA2PQWy8XfffsMosE1AtcJZXZ5QRabk1RyjIHowIpVIEiWelF31BCKyRe9BUto/Ae1BhEyRQT8XJj4XVYJJDRYVRPiJUWU6/s+//+WFlCsF2L3GJASU+fCT75pvFe2D1DalIIpE9GpF2QEqUHaNs4ZUbmgZZ82rQsK9kbaHPOZLhbRlJUBy2NiQRjj4+CSq6jnDGU+ibB6phoJu2wMKJtqxaCW2D/iuhnxjpf1J65IREAFtTlDRrs+dG2qafD2Fl1Q4HXYQYHIjtfVS+pYO3+1IlQJKKVQQZrX4qmJTr3kg9C+//FJJvZh82gJ5kJRy6kFOwWrXwAIWrV1BrGw4apMHmZ/jP/z+dxyjoSpBo0kEgVQyIZr2kwx5y7cRAagtbMOkVgTNFs48qBLWjaseUQEkkiYTlXZBzdzaWFOEIzllquwPy9Q///F3OqSF4gGlXnso6wXtVacX4xUKtpj2s3OE2jLiFRU0N/MrTdY8NzGJMTJv8gHIeC2jCNsr+LYATJ3833+9M1/w1DnCKCH4RpOPtQUCPpiWC548zB6WdEUbpsYluqUQQ63BrFlqGMQig75poV/NoMe2oFoUhu4jKgA6CI2///U3UoZJvskJXdFAY6Ihv57uufMW2lDVesUQf8aZo9IqVGdCg7Il1hJiXGpg0hHUBv5aT/GktqjrHQIwbypH1sZ/+8ufjALY5H86+eh13NAUh37WccqcQg8OmCNw9uzZduKo6hDQRpQAPiLepOZGqFRYa9dg/jafvGK/hZ+RtpBGuJu6fuViJyHREMVTi493Mj27HUVAm0E4+CNZU63ezRjpAIhLsSGphLYqC6aZRKXeYXrWqEDxrOZKRZXAy3AqZ1RGhtPZZEHV9JFJuWVBjwGI733798t1/ZYDKwxnxKjYWbT4cOABMdx4ZSWhwsXLyYcK3+FuL14vFJIVDzsCsEvwavzb33wPU8T4kDNaTISUnbAUivE3r1+3KIFrQWRdLdbi8ScXHmY3tM3N1py2AqitSGCSZSoqofrrdKmClQHhYaNgG0hCQJ0HPXOMABBr4uip/5avjhJYZNo3QxATMJdl30i+a0umUYd9sASp1KQMjm4o6pe1CY46ZopzOL7evXW9W5p2iQApfxL1MEGIqfMxAfvGEi3L7ILCccdi6FtJOvK3OknCqVOn5k4+3hqUGSjNVhOI8XY7KGhPxpEH69LQCLCCt1eTD9QKojnCQcs+r8Iipt+UAvLaFXAtzMZ5qgl7hTOhatHQHD16VI460lmjpEXwnanarBohUK49g/7111+P//rnP+JZKXQwamVVByBSE66pS5Rdamq5iW0eaKR815RrVx68AoW1tr8mh4yTEW03Ds4pMi71HWgVrhg8dFKiC9kw+W7OXMZ/5/faP25Yl2AWYZJfHHQn1haqJZZXz90W6W3UyQgMrzxJWXcK3ShhulONeoLMzAVR/F6RBKV2GCzuhh0EYsTanRaLphvmWPSNHjkFlw7a25oKC6w1k08NSRa6rOsarb0A4c4ELcBQ8iLgdgB0jXesaD9icHYzMhQjQ7yaRyQgSIKOV5jnrwM7N2oc28pRErvhAQu7ug4KlSr31LvarGvXn5pVHHUZiQu04cyBoCnZnRstQQ5Lxf07N+mTJtq1iRf0y7oQNad6YCsMT575VoUdWWvNNQgcsNCxB278UUESWIyw+XHyaU8LFhXxMOihmgNmgHH14vnhADS5COUYcBJSPnsKhV2+u8oiIPRuIiqgEg06KCBCMFTGaES96uwkjfXmDRDqtdvX9gvGGel2iEGYhuNrazhPcsQ0Iaa7P2nft37DBoAANYeRlFjNCY7is6GFnnVzkEA3cmRUevcLXLJApv7nlTLwMHsi6uaRJGSWkKGW4eDYCuNZL/VarSycfGhOnz9PmoCqaoNPwCbMRNG1OaPCK7tIEiuGWnwMIobLEydOIIYi3G0elRSDFl+WqSBPqEzJskk9NWxCZi53Pun2mxUZAYuCsui6poKbvYnodAocZ12SUwFU7Yuw69bx5MOyXNMyCBYLkqhNGEQbqppJ3VMqnu5phnP2d9/+ymtlhO22Ax5EOdt1FGZHD2XHH2GI5VdGkNfNpbf1G1ShQfRkFEaHxNZyoHllhIAMCsmEmDP5dJongxf1MJzzuBcHu0B0UgXfOogDSYFSKP2FQUZ5tSsyrqTo40PxwiEwCIxgupLnPuOi96wuJbojnVlctxMMC7CC5RmRFIftMdpJGKLJEwTe1cm6DrUCluVuIrlhHaPk0W4cGRq3QJkGvV1h3di4B69anq0lhDujstbWnkFe0FHw1jRMD7XVRqz7BRC9RoCRfCusmntktEDNjgNhSp48eZL14Xw3HsMKd9cv/YQDYV0C4hUC2fDtbbuMTkE8ctHhbLg7bccnx50RBN01fzUhX/0noJj8FJDZ1CUnrf4OchZt5y1Ckl2YkVF2VLr9BrTLFZmFRj0IzGDLuSrszwfFwPKofWNnLEJcemcdZJRcK1prQAceueCGUcEZRMD09LQYqLQt6zZFVejsrUstR3SJsS8AAcsJUlHItWzW88Ss3Qx3EHancIAsIBnpD5LOM+ZL86gzY/f9/HW6gqk1tCsQqzL0IuQAZ+LpzhyULqG96najs11cMiKhXXp3T+EzbJrP/XCKIVC86w8FK27/yHUPdvz48dygh12htPH3s1bELs7qRpjAcYwyIhJd2qBXVVt/TejjbLZPRBgoAqbYFRdGhn/I+hOr23bWNd8Ox1VD/+A1TYAmT0ZqvOKvhaVrEuptHoXbVTaXcioJoFBEz+z/MZqCYu1g18HEuGdFJc7/CzAAb2tiTmxUvU0AAAAASUVORK5CYII=", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAC4lJREFUeNpM2UlyHMcVgGE00JgnUgBJUKTEE3jpM3jtpbe+gve6jvcO38J7e6eQEKYoieKIGSAA/9UflOEKsqMq8+Wbx8Ts3//4bmtr6+rq6mTx3N3d9bm0tLS5ubm3t7eysnJ6evrx48fz8/O1tbX9/f22NjY2gr+9vb25ubm4uFhfX2/r/v6+levr6+Xl5T6/fPkSqrb6ffToUZ+z2ezy8rKDoe0z/BY7GExHOhiV9+/f9zkPdbiitLu7++nTp7dv30IX+bY6s7q6Gt75fN6ZDx8+PH36dOX3J1ytBxnY48ePoxGqiLXVYnh6iZUEC2BgS5I4iFYA94unz061ReYA5u0lJaCWXr16FUTMtRei+Gsx/XUygGgkDR30myTb29vh7UjAcRlnYWtlcNzZ2AoY+bBlk1QVGIT99knZHT86OuplHsbU0BvNh6KTT548+eGHH8KL0vricfjNmzc0EcaU0XpnaSjOerldPEyJS7IlAEttLh4WTx0d2dnZaQtbGaTf+fR/Pg9pOoxqoHT7/Pnz1nvHK08KOGMFnC4TuvV85W7xHBwc0FOE6a/f4HsJTzqOs2gH32e/cZZ4SISZs/YZ9332Mo+hCMR49HhiPk431EDQIJmSJvoNL4egqp7erfewbEbsYGI4GKMYGsruN55SR1thI+c8e3EUkdKTSlNVlg00lXACvoyqJ3QdYXpqJn2o2wogVj5//gxzqmLr1lMBRodU14tHfLDbcrbsw0bfeXEifv/99yEKo2PkjrkRa/HRep+Q8k7+MFs8ke9IWi96ko33CN7IdZyC6ca6lRBOhmZvGh7hnQOFq5XM12esy1sxHQEyZB1aaTEy6eD4+LjFQikkiZS3wSkztUJPIe9XYgqyI1EhWMgf2BKi7CIDSTDyaqyELujURg1nZ2cW44m3ClXxy5oBS6fBlOe4cCsMHdWYYIq1xYN0nLT+9ddfx+WcjZhAKMkFkedABBWnAjPsyS3pt9VnhHcXT+uhlkEYPTtSXvDyX4vcTqzEJTftCU8qn0IyXPB2OH65USvkG9jDKxILdaYJGI2whyTssR5M3LfFyTpLbEhg4FIDgPxiRaXKZ+acvzolOBPiavGkyZEY5YWRhVOJAsIVOhKvKbhTilgK67P3SAbTJ5wxFC1op3BbXh7hmS6VE5E0D6mc1pLM0W+H+WMHuJGkPAroN998w6YR7rjaIoO0q/T2BCyhx5MAXF08wWBL7uUVAij4fONBdQnE0/sFLRTomQXVuGjEikzYWYGpMIyt3vUj+Bi1n6ikFRk98THIidCJnFQhiYlEdaYwVi6zV2fIJ2ZZFnYew2n6Tfft5gBOZdDsu7V4WuQk4exsW5FTbcWTborXzg8PDys7tKVtIvrIKAktWFrvhQv3K/2kHkYXyOGVFRUZ3p1IIklV1m+dnZ4WLOdnZ5cXF1E5PDhQY/jxFDitdrJjfDPmWlENaELRHaHEUQIYzhuXqUed1jhwmnbJQxLYtH6KrK1UKNjLwCl58lcxHJawx41MKKeP7O+8F7kgREOv1BBSfoNdaJmbtOl+pFnW1zVIxa0n2FQ8trcnO+gPiQIiLDyXvWQmIip/ujmomalFngcbHfDRrJYMvWRT8PrNPjkuErBJQ1NWkzmlAOyHtzP8jAIiKQUEwJkyIu/pUSiD4aDScsDkbMvBUdOY8tPHj+2WPDE6ug/Vdp6/y5M8iebpVmDCxbc0gIGxjmTIHGRT3Qg53Ei91yOlp9ajzYk9o73RM05ZvvoapQ6Iu9G6KG2cPbZwoyUcZVSxUhaxKCakKyr/9ddfhVQwaZq/hjO6HYlKwNxOuGTXSVschdcnUKgVkFgmdw+7qLUc0S+f0y1FbwQseGmlX6b86quvkFAx+40V1UZf3osMMMn/1z//Md0vzdq78S8XT691DxHIxLUAyl+0tR9hyScqEanQsDWa6eHvI+ICGwLXtCSwnuLs/LwAmf3e6d4vmg79agLM/vPP71ImO2p9HtDtPeL+RkoDp4LK1rDElg5sNPKaZrm3x+xqGqB+Rnz9+jXVgucAZdrw//TTT3Npsw/uyfZabxMzcY3LXErTLGCTnmuPdCr4NYwcWRSnZl7YE69pTlqXdXvhEqjP0TYtGSWG90gEvWRBKacns6ahfCLamkHVekzhXqBiFOMGMeKgNEb31CFj0bcKNuWPNhR8gsock/m3b9OTWwb2Ciwla9slwCGGFKNnHKOH3jqwsGkFYmiIEdo4Uz/adQ8Suw/jqwKeA3V4gEYpFCKUaeiZWK0HHEC44lvLwAFoq5URrVpwuc0wGP4OjjZdH6qSOjVlQf2NXpQaCXR6cqYE6TqoOlEaIQEzBNaD72zadQkADzK6BlVlDI/GssEHKhL4s2fPGgfnpjl5crQixuuYoMv8SaGIQOkx7FnTHY5+UJNkMaq5hIBloz47G73g05OUZjxher+U3UuSz/7197/xAFVMkpTQI9bwCYWJQ5WIS8E8EtXFIjWHXXD89ttvSmdb3377rUZIbyM/j3sKB10BjT55IifDRqYkph7JltJMEkuGEoxo75gC2qLyzJTMF5kAWjGcyQJxxqviRteQ8tR1ehodkdFo7qJCalZoSYnXFy9eBP3jjz+qIQ/F/9MnswDpxXbHgymNjUKkMHBWBykbl26sEiBItXKYaMoR7h3c9LklM5mF1MgQ0pcvXzKu9FOblnHDXko0HaRdF3cMpCcLTHk2u+rG1EEuyC/5QzxQyrt376aMb6/vzo87GTla/JNDMEbJnVYjvASm/Y2GGlKZMo+Ec9xaSW/syCta4Zqy9Bj7ol5nMRnRDaXLAu8mFsIZquKmA72bWl3pBpAJ4j5WmDKSBXUYtH7i1z2ZmmPe0juJMMqW6uQUDdl8SDzmKpIZU6P0/1Nk52PFRKA8KK5pvvdemhHa5XzKl86x46oQJiQwrmnEbTeYdhN+SgXm6eA4QWRisTOuvuUtdpQDA5MUdEj0UaYxa4SqrZ9//jl9F9rRUKfpsi0i9W5O7MmnlTgNC17no+XQp7veaFE3osjEawCS4biyUpE6NWZ2iS2FhbfU9ebNm5GT5Qv+7hJgZ/8RFb54sRP356dnmvXN7Y3Jqf7ypz+kAwOduFB6k0Zsh1pJGY2yIZaPj4sX2Ui/NcbJpJJmXfbxM/Ani4uayc8up2yyt7sn49zeLToIl58YV8IUqTTXYgoLL8fXX1R8xoWlexSxJgVgOpGOjo46e3x8rFsf7ZqrB4wGPKWJpWlwnd1PHUdheHL2eWoXyklRdWEnUXXYNDIGt/EHCyle1AwY1zhSqGZGT9v7q1evGuZpd4L5cnN7f7c2X1nQerh9XVtdU14jTeuTy5shiTuu2iQwDX+7agtnTyCLbErfPbkOparc7phzSvlZxzH6toW5pwE9PGefp9BbXdwr8NQpwjiaTkhJN7pIUS6JeIbKpT4ynL6K0NFwaZund/Dw8DBufvnll829qXiv5G9rD8Pg5fWUY/d3H7kE0H9f314/3Iku3HfOeY1scpVKrAUQZUJv/G1nSK9P4viJYbaW8yQn3jb+oCI50d+7t+9d7B69fBm2D+/eu4MoEh8m743FU9SY4GIrAu4wxx0wh4uzqmG7AnbcjkBSNESv1iACBXkrVY67lRnfGtky3whDMeHSm4StULb0Pj+/uly+mbS3tbuzsjbF9uXN9cX7d/e39bLTbeLS3Wx5aeW/r4831lZ2d7efPn/WaFPPsru1O/0Z5sPbWodnRwenJx/v7pfmG3vLGzVQm7PVteuL04vzk+svt4KgbFufub+9PQ0p1ah3b/P6hM89i4Tp9m2+ka0vzy+miyT3BZKWTK07vZw6z9X1ta3N9WnIub55ur6aLdav7h/+rOKatEA+PW0WOtlY32kYZc1pQrq6vMp1LpYOnjwVQ+Py3Dy96Hmmv6aUfmdLN4XI/v7UcaTsFPY/AQYAVM4VTMddBr0AAAAASUVORK5CYII=", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABfRJREFUeNp8mWt66zgMQ28a9bH/jc1GZgNt0mbgwDnFgM7VD3+OIlF8ghR9uvz7z5/7uN1uPDXWWl9fXz8/P3o5n8+3+zidTnrq58vLi16+v7/11Ltmrtfrz2No2ctj6F0zWimap/swKU/qRfRNjY3b6SLHBgjBn98ZntQWuNcQdQkgzvTOdi/WSbfHgJqf7+/v8GqaqGN7mjtYsUpSbaVIrUclYsXK8PGWytx4Rv+mnlJCZDMDXiyCXr+YZYMoIrfPSHL+eXoML9NT5PJsxOOZijQdS5KWgcJmxLnTDCE6mrCUXqlJSwxnqBnWPVns+kVGNOvWKIb23mWfYA/bOKyczB5q25ktvdiaJlrqZCBhGnEesRtRA69MD/XxtceBiUbP9zGlKg3xFwtE1mGuNY50aO4ub+6mN2gPhgMaNHm5XHDnjO30kgojnAlF6vn29uboM9yYJn68jB92WK+AJ0uTyk8SDM1Y5RwMcFjrGMvEzevr66v+Sm7wM52yR2K6rbkpWfkJTiY4iRYMAYmId2hKgIoIS7P8ilIoChwntBjZUWSeBKwk0wU9yQeAkrFP+K884BmhdF5HECSceQq3kE3zBpTEOUxcAIs6tsCaxgK7E/QZoDxZLHcdCjaJaMi3KjwLhtYEwETzYvqQXPpQuXAhiP/Si+C0BOCsLcbTUQA0NHGYtnOeqiEBPf1yqhAffZZ5N7am3Noghzg0is4Wbk1L+Rhvga3yoXqWz2X0bIgjtIWQJdCsNKwzqJMyTh0pib0eOkakHAGuyTQpGWT0Iu4wRLswhNY33JrWJV5IBWl1xChZfTzIB01xlhWAXa3skJHr5LYmEIC2CISVD7Pe9LyJT5mOJoSmy17vYyX0pWIqEjlbWilx/ZczmJWRrG8WWSuzng1qOyR/CUC/dXqlCA4mIWapU/VqVr0z7BmZTKv+ycjbmM5aL4kiN8ZKv6myDKgDitNvprFApVn82PFX2cjPpFvVTrozeb1KyGSo3lFPomMSdGWxCvspl70N4TKAy7Hm9SbdvG5TFNlluEzYe701Xbsymrlx6HLVMd8Ug+bG4KQSD54APztG3Vky9hFpixLhSgFjaijRH5/jPbewPi9kCb+QlZlcNB9GtN+XAxUPwKsMBPPumsb9O6BURBf8zovxfue5l6yLiKu6AM2XnrMKLdyqVI2vVJnptkDW/lPO5dRb11EnjamSKWXpP22aoTorDpyh/MFjFZD+3msfKFyKZL5g00FdRR++RU1L4qNsL+Ddw8g+lAdj48O+SP3MEOGikSUhWcReQfEDi5DCPTa+S/mwkrW5JZ7JtbKHsQBn4DDaHvAH/sGWJxF10VWqJOgKgmujmSM+Ku6yp5WoRnPApi9koUOWufXsWzUAUZdSAAINgZaVRuqkagEJWlPa8r8Cd+6Pa9bUpgtAZGGIKYutGYnpDLNeyKI5L6GcvuoyVLDLZZD5KpqfdbN4Cs1Zn42diickvLpjU1cJ8gYNgkrJz+4/zxpSVAOst3fjPKn4Tf7UVsEgzNXFtW6UdAxnFZlFItAKLtTtKKX9/PzcfauylQ9zCp/ziS6W7M8oIaupOat+qSr7uRlYDrWVykwNgXsZRMDPvuVuDuc435LLTdENgVzOWp7gzbu2bB3306oDmP1PIgsn4xJRSDvvpbmSjneGVNY/W73FOjdecJfy6xxW2PT9SjseeYWZKX8WQnugpO3A8SwgK9VkTKUm6oBqdM80lTIk0gp+N+fLuiq/fGTaSZ5IZ1noWR6KlgzVrM8yANPtZtW0CK7UQSXpeV2eg3ti+fJh0ZZXhFpjn1uGzfxskT27ui0dHkPZSFMYXXLPnpXtDJF0ylUVD73y/LqRhIqb7OQcwikrsxNWrfUqGzcjVluWegY4rW4v3YRyYeEWGJZtVbros0atCMXxt8t++alTmPLrx8eHqJC/+IB4uV594P/y9x32Zmuv+p1iPTsROkWUKY/p/+59+Wwo1JdOmm/XOzcmbfVYMZz98lBt3tSNW/mZk6KUIP28D60UNPDh7j8BBgBq3suL4cOj2gAAAABJRU5ErkJggg==", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADkJJREFUeNp8WcuS28gR7DcADmckjbRehx1+3Oz9YX+UI3zxwTdH+GDvbtiWVpoHCaBfzqwCMZS0YQSHA4KNRnV1VlZW0T797U/GmHme7+5e55x7760Z7329uZliakteT8/OWOdNN6ZZ/BVr8c/EGEsprbVhGHCjaf37v//jV7/7TT0kfNsfTsvT6fjNvQkRH2utzjkMxr0pJTxuWM1pHO/evTv9+IOvj/FmqO5Q1qHn/2JkgAW4De/4gHfYZG2nWQYn2wGL1BQ55Xm/HOZyhMCpOE+MeHyRYbiIheq9Ov7q3IgLeMBqPLhz1rrNhhXjH5ZdeXAcb2m24BvnW+FhOw1TbwVnzdWxG8cpa6U/MKy1dV3V92r55wbpVd4hlhWj1lk+WmfHEqN4q+Kkd24QbILnohxYSY8RFvmwmdVrvjZod5isimY5sS/LId++uFaN25ch9zXZBLWYt3u56vQSTi7Ld+b/HpfxZp9an+fkUDDgwDA9ud7o61sIDmfkFowEeOW6qTpbwMpgE8zkYktXyOPgYq1rsmg4ijsv3krBfbF3u7c2hyhc1BWC8Z9dm7X6VXu56Po+GKBM+i+GwXQClJ7EpgaPiw1oC+F6E68nuvaEmkKrxD5Gj7rqc7O2GDJGPUp8tdxbdtg9x2jbzFKMw0+KDIJpe5h/AYTig07GxJ8ZtLsNdigci4Q2aMAWrAi70V4i+uqAWboYulki0crFvpkl2xyHUFqGvQAr5sKeOGyoAoPutI1/PWBb4QX4u2RbbUKoYn0uEhkAZZgKl+0MpjSDjW7toeUZEzrMVRh5xmMea6pZXRW+6QFhh4WX6pKtuLEnsMTGW4wg8aruYN8itWuIXDaALFHKCrNazc7ojnYsAO+gmHWdEe0+JGxArhkfPWyyfJTsznaiL910MicID+sFVJzbYzMoVIlriR2JALEycquNxZqUGrFEbIe3tjqCs+ouYHrHZbQYHfjcuooBcHbrqw89JdfzarFe2t+ZIZyMcdV1r9sqhLW9GIOBXghCTk2dhGM3rhH+ErEm00v4gw3wr67bbV68nHTPBeP5HWmqce8BLBeTX3JjHPOl02wfwYwav/BIXVfrMQNSWWgybViWRUlZYQtOV7NgrwZ7/xzetdGyWooXixCpoCq8Pz+fcDDZHRImwQlHPzwkicevj9bbdSDvMaFZh95SckMGVXiRHSQPvbDlJQ8KGrxsor9sIryLTbTHm7t6N0/TTUxTwASHI0nncCzzGc6Vl7mc8IXl6XMFW9ERBKAFb824YWvjG2WKy0dEp3Op1YIcqOgmVA1yOznZBrddRIwhEuUOZ1PJppwzMQHsQYA03B2dDQxjjCEusarkbEFKa4IZxRYg5rbsPmpO9OpAuE0NEoIwBeg2agIC+mIWmKFSY4DnjORsYNAEpgw8L8YhpdHEgbloqDGmTF9iBQHrJewbnB0kbnwcU6V7BD/zGR4zAygEAKBfyB54AZdrbYXsAypyOPfGr+c1WCwKQRnpFHhKYQ1XAPhwJAIQD0UigAcswiwvbY4gpTzj5NPp4+hh95LLudQZJ3iIniCM5vMy57UisEBhBnKtwqHgRDBjNyUoY+km7lmsXR3EGdzDN7J9xSrgok2GKPNzB5d5QUwBsPquQIYndDcU1HuCkqRE0gKgb25uvF/NOALmZd1yQbBXx3VW+SJdbPAnNdi+fSvvjgnWSKCM46hIUEho9EDj6bK/SD4YAKrEAkAFAdbH6PXRFntWg0oRVSb6+F2iqCN3raLPkxygp3KLx/YSfWkcd+GgvgdGRb1twfRFdteHqlnAVwAPiBYFqnFH2CXUtUD7wk/XBMMNAupr06Qq0pdmQXDo4+EzmK50qKGtRPiFz7C/fRzgs8PhkGIxw2AFKpILRTTvwNJZFAS4vgvOdoEF5szI6Bez+CTsqQPc+ml+BJ2qjsBd5/MZ3sIkEAEbJ3+uTmFWjWErI+omCPmGUEWG2CF/7eS9iPgabYonI1JANpKuQnTe3d3BTxiM1eucgDMGLHneAXC9ITHELL7HAvJyQlwMiQkQPEezNAkqpHYwCTm6iw1uH4CEM8SB1EgGeTGL2PKgCoe9gxvalnSDbIq/hsR+DqNBqTozcwr8ulEBX6InCBCKFU+soM6h7HAqIVTeitqQPeht3urEKjTPokjKtF4T00HPG4YM198KCFVQL6mW/IzRLUKLzyYmLAXipddgpkM9+hJnVwaDzCWQvzhjIy31EDgQaat1sBvoDmqxGFH0VvWB2RS0AFEjy4OP17IEMlrLtax5wbuNoo9EcgPDIjloagBDY1gB2507mC6MHvaFWOnsEvZ6V2VGqWWDAtbVKzgfK+KiqKxotN8j1O6Y038IjhX0baEyKV2gi7KkQlmqEzbuVfQNJRcG46Zh8Ld3hzjUARNbJLYlBbo+KBWJdpC6qm/lVDELnoQ9lZdsrmyq6Reg2M/gAjo0EE2Q30PU3ACxha/WBuZmSjE6iUhLfAwRXy2n0/L0/DGBTMJhmIYQBkvqagFRrRwBHzF1lIVlNGZK5DrAViGsxAGLy3qpfLaQsKqsPy2PBRuwnpukrvMJO2gArekQfrbehKQ2o0XY9vt7mOWqR8Ja1nOCCMdz8cVFcjEiYvWIEdJmz4Jk4pRQVczB+z3bl9SzBSO9NU69Y7kuxYHbfQiH6XZZmGAYGE11t1PVhY/wKkXQefnw/uOQ6006Qp15aCSqjL7lRMGNUX8ouwDCEDgQJ4wLCXUd6dOW9fpepItZzkNFYtehPzyJB2tNB8SNln4Eu9GKC/NTNtZiMBVuGrB5rg/xgFp0qX0ME+qVsKewnVH0YyXGjRRATl69SRy6rqlTNKaAXks6UQQcLP2VLrHBIPUqmhtXLLqNY3AHymYwFPTG6XSuax+OUwTIReiStypVqE/jALadhqGtjmq2mjTF9+9/mobXYIflnCV794IypvWv6VEqighL81xHiC/UJ2ZtIzgu33gSiTYBSJtkCMClLetDNymkYaRFcxwKF9hQ2Z8NalXpTNDOwOoe6/B0e3BAbgjblm4nlIwumPR1j4SDGIqs8VOKSAJMAzEybbdlEyZa4xurJVZCrgwYaeCO+fRxHc7Tm8lME6CFQgHZlB0QoAExGKQVwhJZemAW6O65iTbjEpGkwdbN/axZIGdRAIW9IK1OW937RFeabvtPEQCmkBSGGk5zPICGByIrwEXCW8S6ArlKpDRduvZ3JAgFtaZ90Rh6ET8tx0Ciqi1vxbGovGA1Pci0RJ2RJgKU/rRaRWGX3oUX1bRi2+CvwN5BV1AzRoQOrDA36ae3rfA1hVODhq+7gdcOq0yjgKwRLVSkZVqRf4Z4EQ7ybi8sjDEW2i/54/E4VDO4BE0CVNN/jv0tI10vWI5awYmMZtpCom7l7MAvkTUtexgYU439qjF0EcFeO4gIDHZfsPoQRKAWzYmiZlkuwXS82A7GkxCPnfIf8RQ5SbBtBnJC9IfoI3fRtq3io1qocGZGikM+TFOrZxoaESZOi/GvgxHQMMIsIyDfEfJ0zwCsrPnSzBQauhTZw5hOpQHvDw8PcX0qMY0RKvI29hl2BjKbMAIKFjAswkKDORfz/v2Hw/RqHA/Pz88wa5zCsswvufpz41jNlfXx4cOb2yOme1qWV7Wf1jzZqgDvZuueqeid57kYB1vevXt3519764u7ORE2DKwwpTdujGYcaphQ9KUJWYdNdnezmB++f/3ta7b2DkeV0TEc7sZfmb5Xa9LVlIane/XtcHf76sN/5tNjK/Xbbw7x1f38/Q/MyGTnAhqA9dM0nJ7rTz+tv//NvYGzPj389c9/KQ+Ph3H67R//cPvLX6wFWrKFjw//SsuQ1vHp6RPLKZbrqAURBShGl9PT0670NeI+Pfzz4idVLJvPoEvre/P4038HD4lWPz6YV+6+m6duxg54+RYSdrMizqyv46E+PT35g3/79u133303gOSsG+/fFGa2OTQUZG5hl46QPDOt2swy2/Xbw9v7u1s4kL2eVncxY8e8CXz70sGmCHavvMO7jSwRPDJQ8m5gvQesFHzlQpUmLVnwaMPBH4on2DE5smmQunLN+ThQIIVpGBEeSJoL6NkjHr0kvZKXM+bCPwFrvVSIfWuQd3P5CaJp139I9wlpyibPwrCyHQL2yXah/qToAEGKQCqqOotjLspKQ459G+uZ5FEQYXgAxUCRQhhAFUMldJYj8rtOOMcEblyEQ6toSppVZhUdXRIJOzJkYIt7EXK51DOmZ3+iQL/PENzRTXjolicwD/sspCPaOrJ7NUFZtQ41wYKMzcbBWZBwk9qwsWKgImEzkx3FADn76jaNiRxYRPlAtxTI7bRXZXsU0lw3pWmcVnZncYFq5fZNWN0UQP7aASXTSuNJ2nou9gQnZITk+fmEdYCczGFK6Sjd97i6fuavKSGz4DLVg9p7fl6JpHNhlYfEC9e4yKzOOCXEkLisGsRdgH/dEfHePaqaJn155JCQK1Y0V/lRTdvrXoRNBiXCMfCJEc7YamMkR1+WMxsFrT0ieNfSULQA8TWvEZlmzW56q20IgLcIESAOWI9QtXLNVjvQFDryE1J6OLfTKb9Pganucf5wTM9L/zT1gzCIFtbVsxICJ59zJosj4TD8U9KmGiqliLodKmn1kz+M2OKcn5mzQxPK7qOpP/7w729++WsoNmlBtVgdYrK5iWZRyumvKVWrjZBHFFk+3tnTwkx1Mzn/eqQmJZFC6ra8aosMm8bfB6BrwvQ8P6/LeXTz+TTf3Uwmj9atLH29PTbmwknStTduSxQ1n2tOvSJOo2FLE14H50Qj4FA5urdi6H82liMrPelcW6Q3niO1jh5Ez9iVFAe5alAgZbhAcmbQfoQzlyYPs3H5nwADAP/upUmMy6b8AAAAAElFTkSuQmCC", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADjlJREFUeNo8mctvVNcZwOfO3JmxYxuDbUwMBAwmVCBICotIVaJWXWdXqd112W7yn+TfyLJqlSqbVkStKqJU0FaVGqHwMDZ+4bc9g+2x593fd3723MX43nO+872fx9mP84u9Xq/RaOR5PjQ0xHuz2Tw6OhobGxseHuaFlfHxcV7K5TJbrVa7kp4sy0ql0rt376rVarvdZrfVagHGO3hGRkb6/T5oi8Uip4rpAR7gQqEATKHQb6UHKsCDB4rAl8sVALIfnr+CMDRqtRq/Fy9eBPX+/j5woOYAiOAYGufPn19ZWSmV8vfee48joIbd4+NjtkrpkSQrEHPFTwAUgyMwhwCs93pdGGLx4OAAQp1Op9vtQg6xYSDf2dnhD99LS0swe+fOnZH0wOXh4SHnQcpJ8MIWkEjC7ujoKACQFB2MAix5GVI3/IKznR44AJJf2EKqjY11kIBzb2+Ps7C4u7sLtuPjE/DkH3zwAdgvXbp0//59lITEKv/cuXMoH0Qq5uTkBDDUtrS0XK/Xp6amoColwOQP7gFGEpiDNluoDY4Bk3tdAswATE5OsqumkRDMFy5cgEV43dzczL79x3fr6+tQhTMNceXKFQ6rWI4BB1tra2scg4ONjc2trS3UwKfWVNnQbqaHI9qd46DVe4AEoe4BAGDj4+dYhEXXeUdUPGd1dQ34HEfj/PLyMjoEC/pcXV1lBUq69vvvvz89Pa3ngmVm5jLaQiw0BLy+wgNe6HEQPhBDkTgOi+iJIyoGYaDIyubmBmffvn0LW8gAZxwEGIDt7e3s6X//BzHFghKGYA8yCwsLKh99oHDMinXQHJGCWBpC5QPAKdyfUwaHZgUh5GGFFRjlLNhULVv1eg224AC0wGhx0PZ6AZz94etvsBpIwTXY5hNG2YYeJjbEzgK2rpNhdGgAibh4A2oGDLx4MSvAa1PkwTSYAtPAB8jZBUOWAVIg8BMrPZhmMbHejQTx29//jg1MAHPYS4cFddYLF+EdEQ0rI65eO4Qn3MusA99JheVCdur72IhT+OLExATv1coodoFpTnHc3AGq8fGxN2/eAI/uUWckhTyX6dD6L37+SwjjiYcHjaWTFfTBdre7OFypcgCM+gqcsY4A/X6kosuXL0MbKSGAPlI+rEsPMOQZHhoxERDK4GdReL2CI63WiQnsID1QAQDB8Da4zF69WYUqXsIB4EzcyKEDwg2fIOKdX7BPTFxgBXWyhaFBYcwTABxHKqNYBaf8tKHtUBXcu56CZpddWCGeXDFuTEbZn775K0jhCQm0MZ8Ire14GXCMnjlA6jaZgcJTZ1opwJMBy4opA2H29nY8yzpgeNjMzAxUoIDPCAZCg5oHL0R5+fbmVikrRgo9POJ78fUCKuFwPyugEmKQk6ga1zZC5+df6M6IiOsAg3zJuTvqAw5gFzWgIUjOzd1ETsONRZwMxTQaR5ZLczVgkdnz3BQdZpm7NWtZvf2TOc6TkAirEK7V6nTa6+ur5jMjDs5uzs0CDENmBxYBQPr1t5v4OPJAGB5NB1Zx+KPEoRKcVUNzsFwp1d/tA2kpC+aK/VIepalYGsn++OevbRnwbs2sMtvdSIy8mDaRAHrJji2QXr9+PfTT6QBPVKKnRuMQAoABLDG2othXR5HhrPtouQva6lAZUZEQdtm1mOoS4M/uf3zXpKyfAhS5P88b7VMzgQUf1wqRPLuRke1qANblwxFLHYMAGBBChhd8oFQc1ueMQbNrxFqWwSXIsbsFdAATZfTC9AQMYW8RAWc49HuZWGBIl9ed+4UuvEJeRvUM3dY6nafHvi0qxyEKyNutTilH5l6hH1mU9ygh7cicxVI4VqTQ8Kp+VsopYfmDBw8sXmG4dhtKoAs1FkqmdfWhP0bNL3RN+koMx4X0aDWNCIus8IJeq3nZLGOK4V1yvOvmZ+1XfEYjdNIK//vb47/rQxwjElGVNJonbUVXsZ7RMXkiVBNbVkDcjpA0z5n9gcQp8ZVLUxcB0P+MZTMFmCVqhygVXja3I0FkjVazUq7U6rXz4+ePGtHyepisnlihXWnpEGGLdqde34cq8aFlAYY2OVMBoAR5y5HG3d3eRnlUERycdeTRI3mBb4uHKj81fbsbpeLRo0cENsfoB/UkMKKtdrtroLGC53KgVmviguQm8WosUzP0QMqKQtsgoZXQ2dGRVYXUQ2HRXy2ONptICImh9LDS6YVBKSZTEFtYePPDD88QnZIOpdnZ2UplCGWG70dbEhLwSUqjDeMddKQrixJM2xdhx0SjmL7CjsF3Xq2Uq3mp1e10jw6Pbe1hC+W1mp167YBfyxfaKfSLqWKeZOvbO6DAJYG2IyP1IdCdO3d3dnb300NhtpaBdGdnyzHJTh+GKCZs0Tkpuq7dimwcnSDJETWYyVixJIBNC+id5kUbz5N2JzKUMYhL8uKgwnkUvr29o2R2XRwjL0A+ZEphCF6EhmlWUDC4YNf+RD5QLbt5Vkx9R9/hAPlZVJFYxubMwNRldbVsdWMbZrEI0Midupquw5NZkQNowsaLdbCD2iQXwqUsQHmAdV4gA5dwrGJYqZRykNtwUxsQ+Msvv3z8+PEnP/vk008/ff369e3bt+Fmfn4e6vTr08PRQsYZzkPJyiAf9p8WaWtAZLIswwvRgW0Wi9YrtBj5KY0V+gDY7HKBb580bVbNFzD9+eefE17lofLDhw8R4KuvvoLQ3NzcZ5999uTJk788ecrB3NTnAPPq1SvYunr1KhYh5s3sllJO8gsfhgxHbBBUGLxCwDGBR5+zbTwqxHQalJI7IuSNGzcIqU6/Q7GHiv3Zs2fPkBDm/v3ddw8ePsge//OpCQ0mkBKZaIP4xHC2AIRMJz2AqVewwxnrdiaDsuMIxFkbc30ZDJG9dnf1jcGwZAVj5cWLF8+fP2cXdmF9ZnLyo48+yr5/+h/cAhT08nbAIDIwbWDUJd4NOvQBAEodRICRhbg0LbgwR5AHSGQAAH897c3zPNw/mtsJXVk1T6WHcRCi9o9UvaKp3JqKSs2HuoJXEhYZC4UByMCj28m3GdzOUZtCBu4dhDQc3oYFnCCQChiENP3i417DpMF4AxLwfcoWfDj8OHiwgRXwVhsP883i4qJtmQUHAFDwwi4+ASUUjCRj6YE/uOmlx4GaJmskleX9Wi3yBZHU6uSl8lA1azXb++1QwZXLVyPyUgKP5slqADorFHYxjeEfMGfNt+G0KYUhU7wtqAMgOoNjhyjksQljVFldWyMRgJNcYLU1jRWzqJ4sol0C0yhBI0tvV6ImLi0vf/jhh+sbG8srK9YQIvE0adFTEDudaNInp6Y4E6yMjaEh3BFzwFBkE+YO+tVrs1gWqWKi6kWNYxcFXE2l1l4PYTiF4qOiDw9HPeh3d/d2Wu2mBS18ptNlI7e1oLzYTg1cfnB1hsKcjwHQgfbSAyTBCK9gxGenp6bN9ZrYGx69zcTLcZItMJbaUupqDGQsTjxC7t69e6gN6rlkbIg1oj1uNT1OSDqvXZHXLyQw2OW89TEajayP0J1uDLqVapkX4KcuTh6lYd/rNX4RA2AUU0pXX/ZesEtS8HaomSbKiNgAsk9PXQeErcq4HaLgZ+QOO30TmHGHOr1tA7UXWt7J2KxahgFeWlpCbMJCvQKvpkdTN4u+HR1AZb/ESygYF7Z0m/fYU+0mIcdXq7g1Ue7xazMq3HsfcfDuHXwjt/nM+HcO8xpncOmFSoD/9tEjGLp7966RzgqCsVVNZb70q1//BqqwbxNsDkPt6ByMDnr6sgkM4MEsDxYlSVMyQzpVj4yFsUiJ2dBQleluY3PLCzpv4cz7yHx5Zgb9WU6g5UyWJQfKLVvg3U0P56EXs3aewxmgXo0MenZ+sYL3jqoEiSlw0ZEeR0FcX1/HarxAmLNguHXrlt2pUx0YMKKjm2bx8lL3YGsk3Tac6sAqZiXxjtlcSg22y/ayD254wawmM++9dcRzYyOk8jTHNiw+mqaUV0ytTgn6flyMpf4WQggGQtIKLgHYyupqjPz3fvqxZcE5SVUrDQfgSefwauBs1ih7xAsmddDtnQ6MTnz+Ri3vGgOniz4WrsGnaXIQLtFWYVojSMKi9orHgm1YeQPgBKH+Bhfa9l7nxkftObW4U3KEZ++UxcEjKvHw4qIzJvDwFMHxxRdfOElbVtV/uhZrDYZpBw1bVlk3AvRfgh/97+5tm1PSZVNEPlEZwV+qGB+OwY6cYCBgvdQwq8koTZsUs7dbgc5soVtAEvMP7s0cy1SPjiheHuBhgjhNtxqH3nKbnNCEOI+Pmxq6mx7HYK+cvSgAiRkA/ggUjkTgK58p0eSu99heOomrbROHfJuibJ68brCfibqRTqljPsfHLww8RCurNv91YFIwejQFgYz6yUOMo/2k/2PlUDJC3VYObRmbRqujZrqH7qZRopviN9o1YLxzPwt+SLb29+s6uxZUQh5qRKq0bfWHdyHA5ORFvDcE9z8tNr66nldctHt8egWFAuyuWH/58iXKoH3jk9abHAO7qfjE/7dsdK3Zlud6veYUZBBYsmwLbKwd/y1iyEP/EtVz/s2Kdd5AG3iP92wmKnnVoKCYnDy/uLhM6ht4IZzt7+9CydYZ/rxkR3nwM0gNxqyjFOOX1452Jf4nCxL4RkTu4+//FWFcCMOncpZR7+Ku9qiJwsTl3AJA1K9uExWm0SsuiUHXaZ9eSdD1LizE1St5H/t6kzg8bC8fXt/utNbW1nAPVHxj9pa8ohH/K8M7XPaTCNmPLxfjdnpk+Ox6rcRezPvFivkGPaESZGI3bv3LmTcth4eNa9euxdVN+/RS1B4LqXBbAG7evJlajEai2kq5oUs2hzNy+/VrNwcjkCFidW914gLr/wIMAIJk/ijZRA/fAAAAAElFTkSuQmCC"]; var g_sWordPlaceholderImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAOxAAADsQBlSsOGwAAA5dJREFUeF7t0rEVgkAAREG4BgjpvzvJsAA9DSiBHzFbwAb/zTrnPN7fxRS4r8C+jfV1fu479KTAVWAooUBRAKyiqs8FLAiSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSAKwkq1OwGEgKgJVkdQoWA0kBsJKsTsFiICkAVpLVKVgMJAXASrI6BYuBpABYSVanYDGQFAAryeoULAaSAmAlWZ2CxUBSYOwbW0nZJ5/+Uf0Ahm8Ksdfm760AAAAASUVORK5CYII="; var g_oPresetTxWarpGroups=["No Transform","Follow Path","Warp"];var g_PresetTxWarpTypes=[[{"Type":"textNoShape","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAADCUlEQVRoge3WPUjjbADA8SCoNdWoUCtauoi2YFWQYuvgooO46SIoqODoIC7qIIJuVkV0qIgdBId2UWslRRCtiIg6CA4dMnUrQpEKIfixmP87vbmTE3zf68HljvwhQ/J8kF/gKRX4SxJ+9wv8qiyI2bIgZsuCmC0LYrYsiNmyIGbLgpitn4YoioIg/Jrv4PV6kWW5oD0syB8HOT09pbe3l6qqKjweD6urq8A3yPLyMk6nk/r6enZ2dox1l5eXdHR0YLPZaGpqIhaLGWOJRAKPx4MoikxOTtLY2GhArq6u8Pv9VFRU0NPTQyaTKRySzWaRJImjoyOen585OTmhpKSE+/t7AzI6OsrT0xNnZ2eIosjt7S2Pj49IksT6+jqapnF+fo7T6SSXy5HJZCgtLSUWi6GqKouLiwiCgCzL5HI5KisriUajqKpKKBSira0NXdcLg3yW1+slkUigKApFRUWoqmqMjY+PMzU1xe7uLs3NzZ+uX1tbo6ury7h/f3+nrq4OWZbZ3t6mu7v7w3yXy8Xd3V3hkM3NTQKBAA6HA1EUEQSBw8NDFEWhpqbmw9yFhQUGBwdZWVmhr6/v0/1mZmYYGhr68KyzsxNZlpmfn0cQhB+u/f39wiAHBwc4HA4uLi54fX0FwO12E4/HURSF4uJiXl5ejPljY2NMT08TjUZpaWn5dM+NjQ2CwaBxr+s6brcbWZYJh8P09/d/+dL/GxIKhfD7/ei6jq7rhMNhBEEgFosZZ2RiYoJ8Ps/x8TF2u510Ok0+n6e6upqtrS00TeP6+hqXy0U6nSabzWK324lEIqiqytLSknFG/j2Te3t7aJpGMplEkiSy2WxhkIeHB1pbW5EkCVEUGRkZYWBggLm5ORRFoba2ltnZWcrLy/F4PMTjcWPtzc0NwWAQURRpaGggEokYY6lUCp/Ph81mY3h4mEAgYPxqpVIp2tvbKSsrw+fzkUwmv0R8Cfm+t7e3/zr1t2T91zJbFsRsWRCzZUHMlgUxWxbEbFkQs2VBzJYFMVsWxGxZELP110D+AaZ5qZil4yhUAAAAAElFTkSuQmCC"}], [{"Type":"textPlain","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAHVklEQVRoge2ZMWhT3xfHz/CGNzzhDRmipvUNKWYIGCFDhiBBImToEG2GN0QI2CFDhg4BM2RQBItTwSAdCmaoUqFDBUGLBTNkqKCQIWqGCKlUiJChYsQgD/3+hnJu3333paZ/f/L//f+/XrjQvHfeufdz77nnnnNK+D9p9N+ewN/V/r0gjUYDRIRGo/G3T6bVav3Huv9RIL+j+xjkGOQP6T4GOQb5Q7qPQY5B/pBuX5DhcIhyuQzbtrG9vT12sG63i1wuh62trbEDNJtNFAoFNJvNsZO3bRudTmcsiOM4qFQqyOfz6Pf7k4E4joNoNAoiAhHBMAzpY/dgyWTSV4bbixcvcPbsWRARpqenFZjBYADTNEFEiMfjY0GKxaKYTyqVmgxkdXVVfMS9UqkoIEtLS5LMwsKCojybzUoyhUJBel8ul6X3N27cUEB6vR40TZPk/HZXAUmn0wqIaZoKSCqVGisDAO/fv8f09LQkc+bMGXz+/FnIhMNh6X0ikVBA7ty5o8ynVCodDrK3tyfok8mkNFCn05FAdF0HEUkyrVZL6FpbWxPP4/G4ItNut6X3mqaJsd0gbL6maQo9gUDgcJDt7W0QEWZnZwHsnxeeKB9oBnGbE5vQ8vKy0MVmw2a5sLAgybAJZ7NZAEC1WhV6GcRxHOi6Dk3T0Ov14DgOYrEYiAjdbnc8SL1eBxFhY2NDPFteXgYRoV6vKyC8uhsbG8qWz87OgojQ6/UA7Nu6G54nzmN1u10FhBOtXC4n9K6srICIsLq6Oh6ED9ve3p54xsoWFxclkHA4LGRGoxEMw0A6nRbPLMtCIpGQBgsGg7BtGwBg2zZM08RoNBLv2VsyCC/s2tqakOEFqVar40FKpZJif6PRSHgUN8jc3Jwkl8lkcO7cuQPFPp4snU4L95lMJpFMJqX37GYZ5Pbt24qXchwHU1NTuHr16niQQqGAWCwGb/MD8U5yfn4euq4DAPr9PogIKysrkkyhUIBlWQD2d2x+fl56X6vVJJBisQhN06RdA4B4PK7stuK11tfXJwKp1WqSDJslcOCR3GcNABYXF8VhN01T6OTGDoBBbNsW4O7m93yiWMsP5MmTJ5IMO4XBYDBRzOT1cm7d/N2lS5d8LeTatWs4ffr00UA6nY4vyObmpiR3//59EBF2dnawvr4OIsLr1699de7u7kqekFuz2ZRAotGob0jCrnxikI2NDQSDQV8Q72rzBdjr9YS3Ydfrbex5vCD8nHVbloVIJIJ6vS51vrd+CdJqtUS44I6D3CDjouJ2uy1258OHD78FEgqFlPDE3b99+zYepN1uK0GaH0i73Za+29zcFK6Sz8u4kPvt27cgIjx69Eh6/vHjRwmErWFc//Lly3gQ706MMy2v2bhN7lemxbe493Y+6o64m/SLb3Hu0WhUKD8KyN27d0FE+PTpky/IpKYVCAQOBfn69as/iDvHyGQyGA6H+0ITgLCnajQawrR2d3d/C+TkyZPI5/O+OrxNudmJ9hMgx3EOhHxA3rx5Iyl68OCBcLm/Mq2dnR0QEe7duyc9f/funQQyNTWFK1euHB0kk8nAMAy8evVKEtJ1XQHxZmnuyfPf3lCbQw1eeQ5EuXn/rWBZ1tjU9lCQWCyGeDyuCk1wj3B43ev1RFjvlanVakilUkogys2rO5FI4MKFC0cHsSxLJFXcBoPBRCCVSgVEhNFohOfPn4OI8PjxY0nm5s2bOHHiBL5//w5d15WUdWtrS9KdSqV8F7ZerysxoQSi67pSIGBX6QXxuk7btkX0y5mm9zCXSiWEQiEAwMzMDC5fviy954uUQQqFAgzDUECy2aySbgiQnz9/wjRNBeThw4cgIpTLZQnEaxbxeByRSATAwS56k59cLidk3PLcvFWU69evg0iuBfC3h4bxlmUpyQ7n3t4d4VybWyAQQCaTEb8Nw1Bk3EFgNpuFruuSd+QYikE4P3FH2sPhEJqmKUdAAjl//ry0Sj9+/MDFixdBdJBIMUggEBCT8Eu2YrEYDMMQnooPON8LvPrs/ThddoOw0ygWi0Lvs2fPQKSWhCQQrlVxjMS27lbmLj7wgeP7x31uvM/4sl1aWpImyRPi324QzjQNwxCXcz6fB5Gayyg5OxHBtm00m01RegkGg+LsMIhhGAiFQiI3IDqofbknbpomqtWqKI3yHcWT1DRN1Aq8IMBBvBWLxcT8vGMpIHwXuHs8HkcqlRL2zyBcOOPuTT2bzaYSRZ86dQqDwUDI8EJx599uEPdCuWNAbx4vgXA26O61Wg25XE6knAzC9wZ3v9qvd6LeuMldlGMz84K4TZm7t2ihgABy4TkSicBxHBQKBQSDQUlxq9USZVNN05RwBDjI44n2S6xPnz6V3vf7fUkHn0k3iOM4mJubE3pmZmbw8uXLX4N0Oh3EYjFYliXskP93AexXWhqNBkajEVZXV2EYBm7duqUo5knw4XRX9N2tXq/DNE3UajWMRiM0Gg2pQMjjh8NhhMNhpTIzFuR/tR2D/NPaX3VXb+SoHLzSAAAAAElFTkSuQmCC"}, {"Type":"textStop","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGlklEQVRoge2aMYgaTRTHX7GBDdliCVsYELKBDWxhYSFBiAQLC4srUqSwkMTiCguLLSwsDBEsLnABiy0MSDDcESyEWFhYXCHB4goJFldYXGHAIoWFhYEttvh/xTHz7eyodya5+0K+e7CF63925zdv5r03o4S/xOi/7sDvsluQP81uQf402xlkOp2i2+1eR18AAN1uF9PpdOd2O4NYloVarbbzi65qtVoNlmXt3G5nENM0rx3ENM2d292CXJfdguza4BbkivbHgvT7feRyOXQ6Hfi+f6n+xkGWyyVs24Zt21gul2u1Hz9+hK7rICIQEd6+fStpPM9DMpmEbdtYLBY3D+I4Du/gOg95ngfDMLiGiKBpGr5//y7oDg4O+PelUulmQcrlsjDS0WhU0r1//16AYNfh4aGgi8fj/DvDMFCtVn8fiO/7KJfLME0TuVxOAkkmk1IHR6ORoAtqkskkVFUFESGbzXLN+fm59Jx0Oi2BTKdTZLNZOI6zcZ1JIKvVColEQnh4u90WQBRFga7rGAwGyGQy0kj7vs87Xq/XAQC9Xg9EBFVV4XkeAKDVaoGIkEgkMBgMEIlEoCiKAOJ5HqLRKO9LKpVaCyOBvH79WhqlV69eCSBEhGq1KnQw6LnJZAIigq7rWK1W/H4sFgMRYTKZAABKpRKICL1eDwDQaDRARAIIgw1ezWZzO8hisYCqqjBNE8PhEKPRCJqmIR6PSyCsM57nSZrj42MQEYrFovAyFiBYx1OpFDRN4x6az+cSSC6XAxHBdV2MRiPYto1IJMLbrAXpdrsgIsxmM36vWCxCVVUBRNd14SGpVEq4V6vVQETSvqXT6fBOAUAkEkEikRA00WhUALEsS9AMh0MQEU5OTjaDlMtlxGIxQcBcGwRJJpOCplAogIiwWCyEz+fn54JuNBqBiFAuly9eHpqSAITF7nkeiAiVSkXQ2LaNUqm0GaTVakk5od1uSyCFQkHQMA8wT2azWRCRtChnsxnS6TROT0/5NAp3qFAocJDZbAYiwmAwEDSO40gDfmkeWQcShnVdVwjBsVgMkUhk63NZQAg/K5gQx+MxiAhfvnyRNI8ePboayHw+R7PZ5KFvGwiDHQ6HAICHDx/i8ePHW0HYXN8GwjS9Xg+DwQDtdhv1eh3pdBqKomwHGQwGQrZlVxCk0WisBen3+1wTdv0mkIODA+lZYZBN10aQyWQCRVEEMfscBAnH8aOjIxARjo6OAAD379/HkydPtoJ8/vxZiGDMPnz4wCMgC+Phy7ZtaZ0KICxmRyIR5PN5DAaDtVErmOnZKAYrgHv37uHp06dbQcJtgveZR5gmkUjAcRx0u10eGcMmgMRiMdi2LSSbdYv9MhBWM/0qyKdPn4Swvs0EEFVVpXC4DiQ8tcKdunPnDlKp1C+DME0wQQMXpX84kQog8XgcjuNIja4atVin7t69KyXNnwE5OTkBEeH09FTQZLNZqfwRQPb395HJZARBpVLZGYTN623GItK6CBjOI51Oh3/PajtWr60FcV0XmqYJpUUqlZJAwl5jIMfHxwAAXdc3bo5YNbwpj7iuy9uy7B8cfdd1oSiKUFVLILPZDIqiIBaLYbFY8CLyshKl2WwKCdE0zY0gmqahXq/zuisM4jiO0FbTNBiGgel0ivF4DFVVpVkjgQD/7hG2JcRwRGK1Fivtnz17Bl3X8ePHD0H37ds3EBFevnzJ66iwd7PZrADCZkTwGo/Hl4OsViuh8d7enhA5TNOEYRhCm/39fRARP1hgReN8Phd0Z2dnvJpllW0+nxc0YW8eHh4KEOFKeCMIg2k0Gmi1Wnzkzs7O+IvCITGRSAh7FubV8J6h3+8LC/zBgwdC4vz69StUVRX2NqvVCpZlCeX/lUGCtlgspDoqWFp4ngdVVWHbNm/DRjEcker1uhCF4vG4sHBZFRFeX57nSd7dGYS9gL3cNE1YlgXLsuD7Pg8Iz58/53q2jw9ufwHwacrWUrFY5GHb933E43EYhnFz51r5fB5EFyca7BAuOPrL5ZLPabZHYQVpcNowDxiGwdfl3t7ezYBUq1U0m01omiYswnD2ZVsBXddRqVT4lAx6bjqdCs9QVRWu60pl0rWAABfnVixSEdHa3/xYSA5f7969E3TBvc+LFy+k05FrBQHEvUt4UQMXp4jhvc22s19FUfja+Rn7pd/Ze70eisXixmPM4EE3EeHNmzeSxvd9VCoVoZ76GbvWPwysViueHDOZjFQf/U77//7z4U+1vwbkH7Yb7XF6Z9O8AAAAAElFTkSuQmCC"}, {"Type":"textTriangle","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGRklEQVRoge2ZMWjbXBDHb1CLKIJq8KDBgwYPHjx48ODBgwZRPGjwIIqhHlzqwUOGDBrczZAhBQ+mBDo0FNOm1AUPGlLwkIKHDBkyGKrBFFNMcai7afBgiob/N4T3qifJadwmbfjIgaCR753u9967e3evhP+J0L924KrkFuSmyS3ITZNbkJsmtyA3TW5BbprcggRBcJV+/LHN3wLpdrsYjUaX0vV9H0dHR5fSHY1G6Ha7v+PS5iCnp6cgokuD2LYNSZJwfHz8S93RaAQiwunp6aZubQ7CPnYZkPF4DCICESGTyVyp7ahcK0itVuMgRITDw8Mrsx2VawVJpVICiGVZV2Y7KtcGcnJyAiJCuVzGYrGArutQFOVKbCfJH4O4rgvLsjCZTAS9brcr6O3s7ICI4Hke1xmPx7AsC71e79+CTCYTKIqSGMzNZhOqqvK/J5MJiAgHBwf8XT6f59tuOBz+OxDDMIQYCDtQKpVQLpeFsaqqotVqCXbYUygU/g3IwcGB4AgRod1uc71UKoVmsymMLZVKqNVqAIBOpxMbv7+///dBKpUKJEnC0dERHMfhgQ2cn+Z3797Fs2fPhLGPHj2CaZoAfqbmVquF4XAISZJgmubfB5Flma+A7/tQFIXHyefPn0FEePfunTB2e3sbuVwOAFAsFqGqKnzfBwDs7u5CkqTrA5nP50IxF97b0+mUvy+XyyA6N8dSb9Sh2WyGk5MTAICu66hUKsJ3kmLtj0GCIEC9XgcRwTRNDsNA2MwyYdsrCAIcHh6CiC6sryRJguM4wrtCoRADmU6nqFQqaDQaWCwWm4GcnZ3hyZMnQiAypxiIbdvCGHZuzGYzvH//HkSET58+JX7U930QEfb29oT3zWYzBhJO0YVCAcvl8vIg1Wo1MaOEQcIZCgB6vR4Hef36dWzrhWU2m4GI+EEYnQwGwrZo+IlO4FoQ5qhhGJjP59w4c5z9PhgMhHGu6/KT++XLlyAinJ2dbQTCtiQDYSm6UqnA8zzYtg0iwng8/jWIYRjI5XJ8CZfLZSJINCDD79nqzOfzjUCithuNhuB4EATI5/NCkkgEmU6nIKJYR7cpyPPnz0FE+PbtWyII+04UhJUxzLZhGNA0TdDp9XqQJImn7USQwWAARVFivXMSSLRIDIO8ePECRISvX78mgqxbEfaegei6jkKhIOisVivIsox+v78exHEclEolQWF7ezsRZDabCXosRsJbK6rzOyDZbDaWdg3DQL1eXw8ym82wWq0AnMcGO0cuA8Kc9zyP/zvae7PDdRMQIoIkSbBtm9ur1+vIZrPrQZhMp1PkcjkQETRNSwSJOhlehfDqhKXT6SCfz/NzJJrCoyDpdDqWfovFIkzThK7rF4N4nsd7jFwux43/KthZml4ul/j48SOICG/fvhV0nj59ivv37+PHjx+JIJ7nxVakVCqh0Whwn8LPWpDVaoVMJsMrWZaCk0CGw6FgaGtrC5IkAfh5exK9o6rX63wmdV1HtVoVfo9OkmEYvM9frVZwXRfVapVDrQXp9/sgImxtbQmZKwkkur9N0+T79vv377h37x4eP34s6Dx48ADFYhHAeV0VzUisx2EgpmnCMAxEZbVaCZ1mDMSyLGiaxgMeABaLRSII6/SYaJom3JKk02mkUilhQhRF4f2IbdtCKwz8zJAMJCmo14kAks1mY7UMKxuiIOE0zWqiMNzDhw9BRHjz5g0A4NWrV4IOKz/CsRatflncRdPv/v5+7I5MAGFpLiyWZSWChDMX6/bCxtmtSSqVwu7uLk+lLLaOj49BRLz1Dd9KRotGVrAyyWQyF2etqMJ4POZdG+u/wx2iruu8kJNlWSixP3z4EMsyqqriy5cvAM73OQvaSqXC03wYJAgCyLKMdDrNt/tgMAARXXwgMqdqtRparRZkWYamaUKhxkBYf82epEKOZcB1OtEr1WKxGNturKXIZDKo1WocPpr+BZDhcBibxX6/D9u2eUcYzlphvaT2lO1xIsKdO3fguq7we7TfYDbDthaLBVRVFfSi10wxEADY29uDpmnIZrM8xbqui52dHQDnp2+73Ybv+3AcB7Isx1pWJkEQ8FnsdDqJOu12G4qiwHEc+L6PdrsdK3+GwyGKxSIURUG1Wk3sEm//6+2myf8G5D/6xG5E+ZdB9wAAAABJRU5ErkJggg=="}, {"Type":"textTriangleInverted","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGJUlEQVRoge2aLWzbWhTHD7jAwJMMAgIMAqwpICAgoGAgwGCaAgICBgICqikgoCCTAgoqGQQMBGRaQEA1MFVaQEFBwTRZWkDAJhkEWFNAtAUERFonGUSTwf+B6tyXaztputZv7+3tSAaxfY/P757r83Edwm8i9KsNuC/5/4K4rgsiguu6927MXXT/AfkDkpLuPyD/CZDxeAzXdTGfz+/1YTfJLt1XV1cYjUaYTqeJY2MgR0dHICIQETRNw/Hx8d4Pu6ts0z2ZTGCaJogIQgiMRqPYWAXkw4cPEmLzePXq1S8DCcMQlmUp9miahtVqtR2k1+uBiOA4DjzPw+HhIYgIpmkmPqzdbiOfz+Py8vKnjX/37h2KxSI6nU4iCNtUq9Xgui6q1SqICC9evNgO0m63YRgGwjCU52q1GogIvu8rICcnJ3KGdF3Hcrm8NcRqtYJhGFIPG70JYlkWLMuSNgVBAF3XUSqVtoMAwMXFhfKbDT8/P1d+Z7NZxd3RGWIZDocolUpoNpvKBAHXE7epg3UyyNXVFYgI/X5fGVetVpHL5XaDRGW9XoOI0O12FRB+8MHBAYgIhUIhEWIXLK/9UqmkTAyDXFxcKKuBpdVqQQhxOxAAcilFQVzXRRiGKJfLICIlNH779k1C8vHw4UN8//4dADCdTkFEKJfLCMMQnufFQBzHQSaTUWxxXReFQgFEqunKryAI0G630Ww20e/34Xke5vN5IsjmGj07O4stgcvLy8QIOJlMAACnp6cgIpydnckxtm0rII1GQ3ra931UKhWpp1gsbgfZzCHRIwrSarXkuPV6DV3XcXh4KM/x+hdCoNVqoVgsKsur0+lA13Ws1+vYGAaxbRvFYhHNZhNCCKnPcRxlXAyEXbYPyHA4VBQVi0U8evRI/ubZGwwGAK7DLBFJ2Gq1GptV9iyD8JLlo1Qq4ePHj0gSBUQIAcuysFwuMR6P0e120Wg0EkGiCbFWqyn5JpPJwDAMZeYMw8Djx4+lkbVaTdER1Z3L5WQCdBxHRj3f9xXvx0BM00Sj0YjT7gFyfHwsX8AwDEFEqNfryj22bSOfz0sjO52Ocp1f+E0Qy7Ji9VWlUtkNYts2KpXKXiBR5fzyhmEoA0Q0/jcaDQmXy+VwenqqXOdxmyBRr4VhCF3XlSARA0kKd9tAopUxg8znc3lPtLgbj8dyeWiathdIuVxW7mHd0UpCAZlOp7HqcrFY3Bok+tImCRHtBRJNtPV6PRYkYiDAdQjOZDKyuhwMBokgnucp4zgq+b6PN2/egIjw6dOnRAguPW4C4ag1m80A/J3pe73ezSBBEMA0TZimKWP9Pi/75vlN7yQJGxwF8X1f0d1sNkFEsG0bg8EA2WxWKSB3ggDA+fn5jXlkFwh78evXr4kgs9ksESSqu9/vKzYIIba2DFtrrdFoBNM0Yds2CoWCDJX8sF1GcLF4W4/wBDLIYrGQGZ3ouk/aJnsVjZVKReYXNjhayfJyusvS6na7MW/3+30UCoXE9+LWIM+ePcOTJ08UkGjiZOM9z8Pr169BRPjy5ctOkOgMcxXxM230XiC+78s6arOx2hTuGOfzOd6+fQsiwufPnxP1rVYrEBHa7bZynmu91EAAxFpdIYRSwPFsBkEg7+GwyRIEgcxRQgg8ffpUXmMvpQ7CwkaWy2U0m0153rIsaJoGAHj//r3Se7C8fPkSDx48wI8fP5DL5RSvdrvdf8YjLKvVCpZlwXEc6RV+PzjjbgvRJycnskLm7nE4HMLzPOi6jk6ng2w2i8VikT4IACyXS5m8Ng8uCPlatLA7OjqS1S8nu2j3GO3PUwVh2Ww9o+FUCCE3LFjq9bosAkejkTL24ODgLqbcDWQ2m0HTNNn8bO7+5fN55R0CgFKpJL0WBIHc0xJCbN3T3Vfu/A1xMBhACBHrPSqViuwGWXRdVxJbr9eDpmk3Jrt9JLWPobxrycLd33g8Vu6LbiL8rKQGwvUWG847NEEQpPK81EA4cjUaDSyXSxiGEduvvU9J9Ts774Lwduiu6vWukirI8+fPlRD7Mxl7X0kVZDKZKJtraUrqf+GoVqsQQsTqrvuW1EGCIJDfVtKU/++fav6t8tuA/AWoTnSAo15MFQAAAABJRU5ErkJggg=="}, {"Type":"textChevron","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGUklEQVRoge2ZMWgiTRiGv2K522ILiy2Es9jCwsLCwkKOLSyusNjCwsLCwiLFFRYW4ZIihWCRgxQeyBE4Cw9SyJHCIkUKD4QzIJyFcB4nnBwWFhYWwm2xB1u8fxG+YWd3TWL+5BL+Py8I2cnM7DzOzPe9MxL+I6KHHsBd6QnksekJ5LHpCeSx6VYg4/EY8/n8jocCzOdzjMfjW7XdGmQ4HIKI0O/3b/XCq9Tv90FEGAwGW7fdGoRfdp8gt+n73kFc18VsNruXvr26VxDXdWGaJhRFQbPZvNO+/bpXkEajASICEUFRlGtn5tGCxONxAUJEKBQKd9a3X/8aZDQaodVqwXVdqd5gMAARoVQqYblcIh6PQ1VVOI4j6riui06nI6LUg4GMx2NomiYG7NXBwQGICJPJBABwenoaGGShUBCzdXp6+nAgyWRSWjo8aACwLAvpdFo8O44DVVVxeHgIAJhOp1LbWCz2MCDejcyfer0u6um6jkqlIrXNZDJi5sLa8yz+VZBUKoVoNIrFYoFarQYiQi6XAwCsVis8e/YM7969k9qWy2W8evUKAFAsFkFEqNVqWCwWiEajIjjcKchyuUQul0M8HpcsA4MQEVqtFoDLTavrOqLRKABgNpuBiNDr9aQ+j4+PUSwWAQCmaULXdREkOp2O6NcPcnR0hEKhgOl0uh3IdDpFNBoVHUejURFtGERVVdi2LdpYlgWiy+56vd61nskwDFiWJZ4dxxGBwwvSbrelcWyCCYA4jiNB8IddKYNks1mp3f7+PogIy+USnz59AhHh27dvG0F0XcfBwYFUls/nAyD+XBSPx28GcnJyAiKCpmkoFAriW+p0OhKIfyPzNzefz/Hx40cQEX79+rURhIjQbrelst3dXQlkPB4LANM0xVjOz8+vB8lkMlAUBWdnZxJYrVaTQPzeiUEmk4n4e7FYhEKsVqtQEG7HIM1mU8pRg8EAqqqGOgQJZD6fizDIWq/XoSD+jexNeK1WS8xOmPg9fhB/HqlUKoG9Vi6XoSiK5BACILy2v3z5Isr+/PkDVVUDIP7I4i1///49iAg/fvzYCsR/aLMsC5qmSfaH3zMajTaD1Ot1aJoWeHHYjAyHw1CQ2WyGDx8+gIjw9evXrUC4nEFevnyJZDIp1fn9+zdevHiBRqOxGaRSqSCVSkkVbNsOBfEvG84D8/k8sNZZvV5PWPmbgBiGEYiOAJBOpwPeTgLpdrvodrvi2XVd5HK5G4F4NzjnEU6YrFqtJpJm2GErDCQWiwWiVLlcDszUxsxu27ZIcmEg/kMSb3Dg0tqHhehSqYRIJCIGyX1uAonFYlL45QDz+vVrGIZxPYht2zBNU5zswkD8y2Z/f1/sL8dxoCgKDMOQoks8HhffZCKRCICGzYg/MZumCcuyrgfhczZDcFi9DiSfz8M0TfHMFn9nZwfL5VL0w8Yym80G1r+/b8MwYBgGIpFIAIhnfyPI4eGhqMiRIQyEMz0rkUigWq2K5729vdCXv337FsBlYNF1Xerj7OxMAslmsygWi1iv16jVagGgjSBe4+ZNimEgR0dH4v+8JE5OTkTZ58+fA55N0zQRkjnKeW8W6/V6AMQ7a36gjSAcbdhqXwWSz+fF/9kw+p1po9EQe8y/+Rl+d3dXlHFwYZBSqRQaftfrtXSIC4C8efMGz58/x8XFhSj7+fMniAh7e3sSiKIoGI/H4ty+yZXato3hcIhOpxO4oEilUtA0DZPJBJPJREAzSLVaRSwWC+3XLwkkm80GEiLPkn9GiC7PJGFL8aby7kfvh0HYIXz//n07kGQyGXCWbNz8IN5zgqZpWC6XW4Os12voui764bzht/HsxFnNZjOQkCUQXddRLpelCtw5l3ttPC8xvxPeRt1uVywp/2Z3XReqqgbsSCqVujqPcMJhsRuNRCLiWOq1KL1e71Y/Afg1Go1wfn4eSIjA5flIVVWsVisAwGKxgKIogS0ggXDycV0Xtm0jnU4jnU4jm80ikUgAuLxYuM0tx03V7/cl+8MHO9M0MZvNsLOzEx5ZvQ+ZTAZEhEwmI5ZUu92WrnH+tjbdIfgNpwRSrValyslkEq7r3moj36WOj4+lcXmXGksC8YbWq65eHkLem0l/MgRCvFar1UK5XH5UEKzpdBo44rL+3z9PP0Y9gTw2/QP9cVZ6Icas7AAAAABJRU5ErkJggg=="}, {"Type":"textChevronInverted","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGFUlEQVRoge2aLWzbTBjHH2kGAQaWFmAQYE0BAwXWFGBQYBAQEGDgSQaVFhAQEBAQTQEFkQYCCgI6qWAfAZUaaQUD0VRgEFBVgdZUEJBJkRZpBplkEBBg8H9BdVef7TRLmr6btj7Sgbj38fx8z5fvSvhLhH63AruSR5A/TR5B/jT5d0HCMHwIPe4tG4MMh0OYponZbLZzZWazGUzTxHA43HjsViBEtNViDzn3I8gjyAPNnQDxfR+2bcOyLIxGo50utk7umns8HqNcLqPRaKRGzgTIy5cvQUQgIjx79gzv37//5cXuK6vmZpGS6fX69evEWAFkPB7zzqxJkoTpdPpbQcrlsqBTJpPBYrFYDXJycgIiwvPnz1Gr1SDLMogIjUbjt4FMJhP+Qk3T5Dqdnp6uBmm1WiAi7hue5yGTySCTyXC7/L9Bms0miAj9fh/A7cuu1+urQSqVChRFETo0Gg0QEcbjsbCY67ool8soFouYTCZbK+/7PizLgm3bcF03AZLL5aDrOv8dhiFkWYZhGKtBfN9HpVIROrDJP3/+LIBYlsVtVtf1rWswwzD4PAcHBwJIEAQgInS7XWGMaZrQNG01SJqwyY6OjgSQeBsMBhtDnJ6eps7FQL58+ZJqxpVKBU+fPt0MBACICO12OwFSKpXgOA6ICOVyeWOQ/f19EBEcxxF2mCne7XYF/2TC/GYnIIqiYD6fA7gJj5IkJSriIAjQbDah6zry+bywa7PZDEQE0zQRhiGCIICqqgJItVpNmJDrutB1fT1IEATo9Xro9Xq4uLjA+fl5KohlWXzMYDBIhMSfP38m4n8+n8f3798BAP1+P2GScR+xbZs79XA45DvI2kqQ5XIJTdNS7TYO8ubNGz4uDEMoioJms8mfrbJ/FjRarRay2axgNt1uVwAxTRP5fD4BwCxiJUiv10tdPA0k7tyGYQh+wnxHURS0223uAyz+l8vlRAi9uLgQQKIRLQrQbrcRBMFqkFKpJAzK5XL8bcRB4pGkVqtBVVX+O27vQRAgk8mgVCpxJWu1mjDH5eWlMCZqHasAUkGYE7mui+VyedspBeTy8lKYiJkFACwWi9RIViwWkc/nuZLx/DCdTgWQXC63FiAVRFVV7O/vJzulgEQLSeDWLH3fx/X1dcKPAKBer+P8/BwAkM1m0ev17gTRNC2RoIGb0onltVQQIkK1Wr0XyHQ65VEs7kfRipWI1oLkcrnU/PTq1Su8ePFiNYimaXAcZysQ5qjj8RhnZ2cgIlxdXSXmAm6rhV/ZEdM0E+P39vYSgAJIoVBAoVBInXyds0eff/jwAUSEr1+/poKwOdeBGIaRSIjz+TzxaZEAcRwHsiwLsZ3lg3Ug0cr17du3ICJ8+/ZtI5DRaJRIiPHdZ/qwsj4V5Pj4OLFAsVhMBWGJjQnzkeFwKPjLJiDxMr7T6SSqX13XIUnS3XmEferKsozj42NenKWBnJycpIKMRiN8/PgRRMTLkVUgnU5HeM5eJANha8myjHfv3qFarYKI0iNr/EG0CmVNlmVuk2zyaDkCAEdHR3wXPn36xB0/TXzfBxHh8PBQeF6v1wWQHz9+8MTK2pMnT3B2drYe5Pr6Gtlslg+sVqswTZPHcwbCEhsTVvAtFgvex/M8oY/nefwFSJIkFJ7AbUkS9b944RkfsxIEuDGxg4MDHB4eIgxDOI7Dw2D0eySq6N7eHi/kVgWETqcDWZYB3ITWXC7H/8bK+vi46XTKd8VxHKHiWAsSl1arxcMgU1JVVZ5z2DMG63keiIhncSbNZpPvJKvrXNflayiKkvoClsslfN+/U8dfPjJlCzKlWXVrWRYv7pjNh2GITCbDAwQT27Y5LItImqbxMMv8c5sTmo3PftkdBsvk0RY9Yi0UCrBtWxiraRqveNmuRVu/39/67uVeV29sV6JmxaRWq0FRFG7T7KAtmsiix6DbfPNH5V4gQRDAsizoup4ItewgjSnOoKO2PplMYBgGisXiWh9YJw92GTqfzyFJElRV5bYfr+N2KQ96q8ucmLV4WbNLeVAQz/MgSVKqD+1aHvyefTAYoFKpJK4Bdi3/7j8M/Kny14D8BzlJUi1rfoTAAAAAAElFTkSuQmCC"}, {"Type":"textRingInside","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGcklEQVRoge2aL4ziThTH5y5NDlHRXFZUcEkFAoHoJYjmgkCsQCBOICoQFRUVKxArEBVNyAWBQCAqEBWICnIhOQTiBOIEAoFAIBAVKyoQiArEiO9PbDphKHSB2z+/XPabTLK0DDOfmTfvvb4uwT8i8tYTeC69g6RpNptBURTc3NyAEALHcV5iGE4vAjKdTkEIYe0d5AK9g6TpnwaZz+e4u7tDLpeDoihQFAWFQgG2bWO9Xv/1mK8CIooi+1uSJJTLZZTLZebVCCEolUoYj8dXj3k2SBRFGAwGME0ThmHANE2EYXgWCCEEsixjNBpht9ux71FKMR6PcXt7C0IIBEFAr9d7GZDdbodOpwNJkhKTy+fzZ4HIsozVapU6TrfbhSAIIITg/v7+eUGCIEA+n2fmoapqAubYrhyC2LZ91mTa7TbrMxgMngdkuVxClmUoigLP89h1y7K4SQZB8CTIubZPKWULJ8syttvt34GEYQhZllGr1TibBh5N4FKQyWRy9oRs22b9ms3m9SCUUmiahkajkbjebDaZHV8C0u12z57QaDRi/QqFwvUgrutC0zRQStm19XoNVVWRyWRQLBYvBikUCtzvpWkymXB9oyji7odhePS3EiDFYhHL5ZJ9Hg6HEEURhUIBy+USzWbzYhBCCHRdT0zqmFqtFtdvPp+ze67rghACTdMS54cDWa1WzKVSStFoNEAIgWVZ7KyUy2VuoH3oUyCx61YUBaPR6CRQ7GDifoIgcN/99u3bSXPlQHq9HnOVpmlCFEX4vs/ub7dbZDIZbpKj0ehJkMlkglarxfoKggBN02BZFhzHgW3b+P79O5cBxCu/r/37lUrlNEi9XsdisUCr1YIkSYkgVqvVEiZTKpUSNhsEATqdDjzPg+d5LNYEQYB2u41KpZKY9GFTVZUzKwDIZrMghODm5gamaZ4GMU0T8/kcoijiz58/3BcbjQYEQYDv+8jlchBFEbquw3Xdi/x9LEopZrMZfN9Hu92GZVm4v79Hp9OB7/tHD3SlUgEhBNVqFQ8PD6dBfN+Hruuc/VFKYVkWRFHE79+/ATyu7GF8eQ3d3d2BEALTNBMZc+Kwq6rKPkdRhFqtBlmWEzv0FhqPxyCEoF6vJ9IeDsR1XZZ9brdblEolZLPZJxO+1xKlFNlsFsViEdVqlbvHgcQrH4Yh8vk88vn8yVT9reQ4Dmq1Gvr9PnedAyGE4PPnz/jy5QtKpdJZAey1tV6vEYZh+mGPXd/Hjx/x8+fPV53guep2u2i32xgOh9z1BIggCPj06RMEQUhs31trt9tBlmXk8/lEQYMD+fDhA379+oUwDKHrOgghMAzj4jix2WxgGAZrx6L/Nep0OiCEYDqdolarcfc4kK9fv3KDuq4LQRCQzWYvKgwEQfDs5aAoiiBJEssFUyP7jx8/oCgK56nm8zkURWHJ4znp+EuADAYDFItFdshbrdZpENu24TgOVFXlPFYcU+Jk7Slvdi3Iw8PD0ceCGGQ/m0g97PV6HWEYQtM0aJrG7UwURQxGVdXU+PIUSBAE8DwPuq5D0zS243HLZDKo1+vYbDapY5wEsW0b/X6fBcTDsxFFEXK5HCsFndqZYyCUUvR6PVZcOKcdpur7St0R3/dZ6A/DkGWb8U4Bj2dm/6nvHJByucwWQJIkWJaF4XDIrep6vYbjOAmY/cAXe9PZbIZ6vX4aJAxDSJLEVppSCsdxIAgCMpkMGo0GwjDk6lvHKoOHIHF8ajabT7ry+Kk0btPpFMDjy6N4YQkh6TsS/9BhZrlcLtmPCILAVR2LxeJZIJ1OJxUgVpzhxm02m3H1rlNjJkA2mw0kSUoQA49mZRgG97h7+Fx9DCTN1g+1Wq24vrFJx4XBUql0dFePFuhc14UoilgsFkcH2y+ixauWBnLo89M0HA65s3WuTpZMbduGLMvwPI8LgtvtNuEuDzPRQ5BLsoL9M7Jf+LgaBAAMwwAhBLlcDoZhoNlscuWa2A0f6hDk3ErjarViZnvJbjwJQimF53msenHYJEk6utqHIKfc9L622y2rYsqyfDLCXwUSa7fbYTQaQdd1FAoFKIqCarV6crBjXittV+L38jHENY/WL/Lq7RhIbC79fh/T6RTT6RSu67K0J/Zu175PfBUQx3ESpdZ99317e8tKTdfqRUA2mw10XWcvPWM3vlgsWPXR8zz4vp+aGF6i93+q+b/pnwH5D1bN/dl0+RwMAAAAAElFTkSuQmCC"}, {"Type":"textRingOutside","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGbklEQVRoge2aL8zaThjHTzRLRUUFAsEWkjUZgmQVJEO8ooJkCESXIF6B6BJEBQKBQCCavIIsr0AgEIgKxCsQZOrNhqhAIEiGQCAQFYh3CQJRUVHx/YmlF65XoLx/tl+WPcklUHq9+9w99/wrBH+JkD89geeSfyCnZLvdIpvNIpVKgRACy7JeYhhGXgTEdV0QQmj7B3KB/AM5JX81yGq1gmma1AAQQqAoCur1OqbTKYIgeNKYvwUknU7Tz7IsQ9M0aJqGTCZDr+fzecxms0ePeRHIbrfDbDaD4zh4eHhIDBLC2LYN3/eZe6fTKarVKr2v1Wq9DEgQBBgOh7i6umImJooiBoNBIhBJkjCfz0+OY9s2JEkCIQTNZvN5QVarFRRF4Vb3sMWtYBSk0Wgkmoxt27TP7e3t84DsdjsoigJFUWDbNlzXhe/7uL295VTmHMhwOEw8oVKpRHd8vV4/DSQIAmiahuvr61hrElWz6IBRkMlkknhCg8GA9qvX608DMU0T5XKZg5hMJtA0jVOvxWJxEqTT6SSe0Hw+p/1SqRSdw2q1gmEYsG07Gchms0Emk4HnefTabDaDqqr04ObzeeYgR4GjIKqqMs87Jcvlkum72WwAALVajV7r9/vnQZrNJkajEQDA8zw0Gg16Fvr9PjzPg2EY9KHlcpl7aJz5rVQqnOmNk36/z/RzHAfArx3RdR2EELx+/Ro/fvw4DuJ5HkqlEoBfO5PL5SCKIrrdLp2E7/vUwYmiyKlVHIgsyyCEIJPJwLbto7uzXq+Ry+WOqu3DwwNyuRxUVeXCHgZkMBig0+nAdV2k02nkcjnuILdarbPWKAoynU7R7XYhiiIIIRAEAcViEaZpwrIsdDod6LpOgQ8XYL/fM88OFzTqaxgQ0zQxGo2gqiqq1Sq3cuPxmA5yymnt93t0u13Ytg3btmkU4Louut0uyuUydX7HmiRJ1Nr5vs+dw/DsxILoug5d11GpVLiO/X4fgiCAEIJut3sUIqkEQYDFYoH7+3vYto2bmxs0m000Gg30ej0uBDIMg9md6E4xIIVCAYqiMDcFQUAPvCRJGI/HT4Z4jJimCUVRqKpHVZ4BSafTmE6n9LvneahUKtSELpfL3zDleJnNZiCEUGMUWtZQGJAPHz7Qz67rQlVVCIKAVquVyHS+tFQqFYiiCM/zuFiMAXn79i2+ffuGfr8PWZahKMrZqPV3ymq1giAIuLu7Q7vdZn5jQD5+/Mh441M5x58SwzCQz+c5786AfP78GYQQvHr1Ct+/f/+tE0wqy+US0+mU0xQG5NOnT3jz5g3evXsHQRBiY5o/Lff39xiPx1itVsx1BsQwDARBwMRT19fX2O12Fw22Xq9hGAZtl4Tx56RSqUBRlNMhiqIojDcP009Zli9KjhzHeZFy0Ha7pQFotVplfmNA4pKZ9XpNQ3hN0+C67tkBXwokTLrq9TqXl3AOMS6O8n2f5gOyLJ9VlceA+L6P7XZ78p6w2lKr1bg4kFOtcrlMz0bUCTabzURZ3zmQ9XqNwWAAXddRKBSYol2Y+1iWxcV7YYhfKBS4KIMBKZVKcF0Xo9EIkiTRWlT4wCAIUCwW6YB3d3eJQYIgQK/XQzabPRn1HrZarcY89zBi1nX9OMjNzQ2d3Hw+p6qmqiomkwlXRclkMolANE2jZSVZlmGaJiaTCaNKYUk1Gsof7sphxfLLly/HQTabDbMK+/0elmXRhCeVSqFQKDCDxZnmKEiYTLXbbS78jsph1ZEQwqhQWL2RJImLOricvVgscvq33+/R6/W4MhAhJNaKxYEkNd+HRTpCCAO+WCxQKpVijQ0HMp/Pkc/njzrBTqdzMYhhGIkgon2z2WzifrF1rWaziaurq1hzaFnWxSDHalFxclhFiTq9i0E8z4OqqkilUkwFfb/fMzWtpCBhSSeJhP5KEITYCs1FIMAvBxVaEUmSkM1mYwsGz7kji8WC1gUurciffa2wXC5Rr9epCQ1LOmGLVjPiQKL+IE52ux0NhaKVzmcBicrPnz/x/v17OsmvX79y98RZrVNhzWKxoG+visXioxK6R716a7fbdIJxKhAHEjrGyWQCx3HgOA6GwyFKpRJVp0aj8eh3iY9+h+i6LobDIarVKreCUZB2u8050rCJooharfak94dPAjklYWKl6zo0TaMO1nEcWJZF22AwOOvpk8q/P9X83+SvAfkPv2b7OakXefQAAAAASUVORK5CYII="}, {"Type":"textArchUpPour","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAECklEQVRoge2YIXDqShRAr4iIiEAgIiIqIiIqEIgnIhCICmRFRUUEAlGBQCAimEFEIBAIBKICUYFAVCAQERUIBKICEYFAICIqEBUR54sOO+W39ENL52fe5DjYze6eZe+9G4S/BPm/F3AuMpG0kYmcwmq1+vU5fk1kOp3iui4igoig6zrlcpmnp6dfme9XRKbTKZqmUS6XeX5+BuDp6YlisYiu6+q7c/JtkSRJGI/HtFot2u323vHxPA9d19lsNnvPzOdzCoUCnU4HgDiOGQwG1Go1Hh8fSZLku8s5TmQwGOwtarlcYts2FxcXuK6LpmkYhqGOjed55HK5L8dcrVYYhoGmabiui+M45PN5ZrOZ6rPZbAiC4Dwig8EAEaFYLLLdbonjGNM06XQ6agdnsxm6rlMoFACo1+tomsZ2uz04bqlUQtO0vZjpdDqYpsl6vSaOYy4vLxERWq3Wz0Wm0ymGYSAiuK5LEASUy+UP/XzfR0RYr9fMZjNEhOFwuNen0+nQ6/XYbreICI1G48M419fX+L6vEkU+n2cymfxcBOD5+RnHcVQGajabn/YREcIwBKBarWIYBpPJhCiK6Ha7aJrGaDRisVggIszn84MbIiI4jkMURccs8fhg32w2XF1dqWP278CMoggRYbFYAG/JIAgCLMtCRLAsi/F4DMB6vUZEPiwySRIKhQIiQrlcJo7jY5d3WtZKkoRqtYqIcHNzw8vLi2prNBqYpnl05ikUCtRqtU/HrtVqJ2ewb6Xf3TGxLAvf96nVaui6rnb8GBaLBblcjkqlQr1e5/LyEk3T6Pf731nSf4vc399TKpVotVp7WWgymZDL5XAchyAIjj7L74miiCAIcBxHxRPAdrtlOBzieR6+73+oRyeLPDw8qMDbnfOHhwfVvlwuubm54fX19WSJHbsjtVwuldz7xCIimKap2k8WSZIE27YJgoDVaoXruuTzeRXs0+n0R5X4qzk1TePi4oJ2u00cx1QqFVWjThYZj8c4jqM+27ZNGIa0221ERKXSczIajdS44/EY27aBt6uMZVkf6tJ7Dop0u108zwNQBWyXDovF4t5V4lzc3d1RKpWAt18nn8+rdO77PvV6/eCzB0UajYa6GsxmM0zTVG2e5325O98lCAIlAnB7e6sumM1mU23sZxwU8X0fx3HYbDaEYahEdkVrV8HPSRRFGIahArvb7XJ9fc1yuVQxc4iDIrtrxC7YRQTP87i6usK27bMH+o56vY6u6/T7fUajEblcDl3XMQzjyzfNL9NvGIYqFnq9HoZh8OfPn197y9sxGAxoNpuEYYiu67iu++m97D3Znw9pIxNJG5lI2shE0kYmkjYykbSRiaSNTCRtZCJpIxNJG5lI2shE0sZfI/IPnK/mbji+lKgAAAAASUVORK5CYII="}, {"Type":"textArchDownPour","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAE80lEQVRoge2YL2zyThjHH3HJi6ioQJxAICoqKioqumRiAoFAICpegahAIBCIiQnEEsTEBAKBQExMTEwgEIiJiQkEogKBQFQgKhAVFc1y4vsK0gsH7G9YfvwWvgnm+nD3fO6eP9cSfonov3bgUDqBHJtOIMemE8ix6QRybDqBHJtOIMemE8ix6QRybDqBHJtOIMemE8ix6feCPD8/w3VdFItFVCoVjEYj+Ww8HqPVailjh1YYhuh2uyiXy3AcB4VCAXd3dwCAer3+5toKSBiGYIyBiJTf/f09AGA0GqFQKICIUC6XkabpwQDSNEW9XgdjDJxzXFxcwHVdEBFGoxGSJJH+dLvd90Fubm5ARLi4uEAQBBgOh9A0DbquI45jaff4+AgiQrvdPhhIp9PZcTLzZzqdAgB6vR4YY2CMKf7sgFxfX4OI8Pz8LMf6/f7eXdB1HbZt7zgUBAGEEG86LIRAEAQ747VaDYVCQRnzPA+5XE45+VarBSLC4+Pj2yDZDry8vCgLm6apnEocx/LkNjUYDFCr1T4E+fv3L/r9vjJ+d3cHxhgWi4W003Ud5XJZsRuPx0q47wVZLpdgjKHZbCpGo9EIRATP8/D09ATHcaBpGiaTiVy03W7D87x3ITZhPM/D1dWVtBdCwHVdmKaJ5XIpw7fX6yn/7Xa7O1GzAwKsj5gxppxKmqaoVqsy2RzHkXGbJAnK5fKnIbZhKpUKkiQBsN5Izjl0XYdpmsjlckouJEkCwzBQKBR2Cs0OSJIk8DxPOlypVKBpGogIuq6j1+tJh8MwhG3bKJVKCILgS1VMCIH5fA7XdWFZlgyp+XwOy7JARMjn82i32xiPx+j3+ygWiyAiWY7fBcnk+75SghuNBlarlXw+nU7BOQcRyZJtmuanYbLSmv2Xcy6jIEkSWYq3W0G9Xt978ntBJpMJcrkciAi2bctcyJQlJucc3W4X8/kcvV4PRIThcKjYZlUqCx8AGA6HICJcXV1hsVhgMBjAMAwwxpQkjqIInU4Hvu/D9/2duT8EieMY+Xwenuft7HC73ZYNcdM5YF2SO52OsiFZOBSLRcznc7kRRITlciltkyRBqVSSgF/JtzdBgHWZ23Q0SRJUKhVZvfYtlMvlZJWJogiccziOg5ubGxiGAc454jiWINsSQihrbG/Ut0A2tVwuYdu2zIN9C8xmM6VReZ4HwzCk7WKxAGMM19fXmEwmIKK9jTGrTEQEy7IQRdFhQF5eXpDP52WyDQaDvXZZyEVRJPvRtu3DwwOiKEKapmCM4fLycu9cg8FArsc538nRb4FMp1NomiarzHYjAta7yDmHZVkA1ledP3/+yJzYJ8dxoOu6UgkzBUEgC42maUpP+zZIBpPdPvfdPJvNplLfTdOEaZrvzpntuu/7bz6L41g23o/0pRerUqkExhgeHh4ghMBqtUKj0QARwTAMCCHw+voKXddxdnb24Xzn5+cgIrRaLQghIISQN+7sdD+rL4FEUSTfRzZ/m81stVrtvVBmqlarYIwBWBeI7NawPV8Yhj8Hkjl6e3sL27Zxfn6OWq2m9IM0TaFpGjRN2+lBQghZODKFYQjf92EYBizLQqvV+jLEt0A+o1qtpoRMpuzlqVqtHnzNHwGZzWayFxiGAc/z5EWQc47ZbHbwNX/sK0ocx2g2m3BdVyZvo9H4dIP7qn7v56D/q34NyD9R1OIfzRsxNwAAAABJRU5ErkJggg=="}, {"Type":"textCirclePour","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAF10lEQVRoge2aL5CqXhTHbyAQCAQCwUAgGAwGg4FAIBgIBIPBQDAQDAbCCxt2hmAwGAwvEAwbDAYDYYOBQNhAMGwgEAyGDQaDwUD4vuBwfzIqqCvzfu/N+87szO5c7p8P99xzzj0swV8i8rsX8Cz9A8mTaZqQZRmSJIHneZimWcY0GZUComkaCCH0x7KsMqbJqBQQ27YzIK+vr2VMk1EpIG9vbxmQwWCA5XIJ13UxHA7heR7W6/VT5ywF5PPzMwNCCAHHcdA0DaZpot1uQ5Zl8DwPx3FwOBy+PWcpIEmSgGVZCtFsNi/uwGq1gqIokGUZ7+/v35rzYZA4juH7Pna73cX2RqNBQebzee5Yg8GAmuCjuhskjmPouk4XKcvyRZher0ef+fnzZ+G4pmmCEALHce5dEoA7QTzPA8dxZ/bf7/fPnp1MJrRdUZTCscMwBCEELMsijuN7lgXgDpD5fA6GYdDtdjGfz1Gv1+lCL02+XC5pO8Mw6HQ62O/3V8d/f3+nz08mk3JAVqsVOI7DdDoFAGy3W4iiCFEU6eS6rmf6bDYb8DwPSZIQBAFUVQXHcbAsC57nZcxxs9lkztQjZ6UQ5HA4oFKpZIJaq9XCjx8/sFgsMiZm23buWw/DEJZlQRAEer7q9fqZuS4Wi+eDDIfDjI1Pp1M0m00kSYKvry8QQiAIAgRBwGw2u2nSJEmwXC4xGAxQqVQyJmrb9t0QhSC73Q48z8P3fQBHkxIEAZ+fnwCOEVwURSRJkrsTRVqv1wjDEF9fXw+PkQviui6azSb9u9PpZExM13WMRqOHJ89TFEWYTqf0pRUpF0TXdQyHQwDHt8ayLLbbLYCjA+B5/mpA/I5SD5ma3MvLS2GfXBCWZfH29gYAeH19zXgmwzBKyWrjOM5A3OqSr4Ls93sQQtDr9QAcPVW68CAIwLJsKbvhOA5dvCAIkCQJhBDwPJ97hq6CpB6pVqsBOOZOlmUhjmPUajUK+Gyl6c94PEaSJACOToVhGIzH46v9ck2L4zh0u10AoG8m3fbVavXE5f+narV6MaUxTfMs6J4qF2QymdC3cJoElnkHZxjm4tnzfR8cx13tVxgQUy8VRRFkWUar1fpWzCjStbR/u92CEELN7axf0cCLxQKKosD3fcxms4cy03tECLkaOwghV6/IuSCnudR8PofruqhUKnSXylDuYgnBZrO53JY36GlZx3EcTKdTEEJgGMa3F3xJ6/X6KkgcxxBF8WrfXJDUUzUaDei6jt1uB8MwQAihKf0zlYIEQXDWNplM0Ol0rvbNBVFVFYZhIIoi8DxPD5plWRBF8emHPo7jizfK/X4PWZbhuu7VvoUgaZ5TrVbpPeFwOKBarT49RUmDsCzLtEQUhiEajQZEUcwtG+WCWJZFY8Z4PIaqqrTt4+MDLMs+PTCKopgpDaVX6ryoDhSAfHx8oF6vAzjugiiK8DyPthuGgXq9ftW3P6IwDOnvQRCAEIJ2u104R2EcqdVq9PDNZjNUKhWaLK5WKxBCaKr/qJIkwXq9Pjtzo9Ho5vtOIchoNMq42263C03T6BtSFKUwM72kIAjQ7/dRr9dp/sYwDCzLemiHb0pRTg/24XCAoih0u9PC2i0HP4oi2LZN7+mSJF0sPpRWDoqiCIIgUBPabrc0tlSrVeppTrXf7yFJEiRJgu/76HQ6NJjO5/PMDq7XazrOo0npzQW6KIogiiJarRYWiwWWyyV4nqeTVyqVzPNp5TA1GU3Tcj2c7/v0+UfO3F0l0yiKoKrq2TWUEHIWdU9Lpq1Wq9Du02BYesn0VL7vZ0qmqqqeeZx+v39zNR4AXl5ebi40XFJpX3VPdy4vtQCOwTYtlT4ak0oDScui6b3/UvodRRE0TQPP84WwRSoFJL3Nnf7wPI92uw3btmGaJmq1GhiGQa/X+1aFMVUpIJ7nnX2e9jwPjuOg3+/DdV2EYfiUb4epSgEZjUYZkD/2Hwba7fbfAWKaZuYj0B8L8jv0D+T/pl82gOGZr7UaJQAAAABJRU5ErkJggg=="}, {"Type":"textButtonPour","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAIH0lEQVRoge1aLXTqShcdMSIiAoEYgUBERCAiIhARCAQiIgKBqIhAIBAIBCKCtRARCERERUREBaIiAoFAREQgEAhERAQiIgJRgUBE7CdYma+5/BRub9f31lt3q7YDM7NnztnnZ0rwHwH5f2/gT+EvkX8b/hJ5Bvv9/sfX+DEiq9UKmqaBEAJCCARBQLPZRBiGP7LejxBZrVaglKLZbGK32wEAwjCEqqoQBIH/7U/it4lkWQbf9zEejzGZTArmY5omBEFAmqaF72w2GyiKgul0CgA4HA5wXRe9Xg+LxQJZlv3udh4j4rpuYVNRFEGSJFSrVWiaBkopRFHkZmOaJkql0t059/s9RFEEpRSapkGWZZTLZazXa/6ZNE1h2/afIeK6LgghUFUVx+MRh8MBjDFMp1N+guv1GoIgQFEUAMBgMAClFMfj8ea8jUYDlNKCz0ynUzDGkCQJDocDarUaCCEYj8ffJ7JarSCKIggh0DQNtm2j2WxefM6yLBBCkCQJ1us1CCF4e3srfGY6ncJxHByPRxBCMBwOL+Zpt9uwLIsLRblcxnK5/D4RANjtdpBlmSvQaDS6+hlCCIIgAAB0u12Ioojlcok4jjGbzUApxfv7O7bbLQgh2Gw2Nw+EEAJZlhHH8SNbfNzZ0zRFq9XiZvarY8ZxDEIIttstgLMY2LaNSqUCQggqlQp83wcAJEkCQsjFJrMsg6IoIISg2WzicDg8ur3nVCvLMnS7XRBC0Ol08PHxwceGwyEYYw8rj6Io6PV6V+fu9XpPK9hvyW9uJpVKBZZlodfrQRAEfuKPYLvdolQqQdd1DAYD1Go1UErx+vr6O1v6mojneWg0GhiPxwUVWi6XKJVKkGUZtm0/bMufEccxbNuGLMvcnwDgeDzi7e0NpmnCsqyLePQ0kfl8zh0vt/P5fM7HoyhCp9PB6XR6mkSO3KSiKOLkPgsLIQSMMT7+NJEsyyBJEmzbxn6/h6ZpKJfL3NlXq9W3IvG9NSmlqFarmEwmOBwO0HWdx6inifi+D1mW+e+SJCEIAkwmExBCuJTew36/5yr2CN7f3/m8vu9DkiQA51SmUqlcxKWHiMxmM5imCQA8gOVyqKpqIZW4hSAI4Hnew0T6/T4ajQaA8+2Uy2V+EJZlYTAYPE9kOBzy1GC9XoMxxsdM07x7OjmeJWLbNicCAC8vLzzBHI1G/GCv4SYRy7IgyzLSNEUQBJxIHrTyCP4rfN9Hv9/n3xuNRhgOh1zxwjCEbdtX/SuOY4iiyB17Npuh3W4jiiLuM08TydOI3NkJITBNE61WC5IkXd3Ifr+Hqqp4eXnBcDhEEAQQRRGapsGyLO7MhmHAdd2r6w4GAwiCgNfXV7y/v6NUKkEQBIiieLfSvCu/QRBwX3AcB6Iool6v36zygiDg8mwYBoIg4FG61WohDEM4joPT6YR+v39zXdd1MRqNEAQBBEGApmlX87KbRHJNr9VqPEpHUfRUxD6dTvA8D7quIwgCzGYzAGe/8jzvpknewnq9Rrvd5qrpOM5VJSwQyWuPXF632y2CIAAh5K5i5EjTFIwxNJtNfiO5s5umCdd1n6rZXdcFpZTvabPZQNd1VKvViyBcINLv98EYg+u6UBQF7XYbWZbB8zwIgvCl5LquyzfebrcRBAHPnXRdL9zIVzXGbrcDpRSj0QhpmnL57/f7IIRgsVjcJ5JLXBiGEASBq0232y1kq9cwnU6xWq0QxzEajQaCIMBgMMDxeOQ3NJlMcDwe7/oIcJb/er0O4Cw85XIZwNl0JUniJnuViG3bBa2WZZmry3K5LMSSa1itVlBVFfV6nd+IqqpQFIU7OWMMiqJcnOivUBSF367jONB1nY+pqnqRJReIRFEExhi3P8/zeI6TV4BfJW++72Oz2SAMQ6Rpiu12i9lsxudcr9cXp3kNlFJORNO0glwzxrBarW4TAc5NgXyhLMsgyzIcx8FgMCiUsj+NPAAmSQJKKU+PHMcpHHaOCyJRFKFcLmM6nWKz2aDX63HVqNVqhQniOH66JP0VaZqi0+lcBLu8E1Ov1/Hy8gLgfy2kaxH+akDMHf1zTdDtdgulbZ5/NRqNb9cjmqaBMVa47VzK8zpI0zQIggBZlgv7uEtksVhwAoqiXETV+XzOG2v3eleP4ng88kbf52Q0iiLejCCEoNVqXSVxk0iSJBAEAZPJpJBTZVnGfYUxhsVicXPiZ5BlGVdFQggsyyqMx3H85Tp3C6vPyGMBIQSlUolXjKVS6csC6x583wdjjCeXeTPQMIynbvuhLkqSJPyKdV0vOHde1X0VF26RoJTCcRx+8x8fH9B1nYvLI42Hh4iEYchrdUmSrp5Sv99HpVK56vRZlmG/318dUxSFK9JnnE4n3oBgjD1UjX5JZLlcglIKQRBuphWe5xW6jMA5gLZaLW4qhBBUq1WeNOadyVsVZC6/lNI/1/vNs1hVVa+Oj8fjQrDMza3ZbPJuS5Ik3Ad2ux2iKLrq2DkMw4DjOBcR/FtEgLOzM8Yu0ou8w0EIQZqmvApkjF2YYf4skf+cd9t/9YPZbAbG2M/1fqMoQqVSgWEY8DwPr6+v/A0jNzvf93lZ/BWGwyF36vl8jvl8DsMwHmrIfYsIcI64o9EIpVKJF2CmafLTz/3l1uPMZrPBeDzmJmcYBp8r7yUnSfLstr73GPrx8XFx/XnTol6vXzQocrO79jaSJMnPvyE+i9xkDMNAGIbY7/d4e3vj7yvXHoq+ix97Zw/DEJ1OB4qiQBRFSJKETqfzY2XA33/h+LfhP0PkH0zLHKRhYhw0AAAAAElFTkSuQmCC"}, {"Type":"textCurveUp","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGIklEQVRoge2ZL2zbThTHHzCINIMAA6sKMCgICLCmAmsyMAgICDCItEwKMMimgIKAgIKCSAHRNGkDAQUBkdZJAQMFAwUDAZYWYBCQSQEFAQaeZhBgaQbR9P2B6O7ni5P82v5a/byf+iRL8fndn8/du/feXQj/E6H/egAPJU8gWZMnkKzJE0jW5Akka5JZkPV6fSf9TIKsVis4jnOnOpkE6Xa7sCzrTnWeQB5TDoFEUbSzPJMgnU5nJ8h4PIYkSeh2u6lvmQRxHCe12ZfLJWRZBhEhl8shDEPh+x8DUq1WQUT8uby8FL7/ESBhGEKSJKiqimKxCCJCq9US6mQSpFKpCCDD4RCSJMHzPIRhiHw+j0qlItTJJIhlWTg/P+fv5XIZtm3z91qthlKpJNTJFIjneYjjGJZlCZ4pl8thPB7z9263C03ThLqZAfnw4QOICI7jwDRNDjKfz0FEgpcajUYgEoeeCRDP87g3kiQJsixzkM+fP6NQKAj6DwrSarVQq9XuW10Q0zQF10pEuLi4AACcn58L+4OVPRhIPp9/EBBmOrVaDev1GsfHxyAijEYjAIBt29yDxXGMZrPJYZNyL5A4jnf68kMynU5hWRZKpRIWiwUv73Q6kGWZ51BsrzAQ5sEWiwV0XRdW7V+DLJdLENHOnGeXfPr0CUdHR3wAr1694t+KxSJOT0/5+/X1tQBSKpWg6zpPT1iKMhwOD4PEcYzJZILJZIL5fL5zYJPJBESUamyXsACWnMlcLocoihAEAYgIX79+5fo3NzcgInz58gUAoGmaUFfTNEyn01Q/Aojv+1BVVah4cnLCG2UyHo/5AGazGWzbhmmaGAwGqQ6YTff7fazXa1iWBSLCcrnk7axWK67PVnsymQDYxBA2FsdxbpfG93o9EBHq9Tq63S4ajQYkSYIkSXBdl+sl7Ti55MkBAEAQBJAkCfV6nZddXl5yvX6/n4rQ2yBEBEVRcHV1tRNgJ4jneahWq4ICm7Vms8nLzs7OQESQZRmlUgn9fp+70OSg3717ByLCzc0NL5tMJtB1HUEQoNlspvpLgvi+L+yX5DjvlWsVCgXhoOM4DogIxWKRm0UYhpBlGbqucz3TNGEYhtBWGIaI4xjAJodKTlASZDabYbVagYjw8eNHQeft27d4/vz5YZAoigSbBTYbLgnC7Hx7uS3LQi6X4++yLKPX6213IbS77fkYyHK55L+3V6TVaqFcLu8HGQwG3NYVRYFhGHxwyYrFYhGapqXunthKAcC3b98E77Mt6/V6p+ebzWYcBNjskW0nYhhGaiUFkOPjY0iSBNM0eYRNegwm+6K64zhQFAXA5gxBRPj+/ftOkH2zzVz7crnE79+/8ezZM7x+/Zp///HjB1RVxfv37/eDqKoqBCeuRIROpwNgY3rMne4CYel1u93G0dERfv36dScQ5tVYtqsoiuDZrq6u+B7aC9JoNFJn5TAMhSjOAtb2AIDNuZpt9nK5nDoz3AaEhQAmhmFwE42iCKVSCbIsp9oTQEajEQqFghB02AwwO2VLf319nWpM0zTufi3LQrFYTOmEYQjf9/mEbF8i2LYtgLB9J8syFEUBEaHRaBwGiaIIpmnCNE34vo/FYsEjPZu5ZEDbrps0OcMw8OLFi1SHL1++RKVS2ZuvFQoFAYTFseSzbVYpEDZj7KYi+bB8iAW55NET+DvZYy7ZsiyYppnqUNM0tNttnkEnnYbrujwXYxLHsZA2JQPuQRBgk1oMBgP0ej1Mp1NhBbrdrrD5mdi2LVycmaYJVVUFHRapmctVFAX5fJ7HrWq1ClmWU3vLdV3ouo7T09O9fzf8Y2QPggD5fJ6vQKvVQi6Xg6IofACu60KSJMF26/V66qzNNjJLWdilm2VZ/PfJyclBJ7FPbpWiRFEE3/cBbGa+Wq1C0zRuJmzpPc/jdfr9PoiIu/PFYgFZloWUhZkpe1RVxdnZ2eOBJMXzPIzHY54Bs6fdbgt6zLuxM4QkSalIvlqthLPKxcUF5vN56l73UUCSMhwOYdv2zuAIAG/evBFgG40Gfv78Kei4rgvLsva2cVt51OugIAjgOA5UVYXjOPea6dtKJu61HkKeQLImfwHqm4TSvLEUqwAAAABJRU5ErkJggg=="}, {"Type":"textCurveDown","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGEklEQVRoge2ZLWzbXhfGDzAIMDAwMCi4wCDAICCaCgIMDAIizZMCAgwMAqIpYCCTAgIyDQQEBARUWkBBQEBBYTVVWsBAQUFAQEGBQTUFBBhEU4DB8wfVufWNk36ufbu9fSST+F77/K7PPR83hH9E9L824E/pDeS16Q3ktekN5LXpDeS16UEgSZI8lx1P1oNAarUaFovFc9nyJD0IxHVddLvd57LlSfp3QZIkwXK53Dr4rwKpVCrQNA29Xi8z2HVdtFqtFzHsoVJAzs/PQUTyOj4+VgYHQYAwDF/UwPtKATk4OFBADMNQ3CwMw78DpN1ug4gQhiFM0wQRYTgcyvthGML3/Rc38j5SQIIggG3bAICLiwuYpolSqSTvh2EI13Vf1sJ7SgGp1WqK63S7XRAR4jgGcP3F/gqQq6srxZWiKAIR4ezsDMA1mOu6WK1WmM1mL2vpHdqaR9IyTROHh4cArkFs20atVgMRvapQfGdmL5VKMgl2u13oug5N02RkOzk5eXYj76M7QVzXRbvdBgAMh0MlPBMR9vf3/4ghtVoNtVrt0fPvBcIB4PDwEEQEy7KwXq8RhiGICOfn5482gOX7Poge3x4pM1erFTzPg2VZqFar6Ha7EEJkQNjV4jiGruuZJBnHMQaDAUaj0b17mFarBSJ6dM+jgIzH44zrcIJMg6RLl2azCcuylIcGQSDn5vN5RFF0pyG9Xg9EdK+xd4JUq9VbQY6Pj0FEmM/ncs50OgUR4fLyEgCwXC4z84vF4p0rPZlMQET4+fPn1vtRFGE6ncpUcCtIoVAAEUEIAcuyoOs6TNOUIGx0etVWqxU0TZMhmmFN08RgMIDneSAiDAYD5cX9fh9CCPi+j9lsJp99dHSkjFutVgiCQImUpVIJ6/V6N4gQIpO504XiNhAAKBaLaDQaAICvX7+CiCTYer2G4zjY29uTX4Wfw1cul5NfZBO4UqmAiOD7PrrdLvb390FEmTZDAdE0LdM4hWGIcrl8K0i6BuOyJu1+R0dHSs6p1+vS5fr9PhzHga7rICIZ6tPzOp2O/C1JEti2jUKhsBvEMAwcHBzsNJL7lU2QdrsNIYQCkv70SZLAMAx8+vQJwLUL67qOq6srANfu4ziOsh/53YZhZNyo2WxC1/XdII7joN/vKwOq1aoE4dprE2QwGMgcwCCb6nQ6sqQRQmRW9OTkBESkuLZpmkqSjKII7XZbthg7QT58+ICPHz8qAzzPw7t37xSQzQTIYTmKInz58gVEhN+/f2dgWEKIrVnctm3k8/kb44hQqVQwHA7huq7cU+VyOVO0KiCNRgOe5ykDHMeRD2eQ6XS6E4Q3+21KJ9m02JXSIHxx4mUAbi22gvR6PRiGgdVqBeAmJ7D/LxYLEBHG4/FOEE6qtx3kCSEyCwZch+T0/iIi2LaN0WgkbQKuXblSqewGYSOazSaAm9aXQfjhm+V7GuTHjx8gInz//n0nSKFQUDpPFucg3oOO46BYLGbGMdxOkDiOkcvlZELjz7oJsrkaaZDLy0sQEb59+7YTpNlsKi7E4vDOrhsEAXK5nOJGZ2dn0DQtc/aWcWauaPnibJ8G0XVdCYmbdZKu60rsZ3FuGY1GW92PQSaTCYCbU516vY4kSXBxcQHLslCv1zPPzoAsFgvk83kQERzHwenpqdK3c6mQLhy5SOQxjuNs7e2FEKjX65jP54rBLHYtzu7r9RpCCHk0xTal98tOEIYZj8dYLpfSVTjkCiFgmiY8z0OSJIjjGIZhYG9vT85vtVrQNC3zQsuyZLTSdT3jolzKp7P76ekpbNuGZVloNBpbIXaCpBXHMTzPk6snhJD1T7lclrVP2ih2Ea63gJvQzSWQ7/vQNE1Wu7wgmqYhCIK7zHo4CIsLPiGEPIRI76V0EccliWmach/wavOCzGYz6TLNZhP5fB6macL3/UcdOT24t1wul5jP50oTZhhGZuN2Oh1Z2RaLRRBRxt0Yjq9Op4PJZPKo1vlJ/yH2+314nrf1JOXXr194//69Yujnz5+VMUmSoNfrwXXdTLH6UD3rn6FRFKHRaMhNvlnF/kn9f/6r+5r1z4D8B1TcfmbMVYbLAAAAAElFTkSuQmCC"}, {"Type":"textCanUp","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGrklEQVRoge2aIYgbTRTHX2HFUkJZSsTSroiIWGjEiYoToUREpCWFiIhAIyKuNCIi4sSJowRORFRERJyICPRExFEiUnqFiEBPRJyIiDgREeiJiBURC13KUv6fON50Z3aTXu7r9Tv63YOFJPtm5v3mzbx5b+4If4nQf23A75I7kNsmG4GcnJzAtm2MRqMbMgcYjUawbRuTyWSjdhuBdLtdENGNg1xnjDuQm5I7kE2U70A2kDuQTZSvA+J5HgaDATzPu5L+HwdxXRfVahU7OztwHCdSf7FYwDRNEBFM08R8Pg/pOI6DSqWCUqkEx3H+PEi5XAYRgYiQTqcj9dPptNAhImQymZBONpsV74vF4u8F8X0f/X4fZ2dnkSBHR0fQNE0ycjAYSLr9fl96z8/Hjx+FDhvNj6Zp6PV6K0Gm0ylc170aiOu6yGQyICLouo7ZbBYCKRQKIQPL5bLUD3vMMAw0Gg0kEgkQEfb29kI6wSefz0eC7O7ugohg2zaWy+WvQWq1mtRxoVAIgei6jng8jtPTU7x79w5EhHg8LvXDhrNBPPupVEroWJYl4MbjMUzTFJ4OgkwmE8mmRqOxHsT3fcRiMamRruvCnQxCRGg2m6JdMpkEEQnvOY4DIsLW1pY0WDKZhKZpko5pmvB9HwDQbrdF/0GQarUq2RSPx0WbSJDxeAwigmVZwsVEJPYKg2iahsViIdodHByAiNDv9wEAw+EQRIT9/X1pMPb2xcUFBoNBaKktl0vouh4CYc+lUinxWV16Ekiz2YRpmsLISqUiGcggweUB/NzY7KVOpwMiwvv37yW9VqsljAgGjqBsb29Lhs5mMzG5rutiPp8jHo9LKyIEks/nJQWOIN1uVwIpFotSJ+fn5yAi7OzsAAAajQaICNPpVNIbjUao1WpwHAeHh4eSt1l4GTEIT1JwX9RqNWnvhkDS6bTUMW9QFUSdDQAgIlQqFcmYdcKwajgNeg2ACCbBpTQYDEJnkjRaIpGQUgl2qwrC31WQUqkEAHj16hU0TcP3799Xguzt7UXC8t5hw3lfBe1yXRdPnz5dDaK+nM/nkuHs5g8fPoQMePToEV68eAEAKBaLePDgwUoIAHjz5g3u378f+v3z588SSKlUgq7rIb21IKq7OPqoHok6dROJhGifz+dhmuZakHK5DMMwQr+rKUomk0EikQjprd0jx8fH4vP5+blI+DYFWTV4UFbp8OEXBInFYuh0OtJ+WrtHoiCuA5LNZvH48eO1INlsNhKEl3MQhO0wDAMHBwfwPC8UOUMgwdT7uiDPnz/Hw4cP14JUKpVQWhMFombQfI6pGXcIJJfLiQb1en0jEA6/L1++hK7r+PHjx0oQjkaqqEvr2bNnkVm0GsmknjjcEhFqtdrKqPXp06eQAYZh4PXr1wB+ZrWqLBYLtNtteJ6Ht2/f4t69e/j27Zuk8+XLl9DS2t7eRq/Xk5aZ2r/0jXOmQqEA3/dDIOwRtfbwfR9EhN3dXQAQnlQrx+ABywefeiCqUatcLiOZTErvbdteD1IsFmFZlsj3V4EcHh5KnUynUymN4AkZDoeS3tHRkfid+xqPx5LO8fGxBFKpVEJBwXXd9Xskk8lISdzZ2VkkiJrV8uDclr+3Wi1JjwGn06k4wdVJ2d/fl0Dq9bpI/YNycXGxGiSZTEqu5sF+lTTy4Dy77CHe/CwcSJbLpZiker0u6agVIudkUVXhShD1kOF1rILEYjGpsLFtWyrAPM+DruvQdV2UBI7jIBaLwbIsoaNpGizLEn35vi9CP4PwcgzW+huD8AyqIESEXq8H4Gcak8vloPZFdFmDz2YzlEolKdUHgK2trch6J6oeUZeperUkgWSzWfHZ8zxR9rbbbWkgXddhmiaazSYMwwARodPpSB1z+q0+wTSIo1ssFkO1WhV9qWeVYRih5Vyr1VaDBD3CMx2MRgwSPDSJLktfNdQ6jiPKVn4sy5IOsdPT0xAoh9YgSDqdlsprvltYCRK8LOBciIhQrVYlkOASiNrULKpXeAkFhUtbfjiyBUE4mLAdJycn688RTdMwHo9F+sD3Ufl8XgKZz+coFotiBoMXEap0u12USqVICODytOcLhVwuF3nTGLwOyuVyME0zlKdJIMGZ4YiTSqVEETObzTAcDuH7PnzfF3fA/1Y8z8NoNILneeKzOjlqemLb9mqQYNbL6cZkMrnyTfpNyng8lq5p16bxT548AdFl7f3169c/auhVpNPpiADC4Z9FAmm1WigUCiv/THAbxHGc0BUS8H/9z4fbLHcgt03+GpB/APnJiyIuPGi/AAAAAElFTkSuQmCC"}, {"Type":"textCanDown","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGkUlEQVRoge2ZLYwaWxTHTxPETTuCJjRB7DaTZgUCgUCQFjECQROaILbpCsSIbVKBQKxYgSBZsWkQKxCbhmQRK1bQBIFAbFLEiArEpkGsQCAQIxCIESMQ/yeaczv3zgxveW/b1/TtScZwz3DO73LP14Xwhwj91w7clzyA/G7yAPK7yQPI7yZbgTiOg1wuh5ubm5/lD6bTKXK5HL5+/brVe1uBjMdjEBHG4/FWRn6FjQeQnyUPIL/CyK+w8WeCrNdrdDoddLtdeJ53b0a2kU021us1er0eut1uaE0BOT09BRGBiFAsFrFcLu9s5L5kk41yuSz9Gw6HypoCUiqVpCIRIZ/P39nIfUmcjW63q/i2v7+vrCsgpmkqykSE6+vrSCOu66LRaKDf7/9r5weDAer1OlzXjQRZr9fY29tT/MrlcptBDg8P0ev1kEwmQUSoVCqRILlcTn5pr9eLdNDzPFiWBSEE9vf3sVqtQjr9fl9+TzabxfX1dQiEPzMMA81mE7lcDqZpbgaZz+cAgMlkAiJCKpUKgRwdHSm7k06n4ft+yEnbthU927aVdd/3kUqlFJ0PHz6EQOr1OogIV1dXClgsSLFYVBar1SqISAY9g6TT6dAR1H+VxWKBRCIR0ru9vZU6l5eXoXUGC4Lk83mk02ms12v5mRAiHkTPBJ1OB0QkO1EGISJkMhk4jiNhS6WS8u7x8bFyZBiq3W5LHc5C5XIZw+EQ2WxWvhMEMQwD9Xpd+f6NMRIkDjrOux0E4SBfrVYQQsAwDOX9QqGgvMtZJwicTCaRSCTguq7cSB1kOp2CiHB5ean4ZllWPIguHCc6SCqVUpzmWOA5ZT6f4+nTp3j58qUM8NVqhWw2ixcvXgD4fvSi0ihnTgbhZDCbzRS9g4ODu4PM5/NIEP0YnZ+fK7+S4zggIjQaDUWPgVerFQaDAYgIZ2dnik6tVlNAWq1WKLABbK4jdwXRHWTHT05OAAAXFxcgInz69EnR+/jxI4gIjuOg1+uBiDAajRQd7i4YhDMky3K5lBsSCzIYDFCpVGDbNmq1GnZ2diJB9F5nuVwq6fXk5AREhMlkouj1+31Uq1W4risTCcdHUCcIYts2TNPEYrFAs9mU9W0jSLCXiUqtDKIHHgAFhPN+VG1hiTsyemW3bRuJRCKUyvf29uJBoupDFIiepgEglUrJc1ur1fDo0aONIEdHRzAMI/Q5H1MGsSwr5I9hGHAcJx5Ef4HbEB3ky5cvIQd2d3dRLpcBAG/fvsWTJ09iIQDg/fv32N3dDX3+7du3jSCWZSlFNRak3W7DcRy4rhsb7PpuAN/TJuf2N2/e4NmzZxtBDg4OQv0S8CPBMEixWIQQArVaLdJuJIheLeNAotr4IIhlWZFOBsWyrNA5jwKxLCvUOrEvsSB6tfynIKVSCc+fP/9bkCjY2WwWAonSq1ar8SB6oeMv3Rbk9evXStccJeVyOdJB3YZlWUin0yG9QqEQD6JXy7heKwoklUopMfL48eONILZtRzqo2+BKvxWIfrS4+uogFxcXoS82DAPv3r0D8D2Qo4xza+L7fmR1BoDRaKSANBoNEBGm06nUWS6Xm+uIvshDjg7CrUjQQR6KgB8FUb+J4RrR6/Vkm69PjWdnZwpIu90OFeHhcLi5+zVNU/Y+vu/LAqmDsMMsOiBXbb1Fubq6kk7qsw7L4eGhAsKtfXC6tG07NG0qIIVCAdlsFsvlUhmMdBD9doWd4lGUHT4/P1f0eLdns5nsfjudjqKTz+cVENd1QURIJBIYj8cYjUYQQuD4+DgehHeSH+5vTk9PFRC92eOY4HmE5xi9S65UKiAirNdr3N7egohQq9Xkuuu60mYwobx69SrUdXz+/DkehB3gx7ZteXOhgzAcz+ZCCNlbeZ6HRCKBnZ0dOYD5vg/DMJDJZKS9ZDIJIYTcFI4HHUS/7NAHuxBIcHfT6TQWiwVM05TnkUGy2SyEEGi327If04OPR10+OjxnBGdv/oUKhQJarRaEELJND4K4rgvDMCRIq9XS3Q6DeJ6HTqcjr4Xy+bx0kkGC8cOPftabzaZcC178BTtnTu/BhzdSr1X9fh+ZTCYUG7EgujiOI7MRg9zc3EAIIY0nk8lQGuX2Jvgkk0klJfNx43UhRGiwuqts9beC7/sYDofwPE+58I66HQd+FDN+gldBLJzh+Jd2XReDwSDy34B7A9FlNBopd8O6eJ4nW5FGoxEKUJbJZBKa3beV/+f/7L+z/DEgfwGqM5x9rUdafgAAAABJRU5ErkJggg=="}, {"Type":"textWave1","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGdElEQVRoge2aL4waSxzHf2LFihUrVqxYgUAgEAjECcQKBAKBuLQIBAKBQCAqSHqCBIFAIBAIkq4gKWlIeoKkNLleaEMbBIKkTXpi0yAqVpxYgUCs+FaQme7sn3vl3d27e+/dL7mE3Z2d+X1mfvOd38we4T9i9NAO3JX9f0GazSZqtdp9+HIrOxrENE0kEon78OVW9gTy2OwJ5LHZE8hjsycQALAsC61WC67r3rljx1osiGVZyOfzmM/nwn0GMp1OQUQgImSzWez3+ztxaLFYYLPZHP1eJMjFxQV3UtM0OI7Dn5mmCcMwkEwmeRkiwnA4/Pve+x0igmmax78XvOE4DnRdj3XSNE1+X9d1pNNpPip3YXcG0ul0QESQZRmyLIOIUK/X+XMGIkkSbNuG53nI5/MgInz79u12FLhDkFwuh1wuB9d1eYgVCgX+nIGUy2V+j5Xr9XpCXb1eD4qioFqtwvO8fw7EdV1IkiT0rKZpQsUMxLIsoSJd11GtVvn1er2GJEk8DP3P7h1kOp0ik8kIBRKJRCTI1dWVUK5UKgnz5OXLl8I8UxQF79+/vzXIYrGAbds3g3S7XVQqlT8CCdrZ2RkUReHXJycnICKUSiWUy2UQUajuY0Ha7TaICIZhhORe8KhWq6HdbgsFDMMIgWiaFmqErStMqlVVRSKR4A0Wi0Woqiq847ouGo0GOp0OLxcHMh6PhRGeTqfxIIVCAaPRiF8zBQuCRKUoi8UCRITtdovdbhcagfl8DiLCarUS6mKOMUGJAtnv99A0TQBpNpvxIO12G9vtFgAwm834ZD0GZLlc4urqCkSEfr8vOCPLMle25XIpOEZEmM1mkSCj0QhEhFwuh9lsBkVRkM/n40GY2bYNRVF4A8eALBYL/vvi4kIoc3Jywnuy1WoJCysblSiQTCYDVVVxfX0N4HAAEvQhBOJ5HjKZDIgIxWIxcrLfBDIej3F5eQkiwuXlpVDm+fPnePbsGYdiMu55HhqNRmTHbbfbUChNp1NBWCJBut0uVwbHcY4GsSyL//bPB+ZAt9sFcBCDVCrFn7muy6PA395kMgERYb1eh9q6ESSVSkGWZZ6BRoFEqVYUCJtvQYsSA+CgmkGQZrMJWZaFzMC27ZtBNpsNiIj3WhwIEfF4DYKMx2N8+PABRITv379HgkSJAfB7Uvvby2azoYSUSXEsyGg0QjKZFOhlWY4ECYbN+fk5n+yr1SoUDn778uULiAivX78W7n/8+DEEIkkSTk9P+fVgMOBqGgvSaDSESeU4TqRqBUcN+K1Cm80GX79+BRHh06dPkSBxqrbf70PtsezbdV1Uq1UuCLlcLh7ENE0hGbQsKxYkmJP5Q+7Hjx8gIrx79y4ShK0XQVUDDiLA2mMdmc1mhQUxlUoJm70QSCqVwmKx4NcsR/Kri381Xi6XAA4xL0kSdF0HAFxfX4OIMJlMIkFY2s/e95t/TjLp9f+l0+kQRAgkkUjwyvf7PVRVhSzLgkqxra6maVAUBf1+H9lsFkQkxLKu6+h0OpEgbA75Oy0KZL1eCxCVSgW73S6yTgGEiPhhQ7fbhaqqPC6ZSrF1pF6vh3prPB7zuorFYkhee70elssl7+m/AmFzKZvNCmX3+31ofxMCaTQamM/nkCQJzWaTJ45spM7OzlAul2HbtrBx0nVdSK1brRbS6bTQWK1Wg6ZpfB05Pz+/EYQtB4PBQCizWq2EcA+BGIbBHZNlGY7jwLZt/Pz5M9QgcFh1WfgFFYil9f6jnUKhwB2I2mUGQdjIBbcWk8kklI8JICzHIqLY+A6a53mRceu6LmRZ5iHAst9iscgdDjoIiOuW67pcfv3WbrdDX80EkGazCSJCPp//48OCm4ypXr1eR6lU4qELHBSyVCoJ5T3Pi1xHgil7oVAIZQUCiOM46Pf7scpwrL158yYkCG/fvgUAVCoVJJNJoTxTKT8IC102/3a7HRRFCUn3vX7V9TwPp6enHMIwDP6s3++DSDwLGwwGIRA2kkwRWYoS7Ox7/zzteR4KhQJ0XRd6ka0lLNSA34utH2Q4HIKIoKoqKpUKJEkSztmYPeh3dsMwIEkShsMhPyEJgnz+/DkUnq9evQrV9aAgL168EByUJEnItZix3SRLFqOE6EFBXNcVksGorTVwyOWSySQymUzsmvbg/8KxXC6haRoSiQS2220kyJ/Yg4MEbbVa3d2Hnn+jPYE8NvsFyIFK1JCsNRQAAAAASUVORK5CYII="}, {"Type":"textWave2","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGNUlEQVRoge2ZL2wiTxTHnxiBWIFYsWIFAsElCERFBQJRwSWIFQgEAoFAVCAQiIq9XHIIckEgEOSCQFQgEBUVXI5cSI5cEHs5BJcgViAQFRUIxIrvTzQz3WF22/Jroff7pS/ZpJ2dnXmfmfdvBsL/ROi1FXgpeQM5lFiWhWq1uvd3fx0IESGTyez/3QF0eZa8gRxAl2fJG8gBdHmWvIEcQJdnyX8WZLvdol6vo9PpADgiiOM4mE6ne08UJplMBkQEIsJwOAwF6ff7GAwGoePsDZLJZBCLxfb9LFC63a6AICKkUqlAkEajIfr0+/3AsV4VhCsej8ehaZpQ1g+y2WwQjUbFO03TsFqtlLGOAjIcDlGv13F7eyvalssliAinp6fYbDZwXReRSEQB+fLli7RrRIRPnz4dH6TT6QgF0um0aG+32yAiXF1dibZKpaKAFItFEBHOz8+xXq+RSCSkcY4CMpvN8O7dOwHCGMPXr18BAOVyGYZhwPM80b/f7ysg3PzW6zUAYDQagTEm7W4gyGw2w2g0ehGQWq0GIkI0GhVm02g0hIK5XE7qP5/PFRDGGBKJhPjf8zzoui7tpAKyXC7BGAMRhR5ungrieR4Mw4BhGFgsFhiNRiAilMtlAIBpmqjVasp3fpCbmxsQESzLkvoUi0W0Wq1wkM+fP0tOVa1WlS3cBWk0GqjVamLruXDFu92uaIvH4zg7OxMK+99x0TRNgDiOAyJCpVKR+jSbTWWhJZByuaxEiF6vFwpSKpVEv5OTE6nfx48fwRjDzc2NaLMsC+12G9vtNjQnxGIxATIej0FEyGaz0kINh0PFLCWQTCaDZDIJ13VhWZaI8X6H5CB8Ev/jt1vLspToslgsAACu64KIMB6PnwTC/azdbot2v98oILlcDvV6HcCdjfOIMZlMFBAOahiGmKxUKol+8XhcMQku3Kn3AeFPuVzGfD5X/FQCWSwWkinx2oevBAfhEahUKsHzPFxeXord46JpmuKQXLiC/gUKAuHAsVhMgkmn09B1PRwEgGRGm81GJCM/CM8JfruNx+NgjN0PTITr6+sHQR7bEW6C7XYb4/FYWAh/HgQJGphHGj9IPp+X+vFAsVqtsF6vQUSh+eghEH/4vb29BRHBtm0AdwvrDzB7g/gTFAfxmxtwX8kul0v8+fMHRIQfP348CHJ5eSm1c8X98+1aBABUq9XHQfzhMgiEO/m3b9+kfldXVyAifP/+HT9//gQR4ffv34Egk8kkMI/w3OOfT9M0JSECkAKLAjIej8EYg2maKJVKsG0b0Wg0cEf8vsS/5X7B/3ZdV+rjui663a4wvd2VbjabCkg2m4VhGArI7vyPJsTdgXnU2hWufK/XCwWxbVuEzUgkglQqJb1Pp9PKfB8+fAARYTabKXOGgpycnDwJJKjWCgKZz+dSn3K5LJJkMpkEY0z0mU6ngfNxc/OHcsdxRHINBInFYkgkEjg/P0cul0M2m5Vqn6eAjMfj0KhkWRYKhQKA+7NHKpVCt9uFYRjQNA2GYSgnxN3d6/V6StUggTDGFAcMilqPgXBn3r0sME1TVA6DwUDZ+Xw+r8wH3Js8161QKDycEHVdV1ZxX5DpdCoS2cXFhXjPHZwnSc/zEI/HpUOX4zgoFAoib3DhVXAkEoFlWWCM4fT0NBwkmUz+a5Dr62vh4Dwf+MNmo9EAYwybzUa0TSYT6LqOaDT64FUPcFcH7tZcoSBnZ2dK2W6apgJimqYyUavVAhGJ84thGGKVF4sFdF0PPGs/VX79+oX3798LkN0jgATCcwcXz/MCoxYRYbvdYvdbf9GYz+cVH9jN5PvKarWCZVnIZrPK/BLIxcWFdEDiThsE4jiONFAqlZLqL14R82f3ouGlRQLp9Xoguru6BIKvZziI3wS5czebTdHmd2ZN0wJL9oOB8Jit67qoqcJA/PZer9cD88ZisYBt28ruHUKUorFQKCgm4T9W+i+dW60WOp0OGGMHN53HRAFZrVbirrVYLKJSqUjJJ5PJQNd1cUrkT9DVzjEl8DyyXC4xGAzgeR5s2wYRifKe5xF/VNI0TbkOOrY8erCaTCYwTVP8JsJBXNeFaZqIRqOhR9pjyqv/0PNS8uo/vb2UvIH8bfIP/BpHp/Ltbr0AAAAASUVORK5CYII="}, {"Type":"textDoubleWave1","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAG8klEQVRoge2aP4gaSxzHf8UWW1xhYbEJW+zBFhYWQiRYXMBiIRYWQgxYWFhIkGBhwEKIhWBxhAtYmOQCV1zAQpIjXHEBIRewMHCFhYWFxRYWFhYWhizBwEK+r7g3k53Z1Xd37x4vee9+MMXNzvzm95k/v/n9xiP8R4T+bQOuS25AfjX5/4IMBgNUq1WsVqtrN2Y6ncJxnCv1vTRIv98HEWE6nV5pwE1yeHgIXddh2/al+/5yIESEfr9/6b43IDcgG+QGBP91kPF4jEQiAU3TsL+/L3z7bUAcx4FpmiAiXsbjMf9+VZCgi24ymUDTNEQiEczn8+sFef78uQBBRHj8+PGVQVzXxc7ODjRN81106XSaj1EoFK4XJBaL+UAUReEhyWVB9vf3uZ5SqcTrZ7MZFEURxmi329cDMpvNQETY2dnBYrFAv9+HqqogIkwmEwFkPB4jGo1C13X+LUju37/Pjb1z5w6+ffsGANxob8nlctcDwpbWa1itVgMRodfrCSDFYpEbEIvF4LquT/lkMgERQdM0PvtMdz6f56tk2zZ0XYemaYEgq9UK9XodpmlC0zQMBoPNII1GA9FoVGhwcnICIuLei4FsbW0Js3l8fOxT3mw2oSgKRqMRKpUKiAgnJycAANM0oaoq5vM5AKDT6XBdMsijR4+Ese7du4cvX76sBymVSsjlckID27ZBRGg0GgIIEUFVVYRCIRAR8vm8DySRSHB9g8EARIRWq3U+8J9bmInjOHzVvCDe8bxFXhUBJJ/Po1arCQ2m0+lakH6/D9u2EQ6Hoaqq4GKXyyWICIeHh9xQIkKtVuM6vYcfACzL8oGwOrns7e2tB0kmk74G60Di8ThvU6/XQUTodru87uzszOfdcrkcHMfh35rNpjBWoVAQQLyrVCqV4DgOdxKFQmE9yO7urs8DsQMrg5TLZd5mNBr5lL98+RK3b9/Gjx8/IMvR0ZGwWvKEMBB2Pg3D4O7fdV2YpolkMrkeJGhAXdcDQdrtttBW0zSYpsn/LpfLPsfBhHlHGaTVagkg7O/d3V2hXaVSEcZaCzKZTHwXowxyenoq9EmlUiAiPnMPHz5EJpPZCCJ7J7m+XC4Htut0OtB1fTPIYrFAJBLxHS4ZRFbO3CuLy+LxuLD9rgKSzWaFyWHCbNgI0mg0BIB4PB4IMhwOhX4sFGFGbG9v4+nTp4EgBwcHFwJJJpMIh8O+/n8J4rouPxOhUAitVmut15JjLWYE23LePrK8fv0aRIQPHz4I9e/evRNADMPwnQUA6Ha7m0GYkbquYzabAVjvfmWQXq/HD/D3799BRHjx4kUgyJs3b0BEePv2rVD//v17H0gsFoNt25hOpzg7O0OlUuHx31qQdrsNVVUxGo14nQzCXK0ckn/8+BFEhFevXp0rDvBKTNZ5LXlr3bp1K/AyZGW5XAaDlMtlWJYlKF8HIt83nz9/BhHh2bNnHKTT6Qhter0eer0evx/+CoRt86CSzWaFvgKIZVk+nz0cDi+0tVh9o9GA67qBhkajUeRyOYzH48D7QQYxDCMQolgs+qJtASQWi/kGZ7N3GZCvX78Grsj29jaePHnC4y45QA0CiUajyGQySCaTKBaLgSG8D8QwDJ53MGH5iAwiK/SCAMFnxLsK4XAYsVhsI8jdu3fx4MGDQMM3goRCIZ9vj0ajgSBHR0dCOxY/ecN0b1DIzhqDsywLqqoKW2Rvb893j8gxFRM5shBAiH4mPgBwfHy89maXYy3ZE4XDYVSrVZ8u5hFZgOjdAdVqVQBJpVK+VQPOc5uNIYrX4Pl8zr2Goig8d2AglUpFUNRsNgUjIpEI0uk0/16v1xEKhfjf7Ox5EzIWrzEdhULBZzCbNBnQd0YURUEul+OZXyaTgWEYPERnIIlEQlDE4iIWa1mWJRhhmqYQRK5WK2xtbUFRFPT7fe4dvSBshbz3BZsU+ZoQQORgkeXb3r3KQBRFwWKxEPoqisL3fKlU4luJ3frydmQPEHJhIHLYwySTyWxOrNhzjHwu8vk8IpGIABIKhXBwcADg5yXpXW52cA3D4DPvBQd+5vGssAcNBsJWSc4kdV3fnOqyYExVVcF1np6e8r3MQCzL4u46mUyCSMwaP336JBgp3xlBk8f0eFNdovPnJPmB0OuUfCDAuXfZ9IrovS/kLSErZ+9UsnfyiuM4SKVSiEajvlQA+Hm7FwoFDIdDnvCxoHYtyEWk0+lgOp3yKJSIEA6HfQkQ217FYvFCeofDITRNE0DYgfeWoBT6b/3OzrJC73nyiuu66Ha7ga+Q62S5XApnybZt4Y2YiHw/dQB/E8RxHGQyGWSz2X/kd3cmLHcnIkQikcCxfov/fHBdF/V6Hel0mj+xyvJbgFxEbkB+NfkDUJRbE8hV/lcAAAAASUVORK5CYII="}, {"Type":"textWave4","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGqElEQVRoge2aL4gbTxTHn1gRyhYiAo1YkULEihQWGhERsZSIlEZEBBpRaMSJiIiIg0acOIiIOHEiIuJEChERJyKOEpFCoEd74igRV4gIZcWJiIgTK1ak8P2JH2+6M7N717T98fvR3z0Ykd2ZN/OZffP+DCH8IUL/9gJ+l9yD/Nfk/w0SBAGCIPjda0EQBDg4OMDFxcXOY3cG8TwP2WwWnuftPNldMhwOQUSYz+c7j90ZZD6fg4juQW6TexDcg9yD3Cp/PIjv+6hWq8jn81gul5FjfwnE932USiVks1msVqufWnxY4kDq9TqICEQE27Yjg/EvgTSbTTFBqVTS+gZBgPF4DN/3fxrk6upKzMFtPB7/PpDFYoFEIiGUG4aBm5sbqe/h4SGICOVy+adB2u22BhKl76dBeJHhNhqNRL8gCJBMJsW7k5OTSH3L5RK2bSOXy6Hf72sg2WwWRIRutwvP82DbNkzTxHa7vR2k3+/Dtm1ks1m0Wi1cXl5Ggriui3Q6jdVqhb29PRARarWa6Pf+/XsJslQq4du3b5Ku7XYLx3FEn3w+L4EEQQAiguM4YuGj0UhYRCzI5eWltstEhPPzcw3EMAwMBgMAwHq9hmEYSKfTot/x8TGICLlcDul0GkSkbQqbktoYZLFYgIhwdHQkxvi+j0QigclkEg8SZS7sKVQQIsL19bV4XigUQETinPBX8jxPMsewFItFEBFM04RhGBrIeDzWNhIAKpUKjo+P40F48qjGi+ZF5fN5SVGr1ZJ2/fnz53j69Kl4/+zZM7x48UL8vr6+FhDL5VLsfhik0+mAiDSv1+l00G6340FqtRpM04TneQiCAIPBQCifzWYSyKtXryRFbEq8iEwmg0qlIt4fHBwgkUiIGMAHe39/X/QplUqSjkajgWQyCVWGw6F0HjUQ13WlyYHvX4nPA4N0u11NOREJ2yUitFot8f7s7Ew6pKw3fGjZ1TJIpVJBJpPRQObzuWYREkij0ZB2CAAmk4lk3wyiBiV+PhwOBUj4THieByLC6ekpAMBxHFiWJenodrsSiOu6yOfzmE6nGA6HAno+n2uAEshms5FiAQCsVqtIEDWN4Of85cJQYrKQBzIMQ8sG1IDIziDcHMdBr9e7HSRKvn79CiJCp9P5IRAGjgLJ5/PS+2azeSvIkydPYp3Po0ePdgNhk1C/yNXV1c4gqs5wfIgCefz4cSzIw4cPdwNRTYvd5JcvX6R+Hz58ABGh3+/fCcI61fcqiGVZsCwL7XYbh4eHwosxzA+BbLdbzGYz2LYd+UXUeiTqsMeBqH3jQDKZDOr1utTH933h8WJBgiDA3t4eMpkMTNOUPuVdIOxe2StZlhULMp1OIz1fFIjrupE6+MxGgpycnMTa5F0gUYtQ0wiWt2/fgojw7t076fnp6ammo1AoROpQRYvsUXnWj4CokT2Xy2m5VRx03PNCoRAZEO8ECfvtVCqF/f19UaGpIGppy9Ui52Su62rBdVeQSqUiJaIsm83mdpBMJgPLsjCbzUROFOd+1UW4rotUKiV+v379Gi9fvrwVhPO3OBDenOl0KvUbj8fCO0aCpFIp9Ho9qUMciFoPpFIpVKtV8bvX68FxHE1XeMGqM+AklUGOjo6kYMzS6XS0ZFICISItRYkDCdv/+fm5lkhOJhOYpinpyuVyGAwG4lCrIFwPMQjneclkEuv1WvQrFou3pyiWZWkmwwFQBQm7RfbrYRNYLpcgIukeKp1Oo1ar4ePHjyAivHnzRpqLTYnXcHNzIwou13WxWCxEqau6ZQnEcRzNt7PPV0GI/i6i5vM5DMOAaZrafVMikRBJJNff7XYbm80GRKSVDGo9En6mtkajEQ9SKpW0Q9Tr9WJBTNMUV0JqoQUA5XJZLJbHcX5lmqZU4282G7H7YZDwfOGm3spo9Yjq+8vlciQIXyhwUz0Q8L0KvLi4QKPRkKI51/i86HA1qpo3j+VmGIZ0ZjSQTqcjeZrVaiV2iVNuBgnX91G3jADw6dMnaQEPHjzA58+fAXyvBguFAiaTCZLJpNgcFYQ3pVwuw3VdkQbFgrAZ9Xo9rFYrESATiYQwHQZZLBbI5XKoVCra7oRFvbdiYY8UbhwAo0DuEgmE0+tw40vqYrEoQFKpVGR0jRJ2FrxBLOpNpGEYGI1Gkfe6O4MA8g6yS3VdV9TX6/VaSxnukmq1Ctu2tXF8hRTlhXYVDWQ2m4lzwVcuzWbzlyeKEt/3Ua/XUa/Xf/jGPk4iC6uzszMMBoN/5E8B/5T8v//C8V+UPwbkL8E2YCkA6wuRAAAAAElFTkSuQmCC"}, {"Type":"textInflate","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAG/UlEQVRoge2ZP4gazRvHH8hClmBhIWQLAxtYjisMHESChZAtLC5gYSEh5O+SWFgYMHAEIRIWLA7OBIsrDpLCQrgrhFhYHESCxQUsUlgIucLCgBAJV1hssZAtvm9xzLw7O2tO8yb5vfzee2Dh3Hl2Zj7PzDx/5gj/J0L/6wn8KjkH+bfJfxek2+2i0+n8jrkAADqdDg4PD1f+bmUQXddh2/bKAy0rtm1D1/WVvzsH+V1yDrLqB+cgS8o5yKof/GdB+v0+LMtCv99fSv+PgziOg1QqhVgshqOjo1Ddd+/eIR6Pg4igKAr29/clnU+fPiEejyOZTMJxnD8PsrW1BSICEUHTNLiuK+lubGxwHSJCIpGA53m83fM8GIbB223b/rUg0+kUpmlCURRsb29LIJVKBdFoVJhkq9US9D58+IALFy4IOkSEXq/HdXq9ntAWj8dDQebzOUzTRCqVwmQyWQ5kPB4jFovxzlVVFT7WdR3pdFqaYC6XE/qpVCq8LZlMQlEUEBEajQbXKRQKUj+maUogxWJRWP35fH42yLNnz6TOd3Z2BBBFUaCqKprNJt9i0WhU6IfB1mo1AEC9XpeA2bba2tpCq9XisH6Q+XwOVVWF+bA+F4LMZjOoqgpN09BoNJDL5UBEKBaLAggR4dGjRwCAb9++4fr16yAiDIdDrheJRKCqKree67pQVZVP8suXL7h06RKuXbuGr1+/AgAeP34sGaXVavHzVa/XEYvFQs+kANJut0FE3As5joNoNIp0Oi2BdLtd/o5tI/ZuNBqBiHDnzh1hMNM0oaoqAODo6AhEhFKpxNs7nY60IpZlQVEUbqSDgwMQEQaDwWKQarUKwzAEhWw2K3TMQBzH4e+63S6ICHt7e8Jv/3nwA5+cnKDZbIKI0G63ebvjOBJIMplEIpHgvz3P4ztmIcj9+/clK1qWJYFomiboTCYTEBGq1SoA8En6PRQA7O7ugogwGo1g2zaICMfHx4JOIpGQxnvy5Imgc/fuXdy7d28xSLvdltxo0B3quo5MJoOgEBEsy+LfEBHG47Gg0+12USwWMZ/PuZM4OTkRdHK5HB/Pdd3Qwx22c84MiGEgbMJ+0TSNvy+VSiAiIfgFxbIsEMnDl8tlPh5b6WazKejs7e1JLnohiOd5aDab0HVdAnn69Kmkv7a2xl3rgwcPcPHiRXz//n0hSCaTkVw2IBqOOQTmRGazGcbjMSqVCiKRyI9BHMdBvV7nhzp4+BYljYlEAqZpAji1dnCgoIQFPgCo1Wr8fb/f50E5GNuCqyn8cl03NGovA2KaJnfTuVwOly9f/ikQtgv8IIuehSDMj7PHMAxpwB+BML1bt24hHo//Y5BgLsaCZTablXJAyf2yKNpsNuF5XuhhPwtk0ST9kk6nl16RYrGIdru9MGGUQFjw8XubnwHJZDK4cuXKD0GWWZHDw0MQEd6/f//DviSQq1ev4uXLl4LC8+fPlwLxe7fNzU0paAbl5s2bWFtbk97v7Oxwb8ZWxB/9AWA4HEqxRQCJRCJ4+/atoFAqlZYGWV9fB3Bq7TDX6pdFK+LfAYPBAESEN2/eCDq1Wg3JZHIxSDKZRKVSERT8kZZN2J8N+98z95vP50ODneu6PEczTTPURftBptMprxz9ks/npfpHGM2yLNy+fVtQuHHjhuCBdF2XOgFOVzOfz/N+wkCGwyEikQh6vd5CnUKhIBhOURRks1lBR9M0nteFgtRqNSHXPz4+Do0jwWWdzWZCrvXixQsQET5//izosax4f3+fZ8LBfCyVSgnjra+vIxaLcQfEXHLwwiM0jpRKJYzHY2Sz2VCQ4P5n3oVtAVYNBgdjWXG/30ej0QARSf8LicViwnhsDrZtYzQacbCgCCAs1/cHIEVRhL3MUhe/JVl6zjJnZpCg46jVavxbVvnt7u7ydnYm/CCvXr2SgmKYs5E2KbMae8rlsrCXGUi9Xpesxqq24XAolcgAeOk8n8/x8eNHEBEePnzI21+/fi2VupPJhNfyrG2pywfg1MKGYaDRaHBfPp1OOUgkEoFhGHBdF9PplA/EPBKr9DRNE4Krpml8kp7nQVVVKIqC6XQKz/OQTCalFQH+vkWJRCILLwPPrEeYdZm1dV3H5uYmv7phNyEbGxvCd4lEQghmbLv5PR6buGEYyGQy/O8giOd5ODg4kKrJlUDYJFgnuq5je3tbWG52peMXdmcVjUZRrVb5XZm/1mZnxv8ES+tlZeUr03w+j2azyVeFPaPRSIIPS739tx+sAmRPOp2GbduhceqXgwCnSz0YDPiqhA3suq50rRpmaZZxM1ccdoe8jPwUCJN2u41yuRzqRYC/4wl7grU3cOoYKpWKdOmxqvwjkLPE8zwUCgVEo1HpDP1q+a0gf1LOQf5t8hcNB5MLDmokwwAAAABJRU5ErkJggg=="}, {"Type":"textDeflate","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGmklEQVRoge2ZMYgaWxSGTzHFkExgCgsLiykstrCYYgsLiymEbLGETZBgwEKICxYSLCy2kCBIshALSQxIYmEgEAkWBrYMi4WFhYXFFhYWEoRsMRBDJkTIhPyvkHvfXO9o9L19L8t7e2BgnXvuzPnuPefcc2YJ/xGh323ARckVyGWTK5DLJlcgl022Bul0OpjP5/+ELQCA+XyOTqez9bytQQzDQKlU2vpFm0qpVIJhGFvPuwL5p+QKZNsJVyAbyoWCtFotlMtlzGYzaex3gTiOg2KxiFar5TtPAnn9+jWICEQEwzAwHA6F8d8B4rou4vE4t6vf70vzJBDLsvgEIsLt27eFcQbiui7a7TbOzs7+tvGj0QitVguu6/qCNJtNwaZEIrEeZDweCxPY5d0VBpLJZPh4vV5faWSz2UQmk0GtVoPrur7j7DmFQsEXJBaLCfZomiZVFwLIyckJiAi7u7uoVCowDANEhEqlIoAkk0npwefn55KRiURCWkkvzGQygaIofFxVVWSzWQFkOp3ydzBIIsJgMFgNUq1WQUQYj8cAgG63CyJCNpsVQFRVBRHBNE3oug4iQiaTER7c6XR8d/fk5ITr5PN5EBF0XUc0GuUwXpBWqwUiwuPHj4UdfP78+WqQQqEgbWs4HEY8HhdAiAgHBwd8VVVVha7rwjwWnPl8HtPpFMViUZgHAMFgEKqqYjKZAAAODg54kmFSLBahaRrPoPP5HIFAAPl8fjVIOp3G/v6+oJBIJIQHMxBv5mArywLftm0oioJIJCK4kmEYCAQCAIDhcCjtdr/fl0Du3r0Ly7IEm/b393Hv3r3VIPF4HOl0WlDIZDISiKZpgg6LrUajAeBPtzo+Phb0jo6OQESwbZu7SLvdFnQ0TRPeFwqFJLfNZrOIRqOrQabTKbrdrqCwnEUMw5AeYtu2sLqVSsU333c6HcTjcUynU5RKJSEemcRiMeF9RIRyubzWJgnET/xAlncNWPh7KpUCsFgxIvJNt0yYO/rdZ+/7+PEjiAgvX74UdJ4+fYpQKLQ5yHg8hmmaEshyoLH7zJeTySSuX7+OHz9+rHx2Op3m8eIV78JNJhMp0wF/Zq6NQBqNBjRNk4JvVYlimiZM0wQA3Lp1C8FgcCUEsIhHv5rKC8ISws7ODizLQjKZRCaT4dltLYjjONKBtwyy7LPAorRhet6/V8lyLDBpNBr8/unpqe9ZxK5v376tBmFB6D21N9mRWCzGk8CdO3d+uSOrYJvNJr///v37tSBeEX45jsNPaiJCKpVCsVjcCMQbI/fv38e1a9fWxkgqlfIFqdfr/D6rLAzDEEqZX4Kw84CdyIB/1loFwrJWoVDwzUjj8RjZbBaTyQT5fB6Kokg63vf1ej0QEbrdLhzHwWAwQK1WQzqdRjgcXg3y8OFDEBEePHiAr1+/AlgcYr/KWq7rQlVVnpYfPXoEIsLp6amg9/btWxAR3rx5g3K5DCKC4zgrQc7OzkBEePfunQS8LAJIMpmUSmQ/11ouYwaDAYgI1WoVANBut4XfTJjxw+GQp9BeryfoeF3uw4cPICK8evVqOxDLsoSiDljk+2WQSCQi6LCqmfUtjuNAURTs7u4KeqZpQlEUOI7D/X8ZNhKJ8Pe5rgsiQq1W2w7ENE3J/5fzvWEYuHHjBjf6y5cvuHnzJsLhMD5//sz1WDNUKpXgOA6Oj49BRHw3XdeFpmn87AGA2WwmpXtd15HL5QSbbNteD2IYhrRCoVDIt/plhVy9XgcRIZlMCvOW21N2eYtEdl6xFc/lchJILBaTqt9qtbq+jFdVFc1mUyD3OxBZYxUKhXzbYQD4/v07Dg8PBYjDw0N8+vSJ67CynYgQCAR8D+B8Pi+VMrlcTup/OMjPnz+haRqePHnCB1+8eME7OC9IOp0WDFyOKyaz2QzVahV7e3soFotShgIWvYX3WcsnfqPRkJKCZVlSnAo7EgwGBX+0LIuvPjPCMAw0m03eAcbjcd9+fVOxbRumaYKIEI1GpSzJ6i2W2ufzOVRVxd7e3moQwzCws7MD13V5r8y+loxGIwALn+12u3BdF/1+f22pvqm4roter4f5fI52u41YLCaMRyIR3peww3a52SK/CSxN6rrO6x3WcF2E4dsKy3je69mzZ4KOAJJKpQTlo6Mj2Lb9l/6DdJFyfn4u1VrsgwUT389BLMD/ju9ftLCgJyLpoAV8enZd16EoCv+QcJmkXC7DNE0er16RStTRaHQh33P/bfn//nv6ssoVyGWTPwDWyFxNUfRp2wAAAABJRU5ErkJggg=="}, {"Type":"textInflateBottom","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGOElEQVRoge2ZL4gbTxTHX2ELKxa6YsWKFRERESsiIlZcISJixYmIiIiIFSlE3EHFFSKuEIiIWHEihYiIFREVFRERKyIiIk4EGkpECiciVkScCCXQUFZ8f+KY6c7+ud61vf6O9h4shJ03s+8zM+/PTAh/idD/bcDvkn8XZDabgYhweXn52425vLwEEWE2m92770+DbDabe3/sR7LZbJ5A7g3ied6Dg3ied+++TyAPARIEwZ8H2e129/7YXeS3gkwmEziOg/F4nGgbDocgerj0kwWy2Wzgui5Wq1V6v/iL9+/fg4j4Y1kWwjDk7Z1Oh4MEQYDJZCK0/4z4vo8gCDhIp9MR2sfjMRRFARFBkiTM5/PbQbbbLe8QfaIzxEA2mw1UVQUR4ejoKBUmDEOcnJxA13U0m81UnWq1CiKCruvYbrcJkDAMkc/nBXsMw8DhcMgGYdumXq/D930cHx/zVYmDNJtNYfDJZJIwstVqCTrtdlto//Dhg9D++vXrBAjzyWKxiH6/j1KplJprBJBWqwVFUbgjh2EI0zShqmoCRJZlwQjbtoWBP378CMMwBB1d1/H582euU6lUhHY2ZhSkWq1ClmVst1sAwHq9hiRJiUkRQBzHEWYfAHq9HogI19fXAgjbcsvlEpqmCToA4LouN85xHK4zGo0AANfX1yAiKIqC6XQq+GYUJJfLodlsCjaVy2UUi8VskDAME8Wg7/tC3jg/PwcRoVwuc512uw0igu/7/B3blmwLjMdjEBFqtZow7snJCe/D/OX8/BwAsNvtQEQYDoeCTe12G7lcLhskTeK1leM4iQCwWq1ARLi4uODvVFXF0dGRMJZhGCiVSgC+r9hyueTtzGccxwEATKdTEFEi5LquK2z3XwJZr9dcJwxDSJKEVqsFALi6ukp1bsdxoOs6/y1JkhDJWD8GklZFLBYLvtq3giwWC5ydncFxHDQaDe6wURBN0xLApmny7cZmMp7YOp0OZFnm45immRhHVdUEyHq9Rq/XQ6FQEIJDJshqtYIkSYk8EgdJM6BWq/FtMxgMUg9f6/WaRx/btrm/xCckDhJ/JElK9BVA4rkh+jAD6vW64OhMHMfhDhhNmllSLpe5wfH3jUYDANDtdgUbFEVBq9UStnUqSKlUgiRJ6Ha78DwP8/mcz270Q9Vq9VaQN2/egIh42ZEmxWIxFSQ6UWxCcrkcXNflk5kmAoimaYnB2fJGQdIMYM4LAKenp3j27Bm+fPmS+eFcLpc5Thxkv98LOkEQoNfrZYOoqoputysosIR4FxCm9+rVK7x48SITArgJxT8CeffuHYgInz59EnTevn2Lly9fZoNYloWzszNBgSXAH4HUajW+Is1mMxHn43KXFRmNRql1VbVaTfRNOHt8/9fr9TuBlMtl7iOnp6d4/vw5vn37ditIvD6Lg7AcNhgMeHsYhlBVFf1+PxvEdV1omiY4FcsjTCzLQqVSSRhQKpUSzn7bKdKyrETmZyCs3mNH3+jkslInHrkEEFb/2LaNw+HAw190m+RyudQ8YhgGNywr/LLEFgQBKpVKol4CxJUFbvxWlmUsl0vs93uYppnaTwD5+vUrbNtO5JA4SDyzs+KOJSkGcnV1JeixifJ9nweH+KqpqioYygpJRVF4BR2t6VJBgJtry+gpkYFFQYgIi8WCv2MlCQsUrCCcTqfC2CyUr1YrDhutmNl1UBRkMpn88HSYCsJgbNvGaDTiRrKZYyDRMM0iG6ut5vN5ZvnNxmLnj2hheXFxkQABvh8JdF1PzeqZIFFhkYOV0pqmwTAM5PN5bLdb7HY7fnZnOvv9HkTEq2EmlmVBURQA4OdzRVH4OIVCAbIs8wqZSRiGmM1mtwaPO93reJ7HjWRlNltmtm/z+bzQp1gsQpZl7ifL5RKSJOH4+FjQISI+OUSERqORqGzvIvfuYZomhsMhdF0X9m68ImAFqGma8DyPl+DR+M+2UvRMPxgMUCgUHh4EuIlS/X5fcMD4srMtGS+/o5HscDgIFxSu6/70DeYvXRl2Oh3Yti0cV6NiWZYAEvcZ4Ca31Gq1xIreVx70r7f1es2jXLlcfrD7YuAP/IcYhmEiMT6E/Lt/hj5WeQJ5bPIE8tjkCeSxyRPIY5O/BuQ/soiLzOgZW3AAAAAASUVORK5CYII="}, {"Type":"textDeflateBottom","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAG7klEQVRoge1aIYzizhd+oqKiyVZUVFRUIBArEBUVKyoQJLcCQXJsgqhAIBBcQi4IRBPEiRUIBILkKsgFgUCsQCAQXEIu5IJAIFYgEOSCQFRUIL6/IDPLUNiF++3ebX6//5c02UxnOvPNzHvve48l/EtAf3sBr4X/LpHhcAgiwmQyefXFLBYLEBF6vd7FYy8m4vs+iAiLxeLiyV5CEAQgIvi+f/HYi4m0Wi0Qvd2NlGUZnuddPO7iFXmeB13XL57oXJim+WeIFItFmKZ58UTn4vr6Gq7rXjzuYiK5XA62bZ/d//HxEb1eD6vV6qz+juMgl8tduqzLiTiOg9vb27P6VioVSJIEIgIRoV6vvzjGdV04jnPpsi4nYts28vk8giBANpuFYRio1WqRfs1mkxPQNI3/3el0hH6VSgVEBMdxsNlsUC6XcX19/fZEmDHmcjm+OCLCcDjkfcIwhKqqUBSFt7fbbSiKglgshu12C+ApJrHHdV14ngfDMF6PSBiGmEwmCMNQaNd1Ha7rQpIkaJoGRVFARMK9rtfrICJ8+fJFGOt5HogI/X4fAFAoFEBEUBQFmqZBkiSUy+Wj7n2z2SAIgsuIzOdzxGIxfuTCACKoqgrbthEEAabTKSRJQjwe533u7u5wdXWFnz9/CmN//PgBIsLnz58B7DyUJEkYDocIggC2bUNVVRCRsIGTyQSqqkLTtJOKIkIkDEOYpikc+WAwAACsViveNp1O+RjLsoRdjMfjJz3bcDjkY03TFDZgOp3y7+8rh2Qyydv3+z9LpNFoCCSICJVKBQAwm81AREgmk8IYZi8A8OvXL1xdXeHjx49HJ9yHYRhIp9NCWyqVAhFhPp8DAJbLZWQ9Dw8PLxOxbRtEhFgsBsMwuBECT8Z5ePdd1+VEvn//DiLCp0+fXiSy/20GZl/7ToKIIMsy937H4oxAJAgCSJIEy7IQBAFXo2yyh4cHEBHG4/FJIp1OB0R0lsw4RoRdr3a7DeDJPTcaDWw2G5imCU3TnicyGo0EmwB297hYLAJ4Ur7Mfe4TkWUZAPDt2zcQEUql0otEVFU9KkdkWUaj0eDfliSJz8lE6+Pj42ki7XYbsiwLC90XcY1G46iPT6VSSCQSAJ5O7ZRe6vf7WC6XAHZGfHNzE+kTj8f5nMlkUjBw5nD2NztCpFarwbIsocM+Ec/zIobO+mQyGQBPdhSLxY4SyWQykGUZ0+kU5XL5qJJOpVIol8sAdpLoMARYloVms3maSLFYRDabjSySJTqu66JQKAjvWTJUrVYB7LwM01eH3mWz2fA4MZ/PuSEfBrpCocBP9BiRXC7HPelRIq7r8p1gEyuKwomk0+mIEbMT2D/q29tbHrGbzSZmsxlGoxEcx+EeKAxD7s4Pr4nnedwtHyNSrVb5DThKpFqtCrvIJASbyHGcCJFyuRyxm/F4LAjFw4ed3na7FZwJQ61W44t3XReqqnJZA+wM/tAETmqtfr8fEYSJRCJCJBaLCafIsFwukclkBJWgqio8zxPkx/39PQzDEByM7/s8eWOufT9+7b9/lshiseAijogwGo0ARNNQ5qFms9mp/XgR6/UasiwL8t73faiqCuBJaLKnUCig1+udRySdTnMXuq97FEXhRLbbLW5ubiIS43eQz+eRSCT4qbAgCOzyGk3TIMuyoLdeJMKCoq7rmM/nICIsl0us12sQEVKpFICdPUmSFAlMv4PZbAZJkrhHZCJxvV6j1+shFothMBjwlIGIIEnS80TYKfi+z70K8FQ8IyIkEgl+zK8Flocwfcduwng85qphMBgIJ3OSSBiGQhbHXCuwywn272oikYgkXf8EQRDwDWLPZDLhG7herwHs7JLZ7kki4/FYqPR1u10eeYfDIc8fTNN8k0rjarXi3zdNk7tcRVGE/Kfb7T5PpNlsQtd1bnT39/fcqDqdDs8Kn0s5/ymCIMBms4Ft23xDbduOFC0OKzICkVKpJEgU13W5ZvJ9/+wy0Gsgm83yuFEsFiOS5BACkVQqxeUzsAt2TJ22Wq2zi2yvgdVqhVarxed+yc0LRCzL4iV95m7Z1TrMQf4kptMpD5AAjjoZgYhpmlyO9Ho9KIrypnXec7HdbqGqKjf40WgU+Q1FIGIYBieSz+eRSqV+q3z5Fti3mXa7zRM5BoEIE4jb7RaapqFer/Nqxt+G7/vQdR1hGKJUKglXDThCpNvtwvd9WJb1V+3iECzFzeVy0HU9Uh8WiMiyDMuyoCjK0cL038bd3R2P+h8+fBDeRYz9WKXvvWA/R8rn88I7gUg8HhcU7nsEW+OzkZ0p369fv/7RxV2Cfr8PWZYjN0YgUq/XhQTnvWKz2UTaIjL+LQXhW+K/+y8c7xX/J/Le8K8h8j/0YgHdBTXJtgAAAABJRU5ErkJggg=="}, {"Type":"textInflateTop","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGIklEQVRoge2ZLYwaWxTHjxgxbUYgEKRBjECMoAlNEIgVCMSmISkCgUCMQIygCUkRiGkyCWkQiE2DQDTpCMQKkpIGsaJpEJsGUYGoQKxAIEi7YtKMqBjxf4Kc++Yyw+7y3ts+3sue5Brumbn3d+6552Mg/E+E/u0N/FPyAHJs8gBybPIAcmzyAHJs8gBybPIAcmxyMMh4PMZkMrmPvQAAzs/PMR6PD37uYBAiguM4By90V3EcB0SHO8rBTyiKcu8giqIc/NzBILqu3zuIrusHP/eXQNrt9sEL3VVardbvAzFN8+CF7iqmaR4vyGazubPuUYJ4nodcLgciQj6fx/X19a3P/DaQTCYD0zQRBAHK5TKICJ1OJ1aX53lUq9WITqvVAhGhXC4jCAKYpgnDMO4fpFgswjRNvHv3TtrkbhL7/PkzHj16JOkQEb58+SJ0Pn36JM0NBgOYpolisfh7QMrlMgqFgrSJfD4v6XU6HRARdF1Hv99HNpsFEeHs7Ex6V/gduVwO5XL5nwUZj8fIZrOoVCoIgkBaPJ1Og4hwcnKCTqcDRVFARNIdYNDFYgEAmM/nwoWA7f1hAMdxUCqVQERIJpMRkPl8jkqlgn6/fxjI2dmZZKk4KyYSCfi+D2B7QYkI0+kUAPDr1y+oqorT01PpvZlMRvj/dDoFEaFSqQAAgiBAKpUCEUkgnuchkUiIvezLYRGQjx8/Rvz6xYsXYv709BREhGazKVmMiNDtdgEA3759AxGh1+tJ77YsC4lEAgDQ7XZBRJjNZmKe3TFsgF6vF9kPn/KNILVaDUSERqOBwWAATdOgaZpwr13rA9sTUBRFWHc2m4GIIlVyt9sVdVSj0YCiKOJUAeDy8hJEJIV3wzBEZGTQer1+M8hms4GiKJK1OTyuVisJZLlcSi/K5XIoFAoAANd1Y3Wurq6wXq8BANVqFblcTprfbDYSyPX1NYgIpVJJ2o+iKPA8bz/IdDqNKPGmwiBx1Wm9XheJjN2Bn4kTDuO7omma+J3v0WAwEPPr9RqKokgeEQHp9XrIZrOSArtJGCQu85qmiVQqBQB48+YNiAg/fvzYC8KJdVfClQMb8evXr5JOPp+PVOASSK1WE37OwknrNpBGoyEaotevX4OI8PPnz70gyWQStm3fCMInu1vaWJYlwngsyK6sVitx2ThSWJYVCxLu7O7S5e3rNHVdF3fUtm0QEebzuZTL4nqWvauNRiMpfnOYdBwHmUzmXkH4dw4snLeq1Spc1401ZmQ13/dRrVbFCzhrh0FuOxHOEd+/f/9bIPV6PZJDwuNGkLAVdF3HcDg8GOTt27e3Rq27noimaTg5OYGmaXcHWSwWQqnZbML3fRG1zs/PxYbjwq/jOCJr74ZslsvLS7iuiyAIoKpqLEj440Y4sARBgMVigeFwKIX6WBC+XMPhUPzGIK7rAgD6/T6ISMrIgBwEJpNJbNgcDAYgIqzXa+lSSxsiEsXhy5cv8eTJk4hOnEggxWIxcpF3Qdjau/VOoVAQBSGXGmGDANtTU1VVrLVb5XKNxmsd8o1L0spkMqjVapLCxcVFLMhoNJL0OKoA21Lk8ePHePXqlaRTr9fx7NkzANuclUwmpXlu1ngtziNXV1eS3ng8xsXFxX4QRVHQaDQkhWazGQsSTpzL5VJyCWBb7O3WUolEQlS27MbhTXJS5bU+fPgAIsL79++l9zx//hxPnz7dD5JOp6VOLwgCJJPJWBBFUcTXEYYN1z8cOrkCHo1GUqnP96jVagHYFoyqqkprcfMVNhrr7VYgEkihUICqqmKDfLHDkYRBNE2DYRiwbTu2Q+SwraqqCKPhAMCVrqqqsG1brB0GAbbuHjaSZVmR04+A8HGnUink83nRrRmGAcuyAGz9k3uCcEwPl9rAtgTnjfFIp9OSDre3PCqVSqSP4QvPxmP43fpLAlkul8K6fBLz+Vx8bAD+jGLsKjzi/mpot9uSzm6A4DKdB592uGv0fV+0wDziPj9FYpvrukilUjAMQ3zimUwmom9frVZwHAee56HdbkNV1b19tO/7KJVKN+rYtg1N09But+F5HhzHiSTS2Wwmsnuz2ZQKyL0g/1V5ADk2+QMXuYmGRHEj9gAAAABJRU5ErkJggg=="}, {"Type":"textDeflateTop","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGcklEQVRoge1YLYziWhQ+ouIKRAWioqICUdFsKhBkg0AgECMQCLJBVCBWzCYjRiAQ3SBWIEawCWIEAoFYgRiBQJAsAjECgUCwSQUCgahAVCC+JybnTi8FdnZ35r15781JbsJtD/ee797z850S/iNC/7QBzyVvQF6bvAF5bfIG5LXJG5DXJm9AXpu8AXlt8v8Dsl6vX9KOo7JcLp+s+2Qgvu9jMBj8lkG/I6PRCI1G48n6CSCj0eiowd1uF7lc7s+s+wUpFArodruJ58PhEPf394nnCpDdbgchBIgI/X5fUez1erAs65nNPS2O46DX6ynPJpMJiAi2bSf0FSDj8RhEBCJCOp1GGIby3Wg0AtHflxvS6TRGo5HyzHVdad9isVDeKZbd3NxIRSLC5eWlfLdcLkFE2G63L2h+zDAiTCYTOR8MBoptt7e3qn588vHjRxARKpUKNE1DKpVCFEUAgCAIQEQIguDFQfBeq9VKPiuXy9A0DbZtJw45AcTzPOl/nU4HRIThcAgA2O/3IKKjgfbccn9/rxxaFEUQQsD3fURRBMMwUKlUTgMpFouo1WpynslklDkR4e7u7gUhPAgH9X6/B/CQqVKplJxXKhXk83nlP4kYaTabct5qtZQMYZpmIpO8hAwGA5imKef1el050GazmcigiTQUD7DpdAoiknFiWRZ8339uuxPS6XQUQ13XVWpbr9dTgAI/qexRFClxkc/n0Ww2Ua1W8eXLl+e0Hfv9Hr7vo16vw/d9FAoFAA+1TdM0JfB7vV6iFPy0MKTTaXkanudB13WZAq+urp4NSLVaVWoYA5lOp9B1XdH9LSCWZaHdbgN4ABLP5UQk3/2JfP36NbHuhw8fAADtdluCYmk2m78OpFAoyLjwfR9EhHw+j9lsBtu2oev6HxXJ3W4HXddh2zbG4zEKhYJy257nyUDfbDYol8sS7Fkg3W4XlmXJIYTA9fW1AoRry3q9hhDirIvNZjMMBgMMh8OjtLzT6UAIIdsEpkmtVgvAQ0loNpvodruKW58FslqtoGla4po9zwPw6JtxnuP7PoQQ2O12ysLT6VThRjz4UFgymYxyEEyFOM3bti2J7OE4CaTdbh/9AwO5u7sDESlN1nq9TrDl9XqNVCol/2+aJtLptJxziuf14gfD9ITXi6/Do1AoKGUiASQezJqmIZ/Pw3EclMtlecrH+FZcBwAajQaICIZhSCOjKMLFxYXi/9VqFZlMRlmLgUwmE4RhqAAoFouYTqc4JgoQDrRWqyUD+Pr6WmaNU8Tx6uoKQgg5Z5fiWGKZz+cgIlxcXAB4cJtDV+M9ptMpFouF1J/NZkcBHAWSzWbhuq6i4Pu+fMZudNgLdLtdha3quq4w57i0Wi2EYYjdbgciQqfTOQokCAIJ/ClEVQFiWZaMhziQOF0gokTDM5vNFEJJRMhms2c3ZoZ7uFacFjF5PIyHzWajVPoEECGEQhoZiKZpis5hU7PdbpXiSER4//79WSC3t7eJngMA+v2+dFO+ke/fvys6nz9/Ps+1iCjx5YJrB1PoU8SRiORzziznhNc9jLdWqyU9gG9kPB4rOtVqNRECChDDMFCtVhWFy8tLZcNcLpdoag6BvHv37qeudQqI53lwHAfAo5sdxpHrujJhHAViWVbik08ul1M2LJVKiWvl7pGBlEolGIZxFMBsNkMYhrIDPQRi27a8zdVqBSLCp0+f5PsfP35A1/Xzra5t24oB2+1WVlUOOK41cd/mNMlAuPc/rPasNxgMJEuYz+fyPWes+GkzD2PhjxA3NzengdRqNbkR8FAfDqsxu1q9Xpf/6/f7ypcNNvLYtzFmBvw73nGyu8UzZzablXphGMJxnMQBJIDwdWuaJv9gGIaSqXgzIYTM71wA41Vc13Ul4Pf7PVzXlafLGYmDNggCSUfimZMPl/ckokR/kgDCi8dHo9GA4ziSVrTbbei6DsuyoGkaTNOUgOPCN+d5HkajkaTf8RswDANEBMuykEqlYBgGTNNU3IZvOz7i/ftRIMAjTWGyF4YhyuUyisUiAODbt2/SoPjih99pwzBEJpNRdBzHkWkcePQAHu12G5qmKWCjKJLfsvhWDmvPUSDz+Ryu68I0TUnQxuOxPKUgCGRQe54HIQTq9bpiIMtyuUSxWIQQAqVSCZvNJqFTr9ehaRpqtZrs2w/9f7FYIJPJwDCMRNydBPJvlTcgr03+AiRA3AD+jIkcAAAAAElFTkSuQmCC"}, {"Type":"textDeflateInflate","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAIWUlEQVRogeWaIYziWhSGr6ioQHQTkkUgmg0CUVFRgUCQzYhmM2IEAjGiAoFAVCCaDYIEMWJEBdnMJiMqViAQbEKyCAQCMQKBQIxgk2bTZCsQTRaBqPifIOe+3rYzb+Zldvdl30kqaG9v73fvPafn/IXhDzH2uwfwUvb/BVkul2CMYbvdvvhgttstGGNYLpfPvvfZIIvFAowx+L7/7If9k/m+/+tAPM/76SCe5z373n8NEgQBjscjVqsV7u/vc9seDgeMx2N0u12MRiNEUZTbZrVa4XA4/ByQu7s7eJ6H8XiMOI4zIKvVCoqigDEGxhja7bbQzvd9lEolKIqCer0OSZKgKArCMORtbNuGJElgjEGWZd53GiQIAkwmE8zn86eDBEGAarXKB8gYw/n5eQZEURS4rovtdgvHcYQBHI9H6LqOWq2G/X7PwWRZhm3bAIDpdArGGPr9PrbbLVzX5ROTBElPmKZpuSsrgNAAJElCt9uF4zgcarfbAQCGwyEYY3AcR+jIMAzoug4AWK/XYIxhsVgIbW5ubvh9pmlC0zTh+tXVFRhjuLq6AgDEcYxyuYxisYjRaIR+v49CoYCLi4vHQebzORhjuLu74+cmk4kQSQaDQa6zDwYDSJIEAPj48SMYY/j69WvmgWSlUomvDtl+vwdjDIPBAADw6dMnMMYwnU55m/F4LExsLojjOHxWyXa7XQZEUZTMwAgQAPr9Phhjgs8kLY5jMMYwHA4z18rlMgdJTk7SqtVq5l4BZLFYYLVa8d/L5RKGYWRAVFXNdG7bNkqlEgDAdd3cVfN9H+v1GsfjEZVKJbMiAFCv1zlIt9tFoVDAcDjEer3mE2NZFs7Ozh4GIbu7u0Oj0QBjDOVyWQDpdru5IPV6nXc+m83AGIPrukKby8tLMMaw3+/RarVQr9cz/SQBO52OEHQURUGr1YJpmpkxZEBub2/5TcPhkA+K9qRlWZBlGYfDgd9Dzp3cy7quQ1EUjMdj7HY7uK4LWZa5o5I/JkNqFEWQZRmWZQE4Ob8sy1gsFhgMBnx3MMZQLBYfBtntdpAkCWdnZzzej0YjYZtYlgXGGJrNJnzfx3Q6RalUQrPZFDr2fZ+vKh2mafJwTH0VCgVMp1P4vo92uw3GGAchx06mLJvNBv1+//EVsW0bqqrieDzyc7S8SZBKpSLEdsuyHnTsKIqwWq0QBEHm2uFwgG3bkGUZjDEUCgWUy2UOQitEPvOYCSCGYaDb7fLfYRjyh1C222w24TgOgiDAcrl8kZwrDEMsl0vsdjv0ej0OApwmTtd1YaJms1lmYgSQQqHAOzkcDjBNk2+l0WjEz/9sS+6IIAigKAosy8LxeEQcx9A0LfOaEECKxSIURcH19TU0TYNpmgCQeUP/aptOpzwnS27npAkg5+fngmP+itl/qm02G+i6ziNqeksLIL7vo9PpwPO8B533d9t2u82d4GfXI+v1WnhfvLSNRiMhu3iqPRuk0WjkZp8vZf+2/2eDNJtNNBqNZz/oqdZoNDKO/BR7NohlWT8VxDCMPwNEVdX/JshsNoNt208OEL8FZDKZoFarYTAY5IZrKrDooBKWLI5j2LYNTdMwmUx+PYiu61yoo+P6+lpo9/nzZ7x69Upo8/r1a2w2G96GRAs6ZrPZy4MEQQDP8/hMJUFUVeUihaZpXM5JSj1URHU6HYRhCNu2BeAgCHjaoWkaJEmCrutQVTUjbOz3eyyXS6H/J4F4niek6f1+n1+j2py0LeBUNTLGMB6PebtisQhN0/iWi+MYxWKR529UwFG2vV6vOVgybQ/DkCs5VKg9CYQqt3SJSQMikGQhFUURJElCp9MB8Lf0mZwAAGi1WryupyIqmW7QKiZBLi4uhLFIkoT1ev04CIkCqqryYp86p5sJJK0G1mo1rlNtNptMGQucdK12uw3g9OJLp+IkPRHI4XCALMswDINLqpVKBYZhPA5Cq5HUjMip07pWWu/t9Xool8sAgC9fvvzjp4dqtZpx6vv7+1xdK+mnq9VKmNhckMFgkFH/0lJ/Ur9K30vnaQDfvn17EERRlMzWAyCAUJ9piVTTtMd1rfF4nHGmm5ubJ4GQSLHf77mulafRAqctnBey0yCdTidXDCRJ6EGQpC0WC0EFoSqR9Nm0Jb+bPARL9tjng3K5zM+3Wi0u/ZimCcdxMJ/P0e12Ua1WHwcJw1AAoNBHndOA00bhNIoifPjwAYwxfP/+PReEJNO0gJcGSctJyYP8MRfkeDzygZdKJbiuy7XfNEh62+T5SLoc3e/3XFhQFCVX5kk+6/z8HLquYz6fw3VdtNttGIaBQqGQmUzhF+1t27b5QNPbgEDSUYvSDeDvD6bJdAQ4+Zssy4iiCKqqotfrCdfDMBSeRVlEnqUjogBSr9cze4/eCZTwEUg6m03qsXRPeus4jsOlzkajgVqtJlyn8J8ESUujD1lGDkrHdopatA0IJKmkH49HQRMDTt8/0pGFvmIBJ0eWZVnQsCjVIRDaIel3xuXlZaYcFkDevHmDd+/e8d8/fvzA27dvwRjD+/fvBZBkkkgPTEYhyggoH6PtRu8O6ofeByTEJV+A5J/JSYuiCIqiPB5+G40GJEmC53mIoojXE7Is84yUvv2pqopSqcTV+XT2S+mGLMswTZMPkrKG/X7P72u324KenBStKbu+urrCZrPh2tvNzc3DIBRtkke/30ej0eAfRGlmk1lwcmaTdnZ2JrS5vLwUrvd6PeE69ZkEWSwWGZUxmVXnggCnqk5RFJTLZf7mvb295RHm/v4elmUhDEO0221Bl02b7/toNpt8VdLCWhzH/NOCbdsIwxCWZWUi4u3tLSqVCv++kleX/H//VPNftT8G5C+JKlIcDg8DmAAAAABJRU5ErkJggg=="}, {"Type":"textDeflateInflateDeflate","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAI8klEQVRoge2ZL5DiyhbGW0REREREICIiIiIQEQgEAhExAoEYgUBEIBAIBAKBoAqBiEBEjKC2EAgEW4WIQEREIKjaCARbNYK6FYFAREREICK+K6a6H53A7J83e/fV3XeqRkwS0ufX6XP6O6cJ/iVGfrcDH2V/LkgQBCCE4HA4fLgz9N1BEPzwb38aJIqiHx7sW3Y4HH4PSBRFWK/XCMMQWZYVno3jGJ7nYTabIQgCXK/XwjOvr6/YbDZ4fX1FFEUfB5KmKUajESzLgqZpqNfrcF23ANLpdCCKIiqVCgRBgK7r3HLzfR+SJMEwDAyHQ9TrdUiShNfXVwDA5XKBYRgQBIG9o91uF0CiKEK73UalUkGtVsN0Or07aRxIHMcwDAOmacJxHLiuC8uyQAjBbrcDACwWCxBCUKlUcD6f2e90XUelUgEAJEkCQRAwHA65wVqtFrrdLgCgXq9DURTEcczAarUaB3I+nyHLMgzDwGg0guu60HUd9Xq98HU5EMdxIIoiLpcLu3Y+n0EIwWKx4EDm8zn3osFgAEII4jjG58+fQQjBly9fCjMHAFmWQRRF2LbNXafvpmP1ej3IssxgKbAoipjNZo9BjscjWx5pmmK73aLb7d4FuYUFANd1QQjB+XzGfD5/NyEkSQJCCKbTKXc9jmNuLMuyoKoqHMfBZrPB8XjE9XpFs9mEYRiPQYC3zNFsNiGKIlRVxXA4vAsShiH3u1qtBkmSAABhGIIQgs1mwz0zHA5RqVSQZRnK5TJqtdo3QRRFYY4TQiAIAmRZhiiKj0H2+z0EQUCj0cB+v2dg90D6/T6At2VCr90mhU6nA1mW0el0sF6vMR6PubhZr9cQBAGLxYIF72g04sbq9/sQRRFpmgJ4WyVhGMJ1XRZrd0FqtRrq9XphFgkhcByHAzFNE7quQ9M0qKrKBr81z/PQ6/Vg2za63S48z+Pur9dr9g7TNNms03e9vr5CEARugujkUri7ILIss8+dJAmGwyFM00SpVEK73QYA7HY7DIdDZFmGIAgKS+xn7Hg8sn1mPB6zDAm8JSBBENDv93E6nRAEAURRxNPT02OQXq8HQgg0TYMsy2i320jTFMfjsTAD/6RtNhtUKhUQQkAIgSRJhUTCgVwuF0ynU8xms18iQf5bo18knzGBn5Ao+/0ejUbjQxzL2+VyQaPR4JbW99oPg9Bg/xVGtda9xPEt+z/Ir7DfBnI6neC67sMUnKYpptMpbNuG67p3ZXwQBJjNZjifz8iy7GNBjscjptMpOp0OJpMJJ9ooiO/7EASBpcTJZFKAKJfL7D5VzLcS3HEcdk8QBHiedxfE8zwMBgOMRqOHlWkBhO7kVM8QQqDrOnOAgiiKgqenJziOA03TQAhhsgZ4kxeEELTbbXiexyQ6dTJJEsiyDF3X4TgOms0mJEkqgEwmExBCUCqVoCgKCCEF5VsAWa/XIIRguVwiyzJWZNEvcAtiWRaDOx6PbPelpigK9wWu1yskSWI7MgWlhVaWZaz2oSBUsjebTfYe+hW32+1jkOVyWSiG8gFIQfLK1rIsJq1pDZOfuW63y/agarVaUL+bzYYbazabcUUdNdM0Ua1WH4NQy7IMp9MJvu+zmftWPTIej5m03u12dx24NVVVMRqNuGvX65Ubq9PpQJIkBEGAIAiw2WywWCzw9PTESoa7IJfLBc1mkwvQ/Lp9lH5fXl5ACEGapvj06RMIIfj69etdCJqdxuNx4Z4kSWysvC80Kei6/r5opA2C8XiMzWaDw+GA0+n0XSD0ehRFGI/H71aIdOnlMx0AaJrGxmo0GtA0Db7v43A4cNkzb5xHt3Kdmu/73wVCswvwn6/z119/PRxYEITC0gJwt2bPW7vdLug9zqN+vw9d17mNi0r7PAjNNtQGgwEblO4Hp9OJe2a322EwGCBJEhiGUZi0fKODBvtte2i73d7tdHIg5/MZ1WqVBSJtPNwDyTcOdF1nmSRfHlOjCSHLMjQaDaiqyt2njuf3mlKphNFoxHpp92KrsEayLIPjOKjVaqhWq9hut1BVlTm+WCxYA4B+ldVqBUIIXl5eOLDbsjnLMui6zlLudDrlfhNFEUqlUmECPM9jG6FhGNym+y7IPZvP5wzEdV1omgbbtiEIAsrlMgRBQKlUQpIk7DfUUdu2sd1uWQai+8/lckGpVIIgCDBNE6Io4vn5+Z8TjVEUwfM8JEnCnNN1vRAzWZYxWUL/np+fuWf2+z2TN81mE3EcY7Va3a0APxwkb+/V8mma4uXlhanfez1bAO+m1e+1P/egh7ZRf4UlSYJut1sQhN9jP11Y/Youy4dViLcBTLuJk8mEi4PfAeL7PpP4tFzIx1vhWIGKOd/3MRwOIcsyTNMsFFb7/R6TyYTpskeBnGXZu9C73Q6TyQSTyYQdIt2C0E6jbdvwfZ/VR7SFexfkeDxymxqdjdv8T0EkSYJlWej3+1AUBaZpcg7THpUkSSiVSpBlGc/Pz1xDulqtQlEU9Pt9WJbFKlIKEoYhBEHAcrnkfKpWq9B1/TEItSiKEIYhgiBgVeN7EuV6vaJarcKyLPa/qqqo1+tME8VxDE3T0Gq1ALxJdFVVOV1H300dt22bKYggCLBcLjGdTtkm/BAkDEOoqsptYqZpfpdopIc7SZKwwiovJ5IkwfV6ZSdWt6UxvX8rEm/7vYqiwDAM1Ot1tFotDAaDxyDVapXpf7pJpWnKla1UfdLzw/xsRlHEoPKw1KjKzR/f0bFuQcrlcuH3dEIegtB1fGu0jqaKkwZk/qyDHuTcwuZr9vV6jV6vhyzLoKoqms0md5/GIwWxbRuEEByPR/bM9XqFruswTfMxSKvVgiiKmM/nOBwOmM/nkGWZK4IoSKlUQhAESNMU6/Wak9dZlrGDG8/zcL1esdvtIMsyg3Ndlx1qXi4XrFYr6LrOgURRBFEUYZomPM+D53loNBp3mx+FeqTf70NVVda6CcMQnU6HVWRU6M3ncxZP9MDyNgXHcYxOpwNFUSAIwt0z8vl8zuJAVVXMZjNomsbF1uFwYOeThBCUy2WsVivk7c/VWv+r9q8B+Rs10Wlx1IHHdwAAAABJRU5ErkJggg=="}, {"Type":"textFadeRight","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAFs0lEQVRoge2aL2zbThTHHzAwMAgwMDAwCAiIJoOAgAIDg4IAA0vbpABrKgiwtICCggBLAQUFAQMB1RZQUE0BBgWVNmAwTQXZVBCQaQEBAQEFBgUBlvb9genu58s5XdulW/T75UkH6r7787m79973qhL+I0Z/ewGbsh3IttkOZNvswSDj8Rjdbhdpmj7Feh5tDwZJkgREhCRJnmA5j7cdyA7kiWwHsgN5ItsqkCRJYNs2JpPJg/sWghwdHUFRFFQqFVxdXUmTPSXIY8eWQC4vL0FEvCmKgul0WjjZZDJBt9vFbDb7nfUXjv1Qk0BevnwpgBARXr9+LU12eXmJcrkMIoJlWRuRLBsDub29haqqEoiqqsiyTJis2WwKPmEYSoOPRiMYhgFVVXF4ePjnQEajEYgIlUoF4/EYg8GAg7EAZJNpmiaAaJqG5XLJx8qyjJ8Ya8fHx8LkaZqi1WrB8zxMJpPNgQwGAxARzs/P+bd2u82vUh6EiBAEAebzOWq1muADAOfn59xP13V+sre3t9zHcRxhI87OztaCzGYzoe+dIFEUgYiwWCz4N7bwN2/eSCAsyC8uLkBE6Ha7vF8QBCAi9Pt9AECn0wER4ezsDADw6dMnDuC6LhRFgWVZEshkMoFhGHwjwjDk13wtSBiG0HVdcEjTFESEKIoEkHq9Lvjpug7P8/jPlmWhUqnwSVn8tVotAD9TPBHh4uICgJgt8yCWZUFRFBwcHKDZbEJRFPi+fzdIEASwbVt2KgBhC2K2v78P0zQBAMvlsjABuK7LN8B1XVSrVWmMPMjHjx+F2wD8e2XjOF4PkqYphsPhvUB6vZ7gw2IJ+HkdiAinp6eCz9HREYezLEvajF6vJ4CEYYhSqSQkEdZ3b29vPcg6KwLJBzYA9Pt9Hl/smtyVfUqlkgS6mrVc10WtVpP6BkEAwzAeBsKCchXkw4cPgt/bt29BRPj+/Ts//i9fvhSOmWUZiAiDwUD4zk6SgVSrVaiqyuNktb7dCyRNU0RRxOvFKsjnz58F//fv34OI8PXrV7x79w5EhG/fvhWOPZvNCkHYdwZimiaICKZpolarodFooNVqIYoiqW8hyHA45LmftVWQvP7Kf0+ShNej+Xz+WyDPnj3D8+fPC8dYNQnk6upKOsIikFWhWASyTkyuA1m9Wo7jwHEcqb/jOL8Odtu2BYDDw8N7gbCiOJ1OOci6dwUDWZUsLN0ykCAIoKoqbm5uuM/19fWv0y9zYvKd5e8ikOvra2Gg/CkMh8NCnziO0Wg0eLC3223h98fHxwIIG8fzPEynU8RxDNM0US6Xpc0RQE5OTjhEvp4Ugaym1nxcrPPpdDpcOZTLZan47u3tCf2yLOPyhDXTNAtPWgBh0jxfSe8LwnYz77M6ju/7vC74vi+cWl7D5ceez+fwfR++76PX60nFsRDEcRxJoa4DYeKP2YsXL1AqlQAAi8UCRISDgwPBxzAMNJtNAOBKl1V4TdPged5mZLxt21I2uLm5uZdEsW0b+/v7/OdyuQzDMPimrGqk5XIpvFc0TcN4PEan0xGC+1EglmVJypKlxLtEY5qmUFUVnU6Hf2My3vM89Ho9aJomPb5GoxFs20a9Xsd4PH7w4teCqKoqXYfT09NCEMuyuERnYi+fEvMPK9by75VNGwf58eMHSqUSXr16JTiwBMBSZT4o+/0+f/goiiJciSzLUK1WuW+tVlsbqBsFAX5erfzjKMsyrrWY/GYgq3+kcF1XGnyxWCAMQ0RR9KQQEkilUhHkMStIiqIgCAIBhD2CWFuttH/aBBDXdYUrY1kWdF1HvV7nO85A4jjmEPls9bdMAGGvvHxrt9toNBpcFiRJAl3XsVgsEMfxnUXqT5oAwopUXm9Np1MEQcBBlstl4V8x/rYJIPP5XAhiFuDr3hXbZJKMPzk5gaIocF13K67Mfe3/+w8D22o7kG2zfwDRbvJQmsnd7AAAAABJRU5ErkJggg=="}, {"Type":"textFadeLeft","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGIklEQVRoge2YP2gTbxjHn+EVMmSIeMNBg97QIUiGUDIECfaQDC0KHhgkYpEDO2TIkEE0Q4aDDA4dOmQIWiVCBcEOHTJ0yJAhYAfBKB1uCJKh4A2FFjzwlBu+v6G813vvTf/YX22r9IEb8v558n7e93mfPy/hHxE66wWclFyAnDe5ADlvcq5AdnZ20Gg0YNv2b889VyC9Xg9EhF6v99tzL0D+hFyA4ALkz8gFCI4BYts2MpnMsf7sMDkMZGdnZ9+5vw3yf3btuLodx0E6nQYRYXFxcezcMwdxHAfPnz+Hbdv76jYMA0QEIgJjDMPhUNJzKiC2bcN1XanddV1omgYiQjKZRLfblXRvbGwEEPyr1WqnC+K6LmZmZkBEiMfjWF9fF/prtZqwwEqlIumu1+sSSDKZPFmQ4XAI0zRhWRa2trakscViUViApmlBn+/7UBRF6I/H4xJIKpUK7kav10MikQARYTQaHQ3EdV30ej1pAgdZXV0VFlIsFoVxg8Eg6Eun04jFYiAi9Pt9AMDa2hqICLlcDpubm5ibmwvGcxDP80BEyGQygd5qtQoiwsrKysEgrutifn4+2B0iQqlUkkDS6TQYYygUCsEiwzvJzcayLADA8vIyiAj1eh0A0Gg0QERYW1sDsHvpGWOCHr4ZYU/F27iesSCe5yGfz4OIYBgGKpVKsOvcvjlIeFdWVlakS5jL5aBpGjzPA7BnSvzkDMOAqqrCYvh94iCvX78GEaHb7QZjfv78iYmJCTx69Gh/kNXVVenY+v0+iAgLCwsCSD6fFxSlUinkcjkAwPb2NhKJBCqVijDm3r17uHHjRgA6MzMj9HOz4SBPnjwBEUkeL5vNBv81FqTVaknKAQgmwkH4by7lchmMMQC77paIsLS0JIyxLCswCU3TUK1Whf5WqyWAmKYpOAgupVJJaj/Ua3GbjIKEjzu8CMdx0Ol0DnXRiqJIoFHXfvfuXUxNTUlzHz9+jImJiYNBBoMBqtUqdF0XvFIUhHsfLu12O3CLb9++BRHh06dPYyE8z0MsFsOLFy+E9vX1dQFE13Xoui7N5ya4LwjfSe7TC4UCLMsaCxJ1y9yd9vt9vHz5EkQ0NpUAgG/fvoGI8ObNG6H9y5cvAkgul4OqqjBNE+VyGZZlwbIs6Lp+MEgmk4GiKFIEPgpI2CyWlpZARNjc3BwLMhqNQERot9tj2znI9evXpage/n78+DEeJB6PY25uTlDuOM5YkKj98zgxHA7x6tUrEBG+fv06FmQ4HIKIsLy8fCDI1atXDwT5/v37eJB8Po/JyUlBOTe3KEin0xHGhe/I+/fvQUT4/PnzWJCjnkgymTwQJCzSHWGMoVgswrZtdLtdqKoaJHRhkGhdwCO553lHSiyPAqJpGnRdR7vdhmVZmJ+fx507d5DNZqVgKnmt8OKJCKlUCpqmwTRNASSc/wC7F1NRFAB7QTSaDzWbzUAPY0yKRdzkOMjU1JSUw+27MeMaHcdBq9XC4uIiPM9DsVgMIjkHYYwFCx0MBmCMBYscjUa4fPkynj17Juh9+vQprly5gl+/fkHTNKmuiJ7k9PQ0Zmdnjw8SlcFgIN0R0zTBGEO5XA6Ko/AJZLNZKQYYhhHcwXQ6DcMwhP5oIL19+zZu3rx5ciBh2draQr1ex3A4DGoDng3zBBHYC1qDwQDAbtKYSCQCuEKhgFQqJeheWFiQUpSoCZ8YSFhs20Yul0OhUJCCH78nmUwGHz9+DCo9nmtx5xAuyEzTFEAqlQpisRh83xd012o1ydn80Xethw8fSi6T1x88E+BZte/7gYlykGazCSLChw8fBL2zs7O4du3a6YFsbGwIBVrYTFzXRSwWg6qqsG07SDrDIDz3irppRVGQzWZPDwTYMz9d16WUpVQqCacVrRBHoxEuXbqEBw8eBHO4yd6/f/90QQ6ScLXJi7VoIFVVFYyxILfjSWy0ljnzt9/w49u7d+8kEP4ooWkaGo1G8D4QNbczB/F9H81mE51OB47jQFVVAYSX39HPcRxBz5mDRMX3fSEebW9v49atWwLE9PS0NO/cgYwTnsxykGgOB/wlIMAujGEYQdyJyl8DcphcgJw3+WdA/gNJA/iefPxbBwAAAABJRU5ErkJggg=="}, {"Type":"textFadeUp","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAIE0lEQVRoge2ZL4zizBvHJ5eKiooKLmnuEE0OsWIFuSDIBVGxuSAQCMQm10sQ5IJAkAsCgeCCQCAqECsQTQ6BQCDIhksQFSSHQCBIDrECsQJBLhUVzaXi+woyz3WW5Zbdt/v+/uR9kiZLZzrTz3Tmeb7Pswz/J8b+0y8Qlf0LcsxWqxWGw+HR9vF4jMViEfW00YMMh0Msl8uj7ZvNBldXV1FPGz1Io9GA7/t/7FOv16OeNnqQarX6YJ9KpRL1tNGDlMvlSPo81iIF2e12qNVqD/ZrtVq4ubmJcupoQabTKfr9/oP9RqMRRqNRlFNHC2JZFubz+YP9VqsVGo1GlFNHC2KaJjzPe7BfEAS4vLyMcupoQXK53Ml9s9lslFNHBxIEAfL5/Mn9C4UCXNeNavq/B9LtdjEYDAAAy+USlUoFlmVhu91Sn81mg2azSb93ux0sy0K73cZsNgOwPzPhPk+xJ4OMRiMwxlAsFgEAtm2jXq9DkiR0u13qV6vVwBgjdzscDiFJEtrtNizLAgC0220wxmhR/jEQ3/eh67oAUq1WkcvlwBgTInc8HgdjDO12GwDQbDbBGEMul0OpVBJA4vH4g/ImUhDLssAYE0AuLi6gaRoYY+SRfvz4AUmShHulUoleOp1OAwB6vR6Nx7/Ss4P4vg9N05BMJoXV1zQNkiRBVVUYhgHg9/ZLJBJIJBIAgMvLS8RiMSiKAkVREAQBhsOh0C8IgucH6ff7yGQyAIBMJgPLsnB7ewvGGGq1GizLIpBOpwPDMLDZbMAYg+d5MAwDjUYDnU4HjDGsVivMZjMwxhAEAVKp1JOi/qNB0uk0HMchEMdxMB6PwRjDer1Gv98nkHK5TGdD0zQsl0sYhgHbtgl+MBgQKAA4jkML9Wwgq9UKyWSSfmuaBtd10W636b7jOASSyWQwnU4B7APgZDKBYRjCQtRqNQRBAMYYxZV0Oo3VavV8IJVKhbI713Vp3xcKBUqWwiC6rlNMKZfLsG1bAOl0OqQGdF2nzNK27UfnLCeD8EO+2+0AAJPJBIVCAQBwdnaGyWRyACJJEj3farXQbDYFkPV6jVgsBmDv9fjZ4O79Ma74UV8kfAibzSYsy4LneZAkicQiB9lut9B1nfoPh0PM53OYpkkgAKCqKna7HSqVCp0nYP/1bdt+HpCwGYaB2WyGxWKBVCpF9x3HgWmaWCwWFCfCViwWhQiey+UwHo/R7XbpCwPAbDa79/lj9iSQ9XoNRVHgeR663a6Quvb7fRSLRWGL3QXp9Xr0m7tix3FwdnYm9I3H4ycf+keDzOdzCojAfguEtdXV1RVti/tkfa1WEwTiaDTC5eUlXNcFYwy2bdOVyWROTsBOBvE8D5VKhaQE9yrpdJpULLA/O81mE71ej+RL2JrNplBp2Ww2OD8/BwC8ffuWxufXu3fv8OvXr2hAgiBAJpMRJuDVRL7FuJVKJYK5D6TT6RzcV1UVvu/j48ePByCMMXz79i0akGq1SoPGYjEwxrDZbLBerymWcCsUCuj1eqjX6/fGAh5LwpZKpbBYLEi23L1O2V4PgqxWK1KwZ2dnGI/H5PuHw+FBVphKpTAYDFAsFu9Nlsbj8QG8aZro9Xq4vr6+F+QUyfIgSD6fB2MMhmHAdV1YlkWHuNFoHJQ/NU2D4zhHQRaLhRAogd/nxvd9yLL8pCL3H0Fubm4gSRJKpRJJ63w+j1arRX+H61i+75N4PAbCxeLt7S3dCytqwzCEwBgJSKVSQSKRIKkQBAFUVSUhGI/HhTrWzc0Nib9cLncAwsdhjAnRfTabQVVVACAZExmI7/tQVVX4X8d8Pqe8gvv98MpOp1M6P4ZhHIAkk0mKQ2H5sd1uyYE4jgNZlk+qj50EYts2YrGYINwajYYg13kOwa3T6ZBcMQyDcnJuuq5ToLtbtWeMYTQaIQgCKIqC8Xh8MPZ6vX48SDqdPnCf5+fn9HKWZSEejwvt+XyecvNsNnsQL3RdR7/fx6dPn/D+/Xuh7fXr1/jy5QuNE9ZdwN6z/cl73QvCPUtY3F1fX+PFixckR0zTFNQtsA9s/KAWi0VcXFwI7bIsw3EctNttyLIs5Oa6rpMr7/f7kCSJUgZgv3A8xz8Z5OrqivYsN9M0wRij5CeRSAggq9WKtgewdxRhEcjPgeM4VJQIOwpd1ym+eJ4HWZbR6XSofTqdCvOfBPLhwwe8efOGNM5kMoGmaYjH4/j58yc8zwNjDIqi0DO8EMczQl6/4s6AFxjm8zk5inDElmWZHAmwVwg8lQZ+n8mwQH0QRFEUOrRhncX3KH8pvkKe50FVVeEL9Pt9YeK7oMlkEpqmwfd9Kj4wxkiATiYTMMYoReAFjmP/7ToA4QFLVVVKkrjG4p6m2+2SbMlmswQanoTDKoqCWq1GdSxu9XodjDGkUil6XpZlYcUTiQQYY8jn87i4uBAKfQ+C8E8YvkzTRCwWoz1bLpcP1PDdPX97e4tXr14J7eGMb71eHzyfzWaFxeh2uwd97nq7oyB8S/BLURQsl0uhyJxKpVCr1WhfM8aEMhE3wzCEse7qsnC7LMtotVpC2hwEAc7Pz4UxjkX9A5DFYkEPSZKEyWRCX4mvuKIoGAwGwle5G8AA4OvXr9T+8uVLfP/+XWhfLpe0RTOZDIbDobD9gL3b51uMMYbPnz+fBuK6LjKZDDRNo5fbbrdwHAe+78P3fTiOA9d1MRqN6Awcs2q1CkmSjuYUvV4PqqpiPB7DdV2aJ2zz+Zzqwo9yv/+L9i/If5v9BWGRdKF0A6I0AAAAAElFTkSuQmCC"}, {"Type":"textFadeDown","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAHrUlEQVRogeWaIYziWhfHr0A0mwoEogKBqECMGFHBJogKNotAVCAQJFuBQCCaLNkdQbJNECMqEBUIRMUIJovoJgg2O4JkyYZMEBWIiooKNukkiCZTgaj4P0E4u53ZN99Mh9335b2TVEwP515+veee8+9lGP4lxv7pL3As+++CXF9fgzGGjx8/Hv3LfP78GYwxXF9fPzk21YpwHAfDMNKEPmimaYLjuFSxqUAkSYKqqqkmfMg0TYMkSaliU4G0Wq3UEz5klUoFrVYrVWwqENM0wfN8qgkfsnw+D9M0U8WmAlksFmCMYbPZpJr0VxaGIRhjWCwWqeJTgRwmvbq6SjXpr+zq6gqMMYRhmCo+dR8RRRGDwSBt+D0bDocQRTF1fGoQRVHQbrdTT3zXOp0OFEVJHZ8aRNd1lEql1BPftWq1Cl3XU8enBrFtG7lcLvXEdy2Xy8G27dTxjwKxLAuNRgOO49A9z/PAGEMQBLAsC+fn57+MdRwHnU4Hvu/f8xmGAcuyEEURGGPwPI98URRB07S/HffJINvtFplMBowx8DyfmCybzWI+n0MQBDDGcHFxkYi9ubnBq1evwBjDmzdvEr7xeAzGGI2RzWYTfkVRwBhDJpM5DshyuQRjjK5arUa+crmMXq9HPlEUEccx+afTKfkymQy22y35CoUC+TRNQ7lcJp9t24k5f7WaTwZZrVaJQRljmM/nAIButwtZlhO+n3vL27dvE75Pnz4B+NFQD9fp6Sk6nQ4A4Pb2Fq9fv074gyB4PkgQBJQCpVIJjDE0m00AwGQyobQ7pFe326XY09NTWinGGMmPbrcLxhiKxSKNPRqNAPxYjWKxCJ7nj5dawL6i9Ho9AHvByPM84jiG67pgjCGXyyGKIsiynBCT+Xwe9XodcRwjl8tB0zQA+5SUJAlxHNMDWK1WAPZ7o1gsIooiNBoNnJ6eHg+kVqvRkw6CABzHUXrxPE+TXVxcIJPJYLfb7QdnDJZlAQAajQZJf57naQUOqbnb7bDdbsFxHKWnqqq0+kcBOT8/T2zyRqNBKyRJEmRZBrAvmZlMBo7jUEq6rktjqKoKz/OQyWQQRREAoNls4uTkBAAwGo0Sm75erz9aDT8KxHGcRPObTCbU1TudDoEAQKlUwng8hu/7YOzH8JZlQVVVTKfThCJQVRX1eh3APq2GwyH5RFFM9K5ngwCAIAhUBqMoAsdxiKIIpmkm8ljTNPR6Pfi+j3w+fw9kMBhQhQL2aWsYBqIoQjabJfUbhiHtxaOC+L6faIalUgmLxQLL5RKFQoHuj0YjqKoK3/cT9yeTCWzbRqfTSaRLuVzGdDrFbDZDtVql+7PZLJHORwO5a2dnZxgMBoiiKPG2uFwuUalU4Pv+L0VltVrFbDajvwuFArbbLTRNSxxodLtdKgiPsdQgg8EAjUYDAFAsFqlpBUGAk5MT+L6f2DsHE0WRCsChLAP7nrNer+lzJycnT3oDTf2GKAgCBEEAsK8uy+WS/Pl8/m9XJJfLUXl2XRfVahVhGILjOFiWBcuyMBwOH90/ngWiqirJB8/z0O/3E4JRFEWEYZjYIz+DHMy2bXS7XVxeXt6TQR8+fPi9IHEcJyYcj8eYTqeJlyJZlu9tdgDYbDaJJ20YBi4uLvD+/ft7IF++fPm9IIf+cNBImqZhs9kkOrCqqveqGQCs1+tEJWq321iv16ThDtfPZfu3gex2O5rQNE3qxJVKhT7T7XYxn8+pYx9sPp8nTigrlQqCICC9dbjevXv3+0GA/R4QBAFxHJP4+/lJH/bM3VMR27ZJ2gD7FHQc59F66iFLBdJsNqk7t9ttOI4DTdOoYR6qz93KY1kW9Qrf99FqtWCa5lGOlVKBWJZFR0GWZcE0TViWhclkAgC0+WVZJokRxzHOz89JDdu2jcFggFarlfp08dkg2+2W5ITrumg2m3Ach6T+YrGArutoNBqkzzqdDnRdJ4ne7/cxn88hSRIp4T8OAuw36qGxSZKE3W5HcL7vo91uo9VqEUilUoGu6/QeoygKwjCkYhHH8b3Diz8C0u/36enWajUEQUBfyvd9qKoKXdcpbWq1GlqtFikASZLgui7JnKurq0Qh+GMgruvSbxlnZ2ewbRvNZhPr9ZpAhsMhCURFUUgVe54HRVFg2zadWzWbzYS6/mMgwL587nY7jEYjUq/D4ZBAptMpRqMRdrsdarUagViWhV6vB8MwYNs2wjBM9KE/DmIYBsbjMebzOUqlEmazGW1wVVWpLLuui3a7TSDNZhOTyQStVgur1QqmaT5Jsh8dZLPZQFEU+L4PjuPw/ft38DwP13WhqipVt/F4TO/sq9UKuVwOnuehXC7D87yjVK5n/85+eFXleR6LxQL5fB6yLJMU4TgOpVIJk8kEqqpCkiQ6HhUEAbIs0zHRc+zZIIdj0WKxSE+dMUYgL1++BGMM3759I1+tVsPt7S1evHiBbDaLr1+//vMgwF57iaKIs7Mz6LqOYrFIIPV6HYwxRFEEVVUhCAJ0XScV/Zwfd362o4BYloVCoYB+v4/Ly0soikKl2TAMUsG6rqNWq8E0TQJ57HHP/7KjgBzUbxAEuLm5wWKxICHoOA7pskNfCcMQm80mcU78XPvv/lPN/6v9a0D+Aj2lePye0dmuAAAAAElFTkSuQmCC"}, {"Type":"textSlantUp","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAE8UlEQVRoge2YL3DqShTGj1gRERGxIgIRgUBUVFREIBCICAQCgahAVFREVFQgKphBICoqKiIrIioQFRWIiAgEAoGoiEAgEBERKyIQiO+KO9nHkvTPu49C3p1+M53pbs9u97d7zp6zIfwlolMv4FD6ASmbfkDKph+Qsql0IMvlEqvV6l+PKxXIfD4HYwxhGL5rE8dxYX+pQMIwBBEVgkwmE5imCSJCo9HAZrNR/v6/ABmPx2CMgYjkj+d5ik3pQeI4hmEY6Ha7EEJgNptB0zScn58rY0sP0u12cXZ2hu12K/va7TYqlYoyttQgaZqCMQbf9xU713VBpC69FCCe5+Hq6gqPj48KyHg8BhFhuVwCANbrNXq9HhhjYIwpc5wcpNfrKUG8C+K6LjjnEELg7u4OmqaBiNBsNjGfz5V5TgrieR6ICP1+H77vQ9d1BcRxHJimKa/dWq2GyWRSONdJQarVKm5ubmT77u5OATk/PwcRgXMOz/NkwIdhiF6vp8x1FJA0TTEejxV3mE6n0HUdQgjZFwSBAlKpVFCv15GmqTJfo9FQNgA4AkgYhtI1dhd5dXUFx3EU2+VyqdhYloVms6nYxHEMxhim06nS/0cgz8/PeHt7+9RusVhA13WYpolarQYiQrfbBfDbbe7v7xX71WqlgDQaDViWpeSQXq+XyyF/BPJRPbQv27Zh2zaSJMF2u8XZ2RkajQYAgHOOp6enD0GyG200GiFNU5k/Hh4ejgeyWCzAGEMURbIvCAJsNhtsNhsQUQ5kNpspc08mk9zVnJ3owUGEEAiCIPeGuL6+RqfTKZwj2/n9jP309FRYohARDMPAcDhU3OxgIFEUyUDWdV0JQE3TchVqpvV6DSLC4+Oj0p+50v5pv/cGOQhIEASoVqvgnMMwDBCRPIEkST51P8YYXNdVFptl7q/E38FAOp0ObNtGmqYQQsCyLFn/zOdzEFHO3dI0le6UbYIQAmmaot1uo91ugzGGxWJxPBAiUv5hlpVXqxVeXl4KQQaDAUzTBPCP71cqFXDOoes6lsulLBAPCrLdbhEEgbLgDGQ/mWWBOp/P5e/7IM1mU457e3uTtdV+fB0UZDKZgHMudz/bqQxkNBrl7IkI0+lUguwubrvdQtd1JcCjKILv+1iv1/8J4l2Q4XCYeyNnSWg32ItAVquVtNnN3P1+H5qmKbXVIZUDyQq3TqeDJElkkhoMBgrIbDZTxmWnIIRAFEUgIliWhTAMMRgMcmDfCpKVEZ1OR0k8RSD7/j8ajcA5l+1Wq6WcqOM47yazg4Nk1+ZucMdxXAiyXzQ6joPLy0vZjqIItm2jVqt9mJEPJQXk4eEBlmXJdhzHsmrdB9lNWkII6LqOl5eXb13sR1JAXl9f5U4HQaCU3/sgu7eP67qwLCv39e+YKry1PM8DYwz1eh1CiEIQ0zTx+vqK4XBYWAAeWzkQ3/dlcGblRxHI7vX8Xml9TCkgSZJA13Xl1squ0uyNnIH4vg/HcXKJ8VRSQEajEQzDUJJWv98HEcmvFmEYolqtIkmS4670Eykg9Xod7XZbtoUQMAwDnHPYti37ThnU70kB4Zyj1WoB+F1y1+t1uK6Ly8tL3N7enmSBX1UORNM03N/f4+LiApZlIU3Tb09mh5ACsltWWJalfDgouxSQKIrQarVwc3PzpXdymXTyr/GH0g9I2fTXgPwCxRmiuVvgWoIAAAAASUVORK5CYII="}, {"Type":"textCascadeUp","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGAUlEQVRoge2ZP2jbThTHH1SDKYJ68CBaQz0ImsGUDqJ48KDBgwcPoXgIJYMpomQINIMLHjwEPKSgQYMppmQwtIOHUDIEmsGDBxfaYooHUULxoMGDBw8eNGgQ9Nsh3P18OiVx2sRx++sDD5HevbvPu3t/TiH8JUI3vYCrkn8gqyYrBeJ5Hur1Ok5OTi49dqVAer0eiAi9Xu/SY/+/ILPZDIeHh5hMJpee7CJZKsjvTHadtv8IkPF4jM3NTRARkskk+v2+NHblQYIgwNraGoiI/1RVxXQ6FcbeOIjrutje3ka73Y61Xa1WQUSwbRue52FnZwdEhL29PcHOjYKcnJwgmUxyT1cqFcF2GIZQVRWVSkUYl8lkkM1mhWfXDuK6Lra2tmBZlpTpisUiiAipVAqKonAgZvvo6AhEhIODA2Hcs2fPcP/+/eWBRD3+6NEj4R0RoVAowPd9uK4LVVUF2/V6HUSE2WzGx43HY6yvr4NIXPpvgfi+D8dx0G63Y3WfPHkiBCkR4f379wAAx3FARBgOh1w/erTK5TJ0XUcQBOh0OjBNk++coihXB8JSIhFhf39f0BsMBiAi6LqOfr+Pvb09EBF2dnb4IqPnvN1uCyCmaSKZTPKdIiJomoZarQbP8xYDCcMQ/X5fOtcMpNlsCp7WNE04AuxYzAduOp2GaZoAAMMwYFnWmU4CAF3Xuf1cLodOp4MwDGPXGwvS7/eRTqdBREgkEsL2s8ny+TyICJlMhm/3u3fvuF6hUIBhGILdjY0N5PN5AKeZp9lsCu89zxNAMpkMDMOA67qC3sHBATY3N88HCYIAqVRK8PZ8kDIQIsL6+jrCMOS7s7W1xfVUVeXHiMlgMEAQBAAARVGk2IoDKRaL0SVC13XJtgSyv78vBSgRca/Mg7BnYRgilUpx4Nlshlu3buHNmzfSIpiziOhCENM0kcvlBJ3hcAgiktoUCcQ0TRARisUi6vU6D7Tj42MBZH6XAKBUKvGUGF1QVNj7KMhoNJKylqIoGI/HAE4dViqVkE6nJZsCyGQyARHxgATAj43jOAJItNqy4J5Op/jy5QuICF+/fr0USDTYWYouFArodru8fkRjSwJhlfTo6Ejy0u7urjCZbduCIZY6Pc/Dhw8fQET4/v37uSDRBbFjzUAmk4lQ8YkIGxsbsTYFENu2QUTwfV9UigGZh50HcV1XgDoPpF6vC88ty5KOpOM4SCQS0DQNjUZjsfT78uVLPHjwQFK6c+eOBBI9/2w3e70e92wUZDQa8V1QFEXISGEYQtO0WNtRx14IUqlUeJ4XlGJ2JDrZ/PPXr1+DiPDt2zdB59WrV7h37x5+/PiBtbU1qKrKF9lqtc4EWUSkrBWt5MzTUZCot7vdLn/OduTz58+CzosXL/D48WMA4O2NaZqoVqtQFAW1Wg2qqkoF8JdAohAs/V4EMh8XnU5HSNlMTNNEqVQSwOdbnMlk8ssfNc4E2d3dFSZaFGQ2m3GdRqPB3wdBgEQiIWQqlk41Tfulj3IXgrDrJJskDiRaWVnGA/7LSoVCgb9vNBqSA8IwxPHx8ZV8WpJAWEzMe2qRYK9UKtB1nf/N+jXHcdBqtaAoilBor1okENY6q6qKwWBwqhQDcnh4KIwzDEPoSJ8/fy71a51OZzkgHz9+BBHh7t27ePv2LX9++/ZtCWT+rPu+D1VVeRsDnF4FFqnI1wLSarViW4e4Hdne3pbGReOm2WzCNE3p0811iABSLpeRSCSESjoej2NBNE2D7/vwfR/ZbBaapp3ZPixDBBDTNKXK/unTp1gQlpUMwwARoVarLW/VMSKAPHz4EE+fPhUUWD1hNzIGEr1FntUgLksEkGQyKX0QyOVyQkzMxwiDWEYMXCQCSPTCNJ1OpazDQEajESzLWgkIIAKSTqeFK2y1WoWqqsjlcvzuzL5nLdJaL1MEkGw2CyJCq9WCbdtQFAWWZaFcLiOVSt3UGhcSAYQ1cfO/4XAI27alSr5qIoCwy/6yqvFVigAyGo34/SOfz69cHJwnUtPY7XZh2/YfBQGs2P/Zf0f+gaya/DUgPwHndw+ryzSioAAAAABJRU5ErkJggg=="}, {"Type":"textCascadeDown","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAFzUlEQVRoge2ZLWzbXBSGDzAwsCYDgwBrsiaDgACDgIKAAINKG4imgIAAgwBPCoimgoCASNWUSQUBAQEBBpHWSQUFlTZQENBJAZFWEBBpkWYQEBBgYFBg8H6g373LtZ203dK/aa9kqXHvz3l8zz3nXJvwl4ge24Bd6R/IU9OdQWazGVqtFnzfvwdzfl93BhmNRiAijEajezDn9/UP5D5AlsslTk9PEQTBnfs+KZA/GTsBcnJyAkmSQESwLAtnZ2c7m+wm7QxkNptxiPXr5ORkJ5PdpJ2BHB0dgYhwfHyMIAjQaDRARFBVFVdXV4nJPM9DvV7HYrF4WiCe5yGbzQoNOp0OiAgXFxfCZK7r8hXTNA3z+fz3Cf7XTvcIe/JMl5eXICJ0u11hMiKCJEnQNA1EBMdxEoNHUYR+v49er5cY995B0owhIrTbbWEySZIwmUwQhiFs24YkSYlsXyqVOHQul0MYhg8H4nkeXNdFu92G53nwPC8VpFwu8z7xVQOuo188aNTr9YQB/X4f3W4XYRjuDqTX6yUmZ1ccpN/vCwPlcjkBrlKpgIjw5s0bNJtNKIoCWZYFF2P7j4hQrVZ3B5LP5/nTdhyHX2kg8clqtRoymQz/rSgKdF3n7jQYDEBEPC8FQQBVVYWHxVY/DWSxWGx1TQFElmXYtp1slAIyHo+FNmw1getSI+5KV1dXkGUZBwcHAIDhcMj3mmEYICIUi8VUEBYhVVXF5eXlzSCmaaJSqdwKJL6x2dP0fR/n5+c8H63Ltm2USiUAQL1eBxFhMBggiiK+8nGQs7MzYdVM00QURdtByuVyIo8EQXArkNPTU37/+PgYRIRv374Jbd69e4d8Pg8AKBaL0HWdGzWfz1NBbNveWmmkgjBj1hsyl7lpj8Qzfhqs7/vcJU3T5KvDtLe3J4y9Wq248bVajf8/3i8Bwp6UJElotVro9XqQZRlEhGazKRj89etXoR9zgdFoxDf2tlNkJpPB4eGhcI+5GwNhIZwZHoYhstksZFlOuFcCZLlcwrIs/iRkWYaqqjxzbwq/66vA/t5Wg7EotS62+gzkw4cPICJ8/vyZt/n48aNQMm0EYeSe56HZbML3fezv76NarQogtVot1Qjf9/Hp0ycQEX78+JEKwVwmDsKCBAOp1WogIuGgtVgsUvve6mDlui7fpAxEURRhApYAoyjibvb9+/fU8XzfTzUmvv9ev36NV69eJfpns1m8f//+7iBRFGE4HAqTGYbBA0AYhtA0DbqupxoUF4tQcRAGyPrlcjlYlpXov7+/j2KxeHeQdU2nU6iqyssL13V5NGk0GoJBDD6uTe4RBzEMIzVBO44DwzD+DAS4Dgir1Qq6rgvx/fz8nLfJZDIcjGkwGPAkeVsQVq8Nh0Nep7muuxsQptlshkwmI6wGU6lU4vuK6eDggJcxiqKg0+lsBYk/KEVR4LouyuUyd+OdgADXmT8tX3S7XRARJpMJv2fbNjfAMAy0Wq2tIC9fvtxYjb948WK3IJu0XC4hyzL29vYQhiH/XSgUAFxX2utlPwBMJpOEa1mWJeS19etBQIBfmdo0Te4mzAVLpVKirovnkUKhwIvY8XgMx3GEtzwPBuL7Pt9D7GJlOHO91WrF27N7DKRYLCbC7Gq1QqfT2e1mv43WA8L6Cwp2PO71evxetVoVQMrlMnfFm/Qg30eCIEg9EOm6zl9KrJ8YGYjrujBN81ZzPOqHHvYC0LIsFAqFxHmk2+1ClmX8/PnzxrEeFWQ+nwubV1EUAYSVOvFK9/DwENPpVLj36J/e2u02B2HHXQYSP50y5fN5aJom3Ht0EODahRqNBqbTaaLY1HVdOBKHYQhZlpHL5YQxngQIUxiGcBxHAGFlzdHREYBfr5XiyfRJgaRpNptx16tUKnwfxcubJw8CAG/fvk2UJ1++fBHaPAuQ8XjMV4KVPHE9CxAAuLi4gKZpUBQlEY6BZwTCtOn977MD2aR/IE9Nfw3If9N0EwglGDDbAAAAAElFTkSuQmCC"}], [{"Type":"textArchUp","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAADYElEQVRoge2YoZeqQBSHjfsHGDYYCAYCYQLBQDAYCBsMGzYQDASCkWAg2AwGosEwwWAkGAwGAsFAIBAIBgLBYCBMmDDh98I7yzmsuuuuso/zDl/ycB3v/YB7Z44t/Ce0/nUBj+JXRDjnOB6Pleb4FRHf99Hv9yvN8Wsiw+Gw0hyViqxWKwyHQ8znc4xGoypTVSdyOBygKAo8z4Msy5hOp2ffYYwhjuOH5LtLhDEGXdfR6/Vg23YpRiktinccB67rluJhGOL5+RmKosAwjHvKAHCnCKUULy8vAADXdZHneSm2XC6Lz5TS0lpN0xDHMYQQUBQFp9PpnlLuE/E8D5PJ5GIsjmOMx2MAwHw+h+/7RSwIAjw9PcEwDERRBFmWL4qcTies12swxr6s5S4RzjkIIeCcAwD2+33pqQwGA+R5Dk3TEEVRcX25XMLzPLiui263ezbRkiQBpRSyLKPX60FRFAghHiOSZRn2+/3Z9eVyWfTHdDotFbzZbNBut0EIQZqmxXXHcRCGIRhjSJKkJA/8HdetVqvoqzAMv6zvqkgQBDBNE4wxRFGEdrsNVVWhaVqpKACwbRtvb28ghOBwOJRil+7ker0GIQSapmG73ZZix+MRqqqWhsUtXBXhnMO2bciyDMuyih9NkgSapp0dOcIwxG63uzlxEARnN+RdIgiCm3/nnS9frTAMQQhBr9cr7m4URRgMBt9O9hnvo/wnEsCNPSKEwHQ6xevra/EkDMNAlmU/SnqJ8XiMJEl+vP5bUyuKIvT7fZimCV3XKz/RUkqLqfVxw/3It8evEAKu65am06PhnMOyLMxmM6RpijzPoSjKpzmvijDG4Pv+TZvRo3jvQV3XS69ZlmWQJAme511de1FECAFZlqGqKmRZxmg0+nET3kqe53AcB0IIdDod7HY7bLdbzGYzdDodGIaBzWZzdf1FkSAIQAgB8HeTM00T4/EYkiRhsVhUIkIphW3bSJIEs9kMkiTBsizsdrvi5PAZF0WyLEO320WaplgsFsUeYlnWxd39EXDOsVqtQCm9aSf/yNUe8X0fm80GaZqCEILJZAJVVStt8nu4aWpxzpGm6d1H7Spp/g6qG41I3WhE6kYjUjcakbrRiNSNRqRuNCJ1oxGpG41I3WhE6kYjUjcakbrxBw0K0kIhG+liAAAAAElFTkSuQmCC"}, {"Type":"textArchDown","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAADnUlEQVRoge2YIXTqPBiGEROICQQCgUBETERUIioQiAoEAhGBQFQgEJMIRM+pQFQgKhAIxASiImJiAlFRgZhAICoqKiYqKhAViIj3ip31p3+BAWN3vTt9FHxJz/meNPmStIBfQuGnE7gVuUjWyEWyRi6SNXKRrJGLZI1cJGvkIlkjF8kauUjWyEWyRi6SNXKRrPE7RYQQ4JyDcx7/Hg6HCMPwp/I7m4RIu92GoihQFAW9Xg9hGGIymaDRaPxUfmeTEKlWq9hut9jtdqjValiv1wiCAHd3dz+VHxzHgRDi034JEVVVYRgGhBCYzWaQJAmSJMEwjG9L9BRRFIEQgnK5DFVVwTnHbrc72De1Rur1OgqFAiilMAwDQRD8laQP0el0YJomXNcF5xyMMRSLRXQ6Hdi2neibENntdlAUJdXp/5imibe3t1vnnaLX6+H5+TkRe3x8RLfbBaUUg8Egjl9Ufn3fR7vdhmVZt8l0D8/zwDlPxMIwhCzLWCwWcUzXdYzHY4RhiHK5jO12C+BMESEETNNEpVLBcrm8Yfr/MZ1O0e/3U/HtdgvGGAghqNfrKJVK8H0fQghUKpW436cirutClmUwxmBZFiRJSr3uWxBFEZrNJgzDwGq1SrWHYYjVaoUoirBcLtFutzEcDuP2oyJCCBiGgVqthtfX1zg+GAxSU+BWLBYLFAqFk2s0iiIwxqDreiJ+VGSxWIAQgul0Gsd83wel9GgJ/CphGGK9XqPRaGC9Xl/07MmppWkadF2HEAKWZYFSevC1f8Z8Pr+ojPu+D0IIHMc5+5mTIp7n4eHhAcViEZTSxBT7QNd13N/fo9VqHd2BdV2H67qJWBRF8XHo0Oi7rnuRzFlV69hojkYj9Ho9AEC/30/N7SAIYFkWZrNZqm00GsE0TaxWK1BKj8q0Wq1zUrz+GO84Diil8VvgnCdGXQgBSik6nQ4qlUpiLwDeN7vNZgPHcSDLMlRVvTYVAF8QYYxhMpkcbX96eoKmaQDeR3+/aADv669araLVasG2bXiel5p+l3C1SLPZjDfHj1PyPt1uN55Otm3HUh9wziHLcvxf0zTM5/Nr07leZDqdghCC0WgEQkhqNBuNRlwcXl5eDu7akiRhMBhgNpuBEHJxyd3nS1fd5XIJTdPgeV6qTVGUeF2Mx2MwxlJ9giBAv98HY+yqsr7Pt93ZbdtGqVSCqqqo1Wrffsv81o8Pm80mPvJ/Zdqcw+/8ivIv8wdL3arN8Q1vAgAAAABJRU5ErkJggg=="}, {"Type":"textCircle","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAF3klEQVRoge2Zr5eqTBjH9w+44QaDwWDYQCAQCBsIhA0GAoFAMBAIBgLBQDB4joFgIBgMBgKBYCAYDAQDwWAgbCAQDAaCgTCBQPi+YY+cZZFdf/HePffcb2NGZp7P8Dwzzzw+4S/R05824FFqDCRNU4Rh2NTwFTUGEoYheJ5vaviKGgNJkgQcxzU1fEUPB0mSBIqiwDRNdLvdSj8hBI7jII7jh877cBBVVWGaJiaTSQUkz3OwLAtFUcAwDKIoeti8d4Hs9/tKG8dxRXun0yn1ua6L4XAIAFitVhiPx5X3gyBAu90Gx3FIkuRiW24CIYSApmmIoghZlpHnedGnqmrhNrIsl97TNA2tVgs8z0MQBMxms1K/oiigKAqbzQau64IQ0izIZrOBqqoAUFm11WqFyWRSGPaxv9/vY7/fIwgCjEajyhdVFAXPz89Yr9dX23QTSBRFpa01yzJkWVY88zwP27bR7XZLxhqGgfV6jSAI4DhOaUzf9yHLMgghpS98qW6OkcFggOVyCQCwbRue5xV9h8MBmqZhuVyW3CNNU7y8vEAQhEo7z/NXudJn3QxCCAHP85jP5xiPx5jP5zcboaoqdrvd2b40TS8a4yxImqbF6vi+j3a7DZqmK8bmeQ7LsiDL8sUTftZut4NlWaU2Qgg0TQNFUWi321itVreBLJdLdLtduK4LSZKw3W6RJAl0Xa/sUo9WnucQBKFwW9/3IUnSt3PWulYcx+j3+/j9+3dpxVzXhWmaDzK7KsMwCggAsCwLrVYLm83my/e+jZFT8jcejwt3YxjmPmvPaL/fI8sytFotEEIQhiFUVYWiKBelMxcHu+/74HkeHMeh3+/fZfQ5nVzWdV202230er2rrgFX71qO49wc2F+J4zjoug5d1791IwClcwv4QTfELMu+PEfyPIfv+xgOh6AoqhKnZ0G22y0YhgHP8xgOh1iv13cdVrfqeDzCtm3Isozn52f8+vWrNgc7CyKKIjzPw36/B8MwmEwmaLfbGI1GjRt/0mw2K1Kak+Ge51US0ZPOggiCgNVqBUJIsUPVpd3/l47HIwzDgCAIZ/vPgsRxjF6vhyzLIMsyNE0Dz/OVRK9JBUGAwWAASZIgSRIEQcBkMqm9o1wU7EmS/JEYuUY/Zte6V/9AmtZ6vYaiKJAkCbIsYzQawXGc2tP+S5Dj8Yj5fA7DMKBpWuny1ISOx+PZ9jRNEQQBZrMZFosF4jhGq9UqZRi1IJZlgaIoLBYLvL29IYoi0DSNOI7hOE4jO9h0Oq0UJC5VLUir1So9v729odPpQNO0Rmu6juNAVVV4nnfVvacWhGVZTCYTTKdT9Pt9DIfDh1cH65TnOWzbxuvrK0zTrHW5j6oF2e126Ha7GI/HFw3UhE5ALy8vUFUVh8Oh9re1IISQSqp8UpqmjcBtNpvar+55HtI0hWEY2G63lf6rtt84jiHLMkRRBEVRFxUFrhEhBJIkfbk7bjabszXji0GCIADLssUgs9msUv24VaecTtd1RFEEjuNgGMZjgv3zRAzDFFXDU1X9miLzOX02NAxDKIqCTqeDXq+H19fXi134IpDD4VBU1gkhUBQFi8Wi9BtN0y6a8PM752LC932YpgnP80BRVG3x7qMudi1RFMGyLBiGqRxaruvCtm0AKIrbwDt0HMfI8xxhGCLLstICnGLus/b7PSRJAvC+e3Y6nW/j8apgD8OwUnjIsgy9Xg95nuN4PGIwGBR9u92uADz9L3Iy8CRFUeD7fqmNEAJd14vnw+HwrYvdnTRallWs8mKxKK3cer0uQE4Ap4r7RyNZlr27enk3CEVRxXnDcVzp7LFtuwARRRHAez71eXvVdf2uIjjwIJDhcAhZlituY5pmAULTNID3g+3zxpAkCTqdzl31srtBDocDptMpdF2vZMSLxQKWZSGKIjw9PRUQLMtWxhmNRkUc3aJGL1ZRFKHb7YKmaSyXS9A0jfF4fPbkTtP0rlJs4zfEunzt0fqxV91r9Q/kp+mvAfkPWgnC5oYbWPkAAAAASUVORK5CYII="}, {"Type":"textButton","Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGYUlEQVRoge2ZIYziTBvHR4yoQPSSCgSiAlGBqFhBLoiKJoeo2FwQTW4vQZAsYgWiYgWCBMElCMSKExUVCAQCwSWIFc2lAlGBOIGoaHIkV1GBGFFR8X/Fhn5w20LZ5bu998v3TyqmfTozv/aZmWeeIfgfEXnrDlxKFweJ4xjj8RiNRgOapsEwDPi+f+lmnuniIIZhoFqtwrZtbDYb3NzcoFarIY7jSzd1oIuCbDYbEELw48eP5F4cx9hut6n2URSh3+9DlmU0m008Pj4m91VVTcp59F8BcV03l71hGCiVSlgul3BdF9VqFZZlwTAMUEpz1wOcCeK6LizLwnK5zLRRFAWdTicpz2YzSJKU6lqUUliWlZSDIIAoiqCUYjgcntO1bJA4jg9cZPf16vU6KKXo9/up763Xa4iiiFqtBl3XIcsyHMdJb5yQg48SxzEEQUC9Xj8L4ihIp9NBoVCA4ziYTCZoNBrJM8uyQCnFZrNJfTeOYziOc9I1FEXBeDxOyoPBAMViEWEYnsuRDRIEAarVKgqFAmRZxmq1OnguSdKBW7xE6/Ua5XIZrVYLuq6DEHLWAN/X0THCGEOj0QAhBL1e7+CZLMtYLBYvanRfURTBcRwoioL7+/sX13NysMdxDMMwwPM8TNME8ORal14bwjB8VX25Z62HhwdQSiHLMrrdLhhjL270XHmed3K2PGv6nc/nuLu7e3XHztFoNAKlFKVSCYIgZLrfSRDLsp5dnue9qFOMMUyn05N2QRDAcRx4ngdCCFRVxWg0AmMMtVoNs9nsfJDdQN+/fp/B8mq73YLn+ZN2q9UKg8EAlmVB0zRst1tIkoQoimDbNjRNOw3ied7B+kAIyYyVfhdjDKvVClEUpa4xvu9DFEUAT1PvsRgsDEMsFotk/er1euj3+8mCexRkPp+DUgpKKTRNw2KxyA0ym80giiKur69RrVZTG/N9HzzPo9lsQtd1CIKQOoXbto1ms4k4jnF1dYXVaoXtdotisYharZa68h+AyLIM0zSh6zoURQGlFISQg0uW5VQQQRCSfcd0Os0E2Y+OB4MBWq1WJgjw5CGlUgntdhudTgfVajV1f5OA+L6fkDYajWTKI4ScDBk2mw1KpVJSDsPw6B/ZybKspMNZIMDTWua6LqIoyuxDArL/sizL2G63yRc85VpxHIPn+WRtWS6XqSC/D/bZbIbr6+uTIHmUgLiuC0mSkq8ZRRFms1nuMXJzc4NWqwXbtqEoytuBAE/R6Gazga7rqFQq4HkeHz9+zFURYwz9fh+dTgePj4+pIGEYwjCMpOw4ThL27Gu9Xqfezw2yi3XCMMRwODzYj5xSu91GEAQAgMlk8qI9xWt0sa3ufD6HoiioVCqo1+sJ1J/S//Naf5sI8DRQz8lY/I0ijDFIkoRKpfLWfXmViOM4KBaLRzct/waR3QKWpiAIMBqN/kju9rUiQRCgWCwm4QVjDKZpQlVVUEohSRJs237bXuYQAYBWqwVJkqCqKjiOOwjj/xat12u0Wi10u93s6Jcxhk6nA03TMg3fUjuv0TQNpVIJhBAoioLJZJJExP+KdaTb7eLr168A/nP+IssyeJ5PAtq/HiSOY6iqmhqBH2zJz6l0uVxC1/XX9+4MqaqKQqFwMuGRG2Q6nYLn+VzpnEvK8zxUKhUIgnC07Vwgw+EQHMf9cYidGGO4ubkBIQTNZjPVzY6CxHGMu7s7UErfDGJfDw8P4DguNS7MBGGMQdO0JF0piiJEUcTV1RU0TTtr03VJZe1zMkF2Odfdn6jVahgOh/B9H77vZ1ZoGMbZkXQYhjBNE4PB4MUZ+aOutT9TKIqCbrd7tLIoisBx3Fm5Ydd1Icsy7u/vUS6XX3xckXvW0nUdnz59Omozn88hCELm8zAMsd1u0ev1oCgKdF1HvV5PIgnP88Bx3LNDpTzKDXJ7e4v3798ftWm326npHeAJYpdZN00Ttm2jUqk8y7Z0u11QSs9OlOcGWa1WqNVqR21EUcRgMMh8znHcQTpolzfbj+2iKEKpVDo4fM2js1b2Y777/ft3EELw7du3TJtyuXzgNlEUoVAoPDu82WX0z9HFYq0vX77g3bt3+PnzZ6bNhw8f8Pnz54N7t7e3kGUZv379elX7FwNRFCUzU79Ts9l8ZrNcLjEej199sHoxEMbYyWnXNE202+1LNXmgfwDJIwE2xeerMAAAAABJRU5ErkJggg=="}]]; var g_oChartPresets={};g_oChartPresets[Asc.c_oAscChartTypeSettings.areaNormal]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true, 1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,2,0,0,0,0,0,0,0,0],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,12,1,["lumMod",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[18,true,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,true,false,[3,null,[3,12,1,["lumMod",85E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,12,1,["lumMod",75E3]]],null,[1,null],[0,2,2],[0,2,2],0,0,1,9575]],0,0,3,2,false,null,0],[[9, false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],10,[1,null],0,0,0,0,1,9525]],0,3,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[0,true],0,0,2,[0,[3,0,1,["lumMod",75E3]]],[1E5,[3,0,0]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null, null,null,2,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1, 9525]],0,3,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,22,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,2,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3], ["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,3,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[3,216.75,[3,0,0]],[[2,null], null,[0,null],0,0,null,null,null,null]],0,null,null,null,2,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3, null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,null,null,null,2,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16, 2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7, 1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint", 94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,2,0,0,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]], false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]], 0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,2,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],2,[0, [3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null, false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,2,0,0,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2, ["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,true],[[3,188.7,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[10,true,false,[3,null,[3, 0,1,["lumMod",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],null,null,null,2,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1, true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null, [0,null],0,0,null,null,null,null]],0,null,null,null,2,0,0,0,0,0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.areaStacked]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3], ["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,1,0,0,0,0,0,0,0,0],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,12,1,["lumMod",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,true,false,[3,null,[3,12,1,["lumMod",85E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,12,1,["lumMod",75E3]]],null,[1,null],[0,2,2],[0, 2,2],0,0,1,9575]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],10,[1,null],0,0,0,0,1,9525]],0,3,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[0,true],0,0,2,[0,[3,0,1,["lumMod",75E3]]],[1E5,[3,0,0]]],[[2,null], null,[0,null],0,0,null,null,null,null]],0,null,null,null,1,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3], ["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,3,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,22,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,1,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,3,2,false,1,0],[0,0,null,null,false,false,null,false,false, false,false],[[3,216.75,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,1,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff", 5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,null,null,null,1,0,0,0,0,0,0, 0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false, false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3, ["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,1,0,0,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false, [3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff", 85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,1,0,0, 0,0,0,0,0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false, 1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,1,0,0,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null, null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null, true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,true],[[3,188.7,[3,0,0]],[[2,null],null,[0,null],0,0,null,null, null,null]],[[10,true,false,[3,null,[3,0,1,["lumMod",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],null,null,null,1,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,3,2,false,null,0],[[9, false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod", 12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,1,0,0,0,0,0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.areaStackedPer]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9, false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]], null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,0,0,0,0,0,0,0,0,0],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,12,1,["lumMod",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null, [null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,true,false,[3,null,[3,12,1,["lumMod",85E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,12, 1,["lumMod",75E3]]],null,[1,null],[0,2,2],[0,2,2],0,0,1,9575]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],10,[1,null],0,0,0,0,1,9525]],0,3,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[0,true],0,0,2,[0,[3,0, 1,["lumMod",75E3]]],[1E5,[3,0,0]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,0,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff", 35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,3,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,22,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,0,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null, null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]], true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,3,2,false,1,0],[0,0,null, null,false,false,null,false,false,false,false],[[3,216.75,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,0,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null, [3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null, true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]], 0,null,null,null,0,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null, [54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,0,0,0,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null, [3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null, null]],0,null,null,null,0,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null], 0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,0,0,0,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null, null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]], false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,true],[[3,188.7,[3,0,0]],[[2,null],null, [0,null],0,0,null,null,null,null]],[[10,true,false,[3,null,[3,0,1,["lumMod",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],null,null,null,0,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false, [3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]], 0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0, 3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,0,0,0,0,0,0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.barNormal]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true, 0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3], ["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,219,-27,null,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null, null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1, 1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,7,null,false,false,null,false,false,false,true],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[8,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-54E5,1,0,true,0,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],7,null,false, false,false,false,false,false,true],444,-90,null,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,null,null, false,false,null,false,false,false,false],[[5,null,24,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,164,-22,null,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3], ["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2, false],[0,0,[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,true],[0,0,5,null,false,false,null,false,false,false,true],[[3,216.75,[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,0,0,1,9525]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],5,null,false,false,false,false,false,false,true],65,null,null, 0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0, 2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,100,-24,null,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null, null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]], 0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade", 78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,100,-24,null,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,267,-43,null,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0, null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true, -6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3, ["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,100,-24,null,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]], [[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null, [1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],[1E5,[3,15,2,["lumMod",5E3],["lumOff",95E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],4,[0,[3,0,0]],[51E3,[3,0,1,["alpha",75E3]]],[75E3,[3,0,2,["lumMod",6E4],["lumOff",4E4]]],[1E5,[3,0,3,["lumMod",2E4],["lumOff",8E4],["alpha",15E3]]]],[[2,null], null,[0,null],0,0,null,null,null,null]],0,355,-70,null,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false,false, false],[[2,null],[[3,null,[3,0,0]],null,[3,8E5],0,0,0,0,1,25400]],0,164,-35,null,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null, true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,199,null,null,0],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null, null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,true,false,[3,null,[3,12,1,["lumMod",85E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0, null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0, 0,null,null,false,false,null,false,false,false,false],[[2,null],[[3,null,[3,0,0]],null,[3,8E5],0,0,0,0,1,9525]],0,315,-40,null,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,15875]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,178.5,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,80,25,null,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]], null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade", 1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,100,-24,null,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.barStacked]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true, 0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3], ["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null, null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1, 1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9,false,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false, true],79,100,null,2],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null], 0,0,null,null,null,null]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,24,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3], ["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[0,0,[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[[3,216.75,[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,0,0,1,9525]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3, null,false,false,false,false,false,false,true],150,100,null,2],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod", 15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,100,null,2],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null], 0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod", 15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]], [1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3], ["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]], 0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff", 35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false], 0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3, null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],[0,2,2],[0,2,2],0,0, 1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],[1E5,[3,15,2,["lumMod",15E3],["lumOff",85E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,178.5,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,50,100,null,2],[2,[[3, null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0, [[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false, false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade", 78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2]];g_oChartPresets[Asc.c_oAscChartTypeSettings.barStackedPer]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]], null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9,false,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],79,100,null,1],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod", 15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0, [[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,null]],0,2,2,false],[0,0,null,null,false,false, null,false,false,false,false],[[5,null,24,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff", 25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[0, 0,[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[[3,216.75,[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,0,0,1,9525]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],150,100,null,1],[2,[[3, null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false], [0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,100,null,1],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null, null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0, 2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]], [[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3], ["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2, null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod", 85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint", 94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true, 0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],[0,2,2],[0,2,2],0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],[1E5,[3,15,2,["lumMod",15E3],["lumOff",85E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,178.5,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,50,100,null,1],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]], null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null, [3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0, 0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false, false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true, -6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150, 100,null,1]];g_oChartPresets[Asc.c_oAscChartTypeSettings.barNormal3d]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff", 85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null], 0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,20,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,null]],0,160,null,0,0, [100,null,null,false,10,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,null,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3], ["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,216.75,[3,0,0]],[[3,null,[3,0,1,["lumMod",75E3]]],null,[1,null],0,0,0,0,1,9525]],0,65,null,null,0,[60,null,100,false, 0,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,null,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff", 5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]], null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null, [1,null],0,0,0,0,1,9525]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true, false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100,null,null,true, 15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,1,["tint",75E3]]],null,[1,null],0,0,0,0,1,6350]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,false,false,[3,null,[3,12,0]],true,[1,true,0,1,null,true, 1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,0,0,3,2,true],[0,0,null,null,false,false,null,false,false,false,true],[[3,224.4,[3,0,0]],[[3,null,[3,0,1,["lumMod",5E4]]], null,[0,null],0,0,null,null,null,null]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[3,76.5,[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],84,null,53,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,68.85,[3,7,1,["lumMod",75E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3, null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false, null,false,false,false,false],[[3,76.5,[3,0,0]],[[3,null,[3,0,1,["lumMod",75E3]]],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,68.85,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null, null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7, 1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,0,2,[5E4,[3,0,0]],[1E5,[3,0,1,["alpha",0]]]],[[2,null],null,[0,null], 0,0,null,null,null,null]],0,150,null,0,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9, false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]], [[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0, 0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100, null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]]];g_oChartPresets[Asc.c_oAscChartTypeSettings.barStacked3d]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], [14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9, false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff", 35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,null]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,20,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null], 0,0,0,0,1,19050]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null, true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,null,null,false,false,null,false,false,false,true], [[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[8,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],79,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]], [[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0, 0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false, false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0, null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0, [3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod", 65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0, null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null, [54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null, [3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff", 95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]]];g_oChartPresets[Asc.c_oAscChartTypeSettings.barStackedPer3d]=[[2,[[3,null,[3,6,0]],[[3, null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0, 0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false, false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod", 25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,null]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,20,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null, null,null]],0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null, [1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,null,null,false,false,null,false,false,false,true],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[8,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],79,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1, 1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,null, null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true, 0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]], null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,1,[100,null,null,true,15,20], [[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true, 0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true, -6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]]];g_oChartPresets[Asc.c_oAscChartTypeSettings.barNormal3dPerspective]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true, 0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7, 1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,3,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0, null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null, 20,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,null]],0,160,null,0,3,[100,null,null,false,10,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,null,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0, 0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false, [3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,216.75,[3,0,0]],[[3,null, [3,0,1,["lumMod",75E3]]],null,[1,null],0,0,0,0,1,9525]],0,65,null,null,3,[60,null,100,false,0,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,null,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5, [3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,null,null,3,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null, null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]], 0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade", 78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,3,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,1,["tint",75E3]]],null,[1,null],0,0,0,0,1,6350]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],[18,false,false,[3,null,[3,12,0]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,0,0,3,2,true],[0,0,null,null, false,false,null,false,false,false,true],[[3,224.4,[3,0,0]],[[3,null,[3,0,1,["lumMod",5E4]]],null,[0,null],0,0,null,null,null,null]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[3,76.5,[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],84,null,53,3,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,68.85,[3,7,1,["lumMod",75E3]]],[[2,null],null,[0,null],0,0,null, null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true, 1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3], ["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,76.5,[3,0,0]],[[3,null,[3,0,1,["lumMod",75E3]]],null,[0,null],0,0,null,null,null,null]],0,150,null,null,3,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,68.85,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod", 15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],[0,2,2],[0,2,2],0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false, false,null,false,false,false,false],[[4,null,[54E5,false],0,0,2,[5E4,[3,0,0]],[1E5,[3,0,1,["alpha",0]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,0,3,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]], [[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod", 85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]], [5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,3,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0, 0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2, false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,3,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0]]];g_oChartPresets[Asc.c_oAscChartTypeSettings.lineNormal]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null, [1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3, 15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0, [[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,28575]],0,null,null,null,2,0,0,0,0,0,[null,0,4]],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3, null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[0,0,[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3], ["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,31750]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],null,null,null,2,0,0,0,0,[null,0,null],[17,[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null, null,null,null]],0]],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 4],[[4,null,[54E5,false],0,0,2,[0,[3,12,0]],[1E5,[3,12,1,["lumMod",95E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2, 2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,0,1,1,22225]],0,null,null,null,2,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true, 0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]], null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,31750]],0,null,null,null,2,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1, true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,137.7, [3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,130.05,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,137.7,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0, 0]],null,[1,null],0,0,null,1,null,22225]],0,null,null,null,2,0,0,0,0,0,[null,0,4]],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]], null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1, ["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,34925]],0,null,null,null,2,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14.5,false,false,[4,null,[54E5,false],0,0,2,[0,[3,8, 2,["lumMod",5E4],["lumOff",5E4]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[10,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null, [1,null],0,0,0,0,1,9525]],0,0,2,2,false],[0,0,0,0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[0,[[3,null,[3,0,2,["shade",95E3],["satMod",105E3]]],null,[1,null],0,0,0,1,1,19050]],[[9,true,false,[3,null,[3,0,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],null,null,null,2,0,0,0,0,[null,0,null],[17,[[3,null,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3, 6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3, null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,38100]],0,null,null,null,2,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], [14,true,false,[3,null,[3,12,1,["lumMod",85E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff", 35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[0,null], 0,0,null,1,null,22225]],0,null,null,null,2,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true, 1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,22225]],0,null,null,null,2,0,0,0,0,[null,0,null],[6,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[1,null],0,0,null,null,null,9525]],2]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null, null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,28575]],0,null,null,null,2, 0,0,0,0,[null,0,null],[5,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,9525]],0]]];g_oChartPresets[Asc.c_oAscChartTypeSettings.lineStacked]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false, false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null, [1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,28575]],0,null,null,null,1,0,0,0,0,0,[null,0,4],0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null], 0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false, [3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false,null,0],[0,0,[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,true,0,0],[0,0,3,null,false,false,null,false,false,false,true],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,31750]],[[9, true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],null,null,null,1,0,0,0,0,[null,0,null],[17,[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],[14,false,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[4,null,[54E5,false],0,0,2,[0,[3,12,0]],[1E5,[3,12,1,["lumMod",95E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,0,1,1,22225]],0,null,null,null,1,0,0,0,0,0,[null,0,4],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3], ["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,31750]],0,null,null,null,1,0,0,0,0,0,[null,0,4], 0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20, [3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,137.7,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,130.05,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false,null,0],[[9,false,false,[3, null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,137.7,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,22225]],0,null,null,null,1,0,0,0,0,0,[null,0,4],0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff", 15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3, 12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false,null,0],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,34925]], 0,null,null,null,1,0,0,0,0,0,[null,0,4],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14.5,false,false,[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]], null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[10,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false,null,0],[0,0,0,0,2,2,true,0,0],[0,0,3,null,false,false,null,false,false,false,true],[0,[[3,null,[3,0,2,["shade",95E3],["satMod",105E3]]], null,[1,null],0,0,0,1,1,19050]],[[9,true,false,[3,null,[3,0,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],null,null,null,1,0,0,0,0,[null,0,null],[17,[[3,null,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15, 2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null, [3,0,0]],null,[1,null],0,0,null,1,null,38100]],0,null,null,null,1,0,0,0,0,0,[null,0,4],0,0],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,true,false,[3,null,[3,12,1,["lumMod",85E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,0,1, null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,null,0],[[9,false,false,[3,null,[3,12,1,["lumMod", 75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[0,null],0,0,null,1,null,22225]],0,null,null,null,1,0,0,0,0,0,[null,0,4],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]], null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null, [3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false,0,0],[0,0,null,null, false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,22225]],0,null,null,null,1,0,0,0,0,[null,0,null],[6,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[1,null],0,0,null,null,null,9525]],2],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3], ["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false,null,0],[[9,false, false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,28575]],0,null,null,null,1,0,0,0,0,[null,0,null],[5,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,9525]],0],0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.lineStackedPer]= [[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1, 9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,28575]],0,null,null,null,0,0,0,0,0,0,[null,0,4]],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod", 75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0, 0,2,2,false],[0,0,[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,31750]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],null,null,null,0, 0,0,0,0,[null,0,null],[17,[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true, 0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[4,null,[54E5,false],0,0,2,[0,[3,12,0]],[1E5,[3,12,1,["lumMod",95E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null, true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,0,1,1,22225]],0,null,null,null,0,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null, [1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,31750]],0,null,null,null,0,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3, 8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,137.7,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,130.05,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,137.7,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2, 2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,22225]],0,null,null,null,0,0,0,0,0,0,[null,0,4]],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]], null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,34925]],0,null,null,null,0,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],[14.5,false,false,[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[10,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1, null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[0,0,0,0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[0,[[3,null,[3,0,2,["shade",95E3],["satMod",105E3]]],null,[1,null],0,0,0,1,1,19050]],[[9,true,false,[3,null,[3,0,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],null,null,null,0,0,0,0,0,[null,0,null],[17,[[3,null, [3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3, 15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,38100]],0,null,null,null,0,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null, null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,true,false,[3,null,[3,12,1,["lumMod",85E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null, false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[0,null],0,0,null,1,null,22225]],0,null,null,null,0,0,0,0,0,0,[null,0,4]],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2, ["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3, null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,22225]],0,null,null,null,0,0,0,0,0,[null,0,null],[6,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[1,null],0,0,null,null,null,9525]],2]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]], null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null, [3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false], [0,[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,28575]],0,null,null,null,0,0,0,0,0,[null,0,null],[5,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,9525]],0]]];g_oChartPresets[Asc.c_oAscChartTypeSettings.line3d]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false],[[9,false,false, [3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,2,[null,null,null,false,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[null,0,null],[null,0,4]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod", 5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[2,null],null,[1,null],0,0,0,0,1,25400]],0,null,null,null,2,[null,null,null,false,15,20], [[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[null,0,null],[null,0,4]],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], [16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false],[[9,false,false,[3,null, [3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0, null],0,0,null,null,null,25400]],0,null,null,null,2,[null,null,null,false,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[null,0,null],[null,0,4]]];g_oChartPresets[Asc.c_oAscChartTypeSettings.hBarNormal]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null, null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true, 1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,182, null,null,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false, false,false],[[5,null,25,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,227,-48,null,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]], null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false, [3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,5,null,false,false,null,false,false,false,true],[[3,216.75,[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,0,0,1,9525]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null, true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],5,null,false,false,false,false,false,false,true],65,null,null,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3, 15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,100,null, null,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0, 3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,100,null,null,0,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3, null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff", 85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,3,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null, null,null,null]],0,247,null,null,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]], [[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null], 0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,115,-20,null,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null, [null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true, -6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],[0,2,2],[0,2,2],0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],[99E3,[3,15,2,["lumMod",25E3],["lumOff",75E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false, null,false,false,false,false],[[4,null,[108E5,true],0,[],4,[0,[3,0,0]],[51E3,[3,0,1,["alpha",75E3]]],[75E3,[3,0,2,["lumMod",6E4],["lumOff",4E4]]],[1E5,[3,0,3,["lumMod",2E4],["lumOff",8E4],["alpha",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,326,-58,null,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[18,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,3,2, false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,9525]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[2,null],[[3,null,[3,0,0]],null,[3,8E5],0,0,0,0,1,25400]],0,227,-48,null,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null, null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true, -6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null, false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,269,null,null,0,0,0,0,0,0,0],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,true,false,[3,null,[3,12,1,["lumMod",85E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod", 75E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[108E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null, [3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[108E5,false],0,0,2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",75E3],["lumOff",25E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[2,null],[[3,null,[3,0,0]],null,[3,8E5],0,0,0,0,1,9525]],0,182,-50,null,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]], null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null, [3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false], [[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,115,-20,null,0,0,0,0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.hBarStacked]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null, null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100, null,2,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9, false,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],79,100,null,2,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true, 0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3], ["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,null]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,24,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2,0,0,0,0,0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3, null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[0,0,[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[[3,216.75, [3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,0,0,1,9525]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],150,100,null,2,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false, false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]], 0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod", 105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,100,null,2,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0, 0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null, null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod", 65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1, null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2,0,0,0,0,0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null, [3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null, [1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null, 2,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],[0,2,2],[0,2,2],0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,15,2,["lumMod",5E3], ["lumOff",95E3]]],[1E5,[3,15,2,["lumMod",15E3],["lumOff",85E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,178.5,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,50,100,null,2,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false, false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1, 9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null, 2,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null], 0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,2,0,0,0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.hBarStackedPer]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff", 85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false, [3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false, false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null, [1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,3,null,false,false,null,false,false, false,true],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9,false,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],79,100,null,1,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null], 0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,null]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,24,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1,0,0,0,0,0,0],[2, [[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod", 95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[0,0,[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]], 0,2,2,true],[0,0,3,null,false,false,null,false,false,false,true],[[3,216.75,[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,0,0,1,9525]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,false,false,false,false,true],150,100,null,1,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null, null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3, null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4, [3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,100,null,1,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true, 1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], [0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1,0,0,0,0,0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff", 85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0, null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0, 0,0,0,1,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1,0,0,0,0,0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]], 0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade", 78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null, true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],[0,2,2],[0,2,2],0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],[1E5,[3,15,2,["lumMod",15E3],["lumOff",85E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,178.5,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,50,100,null,1,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null, null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null], [[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null, [3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null, true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,100,null,1,0,0,0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.hBarNormal3d]= [[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null, false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null, null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,20,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,null]],0,160,null,0,0,[100,null,null,false,10,0],[[[2,null],[[2,null],null,[0,null],0, 0,null,null,null,null]],0],[[[3,null,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3], ["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2, false],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,216.75,[3,0,0]],[[3,null,[3,0,1,["lumMod",75E3]]],null,[1,null],0,0,0,0,1,9525]],0,65,null,null,0,[60,null,100,false,0,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],0],[[[3,null,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false, false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,null,null,0,[100, null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null, true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,1,["tint",75E3]]],null,[1,null],0,0,0,0,1,6350]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,false,false,[3,null,[3,12,0]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12, 1,["lumMod",75E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[0,0,0,0,3,2,true],[0,0,null,null,false,false,null,false,false,false,true],[[3,224.4,[3,0,0]],[[3,null,[3,0,1,["lumMod",5E4]]],null,[0,null],0,0,null,null,null,null]], [[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[3,76.5,[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],84,null,53,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,68.85,[3,7,1,["lumMod",75E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod", 15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,76.5,[3, 0,0]],[[3,null,[3,0,1,["lumMod",75E3]]],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[3,68.85,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]], [[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[108E5,true],0,[],2,[5E4,[3,0,0]],[1E5,[3,0,1,["alpha",0]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null, 0,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod", 85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null, null,null]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3, null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3, null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,0,[100,null,null,true,15,20],[[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.hBarStacked3d]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3, 15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15, 2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0, 0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0, 1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,null]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,20,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0],[[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,null,null,false,false,null,false,false,false,true],[[3,null,[3,0,0]],[[2, null],null,[0,null],0,0,null,null,null,null]],[[8,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],79,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2, ["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4, null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false, false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod", 103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3], ["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5, false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3, 6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff", 95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,2,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.hBarStackedPer3d]=[[2,[[3,null,[3,6,0]], [[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false, false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15, 2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,null]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[5,null,20,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,0,0]],null,[0,null],0, 0,null,null,null,null]],0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff", 85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,0,0,2,2,true],[0,0,null,null,false,false,null,false,false,false,true],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[8,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,false,false,false,false,true],79,null,null,1,[100,null,null,true,15,20],[[[2, null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0, 1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null, true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]], 0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]], null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,2,2,false],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1, ["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1, 1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,1,[100,null, null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff", 35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff", 35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false],[0,0,null,null,false,false,null,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,150,null,null,1,[100,null,null,true,15,20],[[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.stock]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null, [1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null,[3,15,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,9525]],[[[3,null,[3,8,2,["lumMod",75E3],["lumOff", 25E3]]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,0,1,9525]],150,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,0,1,9525]]]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true, 0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,19050]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod", 65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,null]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,0,1,15875]],[[[3,null,[3,8,2,["lumMod",65E3], ["lumOff",35E3]]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,0,1,9525]],150,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[0,null],0,0,null,null,null,9525]]]],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], [18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]], null,[1,null],0,0,0,0,1,19050]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[4,null,[54E5,false],0,0,2,[0,[3,12,2,["lumMod",75E3],["alpha",36E3]]],[1E5,[3,8,3,["lumMod",95E3],["lumOff",5E3],["alpha",42E3]]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]], 0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,0,1,15875]],[[[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,0,1,9525]],150,[[3,null,[3,12,0]],[[3,null,[3,12,1,["lumMod",85E3]]],null,[1,null],0,0,0,0,1,9525]]]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null, null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2, null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null, 0,0,0,0,0,[null,0,4],[0,[[3,null,[3,15,2,["lumMod",75E3],["lumOff",25E3]]],null,[0,null],0,0,null,null,null,9525]],[[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,15,2,["lumMod",75E3],["lumOff",25E3]]],null,[0,null],0,0,null,null,null,9525]],150,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[0,null],0,0,null,null,null,9525]]]],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null, null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0, 0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[0,null],0,0,null,null, null,9525]],[[[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[0,null],0,0,null,null,null,9525]],150,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,9525]]]],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16, true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod", 15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null, [3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,null],0,0,0,0,1,12700]],[[[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[0,null],0,0,null,null,null,9525]],150,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[0,null],0,0,null,null,null,9525]]]],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null, null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null], [[3,137.7,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null,[3,12,0]],null,[1, null],0,0,0,0,1,9525]],[[[4,null,0,[],0,2,[0,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],[1E5,[3,8,2,["lumMod",95E3],["lumOff",5E3]]]],[[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[0,null],0,0,null,null,null,9525]],150,[[4,null,0,[],0,2,[0,[3,12,0]],[1E5,[3,12,1,["lumMod",85E3]]]],[[3,null,[3,12,0]],null,[1,null],0,0,0,0,1,9525]]]],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null, null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3, null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9575]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0, 0,[null,0,4],[0,[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,2,1,25400]],[[[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[0,null],0,0,null,null,null,9525]],150,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,9525]]]],[2,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[15,true,false,[3,null,[3,12,0]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[8,false,false,[3,null,[3,12,0]],true,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,12,0]],null,[1, true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null,[3,12,0]],null,[1,null],0,0,0,0,1,15875]],[[[5,null,20,[3,12,0],[3,0,0]],[[3,127.5,[3,12,0]],null,[1,null],0,0,0,0,1,9525]],150,[[5,null,20,[3,0,0],[3,12,0]],[[3,127.5,[3,12,1,["lumMod",85E3]]],null,[1,null],0,0,0,0,1,9525]]]],[2,[[3, null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",35E3],["lumOff",65E3]]],null,[1,null],0,0,0,0,1,9525]],0,0,3,2,false,null,0],[[9,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]], [0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,0,1,25400]],[[[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[0,null],0,0,null,null,null,28575]],150,[[3,null,[3,12,0]], [[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[0,null],0,0,null,null,null,28575]]]],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1, null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,12700]],0,0,3,2,false,null,0],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null, null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,0,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[null,0,4],[0,[[3,null,[3,15,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,null],0,0,0,0,1,9525]],[[[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[0,null],0,0,null,null,null,9525]],150, [[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[0,null],0,0,null,null,null,9525]]]]];g_oChartPresets[Asc.c_oAscChartTypeSettings.pie]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false, false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[3,null,[3,0,0]],[[3,null,[3,12,0]],null,[0,null],0,0,null,null,null,19050]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null, null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false], [[5,null,22,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,12,0]],null,[0,null],0,0,null,null,null,19050]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff", 25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],3],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,3,null,false,false,true,false,true,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[10,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[5,null,36,[3,8,2, ["lumMod",75E3],["lumOff",25E3]],[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,true,false,true,false,false],null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]], false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod", 109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[5,null,8,[3,12,0],[3,8,2, ["lumMod",1E4],["lumOff",9E4]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[3,127.5,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]], 3],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,0,2,[0,[3,0,0]],[1E5,[3,0,2,["lumMod",6E4],["lumOff",4E4]]]],[[3,null,[3,12,0]],null,[0,null],0,0,null,null,null,19050]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null, null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3], ["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,true,false,[3,null,[3,15, 2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,5,null,false,false,true,false,true,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],5,null,false,false,true,false,true,false,false],null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],0,0,0,[0,0,7,null,false,true,true,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[10,true,false,[3,null,[3,0,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],7,null,false,true,null,false,false,false,false],null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],[15,true,false,[3,null,[3,12,0]],true,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,5,null,false,true,true,false,true,false,false],[[3,null,[3,12,0]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,19050]],[[9,true,false,[3,null,[3,0,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],5,null,false,true,true,false,true,false,false],null,null,null,null,0,0,0, 0,0,0,0,0],[2,[[5,null,8,[3,12,1,["lumMod",95E3]],[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[3,198.9,[3,12,0]],[[2,null],null,[0,null], 0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,5,null,false,false,true,false,true,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],5,null,false,false,true,false,true,false,false],null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null, [1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false, true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,null,0,0,0,0,0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.doughnut]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null, 0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[3,null, [3,0,0]],[[3,null,[3,12,0]],null,[0,null],0,0,null,null,null,19050]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null, [1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[5,null,22,[3,0,0],[3,0,2,["lumMod",2E4],["lumOff",8E4]]],[[3,null,[3,12,0]],null,[0,null],0,0,null,null,null,19050]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8,2,["lumMod",25E3],["lumOff",75E3]]], null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],3],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 0,0,0,[0,0,null,null,false,false,true,false,true,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[10,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[5,null,36,[3,8,2,["lumMod",75E3],["lumOff",25E3]],[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,true,false,true,false,false],null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null, [1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false, true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null, null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod", 11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[5,null,8,[3,12,0],[3,8,2,["lumMod",1E4],["lumOff",9E4]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4], ["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[3,127.5,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],3],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,0,2,[0,[3,0,0]],[1E5,[3,0,2,["lumMod",6E4],["lumOff",4E4]]]],[[3,null,[3,12,0]],null,[0,null],0,0,null,null,null,19050]],0,null,null, null,null,0,0,0,0,0,0,0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null], null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15, 2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],2],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],0,0,0,[0,0,null,null,false,false,true,false,true,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,true,false,true,false,false],null,null,null,null,0,0,0,0,0,0,0,0],[2,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],[15,true,false,[3,null,[3,12,0]],true,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,true,true,false,true,false,false],[[3,null,[3,12,0]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,19050]],[[9,true,false,[3,null,[3,0,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,true,true,false,true,false,false],null,null, null,null,0,0,0,0,0,0,0,0],[2,[[5,null,8,[3,12,1,["lumMod",95E3]],[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[3,198.9,[3,12,0]],[[2, null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,true,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],null,null,false,false,true,false,true,false,false],null,null,null,null,0,0,0,0,0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.pie3d]= [[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[3,null,[3,0,0]],[[3,null,[3,12,0]],null,[0,null],0,0,null,null,null,25400]],0,null,null,null,null,[100,null,null,true,30,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff", 85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,5,null,false,true,true,false,false,false,false],[[3,229.5,[3,0,0]],[[3,null,[3,0,1,["lumMod",75E3]]],null,[0,null],0,0,null,null,null,19050]],[[10,false,false,[3,null, [3,0,0]],null,[1,true,0,1,0,true,0,1]],[[3,229.5,[3,12,0]],[[3,null,[3,0,0]],null,[1,null],0,0,0,0,1,12700]],5,null,false,true,null,false,false,false,false],null,null,null,null,[100,null,null,true,50,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0],[2,[[4,null,0,[],[],3,[0,[3,12,0]],[39E3,[3,12,0]],[1E5,[3,12,1,["lumMod",75E3]]]],[[3,null,[3,8, 2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",75E3],["lumOff",25E3]]],null,[1,true,0,1,null,true,1,1]],[[3,99.45,[3,12,1,["lumMod",95E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],3],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],0,0,0,[0,0,3,null,false,false,true,false,true,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[10,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[5,null,36,[3,8,2,["lumMod",75E3],["lumOff",25E3]],[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[[2,null],null,[0,null],0,0,null,null,null,null]],3,null,false,false,true,false,true,false,false],null,null,null,null,[100,null,null,true,50,0],[[[2,null],[[2,null],null,[0,null], 0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],[[9,false, false,[3,null,[3,15,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint",81E3]]]],[[2,null],null, [0,null],0,0,null,null,null,null]],0,null,null,null,null,[100,null,null,true,30,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod", 99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,null,[100,null,null,true,30,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0],[2,[[5,null,8,[3,12,0],[3,8,2,["lumMod",1E4],["lumOff",9E4]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null, [null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[3,127.5,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],3],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null, [54E5,false],0,0,2,[0,[3,0,0]],[1E5,[3,0,2,["lumMod",6E4],["lumOff",4E4]]]],[[3,null,[3,12,0]],null,[0,null],0,0,null,null,null,50800]],0,null,null,null,null,[100,null,null,true,30,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2, null],null,[0,null],0,0,null,null,null,null]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,12,1,["lumMod",85E3]]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false, false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,null,[100,null,null,true,30,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null, null,null]],0],0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,7,null,false,true,true,false,false,false,false],[[3,null,[3,0,0]],[[2,null],null, [0,null],0,0,null,null,null,null]],[[10,true,false,[3,null,[3,0,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],7,null,false,true,null,false,false,false,false],null,null,null,null,[100,null,null,true,30,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0],[2,[[5,null,8,[3,12,1,["lumMod",95E3]],[3,12, 0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[18,true,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[3,198.9,[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],0,0,0,[0,0,5,null,false,false,true,false,true,false,false],[[3,null,[3,0,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],[[9,true,false,[3,null,[3,12,0]],null,[1,true,0,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],5,null,false,false,true,false,true,false,false],null,null,null,null,[100,null,null,true,50,0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]], 0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]], [[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],4],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,0,[0,0,null,null,false,false,true,false,false,false,false],[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,null,null,null,null,[100,100,null,true,30,0],[[[2,null], [[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],[[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0,0,0]];g_oChartPresets[Asc.c_oAscChartTypeSettings.scatter]=[[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3, 15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null], null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[5,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[0,null],0,0,null,null,null,9525]],0],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],true,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2, null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[6,[[3,null,[3,0, 0]],[[3,null,[3,0,0]],null,[1,null],0,0,null,null,null,9525]],2],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,16,0]],null,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,16,0]],null,[1,true,-6E7,1,null,true,1,1]], [[2,null],[[3,null,[3,16,2,["lumMod",4E4],["lumOff",6E4]]],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,16,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[5,[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0, 3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[3,null,[3,0,0]],null,[1,null],0,0,null,null,null,9525]],0],0,0],[2,[[3,null,[3,6,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[20,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],0,0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null,[3,15,2,["lumMod",5E3],["lumOff",95E3]]],null,[1,null],0,0,0,0,1,9525]],2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,0,0,0,25400]],0,null,null,null,null,0,0,0,0,0,[6,[[2,null], [[3,178.5,[3,0,1,["lumMod",75E3]]],null,[1,null],0,0,0,0,0,34925]],0],0,0],[2,[[4,null,0,[],[],2,[43E3,[3,12,0]],[1E5,[3,12,1,["lumMod",95E3]]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,false,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null, null]],0,0,[[9,false,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[0,null],0,0,null,null,null,25400]],0,null,null,null,null,0,0,0,0,0,[4,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[1,null],0,0,0,0,1,9525]],0],0,0],[2,[[3,null, [3,8,2,["lumMod",75E3],["lumOff",25E3]]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,true,false,[3,null,[3,12,1,["lumMod",85E3]]],false,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null, [3,12,1,["lumMod",5E4]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,191.25,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[0,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[3,[[3,null,[3,0,2,["lumMod",6E4],["lumOff",4E4]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0, 1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[14,false,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],0,[[4,null,[54E5,false],0,0,2,[0,[3,12,1,["alpha",0]]],[1E5,[3,12,1,["lumMod",95E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,8,2,["lumMod", 25E3],["lumOff",75E3]]],null,[1,null],0,0,null,1,null,9525]],[0,[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],10,[1,null],0,0,0,0,1,25400]],0,null,null,null,null,0,0,0,0,0,[5,[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["lumMod",11E4],["satMod",105E3],["tint",67E3]]],[5E4,[3,0,3,["lumMod",105E3],["satMod",103E3],["tint",73E3]]],[1E5,[3,0,3,["lumMod",105E3],["satMod",109E3],["tint", 81E3]]]],[[3,null,[3,0,1,["shade",95E3]]],null,[1,null],0,0,0,0,1,9525]],0],0,0],[2,[[3,null,[3,0,0]],[[3,null,[3,0,0]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[15,true,false,[3,null,[3,12,0]],true,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,12,0]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[2,null],null, [0,null],0,0,null,null,null,null]],[0,[[3,63.75,[3,12,0]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[6,[[3,null,[3,0,0]],[[3,null,[3,12,0]],null,[1,null],0,0,null,null,null,22225]],0],0,0],[2,[[4,null,0,[],[],2,[0,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],[1E5,[3,8,2,["lumMod",85E3],["lumOff",15E3]]]],[[2,null],null,[0,null],0,0,null,null,null,null]],[null, null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,12,1,["lumMod",95E3]]],null,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,12,1,["lumMod",75E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,12,1,["lumMod",5E4]]],null,[0,null],0,0,0,0,1,9525]],[0,[[3,25.5,[3,12,1,["lumMod",95E3]]],null,[1,null],0,0,0,0,1,9525]],0,2, 2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[6,[[4,null,[54E5,false],0,[],3,[0,[3,0,3,["satMod",103E3],["lumMod",102E3],["tint",94E3]]],[5E4,[3,0,3,["satMod",11E4],["lumMod",1E5],["shade",1E5]]],[1E5,[3,0,3,["lumMod",99E3],["satMod",12E4],["shade",78E3]]]],[[3,null,[3,0,0]],null,[1,null],0,0,null,1,null,9525]],0],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]], null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null,null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],false,[1,true,0,1,null,true,1,1]],0,[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,15,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,null,[3,15,2,["lumMod",25E3],["lumOff",75E3]]],null,[0,null],0, 0,null,null,null,null]],[0,[[3,null,[3,15,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[6,[[3,null,[3,12,0]],[[3,153,[3,0,0]],null,[0,null],0,0,null,null,null,38100]],0],0,0],[2,[[3,null,[3,12,0]],[[3,null,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[null,null,null,0,null,[null,null,null,null, null,null,null,null]],[[2,null],[[2,null],null,[0,null],0,0,null,null,null,null]],[16,true,false,[3,null,[3,8,2,["lumMod",5E4],["lumOff",5E4]]],false,[1,true,0,1,null,true,1,1]],0,[[5,null,20,[3,8,2,["lumMod",15E3],["lumOff",85E3]],[3,12,0]],[[2,null],null,[0,null],0,0,null,null,null,null]],0,0,[[9,false,false,[3,null,[3,8,2,["lumMod",65E3],["lumOff",35E3]]],null,[1,true,-6E7,1,null,true,1,1]],[[2,null],[[3,137.7,[3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],[0,[[3,null, [3,8,2,["lumMod",15E3],["lumOff",85E3]]],null,[1,null],0,0,0,0,1,9525]],0,2,2,false,1,0],[0,0,null,null,false,false,null,false,false,false,false],[0,[[2,null],null,[1,null],0,0,null,1,null,25400]],0,null,null,null,null,0,0,0,0,0,[6,[[3,null,[3,12,0]],[[3,null,[3,0,0]],null,[1,null],0,0,null,null,null,15875]],2],0,0]];window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_oAutoShapesGroups=g_oAutoShapesGroups;window["AscCommon"].g_oAutoShapesTypes=g_oAutoShapesTypes;window["AscCommon"].g_oStandartColors= g_oStandartColors;window["AscCommon"].GetDefaultColorModsIndex=GetDefaultColorModsIndex;window["AscCommon"].GetDefaultMods=GetDefaultMods;window["AscCommon"].g_oUserColorScheme=g_oUserColorScheme;window["AscCommon"].g_oUserTexturePresets=g_oUserTexturePresets;window["AscCommon"].g_sWordPlaceholderImage=g_sWordPlaceholderImage;window["AscCommon"].g_oPresetTxWarpGroups=g_oPresetTxWarpGroups;window["AscCommon"].g_PresetTxWarpTypes=g_PresetTxWarpTypes;window["AscCommon"].g_oChartPresets=g_oChartPresets})(window); "use strict";(function(window,undefined){var prot;var g_memory=AscFonts.g_memory;var DecodeBase64Char=AscFonts.DecodeBase64Char;var b64_decode=AscFonts.b64_decode;var g_nodeAttributeEnd=AscCommon.g_nodeAttributeEnd;var c_oAscShdClear=Asc.c_oAscShdClear;var c_oAscColor=Asc.c_oAscColor;var c_oAscFill=Asc.c_oAscFill;var c_oVariantTypes={vtEmpty:0,vtNull:1,vtVariant:2,vtVector:3,vtArray:4,vtVStream:5,vtBlob:6,vtOBlob:7,vtI1:8,vtI2:9,vtI4:10,vtI8:11,vtInt:12,vtUi1:13,vtUi2:14,vtUi4:15,vtUi8:16,vtUint:17, vtR4:18,vtR8:19,vtDecimal:20,vtLpstr:21,vtLpwstr:22,vtBstr:23,vtDate:24,vtFiletime:25,vtBool:26,vtCy:27,vtError:28,vtStream:29,vtOStream:30,vtStorage:31,vtOStorage:32,vtClsid:33};var c_dScalePPTXSizes=36E3;function IsHiddenObj(object){if(!object)return false;var _uniProps=object.nvSpPr;if(!_uniProps)_uniProps=object.nvPicPr;if(!_uniProps)_uniProps=object.nvGrpSpPr;if(!_uniProps)return false;if(_uniProps.cNvPr&&_uniProps.cNvPr.isHidden)return true;return false}function CBuilderImages(blip_fill,full_url, image_shape,sp_pr,ln,text_pr,para_text_pr,run,paragraph){this.Url=full_url;this.BlipFill=blip_fill;this.ImageShape=image_shape;this.SpPr=sp_pr;this.Ln=ln;this.TextPr=text_pr;this.ParaTextPr=para_text_pr;this.Run=run;this.Paragraph=paragraph;this.AdditionalUrls=[]}CBuilderImages.prototype={SetUrl:function(url){if(url!=="error"){var oCopyFill,oCopyBlipFill,oCopyLn;if(!this.Ln&&this.SpPr&&this.SpPr.Fill){oCopyFill=this.SpPr.Fill.createDuplicate();if(oCopyFill.fill&&oCopyFill.fill.type===c_oAscFill.FILL_TYPE_BLIP){oCopyFill.fill.setRasterImageId(url); this.SpPr.setFill(oCopyFill)}}if(this.Ln&&this.SpPr&&this.SpPr===this.Ln&&this.Ln.Fill&&this.Ln.Fill.fill&&this.Ln.Fill.fill.type===c_oAscFill.FILL_TYPE_BLIP){oCopyLn=this.Ln.createDuplicate();oCopyLn.Fill.fill.setRasterImageId(url);this.SpPr.setLn(oCopyLn)}if(this.ImageShape&&this.ImageShape.blipFill){oCopyBlipFill=this.ImageShape.blipFill.createDuplicate();oCopyBlipFill.setRasterImageId(url);this.ImageShape.setBlipFill(oCopyBlipFill)}if(this.TextPr&&!this.Ln)if(this.Paragraph){var oPr=this.Paragraph.Pr; if(oPr.DefaultRunPr&&oPr.DefaultRunPr.Unifill&&oPr.DefaultRunPr.Unifill.fill&&oPr.DefaultRunPr.Unifill.fill.type===c_oAscFill.FILL_TYPE_BLIP){var Pr=this.Paragraph.Pr.Copy();Pr.DefaultRunPr.Unifill.fill.setRasterImageId(url);this.Paragraph.Set_Pr(Pr)}}else if(this.ParaTextPr||this.Run){if(this.ParaTextPr&&this.ParaTextPr.Value&&this.ParaTextPr.Value.Unifill&&this.ParaTextPr.Value.Unifill.fill&&this.ParaTextPr.Value.Unifill.fill.type===c_oAscFill.FILL_TYPE_BLIP){oCopyFill=this.ParaTextPr.Value.Unifill.createDuplicate(); oCopyFill.fill.setRasterImageId(url);this.ParaTextPr.Set_Unifill(oCopyFill)}if(this.Run&&this.Run.Pr&&this.Run.Pr.Unifill&&this.Run.Pr.Unifill.fill&&this.Run.Pr.Unifill.fill.type===c_oAscFill.FILL_TYPE_BLIP){oCopyFill=this.Run.Pr.Unifill.createDuplicate();oCopyFill.fill.setRasterImageId(url);this.Run.Set_Unifill(oCopyFill)}}this.BlipFill.RasterImageId=url}}};function BinaryPPTYLoader(){this.stream=null;this.presentation=null;this.DrawingDocument=null;this.TempGroupObject=null;this.TempMainObject= null;this.IsThemeLoader=false;this.Api=null;this.map_table_styles={};this.ImageMapChecker=null;this.IsUseFullUrl=false;this.insertDocumentUrlsData=null;this.RebuildImages=[];this.aSlideLayouts=[];this.aThemes=[];this.arr_connectors=[];this.map_shapes_by_id={};this.fields=[];this.ClearConnectorsMaps=function(){this.arr_connectors.length=0;this.map_shapes_by_id={}};this.AssignConnectorsId=function(){var oPr=null;for(var i=0;i<this.arr_connectors.length;++i){oPr=this.arr_connectors[i].nvSpPr.nvUniSpPr; if(AscFormat.isRealNumber(oPr.stCnxId))if(AscCommon.isRealObject(this.map_shapes_by_id[oPr.stCnxId]))oPr.stCnxId=this.map_shapes_by_id[oPr.stCnxId].Id;else{oPr.stCnxId=null;oPr.stCnxIdx=null}if(AscFormat.isRealNumber(oPr.endCnxId))if(AscCommon.isRealObject(this.map_shapes_by_id[oPr.endCnxId]))oPr.endCnxId=this.map_shapes_by_id[oPr.endCnxId].Id;else{oPr.endCnxId=null;oPr.endCnxIdx=null}this.arr_connectors[i].nvSpPr.setUniSpPr(oPr.copy())}this.ClearConnectorsMaps()};this.Start_UseFullUrl=function(insertDocumentUrlsData){this.IsUseFullUrl= true;this.insertDocumentUrlsData=insertDocumentUrlsData};this.End_UseFullUrl=function(){var _result=this.RebuildImages;this.IsUseFullUrl=false;this.RebuildImages=[];return _result};this.Load=function(base64_ppty,presentation){this.presentation=presentation;this.DrawingDocument=null;if(presentation)this.DrawingDocument=presentation.DrawingDocument;else this.DrawingDocument=null;this.ImageMapChecker={};var isBase64=typeof base64_ppty==="string";var srcLen=isBase64?base64_ppty.length:base64_ppty.length; var nWritten=0;var index=0;var read_main_prop="";while(true){var _c=isBase64?base64_ppty.charCodeAt(index):base64_ppty[index];if(_c==";".charCodeAt(0))break;read_main_prop+=String.fromCharCode(_c);index++}index++;if("PPTY"!=read_main_prop)return false;read_main_prop="";while(true){var _c=isBase64?base64_ppty.charCodeAt(index):base64_ppty[index];if(_c==";".charCodeAt(0))break;read_main_prop+=String.fromCharCode(_c);index++}index++;var _version_num_str=read_main_prop.substring(1);var version=1;if(_version_num_str.length> 0)version=_version_num_str-0;read_main_prop="";while(true){var _c=isBase64?base64_ppty.charCodeAt(index):base64_ppty[index];if(_c==";".charCodeAt(0))break;read_main_prop+=String.fromCharCode(_c);index++}index++;if(Asc.c_nVersionNoBase64!==version){var dstLen_str=read_main_prop;var dstLen=parseInt(dstLen_str);var pointer=g_memory.Alloc(dstLen);this.stream=new AscCommon.FileStream(pointer.data,dstLen);this.stream.obj=pointer.obj;var dstPx=this.stream.data;if(window.chrome)while(index<srcLen){var dwCurr= 0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=DecodeBase64Char(isBase64?base64_ppty.charCodeAt(index++):base64_ppty[index++]);if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[isBase64?base64_ppty.charCodeAt(index++):base64_ppty[index++]];if(nCh==undefined){i--; continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}}else{this.stream=new AscCommon.FileStream;this.stream.obj=null;this.stream.data=base64_ppty;this.stream.size=base64_ppty.length;this.stream.EnterFrame(index);this.stream.Seek2(index)}this.presentation.ImageMap={};this.presentation.Fonts=[];this.fields.length=0;this.LoadDocument();if(AscFonts.IsCheckSymbols){var bLoad=AscCommon.g_oIdCounter.m_bLoad;AscCommon.g_oIdCounter.Set_Load(false); for(var nField=0;nField<this.fields.length;++nField){var oField=this.fields[nField];var sValue=oField.private_GetString();if(typeof sValue==="string"&&sValue.length>0)AscFonts.FontPickerByCharacter.getFontsByString(sValue)}AscCommon.g_oIdCounter.Set_Load(bLoad)}this.fields.length=0;AscFormat.checkPlaceholdersText();this.ImageMapChecker=null};this.LoadDocument=function(){var _main_tables={};var s=this.stream;var err=0;err=s.EnterFrame(5*30);if(err!=0)return err;for(var i=0;i<30;i++){var _type=s.GetUChar(); if(0==_type)break;_main_tables[""+_type]=s.GetULong()}if(undefined!=_main_tables["255"]){s.Seek2(_main_tables["255"]);var _sign=s.GetString1(4);var _ver=s.GetULong()}if(!this.IsThemeLoader){if(undefined!=_main_tables["1"]){s.Seek2(_main_tables["1"]);this.presentation.App=new CApp;this.presentation.App.fromStream(s)}if(undefined!=_main_tables["2"]){s.Seek2(_main_tables["2"]);this.presentation.Core=new CCore;this.presentation.Core.fromStream(s)}if(undefined!=_main_tables["48"]){s.Seek2(_main_tables["48"]); this.presentation.CustomProperties=new CCustomProperties;this.presentation.CustomProperties.fromStream(s)}}if(undefined!=_main_tables["3"]){s.Seek2(_main_tables["3"]);this.presentation.pres=new CPres;var pres=this.presentation.pres;pres.fromStream(s,this);if(!this.IsThemeLoader){if(pres.attrShowSpecialPlsOnTitleSld!==null)this.presentation.setShowSpecialPlsOnTitleSld(pres.attrShowSpecialPlsOnTitleSld);if(pres.attrFirstSlideNum!==null)this.presentation.setFirstSlideNum(pres.attrFirstSlideNum)}this.presentation.defaultTextStyle= pres.defaultTextStyle;if(pres.SldSz){this.presentation.Width=pres.SldSz.cx/c_dScalePPTXSizes;this.presentation.Height=pres.SldSz.cy/c_dScalePPTXSizes}else{this.presentation.Width=254;this.presentation.Height=190.5;pres.SldSz={};pres.SldSz.cx=this.presentation.Width*c_dScalePPTXSizes;pres.SldSz.cy=this.presentation.Height*c_dScalePPTXSizes}}if(!this.IsThemeLoader){if(undefined!=_main_tables["4"]){s.Seek2(_main_tables["4"]);this.presentation.ViewProps=this.ReadViewProps()}if(undefined!=_main_tables["5"]){s.Seek2(_main_tables["5"]); this.presentation.VmlDrawing=this.ReadVmlDrawing()}if(undefined!=_main_tables["6"]){s.Seek2(_main_tables["6"]);this.presentation.TableStyles=this.ReadTableStyles()}if(undefined!=_main_tables["7"]){s.Seek2(_main_tables["7"]);this.ReadPresProps(this.presentation)}}this.aThemes.length=0;if(undefined!=_main_tables["20"]){s.Seek2(_main_tables["20"]);var _themes_count=s.GetULong();for(var i=0;i<_themes_count;i++)this.aThemes[i]=this.ReadTheme()}if(undefined!=_main_tables["22"]){s.Seek2(_main_tables["22"]); var _sm_count=s.GetULong();for(var i=0;i<_sm_count;i++){this.presentation.slideMasters[i]=this.ReadSlideMaster();this.presentation.slideMasters[i].setSlideSize(this.presentation.Width,this.presentation.Height)}}this.aSlideLayouts.length=0;if(undefined!=_main_tables["23"]){s.Seek2(_main_tables["23"]);var _sl_count=s.GetULong();for(var i=0;i<_sl_count;i++){this.aSlideLayouts[i]=this.ReadSlideLayout();this.aSlideLayouts[i].setSlideSize(this.presentation.Width,this.presentation.Height)}}if(!this.IsThemeLoader){if(undefined!= _main_tables["24"]){s.Seek2(_main_tables["24"]);var _s_count=s.GetULong();var bOldVal;if(this.Api){bOldVal=this.Api.bNoSendComments;this.Api.bNoSendComments=true}for(var i=0;i<_s_count;i++){this.presentation.insertSlide(i,this.ReadSlide(i));this.presentation.Slides[i].setSlideSize(this.presentation.Width,this.presentation.Height)}if(this.Api)this.Api.bNoSendComments=bOldVal}if(undefined!=_main_tables["25"]){s.Seek2(_main_tables["25"]);var _nm_count=s.GetULong();for(var i=0;i<_nm_count;i++){this.presentation.notesMasters[i]= this.ReadNoteMaster();this.presentation.notesMasters[i].setTheme(this.aThemes[0])}}if(undefined!=_main_tables["26"]){s.Seek2(_main_tables["26"]);var _n_count=s.GetULong();for(var i=0;i<_n_count;i++)this.presentation.notes[i]=this.ReadNote()}}if(null==this.ImageMapChecker){if(undefined!=_main_tables["42"]){s.Seek2(_main_tables["42"]);var _type=s.GetUChar();var _len=s.GetULong();s.Skip2(1);var _cur_ind=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;var image_id=s.GetString2();if(this.IsThemeLoader)image_id= "theme"+(this.Api.ThemeLoader.CurrentLoadThemeIndex+1)+"/media/"+image_id;this.presentation.ImageMap[_cur_ind++]=image_id}}}else{var _cur_ind=0;for(var k in this.ImageMapChecker){if(this.IsThemeLoader)image_id="theme"+(this.Api.ThemeLoader.CurrentLoadThemeIndex+1)+"/media/"+k;this.presentation.ImageMap[_cur_ind++]=k}}if(undefined!=_main_tables["43"]){s.Seek2(_main_tables["43"]);var _type=s.GetUChar();var _len=s.GetULong();s.Skip2(1);var _cur_ind=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break; var f_name=s.GetString2();this.presentation.Fonts[this.presentation.Fonts.length]=new AscFonts.CFont(f_name,0,"",0,15)}}if(undefined!=_main_tables["41"]){s.Seek2(_main_tables["41"]);s.Skip2(5);var _count=s.GetULong();for(var i=0;i<_count;i++){var _master_type=s.GetUChar();this.ReadMasterInfo(i)}}if(!this.IsThemeLoader){if(undefined!=_main_tables["40"]){s.Seek2(_main_tables["40"]);s.Skip2(6);var _slideNum=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;var indexL=s.GetULong();this.presentation.Slides[_slideNum].setLayout(this.aSlideLayouts[indexL]); this.presentation.Slides[_slideNum].Master=this.aSlideLayouts[indexL].Master;_slideNum++}}if(undefined!=_main_tables["45"]){s.Seek2(_main_tables["45"]);s.Skip2(6);var _slideNum=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;var indexL=s.GetLong();this.presentation.Slides[_slideNum].setNotes(this.presentation.notes[indexL]);++_slideNum}}if(undefined!=_main_tables["46"]){s.Seek2(_main_tables["46"]);s.Skip2(6);var _noteNum=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break; var indexL=s.GetLong();this.presentation.notes[_noteNum].setNotesMaster(this.presentation.notesMasters[indexL]);_noteNum++}}if(undefined!=_main_tables["47"]){s.Seek2(_main_tables["47"]);s.Skip2(6);var _noteMasterNum=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;var indexL=s.GetLong();var notesMaster=this.presentation.notesMasters[_noteMasterNum];var notesMasterTheme=this.aThemes[indexL];if(notesMaster&¬esMasterTheme)notesMaster.setTheme(notesMasterTheme);_noteMasterNum++}}}if(this.Api!= null&&!this.IsThemeLoader){if(this.aThemes.length==0)this.aThemes[0]=AscFormat.GenerateDefaultTheme(this.presentation);if(this.presentation.slideMasters.length==0){this.presentation.slideMasters[0]=AscFormat.GenerateDefaultMasterSlide(this.aThemes[0]);this.aSlideLayouts[0]=this.presentation.slideMasters[0].sldLayoutLst[0]}if(this.presentation.slideMasters[0].sldLayoutLst.length===0){this.presentation.slideMasters[0].sldLayoutLst[0]=AscFormat.GenerateDefaultSlideLayout(this.presentation.slideMasters[0]); this.aSlideLayouts[0]=this.presentation.slideMasters[0].sldLayoutLst[0]}if(this.presentation.notesMasters.length===0){this.presentation.notesMasters[0]=AscCommonSlide.CreateNotesMaster();var oNotesTheme=this.aThemes[0].createDuplicate();oNotesTheme.presentation=this.presentation;this.aThemes.push(oNotesTheme);this.presentation.notesMasters[0].setTheme(oNotesTheme)}if(this.presentation.Slides.length==0);var _slides=this.presentation.Slides;var _slide;for(var i=0;i<_slides.length;++i){_slide=_slides[i]; if(!_slide.notes){_slide.setNotes(AscCommonSlide.CreateNotes());_slide.notes.setSlide(_slide);_slide.notes.setNotesMaster(this.presentation.notesMasters[0])}else if(!_slide.notes.Master)_slide.notes.setNotesMaster(this.presentation.notesMasters[0])}}else if(this.Api!=null&&this.IsThemeLoader){var theme_loader=this.Api.ThemeLoader;var _info=theme_loader.themes_info_editor[theme_loader.CurrentLoadThemeIndex];_info.ImageMap=this.presentation.ImageMap;_info.FontMap=this.presentation.Fonts}};this.ReadMasterInfo= function(indexMaster){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;var master=this.presentation.slideMasters[indexMaster];s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{var indexTh=s.GetULong();master.setTheme(this.aThemes[indexTh]);master.ThemeIndex=-indexTh-1;break}case 1:{s.GetString2A();break}default:break}}var _lay_count=s.GetULong();for(var i=0;i<_lay_count;i++){s.Skip2(6);while(true){var _at=s.GetUChar();if(_at== g_nodeAttributeEnd)break;switch(_at){case 0:{var indexL=s.GetULong();master.addToSldLayoutLstToPos(master.sldLayoutLst.length,this.aSlideLayouts[indexL]);break}case 1:{s.GetString2A();break}default:break}}}s.Seek2(_end_rec);if(this.Api!=null&&this.IsThemeLoader){var theme_loader=this.Api.ThemeLoader;var theme_load_info=new CThemeLoadInfo;theme_load_info.Master=master;theme_load_info.Theme=master.Theme;var _lay_cnt=master.sldLayoutLst.length;for(var i=0;i<_lay_cnt;i++)theme_load_info.Layouts[i]=master.sldLayoutLst[i]; theme_loader.themes_info_editor[theme_loader.CurrentLoadThemeIndex]=theme_load_info}};this.ReadViewProps=function(){return null};this.ReadVmlDrawing=function(){return null};this.ReadPresProps=function(presentation){var s=this.stream;var _type=s.GetUChar();var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{s.SkipRecord();break}case 1:{presentation.showPr=this.ReadShowPr();break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)}; this.ReadShowPr=function(){var showPr=new CShowPr;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{showPr.loop=s.GetBool();break}case 1:{showPr.showAnimation=s.GetBool();break}case 2:{showPr.showNarration=s.GetBool();break}case 3:{showPr.useTimings=s.GetBool();break}default:break}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{showPr.browse=true;s.SkipRecord(); break}case 1:{this.ReadShowPrCustShow(showPr);break}case 2:{this.ReadShowPrKiosk(showPr);break}case 3:{showPr.penClr=this.ReadUniColor();break}case 4:{showPr.present=true;s.SkipRecord();break}case 5:{if(!showPr.show)showPr.show={showAll:null,range:null,custShow:null};showPr.show.showAll=true;s.SkipRecord();break}case 6:{this.ReadShowPrSldRg(showPr);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return showPr};this.ReadShowPrCustShow=function(showPr){var s=this.stream;var _rec_start=s.cur; var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{if(!showPr.show)showPr.show={showAll:null,range:null,custShow:null};showPr.show.custShow=s.GetLong();break}default:break}}s.Seek2(_end_rec)};this.ReadShowPrKiosk=function(showPr){showPr.kiosk={restart:null};var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{showPr.kiosk.restart= s.GetLong();break}default:break}}s.Seek2(_end_rec)};this.ReadShowPrSldRg=function(showPr){if(!showPr.show)showPr.show={showAll:null,range:null,custShow:null};showPr.show.range={start:null,end:null};var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{showPr.show.range.start=s.GetLong();break}case 1:{showPr.show.range.end=s.GetLong();break}default:break}}s.Seek2(_end_rec)};this.ReadTableStyles= function(){var s=this.stream;var _type=s.GetUChar();var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);var _old_default=this.presentation.DefaultTableStyleId;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{var _def=s.GetString2();this.presentation.DefaultTableStyleId=_def;break}default:break}}var _type=s.GetUChar();s.Skip2(4);while(s.cur<_end_rec){s.Skip2(1);this.ReadTableStyle()}if(!this.presentation.globalTableStyles.Style[this.presentation.DefaultTableStyleId])this.presentation.DefaultTableStyleId= _old_default;s.Seek2(_end_rec)};this.ReadTableStyle=function(bNotAddStyle){var s=this.stream;var _style=new CStyle("",null,null,styletype_Table);var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{var _id=s.GetString2();if(AscCommon.isRealObject(this.presentation.TableStylesIdMap)&&!bNotAddStyle)this.presentation.TableStylesIdMap[_style.Id]=true;this.map_table_styles[_id]=_style;break}case 1:{_style.Name= s.GetString2();break}default:break}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var _end_rec2=s.cur+s.GetLong()+4;while(s.cur<_end_rec2){var _at2=s.GetUChar();switch(_at2){case 0:{var _end_rec3=s.cur+s.GetLong()+4;while(s.cur<_end_rec3){var _at3=s.GetUChar();switch(_at3){case 0:{var _unifill=this.ReadUniFill();if(_unifill&&_unifill.fill!==undefined&&_unifill.fill!=null){if(undefined===_style.TablePr.Shd||null==_style.TablePr.Shd){_style.TablePr.Shd=new CDocumentShd;_style.TablePr.Shd.Value= c_oAscShdClear}_style.TablePr.Shd.Unifill=_unifill}}default:{s.SkipRecord();break}}}break}case 1:{if(undefined===_style.TablePr.Shd||null==_style.TablePr.Shd){_style.TablePr.Shd=new CDocumentShd;_style.TablePr.Shd.Value=c_oAscShdClear}_style.TablePr.Shd.FillRef=this.ReadStyleRef();break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec2);break}case 1:{_style.TableWholeTable=this.ReadTableStylePart();break}case 2:{_style.TableBand1Horz=this.ReadTableStylePart();break}case 3:{_style.TableBand2Horz=this.ReadTableStylePart(); break}case 4:{_style.TableBand1Vert=this.ReadTableStylePart();break}case 5:{_style.TableBand2Vert=this.ReadTableStylePart();break}case 6:{_style.TableLastCol=this.ReadTableStylePart();break}case 7:{_style.TableFirstCol=this.ReadTableStylePart();break}case 8:{_style.TableFirstRow=this.ReadTableStylePart();break}case 9:{_style.TableLastRow=this.ReadTableStylePart();break}case 10:{_style.TableBRCell=this.ReadTableStylePart();break}case 11:{_style.TableBLCell=this.ReadTableStylePart();break}case 12:{_style.TableTRCell= this.ReadTableStylePart();break}case 13:{_style.TableTLCell=this.ReadTableStylePart();break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);if(_style.TableWholeTable.TablePr.TableBorders.InsideH){_style.TablePr.TableBorders.InsideH=_style.TableWholeTable.TablePr.TableBorders.InsideH;delete _style.TableWholeTable.TablePr.TableBorders.InsideH}if(_style.TableWholeTable.TablePr.TableBorders.InsideV){_style.TablePr.TableBorders.InsideV=_style.TableWholeTable.TablePr.TableBorders.InsideV;delete _style.TableWholeTable.TablePr.TableBorders.InsideV}if(_style.TableWholeTable.TableCellPr.TableCellBorders.Top){_style.TablePr.TableBorders.Top= _style.TableWholeTable.TableCellPr.TableCellBorders.Top;delete _style.TableWholeTable.TableCellPr.TableCellBorders.Top}if(_style.TableWholeTable.TableCellPr.TableCellBorders.Bottom){_style.TablePr.TableBorders.Bottom=_style.TableWholeTable.TableCellPr.TableCellBorders.Bottom;delete _style.TableWholeTable.TableCellPr.TableCellBorders.Bottom}if(_style.TableWholeTable.TableCellPr.TableCellBorders.Left){_style.TablePr.TableBorders.Left=_style.TableWholeTable.TableCellPr.TableCellBorders.Left;delete _style.TableWholeTable.TableCellPr.TableCellBorders.Left}if(_style.TableWholeTable.TableCellPr.TableCellBorders.Right){_style.TablePr.TableBorders.Right= _style.TableWholeTable.TableCellPr.TableCellBorders.Right;delete _style.TableWholeTable.TableCellPr.TableCellBorders.Right}if(bNotAddStyle)return _style;else if(this.presentation.globalTableStyles)this.presentation.globalTableStyles.Add(_style)};this.ReadTableStylePart=function(){var s=this.stream;var _part=new CTableStylePr;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var _end_rec2=s.cur+s.GetLong()+4;s.Skip2(1);var _i, _b;while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;switch(_at2){case 0:{_i=s.GetUChar();break}case 1:{_b=s.GetUChar();break}default:break}}if(_i===0)_part.TextPr.Italic=true;else if(_i===1)_part.TextPr.Italic=false;if(_b===0)_part.TextPr.Bold=true;else if(_b===1)_part.TextPr.Bold=false;while(s.cur<_end_rec2){var _at3=s.GetUChar();switch(_at3){case 0:{_part.TextPr.FontRef=this.ReadFontRef();break}case 1:{var _Unicolor=this.ReadUniColor();if(_Unicolor&&_Unicolor.color){_part.TextPr.Unifill= new AscFormat.CUniFill;_part.TextPr.Unifill.fill=new AscFormat.CSolidFill;_part.TextPr.Unifill.fill.color=_Unicolor}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec2);break}case 1:{var _end_rec2=s.cur+s.GetLong()+4;while(s.cur<_end_rec2){var _at2=s.GetUChar();switch(_at2){case 0:{this.ReadTcBdr(_part);break}case 1:{if(undefined===_part.TableCellPr.Shd||null==_part.TableCellPr.Shd){_part.TableCellPr.Shd=new CDocumentShd;_part.TableCellPr.Shd.Value=c_oAscShdClear}_part.TableCellPr.Shd.FillRef= this.ReadStyleRef();break}case 2:{var _end_rec3=s.cur+s.GetLong()+4;while(s.cur<_end_rec3){var _at3=s.GetUChar();switch(_at3){case 0:{var _unifill=this.ReadUniFill();if(_unifill&&_unifill.fill!==undefined&&_unifill.fill!=null){if(undefined===_part.TableCellPr.Shd||null==_part.TableCellPr.Shd){_part.TableCellPr.Shd=new CDocumentShd;_part.TableCellPr.Shd.Value=c_oAscShdClear}_part.TableCellPr.Shd.Unifill=_unifill}break}default:{s.SkipRecord();break}}}break}case 3:{s.SkipRecord();break}default:{s.SkipRecord(); break}}}s.Seek2(_end_rec2);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return _part};this.ReadTcBdr=function(_part){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{_part.TableCellPr.TableCellBorders.Left=new CDocumentBorder;this.ReadTableBorderLineStyle(_part.TableCellPr.TableCellBorders.Left);break}case 1:{_part.TableCellPr.TableCellBorders.Right=new CDocumentBorder;this.ReadTableBorderLineStyle(_part.TableCellPr.TableCellBorders.Right); break}case 2:{_part.TableCellPr.TableCellBorders.Top=new CDocumentBorder;this.ReadTableBorderLineStyle(_part.TableCellPr.TableCellBorders.Top);break}case 3:{_part.TableCellPr.TableCellBorders.Bottom=new CDocumentBorder;this.ReadTableBorderLineStyle(_part.TableCellPr.TableCellBorders.Bottom);break}case 4:{_part.TablePr.TableBorders.InsideH=new CDocumentBorder;this.ReadTableBorderLineStyle(_part.TablePr.TableBorders.InsideH);break}case 5:{_part.TablePr.TableBorders.InsideV=new CDocumentBorder;this.ReadTableBorderLineStyle(_part.TablePr.TableBorders.InsideV); break}case 6:case 7:{s.SkipRecord()}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return _part};this.ReadTableBorderLineStyle=function(_border){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var ln=this.ReadLn();_border.Unifill=ln.Fill;_border.Size=ln.w==null?12700:ln.w>>0;_border.Size/=36E3;_border.Value=border_Single;break}case 1:{_border.LineRef=this.ReadStyleRef();_border.Value=border_Single;break}default:{s.SkipRecord(); break}}}s.Seek2(_end_rec)};this.ReadUniColor=function(){var s=this.stream;var _len=s.GetULong();var read_start=s.cur;var read_end=read_start+_len;var uni_color=new AscFormat.CUniColor;if(s.cur<read_end){var _type=s.GetUChar();var _e=s.cur+s.GetULong()+4;switch(_type){case c_oAscColor.COLOR_TYPE_PRST:{s.Skip2(2);uni_color.setColor(new AscFormat.CPrstColor);uni_color.color.setId(s.GetString2());s.Skip2(1);if(s.cur<_e)if(0==s.GetUChar())uni_color.setMods(this.ReadColorMods());break}case c_oAscColor.COLOR_TYPE_SCHEME:{s.Skip2(2); uni_color.setColor(new AscFormat.CSchemeColor);uni_color.color.setId(s.GetUChar());s.Skip2(1);if(s.cur<_e)if(0==s.GetUChar())uni_color.setMods(this.ReadColorMods());break}case c_oAscColor.COLOR_TYPE_SRGB:{var r,g,b;s.Skip2(1);uni_color.setColor(new AscFormat.CRGBColor);s.Skip2(1);r=s.GetUChar();s.Skip2(1);g=s.GetUChar();s.Skip2(1);b=s.GetUChar();s.Skip2(1);uni_color.color.setColor(r,g,b);if(s.cur<_e)if(0==s.GetUChar())uni_color.setMods(this.ReadColorMods());break}case c_oAscColor.COLOR_TYPE_SYS:{s.Skip2(1); uni_color.setColor(new AscFormat.CSysColor);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{uni_color.color.setId(s.GetString2());break}case 1:{uni_color.color.setR(s.GetUChar());break}case 2:{uni_color.color.setG(s.GetUChar());break}case 3:{uni_color.color.setB(s.GetUChar());break}default:break}}if(s.cur<_e)if(0==s.GetUChar())uni_color.setMods(this.ReadColorMods());break}}}if(!uni_color.color)return null;s.Seek2(read_end);return uni_color};this.ReadColorMods= function(){var ret=new AscFormat.CColorModifiers;var _mods=this.ReadColorModifiers();if(_mods)for(var i=0;i<_mods.length;++i)ret.addMod(_mods[i]);return ret};this.ReadColorModifiers=function(){var s=this.stream;var _start=s.cur;var _end=_start+s.GetULong()+4;var _ret=null;var _count=s.GetULong();for(var i=0;i<_count;i++){if(s.cur>_end)break;s.Skip2(1);var _s1=s.cur;var _e1=_s1+s.GetULong()+4;if(_s1<_e1){s.Skip2(1);if(null==_ret)_ret=[];var _mod=new AscFormat.CColorMod;_ret[_ret.length]=_mod;while(true){var _type= s.GetUChar();if(0==_type){_mod.setName(s.GetString2());var _find=_mod.name.indexOf(":");if(_find>=0&&_find<_mod.name.length-1)_mod.setName(_mod.name.substring(_find+1))}else if(1==_type)_mod.setVal(s.GetLong());else if(g_nodeAttributeEnd==_type)break;else break}}s.Seek2(_e1)}s.Seek2(_end);return _ret};this.ReadRect=function(bIsMain){var _ret={};var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break; switch(_at){case 0:{_ret.l=s.GetPercentage();break}case 1:{_ret.t=s.GetPercentage();break}case 2:{_ret.r=s.GetPercentage();break}case 3:{_ret.b=s.GetPercentage();break}default:break}}s.Seek2(_end_rec);if(null==_ret.l&&null==_ret.t&&null==_ret.r&&null==_ret.b)return null;if(_ret.l==null)_ret.l=0;if(_ret.t==null)_ret.t=0;if(_ret.r==null)_ret.r=0;if(_ret.b==null)_ret.b=0;if(!bIsMain){var _absW=Math.abs(_ret.l)+Math.abs(_ret.r)+100;var _absH=Math.abs(_ret.t)+Math.abs(_ret.b)+100;_ret.l=-100*_ret.l/_absW; _ret.t=-100*_ret.t/_absH;_ret.r=-100*_ret.r/_absW;_ret.b=-100*_ret.b/_absH}_ret.r=100-_ret.r;_ret.b=100-_ret.b;if(_ret.l>_ret.r){var tmp=_ret.l;_ret.l=_ret.r;_ret.r=tmp}if(_ret.t>_ret.b){var tmp=_ret.t;_ret.t=_ret.b;_ret.b=tmp}var ret=new AscFormat.CSrcRect;ret.setLTRB(_ret.l,_ret.t,_ret.r,_ret.b);return ret};this.ReadGradLin=function(){var _lin=new AscFormat.GradLin;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break; switch(_at){case 0:{_lin.setAngle(s.GetLong());break}case 1:{_lin.setScale(s.GetBool())}default:break}}s.Seek2(_end_rec);return _lin};this.ReadGradPath=function(){var _path=new AscFormat.GradPath;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{_path.setPath(s.GetUChar());break}default:break}}s.Seek2(_end_rec);return _path};this.ReadBlur=function(){var nRecStart,nRecLen,nRecEnd; var s=this.stream;s.GetULong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;var oEffect=new AscFormat.CBlur;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.rad=s.GetULong();break;case 1:oEffect.grow=s.GetBool();break}}s.Seek2(nRecEnd);return oEffect};this.ReadFillOverlay=function(){var s=this.stream;s.GetULong();s.GetUChar();var nRecStart,nRecLen,nRecEnd;nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+ 4;var oEffect=new AscFormat.CFillOverlay;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.blend=s.GetUChar();else break}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.fill=this.ReadUniFill();break}default:break}}s.Seek2(nRecEnd);return oEffect};this.ReadGlow=function(){var s=this.stream;s.GetULong();s.GetUChar();var nRecStart=s.cur;var nRecLen=s.GetLong();var nRecEnd=nRecStart+nRecLen+4;var oEffect=new AscFormat.CGlow;s.Skip2(1); while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.rad=s.GetLong();else break}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.color=this.ReadUniColor();break}default:break}}s.Seek2(nRecEnd);return oEffect};this.ReadInnerShdw=function(){var s=this.stream;s.GetULong();s.GetUChar();var nRecStart=s.cur;var nRecLen=s.GetLong();var nRecEnd=nRecStart+nRecLen+4;var oEffect=new AscFormat.CInnerShdw;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break; switch(_at){case 0:oEffect.dir=s.GetLong();break;case 1:oEffect.dist=s.GetLong();break;case 2:oEffect.blurRad=s.GetLong();break}}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.color=this.ReadUniColor();break}default:break}}s.Seek2(nRecEnd);return oEffect};this.ReadOuterShdw=function(){var s=this.stream;s.GetULong();s.GetUChar();var nRecStart=s.cur;var nRecLen=s.GetLong();var nRecEnd=nRecStart+nRecLen+4;var oEffect=new AscFormat.COuterShdw;s.Skip2(1);while(true){var _at=s.GetUChar(); if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.algn=s.GetUChar();break;case 1:oEffect.blurRad=s.GetLong();break;case 2:oEffect.dir=s.GetLong();break;case 3:oEffect.dist=s.GetLong();break;case 4:oEffect.kx=s.GetLong();break;case 5:oEffect.ky=s.GetLong();break;case 6:oEffect.sx=s.GetLong();break;case 7:oEffect.sy=s.GetLong();break;case 8:oEffect.rotWithShape=s.GetBool();break}}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.color=this.ReadUniColor();break}default:break}}s.Seek2(nRecEnd); return oEffect};this.ReadPrstShdw=function(){var s=this.stream;s.GetULong();s.GetUChar();var nRecStart=s.cur;var nRecLen=s.GetLong();var nRecEnd=nRecStart+nRecLen+4;var oEffect=new AscFormat.CPrstShdw;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.dir=s.GetLong();break;case 1:oEffect.dist=s.GetLong();break;case 2:oEffect.prst=s.GetUChar();break}}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.color=this.ReadUniColor(); break}default:break}}s.Seek2(nRecEnd);return oEffect};this.ReadReflection=function(){var s=this.stream;s.GetULong();s.GetUChar();var nRecStart=s.cur;var nRecLen=s.GetLong();var nRecEnd=nRecStart+nRecLen+4;var oEffect=new AscFormat.CReflection;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{oEffect.algn=s.GetUChar()}break;case 1:oEffect.blurRad=s.GetLong();break;case 2:oEffect.stA=s.GetLong();break;case 3:oEffect.endA=s.GetLong();break;case 4:oEffect.stPos= s.GetLong();break;case 5:oEffect.endPos=s.GetLong();break;case 6:oEffect.dir=s.GetLong();break;case 7:oEffect.fadeDir=s.GetLong();break;case 8:oEffect.dist=s.GetLong();break;case 9:oEffect.kx=s.GetLong();break;case 10:oEffect.ky=s.GetLong();break;case 11:oEffect.sx=s.GetLong();break;case 12:oEffect.sy=s.GetLong();break;case 13:oEffect.rotWithShape=s.GetBool();break}}s.Seek2(nRecEnd);return oEffect};this.ReadSoftEdge=function(){var s=this.stream;s.GetULong();s.GetUChar();var nRecStart=s.cur;var nRecLen= s.GetLong();var nRecEnd=nRecStart+nRecLen+4;var oEffect=new AscFormat.CSoftEdge;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.rad=s.GetULong();else break}s.Seek2(nRecEnd);return oEffect};this.ReadEffect=function(){var s=this.stream;var pos=s.cur;var nUniEffectLength=s.GetLong();if(nUniEffectLength===0)return null;var nEffectType=s.GetUChar();s.Seek2(pos);var nRecStart,nRecLen,nRecEnd;var oEffect=null;switch(nEffectType){case 0:{s.GetLong();s.GetUChar(); nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;s.Seek2(nRecEnd);break}case 1:{oEffect=this.ReadOuterShdw();break}case 2:{oEffect=this.ReadGlow();break}case 3:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CDuotone;var count=s.GetULong();for(var i=0;i<count;++i){s.Skip2(1);var oUniColor=this.ReadUniColor();if(oUniColor.color)oEffect.colors.push(oUniColor)}s.Seek2(nRecEnd);break}case 4:{s.GetLong();s.GetUChar();nRecStart= s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CXfrmEffect;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.kx=s.GetLong();break;case 1:oEffect.ky=s.GetLong();break;case 2:oEffect.sx=s.GetLong();break;case 3:oEffect.sy=s.GetLong();break;case 4:oEffect.tx=s.GetULong();break;case 5:oEffect.ty=s.GetULong();break}}s.Seek2(nRecEnd);break}case 5:{oEffect=this.ReadBlur();break}case 6:{oEffect=this.ReadPrstShdw();break}case 7:{oEffect= this.ReadInnerShdw();break}case 8:{oEffect=this.ReadReflection();break}case 9:{oEffect=this.ReadSoftEdge();break}case 10:{oEffect=this.ReadFillOverlay();break}case 11:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CAlphaCeiling;s.Seek2(nRecEnd);break}case 12:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CAlphaFloor;s.Seek2(nRecEnd);break}case 13:{s.GetLong();s.GetUChar(); nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CTintEffect;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.amt=s.GetLong();break;case 1:oEffect.hue=s.GetLong();break}}s.Seek2(nRecEnd);break}case 14:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CRelOff;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.tx= s.GetLong();break;case 1:oEffect.ty=s.GetLong();break}}s.Seek2(nRecEnd);break}case 15:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CLumEffect;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.bright=s.GetLong();break;case 1:oEffect.contrast=s.GetLong();break}}s.Seek2(nRecEnd);break}case 16:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4; oEffect=new AscFormat.CHslEffect;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.hue=s.GetLong();break;case 1:oEffect.lum=s.GetLong();break;case 2:oEffect.sat=s.GetLong();break}}s.Seek2(nRecEnd);break}case 17:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CGrayscl;s.Seek2(nRecEnd);break}case 18:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+ 4;oEffect=new AscFormat.CEffectElement;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.ref=s.GetString2();else break}s.Seek2(nRecEnd);break}case 19:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CAlphaRepl;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.a=s.GetLong();else break}s.Seek2(nRecEnd);break}case 20:{s.GetLong();s.GetUChar();nRecStart= s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CAlphaOutset;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.rad=s.GetULong();else break}s.Seek2(nRecEnd);break}case 21:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CAlphaModFix;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.amt=s.GetLong();else break}s.Seek2(nRecEnd); break}case 22:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CAlphaBiLevel;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.thresh=s.GetLong();else break}s.Seek2(nRecEnd);break}case 23:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CBiLevel;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at== 0)oEffect.thresh=s.GetLong();else break}s.Seek2(nRecEnd);break}case 24:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CEffectContainer;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:oEffect.name=s.GetString2();break;case 1:{oEffect.type=s.GetUChar()}break}}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{var count_effects2=s.GetULong();for(var _eff2=0;_eff2<count_effects2;++_eff2){s.Skip2(1); var eff2=this.ReadEffect();if(!eff2)oEffect.effectList.push(eff2)}}break;default:break}}s.Seek2(nRecEnd);break}case 25:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CFillEffect;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.fill=this.ReadUniFill();break}default:break}}s.Seek2(nRecEnd);break}case 26:{s.GetLong();s.GetUChar();nRecStart= s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CClrRepl;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.color=this.ReadUniColor();break}default:break}}s.Seek2(nRecEnd);break}case 27:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CClrChange;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break; switch(_at){case 0:oEffect.useA=s.GetBool();break}}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.clrFrom=this.ReadUniColor()}break;case 1:{oEffect.clrTo=this.ReadUniColor()}break;default:break}}s.Seek2(nRecEnd);break}case 28:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CAlphaInv;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.color= this.ReadUniColor();break}default:break}}s.Seek2(nRecEnd);break}case 29:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+4;oEffect=new AscFormat.CAlphaMod;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.cont=this.ReadEffectDag();break}default:break}}s.Seek2(nRecEnd);break}case 30:{s.GetLong();s.GetUChar();nRecStart=s.cur;nRecLen=s.GetLong();nRecEnd=nRecStart+nRecLen+ 4;oEffect=new AscFormat.CBlend;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(_at==0)oEffect.blend=s.GetUChar();else break}while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffect.cont=this.ReadEffectDag();break}default:break}}s.Seek2(nRecEnd);break}default:{s.SkipRecord();break}}return oEffect};this.ReadEffectDag=function(){var s=this.stream;s.GetULong();s.GetUChar();var _start_pos=s.cur;var _end_rec=_start_pos+s.GetLong()+4;s.Skip(1);var ret=new AscFormat.CEffectContainer; while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{ret.name=s.GetString2();break}case 1:{ret.type=s.GetUChar();break}}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var count_effects=s.GetULong();for(var _eff=0;_eff<count_effects;++_eff){s.Skip2(1);var effect=this.ReadEffect();if(effect)ret.effectList.push(effect)}}break;default:break}}s.Seek(_end_rec);return ret};this.ReadUniFill=function(oSpPr,oImageShape,oLn){var s=this.stream;var read_start= s.cur;var read_end=read_start+s.GetULong()+4;var uni_fill=new AscFormat.CUniFill;if(s.cur<read_end){var _type=s.GetUChar();var _e=s.cur+s.GetULong()+4;switch(_type){case c_oAscFill.FILL_TYPE_BLIP:{s.Skip2(1);uni_fill.setFill(new AscFormat.CBlipFill);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:s.Skip2(4);break;case 1:s.Skip2(1);break;default:break}}while(s.cur<_e){var rec=s.GetUChar();switch(rec){case 0:{var _s2=s.cur;var _e2=_s2+s.GetLong()+4;s.Skip2(1);while(true){var _at= s.GetUChar();if(g_nodeAttributeEnd==_at)break;if(_at==0)s.Skip2(1)}while(s.cur<_e2){var _t=s.GetUChar();switch(_t){case 0:case 1:{s.Skip2(4);break}case 10:case 11:{s.GetString2();break}case 2:{var len2=s.GetLong();var _end_rec_effect=s.cur+len2;var count_effects=s.GetULong();for(var _eff=0;_eff<count_effects;++_eff){s.Skip2(1);var oEffect=this.ReadEffect();if(oEffect){uni_fill.fill.Effects.push(oEffect);if(oEffect instanceof AscFormat.CAlphaModFix&&AscFormat.isRealNumber(oEffect.amt))uni_fill.setTransparent(255* oEffect.amt/1E5)}}s.Seek2(_end_rec_effect);break}case 3:{s.Skip2(6);var sReadPath=s.GetString2();if(this.IsUseFullUrl&&this.insertDocumentUrlsData&&this.insertDocumentUrlsData.imageMap){var sReadPathNew=this.insertDocumentUrlsData.imageMap[AscCommon.g_oDocumentUrls.mediaPrefix+sReadPath];if(sReadPathNew)sReadPath=sReadPathNew}if(this.IsUseFullUrl)if(window["native"]&&window["native"]["CopyTmpToMedia"])if(!(window.documentInfo&&window.documentInfo["iscoauthoring"])){var sMedia=window["native"]["CopyTmpToMedia"](sReadPath); if(typeof sMedia==="string"&&sMedia.length>0)sReadPath=sMedia}uni_fill.fill.setRasterImageId(sReadPath);var _s=sReadPath;var indS=_s.lastIndexOf("emf");if(indS==-1)indS=_s.lastIndexOf("wmf");if(indS!=-1&&indS==_s.length-3){_s=_s.substring(0,indS);_s+="svg";sReadPath=_s;uni_fill.fill.setRasterImageId(_s)}if(this.IsThemeLoader){sReadPath="theme"+(this.Api.ThemeLoader.CurrentLoadThemeIndex+1)+"/media/"+sReadPath;uni_fill.fill.setRasterImageId(sReadPath)}if(this.ImageMapChecker!=null)this.ImageMapChecker[sReadPath]= true;if(this.IsUseFullUrl)this.RebuildImages.push(new CBuilderImages(uni_fill.fill,sReadPath,oImageShape,oSpPr,oLn));s.Skip2(1);break}default:{s.SkipRecord();break}}}s.Seek2(_e2);break}case 1:{uni_fill.fill.setSrcRect(this.ReadRect(true));break}case 2:{var oBlipTile=new AscFormat.CBlipFillTile;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{oBlipTile.sx=s.GetLong();break}case 1:{oBlipTile.sy= s.GetLong();break}case 2:{oBlipTile.tx=s.GetLong();break}case 3:{oBlipTile.ty=s.GetLong();break}case 4:{oBlipTile.algn=s.GetUChar();break}case 5:{oBlipTile.flip=s.GetUChar();break}default:{break}}}s.Seek2(_end_rec);uni_fill.fill.setTile(oBlipTile);break}case 3:{var _e2=s.cur+s.GetLong()+4;while(s.cur<_e2){var _t=s.GetUChar();switch(_t){case 0:{var _srcRect=this.ReadRect(false);if(_srcRect!=null)uni_fill.fill.setSrcRect(_srcRect);break}default:{s.SkipRecord();break}}}s.Seek2(_e2);break}case 101:{var oBuilderImages= this.RebuildImages[this.RebuildImages.length-1];if(this.IsUseFullUrl&&oBuilderImages){s.Skip2(4);var urlsCount=s.GetUChar();for(var i=0;i<urlsCount;++i)oBuilderImages.AdditionalUrls.push(s.GetString2())}else s.SkipRecord();break}default:{var _len=s.GetULong();s.Skip2(_len)}}}break}case c_oAscFill.FILL_TYPE_GRAD:{s.Skip2(1);uni_fill.setFill(new AscFormat.CGradFill);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:s.Skip2(1);break;case 1:uni_fill.fill.rotateWithShape= s.GetBool();break;default:break}}while(s.cur<_e){var rec=s.GetUChar();switch(rec){case 0:{var _s1=s.cur;var _e1=_s1+s.GetULong()+4;var _count=s.GetULong();var colors_=[];for(var i=0;i<_count;i++){if(s.cur>=_e1)break;s.Skip2(1);s.Skip2(4);var _gs=new AscFormat.CGs;s.Skip2(1);s.Skip2(1);_gs.pos=s.GetLong();s.Skip2(1);s.Skip2(1);_gs.color=this.ReadUniColor();colors_[colors_.length]=_gs}s.Seek2(_e1);colors_.sort(function(a,b){return a.pos-b.pos});for(var z=0;z<colors_.length;++z)uni_fill.fill.addColor(colors_[z]); break}case 1:{uni_fill.fill.setLin(this.ReadGradLin());break}case 2:{uni_fill.fill.setPath(this.ReadGradPath());break}case 3:{s.SkipRecord();break}default:{var _len=s.GetULong();s.Skip2(_len)}}}if(null!=uni_fill.fill.lin&&null!=uni_fill.fill.path)uni_fill.fill.setPath(null);if(uni_fill.fill.colors.length<2)if(uni_fill.fill.colors.length===1){var oUniColor=uni_fill.fill.colors[0].color;uni_fill.fill=new AscFormat.CSolidFill;uni_fill.fill.color=oUniColor}else{uni_fill.fill=new AscFormat.CSolidFill; uni_fill.fill.color=AscFormat.CreateUniColorRGB(0,0,0)}break}case c_oAscFill.FILL_TYPE_PATT:{uni_fill.setFill(new AscFormat.CPattFill);s.Skip2(1);while(true){var _atPF=s.GetUChar();if(_atPF==g_nodeAttributeEnd)break;switch(_atPF){case 0:{uni_fill.fill.setFType(s.GetUChar());break}default:break}}while(s.cur<_e){var rec=s.GetUChar();switch(rec){case 0:{uni_fill.fill.setFgColor(this.ReadUniColor());break}case 1:{uni_fill.fill.setBgColor(this.ReadUniColor());break}default:{s.SkipRecord()}}}if(uni_fill.fill.fgClr&& uni_fill.fill.bgClr){var fAlphaVal=uni_fill.fill.fgClr.getModValue("alpha");if(fAlphaVal!==null)if(fAlphaVal===uni_fill.fill.bgClr.getModValue("alpha"))uni_fill.setTransparent(255*fAlphaVal/1E5)}break}case c_oAscFill.FILL_TYPE_SOLID:{s.Skip2(1);uni_fill.setFill(new AscFormat.CSolidFill);uni_fill.fill.setColor(this.ReadUniColor());if(uni_fill.fill&&uni_fill.fill.color&&uni_fill.fill.color.Mods&&uni_fill.fill.color.Mods.Mods){var mods=uni_fill.fill.color.Mods.Mods;var _len=mods.length;for(var i=0;i< _len;i++)if(mods[i].name=="alpha"){uni_fill.setTransparent(255*mods[i].val/1E5);uni_fill.fill.color.Mods.removeMod(i);break}}else if(uni_fill.fill.color)uni_fill.fill.color.setMods(new AscFormat.CColorModifiers);break}case c_oAscFill.FILL_TYPE_NOFILL:{uni_fill.setFill(new AscFormat.CNoFill);break}case c_oAscFill.FILL_TYPE_GRP:{uni_fill.setFill(new AscFormat.CGrpFill);break}}}s.Seek2(read_end);if(!uni_fill.fill)return null;return uni_fill};this.ReadExtraColorScheme=function(){var extra=new AscFormat.ExtraClrScheme; var s=this.stream;var _e=s.cur+s.GetULong()+4;while(s.cur<_e){var _rec=s.GetUChar();switch(_rec){case 0:{extra.setClrScheme(new AscFormat.ClrScheme);this.ReadClrScheme(extra.clrScheme);break}case 1:{extra.setClrMap(new AscFormat.ClrMap);this.ReadClrMap(extra.clrMap);break}default:{s.SkipRecord();break}}}s.Seek2(_e);return extra};this.ReadClrScheme=function(clrscheme){var s=this.stream;var _e=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)clrscheme.setName(s.GetString2())}while(s.cur< _e){var _rec=s.GetUChar();clrscheme.addColor(_rec,this.ReadUniColor())}s.Seek2(_e)};this.ReadClrMap=function(clrmap){var s=this.stream;var _e=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;clrmap.setClr(_at,s.GetUChar())}s.Seek2(_e)};this.ReadClrOverride=function(){var s=this.stream;var _e=s.cur+s.GetULong()+4;var clr_map=null;if(s.cur<_e){clr_map=new AscFormat.ClrMap;s.Skip2(1);this.ReadClrMap(clr_map)}s.Seek2(_e);return clr_map};this.ReadLn=function(spPr){var ln= new AscFormat.CLn;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{ln.setAlgn(s.GetUChar());break}case 1:{ln.setCap(s.GetUChar());break}case 2:{ln.setCmpd(s.GetUChar());break}case 3:{ln.setW(s.GetLong());break}default:break}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{ln.setFill(this.ReadUniFill(spPr,null,ln));break}case 1:{ln.setPrstDash(this.ReadLineDash()); break}case 2:{ln.setJoin(this.ReadLineJoin());break}case 3:{ln.setHeadEnd(this.ReadLineEnd());break}case 4:{ln.setTailEnd(this.ReadLineEnd());break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return ln};this.ReadLineEnd=function(){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;var endL=new AscFormat.EndArrow;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{endL.setType(s.GetUChar());break}case 1:{endL.setW(s.GetUChar()); break}case 2:{endL.setLen(s.GetUChar());break}default:break}}s.Seek2(_end_rec);return endL};this.ReadLineDash=function(){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;var _dash=6;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{_dash=s.GetUChar();break}default:break}}s.Seek2(_end_rec);return _dash};this.ReadLineJoin=function(){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;var join=new AscFormat.LineJoin; s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{join.setType(s.GetLong());break}case 1:{join.setLimit(s.GetLong());break}default:break}}s.Seek2(_end_rec);return join};this.ReadSlideMaster=function(){var master=new MasterSlide(this.presentation,null);this.TempMainObject=master;var s=this.stream;s.Skip2(1);var end=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{master.preserve=s.GetBool(); break}default:break}}while(s.cur<end){var _rec=s.GetUChar();switch(_rec){case 0:{var cSld=new AscFormat.CSld;this.ReadCSld(cSld);for(var i=0;i<cSld.spTree.length;++i)master.shapeAdd(i,cSld.spTree[i]);if(cSld.Bg)master.changeBackground(cSld.Bg);master.setCSldName(cSld.name);break}case 1:{var clrMap=new AscFormat.ClrMap;this.ReadClrMap(clrMap);master.setClMapOverride(clrMap);break}case 2:case 3:case 4:{var _len=s.GetULong();s.Skip2(_len);break}case 5:{master.setHF(this.ReadHF());break}case 6:{master.setTxStyles(this.ReadTxStyles()); break}default:{s.SkipRecord();break}}}s.Seek2(end);this.TempMainObject=null;return master};this.ReadTxStyles=function(){var txStyles=new AscFormat.CTextStyles;var s=this.stream;var end=s.cur+s.GetULong()+4;while(s.cur<end){var _rec=s.GetUChar();switch(_rec){case 0:{txStyles.titleStyle=this.ReadTextListStyle();break}case 1:{txStyles.bodyStyle=this.ReadTextListStyle();break}case 2:{txStyles.otherStyle=this.ReadTextListStyle();break}default:{s.SkipRecord();break}}}s.Seek2(end);return txStyles};this.ReadSlideLayout= function(){var layout=new SlideLayout(null);this.TempMainObject=layout;var s=this.stream;s.Skip2(1);var end=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{layout.setMatchingName(s.GetString2());break}case 1:{layout.preserve=s.GetBool();break}case 2:{layout.setShowPhAnim(s.GetBool());break}case 3:{layout.setShowMasterSp(s.GetBool());break}case 4:{layout.userDrawn=s.GetBool();break}case 5:{layout.setType(s.GetUChar());break}default:break}}while(s.cur< end){var _rec=s.GetUChar();switch(_rec){case 0:{var cSld=new AscFormat.CSld;this.ReadCSld(cSld);for(var i=0;i<cSld.spTree.length;++i)layout.shapeAdd(i,cSld.spTree[i]);if(cSld.Bg)layout.changeBackground(cSld.Bg);layout.setCSldName(cSld.name);break}case 1:{layout.setClMapOverride(this.ReadClrOverride());break}case 4:{layout.setHF(this.ReadHF());break}default:{var _len=s.GetULong();s.Skip2(_len);break}}}s.Seek2(end);this.TempMainObject=null;return layout};this.ReadSlide=function(sldIndex){var slide= new Slide(this.presentation,null,sldIndex);this.TempMainObject=slide;slide.maxId=-1;var s=this.stream;s.Skip2(1);var end=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)slide.setShow(s.GetBool());else if(1==_at)slide.setShowPhAnim(s.GetBool());else if(2==_at)slide.setShowMasterSp(s.GetBool())}while(s.cur<end){var _rec=s.GetUChar();switch(_rec){case 0:{var cSld=new AscFormat.CSld;this.ReadCSld(cSld);for(var i=0;i<cSld.spTree.length;++i)slide.shapeAdd(i, cSld.spTree[i]);if(cSld.Bg)slide.changeBackground(cSld.Bg);slide.setCSldName(cSld.name);break}case 1:{slide.setClMapOverride(this.ReadClrOverride());break}case 2:{var _timing=this.ReadTransition();slide.applyTiming(_timing);break}case 4:{this.ReadComments(slide.writecomments);break}default:{var _len=s.GetULong();s.Skip2(_len);break}}}slide.Load_Comments(this.presentation.CommentAuthors);s.Seek2(end);this.TempMainObject=null;return slide};this.ReadComments=function(writecomments){var s=this.stream; var end2=s.cur+s.GetLong()+4;while(s.cur<end2){var _rec2=s.GetUChar();switch(_rec2){case 0:{s.Skip2(4);var lCount=s.GetULong();for(var i=0;i<lCount;i++){s.Skip2(1);var _comment=new AscCommon.CWriteCommentData;var _end_rec3=s.cur+s.GetLong()+4;s.Skip2(1);while(true){var _at3=s.GetUChar();if(_at3==g_nodeAttributeEnd)break;switch(_at3){case 0:_comment.WriteAuthorId=s.GetLong();break;case 1:_comment.WriteTime=s.GetString2();break;case 2:_comment.WriteCommentId=s.GetLong();break;case 3:_comment.x=s.GetLong(); break;case 4:_comment.y=s.GetLong();break;case 5:_comment.WriteText=s.GetString2();break;case 6:_comment.WriteParentAuthorId=s.GetLong();break;case 7:_comment.WriteParentCommentId=s.GetLong();break;case 8:_comment.AdditionalData=s.GetString2();break;default:break}}while(s.cur<_end_rec3){var _rec3=s.GetUChar();switch(_rec3){case 0:{var _end_rec4=s.cur+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 9:{_comment.timeZoneBias=s.GetLong();break}default:return}}s.Seek2(_end_rec4); break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec3);_comment.Calculate2();writecomments.push(_comment)}break}default:{s.SkipRecord();break}}}s.Seek2(end2)};this.ReadTransition=function(){var _timing=new CAscSlideTiming;_timing.setDefaultParams();var s=this.stream;var end=s.cur+s.GetULong()+4;if(s.cur==end)return _timing;s.Skip2(1);var _presentDuration=false;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)_timing.SlideAdvanceOnMouseClick=s.GetBool();else if(1==_at){_timing.SlideAdvanceAfter= true;_timing.SlideAdvanceDuration=s.GetULong()}else if(2==_at){_timing.TransitionDuration=s.GetULong();_presentDuration=true}else if(3==_at){var _spd=s.GetUChar();if(!_presentDuration){_timing.TransitionDuration=250;if(_spd==1)_timing.TransitionDuration=500;else if(_spd==2)_timing.TransitionDuration=750}}}while(s.cur<end){var _rec=s.GetUChar();switch(_rec){case 0:{var _type="";var _paramNames=[];var _paramValues=[];var _end_rec2=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at2=s.GetUChar();if(_at2== g_nodeAttributeEnd)break;switch(_at2){case 0:{_type=s.GetString2();break}case 1:{_paramNames.push(s.GetString2());break}case 2:{_paramValues.push(s.GetString2());break}default:break}}if(_paramNames.length==_paramValues.length&&_type!=""){var _len=_paramNames.length;if("p:fade"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Fade;_timing.TransitionOption=c_oAscSlideTransitionParams.Fade_Smoothly;if(1==_len&&_paramNames[0]=="thruBlk"&&_paramValues[0]=="1")_timing.TransitionOption=c_oAscSlideTransitionParams.Fade_Through_Black}else if("p:push"== _type){_timing.TransitionType=c_oAscSlideTransitionTypes.Push;_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Bottom;if(1==_len&&_paramNames[0]=="dir"){if("l"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Right;if("r"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Left;if("d"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Top}}else if("p:wipe"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Wipe; _timing.TransitionOption=c_oAscSlideTransitionParams.Param_Right;if(1==_len&&_paramNames[0]=="dir"){if("u"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Bottom;if("r"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Left;if("d"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Top}}else if("p:strips"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Wipe;_timing.TransitionOption=c_oAscSlideTransitionParams.Param_TopRight; if(1==_len&&_paramNames[0]=="dir"){if("rd"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_TopLeft;if("ru"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_BottomLeft;if("lu"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_BottomRight}}else if("p:cover"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Cover;_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Right;if(1==_len&&_paramNames[0]=="dir"){if("u"== _paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Bottom;if("r"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Left;if("d"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Top;if("rd"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_TopLeft;if("ru"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_BottomLeft;if("lu"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_BottomRight; if("ld"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_TopRight}}else if("p:pull"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.UnCover;_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Right;if(1==_len&&_paramNames[0]=="dir"){if("u"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Bottom;if("r"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_Left;if("d"==_paramValues[0])_timing.TransitionOption= c_oAscSlideTransitionParams.Param_Top;if("rd"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_TopLeft;if("ru"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_BottomLeft;if("lu"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_BottomRight;if("ld"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Param_TopRight}}else if("p:split"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Split;var _is_vert= true;var _is_out=true;for(var i=0;i<_len;i++)if(_paramNames[i]=="orient")_is_vert=_paramValues[i]=="vert"?true:false;else if(_paramNames[i]=="dir")_is_out=_paramValues[i]=="out"?true:false;if(_is_vert)if(_is_out)_timing.TransitionOption=c_oAscSlideTransitionParams.Split_VerticalOut;else _timing.TransitionOption=c_oAscSlideTransitionParams.Split_VerticalIn;else if(_is_out)_timing.TransitionOption=c_oAscSlideTransitionParams.Split_HorizontalOut;else _timing.TransitionOption=c_oAscSlideTransitionParams.Split_HorizontalIn}else if("p:wheel"== _type){_timing.TransitionType=c_oAscSlideTransitionTypes.Clock;_timing.TransitionOption=c_oAscSlideTransitionParams.Clock_Clockwise}else if("p14:wheelReverse"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Clock;_timing.TransitionOption=c_oAscSlideTransitionParams.Clock_Counterclockwise}else if("p:wedge"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Clock;_timing.TransitionOption=c_oAscSlideTransitionParams.Clock_Wedge}else if("p14:warp"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Zoom; _timing.TransitionOption=c_oAscSlideTransitionParams.Zoom_Out;if(1==_len&&_paramNames[0]=="dir")if("in"==_paramValues[0])_timing.TransitionOption=c_oAscSlideTransitionParams.Zoom_In}else if("p:newsflash"==_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Zoom;_timing.TransitionOption=c_oAscSlideTransitionParams.Zoom_AndRotate}else if("p:none"!=_type){_timing.TransitionType=c_oAscSlideTransitionTypes.Fade;_timing.TransitionOption=c_oAscSlideTransitionParams.Fade_Smoothly}}s.Seek2(_end_rec2); break}default:{s.SkipRecord();break}}}s.Seek2(end);return _timing};this.ReadHF=function(){var hf=new AscFormat.HF;var s=this.stream;var _e=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)hf.setDt(s.GetBool());else if(1==_at)hf.setFtr(s.GetBool());else if(2==_at)hf.setHdr(s.GetBool());else if(3==_at)hf.setSldNum(s.GetBool())}s.Seek2(_e);return hf};this.ReadNoteMaster=function(){var oNotesMaster=new AscCommonSlide.CNotesMaster;this.TempMainObject= oNotesMaster;this.stream.Skip2(1);var end=this.stream.cur+this.stream.GetLong()+4;while(this.stream.cur<end){var at=this.stream.GetUChar();switch(at){case 0:{var cSld=new AscFormat.CSld;this.ReadCSld(cSld);for(var i=0;i<cSld.spTree.length;++i)oNotesMaster.addToSpTreeToPos(i,cSld.spTree[i]);if(cSld.Bg)oNotesMaster.changeBackground(cSld.Bg);oNotesMaster.setCSldName(cSld.name);break}case 1:{this.ReadClrMap(oNotesMaster.clrMap);break}case 2:{oNotesMaster.setHF(this.ReadHF());break}case 3:{oNotesMaster.setNotesStyle(this.ReadTextListStyle()); break}default:{this.stream.SkipRecord();break}}}this.stream.Seek2(end);this.TempMainObject=null;return oNotesMaster};this.ReadNote=function(){var oNotes=new AscCommonSlide.CNotes;this.TempMainObject=oNotes;var _s=this.stream;_s.Skip2(1);var _end=_s.cur+_s.GetLong()+4;_s.Skip2(1);while(true){var _at=_s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)oNotes.setShowMasterPhAnim(_s.GetBool());else if(1==_at)oNotes.setShowMasterSp(_s.GetBool())}while(_s.cur<_end){var _rec=_s.GetUChar();switch(_rec){case 0:{var cSld= new AscFormat.CSld;this.ReadCSld(cSld);for(var i=0;i<cSld.spTree.length;++i)oNotes.addToSpTreeToPos(i,cSld.spTree[i]);if(cSld.Bg)oNotes.changeBackground(cSld.Bg);oNotes.setCSldName(cSld.name);break}case 1:{oNotes.setClMapOverride(this.ReadClrOverride());break}default:{_s.SkipRecord();break}}}this.TempMainObject=null;_s.Seek2(_end);return oNotes};this.ReadCSld=function(csld){var s=this.stream;var _end_rec=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break; if(0==_at)csld.name=s.GetString2();else break}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{csld.Bg=this.ReadBg();break}case 1:{this.ClearConnectorsMaps();csld.spTree=this.ReadGroupShapeMain();this.AssignConnectorsId();break}default:{s.Seek2(_end_rec);return}}}s.Seek2(_end_rec)};this.ReadBg=function(){var bg=new AscFormat.CBg;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0== _at)bg.bwMode=s.GetUChar();else break}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{bg.bgPr=this.ReadBgPr();break}case 1:{bg.bgRef=this.ReadStyleRef();break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return bg};this.ReadBgPr=function(){var bgpr=new AscFormat.CBgPr;var s=this.stream;var _end_rec=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)bgpr.shadeToTitle=s.GetBool();else break}while(s.cur<_end_rec){var _at=s.GetUChar(); switch(_at){case 0:{bgpr.Fill=this.ReadUniFill();break}case 1:{var _len=s.GetULong();s.Skip2(_len);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return bgpr};this.ReadStyleRef=function(){var ref=new AscFormat.StyleRef;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)ref.setIdx(s.GetLong());else break}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{ref.setColor(this.ReadUniColor()); break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return ref};this.ReadFontRef=function(){var ref=new AscFormat.FontRef;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)ref.setIdx(s.GetUChar());else break}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{ref.setColor(this.ReadUniColor());break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return ref};this.ReadTheme= function(){var theme=new AscFormat.CTheme;theme.presentation=this.presentation;var s=this.stream;var type=s.GetUChar();var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)theme.setName(s.GetString2());else if(1==_at)theme.setIsThemeOverride(s.GetBool());else break}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var themeElements=new AscFormat.ThemeElements;this.ReadThemeElements(themeElements); theme.setFontScheme(themeElements.fontScheme);theme.setFormatScheme(themeElements.fmtScheme);theme.setColorScheme(themeElements.clrScheme);break}case 1:{theme.setSpDef(this.ReadDefaultShapeProperties());break}case 2:{theme.setLnDef(this.ReadDefaultShapeProperties());break}case 3:{theme.setTxDef(this.ReadDefaultShapeProperties());break}case 4:{s.Skip2(4);var _len=s.GetULong();for(var i=0;i<_len;i++){s.Skip2(1);theme.extraClrSchemeLst[i]=this.ReadExtraColorScheme()}}}}s.Seek2(_end_rec);return theme}; this.ReadThemeElements=function(thelems){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{this.ReadClrScheme(thelems.clrScheme);break}case 1:{this.ReadFontScheme(thelems.fontScheme);break}case 2:{this.ReadFmtScheme(thelems.fmtScheme);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.ReadFontScheme=function(fontscheme){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4; s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)fontscheme.setName(s.GetString2());else break}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{this.ReadFontCollection(fontscheme.majorFont);break}case 1:{this.ReadFontCollection(fontscheme.minorFont);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.ReadFontCollection=function(fontcolls){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at= s.GetUChar();switch(_at){case 0:{fontcolls.setLatin(this.ReadTextFontTypeface());break}case 1:{fontcolls.setEA(this.ReadTextFontTypeface());break}case 2:{fontcolls.setCS(this.ReadTextFontTypeface());break}case 3:{var _len=s.GetULong();s.Skip2(_len);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.ReadTextFontTypeface=function(){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var charset="";var panose="";var pitchFamily="";var typeface="";s.Skip2(1);while(true){var _at= s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{charset=s.GetString2();break}case 1:{panose=s.GetString2();break}case 2:{pitchFamily=s.GetString2();break}case 3:{typeface=s.GetString2();break}default:break}}s.Seek2(_end_rec);return typeface};this.ReadFmtScheme=function(fmt){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)fmt.setName(s.GetString2());else break}while(s.cur< _end_rec){var _at=s.GetUChar();switch(_at){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(1);fmt.fillStyleLst[i]=this.ReadUniFill()}break}case 1:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(1);fmt.lnStyleLst[i]=this.ReadLn()}break}case 2:{var _len=s.GetULong();s.Skip2(_len);break}case 3:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(1);fmt.bgFillStyleLst[i]=this.ReadUniFill()}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.ReadDefaultShapeProperties= function(){var def=new AscFormat.DefaultShapeDefinition;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{this.ReadSpPr(def.spPr);break}case 1:{var _len=s.GetULong();s.Skip2(_len);break}case 2:{var _len=s.GetULong();s.Skip2(_len);break}case 3:{def.style=this.ReadShapeStyle();break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return def};this.ReadEffectLst=function(){var s=this.stream;s.GetULong();s.GetUChar(); var nRecStart=s.cur;var nRecLen=s.GetLong();var nRecEnd=nRecStart+nRecLen+4;var oEffectLst=new AscFormat.CEffectLst;while(s.cur<nRecEnd){var _at=s.GetUChar();switch(_at){case 0:{oEffectLst.blur=this.ReadBlur();break}case 1:{oEffectLst.fillOverlay=this.ReadFillOverlay();break}case 2:{oEffectLst.glow=this.ReadGlow();break}case 3:{oEffectLst.innerShdw=this.ReadInnerShdw();break}case 4:{oEffectLst.outerShdw=this.ReadOuterShdw();break}case 5:{oEffectLst.prstShdw=this.ReadPrstShdw();break}case 6:{oEffectLst.reflection= this.ReadReflection();break}case 7:{oEffectLst.softEdge=this.ReadSoftEdge();break}default:{s.SkipRecord();break}}}s.Seek2(nRecEnd);return oEffectLst};this.ReadEffectProperties=function(){var s=this.stream;var pos=s.cur;var nLength=s.GetLong();if(nLength===0)return null;var type=s.GetUChar();s.Seek2(pos);var oEffectProperties=new AscFormat.CEffectProperties;if(type===1)oEffectProperties.EffectLst=this.ReadEffectLst();else oEffectProperties.EffectDag=this.ReadEffectDag();return oEffectProperties};this.ReadSpPr= function(spPr){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)spPr.setBwMode(s.GetUChar());else break}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{spPr.setXfrm(this.ReadXfrm());spPr.xfrm.setParent(spPr);break}case 1:{var oGeometry=this.ReadGeometry(spPr.xfrm);if(oGeometry&&oGeometry.pathLst.length>0)spPr.setGeometry(oGeometry);break}case 2:{spPr.setFill(this.ReadUniFill(spPr, null,null));break}case 3:{spPr.setLn(this.ReadLn(spPr));break}case 4:{spPr.setEffectPr(this.ReadEffectProperties());break}case 5:{var _len=s.GetULong();s.Skip2(_len);break}case 6:{var _len=s.GetULong();s.Skip2(_len);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.ReadGrSpPr=function(spPr){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)spPr.setBwMode(s.GetUChar());else break}while(s.cur< _end_rec){var _at=s.GetUChar();switch(_at){case 0:{spPr.setXfrm(this.ReadXfrm());spPr.xfrm.setParent(spPr);break}case 1:{spPr.setFill(this.ReadUniFill(spPr,null,null));break}case 2:{var _len=s.GetULong();s.Skip2(_len);break}case 3:{var _len=s.GetULong();s.Skip2(_len);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.ReadXfrm=function(){var ret=new AscFormat.CXfrm;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at== g_nodeAttributeEnd)break;switch(_at){case 0:{ret.setOffX(s.GetLong()/c_dScalePPTXSizes);break}case 1:{ret.setOffY(s.GetLong()/c_dScalePPTXSizes);break}case 2:{ret.setExtX(s.GetLong()/c_dScalePPTXSizes);break}case 3:{ret.setExtY(s.GetLong()/c_dScalePPTXSizes);break}case 4:{ret.setChOffX(s.GetLong()/c_dScalePPTXSizes);break}case 5:{ret.setChOffY(s.GetLong()/c_dScalePPTXSizes);break}case 6:{ret.setChExtX(s.GetLong()/c_dScalePPTXSizes);break}case 7:{ret.setChExtY(s.GetLong()/c_dScalePPTXSizes);break}case 8:{ret.setFlipH(s.GetBool()); break}case 9:{ret.setFlipV(s.GetBool());break}case 10:{ret.setRot(s.GetLong()/6E4*Math.PI/180);break}default:break}}s.Seek2(_end_rec);return ret};this.ReadSignatureLine=function(){var ret=new AscFormat.CSignatureLine;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{s.GetString2();break}case 1:{s.GetBool();break}case 2:{s.GetUChar();break}case 3:{ret.id=s.GetString2();break}case 4:{s.GetBool(); break}case 5:{s.GetString2();break}case 6:{ret.showDate=s.GetBool();break}case 7:{ret.instructions=s.GetString2();break}case 8:{s.GetBool();break}case 9:{s.GetString2();break}case 10:{ret.signer=s.GetString2();break}case 11:{ret.signer2=s.GetString2();break}case 12:{ret.email=s.GetString2();break}default:break}}s.Seek2(_end_rec);return ret};this.ReadShapeStyle=function(){var def=new AscFormat.CShapeStyle;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at= s.GetUChar();switch(_at){case 0:{def.setLnRef(this.ReadStyleRef());break}case 1:{def.setFillRef(this.ReadStyleRef());break}case 2:{def.setEffectRef(this.ReadStyleRef());break}case 3:{def.setFontRef(this.ReadFontRef());break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return def};this.ReadOleInfo=function(ole){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);var dxaOrig=0;var dyaOrig=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{ole.setApplicationId(s.GetString2()); break}case 1:{ole.setData(s.GetString2());break}case 2:{dxaOrig=s.GetULong();break}case 3:{dyaOrig=s.GetULong();break}case 4:{s.GetUChar();break}case 5:{s.GetUChar();break}case 6:{s.GetUChar();break}case 7:{ole.setObjectFile(s.GetString2());break}default:{break}}}var oleType=null;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 1:{s.GetLong();oleType=s.GetUChar();ole.setOleType(oleType);break}case 2:{var binary_length;switch(oleType){case 0:{binary_length=s.GetULong();ole.setBinaryData(s.data.slice(s.cur, s.cur+binary_length));s.Seek2(s.cur+binary_length);break}case 1:{ole.setObjectFile("maskFile.docx");binary_length=s.GetULong();ole.setBinaryData(s.data.slice(s.cur,s.cur+binary_length));s.Seek2(s.cur+binary_length);break}case 2:{ole.setObjectFile("maskFile.xlsx");binary_length=s.GetULong();ole.setBinaryData(s.data.slice(s.cur,s.cur+binary_length));s.Seek2(s.cur+binary_length);break}case 4:{s.GetLong();var type2=s.GetUChar();s.SkipRecord();break}default:{s.SkipRecord();break}}break}default:{s.SkipRecord(); break}}}if(dxaOrig>0&&dyaOrig>0){var ratio=4/3/20;ole.setPixSizes(ratio*dxaOrig,ratio*dyaOrig)}s.Seek2(_end_rec)};this.ReadGeometry=function(_xfrm){var geom=null;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;if(s.cur<_end_rec){var _t=s.GetUChar();if(1==_t){var _len=s.GetULong();var _s=s.cur;var _e=_s+_len;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at){var tmpStr=s.GetString2();geom=AscFormat.CreateGeometry(tmpStr);geom.isLine= tmpStr=="line";geom.setPreset(tmpStr)}else break}while(s.cur<_e){var _at=s.GetUChar();switch(_at){case 0:{this.ReadGeomAdj(geom);break}default:{s.SkipRecord();break}}}}else if(2==_t){var _len=s.GetULong();var _s=s.cur;var _e=_s+_len;geom=AscFormat.CreateGeometry("");geom.preset=null;while(s.cur<_e){var _at=s.GetUChar();switch(_at){case 0:{this.ReadGeomAdj(geom);break}case 1:{this.ReadGeomGd(geom);break}case 2:{this.ReadGeomAh(geom);break}case 3:{this.ReadGeomCxn(geom);break}case 4:{this.ReadGeomPathLst(geom, _xfrm);break}case 5:{this.ReadGeomRect(geom);break}default:{s.SkipRecord();break}}}}}s.Seek2(_end_rec);return geom};this.ReadGeomAdj=function(geom){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(6);var arr=[];var cp=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(cp==1)arr[cp]=s.GetLong();else arr[cp]=s.GetString2();cp++}if(arr.length>=3)geom.AddAdj(arr[0],arr[1],arr[2])}s.Seek2(_end_rec)};this.ReadGeomGd= function(geom){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(6);var arr=[];var cp=0;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(cp==1)arr[cp]=s.GetLong();else arr[cp]=s.GetString2();cp++}geom.AddGuide(arr[0],arr[1],arr[2],arr[3],arr[4])}s.Seek2(_end_rec)};this.ReadGeomAh=function(geom){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var _c=s.GetULong();for(var i= 0;i<_c;i++){var _type1=s.GetUChar();s.Skip2(4);var _type=s.GetUChar();s.Skip2(5);var arr=[];while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;arr[_at]=s.GetString2()}if(1==_type)geom.AddHandlePolar(arr[2],arr[6],arr[4],arr[3],arr[7],arr[5],arr[0],arr[1]);else geom.AddHandleXY(arr[2],arr[6],arr[4],arr[3],arr[7],arr[5],arr[0],arr[1])}s.Seek2(_end_rec)};this.ReadGeomCxn=function(geom){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var _c=s.GetULong();for(var i= 0;i<_c;i++){var _type=s.GetUChar();s.Skip2(5);var arr=[];while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;arr[_at]=s.GetString2()}geom.AddCnx(arr[2],arr[0],arr[1])}s.Seek2(_end_rec)};this.ReadGeomRect=function(geom){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);var arr=[];arr[0]="l";arr[1]="t";arr[2]="r";arr[3]="b";while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;arr[_at]=s.GetString2()}geom.AddRect(arr[0],arr[1],arr[2], arr[3]);s.Seek2(_end_rec)};this.ReadGeomPathLst=function(geom,_xfrm){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var _c=s.GetULong();for(var i=0;i<_c;i++){var _type=s.GetUChar();var _len=s.GetULong();var _s=s.cur;var _e=_s+_len;s.Skip2(1);var extrusionOk=false;var fill=5;var stroke=true;var w=undefined;var h=undefined;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{extrusionOk=s.GetBool();break}case 1:{fill=s.GetUChar();break}case 2:{h= s.GetLong();break}case 3:{stroke=s.GetBool();break}case 4:{w=s.GetLong();break}default:break}}geom.AddPathCommand(0,extrusionOk,fill==4?"none":"norm",stroke,w,h);var isKoords=false;while(s.cur<_e){var _at=s.GetUChar();switch(_at){case 0:{s.Skip2(4);var _cc=s.GetULong();for(var j=0;j<_cc;j++){s.Skip2(5);isKoords|=this.ReadUniPath2D(geom)}break}default:{s.SkipRecord();break}}}s.Seek2(_e)}var _path=geom.pathLst[geom.pathLst.length-1];if(isKoords&&undefined===_path.pathW&&undefined===_path.pathH){_path.pathW= _xfrm.extX*c_dScalePPTXSizes;_path.pathH=_xfrm.extY*c_dScalePPTXSizes;if(_path.pathW!=undefined){_path.divPW=100/_path.pathW;_path.divPH=100/_path.pathH}}s.Seek2(_end_rec)};this.ReadUniPath2D=function(geom){var s=this.stream;var _type=s.GetUChar();var _len=s.GetULong();var _s=s.cur;var _e=_s+_len;if(3==_type){geom.AddPathCommand(6);s.Seek2(_e);return}s.Skip2(1);var isKoord=false;var arr=[];while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;arr[_at]=s.GetString2();if(!isKoord&&!isNaN(parseInt(arr[_at])))isKoord= true}switch(_type){case 1:{geom.AddPathCommand(1,arr[0],arr[1]);break}case 2:{geom.AddPathCommand(2,arr[0],arr[1]);break}case 3:{geom.AddPathCommand(6);break}case 4:{geom.AddPathCommand(5,arr[0],arr[1],arr[2],arr[3],arr[4],arr[5]);break}case 5:{geom.AddPathCommand(3,arr[0],arr[1],arr[2],arr[3]);break}case 6:{geom.AddPathCommand(4,arr[0],arr[1],arr[2],arr[3]);break}default:{s.SkipRecord();break}}s.Seek2(_e);return isKoord};this.ReadGraphicObject=function(){var s=this.stream;var _type=s.GetUChar(); var _object=null;switch(_type){case 1:{_object=this.ReadShape();break}case 2:case 6:case 7:case 8:{_object=this.ReadPic(_type);break}case 3:{_object=this.ReadCxn();break}case 4:{_object=this.ReadGroupShape();break}case 5:{_object=this.ReadGrFrame();break}default:{s.SkipRecord();break}}return _object};this.ReadShape=function(){var s=this.stream;var shape=new AscFormat.CShape(this.TempMainObject);if(null!=this.TempGroupObject)shape.Container=this.TempGroupObject;var _rec_start=s.cur;var _end_rec=_rec_start+ s.GetULong()+4;shape.setBDeleted(false);s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{shape.attrUseBgFill=s.GetBool();break}default:break}}var txXfrm=null;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var pr=this.ReadNvUniProp(shape);shape.setNvSpPr(pr);if(AscFormat.isRealNumber(pr.locks))shape.setLocks(pr.locks);break}case 1:{var sp_pr=new AscFormat.CSpPr;this.ReadSpPr(sp_pr);shape.setSpPr(sp_pr);sp_pr.setParent(shape);break}case 2:{shape.setStyle(this.ReadShapeStyle()); break}case 3:{shape.setTxBody(this.ReadTextBody(shape));shape.txBody.setParent(shape);break}case 6:{txXfrm=this.ReadXfrm();break}case 7:{shape.setSignature(this.ReadSignatureLine());break}default:{s.SkipRecord();break}}}if(txXfrm&&AscFormat.isRealNumber(txXfrm.rot)&&shape.txBody){var oCopyBodyPr;var rot2=txXfrm.rot;while(rot2<0)rot2+=2*Math.PI;var nSquare=2*rot2/Math.PI+.5>>0;while(nSquare<0)nSquare+=4;switch(nSquare){case 0:{oCopyBodyPr=shape.txBody.bodyPr?shape.txBody.bodyPr.createDuplicate():new AscFormat.CBodyPr; oCopyBodyPr.rot=rot2/AscFormat.cToRad+.5>>0;shape.txBody.setBodyPr(oCopyBodyPr);break}case 1:{oCopyBodyPr=shape.txBody.bodyPr?shape.txBody.bodyPr.createDuplicate():new AscFormat.CBodyPr;oCopyBodyPr.vert=AscFormat.nVertTTvert;shape.txBody.setBodyPr(oCopyBodyPr);break}case 2:{oCopyBodyPr=shape.txBody.bodyPr?shape.txBody.bodyPr.createDuplicate():new AscFormat.CBodyPr;oCopyBodyPr.rot=rot2/AscFormat.cToRad+.5>>0;shape.txBody.setBodyPr(oCopyBodyPr);break}case 3:{oCopyBodyPr=shape.txBody.bodyPr?shape.txBody.bodyPr.createDuplicate(): new AscFormat.CBodyPr;oCopyBodyPr.vert=AscFormat.nVertTTvert270;shape.txBody.setBodyPr(oCopyBodyPr);break}}}s.Seek2(_end_rec);return shape};this.CheckGroupXfrm=function(oGroup){if(!oGroup||!oGroup.spPr)return;if(!oGroup.spPr.xfrm&&oGroup.spTree.length>0){var oXfrm=new AscFormat.CXfrm;oXfrm.setOffX(0);oXfrm.setOffY(0);oXfrm.setChOffX(0);oXfrm.setChOffY(0);oXfrm.setExtX(50);oXfrm.setExtY(50);oXfrm.setChExtX(50);oXfrm.setChExtY(50);oGroup.spPr.setXfrm(oXfrm);oGroup.updateCoordinatesAfterInternalResize(); oGroup.spPr.xfrm.setParent(oGroup.spPr)}};this.ReadGroupShape=function(type){var s=this.stream;var shape;if(type===9)shape=new AscFormat.CLockedCanvas;else shape=new AscFormat.CGroupShape;shape.setBDeleted(false);this.TempGroupObject=shape;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var pr=this.ReadNvUniProp(shape);shape.setNvSpPr(pr);if(AscFormat.isRealNumber(pr.locks))shape.setLocks(pr.locks);break}case 1:{var spPr=new AscFormat.CSpPr; this.ReadGrSpPr(spPr);shape.setSpPr(spPr);spPr.setParent(shape);break}case 2:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(1);var __len=s.GetULong();if(__len==0)continue;var _type=s.GetUChar();var _object=null;switch(_type){case 1:{_object=this.ReadShape();if(!IsHiddenObj(_object)&&_object.spPr&&_object.spPr.xfrm){shape.addToSpTree(shape.spTree.length,_object);shape.spTree[shape.spTree.length-1].setGroup(shape)}break}case 6:case 2:case 7:case 8:{_object=this.ReadPic(_type);if(!IsHiddenObj(_object)&& _object.spPr&&_object.spPr.xfrm){shape.addToSpTree(shape.spTree.length,_object);shape.spTree[shape.spTree.length-1].setGroup(shape)}break}case 3:{_object=this.ReadCxn();if(!IsHiddenObj(_object)&&_object.spPr&&_object.spPr.xfrm){shape.addToSpTree(shape.spTree.length,_object);shape.spTree[shape.spTree.length-1].setGroup(shape)}break}case 4:{_object=this.ReadGroupShape();if(!IsHiddenObj(_object)&&_object.spPr&&_object.spPr.xfrm&&_object.spTree.length>0){shape.addToSpTree(shape.spTree.length,_object); shape.spTree[shape.spTree.length-1].setGroup(shape);this.TempGroupObject=shape}break}case 5:{var _ret=null;if("undefined"!=typeof AscFormat.CGraphicFrame)_ret=this.ReadGrFrame();else _ret=this.ReadChartDataInGroup(shape);if(null!=_ret){shape.addToSpTree(shape.spTree.length,_ret);shape.spTree[shape.spTree.length-1].setGroup(shape)}break}default:{s.SkipRecord();break}}}break}default:{s.SkipRecord();break}}}this.CheckGroupXfrm(shape);s.Seek2(_end_rec);this.TempGroupObject=null;return shape};this.ReadGroupShapeMain= function(){var s=this.stream;var shapes=[];var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(5);while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var _len=s.GetULong();s.Skip2(_len);break}case 1:{var _len=s.GetULong();s.Skip2(_len);break}case 2:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(1);var __len=s.GetULong();if(__len==0)continue;var _type=s.GetUChar();switch(_type){case 1:{var _object=this.ReadShape();if(!IsHiddenObj(_object)){shapes[shapes.length]= _object;_object.setParent2(this.TempMainObject)}break}case 6:case 2:case 7:case 8:{var _object=this.ReadPic(_type);if(!IsHiddenObj(_object)){shapes[shapes.length]=_object;_object.setParent2(this.TempMainObject)}break}case 3:{var _object=this.ReadCxn();if(!IsHiddenObj(_object)){shapes[shapes.length]=_object;_object.setParent2(this.TempMainObject)}break}case 4:{var _object=this.ReadGroupShape();if(!IsHiddenObj(_object)){shapes[shapes.length]=_object;_object.setParent2(this.TempMainObject)}break}case 5:{var _ret= this.ReadGrFrame();if(null!=_ret){shapes[shapes.length]=_ret;_ret.setParent2(this.TempMainObject)}break}default:{s.SkipRecord();break}}}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return shapes};this.ReadPic=function(type){var s=this.stream;var isOle=type===6;var pic=isOle?new AscFormat.COleObject(this.TempMainObject):new AscFormat.CImageShape(this.TempMainObject);pic.setBDeleted(false);var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var sMaskFileName;while(s.cur<_end_rec){var _at= s.GetUChar();switch(_at){case 0:{var pr=this.ReadNvUniProp(pic);pic.setNvSpPr(pr);if(AscFormat.isRealNumber(pr.locks))pic.setLocks(pr.locks);break}case 1:{pic.setBlipFill(this.ReadUniFill(null,pic,null).fill);break}case 2:{var spPr=new AscFormat.CSpPr;spPr.setParent(pic);this.ReadSpPr(spPr);pic.setSpPr(spPr);break}case 3:{pic.setStyle(this.ReadShapeStyle());break}case 4:{if(isOle)this.ReadOleInfo(pic);else s.SkipRecord();break}case 5:{if(type===7||type===8){s.GetLong();s.GetUChar();while(true){var _at2= s.GetUChar();if(_at2==g_nodeAttributeEnd)break;switch(_at2){case 0:{sMaskFileName=s.GetString2();break}case 1:{s.GetBool();break}default:{break}}}}else s.SkipRecord();break}default:{this.stream.SkipRecord();break}}}if(type===7||type===8)if(typeof sMaskFileName==="string"&&sMaskFileName.length>0&&pic.nvPicPr&&pic.nvPicPr.nvPr){var oUniMedia=new AscFormat.UniMedia;oUniMedia.type=type;oUniMedia.media=sMaskFileName;pic.nvPicPr.nvPr.setUniMedia(oUniMedia)}s.Seek2(_end_rec);return pic};this.ReadCxn=function(){var s= this.stream;var shape=new AscFormat.CConnectionShape;shape.setBDeleted(false);var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var pr=this.ReadNvUniProp(shape);shape.setNvSpPr(pr);if(AscFormat.isRealNumber(pr.locks))shape.setLocks(pr.locks);break}case 1:{var spPr=new AscFormat.CSpPr;spPr.setParent(shape);this.ReadSpPr(spPr);shape.setSpPr(spPr);break}case 2:{shape.setStyle(this.ReadShapeStyle());break}default:{s.SkipRecord(); break}}}this.arr_connectors.push(shape);s.Seek2(_end_rec);return shape};this.ReadChartDataInGroup=function(group){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;this.TempGroupObject=group;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{var spid=s.GetString2();break}default:break}}var _nvGraphicFramePr=null;var _xfrm=null;var _chart=null;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{_nvGraphicFramePr=this.ReadNvUniProp(AscFormat.ExecuteNoHistory(function(){return new AscFormat.CGraphicFrame}, this,[]));break}case 1:{_xfrm=this.ReadXfrm();break}case 2:{s.SkipRecord();break}case 3:{var _length=s.GetLong();var _pos=s.cur;var _stream=new AscCommon.FT_Stream2;_stream.data=s.data;_stream.pos=s.pos;_stream.cur=s.cur;_stream.size=s.size;_chart=new AscFormat.CChartSpace;_chart.setBDeleted(false);var oBinaryChartReader=new AscCommon.BinaryChartReader(_stream);oBinaryChartReader.ExternalReadCT_ChartSpace(_length,_chart,this.presentation);_chart.setBDeleted(false);if(AscCommon.isRealObject(_nvGraphicFramePr)&& AscFormat.isRealNumber(_nvGraphicFramePr.locks))_chart.setLocks(_nvGraphicFramePr.locks);if(_xfrm){if(!_chart.spPr){_chart.setSpPr(new AscFormat.CSpPr);_chart.spPr.setParent(_chart)}_chart.spPr.setXfrm(_xfrm);_xfrm.setParent(_chart.spPr)}s.Seek2(_pos+_length);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);this.TempGroupObject=null;if(_chart==null)return null;return _chart};this.ReadGrFrame=function(){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var _graphic_frame= new AscFormat.CGraphicFrame;_graphic_frame.setParent2(this.TempMainObject);this.TempGroupObject=_graphic_frame;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{var spid=s.GetString2();break}default:break}}var _nvGraphicFramePr=null;var _xfrm=null;var _table=null;var _chart=null;var _slicer=null;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{_nvGraphicFramePr=this.ReadNvUniProp(_graphic_frame);break}case 1:{_xfrm=this.ReadXfrm();break}case 2:{_table= this.ReadTable(_xfrm,_graphic_frame);break}case 3:{var _length=s.GetLong();var _pos=s.cur;if(typeof AscFormat.CChartSpace!=="undefined"&&_length){var _stream=new AscCommon.FT_Stream2;_stream.data=s.data;_stream.pos=s.pos;_stream.cur=s.cur;_stream.size=s.size;_chart=new AscFormat.CChartSpace;_chart.setBDeleted(false);AscCommon.pptx_content_loader.ImageMapChecker=this.ImageMapChecker;AscCommon.pptx_content_loader.Reader.ImageMapChecker=this.ImageMapChecker;var oBinaryChartReader=new AscCommon.BinaryChartReader(_stream); oBinaryChartReader.ExternalReadCT_ChartSpace(_length,_chart,this.presentation)}s.Seek2(_pos+_length);break}case 5:case 6:{if(typeof AscFormat.CSlicer!=="undefined"){_slicer=new AscFormat.CSlicer;_slicer.fromStream(s)}else s.SkipRecord();break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);this.TempGroupObject=null;if(_table==null&&_chart==null&&_slicer==null)return null;if(_table!=null){if(!_graphic_frame.spPr){_graphic_frame.setSpPr(new AscFormat.CSpPr);_graphic_frame.spPr.setParent(_graphic_frame)}if(!_xfrm){_xfrm= new AscFormat.CXfrm;_xfrm.setOffX(0);_xfrm.setOffY(0);_xfrm.setExtX(0);_xfrm.setExtY(0)}_graphic_frame.spPr.setXfrm(_xfrm);_xfrm.setParent(_graphic_frame.spPr);_graphic_frame.setSpPr(_graphic_frame.spPr);_graphic_frame.setNvSpPr(_nvGraphicFramePr);if(AscCommon.isRealObject(_nvGraphicFramePr)&&AscFormat.isRealNumber(_nvGraphicFramePr.locks))_graphic_frame.setLocks(_nvGraphicFramePr.locks);_graphic_frame.setGraphicObject(_table);_graphic_frame.setBDeleted(false)}else if(_chart!=null){if(!_chart.spPr){_chart.setSpPr(new AscFormat.CSpPr); _chart.spPr.setParent(_chart)}if(!_xfrm){_xfrm=new AscFormat.CXfrm;_xfrm.setOffX(0);_xfrm.setOffY(0);_xfrm.setExtX(0);_xfrm.setExtY(0)}if(AscCommon.isRealObject(_nvGraphicFramePr)){_chart.setNvSpPr(_nvGraphicFramePr);if(AscFormat.isRealNumber(_nvGraphicFramePr.locks))_chart.setLocks(_nvGraphicFramePr.locks)}this.map_shapes_by_id[_nvGraphicFramePr.cNvPr.id]=_chart;_chart.spPr.setXfrm(_xfrm);_xfrm.setParent(_chart.spPr);return _chart}else if(_slicer!=null){_slicer.setBDeleted(false);if(!_slicer.spPr){_slicer.setSpPr(new AscFormat.CSpPr); _slicer.spPr.setParent(_slicer)}if(!_xfrm){_xfrm=new AscFormat.CXfrm;_xfrm.setOffX(0);_xfrm.setOffY(0);_xfrm.setExtX(0);_xfrm.setExtY(0)}_slicer.spPr.setXfrm(_xfrm);_xfrm.setParent(_slicer.spPr);if(AscCommon.isRealObject(_nvGraphicFramePr)){_slicer.setNvSpPr(_nvGraphicFramePr);if(AscFormat.isRealNumber(_nvGraphicFramePr.locks))_slicer.setLocks(_nvGraphicFramePr.locks)}return _slicer}return _graphic_frame};this.ReadNvUniProp=function(drawing){var prop=new AscFormat.UniNvPr;var s=this.stream;var _rec_start= s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{this.ReadCNvPr(prop.cNvPr);if(AscCommon.isRealObject(drawing))this.map_shapes_by_id[prop.cNvPr.id]=drawing;break}case 1:{var end=s.cur+s.GetULong()+4;var locks=0;if(AscCommon.isRealObject(drawing)){var drawingType=drawing.getObjectType();switch(drawingType){case AscDFH.historyitem_type_Shape:{s.Skip2(1);while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;var value;switch(_at2){case 1:{value= s.GetBool();locks|=AscFormat.LOCKS_MASKS.noAdjustHandles|(value?AscFormat.LOCKS_MASKS.noAdjustHandles<<1:0);break}case 2:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeArrowheads|(value?AscFormat.LOCKS_MASKS.noChangeArrowheads<<1:0);break}case 3:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeAspect|(value?AscFormat.LOCKS_MASKS.noChangeAspect<<1:0);break}case 4:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeShapeType|(value?AscFormat.LOCKS_MASKS.noChangeShapeType<<1:0);break}case 5:{value= s.GetBool();locks|=AscFormat.LOCKS_MASKS.noEditPoints|(value?AscFormat.LOCKS_MASKS.noEditPoints<<1:0);break}case 6:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noGrp|(value?AscFormat.LOCKS_MASKS.noGrp<<1:0);break}case 7:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noMove|(value?AscFormat.LOCKS_MASKS.noMove<<1:0);break}case 8:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noResize|(value?AscFormat.LOCKS_MASKS.noResize<<1:0);break}case 9:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noRot| (value?AscFormat.LOCKS_MASKS.noRot<<1:0);break}case 10:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noSelect|(value?AscFormat.LOCKS_MASKS.noSelect<<1:0);break}case 11:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noTextEdit|(value?AscFormat.LOCKS_MASKS.noTextEdit<<1:0);break}}}prop.locks=locks;break}case AscDFH.historyitem_type_GroupShape:{s.Skip2(1);while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;var value;switch(_at2){case 0:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeAspect| (value?AscFormat.LOCKS_MASKS.noChangeAspect<<1:0);break}case 1:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noGrp|(value?AscFormat.LOCKS_MASKS.noGrp<<1:0);break}case 2:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noMove|(value?AscFormat.LOCKS_MASKS.noMove<<1:0);break}case 3:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noResize|(value?AscFormat.LOCKS_MASKS.noResize<<1:0);break}case 4:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noRot|(value?AscFormat.LOCKS_MASKS.noRot<<1:0);break}case 5:{value= s.GetBool();locks|=AscFormat.LOCKS_MASKS.noSelect|(value?AscFormat.LOCKS_MASKS.noSelect<<1:0);break}case 6:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noUngrp|(value?AscFormat.LOCKS_MASKS.noUngrp<<1:0);break}}}prop.locks=locks;break}case AscDFH.historyitem_type_ImageShape:{s.Skip2(1);while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;var value;switch(_at2){case 0:{value=s.GetBool();break}case 1:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noAdjustHandles|(value?AscFormat.LOCKS_MASKS.noAdjustHandles<< 1:0);break}case 2:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeArrowheads|(value?AscFormat.LOCKS_MASKS.noChangeArrowheads<<1:0);break}case 3:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeAspect|(value?AscFormat.LOCKS_MASKS.noChangeAspect<<1:0);break}case 4:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeShapeType|(value?AscFormat.LOCKS_MASKS.noChangeShapeType<<1:0);break}case 5:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noCrop|(value?AscFormat.LOCKS_MASKS.noCrop<< 1:0);break}case 6:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noEditPoints|(value?AscFormat.LOCKS_MASKS.noEditPoints<<1:0);break}case 7:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noGrp|(value?AscFormat.LOCKS_MASKS.noGrp<<1:0);break}case 8:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noMove|(value?AscFormat.LOCKS_MASKS.noMove<<1:0);break}case 9:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noResize|(value?AscFormat.LOCKS_MASKS.noResize<<1:0);break}case 10:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noRot| (value?AscFormat.LOCKS_MASKS.noRot<<1:0);break}case 11:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noSelect|(value?AscFormat.LOCKS_MASKS.noSelect<<1:0);break}}}prop.locks=locks;break}case AscDFH.historyitem_type_GraphicFrame:case AscDFH.historyitem_type_ChartSpace:{s.Skip2(1);while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;var value;switch(_at2){case 0:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeAspect|(value?AscFormat.LOCKS_MASKS.noChangeAspect<<1:0);break}case 1:{value= s.GetBool();locks|=AscFormat.LOCKS_MASKS.noDrilldown|(value?AscFormat.LOCKS_MASKS.noDrilldown<<1:0);break}case 2:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noGrp|(value?AscFormat.LOCKS_MASKS.noGrp<<1:0);break}case 3:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noMove|(value?AscFormat.LOCKS_MASKS.noMove<<1:0);break}case 4:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noResize|(value?AscFormat.LOCKS_MASKS.noResize<<1:0);break}case 5:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noSelect| (value?AscFormat.LOCKS_MASKS.noSelect<<1:0);break}}}prop.locks=locks;break}case AscDFH.historyitem_type_Cnx:{s.Skip2(1);while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;var value;switch(_at2){case 0:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noAdjustHandles|(value?AscFormat.LOCKS_MASKS.noAdjustHandles<<1:0);break}case 1:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeArrowheads|(value?AscFormat.LOCKS_MASKS.noChangeArrowheads<<1:0);break}case 2:{value=s.GetBool();locks|= AscFormat.LOCKS_MASKS.noChangeAspect|(value?AscFormat.LOCKS_MASKS.noChangeAspect<<1:0);break}case 3:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noChangeShapeType|(value?AscFormat.LOCKS_MASKS.noChangeShapeType<<1:0);break}case 4:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noEditPoints|(value?AscFormat.LOCKS_MASKS.noEditPoints<<1:0);break}case 5:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noGrp|(value?AscFormat.LOCKS_MASKS.noGrp<<1:0);break}case 6:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noMove| (value?AscFormat.LOCKS_MASKS.noMove<<1:0);break}case 7:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noResize|(value?AscFormat.LOCKS_MASKS.noResize<<1:0);break}case 8:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noRot|(value?AscFormat.LOCKS_MASKS.noRot<<1:0);break}case 9:{value=s.GetBool();locks|=AscFormat.LOCKS_MASKS.noSelect|(value?AscFormat.LOCKS_MASKS.noSelect<<1:0);break}case 10:{prop.nvUniSpPr.stCnxId=s.GetULong();break}case 11:{prop.nvUniSpPr.stCnxIdx=s.GetULong();break}case 12:{prop.nvUniSpPr.endCnxId= s.GetULong();break}case 13:{prop.nvUniSpPr.endCnxIdx=s.GetULong();break}}}prop.locks=locks;prop.setUniSpPr(prop.nvUniSpPr.copy());break}}}s.Seek2(end);break}case 2:{this.ReadNvPr(prop.nvPr);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return prop};this.ReadCNvPr=function(cNvPr){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{cNvPr.setId(s.GetLong());if(this.TempMainObject&& cNvPr.id>this.TempMainObject.maxId)this.TempMainObject.maxId=cNvPr.id;break}case 1:{cNvPr.setName(s.GetString2());break}case 2:{cNvPr.setIsHidden(1==s.GetUChar()?true:false);break}case 3:{cNvPr.setTitle(s.GetString2());break}case 4:{cNvPr.setDescr(s.GetString2());break}default:{break}}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{cNvPr.setHlinkClick(this.ReadHyperlink());break}case 1:{cNvPr.setHlinkHover(this.ReadHyperlink());break}default:{this.stream.SkipRecord();break}}}s.Seek2(_end_rec)}; this.ReadTable=function(_xfrm,_graphic_frame){if(_xfrm==null){this.stream.SkipRecord();return null}var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var cols=null;var rows=null;var _return_to_rows=0;var props=null;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{props=this.ReadTablePr();break}case 1:{s.Skip2(4);var _len=s.GetULong();cols=new Array(_len);for(var i=0;i<_len;i++){s.Skip2(7);cols[i]=s.GetULong()/36E3;s.Skip2(1)}break}case 2:{var _end_rec2=s.cur+ s.GetULong()+4;rows=s.GetULong();_return_to_rows=s.cur;s.Seek2(_end_rec2);break}default:{s.SkipRecord();break}}}if(cols.length===0)cols.push(_xfrm.extX);var _table=new CTable(this.presentation.DrawingDocument,_graphic_frame,true,rows,cols.length,cols,true);_table.Reset(0,0,_xfrm.extX,1E5,0,0,1);if(null!=props){var style;if(this.map_table_styles[props.style])_table.Set_TableStyle(this.map_table_styles[props.style].Id);_table.Set_Pr(props.props);_table.Set_TableLook(props.look)}_table.SetTableLayout(tbllayout_Fixed); s.Seek2(_return_to_rows);for(var i=0;i<rows;i++){s.Skip2(1);this.ReadTableRow(_table.Content[i])}s.Seek2(_end_rec);return _table};this.ReadTableRow=function(row){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);var fMaxTopMargin=0,fMaxBottomMargin=0,fMaxTopBorder=0,fMaxBottomBorder=0;var fRowHeight=5;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{fRowHeight=s.GetULong()/36E3;break}default:break}}s.Skip2(5);var _count=s.GetULong(); _count=Math.min(_count,row.Content.length);for(var i=0;i<_count;i++){s.Skip2(1);var bIsNoHMerge=this.ReadCell(row.Content[i]);if(bIsNoHMerge===false){row.Remove_Cell(i);i--;_count--}var _gridCol=1;if("number"==typeof row.Content[i].Pr.GridSpan)_gridCol=row.Content[i].Pr.GridSpan;if(_gridCol>_count-i){_gridCol=_count-i;row.Content[i].Pr.GridSpan=_gridCol;if(1==row.Content[i].Pr.GridSpan)row.Content[i].Pr.GridSpan=undefined}_gridCol--;while(_gridCol>0){i++;if(i>=_count)break;s.Skip2(1);this.ReadCell(row.Content[i]); row.Remove_Cell(i);i--;_count--;--_gridCol}}if(this.presentation&&Array.isArray(this.presentation.Slides)){var bLoadVal=AscCommon.g_oIdCounter.m_bLoad;var bRead=AscCommon.g_oIdCounter.m_bRead;AscCommon.g_oIdCounter.m_bLoad=false;AscCommon.g_oIdCounter.m_bRead=false;for(i=0;i<row.Content.length;++i){var oCell=row.Content[i];var oMargins=oCell.GetMargins();if(oMargins.Bottom.W>fMaxBottomMargin)fMaxBottomMargin=oMargins.Bottom.W;if(oMargins.Top.W>fMaxTopMargin)fMaxTopMargin=oMargins.Top.W;var oBorders= oCell.Get_Borders();if(oBorders.Top.Size>fMaxTopBorder)fMaxTopBorder=oBorders.Top.Size;if(oBorders.Bottom.Size>fMaxBottomBorder)fMaxBottomBorder=oBorders.Bottom.Size}AscCommon.g_oIdCounter.m_bLoad=bLoadVal;AscCommon.g_oIdCounter.m_bRead=bRead;row.Set_Height(Math.max(1,fRowHeight-fMaxTopMargin-fMaxBottomMargin-fMaxTopBorder/2-fMaxBottomBorder/2),Asc.linerule_AtLeast)}s.Seek2(_end_rec)};this.ReadCell=function(cell){cell.Content.Internal_Content_RemoveAll();var s=this.stream;var _rec_start=s.cur;var _end_rec= _rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{var _id=s.GetString2();break}case 1:{var rowSpan=s.GetULong();if(1<rowSpan)cell.SetVMerge(vmerge_Restart);break}case 2:{cell.Set_GridSpan(s.GetULong());break}case 3:{var bIsHMerge=s.GetBool();if(bIsHMerge){s.Seek2(_end_rec);return false}break}case 4:{var bIsVMerge=s.GetBool();if(bIsVMerge&&cell.Pr.VMerge!=vmerge_Restart)cell.SetVMerge(vmerge_Continue);break}default:break}}while(s.cur< _end_rec){var _at=s.GetUChar();switch(_at){case 0:{var props=new CTableCellPr;this.ReadCellProps(props);props.Merge(cell.Pr);cell.Set_Pr(props);break}case 1:{this.ReadTextBody2(cell.Content);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return true};this.ReadCellProps=function(props){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{if(props.TableCellMar==null)props.TableCellMar= {};props.TableCellMar.Left=new CTableMeasurement(tblwidth_Mm,s.GetULong()/36E3);break}case 1:{if(props.TableCellMar==null)props.TableCellMar={};props.TableCellMar.Top=new CTableMeasurement(tblwidth_Mm,s.GetULong()/36E3);break}case 2:{if(props.TableCellMar==null)props.TableCellMar={};props.TableCellMar.Right=new CTableMeasurement(tblwidth_Mm,s.GetULong()/36E3);break}case 3:{if(props.TableCellMar==null)props.TableCellMar={};props.TableCellMar.Bottom=new CTableMeasurement(tblwidth_Mm,s.GetULong()/36E3); break}case 4:{s.Skip2(1);break}case 5:{var nVert=s.GetUChar();switch(nVert){case 0:props.TextDirection=Asc.c_oAscCellTextDirection.TBRL;break;case 1:props.TextDirection=Asc.c_oAscCellTextDirection.LRTB;break;case 2:props.TextDirection=Asc.c_oAscCellTextDirection.TBRL;break;case 3:props.TextDirection=Asc.c_oAscCellTextDirection.TBRL;break;case 4:props.TextDirection=Asc.c_oAscCellTextDirection.BTLR;break;case 5:props.TextDirection=Asc.c_oAscCellTextDirection.BTLR;break;case 6:props.TextDirection=Asc.c_oAscCellTextDirection.TBRL; break;default:props.TextDirection=Asc.c_oAscCellTextDirection.LRTB;break}break}case 6:{var nVertAlign=s.GetUChar();switch(nVertAlign){case 0:{props.VAlign=vertalignjc_Bottom;break}case 1:case 2:case 3:{props.VAlign=vertalignjc_Center;break}case 4:{props.VAlign=vertalignjc_Top;break}}break}case 7:{s.Skip2(1);break}default:break}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{if(!props.TableCellBorders)props.TableCellBorders={};props.TableCellBorders.Left=this.ReadTableBorderLn();break}case 1:{if(!props.TableCellBorders)props.TableCellBorders= {};props.TableCellBorders.Top=this.ReadTableBorderLn();break}case 2:{if(!props.TableCellBorders)props.TableCellBorders={};props.TableCellBorders.Right=this.ReadTableBorderLn();break}case 3:{if(!props.TableCellBorders)props.TableCellBorders={};props.TableCellBorders.Bottom=this.ReadTableBorderLn();break}case 4:{s.SkipRecord();break}case 5:{s.SkipRecord();break}case 6:{var _unifill=this.ReadUniFill();if(_unifill&&_unifill.fill!==undefined&&_unifill.fill!=null){props.Shd=new CDocumentShd;props.Shd.Value= c_oAscShdClear;props.Shd.Unifill=_unifill}break}case 7:{s.SkipRecord();break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.ReadTableBorderLn=function(){var ln=this.ReadLn();var border=new CDocumentBorder;if(ln.Fill)border.Unifill=ln.Fill;border.Size=ln.w==null?12700:ln.w>>0;border.Size/=36E3;border.Value=border_Single;return border};this.ReadTablePr=function(){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);var obj={};obj.props=new CTablePr;obj.look= new CTableLook(false,false,false,false,false,false);obj.style=-1;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{obj.style=s.GetString2();break}case 1:{s.Skip2(1);break}case 2:{obj.look.m_bFirst_Row=s.GetBool();break}case 3:{obj.look.m_bFirst_Col=s.GetBool();break}case 4:{obj.look.m_bLast_Row=s.GetBool();break}case 5:{obj.look.m_bLast_Col=s.GetBool();break}case 6:{obj.look.m_bBand_Hor=s.GetBool();break}case 7:{obj.look.m_bBand_Ver=s.GetBool();break}default:break}}while(s.cur< _end_rec){var _at=s.GetUChar();switch(_at){case 0:{var _unifill=this.ReadUniFill();if(_unifill&&_unifill.fill!==undefined&&_unifill.fill!=null){obj.props.Shd=new CDocumentShd;obj.props.Shd.Value=c_oAscShdClear;obj.props.Shd.Unifill=_unifill}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return obj};this.ReadNvPr=function(nvPr){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{nvPr.setIsPhoto(s.GetBool()); break}case 1:{nvPr.setUserDrawn(s.GetBool());break}default:break}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{nvPr.setPh(this.ReadPH());break}case 1:{nvPr.setUniMedia(new AscFormat.UniMedia);var _len=s.GetULong();s.Skip2(_len);break}default:{var _len=s.GetULong();s.Skip2(_len);break}}}s.Seek2(_end_rec)};this.ReadPH=function(){var ph=new AscFormat.Ph;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at== g_nodeAttributeEnd)break;switch(_at){case 0:{ph.setHasCustomPrompt(s.GetBool());break}case 1:{ph.setIdx(s.GetString2());break}case 2:{ph.setOrient(s.GetUChar());break}case 3:{ph.setSz(s.GetUChar());break}case 4:{ph.setType(s.GetUChar());break}default:break}}s.Seek2(_end_rec);return ph};this.ReadRunProperties=function(){var rPr=new CTextPr;var s=this.stream;var _end_rec=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{var altLang= s.GetString2();break}case 1:{rPr.Bold=s.GetBool();break}case 2:{var baseline=s.GetLong();if(baseline<0)rPr.VertAlign=AscCommon.vertalign_SubScript;else if(baseline>0)rPr.VertAlign=AscCommon.vertalign_SuperScript;break}case 3:{var bmk=s.GetString2();break}case 4:{var _cap=s.GetUChar();if(_cap==0){rPr.Caps=true;rPr.SmallCaps=false}else if(_cap==1){rPr.Caps=false;rPr.SmallCaps=true}else if(_cap==2){rPr.SmallCaps=false;rPr.Caps=false}break}case 5:{s.Skip2(1);break}case 6:{s.Skip2(1);break}case 7:{rPr.Italic= s.GetBool();break}case 8:{s.Skip2(4);break}case 9:{s.Skip2(1);break}case 10:{var lang=s.GetString2();var nLcid=Asc.g_oLcidNameToIdMap[lang];if(nLcid)rPr.Lang.Val=nLcid;break}case 11:{s.Skip2(1);break}case 12:{s.Skip2(1);break}case 13:{s.Skip2(1);break}case 14:{s.Skip2(4);break}case 15:{rPr.Spacing=s.GetLong()*25.4/7200;break}case 16:{var _strike=s.GetUChar();if(0==_strike){rPr.Strikeout=false;rPr.DStrikeout=true}else if(2==_strike){rPr.Strikeout=true;rPr.DStrikeout=false}else{rPr.Strikeout=false; rPr.DStrikeout=false}break}case 17:{var _size=s.GetLong()/100;_size=_size*2+.5>>0;_size/=2;rPr.FontSize=_size;break}case 18:{rPr.Underline=s.GetUChar()!=12;break}default:break}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{rPr.TextOutline=this.ReadLn();break}case 1:{var oUniFill=this.ReadUniFill();if(oUniFill&&oUniFill.fill)rPr.Unifill=oUniFill;break}case 2:{s.SkipRecord();break}case 3:{rPr.RFonts.Ascii={Name:this.ReadTextFontTypeface(),Index:-1};rPr.RFonts.HAnsi={Name:rPr.RFonts.Ascii.Name, Index:-1};break}case 4:{rPr.RFonts.EastAsia={Name:this.ReadTextFontTypeface(),Index:-1};break}case 5:{rPr.RFonts.CS={Name:this.ReadTextFontTypeface(),Index:-1};break}case 6:{s.SkipRecord();break}case 7:{rPr.hlink=this.ReadHyperlink();if(null==rPr.hlink)delete rPr.hlink;break}case 8:{s.SkipRecord();break}case 12:{var end_rec__=s.cur+s.GetULong()+4;s.Skip2(1);var at__;while(true){at__=s.GetUChar();if(at__===g_nodeAttributeEnd)break}while(s.cur<end_rec__){at__=s.GetUChar();switch(at__){case 0:{rPr.HighlightColor= this.ReadUniColor();break}default:{break}}}s.Seek2(end_rec__);break}default:{s.SkipRecord()}}}s.Seek2(_end_rec);return rPr};this.ReadHyperlink=function(){var hyper=new AscFormat.CT_Hyperlink;var s=this.stream;var _end_rec=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{hyper.id=s.GetString2();break}case 1:{hyper.invalidUrl=s.GetString2();break}case 2:{hyper.action=s.GetString2();break}case 3:{hyper.tgtFrame=s.GetString2();break}case 4:{hyper.tooltip= s.GetString2();break}case 5:{hyper.history=s.GetBool();break}case 6:{hyper.highlightClick=s.GetBool();break}case 7:{hyper.endSnd=s.GetBool();break}default:break}}s.Seek2(_end_rec);if(hyper.action!=null&&hyper.action!="")if(hyper.action=="ppaction://hlinkshowjump?jump=firstslide")hyper.id="ppaction://hlinkshowjump?jump=firstslide";else if(hyper.action=="ppaction://hlinkshowjump?jump=lastslide")hyper.id="ppaction://hlinkshowjump?jump=lastslide";else if(hyper.action=="ppaction://hlinkshowjump?jump=nextslide")hyper.id= "ppaction://hlinkshowjump?jump=nextslide";else if(hyper.action=="ppaction://hlinkshowjump?jump=previousslide")hyper.id="ppaction://hlinkshowjump?jump=previousslide";else if(hyper.action=="ppaction://hlinksldjump")if(hyper.id!=null&&hyper.id.indexOf("slide")==0){var _url=hyper.id.substring(5);var _indexXml=_url.indexOf(".");if(-1!=_indexXml)_url=_url.substring(0,_indexXml);var _slideNum=parseInt(_url);if(isNaN(_slideNum))_slideNum=1;--_slideNum;hyper.id=hyper.action+"slide"+_slideNum}else hyper.id= null;else hyper.id=null;if(hyper.id==null)return null;return hyper};this.CorrectBodyPr=function(bodyPr){var s=this.stream;var _end_rec=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{bodyPr.flatTx=s.GetLong();break}case 1:{bodyPr.anchor=s.GetUChar();break}case 2:{bodyPr.anchorCtr=s.GetBool();break}case 3:{bodyPr.bIns=s.GetLong()/36E3;break}case 4:{bodyPr.compatLnSpc=s.GetBool();break}case 5:{bodyPr.forceAA=s.GetBool();break}case 6:{bodyPr.fromWordArt= s.GetBool();break}case 7:{bodyPr.horzOverflow=s.GetUChar();break}case 8:{bodyPr.lIns=s.GetLong()/36E3;break}case 9:{bodyPr.numCol=s.GetLong();break}case 10:{bodyPr.rIns=s.GetLong()/36E3;break}case 11:{bodyPr.rot=s.GetLong();break}case 12:{bodyPr.rtlCol=s.GetBool();break}case 13:{bodyPr.spcCol=s.GetLong()/36E3;break}case 14:{bodyPr.spcFirstLastPara=s.GetBool();break}case 15:{bodyPr.tIns=s.GetLong()/36E3;break}case 16:{bodyPr.upright=s.GetBool();break}case 17:{bodyPr.vert=s.GetUChar();if(bodyPr.vert=== AscFormat.nVertTTwordArtVert)bodyPr.vert=AscFormat.nVertTTvert;break}case 18:{bodyPr.vertOverflow=s.GetUChar();break}case 19:{bodyPr.wrap=s.GetUChar();break}default:break}}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var _end_rec3=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;switch(_at2){case 0:{var sPrst=s.GetUChar();bodyPr.prstTxWarp=AscFormat.ExecuteNoHistory(function(){return AscFormat.CreatePrstTxWarpGeometry(AscFormat.getPrstByNumber(sPrst))}, this,[]);break}}}while(s.cur<_end_rec3){var _at=s.GetUChar();switch(_at){case 0:{this.ReadGeomAdj(bodyPr.prstTxWarp);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec3);break}case 1:{var _end_rec2=s.cur+s.GetULong()+4;s.Skip2(1);var txFit=new AscFormat.CTextFit;txFit.type=-1;while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;switch(_at2){case 0:{txFit.type=s.GetLong()-1;break}case 1:{txFit.fontScale=s.GetLong();break}case 2:{txFit.lnSpcReduction=s.GetLong();break}default:break}}if(txFit.type!= -1)bodyPr.textFit=txFit;s.Seek2(_end_rec2);break}default:{s.SkipRecord()}}}s.Seek2(_end_rec)};this.ReadBodyPr=function(){var bodyPr=new AscFormat.CBodyPr;this.CorrectBodyPr(bodyPr);return bodyPr};this.ReadTextParagraphPr=function(par){var para_pr=new CParaPr;var s=this.stream;var _end_rec=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{var _align=s.GetUChar();switch(_align){case 0:{para_pr.Jc=AscCommon.align_Center;break}case 1:{para_pr.Jc= AscCommon.align_Justify;break}case 2:{para_pr.Jc=AscCommon.align_Justify;break}case 3:{para_pr.Jc=AscCommon.align_Justify;break}case 4:{para_pr.Jc=AscCommon.align_Left;break}case 5:{para_pr.Jc=AscCommon.align_Right;break}case 6:{para_pr.Jc=AscCommon.align_Justify;break}default:para_pr.Jc=AscCommon.align_Center;break}break}case 1:{para_pr.DefaultTab=s.GetLong()/36E3;break}case 2:{s.Skip2(1);break}case 3:{s.Skip2(1);break}case 4:{s.Skip2(1);break}case 5:{para_pr.Ind.FirstLine=s.GetLong()/36E3;break}case 6:{s.Skip2(1); break}case 7:{para_pr.Lvl=s.GetLong();break}case 8:{para_pr.Ind.Left=s.GetLong()/36E3;break}case 9:{para_pr.Ind.Right=s.GetLong()/36E3;break}case 10:{s.Skip2(1);break}default:break}}var bullet=new AscFormat.CBullet;var b_bullet=false;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{s.Skip2(5);var Pts=null;var Pct=null;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{Pct=s.GetLong();para_pr.Spacing.Line=Pct/1E5;para_pr.Spacing.LineRule=Asc.linerule_Auto; break}case 1:{Pts=s.GetLong();para_pr.Spacing.Line=Pts*.00352777778;para_pr.Spacing.LineRule=Asc.linerule_Exact;break}default:break}}break}case 1:{s.Skip2(5);var Pts=null;var Pct=null;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{Pct=s.GetLong();para_pr.Spacing.After=0;para_pr.Spacing.AfterPct=Pct;break}case 1:{Pts=s.GetLong();para_pr.Spacing.After=Pts*.00352777778;break}default:break}}break}case 2:{s.Skip2(5);var Pts=null;var Pct=null;while(true){var _at=s.GetUChar(); if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{Pct=s.GetLong();para_pr.Spacing.Before=0;para_pr.Spacing.BeforePct=Pct;break}case 1:{Pts=s.GetLong();para_pr.Spacing.Before=Pts*.00352777778;break}default:break}}break}case 3:{var cur_pos=s.cur;var _len=s.GetULong();if(0!=_len){b_bullet=true;bullet.bulletColor=new AscFormat.CBulletColor;bullet.bulletColor.type=s.GetUChar();if(bullet.bulletColor.type==AscFormat.BULLET_TYPE_COLOR_CLRTX)s.SkipRecord();else{var _l=s.GetULong();if(0!==_l){s.Skip2(1); bullet.bulletColor.UniColor=this.ReadUniColor()}}}s.Seek2(cur_pos+_len+4);break}case 4:{var cur_pos=s.cur;var _len=s.GetULong();if(0!=_len){b_bullet=true;bullet.bulletSize=new AscFormat.CBulletSize;bullet.bulletSize.type=s.GetUChar();if(bullet.bulletSize.type==AscFormat.BULLET_TYPE_SIZE_TX)s.SkipRecord();else{var _l=s.GetULong();s.Skip2(2);bullet.bulletSize.val=s.GetLong();s.Skip2(1)}}s.Seek2(cur_pos+_len+4);break}case 5:{var cur_pos=s.cur;var _len=s.GetULong();if(0!=_len){b_bullet=true;bullet.bulletTypeface= new AscFormat.CBulletTypeface;bullet.bulletTypeface.type=s.GetUChar();if(bullet.bulletTypeface.type==AscFormat.BULLET_TYPE_TYPEFACE_BUFONT)bullet.bulletTypeface.typeface=this.ReadTextFontTypeface();else s.SkipRecord()}s.Seek2(cur_pos+_len+4);break}case 6:{var cur_pos=s.cur;var _len=s.GetULong();if(0!=_len){b_bullet=true;bullet.bulletType=new AscFormat.CBulletType;bullet.bulletType.type=s.GetUChar();if(bullet.bulletType.type==AscFormat.BULLET_TYPE_BULLET_NONE)s.SkipRecord();else if(bullet.bulletType.type== AscFormat.BULLET_TYPE_BULLET_BLIP)s.SkipRecord();else if(bullet.bulletType.type==AscFormat.BULLET_TYPE_BULLET_AUTONUM){s.Skip2(5);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{bullet.bulletType.AutoNumType=s.GetUChar();break}case 1:{bullet.bulletType.startAt=s.GetLong();break}default:break}}}else if(bullet.bulletType.type==AscFormat.BULLET_TYPE_BULLET_CHAR){s.Skip2(6);bullet.bulletType.Char=s.GetString2();AscFonts.FontPickerByCharacter.getFontsByString(bullet.bulletType.Char); s.Skip2(1)}}s.Seek2(cur_pos+_len+4);break}case 7:{s.Skip2(4);var _c=s.GetULong();if(0!=_c){para_pr.Tabs=new CParaTabs;var _value,_pos;for(var i=0;i<_c;i++){s.Skip2(6);_value=null;_pos=null;while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{_value=s.GetUChar();if(_value==0)_value=tab_Center;else if(_value==3)_value=tab_Right;else _value=tab_Left;break}case 1:{_pos=s.GetLong()/36E3;break}default:break}}para_pr.Tabs.Add(new CParaTab(_value,_pos))}}break}case 8:{var OldBlipCount= 0;if(this.IsUseFullUrl&&par)OldBlipCount=this.RebuildImages.length;var r_pr=this.ReadRunProperties();if(r_pr){para_pr.DefaultRunPr=new CTextPr;if(r_pr.Unifill&&!r_pr.Unifill.fill)r_pr.Unifill=undefined;para_pr.DefaultRunPr.Set_FromObject(r_pr);if(this.IsUseFullUrl&&par)if(this.RebuildImages.length>OldBlipCount)for(var _t=OldBlipCount;_t<this.RebuildImages.length;++_t){var oTextPr=new CTextPr;oTextPr.Set_FromObject(r_pr);this.RebuildImages[_t].TextPr=oTextPr;this.RebuildImages[_t].Paragraph=par}}break}default:{s.SkipRecord()}}}if(b_bullet)para_pr.Bullet= bullet;s.Seek2(_end_rec);return para_pr};this.ReadTextListStyle=function(){var styles=new AscFormat.TextListStyle;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();styles.levels[_at]=this.ReadTextParagraphPr()}s.Seek2(_end_rec);return styles};this.ReadTextBody=function(shape){var txbody;if(shape)if(shape.txBody)txbody=shape.txBody;else{txbody=new AscFormat.CTextBody;txbody.setParent(shape)}else txbody=new AscFormat.CTextBody;var s= this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{txbody.setBodyPr(this.ReadBodyPr());break}case 1:{txbody.setLstStyle(this.ReadTextListStyle());break}case 2:{s.Skip2(4);var _c=s.GetULong();txbody.setContent(new AscFormat.CDrawingDocContent(txbody,this.DrawingDocument,0,0,0,0,0,0,true));if(_c>0)txbody.content.Internal_Content_RemoveAll();for(var i=0;i<_c;i++){s.Skip2(1);var _paragraph=this.ReadParagraph(txbody.content); _paragraph.Correct_Content();txbody.content.Internal_Content_Add(txbody.content.Content.length,_paragraph)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return txbody};this.ReadTextBodyTxPr=function(shape){var txbody;if(shape.txPr)txbody=shape.txPr;else{shape.txPr=new AscFormat.CTextBody;txbody=shape.txPr}var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{shape.setBodyPr(this.ReadBodyPr());break}case 1:{txbody.setLstStyle(this.ReadTextListStyle()); break}case 2:{s.Skip2(4);var _c=s.GetULong();if(!txbody.content)txbody.content=new AscFormat.CDrawingDocContent(shape,this.DrawingDocument,0,0,0,0,0,0,true);if(_c>0)txbody.content.Internal_Content_RemoveAll();for(var i=0;i<_c;i++){s.Skip2(1);var _paragraph=this.ReadParagraph(txbody.content);_paragraph.Set_Parent(txbody.content);txbody.content.Internal_Content_Add(txbody.content.Content.length,_paragraph)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return txbody};this.ReadTextBody2=function(content){var s= this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var oBodyPr;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{s.SkipRecord();break}case 1:{s.SkipRecord();break}case 2:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(1);var _paragraph=this.ReadParagraph(content);content.Internal_Content_Add(content.Content.length,_paragraph)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.ReadParagraph=function(DocumentContent){var par=new Paragraph(DocumentContent.DrawingDocument, DocumentContent,true);var EndPos=0;var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{par.Set_Pr(this.ReadTextParagraphPr(par));break}case 1:{var OldImgCount=0;if(this.IsUseFullUrl)OldImgCount=this.RebuildImages.length;var endRunPr=this.ReadRunProperties();var _value_text_pr=new CTextPr;if(endRunPr.Unifill&&!endRunPr.Unifill.fill)endRunPr.Unifill=undefined;_value_text_pr.Set_FromObject(endRunPr);par.TextPr.Apply_TextPr(_value_text_pr); var oTextPrEnd=new CTextPr;oTextPrEnd.Set_FromObject(endRunPr);par.Content[0].Set_Pr(oTextPrEnd);if(this.IsUseFullUrl)if(this.RebuildImages.length>OldImgCount)for(var _t=OldImgCount;_t<this.RebuildImages.length;++_t){var _text_pr=new CTextPr;_text_pr.Set_FromObject(endRunPr);this.RebuildImages[_t].TextPr=_text_pr;this.RebuildImages[_t].ParaTextPr=par.TextPr;this.RebuildImages[_t].Run=par.Content[0]}break}case 2:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(5);var _type=s.GetUChar(); switch(_type){case AscFormat.PARRUN_TYPE_RUN:{var _end=s.cur+s.GetULong()+4;s.Skip2(1);var _text="";while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)_text=s.GetString2()}var OldImgCount=0;if(this.IsUseFullUrl)OldImgCount=this.RebuildImages.length;var _run=null;while(s.cur<_end){var _rec=s.GetUChar();if(0==_rec)_run=this.ReadRunProperties();else s.SkipRecord()}s.Seek2(_end);var new_run=new ParaRun(par,false),hyperlink=null;if(null!=_run){var text_pr=new CTextPr;if(_run.Unifill&& !_run.Unifill.fill)_run.Unifill=undefined;if(_run.hlink!==undefined){hyperlink=new ParaHyperlink;hyperlink.SetValue(_run.hlink.id);if(_run.hlink.tooltip)hyperlink.SetToolTip(_run.hlink.tooltip);_run.Underline=true}text_pr.Set_FromObject(_run);new_run.Set_Pr(text_pr);if(this.IsUseFullUrl)if(this.RebuildImages.length>OldImgCount)for(var _t=OldImgCount;_t<this.RebuildImages.length;++_t){var _text_pr=new CTextPr;_text_pr.Set_FromObject(text_pr);this.RebuildImages[_t].TextPr=_text_pr;this.RebuildImages[_t].Run= new_run}}new_run.AddText(_text);if(hyperlink!==null){hyperlink.Add_ToContent(0,new_run,false);par.Internal_Content_Add(EndPos++,hyperlink)}else par.Internal_Content_Add(EndPos++,new_run);break}case AscFormat.PARRUN_TYPE_FLD:{var _end=s.cur+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;if(0==_at)var f_id=s.GetString2();else if(1==_at)var f_type=s.GetString2();else var f_text=s.GetString2()}var _rPr=null,_pPr=null;while(s.cur<_end){var _at2=s.GetUChar(); switch(_at2){case 0:{_rPr=this.ReadRunProperties();break}case 1:{_pPr=this.ReadTextParagraphPr();break}default:{s.SkipRecord();break}}}var Fld=new AscCommonWord.CPresentationField(par);if(f_id)Fld.SetGuid(f_id);if(f_type)Fld.SetFieldType(f_type);if(f_text)Fld.AddText(f_text);if(_rPr)Fld.SetPr(_rPr);if(_pPr)Fld.SetPPr(_pPr);par.Internal_Content_Add(EndPos++,new ParaRun(par,false));par.Internal_Content_Add(EndPos++,Fld);par.Internal_Content_Add(EndPos++,new ParaRun(par,false));s.Seek2(_end);this.fields.push(Fld); break}case AscFormat.PARRUN_TYPE_BR:{var _end=s.cur+s.GetULong()+4;var _run=null;while(s.cur<_end){var _rec=s.GetUChar();if(0==_rec)_run=this.ReadRunProperties();else s.SkipRecord()}s.Seek2(_end);var new_run=new ParaRun(par,false),hyperlink=null;if(null!=_run){if(_run.hlink!==undefined){hyperlink=new ParaHyperlink;hyperlink.SetValue(_run.hlink.id);if(_run.hlink.tooltip)hyperlink.SetToolTip(_run.hlink.tooltip)}var text_pr=new CTextPr;if(_run.Unifill&&!_run.Unifill.fill)_run.Unifill=undefined;text_pr.Set_FromObject(_run); new_run.Set_Pr(text_pr)}new_run.Add_ToContent(0,new ParaNewLine(break_Line));if(hyperlink!==null){hyperlink.Add_ToContent(0,new_run,false);par.Internal_Content_Add(EndPos++,hyperlink)}else par.Internal_Content_Add(EndPos++,new_run);break}case AscFormat.PARRUN_TYPE_MATHPARA:case AscFormat.PARRUN_TYPE_MATH:{var _end=s.cur+s.GetULong()+4;var _stream=new AscCommon.FT_Stream2;_stream.data=s.data;_stream.pos=s.pos;_stream.cur=s.cur;_stream.size=s.size;var parContentOld=par.Content.length;var oParStruct= new OpenParStruct(par,par);oParStruct.cur.pos=par.Content.length-1;var oReadResult=new AscCommonWord.DocReadResult(null);var boMathr=new Binary_oMathReader(_stream,oReadResult,null);var nDocLength=_stream.GetULongLE();if(AscFormat.PARRUN_TYPE_MATHPARA==_type){var props={};boMathr.bcr.Read1(nDocLength,function(t,l){return boMathr.ReadMathOMathPara(t,l,oParStruct,props)})}else{var oMath=new ParaMath;oParStruct.addToContent(oMath);boMathr.bcr.Read1(nDocLength,function(t,l){return boMathr.ReadMathArg(t, l,oMath.Root,oParStruct)});oMath.Root.Correct_Content(true)}s.Seek2(_end);EndPos+=par.Content.length-parContentOld;break}default:{s.SkipRecord();break}}}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return par}}function CApp(){this.Template=null;this.TotalTime=null;this.Words=null;this.Application=null;this.PresentationFormat=null;this.Paragraphs=null;this.Slides=null;this.Notes=null;this.HiddenSlides=null;this.MMClips=null;this.ScaleCrop=null;this.HeadingPairs=[];this.TitlesOfParts=[]; this.Company=null;this.LinksUpToDate=null;this.SharedDoc=null;this.HyperlinksChanged=null;this.AppVersion=null;this.Characters=null;this.CharactersWithSpaces=null;this.DocSecurity=null;this.HyperlinkBase=null;this.Lines=null;this.Manager=null;this.Pages=null}CApp.prototype.fromStream=function(s){var _type=s.GetUChar();var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;var _sa=s.GetUChar();while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{this.Template= s.GetString2();break}case 1:{this.Application=s.GetString2();break}case 2:{this.PresentationFormat=s.GetString2();break}case 3:{this.Company=s.GetString2();break}case 4:{this.AppVersion=s.GetString2();break}case 5:{this.TotalTime=s.GetLong();break}case 6:{this.Words=s.GetLong();break}case 7:{this.Paragraphs=s.GetLong();break}case 8:{this.Slides=s.GetLong();break}case 9:{this.Notes=s.GetLong();break}case 10:{this.HiddenSlides=s.GetLong();break}case 11:{this.MMClips=s.GetLong();break}case 12:{this.ScaleCrop= s.GetBool();break}case 13:{this.LinksUpToDate=s.GetBool();break}case 14:{this.SharedDoc=s.GetBool();break}case 15:{this.HyperlinksChanged=s.GetBool();break}default:return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{var _end_rec2=s.cur+s.GetLong()+4;s.Skip2(1);while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 16:{this.Characters=s.GetLong();break}case 17:{this.CharactersWithSpaces=s.GetLong();break}case 18:{this.DocSecurity=s.GetLong(); break}case 19:{this.HyperlinkBase=s.GetString2();break}case 20:{this.Lines=s.GetLong();break}case 21:{this.Manager=s.GetString2();break}case 22:{this.Pages=s.GetLong();break}default:return}}s.Seek2(_end_rec2);break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CApp.prototype.toStream=function(s){s.StartRecord(AscCommon.c_oMainTables.App);s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.Template);s._WriteString2(2,this.PresentationFormat);s._WriteString2(3,this.Company);s._WriteBool2(12, this.ScaleCrop);s._WriteBool2(13,this.LinksUpToDate);s._WriteBool2(14,this.SharedDoc);s._WriteBool2(15,this.HyperlinksChanged);s.WriteUChar(g_nodeAttributeEnd);s.StartRecord(0);s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteInt2(18,this.DocSecurity);s._WriteString2(19,this.HyperlinkBase);s._WriteString2(21,this.Manager);s.WriteUChar(g_nodeAttributeEnd);s.EndRecord();s.EndRecord()};CApp.prototype.asc_getTemplate=function(){return this.Template};CApp.prototype.asc_getTotalTime=function(){return this.TotalTime}; CApp.prototype.asc_getWords=function(){return this.Words};CApp.prototype.asc_getApplication=function(){return this.Application};CApp.prototype.asc_getPresentationFormat=function(){return this.PresentationFormat};CApp.prototype.asc_getParagraphs=function(){return this.Paragraphs};CApp.prototype.asc_getSlides=function(){return this.Slides};CApp.prototype.asc_getNotes=function(){return this.Notes};CApp.prototype.asc_getHiddenSlides=function(){return this.HiddenSlides};CApp.prototype.asc_getMMClips=function(){return this.MMClips}; CApp.prototype.asc_getScaleCrop=function(){return this.ScaleCrop};CApp.prototype.asc_getCompany=function(){return this.Company};CApp.prototype.asc_getLinksUpToDate=function(){return this.LinksUpToDate};CApp.prototype.asc_getSharedDoc=function(){return this.SharedDoc};CApp.prototype.asc_getHyperlinksChanged=function(){return this.HyperlinksChanged};CApp.prototype.asc_getAppVersion=function(){return this.AppVersion};CApp.prototype.asc_getCharacters=function(){return this.Characters};CApp.prototype.asc_getCharactersWithSpaces= function(){return this.CharactersWithSpaces};CApp.prototype.asc_getDocSecurity=function(){return this.DocSecurity};CApp.prototype.asc_getHyperlinkBase=function(){return this.HyperlinkBase};CApp.prototype.asc_getLines=function(){return this.Lines};CApp.prototype.asc_getManager=function(){return this.Manager};CApp.prototype.asc_getPages=function(){return this.Pages};function CChangesCorePr(Class,Old,New,Color){AscDFH.CChangesBase.call(this,Class,Old,New,Color);if(Old&&New){this.OldTitle=Old.title;this.OldCreator= Old.creator;this.OldDescription=Old.description;this.OldSubject=Old.subject;this.NewTitle=New.title===Old.title?undefined:New.title;this.NewCreator=New.creator===Old.creator?undefined:New.creator;this.NewDescription=New.description===Old.description?undefined:New.description;this.NewSubject=New.subject===Old.subject?undefined:New.subject}else{this.OldTitle=undefined;this.OldCreator=undefined;this.OldDescription=undefined;this.OldSubject=undefined;this.NewTitle=undefined;this.NewCreator=undefined; this.NewDescription=undefined;this.NewSubject=undefined}}CChangesCorePr.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesCorePr.prototype.constructor=CChangesCorePr;CChangesCorePr.prototype.Type=AscDFH.historyitem_CoreProperties;CChangesCorePr.prototype.Undo=function(){if(!this.Class)return;this.Class.title=this.OldTitle;this.Class.creator=this.OldCreator;this.Class.description=this.OldDescription;this.Class.subject=this.OldSubject};CChangesCorePr.prototype.Redo=function(){if(!this.Class)return; if(this.NewTitle!==undefined)this.Class.title=this.NewTitle;if(this.NewCreator!==undefined)this.Class.creator=this.NewCreator;if(this.NewDescription!==undefined)this.Class.description=this.NewDescription;if(this.NewSubject!==undefined)this.Class.subject=this.NewSubject};CChangesCorePr.prototype.WriteToBinary=function(Writer){var nFlags=0;if(undefined!==this.NewTitle)nFlags|=1;if(undefined!==this.NewCreator)nFlags|=2;if(undefined!==this.NewDescription)nFlags|=4;if(undefined!==this.NewSubject)nFlags|= 8;Writer.WriteLong(nFlags);var bIsField;if(nFlags&1){bIsField=typeof this.NewTitle==="string";Writer.WriteBool(bIsField);if(bIsField)Writer.WriteString2(this.NewTitle)}if(nFlags&2){bIsField=typeof this.NewCreator==="string";Writer.WriteBool(bIsField);if(bIsField)Writer.WriteString2(this.NewCreator)}if(nFlags&4){bIsField=typeof this.NewDescription==="string";Writer.WriteBool(bIsField);if(bIsField)Writer.WriteString2(this.NewDescription)}if(nFlags&8){bIsField=typeof this.NewSubject==="string";Writer.WriteBool(bIsField); if(bIsField)Writer.WriteString2(this.NewSubject)}};CChangesCorePr.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();var bIsField;if(nFlags&1){bIsField=Reader.GetBool();if(bIsField)this.NewTitle=Reader.GetString2();else this.NewTitle=null}if(nFlags&2){bIsField=Reader.GetBool();if(bIsField)this.NewCreator=Reader.GetString2();else this.NewCreator=null}if(nFlags&4){bIsField=Reader.GetBool();if(bIsField)this.NewDescription=Reader.GetString2();else this.NewDescription=null}if(nFlags& 8){bIsField=Reader.GetBool();if(bIsField)this.NewSubject=Reader.GetString2();else this.NewSubject=null}};CChangesCorePr.prototype.CreateReverseChange=function(){var ret=new CChangesCorePr(this.Class);ret.OldTitle=this.NewTitle;ret.OldCreator=this.NewCreator;ret.OldDescription=this.NewCreator;ret.OldSubject=this.NewSubject;ret.NewTitle=this.OldTitle;ret.NewCreator=this.OldCreator;ret.NewDescription=this.OldCreator;ret.NewSubject=this.OldSubject;return ret};AscDFH.changesFactory[AscDFH.historyitem_CoreProperties]= CChangesCorePr;function CCore(){this.category=null;this.contentStatus=null;this.created=null;this.creator=null;this.description=null;this.identifier=null;this.keywords=null;this.language=null;this.lastModifiedBy=null;this.lastPrinted=null;this.modified=null;this.revision=null;this.subject=null;this.title=null;this.version=null;this.Id=AscCommon.g_oIdCounter.Get_NewId();this.Lock=new AscCommon.CLock;this.lockType=AscCommon.c_oAscLockTypes.kLockTypeNone;AscCommon.g_oTableId.Add(this,this.Id)}CCore.prototype.fromStream= function(s){var _type=s.GetUChar();var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;var _sa=s.GetUChar();while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{this.title=s.GetString2();break}case 1:{this.creator=s.GetString2();break}case 2:{this.lastModifiedBy=s.GetString2();break}case 3:{this.revision=s.GetString2();break}case 4:{this.created=this.readDate(s.GetString2());break}case 5:{this.modified=this.readDate(s.GetString2());break}default:return}}while(true){if(s.cur>= _end_pos)break;_type=s.GetUChar();switch(_type){case 0:{var _end_rec2=s.cur+s.GetLong()+4;s.Skip2(1);while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 6:{this.category=s.GetString2();break}case 7:{this.contentStatus=s.GetString2();break}case 8:{this.description=s.GetString2();break}case 9:{this.identifier=s.GetString2();break}case 10:{this.keywords=s.GetString2();break}case 11:{this.language=s.GetString2();break}case 12:{this.lastPrinted=this.readDate(s.GetString2()); break}case 13:{this.subject=s.GetString2();break}case 14:{this.version=s.GetString2();break}default:return}}s.Seek2(_end_rec2);break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CCore.prototype.readDate=function(val){val=new Date(val);return val instanceof Date&&!isNaN(val)?val:null};CCore.prototype.toStream=function(s,api){s.StartRecord(AscCommon.c_oMainTables.Core);s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.title);s._WriteString2(1,this.creator);if(api&&api.DocInfo)s._WriteString2(2, api.DocInfo.get_UserName());var revision=0;if(this.revision){var rev=parseInt(this.revision);if(!isNaN(rev))revision=rev}s._WriteString2(3,(revision+1).toString());if(this.created)s._WriteString2(4,this.created.toISOString().slice(0,19)+"Z");s._WriteString2(5,(new Date).toISOString().slice(0,19)+"Z");s.WriteUChar(g_nodeAttributeEnd);s.StartRecord(0);s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(6,this.category);s._WriteString2(7,this.contentStatus);s._WriteString2(8,this.description); s._WriteString2(9,this.identifier);s._WriteString2(10,this.keywords);s._WriteString2(11,this.language);s._WriteString2(13,this.subject);s._WriteString2(14,this.version);s.WriteUChar(g_nodeAttributeEnd);s.EndRecord();s.EndRecord()};CCore.prototype.asc_getTitle=function(){return this.title};CCore.prototype.asc_getCreator=function(){return this.creator};CCore.prototype.asc_getLastModifiedBy=function(){return this.lastModifiedBy};CCore.prototype.asc_getRevision=function(){return this.revision};CCore.prototype.asc_getCreated= function(){return this.created};CCore.prototype.asc_getModified=function(){return this.modified};CCore.prototype.asc_getCategory=function(){return this.category};CCore.prototype.asc_getContentStatus=function(){return this.contentStatus};CCore.prototype.asc_getDescription=function(){return this.description};CCore.prototype.asc_getIdentifier=function(){return this.identifier};CCore.prototype.asc_getKeywords=function(){return this.keywords};CCore.prototype.asc_getLanguage=function(){return this.language}; CCore.prototype.asc_getLastPrinted=function(){return this.lastPrinted};CCore.prototype.asc_getSubject=function(){return this.subject};CCore.prototype.asc_getVersion=function(){return this.version};CCore.prototype.asc_putTitle=function(v){this.title=v};CCore.prototype.asc_putCreator=function(v){this.creator=v};CCore.prototype.asc_putLastModifiedBy=function(v){this.lastModifiedBy=v};CCore.prototype.asc_putRevision=function(v){this.revision=v};CCore.prototype.asc_putCreated=function(v){this.created= v};CCore.prototype.asc_putModified=function(v){this.modified=v};CCore.prototype.asc_putCategory=function(v){this.category=v};CCore.prototype.asc_putContentStatus=function(v){this.contentStatus=v};CCore.prototype.asc_putDescription=function(v){this.description=v};CCore.prototype.asc_putIdentifier=function(v){this.identifier=v};CCore.prototype.asc_putKeywords=function(v){this.keywords=v};CCore.prototype.asc_putLanguage=function(v){this.language=v};CCore.prototype.asc_putLastPrinted=function(v){this.lastPrinted= v};CCore.prototype.asc_putSubject=function(v){this.subject=v};CCore.prototype.asc_putVersion=function(v){this.version=v};CCore.prototype.setProps=function(oProps){History.Add(new CChangesCorePr(this,this,oProps,null));this.title=oProps.title;this.creator=oProps.creator;this.description=oProps.description;this.subject=oProps.subject};CCore.prototype.Get_Id=function(){return this.Id};CCore.prototype.Refresh_RecalcData=function(){};CCore.prototype.Refresh_RecalcData2=function(){};CCore.prototype.getObjectType= function(){return AscDFH.historyitem_type_Core};CCore.prototype.Write_ToBinary2=function(oWriter){oWriter.WriteLong(this.getObjectType());oWriter.WriteString2(this.Get_Id())};CCore.prototype.Read_FromBinary2=function(oReader){this.Id=oReader.GetString2()};CCore.prototype.copy=function(){return AscFormat.ExecuteNoHistory(function(){var oCopy=new CCore;oCopy.category=this.category;oCopy.contentStatus=this.contentStatus;oCopy.created=this.created;oCopy.creator=this.creator;oCopy.description=this.description; oCopy.identifier=this.identifier;oCopy.keywords=this.keywords;oCopy.language=this.language;oCopy.lastModifiedBy=this.lastModifiedBy;oCopy.lastPrinted=this.lastPrinted;oCopy.modified=this.modified;oCopy.revision=this.revision;oCopy.subject=this.subject;oCopy.title=this.title;oCopy.version=this.version;return oCopy},this,[])};function CVariantVector(){this.baseType=null;this.size=null;this.variants=[]}CVariantVector.prototype.fromStream=function(s){var _type;var _len=s.GetULong();var _start_pos=s.cur; var _end_pos=_len+_start_pos;var _at;var _sa=s.GetUChar();while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{this.baseType=s.GetUChar();break}case 1:{this.size=s.GetLong();break}default:return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CVariant;tmp.fromStream(s);this.variants.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CVariantVector.prototype.toStream= function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUChar2(0,this.baseType);s._WriteInt2(1,this.size);s.WriteUChar(g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.variants)};function CVariantArray(){this.baseType=null;this.lBounds=null;this.uBounds=null;this.variants=[]}CVariantArray.prototype.fromStream=function(s){var _type;var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;var _sa=s.GetUChar();while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break; switch(_at){case 0:{this.baseType=s.GetUChar();break}case 1:{this.lBounds=s.GetString2();break}case 2:{this.uBounds=s.GetString2();break}default:return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CVariant;tmp.fromStream(s);this.variants.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CVariantArray.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart); s._WriteUChar2(0,this.baseType);s._WriteString2(1,this.lBounds);s._WriteString2(2,this.uBounds);s.WriteUChar(g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.variants)};function CVariantVStream(){this.version=null;this.strContent=null}CVariantVStream.prototype.fromStream=function(s){var _type;var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;var _sa=s.GetUChar();while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{this.version=s.GetString2(); break}default:return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{this.strContent=s.GetString2();break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CVariantVStream.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.version);s.WriteUChar(g_nodeAttributeEnd);s._WriteString2(0,this.strContent)};function CVariant(){this.type=null;this.strContent=null;this.iContent=null;this.uContent=null;this.dContent=null;this.bContent= null;this.variant=null;this.vector=null;this.array=null;this.vStream=null}CVariant.prototype.fromStream=function(s){var _type;var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;var _sa=s.GetUChar();while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{this.type=s.GetUChar();break}default:return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{this.strContent=s.GetString2();break}case 1:{this.iContent=s.GetLong(); break}case 2:{this.iContent=s.GetULong();break}case 3:{this.dContent=s.GetDouble();break}case 4:{this.bContent=s.GetBool();break}case 5:{this.variant=new CVariant;this.variant.fromStream(s);break}case 6:{this.vector=new CVariantVector;this.vector.fromStream(s);break}case 7:{this.array=new CVariantArray;this.array.fromStream(s);break}case 8:{this.vStream=new CVariantVStream;this.vStream.fromStream(s);break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CVariant.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart); s._WriteUChar2(0,this.type);s.WriteUChar(g_nodeAttributeEnd);s._WriteString2(0,this.strContent);s._WriteInt2(1,this.iContent);s._WriteUInt2(2,this.uContent);s._WriteDoubleReal2(3,this.dContent);s._WriteBool2(4,this.bContent);s.WriteRecord4(5,this.variant);s.WriteRecord4(6,this.vector);s.WriteRecord4(7,this.array);s.WriteRecord4(8,this.vStream)};CVariant.prototype.setText=function(val){this.type=c_oVariantTypes.vtLpwstr;this.strContent=val};CVariant.prototype.setNumber=function(val){this.type=c_oVariantTypes.vtI4; this.iContent=val};CVariant.prototype.setDate=function(val){this.type=c_oVariantTypes.vtFiletime;this.strContent=val.toISOString().slice(0,19)+"Z"};CVariant.prototype.setBool=function(val){this.type=c_oVariantTypes.vtBool;this.bContent=val};function CCustomProperty(){this.fmtid=null;this.pid=null;this.name=null;this.linkTarget=null;this.content=null}CCustomProperty.prototype.fromStream=function(s){var _type;var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;var _sa=s.GetUChar(); while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{this.fmtid=s.GetString2();break}case 1:{this.pid=s.GetLong();break}case 2:{this.name=s.GetString2();break}case 3:{this.linkTarget=s.GetString2();break}default:return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{this.content=new CVariant;this.content.fromStream(s);break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CCustomProperty.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart); s._WriteString2(0,this.fmtid);s._WriteInt2(1,this.pid);s._WriteString2(2,this.name);s._WriteString2(3,this.linkTarget);s.WriteUChar(g_nodeAttributeEnd);s.WriteRecord4(0,this.content)};function CCustomProperties(){this.properties=[]}CCustomProperties.prototype.fromStream=function(s){var _type=s.GetUChar();var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;var _sa=s.GetUChar();while(true){_at=s.GetUChar();if(_at==g_nodeAttributeEnd)break}while(true){if(s.cur>=_end_pos)break; _type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CCustomProperty;tmp.fromStream(s);this.properties.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CCustomProperties.prototype.toStream=function(s){s.StartRecord(AscCommon.c_oMainTables.CustomProperties);s.WriteUChar(AscCommon.g_nodeAttributeStart);s.WriteUChar(g_nodeAttributeEnd);this.fillNewPid();s.WriteRecordArray4(0,0,this.properties);s.EndRecord()};CCustomProperties.prototype.fillNewPid= function(s){var index=2;this.properties.forEach(function(property){property.pid=index++})};CCustomProperties.prototype.add=function(name,variant,opt_linkTarget){var newProperty=new CCustomProperty;newProperty.fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";newProperty.pid=null;newProperty.name=name;newProperty.linkTarget=opt_linkTarget||null;newProperty.content=variant;this.properties.push(newProperty)};function CPres(){this.defaultTextStyle=null;this.SldSz=null;this.NotesSz=null;this.attrAutoCompressPictures= null;this.attrBookmarkIdSeed=null;this.attrCompatMode=null;this.attrConformance=null;this.attrEmbedTrueTypeFonts=null;this.attrFirstSlideNum=null;this.attrRemovePersonalInfoOnSave=null;this.attrRtl=null;this.attrSaveSubsetFonts=null;this.attrServerZoom=null;this.attrShowSpecialPlsOnTitleSld=null;this.attrStrictFirstAndLastChars=null;this.fromStream=function(s,reader){var _type=s.GetUChar();var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _sa=s.GetUChar();while(true){var _at= s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{this.attrAutoCompressPictures=s.GetBool();break}case 1:{this.attrBookmarkIdSeed=s.GetLong();break}case 2:{this.attrCompatMode=s.GetBool();break}case 3:{this.attrConformance=s.GetUChar();break}case 4:{this.attrEmbedTrueTypeFonts=s.GetBool();break}case 5:{this.attrFirstSlideNum=s.GetLong();break}case 6:{this.attrRemovePersonalInfoOnSave=s.GetBool();break}case 7:{this.attrRtl=s.GetBool();break}case 8:{this.attrSaveSubsetFonts=s.GetBool(); break}case 9:{this.attrServerZoom=s.GetString2();break}case 10:{this.attrShowSpecialPlsOnTitleSld=s.GetBool();break}case 11:{this.attrStrictFirstAndLastChars=s.GetBool();break}default:return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{this.defaultTextStyle=reader.ReadTextListStyle();break}case 1:{s.SkipRecord();break}case 2:{s.SkipRecord();break}case 3:{s.SkipRecord();break}case 4:{s.SkipRecord();break}case 5:{this.SldSz={};s.Skip2(5);while(true){var _at=s.GetUChar(); if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{this.SldSz.cx=s.GetLong();break}case 1:{this.SldSz.cy=s.GetLong();break}case 2:{this.SldSz.type=s.GetUChar();break}default:return}}break}case 6:{var _end_rec2=s.cur+s.GetULong()+4;while(s.cur<_end_rec2){var _rec=s.GetUChar();switch(_rec){case 0:{s.Skip2(4);var lCount=s.GetULong();for(var i=0;i<lCount;i++){s.Skip2(1);var _author=new AscCommon.CCommentAuthor;var _end_rec3=s.cur+s.GetLong()+4;s.Skip2(1);while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break; switch(_at2){case 0:_author.Id=s.GetLong();break;case 1:_author.LastId=s.GetLong();break;case 2:var _clr_idx=s.GetLong();break;case 3:_author.Name=s.GetString2();break;case 4:_author.Initials=s.GetString2();break;default:break}}s.Seek2(_end_rec3);reader.presentation.CommentAuthors[_author.Name]=_author}break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec2);break}case 9:{var _length=s.GetULong();var _end_rec2=s.cur+_length;reader.presentation.Api.macros.SetData(AscCommon.GetStringUtf8(s,_length)); s.Seek2(_end_rec2);break}case 10:{reader.ReadComments(reader.presentation.writecomments);break}default:{s.SkipRecord();break}}}if(reader.presentation.Load_Comments)reader.presentation.Load_Comments(reader.presentation.CommentAuthors);s.Seek2(_end_pos)}}function CPPTXContentLoader(){this.Reader=new AscCommon.BinaryPPTYLoader;this.Writer=null;this.stream=null;this.TempMainObject=null;this.ParaDrawing=null;this.LogicDocument=null;this.BaseReader=null;this.ImageMapChecker={};this.Start_UseFullUrl=function(insertDocumentUrlsData){this.Reader.Start_UseFullUrl(insertDocumentUrlsData)}; this.End_UseFullUrl=function(){return this.Reader.End_UseFullUrl()};this.ReadDrawing=function(reader,stream,logicDocument,paraDrawing){if(reader)this.BaseReader=reader;if(this.Reader==null)this.Reader=new AscCommon.BinaryPPTYLoader;if(null!=paraDrawing){this.ParaDrawing=paraDrawing;this.TempMainObject=null}this.LogicDocument=logicDocument;this.Reader.ImageMapChecker=this.ImageMapChecker;if(null==this.stream){this.stream=new AscCommon.FileStream;this.stream.obj=stream.obj;this.stream.data=stream.data; this.stream.size=stream.size}this.stream.pos=stream.pos;this.stream.cur=stream.cur;this.Reader.stream=this.stream;this.Reader.presentation=logicDocument;if(logicDocument)this.Reader.DrawingDocument=logicDocument.DrawingDocument;else this.Reader.DrawingDocument=null;var GrObject=null;var s=this.stream;var _main_type=s.GetUChar();var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;if(s.cur<_end_rec){s.Skip2(5);var _type=s.GetUChar();switch(_type){case 1:{GrObject=this.ReadShape();break}case 6:case 2:case 7:case 8:{GrObject= this.ReadPic(_type);break}case 3:{GrObject=this.ReadCxn();break}case 4:{GrObject=this.ReadGroupShape();break}case 5:{s.SkipRecord();break}case 9:{GrObject=this.Reader.ReadGroupShape(9);if(paraDrawing)GrObject.setParent(paraDrawing);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);stream.pos=s.pos;stream.cur=s.cur;return GrObject};this.ReadGraphicObject=function(stream,presentation,drawingDocument){if(this.Reader==null)this.Reader=new AscCommon.BinaryPPTYLoader;if(presentation)this.Reader.presentation= presentation;if(drawingDocument)this.Reader.DrawingDocument=drawingDocument;var oLogicDocument=this.LogicDocument;this.LogicDocument=null;this.Reader.ImageMapChecker=this.ImageMapChecker;if(null==this.stream){this.stream=new AscCommon.FileStream;this.stream.obj=stream.obj;this.stream.data=stream.data;this.stream.size=stream.size}this.stream.pos=stream.pos;this.stream.cur=stream.cur;this.Reader.stream=this.stream;var s=this.stream;var _main_type=s.GetUChar();var _rec_start=s.cur;var _end_rec=_rec_start+ s.GetULong()+4;s.Skip2(5);var GrObject=this.Reader.ReadGraphicObject();s.Seek2(_end_rec);stream.pos=s.pos;stream.cur=s.cur;this.LogicDocument=oLogicDocument;return GrObject};this.ReadTextBody=function(reader,stream,shape,presentation,drawingDocument){if(reader)this.BaseReader=reader;if(this.Reader==null)this.Reader=new AscCommon.BinaryPPTYLoader;if(presentation)this.Reader.presentation=presentation;if(drawingDocument)this.Reader.DrawingDocument=drawingDocument;var oLogicDocument=this.LogicDocument; this.LogicDocument=null;this.Reader.ImageMapChecker=this.ImageMapChecker;if(null==this.stream){this.stream=new AscCommon.FileStream;this.stream.obj=stream.obj;this.stream.data=stream.data;this.stream.size=stream.size}this.stream.pos=stream.pos;this.stream.cur=stream.cur;this.Reader.stream=this.stream;var s=this.stream;var _main_type=s.GetUChar();var txBody=this.Reader.ReadTextBody(shape);stream.pos=s.pos;stream.cur=s.cur;this.LogicDocument=oLogicDocument;return txBody};this.ReadTextBodyTxPr=function(reader, stream,shape){if(reader)this.BaseReader=reader;if(this.Reader==null)this.Reader=new AscCommon.BinaryPPTYLoader;var oLogicDocument=this.LogicDocument;this.LogicDocument=null;this.Reader.ImageMapChecker=this.ImageMapChecker;if(null==this.stream){this.stream=new AscCommon.FileStream;this.stream.obj=stream.obj;this.stream.data=stream.data;this.stream.size=stream.size}this.stream.pos=stream.pos;this.stream.cur=stream.cur;this.Reader.stream=this.stream;var s=this.stream;var _main_type=s.GetUChar();var txBody= this.Reader.ReadTextBodyTxPr(shape);stream.pos=s.pos;stream.cur=s.cur;this.LogicDocument=oLogicDocument;return txBody};this.ReadShapeProperty=function(stream,type){if(this.Reader==null)this.Reader=new AscCommon.BinaryPPTYLoader;var oLogicDocument=this.LogicDocument;this.LogicDocument=null;this.Reader.ImageMapChecker=this.ImageMapChecker;if(null==this.stream){this.stream=new AscCommon.FileStream;this.stream.obj=stream.obj;this.stream.data=stream.data;this.stream.size=stream.size}this.stream.pos=stream.pos; this.stream.cur=stream.cur;this.Reader.stream=this.stream;var s=this.stream;var _main_type=s.GetUChar();var oNewSpPr;if(0==type)oNewSpPr=this.Reader.ReadLn();else if(1==type)oNewSpPr=this.Reader.ReadUniFill();else{oNewSpPr=new AscFormat.CSpPr;this.Reader.ReadSpPr(oNewSpPr)}stream.pos=s.pos;stream.cur=s.cur;this.LogicDocument=oLogicDocument;return oNewSpPr};this.ReadRunProperties=function(stream,type){if(this.Reader==null)this.Reader=new AscCommon.BinaryPPTYLoader;var oLogicDocument=this.LogicDocument; this.LogicDocument=null;this.Reader.ImageMapChecker=this.ImageMapChecker;if(null==this.stream){this.stream=new AscCommon.FileStream;this.stream.obj=stream.obj;this.stream.data=stream.data;this.stream.size=stream.size}this.stream.pos=stream.pos;this.stream.cur=stream.cur;this.Reader.stream=this.stream;var s=this.stream;var _main_type=s.GetUChar();var oNewrPr=this.Reader.ReadRunProperties();stream.pos=s.pos;stream.cur=s.cur;this.LogicDocument=oLogicDocument;return oNewrPr};this.ReadShape=function(){var s= this.stream;var shape=new AscFormat.CShape;shape.setWordShape(true);shape.setBDeleted(false);shape.setParent(this.TempMainObject==null?this.ParaDrawing:null);var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{shape.attrUseBgFill=s.GetBool();break}default:break}}var oXFRM=null;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var pr=this.Reader.ReadNvUniProp(shape);shape.setNvSpPr(pr); if(AscFormat.isRealNumber(pr.locks))shape.setLocks(pr.locks);break}case 1:{var spPr=new AscFormat.CSpPr;this.ReadSpPr(spPr);shape.setSpPr(spPr);shape.spPr.setParent(shape);break}case 2:{shape.setStyle(this.Reader.ReadShapeStyle());break}case 3:{s.SkipRecord();break}case 4:{var oThis=this.BaseReader;shape.setTextBoxContent(new CDocumentContent(shape,this.LogicDocument.DrawingDocument,0,0,0,0,false,false));var _old_cont=shape.textBoxContent.Content[0];shape.textBoxContent.Internal_Content_RemoveAll(); s.Skip2(4);oThis.stream.pos=s.pos;oThis.stream.cur=s.cur;var oBinary_DocumentTableReader=new Binary_DocumentTableReader(shape.textBoxContent,oThis.oReadResult,oThis.openParams,oThis.stream,false,oThis.oComments);var nDocLength=oThis.stream.GetULongLE();var content_arr=[];oThis.bcr.Read1(nDocLength,function(t,l){return oBinary_DocumentTableReader.ReadDocumentContent(t,l,content_arr)});for(var i=0,length=content_arr.length;i<length;++i)if(i==length-1)shape.textBoxContent.Internal_Content_Add(i,content_arr[i], true);else shape.textBoxContent.Internal_Content_Add(i,content_arr[i],false);s.pos=oThis.stream.pos;s.cur=oThis.stream.cur;if(shape.textBoxContent.Content.length==0)shape.textBoxContent.Internal_Content_Add(0,_old_cont);break}case 5:{var bodyPr=new AscFormat.CBodyPr;this.Reader.CorrectBodyPr(bodyPr);shape.setBodyPr(bodyPr);break}case 6:{oXFRM=this.Reader.ReadXfrm();break}case 7:{shape.setSignature(this.Reader.ReadSignatureLine());break}default:{s.SkipRecord();break}}}if(oXFRM){var oRet=new AscFormat.CGroupShape; shape.setParent(null);oRet.setParent(this.TempMainObject==null?this.ParaDrawing:null);oRet.setBDeleted(false);var oSpPr=new AscFormat.CSpPr;var oXfrm=new AscFormat.CXfrm;oXfrm.setOffX(shape.spPr.xfrm.offX);oXfrm.setOffY(shape.spPr.xfrm.offY);oXfrm.setExtX(shape.spPr.xfrm.extX);oXfrm.setExtY(shape.spPr.xfrm.extY);oXfrm.setChExtX(shape.spPr.xfrm.extX);oXfrm.setChExtY(shape.spPr.xfrm.extY);oXfrm.setChOffX(0);oXfrm.setChOffY(0);oSpPr.setXfrm(oXfrm);oXfrm.setParent(oSpPr);shape.spPr.xfrm.setOffX(0);shape.spPr.xfrm.setOffY(0); oRet.setSpPr(oSpPr);oSpPr.setParent(oRet);oRet.addToSpTree(0,shape);var oShape2=new AscFormat.CShape;var oSpPr2=new AscFormat.CSpPr;oShape2.setSpPr(oSpPr2);oSpPr2.setParent(oShape2);var oXfrm2=oXFRM;oXfrm2.setParent(oSpPr2);oSpPr2.setXfrm(oXfrm2);oXfrm2.setOffX(oXfrm2.offX-oXfrm.offX);oXfrm2.setOffY(oXfrm2.offY-oXfrm.offY);oSpPr2.setFill(AscFormat.CreateNoFillUniFill());oSpPr2.setLn(AscFormat.CreateNoFillLine());oShape2.setTxBody(shape.txBody);shape.setTxBody(null);shape.setGroup(oRet);oShape2.setBDeleted(false); oShape2.setWordShape(true);if(shape.spPr.xfrm&&AscFormat.isRealNumber(shape.spPr.xfrm.rot))oXfrm2.setRot((AscFormat.isRealNumber(oXfrm2.rot)?oXfrm2.rot:0)+shape.spPr.xfrm.rot);if(oShape2.txBody)oShape2.txBody.setParent(oShape2);if(shape.textBoxContent){oShape2.setTextBoxContent(shape.textBoxContent.Copy(oShape2,shape.textBoxContent.DrawingDocument));shape.setTextBoxContent(null)}if(shape.bodyPr){oShape2.setBodyPr(shape.bodyPr);shape.setBodyPr(null)}oRet.addToSpTree(1,oShape2);oShape2.setGroup(oRet); s.Seek2(_end_rec);return oRet}s.Seek2(_end_rec);return shape};this.ReadCxn=function(){var s=this.stream;var shape=new AscFormat.CConnectionShape;shape.setWordShape(true);shape.setParent(this.TempMainObject==null?this.ParaDrawing:null);var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{s.SkipRecord();break}case 1:{var spPr=new AscFormat.CSpPr;this.ReadSpPr(spPr);shape.setSpPr(spPr);break}case 2:{shape.setStyle(this.Reader.ReadShapeStyle()); break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec);return shape};this.ReadPic=function(type){var s=this.stream;var isOle=type===6;var pic=isOle?new AscFormat.COleObject:new AscFormat.CImageShape;pic.setBDeleted(false);pic.setParent(this.TempMainObject==null?this.ParaDrawing:null);var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;var sMaskFileName="";while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{var pr=this.Reader.ReadNvUniProp(pic);pic.setNvSpPr(pr);if(AscFormat.isRealNumber(pr.locks))pic.setLocks(pr.locks); break}case 1:{var unifill=this.Reader.ReadUniFill(null,pic,null);pic.setBlipFill(unifill.fill);break}case 2:{var spPr=new AscFormat.CSpPr;this.ReadSpPr(spPr);pic.setSpPr(spPr);pic.spPr.setParent(pic);break}case 3:{pic.setStyle(this.Reader.ReadShapeStyle());break}case 4:{if(isOle)this.ReadOleInfo(pic);else s.SkipRecord();break}case 5:{if(type===7||type===8){s.GetLong();s.GetUChar();while(true){var _at2=s.GetUChar();if(_at2==g_nodeAttributeEnd)break;switch(_at2){case 0:{sMaskFileName=s.GetString2(); break}}}}else s.SkipRecord();break}default:{s.SkipRecord();break}}}if(type===7||type===8)if(typeof sMaskFileName==="string"&&sMaskFileName.length>0&&pic.nvPicPr&&pic.nvPicPr.nvPr){var oUniMedia=new AscFormat.UniMedia;oUniMedia.type=type;oUniMedia.media=sMaskFileName;pic.nvPicPr.nvPr.setUniMedia(oUniMedia)}s.Seek2(_end_rec);return pic};this.ReadOleInfo=function(ole){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetLong()+4;s.Skip2(1);var dxaOrig=0;var dyaOrig=0;while(true){var _at= s.GetUChar();if(_at==g_nodeAttributeEnd)break;switch(_at){case 0:{ole.setApplicationId(s.GetString2());break}case 1:{ole.setData(s.GetString2());break}case 2:{dxaOrig=s.GetULong();break}case 3:{dyaOrig=s.GetULong();break}case 4:{s.GetUChar();break}case 5:{s.GetUChar();break}case 6:{s.GetUChar();break}case 7:{ole.setObjectFile(s.GetString2());break}default:break}}var oleType=null;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 1:{s.GetLong();oleType=s.GetUChar();ole.setOleType(oleType); break}case 2:{var binary_length;switch(oleType){case 0:{binary_length=s.GetULong();ole.setBinaryData(s.data.slice(s.cur,s.cur+binary_length));s.Seek2(s.cur+binary_length);break}case 1:{ole.setObjectFile("maskFile.docx");binary_length=s.GetULong();ole.setBinaryData(s.data.slice(s.cur,s.cur+binary_length));s.Seek2(s.cur+binary_length);break}case 2:{ole.setObjectFile("maskFile.xlsx");binary_length=s.GetULong();ole.setBinaryData(s.data.slice(s.cur,s.cur+binary_length));s.Seek2(s.cur+binary_length);break}case 4:{s.GetLong(); var type2=s.GetUChar();if(c_oSer_OMathContentType.OMath===type2&&ole.parent&&ole.parent.Parent){var length2=s.GetLong();var _stream=new AscCommon.FT_Stream2;_stream.data=s.data;_stream.pos=s.pos;_stream.cur=s.cur;_stream.size=s.size;var oReadResult=this.BaseReader?this.BaseReader.oReadResult:new AscCommonWord.DocReadResult(null);var boMathr=new Binary_oMathReader(_stream,oReadResult,null);var oMathPara=new ParaMath;ole.parent.ParaMath=oMathPara;var par=ole.parent.Parent;var oParStruct=new OpenParStruct(par, par);oParStruct.cur.pos=par.Content.length-1;boMathr.bcr.Read1(length2,function(t,l){return boMathr.ReadMathArg(t,l,oMathPara.Root,oParStruct)});oMathPara.Root.Correct_Content(true)}else s.SkipRecord();break}default:{s.SkipRecord();break}}break}default:{s.SkipRecord();break}}}if(dxaOrig>0&&dyaOrig>0){var ratio=4/3/20;ole.setPixSizes(ratio*dxaOrig,ratio*dyaOrig)}s.Seek2(_end_rec)};this.ReadGroupShape=function(){var s=this.stream;var shape=new AscFormat.CGroupShape;shape.setBDeleted(false);shape.setParent(this.TempMainObject== null?this.ParaDrawing:null);this.TempGroupObject=shape;var oldParaDrawing=this.ParaDrawing;this.ParaDrawing=null;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{s.SkipRecord();break}case 1:{var spPr=new AscFormat.CSpPr;this.Reader.ReadGrSpPr(spPr);shape.setSpPr(spPr);shape.spPr.setParent(shape);break}case 2:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;i++){s.Skip2(1);var __len=s.GetULong();if(__len==0)continue;var _type= s.GetUChar();var sp;switch(_type){case 1:{sp=this.ReadShape();if(sp.spPr&&sp.spPr.xfrm){sp.setGroup(shape);shape.addToSpTree(shape.spTree.length,sp)}break}case 6:case 2:case 7:case 8:{sp=this.ReadPic(_type);if(sp.spPr&&sp.spPr.xfrm){sp.setGroup(shape);shape.addToSpTree(shape.spTree.length,sp)}break}case 3:{sp=this.ReadCxn();if(sp.spPr&&sp.spPr.xfrm){sp.setGroup(shape);shape.addToSpTree(shape.spTree.length,sp)}break}case 4:{sp=this.ReadGroupShape();if(sp&&sp.spPr&&sp.spPr.xfrm&&sp.spTree.length>0){sp.setGroup(shape); shape.addToSpTree(shape.spTree.length,sp)}break}case 5:{var _chart=this.Reader.ReadChartDataInGroup(shape);if(null!=_chart){_chart.setGroup(shape);shape.addToSpTree(shape.spTree.length,_chart)}break}default:{s.SkipRecord();break}}}break}default:{s.SkipRecord();break}}}if(oldParaDrawing&&shape.spPr&&!shape.spPr.xfrm)shape.bEmptyTransform=true;if(!oldParaDrawing)this.Reader.CheckGroupXfrm(shape);this.ParaDrawing=oldParaDrawing;s.Seek2(_end_rec);this.TempGroupObject=null;return shape};this.ReadSpPr= function(spPr){var s=this.stream;var _rec_start=s.cur;var _end_rec=_rec_start+s.GetULong()+4;s.Skip2(1);while(true){var _at=s.GetUChar();if(_at==AscCommon.g_nodeAttributeEnd)break;if(0==_at)spPr.bwMode=s.GetUChar();else break}while(s.cur<_end_rec){var _at=s.GetUChar();switch(_at){case 0:{spPr.setXfrm(this.Reader.ReadXfrm());spPr.xfrm.setParent(spPr);break}case 1:{var oGeometry=this.Reader.ReadGeometry(spPr.xfrm);if(oGeometry&&oGeometry.pathLst.length>0)spPr.setGeometry(oGeometry);break}case 2:{spPr.setFill(this.Reader.ReadUniFill(spPr, null,null));break}case 3:{spPr.setLn(this.Reader.ReadLn());break}case 4:{spPr.setEffectPr(this.Reader.ReadEffectProperties());break}case 5:{var _len=s.GetULong();s.Skip2(_len);break}case 6:{var _len=s.GetULong();s.Skip2(_len);break}default:{s.SkipRecord();break}}}s.Seek2(_end_rec)};this.CorrectXfrm=function(_xfrm){if(!_xfrm)return;if(null==_xfrm.rot)return;var nInvertRotate=0;if(true===_xfrm.flipH)nInvertRotate+=1;if(true===_xfrm.flipV)nInvertRotate+=1;var _rot=_xfrm.rot;var _del=2*Math.PI;if(nInvertRotate)_rot= -_rot;if(_rot>=_del){var _intD=_rot/_del>>0;_rot=_rot-_intD*_del}else if(_rot<0){var _intD=-_rot/_del>>0;_intD=1+_intD;_rot=_rot+_intD*_del}_xfrm.rot=_rot};this.ReadTheme=function(reader,stream){if(reader)this.BaseReader=reader;if(this.Reader==null)this.Reader=new AscCommon.BinaryPPTYLoader;if(null==this.stream){this.stream=new AscCommon.FileStream;this.stream.obj=stream.obj;this.stream.data=stream.data;this.stream.size=stream.size}this.stream.pos=stream.pos;this.stream.cur=stream.cur;this.Reader.stream= this.stream;this.Reader.ImageMapChecker=this.ImageMapChecker;return this.Reader.ReadTheme()};this.CheckImagesNeeds=function(logicDoc){var index=0;logicDoc.ImageMap={};for(var i in this.ImageMapChecker)logicDoc.ImageMap[index++]=i};this.Clear=function(bClearStreamOnly){this.Reader.stream=null;this.stream=null;this.BaseReader=null;if(!bClearStreamOnly)this.ImageMapChecker={}}}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].c_dScalePPTXSizes=c_dScalePPTXSizes;window["AscCommon"].CBuilderImages= CBuilderImages;window["AscCommon"].BinaryPPTYLoader=BinaryPPTYLoader;window["AscCommon"].IsHiddenObj=IsHiddenObj;window["AscCommon"].pptx_content_loader=new CPPTXContentLoader;window["AscCommon"].CApp=CApp;prot=CApp.prototype;prot["asc_getTemplate"]=prot.asc_getTemplate;prot["asc_getTotalTime"]=prot.asc_getTotalTime;prot["asc_getWords"]=prot.asc_getWords;prot["asc_getApplication"]=prot.asc_getApplication;prot["asc_getPresentationFormat"]=prot.asc_getPresentationFormat;prot["asc_getParagraphs"]=prot.asc_getParagraphs; prot["asc_getSlides"]=prot.asc_getSlides;prot["asc_getNotes"]=prot.asc_getNotes;prot["asc_getHiddenSlides"]=prot.asc_getHiddenSlides;prot["asc_getMMClips"]=prot.asc_getMMClips;prot["asc_getScaleCrop"]=prot.asc_getScaleCrop;prot["asc_getCompany"]=prot.asc_getCompany;prot["asc_getLinksUpToDate"]=prot.asc_getLinksUpToDate;prot["asc_getSharedDoc"]=prot.asc_getSharedDoc;prot["asc_getHyperlinksChanged"]=prot.asc_getHyperlinksChanged;prot["asc_getAppVersion"]=prot.asc_getAppVersion;prot["asc_getCharacters"]= prot.asc_getCharacters;prot["asc_getCharactersWithSpaces"]=prot.asc_getCharactersWithSpaces;prot["asc_getDocSecurity"]=prot.asc_getDocSecurity;prot["asc_getHyperlinkBase"]=prot.asc_getHyperlinkBase;prot["asc_getLines"]=prot.asc_getLines;prot["asc_getManager"]=prot.asc_getManager;prot["asc_getPages"]=prot.asc_getPages;window["AscCommon"].CCore=CCore;prot=CCore.prototype;prot["asc_getTitle"]=prot.asc_getTitle;prot["asc_getCreator"]=prot.asc_getCreator;prot["asc_getLastModifiedBy"]=prot.asc_getLastModifiedBy; prot["asc_getRevision"]=prot.asc_getRevision;prot["asc_getCreated"]=prot.asc_getCreated;prot["asc_getModified"]=prot.asc_getModified;prot["asc_getCategory"]=prot.asc_getCategory;prot["asc_getContentStatus"]=prot.asc_getContentStatus;prot["asc_getDescription"]=prot.asc_getDescription;prot["asc_getIdentifier"]=prot.asc_getIdentifier;prot["asc_getKeywords"]=prot.asc_getKeywords;prot["asc_getLanguage"]=prot.asc_getLanguage;prot["asc_getLastPrinted"]=prot.asc_getLastPrinted;prot["asc_getSubject"]=prot.asc_getSubject; prot["asc_getVersion"]=prot.asc_getVersion;prot["asc_putTitle"]=prot.asc_putTitle;prot["asc_putCreator"]=prot.asc_putCreator;prot["asc_putLastModifiedBy"]=prot.asc_putLastModifiedBy;prot["asc_putRevision"]=prot.asc_putRevision;prot["asc_putCreated"]=prot.asc_putCreated;prot["asc_putModified"]=prot.asc_putModified;prot["asc_putCategory"]=prot.asc_putCategory;prot["asc_putContentStatus"]=prot.asc_putContentStatus;prot["asc_putDescription"]=prot.asc_putDescription;prot["asc_putIdentifier"]=prot.asc_putIdentifier; prot["asc_putKeywords"]=prot.asc_putKeywords;prot["asc_putLanguage"]=prot.asc_putLanguage;prot["asc_putLastPrinted"]=prot.asc_putLastPrinted;prot["asc_putSubject"]=prot.asc_putSubject;prot["asc_putVersion"]=prot.asc_putVersion;window["AscCommon"].CCustomProperties=CCustomProperties;prot=CCustomProperties.prototype;prot["add"]=prot.add;window["AscCommon"].c_oVariantTypes=c_oVariantTypes;window["AscCommon"].CVariant=CVariant;prot=CVariant.prototype;prot["setText"]=prot.setText;prot["setNumber"]=prot.setNumber; prot["setDate"]=prot.setDate;prot["setBool"]=prot.setBool})(window);"use strict";(function(window,undefined){var c_dScalePPTXSizes=AscCommon.c_dScalePPTXSizes;var g_nodeAttributeStart=AscCommon.g_nodeAttributeStart;var g_nodeAttributeEnd=AscCommon.g_nodeAttributeEnd;var c_oAscColor=Asc.c_oAscColor;var c_oAscFill=Asc.c_oAscFill;var c_oMainTables={Main:255,App:1,Core:2,Presentation:3,ViewProps:4,VmlDrawing:5,TableStyles:6,PresProps:7,JsaProject:8,Themes:20,ThemeOverride:21,SlideMasters:22,SlideLayouts:23, Slides:24,NotesMasters:25,NotesSlides:26,HandoutMasters:30,SlideRels:40,ThemeRels:41,ImageMap:42,FontMap:43,SlideNotesRels:45,NotesRels:46,NotesMastersRels:47,CustomProperties:48};function CSeekTableEntry(){this.Type=0;this.SeekPos=0}function GUID(){var S4=function(){var ret=((1+Math.random())*65536|0).toString(16).substring(1);ret=ret.toUpperCase();return ret};return S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()}function CBinaryFileWriter(){this.tableStylesGuides={};this.Init=function(){var _canvas= document.createElement("canvas");var _ctx=_canvas.getContext("2d");this.len=1024*1024*5;this.ImData=_ctx.createImageData(this.len/4,1);this.data=this.ImData.data;this.pos=0};this.IsWordWriter=false;this.ImData=null;this.data=null;this.len=0;this.pos=0;this.Init();this.UseContinueWriter=0;this.IsUseFullUrl=false;this.PresentationThemesOrigin="";this.max_shape_id=3;this.arr_map_shapes_id={};this.DocSaveParams=null;var oThis=this;this.ClearIdMap=function(){this.max_shape_id=3;this.arr_map_shapes_id= {}};this.ImportFromMemory=function(memory){this.ImData=memory.ImData;this.data=memory.data;this.len=memory.len;this.pos=memory.pos};this.ExportToMemory=function(memory){memory.ImData=this.ImData;memory.data=this.data;memory.len=this.len;memory.pos=this.pos};this.Start_UseFullUrl=function(){this.IsUseFullUrl=true};this.Start_UseDocumentOrigin=function(origin){this.PresentationThemesOrigin=origin};this.End_UseFullUrl=function(){this.IsUseFullUrl=false};this.Copy=function(oMemory,nPos,nLen){for(var Index= 0;Index<nLen;Index++){this.CheckSize(1);this.data[this.pos++]=oMemory.data[Index+nPos]}};this.CheckSize=function(count){if(this.pos+count>=this.len){var _canvas=document.createElement("canvas");var _ctx=_canvas.getContext("2d");var oldImData=this.ImData;var oldData=this.data;var oldPos=this.pos;this.len=Math.max(this.len*2,this.pos+(3*count/2>>0));this.ImData=_ctx.createImageData(this.len/4,1);this.data=this.ImData.data;var newData=this.data;for(var i=0;i<this.pos;i++)newData[i]=oldData[i]}};this.GetBase64Memory= function(){return AscCommon.Base64Encode(this.data,this.pos,0)};this.GetBase64Memory2=function(nPos,nLen){return AscCommon.Base64Encode(this.data,nLen,nPos)};this.GetData=function(nPos,nLen){var _canvas=document.createElement("canvas");var _ctx=_canvas.getContext("2d");var len=this.GetCurPosition();var ImData=_ctx.createImageData(Math.ceil(len/4),1);var res=ImData.data;for(var i=0;i<len;i++)res[i]=this.data[i];return res};this.GetCurPosition=function(){return this.pos};this.Seek=function(nPos){this.pos= nPos};this.Skip=function(nDif){this.pos+=nDif};this.WriteBool=function(val){this.CheckSize(1);if(false==val)this.data[this.pos++]=0;else this.data[this.pos++]=1};this.WriteUChar=function(val){this.CheckSize(1);this.data[this.pos++]=val};this.WriteUShort=function(val){this.CheckSize(2);this.data[this.pos++]=val&255;this.data[this.pos++]=val>>>8&255};this.WriteULong=function(val){this.CheckSize(4);this.data[this.pos++]=val&255;this.data[this.pos++]=val>>>8&255;this.data[this.pos++]=val>>>16&255;this.data[this.pos++]= val>>>24&255};this.WriteDouble=function(val){this.WriteULong(val*1E5>>0)};var tempHelp=new ArrayBuffer(8);var tempHelpUnit=new Uint8Array(tempHelp);var tempHelpFloat=new Float64Array(tempHelp);this.WriteDoubleReal=function(val){this.CheckSize(8);tempHelpFloat[0]=val;this.data[this.pos++]=tempHelpUnit[0];this.data[this.pos++]=tempHelpUnit[1];this.data[this.pos++]=tempHelpUnit[2];this.data[this.pos++]=tempHelpUnit[3];this.data[this.pos++]=tempHelpUnit[4];this.data[this.pos++]=tempHelpUnit[5];this.data[this.pos++]= tempHelpUnit[6];this.data[this.pos++]=tempHelpUnit[7]};this.WriteString=function(text){var count=text.length&65535;this.WriteULong(count);this.CheckSize(count);for(var i=0;i<count;i++){var c=text.charCodeAt(i)&255;this.data[this.pos++]=c}};this.WriteString2=function(text){if("string"!=typeof text)text=text+"";var count=text.length&2147483647;var countWrite=2*count;this.WriteULong(count);this.CheckSize(countWrite);for(var i=0;i<count;i++){var c=text.charCodeAt(i)&65535;this.data[this.pos++]=c&255; this.data[this.pos++]=c>>>8&255}};this.WriteBuffer=function(data,_pos,count){this.CheckSize(count);for(var i=0;i<count;i++)this.data[this.pos++]=data[_pos+i]};this.m_arStack=[];this.m_lStackPosition=0;this.m_arMainTables=[];this.StartRecord=function(lType){this.m_arStack[this.m_lStackPosition]=this.pos+5;this.m_lStackPosition++;this.WriteUChar(lType);this.WriteULong(0)};this.EndRecord=function(){this.m_lStackPosition--;var _seek=this.pos;this.pos=this.m_arStack[this.m_lStackPosition]-4;this.WriteULong(_seek- this.m_arStack[this.m_lStackPosition]);this.pos=_seek};this.StartMainRecord=function(lType){var oEntry=new CSeekTableEntry;oEntry.Type=lType;oEntry.SeekPos=this.pos;this.m_arMainTables[this.m_arMainTables.length]=oEntry};this.WriteReserved=function(lCount){this.CheckSize(lCount);var _d=this.data;var _p=this.pos;var _e=this.pos+lCount;while(_p<_e)_d[_p++]=0;this.pos+=lCount};this.WriteMainPart=function(startPos){var _pos=this.pos;this.pos=startPos;var _count=this.m_arMainTables.length;for(var i=0;i< _count;i++){this.WriteUChar(this.m_arMainTables[i].Type);this.WriteULong(this.m_arMainTables[i].SeekPos)}this.pos=_pos};this._WriteString1=function(type,val){this.WriteUChar(type);this.WriteString2(val)};this._WriteString2=function(type,val){if(val!=null)this._WriteString1(type,val)};this._WriteUChar1=function(type,val){this.WriteUChar(type);this.WriteUChar(val)};this._WriteUChar2=function(type,val){if(val!=null)this._WriteUChar1(type,val)};this._WriteChar1=function(type,val){this.WriteUChar(type); this.WriteUChar(val)};this._WriteChar2=function(type,val){if(val!=null)this._WriteChar1(type,val)};this._WriteBool1=function(type,val){this.WriteUChar(type);this.WriteBool(val)};this._WriteBool2=function(type,val){if(val!=null)this._WriteBool1(type,val)};this._WriteInt1=function(type,val){this.WriteUChar(type);this.WriteULong(val)};this._WriteInt2=function(type,val){if(val!=null)this._WriteInt1(type,val)};this._WriteUInt1=function(type,val){this.WriteUChar(type);this.WriteULong(val)};this._WriteUInt2= function(type,val){if(val!=null)this._WriteUInt1(type,val)};this._WriteInt3=function(type,val,scale){this._WriteInt1(type,val*scale)};this._WriteInt4=function(type,val,scale){if(val!=null)this._WriteInt1(type,val*scale>>0)};this._WriteDouble1=function(type,val){var _val=val*1E4;this._WriteInt1(type,_val)};this._WriteDouble2=function(type,val){if(val!=null)this._WriteDouble1(type,val)};this._WriteDoubleReal1=function(type,val){this.WriteUChar(type);this.WriteDoubleReal(val)};this._WriteDoubleReal2= function(type,val){if(val!=null)this._WriteDoubleReal1(type,val)};this._WriteLimit1=this._WriteUChar1;this._WriteLimit2=this._WriteUChar2;this.WriteRecord1=function(type,val,func_write){this.StartRecord(type);func_write(val);this.EndRecord()};this.WriteRecord2=function(type,val,func_write){if(null!=val){this.StartRecord(type);func_write(val);this.EndRecord()}};this.WriteRecord3=function(type,val,func_write){if(null!=val){var _start_pos=this.pos;this.StartRecord(type);func_write(val);this.EndRecord(); if(_start_pos+5==this.pos){this.pos-=5;return false}return true}return false};this.WriteRecord4=function(type,val){if(null!=val){this.StartRecord(type);val.toStream(this);this.EndRecord()}};this.WriteRecordArray=function(type,subtype,val_array,func_element_write){this.StartRecord(type);var len=val_array.length;this.WriteULong(len);for(var i=0;i<len;i++)this.WriteRecord1(subtype,val_array[i],func_element_write);this.EndRecord()};this.WriteRecordArray4=function(type,subtype,val_array){this.StartRecord(type); var len=val_array.length;this.WriteULong(len);for(var i=0;i<len;i++)this.WriteRecord4(subtype,val_array[i]);this.EndRecord()};this.font_map={};this.image_map={};this.WriteDocument2=function(presentation){this.font_map={};this.image_map={};var startPos=this.GetCurPosition();this.WriteReserved(5*30);this.StartMainRecord(c_oMainTables.Main);this.WriteULong(1347441753);this.WriteULong(0);if(presentation.App)this.WriteApp(presentation.App);if(presentation.Core)this.WriteCore(presentation.Core,presentation.Api); if(presentation.CustomProperties)this.WriteCustomProperties(presentation.CustomProperties,presentation.Api);if(presentation.ViewProps)this.WriteViewProps(presentation.ViewProps);this.WritePresProps(presentation);this.WritePresentation(presentation);var _dst_themes=[];var _dst_masters=[];var _dst_layouts=[];var _dst_slides=[];var _dst_notes=[];var _dst_notesMasters=[];var _slides_rels=[];var _master_rels=[];var _slides=presentation.Slides;var _slide_count=_slides.length;for(var i=0;i<_slide_count;i++){_dst_slides[i]= _slides[i];if(_slides[i].notes&&!_slides[i].notes.isEmptyBody())_dst_notes.push(_slides[i].notes);var _m=_slides[i].Layout.Master;var is_found=false;var _len_dst=_dst_masters.length;for(var j=0;j<_len_dst;j++)if(_dst_masters[j]==_m){is_found=true;break}if(!is_found){_dst_masters[_len_dst]=_m;var _m_rels={ThemeIndex:0,Layouts:[]};var _lay_c=_m.sldLayoutLst.length;var _ind_l=_dst_layouts.length;for(var k=0;k<_lay_c;k++){_dst_layouts[_ind_l]=_m.sldLayoutLst[k];_m_rels.Layouts[k]=_ind_l;_ind_l++}_master_rels[_len_dst]= _m_rels}var _layoutsC=_dst_layouts.length;for(var ii=0;ii<_layoutsC;ii++)if(_dst_layouts[ii]==_dst_slides[i].Layout)_slides_rels[i]=ii}for(var i=0;i<_dst_notes.length;++i){for(var j=0;j<_dst_notesMasters.length;++j)if(_dst_notesMasters[j]===_dst_notes[i].Master)break;if(j===_dst_notesMasters.length)_dst_notesMasters.push(_dst_notes[i].Master)}var _dst_masters_len=_dst_masters.length;if(0==_dst_masters_len&&presentation.slideMasters.length>0){var _m=presentation.slideMasters[0];_dst_masters[0]=_m; var _m_rels={ThemeIndex:0,Layouts:[]};var _lay_c=_m.sldLayoutLst.length;var _ind_l=_dst_layouts.length;for(var k=0;k<_lay_c;k++){_dst_layouts[_ind_l]=_m.sldLayoutLst[k];_m_rels.Layouts[k]=_ind_l;_ind_l++}_master_rels[0]=_m_rels;_dst_masters_len=1}for(var i=0;i<_dst_masters_len;i++){var _t=_dst_masters[i].Theme;var is_found=false;var _len_dst=_dst_themes.length;for(var j=0;j<_len_dst;j++)if(_dst_themes[j]==_t){is_found=true;break}if(!is_found){_dst_themes[_len_dst]=_t;_master_rels[i].ThemeIndex=_len_dst}}var i, j;for(i=0;i<_dst_notesMasters.length;++i){for(j=0;j<_dst_themes.length;++j)if(_dst_themes[j]===_dst_notesMasters[i].Theme)break;if(j===_dst_themes.length)_dst_themes.push(_dst_notesMasters[i].Theme)}var oTableStyleIdMap;if(presentation.GetTableStyleIdMap){oTableStyleIdMap={};presentation.GetTableStyleIdMap(oTableStyleIdMap)}else oTableStyleIdMap=presentation.TableStylesIdMap;for(var key in oTableStyleIdMap)if(oTableStyleIdMap.hasOwnProperty(key))this.tableStylesGuides[key]="{"+GUID()+"}";this.StartMainRecord(c_oMainTables.TableStyles); this.StartRecord(c_oMainTables.SlideRels);this.WriteUChar(g_nodeAttributeStart);if(this.tableStylesGuides[presentation.DefaultTableStyleId])this._WriteString1(0,this.tableStylesGuides[presentation.DefaultTableStyleId]);else for(key in this.tableStylesGuides)if(this.tableStylesGuides.hasOwnProperty(key)){this._WriteString1(0,this.tableStylesGuides[key]);break}this.WriteUChar(g_nodeAttributeEnd);this.StartRecord(0);for(key in this.tableStylesGuides)if(this.tableStylesGuides.hasOwnProperty(key))this.WriteTableStyle(key, AscCommon.g_oTableId.m_aPairs[key]);this.EndRecord();this.EndRecord();this.StartMainRecord(c_oMainTables.SlideRels);this.StartRecord(c_oMainTables.SlideRels);this.WriteUChar(g_nodeAttributeStart);for(var i=0;i<_slide_count;i++)this._WriteInt1(0,_slides_rels[i]);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();this.StartMainRecord(c_oMainTables.SlideNotesRels);this.StartRecord(c_oMainTables.SlideNotesRels);this.WriteUChar(g_nodeAttributeStart);var _rels,slideNotes,i,j;var _notes=_dst_notes;var _notes_count= _notes.length;for(var i=0;i<_slide_count;++i){slideNotes=presentation.Slides[i].notes;_rels=-1;if(slideNotes)for(j=0;j<_notes_count;++j)if(_notes[j]===slideNotes){_rels=j;break}this._WriteInt1(0,_rels)}this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();this.StartMainRecord(c_oMainTables.NotesMastersRels);this.StartRecord(c_oMainTables.NotesMastersRels);this.WriteUChar(g_nodeAttributeStart);var _notes_masters=_dst_notesMasters;var _notes_masters_count=_notes_masters.length;var _themes=_dst_themes; var _thems_count=_themes.length;var _theme;for(i=0;i<_notes_masters_count;++i){_theme=_notes_masters[i].Theme;_rels=-1;for(j=0;j<_thems_count;++j)if(_theme===_themes[j]){_rels=j;break}this._WriteInt1(0,_rels)}this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();this.StartMainRecord(c_oMainTables.NotesRels);this.StartRecord(c_oMainTables.NotesRels);this.WriteUChar(g_nodeAttributeStart);var _notes_count=_notes.length;for(i=0;i<_notes_count;++i){slideNotes=_notes[i];_rels=-1;for(j=0;j<_notes_masters_count;++j)if(slideNotes.Master=== _notes_masters[j]){_rels=j;break}this._WriteInt1(0,_rels)}this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();this.StartMainRecord(c_oMainTables.ThemeRels);this.StartRecord(c_oMainTables.ThemeRels);var _master_count=_dst_masters.length;this.WriteULong(_master_count);for(var i=0;i<_master_count;i++){this.StartRecord(0);this.WriteUChar(g_nodeAttributeStart);this._WriteInt1(0,_master_rels[i].ThemeIndex);this.WriteUChar(1);this.WriteString(_dst_masters[i].ImageBase64);this.WriteUChar(g_nodeAttributeEnd); var _lay_c=_master_rels[i].Layouts.length;this.WriteULong(_lay_c);for(var j=0;j<_lay_c;j++){this.StartRecord(0);this.WriteUChar(g_nodeAttributeStart);var _indL=_master_rels[i].Layouts[j];this._WriteInt1(0,_indL);this.WriteUChar(1);this.WriteString(_dst_layouts[_indL].ImageBase64);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord()}this.EndRecord()}this.EndRecord();var _count_arr=0;_count_arr=_dst_themes.length;this.StartMainRecord(c_oMainTables.Themes);this.WriteULong(_count_arr);for(var i=0;i<_count_arr;i++)this.WriteTheme(_dst_themes[i]); _count_arr=_dst_masters.length;this.StartMainRecord(c_oMainTables.SlideMasters);this.WriteULong(_count_arr);for(var i=0;i<_count_arr;i++)this.WriteSlideMaster(_dst_masters[i]);_count_arr=_dst_layouts.length;this.StartMainRecord(c_oMainTables.SlideLayouts);this.WriteULong(_count_arr);for(var i=0;i<_count_arr;i++)this.WriteSlideLayout(_dst_layouts[i]);_count_arr=_dst_slides.length;this.StartMainRecord(c_oMainTables.Slides);this.WriteULong(_count_arr);for(var i=0;i<_count_arr;i++)this.WriteSlide(_dst_slides[i]); _count_arr=_dst_notes.length;this.StartMainRecord(c_oMainTables.NotesSlides);this.WriteULong(_count_arr);for(var i=0;i<_count_arr;i++)this.WriteSlideNote(_dst_notes[i]);_count_arr=_dst_notesMasters.length;this.StartMainRecord(c_oMainTables.NotesMasters);this.WriteULong(_count_arr);for(var i=0;i<_count_arr;i++)this.WriteNoteMaster(_dst_notesMasters[i]);this.StartMainRecord(c_oMainTables.FontMap);this.StartRecord(c_oMainTables.FontMap);this.WriteUChar(g_nodeAttributeStart);var _index_attr=0;for(var i in this.font_map){this.WriteUChar(_index_attr++); this.WriteString2(i)}this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();this.StartMainRecord(c_oMainTables.ImageMap);this.StartRecord(c_oMainTables.ImageMap);this.WriteUChar(g_nodeAttributeStart);_index_attr=0;for(var i in this.image_map){this.WriteUChar(_index_attr++);this.WriteString2(i)}this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();this.WriteMainPart(startPos)};this.WriteDocument=function(presentation){this.WriteDocument2(presentation);var ret="PPTY;v1;"+this.pos+";";return ret+this.GetBase64Memory()}; this.WriteDocument3=function(presentation,base64){var _memory=new AscCommon.CMemory(true);_memory.ImData=this.ImData;_memory.data=this.data;_memory.len=this.len;_memory.pos=this.pos;_memory.WriteXmlString("PPTY;v"+Asc.c_nVersionNoBase64+";0;");this.ImData=_memory.ImData;this.data=_memory.data;this.len=_memory.len;this.pos=_memory.pos;this.WriteDocument2(presentation);_memory.ImData=this.ImData;_memory.data=this.data;_memory.len=this.len;_memory.pos=this.pos;if(!base64)return _memory.GetData();return _memory.GetBase64Memory()}; this.WriteByMemory=function(callback){var _memory=new AscCommon.CMemory(true);_memory.ImData=this.ImData;_memory.data=this.data;_memory.len=this.len;_memory.pos=this.pos;callback(_memory);this.ImData=_memory.ImData;this.data=_memory.data;this.len=_memory.len;this.pos=_memory.pos};this.WriteApp=function(app){this.StartMainRecord(c_oMainTables.App);app.toStream(this)};this.WriteCore=function(core,api){this.StartMainRecord(c_oMainTables.Core);core.toStream(this,api)};this.WriteCustomProperties=function(customProperties, api){this.StartMainRecord(c_oMainTables.CustomProperties);customProperties.toStream(this,api)};this.WriteViewProps=function(viewprops){this.StartMainRecord(c_oMainTables.ViewProps);this.StartRecord(c_oMainTables.ViewProps);this.EndRecord()};this.WritePresProps=function(presentation){this.StartMainRecord(c_oMainTables.PresProps);this.StartRecord(c_oMainTables.PresProps);var showPr=presentation.showPr;if(showPr){this.StartRecord(1);this.WriteUChar(g_nodeAttributeStart);this._WriteBool2(0,showPr.loop); this._WriteBool2(1,showPr.showAnimation);this._WriteBool2(2,showPr.showNarration);this._WriteBool2(3,showPr.useTimings);this.WriteUChar(g_nodeAttributeEnd);if(showPr.browse){this.StartRecord(0);this.EndRecord()}if(showPr.show&&null!=showPr.show.custShow){this.StartRecord(1);this.WriteUChar(g_nodeAttributeStart);this._WriteInt2(0,showPr.show.custShow);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord()}if(showPr.kiosk){this.StartRecord(2);this.WriteUChar(g_nodeAttributeStart);this._WriteInt2(0,showPr.kiosk.restart); this.WriteUChar(g_nodeAttributeEnd);this.EndRecord()}this.WriteRecord1(3,showPr.penClr,this.WriteUniColor);if(showPr.present){this.StartRecord(4);this.EndRecord()}if(showPr.show&&null!=showPr.show.showAll){this.StartRecord(5);this.EndRecord()}if(showPr.show&&showPr.show.range&&null!=showPr.show.range.start&&null!=showPr.show.range.end){this.StartRecord(6);this.WriteUChar(g_nodeAttributeStart);this._WriteInt2(0,showPr.show.range.start);this._WriteInt2(1,showPr.show.range.end);this.WriteUChar(g_nodeAttributeEnd); this.EndRecord()}this.EndRecord()}this.EndRecord()};this.WritePresentation=function(presentation){var pres=presentation.pres;this.StartMainRecord(c_oMainTables.Presentation);this.StartRecord(c_oMainTables.Presentation);this.WriteUChar(g_nodeAttributeStart);this._WriteBool2(0,pres.attrAutoCompressPictures);this._WriteInt2(1,pres.attrBookmarkIdSeed);this._WriteBool2(2,pres.attrCompatMode);this._WriteLimit2(3,pres.attrConformance);this._WriteBool2(4,pres.attrEmbedTrueTypeFonts);pres.attrFirstSlideNum= presentation.firstSlideNum;this._WriteInt2(5,pres.attrFirstSlideNum);this._WriteBool2(6,pres.attrRemovePersonalInfoOnSave);this._WriteBool2(7,pres.attrRtl);this._WriteBool2(8,pres.attrSaveSubsetFonts);this._WriteString2(9,pres.attrServerZoom);pres.attrShowSpecialPlsOnTitleSld=presentation.showSpecialPlsOnTitleSld;this._WriteBool2(10,pres.attrShowSpecialPlsOnTitleSld);this._WriteBool2(11,pres.attrStrictFirstAndLastChars);this.WriteUChar(g_nodeAttributeEnd);this.WriteRecord2(0,presentation.defaultTextStyle, this.WriteTextListStyle);pres.SldSz.cx=presentation.Width*c_dScalePPTXSizes>>0;pres.SldSz.cy=presentation.Height*c_dScalePPTXSizes>>0;this.StartRecord(5);this.WriteUChar(g_nodeAttributeStart);this._WriteInt1(0,pres.SldSz.cx);this._WriteInt1(1,pres.SldSz.cy);this._WriteLimit2(2,pres.SldSz.type);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();pres.NotesSz={};pres.NotesSz.cx=presentation.Height*c_dScalePPTXSizes>>0;pres.NotesSz.cy=presentation.Width*c_dScalePPTXSizes>>0;this.StartRecord(3);this.WriteUChar(g_nodeAttributeStart); this._WriteInt1(0,pres.NotesSz.cx);this._WriteInt1(1,pres.NotesSz.cy);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();if(!this.IsUseFullUrl){var _countAuthors=0;for(var i in presentation.CommentAuthors)++_countAuthors;if(_countAuthors>0){this.StartRecord(6);this.StartRecord(0);this.WriteULong(_countAuthors);for(var i in presentation.CommentAuthors){var _author=presentation.CommentAuthors[i];this.StartRecord(0);this.WriteUChar(g_nodeAttributeStart);this._WriteInt1(0,_author.Id);this._WriteInt1(1, _author.LastId);this._WriteInt1(2,_author.Id-1);this._WriteString1(3,_author.Name);this._WriteString1(4,_author.Initials);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord()}this.EndRecord();this.EndRecord()}}var macros=presentation.Api.macros.GetData();if(macros){this.StartRecord(9);this.WriteByMemory(function(_memory){_memory.WriteXmlString(macros)});this.EndRecord()}if(presentation.writecomments)this.WriteComments(10,presentation.writecomments);this.EndRecord()};this.WriteTheme=function(_theme){this.StartRecord(c_oMainTables.Themes); this.WriteUChar(g_nodeAttributeStart);this._WriteString2(0,_theme.name);if(_theme.isThemeOverride)this._WriteBool1(1,true);this.WriteUChar(g_nodeAttributeEnd);this.WriteRecord1(0,_theme.themeElements,this.WriteThemeElements);this.WriteRecord2(1,_theme.spDef,this.WriteDefaultShapeDefinition);this.WriteRecord2(2,_theme.lnDef,this.WriteDefaultShapeDefinition);this.WriteRecord2(3,_theme.txDef,this.WriteDefaultShapeDefinition);this.WriteRecordArray(4,0,_theme.extraClrSchemeLst,this.WriteExtraClrScheme); this.EndRecord()};this.WriteSlideMaster=function(_master){this.StartRecord(c_oMainTables.SlideMasters);this.WriteUChar(g_nodeAttributeStart);this._WriteBool2(0,_master.preserve);this.WriteUChar(g_nodeAttributeEnd);this.WriteRecord1(0,_master.cSld,this.WriteCSld);this.WriteRecord1(1,_master.clrMap,this.WriteClrMap);this.WriteRecord2(5,_master.hf,this.WriteHF);this.WriteRecord2(6,_master.txStyles,this.WriteTxStyles);this.EndRecord()};this.WriteSlideLayout=function(_layout){this.StartRecord(c_oMainTables.SlideLayouts); this.WriteUChar(g_nodeAttributeStart);this._WriteString2(0,_layout.matchingName);this._WriteBool2(1,_layout.preserve);this._WriteBool2(2,_layout.showMasterPhAnim);this._WriteBool2(3,_layout.showMasterSp);this._WriteBool2(4,_layout.userDrawn);this._WriteLimit2(5,_layout.type);this.WriteUChar(g_nodeAttributeEnd);this.WriteRecord1(0,_layout.cSld,this.WriteCSld);this.WriteRecord2(1,_layout.clrMap,this.WriteClrMapOvr);this.WriteRecord2(4,_layout.hf,this.WriteHF);this.EndRecord()};this.WriteSlide=function(_slide){this.StartRecord(c_oMainTables.Slides); this.WriteUChar(g_nodeAttributeStart);this._WriteBool2(0,_slide.show);this._WriteBool2(1,_slide.showMasterPhAnim);this._WriteBool2(2,_slide.showMasterSp);this.WriteUChar(g_nodeAttributeEnd);this.WriteRecord1(0,_slide.cSld,this.WriteCSld);this.WriteRecord2(1,_slide.clrMap,this.WriteClrMapOvr);this.WriteRecord1(2,_slide.timing,this.WriteSlideTransition);this.WriteComments(4,_slide.writecomments);this.EndRecord()};this.WriteComments=function(type,comments){var _countComments=0;{for(var i in comments)++_countComments}if(_countComments> 0){oThis.StartRecord(type);oThis.StartRecord(0);oThis.WriteULong(_countComments);for(var i in comments){var _comment=comments[i];oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0,_comment.WriteAuthorId);oThis._WriteString1(1,_comment.WriteTime);oThis._WriteInt1(2,_comment.WriteCommentId);oThis._WriteInt1(3,22.66*_comment.x>>0);oThis._WriteInt1(4,22.66*_comment.y>>0);oThis._WriteString1(5,_comment.Data.m_sText);if(0!=_comment.WriteParentAuthorId){oThis._WriteInt1(6,_comment.WriteParentAuthorId); oThis._WriteInt1(7,_comment.WriteParentCommentId)}oThis._WriteString1(8,_comment.AdditionalData);oThis.WriteUChar(g_nodeAttributeEnd);if(null!=_comment.timeZoneBias){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(9,_comment.timeZoneBias);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}oThis.EndRecord()}oThis.EndRecord();oThis.EndRecord()}};this.WriteSlideTransition=function(_timing){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteBool1(0,_timing.SlideAdvanceOnMouseClick); if(_timing.SlideAdvanceAfter){oThis._WriteInt1(1,_timing.SlideAdvanceDuration);if(_timing.TransitionType==c_oAscSlideTransitionTypes.None)oThis._WriteInt1(2,0)}else if(_timing.TransitionType==c_oAscSlideTransitionTypes.None)oThis._WriteInt1(2,2E3);if(_timing.TransitionType!=c_oAscSlideTransitionTypes.None){oThis._WriteInt1(2,_timing.TransitionDuration);if(_timing.TransitionDuration<250)oThis._WriteUChar1(3,0);else if(_timing.TransitionDuration>1E3)oThis._WriteUChar1(3,2);else oThis._WriteUChar1(3, 1);oThis.WriteUChar(g_nodeAttributeEnd);oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);switch(_timing.TransitionType){case c_oAscSlideTransitionTypes.Fade:{oThis._WriteString2(0,"p:fade");switch(_timing.TransitionOption){case c_oAscSlideTransitionParams.Fade_Smoothly:{oThis._WriteString2(1,"thruBlk");oThis._WriteString2(2,"0");break}case c_oAscSlideTransitionParams.Fade_Through_Black:{oThis._WriteString2(1,"thruBlk");oThis._WriteString2(2,"1");break}default:break}break}case c_oAscSlideTransitionTypes.Push:{oThis._WriteString2(0, "p:push");switch(_timing.TransitionOption){case c_oAscSlideTransitionParams.Param_Left:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"r");break}case c_oAscSlideTransitionParams.Param_Right:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"l");break}case c_oAscSlideTransitionParams.Param_Top:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"d");break}case c_oAscSlideTransitionParams.Param_Bottom:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"u");break}default:break}break}case c_oAscSlideTransitionTypes.Wipe:{switch(_timing.TransitionOption){case c_oAscSlideTransitionParams.Param_Left:{oThis._WriteString2(0, "p:wipe");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"r");break}case c_oAscSlideTransitionParams.Param_Right:{oThis._WriteString2(0,"p:wipe");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"l");break}case c_oAscSlideTransitionParams.Param_Top:{oThis._WriteString2(0,"p:wipe");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"d");break}case c_oAscSlideTransitionParams.Param_Bottom:{oThis._WriteString2(0,"p:wipe");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"u");break}case c_oAscSlideTransitionParams.Param_TopLeft:{oThis._WriteString2(0, "p:strips");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"rd");break}case c_oAscSlideTransitionParams.Param_TopRight:{oThis._WriteString2(0,"p:strips");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"ld");break}case c_oAscSlideTransitionParams.Param_BottomLeft:{oThis._WriteString2(0,"p:strips");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"ru");break}case c_oAscSlideTransitionParams.Param_BottomRight:{oThis._WriteString2(0,"p:strips");oThis._WriteString2(1,"dir");oThis._WriteString2(2, "lu");break}default:break}break}case c_oAscSlideTransitionTypes.Split:{oThis._WriteString2(0,"p:split");switch(_timing.TransitionOption){case c_oAscSlideTransitionParams.Split_HorizontalIn:{oThis._WriteString2(1,"orient");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"horz");oThis._WriteString2(2,"in");break}case c_oAscSlideTransitionParams.Split_HorizontalOut:{oThis._WriteString2(1,"orient");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"horz");oThis._WriteString2(2,"out");break}case c_oAscSlideTransitionParams.Split_VerticalIn:{oThis._WriteString2(1, "orient");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"vert");oThis._WriteString2(2,"in");break}case c_oAscSlideTransitionParams.Split_VerticalOut:{oThis._WriteString2(1,"orient");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"vert");oThis._WriteString2(2,"out");break}default:break}break}case c_oAscSlideTransitionTypes.UnCover:case c_oAscSlideTransitionTypes.Cover:{if(_timing.TransitionType==c_oAscSlideTransitionTypes.Cover)oThis._WriteString2(0,"p:cover");else oThis._WriteString2(0,"p:pull"); switch(_timing.TransitionOption){case c_oAscSlideTransitionParams.Param_Left:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"r");break}case c_oAscSlideTransitionParams.Param_Right:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"l");break}case c_oAscSlideTransitionParams.Param_Top:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"d");break}case c_oAscSlideTransitionParams.Param_Bottom:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"u");break}case c_oAscSlideTransitionParams.Param_TopLeft:{oThis._WriteString2(1, "dir");oThis._WriteString2(2,"rd");break}case c_oAscSlideTransitionParams.Param_TopRight:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"ld");break}case c_oAscSlideTransitionParams.Param_BottomLeft:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"ru");break}case c_oAscSlideTransitionParams.Param_BottomRight:{oThis._WriteString2(1,"dir");oThis._WriteString2(2,"lu");break}default:break}break}case c_oAscSlideTransitionTypes.Clock:{switch(_timing.TransitionOption){case c_oAscSlideTransitionParams.Clock_Clockwise:{oThis._WriteString2(0, "p:wheel");oThis._WriteString2(1,"spokes");oThis._WriteString2(2,"1");break}case c_oAscSlideTransitionParams.Clock_Counterclockwise:{oThis._WriteString2(0,"p14:wheelReverse");oThis._WriteString2(1,"spokes");oThis._WriteString2(2,"1");break}case c_oAscSlideTransitionParams.Clock_Wedge:{oThis._WriteString2(0,"p:wedge");break}default:break}break}case c_oAscSlideTransitionTypes.Zoom:{switch(_timing.TransitionOption){case c_oAscSlideTransitionParams.Zoom_In:{oThis._WriteString2(0,"p14:warp");oThis._WriteString2(1, "dir");oThis._WriteString2(2,"in");break}case c_oAscSlideTransitionParams.Zoom_Out:{oThis._WriteString2(0,"p14:warp");oThis._WriteString2(1,"dir");oThis._WriteString2(2,"out");break}case c_oAscSlideTransitionParams.Zoom_AndRotate:{oThis._WriteString2(0,"p:newsflash");break}default:break}break}default:break}oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}else oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteSlideNote=function(_note){this.StartRecord(c_oMainTables.NotesSlides);this.WriteUChar(g_nodeAttributeStart); this._WriteBool2(0,_note.showMasterPhAnim);this._WriteBool2(1,_note.showMasterSp);this.WriteUChar(g_nodeAttributeEnd);this.WriteRecord1(0,_note.cSld,this.WriteCSld);this.WriteRecord2(1,_note.clrMap,this.WriteClrMapOvr);this.EndRecord()};this.WriteNoteMaster=function(_master){this.StartRecord(c_oMainTables.NotesMasters);this.WriteRecord1(0,_master.cSld,this.WriteCSld);this.WriteRecord1(1,_master.clrMap,this.WriteClrMap);this.WriteRecord2(2,_master.hf,this.WriteHF);this.WriteRecord2(3,_master.txStyles, this.WriteTextListStyle);this.EndRecord()};this.WriteThemeElements=function(themeElements){oThis.WriteRecord1(0,themeElements.clrScheme,oThis.WriteClrScheme);oThis.WriteRecord1(1,themeElements.fontScheme,oThis.WriteFontScheme);oThis.WriteRecord1(2,themeElements.fmtScheme,oThis.WriteFmtScheme)};this.WriteFontScheme=function(fontScheme){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,fontScheme.name);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord1(0,fontScheme.majorFont,oThis.WriteFontCollection); oThis.WriteRecord1(1,fontScheme.minorFont,oThis.WriteFontCollection)};this.WriteFontCollection=function(coll){oThis.WriteRecord1(0,{Name:coll.latin,Index:-1},oThis.WriteTextFontTypeface);oThis.WriteRecord1(1,{Name:coll.ea,Index:-1},oThis.WriteTextFontTypeface);oThis.WriteRecord1(2,{Name:coll.cs,Index:-1},oThis.WriteTextFontTypeface)};this.WriteFmtScheme=function(fmt){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,fmt.name);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecordArray(0, 0,fmt.fillStyleLst,oThis.WriteUniFill);oThis.WriteRecordArray(1,0,fmt.lnStyleLst,oThis.WriteLn);oThis.WriteRecordArray(3,0,fmt.bgFillStyleLst,oThis.WriteUniFill)};this.WriteDefaultShapeDefinition=function(shapeDef){oThis.WriteRecord1(0,shapeDef.spPr,oThis.WriteSpPr);oThis.WriteRecord1(1,shapeDef.bodyPr,oThis.WriteBodyPr);oThis.WriteRecord1(2,shapeDef.lstStyle,oThis.WriteTextListStyle);oThis.WriteRecord2(3,shapeDef.style,oThis.WriteShapeStyle)};this.WriteExtraClrScheme=function(extraScheme){oThis.WriteRecord1(0, extraScheme.clrScheme,oThis.WriteClrScheme);oThis.WriteRecord2(1,extraScheme.clrMap,oThis.WriteClrMap)};this.WriteCSld=function(cSld){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString2(0,cSld.name);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,cSld.Bg,oThis.WriteBg);var spTree=cSld.spTree;var _len=spTree.length;oThis.StartRecord(1);oThis.StartRecord(4);var uniPr=AscFormat.ExecuteNoHistory(function(){return new AscFormat.UniNvPr},this,[]);uniPr.cNvPr.id=1;uniPr.cNvPr.name="";var spPr= AscFormat.ExecuteNoHistory(function(){return new AscFormat.CSpPr},this,[]);spPr.xfrm=AscFormat.ExecuteNoHistory(function(){return new AscFormat.CXfrm},this,[]);spPr.xfrm.offX=0;spPr.xfrm.offY=0;spPr.xfrm.extX=0;spPr.xfrm.extY=0;spPr.xfrm.chOffX=0;spPr.xfrm.chOffY=0;spPr.xfrm.chExtX=0;spPr.xfrm.chExtY=0;spPr.WriteXfrm=spPr.xfrm;oThis.WriteRecord1(0,uniPr,oThis.WriteUniNvPr);oThis.WriteRecord1(1,spPr,oThis.WriteSpPr);if(0!=_len){oThis.ClearIdMap();oThis.WriteSpTree(spTree);oThis.ClearIdMap()}oThis.EndRecord(); oThis.EndRecord()};this.WriteSpTree=function(spTree){var _len=spTree.length;oThis.StartRecord(2);oThis.WriteULong(_len);for(var i=0;i<_len;i++){oThis.StartRecord(0);oThis.WriteSpTreeElem(spTree[i]);oThis.EndRecord()}oThis.EndRecord()};this.WriteSpTreeElem=function(oSp){switch(oSp.getObjectType()){case AscDFH.historyitem_type_Shape:case AscDFH.historyitem_type_Cnx:{oThis.WriteShape(oSp);break}case AscDFH.historyitem_type_OleObject:case AscDFH.historyitem_type_ImageShape:{oThis.WriteImage(oSp);break}case AscDFH.historyitem_type_GroupShape:{oThis.WriteGroupShape(oSp); break}case AscDFH.historyitem_type_GraphicFrame:case AscDFH.historyitem_type_ChartSpace:case AscDFH.historyitem_type_SlicerView:{oThis.WriteGrFrame(oSp);break}}};this.WriteClrMap=function(clrmap){oThis.WriteUChar(g_nodeAttributeStart);var _len=clrmap.color_map.length;for(var i=0;i<_len;++i)if(null!=clrmap.color_map[i]){oThis.WriteUChar(i);oThis.WriteUChar(clrmap.color_map[i])}oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteClrScheme=function(scheme){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0, scheme.name);oThis.WriteUChar(g_nodeAttributeEnd);var _len=scheme.colors.length;for(var i=0;i<_len;i++)if(null!=scheme.colors[i])oThis.WriteRecord1(i,scheme.colors[i],oThis.WriteUniColor)};this.WriteClrMapOvr=function(clrmapovr){oThis.WriteRecord2(0,clrmapovr,oThis.WriteClrMap)};this.WriteHF=function(hf){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteBool2(0,hf.dt===null?true:hf.dt);oThis._WriteBool2(1,hf.ftr===null?true:hf.ftr);oThis._WriteBool2(2,hf.hdr===null?true:hf.hdr);oThis._WriteBool2(3, hf.sldNum===null?true:hf.sldNum);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteTxStyles=function(txStyles){oThis.WriteRecord2(0,txStyles.titleStyle,oThis.WriteTextListStyle);oThis.WriteRecord2(1,txStyles.bodyStyle,oThis.WriteTextListStyle);oThis.WriteRecord2(2,txStyles.otherStyle,oThis.WriteTextListStyle)};this.WriteTextListStyle=function(styles){var _levels=styles.levels;var _count=_levels.length;var _props_to_write;for(var i=0;i<_count;++i){if(_levels[i]){_props_to_write=new AscFormat.CTextParagraphPr; _props_to_write.bullet=_levels[i].Bullet;_props_to_write.lvl=_levels[i].Lvl;_props_to_write.pPr=_levels[i];_props_to_write.rPr=_levels[i].DefaultRunPr}else _props_to_write=null;oThis.WriteRecord2(i,_props_to_write,oThis.WriteTextParagraphPr)}};this.WriteTextParagraphPr=function(tPr){oThis.WriteUChar(g_nodeAttributeStart);var pPr=tPr.pPr;if(undefined!==pPr&&null!=pPr){switch(pPr.Jc){case AscCommon.align_Left:oThis._WriteUChar1(0,4);break;case AscCommon.align_Center:oThis._WriteUChar1(0,0);break;case AscCommon.align_Right:oThis._WriteUChar1(0, 5);break;case AscCommon.align_Justify:oThis._WriteUChar1(0,2);break;default:break}var defTab=pPr.DefaultTab;if(defTab!==undefined&&defTab!=null)oThis._WriteInt1(1,defTab*36E3);var ind=pPr.Ind;if(ind!==undefined&&ind!=null){if(ind.FirstLine!=null)oThis._WriteInt2(5,ind.FirstLine*36E3);if(ind.Left!=null)oThis._WriteInt1(8,ind.Left*36E3);if(ind.Right!=null)oThis._WriteInt1(9,ind.Right*36E3)}}oThis._WriteInt2(7,tPr.lvl);oThis.WriteUChar(g_nodeAttributeEnd);if(undefined!==pPr&&null!=pPr){var spacing=pPr.Spacing; if(spacing!==undefined&&spacing!=null){var _value;switch(spacing.LineRule){case Asc.linerule_Auto:oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0,spacing.Line*1E5>>0);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break;case Asc.linerule_Exact:oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);_value=spacing.Line/.00352777778>>0;if(_value<0)_value=0;if(_value>158400)_value=158400;oThis._WriteInt1(1,_value);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord(); break;default:break}if(spacing.After!==undefined&&spacing.After!==null){oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);_value=spacing.After/.00352777778>>0;if(_value<0)_value=0;if(_value>158400)_value=158400;oThis._WriteInt1(1,_value);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}if(spacing.Before!==undefined&&spacing.Before!==null){oThis.StartRecord(2);oThis.WriteUChar(g_nodeAttributeStart);_value=spacing.Before/.00352777778>>0;if(_value<0)_value=0;if(_value>158400)_value=158400; oThis._WriteInt1(1,_value);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}}}var bullet=tPr.bullet;if(undefined!==bullet&&null!=bullet){if(bullet.bulletColor!=null&&bullet.bulletColor.type!=AscFormat.BULLET_TYPE_COLOR_NONE){oThis.StartRecord(3);if(bullet.bulletColor.type==AscFormat.BULLET_TYPE_COLOR_CLR){oThis.StartRecord(AscFormat.BULLET_TYPE_COLOR_CLR);oThis.WriteRecord2(0,bullet.bulletColor.UniColor,oThis.WriteUniColor);oThis.EndRecord()}else{oThis.StartRecord(AscFormat.BULLET_TYPE_COLOR_CLRTX); oThis.EndRecord()}oThis.EndRecord()}if(bullet.bulletSize!=null&&bullet.bulletSize.type!=AscFormat.BULLET_TYPE_SIZE_NONE){oThis.StartRecord(4);if(bullet.bulletSize.type==AscFormat.BULLET_TYPE_SIZE_PTS){oThis.StartRecord(AscFormat.BULLET_TYPE_SIZE_PTS);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0,bullet.bulletSize.val);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}else if(bullet.bulletSize.type==AscFormat.BULLET_TYPE_SIZE_PCT){oThis.StartRecord(AscFormat.BULLET_TYPE_SIZE_PCT); oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0,bullet.bulletSize.val);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}else{oThis.StartRecord(AscFormat.BULLET_TYPE_SIZE_TX);oThis.EndRecord()}oThis.EndRecord()}if(bullet.bulletTypeface!=null&&bullet.bulletTypeface.type!=null&&bullet.bulletTypeface.type!=AscFormat.BULLET_TYPE_TYPEFACE_NONE){oThis.StartRecord(5);if(bullet.bulletTypeface.type==AscFormat.BULLET_TYPE_TYPEFACE_BUFONT)oThis.WriteRecord2(AscFormat.BULLET_TYPE_TYPEFACE_BUFONT, {Name:bullet.bulletTypeface.typeface,Index:-1},oThis.WriteTextFontTypeface);else{oThis.StartRecord(AscFormat.BULLET_TYPE_TYPEFACE_TX);oThis.EndRecord()}oThis.EndRecord()}if(bullet.bulletType!=null&&bullet.bulletType.type!=null){oThis.StartRecord(6);switch(bullet.bulletType.type){case AscFormat.BULLET_TYPE_BULLET_CHAR:{oThis.StartRecord(AscFormat.BULLET_TYPE_BULLET_CHAR);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,bullet.bulletType.Char);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord(); break}case AscFormat.BULLET_TYPE_BULLET_BLIP:{oThis.StartRecord(AscFormat.BULLET_TYPE_BULLET_CHAR);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,"*");oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case AscFormat.BULLET_TYPE_BULLET_AUTONUM:{oThis.StartRecord(AscFormat.BULLET_TYPE_BULLET_AUTONUM);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit1(0,bullet.bulletType.AutoNumType);oThis._WriteInt2(1,bullet.bulletType.startAt);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord(); break}case AscFormat.BULLET_TYPE_BULLET_NONE:{oThis.StartRecord(AscFormat.BULLET_TYPE_BULLET_NONE);oThis.EndRecord();break}}oThis.EndRecord()}}if(pPr!==undefined&&pPr!=null&&pPr.Tabs!==undefined&&pPr.Tabs!=null)if(pPr.Tabs.Tabs!=undefined&&pPr.Tabs.Tabs!=null)oThis.WriteRecordArray(7,0,pPr.Tabs.Tabs,oThis.WriteTab);if(tPr!==undefined&&tPr!=null)oThis.WriteRecord2(8,tPr.rPr,oThis.WriteRunProperties)};this.WriteRunProperties=function(rPr,hlinkObj){if(rPr==null||rPr===undefined)return;oThis.WriteUChar(g_nodeAttributeStart); oThis._WriteBool2(1,rPr.Bold);oThis._WriteBool2(7,rPr.Italic);var _cap=null;if(rPr.Caps===true)_cap=0;else if(rPr.SmallCaps===true)_cap=1;else if(rPr.Caps===false&&rPr.SmallCaps===false)_cap=2;if(null!=_cap)oThis._WriteUChar1(4,_cap);oThis._WriteString2(10,Asc.g_oLcidIdToNameMap[rPr.Lang.Val]);var _strike=null;if(rPr.DStrikeout===true)_strike=0;else if(rPr.Strikeout===true)_strike=2;else if(rPr.DStrikeout===false&&rPr.Strikeout===false)_strike=1;if(undefined!==rPr.Spacing&&null!=rPr.Spacing)oThis._WriteInt1(15, rPr.Spacing*7200/25.4>>0);if(null!=_strike)oThis._WriteUChar1(16,_strike);if(undefined!==rPr.Underline&&null!=rPr.Underline)oThis._WriteUChar1(18,rPr.Underline===true?13:12);if(undefined!==rPr.FontSize&&null!=rPr.FontSize){var nFontSize=rPr.FontSize*100;nFontSize=Math.max(100,nFontSize);oThis._WriteInt1(17,nFontSize)}if(AscCommon.vertalign_SubScript==rPr.VertAlign)oThis._WriteInt1(2,-25E3);else if(AscCommon.vertalign_SuperScript==rPr.VertAlign)oThis._WriteInt1(2,3E4);oThis.WriteUChar(g_nodeAttributeEnd); if(rPr.TextOutline)oThis.WriteRecord1(0,rPr.TextOutline,oThis.WriteLn);if(rPr.Unifill)oThis.WriteRecord1(1,rPr.Unifill,oThis.WriteUniFill);if(rPr.RFonts){if(rPr.RFonts.Ascii)oThis.WriteRecord2(3,rPr.RFonts.Ascii,oThis.WriteTextFontTypeface);if(rPr.RFonts.EastAsia)oThis.WriteRecord2(4,rPr.RFonts.EastAsia,oThis.WriteTextFontTypeface);if(rPr.RFonts.CS)oThis.WriteRecord2(5,rPr.RFonts.CS,oThis.WriteTextFontTypeface)}if(hlinkObj!=null&&hlinkObj!==undefined)oThis.WriteRecord1(7,hlinkObj,oThis.WriteHyperlink); if(rPr.HighlightColor)oThis.WriteRecord1(12,rPr.HighlightColor,oThis.WriteHighlightColor)};this.WriteHighlightColor=function(HighlightColor){oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord1(0,HighlightColor,oThis.WriteUniColor)};this.WriteHyperlink=function(hlink){oThis.WriteUChar(g_nodeAttributeStart);var url=hlink.Value;var action=null;if(url=="ppaction://hlinkshowjump?jump=firstslide"){action=url;url=""}else if(url=="ppaction://hlinkshowjump?jump=lastslide"){action= url;url=""}else if(url=="ppaction://hlinkshowjump?jump=nextslide"){action=url;url=""}else if(url=="ppaction://hlinkshowjump?jump=previousslide"){action=url;url=""}else{var mask="ppaction://hlinksldjumpslide";var indSlide=url.indexOf(mask);if(0==indSlide){var slideNum=parseInt(url.substring(mask.length));url="slide"+(slideNum+1)+".xml";action="ppaction://hlinksldjump"}}oThis._WriteString1(0,url);oThis._WriteString2(2,action);oThis._WriteString2(4,hlink.tooltip);oThis.WriteUChar(g_nodeAttributeEnd)}; this.WriteTextFontTypeface=function(typeface){oThis.WriteUChar(g_nodeAttributeStart);if(!typeface||typeface.Name==null){oThis.font_map["Arial"]=true;oThis._WriteString1(3,"Arial");oThis.WriteUChar(g_nodeAttributeEnd);return}if(0!=typeface.Name.indexOf("+mj")&&0!=typeface.Name.indexOf("+mn"))oThis.font_map[typeface.Name]=true;oThis._WriteString1(3,typeface.Name);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteTab=function(tab){oThis.WriteUChar(g_nodeAttributeStart);var _algn=2;if(tab.Value==tab_Center)_algn= 0;else if(tab.Value==tab_Right)_algn=3;oThis._WriteLimit2(0,_algn);if(tab.Pos!=undefined&&tab.Pos!=null)oThis._WriteInt1(1,tab.Pos*36E3);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteBodyPr=function(bodyPr){if(undefined===bodyPr||null==bodyPr)return;oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,bodyPr.flatTx);oThis._WriteLimit2(1,bodyPr.anchor);oThis._WriteBool2(2,bodyPr.anchorCtr);oThis._WriteInt4(3,bodyPr.bIns,36E3);oThis._WriteBool2(4,bodyPr.compatLnSpc);oThis._WriteBool2(5,bodyPr.forceAA); oThis._WriteBool2(6,bodyPr.fromWordArt);oThis._WriteLimit2(7,bodyPr.horzOverflow);oThis._WriteInt4(8,bodyPr.lIns,36E3);oThis._WriteInt2(9,bodyPr.numCol);oThis._WriteInt4(10,bodyPr.rIns,36E3);oThis._WriteInt2(11,bodyPr.rot);oThis._WriteBool2(12,bodyPr.rtlCol);oThis._WriteInt4(13,bodyPr.spcCol,36E3);oThis._WriteBool2(14,bodyPr.spcFirstLastPara);oThis._WriteInt4(15,bodyPr.tIns,36E3);oThis._WriteBool2(16,bodyPr.upright);oThis._WriteLimit2(17,bodyPr.vert);oThis._WriteLimit2(18,bodyPr.vertOverflow);oThis._WriteLimit2(19, bodyPr.wrap);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,bodyPr.prstTxWarp,oThis.WritePrstTxWarp);if(bodyPr.textFit)oThis.WriteRecord1(1,bodyPr.textFit,oThis.WriteTextFit)};this.WriteTextFit=function(oTextFit){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0,oTextFit.type+1);oThis._WriteInt2(1,oTextFit.fontScale);oThis._WriteInt2(2,oTextFit.lnSpcReduction);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteUniColor=function(unicolor){if(undefined===unicolor||null==unicolor||unicolor.color== null)return;var color=unicolor.color;switch(color.type){case c_oAscColor.COLOR_TYPE_PRST:{oThis.StartRecord(c_oAscColor.COLOR_TYPE_PRST);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,color.id);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteMods(unicolor.Mods);oThis.EndRecord();break}case c_oAscColor.COLOR_TYPE_SCHEME:{oThis.StartRecord(c_oAscColor.COLOR_TYPE_SCHEME);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteUChar1(0,color.id);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteMods(unicolor.Mods); oThis.EndRecord();break}case c_oAscColor.COLOR_TYPE_SRGB:{oThis.StartRecord(c_oAscColor.COLOR_TYPE_SRGB);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteUChar1(0,color.RGBA.R);oThis._WriteUChar1(1,color.RGBA.G);oThis._WriteUChar1(2,color.RGBA.B);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteMods(unicolor.Mods);oThis.EndRecord();break}case c_oAscColor.COLOR_TYPE_SYS:{oThis.StartRecord(c_oAscColor.COLOR_TYPE_SYS);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,color.id);oThis._WriteUChar1(1, color.RGBA.R);oThis._WriteUChar1(2,color.RGBA.G);oThis._WriteUChar1(3,color.RGBA.B);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteMods(unicolor.Mods);oThis.EndRecord();break}}};this.WriteMods=function(mods){if(!mods||!mods.Mods)return;var _count=mods.Mods.length;if(0==_count)return;oThis.StartRecord(0);oThis.WriteULong(_count);for(var i=0;i<_count;++i){oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,mods.Mods[i].name);oThis._WriteInt2(1,mods.Mods[i].val);oThis.WriteUChar(g_nodeAttributeEnd); oThis.EndRecord()}oThis.EndRecord()};this.CorrectUniColorAlpha=function(color,trans){if(!color)return;if(!color.Mods)color.setMods(new AscFormat.CColorModifiers);var mods=color.Mods.Mods;var _len=mods.length;if(trans!=null){var nIndex=-1;for(var i=0;i<_len;i++)if(mods[i].name=="alpha"){nIndex=i;break}if(-1!=nIndex){--_len;mods.splice(nIndex,1)}mods[_len]=new AscFormat.CColorMod;mods[_len].name="alpha";mods[_len].val=trans*1E5/255>>0}};this.WriteEffectDag=function(oEffect){oThis.StartRecord(oEffect.Type); oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteString2(0,oEffect.name);oThis._WriteLimit2(1,oEffect.type);oThis.WriteUChar(g_nodeAttributeEnd);oThis.StartRecord(type);var len__=oEffect.effectList.length;oThis._WriteInt2(0,len__);for(i=0;i<len__;++i)oThis.WriteRecord1(1,oEffect.effectList[i],oThis.WriteEffect);oThis.EndRecord();oThis.EndRecord()};this.WriteEffect=function(oEffect){var type=oEffect.Type,i;switch(type){case 1:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteUChar2(0, oEffect.algn);oThis._WriteInt2(1,oEffect.blurRad);oThis._WriteInt2(2,oEffect.dir);oThis._WriteInt2(3,oEffect.dist);oThis._WriteInt2(4,oEffect.kx);oThis._WriteInt2(5,oEffect.ky);oThis._WriteInt2(6,oEffect.sx);oThis._WriteInt2(7,oEffect.sy);oThis._WriteBool2(8,oEffect.rotWithShape);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,oEffect.color,oThis.WriteUniColor);oThis.EndRecord();break}case 2:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.rad); oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,oEffect.color,oThis.WriteUniColor);oThis.EndRecord();break}case 3:{oThis.StartRecord(type);oThis.WriteULong(oEffect.colors.length);for(i=0;i<oEffect.colors.length;++i)oThis.WriteRecord1(0,oEffect.colors[i],oThis.WriteUniColor);oThis.EndRecord();break}case 4:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.kx);oThis._WriteInt2(1,oEffect.ky);oThis._WriteInt2(2,oEffect.sx);oThis._WriteInt2(3,oEffect.sy); oThis._WriteInt2(4,oEffect.tx);oThis._WriteInt2(5,oEffect.tx);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 5:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.rad);oThis._WriteBool2(1,oEffect.grow);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 6:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.dir);oThis._WriteInt2(1,oEffect.dist);oThis._WriteLimit1(2,oEffect.prst);oThis.WriteUChar(g_nodeAttributeEnd); oThis.EndRecord();break}case 7:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.dir);oThis._WriteInt2(1,oEffect.dist);oThis._WriteInt2(2,oEffect.blurRad);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord1(0,oEffect.color,oThis.WriteUniColor);oThis.EndRecord();break}case 8:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,oEffect.algn);oThis._WriteInt2(1,oEffect.blurRad);oThis._WriteInt2(2,oEffect.stA);oThis._WriteInt2(3, oEffect.endA);oThis._WriteInt2(4,oEffect.stPos);oThis._WriteInt2(5,oEffect.endPos);oThis._WriteInt2(6,oEffect.dir);oThis._WriteInt2(7,oEffect.fadeDir);oThis._WriteInt2(8,oEffect.dist);oThis._WriteInt2(9,oEffect.kx);oThis._WriteInt2(10,oEffect.ky);oThis._WriteInt2(11,oEffect.sx);oThis._WriteInt2(12,oEffect.sy);oThis._WriteBool2(13,oEffect.rotWithShape);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 9:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0, oEffect.rad);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 10:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,oEffect.blend);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord1(0,oEffect.fill,oThis.WriteUniFill);oThis.EndRecord();break}case 11:{oThis.StartRecord(type);oThis.EndRecord();break}case 12:{oThis.StartRecord(type);oThis.EndRecord();break}case 13:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0, oEffect.amt);oThis._WriteInt2(1,oEffect.hue);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 14:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.tx);oThis._WriteInt2(1,oEffect.ty);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 15:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.bright);oThis._WriteInt2(1,oEffect.contrast);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 16:{oThis.StartRecord(type); oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.hue);oThis._WriteInt2(1,oEffect.lum);oThis._WriteInt2(2,oEffect.sat);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 17:{oThis.StartRecord(type);oThis.EndRecord();break}case 18:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteString2(0,oEffect.ref);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 19:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0, oEffect.a);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 20:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.rad);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 21:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.amt);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 22:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.thresh); oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 23:{oThis.StartRecord(type);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,oEffect.thresh);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();break}case 24:{oThis.WriteEffectDag(oEffect);break}case 25:{oThis.StartRecord(type);oThis.WriteRecord1(0,oEffect.Fill,oThis.WriteUniFill);oThis.EndRecord();break}case 26:{oThis.StartRecord(type);oThis.WriteRecord1(0,oEffect.color,oThis.WriteUniColor);oThis.EndRecord();break}case 27:{oThis.StartRecord(type); oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteBool2(0,oEffect.useA);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord1(0,oEffect.clrFrom,oThis.WriteUniColor);oThis.WriteRecord1(1,oEffect.clrTo,oThis.WriteUniColor);oThis.EndRecord();break}case 28:{oThis.StartRecord(type);oThis.WriteRecord1(0,oEffect.color,oThis.WriteUniColor);oThis.EndRecord();break}case 29:{oThis.StartRecord(type);oThis.WriteRecord1(0,oEffect.cont,oThis.WriteEffectDag);oThis.EndRecord();break}case 30:{oThis.StartRecord(type); oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,oEffect.blend);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord1(0,oEffect.cont,oThis.WriteEffectDag);oThis.EndRecord();break}}};this.WriteUniFill=function(unifill){if(undefined===unifill||null==unifill)return;var trans=unifill.transparent!=null&&unifill.transparent!=255?unifill.transparent:null;var fill=unifill.fill;if(undefined===fill||null==fill)return;switch(fill.type){case c_oAscFill.FILL_TYPE_NOFILL:{oThis.StartRecord(c_oAscFill.FILL_TYPE_NOFILL); oThis.EndRecord();break}case c_oAscFill.FILL_TYPE_GRP:{oThis.StartRecord(c_oAscFill.FILL_TYPE_GRP);oThis.EndRecord();break}case c_oAscFill.FILL_TYPE_GRAD:{oThis.StartRecord(c_oAscFill.FILL_TYPE_GRAD);oThis.WriteUChar(g_nodeAttributeStart);if(fill.rotateWithShape===false)oThis._WriteBool1(1,false);oThis.WriteUChar(g_nodeAttributeEnd);oThis.StartRecord(0);var len=fill.colors.length;oThis.WriteULong(len);for(var i=0;i<len;i++){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0, fill.colors[i].pos);oThis.WriteUChar(g_nodeAttributeEnd);oThis.CorrectUniColorAlpha(fill.colors[i].color,trans);oThis.WriteRecord1(0,fill.colors[i].color,oThis.WriteUniColor);oThis.EndRecord()}oThis.EndRecord();if(fill.lin){oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0,fill.lin.angle);oThis._WriteBool1(1,fill.lin.scale);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}else if(fill.path){oThis.StartRecord(2);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteUChar1(0, fill.path.path);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}oThis.EndRecord();break}case c_oAscFill.FILL_TYPE_PATT:{oThis.StartRecord(c_oAscFill.FILL_TYPE_PATT);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,fill.ftype);oThis.WriteUChar(g_nodeAttributeEnd);oThis.CorrectUniColorAlpha(fill.fgClr,trans);oThis.CorrectUniColorAlpha(fill.bgClr,trans);oThis.WriteRecord2(0,fill.fgClr,oThis.WriteUniColor);oThis.WriteRecord2(1,fill.bgClr,oThis.WriteUniColor);oThis.EndRecord();break}case c_oAscFill.FILL_TYPE_BLIP:{oThis.StartRecord(c_oAscFill.FILL_TYPE_BLIP); oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd);var _src=fill.RasterImageId;var imageLocal=AscCommon.g_oDocumentUrls.getImageLocal(_src);if(imageLocal)_src=imageLocal;else imageLocal=_src;oThis.image_map[_src]=true;if(window["IsEmbedImagesInInternalFormat"]===true){var _image=editor.ImageLoader.map_image_index[AscCommon.getFullImageSrc2(_src)];if(undefined!==_image){var imgNatural=_image.Image;var _canvas=document.createElement("canvas");_canvas.width=imgNatural.width; _canvas.height=imgNatural.height;_canvas.getContext("2d").drawImage(imgNatural,0,0,_canvas.width,_canvas.height);_src=_canvas.toDataURL("image/png")}}else if(oThis.IsUseFullUrl){if(0==_src.indexOf("theme")&&window.editor)_src=oThis.PresentationThemesOrigin+_src;else if(0!=_src.indexOf("http:")&&0!=_src.indexOf("data:")&&0!=_src.indexOf("https:")&&0!=_src.indexOf("ftp:")&&0!=_src.indexOf("file:"))if(AscCommon.EncryptionWorker&&AscCommon.EncryptionWorker.isCryptoImages()&&window["AscDesktopEditor"]&& window["AscDesktopEditor"]["Crypto_GetLocalImageBase64"])_src=window["AscDesktopEditor"]["Crypto_GetLocalImageBase64"](_src);else{var imageUrl=AscCommon.g_oDocumentUrls.getImageUrl(_src);if(imageUrl)_src=imageUrl}if(window["native"]&&window["native"]["GetImageTmpPath"])if(!(window.documentInfo&&window.documentInfo["iscoauthoring"]))_src=window["native"]["GetImageTmpPath"](_src)}oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd);var effects_count=fill.Effects.length; if(effects_count>0){oThis.StartRecord(2);oThis.WriteULong(effects_count);for(var effect_index=0;effect_index<effects_count;++effect_index)oThis.WriteRecord1(0,fill.Effects[effect_index],oThis.WriteEffect);oThis.EndRecord()}oThis.StartRecord(3);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,_src);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();oThis.EndRecord();if(fill.srcRect!=null){oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);if(fill.srcRect.l!=null){var _num= fill.srcRect.l*1E3>>0;oThis._WriteString1(0,""+_num)}if(fill.srcRect.t!=null){var _num=fill.srcRect.t*1E3>>0;oThis._WriteString1(1,""+_num)}if(fill.srcRect.l!=null){var _num=(100-fill.srcRect.r)*1E3>>0;oThis._WriteString1(2,""+_num)}if(fill.srcRect.l!=null){var _num=(100-fill.srcRect.b)*1E3>>0;oThis._WriteString1(3,""+_num)}oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}if(null!=fill.tile){oThis.StartRecord(2);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,fill.tile.sx);oThis._WriteInt2(1, fill.tile.sy);oThis._WriteInt2(2,fill.tile.tx);oThis._WriteInt2(3,fill.tile.ty);oThis._WriteLimit2(4,fill.tile.algn);oThis._WriteLimit2(5,fill.tile.flip);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}else{oThis.StartRecord(3);oThis.EndRecord()}if(oThis.IsUseFullUrl){var additionalUrl=AscCommon.g_oDocumentUrls.getImageUrlsWithOtherExtention(imageLocal);if(additionalUrl.length>0){oThis.StartRecord(101);oThis.WriteUChar(additionalUrl.length);for(var i=0;i<additionalUrl.length;++i)oThis.WriteString2(additionalUrl[i]); oThis.EndRecord()}}oThis.EndRecord();break}case c_oAscFill.FILL_TYPE_SOLID:{oThis.StartRecord(c_oAscFill.FILL_TYPE_SOLID);if(fill.color)oThis.CorrectUniColorAlpha(fill.color,trans);oThis.WriteRecord1(0,fill.color,oThis.WriteUniColor);oThis.EndRecord();break}default:break}};this.WriteLn=function(ln){if(undefined===ln||null==ln)return;oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,ln.algn);oThis._WriteLimit2(1,ln.cap);oThis._WriteLimit2(2,ln.cmpd);oThis._WriteInt2(3,ln.w);oThis.WriteUChar(g_nodeAttributeEnd); oThis.WriteRecord2(0,ln.Fill,oThis.WriteUniFill);oThis.WriteRecord2(1,ln.prstDash,oThis.WriteLineDash);oThis.WriteRecord1(2,ln.Join,oThis.WriteLineJoin);oThis.WriteRecord2(3,ln.headEnd,oThis.WriteLineEnd);oThis.WriteRecord2(4,ln.tailEnd,oThis.WriteLineEnd)};this.WriteLineJoin=function(join){if(join==null||join===undefined){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0,0);oThis.WriteUChar(g_nodeAttributeEnd);return}oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0,join.type!=null&& join.type!==undefined?join.type:0);oThis._WriteInt2(1,join.limit);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteLineDash=function(dash){if(dash==null||dash===undefined)return;oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,dash);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteLineEnd=function(end){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,end.type);oThis._WriteLimit2(1,end.w);oThis._WriteLimit2(2,end.len);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteTxBody=function(txBody){if(txBody.bodyPr)oThis.WriteRecord2(0, txBody.bodyPr,oThis.WriteBodyPr);if(txBody.lstStyle)oThis.WriteRecord2(1,txBody.lstStyle,oThis.WriteTextListStyle);var _content=txBody.content.Content;oThis.WriteRecordArray(2,0,_content,oThis.WriteParagraph)};this.WriteParagraph=function(paragraph,startPos,endPos){var tPr=new AscFormat.CTextParagraphPr;tPr.bullet=paragraph.Pr.Bullet;tPr.lvl=paragraph.Pr.Lvl;tPr.pPr=paragraph.Pr;tPr.rPr=paragraph.Pr.DefaultRunPr;if(tPr.rPr==null)tPr.rPr=new CTextPr;oThis.WriteRecord1(0,tPr,oThis.WriteTextParagraphPr); oThis.WriteRecord2(1,paragraph.TextPr.Value,oThis.WriteRunProperties);oThis.StartRecord(2);var _position=oThis.pos;oThis.WriteULong(0);var _count=0;var _par_content=paragraph.Content;var _content_len=_par_content.length;for(var i=0;i<_content_len;i++){var _elem=_par_content[i];switch(_elem.Type){case para_Run:{var _run_len=_elem.Content.length;var _run_text="";for(var j=0;j<_run_len;j++)switch(_elem.Content[j].Type){case para_Text:{_run_text+=AscCommon.encodeSurrogateChar(_elem.Content[j].Value); break}case para_Space:{_run_text+=AscCommon.encodeSurrogateChar(_elem.Content[j].Value);break}case para_Tab:{_run_text+="\t";break}case para_NewLine:{if(""!=_run_text){oThis.StartRecord(0);oThis.WriteTextRun(_elem.Pr,_run_text,null);oThis.EndRecord();_count++;_run_text=""}oThis.StartRecord(0);oThis.WriteLineBreak(_elem.Pr,null);oThis.EndRecord();_count++;break}}if(_elem instanceof AscCommonWord.CPresentationField){oThis.StartRecord(0);oThis.WriteParagraphField(_elem.Guid,_elem.FieldType,_run_text, _elem.Pr,_elem.pPr);oThis.EndRecord();_count++}else if(""!=_run_text){oThis.StartRecord(0);oThis.WriteTextRun(_elem.Pr,_run_text,null);oThis.EndRecord();_count++}break}case para_Hyperlink:{var _hObj={Value:_elem.GetValue(),tooltip:_elem.GetToolTip()};var _content_len_h=_elem.Content.length;for(var hi=0;hi<_content_len_h;hi++){var _elem_h=_elem.Content[hi];switch(_elem_h.Type){case para_Run:{var _run_len=_elem_h.Content.length;var _run_text="";for(var j=0;j<_run_len;j++)switch(_elem_h.Content[j].Type){case para_Text:{_run_text+= AscCommon.encodeSurrogateChar(_elem_h.Content[j].Value);break}case para_Space:{_run_text+=" ";break}case para_Tab:{_run_text+="\t";break}case para_NewLine:{if(""!=_run_text){oThis.StartRecord(0);oThis.WriteTextRun(_elem_h.Pr,_run_text,_hObj);oThis.EndRecord();_count++;_run_text=""}oThis.StartRecord(0);oThis.WriteLineBreak(_elem_h.Pr,_hObj);oThis.EndRecord();_count++;break}}if(""!=_run_text){oThis.StartRecord(0);oThis.WriteTextRun(_elem.Content[0].Pr,_run_text,_hObj);oThis.EndRecord();_count++}break}case para_Math:{if(null!= _elem_h.Root){oThis.StartRecord(0);oThis.StartRecord(AscFormat.PARRUN_TYPE_MATHPARA);var _memory=new AscCommon.CMemory(true);_memory.ImData=oThis.ImData;_memory.data=oThis.data;_memory.len=oThis.len;_memory.pos=oThis.pos;oThis.UseContinueWriter++;if(!oThis.DocSaveParams)oThis.DocSaveParams=new AscCommonWord.DocSaveParams(false,false);var boMaths=new Binary_oMathWriter(_memory,null,oThis.DocSaveParams);boMaths.bs.WriteItemWithLength(function(){boMaths.WriteOMathPara(_elem_h)});oThis.ImData=_memory.ImData; oThis.data=_memory.data;oThis.len=_memory.len;oThis.pos=_memory.pos;oThis.UseContinueWriter--;_memory.ImData=null;_memory.data=null;oThis.EndRecord();oThis.EndRecord();_count++}}default:break}}break}case para_Math:{if(null!=_elem.Root){oThis.StartRecord(0);oThis.StartRecord(AscFormat.PARRUN_TYPE_MATHPARA);var _memory=new AscCommon.CMemory(true);_memory.ImData=oThis.ImData;_memory.data=oThis.data;_memory.len=oThis.len;_memory.pos=oThis.pos;oThis.UseContinueWriter++;if(!oThis.DocSaveParams)oThis.DocSaveParams= new AscCommonWord.DocSaveParams(false,false);var boMaths=new Binary_oMathWriter(_memory,null,oThis.DocSaveParams);boMaths.bs.WriteItemWithLength(function(){boMaths.WriteOMathPara(_elem)});oThis.ImData=_memory.ImData;oThis.data=_memory.data;oThis.len=_memory.len;oThis.pos=_memory.pos;oThis.UseContinueWriter--;_memory.ImData=null;_memory.data=null;oThis.EndRecord();oThis.EndRecord();_count++}}default:break}}var _new_pos=oThis.pos;oThis.pos=_position;oThis.WriteULong(_count);oThis.pos=_new_pos;oThis.EndRecord()}; this.WriteParagraphField=function(id,type,text,rPr,pPr){oThis.StartRecord(AscFormat.PARRUN_TYPE_FLD);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,id);oThis._WriteString2(1,type);oThis._WriteString2(2,text);oThis.WriteUChar(g_nodeAttributeEnd);if(rPr!==undefined&&rPr!=null){oThis.StartRecord(0);oThis.WriteRunProperties(rPr,null);oThis.EndRecord()}if(pPr!==undefined&&pPr!=null){var tPr=new AscFormat.CTextParagraphPr;tPr.bullet=pPr.Bullet;tPr.lvl=pPr.Lvl;tPr.pPr=pPr;tPr.rPr=pPr.DefaultRunPr; if(tPr.rPr==null)tPr.rPr=new CTextPr;oThis.WriteRecord1(1,tPr,oThis.WriteTextParagraphPr)}oThis.EndRecord()};this.WriteTextRun=function(runPr,text,hlinkObj){oThis.StartRecord(AscFormat.PARRUN_TYPE_RUN);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString2(0,text);oThis.WriteUChar(g_nodeAttributeEnd);if(runPr!==undefined&&runPr!=null){oThis.StartRecord(0);oThis.WriteRunProperties(runPr,hlinkObj);oThis.EndRecord()}oThis.EndRecord()};this.WriteLineBreak=function(runPr,hlinkObj){oThis.StartRecord(AscFormat.PARRUN_TYPE_BR); if(runPr!==undefined&&runPr!=null){oThis.StartRecord(0);oThis.WriteRunProperties(runPr,hlinkObj);oThis.EndRecord()}oThis.EndRecord()};this.WriteShapeStyle=function(style){oThis.WriteRecord1(0,style.lnRef,oThis.WriteStyleRef);oThis.WriteRecord1(1,style.fillRef,oThis.WriteStyleRef);oThis.WriteRecord1(2,style.effectRef,oThis.WriteStyleRef);oThis.WriteRecord1(3,style.fontRef,oThis.WriteFontRef)};this.WriteStyleRef=function(ref){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt2(0,ref.idx);oThis.WriteUChar(g_nodeAttributeEnd); oThis.WriteRecord1(0,ref.Color,oThis.WriteUniColor)};this.WriteFontRef=function(ref){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteUChar2(0,ref.idx);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord1(0,ref.Color,oThis.WriteUniColor)};this.WriteBg=function(bg){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,bg.bwMode);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,bg.bgPr,oThis.WriteBgPr);oThis.WriteRecord2(1,bg.bgRef,oThis.WriteStyleRef)};this.WriteBgPr=function(bgPr){oThis.WriteUChar(g_nodeAttributeStart); oThis._WriteBool2(0,bgPr.shadeToTitle);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord1(0,bgPr.Fill,oThis.WriteUniFill)};this.WriteShape=function(shape){if(shape.getObjectType()===AscDFH.historyitem_type_Cnx)oThis.StartRecord(3);else{oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteBool2(0,shape.attrUseBgFill);oThis.WriteUChar(g_nodeAttributeEnd)}shape.spPr.WriteXfrm=shape.spPr.xfrm;var tmpFill=shape.spPr.Fill;var isUseTmpFill=false;if(tmpFill!==undefined&&tmpFill!=null){var trans= tmpFill.transparent!=null&&tmpFill.transparent!=255?tmpFill.transparent:null;if(trans!=null)if(tmpFill.fill===undefined||tmpFill.fill==null){isUseTmpFill=true;shape.spPr.Fill=shape.brush}}var nvSpPr;if(shape.nvSpPr)nvSpPr=shape.nvSpPr;else nvSpPr={};nvSpPr.locks=shape.locks;nvSpPr.objectType=shape.getObjectType();if(nvSpPr.cNvPr)nvSpPr.cNvPr.shapeId=shape.Id;oThis.WriteRecord2(0,nvSpPr,oThis.WriteUniNvPr);oThis.WriteRecord1(1,shape.spPr,oThis.WriteSpPr);oThis.WriteRecord2(2,shape.style,oThis.WriteShapeStyle); oThis.WriteRecord2(3,shape.txBody,oThis.WriteTxBody);oThis.WriteRecord2(7,shape.signatureLine,oThis.WriteSignatureLine);if(isUseTmpFill)shape.spPr.Fill=tmpFill;shape.spPr.WriteXfrm=null;oThis.EndRecord()};this.WriteImage=function(image){var isOle=AscDFH.historyitem_type_OleObject==image.getObjectType();if(isOle){oThis.StartRecord(6);oThis.WriteRecord1(4,image,oThis.WriteOleInfo)}else{var _type;var bMedia=false,_fileMask;if(image.nvPicPr&&image.nvPicPr.nvPr&&image.nvPicPr.nvPr.unimedia&&image.nvPicPr.nvPr.unimedia.type!== null&&typeof image.nvPicPr.nvPr.unimedia.media==="string"&&image.nvPicPr.nvPr.unimedia.media.length>0){_type=image.nvPicPr.nvPr.unimedia.type;_fileMask=image.nvPicPr.nvPr.unimedia.media;bMedia=true}else _type=2;oThis.StartRecord(_type);if(bMedia)oThis.WriteRecord1(5,null,function(){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,_fileMask);oThis.WriteUChar(g_nodeAttributeEnd)})}var nvPicPr;if(image.nvPicPr)nvPicPr=image.nvPicPr;else nvPicPr={};nvPicPr.locks=image.locks;nvPicPr.objectType= image.getObjectType();if(nvPicPr.cNvPr)nvPicPr.cNvPr.shapeId=image.Id;oThis.WriteRecord1(0,nvPicPr,this.WriteUniNvPr);image.spPr.WriteXfrm=image.spPr.xfrm;var bSetGeometry=false;if(image.spPr.geometry===undefined||image.spPr.geometry==null){bSetGeometry=true;image.spPr.geometry=AscFormat.ExecuteNoHistory(function(){return AscFormat.CreateGeometry("rect")},this,[])}var unifill=new AscFormat.CUniFill;unifill.fill=image.blipFill;oThis.WriteRecord1(1,unifill,oThis.WriteUniFill);oThis.WriteRecord1(2,image.spPr, oThis.WriteSpPr);if(bSetGeometry)image.spPr.geometry=null;oThis.WriteRecord2(3,image.style,oThis.WriteShapeStyle);image.spPr.WriteXfrm=null;oThis.EndRecord()};this.WriteOleInfo=function(ole){var ratio=20*3/4;oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString2(0,ole.m_sApplicationId);oThis._WriteString2(1,ole.m_sData);oThis._WriteInt2(2,ratio*ole.m_nPixWidth);oThis._WriteInt2(3,ratio*ole.m_nPixHeight);oThis._WriteUChar2(4,0);oThis._WriteUChar2(5,0);oThis._WriteString2(7,ole.m_sObjectFile);oThis.WriteUChar(g_nodeAttributeEnd); if((ole.m_nOleType===0||ole.m_nOleType===1||ole.m_nOleType===2)&&ole.m_aBinaryData!==null){oThis.WriteRecord1(1,ole.m_nOleType,function(val){oThis.WriteUChar(val)});oThis.WriteRecord1(2,0,function(val){oThis.WriteBuffer(ole.m_aBinaryData,0,ole.m_aBinaryData.length)})}};this.WriteGrFrame=function(grObj){oThis.StartRecord(5);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd);var nvGraphicFramePr;if(grObj.nvGraphicFramePr)nvGraphicFramePr=grObj.nvGraphicFramePr;else nvGraphicFramePr= {};nvGraphicFramePr.locks=grObj.locks;var nObjectType=grObj.getObjectType();nvGraphicFramePr.objectType=nObjectType;if(nvGraphicFramePr.cNvPr)nvGraphicFramePr.cNvPr.shapeId=grObj.Id;oThis.WriteRecord1(0,nvGraphicFramePr,oThis.WriteUniNvPr);if(grObj.spPr&&grObj.spPr.xfrm&&grObj.spPr.xfrm.isNotNull())oThis.WriteRecord2(1,grObj.spPr.xfrm,oThis.WriteXfrm);switch(nObjectType){case AscDFH.historyitem_type_GraphicFrame:{oThis.WriteRecord2(2,grObj.graphicObject,oThis.WriteTable2);break}case AscDFH.historyitem_type_ChartSpace:{oThis.WriteRecord2(3, grObj,oThis.WriteChart2);break}case AscDFH.historyitem_type_SlicerView:{var slicer=grObj.getSlicer();var slicerType=slicer&&slicer.isExt()?6:5;oThis.WriteRecord2(slicerType,grObj,function(){grObj.toStream(oThis)});break}}oThis.EndRecord()};this.WriteChart2=function(grObj){var _memory=new AscCommon.CMemory(true);_memory.ImData=oThis.ImData;_memory.data=oThis.data;_memory.len=oThis.len;_memory.pos=oThis.pos;oThis.UseContinueWriter++;var oBinaryChartWriter=new AscCommon.BinaryChartWriter(_memory);oBinaryChartWriter.WriteCT_ChartSpace(grObj); oThis.ImData=_memory.ImData;oThis.data=_memory.data;oThis.len=_memory.len;oThis.pos=_memory.pos;oThis.UseContinueWriter--;_memory.ImData=null;_memory.data=null};this.WriteTable2=function(table){var obj={};obj.props=table.Pr;obj.look=table.TableLook;obj.style=table.TableStyle;oThis.WriteRecord1(0,obj,oThis.WriteTableProps);var grid=table.TableGrid;var _len=grid.length;oThis.StartRecord(1);oThis.WriteULong(_len);for(var i=0;i<_len;i++){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt1(0, grid[i]*36E3>>0);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}oThis.EndRecord();oThis.StartRecord(2);var rows_c=table.Content.length;oThis.WriteULong(rows_c);var _grid=oThis.GenerateTableWriteGrid(table);for(var i=0;i<rows_c;i++){oThis.StartRecord(0);oThis.WriteTableRow(table.Content[i],_grid.Rows[i]);oThis.EndRecord()}oThis.EndRecord()};this.GenerateTableWriteGrid=function(table){var TableGrid={};var _rows=table.Content;var _cols=table.TableGrid;var _cols_count=_cols.length;var _rows_count= _rows.length;TableGrid.Rows=new Array(_rows_count);for(var i=0;i<_rows_count;i++){TableGrid.Rows[i]={};TableGrid.Rows[i].Cells=[];var _index=0;var _cells_len=_rows[i].Content.length;for(var j=0;j<_cells_len;j++){var _cell=_rows[i].Content[j];var _cell_info={};_cell_info.Cell=_cell;_cell_info.row_span=1;_cell_info.grid_span=_cell.Pr.GridSpan===undefined||_cell.Pr.GridSpan==null?1:_cell.Pr.GridSpan;_cell_info.hMerge=false;_cell_info.vMerge=false;_cell_info.isEmpty=false;if(_cell.Pr.VMerge==vmerge_Continue)_cell_info.vMerge= true;TableGrid.Rows[i].Cells.push(_cell_info);if(_cell_info.grid_span>1)for(var t=_cell_info.grid_span-1;t>0;t--){var _cell_info_empty={};_cell_info_empty.isEmpty=true;_cell_info_empty.vMerge=_cell_info.vMerge;TableGrid.Rows[i].Cells.push(_cell_info_empty)}}}for(var i=0;i<_cols_count;i++){var _index=0;while(_index<_rows_count){var _count=1;for(var j=_index+1;j<_rows_count;j++){if(i>=TableGrid.Rows[j].Cells.length)continue;if(TableGrid.Rows[j].Cells[i].vMerge!==true)break;++_count}if(i<TableGrid.Rows[_index].Cells.length)TableGrid.Rows[_index].Cells[i].row_span= _count;_index+=_count}}return TableGrid};this.WriteEmptyTableCell=function(_info){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteBool1(3,true);if(true==_info.vMerge)oThis._WriteBool1(4,true);oThis.WriteUChar(g_nodeAttributeEnd);oThis.StartRecord(1);oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();oThis.StartRecord(2);oThis.WriteULong(1);oThis.StartRecord(0);oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd); oThis.EndRecord();oThis.EndRecord();oThis.EndRecord();oThis.EndRecord()};this.WriteTableRow=function(row,row_info){oThis.WriteUChar(g_nodeAttributeStart);if(row.Pr.Height!==undefined&&row.Pr.Height!=null){var fMaxTopMargin=0,fMaxBottomMargin=0,fMaxTopBorder=0,fMaxBottomBorder=0;for(i=0;i<row.Content.length;++i){var oCell=row.Content[i];var oMargins=oCell.GetMargins();if(oMargins.Bottom.W>fMaxBottomMargin)fMaxBottomMargin=oMargins.Bottom.W;if(oMargins.Top.W>fMaxTopMargin)fMaxTopMargin=oMargins.Top.W; var oBorders=oCell.Get_Borders();if(oBorders.Top.Size>fMaxTopBorder)fMaxTopBorder=oBorders.Top.Size;if(oBorders.Bottom.Size>fMaxBottomBorder)fMaxBottomBorder=oBorders.Bottom.Size}oThis._WriteInt1(0,(row.Pr.Height.Value+fMaxBottomMargin+fMaxTopMargin+fMaxTopBorder/2+fMaxBottomBorder/2)*36E3>>0)}oThis.WriteUChar(g_nodeAttributeEnd);oThis.StartRecord(0);var _len=row_info.Cells.length;oThis.WriteULong(_len);for(var i=0;i<_len;i++){oThis.StartRecord(1);var _info=row_info.Cells[i];if(_info.isEmpty)oThis.WriteEmptyTableCell(_info); else{oThis.WriteUChar(g_nodeAttributeStart);if(_info.vMerge===false&&_info.row_span>1)oThis._WriteInt1(1,_info.row_span);if(_info.hMerge===false&&_info.grid_span>1)oThis._WriteInt1(2,_info.grid_span);if(_info.hMerge===true)oThis._WriteBool1(3,true);if(_info.vMerge===true)oThis._WriteBool1(4,true);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteTableCell(_info.Cell)}oThis.EndRecord()}oThis.EndRecord()};this.WriteTableCell=function(cell){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);var _marg= cell.Pr.TableCellMar;var tableMar=cell.Row.Table.Pr.TableCellMar;if(_marg&&_marg.Left&&AscFormat.isRealNumber(_marg.Left.W))oThis._WriteInt1(0,_marg.Left.W*36E3>>0);else if(tableMar&&tableMar.Left&&AscFormat.isRealNumber(tableMar.Left.W))oThis._WriteInt1(0,tableMar.Left.W*36E3>>0);if(_marg&&_marg.Top&&AscFormat.isRealNumber(_marg.Top.W))oThis._WriteInt1(1,_marg.Top.W*36E3>>0);else if(tableMar&&tableMar.Top&&AscFormat.isRealNumber(tableMar.Top.W))oThis._WriteInt1(1,tableMar.Top.W*36E3>>0);if(_marg&& _marg.Right&&AscFormat.isRealNumber(_marg.Right.W))oThis._WriteInt1(2,_marg.Right.W*36E3>>0);else if(tableMar&&tableMar.Right&&AscFormat.isRealNumber(tableMar.Right.W))oThis._WriteInt1(2,tableMar.Right.W*36E3>>0);if(_marg&&_marg.Bottom&&AscFormat.isRealNumber(_marg.Bottom.W))oThis._WriteInt1(3,_marg.Bottom.W*36E3>>0);else if(tableMar&&tableMar.Bottom&&AscFormat.isRealNumber(tableMar.Bottom.W))oThis._WriteInt1(3,tableMar.Bottom.W*36E3>>0);if(AscFormat.isRealNumber(cell.Pr.TextDirection))switch(cell.Pr.TextDirection){case Asc.c_oAscCellTextDirection.LRTB:{oThis._WriteUChar1(5, 1);break}case Asc.c_oAscCellTextDirection.TBRL:{oThis._WriteUChar1(5,0);break}case Asc.c_oAscCellTextDirection.BTLR:{oThis._WriteUChar1(5,4);break}default:{oThis._WriteUChar1(5,1);break}}if(AscFormat.isRealNumber(cell.Pr.VAlign))switch(cell.Pr.VAlign){case vertalignjc_Bottom:{oThis._WriteUChar1(6,0);break}case vertalignjc_Center:{oThis._WriteUChar1(6,1);break}case vertalignjc_Top:{oThis._WriteUChar1(6,4);break}}oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord3(0,cell.Pr.TableCellBorders.Left, oThis.WriteTableCellBorder);oThis.WriteRecord3(1,cell.Pr.TableCellBorders.Top,oThis.WriteTableCellBorder);oThis.WriteRecord3(2,cell.Pr.TableCellBorders.Right,oThis.WriteTableCellBorder);oThis.WriteRecord3(3,cell.Pr.TableCellBorders.Bottom,oThis.WriteTableCellBorder);var shd=cell.Pr.Shd;if(shd!==undefined&&shd!=null)oThis.WriteRecord2(6,shd.Unifill,oThis.WriteUniFill);oThis.EndRecord();oThis.StartRecord(1);oThis.WriteRecordArray(2,0,cell.Content.Content,oThis.WriteParagraph);oThis.EndRecord()};this.WriteTableProps= function(obj){oThis.WriteUChar(g_nodeAttributeStart);if(oThis.tableStylesGuides.hasOwnProperty(obj.style))oThis._WriteString1(0,oThis.tableStylesGuides[obj.style]);oThis._WriteBool1(2,obj.look.m_bFirst_Row);oThis._WriteBool1(3,obj.look.m_bFirst_Col);oThis._WriteBool1(4,obj.look.m_bLast_Row);oThis._WriteBool1(5,obj.look.m_bLast_Col);oThis._WriteBool1(6,obj.look.m_bBand_Hor);oThis._WriteBool1(7,obj.look.m_bBand_Ver);oThis.WriteUChar(g_nodeAttributeEnd);var shd=obj.props.Shd;if(shd!==undefined&&shd!= null)if(shd.Unifill!==undefined&&shd.Unifill!=null)if(shd.Unifill.fill!==undefined&&shd.Unifill.fill!=null)oThis.WriteRecord1(0,shd.Unifill,oThis.WriteUniFill)};this.WriteGroupShape=function(group,type){if(AscFormat.isRealNumber(type))oThis.StartRecord(type);else oThis.StartRecord(4);group.spPr.WriteXfrm=group.spPr.xfrm;if(group.nvGrpSpPr){var _old_ph=group.nvGrpSpPr.nvPr.ph;group.nvGrpSpPr.nvPr.ph=null;group.nvGrpSpPr.locks=group.locks;group.nvGrpSpPr.objectType=group.getObjectType();group.nvGrpSpPr.cNvPr.shapeId= group.Id;oThis.WriteRecord1(0,group.nvGrpSpPr,oThis.WriteUniNvPr);group.nvGrpSpPr.nvPr.ph=_old_ph}oThis.WriteRecord1(1,group.spPr,oThis.WriteGrpSpPr);group.spPr.WriteXfrm=null;var spTree=group.spTree;var _len=spTree.length;if(0!=_len)oThis.WriteSpTree(spTree);oThis.EndRecord()};this.WriteGrpSpPr=function(grpSpPr){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,grpSpPr.bwMode);oThis.WriteUChar(g_nodeAttributeEnd);if(grpSpPr.WriteXfrm&&grpSpPr.WriteXfrm.isNotNull())oThis.WriteRecord2(0, grpSpPr.WriteXfrm,oThis.WriteXfrm);oThis.WriteRecord1(1,grpSpPr.Fill,oThis.WriteUniFill)};this.WriteSpPr=function(spPr){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit2(0,spPr.bwMode);oThis.WriteUChar(g_nodeAttributeEnd);var _fill=spPr.Fill;var bIsExistFill=false;if(_fill!==undefined&&_fill!=null&&_fill.fill!==undefined&&_fill.fill!=null)bIsExistFill=true;var bIsExistLn=false;if(spPr.ln!==undefined&&spPr.ln!=null){_fill=spPr.ln.Fill;if(_fill!==undefined&&_fill!=null&&_fill.fill!==undefined&& _fill.fill!=null)bIsExistLn=true}if(spPr.xfrm&&spPr.xfrm.isNotNull())oThis.WriteRecord2(0,spPr.xfrm,oThis.WriteXfrm);oThis.WriteRecord2(1,spPr.geometry,oThis.WriteGeometry);if(spPr.geometry===undefined||spPr.geometry==null)if(bIsExistFill||bIsExistLn){oThis.StartRecord(1);oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,"rect");oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord();oThis.EndRecord()}oThis.WriteRecord1(2,spPr.Fill,oThis.WriteUniFill);oThis.WriteRecord2(3, spPr.ln,oThis.WriteLn);var oEffectPr=spPr.effectProps;if(oEffectPr)if(oEffectPr.EffectLst)oThis.WriteRecord1(4,oEffectPr.EffectLst,oThis.WriteEffectLst);else if(oEffectPr.EffectDag)oThis.WriteRecord1(4,oEffectPr.EffectDag,oThis.WriteEffectDag)};this.WriteEffectLst=function(oEffectLst){oThis.StartRecord(1);oThis.WriteRecord2(0,oEffectLst.blur,oThis.WriteEffect);oThis.WriteRecord2(1,oEffectLst.fillOverlay,oThis.WriteEffect);oThis.WriteRecord2(2,oEffectLst.glow,oThis.WriteEffect);oThis.WriteRecord2(3, oEffectLst.innerShdw,oThis.WriteEffect);oThis.WriteRecord2(4,oEffectLst.outerShdw,oThis.WriteEffect);oThis.WriteRecord2(5,oEffectLst.prstShdw,oThis.WriteEffect);oThis.WriteRecord2(6,oEffectLst.reflection,oThis.WriteEffect);oThis.WriteRecord2(7,oEffectLst.softEdge,oThis.WriteEffect);oThis.EndRecord()};this.WriteXfrm=function(xfrm){if(oThis.IsWordWriter===true)return oThis.WriteXfrmRot(xfrm);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt4(0,xfrm.offX,c_dScalePPTXSizes);oThis._WriteInt4(1,xfrm.offY, c_dScalePPTXSizes);oThis._WriteInt4(2,xfrm.extX,c_dScalePPTXSizes);oThis._WriteInt4(3,xfrm.extY,c_dScalePPTXSizes);oThis._WriteInt4(4,xfrm.chOffX,c_dScalePPTXSizes);oThis._WriteInt4(5,xfrm.chOffY,c_dScalePPTXSizes);oThis._WriteInt4(6,xfrm.chExtX,c_dScalePPTXSizes);oThis._WriteInt4(7,xfrm.chExtY,c_dScalePPTXSizes);oThis._WriteBool2(8,xfrm.flipH);oThis._WriteBool2(9,xfrm.flipV);oThis._WriteInt4(10,xfrm.rot,180*6E4/Math.PI);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteSignatureLine=function(oSignatureLine){oThis.WriteUChar(g_nodeAttributeStart); oThis._WriteUChar2(2,1);oThis._WriteString2(3,oSignatureLine.id);oThis._WriteBool2(4,true);oThis._WriteString2(5,"{00000000-0000-0000-0000-000000000000}");oThis._WriteBool2(6,oSignatureLine.showDate);oThis._WriteString2(7,oSignatureLine.instructions);oThis._WriteString2(10,oSignatureLine.signer);oThis._WriteString2(11,oSignatureLine.signer2);oThis._WriteString2(12,oSignatureLine.email);oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteXfrmRot=function(xfrm){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteInt4(0, xfrm.offX,c_dScalePPTXSizes);oThis._WriteInt4(1,xfrm.offY,c_dScalePPTXSizes);oThis._WriteInt4(2,xfrm.extX,c_dScalePPTXSizes);oThis._WriteInt4(3,xfrm.extY,c_dScalePPTXSizes);oThis._WriteInt4(4,xfrm.chOffX,c_dScalePPTXSizes);oThis._WriteInt4(5,xfrm.chOffY,c_dScalePPTXSizes);oThis._WriteInt4(6,xfrm.chExtX,c_dScalePPTXSizes);oThis._WriteInt4(7,xfrm.chExtY,c_dScalePPTXSizes);oThis._WriteBool2(8,xfrm.flipH);oThis._WriteBool2(9,xfrm.flipV);if(xfrm.rot!=null){var nCheckInvert=0;if(true==xfrm.flipH)nCheckInvert+= 1;if(true==xfrm.flipV)nCheckInvert+=1;var _rot=xfrm.rot*180*6E4/Math.PI>>0;var _n360=360*6E4;if(_rot>_n360){var _nDel=_rot/_n360>>0;_rot=_rot-_nDel*_n360}else if(_rot<0){var _nDel=-_rot/_n360>>0;_nDel+=1;_rot=_rot+_nDel*_n360}if(nCheckInvert==1)_rot=_n360-_rot;oThis._WriteInt1(10,_rot)}oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteSpCNvPr=function(locks){oThis.WriteUChar(g_nodeAttributeStart);if(locks&AscFormat.LOCKS_MASKS.noAdjustHandles)oThis._WriteBool2(1,!!(locks&AscFormat.LOCKS_MASKS.noAdjustHandles<< 1));if(locks&AscFormat.LOCKS_MASKS.noChangeArrowheads)oThis._WriteBool2(2,!!(locks&AscFormat.LOCKS_MASKS.noChangeArrowheads<<1));if(locks&AscFormat.LOCKS_MASKS.noChangeAspect)oThis._WriteBool2(3,!!(locks&AscFormat.LOCKS_MASKS.noChangeAspect<<1));if(locks&AscFormat.LOCKS_MASKS.noChangeShapeType)oThis._WriteBool2(4,!!(locks&AscFormat.LOCKS_MASKS.noChangeShapeType<<1));if(locks&AscFormat.LOCKS_MASKS.noEditPoints)oThis._WriteBool2(5,!!(locks&AscFormat.LOCKS_MASKS.noEditPoints<<1));if(locks&AscFormat.LOCKS_MASKS.noGrp)oThis._WriteBool2(6, !!(locks&AscFormat.LOCKS_MASKS.noGrp<<1));if(locks&AscFormat.LOCKS_MASKS.noMove)oThis._WriteBool2(7,!!(locks&AscFormat.LOCKS_MASKS.noMove<<1));if(locks&AscFormat.LOCKS_MASKS.noResize)oThis._WriteBool2(8,!!(locks&AscFormat.LOCKS_MASKS.noResize<<1));if(locks&AscFormat.LOCKS_MASKS.noRot)oThis._WriteBool2(9,!!(locks&AscFormat.LOCKS_MASKS.noRot<<1));if(locks&AscFormat.LOCKS_MASKS.noSelect)oThis._WriteBool2(10,!!(locks&AscFormat.LOCKS_MASKS.noSelect<<1));if(locks&AscFormat.LOCKS_MASKS.noTextEdit)oThis._WriteBool2(11, !!(locks&AscFormat.LOCKS_MASKS.noTextEdit<<1));oThis.WriteUChar(g_nodeAttributeEnd)};this.WritePicCNvPr=function(locks){oThis.WriteUChar(g_nodeAttributeStart);if(locks&AscFormat.LOCKS_MASKS.noAdjustHandles)oThis._WriteBool2(1,!!(locks&AscFormat.LOCKS_MASKS.noAdjustHandles<<1));if(locks&AscFormat.LOCKS_MASKS.noChangeArrowheads)oThis._WriteBool2(2,!!(locks&AscFormat.LOCKS_MASKS.noChangeArrowheads<<1));if(locks&AscFormat.LOCKS_MASKS.noChangeAspect)oThis._WriteBool2(3,!!(locks&AscFormat.LOCKS_MASKS.noChangeAspect<< 1));if(locks&AscFormat.LOCKS_MASKS.noChangeShapeType)oThis._WriteBool2(4,!!(locks&AscFormat.LOCKS_MASKS.noChangeShapeType<<1));if(locks&AscFormat.LOCKS_MASKS.noCrop)oThis._WriteBool2(5,!!(locks&AscFormat.LOCKS_MASKS.noCrop<<1));if(locks&AscFormat.LOCKS_MASKS.noEditPoints)oThis._WriteBool2(6,!!(locks&AscFormat.LOCKS_MASKS.noEditPoints<<1));if(locks&AscFormat.LOCKS_MASKS.noGrp)oThis._WriteBool2(7,!!(locks&AscFormat.LOCKS_MASKS.noGrp<<1));if(locks&AscFormat.LOCKS_MASKS.noMove)oThis._WriteBool2(8,!!(locks& AscFormat.LOCKS_MASKS.noMove<<1));if(locks&AscFormat.LOCKS_MASKS.noResize)oThis._WriteBool2(9,!!(locks&AscFormat.LOCKS_MASKS.noResize<<1));if(locks&AscFormat.LOCKS_MASKS.noRot)oThis._WriteBool2(10,!!(locks&AscFormat.LOCKS_MASKS.noRot<<1));if(locks&AscFormat.LOCKS_MASKS.noSelect)oThis._WriteBool2(11,!!(locks&AscFormat.LOCKS_MASKS.noSelect<<1));oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteGrpCNvPr=function(locks){oThis.WriteUChar(g_nodeAttributeStart);if(locks&AscFormat.LOCKS_MASKS.noChangeAspect)oThis._WriteBool2(0, !!(locks&AscFormat.LOCKS_MASKS.noChangeAspect<<1));if(locks&AscFormat.LOCKS_MASKS.noGrp)oThis._WriteBool2(1,!!(locks&AscFormat.LOCKS_MASKS.noGrp<<1));if(locks&AscFormat.LOCKS_MASKS.noMove)oThis._WriteBool2(2,!!(locks&AscFormat.LOCKS_MASKS.noMove<<1));if(locks&AscFormat.LOCKS_MASKS.noResize)oThis._WriteBool2(3,!!(locks&AscFormat.LOCKS_MASKS.noResize<<1));if(locks&AscFormat.LOCKS_MASKS.noRot)oThis._WriteBool2(4,!!(locks&AscFormat.LOCKS_MASKS.noRot<<1));if(locks&AscFormat.LOCKS_MASKS.noSelect)oThis._WriteBool2(5, !!(locks&AscFormat.LOCKS_MASKS.noSelect<<1));if(locks&AscFormat.LOCKS_MASKS.noUngrp)oThis._WriteBool2(6,!!(locks&AscFormat.LOCKS_MASKS.noUngrp<<1));oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteGrFrameCNvPr=function(locks){oThis.WriteUChar(g_nodeAttributeStart);if(locks&AscFormat.LOCKS_MASKS.noChangeAspect)oThis._WriteBool2(0,!!(locks&AscFormat.LOCKS_MASKS.noChangeAspect<<1));if(locks&AscFormat.LOCKS_MASKS.noDrilldown)oThis._WriteBool2(1,!!(locks&AscFormat.LOCKS_MASKS.noDrilldown<<1));if(locks& AscFormat.LOCKS_MASKS.noGrp)oThis._WriteBool2(2,!!(locks&AscFormat.LOCKS_MASKS.noGrp<<1));if(locks&AscFormat.LOCKS_MASKS.noMove)oThis._WriteBool2(3,!!(locks&AscFormat.LOCKS_MASKS.noMove<<1));if(locks&AscFormat.LOCKS_MASKS.noResize)oThis._WriteBool2(4,!!(locks&AscFormat.LOCKS_MASKS.noResize<<1));if(locks&AscFormat.LOCKS_MASKS.noSelect)oThis._WriteBool2(5,!!(locks&AscFormat.LOCKS_MASKS.noSelect<<1));oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteCnxCNvPr=function(pr){var locks=pr.locks;oThis.WriteUChar(g_nodeAttributeStart); if(locks&AscFormat.LOCKS_MASKS.noAdjustHandles)oThis._WriteBool2(0,!!(locks&AscFormat.LOCKS_MASKS.noAdjustHandles<<1));if(locks&AscFormat.LOCKS_MASKS.noChangeArrowheads)oThis._WriteBool2(1,!!(locks&AscFormat.LOCKS_MASKS.noChangeArrowheads<<1));if(locks&AscFormat.LOCKS_MASKS.noChangeAspect)oThis._WriteBool2(2,!!(locks&AscFormat.LOCKS_MASKS.noChangeAspect<<1));if(locks&AscFormat.LOCKS_MASKS.noChangeShapeType)oThis._WriteBool2(3,!!(locks&AscFormat.LOCKS_MASKS.noChangeShapeType<<1));if(locks&AscFormat.LOCKS_MASKS.noEditPoints)oThis._WriteBool2(4, !!(locks&AscFormat.LOCKS_MASKS.noEditPoints<<1));if(locks&AscFormat.LOCKS_MASKS.noGrp)oThis._WriteBool2(5,!!(locks&AscFormat.LOCKS_MASKS.noGrp<<1));if(locks&AscFormat.LOCKS_MASKS.noMove)oThis._WriteBool2(6,!!(locks&AscFormat.LOCKS_MASKS.noMove<<1));if(locks&AscFormat.LOCKS_MASKS.noResize)oThis._WriteBool2(7,!!(locks&AscFormat.LOCKS_MASKS.noResize<<1));if(locks&AscFormat.LOCKS_MASKS.noRot)oThis._WriteBool2(8,!!(locks&AscFormat.LOCKS_MASKS.noRot<<1));if(locks&AscFormat.LOCKS_MASKS.noSelect)oThis._WriteBool2(9, !!(locks&AscFormat.LOCKS_MASKS.noSelect<<1));if(pr.stCnxId&&AscFormat.isRealNumber(pr.stCnxIdx)){if(!AscFormat.isRealNumber(oThis.arr_map_shapes_id[pr.stCnxId]))oThis.arr_map_shapes_id[pr.stCnxId]=++oThis.max_shape_id;oThis._WriteInt2(10,oThis.arr_map_shapes_id[pr.stCnxId]);oThis._WriteInt2(11,pr.stCnxIdx)}if(pr.endCnxId&&AscFormat.isRealNumber(pr.endCnxIdx)){if(!AscFormat.isRealNumber(oThis.arr_map_shapes_id[pr.endCnxId]))oThis.arr_map_shapes_id[pr.endCnxId]=++oThis.max_shape_id;oThis._WriteInt2(12, oThis.arr_map_shapes_id[pr.endCnxId]);oThis._WriteInt2(13,pr.endCnxIdx)}oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteUniNvPr=function(nv){oThis.WriteRecord2(0,nv.cNvPr,oThis.Write_cNvPr);if(AscFormat.isRealNumber(nv.locks)&&(nv.locks!==0||nv.nvUniSpPr)&&AscFormat.isRealNumber(nv.objectType))switch(nv.objectType){case AscDFH.historyitem_type_Shape:{oThis.WriteRecord1(1,nv.locks,oThis.WriteSpCNvPr);break}case AscDFH.historyitem_type_ImageShape:{oThis.WriteRecord1(1,nv.locks,oThis.WritePicCNvPr); break}case AscDFH.historyitem_type_GroupShape:{oThis.WriteRecord1(1,nv.locks,oThis.WriteGrpCNvPr);break}case AscDFH.historyitem_type_GraphicFrame:case AscDFH.historyitem_type_ChartSpace:case AscDFH.historyitem_type_SlicerView:{oThis.WriteRecord1(1,nv.locks,oThis.WriteGrFrameCNvPr);break}case AscDFH.historyitem_type_Cnx:{nv.nvUniSpPr.locks=nv.locks;oThis.WriteRecord1(1,nv.nvUniSpPr,oThis.WriteCnxCNvPr);break}}nv.locks=null;nv.objectType=null;oThis.WriteRecord2(2,nv.nvPr,oThis.Write_nvPr)};this.Write_cNvPr= function(cNvPr){oThis.WriteUChar(g_nodeAttributeStart);if(cNvPr.shapeId){if(AscFormat.isRealNumber(oThis.arr_map_shapes_id[cNvPr.shapeId]))cNvPr.id=oThis.arr_map_shapes_id[cNvPr.shapeId];else oThis.arr_map_shapes_id[cNvPr.shapeId]=++oThis.max_shape_id;cNvPr.id=oThis.arr_map_shapes_id[cNvPr.shapeId]}oThis._WriteInt1(0,cNvPr.id);oThis._WriteString1(1,cNvPr.name);oThis._WriteBool1(2,cNvPr.isHidden);oThis._WriteString2(3,cNvPr.title);oThis._WriteString2(4,cNvPr.descr);oThis.WriteUChar(g_nodeAttributeEnd); oThis.WriteRecord2(0,cNvPr.hlinkClick,oThis.Write_Hyperlink2);oThis.WriteRecord2(1,cNvPr.hlinkHover,oThis.Write_Hyperlink2)};this.Write_Hyperlink2=function(hyper){oThis.WriteUChar(g_nodeAttributeStart);var id=hyper.id;var action=hyper.action;if(id==="ppaction://hlinkshowjump?jump=firstslide"){action=id;id=""}else if(id==="ppaction://hlinkshowjump?jump=lastslide"){action=id;id=""}else if(id==="ppaction://hlinkshowjump?jump=nextslide"){action=id;id=""}else if(id==="ppaction://hlinkshowjump?jump=previousslide"){action= id;id=""}else if(typeof id==="string"){var mask="ppaction://hlinksldjumpslide";var indSlide=id.indexOf(mask);if(0===indSlide){var slideNum=parseInt(id.substring(mask.length));id="slide"+(slideNum+1)+".xml";action="ppaction://hlinksldjump"}}oThis._WriteString2(0,id);oThis._WriteString2(1,hyper.invalidUrl);oThis._WriteString2(2,action);oThis._WriteString2(3,hyper.tgtFrame);oThis._WriteString2(4,hyper.tooltip);oThis._WriteBool2(5,hyper.history);oThis._WriteBool2(6,hyper.highlightClick);oThis._WriteBool2(7, hyper.endSnd);oThis.WriteUChar(g_nodeAttributeEnd)};this.Write_nvPr=function(nvPr){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteBool2(0,nvPr.isPhoto);oThis._WriteBool2(1,nvPr.userDrawn);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,nvPr.ph,oThis.Write_ph)};this.Write_ph=function(ph){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteBool2(0,ph.hasCustomPrompt);oThis._WriteString2(1,ph.idx);oThis._WriteLimit2(2,ph.orient);oThis._WriteLimit2(3,ph.sz);oThis._WriteLimit2(4,ph.type); oThis.WriteUChar(g_nodeAttributeEnd)};this.WriteGeometry=function(geom){if(undefined===geom||null==geom)return;if(typeof geom.preset==="string"&&geom.preset.length>0){oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,geom.preset);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteAdj(geom.gdLst,geom.avLst,0);oThis.EndRecord()}else{oThis.StartRecord(2);oThis.WriteAdj(geom.gdLst,geom.avLst,0);oThis.WriteGuides(geom.gdLstInfo,1);oThis.WriteAh(geom.ahXYLstInfo,geom.ahPolarLstInfo, 2);oThis.WriteCnx(geom.cnxLstInfo,3);oThis.WritePathLst(geom.pathLst,4);oThis.WriteRecord2(5,geom.rectS,oThis.WriteTextRect);oThis.EndRecord()}};this.WritePrstTxWarp=function(prstTxWarp){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteLimit1(0,AscFormat.getNumByTxPrst(prstTxWarp.preset));oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteAdj(prstTxWarp.gdLst,prstTxWarp.avLst,0)};this.WriteAdj=function(gdLst,avLst,rec_num){var _len=0;for(var i in avLst)++_len;if(0==_len)return;oThis.StartRecord(rec_num); oThis.WriteULong(_len);for(var i in avLst){oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString1(0,i);oThis._WriteInt1(1,15);oThis._WriteString1(2,""+(gdLst[i]>>0));oThis.WriteUChar(g_nodeAttributeEnd);oThis.EndRecord()}oThis.EndRecord()};this.WriteGuides=function(gdLst,rec_num){var _len=gdLst.length;if(0==rec_num)return;this.StartRecord(rec_num);this.WriteULong(_len);for(var i=0;i<_len;i++){this.StartRecord(1);var _gd=gdLst[i];this.WriteUChar(g_nodeAttributeStart);this._WriteString1(0, _gd.name);this._WriteInt1(1,_gd.formula);this._WriteString2(2,_gd.x);this._WriteString2(3,_gd.y);this._WriteString2(4,_gd.z);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord()}this.EndRecord()};this.WriteAh=function(ahLstXY,ahLstPolar,rec_num){var _len=0;for(var i in ahLstXY)++_len;for(var i in ahLstPolar)++_len;if(0==rec_num)return;this.StartRecord(rec_num);this.WriteULong(_len);for(var i in ahLstXY){this.StartRecord(1);var _ah=ahLstXY[i];this.StartRecord(2);this.WriteUChar(g_nodeAttributeStart); this._WriteString2(0,_ah.posX);this._WriteString2(1,_ah.posY);this._WriteString2(2,_ah.gdRefX);this._WriteString2(3,_ah.gdRefY);this._WriteString2(4,_ah.maxX);this._WriteString2(5,_ah.maxY);this._WriteString2(6,_ah.minX);this._WriteString2(7,_ah.minY);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();this.EndRecord()}for(var i in ahLstPolar){this.StartRecord(1);var _ah=ahLstPolar[i];this.StartRecord(2);this.WriteUChar(g_nodeAttributeStart);this._WriteString2(0,_ah.posX);this._WriteString2(1,_ah.posY); this._WriteString2(2,_ah.gdRefAng);this._WriteString2(3,_ah.gdRefR);this._WriteString2(4,_ah.maxAng);this._WriteString2(5,_ah.maxR);this._WriteString2(6,_ah.minAng);this._WriteString2(7,_ah.minR);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();this.EndRecord()}this.EndRecord()};this.WriteCnx=function(cnxLst,rec_num){var _len=0;for(var i in cnxLst)++_len;if(0==rec_num)return;this.StartRecord(rec_num);this.WriteULong(_len);for(var i in cnxLst){this.StartRecord(1);var _gd=cnxLst[i];this.WriteUChar(g_nodeAttributeStart); this._WriteString1(0,_gd.x);this._WriteString1(1,_gd.y);this._WriteString1(2,_gd.ang);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord()}this.EndRecord()};this.WriteTextRect=function(rect){oThis.WriteUChar(g_nodeAttributeStart);oThis._WriteString2(0,rect.l);oThis._WriteString2(1,rect.t);oThis._WriteString2(2,rect.r);oThis._WriteString2(3,rect.b);oThis.WriteUChar(g_nodeAttributeEnd)};this.WritePathLst=function(pathLst,rec_num){var _len=pathLst.length;if(0==_len)return;this.StartRecord(rec_num);this.WriteULong(_len); for(var i=0;i<_len;i++){this.StartRecord(1);var _path=pathLst[i];this.WriteUChar(g_nodeAttributeStart);this._WriteBool2(0,_path.extrusionOk);if(_path.fill!=null&&_path.fill!==undefined)this._WriteLimit1(1,_path.fill=="none"?4:5);this._WriteInt2(2,_path.pathH);this._WriteBool2(3,_path.stroke);this._WriteInt2(4,_path.pathW);this.WriteUChar(g_nodeAttributeEnd);var _comms=_path.ArrPathCommandInfo;var _count=_comms.length;if(0!=_count){this.StartRecord(0);this.WriteULong(_count);for(var j=0;j<_count;j++){this.StartRecord(0); var cmd=_comms[j];switch(cmd.id){case AscFormat.moveTo:{this.StartRecord(1);this.WriteUChar(g_nodeAttributeStart);this._WriteString1(0,""+cmd.X);this._WriteString1(1,""+cmd.Y);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();break}case AscFormat.lineTo:{this.StartRecord(2);this.WriteUChar(g_nodeAttributeStart);this._WriteString1(0,""+cmd.X);this._WriteString1(1,""+cmd.Y);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();break}case AscFormat.bezier3:{this.StartRecord(6);this.WriteUChar(g_nodeAttributeStart); this._WriteString1(0,""+cmd.X0);this._WriteString1(1,""+cmd.Y0);this._WriteString1(2,""+cmd.X1);this._WriteString1(3,""+cmd.Y1);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();break}case AscFormat.bezier4:{this.StartRecord(4);this.WriteUChar(g_nodeAttributeStart);this._WriteString1(0,""+cmd.X0);this._WriteString1(1,""+cmd.Y0);this._WriteString1(2,""+cmd.X1);this._WriteString1(3,""+cmd.Y1);this._WriteString1(4,""+cmd.X2);this._WriteString1(5,""+cmd.Y2);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord(); break}case AscFormat.arcTo:{this.StartRecord(5);this.WriteUChar(g_nodeAttributeStart);this._WriteString1(0,""+cmd.wR);this._WriteString1(1,""+cmd.hR);this._WriteString1(2,""+cmd.stAng);this._WriteString1(3,""+cmd.swAng);this.WriteUChar(g_nodeAttributeEnd);this.EndRecord();break}case AscFormat.close:{this.StartRecord(3);this.EndRecord();break}}this.EndRecord()}this.EndRecord()}this.EndRecord()}this.EndRecord()};this.WriteTableStyle=function(num,tableStyle){oThis.StartRecord(1);oThis.WriteUChar(g_nodeAttributeStart); oThis._WriteString1(0,oThis.tableStylesGuides[num]);var __name=tableStyle.Name;__name=__name.replace(/&/g,"_");__name=__name.replace(/>/g,"_");__name=__name.replace(/</g,"_");__name=__name.replace(/"/g,"_");__name=__name.replace(/'/g,"_");oThis._WriteString2(1,__name);oThis.WriteUChar(g_nodeAttributeEnd);if(undefined!==tableStyle.TablePr.Shd&&null!=tableStyle.TablePr.Shd){oThis.StartRecord(0);if(tableStyle.TablePr.Shd.Unifill!=null&&tableStyle.TablePr.Shd.Unifill!==undefined){oThis.StartRecord(0); oThis.WriteRecord2(0,tableStyle.TablePr.Shd.Unifill,oThis.WriteUniFill);oThis.EndRecord()}if(tableStyle.TablePr.Shd.FillRef!=null&&tableStyle.TablePr.Shd.FillRef!==undefined)oThis.WriteRecord2(1,tableStyle.TablePr.Shd.FillRef,oThis.WriteStyleRef);oThis.EndRecord()}if(tableStyle.TableWholeTable){oThis.StartRecord(1);oThis.WriteTableStylePartWH(tableStyle.TableWholeTable,tableStyle.TablePr);oThis.EndRecord()}oThis.WriteRecord2(2,tableStyle.TableBand1Horz,oThis.WriteTableStylePart);oThis.WriteRecord2(3, tableStyle.TableBand2Horz,oThis.WriteTableStylePart);oThis.WriteRecord2(4,tableStyle.TableBand1Vert,oThis.WriteTableStylePart);oThis.WriteRecord2(5,tableStyle.TableBand2Vert,oThis.WriteTableStylePart);oThis.WriteRecord2(6,tableStyle.TableLastCol,oThis.WriteTableStylePart);oThis.WriteRecord2(7,tableStyle.TableFirstCol,oThis.WriteTableStylePart);oThis.WriteRecord2(8,tableStyle.TableFirstRow,oThis.WriteTableStylePart);oThis.WriteRecord2(9,tableStyle.TableLastRow,oThis.WriteTableStylePart);oThis.WriteRecord2(10, tableStyle.TableBRCell,oThis.WriteTableStylePart);oThis.WriteRecord2(11,tableStyle.TableBLCell,oThis.WriteTableStylePart);oThis.WriteRecord2(12,tableStyle.TableTRCell,oThis.WriteTableStylePart);oThis.WriteRecord2(13,tableStyle.TableTLCell,oThis.WriteTableStylePart);oThis.EndRecord()};this.WriteTableStylePart=function(_part){var bIsFontRef=false;if(_part.TextPr.FontRef!==undefined&&_part.TextPr.FontRef!=null)bIsFontRef=true;var bIsFill=false;if(_part.TextPr.Unifill!==undefined&&_part.TextPr.Unifill!= null)bIsFill=true;if(bIsFontRef||bIsFill){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);if(AscFormat.isRealBool(_part.TextPr.Italic))oThis._WriteLimit1(0,_part.TextPr.Italic===true?0:1);if(AscFormat.isRealBool(_part.TextPr.Bold))oThis._WriteLimit1(1,_part.TextPr.Bold===true?0:1);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,_part.TextPr.FontRef,oThis.WriteFontRef);if(bIsFill&&_part.TextPr.Unifill.fill!==undefined&&_part.TextPr.Unifill.fill!=null&&_part.TextPr.Unifill.fill.type== c_oAscFill.FILL_TYPE_SOLID)oThis.WriteRecord2(1,_part.TextPr.Unifill.fill.color,oThis.WriteUniColor);oThis.EndRecord()}oThis.StartRecord(1);oThis.StartRecord(0);oThis.WriteRecord3(0,_part.TableCellPr.TableCellBorders.Left,oThis.WriteTableCellBorderLineStyle);oThis.WriteRecord3(1,_part.TableCellPr.TableCellBorders.Right,oThis.WriteTableCellBorderLineStyle);oThis.WriteRecord3(2,_part.TableCellPr.TableCellBorders.Top,oThis.WriteTableCellBorderLineStyle);oThis.WriteRecord3(3,_part.TableCellPr.TableCellBorders.Bottom, oThis.WriteTableCellBorderLineStyle);oThis.WriteRecord3(4,_part.TableCellPr.TableCellBorders.InsideH,oThis.WriteTableCellBorderLineStyle);oThis.WriteRecord3(5,_part.TableCellPr.TableCellBorders.InsideV,oThis.WriteTableCellBorderLineStyle);oThis.EndRecord();var _Shd=_part.TableCellPr.Shd;if(undefined!==_Shd&&null!=_Shd){oThis.WriteRecord2(1,_Shd.FillRef,oThis.WriteStyleRef);if(_Shd.Unifill!==undefined&&_Shd.Unifill!=null){oThis.StartRecord(2);oThis.WriteRecord2(0,_Shd.Unifill,oThis.WriteUniFill);oThis.EndRecord()}}oThis.EndRecord()}; this.WriteTableStylePartWH=function(_part,tablePr){var bIsFontRef=false;if(_part.TextPr.FontRef!==undefined&&_part.TextPr.FontRef!=null)bIsFontRef=true;var bIsFill=false;if(_part.TextPr.Unifill!==undefined&&_part.TextPr.Unifill!=null)bIsFill=true;if(bIsFontRef||bIsFill){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,_part.TextPr.FontRef,oThis.WriteFontRef);if(bIsFill&&_part.TextPr.Unifill.fill!==undefined&&_part.TextPr.Unifill.fill!= null&&_part.TextPr.Unifill.fill.type==c_oAscFill.FILL_TYPE_SOLID)oThis.WriteRecord2(1,_part.TextPr.Unifill.fill.color,oThis.WriteUniColor);oThis.EndRecord()}oThis.StartRecord(1);oThis.StartRecord(0);var bIsRet=false;bIsRet=oThis.WriteRecord3(0,tablePr.TableBorders.Left,oThis.WriteTableCellBorderLineStyle);if(!bIsRet)oThis.WriteTableCellBorderLineStyle2(0,tablePr.TableBorders.Left);bIsRet=oThis.WriteRecord3(1,tablePr.TableBorders.Right,oThis.WriteTableCellBorderLineStyle);if(!bIsRet)oThis.WriteTableCellBorderLineStyle2(1, tablePr.TableBorders.Right);bIsRet=oThis.WriteRecord3(2,tablePr.TableBorders.Top,oThis.WriteTableCellBorderLineStyle);if(!bIsRet)oThis.WriteTableCellBorderLineStyle2(2,tablePr.TableBorders.Top);bIsRet=oThis.WriteRecord3(3,tablePr.TableBorders.Bottom,oThis.WriteTableCellBorderLineStyle);if(!bIsRet)oThis.WriteTableCellBorderLineStyle2(3,tablePr.TableBorders.Bottom);if(tablePr.TableBorders.InsideH)oThis.WriteTableCellBorderLineStyle2(4,tablePr.TableBorders.InsideH);if(tablePr.TableBorders.InsideV)oThis.WriteTableCellBorderLineStyle2(5, tablePr.TableBorders.InsideV);oThis.EndRecord();var _Shd=_part.TableCellPr.Shd;if(undefined!==_Shd&&null!=_Shd){oThis.WriteRecord2(1,_Shd.FillRef,oThis.WriteStyleRef);if(_Shd.Unifill!==undefined&&_Shd.Unifill!=null){oThis.StartRecord(2);oThis.WriteRecord2(0,_Shd.Unifill,oThis.WriteUniFill);oThis.EndRecord()}}oThis.EndRecord()};this.WriteTableCellBorder=function(_border){if(_border.Value==border_None){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd); var _unifill=new AscFormat.CUniFill;_unifill.fill=new AscFormat.CNoFill;oThis.WriteRecord2(0,_unifill,oThis.WriteUniFill);oThis.EndRecord();return}var bIsFill=false;var bIsSize=false;if(_border.Unifill!==undefined&&_border.Unifill!=null)bIsFill=true;if(_border.Size!==undefined&&_border.Size!=null)bIsSize=true;if(bIsFill||bIsSize){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);if(bIsSize)oThis._WriteInt2(3,_border.Size*36E3>>0);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0, _border.Unifill,oThis.WriteUniFill);oThis.EndRecord()}};this.WriteTableCellBorderLineStyle2=function(rec_type,_border){if(!_border){oThis.StartRecord(rec_type);oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd);var _unifill=new AscFormat.CUniFill;_unifill.fill=new AscFormat.CNoFill;oThis.WriteRecord2(0,_unifill,oThis.WriteUniFill);oThis.EndRecord();oThis.EndRecord();return}else oThis.WriteRecord3(rec_type,_border,oThis.WriteTableCellBorderLineStyle)}; this.WriteTableCellBorderLineStyle=function(_border){if(_border.Value==border_None){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);oThis.WriteUChar(g_nodeAttributeEnd);var _unifill=new AscFormat.CUniFill;_unifill.fill=new AscFormat.CNoFill;oThis.WriteRecord2(0,_unifill,oThis.WriteUniFill);oThis.EndRecord();return}var bIsFill=false;var bIsSize=false;var bIsLnRef=false;if(_border.Unifill!==undefined&&_border.Unifill!=null)bIsFill=true;if(_border.Size!==undefined&&_border.Size!=null)bIsSize= true;if(bIsFill&&bIsSize){oThis.StartRecord(0);oThis.WriteUChar(g_nodeAttributeStart);if(bIsSize)oThis._WriteInt2(3,_border.Size*36E3>>0);oThis.WriteUChar(g_nodeAttributeEnd);oThis.WriteRecord2(0,_border.Unifill,oThis.WriteUniFill);oThis.EndRecord()}oThis.WriteRecord2(1,_border.LineRef,oThis.WriteStyleRef)}}function CPPTXContentWriter(){this.BinaryFileWriter=new AscCommon.CBinaryFileWriter;this.BinaryFileWriter.Init();this.TreeDrawingIndex=0;this.ShapeTextBoxContent=null;this.arrayStackStartsTextBoxContent= [];this.arrayStackStarts=[];this.Start_UseFullUrl=function(){this.BinaryFileWriter.Start_UseFullUrl()};this.Start_UseDocumentOrigin=function(origin){this.BinaryFileWriter.Start_UseDocumentOrigin(origin)};this.End_UseFullUrl=function(){return this.BinaryFileWriter.End_UseFullUrl()};this._Start=function(){this.ShapeTextBoxContent=new AscCommon.CMemory;this.arrayStackStartsTextBoxContent=[];this.arrayStackStarts=[]};this._End=function(){this.ShapeTextBoxContent=null};this.WriteTextBody=function(memory, textBody){if(this.BinaryFileWriter.UseContinueWriter>0){this.BinaryFileWriter.ImData=memory.ImData;this.BinaryFileWriter.data=memory.data;this.BinaryFileWriter.len=memory.len;this.BinaryFileWriter.pos=memory.pos}else{this.TreeDrawingIndex++;this.arrayStackStarts.push(this.BinaryFileWriter.pos)}var _writer=this.BinaryFileWriter;_writer.StartRecord(0);_writer.WriteTxBody(textBody);_writer.EndRecord();if(this.BinaryFileWriter.UseContinueWriter>0){memory.ImData=this.BinaryFileWriter.ImData;memory.data= this.BinaryFileWriter.data;memory.len=this.BinaryFileWriter.len;memory.pos=this.BinaryFileWriter.pos}else{this.TreeDrawingIndex--;var oldPos=this.arrayStackStarts[this.arrayStackStarts.length-1];memory.WriteBuffer(this.BinaryFileWriter.data,oldPos,this.BinaryFileWriter.pos-oldPos);this.BinaryFileWriter.pos=oldPos;this.arrayStackStarts.splice(this.arrayStackStarts.length-1,1)}};this.WriteClrMapOverride=function(memory,clrMapOverride){if(this.BinaryFileWriter.UseContinueWriter>0){this.BinaryFileWriter.ImData= memory.ImData;this.BinaryFileWriter.data=memory.data;this.BinaryFileWriter.len=memory.len;this.BinaryFileWriter.pos=memory.pos}else{this.TreeDrawingIndex++;this.arrayStackStarts.push(this.BinaryFileWriter.pos)}var _writer=this.BinaryFileWriter;_writer.StartRecord(0);_writer.StartRecord(0);_writer.WriteClrMapOvr(clrMapOverride);_writer.EndRecord();_writer.EndRecord();if(this.BinaryFileWriter.UseContinueWriter>0){memory.ImData=this.BinaryFileWriter.ImData;memory.data=this.BinaryFileWriter.data;memory.len= this.BinaryFileWriter.len;memory.pos=this.BinaryFileWriter.pos}else{this.TreeDrawingIndex--;var oldPos=this.arrayStackStarts[this.arrayStackStarts.length-1];memory.WriteBuffer(this.BinaryFileWriter.data,oldPos,this.BinaryFileWriter.pos-oldPos);this.BinaryFileWriter.pos=oldPos;this.arrayStackStarts.splice(this.arrayStackStarts.length-1,1)}};this.WriteSpPr=function(memory,spPr,type){if(this.BinaryFileWriter.UseContinueWriter>0){this.BinaryFileWriter.ImData=memory.ImData;this.BinaryFileWriter.data=memory.data; this.BinaryFileWriter.len=memory.len;this.BinaryFileWriter.pos=memory.pos}else{this.TreeDrawingIndex++;this.arrayStackStarts.push(this.BinaryFileWriter.pos)}var _writer=this.BinaryFileWriter;_writer.StartRecord(0);if(0==type)_writer.WriteLn(spPr);else if(1==type)_writer.WriteUniFill(spPr);else _writer.WriteSpPr(spPr);_writer.EndRecord();if(this.BinaryFileWriter.UseContinueWriter>0){memory.ImData=this.BinaryFileWriter.ImData;memory.data=this.BinaryFileWriter.data;memory.len=this.BinaryFileWriter.len; memory.pos=this.BinaryFileWriter.pos}else{this.TreeDrawingIndex--;var oldPos=this.arrayStackStarts[this.arrayStackStarts.length-1];memory.WriteBuffer(this.BinaryFileWriter.data,oldPos,this.BinaryFileWriter.pos-oldPos);this.BinaryFileWriter.pos=oldPos;this.arrayStackStarts.splice(this.arrayStackStarts.length-1,1)}};this.WriteRunProperties=function(memory,rPr){if(this.BinaryFileWriter.UseContinueWriter>0){this.BinaryFileWriter.ImData=memory.ImData;this.BinaryFileWriter.data=memory.data;this.BinaryFileWriter.len= memory.len;this.BinaryFileWriter.pos=memory.pos}else{this.TreeDrawingIndex++;this.arrayStackStarts.push(this.BinaryFileWriter.pos)}var _writer=this.BinaryFileWriter;_writer.StartRecord(0);_writer.WriteRunProperties(rPr);_writer.EndRecord();if(this.BinaryFileWriter.UseContinueWriter>0){memory.ImData=this.BinaryFileWriter.ImData;memory.data=this.BinaryFileWriter.data;memory.len=this.BinaryFileWriter.len;memory.pos=this.BinaryFileWriter.pos}else{this.TreeDrawingIndex--;var oldPos=this.arrayStackStarts[this.arrayStackStarts.length- 1];memory.WriteBuffer(this.BinaryFileWriter.data,oldPos,this.BinaryFileWriter.pos-oldPos);this.BinaryFileWriter.pos=oldPos;this.arrayStackStarts.splice(this.arrayStackStarts.length-1,1)}};this.WriteDrawing=function(memory,grObject,Document,oMapCommentId,oNumIdMap,copyParams,saveParams){if(this.BinaryFileWriter.UseContinueWriter>0){this.BinaryFileWriter.ImData=memory.ImData;this.BinaryFileWriter.data=memory.data;this.BinaryFileWriter.len=memory.len;this.BinaryFileWriter.pos=memory.pos}else{this.TreeDrawingIndex++; this.arrayStackStarts.push(this.BinaryFileWriter.pos)}this.BinaryFileWriter.StartRecord(0);this.BinaryFileWriter.StartRecord(1);this.WriteGrObj(grObject,Document,oMapCommentId,oNumIdMap,copyParams,saveParams);this.BinaryFileWriter.EndRecord();this.BinaryFileWriter.EndRecord();if(this.BinaryFileWriter.UseContinueWriter>0){memory.ImData=this.BinaryFileWriter.ImData;memory.data=this.BinaryFileWriter.data;memory.len=this.BinaryFileWriter.len;memory.pos=this.BinaryFileWriter.pos}else{this.TreeDrawingIndex--; var oldPos=this.arrayStackStarts[this.arrayStackStarts.length-1];memory.WriteBuffer(this.BinaryFileWriter.data,oldPos,this.BinaryFileWriter.pos-oldPos);this.BinaryFileWriter.pos=oldPos;this.arrayStackStarts.splice(this.arrayStackStarts.length-1,1)}};this.WriteGrObj=function(grObject,Document,oMapCommentId,oNumIdMap,copyParams,saveParams){switch(grObject.getObjectType()){case AscDFH.historyitem_type_Shape:case AscDFH.historyitem_type_Cnx:{if(grObject.bWordShape)this.WriteShape(grObject,Document,oMapCommentId, oNumIdMap,copyParams,saveParams);else this.WriteShape2(grObject,Document,oMapCommentId,oNumIdMap,copyParams,saveParams);break}case AscDFH.historyitem_type_OleObject:case AscDFH.historyitem_type_ImageShape:{if(grObject.bWordShape)this.WriteImage(grObject);else this.WriteImage2(grObject);break}case AscDFH.historyitem_type_GroupShape:{this.WriteGroup(grObject,Document,oMapCommentId,oNumIdMap,copyParams,saveParams);break}case AscDFH.historyitem_type_LockedCanvas:{if(!grObject.group)this.BinaryFileWriter.WriteGroupShape(grObject, 9);break}case AscDFH.historyitem_type_ChartSpace:case AscDFH.historyitem_type_SlicerView:{this.BinaryFileWriter.WriteGrFrame(grObject);break}}};this.WriteShape2=function(shape,Document,oMapCommentId,oNumIdMap,copyParams,saveParams){var _writer=this.BinaryFileWriter;_writer.WriteShape(shape)};this.WriteShape=function(shape,Document,oMapCommentId,oNumIdMap,copyParams,saveParams){var _writer=this.BinaryFileWriter;if(shape.getObjectType()===AscDFH.historyitem_type_Cnx)_writer.StartRecord(3);else{_writer.StartRecord(1); _writer.WriteUChar(AscCommon.g_nodeAttributeStart);_writer._WriteBool2(0,shape.attrUseBgFill);_writer.WriteUChar(AscCommon.g_nodeAttributeEnd)}shape.spPr.WriteXfrm=shape.spPr.xfrm;var tmpFill=shape.spPr.Fill;var isUseTmpFill=false;if(tmpFill!==undefined&&tmpFill!=null){var trans=tmpFill.transparent!=null&&tmpFill.transparent!=255?tmpFill.transparent:null;if(trans!=null)if(tmpFill.fill===undefined||tmpFill.fill==null){isUseTmpFill=true;shape.spPr.Fill=shape.brush}}_writer.WriteRecord1(0,{locks:shape.locks, objectType:shape.getObjectType()},_writer.WriteUniNvPr);_writer.WriteRecord1(1,shape.spPr,_writer.WriteSpPr);_writer.WriteRecord2(2,shape.style,_writer.WriteShapeStyle);if(shape.textBoxContent){_writer.StartRecord(4);var memory=this.ShapeTextBoxContent;this.arrayStackStartsTextBoxContent.push(memory.pos);var bdtw=new BinaryDocumentTableWriter(memory,Document,oMapCommentId,oNumIdMap,copyParams,saveParams);var bcw=new AscCommon.BinaryCommonWriter(memory);bcw.WriteItemWithLength(function(){bdtw.WriteDocumentContent(shape.textBoxContent)}); var oldPos=this.arrayStackStartsTextBoxContent[this.arrayStackStartsTextBoxContent.length-1];_writer.WriteBuffer(memory.data,oldPos,memory.pos-oldPos);memory.pos=oldPos;this.arrayStackStartsTextBoxContent.splice(this.arrayStackStartsTextBoxContent.length-1,1);_writer.EndRecord();_writer.StartRecord(5);_writer.WriteBodyPr(shape.bodyPr);_writer.EndRecord()}_writer.WriteRecord2(7,shape.signatureLine,_writer.WriteSignatureLine);if(isUseTmpFill)shape.spPr.Fill=tmpFill;delete shape.spPr.WriteXfrm;_writer.EndRecord()}; this.WriteImage2=function(image){var _writer=this.BinaryFileWriter;_writer.WriteImage(image)};this.WriteImage=function(image){var _writer=this.BinaryFileWriter;var isOle=AscDFH.historyitem_type_OleObject==image.getObjectType();var _type,_fileMask;if(isOle){_writer.StartRecord(6);_writer.WriteRecord1(4,image,_writer.WriteOleInfo)}else{var _type;var bMedia=false;if(image.nvPicPr&&image.nvPicPr.nvPr&&image.nvPicPr.nvPr.unimedia&&image.nvPicPr.nvPr.unimedia.type!==null&&typeof image.nvPicPr.nvPr.unimedia.media=== "string"&&image.nvPicPr.nvPr.unimedia.media.length>0){_type=image.nvPicPr.nvPr.unimedia.type;_fileMask=image.nvPicPr.nvPr.unimedia.media;bMedia=true}else _type=2;_writer.StartRecord(_type);if(bMedia)_writer.WriteRecord1(5,null,function(){_writer.WriteUChar(g_nodeAttributeStart);_writer._WriteString2(0,_fileMask);_writer.WriteUChar(g_nodeAttributeEnd)})}_writer.WriteRecord1(0,{locks:image.locks,objectType:image.getObjectType()},_writer.WriteUniNvPr);image.spPr.WriteXfrm=image.spPr.xfrm;var _unifill= null;if(image.blipFill instanceof AscFormat.CUniFill)_unifill=image.blipFill;else{_unifill=new AscFormat.CUniFill;_unifill.fill=image.blipFill}_writer.WriteRecord1(1,_unifill,_writer.WriteUniFill);_writer.WriteRecord1(2,image.spPr,_writer.WriteSpPr);_writer.WriteRecord2(3,image.style,_writer.WriteShapeStyle);delete image.spPr.WriteXfrm;_writer.EndRecord()};this.WriteOleInfo=function(ole){var ratio=20*3/4;var _writer=this.BinaryFileWriter;_writer.WriteUChar(g_nodeAttributeStart);_writer._WriteString2(0, ole.m_sApplicationId);_writer._WriteString2(1,ole.m_sData);_writer._WriteInt2(2,ratio*ole.m_nPixWidth);_writer._WriteInt2(3,ratio*ole.m_nPixHeight);_writer._WriteUChar2(4,0);_writer._WriteUChar2(5,0);_writer._WriteString2(7,ole.m_sObjectFile);_writer.WriteUChar(g_nodeAttributeEnd)};this.WriteGroup=function(group,Document,oMapCommentId,oNumIdMap,copyParams,saveParams){var _writer=this.BinaryFileWriter;_writer.StartRecord(4);group.spPr.WriteXfrm=group.spPr.xfrm;_writer.WriteRecord1(1,group.spPr,_writer.WriteGrpSpPr); delete group.spPr.WriteXfrm;var spTree=group.spTree;var _len=spTree.length;if(0!=_len){_writer.StartRecord(2);_writer.WriteULong(_len);for(var i=0;i<_len;i++){_writer.StartRecord(0);var elem=spTree[i];this.WriteGrObj(elem,Document,oMapCommentId,oNumIdMap,copyParams,saveParams);_writer.EndRecord(0)}_writer.EndRecord()}_writer.EndRecord()};this.WriteTheme=function(memory,theme){if(this.BinaryFileWriter.UseContinueWriter>0){this.BinaryFileWriter.ImData=memory.ImData;this.BinaryFileWriter.data=memory.data; this.BinaryFileWriter.len=memory.len;this.BinaryFileWriter.pos=memory.pos}else{this.TreeDrawingIndex++;this.arrayStackStarts.push(this.BinaryFileWriter.pos)}this.BinaryFileWriter.WriteTheme(theme);if(this.BinaryFileWriter.UseContinueWriter>0){memory.ImData=this.BinaryFileWriter.ImData;memory.data=this.BinaryFileWriter.data;memory.len=this.BinaryFileWriter.len;memory.pos=this.BinaryFileWriter.pos}else{this.TreeDrawingIndex--;var oldPos=this.arrayStackStarts[this.arrayStackStarts.length-1];memory.WriteBuffer(this.BinaryFileWriter.data, oldPos,this.BinaryFileWriter.pos-oldPos);this.BinaryFileWriter.pos=oldPos;this.arrayStackStarts.splice(this.arrayStackStarts.length-1,1)}}}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].GUID=GUID;window["AscCommon"].c_oMainTables=c_oMainTables;window["AscCommon"].CBinaryFileWriter=CBinaryFileWriter;window["AscCommon"].pptx_content_writer=new CPPTXContentWriter})(window);"use strict";(function(window,undefined){var global_mouseEvent=AscCommon.global_mouseEvent;function HitInLine(context, px,py,x0,y0,x1,y1){var tx,ty,dx,dy,d;tx=x1-x0;ty=y1-y0;d=1.5/Math.sqrt(tx*tx+ty*ty);if(typeof global_mouseEvent!=="undefined"&&AscCommon.isRealObject(global_mouseEvent)&&AscFormat.isRealNumber(global_mouseEvent.KoefPixToMM))d*=global_mouseEvent.KoefPixToMM;if(global_mouseEvent&&global_mouseEvent.AscHitToHandlesEpsilon)d=global_mouseEvent.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);dx=-ty*d;dy=tx*d;context.beginPath();context.moveTo(x0,y0);context.lineTo(x0+dx,y0+dy);context.lineTo(x1+dx,y1+dy); context.lineTo(x1-dx,y1-dy);context.lineTo(x0-dx,y0-dy);context.closePath();return context.isPointInPath(px,py)}function HitInBezier4(context,px,py,x0,y0,x1,y1,x2,y2,x3,y3){var l=Math.min(x0,x1,x2,x3);var t=Math.min(y0,y1,y2,y3);var r=Math.max(x0,x1,x2,x3);var b=Math.max(y0,y1,y2,y3);if(px<l||px>r||py<t||py>b)return false;var tx,ty,dx,dy,d;tx=x3-x0;ty=y3-y0;d=1.5/Math.sqrt(tx*tx+ty*ty);if(typeof global_mouseEvent!=="undefined"&&AscCommon.isRealObject(global_mouseEvent)&&AscFormat.isRealNumber(global_mouseEvent.KoefPixToMM))d*= global_mouseEvent.KoefPixToMM;if(global_mouseEvent&&global_mouseEvent.AscHitToHandlesEpsilon)d=global_mouseEvent.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);dx=-ty*d;dy=tx*d;context.beginPath();context.moveTo(x0,y0);context.lineTo(x0+dx,y0+dy);context.bezierCurveTo(x1+dx,y1+dy,x2+dx,y2+dy,x3+dx,y3+dy);context.lineTo(x3-dx,y3-dy);context.bezierCurveTo(x2-dx,y2-dy,x1-dx,y1-dy,x0-dx,y0-dy);context.closePath();return context.isPointInPath(px,py)}function HitInBezier3(context,px,py,x0,y0,x1,y1,x2,y2){var l= Math.min(x0,x1,x2);var t=Math.min(y0,y1,y2);var r=Math.max(x0,x1,x2);var b=Math.max(y0,y1,y2);if(px<l||px>r||py<t||py>b)return false;var tx,ty,dx,dy,d;tx=x2-x0;ty=y2-y0;d=1.5/Math.sqrt(tx*tx+ty*ty);if(typeof global_mouseEvent!=="undefined"&&AscCommon.isRealObject(global_mouseEvent)&&AscFormat.isRealNumber(global_mouseEvent.KoefPixToMM))d*=global_mouseEvent.KoefPixToMM;if(global_mouseEvent&&global_mouseEvent.AscHitToHandlesEpsilon)d=global_mouseEvent.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);dx= -ty*d;dy=tx*d;context.beginPath();context.moveTo(x0,y0);context.lineTo(x0+dx,y0+dy);context.quadraticCurveTo(x1+dx,y1+dy,x2+dx,y2+dy);context.lineTo(x2-dx,y2-dy);context.quadraticCurveTo(x1-dx,y1-dy,x0-dx,y0-dy);context.closePath();return context.isPointInPath(px,py)}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].HitInLine=HitInLine;window["AscFormat"].HitInBezier4=HitInBezier4;window["AscFormat"].HitInBezier3=HitInBezier3})(window);"use strict";(function(window,undefined){var HitInBezier4= AscFormat.HitInBezier4;function Arc3(ctx,fX,fY,fWidth,fHeight,fStartAngle,fSweepAngle){var sin1=Math.sin(fStartAngle);var cos1=Math.cos(fStartAngle);var __x=cos1/fWidth;var __y=sin1/fHeight;var l=1/Math.sqrt(__x*__x+__y*__y);var cx=fX-l*cos1;var cy=fY-l*sin1;Arc2(ctx,cx-fWidth,cy-fHeight,2*fWidth,2*fHeight,fStartAngle,fSweepAngle)}function Arc2(ctx,fX,fY,fWidth,fHeight,fStartAngle,fSweepAngle){if(0>=fWidth||0>=fHeight)return;fStartAngle=-fStartAngle;fSweepAngle=-fSweepAngle;if(false){var fStartX= fX+fWidth/2+fWidth/2*Math.cos(AngToEllPrm(fStartAngle,fWidth/2,fHeight/2));var fStartY=fY+fHeight/2-fHeight/2*Math.sin(AngToEllPrm(fStartAngle,fWidth/2,fHeight/2));if(fSweepAngle<2*Math.PI)ctx._m(fStartX,fStartY)}var bClockDirection=false;var fEndAngle=2*Math.PI-(fSweepAngle+fStartAngle);var fSrtAngle=2*Math.PI-fStartAngle;if(fSweepAngle>0)bClockDirection=true;if(Math.abs(fSweepAngle)>=2*Math.PI)Ellipse(ctx,fX+fWidth/2,fY+fHeight/2,fWidth/2,fHeight/2);else EllipseArc(ctx,fX+fWidth/2,fY+fHeight/2, fWidth/2,fHeight/2,fSrtAngle,fEndAngle,bClockDirection)}function AngToEllPrm(fAngle,fXRad,fYRad){return Math.atan2(Math.sin(fAngle)/fYRad,Math.cos(fAngle)/fXRad)}function Ellipse(ctx,fX,fY,fXRad,fYRad){ctx._m(fX-fXRad,fY);var c_fKappa=.552;ctx._c(fX-fXRad,fY+fYRad*c_fKappa,fX-fXRad*c_fKappa,fY+fYRad,fX,fY+fYRad);ctx._c(fX+fXRad*c_fKappa,fY+fYRad,fX+fXRad,fY+fYRad*c_fKappa,fX+fXRad,fY);ctx._c(fX+fXRad,fY-fYRad*c_fKappa,fX+fXRad*c_fKappa,fY-fYRad,fX,fY-fYRad);ctx._c(fX-fXRad*c_fKappa,fY-fYRad,fX-fXRad, fY-fYRad*c_fKappa,fX-fXRad,fY)}function EllipseArc(ctx,fX,fY,fXRad,fYRad,fAngle1,fAngle2,bClockDirection){while(fAngle1<0)fAngle1+=2*Math.PI;while(fAngle1>2*Math.PI)fAngle1-=2*Math.PI;while(fAngle2<0)fAngle2+=2*Math.PI;while(fAngle2>=2*Math.PI)fAngle2-=2*Math.PI;if(!bClockDirection)if(fAngle1<=fAngle2)EllipseArc2(ctx,fX,fY,fXRad,fYRad,fAngle1,fAngle2,false);else{EllipseArc2(ctx,fX,fY,fXRad,fYRad,fAngle1,2*Math.PI,false);EllipseArc2(ctx,fX,fY,fXRad,fYRad,0,fAngle2,false)}else if(fAngle1>=fAngle2)EllipseArc2(ctx, fX,fY,fXRad,fYRad,fAngle1,fAngle2,true);else{EllipseArc2(ctx,fX,fY,fXRad,fYRad,fAngle1,0,true);EllipseArc2(ctx,fX,fY,fXRad,fYRad,2*Math.PI,fAngle2,true)}}function EllipseArc2(ctx,fX,fY,fXRad,fYRad,dAngle1,dAngle2,bClockDirection){var nFirstPointQuard=(2*dAngle1/Math.PI>>0)+1;var nSecondPointQuard=(2*dAngle2/Math.PI>>0)+1;nSecondPointQuard=Math.min(4,Math.max(1,nSecondPointQuard));nFirstPointQuard=Math.min(4,Math.max(1,nFirstPointQuard));var fStartX=fX+fXRad*Math.cos(AngToEllPrm(dAngle1,fXRad,fYRad)); var fStartY=fY+fYRad*Math.sin(AngToEllPrm(dAngle1,fXRad,fYRad));var EndPoint={X:0,Y:0};var fCurX=fStartX,fCurY=fStartY;var dStartAngle=dAngle1;var dEndAngle=0;if(!bClockDirection)for(var nIndex=nFirstPointQuard;nIndex<=nSecondPointQuard;nIndex++){if(nIndex==nSecondPointQuard)dEndAngle=dAngle2;else dEndAngle=nIndex*Math.PI/2;if(!(nIndex==nFirstPointQuard))dStartAngle=(nIndex-1)*Math.PI/2;EndPoint=EllipseArc3(ctx,fX,fY,fXRad,fYRad,AngToEllPrm(dStartAngle,fXRad,fYRad),AngToEllPrm(dEndAngle,fXRad,fYRad), false)}else for(var nIndex=nFirstPointQuard;nIndex>=nSecondPointQuard;nIndex--){if(nIndex==nFirstPointQuard)dStartAngle=dAngle1;else dStartAngle=nIndex*Math.PI/2;if(!(nIndex==nSecondPointQuard))dEndAngle=(nIndex-1)*Math.PI/2;else dEndAngle=dAngle2;EndPoint=EllipseArc3(ctx,fX,fY,fXRad,fYRad,AngToEllPrm(dStartAngle,fXRad,fYRad),AngToEllPrm(dEndAngle,fXRad,fYRad),false)}}function EllipseArc3(ctx,fX,fY,fXRad,fYRad,dAngle1,dAngle2,bClockDirection){var fAlpha=Math.sin(dAngle2-dAngle1)*(Math.sqrt(4+3*Math.tan((dAngle2- dAngle1)/2)*Math.tan((dAngle2-dAngle1)/2))-1)/3;var sin1=Math.sin(dAngle1);var cos1=Math.cos(dAngle1);var sin2=Math.sin(dAngle2);var cos2=Math.cos(dAngle2);var fX1=fX+fXRad*cos1;var fY1=fY+fYRad*sin1;var fX2=fX+fXRad*cos2;var fY2=fY+fYRad*sin2;var fCX1=fX1-fAlpha*fXRad*sin1;var fCY1=fY1+fAlpha*fYRad*cos1;var fCX2=fX2+fAlpha*fXRad*sin2;var fCY2=fY2-fAlpha*fYRad*cos2;if(!bClockDirection){ctx._c(fCX1,fCY1,fCX2,fCY2,fX2,fY2);return{X:fX2,Y:fY2}}else{ctx._c(fCX2,fCY2,fCX1,fCY1,fX1,fY1);return{X:fX1,Y:fY1}}} function _ArcToOnCanvas(context,start_x,start_y,width_r,height_r,start_ang,sweep_ang){var _sin=Math.sin(start_ang);var _cos=Math.cos(start_ang);var _x=_cos/width_r;var _y=_sin/height_r;var _l=1/Math.sqrt(_x*_x+_y*_y);var _cx=start_x-_l*_cos;var _cy=start_y-_l*_sin;ArcTo2OnCanvas(context,_cx-width_r,_cy-height_r,2*width_r,2*height_r,start_ang,sweep_ang)}function ArcTo2OnCanvas(context,_l_c_x,_l_c_y,width,height,start_ang,sweep_ang){if(0>=width||0>=height)return;start_ang=-start_ang;sweep_ang=-sweep_ang; var bClockDirection=false;var fEndAngle=2*Math.PI-(sweep_ang+start_ang);var fSrtAngle=2*Math.PI-start_ang;if(sweep_ang>0)bClockDirection=true;if(Math.abs(sweep_ang)>=2*Math.PI)EllipseOnCanvas(context,_l_c_x+width/2,_l_c_y+height/2,width/2,height/2);else EllipseArcOnCanvas(context,_l_c_x+width/2,_l_c_y+height/2,width/2,height/2,fSrtAngle,fEndAngle,bClockDirection)}function EllipseOnCanvas(ctx,fX,fY,fXRad,fYRad){ctx.moveTo(fX-fXRad,fY);var c_fKappa=.552;ctx.bezierCurveTo(fX-fXRad,fY+fYRad*c_fKappa, fX-fXRad*c_fKappa,fY+fYRad,fX,fY+fYRad);ctx.bezierCurveTo(fX+fXRad*c_fKappa,fY+fYRad,fX+fXRad,fY+fYRad*c_fKappa,fX+fXRad,fY);ctx.bezierCurveTo(fX+fXRad,fY-fYRad*c_fKappa,fX+fXRad*c_fKappa,fY-fYRad,fX,fY-fYRad);ctx.bezierCurveTo(fX-fXRad*c_fKappa,fY-fYRad,fX-fXRad,fY-fYRad*c_fKappa,fX-fXRad,fY)}function EllipseArcOnCanvas(ctx,fX,fY,fXRad,fYRad,fAngle1,fAngle2,bClockDirection){while(fAngle1<0)fAngle1+=2*Math.PI;while(fAngle1>2*Math.PI)fAngle1-=2*Math.PI;while(fAngle2<0)fAngle2+=2*Math.PI;while(fAngle2>= 2*Math.PI)fAngle2-=2*Math.PI;if(!bClockDirection)if(fAngle1<=fAngle2)EllipseArc2OnCanvas(ctx,fX,fY,fXRad,fYRad,fAngle1,fAngle2,false);else{EllipseArc2OnCanvas(ctx,fX,fY,fXRad,fYRad,fAngle1,2*Math.PI,false);EllipseArc2OnCanvas(ctx,fX,fY,fXRad,fYRad,0,fAngle2,false)}else if(fAngle1>=fAngle2)EllipseArc2OnCanvas(ctx,fX,fY,fXRad,fYRad,fAngle1,fAngle2,true);else{EllipseArc2OnCanvas(ctx,fX,fY,fXRad,fYRad,fAngle1,0,true);EllipseArc2OnCanvas(ctx,fX,fY,fXRad,fYRad,2*Math.PI,fAngle2,true)}}function EllipseArc2OnCanvas(ctx, fX,fY,fXRad,fYRad,dAngle1,dAngle2,bClockDirection){var nFirstPointQuard=(2*dAngle1/Math.PI>>0)+1;var nSecondPointQuard=(2*dAngle2/Math.PI>>0)+1;nSecondPointQuard=Math.min(4,Math.max(1,nSecondPointQuard));nFirstPointQuard=Math.min(4,Math.max(1,nFirstPointQuard));var fStartX=fX+fXRad*Math.cos(AngToEllPrm(dAngle1,fXRad,fYRad));var fStartY=fY+fYRad*Math.sin(AngToEllPrm(dAngle1,fXRad,fYRad));var EndPoint={X:0,Y:0};ctx.lineTo(fStartX,fStartY);var fCurX=fStartX,fCurY=fStartY;var dStartAngle=dAngle1;var dEndAngle= 0;if(!bClockDirection)for(var nIndex=nFirstPointQuard;nIndex<=nSecondPointQuard;nIndex++){if(nIndex==nSecondPointQuard)dEndAngle=dAngle2;else dEndAngle=nIndex*Math.PI/2;if(!(nIndex==nFirstPointQuard))dStartAngle=(nIndex-1)*Math.PI/2;EndPoint=EllipseArc3OnCanvas(ctx,fX,fY,fXRad,fYRad,AngToEllPrm(dStartAngle,fXRad,fYRad),AngToEllPrm(dEndAngle,fXRad,fYRad),false)}else for(var nIndex=nFirstPointQuard;nIndex>=nSecondPointQuard;nIndex--){if(nIndex==nFirstPointQuard)dStartAngle=dAngle1;else dStartAngle= nIndex*Math.PI/2;if(!(nIndex==nSecondPointQuard))dEndAngle=(nIndex-1)*Math.PI/2;else dEndAngle=dAngle2;EndPoint=EllipseArc3OnCanvas(ctx,fX,fY,fXRad,fYRad,AngToEllPrm(dStartAngle,fXRad,fYRad),AngToEllPrm(dEndAngle,fXRad,fYRad),false)}}function EllipseArc3OnCanvas(ctx,fX,fY,fXRad,fYRad,dAngle1,dAngle2,bClockDirection){var fAlpha=Math.sin(dAngle2-dAngle1)*(Math.sqrt(4+3*Math.tan((dAngle2-dAngle1)/2)*Math.tan((dAngle2-dAngle1)/2))-1)/3;var sin1=Math.sin(dAngle1);var cos1=Math.cos(dAngle1);var sin2=Math.sin(dAngle2); var cos2=Math.cos(dAngle2);var fX1=fX+fXRad*cos1;var fY1=fY+fYRad*sin1;var fX2=fX+fXRad*cos2;var fY2=fY+fYRad*sin2;var fCX1=fX1-fAlpha*fXRad*sin1;var fCY1=fY1+fAlpha*fYRad*cos1;var fCX2=fX2+fAlpha*fXRad*sin2;var fCY2=fY2-fAlpha*fYRad*cos2;if(!bClockDirection){ctx.bezierCurveTo(fCX1,fCY1,fCX2,fCY2,fX2,fY2);return{X:fX2,Y:fY2}}else{ctx.bezierCurveTo(fCX2,fCY2,fCX1,fCY1,fX1,fY1);return{X:fX1,Y:fY1}}}function _HitToArc(context,px,py,start_x,start_y,width_r,height_r,start_ang,sweep_ang){var _sin=Math.sin(start_ang); var _cos=Math.cos(start_ang);var _x=_cos/width_r;var _y=_sin/height_r;var _l=1/Math.sqrt(_x*_x+_y*_y);var _cx=start_x-_l*_cos;var _cy=start_y-_l*_sin;return HitToArc2(px,py,context,_cx-width_r,_cy-height_r,2*width_r,2*height_r,start_ang,sweep_ang)}function HitToArc2(px,py,context,_l_c_x,_l_c_y,width,height,start_ang,sweep_ang){if(0>=width||0>=height)return;start_ang=-start_ang;sweep_ang=-sweep_ang;var bClockDirection=false;var fEndAngle=2*Math.PI-(sweep_ang+start_ang);var fSrtAngle=2*Math.PI-start_ang; if(sweep_ang>0)bClockDirection=true;if(Math.abs(sweep_ang)>=2*Math.PI)return HitToEllipseOnCanvas(px,py,context,_l_c_x+width/2,_l_c_y+height/2,width/2,height/2);else return HitToEllipseArcOnCanvas(px,py,context,_l_c_x+width/2,_l_c_y+height/2,width/2,height/2,fSrtAngle,fEndAngle,bClockDirection)}function HitToEllipseOnCanvas(px,py,ctx,fX,fY,fXRad,fYRad){var c_fKappa=.552;return HitInBezier4(ctx,px,py,fX-fXRad,fY,fX-fXRad,fY+fYRad*c_fKappa,fX-fXRad*c_fKappa,fY+fYRad,fX,fY+fYRad)||HitInBezier4(ctx,px, py,fX,fY+fYRad,fX+fXRad*c_fKappa,fY+fYRad,fX+fXRad,fY+fYRad*c_fKappa,fX+fXRad,fY)||HitInBezier4(ctx,px,py,fX+fXRad,fY,fX+fXRad,fY-fYRad*c_fKappa,fX+fXRad*c_fKappa,fY-fYRad,fX,fY-fYRad)||HitInBezier4(ctx,px,py,fX,fY-fYRad,fX-fXRad*c_fKappa,fY-fYRad,fX-fXRad,fY-fYRad*c_fKappa,fX-fXRad,fY)}function HitToEllipseArcOnCanvas(px,py,ctx,fX,fY,fXRad,fYRad,fAngle1,fAngle2,bClockDirection){while(fAngle1<0)fAngle1+=2*Math.PI;while(fAngle1>2*Math.PI)fAngle1-=2*Math.PI;while(fAngle2<0)fAngle2+=2*Math.PI;while(fAngle2>= 2*Math.PI)fAngle2-=2*Math.PI;if(!bClockDirection)if(fAngle1<=fAngle2)return HitToEllipseArc2OnCanvas(px,py,ctx,fX,fY,fXRad,fYRad,fAngle1,fAngle2,false);else return HitToEllipseArc2OnCanvas(px,py,ctx,fX,fY,fXRad,fYRad,fAngle1,2*Math.PI,false)||HitToEllipseArc2OnCanvas(px,py,ctx,fX,fY,fXRad,fYRad,0,fAngle2,false);else if(fAngle1>=fAngle2)return HitToEllipseArc2OnCanvas(px,py,ctx,fX,fY,fXRad,fYRad,fAngle1,fAngle2,true);else return HitToEllipseArc2OnCanvas(px,py,ctx,fX,fY,fXRad,fYRad,fAngle1,0,true)|| HitToEllipseArc2OnCanvas(px,py,ctx,fX,fY,fXRad,fYRad,2*Math.PI,fAngle2,true)}function HitToEllipseArc2OnCanvas(px,py,ctx,fX,fY,fXRad,fYRad,dAngle1,dAngle2,bClockDirection){var nFirstPointQuard=(2*dAngle1/Math.PI>>0)+1;var nSecondPointQuard=(2*dAngle2/Math.PI>>0)+1;nSecondPointQuard=Math.min(4,Math.max(1,nSecondPointQuard));nFirstPointQuard=Math.min(4,Math.max(1,nFirstPointQuard));var fStartX=fX+fXRad*Math.cos(AngToEllPrm(dAngle1,fXRad,fYRad));var fStartY=fY+fYRad*Math.sin(AngToEllPrm(dAngle1,fXRad, fYRad));var EndPoint={X:fStartX,Y:fStartY,hit:false};var dStartAngle=dAngle1;var dEndAngle=0;if(!bClockDirection)for(var nIndex=nFirstPointQuard;nIndex<=nSecondPointQuard;nIndex++){if(nIndex==nSecondPointQuard)dEndAngle=dAngle2;else dEndAngle=nIndex*Math.PI/2;if(!(nIndex==nFirstPointQuard))dStartAngle=(nIndex-1)*Math.PI/2;EndPoint=HitToEllipseArc3OnCanvas(px,py,EndPoint,ctx,fX,fY,fXRad,fYRad,AngToEllPrm(dStartAngle,fXRad,fYRad),AngToEllPrm(dEndAngle,fXRad,fYRad),false);if(EndPoint.hit)return true}else for(var nIndex= nFirstPointQuard;nIndex>=nSecondPointQuard;nIndex--){if(nIndex==nFirstPointQuard)dStartAngle=dAngle1;else dStartAngle=nIndex*Math.PI/2;if(!(nIndex==nSecondPointQuard))dEndAngle=(nIndex-1)*Math.PI/2;else dEndAngle=dAngle2;EndPoint=HitToEllipseArc3OnCanvas(px,py,EndPoint,ctx,fX,fY,fXRad,fYRad,AngToEllPrm(dStartAngle,fXRad,fYRad),AngToEllPrm(dEndAngle,fXRad,fYRad),false);if(EndPoint.hit)return true}return false}function HitToEllipseArc3OnCanvas(px,py,EndPoint,ctx,fX,fY,fXRad,fYRad,dAngle1,dAngle2,bClockDirection){var fAlpha= Math.sin(dAngle2-dAngle1)*(Math.sqrt(4+3*Math.tan((dAngle2-dAngle1)/2)*Math.tan((dAngle2-dAngle1)/2))-1)/3;var sin1=Math.sin(dAngle1);var cos1=Math.cos(dAngle1);var sin2=Math.sin(dAngle2);var cos2=Math.cos(dAngle2);var fX1=fX+fXRad*cos1;var fY1=fY+fYRad*sin1;var fX2=fX+fXRad*cos2;var fY2=fY+fYRad*sin2;var fCX1=fX1-fAlpha*fXRad*sin1;var fCY1=fY1+fAlpha*fYRad*cos1;var fCX2=fX2+fAlpha*fXRad*sin2;var fCY2=fY2-fAlpha*fYRad*cos2;if(!bClockDirection)return{X:fX2,Y:fY2,hit:HitInBezier4(ctx,px,py,EndPoint.X, EndPoint.Y,fCX1,fCY1,fCX2,fCY2,fX2,fY2)};else return{X:fX1,Y:fY1,hit:HitInBezier4(ctx,px,py,EndPoint.X,EndPoint.Y,fCX2,fCY2,fCX1,fCY1,fX1,fY1)}}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].ArcToCurvers=Arc3;window["AscFormat"].HitToArc=_HitToArc;window["AscFormat"].ArcToOnCanvas=_ArcToOnCanvas})(window);"use strict";(function(window,undefined){function CShapeColor(r,g,b){this.r=r;this.g=g;this.b=b}function dBoundColor(c){var t=c+.5>>0;return t<0?0:t>255?255:t}function dBoundColor2(c, min,max){var t=c+.5>>0;return t<min?min:t>max?max:t}CShapeColor.prototype.getColorData=function(dBrightness){if(AscFormat.fApproxEqual(dBrightness,0))return this;var r,g,b;if(dBrightness>=0)return new CShapeColor(dBoundColor(this.r*(1-dBrightness)+dBrightness*255),dBoundColor(this.g*(1-dBrightness)+dBrightness*255),dBoundColor(this.b*(1-dBrightness)+dBrightness*255));else return new CShapeColor(dBoundColor(this.r*(1+dBrightness)),dBoundColor(this.g*(1+dBrightness)),dBoundColor(this.b*(1+dBrightness)))}; CShapeColor.prototype.darken=function(){return this.getColorData(-.4)};CShapeColor.prototype.darkenLess=function(){return this.getColorData(-.2)};CShapeColor.prototype.lighten=function(){return this.getColorData(.4)};CShapeColor.prototype.lightenLess=function(){return this.getColorData(.2)};CShapeColor.prototype.norm=function(a){return this};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CShapeColor=CShapeColor;window["AscFormat"].ClampColor=dBoundColor;window["AscFormat"].ClampColor2= dBoundColor2})(window);"use strict";(function(window,undefined){var c_oAscSizeRelFromH=AscCommon.c_oAscSizeRelFromH;var c_oAscSizeRelFromV=AscCommon.c_oAscSizeRelFromV;var c_oAscLockTypes=AscCommon.c_oAscLockTypes;var parserHelp=AscCommon.parserHelp;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var c_oAscError=Asc.c_oAscError;var c_oAscChartTitleShowSettings=Asc.c_oAscChartTitleShowSettings;var c_oAscChartHorAxisLabelShowSettings=Asc.c_oAscChartHorAxisLabelShowSettings;var c_oAscChartVertAxisLabelShowSettings= Asc.c_oAscChartVertAxisLabelShowSettings;var c_oAscChartLegendShowSettings=Asc.c_oAscChartLegendShowSettings;var c_oAscChartDataLabelsPos=Asc.c_oAscChartDataLabelsPos;var c_oAscGridLinesSettings=Asc.c_oAscGridLinesSettings;var c_oAscChartTypeSettings=Asc.c_oAscChartTypeSettings;var c_oAscRelativeFromH=Asc.c_oAscRelativeFromH;var c_oAscRelativeFromV=Asc.c_oAscRelativeFromV;var c_oAscFill=Asc.c_oAscFill;var HANDLE_EVENT_MODE_HANDLE=0;var HANDLE_EVENT_MODE_CURSOR=1;var DISTANCE_TO_TEXT_LEFTRIGHT=3.2; var BAR_DIR_BAR=0;var BAR_DIR_COL=1;var BAR_GROUPING_CLUSTERED=0;var BAR_GROUPING_PERCENT_STACKED=1;var BAR_GROUPING_STACKED=2;var BAR_GROUPING_STANDARD=3;var GROUPING_PERCENT_STACKED=0;var GROUPING_STACKED=1;var GROUPING_STANDARD=2;var SCATTER_STYLE_LINE=0;var SCATTER_STYLE_LINE_MARKER=1;var SCATTER_STYLE_MARKER=2;var SCATTER_STYLE_NONE=3;var SCATTER_STYLE_SMOOTH=4;var SCATTER_STYLE_SMOOTH_MARKER=5;var CARD_DIRECTION_N=0;var CARD_DIRECTION_NE=1;var CARD_DIRECTION_E=2;var CARD_DIRECTION_SE=3;var CARD_DIRECTION_S= 4;var CARD_DIRECTION_SW=5;var CARD_DIRECTION_W=6;var CARD_DIRECTION_NW=7;var CURSOR_TYPES_BY_CARD_DIRECTION=[];CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_N]="n-resize";CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_NE]="ne-resize";CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_E]="e-resize";CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_SE]="se-resize";CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_S]="s-resize";CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_SW]="sw-resize";CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_W]= "w-resize";CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_NW]="nw-resize";function fillImage(image,rasterImageId,x,y,extX,extY,sVideoUrl,sAudioUrl){image.setSpPr(new AscFormat.CSpPr);image.spPr.setParent(image);image.spPr.setGeometry(AscFormat.CreateGeometry("rect"));image.spPr.setXfrm(new AscFormat.CXfrm);image.spPr.xfrm.setParent(image.spPr);image.spPr.xfrm.setOffX(x);image.spPr.xfrm.setOffY(y);image.spPr.xfrm.setExtX(extX);image.spPr.xfrm.setExtY(extY);var blip_fill=new AscFormat.CBlipFill;blip_fill.setRasterImageId(rasterImageId); blip_fill.setStretch(true);image.setBlipFill(blip_fill);image.setNvPicPr(new AscFormat.UniNvPr);var sMediaName=sVideoUrl||sAudioUrl;if(sMediaName){var sExt=AscCommon.GetFileExtension(sMediaName);var oUniMedia=new AscFormat.UniMedia;oUniMedia.type=sVideoUrl?7:8;oUniMedia.media="maskFile."+sExt;image.nvPicPr.nvPr.setUniMedia(oUniMedia)}image.setNoChangeAspect(true);image.setBDeleted(false)}function removeDPtsFromSeries(series){if(Array.isArray(series.dPt))for(var i=series.dPt.length-1;i>-1;--i)series.removeDPt(i)} function fApproxEqual(a,b,fDelta){if(a===b)return true;if(AscFormat.isRealNumber(fDelta))return Math.abs(a-b)<fDelta;return Math.abs(a-b)<1E-15}function fSolveQuadraticEquation(a,b,c){var oResult={x1:null,x2:null,bError:true};var D=b*b-4*a*c;if(D<0)return oResult;oResult.bError=false;oResult.x1=(-b+Math.sqrt(D))/(2*a);oResult.x2=(-b-Math.sqrt(D))/(2*a);return oResult}function fCheckBoxIntersectionSegment(fX,fY,fWidth,fHeight,x1,y1,x2,y2){return fCheckSegementIntersection(fX,fY,fX+fWidth,fY,x1,y1, x2,y2)||fCheckSegementIntersection(fX+fWidth,fY,fX+fWidth,fY+fHeight,x1,y1,x2,y2)||fCheckSegementIntersection(fX+fWidth,fY+fHeight,fX,fY+fHeight,x1,y1,x2,y2)||fCheckSegementIntersection(fX,fY+fHeight,fX,fY,x1,y1,x2,y2)}function fCheckSegementIntersection(x11,y11,x12,y12,x21,y21,x22,y22){if(Math.max(x11,x12)<Math.min(x21,x22))return false;if(Math.min(x11,x12)>Math.max(x21,x22))return false;if(Math.max(y11,y12)<Math.min(y21,y22))return false;if(Math.min(y11,y12)>Math.max(y21,y22))return false;var oCoeffs= fResolve2LinearSystem(x12-x11,-(x22-x21),y12-y11,-(y22-y21),x21-x11,y21-y11);if(oCoeffs.bError)return false;return oCoeffs.x1>=0&&oCoeffs.x1<=1&&oCoeffs.x2>=0&&oCoeffs.x2<=1}function fResolve2LinearSystem(a11,a12,a21,a22,t1,t2){var oResult={bError:true};var D=a11*a22-a12*a21;if(fApproxEqual(D,0))return oResult;oResult.bError=false;oResult.x1=(t1*a22-a12*t2)/D;oResult.x2=(a11*t2-t1*a21)/D;return oResult}function checkParagraphDefFonts(map,par){par&&par.Pr&&par.Pr.DefaultRunPr&&checkRFonts(map,par.Pr.DefaultRunPr.RFonts)} function checkTxBodyDefFonts(map,txBody){txBody&&txBody.content&&txBody.content.Content[0]&&checkParagraphDefFonts(map,txBody.content.Content[0])}function checkRFonts(map,rFonts){if(rFonts){if(rFonts.Ascii&&typeof rFonts.Ascii.Name&&rFonts.Ascii.Name.length>0)map[rFonts.Ascii.Name]=true;if(rFonts.EastAsia&&typeof rFonts.EastAsia.Name&&rFonts.EastAsia.Name.length>0)map[rFonts.EastAsia.Name]=true;if(rFonts.CS&&typeof rFonts.CS.Name&&rFonts.CS.Name.length>0)map[rFonts.CS.Name]=true;if(rFonts.HAnsi&& typeof rFonts.HAnsi.Name&&rFonts.HAnsi.Name.length>0)map[rFonts.HAnsi.Name]=true}}function CheckShapeBodyAutoFitReset(oShape,bNoResetRelSize){var oParaDrawing=AscFormat.getParaDrawing(oShape);if(oParaDrawing&&!(bNoResetRelSize===true)){if(oParaDrawing.SizeRelH)oParaDrawing.SetSizeRelH(undefined);if(oParaDrawing.SizeRelV)oParaDrawing.SetSizeRelV(undefined)}if(oShape instanceof AscFormat.CShape){var oPropsToSet=null;if(oShape.bWordShape){if(!oShape.textBoxContent)return;if(oShape.bodyPr)oPropsToSet= oShape.bodyPr.createDuplicate();else oPropsToSet=new AscFormat.CBodyPr}else{if(!oShape.txBody)return;if(oShape.txBody.bodyPr)oPropsToSet=oShape.txBody.bodyPr.createDuplicate();else oPropsToSet=new AscFormat.CBodyPr}var oBodyPr=oShape.getBodyPr();if(oBodyPr.textFit&&oBodyPr.textFit.type===AscFormat.text_fit_Auto){if(!oPropsToSet.textFit)oPropsToSet.textFit=new AscFormat.CTextFit;oPropsToSet.textFit.type=AscFormat.text_fit_No}if(oBodyPr.wrap===AscFormat.nTWTNone)oPropsToSet.wrap=AscFormat.nTWTSquare; if(oShape.bWordShape)oShape.setBodyPr(oPropsToSet);else{oShape.txBody.setBodyPr(oPropsToSet);if(oShape.checkExtentsByDocContent)oShape.checkExtentsByDocContent(true,true)}}}function CDistance(L,T,R,B){this.L=L;this.T=T;this.R=R;this.B=B}function ConvertRelPositionHToRelSize(nRelPosition){switch(nRelPosition){case c_oAscRelativeFromH.InsideMargin:{return c_oAscSizeRelFromH.sizerelfromhInsideMargin}case c_oAscRelativeFromH.LeftMargin:{return c_oAscSizeRelFromH.sizerelfromhLeftMargin}case c_oAscRelativeFromH.Margin:{return c_oAscSizeRelFromH.sizerelfromhMargin}case c_oAscRelativeFromH.OutsideMargin:{return c_oAscSizeRelFromH.sizerelfromhOutsideMargin}case c_oAscRelativeFromH.Page:{return c_oAscSizeRelFromH.sizerelfromhPage}case c_oAscRelativeFromH.RightMargin:{return c_oAscSizeRelFromH.sizerelfromhRightMargin}default:{return c_oAscSizeRelFromH.sizerelfromhPage}}} function ConvertRelPositionVToRelSize(nRelPosition){switch(nRelPosition){case c_oAscRelativeFromV.BottomMargin:{return c_oAscSizeRelFromV.sizerelfromvBottomMargin}case c_oAscRelativeFromV.InsideMargin:{return c_oAscSizeRelFromV.sizerelfromvInsideMargin}case c_oAscRelativeFromV.Margin:{return c_oAscSizeRelFromV.sizerelfromvMargin}case c_oAscRelativeFromV.OutsideMargin:{return c_oAscSizeRelFromV.sizerelfromvOutsideMargin}case c_oAscRelativeFromV.Page:{return c_oAscSizeRelFromV.sizerelfromvPage}case c_oAscRelativeFromV.TopMargin:{return c_oAscSizeRelFromV.sizerelfromvTopMargin}default:{return c_oAscSizeRelFromV.sizerelfromvMargin}}} function ConvertRelSizeHToRelPosition(nRelSize){switch(nRelSize){case c_oAscSizeRelFromH.sizerelfromhMargin:{return c_oAscRelativeFromH.Margin}case c_oAscSizeRelFromH.sizerelfromhPage:{return c_oAscRelativeFromH.Page}case c_oAscSizeRelFromH.sizerelfromhLeftMargin:{return c_oAscRelativeFromH.LeftMargin}case c_oAscSizeRelFromH.sizerelfromhRightMargin:{return c_oAscRelativeFromH.RightMargin}case c_oAscSizeRelFromH.sizerelfromhInsideMargin:{return c_oAscRelativeFromH.InsideMargin}case c_oAscSizeRelFromH.sizerelfromhOutsideMargin:{return c_oAscRelativeFromH.OutsideMargin}default:{return c_oAscRelativeFromH.Margin}}} function ConvertRelSizeVToRelPosition(nRelSize){switch(nRelSize){case c_oAscSizeRelFromV.sizerelfromvMargin:{return c_oAscRelativeFromV.Margin}case c_oAscSizeRelFromV.sizerelfromvPage:{return c_oAscRelativeFromV.Page}case c_oAscSizeRelFromV.sizerelfromvTopMargin:{return c_oAscRelativeFromV.TopMargin}case c_oAscSizeRelFromV.sizerelfromvBottomMargin:{return c_oAscRelativeFromV.BottomMargin}case c_oAscSizeRelFromV.sizerelfromvInsideMargin:{return c_oAscRelativeFromV.InsideMargin}case c_oAscSizeRelFromV.sizerelfromvOutsideMargin:{return c_oAscRelativeFromV.OutsideMargin}default:{return c_oAscRelativeFromV.Margin}}} function checkObjectInArray(aObjects,oObject){var i;for(i=0;i<aObjects.length;++i)if(aObjects[i]===oObject)return;aObjects.push(oObject)}function getValOrDefault(val,defaultVal){if(val!==null&&val!==undefined){if(val>558.7)return 0;return val}return defaultVal}function checkInternalSelection(selection){return!!(selection.groupSelection||selection.chartSelection||selection.textSelection)}function CheckStockChart(oDrawingObjects,oApi){var selectedObjectsByType=oDrawingObjects.getSelectedObjectsByTypes(); if(selectedObjectsByType.charts[0]){var chartSpace=selectedObjectsByType.charts[0];if(chartSpace&&chartSpace.chart&&chartSpace.chart.plotArea&&chartSpace.chart.plotArea.charts[0]&&chartSpace.chart.plotArea.charts[0].getObjectType()!==AscDFH.historyitem_type_StockChart)if(chartSpace.chart.plotArea.charts[0].series.length!==4){oApi.sendEvent("asc_onError",c_oAscError.ID.StockChartError,c_oAscError.Level.NoCritical);oApi.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();return false}}return true} function CheckLinePreset(preset){return CheckLinePresetForParagraphAdd(preset)}function CheckLinePresetForParagraphAdd(preset){return preset==="line"||preset==="bentConnector2"||preset==="bentConnector3"||preset==="bentConnector4"||preset==="bentConnector5"||preset==="curvedConnector2"||preset==="curvedConnector3"||preset==="curvedConnector4"||preset==="curvedConnector5"||preset==="straightConnector1"}function CompareGroups(a,b){if(a.group==null&&b.group==null)return 0;if(a.group==null)return 1;if(b.group== null)return-1;var count1=0;var cur_group=a.group;while(cur_group!=null){++count1;cur_group=cur_group.group}var count2=0;cur_group=b.group;while(cur_group!=null){++count2;cur_group=cur_group.group}return count1-count2}function CheckSpPrXfrm(object,bNoResetAutofit){if(!object.spPr){object.setSpPr(new AscFormat.CSpPr);object.spPr.setParent(object)}if(!object.spPr.xfrm){object.spPr.setXfrm(new AscFormat.CXfrm);object.spPr.xfrm.setParent(object.spPr);if(object.parent&&object.parent.GraphicObj===object){object.spPr.xfrm.setOffX(0); object.spPr.xfrm.setOffY(0)}else{object.spPr.xfrm.setOffX(object.x);object.spPr.xfrm.setOffY(object.y)}object.spPr.xfrm.setExtX(object.extX);object.spPr.xfrm.setExtY(object.extY);if(bNoResetAutofit!==true)CheckShapeBodyAutoFitReset(object)}}function CheckSpPrXfrm2(object){if(!object)return;if(!object.spPr){object.spPr=new AscFormat.CSpPr;object.spPr.parent=object}if(!object.spPr.xfrm){object.spPr.xfrm=new AscFormat.CXfrm;object.spPr.xfrm.parent=object.spPr;object.spPr.xfrm.offX=0;object.spPr.xfrm.offY= 0;object.spPr.xfrm.extX=object.extX;object.spPr.xfrm.extY=object.extY}}function CheckSpPrXfrm3(object){if(object.recalcInfo&&object.recalcInfo.recalculateTransform){if(!object.spPr){object.setSpPr(new AscFormat.CSpPr);object.spPr.setParent(object)}if(!object.spPr.xfrm){object.spPr.setXfrm(new AscFormat.CXfrm);object.spPr.xfrm.setParent(object.spPr);if(object.parent&&object.parent.GraphicObj===object){object.spPr.xfrm.setOffX(0);object.spPr.xfrm.setOffY(0)}else{object.spPr.xfrm.setOffX(AscFormat.isRealNumber(object.x)? object.x:0);object.spPr.xfrm.setOffY(AscFormat.isRealNumber(object.y)?object.y:0)}object.spPr.xfrm.setExtX(AscFormat.isRealNumber(object.extX)?object.extX:0);object.spPr.xfrm.setExtY(AscFormat.isRealNumber(object.extY)?object.extY:0)}return}if(!object.spPr){object.setSpPr(new AscFormat.CSpPr);object.spPr.setParent(object)}if(!object.spPr.xfrm){object.spPr.setXfrm(new AscFormat.CXfrm);object.spPr.xfrm.setParent(object.spPr)}var oXfrm=object.spPr.xfrm;var _x=object.x;var _y=object.y;if(object.parent&& object.parent.GraphicObj===object){_x=0;_y=0}if(oXfrm.offX===null||!AscFormat.fApproxEqual(_x,oXfrm.offX,.01))object.spPr.xfrm.setOffX(_x);if(oXfrm.offY===null||!AscFormat.fApproxEqual(_y,oXfrm.offY,.01))object.spPr.xfrm.setOffY(_y);if(oXfrm.extX===null||!AscFormat.fApproxEqual(object.extX,oXfrm.extX,.01))object.spPr.xfrm.setExtX(object.extX);if(oXfrm.extY===null||!AscFormat.fApproxEqual(object.extY,oXfrm.extY,.01))object.spPr.xfrm.setExtY(object.extY)}function getObjectsByTypesFromArr(arr,bGrouped){var ret= {shapes:[],images:[],groups:[],charts:[],tables:[],oleObjects:[],slicers:[]};var selected_objects=arr;for(var i=0;i<selected_objects.length;++i){var drawing=selected_objects[i];var type=drawing.getObjectType();switch(type){case AscDFH.historyitem_type_Shape:case AscDFH.historyitem_type_Cnx:{ret.shapes.push(drawing);break}case AscDFH.historyitem_type_ImageShape:{ret.images.push(drawing);break}case AscDFH.historyitem_type_OleObject:{ret.oleObjects.push(drawing);break}case AscDFH.historyitem_type_GroupShape:{ret.groups.push(drawing); if(bGrouped){var by_types=getObjectsByTypesFromArr(drawing.spTree,true);ret.shapes=ret.shapes.concat(by_types.shapes);ret.images=ret.images.concat(by_types.images);ret.charts=ret.charts.concat(by_types.charts);ret.tables=ret.tables.concat(by_types.tables);ret.oleObjects=ret.oleObjects.concat(by_types.oleObjects)}break}case AscDFH.historyitem_type_ChartSpace:{ret.charts.push(drawing);break}case AscDFH.historyitem_type_GraphicFrame:{ret.tables.push(drawing);break}case AscDFH.historyitem_type_SlicerView:{ret.slicers.push(drawing); break}}}return ret}function CreateBlipFillUniFillFromUrl(url){var ret=new AscFormat.CUniFill;ret.setFill(CreateBlipFillRasterImageId(url));return ret}function CreateBlipFillRasterImageId(url){var oBlipFill=new AscFormat.CBlipFill;oBlipFill.setRasterImageId(url);return oBlipFill}function getTargetTextObject(controller){if(controller.selection.textSelection)return controller.selection.textSelection;else if(controller.selection.groupSelection)if(controller.selection.groupSelection.selection.textSelection)return controller.selection.groupSelection.selection.textSelection; else{if(controller.selection.groupSelection.selection.chartSelection&&controller.selection.groupSelection.selection.chartSelection.selection.textSelection)return controller.selection.groupSelection.selection.chartSelection.selection.textSelection}else if(controller.selection.chartSelection&&controller.selection.chartSelection.selection.textSelection)return controller.selection.chartSelection.selection.textSelection;return null}function isConnectorPreset(sPreset){if(typeof sPreset==="string"&&sPreset.length> 0){if(sPreset==="flowChartOffpageConnector"||sPreset==="flowChartConnector"||sPreset==="flowChartOfflineStorage"||sPreset==="flowChartOnlineStorage")return false;return sPreset.toLowerCase().indexOf("line")>-1||sPreset.toLowerCase().indexOf("connector")>-1}return false}function DrawingObjectsController(drawingObjects){this.drawingObjects=drawingObjects;this.curState=new AscFormat.NullState(this);this.selectedObjects=[];this.drawingDocument=drawingObjects.drawingDocument;this.selection={selectedObjects:[], groupSelection:null,chartSelection:null,textSelection:null};this.arrPreTrackObjects=[];this.arrTrackObjects=[];this.objectsForRecalculate={};this.eventListeners=[];this.chartForProps=null;this.handleEventMode=HANDLE_EVENT_MODE_HANDLE}function CanStartEditText(oController){var oSelector=oController.selection.groupSelection?oController.selection.groupSelection:oController;if(oSelector.selectedObjects.length===1&&oSelector.selectedObjects[0].getObjectType()===AscDFH.historyitem_type_Shape&&!AscFormat.CheckLinePresetForParagraphAdd(oSelector.selectedObjects[0].getPresetGeom()))return true; return false}DrawingObjectsController.prototype={checkDrawingHyperlink:function(drawing,e,hit_in_text_rect,x,y,pageIndex){var oApi=this.getEditorApi();if(!oApi)return;var oNvPr;if(this.document||this.drawingObjects&&this.drawingObjects.cSld){if(true){oNvPr=drawing.getCNvProps();if(oNvPr&&oNvPr.hlinkClick&&oNvPr.hlinkClick.id!==null)if(this.handleEventMode===HANDLE_EVENT_MODE_HANDLE){if(e.CtrlKey||this.isSlideShow()){editor.sync_HyperlinkClickCallback(oNvPr.hlinkClick.id);return true}}else{var ret= {objectId:drawing.Get_Id(),cursorType:"move",bMarker:false};if(!(this.noNeedUpdateCursorType===true)){var oDD=editor&&editor.WordControl&&editor.WordControl.m_oDrawingDocument;if(oDD){var MMData=new AscCommon.CMouseMoveData;var Coords=oDD.ConvertCoordsToCursorWR(x,y,pageIndex,null);MMData.X_abs=Coords.X;MMData.Y_abs=Coords.Y;MMData.Type=Asc.c_oAscMouseMoveDataTypes.Hyperlink;MMData.Hyperlink=new Asc.CHyperlinkProperty({Text:null,Value:oNvPr.hlinkClick.id,ToolTip:oNvPr.hlinkClick.tooltip,Class:null}); if(this.isSlideShow()){ret.cursorType="pointer";MMData.Hyperlink=null;oDD.SetCursorType("pointer",MMData)}else{editor.sync_MouseMoveCallback(MMData);if(hit_in_text_rect){ret.cursorType="text";oDD.SetCursorType("text",MMData)}}ret.updated=true}}return ret}}}else if(this.drawingObjects&&this.drawingObjects.getWorksheetModel){oNvPr=drawing.getCNvProps();if(oNvPr&&oNvPr.hlinkClick&&oNvPr.hlinkClick.id!==null)if(this.handleEventMode===HANDLE_EVENT_MODE_HANDLE)if(e.CtrlKey||this.isSlideShow())return true; else return false;else{var _link=oNvPr.hlinkClick.id;var sLink2;if(_link.search("#")===0)sLink2=_link.replace("#","");else sLink2=_link;var oHyperlink=AscFormat.ExecuteNoHistory(function(){return new ParaHyperlink},this,[]);oHyperlink.Value=sLink2;oHyperlink.Tooltip=oNvPr.hlinkClick.tooltip;if(hit_in_text_rect)return{objectId:drawing.Get_Id(),cursorType:"text",bMarker:false,hyperlink:oHyperlink};else return{objectId:drawing.Get_Id(),cursorType:"move",bMarker:false,hyperlink:oHyperlink}}}if(this.handleEventMode=== HANDLE_EVENT_MODE_HANDLE)return false;else return null},showVideoControl:function(sMediaFile,extX,extY,transform){this.bShowVideoControl=true;var oApi=this.getEditorApi();oApi.showVideoControl(sMediaFile,extX,extY,transform)},getAllSignatures:function(){var _ret=[];this.getAllSignatures2(_ret,this.getDrawingArray());return _ret},getAllSignatures2:function(aRet,spTree){var aSp=[];for(var i=0;i<spTree.length;++i)if(spTree[i].getObjectType()===AscDFH.historyitem_type_GroupShape)aSp=aSp.concat(this.getAllSignatures2(aRet, spTree[i].spTree));else if(spTree[i].signatureLine){aRet.push(spTree[i].signatureLine);aSp.push(spTree[i])}return aSp},getDefaultText:function(){return AscCommon.translateManager.getValue("Your text here")},getAllConnectors:function(aDrawings,allDrawings){var _ret=allDrawings;if(!_ret)_ret=[];for(var i=0;i<aDrawings.length;++i)if(aDrawings[i].getObjectType()===AscDFH.historyitem_type_Cnx)_ret.push(aDrawings[i]);else if(aDrawings[i].getObjectType()===AscDFH.historyitem_type_GroupShape)aDrawings[i].getAllConnectors(aDrawings[i].spTree, _ret);return _ret},getAllShapes:function(aDrawings,allDrawings){var _ret=allDrawings;if(!_ret)_ret=[];for(var i=0;i<aDrawings.length;++i)if(aDrawings[i].getObjectType()===AscDFH.historyitem_type_Shape)_ret.push(aDrawings[i]);else if(aDrawings[i].getObjectType()===AscDFH.historyitem_type_GroupShape)aDrawings[i].getAllShapes(aDrawings[i].spTree,_ret);return _ret},getAllConnectorsByDrawings:function(aDrawings,result,aConnectors,bInsideGroup){var _ret;if(Array.isArray(result))_ret=result;else _ret=[]; var _aConnectors;if(Array.isArray(aConnectors))_aConnectors=aConnectors;else _aConnectors=this.getAllConnectors(this.getDrawingArray(),[]);for(var i=0;i<_aConnectors.length;++i)for(var j=0;j<aDrawings.length;++j)if(aDrawings[j].getObjectType()===AscDFH.historyitem_type_GroupShape){if(bInsideGroup)this.getAllConnectorsByDrawings(aDrawings[j].spTree,_ret,_aConnectors,bInsideGroup)}else if(aDrawings[j].Get_Id()===_aConnectors[i].getStCxnId()||aDrawings[j].Get_Id()===_aConnectors[i].getEndCxnId())_ret.push(_aConnectors[i]); return _ret},getAllSingularDrawings:function(aDrawings,_ret){for(var i=0;i<aDrawings.length;++i)if(aDrawings[i].getObjectType()===AscDFH.historyitem_type_GroupShape)this.getAllSingularDrawings(aDrawings[i].spTree,_ret);else _ret.push(aDrawings[i])},checkConnectorsPreTrack:function(){if(this.arrPreTrackObjects.length>0&&this.arrPreTrackObjects[0].originalObject&&this.arrPreTrackObjects[0].overlayObject){var aAllConnectors=this.getAllConnectors(this.getDrawingArray());var oPreTrack;var stId=null,endId= null,oBeginTrack=null,oEndTrack=null,oBeginShape=null,oEndShape=null;var aConnectionPreTracks=[];for(var i=0;i<aAllConnectors.length;++i){stId=aAllConnectors[i].getStCxnId();endId=aAllConnectors[i].getEndCxnId();oBeginTrack=null;oEndTrack=null;oBeginShape=null;oEndShape=null;if(stId!==null||endId!==null)for(var j=0;j<this.arrPreTrackObjects.length;++j){if(this.arrPreTrackObjects[j].originalObject===aAllConnectors[i]){oEndTrack=null;oBeginTrack=null;break}oPreTrack=this.arrPreTrackObjects[j].originalObject; if(oPreTrack.Id===stId)oBeginTrack=this.arrPreTrackObjects[j];if(oPreTrack.Id===endId)oEndTrack=this.arrPreTrackObjects[j]}if(oBeginTrack||oEndTrack){if(oBeginTrack)oBeginShape=oBeginTrack.originalObject;else if(stId!==null){oBeginShape=AscCommon.g_oTableId.Get_ById(stId);if(oBeginShape&&oBeginShape.bDeleted)oBeginShape=null}if(oEndTrack)oEndShape=oEndTrack.originalObject;else if(endId!==null){oEndShape=AscCommon.g_oTableId.Get_ById(endId);if(oEndShape&&oEndShape.bDeleted)oEndShape=null}aConnectionPreTracks.push(new AscFormat.CConnectorTrack(aAllConnectors[i], oBeginTrack,oEndTrack,oBeginShape,oEndShape))}}for(i=0;i<aConnectionPreTracks.length;++i)this.arrPreTrackObjects.push(aConnectionPreTracks[i])}},startEditTextCurrentShape:function(){if(!CanStartEditText(this))return;var oSelector=this.selection.groupSelection?this.selection.groupSelection:this;var oShape=oSelector.selectedObjects[0];var oContent=oShape.getDocContent();if(oContent){oSelector.resetInternalSelection();oSelector.selection.textSelection=oShape;oContent.MoveCursorToEndPos(false);this.updateSelectionState(); this.updateOverlay();if(this.document)oContent.Set_CurrentElement(0,true)}else{var oThis=this;this.checkSelectedObjectsAndCallback(function(){if(!oShape.bWordShape)oShape.createTextBody();else oShape.createTextBoxContent();var oContent=oShape.getDocContent();oSelector.resetInternalSelection();oSelector.selection.textSelection=oShape;oContent.MoveCursorToEndPos(false);oThis.updateSelectionState();if(this.document)oContent.Set_CurrentElement(0,true)},[],false,AscDFH.historydescription_Spreadsheet_AddNewParagraph)}}, getObjectForCrop:function(){var selectedObjects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects;if(selectedObjects.length===1){var oBlipFill=selectedObjects[0].getBlipFill();if(oBlipFill)return selectedObjects[0]}return null},sendCropState:function(){var oApi=this.getEditorApi();if(!oApi)return;var isCrop=AscCommon.isRealObject(this.selection.cropSelection);oApi.sendEvent("asc_ChangeCropState",isCrop)},canStartImageCrop:function(){return this.getObjectForCrop()!== null},startImageCrop:function(){var cropObject=this.getObjectForCrop();if(!cropObject)return;this.checkSelectedObjectsAndCallback(function(){cropObject.checkSrcRect();if(cropObject.createCropObject()){this.selection.cropSelection=cropObject;this.sendCropState();this.updateOverlay()}},[],false)},endImageCrop:function(bDoNotRedraw){if(this.selection.cropSelection){this.selection.cropSelection.clearCropObject();this.selection.cropSelection=null;this.sendCropState();if(bDoNotRedraw!==true){this.updateOverlay(); if(this.drawingObjects&&this.drawingObjects.showDrawingObjects)this.drawingObjects.showDrawingObjects()}}},cropFit:function(){var cropObject=this.getObjectForCrop();if(!cropObject)return;this.checkSelectedObjectsAndCallback(function(){cropObject.checkSrcRect();if(cropObject.createCropObject()){var oBlipFill=cropObject.getBlipFill();if(oBlipFill){var oImgP=new Asc.asc_CImgProperty;oImgP.ImageUrl=oBlipFill.RasterImageId;var oSize=oImgP.asc_getOriginSize(this.getEditorApi());var oShapeDrawer=new AscCommon.CShapeDrawer; oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;cropObject.check_bounds(oShapeDrawer);var bounds_w=oShapeDrawer.max_x-oShapeDrawer.min_x;var bounds_h=oShapeDrawer.max_y-oShapeDrawer.min_y;var dScale=bounds_w/oSize.Width;var dTestHeight=oSize.Height*dScale;var srcRect=new AscFormat.CSrcRect;if(dTestHeight<=bounds_h){srcRect.l=0;srcRect.r=100;srcRect.t=-100*(bounds_h-dTestHeight)/2/dTestHeight;srcRect.b=100-srcRect.t}else{srcRect.t=0;srcRect.b=100;dScale=bounds_h/ oSize.Height;var dTestWidth=oSize.Width*dScale;srcRect.l=-100*(bounds_w-dTestWidth)/2/dTestWidth;srcRect.r=100-srcRect.l}cropObject.setSrcRect(srcRect);var oParent=cropObject.parent;if(oParent&&oParent.Check_WrapPolygon)oParent.Check_WrapPolygon();this.selection.cropSelection=cropObject;this.sendCropState();if(this.drawingObjects&&this.drawingObjects.showDrawingObjects)this.drawingObjects.showDrawingObjects();this.updateOverlay()}}},[],false)},cropFill:function(){var cropObject=this.getObjectForCrop(); if(!cropObject)return;this.checkSelectedObjectsAndCallback(function(){cropObject.checkSrcRect();if(cropObject.createCropObject()){var oImgP=new Asc.asc_CImgProperty;oImgP.ImageUrl=cropObject.getBlipFill().RasterImageId;var oSize=oImgP.asc_getOriginSize(this.getEditorApi());var oShapeDrawer=new AscCommon.CShapeDrawer;oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;cropObject.check_bounds(oShapeDrawer);var bounds_w=oShapeDrawer.max_x-oShapeDrawer.min_x;var bounds_h= oShapeDrawer.max_y-oShapeDrawer.min_y;var dScale=bounds_w/oSize.Width;var dTestHeight=oSize.Height*dScale;var srcRect=new AscFormat.CSrcRect;if(dTestHeight>=bounds_h){srcRect.l=0;srcRect.r=100;srcRect.t=-100*(bounds_h-dTestHeight)/2/dTestHeight;srcRect.b=100-srcRect.t}else{srcRect.t=0;srcRect.b=100;dScale=bounds_h/oSize.Height;var dTestWidth=oSize.Width*dScale;srcRect.l=-100*(bounds_w-dTestWidth)/2/dTestWidth;srcRect.r=100-srcRect.l}cropObject.setSrcRect(srcRect);var oParent=cropObject.parent;if(oParent&& oParent.Check_WrapPolygon)oParent.Check_WrapPolygon();this.selection.cropSelection=cropObject;this.sendCropState();if(this.drawingObjects&&this.drawingObjects.showDrawingObjects)this.drawingObjects.showDrawingObjects();this.updateOverlay()}},[],false)},setCropAspect:function(dAspect){var cropObject=this.getObjectForCrop();if(!cropObject)return;this.checkSelectedObjectsAndCallback(function(){cropObject.checkSrcRect();if(cropObject.createCropObject()){this.selection.cropSelection=cropObject;this.sendCropState(); var newW,newH;if(dAspect*cropObject.extX<=cropObject.extY){newW=cropObject.extX;newH=cropObject.extY*dAspect}else{newW=cropObject.extX/dAspect;newH=cropObject.extY}if(this.drawingObjects&&this.drawingObjects.showDrawingObjects)this.drawingObjects.showDrawingObjects();this.updateOverlay()}},[],false)},canReceiveKeyPress:function(){return this.curState instanceof AscFormat.NullState},handleAdjustmentHit:function(hit,selectedObject,group,pageIndex,bWord){if(this.handleEventMode===HANDLE_EVENT_MODE_HANDLE){this.arrPreTrackObjects.length= 0;if(hit.adjPolarFlag===false)this.arrPreTrackObjects.push(new AscFormat.XYAdjustmentTrack(selectedObject,hit.adjNum,hit.warp));else this.arrPreTrackObjects.push(new AscFormat.PolarAdjustmentTrack(selectedObject,hit.adjNum,hit.warp));if(!isRealObject(group)){this.resetInternalSelection();this.changeCurrentState(new AscFormat.PreChangeAdjState(this,selectedObject))}else{group.resetInternalSelection();this.changeCurrentState(new AscFormat.PreChangeAdjInGroupState(this,group))}return true}else if(!isRealObject(group))return{objectId:selectedObject.Get_Id(), cursorType:"crosshair",bMarker:true};else return{objectId:selectedObject.Get_Id(),cursorType:"crosshair",bMarker:true}},handleSlideComments:function(e,x,y,pageIndex){if(this.handleEventMode===HANDLE_EVENT_MODE_HANDLE)return{result:null,selectedIndex:-1};else return{result:false,selectedIndex:-1}},handleSignatureDblClick:function(sGuid,width,height){var oApi=editor||Asc["editor"];if(oApi)oApi.sendEvent("asc_onSignatureDblClick",sGuid,width,height)},checkChartForProps:function(bStart){if(bStart){if(this.selectedObjects.length=== 0){this.chartForProps=null;return}this.chartForProps=this.getSelectionState();this.resetSelection();this.drawingObjects.getWorksheet().endEditChart();var oldIsStartAdd=window["Asc"]["editor"].isStartAddShape;window["Asc"]["editor"].isStartAddShape=true;this.updateOverlay();window["Asc"]["editor"].isStartAddShape=oldIsStartAdd}else{if(this.chartForProps===null)return;this.setSelectionState(this.chartForProps,this.chartForProps.length-1);this.updateOverlay();this.drawingObjects.getWorksheet().setSelectionShape(true); this.chartForProps=null}},resetInternalSelection:function(noResetContentSelect,bDoNotRedraw){var oApi=this.getEditorApi&&this.getEditorApi();if(oApi&&oApi.hideVideoControl)oApi.hideVideoControl();if(this.selection.groupSelection){this.selection.groupSelection.resetSelection(this);this.selection.groupSelection=null}if(this.selection.textSelection){if(!(noResetContentSelect===true))if(this.selection.textSelection.getObjectType()===AscDFH.historyitem_type_GraphicFrame){if(this.selection.textSelection.graphicObject)this.selection.textSelection.graphicObject.RemoveSelection()}else{var content= this.selection.textSelection.getDocContent();content&&content.RemoveSelection()}this.selection.textSelection=null}if(this.selection.chartSelection){this.selection.chartSelection.resetSelection(noResetContentSelect);this.selection.chartSelection=null}if(this.selection.wrapPolygonSelection)this.selection.wrapPolygonSelection=null;if(this.selection.cropSelection)this.endImageCrop&&this.endImageCrop(bDoNotRedraw)},resetChartElementsSelection:function(){var oTargetDocContent=this.getTargetDocContent(false, false);if(!oTargetDocContent){var oSelector=this.selection.groupSelection?this.selection.groupSelection:this;if(oSelector.selection.chartSelection){oSelector.selection.chartSelection.resetSelection(false);oSelector.selection.chartSelection=null}}},handleHandleHit:function(hit,selectedObject,group,pageIndex,bWord){if(this.handleEventMode===HANDLE_EVENT_MODE_HANDLE){var selected_objects=group?group.selectedObjects:this.selectedObjects;this.arrPreTrackObjects.length=0;if(hit===8){if(selectedObject.canRotate()){for(var i= 0;i<selected_objects.length;++i)if(selected_objects[i].canRotate())this.arrPreTrackObjects.push(selected_objects[i].createRotateTrack());if(!isRealObject(group)){this.resetInternalSelection();this.updateOverlay();this.changeCurrentState(new AscFormat.PreRotateState(this,selectedObject))}else{group.resetInternalSelection();this.updateOverlay();this.changeCurrentState(new AscFormat.PreRotateInGroupState(this,group,selectedObject))}}}else if(selectedObject.canResize()){var card_direction=selectedObject.getCardDirectionByNum(hit); for(var j=0;j<selected_objects.length;++j)if(selected_objects[j].canResize())this.arrPreTrackObjects.push(selected_objects[j].createResizeTrack(card_direction,selected_objects.length===1?this:null));if(!isRealObject(group)){if(!selectedObject.isCrop&&!selectedObject.cropObject)this.resetInternalSelection();this.updateOverlay();this.changeCurrentState(new AscFormat.PreResizeState(this,selectedObject,card_direction))}else{if(!selectedObject.isCrop&&!selectedObject.cropObject)group.resetInternalSelection(); this.updateOverlay();this.changeCurrentState(new AscFormat.PreResizeInGroupState(this,group,selectedObject,card_direction))}}return true}else{var sId=selectedObject.Get_Id();if(selectedObject.isCrop&&selectedObject.parentCrop)sId=selectedObject.parentCrop.Get_Id();var card_direction=selectedObject.getCardDirectionByNum(hit);return{objectId:sId,cursorType:hit===8?"crosshair":CURSOR_TYPES_BY_CARD_DIRECTION[card_direction],bMarker:true}}},handleDblClickEmptyShape:function(oShape){if(!oShape.getDocContent()&& !CheckLinePresetForParagraphAdd(oShape.getPresetGeom()))this.checkSelectedObjectsAndCallback(function(){if(!oShape.bWordShape)oShape.createTextBody();else oShape.createTextBoxContent();this.recalculate();var oContent=oShape.getDocContent();oContent.Set_CurrentElement(0,true);oContent.MoveCursorToStartPos(false);this.updateSelectionState()},[],false)},handleMoveHit:function(object,e,x,y,group,bInSelect,pageIndex,bWord){var b_is_inline;if(isRealObject(group))b_is_inline=group.parent&&group.parent.Is_Inline&& group.parent.Is_Inline();else b_is_inline=object.parent&&object.parent.Is_Inline&&object.parent.Is_Inline();if(this.selection.cropSelection)if(this.selection.cropSelection===object||this.selection.cropSelection.cropObject===object)b_is_inline=false;var b_is_selected_inline=this.selectedObjects.length===1&&(this.selectedObjects[0].parent&&this.selectedObjects[0].parent.Is_Inline&&this.selectedObjects[0].parent.Is_Inline());if(this.handleEventMode===HANDLE_EVENT_MODE_HANDLE){var selector=group?group: this;this.checkChartTextSelection();this.arrPreTrackObjects.length=0;var is_selected=object.selected;var b_check_internal=checkInternalSelection(selector.selection);if(!(e.CtrlKey||e.ShiftKey)&&!is_selected||b_is_inline||b_is_selected_inline)if(!object.isCrop&&!object.cropObject)selector.resetSelection();if(!e.CtrlKey||!object.selected)selector.selectObject(object,pageIndex);if(!is_selected||b_check_internal)this.updateOverlay();if(object.canMove()){this.checkSelectedObjectsForMove(group,pageIndex); if(!isRealObject(group)){if(!object.isCrop&&!object.cropObject)this.resetInternalSelection();this.updateOverlay();if(!b_is_inline)this.changeCurrentState(new AscFormat.PreMoveState(this,x,y,e.ShiftKey,e.CtrlKey,object,is_selected,!bInSelect));else this.changeCurrentState(new AscFormat.PreMoveInlineObject(this,object,is_selected,!bInSelect,pageIndex,x,y))}else{group.resetInternalSelection();this.updateOverlay();this.changeCurrentState(new AscFormat.PreMoveInGroupState(this,group,x,y,e.ShiftKey,e.CtrlKey, object,is_selected))}if(e.ClickCount>1&&!e.ShiftKey&&!e.CtrlKey&&(this.selection.groupSelection&&this.selection.groupSelection.selectedObjects.length===1||this.selectedObjects.length===1)){var drawing=this.selectedObjects[0].parent;if(object.getObjectType()===AscDFH.historyitem_type_ChartSpace&&this.handleChartDoubleClick)this.handleChartDoubleClick(drawing,object,e,x,y,pageIndex);if(object.getObjectType()===AscDFH.historyitem_type_Shape)if(null!==object.signatureLine){if(this.handleSignatureDblClick)this.handleSignatureDblClick(object.signatureLine.id, object.extX,object.extY)}else if(this.handleDblClickEmptyShape)if(!object.getDocContent())this.handleDblClickEmptyShape(object);if(object.getObjectType()===AscDFH.historyitem_type_OleObject&&this.handleOleObjectDoubleClick)this.handleOleObjectDoubleClick(drawing,object,e,x,y,pageIndex);else if(2==e.ClickCount&&drawing instanceof ParaDrawing&&drawing.IsMathEquation())this.handleMathDrawingDoubleClick(drawing,e,x,y,pageIndex)}}return true}else{var sId=object.Get_Id();if(object.isCrop&&object.parentCrop)sId= object.parentCrop.Get_Id();var sCursorType="move";if(this.isSlideShow()){var sMediaName=object.getMediaFileName();if(sMediaName)sCursorType="pointer"}return{objectId:sId,cursorType:sCursorType,bMarker:bInSelect}}},handleChartTitleMoveHit:function(title,e,x,y,drawing,group,pageIndex){var selector=group?group:this;if(this.handleEventMode===HANDLE_EVENT_MODE_HANDLE){this.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing; if(title.select)drawing.selectTitle(title,pageIndex);this.arrPreTrackObjects.length=0;this.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(title,drawing));this.changeCurrentState(new AscFormat.PreMoveState(this,x,y,false,false,drawing,true,true));this.updateSelectionState();this.updateOverlay();if(Asc["editor"]&&Asc["editor"].wb){var ws=Asc["editor"].wb.getWorksheet();if(ws){var ct=ws.getCursorTypeFromXY(ws.objectRender.lastX,ws.objectRender.lastY);if(ct)Asc["editor"].wb._onUpdateCursor(ct.cursor)}}return true}else return{objectId:drawing.Get_Id(), cursorType:"move",bMarker:false}},recalculateCurPos:function(bUpdateX,bUpdateY){var oTargetDocContent=this.getTargetDocContent(undefined,true);if(oTargetDocContent)return oTargetDocContent.RecalculateCurPos(bUpdateX,bUpdateY);return{X:0,Y:0,Height:0,PageNum:0,Internal:{Line:0,Page:0,Range:0},Transform:null}},startEditCurrentOleObject:function(){var oSelector=this.selection.groupSelection?this.selection.groupSelection:this;var oThis=this;if(oSelector.selectedObjects.length===1&&oSelector.selectedObjects[0].getObjectType()=== AscDFH.historyitem_type_OleObject){var oleObject=oSelector.selectedObjects[0];this.checkSelectedObjectsAndFireCallback(function(){var pluginData=new Asc.CPluginData;pluginData.setAttribute("data",oleObject.m_sData);pluginData.setAttribute("guid",oleObject.m_sApplicationId);pluginData.setAttribute("width",oleObject.extX);pluginData.setAttribute("height",oleObject.extY);pluginData.setAttribute("widthPix",oleObject.m_nPixWidth);pluginData.setAttribute("heightPix",oleObject.m_nPixHeight);pluginData.setAttribute("objectId", oleObject.Id);if(window["Asc"]["editor"])window["Asc"]["editor"].asc_pluginRun(oleObject.m_sApplicationId,0,pluginData);else if(editor)editor.asc_pluginRun(oleObject.m_sApplicationId,0,pluginData)},[])}},checkSelectedObjectsForMove:function(group,pageIndex){var selected_object=group?group.selectedObjects:this.selectedObjects;var b_check_page=AscFormat.isRealNumber(pageIndex);for(var i=0;i<selected_object.length;++i)if(selected_object[i].canMove()&&(!b_check_page||selected_object[i].selectStartPage=== pageIndex))this.arrPreTrackObjects.push(selected_object[i].createMoveTrack())},checkTargetSelection:function(oObject,x,y,invertTransform){if(this.drawingObjects&&this.drawingObjects.cSld){var t_x=invertTransform.TransformPointX(x,y);var t_y=invertTransform.TransformPointY(x,y);if(oObject.getDocContent().CheckPosInSelection(t_x,t_y,0,undefined))return this.startTrackText(x,y,oObject)}return false},handleTextHit:function(object,e,x,y,group,pageIndex,bWord){var content,invert_transform_text,tx,ty,hit_paragraph, par,check_hyperlink;if(this.handleEventMode===HANDLE_EVENT_MODE_HANDLE){var bNotes=this.drawingObjects&&this.drawingObjects.getObjectType&&this.drawingObjects.getObjectType()===AscDFH.historyitem_type_Notes;if((e.CtrlKey||this.isSlideShow())&&!this.document&&!bNotes){check_hyperlink=fCheckObjectHyperlink(object,x,y);if(!isRealObject(check_hyperlink))return this.handleMoveHit(object,e,x,y,group,false,pageIndex,bWord)}if(!group)if(this.selection.textSelection!==object){this.resetSelection(true);this.selectObject(object, pageIndex);this.selection.textSelection=object}else{if(this.checkTargetSelection(object,x,y,object.invertTransformText))return true}else if(this.selection.groupSelection!==group||group.selection.textSelection!==object){this.resetSelection(true);group.selectObject(object,pageIndex);this.selectObject(group,pageIndex);this.selection.groupSelection=group;group.selection.textSelection=object}else if(this.checkTargetSelection(object,x,y,object.invertTransformText))return true;if((e.CtrlKey||this.isSlideShow())&& !this.document&&!bNotes){check_hyperlink=fCheckObjectHyperlink(object,x,y);if(!isRealObject(check_hyperlink))return this.handleMoveHit(object,e,x,y,group,false,pageIndex,bWord)}var oldCtrlKey=e.CtrlKey;if(this.isSlideShow()&&!e.CtrlKey)e.CtrlKey=true;object.selectionSetStart(e,x,y,pageIndex);if(this.isSlideShow())e.CtrlKey=oldCtrlKey;this.changeCurrentState(new AscFormat.TextAddState(this,object,x,y));return true}else{var ret={objectId:object.Get_Id(),cursorType:"text"};content=object.getDocContent(); invert_transform_text=object.invertTransformText;if(content&&invert_transform_text){tx=invert_transform_text.TransformPointX(x,y);ty=invert_transform_text.TransformPointY(x,y);if(!this.isSlideShow()&&(this.document||this.drawingObjects.cSld&&!(this.noNeedUpdateCursorType===true))){var nPageIndex=pageIndex;if(this.drawingObjects.cSld&&!(this.noNeedUpdateCursorType===true)&&AscFormat.isRealNumber(this.drawingObjects.num))nPageIndex=this.drawingObjects.num;content.UpdateCursorType(tx,ty,0);ret.updated= true}else if(this.drawingObjects){check_hyperlink=fCheckObjectHyperlink(object,x,y);if(this.isSlideShow())if(isRealObject(check_hyperlink)){ret.hyperlink=check_hyperlink;ret.cursorType="pointer"}else return null;else if(isRealObject(check_hyperlink))ret.hyperlink=check_hyperlink}}return ret}},isSlideShow:function(){if(this.drawingObjects&&this.drawingObjects.cSld)return editor&&editor.WordControl&&editor.WordControl.DemonstrationManager&&editor.WordControl.DemonstrationManager.Mode;return false}, handleRotateTrack:function(e,x,y){var angle=this.curState.majorObject.getRotateAngle(x,y);this.rotateTrackObjects(angle,e);this.updateOverlay()},getSnapArrays:function(){var drawing_objects=this.getDrawingObjects();var snapX=[];var snapY=[];for(var i=0;i<drawing_objects.length;++i)if(drawing_objects[i].getSnapArrays)drawing_objects[i].getSnapArrays(snapX,snapY);return{snapX:snapX,snapY:snapY}},getLeftTopSelectedFromArray:function(aDrawings,pageIndex){var i,dX,dY;for(i=aDrawings.length-1;i>-1;--i)if(aDrawings[i].selected&& pageIndex===aDrawings[i].selectStartPage){dX=aDrawings[i].transform.TransformPointX(aDrawings[i].extX/2,aDrawings[i].extY/2)-aDrawings[i].extX/2;dY=aDrawings[i].transform.TransformPointY(aDrawings[i].extX/2,aDrawings[i].extY/2)-aDrawings[i].extY/2;return{X:dX,Y:dY,bSelected:true,PageIndex:pageIndex}}return{X:0,Y:0,bSelected:false,PageIndex:pageIndex}},getLeftTopSelectedObject:function(pageIndex){return this.getLeftTopSelectedFromArray(this.getDrawingObjects(),pageIndex)},createWatermarkImage:function(sImageUrl){return AscFormat.ExecuteNoHistory(function(){return this.createImage(sImageUrl, 0,0,110,61.875)},this,[])},IsSelectionUse:function(){var content=this.getTargetDocContent();if(content)return content.IsTextSelectionUse();else return this.selectedObjects.length>0},getFromTargetTextObjectContextMenuPosition:function(oTargetTextObject,pageIndex){var oTransformText=oTargetTextObject.transformText;var oTargetObjectOrTable=this.getTargetDocContent(false,true);if(oTargetTextObject&&oTargetObjectOrTable&&oTargetObjectOrTable.GetCursorPosXY&&oTransformText){var oPos=oTargetObjectOrTable.GetCursorPosXY(); return{X:oTransformText.TransformPointX(oPos.X,oPos.Y),Y:oTransformText.TransformPointY(oPos.X,oPos.Y),PageIndex:pageIndex}}return{X:0,Y:0,PageIndex:pageIndex}},isPointInDrawingObjects3:function(x,y,nPageIndex,bSelected,bText){var oOldState=this.curState;this.changeCurrentState(new AscFormat.NullState(this));var oResult,bRet=false;this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;oResult=this.curState.onMouseDown(AscCommon.global_mouseEvent,x,y,0);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;if(AscCommon.isRealObject(oResult))if(oResult.cursorType!== "text"){var object=g_oTableId.Get_ById(oResult.objectId);if(AscCommon.isRealObject(object)&&(bSelected&&object.selected||!bSelected))bRet=true;else return false}else if(bText)return true;this.changeCurrentState(oOldState);return bRet},isPointInDrawingObjects4:function(x,y,pageIndex){var oOldState=this.curState;this.changeCurrentState(new AscFormat.NullState(this));var oResult,nRet=0;this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;oResult=this.curState.onMouseDown(AscCommon.global_mouseEvent,x,y,0); this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;var object;if(AscCommon.isRealObject(oResult))if(oResult.cursorType==="text")nRet=0;else if(oResult.cursorType==="move"){object=g_oTableId.Get_ById(oResult.objectId);if(object&&object.hitInBoundingRect&&object.hitInBoundingRect(x,y))nRet=3;else nRet=2}else nRet=3;this.changeCurrentState(oOldState);return nRet},GetSelectionBounds:function(){var oTargetDocContent=this.getTargetDocContent(false,true);if(isRealObject(oTargetDocContent))return oTargetDocContent.GetSelectionBounds(); return null},CreateDocContent:function(){var oController=this;if(this.selection.groupSelection)oController=this.selection.groupSelection;if(oController.selection.textSelection)return;if(oController.selection.chartSelection)if(oController.selection.chartSelection.selection.textSelection){oController.selection.chartSelection.selection.textSelection.checkDocContent&&oController.selection.chartSelection.selection.textSelection.checkDocContent();return}if(oController.selectedObjects.length===1)if(oController.selectedObjects[0].getObjectType()=== AscDFH.historyitem_type_Shape){var oShape=oController.selectedObjects[0];if(!AscFormat.CheckLinePresetForParagraphAdd(oShape.getPresetGeom())){if(oShape.bWordShape){if(!oShape.textBoxContent)oShape.createTextBoxContent()}else if(!oShape.txBody)oShape.createTextBody();oController.selection.textSelection=oShape}}else if(oController.selection.chartSelection&&oController.selection.chartSelection.selection.title){oController.selection.chartSelection.selection.textSelection=oController.selection.chartSelection.selection.title; oController.selection.chartSelection.selection.textSelection.checkDocContent&&oController.selection.chartSelection.selection.textSelection.checkDocContent()}},getContextMenuPosition:function(pageIndex){var i,aDrawings,dX,dY,oTargetTextObject;if(this.selectedObjects.length>0){oTargetTextObject=getTargetTextObject(this);if(oTargetTextObject)return this.getFromTargetTextObjectContextMenuPosition(oTargetTextObject,pageIndex);else if(this.selection.groupSelection){aDrawings=this.selection.groupSelection.arrGraphicObjects; for(i=aDrawings.length-1;i>-1;--i)if(aDrawings[i].selected){dX=aDrawings[i].transform.TransformPointX(aDrawings[i].extX/2,aDrawings[i].extY/2)-aDrawings[i].extX/2;dY=aDrawings[i].transform.TransformPointY(aDrawings[i].extX/2,aDrawings[i].extY/2)-aDrawings[i].extY/2;return{X:dX,Y:dY,PageIndex:this.selection.groupSelection.selectStartPage}}}else return this.getLeftTopSelectedObject(pageIndex)}return{X:0,Y:0,PageIndex:pageIndex}},drawSelect:function(pageIndex,drawingDocument){if(undefined!==drawingDocument.BeginDrawTracking)drawingDocument.BeginDrawTracking(); var i;if(this.selection.textSelection){if(this.selection.textSelection.selectStartPage===pageIndex){drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.TEXT,this.selection.textSelection.getTransformMatrix(),0,0,this.selection.textSelection.extX,this.selection.textSelection.extY,AscFormat.CheckObjectLine(this.selection.textSelection),this.selection.textSelection.canRotate());if(this.selection.textSelection.drawAdjustments)this.selection.textSelection.drawAdjustments(drawingDocument)}}else if(this.selection.cropSelection){if(this.arrTrackObjects.length=== 0)if(this.selection.cropSelection.selectStartPage===pageIndex){var oCropSelection=this.selection.cropSelection;var cropObject=oCropSelection.getCropObject();if(cropObject){var oldGlobalAlpha;if(drawingDocument.AutoShapesTrack.Graphics){oldGlobalAlpha=drawingDocument.AutoShapesTrack.Graphics.globalAlpha;drawingDocument.AutoShapesTrack.Graphics.put_GlobalAlpha(false,1)}drawingDocument.AutoShapesTrack.SetCurrentPage(cropObject.selectStartPage,true);cropObject.draw(drawingDocument.AutoShapesTrack);drawingDocument.AutoShapesTrack.CorrectOverlayBounds(); drawingDocument.AutoShapesTrack.SetCurrentPage(cropObject.selectStartPage,true);oCropSelection.draw(drawingDocument.AutoShapesTrack);drawingDocument.AutoShapesTrack.CorrectOverlayBounds();if(drawingDocument.AutoShapesTrack.Graphics)drawingDocument.AutoShapesTrack.Graphics.put_GlobalAlpha(true,oldGlobalAlpha);drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE,cropObject.getTransformMatrix(),0,0,cropObject.extX,cropObject.extY,false,false);drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CROP,oCropSelection.getTransformMatrix(), 0,0,oCropSelection.extX,oCropSelection.extY,false,false)}}}else if(this.selection.groupSelection){if(this.selection.groupSelection.selectStartPage===pageIndex){drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.GROUP_PASSIVE,this.selection.groupSelection.getTransformMatrix(),0,0,this.selection.groupSelection.extX,this.selection.groupSelection.extY,false,this.selection.groupSelection.canRotate());if(this.selection.groupSelection.selection.textSelection)for(i=0;i<this.selection.groupSelection.selectedObjects.length;++i)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.TEXT, this.selection.groupSelection.selectedObjects[i].transform,0,0,this.selection.groupSelection.selectedObjects[i].extX,this.selection.groupSelection.selectedObjects[i].extY,AscFormat.CheckObjectLine(this.selection.groupSelection.selectedObjects[i]),this.selection.groupSelection.selectedObjects[i].canRotate());else if(this.selection.groupSelection.selection.chartSelection)this.selection.groupSelection.selection.chartSelection.drawSelect(drawingDocument,pageIndex);else for(i=0;i<this.selection.groupSelection.selectedObjects.length;++i)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE, this.selection.groupSelection.selectedObjects[i].transform,0,0,this.selection.groupSelection.selectedObjects[i].extX,this.selection.groupSelection.selectedObjects[i].extY,AscFormat.CheckObjectLine(this.selection.groupSelection.selectedObjects[i]),this.selection.groupSelection.selectedObjects[i].canRotate());if(this.selection.groupSelection.selectedObjects.length===1&&this.selection.groupSelection.selectedObjects[0].drawAdjustments)this.selection.groupSelection.selectedObjects[0].drawAdjustments(drawingDocument)}}else if(this.selection.chartSelection)this.selection.chartSelection.drawSelect(drawingDocument, pageIndex);else if(this.selection.wrapPolygonSelection){if(this.selection.wrapPolygonSelection.selectStartPage===pageIndex)drawingDocument.AutoShapesTrack.DrawEditWrapPointsPolygon(this.selection.wrapPolygonSelection.parent.wrappingPolygon.calculatedPoints,new AscCommon.CMatrix)}else{for(i=0;i<this.selectedObjects.length;++i)if(this.selectedObjects[i].selectStartPage===pageIndex)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE,this.selectedObjects[i].getTransformMatrix(),0,0,this.selectedObjects[i].extX, this.selectedObjects[i].extY,AscFormat.CheckObjectLine(this.selectedObjects[i]),this.selectedObjects[i].canRotate());if(this.selectedObjects.length===1&&this.selectedObjects[0].drawAdjustments&&this.selectedObjects[0].selectStartPage===pageIndex)this.selectedObjects[0].drawAdjustments(drawingDocument)}if(this.document)if(this.selectedObjects.length===1&&this.selectedObjects[0].parent&&!this.selectedObjects[0].parent.Is_Inline()){var anchor_pos;if(this.arrTrackObjects.length===1&&!(this.arrTrackObjects[0]instanceof TrackPointWrapPointWrapPolygon||this.arrTrackObjects[0]instanceof TrackNewPointWrapPolygon)){var page_index=AscFormat.isRealNumber(this.arrTrackObjects[0].pageIndex)?this.arrTrackObjects[0].pageIndex:AscFormat.isRealNumber(this.arrTrackObjects[0].selectStartPage)?this.arrTrackObjects[0].selectStartPage:0;if(page_index===pageIndex){var bounds=this.arrTrackObjects[0].getBounds();var nearest_pos=this.document.Get_NearestPos(page_index,bounds.min_x,bounds.min_y,true,this.selectedObjects[0].parent);nearest_pos.Page= page_index;drawingDocument.AutoShapesTrack.drawFlowAnchor(nearest_pos.X,nearest_pos.Y)}}else{var page_index=this.selectedObjects[0].selectStartPage;if(page_index===pageIndex){var paragraph=this.selectedObjects[0].parent.Get_ParentParagraph();anchor_pos=paragraph.Get_AnchorPos(this.selectedObjects[0].parent);if(anchor_pos)drawingDocument.AutoShapesTrack.drawFlowAnchor(anchor_pos.X,anchor_pos.Y)}}}if(this.selectionRect)drawingDocument.DrawTrackSelectShapes(this.selectionRect.x,this.selectionRect.y, this.selectionRect.w,this.selectionRect.h);if(this.connector){this.connector.drawConnectors(drawingDocument.AutoShapesTrack);this.connector=null}if(undefined!==drawingDocument.EndDrawTracking)drawingDocument.EndDrawTracking();return},selectObject:function(object,pageIndex){object.select(this,pageIndex)},deselectObject:function(object){for(var i=0;i<this.selectedObjects.length;++i)if(this.selectedObjects[i]===object){object.selected=false;this.selectedObjects.splice(i,1);return}},recalculate:function(){for(var key in this.objectsForRecalculate)this.objectsForRecalculate[key].recalculate(); this.objectsForRecalculate={}},addContentChanges:function(changes){},refreshContentChanges:function(){},getSelectionImage:function(){var oController2=this.selection.groupSelection?this.selection.groupSelection:this;var oRet,oPos;if(oController2.selectedObjects.length===0){oRet=new Asc.asc_CImgProperty;oRet.asc_putImageUrl("");oRet.asc_putWidth(0);oRet.asc_putHeight(0);oPos=new Asc.CPosition;oPos.put_X(0);oPos.put_Y(0);return null}var _bounds_cheker=new AscFormat.CSlideBoundsChecker;var dKoef=AscCommon.g_dKoef_mm_to_pix; var w_mm=210;var h_mm=297;var w_px=w_mm*dKoef+.5>>0;var h_px=h_mm*dKoef+.5>>0;_bounds_cheker.init(w_px,h_px,w_mm,h_mm);_bounds_cheker.transform(1,0,0,1,0,0);_bounds_cheker.AutoCheckLineWidth=true;for(var i=0;i<oController2.selectedObjects.length;++i)oController2.selectedObjects[i].draw(_bounds_cheker);var _need_pix_width=_bounds_cheker.Bounds.max_x-_bounds_cheker.Bounds.min_x+1;var _need_pix_height=_bounds_cheker.Bounds.max_y-_bounds_cheker.Bounds.min_y+1;if(_need_pix_width>0&&_need_pix_height>0){var _canvas= document.createElement("canvas");_canvas.width=_need_pix_width;_canvas.height=_need_pix_height;var _ctx=_canvas.getContext("2d");var sImageUrl;if(!window["NATIVE_EDITOR_ENJINE"]){var g=new AscCommon.CGraphics;g.init(_ctx,w_px,h_px,w_mm,h_mm);g.m_oFontManager=AscCommon.g_fontManager;g.m_oCoordTransform.tx=-_bounds_cheker.Bounds.min_x;g.m_oCoordTransform.ty=-_bounds_cheker.Bounds.min_y;g.transform(1,0,0,1,0,0);AscCommon.IsShapeToImageConverter=true;for(i=0;i<oController2.selectedObjects.length;++i)oController2.selectedObjects[i].draw(g); AscCommon.IsShapeToImageConverter=false;try{sImageUrl=_canvas.toDataURL("image/png")}catch(err){sImageUrl=""}}else sImageUrl="";oRet=new Asc.asc_CImgProperty;oPos=new Asc.CPosition;oPos.put_X(_bounds_cheker.Bounds.min_x*AscCommon.g_dKoef_pix_to_mm);oPos.put_Y(_bounds_cheker.Bounds.min_y*AscCommon.g_dKoef_pix_to_mm);oRet.asc_putPosition(oPos);oRet.asc_putImageUrl(sImageUrl);oRet.asc_putWidth(_canvas.width*AscCommon.g_dKoef_pix_to_mm);oRet.asc_putHeight(_canvas.height*AscCommon.g_dKoef_pix_to_mm);return oRet}}, getAllFontNames:function(){},getNearestPos:function(x,y){var oTragetDocContent=this.getTargetDocContent(false,false);if(oTragetDocContent){var tx=x,ty=y;var oTransform=oTragetDocContent.Get_ParentTextTransform();if(oTransform){var oInvertTransform=AscCommon.global_MatrixTransformer.Invert(oTransform);tx=oInvertTransform.TransformPointX(x,y);ty=oInvertTransform.TransformPointY(x,y);return oTragetDocContent.Get_NearestPos(0,tx,ty,false)}}return null},getNearestPos2:function(x,y){var oTragetDocContent= this.getTargetDocContent(false,false);if(oTragetDocContent){var tx=x,ty=y;var oTransform=oTragetDocContent.Get_ParentTextTransform();if(oTransform){var oInvertTransform=AscCommon.global_MatrixTransformer.Invert(oTransform);tx=oInvertTransform.TransformPointX(x,y);ty=oInvertTransform.TransformPointY(x,y);var oNearestPos=oTragetDocContent.Get_NearestPos(0,tx,ty,false);return oNearestPos}}return null},getNearestPos3:function(x,y){var oOldState=this.curState;this.changeCurrentState(new AscFormat.NullState(this)); var oResult,bRet=false;this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;oResult=this.curState.onMouseDown(AscCommon.global_mouseEvent,x,y,0);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;this.changeCurrentState(oOldState);if(oResult)if(oResult.cursorType==="text"){var oObject=AscCommon.g_oTableId.Get_ById(oResult.objectId);if(oObject&&oObject.getObjectType()===AscDFH.historyitem_type_Shape){var oContent=oObject.getDocContent();if(oContent){var tx=oObject.invertTransformText.TransformPointX(x,y);var ty= oObject.invertTransformText.TransformPointY(x,y);return oContent.Get_NearestPos(0,tx,ty,false)}}}return null},getTargetDocContent:function(bCheckChartTitle,bOrTable){var text_object=getTargetTextObject(this);if(text_object){if(bOrTable)if(text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame)return text_object.graphicObject;if(bCheckChartTitle&&text_object.checkDocContent)text_object.checkDocContent();return text_object.getDocContent()}return null},addNewParagraph:function(bRecalculate){this.applyTextFunction(CDocumentContent.prototype.AddNewParagraph, CTable.prototype.AddNewParagraph,[bRecalculate])},paragraphClearFormatting:function(isClearParaPr,isClearTextPr){this.applyDocContentFunction(AscFormat.CDrawingDocContent.prototype.ClearParagraphFormatting,[isClearParaPr,isClearTextPr],CTable.prototype.ClearParagraphFormatting)},applyDocContentFunction:function(f,args,tableFunction){var oThis=this;function applyToArrayDrawings(arr){var ret=false,ret2;for(var i=0;i<arr.length;++i){if(arr[i].getObjectType()===AscDFH.historyitem_type_GroupShape){ret2= applyToArrayDrawings(arr[i].arrGraphicObjects);if(ret2)ret=true}else if(arr[i].getObjectType()===AscDFH.historyitem_type_GraphicFrame){arr[i].graphicObject.Set_ApplyToAll(true);tableFunction.apply(arr[i].graphicObject,args);arr[i].graphicObject.Set_ApplyToAll(false);ret=true}else if(arr[i].getObjectType()===AscDFH.historyitem_type_ChartSpace){if(args[0].Type===para_TextPr){var oChartSpace=arr[i];var fCallback=function(oElement){AscFormat.CheckObjectTextPr(oElement,args[0].Value,oThis.getDrawingDocument())}; oChartSpace.applyLabelsFunction(fCallback,args[0].Value)}if(f===CDocumentContent.prototype.IncreaseDecreaseFontSize)arr[i].paragraphIncDecFontSize(args[0])}else if(arr[i].getDocContent){var content=arr[i].getDocContent();if(content){content.Set_ApplyToAll(true);f.apply(content,args);content.Set_ApplyToAll(false);ret=true}else if(arr[i].getObjectType()===AscDFH.historyitem_type_Shape)if(!AscFormat.CheckLinePresetForParagraphAdd(arr[i].getPresetGeom())){if(arr[i].bWordShape)arr[i].createTextBoxContent(); else arr[i].createTextBody();content=arr[i].getDocContent();if(content){content.Set_ApplyToAll(true);f.apply(content,args);content.Set_ApplyToAll(false);ret=true}}}if(arr[i].checkExtentsByDocContent)arr[i].checkExtentsByDocContent()}return ret}function applyToChartSelection(chart){var content;if(chart.selection.textSelection){chart.selection.textSelection.checkDocContent();content=chart.selection.textSelection.getDocContent();if(content)f.apply(content,args)}else if(chart.selection.title){content= chart.selection.title.getDocContent();if(content){content.Set_ApplyToAll(true);f.apply(content,args);content.Set_ApplyToAll(false)}}}if(this.selection.textSelection)if(this.selection.textSelection.getObjectType()!==AscDFH.historyitem_type_GraphicFrame){f.apply(this.selection.textSelection.getDocContent(),args);this.selection.textSelection.checkExtentsByDocContent()}else tableFunction.apply(this.selection.textSelection.graphicObject,args);else if(this.selection.groupSelection)if(this.selection.groupSelection.selection.textSelection)if(this.selection.groupSelection.selection.textSelection.getObjectType()!== AscDFH.historyitem_type_GraphicFrame){f.apply(this.selection.groupSelection.selection.textSelection.getDocContent(),args);this.selection.groupSelection.selection.textSelection.checkExtentsByDocContent()}else tableFunction.apply(this.selection.groupSelection.selection.textSelection.graphicObject,args);else if(this.selection.groupSelection.selection.chartSelection)if(f===CDocumentContent.prototype.IncreaseDecreaseFontSize)this.selection.groupSelection.selection.chartSelection.paragraphIncDecFontSize(args[0]); else applyToChartSelection(this.selection.groupSelection.selection.chartSelection);else applyToArrayDrawings(this.selection.groupSelection.selectedObjects);else if(this.selection.chartSelection)if(f===CDocumentContent.prototype.IncreaseDecreaseFontSize)this.selection.chartSelection.paragraphIncDecFontSize(args[0]);else applyToChartSelection(this.selection.chartSelection);else var ret=applyToArrayDrawings(this.selectedObjects);if(this.document)this.document.Recalculate()},setParagraphSpacing:function(Spacing){this.applyDocContentFunction(CDocumentContent.prototype.SetParagraphSpacing, [Spacing],CTable.prototype.SetParagraphSpacing)},setParagraphTabs:function(Tabs){this.applyTextFunction(CDocumentContent.prototype.SetParagraphTabs,CTable.prototype.SetParagraphTabs,[Tabs])},setParagraphNumbering:function(NumInfo){this.applyDocContentFunction(CDocumentContent.prototype.SetParagraphNumbering,[NumInfo],CTable.prototype.SetParagraphNumbering)},setParagraphShd:function(Shd){this.applyDocContentFunction(CDocumentContent.prototype.SetParagraphShd,[Shd],CTable.prototype.SetParagraphShd)}, setParagraphStyle:function(Style){this.applyDocContentFunction(CDocumentContent.prototype.SetParagraphStyle,[Style],CTable.prototype.SetParagraphStyle)},setParagraphContextualSpacing:function(Value){this.applyDocContentFunction(CDocumentContent.prototype.SetParagraphContextualSpacing,[Value],CTable.prototype.SetParagraphContextualSpacing)},setParagraphPageBreakBefore:function(Value){this.applyTextFunction(CDocumentContent.prototype.SetParagraphPageBreakBefore,CTable.prototype.SetParagraphPageBreakBefore, [Value])},setParagraphKeepLines:function(Value){this.applyTextFunction(CDocumentContent.prototype.SetParagraphKeepLines,CTable.prototype.SetParagraphKeepLines,[Value])},setParagraphKeepNext:function(Value){this.applyTextFunction(CDocumentContent.prototype.SetParagraphKeepNext,CTable.prototype.SetParagraphKeepNext,[Value])},setParagraphWidowControl:function(Value){this.applyTextFunction(CDocumentContent.prototype.SetParagraphWidowControl,CTable.prototype.SetParagraphWidowControl,[Value])},setParagraphBorders:function(Value){this.applyTextFunction(CDocumentContent.prototype.SetParagraphBorders, CTable.prototype.SetParagraphBorders,[Value])},handleEnter:function(){var oSelector=this.selection.groupSelection?this.selection.groupSelection:this;var aSelectedObjects2=oSelector.selectedObjects;var nRet=0;if(aSelectedObjects2.length===1){var oSelectedObject=aSelectedObjects2[0];var nObjectType=oSelectedObject.getObjectType();var oContent;switch(nObjectType){case AscDFH.historyitem_type_Shape:{oContent=oSelectedObject.getDocContent();if(!oContent){if(!CheckLinePresetForParagraphAdd(oSelectedObject.getPresetGeom()))this.checkSelectedObjectsAndCallback(function(){if(oSelectedObject.bWordShape)oSelectedObject.createTextBoxContent(); else oSelectedObject.createTextBody();oContent=oSelectedObject.getDocContent();if(oContent){oContent.MoveCursorToStartPos();oSelector.selection.textSelection=oSelectedObject}nRet|=1;nRet|=2},[],false,undefined,[],undefined)}else{if(oContent.IsEmpty())oContent.MoveCursorToStartPos();else oContent.SelectAll();nRet|=1;if(oSelectedObject.isEmptyPlaceholder())nRet|=2;oSelector.selection.textSelection=oSelectedObject}break}case AscDFH.historyitem_type_ChartSpace:{if(oSelector.selection.chartSelection=== oSelectedObject)if(oSelectedObject.selection.title){oContent=oSelectedObject.selection.title.getDocContent();if(oContent.IsEmpty())oContent.MoveCursorToStartPos();else oContent.SelectAll();nRet|=1;oSelectedObject.selection.textSelection=oSelectedObject.selection.title}break}case AscDFH.historyitem_type_GraphicFrame:{var oTable=oSelectedObject.graphicObject;if(oSelector.selection.textSelection===oSelectedObject){var oTableSelection=oTable.Selection;if(oTableSelection.Type===table_Selection_Cell)this.checkSelectedObjectsAndCallback(function(){oTable.Remove(-1); oTable.RemoveSelection();nRet|=1;nRet|=2},[],false,undefined,[],undefined)}else{oTable.MoveCursorToStartPos(false);var oCurCell=oTable.CurCell;if(oCurCell&&oCurCell.Content){if(!oCurCell.Content.IsEmpty()){oCurCell.Content.SelectAll();oTable.Selection.Use=true;oTable.Selection.Type=table_Selection_Text;oTable.Selection.StartPos.Pos={Row:oCurCell.Row.Index,Cell:oCurCell.Index};oTable.Selection.EndPos.Pos={Row:oCurCell.Row.Index,Cell:oCurCell.Index};oTable.Selection.CurRow=oCurCell.Row.Index}oSelector.selection.textSelection= oSelectedObject;nRet|=1}}break}}}return nRet},applyTextFunction:function(docContentFunction,tableFunction,args){if(this.selection.textSelection)this.selection.textSelection.applyTextFunction(docContentFunction,tableFunction,args);else if(this.selection.groupSelection){var oOldDoc=this.selection.groupSelection.document;this.selection.groupSelection.document=this.document;this.selection.groupSelection.applyTextFunction(docContentFunction,tableFunction,args);this.selection.groupSelection.document=oOldDoc}else if(this.selection.chartSelection){this.selection.chartSelection.applyTextFunction(docContentFunction, tableFunction,args);if(this.document)this.document.Recalculate()}else if(docContentFunction===CDocumentContent.prototype.AddToParagraph&&args[0].Type===para_TextPr||docContentFunction===CDocumentContent.prototype.PasteFormatting){var fDocContentCallback=function(){if(this.CanEditAllContentControls())docContentFunction.apply(this,args)};this.applyDocContentFunction(fDocContentCallback,args,tableFunction)}else if(this.selectedObjects.length===1&&(this.selectedObjects[0].getObjectType()===AscDFH.historyitem_type_Shape&& !CheckLinePresetForParagraphAdd(this.selectedObjects[0].getPresetGeom())&&!this.selectedObjects[0].signatureLine||this.selectedObjects[0].getObjectType()===AscDFH.historyitem_type_GraphicFrame)){this.selection.textSelection=this.selectedObjects[0];if(this.selectedObjects[0].getObjectType()===AscDFH.historyitem_type_GraphicFrame){this.selectedObjects[0].graphicObject.MoveCursorToStartPos(false);this.selectedObjects[0].applyTextFunction(docContentFunction,tableFunction,args)}else{var oDocContent=this.selectedObjects[0].getDocContent(); if(oDocContent)oDocContent.MoveCursorToEndPos(false);this.selectedObjects[0].applyTextFunction(docContentFunction,tableFunction,args);this.selection.textSelection.select(this,this.selection.textSelection.selectStartPage)}}else if(this.parent&&this.parent.GoTo_Text){this.parent.GoTo_Text();this.resetSelection();if(this.document&&(docpostype_DrawingObjects!==this.document.GetDocPosType()||isRealObject(getTargetTextObject(this.document.DrawingObjects)))&&CDocumentContent.prototype.AddNewParagraph=== docContentFunction)this.document.AddNewParagraph(args[0])}else if(this.selectedObjects.length>0&&this.selectedObjects[0].parent&&this.selectedObjects[0].parent.GoTo_Text){this.selectedObjects[0].parent.GoTo_Text();this.resetSelection();if(this.document&&(docpostype_DrawingObjects!==this.document.GetDocPosType()||isRealObject(getTargetTextObject(this)))&&CDocumentContent.prototype.AddNewParagraph===docContentFunction)this.document.AddNewParagraph(args[0])}},paragraphAdd:function(paraItem,bRecalculate){this.applyTextFunction(CDocumentContent.prototype.AddToParagraph, CTable.prototype.AddToParagraph,[paraItem,bRecalculate])},startTrackText:function(X,Y,oObject){if(this.drawingObjects.cSld){this.changeCurrentState(new AscFormat.TrackTextState(this,oObject,X,Y));return true}return false},setMathProps:function(oMathProps){var oContent=this.getTargetDocContent(false);if(oContent)this.checkSelectedObjectsAndCallback(function(){var oContent2=this.getTargetDocContent(true);if(oContent2){var SelectedInfo=new CSelectedElementsInfo;oContent2.GetSelectedElementsInfo(SelectedInfo); if(null!==SelectedInfo.GetMath()){var ParaMath=SelectedInfo.GetMath();ParaMath.Set_MenuProps(oMathProps)}}},[],false,AscDFH.historydescription_Spreadsheet_SetCellFontName)},paragraphIncDecFontSize:function(bIncrease){this.applyDocContentFunction(CDocumentContent.prototype.IncreaseDecreaseFontSize,[bIncrease],CTable.prototype.IncreaseDecreaseFontSize)},paragraphIncDecIndent:function(bIncrease){this.applyDocContentFunction(CDocumentContent.prototype.IncreaseDecreaseIndent,[bIncrease],CTable.prototype.IncreaseDecreaseIndent)}, setDefaultTabSize:function(TabSize){this.applyDocContentFunction(CDocumentContent.prototype.SetParagraphDefaultTabSize,[TabSize],CTable.prototype.SetParagraphDefaultTabSize)},setParagraphAlign:function(align){if(!this.document){var oContent=this.getTargetDocContent(true,false);if(oContent){var oInfo=new CSelectedElementsInfo;oContent.GetSelectedElementsInfo(oInfo);var Math=oInfo.GetMath();if(null!==Math&&true!==Math.Is_Inline()){Math.Set_Align(align);return}}}this.applyDocContentFunction(CDocumentContent.prototype.SetParagraphAlign, [align],CTable.prototype.SetParagraphAlign)},setParagraphIndent:function(indent){var content=this.getTargetDocContent(true);if(content)content.SetParagraphIndent(indent);else if(this.document)if(this.selectedObjects.length>0){var parent_paragraph=this.selectedObjects[0].parent.Get_ParentParagraph();if(parent_paragraph){parent_paragraph.Set_Ind(indent,true);this.document.Recalculate()}}},setCellFontName:function(fontName){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTextPr({FontFamily:{Name:fontName, Index:-1}}))};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_SetCellFontName)},setCellFontSize:function(fontSize){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTextPr({FontSize:fontSize}))};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_SetCellFontSize)},setCellBold:function(isBold){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTextPr({Bold:isBold}))};this.checkSelectedObjectsAndCallback(callBack, [],false,AscDFH.historydescription_Spreadsheet_SetCellBold)},setCellItalic:function(isItalic){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTextPr({Italic:isItalic}))};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_SetCellItalic)},setCellUnderline:function(isUnderline){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTextPr({Underline:isUnderline}))};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_SetCellUnderline)}, setCellStrikeout:function(isStrikeout){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTextPr({Strikeout:isStrikeout}))};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_SetCellStrikeout)},setCellSubscript:function(isSubscript){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTextPr({VertAlign:isSubscript?AscCommon.vertalign_SubScript:AscCommon.vertalign_Baseline}))};this.checkSelectedObjectsAndCallback(callBack,[],false, AscDFH.historydescription_Spreadsheet_SetCellSubscript)},setCellSuperscript:function(isSuperscript){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTextPr({VertAlign:isSuperscript?AscCommon.vertalign_SuperScript:AscCommon.vertalign_Baseline}))};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_SetCellSuperscript)},setCellAlign:function(align){this.checkSelectedObjectsAndCallback(this.setParagraphAlign,[align],false,AscDFH.historydescription_Spreadsheet_SetCellAlign)}, setCellVertAlign:function(align){var vert_align;switch(align){case Asc.c_oAscVAlign.Bottom:{vert_align=0;break}case Asc.c_oAscVAlign.Center:{vert_align=1;break}case Asc.c_oAscVAlign.Dist:{vert_align=1;break}case Asc.c_oAscVAlign.Just:{vert_align=1;break}case Asc.c_oAscVAlign.Top:{vert_align=4}}this.checkSelectedObjectsAndCallback(this.applyDrawingProps,[{verticalTextAlign:vert_align}],false,AscDFH.historydescription_Spreadsheet_SetCellVertAlign)},setCellTextWrap:function(isWrapped){},setCellTextShrink:function(isShrinked){}, setCellTextColor:function(color){var oThis=this;var callBack=function(){var unifill=new AscFormat.CUniFill;unifill.setFill(new AscFormat.CSolidFill);unifill.fill.setColor(AscFormat.CorrectUniColor(color,null));oThis.paragraphAdd(new ParaTextPr({Unifill:unifill}))};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_SetCellTextColor)},setCellBackgroundColor:function(color){var fill=new Asc.asc_CShapeFill;if(color){fill.type=c_oAscFill.FILL_TYPE_SOLID;fill.fill= new Asc.asc_CFillSolid;fill.fill.color=color}else fill.type=c_oAscFill.FILL_TYPE_NOFILL;this.checkSelectedObjectsAndCallback(this.applyDrawingProps,[{fill:fill}],false,AscDFH.historydescription_Spreadsheet_SetCellBackgroundColor)},setCellAngle:function(angle){if(0===angle)angle=AscFormat.nVertTThorz;else if(-90===angle)angle=AscFormat.nVertTTvert;else if(90===angle)angle=AscFormat.nVertTTvert270;else return;this.checkSelectedObjectsAndCallback(this.applyDrawingProps,[{vert:angle}],false,AscDFH.historydescription_Spreadsheet_SetCellVertAlign)}, setCellStyle:function(name){},increaseFontSize:function(){this.checkSelectedObjectsAndCallback(this.paragraphIncDecFontSize,[true],false,AscDFH.historydescription_Spreadsheet_SetCellIncreaseFontSize)},decreaseFontSize:function(){this.checkSelectedObjectsAndCallback(this.paragraphIncDecFontSize,[false],false,AscDFH.historydescription_Spreadsheet_SetCellDecreaseFontSize)},deleteSelectedObjects:function(){if(Asc["editor"]&&Asc["editor"].isChartEditor&&!this.selection.chartSelection)return;var oThis= this;this.checkSelectedObjectsAndCallback(function(){var oSelection=oThis.selection.groupSelection?oThis.selection.groupSelection.selection:oThis.selection;if(oSelection.chartSelection){oSelection.chartSelection.resetSelection(true);oSelection.chartSelection=null}if(oSelection.textSelection)oSelection.textSelection=null;oThis.removeCallback(-1,undefined,undefined,undefined,undefined,undefined);oThis.updateSelectionState()},[],false,AscDFH.historydescription_Spreadsheet_Remove)},hyperlinkCheck:function(bCheckEnd){var content= this.getTargetDocContent();if(content)return content.IsCursorInHyperlink(bCheckEnd);return null},hyperlinkCanAdd:function(bCheckInHyperlink){var content=this.getTargetDocContent();if(content){if(this.document&&content.Parent&&content.Parent instanceof AscFormat.CTextBody)return false;return content.CanAddHyperlink(bCheckInHyperlink)}return false},hyperlinkRemove:function(){var content=this.getTargetDocContent(true);if(content){var Ret=content.RemoveHyperlink();var target_text_object=getTargetTextObject(this); if(target_text_object)target_text_object.checkExtentsByDocContent&&target_text_object.checkExtentsByDocContent();return Ret}return undefined},hyperlinkModify:function(HyperProps){var content=this.getTargetDocContent(true);if(content){var Ret=content.ModifyHyperlink(HyperProps);var target_text_object=getTargetTextObject(this);if(target_text_object)target_text_object.checkExtentsByDocContent&&target_text_object.checkExtentsByDocContent();return Ret}return undefined},hyperlinkAdd:function(HyperProps){var content= this.getTargetDocContent(true),bCheckExtents=false;if(content){if(!this.document)if(null!=HyperProps.Text&&""!=HyperProps.Text&&true===content.IsSelectionUse()){this.removeCallback(-1,undefined,undefined,undefined,undefined,true);bCheckExtents=true}var Ret=content.AddHyperlink(HyperProps);if(bCheckExtents){var target_text_object=getTargetTextObject(this);if(target_text_object)target_text_object.checkExtentsByDocContent&&target_text_object.checkExtentsByDocContent()}return Ret}return null},insertHyperlink:function(options){if(!this.getHyperlinkInfo())this.checkSelectedObjectsAndCallback(this.hyperlinkAdd, [{Text:options.text,Value:options.hyperlinkModel.Hyperlink,ToolTip:options.hyperlinkModel.Tooltip}],false,AscDFH.historydescription_Spreadsheet_SetCellHyperlinkAdd);else this.checkSelectedObjectsAndCallback(this.hyperlinkModify,[{Text:options.text,Value:options.hyperlinkModel.Hyperlink,ToolTip:options.hyperlinkModel.Tooltip}],false,AscDFH.historydescription_Spreadsheet_SetCellHyperlinkModify)},removeHyperlink:function(){this.checkSelectedObjectsAndCallback(this.hyperlinkRemove,[],false,AscDFH.historydescription_Spreadsheet_SetCellHyperlinkRemove)}, canAddHyperlink:function(){return this.hyperlinkCanAdd()},getParagraphParaPr:function(){var target_text_object=getTargetTextObject(this);if(target_text_object)if(target_text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame)return target_text_object.graphicObject.GetCalculatedParaPr();else{var content=this.getTargetDocContent();if(content)return content.GetCalculatedParaPr()}else{var result,cur_pr,selected_objects,i;var getPropsFromArr=function(arr){var cur_pr,result_pr,content;for(var i= 0;i<arr.length;++i){cur_pr=null;if(arr[i].getObjectType()===AscDFH.historyitem_type_GroupShape)cur_pr=getPropsFromArr(arr[i].arrGraphicObjects);else if(arr[i].getDocContent&&arr[i].getObjectType()!==AscDFH.historyitem_type_ChartSpace){content=arr[i].getDocContent();if(content){content.Set_ApplyToAll(true);cur_pr=content.GetCalculatedParaPr();content.Set_ApplyToAll(false)}}if(cur_pr)if(!result_pr)result_pr=cur_pr;else result_pr.Compare(cur_pr)}return result_pr};if(this.selection.groupSelection)result= getPropsFromArr(this.selection.groupSelection.selectedObjects);else result=getPropsFromArr(this.selectedObjects);return result}},getTheme:function(){return window["Asc"]["editor"].wbModel.theme},getParagraphTextPr:function(){var target_text_object=getTargetTextObject(this);if(target_text_object)if(target_text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame)return target_text_object.graphicObject.GetCalculatedTextPr();else{var content=this.getTargetDocContent();if(content)return content.GetCalculatedTextPr()}else{var result, cur_pr,selected_objects,i;var getPropsFromArr=function(arr){var cur_pr,result_pr,content;for(var i=0;i<arr.length;++i){cur_pr=null;if(arr[i].getObjectType()===AscDFH.historyitem_type_GroupShape)cur_pr=getPropsFromArr(arr[i].arrGraphicObjects);else if(arr[i].getObjectType()===AscDFH.historyitem_type_ChartSpace)cur_pr=arr[i].getParagraphTextPr();else if(arr[i].getDocContent){content=arr[i].getDocContent();if(content){content.Set_ApplyToAll(true);cur_pr=content.GetCalculatedTextPr();content.Set_ApplyToAll(false)}}if(cur_pr)if(!result_pr)result_pr= cur_pr;else result_pr.Compare(cur_pr)}return result_pr};if(this.selection.groupSelection)result=getPropsFromArr(this.selection.groupSelection.selectedObjects);else if(this.selectedObjects&&1===this.selectedObjects.length&&this.selectedObjects[0].getObjectType()===AscDFH.historyitem_type_ImageShape&&this.selectedObjects[0].parent&&this.selectedObjects[0].parent.Parent&&this.selectedObjects[0].parent.Parent.GetCalculatedTextPr){var oParaDrawing=this.selectedObjects[0].parent;var oParagraph=oParaDrawing.Parent; oParagraph.MoveCursorToDrawing(oParaDrawing.Get_Id(),true);result=oParagraph.GetCalculatedTextPr()}else result=getPropsFromArr(this.selectedObjects);return result}},getColorMap:function(){return AscFormat.G_O_DEFAULT_COLOR_MAP},editChartDrawingObjects:function(chart){if(this.chartForProps){this.resetSelection();if(this.chartForProps.group){var main_group=this.chartForProps.getMainGroup();this.selectObject(main_group,0);this.selection.groupSelection=main_group;main_group.selectObject(this.chartForProps, 0)}else this.selectObject(this.chartForProps);this.chartForProps=null}var objects_by_types=this.getSelectedObjectsByTypes();if(objects_by_types.charts.length===1)this.checkSelectedObjectsAndCallback(this.editChartCallback,[chart],false,AscDFH.historydescription_Spreadsheet_EditChart)},getTextArtPreviewManager:function(){var api=this.getEditorApi();return api.textArtPreviewManager},resetConnectors:function(aShapes){var aAllConnectors=this.getAllConnectors(this.getDrawingArray());for(var i=0;i<aAllConnectors.length;++i)for(var j= 0;j<aShapes.length;++j)aAllConnectors[i].resetShape(aShapes[j])},getConnectorsForCheck:function(){var aSelectedObjects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects;var aAllConnectors=this.getAllConnectorsByDrawings(aSelectedObjects,[],undefined,true);var _ret=[];for(var i=0;i<aAllConnectors.length;++i)if(!aAllConnectors[i].selected)_ret.push(aAllConnectors[i]);return _ret},getConnectorsForCheck2:function(){var aConnectors=this.getConnectorsForCheck(); var oGroupMaps={};var _ret=[];for(var i=0;i<aConnectors.length;++i){var oGroup=aConnectors[i].getMainGroup();if(oGroup)oGroupMaps[oGroup.Id]=oGroup;else _ret.push(aConnectors[i])}for(i in oGroupMaps)if(oGroupMaps.hasOwnProperty(i))_ret.push(oGroupMaps[i]);return _ret},applyDrawingProps:function(props){var objects_by_type=this.getSelectedObjectsByTypes(true);var i;if(AscFormat.isRealNumber(props.verticalTextAlign)){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].setVerticalAlign(props.verticalTextAlign); for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].setVerticalAlign(props.verticalTextAlign);if(objects_by_type.tables.length===1){var props2=new Asc.CTableProp;if(props.verticalTextAlign===AscFormat.VERTICAL_ANCHOR_TYPE_BOTTOM)props2.put_CellsVAlign(vertalignjc_Bottom);else if(props.verticalTextAlign===AscFormat.VERTICAL_ANCHOR_TYPE_CENTER)props2.put_CellsVAlign(vertalignjc_Center);else props2.put_CellsVAlign(vertalignjc_Top);var target_text_object=getTargetTextObject(this);if(target_text_object=== objects_by_type.tables[0])objects_by_type.tables[0].graphicObject.Set_Props(props2);else{objects_by_type.tables[0].graphicObject.SelectAll();objects_by_type.tables[0].graphicObject.Set_Props(props2);objects_by_type.tables[0].graphicObject.RemoveSelection()}editor.WordControl.m_oLogicDocument.Check_GraphicFrameRowHeight(objects_by_type.tables[0])}}if(AscFormat.isRealNumber(props.columnNumber)){for(i=0;i<objects_by_type.shapes.length;++i){objects_by_type.shapes[i].setColumnNumber(props.columnNumber); objects_by_type.shapes[i].recalculate();objects_by_type.shapes[i].checkExtentsByDocContent()}for(i=0;i<objects_by_type.groups.length;++i){objects_by_type.groups[i].setColumnNumber(props.columnNumber);objects_by_type.groups[i].recalculate();objects_by_type.groups[i].checkExtentsByDocContent()}}if(AscFormat.isRealNumber(props.columnSpace)){for(i=0;i<objects_by_type.shapes.length;++i){objects_by_type.shapes[i].setColumnSpace(props.columnSpace);objects_by_type.shapes[i].recalculate();objects_by_type.shapes[i].checkExtentsByDocContent()}for(i= 0;i<objects_by_type.groups.length;++i){objects_by_type.groups[i].setColumnSpace(props.columnSpace);objects_by_type.groups[i].recalculate();objects_by_type.groups[i].checkExtentsByDocContent()}}if(AscFormat.isRealNumber(props.vert)){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].setVert(props.vert);for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].setVert(props.vert)}if(isRealObject(props.paddings)){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].setPaddings(props.paddings); for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].setPaddings(props.paddings)}if(AscFormat.isRealNumber(props.textFitType)){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].setTextFitType(props.textFitType);for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].setTextFitType(props.textFitType)}if(AscFormat.isRealNumber(props.vertOverflowType)){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].setVertOverflowType(props.vertOverflowType); for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].setVertOverflowType(props.vertOverflowType)}if(typeof props.type==="string"){var aShapes=[];for(i=0;i<objects_by_type.shapes.length;++i)if(objects_by_type.shapes[i].getObjectType()===AscDFH.historyitem_type_Shape){objects_by_type.shapes[i].changePresetGeom(props.type);aShapes.push(objects_by_type.shapes[i])}for(i=0;i<objects_by_type.groups.length;++i){objects_by_type.groups[i].changePresetGeom(props.type);objects_by_type.groups[i].getAllShapes(objects_by_type.groups[i].spTree, aShapes)}for(i=0;i<objects_by_type.images.length;++i){objects_by_type.images[i].changePresetGeom(props.type);aShapes.push(objects_by_type.images[i])}this.resetConnectors(aShapes)}if(isRealObject(props.stroke)){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].changeLine(props.stroke);for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].changeLine(props.stroke);for(i=0;i<objects_by_type.charts.length;++i)objects_by_type.charts[i].changeLine(props.stroke);for(i= 0;i<objects_by_type.images.length;++i)objects_by_type.images[i].changeLine(props.stroke)}if(isRealObject(props.fill)){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].changeFill(props.fill);for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].changeFill(props.fill);for(i=0;i<objects_by_type.charts.length;++i)objects_by_type.charts[i].changeFill(props.fill)}if(isRealObject(props.shadow)||props.shadow===null){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].changeShadow(props.shadow); for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].changeShadow(props.shadow);for(i=0;i<objects_by_type.images.length;++i)objects_by_type.images[i].changeShadow(props.shadow)}if(props.title!==null&&props.title!==undefined){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].setTitle(props.title);for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].setTitle(props.title);for(i=0;i<objects_by_type.charts.length;++i)objects_by_type.charts[i].setTitle(props.title); for(i=0;i<objects_by_type.images.length;++i)objects_by_type.images[i].setTitle(props.title)}if(props.description!==null&&props.description!==undefined){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].setDescription(props.description);for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].setDescription(props.description);for(i=0;i<objects_by_type.charts.length;++i)objects_by_type.charts[i].setDescription(props.description);for(i=0;i<objects_by_type.images.length;++i)objects_by_type.images[i].setDescription(props.description)}if(props.anchor!== null&&props.anchor!==undefined)for(i=0;i<this.selectedObjects.length;++i){CheckSpPrXfrm3(this.selectedObjects[i]);this.selectedObjects[i].setDrawingBaseType(props.anchor);if(props.anchor===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)this.selectedObjects[i].setDrawingBaseEditAs(AscCommon.c_oAscCellAnchorType.cellanchorTwoCell);this.selectedObjects[i].checkDrawingBaseCoords()}if(typeof props.ImageUrl==="string"&&props.ImageUrl.length>0){var oImg;for(i=0;i<objects_by_type.images.length;++i){oImg= objects_by_type.images[i];oImg.setBlipFill(CreateBlipFillRasterImageId(props.ImageUrl));if(oImg.parent instanceof ParaDrawing){var oRun=oImg.parent.GetRun();if(oRun)oRun.CheckParentFormKey(props.ImageUrl)}}}if(props.resetCrop)for(i=0;i<objects_by_type.images.length;++i)if(objects_by_type.images[i].blipFill){var oBlipFill=objects_by_type.images[i].blipFill.createDuplicate();oBlipFill.tile=null;oBlipFill.stretch=true;oBlipFill.srcRect=null;objects_by_type.images[i].setBlipFill(oBlipFill)}if(props.ChartProperties)for(i= 0;i<objects_by_type.charts.length;++i)this.applyPropsToChartSpace(props.ChartProperties,objects_by_type.charts[i]);var aGroups=[];var bCheckConnectors=false;var aSlicerNames=[];if(props.SlicerProperties){var aSlicers=objects_by_type.slicers;var oAPI=Asc.editor;History.StartTransaction();var bSize=false;var oSlicer;for(i=0;i<aSlicers.length;++i){oSlicer=aSlicers[i];aSlicerNames.push(oSlicer.getName());bSize|=oSlicer.setButtonWidth(props.SlicerProperties.asc_getButtonWidth());oSlicer.recalculate(); var bLocked=props.SlicerProperties.asc_getLockedPosition()===true;if(bLocked){oSlicer.setLockValue(AscFormat.LOCKS_MASKS.noMove,true);oSlicer.setLockValue(AscFormat.LOCKS_MASKS.noResize,true)}else{oSlicer.setLockValue(AscFormat.LOCKS_MASKS.noMove,undefined);oSlicer.setLockValue(AscFormat.LOCKS_MASKS.noResize,undefined)}}if(!bSize)if(AscFormat.isRealNumber(props.Width)||AscFormat.isRealNumber(props.Height))for(i=0;i<aSlicers.length;++i){oSlicer=aSlicers[i];var bChanged=false;if(AscFormat.isRealNumber(props.Width)){CheckSpPrXfrm(oSlicer); oSlicer.spPr.xfrm.setExtX(props.Width);bChanged=true}if(AscFormat.isRealNumber(props.Height)){CheckSpPrXfrm(oSlicer);oSlicer.spPr.xfrm.setExtY(props.Height);bChanged=true}bCheckConnectors|=bChanged;if(bChanged){if(oSlicer.group)checkObjectInArray(aGroups,oSlicer.group.getMainGroup());oSlicer.checkDrawingBaseCoords()}oSlicer.recalculate()}}var oApi=editor||Asc["editor"];var editorId=oApi.getEditorId();var bMoveFlag=true;if(AscFormat.isRealNumber(props.Width)||AscFormat.isRealNumber(props.Height)){for(i= 0;i<objects_by_type.shapes.length;++i){CheckSpPrXfrm(objects_by_type.shapes[i]);if(!props.SizeRelH&&AscFormat.isRealNumber(props.Width)){objects_by_type.shapes[i].spPr.xfrm.setExtX(props.Width);if(objects_by_type.shapes[i].parent instanceof ParaDrawing)objects_by_type.shapes[i].parent.SetSizeRelH({RelativeFrom:c_oAscSizeRelFromH.sizerelfromhPage,Percent:0})}if(!props.SizeRelV&&AscFormat.isRealNumber(props.Height)){objects_by_type.shapes[i].spPr.xfrm.setExtY(props.Height);if(objects_by_type.shapes[i].parent instanceof ParaDrawing)objects_by_type.shapes[i].parent.SetSizeRelV({RelativeFrom:c_oAscSizeRelFromV.sizerelfromvPage,Percent:0})}if(objects_by_type.shapes[i].parent instanceof ParaDrawing){var oDrawing=objects_by_type.shapes[i].parent;if(oDrawing.SizeRelH&&!oDrawing.SizeRelV)oDrawing.SetSizeRelV({RelativeFrom:c_oAscSizeRelFromV.sizerelfromvPage,Percent:0});if(oDrawing.SizeRelV&&!oDrawing.SizeRelH)oDrawing.SetSizeRelH({RelativeFrom:c_oAscSizeRelFromH.sizerelfromhPage,Percent:0})}CheckShapeBodyAutoFitReset(objects_by_type.shapes[i], true);if(objects_by_type.shapes[i].group)checkObjectInArray(aGroups,objects_by_type.shapes[i].group.getMainGroup());objects_by_type.shapes[i].checkDrawingBaseCoords()}if(!props.SizeRelH&&!props.SizeRelV&&AscFormat.isRealNumber(props.Width)&&AscFormat.isRealNumber(props.Height)){for(i=0;i<objects_by_type.images.length;++i){CheckSpPrXfrm3(objects_by_type.images[i]);objects_by_type.images[i].spPr.xfrm.setExtX(props.Width);objects_by_type.images[i].spPr.xfrm.setExtY(props.Height);if(objects_by_type.images[i].group)checkObjectInArray(aGroups, objects_by_type.images[i].group.getMainGroup());objects_by_type.images[i].checkDrawingBaseCoords()}for(i=0;i<objects_by_type.charts.length;++i){CheckSpPrXfrm3(objects_by_type.charts[i]);objects_by_type.charts[i].spPr.xfrm.setExtX(props.Width);objects_by_type.charts[i].spPr.xfrm.setExtY(props.Height);if(objects_by_type.charts[i].group)checkObjectInArray(aGroups,objects_by_type.charts[i].group.getMainGroup());objects_by_type.charts[i].checkDrawingBaseCoords()}for(i=0;i<objects_by_type.oleObjects.length;++i){CheckSpPrXfrm3(objects_by_type.oleObjects[i]); objects_by_type.oleObjects[i].spPr.xfrm.setExtX(props.Width);objects_by_type.oleObjects[i].spPr.xfrm.setExtY(props.Height);if(objects_by_type.oleObjects[i].group)checkObjectInArray(aGroups,objects_by_type.oleObjects[i].group.getMainGroup());var api=window.editor||window["Asc"]["editor"];if(api){var pluginData=new Asc.CPluginData;pluginData.setAttribute("data",objects_by_type.oleObjects[i].m_sData);pluginData.setAttribute("guid",objects_by_type.oleObjects[i].m_sApplicationId);pluginData.setAttribute("width", objects_by_type.oleObjects[i].spPr.xfrm.extX);pluginData.setAttribute("height",objects_by_type.oleObjects[i].spPr.xfrm.extY);pluginData.setAttribute("objectId",objects_by_type.oleObjects[i].Get_Id());api.asc_pluginResize(pluginData)}objects_by_type.oleObjects[i].checkDrawingBaseCoords()}}if(editorId===AscCommon.c_oEditorId.Presentation||editorId===AscCommon.c_oEditorId.Spreadsheet){bCheckConnectors=true;bMoveFlag=false}}if(AscFormat.isRealBool(props.lockAspect)){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].setNoChangeAspect(props.lockAspect? true:undefined);for(i=0;i<objects_by_type.images.length;++i)objects_by_type.images[i].setNoChangeAspect(props.lockAspect?true:undefined);for(i=0;i<objects_by_type.charts.length;++i)objects_by_type.charts[i].setNoChangeAspect(props.lockAspect?true:undefined);for(i=0;i<objects_by_type.slicers.length;++i)objects_by_type.slicers[i].setNoChangeAspect(props.lockAspect?true:undefined)}if(isRealObject(props.Position)&&AscFormat.isRealNumber(props.Position.X)&&AscFormat.isRealNumber(props.Position.Y)||AscFormat.isRealBool(props.flipH)|| AscFormat.isRealBool(props.flipV)||AscFormat.isRealBool(props.flipHInvert)||AscFormat.isRealBool(props.flipVInvert)||AscFormat.isRealNumber(props.rotAdd)||AscFormat.isRealNumber(props.rot)||AscFormat.isRealNumber(props.anchor)){var bPosition=isRealObject(props.Position)&&(AscFormat.isRealNumber(props.Position.X)||AscFormat.isRealNumber(props.Position.Y));for(i=0;i<objects_by_type.shapes.length;++i){CheckSpPrXfrm(objects_by_type.shapes[i]);if(bPosition){if(AscFormat.isRealNumber(props.Position.X))objects_by_type.shapes[i].spPr.xfrm.setOffX(props.Position.X); if(AscFormat.isRealNumber(props.Position.Y))objects_by_type.shapes[i].spPr.xfrm.setOffY(props.Position.Y)}if(AscFormat.isRealBool(props.flipH))objects_by_type.shapes[i].spPr.xfrm.setFlipH(props.flipH);if(AscFormat.isRealBool(props.flipV))objects_by_type.shapes[i].spPr.xfrm.setFlipV(props.flipV);if(props.flipHInvert)objects_by_type.shapes[i].spPr.xfrm.setFlipH(!objects_by_type.shapes[i].flipH);if(props.flipVInvert)objects_by_type.shapes[i].spPr.xfrm.setFlipV(!objects_by_type.shapes[i].flipV);if(AscFormat.isRealNumber(props.rotAdd))objects_by_type.shapes[i].spPr.xfrm.setRot(AscFormat.normalizeRotate(objects_by_type.shapes[i].rot+ props.rotAdd));if(AscFormat.isRealNumber(props.rot))objects_by_type.shapes[i].spPr.xfrm.setRot(AscFormat.normalizeRotate(props.rot));if(objects_by_type.shapes[i].group)checkObjectInArray(aGroups,objects_by_type.shapes[i].group.getMainGroup());objects_by_type.shapes[i].checkDrawingBaseCoords()}for(i=0;i<objects_by_type.images.length;++i){CheckSpPrXfrm(objects_by_type.images[i]);if(bPosition){if(AscFormat.isRealNumber(props.Position.X))objects_by_type.images[i].spPr.xfrm.setOffX(props.Position.X);if(AscFormat.isRealNumber(props.Position.Y))objects_by_type.images[i].spPr.xfrm.setOffY(props.Position.Y)}if(AscFormat.isRealBool(props.flipH))objects_by_type.images[i].spPr.xfrm.setFlipH(props.flipH); if(AscFormat.isRealBool(props.flipV))objects_by_type.images[i].spPr.xfrm.setFlipV(props.flipV);if(props.flipHInvert)objects_by_type.images[i].spPr.xfrm.setFlipH(!objects_by_type.images[i].flipH);if(props.flipVInvert)objects_by_type.images[i].spPr.xfrm.setFlipV(!objects_by_type.images[i].flipV);if(AscFormat.isRealNumber(props.rot))objects_by_type.images[i].spPr.xfrm.setRot(AscFormat.normalizeRotate(props.rot));if(AscFormat.isRealNumber(props.rotAdd))objects_by_type.images[i].spPr.xfrm.setRot(AscFormat.normalizeRotate(objects_by_type.images[i].rot+ props.rotAdd));if(objects_by_type.images[i].group)checkObjectInArray(aGroups,objects_by_type.images[i].group.getMainGroup());objects_by_type.images[i].checkDrawingBaseCoords()}if(bPosition){for(i=0;i<objects_by_type.charts.length;++i){CheckSpPrXfrm(objects_by_type.charts[i]);if(AscFormat.isRealNumber(props.Position.X))objects_by_type.charts[i].spPr.xfrm.setOffX(props.Position.X);if(AscFormat.isRealNumber(props.Position.Y))objects_by_type.charts[i].spPr.xfrm.setOffY(props.Position.Y);if(objects_by_type.charts[i].group)checkObjectInArray(aGroups, objects_by_type.charts[i].group.getMainGroup());objects_by_type.charts[i].checkDrawingBaseCoords()}var aSlicers=objects_by_type.slicers;for(i=0;i<aSlicers.length;++i){var oSlicer=aSlicers[i];CheckSpPrXfrm(oSlicer);if(AscFormat.isRealNumber(props.Position.X))oSlicer.spPr.xfrm.setOffX(props.Position.X);if(AscFormat.isRealNumber(props.Position.Y))oSlicer.spPr.xfrm.setOffY(props.Position.Y);if(oSlicer.group)checkObjectInArray(aGroups,oSlicer.group.getMainGroup());oSlicer.checkDrawingBaseCoords();oSlicer.recalculate()}}if(editorId=== AscCommon.c_oEditorId.Presentation||editorId===AscCommon.c_oEditorId.Spreadsheet)bCheckConnectors=true}if(bCheckConnectors){var aConnectors=this.getConnectorsForCheck();for(i=0;i<aConnectors.length;++i){aConnectors[i].calculateTransform(bMoveFlag);var oGroup=aConnectors[i].getMainGroup();if(oGroup)checkObjectInArray(aGroups,oGroup)}}for(i=0;i<aGroups.length;++i)aGroups[i].updateCoordinatesAfterInternalResize();var bRecalcText=false;if(props.textArtProperties){var oAscTextArtProperties=props.textArtProperties; var oParaTextPr;var nStyle=oAscTextArtProperties.asc_getStyle();var bWord=typeof CGraphicObjects!=="undefined"&&this instanceof CGraphicObjects;if(AscFormat.isRealNumber(nStyle)){var oPreviewManager=this.getTextArtPreviewManager();var oStyleTextPr=oPreviewManager.getStylesToApply()[nStyle].Copy();if(bWord)oParaTextPr=new ParaTextPr({TextFill:oStyleTextPr.TextFill,TextOutline:oStyleTextPr.TextOutline});else oParaTextPr=new ParaTextPr({Unifill:oStyleTextPr.TextFill,TextOutline:oStyleTextPr.TextOutline})}else{var oAscFill= oAscTextArtProperties.asc_getFill(),oAscStroke=oAscTextArtProperties.asc_getLine();if(oAscFill||oAscStroke)if(bWord)oParaTextPr=new ParaTextPr({AscFill:oAscFill,AscLine:oAscStroke});else oParaTextPr=new ParaTextPr({AscUnifill:oAscFill,AscLine:oAscStroke})}if(oParaTextPr){bRecalcText=true;if(this.document&&this.document.TurnOff_Recalculate)this.document.TurnOff_Recalculate();this.paragraphAdd(oParaTextPr);if(this.document&&this.document.TurnOn_Recalculate)this.document.TurnOn_Recalculate()}var oPreset= oAscTextArtProperties.asc_getForm();if(typeof oPreset==="string"){for(i=0;i<objects_by_type.shapes.length;++i)objects_by_type.shapes[i].applyTextArtForm(oPreset);for(i=0;i<objects_by_type.groups.length;++i)objects_by_type.groups[i].applyTextArtForm(oPreset);this.resetTextSelection()}}if(props.SlicerProperties)oAPI.asc_setSlicers(aSlicerNames,props.SlicerProperties);var oApi=this.getEditorApi();if(oApi&&oApi.noCreatePoint&&!oApi.exucuteHistory){for(i=0;i<objects_by_type.shapes.length;++i){if(bRecalcText){objects_by_type.shapes[i].recalcText(); if(bWord)objects_by_type.shapes[i].recalculateText()}objects_by_type.shapes[i].recalculate()}for(i=0;i<objects_by_type.groups.length;++i){if(bRecalcText){objects_by_type.groups[i].recalcText();if(bWord)objects_by_type.shapes[i].recalculateText()}objects_by_type.groups[i].recalculate()}}return objects_by_type},getSelectedObjectsByTypes:function(bGroupedObjects){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects;return getObjectsByTypesFromArr(selected_objects, bGroupedObjects)},editChartCallback:function(chartSettings){var objects_by_types=this.getSelectedObjectsByTypes();if(objects_by_types.charts.length===1){var chart_space=objects_by_types.charts[0];this.applyPropsToChartSpace(chartSettings,chart_space)}},applyPropsToChartSpace:function(chartSettings,chartSpace){var chart_space=chartSpace;var style_index=chartSettings.getStyle();var sRange=chartSettings.getRange();var b_clear_formatting=false;chartSpace.resetSelection(true);var oPr=this.getPropsFromChart(chart_space); if(oPr.isEqual(chartSettings)){var oChartType=chart_space&&chart_space.chart&&chart_space.chart.plotArea&&chart_space.chart.plotArea.charts[0];if(!oChartType)return;if(typeof oChartType.setDLbls==="function"&&AscFormat.isRealNumber(chartSettings.getDataLabelsPos())&&chartSettings.getDataLabelsPos()!==c_oAscChartDataLabelsPos.none){if(oChartType.dLbls&&oChartType.dLbls.bDelete)oChartType.dLbls.setDelete(false);for(var i=0;i<oChartType.series.length;++i){var oSerie=oChartType.series[i];if(oSerie.dLbls)if(oSerie.dLbls.bDelete){oSerie.dLbls.setDelete(false); for(var j=0;j<oSerie.dLbls.dLbl.length;++j)if(oSerie.dLbls.dLbl[j].bDelete)oSerie.dLbls.dLbl[j].setDelete(false)}}}return}var type=chartSettings.getType();if(oPr.getType()===type){chartSettings.type=null;var testChartSettings=new Asc.asc_ChartSettings;if(testChartSettings.isEqual(chartSettings)){chartSettings.type=type;return}chartSettings.type=type}chart_space.setChart(chart_space.chart.createDuplicate());var chart=chart_space.chart;var plot_area=chart.plotArea;if(AscFormat.isRealNumber(style_index)){--style_index; var oCurChartSettings=oPr;var _cur_type=oCurChartSettings.type;if(AscCommon.g_oChartPresets[_cur_type]&&AscCommon.g_oChartPresets[_cur_type][style_index]){plot_area.removeCharts(1,plot_area.charts.length-1);AscFormat.ApplyPresetToChartSpace(chartSpace,AscCommon.g_oChartPresets[_cur_type][style_index],chartSettings.bCreate);return}}chart_space.updateLinks();var oValAx=chart_space.chart.plotArea.valAx;var oCatAx=chart_space.chart.plotArea.catAx;chart_space.setStyle(chart_space.style);if(this.drawingObjects&& this.drawingObjects.getWorksheet&&typeof sRange==="string"&&sRange.length>0){var ws_view=this.drawingObjects.getWorksheet();var parsed_formula=parserHelp.parse3DRef(sRange);if(parsed_formula){var ws=ws_view.model.workbook.getWorksheetByName(parsed_formula.sheet);var new_bbox;var range_object=ws.getRange2(parsed_formula.range);if(range_object)new_bbox=range_object.bbox;if(ws&&new_bbox){var oCommonBBox=chart_space.getCommonBBox();var b_equal_bbox=oCommonBBox&&oCommonBBox.r1===new_bbox.r1&&oCommonBBox.r2=== new_bbox.r2&&oCommonBBox.c1===new_bbox.c1&&oCommonBBox.c2===new_bbox.c2;var b_equal_ws=chart_space.bbox&&chart_space.bbox.worksheet===ws;var b_equal_vert=chart_space.bbox&&chartSettings.getInColumns()===!chart_space.bbox.seriesBBox.bVert;var bLimit=Math.abs(new_bbox.r2-new_bbox.r1)>4096||Math.abs(new_bbox.c2-new_bbox.c1)>4096;if(!(chart_space.bbox&&chart_space.bbox.seriesBBox&&b_equal_ws&&b_equal_bbox&&b_equal_vert)&&!bLimit){var catHeadersBBox,serHeadersBBox;if(chart_space.bbox&&b_equal_bbox&&b_equal_ws&& !b_equal_vert){if(chart_space.bbox.catBBox)serHeadersBBox={r1:chart_space.bbox.catBBox.r1,r2:chart_space.bbox.catBBox.r2,c1:chart_space.bbox.catBBox.c1,c2:chart_space.bbox.catBBox.c2};if(chart_space.bbox.serBBox)catHeadersBBox={r1:chart_space.bbox.serBBox.r1,r2:chart_space.bbox.serBBox.r2,c1:chart_space.bbox.serBBox.c1,c2:chart_space.bbox.serBBox.c2}}var chartSeries=AscFormat.getChartSeries(ws_view.model,chartSettings,catHeadersBBox,serHeadersBBox);b_clear_formatting=true;chart_space.rebuildSeriesFromAsc(chartSeries); if(chart_space.pivotSource)chart_space.setPivotSource(null)}}}}var title_show_settings=chartSettings.getTitle();if(title_show_settings===c_oAscChartTitleShowSettings.none){if(chart.title)chart.setTitle(null)}else if(title_show_settings===c_oAscChartTitleShowSettings.noOverlay||title_show_settings===c_oAscChartTitleShowSettings.overlay){if(!chart.title)chart.setTitle(new AscFormat.CTitle);if(chart.title.overlay!==(title_show_settings===c_oAscChartTitleShowSettings.overlay))chart.title.setOverlay(title_show_settings=== c_oAscChartTitleShowSettings.overlay)}var legend_pos_settings=chartSettings.getLegendPos();if(legend_pos_settings!==null)if(legend_pos_settings===c_oAscChartLegendShowSettings.none){if(chart.legend)chart.setLegend(null)}else{if(!chart.legend)chart.setLegend(new AscFormat.CLegend);if(chart.legend.legendPos!==legend_pos_settings&&legend_pos_settings!==c_oAscChartLegendShowSettings.layout)chart.legend.setLegendPos(legend_pos_settings);var b_overlay=c_oAscChartLegendShowSettings.leftOverlay===legend_pos_settings|| legend_pos_settings===c_oAscChartLegendShowSettings.rightOverlay;if(chart.legend.overlay!==b_overlay)chart.legend.setOverlay(b_overlay)}var chart_type=plot_area.charts[0];plot_area.removeCharts(1,plot_area.charts.length-1);var i;var need_groupping,need_num_fmt,need_bar_dir;var val_axis,new_chart_type,object_type,axis_obj;var axis_by_types;var val_ax,cat_ax;object_type=chart_type.getObjectType();var sDefaultValAxFormatCode=null;if(chart_type&&chart_type.series[0]){var aPoints=AscFormat.getPtsFromSeries(chart_type.series[0]); if(aPoints[0]&&typeof aPoints[0].formatCode==="string"&&aPoints[0].formatCode.length>0)sDefaultValAxFormatCode=aPoints[0].formatCode}need_num_fmt=sDefaultValAxFormatCode;var checkSwapAxis=function(plotArea,chartType,newChartType){if(chartType.getAxisByTypes){var axis_by_types=chartType.getAxisByTypes(),cat_ax,val_ax;if(axis_by_types.catAx.length>0&&axis_by_types.valAx.length>0){cat_ax=axis_by_types.catAx[0];val_ax=axis_by_types.valAx[0]}}if(!val_ax||!cat_ax){var axis_obj=AscFormat.CreateDefaultAxises(need_num_fmt? need_num_fmt:"General");cat_ax=axis_obj.catAx;val_ax=axis_obj.valAx;if(oValAx&&oValAx instanceof AscFormat.CValAx){oValAx.createDuplicate(val_ax);val_ax.numFmt.setFormatCode(need_num_fmt)}if(oCatAx){if(oCatAx.majorGridlines)axis_obj.catAx.setMajorGridlines(oCatAx.majorGridlines.createDuplicate());axis_obj.catAx.setMajorTickMark(oCatAx.majorTickMark);if(oCatAx.minorGridlines)axis_obj.catAx.setMinorGridlines(oCatAx.minorGridlines.createDuplicate());axis_obj.catAx.setMinorTickMark(oCatAx.minorTickMark); if(oCatAx.spPr)axis_obj.catAx.setSpPr(oCatAx.spPr.createDuplicate());axis_obj.catAx.setTickLblPos(oCatAx.tickLblPos);if(oCatAx.title)axis_obj.catAx.setTitle(oCatAx.title.createDuplicate());if(oCatAx.txPr)axis_obj.catAx.setTxPr(oCatAx.txPr.createDuplicate())}}if(cat_ax&&val_ax){if(newChartType.getObjectType()===AscDFH.historyitem_type_BarChart&&newChartType.barDir===BAR_DIR_BAR){if(cat_ax.axPos!==AscFormat.AX_POS_L)cat_ax.setAxPos(AscFormat.AX_POS_L);if(val_ax.axPos!==AscFormat.AX_POS_B)val_ax.setAxPos(AscFormat.AX_POS_B)}else{if(cat_ax.axPos!== AscFormat.AX_POS_B)cat_ax.setAxPos(AscFormat.AX_POS_B);if(val_ax.axPos!==AscFormat.AX_POS_L)val_ax.setAxPos(AscFormat.AX_POS_L)}newChartType.addAxId(cat_ax);newChartType.addAxId(val_ax);plotArea.addAxis(cat_ax);plotArea.addAxis(val_ax)}};var replaceChart=function(plotArea,chartType,newChartType){plotArea.addChart(newChartType,0);plotArea.removeCharts(1,plotArea.charts.length-1);newChartType.setFromOtherChart(chartType);if(newChartType.getObjectType()!==AscDFH.historyitem_type_PieChart&&newChartType.getObjectType()!== AscDFH.historyitem_type_DoughnutChart)if(newChartType.setVaryColors&&newChartType.varyColors===true)newChartType.setVaryColors(false)};switch(type){case c_oAscChartTypeSettings.barNormal:case c_oAscChartTypeSettings.barStacked:case c_oAscChartTypeSettings.barStackedPer:case c_oAscChartTypeSettings.barNormal3d:case c_oAscChartTypeSettings.barStacked3d:case c_oAscChartTypeSettings.barStackedPer3d:case c_oAscChartTypeSettings.barNormal3dPerspective:case c_oAscChartTypeSettings.hBarNormal:case c_oAscChartTypeSettings.hBarStacked:case c_oAscChartTypeSettings.hBarStackedPer:case c_oAscChartTypeSettings.hBarNormal3d:case c_oAscChartTypeSettings.hBarStacked3d:case c_oAscChartTypeSettings.hBarStackedPer3d:{if(type=== c_oAscChartTypeSettings.barNormal||type===c_oAscChartTypeSettings.hBarNormal||type===c_oAscChartTypeSettings.barNormal3d||type===c_oAscChartTypeSettings.hBarNormal3d)need_groupping=BAR_GROUPING_CLUSTERED;else if(type===c_oAscChartTypeSettings.barStacked||type===c_oAscChartTypeSettings.hBarStacked||type===c_oAscChartTypeSettings.barStacked3d||type===c_oAscChartTypeSettings.hBarStacked3d)need_groupping=BAR_GROUPING_STACKED;else if(type===c_oAscChartTypeSettings.barNormal3dPerspective)need_groupping= BAR_GROUPING_STANDARD;else need_groupping=BAR_GROUPING_PERCENT_STACKED;var bNeed3D=type===c_oAscChartTypeSettings.barNormal3d||type===c_oAscChartTypeSettings.barStacked3d||type===c_oAscChartTypeSettings.barStackedPer3d||type===c_oAscChartTypeSettings.barNormal3dPerspective||type===c_oAscChartTypeSettings.hBarNormal3d||type===c_oAscChartTypeSettings.hBarStacked3d||type===c_oAscChartTypeSettings.hBarStackedPer3d;if(type===c_oAscChartTypeSettings.barNormal||type===c_oAscChartTypeSettings.barStacked|| type===c_oAscChartTypeSettings.barNormal3d||type===c_oAscChartTypeSettings.barStacked3d||type===c_oAscChartTypeSettings.hBarNormal||type===c_oAscChartTypeSettings.hBarStacked||type===c_oAscChartTypeSettings.hBarNormal3d||type===c_oAscChartTypeSettings.hBarStacked3d||type===c_oAscChartTypeSettings.barNormal3dPerspective)need_num_fmt=sDefaultValAxFormatCode;else need_num_fmt="0%";if(type===c_oAscChartTypeSettings.barNormal||type===c_oAscChartTypeSettings.barStacked||type===c_oAscChartTypeSettings.barStackedPer|| type===c_oAscChartTypeSettings.barNormal3d||type===c_oAscChartTypeSettings.barStacked3d||type===c_oAscChartTypeSettings.barStackedPer3d||type===c_oAscChartTypeSettings.barNormal3dPerspective)need_bar_dir=BAR_DIR_COL;else need_bar_dir=BAR_DIR_BAR;if(chart_type.getObjectType()===AscDFH.historyitem_type_BarChart){var bChangedGrouping=false;var nOldGrouping=chart_type.grouping;if(chart_type.grouping!==need_groupping){chart_type.setGrouping(need_groupping);bChangedGrouping=true}if(!AscFormat.isRealNumber(chart_type.gapWidth))chart_type.setGapWidth(150); if(BAR_GROUPING_PERCENT_STACKED===need_groupping||BAR_GROUPING_STACKED===need_groupping){if(!AscFormat.isRealNumber(chart_type.overlap)||nOldGrouping!==BAR_GROUPING_PERCENT_STACKED||nOldGrouping!==BAR_GROUPING_STACKED)chart_type.setOverlap(100)}else if(bChangedGrouping&&chart_type.overlap!==null)chart_type.setOverlap(null);axis_by_types=chart_type.getAxisByTypes();if(chart_type.barDir!==need_bar_dir){val_axis=axis_by_types.valAx;if(need_bar_dir===BAR_DIR_BAR){for(i=0;i<val_axis.length;++i)val_axis[i].setAxPos(AscFormat.AX_POS_B); for(i=0;i<axis_by_types.catAx.length;++i)axis_by_types.catAx[i].setAxPos(AscFormat.AX_POS_L)}else{for(i=0;i<val_axis.length;++i)val_axis[i].setAxPos(AscFormat.AX_POS_L);for(i=0;i<axis_by_types.catAx.length;++i)axis_by_types.catAx[i].setAxPos(AscFormat.AX_POS_B)}chart_type.setBarDir(need_bar_dir)}if(bNeed3D){if(!chart_type.b3D)chart_type.set3D(true);if(!chart.view3D)chart.setView3D(new AscFormat.CView3d);var oView3d=chart.view3D;if(!AscFormat.isRealNumber(oView3d.rotX))oView3d.setRotX(15);if(!AscFormat.isRealNumber(oView3d.rotY))oView3d.setRotY(20); if(!AscFormat.isRealBool(oView3d.rAngAx))oView3d.setRAngAx(true);if(c_oAscChartTypeSettings.barNormal3dPerspective===type){if(!AscFormat.isRealNumber(oView3d.depthPercent))oView3d.setDepthPercent(100)}else if(null!==oView3d.depthPercent)oView3d.setDepthPercent(null);chart.setDefaultWalls()}else{if(chart_type.b3D)chart_type.set3D(false);if(chart.view3D)chart.setView3D(null);if(chart.floor)chart.setFloor(null);if(chart.sideWall)chart.setSideWall(null);if(chart.backWall)chart.setBackWall(null)}val_axis= axis_by_types.valAx;for(i=0;i<val_axis.length;++i){if(!val_axis[i].numFmt){val_axis[i].setNumFmt(new AscFormat.CNumFmt);val_axis[i].numFmt.setFormatCode(sDefaultValAxFormatCode?sDefaultValAxFormatCode:"General");val_axis[i].numFmt.setSourceLinked(true)}if(need_num_fmt&&val_axis[i].numFmt.formatCode!==need_num_fmt)val_axis[i].numFmt.setFormatCode(need_num_fmt)}}else{new_chart_type=new AscFormat.CBarChart;replaceChart(plot_area,chart_type,new_chart_type);new_chart_type.setBarDir(need_bar_dir);checkSwapAxis(plot_area, chart_type,new_chart_type);new_chart_type.setGrouping(need_groupping);new_chart_type.setGapWidth(150);if(BAR_GROUPING_PERCENT_STACKED===need_groupping||BAR_GROUPING_STACKED===need_groupping)new_chart_type.setOverlap(100);if(bNeed3D){if(!chart.view3D){chart.setView3D(AscFormat.CreateView3d(15,20,true,c_oAscChartTypeSettings.barNormal3dPerspective===type?100:undefined));chart.setDefaultWalls()}if(!new_chart_type.b3D)new_chart_type.set3D(true)}else{if(chart.view3D)chart.setView3D(null);if(chart.floor)chart.setFloor(null); if(chart.sideWall)chart.setSideWall(null);if(chart.backWall)chart.setBackWall(null)}axis_by_types=new_chart_type.getAxisByTypes();val_axis=axis_by_types.valAx;for(i=0;i<val_axis.length;++i){if(!val_axis[i].numFmt){val_axis[i].setNumFmt(new AscFormat.CNumFmt);val_axis[i].numFmt.setFormatCode(sDefaultValAxFormatCode?sDefaultValAxFormatCode:"General");val_axis[i].numFmt.setSourceLinked(true)}if(need_num_fmt&&val_axis[i].numFmt.formatCode!==need_num_fmt)val_axis[i].numFmt.setFormatCode(need_num_fmt); if(need_bar_dir=BAR_DIR_BAR)val_axis[i].setAxPos(AscFormat.AX_POS_B)}if(need_bar_dir=BAR_DIR_BAR)for(i=0;i<axis_by_types.catAx.length;++i)axis_by_types.catAx[i].setAxPos(AscFormat.AX_POS_L)}break}case c_oAscChartTypeSettings.lineNormal:case c_oAscChartTypeSettings.lineStacked:case c_oAscChartTypeSettings.lineStackedPer:case c_oAscChartTypeSettings.lineNormalMarker:case c_oAscChartTypeSettings.lineStackedMarker:case c_oAscChartTypeSettings.lineStackedPerMarker:case c_oAscChartTypeSettings.line3d:{if(type=== c_oAscChartTypeSettings.lineNormal||type===c_oAscChartTypeSettings.lineNormalMarker||type===c_oAscChartTypeSettings.line3d)need_groupping=GROUPING_STANDARD;else if(type===c_oAscChartTypeSettings.lineStacked||type===c_oAscChartTypeSettings.lineStackedMarker)need_groupping=GROUPING_STACKED;else need_groupping=GROUPING_PERCENT_STACKED;if(type===c_oAscChartTypeSettings.lineNormal||type===c_oAscChartTypeSettings.lineStacked||type===c_oAscChartTypeSettings.line3d||type===c_oAscChartTypeSettings.lineNormalMarker|| type===c_oAscChartTypeSettings.lineStackedMarker)need_num_fmt=sDefaultValAxFormatCode;else need_num_fmt="0%";var b_marker=chartSettings.getShowMarker();if(chart_type.getObjectType()===AscDFH.historyitem_type_LineChart){if(chart_type.grouping!==need_groupping)chart_type.setGrouping(need_groupping);val_axis=chart_type.getAxisByTypes().valAx;for(i=0;i<val_axis.length;++i){if(!val_axis[i].numFmt){val_axis[i].setNumFmt(new AscFormat.CNumFmt);val_axis[i].numFmt.setFormatCode(sDefaultValAxFormatCode?sDefaultValAxFormatCode: "General");val_axis[i].numFmt.setSourceLinked(true)}if(need_num_fmt&&val_axis[i].numFmt.formatCode!==need_num_fmt)val_axis[i].numFmt.setFormatCode(need_num_fmt)}if(type===c_oAscChartTypeSettings.line3d){if(!chart.view3D)chart.setView3D(new AscFormat.CView3d);var oView3d=chart.view3D;if(!AscFormat.isRealNumber(oView3d.rotX))oView3d.setRotX(15);if(!AscFormat.isRealNumber(oView3d.rotY))oView3d.setRotY(20);if(!AscFormat.isRealBool(oView3d.rAngAx))oView3d.setRAngAx(true);if(!AscFormat.isRealNumber(oView3d.depthPercent))oView3d.setDepthPercent(100); chart.setDefaultWalls()}else{if(chart.view3D){chart.setView3D(null);chartSettings.bLine=true;new_chart_type=new AscFormat.CLineChart;replaceChart(plot_area,chart_type,new_chart_type);checkSwapAxis(plot_area,chart_type,new_chart_type)}if(chart.floor)chart.setFloor(null);if(chart.sideWall)chart.setSideWall(null);if(chart.backWall)chart.setBackWall(null)}}else{new_chart_type=new AscFormat.CLineChart;replaceChart(plot_area,chart_type,new_chart_type);checkSwapAxis(plot_area,chart_type,new_chart_type); val_axis=new_chart_type.getAxisByTypes().valAx;for(i=0;i<val_axis.length;++i){if(!val_axis[i].numFmt){val_axis[i].setNumFmt(new AscFormat.CNumFmt);val_axis[i].numFmt.setFormatCode(sDefaultValAxFormatCode?sDefaultValAxFormatCode:"General");val_axis[i].numFmt.setSourceLinked(true)}if(need_num_fmt&&val_axis[i].numFmt.formatCode!==need_num_fmt)val_axis[i].numFmt.setFormatCode(need_num_fmt)}if(type===c_oAscChartTypeSettings.line3d){if(!chart.view3D){chart.setView3D(AscFormat.CreateView3d(15,20,true,100)); chart.setDefaultWalls()}}else{if(chart.view3D)chart.setView3D(null);if(chart.floor)chart.setFloor(null);if(chart.sideWall)chart.setSideWall(null);if(chart.backWall)chart.setBackWall(null)}new_chart_type.setGrouping(need_groupping)}break}case c_oAscChartTypeSettings.pie:case c_oAscChartTypeSettings.pie3d:{if(chart_type.getObjectType()!==AscDFH.historyitem_type_PieChart){new_chart_type=new AscFormat.CPieChart;replaceChart(plot_area,chart_type,new_chart_type);new_chart_type.setVaryColors(true);if(type=== c_oAscChartTypeSettings.pie3d){if(!chart.view3D){chart.setView3D(AscFormat.CreateView3d(30,0,true,100));chart.setDefaultWalls()}if(!chart.view3D.rAngAx)chart.view3D.setRAngAx(true);if(chart.view3D.rotX<0)chart.view3D.rotX=30}else{if(chart.view3D)chart.setView3D(null);if(chart.floor)chart.setFloor(null);if(chart.sideWall)chart.setSideWall(null);if(chart.backWall)chart.setBackWall(null)}}else if(type===c_oAscChartTypeSettings.pie3d){if(!chart.view3D)chart.setView3D(new AscFormat.CView3d);var oView3d= chart.view3D;if(!AscFormat.isRealNumber(oView3d.rotX))oView3d.setRotX(30);if(!AscFormat.isRealNumber(oView3d.rotY))oView3d.setRotY(0);if(!AscFormat.isRealBool(oView3d.rAngAx))oView3d.setRAngAx(true);if(!AscFormat.isRealNumber(oView3d.depthPercent))oView3d.setDepthPercent(100);chart.setDefaultWalls()}else{if(chart.view3D)chart.setView3D(null);if(chart.floor)chart.setFloor(null);if(chart.sideWall)chart.setSideWall(null);if(chart.backWall)chart.setBackWall(null)}break}case c_oAscChartTypeSettings.doughnut:{if(chart_type.getObjectType()!== AscDFH.historyitem_type_DoughnutChart){new_chart_type=new AscFormat.CDoughnutChart;replaceChart(plot_area,chart_type,new_chart_type);new_chart_type.setVaryColors(true);new_chart_type.setHoleSize(50)}break}case c_oAscChartTypeSettings.areaNormal:case c_oAscChartTypeSettings.areaStacked:case c_oAscChartTypeSettings.areaStackedPer:{if(type===c_oAscChartTypeSettings.areaNormal)need_groupping=GROUPING_STANDARD;else if(type===c_oAscChartTypeSettings.areaStacked)need_groupping=GROUPING_STACKED;else need_groupping= GROUPING_PERCENT_STACKED;if(type===c_oAscChartTypeSettings.areaNormal||type===c_oAscChartTypeSettings.areaStacked)need_num_fmt=sDefaultValAxFormatCode;else need_num_fmt="0%";if(chart_type.getObjectType()===AscDFH.historyitem_type_AreaChart){if(chart_type.grouping!==need_groupping)chart_type.setGrouping(need_groupping);val_axis=chart_type.getAxisByTypes().valAx;for(i=0;i<val_axis.length;++i){if(!val_axis[i].numFmt){val_axis[i].setNumFmt(new AscFormat.CNumFmt);val_axis[i].numFmt.setFormatCode(sDefaultValAxFormatCode? sDefaultValAxFormatCode:"General");val_axis[i].numFmt.setSourceLinked(true)}if(need_num_fmt&&val_axis[i].numFmt.formatCode!==need_num_fmt)val_axis[i].numFmt.setFormatCode(need_num_fmt)}}else{new_chart_type=new AscFormat.CAreaChart;replaceChart(plot_area,chart_type,new_chart_type);checkSwapAxis(plot_area,chart_type,new_chart_type);val_axis=new_chart_type.getAxisByTypes().valAx;for(i=0;i<val_axis.length;++i){if(!val_axis[i].numFmt){val_axis[i].setNumFmt(new AscFormat.CNumFmt);val_axis[i].numFmt.setFormatCode(sDefaultValAxFormatCode? sDefaultValAxFormatCode:"General");val_axis[i].numFmt.setSourceLinked(true)}if(need_num_fmt&&val_axis[i].numFmt.formatCode!==need_num_fmt)val_axis[i].numFmt.setFormatCode(need_num_fmt)}new_chart_type.setGrouping(need_groupping)}chart_space.chart.setView3D(null);break}case c_oAscChartTypeSettings.scatter:case c_oAscChartTypeSettings.scatterLine:case c_oAscChartTypeSettings.scatterSmooth:{if(chart_type.getObjectType()!==AscDFH.historyitem_type_ScatterChart){new_chart_type=new AscFormat.CScatterChart; replaceChart(plot_area,chart_type,new_chart_type);for(var j=0;j<new_chart_type.series.length;++j)new_chart_type.series[j].setMarker(null);new_chart_type.setScatterStyle(SCATTER_STYLE_MARKER);axis_obj=AscFormat.CreateScatterAxis();if(oValAx&&oValAx instanceof AscFormat.CValAx){oValAx.createDuplicate(axis_obj.valAx);axis_obj.valAx.setAxPos(AscFormat.AX_POS_L)}if(oCatAx){if(oCatAx.majorGridlines)axis_obj.catAx.setMajorGridlines(oCatAx.majorGridlines.createDuplicate());axis_obj.catAx.setMajorTickMark(oCatAx.majorTickMark); if(oCatAx.minorGridlines)axis_obj.catAx.setMinorGridlines(oCatAx.minorGridlines.createDuplicate());axis_obj.catAx.setMinorTickMark(oCatAx.minorTickMark);if(oCatAx.spPr)axis_obj.catAx.setSpPr(oCatAx.spPr.createDuplicate());axis_obj.catAx.setTickLblPos(oCatAx.tickLblPos);if(oCatAx.title)axis_obj.catAx.setTitle(oCatAx.title.createDuplicate());if(oCatAx.txPr)axis_obj.catAx.setTxPr(oCatAx.txPr.createDuplicate())}new_chart_type.addAxId(axis_obj.catAx);new_chart_type.addAxId(axis_obj.valAx);plot_area.addAxis(axis_obj.catAx); plot_area.addAxis(axis_obj.valAx)}break}case c_oAscChartTypeSettings.stock:{if(chart_type.getObjectType()!==AscDFH.historyitem_type_StockChart){new_chart_type=new AscFormat.CStockChart;replaceChart(plot_area,chart_type,new_chart_type);checkSwapAxis(plot_area,chart_type,new_chart_type);new_chart_type.setHiLowLines(new AscFormat.CSpPr);new_chart_type.setUpDownBars(new AscFormat.CUpDownBars);new_chart_type.upDownBars.setGapWidth(150);new_chart_type.upDownBars.setUpBars(new AscFormat.CSpPr);new_chart_type.upDownBars.setDownBars(new AscFormat.CSpPr); val_axis=new_chart_type.getAxisByTypes().valAx;for(i=0;i<val_axis.length;++i){if(!val_axis[i].numFmt){val_axis[i].setNumFmt(new AscFormat.CNumFmt);val_axis[i].numFmt.setSourceLinked(true)}if(val_axis[i].numFmt.formatCode!=="General")val_axis[i].numFmt.setFormatCode("General")}}break}}var hor_axis=plot_area.getHorizontalAxis();var hor_axis_label_setting=chartSettings.getHorAxisLabel();if(hor_axis){if(hor_axis_label_setting!==null)switch(hor_axis_label_setting){case c_oAscChartHorAxisLabelShowSettings.none:{if(hor_axis.title)hor_axis.setTitle(null); break}case c_oAscChartHorAxisLabelShowSettings.noOverlay:{var _text_body;if(hor_axis.title&&hor_axis.title.tx&&hor_axis.title.tx.rich)_text_body=hor_axis.title.tx.rich;else{if(!hor_axis.title)hor_axis.setTitle(new AscFormat.CTitle);if(!hor_axis.title.txPr)hor_axis.title.setTxPr(new AscFormat.CTextBody);if(!hor_axis.title.txPr.bodyPr)hor_axis.title.txPr.setBodyPr(new AscFormat.CBodyPr);if(!hor_axis.title.txPr.content)hor_axis.title.txPr.setContent(new AscFormat.CDrawingDocContent(hor_axis.title.txPr, chart_space.getDrawingDocument(),0,0,100,500,false,false,true));_text_body=hor_axis.title.txPr}if(hor_axis.title.overlay!==false)hor_axis.title.setOverlay(false);if(!_text_body.bodyPr||_text_body.bodyPr.isNotNull())_text_body.setBodyPr(new AscFormat.CBodyPr);break}}hor_axis.setMenuProps(chartSettings.getHorAxisProps());if(AscFormat.isRealBool(chartSettings.getShowHorAxis()))hor_axis.setDelete(!chartSettings.getShowHorAxis())}var vert_axis=plot_area.getVerticalAxis();var vert_axis_labels_settings= chartSettings.getVertAxisLabel();if(vert_axis){if(vert_axis_labels_settings!==null)switch(vert_axis_labels_settings){case c_oAscChartVertAxisLabelShowSettings.none:{if(vert_axis.title)vert_axis.setTitle(null);break}case c_oAscChartVertAxisLabelShowSettings.vertical:{break}default:{if(vert_axis_labels_settings===c_oAscChartVertAxisLabelShowSettings.rotated||vert_axis_labels_settings===c_oAscChartVertAxisLabelShowSettings.horizontal){var _text_body;if(vert_axis.title&&vert_axis.title.tx&&vert_axis.title.tx.rich)_text_body= vert_axis.title.tx.rich;else{if(!vert_axis.title)vert_axis.setTitle(new AscFormat.CTitle);if(!vert_axis.title.txPr)vert_axis.title.setTxPr(new AscFormat.CTextBody);_text_body=vert_axis.title.txPr}if(!_text_body.bodyPr)_text_body.setBodyPr(new AscFormat.CBodyPr);var _body_pr=_text_body.bodyPr.createDuplicate();if(!_text_body.content)_text_body.setContent(new AscFormat.CDrawingDocContent(_text_body,chart_space.getDrawingDocument(),0,0,100,500,false,false,true));if(vert_axis_labels_settings===c_oAscChartVertAxisLabelShowSettings.rotated)_body_pr.reset(); else{_body_pr.setVert(AscFormat.nVertTThorz);_body_pr.setRot(0)}_text_body.setBodyPr(_body_pr);if(vert_axis.title.overlay!==false)vert_axis.title.setOverlay(false)}}}vert_axis.setMenuProps(chartSettings.getVertAxisProps());if(AscFormat.isRealBool(chartSettings.getShowVerAxis()))vert_axis.setDelete(!chartSettings.getShowVerAxis())}var setAxisGridLines=function(axis,gridLinesSettings){if(axis)switch(gridLinesSettings){case c_oAscGridLinesSettings.none:{if(axis.majorGridlines)axis.setMajorGridlines(null); if(axis.minorGridlines)axis.setMinorGridlines(null);break}case c_oAscGridLinesSettings.major:{if(!axis.majorGridlines)axis.setMajorGridlines(new AscFormat.CSpPr);if(axis.minorGridlines)axis.setMinorGridlines(null);break}case c_oAscGridLinesSettings.minor:{if(!axis.minorGridlines)axis.setMinorGridlines(new AscFormat.CSpPr);if(axis.majorGridlines)axis.setMajorGridlines(null);break}case c_oAscGridLinesSettings.majorMinor:{if(!axis.minorGridlines)axis.setMinorGridlines(new AscFormat.CSpPr);if(!axis.majorGridlines)axis.setMajorGridlines(new AscFormat.CSpPr); break}}};setAxisGridLines(plot_area.getVerticalAxis(),chartSettings.getHorGridLines());setAxisGridLines(plot_area.getHorizontalAxis(),chartSettings.getVertGridLines());for(var i=0;i<plot_area.charts.length;++i){chart_type=plot_area.charts[i];var data_labels_pos_setting=chartSettings.getDataLabelsPos();if(AscFormat.isRealNumber(data_labels_pos_setting))if(data_labels_pos_setting===c_oAscChartDataLabelsPos.none){if(chart_type.dLbls)chart_type.setDLbls(null);chart_type.removeDataLabels()}else{var finish_dlbl_pos= data_labels_pos_setting;finish_dlbl_pos=this.checkDlblsPosition(chart,chart_type,finish_dlbl_pos);if(chart_type.dLbls&&chart_type.dLbls.dLblPos!==finish_dlbl_pos)chart_type.dLbls.setDLblPos(finish_dlbl_pos);for(var i=0;i<chart_type.series.length;++i)if(chart_type.series[i].setDLbls){if(!chart_type.series[i].dLbls){var d_lbls=new AscFormat.CDLbls;d_lbls.setShowVal(true);chart_type.series[i].setDLbls(d_lbls);chart_type.series[i].dLbls.setParent(chart_type)}if(chart_type.series[i].dLbls.dLblPos!==finish_dlbl_pos)chart_type.series[i].dLbls.setDLblPos(finish_dlbl_pos); for(var j=0;j<chart_type.series[i].dLbls.dLbl.length;++j)if(chart_type.series[i].dLbls.dLbl[j].dLblPos!==finish_dlbl_pos)chart_type.series[i].dLbls.dLbl[j].setDLblPos(finish_dlbl_pos)}}else{if(chart_type.dLbls&&AscFormat.isRealNumber(chart_type.dLbls.dLblPos))chart_type.dLbls.setDLblPos(this.checkDlblsPosition(chart,chart_type,chart_type.dLbls.dLblPos));for(var i=0;i<chart_type.series.length;++i)if(chart_type.series[i].dLbls){if(AscFormat.isRealNumber(chart_type.series[i].dLbls.dLblPos))chart_type.series[i].dLbls.setDLblPos(this.checkDlblsPosition(chart, chart_type,chart_type.series[i].dLbls.dLblPos));for(var j=0;j<chart_type.series[i].dLbls.dLbl.length;++j)if(AscFormat.isRealNumber(chart_type.series[i].dLbls.dLbl[j].dLblPos))chart_type.series[i].dLbls.dLbl[j].setDLblPos(this.checkDlblsPosition(chart,chart_type,chart_type.series[i].dLbls.dLbl[j].dLblPos))}}if(typeof chart_type.setDLbls==="function"&&AscFormat.isRealNumber(chartSettings.getDataLabelsPos())&&chartSettings.getDataLabelsPos()!==c_oAscChartDataLabelsPos.none)if(AscFormat.isRealBool(chartSettings.showCatName)|| AscFormat.isRealBool(chartSettings.showSerName)||AscFormat.isRealBool(chartSettings.showVal)){var fCheckLbls=function(oLbl){if(oLbl.setDelete&&oLbl.bDelete)oLbl.setDelete(false);if(AscFormat.isRealBool(chartSettings.showCatName))oLbl.setShowCatName(chartSettings.showCatName);if(AscFormat.isRealBool(chartSettings.showSerName))oLbl.setShowSerName(chartSettings.showSerName);if(AscFormat.isRealBool(chartSettings.showVal))oLbl.setShowVal(chartSettings.showVal);if(!AscFormat.isRealBool(oLbl.showLegendKey)|| oLbl.showLegendKey===true)oLbl.setShowLegendKey(false);if(!AscFormat.isRealBool(oLbl.showPercent)||oLbl.showPercent===true)oLbl.setShowPercent(false);if(!AscFormat.isRealBool(oLbl.showBubbleSize)||oLbl.showBubbleSize===true)oLbl.setShowBubbleSize(false);if(typeof chartSettings.separator==="string"&&chartSettings.separator.length>0)oLbl.setSeparator(chartSettings.separator)};for(var i=0;i<chart_type.series.length;++i){var oSeries=chart_type.series[i];if(oSeries.setDLbls)if(!oSeries.dLbls){oSeries.setDLbls(new AscFormat.CDLbls); oSeries.dLbls.setParent(oSeries)}fCheckLbls(oSeries.dLbls);for(var j=0;j<oSeries.dLbls.dLbl.length;++j)fCheckLbls(oSeries.dLbls.dLbl[j])}}if(chart_type.getObjectType()===AscDFH.historyitem_type_LineChart){if(!AscFormat.isRealBool(chartSettings.showMarker)||AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(chartSpace))chartSettings.showMarker=false;if(!AscFormat.isRealBool(chartSettings.bLine)||AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(chartSpace))chartSettings.bLine=true;if(chartSettings.showMarker){if(!chart_type.marker)chart_type.setMarker(true); for(var j=0;j<chart_type.series.length;++j)if(chart_type.series[j].marker&&chart_type.series[j].marker.symbol===AscFormat.SYMBOL_NONE)chart_type.series[j].setMarker(null)}else for(var j=0;j<chart_type.series.length;++j){if(!chart_type.series[j].marker)chart_type.series[j].setMarker(new AscFormat.CMarker);if(chart_type.series[j].marker.symbol!==AscFormat.SYMBOL_NONE)chart_type.series[j].marker.setSymbol(AscFormat.SYMBOL_NONE)}if(!chartSettings.bLine)for(var j=0;j<chart_type.series.length;++j){removeDPtsFromSeries(chart_type.series[j]); if(!chart_type.series[j].spPr)chart_type.series[j].setSpPr(new AscFormat.CSpPr);if(AscFormat.isRealBool(chart_type.series[j].smooth))chart_type.series[j].setSmooth(null);chart_type.series[j].spPr.setLn(AscFormat.CreateNoFillLine())}else for(var j=0;j<chart_type.series.length;++j){removeDPtsFromSeries(chart_type.series[j]);if(chart_type.series[j].smooth!==(chartSettings.smooth===true))chart_type.series[j].setSmooth(chartSettings.smooth===true);if(chart_type.series[j].spPr&&chart_type.series[j].spPr.ln)chart_type.series[j].spPr.setLn(null)}if(chart_type.smooth!== (chartSettings.smooth===true))chart_type.setSmooth(chartSettings.smooth===true);for(var j=0;j<chart_type.series.length;++j)if(chart_type.series[j].smooth!==(chartSettings.smooth===true))chart_type.series[j].setSmooth(chartSettings.smooth===true)}if(chart_type.getObjectType()===AscDFH.historyitem_type_ScatterChart){if(!AscFormat.isRealBool(chartSettings.showMarker))chartSettings.showMarker=true;if(!AscFormat.isRealBool(chartSettings.bLine))chartSettings.bLine=false;for(var i=0;i<chart_type.series.length;++i){if(chart_type.series[i].marker)chart_type.series[i].setMarker(null); if(AscFormat.isRealBool(chart_type.series[i].smooth))chart_type.series[i].setSmooth(null)}var new_scatter_style;if(chartSettings.bLine){for(var j=0;j<chart_type.series.length;++j){removeDPtsFromSeries(chart_type.series[j]);if(chart_type.series[j].spPr&&chart_type.series[j].spPr.ln)chart_type.series[j].spPr.setLn(null)}if(chartSettings.smooth)if(chartSettings.showMarker){new_scatter_style=SCATTER_STYLE_SMOOTH_MARKER;for(var j=0;j<chart_type.series.length;++j){if(chart_type.series[j].marker)chart_type.series[j].setMarker(null); chart_type.series[j].setSmooth(true)}}else{new_scatter_style=SCATTER_STYLE_SMOOTH;for(var j=0;j<chart_type.series.length;++j){if(!chart_type.series[j].marker)chart_type.series[j].setMarker(new AscFormat.CMarker);chart_type.series[j].marker.setSymbol(AscFormat.SYMBOL_NONE);chart_type.series[j].setSmooth(true)}}else if(chartSettings.showMarker){new_scatter_style=SCATTER_STYLE_LINE_MARKER;for(var j=0;j<chart_type.series.length;++j){if(chart_type.series[j].marker)chart_type.series[j].setMarker(null); chart_type.series[j].setSmooth(false)}}else{new_scatter_style=SCATTER_STYLE_LINE;for(var j=0;j<chart_type.series.length;++j){if(!chart_type.series[j].marker)chart_type.series[j].setMarker(new AscFormat.CMarker);chart_type.series[j].marker.setSymbol(AscFormat.SYMBOL_NONE);chart_type.series[j].setSmooth(false)}}}else{for(var j=0;j<chart_type.series.length;++j){removeDPtsFromSeries(chart_type.series[j]);if(!chart_type.series[j].spPr)chart_type.series[j].setSpPr(new AscFormat.CSpPr);chart_type.series[j].spPr.setLn(AscFormat.CreateNoFillLine())}if(chartSettings.showMarker){new_scatter_style= SCATTER_STYLE_MARKER;for(var j=0;j<chart_type.series.length;++j){if(chart_type.series[j].marker)chart_type.series[j].setMarker(null);chart_type.series[j].setSmooth(false)}}else{new_scatter_style=SCATTER_STYLE_MARKER;for(var j=0;j<chart_type.series.length;++j){if(!chart_type.series[j].marker)chart_type.series[j].setMarker(new AscFormat.CMarker);chart_type.series[j].marker.setSymbol(AscFormat.SYMBOL_NONE)}}}chart_type.setScatterStyle(new_scatter_style)}}},checkDlblsPosition:function(chart,chart_type, position){var finish_dlbl_pos=position;switch(chart_type.getObjectType()){case AscDFH.historyitem_type_BarChart:{if(BAR_GROUPING_CLUSTERED===chart_type.grouping){if(!(finish_dlbl_pos===c_oAscChartDataLabelsPos.ctr||finish_dlbl_pos===c_oAscChartDataLabelsPos.inEnd||finish_dlbl_pos===c_oAscChartDataLabelsPos.inBase||finish_dlbl_pos===c_oAscChartDataLabelsPos.outEnd))finish_dlbl_pos=c_oAscChartDataLabelsPos.ctr}else if(!(finish_dlbl_pos===c_oAscChartDataLabelsPos.ctr||finish_dlbl_pos===c_oAscChartDataLabelsPos.inEnd|| finish_dlbl_pos===c_oAscChartDataLabelsPos.inBase))finish_dlbl_pos=c_oAscChartDataLabelsPos.ctr;if(chart.view3D)finish_dlbl_pos=null;break}case AscDFH.historyitem_type_LineChart:case AscDFH.historyitem_type_ScatterChart:{if(!(finish_dlbl_pos===c_oAscChartDataLabelsPos.ctr||finish_dlbl_pos===c_oAscChartDataLabelsPos.l||finish_dlbl_pos===c_oAscChartDataLabelsPos.t||finish_dlbl_pos===c_oAscChartDataLabelsPos.r||finish_dlbl_pos===c_oAscChartDataLabelsPos.b))finish_dlbl_pos=c_oAscChartDataLabelsPos.ctr; if(chart.view3D)finish_dlbl_pos=null;break}case AscDFH.historyitem_type_PieChart:{if(!(finish_dlbl_pos===c_oAscChartDataLabelsPos.ctr||finish_dlbl_pos===c_oAscChartDataLabelsPos.inEnd||finish_dlbl_pos===c_oAscChartDataLabelsPos.outEnd||finish_dlbl_pos===c_oAscChartDataLabelsPos.bestFit))finish_dlbl_pos=c_oAscChartDataLabelsPos.ctr;break}case AscDFH.historyitem_type_AreaChart:case AscDFH.historyitem_type_DoughnutChart:case AscDFH.historyitem_type_StockChart:{finish_dlbl_pos=null;break}}return finish_dlbl_pos}, getChartProps:function(){var objects_by_types=this.getSelectedObjectsByTypes();var ret=null;if(objects_by_types.charts.length===1)ret=this.getPropsFromChart(objects_by_types.charts[0]);return ret},getPropsFromChart:function(chart_space){var chart=chart_space.chart,plot_area=chart_space.chart.plotArea;var ret=new Asc.asc_ChartSettings;ret.chartSpace=chart_space;var range_obj=chart_space.getRangeObjectStr();if(range_obj)if(typeof range_obj.range==="string"&&range_obj.range.length>0){ret.putRange(range_obj.range); ret.putInColumns(!range_obj.bVert)}ret.putTitle(isRealObject(chart.title)?chart.title.overlay?c_oAscChartTitleShowSettings.overlay:c_oAscChartTitleShowSettings.noOverlay:c_oAscChartTitleShowSettings.none);var hor_axis=plot_area.getHorizontalAxis();var vert_axis=plot_area.getVerticalAxis();var calc_grid_lines=function(axis){if(!axis||!axis.majorGridlines&&!axis.minorGridlines)return c_oAscGridLinesSettings.none;if(axis.majorGridlines&&!axis.minorGridlines)return c_oAscGridLinesSettings.major;if(axis.minorGridlines&& !axis.majorGridlines)return c_oAscGridLinesSettings.minor;return c_oAscGridLinesSettings.majorMinor};var chart_type=plot_area.charts[0];var chart_type_object_type=chart_type.getObjectType();if(hor_axis){ret.putShowHorAxis(!hor_axis.bDelete);ret.putHorAxisProps(hor_axis.getMenuProps())}else if(vert_axis)if(vert_axis.getObjectType()===AscDFH.historyitem_type_ValAx){ret.putShowHorAxis(false);var _cat_ax_pr=new AscCommon.asc_CatAxisSettings;_cat_ax_pr.setDefault();ret.putHorAxisProps(_cat_ax_pr)}else{ret.putShowHorAxis(false); var _val_ax_pr=new AscCommon.asc_ValAxisSettings;_val_ax_pr.setDefault();ret.putHorAxisProps(_val_ax_pr)}ret.putHorGridLines(calc_grid_lines(vert_axis));if(vert_axis){ret.putShowVerAxis(!vert_axis.bDelete);ret.putVertAxisProps(vert_axis.getMenuProps());if(chart_type.getObjectType()===AscDFH.historyitem_type_AreaChart&&!AscFormat.isRealNumber(vert_axis.crossBetween))if(ret.horAxisProps)ret.horAxisProps.putLabelsPosition(Asc.c_oAscLabelsPosition.byDivisions)}ret.putVertGridLines(calc_grid_lines(hor_axis)); ret.putHorAxisLabel(hor_axis&&hor_axis.title?c_oAscChartHorAxisLabelShowSettings.noOverlay:c_oAscChartTitleShowSettings.none);var _label;if(vert_axis&&vert_axis.title){var tx_body;if(vert_axis.title.tx&&vert_axis.title.tx.rich)tx_body=vert_axis.title.tx.rich;else if(vert_axis.title.txPr)tx_body=vert_axis.title.txPr;if(tx_body){var oBodyPr=vert_axis.title.getBodyPr();if(oBodyPr&&oBodyPr.vert===AscFormat.nVertTThorz)_label=c_oAscChartVertAxisLabelShowSettings.horizontal;else _label=c_oAscChartVertAxisLabelShowSettings.rotated}else _label= c_oAscChartVertAxisLabelShowSettings.none}else _label=c_oAscChartVertAxisLabelShowSettings.none;ret.putVertAxisLabel(_label);var data_labels=plot_area.charts[0].dLbls;var nDefaultDatalabelsPos=chart_type&&chart_type.getDefaultDataLabelsPosition?chart_type.getDefaultDataLabelsPosition():c_oAscChartDataLabelsPos.none;if(data_labels)if(chart_type.series[0]&&chart_type.series[0].dLbls)this.collectPropsFromDLbls(nDefaultDatalabelsPos,chart_type.series[0].dLbls,ret);else this.collectPropsFromDLbls(nDefaultDatalabelsPos, data_labels,ret);else if(chart_type.series[0]&&chart_type.series[0].dLbls)this.collectPropsFromDLbls(nDefaultDatalabelsPos,chart_type.series[0].dLbls,ret);else{ret.putShowSerName(false);ret.putShowCatName(false);ret.putShowVal(false);ret.putSeparator("");ret.putDataLabelsPos(c_oAscChartDataLabelsPos.none)}if(chart.legend)ret.putLegendPos(AscFormat.isRealNumber(chart.legend.legendPos)?chart.legend.legendPos:c_oAscChartLegendShowSettings.bottom);else ret.putLegendPos(c_oAscChartLegendShowSettings.none); var calc_chart_type;if(chart_type_object_type===AscDFH.historyitem_type_PieChart)if(!AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(chart_space))calc_chart_type=c_oAscChartTypeSettings.pie;else calc_chart_type=c_oAscChartTypeSettings.pie3d;else if(chart_type_object_type===AscDFH.historyitem_type_DoughnutChart)calc_chart_type=c_oAscChartTypeSettings.doughnut;else if(chart_type_object_type===AscDFH.historyitem_type_StockChart)calc_chart_type=c_oAscChartTypeSettings.stock;else if(chart_type_object_type=== AscDFH.historyitem_type_BarChart){var b_hbar=chart_type.barDir===BAR_DIR_BAR;var bView3d=AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(chart_space);if(b_hbar)switch(chart_type.grouping){case BAR_GROUPING_CLUSTERED:{calc_chart_type=bView3d?c_oAscChartTypeSettings.hBarNormal3d:c_oAscChartTypeSettings.hBarNormal;break}case BAR_GROUPING_STACKED:{calc_chart_type=bView3d?c_oAscChartTypeSettings.hBarStacked3d:c_oAscChartTypeSettings.hBarStacked;break}case BAR_GROUPING_PERCENT_STACKED:{calc_chart_type= bView3d?c_oAscChartTypeSettings.hBarStackedPer3d:c_oAscChartTypeSettings.hBarStackedPer;break}default:{calc_chart_type=bView3d?c_oAscChartTypeSettings.hBarNormal3d:c_oAscChartTypeSettings.hBarNormal;break}}else switch(chart_type.grouping){case BAR_GROUPING_CLUSTERED:{calc_chart_type=bView3d?c_oAscChartTypeSettings.barNormal3d:c_oAscChartTypeSettings.barNormal;break}case BAR_GROUPING_STACKED:{calc_chart_type=bView3d?c_oAscChartTypeSettings.barStacked3d:c_oAscChartTypeSettings.barStacked;break}case BAR_GROUPING_PERCENT_STACKED:{calc_chart_type= bView3d?c_oAscChartTypeSettings.barStackedPer3d:c_oAscChartTypeSettings.barStackedPer;break}default:{if(BAR_GROUPING_STANDARD&&bView3d)calc_chart_type=c_oAscChartTypeSettings.barNormal3dPerspective;else calc_chart_type=c_oAscChartTypeSettings.barNormal;break}}}else if(chart_type_object_type===AscDFH.historyitem_type_LineChart){switch(chart_type.grouping){case GROUPING_PERCENT_STACKED:{calc_chart_type=c_oAscChartTypeSettings.lineStackedPer;break}case GROUPING_STACKED:{calc_chart_type=c_oAscChartTypeSettings.lineStacked; break}default:{if(!AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(chart_space))calc_chart_type=c_oAscChartTypeSettings.lineNormal;else calc_chart_type=c_oAscChartTypeSettings.line3d;break}}var bShowMarker=false;if(chart_type.marker!==false)for(var j=0;j<chart_type.series.length;++j){if(!chart_type.series[j].marker){bShowMarker=true;break}if(chart_type.series[j].marker.symbol!==AscFormat.SYMBOL_NONE){bShowMarker=true;break}}ret.putShowMarker(bShowMarker);var b_no_line=true;for(var i=0;i< chart_type.series.length;++i)if(!(chart_type.series[i].spPr&&chart_type.series[i].spPr.ln&&chart_type.series[i].spPr.ln.Fill&&chart_type.series[i].spPr.ln.Fill.fill&&chart_type.series[i].spPr.ln.Fill.fill.type===c_oAscFill.FILL_TYPE_NOFILL)){b_no_line=false;break}var b_smooth=true;for(var i=0;i<chart_type.series.length;++i)if(chart_type.series[i].smooth===false){b_smooth=false;break}if(!b_no_line){ret.putLine(true);ret.putSmooth(b_smooth)}else ret.putLine(false)}else if(chart_type_object_type===AscDFH.historyitem_type_AreaChart)switch(chart_type.grouping){case GROUPING_PERCENT_STACKED:{calc_chart_type= c_oAscChartTypeSettings.areaStackedPer;break}case GROUPING_STACKED:{calc_chart_type=c_oAscChartTypeSettings.areaStacked;break}default:{calc_chart_type=c_oAscChartTypeSettings.areaNormal;break}}else if(chart_type_object_type===AscDFH.historyitem_type_ScatterChart){calc_chart_type=c_oAscChartTypeSettings.scatter;switch(chart_type.scatterStyle){case SCATTER_STYLE_LINE:{ret.bLine=true;ret.smooth=false;ret.showMarker=false;break}case SCATTER_STYLE_LINE_MARKER:{ret.bLine=true;ret.smooth=false;ret.showMarker= true;break}case SCATTER_STYLE_MARKER:{ret.bLine=false;ret.showMarker=false;for(var j=0;j<chart_type.series.length;++j)if(!(chart_type.series[j].marker&&chart_type.series[j].marker.symbol===AscFormat.SYMBOL_NONE)){ret.showMarker=true;break}break}case SCATTER_STYLE_NONE:{ret.bLine=false;ret.showMarker=false;break}case SCATTER_STYLE_SMOOTH:{ret.bLine=true;ret.smooth=true;ret.showMarker=false;break}case SCATTER_STYLE_SMOOTH_MARKER:{ret.bLine=true;ret.smooth=true;ret.showMarker=true;break}}if(ret.bLine){for(var i= 0;i<chart_type.series.length;++i)if(!(chart_type.series[i].spPr&&chart_type.series[i].spPr.ln&&chart_type.series[i].spPr.ln.Fill&&chart_type.series[i].spPr.ln.Fill.fill&&chart_type.series[i].spPr.ln.Fill.fill.type===c_oAscFill.FILL_TYPE_NOFILL))break;if(i===chart_type.series.length)ret.bLine=false;var b_smooth=ret.smooth;if(b_smooth)for(var i=0;i<chart_type.series.length;++i)if(!chart_type.series[i].smooth){b_smooth=false;break}ret.putSmooth(b_smooth)}}else if(chart_type_object_type===AscDFH.historyitem_type_SurfaceChart){var oView3D= chart_space.chart.view3D;if(chart_type.isWireframe())if(oView3D&&oView3D.rotX===90&&oView3D.rotY===0&&oView3D.rAngAx===false&&oView3D.perspective===0)calc_chart_type=c_oAscChartTypeSettings.contourWireframe;else calc_chart_type=c_oAscChartTypeSettings.surfaceWireframe;else if(oView3D&&oView3D.rotX===90&&oView3D.rotY===0&&oView3D.rAngAx===false&&oView3D.perspective===0)calc_chart_type=c_oAscChartTypeSettings.contourNormal;else calc_chart_type=c_oAscChartTypeSettings.surfaceNormal}else calc_chart_type= c_oAscChartTypeSettings.unknown;ret.type=calc_chart_type;return ret},collectPropsFromDLbls:function(nDefaultDatalabelsPos,data_labels,ret){ret.putShowSerName(data_labels.showSerName===true);ret.putShowCatName(data_labels.showCatName===true);ret.putShowVal(data_labels.showVal===true);ret.putSeparator(data_labels.separator);if(data_labels.bDelete)ret.putDataLabelsPos(c_oAscChartDataLabelsPos.none);else if(data_labels.showSerName||data_labels.showCatName||data_labels.showVal||data_labels.showPercent)ret.putDataLabelsPos(AscFormat.isRealNumber(data_labels.dLblPos)? data_labels.dLblPos:nDefaultDatalabelsPos);else ret.putDataLabelsPos(c_oAscChartDataLabelsPos.none)},_getChartSpace:function(chartSeries,options,bUseCache){switch(options.type){case c_oAscChartTypeSettings.lineNormal:case c_oAscChartTypeSettings.lineNormalMarker:return AscFormat.CreateLineChart(chartSeries,GROUPING_STANDARD,bUseCache,options);case c_oAscChartTypeSettings.lineStacked:case c_oAscChartTypeSettings.lineStackedMarker:return AscFormat.CreateLineChart(chartSeries,GROUPING_STACKED,bUseCache, options);case c_oAscChartTypeSettings.lineStackedPer:case c_oAscChartTypeSettings.lineStackedPerMarker:return AscFormat.CreateLineChart(chartSeries,GROUPING_PERCENT_STACKED,bUseCache,options);case c_oAscChartTypeSettings.line3d:return AscFormat.CreateLineChart(chartSeries,GROUPING_STANDARD,bUseCache,options,true);case c_oAscChartTypeSettings.barNormal:return AscFormat.CreateBarChart(chartSeries,BAR_GROUPING_CLUSTERED,bUseCache,options);case c_oAscChartTypeSettings.barStacked:return AscFormat.CreateBarChart(chartSeries, BAR_GROUPING_STACKED,bUseCache,options);case c_oAscChartTypeSettings.barStackedPer:return AscFormat.CreateBarChart(chartSeries,BAR_GROUPING_PERCENT_STACKED,bUseCache,options);case c_oAscChartTypeSettings.barNormal3d:return AscFormat.CreateBarChart(chartSeries,BAR_GROUPING_CLUSTERED,bUseCache,options,true);case c_oAscChartTypeSettings.barStacked3d:return AscFormat.CreateBarChart(chartSeries,BAR_GROUPING_STACKED,bUseCache,options,true);case c_oAscChartTypeSettings.barStackedPer3d:return AscFormat.CreateBarChart(chartSeries, BAR_GROUPING_PERCENT_STACKED,bUseCache,options,true);case c_oAscChartTypeSettings.barNormal3dPerspective:return AscFormat.CreateBarChart(chartSeries,BAR_GROUPING_STANDARD,bUseCache,options,true,true);case c_oAscChartTypeSettings.hBarNormal:return AscFormat.CreateHBarChart(chartSeries,BAR_GROUPING_CLUSTERED,bUseCache,options);case c_oAscChartTypeSettings.hBarStacked:return AscFormat.CreateHBarChart(chartSeries,BAR_GROUPING_STACKED,bUseCache,options);case c_oAscChartTypeSettings.hBarStackedPer:return AscFormat.CreateHBarChart(chartSeries, BAR_GROUPING_PERCENT_STACKED,bUseCache,options);case c_oAscChartTypeSettings.hBarNormal3d:return AscFormat.CreateHBarChart(chartSeries,BAR_GROUPING_CLUSTERED,bUseCache,options,true);case c_oAscChartTypeSettings.hBarStacked3d:return AscFormat.CreateHBarChart(chartSeries,BAR_GROUPING_STACKED,bUseCache,options,true);case c_oAscChartTypeSettings.hBarStackedPer3d:return AscFormat.CreateHBarChart(chartSeries,BAR_GROUPING_PERCENT_STACKED,bUseCache,options,true);case c_oAscChartTypeSettings.areaNormal:return AscFormat.CreateAreaChart(chartSeries, GROUPING_STANDARD,bUseCache,options);case c_oAscChartTypeSettings.areaStacked:return AscFormat.CreateAreaChart(chartSeries,GROUPING_STACKED,bUseCache,options);case c_oAscChartTypeSettings.areaStackedPer:return AscFormat.CreateAreaChart(chartSeries,GROUPING_PERCENT_STACKED,bUseCache,options);case c_oAscChartTypeSettings.stock:return AscFormat.CreateStockChart(chartSeries,bUseCache,options);case c_oAscChartTypeSettings.doughnut:return AscFormat.CreatePieChart(chartSeries,true,bUseCache,options);case c_oAscChartTypeSettings.pie:return AscFormat.CreatePieChart(chartSeries, false,bUseCache,options);case c_oAscChartTypeSettings.pie3d:return AscFormat.CreatePieChart(chartSeries,false,bUseCache,options,true);case c_oAscChartTypeSettings.scatter:case c_oAscChartTypeSettings.scatterLine:case c_oAscChartTypeSettings.scatterLineMarker:case c_oAscChartTypeSettings.scatterMarker:case c_oAscChartTypeSettings.scatterNone:case c_oAscChartTypeSettings.scatterSmooth:case c_oAscChartTypeSettings.scatterSmoothMarker:return AscFormat.CreateScatterChart(chartSeries,bUseCache,options); case c_oAscChartTypeSettings.surfaceNormal:return AscFormat.CreateSurfaceChart(chartSeries,bUseCache,options,false,false);case c_oAscChartTypeSettings.surfaceWireframe:return AscFormat.CreateSurfaceChart(chartSeries,bUseCache,options,false,true);case c_oAscChartTypeSettings.contourNormal:return AscFormat.CreateSurfaceChart(chartSeries,bUseCache,options,true,false);case c_oAscChartTypeSettings.contourWireframe:return AscFormat.CreateSurfaceChart(chartSeries,bUseCache,options,true,true)}return null}, getChartSpace:function(worksheet,options,bUseCache){var chartSeries=AscFormat.getChartSeries(worksheet,options);return this._getChartSpace(chartSeries,options,bUseCache)},getChartSpace2:function(chart,options){var ret=null;if(isRealObject(chart)&&typeof chart["binary"]==="string"&&chart["binary"].length>0){var asc_chart_binary=new Asc.asc_CChartBinary;asc_chart_binary.asc_setBinary(chart["binary"]);ret=asc_chart_binary.getChartSpace(editor.WordControl.m_oLogicDocument);if(ret.spPr&&ret.spPr.xfrm){ret.spPr.xfrm.setOffX(0); ret.spPr.xfrm.setOffY(0)}ret.setBDeleted(false)}else if(isRealObject(chart)){ret=DrawingObjectsController.prototype._getChartSpace.call(this,chart,options,true);ret.setBDeleted(false);ret.setStyle(2);ret.setSpPr(new AscFormat.CSpPr);ret.spPr.setParent(ret);ret.spPr.setXfrm(new AscFormat.CXfrm);ret.spPr.xfrm.setParent(ret.spPr);ret.spPr.xfrm.setOffX(0);ret.spPr.xfrm.setOffY(0);ret.spPr.xfrm.setExtX(152);ret.spPr.xfrm.setExtY(89)}return ret},getSeriesDefault:function(type){var series=[],seria,Cat;var createItem= function(value){return{numFormatStr:"General",isDateTimeFormat:false,val:value,isHidden:false}};var createItem2=function(value,formatCode){return{numFormatStr:formatCode,isDateTimeFormat:false,val:value,isHidden:false}};if(type!==c_oAscChartTypeSettings.stock){var bIsScatter=c_oAscChartTypeSettings.scatter<=type&&type<=c_oAscChartTypeSettings.scatterSmoothMarker;Cat={Formula:"Sheet1!$A$2:$A$7",NumCache:[createItem("USA"),createItem("CHN"),createItem("RUS"),createItem("GBR"),createItem("GER"),createItem("JPN")]}; seria=new AscFormat.asc_CChartSeria;seria.Val.Formula="Sheet1!$B$2:$B$7";seria.Val.NumCache=[createItem(46),createItem(38),createItem(24),createItem(29),createItem(11),createItem(7)];seria.TxCache.Formula="Sheet1!$B$1";seria.TxCache.Tx="Gold";if(!bIsScatter)seria.Cat=Cat;else seria.xVal=Cat;series.push(seria);seria=new AscFormat.asc_CChartSeria;seria.Val.Formula="Sheet1!$C$2:$C$7";seria.Val.NumCache=[createItem(29),createItem(27),createItem(26),createItem(17),createItem(19),createItem(14)];seria.TxCache.Formula= "Sheet1!$C$1";seria.TxCache.Tx="Silver";if(!bIsScatter)seria.Cat=Cat;else seria.xVal=Cat;series.push(seria);seria=new AscFormat.asc_CChartSeria;seria.Val.Formula="Sheet1!$D$2:$D$7";seria.Val.NumCache=[createItem(29),createItem(23),createItem(32),createItem(19),createItem(14),createItem(17)];seria.TxCache.Formula="Sheet1!$D$1";seria.TxCache.Tx="Bronze";if(!bIsScatter)seria.Cat=Cat;else seria.xVal=Cat;series.push(seria);return series}else{Cat={Formula:"Sheet1!$A$2:$A$6",NumCache:[createItem2(38719, "d-mmm-yy"),createItem2(38720,"d-mmm-yy"),createItem2(38721,"d-mmm-yy"),createItem2(38722,"d-mmm-yy"),createItem2(38723,"d-mmm-yy")],formatCode:"d-mmm-yy"};seria=new AscFormat.asc_CChartSeria;seria.Val.Formula="Sheet1!$B$2:$B$6";seria.Val.NumCache=[createItem(40),createItem(21),createItem(37),createItem(49),createItem(32)];seria.TxCache.Formula="Sheet1!$B$1";seria.TxCache.Tx="Open";seria.Cat=Cat;series.push(seria);seria=new AscFormat.asc_CChartSeria;seria.Val.Formula="Sheet1!$C$2:$C$6";seria.Val.NumCache= [createItem(57),createItem(54),createItem(52),createItem(59),createItem(34)];seria.TxCache.Formula="Sheet1!$C$1";seria.TxCache.Tx="High";seria.Cat=Cat;series.push(seria);seria=new AscFormat.asc_CChartSeria;seria.Val.Formula="Sheet1!$D$2:$D$6";seria.Val.NumCache=[createItem(10),createItem(14),createItem(14),createItem(12),createItem(6)];seria.TxCache.Formula="Sheet1!$D$1";seria.TxCache.Tx="Low";seria.Cat=Cat;series.push(seria);seria=new AscFormat.asc_CChartSeria;seria.Val.Formula="Sheet1!$E$2:$E$6"; seria.Val.NumCache=[createItem(24),createItem(35),createItem(48),createItem(35),createItem(15)];seria.TxCache.Formula="Sheet1!$E$1";seria.TxCache.Tx="Close";seria.Cat=Cat;series.push(seria);return series}},changeCurrentState:function(newState){this.curState=newState},updateSelectionState:function(bNoCheck){var text_object,drawingDocument=this.drawingObjects.getDrawingDocument();if(this.selection.textSelection)text_object=this.selection.textSelection;else if(this.selection.groupSelection)if(this.selection.groupSelection.selection.textSelection)text_object= this.selection.groupSelection.selection.textSelection;else{if(this.selection.groupSelection.selection.chartSelection&&this.selection.groupSelection.selection.chartSelection.selection.textSelection)text_object=this.selection.groupSelection.selection.chartSelection.selection.textSelection}else if(this.selection.chartSelection&&this.selection.chartSelection.selection.textSelection)text_object=this.selection.chartSelection.selection.textSelection;if(isRealObject(text_object))text_object.updateSelectionState(drawingDocument); else if(bNoCheck!==true){drawingDocument.UpdateTargetTransform(null);drawingDocument.TargetEnd();drawingDocument.SelectEnabled(false);drawingDocument.SelectShow()}var oContent=this.getTargetDocContent();if(oContent){var oSelectedInfo=new CSelectedElementsInfo;oSelectedInfo=oContent.GetSelectedElementsInfo(oSelectedInfo);var Math=oSelectedInfo.GetMath();var bSelection=oContent.IsSelectionUse();var bEmptySelection=bSelection&&oContent.IsSelectionEmpty();if(null!==Math)drawingDocument.Update_MathTrack(true, !bSelection||bEmptySelection,Math);else drawingDocument.Update_MathTrack(false)}else drawingDocument.Update_MathTrack(false)},remove:function(dir,bOnlyText,bRemoveOnlySelection,bOnTextAdd,isWord){if(Asc["editor"]&&Asc["editor"].isChartEditor&&!this.selection.chartSelection)return;this.checkSelectedObjectsAndCallback(this.removeCallback,[dir,bOnlyText,bRemoveOnlySelection,bOnTextAdd,isWord,undefined],false,AscDFH.historydescription_Spreadsheet_Remove)},removeCallback:function(dir,bOnlyText,bRemoveOnlySelection, bOnTextAdd,isWord,bNoCheck){var target_text_object=getTargetTextObject(this);if(target_text_object)if(target_text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame)target_text_object.graphicObject.Remove(dir,bOnlyText,bRemoveOnlySelection,bOnTextAdd,isWord);else{var content=this.getTargetDocContent(true);if(content)content.Remove(dir,true,bRemoveOnlySelection,bOnTextAdd,isWord);bNoCheck!==true&&target_text_object.checkExtentsByDocContent&&target_text_object.checkExtentsByDocContent()}else if(this.selectedObjects.length> 0){var aSO,oSp;var worksheet=this.drawingObjects.getWorksheet();var oWBView;if(worksheet)worksheet.endEditChart();var aSlicerNames=[];if(this.selection.groupSelection)if(this.selection.groupSelection.selection.chartSelection)this.selection.groupSelection.selection.chartSelection.remove();else{aSO=this.selection.groupSelection.selectedObjects;this.resetConnectors(aSO);var group_map={},group_arr=[],i,cur_group,sp,xc,yc,hc,vc,rel_xc,rel_yc,j;for(i=0;i<aSO.length;++i){oSp=aSO[i];if(oSp.getObjectType()=== AscDFH.historyitem_type_SlicerView)aSlicerNames.push(oSp.getName());else{oSp.group.removeFromSpTree(oSp.Get_Id());group_map[oSp.group.Get_Id()]=oSp.group;oSp.setBDeleted(true)}}group_map[this.selection.groupSelection.Get_Id()+""]=this.selection.groupSelection;for(var key in group_map)if(group_map.hasOwnProperty(key))group_arr.push(group_map[key]);group_arr.sort(CompareGroups);for(i=0;i<group_arr.length;++i){cur_group=group_arr[i];if(isRealObject(cur_group.group))if(cur_group.spTree.length===0)cur_group.group.removeFromSpTree(cur_group.Get_Id()); else{if(cur_group.spTree.length==1){sp=cur_group.spTree[0];hc=sp.spPr.xfrm.extX/2;vc=sp.spPr.xfrm.extY/2;xc=sp.transform.TransformPointX(hc,vc);yc=sp.transform.TransformPointY(hc,vc);rel_xc=cur_group.group.invertTransform.TransformPointX(xc,yc);rel_yc=cur_group.group.invertTransform.TransformPointY(xc,yc);sp.spPr.xfrm.setOffX(rel_xc-hc);sp.spPr.xfrm.setOffY(rel_yc-vc);sp.spPr.xfrm.setRot(AscFormat.normalizeRotate(cur_group.rot+sp.rot));sp.spPr.xfrm.setFlipH(cur_group.spPr.xfrm.flipH===true?!(sp.spPr.xfrm.flipH=== true):sp.spPr.xfrm.flipH===true);sp.spPr.xfrm.setFlipV(cur_group.spPr.xfrm.flipV===true?!(sp.spPr.xfrm.flipV===true):sp.spPr.xfrm.flipV===true);sp.setGroup(cur_group.group);for(j=0;j<cur_group.group.spTree.length;++j)if(cur_group.group.spTree[j]===cur_group){cur_group.group.addToSpTree(j,sp);cur_group.group.removeFromSpTree(cur_group.Get_Id())}}}else{if(cur_group.spTree.length===0){this.resetInternalSelection();this.removeCallback(-1,undefined,undefined,undefined,undefined,undefined);return}else if(cur_group.spTree.length=== 1){sp=cur_group.spTree[0];sp.spPr.xfrm.setOffX(cur_group.spPr.xfrm.offX+sp.spPr.xfrm.offX);sp.spPr.xfrm.setOffY(cur_group.spPr.xfrm.offY+sp.spPr.xfrm.offY);sp.spPr.xfrm.setRot(AscFormat.normalizeRotate(cur_group.rot+sp.rot));sp.spPr.xfrm.setFlipH(cur_group.spPr.xfrm.flipH===true?!(sp.spPr.xfrm.flipH===true):sp.spPr.xfrm.flipH===true);sp.spPr.xfrm.setFlipV(cur_group.spPr.xfrm.flipV===true?!(sp.spPr.xfrm.flipV===true):sp.spPr.xfrm.flipV===true);sp.setGroup(null);sp.addToDrawingObjects();sp.checkDrawingBaseCoords(); cur_group.deleteDrawingBase();this.resetSelection();this.selectObject(sp,cur_group.selectStartPage)}else cur_group.updateCoordinatesAfterInternalResize();this.resetInternalSelection();this.recalculate();oWBView=Asc.editor&&Asc.editor.wb;if(aSlicerNames.length>0&&oWBView){History.StartTransaction();oWBView.deleteSlicers(aSlicerNames)}return}}this.resetInternalSelection()}else if(this.selection.chartSelection)this.selection.chartSelection.remove();else{aSO=this.selectedObjects;this.resetConnectors(aSO); for(var i=0;i<aSO.length;++i){oSp=aSO[i];if(oSp.getObjectType()===AscDFH.historyitem_type_SlicerView)aSlicerNames.push(oSp.getName());else{oSp.deleteDrawingBase(true);oSp.setBDeleted(true)}}this.resetSelection();this.recalculate()}this.updateOverlay();oWBView=Asc.editor&&Asc.editor.wb;if(aSlicerNames.length>0&&oWBView){History.StartTransaction();oWBView.deleteSlicers(aSlicerNames)}}else if(this.drawingObjects.slideComments)this.drawingObjects.slideComments.removeSelectedComment()},getAllObjectsOnPage:function(pageIndex, bHdrFtr){return this.getDrawingArray()},selectNextObject:function(direction){var selection_array=this.selectedObjects;if(selection_array.length>0){var i,graphic_page;if(direction>0){var selectNext=function(oThis,last_selected_object){var search_array=oThis.getAllObjectsOnPage(last_selected_object.selectStartPage,last_selected_object.parent&&last_selected_object.parent.DocumentContent&&last_selected_object.parent.DocumentContent.IsHdrFtr(false));if(search_array.length>0){for(var i=search_array.length- 1;i>-1;--i)if(search_array[i]===last_selected_object)break;if(i>-1){oThis.resetSelection();oThis.selectObject(search_array[i<search_array.length-1?i+1:0],last_selected_object.selectStartPage);return}else return}};if(this.selection.groupSelection){for(i=this.selection.groupSelection.arrGraphicObjects.length-1;i>-1;--i)if(this.selection.groupSelection.arrGraphicObjects[i].selected)break;if(i>-1)if(i<this.selection.groupSelection.arrGraphicObjects.length-1){this.selection.groupSelection.resetSelection(); this.selection.groupSelection.selectObject(this.selection.groupSelection.arrGraphicObjects[i+1],this.selection.groupSelection.selectStartPage)}else selectNext(this,this.selection.groupSelection)}else{var last_selected_object=this.selectedObjects[this.selectedObjects.length-1];if(last_selected_object.getObjectType()===AscDFH.historyitem_type_GroupShape&&last_selected_object.arrGraphicObjects.length>0){this.resetSelection();this.selectObject(last_selected_object,last_selected_object.selectStartPage); this.selection.groupSelection=last_selected_object;last_selected_object.selectObject(last_selected_object.arrGraphicObjects[0],last_selected_object.selectStartPage)}else selectNext(this,last_selected_object)}}else{var selectPrev=function(oThis,first_selected_object){var search_array=oThis.getAllObjectsOnPage(first_selected_object.selectStartPage,first_selected_object.parent&&first_selected_object.parent.DocumentContent&&first_selected_object.parent.DocumentContent.IsHdrFtr(false));if(search_array.length> 0){for(var i=0;i<search_array.length;++i)if(search_array[i]===first_selected_object)break;if(i<search_array.length){oThis.resetSelection();oThis.selectObject(search_array[i>0?i-1:search_array.length-1],first_selected_object.selectStartPage);return}else return}};if(this.selection.groupSelection){for(i=0;i<this.selection.groupSelection.arrGraphicObjects.length;++i)if(this.selection.groupSelection.arrGraphicObjects[i].selected)break;if(i<this.selection.groupSelection.arrGraphicObjects.length)if(i>0){this.selection.groupSelection.resetSelection(); this.selection.groupSelection.selectObject(this.selection.groupSelection.arrGraphicObjects[i-1],this.selection.groupSelection.selectStartPage)}else selectPrev(this,this.selection.groupSelection);else return}else{var first_selected_object=this.selectedObjects[0];if(first_selected_object.getObjectType()===AscDFH.historyitem_type_GroupShape&&first_selected_object.arrGraphicObjects.length>0){this.resetSelection();this.selectObject(first_selected_object,first_selected_object.selectStartPage);this.selection.groupSelection= first_selected_object;first_selected_object.selectObject(first_selected_object.arrGraphicObjects[first_selected_object.arrGraphicObjects.length-1],first_selected_object.selectStartPage)}else selectPrev(this,first_selected_object)}}this.updateOverlay();if(this.drawingObjects&&this.drawingObjects.sendGraphicObjectProps)this.drawingObjects.sendGraphicObjectProps();else if(this.document&&this.document.Document_UpdateInterfaceState)this.document.Document_UpdateInterfaceState()}},moveSelectedObjects:function(dx, dy){if(!this.canEdit())return;var oldCurState=this.curState;this.checkSelectedObjectsForMove(this.selection.groupSelection?this.selection.groupSelection:null);this.swapTrackObjects();var move_state;if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,this.selectedObjects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this,this.selection.groupSelection.selectedObjects[0],this.selection.groupSelection,0,0);for(var i=0;i<this.arrTrackObjects.length;++i)this.arrTrackObjects[i].track(dx, dy,this.arrTrackObjects[i].originalObject.selectStartPage);var nPageIndex=this.arrTrackObjects[0]&&this.arrTrackObjects[0].originalObject&&AscFormat.isRealNumber(this.arrTrackObjects[0].originalObject.selectStartPage)?this.arrTrackObjects[0].originalObject.selectStartPage:0;move_state.bSamePos=false;move_state.onMouseUp({},0,0,nPageIndex);this.curState=oldCurState},checkRedrawOnChangeCursorPosition:function(oStartContent,oStartPara){if(this.document)return;var oEndContent=AscFormat.checkEmptyPlaceholderContent(this.getTargetDocContent()); var bRedraw=false;var oEndPara=null;if(oStartContent||oEndContent)if(oStartContent!==oEndContent)bRedraw=true;else{if(oEndContent)oEndPara=oEndContent.GetCurrentParagraph();if(oEndPara!==oStartPara)bRedraw=true}if(bRedraw){this.checkChartTextSelection(true);this.drawingObjects.showDrawingObjects&&this.drawingObjects.showDrawingObjects()}},cursorMoveToStartPos:function(){var content=this.getTargetDocContent(undefined,true);var oStartContent,oStartPara;if(content){oStartContent=content;if(oStartContent)oStartPara= oStartContent.GetCurrentParagraph();content.MoveCursorToStartPos();this.updateSelectionState()}this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)},cursorMoveToEndPos:function(){var content=this.getTargetDocContent(undefined,true);var oStartContent,oStartPara;if(content){oStartContent=content;if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();content.MoveCursorToEndPos();this.updateSelectionState()}this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)},getMoveDist:function(bWord){if(bWord)return this.convertPixToMM(1); else return this.convertPixToMM(5)},cursorMoveLeft:function(AddToSelect,Word){var target_text_object=getTargetTextObject(this);var oStartContent,oStartPara;if(target_text_object){if(target_text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame){oStartContent=this.getTargetDocContent(false,false);if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();target_text_object.graphicObject.MoveCursorLeft(AddToSelect,Word);this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}else{var content= this.getTargetDocContent(undefined,true);if(content){oStartContent=content;if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();content.MoveCursorLeft(AddToSelect,Word);this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}}this.updateSelectionState()}else{if(this.selectedObjects.length===0)return;this.moveSelectedObjects(-this.getMoveDist(Word),0)}},cursorMoveRight:function(AddToSelect,Word,bFromPaste){var target_text_object=getTargetTextObject(this);var oStartContent,oStartPara; if(target_text_object){if(target_text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame){oStartContent=this.getTargetDocContent(false,false);if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();target_text_object.graphicObject.MoveCursorRight(AddToSelect,Word,bFromPaste);this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}else{var content=this.getTargetDocContent(undefined,true);if(content){oStartContent=content;if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph(); content.MoveCursorRight(AddToSelect,Word,bFromPaste);this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}}this.updateSelectionState()}else{if(this.selectedObjects.length===0)return;this.moveSelectedObjects(this.getMoveDist(Word),0)}},cursorMoveUp:function(AddToSelect,Word){var target_text_object=getTargetTextObject(this);var oStartContent,oStartPara;if(target_text_object){if(target_text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame){oStartContent=this.getTargetDocContent(false, false);if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();target_text_object.graphicObject.MoveCursorUp(AddToSelect);this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}else{var content=this.getTargetDocContent(undefined,true);if(content){oStartContent=content;if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();content.MoveCursorUp(AddToSelect);this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}}this.updateSelectionState()}else{if(this.selectedObjects.length=== 0)return;this.moveSelectedObjects(0,-this.getMoveDist(Word))}},cursorMoveDown:function(AddToSelect,Word){var target_text_object=getTargetTextObject(this);var oStartContent,oStartPara;if(target_text_object){if(target_text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame){oStartContent=this.getTargetDocContent(false,false);if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();target_text_object.graphicObject.MoveCursorDown(AddToSelect);this.checkRedrawOnChangeCursorPosition(oStartContent, oStartPara)}else{var content=this.getTargetDocContent(undefined,true);if(content){oStartContent=content;if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();content.MoveCursorDown(AddToSelect);this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}}this.updateSelectionState()}else{if(this.selectedObjects.length===0)return;this.moveSelectedObjects(0,this.getMoveDist(Word))}},cursorMoveEndOfLine:function(AddToSelect){var oStartContent,oStartPara;var content=this.getTargetDocContent(undefined, true);if(content){oStartContent=content;if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();content.MoveCursorToEndOfLine(AddToSelect);this.updateSelectionState();this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}},cursorMoveStartOfLine:function(AddToSelect){var oStartContent,oStartPara;var content=this.getTargetDocContent(undefined,true);if(content){oStartContent=content;if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();content.MoveCursorToStartOfLine(AddToSelect); this.updateSelectionState();this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}},cursorMoveAt:function(X,Y,AddToSelect){var text_object;var oStartContent,oStartPara;if(this.selection.textSelection)text_object=this.selection.textSelection;else if(this.selection.groupSelection&&this.selection.groupSelection.selection.textSelection)text_object=this.selection.groupSelection.selection.textSelection;if(text_object&&text_object.cursorMoveAt){oStartContent=this.getTargetDocContent(false,false); if(oStartContent)oStartPara=oStartContent.GetCurrentParagraph();text_object.cursorMoveAt(X,Y,AddToSelect);this.updateSelectionState();this.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)}},resetTextSelection:function(){var oContent=this.getTargetDocContent();if(oContent){oContent.RemoveSelection();var oTextSelection;if(this.selection.groupSelection){oTextSelection=this.selection.groupSelection.selection.textSelection;this.selection.groupSelection.selection.textSelection=null}if(this.selection.textSelection){oTextSelection= this.selection.textSelection;this.selection.textSelection=null}if(oTextSelection&&oTextSelection.recalcInfo)if(oTextSelection.recalcInfo.bRecalculatedTitle){oTextSelection.recalcInfo.recalcTitle=null;oTextSelection.recalcInfo.bRecalculatedTitle=false}if(this.selection.chartSelection)this.selection.chartSelection.selection.textSelection=null}},selectAll:function(){var i;var target_text_object=getTargetTextObject(this);if(target_text_object)if(target_text_object.getObjectType()===AscDFH.historyitem_type_GraphicFrame)target_text_object.graphicObject.SelectAll(); else{var content=this.getTargetDocContent();if(content)content.SelectAll()}else if(!this.document)if(this.selection.groupSelection){if(!this.selection.groupSelection.selection.chartSelection){this.selection.groupSelection.resetSelection();for(i=this.selection.groupSelection.arrGraphicObjects.length-1;i>-1;--i)this.selection.groupSelection.selectObject(this.selection.groupSelection.arrGraphicObjects[i],0)}}else{if(!this.selection.chartSelection){this.resetSelection();var drawings=this.getDrawingObjects(); for(i=drawings.length-1;i>-1;--i)this.selectObject(drawings[i],0)}}else{this.resetSelection();this.document.SetDocPosType(docpostype_Content);this.document.SelectAll()}this.updateSelectionState()},canEdit:function(){var oApi=this.getEditorApi();var _ret=true;if(oApi)_ret=oApi.canEdit();return _ret},getEventListeners:function(){return this.eventListeners},onKeyUp:function(e){var aListeners=this.getEventListeners();for(var nObject=0;nObject<aListeners.length;++nObject)aListeners[nObject].onKeyUp(e)}, onKeyDown:function(e){var ctrlKey=e.metaKey||e.ctrlKey;var drawingObjectsController=this;var bRetValue=false;var canEdit=drawingObjectsController.canEdit();var oApi=window["Asc"]["editor"];var oTargetTextObject;AscCommon.check_KeyboardEvent(e);var oEvent=AscCommon.global_keyboardEvent;var nShortcutAction=oApi.getShortcut(oEvent);var oCustom=oApi.getCustomShortcutAction(nShortcutAction);if(oCustom){if(this.getTargetDocContent(false,false))if(AscCommon.c_oAscCustomShortcutType.Symbol===oCustom.Type)oApi["asc_insertSymbol"](oCustom.Font, oCustom.CharCode)}else if(e.keyCode==8&&canEdit){drawingObjectsController.remove(-1,undefined,undefined,undefined,ctrlKey);bRetValue=true}else if(e.keyCode==9&&canEdit){if(this.getTargetDocContent()){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaTab)};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_AddTab,undefined,window["Asc"]["editor"].collaborativeEditing.getFast())}else this.selectNextObject(!e.shiftKey?1:-1);bRetValue=true}else if(e.keyCode== 13&&canEdit){var target_doc_content=this.getTargetDocContent();if(target_doc_content){var hyperlink=this.hyperlinkCheck(false);if(hyperlink&&!e.shiftKey){window["Asc"]["editor"].wb.handlers.trigger("asc_onHyperlinkClick",hyperlink.GetValue());hyperlink.SetVisited(true);this.drawingObjects.showDrawingObjects()}else{var oSelectedInfo=new CSelectedElementsInfo;target_doc_content.GetSelectedElementsInfo(oSelectedInfo);var oMath=oSelectedInfo.GetMath();if(null!==oMath&&oMath.Is_InInnerContent()){this.checkSelectedObjectsAndCallback(function(){oMath.Handle_AddNewLine()}, [],false,AscDFH.historydescription_Spreadsheet_AddNewParagraph,undefined,window["Asc"]["editor"].collaborativeEditing.getFast());this.recalculate()}else{if(e.shiftKey){var oThis=this;var callBack=function(){oThis.paragraphAdd(new ParaNewLine(AscCommonWord.break_Line))};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_AddItem,undefined,window["Asc"]["editor"].collaborativeEditing.getFast())}else this.checkSelectedObjectsAndCallback(this.addNewParagraph,[], false,AscDFH.historydescription_Spreadsheet_AddNewParagraph,undefined,window["Asc"]["editor"].collaborativeEditing.getFast());this.recalculate()}}}else{var nResult=this.handleEnter();if(nResult&1){this.updateSelectionState();if(this.drawingObjects&&this.drawingObjects.sendGraphicObjectProps)this.drawingObjects.sendGraphicObjectProps()}}bRetValue=true}else if(e.keyCode==27){var content=this.getTargetDocContent();if(content)content.RemoveSelection();if(this.selection.textSelection){this.selection.textSelection= null;drawingObjectsController.updateSelectionState()}else if(this.selection.groupSelection){if(this.selection.groupSelection.selection.textSelection)this.selection.groupSelection.selection.textSelection=null;else if(this.selection.groupSelection.selection.chartSelection)if(this.selection.groupSelection.selection.chartSelection.selection.textSelection)this.selection.groupSelection.selection.chartSelection.selection.textSelection=null;else{this.selection.groupSelection.selection.chartSelection.resetSelection(); this.selection.groupSelection.selection.chartSelection=null}else{this.selection.groupSelection.resetSelection();this.selection.groupSelection=null}drawingObjectsController.updateSelectionState()}else if(this.selection.chartSelection){if(this.selection.chartSelection.selection.textSelection)this.selection.chartSelection.selection.textSelection=null;else{this.selection.chartSelection.resetSelection();this.selection.chartSelection=null}drawingObjectsController.updateSelectionState()}else if(!this.checkEndAddShape()){this.resetSelection(); var ws=drawingObjectsController.drawingObjects.getWorksheet();var isChangeSelectionShape=ws._endSelectionShape();if(isChangeSelectionShape){ws._drawSelection();ws._updateSelectionNameAndInfo()}}bRetValue=true}else if(e.keyCode==33);else if(e.keyCode==34);else if(e.keyCode==35){var content=this.getTargetDocContent();if(content)if(ctrlKey){content.MoveCursorToEndPos();drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();this.drawingObjects.sendGraphicObjectProps()}else{content.MoveCursorToEndOfLine(e.shiftKey); drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();this.drawingObjects.sendGraphicObjectProps()}bRetValue=true}else if(e.keyCode==36){var content=this.getTargetDocContent();if(content)if(ctrlKey){content.MoveCursorToStartPos();drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();this.drawingObjects.sendGraphicObjectProps()}else{content.MoveCursorToStartOfLine(e.shiftKey);drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay(); this.drawingObjects.sendGraphicObjectProps()}bRetValue=true}else if(e.keyCode==37){this.cursorMoveLeft(e.shiftKey,ctrlKey);drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();this.drawingObjects.sendGraphicObjectProps();bRetValue=true}else if(e.keyCode==38){this.cursorMoveUp(e.shiftKey,ctrlKey);drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();this.drawingObjects.sendGraphicObjectProps();bRetValue=true}else if(e.keyCode== 39){this.cursorMoveRight(e.shiftKey,ctrlKey);drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();this.drawingObjects.sendGraphicObjectProps();bRetValue=true}else if(e.keyCode==40){this.cursorMoveDown(e.shiftKey,ctrlKey);drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();this.drawingObjects.sendGraphicObjectProps();bRetValue=true}else if(e.keyCode==45);else if(e.keyCode==46&&canEdit){if(!e.shiftKey){drawingObjectsController.remove(1, undefined,undefined,undefined,ctrlKey);bRetValue=true}}else if(e.keyCode==65&&true===ctrlKey){this.selectAll();this.drawingObjects.sendGraphicObjectProps();bRetValue=true}else if(e.keyCode==66&&canEdit&&true===ctrlKey){var TextPr=drawingObjectsController.getParagraphTextPr();if(isRealObject(TextPr)){this.setCellBold(TextPr.Bold===true?false:true);bRetValue=true}}else if(e.keyCode==67){if(e.altKey){var oSelector=this.selection.groupSelection||this;var aSelected=oSelector.selectedObjects;if(aSelected.length=== 1&&aSelected[0].getObjectType()===AscDFH.historyitem_type_SlicerView){aSelected[0].handleClearButtonClick();bRetValue=true}}}else if(e.keyCode==69&&canEdit&&true===ctrlKey){var ParaPr=drawingObjectsController.getParagraphParaPr();if(isRealObject(ParaPr)){this.setCellAlign(ParaPr.Jc===AscCommon.align_Center?AscCommon.align_Left:AscCommon.align_Center);bRetValue=true}}else if(e.keyCode==73&&canEdit&&true===ctrlKey){var TextPr=drawingObjectsController.getParagraphTextPr();if(isRealObject(TextPr)){drawingObjectsController.setCellItalic(TextPr.Italic=== true?false:true);bRetValue=true}}else if(e.keyCode==74&&canEdit&&true===ctrlKey){var ParaPr=drawingObjectsController.getParagraphParaPr();if(isRealObject(ParaPr)){drawingObjectsController.setCellAlign(ParaPr.Jc===AscCommon.align_Justify?AscCommon.align_Left:AscCommon.align_Justify);bRetValue=true}}else if(e.keyCode==75&&canEdit&&true===ctrlKey)bRetValue=true;else if(e.keyCode==76&&canEdit&&true===ctrlKey){var ParaPr=drawingObjectsController.getParagraphParaPr();if(isRealObject(ParaPr)){drawingObjectsController.setCellAlign(ParaPr.Jc=== AscCommon.align_Left?AscCommon.align_Justify:AscCommon.align_Left);bRetValue=true}}else if(e.keyCode==77&&canEdit&&true===ctrlKey)bRetValue=true;else if(e.keyCode==80&&true===ctrlKey)bRetValue=true;else if(e.keyCode==82&&canEdit&&true===ctrlKey){var ParaPr=drawingObjectsController.getParagraphParaPr();if(isRealObject(ParaPr)){drawingObjectsController.setCellAlign(ParaPr.Jc===AscCommon.align_Right?AscCommon.align_Left:AscCommon.align_Right);bRetValue=true}}else if(e.keyCode==83){if(e.altKey){var oSelector= this.selection.groupSelection||this;var aSelected=oSelector.selectedObjects;if(aSelected.length===1&&aSelected[0].getObjectType()===AscDFH.historyitem_type_SlicerView){aSelected[0].invertMultiSelect();bRetValue=true}}}else if(e.keyCode==85&&canEdit&&true===ctrlKey){var TextPr=drawingObjectsController.getParagraphTextPr();if(isRealObject(TextPr)){drawingObjectsController.setCellUnderline(TextPr.Underline===true?false:true);bRetValue=true}}else if(e.keyCode==86&&canEdit&&true===ctrlKey);else if(e.keyCode== 88&&canEdit&&true===ctrlKey);else if(e.keyCode==89&&canEdit&&true===ctrlKey);else if(e.keyCode==90&&canEdit&&true===ctrlKey);else if(e.keyCode==93||57351==e.keyCode)bRetValue=true;else if(e.keyCode==121&&true===e.shiftKey);else if(e.keyCode==144);else if(e.keyCode==145);else if(e.keyCode==187&&canEdit&&true===ctrlKey){var TextPr=drawingObjectsController.getParagraphTextPr();if(isRealObject(TextPr)){if(true===e.shiftKey)drawingObjectsController.setCellSuperscript(TextPr.VertAlign===AscCommon.vertalign_SuperScript? false:true);else drawingObjectsController.setCellSubscript(TextPr.VertAlign===AscCommon.vertalign_SubScript?false:true);bRetValue=true}}else if(e.keyCode==188&&true===ctrlKey){var TextPr=drawingObjectsController.getParagraphTextPr();if(isRealObject(TextPr)){drawingObjectsController.setCellSuperscript(TextPr.VertAlign===AscCommon.vertalign_SuperScript?false:true);bRetValue=true}}else if(e.keyCode==189&&canEdit){var Item=null;var oThis=this;var callBack=function(){var Item=null;if(true===ctrlKey&&true=== e.shiftKey){Item=new ParaText(8211);Item.SpaceAfter=false}else if(true===e.shiftKey)Item=new ParaText("_".charCodeAt(0));else Item=new ParaText("-".charCodeAt(0));oThis.paragraphAdd(Item)};this.checkSelectedObjectsAndCallback(callBack,[],false,AscDFH.historydescription_Spreadsheet_AddItem,undefined,window["Asc"]["editor"].collaborativeEditing.getFast());bRetValue=true}else if(e.keyCode==190&&true===ctrlKey){var TextPr=drawingObjectsController.getParagraphTextPr();if(isRealObject(TextPr)){drawingObjectsController.setCellSubscript(TextPr.VertAlign=== AscCommon.vertalign_SubScript?false:true);bRetValue=true}}else if(e.keyCode==219&&canEdit&&true===ctrlKey){drawingObjectsController.decreaseFontSize();bRetValue=true}else if(e.keyCode==221&&canEdit&&true===ctrlKey){drawingObjectsController.increaseFontSize();bRetValue=true}else if(e.keyCode===113)bRetValue=true;if(bRetValue)e.preventDefault();return bRetValue},checkTrackDrawings:function(){return this.curState instanceof AscFormat.StartAddNewShape||this.curState instanceof AscFormat.SplineBezierState|| this.curState instanceof AscFormat.PolyLineAddState||this.curState instanceof AscFormat.AddPolyLine2State||this.arrTrackObjects.length>0||this.arrPreTrackObjects.length>0},checkEndAddShape:function(){if(this.checkTrackDrawings()){this.endTrackNewShape();if(Asc["editor"]){Asc["editor"].asc_endAddShape();var ws=Asc["editor"].wb.getWorksheet();if(ws){var ct=ws.getCursorTypeFromXY(ws.objectRender.lastX,ws.objectRender.lastY);if(ct)Asc["editor"].wb._onUpdateCursor(ct.cursor)}}return true}return false}, onMouseWheel:function(deltaX,deltaY){var aSelection=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects;if(aSelection.length===1&&aSelection[0].getObjectType()===AscDFH.historyitem_type_SlicerView)return aSelection[0].onWheel(deltaX,deltaY);return false},resetSelectionState:function(){if(this.bNoResetSeclectionState===true)return;this.checkChartTextSelection();this.resetSelection();this.clearPreTrackObjects();this.clearTrackObjects();this.changeCurrentState(new AscFormat.NullState(this, this.drawingObjects));this.updateSelectionState();Asc["editor"]&&Asc["editor"].asc_endAddShape()},resetSelectionState2:function(){var count=this.selectedObjects.length;while(count>0){this.selectedObjects[0].deselect(this);--count}this.changeCurrentState(new AscFormat.NullState(this,this.drawingObjects))},addTextWithPr:function(sText,oTextPr,isMoveCursorOutside){this.checkSelectedObjectsAndCallback(function(){var oTargetDocContent=this.getTargetDocContent(true,false);if(oTargetDocContent){oTargetDocContent.Remove(-1, true,true,true,undefined);var oCurrentTextPr=oTargetDocContent.GetDirectTextPr();var oParagraph=oTargetDocContent.GetCurrentParagraph();if(oParagraph&&oParagraph.GetParent()){var oTempPara=new Paragraph(this.drawingObjects.getDrawingDocument(),oParagraph.GetParent());var oRun=new ParaRun(oTempPara,false);oRun.AddText(sText);oTempPara.AddToContent(0,oRun);oRun.SetPr(oCurrentTextPr.Copy());if(oTextPr)oRun.ApplyPr(oTextPr);var oAnchorPos=oParagraph.GetCurrentAnchorPosition();var oSelectedContent=new CSelectedContent; var oSelectedElement=new CSelectedElement;oSelectedElement.Element=oTempPara;oSelectedElement.SelectedAll=false;oSelectedContent.Add(oSelectedElement);oSelectedContent.On_EndCollectElements(oTargetDocContent,false);var isMath=false;if(oAnchorPos&&oAnchorPos.Paragraph){var oParaNearPos=oAnchorPos.Paragraph.Get_ParaNearestPos(oAnchorPos);var oLastClass=oParaNearPos.Classes[oParaNearPos.Classes.length-1];isMath=para_Math_Run===oLastClass.Type}oParagraph.GetParent().InsertContent(oSelectedContent,oAnchorPos); oSelectedElement=oSelectedContent.Elements[0];if(oSelectedElement){oTempPara=oSelectedElement.Element;if(oTempPara){oRun=oTempPara.Content[0];if(isMath)oTargetDocContent.MoveCursorRight(false,false,true);else if(oTargetDocContent.IsSelectionUse())if(isMoveCursorOutside){oTargetDocContent.RemoveSelection();oRun.MoveCursorOutsideElement(false)}else oTargetDocContent.MoveCursorRight(false,false,true);else if(isMoveCursorOutside)oRun.MoveCursorOutsideElement(false)}}var oTargetTextObject=getTargetTextObject(this); if(oTargetTextObject&&oTargetTextObject.checkExtentsByDocContent)oTargetTextObject.checkExtentsByDocContent()}}},[],false,AscDFH.historydescription_Document_AddTextWithProperties)},getColorMapOverride:function(){return null},Document_UpdateInterfaceState:function(){},getChartObject:function(type,w,h){if(null!=type)return AscFormat.ExecuteNoHistory(function(){var options=new Asc.asc_ChartSettings;options.type=type;options.style=1;options.putTitle(c_oAscChartTitleShowSettings.noOverlay);var chartSeries= {series:DrawingObjectsController.prototype.getSeriesDefault.call(this,type),parsedHeaders:{bLeft:true,bTop:true}};var ret=this.getChartSpace2(chartSeries,options);if(!ret){chartSeries={series:DrawingObjectsController.prototype.getSeriesDefault.call(this,c_oAscChartTypeSettings.barNormal),parsedHeaders:{bLeft:true,bTop:true}};ret=this.getChartSpace2(chartSeries,options)}if(type===c_oAscChartTypeSettings.scatter){var new_hor_axis_settings=new AscCommon.asc_ValAxisSettings;new_hor_axis_settings.setDefault(); options.putHorAxisProps(new_hor_axis_settings);var new_vert_axis_settings=new AscCommon.asc_ValAxisSettings;new_vert_axis_settings.setDefault();options.putVertAxisProps(new_vert_axis_settings);options.putHorGridLines(c_oAscGridLinesSettings.major);options.putVertGridLines(c_oAscGridLinesSettings.major);options.putShowMarker(true);options.putSmooth(null);options.putLine(false)}options.type=null;options.bCreate=true;this.applyPropsToChartSpace(options,ret);options.bCreate=false;this.applyPropsToChartSpace(options, ret);ret.theme=this.getTheme();CheckSpPrXfrm(ret);ret.spPr.xfrm.setOffX(0);ret.spPr.xfrm.setOffY(0);if(AscFormat.isRealNumber(w)&&w>0){var dAspect=w/ret.spPr.xfrm.extX;if(dAspect<1){ret.spPr.xfrm.setExtX(w);ret.spPr.xfrm.setExtY(ret.spPr.xfrm.extY*dAspect)}}ret.theme=this.getTheme();ret.colorMapOverride=this.getColorMapOverride();return ret},this,[]);else{var by_types=getObjectsByTypesFromArr(this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,true);if(by_types.charts.length=== 1){by_types.charts[0].theme=this.getTheme();by_types.charts[0].colorMapOverride=this.getColorMapOverride();AscFormat.ExecuteNoHistory(function(){CheckSpPrXfrm2(by_types.charts[0])},this,[]);return by_types.charts[0]}}return null},checkNeedResetChartSelection:function(e,x,y,pageIndex,bTextFlag){var oTitle,oCursorInfo,oTargetTextObject=getTargetTextObject(this);if(oTargetTextObject instanceof AscFormat.CTitle)oTitle=oTargetTextObject;if(!oTitle)return true;this.handleEventMode=HANDLE_EVENT_MODE_CURSOR; oCursorInfo=this.curState.onMouseDown(e,x,y,pageIndex,bTextFlag);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;return!(isRealObject(oCursorInfo)&&oTitle===oCursorInfo.title)},checkChartTextSelection:function(bNoRedraw){if(this.bNoCheckChartTextSelection===true)return false;var chart_selection,bRet=false;var nPageNum1,nPageNum2;if(this.selection.chartSelection)chart_selection=this.selection.chartSelection;else if(this.selection.groupSelection&&this.selection.groupSelection.selection.chartSelection)chart_selection= this.selection.groupSelection.selection.chartSelection;if(chart_selection&&(chart_selection.selection.textSelection||chart_selection.selection.title)){var oTitle=chart_selection.selection.textSelection;if(!oTitle){oTitle=chart_selection.selection.title;nPageNum2=this.drawingObjects.num}var content=oTitle.getDocContent(),bDeleteTitle=false;if(content)if(content.Is_Empty())if(chart_selection.selection.title&&chart_selection.selection.title.parent){History.Create_NewPoint(AscDFH.historydescription_CommonControllerCheckChartText); chart_selection.selection.title.parent.setTitle(null);bDeleteTitle=true}if(chart_selection.recalcInfo.bRecalculatedTitle||bDeleteTitle){chart_selection.recalcInfo.recalcTitle=null;chart_selection.handleUpdateInternalChart(false);if(this.document){chart_selection.recalculate();nPageNum1=chart_selection.selectStartPage}else if(this.drawingObjects.cSld){chart_selection.recalculate();if(!(bNoRedraw===true))nPageNum1=this.drawingObjects.num}else{nPageNum1=0;chart_selection.recalculate()}chart_selection.recalcInfo.bRecalculatedTitle= false}}var oTargetTextObject=getTargetTextObject(this);var nSelectStartPage=0,bNoNeedRecalc=false;if(oTargetTextObject)nSelectStartPage=oTargetTextObject.selectStartPage;if(!(oTargetTextObject instanceof AscFormat.CShape)&&this.document)if(this.selectedObjects.length===1&&this.selectedObjects[0].parent){var oShape=this.selectedObjects[0].parent.isShapeChild(true);if(oShape){oTargetTextObject=oShape;nSelectStartPage=this.selectedObjects[0].selectStartPage;bNoNeedRecalc=true}}if(oTargetTextObject){var warpGeometry= oTargetTextObject.recalcInfo&&oTargetTextObject.recalcInfo.warpGeometry;if(warpGeometry&&warpGeometry.preset!=="textNoShape"||oTargetTextObject.worksheet){if(oTargetTextObject.recalcInfo.bRecalculatedTitle){oTargetTextObject.recalcInfo.recalcTitle=null;oTargetTextObject.recalcInfo.bRecalculatedTitle=false;AscFormat.ExecuteNoHistory(function(){if(oTargetTextObject.bWordShape){if(!bNoNeedRecalc){oTargetTextObject.recalcInfo.oContentMetrics=oTargetTextObject.recalculateTxBoxContent();oTargetTextObject.recalcInfo.recalculateTxBoxContent= false;oTargetTextObject.recalcInfo.AllDrawings=[];var oContent=oTargetTextObject.getDocContent();if(oContent)oContent.GetAllDrawingObjects(oTargetTextObject.recalcInfo.AllDrawings)}}else{oTargetTextObject.recalcInfo.oContentMetrics=oTargetTextObject.recalculateContent();oTargetTextObject.recalcInfo.recalculateContent=false}},this,[])}if(this.document)nPageNum2=nSelectStartPage;else if(this.drawingObjects.cSld)nPageNum2=this.drawingObjects.num;else nPageNum2=0}}if(AscFormat.isRealNumber(nPageNum1)){bRet= true;if(this.document){this.document.DrawingDocument.OnRecalculatePage(nPageNum1,this.document.Pages[nPageNum1]);this.document.DrawingDocument.OnEndRecalculate(false,true)}else if(this.drawingObjects.cSld){if(!(bNoRedraw===true)){editor.WordControl.m_oDrawingDocument.OnRecalculatePage(nPageNum1,this.drawingObjects);editor.WordControl.m_oDrawingDocument.OnEndRecalculate(false,true)}}else this.drawingObjects.showDrawingObjects()}if(AscFormat.isRealNumber(nPageNum2)&&nPageNum2!==nPageNum1){bRet=true; if(this.document){this.document.DrawingDocument.OnRecalculatePage(nPageNum2,this.document.Pages[nPageNum2]);this.document.DrawingDocument.OnEndRecalculate(false,true)}else if(this.drawingObjects.cSld){if(!(bNoRedraw===true)){editor.WordControl.m_oDrawingDocument.OnRecalculatePage(nPageNum2,this.drawingObjects);editor.WordControl.m_oDrawingDocument.OnEndRecalculate(false,true)}}else this.drawingObjects.showDrawingObjects()}return bRet},resetSelection:function(noResetContentSelect,bNoCheckChart,bDoNotRedraw){if(bNoCheckChart!== true)this.checkChartTextSelection();this.resetInternalSelection(noResetContentSelect,bDoNotRedraw);for(var i=0;i<this.selectedObjects.length;++i)this.selectedObjects[i].selected=false;this.selectedObjects.length=0;this.selection={selectedObjects:[],groupSelection:null,chartSelection:null,textSelection:null,cropSelection:null}},clearPreTrackObjects:function(){this.arrPreTrackObjects.length=0},addPreTrackObject:function(preTrackObject){this.arrPreTrackObjects.push(preTrackObject)},clearTrackObjects:function(){this.arrTrackObjects.length= 0},addTrackObject:function(trackObject){this.arrTrackObjects.push(trackObject)},swapTrackObjects:function(){this.checkConnectorsPreTrack();this.clearTrackObjects();for(var i=0;i<this.arrPreTrackObjects.length;++i)this.addTrackObject(this.arrPreTrackObjects[i]);this.clearPreTrackObjects()},rotateTrackObjects:function(angle,e){for(var i=0;i<this.arrTrackObjects.length;++i)this.arrTrackObjects[i].track(angle,e)},trackResizeObjects:function(kd1,kd2,e,x,y){for(var i=0;i<this.arrTrackObjects.length;++i)this.arrTrackObjects[i].track(kd1, kd2,e,x,y)},trackEnd:function(){var oOriginalObjects=[];for(var i=0;i<this.arrTrackObjects.length;++i){this.arrTrackObjects[i].trackEnd();if(this.arrTrackObjects[i].originalObject&&!this.arrTrackObjects[i].processor3D)oOriginalObjects.push(this.arrTrackObjects[i].originalObject)}var aAllConnectors=this.getAllConnectorsByDrawings(oOriginalObjects,[],undefined,true);for(i=0;i<aAllConnectors.length;++i)aAllConnectors[i].calculateTransform();this.drawingObjects.showDrawingObjects()},canGroup:function(){return this.getArrayForGrouping().length> 1},getArrayForGrouping:function(){var graphic_objects=this.getDrawingObjects();var grouped_objects=[];for(var i=0;i<graphic_objects.length;++i){var cur_graphic_object=graphic_objects[i];if(cur_graphic_object.selected){if(!cur_graphic_object.canGroup())return[];grouped_objects.push(cur_graphic_object)}}return grouped_objects},getBoundsForGroup:function(arrDrawings){var bounds=arrDrawings[0].getBoundsInGroup();var max_x=bounds.r;var max_y=bounds.b;var min_x=bounds.l;var min_y=bounds.t;for(var i=1;i< arrDrawings.length;++i){bounds=arrDrawings[i].getBoundsInGroup();if(max_x<bounds.r)max_x=bounds.r;if(max_y<bounds.b)max_y=bounds.b;if(min_x>bounds.l)min_x=bounds.l;if(min_y>bounds.t)min_y=bounds.t}return new AscFormat.CGraphicBounds(min_x,min_y,max_x,max_y)},getGroup:function(arrDrawings){if(!Array.isArray(arrDrawings))arrDrawings=this.getArrayForGrouping();if(arrDrawings.length<2)return null;var bounds=this.getBoundsForGroup(arrDrawings);var max_x=bounds.r;var max_y=bounds.b;var min_x=bounds.l;var min_y= bounds.t;var group=new AscFormat.CGroupShape;group.setSpPr(new AscFormat.CSpPr);group.spPr.setParent(group);group.spPr.setXfrm(new AscFormat.CXfrm);var xfrm=group.spPr.xfrm;xfrm.setParent(group.spPr);xfrm.setOffX(min_x);xfrm.setOffY(min_y);xfrm.setExtX(max_x-min_x);xfrm.setExtY(max_y-min_y);xfrm.setChExtX(max_x-min_x);xfrm.setChExtY(max_y-min_y);xfrm.setChOffX(0);xfrm.setChOffY(0);for(var i=0;i<arrDrawings.length;++i){CheckSpPrXfrm(arrDrawings[i]);arrDrawings[i].spPr.xfrm.setOffX(arrDrawings[i].x- min_x);arrDrawings[i].spPr.xfrm.setOffY(arrDrawings[i].y-min_y);arrDrawings[i].setGroup(group);group.addToSpTree(group.spTree.length,arrDrawings[i])}group.setBDeleted(false);return group},unGroup:function(){this.checkSelectedObjectsAndCallback(this.unGroupCallback,null,false,AscDFH.historydescription_CommonControllerUnGroup)},getSelectedObjectsBounds:function(isTextSelectionUse){if((!this.getTargetDocContent()||true===isTextSelectionUse)&&this.selectedObjects.length>0){var nPageIndex,aDrawings,oRes, aSelectedCopy,i;if(this.selection.groupSelection){aDrawings=this.selection.groupSelection.selectedObjects;nPageIndex=this.selection.groupSelection.selectStartPage}else{aSelectedCopy=[].concat(this.selectedObjects);aSelectedCopy.sort(function(a,b){return a.selectStartPage-b.selectStartPage});nPageIndex=aSelectedCopy[0].selectStartPage;aDrawings=[];for(i=0;i<aSelectedCopy.length;++i)if(nPageIndex===aSelectedCopy[i].selectStartPage)aDrawings.push(aSelectedCopy[i]);else break}oRes=getAbsoluteRectBoundsArr(aDrawings); oRes.pageIndex=nPageIndex;return oRes}return null},unGroupCallback:function(){var ungroup_arr=this.canUnGroup(true),aGraphicObjects;if(ungroup_arr.length>0){this.resetSelection();var i,j,cur_group,sp_tree,sp,nInsertPos;for(i=0;i<ungroup_arr.length;++i){cur_group=ungroup_arr[i];cur_group.normalize();aGraphicObjects=this.getDrawingObjects();nInsertPos=undefined;for(j=0;j<aGraphicObjects.length;++j)if(aGraphicObjects[j]===cur_group){nInsertPos=j;break}sp_tree=cur_group.spTree;var xc,yc;for(j=0;j<sp_tree.length;++j){sp= sp_tree[j];sp.spPr.xfrm.setRot(AscFormat.normalizeRotate(sp.rot+cur_group.rot));xc=sp.transform.TransformPointX(sp.extX/2,sp.extY/2);yc=sp.transform.TransformPointY(sp.extX/2,sp.extY/2);sp.spPr.xfrm.setOffX(xc-sp.extX/2);sp.spPr.xfrm.setOffY(yc-sp.extY/2);sp.spPr.xfrm.setFlipH(cur_group.spPr.xfrm.flipH===true?!(sp.spPr.xfrm.flipH===true):sp.spPr.xfrm.flipH===true);sp.spPr.xfrm.setFlipV(cur_group.spPr.xfrm.flipV===true?!(sp.spPr.xfrm.flipV===true):sp.spPr.xfrm.flipV===true);sp.setGroup(null);if(sp.spPr.Fill&& sp.spPr.Fill.fill&&sp.spPr.Fill.fill.type===Asc.c_oAscFill.FILL_TYPE_GRP&&cur_group.spPr&&cur_group.spPr.Fill)sp.spPr.setFill(cur_group.spPr.Fill.createDuplicate());if(AscFormat.isRealNumber(nInsertPos))sp.addToDrawingObjects(nInsertPos+j);else sp.addToDrawingObjects();sp.checkDrawingBaseCoords();this.selectObject(sp,0)}cur_group.setBDeleted(true);cur_group.deleteDrawingBase()}}},canUnGroup:function(bRetArray){var _arr_selected_objects=this.selectedObjects;var ret_array=[];for(var _index=0;_index< _arr_selected_objects.length;++_index)if(_arr_selected_objects[_index].getObjectType()===AscDFH.historyitem_type_GroupShape&&_arr_selected_objects[_index].canUnGroup()&&(!_arr_selected_objects[_index].parent||_arr_selected_objects[_index].parent&&(!_arr_selected_objects[_index].parent.Is_Inline||!_arr_selected_objects[_index].parent.Is_Inline()))){if(!(bRetArray===true))return true;ret_array.push(_arr_selected_objects[_index])}return bRetArray===true?ret_array:false},startTrackNewShape:function(presetGeom){switch(presetGeom){case "spline":{this.changeCurrentState(new AscFormat.SplineBezierState(this)); break}case "polyline1":{this.changeCurrentState(new AscFormat.PolyLineAddState(this));break}case "polyline2":{this.changeCurrentState(new AscFormat.AddPolyLine2State(this));break}default:{this.changeCurrentState(new AscFormat.StartAddNewShape(this,presetGeom));break}}},endTrackNewShape:function(){this.curState.bStart=this.curState.bStart!==false;var bRet=AscFormat.StartAddNewShape.prototype.onMouseUp.call(this.curState,{ClickCount:1,X:0,Y:0},0,0,0);if(bRet===false&&this.document){var oElement=this.document.Content[this.document.CurPos.ContentPos]; if(oElement){var oParagraph=oElement.GetCurrentParagraph();if(oParagraph){oParagraph.MoveCursorToStartPos(false);oParagraph.Document_SetThisElementCurrent(true)}}}},resetTracking:function(){this.changeCurrentState(new AscFormat.NullState(this));this.clearTrackObjects();this.updateOverlay()},getHyperlinkInfo:function(){var content=this.getTargetDocContent();if(content)if(true===content.Selection.Use&&content.Selection.StartPos==content.Selection.EndPos||false==content.Selection.Use){var paragraph; if(true==content.Selection.Use)paragraph=content.Content[content.Selection.StartPos];else paragraph=content.Content[content.CurPos.ContentPos];var HyperPos=-1;if(true===paragraph.Selection.Use){var StartPos=paragraph.Selection.StartPos;var EndPos=paragraph.Selection.EndPos;if(StartPos>EndPos){StartPos=paragraph.Selection.EndPos;EndPos=paragraph.Selection.StartPos}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Element=paragraph.Content[CurPos];if(true!==Element.IsSelectionEmpty()&¶_Hyperlink!== Element.Type)break;else if(true!==Element.IsSelectionEmpty()&¶_Hyperlink===Element.Type)if(-1===HyperPos)HyperPos=CurPos;else break}if(paragraph.Selection.StartPos===paragraph.Selection.EndPos&¶_Hyperlink===paragraph.Content[paragraph.Selection.StartPos].Type)HyperPos=paragraph.Selection.StartPos}else if(para_Hyperlink===paragraph.Content[paragraph.CurPos.ContentPos].Type)HyperPos=paragraph.CurPos.ContentPos;if(-1!==HyperPos)return paragraph.Content[HyperPos]}return null},setSelectionState:function(state, stateIndex){if(!Array.isArray(state))return;var _state_index=AscFormat.isRealNumber(stateIndex)?stateIndex:state.length-1;var selection_state=state[_state_index];this.clearPreTrackObjects();this.clearTrackObjects();this.resetSelection(undefined,true,undefined);this.changeCurrentState(new AscFormat.NullState(this));if(selection_state.textObject&&!selection_state.textObject.bDeleted){this.selectObject(selection_state.textObject,selection_state.selectStartPage);this.selection.textSelection=selection_state.textObject; if(selection_state.textObject.getObjectType()===AscDFH.historyitem_type_GraphicFrame)selection_state.textObject.graphicObject.SetSelectionState(selection_state.textSelection,selection_state.textSelection.length-1);else selection_state.textObject.getDocContent().SetSelectionState(selection_state.textSelection,selection_state.textSelection.length-1)}else if(selection_state.groupObject&&!selection_state.groupObject.bDeleted){this.selectObject(selection_state.groupObject,selection_state.selectStartPage); this.selection.groupSelection=selection_state.groupObject;selection_state.groupObject.setSelectionState(selection_state.groupSelection)}else if(selection_state.chartObject&&!selection_state.chartObject.bDeleted){this.selectObject(selection_state.chartObject,selection_state.selectStartPage);this.selection.chartSelection=selection_state.chartObject;selection_state.chartObject.setSelectionState(selection_state.chartSelection)}else if(selection_state.wrapObject&&!selection_state.wrapObject.bDeleted){this.selectObject(selection_state.wrapObject, selection_state.selectStartPage);this.selection.wrapPolygonSelection=selection_state.wrapObject}else if(selection_state.cropObject&&!selection_state.cropObject.bDeleted){this.selectObject(selection_state.cropObject,selection_state.selectStartPage);this.selection.cropSelection=selection_state.cropObject;this.sendCropState();if(this.selection.cropSelection)this.selection.cropSelection.cropObject=null}else if(Array.isArray(selection_state.selection))for(var i=0;i<selection_state.selection.length;++i)if(!selection_state.selection[i].object.bDeleted)this.selectObject(selection_state.selection[i].object, selection_state.selection[i].pageIndex)},getSelectionState:function(){var selection_state={};if(this.selection.textSelection){selection_state.focus=true;selection_state.textObject=this.selection.textSelection;selection_state.selectStartPage=this.selection.textSelection.selectStartPage;if(this.selection.textSelection.getObjectType()===AscDFH.historyitem_type_GraphicFrame)selection_state.textSelection=this.selection.textSelection.graphicObject.GetSelectionState();else selection_state.textSelection= this.selection.textSelection.getDocContent().GetSelectionState()}else if(this.selection.groupSelection){selection_state.focus=true;selection_state.groupObject=this.selection.groupSelection;selection_state.selectStartPage=this.selection.groupSelection.selectStartPage;selection_state.groupSelection=this.selection.groupSelection.getSelectionState()}else if(this.selection.chartSelection){selection_state.focus=true;selection_state.chartObject=this.selection.chartSelection;selection_state.selectStartPage= this.selection.chartSelection.selectStartPage;selection_state.chartSelection=this.selection.chartSelection.getSelectionState()}else if(this.selection.wrapPolygonSelection){selection_state.focus=true;selection_state.wrapObject=this.selection.wrapPolygonSelection;selection_state.selectStartPage=this.selection.wrapPolygonSelection.selectStartPage}else if(this.selection.cropSelection){selection_state.focus=true;selection_state.cropObject=this.selection.cropSelection;selection_state.cropImage=this.selection.cropSelection.cropObject; selection_state.selectStartPage=this.selection.cropSelection.selectStartPage}else{selection_state.focus=this.selectedObjects.length>0;selection_state.selection=[];for(var i=0;i<this.selectedObjects.length;++i)selection_state.selection.push({object:this.selectedObjects[i],pageIndex:this.selectedObjects[i].selectStartPage})}if(this.drawingObjects&&this.drawingObjects.getWorksheet){var worksheetView=this.drawingObjects.getWorksheet();if(worksheetView)selection_state.worksheetId=worksheetView.model.getId()}return[selection_state]}, Save_DocumentStateBeforeLoadChanges:function(oState){var oTargetDocContent=this.getTargetDocContent(undefined,true);if(oTargetDocContent){oState.Pos=oTargetDocContent.GetContentPosition(false,false,undefined);oState.StartPos=oTargetDocContent.GetContentPosition(true,true,undefined);oState.EndPos=oTargetDocContent.GetContentPosition(true,false,undefined);oState.DrawingSelection=oTargetDocContent.Selection.Use}oState.DrawingsSelectionState=this.getSelectionState()[0]},loadDocumentStateAfterLoadChanges:function(oSelectionState, PageIndex){var bDocument=isRealObject(this.document),bNeedRecalculateCurPos=false;var nPageIndex=0;var bSlide=false;if(AscFormat.isRealNumber(PageIndex))nPageIndex=PageIndex;else if(!bDocument)if(this.drawingObjects.getObjectType&&this.drawingObjects.getObjectType()===AscDFH.historyitem_type_Slide){nPageIndex=0;bSlide=true}if(oSelectionState&&oSelectionState.DrawingsSelectionState){var oDrawingSelectionState=oSelectionState.DrawingsSelectionState;if(oDrawingSelectionState.textObject){if(oDrawingSelectionState.textObject.Is_UseInDocument()&& (!oDrawingSelectionState.textObject.group||oDrawingSelectionState.textObject.group===this)&&(!bSlide||oDrawingSelectionState.textObject.parent===this.drawingObjects)){this.selectObject(oDrawingSelectionState.textObject,bDocument?oDrawingSelectionState.textObject.parent?oDrawingSelectionState.textObject.parent.PageNum:nPageIndex:nPageIndex);var oDocContent;var Depth=0;if(oDrawingSelectionState.textObject instanceof AscFormat.CGraphicFrame)oDocContent=oDrawingSelectionState.textObject.graphicObject; else oDocContent=oDrawingSelectionState.textObject.getDocContent();if(oDocContent){if(true===oSelectionState.DrawingSelection){oDocContent.SetContentPosition(oSelectionState.StartPos,Depth,0);oDocContent.SetContentSelection(oSelectionState.StartPos,oSelectionState.EndPos,Depth,0,0)}else{oDocContent.SetContentPosition(oSelectionState.Pos,0,0);bNeedRecalculateCurPos=true}this.selection.textSelection=oDrawingSelectionState.textObject}}}else if(oDrawingSelectionState.groupObject){if(oDrawingSelectionState.groupObject.Is_UseInDocument()&& !oDrawingSelectionState.groupObject.group&&(!bSlide||oDrawingSelectionState.groupObject.parent===this.drawingObjects)){this.selectObject(oDrawingSelectionState.groupObject,bDocument?oDrawingSelectionState.groupObject.parent?oDrawingSelectionState.groupObject.parent.PageNum:nPageIndex:nPageIndex);oDrawingSelectionState.groupObject.resetSelection(this);var oState={DrawingsSelectionState:oDrawingSelectionState.groupSelection,Pos:oSelectionState.Pos,StartPos:oSelectionState.StartPos,EndPos:oSelectionState.EndPos, DrawingSelection:oSelectionState.DrawingSelection};if(oDrawingSelectionState.groupObject.loadDocumentStateAfterLoadChanges(oState,nPageIndex)){this.selection.groupSelection=oDrawingSelectionState.groupObject;if(!oSelectionState.DrawingSelection)bNeedRecalculateCurPos=true}}}else if(oDrawingSelectionState.chartObject){if(oDrawingSelectionState.chartObject.Is_UseInDocument()&&(!bSlide||oDrawingSelectionState.chartObject.parent===this.drawingObjects)){this.selectObject(oDrawingSelectionState.chartObject, bDocument?oDrawingSelectionState.chartObject.parent?oDrawingSelectionState.chartObject.parent.PageNum:nPageIndex:nPageIndex);oDrawingSelectionState.chartObject.resetSelection(undefined,true,undefined);if(oDrawingSelectionState.chartObject.loadDocumentStateAfterLoadChanges(oSelectionState)){this.selection.chartSelection=oDrawingSelectionState.chartObject;if(!oSelectionState.DrawingSelection)bNeedRecalculateCurPos=true}}}else if(oDrawingSelectionState.wrapObject){if(oDrawingSelectionState.wrapObject.parent&& oDrawingSelectionState.wrapObject.parent.Is_UseInDocument&&oDrawingSelectionState.wrapObject.parent.Is_UseInDocument()){this.selectObject(oDrawingSelectionState.wrapObject,oDrawingSelectionState.wrapObject.parent.PageNum);if(oDrawingSelectionState.wrapObject.canChangeWrapPolygon&&oDrawingSelectionState.wrapObject.canChangeWrapPolygon()&&!oDrawingSelectionState.wrapObject.parent.Is_Inline())this.selection.wrapPolygonSelection=oDrawingSelectionState.wrapObject}}else if(oDrawingSelectionState.cropObject){if(oDrawingSelectionState.cropObject.Is_UseInDocument()&& (!bSlide||oDrawingSelectionState.cropObject.parent===this.drawingObjects)){this.selectObject(oDrawingSelectionState.cropObject,bDocument?oDrawingSelectionState.cropObject.parent?oDrawingSelectionState.cropObject.parent.PageNum:nPageIndex:nPageIndex);this.selection.cropSelection=oDrawingSelectionState.cropObject;this.sendCropState();if(this.selection.cropSelection)this.selection.cropSelection.cropObject=oDrawingSelectionState.cropImage;if(!oSelectionState.DrawingSelection)bNeedRecalculateCurPos=true}}else for(var i= 0;i<oDrawingSelectionState.selection.length;++i){var oSp=oDrawingSelectionState.selection[i].object;if(oSp.Is_UseInDocument()&&!oSp.group&&(!bSlide||oSp.parent===this.drawingObjects))this.selectObject(oSp,bDocument?oSp.parent?oSp.parent.PageNum:nPageIndex:nPageIndex)}}if(this.document&&bNeedRecalculateCurPos){this.document.NeedUpdateTarget=true;this.document.RecalculateCurPos()}return this.selectedObjects.length>0},drawTracks:function(overlay){for(var i=0;i<this.arrTrackObjects.length;++i)this.arrTrackObjects[i].draw(overlay)}, DrawOnOverlay:function(overlay){this.drawTracks(overlay)},needUpdateOverlay:function(){return this.arrTrackObjects.length>0},drawSelection:function(drawingDocument){DrawingObjectsController.prototype.drawSelect.call(this,0,drawingDocument)},getTargetTransform:function(){var oRet=null;if(this.selection.textSelection)oRet=this.selection.textSelection.transformText;else if(this.selection.groupSelection)if(this.selection.groupSelection.selection.textSelection)oRet=this.selection.groupSelection.selection.textSelection.transformText; else{if(this.selection.groupSelection.selection.chartSelection&&this.selection.groupSelection.selection.chartSelection.selection.textSelection)oRet=this.selection.groupSelection.selection.chartSelection.selection.textSelection.transformText}else if(this.selection.chartSelection&&this.selection.chartSelection.selection.textSelection)oRet=this.selection.chartSelection.selection.textSelection.transformText;if(oRet){oRet=oRet.CreateDublicate();return oRet}return new AscCommon.CMatrix},drawTextSelection:function(num){var content= this.getTargetDocContent(undefined,true);if(content){this.drawingObjects.getDrawingDocument().UpdateTargetTransform(this.getTargetTransform());content.DrawSelectionOnPage(0)}},getSelectedObjects:function(){return this.selectedObjects},getSelectedArray:function(){if(this.selection.groupSelection)return this.selection.groupSelection.selectedObjects;return this.selectedObjects},getDrawingPropsFromArray:function(drawings){var image_props,shape_props,chart_props,table_props=undefined,new_image_props,new_shape_props, new_chart_props,new_table_props,shape_chart_props,locked;var drawing;var slicer_props,new_slicer_props;for(var i=0;i<drawings.length;++i){drawing=drawings[i];locked=undefined;if(!drawing.group){locked=drawing.lockType!==c_oAscLockTypes.kLockTypeNone&&drawing.lockType!==c_oAscLockTypes.kLockTypeMine;if(typeof editor!=="undefined"&&isRealObject(editor)&&editor.isPresentationEditor)if(drawing.Lock)locked=drawing.Lock.Is_Locked()}else{var oParentGroup=drawing.group.getMainGroup();if(oParentGroup){locked= oParentGroup.lockType!==c_oAscLockTypes.kLockTypeNone&&oParentGroup.lockType!==c_oAscLockTypes.kLockTypeMine;if(typeof editor!=="undefined"&&isRealObject(editor)&&editor.isPresentationEditor)if(oParentGroup.Lock)locked=oParentGroup.Lock.Is_Locked()}}var lockAspect=drawing.getNoChangeAspect();switch(drawing.getObjectType()){case AscDFH.historyitem_type_Shape:case AscDFH.historyitem_type_Cnx:{new_shape_props={canFill:drawing.canFill(),type:drawing.getPresetGeom(),fill:drawing.getFill(),stroke:drawing.getStroke(), paddings:drawing.getPaddings(),verticalTextAlign:drawing.getBodyPr().anchor,vert:drawing.getBodyPr().vert,w:drawing.extX,h:drawing.extY,rot:drawing.rot,flipH:drawing.flipH,flipV:drawing.flipV,canChangeArrows:drawing.canChangeArrows(),bFromChart:false,locked:locked,textArtProperties:drawing.getTextArtProperties(),lockAspect:lockAspect,title:drawing.getTitle(),description:drawing.getDescription(),columnNumber:drawing.getColumnNumber(),columnSpace:drawing.getColumnSpace(),textFitType:drawing.getTextFitType(), vertOverflowType:drawing.getVertOverflowType(),signatureId:drawing.getSignatureLineGuid(),shadow:drawing.getOuterShdw(),anchor:drawing.getDrawingBaseType()};if(!shape_props)shape_props=new_shape_props;else shape_props=AscFormat.CompareShapeProperties(shape_props,new_shape_props);break}case AscDFH.historyitem_type_ImageShape:{new_image_props={ImageUrl:drawing.getImageUrl(),w:drawing.extX,h:drawing.extY,rot:drawing.rot,flipH:drawing.flipH,flipV:drawing.flipV,locked:locked,x:drawing.x,y:drawing.y,lockAspect:lockAspect, title:drawing.getTitle(),description:drawing.getDescription(),anchor:drawing.getDrawingBaseType()};if(!image_props)image_props=new_image_props;else{if(image_props.ImageUrl!==null&&image_props.ImageUrl!==new_image_props.ImageUrl)image_props.ImageUrl=null;if(image_props.w!=null&&image_props.w!==new_image_props.w)image_props.w=null;if(image_props.h!=null&&image_props.h!==new_image_props.h)image_props.h=null;if(image_props.x!=null&&image_props.x!==new_image_props.x)image_props.x=null;if(image_props.y!= null&&image_props.y!==new_image_props.y)image_props.y=null;if(image_props.rot!=null&&image_props.rot!==new_image_props.rot)image_props.rot=null;if(image_props.flipH!=null&&image_props.flipH!==new_image_props.flipH)image_props.flipH=null;if(image_props.flipV!=null&&image_props.flipV!==new_image_props.flipV)image_props.flipV=null;if(image_props.locked||new_image_props.locked)image_props.locked=true;if(image_props.lockAspect||new_image_props.lockAspect)image_props.lockAspect=false;if(image_props.title!== new_image_props.title)image_props.title=undefined;if(image_props.description!==new_image_props.description)image_props.description=undefined;if(image_props.anchor!==new_image_props.anchor)image_props.anchor=undefined}new_shape_props={canFill:false,type:drawing.getPresetGeom(),fill:drawing.getFill(),stroke:drawing.getStroke(),paddings:null,verticalTextAlign:null,vert:null,w:drawing.extX,h:drawing.extY,rot:drawing.rot,flipH:drawing.flipH,flipV:drawing.flipV,canChangeArrows:drawing.canChangeArrows(), bFromChart:false,bFromImage:true,locked:locked,textArtProperties:null,lockAspect:lockAspect,title:drawing.getTitle(),description:drawing.getDescription(),columnNumber:null,columnSpace:null,textFitType:null,vertOverflowType:null,signatureId:null,shadow:drawing.getOuterShdw(),anchor:drawing.getDrawingBaseType()};if(!shape_props)shape_props=new_shape_props;else shape_props=AscFormat.CompareShapeProperties(shape_props,new_shape_props);break}case AscDFH.historyitem_type_OleObject:{var pluginData=new Asc.CPluginData; pluginData.setAttribute("data",drawing.m_sData);pluginData.setAttribute("guid",drawing.m_sApplicationId);pluginData.setAttribute("width",drawing.extX);pluginData.setAttribute("height",drawing.extY);pluginData.setAttribute("widthPix",drawing.m_nPixWidth);pluginData.setAttribute("heightPix",drawing.m_nPixHeight);pluginData.setAttribute("objectId",drawing.Id);new_image_props={ImageUrl:drawing.getImageUrl(),w:drawing.extX,h:drawing.extY,locked:locked,x:drawing.x,y:drawing.y,lockAspect:lockAspect,pluginGuid:drawing.m_sApplicationId, pluginData:pluginData,oleWidth:drawing.m_fDefaultSizeX,oleHeight:drawing.m_fDefaultSizeY,title:drawing.getTitle(),description:drawing.getDescription(),anchor:drawing.getDrawingBaseType()};if(!image_props)image_props=new_image_props;else{image_props.ImageUrl=null;if(image_props.w!=null&&image_props.w!==new_image_props.w)image_props.w=null;if(image_props.h!=null&&image_props.h!==new_image_props.h)image_props.h=null;if(image_props.x!=null&&image_props.x!==new_image_props.x)image_props.x=null;if(image_props.y!= null&&image_props.y!==new_image_props.y)image_props.y=null;if(image_props.locked||new_image_props.locked)image_props.locked=true;if(image_props.lockAspect||new_image_props.lockAspect)image_props.lockAspect=false;image_props.pluginGuid=null;image_props.pluginData=undefined;image_props.oleWidth=undefined;image_props.oleHeight=undefined;if(image_props.title!==new_image_props.title)image_props.title=undefined;if(image_props.description!==new_image_props.description)image_props.description=undefined;if(image_props.anchor!== new_image_props.anchor)image_props.anchor=undefined}break}case AscDFH.historyitem_type_ChartSpace:{var type_subtype=drawing.getTypeSubType();new_chart_props={type:type_subtype.type,subtype:type_subtype.subtype,styleId:drawing.style,w:drawing.extX,h:drawing.extY,locked:locked,lockAspect:lockAspect,title:drawing.getTitle(),description:drawing.getDescription(),anchor:drawing.getDrawingBaseType()};if(!chart_props){chart_props=new_chart_props;chart_props.chartProps=this.getPropsFromChart(drawing);chart_props.severalCharts= false;chart_props.severalChartStyles=false;chart_props.severalChartTypes=false}else{chart_props.chartProps=null;chart_props.severalCharts=true;if(!chart_props.severalChartStyles)chart_props.severalChartStyles=chart_props.styleId!==new_chart_props.styleId;if(!chart_props.severalChartTypes)chart_props.severalChartTypes=chart_props.type!==new_chart_props.type;if(chart_props.w!=null&&chart_props.w!==new_chart_props.w)chart_props.w=null;if(chart_props.h!=null&&chart_props.h!==new_chart_props.h)chart_props.h= null;if(chart_props.locked||new_chart_props.locked)chart_props.locked=true;if(!chart_props.lockAspect||!new_chart_props.lockAspect)chart_props.locked=false;if(chart_props.title!==new_chart_props.title)chart_props.title=undefined;if(chart_props.description!==new_chart_props.description)chart_props.description=undefined;if(chart_props.anchor!==new_chart_props.anchor)chart_props.anchor=undefined}new_shape_props={canFill:drawing.canFill(),type:null,fill:drawing.getFill(),stroke:drawing.getStroke(),paddings:null, verticalTextAlign:null,vert:null,w:drawing.extX,h:drawing.extY,canChangeArrows:false,bFromChart:true,locked:locked,textArtProperties:null,lockAspect:lockAspect,title:drawing.getTitle(),description:drawing.getDescription(),signatureId:drawing.getSignatureLineGuid(),anchor:drawing.getDrawingBaseType()};if(!shape_props)shape_props=new_shape_props;else shape_props=AscFormat.CompareShapeProperties(shape_props,new_shape_props);if(!shape_chart_props)shape_chart_props=new_shape_props;else shape_chart_props= AscFormat.CompareShapeProperties(shape_chart_props,new_shape_props);break}case AscDFH.historyitem_type_SlicerView:{var oSlicer=drawing.getSlicer();var oSlicerCopy=oSlicer?oSlicer.clone():null;if(oSlicerCopy)oSlicerCopy.asc_setButtonWidth(drawing.getButtonWidth());new_slicer_props={w:drawing.extX,h:drawing.extY,x:drawing.x,y:drawing.y,locked:locked,lockAspect:lockAspect,title:drawing.getTitle(),description:drawing.getDescription(),anchor:drawing.getDrawingBaseType(),slicerProps:oSlicerCopy};if(!slicer_props)slicer_props= new_slicer_props;else{if(slicer_props.slicerProps!=null)if(!new_slicer_props.slicerProps)slicer_props.slicerProps=null;else slicer_props.slicerProps.merge(new_slicer_props.slicerProps);if(slicer_props.w!=null&&slicer_props.w!==new_slicer_props.w)slicer_props.w=null;if(slicer_props.h!=null&&slicer_props.h!==new_slicer_props.h)slicer_props.h=null;if(slicer_props.x!=null&&slicer_props.x!==new_slicer_props.x)slicer_props.x=null;if(slicer_props.y!=null&&slicer_props.y!==new_slicer_props.y)slicer_props.y= null;if(slicer_props.locked||new_slicer_props.locked)slicer_props.locked=true;if(!slicer_props.lockAspect||!new_slicer_props.lockAspect)slicer_props.locked=false;if(slicer_props.title!==new_slicer_props.title)slicer_props.title=undefined;if(slicer_props.description!==new_slicer_props.description)slicer_props.description=undefined;if(slicer_props.anchor!==new_slicer_props.anchor)slicer_props.anchor=undefined}break}case AscDFH.historyitem_type_GraphicFrame:{if(table_props===undefined){new_table_props= drawing.graphicObject.Get_Props();table_props=new_table_props;new_table_props.Locked=locked;if(new_table_props.CellsBackground)if(new_table_props.CellsBackground.Unifill&&new_table_props.CellsBackground.Unifill.fill&&new_table_props.CellsBackground.Unifill.fill.type!==c_oAscFill.FILL_TYPE_NONE){new_table_props.CellsBackground.Unifill.check(drawing.Get_Theme(),drawing.Get_ColorMap());var RGBA=new_table_props.CellsBackground.Unifill.getRGBAColor();new_table_props.CellsBackground.Color=new CDocumentColor(RGBA.R, RGBA.G,RGBA.B,false);new_table_props.CellsBackground.Value=Asc.c_oAscShdClear}else{new_table_props.CellsBackground.Color=new CDocumentColor(0,0,0,false);new_table_props.CellsBackground.Value=Asc.c_oAscShdNil}if(new_table_props.CellBorders){var checkBorder=function(border){if(!border)return;if(border.Unifill&&border.Unifill.fill&&border.Unifill.fill.type!==c_oAscFill.FILL_TYPE_NONE){border.Unifill.check(drawing.Get_Theme(),drawing.Get_ColorMap());var RGBA=border.Unifill.getRGBAColor();border.Color= new CDocumentColor(RGBA.R,RGBA.G,RGBA.B,false);border.Value=border_Single}else{border.Color=new CDocumentColor(0,0,0,false);border.Value=border_Single}};checkBorder(new_table_props.CellBorders.Top);checkBorder(new_table_props.CellBorders.Bottom);checkBorder(new_table_props.CellBorders.Right);checkBorder(new_table_props.CellBorders.Left)}new_table_props.TableDescription=drawing.getDescription();new_table_props.TableCaption=drawing.getTitle()}else table_props=null;break}case AscDFH.historyitem_type_GroupShape:{var anchor= drawing.getDrawingBaseType();var group_drawing_props=this.getDrawingPropsFromArray(drawing.spTree);if(group_drawing_props.shapeProps){group_drawing_props.shapeProps.anchor=anchor;if(!shape_props)shape_props=group_drawing_props.shapeProps;else shape_props=AscFormat.CompareShapeProperties(shape_props,group_drawing_props.shapeProps)}if(group_drawing_props.shapeChartProps){group_drawing_props.shapeChartProps.anchor=anchor;if(!shape_chart_props)shape_chart_props=group_drawing_props.shapeChartProps;else shape_chart_props= AscFormat.CompareShapeProperties(shape_chart_props,group_drawing_props.shapeChartProps)}if(group_drawing_props.imageProps){group_drawing_props.imageProps.anchor=anchor;if(!image_props)image_props=group_drawing_props.imageProps;else{if(image_props.ImageUrl!==null&&image_props.ImageUrl!==group_drawing_props.imageProps.ImageUrl)image_props.ImageUrl=null;if(image_props.w!=null&&image_props.w!==group_drawing_props.imageProps.w)image_props.w=null;if(image_props.h!=null&&image_props.h!==group_drawing_props.imageProps.h)image_props.h= null;if(image_props.x!=null&&image_props.x!==group_drawing_props.imageProps.x)image_props.x=null;if(image_props.y!=null&&image_props.y!==group_drawing_props.imageProps.y)image_props.y=null;if(image_props.rot!=null&&image_props.rot!==group_drawing_props.imageProps.rot)image_props.rot=null;if(image_props.flipH!=null&&image_props.flipH!==group_drawing_props.imageProps.flipH)image_props.flipH=null;if(image_props.flipV!=null&&image_props.flipV!==group_drawing_props.imageProps.flipV)image_props.flipV=null; if(image_props.locked||group_drawing_props.imageProps.locked)image_props.locked=true;if(!image_props.lockAspect||!group_drawing_props.imageProps.lockAspect)image_props.lockAspect=false;if(image_props.title!==group_drawing_props.imageProps.title)image_props.title=undefined;if(image_props.description!==group_drawing_props.imageProps.description)image_props.description=undefined}}if(group_drawing_props.chartProps){group_drawing_props.chartProps.anchor=anchor;if(!chart_props)chart_props=group_drawing_props.chartProps; else{chart_props.chartProps=null;chart_props.severalCharts=true;if(!chart_props.severalChartStyles)chart_props.severalChartStyles=chart_props.styleId!==group_drawing_props.chartProps.styleId;if(!chart_props.severalChartTypes)chart_props.severalChartTypes=chart_props.type!==group_drawing_props.chartProps.type;if(chart_props.w!=null&&chart_props.w!==group_drawing_props.chartProps.w)chart_props.w=null;if(chart_props.h!=null&&chart_props.h!==group_drawing_props.chartProps.h)chart_props.h=null;if(chart_props.title!== group_drawing_props.title)chart_props.title=undefined;if(chart_props.description!==group_drawing_props.chartProps.description)chart_props.description=undefined;if(chart_props.locked||group_drawing_props.chartProps.locked)chart_props.locked=true}}if(group_drawing_props.tableProps)if(!table_props)table_props=group_drawing_props.tableProps;else table_props=null;break}}}if(shape_props&&shape_props.textArtProperties){var oTextArtProperties=shape_props.textArtProperties;var oTextPr=this.getParagraphTextPr(); if(oTextPr){if(oTextPr.TextFill)oTextArtProperties.Fill=oTextPr.TextFill;else if(oTextPr.Unifill)oTextArtProperties.Fill=oTextPr.Unifill;else if(oTextPr.Color)oTextArtProperties.Fill=AscFormat.CreateUnfilFromRGB(oTextPr.Color.r,oTextPr.Color.g,oTextPr.Color.b);if(oTextPr.TextOutline)oTextArtProperties.Line=oTextPr.TextOutline;else oTextArtProperties.Line=AscFormat.CreateNoFillLine();if(oTextArtProperties.Fill)oTextArtProperties.Fill.check(this.getTheme(),this.getColorMap());if(oTextArtProperties.Line&& oTextArtProperties.Line.Fill)oTextArtProperties.Line.Fill.check(this.getTheme(),this.getColorMap())}}return{imageProps:image_props,shapeProps:shape_props,chartProps:chart_props,tableProps:table_props,shapeChartProps:shape_chart_props,slicerProps:slicer_props}},getDrawingProps:function(){if(this.selection.groupSelection)return this.getDrawingPropsFromArray(this.selection.groupSelection.selectedObjects);return this.getDrawingPropsFromArray(this.selectedObjects)},getEditorApi:function(){if(window["Asc"]&& window["Asc"]["editor"])return window["Asc"]["editor"];else return editor},getGraphicObjectProps:function(){var props=this.getDrawingProps();var api=this.getEditorApi();var shape_props,image_props,chart_props,slicer_props;var ascSelectedObjects=[];var ret=[],i,bParaLocked=false;var oDrawingDocument=this.drawingObjects&&this.drawingObjects.drawingDocument;if(isRealObject(props.shapeChartProps)){shape_props=new Asc.asc_CImgProperty;shape_props.fromGroup=props.shapeChartProps.fromGroup;shape_props.ShapeProperties= new Asc.asc_CShapeProperty;shape_props.ShapeProperties.type=props.shapeChartProps.type;shape_props.ShapeProperties.fill=props.shapeChartProps.fill;shape_props.ShapeProperties.stroke=props.shapeChartProps.stroke;shape_props.ShapeProperties.canChangeArrows=props.shapeChartProps.canChangeArrows;shape_props.ShapeProperties.bFromChart=props.shapeChartProps.bFromChart;shape_props.ShapeProperties.bFromImage=props.shapeChartProps.bFromImage;shape_props.ShapeProperties.lockAspect=props.shapeChartProps.lockAspect; shape_props.ShapeProperties.anchor=props.shapeChartProps.anchor;if(props.shapeChartProps.paddings)shape_props.ShapeProperties.paddings=new Asc.asc_CPaddings(props.shapeChartProps.paddings);shape_props.verticalTextAlign=props.shapeChartProps.verticalTextAlign;shape_props.vert=props.shapeChartProps.vert;shape_props.ShapeProperties.canFill=props.shapeChartProps.canFill;shape_props.Width=props.shapeChartProps.w;shape_props.Height=props.shapeChartProps.h;var pr=shape_props.ShapeProperties;var oTextArtProperties; if(!isRealObject(props.shapeProps)&&oDrawingDocument){if(pr.fill!=null&&pr.fill.fill!=null&&pr.fill.fill.type==c_oAscFill.FILL_TYPE_BLIP){if(api)oDrawingDocument.InitGuiCanvasShape(api.shapeElementId);oDrawingDocument.LastDrawingUrl=null;oDrawingDocument.DrawImageTextureFillShape(pr.fill.fill.RasterImageId)}else{if(api)oDrawingDocument.InitGuiCanvasShape(api.shapeElementId);oDrawingDocument.DrawImageTextureFillShape(null)}if(pr.textArtProperties){oTextArtProperties=pr.textArtProperties;if(oTextArtProperties&& oTextArtProperties.Fill&&oTextArtProperties.Fill.fill&&oTextArtProperties.Fill.fill.type==c_oAscFill.FILL_TYPE_BLIP){if(api)oDrawingDocument.InitGuiCanvasTextArt(api.textArtElementId);oDrawingDocument.LastDrawingUrlTextArt=null;oDrawingDocument.DrawImageTextureFillTextArt(oTextArtProperties.Fill.fill.RasterImageId)}else oDrawingDocument.DrawImageTextureFillTextArt(null)}}shape_props.ShapeProperties.fill=AscFormat.CreateAscFill(shape_props.ShapeProperties.fill);shape_props.ShapeProperties.stroke=AscFormat.CreateAscStroke(shape_props.ShapeProperties.stroke, shape_props.ShapeProperties.canChangeArrows===true);shape_props.ShapeProperties.stroke.canChangeArrows=shape_props.ShapeProperties.canChangeArrows===true;shape_props.Locked=props.shapeChartProps.locked===true;ret.push(shape_props)}if(isRealObject(props.shapeProps)){shape_props=new Asc.asc_CImgProperty;shape_props.fromGroup=CanStartEditText(this);shape_props.ShapeProperties=new Asc.asc_CShapeProperty;shape_props.ShapeProperties.type=props.shapeProps.type;shape_props.ShapeProperties.fill=props.shapeProps.fill; shape_props.ShapeProperties.stroke=props.shapeProps.stroke;shape_props.ShapeProperties.canChangeArrows=props.shapeProps.canChangeArrows;shape_props.ShapeProperties.bFromChart=props.shapeProps.bFromChart;shape_props.ShapeProperties.bFromImage=props.shapeProps.bFromImage;shape_props.ShapeProperties.lockAspect=props.shapeProps.lockAspect;shape_props.ShapeProperties.description=props.shapeProps.description;shape_props.ShapeProperties.title=props.shapeProps.title;shape_props.ShapeProperties.rot=props.shapeProps.rot; shape_props.ShapeProperties.flipH=props.shapeProps.flipH;shape_props.ShapeProperties.flipV=props.shapeProps.flipV;shape_props.description=props.shapeProps.description;shape_props.title=props.shapeProps.title;shape_props.ShapeProperties.textArtProperties=AscFormat.CreateAscTextArtProps(props.shapeProps.textArtProperties);shape_props.lockAspect=props.shapeProps.lockAspect;shape_props.anchor=props.shapeProps.anchor;shape_props.ShapeProperties.columnNumber=props.shapeProps.columnNumber;shape_props.ShapeProperties.columnSpace= props.shapeProps.columnSpace;shape_props.ShapeProperties.textFitType=props.shapeProps.textFitType;shape_props.ShapeProperties.vertOverflowType=props.shapeProps.vertOverflowType;shape_props.ShapeProperties.shadow=props.shapeProps.shadow;shape_props.ShapeProperties.signatureId=props.shapeProps.signatureId;if(props.shapeProps.textArtProperties&&oDrawingDocument){oTextArtProperties=props.shapeProps.textArtProperties;if(oTextArtProperties&&oTextArtProperties.Fill&&oTextArtProperties.Fill.fill&&oTextArtProperties.Fill.fill.type== c_oAscFill.FILL_TYPE_BLIP){if(api)oDrawingDocument.InitGuiCanvasTextArt(api.textArtElementId);oDrawingDocument.LastDrawingUrlTextArt=null;oDrawingDocument.DrawImageTextureFillTextArt(oTextArtProperties.Fill.fill.RasterImageId)}else oDrawingDocument.DrawImageTextureFillTextArt(null)}if(props.shapeProps.paddings)shape_props.ShapeProperties.paddings=new Asc.asc_CPaddings(props.shapeProps.paddings);shape_props.verticalTextAlign=props.shapeProps.verticalTextAlign;shape_props.vert=props.shapeProps.vert; shape_props.ShapeProperties.canFill=props.shapeProps.canFill;shape_props.Width=props.shapeProps.w;shape_props.Height=props.shapeProps.h;shape_props.rot=props.shapeProps.rot;shape_props.flipH=props.shapeProps.flipH;shape_props.flipV=props.shapeProps.flipV;var pr=shape_props.ShapeProperties;if(oDrawingDocument)if(pr.fill!=null&&pr.fill.fill!=null&&pr.fill.fill.type==c_oAscFill.FILL_TYPE_BLIP){if(api)oDrawingDocument.InitGuiCanvasShape(api.shapeElementId);oDrawingDocument.LastDrawingUrl=null;oDrawingDocument.DrawImageTextureFillShape(pr.fill.fill.RasterImageId)}else{if(api)oDrawingDocument.InitGuiCanvasShape(api.shapeElementId); oDrawingDocument.DrawImageTextureFillShape(null)}shape_props.ShapeProperties.fill=AscFormat.CreateAscFill(shape_props.ShapeProperties.fill);shape_props.ShapeProperties.stroke=AscFormat.CreateAscStroke(shape_props.ShapeProperties.stroke,shape_props.ShapeProperties.canChangeArrows===true);shape_props.ShapeProperties.stroke.canChangeArrows=shape_props.ShapeProperties.canChangeArrows===true;shape_props.Locked=props.shapeProps.locked===true;if(!bParaLocked)bParaLocked=shape_props.Locked;ret.push(shape_props)}if(isRealObject(props.imageProps)){image_props= new Asc.asc_CImgProperty;image_props.Width=props.imageProps.w;image_props.Height=props.imageProps.h;image_props.rot=props.imageProps.rot;image_props.flipH=props.imageProps.flipH;image_props.flipV=props.imageProps.flipV;image_props.ImageUrl=props.imageProps.ImageUrl;image_props.Locked=props.imageProps.locked===true;image_props.lockAspect=props.imageProps.lockAspect;image_props.anchor=props.imageProps.anchor;image_props.pluginGuid=props.imageProps.pluginGuid;image_props.pluginData=props.imageProps.pluginData; image_props.oleWidth=props.imageProps.oleWidth;image_props.oleHeight=props.imageProps.oleHeight;image_props.description=props.imageProps.description;image_props.title=props.imageProps.title;if(!bParaLocked)bParaLocked=image_props.Locked;ret.push(image_props);this.sendCropState()}if(isRealObject(props.chartProps)&&isRealObject(props.chartProps.chartProps)){chart_props=new Asc.asc_CImgProperty;chart_props.Width=props.chartProps.w;chart_props.Height=props.chartProps.h;chart_props.ChartProperties=props.chartProps.chartProps; chart_props.Locked=props.chartProps.locked===true;chart_props.lockAspect=props.chartProps.lockAspect;chart_props.anchor=props.chartProps.anchor;if(!bParaLocked)bParaLocked=chart_props.Locked;chart_props.description=props.chartProps.description;chart_props.title=props.chartProps.title;ret.push(chart_props)}if(isRealObject(props.slicerProps)&&isRealObject(props.slicerProps.slicerProps)){slicer_props=new Asc.asc_CImgProperty;slicer_props.Width=props.slicerProps.w;slicer_props.Height=props.slicerProps.h; slicer_props.SlicerProperties=props.slicerProps.slicerProps;slicer_props.Locked=props.slicerProps.locked===true;slicer_props.lockAspect=props.slicerProps.lockAspect;slicer_props.anchor=props.slicerProps.anchor;slicer_props.Position=new Asc.CPosition({X:props.slicerProps.x,Y:props.slicerProps.y});if(!bParaLocked)bParaLocked=slicer_props.Locked;slicer_props.description=props.slicerProps.description;slicer_props.title=props.slicerProps.title;ret.push(slicer_props)}for(i=0;i<ret.length;i++)ascSelectedObjects.push(new AscCommon.asc_CSelectedObject(Asc.c_oAscTypeSelectElement.Image, new Asc.asc_CImgProperty(ret[i])));var ParaPr=this.getParagraphParaPr();var TextPr=this.getParagraphTextPr();if(ParaPr&&TextPr){var theme=this.getTheme();if(theme&&theme.themeElements&&theme.themeElements.fontScheme){TextPr.ReplaceThemeFonts(theme.themeElements.fontScheme);var oBullet=ParaPr.Bullet;if(oBullet&&oBullet.bulletColor)if(oBullet.bulletColor.UniColor)oBullet.bulletColor.UniColor.check(theme,this.getColorMap());if(TextPr.Unifill)ParaPr.Unifill=TextPr.Unifill}if(bParaLocked)ParaPr.Locked= true;this.prepareParagraphProperties(ParaPr,TextPr,ascSelectedObjects)}var oTargetDocContent=this.getTargetDocContent(false,false);if(oTargetDocContent)if(true===oTargetDocContent.Selection.Use&&oTargetDocContent.Selection.StartPos==oTargetDocContent.Selection.EndPos&&type_Paragraph==oTargetDocContent.Content[oTargetDocContent.Selection.StartPos].GetType()||false==oTargetDocContent.Selection.Use&&type_Paragraph==oTargetDocContent.Content[oTargetDocContent.CurPos.ContentPos].GetType()){var oParagraph; if(true==oTargetDocContent.Selection.Use)oParagraph=oTargetDocContent.Content[oTargetDocContent.Selection.StartPos];else oParagraph=oTargetDocContent.Content[oTargetDocContent.CurPos.ContentPos];if(true===oParagraph.Selection.Use){var StartPos=oParagraph.Selection.StartPos;var EndPos=oParagraph.Selection.EndPos;if(StartPos>EndPos){StartPos=oParagraph.Selection.EndPos;EndPos=oParagraph.Selection.StartPos}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Element=oParagraph.Content[CurPos];if(true!== Element.IsSelectionEmpty()&¶_Math===Element.Type)ascSelectedObjects.push(new AscCommon.asc_CSelectedObject(Asc.c_oAscTypeSelectElement.Math,Element.Get_MenuProps()))}}else{var CurType=oParagraph.Content[oParagraph.CurPos.ContentPos].Type;if(para_Math===CurType)ascSelectedObjects.push(new AscCommon.asc_CSelectedObject(Asc.c_oAscTypeSelectElement.Math,oParagraph.Content[oParagraph.CurPos.ContentPos].Get_MenuProps()))}}return ascSelectedObjects},prepareParagraphProperties:function(ParaPr,TextPr, ascSelectedObjects){var _this=this;var trigger=this.drawingObjects.callTrigger;ParaPr.Subscript=TextPr.VertAlign===AscCommon.vertalign_SubScript?true:false;ParaPr.Superscript=TextPr.VertAlign===AscCommon.vertalign_SuperScript?true:false;ParaPr.Strikeout=TextPr.Strikeout;ParaPr.DStrikeout=TextPr.DStrikeout;ParaPr.AllCaps=TextPr.Caps;ParaPr.SmallCaps=TextPr.SmallCaps;ParaPr.TextSpacing=TextPr.Spacing;ParaPr.Position=TextPr.Position;if(true===ParaPr.Spacing.AfterAutoSpacing)ParaPr.Spacing.After=spacing_Auto; else if(undefined===ParaPr.Spacing.AfterAutoSpacing)ParaPr.Spacing.After=UnknownValue;if(true===ParaPr.Spacing.BeforeAutoSpacing)ParaPr.Spacing.Before=spacing_Auto;else if(undefined===ParaPr.Spacing.BeforeAutoSpacing)ParaPr.Spacing.Before=UnknownValue;if(-1===ParaPr.PStyle)ParaPr.StyleName="";if(null==ParaPr.NumPr||0===ParaPr.NumPr.NumId)ParaPr.ListType={Type:-1,SubType:-1};if(true===ParaPr.Spacing.AfterAutoSpacing)ParaPr.Spacing.After=spacing_Auto;else if(undefined===ParaPr.Spacing.AfterAutoSpacing)ParaPr.Spacing.After= UnknownValue;if(true===ParaPr.Spacing.BeforeAutoSpacing)ParaPr.Spacing.Before=spacing_Auto;else if(undefined===ParaPr.Spacing.BeforeAutoSpacing)ParaPr.Spacing.Before=UnknownValue;trigger("asc_onParaSpacingLine",new AscCommon.asc_CParagraphSpacing(ParaPr.Spacing));trigger("asc_onPrAlign",ParaPr.Jc);ascSelectedObjects.push(new AscCommon.asc_CSelectedObject(Asc.c_oAscTypeSelectElement.Paragraph,new Asc.asc_CParagraphProperty(ParaPr)))},createImage:function(rasterImageId,x,y,extX,extY,sVideoUrl,sAudioUrl){var image= new AscFormat.CImageShape;AscFormat.fillImage(image,rasterImageId,x,y,extX,extY,sVideoUrl,sAudioUrl);return image},createOleObject:function(data,sApplicationId,rasterImageId,x,y,extX,extY,nWidthPix,nHeightPix){var oleObject=new AscFormat.COleObject;AscFormat.fillImage(oleObject,rasterImageId,x,y,extX,extY);oleObject.setData(data);oleObject.setApplicationId(sApplicationId);oleObject.setPixSizes(nWidthPix,nHeightPix);return oleObject},createTextArt:function(nStyle,bWord,wsModel,sStartString){var MainLogicDocument= editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument?editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument:null;var TrackRevisions=MainLogicDocument?MainLogicDocument.IsTrackRevisions():false;if(MainLogicDocument&&true===TrackRevisions)MainLogicDocument.SetTrackRevisions(false);var oShape=new AscFormat.CShape;oShape.setWordShape(bWord===true);oShape.setBDeleted(false);if(wsModel)oShape.setWorksheet(wsModel);var nFontSize;if(bWord){nFontSize=36;oShape.createTextBoxContent()}else{nFontSize= 54;oShape.createTextBody()}var bUseStartString=typeof sStartString==="string";if(bUseStartString)nFontSize=undefined;var oSpPr=new AscFormat.CSpPr;var oXfrm=new AscFormat.CXfrm;oXfrm.setOffX(0);oXfrm.setOffY(0);oXfrm.setExtX(1828800/36E3);oXfrm.setExtY(1828800/36E3);oSpPr.setXfrm(oXfrm);oXfrm.setParent(oSpPr);oSpPr.setFill(AscFormat.CreateNoFillUniFill());oSpPr.setLn(AscFormat.CreateNoFillLine());oSpPr.setGeometry(AscFormat.CreateGeometry("rect"));oShape.setSpPr(oSpPr);oSpPr.setParent(oShape);var oContent= oShape.getDocContent();var sText,oSelectedContent,oNearestPos,sSelectedText;if(this.document){sSelectedText=this.document.GetSelectedText(false,{});oSelectedContent=this.document.GetSelectedContent(true);oContent.Recalculate_Page(0,true);oContent.MoveCursorToStartPos(false);oNearestPos=oContent.Get_NearestPos(0,0,0,false,undefined);oNearestPos.Paragraph.Check_NearestPos(oNearestPos);if(typeof sSelectedText==="string"&&sSelectedText.length>0)if(oSelectedContent&&this.document.Can_InsertContent(oSelectedContent, oNearestPos)){oSelectedContent.MoveDrawing=true;if(oSelectedContent.Elements.length>1&&oSelectedContent.Elements[oSelectedContent.Elements.length-1].Element.GetType()===AscCommonWord.type_Paragraph&&oSelectedContent.Elements[oSelectedContent.Elements.length-1].Element.IsEmpty())oSelectedContent.Elements.splice(oSelectedContent.Elements.length-1,1);if(oSelectedContent.Elements.length>0)oSelectedContent.Elements[oSelectedContent.Elements.length-1].SelectedAll=false;oContent.InsertContent(oSelectedContent, oNearestPos);oContent.Selection.Start=false;oContent.Selection.Use=false;oContent.Selection.StartPos=0;oContent.Selection.EndPos=0;oContent.Selection.Flag=selectionflag_Common;oContent.SetDocPosType(docpostype_Content);oContent.CurPos.ContentPos=0;oShape.bSelectedText=true}else{sText=this.getDefaultText();AscFormat.AddToContentFromString(oContent,sText);oShape.bSelectedText=false}else{sText=this.getDefaultText();AscFormat.AddToContentFromString(oContent,sText);oShape.bSelectedText=false}}else if(this.drawingObjects.cSld){oShape.setParent(this.drawingObjects); var oTargetDocContent=this.getTargetDocContent();if(oTargetDocContent&&oTargetDocContent.Selection.Use&&oTargetDocContent.GetSelectedText(false,{}).length>0){oSelectedContent=new CSelectedContent;oTargetDocContent.GetSelectedContent(oSelectedContent);oSelectedContent.MoveDrawing=true;if(oSelectedContent.Elements.length>1&&oSelectedContent.Elements[oSelectedContent.Elements.length-1].Element.GetType()===AscCommonWord.type_Paragraph&&oSelectedContent.Elements[oSelectedContent.Elements.length-1].Element.IsEmpty())oSelectedContent.Elements.splice(oSelectedContent.Elements.length- 1,1);if(oSelectedContent.Elements.length>0)oSelectedContent.Elements[oSelectedContent.Elements.length-1].SelectedAll=false;oContent.Recalculate_Page(0,true);oContent.MoveCursorToStartPos(false);var paragraph=oContent.Content[oContent.CurPos.ContentPos];if(null!=paragraph&&type_Paragraph==paragraph.GetType()){oNearestPos={Paragraph:paragraph,ContentPos:paragraph.Get_ParaContentPos(false,false)};paragraph.Check_NearestPos(oNearestPos);oContent.InsertContent(oSelectedContent,oNearestPos);oShape.bSelectedText= false}else{sText=this.getDefaultText();AscFormat.AddToContentFromString(oContent,sText);oShape.bSelectedText=false}}else{oShape.bSelectedText=false;sText=bUseStartString?sStartString:this.getDefaultText();AscFormat.AddToContentFromString(oContent,sText)}}else{sText=bUseStartString?sStartString:this.getDefaultText();AscFormat.AddToContentFromString(oContent,sText)}var oTextPr;if(!bUseStartString){oTextPr=oShape.getTextArtPreviewManager().getStylesToApply()[nStyle].Copy();oTextPr.FontSize=nFontSize; oTextPr.RFonts.Ascii=undefined;if(!(typeof CGraphicObjects!=="undefined"&&this instanceof CGraphicObjects)){oTextPr.Unifill=oTextPr.TextFill;oTextPr.TextFill=undefined}}else{oTextPr=new CTextPr;oTextPr.FontSize=nFontSize;oTextPr.RFonts.Ascii={Name:"Cambria Math",Index:-1};oTextPr.RFonts.HAnsi={Name:"Cambria Math",Index:-1};oTextPr.RFonts.CS={Name:"Cambria Math",Index:-1};oTextPr.RFonts.EastAsia={Name:"Cambria Math",Index:-1}}oContent.Set_ApplyToAll(true);oContent.AddToParagraph(new ParaTextPr(oTextPr)); oContent.SetParagraphAlign(AscCommon.align_Center);oContent.Set_ApplyToAll(false);var oBodyPr=oShape.getBodyPr().createDuplicate();oBodyPr.rot=0;oBodyPr.spcFirstLastPara=false;oBodyPr.vertOverflow=AscFormat.nOTOwerflow;oBodyPr.horzOverflow=AscFormat.nOTOwerflow;oBodyPr.vert=AscFormat.nVertTThorz;oBodyPr.wrap=AscFormat.nTWTNone;oBodyPr.lIns=2.54;oBodyPr.tIns=1.27;oBodyPr.rIns=2.54;oBodyPr.bIns=1.27;oBodyPr.numCol=1;oBodyPr.spcCol=0;oBodyPr.rtlCol=0;oBodyPr.fromWordArt=false;oBodyPr.anchor=4;oBodyPr.anchorCtr= false;oBodyPr.forceAA=false;oBodyPr.compatLnSpc=true;oBodyPr.prstTxWarp=AscFormat.ExecuteNoHistory(function(){return AscFormat.CreatePrstTxWarpGeometry("textNoShape")},this,[]);oBodyPr.textFit=new AscFormat.CTextFit;oBodyPr.textFit.type=AscFormat.text_fit_Auto;if(bWord)oShape.setBodyPr(oBodyPr);else oShape.txBody.setBodyPr(oBodyPr);if(MainLogicDocument&&true===TrackRevisions)MainLogicDocument.SetTrackRevisions(true);return oShape},GetSelectedText:function(bCleartText,oPr){var content=this.getTargetDocContent(); if(content)return content.GetSelectedText(bCleartText,oPr);else return""},putPrLineSpacing:function(type,value){this.checkSelectedObjectsAndCallback(this.setParagraphSpacing,[{LineRule:type,Line:value}],false,AscDFH.historydescription_Spreadsheet_PutPrLineSpacing)},putLineSpacingBeforeAfter:function(type,value){var arg;switch(type){case 0:{if(spacing_Auto===value)arg={BeforeAutoSpacing:true};else arg={Before:value,BeforeAutoSpacing:false};break}case 1:{if(spacing_Auto===value)arg={AfterAutoSpacing:true}; else arg={After:value,AfterAutoSpacing:false};break}}if(arg)this.checkSelectedObjectsAndCallback(this.setParagraphSpacing,[arg],false,AscDFH.historydescription_Spreadsheet_SetParagraphSpacing)},setGraphicObjectProps:function(props){if(typeof Asc.asc_CParagraphProperty!=="undefined"&&!(props instanceof Asc.asc_CParagraphProperty)){var aAdditionalObjects=null;if(AscFormat.isRealNumber(props.Width)&&AscFormat.isRealNumber(props.Height))aAdditionalObjects=this.getConnectorsForCheck2();var bNoSendProperties= AscCommon.isRealObject(props.SlicerProperties);this.checkSelectedObjectsAndCallback(this.setGraphicObjectPropsCallBack,[props],bNoSendProperties,AscDFH.historydescription_Spreadsheet_SetGraphicObjectsProps,aAdditionalObjects);var oApplyProps=null;if(props)if(props.ShapeProperties)oApplyProps=props.ShapeProperties;else oApplyProps=props;if(oApplyProps&&(oApplyProps.textArtProperties&&typeof oApplyProps.textArtProperties.asc_getForm()==="string"||oApplyProps.ChartProperties))this.updateSelectionState()}else this.checkSelectedObjectsAndCallback(this.paraApplyCallback, [props],false,AscDFH.historydescription_Spreadsheet_ParaApply)},checkSelectedObjectsAndCallback:function(callback,args,bNoSendProps,nHistoryPointType,aAdditionalObjects,bNoCheckLock){var oApi=Asc.editor;if(oApi&&oApi.collaborativeEditing&&oApi.collaborativeEditing.getGlobalLock())return;var selection_state=this.getSelectionState();if(!(bNoCheckLock===true)){this.drawingObjects.objectLocker.reset();for(var i=0;i<this.selectedObjects.length;++i)this.drawingObjects.objectLocker.addObjectId(this.selectedObjects[i].Get_Id()); if(aAdditionalObjects)for(var i=0;i<aAdditionalObjects.length;++i)this.drawingObjects.objectLocker.addObjectId(aAdditionalObjects[i].Get_Id())}var _this=this;var callback2=function(bLock,bSync){if(bLock){var nPointType=AscFormat.isRealNumber(nHistoryPointType)?nHistoryPointType:AscDFH.historydescription_CommonControllerCheckSelected;History.Create_NewPoint(nPointType);if(bSync!==true){_this.setSelectionState(selection_state);for(var i=0;i<_this.selectedObjects.length;++i)_this.selectedObjects[i].lockType= c_oAscLockTypes.kLockTypeMine;if(aAdditionalObjects)for(var i=0;i<aAdditionalObjects.length;++i)aAdditionalObjects[i].lockType=c_oAscLockTypes.kLockTypeMine}callback.apply(_this,args);_this.startRecalculate();if(!(bNoSendProps===true))_this.drawingObjects.sendGraphicObjectProps()}};if(!(bNoCheckLock===true))return this.drawingObjects.objectLocker.checkObjects(callback2);callback2(true,true);return true},checkSelectedObjectsAndCallbackNoCheckLock:function(callback,args,bNoSendProps,nHistoryPointType){var nPointType= AscFormat.isRealNumber(nHistoryPointType)?nHistoryPointType:AscDFH.historydescription_CommonControllerCheckSelected;History.Create_NewPoint(nPointType);callback.apply(this,args);this.startRecalculate();if(!(bNoSendProps===true))this.drawingObjects.sendGraphicObjectProps()},checkSelectedObjectsAndCallback2:function(callback){var selection_state=this.getSelectionState();this.drawingObjects.objectLocker.reset();for(var i=0;i<this.selectedObjects.length;++i)this.drawingObjects.objectLocker.addObjectId(this.selectedObjects[i].Get_Id()); var _this=this;var callback2=function(bLock){if(bLock)History.Create_NewPoint();callback.apply(_this,[bLock]);if(bLock){_this.startRecalculate();_this.drawingObjects.sendGraphicObjectProps()}};return this.drawingObjects.objectLocker.checkObjects(callback2)},setGraphicObjectPropsCallBack:function(props){var apply_props;if(AscFormat.isRealNumber(props.Width)&&AscFormat.isRealNumber(props.Height))apply_props=props;else apply_props=props.ShapeProperties?props.ShapeProperties:props;var objects_by_types= this.applyDrawingProps(apply_props)},paraApplyCallback:function(Props){if("undefined"!=typeof Props.Ind&&null!=Props.Ind)this.setParagraphIndent(Props.Ind);if("undefined"!=typeof Props.Jc&&null!=Props.Jc)this.setParagraphAlign(Props.Jc);if("undefined"!=typeof Props.Spacing&&null!=Props.Spacing)this.setParagraphSpacing(Props.Spacing);if(undefined!=Props.Tabs){var Tabs=new CParaTabs;Tabs.Set_FromObject(Props.Tabs.Tabs);this.setParagraphTabs(Tabs)}if(undefined!=Props.DefaultTab)this.setDefaultTabSize(Props.DefaultTab); if(undefined!=Props.Bullet)this.setParagraphNumbering(Props.Bullet);var TextPr=new CTextPr;if(true===Props.Subscript)TextPr.VertAlign=AscCommon.vertalign_SubScript;else if(true===Props.Superscript)TextPr.VertAlign=AscCommon.vertalign_SuperScript;else if(false===Props.Superscript||false===Props.Subscript)TextPr.VertAlign=AscCommon.vertalign_Baseline;if(undefined!=Props.Strikeout){TextPr.Strikeout=Props.Strikeout;TextPr.DStrikeout=false}if(undefined!=Props.DStrikeout){TextPr.DStrikeout=Props.DStrikeout; if(true===TextPr.DStrikeout)TextPr.Strikeout=false}if(undefined!=Props.SmallCaps){TextPr.SmallCaps=Props.SmallCaps;TextPr.AllCaps=false}if(undefined!=Props.AllCaps){TextPr.Caps=Props.AllCaps;if(true===TextPr.AllCaps)TextPr.SmallCaps=false}if(undefined!=Props.TextSpacing)TextPr.Spacing=Props.TextSpacing;this.paragraphAdd(new ParaTextPr(TextPr));this.startRecalculate()},setGraphicObjectLayer:function(layerType){if(this.selection.groupSelection)this.checkSelectedObjectsAndCallback(this.setGraphicObjectLayerCallBack, [layerType],false,AscDFH.historydescription_Spreadsheet_GraphicObjectLayer);else this.checkSelectedObjectsAndCallback(this.setGraphicObjectLayerCallBack,[layerType],false,AscDFH.historydescription_Spreadsheet_GraphicObjectLayer)},setGraphicObjectAlign:function(alignType){this.checkSelectedObjectsAndCallback(this.setGraphicObjectAlignCallBack,[alignType],false,AscDFH.historydescription_Spreadsheet_GraphicObjectLayer)},distributeGraphicObjectHor:function(){this.checkSelectedObjectsAndCallback(this.distributeHor, [true],false,AscDFH.historydescription_Spreadsheet_GraphicObjectLayer)},distributeGraphicObjectVer:function(){this.checkSelectedObjectsAndCallback(this.distributeVer,[true],false,AscDFH.historydescription_Spreadsheet_GraphicObjectLayer)},setGraphicObjectLayerCallBack:function(layerType){switch(layerType){case 0:{this.bringToFront();break}case 1:{this.sendToBack();break}case 2:{this.bringForward();break}case 3:{this.bringBackward()}}},setGraphicObjectAlignCallBack:function(alignType){switch(alignType){case 0:{this.alignLeft(true); break}case 1:{this.alignRight(true);break}case 2:{this.alignBottom(true);break}case 3:{this.alignTop(true);break}case 4:{this.alignCenter(true);break}case 5:{this.alignMiddle(true);break}}},alignLeft:function(bSelected){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,i,boundsObject,leftPos;if(selected_objects.length>0){if(bSelected&&selected_objects.length>1){boundsObject=getAbsoluteRectBoundsArr(selected_objects);leftPos=boundsObject.minX}else leftPos= 0;this.checkSelectedObjectsForMove(this.selection.groupSelection?this.selection.groupSelection:null);this.swapTrackObjects();var move_state,oTrack,oDrawing,oBounds;if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,selected_objects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this,selected_objects[0],this.selection.groupSelection,0,0);for(i=0;i<this.arrTrackObjects.length;++i){oTrack=this.arrTrackObjects[i];oDrawing=oTrack.originalObject;oBounds=getAbsoluteRectBoundsObject(oDrawing); oTrack.track(leftPos-oBounds.minX,0,oDrawing.selectStartPage)}move_state.bSamePos=false;move_state.onMouseUp({},0,0,0)}},alignRight:function(bSelected){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,i,boundsObject,rightPos;if(selected_objects.length>0){if(bSelected&&selected_objects.length>1){boundsObject=getAbsoluteRectBoundsArr(selected_objects);rightPos=boundsObject.maxX}else rightPos=this.drawingObjects.Width;this.checkSelectedObjectsForMove(this.selection.groupSelection? this.selection.groupSelection:null);this.swapTrackObjects();var move_state,oTrack,oDrawing,oBounds;if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,this.selectedObjects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this,this.selection.groupSelection.selectedObjects[0],this.selection.groupSelection,0,0);for(i=0;i<this.arrTrackObjects.length;++i){oTrack=this.arrTrackObjects[i];oDrawing=oTrack.originalObject;oBounds=getAbsoluteRectBoundsObject(oDrawing);oTrack.track(rightPos- oBounds.maxX,0,oDrawing.selectStartPage)}move_state.bSamePos=false;move_state.onMouseUp({},0,0,0)}},alignTop:function(bSelected){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,i,boundsObject,topPos;if(selected_objects.length>0){if(bSelected&&selected_objects.length>1){boundsObject=getAbsoluteRectBoundsArr(selected_objects);topPos=boundsObject.minY}else topPos=0;this.checkSelectedObjectsForMove(this.selection.groupSelection?this.selection.groupSelection: null);this.swapTrackObjects();var move_state,oTrack,oDrawing,oBounds;if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,this.selectedObjects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this,this.selection.groupSelection.selectedObjects[0],this.selection.groupSelection,0,0);for(i=0;i<this.arrTrackObjects.length;++i){oTrack=this.arrTrackObjects[i];oDrawing=oTrack.originalObject;oBounds=getAbsoluteRectBoundsObject(oDrawing);oTrack.track(0,topPos-oBounds.minY,oDrawing.selectStartPage)}move_state.bSamePos= false;move_state.onMouseUp({},0,0,0)}},alignBottom:function(bSelected){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,i,boundsObject,bottomPos;if(selected_objects.length>0){if(bSelected&&selected_objects.length>1){boundsObject=getAbsoluteRectBoundsArr(selected_objects);bottomPos=boundsObject.maxY}else bottomPos=this.drawingObjects.Height;this.checkSelectedObjectsForMove(this.selection.groupSelection?this.selection.groupSelection: null);this.swapTrackObjects();var move_state,oTrack,oDrawing,oBounds;if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,this.selectedObjects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this,this.selection.groupSelection.selectedObjects[0],this.selection.groupSelection,0,0);for(i=0;i<this.arrTrackObjects.length;++i){oTrack=this.arrTrackObjects[i];oDrawing=oTrack.originalObject;oBounds=getAbsoluteRectBoundsObject(oDrawing);oTrack.track(0,bottomPos-oBounds.maxY,oDrawing.selectStartPage)}move_state.bSamePos= false;move_state.onMouseUp({},0,0,0)}},alignCenter:function(bSelected){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,i,boundsObject,centerPos;if(selected_objects.length>0){if(bSelected&&selected_objects.length>1){boundsObject=getAbsoluteRectBoundsArr(selected_objects);centerPos=boundsObject.minX+(boundsObject.maxX-boundsObject.minX)/2}else centerPos=this.drawingObjects.Width/2;this.checkSelectedObjectsForMove(this.selection.groupSelection? this.selection.groupSelection:null);this.swapTrackObjects();var move_state,oTrack,oDrawing,oBounds;if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,this.selectedObjects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this,this.selection.groupSelection.selectedObjects[0],this.selection.groupSelection,0,0);for(i=0;i<this.arrTrackObjects.length;++i){oTrack=this.arrTrackObjects[i];oDrawing=oTrack.originalObject;oBounds=getAbsoluteRectBoundsObject(oDrawing);oTrack.track(centerPos- (oBounds.maxX-oBounds.minX)/2-oBounds.minX,0,oDrawing.selectStartPage)}move_state.bSamePos=false;move_state.onMouseUp({},0,0,0)}},alignMiddle:function(bSelected){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,i,boundsObject,middlePos;if(selected_objects.length>0){if(bSelected&&selected_objects.length>1){boundsObject=getAbsoluteRectBoundsArr(selected_objects);middlePos=boundsObject.minY+(boundsObject.maxY-boundsObject.minY)/2}else middlePos= this.drawingObjects.Height/2;this.checkSelectedObjectsForMove(this.selection.groupSelection?this.selection.groupSelection:null);this.swapTrackObjects();var move_state,oTrack,oDrawing,oBounds;if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,this.selectedObjects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this,this.selection.groupSelection.selectedObjects[0],this.selection.groupSelection,0,0);for(i=0;i<this.arrTrackObjects.length;++i){oTrack=this.arrTrackObjects[i]; oDrawing=oTrack.originalObject;oBounds=getAbsoluteRectBoundsObject(oDrawing);oTrack.track(0,middlePos-(oBounds.maxY-oBounds.minY)/2-oBounds.minY,oDrawing.selectStartPage)}move_state.bSamePos=false;move_state.onMouseUp({},0,0,0)}},distributeHor:function(bSelected){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,i,boundsObject,pos1,pos2,gap,sortObjects,lastPos;var oTrack,oDrawing,oBounds,oSortObject;if(selected_objects.length>0){boundsObject= getAbsoluteRectBoundsArr(selected_objects);this.checkSelectedObjectsForMove(this.selection.groupSelection?this.selection.groupSelection:null);this.swapTrackObjects();sortObjects=[];for(i=0;i<selected_objects.length;++i){oTrack=this.arrTrackObjects[i];oDrawing=oTrack.originalObject;oBounds=getAbsoluteRectBoundsObject(oDrawing);sortObjects.push({trackObject:this.arrTrackObjects[i],bounds:oBounds})}sortObjects.sort(function(obj1,obj2){return(obj1.bounds.maxX+obj1.bounds.minX)/2-(obj2.bounds.maxX+obj2.bounds.minX)/ 2});if(bSelected&&selected_objects.length>2){pos1=sortObjects[0].bounds.minX;pos2=sortObjects[sortObjects.length-1].bounds.maxX;gap=(pos2-pos1-boundsObject.summWidth)/(sortObjects.length-1)}else if(boundsObject.summWidth<this.drawingObjects.Width){gap=(this.drawingObjects.Width-boundsObject.summWidth)/(sortObjects.length+1);pos1=gap;pos2=this.drawingObjects.Width-gap}else{pos1=0;pos2=this.drawingObjects.Width;gap=(this.drawingObjects.Width-boundsObject.summWidth)/(sortObjects.length-1)}var move_state; if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,this.selectedObjects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this,this.selection.groupSelection.selectedObjects[0],this.selection.groupSelection,0,0);lastPos=pos1;for(i=0;i<sortObjects.length;++i){oSortObject=sortObjects[i];oTrack=oSortObject.trackObject;oDrawing=oTrack.originalObject;oBounds=oSortObject.bounds;oTrack.track(lastPos-oBounds.minX,0,oDrawing.selectStartPage);lastPos+=gap+(oBounds.maxX-oBounds.minX)}move_state.bSamePos= false;move_state.onMouseUp({},0,0,0)}},distributeVer:function(bSelected){var selected_objects=this.selection.groupSelection?this.selection.groupSelection.selectedObjects:this.selectedObjects,i,boundsObject,pos1,pos2,gap,sortObjects,lastPos;var oTrack,oDrawing,oBounds,oSortObject;if(selected_objects.length>0){boundsObject=getAbsoluteRectBoundsArr(selected_objects);this.checkSelectedObjectsForMove(this.selection.groupSelection?this.selection.groupSelection:null);this.swapTrackObjects();sortObjects= [];for(i=0;i<selected_objects.length;++i){oTrack=this.arrTrackObjects[i];oDrawing=oTrack.originalObject;oBounds=getAbsoluteRectBoundsObject(oDrawing);sortObjects.push({trackObject:this.arrTrackObjects[i],bounds:oBounds})}sortObjects.sort(function(obj1,obj2){return(obj1.bounds.maxY+obj1.bounds.minY)/2-(obj2.bounds.maxY+obj2.bounds.minY)/2});if(bSelected&&selected_objects.length>2){pos1=sortObjects[0].bounds.minY;pos2=sortObjects[sortObjects.length-1].bounds.maxY;gap=(pos2-pos1-boundsObject.summHeight)/ (sortObjects.length-1)}else if(boundsObject.summHeight<this.drawingObjects.Height){gap=(this.drawingObjects.Height-boundsObject.summHeight)/(sortObjects.length+1);pos1=gap;pos2=this.drawingObjects.Height-gap}else{pos1=0;pos2=this.drawingObjects.Height;gap=(this.drawingObjects.Height-boundsObject.summHeight)/(sortObjects.length-1)}var move_state;if(!this.selection.groupSelection)move_state=new AscFormat.MoveState(this,this.selectedObjects[0],0,0);else move_state=new AscFormat.MoveInGroupState(this, this.selection.groupSelection.selectedObjects[0],this.selection.groupSelection,0,0);lastPos=pos1;for(i=0;i<sortObjects.length;++i){oSortObject=sortObjects[i];oTrack=oSortObject.trackObject;oDrawing=oTrack.originalObject;oBounds=oSortObject.bounds;oTrack.track(0,lastPos-oBounds.minY,oDrawing.selectStartPage);lastPos+=gap+(oBounds.maxY-oBounds.minY)}move_state.bSamePos=false;move_state.onMouseUp({},0,0,0)}},bringToFront:function(){var sp_tree=this.getDrawingObjects();if(!this.selection.groupSelection){var selected= [];for(var i=0;i<sp_tree.length;++i)if(sp_tree[i].selected)selected.push(sp_tree[i]);for(var i=sp_tree.length-1;i>-1;--i)if(sp_tree[i].selected)sp_tree[i].deleteDrawingBase();for(i=0;i<selected.length;++i)selected[i].addToDrawingObjects(sp_tree.length)}else this.selection.groupSelection.bringToFront();this.drawingObjects.showDrawingObjects()},bringForward:function(){var sp_tree=this.getDrawingObjects();if(!this.selection.groupSelection)for(var i=sp_tree.length-1;i>-1;--i){var sp=sp_tree[i];if(sp.selected&& i<sp_tree.length-1&&!sp_tree[i+1].selected){sp.deleteDrawingBase();sp.addToDrawingObjects(i+1)}}else this.selection.groupSelection.bringForward();this.drawingObjects.showDrawingObjects()},sendToBack:function(){var sp_tree=this.getDrawingObjects();if(!this.selection.groupSelection){var j=0;for(var i=0;i<sp_tree.length;++i)if(sp_tree[i].selected){var object=sp_tree[i];object.deleteDrawingBase();object.addToDrawingObjects(j);++j}}else this.selection.groupSelection.sendToBack();this.drawingObjects.showDrawingObjects()}, bringBackward:function(){var sp_tree=this.getDrawingObjects();if(!this.selection.groupSelection)for(var i=0;i<sp_tree.length;++i){var sp=sp_tree[i];if(sp.selected&&i>0&&!sp_tree[i-1].selected){sp.deleteDrawingBase();sp.addToDrawingObjects(i-1)}}else this.selection.groupSelection.bringBackward();this.drawingObjects.showDrawingObjects()},addEventListener:function(drawing){if(!this.isEventListener(drawing))this.eventListeners.push(drawing)},removeEventListener:function(drawing){for(var i=0;i<this.eventListeners.length;++i)if(this.eventListeners[i]=== drawing){this.eventListeners.splice(i,1);break}},isEventListener:function(drawing){var i;for(i=0;i<this.eventListeners.length;++i)if(this.eventListeners[i]===drawing)break;return i<this.eventListeners.length}};function CBoundsController(){this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535;this.Rects=[]}CBoundsController.prototype={ClearNoAttack:function(){this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535;if(0!=this.Rects.length)this.Rects.splice(0,this.Rects.length)}, CheckPageRects:function(rects,ctx){var _bIsUpdate=false;if(rects.length!=this.Rects.length)_bIsUpdate=true;else for(var i=0;i<rects.length;i++){var _1=this.Rects[i];var _2=rects[i];if(_1.x!=_2.x||_1.y!=_2.y||_1.w!=_2.w||_1.h!=_2.h)_bIsUpdate=true}if(!_bIsUpdate)return;this.Clear(ctx);if(0!=this.Rects.length)this.Rects.splice(0,this.Rects.length);for(var i=0;i<rects.length;i++){var _r=rects[i];this.CheckRect(_r.x,_r.y,_r.w,_r.h);this.Rects.push(_r)}},Clear:function(ctx){if(this.max_x!=-65535&&this.max_y!= -65535)ctx.fillRect(this.min_x-5,this.min_y-5,this.max_x-this.min_x+10,this.max_y-this.min_y+10);this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535},CheckPoint1:function(x,y){if(x<this.min_x)this.min_x=x;if(y<this.min_y)this.min_y=y},CheckPoint2:function(x,y){if(x>this.max_x)this.max_x=x;if(y>this.max_y)this.max_y=y},CheckPoint:function(x,y){if(x<this.min_x)this.min_x=x;if(y<this.min_y)this.min_y=y;if(x>this.max_x)this.max_x=x;if(y>this.max_y)this.max_y=y},CheckRect:function(x, y,w,h){this.CheckPoint1(x,y);this.CheckPoint2(x+w,y+h)},fromBounds:function(_bounds){this.min_x=_bounds.min_x;this.min_y=_bounds.min_y;this.max_x=_bounds.max_x;this.max_y=_bounds.max_y}};function CSlideBoundsChecker(){this.map_bounds_shape={};this.map_bounds_shape["heart"]=true;this.IsSlideBoundsCheckerType=true;this.Bounds=new CBoundsController;this.m_oCurFont=null;this.m_oTextPr=null;this.m_oCoordTransform=new AscCommon.CMatrixL;this.m_oTransform=new AscCommon.CMatrixL;this.m_oFullTransform=new AscCommon.CMatrixL; this.IsNoSupportTextDraw=true;this.LineWidth=null;this.AutoCheckLineWidth=false}CSlideBoundsChecker.prototype={DrawLockParagraph:function(){},GetIntegerGrid:function(){return false},AddSmartRect:function(){},drawCollaborativeChanges:function(){},drawSearchResult:function(x,y,w,h){},IsShapeNeedBounds:function(preset){if(preset===undefined||preset==null)return true;return true===this.map_bounds_shape[preset]?false:true},init:function(width_px,height_px,width_mm,height_mm){this.m_lHeightPix=height_px; this.m_lWidthPix=width_px;this.m_dWidthMM=width_mm;this.m_dHeightMM=height_mm;this.m_dDpiX=25.4*this.m_lWidthPix/this.m_dWidthMM;this.m_dDpiY=25.4*this.m_lHeightPix/this.m_dHeightMM;this.m_oCoordTransform.sx=this.m_dDpiX/25.4;this.m_oCoordTransform.sy=this.m_dDpiY/25.4;this.Bounds.ClearNoAttack()},SetCurrentPage:function(){},EndDraw:function(){},put_GlobalAlpha:function(enable,alpha){},Start_GlobalAlpha:function(){},End_GlobalAlpha:function(){},p_color:function(r,g,b,a){},p_width:function(w){},p_dash:function(params){}, b_color1:function(r,g,b,a){},b_color2:function(r,g,b,a){},SetIntegerGrid:function(){},transform:function(sx,shy,shx,sy,tx,ty){this.m_oTransform.sx=sx;this.m_oTransform.shx=shx;this.m_oTransform.shy=shy;this.m_oTransform.sy=sy;this.m_oTransform.tx=tx;this.m_oTransform.ty=ty;this.CalculateFullTransform()},CalculateFullTransform:function(){this.m_oFullTransform.sx=this.m_oTransform.sx;this.m_oFullTransform.shx=this.m_oTransform.shx;this.m_oFullTransform.shy=this.m_oTransform.shy;this.m_oFullTransform.sy= this.m_oTransform.sy;this.m_oFullTransform.tx=this.m_oTransform.tx;this.m_oFullTransform.ty=this.m_oTransform.ty;AscCommon.global_MatrixTransformer.MultiplyAppend(this.m_oFullTransform,this.m_oCoordTransform)},_s:function(){},_e:function(){},_z:function(){},_m:function(x,y){var _x=this.m_oFullTransform.TransformPointX(x,y);var _y=this.m_oFullTransform.TransformPointY(x,y);this.Bounds.CheckPoint(_x,_y)},_l:function(x,y){var _x=this.m_oFullTransform.TransformPointX(x,y);var _y=this.m_oFullTransform.TransformPointY(x, y);this.Bounds.CheckPoint(_x,_y)},_c:function(x1,y1,x2,y2,x3,y3){var _x1=this.m_oFullTransform.TransformPointX(x1,y1);var _y1=this.m_oFullTransform.TransformPointY(x1,y1);var _x2=this.m_oFullTransform.TransformPointX(x2,y2);var _y2=this.m_oFullTransform.TransformPointY(x2,y2);var _x3=this.m_oFullTransform.TransformPointX(x3,y3);var _y3=this.m_oFullTransform.TransformPointY(x3,y3);this.Bounds.CheckPoint(_x1,_y1);this.Bounds.CheckPoint(_x2,_y2);this.Bounds.CheckPoint(_x3,_y3)},_c2:function(x1,y1,x2, y2){var _x1=this.m_oFullTransform.TransformPointX(x1,y1);var _y1=this.m_oFullTransform.TransformPointY(x1,y1);var _x2=this.m_oFullTransform.TransformPointX(x2,y2);var _y2=this.m_oFullTransform.TransformPointY(x2,y2);this.Bounds.CheckPoint(_x1,_y1);this.Bounds.CheckPoint(_x2,_y2)},ds:function(){},df:function(){},save:function(){},restore:function(){},clip:function(){},reset:function(){this.m_oTransform.Reset();this.CalculateFullTransform()},transform3:function(m){this.m_oTransform=m.CreateDublicate(); this.CalculateFullTransform()},transform00:function(m){this.m_oTransform=m.CreateDublicate();this.m_oTransform.tx=0;this.m_oTransform.ty=0;this.CalculateFullTransform()},drawImage2:function(img,x,y,w,h){var _x1=this.m_oFullTransform.TransformPointX(x,y);var _y1=this.m_oFullTransform.TransformPointY(x,y);var _x2=this.m_oFullTransform.TransformPointX(x+w,y);var _y2=this.m_oFullTransform.TransformPointY(x+w,y);var _x3=this.m_oFullTransform.TransformPointX(x+w,y+h);var _y3=this.m_oFullTransform.TransformPointY(x+ w,y+h);var _x4=this.m_oFullTransform.TransformPointX(x,y+h);var _y4=this.m_oFullTransform.TransformPointY(x,y+h);this.Bounds.CheckPoint(_x1,_y1);this.Bounds.CheckPoint(_x2,_y2);this.Bounds.CheckPoint(_x3,_y3);this.Bounds.CheckPoint(_x4,_y4)},drawImage:function(img,x,y,w,h){return this.drawImage2(img,x,y,w,h)},font:function(font_id,font_size){this.m_oFontManager.LoadFontFromFile(font_id,font_size,this.m_dDpiX,this.m_dDpiY)},GetFont:function(){return this.m_oCurFont},SetFont:function(font){this.m_oCurFont= font},SetTextPr:function(textPr){this.m_oTextPr=textPr},SetFontSlot:function(slot,fontSizeKoef){},GetTextPr:function(){return this.m_oTextPr},FillText:function(x,y,text){if(this.m_bIsBreak)return;var _x=this.m_oFullTransform.TransformPointX(x,y);var _y=this.m_oFullTransform.TransformPointY(x,y);this.Bounds.CheckRect(_x,_y,1,1)},FillTextCode:function(x,y,lUnicode){if(this.m_bIsBreak)return;var _x=this.m_oFullTransform.TransformPointX(x,y);var _y=this.m_oFullTransform.TransformPointY(x,y);this.Bounds.CheckRect(_x, _y,1,1)},t:function(text,x,y){if(this.m_bIsBreak)return;var _x=this.m_oFullTransform.TransformPointX(x,y);var _y=this.m_oFullTransform.TransformPointY(x,y);this.Bounds.CheckRect(_x,_y,1,1)},FillText2:function(x,y,text,cropX,cropW){if(this.m_bIsBreak)return;var _x=this.m_oFullTransform.TransformPointX(x,y);var _y=this.m_oFullTransform.TransformPointY(x,y);this.Bounds.CheckRect(_x,_y,1,1)},t2:function(text,x,y,cropX,cropW){if(this.m_bIsBreak)return;var _x=this.m_oFullTransform.TransformPointX(x,y); var _y=this.m_oFullTransform.TransformPointY(x,y);this.Bounds.CheckRect(_x,_y,1,1)},charspace:function(space){},DrawHeaderEdit:function(yPos){},DrawFooterEdit:function(yPos){},DrawEmptyTableLine:function(x1,y1,x2,y2){},DrawSpellingLine:function(y0,x0,x1,w){},drawHorLine:function(align,y,x,r,penW){var _x1=this.m_oFullTransform.TransformPointX(x,y-penW);var _y1=this.m_oFullTransform.TransformPointY(x,y-penW);var _x2=this.m_oFullTransform.TransformPointX(x,y+penW);var _y2=this.m_oFullTransform.TransformPointY(x, y+penW);var _x3=this.m_oFullTransform.TransformPointX(r,y-penW);var _y3=this.m_oFullTransform.TransformPointY(r,y-penW);var _x4=this.m_oFullTransform.TransformPointX(r,y+penW);var _y4=this.m_oFullTransform.TransformPointY(r,y+penW);this.Bounds.CheckPoint(_x1,_y1);this.Bounds.CheckPoint(_x2,_y2);this.Bounds.CheckPoint(_x3,_y3);this.Bounds.CheckPoint(_x4,_y4)},drawHorLine2:function(align,y,x,r,penW){return this.drawHorLine(align,y,x,r,penW)},drawVerLine:function(align,x,y,b,penW){var _x1=this.m_oFullTransform.TransformPointX(x- penW,y);var _y1=this.m_oFullTransform.TransformPointY(x-penW,y);var _x2=this.m_oFullTransform.TransformPointX(x+penW,y);var _y2=this.m_oFullTransform.TransformPointY(x+penW,y);var _x3=this.m_oFullTransform.TransformPointX(x-penW,b);var _y3=this.m_oFullTransform.TransformPointY(x-penW,b);var _x4=this.m_oFullTransform.TransformPointX(x+penW,b);var _y4=this.m_oFullTransform.TransformPointY(x+penW,b);this.Bounds.CheckPoint(_x1,_y1);this.Bounds.CheckPoint(_x2,_y2);this.Bounds.CheckPoint(_x3,_y3);this.Bounds.CheckPoint(_x4, _y4)},drawHorLineExt:function(align,y,x,r,penW,leftMW,rightMW){this.drawHorLine(align,y,x+leftMW,r+rightMW)},rect:function(x,y,w,h){var _x1=this.m_oFullTransform.TransformPointX(x,y);var _y1=this.m_oFullTransform.TransformPointY(x,y);var _x2=this.m_oFullTransform.TransformPointX(x+w,y);var _y2=this.m_oFullTransform.TransformPointY(x+w,y);var _x3=this.m_oFullTransform.TransformPointX(x+w,y+h);var _y3=this.m_oFullTransform.TransformPointY(x+w,y+h);var _x4=this.m_oFullTransform.TransformPointX(x,y+h); var _y4=this.m_oFullTransform.TransformPointY(x,y+h);this.Bounds.CheckPoint(_x1,_y1);this.Bounds.CheckPoint(_x2,_y2);this.Bounds.CheckPoint(_x3,_y3);this.Bounds.CheckPoint(_x4,_y4)},rect2:function(x,y,w,h){var _x1=this.m_oFullTransform.TransformPointX(x,y);var _y1=this.m_oFullTransform.TransformPointY(x,y);var _x2=this.m_oFullTransform.TransformPointX(x+w,y);var _y2=this.m_oFullTransform.TransformPointY(x+w,y);var _x3=this.m_oFullTransform.TransformPointX(x+w,y-h);var _y3=this.m_oFullTransform.TransformPointY(x+ w,y-h);var _x4=this.m_oFullTransform.TransformPointX(x,y-h);var _y4=this.m_oFullTransform.TransformPointY(x,y-h);this.Bounds.CheckPoint(_x1,_y1);this.Bounds.CheckPoint(_x2,_y2);this.Bounds.CheckPoint(_x3,_y3);this.Bounds.CheckPoint(_x4,_y4)},TableRect:function(x,y,w,h){this.rect(x,y,w,h)},AddClipRect:function(x,y,w,h){},RemoveClipRect:function(){},SetClip:function(r){},RemoveClip:function(){},SavePen:function(){},RestorePen:function(){},SaveBrush:function(){},RestoreBrush:function(){},SavePenBrush:function(){}, RestorePenBrush:function(){},SaveGrState:function(){},RestoreGrState:function(){},StartClipPath:function(){},EndClipPath:function(){},CorrectBounds:function(){if(this.LineWidth!=null){var _correct=this.LineWidth/2;this.Bounds.min_x-=_correct;this.Bounds.min_y-=_correct;this.Bounds.max_x+=_correct;this.Bounds.max_y+=_correct}},CorrectBounds2:function(){if(this.LineWidth!=null){var _correct=this.LineWidth*this.m_oCoordTransform.sx/2;this.Bounds.min_x-=_correct;this.Bounds.min_y-=_correct;this.Bounds.max_x+= _correct;this.Bounds.max_y+=_correct}},CheckLineWidth:function(shape){if(!shape)return;var _ln=shape.pen;if(_ln!=null&&_ln.Fill!=null&&_ln.Fill.fill!=null){this.LineWidth=_ln.w==null?12700:parseInt(_ln.w);this.LineWidth/=36E3}},DrawLockObjectRect:function(){},DrawPresentationComment:function(type,x,y,w,h){this.rect(x,y,w,h)}};function GetMinSnapDistanceXObject(pointX,arrGrObjects){var min_dx=null;var ret=null;for(var i=0;i<arrGrObjects.length;++i){var cur_snap_arr_x=arrGrObjects[i].snapArrayX;if(!cur_snap_arr_x)continue; var count=cur_snap_arr_x.length;for(var snap_index=0;snap_index<count;++snap_index){var dx=cur_snap_arr_x[snap_index]-pointX;if(min_dx===null){ret={dist:dx,pos:cur_snap_arr_x[snap_index]};min_dx=dx}else if(Math.abs(dx)<Math.abs(min_dx)){min_dx=dx;ret={dist:dx,pos:cur_snap_arr_x[snap_index]}}}}return ret}function GetMinSnapDistanceYObject(pointY,arrGrObjects){var min_dy=null;var ret=null;for(var i=0;i<arrGrObjects.length;++i){var cur_snap_arr_y=arrGrObjects[i].snapArrayY;if(!cur_snap_arr_y)continue; var count=cur_snap_arr_y.length;for(var snap_index=0;snap_index<count;++snap_index){var dy=cur_snap_arr_y[snap_index]-pointY;if(min_dy===null){min_dy=dy;ret={dist:dy,pos:cur_snap_arr_y[snap_index]}}else if(Math.abs(dy)<Math.abs(min_dy)){min_dy=dy;ret={dist:dy,pos:cur_snap_arr_y[snap_index]}}}}return ret}function GetMinSnapDistanceXObjectByArrays(pointX,snapArrayX){var min_dx=null;var ret=null;var cur_snap_arr_x=snapArrayX;var count=cur_snap_arr_x.length;for(var snap_index=0;snap_index<count;++snap_index){var dx= cur_snap_arr_x[snap_index]-pointX;if(min_dx===null){ret={dist:dx,pos:cur_snap_arr_x[snap_index]};min_dx=dx}else if(Math.abs(dx)<Math.abs(min_dx)){min_dx=dx;ret={dist:dx,pos:cur_snap_arr_x[snap_index]}}}return ret}function GetMinSnapDistanceYObjectByArrays(pointY,snapArrayY){var min_dy=null;var ret=null;var cur_snap_arr_y=snapArrayY;var count=cur_snap_arr_y.length;for(var snap_index=0;snap_index<count;++snap_index){var dy=cur_snap_arr_y[snap_index]-pointY;if(min_dy===null){min_dy=dy;ret={dist:dy,pos:cur_snap_arr_y[snap_index]}}else if(Math.abs(dy)< Math.abs(min_dy)){min_dy=dy;ret={dist:dy,pos:cur_snap_arr_y[snap_index]}}}return ret}function getAbsoluteRectBoundsObject(drawing){var transform=drawing.transform;var arrX=[],arrY=[];arrX.push(transform.TransformPointX(0,0));arrX.push(transform.TransformPointX(drawing.extX,0));arrX.push(transform.TransformPointX(drawing.extX,drawing.extY));arrX.push(transform.TransformPointX(0,drawing.extY));arrY.push(transform.TransformPointY(0,0));arrY.push(transform.TransformPointY(drawing.extX,0));arrY.push(transform.TransformPointY(drawing.extX, drawing.extY));arrY.push(transform.TransformPointY(0,drawing.extY));return{minX:Math.min.apply(Math,arrX),minY:Math.min.apply(Math,arrY),maxX:Math.max.apply(Math,arrX),maxY:Math.max.apply(Math,arrY)}}function getAbsoluteRectBoundsArr(aDrawings){var arrBounds=[],minX,minY,maxX,maxY,i,bounds;var summWidth=0;var summHeight=0;for(i=0;i<aDrawings.length;++i){bounds=getAbsoluteRectBoundsObject(aDrawings[i]);arrBounds.push(bounds);if(i===0){minX=bounds.minX;minY=bounds.minY;maxX=bounds.maxX;maxY=bounds.maxY}else{if(minX> bounds.minX)minX=bounds.minX;if(minY>bounds.minY)minY=bounds.minY;if(maxX<bounds.maxX)maxX=bounds.maxX;if(maxY<bounds.maxY)maxY=bounds.maxY}summWidth+=bounds.maxX-bounds.minX;summHeight+=bounds.maxY-bounds.minY}return{arrBounds:arrBounds,minX:minX,maxX:maxX,minY:minY,maxY:maxY,summWidth:summWidth,summHeight:summHeight}}function CalcLiterByLength(aAlphaBet,nLength){var modulo=nLength;var sResultLiter="";while(modulo>0){sResultLiter=aAlphaBet[modulo%aAlphaBet.length]+sResultLiter;modulo=modulo/aAlphaBet.length>> 0}return sResultLiter}function CollectUniColor(oUniColor){if(!oUniColor||!oUniColor.color)return 0;var ret=[];var oColor=oUniColor.color;var oColorTypes=window["Asc"].c_oAscColor;ret.push(oColor.type);switch(oColor.type){case oColorTypes.COLOR_TYPE_NONE:{break}case oColorTypes.COLOR_TYPE_SRGB:{ret.push((oColor.RGBA.R<<16&16711680)+(oColor.RGBA.G<<8&65280)+oColor.RGBA.B);break}case oColorTypes.COLOR_TYPE_PRST:case oColorTypes.COLOR_TYPE_SCHEME:case oColorTypes.COLOR_TYPE_SYS:{ret.push(oColor.id);break}}if(!oUniColor.Mods)ret.push(0); else{var aMods=oUniColor.Mods.Mods;ret.push(aMods.length);for(var i=0;i<aMods.length;++i)ret.push([aMods[i].name,aMods[i].val])}return ret}function CollectGs(oGs){if(!oGs)return 0;return[oGs.pos,CollectUniColor(oGs.color)]}function CreateGsFromParams(aParams,index,aBaseColors,bAccent1Background){if(!aParams)return null;var oRet=new AscFormat.CGs;oRet.pos=aParams[0];oRet.color=CreateUniColorFromPreset(aParams[1],index,aBaseColors,bAccent1Background);return oRet}function CollectSettingsUniFill(oUniFill){if(!oUniFill|| !oUniFill.fill)return 0;var ret=[];var oFill=oUniFill.fill;ret.push(oFill.type);ret.push(oUniFill.transparent);var oFillTypes=window["Asc"].c_oAscFill;switch(oFill.type){case oFillTypes.FILL_TYPE_NONE:{break}case oFillTypes.FILL_TYPE_BLIP:{ret.push(oFill.RasterImageId);break}case oFillTypes.FILL_TYPE_NOFILL:{break}case oFillTypes.FILL_TYPE_SOLID:{ret.push(CollectUniColor(oUniFill.fill.color));break}case oFillTypes.FILL_TYPE_GRAD:{ret.push(oFill.lin?[oFill.lin.angle,oFill.lin.scale]:0);ret.push(oFill.path? []:0);ret.push(oFill.rotateWithShape?[]:0);ret.push(oFill.colors.length);for(var i=0;i<oFill.colors.length;++i)ret.push(CollectGs(oFill.colors[i]));break}case oFillTypes.FILL_TYPE_PATT:{ret.push(oFill.ftype);ret.push(CollectUniColor(oFill.fgClr||AscFormat.CreateUniColorRGB(0,0,0)));ret.push(CollectUniColor(oFill.bgClr||AscFormat.CreateUniColorRGB(255,255,255)));break}case oFillTypes.FILL_TYPE_GRP:{break}}return ret}function CreateUniColorFromPreset(aPreset,index,aBaseColors,bAccent1Background){if(!aPreset)return null; var oRet=new AscFormat.CUniColor;var oColorTypes=window["Asc"].c_oAscColor;switch(aPreset[0]){case oColorTypes.COLOR_TYPE_NONE:{oRet.color=new AscFormat.CRGBColor;break}case oColorTypes.COLOR_TYPE_SRGB:{oRet.color=new AscFormat.CRGBColor;oRet.color.RGBA.R=aPreset[1]>>16&255;oRet.color.RGBA.G=aPreset[1]>>8&255;oRet.color.RGBA.R=aPreset[1]&255;break}case oColorTypes.COLOR_TYPE_PRST:{oRet.color=new AscFormat.CPrstColor;oRet.color.id=aPreset[1];break}case oColorTypes.COLOR_TYPE_SCHEME:{oRet.color=new AscFormat.CSchemeColor; oRet.color.id=aPreset[1];if(AscFormat.isRealNumber(index)&&Array.isArray(aBaseColors)&&aBaseColors[index])if(aBaseColors[index].fill&&aBaseColors[index].fill.color&&aBaseColors[index].fill.color.color&&aBaseColors[index].fill.color.color.type===oColorTypes.COLOR_TYPE_SCHEME&&oRet.color.id===0&&!bAccent1Background){oRet.color.id=aBaseColors[index].fill.color.color.id;if(aBaseColors[index].fill.color.Mods)oRet.Mods=aBaseColors[index].fill.color.Mods.createDuplicate()}break}case oColorTypes.COLOR_TYPE_SYS:{oRet.color= new AscFormat.CSysColor;oRet.color.id=aPreset[2];break}}if(aPreset[2]){if(!oRet.Mods)oRet.Mods=new AscFormat.CColorModifiers;for(var i=0;i<aPreset[2];++i){var oMod=new AscFormat.CColorMod;oMod.name=aPreset[i+3][0];oMod.val=aPreset[i+3][1];oRet.Mods.Mods.push(oMod)}}return oRet}function CreateUnifillFromPreset(aPreset,index,aBaseColors,bAccent1Background){var oRet=null;if(!aPreset)return oRet;var oUnifill=new AscFormat.CUniFill;oUnifill.transparent=aPreset[1];var oFillTypes=window["Asc"].c_oAscFill; switch(aPreset[0]){case oFillTypes.FILL_TYPE_NONE:{oUnifill.fill=new AscFormat.CNoFill;break}case oFillTypes.FILL_TYPE_BLIP:{oUnifill.fill=new AscFormat.CBlipFill;oUnifill.fill.RasterImageId=aPreset[2];break}case oFillTypes.FILL_TYPE_NOFILL:{oUnifill.fill=new AscFormat.CNoFill;break}case oFillTypes.FILL_TYPE_SOLID:{oUnifill.fill=new AscFormat.CSolidFill;oUnifill.fill.color=CreateUniColorFromPreset(aPreset[2],index,aBaseColors,bAccent1Background);break}case oFillTypes.FILL_TYPE_GRAD:{oUnifill.fill= new AscFormat.CGradFill;if(aPreset[2]){oUnifill.fill.lin=new AscFormat.GradLin;oUnifill.fill.lin.angle=aPreset[2][0];oUnifill.fill.lin.scale=aPreset[2][1]}if(Array.isArray(aPreset[3]))oUnifill.fill.path=new AscFormat.GradPath;if(Array.isArray(aPreset[4]))oUnifill.fill.rotateWithShape=true;for(var i=0;i<aPreset[5];++i)oUnifill.fill.colors.push(CreateGsFromParams(aPreset[6+i],index,aBaseColors,bAccent1Background));break}case oFillTypes.FILL_TYPE_PATT:{oUnifill.fill=new AscFormat.CPattFill;oUnifill.fill.ftype= aPreset[2];oUnifill.fill.fgClr=CreateUniColorFromPreset(aPreset[3],index,aBaseColors,bAccent1Background);oUnifill.fill.bgClr=CreateUniColorFromPreset(aPreset[4],index,aBaseColors,bAccent1Background);break}case oFillTypes.FILL_TYPE_GRP:{break}}return oUnifill}function CollectSettingsLn(oLn){if(!oLn)return 0;var ret=[];ret.push(CollectSettingsUniFill(oLn.Fill));ret.push(oLn.prstDash);if(!oLn.Join)ret.push(0);else ret.push([oLn.Join.type,oLn.Join.limit]);if(oLn.headEnd)ret.push([oLn.headEnd.type,oLn.headEnd.len, oLn.headEnd.w]);else ret.push(0);if(oLn.tailEnd)ret.push([oLn.tailEnd.type,oLn.tailEnd.len,oLn.tailEnd.w]);else ret.push(0);ret.push(oLn.algn);ret.push(oLn.cap);ret.push(oLn.cmpd);ret.push(oLn.w);return ret}function CollectSettingsSpPr(oSpPr){if(!oSpPr)return 0;return[CollectSettingsUniFill(oSpPr.Fill),CollectSettingsLn(oSpPr.ln)]}function CollectTextPr(oTxPr){if(!oTxPr||!oTxPr.content||!oTxPr.content.Content[0].Pr||!oTxPr.content.Content[0].Pr.DefaultRunPr)return 0;var oRet=[];var oTextPr=oTxPr.content.Content[0].Pr.DefaultRunPr; oRet.push(oTextPr.FontSize);oRet.push(oTextPr.Bold);oRet.push(oTextPr.Italic);oRet.push(CollectSettingsUniFill(oTextPr.Unifill));oRet.push(oTextPr.Caps);if(oTxPr.bodyPr)oRet.push([oTxPr.bodyPr.anchor,oTxPr.bodyPr.anchorCtr,oTxPr.bodyPr.rot,oTxPr.bodyPr.vert,oTxPr.bodyPr.horzOverflow,oTxPr.bodyPr.spcFirstLastPara,oTxPr.bodyPr.vertOverflow,oTxPr.bodyPr.wrap]);else oRet.push(0);return oRet}function CollectCatAxisPr(oAxis){var oRet=0;if(!oAxis)return oRet;oRet=[];oRet.push(CollectTextPr(oAxis.txPr)); oRet.push(CollectSettingsSpPr(oAxis.spPr));oRet.push(CollectSettingsSpPr(oAxis.majorGridlines));oRet.push(CollectSettingsSpPr(oAxis.minorGridlines));oRet.push(oAxis.majorTickMark);oRet.push(oAxis.minorTickMark);oRet.push(oAxis.bDelete);oRet.push(oAxis.crossBetween);oRet.push(oAxis.crosses);return oRet}function CollectValAxisPr(oAxis){var oRet=0;if(!oAxis)return oRet;oRet=[];oRet.push(CollectTextPr(oAxis.txPr));oRet.push(CollectSettingsSpPr(oAxis.spPr));oRet.push(CollectSettingsSpPr(oAxis.majorGridlines)); oRet.push(CollectSettingsSpPr(oAxis.minorGridlines));oRet.push(oAxis.majorTickMark);oRet.push(oAxis.minorTickMark);oRet.push(oAxis.bDelete);oRet.push(oAxis.crossBetween);oRet.push(oAxis.crosses);return oRet}function CollectLegendPr(oLegend){var oRet=0;if(!oLegend)return oRet;oRet=[];oRet.push(CollectTextPr(oLegend.txPr));oRet.push(CollectSettingsSpPr(oLegend.spPr));oRet.push(oLegend.legendPos);return oRet}function CollectDLbls(oDlbls){var oRet=0;if(!oDlbls)return oRet;oRet=[];oRet.push(CollectTextPr(oDlbls.txPr)); oRet.push(CollectSettingsSpPr(oDlbls.spPr));oRet.push(oDlbls.dLblPos);oRet.push(oDlbls.separator);oRet.push(oDlbls.showBubbleSize);oRet.push(oDlbls.showCatName);oRet.push(oDlbls.showLeaderLines);oRet.push(oDlbls.showLegendKey);oRet.push(oDlbls.showPercent);oRet.push(oDlbls.showSerName);oRet.push(oDlbls.showVal);return oRet}function CollectMarker(oMarker){if(!oMarker)return 0;return[oMarker.size,CollectSettingsSpPr(oMarker.spPr),oMarker.symbol]}function ApplyMarker(aPreset,oObject,index,aBaseColors){if(!oObject|| !oObject.setMarker||oObject instanceof AscFormat.CLineChart)return;if(!aPreset){oObject.setMarker(null);return}if(!oObject.marker)oObject.setMarker(new AscFormat.CMarker);oObject.marker.setSize(aPreset[0]);ApplySpPr(aPreset[1],oObject.marker,index,aBaseColors);oObject.marker.setSymbol(aPreset[2]);if(AscFormat.MARKER_SYMBOL_TYPE[0]===oObject.marker.symbol)oObject.marker.setSymbol(AscFormat.MARKER_SYMBOL_TYPE[index%9])}function CollectSettingsFromChart(oChartSpace){var oRet=[];if(!oChartSpace)return oRet; oRet.push(oChartSpace.style);oRet.push(CollectSettingsSpPr(oChartSpace.spPr));oRet.push(CollectTextPr(oChartSpace.txPr));if(oChartSpace.chart.title){oRet.push(CollectSettingsSpPr(oChartSpace.chart.title.spPr));oRet.push(CollectTextPr(oChartSpace.chart.title.txPr))}else{oRet.push(0);oRet.push(0)}oRet.push(CollectLegendPr(oChartSpace.chart.legend));if(oChartSpace.chart.plotArea){var oPlotArea=oChartSpace.chart.plotArea;oRet.push(CollectSettingsSpPr(oPlotArea.spPr));oRet.push(CollectTextPr(oPlotArea.txPr)); var oValAxData=0,oCatAxData=0;for(var i=0;i<oPlotArea.axId.length;++i){if(oPlotArea.axId[i].getObjectType()===AscDFH.historyitem_type_CatAx||oPlotArea.axId[i].getObjectType()===AscDFH.historyitem_type_DateAx||oPlotArea.axId[i].getObjectType()===AscDFH.historyitem_type_SerAx)oCatAxData=CollectCatAxisPr(oPlotArea.axId[i]);if(oPlotArea.axId[i].getObjectType()===AscDFH.historyitem_type_ValAx)oValAxData=CollectValAxisPr(oPlotArea.axId[i])}oRet.push(oCatAxData);oRet.push(oValAxData);var oChart=oPlotArea.charts[0]; oRet.push(CollectDLbls(oChart.dLbls));if(oChart.getObjectType()===AscDFH.historyitem_type_PieChart||oChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart)oRet.push(CollectSettingsSpPr(oChart.series[0]&&oChart.series[0].dPt[0]&&oChart.series[0].dPt[0].spPr));else oRet.push(CollectSettingsSpPr(oChart.series[0]&&oChart.series[0].spPr));if(oChart.getObjectType()===AscDFH.historyitem_type_PieChart||oChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart)if(oChart.series[0]&&oChart.series[0].dLbls&& oChart.series[0].dLbls.dLbl[0])oRet.push(CollectDLbls(oChart.series[0].dLbls&&oChart.series[0].dLbls.dLbl[0]&&oChart.series[0].dLbls.dLbl[0]));else oRet.push(CollectDLbls(oChart.series[0]&&oChart.series[0].dLbls));else oRet.push(CollectDLbls(oChart.series[0]&&oChart.series[0].dLbls));oRet.push(oChart.gapWidth);oRet.push(oChart.overlap);oRet.push(oChart.gapDepth);oRet.push(oChart.grouping);if(oChartSpace.chart.view3D){var oView3D=oChartSpace.chart.view3D;oRet.push([oView3D.depthPercent,oView3D.hPercent, oView3D.perspective,oView3D.rAngAx,oView3D.rotX,oView3D.rotY])}else oRet.push(0)}else oRet.push(0);if(oChartSpace.chart.backWall)oRet.push([CollectSettingsSpPr(oChartSpace.chart.backWall.spPr),oChartSpace.chart.backWall.thickness]);else oRet.push(0);if(oChartSpace.chart.floor)oRet.push([CollectSettingsSpPr(oChartSpace.chart.floor.spPr),oChartSpace.chart.floor.thickness]);else oRet.push(0);if(oChartSpace.chart.sideWall)oRet.push([CollectSettingsSpPr(oChartSpace.chart.sideWall.spPr),oChartSpace.chart.sideWall.thickness]); else oRet.push(0);oRet.push(CollectMarker(oChart.marker));oRet.push(CollectMarker(oChart.series[0]&&oChart.series[0].marker));oRet.push(CollectSettingsSpPr(oChart.hiLowLines));if(oChart.upDownBars)oRet.push([CollectSettingsSpPr(oChart.upDownBars.downBars),oChart.upDownBars.gapWidth,CollectSettingsSpPr(oChart.upDownBars.upBars)]);else oRet.push(0);return oRet}function CreateLnFromPreset(aPreset,index,aBaseColors,bAccent1Background){var oRet=null;if(!aPreset)return oRet;var oLn=new AscFormat.CLn;oLn.Fill= CreateUnifillFromPreset(aPreset[0],index,aBaseColors,bAccent1Background);oLn.prstDash=aPreset[1];if(aPreset[2]){oLn.Join=new AscFormat.LineJoin;oLn.Join.type=aPreset[2][0];oLn.Join.limit=aPreset[2][1]}if(aPreset[3]){oLn.headEnd=new AscFormat.EndArrow;oLn.headEnd.type=aPreset[3][0];oLn.headEnd.len=aPreset[3][1];oLn.headEnd.w=aPreset[3][2]}if(aPreset[4]){oLn.headEnd=new AscFormat.EndArrow;oLn.headEnd.type=aPreset[4][0];oLn.headEnd.len=aPreset[4][1];oLn.headEnd.w=aPreset[4][2]}oLn.algn=aPreset[5];oLn.cap= aPreset[6];oLn.cmpd=aPreset[7];oLn.w=aPreset[8];return oLn}function ApplySpPr(aSpPrPr,oObject,index,aBaseColors,bAccent1Background){if(!aSpPrPr){if(oObject.spPr&&oObject.spPr.xfrm){oObject.spPr.setFill(null);oObject.spPr.setLn(null);return}oObject.setSpPr(null);return}if(!oObject.spPr)oObject.setSpPr(new AscFormat.CSpPr);oObject.spPr.setParent(oObject);oObject.spPr.setFill(CreateUnifillFromPreset(aSpPrPr[0],index,aBaseColors,bAccent1Background));oObject.spPr.setLn(CreateLnFromPreset(aSpPrPr[1],index, aBaseColors,bAccent1Background))}function ApplyTxPr(aTextPr,oObject,oDrawingDocument,i,baseFills,bAccent1Background){if(!aTextPr)return;if(!oObject.txPr)oObject.setTxPr(AscFormat.CreateTextBodyFromString("",oDrawingDocument,oObject));var Pr=oObject.txPr.content.Content[0].Pr.Copy();if(!Pr.DefaultRunPr)Pr.DefaultRunPr=new CTextPr;Pr.DefaultRunPr.FontSize=aTextPr[0];Pr.DefaultRunPr.Bold=aTextPr[1];Pr.DefaultRunPr.Italic=aTextPr[2];Pr.DefaultRunPr.Unifill=CreateUnifillFromPreset(aTextPr[3],i,baseFills, bAccent1Background);Pr.DefaultRunPr.Caps=aTextPr[4];oObject.txPr.content.Content[0].Set_Pr(Pr);if(aTextPr[5]){var oBodyPr=new AscFormat.CBodyPr;oBodyPr.anchor=aTextPr[5][0];oBodyPr.anchorCtr=aTextPr[5][1];oBodyPr.rot=aTextPr[5][2];oBodyPr.vert=aTextPr[5][3];oBodyPr.horzOverflow=aTextPr[5][4];oBodyPr.spcFirstLastPara=aTextPr[5][5];oBodyPr.vertOverflow=aTextPr[5][6];oBodyPr.wrap=aTextPr[5][7];oObject.txPr.setBodyPr(oBodyPr)}}function ApplyPropsToCatAxis(aPr,oAxis,oDrawingDocument,bCreate){if(!aPr)return; ApplyTxPr(aPr[0],oAxis,oDrawingDocument);ApplySpPr(aPr[2],oAxis);if(oAxis.spPr){if(!bCreate||oAxis.majorGridlines)oAxis.setMajorGridlines(oAxis.spPr);oAxis.setSpPr(null)}else if(!bCreate)oAxis.setMajorGridlines(null);ApplySpPr(aPr[3],oAxis);if(oAxis.spPr){if(!bCreate||oAxis.minorGridlines)oAxis.setMinorGridlines(oAxis.spPr);oAxis.setSpPr(null)}else if(!bCreate)oAxis.setMinorGridlines(null);ApplySpPr(aPr[1],oAxis);if(!bCreate){oAxis.setMajorTickMark(aPr[4]);oAxis.setMinorTickMark(aPr[5]);oAxis.setDelete(aPr[6]); if(aPr.length>7){oAxis.setCrossBetween&&oAxis.setCrossBetween(aPr[7]);oAxis.setCrosses&&oAxis.setCrosses(aPr[8])}}}function ApplyPropsToValAxis(aPr,oAxis,oDrawingDocument,bCreate){if(!aPr)return;ApplyTxPr(aPr[0],oAxis,oDrawingDocument);ApplySpPr(aPr[2],oAxis);if(oAxis.spPr){if(!bCreate||oAxis.majorGridlines)oAxis.setMajorGridlines(oAxis.spPr);oAxis.setSpPr(null)}else if(!bCreate)oAxis.setMajorGridlines(null);ApplySpPr(aPr[3],oAxis);if(oAxis.spPr){if(!bCreate||oAxis.minorGridlines)oAxis.setMinorGridlines(oAxis.spPr); oAxis.setSpPr(null)}else if(!bCreate)oAxis.setMinorGridlines(null);ApplySpPr(aPr[1],oAxis);if(!bCreate){oAxis.setMajorTickMark(aPr[4]);oAxis.setMinorTickMark(aPr[5]);oAxis.setDelete(aPr[6]);if(aPr.length>7){oAxis.setCrossBetween&&oAxis.setCrossBetween(aPr[7]);oAxis.setCrosses&&oAxis.setCrosses(aPr[8])}}}function ApplyLegendProps(aPr,oLegend,oDrawingDocument,bCreate){if(!aPr||!oLegend)return;ApplyTxPr(aPr[0],oLegend,oDrawingDocument);ApplySpPr(aPr[1],oLegend);if(!bCreate)oLegend.setLegendPos(aPr[2]); oLegend.setLayout(null)}function ApplyDLblsProps(aPr,oObj,oDrawingDocument,i,baseFills,bCreate){if(!aPr||!oObj){if(oObj)oObj.setDLbls(null);return}{if(!oObj.dLbls)oObj.setDLbls(new AscFormat.CDLbls)}if(oObj.dLbls){var lbls=oObj.dLbls;lbls.setParent(oObj);if(oObj.dLbls.bDelete)if(oObj.dLbls.setDelete)oObj.dLbls.setDelete(false);ApplyTxPr(aPr[0],lbls,oDrawingDocument,i,baseFills);ApplySpPr(aPr[1],lbls,i,baseFills);{lbls.setDLblPos(aPr[2]);lbls.setSeparator(aPr[3]);lbls.setShowBubbleSize(aPr[4]);lbls.setShowCatName(aPr[5]); lbls.setShowLeaderLines(aPr[6]);lbls.setShowLegendKey(aPr[7]);lbls.setShowPercent(aPr[8]);lbls.setShowSerName(aPr[9]);lbls.setShowVal(aPr[10])}}}function ApplyPresetToChartSpace(oChartSpace,aPreset,bCreate){var oDrawingDocument=oChartSpace.getDrawingDocument();oChartSpace.setStyle(aPreset[0]);ApplySpPr(aPreset[1],oChartSpace);ApplyTxPr(aPreset[2],oChartSpace,oDrawingDocument);var bAccent1Background=false;if(oChartSpace.spPr&&oChartSpace.spPr.Fill&&oChartSpace.spPr.Fill.fill&&oChartSpace.spPr.Fill.fill.color&& oChartSpace.spPr.Fill.fill.color.color&&oChartSpace.spPr.Fill.fill.color.color.type===window["Asc"].c_oAscColor.COLOR_TYPE_SCHEME&&oChartSpace.spPr.Fill.fill.color.color.id===0)bAccent1Background=true;if(bCreate&&!oChartSpace.chart.title){oChartSpace.chart.setTitle(new AscFormat.CTitle);oChartSpace.chart.title.setOverlay(false)}if(oChartSpace.chart.title){ApplySpPr(aPreset[3],oChartSpace.chart.title);ApplyTxPr(aPreset[4],oChartSpace.chart.title,oDrawingDocument);if(oChartSpace.chart.title.layout)oChartSpace.chart.title.setLayout(null)}var style= AscFormat.CHART_STYLE_MANAGER.getStyleByIndex(aPreset[0]);if(!aPreset[5]&&!bCreate)oChartSpace.chart.setLegend(null);else if(!bCreate&&aPreset[5])oChartSpace.chart.legend&&oChartSpace.chart.legend.setOverlay(false);ApplyLegendProps(aPreset[5],oChartSpace.chart.legend,oDrawingDocument,bCreate);var oPlotArea=oChartSpace.chart.plotArea;if(oPlotArea.layout)oPlotArea.setLayout(null);ApplySpPr(aPreset[6],oPlotArea);ApplyTxPr(aPreset[7],oPlotArea,oDrawingDocument);var oAxisByTypes=oPlotArea.getAxisByTypes(); for(var i=0;i<oAxisByTypes.catAx.length;++i)ApplyPropsToCatAxis(aPreset[8],oAxisByTypes.catAx[i],oDrawingDocument,bCreate);for(i=0;i<oAxisByTypes.valAx.length;++i)ApplyPropsToValAxis(aPreset[9],oAxisByTypes.valAx[i],oDrawingDocument,bCreate);var oChart=oPlotArea.charts[0],base_fills;var ser,lit=null,val=null;ApplyDLblsProps(aPreset[10],oChart,oDrawingDocument,undefined,undefined,bCreate);for(i=0;i<oChart.series.length;++i){lit=null;ser=oChart.series[i];val=ser.val||ser.yVal;var pts=AscFormat.getPtsFromSeries(ser); if(val)if(val.numRef&&val.numRef.numCache)lit=val.numRef.numCache;else if(val.numLit)lit=val.numLit;var ptCount;if(lit&&AscFormat.isRealNumber(lit.ptCount))ptCount=Math.max(lit.ptCount,AscFormat.getMaxIdx(pts));else ptCount=AscFormat.getMaxIdx(pts);var oDPt;if(oChart.getObjectType()===AscDFH.historyitem_type_PieChart||oChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart){base_fills=AscFormat.getArrayFillsFromBase(style.fill2,ptCount);for(j=0;j<ptCount;++j){oDPt=null;if(oChart.series[i].getDptByIdx)oDPt= oChart.series[i].getDptByIdx(j);if(!oDPt){oDPt=new AscFormat.CDPt;oDPt.setIdx(j);oChart.series[i].addDPt(oDPt)}if(oDPt.bubble3D!==false)oDPt.setBubble3D(false);ApplySpPr(aPreset[11],oDPt,j,base_fills,bAccent1Background)}for(j=0;j<oChart.series[i].dPt.length;++j)if(oChart.series[i].dPt[j].idx>=ptCount)oChart.series[i].removeDPt(j)}else{for(var j=oChart.series[i].dPt.length-1;j>-1;--j)oChart.series[i].removeDPt(j);base_fills=AscFormat.getArrayFillsFromBase(style.fill2,oChart.series.length);ApplySpPr(aPreset[11], oChart.series[i],i,base_fills,bAccent1Background)}if(oChart.getObjectType()===AscDFH.historyitem_type_PieChart||oChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart){ApplyDLblsProps(aPreset[12],oChart.series[i],oDrawingDocument,i,base_fills,true);if(oChart.series[i].dLbls)for(var j=0;j<ptCount;++j){var oDLbl=oChart.series[i].dLbls.findDLblByIdx(j);if(!oDLbl){oDLbl=new AscFormat.CDLbl;oChart.series[i].dLbls.addDLbl(oDLbl);oDLbl.setIdx(j)}ApplyTxPr(aPreset[12][0],oDLbl,oDrawingDocument,j, base_fills,bAccent1Background);ApplySpPr(aPreset[12][1],oDLbl,j,base_fills,bAccent1Background);oDLbl.setDLblPos(aPreset[12][2]);oDLbl.setSeparator(aPreset[12][3]);oDLbl.setShowBubbleSize(aPreset[12][4]);oDLbl.setShowCatName(aPreset[12][5]);oDLbl.setShowLegendKey(aPreset[12][7]);oDLbl.setShowPercent(aPreset[12][8]);oDLbl.setShowSerName(aPreset[12][9]);oDLbl.setShowVal(aPreset[12][10])}}else ApplyDLblsProps(aPreset[12],oChart.series[i],oDrawingDocument,i,base_fills,true)}if(oChart.getObjectType()=== AscDFH.historyitem_type_PieChart||oChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart)oChart.setVaryColors(true);else if(oChart.setVaryColors)oChart.setVaryColors(false);if(oChart.setGapWidth)oChart.setGapWidth(aPreset[13]);if(oChart.setOverlap)oChart.setOverlap(aPreset[14]);if(oChart.setGapDepth)oChart.setGapDepth(aPreset[15]);if(oChart.setGrouping)oChart.setGrouping(aPreset[16]);if(aPreset[17]){if(!oChartSpace.chart.view3D)oChartSpace.chart.setView3D(new AscFormat.CView3d);oChartSpace.chart.view3D.setDepthPercent(aPreset[17][0]); oChartSpace.chart.view3D.setHPercent(aPreset[17][1]);oChartSpace.chart.view3D.setPerspective(aPreset[17][2]);oChartSpace.chart.view3D.setRAngAx(aPreset[17][3]);oChartSpace.chart.view3D.setRotX(aPreset[17][4]);oChartSpace.chart.view3D.setRotY(aPreset[17][5])}else oChartSpace.chart.setView3D(null);if(aPreset[18]){if(!oChartSpace.chart.backWall)oChartSpace.chart.setBackWall(new AscFormat.CChartWall);ApplySpPr(aPreset[18][0],oChartSpace.chart.backWall);oChartSpace.chart.backWall.setThickness(aPreset[18][1])}else oChartSpace.chart.setBackWall(null); if(aPreset[19]){if(!oChartSpace.chart.floor)oChartSpace.chart.setFloor(new AscFormat.CChartWall);ApplySpPr(aPreset[19][0],oChartSpace.chart.floor);oChartSpace.chart.floor.setThickness(aPreset[19][1])}else oChartSpace.chart.setFloor(null);if(aPreset[20]){if(!oChartSpace.chart.sideWall)oChartSpace.chart.setSideWall(new AscFormat.CChartWall);ApplySpPr(aPreset[20][0],oChartSpace.chart.sideWall);oChartSpace.chart.sideWall.setThickness(aPreset[20][1])}else oChartSpace.chart.setSideWall(null);ApplyMarker(aPreset[21], oChart);for(var i=0;i<oChart.series.length;++i)ApplyMarker(aPreset[22],oChart.series[i],i,base_fills,bCreate);if(oChart.getObjectType()===AscDFH.historyitem_type_StockChart){var oSpPr=oChartSpace.spPr;if(oChart.hiLowLines){oChartSpace.spPr=oChart.hiLowLines;ApplySpPr(aPreset[23],oChartSpace)}else{oChartSpace.spPr=new AscFormat.CSpPr;ApplySpPr(aPreset[23],oChartSpace);oChart.setHiLowLines(oChartSpace.spPr)}if(!aPreset[24])oChart.setUpDownBars(null);else{if(!oChart.upDownBars)oChart.setUpDownBars(new AscFormat.CUpDownBars); if(oChart.upDownBars.downBars){oChartSpace.spPr=oChart.upDownBars.downBars;ApplySpPr(aPreset[24][0],oChartSpace)}else{oChartSpace.spPr=new AscFormat.CSpPr;ApplySpPr(aPreset[24][0],oChartSpace);oChart.upDownBars.setDownBars(oChartSpace.spPr)}oChart.upDownBars.setGapWidth(aPreset[24][1]);if(oChart.upDownBars.upBars){oChartSpace.spPr=oChart.upDownBars.upBars;ApplySpPr(aPreset[24][2],oChartSpace)}else{oChartSpace.spPr=new AscFormat.CSpPr;ApplySpPr(aPreset[24][2],oChartSpace);oChart.upDownBars.setUpBars(oChartSpace.spPr)}}oChartSpace.spPr= oSpPr}}function CMathPainter(_api){this.Api=_api;this.StartLoad=function(){var loader=AscCommon.g_font_loader;var fontinfo=g_fontApplication.GetFontInfo("Cambria Math");if(undefined===fontinfo)return;var isasync=loader.LoadFont(fontinfo,this.Api.asyncFontEndLoaded_MathDraw,this);if(false===isasync)this.Generate()};this.Generate2=function(){var bTurnOnId=false;if(false===g_oTableId.m_bTurnOff){g_oTableId.m_bTurnOff=true;bTurnOnId=true}History.TurnOff();var _math=new AscCommon.CAscMathCategory;var _canvas= document.createElement("canvas");var _sizes=[{w:25,h:25},{w:50,h:50},{w:50,h:50},{w:115,h:55},{w:60,h:60},{w:100,h:75},{w:80,h:75},{w:100,h:50},{w:100,h:40},{w:100,h:60},{w:60,h:40},{w:100,h:70}];var _excluded_arr=[c_oAscMathType.Bracket_Custom_5];var _excluded_obj={};for(var k=0;k<_excluded_arr.length;k++)_excluded_obj[""+_excluded_arr[k]]=true;var _types=[];for(var _name in c_oAscMathType){if(_excluded_obj[""+c_oAscMathType[_name]]!==undefined)continue;_types.push(c_oAscMathType[_name])}_types.sort(function(a, b){return a-b});var raster_koef=1;var _total_image=new AscFonts.CRasterHeapTotal;_total_image.CreateFirstChuck(1500*raster_koef,5E3*raster_koef);_total_image.Chunks[0].FindOnlyEqualHeight=true;_total_image.Chunks[0].CanvasCtx.globalCompositeOperation="source-over";var _types_len=_types.length;for(var t=0;t<_types_len;t++){var _type=_types[t];var _category1=_type>>24&255;var _category2=_type>>16&255;_type&=65535;if(undefined==_math.Data[_category1]){_math.Data[_category1]=new AscCommon.CAscMathCategory; _math.Data[_category1].Id=_category1;_math.Data[_category1].W=_sizes[_category1].w;_math.Data[_category1].H=_sizes[_category1].h}if(undefined==_math.Data[_category1].Data[_category2]){_math.Data[_category1].Data[_category2]=new AscCommon.CAscMathCategory;_math.Data[_category1].Data[_category2].Id=_category2;_math.Data[_category1].Data[_category2].W=_sizes[_category1].w;_math.Data[_category1].Data[_category2].H=_sizes[_category1].h}var _menuType=new AscCommon.CAscMathType;_menuType.Id=_types[t];var _paraMath= new ParaMath;_paraMath.Root.Load_FromMenu(_menuType.Id);_paraMath.Root.Correct_Content(true);_paraMath.MathToImageConverter(false,_canvas,_sizes[_category1].w,_sizes[_category1].h,raster_koef);var _place=_total_image.Alloc(_canvas.width,_canvas.height);var _x=_place.Line.Height*_place.Index;var _y=_place.Line.Y;_menuType.X=_x;_menuType.Y=_y;_math.Data[_category1].Data[_category2].Data.push(_menuType);_total_image.Chunks[0].CanvasCtx.drawImage(_canvas,_x,_y)}var _total_w=_total_image.Chunks[0].CanvasImage.width; var _total_h=_total_image.Chunks[0].LinesFree[0].Y;var _total_canvas=document.createElement("canvas");_total_canvas.width=_total_w;_total_canvas.height=_total_h;_total_canvas.getContext("2d").drawImage(_total_image.Chunks[0].CanvasImage,0,0);var _url_total=_total_canvas.toDataURL("image/png");var _json_formulas=JSON.stringify(_math);_canvas=null;if(true===bTurnOnId)g_oTableId.m_bTurnOff=false;History.TurnOn();this.Api.sendMathTypesToMenu(_math)};this.Generate=function(){var _math_json=JSON.parse('{"Id":0,"Data":[{"Id":0,"Data":[{"Id":0,"Data":[{"Id":0,"X":0,"Y":0},{"Id":1,"X":25,"Y":0},{"Id":2,"X":50,"Y":0},{"Id":3,"X":75,"Y":0},{"Id":4,"X":100,"Y":0},{"Id":5,"X":125,"Y":0},{"Id":6,"X":150,"Y":0},{"Id":7,"X":175,"Y":0},{"Id":8,"X":200,"Y":0},{"Id":9,"X":225,"Y":0},{"Id":10,"X":250,"Y":0},{"Id":11,"X":275,"Y":0},{"Id":12,"X":300,"Y":0},{"Id":13,"X":325,"Y":0},{"Id":14,"X":350,"Y":0},{"Id":15,"X":375,"Y":0},{"Id":16,"X":400,"Y":0},{"Id":17,"X":425,"Y":0},{"Id":18,"X":450,"Y":0},{"Id":19,"X":475,"Y":0},{"Id":20,"X":500,"Y":0},{"Id":21,"X":525,"Y":0},{"Id":22,"X":550,"Y":0},{"Id":23,"X":575,"Y":0},{"Id":24,"X":600,"Y":0},{"Id":25,"X":625,"Y":0},{"Id":26,"X":650,"Y":0},{"Id":27,"X":675,"Y":0},{"Id":28,"X":700,"Y":0},{"Id":29,"X":725,"Y":0},{"Id":30,"X":750,"Y":0},{"Id":31,"X":775,"Y":0},{"Id":32,"X":800,"Y":0},{"Id":33,"X":825,"Y":0},{"Id":34,"X":850,"Y":0},{"Id":35,"X":875,"Y":0},{"Id":36,"X":900,"Y":0},{"Id":37,"X":925,"Y":0},{"Id":38,"X":950,"Y":0},{"Id":39,"X":975,"Y":0},{"Id":40,"X":1000,"Y":0},{"Id":41,"X":1025,"Y":0},{"Id":42,"X":1050,"Y":0},{"Id":43,"X":1075,"Y":0},{"Id":44,"X":1100,"Y":0},{"Id":45,"X":1125,"Y":0},{"Id":46,"X":1150,"Y":0},{"Id":47,"X":1175,"Y":0},{"Id":48,"X":1200,"Y":0},{"Id":49,"X":1225,"Y":0},{"Id":50,"X":1250,"Y":0},{"Id":51,"X":1275,"Y":0},{"Id":52,"X":1300,"Y":0},{"Id":53,"X":1325,"Y":0},{"Id":54,"X":1350,"Y":0},{"Id":55,"X":1375,"Y":0}],"W":25,"H":25},{"Id":1,"Data":[{"Id":65536,"X":1400,"Y":0},{"Id":65537,"X":1425,"Y":0},{"Id":65538,"X":1450,"Y":0},{"Id":65539,"X":1475,"Y":0},{"Id":65540,"X":0,"Y":25},{"Id":65541,"X":25,"Y":25},{"Id":65542,"X":50,"Y":25},{"Id":65543,"X":75,"Y":25},{"Id":65544,"X":100,"Y":25},{"Id":65545,"X":125,"Y":25},{"Id":65546,"X":150,"Y":25},{"Id":65547,"X":175,"Y":25},{"Id":65548,"X":200,"Y":25},{"Id":65549,"X":225,"Y":25},{"Id":65550,"X":250,"Y":25},{"Id":65551,"X":275,"Y":25},{"Id":65552,"X":300,"Y":25},{"Id":65553,"X":325,"Y":25},{"Id":65554,"X":350,"Y":25},{"Id":65555,"X":375,"Y":25},{"Id":65556,"X":400,"Y":25},{"Id":65557,"X":425,"Y":25},{"Id":65558,"X":450,"Y":25},{"Id":65559,"X":475,"Y":25},{"Id":65560,"X":500,"Y":25},{"Id":65561,"X":525,"Y":25},{"Id":65562,"X":550,"Y":25},{"Id":65563,"X":575,"Y":25},{"Id":65564,"X":600,"Y":25},{"Id":65565,"X":625,"Y":25}],"W":25,"H":25},{"Id":2,"Data":[{"Id":131072,"X":650,"Y":25},{"Id":131073,"X":675,"Y":25},{"Id":131074,"X":700,"Y":25},{"Id":131075,"X":725,"Y":25},{"Id":131076,"X":750,"Y":25},{"Id":131077,"X":775,"Y":25},{"Id":131078,"X":800,"Y":25},{"Id":131079,"X":825,"Y":25},{"Id":131080,"X":850,"Y":25},{"Id":131081,"X":875,"Y":25},{"Id":131082,"X":900,"Y":25},{"Id":131083,"X":925,"Y":25},{"Id":131084,"X":950,"Y":25},{"Id":131085,"X":975,"Y":25},{"Id":131086,"X":1000,"Y":25},{"Id":131087,"X":1025,"Y":25},{"Id":131088,"X":1050,"Y":25},{"Id":131089,"X":1075,"Y":25},{"Id":131090,"X":1100,"Y":25},{"Id":131091,"X":1125,"Y":25},{"Id":131092,"X":1150,"Y":25},{"Id":131093,"X":1175,"Y":25},{"Id":131094,"X":1200,"Y":25},{"Id":131095,"X":1225,"Y":25}],"W":25,"H":25}],"W":25,"H":25},{"Id":1,"Data":[{"Id":0,"Data":[{"Id":16777216,"X":0,"Y":50},{"Id":16777217,"X":50,"Y":50},{"Id":16777218,"X":100,"Y":50},{"Id":16777219,"X":150,"Y":50}],"W":50,"H":50},{"Id":1,"Data":[{"Id":16842752,"X":200,"Y":50},{"Id":16842753,"X":250,"Y":50},{"Id":16842754,"X":300,"Y":50},{"Id":16842755,"X":350,"Y":50},{"Id":16842756,"X":400,"Y":50}],"W":50,"H":50}],"W":50,"H":50},{"Id":2,"Data":[{"Id":0,"Data":[{"Id":33554432,"X":450,"Y":50},{"Id":33554433,"X":500,"Y":50},{"Id":33554434,"X":550,"Y":50},{"Id":33554435,"X":600,"Y":50}],"W":50,"H":50},{"Id":1,"Data":[{"Id":33619968,"X":650,"Y":50},{"Id":33619969,"X":700,"Y":50},{"Id":33619970,"X":750,"Y":50},{"Id":33619971,"X":800,"Y":50}],"W":50,"H":50}],"W":50,"H":50},{"Id":3,"Data":[{"Id":0,"Data":[{"Id":50331648,"X":0,"Y":100},{"Id":50331649,"X":115,"Y":100},{"Id":50331650,"X":230,"Y":100},{"Id":50331651,"X":345,"Y":100}],"W":115,"H":55},{"Id":1,"Data":[{"Id":50397184,"X":460,"Y":100},{"Id":50397185,"X":575,"Y":100}],"W":115,"H":55}],"W":115,"H":55},{"Id":4,"Data":[{"Id":0,"Data":[{"Id":67108864,"X":690,"Y":100},{"Id":67108865,"X":805,"Y":100},{"Id":67108866,"X":920,"Y":100},{"Id":67108867,"X":1035,"Y":100},{"Id":67108868,"X":1150,"Y":100},{"Id":67108869,"X":1265,"Y":100},{"Id":67108870,"X":1380,"Y":100},{"Id":67108871,"X":0,"Y":215},{"Id":67108872,"X":60,"Y":215}],"W":60,"H":60},{"Id":1,"Data":[{"Id":67174400,"X":120,"Y":215},{"Id":67174401,"X":180,"Y":215},{"Id":67174402,"X":240,"Y":215},{"Id":67174403,"X":300,"Y":215},{"Id":67174404,"X":360,"Y":215},{"Id":67174405,"X":420,"Y":215},{"Id":67174406,"X":480,"Y":215},{"Id":67174407,"X":540,"Y":215},{"Id":67174408,"X":600,"Y":215}],"W":60,"H":60},{"Id":2,"Data":[{"Id":67239936,"X":660,"Y":215},{"Id":67239937,"X":720,"Y":215},{"Id":67239938,"X":780,"Y":215}],"W":60,"H":60}],"W":60,"H":60},{"Id":5,"Data":[{"Id":0,"Data":[{"Id":83886080,"X":0,"Y":275},{"Id":83886081,"X":100,"Y":275},{"Id":83886082,"X":200,"Y":275},{"Id":83886083,"X":300,"Y":275},{"Id":83886084,"X":400,"Y":275}],"W":100,"H":75},{"Id":1,"Data":[{"Id":83951616,"X":500,"Y":275},{"Id":83951617,"X":600,"Y":275},{"Id":83951618,"X":700,"Y":275},{"Id":83951619,"X":800,"Y":275},{"Id":83951620,"X":900,"Y":275},{"Id":83951621,"X":1000,"Y":275},{"Id":83951622,"X":1100,"Y":275},{"Id":83951623,"X":1200,"Y":275},{"Id":83951624,"X":1300,"Y":275},{"Id":83951625,"X":1400,"Y":275}],"W":100,"H":75},{"Id":2,"Data":[{"Id":84017152,"X":0,"Y":375},{"Id":84017153,"X":100,"Y":375},{"Id":84017154,"X":200,"Y":375},{"Id":84017155,"X":300,"Y":375},{"Id":84017156,"X":400,"Y":375},{"Id":84017157,"X":500,"Y":375},{"Id":84017158,"X":600,"Y":375},{"Id":84017159,"X":700,"Y":375},{"Id":84017160,"X":800,"Y":375},{"Id":84017161,"X":900,"Y":375}],"W":100,"H":75},{"Id":3,"Data":[{"Id":84082688,"X":1000,"Y":375},{"Id":84082689,"X":1100,"Y":375},{"Id":84082690,"X":1200,"Y":375},{"Id":84082691,"X":1300,"Y":375},{"Id":84082692,"X":1400,"Y":375},{"Id":84082693,"X":0,"Y":475},{"Id":84082694,"X":100,"Y":475},{"Id":84082695,"X":200,"Y":475},{"Id":84082696,"X":300,"Y":475},{"Id":84082697,"X":400,"Y":475}],"W":100,"H":75},{"Id":4,"Data":[{"Id":84148224,"X":500,"Y":475},{"Id":84148225,"X":600,"Y":475},{"Id":84148226,"X":700,"Y":475},{"Id":84148227,"X":800,"Y":475},{"Id":84148228,"X":900,"Y":475}],"W":100,"H":75}],"W":100,"H":75},{"Id":6,"Data":[{"Id":0,"Data":[{"Id":100663296,"X":1000,"Y":475},{"Id":100663297,"X":1100,"Y":475},{"Id":100663298,"X":1200,"Y":475},{"Id":100663299,"X":1300,"Y":475},{"Id":100663300,"X":1400,"Y":475},{"Id":100663301,"X":0,"Y":575},{"Id":100663302,"X":80,"Y":575},{"Id":100663303,"X":160,"Y":575},{"Id":100663304,"X":240,"Y":575},{"Id":100663305,"X":320,"Y":575},{"Id":100663306,"X":400,"Y":575},{"Id":100663307,"X":480,"Y":575}],"W":80,"H":75},{"Id":1,"Data":[{"Id":100728832,"X":560,"Y":575},{"Id":100728833,"X":640,"Y":575},{"Id":100728834,"X":720,"Y":575},{"Id":100728835,"X":800,"Y":575}],"W":80,"H":75},{"Id":2,"Data":[{"Id":100794368,"X":880,"Y":575},{"Id":100794369,"X":960,"Y":575},{"Id":100794370,"X":1040,"Y":575},{"Id":100794371,"X":1120,"Y":575},{"Id":100794372,"X":1200,"Y":575},{"Id":100794373,"X":1280,"Y":575},{"Id":100794374,"X":1360,"Y":575},{"Id":100794375,"X":0,"Y":655},{"Id":100794376,"X":80,"Y":655},{"Id":100794377,"X":160,"Y":655},{"Id":100794378,"X":240,"Y":655},{"Id":100794379,"X":320,"Y":655},{"Id":100794380,"X":400,"Y":655},{"Id":100794381,"X":480,"Y":655},{"Id":100794382,"X":560,"Y":655},{"Id":100794383,"X":640,"Y":655},{"Id":100794384,"X":720,"Y":655},{"Id":100794385,"X":800,"Y":655}],"W":80,"H":75},{"Id":3,"Data":[{"Id":100859904,"X":880,"Y":655},{"Id":100859905,"X":960,"Y":655},{"Id":100859906,"X":1040,"Y":655},{"Id":100859907,"X":1120,"Y":655}],"W":80,"H":75},{"Id":4,"Data":[{"Id":100925441,"X":1200,"Y":655},{"Id":100925442,"X":1280,"Y":655}],"W":80,"H":75}],"W":80,"H":75},{"Id":7,"Data":[{"Id":0,"Data":[{"Id":117440512,"X":0,"Y":735},{"Id":117440513,"X":100,"Y":735},{"Id":117440514,"X":200,"Y":735},{"Id":117440515,"X":300,"Y":735},{"Id":117440516,"X":400,"Y":735},{"Id":117440517,"X":500,"Y":735}],"W":100,"H":50},{"Id":1,"Data":[{"Id":117506048,"X":600,"Y":735},{"Id":117506049,"X":700,"Y":735},{"Id":117506050,"X":800,"Y":735},{"Id":117506051,"X":900,"Y":735},{"Id":117506052,"X":1000,"Y":735},{"Id":117506053,"X":1100,"Y":735}],"W":100,"H":50},{"Id":2,"Data":[{"Id":117571584,"X":1200,"Y":735},{"Id":117571585,"X":1300,"Y":735},{"Id":117571586,"X":1400,"Y":735},{"Id":117571587,"X":0,"Y":835},{"Id":117571588,"X":100,"Y":835},{"Id":117571589,"X":200,"Y":835}],"W":100,"H":50},{"Id":3,"Data":[{"Id":117637120,"X":300,"Y":835},{"Id":117637121,"X":400,"Y":835},{"Id":117637122,"X":500,"Y":835},{"Id":117637123,"X":600,"Y":835},{"Id":117637124,"X":700,"Y":835},{"Id":117637125,"X":800,"Y":835}],"W":100,"H":50},{"Id":4,"Data":[{"Id":117702656,"X":900,"Y":835},{"Id":117702657,"X":1000,"Y":835},{"Id":117702658,"X":1100,"Y":835}],"W":100,"H":50}],"W":100,"H":50},{"Id":8,"Data":[{"Id":0,"Data":[{"Id":134217728,"X":1200,"Y":835},{"Id":134217729,"X":1300,"Y":835},{"Id":134217730,"X":1400,"Y":835},{"Id":134217731,"X":0,"Y":935},{"Id":134217732,"X":100,"Y":935},{"Id":134217733,"X":200,"Y":935},{"Id":134217734,"X":300,"Y":935},{"Id":134217735,"X":400,"Y":935},{"Id":134217736,"X":500,"Y":935},{"Id":134217737,"X":600,"Y":935},{"Id":134217738,"X":700,"Y":935},{"Id":134217739,"X":800,"Y":935},{"Id":134217740,"X":900,"Y":935},{"Id":134217741,"X":1000,"Y":935},{"Id":134217742,"X":1100,"Y":935},{"Id":134217743,"X":1200,"Y":935},{"Id":134217744,"X":1300,"Y":935},{"Id":134217745,"X":1400,"Y":935},{"Id":134217746,"X":0,"Y":1035},{"Id":134217747,"X":100,"Y":1035}],"W":100,"H":40},{"Id":1,"Data":[{"Id":134283264,"X":200,"Y":1035},{"Id":134283265,"X":300,"Y":1035}],"W":100,"H":40},{"Id":2,"Data":[{"Id":134348800,"X":400,"Y":1035},{"Id":134348801,"X":500,"Y":1035}],"W":100,"H":40},{"Id":3,"Data":[{"Id":134414336,"X":600,"Y":1035},{"Id":134414337,"X":700,"Y":1035},{"Id":134414338,"X":800,"Y":1035}],"W":100,"H":40}],"W":100,"H":40},{"Id":9,"Data":[{"Id":0,"Data":[{"Id":150994944,"X":900,"Y":1035},{"Id":150994945,"X":1000,"Y":1035},{"Id":150994946,"X":1100,"Y":1035},{"Id":150994947,"X":1200,"Y":1035},{"Id":150994948,"X":1300,"Y":1035},{"Id":150994949,"X":1400,"Y":1035}],"W":100,"H":60},{"Id":1,"Data":[{"Id":151060480,"X":0,"Y":1135},{"Id":151060481,"X":100,"Y":1135}],"W":100,"H":60}],"W":100,"H":60},{"Id":10,"Data":[{"Id":0,"Data":[{"Id":167772160,"X":840,"Y":215},{"Id":167772161,"X":900,"Y":215},{"Id":167772162,"X":960,"Y":215},{"Id":167772163,"X":1020,"Y":215},{"Id":167772164,"X":1080,"Y":215},{"Id":167772165,"X":1140,"Y":215},{"Id":167772166,"X":1200,"Y":215}],"W":60,"H":40},{"Id":1,"Data":[{"Id":167837696,"X":1260,"Y":215},{"Id":167837697,"X":1320,"Y":215},{"Id":167837698,"X":1380,"Y":215},{"Id":167837699,"X":1440,"Y":215},{"Id":167837700,"X":1360,"Y":655},{"Id":167837701,"X":200,"Y":1135},{"Id":167837702,"X":300,"Y":1135},{"Id":167837703,"X":400,"Y":1135},{"Id":167837704,"X":500,"Y":1135},{"Id":167837705,"X":600,"Y":1135},{"Id":167837706,"X":700,"Y":1135},{"Id":167837707,"X":800,"Y":1135}],"W":60,"H":40},{"Id":2,"Data":[{"Id":167903232,"X":900,"Y":1135},{"Id":167903233,"X":1000,"Y":1135}],"W":60,"H":40}],"W":60,"H":40},{"Id":11,"Data":[{"Id":0,"Data":[{"Id":184549376,"X":1100,"Y":1135},{"Id":184549377,"X":1200,"Y":1135},{"Id":184549378,"X":1300,"Y":1135},{"Id":184549379,"X":1400,"Y":1135},{"Id":184549380,"X":0,"Y":1235},{"Id":184549381,"X":100,"Y":1235},{"Id":184549382,"X":200,"Y":1235},{"Id":184549383,"X":300,"Y":1235}],"W":100,"H":70},{"Id":1,"Data":[{"Id":184614912,"X":400,"Y":1235},{"Id":184614913,"X":500,"Y":1235},{"Id":184614914,"X":600,"Y":1235},{"Id":184614915,"X":700,"Y":1235}],"W":100,"H":70},{"Id":2,"Data":[{"Id":184680448,"X":800,"Y":1235},{"Id":184680449,"X":900,"Y":1235},{"Id":184680450,"X":1000,"Y":1235},{"Id":184680451,"X":1100,"Y":1235}],"W":100,"H":70},{"Id":3,"Data":[{"Id":184745984,"X":1200,"Y":1235},{"Id":184745985,"X":1300,"Y":1235},{"Id":184745986,"X":1400,"Y":1235},{"Id":184745987,"X":0,"Y":1335}],"W":100,"H":70},{"Id":4,"Data":[{"Id":184811520,"X":100,"Y":1335},{"Id":184811521,"X":200,"Y":1335}],"W":100,"H":70}],"W":100,"H":70}],"W":0,"H":0}'); var _math=new AscCommon.CAscMathCategory;var _len1=_math_json["Data"].length;for(var i1=0;i1<_len1;i1++){var _catJS1=_math_json["Data"][i1];var _cat1=new AscCommon.CAscMathCategory;_cat1.Id=_catJS1["Id"];_cat1.W=_catJS1["W"];_cat1.H=_catJS1["H"];var _len2=_catJS1["Data"].length;for(var i2=0;i2<_len2;i2++){var _catJS2=_catJS1["Data"][i2];var _cat2=new AscCommon.CAscMathCategory;_cat2.Id=_catJS2["Id"];_cat2.W=_catJS2["W"];_cat2.H=_catJS2["H"];var _len3=_catJS2["Data"].length;for(var i3=0;i3<_len3;i3++){var _typeJS= _catJS2["Data"][i3];var _type=new AscCommon.CAscMathType;_type.Id=_typeJS["Id"];_type.X=_typeJS["X"];_type.Y=_typeJS["Y"];_cat2.Data.push(_type)}_cat1.Data.push(_cat2)}_math.Data.push(_cat1)}this.Api.sendMathTypesToMenu(_math)}}function fCreateSignatureShape(oPr,bWord,wsModel,Width,Height,sImgUrl){var oShape=new AscFormat.CShape;oShape.setWordShape(bWord===true);oShape.setBDeleted(false);if(wsModel)oShape.setWorksheet(wsModel);var oSpPr=new AscFormat.CSpPr;var oXfrm=new AscFormat.CXfrm;oXfrm.setOffX(0); oXfrm.setOffY(0);if(AscFormat.isRealNumber(Width)&&AscFormat.isRealNumber(Height)){oXfrm.setExtX(Width);oXfrm.setExtY(Height)}else{oXfrm.setExtX(1828800/36E3);oXfrm.setExtY(1828800/36E3)}if(typeof sImgUrl==="string"&&sImgUrl.length>0){var oBlipFillUnifill=AscFormat.CreateBlipFillUniFillFromUrl(sImgUrl);oSpPr.setFill(oBlipFillUnifill)}else oSpPr.setFill(AscFormat.CreateNoFillUniFill());oSpPr.setXfrm(oXfrm);oXfrm.setParent(oSpPr);oSpPr.setLn(AscFormat.CreateNoFillLine());oSpPr.setGeometry(AscFormat.CreateGeometry("rect")); oShape.setSpPr(oSpPr);oSpPr.setParent(oShape);var oSignatureLine=new AscFormat.CSignatureLine;oSignatureLine.id=AscCommon.CreateGUID();oSignatureLine.setProperties(oPr);oShape.setSignature(oSignatureLine);return oShape}function fGetListTypeFromBullet(Bullet){var ListType={Type:-1,SubType:-1};if(Bullet)if(Bullet&&Bullet.bulletType)switch(Bullet.bulletType.type){case AscFormat.BULLET_TYPE_BULLET_CHAR:{ListType.Type=0;ListType.SubType=undefined;switch(Bullet.bulletType.Char){case "\u2022":{ListType.SubType= 1;break}case "o":{ListType.SubType=2;break}case "\u00a7":{ListType.SubType=3;break}case String.fromCharCode(118):{ListType.SubType=4;break}case String.fromCharCode(216):{ListType.SubType=5;break}case String.fromCharCode(252):{ListType.SubType=6;break}case String.fromCharCode(119):{ListType.SubType=7;break}case String.fromCharCode(8211):{ListType.SubType=8;break}}break}case AscFormat.BULLET_TYPE_BULLET_BLIP:{ListType.Type=0;ListType.SubType=undefined;break}case AscFormat.BULLET_TYPE_BULLET_AUTONUM:{ListType.Type= 1;ListType.SubType=undefined;if(AscFormat.isRealNumber(Bullet.bulletType.AutoNumType)){var AutoNumType=undefined;switch(Bullet.bulletType.AutoNumType){case 1:{AutoNumType=5;break}case 2:{AutoNumType=6;break}case 5:{AutoNumType=4;break}case 11:{AutoNumType=2;break}case 12:{AutoNumType=1;break}case 31:{AutoNumType=7;break}case 34:{AutoNumType=3;break}}if(AscFormat.isRealNumber(AutoNumType)&&AutoNumType>0&&AutoNumType<9)ListType.SubType=AutoNumType}break}}return ListType}function fGetFontByNumInfo(Type, SubType){if(!AscFormat.isRealNumber(Type)||!AscFormat.isRealNumber(SubType))return null;if(SubType>=0)if(Type===0)switch(SubType){case 0:case 1:case 8:{return"Arial"}case 2:{return"Courier New"}case 3:case 4:case 5:case 6:case 7:{return"Wingdings"}}return null}function getNumberingType(nType){var numberingType=12;switch(nType){case 0:case 1:{numberingType=12;break}case 2:{numberingType=11;break}case 3:{numberingType=34;break}case 4:{numberingType=5;break}case 5:{numberingType=1;break}case 6:{numberingType= 2;break}case 7:{numberingType=31;break}case 8:{break}case 9:{break}case 10:{break}}return numberingType}function fFillBullet(NumInfo,bullet){if(NumInfo.SubType<0){bullet.bulletType=new AscFormat.CBulletType;bullet.bulletType.type=AscFormat.BULLET_TYPE_BULLET_NONE}else switch(NumInfo.Type){case 0:{switch(NumInfo.SubType){case 0:case 1:{var bulletText="\u2022";bullet.bulletTypeface=new AscFormat.CBulletTypeface;bullet.bulletTypeface.type=AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;bullet.bulletTypeface.typeface= "Arial";break}case 2:{bulletText="o";bullet.bulletTypeface=new AscFormat.CBulletTypeface;bullet.bulletTypeface.type=AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;bullet.bulletTypeface.typeface="Courier New";break}case 3:{bulletText="\u00a7";bullet.bulletTypeface=new AscFormat.CBulletTypeface;bullet.bulletTypeface.type=AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;bullet.bulletTypeface.typeface="Wingdings";break}case 4:{bulletText=String.fromCharCode(118);bullet.bulletTypeface=new AscFormat.CBulletTypeface;bullet.bulletTypeface.type= AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;bullet.bulletTypeface.typeface="Wingdings";break}case 5:{bulletText=String.fromCharCode(216);bullet.bulletTypeface=new AscFormat.CBulletTypeface;bullet.bulletTypeface.type=AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;bullet.bulletTypeface.typeface="Wingdings";break}case 6:{bulletText=String.fromCharCode(252);bullet.bulletTypeface=new AscFormat.CBulletTypeface;bullet.bulletTypeface.type=AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;bullet.bulletTypeface.typeface="Wingdings"; break}case 7:{bulletText=String.fromCharCode(119);bullet.bulletTypeface=new AscFormat.CBulletTypeface;bullet.bulletTypeface.type=AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;bullet.bulletTypeface.typeface="Wingdings";break}case 8:{bulletText=String.fromCharCode(8211);bullet.bulletTypeface=new AscFormat.CBulletTypeface;bullet.bulletTypeface.type=AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;bullet.bulletTypeface.typeface="Arial";break}}bullet.bulletType=new AscFormat.CBulletType;bullet.bulletType.type=AscFormat.BULLET_TYPE_BULLET_CHAR; bullet.bulletType.Char=bulletText;break}case 1:{bullet.bulletType=new AscFormat.CBulletType;bullet.bulletType.type=AscFormat.BULLET_TYPE_BULLET_AUTONUM;bullet.bulletType.AutoNumType=getNumberingType(NumInfo.SubType);break}default:{break}}}function fGetPresentationBulletByNumInfo(NumInfo){if(!AscFormat.isRealNumber(NumInfo.Type)&&!AscFormat.isRealNumber(NumInfo.SubType))return null;var bullet=new AscFormat.CBullet;fFillBullet(NumInfo,bullet);return bullet}function fResetConnectorsIds(aCopyObjects, oIdMaps){for(var i=0;i<aCopyObjects.length;++i){var oDrawing=aCopyObjects[i].Drawing?aCopyObjects[i].Drawing:aCopyObjects[i];if(oDrawing.getObjectType)if(oDrawing.getObjectType()===AscDFH.historyitem_type_Cnx){var sStId=oDrawing.getStCxnId();var sEndId=oDrawing.getEndCxnId();var sStCnxId=null,sEndCnxId=null;if(oIdMaps[sStId])sStCnxId=oIdMaps[sStId];if(oIdMaps[sEndId])sEndCnxId=oIdMaps[sEndId];if(sStId!==sStCnxId||sEndCnxId!==sEndId){var nvUniSpPr=oDrawing.nvSpPr.nvUniSpPr.copy();if(!sStCnxId){nvUniSpPr.stCnxIdx= null;nvUniSpPr.stCnxId=null}else nvUniSpPr.stCnxId=sStCnxId;if(!sEndCnxId){nvUniSpPr.endCnxIdx=null;nvUniSpPr.endCnxId=null}else nvUniSpPr.endCnxId=sEndCnxId;oDrawing.nvSpPr.setUniSpPr(nvUniSpPr)}}else if(oDrawing.getObjectType()===AscDFH.historyitem_type_GroupShape)fResetConnectorsIds(oDrawing.spTree,oIdMaps)}}function fCheckObjectHyperlink(object,x,y){var content=object.getDocContent&&object.getDocContent();var invert_transform_text=object.invertTransformText,tx,ty,hit_paragraph,check_hyperlink, par;if(content&&invert_transform_text){tx=invert_transform_text.TransformPointX(x,y);ty=invert_transform_text.TransformPointY(x,y);hit_paragraph=content.Internal_GetContentPosByXY(tx,ty,0);par=content.Content[hit_paragraph];if(isRealObject(par))if(par.IsInText&&par.IsInText(tx,ty,0)){check_hyperlink=par.CheckHyperlink(tx,ty,0);if(isRealObject(check_hyperlink))return check_hyperlink}}return null}function fGetDefaultShapeExtents(sPreset){var ext_x,ext_y;if(typeof AscFormat.SHAPE_EXT[sPreset]==="number")ext_x= AscFormat.SHAPE_EXT[sPreset];else ext_x=25.4;if(typeof AscFormat.SHAPE_ASPECTS[sPreset]==="number"){var _aspect=AscFormat.SHAPE_ASPECTS[sPreset];ext_y=ext_x/_aspect}else ext_y=ext_x;return{x:ext_x,y:ext_y}}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].HANDLE_EVENT_MODE_HANDLE=HANDLE_EVENT_MODE_HANDLE;window["AscFormat"].HANDLE_EVENT_MODE_CURSOR=HANDLE_EVENT_MODE_CURSOR;window["AscFormat"].DISTANCE_TO_TEXT_LEFTRIGHT=DISTANCE_TO_TEXT_LEFTRIGHT;window["AscFormat"].BAR_DIR_BAR=BAR_DIR_BAR; window["AscFormat"].BAR_DIR_COL=BAR_DIR_COL;window["AscFormat"].BAR_GROUPING_CLUSTERED=BAR_GROUPING_CLUSTERED;window["AscFormat"].BAR_GROUPING_PERCENT_STACKED=BAR_GROUPING_PERCENT_STACKED;window["AscFormat"].BAR_GROUPING_STACKED=BAR_GROUPING_STACKED;window["AscFormat"].BAR_GROUPING_STANDARD=BAR_GROUPING_STANDARD;window["AscFormat"].GROUPING_PERCENT_STACKED=GROUPING_PERCENT_STACKED;window["AscFormat"].GROUPING_STACKED=GROUPING_STACKED;window["AscFormat"].GROUPING_STANDARD=GROUPING_STANDARD;window["AscFormat"].SCATTER_STYLE_LINE= SCATTER_STYLE_LINE;window["AscFormat"].SCATTER_STYLE_LINE_MARKER=SCATTER_STYLE_LINE_MARKER;window["AscFormat"].SCATTER_STYLE_MARKER=SCATTER_STYLE_MARKER;window["AscFormat"].SCATTER_STYLE_NONE=SCATTER_STYLE_NONE;window["AscFormat"].SCATTER_STYLE_SMOOTH=SCATTER_STYLE_SMOOTH;window["AscFormat"].SCATTER_STYLE_SMOOTH_MARKER=SCATTER_STYLE_SMOOTH_MARKER;window["AscFormat"].CARD_DIRECTION_N=CARD_DIRECTION_N;window["AscFormat"].CARD_DIRECTION_NE=CARD_DIRECTION_NE;window["AscFormat"].CARD_DIRECTION_E=CARD_DIRECTION_E; window["AscFormat"].CARD_DIRECTION_SE=CARD_DIRECTION_SE;window["AscFormat"].CARD_DIRECTION_S=CARD_DIRECTION_S;window["AscFormat"].CARD_DIRECTION_SW=CARD_DIRECTION_SW;window["AscFormat"].CARD_DIRECTION_W=CARD_DIRECTION_W;window["AscFormat"].CARD_DIRECTION_NW=CARD_DIRECTION_NW;window["AscFormat"].CURSOR_TYPES_BY_CARD_DIRECTION=CURSOR_TYPES_BY_CARD_DIRECTION;window["AscFormat"].removeDPtsFromSeries=removeDPtsFromSeries;window["AscFormat"].checkTxBodyDefFonts=checkTxBodyDefFonts;window["AscFormat"].CheckShapeBodyAutoFitReset= CheckShapeBodyAutoFitReset;window["AscFormat"].CDistance=CDistance;window["AscFormat"].ConvertRelPositionHToRelSize=ConvertRelPositionHToRelSize;window["AscFormat"].ConvertRelPositionVToRelSize=ConvertRelPositionVToRelSize;window["AscFormat"].ConvertRelSizeHToRelPosition=ConvertRelSizeHToRelPosition;window["AscFormat"].ConvertRelSizeVToRelPosition=ConvertRelSizeVToRelPosition;window["AscFormat"].checkObjectInArray=checkObjectInArray;window["AscFormat"].getValOrDefault=getValOrDefault;window["AscFormat"].CheckStockChart= CheckStockChart;window["AscFormat"].CheckLinePreset=CheckLinePreset;window["AscFormat"].CompareGroups=CompareGroups;window["AscFormat"].CheckSpPrXfrm=CheckSpPrXfrm;window["AscFormat"].CheckSpPrXfrm2=CheckSpPrXfrm2;window["AscFormat"].CheckSpPrXfrm3=CheckSpPrXfrm3;window["AscFormat"].getObjectsByTypesFromArr=getObjectsByTypesFromArr;window["AscFormat"].getTargetTextObject=getTargetTextObject;window["AscFormat"].DrawingObjectsController=DrawingObjectsController;window["AscFormat"].CBoundsController= CBoundsController;window["AscFormat"].CSlideBoundsChecker=CSlideBoundsChecker;window["AscFormat"].GetMinSnapDistanceXObject=GetMinSnapDistanceXObject;window["AscFormat"].GetMinSnapDistanceYObject=GetMinSnapDistanceYObject;window["AscFormat"].GetMinSnapDistanceXObjectByArrays=GetMinSnapDistanceXObjectByArrays;window["AscFormat"].GetMinSnapDistanceYObjectByArrays=GetMinSnapDistanceYObjectByArrays;window["AscFormat"].CalcLiterByLength=CalcLiterByLength;window["AscFormat"].fillImage=fillImage;window["AscFormat"].fSolveQuadraticEquation= fSolveQuadraticEquation;window["AscFormat"].fApproxEqual=fApproxEqual;window["AscFormat"].fCheckBoxIntersectionSegment=fCheckBoxIntersectionSegment;window["AscFormat"].CMathPainter=CMathPainter;window["AscFormat"].CollectSettingsFromChart=CollectSettingsFromChart;window["AscFormat"].ApplyPresetToChartSpace=ApplyPresetToChartSpace;window["AscFormat"].ApplySpPr=ApplySpPr;window["AscFormat"].ApplyDLblsProps=ApplyDLblsProps;window["AscFormat"].CollectDLbls=CollectDLbls;window["AscFormat"].CollectSettingsSpPr= CollectSettingsSpPr;window["AscFormat"].CheckLinePresetForParagraphAdd=CheckLinePresetForParagraphAdd;window["AscFormat"].isConnectorPreset=isConnectorPreset;window["AscFormat"].fCreateSignatureShape=fCreateSignatureShape;window["AscFormat"].CreateBlipFillUniFillFromUrl=CreateBlipFillUniFillFromUrl;window["AscFormat"].fGetListTypeFromBullet=fGetListTypeFromBullet;window["AscFormat"].fGetPresentationBulletByNumInfo=fGetPresentationBulletByNumInfo;window["AscFormat"].fFillBullet=fFillBullet;window["AscFormat"].fGetFontByNumInfo= fGetFontByNumInfo;window["AscFormat"].CreateBlipFillRasterImageId=CreateBlipFillRasterImageId;window["AscFormat"].fResetConnectorsIds=fResetConnectorsIds;window["AscFormat"].getAbsoluteRectBoundsArr=getAbsoluteRectBoundsArr;window["AscFormat"].fCheckObjectHyperlink=fCheckObjectHyperlink;window["AscFormat"].getNumberingType=getNumberingType;window["AscFormat"].CreateUnifillFromPreset=CreateUnifillFromPreset;window["AscFormat"].fGetDefaultShapeExtents=fGetDefaultShapeExtents})(window);"use strict"; (function(window,undefined){var HANDLE_EVENT_MODE_HANDLE=AscFormat.HANDLE_EVENT_MODE_HANDLE;var HANDLE_EVENT_MODE_CURSOR=AscFormat.HANDLE_EVENT_MODE_CURSOR;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var MOVE_DELTA=1/1E5;var SNAP_DISTANCE=1.27;function StartAddNewShape(drawingObjects,preset){this.drawingObjects=drawingObjects;this.preset=preset;this.bStart=false;this.bMoved=false;this.startX=null;this.startY=null;this.oldConnector=null}StartAddNewShape.prototype={onMouseDown:function(e, x,y){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};this.startX=x;this.startY=y;this.drawingObjects.arrPreTrackObjects.length=0;var layout=null,master=null,slide=null;if(this.drawingObjects.drawingObjects&&this.drawingObjects.drawingObjects.cSld&&this.drawingObjects.drawingObjects.getParentObjects){var oParentObjects=this.drawingObjects.drawingObjects.getParentObjects();if(isRealObject(oParentObjects)){layout=oParentObjects.layout; master=oParentObjects.master;slide=oParentObjects.slide}}this.drawingObjects.arrPreTrackObjects.push(new AscFormat.NewShapeTrack(this.preset,x,y,this.drawingObjects.getTheme(),master,layout,slide,0,this.drawingObjects));this.bStart=true;this.drawingObjects.swapTrackObjects()},onMouseMove:function(e,x,y){if(this.bStart&&e.IsLocked){if(!this.bMoved&&(Math.abs(this.startX-x)>MOVE_DELTA||Math.abs(this.startY-y)>MOVE_DELTA))this.bMoved=true;this.drawingObjects.arrTrackObjects[0].track(e,x,y);this.drawingObjects.updateOverlay()}else if(AscFormat.isConnectorPreset(this.preset)){var oOldState= this.drawingObjects.curState;this.drawingObjects.connector=null;this.drawingObjects.changeCurrentState(new AscFormat.NullState(this.drawingObjects));var oResult;this.drawingObjects.handleEventMode=HANDLE_EVENT_MODE_CURSOR;oResult=this.drawingObjects.curState.onMouseDown(e,x,y,0);this.drawingObjects.handleEventMode=HANDLE_EVENT_MODE_HANDLE;this.drawingObjects.changeCurrentState(oOldState);if(oResult){var oObject=AscCommon.g_oTableId.Get_ById(oResult.objectId);this.drawingObjects.connector=oObject}if(this.drawingObjects.connector!== this.oldConnector){this.oldConnector=this.drawingObjects.connector;this.drawingObjects.updateOverlay()}else this.oldConnector=this.drawingObjects.connector}},onMouseUp:function(e,x,y){var bRet=false;if(this.bStart&&this.drawingObjects.canEdit()&&this.drawingObjects.arrTrackObjects.length>0){bRet=true;if(this.drawingObjects.drawingObjects.objectLocker){this.drawingObjects.drawingObjects.objectLocker.reset();this.drawingObjects.drawingObjects.objectLocker.addObjectId(AscCommon.g_oIdCounter.Get_NewId())}var oThis= this;var track=oThis.drawingObjects.arrTrackObjects[0];if(!this.bMoved&&this instanceof StartAddNewShape){var ext_x,ext_y;var oExt=AscFormat.fGetDefaultShapeExtents(this.preset);ext_x=oExt.x;ext_y=oExt.y;this.onMouseMove({IsLocked:true},this.startX+ext_x,this.startY+ext_y)}var callback=function(bLock){if(bLock){History.Create_NewPoint(AscDFH.historydescription_CommonStatesAddNewShape);var shape=track.getShape(false,oThis.drawingObjects.getDrawingDocument(),oThis.drawingObjects.drawingObjects);if(!(oThis.drawingObjects.drawingObjects&& oThis.drawingObjects.drawingObjects.cSld)){if(shape.spPr.xfrm.offX<0)shape.spPr.xfrm.setOffX(0);if(shape.spPr.xfrm.offY<0)shape.spPr.xfrm.setOffY(0)}oThis.drawingObjects.drawingObjects.getWorksheetModel&&shape.setWorksheet(oThis.drawingObjects.drawingObjects.getWorksheetModel());if(oThis.drawingObjects.drawingObjects&&oThis.drawingObjects.drawingObjects.cSld){shape.setParent(oThis.drawingObjects.drawingObjects);shape.setRecalculateInfo()}shape.addToDrawingObjects(undefined,AscCommon.c_oAscCellAnchorType.cellanchorTwoCell); shape.checkDrawingBaseCoords();oThis.drawingObjects.checkChartTextSelection();oThis.drawingObjects.resetSelection();shape.select(oThis.drawingObjects,0);if(oThis.preset==="textRect"){oThis.drawingObjects.selection.textSelection=shape;shape.recalculate();shape.selectionSetStart(e,x,y,0);shape.selectionSetEnd(e,x,y,0)}oThis.drawingObjects.startRecalculate();oThis.drawingObjects.drawingObjects.sendGraphicObjectProps()}};if(this.drawingObjects.drawingObjects.objectLocker)this.drawingObjects.drawingObjects.objectLocker.checkObjects(callback); else callback(true)}this.drawingObjects.clearTrackObjects();this.drawingObjects.clearPreTrackObjects();this.drawingObjects.updateOverlay();if(Asc["editor"]){if(!e.fromWindow||this.bStart)Asc["editor"].asc_endAddShape()}else if(editor&&editor.sync_EndAddShape)editor.sync_EndAddShape();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));return bRet}};function checkEmptyPlaceholderContent(content){if(!content)return content;if(content.Parent&&content.Parent.parent){if(content.Is_Empty()&& content.Parent.parent.isPlaceholder&&content.Parent.parent.isPlaceholder())return content;if(content.Parent.parent.txWarpStruct)return content;if(content.Parent.parent.recalcInfo&&content.Parent.parent.recalcInfo.warpGeometry)return content;var oBodyPr;if(content.Parent.parent.getBodyPr){oBodyPr=content.Parent.parent.getBodyPr;if(oBodyPr.vertOverflow!==AscFormat.nOTOwerflow)return content}var oParagraph=content.GetCurrentParagraph();if(oParagraph.IsEmpty())return content}return null}function NullState(drawingObjects){this.drawingObjects= drawingObjects;this.startTargetTextObject=null;this.lastMoveHandler=null}NullState.prototype={checkRedrawOnMouseDown:function(oStartContent,oStartPara){this.drawingObjects.checkRedrawOnChangeCursorPosition(oStartContent,oStartPara)},onMouseDown:function(e,x,y,pageIndex,bTextFlag){var start_target_doc_content,end_target_doc_content,selected_comment_index=-1;var oStartPara=null;if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_HANDLE){start_target_doc_content=checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent()); if(start_target_doc_content){oStartPara=start_target_doc_content.GetCurrentParagraph();if(!oStartPara.IsEmpty())oStartPara=null}this.startTargetTextObject=AscFormat.getTargetTextObject(this.drawingObjects)}var ret;ret=this.drawingObjects.handleSlideComments(e,x,y,pageIndex);if(ret){if(ret.result)return ret.result;selected_comment_index=ret.selectedIndex}var selection=this.drawingObjects.selection;if(selection.groupSelection){ret=AscFormat.handleSelectedObjects(this.drawingObjects,e,x,y,selection.groupSelection, pageIndex,false);if(ret){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_HANDLE){this.checkRedrawOnMouseDown(start_target_doc_content,oStartPara);AscCommon.CollaborativeEditing.Update_ForeignCursorsPositions()}return ret}ret=AscFormat.handleFloatObjects(this.drawingObjects,selection.groupSelection.arrGraphicObjects,e,x,y,selection.groupSelection,pageIndex,false);if(ret){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_HANDLE){this.checkRedrawOnMouseDown(start_target_doc_content, oStartPara);AscCommon.CollaborativeEditing.Update_ForeignCursorsPositions()}return ret}}else if(selection.chartSelection);ret=AscFormat.handleSelectedObjects(this.drawingObjects,e,x,y,null,pageIndex,false);if(ret){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_HANDLE){this.checkRedrawOnMouseDown(start_target_doc_content,oStartPara);AscCommon.CollaborativeEditing.Update_ForeignCursorsPositions()}return ret}ret=AscFormat.handleFloatObjects(this.drawingObjects,this.drawingObjects.getDrawingArray(), e,x,y,null,pageIndex,false);if(ret){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_HANDLE){this.checkRedrawOnMouseDown(start_target_doc_content,oStartPara);AscCommon.CollaborativeEditing.Update_ForeignCursorsPositions()}return ret}if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_HANDLE){var bRet=this.drawingObjects.checkChartTextSelection(true);if(e.ClickCount<2)this.drawingObjects.resetSelection();if(start_target_doc_content||selected_comment_index>-1||bRet)this.drawingObjects.drawingObjects.showDrawingObjects(); if(this.drawingObjects.drawingObjects&&this.drawingObjects.drawingObjects.cSld)if(!this.drawingObjects.isSlideShow()){this.drawingObjects.stX=x;this.drawingObjects.stY=y;this.drawingObjects.selectionRect={x:x,y:y,w:0,h:0};this.drawingObjects.changeCurrentState(new TrackSelectionRect(this.drawingObjects))}}else if(this.lastMoveHandler&&!this.drawingObjects.isSlideShow()){var oRet={};oRet.objectId=this.lastMoveHandler.Get_Id();oRet.bMarker=false;oRet.cursorType="default";oRet.tooltip=null;return oRet}return null}, onMouseMove:function(e,x,y,pageIndex){var aDrawings=this.drawingObjects.getDrawingArray();var _x=x,_y=y,oDrawing;this.lastMoveHandler=null;for(var nDrawing=aDrawings.length-1;nDrawing>-1;--nDrawing){oDrawing=aDrawings[nDrawing];if(oDrawing.onMouseMove(e,_x,_y)){this.lastMoveHandler=oDrawing;_x=-1E3}}},onMouseUp:function(e,x,y,pageIndex){}};function SlicerState(drawingObjects,oSlicer){this.drawingObjects=drawingObjects;this.slicer=oSlicer}SlicerState.prototype.onMouseDown=function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode=== HANDLE_EVENT_MODE_CURSOR)return{cursorType:"default",objectId:this.slicer.Get_Id()};return null};SlicerState.prototype.onMouseMove=function(e,x,y,pageIndex){if(!e.IsLocked)return this.onMouseUp(e,x,y,pageIndex);this.slicer.onMouseMove(e,x,y,pageIndex)};SlicerState.prototype.onMouseUp=function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{cursorType:"default",objectId:this.slicer.Get_Id()};var bRet=this.slicer.onMouseUp(e,x,y,pageIndex);this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects)); return bRet};function TrackSelectionRect(drawingObjects){this.drawingObjects=drawingObjects}TrackSelectionRect.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{cursorType:"default",objectId:"1"};return null},onMouseMove:function(e,x,y,pageIndex){this.drawingObjects.selectionRect={x:this.drawingObjects.stX,y:this.drawingObjects.stY,w:x-this.drawingObjects.stX,h:y-this.drawingObjects.stY};editor.WordControl.m_oDrawingDocument.m_oWordControl.OnUpdateOverlay(true)}, onMouseUp:function(e,x,y,pageIndex){var _glyph_index;var _glyphs_array=this.drawingObjects.getDrawingArray();var _glyph,_glyph_transform;var _xlt,_ylt,_xrt,_yrt,_xrb,_yrb,_xlb,_ylb;var _rect_l=Math.min(this.drawingObjects.selectionRect.x,this.drawingObjects.selectionRect.x+this.drawingObjects.selectionRect.w);var _rect_r=Math.max(this.drawingObjects.selectionRect.x,this.drawingObjects.selectionRect.x+this.drawingObjects.selectionRect.w);var _rect_t=Math.min(this.drawingObjects.selectionRect.y,this.drawingObjects.selectionRect.y+ this.drawingObjects.selectionRect.h);var _rect_b=Math.max(this.drawingObjects.selectionRect.y,this.drawingObjects.selectionRect.y+this.drawingObjects.selectionRect.h);for(_glyph_index=0;_glyph_index<_glyphs_array.length;++_glyph_index){_glyph=_glyphs_array[_glyph_index];_glyph_transform=_glyph.transform;_xlt=_glyph_transform.TransformPointX(0,0);_ylt=_glyph_transform.TransformPointY(0,0);_xrt=_glyph_transform.TransformPointX(_glyph.extX,0);_yrt=_glyph_transform.TransformPointY(_glyph.extX,0);_xrb= _glyph_transform.TransformPointX(_glyph.extX,_glyph.extY);_yrb=_glyph_transform.TransformPointY(_glyph.extX,_glyph.extY);_xlb=_glyph_transform.TransformPointX(0,_glyph.extY);_ylb=_glyph_transform.TransformPointY(0,_glyph.extY);if(_xlb>=_rect_l&&_xlb<=_rect_r&&(_xrb>=_rect_l&&_xrb<=_rect_r)&&(_xlt>=_rect_l&&_xlt<=_rect_r)&&(_xrt>=_rect_l&&_xrt<=_rect_r)&&(_ylb>=_rect_t&&_ylb<=_rect_b)&&(_yrb>=_rect_t&&_yrb<=_rect_b)&&(_ylt>=_rect_t&&_ylt<=_rect_b)&&(_yrt>=_rect_t&&_yrt<=_rect_b))this.drawingObjects.selectObject(_glyph, pageIndex)}this.drawingObjects.selectionRect=null;this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));editor.WordControl.m_oDrawingDocument.m_oWordControl.OnUpdateOverlay(true);editor.WordControl.m_oLogicDocument.Document_UpdateInterfaceState()}};function PreChangeAdjState(drawingObjects,majorObject){this.drawingObjects=drawingObjects;this.majorObject=majorObject}PreChangeAdjState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject&& this.majorObject.Get_Id(),bMarker:true,cursorType:"crosshair"}},onMouseMove:function(e,x,y,pageIndex){this.drawingObjects.swapTrackObjects();this.drawingObjects.changeCurrentState(new ChangeAdjState(this.drawingObjects,this.majorObject));this.drawingObjects.OnMouseMove(e,x,y,pageIndex)},onMouseUp:function(e,x,y,pageIndex){this.drawingObjects.clearPreTrackObjects();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects))}};function ChangeAdjState(drawingObjects,majorObject){this.drawingObjects= drawingObjects;this.majorObject=majorObject}ChangeAdjState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject&&this.majorObject.Get_Id(),bMarker:true,cursorType:"crosshair"}},onMouseMove:function(e,x,y,pageIndex){if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}var t=AscFormat.CheckCoordsNeedPage(x,y,pageIndex,this.majorObject.selectStartPage,this.drawingObjects.getDrawingDocument());for(var i=0;i< this.drawingObjects.arrTrackObjects.length;++i)this.drawingObjects.arrTrackObjects[i].track(t.x,t.y);this.drawingObjects.updateOverlay()},onMouseUp:function(e,x,y,pageIndex){if(this.drawingObjects.canEdit()){var trackObjects=[].concat(this.drawingObjects.arrTrackObjects);var drawingObjects=this.drawingObjects;this.drawingObjects.checkSelectedObjectsAndCallback(function(){var oOriginalObjects=[];var oMapOriginalsIds={};for(var i=0;i<trackObjects.length;++i){trackObjects[i].trackEnd();if(trackObjects[i].originalObject&& !trackObjects[i].processor3D){oOriginalObjects.push(trackObjects[i].originalObject);oMapOriginalsIds[trackObjects[i].originalObject.Get_Id()]=true}}var aAllConnectors=drawingObjects.getAllConnectorsByDrawings(oOriginalObjects,[],undefined,true);for(i=0;i<aAllConnectors.length;++i)if(!oMapOriginalsIds[aAllConnectors[i].Get_Id()])aAllConnectors[i].calculateTransform();drawingObjects.startRecalculate()},[],false,AscDFH.historydescription_CommonDrawings_ChangeAdj)}this.drawingObjects.clearTrackObjects(); this.drawingObjects.updateOverlay();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects))}};function PreRotateState(drawingObjects,majorObject){this.drawingObjects=drawingObjects;this.majorObject=majorObject}PreRotateState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"crosshair",bMarker:true}},onMouseMove:function(e,x,y,pageIndex){if(!e.IsLocked){this.onMouseUp(e, x,y,pageIndex);return}this.drawingObjects.swapTrackObjects();this.drawingObjects.changeCurrentState(new RotateState(this.drawingObjects,this.majorObject));this.drawingObjects.OnMouseMove(e,x,y,pageIndex)},onMouseUp:function(e,x,y,pageIndex){this.drawingObjects.clearPreTrackObjects();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects))}};function RotateState(drawingObjects,majorObject){this.drawingObjects=drawingObjects;this.majorObject=majorObject}RotateState.prototype={onMouseDown:function(e, x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject&&this.majorObject.Get_Id(),bMarker:true,cursorType:"crosshair"}},onMouseMove:function(e,x,y,pageIndex){if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}var coords=AscFormat.CheckCoordsNeedPage(x,y,pageIndex,this.majorObject.selectStartPage,this.drawingObjects.getDrawingDocument());this.drawingObjects.handleRotateTrack(e,coords.x,coords.y)},onMouseUp:function(e,x,y,pageIndex){if(this.drawingObjects.canEdit()&& this.bSamePos!==true){var tracks=[].concat(this.drawingObjects.arrTrackObjects);var group=this.group;var drawingObjects=this.drawingObjects;var oThis=this;var bIsMoveState=this instanceof MoveState;var bIsChartFrame=Asc["editor"]&&Asc["editor"].isChartEditor===true;var bIsTrackInChart=tracks.length>0&&tracks[0]instanceof AscFormat.MoveChartObjectTrack;var bCopyOnMove=e.CtrlKey&&bIsMoveState&&!bIsChartFrame&&!bIsTrackInChart;var bCopyOnMoveInGroup=e.CtrlKey&&oThis instanceof MoveInGroupState;var i, j;var copy;if(bCopyOnMove){this.drawingObjects.resetSelection();var oIdMap={};var oCopyPr=new AscFormat.CCopyObjectProperties;oCopyPr.idMap=oIdMap;var aCopies=[];History.Create_NewPoint(AscDFH.historydescription_CommonDrawings_CopyCtrl);for(i=0;i<tracks.length;++i){copy=tracks[i].originalObject.copy(oCopyPr);oIdMap[tracks[i].originalObject.Id]=copy.Id;this.drawingObjects.drawingObjects.getWorksheetModel&©.setWorksheet(this.drawingObjects.drawingObjects.getWorksheetModel());if(this.drawingObjects.drawingObjects&& this.drawingObjects.drawingObjects.cSld){copy.setParent2(this.drawingObjects.drawingObjects);if(!copy.spPr||!copy.spPr.xfrm||(copy.getObjectType()===AscDFH.historyitem_type_GroupShape&&!copy.spPr.xfrm.isNotNullForGroup()||copy.getObjectType()!==AscDFH.historyitem_type_GroupShape&&!copy.spPr.xfrm.isNotNull()))copy.recalculateTransform()}if(tracks[i].originalObject.drawingBase){var drawingObject=tracks[i].originalObject.drawingBase;var metrics=drawingObject.getGraphicObjectMetrics();AscFormat.SetXfrmFromMetrics(copy, metrics);copy.drawingBase=drawingObject}copy.addToDrawingObjects();aCopies.push(copy);tracks[i].originalObject=copy;tracks[i].trackEnd(false,true);this.drawingObjects.selectObject(copy,0)}if(!(this.drawingObjects.drawingObjects&&this.drawingObjects.drawingObjects.cSld)){if(History.StartTransaction&&History.EndTransaction)History.StartTransaction();AscFormat.ExecuteNoHistory(function(){drawingObjects.checkSelectedObjectsAndCallback(function(){},[])},this,[]);if(History.StartTransaction&&History.EndTransaction)History.EndTransaction(); if(this.drawingObjects.checkSlicerCopies)this.drawingObjects.checkSlicerCopies(aCopies)}else{this.drawingObjects.startRecalculate();this.drawingObjects.drawingObjects.sendGraphicObjectProps()}AscFormat.fResetConnectorsIds(aCopies,oIdMap)}else if(bCopyOnMoveInGroup)this.drawingObjects.checkSelectedObjectsAndCallback(function(){var oIdMap={};var aCopies=[];var oCopyPr=new AscFormat.CCopyObjectProperties;oCopyPr.idMap=oIdMap;group.resetSelection();for(i=0;i<tracks.length;++i){copy=tracks[i].originalObject.copy(oCopyPr); aCopies.push(copy);oThis.drawingObjects.drawingObjects.getWorksheetModel&©.setWorksheet(oThis.drawingObjects.drawingObjects.getWorksheetModel());if(oThis.drawingObjects.drawingObjects&&oThis.drawingObjects.drawingObjects.cSld)copy.setParent2(oThis.drawingObjects.drawingObjects);copy.setGroup(tracks[i].originalObject.group);copy.group.addToSpTree(copy.group.length,copy);tracks[i].originalObject=copy;tracks[i].trackEnd(false);group.selectObject(copy,0)}AscFormat.fResetConnectorsIds(aCopies,oIdMap); if(group)group.updateCoordinatesAfterInternalResize();if(!oThis.drawingObjects.drawingObjects||!oThis.drawingObjects.drawingObjects.cSld){var min_x,min_y,drawing,arr_x2=[],arr_y2=[],oTransform;for(i=0;i<oThis.drawingObjects.selectedObjects.length;++i){drawing=oThis.drawingObjects.selectedObjects[i];var rot=AscFormat.isRealNumber(drawing.spPr.xfrm.rot)?drawing.spPr.xfrm.rot:0;rot=AscFormat.normalizeRotate(rot);arr_x2.push(drawing.spPr.xfrm.offX);arr_y2.push(drawing.spPr.xfrm.offY);arr_x2.push(drawing.spPr.xfrm.offX+ drawing.spPr.xfrm.extX);arr_y2.push(drawing.spPr.xfrm.offY+drawing.spPr.xfrm.extY);if(AscFormat.checkNormalRotate(rot)){min_x=drawing.spPr.xfrm.offX;min_y=drawing.spPr.xfrm.offY}else{min_x=drawing.spPr.xfrm.offX+drawing.spPr.xfrm.extX/2-drawing.spPr.xfrm.extY/2;min_y=drawing.spPr.xfrm.offY+drawing.spPr.xfrm.extY/2-drawing.spPr.xfrm.extX/2;arr_x2.push(min_x);arr_y2.push(min_y);arr_x2.push(min_x+drawing.spPr.xfrm.extY);arr_y2.push(min_y+drawing.spPr.xfrm.extX)}if(min_x<0)drawing.spPr.xfrm.setOffX(drawing.spPr.xfrm.offX- min_x);if(min_y<0)drawing.spPr.xfrm.setOffY(drawing.spPr.xfrm.offY-min_y);drawing.checkDrawingBaseCoords();drawing.recalculateTransform();oTransform=drawing.transform;arr_x2.push(oTransform.TransformPointX(0,0));arr_y2.push(oTransform.TransformPointY(0,0));arr_x2.push(oTransform.TransformPointX(drawing.extX,0));arr_y2.push(oTransform.TransformPointY(drawing.extX,0));arr_x2.push(oTransform.TransformPointX(drawing.extX,drawing.extY));arr_y2.push(oTransform.TransformPointY(drawing.extX,drawing.extY)); arr_x2.push(oTransform.TransformPointX(0,drawing.extY));arr_y2.push(oTransform.TransformPointY(0,drawing.extY))}oThis.drawingObjects.drawingObjects.checkGraphicObjectPosition(0,0,Math.max.apply(Math,arr_x2),Math.max.apply(Math,arr_y2))}if(oThis.drawingObjects.checkSlicerCopies)oThis.drawingObjects.checkSlicerCopies(aCopies)},[],false,AscDFH.historydescription_CommonDrawings_EndTrack);else{var oOriginalObjects=[];var oMapOriginalsId={};var oMapAdditionalForCheck={};for(i=0;i<tracks.length;++i){var oOrigObject= tracks[i].originalObject&&tracks[i].chartSpace?tracks[i].chartSpace:tracks[i].originalObject;if(tracks[i].originalObject&&!tracks[i].processor3D){oOriginalObjects.push(oOrigObject);oMapOriginalsId[oOrigObject.Get_Id()]=true;var oGroup=oOrigObject.getMainGroup&&oOrigObject.getMainGroup();if(oGroup){if(!oGroup.selected)oMapAdditionalForCheck[oGroup.Get_Id()]=oGroup}else if(!oOrigObject.selected)oMapAdditionalForCheck[oOrigObject.Get_Id()]=oOrigObject;if(Array.isArray(oOrigObject.arrGraphicObjects))for(j= 0;j<oOrigObject.arrGraphicObjects.length;++j)oMapOriginalsId[oOrigObject.arrGraphicObjects[j].Get_Id()]=true}}var aAllConnectors=drawingObjects.getAllConnectorsByDrawings(oOriginalObjects,[],undefined,true);var bFlag=oThis instanceof MoveInGroupState||oThis instanceof MoveState;var aConnectors=[];for(i=0;i<aAllConnectors.length;++i){var stSp=AscCommon.g_oTableId.Get_ById(aAllConnectors[i].getStCxnId());var endSp=AscCommon.g_oTableId.Get_ById(aAllConnectors[i].getEndCxnId());if(stSp&&!oMapOriginalsId[stSp.Get_Id()]|| endSp&&!oMapOriginalsId[endSp.Get_Id()]||!oMapOriginalsId[aAllConnectors[i].Get_Id()]){var oGroup=aAllConnectors[i].getMainGroup&&aAllConnectors[i].getMainGroup();aConnectors.push(aAllConnectors[i]);if(oGroup)oMapAdditionalForCheck[oGroup.Id]=oGroup;else oMapAdditionalForCheck[aAllConnectors[i].Get_Id()]=aAllConnectors[i]}}var aAdditionalForCheck=[];for(i in oMapAdditionalForCheck)if(oMapAdditionalForCheck.hasOwnProperty(i))if(!oMapAdditionalForCheck[i].selected)aAdditionalForCheck.push(oMapAdditionalForCheck[i]); this.drawingObjects.checkSelectedObjectsAndCallback(function(){for(i=0;i<tracks.length;++i)tracks[i].trackEnd(false,bFlag);if(tracks.length===1&&tracks[0].chartSpace)return;var oGroupMaps={};for(i=0;i<aConnectors.length;++i){aConnectors[i].calculateTransform(bFlag);var oGroup=aConnectors[i].getMainGroup&&aConnectors[i].getMainGroup();if(oGroup)oGroupMaps[oGroup.Id]=oGroup}for(var key in oGroupMaps)if(oGroupMaps.hasOwnProperty(key))oGroupMaps[key].updateCoordinatesAfterInternalResize();if(group)group.updateCoordinatesAfterInternalResize(); if(!oThis.drawingObjects.drawingObjects||!oThis.drawingObjects.drawingObjects.cSld){var min_x,min_y,drawing,arr_x2=[],arr_y2=[],oTransform;for(i=0;i<oThis.drawingObjects.selectedObjects.length;++i){drawing=oThis.drawingObjects.selectedObjects[i];var rot=AscFormat.isRealNumber(drawing.spPr.xfrm.rot)?drawing.spPr.xfrm.rot:0;rot=AscFormat.normalizeRotate(rot);arr_x2.push(drawing.spPr.xfrm.offX);arr_y2.push(drawing.spPr.xfrm.offY);arr_x2.push(drawing.spPr.xfrm.offX+drawing.spPr.xfrm.extX);arr_y2.push(drawing.spPr.xfrm.offY+ drawing.spPr.xfrm.extY);if(AscFormat.checkNormalRotate(rot)){min_x=drawing.spPr.xfrm.offX;min_y=drawing.spPr.xfrm.offY}else{min_x=drawing.spPr.xfrm.offX+drawing.spPr.xfrm.extX/2-drawing.spPr.xfrm.extY/2;min_y=drawing.spPr.xfrm.offY+drawing.spPr.xfrm.extY/2-drawing.spPr.xfrm.extX/2;arr_x2.push(min_x);arr_y2.push(min_y);arr_x2.push(min_x+drawing.spPr.xfrm.extY);arr_y2.push(min_y+drawing.spPr.xfrm.extX)}if(min_x<0)drawing.spPr.xfrm.setOffX(drawing.spPr.xfrm.offX-min_x);if(min_y<0)drawing.spPr.xfrm.setOffY(drawing.spPr.xfrm.offY- min_y);drawing.checkDrawingBaseCoords&&drawing.checkDrawingBaseCoords();drawing.recalculateTransform&&drawing.recalculateTransform();oTransform=drawing.transform;arr_x2.push(oTransform.TransformPointX(0,0));arr_y2.push(oTransform.TransformPointY(0,0));arr_x2.push(oTransform.TransformPointX(drawing.extX,0));arr_y2.push(oTransform.TransformPointY(drawing.extX,0));arr_x2.push(oTransform.TransformPointX(drawing.extX,drawing.extY));arr_y2.push(oTransform.TransformPointY(drawing.extX,drawing.extY));arr_x2.push(oTransform.TransformPointX(0, drawing.extY));arr_y2.push(oTransform.TransformPointY(0,drawing.extY))}oThis.drawingObjects.drawingObjects.checkGraphicObjectPosition(0,0,Math.max.apply(Math,arr_x2),Math.max.apply(Math,arr_y2))}},[],false,AscDFH.historydescription_CommonDrawings_EndTrack,aAdditionalForCheck)}}this.drawingObjects.resetTracking()}};function PreResizeState(drawingObjects,majorObject,cardDirection){this.drawingObjects=drawingObjects;this.majorObject=majorObject;this.cardDirection=cardDirection;this.handleNum=this.majorObject.getNumByCardDirection(cardDirection)} PreResizeState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"crosshair",bMarker:true}},onMouseMove:function(e,x,y,pageIndex){if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}this.drawingObjects.swapTrackObjects();this.drawingObjects.changeCurrentState(new ResizeState(this.drawingObjects,this.majorObject,this.handleNum,this.cardDirection));this.drawingObjects.OnMouseMove(e, x,y,pageIndex)},onMouseUp:function(e,x,y,pageIndex){this.drawingObjects.clearPreTrackObjects();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects))}};function ResizeState(drawingObjects,majorObject,handleNum,cardDirection){this.drawingObjects=drawingObjects;this.majorObject=majorObject;this.handleNum=handleNum;this.cardDirection=cardDirection}ResizeState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(), cursorType:"crosshair",bMarker:true}},onMouseMove:function(e,x,y,pageIndex){if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}var coords=AscFormat.CheckCoordsNeedPage(x,y,pageIndex,this.majorObject.selectStartPage,this.drawingObjects.getDrawingDocument());var resize_coef=this.majorObject.getResizeCoefficients(this.handleNum,coords.x,coords.y);this.drawingObjects.trackResizeObjects(resize_coef.kd1,resize_coef.kd2,e,x,y);this.drawingObjects.updateOverlay()},onMouseUp:RotateState.prototype.onMouseUp}; function PreMoveState(drawingObjects,startX,startY,shift,ctrl,majorObject,majorObjectIsSelected,bInside){this.drawingObjects=drawingObjects;this.majorObject=majorObject;this.startX=startX;this.startY=startY;this.shift=shift;this.ctrl=ctrl;this.majorObjectIsSelected=majorObjectIsSelected;this.bInside=bInside}PreMoveState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"move",bMarker:true}; else this.onMouseUp(e,x,y,pageIndex)},onMouseMove:function(e,x,y,pageIndex){if(this.drawingObjects.isSlideShow())return;if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}if(Math.abs(this.startX-x)>MOVE_DELTA||Math.abs(this.startY-y)>MOVE_DELTA||pageIndex!==this.majorObject.selectStartPage){this.drawingObjects.swapTrackObjects();this.drawingObjects.changeCurrentState(new MoveState(this.drawingObjects,this.majorObject,this.startX,this.startY));this.drawingObjects.OnMouseMove(e,x,y,pageIndex)}}, onMouseUp:function(e,x,y,pageIndex){return AscFormat.handleMouseUpPreMoveState(this.drawingObjects,e,x,y,pageIndex,true)}};function MoveState(drawingObjects,majorObject,startX,startY){this.drawingObjects=drawingObjects;this.majorObject=majorObject;this.startX=startX;this.startY=startY;var arr_x=[],arr_y=[];for(var i=0;i<this.drawingObjects.arrTrackObjects.length;++i){var track=this.drawingObjects.arrTrackObjects[i];var transform=track.originalObject.transform;arr_x.push(transform.TransformPointX(0, 0));arr_y.push(transform.TransformPointY(0,0));arr_x.push(transform.TransformPointX(track.originalObject.extX,0));arr_y.push(transform.TransformPointY(track.originalObject.extX,0));arr_x.push(transform.TransformPointX(track.originalObject.extX,track.originalObject.extY));arr_y.push(transform.TransformPointY(track.originalObject.extX,track.originalObject.extY));arr_x.push(transform.TransformPointX(0,track.originalObject.extY));arr_y.push(transform.TransformPointY(0,track.originalObject.extY))}this.rectX= Math.min.apply(Math,arr_x);this.rectY=Math.min.apply(Math,arr_y);this.rectW=Math.max.apply(Math,arr_x)-this.rectX;this.rectH=Math.max.apply(Math,arr_y)-this.rectY;this.bSamePos=true}MoveState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"move",bMarker:true}},onMouseMove:function(e,x,y,pageIndex){if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}var _arr_track_objects=this.drawingObjects.arrTrackObjects; var _objects_count=_arr_track_objects.length;var _object_index;var result_x,result_y;if(!e.ShiftKey){result_x=x;result_y=y}else{var abs_dist_x=Math.abs(this.startX-x);var abs_dist_y=Math.abs(this.startY-y);if(abs_dist_x>abs_dist_y){result_x=x;result_y=this.startY}else{result_x=this.startX;result_y=y}}var startPos={x:this.startX,y:this.startY};var start_arr=this.drawingObjects.getAllObjectsOnPage(0);var min_dx=null,min_dy=null;var dx,dy;var snap_x=[],snap_y=[];var snapHorArray=[],snapVerArray=[];for(var track_index= 0;track_index<_arr_track_objects.length;++track_index){var cur_track_original_shape=_arr_track_objects[track_index].originalObject;var trackSnapArrayX=cur_track_original_shape.snapArrayX;if(!trackSnapArrayX)continue;var curDX=result_x-startPos.x;for(snap_index=0;snap_index<trackSnapArrayX.length;++snap_index){var snap_obj=AscFormat.GetMinSnapDistanceXObjectByArrays(trackSnapArrayX[snap_index]+curDX,snapHorArray);if(isRealObject(snap_obj)){dx=snap_obj.dist;if(dx!==null)if(min_dx===null){min_dx=dx; snap_x.push(snap_obj.pos)}else if(AscFormat.fApproxEqual(min_dx,dx,.01))snap_x.push(snap_obj.pos);else if(Math.abs(min_dx)>Math.abs(dx)){min_dx=dx;snap_x.length=0;snap_x.push(snap_obj.pos)}}}if(start_arr.length>0)for(var snap_index=0;snap_index<trackSnapArrayX.length;++snap_index){var snap_obj=AscFormat.GetMinSnapDistanceXObject(trackSnapArrayX[snap_index]+curDX,start_arr);if(isRealObject(snap_obj)){dx=snap_obj.dist;if(dx!==null)if(min_dx===null){min_dx=dx;snap_x.push(snap_obj.pos)}else if(AscFormat.fApproxEqual(min_dx, dx,.01))snap_x.push(snap_obj.pos);else if(Math.abs(min_dx)>Math.abs(dx)){min_dx=dx;snap_x.length=0;snap_x.push(snap_obj.pos)}}}}if(result_x===this.startX)min_dx=0;for(track_index=0;track_index<_arr_track_objects.length;++track_index){cur_track_original_shape=_arr_track_objects[track_index].originalObject;var trackSnapArrayY=cur_track_original_shape.snapArrayY;if(!trackSnapArrayY)continue;var curDY=result_y-startPos.y;for(snap_index=0;snap_index<trackSnapArrayY.length;++snap_index){var snap_obj=AscFormat.GetMinSnapDistanceYObjectByArrays(trackSnapArrayY[snap_index]+ curDY,snapVerArray);if(isRealObject(snap_obj)){dy=snap_obj.dist;if(dy!==null)if(min_dy===null){min_dy=dy;snap_y.push(snap_obj.pos)}else if(AscFormat.fApproxEqual(min_dy,dy,.01))snap_y.push(snap_obj.pos);else if(Math.abs(min_dy)>Math.abs(dy)){min_dy=dy;snap_y.length=0;snap_y.push(snap_obj.pos)}}}if(start_arr.length>0)for(snap_index=0;snap_index<trackSnapArrayY.length;++snap_index){var snap_obj=AscFormat.GetMinSnapDistanceYObject(trackSnapArrayY[snap_index]+curDY,start_arr);if(isRealObject(snap_obj)){dy= snap_obj.dist;if(dy!==null)if(min_dy===null){min_dy=dy;snap_y.push(snap_obj.pos)}else if(AscFormat.fApproxEqual(min_dy,dy,.01))snap_y.push(snap_obj.pos);else if(Math.abs(min_dy)>Math.abs(dy)){min_dy=dy;snap_y.length=0;snap_y.push(snap_obj.pos)}}}}if(result_y===this.startY)min_dy=0;if(min_dx===null||Math.abs(min_dx)>SNAP_DISTANCE)min_dx=0;else if(this.drawingObjects.drawingObjects.cSld)for(var i=0;i<snap_x.length;++i)this.drawingObjects.getDrawingDocument().DrawVerAnchor(pageIndex,snap_x[i]);if(min_dy=== null||Math.abs(min_dy)>SNAP_DISTANCE)min_dy=0;else if(this.drawingObjects.drawingObjects.cSld)for(var i=0;i<snap_y.length;++i)this.drawingObjects.getDrawingDocument().DrawHorAnchor(pageIndex,snap_y[i]);var tx=result_x-this.startX+min_dx,ty=result_y-this.startY+min_dy;var check_position=this.drawingObjects.drawingObjects.checkGraphicObjectPosition(this.rectX+tx,this.rectY+ty,this.rectW,this.rectH);for(_object_index=0;_object_index<_objects_count;++_object_index)_arr_track_objects[_object_index].track(tx+ check_position.x,ty+check_position.y,pageIndex);this.bSamePos=AscFormat.fApproxEqual(tx+check_position.x,0)&&AscFormat.fApproxEqual(ty+check_position.y,0);this.drawingObjects.updateOverlay()},onMouseUp:RotateState.prototype.onMouseUp};function PreMoveInGroupState(drawingObjects,group,startX,startY,ShiftKey,CtrlKey,majorObject,majorObjectIsSelected){this.drawingObjects=drawingObjects;this.group=group;this.startX=startX;this.startY=startY;this.ShiftKey=ShiftKey;this.CtrlKey=CtrlKey;this.majorObject= majorObject;this.majorObjectIsSelected=majorObjectIsSelected}PreMoveInGroupState.prototype={onMouseDown:function(e,x,y,pageIndex){},onMouseMove:function(e,x,y,pageIndex){if(this.drawingObjects.isSlideShow())return;if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}if(Math.abs(this.startX-x)>MOVE_DELTA||Math.abs(this.startY-y)>MOVE_DELTA||pageIndex!==this.majorObject.selectStartPage){this.drawingObjects.swapTrackObjects();this.drawingObjects.changeCurrentState(new MoveInGroupState(this.drawingObjects, this.majorObject,this.group,this.startX,this.startY));this.drawingObjects.OnMouseMove(e,x,y,pageIndex)}},onMouseUp:function(e,x,y,pageIndex){if(e.CtrlKey&&this.majorObjectIsSelected){this.group.deselectObject(this.majorObject);if(this.group.selectedObjects.length===0)this.drawingObjects.resetInternalSelection();this.drawingObjects.drawingObjects&&this.drawingObjects.drawingObjects.sendGraphicObjectProps&&this.drawingObjects.drawingObjects.sendGraphicObjectProps();this.drawingObjects.updateOverlay()}this.drawingObjects.clearPreTrackObjects(); this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects))}};function MoveInGroupState(drawingObjects,majorObject,group,startX,startY){this.drawingObjects=drawingObjects;this.majorObject=majorObject;this.group=group;this.startX=startX;this.startY=startY;this.bSamePos=true;var arr_x=[],arr_y=[];for(var i=0;i<this.drawingObjects.arrTrackObjects.length;++i){var track=this.drawingObjects.arrTrackObjects[i];var transform=track.originalObject.transform;arr_x.push(transform.TransformPointX(0, 0));arr_y.push(transform.TransformPointY(0,0));arr_x.push(transform.TransformPointX(track.originalObject.extX,0));arr_y.push(transform.TransformPointY(track.originalObject.extX,0));arr_x.push(transform.TransformPointX(track.originalObject.extX,track.originalObject.extY));arr_y.push(transform.TransformPointY(track.originalObject.extX,track.originalObject.extY));arr_x.push(transform.TransformPointX(0,track.originalObject.extY));arr_y.push(transform.TransformPointY(0,track.originalObject.extY))}this.rectX= Math.min.apply(Math,arr_x);this.rectY=Math.min.apply(Math,arr_y);this.rectW=Math.max.apply(Math,arr_x);this.rectH=Math.max.apply(Math,arr_y)}MoveInGroupState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"move",bMarker:true}},onMouseMove:MoveState.prototype.onMouseMove,onMouseUp:MoveState.prototype.onMouseUp};function PreRotateInGroupState(drawingObjects,group,majorObject){this.drawingObjects= drawingObjects;this.group=group;this.majorObject=majorObject}PreRotateInGroupState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"crosshair",bMarker:true}},onMouseMove:function(e,x,y,pageIndex){if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}this.drawingObjects.swapTrackObjects();this.drawingObjects.changeCurrentState(new RotateInGroupState(this.drawingObjects,this.group, this.majorObject))},onMouseUp:PreMoveInGroupState.prototype.onMouseUp};function RotateInGroupState(drawingObjects,group,majorObject){this.drawingObjects=drawingObjects;this.group=group;this.majorObject=majorObject}RotateInGroupState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"crosshair",bMarker:true}},onMouseMove:RotateState.prototype.onMouseMove,onMouseUp:MoveInGroupState.prototype.onMouseUp}; function PreResizeInGroupState(drawingObjects,group,majorObject,cardDirection){this.drawingObjects=drawingObjects;this.group=group;this.majorObject=majorObject;this.cardDirection=cardDirection}PreResizeInGroupState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"crosshair",bMarker:true}},onMouseMove:function(e,x,y,pageIndex){this.drawingObjects.swapTrackObjects();this.drawingObjects.changeCurrentState(new ResizeInGroupState(this.drawingObjects, this.group,this.majorObject,this.majorObject.getNumByCardDirection(this.cardDirection),this.cardDirection));this.drawingObjects.OnMouseMove(e,x,y,pageIndex)},onMouseUp:PreMoveInGroupState.prototype.onMouseUp};function ResizeInGroupState(drawingObjects,group,majorObject,handleNum,cardDirection){this.drawingObjects=drawingObjects;this.group=group;this.majorObject=majorObject;this.handleNum=handleNum;this.cardDirection=cardDirection}ResizeInGroupState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode=== HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"crosshair",bMarker:true}},onMouseMove:ResizeState.prototype.onMouseMove,onMouseUp:MoveInGroupState.prototype.onMouseUp};function PreChangeAdjInGroupState(drawingObjects,group){this.drawingObjects=drawingObjects;this.group=group}PreChangeAdjInGroupState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.group.Get_Id(),bMarker:true,cursorType:"crosshair"}}, onMouseMove:function(e,x,y,pageIndex){this.drawingObjects.swapTrackObjects();this.drawingObjects.changeCurrentState(new ChangeAdjInGroupState(this.drawingObjects,this.group));this.drawingObjects.OnMouseMove(e,x,y,pageIndex)},onMouseUp:PreMoveInGroupState.prototype.onMouseUp};function ChangeAdjInGroupState(drawingObjects,group){this.drawingObjects=drawingObjects;this.group=group;this.majorObject=drawingObjects.arrTrackObjects[0].originalShape}ChangeAdjInGroupState.prototype={onMouseDown:function(e, x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Get_Id(),cursorType:"crosshair",bMarker:true}},onMouseMove:ChangeAdjState.prototype.onMouseMove,onMouseUp:MoveInGroupState.prototype.onMouseUp};function TextAddState(drawingObjects,majorObject,startX,startY){this.drawingObjects=drawingObjects;this.majorObject=majorObject;this.startX=startX;this.startY=startY;this.bIsSelectionEmpty=true}TextAddState.prototype={isSelectionEmpty:function(){if(this.majorObject.getObjectType()=== AscDFH.historyitem_type_GraphicFrame){if(this.majorObject.graphicObject)return this.majorObject.graphicObject.IsSelectionEmpty();return true}var oContent=this.majorObject.getDocContent&&this.majorObject.getDocContent();if(oContent)return oContent.IsSelectionEmpty();return true},checkSelectionEmpty:function(){this.bIsSelectionEmpty=this.isSelectionEmpty()},onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR){var sId=this.majorObject.Id;if(this.majorObject.chart&& this.majorObject.chart.getObjectType&&this.majorObject.chart.getObjectType()===AscDFH.historyitem_type_ChartSpace)sId=this.majorObject.chart.Id;return{objectId:sId,cursorType:"text"}}},onMouseMove:function(e,x,y,pageIndex){if(!e.IsLocked){this.onMouseUp(e,x,y,pageIndex);return}if(AscFormat.isRealNumber(this.startX)&&AscFormat.isRealNumber(this.startY)){if(Math.abs(this.startX-x)<.001&&Math.abs(this.startY-y)<.001)return;this.startX=undefined;this.startY=undefined}this.majorObject.selectionSetEnd(e, x,y,pageIndex);if(!(this.majorObject.getObjectType()===AscDFH.historyitem_type_GraphicFrame&&this.majorObject.graphicObject.Selection.Type2===table_Selection_Border))this.drawingObjects.updateSelectionState();if(this.bIsSelectionEmpty!==this.isSelectionEmpty())this.drawingObjects.drawingObjects.showDrawingObjects();this.checkSelectionEmpty()},onMouseUp:function(e,x,y,pageIndex){var oldCtrl;if(this.drawingObjects.isSlideShow()){oldCtrl=e.CtrlKey;e.CtrlKey=true}this.majorObject.selectionSetEnd(e,x, y,pageIndex);if(this.drawingObjects.isSlideShow())e.CtrlKey=oldCtrl;this.drawingObjects.updateSelectionState();this.drawingObjects.drawingObjects.sendGraphicObjectProps();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));this.drawingObjects.handleEventMode=HANDLE_EVENT_MODE_CURSOR;this.drawingObjects.noNeedUpdateCursorType=true;var cursor_type=this.drawingObjects.curState.onMouseDown(e,x,y,pageIndex);if(cursor_type&&cursor_type.hyperlink){this.drawingObjects.drawingObjects.showDrawingObjects(); if(this.drawingObjects.isSlideShow())this.drawingObjects.getEditorApi().sync_HyperlinkClickCallback(cursor_type.hyperlink.Value)}this.drawingObjects.noNeedUpdateCursorType=false;this.drawingObjects.handleEventMode=HANDLE_EVENT_MODE_HANDLE;if(editor&&AscCommon.c_oAscFormatPainterState.kOff!==editor.isPaintFormat){this.drawingObjects.paragraphFormatPaste2();if(AscCommon.c_oAscFormatPainterState.kOn===editor.isPaintFormat)editor.sync_PaintFormatCallback(c_oAscFormatPainterState.kOff)}}};function SplineBezierState(drawingObjects){this.drawingObjects= drawingObjects;this.polylineFlag=true}SplineBezierState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};this.drawingObjects.startTrackPos={x:x,y:y,pageIndex:pageIndex};this.drawingObjects.clearTrackObjects();this.drawingObjects.addPreTrackObject(new AscFormat.Spline(this.drawingObjects,this.drawingObjects.getTheme(),null,null,null,pageIndex));this.drawingObjects.arrPreTrackObjects[0].path.push(new AscFormat.SplineCommandMoveTo(x, y));this.drawingObjects.changeCurrentState(new SplineBezierState33(this.drawingObjects,x,y,pageIndex));this.drawingObjects.checkChartTextSelection();this.drawingObjects.resetSelection();this.drawingObjects.updateOverlay()},onMouseMove:function(e,X,Y,pageIndex){},onMouseUp:function(e,X,Y,pageIndex){if(Asc["editor"])Asc["editor"].asc_endAddShape();else if(editor&&editor.sync_EndAddShape)editor.sync_EndAddShape();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects))}};function SplineBezierState33(drawingObjects, startX,startY,pageIndex){this.drawingObjects=drawingObjects;this.polylineFlag=true;this.pageIndex=pageIndex}SplineBezierState33.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"}},onMouseMove:function(e,x,y,pageIndex){var startPos=this.drawingObjects.startTrackPos;if(startPos.x===x&&startPos.y===y&&startPos.pageIndex===pageIndex)return;var tr_x,tr_y;if(pageIndex===startPos.pageIndex){tr_x= x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,startPos.pageIndex);tr_x=tr_point.X;tr_y=tr_point.Y}this.drawingObjects.swapTrackObjects();this.drawingObjects.arrTrackObjects[0].path.push(new AscFormat.SplineCommandLineTo(tr_x,tr_y));this.drawingObjects.changeCurrentState(new SplineBezierState2(this.drawingObjects,this.pageIndex));this.drawingObjects.updateOverlay()},onMouseUp:function(e,x,y,pageIndex){}};function SplineBezierState2(drawingObjects, pageIndex){this.drawingObjects=drawingObjects;this.polylineFlag=true;this.pageIndex=pageIndex}SplineBezierState2.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};if(e.ClickCount>=2){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}},onMouseMove:function(e,x,y,pageIndex){var startPos=this.drawingObjects.startTrackPos; var tr_x,tr_y;if(pageIndex===startPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,startPos.pageIndex);tr_x=tr_point.X;tr_y=tr_point.Y}this.drawingObjects.arrTrackObjects[0].path[1].changeLastPoint(tr_x,tr_y);this.drawingObjects.updateOverlay()},onMouseUp:function(e,x,y,pageIndex){if(e.fromWindow){var nOldClickCount=e.ClickCount;e.ClickCount=2;this.onMouseDown(e,x,y,pageIndex);e.ClickCount=nOldClickCount;return}if(e.ClickCount< 2){var tr_x,tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex);tr_x=tr_point.x;tr_y=tr_point.y}this.drawingObjects.changeCurrentState(new SplineBezierState3(this.drawingObjects,tr_x,tr_y,this.pageIndex))}}};function SplineBezierState3(drawingObjects,startX,startY,pageIndex){this.drawingObjects=drawingObjects;this.startX=startX; this.startY=startY;this.polylineFlag=true;this.pageIndex=pageIndex}SplineBezierState3.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};if(e.ClickCount>=2){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}},onMouseMove:function(e,x,y,pageIndex){if(x===this.startX&&y===this.startY&&pageIndex=== this.drawingObjects.startTrackPos.pageIndex)return;var tr_x,tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex);tr_x=tr_point.X;tr_y=tr_point.Y}var x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6;var spline=this.drawingObjects.arrTrackObjects[0];x0=spline.path[0].x;y0=spline.path[0].y;x3=spline.path[1].x;y3=spline.path[1].y;x6=tr_x;y6= tr_y;var vx=(x6-x0)/6;var vy=(y6-y0)/6;x2=x3-vx;y2=y3-vy;x4=x3+vx;y4=y3+vy;x1=(x0+x2)*.5;y1=(y0+y2)*.5;x5=(x4+x6)*.5;y5=(y4+y6)*.5;spline.path.length=1;spline.path.push(new AscFormat.SplineCommandBezier(x1,y1,x2,y2,x3,y3));spline.path.push(new AscFormat.SplineCommandBezier(x4,y4,x5,y5,x6,y6));this.drawingObjects.updateOverlay();this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects,this.pageIndex))},onMouseUp:function(e,x,y,pageIndex){if(e.fromWindow){var nOldClickCount= e.ClickCount;e.ClickCount=2;this.onMouseDown(e,x,y,pageIndex);e.ClickCount=nOldClickCount;return}if(e.ClickCount>=2){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}}};function SplineBezierState4(drawingObjects,pageIndex){this.drawingObjects=drawingObjects;this.polylineFlag=true;this.pageIndex=pageIndex}SplineBezierState4.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode=== HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};if(e.ClickCount>=2){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}},onMouseMove:function(e,x,y,pageIndex){var spline=this.drawingObjects.arrTrackObjects[0];var lastCommand=spline.path[spline.path.length-1];var preLastCommand=spline.path[spline.path.length-2];var x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6;if(spline.path[spline.path.length- 3].id==0){x0=spline.path[spline.path.length-3].x;y0=spline.path[spline.path.length-3].y}else{x0=spline.path[spline.path.length-3].x3;y0=spline.path[spline.path.length-3].y3}x3=preLastCommand.x3;y3=preLastCommand.y3;var tr_x,tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex);tr_x=tr_point.X;tr_y=tr_point.Y}x6=tr_x;y6=tr_y;var vx= (x6-x0)/6;var vy=(y6-y0)/6;x2=x3-vx;y2=y3-vy;x4=x3+vx;y4=y3+vy;x5=(x4+x6)*.5;y5=(y4+y6)*.5;if(spline.path[spline.path.length-3].id==0){preLastCommand.x1=(x0+x2)*.5;preLastCommand.y1=(y0+y2)*.5}preLastCommand.x2=x2;preLastCommand.y2=y2;preLastCommand.x3=x3;preLastCommand.y3=y3;lastCommand.x1=x4;lastCommand.y1=y4;lastCommand.x2=x5;lastCommand.y2=y5;lastCommand.x3=x6;lastCommand.y3=y6;this.drawingObjects.updateOverlay()},onMouseUp:function(e,x,y,pageIndex){if(e.fromWindow){var nOldClickCount=e.ClickCount; e.ClickCount=2;this.onMouseDown(e,x,y,pageIndex);e.ClickCount=nOldClickCount;return}if(e.ClickCount<2){var tr_x,tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex);tr_x=tr_point.X;tr_y=tr_point.Y}this.drawingObjects.changeCurrentState(new SplineBezierState5(this.drawingObjects,tr_x,tr_y,this.pageIndex))}}};function SplineBezierState5(drawingObjects, startX,startY,pageIndex){this.drawingObjects=drawingObjects;this.startX=startX;this.startY=startY;this.polylineFlag=true;this.pageIndex=pageIndex}SplineBezierState5.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};if(e.ClickCount>=2){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}},onMouseMove:function(e, x,y,pageIndex){if(x===this.startX&&y===this.startY&&pageIndex===this.drawingObjects.startTrackPos.pageIndex)return;var spline=this.drawingObjects.arrTrackObjects[0];var lastCommand=spline.path[spline.path.length-1];var x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6;if(spline.path[spline.path.length-2].id==0){x0=spline.path[spline.path.length-2].x;y0=spline.path[spline.path.length-2].y}else{x0=spline.path[spline.path.length-2].x3;y0=spline.path[spline.path.length-2].y3}x3=lastCommand.x3;y3=lastCommand.y3; var tr_x,tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex);tr_x=tr_point.X;tr_y=tr_point.Y}x6=tr_x;y6=tr_y;var vx=(x6-x0)/6;var vy=(y6-y0)/6;x2=x3-vx;y2=y3-vy;x1=(x2+x1)*.5;y1=(y2+y1)*.5;x4=x3+vx;y4=y3+vy;x5=(x4+x6)*.5;y5=(y4+y6)*.5;if(spline.path[spline.path.length-2].id==0){lastCommand.x1=x1;lastCommand.y1=y1}lastCommand.x2= x2;lastCommand.y2=y2;spline.path.push(new AscFormat.SplineCommandBezier(x4,y4,x5,y5,x6,y6));this.drawingObjects.updateOverlay();this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects,this.pageIndex))},onMouseUp:function(e,x,y,pageIndex){if(e.ClickCount>=2||e.fromWindow){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}}};function PolyLineAddState(drawingObjects){this.drawingObjects= drawingObjects;this.polylineFlag=true}PolyLineAddState.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};this.drawingObjects.startTrackPos={x:x,y:y,pageIndex:pageIndex};this.drawingObjects.clearTrackObjects();this.drawingObjects.addTrackObject(new AscFormat.PolyLine(this.drawingObjects,this.drawingObjects.getTheme(),null,null,null,pageIndex));this.drawingObjects.arrTrackObjects[0].arrPoint.push({x:x, y:y});this.drawingObjects.checkChartTextSelection();this.drawingObjects.resetSelection();this.drawingObjects.updateOverlay();var _min_distance=this.drawingObjects.convertPixToMM(1);this.drawingObjects.changeCurrentState(new PolyLineAddState2(this.drawingObjects,_min_distance))},onMouseMove:function(){},onMouseUp:function(){if(Asc["editor"])Asc["editor"].asc_endAddShape();else if(editor&&editor.sync_EndAddShape)editor.sync_EndAddShape();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects))}}; function PolyLineAddState2(drawingObjects,minDistance){this.drawingObjects=drawingObjects;this.minDistance=minDistance;this.polylineFlag=true}PolyLineAddState2.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"}},onMouseMove:function(e,x,y,pageIndex){var _last_point=this.drawingObjects.arrTrackObjects[0].arrPoint[this.drawingObjects.arrTrackObjects[0].arrPoint.length-1];var tr_x, tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex);tr_x=tr_point.X;tr_y=tr_point.Y}var dx=tr_x-_last_point.x;var dy=tr_y-_last_point.y;if(Math.sqrt(dx*dx+dy*dy)>=this.minDistance){this.drawingObjects.arrTrackObjects[0].arrPoint.push({x:tr_x,y:tr_y});this.drawingObjects.updateOverlay()}},onMouseUp:function(e,x,y,pageIndex){if(this.drawingObjects.arrTrackObjects[0].arrPoint.length> 1){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}else{this.drawingObjects.clearTrackObjects();this.drawingObjects.updateOverlay();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));if(Asc["editor"])Asc["editor"].asc_endAddShape();else if(editor&&editor.sync_EndAddShape)editor.sync_EndAddShape()}}};function AddPolyLine2State(drawingObjects){this.drawingObjects=drawingObjects;this.polylineFlag= true}AddPolyLine2State.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};this.drawingObjects.startTrackPos={x:x,y:y,pageIndex:pageIndex};this.drawingObjects.checkChartTextSelection();this.drawingObjects.resetSelection();this.drawingObjects.updateOverlay();this.drawingObjects.clearTrackObjects();this.drawingObjects.addPreTrackObject(new AscFormat.PolyLine(this.drawingObjects,this.drawingObjects.getTheme(), null,null,null,pageIndex));this.drawingObjects.arrPreTrackObjects[0].arrPoint.push({x:x,y:y});this.drawingObjects.changeCurrentState(new AddPolyLine2State2(this.drawingObjects,x,y))},onMouseMove:function(e,x,y,pageIndex){},onMouseUp:function(e,x,y,pageIndex){}};function AddPolyLine2State2(drawingObjects,x,y){this.drawingObjects=drawingObjects;this.X=x;this.Y=y;this.polylineFlag=true}AddPolyLine2State2.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1", bMarker:true,cursorType:"crosshair"};if(e.ClickCount>1){if(Asc["editor"])Asc["editor"].asc_endAddShape();else if(editor&&editor.sync_EndAddShape)editor.sync_EndAddShape();this.drawingObjects.clearPreTrackObjects();this.drawingObjects.clearTrackObjects();this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects))}},onMouseMove:function(e,x,y,pageIndex){if(this.X!==x||this.Y!==y||this.drawingObjects.startTrackPos.pageIndex!==pageIndex){var tr_x,tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x= x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex);tr_x=tr_point.X;tr_y=tr_point.Y}this.drawingObjects.swapTrackObjects();this.drawingObjects.arrTrackObjects[0].arrPoint.push({x:tr_x,y:tr_y});this.drawingObjects.changeCurrentState(new AddPolyLine2State3(this.drawingObjects))}},onMouseUp:function(e,x,y,pageIndex){}};function AddPolyLine2State3(drawingObjects){this.drawingObjects=drawingObjects;this.minSize= drawingObjects.convertPixToMM(1);this.polylineFlag=true}AddPolyLine2State3.prototype={onMouseDown:function(e,x,y,pageIndex){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:"1",bMarker:true,cursorType:"crosshair"};var tr_x,tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex);tr_x=tr_point.X;tr_y= tr_point.Y}this.drawingObjects.arrTrackObjects[0].arrPoint.push({x:tr_x,y:tr_y});if(e.ClickCount>1){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}},onMouseMove:function(e,x,y,pageIndex){var tr_x,tr_y;if(pageIndex===this.drawingObjects.startTrackPos.pageIndex){tr_x=x;tr_y=y}else{var tr_point=this.drawingObjects.getDrawingDocument().ConvertCoordsToAnotherPage(x,y,pageIndex,this.drawingObjects.startTrackPos.pageIndex); tr_x=tr_point.X;tr_y=tr_point.Y}if(!e.IsLocked)this.drawingObjects.arrTrackObjects[0].arrPoint[this.drawingObjects.arrTrackObjects[0].arrPoint.length-1]={x:tr_x,y:tr_y};else{var _last_point=this.drawingObjects.arrTrackObjects[0].arrPoint[this.drawingObjects.arrTrackObjects[0].arrPoint.length-1];var dx=tr_x-_last_point.x;var dy=tr_y-_last_point.y;if(Math.sqrt(dx*dx+dy*dy)>=this.minSize)this.drawingObjects.arrTrackObjects[0].arrPoint.push({x:tr_x,y:tr_y})}this.drawingObjects.updateOverlay()},onMouseUp:function(e, x,y,pageIndex){if(e.fromWindow){var nOldClickCount=e.ClickCount;e.ClickCount=2;this.onMouseDown(e,x,y,pageIndex);e.ClickCount=nOldClickCount;return}if(e.ClickCount>1){this.bStart=true;this.pageIndex=this.drawingObjects.startTrackPos.pageIndex;StartAddNewShape.prototype.onMouseUp.call(this,e,x,y,pageIndex)}}};function TrackTextState(drawingObjects,majorObject,x,y){this.drawingObjects=drawingObjects;this.majorObject=majorObject;this.startX=x;this.startY=y;this.bMove=false}TrackTextState.prototype.onMouseDown= function(e,x,y){if(this.drawingObjects.handleEventMode===HANDLE_EVENT_MODE_CURSOR)return{objectId:this.majorObject.Id,bMarker:true,cursorType:"default"};return null};TrackTextState.prototype.onMouseMove=function(e,x,y){if(Math.abs(x-this.startX)>MOVE_DELTA||Math.abs(y-this.startY)>MOVE_DELTA){this.bMove=true;this.drawingObjects.getDrawingDocument().StartTrackText()}};TrackTextState.prototype.onMouseUp=function(e,x,y,pageIndex){if(!this.bMove){this.majorObject.selectionSetStart(e,x,y,0);this.majorObject.selectionSetEnd(e, x,y,0);this.drawingObjects.updateSelectionState();this.drawingObjects.drawingObjects.sendGraphicObjectProps()}this.drawingObjects.changeCurrentState(new AscFormat.NullState(this.drawingObjects))};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].MOVE_DELTA=MOVE_DELTA;window["AscFormat"].SNAP_DISTANCE=SNAP_DISTANCE;window["AscFormat"].StartAddNewShape=StartAddNewShape;window["AscFormat"].NullState=NullState;window["AscFormat"].SlicerState=SlicerState;window["AscFormat"].PreChangeAdjState= PreChangeAdjState;window["AscFormat"].PreRotateState=PreRotateState;window["AscFormat"].PreResizeState=PreResizeState;window["AscFormat"].PreMoveState=PreMoveState;window["AscFormat"].MoveState=MoveState;window["AscFormat"].PreMoveInGroupState=PreMoveInGroupState;window["AscFormat"].MoveInGroupState=MoveInGroupState;window["AscFormat"].PreRotateInGroupState=PreRotateInGroupState;window["AscFormat"].PreResizeInGroupState=PreResizeInGroupState;window["AscFormat"].PreChangeAdjInGroupState=PreChangeAdjInGroupState; window["AscFormat"].TextAddState=TextAddState;window["AscFormat"].SplineBezierState=SplineBezierState;window["AscFormat"].PolyLineAddState=PolyLineAddState;window["AscFormat"].AddPolyLine2State=AddPolyLine2State;window["AscFormat"].TrackTextState=TrackTextState;window["AscFormat"].checkEmptyPlaceholderContent=checkEmptyPlaceholderContent})(window);"use strict";(function(window,undefined){function CreateGeometry(prst){var f=new AscFormat.Geometry;switch(prst){case "accentBorderCallout1":{f.AddAdj("adj1", 15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"112500");f.AddAdj("adj4",15,"-38333");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2", "l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(6);f.AddPathCommand(2,"x1","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2, "x2","y2");break}case "accentBorderCallout2":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"18750");f.AddAdj("adj4",15,"-16667");f.AddAdj("adj5",15,"112500");f.AddAdj("adj6",15,"-46667");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddGuide("y3",0,"h","adj5","100000");f.AddGuide("x3",0,"w","adj6","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1", "-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddHandleXY("adj6","-2147483647","2147483647","adj5","-2147483647","2147483647","x3","y3");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b"); f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(6);f.AddPathCommand(2,"x1","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x3","y3");break}case "accentBorderCallout3":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"18750");f.AddAdj("adj4",15,"-16667");f.AddAdj("adj5", 15,"100000");f.AddAdj("adj6",15,"-16667");f.AddAdj("adj7",15,"112963");f.AddAdj("adj8",15,"-8333");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddGuide("y3",0,"h","adj5","100000");f.AddGuide("x3",0,"w","adj6","100000");f.AddGuide("y4",0,"h","adj7","100000");f.AddGuide("x4",0,"w","adj8","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1"); f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddHandleXY("adj6","-2147483647","2147483647","adj5","-2147483647","2147483647","x3","y3");f.AddHandleXY("adj8","-2147483647","2147483647","adj7","-2147483647","2147483647","x4","y4");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2, "r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(6);f.AddPathCommand(2,"x1","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x4","y4");break}case "accentCallout1":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3", 15,"112500");f.AddAdj("adj4",15,"-38333");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t", "r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(6);f.AddPathCommand(2,"x1","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");break}case "accentCallout2":{f.AddAdj("adj1", 15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"18750");f.AddAdj("adj4",15,"-16667");f.AddAdj("adj5",15,"112500");f.AddAdj("adj6",15,"-46667");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddGuide("y3",0,"h","adj5","100000");f.AddGuide("x3",0,"w","adj6","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4", "-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddHandleXY("adj6","-2147483647","2147483647","adj5","-2147483647","2147483647","x3","y3");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0, false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(6);f.AddPathCommand(2,"x1","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x3","y3");break}case "accentCallout3":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"18750");f.AddAdj("adj4",15,"-16667");f.AddAdj("adj5",15,"100000");f.AddAdj("adj6",15,"-16667");f.AddAdj("adj7",15,"112963"); f.AddAdj("adj8",15,"-8333");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddGuide("y3",0,"h","adj5","100000");f.AddGuide("x3",0,"w","adj6","100000");f.AddGuide("y4",0,"h","adj7","100000");f.AddGuide("x4",0,"w","adj8","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647", "2147483647","x2","y2");f.AddHandleXY("adj6","-2147483647","2147483647","adj5","-2147483647","2147483647","x3","y3");f.AddHandleXY("adj8","-2147483647","2147483647","adj7","-2147483647","2147483647","x4","y4");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2, "l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(6);f.AddPathCommand(2,"x1","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x4","y4");break}case "actionButtonBackPrevious":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0");f.AddGuide("g11", 1,"hc","0","dx2");f.AddGuide("g12",1,"hc","dx2","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"g11","vc");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(6);f.AddPathCommand(0, false,"darken",false,undefined,undefined);f.AddPathCommand(1,"g11","vc");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"g11","vc");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2, "l","b");f.AddPathCommand(6);break}case "actionButtonBeginning":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0");f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g12",1,"hc","dx2","0");f.AddGuide("g13",0,"ss","3","4");f.AddGuide("g14",0,"g13","1","8");f.AddGuide("g15",0,"g13","1","4");f.AddGuide("g16",1,"g11","g14","0");f.AddGuide("g17",1,"g11","g15","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc", "t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"g17","vc");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(6);f.AddPathCommand(1,"g16","g9");f.AddPathCommand(2,"g11","g9");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(2,"g16","g10");f.AddPathCommand(6);f.AddPathCommand(0, false,"darken",false,undefined,undefined);f.AddPathCommand(1,"g17","vc");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(6);f.AddPathCommand(1,"g16","g9");f.AddPathCommand(2,"g11","g9");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(2,"g16","g10");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"g17","vc");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(6);f.AddPathCommand(1,"g16", "g9");f.AddPathCommand(2,"g16","g10");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(2,"g11","g9");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonBlank":{f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined, undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonDocument":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0");f.AddGuide("dx1",0,"ss","9","32");f.AddGuide("g11",1,"hc","0","dx1");f.AddGuide("g12",1,"hc","dx1","0");f.AddGuide("g13",0,"ss","3","16");f.AddGuide("g14",1,"g12","0","g13");f.AddGuide("g15", 1,"g9","g13","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"g11","g9");f.AddPathCommand(2,"g14","g9");f.AddPathCommand(2,"g12","g15");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(6); f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"g11","g9");f.AddPathCommand(2,"g14","g9");f.AddPathCommand(2,"g14","g15");f.AddPathCommand(2,"g12","g15");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken",false,undefined,undefined);f.AddPathCommand(1,"g14","g9");f.AddPathCommand(2,"g14","g15");f.AddPathCommand(2,"g12","g15");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined, undefined);f.AddPathCommand(1,"g11","g9");f.AddPathCommand(2,"g14","g9");f.AddPathCommand(2,"g12","g15");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(6);f.AddPathCommand(1,"g12","g15");f.AddPathCommand(2,"g14","g15");f.AddPathCommand(2,"g14","g9");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonEnd":{f.AddGuide("dx2", 0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0");f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g12",1,"hc","dx2","0");f.AddGuide("g13",0,"ss","3","4");f.AddGuide("g14",0,"g13","3","4");f.AddGuide("g15",0,"g13","7","8");f.AddGuide("g16",1,"g11","g14","0");f.AddGuide("g17",1,"g11","g15","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined, undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"g16","vc");f.AddPathCommand(2,"g11","g9");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(6);f.AddPathCommand(1,"g17","g9");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(2,"g17","g10");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken",false,undefined,undefined);f.AddPathCommand(1,"g16","vc");f.AddPathCommand(2, "g11","g9");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(6);f.AddPathCommand(1,"g17","g9");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(2,"g17","g10");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"g16","vc");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(2,"g11","g9");f.AddPathCommand(6);f.AddPathCommand(1,"g17","g9");f.AddPathCommand(2,"g12","g9");f.AddPathCommand(2,"g12","g10");f.AddPathCommand(2,"g17", "g10");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonForwardNext":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0");f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g12",1,"hc","dx2","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l", "vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"g12","vc");f.AddPathCommand(2,"g11","g9");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken",false,undefined,undefined);f.AddPathCommand(1,"g12","vc");f.AddPathCommand(2,"g11","g9");f.AddPathCommand(2, "g11","g10");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"g12","vc");f.AddPathCommand(2,"g11","g10");f.AddPathCommand(2,"g11","g9");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonHelp":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2"); f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g13",0,"ss","3","4");f.AddGuide("g14",0,"g13","1","7");f.AddGuide("g15",0,"g13","3","14");f.AddGuide("g16",0,"g13","2","7");f.AddGuide("g19",0,"g13","3","7");f.AddGuide("g20",0,"g13","4","7");f.AddGuide("g21",0,"g13","17","28");f.AddGuide("g23",0,"g13","21","28");f.AddGuide("g24",0,"g13","11","14");f.AddGuide("g27",1,"g9","g16","0");f.AddGuide("g29",1,"g9","g21","0");f.AddGuide("g30",1,"g9","g23","0");f.AddGuide("g31",1,"g9","g24","0");f.AddGuide("g33", 1,"g11","g15","0");f.AddGuide("g36",1,"g11","g19","0");f.AddGuide("g37",1,"g11","g20","0");f.AddGuide("g41",0,"g13","1","14");f.AddGuide("g42",0,"g13","3","28");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1, "g33","g27");f.AddPathCommand(3,"g16","g16","cd2","cd2");f.AddPathCommand(3,"g14","g15","0","cd4");f.AddPathCommand(3,"g41","g42","_3cd4","-5400000");f.AddPathCommand(2,"g37","g30");f.AddPathCommand(2,"g36","g30");f.AddPathCommand(2,"g36","g29");f.AddPathCommand(3,"g14","g15","cd2","cd4");f.AddPathCommand(3,"g41","g42","cd4","-5400000");f.AddPathCommand(3,"g14","g14","0","-10800000");f.AddPathCommand(6);f.AddPathCommand(1,"hc","g31");f.AddPathCommand(3,"g42","g42","_3cd4","21600000");f.AddPathCommand(6); f.AddPathCommand(0,false,"darken",false,undefined,undefined);f.AddPathCommand(1,"g33","g27");f.AddPathCommand(3,"g16","g16","cd2","cd2");f.AddPathCommand(3,"g14","g15","0","cd4");f.AddPathCommand(3,"g41","g42","_3cd4","-5400000");f.AddPathCommand(2,"g37","g30");f.AddPathCommand(2,"g36","g30");f.AddPathCommand(2,"g36","g29");f.AddPathCommand(3,"g14","g15","cd2","cd4");f.AddPathCommand(3,"g41","g42","cd4","-5400000");f.AddPathCommand(3,"g14","g14","0","-10800000");f.AddPathCommand(6);f.AddPathCommand(1, "hc","g31");f.AddPathCommand(3,"g42","g42","_3cd4","21600000");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"g33","g27");f.AddPathCommand(3,"g16","g16","cd2","cd2");f.AddPathCommand(3,"g14","g15","0","cd4");f.AddPathCommand(3,"g41","g42","_3cd4","-5400000");f.AddPathCommand(2,"g37","g30");f.AddPathCommand(2,"g36","g30");f.AddPathCommand(2,"g36","g29");f.AddPathCommand(3,"g14","g15","cd2","cd4");f.AddPathCommand(3,"g41","g42","cd4","-5400000"); f.AddPathCommand(3,"g14","g14","0","-10800000");f.AddPathCommand(6);f.AddPathCommand(1,"hc","g31");f.AddPathCommand(3,"g42","g42","_3cd4","21600000");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonHome":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0"); f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g12",1,"hc","dx2","0");f.AddGuide("g13",0,"ss","3","4");f.AddGuide("g14",0,"g13","1","16");f.AddGuide("g15",0,"g13","1","8");f.AddGuide("g16",0,"g13","3","16");f.AddGuide("g17",0,"g13","5","16");f.AddGuide("g18",0,"g13","7","16");f.AddGuide("g19",0,"g13","9","16");f.AddGuide("g20",0,"g13","11","16");f.AddGuide("g21",0,"g13","3","4");f.AddGuide("g22",0,"g13","13","16");f.AddGuide("g23",0,"g13","7","8");f.AddGuide("g24",1,"g9","g14","0");f.AddGuide("g25", 1,"g9","g16","0");f.AddGuide("g26",1,"g9","g17","0");f.AddGuide("g27",1,"g9","g21","0");f.AddGuide("g28",1,"g11","g15","0");f.AddGuide("g29",1,"g11","g18","0");f.AddGuide("g30",1,"g11","g19","0");f.AddGuide("g31",1,"g11","g20","0");f.AddGuide("g32",1,"g11","g22","0");f.AddGuide("g33",1,"g11","g23","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1, "l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"hc","g9");f.AddPathCommand(2,"g11","vc");f.AddPathCommand(2,"g28","vc");f.AddPathCommand(2,"g28","g10");f.AddPathCommand(2,"g33","g10");f.AddPathCommand(2,"g33","vc");f.AddPathCommand(2,"g12","vc");f.AddPathCommand(2,"g32","g26");f.AddPathCommand(2,"g32","g24");f.AddPathCommand(2,"g31","g24");f.AddPathCommand(2,"g31","g25");f.AddPathCommand(6);f.AddPathCommand(0,false, "darkenLess",false,undefined,undefined);f.AddPathCommand(1,"g32","g26");f.AddPathCommand(2,"g32","g24");f.AddPathCommand(2,"g31","g24");f.AddPathCommand(2,"g31","g25");f.AddPathCommand(6);f.AddPathCommand(1,"g28","vc");f.AddPathCommand(2,"g28","g10");f.AddPathCommand(2,"g29","g10");f.AddPathCommand(2,"g29","g27");f.AddPathCommand(2,"g30","g27");f.AddPathCommand(2,"g30","g10");f.AddPathCommand(2,"g33","g10");f.AddPathCommand(2,"g33","vc");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken",false, undefined,undefined);f.AddPathCommand(1,"hc","g9");f.AddPathCommand(2,"g11","vc");f.AddPathCommand(2,"g12","vc");f.AddPathCommand(6);f.AddPathCommand(1,"g29","g27");f.AddPathCommand(2,"g30","g27");f.AddPathCommand(2,"g30","g10");f.AddPathCommand(2,"g29","g10");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"hc","g9");f.AddPathCommand(2,"g31","g25");f.AddPathCommand(2,"g31","g24");f.AddPathCommand(2,"g32","g24");f.AddPathCommand(2,"g32","g26"); f.AddPathCommand(2,"g12","vc");f.AddPathCommand(2,"g33","vc");f.AddPathCommand(2,"g33","g10");f.AddPathCommand(2,"g28","g10");f.AddPathCommand(2,"g28","vc");f.AddPathCommand(2,"g11","vc");f.AddPathCommand(6);f.AddPathCommand(1,"g31","g25");f.AddPathCommand(2,"g32","g26");f.AddPathCommand(1,"g33","vc");f.AddPathCommand(2,"g28","vc");f.AddPathCommand(1,"g29","g10");f.AddPathCommand(2,"g29","g27");f.AddPathCommand(2,"g30","g27");f.AddPathCommand(2,"g30","g10");f.AddPathCommand(0,undefined,"none",undefined, undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonInformation":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g13",0,"ss","3","4");f.AddGuide("g14",0,"g13","1","32");f.AddGuide("g17",0,"g13","5","16");f.AddGuide("g18",0,"g13","3","8");f.AddGuide("g19",0,"g13","13","32");f.AddGuide("g20",0,"g13","19","32"); f.AddGuide("g22",0,"g13","11","16");f.AddGuide("g23",0,"g13","13","16");f.AddGuide("g24",0,"g13","7","8");f.AddGuide("g25",1,"g9","g14","0");f.AddGuide("g28",1,"g9","g17","0");f.AddGuide("g29",1,"g9","g18","0");f.AddGuide("g30",1,"g9","g23","0");f.AddGuide("g31",1,"g9","g24","0");f.AddGuide("g32",1,"g11","g17","0");f.AddGuide("g34",1,"g11","g19","0");f.AddGuide("g35",1,"g11","g20","0");f.AddGuide("g37",1,"g11","g22","0");f.AddGuide("g38",0,"g13","3","32");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc", "b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"hc","g9");f.AddPathCommand(3,"dx2","dx2","_3cd4","21600000");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken",false,undefined,undefined);f.AddPathCommand(1,"hc","g9");f.AddPathCommand(3,"dx2","dx2", "_3cd4","21600000");f.AddPathCommand(6);f.AddPathCommand(1,"hc","g25");f.AddPathCommand(3,"g38","g38","_3cd4","21600000");f.AddPathCommand(1,"g32","g28");f.AddPathCommand(2,"g32","g29");f.AddPathCommand(2,"g34","g29");f.AddPathCommand(2,"g34","g30");f.AddPathCommand(2,"g32","g30");f.AddPathCommand(2,"g32","g31");f.AddPathCommand(2,"g37","g31");f.AddPathCommand(2,"g37","g30");f.AddPathCommand(2,"g35","g30");f.AddPathCommand(2,"g35","g28");f.AddPathCommand(6);f.AddPathCommand(0,false,"lighten",false, undefined,undefined);f.AddPathCommand(1,"hc","g25");f.AddPathCommand(3,"g38","g38","_3cd4","21600000");f.AddPathCommand(1,"g32","g28");f.AddPathCommand(2,"g35","g28");f.AddPathCommand(2,"g35","g30");f.AddPathCommand(2,"g37","g30");f.AddPathCommand(2,"g37","g31");f.AddPathCommand(2,"g32","g31");f.AddPathCommand(2,"g32","g30");f.AddPathCommand(2,"g34","g30");f.AddPathCommand(2,"g34","g29");f.AddPathCommand(2,"g32","g29");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined); f.AddPathCommand(1,"hc","g9");f.AddPathCommand(3,"dx2","dx2","_3cd4","21600000");f.AddPathCommand(6);f.AddPathCommand(1,"hc","g25");f.AddPathCommand(3,"g38","g38","_3cd4","21600000");f.AddPathCommand(1,"g32","g28");f.AddPathCommand(2,"g35","g28");f.AddPathCommand(2,"g35","g30");f.AddPathCommand(2,"g37","g30");f.AddPathCommand(2,"g37","g31");f.AddPathCommand(2,"g32","g31");f.AddPathCommand(2,"g32","g30");f.AddPathCommand(2,"g34","g30");f.AddPathCommand(2,"g34","g29");f.AddPathCommand(2,"g32","g29"); f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonMovie":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0");f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g12",1,"hc","dx2","0");f.AddGuide("g13",0,"ss","3","4");f.AddGuide("g14",0,"g13","1455","21600");f.AddGuide("g15", 0,"g13","1905","21600");f.AddGuide("g16",0,"g13","2325","21600");f.AddGuide("g17",0,"g13","16155","21600");f.AddGuide("g18",0,"g13","17010","21600");f.AddGuide("g19",0,"g13","19335","21600");f.AddGuide("g20",0,"g13","19725","21600");f.AddGuide("g21",0,"g13","20595","21600");f.AddGuide("g22",0,"g13","5280","21600");f.AddGuide("g23",0,"g13","5730","21600");f.AddGuide("g24",0,"g13","6630","21600");f.AddGuide("g25",0,"g13","7492","21600");f.AddGuide("g26",0,"g13","9067","21600");f.AddGuide("g27",0,"g13", "9555","21600");f.AddGuide("g28",0,"g13","13342","21600");f.AddGuide("g29",0,"g13","14580","21600");f.AddGuide("g30",0,"g13","15592","21600");f.AddGuide("g31",1,"g11","g14","0");f.AddGuide("g32",1,"g11","g15","0");f.AddGuide("g33",1,"g11","g16","0");f.AddGuide("g34",1,"g11","g17","0");f.AddGuide("g35",1,"g11","g18","0");f.AddGuide("g36",1,"g11","g19","0");f.AddGuide("g37",1,"g11","g20","0");f.AddGuide("g38",1,"g11","g21","0");f.AddGuide("g39",1,"g9","g22","0");f.AddGuide("g40",1,"g9","g23","0");f.AddGuide("g41", 1,"g9","g24","0");f.AddGuide("g42",1,"g9","g25","0");f.AddGuide("g43",1,"g9","g26","0");f.AddGuide("g44",1,"g9","g27","0");f.AddGuide("g45",1,"g9","g28","0");f.AddGuide("g46",1,"g9","g29","0");f.AddGuide("g47",1,"g9","g30","0");f.AddGuide("g48",1,"g9","g31","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r", "t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"g11","g39");f.AddPathCommand(2,"g11","g44");f.AddPathCommand(2,"g31","g44");f.AddPathCommand(2,"g32","g43");f.AddPathCommand(2,"g33","g43");f.AddPathCommand(2,"g33","g47");f.AddPathCommand(2,"g35","g47");f.AddPathCommand(2,"g35","g45");f.AddPathCommand(2,"g36","g45");f.AddPathCommand(2,"g38","g46");f.AddPathCommand(2,"g12","g46");f.AddPathCommand(2,"g12","g41");f.AddPathCommand(2,"g38","g41");f.AddPathCommand(2, "g37","g42");f.AddPathCommand(2,"g35","g42");f.AddPathCommand(2,"g35","g41");f.AddPathCommand(2,"g34","g40");f.AddPathCommand(2,"g32","g40");f.AddPathCommand(2,"g31","g39");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken",false,undefined,undefined);f.AddPathCommand(1,"g11","g39");f.AddPathCommand(2,"g11","g44");f.AddPathCommand(2,"g31","g44");f.AddPathCommand(2,"g32","g43");f.AddPathCommand(2,"g33","g43");f.AddPathCommand(2,"g33","g47");f.AddPathCommand(2,"g35","g47");f.AddPathCommand(2,"g35", "g45");f.AddPathCommand(2,"g36","g45");f.AddPathCommand(2,"g38","g46");f.AddPathCommand(2,"g12","g46");f.AddPathCommand(2,"g12","g41");f.AddPathCommand(2,"g38","g41");f.AddPathCommand(2,"g37","g42");f.AddPathCommand(2,"g35","g42");f.AddPathCommand(2,"g35","g41");f.AddPathCommand(2,"g34","g40");f.AddPathCommand(2,"g32","g40");f.AddPathCommand(2,"g31","g39");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"g11","g39");f.AddPathCommand(2,"g31","g39"); f.AddPathCommand(2,"g32","g40");f.AddPathCommand(2,"g34","g40");f.AddPathCommand(2,"g35","g41");f.AddPathCommand(2,"g35","g42");f.AddPathCommand(2,"g37","g42");f.AddPathCommand(2,"g38","g41");f.AddPathCommand(2,"g12","g41");f.AddPathCommand(2,"g12","g46");f.AddPathCommand(2,"g38","g46");f.AddPathCommand(2,"g36","g45");f.AddPathCommand(2,"g35","g45");f.AddPathCommand(2,"g35","g47");f.AddPathCommand(2,"g33","g47");f.AddPathCommand(2,"g33","g43");f.AddPathCommand(2,"g32","g43");f.AddPathCommand(2,"g31", "g44");f.AddPathCommand(2,"g11","g44");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonReturn":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0");f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g12",1,"hc","dx2","0");f.AddGuide("g13",0,"ss","3","4");f.AddGuide("g14", 0,"g13","7","8");f.AddGuide("g15",0,"g13","3","4");f.AddGuide("g16",0,"g13","5","8");f.AddGuide("g17",0,"g13","3","8");f.AddGuide("g18",0,"g13","1","4");f.AddGuide("g19",1,"g9","g15","0");f.AddGuide("g20",1,"g9","g16","0");f.AddGuide("g21",1,"g9","g18","0");f.AddGuide("g22",1,"g11","g14","0");f.AddGuide("g23",1,"g11","g15","0");f.AddGuide("g24",1,"g11","g16","0");f.AddGuide("g25",1,"g11","g17","0");f.AddGuide("g26",1,"g11","g18","0");f.AddGuide("g27",0,"g13","1","8");f.AddCnx("0","r","vc");f.AddCnx("cd4", "hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"g12","g21");f.AddPathCommand(2,"g23","g9");f.AddPathCommand(2,"hc","g21");f.AddPathCommand(2,"g24","g21");f.AddPathCommand(2,"g24","g20");f.AddPathCommand(3,"g27","g27","0","cd4");f.AddPathCommand(2, "g25","g19");f.AddPathCommand(3,"g27","g27","cd4","cd4");f.AddPathCommand(2,"g26","g21");f.AddPathCommand(2,"g11","g21");f.AddPathCommand(2,"g11","g20");f.AddPathCommand(3,"g17","g17","cd2","-5400000");f.AddPathCommand(2,"hc","g10");f.AddPathCommand(3,"g17","g17","cd4","-5400000");f.AddPathCommand(2,"g22","g21");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken",false,undefined,undefined);f.AddPathCommand(1,"g12","g21");f.AddPathCommand(2,"g23","g9");f.AddPathCommand(2,"hc","g21");f.AddPathCommand(2, "g24","g21");f.AddPathCommand(2,"g24","g20");f.AddPathCommand(3,"g27","g27","0","cd4");f.AddPathCommand(2,"g25","g19");f.AddPathCommand(3,"g27","g27","cd4","cd4");f.AddPathCommand(2,"g26","g21");f.AddPathCommand(2,"g11","g21");f.AddPathCommand(2,"g11","g20");f.AddPathCommand(3,"g17","g17","cd2","-5400000");f.AddPathCommand(2,"hc","g10");f.AddPathCommand(3,"g17","g17","cd4","-5400000");f.AddPathCommand(2,"g22","g21");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined); f.AddPathCommand(1,"g12","g21");f.AddPathCommand(2,"g22","g21");f.AddPathCommand(2,"g22","g20");f.AddPathCommand(3,"g17","g17","0","cd4");f.AddPathCommand(2,"g25","g10");f.AddPathCommand(3,"g17","g17","cd4","cd4");f.AddPathCommand(2,"g11","g21");f.AddPathCommand(2,"g26","g21");f.AddPathCommand(2,"g26","g20");f.AddPathCommand(3,"g27","g27","cd2","-5400000");f.AddPathCommand(2,"hc","g19");f.AddPathCommand(3,"g27","g27","cd4","-5400000");f.AddPathCommand(2,"g24","g21");f.AddPathCommand(2,"hc","g21"); f.AddPathCommand(2,"g23","g9");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "actionButtonSound":{f.AddGuide("dx2",0,"ss","3","8");f.AddGuide("g9",1,"vc","0","dx2");f.AddGuide("g10",1,"vc","dx2","0");f.AddGuide("g11",1,"hc","0","dx2");f.AddGuide("g12",1,"hc","dx2","0");f.AddGuide("g13",0,"ss","3","4");f.AddGuide("g14", 0,"g13","1","8");f.AddGuide("g15",0,"g13","5","16");f.AddGuide("g16",0,"g13","5","8");f.AddGuide("g17",0,"g13","11","16");f.AddGuide("g18",0,"g13","3","4");f.AddGuide("g19",0,"g13","7","8");f.AddGuide("g20",1,"g9","g14","0");f.AddGuide("g21",1,"g9","g15","0");f.AddGuide("g22",1,"g9","g17","0");f.AddGuide("g23",1,"g9","g19","0");f.AddGuide("g24",1,"g11","g15","0");f.AddGuide("g25",1,"g11","g16","0");f.AddGuide("g26",1,"g11","g18","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2", "l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"g11","g21");f.AddPathCommand(2,"g11","g22");f.AddPathCommand(2,"g24","g22");f.AddPathCommand(2,"g25","g10");f.AddPathCommand(2,"g25","g9");f.AddPathCommand(2,"g24","g21");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken", false,undefined,undefined);f.AddPathCommand(1,"g11","g21");f.AddPathCommand(2,"g11","g22");f.AddPathCommand(2,"g24","g22");f.AddPathCommand(2,"g25","g10");f.AddPathCommand(2,"g25","g9");f.AddPathCommand(2,"g24","g21");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"g11","g21");f.AddPathCommand(2,"g24","g21");f.AddPathCommand(2,"g25","g9");f.AddPathCommand(2,"g25","g10");f.AddPathCommand(2,"g24","g22");f.AddPathCommand(2,"g11","g22");f.AddPathCommand(6); f.AddPathCommand(1,"g26","g21");f.AddPathCommand(2,"g12","g20");f.AddPathCommand(1,"g26","vc");f.AddPathCommand(2,"g12","vc");f.AddPathCommand(1,"g26","g22");f.AddPathCommand(2,"g12","g23");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "arc":{f.AddAdj("adj1",15,"16200000");f.AddAdj("adj2",15,"0");f.AddGuide("stAng",10,"0","adj1","21599999"); f.AddGuide("enAng",10,"0","adj2","21599999");f.AddGuide("sw11",1,"enAng","0","stAng");f.AddGuide("sw12",1,"sw11","21600000","0");f.AddGuide("swAng",3,"sw11","sw11","sw12");f.AddGuide("wt1",12,"wd2","stAng");f.AddGuide("ht1",7,"hd2","stAng");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("wt2",12,"wd2","enAng");f.AddGuide("ht2",7,"hd2","enAng");f.AddGuide("dx2",6,"wd2","ht2","wt2");f.AddGuide("dy2",11,"hd2","ht2","wt2");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1", 1,"vc","dy1","0");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddGuide("sw0",1,"21600000","0","stAng");f.AddGuide("da1",1,"swAng","0","sw0");f.AddGuide("g1",8,"x1","x2");f.AddGuide("ir",3,"da1","r","g1");f.AddGuide("sw1",1,"cd4","0","stAng");f.AddGuide("sw2",1,"27000000","0","stAng");f.AddGuide("sw3",3,"sw1","sw1","sw2");f.AddGuide("da2",1,"swAng","0","sw3");f.AddGuide("g5",8,"y1","y2");f.AddGuide("ib",3,"da2","b","g5");f.AddGuide("sw4",1,"cd2","0","stAng");f.AddGuide("sw5", 1,"32400000","0","stAng");f.AddGuide("sw6",3,"sw4","sw4","sw5");f.AddGuide("da3",1,"swAng","0","sw6");f.AddGuide("g9",16,"x1","x2");f.AddGuide("il",3,"da3","l","g9");f.AddGuide("sw7",1,"_3cd4","0","stAng");f.AddGuide("sw8",1,"37800000","0","stAng");f.AddGuide("sw9",3,"sw7","sw7","sw8");f.AddGuide("da4",1,"swAng","0","sw9");f.AddGuide("g13",16,"y1","y2");f.AddGuide("it",3,"da4","t","g13");f.AddGuide("cang1",1,"stAng","0","cd4");f.AddGuide("cang2",1,"enAng","cd4","0");f.AddGuide("cang3",2,"cang1","cang2", "2");f.AddHandlePolar("adj1","0","21599999",undefined,"0","0","x1","y1");f.AddHandlePolar("adj2","0","21599999",undefined,"0","0","x2","y2");f.AddCnx("cang1","x1","y1");f.AddCnx("cang3","hc","vc");f.AddCnx("cang2","x2","y2");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","stAng","swAng");f.AddPathCommand(2,"hc","vc");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined, undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","stAng","swAng");break}case "bentArrow":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddAdj("adj4",15,"43750");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("a3",10,"0","adj3","50000");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("aw2",0,"ss","a2","100000");f.AddGuide("th2",0,"th","1","2");f.AddGuide("dh2", 1,"aw2","0","th2");f.AddGuide("ah",0,"ss","a3","100000");f.AddGuide("bw",1,"r","0","ah");f.AddGuide("bh",1,"b","0","dh2");f.AddGuide("bs",16,"bw","bh");f.AddGuide("maxAdj4",0,"100000","bs","ss");f.AddGuide("a4",10,"0","adj4","maxAdj4");f.AddGuide("bd",0,"ss","a4","100000");f.AddGuide("bd3",1,"bd","0","th");f.AddGuide("bd2",8,"bd3","0");f.AddGuide("x3",1,"th","bd2","0");f.AddGuide("x4",1,"r","0","ah");f.AddGuide("y3",1,"dh2","th","0");f.AddGuide("y4",1,"y3","dh2","0");f.AddGuide("y5",1,"dh2","bd", "0");f.AddGuide("y6",1,"y3","bd2","0");f.AddHandleXY("adj1","0","maxAdj1",undefined,"0","0","th","b");f.AddHandleXY(undefined,"0","0","adj2","0","50000","r","y4");f.AddHandleXY("adj3","0","50000",undefined,"0","0","x4","t");f.AddHandleXY("adj4","0","maxAdj4",undefined,"0","0","bd","t");f.AddCnx("_3cd4","x4","t");f.AddCnx("cd4","x4","y4");f.AddCnx("cd4","th2","b");f.AddCnx("0","r","aw2");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1, "l","b");f.AddPathCommand(2,"l","y5");f.AddPathCommand(3,"bd","bd","cd2","cd4");f.AddPathCommand(2,"x4","dh2");f.AddPathCommand(2,"x4","t");f.AddPathCommand(2,"r","aw2");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(3,"bd2","bd2","_3cd4","-5400000");f.AddPathCommand(2,"th","b");f.AddPathCommand(6);break}case "bentConnector2":{f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1, "l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");break}case "bentConnector3":{f.AddAdj("adj1",15,"50000");f.AddGuide("x1",0,"w","adj1","100000");f.AddHandleXY("adj1","-2147483647","2147483647",undefined,"0","0","x1","vc");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"r","b");break}case "bentConnector4":{f.AddAdj("adj1",15,"50000"); f.AddAdj("adj2",15,"50000");f.AddGuide("x1",0,"w","adj1","100000");f.AddGuide("x2",2,"x1","r","2");f.AddGuide("y2",0,"h","adj2","100000");f.AddGuide("y1",2,"t","y2","2");f.AddHandleXY("adj1","-2147483647","2147483647",undefined,"0","0","x1","y1");f.AddHandleXY(undefined,"0","0","adj2","-2147483647","2147483647","x2","y2");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x1","y2"); f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"r","b");break}case "bentConnector5":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"50000");f.AddGuide("x1",0,"w","adj1","100000");f.AddGuide("x3",0,"w","adj3","100000");f.AddGuide("x2",2,"x1","x3","2");f.AddGuide("y2",0,"h","adj2","100000");f.AddGuide("y1",2,"t","y2","2");f.AddGuide("y3",2,"b","y2","2");f.AddHandleXY("adj1","-2147483647","2147483647",undefined,"0","0","x1","y1");f.AddHandleXY(undefined,"0","0","adj2","-2147483647", "2147483647","x2","y2");f.AddHandleXY("adj3","-2147483647","2147483647",undefined,"0","0","x3","y3");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2,"x3","b");f.AddPathCommand(2,"r","b");break}case "bentUpArrow":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddGuide("a1",10,"0", "adj1","50000");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("a3",10,"0","adj3","50000");f.AddGuide("y1",0,"ss","a3","100000");f.AddGuide("dx1",0,"ss","a2","50000");f.AddGuide("x1",1,"r","0","dx1");f.AddGuide("dx3",0,"ss","a2","100000");f.AddGuide("x3",1,"r","0","dx3");f.AddGuide("dx2",0,"ss","a1","200000");f.AddGuide("x2",1,"x3","0","dx2");f.AddGuide("x4",1,"x3","dx2","0");f.AddGuide("dy2",0,"ss","a1","100000");f.AddGuide("y2",1,"b","0","dy2");f.AddGuide("x0",0,"x4","1","2");f.AddGuide("y3", 2,"y2","b","2");f.AddGuide("y15",2,"y1","b","2");f.AddHandleXY(undefined,"0","0","adj1","0","50000","l","y2");f.AddHandleXY("adj2","0","50000",undefined,"0","0","x1","t");f.AddHandleXY(undefined,"0","0","adj3","0","50000","x2","y1");f.AddCnx("_3cd4","x3","t");f.AddCnx("cd2","x1","y1");f.AddCnx("cd2","l","y3");f.AddCnx("cd4","x0","b");f.AddCnx("0","x4","y15");f.AddCnx("0","r","y1");f.AddRect("l","y2","x4","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1, "l","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"x3","t");f.AddPathCommand(2,"r","y1");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x4","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "bevel":{f.AddAdj("adj",15,"12500");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("x1",0,"ss","a","100000");f.AddGuide("x2",1,"r","0","x1");f.AddGuide("y2",1,"b","0","x1");f.AddHandleXY("adj","0","50000",undefined,"0","0","x1", "t");f.AddCnx("0","r","vc");f.AddCnx("0","x2","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","hc","y2");f.AddCnx("cd2","l","vc");f.AddCnx("cd2","x1","vc");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","hc","x1");f.AddRect("x1","x1","x2","y2");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"x1","x1");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(6);f.AddPathCommand(0,false,"lightenLess",false,undefined,undefined); f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(2,"x1","x1");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"r","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"lighten",false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","x1");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2, "l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"darken",false,undefined,undefined);f.AddPathCommand(1,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"x1","x1");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(2,"x2", "y2");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(6);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","x1");f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(1,"r","t");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(1,"r","b");f.AddPathCommand(2,"x2","y2");break}case "blockArc":{f.AddAdj("adj1",15,"10800000");f.AddAdj("adj2",15,"0");f.AddAdj("adj3",15,"25000");f.AddGuide("stAng",10,"0","adj1","21599999");f.AddGuide("istAng",10,"0","adj2","21599999");f.AddGuide("a3", 10,"0","adj3","50000");f.AddGuide("sw11",1,"istAng","0","stAng");f.AddGuide("sw12",1,"sw11","21600000","0");f.AddGuide("swAng",3,"sw11","sw11","sw12");f.AddGuide("iswAng",1,"0","0","swAng");f.AddGuide("wt1",12,"wd2","stAng");f.AddGuide("ht1",7,"hd2","stAng");f.AddGuide("wt3",12,"wd2","istAng");f.AddGuide("ht3",7,"hd2","istAng");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("dx3",6,"wd2","ht3","wt3");f.AddGuide("dy3",11,"hd2","ht3","wt3");f.AddGuide("x1",1, "hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("x3",1,"hc","dx3","0");f.AddGuide("y3",1,"vc","dy3","0");f.AddGuide("dr",0,"ss","a3","100000");f.AddGuide("iwd2",1,"wd2","0","dr");f.AddGuide("ihd2",1,"hd2","0","dr");f.AddGuide("wt2",12,"iwd2","istAng");f.AddGuide("ht2",7,"ihd2","istAng");f.AddGuide("wt4",12,"iwd2","stAng");f.AddGuide("ht4",7,"ihd2","stAng");f.AddGuide("dx2",6,"iwd2","ht2","wt2");f.AddGuide("dy2",11,"ihd2","ht2","wt2");f.AddGuide("dx4",6,"iwd2","ht4","wt4");f.AddGuide("dy4", 11,"ihd2","ht4","wt4");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddGuide("x4",1,"hc","dx4","0");f.AddGuide("y4",1,"vc","dy4","0");f.AddGuide("sw0",1,"21600000","0","stAng");f.AddGuide("da1",1,"swAng","0","sw0");f.AddGuide("g1",8,"x1","x2");f.AddGuide("g2",8,"x3","x4");f.AddGuide("g3",8,"g1","g2");f.AddGuide("ir",3,"da1","r","g3");f.AddGuide("sw1",1,"cd4","0","stAng");f.AddGuide("sw2",1,"27000000","0","stAng");f.AddGuide("sw3",3,"sw1","sw1","sw2");f.AddGuide("da2",1,"swAng", "0","sw3");f.AddGuide("g5",8,"y1","y2");f.AddGuide("g6",8,"y3","y4");f.AddGuide("g7",8,"g5","g6");f.AddGuide("ib",3,"da2","b","g7");f.AddGuide("sw4",1,"cd2","0","stAng");f.AddGuide("sw5",1,"32400000","0","stAng");f.AddGuide("sw6",3,"sw4","sw4","sw5");f.AddGuide("da3",1,"swAng","0","sw6");f.AddGuide("g9",16,"x1","x2");f.AddGuide("g10",16,"x3","x4");f.AddGuide("g11",16,"g9","g10");f.AddGuide("il",3,"da3","l","g11");f.AddGuide("sw7",1,"_3cd4","0","stAng");f.AddGuide("sw8",1,"37800000","0","stAng");f.AddGuide("sw9", 3,"sw7","sw7","sw8");f.AddGuide("da4",1,"swAng","0","sw9");f.AddGuide("g13",16,"y1","y2");f.AddGuide("g14",16,"y3","y4");f.AddGuide("g15",16,"g13","g14");f.AddGuide("it",3,"da4","t","g15");f.AddGuide("x5",2,"x1","x4","2");f.AddGuide("y5",2,"y1","y4","2");f.AddGuide("x6",2,"x3","x2","2");f.AddGuide("y6",2,"y3","y2","2");f.AddGuide("cang1",1,"stAng","0","cd4");f.AddGuide("cang2",1,"istAng","cd4","0");f.AddGuide("cang3",2,"cang1","cang2","2");f.AddHandlePolar("adj1","0","21599999",undefined,"0","0", "x1","y1");f.AddHandlePolar(undefined,"0","0","adj3","0","50000","x2","y2");f.AddCnx("cang1","x5","y5");f.AddCnx("cang2","x6","y6");f.AddCnx("cang3","hc","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","stAng","swAng");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(3,"iwd2","ihd2","istAng","iswAng");f.AddPathCommand(6);break}case "borderCallout1":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2", 15,"-8333");f.AddAdj("adj3",15,"112500");f.AddAdj("adj4",15,"-38333");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4", "hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");break}case "borderCallout2":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"18750");f.AddAdj("adj4",15,"-16667");f.AddAdj("adj5", 15,"112500");f.AddAdj("adj6",15,"-46667");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddGuide("y3",0,"h","adj5","100000");f.AddGuide("x3",0,"w","adj6","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddHandleXY("adj6","-2147483647","2147483647", "adj5","-2147483647","2147483647","x3","y3");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2, "x3","y3");break}case "borderCallout3":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"18750");f.AddAdj("adj4",15,"-16667");f.AddAdj("adj5",15,"100000");f.AddAdj("adj6",15,"-16667");f.AddAdj("adj7",15,"112963");f.AddAdj("adj8",15,"-8333");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddGuide("y3",0,"h","adj5","100000");f.AddGuide("x3",0,"w","adj6","100000"); f.AddGuide("y4",0,"h","adj7","100000");f.AddGuide("x4",0,"w","adj8","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddHandleXY("adj6","-2147483647","2147483647","adj5","-2147483647","2147483647","x3","y3");f.AddHandleXY("adj8","-2147483647","2147483647","adj7","-2147483647","2147483647","x4","y4");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2", "l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x4","y4");break}case "bracePair":{f.AddAdj("adj",15,"8333");f.AddGuide("a", 10,"0","adj","25000");f.AddGuide("x1",0,"ss","a","100000");f.AddGuide("x2",0,"ss","a","50000");f.AddGuide("x3",1,"r","0","x2");f.AddGuide("x4",1,"r","0","x1");f.AddGuide("y2",1,"vc","0","x1");f.AddGuide("y3",1,"vc","x1","0");f.AddGuide("y4",1,"b","0","x1");f.AddGuide("it",0,"x1","29289","100000");f.AddGuide("il",1,"x1","it","0");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","it");f.AddHandleXY(undefined,"0","0","adj","0","25000","l","x1");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l", "vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","il","ir","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"x2","b");f.AddPathCommand(3,"x1","x1","cd4","cd4");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(3,"x1","x1","0","-5400000");f.AddPathCommand(3,"x1","x1","cd4","-5400000");f.AddPathCommand(2,"x1","x1");f.AddPathCommand(3,"x1","x1","cd2","cd4");f.AddPathCommand(2,"x3","t");f.AddPathCommand(3,"x1","x1","_3cd4","cd4");f.AddPathCommand(2, "x4","y2");f.AddPathCommand(3,"x1","x1","cd2","-5400000");f.AddPathCommand(3,"x1","x1","_3cd4","-5400000");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(3,"x1","x1","0","cd4");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x2","b");f.AddPathCommand(3,"x1","x1","cd4","cd4");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(3,"x1","x1","0","-5400000");f.AddPathCommand(3,"x1","x1","cd4","-5400000");f.AddPathCommand(2,"x1","x1");f.AddPathCommand(3,"x1", "x1","cd2","cd4");f.AddPathCommand(1,"x3","t");f.AddPathCommand(3,"x1","x1","_3cd4","cd4");f.AddPathCommand(2,"x4","y2");f.AddPathCommand(3,"x1","x1","cd2","-5400000");f.AddPathCommand(3,"x1","x1","_3cd4","-5400000");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(3,"x1","x1","0","cd4");break}case "bracketPair":{f.AddAdj("adj",15,"16667");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("x1",0,"ss","a","100000");f.AddGuide("x2",1,"r","0","x1");f.AddGuide("y2",1,"b","0","x1");f.AddGuide("il",0,"x1", "29289","100000");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","il");f.AddHandleXY(undefined,"0","0","adj","0","50000","l","x1");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","il","ir","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","x1");f.AddPathCommand(3,"x1","x1","cd2","cd4");f.AddPathCommand(2,"x2","t");f.AddPathCommand(3,"x1","x1","_3cd4","cd4");f.AddPathCommand(2,"r", "y2");f.AddPathCommand(3,"x1","x1","0","cd4");f.AddPathCommand(2,"x1","b");f.AddPathCommand(3,"x1","x1","cd4","cd4");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","b");f.AddPathCommand(3,"x1","x1","cd4","cd4");f.AddPathCommand(2,"l","x1");f.AddPathCommand(3,"x1","x1","cd2","cd4");f.AddPathCommand(1,"x2","t");f.AddPathCommand(3,"x1","x1","_3cd4","cd4");f.AddPathCommand(2,"r","y2");f.AddPathCommand(3,"x1","x1","0","cd4");break}case "callout1":{f.AddAdj("adj1", 15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"112500");f.AddAdj("adj4",15,"-38333");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2", "l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");break}case "callout2":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"18750");f.AddAdj("adj4", 15,"-16667");f.AddAdj("adj5",15,"112500");f.AddAdj("adj6",15,"-46667");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddGuide("y3",0,"h","adj5","100000");f.AddGuide("x3",0,"w","adj6","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddHandleXY("adj6", "-2147483647","2147483647","adj5","-2147483647","2147483647","x3","y3");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2, "x2","y2");f.AddPathCommand(2,"x3","y3");break}case "callout3":{f.AddAdj("adj1",15,"18750");f.AddAdj("adj2",15,"-8333");f.AddAdj("adj3",15,"18750");f.AddAdj("adj4",15,"-16667");f.AddAdj("adj5",15,"100000");f.AddAdj("adj6",15,"-16667");f.AddAdj("adj7",15,"112963");f.AddAdj("adj8",15,"-8333");f.AddGuide("y1",0,"h","adj1","100000");f.AddGuide("x1",0,"w","adj2","100000");f.AddGuide("y2",0,"h","adj3","100000");f.AddGuide("x2",0,"w","adj4","100000");f.AddGuide("y3",0,"h","adj5","100000");f.AddGuide("x3", 0,"w","adj6","100000");f.AddGuide("y4",0,"h","adj7","100000");f.AddGuide("x4",0,"w","adj8","100000");f.AddHandleXY("adj2","-2147483647","2147483647","adj1","-2147483647","2147483647","x1","y1");f.AddHandleXY("adj4","-2147483647","2147483647","adj3","-2147483647","2147483647","x2","y2");f.AddHandleXY("adj6","-2147483647","2147483647","adj5","-2147483647","2147483647","x3","y3");f.AddHandleXY("adj8","-2147483647","2147483647","adj7","-2147483647","2147483647","x4","y4");f.AddCnx("0","r","vc");f.AddCnx("cd4", "hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x4","y4");break}case "can":{f.AddAdj("adj",15, "25000");f.AddGuide("maxAdj",0,"50000","h","ss");f.AddGuide("a",10,"0","adj","maxAdj");f.AddGuide("y1",0,"ss","a","200000");f.AddGuide("y2",1,"y1","y1","0");f.AddGuide("y3",1,"b","0","y1");f.AddHandleXY(undefined,"0","0","adj","0","maxAdj","hc","y2");f.AddCnx("_3cd4","hc","y2");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","y2","r","y3");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(3, "wd2","y1","cd2","-10800000");f.AddPathCommand(2,"r","y3");f.AddPathCommand(3,"wd2","y1","0","cd2");f.AddPathCommand(6);f.AddPathCommand(0,false,"lighten",false,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(3,"wd2","y1","cd2","cd2");f.AddPathCommand(3,"wd2","y1","0","cd2");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"r","y1");f.AddPathCommand(3,"wd2","y1","0","cd2");f.AddPathCommand(3,"wd2","y1","cd2","cd2");f.AddPathCommand(2, "r","y3");f.AddPathCommand(3,"wd2","y1","0","cd2");f.AddPathCommand(2,"l","y1");break}case "chartPlus":{f.AddPathCommand(0,false,"none",undefined,10,10);f.AddPathCommand(1,"5","0");f.AddPathCommand(2,"5","10");f.AddPathCommand(1,"0","5");f.AddPathCommand(2,"10","5");f.AddPathCommand(0,undefined,undefined,false,10,10);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"0","10");f.AddPathCommand(2,"10","10");f.AddPathCommand(2,"10","0");f.AddPathCommand(6);break}case "chartStar":{f.AddPathCommand(0,false, "none",undefined,10,10);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"10","10");f.AddPathCommand(1,"0","10");f.AddPathCommand(2,"10","0");f.AddPathCommand(1,"5","0");f.AddPathCommand(2,"5","10");f.AddPathCommand(0,undefined,undefined,false,10,10);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"0","10");f.AddPathCommand(2,"10","10");f.AddPathCommand(2,"10","0");f.AddPathCommand(6);break}case "chartX":{f.AddPathCommand(0,false,"none",undefined,10,10);f.AddPathCommand(1,"0","0");f.AddPathCommand(2, "10","10");f.AddPathCommand(1,"0","10");f.AddPathCommand(2,"10","0");f.AddPathCommand(0,undefined,undefined,false,10,10);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"0","10");f.AddPathCommand(2,"10","10");f.AddPathCommand(2,"10","0");f.AddPathCommand(6);break}case "chevron":{f.AddAdj("adj",15,"50000");f.AddGuide("maxAdj",0,"100000","w","ss");f.AddGuide("a",10,"0","adj","maxAdj");f.AddGuide("x1",0,"ss","a","100000");f.AddGuide("x2",1,"r","0","x1");f.AddGuide("x3",0,"x2","1","2");f.AddGuide("dx", 1,"x2","0","x1");f.AddGuide("il",3,"dx","x1","l");f.AddGuide("ir",3,"dx","x2","r");f.AddHandleXY("adj","0","maxAdj",undefined,"0","0","x2","t");f.AddCnx("_3cd4","x3","t");f.AddCnx("cd2","x1","vc");f.AddCnx("cd4","x3","b");f.AddCnx("0","r","vc");f.AddRect("il","t","ir","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(2, "x1","vc");f.AddPathCommand(6);break}case "chord":{f.AddAdj("adj1",15,"2700000");f.AddAdj("adj2",15,"16200000");f.AddGuide("stAng",10,"0","adj1","21599999");f.AddGuide("enAng",10,"0","adj2","21599999");f.AddGuide("sw1",1,"enAng","0","stAng");f.AddGuide("sw2",1,"sw1","21600000","0");f.AddGuide("swAng",3,"sw1","sw1","sw2");f.AddGuide("wt1",12,"wd2","stAng");f.AddGuide("ht1",7,"hd2","stAng");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("wt2",12,"wd2","enAng"); f.AddGuide("ht2",7,"hd2","enAng");f.AddGuide("dx2",6,"wd2","ht2","wt2");f.AddGuide("dy2",11,"hd2","ht2","wt2");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddGuide("x3",2,"x1","x2","2");f.AddGuide("y3",2,"y1","y2","2");f.AddGuide("midAng0",0,"swAng","1","2");f.AddGuide("midAng",1,"stAng","midAng0","cd2");f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx"); f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddHandlePolar("adj1","0","21599999",undefined,"0","0","x1","y1");f.AddHandlePolar("adj2","0","21599999",undefined,"0","0","x2","y2");f.AddCnx("stAng","x1","y1");f.AddCnx("enAng","x2","y2");f.AddCnx("midAng","x3","y3");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","stAng","swAng"); f.AddPathCommand(6);break}case "circularArrow":{f.AddAdj("adj1",15,"12500");f.AddAdj("adj2",15,"1142319");f.AddAdj("adj3",15,"20457681");f.AddAdj("adj4",15,"10800000");f.AddAdj("adj5",15,"12500");f.AddGuide("a5",10,"0","adj5","25000");f.AddGuide("maxAdj1",0,"a5","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("enAng",10,"1","adj3","21599999");f.AddGuide("stAng",10,"0","adj4","21599999");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("thh",0,"ss","a5","100000");f.AddGuide("th2",0,"th", "1","2");f.AddGuide("rw1",1,"wd2","th2","thh");f.AddGuide("rh1",1,"hd2","th2","thh");f.AddGuide("rw2",1,"rw1","0","th");f.AddGuide("rh2",1,"rh1","0","th");f.AddGuide("rw3",1,"rw2","th2","0");f.AddGuide("rh3",1,"rh2","th2","0");f.AddGuide("wtH",12,"rw3","enAng");f.AddGuide("htH",7,"rh3","enAng");f.AddGuide("dxH",6,"rw3","htH","wtH");f.AddGuide("dyH",11,"rh3","htH","wtH");f.AddGuide("xH",1,"hc","dxH","0");f.AddGuide("yH",1,"vc","dyH","0");f.AddGuide("rI",16,"rw2","rh2");f.AddGuide("u1",0,"dxH","dxH", "1");f.AddGuide("u2",0,"dyH","dyH","1");f.AddGuide("u3",0,"rI","rI","1");f.AddGuide("u4",1,"u1","0","u3");f.AddGuide("u5",1,"u2","0","u3");f.AddGuide("u6",0,"u4","u5","u1");f.AddGuide("u7",0,"u6","1","u2");f.AddGuide("u8",1,"1","0","u7");f.AddGuide("u9",13,"u8");f.AddGuide("u10",0,"u4","1","dxH");f.AddGuide("u11",0,"u10","1","dyH");f.AddGuide("u12",2,"1","u9","u11");f.AddGuide("u13",5,"1","u12");f.AddGuide("u14",1,"u13","21600000","0");f.AddGuide("u15",3,"u13","u13","u14");f.AddGuide("u16",1,"u15", "0","enAng");f.AddGuide("u17",1,"u16","21600000","0");f.AddGuide("u18",3,"u16","u16","u17");f.AddGuide("u19",1,"u18","0","cd2");f.AddGuide("u20",1,"u18","0","21600000");f.AddGuide("u21",3,"u19","u20","u18");f.AddGuide("maxAng",4,"u21");f.AddGuide("aAng",10,"0","adj2","maxAng");f.AddGuide("ptAng",1,"enAng","aAng","0");f.AddGuide("wtA",12,"rw3","ptAng");f.AddGuide("htA",7,"rh3","ptAng");f.AddGuide("dxA",6,"rw3","htA","wtA");f.AddGuide("dyA",11,"rh3","htA","wtA");f.AddGuide("xA",1,"hc","dxA","0");f.AddGuide("yA", 1,"vc","dyA","0");f.AddGuide("wtE",12,"rw1","stAng");f.AddGuide("htE",7,"rh1","stAng");f.AddGuide("dxE",6,"rw1","htE","wtE");f.AddGuide("dyE",11,"rh1","htE","wtE");f.AddGuide("xE",1,"hc","dxE","0");f.AddGuide("yE",1,"vc","dyE","0");f.AddGuide("dxG",7,"thh","ptAng");f.AddGuide("dyG",12,"thh","ptAng");f.AddGuide("xG",1,"xH","dxG","0");f.AddGuide("yG",1,"yH","dyG","0");f.AddGuide("dxB",7,"thh","ptAng");f.AddGuide("dyB",12,"thh","ptAng");f.AddGuide("xB",1,"xH","0","dxB","0");f.AddGuide("yB",1,"yH","0", "dyB","0");f.AddGuide("sx1",1,"xB","0","hc");f.AddGuide("sy1",1,"yB","0","vc");f.AddGuide("sx2",1,"xG","0","hc");f.AddGuide("sy2",1,"yG","0","vc");f.AddGuide("rO",16,"rw1","rh1");f.AddGuide("x1O",0,"sx1","rO","rw1");f.AddGuide("y1O",0,"sy1","rO","rh1");f.AddGuide("x2O",0,"sx2","rO","rw1");f.AddGuide("y2O",0,"sy2","rO","rh1");f.AddGuide("dxO",1,"x2O","0","x1O");f.AddGuide("dyO",1,"y2O","0","y1O");f.AddGuide("dO",9,"dxO","dyO","0");f.AddGuide("q1",0,"x1O","y2O","1");f.AddGuide("q2",0,"x2O","y1O","1"); f.AddGuide("DO",1,"q1","0","q2");f.AddGuide("q3",0,"rO","rO","1");f.AddGuide("q4",0,"dO","dO","1");f.AddGuide("q5",0,"q3","q4","1");f.AddGuide("q6",0,"DO","DO","1");f.AddGuide("q7",1,"q5","0","q6");f.AddGuide("q8",8,"q7","0");f.AddGuide("sdelO",13,"q8");f.AddGuide("ndyO",0,"dyO","-1","1");f.AddGuide("sdyO",3,"ndyO","-1","1");f.AddGuide("q9",0,"sdyO","dxO","1");f.AddGuide("q10",0,"q9","sdelO","1");f.AddGuide("q11",0,"DO","dyO","1");f.AddGuide("dxF1",2,"q11","q10","q4");f.AddGuide("q12",1,"q11","0", "q10");f.AddGuide("dxF2",0,"q12","1","q4");f.AddGuide("adyO",4,"dyO");f.AddGuide("q13",0,"adyO","sdelO","1");f.AddGuide("q14",0,"DO","dxO","-1");f.AddGuide("dyF1",2,"q14","q13","q4");f.AddGuide("q15",1,"q14","0","q13");f.AddGuide("dyF2",0,"q15","1","q4");f.AddGuide("q16",1,"x2O","0","dxF1");f.AddGuide("q17",1,"x2O","0","dxF2");f.AddGuide("q18",1,"y2O","0","dyF1");f.AddGuide("q19",1,"y2O","0","dyF2");f.AddGuide("q20",9,"q16","q18","0");f.AddGuide("q21",9,"q17","q19","0");f.AddGuide("q22",1,"q21","0", "q20");f.AddGuide("dxF",3,"q22","dxF1","dxF2");f.AddGuide("dyF",3,"q22","dyF1","dyF2");f.AddGuide("sdxF",0,"dxF","rw1","rO");f.AddGuide("sdyF",0,"dyF","rh1","rO");f.AddGuide("xF",1,"hc","sdxF","0");f.AddGuide("yF",1,"vc","sdyF","0");f.AddGuide("x1I",0,"sx1","rI","rw2");f.AddGuide("y1I",0,"sy1","rI","rh2");f.AddGuide("x2I",0,"sx2","rI","rw2");f.AddGuide("y2I",0,"sy2","rI","rh2");f.AddGuide("dxI",1,"x2I","0","x1I");f.AddGuide("dyI",1,"y2I","0","y1I");f.AddGuide("dI",9,"dxI","dyI","0");f.AddGuide("v1", 0,"x1I","y2I","1");f.AddGuide("v2",0,"x2I","y1I","1");f.AddGuide("DI",1,"v1","0","v2");f.AddGuide("v3",0,"rI","rI","1");f.AddGuide("v4",0,"dI","dI","1");f.AddGuide("v5",0,"v3","v4","1");f.AddGuide("v6",0,"DI","DI","1");f.AddGuide("v7",1,"v5","0","v6");f.AddGuide("v8",8,"v7","0");f.AddGuide("sdelI",13,"v8");f.AddGuide("v9",0,"sdyO","dxI","1");f.AddGuide("v10",0,"v9","sdelI","1");f.AddGuide("v11",0,"DI","dyI","1");f.AddGuide("dxC1",2,"v11","v10","v4");f.AddGuide("v12",1,"v11","0","v10");f.AddGuide("dxC2", 0,"v12","1","v4");f.AddGuide("adyI",4,"dyI");f.AddGuide("v13",0,"adyI","sdelI","1");f.AddGuide("v14",0,"DI","dxI","-1");f.AddGuide("dyC1",2,"v14","v13","v4");f.AddGuide("v15",1,"v14","0","v13");f.AddGuide("dyC2",0,"v15","1","v4");f.AddGuide("v16",1,"x1I","0","dxC1");f.AddGuide("v17",1,"x1I","0","dxC2");f.AddGuide("v18",1,"y1I","0","dyC1");f.AddGuide("v19",1,"y1I","0","dyC2");f.AddGuide("v20",9,"v16","v18","0");f.AddGuide("v21",9,"v17","v19","0");f.AddGuide("v22",1,"v21","0","v20");f.AddGuide("dxC", 3,"v22","dxC1","dxC2");f.AddGuide("dyC",3,"v22","dyC1","dyC2");f.AddGuide("sdxC",0,"dxC","rw2","rI");f.AddGuide("sdyC",0,"dyC","rh2","rI");f.AddGuide("xC",1,"hc","sdxC","0");f.AddGuide("yC",1,"vc","sdyC","0");f.AddGuide("ist0",5,"sdxC","sdyC");f.AddGuide("ist1",1,"ist0","21600000","0");f.AddGuide("istAng",3,"ist0","ist0","ist1");f.AddGuide("isw1",1,"stAng","0","istAng");f.AddGuide("isw2",1,"isw1","0","21600000");f.AddGuide("iswAng",3,"isw1","isw2","isw1");f.AddGuide("p1",1,"xF","0","xC");f.AddGuide("p2", 1,"yF","0","yC");f.AddGuide("p3",9,"p1","p2","0");f.AddGuide("p4",0,"p3","1","2");f.AddGuide("p5",1,"p4","0","thh");f.AddGuide("xGp",3,"p5","xF","xG");f.AddGuide("yGp",3,"p5","yF","yG");f.AddGuide("xBp",3,"p5","xC","xB");f.AddGuide("yBp",3,"p5","yC","yB");f.AddGuide("en0",5,"sdxF","sdyF");f.AddGuide("en1",1,"en0","21600000","0");f.AddGuide("en2",3,"en0","en0","en1");f.AddGuide("sw0",1,"en2","0","stAng");f.AddGuide("sw1",1,"sw0","21600000","0");f.AddGuide("swAng",3,"sw0","sw0","sw1");f.AddGuide("wtI", 12,"rw3","stAng");f.AddGuide("htI",7,"rh3","stAng");f.AddGuide("dxI",6,"rw3","htI","wtI");f.AddGuide("dyI",11,"rh3","htI","wtI");f.AddGuide("xI",1,"hc","dxI","0");f.AddGuide("yI",1,"vc","dyI","0");f.AddGuide("aI",1,"stAng","0","cd4");f.AddGuide("aA",1,"ptAng","cd4","0");f.AddGuide("aB",1,"ptAng","cd2","0");f.AddGuide("idx",7,"rw1","2700000");f.AddGuide("idy",12,"rh1","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1, "vc","idy","0");f.AddHandlePolar("adj2","0","maxAng",undefined,"0","0","xA","yA");f.AddHandlePolar("adj4","0","21599999",undefined,"0","0","xE","yE");f.AddHandlePolar(undefined,"0","0","adj1","0","maxAdj1","xF","yF");f.AddHandlePolar(undefined,"0","0","adj5","0","25000","xB","yB");f.AddCnx("aI","xI","yI");f.AddCnx("ptAng","xGp","yGp");f.AddCnx("aA","xA","yA");f.AddCnx("aB","xBp","yBp");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1, "xE","yE");f.AddPathCommand(3,"rw1","rh1","stAng","swAng");f.AddPathCommand(2,"xGp","yGp");f.AddPathCommand(2,"xA","yA");f.AddPathCommand(2,"xBp","yBp");f.AddPathCommand(2,"xC","yC");f.AddPathCommand(3,"rw2","rh2","istAng","iswAng");f.AddPathCommand(6);break}case "cloud":{f.AddGuide("il",0,"w","2977","21600");f.AddGuide("it",0,"h","3262","21600");f.AddGuide("ir",0,"w","17087","21600");f.AddGuide("ib",0,"h","17337","21600");f.AddGuide("g27",0,"w","67","21600");f.AddGuide("g28",0,"h","21577","21600"); f.AddGuide("g29",0,"w","21582","21600");f.AddGuide("g30",0,"h","1235","21600");f.AddCnx("0","g29","vc");f.AddCnx("cd4","hc","g28");f.AddCnx("cd2","g27","vc");f.AddCnx("_3cd4","hc","g30");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,43200,43200);f.AddPathCommand(1,"3900","14370");f.AddPathCommand(3,"6753","9190","-11429249","7426832");f.AddPathCommand(3,"5333","7267","-8646143","5396714");f.AddPathCommand(3,"4365","5945","-8748475","5983381");f.AddPathCommand(3,"4857", "6595","-7859164","7034504");f.AddPathCommand(3,"5333","7273","-4722533","6541615");f.AddPathCommand(3,"6775","9220","-2776035","7816140");f.AddPathCommand(3,"5785","7867","37501","6842000");f.AddPathCommand(3,"6752","9215","1347096","6910353");f.AddPathCommand(3,"7720","10543","3974558","4542661");f.AddPathCommand(3,"4360","5918","-16496525","8804134");f.AddPathCommand(3,"4345","5945","-14809710","9151131");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,43200,43200);f.AddPathCommand(1, "4693","26177");f.AddPathCommand(3,"4345","5945","5204520","1585770");f.AddPathCommand(1,"6928","34899");f.AddPathCommand(3,"4360","5918","4416628","686848");f.AddPathCommand(1,"16478","39090");f.AddPathCommand(3,"6752","9215","8257449","844866");f.AddPathCommand(1,"28827","34751");f.AddPathCommand(3,"6752","9215","387196","959901");f.AddPathCommand(1,"34129","22954");f.AddPathCommand(3,"5785","7867","-4217541","4255042");f.AddPathCommand(1,"41798","15354");f.AddPathCommand(3,"5333","7273","1819082", "1665090");f.AddPathCommand(1,"38324","5426");f.AddPathCommand(3,"4857","6595","-824660","891534");f.AddPathCommand(1,"29078","3952");f.AddPathCommand(3,"4857","6595","-8950887","1091722");f.AddPathCommand(1,"22141","4720");f.AddPathCommand(3,"4365","5945","-9809656","1061181");f.AddPathCommand(1,"14000","5192");f.AddPathCommand(3,"6753","9190","-4002417","739161");f.AddPathCommand(1,"4127","15789");f.AddPathCommand(3,"6753","9190","9459261","711490");f.AddPathCommand(6);break}case "cloudCallout":{f.AddAdj("adj1", 15,"-20833");f.AddAdj("adj2",15,"62500");f.AddGuide("dxPos",0,"w","adj1","100000");f.AddGuide("dyPos",0,"h","adj2","100000");f.AddGuide("xPos",1,"hc","dxPos","0");f.AddGuide("yPos",1,"vc","dyPos","0");f.AddGuide("ht",6,"hd2","dxPos","dyPos");f.AddGuide("wt",11,"wd2","dxPos","dyPos");f.AddGuide("g2",6,"wd2","ht","wt");f.AddGuide("g3",11,"hd2","ht","wt");f.AddGuide("g4",1,"hc","g2","0");f.AddGuide("g5",1,"vc","g3","0");f.AddGuide("g6",1,"g4","0","xPos");f.AddGuide("g7",1,"g5","0","yPos");f.AddGuide("g8", 9,"g6","g7","0");f.AddGuide("g9",0,"ss","6600","21600");f.AddGuide("g10",1,"g8","0","g9");f.AddGuide("g11",0,"g10","1","3");f.AddGuide("g12",0,"ss","1800","21600");f.AddGuide("g13",1,"g11","g12","0");f.AddGuide("g14",0,"g13","g6","g8");f.AddGuide("g15",0,"g13","g7","g8");f.AddGuide("g16",1,"g14","xPos","0");f.AddGuide("g17",1,"g15","yPos","0");f.AddGuide("g18",0,"ss","4800","21600");f.AddGuide("g19",0,"g11","2","1");f.AddGuide("g20",1,"g18","g19","0");f.AddGuide("g21",0,"g20","g6","g8");f.AddGuide("g22", 0,"g20","g7","g8");f.AddGuide("g23",1,"g21","xPos","0");f.AddGuide("g24",1,"g22","yPos","0");f.AddGuide("g25",0,"ss","1200","21600");f.AddGuide("g26",0,"ss","600","21600");f.AddGuide("x23",1,"xPos","g26","0");f.AddGuide("x24",1,"g16","g25","0");f.AddGuide("x25",1,"g23","g12","0");f.AddGuide("il",0,"w","2977","21600");f.AddGuide("it",0,"h","3262","21600");f.AddGuide("ir",0,"w","17087","21600");f.AddGuide("ib",0,"h","17337","21600");f.AddGuide("g27",0,"w","67","21600");f.AddGuide("g28",0,"h","21577", "21600");f.AddGuide("g29",0,"w","21582","21600");f.AddGuide("g30",0,"h","1235","21600");f.AddGuide("pang",5,"dxPos","dyPos");f.AddHandleXY("adj1","-2147483647","2147483647","adj2","-2147483647","2147483647","xPos","yPos");f.AddCnx("cd2","g27","vc");f.AddCnx("cd4","hc","g28");f.AddCnx("0","g29","vc");f.AddCnx("_3cd4","hc","g30");f.AddCnx("pang","xPos","yPos");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,43200,43200);f.AddPathCommand(1,"3900","14370");f.AddPathCommand(3, "6753","9190","-11429249","7426832");f.AddPathCommand(3,"5333","7267","-8646143","5396714");f.AddPathCommand(3,"4365","5945","-8748475","5983381");f.AddPathCommand(3,"4857","6595","-7859164","7034504");f.AddPathCommand(3,"5333","7273","-4722533","6541615");f.AddPathCommand(3,"6775","9220","-2776035","7816140");f.AddPathCommand(3,"5785","7867","37501","6842000");f.AddPathCommand(3,"6752","9215","1347096","6910353");f.AddPathCommand(3,"7720","10543","3974558","4542661");f.AddPathCommand(3,"4360","5918", "-16496525","8804134");f.AddPathCommand(3,"4345","5945","-14809710","9151131");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x23","yPos");f.AddPathCommand(3,"g26","g26","0","21600000");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x24","g17");f.AddPathCommand(3,"g25","g25","0","21600000");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined); f.AddPathCommand(1,"x25","g24");f.AddPathCommand(3,"g12","g12","0","21600000");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,43200,43200);f.AddPathCommand(1,"4693","26177");f.AddPathCommand(3,"4345","5945","5204520","1585770");f.AddPathCommand(1,"6928","34899");f.AddPathCommand(3,"4360","5918","4416628","686848");f.AddPathCommand(1,"16478","39090");f.AddPathCommand(3,"6752","9215","8257449","844866");f.AddPathCommand(1,"28827","34751");f.AddPathCommand(3,"6752","9215","387196","959901"); f.AddPathCommand(1,"34129","22954");f.AddPathCommand(3,"5785","7867","-4217541","4255042");f.AddPathCommand(1,"41798","15354");f.AddPathCommand(3,"5333","7273","1819082","1665090");f.AddPathCommand(1,"38324","5426");f.AddPathCommand(3,"4857","6595","-824660","891534");f.AddPathCommand(1,"29078","3952");f.AddPathCommand(3,"4857","6595","-8950887","1091722");f.AddPathCommand(1,"22141","4720");f.AddPathCommand(3,"4365","5945","-9809656","1061181");f.AddPathCommand(1,"14000","5192");f.AddPathCommand(3, "6753","9190","-4002417","739161");f.AddPathCommand(1,"4127","15789");f.AddPathCommand(3,"6753","9190","9459261","711490");f.AddPathCommand(6);break}case "corner":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj1",0,"100000","h","ss");f.AddGuide("maxAdj2",0,"100000","w","ss");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("x1",0,"ss","a2","100000");f.AddGuide("dy1",0,"ss","a1","100000");f.AddGuide("y1",1,"b","0","dy1");f.AddGuide("cx1", 0,"x1","1","2");f.AddGuide("cy1",2,"y1","b","2");f.AddGuide("d",1,"w","0","h");f.AddGuide("it",3,"d","y1","t");f.AddGuide("ir",3,"d","r","x1");f.AddHandleXY(undefined,"0","0","adj1","0","maxAdj1","l","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x1","t");f.AddCnx("0","r","cy1");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","cx1","t");f.AddRect("l","it","ir","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2, "x1","t");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"r","y1");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "cornerTabs":{f.AddGuide("md",9,"w","h","0");f.AddGuide("dx",0,"1","md","20");f.AddGuide("y1",1,"0","b","dx");f.AddGuide("x1",1,"0","r","dx");f.AddCnx("cd2","l","t");f.AddCnx("cd2","l","dx");f.AddCnx("cd2","l","y1");f.AddCnx("cd2","l","b");f.AddCnx("_3cd4","dx","t");f.AddCnx("_3cd4","x1","t");f.AddCnx("cd4","dx","b");f.AddCnx("cd4","x1","b");f.AddCnx("0", "r","t");f.AddCnx("0","r","dx");f.AddCnx("0","r","y1");f.AddCnx("0","r","b");f.AddRect("dx","dx","x1","y1");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"dx","t");f.AddPathCommand(2,"l","dx");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"dx","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined, undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","dx");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"r","y1");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"x1","b");f.AddPathCommand(6);break}case "cube":{f.AddAdj("adj",15,"25000");f.AddGuide("a",10,"0","adj","100000");f.AddGuide("y1",0,"ss","a","100000");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("y2",0,"y4","1","2");f.AddGuide("y3", 2,"y1","b","2");f.AddGuide("x4",1,"r","0","y1");f.AddGuide("x2",0,"x4","1","2");f.AddGuide("x3",2,"y1","r","2");f.AddHandleXY(undefined,"0","0","adj","0","100000","l","y1");f.AddCnx("_3cd4","x3","t");f.AddCnx("_3cd4","x2","y1");f.AddCnx("cd2","l","y3");f.AddCnx("cd4","x2","b");f.AddCnx("0","x4","y3");f.AddCnx("0","r","y2");f.AddRect("l","y1","x4","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x4","b"); f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"x4","y1");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","y4");f.AddPathCommand(2,"x4","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"lightenLess",false,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"y1","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined, undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"y1","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","y4");f.AddPathCommand(2,"x4","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"r","t");f.AddPathCommand(1,"x4","y1");f.AddPathCommand(2,"x4","b");break}case "curvedConnector2":{f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t"); f.AddPathCommand(5,"wd2","t","r","hd2","r","b");break}case "curvedConnector3":{f.AddAdj("adj1",15,"50000");f.AddGuide("x2",0,"w","adj1","100000");f.AddGuide("x1",2,"l","x2","2");f.AddGuide("x3",2,"r","x2","2");f.AddGuide("y3",0,"h","3","4");f.AddHandleXY("adj1","-2147483647","2147483647",undefined,"0","0","x2","vc");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(5,"x1","t","x2","hd4","x2","vc");f.AddPathCommand(5, "x2","y3","x3","b","r","b");break}case "curvedConnector4":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("x2",0,"w","adj1","100000");f.AddGuide("x1",2,"l","x2","2");f.AddGuide("x3",2,"r","x2","2");f.AddGuide("x4",2,"x2","x3","2");f.AddGuide("x5",2,"x3","r","2");f.AddGuide("y4",0,"h","adj2","100000");f.AddGuide("y1",2,"t","y4","2");f.AddGuide("y2",2,"t","y1","2");f.AddGuide("y3",2,"y1","y4","2");f.AddGuide("y5",2,"b","y4","2");f.AddHandleXY("adj1","-2147483647","2147483647",undefined, "0","0","x2","y1");f.AddHandleXY(undefined,"0","0","adj2","-2147483647","2147483647","x3","y4");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(5,"x1","t","x2","y2","x2","y1");f.AddPathCommand(5,"x2","y3","x4","y4","x3","y4");f.AddPathCommand(5,"x5","y4","r","y5","r","b");break}case "curvedConnector5":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"50000");f.AddGuide("x3",0,"w", "adj1","100000");f.AddGuide("x6",0,"w","adj3","100000");f.AddGuide("x1",2,"x3","x6","2");f.AddGuide("x2",2,"l","x3","2");f.AddGuide("x4",2,"x3","x1","2");f.AddGuide("x5",2,"x6","x1","2");f.AddGuide("x7",2,"x6","r","2");f.AddGuide("y4",0,"h","adj2","100000");f.AddGuide("y1",2,"t","y4","2");f.AddGuide("y2",2,"t","y1","2");f.AddGuide("y3",2,"y1","y4","2");f.AddGuide("y5",2,"b","y4","2");f.AddGuide("y6",2,"y5","y4","2");f.AddGuide("y7",2,"y5","b","2");f.AddHandleXY("adj1","-2147483647","2147483647",undefined, "0","0","x3","y1");f.AddHandleXY(undefined,"0","0","adj2","-2147483647","2147483647","x1","y4");f.AddHandleXY("adj3","-2147483647","2147483647",undefined,"0","0","x6","y5");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(5,"x2","t","x3","y2","x3","y1");f.AddPathCommand(5,"x3","y3","x4","y4","x1","y4");f.AddPathCommand(5,"x5","y4","x6","y6","x6","y5");f.AddPathCommand(5,"x6","y7","x7","b","r","b");break}case "curvedDownArrow":{f.AddAdj("adj1", 15,"25000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"25000");f.AddGuide("maxAdj2",0,"50000","w","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("aw",0,"ss","a2","100000");f.AddGuide("q1",2,"th","aw","4");f.AddGuide("wR",1,"wd2","0","q1");f.AddGuide("q7",0,"wR","2","1");f.AddGuide("q8",0,"q7","q7","1");f.AddGuide("q9",0,"th","th","1");f.AddGuide("q10",1,"q8","0","q9");f.AddGuide("q11",13,"q10");f.AddGuide("idy", 0,"q11","h","q7");f.AddGuide("maxAdj3",0,"100000","idy","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("ah",0,"ss","adj3","100000");f.AddGuide("x3",1,"wR","th","0");f.AddGuide("q2",0,"h","h","1");f.AddGuide("q3",0,"ah","ah","1");f.AddGuide("q4",1,"q2","0","q3");f.AddGuide("q5",13,"q4");f.AddGuide("dx",0,"q5","wR","h");f.AddGuide("x5",1,"wR","dx","0");f.AddGuide("x7",1,"x3","dx","0");f.AddGuide("q6",1,"aw","0","th");f.AddGuide("dh",0,"q6","1","2");f.AddGuide("x4",1,"x5","0","dh");f.AddGuide("x8", 1,"x7","dh","0");f.AddGuide("aw2",0,"aw","1","2");f.AddGuide("x6",1,"r","0","aw2");f.AddGuide("y1",1,"b","0","ah");f.AddGuide("swAng",5,"ah","dx");f.AddGuide("mswAng",1,"0","0","swAng");f.AddGuide("iy",1,"b","0","idy");f.AddGuide("ix",2,"wR","x3","2");f.AddGuide("q12",0,"th","1","2");f.AddGuide("dang2",5,"idy","q12");f.AddGuide("stAng",1,"_3cd4","swAng","0");f.AddGuide("stAng2",1,"_3cd4","0","dang2");f.AddGuide("swAng2",1,"dang2","0","cd4");f.AddGuide("swAng3",1,"cd4","dang2","0");f.AddHandleXY("adj1", "0","adj2",undefined,"0","0","x7","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x4","b");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","y1");f.AddCnx("_3cd4","ix","t");f.AddCnx("cd4","q12","b");f.AddCnx("cd4","x4","y1");f.AddCnx("cd4","x6","b");f.AddCnx("0","x8","y1");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"x6","b");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x5","y1");f.AddPathCommand(3,"wR","h","stAng", "mswAng");f.AddPathCommand(2,"x3","t");f.AddPathCommand(3,"wR","h","_3cd4","swAng");f.AddPathCommand(2,"x8","y1");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"ix","iy");f.AddPathCommand(3,"wR","h","stAng2","swAng2");f.AddPathCommand(2,"l","b");f.AddPathCommand(3,"wR","h","cd2","swAng3");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"ix","iy");f.AddPathCommand(3,"wR","h","stAng2","swAng2"); f.AddPathCommand(2,"l","b");f.AddPathCommand(3,"wR","h","cd2","cd4");f.AddPathCommand(2,"x3","t");f.AddPathCommand(3,"wR","h","_3cd4","swAng");f.AddPathCommand(2,"x8","y1");f.AddPathCommand(2,"x6","b");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x5","y1");f.AddPathCommand(3,"wR","h","stAng","mswAng");break}case "curvedLeftArrow":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"25000");f.AddGuide("maxAdj2",0,"50000","h","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2"); f.AddGuide("a1",10,"0","adj1","a2");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("aw",0,"ss","a2","100000");f.AddGuide("q1",2,"th","aw","4");f.AddGuide("hR",1,"hd2","0","q1");f.AddGuide("q7",0,"hR","2","1");f.AddGuide("q8",0,"q7","q7","1");f.AddGuide("q9",0,"th","th","1");f.AddGuide("q10",1,"q8","0","q9");f.AddGuide("q11",13,"q10");f.AddGuide("idx",0,"q11","w","q7");f.AddGuide("maxAdj3",0,"100000","idx","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("ah",0,"ss","a3","100000");f.AddGuide("y3", 1,"hR","th","0");f.AddGuide("q2",0,"w","w","1");f.AddGuide("q3",0,"ah","ah","1");f.AddGuide("q4",1,"q2","0","q3");f.AddGuide("q5",13,"q4");f.AddGuide("dy",0,"q5","hR","w");f.AddGuide("y5",1,"hR","dy","0");f.AddGuide("y7",1,"y3","dy","0");f.AddGuide("q6",1,"aw","0","th");f.AddGuide("dh",0,"q6","1","2");f.AddGuide("y4",1,"y5","0","dh");f.AddGuide("y8",1,"y7","dh","0");f.AddGuide("aw2",0,"aw","1","2");f.AddGuide("y6",1,"b","0","aw2");f.AddGuide("x1",1,"l","ah","0");f.AddGuide("swAng",5,"ah","dy");f.AddGuide("mswAng", 1,"0","0","swAng");f.AddGuide("ix",1,"l","idx","0");f.AddGuide("iy",2,"hR","y3","2");f.AddGuide("q12",0,"th","1","2");f.AddGuide("dang2",5,"idx","q12");f.AddGuide("swAng2",1,"dang2","0","swAng");f.AddGuide("swAng3",1,"swAng","dang2","0");f.AddGuide("stAng3",1,"0","0","dang2");f.AddHandleXY(undefined,"0","0","adj1","0","a2","x1","y5");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","r","y4");f.AddHandleXY("adj3","0","maxAdj3",undefined,"0","0","x1","b");f.AddCnx("cd2","l","q12");f.AddCnx("cd2", "x1","y4");f.AddCnx("cd3","l","y6");f.AddCnx("cd4","x1","y8");f.AddCnx("0","r","iy");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","y6");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"x1","y5");f.AddPathCommand(3,"w","hR","swAng","swAng2");f.AddPathCommand(3,"w","hR","stAng3","swAng3");f.AddPathCommand(2,"x1","y8");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"r","y3");f.AddPathCommand(3, "w","hR","0","-5400000");f.AddPathCommand(2,"l","t");f.AddPathCommand(3,"w","hR","_3cd4","cd4");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"r","y3");f.AddPathCommand(3,"w","hR","0","-5400000");f.AddPathCommand(2,"l","t");f.AddPathCommand(3,"w","hR","_3cd4","cd4");f.AddPathCommand(2,"r","y3");f.AddPathCommand(3,"w","hR","0","swAng");f.AddPathCommand(2,"x1","y8");f.AddPathCommand(2,"l","y6");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2, "x1","y5");f.AddPathCommand(3,"w","hR","swAng","swAng2");break}case "curvedRightArrow":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"25000");f.AddGuide("maxAdj2",0,"50000","h","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("a1",10,"0","adj1","a2");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("aw",0,"ss","a2","100000");f.AddGuide("q1",2,"th","aw","4");f.AddGuide("hR",1,"hd2","0","q1");f.AddGuide("q7",0,"hR","2","1");f.AddGuide("q8",0,"q7","q7","1");f.AddGuide("q9", 0,"th","th","1");f.AddGuide("q10",1,"q8","0","q9");f.AddGuide("q11",13,"q10");f.AddGuide("idx",0,"q11","w","q7");f.AddGuide("maxAdj3",0,"100000","idx","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("ah",0,"ss","a3","100000");f.AddGuide("y3",1,"hR","th","0");f.AddGuide("q2",0,"w","w","1");f.AddGuide("q3",0,"ah","ah","1");f.AddGuide("q4",1,"q2","0","q3");f.AddGuide("q5",13,"q4");f.AddGuide("dy",0,"q5","hR","w");f.AddGuide("y5",1,"hR","dy","0");f.AddGuide("y7",1,"y3","dy","0");f.AddGuide("q6", 1,"aw","0","th");f.AddGuide("dh",0,"q6","1","2");f.AddGuide("y4",1,"y5","0","dh");f.AddGuide("y8",1,"y7","dh","0");f.AddGuide("aw2",0,"aw","1","2");f.AddGuide("y6",1,"b","0","aw2");f.AddGuide("x1",1,"r","0","ah");f.AddGuide("swAng",5,"ah","dy");f.AddGuide("stAng",1,"cd2","0","swAng");f.AddGuide("mswAng",1,"0","0","swAng");f.AddGuide("ix",1,"r","0","idx");f.AddGuide("iy",2,"hR","y3","2");f.AddGuide("q12",0,"th","1","2");f.AddGuide("dang2",5,"idx","q12");f.AddGuide("swAng2",1,"dang2","0","cd4");f.AddGuide("swAng3", 1,"cd4","dang2","0");f.AddGuide("stAng3",1,"cd2","0","dang2");f.AddHandleXY(undefined,"0","0","adj1","0","a2","x1","y5");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","r","y4");f.AddHandleXY("adj3","0","maxAdj3",undefined,"0","0","x1","b");f.AddCnx("cd2","l","iy");f.AddCnx("cd4","x1","y8");f.AddCnx("0","r","y6");f.AddCnx("0","x1","y4");f.AddCnx("0","r","q12");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","hR");f.AddPathCommand(3, "w","hR","cd2","mswAng");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"r","y6");f.AddPathCommand(2,"x1","y8");f.AddPathCommand(2,"x1","y7");f.AddPathCommand(3,"w","hR","stAng","swAng");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"r","th");f.AddPathCommand(3,"w","hR","_3cd4","swAng2");f.AddPathCommand(3,"w","hR","stAng3","swAng3");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l", "hR");f.AddPathCommand(3,"w","hR","cd2","mswAng");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"r","y6");f.AddPathCommand(2,"x1","y8");f.AddPathCommand(2,"x1","y7");f.AddPathCommand(3,"w","hR","stAng","swAng");f.AddPathCommand(2,"l","hR");f.AddPathCommand(3,"w","hR","cd2","cd4");f.AddPathCommand(2,"r","th");f.AddPathCommand(3,"w","hR","_3cd4","swAng2");break}case "curvedUpArrow":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"25000");f.AddGuide("maxAdj2",0,"50000", "w","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("aw",0,"ss","a2","100000");f.AddGuide("q1",2,"th","aw","4");f.AddGuide("wR",1,"wd2","0","q1");f.AddGuide("q7",0,"wR","2","1");f.AddGuide("q8",0,"q7","q7","1");f.AddGuide("q9",0,"th","th","1");f.AddGuide("q10",1,"q8","0","q9");f.AddGuide("q11",13,"q10");f.AddGuide("idy",0,"q11","h","q7");f.AddGuide("maxAdj3",0,"100000","idy","ss");f.AddGuide("a3",10,"0","adj3", "maxAdj3");f.AddGuide("ah",0,"ss","adj3","100000");f.AddGuide("x3",1,"wR","th","0");f.AddGuide("q2",0,"h","h","1");f.AddGuide("q3",0,"ah","ah","1");f.AddGuide("q4",1,"q2","0","q3");f.AddGuide("q5",13,"q4");f.AddGuide("dx",0,"q5","wR","h");f.AddGuide("x5",1,"wR","dx","0");f.AddGuide("x7",1,"x3","dx","0");f.AddGuide("q6",1,"aw","0","th");f.AddGuide("dh",0,"q6","1","2");f.AddGuide("x4",1,"x5","0","dh");f.AddGuide("x8",1,"x7","dh","0");f.AddGuide("aw2",0,"aw","1","2");f.AddGuide("x6",1,"r","0","aw2"); f.AddGuide("y1",1,"t","ah","0");f.AddGuide("swAng",5,"ah","dx");f.AddGuide("mswAng",1,"0","0","swAng");f.AddGuide("iy",1,"t","idy","0");f.AddGuide("ix",2,"wR","x3","2");f.AddGuide("q12",0,"th","1","2");f.AddGuide("dang2",5,"idy","q12");f.AddGuide("swAng2",1,"dang2","0","swAng");f.AddGuide("mswAng2",1,"0","0","swAng2");f.AddGuide("stAng3",1,"cd4","0","swAng");f.AddGuide("swAng3",1,"swAng","dang2","0");f.AddGuide("stAng2",1,"cd4","0","dang2");f.AddHandleXY("adj1","0","a2",undefined,"0","0","x7","y1"); f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x4","t");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","y1");f.AddCnx("_3cd4","x6","t");f.AddCnx("_3cd4","x4","y1");f.AddCnx("_3cd4","q12","t");f.AddCnx("cd4","ix","b");f.AddCnx("0","x8","y1");f.AddRect("l","t","r","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"x6","t");f.AddPathCommand(2,"x8","y1");f.AddPathCommand(2,"x7","y1");f.AddPathCommand(3,"wR","h","stAng3","swAng3");f.AddPathCommand(3, "wR","h","stAng2","swAng2");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"wR","b");f.AddPathCommand(3,"wR","h","cd4","cd4");f.AddPathCommand(2,"th","t");f.AddPathCommand(3,"wR","h","cd2","-5400000");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"ix","iy");f.AddPathCommand(3,"wR","h","stAng2","swAng2");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x6", "t");f.AddPathCommand(2,"x8","y1");f.AddPathCommand(2,"x7","y1");f.AddPathCommand(3,"wR","h","stAng3","swAng");f.AddPathCommand(2,"wR","b");f.AddPathCommand(3,"wR","h","cd4","cd4");f.AddPathCommand(2,"th","t");f.AddPathCommand(3,"wR","h","cd2","-5400000");break}case "decagon":{f.AddAdj("vf",15,"105146");f.AddGuide("shd2",0,"hd2","vf","100000");f.AddGuide("dx1",7,"wd2","2160000");f.AddGuide("dx2",7,"wd2","4320000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3", 1,"hc","dx2","0");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("dy1",12,"shd2","4320000");f.AddGuide("dy2",12,"shd2","2160000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","dy2","0");f.AddGuide("y4",1,"vc","dy1","0");f.AddCnx("0","x4","y2");f.AddCnx("0","r","vc");f.AddCnx("0","x4","y3");f.AddCnx("cd4","x3","y4");f.AddCnx("cd4","x2","y4");f.AddCnx("cd2","x1","y3");f.AddCnx("cd2","l","vc");f.AddCnx("cd2","x1","y2");f.AddCnx("_3cd4","x2","y1");f.AddCnx("_3cd4", "x3","y1");f.AddRect("x1","y2","x4","y3");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"x4","y2");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(6);break}case "diagStripe":{f.AddAdj("adj",15,"50000");f.AddGuide("a",10,"0", "adj","100000");f.AddGuide("x2",0,"w","a","100000");f.AddGuide("x1",0,"x2","1","2");f.AddGuide("x3",2,"x2","r","2");f.AddGuide("y2",0,"h","a","100000");f.AddGuide("y1",0,"y2","1","2");f.AddGuide("y3",2,"y2","b","2");f.AddHandleXY(undefined,"0","0","adj","0","100000","l","y2");f.AddCnx("0","hc","vc");f.AddCnx("cd2","l","y3");f.AddCnx("cd2","x1","y1");f.AddCnx("_3cd4","x3","t");f.AddRect("l","t","x3","y3");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l", "y2");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "diamond":{f.AddGuide("ir",0,"w","3","4");f.AddGuide("ib",0,"h","3","4");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("wd4","hd4","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2, "hc","b");f.AddPathCommand(6);break}case "dodecagon":{f.AddGuide("x1",0,"w","2894","21600");f.AddGuide("x2",0,"w","7906","21600");f.AddGuide("x3",0,"w","13694","21600");f.AddGuide("x4",0,"w","18706","21600");f.AddGuide("y1",0,"h","2894","21600");f.AddGuide("y2",0,"h","7906","21600");f.AddGuide("y3",0,"h","13694","21600");f.AddGuide("y4",0,"h","18706","21600");f.AddCnx("0","x4","y1");f.AddCnx("0","r","y2");f.AddCnx("0","r","y3");f.AddCnx("0","x4","y4");f.AddCnx("cd4","x3","b");f.AddCnx("cd4","x2", "b");f.AddCnx("cd2","x1","y4");f.AddCnx("cd2","l","y3");f.AddCnx("cd2","l","y2");f.AddCnx("cd2","x1","y1");f.AddCnx("_3cd4","x2","t");f.AddCnx("_3cd4","x3","t");f.AddRect("x1","y1","x4","y4");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"x3","t");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"r","y3");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(2, "x3","b");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"l","y3");f.AddPathCommand(6);break}case "donut":{f.AddAdj("adj",15,"25000");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dr",0,"ss","a","100000");f.AddGuide("iwd2",1,"wd2","0","dr");f.AddGuide("ihd2",1,"hd2","0","dr");f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib", 1,"vc","idy","0");f.AddHandlePolar(undefined,"0","0","adj","0","50000","dr","vc");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","il","it");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","il","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","ir","ib");f.AddCnx("0","r","vc");f.AddCnx("_3cd4","ir","it");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4", "cd4");f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2","hd2","cd4","cd4");f.AddPathCommand(6);f.AddPathCommand(1,"dr","vc");f.AddPathCommand(3,"iwd2","ihd2","cd2","-5400000");f.AddPathCommand(3,"iwd2","ihd2","cd4","-5400000");f.AddPathCommand(3,"iwd2","ihd2","0","-5400000");f.AddPathCommand(3,"iwd2","ihd2","_3cd4","-5400000");f.AddPathCommand(6);break}case "doubleWave":{f.AddAdj("adj1",15,"6250");f.AddAdj("adj2",15,"0");f.AddGuide("a1",10,"0","adj1","12500");f.AddGuide("a2",10, "-10000","adj2","10000");f.AddGuide("y1",0,"h","a1","100000");f.AddGuide("dy2",0,"y1","10","3");f.AddGuide("y2",1,"y1","0","dy2");f.AddGuide("y3",1,"y1","dy2","0");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("y5",1,"y4","0","dy2");f.AddGuide("y6",1,"y4","dy2","0");f.AddGuide("dx1",0,"w","a2","100000");f.AddGuide("of2",0,"w","a2","50000");f.AddGuide("x1",4,"dx1");f.AddGuide("dx2",3,"of2","0","of2");f.AddGuide("x2",1,"l","0","dx2");f.AddGuide("dx8",3,"of2","of2","0");f.AddGuide("x8",1,"r","0","dx8"); f.AddGuide("dx3",2,"dx2","x8","6");f.AddGuide("x3",1,"x2","dx3","0");f.AddGuide("dx4",2,"dx2","x8","3");f.AddGuide("x4",1,"x2","dx4","0");f.AddGuide("x5",2,"x2","x8","2");f.AddGuide("x6",1,"x5","dx3","0");f.AddGuide("x7",2,"x6","x8","2");f.AddGuide("x9",1,"l","dx8","0");f.AddGuide("x15",1,"r","dx2","0");f.AddGuide("x10",1,"x9","dx3","0");f.AddGuide("x11",1,"x9","dx4","0");f.AddGuide("x12",2,"x9","x15","2");f.AddGuide("x13",1,"x12","dx3","0");f.AddGuide("x14",2,"x13","x15","2");f.AddGuide("x16",1, "r","0","x1");f.AddGuide("xAdj",1,"hc","dx1","0");f.AddGuide("il",8,"x2","x9");f.AddGuide("ir",16,"x8","x15");f.AddGuide("it",0,"h","a1","50000");f.AddGuide("ib",1,"b","0","it");f.AddHandleXY(undefined,"0","0","adj1","0","12500","l","y1");f.AddHandleXY("adj2","-10000","10000",undefined,"0","0","xAdj","b");f.AddCnx("cd4","x12","y1");f.AddCnx("cd2","x1","vc");f.AddCnx("_3cd4","x5","y4");f.AddCnx("0","x16","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined, undefined);f.AddPathCommand(1,"x2","y1");f.AddPathCommand(5,"x3","y2","x4","y3","x5","y1");f.AddPathCommand(5,"x6","y2","x7","y3","x8","y1");f.AddPathCommand(2,"x15","y4");f.AddPathCommand(5,"x14","y6","x13","y5","x12","y4");f.AddPathCommand(5,"x11","y6","x10","y5","x9","y4");f.AddPathCommand(6);break}case "downArrow":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj2",0,"100000","h","ss");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("dy1", 0,"ss","a2","100000");f.AddGuide("y1",1,"b","0","dy1");f.AddGuide("dx1",0,"w","a1","200000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","dx1","0");f.AddGuide("dy2",0,"x1","dy1","wd2");f.AddGuide("y2",1,"y1","dy2","0");f.AddHandleXY("adj1","0","100000",undefined,"0","0","x1","t");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","l","y1");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","y1");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","y1");f.AddRect("x1","t","x2","y2");f.AddPathCommand(0, undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"r","y1");f.AddPathCommand(2,"hc","b");f.AddPathCommand(6);break}case "downArrowCallout":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddAdj("adj4",15,"64977");f.AddGuide("maxAdj2",0,"50000","w","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2"); f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("maxAdj3",0,"100000","h","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("q2",0,"a3","ss","h");f.AddGuide("maxAdj4",1,"100000","0","q2");f.AddGuide("a4",10,"0","adj4","maxAdj4");f.AddGuide("dx1",0,"ss","a2","100000");f.AddGuide("dx2",0,"ss","a1","200000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("dy3", 0,"ss","a3","100000");f.AddGuide("y3",1,"b","0","dy3");f.AddGuide("y2",0,"h","a4","100000");f.AddGuide("y1",0,"y2","1","2");f.AddHandleXY("adj1","0","maxAdj1",undefined,"0","0","x2","y3");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x1","b");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","y3");f.AddHandleXY(undefined,"0","0","adj4","0","maxAdj4","l","y2");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","y1");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","y1");f.AddRect("l","t","r","y2"); f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"l","y2");f.AddPathCommand(6);break}case "ellipse":{f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000"); f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","il","it");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","il","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","ir","ib");f.AddCnx("0","r","vc");f.AddCnx("_3cd4","ir","it");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2", "cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd4");f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2","hd2","cd4","cd4");f.AddPathCommand(6);break}case "ellipseRibbon":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"12500");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"25000","adj2","75000");f.AddGuide("q10",1,"100000","0","a1");f.AddGuide("q11",0,"q10","1","2");f.AddGuide("q12",1,"a1","0","q11");f.AddGuide("minAdj3",8,"0","q12"); f.AddGuide("a3",10,"minAdj3","adj3","a1");f.AddGuide("dx2",0,"w","a2","200000");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"x2","wd8","0");f.AddGuide("x4",1,"r","0","x3");f.AddGuide("x5",1,"r","0","x2");f.AddGuide("x6",1,"r","0","wd8");f.AddGuide("dy1",0,"h","a3","100000");f.AddGuide("f1",0,"4","dy1","w");f.AddGuide("q1",0,"x3","x3","w");f.AddGuide("q2",1,"x3","0","q1");f.AddGuide("y1",0,"f1","q2","1");f.AddGuide("cx1",0,"x3","1","2");f.AddGuide("cy1",0,"f1","cx1","1");f.AddGuide("cx2",1, "r","0","cx1");f.AddGuide("q1",0,"h","a1","100000");f.AddGuide("dy3",1,"q1","0","dy1");f.AddGuide("q3",0,"x2","x2","w");f.AddGuide("q4",1,"x2","0","q3");f.AddGuide("q5",0,"f1","q4","1");f.AddGuide("y3",1,"q5","dy3","0");f.AddGuide("q6",1,"dy1","dy3","y3");f.AddGuide("q7",1,"q6","dy1","0");f.AddGuide("cy3",1,"q7","dy3","0");f.AddGuide("rh",1,"b","0","q1");f.AddGuide("q8",0,"dy1","14","16");f.AddGuide("y2",2,"q8","rh","2");f.AddGuide("y5",1,"q5","rh","0");f.AddGuide("y6",1,"y3","rh","0");f.AddGuide("cx4", 0,"x2","1","2");f.AddGuide("q9",0,"f1","cx4","1");f.AddGuide("cy4",1,"q9","rh","0");f.AddGuide("cx5",1,"r","0","cx4");f.AddGuide("cy6",1,"cy3","rh","0");f.AddGuide("y7",1,"y1","dy3","0");f.AddGuide("cy7",1,"q1","q1","y7");f.AddGuide("y8",1,"b","0","dy1");f.AddHandleXY(undefined,"0","0","adj1","0","100000","hc","q1");f.AddHandleXY("adj2","25000","75000",undefined,"0","0","x2","b");f.AddHandleXY(undefined,"0","0","adj3","minAdj3","a1","l","y8");f.AddCnx("_3cd4","hc","q1");f.AddCnx("cd2","wd8","y2"); f.AddCnx("cd4","hc","b");f.AddCnx("0","x6","y2");f.AddRect("x2","q1","x5","y6");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(4,"cx1","cy1","x3","y1");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(4,"hc","cy3","x5","y3");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(4,"cx2","cy1","r","t");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"r","rh");f.AddPathCommand(4,"cx5","cy4","x5","y5");f.AddPathCommand(2,"x5","y6");f.AddPathCommand(4, "hc","cy6","x2","y6");f.AddPathCommand(2,"x2","y5");f.AddPathCommand(4,"cx4","cy4","l","rh");f.AddPathCommand(2,"wd8","y2");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"x3","y7");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(4,"hc","cy3","x5","y3");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x4","y7");f.AddPathCommand(4,"hc","cy7","x3","y7");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined, undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(4,"cx1","cy1","x3","y1");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(4,"hc","cy3","x5","y3");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(4,"cx2","cy1","r","t");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"r","rh");f.AddPathCommand(4,"cx5","cy4","x5","y5");f.AddPathCommand(2,"x5","y6");f.AddPathCommand(4,"hc","cy6","x2","y6");f.AddPathCommand(2,"x2","y5");f.AddPathCommand(4,"cx4","cy4","l","rh");f.AddPathCommand(2,"wd8","y2"); f.AddPathCommand(6);f.AddPathCommand(1,"x2","y5");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(1,"x5","y3");f.AddPathCommand(2,"x5","y5");f.AddPathCommand(1,"x3","y1");f.AddPathCommand(2,"x3","y7");f.AddPathCommand(1,"x4","y7");f.AddPathCommand(2,"x4","y1");break}case "ellipseRibbon2":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"12500");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"25000","adj2","75000");f.AddGuide("q10",1,"100000","0","a1");f.AddGuide("q11", 0,"q10","1","2");f.AddGuide("q12",1,"a1","0","q11");f.AddGuide("minAdj3",8,"0","q12");f.AddGuide("a3",10,"minAdj3","adj3","a1");f.AddGuide("dx2",0,"w","a2","200000");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"x2","wd8","0");f.AddGuide("x4",1,"r","0","x3");f.AddGuide("x5",1,"r","0","x2");f.AddGuide("x6",1,"r","0","wd8");f.AddGuide("dy1",0,"h","a3","100000");f.AddGuide("f1",0,"4","dy1","w");f.AddGuide("q1",0,"x3","x3","w");f.AddGuide("q2",1,"x3","0","q1");f.AddGuide("u1",0,"f1","q2","1"); f.AddGuide("y1",1,"b","0","u1");f.AddGuide("cx1",0,"x3","1","2");f.AddGuide("cu1",0,"f1","cx1","1");f.AddGuide("cy1",1,"b","0","cu1");f.AddGuide("cx2",1,"r","0","cx1");f.AddGuide("q1",0,"h","a1","100000");f.AddGuide("dy3",1,"q1","0","dy1");f.AddGuide("q3",0,"x2","x2","w");f.AddGuide("q4",1,"x2","0","q3");f.AddGuide("q5",0,"f1","q4","1");f.AddGuide("u3",1,"q5","dy3","0");f.AddGuide("y3",1,"b","0","u3");f.AddGuide("q6",1,"dy1","dy3","u3");f.AddGuide("q7",1,"q6","dy1","0");f.AddGuide("cu3",1,"q7","dy3", "0");f.AddGuide("cy3",1,"b","0","cu3");f.AddGuide("rh",1,"b","0","q1");f.AddGuide("q8",0,"dy1","14","16");f.AddGuide("u2",2,"q8","rh","2");f.AddGuide("y2",1,"b","0","u2");f.AddGuide("u5",1,"q5","rh","0");f.AddGuide("y5",1,"b","0","u5");f.AddGuide("u6",1,"u3","rh","0");f.AddGuide("y6",1,"b","0","u6");f.AddGuide("cx4",0,"x2","1","2");f.AddGuide("q9",0,"f1","cx4","1");f.AddGuide("cu4",1,"q9","rh","0");f.AddGuide("cy4",1,"b","0","cu4");f.AddGuide("cx5",1,"r","0","cx4");f.AddGuide("cu6",1,"cu3","rh","0"); f.AddGuide("cy6",1,"b","0","cu6");f.AddGuide("u7",1,"u1","dy3","0");f.AddGuide("y7",1,"b","0","u7");f.AddGuide("cu7",1,"q1","q1","u7");f.AddGuide("cy7",1,"b","0","cu7");f.AddHandleXY(undefined,"0","0","adj1","0","100000","hc","rh");f.AddHandleXY("adj2","25000","100000",undefined,"0","0","x2","t");f.AddHandleXY(undefined,"0","0","adj3","minAdj3","a1","l","dy1");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","wd8","y2");f.AddCnx("cd4","hc","rh");f.AddCnx("0","x6","y2");f.AddRect("x2","y6","x5","rh");f.AddPathCommand(0, false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(4,"cx1","cy1","x3","y1");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(4,"hc","cy3","x5","y3");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(4,"cx2","cy1","r","b");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"r","q1");f.AddPathCommand(4,"cx5","cy4","x5","y5");f.AddPathCommand(2,"x5","y6");f.AddPathCommand(4,"hc","cy6","x2","y6");f.AddPathCommand(2,"x2","y5");f.AddPathCommand(4,"cx4","cy4","l","q1");f.AddPathCommand(2, "wd8","y2");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"x3","y7");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(4,"hc","cy3","x5","y3");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x4","y7");f.AddPathCommand(4,"hc","cy7","x3","y7");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"wd8","y2");f.AddPathCommand(2,"l","q1");f.AddPathCommand(4, "cx4","cy4","x2","y5");f.AddPathCommand(2,"x2","y6");f.AddPathCommand(4,"hc","cy6","x5","y6");f.AddPathCommand(2,"x5","y5");f.AddPathCommand(4,"cx5","cy4","r","q1");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"r","b");f.AddPathCommand(4,"cx2","cy1","x4","y1");f.AddPathCommand(2,"x5","y3");f.AddPathCommand(4,"hc","cy3","x2","y3");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(4,"cx1","cy1","l","b");f.AddPathCommand(6);f.AddPathCommand(1,"x2","y3");f.AddPathCommand(2,"x2","y5");f.AddPathCommand(1, "x5","y5");f.AddPathCommand(2,"x5","y3");f.AddPathCommand(1,"x3","y7");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(1,"x4","y1");f.AddPathCommand(2,"x4","y7");break}case "flowChartAlternateProcess":{f.AddGuide("x2",1,"r","0","ssd6");f.AddGuide("y2",1,"b","0","ssd6");f.AddGuide("il",0,"ssd6","29289","100000");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","il");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","il","ir", "ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","ssd6");f.AddPathCommand(3,"ssd6","ssd6","cd2","cd4");f.AddPathCommand(2,"x2","t");f.AddPathCommand(3,"ssd6","ssd6","_3cd4","cd4");f.AddPathCommand(2,"r","y2");f.AddPathCommand(3,"ssd6","ssd6","0","cd4");f.AddPathCommand(2,"ssd6","b");f.AddPathCommand(3,"ssd6","ssd6","cd4","cd4");f.AddPathCommand(6);break}case "flowChartCollate":{f.AddGuide("ir",0,"w","3","4");f.AddGuide("ib",0,"h","3","4");f.AddCnx("_3cd4", "hc","t");f.AddCnx("_3cd4","hc","vc");f.AddCnx("cd4","hc","b");f.AddRect("wd4","hd4","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,2,2);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"2","0");f.AddPathCommand(2,"1","1");f.AddPathCommand(2,"2","2");f.AddPathCommand(2,"0","2");f.AddPathCommand(2,"1","1");f.AddPathCommand(6);break}case "flowChartConnector":{f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc", "idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","il","it");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","il","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","ir","ib");f.AddCnx("0","r","vc");f.AddCnx("_3cd4","ir","it");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd4"); f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2","hd2","cd4","cd4");f.AddPathCommand(6);break}case "flowChartDecision":{f.AddGuide("ir",0,"w","3","4");f.AddGuide("ib",0,"h","3","4");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("wd4","hd4","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,2,2);f.AddPathCommand(1,"0","1");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"2","1");f.AddPathCommand(2,"1","2");f.AddPathCommand(6); break}case "flowChartDelay":{f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"hc","t");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd2"); f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "flowChartDisplay":{f.AddGuide("x2",0,"w","5","6");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("wd6","t","x2","b");f.AddPathCommand(0,undefined,undefined,undefined,6,6);f.AddPathCommand(1,"0","3");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"5","0");f.AddPathCommand(3,"1","3","_3cd4","cd2");f.AddPathCommand(2,"1","6");f.AddPathCommand(6);break}case "flowChartDocument":{f.AddGuide("y1", 0,"h","17322","21600");f.AddGuide("y2",0,"h","20172","21600");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","y2");f.AddCnx("0","r","vc");f.AddRect("l","t","r","y1");f.AddPathCommand(0,undefined,undefined,undefined,21600,21600);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"21600","0");f.AddPathCommand(2,"21600","17322");f.AddPathCommand(5,"10800","17322","10800","23922","0","20172");f.AddPathCommand(6);break}case "flowChartExtract":{f.AddGuide("x2",0,"w","3","4");f.AddCnx("_3cd4", "hc","t");f.AddCnx("cd2","wd4","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","x2","vc");f.AddRect("wd4","vc","x2","b");f.AddPathCommand(0,undefined,undefined,undefined,2,2);f.AddPathCommand(1,"0","2");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"2","2");f.AddPathCommand(6);break}case "flowChartInputOutput":{f.AddGuide("x3",0,"w","2","5");f.AddGuide("x4",0,"w","3","5");f.AddGuide("x5",0,"w","4","5");f.AddGuide("x6",0,"w","9","10");f.AddCnx("_3cd4","x4","t");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2", "wd10","vc");f.AddCnx("cd4","x3","b");f.AddCnx("cd4","hc","b");f.AddCnx("0","x6","vc");f.AddRect("wd5","t","x5","b");f.AddPathCommand(0,undefined,undefined,undefined,5,5);f.AddPathCommand(1,"0","5");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"5","0");f.AddPathCommand(2,"4","5");f.AddPathCommand(6);break}case "flowChartInternalStorage":{f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("wd8","hd8","r","b");f.AddPathCommand(0,false,undefined, false,1,1);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"1","1");f.AddPathCommand(2,"0","1");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,8,8);f.AddPathCommand(1,"1","0");f.AddPathCommand(2,"1","8");f.AddPathCommand(1,"0","1");f.AddPathCommand(2,"8","1");f.AddPathCommand(0,undefined,"none",undefined,1,1);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"1","1");f.AddPathCommand(2,"0","1");f.AddPathCommand(6);break}case "flowChartMagneticDisk":{f.AddGuide("y3", 0,"h","5","6");f.AddCnx("_3cd4","hc","hd3");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","hd3","r","y3");f.AddPathCommand(0,false,undefined,false,6,6);f.AddPathCommand(1,"0","1");f.AddPathCommand(3,"3","1","cd2","cd2");f.AddPathCommand(2,"6","5");f.AddPathCommand(3,"3","1","0","cd2");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,6,6);f.AddPathCommand(1,"6","1");f.AddPathCommand(3,"3","1","0","cd2");f.AddPathCommand(0, undefined,"none",undefined,6,6);f.AddPathCommand(1,"0","1");f.AddPathCommand(3,"3","1","cd2","cd2");f.AddPathCommand(2,"6","5");f.AddPathCommand(3,"3","1","0","cd2");f.AddPathCommand(6);break}case "flowChartMagneticDrum":{f.AddGuide("x2",0,"w","2","3");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","x2","vc");f.AddCnx("0","r","vc");f.AddRect("wd6","t","x2","b");f.AddPathCommand(0,false,undefined,false,6,6);f.AddPathCommand(1,"1","0");f.AddPathCommand(2,"5", "0");f.AddPathCommand(3,"1","3","_3cd4","cd2");f.AddPathCommand(2,"1","6");f.AddPathCommand(3,"1","3","cd4","cd2");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,6,6);f.AddPathCommand(1,"5","6");f.AddPathCommand(3,"1","3","cd4","cd2");f.AddPathCommand(0,undefined,"none",undefined,6,6);f.AddPathCommand(1,"1","0");f.AddPathCommand(2,"5","0");f.AddPathCommand(3,"1","3","_3cd4","cd2");f.AddPathCommand(2,"1","6");f.AddPathCommand(3,"1","3","cd4","cd2");f.AddPathCommand(6);break}case "flowChartMagneticTape":{f.AddGuide("idx", 7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddGuide("ang1",5,"1","1");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"hc","b");f.AddPathCommand(3,"wd2","hd2","cd4","cd4");f.AddPathCommand(3, "wd2","hd2","cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd4");f.AddPathCommand(3,"wd2","hd2","0","ang1");f.AddPathCommand(2,"r","ib");f.AddPathCommand(2,"r","b");f.AddPathCommand(6);break}case "flowChartManualInput":{f.AddCnx("_3cd4","hc","hd10");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","hd5","r","b");f.AddPathCommand(0,undefined,undefined,undefined,5,5);f.AddPathCommand(1,"0","1");f.AddPathCommand(2,"5","0");f.AddPathCommand(2,"5","5");f.AddPathCommand(2, "0","5");f.AddPathCommand(6);break}case "flowChartManualOperation":{f.AddGuide("x3",0,"w","4","5");f.AddGuide("x4",0,"w","9","10");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","wd10","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","x4","vc");f.AddRect("wd5","t","x3","b");f.AddPathCommand(0,undefined,undefined,undefined,5,5);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"5","0");f.AddPathCommand(2,"4","5");f.AddPathCommand(2,"1","5");f.AddPathCommand(6);break}case "flowChartMerge":{f.AddGuide("x2",0,"w", "3","4");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","wd4","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","x2","vc");f.AddRect("wd4","t","x2","vc");f.AddPathCommand(0,undefined,undefined,undefined,2,2);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"2","0");f.AddPathCommand(2,"1","2");f.AddPathCommand(6);break}case "flowChartMultidocument":{f.AddGuide("y2",0,"h","3675","21600");f.AddGuide("y8",0,"h","20782","21600");f.AddGuide("x3",0,"w","9298","21600");f.AddGuide("x4",0,"w","12286","21600");f.AddGuide("x5", 0,"w","18595","21600");f.AddCnx("_3cd4","x4","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","x3","y8");f.AddCnx("0","r","vc");f.AddRect("l","y2","x5","y8");f.AddPathCommand(0,false,undefined,false,21600,21600);f.AddPathCommand(1,"0","20782");f.AddPathCommand(5,"9298","23542","9298","18022","18595","18022");f.AddPathCommand(2,"18595","3675");f.AddPathCommand(2,"0","3675");f.AddPathCommand(6);f.AddPathCommand(1,"1532","3675");f.AddPathCommand(2,"1532","1815");f.AddPathCommand(2,"20000","1815");f.AddPathCommand(2, "20000","16252");f.AddPathCommand(5,"19298","16252","18595","16352","18595","16352");f.AddPathCommand(2,"18595","3675");f.AddPathCommand(6);f.AddPathCommand(1,"2972","1815");f.AddPathCommand(2,"2972","0");f.AddPathCommand(2,"21600","0");f.AddPathCommand(2,"21600","14392");f.AddPathCommand(5,"20800","14392","20000","14467","20000","14467");f.AddPathCommand(2,"20000","1815");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,21600,21600);f.AddPathCommand(1,"0","3675");f.AddPathCommand(2, "18595","3675");f.AddPathCommand(2,"18595","18022");f.AddPathCommand(5,"9298","18022","9298","23542","0","20782");f.AddPathCommand(6);f.AddPathCommand(1,"1532","3675");f.AddPathCommand(2,"1532","1815");f.AddPathCommand(2,"20000","1815");f.AddPathCommand(2,"20000","16252");f.AddPathCommand(5,"19298","16252","18595","16352","18595","16352");f.AddPathCommand(1,"2972","1815");f.AddPathCommand(2,"2972","0");f.AddPathCommand(2,"21600","0");f.AddPathCommand(2,"21600","14392");f.AddPathCommand(5,"20800", "14392","20000","14467","20000","14467");f.AddPathCommand(0,undefined,"none",false,21600,21600);f.AddPathCommand(1,"0","20782");f.AddPathCommand(5,"9298","23542","9298","18022","18595","18022");f.AddPathCommand(2,"18595","16352");f.AddPathCommand(5,"18595","16352","19298","16252","20000","16252");f.AddPathCommand(2,"20000","14467");f.AddPathCommand(5,"20000","14467","20800","14392","21600","14392");f.AddPathCommand(2,"21600","0");f.AddPathCommand(2,"2972","0");f.AddPathCommand(2,"2972","1815");f.AddPathCommand(2, "1532","1815");f.AddPathCommand(2,"1532","3675");f.AddPathCommand(2,"0","3675");f.AddPathCommand(6);break}case "flowChartOfflineStorage":{f.AddGuide("x4",0,"w","3","4");f.AddCnx("0","x4","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","wd4","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("wd4","t","x4","vc");f.AddPathCommand(0,false,undefined,false,2,2);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"2","0");f.AddPathCommand(2,"1","2");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,5,5);f.AddPathCommand(1, "2","4");f.AddPathCommand(2,"3","4");f.AddPathCommand(0,true,"none",undefined,2,2);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"2","0");f.AddPathCommand(2,"1","2");f.AddPathCommand(6);break}case "flowChartOffpageConnector":{f.AddGuide("y1",0,"h","4","5");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","t","r","y1");f.AddPathCommand(0,undefined,undefined,undefined,10,10);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"10","0");f.AddPathCommand(2, "10","8");f.AddPathCommand(2,"5","10");f.AddPathCommand(2,"0","8");f.AddPathCommand(6);break}case "flowChartOnlineStorage":{f.AddGuide("x2",0,"w","5","6");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","x2","vc");f.AddRect("wd6","t","x2","b");f.AddPathCommand(0,undefined,undefined,undefined,6,6);f.AddPathCommand(1,"1","0");f.AddPathCommand(2,"6","0");f.AddPathCommand(3,"1","3","_3cd4","-10800000");f.AddPathCommand(2,"1","6");f.AddPathCommand(3,"1","3","cd4", "cd2");f.AddPathCommand(6);break}case "flowChartOr":{f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","il","it");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","il","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","ir","ib");f.AddCnx("0","r","vc");f.AddCnx("_3cd4","ir","it");f.AddRect("il","it","ir","ib"); f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd4");f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2","hd2","cd4","cd4");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"hc","t");f.AddPathCommand(2,"hc","b");f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"r","vc");f.AddPathCommand(0,undefined,"none", undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd4");f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2","hd2","cd4","cd4");f.AddPathCommand(6);break}case "flowChartPredefinedProcess":{f.AddGuide("x2",0,"w","7","8");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("wd8","t","x2","b");f.AddPathCommand(0,false,undefined,false,1, 1);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"1","1");f.AddPathCommand(2,"0","1");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,8,8);f.AddPathCommand(1,"1","0");f.AddPathCommand(2,"1","8");f.AddPathCommand(1,"7","0");f.AddPathCommand(2,"7","8");f.AddPathCommand(0,undefined,"none",undefined,1,1);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"1","1");f.AddPathCommand(2,"0","1");f.AddPathCommand(6);break}case "flowChartPreparation":{f.AddGuide("x2", 0,"w","4","5");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("wd5","t","x2","b");f.AddPathCommand(0,undefined,undefined,undefined,10,10);f.AddPathCommand(1,"0","5");f.AddPathCommand(2,"2","0");f.AddPathCommand(2,"8","0");f.AddPathCommand(2,"10","5");f.AddPathCommand(2,"8","10");f.AddPathCommand(2,"2","10");f.AddPathCommand(6);break}case "flowChartProcess":{f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0", "r","vc");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,undefined,undefined,1,1);f.AddPathCommand(1,"0","0");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"1","1");f.AddPathCommand(2,"0","1");f.AddPathCommand(6);break}case "flowChartPunchedCard":{f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","hd5","r","b");f.AddPathCommand(0,undefined,undefined,undefined,5,5);f.AddPathCommand(1,"0","1");f.AddPathCommand(2,"1","0");f.AddPathCommand(2, "5","0");f.AddPathCommand(2,"5","5");f.AddPathCommand(2,"0","5");f.AddPathCommand(6);break}case "flowChartPunchedTape":{f.AddGuide("y2",0,"h","9","10");f.AddGuide("ib",0,"h","4","5");f.AddCnx("_3cd4","hc","hd10");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","y2");f.AddCnx("0","r","vc");f.AddRect("l","hd5","r","ib");f.AddPathCommand(0,undefined,undefined,undefined,20,20);f.AddPathCommand(1,"0","2");f.AddPathCommand(3,"5","2","cd2","-10800000");f.AddPathCommand(3,"5","2","cd2","cd2");f.AddPathCommand(2, "20","18");f.AddPathCommand(3,"5","2","0","-10800000");f.AddPathCommand(3,"5","2","0","cd2");f.AddPathCommand(6);break}case "flowChartSort":{f.AddGuide("ir",0,"w","3","4");f.AddGuide("ib",0,"h","3","4");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("wd4","hd4","ir","ib");f.AddPathCommand(0,false,undefined,false,2,2);f.AddPathCommand(1,"0","1");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"2","1");f.AddPathCommand(2,"1","2");f.AddPathCommand(6); f.AddPathCommand(0,false,"none",undefined,2,2);f.AddPathCommand(1,"0","1");f.AddPathCommand(2,"2","1");f.AddPathCommand(0,undefined,"none",undefined,2,2);f.AddPathCommand(1,"0","1");f.AddPathCommand(2,"1","0");f.AddPathCommand(2,"2","1");f.AddPathCommand(2,"1","2");f.AddPathCommand(6);break}case "flowChartSummingJunction":{f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib", 1,"vc","idy","0");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","il","it");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","il","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","ir","ib");f.AddCnx("0","r","vc");f.AddCnx("_3cd4","ir","it");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd4");f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2", "hd2","cd4","cd4");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"il","it");f.AddPathCommand(2,"ir","ib");f.AddPathCommand(1,"ir","it");f.AddPathCommand(2,"il","ib");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd4");f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2","hd2","cd4","cd4");f.AddPathCommand(6); break}case "flowChartTerminator":{f.AddGuide("il",0,"w","1018","21600");f.AddGuide("ir",0,"w","20582","21600");f.AddGuide("it",0,"h","3163","21600");f.AddGuide("ib",0,"h","18437","21600");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,21600,21600);f.AddPathCommand(1,"3475","0");f.AddPathCommand(2,"18125","0");f.AddPathCommand(3,"3475","10800","_3cd4","cd2");f.AddPathCommand(2, "3475","21600");f.AddPathCommand(3,"3475","10800","cd4","cd2");f.AddPathCommand(6);break}case "foldedCorner":{f.AddAdj("adj",15,"16667");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dy2",0,"ss","a","100000");f.AddGuide("dy1",0,"dy2","1","5");f.AddGuide("x1",1,"r","0","dy2");f.AddGuide("x2",1,"x1","dy1","0");f.AddGuide("y2",1,"b","0","dy2");f.AddGuide("y1",1,"y2","dy1","0");f.AddHandleXY("adj","0","50000",undefined,"0","0","x1","b");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4", "hc","b");f.AddCnx("0","r","vc");f.AddRect("l","t","r","y2");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"x1","b");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"r","y2");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined, undefined);f.AddPathCommand(1,"x1","b");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(2,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","y2");break}case "frame":{f.AddAdj("adj1",15,"12500");f.AddGuide("a1",10,"0","adj1","50000");f.AddGuide("x1",0,"ss","a1","100000");f.AddGuide("x4",1,"r","0","x1");f.AddGuide("y4",1,"b","0","x1");f.AddHandleXY("adj1","0","50000",undefined,"0","0","x1","t");f.AddCnx("_3cd4", "hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("x1","x1","x4","y4");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(1,"x1","x1");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(2,"x4","x1");f.AddPathCommand(6);break}case "funnel":{f.AddGuide("d",0,"ss","1", "20");f.AddGuide("rw2",1,"wd2","0","d");f.AddGuide("rh2",1,"hd4","0","d");f.AddGuide("t1",7,"wd2","480000");f.AddGuide("t2",12,"hd4","480000");f.AddGuide("da",5,"t1","t2");f.AddGuide("2da",0,"da","2","1");f.AddGuide("stAng1",1,"cd2","0","da");f.AddGuide("swAng1",1,"cd2","2da","0");f.AddGuide("swAng3",1,"cd2","0","2da");f.AddGuide("rw3",0,"wd2","1","4");f.AddGuide("rh3",0,"hd4","1","4");f.AddGuide("ct1",7,"hd4","stAng1");f.AddGuide("st1",12,"wd2","stAng1");f.AddGuide("m1",9,"ct1","st1","0");f.AddGuide("n1", 0,"wd2","hd4","m1");f.AddGuide("dx1",7,"n1","stAng1");f.AddGuide("dy1",12,"n1","stAng1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"hd4","dy1","0");f.AddGuide("ct3",7,"rh3","da");f.AddGuide("st3",12,"rw3","da");f.AddGuide("m3",9,"ct3","st3","0");f.AddGuide("n3",0,"rw3","rh3","m3");f.AddGuide("dx3",7,"n3","da");f.AddGuide("dy3",12,"n3","da");f.AddGuide("x3",1,"hc","dx3","0");f.AddGuide("vc3",1,"b","0","rh3");f.AddGuide("y2",1,"vc3","dy3","0");f.AddGuide("x2",1,"wd2","0","rw2");f.AddGuide("cd", 0,"cd2","2","1");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd4","stAng1","swAng1");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(3,"rw3","rh3","da","swAng3");f.AddPathCommand(6);f.AddPathCommand(1,"x2","hd4");f.AddPathCommand(3,"rw2","rh2","cd2","-21600000");f.AddPathCommand(6);break}case "gear6":{f.AddAdj("adj1",15,"15000");f.AddAdj("adj2",15,"3526");f.AddGuide("a1",10,"0","adj1","20000"); f.AddGuide("a2",10,"0","adj2","5358");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("lFD",0,"ss","a2","100000");f.AddGuide("th2",0,"th","1","2");f.AddGuide("l2",0,"lFD","1","2");f.AddGuide("l3",1,"th2","l2","0");f.AddGuide("rh",1,"hd2","0","th");f.AddGuide("rw",1,"wd2","0","th");f.AddGuide("dr",1,"rw","0","rh");f.AddGuide("maxr",3,"dr","rh","rw");f.AddGuide("ha",5,"maxr","l3");f.AddGuide("aA1",1,"19800000","0","ha");f.AddGuide("aD1",1,"19800000","ha","0");f.AddGuide("ta11",7,"rw","aA1");f.AddGuide("ta12", 12,"rh","aA1");f.AddGuide("bA1",5,"ta11","ta12");f.AddGuide("cta1",7,"rh","bA1");f.AddGuide("sta1",12,"rw","bA1");f.AddGuide("ma1",9,"cta1","sta1","0");f.AddGuide("na1",0,"rw","rh","ma1");f.AddGuide("dxa1",7,"na1","bA1");f.AddGuide("dya1",12,"na1","bA1");f.AddGuide("xA1",1,"hc","dxa1","0");f.AddGuide("yA1",1,"vc","dya1","0");f.AddGuide("td11",7,"rw","aD1");f.AddGuide("td12",12,"rh","aD1");f.AddGuide("bD1",5,"td11","td12");f.AddGuide("ctd1",7,"rh","bD1");f.AddGuide("std1",12,"rw","bD1");f.AddGuide("md1", 9,"ctd1","std1","0");f.AddGuide("nd1",0,"rw","rh","md1");f.AddGuide("dxd1",7,"nd1","bD1");f.AddGuide("dyd1",12,"nd1","bD1");f.AddGuide("xD1",1,"hc","dxd1","0");f.AddGuide("yD1",1,"vc","dyd1","0");f.AddGuide("xAD1",1,"xA1","0","xD1");f.AddGuide("yAD1",1,"yA1","0","yD1");f.AddGuide("lAD1",9,"xAD1","yAD1","0");f.AddGuide("a1",5,"yAD1","xAD1");f.AddGuide("dxF1",12,"lFD","a1");f.AddGuide("dyF1",7,"lFD","a1");f.AddGuide("xF1",1,"xD1","dxF1","0");f.AddGuide("yF1",1,"yD1","dyF1","0");f.AddGuide("xE1",1,"xA1", "0","dxF1");f.AddGuide("yE1",1,"yA1","0","dyF1");f.AddGuide("yC1t",12,"th","a1");f.AddGuide("xC1t",7,"th","a1");f.AddGuide("yC1",1,"yF1","yC1t","0");f.AddGuide("xC1",1,"xF1","0","xC1t");f.AddGuide("yB1",1,"yE1","yC1t","0");f.AddGuide("xB1",1,"xE1","0","xC1t");f.AddGuide("aD6",1,"_3cd4","ha","0");f.AddGuide("td61",7,"rw","aD6");f.AddGuide("td62",12,"rh","aD6");f.AddGuide("bD6",5,"td61","td62");f.AddGuide("ctd6",7,"rh","bD6");f.AddGuide("std6",12,"rw","bD6");f.AddGuide("md6",9,"ctd6","std6","0");f.AddGuide("nd6", 0,"rw","rh","md6");f.AddGuide("dxd6",7,"nd6","bD6");f.AddGuide("dyd6",12,"nd6","bD6");f.AddGuide("xD6",1,"hc","dxd6","0");f.AddGuide("yD6",1,"vc","dyd6","0");f.AddGuide("xA6",1,"hc","0","dxd6");f.AddGuide("xF6",1,"xD6","0","lFD");f.AddGuide("xE6",1,"xA6","lFD","0");f.AddGuide("yC6",1,"yD6","0","th");f.AddGuide("swAng1",1,"bA1","0","bD6");f.AddGuide("aA2",1,"1800000","0","ha");f.AddGuide("aD2",1,"1800000","ha","0");f.AddGuide("ta21",7,"rw","aA2");f.AddGuide("ta22",12,"rh","aA2");f.AddGuide("bA2",5, "ta21","ta22");f.AddGuide("yA2",1,"h","0","yD1");f.AddGuide("td21",7,"rw","aD2");f.AddGuide("td22",12,"rh","aD2");f.AddGuide("bD2",5,"td21","td22");f.AddGuide("yD2",1,"h","0","yA1");f.AddGuide("yC2",1,"h","0","yB1");f.AddGuide("yB2",1,"h","0","yC1");f.AddGuide("xB2",15,"xC1");f.AddGuide("swAng2",1,"bA2","0","bD1");f.AddGuide("aD3",1,"cd4","ha","0");f.AddGuide("td31",7,"rw","aD3");f.AddGuide("td32",12,"rh","aD3");f.AddGuide("bD3",5,"td31","td32");f.AddGuide("yD3",1,"h","0","yD6");f.AddGuide("yB3", 1,"h","0","yC6");f.AddGuide("aD4",1,"9000000","ha","0");f.AddGuide("td41",7,"rw","aD4");f.AddGuide("td42",12,"rh","aD4");f.AddGuide("bD4",5,"td41","td42");f.AddGuide("xD4",1,"w","0","xD1");f.AddGuide("xC4",1,"w","0","xC1");f.AddGuide("xB4",1,"w","0","xB1");f.AddGuide("aD5",1,"12600000","ha","0");f.AddGuide("td51",7,"rw","aD5");f.AddGuide("td52",12,"rh","aD5");f.AddGuide("bD5",5,"td51","td52");f.AddGuide("xD5",1,"w","0","xA1");f.AddGuide("xC5",1,"w","0","xB1");f.AddGuide("xB5",1,"w","0","xC1");f.AddGuide("xCxn1", 2,"xB1","xC1","2");f.AddGuide("yCxn1",2,"yB1","yC1","2");f.AddGuide("yCxn2",1,"b","0","yCxn1");f.AddGuide("xCxn4",2,"r","0","xCxn1");f.AddHandleXY(undefined,"0","0","adj1","0","20000","xD6","yD6");f.AddHandleXY("adj2","0","5358",undefined,"0","0","xA6","yD6");f.AddCnx("19800000","xCxn1","yCxn1");f.AddCnx("1800000","xCxn1","yCxn2");f.AddCnx("cd4","hc","yB3");f.AddCnx("9000000","xCxn4","yCxn2");f.AddCnx("12600000","xCxn4","yCxn1");f.AddCnx("_3cd4","hc","yC6");f.AddRect("xD5","yA1","xA1","yD2");f.AddPathCommand(0, undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"xA1","yA1");f.AddPathCommand(2,"xB1","yB1");f.AddPathCommand(2,"xC1","yC1");f.AddPathCommand(2,"xD1","yD1");f.AddPathCommand(3,"rh","rw","bD1","swAng2");f.AddPathCommand(2,"xC1","yB2");f.AddPathCommand(2,"xB1","yC2");f.AddPathCommand(2,"xA1","yD2");f.AddPathCommand(3,"rh","rw","bD2","swAng1");f.AddPathCommand(2,"xF6","yB3");f.AddPathCommand(2,"xE6","yB3");f.AddPathCommand(2,"xA6","yD3");f.AddPathCommand(3,"rh","rw","bD3","swAng1"); f.AddPathCommand(2,"xB4","yC2");f.AddPathCommand(2,"xC4","yB2");f.AddPathCommand(2,"xD4","yA2");f.AddPathCommand(3,"rh","rw","bD4","swAng2");f.AddPathCommand(2,"xB5","yC1");f.AddPathCommand(2,"xC5","yB1");f.AddPathCommand(2,"xD5","yA1");f.AddPathCommand(3,"rh","rw","bD5","swAng1");f.AddPathCommand(2,"xE6","yC6");f.AddPathCommand(2,"xF6","yC6");f.AddPathCommand(2,"xD6","yD6");f.AddPathCommand(3,"rh","rw","bD6","swAng1");f.AddPathCommand(6);break}case "gear9":{f.AddAdj("adj1",15,"10000");f.AddAdj("adj2", 15,"1763");f.AddGuide("a1",10,"0","adj1","20000");f.AddGuide("a2",10,"0","adj2","2679");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("lFD",0,"ss","a2","100000");f.AddGuide("th2",0,"th","1","2");f.AddGuide("l2",0,"lFD","1","2");f.AddGuide("l3",1,"th2","l2","0");f.AddGuide("rh",1,"hd2","0","th");f.AddGuide("rw",1,"wd2","0","th");f.AddGuide("dr",1,"rw","0","rh");f.AddGuide("maxr",3,"dr","rh","rw");f.AddGuide("ha",5,"maxr","l3");f.AddGuide("aA1",1,"18600000","0","ha");f.AddGuide("aD1",1,"18600000", "ha","0");f.AddGuide("ta11",7,"rw","aA1");f.AddGuide("ta12",12,"rh","aA1");f.AddGuide("bA1",5,"ta11","ta12");f.AddGuide("cta1",7,"rh","bA1");f.AddGuide("sta1",12,"rw","bA1");f.AddGuide("ma1",9,"cta1","sta1","0");f.AddGuide("na1",0,"rw","rh","ma1");f.AddGuide("dxa1",7,"na1","bA1");f.AddGuide("dya1",12,"na1","bA1");f.AddGuide("xA1",1,"hc","dxa1","0");f.AddGuide("yA1",1,"vc","dya1","0");f.AddGuide("td11",7,"rw","aD1");f.AddGuide("td12",12,"rh","aD1");f.AddGuide("bD1",5,"td11","td12");f.AddGuide("ctd1", 7,"rh","bD1");f.AddGuide("std1",12,"rw","bD1");f.AddGuide("md1",9,"ctd1","std1","0");f.AddGuide("nd1",0,"rw","rh","md1");f.AddGuide("dxd1",7,"nd1","bD1");f.AddGuide("dyd1",12,"nd1","bD1");f.AddGuide("xD1",1,"hc","dxd1","0");f.AddGuide("yD1",1,"vc","dyd1","0");f.AddGuide("xAD1",1,"xA1","0","xD1");f.AddGuide("yAD1",1,"yA1","0","yD1");f.AddGuide("lAD1",9,"xAD1","yAD1","0");f.AddGuide("a1",5,"yAD1","xAD1");f.AddGuide("dxF1",12,"lFD","a1");f.AddGuide("dyF1",7,"lFD","a1");f.AddGuide("xF1",1,"xD1","dxF1", "0");f.AddGuide("yF1",1,"yD1","dyF1","0");f.AddGuide("xE1",1,"xA1","0","dxF1");f.AddGuide("yE1",1,"yA1","0","dyF1");f.AddGuide("yC1t",12,"th","a1");f.AddGuide("xC1t",7,"th","a1");f.AddGuide("yC1",1,"yF1","yC1t","0");f.AddGuide("xC1",1,"xF1","0","xC1t");f.AddGuide("yB1",1,"yE1","yC1t","0");f.AddGuide("xB1",1,"xE1","0","xC1t");f.AddGuide("aA2",1,"21000000","0","ha");f.AddGuide("aD2",1,"21000000","ha","0");f.AddGuide("ta21",7,"rw","aA2");f.AddGuide("ta22",12,"rh","aA2");f.AddGuide("bA2",5,"ta21","ta22"); f.AddGuide("cta2",7,"rh","bA2");f.AddGuide("sta2",12,"rw","bA2");f.AddGuide("ma2",9,"cta2","sta2","0");f.AddGuide("na2",0,"rw","rh","ma2");f.AddGuide("dxa2",7,"na2","bA2");f.AddGuide("dya2",12,"na2","bA2");f.AddGuide("xA2",1,"hc","dxa2","0");f.AddGuide("yA2",1,"vc","dya2","0");f.AddGuide("td21",7,"rw","aD2");f.AddGuide("td22",12,"rh","aD2");f.AddGuide("bD2",5,"td21","td22");f.AddGuide("ctd2",7,"rh","bD2");f.AddGuide("std2",12,"rw","bD2");f.AddGuide("md2",9,"ctd2","std2","0");f.AddGuide("nd2",0,"rw", "rh","md2");f.AddGuide("dxd2",7,"nd2","bD2");f.AddGuide("dyd2",12,"nd2","bD2");f.AddGuide("xD2",1,"hc","dxd2","0");f.AddGuide("yD2",1,"vc","dyd2","0");f.AddGuide("xAD2",1,"xA2","0","xD2");f.AddGuide("yAD2",1,"yA2","0","yD2");f.AddGuide("lAD2",9,"xAD2","yAD2","0");f.AddGuide("a2",5,"yAD2","xAD2");f.AddGuide("dxF2",12,"lFD","a2");f.AddGuide("dyF2",7,"lFD","a2");f.AddGuide("xF2",1,"xD2","dxF2","0");f.AddGuide("yF2",1,"yD2","dyF2","0");f.AddGuide("xE2",1,"xA2","0","dxF2");f.AddGuide("yE2",1,"yA2","0", "dyF2");f.AddGuide("yC2t",12,"th","a2");f.AddGuide("xC2t",7,"th","a2");f.AddGuide("yC2",1,"yF2","yC2t","0");f.AddGuide("xC2",1,"xF2","0","xC2t");f.AddGuide("yB2",1,"yE2","yC2t","0");f.AddGuide("xB2",1,"xE2","0","xC2t");f.AddGuide("swAng1",1,"bA2","0","bD1");f.AddGuide("aA3",1,"1800000","0","ha");f.AddGuide("aD3",1,"1800000","ha","0");f.AddGuide("ta31",7,"rw","aA3");f.AddGuide("ta32",12,"rh","aA3");f.AddGuide("bA3",5,"ta31","ta32");f.AddGuide("cta3",7,"rh","bA3");f.AddGuide("sta3",12,"rw","bA3");f.AddGuide("ma3", 9,"cta3","sta3","0");f.AddGuide("na3",0,"rw","rh","ma3");f.AddGuide("dxa3",7,"na3","bA3");f.AddGuide("dya3",12,"na3","bA3");f.AddGuide("xA3",1,"hc","dxa3","0");f.AddGuide("yA3",1,"vc","dya3","0");f.AddGuide("td31",7,"rw","aD3");f.AddGuide("td32",12,"rh","aD3");f.AddGuide("bD3",5,"td31","td32");f.AddGuide("ctd3",7,"rh","bD3");f.AddGuide("std3",12,"rw","bD3");f.AddGuide("md3",9,"ctd3","std3","0");f.AddGuide("nd3",0,"rw","rh","md3");f.AddGuide("dxd3",7,"nd3","bD3");f.AddGuide("dyd3",12,"nd3","bD3"); f.AddGuide("xD3",1,"hc","dxd3","0");f.AddGuide("yD3",1,"vc","dyd3","0");f.AddGuide("xAD3",1,"xA3","0","xD3");f.AddGuide("yAD3",1,"yA3","0","yD3");f.AddGuide("lAD3",9,"xAD3","yAD3","0");f.AddGuide("a3",5,"yAD3","xAD3");f.AddGuide("dxF3",12,"lFD","a3");f.AddGuide("dyF3",7,"lFD","a3");f.AddGuide("xF3",1,"xD3","dxF3","0");f.AddGuide("yF3",1,"yD3","dyF3","0");f.AddGuide("xE3",1,"xA3","0","dxF3");f.AddGuide("yE3",1,"yA3","0","dyF3");f.AddGuide("yC3t",12,"th","a3");f.AddGuide("xC3t",7,"th","a3");f.AddGuide("yC3", 1,"yF3","yC3t","0");f.AddGuide("xC3",1,"xF3","0","xC3t");f.AddGuide("yB3",1,"yE3","yC3t","0");f.AddGuide("xB3",1,"xE3","0","xC3t");f.AddGuide("swAng2",1,"bA3","0","bD2");f.AddGuide("aA4",1,"4200000","0","ha");f.AddGuide("aD4",1,"4200000","ha","0");f.AddGuide("ta41",7,"rw","aA4");f.AddGuide("ta42",12,"rh","aA4");f.AddGuide("bA4",5,"ta41","ta42");f.AddGuide("cta4",7,"rh","bA4");f.AddGuide("sta4",12,"rw","bA4");f.AddGuide("ma4",9,"cta4","sta4","0");f.AddGuide("na4",0,"rw","rh","ma4");f.AddGuide("dxa4", 7,"na4","bA4");f.AddGuide("dya4",12,"na4","bA4");f.AddGuide("xA4",1,"hc","dxa4","0");f.AddGuide("yA4",1,"vc","dya4","0");f.AddGuide("td41",7,"rw","aD4");f.AddGuide("td42",12,"rh","aD4");f.AddGuide("bD4",5,"td41","td42");f.AddGuide("ctd4",7,"rh","bD4");f.AddGuide("std4",12,"rw","bD4");f.AddGuide("md4",9,"ctd4","std4","0");f.AddGuide("nd4",0,"rw","rh","md4");f.AddGuide("dxd4",7,"nd4","bD4");f.AddGuide("dyd4",12,"nd4","bD4");f.AddGuide("xD4",1,"hc","dxd4","0");f.AddGuide("yD4",1,"vc","dyd4","0");f.AddGuide("xAD4", 1,"xA4","0","xD4");f.AddGuide("yAD4",1,"yA4","0","yD4");f.AddGuide("lAD4",9,"xAD4","yAD4","0");f.AddGuide("a4",5,"yAD4","xAD4");f.AddGuide("dxF4",12,"lFD","a4");f.AddGuide("dyF4",7,"lFD","a4");f.AddGuide("xF4",1,"xD4","dxF4","0");f.AddGuide("yF4",1,"yD4","dyF4","0");f.AddGuide("xE4",1,"xA4","0","dxF4");f.AddGuide("yE4",1,"yA4","0","dyF4");f.AddGuide("yC4t",12,"th","a4");f.AddGuide("xC4t",7,"th","a4");f.AddGuide("yC4",1,"yF4","yC4t","0");f.AddGuide("xC4",1,"xF4","0","xC4t");f.AddGuide("yB4",1,"yE4", "yC4t","0");f.AddGuide("xB4",1,"xE4","0","xC4t");f.AddGuide("swAng3",1,"bA4","0","bD3");f.AddGuide("aA5",1,"6600000","0","ha");f.AddGuide("aD5",1,"6600000","ha","0");f.AddGuide("ta51",7,"rw","aA5");f.AddGuide("ta52",12,"rh","aA5");f.AddGuide("bA5",5,"ta51","ta52");f.AddGuide("td51",7,"rw","aD5");f.AddGuide("td52",12,"rh","aD5");f.AddGuide("bD5",5,"td51","td52");f.AddGuide("xD5",1,"w","0","xA4");f.AddGuide("xC5",1,"w","0","xB4");f.AddGuide("xB5",1,"w","0","xC4");f.AddGuide("swAng4",1,"bA5","0","bD4"); f.AddGuide("aD6",1,"9000000","ha","0");f.AddGuide("td61",7,"rw","aD6");f.AddGuide("td62",12,"rh","aD6");f.AddGuide("bD6",5,"td61","td62");f.AddGuide("xD6",1,"w","0","xA3");f.AddGuide("xC6",1,"w","0","xB3");f.AddGuide("xB6",1,"w","0","xC3");f.AddGuide("aD7",1,"11400000","ha","0");f.AddGuide("td71",7,"rw","aD7");f.AddGuide("td72",12,"rh","aD7");f.AddGuide("bD7",5,"td71","td72");f.AddGuide("xD7",1,"w","0","xA2");f.AddGuide("xC7",1,"w","0","xB2");f.AddGuide("xB7",1,"w","0","xC2");f.AddGuide("aD8",1,"13800000", "ha","0");f.AddGuide("td81",7,"rw","aD8");f.AddGuide("td82",12,"rh","aD8");f.AddGuide("bD8",5,"td81","td82");f.AddGuide("xA8",1,"w","0","xD1");f.AddGuide("xD8",1,"w","0","xA1");f.AddGuide("xC8",1,"w","0","xB1");f.AddGuide("xB8",1,"w","0","xC1");f.AddGuide("aA9",1,"_3cd4","0","ha");f.AddGuide("aD9",1,"_3cd4","ha","0");f.AddGuide("td91",7,"rw","aD9");f.AddGuide("td92",12,"rh","aD9");f.AddGuide("bD9",5,"td91","td92");f.AddGuide("ctd9",7,"rh","bD9");f.AddGuide("std9",12,"rw","bD9");f.AddGuide("md9",9, "ctd9","std9","0");f.AddGuide("nd9",0,"rw","rh","md9");f.AddGuide("dxd9",7,"nd9","bD9");f.AddGuide("dyd9",12,"nd9","bD9");f.AddGuide("xD9",1,"hc","dxd9","0");f.AddGuide("yD9",1,"vc","dyd9","0");f.AddGuide("ta91",7,"rw","aA9");f.AddGuide("ta92",12,"rh","aA9");f.AddGuide("bA9",5,"ta91","ta92");f.AddGuide("xA9",1,"hc","0","dxd9");f.AddGuide("xF9",1,"xD9","0","lFD");f.AddGuide("xE9",1,"xA9","lFD","0");f.AddGuide("yC9",1,"yD9","0","th");f.AddGuide("swAng5",1,"bA9","0","bD8");f.AddGuide("xCxn1",2,"xB1", "xC1","2");f.AddGuide("yCxn1",2,"yB1","yC1","2");f.AddGuide("xCxn2",2,"xB2","xC2","2");f.AddGuide("yCxn2",2,"yB2","yC2","2");f.AddGuide("xCxn3",2,"xB3","xC3","2");f.AddGuide("yCxn3",2,"yB3","yC3","2");f.AddGuide("xCxn4",2,"xB4","xC4","2");f.AddGuide("yCxn4",2,"yB4","yC4","2");f.AddGuide("xCxn5",2,"r","0","xCxn4");f.AddGuide("xCxn6",2,"r","0","xCxn3");f.AddGuide("xCxn7",2,"r","0","xCxn2");f.AddGuide("xCxn8",2,"r","0","xCxn1");f.AddHandleXY(undefined,"0","0","adj1","0","20000","xD9","yD9");f.AddHandleXY("adj2", "0","2679",undefined,"0","0","xA9","yD9");f.AddCnx("18600000","xCxn1","yCxn1");f.AddCnx("21000000","xCxn2","yCxn2");f.AddCnx("1800000","xCxn3","yCxn3");f.AddCnx("4200000","xCxn4","yCxn4");f.AddCnx("6600000","xCxn5","yCxn4");f.AddCnx("9000000","xCxn6","yCxn3");f.AddCnx("11400000","xCxn7","yCxn2");f.AddCnx("13800000","xCxn8","yCxn1");f.AddCnx("_3cd4","hc","yC9");f.AddRect("xA8","yD1","xD1","yD3");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"xA1","yA1");f.AddPathCommand(2, "xB1","yB1");f.AddPathCommand(2,"xC1","yC1");f.AddPathCommand(2,"xD1","yD1");f.AddPathCommand(3,"rh","rw","bD1","swAng1");f.AddPathCommand(2,"xB2","yB2");f.AddPathCommand(2,"xC2","yC2");f.AddPathCommand(2,"xD2","yD2");f.AddPathCommand(3,"rh","rw","bD2","swAng2");f.AddPathCommand(2,"xB3","yB3");f.AddPathCommand(2,"xC3","yC3");f.AddPathCommand(2,"xD3","yD3");f.AddPathCommand(3,"rh","rw","bD3","swAng3");f.AddPathCommand(2,"xB4","yB4");f.AddPathCommand(2,"xC4","yC4");f.AddPathCommand(2,"xD4","yD4");f.AddPathCommand(3, "rh","rw","bD4","swAng4");f.AddPathCommand(2,"xB5","yC4");f.AddPathCommand(2,"xC5","yB4");f.AddPathCommand(2,"xD5","yA4");f.AddPathCommand(3,"rh","rw","bD5","swAng3");f.AddPathCommand(2,"xB6","yC3");f.AddPathCommand(2,"xC6","yB3");f.AddPathCommand(2,"xD6","yA3");f.AddPathCommand(3,"rh","rw","bD6","swAng2");f.AddPathCommand(2,"xB7","yC2");f.AddPathCommand(2,"xC7","yB2");f.AddPathCommand(2,"xD7","yA2");f.AddPathCommand(3,"rh","rw","bD7","swAng1");f.AddPathCommand(2,"xB8","yC1");f.AddPathCommand(2,"xC8", "yB1");f.AddPathCommand(2,"xD8","yA1");f.AddPathCommand(3,"rh","rw","bD8","swAng5");f.AddPathCommand(2,"xE9","yC9");f.AddPathCommand(2,"xF9","yC9");f.AddPathCommand(2,"xD9","yD9");f.AddPathCommand(3,"rh","rw","bD9","swAng5");f.AddPathCommand(6);break}case "halfFrame":{f.AddAdj("adj1",15,"33333");f.AddAdj("adj2",15,"33333");f.AddGuide("maxAdj2",0,"100000","w","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("x1",0,"ss","a2","100000");f.AddGuide("g1",0,"h","x1","w");f.AddGuide("g2",1,"h","0", "g1");f.AddGuide("maxAdj1",0,"100000","g2","ss");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("y1",0,"ss","a1","100000");f.AddGuide("dx2",0,"y1","w","h");f.AddGuide("x2",1,"r","0","dx2");f.AddGuide("dy2",0,"x1","h","w");f.AddGuide("y2",1,"b","0","dy2");f.AddGuide("cx1",0,"x1","1","2");f.AddGuide("cy1",2,"y2","b","2");f.AddGuide("cx2",2,"x2","r","2");f.AddGuide("cy2",0,"y1","1","2");f.AddHandleXY(undefined,"0","0","adj1","0","maxAdj1","l","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0", "0","x1","t");f.AddCnx("0","cx2","cy2");f.AddCnx("cd4","cx1","cy1");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "heart":{f.AddGuide("dx1",0,"w","49","48");f.AddGuide("dx2",0,"w","10","48");f.AddGuide("x1", 1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("y1",1,"t","0","hd3");f.AddGuide("il",0,"w","1","6");f.AddGuide("ir",0,"w","5","6");f.AddGuide("ib",0,"h","2","3");f.AddCnx("_3cd4","hc","hd4");f.AddCnx("cd4","hc","b");f.AddRect("il","hd4","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"hc","hd4");f.AddPathCommand(5,"x3","y1","x4","hd4","hc","b");f.AddPathCommand(5, "x1","hd4","x2","y1","hc","hd4");f.AddPathCommand(6);break}case "heptagon":{f.AddAdj("hf",15,"102572");f.AddAdj("vf",15,"105210");f.AddGuide("swd2",0,"wd2","hf","100000");f.AddGuide("shd2",0,"hd2","vf","100000");f.AddGuide("svc",0,"vc","vf","100000");f.AddGuide("dx1",0,"swd2","97493","100000");f.AddGuide("dx2",0,"swd2","78183","100000");f.AddGuide("dx3",0,"swd2","43388","100000");f.AddGuide("dy1",0,"shd2","62349","100000");f.AddGuide("dy2",0,"shd2","22252","100000");f.AddGuide("dy3",0,"shd2","90097", "100000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","0","dx3");f.AddGuide("x4",1,"hc","dx3","0");f.AddGuide("x5",1,"hc","dx2","0");f.AddGuide("x6",1,"hc","dx1","0");f.AddGuide("y1",1,"svc","0","dy1");f.AddGuide("y2",1,"svc","dy2","0");f.AddGuide("y3",1,"svc","dy3","0");f.AddGuide("ib",1,"b","0","y1");f.AddCnx("0","x5","y1");f.AddCnx("0","x6","y2");f.AddCnx("cd4","x4","y3");f.AddCnx("cd4","x3","y3");f.AddCnx("cd2","x1","y2");f.AddCnx("cd2","x2","y1"); f.AddCnx("_3cd4","hc","t");f.AddRect("x2","y1","x5","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y2");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"x5","y1");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(6);break}case "hexagon":{f.AddAdj("adj",15,"25000");f.AddAdj("vf",15,"115470");f.AddGuide("maxAdj",0,"50000","w","ss");f.AddGuide("a",10,"0","adj", "maxAdj");f.AddGuide("shd2",0,"hd2","vf","100000");f.AddGuide("x1",0,"ss","a","100000");f.AddGuide("x2",1,"r","0","x1");f.AddGuide("dy1",12,"shd2","3600000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","dy1","0");f.AddGuide("q1",0,"maxAdj","-1","2");f.AddGuide("q2",1,"a","q1","0");f.AddGuide("q3",3,"q2","4","2");f.AddGuide("q4",3,"q2","3","2");f.AddGuide("q5",3,"q2","q1","0");f.AddGuide("q6",2,"a","q5","q1");f.AddGuide("q7",0,"q6","q4","-1");f.AddGuide("q8",1,"q3","q7","0");f.AddGuide("il", 0,"w","q8","24");f.AddGuide("it",0,"h","q8","24");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","it");f.AddHandleXY("adj","0","maxAdj",undefined,"0","0","x1","t");f.AddCnx("0","r","vc");f.AddCnx("cd4","x2","y2");f.AddCnx("cd4","x1","y2");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","x1","y1");f.AddCnx("_3cd4","x2","y1");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2, "x2","y1");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(6);break}case "homePlate":{f.AddAdj("adj",15,"50000");f.AddGuide("maxAdj",0,"100000","w","ss");f.AddGuide("a",10,"0","adj","maxAdj");f.AddGuide("dx1",0,"ss","a","100000");f.AddGuide("x1",1,"r","0","dx1");f.AddGuide("ir",2,"x1","r","2");f.AddGuide("x2",0,"x1","1","2");f.AddHandleXY("adj","0","maxAdj",undefined,"0","0","x1","t");f.AddCnx("_3cd4","x2","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4", "x1","b");f.AddCnx("0","r","vc");f.AddRect("l","t","ir","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "horizontalScroll":{f.AddAdj("adj",15,"12500");f.AddGuide("a",10,"0","adj","25000");f.AddGuide("ch",0,"ss","a","100000");f.AddGuide("ch2",0,"ch","1","2");f.AddGuide("ch4",0,"ch","1","4");f.AddGuide("y3", 1,"ch","ch2","0");f.AddGuide("y4",1,"ch","ch","0");f.AddGuide("y6",1,"b","0","ch");f.AddGuide("y7",1,"b","0","ch2");f.AddGuide("y5",1,"y6","0","ch2");f.AddGuide("x3",1,"r","0","ch");f.AddGuide("x4",1,"r","0","ch2");f.AddHandleXY("adj","0","25000",undefined,"0","0","ch","t");f.AddCnx("cd4","hc","ch");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","y6");f.AddCnx("0","r","vc");f.AddRect("ch","ch","x4","y6");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"r","ch2");f.AddPathCommand(3, "ch2","ch2","0","cd4");f.AddPathCommand(2,"x4","ch2");f.AddPathCommand(3,"ch4","ch4","0","cd2");f.AddPathCommand(2,"x3","ch");f.AddPathCommand(2,"ch2","ch");f.AddPathCommand(3,"ch2","ch2","_3cd4","-5400000");f.AddPathCommand(2,"l","y7");f.AddPathCommand(3,"ch2","ch2","cd2","-10800000");f.AddPathCommand(2,"ch","y6");f.AddPathCommand(2,"x4","y6");f.AddPathCommand(3,"ch2","ch2","cd4","-5400000");f.AddPathCommand(6);f.AddPathCommand(1,"ch2","y4");f.AddPathCommand(3,"ch2","ch2","cd4","-5400000");f.AddPathCommand(3, "ch4","ch4","0","-10800000");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"ch2","y4");f.AddPathCommand(3,"ch2","ch2","cd4","-5400000");f.AddPathCommand(3,"ch4","ch4","0","-10800000");f.AddPathCommand(6);f.AddPathCommand(1,"x4","ch");f.AddPathCommand(3,"ch2","ch2","cd4","-16200000");f.AddPathCommand(3,"ch4","ch4","cd2","-10800000");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y3"); f.AddPathCommand(3,"ch2","ch2","cd2","cd4");f.AddPathCommand(2,"x3","ch");f.AddPathCommand(2,"x3","ch2");f.AddPathCommand(3,"ch2","ch2","cd2","cd2");f.AddPathCommand(2,"r","y5");f.AddPathCommand(3,"ch2","ch2","0","cd4");f.AddPathCommand(2,"ch","y6");f.AddPathCommand(2,"ch","y7");f.AddPathCommand(3,"ch2","ch2","0","cd2");f.AddPathCommand(6);f.AddPathCommand(1,"x3","ch");f.AddPathCommand(2,"x4","ch");f.AddPathCommand(3,"ch2","ch2","cd4","-5400000");f.AddPathCommand(1,"x4","ch");f.AddPathCommand(2,"x4", "ch2");f.AddPathCommand(3,"ch4","ch4","0","cd2");f.AddPathCommand(1,"ch2","y4");f.AddPathCommand(2,"ch2","y3");f.AddPathCommand(3,"ch4","ch4","cd2","cd2");f.AddPathCommand(3,"ch2","ch2","0","cd2");f.AddPathCommand(1,"ch","y3");f.AddPathCommand(2,"ch","y6");break}case "irregularSeal1":{f.AddGuide("x5",0,"w","4627","21600");f.AddGuide("x12",0,"w","8485","21600");f.AddGuide("x21",0,"w","16702","21600");f.AddGuide("x24",0,"w","14522","21600");f.AddGuide("y3",0,"h","6320","21600");f.AddGuide("y6",0,"h", "8615","21600");f.AddGuide("y9",0,"h","13937","21600");f.AddGuide("y18",0,"h","13290","21600");f.AddCnx("_3cd4","x24","t");f.AddCnx("cd2","l","y6");f.AddCnx("cd4","x12","b");f.AddCnx("0","r","y18");f.AddRect("x5","y3","x21","y9");f.AddPathCommand(0,undefined,undefined,undefined,21600,21600);f.AddPathCommand(1,"10800","5800");f.AddPathCommand(2,"14522","0");f.AddPathCommand(2,"14155","5325");f.AddPathCommand(2,"18380","4457");f.AddPathCommand(2,"16702","7315");f.AddPathCommand(2,"21097","8137");f.AddPathCommand(2, "17607","10475");f.AddPathCommand(2,"21600","13290");f.AddPathCommand(2,"16837","12942");f.AddPathCommand(2,"18145","18095");f.AddPathCommand(2,"14020","14457");f.AddPathCommand(2,"13247","19737");f.AddPathCommand(2,"10532","14935");f.AddPathCommand(2,"8485","21600");f.AddPathCommand(2,"7715","15627");f.AddPathCommand(2,"4762","17617");f.AddPathCommand(2,"5667","13937");f.AddPathCommand(2,"135","14587");f.AddPathCommand(2,"3722","11775");f.AddPathCommand(2,"0","8615");f.AddPathCommand(2,"4627","7617"); f.AddPathCommand(2,"370","2295");f.AddPathCommand(2,"7312","6320");f.AddPathCommand(2,"8352","2295");f.AddPathCommand(6);break}case "irregularSeal2":{f.AddGuide("x2",0,"w","9722","21600");f.AddGuide("x5",0,"w","5372","21600");f.AddGuide("x16",0,"w","11612","21600");f.AddGuide("x19",0,"w","14640","21600");f.AddGuide("y2",0,"h","1887","21600");f.AddGuide("y3",0,"h","6382","21600");f.AddGuide("y8",0,"h","12877","21600");f.AddGuide("y14",0,"h","19712","21600");f.AddGuide("y16",0,"h","18842","21600"); f.AddGuide("y17",0,"h","15935","21600");f.AddGuide("y24",0,"h","6645","21600");f.AddCnx("_3cd4","x2","y2");f.AddCnx("cd2","l","y8");f.AddCnx("cd4","x16","y16");f.AddCnx("0","r","y24");f.AddRect("x5","y3","x19","y17");f.AddPathCommand(0,undefined,undefined,undefined,21600,21600);f.AddPathCommand(1,"11462","4342");f.AddPathCommand(2,"14790","0");f.AddPathCommand(2,"14525","5777");f.AddPathCommand(2,"18007","3172");f.AddPathCommand(2,"16380","6532");f.AddPathCommand(2,"21600","6645");f.AddPathCommand(2, "16985","9402");f.AddPathCommand(2,"18270","11290");f.AddPathCommand(2,"16380","12310");f.AddPathCommand(2,"18877","15632");f.AddPathCommand(2,"14640","14350");f.AddPathCommand(2,"14942","17370");f.AddPathCommand(2,"12180","15935");f.AddPathCommand(2,"11612","18842");f.AddPathCommand(2,"9872","17370");f.AddPathCommand(2,"8700","19712");f.AddPathCommand(2,"7527","18125");f.AddPathCommand(2,"4917","21600");f.AddPathCommand(2,"4805","18240");f.AddPathCommand(2,"1285","17825");f.AddPathCommand(2,"3330", "15370");f.AddPathCommand(2,"0","12877");f.AddPathCommand(2,"3935","11592");f.AddPathCommand(2,"1172","8270");f.AddPathCommand(2,"5372","7817");f.AddPathCommand(2,"4502","3625");f.AddPathCommand(2,"8550","6382");f.AddPathCommand(2,"9722","1887");f.AddPathCommand(6);break}case "leftArrow":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj2",0,"100000","w","ss");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("dx2",0,"ss","a2","100000"); f.AddGuide("x2",1,"l","dx2","0");f.AddGuide("dy1",0,"h","a1","200000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","dy1","0");f.AddGuide("dx1",0,"y1","dx2","hd2");f.AddGuide("x1",1,"x2","0","dx1");f.AddHandleXY(undefined,"0","0","adj1","0","100000","r","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x2","t");f.AddCnx("_3cd4","x2","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","x2","b");f.AddCnx("0","r","vc");f.AddRect("x1","y1","r","y2");f.AddPathCommand(0,undefined,undefined, undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"r","y1");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","b");f.AddPathCommand(6);break}case "upArrow":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj2",0,"100000","h","ss");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("dy2",0,"ss","a2","100000");f.AddGuide("y2", 1,"t","dy2","0");f.AddGuide("dx1",0,"w","a1","200000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","dx1","0");f.AddGuide("dy1",0,"x1","dy2","wd2");f.AddGuide("y1",1,"y2","0","dy1");f.AddHandleXY("adj1","0","100000",undefined,"0","0","x1","b");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","l","y2");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","y2");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","y2");f.AddRect("x1","y1","x2","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined, undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(6);break}case "leftArrowCallout":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddAdj("adj4",15,"64977");f.AddGuide("maxAdj2",0,"50000","h","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1", 10,"0","adj1","maxAdj1");f.AddGuide("maxAdj3",0,"100000","w","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("q2",0,"a3","ss","w");f.AddGuide("maxAdj4",1,"100000","0","q2");f.AddGuide("a4",10,"0","adj4","maxAdj4");f.AddGuide("dy1",0,"ss","a2","100000");f.AddGuide("dy2",0,"ss","a1","200000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","dy2","0");f.AddGuide("y4",1,"vc","dy1","0");f.AddGuide("x1",0,"ss","a3","100000");f.AddGuide("dx2",0,"w","a4", "100000");f.AddGuide("x2",1,"r","0","dx2");f.AddGuide("x3",2,"x2","r","2");f.AddHandleXY(undefined,"0","0","adj1","0","maxAdj1","x1","y2");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","l","y1");f.AddHandleXY("adj3","0","maxAdj3",undefined,"0","0","x1","t");f.AddHandleXY("adj4","0","maxAdj4",undefined,"0","0","x2","b");f.AddCnx("_3cd4","x3","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","x3","b");f.AddCnx("0","r","vc");f.AddRect("x2","t","r","b");f.AddPathCommand(0,undefined,undefined,undefined, undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(6);break}case "leftBrace":{f.AddAdj("adj1",15,"8333");f.AddAdj("adj2",15,"50000");f.AddGuide("a2",10,"0","adj2","100000");f.AddGuide("q1",1, "100000","0","a2");f.AddGuide("q2",16,"q1","a2");f.AddGuide("q3",0,"q2","1","2");f.AddGuide("maxAdj1",0,"q3","h","ss");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("y1",0,"ss","a1","100000");f.AddGuide("y3",0,"h","a2","100000");f.AddGuide("y4",1,"y3","y1","0");f.AddGuide("dx1",7,"wd2","2700000");f.AddGuide("dy1",12,"y1","2700000");f.AddGuide("il",1,"r","0","dx1");f.AddGuide("it",1,"y1","0","dy1");f.AddGuide("ib",1,"b","dy1","y1");f.AddHandleXY(undefined,"0","0","adj1","0","maxAdj1","hc","y1"); f.AddHandleXY(undefined,"0","0","adj2","0","100000","l","y3");f.AddCnx("cd4","r","t");f.AddCnx("cd2","l","y3");f.AddCnx("_3cd4","r","b");f.AddRect("il","it","r","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"r","b");f.AddPathCommand(3,"wd2","y1","cd4","cd4");f.AddPathCommand(2,"hc","y4");f.AddPathCommand(3,"wd2","y1","0","-5400000");f.AddPathCommand(3,"wd2","y1","cd4","-5400000");f.AddPathCommand(2,"hc","y1");f.AddPathCommand(3,"wd2","y1","cd2","cd4");f.AddPathCommand(6); f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"r","b");f.AddPathCommand(3,"wd2","y1","cd4","cd4");f.AddPathCommand(2,"hc","y4");f.AddPathCommand(3,"wd2","y1","0","-5400000");f.AddPathCommand(3,"wd2","y1","cd4","-5400000");f.AddPathCommand(2,"hc","y1");f.AddPathCommand(3,"wd2","y1","cd2","cd4");break}case "leftBracket":{f.AddAdj("adj",15,"8333");f.AddGuide("maxAdj",0,"50000","h","ss");f.AddGuide("a",10,"0","adj","maxAdj");f.AddGuide("y1",0,"ss","a","100000"); f.AddGuide("y2",1,"b","0","y1");f.AddGuide("dx1",7,"w","2700000");f.AddGuide("dy1",12,"y1","2700000");f.AddGuide("il",1,"r","0","dx1");f.AddGuide("it",1,"y1","0","dy1");f.AddGuide("ib",1,"b","dy1","y1");f.AddHandleXY(undefined,"0","0","adj","0","maxAdj","l","y1");f.AddCnx("cd4","r","t");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","r","b");f.AddRect("il","it","r","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"r","b");f.AddPathCommand(3,"w","y1","cd4","cd4");f.AddPathCommand(2, "l","y1");f.AddPathCommand(3,"w","y1","cd2","cd4");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"r","b");f.AddPathCommand(3,"w","y1","cd4","cd4");f.AddPathCommand(2,"l","y1");f.AddPathCommand(3,"w","y1","cd2","cd4");break}case "leftCircularArrow":{f.AddAdj("adj1",15,"12500");f.AddAdj("adj2",15,"-1142319");f.AddAdj("adj3",15,"1142319");f.AddAdj("adj4",15,"10800000");f.AddAdj("adj5",15,"12500");f.AddGuide("a5",10,"0","adj5","25000");f.AddGuide("maxAdj1", 0,"a5","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("enAng",10,"1","adj3","21599999");f.AddGuide("stAng",10,"0","adj4","21599999");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("thh",0,"ss","a5","100000");f.AddGuide("th2",0,"th","1","2");f.AddGuide("rw1",1,"wd2","th2","thh");f.AddGuide("rh1",1,"hd2","th2","thh");f.AddGuide("rw2",1,"rw1","0","th");f.AddGuide("rh2",1,"rh1","0","th");f.AddGuide("rw3",1,"rw2","th2","0");f.AddGuide("rh3",1,"rh2","th2","0");f.AddGuide("wtH",12,"rw3", "enAng");f.AddGuide("htH",7,"rh3","enAng");f.AddGuide("dxH",6,"rw3","htH","wtH");f.AddGuide("dyH",11,"rh3","htH","wtH");f.AddGuide("xH",1,"hc","dxH","0");f.AddGuide("yH",1,"vc","dyH","0");f.AddGuide("rI",16,"rw2","rh2");f.AddGuide("u1",0,"dxH","dxH","1");f.AddGuide("u2",0,"dyH","dyH","1");f.AddGuide("u3",0,"rI","rI","1");f.AddGuide("u4",1,"u1","0","u3");f.AddGuide("u5",1,"u2","0","u3");f.AddGuide("u6",0,"u4","u5","u1");f.AddGuide("u7",0,"u6","1","u2");f.AddGuide("u8",1,"1","0","u7");f.AddGuide("u9", 13,"u8");f.AddGuide("u10",0,"u4","1","dxH");f.AddGuide("u11",0,"u10","1","dyH");f.AddGuide("u12",2,"1","u9","u11");f.AddGuide("u13",5,"1","u12");f.AddGuide("u14",1,"u13","21600000","0");f.AddGuide("u15",3,"u13","u13","u14");f.AddGuide("u16",1,"u15","0","enAng");f.AddGuide("u17",1,"u16","21600000","0");f.AddGuide("u18",3,"u16","u16","u17");f.AddGuide("u19",1,"u18","0","cd2");f.AddGuide("u20",1,"u18","0","21600000");f.AddGuide("u21",3,"u19","u20","u18");f.AddGuide("u22",4,"u21");f.AddGuide("minAng", 0,"u22","-1","1");f.AddGuide("u23",4,"adj2");f.AddGuide("a2",0,"u23","-1","1");f.AddGuide("aAng",10,"minAng","a2","0");f.AddGuide("ptAng",1,"enAng","aAng","0");f.AddGuide("wtA",12,"rw3","ptAng");f.AddGuide("htA",7,"rh3","ptAng");f.AddGuide("dxA",6,"rw3","htA","wtA");f.AddGuide("dyA",11,"rh3","htA","wtA");f.AddGuide("xA",1,"hc","dxA","0");f.AddGuide("yA",1,"vc","dyA","0");f.AddGuide("wtE",12,"rw1","stAng");f.AddGuide("htE",7,"rh1","stAng");f.AddGuide("dxE",6,"rw1","htE","wtE");f.AddGuide("dyE",11, "rh1","htE","wtE");f.AddGuide("xE",1,"hc","dxE","0");f.AddGuide("yE",1,"vc","dyE","0");f.AddGuide("wtD",12,"rw2","stAng");f.AddGuide("htD",7,"rh2","stAng");f.AddGuide("dxD",6,"rw2","htD","wtD");f.AddGuide("dyD",11,"rh2","htD","wtD");f.AddGuide("xD",1,"hc","dxD","0");f.AddGuide("yD",1,"vc","dyD","0");f.AddGuide("dxG",7,"thh","ptAng");f.AddGuide("dyG",12,"thh","ptAng");f.AddGuide("xG",1,"xH","dxG","0");f.AddGuide("yG",1,"yH","dyG","0");f.AddGuide("dxB",7,"thh","ptAng");f.AddGuide("dyB",12,"thh","ptAng"); f.AddGuide("xB",1,"xH","0","dxB","0");f.AddGuide("yB",1,"yH","0","dyB","0");f.AddGuide("sx1",1,"xB","0","hc");f.AddGuide("sy1",1,"yB","0","vc");f.AddGuide("sx2",1,"xG","0","hc");f.AddGuide("sy2",1,"yG","0","vc");f.AddGuide("rO",16,"rw1","rh1");f.AddGuide("x1O",0,"sx1","rO","rw1");f.AddGuide("y1O",0,"sy1","rO","rh1");f.AddGuide("x2O",0,"sx2","rO","rw1");f.AddGuide("y2O",0,"sy2","rO","rh1");f.AddGuide("dxO",1,"x2O","0","x1O");f.AddGuide("dyO",1,"y2O","0","y1O");f.AddGuide("dO",9,"dxO","dyO","0");f.AddGuide("q1", 0,"x1O","y2O","1");f.AddGuide("q2",0,"x2O","y1O","1");f.AddGuide("DO",1,"q1","0","q2");f.AddGuide("q3",0,"rO","rO","1");f.AddGuide("q4",0,"dO","dO","1");f.AddGuide("q5",0,"q3","q4","1");f.AddGuide("q6",0,"DO","DO","1");f.AddGuide("q7",1,"q5","0","q6");f.AddGuide("q8",8,"q7","0");f.AddGuide("sdelO",13,"q8");f.AddGuide("ndyO",0,"dyO","-1","1");f.AddGuide("sdyO",3,"ndyO","-1","1");f.AddGuide("q9",0,"sdyO","dxO","1");f.AddGuide("q10",0,"q9","sdelO","1");f.AddGuide("q11",0,"DO","dyO","1");f.AddGuide("dxF1", 2,"q11","q10","q4");f.AddGuide("q12",1,"q11","0","q10");f.AddGuide("dxF2",0,"q12","1","q4");f.AddGuide("adyO",4,"dyO");f.AddGuide("q13",0,"adyO","sdelO","1");f.AddGuide("q14",0,"DO","dxO","-1");f.AddGuide("dyF1",2,"q14","q13","q4");f.AddGuide("q15",1,"q14","0","q13");f.AddGuide("dyF2",0,"q15","1","q4");f.AddGuide("q16",1,"x2O","0","dxF1");f.AddGuide("q17",1,"x2O","0","dxF2");f.AddGuide("q18",1,"y2O","0","dyF1");f.AddGuide("q19",1,"y2O","0","dyF2");f.AddGuide("q20",9,"q16","q18","0");f.AddGuide("q21", 9,"q17","q19","0");f.AddGuide("q22",1,"q21","0","q20");f.AddGuide("dxF",3,"q22","dxF1","dxF2");f.AddGuide("dyF",3,"q22","dyF1","dyF2");f.AddGuide("sdxF",0,"dxF","rw1","rO");f.AddGuide("sdyF",0,"dyF","rh1","rO");f.AddGuide("xF",1,"hc","sdxF","0");f.AddGuide("yF",1,"vc","sdyF","0");f.AddGuide("x1I",0,"sx1","rI","rw2");f.AddGuide("y1I",0,"sy1","rI","rh2");f.AddGuide("x2I",0,"sx2","rI","rw2");f.AddGuide("y2I",0,"sy2","rI","rh2");f.AddGuide("dxI",1,"x2I","0","x1I");f.AddGuide("dyI",1,"y2I","0","y1I"); f.AddGuide("dI",9,"dxI","dyI","0");f.AddGuide("v1",0,"x1I","y2I","1");f.AddGuide("v2",0,"x2I","y1I","1");f.AddGuide("DI",1,"v1","0","v2");f.AddGuide("v3",0,"rI","rI","1");f.AddGuide("v4",0,"dI","dI","1");f.AddGuide("v5",0,"v3","v4","1");f.AddGuide("v6",0,"DI","DI","1");f.AddGuide("v7",1,"v5","0","v6");f.AddGuide("v8",8,"v7","0");f.AddGuide("sdelI",13,"v8");f.AddGuide("v9",0,"sdyO","dxI","1");f.AddGuide("v10",0,"v9","sdelI","1");f.AddGuide("v11",0,"DI","dyI","1");f.AddGuide("dxC1",2,"v11","v10","v4"); f.AddGuide("v12",1,"v11","0","v10");f.AddGuide("dxC2",0,"v12","1","v4");f.AddGuide("adyI",4,"dyI");f.AddGuide("v13",0,"adyI","sdelI","1");f.AddGuide("v14",0,"DI","dxI","-1");f.AddGuide("dyC1",2,"v14","v13","v4");f.AddGuide("v15",1,"v14","0","v13");f.AddGuide("dyC2",0,"v15","1","v4");f.AddGuide("v16",1,"x1I","0","dxC1");f.AddGuide("v17",1,"x1I","0","dxC2");f.AddGuide("v18",1,"y1I","0","dyC1");f.AddGuide("v19",1,"y1I","0","dyC2");f.AddGuide("v20",9,"v16","v18","0");f.AddGuide("v21",9,"v17","v19","0"); f.AddGuide("v22",1,"v21","0","v20");f.AddGuide("dxC",3,"v22","dxC1","dxC2");f.AddGuide("dyC",3,"v22","dyC1","dyC2");f.AddGuide("sdxC",0,"dxC","rw2","rI");f.AddGuide("sdyC",0,"dyC","rh2","rI");f.AddGuide("xC",1,"hc","sdxC","0");f.AddGuide("yC",1,"vc","sdyC","0");f.AddGuide("ist0",5,"sdxC","sdyC");f.AddGuide("ist1",1,"ist0","21600000","0");f.AddGuide("istAng0",3,"ist0","ist0","ist1");f.AddGuide("isw1",1,"stAng","0","istAng0");f.AddGuide("isw2",1,"isw1","21600000","0");f.AddGuide("iswAng0",3,"isw1", "isw1","isw2");f.AddGuide("istAng",1,"istAng0","iswAng0","0");f.AddGuide("iswAng",1,"0","0","iswAng0");f.AddGuide("p1",1,"xF","0","xC");f.AddGuide("p2",1,"yF","0","yC");f.AddGuide("p3",9,"p1","p2","0");f.AddGuide("p4",0,"p3","1","2");f.AddGuide("p5",1,"p4","0","thh");f.AddGuide("xGp",3,"p5","xF","xG");f.AddGuide("yGp",3,"p5","yF","yG");f.AddGuide("xBp",3,"p5","xC","xB");f.AddGuide("yBp",3,"p5","yC","yB");f.AddGuide("en0",5,"sdxF","sdyF");f.AddGuide("en1",1,"en0","21600000","0");f.AddGuide("en2",3, "en0","en0","en1");f.AddGuide("sw0",1,"en2","0","stAng");f.AddGuide("sw1",1,"sw0","0","21600000");f.AddGuide("swAng",3,"sw0","sw1","sw0");f.AddGuide("stAng0",1,"stAng","swAng","0");f.AddGuide("swAng0",1,"0","0","swAng");f.AddGuide("wtI",12,"rw3","stAng");f.AddGuide("htI",7,"rh3","stAng");f.AddGuide("dxI",6,"rw3","htI","wtI");f.AddGuide("dyI",11,"rh3","htI","wtI");f.AddGuide("xI",1,"hc","dxI","0");f.AddGuide("yI",1,"vc","dyI","0");f.AddGuide("aI",1,"stAng","cd4","0");f.AddGuide("aA",1,"ptAng","0", "cd4");f.AddGuide("aB",1,"ptAng","cd2","0");f.AddGuide("idx",7,"rw1","2700000");f.AddGuide("idy",12,"rh1","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddHandlePolar("adj2","minAng","0",undefined,"0","0","xA","yA");f.AddHandlePolar("adj4","0","21599999",undefined,"0","0","xE","yE");f.AddHandlePolar(undefined,"0","0","adj1","0","maxAdj1","xF","yF");f.AddHandlePolar(undefined,"0","0","adj5","0","25000", "xB","yB");f.AddCnx("aI","xI","yI");f.AddCnx("ptAng","xGp","yGp");f.AddCnx("aA","xA","yA");f.AddCnx("aB","xBp","yBp");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"xE","yE");f.AddPathCommand(2,"xD","yD");f.AddPathCommand(3,"rw2","rh2","istAng","iswAng");f.AddPathCommand(2,"xBp","yBp");f.AddPathCommand(2,"xA","yA");f.AddPathCommand(2,"xGp","yGp");f.AddPathCommand(2,"xF","yF");f.AddPathCommand(3,"rw1","rh1","stAng0","swAng0"); f.AddPathCommand(6);break}case "leftRightArrow":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj2",0,"50000","w","ss");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("x2",0,"ss","a2","100000");f.AddGuide("x3",1,"r","0","x2");f.AddGuide("dy",0,"h","a1","200000");f.AddGuide("y1",1,"vc","0","dy");f.AddGuide("y2",1,"vc","dy","0");f.AddGuide("dx1",0,"y1","x2","hd2");f.AddGuide("x1",1,"x2","0","dx1");f.AddGuide("x4",1,"x3","dx1","0"); f.AddHandleXY(undefined,"0","0","adj1","0","100000","x3","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x2","t");f.AddCnx("0","r","vc");f.AddCnx("cd4","x3","b");f.AddCnx("cd4","x2","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","x2","t");f.AddCnx("_3cd4","x3","t");f.AddRect("x1","y1","x4","y2");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2, "x3","t");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x3","b");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","b");f.AddPathCommand(6);break}case "leftRightArrowCallout":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddAdj("adj4",15,"48123");f.AddGuide("maxAdj2",0,"50000","h","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("maxAdj3", 0,"50000","w","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("q2",0,"a3","ss","wd2");f.AddGuide("maxAdj4",1,"100000","0","q2");f.AddGuide("a4",10,"0","adj4","maxAdj4");f.AddGuide("dy1",0,"ss","a2","100000");f.AddGuide("dy2",0,"ss","a1","200000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","dy2","0");f.AddGuide("y4",1,"vc","dy1","0");f.AddGuide("x1",0,"ss","a3","100000");f.AddGuide("x4",1,"r","0","x1");f.AddGuide("dx2",0,"w","a4","200000"); f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddHandleXY(undefined,"0","0","adj1","0","maxAdj1","x1","y2");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","l","y1");f.AddHandleXY("adj3","0","maxAdj3",undefined,"0","0","x1","t");f.AddHandleXY("adj4","0","maxAdj4",undefined,"0","0","x2","b");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("x2","t","x3","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined, undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"x3","t");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2,"x4","y2");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x3","b");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(2, "x1","y3");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(6);break}case "leftRightCircularArrow":{f.AddAdj("adj1",15,"12500");f.AddAdj("adj2",15,"1142319");f.AddAdj("adj3",15,"20457681");f.AddAdj("adj4",15,"11942319");f.AddAdj("adj5",15,"12500");f.AddGuide("a5",10,"0","adj5","25000");f.AddGuide("maxAdj1",0,"a5","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("enAng",10,"1","adj3","21599999");f.AddGuide("stAng",10,"0","adj4","21599999");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("thh", 0,"ss","a5","100000");f.AddGuide("th2",0,"th","1","2");f.AddGuide("rw1",1,"wd2","th2","thh");f.AddGuide("rh1",1,"hd2","th2","thh");f.AddGuide("rw2",1,"rw1","0","th");f.AddGuide("rh2",1,"rh1","0","th");f.AddGuide("rw3",1,"rw2","th2","0");f.AddGuide("rh3",1,"rh2","th2","0");f.AddGuide("wtH",12,"rw3","enAng");f.AddGuide("htH",7,"rh3","enAng");f.AddGuide("dxH",6,"rw3","htH","wtH");f.AddGuide("dyH",11,"rh3","htH","wtH");f.AddGuide("xH",1,"hc","dxH","0");f.AddGuide("yH",1,"vc","dyH","0");f.AddGuide("rI", 16,"rw2","rh2");f.AddGuide("u1",0,"dxH","dxH","1");f.AddGuide("u2",0,"dyH","dyH","1");f.AddGuide("u3",0,"rI","rI","1");f.AddGuide("u4",1,"u1","0","u3");f.AddGuide("u5",1,"u2","0","u3");f.AddGuide("u6",0,"u4","u5","u1");f.AddGuide("u7",0,"u6","1","u2");f.AddGuide("u8",1,"1","0","u7");f.AddGuide("u9",13,"u8");f.AddGuide("u10",0,"u4","1","dxH");f.AddGuide("u11",0,"u10","1","dyH");f.AddGuide("u12",2,"1","u9","u11");f.AddGuide("u13",5,"1","u12");f.AddGuide("u14",1,"u13","21600000","0");f.AddGuide("u15", 3,"u13","u13","u14");f.AddGuide("u16",1,"u15","0","enAng");f.AddGuide("u17",1,"u16","21600000","0");f.AddGuide("u18",3,"u16","u16","u17");f.AddGuide("u19",1,"u18","0","cd2");f.AddGuide("u20",1,"u18","0","21600000");f.AddGuide("u21",3,"u19","u20","u18");f.AddGuide("maxAng",4,"u21");f.AddGuide("aAng",10,"0","adj2","maxAng");f.AddGuide("ptAng",1,"enAng","aAng","0");f.AddGuide("wtA",12,"rw3","ptAng");f.AddGuide("htA",7,"rh3","ptAng");f.AddGuide("dxA",6,"rw3","htA","wtA");f.AddGuide("dyA",11,"rh3","htA", "wtA");f.AddGuide("xA",1,"hc","dxA","0");f.AddGuide("yA",1,"vc","dyA","0");f.AddGuide("dxG",7,"thh","ptAng");f.AddGuide("dyG",12,"thh","ptAng");f.AddGuide("xG",1,"xH","dxG","0");f.AddGuide("yG",1,"yH","dyG","0");f.AddGuide("dxB",7,"thh","ptAng");f.AddGuide("dyB",12,"thh","ptAng");f.AddGuide("xB",1,"xH","0","dxB","0");f.AddGuide("yB",1,"yH","0","dyB","0");f.AddGuide("sx1",1,"xB","0","hc");f.AddGuide("sy1",1,"yB","0","vc");f.AddGuide("sx2",1,"xG","0","hc");f.AddGuide("sy2",1,"yG","0","vc");f.AddGuide("rO", 16,"rw1","rh1");f.AddGuide("x1O",0,"sx1","rO","rw1");f.AddGuide("y1O",0,"sy1","rO","rh1");f.AddGuide("x2O",0,"sx2","rO","rw1");f.AddGuide("y2O",0,"sy2","rO","rh1");f.AddGuide("dxO",1,"x2O","0","x1O");f.AddGuide("dyO",1,"y2O","0","y1O");f.AddGuide("dO",9,"dxO","dyO","0");f.AddGuide("q1",0,"x1O","y2O","1");f.AddGuide("q2",0,"x2O","y1O","1");f.AddGuide("DO",1,"q1","0","q2");f.AddGuide("q3",0,"rO","rO","1");f.AddGuide("q4",0,"dO","dO","1");f.AddGuide("q5",0,"q3","q4","1");f.AddGuide("q6",0,"DO","DO", "1");f.AddGuide("q7",1,"q5","0","q6");f.AddGuide("q8",8,"q7","0");f.AddGuide("sdelO",13,"q8");f.AddGuide("ndyO",0,"dyO","-1","1");f.AddGuide("sdyO",3,"ndyO","-1","1");f.AddGuide("q9",0,"sdyO","dxO","1");f.AddGuide("q10",0,"q9","sdelO","1");f.AddGuide("q11",0,"DO","dyO","1");f.AddGuide("dxF1",2,"q11","q10","q4");f.AddGuide("q12",1,"q11","0","q10");f.AddGuide("dxF2",0,"q12","1","q4");f.AddGuide("adyO",4,"dyO");f.AddGuide("q13",0,"adyO","sdelO","1");f.AddGuide("q14",0,"DO","dxO","-1");f.AddGuide("dyF1", 2,"q14","q13","q4");f.AddGuide("q15",1,"q14","0","q13");f.AddGuide("dyF2",0,"q15","1","q4");f.AddGuide("q16",1,"x2O","0","dxF1");f.AddGuide("q17",1,"x2O","0","dxF2");f.AddGuide("q18",1,"y2O","0","dyF1");f.AddGuide("q19",1,"y2O","0","dyF2");f.AddGuide("q20",9,"q16","q18","0");f.AddGuide("q21",9,"q17","q19","0");f.AddGuide("q22",1,"q21","0","q20");f.AddGuide("dxF",3,"q22","dxF1","dxF2");f.AddGuide("dyF",3,"q22","dyF1","dyF2");f.AddGuide("sdxF",0,"dxF","rw1","rO");f.AddGuide("sdyF",0,"dyF","rh1","rO"); f.AddGuide("xF",1,"hc","sdxF","0");f.AddGuide("yF",1,"vc","sdyF","0");f.AddGuide("x1I",0,"sx1","rI","rw2");f.AddGuide("y1I",0,"sy1","rI","rh2");f.AddGuide("x2I",0,"sx2","rI","rw2");f.AddGuide("y2I",0,"sy2","rI","rh2");f.AddGuide("dxI",1,"x2I","0","x1I");f.AddGuide("dyI",1,"y2I","0","y1I");f.AddGuide("dI",9,"dxI","dyI","0");f.AddGuide("v1",0,"x1I","y2I","1");f.AddGuide("v2",0,"x2I","y1I","1");f.AddGuide("DI",1,"v1","0","v2");f.AddGuide("v3",0,"rI","rI","1");f.AddGuide("v4",0,"dI","dI","1");f.AddGuide("v5", 0,"v3","v4","1");f.AddGuide("v6",0,"DI","DI","1");f.AddGuide("v7",1,"v5","0","v6");f.AddGuide("v8",8,"v7","0");f.AddGuide("sdelI",13,"v8");f.AddGuide("v9",0,"sdyO","dxI","1");f.AddGuide("v10",0,"v9","sdelI","1");f.AddGuide("v11",0,"DI","dyI","1");f.AddGuide("dxC1",2,"v11","v10","v4");f.AddGuide("v12",1,"v11","0","v10");f.AddGuide("dxC2",0,"v12","1","v4");f.AddGuide("adyI",4,"dyI");f.AddGuide("v13",0,"adyI","sdelI","1");f.AddGuide("v14",0,"DI","dxI","-1");f.AddGuide("dyC1",2,"v14","v13","v4");f.AddGuide("v15", 1,"v14","0","v13");f.AddGuide("dyC2",0,"v15","1","v4");f.AddGuide("v16",1,"x1I","0","dxC1");f.AddGuide("v17",1,"x1I","0","dxC2");f.AddGuide("v18",1,"y1I","0","dyC1");f.AddGuide("v19",1,"y1I","0","dyC2");f.AddGuide("v20",9,"v16","v18","0");f.AddGuide("v21",9,"v17","v19","0");f.AddGuide("v22",1,"v21","0","v20");f.AddGuide("dxC",3,"v22","dxC1","dxC2");f.AddGuide("dyC",3,"v22","dyC1","dyC2");f.AddGuide("sdxC",0,"dxC","rw2","rI");f.AddGuide("sdyC",0,"dyC","rh2","rI");f.AddGuide("xC",1,"hc","sdxC","0"); f.AddGuide("yC",1,"vc","sdyC","0");f.AddGuide("wtI",12,"rw3","stAng");f.AddGuide("htI",7,"rh3","stAng");f.AddGuide("dxI",6,"rw3","htI","wtI");f.AddGuide("dyI",11,"rh3","htI","wtI");f.AddGuide("xI",1,"hc","dxI","0");f.AddGuide("yI",1,"vc","dyI","0");f.AddGuide("lptAng",1,"stAng","0","aAng");f.AddGuide("wtL",12,"rw3","lptAng");f.AddGuide("htL",7,"rh3","lptAng");f.AddGuide("dxL",6,"rw3","htL","wtL");f.AddGuide("dyL",11,"rh3","htL","wtL");f.AddGuide("xL",1,"hc","dxL","0");f.AddGuide("yL",1,"vc","dyL", "0");f.AddGuide("dxK",7,"thh","lptAng");f.AddGuide("dyK",12,"thh","lptAng");f.AddGuide("xK",1,"xI","dxK","0");f.AddGuide("yK",1,"yI","dyK","0");f.AddGuide("dxJ",7,"thh","lptAng");f.AddGuide("dyJ",12,"thh","lptAng");f.AddGuide("xJ",1,"xI","0","dxJ","0");f.AddGuide("yJ",1,"yI","0","dyJ","0");f.AddGuide("p1",1,"xF","0","xC");f.AddGuide("p2",1,"yF","0","yC");f.AddGuide("p3",9,"p1","p2","0");f.AddGuide("p4",0,"p3","1","2");f.AddGuide("p5",1,"p4","0","thh");f.AddGuide("xGp",3,"p5","xF","xG");f.AddGuide("yGp", 3,"p5","yF","yG");f.AddGuide("xBp",3,"p5","xC","xB");f.AddGuide("yBp",3,"p5","yC","yB");f.AddGuide("en0",5,"sdxF","sdyF");f.AddGuide("en1",1,"en0","21600000","0");f.AddGuide("en2",3,"en0","en0","en1");f.AddGuide("od0",1,"en2","0","enAng");f.AddGuide("od1",1,"od0","21600000","0");f.AddGuide("od2",3,"od0","od0","od1");f.AddGuide("st0",1,"stAng","0","od2");f.AddGuide("st1",1,"st0","21600000","0");f.AddGuide("st2",3,"st0","st0","st1");f.AddGuide("sw0",1,"en2","0","st2");f.AddGuide("sw1",1,"sw0","21600000", "0");f.AddGuide("swAng",3,"sw0","sw0","sw1");f.AddGuide("ist0",5,"sdxC","sdyC");f.AddGuide("ist1",1,"ist0","21600000","0");f.AddGuide("istAng",3,"ist0","ist0","ist1");f.AddGuide("id0",1,"istAng","0","enAng");f.AddGuide("id1",1,"id0","0","21600000");f.AddGuide("id2",3,"id0","id1","id0");f.AddGuide("ien0",1,"stAng","0","id2");f.AddGuide("ien1",1,"ien0","0","21600000");f.AddGuide("ien2",3,"ien1","ien1","ien0");f.AddGuide("isw1",1,"ien2","0","istAng");f.AddGuide("isw2",1,"isw1","0","21600000");f.AddGuide("iswAng", 3,"isw1","isw2","isw1");f.AddGuide("wtE",12,"rw1","st2");f.AddGuide("htE",7,"rh1","st2");f.AddGuide("dxE",6,"rw1","htE","wtE");f.AddGuide("dyE",11,"rh1","htE","wtE");f.AddGuide("xE",1,"hc","dxE","0");f.AddGuide("yE",1,"vc","dyE","0");f.AddGuide("wtD",12,"rw2","ien2");f.AddGuide("htD",7,"rh2","ien2");f.AddGuide("dxD",6,"rw2","htD","wtD");f.AddGuide("dyD",11,"rh2","htD","wtD");f.AddGuide("xD",1,"hc","dxD","0");f.AddGuide("yD",1,"vc","dyD","0");f.AddGuide("xKp",3,"p5","xE","xK");f.AddGuide("yKp",3,"p5", "yE","yK");f.AddGuide("xJp",3,"p5","xD","xJ");f.AddGuide("yJp",3,"p5","yD","yJ");f.AddGuide("aL",1,"lptAng","0","cd4");f.AddGuide("aA",1,"ptAng","cd4","0");f.AddGuide("aB",1,"ptAng","cd2","0");f.AddGuide("aJ",1,"lptAng","cd2","0");f.AddGuide("idx",7,"rw1","2700000");f.AddGuide("idy",12,"rh1","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddHandlePolar("adj2","0","maxAng",undefined,"0","0","xA","yA"); f.AddHandlePolar("adj4","0","21599999",undefined,"0","0","xE","yE");f.AddHandlePolar(undefined,"0","0","adj1","0","maxAdj1","xF","yF");f.AddHandlePolar(undefined,"0","0","adj5","0","25000","xB","yB");f.AddCnx("aL","xL","yL");f.AddCnx("lptAng","xKp","yKp");f.AddCnx("ptAng","xGp","yGp");f.AddCnx("aA","xA","yA");f.AddCnx("aB","xBp","yBp");f.AddCnx("aJ","xJp","yJp");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"xL","yL");f.AddPathCommand(2, "xKp","yKp");f.AddPathCommand(2,"xE","yE");f.AddPathCommand(3,"rw1","rh1","st2","swAng");f.AddPathCommand(2,"xGp","yGp");f.AddPathCommand(2,"xA","yA");f.AddPathCommand(2,"xBp","yBp");f.AddPathCommand(2,"xC","yC");f.AddPathCommand(3,"rw2","rh2","istAng","iswAng");f.AddPathCommand(2,"xJp","yJp");f.AddPathCommand(6);break}case "leftRightRibbon":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddAdj("adj3",15,"16667");f.AddGuide("a3",10,"0","adj3","33333");f.AddGuide("maxAdj1",1,"100000","0", "a3");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("w1",1,"wd2","0","wd32");f.AddGuide("maxAdj2",0,"100000","w1","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("x1",0,"ss","a2","100000");f.AddGuide("x4",1,"r","0","x1");f.AddGuide("dy1",0,"h","a1","200000");f.AddGuide("dy2",0,"h","a3","-200000");f.AddGuide("ly1",1,"vc","dy2","dy1");f.AddGuide("ry4",1,"vc","dy1","dy2");f.AddGuide("ly2",1,"ly1","dy1","0");f.AddGuide("ry3",1,"b","0","ly2");f.AddGuide("ly4",0,"ly2","2","1");f.AddGuide("ry1", 1,"b","0","ly4");f.AddGuide("ly3",1,"ly4","0","ly1");f.AddGuide("ry2",1,"b","0","ly3");f.AddGuide("hR",0,"a3","ss","400000");f.AddGuide("x2",1,"hc","0","wd32");f.AddGuide("x3",1,"hc","wd32","0");f.AddGuide("y1",1,"ly1","hR","0");f.AddGuide("y2",1,"ry2","0","hR");f.AddHandleXY(undefined,"0","0","adj1","0","maxAdj1","x4","ry2");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x1","t");f.AddHandleXY(undefined,"0","0","adj3","0","33333","x3","ry2");f.AddCnx("0","r","ry3");f.AddCnx("cd4","x4","b"); f.AddCnx("cd4","x1","ly4");f.AddCnx("cd2","l","ly2");f.AddCnx("_3cd4","x1","t");f.AddCnx("_3cd4","x4","ry1");f.AddRect("x1","ly1","x4","ry4");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","ly2");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x1","ly1");f.AddPathCommand(2,"hc","ly1");f.AddPathCommand(3,"wd32","hR","_3cd4","cd2");f.AddPathCommand(3,"wd32","hR","_3cd4","-10800000");f.AddPathCommand(2,"x4","ry2");f.AddPathCommand(2,"x4","ry1");f.AddPathCommand(2, "r","ry3");f.AddPathCommand(2,"x4","b");f.AddPathCommand(2,"x4","ry4");f.AddPathCommand(2,"hc","ry4");f.AddPathCommand(3,"wd32","hR","cd4","cd4");f.AddPathCommand(2,"x2","ly3");f.AddPathCommand(2,"x1","ly3");f.AddPathCommand(2,"x1","ly4");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"x3","y1");f.AddPathCommand(3,"wd32","hR","0","cd4");f.AddPathCommand(3,"wd32","hR","_3cd4","-10800000");f.AddPathCommand(2,"x3","ry2");f.AddPathCommand(6);f.AddPathCommand(0, false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","ly2");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x1","ly1");f.AddPathCommand(2,"hc","ly1");f.AddPathCommand(3,"wd32","hR","_3cd4","cd2");f.AddPathCommand(3,"wd32","hR","_3cd4","-10800000");f.AddPathCommand(2,"x4","ry2");f.AddPathCommand(2,"x4","ry1");f.AddPathCommand(2,"r","ry3");f.AddPathCommand(2,"x4","b");f.AddPathCommand(2,"x4","ry4");f.AddPathCommand(2,"hc","ry4");f.AddPathCommand(3,"wd32","hR","cd4","cd4");f.AddPathCommand(2, "x2","ly3");f.AddPathCommand(2,"x1","ly3");f.AddPathCommand(2,"x1","ly4");f.AddPathCommand(6);f.AddPathCommand(1,"x3","y1");f.AddPathCommand(2,"x3","ry2");f.AddPathCommand(1,"x2","y2");f.AddPathCommand(2,"x2","ly3");break}case "leftRightUpArrow":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("q1",1,"100000","0","maxAdj1");f.AddGuide("maxAdj3", 0,"q1","1","2");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("x1",0,"ss","a3","100000");f.AddGuide("dx2",0,"ss","a2","100000");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x5",1,"hc","dx2","0");f.AddGuide("dx3",0,"ss","a1","200000");f.AddGuide("x3",1,"hc","0","dx3");f.AddGuide("x4",1,"hc","dx3","0");f.AddGuide("x6",1,"r","0","x1");f.AddGuide("dy2",0,"ss","a2","50000");f.AddGuide("y2",1,"b","0","dy2");f.AddGuide("y4",1,"b","0","dx2");f.AddGuide("y3",1,"y4","0","dx3");f.AddGuide("y5",1,"y4", "dx3","0");f.AddGuide("il",0,"dx3","x1","dx2");f.AddGuide("ir",1,"r","0","il");f.AddHandleXY("adj1","0","maxAdj1",undefined,"0","0","x3","x1");f.AddHandleXY("adj2","0","50000",undefined,"0","0","x2","t");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","x1");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","y4");f.AddCnx("cd4","hc","y5");f.AddCnx("0","r","y4");f.AddRect("il","y3","ir","y5");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y4");f.AddPathCommand(2, "x1","y2");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x3","x1");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"x5","x1");f.AddPathCommand(2,"x4","x1");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"x6","y3");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"r","y4");f.AddPathCommand(2,"x6","b");f.AddPathCommand(2,"x6","y5");f.AddPathCommand(2,"x1","y5");f.AddPathCommand(2,"x1","b");f.AddPathCommand(6);break}case "leftUpArrow":{f.AddAdj("adj1", 15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("maxAdj3",1,"100000","0","maxAdj1");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("x1",0,"ss","a3","100000");f.AddGuide("dx2",0,"ss","a2","50000");f.AddGuide("x2",1,"r","0","dx2");f.AddGuide("y2",1,"b","0","dx2");f.AddGuide("dx4",0,"ss","a2","100000");f.AddGuide("x4",1,"r","0","dx4");f.AddGuide("y4", 1,"b","0","dx4");f.AddGuide("dx3",0,"ss","a1","200000");f.AddGuide("x3",1,"x4","0","dx3");f.AddGuide("x5",1,"x4","dx3","0");f.AddGuide("y3",1,"y4","0","dx3");f.AddGuide("y5",1,"y4","dx3","0");f.AddGuide("il",0,"dx3","x1","dx4");f.AddGuide("cx1",2,"x1","x5","2");f.AddGuide("cy1",2,"x1","y5","2");f.AddHandleXY(undefined,"0","0","adj1","0","maxAdj1","x3","y3");f.AddHandleXY("adj2","0","50000",undefined,"0","0","x2","t");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","x3","x1");f.AddCnx("_3cd4", "x4","t");f.AddCnx("cd2","x2","x1");f.AddCnx("_3cd4","x1","y2");f.AddCnx("cd2","l","y4");f.AddCnx("cd4","x1","b");f.AddCnx("cd4","cx1","y5");f.AddCnx("0","x5","cy1");f.AddCnx("0","r","x1");f.AddRect("il","y3","x4","y5");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y4");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x3","x1");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(2,"x4","t");f.AddPathCommand(2, "r","x1");f.AddPathCommand(2,"x5","x1");f.AddPathCommand(2,"x5","y5");f.AddPathCommand(2,"x1","y5");f.AddPathCommand(2,"x1","b");f.AddPathCommand(6);break}case "lightningBolt":{f.AddGuide("x1",0,"w","5022","21600");f.AddGuide("x3",0,"w","8472","21600");f.AddGuide("x4",0,"w","8757","21600");f.AddGuide("x5",0,"w","10012","21600");f.AddGuide("x8",0,"w","12860","21600");f.AddGuide("x9",0,"w","13917","21600");f.AddGuide("x11",0,"w","16577","21600");f.AddGuide("y1",0,"h","3890","21600");f.AddGuide("y2", 0,"h","6080","21600");f.AddGuide("y4",0,"h","7437","21600");f.AddGuide("y6",0,"h","9705","21600");f.AddGuide("y7",0,"h","12007","21600");f.AddGuide("y10",0,"h","14277","21600");f.AddGuide("y11",0,"h","14915","21600");f.AddCnx("_3cd4","x3","t");f.AddCnx("_3cd4","l","y1");f.AddCnx("cd2","x1","y6");f.AddCnx("cd2","x5","y11");f.AddCnx("cd4","r","b");f.AddCnx("0","x11","y7");f.AddCnx("0","x8","y2");f.AddRect("x4","y4","x9","y10");f.AddPathCommand(0,undefined,undefined,undefined,21600,21600);f.AddPathCommand(1, "8472","0");f.AddPathCommand(2,"12860","6080");f.AddPathCommand(2,"11050","6797");f.AddPathCommand(2,"16577","12007");f.AddPathCommand(2,"14767","12877");f.AddPathCommand(2,"21600","21600");f.AddPathCommand(2,"10012","14915");f.AddPathCommand(2,"12222","13987");f.AddPathCommand(2,"5022","9705");f.AddPathCommand(2,"7602","8382");f.AddPathCommand(2,"0","3890");f.AddPathCommand(6);break}case "line":{f.AddCnx("cd4","l","t");f.AddCnx("_3cd4","r","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined, undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","b");break}case "lineInv":{f.AddCnx("cd4","l","b");f.AddCnx("_3cd4","r","t");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","t");break}case "mathDivide":{f.AddAdj("adj1",15,"23520");f.AddAdj("adj2",15,"5880");f.AddAdj("adj3",15,"11760");f.AddGuide("a1",10,"1000","adj1","36745");f.AddGuide("ma1",1,"0","0","a1");f.AddGuide("ma3h",2,"73490","ma1","4");f.AddGuide("ma3w", 0,"36745","w","h");f.AddGuide("maxAdj3",16,"ma3h","ma3w");f.AddGuide("a3",10,"1000","adj3","maxAdj3");f.AddGuide("m4a3",0,"-4","a3","1");f.AddGuide("maxAdj2",1,"73490","m4a3","a1");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("dy1",0,"h","a1","200000");f.AddGuide("yg",0,"h","a2","100000");f.AddGuide("rad",0,"h","a3","100000");f.AddGuide("dx1",0,"w","73490","200000");f.AddGuide("y3",1,"vc","0","dy1");f.AddGuide("y4",1,"vc","dy1","0");f.AddGuide("a",1,"yg","rad","0");f.AddGuide("y2",1,"y3","0", "a");f.AddGuide("y1",1,"y2","0","rad");f.AddGuide("y5",1,"b","0","y1");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x3",1,"hc","dx1","0");f.AddGuide("x2",1,"hc","0","rad");f.AddHandleXY(undefined,"0","0","adj1","1000","36745","l","y3");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","r","y2");f.AddHandleXY("adj3","1000","maxAdj3",undefined,"0","0","x2","t");f.AddCnx("0","x3","vc");f.AddCnx("cd4","hc","y5");f.AddCnx("cd2","x1","vc");f.AddCnx("_3cd4","hc","y1");f.AddRect("x1","y3","x3","y4"); f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"hc","y1");f.AddPathCommand(3,"rad","rad","_3cd4","21600000");f.AddPathCommand(6);f.AddPathCommand(1,"hc","y5");f.AddPathCommand(3,"rad","rad","cd4","21600000");f.AddPathCommand(6);f.AddPathCommand(1,"x1","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(6);break}case "mathEqual":{f.AddAdj("adj1",15,"23520");f.AddAdj("adj2",15,"11760");f.AddGuide("a1", 10,"0","adj1","36745");f.AddGuide("2a1",0,"a1","2","1");f.AddGuide("mAdj2",1,"100000","0","2a1");f.AddGuide("a2",10,"0","adj2","mAdj2");f.AddGuide("dy1",0,"h","a1","100000");f.AddGuide("dy2",0,"h","a2","200000");f.AddGuide("dx1",0,"w","73490","200000");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","dy2","0");f.AddGuide("y1",1,"y2","0","dy1");f.AddGuide("y4",1,"y3","dy1","0");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","dx1","0");f.AddGuide("yC1",2,"y1","y2","2");f.AddGuide("yC2", 2,"y3","y4","2");f.AddHandleXY(undefined,"0","0","adj1","0","36745","l","y1");f.AddHandleXY(undefined,"0","0","adj2","0","mAdj2","r","y2");f.AddCnx("0","x2","yC1");f.AddCnx("0","x2","yC2");f.AddCnx("cd4","hc","y4");f.AddCnx("cd2","x1","yC1");f.AddCnx("cd2","x1","yC2");f.AddCnx("_3cd4","hc","y1");f.AddRect("x1","y1","x2","y4");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2, "x1","y2");f.AddPathCommand(6);f.AddPathCommand(1,"x1","y3");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(6);break}case "mathMinus":{f.AddAdj("adj1",15,"23520");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("dy1",0,"h","a1","200000");f.AddGuide("dx1",0,"w","73490","200000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","dy1","0");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","dx1","0");f.AddHandleXY(undefined, "0","0","adj1","0","100000","l","y1");f.AddCnx("0","x2","vc");f.AddCnx("cd4","hc","y2");f.AddCnx("cd2","x1","vc");f.AddCnx("_3cd4","hc","y1");f.AddRect("x1","y1","x2","y2");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(6);break}case "mathMultiply":{f.AddAdj("adj1",15,"23520");f.AddGuide("a1",10,"0","adj1","51965");f.AddGuide("th",0,"ss","a1", "100000");f.AddGuide("a",5,"w","h");f.AddGuide("sa",12,"1","a");f.AddGuide("ca",7,"1","a");f.AddGuide("ta",14,"1","a");f.AddGuide("dl",9,"w","h","0");f.AddGuide("rw",0,"dl","51965","100000");f.AddGuide("lM",1,"dl","0","rw");f.AddGuide("xM",0,"ca","lM","2");f.AddGuide("yM",0,"sa","lM","2");f.AddGuide("dxAM",0,"sa","th","2");f.AddGuide("dyAM",0,"ca","th","2");f.AddGuide("xA",1,"xM","0","dxAM");f.AddGuide("yA",1,"yM","dyAM","0");f.AddGuide("xB",1,"xM","dxAM","0");f.AddGuide("yB",1,"yM","0","dyAM");f.AddGuide("xBC", 1,"hc","0","xB");f.AddGuide("yBC",0,"xBC","ta","1");f.AddGuide("yC",1,"yBC","yB","0");f.AddGuide("xD",1,"r","0","xB");f.AddGuide("xE",1,"r","0","xA");f.AddGuide("yFE",1,"vc","0","yA");f.AddGuide("xFE",0,"yFE","1","ta");f.AddGuide("xF",1,"xE","0","xFE");f.AddGuide("xL",1,"xA","xFE","0");f.AddGuide("yG",1,"b","0","yA");f.AddGuide("yH",1,"b","0","yB");f.AddGuide("yI",1,"b","0","yC");f.AddGuide("xC2",1,"r","0","xM");f.AddGuide("yC3",1,"b","0","yM");f.AddHandleXY(undefined,"0","0","adj1","0","51965","l", "th");f.AddCnx("cd2","xM","yM");f.AddCnx("_3cd4","xC2","yM");f.AddCnx("0","xC2","yC3");f.AddCnx("cd4","xM","yC3");f.AddRect("xA","yB","xE","yH");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"xA","yA");f.AddPathCommand(2,"xB","yB");f.AddPathCommand(2,"hc","yC");f.AddPathCommand(2,"xD","yB");f.AddPathCommand(2,"xE","yA");f.AddPathCommand(2,"xF","vc");f.AddPathCommand(2,"xE","yG");f.AddPathCommand(2,"xD","yH");f.AddPathCommand(2,"hc","yI");f.AddPathCommand(2, "xB","yH");f.AddPathCommand(2,"xA","yG");f.AddPathCommand(2,"xL","vc");f.AddPathCommand(6);break}case "mathNotEqual":{f.AddAdj("adj1",15,"23520");f.AddAdj("adj2",15,"6600000");f.AddAdj("adj3",15,"11760");f.AddGuide("a1",10,"0","adj1","50000");f.AddGuide("crAng",10,"4200000","adj2","6600000");f.AddGuide("2a1",0,"a1","2","1");f.AddGuide("maxAdj3",1,"100000","0","2a1");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("dy1",0,"h","a1","100000");f.AddGuide("dy2",0,"h","a3","200000");f.AddGuide("dx1", 0,"w","73490","200000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x8",1,"hc","dx1","0");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","dy2","0");f.AddGuide("y1",1,"y2","0","dy1");f.AddGuide("y4",1,"y3","dy1","0");f.AddGuide("cadj2",1,"crAng","0","cd4");f.AddGuide("xadj2",14,"hd2","cadj2");f.AddGuide("len",9,"xadj2","hd2","0");f.AddGuide("bhw",0,"len","dy1","hd2");f.AddGuide("bhw2",0,"bhw","1","2");f.AddGuide("x7",1,"hc","xadj2","bhw2");f.AddGuide("dx67",0,"xadj2","y1","hd2");f.AddGuide("x6", 1,"x7","0","dx67");f.AddGuide("dx57",0,"xadj2","y2","hd2");f.AddGuide("x5",1,"x7","0","dx57");f.AddGuide("dx47",0,"xadj2","y3","hd2");f.AddGuide("x4",1,"x7","0","dx47");f.AddGuide("dx37",0,"xadj2","y4","hd2");f.AddGuide("x3",1,"x7","0","dx37");f.AddGuide("dx27",0,"xadj2","2","1");f.AddGuide("x2",1,"x7","0","dx27");f.AddGuide("rx7",1,"x7","bhw","0");f.AddGuide("rx6",1,"x6","bhw","0");f.AddGuide("rx5",1,"x5","bhw","0");f.AddGuide("rx4",1,"x4","bhw","0");f.AddGuide("rx3",1,"x3","bhw","0");f.AddGuide("rx2", 1,"x2","bhw","0");f.AddGuide("dx7",0,"dy1","hd2","len");f.AddGuide("rxt",1,"x7","dx7","0");f.AddGuide("lxt",1,"rx7","0","dx7");f.AddGuide("rx",3,"cadj2","rxt","rx7");f.AddGuide("lx",3,"cadj2","x7","lxt");f.AddGuide("dy3",0,"dy1","xadj2","len");f.AddGuide("dy4",1,"0","0","dy3");f.AddGuide("ry",3,"cadj2","dy3","t");f.AddGuide("ly",3,"cadj2","t","dy4");f.AddGuide("dlx",1,"w","0","rx");f.AddGuide("drx",1,"w","0","lx");f.AddGuide("dly",1,"h","0","ry");f.AddGuide("dry",1,"h","0","ly");f.AddGuide("xC1", 2,"rx","lx","2");f.AddGuide("xC2",2,"drx","dlx","2");f.AddGuide("yC1",2,"ry","ly","2");f.AddGuide("yC2",2,"y1","y2","2");f.AddGuide("yC3",2,"y3","y4","2");f.AddGuide("yC4",2,"dry","dly","2");f.AddHandleXY(undefined,"0","0","adj1","0","50000","l","y1");f.AddHandlePolar("adj2","4200000","6600000",undefined,"0","0","lx","t");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","y2");f.AddCnx("0","x8","yC2");f.AddCnx("0","x8","yC3");f.AddCnx("cd4","xC2","yC4");f.AddCnx("cd2","x1","yC2");f.AddCnx("cd2", "x1","yC3");f.AddCnx("_3cd4","xC1","yC1");f.AddRect("x1","y1","x8","y4");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"x6","y1");f.AddPathCommand(2,"lx","ly");f.AddPathCommand(2,"rx","ry");f.AddPathCommand(2,"rx6","y1");f.AddPathCommand(2,"x8","y1");f.AddPathCommand(2,"x8","y2");f.AddPathCommand(2,"rx5","y2");f.AddPathCommand(2,"rx4","y3");f.AddPathCommand(2,"x8","y3");f.AddPathCommand(2,"x8","y4");f.AddPathCommand(2,"rx3", "y4");f.AddPathCommand(2,"drx","dry");f.AddPathCommand(2,"dlx","dly");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"x5","y2");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(6);break}case "mathPlus":{f.AddAdj("adj1",15,"23520");f.AddGuide("a1",10,"0","adj1","73490");f.AddGuide("dx1",0,"w","73490","200000");f.AddGuide("dy1",0,"h","73490","200000");f.AddGuide("dx2",0,"ss","a1","200000");f.AddGuide("x1",1,"hc", "0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dx2");f.AddGuide("y3",1,"vc","dx2","0");f.AddGuide("y4",1,"vc","dy1","0");f.AddHandleXY(undefined,"0","0","adj1","0","73490","l","y2");f.AddCnx("0","x4","vc");f.AddCnx("cd4","hc","y4");f.AddCnx("cd2","x1","vc");f.AddCnx("_3cd4","hc","y1");f.AddRect("x1","y2","x4","y3");f.AddPathCommand(0,undefined,undefined,undefined,undefined, undefined);f.AddPathCommand(1,"x1","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2,"x4","y2");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(6);break}case "moon":{f.AddAdj("adj",15,"50000");f.AddGuide("a",10,"0","adj","875000");f.AddGuide("g0",0,"ss","a", "100000");f.AddGuide("g0w",0,"g0","w","ss");f.AddGuide("g1",1,"ss","0","g0");f.AddGuide("g2",0,"g0","g0","g1");f.AddGuide("g3",0,"ss","ss","g1");f.AddGuide("g4",0,"g3","2","1");f.AddGuide("g5",1,"g4","0","g2");f.AddGuide("g6",1,"g5","0","g0");f.AddGuide("g6w",0,"g6","w","ss");f.AddGuide("g7",0,"g5","1","2");f.AddGuide("g8",1,"g7","0","g0");f.AddGuide("dy1",0,"g8","hd2","ss");f.AddGuide("g10h",1,"vc","0","dy1");f.AddGuide("g11h",1,"vc","dy1","0");f.AddGuide("g12",0,"g0","9598","32768");f.AddGuide("g12w", 0,"g12","w","ss");f.AddGuide("g13",1,"ss","0","g12");f.AddGuide("q1",0,"ss","ss","1");f.AddGuide("q2",0,"g13","g13","1");f.AddGuide("q3",1,"q1","0","q2");f.AddGuide("q4",13,"q3");f.AddGuide("dy4",0,"q4","hd2","ss");f.AddGuide("g15h",1,"vc","0","dy4");f.AddGuide("g16h",1,"vc","dy4","0");f.AddGuide("g17w",1,"g6w","0","g0w");f.AddGuide("g18w",0,"g17w","1","2");f.AddGuide("dx2p",1,"g0w","g18w","w");f.AddGuide("dx2",0,"dx2p","-1","1");f.AddGuide("dy2",0,"hd2","-1","1");f.AddGuide("stAng1",5,"dx2","dy2"); f.AddGuide("enAngp1",5,"dx2","hd2");f.AddGuide("enAng1",1,"enAngp1","0","21600000");f.AddGuide("swAng1",1,"enAng1","0","stAng1");f.AddHandleXY("adj","0","87500",undefined,"0","0","g0w","vc");f.AddCnx("_3cd4","r","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","r","b");f.AddCnx("0","g0w","vc");f.AddRect("g12w","g15h","g0w","g16h");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"r","b");f.AddPathCommand(3,"w","hd2","cd4","cd2");f.AddPathCommand(3,"g18w","dy1", "stAng1","swAng1");f.AddPathCommand(6);break}case "nonIsoscelesTrapezoid":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddGuide("maxAdj",0,"50000","w","ss");f.AddGuide("a1",10,"0","adj1","maxAdj");f.AddGuide("a2",10,"0","adj2","maxAdj");f.AddGuide("x1",0,"ss","a1","200000");f.AddGuide("x2",0,"ss","a1","100000");f.AddGuide("dx3",0,"ss","a2","100000");f.AddGuide("x3",1,"r","0","dx3");f.AddGuide("x4",2,"r","x3","2");f.AddGuide("il",0,"wd3","a1","maxAdj");f.AddGuide("adjm",8,"a1","a2"); f.AddGuide("it",0,"hd3","adjm","maxAdj");f.AddGuide("irt",0,"wd3","a2","maxAdj");f.AddGuide("ir",1,"r","0","irt");f.AddHandleXY("adj1","0","maxAdj",undefined,"0","0","x2","t");f.AddHandleXY("adj2","0","maxAdj",undefined,"0","0","x3","t");f.AddCnx("0","x4","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","x1","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("il","it","ir","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2, "x3","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(6);break}case "noSmoking":{f.AddAdj("adj",15,"18750");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dr",0,"ss","a","100000");f.AddGuide("iwd2",1,"wd2","0","dr");f.AddGuide("ihd2",1,"hd2","0","dr");f.AddGuide("ang",5,"w","h");f.AddGuide("ct",7,"ihd2","ang");f.AddGuide("st",12,"iwd2","ang");f.AddGuide("m",9,"ct","st","0");f.AddGuide("n",0,"iwd2","ihd2","m");f.AddGuide("drd2",0,"dr","1","2");f.AddGuide("dang",5,"n","drd2");f.AddGuide("2dang", 0,"dang","2","1");f.AddGuide("swAng",1,"-10800000","2dang","0");f.AddGuide("t3",5,"w","h");f.AddGuide("stAng1",1,"t3","0","dang");f.AddGuide("stAng2",1,"stAng1","0","cd2");f.AddGuide("ct1",7,"ihd2","stAng1");f.AddGuide("st1",12,"iwd2","stAng1");f.AddGuide("m1",9,"ct1","st1","0");f.AddGuide("n1",0,"iwd2","ihd2","m1");f.AddGuide("dx1",7,"n1","stAng1");f.AddGuide("dy1",12,"n1","stAng1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("x2",1,"hc","0","dx1");f.AddGuide("y2", 1,"vc","0","dy1");f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddHandlePolar(undefined,"0","0","adj","0","50000","dr","vc");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","il","it");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","il","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","ir","ib");f.AddCnx("0","r","vc");f.AddCnx("_3cd4","ir","it");f.AddRect("il", "it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"iwd2","ihd2","stAng1","swAng");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(1,"x2","y2");f.AddPathCommand(3,"iwd2","ihd2","stAng2","swAng");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","cd4");f.AddPathCommand(3,"wd2","hd2","_3cd4","cd4");f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2","hd2","cd4", "cd4");f.AddPathCommand(6);break}case "notchedRightArrow":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj2",0,"100000","w","ss");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("dx2",0,"ss","a2","100000");f.AddGuide("x2",1,"r","0","dx2");f.AddGuide("dy1",0,"h","a1","200000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","dy1","0");f.AddGuide("x1",0,"dy1","dx2","hd2");f.AddGuide("x3",1,"r","0","x1");f.AddHandleXY(undefined, "0","0","adj1","0","100000","r","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x2","t");f.AddCnx("_3cd4","x2","t");f.AddCnx("cd2","x1","vc");f.AddCnx("cd4","x2","b");f.AddCnx("0","r","vc");f.AddRect("x1","y1","x3","y2");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"l", "y2");f.AddPathCommand(2,"x1","vc");f.AddPathCommand(6);break}case "octagon":{f.AddAdj("adj",15,"29289");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("x1",0,"ss","a","100000");f.AddGuide("x2",1,"r","0","x1");f.AddGuide("y2",1,"b","0","x1");f.AddGuide("il",0,"x1","1","2");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","il");f.AddHandleXY("adj","0","50000",undefined,"0","0","x1","t");f.AddCnx("0","r","x1");f.AddCnx("0","r","y2");f.AddCnx("cd4","x2","b");f.AddCnx("cd4","x1","b");f.AddCnx("cd2", "l","y2");f.AddCnx("cd2","l","x1");f.AddCnx("_3cd4","x1","t");f.AddCnx("_3cd4","x2","t");f.AddRect("il","il","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","x1");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","x1");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"l","y2");f.AddPathCommand(6);break}case "parallelogram":{f.AddAdj("adj",15,"25000");f.AddGuide("maxAdj", 0,"100000","w","ss");f.AddGuide("a",10,"0","adj","maxAdj");f.AddGuide("x1",0,"ss","a","200000");f.AddGuide("x2",0,"ss","a","100000");f.AddGuide("x6",1,"r","0","x1");f.AddGuide("x5",1,"r","0","x2");f.AddGuide("x3",0,"x5","1","2");f.AddGuide("x4",1,"r","0","x3");f.AddGuide("il",0,"wd2","a","maxAdj");f.AddGuide("q1",0,"5","a","maxAdj");f.AddGuide("q2",2,"1","q1","12");f.AddGuide("il",0,"q2","w","1");f.AddGuide("it",0,"q2","h","1");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","it");f.AddGuide("q3", 0,"h","hc","x2");f.AddGuide("y1",10,"0","q3","h");f.AddGuide("y2",1,"b","0","y1");f.AddHandleXY("adj","0","maxAdj",undefined,"0","0","x2","t");f.AddCnx("_3cd4","hc","y2");f.AddCnx("_3cd4","x4","t");f.AddCnx("0","x6","vc");f.AddCnx("cd4","x3","b");f.AddCnx("cd4","hc","y1");f.AddCnx("cd2","x1","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2, "x5","b");f.AddPathCommand(6);break}case "pentagon":{f.AddAdj("hf",15,"105146");f.AddAdj("vf",15,"110557");f.AddGuide("swd2",0,"wd2","hf","100000");f.AddGuide("shd2",0,"hd2","vf","100000");f.AddGuide("svc",0,"vc","vf","100000");f.AddGuide("dx1",7,"swd2","1080000");f.AddGuide("dx2",7,"swd2","18360000");f.AddGuide("dy1",12,"shd2","1080000");f.AddGuide("dy2",12,"shd2","18360000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddGuide("x4",1,"hc", "dx1","0");f.AddGuide("y1",1,"svc","0","dy1");f.AddGuide("y2",1,"svc","0","dy2");f.AddGuide("it",0,"y1","dx2","dx1");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","x1","y1");f.AddCnx("cd4","x2","y2");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","x3","y2");f.AddCnx("0","x4","y1");f.AddRect("x2","it","x3","y2");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2, "x2","y2");f.AddPathCommand(6);break}case "pie":{f.AddAdj("adj1",15,"0");f.AddAdj("adj2",15,"16200000");f.AddGuide("stAng",10,"0","adj1","21599999");f.AddGuide("enAng",10,"0","adj2","21599999");f.AddGuide("sw1",1,"enAng","0","stAng");f.AddGuide("sw2",1,"sw1","21600000","0");f.AddGuide("swAng",3,"sw1","sw1","sw2");f.AddGuide("wt1",12,"wd2","stAng");f.AddGuide("ht1",7,"hd2","stAng");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1", 1,"vc","dy1","0");f.AddGuide("wt2",12,"wd2","enAng");f.AddGuide("ht2",7,"hd2","enAng");f.AddGuide("dx2",6,"wd2","ht2","wt2");f.AddGuide("dy2",11,"hd2","ht2","wt2");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddGuide("idx",7,"hc","2700000");f.AddGuide("idy",12,"vc","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddHandlePolar("adj1","0","21599999",undefined,"0","0","x1", "y1");f.AddHandlePolar("adj2","0","21599999",undefined,"0","0","x2","y2");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","stAng","swAng");f.AddPathCommand(2,"hc","vc");f.AddPathCommand(6);break}case "pieWedge":{f.AddGuide("g1",7,"w","13500000");f.AddGuide("g2",12,"h","13500000");f.AddGuide("x1", 1,"r","g1","0");f.AddGuide("y1",1,"b","g2","0");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddRect("x1","y1","r","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(3,"w","h","cd2","cd4");f.AddPathCommand(2,"r","b");f.AddPathCommand(6);break}case "plaque":{f.AddAdj("adj",15,"16667");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("x1",0,"ss","a","100000");f.AddGuide("x2",1,"r","0","x1");f.AddGuide("y2",1,"b","0","x1");f.AddGuide("il", 0,"x1","70711","100000");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","il");f.AddHandleXY("adj","0","50000",undefined,"0","0","x1","t");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","il","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","x1");f.AddPathCommand(3,"x1","x1","cd4","-5400000");f.AddPathCommand(2,"x2","t");f.AddPathCommand(3,"x1","x1","cd2","-5400000"); f.AddPathCommand(2,"r","y2");f.AddPathCommand(3,"x1","x1","_3cd4","-5400000");f.AddPathCommand(2,"x1","b");f.AddPathCommand(3,"x1","x1","0","-5400000");f.AddPathCommand(6);break}case "plaqueTabs":{f.AddGuide("md",9,"w","h","0");f.AddGuide("dx",0,"1","md","20");f.AddGuide("y1",1,"0","b","dx");f.AddGuide("x1",1,"0","r","dx");f.AddCnx("cd2","l","t");f.AddCnx("cd2","l","dx");f.AddCnx("cd2","l","y1");f.AddCnx("cd2","l","b");f.AddCnx("_3cd4","dx","t");f.AddCnx("_3cd4","x1","t");f.AddCnx("cd4","dx","b"); f.AddCnx("cd4","x1","b");f.AddCnx("0","r","t");f.AddCnx("0","r","dx");f.AddCnx("0","r","y1");f.AddCnx("0","r","b");f.AddRect("dx","dx","x1","y1");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"dx","t");f.AddPathCommand(3,"dx","dx","0","cd4");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(3,"dx","dx","_3cd4","cd4");f.AddPathCommand(2,"l","b"); f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"r","t");f.AddPathCommand(2,"r","dx");f.AddPathCommand(3,"dx","dx","cd4","cd4");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","b");f.AddPathCommand(3,"dx","dx","cd2","cd4");f.AddPathCommand(2,"r","b");f.AddPathCommand(6);break}case "plus":{f.AddAdj("adj",15,"25000");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("x1",0,"ss", "a","100000");f.AddGuide("x2",1,"r","0","x1");f.AddGuide("y2",1,"b","0","x1");f.AddGuide("d",1,"w","0","h");f.AddGuide("il",3,"d","l","x1");f.AddGuide("ir",3,"d","r","x2");f.AddGuide("it",3,"d","x1","t");f.AddGuide("ib",3,"d","y2","b");f.AddHandleXY("adj","0","50000",undefined,"0","0","x1","t");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1, "l","x1");f.AddPathCommand(2,"x1","x1");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(2,"r","x1");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"l","y2");f.AddPathCommand(6);break}case "quadArrow":{f.AddAdj("adj1",15,"22500");f.AddAdj("adj2",15,"22500");f.AddAdj("adj3",15,"22500");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("maxAdj1", 0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("q1",1,"100000","0","maxAdj1");f.AddGuide("maxAdj3",0,"q1","1","2");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("x1",0,"ss","a3","100000");f.AddGuide("dx2",0,"ss","a2","100000");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x5",1,"hc","dx2","0");f.AddGuide("dx3",0,"ss","a1","200000");f.AddGuide("x3",1,"hc","0","dx3");f.AddGuide("x4",1,"hc","dx3","0");f.AddGuide("x6",1,"r","0","x1");f.AddGuide("y2",1,"vc","0","dx2");f.AddGuide("y5", 1,"vc","dx2","0");f.AddGuide("y3",1,"vc","0","dx3");f.AddGuide("y4",1,"vc","dx3","0");f.AddGuide("y6",1,"b","0","x1");f.AddGuide("il",0,"dx3","x1","dx2");f.AddGuide("ir",1,"r","0","il");f.AddHandleXY("adj1","0","maxAdj1",undefined,"0","0","x3","x1");f.AddHandleXY("adj2","0","50000",undefined,"0","0","x2","t");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","x1");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","y3","ir","y4"); f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x3","x1");f.AddPathCommand(2,"x2","x1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"x5","x1");f.AddPathCommand(2,"x4","x1");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"x6","y3");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x6","y5");f.AddPathCommand(2, "x6","y4");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(2,"x4","y6");f.AddPathCommand(2,"x5","y6");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"x2","y6");f.AddPathCommand(2,"x3","y6");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"x1","y5");f.AddPathCommand(6);break}case "quadArrowCallout":{f.AddAdj("adj1",15,"18515");f.AddAdj("adj2",15,"18515");f.AddAdj("adj3",15,"18515");f.AddAdj("adj4",15,"48123");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("maxAdj1", 0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("maxAdj3",1,"50000","0","a2");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("q2",0,"a3","2","1");f.AddGuide("maxAdj4",1,"100000","0","q2");f.AddGuide("a4",10,"a1","adj4","maxAdj4");f.AddGuide("dx2",0,"ss","a2","100000");f.AddGuide("dx3",0,"ss","a1","200000");f.AddGuide("ah",0,"ss","a3","100000");f.AddGuide("dx1",0,"w","a4","200000");f.AddGuide("dy1",0,"h","a4","200000");f.AddGuide("x8",1,"r","0","ah");f.AddGuide("x2",1,"hc", "0","dx1");f.AddGuide("x7",1,"hc","dx1","0");f.AddGuide("x3",1,"hc","0","dx2");f.AddGuide("x6",1,"hc","dx2","0");f.AddGuide("x4",1,"hc","0","dx3");f.AddGuide("x5",1,"hc","dx3","0");f.AddGuide("y8",1,"b","0","ah");f.AddGuide("y2",1,"vc","0","dy1");f.AddGuide("y7",1,"vc","dy1","0");f.AddGuide("y3",1,"vc","0","dx2");f.AddGuide("y6",1,"vc","dx2","0");f.AddGuide("y4",1,"vc","0","dx3");f.AddGuide("y5",1,"vc","dx3","0");f.AddHandleXY("adj1","0","maxAdj1",undefined,"0","0","x4","ah");f.AddHandleXY("adj2", "0","50000",undefined,"0","0","x3","t");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","ah");f.AddHandleXY(undefined,"0","0","adj4","a1","maxAdj4","l","y2");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("x2","y2","x7","y7");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"ah","y3");f.AddPathCommand(2,"ah","y4");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2, "x2","y2");f.AddPathCommand(2,"x4","y2");f.AddPathCommand(2,"x4","ah");f.AddPathCommand(2,"x3","ah");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"x6","ah");f.AddPathCommand(2,"x5","ah");f.AddPathCommand(2,"x5","y2");f.AddPathCommand(2,"x7","y2");f.AddPathCommand(2,"x7","y4");f.AddPathCommand(2,"x8","y4");f.AddPathCommand(2,"x8","y3");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x8","y6");f.AddPathCommand(2,"x8","y5");f.AddPathCommand(2,"x7","y5");f.AddPathCommand(2,"x7","y7");f.AddPathCommand(2, "x5","y7");f.AddPathCommand(2,"x5","y8");f.AddPathCommand(2,"x6","y8");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"x3","y8");f.AddPathCommand(2,"x4","y8");f.AddPathCommand(2,"x4","y7");f.AddPathCommand(2,"x2","y7");f.AddPathCommand(2,"x2","y5");f.AddPathCommand(2,"ah","y5");f.AddPathCommand(2,"ah","y6");f.AddPathCommand(6);break}case "rect":{f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined, undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "ribbon":{f.AddAdj("adj1",15,"16667");f.AddAdj("adj2",15,"50000");f.AddGuide("a1",10,"0","adj1","33333");f.AddGuide("a2",10,"25000","adj2","75000");f.AddGuide("x10",1,"r","0","wd8");f.AddGuide("dx2",0,"w","a2","200000");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x9",1,"hc","dx2","0");f.AddGuide("x3",1,"x2","wd32", "0");f.AddGuide("x8",1,"x9","0","wd32");f.AddGuide("x5",1,"x2","wd8","0");f.AddGuide("x6",1,"x9","0","wd8");f.AddGuide("x4",1,"x5","0","wd32");f.AddGuide("x7",1,"x6","wd32","0");f.AddGuide("y1",0,"h","a1","200000");f.AddGuide("y2",0,"h","a1","100000");f.AddGuide("y4",1,"b","0","y2");f.AddGuide("y3",0,"y4","1","2");f.AddGuide("hR",0,"h","a1","400000");f.AddGuide("y5",1,"b","0","hR");f.AddGuide("y6",1,"y2","0","hR");f.AddHandleXY(undefined,"0","0","adj1","0","33333","hc","y2");f.AddHandleXY("adj2", "25000","75000",undefined,"0","0","x2","t");f.AddCnx("_3cd4","hc","y2");f.AddCnx("cd2","wd8","y3");f.AddCnx("cd4","hc","b");f.AddCnx("0","x10","y3");f.AddRect("x2","y2","x9","b");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x4","t");f.AddPathCommand(3,"wd32","hR","_3cd4","cd2");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(3,"wd32","hR","_3cd4","-10800000");f.AddPathCommand(2,"x8","y2");f.AddPathCommand(3,"wd32","hR","cd4","-10800000"); f.AddPathCommand(2,"x7","y1");f.AddPathCommand(3,"wd32","hR","cd4","cd2");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"x10","y3");f.AddPathCommand(2,"r","y4");f.AddPathCommand(2,"x9","y4");f.AddPathCommand(2,"x9","y5");f.AddPathCommand(3,"wd32","hR","0","cd4");f.AddPathCommand(2,"x3","b");f.AddPathCommand(3,"wd32","hR","cd4","cd4");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"l","y4");f.AddPathCommand(2,"wd8","y3");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined, undefined);f.AddPathCommand(1,"x5","hR");f.AddPathCommand(3,"wd32","hR","0","cd4");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(3,"wd32","hR","_3cd4","-10800000");f.AddPathCommand(2,"x5","y2");f.AddPathCommand(6);f.AddPathCommand(1,"x6","hR");f.AddPathCommand(3,"wd32","hR","cd2","-5400000");f.AddPathCommand(2,"x8","y1");f.AddPathCommand(3,"wd32","hR","_3cd4","cd2");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1, "l","t");f.AddPathCommand(2,"x4","t");f.AddPathCommand(3,"wd32","hR","_3cd4","cd2");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(3,"wd32","hR","_3cd4","-10800000");f.AddPathCommand(2,"x8","y2");f.AddPathCommand(3,"wd32","hR","cd4","-10800000");f.AddPathCommand(2,"x7","y1");f.AddPathCommand(3,"wd32","hR","cd4","cd2");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"x10","y3");f.AddPathCommand(2,"r","y4");f.AddPathCommand(2,"x9","y4");f.AddPathCommand(2,"x9","y5");f.AddPathCommand(3,"wd32","hR","0", "cd4");f.AddPathCommand(2,"x3","b");f.AddPathCommand(3,"wd32","hR","cd4","cd4");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"l","y4");f.AddPathCommand(2,"wd8","y3");f.AddPathCommand(6);f.AddPathCommand(1,"x5","hR");f.AddPathCommand(2,"x5","y2");f.AddPathCommand(1,"x6","y2");f.AddPathCommand(2,"x6","hR");f.AddPathCommand(1,"x2","y4");f.AddPathCommand(2,"x2","y6");f.AddPathCommand(1,"x9","y6");f.AddPathCommand(2,"x9","y4");break}case "ribbon2":{f.AddAdj("adj1",15,"16667");f.AddAdj("adj2",15,"50000"); f.AddGuide("a1",10,"0","adj1","33333");f.AddGuide("a2",10,"25000","adj2","75000");f.AddGuide("x10",1,"r","0","wd8");f.AddGuide("dx2",0,"w","a2","200000");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x9",1,"hc","dx2","0");f.AddGuide("x3",1,"x2","wd32","0");f.AddGuide("x8",1,"x9","0","wd32");f.AddGuide("x5",1,"x2","wd8","0");f.AddGuide("x6",1,"x9","0","wd8");f.AddGuide("x4",1,"x5","0","wd32");f.AddGuide("x7",1,"x6","wd32","0");f.AddGuide("dy1",0,"h","a1","200000");f.AddGuide("y1",1,"b","0","dy1"); f.AddGuide("dy2",0,"h","a1","100000");f.AddGuide("y2",1,"b","0","dy2");f.AddGuide("y4",1,"t","dy2","0");f.AddGuide("y3",2,"y4","b","2");f.AddGuide("hR",0,"h","a1","400000");f.AddGuide("y6",1,"b","0","hR");f.AddGuide("y7",1,"y1","0","hR");f.AddHandleXY(undefined,"0","0","adj1","0","33333","hc","y2");f.AddHandleXY("adj2","25000","75000",undefined,"0","0","x2","b");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","wd8","y3");f.AddCnx("cd4","hc","y2");f.AddCnx("0","x10","y3");f.AddRect("x2","t","x9","y2");f.AddPathCommand(0, false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"x4","b");f.AddPathCommand(3,"wd32","hR","cd4","-10800000");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(3,"wd32","hR","cd4","cd2");f.AddPathCommand(2,"x8","y2");f.AddPathCommand(3,"wd32","hR","_3cd4","cd2");f.AddPathCommand(2,"x7","y1");f.AddPathCommand(3,"wd32","hR","_3cd4","-10800000");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"x10","y3");f.AddPathCommand(2,"r","y4");f.AddPathCommand(2,"x9","y4");f.AddPathCommand(2, "x9","hR");f.AddPathCommand(3,"wd32","hR","0","-5400000");f.AddPathCommand(2,"x3","t");f.AddPathCommand(3,"wd32","hR","_3cd4","-5400000");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"l","y4");f.AddPathCommand(2,"wd8","y3");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"x5","y6");f.AddPathCommand(3,"wd32","hR","0","-5400000");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(3,"wd32","hR","cd4","cd2");f.AddPathCommand(2,"x5","y2");f.AddPathCommand(6); f.AddPathCommand(1,"x6","y6");f.AddPathCommand(3,"wd32","hR","cd2","cd4");f.AddPathCommand(2,"x8","y1");f.AddPathCommand(3,"wd32","hR","cd4","-10800000");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(6);f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"wd8","y3");f.AddPathCommand(2,"l","y4");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"x2","hR");f.AddPathCommand(3,"wd32","hR","cd2","cd4");f.AddPathCommand(2,"x8","t");f.AddPathCommand(3, "wd32","hR","_3cd4","cd4");f.AddPathCommand(2,"x9","y4");f.AddPathCommand(2,"x9","y4");f.AddPathCommand(2,"r","y4");f.AddPathCommand(2,"x10","y3");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"x7","b");f.AddPathCommand(3,"wd32","hR","cd4","cd2");f.AddPathCommand(2,"x8","y1");f.AddPathCommand(3,"wd32","hR","cd4","-10800000");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(3,"wd32","hR","_3cd4","-10800000");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(3,"wd32","hR","_3cd4","cd2");f.AddPathCommand(6); f.AddPathCommand(1,"x5","y2");f.AddPathCommand(2,"x5","y6");f.AddPathCommand(1,"x6","y6");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(1,"x2","y7");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(1,"x9","y4");f.AddPathCommand(2,"x9","y7");break}case "rightArrow":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj2",0,"100000","w","ss");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("dx1",0,"ss","a2","100000");f.AddGuide("x1",1, "r","0","dx1");f.AddGuide("dy1",0,"h","a1","200000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","dy1","0");f.AddGuide("dx2",0,"y1","dx1","hd2");f.AddGuide("x2",1,"x1","dx2","0");f.AddHandleXY(undefined,"0","0","adj1","0","100000","l","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x1","t");f.AddCnx("_3cd4","x1","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","x1","b");f.AddCnx("0","r","vc");f.AddRect("l","y1","x2","y2");f.AddPathCommand(0,undefined,undefined,undefined,undefined, undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"l","y2");f.AddPathCommand(6);break}case "rightArrowCallout":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddAdj("adj4",15,"64977");f.AddGuide("maxAdj2",0,"50000","h","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1", 10,"0","adj1","maxAdj1");f.AddGuide("maxAdj3",0,"100000","w","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("q2",0,"a3","ss","w");f.AddGuide("maxAdj4",1,"100000","0","q2");f.AddGuide("a4",10,"0","adj4","maxAdj4");f.AddGuide("dy1",0,"ss","a2","100000");f.AddGuide("dy2",0,"ss","a1","200000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","dy2","0");f.AddGuide("y4",1,"vc","dy1","0");f.AddGuide("dx3",0,"ss","a3","100000");f.AddGuide("x3",1,"r","0", "dx3");f.AddGuide("x2",0,"w","a4","100000");f.AddGuide("x1",0,"x2","1","2");f.AddHandleXY(undefined,"0","0","adj1","0","maxAdj1","x3","y2");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","r","y1");f.AddHandleXY("adj3","0","maxAdj3",undefined,"0","0","x3","t");f.AddHandleXY("adj4","0","maxAdj4",undefined,"0","0","x2","b");f.AddCnx("_3cd4","x1","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","x1","b");f.AddCnx("0","r","vc");f.AddRect("l","t","x2","b");f.AddPathCommand(0,undefined,undefined,undefined, undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "rightBrace":{f.AddAdj("adj1",15,"8333");f.AddAdj("adj2",15,"50000");f.AddGuide("a2",10,"0","adj2","100000");f.AddGuide("q1",1, "100000","0","a2");f.AddGuide("q2",16,"q1","a2");f.AddGuide("q3",0,"q2","1","2");f.AddGuide("maxAdj1",0,"q3","h","ss");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("y1",0,"ss","a1","100000");f.AddGuide("y3",0,"h","a2","100000");f.AddGuide("y2",1,"y3","0","y1");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("dx1",7,"wd2","2700000");f.AddGuide("dy1",12,"y1","2700000");f.AddGuide("ir",1,"l","dx1","0");f.AddGuide("it",1,"y1","0","dy1");f.AddGuide("ib",1,"b","dy1","y1");f.AddHandleXY(undefined,"0", "0","adj1","0","maxAdj1","hc","y1");f.AddHandleXY(undefined,"0","0","adj2","0","100000","r","y3");f.AddCnx("cd4","l","t");f.AddCnx("cd2","r","y3");f.AddCnx("_3cd4","l","b");f.AddRect("l","it","ir","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(3,"wd2","y1","_3cd4","cd4");f.AddPathCommand(2,"hc","y2");f.AddPathCommand(3,"wd2","y1","cd2","-5400000");f.AddPathCommand(3,"wd2","y1","_3cd4","-5400000");f.AddPathCommand(2,"hc","y4");f.AddPathCommand(3, "wd2","y1","0","cd4");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(3,"wd2","y1","_3cd4","cd4");f.AddPathCommand(2,"hc","y2");f.AddPathCommand(3,"wd2","y1","cd2","-5400000");f.AddPathCommand(3,"wd2","y1","_3cd4","-5400000");f.AddPathCommand(2,"hc","y4");f.AddPathCommand(3,"wd2","y1","0","cd4");break}case "rightBracket":{f.AddAdj("adj",15,"8333");f.AddGuide("maxAdj",0,"50000","h","ss");f.AddGuide("a",10,"0","adj", "maxAdj");f.AddGuide("y1",0,"ss","a","100000");f.AddGuide("y2",1,"b","0","y1");f.AddGuide("dx1",7,"w","2700000");f.AddGuide("dy1",12,"y1","2700000");f.AddGuide("ir",1,"l","dx1","0");f.AddGuide("it",1,"y1","0","dy1");f.AddGuide("ib",1,"b","dy1","y1");f.AddHandleXY(undefined,"0","0","adj","0","maxAdj","r","y1");f.AddCnx("cd4","l","t");f.AddCnx("_3cd4","l","b");f.AddCnx("cd2","r","vc");f.AddRect("l","it","ir","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l", "t");f.AddPathCommand(3,"w","y1","_3cd4","cd4");f.AddPathCommand(2,"r","y2");f.AddPathCommand(3,"w","y1","0","cd4");f.AddPathCommand(6);f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(3,"w","y1","_3cd4","cd4");f.AddPathCommand(2,"r","y2");f.AddPathCommand(3,"w","y1","0","cd4");break}case "round1Rect":{f.AddAdj("adj",15,"16667");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dx1",0,"ss","a","100000");f.AddGuide("x1",1,"r","0","dx1"); f.AddGuide("idx",0,"dx1","29289","100000");f.AddGuide("ir",1,"r","0","idx");f.AddHandleXY("adj","0","50000",undefined,"0","0","x1","t");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","t","ir","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","t");f.AddPathCommand(3,"dx1","dx1","_3cd4","cd4");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6); break}case "round2DiagRect":{f.AddAdj("adj1",15,"16667");f.AddAdj("adj2",15,"0");f.AddGuide("a1",10,"0","adj1","50000");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("x1",0,"ss","a1","100000");f.AddGuide("y1",1,"b","0","x1");f.AddGuide("a",0,"ss","a2","100000");f.AddGuide("x2",1,"r","0","a");f.AddGuide("y2",1,"b","0","a");f.AddGuide("dx1",0,"x1","29289","100000");f.AddGuide("dx2",0,"a","29289","100000");f.AddGuide("d",1,"dx1","0","dx2");f.AddGuide("dx",3,"d","dx1","dx2");f.AddGuide("ir",1,"r", "0","dx");f.AddGuide("ib",1,"b","0","dx");f.AddHandleXY("adj1","0","50000",undefined,"0","0","x1","t");f.AddHandleXY("adj2","0","50000",undefined,"0","0","x2","t");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("dx","dx","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(2,"x2","t");f.AddPathCommand(3,"a","a","_3cd4","cd4");f.AddPathCommand(2,"r","y1");f.AddPathCommand(3, "x1","x1","0","cd4");f.AddPathCommand(2,"a","b");f.AddPathCommand(3,"a","a","cd4","cd4");f.AddPathCommand(2,"l","x1");f.AddPathCommand(3,"x1","x1","cd2","cd4");f.AddPathCommand(6);break}case "round2SameRect":{f.AddAdj("adj1",15,"16667");f.AddAdj("adj2",15,"0");f.AddGuide("a1",10,"0","adj1","50000");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("tx1",0,"ss","a1","100000");f.AddGuide("tx2",1,"r","0","tx1");f.AddGuide("bx1",0,"ss","a2","100000");f.AddGuide("bx2",1,"r","0","bx1");f.AddGuide("by1", 1,"b","0","bx1");f.AddGuide("d",1,"tx1","0","bx1");f.AddGuide("tdx",0,"tx1","29289","100000");f.AddGuide("bdx",0,"bx1","29289","100000");f.AddGuide("il",3,"d","tdx","bdx");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","bdx");f.AddHandleXY("adj1","0","50000",undefined,"0","0","tx2","t");f.AddHandleXY("adj2","0","50000",undefined,"0","0","bx1","b");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("il","tdx","ir","ib");f.AddPathCommand(0, undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"tx1","t");f.AddPathCommand(2,"tx2","t");f.AddPathCommand(3,"tx1","tx1","_3cd4","cd4");f.AddPathCommand(2,"r","by1");f.AddPathCommand(3,"bx1","bx1","0","cd4");f.AddPathCommand(2,"bx1","b");f.AddPathCommand(3,"bx1","bx1","cd4","cd4");f.AddPathCommand(2,"l","tx1");f.AddPathCommand(3,"tx1","tx1","cd2","cd4");f.AddPathCommand(6);break}case "roundRect":{f.AddAdj("adj",15,"16667");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("x1", 0,"ss","a","100000");f.AddGuide("x2",1,"r","0","x1");f.AddGuide("y2",1,"b","0","x1");f.AddGuide("il",0,"x1","29289","100000");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","il");f.AddHandleXY("adj","0","50000",undefined,"0","0","x1","t");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","il","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","x1");f.AddPathCommand(3,"x1", "x1","cd2","cd4");f.AddPathCommand(2,"x2","t");f.AddPathCommand(3,"x1","x1","_3cd4","cd4");f.AddPathCommand(2,"r","y2");f.AddPathCommand(3,"x1","x1","0","cd4");f.AddPathCommand(2,"x1","b");f.AddPathCommand(3,"x1","x1","cd4","cd4");f.AddPathCommand(6);break}case "rtTriangle":{f.AddGuide("it",0,"h","7","12");f.AddGuide("ir",0,"w","7","12");f.AddGuide("ib",0,"h","11","12");f.AddCnx("_3cd4","l","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","l","b");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","r","b");f.AddCnx("0", "hc","vc");f.AddRect("wd12","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"l","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(6);break}case "smileyFace":{f.AddAdj("adj",15,"4653");f.AddGuide("a",10,"-4653","adj","4653");f.AddGuide("x1",0,"w","4969","21699");f.AddGuide("x2",0,"w","6215","21600");f.AddGuide("x3",0,"w","13135","21600");f.AddGuide("x4",0,"w","16640","21600");f.AddGuide("y1",0,"h","7570","21600"); f.AddGuide("y3",0,"h","16515","21600");f.AddGuide("dy2",0,"h","a","100000");f.AddGuide("y2",1,"y3","0","dy2");f.AddGuide("y4",1,"y3","dy2","0");f.AddGuide("dy3",0,"h","a","50000");f.AddGuide("y5",1,"y4","dy3","0");f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddGuide("wR",0,"w","1125","21600");f.AddGuide("hR",0,"h","1125","21600");f.AddHandleXY(undefined, "0","0","adj","-4653","4653","hc","y4");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","il","it");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","il","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","ir","ib");f.AddCnx("0","r","vc");f.AddCnx("_3cd4","ir","it");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,false,undefined,false,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","21600000");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",undefined,undefined,undefined); f.AddPathCommand(1,"x2","y1");f.AddPathCommand(3,"wR","hR","cd2","21600000");f.AddPathCommand(1,"x3","y1");f.AddPathCommand(3,"wR","hR","cd2","21600000");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y2");f.AddPathCommand(4,"hc","y5","x4","y2");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","21600000");f.AddPathCommand(6);break}case "snip1Rect":{f.AddAdj("adj",15,"16667"); f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dx1",0,"ss","a","100000");f.AddGuide("x1",1,"r","0","dx1");f.AddGuide("it",0,"dx1","1","2");f.AddGuide("ir",2,"x1","r","2");f.AddHandleXY("adj","0","50000",undefined,"0","0","x1","t");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("l","it","ir","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2, "r","dx1");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "snip2DiagRect":{f.AddAdj("adj1",15,"0");f.AddAdj("adj2",15,"16667");f.AddGuide("a1",10,"0","adj1","50000");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("lx1",0,"ss","a1","100000");f.AddGuide("lx2",1,"r","0","lx1");f.AddGuide("ly1",1,"b","0","lx1");f.AddGuide("rx1",0,"ss","a2","100000");f.AddGuide("rx2",1,"r","0","rx1");f.AddGuide("ry1",1,"b","0","rx1");f.AddGuide("d",1,"lx1","0","rx1");f.AddGuide("dx", 3,"d","lx1","rx1");f.AddGuide("il",0,"dx","1","2");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","il");f.AddHandleXY("adj1","0","50000",undefined,"0","0","lx1","t");f.AddHandleXY("adj2","0","50000",undefined,"0","0","rx2","t");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("il","il","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"lx1","t");f.AddPathCommand(2,"rx2","t");f.AddPathCommand(2, "r","rx1");f.AddPathCommand(2,"r","ly1");f.AddPathCommand(2,"lx2","b");f.AddPathCommand(2,"rx1","b");f.AddPathCommand(2,"l","ry1");f.AddPathCommand(2,"l","lx1");f.AddPathCommand(6);break}case "snip2SameRect":{f.AddAdj("adj1",15,"16667");f.AddAdj("adj2",15,"0");f.AddGuide("a1",10,"0","adj1","50000");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("tx1",0,"ss","a1","100000");f.AddGuide("tx2",1,"r","0","tx1");f.AddGuide("bx1",0,"ss","a2","100000");f.AddGuide("bx2",1,"r","0","bx1");f.AddGuide("by1", 1,"b","0","bx1");f.AddGuide("d",1,"tx1","0","bx1");f.AddGuide("dx",3,"d","tx1","bx1");f.AddGuide("il",0,"dx","1","2");f.AddGuide("ir",1,"r","0","il");f.AddGuide("it",0,"tx1","1","2");f.AddGuide("ib",2,"by1","b","2");f.AddHandleXY("adj1","0","50000",undefined,"0","0","tx2","t");f.AddHandleXY("adj2","0","50000",undefined,"0","0","bx1","b");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined, undefined,undefined,undefined);f.AddPathCommand(1,"tx1","t");f.AddPathCommand(2,"tx2","t");f.AddPathCommand(2,"r","tx1");f.AddPathCommand(2,"r","by1");f.AddPathCommand(2,"bx2","b");f.AddPathCommand(2,"bx1","b");f.AddPathCommand(2,"l","by1");f.AddPathCommand(2,"l","tx1");f.AddPathCommand(6);break}case "snipRoundRect":{f.AddAdj("adj1",15,"16667");f.AddAdj("adj2",15,"16667");f.AddGuide("a1",10,"0","adj1","50000");f.AddGuide("a2",10,"0","adj2","50000");f.AddGuide("x1",0,"ss","a1","100000");f.AddGuide("dx2", 0,"ss","a2","100000");f.AddGuide("x2",1,"r","0","dx2");f.AddGuide("il",0,"x1","29289","100000");f.AddGuide("ir",2,"x2","r","2");f.AddHandleXY("adj1","0","50000",undefined,"0","0","x1","t");f.AddHandleXY("adj2","0","50000",undefined,"0","0","x2","t");f.AddCnx("0","r","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","hc","t");f.AddRect("il","il","ir","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(2,"x2", "t");f.AddPathCommand(2,"r","dx2");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(2,"l","x1");f.AddPathCommand(3,"x1","x1","cd2","cd4");f.AddPathCommand(6);break}case "squareTabs":{f.AddGuide("md",9,"w","h","0");f.AddGuide("dx",0,"1","md","20");f.AddGuide("y1",1,"0","b","dx");f.AddGuide("x1",1,"0","r","dx");f.AddCnx("cd2","l","t");f.AddCnx("cd2","l","dx");f.AddCnx("cd2","l","y1");f.AddCnx("cd2","l","b");f.AddCnx("cd2","dx","dx");f.AddCnx("cd2","dx","x1");f.AddCnx("_3cd4", "dx","t");f.AddCnx("_3cd4","x1","t");f.AddCnx("cd4","dx","b");f.AddCnx("cd4","x1","b");f.AddCnx("0","r","t");f.AddCnx("0","r","dx");f.AddCnx("0","r","y1");f.AddCnx("0","r","b");f.AddCnx("0","x1","dx");f.AddCnx("0","x1","y1");f.AddRect("dx","dx","x1","y1");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"dx","t");f.AddPathCommand(2,"dx","dx");f.AddPathCommand(2,"l","dx");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined, undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"dx","y1");f.AddPathCommand(2,"dx","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","dx");f.AddPathCommand(2,"x1","dx");f.AddPathCommand(6);f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"r","y1"); f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"x1","b");f.AddPathCommand(6);break}case "star10":{f.AddAdj("adj",15,"42533");f.AddAdj("hf",15,"105146");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("swd2",0,"wd2","hf","100000");f.AddGuide("dx1",0,"swd2","95106","100000");f.AddGuide("dx2",0,"swd2","58779","100000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("dy1",0,"hd2","80902","100000");f.AddGuide("dy2", 0,"hd2","30902","100000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","dy2","0");f.AddGuide("y4",1,"vc","dy1","0");f.AddGuide("iwd2",0,"swd2","a","50000");f.AddGuide("ihd2",0,"hd2","a","50000");f.AddGuide("sdx1",0,"iwd2","80902","100000");f.AddGuide("sdx2",0,"iwd2","30902","100000");f.AddGuide("sdy1",0,"ihd2","95106","100000");f.AddGuide("sdy2",0,"ihd2","58779","100000");f.AddGuide("sx1",1,"hc","0","iwd2");f.AddGuide("sx2",1,"hc","0","sdx1");f.AddGuide("sx3", 1,"hc","0","sdx2");f.AddGuide("sx4",1,"hc","sdx2","0");f.AddGuide("sx5",1,"hc","sdx1","0");f.AddGuide("sx6",1,"hc","iwd2","0");f.AddGuide("sy1",1,"vc","0","sdy1");f.AddGuide("sy2",1,"vc","0","sdy2");f.AddGuide("sy3",1,"vc","sdy2","0");f.AddGuide("sy4",1,"vc","sdy1","0");f.AddGuide("yAdj",1,"vc","0","ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("0","x4","y2");f.AddCnx("0","x4","y3");f.AddCnx("cd4","x3","y4");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","x2","y4");f.AddCnx("cd2", "x1","y3");f.AddCnx("cd2","x1","y2");f.AddCnx("_3cd4","x2","y1");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","x3","y1");f.AddRect("sx2","sy2","sx5","sy3");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y2");f.AddPathCommand(2,"sx2","sy2");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"sx3","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx4","sy1");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"sx5","sy2");f.AddPathCommand(2,"x4","y2"); f.AddPathCommand(2,"sx6","vc");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"sx5","sy3");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"sx4","sy4");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"sx3","sy4");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"sx2","sy3");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"sx1","vc");f.AddPathCommand(6);break}case "star12":{f.AddAdj("adj",15,"37500");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dx1",7,"wd2","1800000");f.AddGuide("dy1",12,"hd2", "3600000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x3",0,"w","3","4");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y3",0,"h","3","4");f.AddGuide("y4",1,"vc","dy1","0");f.AddGuide("iwd2",0,"wd2","a","50000");f.AddGuide("ihd2",0,"hd2","a","50000");f.AddGuide("sdx1",7,"iwd2","900000");f.AddGuide("sdx2",7,"iwd2","2700000");f.AddGuide("sdx3",7,"iwd2","4500000");f.AddGuide("sdy1",12,"ihd2","4500000");f.AddGuide("sdy2",12,"ihd2","2700000");f.AddGuide("sdy3",12,"ihd2", "900000");f.AddGuide("sx1",1,"hc","0","sdx1");f.AddGuide("sx2",1,"hc","0","sdx2");f.AddGuide("sx3",1,"hc","0","sdx3");f.AddGuide("sx4",1,"hc","sdx3","0");f.AddGuide("sx5",1,"hc","sdx2","0");f.AddGuide("sx6",1,"hc","sdx1","0");f.AddGuide("sy1",1,"vc","0","sdy1");f.AddGuide("sy2",1,"vc","0","sdy2");f.AddGuide("sy3",1,"vc","0","sdy3");f.AddGuide("sy4",1,"vc","sdy3","0");f.AddGuide("sy5",1,"vc","sdy2","0");f.AddGuide("sy6",1,"vc","sdy1","0");f.AddGuide("yAdj",1,"vc","0","ihd2");f.AddHandleXY(undefined, "0","0","adj","0","50000","hc","yAdj");f.AddCnx("0","x4","hd4");f.AddCnx("0","r","vc");f.AddCnx("0","x4","y3");f.AddCnx("cd4","x3","y4");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","wd4","y4");f.AddCnx("cd2","x1","y3");f.AddCnx("cd2","l","vc");f.AddCnx("cd2","x1","hd4");f.AddCnx("_3cd4","wd4","y1");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","x3","y1");f.AddRect("sx2","sy2","sx5","sy5");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2, "sx1","sy3");f.AddPathCommand(2,"x1","hd4");f.AddPathCommand(2,"sx2","sy2");f.AddPathCommand(2,"wd4","y1");f.AddPathCommand(2,"sx3","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx4","sy1");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"sx5","sy2");f.AddPathCommand(2,"x4","hd4");f.AddPathCommand(2,"sx6","sy3");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"sx6","sy4");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"sx5","sy5");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"sx4", "sy6");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"sx3","sy6");f.AddPathCommand(2,"wd4","y4");f.AddPathCommand(2,"sx2","sy5");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"sx1","sy4");f.AddPathCommand(6);break}case "star16":{f.AddAdj("adj",15,"37500");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dx1",0,"wd2","92388","100000");f.AddGuide("dx2",0,"wd2","70711","100000");f.AddGuide("dx3",0,"wd2","38268","100000");f.AddGuide("dy1",0,"hd2","92388","100000");f.AddGuide("dy2",0,"hd2","70711", "100000");f.AddGuide("dy3",0,"hd2","38268","100000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","0","dx3");f.AddGuide("x4",1,"hc","dx3","0");f.AddGuide("x5",1,"hc","dx2","0");f.AddGuide("x6",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","0","dy3");f.AddGuide("y4",1,"vc","dy3","0");f.AddGuide("y5",1,"vc","dy2","0");f.AddGuide("y6",1,"vc","dy1","0");f.AddGuide("iwd2",0,"wd2","a","50000");f.AddGuide("ihd2", 0,"hd2","a","50000");f.AddGuide("sdx1",0,"iwd2","98079","100000");f.AddGuide("sdx2",0,"iwd2","83147","100000");f.AddGuide("sdx3",0,"iwd2","55557","100000");f.AddGuide("sdx4",0,"iwd2","19509","100000");f.AddGuide("sdy1",0,"ihd2","98079","100000");f.AddGuide("sdy2",0,"ihd2","83147","100000");f.AddGuide("sdy3",0,"ihd2","55557","100000");f.AddGuide("sdy4",0,"ihd2","19509","100000");f.AddGuide("sx1",1,"hc","0","sdx1");f.AddGuide("sx2",1,"hc","0","sdx2");f.AddGuide("sx3",1,"hc","0","sdx3");f.AddGuide("sx4", 1,"hc","0","sdx4");f.AddGuide("sx5",1,"hc","sdx4","0");f.AddGuide("sx6",1,"hc","sdx3","0");f.AddGuide("sx7",1,"hc","sdx2","0");f.AddGuide("sx8",1,"hc","sdx1","0");f.AddGuide("sy1",1,"vc","0","sdy1");f.AddGuide("sy2",1,"vc","0","sdy2");f.AddGuide("sy3",1,"vc","0","sdy3");f.AddGuide("sy4",1,"vc","0","sdy4");f.AddGuide("sy5",1,"vc","sdy4","0");f.AddGuide("sy6",1,"vc","sdy3","0");f.AddGuide("sy7",1,"vc","sdy2","0");f.AddGuide("sy8",1,"vc","sdy1","0");f.AddGuide("idx",7,"iwd2","2700000");f.AddGuide("idy", 12,"ihd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("ib",1,"vc","idy","0");f.AddGuide("yAdj",1,"vc","0","ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("0","x5","y2");f.AddCnx("0","x6","y3");f.AddCnx("0","r","vc");f.AddCnx("0","x6","y4");f.AddCnx("0","x5","y5");f.AddCnx("cd4","x4","y6");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","x3","y6");f.AddCnx("cd2","x2","y5");f.AddCnx("cd2","x1","y4"); f.AddCnx("cd2","l","vc");f.AddCnx("cd2","x1","y3");f.AddCnx("cd2","x2","y2");f.AddCnx("_3cd4","x3","y1");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","x4","y1");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"sx1","sy4");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"sx2","sy3");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"sx3","sy2");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"sx4", "sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx5","sy1");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"sx6","sy2");f.AddPathCommand(2,"x5","y2");f.AddPathCommand(2,"sx7","sy3");f.AddPathCommand(2,"x6","y3");f.AddPathCommand(2,"sx8","sy4");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"sx8","sy5");f.AddPathCommand(2,"x6","y4");f.AddPathCommand(2,"sx7","sy6");f.AddPathCommand(2,"x5","y5");f.AddPathCommand(2,"sx6","sy7");f.AddPathCommand(2,"x4","y6");f.AddPathCommand(2,"sx5","sy8"); f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"sx4","sy8");f.AddPathCommand(2,"x3","y6");f.AddPathCommand(2,"sx3","sy7");f.AddPathCommand(2,"x2","y5");f.AddPathCommand(2,"sx2","sy6");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"sx1","sy5");f.AddPathCommand(6);break}case "star24":{f.AddAdj("adj",15,"37500");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dx1",7,"wd2","900000");f.AddGuide("dx2",7,"wd2","1800000");f.AddGuide("dx3",7,"wd2","2700000");f.AddGuide("dx4",15,"wd4");f.AddGuide("dx5", 7,"wd2","4500000");f.AddGuide("dy1",12,"hd2","4500000");f.AddGuide("dy2",12,"hd2","3600000");f.AddGuide("dy3",12,"hd2","2700000");f.AddGuide("dy4",15,"hd4");f.AddGuide("dy5",12,"hd2","900000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","0","dx3");f.AddGuide("x4",1,"hc","0","dx4");f.AddGuide("x5",1,"hc","0","dx5");f.AddGuide("x6",1,"hc","dx5","0");f.AddGuide("x7",1,"hc","dx4","0");f.AddGuide("x8",1,"hc","dx3","0");f.AddGuide("x9",1,"hc","dx2","0");f.AddGuide("x10", 1,"hc","dx1","0");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","0","dy3");f.AddGuide("y4",1,"vc","0","dy4");f.AddGuide("y5",1,"vc","0","dy5");f.AddGuide("y6",1,"vc","dy5","0");f.AddGuide("y7",1,"vc","dy4","0");f.AddGuide("y8",1,"vc","dy3","0");f.AddGuide("y9",1,"vc","dy2","0");f.AddGuide("y10",1,"vc","dy1","0");f.AddGuide("iwd2",0,"wd2","a","50000");f.AddGuide("ihd2",0,"hd2","a","50000");f.AddGuide("sdx1",0,"iwd2","99144","100000");f.AddGuide("sdx2",0, "iwd2","92388","100000");f.AddGuide("sdx3",0,"iwd2","79335","100000");f.AddGuide("sdx4",0,"iwd2","60876","100000");f.AddGuide("sdx5",0,"iwd2","38268","100000");f.AddGuide("sdx6",0,"iwd2","13053","100000");f.AddGuide("sdy1",0,"ihd2","99144","100000");f.AddGuide("sdy2",0,"ihd2","92388","100000");f.AddGuide("sdy3",0,"ihd2","79335","100000");f.AddGuide("sdy4",0,"ihd2","60876","100000");f.AddGuide("sdy5",0,"ihd2","38268","100000");f.AddGuide("sdy6",0,"ihd2","13053","100000");f.AddGuide("sx1",1,"hc","0", "sdx1");f.AddGuide("sx2",1,"hc","0","sdx2");f.AddGuide("sx3",1,"hc","0","sdx3");f.AddGuide("sx4",1,"hc","0","sdx4");f.AddGuide("sx5",1,"hc","0","sdx5");f.AddGuide("sx6",1,"hc","0","sdx6");f.AddGuide("sx7",1,"hc","sdx6","0");f.AddGuide("sx8",1,"hc","sdx5","0");f.AddGuide("sx9",1,"hc","sdx4","0");f.AddGuide("sx10",1,"hc","sdx3","0");f.AddGuide("sx11",1,"hc","sdx2","0");f.AddGuide("sx12",1,"hc","sdx1","0");f.AddGuide("sy1",1,"vc","0","sdy1");f.AddGuide("sy2",1,"vc","0","sdy2");f.AddGuide("sy3",1,"vc", "0","sdy3");f.AddGuide("sy4",1,"vc","0","sdy4");f.AddGuide("sy5",1,"vc","0","sdy5");f.AddGuide("sy6",1,"vc","0","sdy6");f.AddGuide("sy7",1,"vc","sdy6","0");f.AddGuide("sy8",1,"vc","sdy5","0");f.AddGuide("sy9",1,"vc","sdy4","0");f.AddGuide("sy10",1,"vc","sdy3","0");f.AddGuide("sy11",1,"vc","sdy2","0");f.AddGuide("sy12",1,"vc","sdy1","0");f.AddGuide("idx",7,"iwd2","2700000");f.AddGuide("idy",12,"ihd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ir",1,"hc", "idx","0");f.AddGuide("ib",1,"vc","idy","0");f.AddGuide("yAdj",1,"vc","0","ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"sx1","sy6");f.AddPathCommand(2,"x1","y5");f.AddPathCommand(2,"sx2","sy5");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2, "sx3","sy4");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"sx4","sy3");f.AddPathCommand(2,"x4","y2");f.AddPathCommand(2,"sx5","sy2");f.AddPathCommand(2,"x5","y1");f.AddPathCommand(2,"sx6","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx7","sy1");f.AddPathCommand(2,"x6","y1");f.AddPathCommand(2,"sx8","sy2");f.AddPathCommand(2,"x7","y2");f.AddPathCommand(2,"sx9","sy3");f.AddPathCommand(2,"x8","y3");f.AddPathCommand(2,"sx10","sy4");f.AddPathCommand(2,"x9","y4");f.AddPathCommand(2,"sx11", "sy5");f.AddPathCommand(2,"x10","y5");f.AddPathCommand(2,"sx12","sy6");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"sx12","sy7");f.AddPathCommand(2,"x10","y6");f.AddPathCommand(2,"sx11","sy8");f.AddPathCommand(2,"x9","y7");f.AddPathCommand(2,"sx10","sy9");f.AddPathCommand(2,"x8","y8");f.AddPathCommand(2,"sx9","sy10");f.AddPathCommand(2,"x7","y9");f.AddPathCommand(2,"sx8","sy11");f.AddPathCommand(2,"x6","y10");f.AddPathCommand(2,"sx7","sy12");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"sx6", "sy12");f.AddPathCommand(2,"x5","y10");f.AddPathCommand(2,"sx5","sy11");f.AddPathCommand(2,"x4","y9");f.AddPathCommand(2,"sx4","sy10");f.AddPathCommand(2,"x3","y8");f.AddPathCommand(2,"sx3","sy9");f.AddPathCommand(2,"x2","y7");f.AddPathCommand(2,"sx2","sy8");f.AddPathCommand(2,"x1","y6");f.AddPathCommand(2,"sx1","sy7");f.AddPathCommand(6);break}case "star32":{f.AddAdj("adj",15,"37500");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dx1",0,"wd2","98079","100000");f.AddGuide("dx2",0,"wd2","92388", "100000");f.AddGuide("dx3",0,"wd2","83147","100000");f.AddGuide("dx4",7,"wd2","2700000");f.AddGuide("dx5",0,"wd2","55557","100000");f.AddGuide("dx6",0,"wd2","38268","100000");f.AddGuide("dx7",0,"wd2","19509","100000");f.AddGuide("dy1",0,"hd2","98079","100000");f.AddGuide("dy2",0,"hd2","92388","100000");f.AddGuide("dy3",0,"hd2","83147","100000");f.AddGuide("dy4",12,"hd2","2700000");f.AddGuide("dy5",0,"hd2","55557","100000");f.AddGuide("dy6",0,"hd2","38268","100000");f.AddGuide("dy7",0,"hd2","19509", "100000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","0","dx3");f.AddGuide("x4",1,"hc","0","dx4");f.AddGuide("x5",1,"hc","0","dx5");f.AddGuide("x6",1,"hc","0","dx6");f.AddGuide("x7",1,"hc","0","dx7");f.AddGuide("x8",1,"hc","dx7","0");f.AddGuide("x9",1,"hc","dx6","0");f.AddGuide("x10",1,"hc","dx5","0");f.AddGuide("x11",1,"hc","dx4","0");f.AddGuide("x12",1,"hc","dx3","0");f.AddGuide("x13",1,"hc","dx2","0");f.AddGuide("x14",1,"hc","dx1","0");f.AddGuide("y1", 1,"vc","0","dy1");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","0","dy3");f.AddGuide("y4",1,"vc","0","dy4");f.AddGuide("y5",1,"vc","0","dy5");f.AddGuide("y6",1,"vc","0","dy6");f.AddGuide("y7",1,"vc","0","dy7");f.AddGuide("y8",1,"vc","dy7","0");f.AddGuide("y9",1,"vc","dy6","0");f.AddGuide("y10",1,"vc","dy5","0");f.AddGuide("y11",1,"vc","dy4","0");f.AddGuide("y12",1,"vc","dy3","0");f.AddGuide("y13",1,"vc","dy2","0");f.AddGuide("y14",1,"vc","dy1","0");f.AddGuide("iwd2",0,"wd2","a","50000"); f.AddGuide("ihd2",0,"hd2","a","50000");f.AddGuide("sdx1",0,"iwd2","99518","100000");f.AddGuide("sdx2",0,"iwd2","95694","100000");f.AddGuide("sdx3",0,"iwd2","88192","100000");f.AddGuide("sdx4",0,"iwd2","77301","100000");f.AddGuide("sdx5",0,"iwd2","63439","100000");f.AddGuide("sdx6",0,"iwd2","47140","100000");f.AddGuide("sdx7",0,"iwd2","29028","100000");f.AddGuide("sdx8",0,"iwd2","9802","100000");f.AddGuide("sdy1",0,"ihd2","99518","100000");f.AddGuide("sdy2",0,"ihd2","95694","100000");f.AddGuide("sdy3", 0,"ihd2","88192","100000");f.AddGuide("sdy4",0,"ihd2","77301","100000");f.AddGuide("sdy5",0,"ihd2","63439","100000");f.AddGuide("sdy6",0,"ihd2","47140","100000");f.AddGuide("sdy7",0,"ihd2","29028","100000");f.AddGuide("sdy8",0,"ihd2","9802","100000");f.AddGuide("sx1",1,"hc","0","sdx1");f.AddGuide("sx2",1,"hc","0","sdx2");f.AddGuide("sx3",1,"hc","0","sdx3");f.AddGuide("sx4",1,"hc","0","sdx4");f.AddGuide("sx5",1,"hc","0","sdx5");f.AddGuide("sx6",1,"hc","0","sdx6");f.AddGuide("sx7",1,"hc","0","sdx7"); f.AddGuide("sx8",1,"hc","0","sdx8");f.AddGuide("sx9",1,"hc","sdx8","0");f.AddGuide("sx10",1,"hc","sdx7","0");f.AddGuide("sx11",1,"hc","sdx6","0");f.AddGuide("sx12",1,"hc","sdx5","0");f.AddGuide("sx13",1,"hc","sdx4","0");f.AddGuide("sx14",1,"hc","sdx3","0");f.AddGuide("sx15",1,"hc","sdx2","0");f.AddGuide("sx16",1,"hc","sdx1","0");f.AddGuide("sy1",1,"vc","0","sdy1");f.AddGuide("sy2",1,"vc","0","sdy2");f.AddGuide("sy3",1,"vc","0","sdy3");f.AddGuide("sy4",1,"vc","0","sdy4");f.AddGuide("sy5",1,"vc","0", "sdy5");f.AddGuide("sy6",1,"vc","0","sdy6");f.AddGuide("sy7",1,"vc","0","sdy7");f.AddGuide("sy8",1,"vc","0","sdy8");f.AddGuide("sy9",1,"vc","sdy8","0");f.AddGuide("sy10",1,"vc","sdy7","0");f.AddGuide("sy11",1,"vc","sdy6","0");f.AddGuide("sy12",1,"vc","sdy5","0");f.AddGuide("sy13",1,"vc","sdy4","0");f.AddGuide("sy14",1,"vc","sdy3","0");f.AddGuide("sy15",1,"vc","sdy2","0");f.AddGuide("sy16",1,"vc","sdy1","0");f.AddGuide("idx",7,"iwd2","2700000");f.AddGuide("idy",12,"ihd2","2700000");f.AddGuide("il", 1,"hc","0","idx");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("ib",1,"vc","idy","0");f.AddGuide("yAdj",1,"vc","0","ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"sx1","sy8");f.AddPathCommand(2, "x1","y7");f.AddPathCommand(2,"sx2","sy7");f.AddPathCommand(2,"x2","y6");f.AddPathCommand(2,"sx3","sy6");f.AddPathCommand(2,"x3","y5");f.AddPathCommand(2,"sx4","sy5");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(2,"sx5","sy4");f.AddPathCommand(2,"x5","y3");f.AddPathCommand(2,"sx6","sy3");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"sx7","sy2");f.AddPathCommand(2,"x7","y1");f.AddPathCommand(2,"sx8","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx9","sy1");f.AddPathCommand(2,"x8","y1"); f.AddPathCommand(2,"sx10","sy2");f.AddPathCommand(2,"x9","y2");f.AddPathCommand(2,"sx11","sy3");f.AddPathCommand(2,"x10","y3");f.AddPathCommand(2,"sx12","sy4");f.AddPathCommand(2,"x11","y4");f.AddPathCommand(2,"sx13","sy5");f.AddPathCommand(2,"x12","y5");f.AddPathCommand(2,"sx14","sy6");f.AddPathCommand(2,"x13","y6");f.AddPathCommand(2,"sx15","sy7");f.AddPathCommand(2,"x14","y7");f.AddPathCommand(2,"sx16","sy8");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"sx16","sy9");f.AddPathCommand(2,"x14", "y8");f.AddPathCommand(2,"sx15","sy10");f.AddPathCommand(2,"x13","y9");f.AddPathCommand(2,"sx14","sy11");f.AddPathCommand(2,"x12","y10");f.AddPathCommand(2,"sx13","sy12");f.AddPathCommand(2,"x11","y11");f.AddPathCommand(2,"sx12","sy13");f.AddPathCommand(2,"x10","y12");f.AddPathCommand(2,"sx11","sy14");f.AddPathCommand(2,"x9","y13");f.AddPathCommand(2,"sx10","sy15");f.AddPathCommand(2,"x8","y14");f.AddPathCommand(2,"sx9","sy16");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"sx8","sy16");f.AddPathCommand(2, "x7","y14");f.AddPathCommand(2,"sx7","sy15");f.AddPathCommand(2,"x6","y13");f.AddPathCommand(2,"sx6","sy14");f.AddPathCommand(2,"x5","y12");f.AddPathCommand(2,"sx5","sy13");f.AddPathCommand(2,"x4","y11");f.AddPathCommand(2,"sx4","sy12");f.AddPathCommand(2,"x3","y10");f.AddPathCommand(2,"sx3","sy11");f.AddPathCommand(2,"x2","y9");f.AddPathCommand(2,"sx2","sy10");f.AddPathCommand(2,"x1","y8");f.AddPathCommand(2,"sx1","sy9");f.AddPathCommand(6);break}case "star4":{f.AddAdj("adj",15,"12500");f.AddGuide("a", 10,"0","adj","50000");f.AddGuide("iwd2",0,"wd2","a","50000");f.AddGuide("ihd2",0,"hd2","a","50000");f.AddGuide("sdx",7,"iwd2","2700000");f.AddGuide("sdy",12,"ihd2","2700000");f.AddGuide("sx1",1,"hc","0","sdx");f.AddGuide("sx2",1,"hc","sdx","0");f.AddGuide("sy1",1,"vc","0","sdy");f.AddGuide("sy2",1,"vc","sdy","0");f.AddGuide("yAdj",1,"vc","0","ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0", "r","vc");f.AddRect("sx1","sy1","sx2","sy2");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"sx1","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx2","sy1");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"sx2","sy2");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"sx1","sy2");f.AddPathCommand(6);break}case "star5":{f.AddAdj("adj",15,"19098");f.AddAdj("hf",15,"105146");f.AddAdj("vf",15,"110557");f.AddGuide("a",10,"0", "adj","50000");f.AddGuide("swd2",0,"wd2","hf","100000");f.AddGuide("shd2",0,"hd2","vf","100000");f.AddGuide("svc",0,"vc","vf","100000");f.AddGuide("dx1",7,"swd2","1080000");f.AddGuide("dx2",7,"swd2","18360000");f.AddGuide("dy1",12,"shd2","1080000");f.AddGuide("dy2",12,"shd2","18360000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("y1",1,"svc","0","dy1");f.AddGuide("y2",1,"svc","0","dy2");f.AddGuide("iwd2", 0,"swd2","a","50000");f.AddGuide("ihd2",0,"shd2","a","50000");f.AddGuide("sdx1",7,"iwd2","20520000");f.AddGuide("sdx2",7,"iwd2","3240000");f.AddGuide("sdy1",12,"ihd2","3240000");f.AddGuide("sdy2",12,"ihd2","20520000");f.AddGuide("sx1",1,"hc","0","sdx1");f.AddGuide("sx2",1,"hc","0","sdx2");f.AddGuide("sx3",1,"hc","sdx2","0");f.AddGuide("sx4",1,"hc","sdx1","0");f.AddGuide("sy1",1,"svc","0","sdy1");f.AddGuide("sy2",1,"svc","0","sdy2");f.AddGuide("sy3",1,"svc","ihd2","0");f.AddGuide("yAdj",1,"svc","0", "ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","x1","y1");f.AddCnx("cd4","x2","y2");f.AddCnx("cd4","x3","y2");f.AddCnx("0","x4","y1");f.AddRect("sx1","sy1","sx4","sy3");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(2,"sx2","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx3","sy1");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"sx4","sy2");f.AddPathCommand(2, "x3","y2");f.AddPathCommand(2,"hc","sy3");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"sx1","sy2");f.AddPathCommand(6);break}case "star6":{f.AddAdj("adj",15,"28868");f.AddAdj("hf",15,"115470");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("swd2",0,"wd2","hf","100000");f.AddGuide("dx1",7,"swd2","1800000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","dx1","0");f.AddGuide("y2",1,"vc","hd4","0");f.AddGuide("iwd2",0,"swd2","a","50000");f.AddGuide("ihd2",0,"hd2","a","50000");f.AddGuide("sdx2", 0,"iwd2","1","2");f.AddGuide("sx1",1,"hc","0","iwd2");f.AddGuide("sx2",1,"hc","0","sdx2");f.AddGuide("sx3",1,"hc","sdx2","0");f.AddGuide("sx4",1,"hc","iwd2","0");f.AddGuide("sdy1",12,"ihd2","3600000");f.AddGuide("sy1",1,"vc","0","sdy1");f.AddGuide("sy2",1,"vc","sdy1","0");f.AddGuide("yAdj",1,"vc","0","ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("0","x2","hd4");f.AddCnx("0","x2","y2");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","x1","y2");f.AddCnx("cd2","x1","hd4");f.AddCnx("_3cd4", "hc","t");f.AddRect("sx1","sy1","sx4","sy2");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","hd4");f.AddPathCommand(2,"sx2","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx3","sy1");f.AddPathCommand(2,"x2","hd4");f.AddPathCommand(2,"sx4","vc");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"sx3","sy2");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"sx2","sy2");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(2,"sx1","vc");f.AddPathCommand(6); break}case "star7":{f.AddAdj("adj",15,"34601");f.AddAdj("hf",15,"102572");f.AddAdj("vf",15,"105210");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("swd2",0,"wd2","hf","100000");f.AddGuide("shd2",0,"hd2","vf","100000");f.AddGuide("svc",0,"vc","vf","100000");f.AddGuide("dx1",0,"swd2","97493","100000");f.AddGuide("dx2",0,"swd2","78183","100000");f.AddGuide("dx3",0,"swd2","43388","100000");f.AddGuide("dy1",0,"shd2","62349","100000");f.AddGuide("dy2",0,"shd2","22252","100000");f.AddGuide("dy3",0,"shd2", "90097","100000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","0","dx3");f.AddGuide("x4",1,"hc","dx3","0");f.AddGuide("x5",1,"hc","dx2","0");f.AddGuide("x6",1,"hc","dx1","0");f.AddGuide("y1",1,"svc","0","dy1");f.AddGuide("y2",1,"svc","dy2","0");f.AddGuide("y3",1,"svc","dy3","0");f.AddGuide("iwd2",0,"swd2","a","50000");f.AddGuide("ihd2",0,"shd2","a","50000");f.AddGuide("sdx1",0,"iwd2","97493","100000");f.AddGuide("sdx2",0,"iwd2","78183","100000");f.AddGuide("sdx3", 0,"iwd2","43388","100000");f.AddGuide("sx1",1,"hc","0","sdx1");f.AddGuide("sx2",1,"hc","0","sdx2");f.AddGuide("sx3",1,"hc","0","sdx3");f.AddGuide("sx4",1,"hc","sdx3","0");f.AddGuide("sx5",1,"hc","sdx2","0");f.AddGuide("sx6",1,"hc","sdx1","0");f.AddGuide("sdy1",0,"ihd2","90097","100000");f.AddGuide("sdy2",0,"ihd2","22252","100000");f.AddGuide("sdy3",0,"ihd2","62349","100000");f.AddGuide("sy1",1,"svc","0","sdy1");f.AddGuide("sy2",1,"svc","0","sdy2");f.AddGuide("sy3",1,"svc","sdy3","0");f.AddGuide("sy4", 1,"svc","ihd2","0");f.AddGuide("yAdj",1,"svc","0","ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("0","x5","y1");f.AddCnx("0","x6","y2");f.AddCnx("cd4","x4","y3");f.AddCnx("cd4","x3","y3");f.AddCnx("cd2","x1","y2");f.AddCnx("cd2","x2","y1");f.AddCnx("_3cd4","hc","t");f.AddRect("sx2","sy1","sx5","sy3");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x1","y2");f.AddPathCommand(2,"sx1","sy2");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2, "sx3","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx4","sy1");f.AddPathCommand(2,"x5","y1");f.AddPathCommand(2,"sx6","sy2");f.AddPathCommand(2,"x6","y2");f.AddPathCommand(2,"sx5","sy3");f.AddPathCommand(2,"x4","y3");f.AddPathCommand(2,"hc","sy4");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"sx2","sy3");f.AddPathCommand(6);break}case "star8":{f.AddAdj("adj",15,"37500");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dx1",7,"wd2","2700000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2", 1,"hc","dx1","0");f.AddGuide("dy1",12,"hd2","2700000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","dy1","0");f.AddGuide("iwd2",0,"wd2","a","50000");f.AddGuide("ihd2",0,"hd2","a","50000");f.AddGuide("sdx1",0,"iwd2","92388","100000");f.AddGuide("sdx2",0,"iwd2","38268","100000");f.AddGuide("sdy1",0,"ihd2","92388","100000");f.AddGuide("sdy2",0,"ihd2","38268","100000");f.AddGuide("sx1",1,"hc","0","sdx1");f.AddGuide("sx2",1,"hc","0","sdx2");f.AddGuide("sx3",1,"hc","sdx2","0");f.AddGuide("sx4", 1,"hc","sdx1","0");f.AddGuide("sy1",1,"vc","0","sdy1");f.AddGuide("sy2",1,"vc","0","sdy2");f.AddGuide("sy3",1,"vc","sdy2","0");f.AddGuide("sy4",1,"vc","sdy1","0");f.AddGuide("yAdj",1,"vc","0","ihd2");f.AddHandleXY(undefined,"0","0","adj","0","50000","hc","yAdj");f.AddCnx("0","r","vc");f.AddCnx("cd4","x2","y2");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","x1","y2");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4","x1","y1");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","x2","y1");f.AddRect("sx1","sy1","sx4","sy4"); f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"sx1","sy2");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"sx2","sy1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"sx3","sy1");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"sx4","sy2");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"sx4","sy3");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"sx3","sy4");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"sx2","sy4");f.AddPathCommand(2, "x1","y2");f.AddPathCommand(2,"sx1","sy3");f.AddPathCommand(6);break}case "straightConnector1":{f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","b");break}case "stripedRightArrow":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj2",0,"84375","w","ss");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("x4",0,"ss","5","32");f.AddGuide("dx5", 0,"ss","a2","100000");f.AddGuide("x5",1,"r","0","dx5");f.AddGuide("dy1",0,"h","a1","200000");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("y2",1,"vc","dy1","0");f.AddGuide("dx6",0,"dy1","dx5","hd2");f.AddGuide("x6",1,"r","0","dx6");f.AddHandleXY(undefined,"0","0","adj1","0","100000","l","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x5","t");f.AddCnx("_3cd4","x5","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","x5","b");f.AddCnx("0","r","vc");f.AddRect("x4","y1","x6","y2");f.AddPathCommand(0, undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"ssd32","y1");f.AddPathCommand(2,"ssd32","y2");f.AddPathCommand(2,"l","y2");f.AddPathCommand(6);f.AddPathCommand(1,"ssd16","y1");f.AddPathCommand(2,"ssd8","y1");f.AddPathCommand(2,"ssd8","y2");f.AddPathCommand(2,"ssd16","y2");f.AddPathCommand(6);f.AddPathCommand(1,"x4","y1");f.AddPathCommand(2,"x5","y1");f.AddPathCommand(2,"x5","t");f.AddPathCommand(2,"r","vc");f.AddPathCommand(2,"x5","b");f.AddPathCommand(2, "x5","y2");f.AddPathCommand(2,"x4","y2");f.AddPathCommand(6);break}case "sun":{f.AddAdj("adj",15,"25000");f.AddGuide("a",10,"12500","adj","46875");f.AddGuide("g0",1,"50000","0","a");f.AddGuide("g1",0,"g0","30274","32768");f.AddGuide("g2",0,"g0","12540","32768");f.AddGuide("g3",1,"g1","50000","0");f.AddGuide("g4",1,"g2","50000","0");f.AddGuide("g5",1,"50000","0","g1");f.AddGuide("g6",1,"50000","0","g2");f.AddGuide("g7",0,"g0","23170","32768");f.AddGuide("g8",1,"50000","g7","0");f.AddGuide("g9",1,"50000", "0","g7");f.AddGuide("g10",0,"g5","3","4");f.AddGuide("g11",0,"g6","3","4");f.AddGuide("g12",1,"g10","3662","0");f.AddGuide("g13",1,"g11","3662","0");f.AddGuide("g14",1,"g11","12500","0");f.AddGuide("g15",1,"100000","0","g10");f.AddGuide("g16",1,"100000","0","g12");f.AddGuide("g17",1,"100000","0","g13");f.AddGuide("g18",1,"100000","0","g14");f.AddGuide("ox1",0,"w","18436","21600");f.AddGuide("oy1",0,"h","3163","21600");f.AddGuide("ox2",0,"w","3163","21600");f.AddGuide("oy2",0,"h","18436","21600"); f.AddGuide("x8",0,"w","g8","100000");f.AddGuide("x9",0,"w","g9","100000");f.AddGuide("x10",0,"w","g10","100000");f.AddGuide("x12",0,"w","g12","100000");f.AddGuide("x13",0,"w","g13","100000");f.AddGuide("x14",0,"w","g14","100000");f.AddGuide("x15",0,"w","g15","100000");f.AddGuide("x16",0,"w","g16","100000");f.AddGuide("x17",0,"w","g17","100000");f.AddGuide("x18",0,"w","g18","100000");f.AddGuide("x19",0,"w","a","100000");f.AddGuide("wR",0,"w","g0","100000");f.AddGuide("hR",0,"h","g0","100000");f.AddGuide("y8", 0,"h","g8","100000");f.AddGuide("y9",0,"h","g9","100000");f.AddGuide("y10",0,"h","g10","100000");f.AddGuide("y12",0,"h","g12","100000");f.AddGuide("y13",0,"h","g13","100000");f.AddGuide("y14",0,"h","g14","100000");f.AddGuide("y15",0,"h","g15","100000");f.AddGuide("y16",0,"h","g16","100000");f.AddGuide("y17",0,"h","g17","100000");f.AddGuide("y18",0,"h","g18","100000");f.AddHandleXY("adj","12500","46875",undefined,"0","0","x19","vc");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4", "hc","b");f.AddCnx("0","r","vc");f.AddRect("x9","y9","x8","y8");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"r","vc");f.AddPathCommand(2,"x15","y18");f.AddPathCommand(2,"x15","y14");f.AddPathCommand(6);f.AddPathCommand(1,"ox1","oy1");f.AddPathCommand(2,"x16","y13");f.AddPathCommand(2,"x17","y12");f.AddPathCommand(6);f.AddPathCommand(1,"hc","t");f.AddPathCommand(2,"x18","y10");f.AddPathCommand(2,"x14","y10");f.AddPathCommand(6);f.AddPathCommand(1,"ox2", "oy1");f.AddPathCommand(2,"x13","y12");f.AddPathCommand(2,"x12","y13");f.AddPathCommand(6);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"x10","y14");f.AddPathCommand(2,"x10","y18");f.AddPathCommand(6);f.AddPathCommand(1,"ox2","oy2");f.AddPathCommand(2,"x12","y17");f.AddPathCommand(2,"x13","y16");f.AddPathCommand(6);f.AddPathCommand(1,"hc","b");f.AddPathCommand(2,"x14","y15");f.AddPathCommand(2,"x18","y15");f.AddPathCommand(6);f.AddPathCommand(1,"ox1","oy2");f.AddPathCommand(2,"x17","y16");f.AddPathCommand(2, "x16","y17");f.AddPathCommand(6);f.AddPathCommand(1,"x19","vc");f.AddPathCommand(3,"wR","hR","cd2","21600000");f.AddPathCommand(6);break}case "swooshArrow":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"16667");f.AddGuide("a1",10,"1","adj1","75000");f.AddGuide("maxAdj2",0,"70000","w","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("ad1",0,"h","a1","100000");f.AddGuide("ad2",0,"ss","a2","100000");f.AddGuide("xB",1,"r","0","ad2");f.AddGuide("yB",1,"t","ssd8","0");f.AddGuide("alfa",0,"cd4", "1","14");f.AddGuide("dx0",14,"ssd8","alfa");f.AddGuide("xC",1,"xB","0","dx0");f.AddGuide("dx1",14,"ad1","alfa");f.AddGuide("yF",1,"yB","ad1","0");f.AddGuide("xF",1,"xB","dx1","0");f.AddGuide("xE",1,"xF","dx0","0");f.AddGuide("yE",1,"yF","ssd8","0");f.AddGuide("dy2",1,"yE","0","t");f.AddGuide("dy22",0,"dy2","1","2");f.AddGuide("dy3",0,"h","1","20");f.AddGuide("yD",1,"t","dy22","dy3");f.AddGuide("dy4",0,"hd6","1","1");f.AddGuide("yP1",1,"hd6","dy4","0");f.AddGuide("xP1",15,"wd6");f.AddGuide("dy5", 0,"hd6","1","2");f.AddGuide("yP2",1,"yF","dy5","0");f.AddGuide("xP2",15,"wd4");f.AddHandleXY(undefined,"0","0","adj1","1","75000","xF","yF");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","xB","yB");f.AddCnx("cd4","l","b");f.AddCnx("_3cd4","xC","t");f.AddCnx("0","r","yD");f.AddCnx("cd4","xE","yE");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(4,"xP1","yP1","xB","yB");f.AddPathCommand(2,"xC","t"); f.AddPathCommand(2,"r","yD");f.AddPathCommand(2,"xE","yE");f.AddPathCommand(2,"xF","yF");f.AddPathCommand(4,"xP2","yP2","l","b");f.AddPathCommand(6);break}case "teardrop":{f.AddAdj("adj",15,"100000");f.AddGuide("a",10,"0","adj","200000");f.AddGuide("r2",13,"2");f.AddGuide("tw",0,"wd2","r2","1");f.AddGuide("th",0,"hd2","r2","1");f.AddGuide("sw",0,"tw","a","100000");f.AddGuide("sh",0,"th","a","100000");f.AddGuide("dx1",7,"sw","2700000");f.AddGuide("dy1",12,"sh","2700000");f.AddGuide("x1",1,"hc","dx1", "0");f.AddGuide("y1",1,"vc","0","dy1");f.AddGuide("x2",2,"hc","x1","2");f.AddGuide("y2",2,"vc","y1","2");f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it",1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddHandleXY("adj","0","200000",undefined,"0","0","x1","t");f.AddCnx("0","r","vc");f.AddCnx("cd4","ir","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","il","ib");f.AddCnx("cd2","l","vc");f.AddCnx("_3cd4", "il","it");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","x1","y1");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(3,"wd2","hd2","cd2","cd4");f.AddPathCommand(4,"x2","t","x1","y1");f.AddPathCommand(4,"r","y2","r","vc");f.AddPathCommand(3,"wd2","hd2","0","cd4");f.AddPathCommand(3,"wd2","hd2","cd4","cd4");f.AddPathCommand(6);break}case "trapezoid":{f.AddAdj("adj",15,"25000");f.AddGuide("maxAdj",0,"50000", "w","ss");f.AddGuide("a",10,"0","adj","maxAdj");f.AddGuide("x1",0,"ss","a","200000");f.AddGuide("x2",0,"ss","a","100000");f.AddGuide("x3",1,"r","0","x2");f.AddGuide("x4",1,"r","0","x1");f.AddGuide("il",0,"wd3","a","maxAdj");f.AddGuide("it",0,"hd3","a","maxAdj");f.AddGuide("ir",1,"r","0","il");f.AddHandleXY("adj","0","maxAdj",undefined,"0","0","x2","t");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","x1","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","x4","vc");f.AddRect("il","it","ir","b");f.AddPathCommand(0, undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"x3","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(6);break}case "triangle":{f.AddAdj("adj",15,"50000");f.AddGuide("a",10,"0","adj","100000");f.AddGuide("x1",0,"w","a","200000");f.AddGuide("x2",0,"w","a","100000");f.AddGuide("x3",1,"x1","wd2","0");f.AddHandleXY("adj","0","100000",undefined,"0","0","x2","t");f.AddCnx("_3cd4","x2","t");f.AddCnx("cd2","x1","vc");f.AddCnx("cd4", "l","b");f.AddCnx("cd4","x2","b");f.AddCnx("cd4","r","b");f.AddCnx("0","x3","vc");f.AddRect("x1","vc","x3","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","b");f.AddPathCommand(6);break}case "upArrowCallout":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddAdj("adj4",15,"64977");f.AddGuide("maxAdj2",0,"50000","w","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2"); f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("maxAdj3",0,"100000","h","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("q2",0,"a3","ss","h");f.AddGuide("maxAdj4",1,"100000","0","q2");f.AddGuide("a4",10,"0","adj4","maxAdj4");f.AddGuide("dx1",0,"ss","a2","100000");f.AddGuide("dx2",0,"ss","a1","200000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("y1", 0,"ss","a3","100000");f.AddGuide("dy2",0,"h","a4","100000");f.AddGuide("y2",1,"b","0","dy2");f.AddGuide("y3",2,"y2","b","2");f.AddHandleXY("adj1","0","maxAdj1",undefined,"0","0","x2","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x1","t");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","y1");f.AddHandleXY(undefined,"0","0","adj4","0","maxAdj4","l","y2");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","y2");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","y2");f.AddRect("l","y2","r", "b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(6);break}case "upDownArrow":{f.AddAdj("adj1",15,"50000");f.AddAdj("adj2",15,"50000");f.AddGuide("maxAdj2", 0,"50000","h","ss");f.AddGuide("a1",10,"0","adj1","100000");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("y2",0,"ss","a2","100000");f.AddGuide("y3",1,"b","0","y2");f.AddGuide("dx1",0,"w","a1","200000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","dx1","0");f.AddGuide("dy1",0,"x1","y2","wd2");f.AddGuide("y1",1,"y2","0","dy1");f.AddGuide("y4",1,"y3","dy1","0");f.AddHandleXY("adj1","0","100000",undefined,"0","0","x1","y3");f.AddHandleXY(undefined,"0","0","adj2","0","maxAdj2","l", "y2");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","y2");f.AddCnx("cd2","x1","vc");f.AddCnx("cd2","l","y3");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","y3");f.AddCnx("0","x2","vc");f.AddCnx("0","r","y2");f.AddRect("x1","y1","x2","y4");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"x2","y2");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(2,"r","y3");f.AddPathCommand(2,"hc", "b");f.AddPathCommand(2,"l","y3");f.AddPathCommand(2,"x1","y3");f.AddPathCommand(2,"x1","y2");f.AddPathCommand(6);break}case "upDownArrowCallout":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddAdj("adj4",15,"48123");f.AddGuide("maxAdj2",0,"50000","w","ss");f.AddGuide("a2",10,"0","adj2","maxAdj2");f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("maxAdj3",0,"50000","h","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3"); f.AddGuide("q2",0,"a3","ss","hd2");f.AddGuide("maxAdj4",1,"100000","0","q2");f.AddGuide("a4",10,"0","adj4","maxAdj4");f.AddGuide("dx1",0,"ss","a2","100000");f.AddGuide("dx2",0,"ss","a1","200000");f.AddGuide("x1",1,"hc","0","dx1");f.AddGuide("x2",1,"hc","0","dx2");f.AddGuide("x3",1,"hc","dx2","0");f.AddGuide("x4",1,"hc","dx1","0");f.AddGuide("y1",0,"ss","a3","100000");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("dy2",0,"h","a4","200000");f.AddGuide("y2",1,"vc","0","dy2");f.AddGuide("y3",1,"vc","dy2", "0");f.AddHandleXY("adj1","0","maxAdj1",undefined,"0","0","x2","y1");f.AddHandleXY("adj2","0","maxAdj2",undefined,"0","0","x1","t");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","r","y1");f.AddHandleXY(undefined,"0","0","adj4","0","maxAdj4","l","y2");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddRect("l","y2","r","y3");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(2, "x2","y2");f.AddPathCommand(2,"x2","y1");f.AddPathCommand(2,"x1","y1");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"x4","y1");f.AddPathCommand(2,"x3","y1");f.AddPathCommand(2,"x3","y2");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"r","y3");f.AddPathCommand(2,"x3","y3");f.AddPathCommand(2,"x3","y4");f.AddPathCommand(2,"x4","y4");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"x1","y4");f.AddPathCommand(2,"x2","y4");f.AddPathCommand(2,"x2","y3");f.AddPathCommand(2,"l","y3");f.AddPathCommand(6); break}case "uturnArrow":{f.AddAdj("adj1",15,"25000");f.AddAdj("adj2",15,"25000");f.AddAdj("adj3",15,"25000");f.AddAdj("adj4",15,"43750");f.AddAdj("adj5",15,"75000");f.AddGuide("a2",10,"0","adj2","25000");f.AddGuide("maxAdj1",0,"a2","2","1");f.AddGuide("a1",10,"0","adj1","maxAdj1");f.AddGuide("q2",0,"a1","ss","h");f.AddGuide("q3",1,"100000","0","q2");f.AddGuide("maxAdj3",0,"q3","h","ss");f.AddGuide("a3",10,"0","adj3","maxAdj3");f.AddGuide("q1",1,"a3","a1","0");f.AddGuide("minAdj5",0,"q1","ss","h"); f.AddGuide("a5",10,"minAdj5","adj5","100000");f.AddGuide("th",0,"ss","a1","100000");f.AddGuide("aw2",0,"ss","a2","100000");f.AddGuide("th2",0,"th","1","2");f.AddGuide("dh2",1,"aw2","0","th2");f.AddGuide("y5",0,"h","a5","100000");f.AddGuide("ah",0,"ss","a3","100000");f.AddGuide("y4",1,"y5","0","ah");f.AddGuide("x9",1,"r","0","dh2");f.AddGuide("bw",0,"x9","1","2");f.AddGuide("bs",16,"bw","y4");f.AddGuide("maxAdj4",0,"bs","100000","ss");f.AddGuide("a4",10,"0","adj4","maxAdj4");f.AddGuide("bd",0,"ss", "a4","100000");f.AddGuide("bd3",1,"bd","0","th");f.AddGuide("bd2",8,"bd3","0");f.AddGuide("x3",1,"th","bd2","0");f.AddGuide("x8",1,"r","0","aw2");f.AddGuide("x6",1,"x8","0","aw2");f.AddGuide("x7",1,"x6","dh2","0");f.AddGuide("x4",1,"x9","0","bd");f.AddGuide("x5",1,"x7","0","bd2");f.AddGuide("cx",2,"th","x7","2");f.AddHandleXY("adj1","0","maxAdj1",undefined,"0","0","th","b");f.AddHandleXY("adj2","0","25000",undefined,"0","0","x6","b");f.AddHandleXY(undefined,"0","0","adj3","0","maxAdj3","x6","y4"); f.AddHandleXY("adj4","0","maxAdj4",undefined,"0","0","bd","t");f.AddHandleXY(undefined,"0","0","adj5","minAdj5","100000","r","y5");f.AddCnx("cd4","x6","y4");f.AddCnx("cd4","x8","y5");f.AddCnx("0","r","y4");f.AddCnx("_3cd4","cx","t");f.AddCnx("cd4","th2","b");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"l","bd");f.AddPathCommand(3,"bd","bd","cd2","cd4");f.AddPathCommand(2,"x4","t");f.AddPathCommand(3, "bd","bd","_3cd4","cd4");f.AddPathCommand(2,"x9","y4");f.AddPathCommand(2,"r","y4");f.AddPathCommand(2,"x8","y5");f.AddPathCommand(2,"x6","y4");f.AddPathCommand(2,"x7","y4");f.AddPathCommand(2,"x7","x3");f.AddPathCommand(3,"bd2","bd2","0","-5400000");f.AddPathCommand(2,"x3","th");f.AddPathCommand(3,"bd2","bd2","_3cd4","-5400000");f.AddPathCommand(2,"th","b");f.AddPathCommand(6);break}case "verticalScroll":{f.AddAdj("adj",15,"12500");f.AddGuide("a",10,"0","adj","25000");f.AddGuide("ch",0,"ss","a", "100000");f.AddGuide("ch2",0,"ch","1","2");f.AddGuide("ch4",0,"ch","1","4");f.AddGuide("x3",1,"ch","ch2","0");f.AddGuide("x4",1,"ch","ch","0");f.AddGuide("x6",1,"r","0","ch");f.AddGuide("x7",1,"r","0","ch2");f.AddGuide("x5",1,"x6","0","ch2");f.AddGuide("y3",1,"b","0","ch");f.AddGuide("y4",1,"b","0","ch2");f.AddHandleXY(undefined,"0","0","adj","0","25000","l","ch");f.AddCnx("_3cd4","hc","t");f.AddCnx("0","ch","vc");f.AddCnx("cd4","hc","b");f.AddCnx("cd2","x6","vc");f.AddRect("ch","ch","x6","y4");f.AddPathCommand(0, false,undefined,false,undefined,undefined);f.AddPathCommand(1,"ch2","b");f.AddPathCommand(3,"ch2","ch2","cd4","-5400000");f.AddPathCommand(2,"ch2","y4");f.AddPathCommand(3,"ch4","ch4","cd4","-10800000");f.AddPathCommand(2,"ch","y3");f.AddPathCommand(2,"ch","ch2");f.AddPathCommand(3,"ch2","ch2","cd2","cd4");f.AddPathCommand(2,"x7","t");f.AddPathCommand(3,"ch2","ch2","_3cd4","cd2");f.AddPathCommand(2,"x6","ch");f.AddPathCommand(2,"x6","y4");f.AddPathCommand(3,"ch2","ch2","0","cd4");f.AddPathCommand(6); f.AddPathCommand(1,"x4","ch2");f.AddPathCommand(3,"ch2","ch2","0","cd4");f.AddPathCommand(3,"ch4","ch4","cd4","cd2");f.AddPathCommand(6);f.AddPathCommand(0,false,"darkenLess",false,undefined,undefined);f.AddPathCommand(1,"x4","ch2");f.AddPathCommand(3,"ch2","ch2","0","cd4");f.AddPathCommand(3,"ch4","ch4","cd4","cd2");f.AddPathCommand(6);f.AddPathCommand(1,"ch","y4");f.AddPathCommand(3,"ch2","ch2","0","_3cd4");f.AddPathCommand(3,"ch4","ch4","_3cd4","cd2");f.AddPathCommand(6);f.AddPathCommand(0,false, "none",undefined,undefined,undefined);f.AddPathCommand(1,"ch","y3");f.AddPathCommand(2,"ch","ch2");f.AddPathCommand(3,"ch2","ch2","cd2","cd4");f.AddPathCommand(2,"x7","t");f.AddPathCommand(3,"ch2","ch2","_3cd4","cd2");f.AddPathCommand(2,"x6","ch");f.AddPathCommand(2,"x6","y4");f.AddPathCommand(3,"ch2","ch2","0","cd4");f.AddPathCommand(2,"ch2","b");f.AddPathCommand(3,"ch2","ch2","cd4","cd2");f.AddPathCommand(6);f.AddPathCommand(1,"x3","t");f.AddPathCommand(3,"ch2","ch2","_3cd4","cd2");f.AddPathCommand(3, "ch4","ch4","cd4","cd2");f.AddPathCommand(2,"x4","ch2");f.AddPathCommand(1,"x6","ch");f.AddPathCommand(2,"x3","ch");f.AddPathCommand(1,"ch2","y3");f.AddPathCommand(3,"ch4","ch4","_3cd4","cd2");f.AddPathCommand(2,"ch","y4");f.AddPathCommand(1,"ch2","b");f.AddPathCommand(3,"ch2","ch2","cd4","-5400000");f.AddPathCommand(2,"ch","y3");break}case "wave":{f.AddAdj("adj1",15,"12500");f.AddAdj("adj2",15,"0");f.AddGuide("a1",10,"0","adj1","20000");f.AddGuide("a2",10,"-10000","adj2","10000");f.AddGuide("y1", 0,"h","a1","100000");f.AddGuide("dy2",0,"y1","10","3");f.AddGuide("y2",1,"y1","0","dy2");f.AddGuide("y3",1,"y1","dy2","0");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("y5",1,"y4","0","dy2");f.AddGuide("y6",1,"y4","dy2","0");f.AddGuide("dx1",0,"w","a2","100000");f.AddGuide("of2",0,"w","a2","50000");f.AddGuide("x1",4,"dx1");f.AddGuide("dx2",3,"of2","0","of2");f.AddGuide("x2",1,"l","0","dx2");f.AddGuide("dx5",3,"of2","of2","0");f.AddGuide("x5",1,"r","0","dx5");f.AddGuide("dx3",2,"dx2","x5","3");f.AddGuide("x3", 1,"x2","dx3","0");f.AddGuide("x4",2,"x3","x5","2");f.AddGuide("x6",1,"l","dx5","0");f.AddGuide("x10",1,"r","dx2","0");f.AddGuide("x7",1,"x6","dx3","0");f.AddGuide("x8",2,"x7","x10","2");f.AddGuide("x9",1,"r","0","x1");f.AddGuide("xAdj",1,"hc","dx1","0");f.AddGuide("xAdj2",1,"hc","0","dx1");f.AddGuide("il",8,"x2","x6");f.AddGuide("ir",16,"x5","x10");f.AddGuide("it",0,"h","a1","50000");f.AddGuide("ib",1,"b","0","it");f.AddHandleXY(undefined,"0","0","adj1","0","20000","l","y1");f.AddHandleXY("adj2", "-10000","10000",undefined,"0","0","xAdj","b");f.AddCnx("cd4","xAdj2","y1");f.AddCnx("cd2","x1","vc");f.AddCnx("_3cd4","xAdj","y4");f.AddCnx("0","x9","vc");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"x2","y1");f.AddPathCommand(5,"x3","y2","x4","y3","x5","y1");f.AddPathCommand(2,"x10","y4");f.AddPathCommand(5,"x8","y6","x7","y5","x6","y4");f.AddPathCommand(6);break}case "wedgeEllipseCallout":{f.AddAdj("adj1",15,"-20833"); f.AddAdj("adj2",15,"62500");f.AddGuide("dxPos",0,"w","adj1","100000");f.AddGuide("dyPos",0,"h","adj2","100000");f.AddGuide("xPos",1,"hc","dxPos","0");f.AddGuide("yPos",1,"vc","dyPos","0");f.AddGuide("sdx",0,"dxPos","h","1");f.AddGuide("sdy",0,"dyPos","w","1");f.AddGuide("pang",5,"sdx","sdy");f.AddGuide("stAng",1,"pang","660000","0");f.AddGuide("enAng",1,"pang","0","660000");f.AddGuide("dx1",7,"wd2","stAng");f.AddGuide("dy1",12,"hd2","stAng");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc", "dy1","0");f.AddGuide("dx2",7,"wd2","enAng");f.AddGuide("dy2",12,"hd2","enAng");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddGuide("stAng1",5,"dx1","dy1");f.AddGuide("enAng1",5,"dx2","dy2");f.AddGuide("swAng1",1,"enAng1","0","stAng1");f.AddGuide("swAng2",1,"swAng1","21600000","0");f.AddGuide("swAng",3,"swAng1","swAng1","swAng2");f.AddGuide("idx",7,"wd2","2700000");f.AddGuide("idy",12,"hd2","2700000");f.AddGuide("il",1,"hc","0","idx");f.AddGuide("ir",1,"hc","idx","0");f.AddGuide("it", 1,"vc","0","idy");f.AddGuide("ib",1,"vc","idy","0");f.AddHandleXY("adj1","-2147483647","2147483647","adj2","-2147483647","2147483647","xPos","yPos");f.AddCnx("_3cd4","hc","t");f.AddCnx("_3cd4","il","it");f.AddCnx("cd4","il","ib");f.AddCnx("cd4","hc","b");f.AddCnx("cd4","ir","ib");f.AddCnx("0","r","vc");f.AddCnx("_3cd4","ir","it");f.AddCnx("pang","xPos","yPos");f.AddRect("il","it","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"xPos","yPos");f.AddPathCommand(2, "x1","y1");f.AddPathCommand(3,"wd2","hd2","stAng1","swAng");f.AddPathCommand(6);break}case "wedgeRectCallout":{f.AddAdj("adj1",15,"-20833");f.AddAdj("adj2",15,"62500");f.AddGuide("dxPos",0,"w","adj1","100000");f.AddGuide("dyPos",0,"h","adj2","100000");f.AddGuide("xPos",1,"hc","dxPos","0");f.AddGuide("yPos",1,"vc","dyPos","0");f.AddGuide("dx",1,"xPos","0","hc");f.AddGuide("dy",1,"yPos","0","vc");f.AddGuide("dq",0,"dxPos","h","w");f.AddGuide("ady",4,"dyPos");f.AddGuide("adq",4,"dq");f.AddGuide("dz", 1,"ady","0","adq");f.AddGuide("xg1",3,"dxPos","7","2");f.AddGuide("xg2",3,"dxPos","10","5");f.AddGuide("x1",0,"w","xg1","12");f.AddGuide("x2",0,"w","xg2","12");f.AddGuide("yg1",3,"dyPos","7","2");f.AddGuide("yg2",3,"dyPos","10","5");f.AddGuide("y1",0,"h","yg1","12");f.AddGuide("y2",0,"h","yg2","12");f.AddGuide("t1",3,"dxPos","l","xPos");f.AddGuide("xl",3,"dz","l","t1");f.AddGuide("t2",3,"dyPos","x1","xPos");f.AddGuide("xt",3,"dz","t2","x1");f.AddGuide("t3",3,"dxPos","xPos","r");f.AddGuide("xr",3, "dz","r","t3");f.AddGuide("t4",3,"dyPos","xPos","x1");f.AddGuide("xb",3,"dz","t4","x1");f.AddGuide("t5",3,"dxPos","y1","yPos");f.AddGuide("yl",3,"dz","y1","t5");f.AddGuide("t6",3,"dyPos","t","yPos");f.AddGuide("yt",3,"dz","t6","t");f.AddGuide("t7",3,"dxPos","yPos","y1");f.AddGuide("yr",3,"dz","y1","t7");f.AddGuide("t8",3,"dyPos","yPos","b");f.AddGuide("yb",3,"dz","t8","b");f.AddHandleXY("adj1","-2147483647","2147483647","adj2","-2147483647","2147483647","xPos","yPos");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2", "l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddCnx("cd4","xPos","yPos");f.AddRect("l","t","r","b");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"xt","yt");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(2,"r","y1");f.AddPathCommand(2,"xr","yr");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"r","b");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"xb","yb"); f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"l","b");f.AddPathCommand(2,"l","y2");f.AddPathCommand(2,"xl","yl");f.AddPathCommand(2,"l","y1");f.AddPathCommand(6);break}case "wedgeRoundRectCallout":{f.AddAdj("adj1",15,"-20833");f.AddAdj("adj2",15,"62500");f.AddAdj("adj3",15,"16667");f.AddGuide("dxPos",0,"w","adj1","100000");f.AddGuide("dyPos",0,"h","adj2","100000");f.AddGuide("xPos",1,"hc","dxPos","0");f.AddGuide("yPos",1,"vc","dyPos","0");f.AddGuide("dq",0,"dxPos","h","w");f.AddGuide("ady",4,"dyPos"); f.AddGuide("adq",4,"dq");f.AddGuide("dz",1,"ady","0","adq");f.AddGuide("xg1",3,"dxPos","7","2");f.AddGuide("xg2",3,"dxPos","10","5");f.AddGuide("x1",0,"w","xg1","12");f.AddGuide("x2",0,"w","xg2","12");f.AddGuide("yg1",3,"dyPos","7","2");f.AddGuide("yg2",3,"dyPos","10","5");f.AddGuide("y1",0,"h","yg1","12");f.AddGuide("y2",0,"h","yg2","12");f.AddGuide("t1",3,"dxPos","l","xPos");f.AddGuide("xl",3,"dz","l","t1");f.AddGuide("t2",3,"dyPos","x1","xPos");f.AddGuide("xt",3,"dz","t2","x1");f.AddGuide("t3", 3,"dxPos","xPos","r");f.AddGuide("xr",3,"dz","r","t3");f.AddGuide("t4",3,"dyPos","xPos","x1");f.AddGuide("xb",3,"dz","t4","x1");f.AddGuide("t5",3,"dxPos","y1","yPos");f.AddGuide("yl",3,"dz","y1","t5");f.AddGuide("t6",3,"dyPos","t","yPos");f.AddGuide("yt",3,"dz","t6","t");f.AddGuide("t7",3,"dxPos","yPos","y1");f.AddGuide("yr",3,"dz","y1","t7");f.AddGuide("t8",3,"dyPos","yPos","b");f.AddGuide("yb",3,"dz","t8","b");f.AddGuide("u1",0,"ss","adj3","100000");f.AddGuide("u2",1,"r","0","u1");f.AddGuide("v2", 1,"b","0","u1");f.AddGuide("il",0,"u1","29289","100000");f.AddGuide("ir",1,"r","0","il");f.AddGuide("ib",1,"b","0","il");f.AddHandleXY("adj1","-2147483647","2147483647","adj2","-2147483647","2147483647","xPos","yPos");f.AddCnx("_3cd4","hc","t");f.AddCnx("cd2","l","vc");f.AddCnx("cd4","hc","b");f.AddCnx("0","r","vc");f.AddCnx("cd4","xPos","yPos");f.AddRect("il","il","ir","ib");f.AddPathCommand(0,undefined,undefined,undefined,undefined,undefined);f.AddPathCommand(1,"l","u1");f.AddPathCommand(3,"u1", "u1","cd2","cd4");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"xt","yt");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"u2","t");f.AddPathCommand(3,"u1","u1","_3cd4","cd4");f.AddPathCommand(2,"r","y1");f.AddPathCommand(2,"xr","yr");f.AddPathCommand(2,"r","y2");f.AddPathCommand(2,"r","v2");f.AddPathCommand(3,"u1","u1","0","cd4");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"xb","yb");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"u1","b");f.AddPathCommand(3,"u1","u1","cd4","cd4");f.AddPathCommand(2, "l","y2");f.AddPathCommand(2,"xl","yl");f.AddPathCommand(2,"l","y1");f.AddPathCommand(6);break}}if(typeof prst==="string"&&prst.length>0)f.setPreset(prst);return f}function getPrstByNumber(nPreset){switch(nPreset){case 0:{return"textArchDown"}case 1:{return"textArchDownPour"}case 2:{return"textArchUp"}case 3:{return"textArchUpPour"}case 4:{return"textButton"}case 5:{return"textButtonPour"}case 6:{return"textCanDown"}case 7:{return"textCanUp"}case 8:{return"textCascadeDown"}case 9:{return"textCascadeUp"}case 10:{return"textChevron"}case 11:{return"textChevronInverted"}case 12:{return"textCircle"}case 13:{return"textCirclePour"}case 14:{return"textCurveDown"}case 15:{return"textCurveUp"}case 16:{return"textDeflate"}case 17:{return"textDeflateBottom"}case 18:{return"textDeflateInflate"}case 19:{return"textDeflateInflateDeflate"}case 20:{return"textDeflateTop"}case 21:{return"textDoubleWave1"}case 22:{return"textFadeDown"}case 23:{return"textFadeLeft"}case 24:{return"textFadeRight"}case 25:{return"textFadeUp"}case 26:{return"textInflate"}case 27:{return"textInflateBottom"}case 28:{return"textInflateTop"}case 29:{return"textNoShape"}case 30:{return"textPlain"}case 31:{return"textRingInside"}case 32:{return"textRingOutside"}case 33:{return"textSlantDown"}case 34:{return"textSlantUp"}case 35:{return"textStop"}case 36:{return"textTriangle"}case 37:{return"textTriangleInverted"}case 38:{return"textWave1"}case 39:{return"textWave2"}case 40:{return"textWave4"}}return"textNoShape"} function getNumByTxPrst(sPreset){if("textArchDown"==sPreset)return 0;if("textArchDownPour"==sPreset)return 1;if("textArchUp"==sPreset)return 2;if("textArchUpPour"==sPreset)return 3;if("textButton"==sPreset)return 4;if("textButtonPour"==sPreset)return 5;if("textCanDown"==sPreset)return 6;if("textCanUp"==sPreset)return 7;if("textCascadeDown"==sPreset)return 8;if("textCascadeUp"==sPreset)return 9;if("textChevron"==sPreset)return 10;if("textChevronInverted"==sPreset)return 11;if("textCircle"==sPreset)return 12; if("textCirclePour"==sPreset)return 13;if("textCurveDown"==sPreset)return 14;if("textCurveUp"==sPreset)return 15;if("textDeflate"==sPreset)return 16;if("textDeflateBottom"==sPreset)return 17;if("textDeflateInflate"==sPreset)return 18;if("textDeflateInflateDeflate"==sPreset)return 19;if("textDeflateTop"==sPreset)return 20;if("textDoubleWave1"==sPreset)return 21;if("textFadeDown"==sPreset)return 22;if("textFadeLeft"==sPreset)return 23;if("textFadeRight"==sPreset)return 24;if("textFadeUp"==sPreset)return 25; if("textInflate"==sPreset)return 26;if("textInflateBottom"==sPreset)return 27;if("textInflateTop"==sPreset)return 28;if("textNoShape"==sPreset)return 29;if("textPlain"==sPreset)return 30;if("textRingInside"==sPreset)return 31;if("textRingOutside"==sPreset)return 32;if("textSlantDown"==sPreset)return 33;if("textSlantUp"==sPreset)return 34;if("textStop"==sPreset)return 35;if("textTriangle"==sPreset)return 36;if("textTriangleInverted"==sPreset)return 37;if("textWave1"==sPreset)return 38;if("textWave2"== sPreset)return 39;if("textWave4"==sPreset)return 40;return 29}function CreatePrstTxWarpGeometry(prst){var f=new AscFormat.Geometry;switch(prst){case "textArchDown":{f.AddAdj("adj",15,"0");f.AddGuide("adval",10,"0","adj","21599999");f.AddGuide("v1",1,"10800000","0","adval");f.AddGuide("v2",1,"32400000","0","adval");f.AddGuide("nv1",1,"0","0","v1");f.AddGuide("stAng",3,"nv1","v2","v1");f.AddGuide("w1",1,"5400000","0","adval");f.AddGuide("w2",1,"16200000","0","adval");f.AddGuide("d1",1,"adval","0","stAng"); f.AddGuide("d2",1,"d1","0","21600000");f.AddGuide("v3",1,"0","0","10800000");f.AddGuide("c2",3,"w2","d1","d2");f.AddGuide("c1",3,"v1","d2","c2");f.AddGuide("c0",3,"w1","d1","c1");f.AddGuide("swAng",3,"stAng","c0","v3");f.AddGuide("wt1",12,"wd2","adj");f.AddGuide("ht1",7,"hd2","adj");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("wt2",12,"wd2","stAng");f.AddGuide("ht2",7,"hd2","stAng");f.AddGuide("dx2", 6,"wd2","ht2","wt2");f.AddGuide("dy2",11,"hd2","ht2","wt2");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddHandlePolar("adj","0","21599999",undefined,"0","0","x1","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y2");f.AddPathCommand(3,"wd2","hd2","stAng","swAng");break}case "textArchDownPour":{f.AddAdj("adj1",15,"0");f.AddAdj("adj2",15,"25000");f.AddGuide("adval",10,"0","adj1","21599999");f.AddGuide("v1",1,"10800000","0","adval"); f.AddGuide("v2",1,"32400000","0","adval");f.AddGuide("nv1",1,"0","0","v1");f.AddGuide("stAng",3,"nv1","v2","v1");f.AddGuide("w1",1,"5400000","0","adval");f.AddGuide("w2",1,"16200000","0","adval");f.AddGuide("d1",1,"adval","0","stAng");f.AddGuide("d2",1,"d1","0","21600000");f.AddGuide("v3",1,"0","0","10800000");f.AddGuide("c2",3,"w2","d1","d2");f.AddGuide("c1",3,"v1","d2","c2");f.AddGuide("c0",3,"w1","d1","c1");f.AddGuide("swAng",3,"stAng","c0","v3");f.AddGuide("wt1",12,"wd2","stAng");f.AddGuide("ht1", 7,"hd2","stAng");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("adval2",10,"0","adj2","99000");f.AddGuide("ratio",0,"adval2","1","100000");f.AddGuide("iwd2",0,"wd2","ratio","1");f.AddGuide("ihd2",0,"hd2","ratio","1");f.AddGuide("wt2",12,"iwd2","adval");f.AddGuide("ht2",7,"ihd2","adval");f.AddGuide("dx2",6,"iwd2","ht2","wt2");f.AddGuide("dy2",11,"ihd2","ht2","wt2");f.AddGuide("x2",1,"hc","dx2", "0");f.AddGuide("y2",1,"vc","dy2","0");f.AddGuide("wt3",12,"iwd2","stAng");f.AddGuide("ht3",7,"ihd2","stAng");f.AddGuide("dx3",6,"iwd2","ht3","wt3");f.AddGuide("dy3",11,"ihd2","ht3","wt3");f.AddGuide("x3",1,"hc","dx3","0");f.AddGuide("y3",1,"vc","dy3","0");f.AddHandlePolar("adj1","0","21599999","adj2","0","100000","x2","y2");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x3","y3");f.AddPathCommand(3,"iwd2","ihd2","stAng","swAng");f.AddPathCommand(0,false,"none", undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","stAng","swAng");break}case "textArchUp":{f.AddAdj("adj",15,"cd2");f.AddGuide("adval",10,"0","adj","21599999");f.AddGuide("v1",1,"10800000","0","adval");f.AddGuide("v2",1,"32400000","0","adval");f.AddGuide("end",3,"v1","v1","v2");f.AddGuide("w1",1,"5400000","0","adval");f.AddGuide("w2",1,"16200000","0","adval");f.AddGuide("d1",1,"end","0","adval");f.AddGuide("d2",1,"21600000","d1","0");f.AddGuide("c2",3,"w2", "d1","d2");f.AddGuide("c1",3,"v1","d2","c2");f.AddGuide("swAng",3,"w1","d1","c1");f.AddGuide("wt1",12,"wd2","adj");f.AddGuide("ht1",7,"hd2","adj");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddHandlePolar("adj","0","21599999",undefined,"0","0","x1","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","adval","swAng");break}case "textArchUpPour":{f.AddAdj("adj1", 15,"cd2");f.AddAdj("adj2",15,"50000");f.AddGuide("adval",10,"0","adj1","21599999");f.AddGuide("v1",1,"10800000","0","adval");f.AddGuide("v2",1,"32400000","0","adval");f.AddGuide("end",3,"v1","v1","v2");f.AddGuide("w1",1,"5400000","0","adval");f.AddGuide("w2",1,"16200000","0","adval");f.AddGuide("d1",1,"end","0","adval");f.AddGuide("d2",1,"21600000","d1","0");f.AddGuide("c2",3,"w2","d1","d2");f.AddGuide("c1",3,"v1","d2","c2");f.AddGuide("swAng",3,"w1","d1","c1");f.AddGuide("wt1",12,"wd2","adval"); f.AddGuide("ht1",7,"hd2","adval");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("adval2",10,"0","adj2","99000");f.AddGuide("ratio",0,"adval2","1","100000");f.AddGuide("iwd2",0,"wd2","ratio","1");f.AddGuide("ihd2",0,"hd2","ratio","1");f.AddGuide("wt2",12,"iwd2","adval");f.AddGuide("ht2",7,"ihd2","adval");f.AddGuide("dx2",6,"iwd2","ht2","wt2");f.AddGuide("dy2",11,"ihd2","ht2","wt2");f.AddGuide("x2", 1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddHandlePolar("adj1","0","21599999","adj2","0","100000","x2","y2");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","adval","swAng");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y2");f.AddPathCommand(3,"iwd2","ihd2","adval","swAng");break}case "textButton":{f.AddAdj("adj",15,"10800000");f.AddGuide("adval",10,"0","adj","21599999"); f.AddGuide("bot",1,"5400000","0","adval");f.AddGuide("lef",1,"10800000","0","adval");f.AddGuide("top",1,"16200000","0","adval");f.AddGuide("rig",1,"21600000","0","adval");f.AddGuide("c3",3,"top","adval","0");f.AddGuide("c2",3,"lef","10800000","c3");f.AddGuide("c1",3,"bot","rig","c2");f.AddGuide("stAng",3,"adval","c1","0");f.AddGuide("w1",1,"21600000","0","stAng");f.AddGuide("stAngB",3,"stAng","w1","0");f.AddGuide("td1",0,"bot","2","1");f.AddGuide("td2",0,"top","2","1");f.AddGuide("ntd2",1,"0","0", "td2");f.AddGuide("w2",1,"0","0","10800000");f.AddGuide("c6",3,"top","ntd2","w2");f.AddGuide("c5",3,"lef","10800000","c6");f.AddGuide("c4",3,"bot","td1","c5");f.AddGuide("v1",3,"adval","c4","10800000");f.AddGuide("swAngT",1,"0","0","v1");f.AddGuide("stT",3,"lef","stAngB","stAng");f.AddGuide("stB",3,"lef","stAng","stAngB");f.AddGuide("swT",3,"lef","v1","swAngT");f.AddGuide("swB",3,"lef","swAngT","v1");f.AddGuide("wt1",12,"wd2","stT");f.AddGuide("ht1",7,"hd2","stT");f.AddGuide("dx1",6,"wd2","ht1","wt1"); f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("wt2",12,"wd2","stB");f.AddGuide("ht2",7,"hd2","stB");f.AddGuide("dx2",6,"wd2","ht2","wt2");f.AddGuide("dy2",11,"hd2","ht2","wt2");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddGuide("wt3",12,"wd2","adj");f.AddGuide("ht3",7,"hd2","adj");f.AddGuide("dx3",6,"wd2","ht3","wt3");f.AddGuide("dy3",11,"hd2","ht3","wt3");f.AddGuide("x3",1,"hc","dx3","0");f.AddGuide("y3", 1,"vc","dy3","0");f.AddHandlePolar("adj","0","21599999",undefined,"0","0","x3","y3");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","stT","swT");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","vc");f.AddPathCommand(2,"r","vc");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y2");f.AddPathCommand(3,"wd2","hd2","stB","swB");break}case "textButtonPour":{f.AddAdj("adj1", 15,"cd2");f.AddAdj("adj2",15,"50000");f.AddGuide("adval",10,"0","adj1","21599999");f.AddGuide("bot",1,"5400000","0","adval");f.AddGuide("lef",1,"10800000","0","adval");f.AddGuide("top",1,"16200000","0","adval");f.AddGuide("rig",1,"21600000","0","adval");f.AddGuide("c3",3,"top","adval","0");f.AddGuide("c2",3,"lef","10800000","c3");f.AddGuide("c1",3,"bot","rig","c2");f.AddGuide("stAng",3,"adval","c1","0");f.AddGuide("w1",1,"21600000","0","stAng");f.AddGuide("stAngB",3,"stAng","w1","0");f.AddGuide("td1", 0,"bot","2","1");f.AddGuide("td2",0,"top","2","1");f.AddGuide("ntd2",1,"0","0","td2");f.AddGuide("w2",1,"0","0","10800000");f.AddGuide("c6",3,"top","ntd2","w2");f.AddGuide("c5",3,"lef","10800000","c6");f.AddGuide("c4",3,"bot","td1","c5");f.AddGuide("v1",3,"adval","c4","10800000");f.AddGuide("swAngT",1,"0","0","v1");f.AddGuide("stT",3,"lef","stAngB","stAng");f.AddGuide("stB",3,"lef","stAng","stAngB");f.AddGuide("swT",3,"lef","v1","swAngT");f.AddGuide("swB",3,"lef","swAngT","v1");f.AddGuide("wt1",12, "wd2","stT");f.AddGuide("ht1",7,"hd2","stT");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("wt6",12,"wd2","stB");f.AddGuide("ht6",7,"hd2","stB");f.AddGuide("dx6",6,"wd2","ht6","wt6");f.AddGuide("dy6",11,"hd2","ht6","wt6");f.AddGuide("x6",1,"hc","dx6","0");f.AddGuide("y6",1,"vc","dy6","0");f.AddGuide("adval2",10,"40000","adj2","99000");f.AddGuide("ratio",0,"adval2","1","100000");f.AddGuide("iwd2", 0,"wd2","ratio","1");f.AddGuide("ihd2",0,"hd2","ratio","1");f.AddGuide("wt2",12,"iwd2","stT");f.AddGuide("ht2",7,"ihd2","stT");f.AddGuide("dx2",6,"iwd2","ht2","wt2");f.AddGuide("dy2",11,"ihd2","ht2","wt2");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddGuide("wt5",12,"iwd2","stB");f.AddGuide("ht5",7,"ihd2","stB");f.AddGuide("dx5",6,"iwd2","ht5","wt5");f.AddGuide("dy5",11,"ihd2","ht5","wt5");f.AddGuide("x5",1,"hc","dx5","0");f.AddGuide("y5",1,"vc","dy5","0");f.AddGuide("d1", 1,"hd2","0","ihd2");f.AddGuide("d12",0,"d1","1","2");f.AddGuide("yu",1,"vc","0","d12");f.AddGuide("yd",1,"vc","d12","0");f.AddGuide("v1",0,"d12","d12","1");f.AddGuide("v2",0,"ihd2","ihd2","1");f.AddGuide("v3",0,"v1","1","v2");f.AddGuide("v4",1,"1","0","v3");f.AddGuide("v5",0,"iwd2","iwd2","1");f.AddGuide("v6",0,"v4","v5","1");f.AddGuide("v7",13,"v6");f.AddGuide("xl",1,"hc","0","v7");f.AddGuide("xr",1,"hc","v7","0");f.AddGuide("wtadj",12,"iwd2","adj1");f.AddGuide("htadj",7,"ihd2","adj1");f.AddGuide("dxadj", 6,"iwd2","htadj","wtadj");f.AddGuide("dyadj",11,"ihd2","htadj","wtadj");f.AddGuide("xadj",1,"hc","dxadj","0");f.AddGuide("yadj",1,"vc","dyadj","0");f.AddHandlePolar("adj1","0","21599999","adj2","0","100000","xadj","yadj");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","stT","swT");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y2");f.AddPathCommand(3,"iwd2","ihd2","stT","swT");f.AddPathCommand(0, false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"xl","yu");f.AddPathCommand(2,"xr","yu");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"xl","yd");f.AddPathCommand(2,"xr","yd");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x5","y5");f.AddPathCommand(3,"iwd2","ihd2","stB","swB");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x6","y6");f.AddPathCommand(3,"wd2","hd2","stB","swB"); break}case "textCanDown":{f.AddAdj("adj",15,"14286");f.AddGuide("a",10,"0","adj","33333");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y0",1,"t","dy","0");f.AddGuide("y1",1,"b","0","dy");f.AddGuide("ncd2",0,"cd2","-1","1");f.AddHandleXY(undefined,"0","0","adj","0","33333","hc","y0");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(3,"wd2","y0","cd2","ncd2");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1, "l","y1");f.AddPathCommand(3,"wd2","y0","cd2","ncd2");break}case "textCanUp":{f.AddAdj("adj",15,"85714");f.AddGuide("a",10,"66667","adj","100000");f.AddGuide("dy1",0,"a","h","100000");f.AddGuide("dy",1,"h","0","dy1");f.AddGuide("y0",1,"t","dy1","0");f.AddGuide("y1",1,"t","dy","0");f.AddHandleXY(undefined,"0","0","adj","66667","100000","hc","y0");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(3,"wd2","y1","cd2","cd2");f.AddPathCommand(0, false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(3,"wd2","y1","cd2","cd2");break}case "textCascadeDown":{f.AddAdj("adj",15,"44444");f.AddGuide("a",10,"28570","adj","100000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y1",1,"t","dy","0");f.AddGuide("dy2",1,"h","0","dy");f.AddGuide("dy3",0,"dy2","1","4");f.AddGuide("y2",1,"t","dy3","0");f.AddHandleXY(undefined,"0","0","adj","28570","100000","l","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined); f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","y2");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"r","b");break}case "textCascadeUp":{f.AddAdj("adj",15,"44444");f.AddGuide("a",10,"28570","adj","100000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y1",1,"t","dy","0");f.AddGuide("dy2",1,"h","0","dy");f.AddGuide("dy3",0,"dy2","1","4");f.AddGuide("y2",1,"t","dy3","0");f.AddHandleXY(undefined,"0","0","adj","28570","100000","r", "y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(2,"r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","y1");break}case "textChevron":{f.AddAdj("adj",15,"25000");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("y",0,"a","h","100000");f.AddGuide("y1",1,"t","b","y");f.AddHandleXY(undefined,"0","0","adj","0","50000","l","y");f.AddPathCommand(0,false,"none",undefined, undefined,undefined);f.AddPathCommand(1,"l","y");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"r","y");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"hc","y1");f.AddPathCommand(2,"r","b");break}case "textChevronInverted":{f.AddAdj("adj",15,"75000");f.AddGuide("a",10,"50000","adj","100000");f.AddGuide("y",0,"a","h","100000");f.AddGuide("y1",1,"b","0","y");f.AddHandleXY(undefined,"0","0","adj","50000","100000","l","y");f.AddPathCommand(0, false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"hc","y1");f.AddPathCommand(2,"r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"r","y");break}case "textCircle":{f.AddAdj("adj",15,"10800000");f.AddGuide("adval",10,"0","adj","21599999");f.AddGuide("d0",1,"adval","0","10800000");f.AddGuide("d1",1,"10800000","0","adval");f.AddGuide("d2",1,"21600000","0","adval"); f.AddGuide("d3",3,"d1","d1","10799999");f.AddGuide("d4",3,"d0","d2","d3");f.AddGuide("swAng",0,"d4","2","1");f.AddGuide("wt1",12,"wd2","adj");f.AddGuide("ht1",7,"hd2","adj");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1",11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddHandlePolar("adj","0","21599999",undefined,"0","0","x1","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2", "hd2","adval","swAng");break}case "textCirclePour":{f.AddAdj("adj1",15,"cd2");f.AddAdj("adj2",15,"50000");f.AddGuide("adval",10,"0","adj1","21599999");f.AddGuide("d0",1,"adval","0","10800000");f.AddGuide("d1",1,"10800000","0","adval");f.AddGuide("d2",1,"21600000","0","adval");f.AddGuide("d3",3,"d1","d1","10799999");f.AddGuide("d4",3,"d0","d2","d3");f.AddGuide("swAng",0,"d4","2","1");f.AddGuide("wt1",12,"wd2","adval");f.AddGuide("ht1",7,"hd2","adval");f.AddGuide("dx1",6,"wd2","ht1","wt1");f.AddGuide("dy1", 11,"hd2","ht1","wt1");f.AddGuide("x1",1,"hc","dx1","0");f.AddGuide("y1",1,"vc","dy1","0");f.AddGuide("adval2",10,"0","adj2","99000");f.AddGuide("ratio",0,"adval2","1","100000");f.AddGuide("iwd2",0,"wd2","ratio","1");f.AddGuide("ihd2",0,"hd2","ratio","1");f.AddGuide("wt2",12,"iwd2","adval");f.AddGuide("ht2",7,"ihd2","adval");f.AddGuide("dx2",6,"iwd2","ht2","wt2");f.AddGuide("dy2",11,"ihd2","ht2","wt2");f.AddGuide("x2",1,"hc","dx2","0");f.AddGuide("y2",1,"vc","dy2","0");f.AddHandlePolar("adj1","0", "21599999","adj2","0","100000","x2","y2");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","y1");f.AddPathCommand(3,"wd2","hd2","adval","swAng");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y2");f.AddPathCommand(3,"iwd2","ihd2","adval","swAng");break}case "textCurveDown":{f.AddAdj("adj",15,"45977");f.AddGuide("a",10,"0","adj","56338");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("gd1",0,"dy","3","4");f.AddGuide("gd2", 0,"dy","5","4");f.AddGuide("gd3",0,"dy","3","8");f.AddGuide("gd4",0,"dy","1","8");f.AddGuide("gd5",1,"h","0","gd3");f.AddGuide("gd6",1,"gd4","h","0");f.AddGuide("y0",1,"t","dy","0");f.AddGuide("y1",1,"t","gd1","0");f.AddGuide("y2",1,"t","gd2","0");f.AddGuide("y3",1,"t","gd3","0");f.AddGuide("y4",1,"t","gd4","0");f.AddGuide("y5",1,"t","gd5","0");f.AddGuide("y6",1,"t","gd6","0");f.AddGuide("x1",1,"l","wd3","0");f.AddGuide("x2",1,"r","0","wd3");f.AddHandleXY(undefined,"0","0","adj","0","56338","r","y0"); f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(5,"x1","y1","x2","y2","r","y0");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y5");f.AddPathCommand(5,"x1","y6","x2","y6","r","y5");break}case "textCurveUp":{f.AddAdj("adj",15,"45977");f.AddGuide("a",10,"0","adj","56338");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("gd1",0,"dy","3","4");f.AddGuide("gd2",0,"dy","5","4");f.AddGuide("gd3",0,"dy","3", "8");f.AddGuide("gd4",0,"dy","1","8");f.AddGuide("gd5",1,"h","0","gd3");f.AddGuide("gd6",1,"gd4","h","0");f.AddGuide("y0",1,"t","dy","0");f.AddGuide("y1",1,"t","gd1","0");f.AddGuide("y2",1,"t","gd2","0");f.AddGuide("y3",1,"t","gd3","0");f.AddGuide("y4",1,"t","gd4","0");f.AddGuide("y5",1,"t","gd5","0");f.AddGuide("y6",1,"t","gd6","0");f.AddGuide("x1",1,"l","wd3","0");f.AddGuide("x2",1,"r","0","wd3");f.AddHandleXY(undefined,"0","0","adj","0","56338","l","y0");f.AddPathCommand(0,false,"none",undefined, undefined,undefined);f.AddPathCommand(1,"l","y0");f.AddPathCommand(5,"x1","y2","x2","y1","r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y5");f.AddPathCommand(5,"x1","y6","x2","y6","r","y5");break}case "textDeflate":{f.AddAdj("adj",15,"18750");f.AddGuide("a",10,"0","adj","37500");f.AddGuide("dy",0,"a","ss","100000");f.AddGuide("gd0",0,"dy","4","3");f.AddGuide("gd1",1,"h","0","gd0");f.AddGuide("adjY",1,"t","dy","0");f.AddGuide("y0",1,"t","gd0","0");f.AddGuide("y1", 1,"t","gd1","0");f.AddGuide("x0",1,"l","wd3","0");f.AddGuide("x1",1,"r","0","wd3");f.AddHandleXY(undefined,"0","0","adj","0","37500","hc","adjY");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(5,"x0","y0","x1","y0","r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(5,"x0","y1","x1","y1","r","b");break}case "textDeflateBottom":{f.AddAdj("adj",15,"50000");f.AddGuide("a",10, "6250","adj","100000");f.AddGuide("dy",0,"a","ss","100000");f.AddGuide("dy2",1,"h","0","dy");f.AddGuide("y1",1,"t","dy","0");f.AddGuide("cp",1,"y1","0","dy2");f.AddHandleXY(undefined,"0","0","adj","6250","100000","hc","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(4,"hc","cp","r","b");break}case "textDeflateInflate":{f.AddAdj("adj", 15,"35000");f.AddGuide("a",10,"5000","adj","95000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("del",0,"h","5","100");f.AddGuide("dh1",0,"h","45","100");f.AddGuide("dh2",0,"h","55","100");f.AddGuide("yh",1,"dy","0","del");f.AddGuide("yl",1,"dy","del","0");f.AddGuide("y3",1,"yh","yh","dh1");f.AddGuide("y4",1,"yl","yl","dh2");f.AddHandleXY(undefined,"0","0","adj","5000","95000","hc","dy");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2, "r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","dh1");f.AddPathCommand(4,"hc","y3","r","dh1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","dh2");f.AddPathCommand(4,"hc","y4","r","dh2");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","b");break}case "textDeflateInflateDeflate":{f.AddAdj("adj",15,"25000");f.AddGuide("a",10,"3000","adj","47000"); f.AddGuide("dy",0,"a","h","100000");f.AddGuide("del",0,"h","3","100");f.AddGuide("ey1",0,"h","30","100");f.AddGuide("ey2",0,"h","36","100");f.AddGuide("ey3",0,"h","63","100");f.AddGuide("ey4",0,"h","70","100");f.AddGuide("by",1,"b","0","dy");f.AddGuide("yh1",1,"dy","0","del");f.AddGuide("yl1",1,"dy","del","0");f.AddGuide("yh2",1,"by","0","del");f.AddGuide("yl2",1,"by","del","0");f.AddGuide("y1",1,"yh1","yh1","ey1");f.AddGuide("y2",1,"yl1","yl1","ey2");f.AddGuide("y3",1,"yh2","yh2","ey3");f.AddGuide("y4", 1,"yl2","yl2","ey4");f.AddHandleXY(undefined,"0","0","adj","3000","47000","hc","dy");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","ey1");f.AddPathCommand(4,"hc","y1","r","ey1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","ey2");f.AddPathCommand(4,"hc","y2","r","ey2");f.AddPathCommand(0,false,"none", undefined,undefined,undefined);f.AddPathCommand(1,"l","ey3");f.AddPathCommand(4,"hc","y3","r","ey3");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","ey4");f.AddPathCommand(4,"hc","y4","r","ey4");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","b");break}case "textDeflateTop":{f.AddAdj("adj",15,"50000");f.AddGuide("a",10,"0","adj","93750");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y1",1,"t", "dy","0");f.AddGuide("cp",1,"y1","dy","0");f.AddHandleXY(undefined,"0","0","adj","0","93750","hc","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(4,"hc","cp","r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","b");break}case "textDoubleWave1":{f.AddAdj("adj1",15,"6250");f.AddAdj("adj2",15,"0");f.AddGuide("a1",10,"0","adj1","12500");f.AddGuide("a2",10,"-10000","adj2", "10000");f.AddGuide("y1",0,"h","a1","100000");f.AddGuide("dy2",0,"y1","10","3");f.AddGuide("y2",1,"y1","0","dy2");f.AddGuide("y3",1,"y1","dy2","0");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("y5",1,"y4","0","dy2");f.AddGuide("y6",1,"y4","dy2","0");f.AddGuide("of",0,"w","a2","100000");f.AddGuide("of2",0,"w","a2","50000");f.AddGuide("x1",4,"of");f.AddGuide("dx2",3,"of2","0","of2");f.AddGuide("x2",1,"l","0","dx2");f.AddGuide("dx8",3,"of2","of2","0");f.AddGuide("x8",1,"r","0","dx8");f.AddGuide("dx3", 2,"dx2","x8","6");f.AddGuide("x3",1,"x2","dx3","0");f.AddGuide("dx4",2,"dx2","x8","3");f.AddGuide("x4",1,"x2","dx4","0");f.AddGuide("x5",2,"x2","x8","2");f.AddGuide("x6",1,"x5","dx3","0");f.AddGuide("x7",2,"x6","x8","2");f.AddGuide("x9",1,"l","dx8","0");f.AddGuide("x15",1,"r","dx2","0");f.AddGuide("x10",1,"x9","dx3","0");f.AddGuide("x11",1,"x9","dx4","0");f.AddGuide("x12",2,"x9","x15","2");f.AddGuide("x13",1,"x12","dx3","0");f.AddGuide("x14",2,"x13","x15","2");f.AddGuide("x16",1,"r","0","x1");f.AddGuide("xAdj", 1,"hc","of","0");f.AddHandleXY(undefined,"0","0","adj1","0","12500","l","y1");f.AddHandleXY("adj2","-10000","10000",undefined,"0","0","xAdj","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y1");f.AddPathCommand(5,"x3","y2","x4","y3","x5","y1");f.AddPathCommand(5,"x6","y2","x7","y3","x8","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x9","y4");f.AddPathCommand(5,"x10","y5","x11","y6","x12","y4");f.AddPathCommand(5, "x13","y5","x14","y6","x15","y4");break}case "textFadeDown":{f.AddAdj("adj",15,"33333");f.AddGuide("a",10,"0","adj","49999");f.AddGuide("dx",0,"a","w","100000");f.AddGuide("x1",1,"l","dx","0");f.AddGuide("x2",1,"r","0","dx");f.AddHandleXY("adj","0","49999",undefined,"0","0","x1","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","b");f.AddPathCommand(2, "x2","b");break}case "textFadeLeft":{f.AddAdj("adj",15,"33333");f.AddGuide("a",10,"0","adj","49999");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y1",1,"t","dy","0");f.AddGuide("y2",1,"b","0","dy");f.AddHandleXY(undefined,"0","0","adj","0","49999","l","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(2,"r","b"); break}case "textFadeRight":{f.AddAdj("adj",15,"33333");f.AddGuide("a",10,"0","adj","49999");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y1",1,"t","dy","0");f.AddGuide("y2",1,"b","0","dy");f.AddHandleXY(undefined,"0","0","adj","0","49999","r","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","y2");break}case "textFadeUp":{f.AddAdj("adj", 15,"33333");f.AddGuide("a",10,"0","adj","49999");f.AddGuide("dx",0,"a","w","100000");f.AddGuide("x1",1,"l","dx","0");f.AddGuide("x2",1,"r","0","dx");f.AddHandleXY("adj","0","49999",undefined,"0","0","x1","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x1","t");f.AddPathCommand(2,"x2","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","b");break}case "textInflate":{f.AddAdj("adj",15,"18750"); f.AddGuide("a",10,"0","adj","20000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("gd",0,"dy","1","3");f.AddGuide("gd0",1,"0","0","gd");f.AddGuide("gd1",1,"h","0","gd0");f.AddGuide("ty",1,"t","dy","0");f.AddGuide("by",1,"b","0","dy");f.AddGuide("y0",1,"t","gd0","0");f.AddGuide("y1",1,"t","gd1","0");f.AddGuide("x0",1,"l","wd3","0");f.AddGuide("x1",1,"r","0","wd3");f.AddHandleXY(undefined,"0","0","adj","0","20000","l","ty");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1, "l","ty");f.AddPathCommand(5,"x0","y0","x1","y0","r","ty");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","by");f.AddPathCommand(5,"x0","y1","x1","y1","r","by");break}case "textInflateBottom":{f.AddAdj("adj",15,"60000");f.AddGuide("a",10,"60000","adj","100000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("ty",1,"t","dy","0");f.AddHandleXY(undefined,"0","0","adj","60000","100000","l","ty");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1, "l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","ty");f.AddPathCommand(4,"hc","b","r","ty");break}case "textInflateTop":{f.AddAdj("adj",15,"40000");f.AddGuide("a",10,"0","adj","50000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("ty",1,"t","dy","0");f.AddHandleXY(undefined,"0","0","adj","0","50000","l","ty");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","ty");f.AddPathCommand(4,"hc", "t","r","ty");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","b");break}case "textPlain":{f.AddAdj("adj",15,"50000");f.AddGuide("a",10,"30000","adj","70000");f.AddGuide("mid",0,"a","w","100000");f.AddGuide("midDir",1,"mid","0","hc");f.AddGuide("dl",1,"mid","0","l");f.AddGuide("dr",1,"r","0","mid");f.AddGuide("dl2",0,"dl","2","1");f.AddGuide("dr2",0,"dr","2","1");f.AddGuide("dx",3,"midDir","dr2","dl2");f.AddGuide("xr",1,"l","dx","0"); f.AddGuide("xl",1,"r","0","dx");f.AddGuide("tlx",3,"midDir","l","xl");f.AddGuide("trx",3,"midDir","xr","r");f.AddGuide("blx",3,"midDir","xl","l");f.AddGuide("brx",3,"midDir","r","xr");f.AddHandleXY("adj","30000","70000",undefined,"0","0","mid","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"tlx","t");f.AddPathCommand(2,"trx","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"blx","b");f.AddPathCommand(2,"brx","b");break}case "textRingInside":{f.AddAdj("adj", 15,"60000");f.AddGuide("a",10,"50000","adj","99000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y",1,"t","dy","0");f.AddGuide("r",0,"dy","1","2");f.AddGuide("y1",1,"t","r","0");f.AddGuide("y2",1,"b","0","r");f.AddHandleXY(undefined,"0","0","adj","50000","99000","hc","y");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(3,"wd2","y1","10800000","21599999");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1, "l","y2");f.AddPathCommand(3,"wd2","r","10800000","21599999");break}case "textRingOutside":{f.AddAdj("adj",15,"60000");f.AddGuide("a",10,"50000","adj","99000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y",1,"t","dy","0");f.AddGuide("r",0,"dy","1","2");f.AddGuide("y1",1,"t","r","0");f.AddGuide("y2",1,"b","0","r");f.AddHandleXY(undefined,"0","0","adj","50000","99000","hc","y");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(3,"wd2", "y1","10800000","-21599999");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(3,"wd2","r","10800000","-21599999");break}case "textSlantDown":{f.AddAdj("adj",15,"44445");f.AddGuide("a",10,"28569","adj","100000");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y1",1,"t","dy","0");f.AddGuide("y2",1,"b","0","dy");f.AddHandleXY(undefined,"0","0","adj","28569","100000","l","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1, "l","t");f.AddPathCommand(2,"r","y2");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"r","b");break}case "textSlantUp":{f.AddAdj("adj",15,"55555");f.AddGuide("a",10,"0","adj","71431");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("y1",1,"t","dy","0");f.AddGuide("y2",1,"b","0","dy");f.AddHandleXY(undefined,"0","0","adj","0","71431","l","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2, "r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","y2");break}case "textStop":{f.AddAdj("adj",15,"25000");f.AddGuide("a",10,"14286","adj","50000");f.AddGuide("dx",0,"w","1","3");f.AddGuide("dy",0,"a","h","100000");f.AddGuide("x1",1,"l","dx","0");f.AddGuide("x2",1,"r","0","dx");f.AddGuide("y1",1,"t","dy","0");f.AddGuide("y2",1,"b","0","dy");f.AddHandleXY(undefined,"0","0","adj","14286","50000","l","dy");f.AddPathCommand(0,false, "none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y1");f.AddPathCommand(2,"x1","t");f.AddPathCommand(2,"x2","t");f.AddPathCommand(2,"r","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y2");f.AddPathCommand(2,"x1","b");f.AddPathCommand(2,"x2","b");f.AddPathCommand(2,"r","y2");break}case "textTriangle":{f.AddAdj("adj",15,"50000");f.AddGuide("a",10,"0","adj","100000");f.AddGuide("y",0,"a","h","100000");f.AddHandleXY(undefined,"0","0","adj","0", "100000","l","y");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y");f.AddPathCommand(2,"hc","t");f.AddPathCommand(2,"r","y");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","b");f.AddPathCommand(2,"r","b");break}case "textTriangleInverted":{f.AddAdj("adj",15,"50000");f.AddGuide("a",10,"0","adj","100000");f.AddGuide("y",0,"a","h","100000");f.AddHandleXY(undefined,"0","0","adj","0","100000","l","y");f.AddPathCommand(0,false, "none",undefined,undefined,undefined);f.AddPathCommand(1,"l","t");f.AddPathCommand(2,"r","t");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"l","y");f.AddPathCommand(2,"hc","b");f.AddPathCommand(2,"r","y");break}case "textWave1":{f.AddAdj("adj1",15,"12500");f.AddAdj("adj2",15,"0");f.AddGuide("a1",10,"0","adj1","20000");f.AddGuide("a2",10,"-10000","adj2","10000");f.AddGuide("y1",0,"h","a1","100000");f.AddGuide("dy2",0,"y1","10","3");f.AddGuide("y2",1,"y1","0","dy2"); f.AddGuide("y3",1,"y1","dy2","0");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("y5",1,"y4","0","dy2");f.AddGuide("y6",1,"y4","dy2","0");f.AddGuide("of",0,"w","a2","100000");f.AddGuide("of2",0,"w","a2","50000");f.AddGuide("x1",4,"of");f.AddGuide("dx2",3,"of2","0","of2");f.AddGuide("x2",1,"l","0","dx2");f.AddGuide("dx5",3,"of2","of2","0");f.AddGuide("x5",1,"r","0","dx5");f.AddGuide("dx3",2,"dx2","x5","3");f.AddGuide("x3",1,"x2","dx3","0");f.AddGuide("x4",2,"x3","x5","2");f.AddGuide("x6",1,"l","dx5","0"); f.AddGuide("x10",1,"r","dx2","0");f.AddGuide("x7",1,"x6","dx3","0");f.AddGuide("x8",2,"x7","x10","2");f.AddGuide("x9",1,"r","0","x1");f.AddGuide("xAdj",1,"hc","of","0");f.AddHandleXY(undefined,"0","0","adj1","0","20000","l","y1");f.AddHandleXY("adj2","-10000","10000",undefined,"0","0","xAdj","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y1");f.AddPathCommand(5,"x3","y2","x4","y3","x5","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined); f.AddPathCommand(1,"x6","y4");f.AddPathCommand(5,"x7","y5","x8","y6","x10","y4");break}case "textWave2":{f.AddAdj("adj1",15,"12500");f.AddAdj("adj2",15,"0");f.AddGuide("a1",10,"0","adj1","20000");f.AddGuide("a2",10,"-10000","adj2","10000");f.AddGuide("y1",0,"h","a1","100000");f.AddGuide("dy2",0,"y1","10","3");f.AddGuide("y2",1,"y1","0","dy2");f.AddGuide("y3",1,"y1","dy2","0");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("y5",1,"y4","0","dy2");f.AddGuide("y6",1,"y4","dy2","0");f.AddGuide("of",0,"w", "a2","100000");f.AddGuide("of2",0,"w","a2","50000");f.AddGuide("x1",4,"of");f.AddGuide("dx2",3,"of2","0","of2");f.AddGuide("x2",1,"l","0","dx2");f.AddGuide("dx5",3,"of2","of2","0");f.AddGuide("x5",1,"r","0","dx5");f.AddGuide("dx3",2,"dx2","x5","3");f.AddGuide("x3",1,"x2","dx3","0");f.AddGuide("x4",2,"x3","x5","2");f.AddGuide("x6",1,"l","dx5","0");f.AddGuide("x10",1,"r","dx2","0");f.AddGuide("x7",1,"x6","dx3","0");f.AddGuide("x8",2,"x7","x10","2");f.AddGuide("x9",1,"r","0","x1");f.AddGuide("xAdj", 1,"hc","of","0");f.AddHandleXY(undefined,"0","0","adj1","0","20000","l","y1");f.AddHandleXY("adj2","-10000","10000",undefined,"0","0","xAdj","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y1");f.AddPathCommand(5,"x3","y3","x4","y2","x5","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x6","y4");f.AddPathCommand(5,"x7","y6","x8","y5","x10","y4");break}case "textWave4":{f.AddAdj("adj1",15,"6250");f.AddAdj("adj2",15, "0");f.AddGuide("a1",10,"0","adj1","12500");f.AddGuide("a2",10,"-10000","adj2","10000");f.AddGuide("y1",0,"h","a1","100000");f.AddGuide("dy2",0,"y1","10","3");f.AddGuide("y2",1,"y1","0","dy2");f.AddGuide("y3",1,"y1","dy2","0");f.AddGuide("y4",1,"b","0","y1");f.AddGuide("y5",1,"y4","0","dy2");f.AddGuide("y6",1,"y4","dy2","0");f.AddGuide("of",0,"w","a2","100000");f.AddGuide("of2",0,"w","a2","50000");f.AddGuide("x1",4,"of");f.AddGuide("dx2",3,"of2","0","of2");f.AddGuide("x2",1,"l","0","dx2");f.AddGuide("dx8", 3,"of2","of2","0");f.AddGuide("x8",1,"r","0","dx8");f.AddGuide("dx3",2,"dx2","x8","6");f.AddGuide("x3",1,"x2","dx3","0");f.AddGuide("dx4",2,"dx2","x8","3");f.AddGuide("x4",1,"x2","dx4","0");f.AddGuide("x5",2,"x2","x8","2");f.AddGuide("x6",1,"x5","dx3","0");f.AddGuide("x7",2,"x6","x8","2");f.AddGuide("x9",1,"l","dx8","0");f.AddGuide("x15",1,"r","dx2","0");f.AddGuide("x10",1,"x9","dx3","0");f.AddGuide("x11",1,"x9","dx4","0");f.AddGuide("x12",2,"x9","x15","2");f.AddGuide("x13",1,"x12","dx3","0");f.AddGuide("x14", 2,"x13","x15","2");f.AddGuide("x16",1,"r","0","x1");f.AddGuide("xAdj",1,"hc","of","0");f.AddHandleXY(undefined,"0","0","adj1","0","12500","l","y1");f.AddHandleXY("adj2","-10000","10000",undefined,"0","0","xAdj","b");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x2","y1");f.AddPathCommand(5,"x3","y3","x4","y2","x5","y1");f.AddPathCommand(5,"x6","y3","x7","y2","x8","y1");f.AddPathCommand(0,false,"none",undefined,undefined,undefined);f.AddPathCommand(1,"x9","y4"); f.AddPathCommand(5,"x10","y6","x11","y5","x12","y4");f.AddPathCommand(5,"x13","y6","x14","y5","x15","y4");break}}if(typeof prst==="string"&&prst.length>0)f.setPreset(prst);return f}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CreateGeometry=CreateGeometry;window["AscFormat"].getPrstByNumber=getPrstByNumber;window["AscFormat"].getNumByTxPrst=getNumByTxPrst;window["AscFormat"].CreatePrstTxWarpGeometry=CreatePrstTxWarpGeometry})(window);"use strict";(function(window,undefined){var drawingsChangesMap= {};var drawingConstructorsMap={};var drawingContentChanges={};window["AscDFH"].drawingsChangesMap=drawingsChangesMap;window["AscDFH"].drawingsConstructorsMap=drawingConstructorsMap;window["AscDFH"].drawingContentChanges=drawingContentChanges;var oPosExtMap={};oPosExtMap[AscDFH.historyitem_Xfrm_SetOffX]=true;oPosExtMap[AscDFH.historyitem_Xfrm_SetOffY]=true;oPosExtMap[AscDFH.historyitem_Xfrm_SetExtX]=true;oPosExtMap[AscDFH.historyitem_Xfrm_SetExtY]=true;oPosExtMap[AscDFH.historyitem_Xfrm_SetChOffX]= true;oPosExtMap[AscDFH.historyitem_Xfrm_SetChOffY]=true;oPosExtMap[AscDFH.historyitem_Xfrm_SetChExtX]=true;oPosExtMap[AscDFH.historyitem_Xfrm_SetChExtY]=true;var oPosExtHor={};oPosExtHor[AscDFH.historyitem_Xfrm_SetOffX]=true;oPosExtHor[AscDFH.historyitem_Xfrm_SetExtX]=true;oPosExtHor[AscDFH.historyitem_Xfrm_SetChOffX]=true;oPosExtHor[AscDFH.historyitem_Xfrm_SetChExtX]=true;function private_SetValue(Value){if(!this.Class)return;if(AscDFH.drawingsChangesMap[this.Type]){var _Value=Value===undefined? null:Value;AscDFH.drawingsChangesMap[this.Type](this.Class,_Value,this.FromLoad)}}function CChangesDrawingsBool(Class,Type,OldPr,NewPr){this.Type=Type;var _OldPr=AscFormat.isRealBool(OldPr)?OldPr:undefined;var _NewPr=AscFormat.isRealBool(NewPr)?NewPr:undefined;AscDFH.CChangesBaseBoolProperty.call(this,Class,_OldPr,_NewPr)}CChangesDrawingsBool.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesDrawingsBool.prototype.constructor=CChangesDrawingsBool;CChangesDrawingsBool.prototype.private_SetValue= private_SetValue;CChangesDrawingsBool.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingsBool.prototype.CreateReverseChange=function(){return new this.constructor(this.Class,this.Type,this.New,this.Old,this.Color)};CChangesDrawingsBool.prototype.ReadFromBinary=function(reader){reader.Seek2(reader.GetCurPos()-4);this.Type=reader.GetLong();AscDFH.CChangesBaseBoolProperty.prototype.ReadFromBinary.call(this,reader)};window["AscDFH"].CChangesDrawingsBool=CChangesDrawingsBool; function CChangesDrawingsLong(Class,Type,OldPr,NewPr){this.Type=Type;var _OldPr=AscFormat.isRealNumber(OldPr)?OldPr+.5>>0:undefined;var _NewPr=AscFormat.isRealNumber(NewPr)?NewPr+.5>>0:undefined;AscDFH.CChangesBaseLongProperty.call(this,Class,_OldPr,_NewPr)}CChangesDrawingsLong.prototype=Object.create(AscDFH.CChangesBaseLongProperty.prototype);CChangesDrawingsLong.prototype.constructor=CChangesDrawingsLong;CChangesDrawingsLong.prototype.CreateReverseChange=function(){return new this.constructor(this.Class, this.Type,this.New,this.Old,this.Color)};CChangesDrawingsLong.prototype.private_SetValue=private_SetValue;CChangesDrawingsLong.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingsLong.prototype.ReadFromBinary=function(reader){reader.Seek2(reader.GetCurPos()-4);this.Type=reader.GetLong();AscDFH.CChangesBaseLongProperty.prototype.ReadFromBinary.call(this,reader)};window["AscDFH"].CChangesDrawingsLong=CChangesDrawingsLong;function CChangesDrawingsDouble(Class,Type,OldPr,NewPr){this.Type= Type;var _OldPr=AscFormat.isRealNumber(OldPr)?OldPr:undefined;var _NewPr=AscFormat.isRealNumber(NewPr)?NewPr:undefined;AscDFH.CChangesBaseDoubleProperty.call(this,Class,_OldPr,_NewPr)}CChangesDrawingsDouble.prototype=Object.create(AscDFH.CChangesBaseDoubleProperty.prototype);CChangesDrawingsDouble.prototype.constructor=CChangesDrawingsDouble;CChangesDrawingsDouble.prototype.CreateReverseChange=function(){return new this.constructor(this.Class,this.Type,this.New,this.Old,this.Color)};CChangesDrawingsDouble.prototype.private_SetValue= private_SetValue;CChangesDrawingsDouble.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingsDouble.prototype.ReadFromBinary=function(reader){reader.Seek2(reader.GetCurPos()-4);this.Type=reader.GetLong();AscDFH.CChangesBaseDoubleProperty.prototype.ReadFromBinary.call(this,reader)};CChangesDrawingsDouble.prototype.IsPosExtChange=function(){return!!oPosExtMap[this.Type]};CChangesDrawingsDouble.prototype.IsHorizontal=function(){return!!oPosExtHor[this.Type]};window["AscDFH"].CChangesDrawingsDouble= CChangesDrawingsDouble;function CChangesDrawingsDouble2(Class,Type,OldPr,NewPr){this.Type=Type;var _OldPr=AscFormat.isRealNumber(OldPr)?OldPr:undefined;var _NewPr=AscFormat.isRealNumber(NewPr)?NewPr:undefined;AscDFH.CChangesBaseDoubleProperty.call(this,Class,_OldPr,_NewPr)}CChangesDrawingsDouble2.prototype=Object.create(AscDFH.CChangesBaseDoubleProperty.prototype);CChangesDrawingsDouble2.prototype.constructor=CChangesDrawingsDouble2;CChangesDrawingsDouble2.prototype.CreateReverseChange=function(){return new this.constructor(this.Class, this.Type,this.New,this.Old,this.Color)};CChangesDrawingsDouble2.prototype.private_SetValue=private_SetValue;CChangesDrawingsDouble2.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingsDouble2.prototype.WriteToBinary=function(Writer){var nFlags=0;if(false!==this.Color)nFlags|=1;if(undefined===this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;Writer.WriteLong(nFlags);if(undefined!==this.New)Writer.WriteDouble2(this.New);if(undefined!==this.Old)Writer.WriteDouble2(this.Old)}; CChangesDrawingsDouble2.prototype.ReadFromBinary=function(Reader){Reader.Seek2(Reader.GetCurPos()-4);this.Type=Reader.GetLong();var nFlags=Reader.GetLong();if(nFlags&1)this.Color=true;else this.Color=false;if(nFlags&2)this.New=undefined;else this.New=Reader.GetDoubleLE();if(nFlags&4)this.Old=undefined;else this.Old=Reader.GetDoubleLE()};CChangesDrawingsDouble2.prototype.IsPosExtChange=function(){return!!oPosExtMap[this.Type]};CChangesDrawingsDouble2.prototype.IsHorizontal=function(){return!!oPosExtHor[this.Type]}; window["AscDFH"].CChangesDrawingsDouble2=CChangesDrawingsDouble2;function CChangesDrawingsString(Class,Type,OldPr,NewPr){this.Type=Type;var _OldPr=typeof OldPr==="string"?OldPr:undefined;var _NewPr=typeof NewPr==="string"?NewPr:undefined;AscDFH.CChangesBaseStringProperty.call(this,Class,_OldPr,_NewPr)}CChangesDrawingsString.prototype=Object.create(AscDFH.CChangesBaseStringProperty.prototype);CChangesDrawingsString.prototype.constructor=CChangesDrawingsString;CChangesDrawingsString.prototype.CreateReverseChange= function(){return new this.constructor(this.Class,this.Type,this.New,this.Old,this.Color)};CChangesDrawingsString.prototype.private_SetValue=private_SetValue;CChangesDrawingsString.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingsString.prototype.ReadFromBinary=function(reader){reader.Seek2(reader.GetCurPos()-4);this.Type=reader.GetLong();AscDFH.CChangesBaseStringProperty.prototype.ReadFromBinary.call(this,reader)};window["AscDFH"].CChangesDrawingsString=CChangesDrawingsString; function CChangesDrawingsObjectNoId(Class,Type,OldPr,NewPr){this.Type=Type;this.FromLoad=false;var _OldPr=AscCommon.isRealObject(OldPr)?OldPr:undefined;var _NewPr=AscCommon.isRealObject(NewPr)?NewPr:undefined;AscDFH.CChangesBaseObjectProperty.call(this,Class,_OldPr,_NewPr)}CChangesDrawingsObjectNoId.prototype=Object.create(AscDFH.CChangesBaseObjectProperty.prototype);CChangesDrawingsObjectNoId.prototype.constructor=CChangesDrawingsObjectNoId;CChangesDrawingsObjectNoId.prototype.CreateReverseChange= function(){return new this.constructor(this.Class,this.Type,this.New,this.Old,this.Color)};CChangesDrawingsObjectNoId.prototype.private_SetValue=private_SetValue;CChangesDrawingsObjectNoId.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};window["AscDFH"].CChangesDrawingsObjectNoId=CChangesDrawingsObjectNoId;CChangesDrawingsObjectNoId.prototype.ReadFromBinary=function(reader){reader.Seek2(reader.GetCurPos()-4);var nType=reader.GetLong();this.Type=nType;this.FromLoad=true;AscDFH.CChangesBaseObjectProperty.prototype.ReadFromBinary.call(this, reader)};CChangesDrawingsObjectNoId.prototype.private_CreateObject=function(){if(AscDFH.drawingsConstructorsMap[this.Type])return new AscDFH.drawingsConstructorsMap[this.Type];return null};function CChangesDrawingsObject(Class,Type,OldPr,NewPr){this.Type=Type;var _OldPr=OldPr&&OldPr.Get_Id?OldPr.Get_Id():undefined;var _NewPr=NewPr&&NewPr.Get_Id?NewPr.Get_Id():undefined;AscDFH.CChangesBaseStringProperty.call(this,Class,_OldPr,_NewPr)}CChangesDrawingsObject.prototype=Object.create(AscDFH.CChangesBaseStringProperty.prototype); CChangesDrawingsObject.prototype.constructor=CChangesDrawingsObject;CChangesDrawingsObject.prototype.CreateReverseChange=function(){return new this.constructor(this.Class,this.Type,AscCommon.g_oTableId.Get_ById(this.New),AscCommon.g_oTableId.Get_ById(this.Old),this.Color)};window["AscDFH"].CChangesDrawingsObject=CChangesDrawingsObject;CChangesDrawingsObject.prototype.ReadFromBinary=function(reader){reader.Seek2(reader.GetCurPos()-4);this.Type=reader.GetLong();AscDFH.CChangesBaseStringProperty.prototype.ReadFromBinary.call(this, reader)};CChangesDrawingsObject.prototype.private_SetValue=function(Value){var oObject=null;if(typeof Value==="string"){oObject=AscCommon.g_oTableId.Get_ById(Value);if(!oObject)oObject=null}if(AscDFH.drawingsChangesMap[this.Type])AscDFH.drawingsChangesMap[this.Type](this.Class,oObject)};CChangesDrawingsObject.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingsObject.prototype.CheckCorrect=function(){if(this.Old){var oObject=AscCommon.g_oTableId.Get_ById(this.Old);if(oObject.CheckCorrect)if(!oObject.CheckCorrect())return false}return true}; function CChangesDrawingsContent(Class,Type,Pos,Items,isAdd){this.Type=Type;AscDFH.CChangesBaseContentChange.call(this,Class,Pos,Items,isAdd)}CChangesDrawingsContent.prototype=Object.create(AscDFH.CChangesBaseContentChange.prototype);CChangesDrawingsContent.prototype.constructor=CChangesDrawingsContent;window["AscDFH"].CChangesDrawingsContent=CChangesDrawingsContent;CChangesDrawingsContent.prototype.ReadFromBinary=function(reader){reader.Seek2(reader.GetCurPos()-4);this.Type=reader.GetLong();this.Add= reader.GetBool();this.Pos=reader.GetLong();AscDFH.CChangesBaseContentChange.prototype.ReadFromBinary.call(this,reader)};CChangesDrawingsContent.prototype.WriteToBinary=function(writer){writer.WriteBool(this.IsAdd());writer.WriteLong(this.Pos);AscDFH.CChangesBaseContentChange.prototype.WriteToBinary.call(this,writer)};CChangesDrawingsContent.prototype.private_WriteItem=function(Writer,Item){Writer.WriteString2(Item.Get_Id())};CChangesDrawingsContent.prototype.private_ReadItem=function(Reader){var Id= Reader.GetString2();return AscCommon.g_oTableId.Get_ById(Id)};CChangesDrawingsContent.prototype.private_GetChangedArray=function(){if(drawingContentChanges[this.Type])return drawingContentChanges[this.Type](this.Class);return null};CChangesDrawingsContent.prototype.private_GetContentChanges=function(){if(this.Class&&this.Class.getContentChangesByType)return this.Class.getContentChangesByType(this.Type);return null};CChangesDrawingsContent.prototype.private_InsertInArrayLoad=function(){if(this.Items.length<= 0)return;var aChangedArray=this.private_GetChangedArray();if(null!==aChangedArray){var oContentChanges=this.private_GetContentChanges(),nPos;for(var i=0;i<this.Items.length;++i){if(oContentChanges)nPos=oContentChanges.Check(AscCommon.contentchanges_Add,this.Pos+i);else nPos=this.Pos+i;var oElement=this.Items[i];nPos=Math.min(nPos,aChangedArray.length);aChangedArray.splice(nPos,0,oElement)}}};CChangesDrawingsContent.prototype.private_RemoveInArrayLoad=function(){var aChangedArray=this.private_GetChangedArray(); if(null!==aChangedArray){var oContentChanges=this.private_GetContentChanges(),nPos;for(var i=0;i<this.Items.length;++i){if(oContentChanges)nPos=oContentChanges.Check(AscCommon.contentchanges_Remove,this.Pos+i);else nPos=this.Pos+i;if(false===nPos)continue;aChangedArray.splice(nPos,1)}}};CChangesDrawingsContent.prototype.private_InsertInArrayUndoRedo=function(){var aChangedArray=this.private_GetChangedArray();if(null!==aChangedArray){var nPos;for(var i=0;i<this.Items.length;++i){nPos=Math.min(this.Pos+ i,aChangedArray.length);aChangedArray.splice(nPos,0,this.Items[i])}}};CChangesDrawingsContent.prototype.private_RemoveInArrayUndoRedo=function(){var aChangedArray=this.private_GetChangedArray();if(null!==aChangedArray)for(var i=0;i<this.Items.length;++i)aChangedArray.splice(this.Pos+i,1)};CChangesDrawingsContent.prototype.Load=function(){if(this.IsAdd())this.private_InsertInArrayLoad();else this.private_RemoveInArrayLoad();this.RefreshRecalcData()};CChangesDrawingsContent.prototype.Undo=function(){if(this.IsAdd())this.private_RemoveInArrayUndoRedo(); else this.private_InsertInArrayUndoRedo()};CChangesDrawingsContent.prototype.Redo=function(){if(this.IsAdd())this.private_InsertInArrayUndoRedo();else this.private_RemoveInArrayUndoRedo()};CChangesDrawingsContent.prototype.IsContentChange=function(){return false};CChangesDrawingsContent.prototype.Copy=function(){var oChanges=new this.constructor(this.Class,this.Type,this.Pos,this.Items,this.Add);oChanges.UseArray=this.UseArray;oChanges.Pos=this.Pos;for(var nIndex=0,nCount=this.PosArray.length;nIndex< nCount;++nIndex)oChanges.PosArray[nIndex]=this.PosArray[nIndex];return oChanges};CChangesDrawingsContent.prototype.CreateReverseChange=function(){var oRet=this.private_CreateReverseChange(this.constructor);oRet.Type=this.Type;oRet.Pos=this.Pos;return oRet};function CChangesDrawingsContentPresentation(Class,Type,Pos,Items,isAdd){CChangesDrawingsContent.call(this,Class,Type,Pos,Items,isAdd)}CChangesDrawingsContentPresentation.prototype=Object.create(CChangesDrawingsContent.prototype);CChangesDrawingsContentPresentation.prototype.constructor= CChangesDrawingsContentPresentation;CChangesDrawingsContentPresentation.prototype.IsContentChange=function(){return true};CChangesDrawingsContentPresentation.prototype.Load=function(Color){var aContent=this.private_GetChangedArray();if(!Array.isArray(aContent))return;if(this.IsAdd()){if(this.PosArray.length<=0||this.Items.length<=0)return;for(var nIndex=0,nCount=this.Items.length;nIndex<nCount;++nIndex){var Pos=this.Class.m_oContentChanges.Check(AscCommon.contentchanges_Add,true!==this.UseArray?this.Pos+ nIndex:this.PosArray[nIndex]);if(Pos===false)continue;var Element=this.Items[nIndex];Pos=Math.min(Pos,aContent.length);aContent.splice(Pos,0,Element)}}else for(var nIndex=0,nCount=this.Items.length;nIndex<nCount;++nIndex){var Pos=this.Class.m_oContentChanges.Check(AscCommon.contentchanges_Remove,true!==this.UseArray?this.Pos+nIndex:this.PosArray[nIndex]);if(false===Pos)continue;if(aContent[Pos]===this.Items[nIndex]){aContent.splice(Pos,1);break}for(var j=aContent.length-1;j>-1;--j)if(aContent[j]=== this.Items[nIndex]){aContent.splice(j,1);break}}};CChangesDrawingsContentPresentation.prototype.CheckCorrect=function(){if(!this.IsAdd())for(var nIndex=0;nIndex<this.Items.length;++nIndex)if(this.Items[nIndex].CheckCorrect&&!this.Items[nIndex].CheckCorrect())return false;return true};window["AscDFH"].CChangesDrawingsContentPresentation=CChangesDrawingsContentPresentation;function CChangesDrawingsContentNoId(Class,Type,Pos,Items,isAdd){AscDFH.CChangesDrawingsContent.call(this,Class,Type,Pos,Items, isAdd)}CChangesDrawingsContentNoId.prototype=Object.create(AscDFH.CChangesDrawingsContent.prototype);CChangesDrawingsContentNoId.prototype.constructor=CChangesDrawingsContentNoId;CChangesDrawingsContentNoId.prototype.private_WriteItem=function(Writer,Item){Item.Write_ToBinary(Writer)};CChangesDrawingsContentNoId.prototype.private_ReadItem=function(Reader){var oItem=null;if(drawingConstructorsMap[this.Type]){oItem=new drawingConstructorsMap[this.Type];oItem.Read_FromBinary(Reader)}return oItem};window["AscDFH"].CChangesDrawingsContentNoId= CChangesDrawingsContentNoId;function CChangesDrawingsContentLong(Class,Type,Pos,Items,isAdd){AscDFH.CChangesDrawingsContent.call(this,Class,Type,Pos,Items,isAdd)}CChangesDrawingsContentLong.prototype=Object.create(AscDFH.CChangesDrawingsContent.prototype);CChangesDrawingsContentLong.prototype.constructor=CChangesDrawingsContentLong;CChangesDrawingsContentLong.prototype.private_WriteItem=function(Writer,Item){Writer.WriteLong(Item)};CChangesDrawingsContentLong.prototype.private_ReadItem=function(Reader){return Reader.GetLong()}; window["AscDFH"].CChangesDrawingsContentLong=CChangesDrawingsContentLong;function CChangesDrawingsContentLongMap(Class,Type,Pos,Items,isAdd){AscDFH.CChangesDrawingsContentLong.call(this,Class,Type,Pos,Items,isAdd)}CChangesDrawingsContentLongMap.prototype=Object.create(AscDFH.CChangesDrawingsContentLong.prototype);CChangesDrawingsContentLongMap.prototype.constructor=CChangesDrawingsContentLongMap;CChangesDrawingsContentLongMap.prototype.private_InsertInArrayLoad=function(){if(this.Items.length<=0)return; var aChangedArray=this.private_GetChangedArray();if(null!==aChangedArray)for(var i=0;i<this.Items.length;++i)aChangedArray[this.Pos+i]=this.Items[i]};CChangesDrawingsContentLongMap.prototype.private_RemoveInArrayLoad=function(){var aChangedArray=this.private_GetChangedArray();if(null!==aChangedArray)for(var i=0;i<this.Items.length;++i)aChangedArray[this.Pos+i]=null};CChangesDrawingsContentLongMap.prototype.private_InsertInArrayUndoRedo=function(){var aChangedArray=this.private_GetChangedArray();if(null!== aChangedArray)for(var i=0;i<this.Items.length;++i)aChangedArray[this.Pos+i]=this.Items[i]};CChangesDrawingsContentLongMap.prototype.private_RemoveInArrayUndoRedo=function(){var aChangedArray=this.private_GetChangedArray();if(null!==aChangedArray)for(var i=0;i<this.Items.length;++i)aChangedArray[this.Pos+i]=null};window["AscDFH"].CChangesDrawingsContentLongMap=CChangesDrawingsContentLongMap;function CChangesDrawingChangeTheme(Class,Type,aIndexes){this.Type=Type;this.aIndexes=aIndexes;AscDFH.CChangesBase.call(this, Class)}CChangesDrawingChangeTheme.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesDrawingChangeTheme.prototype.constructor=CChangesDrawingChangeTheme;CChangesDrawingChangeTheme.prototype.WriteToBinary=function(Writer){Writer.WriteLong(this.Type);Writer.WriteLong(this.aIndexes.length);for(var i=0;i<this.aIndexes.length;++i)Writer.WriteLong(this.aIndexes[i])};CChangesDrawingChangeTheme.prototype.ReadFromBinary=function(Reader){this.Type=Reader.GetLong();this.aIndexes=[];var nLength=Reader.GetLong(); for(var i=0;i<nLength;++i)this.aIndexes.push(Reader.GetLong())};CChangesDrawingChangeTheme.prototype.Do=function(){var aSlides=this.Class.Slides;for(var i=0;i<this.aIndexes.length;++i)aSlides[this.aIndexes[i]]&&aSlides[this.aIndexes[i]].checkSlideTheme()};CChangesDrawingChangeTheme.prototype.Undo=function(){this.Do()};CChangesDrawingChangeTheme.prototype.Redo=function(){this.Do()};CChangesDrawingChangeTheme.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingChangeTheme.prototype.CreateReverseChange= function(){return new CChangesDrawingChangeTheme(this.Class,this.Type,this.aIndexes)};window["AscDFH"].CChangesDrawingChangeTheme=CChangesDrawingChangeTheme;function CChangesDrawingTimingLocks(Class,deleteLock,backgroundLock,timingLock,transitionLock,layoutLock,showLock){this.Type=AscDFH.historyitem_SlideSetLocks;this.deleteLock=deleteLock;this.backgroundLock=backgroundLock;this.timingLock=timingLock;this.transitionLock=transitionLock;this.layoutLock=layoutLock;this.showLock=showLock;AscDFH.CChangesBase.call(this, Class)}CChangesDrawingTimingLocks.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesDrawingTimingLocks.prototype.constructor=CChangesDrawingTimingLocks;CChangesDrawingTimingLocks.prototype.WriteToBinary=function(Writer){AscFormat.writeObject(Writer,this.deleteLock);AscFormat.writeObject(Writer,this.backgroundLock);AscFormat.writeObject(Writer,this.timingLock);AscFormat.writeObject(Writer,this.transitionLock);AscFormat.writeObject(Writer,this.layoutLock);AscFormat.writeObject(Writer,this.showLock)}; CChangesDrawingTimingLocks.prototype.ReadFromBinary=function(Reader){this.deleteLock=AscFormat.readObject(Reader);this.backgroundLock=AscFormat.readObject(Reader);this.timingLock=AscFormat.readObject(Reader);this.transitionLock=AscFormat.readObject(Reader);this.layoutLock=AscFormat.readObject(Reader);this.showLock=AscFormat.readObject(Reader)};CChangesDrawingTimingLocks.prototype.Undo=function(){var oSlide=this.Class;oSlide.deleteLock=null;oSlide.backgroundLock=null;oSlide.timingLock=null;oSlide.transitionLock= null;oSlide.layoutLock=null;oSlide.showLock=null};CChangesDrawingTimingLocks.prototype.Redo=function(){var oSlide=this.Class;oSlide.deleteLock=this.deleteLock;oSlide.backgroundLock=this.backgroundLock;oSlide.timingLock=this.timingLock;oSlide.transitionLock=this.transitionLock;oSlide.layoutLock=this.layoutLock;oSlide.showLock=this.showLock};CChangesDrawingTimingLocks.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingTimingLocks.prototype.CreateReverseChange=function(){return new this.constructor(this.Class, null,null,null,null,null)};window["AscDFH"].CChangesDrawingTimingLocks=CChangesDrawingTimingLocks;function CChangesSparklinesChangeData(Class,OldPr,NewPr){this.Type=AscDFH.historyitem_Sparkline_ChangeData;this.OldPr=OldPr;this.NewPr=NewPr;AscDFH.CChangesBase.call(this,Class)}CChangesSparklinesChangeData.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesSparklinesChangeData.prototype.constructor=CChangesSparklinesChangeData;CChangesSparklinesChangeData.prototype.WritePr=function(Writer, Pr){var bIsArray=Array.isArray(Pr);Writer.WriteBool(bIsArray);if(bIsArray){Writer.WriteLong(Pr.length);for(var i=0;i<Pr.length;++i){Writer.WriteLong(Pr[i].sqRef.c1);Writer.WriteLong(Pr[i].sqRef.r1);Writer.WriteString2(Pr[i].f)}}};CChangesSparklinesChangeData.prototype.ReadPr=function(Reader){var bIsArray=Reader.GetBool();var RetPr=null;if(bIsArray){var nLength=Reader.GetLong();RetPr=[];for(var i=0;i<nLength;++i){var oSparkline=new AscCommonExcel.sparkline;var col=Reader.GetLong();var row=Reader.GetLong(); oSparkline.sqRef=new Asc.Range(col,row,col,row);oSparkline.setF(Reader.GetString2());RetPr.push(oSparkline)}}return RetPr};CChangesSparklinesChangeData.prototype.WriteToBinary=function(Writer){this.WritePr(Writer,this.OldPr);this.WritePr(Writer,this.NewPr)};CChangesSparklinesChangeData.prototype.ReadFromBinary=function(Reader){Reader.Seek2(Reader.GetCurPos()-4);var nType=Reader.GetLong();this.Type=nType;this.OldPr=this.ReadPr(Reader);this.NewPr=this.ReadPr(Reader)};CChangesSparklinesChangeData.prototype.Fill= function(Pr){var aSparklines=this.Class.arrSparklines;aSparklines.length=0;if(Array.isArray(Pr))for(var i=0;i<Pr.length;++i)aSparklines.push(Pr[i].clone());this.Class.cleanCache()};CChangesSparklinesChangeData.prototype.Undo=function(){this.Fill(this.OldPr)};CChangesSparklinesChangeData.prototype.Redo=function(){this.Fill(this.NewPr)};CChangesSparklinesChangeData.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesSparklinesChangeData.prototype.CreateReverseChange=function(){return new CChangesSparklinesChangeData(this.Class, this.NewPr,this.OldPr)};window["AscDFH"].CChangesSparklinesChangeData=CChangesSparklinesChangeData;function CChangesSparklinesRemoveData(Class,oSparkline,bReverse){this.Type=AscDFH.historyitem_Sparkline_RemoveData;this.sparkline=oSparkline;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesSparklinesRemoveData.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesSparklinesRemoveData.prototype.constructor=CChangesSparklinesRemoveData;CChangesSparklinesRemoveData.prototype.WriteToBinary= function(Writer){var bIsObject=AscCommon.isRealObject(this.sparkline);Writer.WriteBool(bIsObject);if(bIsObject){Writer.WriteLong(this.sparkline.sqRef.c1);Writer.WriteLong(this.sparkline.sqRef.r1);Writer.WriteString2(this.sparkline.f)}Writer.WriteBool(this.bReverse===true)};CChangesSparklinesRemoveData.prototype.ReadFromBinary=function(Reader){var bIsObject=Reader.GetLong();if(bIsObject){this.sparkline=new AscCommonExcel.sparkline;var col=Reader.GetLong();var row=Reader.GetLong();this.sparkline.sqRef= new Asc.Range(col,row,col,row);this.sparkline.setF(Reader.GetString2())}this.bReverse=Reader.GetBool()};CChangesSparklinesRemoveData.prototype.Undo=function(){if(this.bReverse)this.Class.remove(this.sparkline.sqRef);else this.Class.arrSparklines.push(this.sparkline);this.Class.cleanCache()};CChangesSparklinesRemoveData.prototype.Redo=function(){if(this.bReverse)this.Class.arrSparklines.push(this.sparkline);else this.Class.remove(this.sparkline.sqRef);this.Class.cleanCache()};CChangesSparklinesRemoveData.prototype.CreateReverseChange= function(){return new CChangesSparklinesRemoveData(this.Class,this.sparkline,!this.bReverse)};window["AscDFH"].CChangesSparklinesRemoveData=CChangesSparklinesRemoveData;function CChangesDrawingsExcelColor(Class,Type,OldPr,NewPr){this.Type=Type;this.OldPr=OldPr;this.NewPr=NewPr;AscDFH.CChangesBase.call(this,Class)}CChangesDrawingsExcelColor.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesDrawingsExcelColor.prototype.constructor=CChangesDrawingsExcelColor;CChangesDrawingsExcelColor.prototype.WritePr= function(Writer,Pr){var bIsObject=AscCommon.isRealObject(Pr);Writer.WriteBool(bIsObject);if(bIsObject){Writer.WriteLong(Pr.getType());Pr.Write_ToBinary2(Writer)}};CChangesDrawingsExcelColor.prototype.ReadPr=function(Reader){var RetPr=null;var bIsObject=Reader.GetBool();if(bIsObject)switch(Reader.GetLong()){case AscCommonExcel.UndoRedoDataTypes.RgbColor:RetPr=new AscCommonExcel.RgbColor;RetPr.Read_FromBinary2(Reader);break;case AscCommonExcel.UndoRedoDataTypes.ThemeColor:RetPr=new AscCommonExcel.ThemeColor; RetPr=RetPr.Read_FromBinary2AndReplace(Reader);break}return RetPr};CChangesDrawingsExcelColor.prototype.WriteToBinary=function(Writer){this.WritePr(Writer,this.OldPr);this.WritePr(Writer,this.NewPr)};CChangesDrawingsExcelColor.prototype.ReadFromBinary=function(Reader){Reader.Seek2(Reader.GetCurPos()-4);var nType=Reader.GetLong();this.Type=nType;this.OldPr=this.ReadPr(Reader);this.NewPr=this.ReadPr(Reader)};CChangesDrawingsExcelColor.prototype.Undo=function(){this.Fill(this.OldPr)};CChangesDrawingsExcelColor.prototype.Redo= function(){this.Fill(this.NewPr)};CChangesDrawingsExcelColor.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingsExcelColor.prototype.Fill=function(Pr){var oClass=this.Class;switch(this.Type){case AscDFH.historyitem_Sparkline_ColorSeries:oClass.colorSeries=Pr;break;case AscDFH.historyitem_Sparkline_ColorNegative:oClass.colorNegative=Pr;break;case AscDFH.historyitem_Sparkline_ColorAxis:oClass.colorAxis=Pr;break;case AscDFH.historyitem_Sparkline_ColorMarkers:oClass.colorMarkers= Pr;break;case AscDFH.historyitem_Sparkline_ColorFirst:oClass.colorFirst=Pr;break;case AscDFH.historyitem_Sparkline_colorLast:oClass.colorLast=Pr;break;case AscDFH.historyitem_Sparkline_ColorHigh:oClass.colorHigh=Pr;break;case AscDFH.historyitem_Sparkline_ColorLow:oClass.colorLow=Pr;break}oClass.cleanCache()};CChangesDrawingsExcelColor.prototype.CreateReverseChange=function(){return new CChangesDrawingsExcelColor(this.Class,this.Type,this.NewPr,this.OldPr)};AscDFH.CChangesDrawingsExcelColor=CChangesDrawingsExcelColor; function CChangesDrawingsSparklinesRemove(Class,bReverse){this.Type=AscDFH.historyitem_Sparkline_RemoveSparkline;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesDrawingsSparklinesRemove.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesDrawingsSparklinesRemove.prototype.constructor=CChangesDrawingsSparklinesRemove;CChangesDrawingsSparklinesRemove.prototype.Undo=function(){if(this.Class.worksheet)if(this.bReverse)this.Class.worksheet.removeSparklineGroup(this.Class.Get_Id()); else this.Class.worksheet.insertSparklineGroup(this.Class);this.Class.cleanCache()};CChangesDrawingsSparklinesRemove.prototype.Redo=function(){if(this.Class.worksheet)if(this.bReverse)this.Class.worksheet.insertSparklineGroup(this.Class);else this.Class.worksheet.removeSparklineGroup(this.Class.Get_Id());this.Class.cleanCache()};CChangesDrawingsSparklinesRemove.prototype.WriteToBinary=function(Writer){Writer.WriteBool(!!this.bReverse)};CChangesDrawingsSparklinesRemove.prototype.ReadFromBinary=function(Reader){this.bReverse= Reader.GetBool()};CChangesDrawingsSparklinesRemove.prototype.Load=function(){this.Redo();this.RefreshRecalcData()};CChangesDrawingsSparklinesRemove.prototype.CreateReverseChange=function(){return new CChangesDrawingsSparklinesRemove(this.Class,!this.bReverse)};window["AscDFH"].CChangesDrawingsSparklinesRemove=CChangesDrawingsSparklinesRemove;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_Type]=AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_LineWeight]=AscDFH.CChangesDrawingsDouble; AscDFH.changesFactory[AscDFH.historyitem_Sparkline_DisplayEmptyCellsAs]=AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_Markers]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_High]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_Low]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_First]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_Last]=AscDFH.CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_Sparkline_Negative]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_DisplayXAxis]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_DisplayHidden]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_MinAxisType]=AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_MaxAxisType]=AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_RightToLeft]= AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ManualMax]=AscDFH.CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ManualMin]=AscDFH.CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_DateAxis]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_F]=AscDFH.CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ColorSeries]=AscDFH.CChangesDrawingsExcelColor;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ColorNegative]= AscDFH.CChangesDrawingsExcelColor;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ColorAxis]=AscDFH.CChangesDrawingsExcelColor;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ColorMarkers]=AscDFH.CChangesDrawingsExcelColor;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ColorFirst]=AscDFH.CChangesDrawingsExcelColor;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_colorLast]=AscDFH.CChangesDrawingsExcelColor;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ColorHigh]=AscDFH.CChangesDrawingsExcelColor; AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ColorLow]=AscDFH.CChangesDrawingsExcelColor;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_ChangeData]=AscDFH.CChangesSparklinesChangeData;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_RemoveData]=AscDFH.CChangesSparklinesRemoveData;AscDFH.changesFactory[AscDFH.historyitem_Sparkline_RemoveSparkline]=AscDFH.CChangesDrawingsSparklinesRemove;AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_Type]=function(oClass,value){oClass.type=value; oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_LineWeight]=function(oClass,value){oClass.lineWeight=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_DisplayEmptyCellsAs]=function(oClass,value){oClass.displayEmptyCellsAs=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_Markers]=function(oClass,value){oClass.markers=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_High]=function(oClass, value){oClass.high=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_Low]=function(oClass,value){oClass.low=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_First]=function(oClass,value){oClass.first=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_Last]=function(oClass,value){oClass.last=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_Negative]=function(oClass,value){oClass.negative= value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_DisplayXAxis]=function(oClass,value){oClass.displayXAxis=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_DisplayHidden]=function(oClass,value){oClass.displayHidden=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_MinAxisType]=function(oClass,value){oClass.minAxisType=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_MaxAxisType]= function(oClass,value){oClass.maxAxisType=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_RightToLeft]=function(oClass,value){oClass.rightToLeft=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_ManualMax]=function(oClass,value){oClass.manualMax=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_ManualMin]=function(oClass,value){oClass.manualMin=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_DateAxis]= function(oClass,value){oClass.dateAxis=value;oClass.cleanCache()};AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_F]=function(oClass,value){oClass.f=value;oClass.cleanCache()}})(window);"use strict";(function(window,undefined){var ArcToCurvers=AscFormat.ArcToCurvers;var History=AscCommon.History;var EPSILON_TEXT_AUTOFIT=.001;var FORMULA_TYPE_MULT_DIV=0,FORMULA_TYPE_PLUS_MINUS=1,FORMULA_TYPE_PLUS_DIV=2,FORMULA_TYPE_IF_ELSE=3,FORMULA_TYPE_ABS=4,FORMULA_TYPE_AT2=5,FORMULA_TYPE_CAT2=6,FORMULA_TYPE_COS= 7,FORMULA_TYPE_MAX=8,FORMULA_TYPE_MOD=9,FORMULA_TYPE_PIN=10,FORMULA_TYPE_SAT2=11,FORMULA_TYPE_SIN=12,FORMULA_TYPE_SQRT=13,FORMULA_TYPE_TAN=14,FORMULA_TYPE_VALUE=15,FORMULA_TYPE_MIN=16;var cToRad=Math.PI/(6E4*180);var cToDeg=1/cToRad;var MAX_ITER_COUNT=50;var oGdLst={};oGdLst["_3cd4"]=162E5;oGdLst["_3cd8"]=81E5;oGdLst["_5cd8"]=135E5;oGdLst["_7cd8"]=189E5;oGdLst["cd2"]=108E5;oGdLst["cd4"]=54E5;oGdLst["cd8"]=27E5;oGdLst["l"]=0;oGdLst["t"]=0;function Cos(angle){return Math.cos(cToRad*angle)}function Sin(angle){return Math.sin(cToRad* angle)}function Tan(angle){return Math.tan(cToRad*angle)}function ATan(x){return cToDeg*Math.atan(x)}function ATan2(y,x){return cToDeg*Math.atan2(y,x)}function CAt2(x,y,z){return x*Math.cos(Math.atan2(z,y))}function SAt2(x,y,z){return x*Math.sin(Math.atan2(z,y))}function CalculateGuideValue(name,formula,x,y,z,gdLst){var xt,yt,zt;xt=gdLst[x];if(xt===undefined)xt=parseInt(x,10);yt=gdLst[y];if(yt===undefined)yt=parseInt(y,10);zt=gdLst[z];if(zt===undefined)zt=parseInt(z,10);switch(formula){case FORMULA_TYPE_MULT_DIV:{gdLst[name]= xt*yt/zt;break}case FORMULA_TYPE_PLUS_MINUS:{gdLst[name]=xt+yt-zt;break}case FORMULA_TYPE_PLUS_DIV:{gdLst[name]=(xt+yt)/zt;break}case FORMULA_TYPE_IF_ELSE:{if(xt>0)gdLst[name]=yt;else gdLst[name]=zt;break}case FORMULA_TYPE_ABS:{gdLst[name]=Math.abs(xt);break}case FORMULA_TYPE_AT2:{gdLst[name]=ATan2(yt,xt);break}case FORMULA_TYPE_CAT2:{gdLst[name]=CAt2(xt,yt,zt);break}case FORMULA_TYPE_COS:{gdLst[name]=xt*Cos(yt);break}case FORMULA_TYPE_MAX:{gdLst[name]=Math.max(xt,yt);break}case FORMULA_TYPE_MOD:{gdLst[name]= Math.sqrt(xt*xt+yt*yt+zt*zt);break}case FORMULA_TYPE_PIN:{if(yt<xt)gdLst[name]=xt;else if(yt>zt)gdLst[name]=zt;else gdLst[name]=yt;break}case FORMULA_TYPE_SAT2:{gdLst[name]=SAt2(xt,yt,zt);break}case FORMULA_TYPE_SIN:{gdLst[name]=xt*Sin(yt);break}case FORMULA_TYPE_SQRT:{gdLst[name]=Math.sqrt(xt);break}case FORMULA_TYPE_TAN:{gdLst[name]=xt*Tan(yt);break}case FORMULA_TYPE_VALUE:{gdLst[name]=xt;break}case FORMULA_TYPE_MIN:{gdLst[name]=Math.min(xt,yt)}}}function CalculateGuideLst(gdLstInfo,gdLst){var info; for(var i=0,n=gdLstInfo.length;i<n;i++){info=gdLstInfo[i];CalculateGuideValue(info.name,info.formula,info.x,info.y,info.z,gdLst)}}function CalculateCnxLst(cnxLstInfo,cnxLst,gdLst){var x_,y_,ang_;for(var i=0,n=cnxLstInfo.length;i<n;i++){ang_=parseInt(cnxLstInfo[i].ang);if(isNaN(ang_))ang_=gdLst[cnxLstInfo[i].ang];x_=gdLst[cnxLstInfo[i].x];if(x_===undefined)x_=parseInt(cnxLstInfo[i].x);y_=gdLst[cnxLstInfo[i].y];if(y_===undefined)y_=parseInt(cnxLstInfo[i].y);if(cnxLst[i]==undefined)cnxLst[i]={};cnxLst[i].ang= ang_;cnxLst[i].x=x_;cnxLst[i].y=y_}}function CalculateAhXYList(ahXYListInfo,ahXYLst,gdLst){var minX,maxX,minY,maxY,posX,posY;for(var i=0,n=ahXYListInfo.length;i<n;i++){minX=parseInt(ahXYListInfo[i].minX);if(isNaN(minX))minX=gdLst[ahXYListInfo[i].minX];maxX=parseInt(ahXYListInfo[i].maxX);if(isNaN(maxX))maxX=gdLst[ahXYListInfo[i].maxX];minY=parseInt(ahXYListInfo[i].minY);if(isNaN(minY))minY=gdLst[ahXYListInfo[i].minY];maxY=parseInt(ahXYListInfo[i].maxY);if(isNaN(maxY))maxY=gdLst[ahXYListInfo[i].maxY]; posX=parseInt(ahXYListInfo[i].posX);if(isNaN(posX))posX=gdLst[ahXYListInfo[i].posX];posY=parseInt(ahXYListInfo[i].posY);if(isNaN(posY))posY=gdLst[ahXYListInfo[i].posY];if(ahXYLst[i]==undefined)ahXYLst[i]={};ahXYLst[i].gdRefX=ahXYListInfo[i].gdRefX;ahXYLst[i].minX=minX;ahXYLst[i].maxX=maxX;ahXYLst[i].gdRefY=ahXYListInfo[i].gdRefY;ahXYLst[i].minY=minY;ahXYLst[i].maxY=maxY;ahXYLst[i].posX=posX;ahXYLst[i].posY=posY}}function CalculateAhPolarList(ahPolarListInfo,ahPolarLst,gdLst){var minR,maxR,minAng, maxAng,posX,posY;for(var i=0,n=ahPolarListInfo.length;i<n;i++){minR=parseInt(ahPolarListInfo[i].minR);if(isNaN(minR))minR=gdLst[ahPolarListInfo[i].minR];maxR=parseInt(ahPolarListInfo[i].maxR);if(isNaN(maxR))maxR=gdLst[ahPolarListInfo[i].maxR];minAng=parseInt(ahPolarListInfo[i].minAng);if(isNaN(minAng))minAng=gdLst[ahPolarListInfo[i].minAng];maxAng=parseInt(ahPolarListInfo[i].maxAng);if(isNaN(maxAng))maxAng=gdLst[ahPolarListInfo[i].maxAng];posX=parseInt(ahPolarListInfo[i].posX);if(isNaN(posX))posX= gdLst[ahPolarListInfo[i].posX];posY=parseInt(ahPolarListInfo[i].posY);if(isNaN(posY))posY=gdLst[ahPolarListInfo[i].posY];if(ahPolarLst[i]==undefined)ahPolarLst[i]={};ahPolarLst[i].gdRefR=ahPolarListInfo[i].gdRefR;ahPolarLst[i].minR=minR;ahPolarLst[i].maxR=maxR;ahPolarLst[i].gdRefAng=ahPolarListInfo[i].gdRefAng;ahPolarLst[i].minAng=minAng;ahPolarLst[i].maxAng=maxAng;ahPolarLst[i].posX=posX;ahPolarLst[i].posY=posY}}function CChangesGeometryAddAdj(Class,Name,OldValue,NewValue,OldAvValue,bReverse){this.Type= AscDFH.historyitem_GeometryAddAdj;this.Name=Name;this.OldValue=OldValue;this.NewValue=NewValue;this.OldAvValue=OldAvValue;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesGeometryAddAdj.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesGeometryAddAdj.prototype.constructor=CChangesGeometryAddAdj;CChangesGeometryAddAdj.prototype.CreateReverseChange=function(){return new CChangesGeometryAddAdj(this.Class,this.Name,this.OldValue,this.NewValue,this.OldAvValue,!this.bReverse)}; CChangesGeometryAddAdj.prototype.AddAdj=function(){this.Class.gdLst[this.Name]=parseInt(this.NewValue);this.Class.avLst[this.Name]=true;if(this.Class.parent&&this.Class.parent.handleUpdateGeometry)this.Class.parent.handleUpdateGeometry()};CChangesGeometryAddAdj.prototype.RemoveAdj=function(){var _OldValue=parseInt(this.OldValue);if(!isNaN(_OldValue)){this.Class.gdLst[this.Name]=_OldValue;if(this.Class.parent&&this.Class.parent.handleUpdateGeometry)this.Class.parent.handleUpdateGeometry()}else delete this.Class.gdLst[this.Name]; this.Class.avLst[this.Name]=this.OldAvValue};CChangesGeometryAddAdj.prototype.Undo=function(){if(this.bReverse)this.AddAdj();else this.RemoveAdj()};CChangesGeometryAddAdj.prototype.Redo=function(){if(this.bReverse)this.RemoveAdj();else this.AddAdj()};CChangesGeometryAddAdj.prototype.WriteToBinary=function(Writer){Writer.WriteString2(this.Name);Writer.WriteString2(this.NewValue);AscFormat.writeString(Writer,this.OldValue);AscFormat.writeBool(Writer,this.OldAvValue);Writer.WriteBool(!!this.bReverse)}; CChangesGeometryAddAdj.prototype.ReadFromBinary=function(Reader){this.Name=Reader.GetString2();this.NewValue=Reader.GetString2();this.OldValue=AscFormat.readString(Reader);this.OldAvValue=AscFormat.readBool(Reader);this.bReverse=Reader.GetBool()};AscDFH.changesFactory[AscDFH.historyitem_GeometryAddAdj]=CChangesGeometryAddAdj;function CChangesGeometryAddGuide(Class,Name,formula,x,y,z,bReverse){this.Type=AscDFH.historyitem_GeometryAddGuide;this.Name=Name;this.formula=formula;this.x=x;this.y=y;this.z= z;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesGeometryAddGuide.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesGeometryAddGuide.prototype.constructor=CChangesGeometryAddGuide;CChangesGeometryAddGuide.prototype.RemoveGuide=function(){var aGdLstInfo=this.Class.gdLstInfo;for(var i=aGdLstInfo.length-1;i>-1;--i){var oCurGd=aGdLstInfo[i];if(oCurGd.name==this.Name&&oCurGd.formula==this.formula&&oCurGd.x==this.x&&oCurGd.y==this.y&&oCurGd.z==this.z)aGdLstInfo.splice(i, 1)}};CChangesGeometryAddGuide.prototype.AddGuide=function(){this.Class.gdLstInfo.push({name:this.Name,formula:this.formula,x:this.x,y:this.y,z:this.z})};CChangesGeometryAddGuide.prototype.Undo=function(){if(this.bReverse)this.AddGuide();else this.RemoveGuide()};CChangesGeometryAddGuide.prototype.Redo=function(){if(this.bReverse)this.RemoveGuide();else this.AddGuide()};CChangesGeometryAddGuide.prototype.WriteToBinary=function(Writer){Writer.WriteString2(this.Name);Writer.WriteLong(this.formula);AscFormat.writeString(Writer, this.x);AscFormat.writeString(Writer,this.y);AscFormat.writeString(Writer,this.z);Writer.WriteBool(!!this.bReverse)};CChangesGeometryAddGuide.prototype.ReadFromBinary=function(Reader){this.Name=Reader.GetString2();this.formula=Reader.GetLong();this.x=AscFormat.readString(Reader);this.y=AscFormat.readString(Reader);this.z=AscFormat.readString(Reader);this.bReverse=Reader.GetBool()};CChangesGeometryAddGuide.prototype.CreateReverseChange=function(){return new CChangesGeometryAddGuide(this.Class,this.Name, this.formula,this.x,this.y,this.z,!this.bReverse)};AscDFH.changesFactory[AscDFH.historyitem_GeometryAddGuide]=CChangesGeometryAddGuide;function CChangesGeometryAddCnx(Class,ang,x,y,bReverse){this.Type=AscDFH.historyitem_GeometryAddCnx;this.ang=ang;this.x=x;this.y=y;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesGeometryAddCnx.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesGeometryAddCnx.prototype.constructor=CChangesGeometryAddCnx;CChangesGeometryAddCnx.prototype.RemoveCnx= function(){var aCnxLstInfo=this.Class.cnxLstInfo;for(var i=aCnxLstInfo.length-1;i>-1;--i){var oCurCnx=aCnxLstInfo[i];if(oCurCnx.ang==this.ang&&oCurCnx.x==this.x&&oCurCnx.y==this.y)aCnxLstInfo.splice(i,1)}};CChangesGeometryAddCnx.prototype.AddCnx=function(){this.Class.cnxLstInfo.push({ang:this.ang,x:this.x,y:this.y})};CChangesGeometryAddCnx.prototype.Undo=function(){if(this.bReverse)this.AddCnx();else this.RemoveCnx()};CChangesGeometryAddCnx.prototype.Redo=function(){if(this.bReverse)this.RemoveCnx(); else this.AddCnx()};CChangesGeometryAddCnx.prototype.WriteToBinary=function(Writer){AscFormat.writeString(Writer,this.ang);AscFormat.writeString(Writer,this.x);AscFormat.writeString(Writer,this.y);Writer.WriteBool(!!this.bReverse)};CChangesGeometryAddCnx.prototype.ReadFromBinary=function(Reader){this.ang=AscFormat.readString(Reader);this.x=AscFormat.readString(Reader);this.y=AscFormat.readString(Reader);this.bReverse=Reader.GetBool()};CChangesGeometryAddCnx.prototype.CreateReverseChange=function(){return new CChangesGeometryAddCnx(this.Class, this.ang,this.x,this.y,!this.bReverse)};AscDFH.changesFactory[AscDFH.historyitem_GeometryAddCnx]=CChangesGeometryAddCnx;function CChangesGeometryAddHandleXY(Class,gdRefX,minX,maxX,gdRefY,minY,maxY,posX,posY,bReverse){this.Type=AscDFH.historyitem_GeometryAddHandleXY;this.gdRefX=gdRefX;this.minX=minX;this.maxX=maxX;this.gdRefY=gdRefY;this.minY=minY;this.maxY=maxY;this.posX=posX;this.posY=posY;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesGeometryAddHandleXY.prototype=Object.create(AscDFH.CChangesBase.prototype); CChangesGeometryAddHandleXY.prototype.constructor=CChangesGeometryAddHandleXY;CChangesGeometryAddHandleXY.prototype.RemoveHandleXY=function(){var ahXYLstInfo=this.Class.ahXYLstInfo;for(var i=ahXYLstInfo.length-1;i>-1;--i){var oCurXY=ahXYLstInfo[i];if(oCurXY.gdRefX==this.gdRefX&&oCurXY.minX==this.minX&&oCurXY.maxX==this.maxX&&oCurXY.gdRefY==this.gdRefY&&oCurXY.minY==this.minY&&oCurXY.maxY==this.maxY&&oCurXY.posX==this.posX&&oCurXY.posY==this.posY)ahXYLstInfo.splice(i,1)}};CChangesGeometryAddHandleXY.prototype.AddHandleXY= function(){this.Class.ahXYLstInfo.push({gdRefX:this.gdRefX,minX:this.minX,maxX:this.maxX,gdRefY:this.gdRefY,minY:this.minY,maxY:this.maxY,posX:this.posX,posY:this.posY})};CChangesGeometryAddHandleXY.prototype.Undo=function(){if(this.bReverse)this.AddHandleXY();else this.RemoveHandleXY()};CChangesGeometryAddHandleXY.prototype.Redo=function(){if(this.bReverse)this.RemoveHandleXY();else this.AddHandleXY()};CChangesGeometryAddHandleXY.prototype.WriteToBinary=function(Writer){AscFormat.writeString(Writer, this.gdRefX);AscFormat.writeString(Writer,this.minX);AscFormat.writeString(Writer,this.maxX);AscFormat.writeString(Writer,this.gdRefY);AscFormat.writeString(Writer,this.minY);AscFormat.writeString(Writer,this.maxY);AscFormat.writeString(Writer,this.posX);AscFormat.writeString(Writer,this.posY);Writer.WriteBool(!!this.bReverse)};CChangesGeometryAddHandleXY.prototype.ReadFromBinary=function(Reader){this.gdRefX=AscFormat.readString(Reader);this.minX=AscFormat.readString(Reader);this.maxX=AscFormat.readString(Reader); this.gdRefY=AscFormat.readString(Reader);this.minY=AscFormat.readString(Reader);this.maxY=AscFormat.readString(Reader);this.posX=AscFormat.readString(Reader);this.posY=AscFormat.readString(Reader);this.bReverse=Reader.GetBool()};CChangesGeometryAddHandleXY.prototype.CreateReverseChange=function(){return new CChangesGeometryAddHandleXY(this.Class,this.gdRefX,this.minX,this.maxX,this.gdRefY,this.minY,this.maxY,this.posX,this.posY,!this.bReverse)};AscDFH.changesFactory[AscDFH.historyitem_GeometryAddHandleXY]= CChangesGeometryAddHandleXY;function CChangesGeometryAddHandlePolar(Class,gdRefR,minR,maxR,gdRefAng,minAng,maxAng,posX,posY,bReverse){this.Type=AscDFH.historyitem_GeometryAddHandlePolar;this.gdRefAng=gdRefAng;this.minAng=minAng;this.maxAng=maxAng;this.gdRefR=gdRefR;this.minR=minR;this.maxR=maxR;this.posX=posX;this.posY=posY;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesGeometryAddHandlePolar.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesGeometryAddHandlePolar.prototype.constructor= CChangesGeometryAddHandlePolar;CChangesGeometryAddHandlePolar.prototype.RemoveHandlePolar=function(){var ahPolarLstInfo=this.Class.ahPolarLstInfo;for(var i=ahPolarLstInfo.length-1;i>-1;--i){var oCurPolar=ahPolarLstInfo[i];if(oCurPolar.gdRefR==this.gdRefR&&oCurPolar.minR==this.minR&&oCurPolar.maxR==this.maxR&&oCurPolar.gdRefAng==this.gdRefAng&&oCurPolar.minAng==this.minAng&&oCurPolar.maxAng==this.maxAng&&oCurPolar.posX==this.posX&&oCurPolar.posY==this.posY)ahPolarLstInfo.splice(i,1)}};CChangesGeometryAddHandlePolar.prototype.AddHandlePolar= function(){this.Class.ahPolarLstInfo.push({gdRefR:this.gdRefR,minR:this.minR,maxR:this.maxR,gdRefAng:this.gdRefAng,minAng:this.minAng,maxAng:this.maxAng,posX:this.posX,posY:this.posY})};CChangesGeometryAddHandlePolar.prototype.Undo=function(){if(this.bReverse)this.AddHandlePolar();else this.RemoveHandlePolar()};CChangesGeometryAddHandlePolar.prototype.Redo=function(){if(this.bReverse)this.RemoveHandlePolar();else this.AddHandlePolar()};CChangesGeometryAddHandlePolar.prototype.WriteToBinary=function(Writer){AscFormat.writeString(Writer, this.gdRefR);AscFormat.writeString(Writer,this.minR);AscFormat.writeString(Writer,this.maxR);AscFormat.writeString(Writer,this.gdRefAng);AscFormat.writeString(Writer,this.minAng);AscFormat.writeString(Writer,this.maxAng);AscFormat.writeString(Writer,this.posX);AscFormat.writeString(Writer,this.posY);Writer.WriteBool(!!this.bReverse)};CChangesGeometryAddHandlePolar.prototype.ReadFromBinary=function(Reader){this.gdRefR=AscFormat.readString(Reader);this.minR=AscFormat.readString(Reader);this.maxR=AscFormat.readString(Reader); this.gdRefAng=AscFormat.readString(Reader);this.minAng=AscFormat.readString(Reader);this.maxAng=AscFormat.readString(Reader);this.posX=AscFormat.readString(Reader);this.posY=AscFormat.readString(Reader);this.bReverse=Reader.GetBool()};CChangesGeometryAddHandlePolar.prototype.CreateReverseChange=function(){return new CChangesGeometryAddHandlePolar(this.Class,this.gdRefR,this.minR,this.maxR,this.gdRefAng,this.minAng,this.maxAng,this.posX,this.posY,!this.bReverse)};AscDFH.changesFactory[AscDFH.historyitem_GeometryAddHandlePolar]= CChangesGeometryAddHandlePolar;function CChangesGeometryAddRect(Class,l,t,r,b,bReverse){this.Type=AscDFH.historyitem_GeometryAddRect;this.l=l;this.t=t;this.r=r;this.b=b;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesGeometryAddRect.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesGeometryAddRect.prototype.constructor=CChangesGeometryAddRect;CChangesGeometryAddRect.prototype.Undo=function(){if(this.bReverse)this.Class.rectS={l:this.l,t:this.t,r:this.r,b:this.b};else this.Class.rectS= null};CChangesGeometryAddRect.prototype.Redo=function(){if(this.bReverse)this.Class.rectS=null;else this.Class.rectS={l:this.l,t:this.t,r:this.r,b:this.b}};CChangesGeometryAddRect.prototype.WriteToBinary=function(Writer){AscFormat.writeString(Writer,this.l);AscFormat.writeString(Writer,this.t);AscFormat.writeString(Writer,this.r);AscFormat.writeString(Writer,this.b);Writer.WriteBool(!!this.bReverse)};CChangesGeometryAddRect.prototype.ReadFromBinary=function(Reader){this.l=AscFormat.readString(Reader); this.t=AscFormat.readString(Reader);this.r=AscFormat.readString(Reader);this.b=AscFormat.readString(Reader);this.bReverse=Reader.GetBool()};AscDFH.changesFactory[AscDFH.historyitem_GeometryAddRect]=CChangesGeometryAddRect;AscDFH.changesFactory[AscDFH.historyitem_GeometrySetPreset]=AscDFH.CChangesDrawingsString;AscDFH.drawingsChangesMap[AscDFH.historyitem_GeometrySetPreset]=function(oClass,value){oClass.preset=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_GeometrySetParent]=function(oClass,value){oClass.parent= value};AscDFH.changesFactory[AscDFH.historyitem_GeometryAddPath]=AscDFH.CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_GeometrySetParent]=AscDFH.CChangesDrawingsObject;AscDFH.drawingContentChanges[AscDFH.historyitem_GeometryAddPath]=function(oClass){return oClass.pathLst};function Geometry(){this.gdLstInfo=[];this.gdLst={};this.avLst={};this.cnxLstInfo=[];this.cnxLst=[];this.ahXYLstInfo=[];this.ahXYLst=[];this.ahPolarLstInfo=[];this.ahPolarLst=[];this.pathLst=[];this.preset=null; this.rectS=null;this.parent=null;this.bDrawSmart=false;this.Id=AscCommon.g_oIdCounter.Get_NewId();AscCommon.g_oTableId.Add(this,this.Id)}Geometry.prototype={Get_Id:function(){return this.Id},getObjectType:function(){return AscDFH.historyitem_type_Geometry},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},Refresh_RecalcData:function(data){if(this.parent&&this.parent.handleUpdateGeometry)this.parent.handleUpdateGeometry()}, isEmpty:function(){if(this.pathLst.length===0)return true;if(this.pathLst.length===1)return this.pathLst[0].ArrPathCommandInfo.length===0;return false},createDuplicate:function(){var g=new Geometry;for(var i=0;i<this.gdLstInfo.length;++i){var gd=this.gdLstInfo[i];g.AddGuide(gd.name,gd.formula,gd.x,gd.y,gd.z)}for(var key in this.avLst)g.AddAdj(key,15,this.gdLst[key]+"",undefined,undefined);g.setPreset(this.preset);for(i=0;i<this.cnxLstInfo.length;++i){var cn=this.cnxLstInfo[i];g.AddCnx(cn.ang,cn.x, cn.y)}for(i=0;i<this.ahXYLstInfo.length;++i){var ah=this.ahXYLstInfo[i];g.AddHandleXY(ah.gdRefX,ah.minX,ah.maxX,ah.gdRefY,ah.minY,ah.maxY,ah.posX,ah.posY)}for(i=0;i<this.ahPolarLstInfo.length;++i){var ah=this.ahPolarLstInfo[i];g.AddHandlePolar(ah.gdRefAng,ah.minAng,ah.maxAng,ah.gdRefR,ah.minR,ah.maxR,ah.posX,ah.posY)}for(i=0;i<this.pathLst.length;++i)g.AddPath(this.pathLst[i].createDuplicate());if(this.rectS)g.AddRect(this.rectS.l,this.rectS.t,this.rectS.r,this.rectS.b);return g},setParent:function(pr){History.CanAddChanges()&& History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GeometrySetParent,this.parent,pr));this.parent=pr},setPreset:function(preset){History.CanAddChanges()&&History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_GeometrySetPreset,this.preset,preset));this.preset=preset},AddAdj:function(name,formula,x){var OldValue=null;if(this.gdLst[name]!==null&&this.gdLst[name]!==undefined)OldValue=this.gdLst[name]+"";History.CanAddChanges()&&History.Add(new CChangesGeometryAddAdj(this, name,OldValue,x,this.avLst[name]));var dVal=parseInt(x);if(isNaN(dVal))if(AscFormat.isRealNumber(oGdLst[x]))dVal=oGdLst[x];else dVal=0;this.gdLst[name]=dVal;this.avLst[name]=true},setAdjValue:function(name,val){this.AddAdj(name,15,val+"");if(this.parent&&this.parent.handleUpdateGeometry)this.parent.handleUpdateGeometry()},CheckCorrect:function(){if(!this.parent)return false;if(this.pathLst.length===0)return false;return true},AddGuide:function(name,formula,x,y,z){History.CanAddChanges()&&History.Add(new CChangesGeometryAddGuide(this, name,formula,x,y,z));this.gdLstInfo.push({name:name,formula:formula,x:x,y:y,z:z})},AddCnx:function(ang,x,y){History.CanAddChanges()&&History.Add(new CChangesGeometryAddCnx(this,ang,x,y));this.cnxLstInfo.push({ang:ang,x:x,y:y})},AddHandleXY:function(gdRefX,minX,maxX,gdRefY,minY,maxY,posX,posY){History.CanAddChanges()&&History.Add(new CChangesGeometryAddHandleXY(this,gdRefX,minX,maxX,gdRefY,minY,maxY,posX,posY));this.ahXYLstInfo.push({gdRefX:gdRefX,minX:minX,maxX:maxX,gdRefY:gdRefY,minY:minY,maxY:maxY, posX:posX,posY:posY})},AddHandlePolar:function(gdRefAng,minAng,maxAng,gdRefR,minR,maxR,posX,posY){History.CanAddChanges()&&History.Add(new CChangesGeometryAddHandlePolar(this,gdRefR,minR,maxR,gdRefAng,minAng,maxAng,posX,posY));this.ahPolarLstInfo.push({gdRefAng:gdRefAng,minAng:minAng,maxAng:maxAng,gdRefR:gdRefR,minR:minR,maxR:maxR,posX:posX,posY:posY})},AddPath:function(pr){History.CanAddChanges()&&History.Add(new AscDFH.CChangesDrawingsContent(this,AscDFH.historyitem_GeometryAddPath,this.pathLst.length, [pr],true));this.pathLst.push(pr)},AddPathCommand:function(command,x1,y1,x2,y2,x3,y3){switch(command){case 0:{var path=new AscFormat.Path;path.setExtrusionOk(x1||false);path.setFill(y1||"norm");path.setStroke(x2!=undefined?x2:true);path.setPathW(y2);path.setPathH(x3);this.AddPath(path);break}case 1:{this.pathLst[this.pathLst.length-1].moveTo(x1,y1);break}case 2:{this.pathLst[this.pathLst.length-1].lnTo(x1,y1);break}case 3:{this.pathLst[this.pathLst.length-1].arcTo(x1,y1,x2,y2);break}case 4:{this.pathLst[this.pathLst.length- 1].quadBezTo(x1,y1,x2,y2);break}case 5:{this.pathLst[this.pathLst.length-1].cubicBezTo(x1,y1,x2,y2,x3,y3);break}case 6:{this.pathLst[this.pathLst.length-1].close();break}}},AddRect:function(l,t,r,b){History.CanAddChanges()&&History.Add(new CChangesGeometryAddRect(this,l,t,r,b));this.rectS={};this.rectS.l=l;this.rectS.t=t;this.rectS.r=r;this.rectS.b=b},findConnector:function(x,y,distanse){var dx,dy;for(var i=0;i<this.cnxLst.length;i++){dx=x-this.cnxLst[i].x;dy=y-this.cnxLst[i].y;if(Math.sqrt(dx*dx+ dy*dy)<distanse)return{idx:i,ang:this.cnxLst[i].ang,x:this.cnxLst[i].x,y:this.cnxLst[i].y}}return null},drawConnectors:function(overlay,transform){var dOldAlpha;var oGraphics=overlay.Graphics?overlay.Graphics:overlay;if(AscFormat.isRealNumber(oGraphics.globalAlpha)&&oGraphics.put_GlobalAlpha){dOldAlpha=oGraphics.globalAlpha;oGraphics.put_GlobalAlpha(false,1)}if(overlay.DrawEditWrapPointsPolygon)for(var i=0;i<this.cnxLst.length;i++)overlay.DrawEditWrapPointsPolygon([{x:this.cnxLst[i].x,y:this.cnxLst[i].y}], transform);if(AscFormat.isRealNumber(dOldAlpha)&&oGraphics.put_GlobalAlpha)oGraphics.put_GlobalAlpha(true,dOldAlpha)},Recalculate:function(w,h,bResetPathsInfo){this.gdLst["_3cd4"]=162E5;this.gdLst["_3cd8"]=81E5;this.gdLst["_5cd8"]=135E5;this.gdLst["_7cd8"]=189E5;this.gdLst["cd2"]=108E5;this.gdLst["cd4"]=54E5;this.gdLst["cd8"]=27E5;this.gdLst["l"]=0;this.gdLst["t"]=0;this.gdLst["h"]=h;this.gdLst["b"]=h;this.gdLst["hd2"]=h/2;this.gdLst["hd3"]=h/3;this.gdLst["hd4"]=h/4;this.gdLst["hd5"]=h/5;this.gdLst["hd6"]= h/6;this.gdLst["hd8"]=h/8;this.gdLst["hd10"]=h/10;this.gdLst["hd12"]=h/12;this.gdLst["hd32"]=h/32;this.gdLst["vc"]=h/2;this.gdLst["w"]=w;this.gdLst["r"]=w;this.gdLst["wd2"]=w/2;this.gdLst["wd3"]=w/3;this.gdLst["wd4"]=w/4;this.gdLst["wd5"]=w/5;this.gdLst["wd6"]=w/6;this.gdLst["wd8"]=w/8;this.gdLst["wd10"]=w/10;this.gdLst["wd12"]=w/12;this.gdLst["wd32"]=w/32;this.gdLst["hc"]=w/2;this.gdLst["ls"]=Math.max(w,h);this.gdLst["ss"]=Math.min(w,h);this.gdLst["ssd2"]=this.gdLst["ss"]/2;this.gdLst["ssd4"]=this.gdLst["ss"]/ 4;this.gdLst["ssd6"]=this.gdLst["ss"]/6;this.gdLst["ssd8"]=this.gdLst["ss"]/8;this.gdLst["ssd16"]=this.gdLst["ss"]/16;this.gdLst["ssd32"]=this.gdLst["ss"]/32;CalculateGuideLst(this.gdLstInfo,this.gdLst);CalculateCnxLst(this.cnxLstInfo,this.cnxLst,this.gdLst);CalculateAhXYList(this.ahXYLstInfo,this.ahXYLst,this.gdLst);CalculateAhPolarList(this.ahPolarLstInfo,this.ahPolarLst,this.gdLst);for(var i=0,n=this.pathLst.length;i<n;i++)this.pathLst[i].recalculate(this.gdLst,bResetPathsInfo);this.rect={};if(this.rectS){this.rect.l= this.gdLst[this.rectS.l];if(this.rect.l===undefined)this.rect.l=parseInt(this.rectS.l);this.rect.t=this.gdLst[this.rectS.t];if(this.rect.t===undefined)this.rect.t=parseInt(this.rectS.t);this.rect.r=this.gdLst[this.rectS.r];if(this.rect.r===undefined)this.rect.r=parseInt(this.rectS.r);this.rect.b=this.gdLst[this.rectS.b];if(this.rect.b===undefined)this.rect.b=parseInt(this.rectS.b)}else{this.rect.l=this.gdLst["l"];this.rect.t=this.gdLst["t"];this.rect.r=this.gdLst["r"];this.rect.b=this.gdLst["b"]}if(bResetPathsInfo){delete this.gdLst; delete this.gdLstInfo;delete this.rect;delete this.rectS;delete this.gdLstInfo;delete this.cnxLstInfo;delete this.ahXYLstInfo;delete this.ahPolarLstInfo}},getMaxPathPolygonLength:function(){var aByPaths=this.getArrayPolygonsByPaths(AscFormat.PATH_DIV_EPSILON);var dLength=0;for(var i=0;i<aByPaths.length;++i){var oWarpPathPolygon=new AscFormat.PolygonWrapper(aByPaths[i]);if(dLength<oWarpPathPolygon.dLen)dLength=oWarpPathPolygon.dLen}return dLength},getMinPathPolygonLength:function(){var aByPaths=this.getArrayPolygonsByPaths(AscFormat.PATH_DIV_EPSILON); var dLength=1E7;for(var i=0;i<aByPaths.length;++i){var oWarpPathPolygon=new AscFormat.PolygonWrapper(aByPaths[i]);if(dLength>oWarpPathPolygon.dLen)dLength=oWarpPathPolygon.dLen}return dLength},draw:function(shape_drawer){if(shape_drawer.Graphics&&shape_drawer.Graphics.bDrawSmart||this.bDrawSmart){this.drawSmart(shape_drawer);return}for(var i=0,n=this.pathLst.length;i<n;++i)this.pathLst[i].draw(shape_drawer)},drawSmart:function(shape_drawer){for(var i=0,n=this.pathLst.length;i<n;++i)this.pathLst[i].drawSmart(shape_drawer)}, check_bounds:function(checker){for(var i=0,n=this.pathLst.length;i<n;++i)this.pathLst[i].check_bounds(checker)},drawAdjustments:function(drawingDocument,transform,bTextWarp){var _adjustments=this.ahXYLst;var _adj_count=_adjustments.length;var _adj_index;for(_adj_index=0;_adj_index<_adj_count;++_adj_index)drawingDocument.DrawAdjustment(transform,_adjustments[_adj_index].posX,_adjustments[_adj_index].posY,bTextWarp);_adjustments=this.ahPolarLst;_adj_count=_adjustments.length;for(_adj_index=0;_adj_index< _adj_count;++_adj_index)drawingDocument.DrawAdjustment(transform,_adjustments[_adj_index].posX,_adjustments[_adj_index].posY,bTextWarp)},canFill:function(){if(this.preset==="line")return false;for(var i=0;i<this.pathLst.length;++i)if(this.pathLst[i].fill!=="none")return true;return false},hitInInnerArea:function(canvasContext,x,y){var _path_list=this.pathLst;var _path_count=_path_list.length;var _path_index;for(_path_index=0;_path_index<_path_count;++_path_index)if(_path_list[_path_index].hitInInnerArea(canvasContext, x,y)===true)return true;return false},hitInPath:function(canvasContext,x,y){var _path_list=this.pathLst;var _path_count=_path_list.length;var _path_index;for(_path_index=0;_path_index<_path_count;++_path_index)if(_path_list[_path_index].hitInPath(canvasContext,x,y)===true)return true;return false},hitToAdj:function(x,y,distanse){var dx,dy;for(var i=0;i<this.ahXYLst.length;i++){dx=x-this.ahXYLst[i].posX;dy=y-this.ahXYLst[i].posY;if(Math.sqrt(dx*dx+dy*dy)<distanse)return{hit:true,adjPolarFlag:false, adjNum:i}}for(i=0;i<this.ahPolarLst.length;i++){dx=x-this.ahPolarLst[i].posX;dy=y-this.ahPolarLst[i].posY;if(Math.sqrt(dx*dx+dy*dy)<distanse)return{hit:true,adjPolarFlag:true,adjNum:i}}return{hit:false,adjPolarFlag:null,adjNum:null}},getArrayPolygonsByPaths:function(epsilon){return GetArrayPolygonsByPaths(epsilon,this.pathLst)},getArrayPolygons:function(epsilon){var used_epsilon;if(typeof epsilon!=="number"||isNaN(epsilon))used_epsilon=AscFormat.APPROXIMATE_EPSILON;else used_epsilon=epsilon;var arr_polygons= [];var cur_polygon=[];for(var path_index=0;path_index<this.pathLst.length;++path_index){var arr_cur_path_commands=this.pathLst[path_index].ArrPathCommand;var last_command=null,last_point_x=null,last_point_y=null;var first_point_x=null,first_point_y=null;var bezier_polygon=null;for(var command_index=0;command_index<arr_cur_path_commands.length;++command_index){var cur_command=arr_cur_path_commands[command_index];switch(cur_command.id){case AscFormat.moveTo:{if(last_command===null||last_command.id=== AscFormat.close){cur_polygon.push({x:cur_command.X,y:cur_command.Y});last_command=cur_command;last_point_x=cur_command.X;last_point_y=cur_command.Y;first_point_x=cur_command.X;first_point_y=cur_command.Y}break}case AscFormat.lineTo:{cur_polygon.push({x:cur_command.X,y:cur_command.Y});last_command=cur_command;last_point_x=cur_command.X;last_point_y=cur_command.Y;break}case AscFormat.bezier3:{bezier_polygon=AscFormat.partition_bezier3(last_point_x,last_point_y,cur_command.X0,cur_command.Y0,cur_command.X1, cur_command.Y1,used_epsilon);for(var point_index=1;point_index<bezier_polygon.length;++point_index)cur_polygon.push(bezier_polygon[point_index]);last_command=cur_command;last_point_x=cur_command.X1;last_point_y=cur_command.Y1;break}case AscFormat.bezier4:{bezier_polygon=AscFormat.partition_bezier4(last_point_x,last_point_y,cur_command.X0,cur_command.Y0,cur_command.X1,cur_command.Y1,cur_command.X2,cur_command.Y2,used_epsilon);for(point_index=1;point_index<bezier_polygon.length;++point_index)cur_polygon.push(bezier_polygon[point_index]); last_command=cur_command;last_point_x=cur_command.X2;last_point_y=cur_command.Y2;break}case AscFormat.arcTo:{var path_accumulator=new PathAccumulator;ArcToCurvers(path_accumulator,cur_command.stX,cur_command.stY,cur_command.wR,cur_command.hR,cur_command.stAng,cur_command.swAng);var arc_to_path_commands=path_accumulator.pathCommand;for(var arc_to_path_index=0;arc_to_path_index<arc_to_path_commands.length;++arc_to_path_index){var cur_arc_to_command=arc_to_path_commands[arc_to_path_index];switch(cur_arc_to_command.id){case AscFormat.moveTo:{cur_polygon.push({x:cur_arc_to_command.X, y:cur_arc_to_command.Y});last_command=cur_arc_to_command;last_point_x=cur_arc_to_command.X;last_point_y=cur_arc_to_command.Y;break}case AscFormat.bezier4:{bezier_polygon=AscFormat.partition_bezier4(last_point_x,last_point_y,cur_arc_to_command.X0,cur_arc_to_command.Y0,cur_arc_to_command.X1,cur_arc_to_command.Y1,cur_arc_to_command.X2,cur_arc_to_command.Y2,used_epsilon);for(point_index=0;point_index<bezier_polygon.length;++point_index)cur_polygon.push(bezier_polygon[point_index]);last_command=cur_arc_to_command; last_point_x=cur_arc_to_command.X2;last_point_y=cur_arc_to_command.Y2;break}}}break}case AscFormat.close:{if(last_command.id!==AscFormat.moveTo){if(cur_polygon.length>=2){if(first_point_x!==null&&first_point_y!==null)cur_polygon.push({x:first_point_x,y:first_point_y});arr_polygons.push(cur_polygon)}cur_polygon=[];last_command=cur_command}break}}}if(cur_polygon.length>=2)arr_polygons.push(cur_polygon);if(cur_polygon.length===1){cur_polygon.push({x:cur_polygon[0].x,y:cur_polygon[0].y});arr_polygons.push(cur_polygon)}}return arr_polygons}, getBounds:function(){},getNewWHByTextRect:function(dTextWidth,dTextHeight,dGeometryWidth,dGeometryHeight){var dDelta=0;var dWi=dTextWidth,dHi=dTextHeight,dWNext,dHNext;var oGeometry=AscFormat.ExecuteNoHistory(function(){return this.createDuplicate()},this,[]);var iter_Count=0;if(!AscFormat.isRealNumber(dGeometryWidth)&&!AscFormat.isRealNumber(dGeometryHeight)){do{oGeometry.Recalculate(dWi,dHi);dWNext=dTextWidth-(oGeometry.rect.r-oGeometry.rect.l)+dWi;dHNext=dTextHeight-(oGeometry.rect.b-oGeometry.rect.t)+ dHi;dDelta=Math.max(Math.abs(dWNext-dWi),Math.abs(dHNext-dHi));dWi=dWNext;dHi=dHNext;++iter_Count}while(dDelta>EPSILON_TEXT_AUTOFIT&&iter_Count<MAX_ITER_COUNT);return{W:dWi,H:dHi,bError:dDelta>EPSILON_TEXT_AUTOFIT}}else if(AscFormat.isRealNumber(dGeometryWidth)){do{oGeometry.Recalculate(dGeometryWidth,dHi);dHNext=dTextHeight-(oGeometry.rect.b-oGeometry.rect.t)+dHi;dDelta=Math.abs(dHNext-dHi);dHi=dHNext;++iter_Count}while(dDelta>EPSILON_TEXT_AUTOFIT&&iter_Count<MAX_ITER_COUNT);return{W:dGeometryWidth, H:dHi,bError:dDelta>EPSILON_TEXT_AUTOFIT}}else{do{oGeometry.Recalculate(dWi,dGeometryHeight);dWNext=dTextWidth-(oGeometry.rect.r-oGeometry.rect.l)+dWi;dDelta=Math.abs(dWNext-dWi);dWi=dWNext;++iter_Count}while(dDelta>EPSILON_TEXT_AUTOFIT&&iter_Count<MAX_ITER_COUNT);return{W:dWi,H:dGeometryHeight,bError:dDelta>EPSILON_TEXT_AUTOFIT}}},checkBetweenPolygons:function(oBoundsController,oPolygonWrapper1,oPolygonWrapper2){var aPathLst=this.pathLst;for(var i=0;i<aPathLst.length;++i)aPathLst[i].checkBetweenPolygons(oBoundsController, oPolygonWrapper1,oPolygonWrapper2)},checkByPolygon:function(oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds){var aPathLst=this.pathLst;for(var i=0;i<aPathLst.length;++i)aPathLst[i].checkByPolygon(oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds)},transform:function(oTransform,dKoeff){var aPathLst=this.pathLst;for(var i=0;i<aPathLst.length;++i)aPathLst[i].transform(oTransform,dKoeff)}};function PathAccumulator(){this.pathCommand=[]}PathAccumulator.prototype={_m:function(x,y){this.pathCommand.push({id:AscFormat.moveTo, X:x,Y:y})},_c:function(x0,y0,x1,y1,x2,y2){this.pathCommand.push({id:AscFormat.bezier4,X0:x0,Y0:y0,X1:x1,Y1:y1,X2:x2,Y2:y2})}};function GraphEdge(point1,point2){if(point1.y<=point2.y){this.point1=point1;this.point2=point2}else{this.point1=point2;this.point2=point1}this.getIntersectionPointX=function(y){var ret=[];if(this.point2.y<y||this.point1.y>y)return ret;else if(this.point1.y===this.point2.y)if(this.point1.x<=this.point2.x){ret.push(this.point1.x);ret.push(this.point2.x);return ret}else{ret.push(this.point2.x); ret.push(this.point1.x);return ret}else if(!(this.point1.x===this.point2.x)){var ret_x=this.point1.x+(y-this.point1.y)/(this.point2.y-this.point1.y)*(this.point2.x-this.point1.x);ret.push(ret_x);return ret}else{ret.push(this.point1.x);return ret}}}function GetArrayPolygonsByPaths(dEpsilon,aPathLst){var geom=new Geometry;var aByPaths=[];for(var i=0;i<aPathLst.length;++i){geom.pathLst.length=0;geom.pathLst.push(aPathLst[i]);var a=geom.getArrayPolygons(dEpsilon);aByPaths[i]=[];for(var t=0;t<a.length;++t)aByPaths[i]= aByPaths[i].concat(a[t])}return aByPaths}function ComparisonEdgeByTopPoint(graphEdge1,graphEdge2){return Math.min(graphEdge1.point1.y,graphEdge1.point2.y)-Math.min(graphEdge2.point1.y,graphEdge2.point2.y)}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].Geometry=Geometry;window["AscFormat"].GraphEdge=GraphEdge;window["AscFormat"].PathAccumulator=PathAccumulator;window["AscFormat"].EPSILON_TEXT_AUTOFIT=EPSILON_TEXT_AUTOFIT;window["AscFormat"].MAX_ITER_COUNT=MAX_ITER_COUNT;window["AscFormat"].APPROXIMATE_EPSILON= 1;window["AscFormat"].APPROXIMATE_EPSILON2=3;window["AscFormat"].APPROXIMATE_EPSILON3=5;window["AscFormat"].cToRad=cToRad;window["AscFormat"].cToDeg=cToDeg})(window);"use strict";(function(window,undefined){var recalcSlideInterval=30;var CreateAscColor=AscCommon.CreateAscColor;var g_oIdCounter=AscCommon.g_oIdCounter;var g_oTableId=AscCommon.g_oTableId;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var c_oAscColor=Asc.c_oAscColor;var c_oAscFill=Asc.c_oAscFill;var asc_CShapeFill= Asc.asc_CShapeFill;var c_oAscFillGradType=Asc.c_oAscFillGradType;var c_oAscFillBlipType=Asc.c_oAscFillBlipType;var c_oAscStrokeType=Asc.c_oAscStrokeType;var asc_CShapeProperty=Asc.asc_CShapeProperty;function CT_Hyperlink(){this.snd=null;this.id=null;this.invalidUrl=null;this.action=null;this.tgtFrame=null;this.tooltip=null;this.history=null;this.highlightClick=null;this.endSnd=null}CT_Hyperlink.prototype.Write_ToBinary=function(w){var nStartPos=w.GetCurPosition();var nFlags=0;w.WriteLong(0);if(null!== this.snd){nFlags|=1;w.WriteString2(this.snd)}if(null!==this.id){nFlags|=2;w.WriteString2(this.id)}if(null!==this.invalidUrl){nFlags|=4;w.WriteString2(this.invalidUrl)}if(null!==this.action){nFlags|=8;w.WriteString2(this.action)}if(null!==this.tgtFrame){nFlags|=16;w.WriteString2(this.tgtFrame)}if(null!==this.tooltip){nFlags|=32;w.WriteString2(this.tooltip)}if(null!==this.history){nFlags|=64;w.WriteBool(this.history)}if(null!==this.highlightClick){nFlags|=128;w.WriteBool(this.highlightClick)}if(null!== this.endSnd){nFlags|=256;w.WriteBool(this.endSnd)}var nEndPos=w.GetCurPosition();w.Seek(nStartPos);w.WriteLong(nFlags);w.Seek(nEndPos)};CT_Hyperlink.prototype.Read_FromBinary=function(r){var nFlags=r.GetLong();if(nFlags&1)this.snd=r.GetString2();if(nFlags&2)this.id=r.GetString2();if(nFlags&4)this.invalidUrl=r.GetString2();if(nFlags&8)this.action=r.GetString2();if(nFlags&16)this.tgtFrame=r.GetString2();if(nFlags&32)this.tooltip=r.GetString2();if(nFlags&64)this.history=r.GetBool();if(nFlags&128)this.highlightClick= r.GetBool();if(nFlags&256)this.endSnd=r.GetBool()};CT_Hyperlink.prototype.createDuplicate=function(){var ret=new CT_Hyperlink;ret.snd=this.snd;ret.id=this.id;ret.invalidUrl=this.invalidUrl;ret.action=this.action;ret.tgtFrame=this.tgtFrame;ret.tooltip=this.tooltip;ret.history=this.history;ret.highlightClick=this.highlightClick;ret.endSnd=this.endSnd;return ret};var CChangesDrawingsBool=AscDFH.CChangesDrawingsBool;var CChangesDrawingsLong=AscDFH.CChangesDrawingsLong;var CChangesDrawingsDouble=AscDFH.CChangesDrawingsDouble; var CChangesDrawingsString=AscDFH.CChangesDrawingsString;var CChangesDrawingsObjectNoId=AscDFH.CChangesDrawingsObjectNoId;var CChangesDrawingsObject=AscDFH.CChangesDrawingsObject;var CChangesDrawingsContentNoId=AscDFH.CChangesDrawingsContentNoId;var CChangesDrawingsContentLong=AscDFH.CChangesDrawingsContentLong;var CChangesDrawingsContentLongMap=AscDFH.CChangesDrawingsContentLongMap;var CChangesDrawingsContent=AscDFH.CChangesDrawingsContent;var drawingsChangesMap=window["AscDFH"].drawingsChangesMap; var drawingConstructorsMap=window["AscDFH"].drawingsConstructorsMap;var drawingContentChanges=window["AscDFH"].drawingContentChanges;drawingsChangesMap[AscDFH.historyitem_DefaultShapeDefinition_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_DefaultShapeDefinition_SetBodyPr]=function(oClass,value){oClass.bodyPr=value};drawingsChangesMap[AscDFH.historyitem_DefaultShapeDefinition_SetLstStyle]=function(oClass,value){oClass.lstStyle=value};drawingsChangesMap[AscDFH.historyitem_DefaultShapeDefinition_SetStyle]= function(oClass,value){oClass.style=value};drawingsChangesMap[AscDFH.historyitem_CNvPr_SetId]=function(oClass,value){oClass.id=value};drawingsChangesMap[AscDFH.historyitem_CNvPr_SetName]=function(oClass,value){oClass.name=value};drawingsChangesMap[AscDFH.historyitem_CNvPr_SetIsHidden]=function(oClass,value){oClass.isHidden=value};drawingsChangesMap[AscDFH.historyitem_CNvPr_SetDescr]=function(oClass,value){oClass.descr=value};drawingsChangesMap[AscDFH.historyitem_CNvPr_SetTitle]=function(oClass,value){oClass.title= value};drawingsChangesMap[AscDFH.historyitem_CNvPr_SetHlinkClick]=function(oClass,value){oClass.hlinkClick=value};drawingsChangesMap[AscDFH.historyitem_CNvPr_SetHlinkHover]=function(oClass,value){oClass.hlinkHover=value};drawingsChangesMap[AscDFH.historyitem_NvPr_SetIsPhoto]=function(oClass,value){oClass.isPhoto=value};drawingsChangesMap[AscDFH.historyitem_NvPr_SetUserDrawn]=function(oClass,value){oClass.userDrawn=value};drawingsChangesMap[AscDFH.historyitem_NvPr_SetPh]=function(oClass,value){oClass.ph= value};drawingsChangesMap[AscDFH.historyitem_Ph_SetHasCustomPrompt]=function(oClass,value){oClass.hasCustomPrompt=value};drawingsChangesMap[AscDFH.historyitem_Ph_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_Ph_SetOrient]=function(oClass,value){oClass.orient=value};drawingsChangesMap[AscDFH.historyitem_Ph_SetSz]=function(oClass,value){oClass.sz=value};drawingsChangesMap[AscDFH.historyitem_Ph_SetType]=function(oClass,value){oClass.type=value};drawingsChangesMap[AscDFH.historyitem_UniNvPr_SetCNvPr]= function(oClass,value){oClass.cNvPr=value};drawingsChangesMap[AscDFH.historyitem_UniNvPr_SetUniPr]=function(oClass,value){oClass.uniPr=value};drawingsChangesMap[AscDFH.historyitem_UniNvPr_SetNvPr]=function(oClass,value){oClass.nvPr=value};drawingsChangesMap[AscDFH.historyitem_ShapeStyle_SetLnRef]=function(oClass,value){oClass.lnRef=value};drawingsChangesMap[AscDFH.historyitem_ShapeStyle_SetFillRef]=function(oClass,value){oClass.fillRef=value};drawingsChangesMap[AscDFH.historyitem_ShapeStyle_SetFontRef]= function(oClass,value){oClass.fontRef=value};drawingsChangesMap[AscDFH.historyitem_ShapeStyle_SetEffectRef]=function(oClass,value){oClass.effectRef=value};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetParent]=function(oClass,value){oClass.parent=value};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetOffX]=function(oClass,value){oClass.offX=value;oClass.handleUpdatePosition()};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetOffY]=function(oClass,value){oClass.offY=value;oClass.handleUpdatePosition()}; drawingsChangesMap[AscDFH.historyitem_Xfrm_SetExtX]=function(oClass,value){oClass.extX=value;oClass.handleUpdateExtents()};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetExtY]=function(oClass,value){oClass.extY=value;oClass.handleUpdateExtents()};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetChOffX]=function(oClass,value){oClass.chOffX=value;oClass.handleUpdateChildOffset()};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetChOffY]=function(oClass,value){oClass.chOffY=value;oClass.handleUpdateChildOffset()}; drawingsChangesMap[AscDFH.historyitem_Xfrm_SetChExtX]=function(oClass,value){oClass.chExtX=value;oClass.handleUpdateChildExtents()};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetChExtY]=function(oClass,value){oClass.chExtY=value;oClass.handleUpdateChildExtents()};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetFlipH]=function(oClass,value){oClass.flipH=value;oClass.handleUpdateFlip()};drawingsChangesMap[AscDFH.historyitem_Xfrm_SetFlipV]=function(oClass,value){oClass.flipV=value;oClass.handleUpdateFlip()}; drawingsChangesMap[AscDFH.historyitem_Xfrm_SetRot]=function(oClass,value){oClass.rot=value;oClass.handleUpdateRot()};drawingsChangesMap[AscDFH.historyitem_SpPr_SetParent]=function(oClass,value){oClass.parent=value};drawingsChangesMap[AscDFH.historyitem_SpPr_SetBwMode]=function(oClass,value){oClass.bwMode=value};drawingsChangesMap[AscDFH.historyitem_SpPr_SetXfrm]=function(oClass,value){oClass.xfrm=value};drawingsChangesMap[AscDFH.historyitem_SpPr_SetGeometry]=function(oClass,value){oClass.geometry= value;oClass.handleUpdateGeometry()};drawingsChangesMap[AscDFH.historyitem_SpPr_SetFill]=function(oClass,value,FromLoad){oClass.Fill=value;oClass.handleUpdateFill();if(FromLoad)if(typeof AscCommon.CollaborativeEditing!=="undefined")if(oClass.Fill&&oClass.Fill.fill&&oClass.Fill.fill.type===c_oAscFill.FILL_TYPE_BLIP&&typeof oClass.Fill.fill.RasterImageId==="string"&&oClass.Fill.fill.RasterImageId.length>0)AscCommon.CollaborativeEditing.Add_NewImage(oClass.Fill.fill.RasterImageId)};drawingsChangesMap[AscDFH.historyitem_SpPr_SetLn]= function(oClass,value){oClass.ln=value;oClass.handleUpdateLn()};drawingsChangesMap[AscDFH.historyitem_SpPr_SetEffectPr]=function(oClass,value){oClass.effectProps=value;oClass.handleUpdateGeometry()};drawingsChangesMap[AscDFH.historyitem_ExtraClrScheme_SetClrScheme]=function(oClass,value){oClass.clrScheme=value};drawingsChangesMap[AscDFH.historyitem_ExtraClrScheme_SetClrMap]=function(oClass,value){oClass.clrMap=value};drawingsChangesMap[AscDFH.historyitem_ThemeSetColorScheme]=function(oClass,value){oClass.themeElements.clrScheme= value;var oWordGraphicObjects=oClass.GetWordDrawingObjects();if(oWordGraphicObjects){oWordGraphicObjects.drawingDocument.CheckGuiControlColors();oWordGraphicObjects.document.Api.chartPreviewManager.clearPreviews();oWordGraphicObjects.document.Api.textArtPreviewManager.clear()}};drawingsChangesMap[AscDFH.historyitem_ThemeSetFontScheme]=function(oClass,value){oClass.themeElements.fontScheme=value};drawingsChangesMap[AscDFH.historyitem_ThemeSetFmtScheme]=function(oClass,value){oClass.themeElements.fmtScheme= value};drawingsChangesMap[AscDFH.historyitem_ThemeSetName]=function(oClass,value){oClass.name=value};drawingsChangesMap[AscDFH.historyitem_ThemeSetIsThemeOverride]=function(oClass,value){oClass.isThemeOverride=value};drawingsChangesMap[AscDFH.historyitem_ThemeSetSpDef]=function(oClass,value){oClass.spDef=value};drawingsChangesMap[AscDFH.historyitem_ThemeSetLnDef]=function(oClass,value){oClass.lnDef=value};drawingsChangesMap[AscDFH.historyitem_ThemeSetTxDef]=function(oClass,value){oClass.txDef=value}; drawingsChangesMap[AscDFH.historyitem_HF_SetDt]=function(oClass,value){oClass.dt=value};drawingsChangesMap[AscDFH.historyitem_HF_SetFtr]=function(oClass,value){oClass.ftr=value};drawingsChangesMap[AscDFH.historyitem_HF_SetHdr]=function(oClass,value){oClass.hdr=value};drawingsChangesMap[AscDFH.historyitem_HF_SetSldNum]=function(oClass,value){oClass.sldNum=value};drawingsChangesMap[AscDFH.historyitem_UniNvPr_SetUniSpPr]=function(oClass,value){oClass.nvUniSpPr=value};drawingsChangesMap[AscDFH.historyitem_NvPr_SetUniMedia]= function(oClass,value){oClass.unimedia=value};drawingContentChanges[AscDFH.historyitem_ClrMap_SetClr]=function(oClass){return oClass.color_map};drawingContentChanges[AscDFH.historyitem_ThemeAddExtraClrScheme]=function(oClass){return oClass.extraClrSchemeLst};drawingContentChanges[AscDFH.historyitem_ThemeRemoveExtraClrScheme]=function(oClass){return oClass.extraClrSchemeLst};drawingConstructorsMap[AscDFH.historyitem_ClrMap_SetClr]=CUniColor;drawingConstructorsMap[AscDFH.historyitem_DefaultShapeDefinition_SetBodyPr]= CBodyPr;drawingConstructorsMap[AscDFH.historyitem_DefaultShapeDefinition_SetLstStyle]=TextListStyle;drawingConstructorsMap[AscDFH.historyitem_ShapeStyle_SetLnRef]=drawingConstructorsMap[AscDFH.historyitem_ShapeStyle_SetFillRef]=drawingConstructorsMap[AscDFH.historyitem_ShapeStyle_SetEffectRef]=StyleRef;drawingConstructorsMap[AscDFH.historyitem_ShapeStyle_SetFontRef]=FontRef;drawingConstructorsMap[AscDFH.historyitem_SpPr_SetFill]=CUniFill;drawingConstructorsMap[AscDFH.historyitem_SpPr_SetLn]=CLn;drawingConstructorsMap[AscDFH.historyitem_SpPr_SetEffectPr]= CEffectProperties;drawingConstructorsMap[AscDFH.historyitem_ThemeSetColorScheme]=ClrScheme;drawingConstructorsMap[AscDFH.historyitem_ThemeSetFontScheme]=FontScheme;drawingConstructorsMap[AscDFH.historyitem_ThemeSetFmtScheme]=FmtScheme;drawingConstructorsMap[AscDFH.historyitem_UniNvPr_SetUniSpPr]=CNvUniSpPr;drawingConstructorsMap[AscDFH.historyitem_CNvPr_SetHlinkClick]=CT_Hyperlink;drawingConstructorsMap[AscDFH.historyitem_CNvPr_SetHlinkHover]=CT_Hyperlink;AscDFH.changesFactory[AscDFH.historyitem_DefaultShapeDefinition_SetSpPr]= CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DefaultShapeDefinition_SetBodyPr]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_DefaultShapeDefinition_SetLstStyle]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_DefaultShapeDefinition_SetStyle]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CNvPr_SetId]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CNvPr_SetName]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_CNvPr_SetIsHidden]= CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_CNvPr_SetDescr]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_CNvPr_SetTitle]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_CNvPr_SetHlinkClick]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_CNvPr_SetHlinkHover]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_NvPr_SetIsPhoto]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_NvPr_SetUserDrawn]=CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_NvPr_SetPh]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_NvPr_SetUniMedia]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_Ph_SetHasCustomPrompt]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Ph_SetIdx]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_Ph_SetOrient]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Ph_SetSz]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Ph_SetType]= CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_UniNvPr_SetCNvPr]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_UniNvPr_SetUniPr]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_UniNvPr_SetNvPr]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_UniNvPr_SetUniSpPr]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ShapeStyle_SetLnRef]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ShapeStyle_SetFillRef]= CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ShapeStyle_SetFontRef]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ShapeStyle_SetEffectRef]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetParent]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetOffX]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetOffY]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetExtX]= CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetExtY]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetChOffX]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetChOffY]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetChExtX]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetChExtY]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetFlipH]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetFlipV]= CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Xfrm_SetRot]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetParent]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetBwMode]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetXfrm]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetGeometry]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetFill]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetLn]= CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetEffectPr]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ClrMap_SetClr]=CChangesDrawingsContentLongMap;AscDFH.changesFactory[AscDFH.historyitem_ExtraClrScheme_SetClrScheme]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ExtraClrScheme_SetClrMap]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ThemeSetColorScheme]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ThemeSetFontScheme]= CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ThemeSetFmtScheme]=CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ThemeSetName]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_ThemeSetIsThemeOverride]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ThemeSetSpDef]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ThemeSetLnDef]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ThemeSetTxDef]=CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_ThemeAddExtraClrScheme]=CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_ThemeRemoveExtraClrScheme]=CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_HF_SetDt]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_HF_SetFtr]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_HF_SetHdr]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_HF_SetSldNum]=CChangesDrawingsBool;function CreateFontRef(idx, color){var ret=new FontRef;ret.idx=idx;ret.Color=color;return ret}function CreateStyleRef(idx,color){var ret=new StyleRef;ret.idx=idx;ret.Color=color;return ret}function CreatePresetColor(id){var ret=new CPrstColor;ret.idx=id;return ret}function sRGB_to_scRGB(value){if(value<0)return 0;if(value<=.04045)return value/12.92;if(value<=1)return Math.pow((value+.055)/1.055,2.4);return 1}function scRGB_to_sRGB(value){if(value<0)return 0;if(value<=.0031308)return value*12.92;if(value<1)return 1.055*Math.pow(value, 1/2.4)-.055;return 1}function checkRasterImageId(rasterImageId){var imageLocal=AscCommon.g_oDocumentUrls.getImageLocal(rasterImageId);return imageLocal?imageLocal:rasterImageId}var g_oThemeFontsName={};g_oThemeFontsName["+mj-cs"]=true;g_oThemeFontsName["+mj-ea"]=true;g_oThemeFontsName["+mj-lt"]=true;g_oThemeFontsName["+mn-cs"]=true;g_oThemeFontsName["+mn-ea"]=true;g_oThemeFontsName["+mn-lt"]=true;function isRealNumber(n){return typeof n==="number"&&!isNaN(n)}function isRealBool(b){return b===true|| b===false}function writeLong(w,val){w.WriteBool(isRealNumber(val));if(isRealNumber(val))w.WriteLong(val)}function readLong(r){var ret;if(r.GetBool())ret=r.GetLong();else ret=null;return ret}function writeDouble(w,val){w.WriteBool(isRealNumber(val));if(isRealNumber(val))w.WriteDouble(val)}function readDouble(r){var ret;if(r.GetBool())ret=r.GetDouble();else ret=null;return ret}function writeBool(w,val){w.WriteBool(isRealBool(val));if(isRealBool(val))w.WriteBool(val)}function readBool(r){var ret;if(r.GetBool())ret= r.GetBool();else ret=null;return ret}function writeString(w,val){w.WriteBool(typeof val==="string");if(typeof val==="string")w.WriteString2(val)}function readString(r){var ret;if(r.GetBool())ret=r.GetString2();else ret=null;return ret}function writeObject(w,val){w.WriteBool(isRealObject(val));if(isRealObject(val))w.WriteString2(val.Get_Id())}function readObject(r){var ret;if(r.GetBool())ret=g_oTableId.Get_ById(r.GetString2());else ret=null;return ret}function checkThemeFonts(oFontMap,font_scheme){if(oFontMap["+mj-lt"]){if(font_scheme.majorFont&& typeof font_scheme.majorFont.latin==="string"&&font_scheme.majorFont.latin.length>0)oFontMap[font_scheme.majorFont.latin]=1;delete oFontMap["+mj-lt"]}if(oFontMap["+mj-ea"]){if(font_scheme.majorFont&&typeof font_scheme.majorFont.ea==="string"&&font_scheme.majorFont.ea.length>0)oFontMap[font_scheme.majorFont.ea]=1;delete oFontMap["+mj-ea"]}if(oFontMap["+mj-cs"]){if(font_scheme.majorFont&&typeof font_scheme.majorFont.cs==="string"&&font_scheme.majorFont.cs.length>0)oFontMap[font_scheme.majorFont.cs]= 1;delete oFontMap["+mj-cs"]}if(oFontMap["+mn-lt"]){if(font_scheme.minorFont&&typeof font_scheme.minorFont.latin==="string"&&font_scheme.minorFont.latin.length>0)oFontMap[font_scheme.minorFont.latin]=1;delete oFontMap["+mn-lt"]}if(oFontMap["+mn-ea"]){if(font_scheme.minorFont&&typeof font_scheme.minorFont.ea==="string"&&font_scheme.minorFont.ea.length>0)oFontMap[font_scheme.minorFont.ea]=1;delete oFontMap["+mn-ea"]}if(oFontMap["+mn-cs"]){if(font_scheme.minorFont&&typeof font_scheme.minorFont.cs==="string"&& font_scheme.minorFont.cs.length>0)oFontMap[font_scheme.minorFont.cs]=1;delete oFontMap["+mn-cs"]}}function ExecuteNoHistory(f,oThis,args){History.TurnOff&&History.TurnOff();var b_table_id=false;if(g_oTableId&&!g_oTableId.m_bTurnOff){g_oTableId.m_bTurnOff=true;b_table_id=true}var ret=f.apply(oThis,args);History.TurnOn&&History.TurnOn();if(b_table_id)g_oTableId.m_bTurnOff=false;return ret}function checkObjectUnifill(obj,theme,colorMap){if(obj&&obj.Unifill){obj.Unifill.check(theme,colorMap);var rgba= obj.Unifill.getRGBAColor();obj.Color=new CDocumentColor(rgba.R,rgba.G,rgba.B,false)}}function checkTableCellPr(cellPr,slide,layout,master,theme){cellPr.Check_PresentationPr(theme);var color_map,rgba;if(slide.clrMap)color_map=slide.clrMap;else if(layout.clrMap)color_map=layout.clrMap;else if(master.clrMap)color_map=master.clrMap;else color_map=AscFormat.G_O_DEFAULT_COLOR_MAP;checkObjectUnifill(cellPr.Shd,theme,color_map);if(cellPr.TableCellBorders){checkObjectUnifill(cellPr.TableCellBorders.Left,theme, color_map);checkObjectUnifill(cellPr.TableCellBorders.Top,theme,color_map);checkObjectUnifill(cellPr.TableCellBorders.Right,theme,color_map);checkObjectUnifill(cellPr.TableCellBorders.Bottom,theme,color_map);checkObjectUnifill(cellPr.TableCellBorders.InsideH,theme,color_map);checkObjectUnifill(cellPr.TableCellBorders.InsideV,theme,color_map)}return cellPr}var Ax_Counter={GLOBAL_AX_ID_COUNTER:1E3};var TYPE_TRACK={SHAPE:0,GROUP:0,GROUP_PASSIVE:1,TEXT:2,EMPTY_PH:3,CHART_TEXT:4,CROP:5};var TYPE_KIND= {SLIDE:0,LAYOUT:1,MASTER:2,NOTES:3,NOTES_MASTER:4};var TYPE_TRACK_SHAPE=0;var TYPE_TRACK_GROUP=TYPE_TRACK_SHAPE;var TYPE_TRACK_GROUP_PASSIVE=1;var TYPE_TRACK_TEXT=2;var TYPE_TRACK_EMPTY_PH=3;var TYPE_TRACK_CHART=4;var SLIDE_KIND=0;var LAYOUT_KIND=1;var MASTER_KIND=2;var map_prst_color={};map_prst_color["aliceBlue"]=15792383;map_prst_color["antiqueWhite"]=16444375;map_prst_color["aqua"]=65535;map_prst_color["aquamarine"]=8388564;map_prst_color["azure"]=15794175;map_prst_color["beige"]=16119260;map_prst_color["bisque"]= 16770244;map_prst_color["black"]=0;map_prst_color["blanchedAlmond"]=16772045;map_prst_color["blue"]=255;map_prst_color["blueViolet"]=9055202;map_prst_color["brown"]=10824234;map_prst_color["burlyWood"]=14596231;map_prst_color["cadetBlue"]=6266528;map_prst_color["chartreuse"]=8388352;map_prst_color["chocolate"]=13789470;map_prst_color["coral"]=16744272;map_prst_color["cornflowerBlue"]=6591981;map_prst_color["cornsilk"]=16775388;map_prst_color["crimson"]=14423100;map_prst_color["cyan"]=65535;map_prst_color["darkBlue"]= 139;map_prst_color["darkCyan"]=35723;map_prst_color["darkGoldenrod"]=12092939;map_prst_color["darkGray"]=11119017;map_prst_color["darkGreen"]=25600;map_prst_color["darkGrey"]=11119017;map_prst_color["darkKhaki"]=12433259;map_prst_color["darkMagenta"]=9109643;map_prst_color["darkOliveGreen"]=5597999;map_prst_color["darkOrange"]=16747520;map_prst_color["darkOrchid"]=10040012;map_prst_color["darkRed"]=9109504;map_prst_color["darkSalmon"]=15308410;map_prst_color["darkSeaGreen"]=9419919;map_prst_color["darkSlateBlue"]= 4734347;map_prst_color["darkSlateGray"]=3100495;map_prst_color["darkSlateGrey"]=3100495;map_prst_color["darkTurquoise"]=52945;map_prst_color["darkViolet"]=9699539;map_prst_color["deepPink"]=16716947;map_prst_color["deepSkyBlue"]=49151;map_prst_color["dimGray"]=6908265;map_prst_color["dimGrey"]=6908265;map_prst_color["dkBlue"]=139;map_prst_color["dkCyan"]=35723;map_prst_color["dkGoldenrod"]=12092939;map_prst_color["dkGray"]=11119017;map_prst_color["dkGreen"]=25600;map_prst_color["dkGrey"]=11119017; map_prst_color["dkKhaki"]=12433259;map_prst_color["dkMagenta"]=9109643;map_prst_color["dkOliveGreen"]=5597999;map_prst_color["dkOrange"]=16747520;map_prst_color["dkOrchid"]=10040012;map_prst_color["dkRed"]=9109504;map_prst_color["dkSalmon"]=15308410;map_prst_color["dkSeaGreen"]=9419915;map_prst_color["dkSlateBlue"]=4734347;map_prst_color["dkSlateGray"]=3100495;map_prst_color["dkSlateGrey"]=3100495;map_prst_color["dkTurquoise"]=52945;map_prst_color["dkViolet"]=9699539;map_prst_color["dodgerBlue"]= 2003199;map_prst_color["firebrick"]=11674146;map_prst_color["floralWhite"]=16775920;map_prst_color["forestGreen"]=2263842;map_prst_color["fuchsia"]=16711935;map_prst_color["gainsboro"]=14474460;map_prst_color["ghostWhite"]=16316671;map_prst_color["gold"]=16766720;map_prst_color["goldenrod"]=14329120;map_prst_color["gray"]=8421504;map_prst_color["green"]=32768;map_prst_color["greenYellow"]=11403055;map_prst_color["grey"]=8421504;map_prst_color["honeydew"]=15794160;map_prst_color["hotPink"]=16738740; map_prst_color["indianRed"]=13458524;map_prst_color["indigo"]=4915330;map_prst_color["ivory"]=16777200;map_prst_color["khaki"]=15787660;map_prst_color["lavender"]=15132410;map_prst_color["lavenderBlush"]=16773365;map_prst_color["lawnGreen"]=8190976;map_prst_color["lemonChiffon"]=16775885;map_prst_color["lightBlue"]=11393254;map_prst_color["lightCoral"]=15761536;map_prst_color["lightCyan"]=14745599;map_prst_color["lightGoldenrodYellow"]=16448210;map_prst_color["lightGray"]=13882323;map_prst_color["lightGreen"]= 9498256;map_prst_color["lightGrey"]=13882323;map_prst_color["lightPink"]=16758465;map_prst_color["lightSalmon"]=16752762;map_prst_color["lightSeaGreen"]=2142890;map_prst_color["lightSkyBlue"]=8900346;map_prst_color["lightSlateGray"]=7833753;map_prst_color["lightSlateGrey"]=7833753;map_prst_color["lightSteelBlue"]=11584734;map_prst_color["lightYellow"]=16777184;map_prst_color["lime"]=65280;map_prst_color["limeGreen"]=3329330;map_prst_color["linen"]=16445670;map_prst_color["ltBlue"]=11393254;map_prst_color["ltCoral"]= 15761536;map_prst_color["ltCyan"]=14745599;map_prst_color["ltGoldenrodYellow"]=16448120;map_prst_color["ltGray"]=13882323;map_prst_color["ltGreen"]=9498256;map_prst_color["ltGrey"]=13882323;map_prst_color["ltPink"]=16758465;map_prst_color["ltSalmon"]=16752762;map_prst_color["ltSeaGreen"]=2142890;map_prst_color["ltSkyBlue"]=8900346;map_prst_color["ltSlateGray"]=7833753;map_prst_color["ltSlateGrey"]=7833753;map_prst_color["ltSteelBlue"]=11584734;map_prst_color["ltYellow"]=16777184;map_prst_color["magenta"]= 16711935;map_prst_color["maroon"]=8388608;map_prst_color["medAquamarine"]=6737322;map_prst_color["medBlue"]=205;map_prst_color["mediumAquamarine"]=6737322;map_prst_color["mediumBlue"]=205;map_prst_color["mediumOrchid"]=12211667;map_prst_color["mediumPurple"]=9662683;map_prst_color["mediumSeaGreen"]=3978097;map_prst_color["mediumSlateBlue"]=8087790;map_prst_color["mediumSpringGreen"]=64154;map_prst_color["mediumTurquoise"]=4772300;map_prst_color["mediumVioletRed"]=13047173;map_prst_color["medOrchid"]= 12211667;map_prst_color["medPurple"]=9662683;map_prst_color["medSeaGreen"]=3978097;map_prst_color["medSlateBlue"]=8087790;map_prst_color["medSpringGreen"]=64154;map_prst_color["medTurquoise"]=4772300;map_prst_color["medVioletRed"]=13047173;map_prst_color["midnightBlue"]=1644912;map_prst_color["mintCream"]=16121850;map_prst_color["mistyRose"]=16770303;map_prst_color["moccasin"]=16770229;map_prst_color["navajoWhite"]=16768685;map_prst_color["navy"]=128;map_prst_color["oldLace"]=16643558;map_prst_color["olive"]= 8421376;map_prst_color["oliveDrab"]=7048739;map_prst_color["orange"]=16753920;map_prst_color["orangeRed"]=16729344;map_prst_color["orchid"]=14315734;map_prst_color["paleGoldenrod"]=15657130;map_prst_color["paleGreen"]=10025880;map_prst_color["paleTurquoise"]=11529966;map_prst_color["paleVioletRed"]=14381203;map_prst_color["papayaWhip"]=16773077;map_prst_color["peachPuff"]=16767673;map_prst_color["peru"]=13468991;map_prst_color["pink"]=16761035;map_prst_color["plum"]=13869267;map_prst_color["powderBlue"]= 11591910;map_prst_color["purple"]=8388736;map_prst_color["red"]=16711680;map_prst_color["rosyBrown"]=12357519;map_prst_color["royalBlue"]=4286945;map_prst_color["saddleBrown"]=9127187;map_prst_color["salmon"]=16416882;map_prst_color["sandyBrown"]=16032864;map_prst_color["seaGreen"]=3050327;map_prst_color["seaShell"]=16774638;map_prst_color["sienna"]=10506797;map_prst_color["silver"]=12632256;map_prst_color["skyBlue"]=8900331;map_prst_color["slateBlue"]=6970091;map_prst_color["slateGray"]=7372944; map_prst_color["slateGrey"]=7372944;map_prst_color["snow"]=16775930;map_prst_color["springGreen"]=65407;map_prst_color["steelBlue"]=4620980;map_prst_color["tan"]=13808780;map_prst_color["teal"]=32896;map_prst_color["thistle"]=14204888;map_prst_color["tomato"]=16741191;map_prst_color["turquoise"]=4251856;map_prst_color["violet"]=15631086;map_prst_color["wheat"]=16113331;map_prst_color["white"]=16777215;map_prst_color["whiteSmoke"]=16119285;map_prst_color["yellow"]=16776960;map_prst_color["yellowGreen"]= 10145074;function CColorMod(){this.name="";this.val=0}CColorMod.prototype={getObjectType:function(){return AscDFH.historyitem_type_ColorMod},Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},setName:function(name){this.name=name},setVal:function(val){this.val=val},createDuplicate:function(){var duplicate=new CColorMod;duplicate.name=this.name;duplicate.val=this.val;return duplicate}};var cd16=1/6;var cd13=1/3;var cd23=2/3;var max_hls=255;var DEC_GAMMA=2.3;var INC_GAMMA=1/DEC_GAMMA; var MAX_PERCENT=1E5;function CColorModifiers(){this.Mods=[]}CColorModifiers.prototype={isUsePow:!AscCommon.AscBrowser.isSailfish||!AscCommon.AscBrowser.isEmulateDevicePixelRatio,getObjectType:function(){return AscDFH.historyitem_type_ColorModifiers},Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getModsToWrite:function(){},getModValue:function(sName){if(Array.isArray(this.Mods))for(var i=0;i<this.Mods.length;++i)if(this.Mods[i]&&this.Mods[i].name===sName)return this.Mods[i].val; return null},Write_ToBinary:function(w){w.WriteLong(this.Mods.length);for(var i=0;i<this.Mods.length;++i){w.WriteString2(this.Mods[i].name);w.WriteLong(this.Mods[i].val)}},Read_FromBinary:function(r){var len=r.GetLong();for(var i=0;i<len;++i){var mod=new CColorMod;mod.name=r.GetString2();mod.val=r.GetLong();this.Mods.push(mod)}},addMod:function(mod){this.Mods.push(mod)},removeMod:function(pos){this.Mods.splice(pos,1)[0]},IsIdentical:function(mods){if(mods==null)return false;if(mods.Mods==null||this.Mods.length!= mods.Mods.length)return false;for(var i=0;i<this.Mods.length;++i)if(this.Mods[i].name!=mods.Mods[i].name||this.Mods[i].val!=mods.Mods[i].val)return false;return true},createDuplicate:function(){var duplicate=new CColorModifiers;for(var i=0;i<this.Mods.length;++i)duplicate.Mods[i]=this.Mods[i].createDuplicate();return duplicate},RGB2HSL:function(R,G,B,HLS){var iMin=R<G?R:G;iMin=iMin<B?iMin:B;var iMax=R>G?R:G;iMax=iMax>B?iMax:B;var iDelta=iMax-iMin;var dMax=(iMax+iMin)/255;var dDelta=iDelta/255;var H= 0;var S=0;var L=dMax/2;if(iDelta!=0){if(L<.5)S=dDelta/dMax;else S=dDelta/(2-dMax);dDelta=dDelta*1530;var dR=(iMax-R)/dDelta;var dG=(iMax-G)/dDelta;var dB=(iMax-B)/dDelta;if(R==iMax)H=dB-dG;else if(G==iMax)H=cd13+dR-dB;else if(B==iMax)H=cd23+dG-dR;if(H<0)H+=1;if(H>1)H-=1}H=H*max_hls>>0&255;if(H<0)H=0;if(H>255)H=255;S=S*max_hls>>0&255;if(S<0)S=0;if(S>255)S=255;L=L*max_hls>>0&255;if(L<0)L=0;if(L>255)L=255;HLS.H=H;HLS.S=S;HLS.L=L},HSL2RGB:function(HSL,RGB){if(HSL.S==0){RGB.R=HSL.L;RGB.G=HSL.L;RGB.B=HSL.L}else{var H= HSL.H/max_hls;var S=HSL.S/max_hls;var L=HSL.L/max_hls;var v2=0;if(L<.5)v2=L*(1+S);else v2=L+S-S*L;var v1=2*L-v2;var R=255*this.Hue_2_RGB(v1,v2,H+cd13)>>0;var G=255*this.Hue_2_RGB(v1,v2,H)>>0;var B=255*this.Hue_2_RGB(v1,v2,H-cd13)>>0;if(R<0)R=0;if(R>255)R=255;if(G<0)G=0;if(G>255)G=255;if(B<0)B=0;if(B>255)B=255;RGB.R=R;RGB.G=G;RGB.B=B}},Hue_2_RGB:function(v1,v2,vH){if(vH<0)vH+=1;if(vH>1)vH-=1;if(vH<cd16)return v1+(v2-v1)*6*vH;if(vH<.5)return v2;if(vH<cd23)return v1+(v2-v1)*(cd23-vH)*6;return v1},lclRgbCompToCrgbComp:function(value){return value* MAX_PERCENT/255},lclCrgbCompToRgbComp:function(value){return value*255/MAX_PERCENT},lclGamma:function(nComp,fGamma){return Math.pow(nComp/MAX_PERCENT,fGamma)*MAX_PERCENT+.5>>0},RgbtoCrgb:function(RGBA){if(this.isUsePow){RGBA.R=Math.pow(RGBA.R/255,DEC_GAMMA)*MAX_PERCENT+.5>>0;RGBA.G=Math.pow(RGBA.G/255,DEC_GAMMA)*MAX_PERCENT+.5>>0;RGBA.B=Math.pow(RGBA.B/255,DEC_GAMMA)*MAX_PERCENT+.5>>0}},CrgbtoRgb:function(RGBA){if(this.isUsePow){RGBA.R=Math.pow(RGBA.R/1E5,INC_GAMMA)*255+.5>>0;RGBA.G=Math.pow(RGBA.G/ 1E5,INC_GAMMA)*255+.5>>0;RGBA.B=Math.pow(RGBA.B/1E5,INC_GAMMA)*255+.5>>0}else{RGBA.R=AscFormat.ClampColor(RGBA.R);RGBA.G=AscFormat.ClampColor(RGBA.G);RGBA.B=AscFormat.ClampColor(RGBA.B)}},Apply:function(RGBA){if(null==this.Mods)return;var _len=this.Mods.length;for(var i=0;i<_len;i++){var colorMod=this.Mods[i];var val=colorMod.val/1E5;if(colorMod.name=="alpha")RGBA.A=AscFormat.ClampColor(255*val);else if(colorMod.name=="blue")RGBA.B=AscFormat.ClampColor(255*val);else if(colorMod.name=="blueMod")RGBA.B= AscFormat.ClampColor(RGBA.B*val);else if(colorMod.name=="blueOff")RGBA.B=AscFormat.ClampColor(RGBA.B+val*255);else if(colorMod.name=="green")RGBA.G=AscFormat.ClampColor(255*val);else if(colorMod.name=="greenMod")RGBA.G=AscFormat.ClampColor(RGBA.G*val);else if(colorMod.name=="greenOff")RGBA.G=AscFormat.ClampColor(RGBA.G+val*255);else if(colorMod.name=="red")RGBA.R=AscFormat.ClampColor(255*val);else if(colorMod.name=="redMod")RGBA.R=AscFormat.ClampColor(RGBA.R*val);else if(colorMod.name=="redOff")RGBA.R= AscFormat.ClampColor(RGBA.R+val*255);else if(colorMod.name=="hueOff"){var HSL={H:0,S:0,L:0};this.RGB2HSL(RGBA.R,RGBA.G,RGBA.B,HSL);var res=HSL.H+val*10/9+.5>>0;HSL.H=AscFormat.ClampColor2(res,0,max_hls);this.HSL2RGB(HSL,RGBA)}else if(colorMod.name=="inv"){RGBA.R^=255;RGBA.G^=255;RGBA.B^=255}else if(colorMod.name=="lumMod"){var HSL={H:0,S:0,L:0};this.RGB2HSL(RGBA.R,RGBA.G,RGBA.B,HSL);HSL.L=AscFormat.ClampColor2(HSL.L*val,0,max_hls);this.HSL2RGB(HSL,RGBA)}else if(colorMod.name=="lumOff"){var HSL={H:0, S:0,L:0};this.RGB2HSL(RGBA.R,RGBA.G,RGBA.B,HSL);var res=HSL.L+val*max_hls+.5>>0;HSL.L=AscFormat.ClampColor2(res,0,max_hls);this.HSL2RGB(HSL,RGBA)}else if(colorMod.name=="satMod"){var HSL={H:0,S:0,L:0};this.RGB2HSL(RGBA.R,RGBA.G,RGBA.B,HSL);HSL.S=AscFormat.ClampColor2(HSL.S*val,0,max_hls);this.HSL2RGB(HSL,RGBA)}else if(colorMod.name=="satOff"){var HSL={H:0,S:0,L:0};this.RGB2HSL(RGBA.R,RGBA.G,RGBA.B,HSL);var res=HSL.S+val*max_hls+.5>>0;HSL.S=AscFormat.ClampColor2(res,0,max_hls);this.HSL2RGB(HSL,RGBA)}else if(colorMod.name== "wordShade"){var val_=colorMod.val/255;var HSL={H:0,S:0,L:0};this.RGB2HSL(RGBA.R,RGBA.G,RGBA.B,HSL);HSL.L=AscFormat.ClampColor2(HSL.L*val_,0,max_hls);this.HSL2RGB(HSL,RGBA)}else if(colorMod.name=="wordTint"){var _val=colorMod.val/255;var HSL={H:0,S:0,L:0};this.RGB2HSL(RGBA.R,RGBA.G,RGBA.B,HSL);var L_=HSL.L*_val+(255-colorMod.val);HSL.L=AscFormat.ClampColor2(L_,0,max_hls);this.HSL2RGB(HSL,RGBA)}else if(colorMod.name=="shade"){this.RgbtoCrgb(RGBA);if(val<0)val=0;if(val>1)val=1;RGBA.R=RGBA.R*val;RGBA.G= RGBA.G*val;RGBA.B=RGBA.B*val;this.CrgbtoRgb(RGBA)}else if(colorMod.name=="tint"){this.RgbtoCrgb(RGBA);if(val<0)val=0;if(val>1)val=1;RGBA.R=MAX_PERCENT-(MAX_PERCENT-RGBA.R)*val;RGBA.G=MAX_PERCENT-(MAX_PERCENT-RGBA.G)*val;RGBA.B=MAX_PERCENT-(MAX_PERCENT-RGBA.B)*val;this.CrgbtoRgb(RGBA)}else if(colorMod.name=="gamma"){this.RgbtoCrgb(RGBA);RGBA.R=this.lclGamma(RGBA.R,INC_GAMMA);RGBA.G=this.lclGamma(RGBA.G,INC_GAMMA);RGBA.B=this.lclGamma(RGBA.B,INC_GAMMA);this.CrgbtoRgb(RGBA)}else if(colorMod.name=="invGamma"){this.RgbtoCrgb(RGBA); RGBA.R=this.lclGamma(RGBA.R,DEC_GAMMA);RGBA.G=this.lclGamma(RGBA.G,DEC_GAMMA);RGBA.B=this.lclGamma(RGBA.B,DEC_GAMMA);this.CrgbtoRgb(RGBA)}}}};function CSysColor(){this.type=c_oAscColor.COLOR_TYPE_SYS;this.id="";this.RGBA={R:0,G:0,B:0,A:255,needRecalc:true}}CSysColor.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},setR:function(pr){this.RGBA.R=pr},setG:function(pr){this.RGBA.G=pr},setB:function(pr){this.RGBA.B=pr},check:function(){var ret=this.RGBA.needRecalc;this.RGBA.needRecalc= false;return ret},getObjectType:function(){return AscDFH.historyitem_type_SysColor},Write_ToBinary:function(w){w.WriteLong(this.type);w.WriteString2(this.id);w.WriteLong((this.RGBA.R<<16&16711680)+(this.RGBA.G<<8&65280)+this.RGBA.B)},Read_FromBinary:function(r){this.id=r.GetString2();var RGB=r.GetLong();this.RGBA.R=RGB>>16&255;this.RGBA.G=RGB>>8&255;this.RGBA.B=RGB&255},setId:function(id){this.id=id},IsIdentical:function(color){return color&&color.type==this.type&&color.id==this.id},Calculate:function(obj){}, createDuplicate:function(){var duplicate=new CSysColor;duplicate.id=this.id;duplicate.RGBA.R=this.RGBA.R;duplicate.RGBA.G=this.RGBA.G;duplicate.RGBA.B=this.RGBA.B;duplicate.RGBA.A=this.RGBA.A;return duplicate}};function CPrstColor(){this.type=c_oAscColor.COLOR_TYPE_PRST;this.id="";this.RGBA={R:0,G:0,B:0,A:255,needRecalc:true}}CPrstColor.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_PrstColor},Write_ToBinary:function(w){w.WriteLong(this.type); w.WriteString2(this.id)},Read_FromBinary:function(r){this.id=r.GetString2()},setId:function(id){this.id=id},IsIdentical:function(color){return color&&color.type==this.type&&color.id==this.id},createDuplicate:function(){var duplicate=new CPrstColor;duplicate.id=this.id;duplicate.RGBA.R=this.RGBA.R;duplicate.RGBA.G=this.RGBA.G;duplicate.RGBA.B=this.RGBA.B;duplicate.RGBA.A=this.RGBA.A;return duplicate},Calculate:function(obj){var RGB=map_prst_color[this.id];this.RGBA.R=RGB>>16&255;this.RGBA.G=RGB>>8& 255;this.RGBA.B=RGB&255},check:function(){var r,g,b,rgb;rgb=map_prst_color[this.id];r=rgb>>16&255;g=rgb>>8&255;b=rgb&255;var RGBA=this.RGBA;if(RGBA.needRecalc){RGBA.R=r;RGBA.G=g;RGBA.B=b;RGBA.needRecalc=false;return true}else if(RGBA.R===r&&RGBA.G===g&&RGBA.B===b)return false;else{RGBA.R=r;RGBA.G=g;RGBA.B=b;return true}}};function CRGBColor(){this.type=c_oAscColor.COLOR_TYPE_SRGB;this.RGBA={R:0,G:0,B:0,A:255,needRecalc:true}}CRGBColor.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){}, check:function(){var ret=this.RGBA.needRecalc;this.RGBA.needRecalc=false;return ret},getObjectType:function(){return AscDFH.historyitem_type_RGBColor},writeToBinaryLong:function(w){w.WriteLong((this.RGBA.R<<16&16711680)+(this.RGBA.G<<8&65280)+this.RGBA.B)},readFromBinaryLong:function(r){var RGB=r.GetLong();this.RGBA.R=RGB>>16&255;this.RGBA.G=RGB>>8&255;this.RGBA.B=RGB&255},Write_ToBinary:function(w){w.WriteLong(this.type);w.WriteLong((this.RGBA.R<<16&16711680)+(this.RGBA.G<<8&65280)+this.RGBA.B)}, Read_FromBinary:function(r){var RGB=r.GetLong();this.RGBA.R=RGB>>16&255;this.RGBA.G=RGB>>8&255;this.RGBA.B=RGB&255},setColor:function(r,g,b){this.RGBA.R=r;this.RGBA.G=g;this.RGBA.B=b},IsIdentical:function(color){return color&&color.type==this.type&&color.RGBA.R==this.RGBA.R&&color.RGBA.G==this.RGBA.G&&color.RGBA.B==this.RGBA.B&&color.RGBA.A==this.RGBA.A},createDuplicate:function(){var duplicate=new CRGBColor;duplicate.id=this.id;duplicate.RGBA.R=this.RGBA.R;duplicate.RGBA.G=this.RGBA.G;duplicate.RGBA.B= this.RGBA.B;duplicate.RGBA.A=this.RGBA.A;return duplicate},Calculate:function(obj){}};function CSchemeColor(){this.type=c_oAscColor.COLOR_TYPE_SCHEME;this.id=0;this.RGBA={R:0,G:0,B:0,A:255,needRecalc:true}}CSchemeColor.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},check:function(theme,colorMap){var RGBA,colors=theme.themeElements.clrScheme.colors;if(colorMap[this.id]!=null&&colors[colorMap[this.id]]!=null)RGBA=colors[colorMap[this.id]].color.RGBA;else if(colors[this.id]!= null)RGBA=colors[this.id].color.RGBA;if(!RGBA)RGBA={R:0,G:0,B:0,A:255};var _RGBA=this.RGBA;if(this.RGBA.needRecalc){_RGBA.R=RGBA.R;_RGBA.G=RGBA.G;_RGBA.B=RGBA.B;_RGBA.A=RGBA.A;this.RGBA.needRecalc=false;return true}else if(_RGBA.R===RGBA.R&&_RGBA.G===RGBA.G&&_RGBA.B===RGBA.B&&_RGBA.A===RGBA.A)return false;else{_RGBA.R=RGBA.R;_RGBA.G=RGBA.G;_RGBA.B=RGBA.B;_RGBA.A=RGBA.A;return true}},getObjectType:function(){return AscDFH.historyitem_type_SchemeColor},Write_ToBinary:function(w){w.WriteLong(this.type); w.WriteLong(this.id)},Read_FromBinary:function(r){this.id=r.GetLong()},setId:function(id){this.id=id},IsIdentical:function(color){return color&&color.type==this.type&&color.id==this.id},createDuplicate:function(){var duplicate=new CSchemeColor;duplicate.id=this.id;duplicate.RGBA.R=this.RGBA.R;duplicate.RGBA.G=this.RGBA.G;duplicate.RGBA.B=this.RGBA.B;duplicate.RGBA.A=this.RGBA.A;return duplicate},Calculate:function(theme,slide,layout,masterSlide,RGBA,colorMap){if(theme.themeElements.clrScheme)if(this.id== phClr)this.RGBA=RGBA;else{var clrMap;if(colorMap&&colorMap.color_map)clrMap=colorMap.color_map;else if(slide!=null&&slide.clrMap!=null)clrMap=slide.clrMap.color_map;else if(layout!=null&&layout.clrMap!=null)clrMap=layout.clrMap.color_map;else if(masterSlide!=null&&masterSlide.clrMap!=null)clrMap=masterSlide.clrMap.color_map;else clrMap=AscFormat.DEFAULT_COLOR_MAP.color_map;if(clrMap[this.id]!=null&&theme.themeElements.clrScheme.colors[clrMap[this.id]]!=null&&theme.themeElements.clrScheme.colors[clrMap[this.id]].color!= null)this.RGBA=theme.themeElements.clrScheme.colors[clrMap[this.id]].color.RGBA;else if(theme.themeElements.clrScheme.colors[this.id]!=null&&theme.themeElements.clrScheme.colors[this.id].color!=null)this.RGBA=theme.themeElements.clrScheme.colors[this.id].color.RGBA}}};function CUniColor(){this.color=null;this.Mods=null;this.RGBA={R:0,G:0,B:0,A:255}}CUniColor.prototype={checkPhColor:function(unicolor){if(this.color&&this.color.type===c_oAscColor.COLOR_TYPE_SCHEME&&this.color.id===14)if(unicolor){if(unicolor.color)this.color= unicolor.color.createDuplicate();if(unicolor.Mods)this.Mods=unicolor.Mods.createDuplicate()}},saveSourceFormatting:function(){var _ret=new CUniColor;_ret.color=new CRGBColor;_ret.color.RGBA.R=this.RGBA.R;_ret.color.RGBA.G=this.RGBA.G;_ret.color.RGBA.B=this.RGBA.B;return _ret},addColorMod:function(mod){if(!this.Mods)this.Mods=new CColorModifiers;this.Mods.addMod(mod.createDuplicate())},check:function(theme,colorMap){if(this.color&&this.color.check(theme,colorMap.color_map)){this.RGBA.R=this.color.RGBA.R; this.RGBA.G=this.color.RGBA.G;this.RGBA.B=this.color.RGBA.B;if(this.Mods)this.Mods.Apply(this.RGBA)}},getModValue:function(sModName){if(this.Mods&&this.Mods.getModValue)return this.Mods.getModValue(sModName);return null},checkWordMods:function(){return this.Mods&&this.Mods.Mods.length===1&&(this.Mods.Mods[0].name==="wordTint"||this.Mods.Mods[0].name==="wordShade")},convertToPPTXMods:function(){if(this.checkWordMods()){var val_,mod_;if(this.Mods.Mods[0].name==="wordShade"){mod_=new CColorMod;mod_.setName("lumMod"); mod_.setVal(this.Mods.Mods[0].val/255*1E5>>0);this.Mods.Mods.splice(0,this.Mods.Mods.length);this.Mods.Mods.push(mod_)}else{val_=this.Mods.Mods[0].val/255*1E5>>0;this.Mods.Mods.splice(0,this.Mods.Mods.length);mod_=new CColorMod;mod_.setName("lumMod");mod_.setVal(val_);this.Mods.Mods.push(mod_);mod_=new CColorMod;mod_.setName("lumOff");mod_.setVal(1E5-val_);this.Mods.Mods.push(mod_)}}},canConvertPPTXModsToWord:function(){return this.Mods&&(this.Mods.Mods.length===1&&this.Mods.Mods[0].name==="lumMod"&& this.Mods.Mods[0].val>0||this.Mods.Mods.length===2&&this.Mods.Mods[0].name==="lumMod"&&this.Mods.Mods[0].val>0&&this.Mods.Mods[1].name==="lumOff"&&this.Mods.Mods[1].val>0)},convertToWordMods:function(){if(this.canConvertPPTXModsToWord()){var mod_=new CColorMod;mod_.setName(this.Mods.Mods.length===1?"wordShade":"wordTint");mod_.setVal(this.Mods.Mods[0].val*255/1E5>>0);this.Mods.Mods.splice(0,this.Mods.Mods.length);this.Mods.Mods.push(mod_)}},getObjectType:function(){return AscDFH.historyitem_type_UniColor}, setColor:function(color){this.color=color},setMods:function(mods){this.Mods=mods},Write_ToBinary:function(w){if(this.color){w.WriteBool(true);this.color.Write_ToBinary(w)}else w.WriteBool(false);if(this.Mods){w.WriteBool(true);this.Mods.Write_ToBinary(w)}else w.WriteBool(false)},Read_FromBinary:function(r){if(r.GetBool()){var type=r.GetLong();switch(type){case c_oAscColor.COLOR_TYPE_NONE:{break}case c_oAscColor.COLOR_TYPE_SRGB:{this.color=new CRGBColor;this.color.Read_FromBinary(r);break}case c_oAscColor.COLOR_TYPE_PRST:{this.color= new CPrstColor;this.color.Read_FromBinary(r);break}case c_oAscColor.COLOR_TYPE_SCHEME:{this.color=new CSchemeColor;this.color.Read_FromBinary(r);break}case c_oAscColor.COLOR_TYPE_SYS:{this.color=new CSysColor;this.color.Read_FromBinary(r);break}}}if(r.GetBool()){this.Mods=new CColorModifiers;this.Mods.Read_FromBinary(r)}else this.Mods=null},createDuplicate:function(){var duplicate=new CUniColor;if(this.color!=null)duplicate.color=this.color.createDuplicate();if(this.Mods)duplicate.Mods=this.Mods.createDuplicate(); duplicate.RGBA.R=this.RGBA.R;duplicate.RGBA.G=this.RGBA.G;duplicate.RGBA.B=this.RGBA.B;duplicate.RGBA.A=this.RGBA.A;return duplicate},IsIdentical:function(unicolor){if(!isRealObject(unicolor))return false;if(!isRealObject(unicolor.color)&&isRealObject(this.color)||!isRealObject(this.color)&&isRealObject(unicolor.color)||isRealObject(this.color)&&!this.color.IsIdentical(unicolor.color))return false;if(!isRealObject(unicolor.Mods)&&isRealObject(this.Mods)&&this.Mods.Mods.length>0||!isRealObject(this.Mods)&& isRealObject(unicolor.Mods)&&unicolor.Mods.Mods.length>0||isRealObject(this.Mods)&&!this.Mods.IsIdentical(unicolor.Mods))return false;return true},Calculate:function(theme,slide,layout,masterSlide,RGBA,colorMap){if(this.color==null)return this.RGBA;this.color.Calculate(theme,slide,layout,masterSlide,RGBA,colorMap);this.RGBA={R:this.color.RGBA.R,G:this.color.RGBA.G,B:this.color.RGBA.B,A:this.color.RGBA.A};if(this.Mods)this.Mods.Apply(this.RGBA)},compare:function(unicolor){if(unicolor==null)return null; var _ret=new CUniColor;if(this.color==null||unicolor.color==null||this.color.type!==unicolor.color.type)return _ret;if(this.Mods&&unicolor.Mods){var aMods=this.Mods.Mods;var aMods2=unicolor.Mods.Mods;if(aMods.length===aMods2.length){for(var i=0;i<aMods.length;++i)if(aMods2[i].name!==aMods[i].name||aMods2[i].val!==aMods[i].val)break;if(i===aMods.length)_ret.Mods=this.Mods.createDuplicate()}}switch(this.color.type){case c_oAscColor.COLOR_TYPE_NONE:{break}case c_oAscColor.COLOR_TYPE_PRST:{_ret.color= new CPrstColor;if(unicolor.color.id==this.color.id){_ret.color.id=this.color.id;_ret.color.RGBA.R=this.color.RGBA.R;_ret.color.RGBA.G=this.color.RGBA.G;_ret.color.RGBA.B=this.color.RGBA.B;_ret.color.RGBA.A=this.color.RGBA.A;_ret.RGBA.R=this.RGBA.R;_ret.RGBA.G=this.RGBA.G;_ret.RGBA.B=this.RGBA.B;_ret.RGBA.A=this.RGBA.A}break}case c_oAscColor.COLOR_TYPE_SCHEME:{_ret.color=new CSchemeColor;if(unicolor.color.id==this.color.id){_ret.color.id=this.color.id;_ret.color.RGBA.R=this.color.RGBA.R;_ret.color.RGBA.G= this.color.RGBA.G;_ret.color.RGBA.B=this.color.RGBA.B;_ret.color.RGBA.A=this.color.RGBA.A;_ret.RGBA.R=this.RGBA.R;_ret.RGBA.G=this.RGBA.G;_ret.RGBA.B=this.RGBA.B;_ret.RGBA.A=this.RGBA.A}break}case c_oAscColor.COLOR_TYPE_SRGB:{_ret.color=new CRGBColor;var _RGBA1=this.color.RGBA;var _RGBA2=this.color.RGBA;if(_RGBA1.R===_RGBA2.R&&_RGBA1.G===_RGBA2.G&&_RGBA1.B===_RGBA2.B){_ret.color.RGBA.R=this.color.RGBA.R;_ret.color.RGBA.G=this.color.RGBA.G;_ret.color.RGBA.B=this.color.RGBA.B;_ret.RGBA.R=this.RGBA.R; _ret.RGBA.G=this.RGBA.G;_ret.RGBA.B=this.RGBA.B}if(_RGBA1.A===_RGBA2.A)_ret.color.RGBA.A=this.color.RGBA.A;break}case c_oAscColor.COLOR_TYPE_SYS:{_ret.color=new CSysColor;if(unicolor.color.id==this.color.id){_ret.color.id=this.color.id;_ret.color.RGBA.R=this.color.RGBA.R;_ret.color.RGBA.G=this.color.RGBA.G;_ret.color.RGBA.B=this.color.RGBA.B;_ret.color.RGBA.A=this.color.RGBA.A;_ret.RGBA.R=this.RGBA.R;_ret.RGBA.G=this.RGBA.G;_ret.RGBA.B=this.RGBA.B;_ret.RGBA.A=this.RGBA.A}break}}return _ret},getCSSColor:function(transparent){if(transparent!= null){var _css="rgba("+this.RGBA.R+","+this.RGBA.G+","+this.RGBA.B+",1)";return _css}var _css="rgba("+this.RGBA.R+","+this.RGBA.G+","+this.RGBA.B+","+this.RGBA.A/255+")";return _css}};function CreateUniColorRGB(r,g,b){var ret=new CUniColor;ret.setColor(new CRGBColor);ret.color.setColor(r,g,b);return ret}function CreateUniColorRGB2(color){var ret=new CUniColor;ret.setColor(new CRGBColor);ret.color.setColor(ret.RGBA.R=color.getR(),ret.RGBA.G=color.getG(),ret.RGBA.B=color.getB());return ret}function CreteSolidFillRGB(r, g,b){var ret=new CUniFill;ret.setFill(new CSolidFill);ret.fill.setColor(new CUniColor);var _uni_color=ret.fill.color;_uni_color.setColor(new CRGBColor);_uni_color.color.setColor(r,g,b);return ret}function CreateSolidFillRGBA(r,g,b,a){var ret=new CUniFill;ret.setFill(new CSolidFill);ret.fill.setColor(new CUniColor);var _uni_color=ret.fill.color;_uni_color.setColor(new CRGBColor);_uni_color.color.setColor(r,g,b);_uni_color.RGBA.R=r;_uni_color.RGBA.G=g;_uni_color.RGBA.B=b;_uni_color.RGBA.A=a;return ret} function CSrcRect(){this.l=null;this.t=null;this.r=null;this.b=null}CSrcRect.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_SrcRect},setLTRB:function(l,t,r,b){this.l=l;this.t=t;this.r=r;this.b=b},Write_ToBinary:function(w){writeDouble(w,this.l);writeDouble(w,this.t);writeDouble(w,this.r);writeDouble(w,this.b)},Read_FromBinary:function(r){this.l=readDouble(r);this.t=readDouble(r);this.r=readDouble(r);this.b=readDouble(r)}, createDublicate:function(){var _ret=new CSrcRect;_ret.l=this.l;_ret.t=this.t;_ret.r=this.r;_ret.b=this.b;return _ret}};function CBlipFillTile(){this.tx=null;this.ty=null;this.sx=null;this.sy=null;this.flip=null;this.algn=null}CBlipFillTile.prototype.Write_ToBinary=function(w){writeLong(w,this.tx);writeLong(w,this.ty);writeLong(w,this.sx);writeLong(w,this.sy);writeLong(w,this.flip);writeLong(w,this.algn)};CBlipFillTile.prototype.Read_FromBinary=function(r){this.tx=readLong(r);this.ty=readLong(r);this.sx= readLong(r);this.sy=readLong(r);this.flip=readLong(r);this.algn=readLong(r)};CBlipFillTile.prototype.createDuplicate=function(){var ret=new CBlipFillTile;ret.tx=this.tx;ret.ty=this.ty;ret.sx=this.sx;ret.sy=this.sy;ret.flip=this.flip;ret.algn=this.algn;return ret};CBlipFillTile.prototype.IsIdentical=function(o){if(!o)return false;return o.tx==this.tx&&o.ty==this.ty&&o.sx==this.sx&&o.sy==this.sy&&o.flip==this.flip&&o.algn==this.algn};function CBlipFill(){this.type=c_oAscFill.FILL_TYPE_BLIP;this.RasterImageId= "";this.srcRect=null;this.stretch=null;this.tile=null;this.rotWithShape=null;this.Effects=[]}CBlipFill.prototype={Get_Id:function(){return this.Id},saveSourceFormatting:function(){return this.createDuplicate()},Write_ToBinary:function(w){writeString(w,this.RasterImageId);if(this.srcRect){writeBool(w,true);writeDouble(w,this.srcRect.l);writeDouble(w,this.srcRect.t);writeDouble(w,this.srcRect.r);writeDouble(w,this.srcRect.b)}else writeBool(w,false);writeBool(w,this.stretch);if(isRealObject(this.tile)){w.WriteBool(true); this.tile.Write_ToBinary(w)}else w.WriteBool(false);writeBool(w,this.rotWithShape);w.WriteLong(this.Effects.length);for(var i=0;i<this.Effects.length;++i)this.Effects[i].Write_ToBinary(w)},Read_FromBinary:function(r){this.RasterImageId=readString(r);var _correct_id=AscCommon.getImageFromChanges(this.RasterImageId);if(null!=_correct_id)this.RasterImageId=_correct_id;if(readBool(r)){this.srcRect=new CSrcRect;this.srcRect.l=readDouble(r);this.srcRect.t=readDouble(r);this.srcRect.r=readDouble(r);this.srcRect.b= readDouble(r)}else this.srcRect=null;this.stretch=readBool(r);if(r.GetBool()){this.tile=new CBlipFillTile;this.tile.Read_FromBinary(r)}else this.tile=null;this.rotWithShape=readBool(r);var count=r.GetLong();for(var i=0;i<count;++i){var effect=fReadEffect(r);if(!effect)break;this.Effects.push(effect)}},Refresh_RecalcData:function(){},check:function(){},checkWordMods:function(){return false},convertToPPTXMods:function(){},canConvertPPTXModsToWord:function(){return false},convertToWordMods:function(){}, getObjectType:function(){return AscDFH.historyitem_type_BlipFill},setRasterImageId:function(rasterImageId){this.RasterImageId=checkRasterImageId(rasterImageId)},setSrcRect:function(srcRect){this.srcRect=srcRect},setStretch:function(stretch){this.stretch=stretch},setTile:function(tile){this.tile=tile},setRotWithShape:function(rotWithShape){this.rotWithShape=rotWithShape},createDuplicate:function(){var duplicate=new CBlipFill;duplicate.RasterImageId=this.RasterImageId;duplicate.stretch=this.stretch; if(isRealObject(this.tile))duplicate.tile=this.tile.createDuplicate();if(null!=this.srcRect)duplicate.srcRect=this.srcRect.createDublicate();duplicate.rotWithShape=this.rotWithShape;if(Array.isArray(this.Effects))for(var i=0;i<this.Effects.length;++i)if(this.Effects[i]&&this.Effects[i].createDuplicate)duplicate.Effects.push(this.Effects[i].createDuplicate());return duplicate},IsIdentical:function(fill){if(fill==null)return false;if(fill.type!=c_oAscFill.FILL_TYPE_BLIP)return false;if(fill.RasterImageId!= this.RasterImageId)return false;if(fill.stretch!=this.stretch)return false;if(isRealObject(this.tile)){if(!this.tile.IsIdentical(fill.tile))return false}else if(fill.tile)return false;return true},compare:function(fill){if(fill==null||fill.type!==c_oAscFill.FILL_TYPE_BLIP)return null;var _ret=new CBlipFill;if(this.RasterImageId==fill.RasterImageId)_ret.RasterImageId=this.RasterImageId;if(fill.stretch==this.stretch)_ret.stretch=this.stretch;if(isRealObject(fill.tile))if(fill.tile.IsIdentical(this.tile))_ret.tile= this.tile.createDuplicate();else _ret.tile=new CBlipFillTile;if(fill.rotWithShape===this.rotWithShape)_ret.rotWithShape=this.rotWithShape;return _ret}};var EFFECT_TYPE_NONE=0;var EFFECT_TYPE_OUTERSHDW=1;var EFFECT_TYPE_GLOW=2;var EFFECT_TYPE_DUOTONE=3;var EFFECT_TYPE_XFRM=4;var EFFECT_TYPE_BLUR=5;var EFFECT_TYPE_PRSTSHDW=6;var EFFECT_TYPE_INNERSHDW=7;var EFFECT_TYPE_REFLECTION=8;var EFFECT_TYPE_SOFTEDGE=9;var EFFECT_TYPE_FILLOVERLAY=10;var EFFECT_TYPE_ALPHACEILING=11;var EFFECT_TYPE_ALPHAFLOOR=12; var EFFECT_TYPE_TINTEFFECT=13;var EFFECT_TYPE_RELOFF=14;var EFFECT_TYPE_LUM=15;var EFFECT_TYPE_HSL=16;var EFFECT_TYPE_GRAYSCL=17;var EFFECT_TYPE_ELEMENT=18;var EFFECT_TYPE_ALPHAREPL=19;var EFFECT_TYPE_ALPHAOUTSET=20;var EFFECT_TYPE_ALPHAMODFIX=21;var EFFECT_TYPE_ALPHABILEVEL=22;var EFFECT_TYPE_BILEVEL=23;var EFFECT_TYPE_DAG=24;var EFFECT_TYPE_FILL=25;var EFFECT_TYPE_CLRREPL=26;var EFFECT_TYPE_CLRCHANGE=27;var EFFECT_TYPE_ALPHAINV=28;var EFFECT_TYPE_ALPHAMOD=29;var EFFECT_TYPE_BLEND=30;function fCreateEffectByType(type){var ret= null;switch(type){case EFFECT_TYPE_NONE:{break}case EFFECT_TYPE_OUTERSHDW:{ret=new COuterShdw;break}case EFFECT_TYPE_GLOW:{ret=new CGlow;break}case EFFECT_TYPE_DUOTONE:{ret=new CDuotone;break}case EFFECT_TYPE_XFRM:{ret=new CXfrmEffect;break}case EFFECT_TYPE_BLUR:{ret=new CBlur;break}case EFFECT_TYPE_PRSTSHDW:{ret=new CPrstShdw;break}case EFFECT_TYPE_INNERSHDW:{ret=new CInnerShdw;break}case EFFECT_TYPE_REFLECTION:{ret=new CReflection;break}case EFFECT_TYPE_SOFTEDGE:{ret=new CSoftEdge;break}case EFFECT_TYPE_FILLOVERLAY:{ret= new CFillOverlay;break}case EFFECT_TYPE_ALPHACEILING:{ret=new CAlphaCeiling;break}case EFFECT_TYPE_ALPHAFLOOR:{ret=new CAlphaFloor;break}case EFFECT_TYPE_TINTEFFECT:{ret=new CTintEffect;break}case EFFECT_TYPE_RELOFF:{ret=new CRelOff;break}case EFFECT_TYPE_LUM:{ret=new CLumEffect;break}case EFFECT_TYPE_HSL:{ret=new CHslEffect;break}case EFFECT_TYPE_GRAYSCL:{ret=new CGrayscl;break}case EFFECT_TYPE_ELEMENT:{ret=new CEffectElement;break}case EFFECT_TYPE_ALPHAREPL:{ret=new CAlphaRepl;break}case EFFECT_TYPE_ALPHAOUTSET:{ret= new CAlphaOutset;break}case EFFECT_TYPE_ALPHAMODFIX:{ret=new CAlphaModFix;break}case EFFECT_TYPE_ALPHABILEVEL:{ret=new CAlphaBiLevel;break}case EFFECT_TYPE_BILEVEL:{ret=new CBiLevel;break}case EFFECT_TYPE_DAG:{ret=new CEffectContainer;break}case EFFECT_TYPE_FILL:{ret=new CFillEffect;break}case EFFECT_TYPE_CLRREPL:{ret=new CClrRepl;break}case EFFECT_TYPE_CLRCHANGE:{ret=new CClrChange;break}case EFFECT_TYPE_ALPHAINV:{ret=new CAlphaInv;break}case EFFECT_TYPE_ALPHAMOD:{ret=new CAlphaMod;break}case EFFECT_TYPE_BLEND:{ret= new CBlend;break}}return ret}function fReadEffect(r){var type=r.GetLong();var ret=fCreateEffectByType(type);ret.Read_FromBinary(r);return ret}function CAlphaBiLevel(){this.tresh=0}CAlphaBiLevel.prototype.Type=EFFECT_TYPE_ALPHABILEVEL;CAlphaBiLevel.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ALPHABILEVEL);w.WriteLong(this.tresh)};CAlphaBiLevel.prototype.Read_FromBinary=function(r){this.tresh=r.GetLong()};CAlphaBiLevel.prototype.createDuplicate=function(){var oCopy=new CAlphaBiLevel; oCopy.tresh=this.tresh;return oCopy};function CAlphaCeiling(){}CAlphaCeiling.prototype.Type=EFFECT_TYPE_ALPHACEILING;CAlphaCeiling.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ALPHACEILING)};CAlphaCeiling.prototype.Read_FromBinary=function(r){};CAlphaCeiling.prototype.createDuplicate=function(){var oCopy=new CAlphaCeiling;return oCopy};function CAlphaFloor(){}CAlphaFloor.prototype.Type=EFFECT_TYPE_ALPHAFLOOR;CAlphaFloor.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ALPHAFLOOR)}; CAlphaFloor.prototype.Read_FromBinary=function(r){};CAlphaFloor.prototype.createDuplicate=function(){var oCopy=new CAlphaFloor;return oCopy};function CAlphaInv(){this.unicolor=null}CAlphaInv.prototype.Type=EFFECT_TYPE_ALPHAINV;CAlphaInv.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ALPHAINV);if(this.unicolor){w.WriteBool(true);this.unicolor.Write_ToBinary(w)}else w.WriteBool(false)};CAlphaInv.prototype.Read_FromBinary=function(r){if(r.GetBool()){this.unicolor=new CUniColor;this.unicolor.Read_FromBinary(r)}}; CAlphaInv.prototype.createDuplicate=function(){var oCopy=new CAlphaInv;if(this.unicolor)oCopy.unicolor=this.unicolor.createDuplicate();return oCopy};var effectcontainertypeSib=0;var effectcontainertypeTree=1;function CEffectContainer(){this.type=null;this.name=null;this.effectList=[]}CEffectContainer.prototype.Type=EFFECT_TYPE_DAG;CEffectContainer.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_DAG);writeLong(w,this.type);writeString(w,this.name);w.WriteLong(this.effectList.length);for(var i= 0;i<this.effectList.length;++i)this.effectList[i].Write_ToBinary(w)};CEffectContainer.prototype.Read_FromBinary=function(r){this.type=readLong(r);this.name=readString(r);var count=r.GetLong();for(var i=0;i<count;++i){var effect=fReadEffect(r);if(!effect)break;this.effectList.push(effect)}};CEffectContainer.prototype.createDuplicate=function(){var oCopy=new CEffectContainer;oCopy.type=this.type;oCopy.name=this.name;for(var i=0;i<this.effectList.length;++i)oCopy.effectList.push(this.effectList[i].createDuplicate()); return oCopy};function CAlphaMod(){this.cont=new CEffectContainer}CAlphaMod.prototype.Type=EFFECT_TYPE_ALPHAMOD;CAlphaMod.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ALPHAMOD);this.cont.Write_ToBinary(w)};CAlphaMod.prototype.Read_FromBinary=function(r){this.cont.Read_FromBinary(r)};CAlphaMod.prototype.createDuplicate=function(){var oCopy=new CAlphaMod;oCopy.cont=this.cont.createDuplicate();return oCopy};function CAlphaModFix(){this.amt=null}CAlphaModFix.prototype.Type=EFFECT_TYPE_ALPHAMODFIX; CAlphaModFix.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ALPHAMODFIX);writeLong(w,this.amt)};CAlphaModFix.prototype.Read_FromBinary=function(r){this.amt=readLong(r)};CAlphaModFix.prototype.createDuplicate=function(){var oCopy=new CAlphaModFix;oCopy.amt=this.amt;return oCopy};function CAlphaOutset(){this.rad=null}CAlphaOutset.prototype.Type=EFFECT_TYPE_ALPHAOUTSET;CAlphaOutset.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ALPHAOUTSET);writeLong(w,this.rad)};CAlphaOutset.prototype.Read_FromBinary= function(r){this.rad=readLong(r)};CAlphaOutset.prototype.createDuplicate=function(){var oCopy=new CAlphaOutset;oCopy.rad=this.rad;return oCopy};function CAlphaRepl(){this.a=null}CAlphaRepl.prototype.Type=EFFECT_TYPE_ALPHAREPL;CAlphaRepl.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ALPHAREPL);writeLong(w,this.a)};CAlphaRepl.prototype.Read_FromBinary=function(r){this.a=readLong(r)};CAlphaRepl.prototype.createDuplicate=function(){var oCopy=new CAlphaRepl;oCopy.a=this.a;return oCopy}; function CBiLevel(){this.thresh=null}CBiLevel.prototype.Type=EFFECT_TYPE_BILEVEL;CBiLevel.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_BILEVEL);writeLong(w,this.thresh)};CBiLevel.prototype.Read_FromBinary=function(r){this.thresh=readLong(r)};CBiLevel.prototype.createDuplicate=function(){var oCopy=new CBiLevel;oCopy.thresh=this.thresh;return oCopy};var blendmodeDarken=0;var blendmodeLighten=1;var blendmodeMult=2;var blendmodeOver=3;var blendmodeScreen=4;function CBlend(){this.blend= null;this.cont=new CEffectContainer}CBlend.prototype.Type=EFFECT_TYPE_BLEND;CBlend.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_BLEND);writeLong(w,this.blend);this.cont.Write_ToBinary(w)};CBlend.prototype.Read_FromBinary=function(r){this.blend=readLong(r);this.cont.Read_FromBinary(r)};CBlend.prototype.createDuplicate=function(){var oCopy=new CBlend;oCopy.blend=this.blend;oCopy.cont=this.cont.createDuplicate();return oCopy};function CBlur(){this.rad=null;this.grow=null}CBlur.prototype.Type= EFFECT_TYPE_BLUR;CBlur.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_BLUR);writeLong(w,this.rad);writeBool(w,this.grow)};CBlur.prototype.Read_FromBinary=function(r){this.rad=readLong(r);this.grow=readBool(r)};CBlur.prototype.createDuplicate=function(){var oCopy=new CBlur;oCopy.rad=this.rad;oCopy.grow=this.grow;return oCopy};function CClrChange(){this.clrFrom=new CUniColor;this.clrTo=new CUniColor;this.useA=null}CClrChange.prototype.Type=EFFECT_TYPE_CLRCHANGE;CClrChange.prototype.Write_ToBinary= function(w){w.WriteLong(EFFECT_TYPE_CLRCHANGE);this.clrFrom.Write_ToBinary(w);this.clrTo.Write_ToBinary(w);writeBool(w,this.useA)};CClrChange.prototype.Read_FromBinary=function(r){this.clrFrom.Read_FromBinary(r);this.clrTo.Read_FromBinary(r);this.useA=readBool(r)};CClrChange.prototype.createDuplicate=function(){var oCopy=new CClrChange;oCopy.clrFrom=this.clrFrom.createDuplicate();oCopy.clrTo=this.clrTo.createDuplicate();oCopy.useA=this.useA;return oCopy};function CClrRepl(){this.color=new CUniColor} CClrRepl.prototype.Type=EFFECT_TYPE_CLRREPL;CClrRepl.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_CLRREPL);this.color.Write_ToBinary(w)};CClrRepl.prototype.Read_FromBinary=function(r){this.color.Read_FromBinary(r)};CClrRepl.prototype.createDuplicate=function(){var oCopy=new CClrRepl;oCopy.color=this.color.createDuplicate();return oCopy};function CDuotone(){this.colors=[]}CDuotone.prototype.Type=EFFECT_TYPE_DUOTONE;CDuotone.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_DUOTONE); w.WriteLong(this.colors.length);for(var i=0;i<this.colors.length;++i)this.colors[i].Write_ToBinary(w)};CDuotone.prototype.Read_FromBinary=function(r){var count=r.GetLong();for(var i=0;i<count;++i){this.colors[i]=new CUniColor;this.colors[i].Read_FromBinary(r)}};CDuotone.prototype.createDuplicate=function(){var oCopy=new CDuotone;for(var i=0;i<this.colors.length;++i)oCopy.colors[i]=this.colors[i].createDuplicate();return oCopy};function CEffectElement(){this.ref=null}CEffectElement.prototype.Type= EFFECT_TYPE_ELEMENT;CEffectElement.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_ELEMENT);writeString(w,this.ref)};CEffectElement.prototype.Read_FromBinary=function(r){this.ref=readString(r)};CEffectElement.prototype.createDuplicate=function(){var oCopy=new CEffectElement;oCopy.ref=this.ref;return oCopy};function CFillEffect(){this.fill=new CUniFill}CFillEffect.prototype.Type=EFFECT_TYPE_FILL;CFillEffect.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_FILL);this.fill.Write_ToBinary(w)}; CFillEffect.prototype.Read_FromBinary=function(r){this.fill.Read_FromBinary(r)};CFillEffect.prototype.createDuplicate=function(){var oCopy=new CFillEffect;oCopy.fill=this.fill.createDuplicate();return oCopy};function CFillOverlay(){this.fill=new CUniFill;this.blend=0}CFillOverlay.prototype.Type=EFFECT_TYPE_FILLOVERLAY;CFillOverlay.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_FILLOVERLAY);this.fill.Write_ToBinary(w);w.WriteLong(this.blend)};CFillOverlay.prototype.Read_FromBinary=function(r){this.fill.Read_FromBinary(r); this.blend=r.GetLong()};CFillOverlay.prototype.createDuplicate=function(){var oCopy=new CFillOverlay;oCopy.fill=this.fill.createDuplicate();oCopy.blend=this.blend;return oCopy};function CGlow(){this.color=new CUniColor;this.rad=null}CGlow.prototype.Type=EFFECT_TYPE_GLOW;CGlow.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_GLOW);this.color.Write_ToBinary(w);writeLong(w,this.rad)};CGlow.prototype.Read_FromBinary=function(r){this.color.Read_FromBinary(r);this.rad=readLong(r)};CGlow.prototype.createDuplicate= function(){var oCopy=new CGlow;oCopy.color=this.color.createDuplicate();oCopy.rad=this.rad;return oCopy};function CGrayscl(){}CGrayscl.prototype.Type=EFFECT_TYPE_GRAYSCL;CGrayscl.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_GRAYSCL)};CGrayscl.prototype.Read_FromBinary=function(r){};CGrayscl.prototype.createDuplicate=function(){var oCopy=new CGrayscl;return oCopy};function CHslEffect(){this.h=null;this.s=null;this.l=null}CHslEffect.prototype.Type=EFFECT_TYPE_HSL;CHslEffect.prototype.Write_ToBinary= function(w){w.WriteLong(EFFECT_TYPE_HSL);writeLong(w,this.h);writeLong(w,this.s);writeLong(w,this.l)};CHslEffect.prototype.Read_FromBinary=function(r){this.h=readLong(r);this.s=readLong(r);this.l=readLong(r)};CHslEffect.prototype.createDuplicate=function(){var oCopy=new CHslEffect;oCopy.h=this.h;oCopy.s=this.s;oCopy.l=this.l;return oCopy};function CInnerShdw(){this.color=new CUniColor;this.blurRad=null;this.dir=null;this.dist=null}CInnerShdw.prototype.Type=EFFECT_TYPE_INNERSHDW;CInnerShdw.prototype.Write_ToBinary= function(w){w.WriteLong(EFFECT_TYPE_INNERSHDW);this.color.Write_ToBinary(w);writeLong(w,this.blurRad);writeLong(w,this.dir);writeLong(w,this.dist)};CInnerShdw.prototype.Read_FromBinary=function(r){this.color.Read_FromBinary(r);this.blurRad=readLong(r);this.dir=readLong(r);this.dist=readLong(r)};CInnerShdw.prototype.createDuplicate=function(){var oCopy=new CInnerShdw;oCopy.color=oCopy.color.createDuplicate();oCopy.blurRad=this.blurRad;oCopy.dir=this.dir;oCopy.dist=this.dist;return oCopy};function CLumEffect(){this.bright= null;this.contrast=null}CLumEffect.prototype.Type=EFFECT_TYPE_LUM;CLumEffect.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_LUM);writeLong(w,this.bright);writeLong(w,this.contrast)};CLumEffect.prototype.Read_FromBinary=function(r){this.bright=readLong(r);this.contrast=readLong(r)};CLumEffect.prototype.createDuplicate=function(){var oCopy=new CLumEffect;oCopy.bright=this.bright;oCopy.contrast=this.contrast;return oCopy};function COuterShdw(){this.color=new CUniColor;this.algn=null;this.blurRad= null;this.dir=null;this.dist=null;this.kx=null;this.ky=null;this.rotWithShape=null;this.sx=null;this.sy=null}COuterShdw.prototype.Type=EFFECT_TYPE_OUTERSHDW;COuterShdw.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_OUTERSHDW);this.color.Write_ToBinary(w);writeLong(w,this.algn);writeLong(w,this.blurRad);writeLong(w,this.dir);writeLong(w,this.dist);writeLong(w,this.kx);writeLong(w,this.ky);writeBool(w,this.rotWithShape);writeLong(w,this.sx);writeLong(w,this.sy)};COuterShdw.prototype.Read_FromBinary= function(r){this.color.Read_FromBinary(r);this.algn=readLong(r);this.blurRad=readLong(r);this.dir=readLong(r);this.dist=readLong(r);this.kx=readLong(r);this.ky=readLong(r);this.rotWithShape=readBool(r);this.sx=readLong(r);this.sy=readLong(r)};COuterShdw.prototype.createDuplicate=function(){var oCopy=new COuterShdw;oCopy.color=this.color.createDuplicate();oCopy.algn=this.algn;oCopy.blurRad=this.blurRad;oCopy.dir=this.dir;oCopy.dist=this.dist;oCopy.kx=this.kx;oCopy.ky=this.ky;oCopy.rotWithShape=this.rotWithShape; oCopy.sx=this.sx;oCopy.sy=this.sy;return oCopy};COuterShdw.prototype.IsIdentical=function(other){if(!other)return false;if(!this.color&&other.color||this.color&&!other.color||!this.color.IsIdentical(other.color))return false;if(other.algn!==this.algn||other.blurRad!==this.blurRad||other.dir!==this.dir||other.dist!==this.dist||other.kx!==this.kx||other.ky!==this.ky||other.rotWithShape!==this.rotWithShape||other.sx!==this.sx||other.sy!==this.sy)return false;return true};function asc_CShadowProperty(){COuterShdw.call(this); this.algn=7;this.blurRad=50800;this.color=new CUniColor;this.color.color=new CPrstColor;this.color.color.id="black";this.color.Mods=new CColorModifiers;var oMod=new CColorMod;oMod.name="alpha";oMod.val=4E4;this.color.Mods.Mods.push(oMod);this.dir=27E5;this.dist=38100;this.rotWithShape=false}asc_CShadowProperty.prototype=Object.create(COuterShdw.prototype);asc_CShadowProperty.prototype.constructor=asc_CShadowProperty;window["Asc"]=window["Asc"]||{};window["Asc"]["asc_CShadowProperty"]=window["Asc"].asc_CShadowProperty= asc_CShadowProperty;function CPrstShdw(){this.color=new CUniColor;this.prst=null;this.dir=null;this.dis=null}CPrstShdw.prototype.Type=EFFECT_TYPE_PRSTSHDW;CPrstShdw.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_PRSTSHDW);this.color.Write_ToBinary(w);writeLong(w,this.prst);writeLong(w,this.dir);writeLong(w,this.dis)};CPrstShdw.prototype.Read_FromBinary=function(r){this.color.Read_FromBinary(r);this.prst=readLong(r);this.dir=readLong(r);this.dis=readLong(r)};CPrstShdw.prototype.createDuplicate= function(){var oCopy=new CPrstShdw;oCopy.color=this.color.createDuplicate();oCopy.prst=this.prst;oCopy.dir=this.dir;oCopy.dis=this.dis;return oCopy};function CReflection(){this.algn=null;this.blurRad=null;this.stA=null;this.endA=null;this.stPos=null;this.endPos=null;this.dir=null;this.fadeDir=null;this.dist=null;this.kx=null;this.ky=null;this.rotWithShape=null;this.sx=null;this.sy=null}CReflection.prototype.Type=EFFECT_TYPE_REFLECTION;CReflection.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_REFLECTION); writeLong(w,this.algn);writeLong(w,this.blurRad);writeLong(w,this.stA);writeLong(w,this.endA);writeLong(w,this.stPos);writeLong(w,this.endPos);writeLong(w,this.dir);writeLong(w,this.fadeDir);writeLong(w,this.dist);writeLong(w,this.kx);writeLong(w,this.ky);writeBool(w,this.rotWithShape);writeLong(w,this.sx);writeLong(w,this.sy)};CReflection.prototype.Read_FromBinary=function(r){this.algn=readLong(r);this.blurRad=readLong(r);this.stA=readLong(r);this.endA=readLong(r);this.stPos=readLong(r);this.endPos= readLong(r);this.dir=readLong(r);this.fadeDir=readLong(r);this.dist=readLong(r);this.kx=readLong(r);this.ky=readLong(r);this.rotWithShape=readBool(r);this.sx=readLong(r);this.sy=readLong(r)};CReflection.prototype.createDuplicate=function(){var oCopy=new CReflection;oCopy.algn=this.algn;oCopy.blurRad=this.blurRad;oCopy.stA=this.stA;oCopy.endA=this.endA;oCopy.stPos=this.stPos;oCopy.endPos=this.endPos;oCopy.dir=this.dir;oCopy.fadeDir=this.fadeDir;oCopy.dist=this.dist;oCopy.kx=this.kx;oCopy.ky=this.ky; oCopy.rotWithShape=this.rotWithShape;oCopy.sx=this.sx;oCopy.sy=this.sy;return oCopy};function CRelOff(){this.tx=null;this.ty=null}CRelOff.prototype.Type=EFFECT_TYPE_RELOFF;CRelOff.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_RELOFF);writeLong(w,this.tx);writeLong(w,this.ty)};CRelOff.prototype.Read_FromBinary=function(r){this.tx=readLong(r);this.ty=readLong(r)};CRelOff.prototype.createDuplicate=function(){var oCopy=new CRelOff;oCopy.tx=this.tx;oCopy.ty=this.ty;return oCopy};function CSoftEdge(){this.rad= null}CSoftEdge.prototype.Type=EFFECT_TYPE_SOFTEDGE;CSoftEdge.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_SOFTEDGE);writeLong(w,this.rad)};CSoftEdge.prototype.Read_FromBinary=function(r){this.rad=readLong(r)};CSoftEdge.prototype.createDuplicate=function(){var oCopy=new CSoftEdge;oCopy.rad=this.rad;return oCopy};function CTintEffect(){this.amt=null;this.hue=null}CTintEffect.prototype.Type=EFFECT_TYPE_TINTEFFECT;CTintEffect.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_TINTEFFECT); writeLong(w,this.amt);writeLong(w,this.hue)};CTintEffect.prototype.Read_FromBinary=function(r){this.amt=readLong(r);this.hue=readLong(r)};CTintEffect.prototype.createDuplicate=function(){var oCopy=new CTintEffect;oCopy.amt=this.amt;oCopy.hue=this.hue;return oCopy};function CXfrmEffect(){this.kx=null;this.ky=null;this.sx=null;this.sy=null;this.tx=null;this.ty=null}CXfrmEffect.prototype.Type=EFFECT_TYPE_XFRM;CXfrmEffect.prototype.Write_ToBinary=function(w){w.WriteLong(EFFECT_TYPE_XFRM);writeLong(w, this.kx);writeLong(w,this.ky);writeLong(w,this.sx);writeLong(w,this.sy);writeLong(w,this.tx);writeLong(w,this.ty)};CXfrmEffect.prototype.Read_FromBinary=function(r){this.kx=readLong(r);this.ky=readLong(r);this.sx=readLong(r);this.sy=readLong(r);this.tx=readLong(r);this.ty=readLong(r)};CXfrmEffect.prototype.createDuplicate=function(){var oCopy=new CXfrmEffect;oCopy.kx=this.kx;oCopy.ky=this.ky;oCopy.sx=this.sx;oCopy.sy=this.sy;oCopy.tx=this.tx;oCopy.ty=this.ty;return oCopy};function CSolidFill(){this.type= c_oAscFill.FILL_TYPE_SOLID;this.color=null}CSolidFill.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},check:function(theme,colorMap){if(this.color)this.color.check(theme,colorMap)},saveSourceFormatting:function(){var _ret=new CSolidFill;if(this.color)_ret.color=this.color.saveSourceFormatting();return _ret},getObjectType:function(){return AscDFH.historyitem_type_SolidFill},setColor:function(color){this.color=color},Write_ToBinary:function(w){if(this.color){w.WriteBool(true); this.color.Write_ToBinary(w)}else w.WriteBool(false)},Read_FromBinary:function(r){if(r.GetBool()){this.color=new CUniColor;this.color.Read_FromBinary(r)}},checkWordMods:function(){return this.color&&this.color.checkWordMods()},convertToPPTXMods:function(){this.color&&this.color.convertToPPTXMods()},canConvertPPTXModsToWord:function(){return this.color&&this.color.canConvertPPTXModsToWord()},convertToWordMods:function(){this.color&&this.color.convertToWordMods()},IsIdentical:function(fill){if(fill== null)return false;if(fill.type!=c_oAscFill.FILL_TYPE_SOLID)return false;if(this.color)return this.color.IsIdentical(fill.color);return fill.color===null},createDuplicate:function(){var duplicate=new CSolidFill;if(this.color)duplicate.color=this.color.createDuplicate();return duplicate},compare:function(fill){if(fill==null||fill.type!==c_oAscFill.FILL_TYPE_SOLID)return null;if(this.color&&fill.color){var _ret=new CSolidFill;_ret.color=this.color.compare(fill.color);return _ret}return null}};function CGs(){this.color= null;this.pos=0}CGs.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_Gs},setColor:function(color){this.color=color},setPos:function(pos){this.pos=pos},saveSourceFormatting:function(){var _ret=new CGs;_ret.pos=this.pos;if(this.color)_ret.color=this.color.saveSourceFormatting();return _ret},Write_ToBinary:function(w){w.WriteBool(isRealObject(this.color));if(isRealObject(this.color))this.color.Write_ToBinary(w);writeLong(w, this.pos)},Read_FromBinary:function(r){if(r.GetBool()){this.color=new CUniColor;this.color.Read_FromBinary(r)}else this.color=null;this.pos=readLong(r)},IsIdentical:function(fill){if(!fill)return false;if(this.pos!==fill.pos)return false;if(!this.color&&fill.color||this.color&&!fill.color||this.color&&fill.color&&!this.color.IsIdentical(fill.color))return false;return true},createDuplicate:function(){var duplicate=new CGs;duplicate.pos=this.pos;if(this.color)duplicate.color=this.color.createDuplicate(); return duplicate},compare:function(gs){if(gs.pos!==this.pos)return null;var compare_unicolor=this.color.compare(gs.color);if(!isRealObject(compare_unicolor))return null;var ret=new CGs;ret.color=compare_unicolor;ret.pos=gs.pos===this.pos?this.pos:0;return ret}};function GradLin(){this.angle=54E5;this.scale=true}GradLin.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_GradLin},setAngle:function(angle){this.angle=angle}, setScale:function(scale){this.scale=scale},Write_ToBinary:function(w){writeLong(w,this.angle);writeBool(w,this.scale)},Read_FromBinary:function(r){this.angle=readLong(r);this.scale=readBool(r)},IsIdentical:function(lin){if(this.angle!=lin.angle)return false;if(this.scale!=lin.scale)return false;return true},createDuplicate:function(){var duplicate=new GradLin;duplicate.angle=this.angle;duplicate.scale=this.scale;return duplicate},compare:function(lin){return null}};function GradPath(){this.path=0; this.rect=null}GradPath.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_GradPath},setPath:function(path){this.path=path},setRect:function(rect){this.rect=rect},Write_ToBinary:function(w){writeLong(w,this.path);w.WriteBool(isRealObject(this.rect));if(isRealObject(this.rect))this.rect.Write_ToBinary(w)},Read_FromBinary:function(r){this.path=readLong(r);if(r.GetBool()){this.rect=new CSrcRect;this.rect.Read_FromBinary(r)}}, IsIdentical:function(path){if(this.path!=path.path)return false;return true},createDuplicate:function(){var duplicate=new GradPath;duplicate.path=this.path;return duplicate},compare:function(path){return null}};function CGradFill(){this.type=c_oAscFill.FILL_TYPE_GRAD;this.colors=[];this.lin=null;this.path=null;this.rotateWithShape=null}CGradFill.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},saveSourceFormatting:function(){var _ret=new CGradFill;if(this.lin)_ret.lin= this.lin.createDuplicate();if(this.path)_ret.path=this.path.createDuplicate();for(var i=0;i<this.colors.length;++i)_ret.colors.push(this.colors[i].saveSourceFormatting());return _ret},check:function(theme,colorMap){for(var i=0;i<this.colors.length;++i)if(this.colors[i].color)this.colors[i].color.check(theme,colorMap)},getObjectType:function(){return AscDFH.historyitem_type_GradFill},checkWordMods:function(){for(var i=0;i<this.colors.length;++i)if(this.colors[i]&&this.colors[i].color&&this.colors[i].color.checkWordMods())return true; return false},convertToPPTXMods:function(){for(var i=0;i<this.colors.length;++i)this.colors[i]&&this.colors[i].color&&this.colors[i].color.convertToPPTXMods()},canConvertPPTXModsToWord:function(){for(var i=0;i<this.colors.length;++i)if(this.colors[i]&&this.colors[i].color&&this.colors[i].color.canConvertPPTXModsToWord())return true;return false},convertToWordMods:function(){for(var i=0;i<this.colors.length;++i)this.colors[i]&&this.colors[i].color&&this.colors[i].color.convertToWordMods()},addColor:function(color){this.colors.push(color)}, setLin:function(lin){this.lin=lin},setPath:function(path){this.path=path},Write_ToBinary:function(w){w.WriteLong(this.colors.length);for(var i=0;i<this.colors.length;++i)this.colors[i].Write_ToBinary(w);w.WriteBool(isRealObject(this.lin));if(isRealObject(this.lin))this.lin.Write_ToBinary(w);w.WriteBool(isRealObject(this.path));if(isRealObject(this.path))this.path.Write_ToBinary(w)},Read_FromBinary:function(r){var len=r.GetLong();for(var i=0;i<len;++i){this.colors[i]=new CGs;this.colors[i].Read_FromBinary(r)}if(r.GetBool()){this.lin= new GradLin;this.lin.Read_FromBinary(r)}else this.lin=null;if(r.GetBool()){this.path=new GradPath;this.path.Read_FromBinary(r)}else this.path=null},IsIdentical:function(fill){if(fill==null)return false;if(fill.type!=c_oAscFill.FILL_TYPE_GRAD)return false;if(fill.colors.length!=this.colors.length)return false;for(var i=0;i<this.colors.length;++i)if(!this.colors[i].IsIdentical(fill.colors[i]))return false;if(!this.path&&fill.path||this.path&&!fill.path||this.path&&fill.path&&!this.path.IsIdentical(fill.path))return false; if(!this.lin&&fill.lin||!fill.lin&&this.lin||this.lin&&fill.lin&&!this.lin.IsIdentical(fill.lin))return false;return true},createDuplicate:function(){var duplicate=new CGradFill;for(var i=0;i<this.colors.length;++i)duplicate.colors[i]=this.colors[i].createDuplicate();if(this.lin)duplicate.lin=this.lin.createDuplicate();if(this.path)duplicate.path=this.path.createDuplicate();if(this.rotateWithShape!=null)duplicate.rotateWithShape=this.rotateWithShape;return duplicate},compare:function(fill){if(fill== null||fill.type!==c_oAscFill.FILL_TYPE_GRAD)return null;var _ret=new CGradFill;if(this.lin==null||fill.lin==null)_ret.lin=null;else{_ret.lin=new GradLin;_ret.lin.angle=this.lin&&this.lin.angle===fill.lin.angle?fill.lin.angle:54E5;_ret.lin.scale=this.lin&&this.lin.scale===fill.lin.scale?fill.lin.scale:true}if(this.path==null||fill.path==null)_ret.path=null;else _ret.path=new GradPath;if(this.colors.length===fill.colors.length)for(var i=0;i<this.colors.length;++i){var compare_unicolor=this.colors[i].compare(fill.colors[i]); if(!isRealObject(compare_unicolor))return null;_ret.colors[i]=compare_unicolor}return _ret}};function CPattFill(){this.type=c_oAscFill.FILL_TYPE_PATT;this.ftype=0;this.fgClr=null;this.bgClr=null}CPattFill.prototype={getObjectType:function(){return AscDFH.historyitem_type_PathFill},check:function(theme,colorMap){if(this.fgClr)this.fgClr.check(theme,colorMap);if(this.bgClr)this.bgClr.check(theme,colorMap)},checkWordMods:function(){if(this.fgClr&&this.fgClr.checkWordMods())return true;return this.bgClr&& this.bgClr.checkWordMods()},saveSourceFormatting:function(){var _ret=new CPattFill;if(this.fgClr)_ret.fgClr=this.fgClr.saveSourceFormatting();if(this.bgClr)_ret.bgClr=this.bgClr.saveSourceFormatting();_ret.ftype=this.ftype;return _ret},convertToPPTXMods:function(){this.fgClr&&this.fgClr.convertToPPTXMods();this.bgClr&&this.bgClr.convertToPPTXMods()},canConvertPPTXModsToWord:function(){if(this.fgClr&&this.fgClr.canConvertPPTXModsToWord())return true;return this.bgClr&&this.bgClr.canConvertPPTXModsToWord()}, convertToWordMods:function(){this.fgClr&&this.fgClr.convertToWordMods();this.bgClr&&this.bgClr.convertToWordMods()},setFType:function(fType){this.ftype=fType},setFgColor:function(fgClr){this.fgClr=fgClr},setBgColor:function(bgClr){this.bgClr=bgClr},Write_ToBinary:function(w){writeLong(w,this.ftype);w.WriteBool(isRealObject(this.fgClr));if(isRealObject(this.fgClr))this.fgClr.Write_ToBinary(w);w.WriteBool(isRealObject(this.bgClr));if(isRealObject(this.bgClr))this.bgClr.Write_ToBinary(w)},Read_FromBinary:function(r){this.ftype= readLong(r);if(r.GetBool()){this.fgClr=new CUniColor;this.fgClr.Read_FromBinary(r)}if(r.GetBool()){this.bgClr=new CUniColor;this.bgClr.Read_FromBinary(r)}},Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},IsIdentical:function(fill){if(fill==null)return false;if(fill.type!=c_oAscFill.FILL_TYPE_PATT&&this.ftype!=fill.ftype)return false;return this.fgClr.IsIdentical(fill.fgClr)&&this.bgClr.IsIdentical(fill.bgClr)&&this.ftype===fill.ftype},createDuplicate:function(){var duplicate=new CPattFill; duplicate.ftype=this.ftype;if(this.fgClr)duplicate.fgClr=this.fgClr.createDuplicate();if(this.bgClr)duplicate.bgClr=this.bgClr.createDuplicate();return duplicate},compare:function(fill){if(fill==null)return null;if(fill.type!==c_oAscFill.FILL_TYPE_PATT)return null;var _ret=new CPattFill;if(fill.ftype==this.ftype)_ret.ftype=this.ftype;if(this.fgClr)_ret.fgClr=this.fgClr.compare(fill.fgClr);else _ret.fgClr=null;if(this.bgClr)_ret.bgClr=this.bgClr.compare(fill.bgClr);else _ret.bgClr=null;if(!_ret.bgClr&& !_ret.fgClr)return null;return _ret}};function CNoFill(){this.type=c_oAscFill.FILL_TYPE_NOFILL}CNoFill.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},check:function(){},getObjectType:function(){return AscDFH.historyitem_type_NoFill},saveSourceFormatting:function(){return this.createDuplicate()},Write_ToBinary:function(w){},Read_FromBinary:function(r){},checkWordMods:function(){return false},convertToPPTXMods:function(){},canConvertPPTXModsToWord:function(){return false}, convertToWordMods:function(){},createDuplicate:function(){return new CNoFill},IsIdentical:function(fill){if(fill==null)return false;return fill.type===c_oAscFill.FILL_TYPE_NOFILL},compare:function(nofill){if(nofill==null)return null;if(nofill.type===this.type)return new CNoFill;return null}};function CGrpFill(){this.type=c_oAscFill.FILL_TYPE_GRP}CGrpFill.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},check:function(){},getObjectType:function(){return AscDFH.historyitem_type_GrpFill}, Write_ToBinary:function(w){},Read_FromBinary:function(r){},checkWordMods:function(){return false},convertToPPTXMods:function(){},canConvertPPTXModsToWord:function(){return false},convertToWordMods:function(){},createDuplicate:function(){return new CGrpFill},IsIdentical:function(fill){if(fill==null)return false;return fill.type===c_oAscFill.FILL_TYPE_GRP},compare:function(grpfill){if(grpfill==null)return null;if(grpfill.type===this.type)return new CGrpFill;return null}};function CreateBlackRGBUnifill(){var ret= new CUniFill;ret.setFill(new CSolidFill);ret.fill.setColor(new CUniColor);ret.fill.color.setColor(new CRGBColor);ret.fill.color.color.setColor(0,0,0);return ret}function FormatRGBAColor(){this.R=0;this.G=0;this.B=0;this.A=255}function CUniFill(){this.fill=null;this.transparent=null}CUniFill.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},check:function(theme,colorMap){if(this.fill)this.fill.check(theme,colorMap)},addColorMod:function(mod){if(this.fill)switch(this.fill.type){case c_oAscFill.FILL_TYPE_NONE:case c_oAscFill.FILL_TYPE_BLIP:case c_oAscFill.FILL_TYPE_NOFILL:case c_oAscFill.FILL_TYPE_GRP:{break}case c_oAscFill.FILL_TYPE_SOLID:{if(this.fill.color&& this.fill.color)this.fill.color.addColorMod(mod);break}case c_oAscFill.FILL_TYPE_GRAD:{for(var i=0;i<this.fill.colors.length;++i)if(this.fill.colors[i]&&this.fill.colors[i].color)this.fill.colors[i].color.addColorMod(mod);break}case c_oAscFill.FILL_TYPE_PATT:{if(this.fill.bgClr)this.fill.bgClr.addColorMod(mod);if(this.fill.fgClr)this.fill.fgClr.addColorMod(mod);break}}},checkPhColor:function(unicolor){if(this.fill)switch(this.fill.type){case c_oAscFill.FILL_TYPE_NONE:case c_oAscFill.FILL_TYPE_BLIP:case c_oAscFill.FILL_TYPE_NOFILL:case c_oAscFill.FILL_TYPE_GRP:{break}case c_oAscFill.FILL_TYPE_SOLID:{if(this.fill.color&& this.fill.color)this.fill.color.checkPhColor(unicolor);break}case c_oAscFill.FILL_TYPE_GRAD:{for(var i=0;i<this.fill.colors.length;++i)if(this.fill.colors[i]&&this.fill.colors[i].color)this.fill.colors[i].color.checkPhColor(unicolor);break}case c_oAscFill.FILL_TYPE_PATT:{if(this.fill.bgClr)this.fill.bgClr.checkPhColor(unicolor);if(this.fill.fgClr)this.fill.fgClr.checkPhColor(unicolor);break}}},Get_TextBackGroundColor:function(){if(!this.fill)return undefined;var oColor=undefined,RGBA;switch(this.fill.type){case c_oAscFill.FILL_TYPE_SOLID:{if(this.fill.color){RGBA= this.fill.color.RGBA;if(RGBA)oColor=new CDocumentColor(RGBA.R,RGBA.G,RGBA.B,false)}break}case c_oAscFill.FILL_TYPE_PATT:{var oClr;if(this.fill.ftype===38)oClr=this.fill.fgClr;else oClr=this.fill.bgClr;if(oClr){RGBA=oClr.RGBA;if(RGBA)oColor=new CDocumentColor(RGBA.R,RGBA.G,RGBA.B,false)}break}}return oColor},checkWordMods:function(){return this.fill&&this.fill.checkWordMods()},convertToPPTXMods:function(){this.fill&&this.fill.convertToPPTXMods()},canConvertPPTXModsToWord:function(){return this.fill&& this.fill.canConvertPPTXModsToWord()},convertToWordMods:function(){this.fill&&this.fill.convertToWordMods()},getObjectType:function(){return AscDFH.historyitem_type_UniFill},setFill:function(fill){this.fill=fill},setTransparent:function(transparent){this.transparent=transparent},getUniColor:function(){if(this.fill&&this.fill instanceof CSolidFill&&this.fill.color)return this.fill.color;else{var RGBA=this.getRGBAColor();return CreateUniColorRGB(RGBA.R,RGBA.G,RGBA.B)}},Set_FromObject:function(o){}, Write_ToBinary:function(w){writeDouble(w,this.transparent);w.WriteBool(isRealObject(this.fill));if(isRealObject(this.fill)){w.WriteLong(this.fill.type);this.fill.Write_ToBinary(w)}},Read_FromBinary:function(r){this.transparent=readDouble(r);if(r.GetBool()){var type=r.GetLong();switch(type){case c_oAscFill.FILL_TYPE_NONE:{break}case c_oAscFill.FILL_TYPE_BLIP:{this.fill=new CBlipFill;this.fill.Read_FromBinary(r);break}case c_oAscFill.FILL_TYPE_NOFILL:{this.fill=new CNoFill;this.fill.Read_FromBinary(r); break}case c_oAscFill.FILL_TYPE_SOLID:{this.fill=new CSolidFill;this.fill.Read_FromBinary(r);break}case c_oAscFill.FILL_TYPE_GRAD:{this.fill=new CGradFill;this.fill.Read_FromBinary(r);break}case c_oAscFill.FILL_TYPE_PATT:{this.fill=new CPattFill;this.fill.Read_FromBinary(r);break}case c_oAscFill.FILL_TYPE_GRP:{this.fill=new CGrpFill;this.fill.Read_FromBinary(r);break}}}},calculate:function(theme,slide,layout,masterSlide,RGBA,colorMap){if(this.fill){if(this.fill.color)this.fill.color.Calculate(theme, slide,layout,masterSlide,RGBA,colorMap);if(this.fill.colors)for(var i=0;i<this.fill.colors.length;++i)this.fill.colors[i].color.Calculate(theme,slide,layout,masterSlide,RGBA,colorMap);if(this.fill.fgClr)this.fill.fgClr.Calculate(theme,slide,layout,masterSlide,RGBA,colorMap);if(this.fill.bgClr)this.fill.bgClr.Calculate(theme,slide,layout,masterSlide,RGBA,colorMap)}},getRGBAColor:function(){if(this.fill){if(this.fill.type==c_oAscFill.FILL_TYPE_SOLID)if(this.fill.color)return this.fill.color.RGBA;else return new FormatRGBAColor; if(this.fill.type==c_oAscFill.FILL_TYPE_GRAD){var RGBA=new FormatRGBAColor;var _colors=this.fill.colors;var _len=_colors.length;if(0==_len)return RGBA;for(var i=0;i<_len;i++){RGBA.R+=_colors[i].color.RGBA.R;RGBA.G+=_colors[i].color.RGBA.G;RGBA.B+=_colors[i].color.RGBA.B}RGBA.R=RGBA.R/_len>>0;RGBA.G=RGBA.G/_len>>0;RGBA.B=RGBA.B/_len>>0;return RGBA}if(this.fill.type==c_oAscFill.FILL_TYPE_PATT)return this.fill.fgClr.RGBA;if(this.fill.type==c_oAscFill.FILL_TYPE_NOFILL)return{R:0,G:0,B:0}}return new FormatRGBAColor}, createDuplicate:function(){var duplicate=new CUniFill;if(this.fill!=null)duplicate.fill=this.fill.createDuplicate();duplicate.transparent=this.transparent;return duplicate},saveSourceFormatting:function(){var duplicate=new CUniFill;if(this.fill)if(this.fill.saveSourceFormatting)duplicate.fill=this.fill.saveSourceFormatting();else duplicate.fill=this.fill.createDuplicate();duplicate.transparent=this.transparent;return duplicate},merge:function(unifill){if(unifill){if(unifill.fill!=null){this.fill= unifill.fill.createDuplicate();if(this.fill.type===c_oAscFill.FILL_TYPE_PATT){var _patt_fill=this.fill;if(!_patt_fill.fgClr)_patt_fill.setFgColor(CreateUniColorRGB(0,0,0));if(!_patt_fill.bgClr)_patt_fill.bgClr=CreateUniColorRGB(255,255,255)}}if(unifill.transparent!=null)this.transparent=unifill.transparent}},IsIdentical:function(unifill){if(unifill==null)return false;if(isRealNumber(this.transparent)!==isRealNumber(unifill.transparent)||isRealNumber(this.transparent)&&this.transparent!==unifill.transparent)return false; if(this.fill==null&&unifill.fill==null)return true;if(this.fill!=null)return this.fill.IsIdentical(unifill.fill);else return false},Is_Equal:function(unfill){return this.IsIdentical(unfill)},compare:function(unifill){if(unifill==null)return null;var _ret=new CUniFill;if(!(this.fill==null||unifill.fill==null))if(this.fill.compare)_ret.fill=this.fill.compare(unifill.fill);return _ret.fill},isAccent1:function(){return this.fill&&this.fill.color&&this.fill.color.color&&this.fill.color.color.type===window["Asc"].c_oAscColor.COLOR_TYPE_SCHEME&& this.fill.color.color.id===0},isSolidFillRGB:function(){return this.fill&&this.fill.color&&this.fill.color.color&&this.fill.color.color.type===window["Asc"].c_oAscColor.COLOR_TYPE_SRGB}};function CompareUniFill(unifill_1,unifill_2){if(unifill_1==null||unifill_2==null)return null;var _ret=new CUniFill;if(!(unifill_1.transparent===null||unifill_2.transparent===null||unifill_1.transparent!==unifill_2.transparent))_ret.transparent=unifill_1.transparent;if(unifill_1.fill==null||unifill_2.fill==null||unifill_1.fill.type!= unifill_2.fill.type)return _ret;_ret.fill=unifill_1.compare(unifill_2);return _ret}function CompareBlipTiles(tile1,tile2){if(isRealObject(tile1))return tile1.IsIdentical(tile2);return tile1===tile2}function CompareUnifillBool(u1,u2){if(!u1&&!u2)return true;if(!u1&&u2||u1&&!u2)return false;if(isRealNumber(u1.transparent)!==isRealNumber(u2.transparent)||isRealNumber(u1.transparent)&&u1.transparent!==u2.transparent)return false;if(!u1.fill&&!u2.fill)return true;if(!u1.fill&&u2.fill||u1.fill&&!u2.fill)return false; if(u1.fill.type!==u2.fill.type)return false;switch(u1.fill.type){case c_oAscFill.FILL_TYPE_BLIP:{if(u1.fill.RasterImageId&&!u2.fill.RasterImageId||u2.fill.RasterImageId&&!u1.fill.RasterImageId)return false;if(typeof u1.fill.RasterImageId==="string"&&typeof u2.fill.RasterImageId==="string"&&AscCommon.getFullImageSrc2(u1.fill.RasterImageId)!==AscCommon.getFullImageSrc2(u2.fill.RasterImageId))return false;if(u1.fill.srcRect&&!u2.fill.srcRect||!u1.fill.srcRect&&u2.fill.srcRect)return false;if(u1.fill.srcRect&& u2.fill.srcRect)if(u1.fill.srcRect.l!==u2.fill.srcRect.l||u1.fill.srcRect.t!==u2.fill.srcRect.t||u1.fill.srcRect.r!==u2.fill.srcRect.r||u1.fill.srcRect.b!==u2.fill.srcRect.b)return false;if(u1.fill.stretch!==u2.fill.stretch||!CompareBlipTiles(u1.fill.tile,u2.fill.tile)||u1.fill.rotWithShape!==u2.fill.rotWithShape)return false;break}case c_oAscFill.FILL_TYPE_SOLID:{if(u1.fill.color&&u2.fill.color)return CompareUniColor(u1.fill.color,u2.fill.color);break}case c_oAscFill.FILL_TYPE_GRAD:{if(u1.fill.colors.length!== u2.fill.colors.length)return false;if(isRealObject(u1.fill.path)!==isRealObject(u2.fill.path))return false;if(u1.fill.path&&!u1.fill.path.IsIdentical(u2.fill.path))return false;if(isRealObject(u1.fill.lin)!==isRealObject(u2.fill.lin))return false;if(u1.fill.lin&&!u1.fill.lin.IsIdentical(u2.fill.lin))return false;for(var i=0;i<u1.fill.colors.length;++i)if(u1.fill.colors[i].pos!==u2.fill.colors[i].pos||!CompareUniColor(u1.fill.colors[i].color,u2.fill.colors[i].color))return false;break}case c_oAscFill.FILL_TYPE_PATT:{if(u1.fill.ftype!== u2.fill.ftype||!CompareUniColor(u1.fill.fgClr,u2.fill.fgClr)||!CompareUniColor(u1.fill.bgClr,u2.fill.bgClr))return false;break}}return true}function CompareUniColor(u1,u2){if(!u1&&!u2)return true;if(!u1&&u2||u1&&!u2)return false;if(!u1.color&&u2.color||u1.color&&!u2.color)return false;if(u1.color&&u2.color){if(u1.color.type!==u2.color.type)return false;switch(u1.color.type){case c_oAscColor.COLOR_TYPE_NONE:{break}case c_oAscColor.COLOR_TYPE_SRGB:{if(u1.color.RGBA.R!==u2.color.RGBA.R||u1.color.RGBA.G!== u2.color.RGBA.G||u1.color.RGBA.B!==u2.color.RGBA.B||u1.color.RGBA.A!==u2.color.RGBA.A)return false;break}case c_oAscColor.COLOR_TYPE_PRST:case c_oAscColor.COLOR_TYPE_SCHEME:{if(u1.color.id!==u2.color.id)return false;break}case c_oAscColor.COLOR_TYPE_SYS:{if(u1.color.RGBA.R!==u2.color.RGBA.R||u1.color.RGBA.G!==u2.color.RGBA.G||u1.color.RGBA.B!==u2.color.RGBA.B||u1.color.RGBA.A!==u2.color.RGBA.A||u1.color.id!==u2.color.id)return false;break}}}if(!u1.Mods&&u2.Mods||!u2.Mods&&u1.Mods)return false;if(u1.Mods&& u2.Mods){if(u1.Mods.Mods.length!==u2.Mods.Mods.length)return false;for(var i=0;i<u1.Mods.Mods.length;++i)if(u1.Mods.Mods[i].name!==u2.Mods.Mods[i].name||u1.Mods.Mods[i].val!==u2.Mods.Mods[i].val)return false}return true}function CompareShapeProperties(shapeProp1,shapeProp2){var _result_shape_prop={};if(shapeProp1.type===shapeProp2.type)_result_shape_prop.type=shapeProp1.type;else _result_shape_prop.type=null;if(shapeProp1.h===shapeProp2.h)_result_shape_prop.h=shapeProp1.h;else _result_shape_prop.h= null;if(shapeProp1.w===shapeProp2.w)_result_shape_prop.w=shapeProp1.w;else _result_shape_prop.w=null;if(shapeProp1.rot===shapeProp2.rot)_result_shape_prop.rot=shapeProp1.rot;else _result_shape_prop.rot=null;if(shapeProp1.flipH===shapeProp2.flipH)_result_shape_prop.flipH=shapeProp1.flipH;else _result_shape_prop.flipH=null;if(shapeProp1.flipV===shapeProp2.flipV)_result_shape_prop.flipV=shapeProp1.flipV;else _result_shape_prop.flipV=null;if(shapeProp1.anchor===shapeProp2.anchor)_result_shape_prop.anchor= shapeProp1.anchor;else _result_shape_prop.anchor=null;if(shapeProp1.stroke==null||shapeProp2.stroke==null)_result_shape_prop.stroke=null;else _result_shape_prop.stroke=shapeProp1.stroke.compare(shapeProp2.stroke);{_result_shape_prop.verticalTextAlign=null;_result_shape_prop.vert=null}if(shapeProp1.canChangeArrows!==true||shapeProp2.canChangeArrows!==true)_result_shape_prop.canChangeArrows=false;else _result_shape_prop.canChangeArrows=true;_result_shape_prop.fill=CompareUniFill(shapeProp1.fill,shapeProp2.fill); _result_shape_prop.IsLocked=shapeProp1.IsLocked===true||shapeProp2.IsLocked===true;if(isRealObject(shapeProp1.paddings)&&isRealObject(shapeProp2.paddings)){_result_shape_prop.paddings=new Asc.asc_CPaddings;_result_shape_prop.paddings.Left=isRealNumber(shapeProp1.paddings.Left)?shapeProp1.paddings.Left===shapeProp2.paddings.Left?shapeProp1.paddings.Left:undefined:undefined;_result_shape_prop.paddings.Top=isRealNumber(shapeProp1.paddings.Top)?shapeProp1.paddings.Top===shapeProp2.paddings.Top?shapeProp1.paddings.Top: undefined:undefined;_result_shape_prop.paddings.Right=isRealNumber(shapeProp1.paddings.Right)?shapeProp1.paddings.Right===shapeProp2.paddings.Right?shapeProp1.paddings.Right:undefined:undefined;_result_shape_prop.paddings.Bottom=isRealNumber(shapeProp1.paddings.Bottom)?shapeProp1.paddings.Bottom===shapeProp2.paddings.Bottom?shapeProp1.paddings.Bottom:undefined:undefined}_result_shape_prop.canFill=shapeProp1.canFill===true||shapeProp2.canFill===true;if(shapeProp1.bFromChart||shapeProp2.bFromChart)_result_shape_prop.bFromChart= true;else _result_shape_prop.bFromChart=false;if(!shapeProp1.bFromImage||!shapeProp2.bFromImage)_result_shape_prop.bFromImage=false;else _result_shape_prop.bFromImage=true;if(shapeProp1.locked||shapeProp2.locked)_result_shape_prop.locked=true;_result_shape_prop.lockAspect=!!(shapeProp1.lockAspect&&shapeProp2.lockAspect);_result_shape_prop.textArtProperties=CompareTextArtProperties(shapeProp1.textArtProperties,shapeProp2.textArtProperties);if(shapeProp1.title===shapeProp2.title)_result_shape_prop.title= shapeProp1.title;if(shapeProp1.description===shapeProp2.description)_result_shape_prop.description=shapeProp1.description;if(shapeProp1.columnNumber===shapeProp2.columnNumber)_result_shape_prop.columnNumber=shapeProp1.columnNumber;if(shapeProp1.columnSpace===shapeProp2.columnSpace)_result_shape_prop.columnSpace=shapeProp1.columnSpace;if(shapeProp1.textFitType===shapeProp2.textFitType)_result_shape_prop.textFitType=shapeProp1.textFitType;if(shapeProp1.vertOverflowType===shapeProp2.vertOverflowType)_result_shape_prop.vertOverflowType= shapeProp1.vertOverflowType;if(!shapeProp1.shadow&&!shapeProp2.shadow)_result_shape_prop.shadow=null;else if(shapeProp1.shadow&&!shapeProp2.shadow)_result_shape_prop.shadow=null;else if(!shapeProp1.shadow&&shapeProp2.shadow)_result_shape_prop.shadow=null;else if(shapeProp1.shadow.IsIdentical(shapeProp2.shadow))_result_shape_prop.shadow=shapeProp1.shadow.createDuplicate();else _result_shape_prop.shadow=null;return _result_shape_prop}function CompareTextArtProperties(oProps1,oProps2){if(!oProps1||!oProps2)return null; var oRet={Fill:undefined,Line:undefined,Form:undefined};if(oProps1.Form===oProps2.Form)oRet.From=oProps1.Form;if(oProps1.Fill&&oProps2.Fill)oRet.Fill=CompareUniFill(oProps1.Fill,oProps2.Fill);if(oProps1.Line&&oProps2.Line)oRet.Line=oProps1.Line.compare(oProps2.Line);return oRet}var lg=500,mid=300,sm=200;var ar_arrow=0,ar_diamond=1,ar_none=2,ar_oval=3,ar_stealth=4,ar_triangle=5;var LineEndType={None:0,Arrow:1,Diamond:2,Oval:3,Stealth:4,Triangle:5};var LineEndSize={Large:0,Mid:1,Small:2};function EndArrow(){this.type= null;this.len=null;this.w=null}var LineJoinType={Empty:0,Round:1,Bevel:2,Miter:3};EndArrow.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},compare:function(end_arrow){if(end_arrow==null)return null;var _ret=new EndArrow;if(this.type===end_arrow.type)_ret.type=this.type;if(this.len===end_arrow.len)_ret.len=this.len;if(this.w===end_arrow)_ret.w=this.w;return _ret},createDuplicate:function(){var duplicate=new EndArrow;duplicate.type=this.type;duplicate.len=this.len;duplicate.w= this.w;return duplicate},IsIdentical:function(arrow){return arrow&&arrow.type==this.type&&arrow.len==this.len&&arrow.w==this.w},GetWidth:function(_size,_max){var size=Math.max(_size,_max?_max:2);var _ret=3*size;if(null!=this.w)switch(this.w){case LineEndSize.Large:_ret=5*size;break;case LineEndSize.Small:_ret=2*size;break;default:break}return _ret},GetLen:function(_size,_max){var size=Math.max(_size,_max?_max:2);var _ret=3*size;if(null!=this.len)switch(this.len){case LineEndSize.Large:_ret=5*size; break;case LineEndSize.Small:_ret=2*size;break;default:break}return _ret},getObjectType:function(){return AscDFH.historyitem_type_EndArrow},setType:function(type){this.type=type},setLen:function(len){this.len=len},setW:function(w){this.w=w},Write_ToBinary:function(w){writeLong(w,this.type);writeLong(w,this.len);writeLong(w,this.w)},Read_FromBinary:function(r){this.type=readLong(r);this.len=readLong(r);this.w=readLong(r)}};function ConvertJoinAggType(_type){switch(_type){case LineJoinType.Round:return 2; case LineJoinType.Bevel:return 1;case LineJoinType.Miter:return 0;default:break}return 2}function LineJoin(){this.type=null;this.limit=null}LineJoin.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},IsIdentical:function(oJoin){if(!oJoin)return false;if(this.type!==oJoin.type)return false;if(this.limit!==oJoin.limit)return false;return true},getObjectType:function(){return AscDFH.historyitem_type_LineJoin},createDuplicate:function(){var duplicate=new LineJoin;duplicate.type= this.type;duplicate.limit=this.limit;return duplicate},setType:function(type){this.type=type},setLimit:function(limit){this.limit=limit},Write_ToBinary:function(w){writeLong(w,this.type);writeBool(w,this.limit)},Read_FromBinary:function(r){this.type=readLong(r);this.limit=readBool(r)}};function CLn(){this.Fill=null;this.prstDash=null;this.Join=null;this.headEnd=null;this.tailEnd=null;this.algn=null;this.cap=null;this.cmpd=null;this.w=null}CLn.prototype={getObjectType:function(){return AscDFH.historyitem_type_Ln}, compare:function(line){if(line==null)return null;var _ret=new CLn;if(this.Fill!=null)_ret.Fill=CompareUniFill(this.Fill,line.Fill);if(this.prstDash===line.prstDash)_ret.prstDash=this.prstDash;else _ret.prstDash=undefined;if(this.Join===line.Join)_ret.Join=this.Join;if(this.tailEnd!=null)_ret.tailEnd=this.tailEnd.compare(line.tailEnd);if(this.headEnd!=null)_ret.headEnd=this.headEnd.compare(line.headEnd);if(this.algn===line.algn)_ret.algn=this.algn;if(this.cap===line.cap)_ret.cap=this.cap;if(this.cmpd=== line.cmpd)_ret.cmpd=this.cmpd;if(this.w===line.w)_ret.w=this.w;return _ret},merge:function(ln){if(ln==null)return;if(ln.Fill!=null&&ln.Fill.fill!=null)this.Fill=ln.Fill.createDuplicate();if(ln.prstDash!=null)this.prstDash=ln.prstDash;if(ln.Join!=null)this.Join=ln.Join.createDuplicate();if(ln.headEnd!=null)this.headEnd=ln.headEnd.createDuplicate();if(ln.tailEnd!=null)this.tailEnd=ln.tailEnd.createDuplicate();if(ln.algn!=null)this.algn=ln.algn;if(ln.cap!=null)this.cap=ln.cap;if(ln.cmpd!=null)this.cmpd= ln.cmpd;if(ln.w!=null)this.w=ln.w},calculate:function(theme,slide,layout,master,RGBA,colorMap){if(isRealObject(this.Fill))this.Fill.calculate(theme,slide,layout,master,RGBA,colorMap)},createDuplicate:function(bSaveFormatting){var duplicate=new CLn;if(null!=this.Fill)if(bSaveFormatting===true)duplicate.Fill=this.Fill.saveSourceFormatting();else duplicate.Fill=this.Fill.createDuplicate();duplicate.prstDash=this.prstDash;duplicate.Join=this.Join;if(this.headEnd!=null)duplicate.headEnd=this.headEnd.createDuplicate(); if(this.tailEnd!=null)duplicate.tailEnd=this.tailEnd.createDuplicate();duplicate.algn=this.algn;duplicate.cap=this.cap;duplicate.cmpd=this.cmpd;duplicate.w=this.w;return duplicate},IsIdentical:function(ln){return ln&&(this.Fill==null?ln.Fill==null:this.Fill.IsIdentical(ln.Fill))&&(this.Join==null?ln.Join==null:this.Join.IsIdentical(ln.Join))&&(this.headEnd==null?ln.headEnd==null:this.headEnd.IsIdentical(ln.headEnd))&&(this.tailEnd==null?ln.tailEnd==null:this.tailEnd.IsIdentical(ln.headEnd))&&this.algn== ln.algn&&this.cap==ln.cap&&this.cmpd==ln.cmpd&&this.w==ln.w&&this.prstDash===ln.prstDash},setFill:function(fill){this.Fill=fill},setPrstDash:function(prstDash){this.prstDash=prstDash},setJoin:function(join){this.Join=join},setHeadEnd:function(headEnd){this.headEnd=headEnd},setTailEnd:function(tailEnd){this.tailEnd=tailEnd},setAlgn:function(algn){this.algn=algn},setCap:function(cap){this.cap=cap},setCmpd:function(cmpd){this.cmpd=cmpd},setW:function(w){this.w=w},isVisible:function(){return this.Fill&& this.Fill.fill&&this.Fill.fill.type!==AscFormat.FILL_TYPE_NONE&&this.Fill.fill.type!==AscFormat.FILL_TYPE_NOFILL},Write_ToBinary:function(w){w.WriteBool(isRealObject(this.Fill));if(isRealObject(this.Fill))this.Fill.Write_ToBinary(w);writeLong(w,this.prstDash);w.WriteBool(isRealObject(this.Join));if(isRealObject(this.Join))this.Join.Write_ToBinary(w);w.WriteBool(isRealObject(this.headEnd));if(isRealObject(this.headEnd))this.headEnd.Write_ToBinary(w);w.WriteBool(isRealObject(this.tailEnd));if(isRealObject(this.tailEnd))this.tailEnd.Write_ToBinary(w); writeLong(w,this.algn);writeLong(w,this.cap);writeLong(w,this.cmpd);writeLong(w,this.w)},Read_FromBinary:function(r){if(r.GetBool()){this.Fill=new CUniFill;this.Fill.Read_FromBinary(r)}else this.Fill=null;this.prstDash=readLong(r);if(r.GetBool()){this.Join=new LineJoin;this.Join.Read_FromBinary(r)}if(r.GetBool()){this.headEnd=new EndArrow;this.headEnd.Read_FromBinary(r)}if(r.GetBool()){this.tailEnd=new EndArrow;this.tailEnd.Read_FromBinary(r)}this.algn=readLong(r);this.cap=readLong(r);this.cmpd=readLong(r); this.w=readLong(r)}};function DefaultShapeDefinition(){this.spPr=new CSpPr;this.bodyPr=new CBodyPr;this.lstStyle=new TextListStyle;this.style=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}DefaultShapeDefinition.prototype={Get_Id:function(){return this.Id},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_DefaultShapeDefinition}, setSpPr:function(spPr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DefaultShapeDefinition_SetSpPr,this.spPr,spPr));this.spPr=spPr},setBodyPr:function(bodyPr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_DefaultShapeDefinition_SetBodyPr,this.bodyPr,bodyPr));this.bodyPr=bodyPr},setLstStyle:function(lstStyle){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_DefaultShapeDefinition_SetLstStyle,this.lstStyle,lstStyle));this.lstStyle=lstStyle},setStyle:function(style){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_DefaultShapeDefinition_SetStyle,this.style,style));this.style=style},createDuplicate:function(){var ret=new DefaultShapeDefinition;if(this.spPr)ret.setSpPr(this.spPr.createDuplicate());if(this.bodyPr)ret.setBodyPr(this.bodyPr.createDuplicate());if(this.lstStyle)ret.setLstStyle(this.lstStyle.createDuplicate());if(this.style)ret.setStyle(this.style.createDuplicate());return ret}};function CNvPr(){this.id=0;this.name="";this.isHidden=false;this.descr=null;this.title=null;this.hlinkClick= null;this.hlinkHover=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CNvPr.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_CNvPr},createDuplicate:function(){var duplicate=new CNvPr;duplicate.setId(this.id);duplicate.setName(this.name);duplicate.setIsHidden(this.isHidden);duplicate.setDescr(this.descr);duplicate.setTitle(this.title);if(this.hlinkClick)duplicate.setHlinkClick(this.hlinkClick.createDuplicate()); if(this.hlinkHover)duplicate.setHlinkClick(this.hlinkHover.createDuplicate());return duplicate},setId:function(id){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CNvPr_SetId,this.id,id));this.id=id},setName:function(name){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_CNvPr_SetName,this.name,name));this.name=name},setIsHidden:function(isHidden){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_CNvPr_SetIsHidden,this.isHidden,isHidden));this.isHidden=isHidden}, setDescr:function(descr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_CNvPr_SetDescr,this.descr,descr));this.descr=descr},setHlinkClick:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_CNvPr_SetHlinkClick,this.hlinkClick,pr));this.hlinkClick=pr},setHlinkHover:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_CNvPr_SetHlinkHover,this.hlinkHover,pr));this.hlinkHover=pr},setTitle:function(title){History.Add(new CChangesDrawingsString(this, AscDFH.historyitem_CNvPr_SetTitle,this.title,title));this.title=title},setFromOther:function(oOther){if(!oOther)return;if(oOther.name)this.setName(oOther.name);if(oOther.descr)this.setDescr(oOther.descr);if(oOther.title)this.setTitle(oOther.title)},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()}};var AUDIO_CD=0;var WAV_AUDIO_FILE=1;var AUDIO_FILE=2;var VIDEO_FILE=3;var QUICK_TIME_FILE=4;function UniMedia(){this.type= null;this.media=null}UniMedia.prototype.Write_ToBinary=function(w){var bType=this.type!==null&&this.type!==undefined;var bMedia=typeof this.media==="string";var nFlags=0;bType&&(nFlags|=1);bMedia&&(nFlags|=2);w.WriteLong(nFlags);bType&&w.WriteLong(this.type);bMedia&&w.WriteString2(this.media)};UniMedia.prototype.Read_FromBinary=function(r){var nFlags=r.GetLong();if(nFlags&1)this.type=r.GetLong();if(nFlags&2)this.media=r.GetString2()};UniMedia.prototype.createDuplicate=function(){var _ret=new UniMedia; _ret.type=this.type;_ret.media=this.media;return _ret};drawingConstructorsMap[AscDFH.historyitem_NvPr_SetUniMedia]=UniMedia;function NvPr(){this.isPhoto=false;this.userDrawn=false;this.ph=null;this.unimedia=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}NvPr.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_NvPr},setIsPhoto:function(isPhoto){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_NvPr_SetIsPhoto, this.isPhoto,isPhoto));this.isPhoto=isPhoto},setUserDrawn:function(userDrawn){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_NvPr_SetUserDrawn,this.userDrawn,userDrawn));this.userDrawn=userDrawn},setPh:function(ph){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_NvPr_SetPh,this.ph,ph));this.ph=ph},setUniMedia:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_NvPr_SetUniMedia,this.unimedia,pr));this.unimedia=pr},createDuplicate:function(){var duplicate= new NvPr;duplicate.setIsPhoto(this.isPhoto);duplicate.setUserDrawn(this.userDrawn);if(this.ph!=null)duplicate.setPh(this.ph.createDuplicate());if(this.unimedia!=null)duplicate.setUniMedia(this.unimedia.createDuplicate());return duplicate},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()}};var szPh_full=0,szPh_half=1,szPh_quarter=2;var orientPh_horz=0,orientPh_vert=1;function Ph(){this.hasCustomPrompt=false;this.idx= null;this.orient=null;this.sz=null;this.type=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}Ph.prototype={createDuplicate:function(){var duplicate=new Ph;duplicate.setHasCustomPrompt(this.hasCustomPrompt);duplicate.setIdx(this.idx);duplicate.setOrient(this.orient);duplicate.setSz(this.sz);duplicate.setType(this.type);return duplicate},Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_Ph},setHasCustomPrompt:function(hasCustomPrompt){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_Ph_SetHasCustomPrompt,this.hasCustomPrompt,hasCustomPrompt));this.hasCustomPrompt=hasCustomPrompt},setIdx:function(idx){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_Ph_SetIdx,this.idx,idx));this.idx=idx},setOrient:function(orient){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Ph_SetOrient,this.orient,orient));this.orient=orient},setSz:function(sz){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Ph_SetSz,this.sz,sz));this.sz=sz},setType:function(type){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_Ph_SetType,this.type,type));this.type=type},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()}};function CNvUniSpPr(){this.locks=null;this.stCnxIdx=null;this.stCnxId=null;this.endCnxIdx=null;this.endCnxId=null}CNvUniSpPr.prototype.Write_ToBinary=function(w){if(AscFormat.isRealNumber(this.locks)){w.WriteBool(true);w.WriteLong(this.locks)}else w.WriteBool(false);if(AscFormat.isRealNumber(this.stCnxIdx)&& typeof this.stCnxId==="string"&&this.stCnxId.length>0){w.WriteBool(true);w.WriteLong(this.stCnxIdx);w.WriteString2(this.stCnxId)}else w.WriteBool(false);if(AscFormat.isRealNumber(this.endCnxIdx)&&typeof this.endCnxId==="string"&&this.endCnxId.length>0){w.WriteBool(true);w.WriteLong(this.endCnxIdx);w.WriteString2(this.endCnxId)}else w.WriteBool(false)};CNvUniSpPr.prototype.Read_FromBinary=function(r){var bCnx=r.GetBool();if(bCnx)this.locks=r.GetLong();else this.locks=null;bCnx=r.GetBool();if(bCnx){this.stCnxIdx= r.GetLong();this.stCnxId=r.GetString2()}else{this.stCnxIdx=null;this.stCnxId=null}bCnx=r.GetBool();if(bCnx){this.endCnxIdx=r.GetLong();this.endCnxId=r.GetString2()}else{this.endCnxIdx=null;this.endCnxId=null}};CNvUniSpPr.prototype.copy=function(){var _ret=new CNvUniSpPr;_ret.locks=this.locks;_ret.stCnxId=this.stCnxId;_ret.stCnxIdx=this.stCnxIdx;_ret.endCnxId=this.endCnxId;_ret.endCnxIdx=this.endCnxIdx;return _ret};function UniNvPr(){this.cNvPr=new CNvPr;this.UniPr=null;this.nvPr=new NvPr;this.nvUniSpPr= new CNvUniSpPr;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}UniNvPr.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_UniNvPr},setCNvPr:function(cNvPr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_UniNvPr_SetCNvPr,this.cNvPr,cNvPr));this.cNvPr=cNvPr},setUniSpPr:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_UniNvPr_SetUniSpPr,this.nvUniSpPr,pr));this.nvUniSpPr= pr},setUniPr:function(uniPr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_UniNvPr_SetUniPr,this.UniPr,uniPr));this.UniPr=uniPr},setNvPr:function(nvPr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_UniNvPr_SetNvPr,this.nvPr,nvPr));this.nvPr=nvPr},createDuplicate:function(){var duplicate=new UniNvPr;this.cNvPr&&duplicate.setCNvPr(this.cNvPr.createDuplicate());this.nvPr&&duplicate.setNvPr(this.nvPr.createDuplicate());this.nvUniSpPr&&duplicate.setUniSpPr(this.nvUniSpPr.copy()); return duplicate},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id);writeObject(w,this.cNvPr);writeObject(w,this.nvPr)},Read_FromBinary2:function(r){this.Id=r.GetString2();this.cNvPr=readObject(r);this.nvPr=readObject(r)}};function StyleRef(){this.idx=0;this.Color=new CUniColor}StyleRef.prototype={Get_Id:function(){return this.Id},isIdentical:function(styleRef){if(styleRef==null)return false;if(this.idx!==styleRef.idx)return false;if(this.Color.IsIdentical(styleRef.Color)== false)return false;return true},getObjectType:function(){return AscDFH.historyitem_type_StyleRef},setIdx:function(idx){this.idx=idx},setColor:function(color){this.Color=color},createDuplicate:function(){var duplicate=new StyleRef;duplicate.setIdx(this.idx);if(this.Color)duplicate.setColor(this.Color.createDuplicate());return duplicate},Refresh_RecalcData:function(){},Write_ToBinary:function(w){writeLong(w,this.idx);w.WriteBool(isRealObject(this.Color));if(isRealObject(this.Color))this.Color.Write_ToBinary(w)}, Read_FromBinary:function(r){this.idx=readLong(r);if(r.GetBool()){this.Color=new CUniColor;this.Color.Read_FromBinary(r)}}};function FontRef(){this.idx=AscFormat.fntStyleInd_none;this.Color=null}FontRef.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},setIdx:function(idx){this.idx=idx},setColor:function(color){this.Color=color},createDuplicate:function(){var duplicate=new FontRef;duplicate.setIdx(this.idx);if(this.Color)duplicate.setColor(this.Color.createDuplicate());return duplicate}, Write_ToBinary:function(w){writeLong(w,this.idx);w.WriteBool(isRealObject(this.Color));if(isRealObject(this.Color))this.Color.Write_ToBinary(w)},Read_FromBinary:function(r){this.idx=readLong(r);if(r.GetBool()){this.Color=new CUniColor;this.Color.Read_FromBinary(r)}}};function CShapeStyle(){this.lnRef=null;this.fillRef=null;this.effectRef=null;this.fontRef=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CShapeStyle.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){}, Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},merge:function(style){if(style!=null){if(style.lnRef!=null)this.lnRef=style.lnRef.createDuplicate();if(style.fillRef!=null)this.fillRef=style.fillRef.createDuplicate();if(style.effectRef!=null)this.effectRef=style.effectRef.createDuplicate();if(style.fontRef!=null)this.fontRef=style.fontRef.createDuplicate()}},createDuplicate:function(){var duplicate=new CShapeStyle; if(this.lnRef!=null)duplicate.setLnRef(this.lnRef.createDuplicate());if(this.fillRef!=null)duplicate.setFillRef(this.fillRef.createDuplicate());if(this.effectRef!=null)duplicate.setEffectRef(this.effectRef.createDuplicate());if(this.fontRef!=null)duplicate.setFontRef(this.fontRef.createDuplicate());return duplicate},getObjectType:function(){return AscDFH.historyitem_type_ShapeStyle},setLnRef:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ShapeStyle_SetLnRef,this.lnRef, pr));this.lnRef=pr},setFillRef:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ShapeStyle_SetFillRef,this.fillRef,pr));this.fillRef=pr},setFontRef:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ShapeStyle_SetFontRef,this.fontRef,pr));this.fontRef=pr},setEffectRef:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ShapeStyle_SetEffectRef,this.effectRef,pr));this.effectRef=pr}};var LINE_PRESETS_MAP={};LINE_PRESETS_MAP["line"]= true;LINE_PRESETS_MAP["bracePair"]=true;LINE_PRESETS_MAP["leftBrace"]=true;LINE_PRESETS_MAP["rightBrace"]=true;LINE_PRESETS_MAP["bracketPair"]=true;LINE_PRESETS_MAP["leftBracket"]=true;LINE_PRESETS_MAP["rightBracket"]=true;LINE_PRESETS_MAP["bentConnector2"]=true;LINE_PRESETS_MAP["bentConnector3"]=true;LINE_PRESETS_MAP["bentConnector4"]=true;LINE_PRESETS_MAP["bentConnector5"]=true;LINE_PRESETS_MAP["curvedConnector2"]=true;LINE_PRESETS_MAP["curvedConnector3"]=true;LINE_PRESETS_MAP["curvedConnector4"]= true;LINE_PRESETS_MAP["curvedConnector5"]=true;LINE_PRESETS_MAP["straightConnector1"]=true;LINE_PRESETS_MAP["arc"]=true;function CreateDefaultShapeStyle(preset){var b_line=typeof preset==="string"&&LINE_PRESETS_MAP[preset];var tx_color=b_line;var unicolor;var style=new CShapeStyle;var lnRef=new StyleRef;lnRef.setIdx(b_line?1:2);unicolor=new CUniColor;unicolor.setColor(new CSchemeColor);unicolor.color.setId(g_clr_accent1);var mod=new CColorMod;mod.setName("shade");mod.setVal(5E4);unicolor.setMods(new CColorModifiers); unicolor.Mods.addMod(mod);lnRef.setColor(unicolor);style.setLnRef(lnRef);var fillRef=new StyleRef;unicolor=new CUniColor;unicolor.setColor(new CSchemeColor);unicolor.color.setId(g_clr_accent1);fillRef.setIdx(b_line?0:1);fillRef.setColor(unicolor);style.setFillRef(fillRef);var effectRef=new StyleRef;unicolor=new CUniColor;unicolor.setColor(new CSchemeColor);unicolor.color.setId(g_clr_accent1);effectRef.setIdx(0);effectRef.setColor(unicolor);style.setEffectRef(effectRef);var fontRef=new FontRef;unicolor= new CUniColor;unicolor.setColor(new CSchemeColor);unicolor.color.setId(tx_color?15:12);fontRef.setIdx(AscFormat.fntStyleInd_minor);fontRef.setColor(unicolor);style.setFontRef(fontRef);return style}function CXfrm(){this.offX=null;this.offY=null;this.extX=null;this.extY=null;this.chOffX=null;this.chOffY=null;this.chExtX=null;this.chExtY=null;this.flipH=null;this.flipV=null;this.rot=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CXfrm.prototype={Get_Id:function(){return this.Id}, getObjectType:function(){return AscDFH.historyitem_type_Xfrm},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},isNotNull:function(){return isRealNumber(this.offX)&&isRealNumber(this.offY)&&isRealNumber(this.extX)&&isRealNumber(this.extY)},isNotNullForGroup:function(){return isRealNumber(this.offX)&&isRealNumber(this.offY)&&isRealNumber(this.chOffX)&&isRealNumber(this.chOffY)&&isRealNumber(this.extX)&&isRealNumber(this.extY)&& isRealNumber(this.chExtX)&&isRealNumber(this.chExtY)},isEqual:function(xfrm){return xfrm&&this.offX==xfrm.offX&&this.offY==xfrm.offY&&this.extX==xfrm.extX&&this.extY==xfrm.extY&&this.chOffX==xfrm.chOffX&&this.chOffY==xfrm.chOffY&&this.chExtX==xfrm.chExtX&&this.chExtY==xfrm.chExtY},merge:function(xfrm){if(xfrm.offX!=null)this.offX=xfrm.offX;if(xfrm.offY!=null)this.offY=xfrm.offY;if(xfrm.extX!=null)this.extX=xfrm.extX;if(xfrm.extY!=null)this.extY=xfrm.extY;if(xfrm.chOffX!=null)this.chOffX=xfrm.chOffX; if(xfrm.chOffY!=null)this.chOffY=xfrm.chOffY;if(xfrm.chExtX!=null)this.chExtX=xfrm.chExtX;if(xfrm.chExtY!=null)this.chExtY=xfrm.chExtY;if(xfrm.flipH!=null)this.flipH=xfrm.flipH;if(xfrm.flipV!=null)this.flipV=xfrm.flipV;if(xfrm.rot!=null)this.rot=xfrm.rot},createDuplicate:function(){var duplicate=new CXfrm;duplicate.setOffX(this.offX);duplicate.setOffY(this.offY);duplicate.setExtX(this.extX);duplicate.setExtY(this.extY);duplicate.setChOffX(this.chOffX);duplicate.setChOffY(this.chOffY);duplicate.setChExtX(this.chExtX); duplicate.setChExtY(this.chExtY);duplicate.setFlipH(this.flipH);duplicate.setFlipV(this.flipV);duplicate.setRot(this.rot);return duplicate},setParent:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Xfrm_SetParent,this.parent,pr));this.parent=pr},setOffX:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetOffX,this.offX,pr));this.offX=pr;this.handleUpdatePosition()},setOffY:function(pr){History.CanAddChanges()&& History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetOffY,this.offY,pr));this.offY=pr;this.handleUpdatePosition()},setExtX:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetExtX,this.extX,pr));this.extX=pr;this.handleUpdateExtents(true)},setExtY:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetExtY,this.extY,pr));this.extY=pr;this.handleUpdateExtents(false)},setChOffX:function(pr){History.CanAddChanges()&& History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetChOffX,this.chOffX,pr));this.chOffX=pr;this.handleUpdateChildOffset()},setChOffY:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetChOffY,this.chOffY,pr));this.chOffY=pr;this.handleUpdateChildOffset()},setChExtX:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetChExtX,this.chExtX,pr));this.chExtX=pr;this.handleUpdateChildExtents()}, setChExtY:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetChExtY,this.chExtY,pr));this.chExtY=pr;this.handleUpdateChildExtents()},setFlipH:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Xfrm_SetFlipH,this.flipH,pr));this.flipH=pr;this.handleUpdateFlip()},setFlipV:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Xfrm_SetFlipV,this.flipV, pr));this.flipV=pr;this.handleUpdateFlip()},setRot:function(pr){History.CanAddChanges()&&History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Xfrm_SetRot,this.rot,pr));this.rot=pr;this.handleUpdateRot()},handleUpdatePosition:function(){if(this.parent&&this.parent.handleUpdatePosition)this.parent.handleUpdatePosition()},handleUpdateExtents:function(bExtX){if(this.parent&&this.parent.handleUpdateExtents)this.parent.handleUpdateExtents(bExtX)},handleUpdateChildOffset:function(){if(this.parent&& this.parent.handleUpdateChildOffset)this.parent.handleUpdateChildOffset()},handleUpdateChildExtents:function(){if(this.parent&&this.parent.handleUpdateChildExtents)this.parent.handleUpdateChildExtents()},handleUpdateFlip:function(){if(this.parent&&this.parent.handleUpdateFlip)this.parent.handleUpdateFlip()},handleUpdateRot:function(){if(this.parent&&this.parent.handleUpdateRot)this.parent.handleUpdateRot()},Refresh_RecalcData:function(data){switch(data.Type){case AscDFH.historyitem_Xfrm_SetOffX:{this.handleUpdatePosition(); break}case AscDFH.historyitem_Xfrm_SetOffY:{this.handleUpdatePosition();break}case AscDFH.historyitem_Xfrm_SetExtX:{this.handleUpdateExtents();break}case AscDFH.historyitem_Xfrm_SetExtY:{this.handleUpdateExtents();break}case AscDFH.historyitem_Xfrm_SetChOffX:{this.handleUpdateChildOffset();break}case AscDFH.historyitem_Xfrm_SetChOffY:{this.handleUpdateChildOffset();break}case AscDFH.historyitem_Xfrm_SetChExtX:{this.handleUpdateChildExtents();break}case AscDFH.historyitem_Xfrm_SetChExtY:{this.handleUpdateChildExtents(); break}case AscDFH.historyitem_Xfrm_SetFlipH:{this.handleUpdateFlip();break}case AscDFH.historyitem_Xfrm_SetFlipV:{this.handleUpdateFlip();break}case AscDFH.historyitem_Xfrm_SetRot:{this.handleUpdateRot();break}}}};function CEffectProperties(){this.EffectDag=null;this.EffectLst=null}CEffectProperties.prototype.createDuplicate=function(){var oCopy=new CEffectProperties;if(this.EffectDag)oCopy.EffectDag=this.EffectDag.createDuplicate();if(this.EffectLst)oCopy.EffectLst=this.EffectLst.createDuplicate(); return oCopy};CEffectProperties.prototype.Write_ToBinary=function(w){var nFlags=0;if(this.EffectDag)nFlags|=1;if(this.EffectLst)nFlags|=2;w.WriteLong(nFlags);if(this.EffectDag)this.EffectDag.Write_ToBinary(w);if(this.EffectLst)this.EffectLst.Write_ToBinary(w)};CEffectProperties.prototype.Read_FromBinary=function(r){var nFlags=r.GetLong();if(nFlags&1){this.EffectDag=new CEffectContainer;this.EffectDag.Read_FromBinary(r)}if(nFlags&2){this.EffectLst=new CEffectLst;this.EffectLst.Read_FromBinary(r)}}; function CEffectLst(){this.blur=null;this.fillOverlay=null;this.glow=null;this.innerShdw=null;this.outerShdw=null;this.prstShdw=null;this.reflection=null;this.softEdge=null}CEffectLst.prototype.createDuplicate=function(){var oCopy=new CEffectLst;if(this.blur)oCopy.blur=this.blur.createDuplicate();if(this.fillOverlay)oCopy.fillOverlay=this.fillOverlay.createDuplicate();if(this.glow)oCopy.glow=this.glow.createDuplicate();if(this.innerShdw)oCopy.innerShdw=this.innerShdw.createDuplicate();if(this.outerShdw)oCopy.outerShdw= this.outerShdw.createDuplicate();if(this.prstShdw)oCopy.prstShdw=this.prstShdw.createDuplicate();if(this.reflection)oCopy.reflection=this.reflection.createDuplicate();if(this.softEdge)oCopy.softEdge=this.softEdge.createDuplicate();return oCopy};CEffectLst.prototype.Write_ToBinary=function(w){var nFlags=0;if(this.blur)nFlags|=1;if(this.fillOverlay)nFlags|=2;if(this.glow)nFlags|=4;if(this.innerShdw)nFlags|=8;if(this.outerShdw)nFlags|=16;if(this.prstShdw)nFlags|=32;if(this.reflection)nFlags|=64;if(this.softEdge)nFlags|= 128;w.WriteLong(nFlags);if(this.blur)this.blur.Write_ToBinary(w);if(this.fillOverlay)this.fillOverlay.Write_ToBinary(w);if(this.glow)this.glow.Write_ToBinary(w);if(this.innerShdw)this.innerShdw.Write_ToBinary(w);if(this.outerShdw)this.outerShdw.Write_ToBinary(w);if(this.prstShdw)this.prstShdw.Write_ToBinary(w);if(this.reflection)this.reflection.Write_ToBinary(w);if(this.softEdge)this.softEdge.Write_ToBinary(w)};CEffectLst.prototype.Read_FromBinary=function(r){var nFlags=r.GetLong();if(nFlags&1){this.blur= new CBlur;r.GetLong();this.blur.Read_FromBinary(r)}if(nFlags&2){this.fillOverlay=new CFillOverlay;r.GetLong();this.fillOverlay.Read_FromBinary(r)}if(nFlags&4){this.glow=new CGlow;r.GetLong();this.glow.Read_FromBinary(r)}if(nFlags&8){this.innerShdw=new CInnerShdw;r.GetLong();this.innerShdw.Read_FromBinary(r)}if(nFlags&16){this.outerShdw=new COuterShdw;r.GetLong();this.outerShdw.Read_FromBinary(r)}if(nFlags&32){this.prstShdw=new CPrstShdw;r.GetLong();this.prstShdw.Read_FromBinary(r)}if(nFlags&64){this.reflection= new CReflection;r.GetLong();this.reflection.Read_FromBinary(r)}if(nFlags&128){this.softEdge=new CSoftEdge;r.GetLong();this.softEdge.Read_FromBinary(r)}};function CSpPr(){this.bwMode=0;this.xfrm=null;this.geometry=null;this.Fill=null;this.ln=null;this.parent=null;this.effectProps=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CSpPr.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(data){switch(data.Type){case AscDFH.historyitem_SpPr_SetParent:{break}case AscDFH.historyitem_SpPr_SetBwMode:{break}case AscDFH.historyitem_SpPr_SetXfrm:{break}case AscDFH.historyitem_SpPr_SetGeometry:case AscDFH.historyitem_SpPr_SetEffectPr:{this.handleUpdateGeometry(); break}case AscDFH.historyitem_SpPr_SetFill:{this.handleUpdateFill();break}case AscDFH.historyitem_SpPr_SetLn:{this.handleUpdateLn();break}}},Refresh_RecalcData2:function(data){},createDuplicate:function(){var duplicate=new CSpPr;duplicate.setBwMode(this.bwMode);if(this.xfrm){duplicate.setXfrm(this.xfrm.createDuplicate());duplicate.xfrm.setParent(duplicate)}if(this.geometry!=null)duplicate.setGeometry(this.geometry.createDuplicate());if(this.Fill!=null)duplicate.setFill(this.Fill.createDuplicate()); if(this.ln!=null)duplicate.setLn(this.ln.createDuplicate());if(this.effectProps)duplicate.setEffectPr(this.effectProps.createDuplicate());return duplicate},hasRGBFill:function(){return this.Fill&&this.Fill.fill&&this.Fill.fill.color&&this.Fill.fill.color.color&&this.Fill.fill.color.color.type===c_oAscColor.COLOR_TYPE_SRGB},checkUniFillRasterImageId:function(unifill){if(unifill&&unifill.fill&&typeof unifill.fill.RasterImageId==="string"&&unifill.fill.RasterImageId.length>0)return unifill.fill.RasterImageId; return null},checkBlipFillRasterImage:function(images){var fill_image_id=this.checkUniFillRasterImageId(this.Fill);if(fill_image_id!==null)images.push(fill_image_id);if(this.ln){var line_image_id=this.checkUniFillRasterImageId(this.ln.Fill);if(line_image_id)images.push(line_image_id)}},changeShadow:function(oShadow){if(oShadow){var oEffectProps=this.effectProps?this.effectProps.createDuplicate():new AscFormat.CEffectProperties;if(!oEffectProps.EffectLst)oEffectProps.EffectLst=new CEffectLst;oEffectProps.EffectLst.outerShdw= oShadow.createDuplicate();this.setEffectPr(oEffectProps)}else if(this.effectProps)if(this.effectProps.EffectLst)if(this.effectProps.EffectLst.outerShdw){var oEffectProps=this.effectProps.createDuplicate();oEffectProps.EffectLst.outerShdw=null;this.setEffectPr(oEffectProps)}},merge:function(spPr){if(spPr.geometry!=null)this.geometry=spPr.geometry.createDuplicate();if(spPr.Fill!=null&&spPr.Fill.fill!=null);},getObjectType:function(){return AscDFH.historyitem_type_SpPr},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SpPr_SetParent,this.parent,pr));this.parent=pr},setBwMode:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_SpPr_SetBwMode,this.bwMode,pr));this.bwMode=pr},setXfrm:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SpPr_SetXfrm,this.xfrm,pr));this.xfrm=pr},setGeometry:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_SpPr_SetGeometry,this.geometry,pr));this.geometry=pr;if(this.geometry)this.geometry.setParent(this);this.handleUpdateGeometry()},setFill:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_SpPr_SetFill,this.Fill,pr));this.Fill=pr;if(this.parent&&this.parent.handleUpdateFill)this.parent.handleUpdateFill()},setLn:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_SpPr_SetLn,this.ln,pr));this.ln=pr;if(this.parent&&this.parent.handleUpdateLn)this.parent.handleUpdateLn()}, setEffectPr:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_SpPr_SetEffectPr,this.effectProps,pr));this.effectProps=pr},handleUpdatePosition:function(){if(this.parent&&this.parent.handleUpdatePosition)this.parent.handleUpdatePosition()},handleUpdateExtents:function(bExtX){if(this.parent&&this.parent.handleUpdateExtents)this.parent.handleUpdateExtents(bExtX)},handleUpdateChildOffset:function(){if(this.parent&&this.parent.handleUpdateChildOffset)this.parent.handleUpdateChildOffset()}, handleUpdateChildExtents:function(){if(this.parent&&this.parent.handleUpdateChildExtents)this.parent.handleUpdateChildExtents()},handleUpdateFlip:function(){if(this.parent&&this.parent.handleUpdateFlip)this.parent.handleUpdateFlip()},handleUpdateRot:function(){if(this.parent&&this.parent.handleUpdateRot)this.parent.handleUpdateRot()},handleUpdateGeometry:function(){if(this.parent&&this.parent.handleUpdateGeometry)this.parent.handleUpdateGeometry()},handleUpdateFill:function(){if(this.parent&&this.parent.handleUpdateFill)this.parent.handleUpdateFill()}, handleUpdateLn:function(){if(this.parent&&this.parent.handleUpdateLn)this.parent.handleUpdateLn()}};var g_clr_MIN=0;var g_clr_accent1=0;var g_clr_accent2=1;var g_clr_accent3=2;var g_clr_accent4=3;var g_clr_accent5=4;var g_clr_accent6=5;var g_clr_dk1=6;var g_clr_dk2=7;var g_clr_folHlink=8;var g_clr_hlink=9;var g_clr_lt1=10;var g_clr_lt2=11;var g_clr_MAX=11;var g_clr_bg1=g_clr_lt1;var g_clr_bg2=g_clr_lt2;var g_clr_tx1=g_clr_dk1;var g_clr_tx2=g_clr_dk2;var phClr=14;var tx1=15;var tx2=16;function ClrScheme(){this.name= "";this.colors=[];for(var i=g_clr_MIN;i<=g_clr_MAX;i++)this.colors[i]=null}ClrScheme.prototype={isIdentical:function(clrScheme){if(!(clrScheme instanceof ClrScheme))return false;if(clrScheme.name!==this.name)return false;for(var _clr_index=g_clr_MIN;_clr_index<=g_clr_MAX;++_clr_index)if(this.colors[_clr_index]){if(!this.colors[_clr_index].IsIdentical(clrScheme.colors[_clr_index]))return false}else if(clrScheme.colors[_clr_index])return false;return true},createDuplicate:function(){var _duplicate= new ClrScheme;_duplicate.name=this.name;for(var _clr_index=0;_clr_index<=this.colors.length;++_clr_index)if(this.colors[_clr_index])_duplicate.colors[_clr_index]=this.colors[_clr_index].createDuplicate();return _duplicate},Write_ToBinary:function(w){w.WriteLong(this.colors.length);w.WriteString2(this.name);for(var i=0;i<this.colors.length;++i){w.WriteBool(isRealObject(this.colors[i]));if(isRealObject(this.colors[i]))this.colors[i].Write_ToBinary(w)}},Read_FromBinary:function(r){var len=r.GetLong(); this.name=r.GetString2();for(var i=0;i<len;++i)if(r.GetBool()){this.colors[i]=new CUniColor;this.colors[i].Read_FromBinary(r)}else this.colors[i]=null},setName:function(name){this.name=name},addColor:function(index,color){this.colors[index]=color}};function ClrMap(){this.color_map=[];for(var i=g_clr_MIN;i<=g_clr_MAX;i++)this.color_map[i]=null;if(g_oTableId.checkInit()){this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}}ClrMap.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){}, createDuplicate:function(){var _copy=new ClrMap;for(var _color_index=g_clr_MIN;_color_index<=this.color_map.length;++_color_index)_copy.setClr(_color_index,this.color_map[_color_index]);return _copy},compare:function(other){if(!other)return false;for(var i=g_clr_MIN;i<this.color_map.length;++i)if(this.color_map[i]!==other.color_map[i])return false;return true},getObjectType:function(){return AscDFH.historyitem_type_ClrMap},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)}, Read_FromBinary2:function(r){this.Id=r.GetString2()},setClr:function(index,clr){History.Add(new CChangesDrawingsContentLongMap(this,AscDFH.historyitem_ClrMap_SetClr,index,[clr],true));this.color_map[index]=clr}};function ExtraClrScheme(){this.clrScheme=null;this.clrMap=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}ExtraClrScheme.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_ExtraClrScheme}, setClrScheme:function(pr){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ExtraClrScheme_SetClrScheme,this.clrScheme,pr));this.clrScheme=pr},setClrMap:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ExtraClrScheme_SetClrMap,this.clrMap,pr));this.clrMap=pr},createDuplicate:function(){var ret=new ExtraClrScheme;if(this.clrScheme)ret.setClrScheme(this.clrScheme.createDuplicate());if(this.clrMap)ret.setClrMap(this.clrMap.createDuplicate());return ret},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()}};drawingConstructorsMap[AscDFH.historyitem_ExtraClrScheme_SetClrScheme]=ClrScheme;function FontCollection(fontScheme){this.latin=null;this.ea=null;this.cs=null;if(fontScheme)this.setFontScheme(fontScheme)}FontCollection.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},setFontScheme:function(fontScheme){this.fontScheme=fontScheme},getObjectType:function(){return AscDFH.historyitem_type_FontCollection}, setLatin:function(pr){this.latin=pr;if(this.fontScheme)this.fontScheme.checkFromFontCollection(pr,this,FONT_REGION_LT)},setEA:function(pr){this.ea=pr;if(this.fontScheme)this.fontScheme.checkFromFontCollection(pr,this,FONT_REGION_EA)},setCS:function(pr){this.cs=pr;if(this.fontScheme)this.fontScheme.checkFromFontCollection(pr,this,FONT_REGION_CS)},Write_ToBinary:function(w){writeString(w,this.latin);writeString(w,this.ea);writeString(w,this.cs)},Read_FromBinary:function(r){this.latin=readString(r); this.ea=readString(r);this.cs=readString(r);if(this.fontScheme){this.fontScheme.checkFromFontCollection(this.latin,this,FONT_REGION_LT);this.fontScheme.checkFromFontCollection(this.ea,this,FONT_REGION_EA);this.fontScheme.checkFromFontCollection(this.cs,this,FONT_REGION_CS)}}};function FontScheme(){this.name="";this.majorFont=new FontCollection(this);this.minorFont=new FontCollection(this);this.fontMap={"+mj-lt":undefined,"+mj-ea":undefined,"+mj-cs":undefined,"+mn-lt":undefined,"+mn-ea":undefined, "+mn-cs":undefined}}var FONT_REGION_LT=0;var FONT_REGION_EA=1;var FONT_REGION_CS=2;FontScheme.prototype={createDuplicate:function(){var oCopy=new FontScheme;oCopy.majorFont.setLatin(this.majorFont.latin);oCopy.majorFont.setEA(this.majorFont.ea);oCopy.majorFont.setCS(this.majorFont.cs);oCopy.minorFont.setLatin(this.minorFont.latin);oCopy.minorFont.setEA(this.minorFont.ea);oCopy.minorFont.setCS(this.minorFont.cs);return oCopy},Refresh_RecalcData:function(){},Write_ToBinary:function(w){this.majorFont.Write_ToBinary(w); this.minorFont.Write_ToBinary(w)},Read_FromBinary:function(r){this.majorFont.Read_FromBinary(r);this.minorFont.Read_FromBinary(r)},checkFromFontCollection:function(font,fontCollection,region){if(fontCollection===this.majorFont)switch(region){case FONT_REGION_LT:{this.fontMap["+mj-lt"]=font;break}case FONT_REGION_EA:{this.fontMap["+mj-ea"]=font;break}case FONT_REGION_CS:{this.fontMap["+mj-cs"]=font;break}}else if(fontCollection===this.minorFont)switch(region){case FONT_REGION_LT:{this.fontMap["+mn-lt"]= font;break}case FONT_REGION_EA:{this.fontMap["+mn-ea"]=font;break}case FONT_REGION_CS:{this.fontMap["+mn-cs"]=font;break}}},checkFont:function(font){if(g_oThemeFontsName[font])if(this.fontMap[font])return this.fontMap[font];else if(this.fontMap["+mn-lt"])return this.fontMap["+mn-lt"];else return"Arial";return font},getObjectType:function(){return AscDFH.historyitem_type_FontScheme},setName:function(pr){this.name=pr},setMajorFont:function(pr){this.majorFont=pr},setMinorFont:function(pr){this.minorFont= pr}};function FmtScheme(){this.name="";this.fillStyleLst=[];this.lnStyleLst=[];this.effectStyleLst=null;this.bgFillStyleLst=[]}FmtScheme.prototype={GetFillStyle:function(number,unicolor){if(number>=1&&number<=999){var ret=this.fillStyleLst[number-1];if(!ret)return null;var ret2=ret.createDuplicate();ret2.checkPhColor(unicolor);return ret2}else if(number>=1001){var ret=this.bgFillStyleLst[number-1001];if(!ret)return null;var ret2=ret.createDuplicate();ret2.checkPhColor(unicolor);return ret2}return null}, Write_ToBinary:function(w){writeString(w,this.name);var i;w.WriteLong(this.fillStyleLst.length);for(i=0;i<this.fillStyleLst.length;++i)this.fillStyleLst[i].Write_ToBinary(w);w.WriteLong(this.lnStyleLst.length);for(i=0;i<this.lnStyleLst.length;++i)this.lnStyleLst[i].Write_ToBinary(w);w.WriteLong(this.bgFillStyleLst.length);for(i=0;i<this.bgFillStyleLst.length;++i)this.bgFillStyleLst[i].Write_ToBinary(w)},Read_FromBinary:function(r){this.name=readString(r);var _len=r.GetLong(),i;for(i=0;i<_len;++i){this.fillStyleLst[i]= new CUniFill;this.fillStyleLst[i].Read_FromBinary(r)}_len=r.GetLong();for(i=0;i<_len;++i){this.lnStyleLst[i]=new CLn;this.lnStyleLst[i].Read_FromBinary(r)}_len=r.GetLong();for(i=0;i<_len;++i){this.bgFillStyleLst[i]=new CUniFill;this.bgFillStyleLst[i].Read_FromBinary(r)}},createDuplicate:function(){var oCopy=new FmtScheme;oCopy.name=this.name;var i;for(i=0;i<this.fillStyleLst.length;++i)oCopy.fillStyleLst[i]=this.fillStyleLst[i].createDuplicate();for(i=0;i<this.lnStyleLst.length;++i)oCopy.lnStyleLst[i]= this.lnStyleLst[i].createDuplicate();for(i=0;i<this.bgFillStyleLst.length;++i)oCopy.bgFillStyleLst[i]=this.bgFillStyleLst[i].createDuplicate();return oCopy},setName:function(pr){this.name=pr},addFillToStyleLst:function(pr){this.fillStyleLst.push(pr)},addLnToStyleLst:function(pr){this.lnStyleLst.push(pr)},addEffectToStyleLst:function(pr){this.effectStyleLst.push(pr)},addBgFillToStyleLst:function(pr){this.bgFillStyleLst.push(pr)}};function ThemeElements(){this.clrScheme=new ClrScheme;this.fontScheme= new FontScheme;this.fmtScheme=new FmtScheme}function CTheme(){this.name="";this.themeElements=new ThemeElements;this.spDef=null;this.lnDef=null;this.txDef=null;this.extraClrSchemeLst=[];this.isThemeOverride=false;this.presentation=null;this.clrMap=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CTheme.prototype={Get_Id:function(){return this.Id},createDuplicate:function(){var oTheme=new CTheme;oTheme.setName(this.name);oTheme.setColorScheme(this.themeElements.clrScheme.createDuplicate()); oTheme.setFontScheme(this.themeElements.fontScheme.createDuplicate());oTheme.setFormatScheme(this.themeElements.fmtScheme.createDuplicate());if(this.spDef)oTheme.setSpDef(this.spDef.createDuplicate());if(this.lnDef)oTheme.setLnDef(this.lnDef.createDuplicate());if(this.txDef)oTheme.setTxDef(this.txDef.createDuplicate());for(var i=0;i<this.extraClrSchemeLst.length;++i)oTheme.addExtraClrSceme(this.extraClrSchemeLst[i].createDuplicate());return oTheme},Document_Get_AllFontNames:function(AllFonts){var font_scheme= this.themeElements.fontScheme;var major_font=font_scheme.majorFont;typeof major_font.latin==="string"&&major_font.latin.length>0&&(AllFonts[major_font.latin]=1);typeof major_font.ea==="string"&&major_font.ea.length>0&&(AllFonts[major_font.ea]=1);typeof major_font.cs==="string"&&major_font.latin.length>0&&(AllFonts[major_font.cs]=1);var minor_font=font_scheme.minorFont;typeof minor_font.latin==="string"&&minor_font.latin.length>0&&(AllFonts[minor_font.latin]=1);typeof minor_font.ea==="string"&&minor_font.ea.length> 0&&(AllFonts[minor_font.ea]=1);typeof minor_font.cs==="string"&&minor_font.latin.length>0&&(AllFonts[minor_font.cs]=1)},getFillStyle:function(idx,unicolor){if(idx===0||idx===1E3)return AscFormat.CreateNoFillUniFill();var ret;if(idx>=1&&idx<=999){if(this.themeElements.fmtScheme.fillStyleLst[idx-1]){ret=this.themeElements.fmtScheme.fillStyleLst[idx-1].createDuplicate();if(ret){ret.checkPhColor(unicolor);return ret}}}else if(idx>=1001)if(this.themeElements.fmtScheme.bgFillStyleLst[idx-1001]){ret=this.themeElements.fmtScheme.bgFillStyleLst[idx- 1001].createDuplicate();if(ret){ret.checkPhColor(unicolor);return ret}}return CreateSolidFillRGBA(0,0,0,255)},getLnStyle:function(idx,unicolor){if(this.themeElements.fmtScheme.lnStyleLst[idx-1]){var ret=this.themeElements.fmtScheme.lnStyleLst[idx-1].createDuplicate();if(ret.Fill)ret.Fill.checkPhColor(unicolor);return ret}return new CLn},getExtraClrScheme:function(sName){for(var i=0;i<this.extraClrSchemeLst.length;++i)if(this.extraClrSchemeLst[i].clrScheme&&this.extraClrSchemeLst[i].clrScheme.name=== sName)return this.extraClrSchemeLst[i].clrScheme.createDuplicate();return null},changeColorScheme:function(clrScheme){var oCurClrScheme=this.themeElements.clrScheme;this.setColorScheme(clrScheme);var oOldAscColorScheme=AscCommon.getAscColorScheme(oCurClrScheme,this),aExtraAscClrSchemes=this.getExtraAscColorSchemes();var oNewAscColorScheme=AscCommon.getAscColorScheme(clrScheme,this);if(AscCommon.getIndexColorSchemeInArray(AscCommon.g_oUserColorScheme,oOldAscColorScheme)===-1)if(AscCommon.getIndexColorSchemeInArray(aExtraAscClrSchemes, oOldAscColorScheme)===-1){var oExtraClrScheme=new ExtraClrScheme;if(this.clrMap)oExtraClrScheme.setClrMap(this.clrMap.createDuplicate());oExtraClrScheme.setClrScheme(oCurClrScheme.createDuplicate());this.addExtraClrSceme(oExtraClrScheme,0);aExtraAscClrSchemes=this.getExtraAscColorSchemes()}var nIndex=AscCommon.getIndexColorSchemeInArray(aExtraAscClrSchemes,oNewAscColorScheme);if(nIndex>-1)this.removeExtraClrScheme(nIndex)},getExtraAscColorSchemes:function(){var asc_color_scheme;var aCustomSchemes= [];var _extra=this.extraClrSchemeLst;var _count=_extra.length;for(var i=0;i<_count;++i){var _scheme=_extra[i].clrScheme;asc_color_scheme=AscCommon.getAscColorScheme(_scheme,this);aCustomSchemes.push(asc_color_scheme)}return aCustomSchemes},setColorScheme:function(clrScheme){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ThemeSetColorScheme,this.themeElements.clrScheme,clrScheme));this.themeElements.clrScheme=clrScheme},setFontScheme:function(fontScheme){History.Add(new CChangesDrawingsObjectNoId(this, AscDFH.historyitem_ThemeSetFontScheme,this.themeElements.fontScheme,fontScheme));this.themeElements.fontScheme=fontScheme},setFormatScheme:function(fmtScheme){History.Add(new CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ThemeSetFmtScheme,this.themeElements.fmtScheme,fmtScheme));this.themeElements.fmtScheme=fmtScheme},setName:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_ThemeSetName,this.name,pr));this.name=pr},setIsThemeOverride:function(pr){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_ThemeSetIsThemeOverride,this.isThemeOverride,pr));this.isThemeOverride=pr},setSpDef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ThemeSetSpDef,this.spDef,pr));this.spDef=pr},setLnDef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ThemeSetLnDef,this.spDef,pr));this.lnDef=pr},setTxDef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ThemeSetTxDef,this.spDef,pr));this.txDef=pr},addExtraClrSceme:function(pr, idx){var pos;if(AscFormat.isRealNumber(idx))pos=idx;else pos=this.extraClrSchemeLst.length;History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_ThemeAddExtraClrScheme,pos,[pr],true));this.extraClrSchemeLst.splice(pos,0,pr)},removeExtraClrScheme:function(idx){if(idx>-1&&idx<this.extraClrSchemeLst.length)History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_ThemeRemoveExtraClrScheme,idx,this.extraClrSchemeLst.splice(idx,1),false))},GetWordDrawingObjects:function(){var oRet=typeof editor!== "undefined"&&editor.WordControl&&editor.WordControl.m_oLogicDocument&&editor.WordControl.m_oLogicDocument.DrawingObjects;return AscCommon.isRealObject(oRet)?oRet:null},Refresh_RecalcData:function(oData){if(oData)if(oData.Type===AscDFH.historyitem_ThemeSetColorScheme){var oWordGraphicObject=this.GetWordDrawingObjects();if(oWordGraphicObject){History.RecalcData_Add({All:true});for(var i=0;i<oWordGraphicObject.drawingObjects.length;++i)if(oWordGraphicObject.drawingObjects[i].GraphicObj){oWordGraphicObject.drawingObjects[i].GraphicObj.handleUpdateFill(); oWordGraphicObject.drawingObjects[i].GraphicObj.handleUpdateLn()}oWordGraphicObject.document.Api.chartPreviewManager.clearPreviews();oWordGraphicObject.document.Api.textArtPreviewManager.clear()}}},getObjectType:function(){return AscDFH.historyitem_type_Theme},Write_ToBinary2:function(w){w.WriteLong(AscDFH.historyitem_type_Theme);w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()}};function HF(){this.dt=null;this.ftr=null;this.hdr=null;this.sldNum=null;this.Id=g_oIdCounter.Get_NewId(); g_oTableId.Add(this,this.Id)}HF.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_HF},createDuplicate:function(){var ret=new HF;if(ret.dt!==this.dt)ret.setDt(this.dt);if(ret.ftr!==this.ftr)ret.setFtr(this.ftr);if(ret.hdr!==this.hdr)ret.setHdr(this.hdr);if(ret.sldNum!==this.sldNum)ret.setSldNum(this.sldNum);return ret},setDt:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_HF_SetDt,this.dt,pr)); this.dt=pr},setFtr:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_HF_SetFtr,this.ftr,pr));this.ftr=pr},setHdr:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_HF_SetHdr,this.hdr,pr));this.hdr=pr},setSldNum:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_HF_SetSldNum,this.sldNum,pr));this.sldNum=pr},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id= r.GetString2()}};function CBgPr(){this.Fill=null;this.shadeToTitle=false}CBgPr.prototype={Get_Id:function(){return this.Id},merge:function(bgPr){if(this.Fill==null){this.Fill=new CUniFill;if(bgPr.Fill!=null)this.Fill.merge(bgPr.Fill)}},createFullCopy:function(){var _copy=new CBgPr;if(this.Fill!=null)_copy.Fill=this.Fill.createDuplicate();_copy.shadeToTitle=this.shadeToTitle;return _copy},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_BgPr},setFill:function(pr){this.Fill= pr},setShadeToTitle:function(pr){this.shadeToTitle=pr},Write_ToBinary:function(w){w.WriteBool(isRealObject(this.Fill));if(isRealObject(this.Fill))this.Fill.Write_ToBinary(w);w.WriteBool(this.shadeToTitle)},Read_FromBinary:function(r){if(r.GetBool()){this.Fill=new CUniFill;this.Fill.Read_FromBinary(r)}this.shadeToTitle=r.GetBool()}};function CBg(){this.bwMode=null;this.bgPr=null;this.bgRef=null}CBg.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},setBwMode:function(pr){this.bwMode= pr},setBgPr:function(pr){this.bgPr=pr},setBgRef:function(pr){this.bgRef=pr},merge:function(bg){if(this.bgPr==null){this.bgPr=new CBgPr;if(bg.bgPr!=null)this.bgPr.merge(bg.bgPr)}},createFullCopy:function(){var _copy=new CBg;_copy.bwMode=this.bwMode;if(this.bgPr!=null)_copy.bgPr=this.bgPr.createFullCopy();if(this.bgRef!=null)_copy.bgRef=this.bgRef.createDuplicate();return _copy},Write_ToBinary:function(w){w.WriteBool(isRealObject(this.bgPr));if(isRealObject(this.bgPr))this.bgPr.Write_ToBinary(w);w.WriteBool(isRealObject(this.bgRef)); if(isRealObject(this.bgRef))this.bgRef.Write_ToBinary(w)},Read_FromBinary:function(r){if(r.GetBool()){this.bgPr=new CBgPr;this.bgPr.Read_FromBinary(r)}if(r.GetBool()){this.bgRef=new StyleRef;this.bgRef.Read_FromBinary(r)}}};function CSld(){this.name="";this.Bg=null;this.spTree=[]}function CTextStyle(){this.defPPr=null;this.lvl1pPr=null;this.lvl2pPr=null;this.lvl3pPr=null;this.lvl4pPr=null;this.lvl5pPr=null;this.lvl6pPr=null;this.lvl7pPr=null;this.lvl8pPr=null;this.lvl9pPr=null}CTextStyle.prototype= {Get_Id:function(){return this.Id},Refresh_RecalcData:function(){}};function CTextStyles(){this.titleStyle=null;this.bodyStyle=null;this.otherStyle=null}CTextStyles.prototype={Get_Id:function(){return this.Id},getStyleByPhType:function(phType){switch(phType){case AscFormat.phType_ctrTitle:case AscFormat.phType_title:{return this.titleStyle}case AscFormat.phType_body:case AscFormat.phType_subTitle:case AscFormat.phType_obj:case null:{return this.bodyStyle}default:{break}}return this.otherStyle},createDuplicate:function(){var ret= new CTextStyles;if(isRealObject(this.titleStyle))ret.titleStyle=this.titleStyle.createDuplicate();if(isRealObject(this.bodyStyle))ret.bodyStyle=this.bodyStyle.createDuplicate();if(isRealObject(this.otherStyle))ret.otherStyle=this.otherStyle.createDuplicate();return ret},Refresh_RecalcData:function(){},Write_ToBinary:function(w){w.WriteBool(isRealObject(this.titleStyle));if(isRealObject(this.titleStyle))this.titleStyle.Write_ToBinary(w);w.WriteBool(isRealObject(this.bodyStyle));if(isRealObject(this.bodyStyle))this.bodyStyle.Write_ToBinary(w); w.WriteBool(isRealObject(this.otherStyle));if(isRealObject(this.otherStyle))this.otherStyle.Write_ToBinary(w)},Read_FromBinary:function(r){if(r.GetBool()){this.titleStyle=new TextListStyle;this.titleStyle.Read_FromBinary(r)}else this.titleStyle=null;if(r.GetBool()){this.bodyStyle=new TextListStyle;this.bodyStyle.Read_FromBinary(r)}else this.bodyStyle=null;if(r.GetBool()){this.otherStyle=new TextListStyle;this.otherStyle.Read_FromBinary(r)}else this.otherStyle=null},Document_Get_AllFontNames:function(AllFonts){if(this.titleStyle)this.titleStyle.Document_Get_AllFontNames(AllFonts); if(this.bodyStyle)this.bodyStyle.Document_Get_AllFontNames(AllFonts);if(this.otherStyle)this.otherStyle.Document_Get_AllFontNames(AllFonts)}};var nSldLtTBlank=0;var nSldLtTChart=1;var nSldLtTChartAndTx=2;var nSldLtTClipArtAndTx=3;var nSldLtTClipArtAndVertTx=4;var nSldLtTCust=5;var nSldLtTDgm=6;var nSldLtTFourObj=7;var nSldLtTMediaAndTx=8;var nSldLtTObj=9;var nSldLtTObjAndTwoObj=10;var nSldLtTObjAndTx=11;var nSldLtTObjOnly=12;var nSldLtTObjOverTx=13;var nSldLtTObjTx=14;var nSldLtTPicTx=15;var nSldLtTSecHead= 16;var nSldLtTTbl=17;var nSldLtTTitle=18;var nSldLtTTitleOnly=19;var nSldLtTTwoColTx=20;var nSldLtTTwoObj=21;var nSldLtTTwoObjAndObj=22;var nSldLtTTwoObjAndTx=23;var nSldLtTTwoObjOverTx=24;var nSldLtTTwoTxTwoObj=25;var nSldLtTTx=26;var nSldLtTTxAndChart=27;var nSldLtTTxAndClipArt=28;var nSldLtTTxAndMedia=29;var nSldLtTTxAndObj=30;var nSldLtTTxAndTwoObj=31;var nSldLtTTxOverObj=32;var nSldLtTVertTitleAndTx=33;var nSldLtTVertTitleAndTxOverChart=34;var nSldLtTVertTx=35;var _ph_multiplier=4;var _weight_body= 9;var _weight_chart=5;var _weight_clipArt=2;var _weight_ctrTitle=11;var _weight_dgm=4;var _weight_media=3;var _weight_obj=8;var _weight_pic=7;var _weight_subTitle=10;var _weight_tbl=6;var _weight_title=11;var _ph_summ_blank=0;var _ph_summ_chart=Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_chart);var _ph_summ_chart_and_tx=Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_chart)+Math.pow(_ph_multiplier,_weight_body);var _ph_summ_dgm=Math.pow(_ph_multiplier, _weight_title)+Math.pow(_ph_multiplier,_weight_dgm);var _ph_summ_four_obj=Math.pow(_ph_multiplier,_weight_title)+4*Math.pow(_ph_multiplier,_weight_obj);var _ph_summ__media_and_tx=Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_media)+Math.pow(_ph_multiplier,_weight_body);var _ph_summ__obj=Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_obj);var _ph_summ__obj_and_two_obj=Math.pow(_ph_multiplier,_weight_title)+3*Math.pow(_ph_multiplier,_weight_obj);var _ph_summ__obj_and_tx= Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_obj)+Math.pow(_ph_multiplier,_weight_body);var _ph_summ__obj_only=Math.pow(_ph_multiplier,_weight_obj);var _ph_summ__pic_tx=Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_pic)+Math.pow(_ph_multiplier,_weight_body);var _ph_summ__sec_head=Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_subTitle);var _ph_summ__tbl=Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_tbl); var _ph_summ__title_only=Math.pow(_ph_multiplier,_weight_title);var _ph_summ__two_col_tx=Math.pow(_ph_multiplier,_weight_title)+2*Math.pow(_ph_multiplier,_weight_body);var _ph_summ__two_obj_and_tx=Math.pow(_ph_multiplier,_weight_title)+2*Math.pow(_ph_multiplier,_weight_obj)+Math.pow(_ph_multiplier,_weight_body);var _ph_summ__two_obj_and_two_tx=Math.pow(_ph_multiplier,_weight_title)+2*Math.pow(_ph_multiplier,_weight_obj)+2*Math.pow(_ph_multiplier,_weight_body);var _ph_summ__tx=Math.pow(_ph_multiplier, _weight_title)+Math.pow(_ph_multiplier,_weight_body);var _ph_summ__tx_and_clip_art=Math.pow(_ph_multiplier,_weight_title)+Math.pow(_ph_multiplier,_weight_body)+ +Math.pow(_ph_multiplier,_weight_clipArt);var _arr_lt_types_weight=[];_arr_lt_types_weight[0]=_ph_summ_blank;_arr_lt_types_weight[1]=_ph_summ_chart;_arr_lt_types_weight[2]=_ph_summ_chart_and_tx;_arr_lt_types_weight[3]=_ph_summ_dgm;_arr_lt_types_weight[4]=_ph_summ_four_obj;_arr_lt_types_weight[5]=_ph_summ__media_and_tx;_arr_lt_types_weight[6]= _ph_summ__obj;_arr_lt_types_weight[7]=_ph_summ__obj_and_two_obj;_arr_lt_types_weight[8]=_ph_summ__obj_and_tx;_arr_lt_types_weight[9]=_ph_summ__obj_only;_arr_lt_types_weight[10]=_ph_summ__pic_tx;_arr_lt_types_weight[11]=_ph_summ__sec_head;_arr_lt_types_weight[12]=_ph_summ__tbl;_arr_lt_types_weight[13]=_ph_summ__title_only;_arr_lt_types_weight[14]=_ph_summ__two_col_tx;_arr_lt_types_weight[15]=_ph_summ__two_obj_and_tx;_arr_lt_types_weight[16]=_ph_summ__two_obj_and_two_tx;_arr_lt_types_weight[17]=_ph_summ__tx; _arr_lt_types_weight[18]=_ph_summ__tx_and_clip_art;_arr_lt_types_weight.sort(AscCommon.fSortAscending);var _global_layout_summs_array={};_global_layout_summs_array["_"+_ph_summ_blank]=nSldLtTBlank;_global_layout_summs_array["_"+_ph_summ_chart]=nSldLtTChart;_global_layout_summs_array["_"+_ph_summ_chart_and_tx]=nSldLtTChartAndTx;_global_layout_summs_array["_"+_ph_summ_dgm]=nSldLtTDgm;_global_layout_summs_array["_"+_ph_summ_four_obj]=nSldLtTFourObj;_global_layout_summs_array["_"+_ph_summ__media_and_tx]= nSldLtTMediaAndTx;_global_layout_summs_array["_"+_ph_summ__obj]=nSldLtTObj;_global_layout_summs_array["_"+_ph_summ__obj_and_two_obj]=nSldLtTObjAndTwoObj;_global_layout_summs_array["_"+_ph_summ__obj_and_tx]=nSldLtTObjAndTx;_global_layout_summs_array["_"+_ph_summ__obj_only]=nSldLtTObjOnly;_global_layout_summs_array["_"+_ph_summ__pic_tx]=nSldLtTPicTx;_global_layout_summs_array["_"+_ph_summ__sec_head]=nSldLtTSecHead;_global_layout_summs_array["_"+_ph_summ__tbl]=nSldLtTTbl;_global_layout_summs_array["_"+ _ph_summ__title_only]=nSldLtTTitleOnly;_global_layout_summs_array["_"+_ph_summ__two_col_tx]=nSldLtTTwoColTx;_global_layout_summs_array["_"+_ph_summ__two_obj_and_tx]=nSldLtTTwoObjAndTx;_global_layout_summs_array["_"+_ph_summ__two_obj_and_two_tx]=nSldLtTTwoTxTwoObj;_global_layout_summs_array["_"+_ph_summ__tx]=nSldLtTTx;_global_layout_summs_array["_"+_ph_summ__tx_and_clip_art]=nSldLtTTxAndClipArt;function redrawSlide(slide,presentation,arrInd,pos,direction,arr_slides){if(slide){slide.recalculate();presentation.DrawingDocument.OnRecalculatePage(slide.num, slide)}if(direction==0){if(pos>0)presentation.backChangeThemeTimeOutId=setTimeout(function(){redrawSlide(arr_slides[arrInd[pos-1]],presentation,arrInd,pos-1,-1,arr_slides)},recalcSlideInterval);else presentation.backChangeThemeTimeOutId=null;if(pos<arrInd.length-1)presentation.forwardChangeThemeTimeOutId=setTimeout(function(){redrawSlide(arr_slides[arrInd[pos+1]],presentation,arrInd,pos+1,+1,arr_slides)},recalcSlideInterval);else presentation.forwardChangeThemeTimeOutId=null;presentation.startChangeThemeTimeOutId= null}if(direction>0)if(pos<arrInd.length-1)presentation.forwardChangeThemeTimeOutId=setTimeout(function(){redrawSlide(arr_slides[arrInd[pos+1]],presentation,arrInd,pos+1,+1,arr_slides)},recalcSlideInterval);else presentation.forwardChangeThemeTimeOutId=null;if(direction<0)if(pos>0)presentation.backChangeThemeTimeOutId=setTimeout(function(){redrawSlide(arr_slides[arrInd[pos-1]],presentation,arrInd,pos-1,-1,arr_slides)},recalcSlideInterval);else presentation.backChangeThemeTimeOutId=null}function CTextFit(){this.type= 0;this.fontScale=null;this.lnSpcReduction=null}CTextFit.prototype={CreateDublicate:function(){var d=new CTextFit;d.type=this.type;d.fontScale=this.fontScale;d.lnSpcReduction=this.lnSpcReduction;return d},Write_ToBinary:function(w){writeLong(w,this.type);writeLong(w,this.fontScale);writeLong(w,this.lnSpcReduction)},Read_FromBinary:function(r){this.type=readLong(r);this.fontScale=readLong(r);this.lnSpcReduction=readLong(r)},Get_Id:function(){return this.Id},Refresh_RecalcData:function(){}};var nOTClip= 0;var nOTEllipsis=1;var nOTOwerflow=2;var nTextATB=0;var nTextATCtr=1;var nTextATDist=2;var nTextATJust=3;var nTextATT=4;function CBodyPr(){this.flatTx=null;this.anchor=null;this.anchorCtr=null;this.bIns=null;this.compatLnSpc=null;this.forceAA=null;this.fromWordArt=null;this.horzOverflow=null;this.lIns=null;this.numCol=null;this.rIns=null;this.rot=null;this.rtlCol=null;this.spcCol=null;this.spcFirstLastPara=null;this.tIns=null;this.upright=null;this.vert=null;this.vertOverflow=null;this.wrap=null; this.textFit=null;this.prstTxWarp=null;this.parent=null}CBodyPr.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getLnSpcReduction:function(){if(this.textFit&&this.textFit.type===AscFormat.text_fit_NormAuto&&AscFormat.isRealNumber(this.textFit.lnSpcReduction))return this.textFit.lnSpcReduction/1E5;return undefined},getFontScale:function(){if(this.textFit&&this.textFit.type===AscFormat.text_fit_NormAuto&&AscFormat.isRealNumber(this.textFit.fontScale))return this.textFit.fontScale/ 1E5;return undefined},isNotNull:function(){return this.flatTx!==null||this.anchor!==null||this.anchorCtr!==null||this.bIns!==null||this.compatLnSpc!==null||this.forceAA!==null||this.fromWordArt!==null||this.horzOverflow!==null||this.lIns!==null||this.numCol!==null||this.rIns!==null||this.rot!==null||this.rtlCol!==null||this.spcCol!==null||this.spcFirstLastPara!==null||this.tIns!==null||this.upright!==null||this.vert!==null||this.vertOverflow!==null||this.wrap!==null||this.textFit!==null||this.prstTxWarp!== null},setAnchor:function(val){this.anchor=val},setVert:function(val){this.vert=val},setRot:function(val){this.rot=val},reset:function(){this.flatTx=null;this.anchor=null;this.anchorCtr=null;this.bIns=null;this.compatLnSpc=null;this.forceAA=null;this.fromWordArt=null;this.horzOverflow=null;this.lIns=null;this.numCol=null;this.rIns=null;this.rot=null;this.rtlCol=null;this.spcCol=null;this.spcFirstLastPara=null;this.tIns=null;this.upright=null;this.vert=null;this.vertOverflow=null;this.wrap=null;this.textFit= null;this.prstTxWarp=null},WritePrstTxWarp:function(w){w.WriteBool(isRealObject(this.prstTxWarp));if(isRealObject(this.prstTxWarp)){writeString(w,this.prstTxWarp.preset);var startPos=w.GetCurPosition(),countAv=0;w.Skip(4);for(var key in this.prstTxWarp.avLst)if(this.prstTxWarp.avLst.hasOwnProperty(key)){++countAv;w.WriteString2(key);w.WriteLong(this.prstTxWarp.gdLst[key])}var endPos=w.GetCurPosition();w.Seek(startPos);w.WriteLong(countAv);w.Seek(endPos)}},ReadPrstTxWarp:function(r){ExecuteNoHistory(function(){if(r.GetBool()){this.prstTxWarp= AscFormat.CreatePrstTxWarpGeometry(readString(r));var count=r.GetLong();for(var i=0;i<count;++i){var sAdj=r.GetString2();var nVal=r.GetLong();this.prstTxWarp.AddAdj(sAdj,15,nVal+"",undefined,undefined)}}},this,[])},Write_ToBinary2:function(w){var flag=this.flatTx!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.flatTx);flag=this.anchor!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.anchor);flag=this.anchorCtr!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.anchorCtr);flag=this.bIns!=null;w.WriteBool(flag); if(flag)w.WriteDouble(this.bIns);flag=this.compatLnSpc!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.compatLnSpc);flag=this.forceAA!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.forceAA);flag=this.fromWordArt!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.fromWordArt);flag=this.horzOverflow!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.horzOverflow);flag=this.lIns!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.lIns);flag=this.numCol!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.numCol); flag=this.rIns!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.rIns);flag=this.rot!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.rot);flag=this.rtlCol!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.rtlCol);flag=this.spcCol!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.spcCol);flag=this.spcFirstLastPara!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.spcFirstLastPara);flag=this.tIns!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.tIns);flag=this.upright!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.upright); flag=this.vert!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.vert);flag=this.vertOverflow!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.vertOverflow);flag=this.wrap!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.wrap);this.WritePrstTxWarp(w);w.WriteBool(isRealObject(this.textFit));if(this.textFit)this.textFit.Write_ToBinary(w)},Read_FromBinary2:function(r){var flag=r.GetBool();if(flag)this.flatTx=r.GetLong();flag=r.GetBool();if(flag)this.anchor=r.GetLong();flag=r.GetBool();if(flag)this.anchorCtr= r.GetBool();flag=r.GetBool();if(flag)this.bIns=r.GetDouble();flag=r.GetBool();if(flag)this.compatLnSpc=r.GetBool();flag=r.GetBool();if(flag)this.forceAA=r.GetBool();flag=r.GetBool();if(flag)this.fromWordArt=r.GetBool();flag=r.GetBool();if(flag)this.horzOverflow=r.GetLong();flag=r.GetBool();if(flag)this.lIns=r.GetDouble();flag=r.GetBool();if(flag)this.numCol=r.GetLong();flag=r.GetBool();if(flag)this.rIns=r.GetDouble();flag=r.GetBool();if(flag)this.rot=r.GetLong();flag=r.GetBool();if(flag)this.rtlCol= r.GetBool();flag=r.GetBool();if(flag)this.spcCol=r.GetDouble();flag=r.GetBool();if(flag)this.spcFirstLastPara=r.GetBool();flag=r.GetBool();if(flag)this.tIns=r.GetDouble();flag=r.GetBool();if(flag)this.upright=r.GetBool();flag=r.GetBool();if(flag)this.vert=r.GetLong();flag=r.GetBool();if(flag)this.vertOverflow=r.GetLong();flag=r.GetBool();if(flag)this.wrap=r.GetLong();this.ReadPrstTxWarp(r);if(r.GetBool()){this.textFit=new CTextFit;this.textFit.Read_FromBinary(r)}},setDefault:function(){this.flatTx= null;this.anchor=4;this.anchorCtr=false;this.bIns=45720/36E3;this.compatLnSpc=false;this.forceAA=false;this.fromWordArt=false;this.horzOverflow=nOTOwerflow;this.lIns=91440/36E3;this.numCol=1;this.rIns=91440/36E3;this.rot=null;this.rtlCol=false;this.spcCol=false;this.spcFirstLastPara=null;this.tIns=45720/36E3;this.upright=false;this.vert=AscFormat.nVertTThorz;this.vertOverflow=nOTOwerflow;this.wrap=AscFormat.nTWTSquare;this.prstTxWarp=null;this.textFit=null},createDuplicate:function(){var duplicate= new CBodyPr;duplicate.flatTx=this.flatTx;duplicate.anchor=this.anchor;duplicate.anchorCtr=this.anchorCtr;duplicate.bIns=this.bIns;duplicate.compatLnSpc=this.compatLnSpc;duplicate.forceAA=this.forceAA;duplicate.fromWordArt=this.fromWordArt;duplicate.horzOverflow=this.horzOverflow;duplicate.lIns=this.lIns;duplicate.numCol=this.numCol;duplicate.rIns=this.rIns;duplicate.rot=this.rot;duplicate.rtlCol=this.rtlCol;duplicate.spcCol=this.spcCol;duplicate.spcFirstLastPara=this.spcFirstLastPara;duplicate.tIns= this.tIns;duplicate.upright=this.upright;duplicate.vert=this.vert;duplicate.vertOverflow=this.vertOverflow;duplicate.wrap=this.wrap;if(this.prstTxWarp)duplicate.prstTxWarp=ExecuteNoHistory(function(){return this.prstTxWarp.createDuplicate()},this,[]);if(this.textFit)duplicate.textFit=this.textFit.CreateDublicate();return duplicate},merge:function(bodyPr){if(!bodyPr)return;if(bodyPr.flatTx!=null)this.flatTx=bodyPr.flatTx;if(bodyPr.anchor!=null)this.anchor=bodyPr.anchor;if(bodyPr.anchorCtr!=null)this.anchorCtr= bodyPr.anchorCtr;if(bodyPr.bIns!=null)this.bIns=bodyPr.bIns;if(bodyPr.compatLnSpc!=null)this.compatLnSpc=bodyPr.compatLnSpc;if(bodyPr.forceAA!=null)this.forceAA=bodyPr.forceAA;if(bodyPr.fromWordArt!=null)this.fromWordArt=bodyPr.fromWordArt;if(bodyPr.horzOverflow!=null)this.horzOverflow=bodyPr.horzOverflow;if(bodyPr.lIns!=null)this.lIns=bodyPr.lIns;if(bodyPr.numCol!=null)this.numCol=bodyPr.numCol;if(bodyPr.rIns!=null)this.rIns=bodyPr.rIns;if(bodyPr.rot!=null)this.rot=bodyPr.rot;if(bodyPr.rtlCol!=null)this.rtlCol= bodyPr.rtlCol;if(bodyPr.spcCol!=null)this.spcCol=bodyPr.spcCol;if(bodyPr.spcFirstLastPara!=null)this.spcFirstLastPara=bodyPr.spcFirstLastPara;if(bodyPr.tIns!=null)this.tIns=bodyPr.tIns;if(bodyPr.upright!=null)this.upright=bodyPr.upright;if(bodyPr.vert!=null)this.vert=bodyPr.vert;if(bodyPr.vertOverflow!=null)this.vertOverflow=bodyPr.vertOverflow;if(bodyPr.wrap!=null)this.wrap=bodyPr.wrap;if(bodyPr.prstTxWarp)this.prstTxWarp=ExecuteNoHistory(function(){return bodyPr.prstTxWarp.createDuplicate()},this, []);if(bodyPr.textFit)this.textFit=bodyPr.textFit.CreateDublicate();if(bodyPr.numCol!=null)this.numCol=bodyPr.numCol;return this},Write_ToBinary:function(w){var flag=this.flatTx!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.flatTx);flag=this.anchor!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.anchor);flag=this.anchorCtr!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.anchorCtr);flag=this.bIns!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.bIns);flag=this.compatLnSpc!=null;w.WriteBool(flag); if(flag)w.WriteBool(this.compatLnSpc);flag=this.forceAA!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.forceAA);flag=this.fromWordArt!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.fromWordArt);flag=this.horzOverflow!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.horzOverflow);flag=this.lIns!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.lIns);flag=this.numCol!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.numCol);flag=this.rIns!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.rIns); flag=this.rot!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.rot);flag=this.rtlCol!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.rtlCol);flag=this.spcCol!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.spcCol);flag=this.spcFirstLastPara!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.spcFirstLastPara);flag=this.tIns!=null;w.WriteBool(flag);if(flag)w.WriteDouble(this.tIns);flag=this.upright!=null;w.WriteBool(flag);if(flag)w.WriteBool(this.upright);flag=this.vert!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.vert); flag=this.vertOverflow!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.vertOverflow);flag=this.wrap!=null;w.WriteBool(flag);if(flag)w.WriteLong(this.wrap);this.WritePrstTxWarp(w);w.WriteBool(isRealObject(this.textFit));if(this.textFit)this.textFit.Write_ToBinary(w)},Read_FromBinary:function(r){var flag=r.GetBool();if(flag)this.flatTx=r.GetLong();flag=r.GetBool();if(flag)this.anchor=r.GetLong();flag=r.GetBool();if(flag)this.anchorCtr=r.GetBool();flag=r.GetBool();if(flag)this.bIns=r.GetDouble();flag= r.GetBool();if(flag)this.compatLnSpc=r.GetBool();flag=r.GetBool();if(flag)this.forceAA=r.GetBool();flag=r.GetBool();if(flag)this.fromWordArt=r.GetBool();flag=r.GetBool();if(flag)this.horzOverflow=r.GetLong();flag=r.GetBool();if(flag)this.lIns=r.GetDouble();flag=r.GetBool();if(flag)this.numCol=r.GetLong();flag=r.GetBool();if(flag)this.rIns=r.GetDouble();flag=r.GetBool();if(flag)this.rot=r.GetLong();flag=r.GetBool();if(flag)this.rtlCol=r.GetBool();flag=r.GetBool();if(flag)this.spcCol=r.GetDouble(); flag=r.GetBool();if(flag)this.spcFirstLastPara=r.GetBool();flag=r.GetBool();if(flag)this.tIns=r.GetDouble();flag=r.GetBool();if(flag)this.upright=r.GetBool();flag=r.GetBool();if(flag)this.vert=r.GetLong();flag=r.GetBool();if(flag)this.vertOverflow=r.GetLong();flag=r.GetBool();if(flag)this.wrap=r.GetLong();this.ReadPrstTxWarp(r);if(r.GetBool()){this.textFit=new CTextFit;this.textFit.Read_FromBinary(r)}}};function CHyperlink(){this.url="";this.action="";this.tooltip=null}CHyperlink.prototype={Get_Id:function(){return this.Id}, Refresh_RecalcData:function(){}};function CTextParagraphPr(){this.bullet=new CBullet;this.lvl=null;this.pPr=new CParaPr;this.rPr=new CTextPr}function CreateNoneBullet(){var ret=new CBullet;ret.bulletType=new CBulletType;ret.bulletType.type=BULLET_TYPE_BULLET_NONE;return ret}function CompareBullets(bullet1,bullet2){if(bullet1.bulletType&&bullet2.bulletType&&bullet1.bulletType.type===bullet2.bulletType.type){var ret=new CBullet;ret.bulletType=new CBulletType;switch(bullet1.bulletType.type){case BULLET_TYPE_BULLET_CHAR:{ret.bulletType.type= BULLET_TYPE_BULLET_CHAR;if(bullet1.bulletType.Char===bullet2.bulletType.Char)ret.bulletType.Char=bullet1.bulletType.Char;break}case BULLET_TYPE_BULLET_BLIP:{ret.bulletType.type=BULLET_TYPE_BULLET_CHAR;break}case BULLET_TYPE_BULLET_AUTONUM:{if(bullet1.bulletType.AutoNumType===bullet2.bulletType.AutoNumType)ret.bulletType.AutoNumType=bullet1.bulletType.AutoNumType;if(bullet1.bulletType.startAt===bullet2.bulletType.startAt)ret.bulletType.startAt=bullet1.bulletType.startAt;else ret.bulletType.startAt= undefined;if(bullet1.bulletType.type===bullet2.bulletType.type)ret.bulletType.type=bullet1.bulletType.type;break}}if(bullet1.bulletSize&&bullet2.bulletSize&&bullet1.bulletSize.val===bullet2.bulletSize.val&&bullet1.bulletSize.type===bullet2.bulletSize.type)ret.bulletSize=bullet1.bulletSize;if(bullet1.bulletColor&&bullet2.bulletColor&&bullet1.bulletColor.type===bullet2.bulletColor.type){ret.bulletColor=new CBulletColor;ret.bulletColor.type=bullet2.bulletColor.type;if(bullet1.bulletColor.UniColor)ret.bulletColor.UniColor= bullet1.bulletColor.UniColor.compare(bullet2.bulletColor.UniColor);if(!ret.bulletColor.UniColor||!ret.bulletColor.UniColor.color)ret.bulletColor=null}return ret}else return undefined}function CBullet(){this.bulletColor=null;this.bulletSize=null;this.bulletTypeface=null;this.bulletType=null;this.Bullet=null;this.FirstTextPr=null}CBullet.prototype.Set_FromObject=function(obj){if(obj){if(obj.bulletColor){this.bulletColor=new CBulletColor;this.bulletColor.Set_FromObject(obj.bulletColor)}else this.bulletColor= null;if(obj.bulletSize){this.bulletSize=new CBulletSize;this.bulletSize.Set_FromObject(obj.bulletSize)}else this.bulletSize=null;if(obj.bulletTypeface){this.bulletTypeface=new CBulletTypeface;this.bulletTypeface.Set_FromObject(obj.bulletTypeface)}else this.bulletTypeface=null}};CBullet.prototype.merge=function(oBullet){if(!oBullet)return;if(oBullet.bulletColor)if(!this.bulletColor)this.bulletColor=oBullet.bulletColor.createDuplicate();else this.bulletColor.merge(oBullet.bulletColor);if(oBullet.bulletSize)if(!this.bulletSize)this.bulletSize= oBullet.bulletSize.createDuplicate();else this.bulletSize.merge(oBullet.bulletSize);if(oBullet.bulletTypeface)if(!this.bulletTypeface)this.bulletTypeface=oBullet.bulletTypeface.createDuplicate();else this.bulletTypeface.merge(oBullet.bulletTypeface);if(oBullet.bulletType)if(!this.bulletType)this.bulletType=oBullet.bulletType.createDuplicate();else this.bulletType.merge(oBullet.bulletType)};CBullet.prototype.createDuplicate=function(){var duplicate=new CBullet;if(this.bulletColor)duplicate.bulletColor= this.bulletColor.createDuplicate();if(this.bulletSize)duplicate.bulletSize=this.bulletSize.createDuplicate();if(this.bulletTypeface)duplicate.bulletTypeface=this.bulletTypeface.createDuplicate();if(this.bulletType)duplicate.bulletType=this.bulletType.createDuplicate();duplicate.Bullet=this.Bullet;return duplicate};CBullet.prototype.isBullet=function(){return this.bulletType!=null&&this.bulletType.type!=null};CBullet.prototype.getPresentationBullet=function(theme,color){var para_pr=new CParaPr;para_pr.Bullet= this;return para_pr.Get_PresentationBullet(theme,color)};CBullet.prototype.getBulletType=function(theme,color){return this.getPresentationBullet(theme,color).m_nType};CBullet.prototype.Write_ToBinary=function(w){w.WriteBool(isRealObject(this.bulletColor));if(isRealObject(this.bulletColor))this.bulletColor.Write_ToBinary(w);w.WriteBool(isRealObject(this.bulletSize));if(isRealObject(this.bulletSize))this.bulletSize.Write_ToBinary(w);w.WriteBool(isRealObject(this.bulletTypeface));if(isRealObject(this.bulletTypeface))this.bulletTypeface.Write_ToBinary(w); w.WriteBool(isRealObject(this.bulletType));if(isRealObject(this.bulletType))this.bulletType.Write_ToBinary(w)};CBullet.prototype.Read_FromBinary=function(r){if(r.GetBool()){this.bulletColor=new CBulletColor;this.bulletColor.Read_FromBinary(r)}if(r.GetBool()){this.bulletSize=new CBulletSize;this.bulletSize.Read_FromBinary(r)}if(r.GetBool()){this.bulletTypeface=new CBulletTypeface;this.bulletTypeface.Read_FromBinary(r)}if(r.GetBool()){this.bulletType=new CBulletType;this.bulletType.Read_FromBinary(r)}}; CBullet.prototype.Get_AllFontNames=function(AllFonts){if(this.bulletTypeface&&typeof this.bulletTypeface.typeface==="string"&&this.bulletTypeface.typeface.length>0)AllFonts[this.bulletTypeface.typeface]=true};CBullet.prototype.putNumStartAt=function(NumStartAt){if(!this.bulletType)this.bulletType=new CBulletType;this.bulletType.type=AscFormat.BULLET_TYPE_BULLET_AUTONUM;this.bulletType.startAt=NumStartAt};CBullet.prototype.getNumStartAt=function(){if(this.bulletType)if(AscFormat.isRealNumber(this.bulletType.startAt))return Math.max(1, this.bulletType.startAt);return undefined};CBullet.prototype.isEqual=function(oBullet){if(!oBullet)return false;if(!this.bulletColor&&oBullet.bulletColor||!oBullet.bulletColor&&this.bulletColor)return false;if(this.bulletColor&&oBullet.bulletColor)if(!this.bulletColor.IsIdentical(oBullet.bulletColor))return false;if(!this.bulletSize&&oBullet.bulletSize||this.bulletSize&&!oBullet.bulletSize)return false;if(this.bulletSize&&oBullet.bulletSize)if(!this.bulletSize.IsIdentical(oBullet.bulletSize))return false; if(!this.bulletTypeface&&oBullet.bulletTypeface||this.bulletTypeface&&!oBullet.bulletTypeface)return false;if(this.bulletTypeface&&oBullet.bulletTypeface)if(!this.bulletTypeface.IsIdentical(oBullet.bulletTypeface))return false;if(!this.bulletType&&oBullet.bulletType||this.bulletType&&!oBullet.bulletType)return false;if(this.bulletType&&oBullet.bulletType)if(!this.bulletType.IsIdentical(oBullet.bulletType))return false;return true};var prot=CBullet.prototype;prot.asc_getSize=function(){var nRet=100; if(this.bulletSize)switch(this.bulletSize.type){case AscFormat.BULLET_TYPE_SIZE_NONE:{break}case AscFormat.BULLET_TYPE_SIZE_TX:{break}case AscFormat.BULLET_TYPE_SIZE_PCT:{nRet=this.bulletSize.val/1E3;break}case AscFormat.BULLET_TYPE_SIZE_PTS:{break}}return nRet};prot["get_Size"]=prot["asc_getSize"]=CBullet.prototype.asc_getSize;prot.asc_putSize=function(Size){if(AscFormat.isRealNumber(Size)){this.bulletSize=new AscFormat.CBulletSize;this.bulletSize.type=AscFormat.BULLET_TYPE_SIZE_PCT;this.bulletSize.val= Size*1E3>>0}};prot["put_Size"]=prot["asc_putSize"]=CBullet.prototype.asc_putSize;prot.asc_getColor=function(){if(this.bulletColor){if(this.bulletColor.UniColor)return AscCommon.CreateAscColor(this.bulletColor.UniColor)}else{var FirstTextPr=this.FirstTextPr;if(FirstTextPr&&FirstTextPr.Unifill)if(FirstTextPr.Unifill.fill instanceof AscFormat.CSolidFill&&FirstTextPr.Unifill.fill.color)return AscCommon.CreateAscColor(FirstTextPr.Unifill.fill.color);else{var RGBA=FirstTextPr.Unifill.getRGBAColor();return AscCommon.CreateAscColorCustom(RGBA.R, RGBA.G,RGBA.B)}}return AscCommon.CreateAscColorCustom(0,0,0)};prot["get_Color"]=prot["asc_getColor"]=prot.asc_getColor;prot.asc_putColor=function(color){this.bulletColor=new AscFormat.CBulletColor;this.bulletColor.type=AscFormat.BULLET_TYPE_COLOR_CLR;this.bulletColor.UniColor=AscFormat.CorrectUniColor(color,this.bulletColor.UniColor,0)};prot["put_Color"]=prot["asc_putColor"]=prot.asc_putColor;prot.asc_getFont=function(){var sRet="";if(this.bulletTypeface&&this.bulletTypeface.type===AscFormat.BULLET_TYPE_TYPEFACE_BUFONT&& typeof this.bulletTypeface.typeface==="string"&&this.bulletTypeface.typeface.length>0)sRet=this.bulletTypeface.typeface;else{var FirstTextPr=this.FirstTextPr;if(FirstTextPr&&FirstTextPr.FontFamily&&typeof FirstTextPr.FontFamily.Name==="string"&&FirstTextPr.FontFamily.Name.length>0)sRet=FirstTextPr.FontFamily.Name}return sRet};prot["get_Font"]=prot["asc_getFont"]=prot.asc_getFont;prot.asc_putFont=function(val){if(typeof val==="string"&&val.length>0){this.bulletTypeface=new AscFormat.CBulletTypeface; this.bulletTypeface.type=AscFormat.BULLET_TYPE_TYPEFACE_BUFONT;this.bulletTypeface.typeface=val}};prot["put_Font"]=prot["asc_putFont"]=prot.asc_putFont;prot.asc_putNumStartAt=function(NumStartAt){this.putNumStartAt(NumStartAt)};prot["put_NumStartAt"]=prot["asc_putNumStartAt"]=prot.asc_putNumStartAt;prot.asc_getNumStartAt=function(){return this.getNumStartAt()};prot["get_NumStartAt"]=prot["asc_getNumStartAt"]=prot.asc_getNumStartAt;prot.asc_getSymbol=function(){if(this.bulletType&&this.bulletType.type=== AscFormat.BULLET_TYPE_BULLET_CHAR)return this.bulletType.Char;return undefined};prot["get_Symbol"]=prot["asc_getSymbol"]=prot.asc_getSymbol;prot.asc_putSymbol=function(v){if(!this.bulletType)this.bulletType=new CBulletType;this.bulletType.AutoNumType=0;this.bulletType.type=AscFormat.BULLET_TYPE_BULLET_CHAR;this.bulletType.Char=v};prot["put_Symbol"]=prot["asc_putSymbol"]=prot.asc_putSymbol;prot.asc_putAutoNumType=function(val){if(!this.bulletType)this.bulletType=new CBulletType;this.bulletType.type= AscFormat.BULLET_TYPE_BULLET_AUTONUM;this.bulletType.AutoNumType=AscFormat.getNumberingType(val)};prot["put_AutoNumType"]=prot["asc_putAutoNumType"]=prot.asc_putAutoNumType;prot.asc_getAutoNumType=function(){if(this.bulletType&&this.bulletType.type===AscFormat.BULLET_TYPE_BULLET_AUTONUM)return AscFormat.fGetListTypeFromBullet(this).SubType;return-1};prot["get_AutoNumType"]=prot["asc_getAutoNumType"]=prot.asc_getAutoNumType;prot.asc_putListType=function(type,subtype){var NumberInfo={Type:type,SubType:subtype}; AscFormat.fFillBullet(NumberInfo,this)};prot["put_ListType"]=prot["asc_putListType"]=prot.asc_putListType;prot.asc_getListType=function(){return new AscCommon.asc_CListType(AscFormat.fGetListTypeFromBullet(this))};prot.asc_getType=function(){return this.bulletType&&this.bulletType.type};prot["get_Type"]=prot["asc_getType"]=prot.asc_getType;window["Asc"]["asc_CBullet"]=window["Asc"].asc_CBullet=CBullet;function CBulletColor(){this.type=AscFormat.BULLET_TYPE_COLOR_CLRTX;this.UniColor=null}CBulletColor.prototype.Set_FromObject= function(o){this.merge(o)};CBulletColor.prototype.merge=function(oBulletColor){if(!oBulletColor)return;if(oBulletColor.UniColor){this.type=oBulletColor.type;this.UniColor=oBulletColor.UniColor.createDuplicate()}};CBulletColor.prototype.IsIdentical=function(oBulletColor){if(!oBulletColor)return false;if(this.type!==oBulletColor.type)return false;if(this.UniColor&&!oBulletColor.UniColor||oBulletColor.UniColor&&!this.UniColor)return false;if(this.UniColor)if(!this.UniColor.IsIdentical(oBulletColor.UniColor))return false; return true};CBulletColor.prototype.createDuplicate=function(){var duplicate=new CBulletColor;duplicate.type=this.type;if(this.UniColor!=null)duplicate.UniColor=this.UniColor.createDuplicate();return duplicate};CBulletColor.prototype.Write_ToBinary=function(w){w.WriteBool(isRealNumber(this.type));if(isRealNumber(this.type))w.WriteLong(this.type);w.WriteBool(isRealObject(this.UniColor));if(isRealObject(this.UniColor))this.UniColor.Write_ToBinary(w)};CBulletColor.prototype.Read_FromBinary=function(r){if(r.GetBool())this.type= r.GetLong();if(r.GetBool()){this.UniColor=new CUniColor;this.UniColor.Read_FromBinary(r)}};function CBulletSize(){this.type=AscFormat.BULLET_TYPE_SIZE_NONE;this.val=0}CBulletSize.prototype={Set_FromObject:function(o){this.merge(o)},merge:function(oBulletSize){if(!oBulletSize)return;this.type=oBulletSize.type;this.val=oBulletSize.val},createDuplicate:function(){var d=new CBulletSize;d.type=this.type;d.val=this.val;return d},IsIdentical:function(oBulletSize){if(!oBulletSize)return false;return this.type=== oBulletSize.type&&this.val===oBulletSize.val},Write_ToBinary:function(w){w.WriteBool(isRealNumber(this.type));if(isRealNumber(this.type))w.WriteLong(this.type);w.WriteBool(isRealNumber(this.val));if(isRealNumber(this.val))w.WriteLong(this.val)},Read_FromBinary:function(r){if(r.GetBool())this.type=r.GetLong();if(r.GetBool())this.val=r.GetLong()}};function CBulletTypeface(){this.type=AscFormat.BULLET_TYPE_TYPEFACE_NONE;this.typeface=""}CBulletTypeface.prototype={Set_FromObject:function(o){this.merge(o)}, createDuplicate:function(){var d=new CBulletTypeface;d.type=this.type;d.typeface=this.typeface;return d},merge:function(oBulletTypeface){if(!oBulletTypeface)return;this.type=oBulletTypeface.type;this.typeface=oBulletTypeface.typeface},IsIdentical:function(oBulletTypeface){if(!oBulletTypeface)return false;return this.type===oBulletTypeface.type&&this.typeface===oBulletTypeface.typeface},Write_ToBinary:function(w){w.WriteBool(isRealNumber(this.type));if(isRealNumber(this.type))w.WriteLong(this.type); w.WriteBool(typeof this.typeface==="string");if(typeof this.typeface==="string")w.WriteString2(this.typeface)},Read_FromBinary:function(r){if(r.GetBool())this.type=r.GetLong();if(r.GetBool())this.typeface=r.GetString2()}};var BULLET_TYPE_BULLET_NONE=0;var BULLET_TYPE_BULLET_CHAR=1;var BULLET_TYPE_BULLET_AUTONUM=2;var BULLET_TYPE_BULLET_BLIP=3;function CBulletType(){this.type=null;this.Char=null;this.AutoNumType=null;this.startAt=null}CBulletType.prototype={Set_FromObject:function(o){this.merge(o)}, IsIdentical:function(oBulletType){if(!oBulletType)return false;return this.type===oBulletType.type&&this.Char===oBulletType.Char&&this.AutoNumType===oBulletType.AutoNumType&&this.startAt===oBulletType.startAt},merge:function(oBulletType){if(!oBulletType)return;if(oBulletType.type!==null&&this.type!==oBulletType.type){this.type=oBulletType.type;this.Char=oBulletType.Char;this.AutoNumType=oBulletType.AutoNumType;this.startAt=oBulletType.startAt}else{if(this.type===AscFormat.BULLET_TYPE_BULLET_CHAR)if(typeof oBulletType.Char=== "string"&&oBulletType.Char.length>0)if(this.Char!==oBulletType.Char)this.Char=oBulletType.Char;if(this.type===AscFormat.BULLET_TYPE_BULLET_AUTONUM){if(oBulletType.AutoNumType!==null&&this.AutoNumType!==oBulletType.AutoNumType)this.AutoNumType=oBulletType.AutoNumType;if(oBulletType.startAt!==null&&this.startAt!==oBulletType.startAt)this.startAt=oBulletType.startAt}}},createDuplicate:function(){var d=new CBulletType;d.type=this.type;d.Char=this.Char;d.AutoNumType=this.AutoNumType;d.startAt=this.startAt; return d},Write_ToBinary:function(w){w.WriteBool(isRealNumber(this.type));if(isRealNumber(this.type))w.WriteLong(this.type);w.WriteBool(typeof this.Char==="string");if(typeof this.Char==="string")w.WriteString2(this.Char);w.WriteBool(isRealNumber(this.AutoNumType));if(isRealNumber(this.AutoNumType))w.WriteLong(this.AutoNumType);w.WriteBool(isRealNumber(this.startAt));if(isRealNumber(this.startAt))w.WriteLong(this.startAt)},Read_FromBinary:function(r){if(r.GetBool())this.type=r.GetLong();if(r.GetBool()){this.Char= r.GetString2();if(AscFonts.IsCheckSymbols)AscFonts.FontPickerByCharacter.getFontsByString(this.Char)}if(r.GetBool())this.AutoNumType=r.GetLong();if(r.GetBool())this.startAt=r.GetLong()}};function TextListStyle(){this.levels=new Array(10);for(var i=0;i<10;i++)this.levels[i]=null}TextListStyle.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var duplicate=new TextListStyle;for(var i=0;i<10;++i)if(this.levels[i]!=null)duplicate.levels[i]=this.levels[i].Copy(); return duplicate},Write_ToBinary:function(w){for(var i=0;i<10;++i){w.WriteBool(isRealObject(this.levels[i]));if(isRealObject(this.levels[i]))this.levels[i].Write_ToBinary(w)}},Read_FromBinary:function(r){for(var i=0;i<10;++i)if(r.GetBool()){this.levels[i]=new CParaPr;this.levels[i].Read_FromBinary(r)}else this.levels[i]=null},merge:function(oTextListStyle){if(!oTextListStyle)return;for(var i=0;i<this.levels.length;++i)if(oTextListStyle.levels[i])if(this.levels[i])this.levels[i].Merge(oTextListStyle.levels[i]); else this.levels[i]=oTextListStyle.levels[i].Copy()},Document_Get_AllFontNames:function(AllFonts){for(var i=0;i<10;++i)if(this.levels[i]){if(this.levels[i].DefaultRunPr)this.levels[i].DefaultRunPr.Document_Get_AllFontNames(AllFonts);if(this.levels[i].Bullet)this.levels[i].Bullet.Get_AllFontNames(AllFonts)}}};function GenerateDefaultTheme(presentation,opt_fontName){return ExecuteNoHistory(function(){if(!opt_fontName)opt_fontName="Arial";var theme=new CTheme;theme.presentation=presentation;theme.setFontScheme(new FontScheme); theme.themeElements.fontScheme.setMajorFont(new FontCollection(theme.themeElements.fontScheme));theme.themeElements.fontScheme.setMinorFont(new FontCollection(theme.themeElements.fontScheme));theme.themeElements.fontScheme.majorFont.setLatin(opt_fontName);theme.themeElements.fontScheme.minorFont.setLatin(opt_fontName);var scheme=theme.themeElements.clrScheme;scheme.colors[8]=CreateUniColorRGB(0,0,0);scheme.colors[12]=CreateUniColorRGB(255,255,255);scheme.colors[9]=CreateUniColorRGB(31,73,125);scheme.colors[13]= CreateUniColorRGB(238,236,225);scheme.colors[0]=CreateUniColorRGB(79,129,189);scheme.colors[1]=CreateUniColorRGB(192,80,77);scheme.colors[2]=CreateUniColorRGB(155,187,89);scheme.colors[3]=CreateUniColorRGB(128,100,162);scheme.colors[4]=CreateUniColorRGB(75,172,198);scheme.colors[5]=CreateUniColorRGB(247,150,70);scheme.colors[11]=CreateUniColorRGB(0,0,255);scheme.colors[10]=CreateUniColorRGB(128,0,128);var brush=new CUniFill;brush.setFill(new CSolidFill);brush.fill.setColor(new CUniColor);brush.fill.color.setColor(new CSchemeColor); brush.fill.color.color.setId(phClr);theme.themeElements.fmtScheme.fillStyleLst.push(brush);brush=new CUniFill;brush.setFill(new CSolidFill);brush.fill.setColor(new CUniColor);brush.fill.color.setColor(CreateUniColorRGB(0,0,0));theme.themeElements.fmtScheme.fillStyleLst.push(brush);brush=new CUniFill;brush.setFill(new CSolidFill);brush.fill.setColor(new CUniColor);brush.fill.color.setColor(CreateUniColorRGB(0,0,0));theme.themeElements.fmtScheme.fillStyleLst.push(brush);brush=new CUniFill;brush.setFill(new CSolidFill); brush.fill.setColor(new CUniColor);brush.fill.color.setColor(new CSchemeColor);brush.fill.color.color.setId(phClr);theme.themeElements.fmtScheme.bgFillStyleLst.push(brush);brush=AscFormat.CreateUniFillByUniColor(AscFormat.CreateUniColorRGB(0,0,0));theme.themeElements.fmtScheme.bgFillStyleLst.push(brush);brush=AscFormat.CreateUniFillByUniColor(AscFormat.CreateUniColorRGB(0,0,0));theme.themeElements.fmtScheme.bgFillStyleLst.push(brush);var pen=new CLn;pen.setW(9525);pen.setFill(new CUniFill);pen.Fill.setFill(new CSolidFill); pen.Fill.fill.setColor(new CUniColor);pen.Fill.fill.color.setColor(new CSchemeColor);pen.Fill.fill.color.color.setId(phClr);pen.Fill.fill.color.setMods(new CColorModifiers);var mod=new CColorMod;mod.setName("shade");mod.setVal(95E3);pen.Fill.fill.color.Mods.addMod(mod);mod=new CColorMod;mod.setName("satMod");mod.setVal(105E3);pen.Fill.fill.color.Mods.addMod(mod);theme.themeElements.fmtScheme.lnStyleLst.push(pen);pen=new CLn;pen.setW(25400);pen.setFill(new CUniFill);pen.Fill.setFill(new CSolidFill); pen.Fill.fill.setColor(new CUniColor);pen.Fill.fill.color.setColor(new CSchemeColor);pen.Fill.fill.color.color.setId(phClr);theme.themeElements.fmtScheme.lnStyleLst.push(pen);pen=new CLn;pen.setW(38100);pen.setFill(new CUniFill);pen.Fill.setFill(new CSolidFill);pen.Fill.fill.setColor(new CUniColor);pen.Fill.fill.color.setColor(new CSchemeColor);pen.Fill.fill.color.color.setId(phClr);theme.themeElements.fmtScheme.lnStyleLst.push(pen);theme.extraClrSchemeLst=[];return theme},this,[])}function GenerateDefaultMasterSlide(theme){var master= new MasterSlide(theme.presentation,theme);master.Theme=theme;master.sldLayoutLst[0]=GenerateDefaultSlideLayout(master);return master}function GenerateDefaultSlideLayout(master){var layout=new SlideLayout;layout.Theme=master.Theme;layout.Master=master;return layout}function GenerateDefaultSlide(layout){var slide=new Slide(layout.Master.presentation,layout,0);slide.Master=layout.Master;slide.Theme=layout.Master.Theme;slide.setNotes(AscCommonSlide.CreateNotes());slide.notes.setNotesMaster(layout.Master.presentation.notesMasters[0]); slide.notes.setSlide(slide);return slide}function CreateDefaultTextRectStyle(){var style=new CShapeStyle;var lnRef=new StyleRef;lnRef.setIdx(0);var unicolor=new CUniColor;unicolor.setColor(new CSchemeColor);unicolor.color.setId(g_clr_accent1);var mod=new CColorMod;mod.setName("shade");mod.setVal(5E4);unicolor.setMods(new CColorModifiers);unicolor.Mods.addMod(mod);lnRef.setColor(unicolor);style.setLnRef(lnRef);var fillRef=new StyleRef;fillRef.setIdx(0);unicolor=new CUniColor;unicolor.setColor(new CSchemeColor); unicolor.color.setId(g_clr_accent1);fillRef.setColor(unicolor);style.setFillRef(fillRef);var effectRef=new StyleRef;effectRef.setIdx(0);unicolor=new CUniColor;unicolor.setColor(new CSchemeColor);unicolor.color.setId(g_clr_accent1);effectRef.setColor(unicolor);style.setEffectRef(effectRef);var fontRef=new FontRef;fontRef.setIdx(AscFormat.fntStyleInd_minor);unicolor=new CUniColor;unicolor.setColor(new CSchemeColor);unicolor.color.setId(8);fontRef.setColor(unicolor);style.setFontRef(fontRef);return style} function GenerateDefaultColorMap(){var clrMap=new ClrMap;clrMap.color_map[0]=0;clrMap.color_map[1]=1;clrMap.color_map[2]=2;clrMap.color_map[3]=3;clrMap.color_map[4]=4;clrMap.color_map[5]=5;clrMap.color_map[10]=10;clrMap.color_map[11]=11;clrMap.color_map[6]=12;clrMap.color_map[7]=13;clrMap.color_map[15]=8;clrMap.color_map[16]=9;return clrMap}function CreateAscFill(unifill){if(null==unifill||null==unifill.fill)return new asc_CShapeFill;var ret=new asc_CShapeFill;var _fill=unifill.fill;switch(_fill.type){case c_oAscFill.FILL_TYPE_SOLID:{ret.type= c_oAscFill.FILL_TYPE_SOLID;ret.fill=new Asc.asc_CFillSolid;ret.fill.color=CreateAscColor(_fill.color);break}case c_oAscFill.FILL_TYPE_PATT:{ret.type=c_oAscFill.FILL_TYPE_PATT;ret.fill=new Asc.asc_CFillHatch;ret.fill.PatternType=_fill.ftype;ret.fill.fgClr=CreateAscColor(_fill.fgClr);ret.fill.bgClr=CreateAscColor(_fill.bgClr);break}case c_oAscFill.FILL_TYPE_GRAD:{ret.type=c_oAscFill.FILL_TYPE_GRAD;ret.fill=new Asc.asc_CFillGrad;var bCheckTransparent=true,nLastTransparent=null,nLastTempTransparent,j, aMods;for(var i=0;i<_fill.colors.length;i++){if(0==i){ret.fill.Colors=[];ret.fill.Positions=[]}if(bCheckTransparent)if(_fill.colors[i].color.Mods){aMods=_fill.colors[i].color.Mods.Mods;nLastTempTransparent=null;for(j=0;j<aMods.length;++j)if(aMods[j].name==="alpha")if(nLastTempTransparent===null){nLastTempTransparent=aMods[j].val;if(nLastTransparent===null)nLastTransparent=nLastTempTransparent;else if(nLastTransparent!==nLastTempTransparent){bCheckTransparent=false;break}}else{bCheckTransparent=false; break}}else bCheckTransparent=false;ret.fill.Colors.push(CreateAscColor(_fill.colors[i].color));ret.fill.Positions.push(_fill.colors[i].pos)}if(bCheckTransparent&&nLastTransparent!==null)ret.transparent=nLastTransparent/1E5*255;if(_fill.lin){ret.fill.GradType=c_oAscFillGradType.GRAD_LINEAR;ret.fill.LinearAngle=_fill.lin.angle;ret.fill.LinearScale=_fill.lin.scale}else if(_fill.path){ret.fill.GradType=c_oAscFillGradType.GRAD_PATH;ret.fill.PathType=0}else{ret.fill.GradType=c_oAscFillGradType.GRAD_LINEAR; ret.fill.LinearAngle=0;ret.fill.LinearScale=false}break}case c_oAscFill.FILL_TYPE_BLIP:{ret.type=c_oAscFill.FILL_TYPE_BLIP;ret.fill=new Asc.asc_CFillBlip;ret.fill.url=_fill.RasterImageId;ret.fill.type=_fill.tile==null?c_oAscFillBlipType.STRETCH:c_oAscFillBlipType.TILE;break}case c_oAscFill.FILL_TYPE_NOFILL:case c_oAscFill.FILL_TYPE_NONE:{ret.type=c_oAscFill.FILL_TYPE_NOFILL;break}default:break}if(isRealNumber(unifill.transparent))ret.transparent=unifill.transparent;return ret}function CorrectUniFill(asc_fill, unifill,editorId){if(null==asc_fill)return unifill;var ret=unifill;if(null==ret)ret=new CUniFill;var _fill=asc_fill.fill;var _type=asc_fill.type;if(null!=_type)switch(_type){case c_oAscFill.FILL_TYPE_NOFILL:{ret.fill=new CNoFill;break}case c_oAscFill.FILL_TYPE_GRP:{ret.fill=new CGrpFill;break}case c_oAscFill.FILL_TYPE_BLIP:{var _url=_fill.url;var _tx_id=_fill.texture_id;if(null!=_tx_id&&0<=_tx_id&&_tx_id<AscCommon.g_oUserTexturePresets.length)_url=AscCommon.g_oUserTexturePresets[_tx_id];if(ret.fill== null)ret.fill=new CBlipFill;if(ret.fill.type!=c_oAscFill.FILL_TYPE_BLIP){if(!(typeof _url==="string"&&_url.length>0)||!isRealNumber(_fill.type))break;ret.fill=new CBlipFill}if(_url!=null&&_url!==undefined&&_url!="")ret.fill.setRasterImageId(_url);if(ret.fill.RasterImageId==null)ret.fill.RasterImageId="";var tile=_fill.type;if(tile==c_oAscFillBlipType.STRETCH){ret.fill.tile=null;ret.fill.srcRect=null;ret.fill.stretch=true}else if(tile==c_oAscFillBlipType.TILE){ret.fill.tile=new CBlipFillTile;ret.fill.stretch= false;ret.fill.srcRect=null}break}case c_oAscFill.FILL_TYPE_PATT:{if(ret.fill==null)ret.fill=new CPattFill;if(ret.fill.type!=c_oAscFill.FILL_TYPE_PATT)if(undefined!=_fill.PatternType&&undefined!=_fill.fgClr&&undefined!=_fill.bgClr)ret.fill=new CPattFill;else break;if(undefined!=_fill.PatternType)ret.fill.ftype=_fill.PatternType;if(undefined!=_fill.fgClr)ret.fill.fgClr=CorrectUniColor(_fill.fgClr,ret.fill.fgClr,editorId);if(!ret.fill.fgClr)ret.fill.fgClr=CreateUniColorRGB(0,0,0);if(undefined!=_fill.bgClr)ret.fill.bgClr= CorrectUniColor(_fill.bgClr,ret.fill.bgClr,editorId);if(!ret.fill.bgClr)ret.fill.bgClr=CreateUniColorRGB(0,0,0);break}case c_oAscFill.FILL_TYPE_GRAD:{if(ret.fill==null)ret.fill=new CGradFill;var _colors=_fill.Colors;var _positions=_fill.Positions;if(ret.fill.type!=c_oAscFill.FILL_TYPE_GRAD)if(undefined!=_colors&&undefined!=_positions)ret.fill=new CGradFill;else break;if(undefined!=_colors&&undefined!=_positions){if(_colors.length===_positions.length)if(ret.fill.colors.length===_colors.length)for(var i= 0;i<_colors.length;i++){var _gs=ret.fill.colors[i]?ret.fill.colors[i]:new CGs;_gs.color=CorrectUniColor(_colors[i],_gs.color,editorId);_gs.pos=_positions[i];ret.fill.colors[i]=_gs}else{ret.fill.colors.length=0;for(var i=0;i<_colors.length;i++){var _gs=new CGs;_gs.color=CorrectUniColor(_colors[i],_gs.color,editorId);_gs.pos=_positions[i];ret.fill.colors.push(_gs)}}}else if(undefined!=_colors){if(_colors.length==ret.fill.colors.length)for(var i=0;i<_colors.length;i++)ret.fill.colors[i].color=CorrectUniColor(_colors[i], ret.fill.colors[i].color,editorId)}else if(undefined!=_positions)if(_positions.length<=ret.fill.colors.length){if(_positions.length<ret.fill.colors.length)ret.fill.colors.splice(_positions.length,ret.fill.colors.length-_positions.length);for(var i=0;i<_positions.length;i++)ret.fill.colors[i].pos=_positions[i]}var _grad_type=_fill.GradType;if(c_oAscFillGradType.GRAD_LINEAR==_grad_type){var _angle=_fill.LinearAngle;var _scale=_fill.LinearScale;if(!ret.fill.lin){ret.fill.lin=new GradLin;ret.fill.lin.angle= 0;ret.fill.lin.scale=false}if(undefined!=_angle)ret.fill.lin.angle=_angle;if(undefined!=_scale)ret.fill.lin.scale=_scale;ret.fill.path=null}else if(c_oAscFillGradType.GRAD_PATH==_grad_type){ret.fill.lin=null;ret.fill.path=new GradPath}break}default:{if(ret.fill==null||ret.fill.type!=c_oAscFill.FILL_TYPE_SOLID)ret.fill=new CSolidFill;ret.fill.color=CorrectUniColor(_fill.color,ret.fill.color,editorId)}}var _alpha=asc_fill.transparent;if(null!=_alpha)ret.transparent=_alpha;if(ret.transparent!=null)if(ret.fill&& ret.fill.type===c_oAscFill.FILL_TYPE_BLIP){for(var i=0;i<ret.fill.Effects.length;++i)if(ret.fill.Effects[i].Type===EFFECT_TYPE_ALPHAMODFIX){ret.fill.Effects[i].amt=ret.transparent*1E5/255>>0;break}if(i===ret.fill.Effects.length){var oEffect=new CAlphaModFix;oEffect.amt=ret.transparent*1E5/255>>0;ret.fill.Effects.push(oEffect)}}return ret}function CreateAscStroke(ln,_canChangeArrows){if(null==ln||null==ln.Fill||ln.Fill.fill==null)return new Asc.asc_CStroke;var ret=new Asc.asc_CStroke;var _fill=ln.Fill.fill; if(_fill!=null)switch(_fill.type){case c_oAscFill.FILL_TYPE_BLIP:{break}case c_oAscFill.FILL_TYPE_SOLID:{ret.color=CreateAscColor(_fill.color);ret.type=c_oAscStrokeType.STROKE_COLOR;break}case c_oAscFill.FILL_TYPE_GRAD:{var _c=_fill.colors;if(_c!=0){ret.color=CreateAscColor(_fill.colors[0].color);ret.type=c_oAscStrokeType.STROKE_COLOR}break}case c_oAscFill.FILL_TYPE_PATT:{ret.color=CreateAscColor(_fill.fgClr);ret.type=c_oAscStrokeType.STROKE_COLOR;break}case c_oAscFill.FILL_TYPE_NOFILL:{ret.color= null;ret.type=c_oAscStrokeType.STROKE_NONE;break}default:{break}}ret.width=ln.w==null?12700:ln.w>>0;ret.width/=36E3;if(ln.cap!=null)ret.asc_putLinecap(ln.cap);if(ln.Join!=null)ret.asc_putLinejoin(ln.Join.type);if(ln.headEnd!=null){ret.asc_putLinebeginstyle(ln.headEnd.type==null?LineEndType.None:ln.headEnd.type);var _len=null==ln.headEnd.len?1:2-ln.headEnd.len;var _w=null==ln.headEnd.w?1:2-ln.headEnd.w;ret.asc_putLinebeginsize(_w*3+_len)}else ret.asc_putLinebeginstyle(LineEndType.None);if(ln.tailEnd!= null){ret.asc_putLineendstyle(ln.tailEnd.type==null?LineEndType.None:ln.tailEnd.type);var _len=null==ln.tailEnd.len?1:2-ln.tailEnd.len;var _w=null==ln.tailEnd.w?1:2-ln.tailEnd.w;ret.asc_putLineendsize(_w*3+_len)}else ret.asc_putLineendstyle(LineEndType.None);if(AscFormat.isRealNumber(ln.prstDash))ret.prstDash=ln.prstDash;else if(ln.prstDash===null)ret.prstDash=Asc.c_oDashType.solid;if(true===_canChangeArrows)ret.canChangeArrows=true;return ret}function CorrectUniStroke(asc_stroke,unistroke,flag){if(null== asc_stroke)return unistroke;var ret=unistroke;if(null==ret)ret=new CLn;var _type=asc_stroke.type;var _w=asc_stroke.width;if(_w!=null&&_w!==undefined)ret.w=_w*36E3;var _color=asc_stroke.color;if(_type==c_oAscStrokeType.STROKE_NONE){ret.Fill=new CUniFill;ret.Fill.fill=new CNoFill}else if(_type!=null)if(null!=_color&&undefined!==_color){ret.Fill=new CUniFill;ret.Fill.type=c_oAscFill.FILL_TYPE_SOLID;ret.Fill.fill=new CSolidFill;ret.Fill.fill.color=CorrectUniColor(_color,ret.Fill.fill.color,flag)}var _join= asc_stroke.LineJoin;if(null!=_join){ret.Join=new LineJoin;ret.Join.type=_join}var _cap=asc_stroke.LineCap;if(null!=_cap)ret.cap=_cap;var _begin_style=asc_stroke.LineBeginStyle;if(null!=_begin_style){if(ret.headEnd==null)ret.headEnd=new EndArrow;ret.headEnd.type=_begin_style}var _end_style=asc_stroke.LineEndStyle;if(null!=_end_style){if(ret.tailEnd==null)ret.tailEnd=new EndArrow;ret.tailEnd.type=_end_style}var _begin_size=asc_stroke.LineBeginSize;if(null!=_begin_size){if(ret.headEnd==null)ret.headEnd= new EndArrow;ret.headEnd.w=2-(_begin_size/3>>0);ret.headEnd.len=2-_begin_size%3}var _end_size=asc_stroke.LineEndSize;if(null!=_end_size){if(ret.tailEnd==null)ret.tailEnd=new EndArrow;ret.tailEnd.w=2-(_end_size/3>>0);ret.tailEnd.len=2-_end_size%3}if(AscFormat.isRealNumber(asc_stroke.prstDash))ret.prstDash=asc_stroke.prstDash;return ret}function CreateAscShapeProp(shape){if(null==shape)return new asc_CShapeProperty;var ret=new asc_CShapeProperty;ret.fill=CreateAscFill(shape.brush);ret.stroke=CreateAscStroke(shape.pen); ret.lockAspect=shape.getNoChangeAspect();var paddings=null;if(shape.textBoxContent){var body_pr=shape.bodyPr;paddings=new Asc.asc_CPaddings;if(typeof body_pr.lIns==="number")paddings.Left=body_pr.lIns;else paddings.Left=2.54;if(typeof body_pr.tIns==="number")paddings.Top=body_pr.tIns;else paddings.Top=1.27;if(typeof body_pr.rIns==="number")paddings.Right=body_pr.rIns;else paddings.Right=2.54;if(typeof body_pr.bIns==="number")paddings.Bottom=body_pr.bIns;else paddings.Bottom=1.27}return ret}function CreateAscShapePropFromProp(shapeProp){var obj= new asc_CShapeProperty;if(!isRealObject(shapeProp))return obj;if(isRealBool(shapeProp.locked))obj.Locked=shapeProp.locked;obj.lockAspect=shapeProp.lockAspect;if(typeof shapeProp.type==="string")obj.type=shapeProp.type;if(isRealObject(shapeProp.fill))obj.fill=CreateAscFill(shapeProp.fill);if(isRealObject(shapeProp.stroke))obj.stroke=CreateAscStroke(shapeProp.stroke,shapeProp.canChangeArrows);if(isRealObject(shapeProp.paddings))obj.paddings=shapeProp.paddings;if(shapeProp.canFill===true||shapeProp.canFill=== false)obj.canFill=shapeProp.canFill;obj.bFromChart=shapeProp.bFromChart;obj.bFromImage=shapeProp.bFromImage;obj.w=shapeProp.w;obj.h=shapeProp.h;obj.rot=shapeProp.rot;obj.flipH=shapeProp.flipH;obj.flipV=shapeProp.flipV;obj.vert=shapeProp.vert;obj.verticalTextAlign=shapeProp.verticalTextAlign;if(shapeProp.textArtProperties)obj.textArtProperties=CreateAscTextArtProps(shapeProp.textArtProperties);obj.title=shapeProp.title;obj.description=shapeProp.description;obj.columnNumber=shapeProp.columnNumber;obj.columnSpace= shapeProp.columnSpace;obj.textFitType=shapeProp.textFitType;obj.vertOverflowType=shapeProp.vertOverflowType;obj.shadow=shapeProp.shadow;if(shapeProp.signatureId)obj.signatureId=shapeProp.signatureId;return obj}function CorrectShapeProp(asc_shape_prop,shape){if(null==shape||null==asc_shape_prop)return;shape.spPr.Fill=CorrectUniFill(asc_shape_prop.asc_getFill(),shape.spPr.Fill);shape.spPr.ln=CorrectUniFill(asc_shape_prop.asc_getStroke(),shape.spPr.ln)}function CreateAscTextArtProps(oTextArtProps){if(!oTextArtProps)return undefined; var oRet=new Asc.asc_TextArtProperties;if(oTextArtProps.Fill)oRet.asc_putFill(CreateAscFill(oTextArtProps.Fill));if(oTextArtProps.Line)oRet.asc_putLine(CreateAscStroke(oTextArtProps.Line,false));oRet.asc_putForm(oTextArtProps.Form);return oRet}function CreateUnifillFromAscColor(asc_color,editorId){var Unifill=new CUniFill;Unifill.fill=new CSolidFill;Unifill.fill.color=CorrectUniColor(asc_color,Unifill.fill.color,editorId);return Unifill}function CorrectUniColor(asc_color,unicolor,flag){if(null==asc_color)return unicolor; var ret=unicolor;if(null==ret)ret=new CUniColor;var _type=asc_color.asc_getType();switch(_type){case c_oAscColor.COLOR_TYPE_PRST:{if(ret.color==null||ret.color.type!=c_oAscColor.COLOR_TYPE_PRST)ret.color=new CPrstColor;ret.color.id=asc_color.value;if(ret.Mods.Mods.length!=0)ret.Mods.Mods.splice(0,ret.Mods.Mods.length);break}case c_oAscColor.COLOR_TYPE_SCHEME:{if(ret.color==null||ret.color.type!=c_oAscColor.COLOR_TYPE_SCHEME)ret.color=new CSchemeColor;var _index=parseInt(asc_color.value);if(isNaN(_index))break; var _id=_index/6>>0;var _pos=_index-_id*6;var array_colors_types=[6,15,7,16,0,1,2,3,4,5];ret.color.id=array_colors_types[_id];if(!ret.Mods)ret.setMods(new CColorModifiers);if(ret.Mods.Mods.length!=0)ret.Mods.Mods.splice(0,ret.Mods.Mods.length);var __mods=null;var _flag;if(editor&&editor.WordControl&&editor.WordControl.m_oDrawingDocument&&editor.WordControl.m_oDrawingDocument.GuiControlColorsMap){var _map=editor.WordControl.m_oDrawingDocument.GuiControlColorsMap;_flag=isRealNumber(flag)?flag:1;__mods= AscCommon.GetDefaultMods(_map[_id].r,_map[_id].g,_map[_id].b,_pos,_flag)}else{var _editor=window["Asc"]&&window["Asc"]["editor"];if(_editor&&_editor.wbModel){var _theme=_editor.wbModel.theme;var _clrMap=_editor.wbModel.clrSchemeMap;if(_theme&&_clrMap){var _schemeClr=new CSchemeColor;_schemeClr.id=array_colors_types[_id];var _rgba={R:0,G:0,B:0,A:255};_schemeClr.Calculate(_theme,_clrMap.color_map,_rgba);_flag=isRealNumber(flag)?flag:0;__mods=AscCommon.GetDefaultMods(_schemeClr.RGBA.R,_schemeClr.RGBA.G, _schemeClr.RGBA.B,_pos,_flag)}}}if(null!=__mods)ret.Mods.Mods=__mods;break}default:{if(ret.color==null||ret.color.type!=c_oAscColor.COLOR_TYPE_SRGB)ret.color=new CRGBColor;ret.color.RGBA.R=asc_color.r;ret.color.RGBA.G=asc_color.g;ret.color.RGBA.B=asc_color.b;ret.color.RGBA.A=asc_color.a;if(ret.Mods&&ret.Mods.Mods.length!=0)ret.Mods.Mods.splice(0,ret.Mods.Mods.length)}}return ret}function deleteDrawingBase(aObjects,graphicId){var position=null;for(var i=0;i<aObjects.length;i++)if(aObjects[i].graphicObject.Get_Id()== graphicId){aObjects.splice(i,1);position=i;break}return position}function builder_CreateShape(sType,nWidth,nHeight,oFill,oStroke,oParent,oTheme,oDrawingDocument,bWord,worksheet){var oShapeTrack=new AscFormat.NewShapeTrack(sType,0,0,oTheme,null,null,null,0);oShapeTrack.track({},nWidth,nHeight);var oShape=oShapeTrack.getShape(bWord===true,oDrawingDocument,null);oShape.setParent(oParent);if(worksheet)oShape.setWorksheet(worksheet);if(bWord)oShape.createTextBoxContent();else oShape.createTextBody();oShape.spPr.setFill(oFill); oShape.spPr.setLn(oStroke);return oShape}function builder_CreateChart(nW,nH,sType,aCatNames,aSeriesNames,aSeries,nStyleIndex){var settings=new Asc.asc_ChartSettings;switch(sType){case "bar":{settings.type=Asc.c_oAscChartTypeSettings.barNormal;break}case "barStacked":{settings.type=Asc.c_oAscChartTypeSettings.barStacked;break}case "barStackedPercent":{settings.type=Asc.c_oAscChartTypeSettings.barStackedPer;break}case "bar3D":{settings.type=Asc.c_oAscChartTypeSettings.barNormal3d;break}case "barStacked3D":{settings.type= Asc.c_oAscChartTypeSettings.barStacked3d;break}case "barStackedPercent3D":{settings.type=Asc.c_oAscChartTypeSettings.barStackedPer3d;break}case "barStackedPercent3DPerspective":{settings.type=Asc.c_oAscChartTypeSettings.barNormal3dPerspective;break}case "horizontalBar":{settings.type=Asc.c_oAscChartTypeSettings.hBarNormal;break}case "horizontalBarStacked":{settings.type=Asc.c_oAscChartTypeSettings.hBarStacked;break}case "horizontalBarStackedPercent":{settings.type=Asc.c_oAscChartTypeSettings.hBarStackedPer; break}case "horizontalBar3D":{settings.type=Asc.c_oAscChartTypeSettings.hBarNormal3d;break}case "horizontalBarStacked3D":{settings.type=Asc.c_oAscChartTypeSettings.hBarStacked3d;break}case "horizontalBarStackedPercent3D":{settings.type=Asc.c_oAscChartTypeSettings.hBarStackedPer3d;break}case "lineNormal":{settings.type=Asc.c_oAscChartTypeSettings.lineNormal;break}case "lineStacked":{settings.type=Asc.c_oAscChartTypeSettings.lineStacked;break}case "lineStackedPercent":{settings.type=Asc.c_oAscChartTypeSettings.lineStackedPer; break}case "line3D":{settings.type=Asc.c_oAscChartTypeSettings.line3d;break}case "pie":{settings.type=Asc.c_oAscChartTypeSettings.pie;break}case "pie3D":{settings.type=Asc.c_oAscChartTypeSettings.pie3d;break}case "doughnut":{settings.type=Asc.c_oAscChartTypeSettings.doughnut;break}case "scatter":{settings.type=Asc.c_oAscChartTypeSettings.scatter;break}case "stock":{settings.type=Asc.c_oAscChartTypeSettings.stock;break}case "area":{settings.type=Asc.c_oAscChartTypeSettings.areaNormal;break}case "areaStacked":{settings.type= Asc.c_oAscChartTypeSettings.areaStacked;break}case "areaStackedPercent":{settings.type=Asc.c_oAscChartTypeSettings.areaStackedPer;break}}var aAscSeries=[];var aAlphaBet=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];var oCat,i;if(aCatNames.length>0){var aNumCache=[];for(i=0;i<aCatNames.length;++i)aNumCache.push({val:aCatNames[i]+""});oCat={Formula:"Sheet1!$B$1:$"+AscFormat.CalcLiterByLength(aAlphaBet,aCatNames.length)+"$1",NumCache:aNumCache}}for(i= 0;i<aSeries.length;++i){var oAscSeries=new AscFormat.asc_CChartSeria;oAscSeries.Val.NumCache=[];var aData=aSeries[i];var sEndLiter=AscFormat.CalcLiterByLength(aAlphaBet,aData.length);oAscSeries.Val.Formula="Sheet1!"+"$B$"+(i+2)+":$"+sEndLiter+"$"+(i+2);if(aSeriesNames[i]){oAscSeries.TxCache.Formula="Sheet1!"+"$A$"+(i+2);oAscSeries.TxCache.Tx=aSeriesNames[i]}if(oCat)oAscSeries.Cat=oCat;for(var j=0;j<aData.length;++j)oAscSeries.Val.NumCache.push({numFormatStr:"General",isDateTimeFormat:false,val:aData[j], isHidden:false});aAscSeries.push(oAscSeries)}var chartSeries={series:aAscSeries,parsedHeaders:{bLeft:true,bTop:true}};var oChartSpace=AscFormat.DrawingObjectsController.prototype._getChartSpace(chartSeries,settings,true);if(!oChartSpace)return null;oChartSpace.setBDeleted(false);oChartSpace.extX=nW;oChartSpace.extY=nH;if(AscFormat.isRealNumber(nStyleIndex))oChartSpace.setStyle(nStyleIndex);AscFormat.CheckSpPrXfrm(oChartSpace);return oChartSpace}function builder_CreateGroup(aDrawings,oController){if(!oController)return null; var aForGroup=[];for(var i=0;i<aDrawings.length;++i){if(!aDrawings[i].Drawing||!aDrawings[i].Drawing.canGroup())return null;aForGroup.push(aDrawings[i].Drawing)}return oController.getGroup(aForGroup)}function builder_CreateSchemeColor(sColorId){var oUniColor=new AscFormat.CUniColor;oUniColor.setColor(new AscFormat.CSchemeColor);switch(sColorId){case "accent1":{oUniColor.color.id=0;break}case "accent2":{oUniColor.color.id=1;break}case "accent3":{oUniColor.color.id=2;break}case "accent4":{oUniColor.color.id= 3;break}case "accent5":{oUniColor.color.id=4;break}case "accent6":{oUniColor.color.id=5;break}case "bg1":{oUniColor.color.id=6;break}case "bg2":{oUniColor.color.id=7;break}case "dk1":{oUniColor.color.id=8;break}case "dk2":{oUniColor.color.id=9;break}case "lt1":{oUniColor.color.id=12;break}case "lt2":{oUniColor.color.id=13;break}case "tx1":{oUniColor.color.id=15;break}case "tx2":{oUniColor.color.id=16;break}default:{oUniColor.color.id=16;break}}return oUniColor}function builder_CreatePresetColor(sPresetColor){var oUniColor= new AscFormat.CUniColor;oUniColor.setColor(new AscFormat.CPrstColor);oUniColor.color.id=sPresetColor;return oUniColor}function builder_CreateGradientStop(oUniColor,nPos){var Gs=new AscFormat.CGs;Gs.pos=nPos;Gs.color=oUniColor;return Gs}function builder_CreateGradient(aGradientStop){var oUniFill=new AscFormat.CUniFill;oUniFill.fill=new AscFormat.CGradFill;for(var i=0;i<aGradientStop.length;++i)oUniFill.fill.colors.push(aGradientStop[i].Gs);return oUniFill}function builder_CreateLinearGradient(aGradientStop, Angle){var oUniFill=builder_CreateGradient(aGradientStop);oUniFill.fill.lin=new AscFormat.GradLin;if(!AscFormat.isRealNumber(Angle))oUniFill.fill.lin.angle=0;else oUniFill.fill.lin.angle=Angle;return oUniFill}function builder_CreateRadialGradient(aGradientStop){var oUniFill=builder_CreateGradient(aGradientStop);oUniFill.fill.path=new AscFormat.GradPath;return oUniFill}function builder_CreatePatternFill(sPatternType,BgColor,FgColor){var oUniFill=new AscFormat.CUniFill;oUniFill.fill=new AscFormat.CPattFill; oUniFill.fill.ftype=AscCommon.global_hatch_offsets[sPatternType];oUniFill.fill.fgClr=FgColor&&FgColor.Unicolor;oUniFill.fill.bgClr=BgColor&&BgColor.Unicolor;return oUniFill}function builder_CreateBlipFill(sImageUrl,sBlipFillType){var oUniFill=new AscFormat.CUniFill;oUniFill.fill=new AscFormat.CBlipFill;oUniFill.fill.RasterImageId=sImageUrl;if(sBlipFillType==="tile")oUniFill.fill.tile=new AscFormat.CBlipFillTile;else if(sBlipFillType==="stretch")oUniFill.fill.stretch=true;return oUniFill}function builder_CreateLine(nWidth, oFill){if(nWidth===0)return new AscFormat.CreateNoFillLine;var oLn=new AscFormat.CLn;oLn.w=nWidth;oLn.Fill=oFill.UniFill;return oLn}function builder_CreateChartTitle(sTitle,nFontSize,bIsBold,oDrawingDocument){if(typeof sTitle==="string"&&sTitle.length>0){var oTitle=new AscFormat.CTitle;oTitle.setOverlay(false);oTitle.setTx(new AscFormat.CChartText);var oTextBody=AscFormat.CreateTextBodyFromString(sTitle,oDrawingDocument,oTitle.tx);if(AscFormat.isRealNumber(nFontSize)){oTextBody.content.Set_ApplyToAll(true); oTextBody.content.AddToParagraph(new ParaTextPr({FontSize:nFontSize,Bold:bIsBold}));oTextBody.content.Set_ApplyToAll(false)}oTitle.tx.setRich(oTextBody);return oTitle}return null}function builder_CreateTitle(sTitle,nFontSize,bIsBold,oChartSpace){if(typeof sTitle==="string"&&sTitle.length>0){var oTitle=new AscFormat.CTitle;oTitle.setOverlay(false);oTitle.setTx(new AscFormat.CChartText);var oTextBody=AscFormat.CreateTextBodyFromString(sTitle,oChartSpace.getDrawingDocument(),oTitle.tx);if(AscFormat.isRealNumber(nFontSize)){oTextBody.content.Set_ApplyToAll(true); oTextBody.content.AddToParagraph(new ParaTextPr({FontSize:nFontSize,Bold:bIsBold}));oTextBody.content.Set_ApplyToAll(false)}oTitle.tx.setRich(oTextBody);return oTitle}return null}function builder_SetChartTitle(oChartSpace,sTitle,nFontSize,bIsBold){if(oChartSpace)oChartSpace.chart.setTitle(builder_CreateChartTitle(sTitle,nFontSize,bIsBold,oChartSpace.getDrawingDocument()))}function builder_SetChartHorAxisTitle(oChartSpace,sTitle,nFontSize,bIsBold){if(oChartSpace){var horAxis=oChartSpace.chart.plotArea.getHorizontalAxis(); if(horAxis)horAxis.setTitle(builder_CreateTitle(sTitle,nFontSize,bIsBold,oChartSpace))}}function builder_SetChartVertAxisTitle(oChartSpace,sTitle,nFontSize,bIsBold){if(oChartSpace){var verAxis=oChartSpace.chart.plotArea.getVerticalAxis();if(verAxis)if(typeof sTitle==="string"&&sTitle.length>0){verAxis.setTitle(builder_CreateTitle(sTitle,nFontSize,bIsBold,oChartSpace));if(verAxis.title){var _body_pr=new AscFormat.CBodyPr;_body_pr.reset();if(!verAxis.title.txPr)verAxis.title.setTxPr(AscFormat.CreateTextBodyFromString("", oChartSpace.getDrawingDocument(),verAxis.title));var _text_body=verAxis.title.txPr;_text_body.setBodyPr(_body_pr);verAxis.title.setOverlay(false)}}else verAxis.setTitle(null)}}function builder_SetChartVertAxisOrientation(oChartSpace,bIsMinMax){if(oChartSpace){var verAxis=oChartSpace.chart.plotArea.getVerticalAxis();if(verAxis){if(!verAxis.scaling)verAxis.setScaling(new AscFormat.CScaling);var scaling=verAxis.scaling;if(bIsMinMax)scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);else scaling.setOrientation(AscFormat.ORIENTATION_MAX_MIN)}}} function builder_SetChartHorAxisOrientation(oChartSpace,bIsMinMax){if(oChartSpace){var horAxis=oChartSpace.chart.plotArea.getHorizontalAxis();if(horAxis){if(!horAxis.scaling)horAxis.setScaling(new AscFormat.CScaling);var scaling=horAxis.scaling;if(bIsMinMax)scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);else scaling.setOrientation(AscFormat.ORIENTATION_MAX_MIN)}}}function builder_SetChartLegendPos(oChartSpace,sLegendPos){if(oChartSpace&&oChartSpace.chart)if(sLegendPos==="none"){if(oChartSpace.chart.legend)oChartSpace.chart.setLegend(null)}else{var nLegendPos= null;switch(sLegendPos){case "left":{nLegendPos=Asc.c_oAscChartLegendShowSettings.left;break}case "top":{nLegendPos=Asc.c_oAscChartLegendShowSettings.top;break}case "right":{nLegendPos=Asc.c_oAscChartLegendShowSettings.right;break}case "bottom":{nLegendPos=Asc.c_oAscChartLegendShowSettings.bottom;break}}if(null!==nLegendPos){if(!oChartSpace.chart.legend)oChartSpace.chart.setLegend(new AscFormat.CLegend);if(oChartSpace.chart.legend.legendPos!==nLegendPos)oChartSpace.chart.legend.setLegendPos(nLegendPos); if(oChartSpace.chart.legend.overlay!==false)oChartSpace.chart.legend.setOverlay(false)}}}function builder_SetObjectFontSize(oObject,nFontSize,oDrawingDocument){if(!oObject)return;if(!oObject.txPr)oObject.setTxPr(new AscFormat.CTextBody);if(!oObject.txPr.bodyPr)oObject.txPr.setBodyPr(new AscFormat.CBodyPr);if(!oObject.txPr.content)oObject.txPr.setContent(new AscFormat.CDrawingDocContent(oObject.txPr,oDrawingDocument,0,0,100,500,false,false,true));var oPr=oObject.txPr.content.Content[0].Pr.Copy();if(!oPr.DefaultRunPr)oPr.DefaultRunPr= new AscCommonWord.CTextPr;oPr.DefaultRunPr.FontSize=nFontSize;oObject.txPr.content.Content[0].Set_Pr(oPr)}function builder_SetLegendFontSize(oChartSpace,nFontSize){builder_SetObjectFontSize(oChartSpace.chart.legend,nFontSize,oChartSpace.getDrawingDocument())}function builder_SetHorAxisFontSize(oChartSpace,nFontSize){builder_SetObjectFontSize(oChartSpace.chart.plotArea.getHorizontalAxis(),nFontSize,oChartSpace.getDrawingDocument())}function builder_SetVerAxisFontSize(oChartSpace,nFontSize){builder_SetObjectFontSize(oChartSpace.chart.plotArea.getVerticalAxis(), nFontSize,oChartSpace.getDrawingDocument())}function builder_SetShowPointDataLabel(oChartSpace,nSeriesIndex,nPointIndex,bShowSerName,bShowCatName,bShowVal,bShowPerecent){if(oChartSpace&&oChartSpace.chart&&oChartSpace.chart.plotArea&&oChartSpace.chart.plotArea.charts[0]){var oChart=oChartSpace.chart.plotArea.charts[0];var bPieChart=oChart.getObjectType()===AscDFH.historyitem_type_PieChart||oChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart;var ser=oChart.series[nSeriesIndex];if(ser){{if(!ser.dLbls)if(oChart.dLbls)ser.setDLbls(oChart.dLbls.createDuplicate()); else{ser.setDLbls(new AscFormat.CDLbls);ser.dLbls.setSeparator(",");ser.dLbls.setShowSerName(false);ser.dLbls.setShowCatName(false);ser.dLbls.setShowVal(false);ser.dLbls.setShowLegendKey(false);if(bPieChart)ser.dLbls.setShowPercent(false);ser.dLbls.setShowBubbleSize(false)}var dLbl=ser.dLbls&&ser.dLbls.findDLblByIdx(nPointIndex);if(!dLbl){dLbl=new AscFormat.CDLbl;dLbl.setIdx(nPointIndex);if(ser.dLbls.txPr)dLbl.merge(ser.dLbls);ser.dLbls.addDLbl(dLbl)}dLbl.setSeparator(",");dLbl.setShowSerName(true== bShowSerName);dLbl.setShowCatName(true==bShowCatName);dLbl.setShowVal(true==bShowVal);dLbl.setShowLegendKey(false);if(bPieChart)dLbl.setShowPercent(true===bShowPerecent);dLbl.setShowBubbleSize(false)}}}}function builder_SetShowDataLabels(oChartSpace,bShowSerName,bShowCatName,bShowVal,bShowPerecent){if(oChartSpace&&oChartSpace.chart&&oChartSpace.chart.plotArea&&oChartSpace.chart.plotArea.charts[0]){var oChart=oChartSpace.chart.plotArea.charts[0];var bPieChart=oChart.getObjectType()===AscDFH.historyitem_type_PieChart|| oChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart;if(false==bShowSerName&&false==bShowCatName&&false==bShowVal&&(bPieChart&&bShowPerecent===false))if(oChart.dLbls)oChart.setDLbls(null);if(!oChart.dLbls)oChart.setDLbls(new AscFormat.CDLbls);oChart.dLbls.setSeparator(",");oChart.dLbls.setShowSerName(true==bShowSerName);oChart.dLbls.setShowCatName(true==bShowCatName);oChart.dLbls.setShowVal(true==bShowVal);oChart.dLbls.setShowLegendKey(false);if(bPieChart)oChart.dLbls.setShowPercent(true=== bShowPerecent);oChart.dLbls.setShowBubbleSize(false)}}function builder_SetChartAxisLabelsPos(oAxis,sPosition){if(!oAxis||!oAxis.setTickLblPos)return;var nPositionType=null;var c_oAscTickLabelsPos=window["Asc"].c_oAscTickLabelsPos;switch(sPosition){case "high":{nPositionType=c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH;break}case "low":{nPositionType=c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW;break}case "nextTo":{nPositionType=c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO;break}case "none":{nPositionType= c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE;break}}if(nPositionType!==null)oAxis.setTickLblPos(nPositionType)}function builder_SetChartVertAxisTickLablePosition(oChartSpace,sPosition){if(oChartSpace)builder_SetChartAxisLabelsPos(oChartSpace.chart.plotArea.getVerticalAxis(),sPosition)}function builder_SetChartHorAxisTickLablePosition(oChartSpace,sPosition){if(oChartSpace)builder_SetChartAxisLabelsPos(oChartSpace.chart.plotArea.getHorizontalAxis(),sPosition)}function builder_GetTickMark(sTickMark){var nNewTickMark= null;switch(sTickMark){case "cross":{nNewTickMark=Asc.c_oAscTickMark.TICK_MARK_CROSS;break}case "in":{nNewTickMark=Asc.c_oAscTickMark.TICK_MARK_IN;break}case "none":{nNewTickMark=Asc.c_oAscTickMark.TICK_MARK_NONE;break}case "out":{nNewTickMark=Asc.c_oAscTickMark.TICK_MARK_OUT;break}}return nNewTickMark}function builder_SetChartAxisMajorTickMark(oAxis,sTickMark){if(!oAxis)return;var nNewTickMark=builder_GetTickMark(sTickMark);if(nNewTickMark!==null)oAxis.setMajorTickMark(nNewTickMark)}function builder_SetChartAxisMinorTickMark(oAxis, sTickMark){if(!oAxis)return;var nNewTickMark=builder_GetTickMark(sTickMark);if(nNewTickMark!==null)oAxis.setMinorTickMark(nNewTickMark)}function builder_SetChartHorAxisMajorTickMark(oChartSpace,sTickMark){if(oChartSpace)builder_SetChartAxisMajorTickMark(oChartSpace.chart.plotArea.getHorizontalAxis(),sTickMark)}function builder_SetChartHorAxisMinorTickMark(oChartSpace,sTickMark){if(oChartSpace)builder_SetChartAxisMinorTickMark(oChartSpace.chart.plotArea.getHorizontalAxis(),sTickMark)}function builder_SetChartVerAxisMajorTickMark(oChartSpace, sTickMark){if(oChartSpace)builder_SetChartAxisMajorTickMark(oChartSpace.chart.plotArea.getVerticalAxis(),sTickMark)}function builder_SetChartVerAxisMinorTickMark(oChartSpace,sTickMark){if(oChartSpace)builder_SetChartAxisMinorTickMark(oChartSpace.chart.plotArea.getVerticalAxis(),sTickMark)}function builder_SetAxisMajorGridlines(oAxis,oLn){if(oAxis){if(!oAxis.majorGridlines)oAxis.setMajorGridlines(new AscFormat.CSpPr);oAxis.majorGridlines.setLn(oLn);if(!oAxis.majorGridlines.Fill&&!oAxis.majorGridlines.ln)oAxis.setMajorGridlines(null)}} function builder_SetAxisMinorGridlines(oAxis,oLn){if(oAxis){if(!oAxis.minorGridlines)oAxis.setMinorGridlines(new AscFormat.CSpPr);oAxis.minorGridlines.setLn(oLn);if(!oAxis.minorGridlines.Fill&&!oAxis.minorGridlines.ln)oAxis.setMinorGridlines(null)}}function builder_SetHorAxisMajorGridlines(oChartSpace,oLn){builder_SetAxisMajorGridlines(oChartSpace.chart.plotArea.getVerticalAxis(),oLn)}function builder_SetHorAxisMinorGridlines(oChartSpace,oLn){builder_SetAxisMinorGridlines(oChartSpace.chart.plotArea.getVerticalAxis(), oLn)}function builder_SetVerAxisMajorGridlines(oChartSpace,oLn){builder_SetAxisMajorGridlines(oChartSpace.chart.plotArea.getHorizontalAxis(),oLn)}function builder_SetVerAxisMinorGridlines(oChartSpace,oLn){builder_SetAxisMinorGridlines(oChartSpace.chart.plotArea.getHorizontalAxis(),oLn)}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CreateFontRef=CreateFontRef;window["AscFormat"].CreatePresetColor=CreatePresetColor;window["AscFormat"].isRealNumber=isRealNumber;window["AscFormat"].isRealBool= isRealBool;window["AscFormat"].writeLong=writeLong;window["AscFormat"].readLong=readLong;window["AscFormat"].writeDouble=writeDouble;window["AscFormat"].readDouble=readDouble;window["AscFormat"].writeBool=writeBool;window["AscFormat"].readBool=readBool;window["AscFormat"].writeString=writeString;window["AscFormat"].readString=readString;window["AscFormat"].writeObject=writeObject;window["AscFormat"].readObject=readObject;window["AscFormat"].checkThemeFonts=checkThemeFonts;window["AscFormat"].ExecuteNoHistory= ExecuteNoHistory;window["AscFormat"].checkTableCellPr=checkTableCellPr;window["AscFormat"].CColorMod=CColorMod;window["AscFormat"].CColorModifiers=CColorModifiers;window["AscFormat"].CSysColor=CSysColor;window["AscFormat"].CPrstColor=CPrstColor;window["AscFormat"].CRGBColor=CRGBColor;window["AscFormat"].CSchemeColor=CSchemeColor;window["AscFormat"].CUniColor=CUniColor;window["AscFormat"].CreateUniColorRGB=CreateUniColorRGB;window["AscFormat"].CreateUniColorRGB2=CreateUniColorRGB2;window["AscFormat"].CreteSolidFillRGB= CreteSolidFillRGB;window["AscFormat"].CreateSolidFillRGBA=CreateSolidFillRGBA;window["AscFormat"].CSrcRect=CSrcRect;window["AscFormat"].CBlipFillTile=CBlipFillTile;window["AscFormat"].CBlipFill=CBlipFill;window["AscFormat"].CSolidFill=CSolidFill;window["AscFormat"].CGs=CGs;window["AscFormat"].GradLin=GradLin;window["AscFormat"].GradPath=GradPath;window["AscFormat"].CGradFill=CGradFill;window["AscFormat"].CPattFill=CPattFill;window["AscFormat"].CNoFill=CNoFill;window["AscFormat"].CGrpFill=CGrpFill; window["AscFormat"].CUniFill=CUniFill;window["AscFormat"].CompareUniFill=CompareUniFill;window["AscFormat"].CompareUnifillBool=CompareUnifillBool;window["AscFormat"].CompareShapeProperties=CompareShapeProperties;window["AscFormat"].EndArrow=EndArrow;window["AscFormat"].ConvertJoinAggType=ConvertJoinAggType;window["AscFormat"].LineJoin=LineJoin;window["AscFormat"].CLn=CLn;window["AscFormat"].DefaultShapeDefinition=DefaultShapeDefinition;window["AscFormat"].CNvPr=CNvPr;window["AscFormat"].NvPr=NvPr; window["AscFormat"].Ph=Ph;window["AscFormat"].UniNvPr=UniNvPr;window["AscFormat"].StyleRef=StyleRef;window["AscFormat"].FontRef=FontRef;window["AscFormat"].CShapeStyle=CShapeStyle;window["AscFormat"].CreateDefaultShapeStyle=CreateDefaultShapeStyle;window["AscFormat"].CXfrm=CXfrm;window["AscFormat"].CEffectProperties=CEffectProperties;window["AscFormat"].CEffectLst=CEffectLst;window["AscFormat"].CSpPr=CSpPr;window["AscFormat"].ClrScheme=ClrScheme;window["AscFormat"].ClrMap=ClrMap;window["AscFormat"].ExtraClrScheme= ExtraClrScheme;window["AscFormat"].FontCollection=FontCollection;window["AscFormat"].FontScheme=FontScheme;window["AscFormat"].FmtScheme=FmtScheme;window["AscFormat"].ThemeElements=ThemeElements;window["AscFormat"].CTheme=CTheme;window["AscFormat"].HF=HF;window["AscFormat"].CBgPr=CBgPr;window["AscFormat"].CBg=CBg;window["AscFormat"].CSld=CSld;window["AscFormat"].CTextStyles=CTextStyles;window["AscFormat"].redrawSlide=redrawSlide;window["AscFormat"].CTextFit=CTextFit;window["AscFormat"].CBodyPr=CBodyPr; window["AscFormat"].CHyperlink=CHyperlink;window["AscFormat"].CTextParagraphPr=CTextParagraphPr;window["AscFormat"].CompareBullets=CompareBullets;window["AscFormat"].CBullet=CBullet;window["AscFormat"].CBulletColor=CBulletColor;window["AscFormat"].CBulletSize=CBulletSize;window["AscFormat"].CBulletTypeface=CBulletTypeface;window["AscFormat"].CBulletType=CBulletType;window["AscFormat"].TextListStyle=TextListStyle;window["AscFormat"].GenerateDefaultTheme=GenerateDefaultTheme;window["AscFormat"].GenerateDefaultMasterSlide= GenerateDefaultMasterSlide;window["AscFormat"].GenerateDefaultSlideLayout=GenerateDefaultSlideLayout;window["AscFormat"].GenerateDefaultSlide=GenerateDefaultSlide;window["AscFormat"].CreateDefaultTextRectStyle=CreateDefaultTextRectStyle;window["AscFormat"].GenerateDefaultColorMap=GenerateDefaultColorMap;window["AscFormat"].CreateAscFill=CreateAscFill;window["AscFormat"].CorrectUniFill=CorrectUniFill;window["AscFormat"].CreateAscStroke=CreateAscStroke;window["AscFormat"].CorrectUniStroke=CorrectUniStroke; window["AscFormat"].CreateAscShapePropFromProp=CreateAscShapePropFromProp;window["AscFormat"].CreateAscTextArtProps=CreateAscTextArtProps;window["AscFormat"].CreateUnifillFromAscColor=CreateUnifillFromAscColor;window["AscFormat"].CorrectUniColor=CorrectUniColor;window["AscFormat"].deleteDrawingBase=deleteDrawingBase;window["AscFormat"].CNvUniSpPr=CNvUniSpPr;window["AscFormat"].UniMedia=UniMedia;window["AscFormat"].CT_Hyperlink=CT_Hyperlink;window["AscFormat"].builder_CreateShape=builder_CreateShape; window["AscFormat"].builder_CreateChart=builder_CreateChart;window["AscFormat"].builder_CreateGroup=builder_CreateGroup;window["AscFormat"].builder_CreateSchemeColor=builder_CreateSchemeColor;window["AscFormat"].builder_CreatePresetColor=builder_CreatePresetColor;window["AscFormat"].builder_CreateGradientStop=builder_CreateGradientStop;window["AscFormat"].builder_CreateLinearGradient=builder_CreateLinearGradient;window["AscFormat"].builder_CreateRadialGradient=builder_CreateRadialGradient;window["AscFormat"].builder_CreatePatternFill= builder_CreatePatternFill;window["AscFormat"].builder_CreateBlipFill=builder_CreateBlipFill;window["AscFormat"].builder_CreateLine=builder_CreateLine;window["AscFormat"].builder_SetChartTitle=builder_SetChartTitle;window["AscFormat"].builder_SetChartHorAxisTitle=builder_SetChartHorAxisTitle;window["AscFormat"].builder_SetChartVertAxisTitle=builder_SetChartVertAxisTitle;window["AscFormat"].builder_SetChartLegendPos=builder_SetChartLegendPos;window["AscFormat"].builder_SetShowDataLabels=builder_SetShowDataLabels; window["AscFormat"].builder_SetChartVertAxisOrientation=builder_SetChartVertAxisOrientation;window["AscFormat"].builder_SetChartHorAxisOrientation=builder_SetChartHorAxisOrientation;window["AscFormat"].builder_SetChartVertAxisTickLablePosition=builder_SetChartVertAxisTickLablePosition;window["AscFormat"].builder_SetChartHorAxisTickLablePosition=builder_SetChartHorAxisTickLablePosition;window["AscFormat"].builder_SetChartHorAxisMajorTickMark=builder_SetChartHorAxisMajorTickMark;window["AscFormat"].builder_SetChartHorAxisMinorTickMark= builder_SetChartHorAxisMinorTickMark;window["AscFormat"].builder_SetChartVerAxisMajorTickMark=builder_SetChartVerAxisMajorTickMark;window["AscFormat"].builder_SetChartVerAxisMinorTickMark=builder_SetChartVerAxisMinorTickMark;window["AscFormat"].builder_SetLegendFontSize=builder_SetLegendFontSize;window["AscFormat"].builder_SetHorAxisMajorGridlines=builder_SetHorAxisMajorGridlines;window["AscFormat"].builder_SetHorAxisMinorGridlines=builder_SetHorAxisMinorGridlines;window["AscFormat"].builder_SetVerAxisMajorGridlines= builder_SetVerAxisMajorGridlines;window["AscFormat"].builder_SetVerAxisMinorGridlines=builder_SetVerAxisMinorGridlines;window["AscFormat"].builder_SetHorAxisFontSize=builder_SetHorAxisFontSize;window["AscFormat"].builder_SetVerAxisFontSize=builder_SetVerAxisFontSize;window["AscFormat"].builder_SetShowPointDataLabel=builder_SetShowPointDataLabel;window["AscFormat"].Ax_Counter=Ax_Counter;window["AscFormat"].TYPE_TRACK=TYPE_TRACK;window["AscFormat"].TYPE_KIND=TYPE_KIND;window["AscFormat"].mapPrstColor= map_prst_color;window["AscFormat"].ar_arrow=ar_arrow;window["AscFormat"].ar_diamond=ar_diamond;window["AscFormat"].ar_none=ar_none;window["AscFormat"].ar_oval=ar_oval;window["AscFormat"].ar_stealth=ar_stealth;window["AscFormat"].ar_triangle=ar_triangle;window["AscFormat"].LineEndType=LineEndType;window["AscFormat"].LineEndSize=LineEndSize;window["AscFormat"].LineJoinType=LineJoinType;window["AscFormat"].phType_body=0;window["AscFormat"].phType_chart=1;window["AscFormat"].phType_clipArt=2;window["AscFormat"].phType_ctrTitle= 3;window["AscFormat"].phType_dgm=4;window["AscFormat"].phType_dt=5;window["AscFormat"].phType_ftr=6;window["AscFormat"].phType_hdr=7;window["AscFormat"].phType_media=8;window["AscFormat"].phType_obj=9;window["AscFormat"].phType_pic=10;window["AscFormat"].phType_sldImg=11;window["AscFormat"].phType_sldNum=12;window["AscFormat"].phType_subTitle=13;window["AscFormat"].phType_tbl=14;window["AscFormat"].phType_title=15;window["AscFormat"].fntStyleInd_none=2;window["AscFormat"].fntStyleInd_major=0;window["AscFormat"].fntStyleInd_minor= 1;window["AscFormat"].VERTICAL_ANCHOR_TYPE_BOTTOM=0;window["AscFormat"].VERTICAL_ANCHOR_TYPE_CENTER=1;window["AscFormat"].VERTICAL_ANCHOR_TYPE_DISTRIBUTED=2;window["AscFormat"].VERTICAL_ANCHOR_TYPE_JUSTIFIED=3;window["AscFormat"].VERTICAL_ANCHOR_TYPE_TOP=4;window["AscFormat"].nVertTTeaVert=0;window["AscFormat"].nVertTThorz=1;window["AscFormat"].nVertTTmongolianVert=2;window["AscFormat"].nVertTTvert=3;window["AscFormat"].nVertTTvert270=4;window["AscFormat"].nVertTTwordArtVert=5;window["AscFormat"].nVertTTwordArtVertRtl= 6;window["AscFormat"].nTWTNone=0;window["AscFormat"].nTWTSquare=1;window["AscFormat"]["text_fit_No"]=window["AscFormat"].text_fit_No=0;window["AscFormat"]["text_fit_Auto"]=window["AscFormat"].text_fit_Auto=1;window["AscFormat"]["text_fit_NormAuto"]=window["AscFormat"].text_fit_NormAuto=2;window["AscFormat"].BULLET_TYPE_COLOR_NONE=0;window["AscFormat"].BULLET_TYPE_COLOR_CLRTX=1;window["AscFormat"].BULLET_TYPE_COLOR_CLR=2;window["AscFormat"].BULLET_TYPE_SIZE_NONE=0;window["AscFormat"].BULLET_TYPE_SIZE_TX= 1;window["AscFormat"].BULLET_TYPE_SIZE_PCT=2;window["AscFormat"].BULLET_TYPE_SIZE_PTS=3;window["AscFormat"].BULLET_TYPE_TYPEFACE_NONE=0;window["AscFormat"].BULLET_TYPE_TYPEFACE_TX=1;window["AscFormat"].BULLET_TYPE_TYPEFACE_BUFONT=2;window["AscFormat"].PARRUN_TYPE_NONE=0;window["AscFormat"].PARRUN_TYPE_RUN=1;window["AscFormat"].PARRUN_TYPE_FLD=2;window["AscFormat"].PARRUN_TYPE_BR=3;window["AscFormat"].PARRUN_TYPE_MATH=4;window["AscFormat"].PARRUN_TYPE_MATHPARA=5;window["AscFormat"]._weight_body=_weight_body; window["AscFormat"]._weight_chart=_weight_chart;window["AscFormat"]._weight_clipArt=_weight_clipArt;window["AscFormat"]._weight_ctrTitle=_weight_ctrTitle;window["AscFormat"]._weight_dgm=_weight_dgm;window["AscFormat"]._weight_media=_weight_media;window["AscFormat"]._weight_obj=_weight_obj;window["AscFormat"]._weight_pic=_weight_pic;window["AscFormat"]._weight_subTitle=_weight_subTitle;window["AscFormat"]._weight_tbl=_weight_tbl;window["AscFormat"]._weight_title=_weight_title;window["AscFormat"]._ph_multiplier= _ph_multiplier;window["AscFormat"].nSldLtTTitle=nSldLtTTitle;window["AscFormat"].nSldLtTObj=nSldLtTObj;window["AscFormat"].nSldLtTTx=nSldLtTTx;window["AscFormat"]._arr_lt_types_weight=_arr_lt_types_weight;window["AscFormat"]._global_layout_summs_array=_global_layout_summs_array;window["AscFormat"].nOTOwerflow=window["AscFormat"]["nOTOwerflow"]=nOTOwerflow;window["AscFormat"].nOTClip=window["AscFormat"]["nOTClip"]=nOTClip;window["AscFormat"].nOTEllipsis=window["AscFormat"]["nOTEllipsis"]=nOTEllipsis; window["AscFormat"].BULLET_TYPE_BULLET_NONE=window["AscFormat"]["BULLET_TYPE_BULLET_NONE"]=BULLET_TYPE_BULLET_NONE;window["AscFormat"].BULLET_TYPE_BULLET_CHAR=window["AscFormat"]["BULLET_TYPE_BULLET_CHAR"]=BULLET_TYPE_BULLET_CHAR;window["AscFormat"].BULLET_TYPE_BULLET_AUTONUM=window["AscFormat"]["BULLET_TYPE_BULLET_AUTONUM"]=BULLET_TYPE_BULLET_AUTONUM;window["AscFormat"].BULLET_TYPE_BULLET_BLIP=window["AscFormat"]["BULLET_TYPE_BULLET_BLIP"]=BULLET_TYPE_BULLET_BLIP;window["AscFormat"].AUDIO_CD=AUDIO_CD; window["AscFormat"].WAV_AUDIO_FILE=WAV_AUDIO_FILE;window["AscFormat"].AUDIO_FILE=AUDIO_FILE;window["AscFormat"].VIDEO_FILE=VIDEO_FILE;window["AscFormat"].QUICK_TIME_FILE=QUICK_TIME_FILE;window["AscFormat"].fCreateEffectByType=fCreateEffectByType;window["AscFormat"].COuterShdw=COuterShdw;window["AscFormat"].CGlow=CGlow;window["AscFormat"].CDuotone=CDuotone;window["AscFormat"].CXfrmEffect=CXfrmEffect;window["AscFormat"].CBlur=CBlur;window["AscFormat"].CPrstShdw=CPrstShdw;window["AscFormat"].CInnerShdw= CInnerShdw;window["AscFormat"].CReflection=CReflection;window["AscFormat"].CSoftEdge=CSoftEdge;window["AscFormat"].CFillOverlay=CFillOverlay;window["AscFormat"].CAlphaCeiling=CAlphaCeiling;window["AscFormat"].CAlphaFloor=CAlphaFloor;window["AscFormat"].CTintEffect=CTintEffect;window["AscFormat"].CRelOff=CRelOff;window["AscFormat"].CLumEffect=CLumEffect;window["AscFormat"].CHslEffect=CHslEffect;window["AscFormat"].CGrayscl=CGrayscl;window["AscFormat"].CEffectElement=CEffectElement;window["AscFormat"].CAlphaRepl= CAlphaRepl;window["AscFormat"].CAlphaOutset=CAlphaOutset;window["AscFormat"].CAlphaModFix=CAlphaModFix;window["AscFormat"].CAlphaBiLevel=CAlphaBiLevel;window["AscFormat"].CBiLevel=CBiLevel;window["AscFormat"].CEffectContainer=CEffectContainer;window["AscFormat"].CFillEffect=CFillEffect;window["AscFormat"].CClrRepl=CClrRepl;window["AscFormat"].CClrChange=CClrChange;window["AscFormat"].CAlphaInv=CAlphaInv;window["AscFormat"].CAlphaMod=CAlphaMod;window["AscFormat"].CBlend=CBlend;window["AscFormat"].CreateNoneBullet= CreateNoneBullet;window["AscFormat"].DEFAULT_COLOR_MAP=GenerateDefaultColorMap()})(window);(function(window,undefined){AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_SetLocks]=AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_SetDrawingBaseType]=AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_SetDrawingBaseEditAs]=AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_SetWorksheet]=AscDFH.CChangesDrawingsString; AscDFH.changesFactory[AscDFH.historyitem_ShapeSetBDeleted]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_SetDrawingBasePos]=AscDFH.CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_SetDrawingBaseExt]=AscDFH.CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_SetDrawingBaseCoors]=AscDFH.CChangesDrawingsObjectNoId;var drawingsChangesMap=window["AscDFH"].drawingsChangesMap;drawingsChangesMap[AscDFH.historyitem_AutoShapes_SetLocks]= function(oClass,value){oClass.locks=value};drawingsChangesMap[AscDFH.historyitem_ShapeSetBDeleted]=function(oClass,value){oClass.bDeleted=value};drawingsChangesMap[AscDFH.historyitem_AutoShapes_SetDrawingBaseType]=function(oClass,value){if(oClass.drawingBase){oClass.drawingBase.Type=value;oClass.handleUpdateExtents()}};drawingsChangesMap[AscDFH.historyitem_AutoShapes_SetDrawingBaseEditAs]=function(oClass,value){if(oClass.drawingBase){oClass.drawingBase.editAs=value;oClass.handleUpdateExtents()}}; drawingsChangesMap[AscDFH.historyitem_AutoShapes_SetWorksheet]=function(oClass,value){if(typeof value==="string"){var oApi=window["Asc"]&&window["Asc"]["editor"];if(oApi&&oApi.wbModel)oClass.worksheet=oApi.wbModel.getWorksheetById(value);else oClass.worksheet=null}else oClass.worksheet=null};drawingsChangesMap[AscDFH.historyitem_AutoShapes_SetDrawingBasePos]=function(oClass,value){if(value)if(oClass.drawingBase&&oClass.drawingBase.Pos){oClass.drawingBase.Pos.X=value.a;oClass.drawingBase.Pos.Y=value.b; oClass.handleUpdatePosition()}};drawingsChangesMap[AscDFH.historyitem_AutoShapes_SetDrawingBaseExt]=function(oClass,value){if(value)if(oClass.drawingBase&&oClass.drawingBase.ext){oClass.drawingBase.ext.cx=value.a;oClass.drawingBase.ext.cy=value.b;oClass.handleUpdateExtents()}};drawingsChangesMap[AscDFH.historyitem_AutoShapes_SetDrawingBaseCoors]=function(oClass,value){if(value)if(oClass.drawingBase){oClass.drawingBase.from.col=value.fromCol;oClass.drawingBase.from.colOff=value.fromColOff;oClass.drawingBase.from.row= value.fromRow;oClass.drawingBase.from.rowOff=value.fromRowOff;oClass.drawingBase.to.col=value.toCol;oClass.drawingBase.to.colOff=value.toColOff;oClass.drawingBase.to.row=value.toRow;oClass.drawingBase.to.rowOff=value.toRowOff;oClass.drawingBase.Pos.X=value.posX;oClass.drawingBase.Pos.Y=value.posY;oClass.drawingBase.ext.cx=value.cx;oClass.drawingBase.ext.cy=value.cy;oClass.handleUpdateExtents()}};AscDFH.drawingsConstructorsMap[AscDFH.historyitem_AutoShapes_SetDrawingBasePos]=CDrawingBaseCoordsWritable; AscDFH.drawingsConstructorsMap[AscDFH.historyitem_AutoShapes_SetDrawingBaseExt]=CDrawingBaseCoordsWritable;AscDFH.drawingsConstructorsMap[AscDFH.historyitem_AutoShapes_SetDrawingBaseCoors]=CDrawingBasePosWritable;var LOCKS_MASKS={noGrp:1,noUngrp:4,noSelect:16,noRot:64,noChangeAspect:256,noMove:1024,noResize:4096,noEditPoints:16384,noAdjustHandles:65536,noChangeArrowheads:262144,noChangeShapeType:1048576,noDrilldown:4194304,noTextEdit:8388608,noCrop:16777216};function checkNormalRotate(rot){var _rot= normalizeRotate(rot);return _rot>=0&&_rot<Math.PI*.25||_rot>=3*Math.PI*.25&&_rot<5*Math.PI*.25||_rot>=7*Math.PI*.25&&_rot<2*Math.PI}function normalizeRotate(rot){var new_rot=rot;if(AscFormat.isRealNumber(new_rot)){while(new_rot>=2*Math.PI)new_rot-=2*Math.PI;while(new_rot<0)new_rot+=2*Math.PI;if(AscFormat.fApproxEqual(new_rot,2*Math.PI,.001))new_rot=0;return new_rot}return new_rot}function CDrawingBaseCoordsWritable(a,b){this.a=a;this.b=b}CDrawingBaseCoordsWritable.prototype.Write_ToBinary=function(Writer){Writer.WriteDouble(this.a); Writer.WriteDouble(this.b)};CDrawingBaseCoordsWritable.prototype.Read_FromBinary=function(Reader){this.a=Reader.GetDouble();this.b=Reader.GetDouble()};window["AscFormat"].CDrawingBaseCoordsWritable=CDrawingBaseCoordsWritable;function CDrawingBasePosWritable(oObject){this.fromCol=null;this.fromColOff=null;this.fromRow=null;this.fromRowOff=null;this.toCol=null;this.toColOff=null;this.toRow=null;this.toRowOff=null;this.posX=null;this.posY=null;this.cx=null;this.cy=null;if(oObject){this.fromCol=oObject.fromCol; this.fromColOff=oObject.fromColOff;this.fromRow=oObject.fromRow;this.fromRowOff=oObject.fromRowOff;this.toCol=oObject.toCol;this.toColOff=oObject.toColOff;this.toRow=oObject.toRow;this.toRowOff=oObject.toRowOff;this.posX=oObject.posX;this.posY=oObject.posY;this.cx=oObject.cx;this.cy=oObject.cy}}CDrawingBasePosWritable.prototype.Write_ToBinary=function(Writer){AscFormat.writeLong(Writer,this.fromCol);AscFormat.writeDouble(Writer,this.fromColOff);AscFormat.writeLong(Writer,this.fromRow);AscFormat.writeDouble(Writer, this.fromRowOff);AscFormat.writeLong(Writer,this.toCol);AscFormat.writeDouble(Writer,this.toColOff);AscFormat.writeLong(Writer,this.toRow);AscFormat.writeDouble(Writer,this.toRowOff);AscFormat.writeDouble(Writer,this.posX);AscFormat.writeDouble(Writer,this.posY);AscFormat.writeDouble(Writer,this.cx);AscFormat.writeDouble(Writer,this.cy)};CDrawingBasePosWritable.prototype.Read_FromBinary=function(Reader){this.fromCol=AscFormat.readLong(Reader);this.fromColOff=AscFormat.readDouble(Reader);this.fromRow= AscFormat.readLong(Reader);this.fromRowOff=AscFormat.readDouble(Reader);this.toCol=AscFormat.readLong(Reader);this.toColOff=AscFormat.readDouble(Reader);this.toRow=AscFormat.readLong(Reader);this.toRowOff=AscFormat.readDouble(Reader);this.posX=AscFormat.readDouble(Reader);this.posY=AscFormat.readDouble(Reader);this.cx=AscFormat.readDouble(Reader);this.cy=AscFormat.readDouble(Reader)};function CGraphicBounds(l,t,r,b){this.l=l;this.t=t;this.r=r;this.b=b;this.checkWH()}CGraphicBounds.prototype.fromOther= function(oBounds){this.l=oBounds.l;this.t=oBounds.t;this.r=oBounds.r;this.b=oBounds.b;this.checkWH()};CGraphicBounds.prototype.copy=function(){return new CGraphicBounds(this.l,this.t,this.r,this.b)};CGraphicBounds.prototype.transform=function(oTransform){var xlt=oTransform.TransformPointX(this.l,this.t);var ylt=oTransform.TransformPointY(this.l,this.t);var xrt=oTransform.TransformPointX(this.r,this.t);var yrt=oTransform.TransformPointY(this.r,this.t);var xlb=oTransform.TransformPointX(this.l,this.b); var ylb=oTransform.TransformPointY(this.l,this.b);var xrb=oTransform.TransformPointX(this.r,this.b);var yrb=oTransform.TransformPointY(this.r,this.b);this.l=Math.min(xlb,xlt,xrb,xrt);this.t=Math.min(ylb,ylt,yrb,yrt);this.r=Math.max(xlb,xlt,xrb,xrt);this.b=Math.max(ylb,ylt,yrb,yrt);this.checkWH()};CGraphicBounds.prototype.checkByOther=function(oBounds){if(oBounds){if(oBounds.l<this.l)this.l=oBounds.l;if(oBounds.t<this.t)this.t=oBounds.t;if(oBounds.r>this.r)this.r=oBounds.r;if(oBounds.b>this.b)this.b= oBounds.b;this.checkWH()}};CGraphicBounds.prototype.checkWH=function(){this.x=this.l;this.y=this.t;this.w=this.r-this.l;this.h=this.b-this.t};CGraphicBounds.prototype.reset=function(l,t,r,b){this.l=l;this.t=t;this.r=r;this.b=b;this.checkWH()};CGraphicBounds.prototype.isIntersect=function(l,t,r,b){if(l>this.r)return false;if(r<this.l)return false;if(t>this.b)return false;if(b<this.t)return false;return true};CGraphicBounds.prototype.isIntersectOther=function(o){return this.isIntersect(o.l,o.t,o.r, o.b)};CGraphicBounds.prototype.intersection=function(o){var oRes=null;var l=Math.max(this.l,o.l);var t=Math.max(this.t,o.t);var r=Math.min(this.r,o.r);var b=Math.min(this.b,o.b);if(l<=r&&t<=b)return new CGraphicBounds(l,t,r,b);return oRes};function CCopyObjectProperties(){this.drawingDocument=null;this.idMap=null;this.bSaveSourceFormatting=null;this.contentCopyPr=null}function CBaseObject(){this.Id=null;if(AscCommon.g_oIdCounter.m_bLoad||History.CanAddChanges()){this.Id=AscCommon.g_oIdCounter.Get_NewId(); AscCommon.g_oTableId.Add(this,this.Id)}}CBaseObject.prototype.getObjectType=function(){return AscDFH.historyitem_type_Unknown};CBaseObject.prototype.Get_Id=function(){return this.Id};CBaseObject.prototype.Write_ToBinary2=function(oWriter){oWriter.WriteLong(this.getObjectType());oWriter.WriteString2(this.Get_Id())};CBaseObject.prototype.Read_FromBinary2=function(oReader){this.Id=oReader.GetString2()};CBaseObject.prototype.Refresh_RecalcData=function(oChange){};function CGraphicObjectBase(){CBaseObject.call(this); this.spPr=null;this.group=null;this.parent=null;this.bDeleted=true;this.locks=0;this.posX=null;this.posY=null;this.x=0;this.y=0;this.extX=0;this.extY=0;this.rot=0;this.flipH=false;this.flipV=false;this.bounds=new CGraphicBounds(0,0,0,0);this.localTransform=new AscCommon.CMatrix;this.transform=new AscCommon.CMatrix;this.invertTransform=null;this.pen=null;this.brush=null;this.snapArrayX=[];this.snapArrayY=[];this.selected=false;this.cropObject=null;this.Lock=new AscCommon.CLock;this.setRecalculateInfo()} CGraphicObjectBase.prototype=Object.create(CBaseObject.prototype);CGraphicObjectBase.prototype.constructor=CGraphicObjectBase;CGraphicObjectBase.prototype.checkBoundsRect=function(){var aCheckX=[],aCheckY=[];this.calculateSnapArrays(aCheckX,aCheckY,this.localTransform);return new CGraphicBounds(Math.min.apply(Math,aCheckX),Math.min.apply(Math,aCheckY),Math.max.apply(Math,aCheckX),Math.max.apply(Math,aCheckY))};CGraphicObjectBase.prototype.setRecalculateInfo=function(){};CGraphicObjectBase.prototype.getBoundsInGroup= function(){var r=this.rot;if(!AscFormat.isRealNumber(r)||AscFormat.checkNormalRotate(r))return new CGraphicBounds(this.x,this.y,this.x+this.extX,this.y+this.extY);else{var hc=this.extX*.5;var vc=this.extY*.5;var xc=this.x+hc;var yc=this.y+vc;return new CGraphicBounds(xc-vc,yc-hc,xc+vc,yc+hc)}};CGraphicObjectBase.prototype.normalize=function(){var new_off_x,new_off_y,new_ext_x,new_ext_y;var xfrm=this.spPr.xfrm;if(!AscCommon.isRealObject(this.group)){new_off_x=xfrm.offX;new_off_y=xfrm.offY;new_ext_x= xfrm.extX;new_ext_y=xfrm.extY}else{var scale_scale_coefficients=this.group.getResultScaleCoefficients();new_off_x=scale_scale_coefficients.cx*(xfrm.offX-this.group.spPr.xfrm.chOffX);new_off_y=scale_scale_coefficients.cy*(xfrm.offY-this.group.spPr.xfrm.chOffY);new_ext_x=scale_scale_coefficients.cx*xfrm.extX;new_ext_y=scale_scale_coefficients.cy*xfrm.extY}Math.abs(new_off_x-xfrm.offX)>AscFormat.MOVE_DELTA&&xfrm.setOffX(new_off_x);Math.abs(new_off_y-xfrm.offY)>AscFormat.MOVE_DELTA&&xfrm.setOffY(new_off_y); Math.abs(new_ext_x-xfrm.extX)>AscFormat.MOVE_DELTA&&xfrm.setExtX(new_ext_x);Math.abs(new_ext_y-xfrm.extY)>AscFormat.MOVE_DELTA&&xfrm.setExtY(new_ext_y)};CGraphicObjectBase.prototype.checkHitToBounds=function(x,y){if(this.parent&&(this.parent.Get_ParentTextTransform&&this.parent.Get_ParentTextTransform()))return true;var _x,_y;if(AscFormat.isRealNumber(this.posX)&&AscFormat.isRealNumber(this.posY)){_x=x-this.posX-this.bounds.x;_y=y-this.posY-this.bounds.y}else{_x=x-this.bounds.x;_y=y-this.bounds.y}var delta= 3+(this.pen&&AscFormat.isRealNumber(this.pen.w)?this.pen.w/36E3:0);if(_x>=-delta&&_x<=this.bounds.w+delta&&_y>=-delta&&_y<=this.bounds.h+delta){var oClipRect;if(this.getClipRect)oClipRect=this.getClipRect();if(oClipRect)if(x<oClipRect.x||x>oClipRect.x+oClipRect.w||y<oClipRect.y||y>oClipRect.y+oClipRect.h)return false;return true}return false};CGraphicObjectBase.prototype.calculateSnapArrays=function(snapArrayX,snapArrayY,transform){var t=transform?transform:this.transform;snapArrayX.push(t.TransformPointX(0, 0));snapArrayY.push(t.TransformPointY(0,0));snapArrayX.push(t.TransformPointX(this.extX,0));snapArrayY.push(t.TransformPointY(this.extX,0));snapArrayX.push(t.TransformPointX(this.extX*.5,this.extY*.5));snapArrayY.push(t.TransformPointY(this.extX*.5,this.extY*.5));snapArrayX.push(t.TransformPointX(this.extX,this.extY));snapArrayY.push(t.TransformPointY(this.extX,this.extY));snapArrayX.push(t.TransformPointX(0,this.extY));snapArrayY.push(t.TransformPointY(0,this.extY))};CGraphicObjectBase.prototype.recalculateSnapArrays= function(){this.snapArrayX.length=0;this.snapArrayY.length=0;this.calculateSnapArrays(this.snapArrayX,this.snapArrayY,null)};CGraphicObjectBase.prototype.setLocks=function(nLocks){AscCommon.History.Add(new AscDFH.CChangesDrawingsLong(this,AscDFH.historyitem_AutoShapes_SetLocks,this.locks,nLocks));this.locks=nLocks};CGraphicObjectBase.prototype.getLockValue=function(nMask){return!!(this.locks&nMask&&this.locks&nMask<<1)};CGraphicObjectBase.prototype.setLockValue=function(nMask,bValue){if(!AscFormat.isRealBool(bValue))this.setLocks(~nMask& this.locks);else this.setLocks(this.locks|nMask|(bValue?nMask<<1:0))};CGraphicObjectBase.prototype.getNoGrp=function(){return this.getLockValue(LOCKS_MASKS.noGrp)};CGraphicObjectBase.prototype.getNoUngrp=function(){return this.getLockValue(LOCKS_MASKS.noUngrp)};CGraphicObjectBase.prototype.getNoSelect=function(){return this.getLockValue(LOCKS_MASKS.noSelect)};CGraphicObjectBase.prototype.getNoRot=function(){return this.getLockValue(LOCKS_MASKS.noRot)};CGraphicObjectBase.prototype.getNoChangeAspect= function(){return this.getLockValue(LOCKS_MASKS.noChangeAspect)};CGraphicObjectBase.prototype.getNoMove=function(){return this.getLockValue(LOCKS_MASKS.noMove)};CGraphicObjectBase.prototype.getNoResize=function(){return this.getLockValue(LOCKS_MASKS.noResize)};CGraphicObjectBase.prototype.getNoEditPoints=function(){return this.getLockValue(LOCKS_MASKS.noEditPoints)};CGraphicObjectBase.prototype.getNoAdjustHandles=function(){return this.getLockValue(LOCKS_MASKS.noAdjustHandles)};CGraphicObjectBase.prototype.getNoChangeArrowheads= function(){return this.getLockValue(LOCKS_MASKS.noChangeArrowheads)};CGraphicObjectBase.prototype.getNoChangeShapeType=function(){return this.getLockValue(LOCKS_MASKS.noChangeShapeType)};CGraphicObjectBase.prototype.getNoDrilldown=function(){return this.getLockValue(LOCKS_MASKS.noDrilldown)};CGraphicObjectBase.prototype.getNoTextEdit=function(){return this.getLockValue(LOCKS_MASKS.noTextEdit)};CGraphicObjectBase.prototype.getNoCrop=function(){return this.getLockValue(LOCKS_MASKS.noCrop)};CGraphicObjectBase.prototype.setNoChangeAspect= function(bValue){return this.setLockValue(LOCKS_MASKS.noChangeAspect,bValue)};CGraphicObjectBase.prototype.canRotate=function(){return this.getNoRot()===false};CGraphicObjectBase.prototype.canResize=function(){return this.getNoResize()===false};CGraphicObjectBase.prototype.canMove=function(){return this.getNoMove()===false};CGraphicObjectBase.prototype.canGroup=function(){return this.getNoGrp()===false};CGraphicObjectBase.prototype.canUnGroup=function(){return this.getNoUngrp()===false};CGraphicObjectBase.prototype.canChangeAdjustments= function(){return this.getNoAdjustHandles()===false};CGraphicObjectBase.prototype.Reassign_ImageUrls=function(mapUrl){var blip_fill;if(this.blipFill)if(mapUrl[this.blipFill.RasterImageId])if(this.setBlipFill){blip_fill=this.blipFill.createDuplicate();blip_fill.setRasterImageId(mapUrl[this.blipFill.RasterImageId]);this.setBlipFill(blip_fill)}if(this.spPr&&this.spPr.Fill&&this.spPr.Fill.fill&&this.spPr.Fill.fill.RasterImageId)if(mapUrl[this.spPr.Fill.fill.RasterImageId]){blip_fill=this.spPr.Fill.fill.createDuplicate(); blip_fill.setRasterImageId(mapUrl[this.spPr.Fill.fill.RasterImageId]);var oUniFill=this.spPr.Fill.createDuplicate();oUniFill.setFill(blip_fill);this.spPr.setFill(oUniFill)}if(Array.isArray(this.spTree))for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].Reassign_ImageUrls)this.spTree[i].Reassign_ImageUrls(mapUrl)};CGraphicObjectBase.prototype.getAllFonts=function(mapUrl){};CGraphicObjectBase.prototype.getOuterShdw=function(){if(this.spPr&&this.spPr.effectProps&&this.spPr.effectProps.EffectLst&& this.spPr.effectProps.EffectLst.outerShdw)return this.spPr.effectProps.EffectLst.outerShdw;return null};CGraphicObjectBase.prototype.recalculateShdw=function(){this.shdwSp=null;var outerShdw=this.getOuterShdw&&this.getOuterShdw();if(outerShdw)AscFormat.ExecuteNoHistory(function(){var geometry=this.calcGeometry||this.spPr&&this.spPr.geometry;var oParentObjects=this.getParentObjects();var track_object=new AscFormat.NewShapeTrack("rect",0,0,oParentObjects.theme,oParentObjects.master,oParentObjects.layout, oParentObjects.slide,0);track_object.track({},0,0);var shape=track_object.getShape(false,null,null);if(geometry){shape.spPr.setGeometry(geometry.createDuplicate());shape.spPr.geometry.setParent(shape.spPr)}if(outerShdw.color)shape.spPr.Fill=AscFormat.CreateUniFillByUniColor(outerShdw.color);else shape.spPr.Fill=AscFormat.CreateUniFillByUniColor(CreateUniColorRGB(0,0,0));shape.spPr.ln=null;var W=this.extX;var H=this.extY;var penW=0;if(this.pen){penW=this.pen.w?this.pen.w/36E3:12700/36E3;if(this.getObjectType()!== AscDFH.historyitem_type_ImageShape)penW/=2}if(outerShdw.sx)W*=outerShdw.sx/1E5;if(outerShdw.sy)H*=outerShdw.sy/1E5;if(W<this.extX+penW)W=this.extX+penW+1;if(H<this.extY+penW)H=this.extY+penW+1;shape.spPr.xfrm.setExtX(W);shape.spPr.xfrm.setExtY(H);shape.spPr.xfrm.setOffX(0);shape.spPr.xfrm.setOffY(0);if(!(this.parent&&this.parent.Extent))shape.setParent(this.parent);shape.recalculate();this.shdwSp=shape},this,[])};CGraphicObjectBase.prototype.drawShdw=function(graphics){var outerShdw=this.getOuterShdw&& this.getOuterShdw();if(this.shdwSp&&outerShdw&&!graphics.IsSlideBoundsCheckerType){var oTransform=new AscCommon.CMatrix;var dist=outerShdw.dist?outerShdw.dist/36E3:0;var dir=outerShdw.dir?outerShdw.dir:0;oTransform.tx=dist*Math.cos(AscFormat.cToRad*dir)-(this.shdwSp.extX-this.extX)/2;oTransform.ty=dist*Math.sin(AscFormat.cToRad*dir)-(this.shdwSp.extY-this.extY)/2;global_MatrixTransformer.MultiplyAppend(oTransform,this.transform);this.shdwSp.bounds.x=this.bounds.x+this.shdwSp.bounds.l;this.shdwSp.bounds.y= this.bounds.y+this.shdwSp.bounds.t;this.shdwSp.transform=oTransform;this.shdwSp.pen=null;this.shdwSp.draw(graphics)}};CGraphicObjectBase.prototype.getAllRasterImages=function(mapUrl){};CGraphicObjectBase.prototype.getAllSlicerViews=function(aSlicerView){};CGraphicObjectBase.prototype.checkCorrect=function(){if(this.bDeleted===true)return false;return this.checkTypeCorrect()};CGraphicObjectBase.prototype.Clear_ContentChanges=function(){};CGraphicObjectBase.prototype.Add_ContentChanges=function(Changes){}; CGraphicObjectBase.prototype.Refresh_ContentChanges=function(){};CGraphicObjectBase.prototype.isWatermark=function(){return false};CGraphicObjectBase.prototype.getWatermarkProps=function(){var oProps=new Asc.CAscWatermarkProperties;oProps.put_Type(Asc.c_oAscWatermarkType.None);return oProps};CGraphicObjectBase.prototype.CheckCorrect=function(){return this.checkCorrect()};CGraphicObjectBase.prototype.checkTypeCorrect=function(){return true};CGraphicObjectBase.prototype.handleUpdateExtents=function(bExtX){}; CGraphicObjectBase.prototype.handleUpdatePosition=function(){};CGraphicObjectBase.prototype.setDrawingBaseType=function(nType){if(this.drawingBase){History.Add(new AscDFH.CChangesDrawingsLong(this,AscDFH.historyitem_AutoShapes_SetDrawingBaseType,this.drawingBase.Type,nType));this.drawingBase.Type=nType;this.handleUpdateExtents()}};CGraphicObjectBase.prototype.setDrawingBaseEditAs=function(nType){if(this.drawingBase){History.Add(new AscDFH.CChangesDrawingsLong(this,AscDFH.historyitem_AutoShapes_SetDrawingBaseEditAs, this.drawingBase.editAs,nType));this.drawingBase.editAs=nType;this.handleUpdateExtents()}};CGraphicObjectBase.prototype.setDrawingBasePos=function(fPosX,fPosY){if(this.drawingBase&&this.drawingBase.Pos){History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_AutoShapes_SetDrawingBasePos,new CDrawingBaseCoordsWritable(this.drawingBase.Pos.X,this.drawingBase.Pos.Y),new CDrawingBaseCoordsWritable(fPosX,fPosY)));this.drawingBase.Pos.X=fPosX;this.drawingBase.Pos.Y=fPosY;this.handleUpdatePosition()}}; CGraphicObjectBase.prototype.setDrawingBaseExt=function(fExtX,fExtY){if(this.drawingBase&&this.drawingBase.ext){History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_AutoShapes_SetDrawingBaseExt,new CDrawingBaseCoordsWritable(this.drawingBase.ext.cx,this.drawingBase.ext.cy),new CDrawingBaseCoordsWritable(fExtX,fExtY)));this.drawingBase.ext.cx=fExtX;this.drawingBase.ext.cy=fExtY;this.handleUpdateExtents()}};CGraphicObjectBase.prototype.setTransformParams=function(x,y,extX,extY, rot,flipH,flipV){if(!this.spPr){this.setSpPr(new AscFormat.CSpPr);this.spPr.setParent(this)}if(!this.spPr.xfrm){this.spPr.setXfrm(new AscFormat.CXfrm);this.spPr.xfrm.setParent(this.spPr)}this.spPr.xfrm.setOffX(x);this.spPr.xfrm.setOffY(y);this.spPr.xfrm.setExtX(extX);this.spPr.xfrm.setExtY(extY);this.spPr.xfrm.setRot(rot);this.spPr.xfrm.setFlipH(flipH);this.spPr.xfrm.setFlipV(flipV)};CGraphicObjectBase.prototype.getPlaceholderType=function(){return null};CGraphicObjectBase.prototype.getPlaceholderIndex= function(){return null};CGraphicObjectBase.prototype.getPhType=function(){return null};CGraphicObjectBase.prototype.getPhIndex=function(){return null};CGraphicObjectBase.prototype.getDrawingBaseType=function(){if(this.drawingBase){if(this.drawingBase.Type===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)if(this.drawingBase.editAs!==null)return this.drawingBase.editAs;return this.drawingBase.Type}return null};CGraphicObjectBase.prototype.checkDrawingBaseCoords=function(){if(this.drawingBase&&this.spPr&& this.spPr.xfrm&&!this.group){var oldX=this.x,oldY=this.y,oldExtX=this.extX,oldExtY=this.extY;var oldRot=this.rot;this.x=this.spPr.xfrm.offX;this.y=this.spPr.xfrm.offY;this.extX=this.spPr.xfrm.extX;this.extY=this.spPr.xfrm.extY;this.rot=AscFormat.isRealNumber(this.spPr.xfrm.rot)?AscFormat.normalizeRotate(this.spPr.xfrm.rot):0;var oldFromCol=this.drawingBase.from.col,oldFromColOff=this.drawingBase.from.colOff,oldFromRow=this.drawingBase.from.row,oldFromRowOff=this.drawingBase.from.rowOff,oldToCol=this.drawingBase.to.col, oldToColOff=this.drawingBase.to.colOff,oldToRow=this.drawingBase.to.row,oldToRowOff=this.drawingBase.to.rowOff,oldPosX=this.drawingBase.Pos.X,oldPosY=this.drawingBase.Pos.Y,oldCx=this.drawingBase.ext.cx,oldCy=this.drawingBase.ext.cy;this.drawingBase.setGraphicObjectCoords();this.x=oldX;this.y=oldY;this.extX=oldExtX;this.extY=oldExtY;this.rot=oldRot;var from=this.drawingBase.from,to=this.drawingBase.to;History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_AutoShapes_SetDrawingBaseCoors, new CDrawingBasePosWritable({fromCol:oldFromCol,fromColOff:oldFromColOff,fromRow:oldFromRow,fromRowOff:oldFromRowOff,toCol:oldToCol,toColOff:oldToColOff,toRow:oldToRow,toRowOff:oldToRowOff,posX:oldPosX,posY:oldPosY,cx:oldCx,cy:oldCy}),new CDrawingBasePosWritable({fromCol:from.col,fromColOff:from.colOff,fromRow:from.row,fromRowOff:from.rowOff,toCol:to.col,toColOff:to.colOff,toRow:to.row,toRowOff:to.rowOff,posX:this.drawingBase.Pos.X,posY:this.drawingBase.Pos.Y,cx:this.drawingBase.ext.cx,cy:this.drawingBase.ext.cy}))); this.handleUpdateExtents()}};CGraphicObjectBase.prototype.setDrawingBaseCoords=function(fromCol,fromColOff,fromRow,fromRowOff,toCol,toColOff,toRow,toRowOff,posX,posY,extX,extY){if(this.drawingBase){History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_AutoShapes_SetDrawingBaseCoors,new CDrawingBasePosWritable({fromCol:this.drawingBase.from.col,fromColOff:this.drawingBase.from.colOff,fromRow:this.drawingBase.from.row,fromRowOff:this.drawingBase.from.rowOff,toCol:this.drawingBase.to.col, toColOff:this.drawingBase.to.colOff,toRow:this.drawingBase.to.row,toRowOff:this.drawingBase.to.rowOff,posX:this.drawingBase.Pos.X,posY:this.drawingBase.Pos.Y,cx:this.drawingBase.ext.cx,cy:this.drawingBase.ext.cy}),new CDrawingBasePosWritable({fromCol:fromCol,fromColOff:fromColOff,fromRow:fromRow,fromRowOff:fromRowOff,toCol:toCol,toColOff:toColOff,toRow:toRow,toRowOff:toRowOff,posX:posX,posY:posY,cx:extX,cy:extY})));this.drawingBase.from.col=fromCol;this.drawingBase.from.colOff=fromColOff;this.drawingBase.from.row= fromRow;this.drawingBase.from.rowOff=fromRowOff;this.drawingBase.to.col=toCol;this.drawingBase.to.colOff=toColOff;this.drawingBase.to.row=toRow;this.drawingBase.to.rowOff=toRowOff;this.drawingBase.Pos.X=posX;this.drawingBase.Pos.Y=posY;this.drawingBase.ext.cx=extX;this.drawingBase.ext.cy=extY;this.handleUpdateExtents()}};CGraphicObjectBase.prototype.setWorksheet=function(worksheet){AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_AutoShapes_SetWorksheet,this.worksheet? this.worksheet.getId():null,worksheet?worksheet.getId():null));this.worksheet=worksheet;if(Array.isArray(this.spTree))for(var i=0;i<this.spTree.length;++i)this.spTree[i].setWorksheet(worksheet)};CGraphicObjectBase.prototype.getWorksheet=function(){return this.worksheet};CGraphicObjectBase.prototype.getWorkbook=function(){var oWorksheet=this.getWorksheet();if(!oWorksheet)return null;if(oWorksheet.workbook)return oWorksheet.workbook;return null};CGraphicObjectBase.prototype.getUniNvProps=function(){return this.nvSpPr|| this.nvPicPr||this.nvGrpSpPr||this.nvGraphicFramePr||null};CGraphicObjectBase.prototype.getCNvProps=function(){var oUniNvPr=this.getUniNvProps();if(oUniNvPr)return oUniNvPr.cNvPr;return null};CGraphicObjectBase.prototype.getNvProps=function(){var oUniNvPr=this.getUniNvProps();if(oUniNvPr)return oUniNvPr.nvPr;return null};CGraphicObjectBase.prototype.setTitle=function(sTitle){if(undefined===sTitle||null===sTitle)return;var oNvPr=this.getCNvProps();if(oNvPr)oNvPr.setTitle(sTitle?sTitle:null)};CGraphicObjectBase.prototype.setDescription= function(sDescription){if(undefined===sDescription||null===sDescription)return;var oNvPr=this.getCNvProps();if(oNvPr)oNvPr.setDescr(sDescription?sDescription:null)};CGraphicObjectBase.prototype.getTitle=function(){var oNvPr=this.getCNvProps();if(oNvPr)return oNvPr.title?oNvPr.title:undefined;return undefined};CGraphicObjectBase.prototype.getDescription=function(){var oNvPr=this.getCNvProps();if(oNvPr)return oNvPr.descr?oNvPr.descr:undefined;return undefined};CGraphicObjectBase.prototype.setBDeleted= function(pr){History.Add(new AscDFH.CChangesDrawingsBool(this,AscDFH.historyitem_ShapeSetBDeleted,this.bDeleted,pr));this.bDeleted=pr};CGraphicObjectBase.prototype.getEditorType=function(){return 1};CGraphicObjectBase.prototype.isEmptyPlaceholder=function(){return false};CGraphicObjectBase.prototype.Restart_CheckSpelling=function(){};CGraphicObjectBase.prototype.GetAllFields=function(isUseSelection,arrFields){return arrFields?arrFields:[]};CGraphicObjectBase.prototype.GetAllSeqFieldsByType=function(sType, aFields){};CGraphicObjectBase.prototype.convertToConnectionParams=function(rot,flipH,flipV,oTransform,oBounds,oConnectorInfo){var _ret=new AscFormat.ConnectionParams;var _rot=oConnectorInfo.ang*AscFormat.cToRad+rot;var _normalized_rot=AscFormat.normalizeRotate(_rot);_ret.dir=AscFormat.CARD_DIRECTION_E;if(_normalized_rot>=0&&_normalized_rot<Math.PI*.25||_normalized_rot>=7*Math.PI*.25&&_normalized_rot<2*Math.PI){_ret.dir=AscFormat.CARD_DIRECTION_E;if(flipH)_ret.dir=AscFormat.CARD_DIRECTION_W}else if(_normalized_rot>= Math.PI*.25&&_normalized_rot<3*Math.PI*.25){_ret.dir=AscFormat.CARD_DIRECTION_S;if(flipV)_ret.dir=AscFormat.CARD_DIRECTION_N}else if(_normalized_rot>=3*Math.PI*.25&&_normalized_rot<5*Math.PI*.25){_ret.dir=AscFormat.CARD_DIRECTION_W;if(flipH)_ret.dir=AscFormat.CARD_DIRECTION_E}else if(_normalized_rot>=5*Math.PI*.25&&_normalized_rot<7*Math.PI*.25){_ret.dir=AscFormat.CARD_DIRECTION_N;if(flipV)_ret.dir=AscFormat.CARD_DIRECTION_S}_ret.x=oTransform.TransformPointX(oConnectorInfo.x,oConnectorInfo.y);_ret.y= oTransform.TransformPointY(oConnectorInfo.x,oConnectorInfo.y);_ret.bounds.fromOther(oBounds);_ret.idx=oConnectorInfo.idx;return _ret};CGraphicObjectBase.prototype.getGeom=function(){var _geom;if(this.rectGeometry)_geom=this.rectGeometry;else if(this.calcGeometry)_geom=this.calcGeometry;else if(this.spPr&&this.spPr.geometry)_geom=this.spPr.geometry;else _geom=AscFormat.ExecuteNoHistory(function(){var _ret=AscFormat.CreateGeometry("rect");_ret.Recalculate(this.extX,this.extY);return _ret},this,[]); return _geom};CGraphicObjectBase.prototype.findGeomConnector=function(x,y){var _geom=this.getGeom();var oInvertTransform=this.invertTransform;var _x=oInvertTransform.TransformPointX(x,y);var _y=oInvertTransform.TransformPointY(x,y);return _geom.findConnector(_x,_y,this.convertPixToMM(AscCommon.global_mouseEvent.KoefPixToMM*AscCommon.TRACK_CIRCLE_RADIUS))};CGraphicObjectBase.prototype.findConnector=function(x,y){var oConnGeom=this.findGeomConnector(x,y);if(oConnGeom){var _rot=this.rot;var _flipH=this.flipH; var _flipV=this.flipV;if(this.group){_rot=AscFormat.normalizeRotate(this.group.getFullRotate()+_rot);if(this.group.getFullFlipH())_flipH=!_flipH;if(this.group.getFullFlipV())_flipV=!_flipV}return this.convertToConnectionParams(_rot,_flipH,_flipV,this.transform,this.bounds,oConnGeom)}return null};CGraphicObjectBase.prototype.findConnectionShape=function(x,y){if(this.hit(x,y))return this;return null};CGraphicObjectBase.prototype.getAllDocContents=function(aDrawings){};CGraphicObjectBase.prototype.getFullRotate= function(){return!AscCommon.isRealObject(this.group)?this.rot:this.rot+this.group.getFullRotate()};CGraphicObjectBase.prototype.getAspect=function(num){var _tmp_x=this.extX!==0?this.extX:.1;var _tmp_y=this.extY!==0?this.extY:.1;return num===0||num===4?_tmp_x/_tmp_y:_tmp_y/_tmp_x};CGraphicObjectBase.prototype.getFullFlipH=function(){if(!AscCommon.isRealObject(this.group))return this.flipH;return this.group.getFullFlipH()?!this.flipH:this.flipH};CGraphicObjectBase.prototype.getFullFlipV=function(){if(!AscCommon.isRealObject(this.group))return this.flipV; return this.group.getFullFlipV()?!this.flipV:this.flipV};CGraphicObjectBase.prototype.getMainGroup=function(){if(!AscCommon.isRealObject(this.group)){if(this.getObjectType()===AscDFH.historyitem_type_GroupShape||this.getObjectType()===AscDFH.historyitem_type_LockedCanvas)return this;return null}return this.group.getMainGroup()};CGraphicObjectBase.prototype.drawConnectors=function(overlay){var _geom=this.getGeom();_geom.drawConnectors(overlay,this.transform)};CGraphicObjectBase.prototype.getConnectionParams= function(cnxIdx,_group){AscFormat.ExecuteNoHistory(function(){if(this.recalculateSizes)this.recalculateSizes();else if(this.recalculateTransform)this.recalculateTransform()},this,[]);if(cnxIdx!==null){var oConnectionObject=this.getGeom().cnxLst[cnxIdx];if(oConnectionObject){var g_conn_info={idx:cnxIdx,ang:oConnectionObject.ang,x:oConnectionObject.x,y:oConnectionObject.y};var _rot=AscFormat.normalizeRotate(this.getFullRotate());var _flipH=this.getFullFlipH();var _flipV=this.getFullFlipV();var _bounds= this.bounds;var _transform=this.transform;if(_group){_rot=AscFormat.normalizeRotate((this.group?this.group.getFullRotate():0)+_rot-_group.getFullRotate());if(_group.getFullFlipH())_flipH=!_flipH;if(_group.getFullFlipV())_flipV=!_flipV;_bounds=_bounds.copy();_bounds.transform(_group.invertTransform);_transform=_transform.CreateDublicate();AscCommon.global_MatrixTransformer.MultiplyAppend(_transform,_group.invertTransform)}return this.convertToConnectionParams(_rot,_flipH,_flipV,_transform,_bounds, g_conn_info)}}return null};CGraphicObjectBase.prototype.getCardDirectionByNum=function(num){var num_north=this.getNumByCardDirection(AscFormat.CARD_DIRECTION_N);var full_flip_h=this.getFullFlipH();var full_flip_v=this.getFullFlipV();var same_flip=!full_flip_h&&!full_flip_v||full_flip_h&&full_flip_v;if(same_flip)return(num-num_north+AscFormat.CARD_DIRECTION_N+8)%8;return(AscFormat.CARD_DIRECTION_N-(num-num_north)+8)%8};CGraphicObjectBase.prototype.getTransformMatrix=function(){return this.transform}; CGraphicObjectBase.prototype.getNumByCardDirection=function(cardDirection){var hc=this.extX*.5;var vc=this.extY*.5;var transform=this.getTransformMatrix();var y1,y3,y5,y7;y1=transform.TransformPointY(hc,0);y3=transform.TransformPointY(this.extX,vc);y5=transform.TransformPointY(hc,this.extY);y7=transform.TransformPointY(0,vc);var north_number;var full_flip_h=this.getFullFlipH();var full_flip_v=this.getFullFlipV();switch(Math.min(y1,y3,y5,y7)){case y1:{north_number=1;break}case y3:{north_number=3;break}case y5:{north_number= 5;break}default:{north_number=7;break}}var same_flip=!full_flip_h&&!full_flip_v||full_flip_h&&full_flip_v;if(same_flip)return(north_number+cardDirection)%8;return(north_number-cardDirection+8)%8};CGraphicObjectBase.prototype.getInvertTransform=function(){return this.invertTransform};CGraphicObjectBase.prototype.getResizeCoefficients=function(numHandle,x,y){var cx,cy;cx=this.extX>0?this.extX:.01;cy=this.extY>0?this.extY:.01;var invert_transform=this.getInvertTransform();if(!invert_transform)return{kd1:1, kd2:1};var t_x=invert_transform.TransformPointX(x,y);var t_y=invert_transform.TransformPointY(x,y);switch(numHandle){case 0:return{kd1:(cx-t_x)/cx,kd2:(cy-t_y)/cy};case 1:return{kd1:(cy-t_y)/cy,kd2:0};case 2:return{kd1:(cy-t_y)/cy,kd2:t_x/cx};case 3:return{kd1:t_x/cx,kd2:0};case 4:return{kd1:t_x/cx,kd2:t_y/cy};case 5:return{kd1:t_y/cy,kd2:0};case 6:return{kd1:t_y/cy,kd2:(cx-t_x)/cx};case 7:return{kd1:(cx-t_x)/cx,kd2:0}}return{kd1:1,kd2:1}};CGraphicObjectBase.prototype.GetAllContentControls=function(arrContentControls){}; CGraphicObjectBase.prototype.CheckContentControlEditingLock=function(){if(this.group){this.group.CheckContentControlEditingLock();return}if(this.parent&&this.parent.CheckContentControlEditingLock)this.parent.CheckContentControlEditingLock()};CGraphicObjectBase.prototype.hit=function(x,y){return false};CGraphicObjectBase.prototype.hitToAdjustment=function(){return{hit:false}};CGraphicObjectBase.prototype.hitToHandles=function(x,y){if(this.parent&&this.parent.kind===AscFormat.TYPE_KIND.NOTES)return-1; return AscFormat.hitToHandles(x,y,this)};CGraphicObjectBase.prototype.onMouseMove=function(e,x,y){return this.hit(x,y)};CGraphicObjectBase.prototype.drawLocks=function(transform,graphics){var bNotes=!!(this.parent&&this.parent.kind===AscFormat.TYPE_KIND.NOTES);if(!this.group&&!bNotes){var oLock;if(this.parent instanceof ParaDrawing)oLock=this.parent.Lock;else if(this.Lock)oLock=this.Lock;if(oLock&&AscCommon.locktype_None!==oLock.Get_Type()){var bCoMarksDraw=true;var oApi=editor||Asc["editor"];if(oApi)switch(oApi.getEditorId()){case AscCommon.c_oEditorId.Word:{bCoMarksDraw= true===oApi.isCoMarksDraw||AscCommon.locktype_Mine!==oLock.Get_Type();break}case AscCommon.c_oEditorId.Presentation:{bCoMarksDraw=!AscCommon.CollaborativeEditing.Is_Fast()||AscCommon.locktype_Mine!==oLock.Get_Type();break}case AscCommon.c_oEditorId.Spreadsheet:{bCoMarksDraw=!oApi.collaborativeEditing.getFast()||AscCommon.locktype_Mine!==oLock.Get_Type();break}}if(bCoMarksDraw&&graphics.DrawLockObjectRect){graphics.transform3(transform);graphics.DrawLockObjectRect(oLock.Get_Type(),0,0,this.extX,this.extY); return true}}}return false};CGraphicObjectBase.prototype.getSignatureLineGuid=function(){return null};CGraphicObjectBase.prototype.getCopyWithSourceFormatting=function(oIdMap){return this.copy(oIdMap)};CGraphicObjectBase.prototype.checkNeedRecalculate=function(){return false};CGraphicObjectBase.prototype.handleAllContents=function(fCallback){};CGraphicObjectBase.prototype.canChangeArrows=function(){if(!this.spPr||this.spPr.geometry==null)return false;var _path_list=this.spPr.geometry.pathLst;var _path_index; var _path_command_index;var _path_command_arr;for(_path_index=0;_path_index<_path_list.length;++_path_index){_path_command_arr=_path_list[_path_index].ArrPathCommandInfo;for(_path_command_index=0;_path_command_index<_path_command_arr.length;++_path_command_index)if(_path_command_arr[_path_command_index].id==5)break;if(_path_command_index==_path_command_arr.length)return true}return false};CGraphicObjectBase.prototype.getStroke=function(){if(this.pen&&this.pen.Fill){if(this.getObjectType()===AscDFH.historyitem_type_ImageShape&& AscFormat.isRealNumber(this.pen.w)){var _ret=this.pen.createDuplicate();_ret.w/=2;return _ret}return this.pen}var ret=AscFormat.CreateNoFillLine();ret.w=0;return ret};CGraphicObjectBase.prototype.getPresetGeom=function(){if(this.spPr&&this.spPr.geometry)return this.spPr.geometry.preset;else{if(this.calcGeometry)return this.calcGeometry.preset;return null}};CGraphicObjectBase.prototype.getFill=function(){if(this.brush&&this.brush.fill)return this.brush;return AscFormat.CreateNoFillUniFill()};CGraphicObjectBase.prototype.getClipRect= function(){if(this.parent&&this.parent.GetClipRect)return this.parent.GetClipRect();return null};CGraphicObjectBase.prototype.getBlipFill=function(){if(this.getObjectType()===AscDFH.historyitem_type_ImageShape||this.getObjectType()===AscDFH.historyitem_type_Shape){if(this.blipFill)return this.blipFill;if(this.brush&&this.brush.fill&&this.brush.fill.type===window["Asc"].c_oAscFill.FILL_TYPE_BLIP)return this.brush.fill}return null};CGraphicObjectBase.prototype.checkSrcRect=function(){if(this.getObjectType()=== AscDFH.historyitem_type_ImageShape){if(this.blipFill.tile||!this.blipFill.srcRect||this.blipFill.stretch){var blipFill=this.blipFill.createDuplicate();if(blipFill.tile)blipFill.tile=null;if(!blipFill.srcRect){blipFill.srcRect=new AscFormat.CSrcRect;blipFill.srcRect.l=0;blipFill.srcRect.t=0;blipFill.srcRect.r=100;blipFill.srcRect.b=100}if(blipFill.stretch)blipFill.stretch=null;this.setBlipFill(blipFill)}}else if(this.brush.fill.tile||!this.brush.fill.srcRect||this.brush.fill.stretch){var brush=this.brush.createDuplicate(); if(brush.fill.tile)brush.fill.tile=null;if(!brush.fill.srcRect){brush.fill.srcRect=new AscFormat.CSrcRect;brush.fill.srcRect.l=0;brush.fill.srcRect.t=0;brush.fill.srcRect.r=100;brush.fill.srcRect.b=100}if(brush.fill.stretch)brush.fill.stretch=null;this.brush=brush;this.spPr.setFill(brush)}};CGraphicObjectBase.prototype.getCropObject=function(){if(!this.cropObject)this.createCropObject();return this.cropObject};CGraphicObjectBase.prototype.createCropObject=function(){return AscFormat.ExecuteNoHistory(function(){var oBlipFill= this.getBlipFill();if(!oBlipFill)return;var srcRect=oBlipFill.srcRect;if(srcRect){var sRasterImageId=oBlipFill.RasterImageId;var _l=srcRect.l?srcRect.l:0;var _t=srcRect.t?srcRect.t:0;var _r=srcRect.r?srcRect.r:100;var _b=srcRect.b?srcRect.b:100;var oShapeDrawer=new AscCommon.CShapeDrawer;oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;this.check_bounds(oShapeDrawer);var boundsW=oShapeDrawer.max_x-oShapeDrawer.min_x;var boundsH=oShapeDrawer.max_y-oShapeDrawer.min_y; var wpct=(_r-_l)/100;var hpct=(_b-_t)/100;var extX=boundsW/wpct;var extY=boundsH/hpct;var DX=-extX*_l/100+oShapeDrawer.min_x;var DY=-extY*_t/100+oShapeDrawer.min_y;var XC=DX+extX/2;var YC=DY+extY/2;var oTransform=this.transform.CreateDublicate();var XC_=oTransform.TransformPointX(XC,YC);var YC_=oTransform.TransformPointY(XC,YC);var X=XC_-extX/2;var Y=YC_-extY/2;var oImage=AscFormat.DrawingObjectsController.prototype.createImage(sRasterImageId,X,Y,extX,extY);oImage.isCrop=true;oImage.parentCrop=this; oImage.worksheet=this.worksheet;oImage.drawingBase=this.drawingBase;oImage.spPr.xfrm.setRot(this.rot);oImage.spPr.xfrm.setFlipH(this.flipH);oImage.spPr.xfrm.setFlipV(this.flipV);oImage.setParent(this.parent);oImage.recalculate();oImage.setParent(null);oImage.recalculateTransform();oImage.recalculateGeometry();oImage.invertTransform=AscCommon.global_MatrixTransformer.Invert(oImage.transform);oImage.recalculateBounds();oImage.setParent(this.parent);oImage.selectStartPage=this.selectStartPage;oImage.cropBrush= AscFormat.CreateUnfilFromRGB(128,128,128);oImage.cropBrush.transparent=100;oImage.pen=AscFormat.CreatePenBrushForChartTrack().pen;oImage.parent=this.parent;var oParentObjects=this.getParentObjects();oImage.cropBrush.calculate(oParentObjects.theme,oParentObjects.slide,oParentObjects.layout,oParentObjects.master,{R:0,G:0,B:0,A:255,needRecalc:true},AscFormat.G_O_DEFAULT_COLOR_MAP);this.cropObject=oImage;return true}return false},this,[])};CGraphicObjectBase.prototype.clearCropObject=function(){this.cropObject= null};CGraphicObjectBase.prototype.drawCropTrack=function(graphics,srcRect,transform,cropObjectTransform){};CGraphicObjectBase.prototype.calculateSrcRect=function(){var oldTransform=this.transform.CreateDublicate();var oldExtX=this.extX;var oldExtY=this.extY;AscFormat.ExecuteNoHistory(function(){var oldVal=this.recalcInfo.recalculateTransform;this.recalcInfo.recalculateTransform=false;this.recalculateGeometry();this.recalcInfo.recalculateTransform=oldVal},this,[]);this.transform=oldTransform;this.extX= oldExtX;this.extY=oldExtY;this.setSrcRect(this.calculateSrcRect2());this.clearCropObject()};CGraphicObjectBase.prototype.setSrcRect=function(srcRect){if(this.getObjectType()===AscDFH.historyitem_type_ImageShape){var blipFill=this.blipFill.createDuplicate();blipFill.srcRect=srcRect;this.setBlipFill(blipFill)}else{var brush=this.brush.createDuplicate();brush.fill.srcRect=srcRect;this.spPr.setFill(brush)}};CGraphicObjectBase.prototype.calculateSrcRect2=function(){var oShapeDrawer=new AscCommon.CShapeDrawer; oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;this.check_bounds(oShapeDrawer);return CalculateSrcRect(this.transform,oShapeDrawer,this.cropObject.invertTransform,this.cropObject.extX,this.cropObject.extY)};CGraphicObjectBase.prototype.getMediaFileName=function(){return null};CGraphicObjectBase.prototype.getLogicDocument=function(){var oApi=editor||Asc["editor"];if(oApi&&oApi.WordControl)return oApi.WordControl.m_oLogicDocument;return null};CGraphicObjectBase.prototype.updatePosition= function(x,y){this.posX=x;this.posY=y;if(!this.group){this.x=this.localX+x;this.y=this.localY+y}else{this.x=this.localX;this.y=this.localY}if(this.updateTransformMatrix)this.updateTransformMatrix()};CGraphicObjectBase.prototype.copyComments=function(oLogicDocument){if(!oLogicDocument)return;var aDocContents=[];this.getAllDocContents(aDocContents);for(var i=0;i<aDocContents.length;++i)aDocContents[i].CreateDuplicateComments()};CGraphicObjectBase.prototype.createPlaceholderControl=function(){var phType= this.getPhType();var aButtons=[];var isLocalDesktop=window["AscDesktopEditor"]&&window["AscDesktopEditor"]["IsSupportMedia"]&&window["AscDesktopEditor"]["IsSupportMedia"]();switch(phType){case null:{aButtons.push(AscCommon.PlaceholderButtonType.Table);aButtons.push(AscCommon.PlaceholderButtonType.Chart);aButtons.push(AscCommon.PlaceholderButtonType.Image);aButtons.push(AscCommon.PlaceholderButtonType.ImageUrl);if(isLocalDesktop){aButtons.push(AscCommon.PlaceholderButtonType.Video);aButtons.push(AscCommon.PlaceholderButtonType.Audio)}break}case AscFormat.phType_body:{break}case AscFormat.phType_chart:{aButtons.push(AscCommon.PlaceholderButtonType.Chart); break}case AscFormat.phType_clipArt:{aButtons.push(AscCommon.PlaceholderButtonType.Image);aButtons.push(AscCommon.PlaceholderButtonType.ImageUrl);break}case AscFormat.phType_ctrTitle:{break}case AscFormat.phType_dgm:{break}case AscFormat.phType_dt:{break}case AscFormat.phType_ftr:{break}case AscFormat.phType_hdr:{break}case AscFormat.phType_media:{if(isLocalDesktop){aButtons.push(AscCommon.PlaceholderButtonType.Video);aButtons.push(AscCommon.PlaceholderButtonType.Audio)}break}case AscFormat.phType_obj:{aButtons.push(AscCommon.PlaceholderButtonType.Table); aButtons.push(AscCommon.PlaceholderButtonType.Chart);aButtons.push(AscCommon.PlaceholderButtonType.Image);aButtons.push(AscCommon.PlaceholderButtonType.ImageUrl);if(isLocalDesktop){aButtons.push(AscCommon.PlaceholderButtonType.Video);aButtons.push(AscCommon.PlaceholderButtonType.Audio)}break}case AscFormat.phType_pic:{aButtons.push(AscCommon.PlaceholderButtonType.Image);aButtons.push(AscCommon.PlaceholderButtonType.ImageUrl);break}case AscFormat.phType_sldImg:{aButtons.push(AscCommon.PlaceholderButtonType.Image); aButtons.push(AscCommon.PlaceholderButtonType.ImageUrl);break}case AscFormat.phType_sldNum:{break}case AscFormat.phType_subTitle:{break}case AscFormat.phType_tbl:{aButtons.push(AscCommon.PlaceholderButtonType.Table);break}case AscFormat.phType_title:{break}}var nSlideNum=0;if(this.parent.getObjectType&&this.parent.getObjectType()===AscDFH.historyitem_type_Slide)nSlideNum=this.parent.num;return AscCommon.CreateDrawingPlaceholder(this.Id,aButtons,nSlideNum,{x:0,y:0,w:this.extX,h:this.extY},this.transform)}; CGraphicObjectBase.prototype.onSlicerUpdate=function(sName){return false};CGraphicObjectBase.prototype.onSlicerLock=function(sName,bLock){};CGraphicObjectBase.prototype.onSlicerDelete=function(sName){return false};CGraphicObjectBase.prototype.onSlicerChangeName=function(sName,sNewName){return false};CGraphicObjectBase.prototype.onUpdate=function(oRect){if(this.drawingBase)this.drawingBase.onUpdate(oRect);else if(this.group)this.group.onUpdate(oRect)};CGraphicObjectBase.prototype.getSlicerViewByName= function(name){return null};CGraphicObjectBase.prototype.setParent2=function(parent){this.setParent(parent);if(Array.isArray(this.spTree))for(var i=0;i<this.spTree.length;++i)this.spTree[i].setParent2(parent)};CGraphicObjectBase.prototype.documentCreateFontMap=function(oMap){};CGraphicObjectBase.prototype.createFontMap=function(oMap){this.documentCreateFontMap(oMap)};function CRelSizeAnchor(){CBaseObject.call(this);this.fromX=null;this.fromY=null;this.toX=null;this.toY=null;this.object=null;this.parent= null;this.drawingBase=null}CRelSizeAnchor.prototype=Object.create(CBaseObject.prototype);CRelSizeAnchor.prototype.constructor=CRelSizeAnchor;CRelSizeAnchor.prototype.setDrawingBase=function(drawingBase){this.drawingBase=drawingBase};CRelSizeAnchor.prototype.getObjectType=function(){return AscDFH.historyitem_type_RelSizeAnchor};CRelSizeAnchor.prototype.setFromTo=function(fromX,fromY,toX,toY){History.Add(new AscDFH.CChangesDrawingsDouble(this,AscDFH.historyitem_RelSizeAnchorFromX,this.fromX,fromX)); History.Add(new AscDFH.CChangesDrawingsDouble(this,AscDFH.historyitem_RelSizeAnchorFromY,this.fromY,fromY));History.Add(new AscDFH.CChangesDrawingsDouble(this,AscDFH.historyitem_RelSizeAnchorToX,this.toX,toX));History.Add(new AscDFH.CChangesDrawingsDouble(this,AscDFH.historyitem_RelSizeAnchorToY,this.toY,toY));this.fromX=fromX;this.fromY=fromY;this.toX=toX;this.toY=toY};CRelSizeAnchor.prototype.setObject=function(object){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_RelSizeAnchorObject, this.object,object));this.object=object;if(object)object.setParent(this)};CRelSizeAnchor.prototype.setParent=function(object){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_RelSizeAnchorParent,this.parent,object));this.parent=object};CRelSizeAnchor.prototype.copy=function(oPr){var copy=new CRelSizeAnchor;copy.setFromTo(this.fromX,this.fromY,this.toX,this.toY);if(this.object)copy.setObject(this.object.copy(oPr));return copy};CRelSizeAnchor.prototype.Refresh_RecalcData=function(drawingDocument){if(this.parent&& this.parent.Refresh_RecalcData2)this.parent.Refresh_RecalcData2()};CRelSizeAnchor.prototype.Refresh_RecalcData2=function(drawingDocument){if(this.parent&&this.parent.Refresh_RecalcData2)this.parent.Refresh_RecalcData2()};AscDFH.drawingsChangesMap[AscDFH.historyitem_RelSizeAnchorFromX]=function(oClass,value){oClass.fromX=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_RelSizeAnchorFromY]=function(oClass,value){oClass.fromY=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_RelSizeAnchorToX]=function(oClass, value){oClass.toX=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_RelSizeAnchorToY]=function(oClass,value){oClass.toY=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_RelSizeAnchorObject]=function(oClass,value){oClass.object=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_RelSizeAnchorParent]=function(oClass,value){oClass.parent=value};AscDFH.changesFactory[AscDFH.historyitem_RelSizeAnchorFromX]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_RelSizeAnchorFromY]= window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_RelSizeAnchorToX]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_RelSizeAnchorToY]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_RelSizeAnchorObject]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RelSizeAnchorParent]=window["AscDFH"].CChangesDrawingsObject;function CAbsSizeAnchor(){CBaseObject.call(this);this.fromX= null;this.fromY=null;this.toX=null;this.toY=null;this.object=null;this.parent=null;this.drawingBase=null}CAbsSizeAnchor.prototype=Object.create(CBaseObject.prototype);CAbsSizeAnchor.prototype.constructor=CAbsSizeAnchor;CAbsSizeAnchor.prototype.setDrawingBase=function(drawingBase){this.drawingBase=drawingBase};CAbsSizeAnchor.prototype.getObjectType=function(){return AscDFH.historyitem_type_AbsSizeAnchor};CAbsSizeAnchor.prototype.setFromTo=function(fromX,fromY,extX,extY){History.Add(new AscDFH.CChangesDrawingsDouble(this, AscDFH.historyitem_AbsSizeAnchorFromX,this.fromX,fromX));History.Add(new AscDFH.CChangesDrawingsDouble(this,AscDFH.historyitem_AbsSizeAnchorFromY,this.fromY,fromY));History.Add(new AscDFH.CChangesDrawingsDouble(this,AscDFH.historyitem_AbsSizeAnchorExtX,this.toX,extX));History.Add(new AscDFH.CChangesDrawingsDouble(this,AscDFH.historyitem_AbsSizeAnchorExtY,this.toY,extY));this.fromX=fromX;this.fromY=fromY;this.toX=extX;this.toY=extY};CAbsSizeAnchor.prototype.setObject=function(object){History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_AbsSizeAnchorObject,this.object,object));this.object=object;if(object)object.setParent(this)};CAbsSizeAnchor.prototype.setParent=function(object){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_AbsSizeAnchorParent,this.parent,object));this.parent=object};CAbsSizeAnchor.prototype.copy=function(oPr){var copy=new CRelSizeAnchor;copy.setFromTo(this.fromX,this.fromY,this.toX,this.toY);if(this.object)copy.setObject(this.object.copy(oPr));return copy};CAbsSizeAnchor.prototype.Refresh_RecalcData= function(drawingDocument){if(this.parent&&this.parent.Refresh_RecalcData2)this.parent.Refresh_RecalcData2()};CAbsSizeAnchor.prototype.Refresh_RecalcData2=function(drawingDocument){if(this.parent&&this.parent.Refresh_RecalcData2)this.parent.Refresh_RecalcData2()};function CalculateSrcRect(parentCropTransform,bounds,oInvertTransformCrop,cropExtX,cropExtY){var lt_x_abs=parentCropTransform.TransformPointX(bounds.min_x,bounds.min_y);var lt_y_abs=parentCropTransform.TransformPointY(bounds.min_x,bounds.min_y); var rb_x_abs=parentCropTransform.TransformPointX(bounds.max_x,bounds.max_y);var rb_y_abs=parentCropTransform.TransformPointY(bounds.max_x,bounds.max_y);var lt_x_rel=oInvertTransformCrop.TransformPointX(lt_x_abs,lt_y_abs);var lt_y_rel=oInvertTransformCrop.TransformPointY(lt_x_abs,lt_y_abs);var rb_x_rel=oInvertTransformCrop.TransformPointX(rb_x_abs,rb_y_abs);var rb_y_rel=oInvertTransformCrop.TransformPointY(rb_x_abs,rb_y_abs);var srcRect=new AscFormat.CSrcRect;var _l=100*lt_x_rel/cropExtX;var _t=100* lt_y_rel/cropExtY;var _r=100*rb_x_rel/cropExtX;var _b=100*rb_y_rel/cropExtY;srcRect.l=Math.min(_l,_r);srcRect.t=Math.min(_t,_b);srcRect.r=Math.max(_l,_r);srcRect.b=Math.max(_t,_b);return srcRect}AscDFH.drawingsChangesMap[AscDFH.historyitem_AbsSizeAnchorFromX]=function(oClass,value){oClass.fromX=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_AbsSizeAnchorFromY]=function(oClass,value){oClass.fromY=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_AbsSizeAnchorExtX]=function(oClass,value){oClass.toX= value};AscDFH.drawingsChangesMap[AscDFH.historyitem_AbsSizeAnchorExtY]=function(oClass,value){oClass.toY=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_AbsSizeAnchorObject]=function(oClass,value){oClass.object=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_AbsSizeAnchorParent]=function(oClass,value){oClass.parent=value};AscDFH.changesFactory[AscDFH.historyitem_AbsSizeAnchorFromX]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_AbsSizeAnchorFromY]=window["AscDFH"].CChangesDrawingsDouble; AscDFH.changesFactory[AscDFH.historyitem_AbsSizeAnchorExtX]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_AbsSizeAnchorExtY]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_AbsSizeAnchorObject]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AbsSizeAnchorParent]=window["AscDFH"].CChangesDrawingsObject;window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CBaseObject=CBaseObject;window["AscFormat"].CGraphicObjectBase= CGraphicObjectBase;window["AscFormat"].CGraphicBounds=CGraphicBounds;window["AscFormat"].checkNormalRotate=checkNormalRotate;window["AscFormat"].normalizeRotate=normalizeRotate;window["AscFormat"].CRelSizeAnchor=CRelSizeAnchor;window["AscFormat"].CAbsSizeAnchor=CAbsSizeAnchor;window["AscFormat"].CalculateSrcRect=CalculateSrcRect;window["AscFormat"].CCopyObjectProperties=CCopyObjectProperties;window["AscFormat"].LOCKS_MASKS=LOCKS_MASKS})(window);"use strict";(function(window,undefined){var g_memory= AscFonts.g_memory;var DecodeBase64Char=AscFonts.DecodeBase64Char;var b64_decode=AscFonts.b64_decode;var c_oAscSizeRelFromH=AscCommon.c_oAscSizeRelFromH;var c_oAscSizeRelFromV=AscCommon.c_oAscSizeRelFromV;var CMatrix=AscCommon.CMatrix;var isRealObject=AscCommon.isRealObject;var global_mouseEvent=AscCommon.global_mouseEvent;var History=AscCommon.History;var global_MatrixTransformer=AscCommon.global_MatrixTransformer;var checkNormalRotate=AscFormat.checkNormalRotate;var HitInLine=AscFormat.HitInLine; var MOVE_DELTA=AscFormat.MOVE_DELTA;var c_oAscFill=Asc.c_oAscFill;var dTextFitDelta=3;function CheckObjectLine(obj){return obj instanceof CShape&&obj.spPr&&obj.spPr.geometry&&AscFormat.CheckLinePreset(obj.spPr.geometry.preset)}function CheckWordArtTextPr(oRun){if(oRun instanceof AscCommonWord.ParaRun){var oTextPr=oRun.Get_CompiledPr();if(oTextPr.TextFill||oTextPr.TextOutline&&oTextPr.TextOutline.Fill&&oTextPr.TextOutline.Fill.fill&&oTextPr.TextOutline.Fill.fill.type!==Asc.c_oAscFill.FILL_TYPE_NOFILL|| oTextPr.Unifill&&oTextPr.Unifill.fill&&(oTextPr.Unifill.fill.type!==c_oAscFill.FILL_TYPE_SOLID||oTextPr.Unifill.transparent!=null&&oTextPr.Unifill.transparent<254.5))return true}return false}function hitInRect(x,y,l,t,r,b){return x>=l&&x<=r&&y>=t&&y<=b}function hitToCropHandles(x,y,object){var invert_transform=object.getInvertTransform();if(!invert_transform)return-1;var t_x,t_y;t_x=invert_transform.TransformPointX(x,y);t_y=invert_transform.TransformPointY(x,y);var fCoeff=object.convertPixToMM(1); var fCoeff2=1/fCoeff;var widthCorner=object.extX*fCoeff2+1>>1;var isCentralMarkerX=widthCorner>40?true:false;if(widthCorner>17)widthCorner=17;var heightCorner=object.extY*fCoeff2+1>>1;var isCentralMarkerY=heightCorner>40?true:false;if(heightCorner>17)heightCorner=17;widthCorner*=fCoeff;heightCorner*=fCoeff;var markerWidth=5*fCoeff;if(hitInRect(t_x,t_y,0,0,widthCorner,markerWidth))return 0;if(hitInRect(t_x,t_y,0,0,markerWidth,heightCorner))return 0;if(isCentralMarkerX){if(hitInRect(t_x,t_y,object.extX/ 2-widthCorner/2,0,object.extX/2+widthCorner/2,markerWidth))return 1;if(hitInRect(t_x,t_y,object.extX/2-widthCorner/2,object.extY-markerWidth,object.extX/2+widthCorner/2,object.extY))return 5}if(hitInRect(t_x,t_y,object.extX-widthCorner,0,object.extX,markerWidth))return 2;if(hitInRect(t_x,t_y,object.extX-markerWidth,0,object.extX,heightCorner))return 2;if(isCentralMarkerY){if(hitInRect(t_x,t_y,object.extX-markerWidth,object.extY/2-heightCorner/2,object.extX,object.extY/2+heightCorner/2))return 3;if(hitInRect(t_x, t_y,0,object.extY/2-heightCorner/2,markerWidth,object.extY/2+heightCorner/2))return 7}if(hitInRect(t_x,t_y,object.extX-markerWidth,object.extY-heightCorner,object.extX,object.extY))return 4;if(hitInRect(t_x,t_y,object.extX-widthCorner,object.extY-markerWidth,object.extX,object.extY))return 4;if(hitInRect(t_x,t_y,0,object.extY-heightCorner,markerWidth,object.extY))return 6;if(hitInRect(t_x,t_y,0,object.extY-markerWidth,widthCorner,object.extY))return 6;return-1}function hitToHandles(x,y,object){if(object.cropObject)return hitToCropHandles(x, y,object);var invert_transform=object.getInvertTransform();if(!invert_transform)return-1;var t_x,t_y;t_x=invert_transform.TransformPointX(x,y);t_y=invert_transform.TransformPointY(x,y);var radius=object.convertPixToMM(AscCommon.TRACK_CIRCLE_RADIUS);if(typeof global_mouseEvent!=="undefined"&&isRealObject(global_mouseEvent)&&AscFormat.isRealNumber(global_mouseEvent.KoefPixToMM))radius*=global_mouseEvent.KoefPixToMM;if(global_mouseEvent&&global_mouseEvent.AscHitToHandlesEpsilon)radius=global_mouseEvent.AscHitToHandlesEpsilon; radius*=radius;var _min_dist=2*radius;var _ret_value=-1;var check_line=CheckObjectLine(object);var sqr_x=t_x*t_x,sqr_y=t_y*t_y;var _tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist){_min_dist=_tmp_dist;_ret_value=0}var hc=object.extX*.5;var dist_x=t_x-hc;sqr_x=dist_x*dist_x;_tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist&&!check_line){_min_dist=_tmp_dist;_ret_value=1}dist_x=t_x-object.extX;sqr_x=dist_x*dist_x;_tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist&&!check_line){_min_dist=_tmp_dist;_ret_value=2}var vc= object.extY*.5;var dist_y=t_y-vc;sqr_y=dist_y*dist_y;_tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist&&!check_line){_min_dist=_tmp_dist;_ret_value=3}dist_y=t_y-object.extY;sqr_y=dist_y*dist_y;_tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist){_min_dist=_tmp_dist;_ret_value=4}dist_x=t_x-hc;sqr_x=dist_x*dist_x;_tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist&&!check_line){_min_dist=_tmp_dist;_ret_value=5}dist_x=t_x;sqr_x=dist_x*dist_x;_tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist&&!check_line){_min_dist=_tmp_dist; _ret_value=6}dist_y=t_y-vc;sqr_y=dist_y*dist_y;_tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist&&!check_line){_min_dist=_tmp_dist;_ret_value=7}if(object.canRotate&&object.canRotate()&&!check_line){var rotate_distance=object.convertPixToMM(AscCommon.TRACK_DISTANCE_ROTATE);dist_y=t_y+rotate_distance;sqr_y=dist_y*dist_y;dist_x=t_x-hc;sqr_x=dist_x*dist_x;_tmp_dist=sqr_x+sqr_y;if(_tmp_dist<_min_dist){_min_dist=_tmp_dist;_ret_value=8}}dist_x=t_x-hc;dist_y=t_y-vc;_tmp_dist=dist_x*dist_x+dist_y*dist_y;if(_tmp_dist< _min_dist&&!check_line){_min_dist=_tmp_dist;_ret_value=-1}if(_min_dist<radius)return _ret_value;return-1}function CreateUniFillByUniColorCopy(uniColor){var ret=new AscFormat.CUniFill;ret.setFill(new AscFormat.CSolidFill);ret.fill.setColor(uniColor.createDuplicate());return ret}function CreateUniFillByUniColor(uniColor){var ret=new AscFormat.CUniFill;ret.setFill(new AscFormat.CSolidFill);ret.fill.setColor(uniColor.createDuplicate());return ret}function CopyRunToPPTX(Run,Paragraph,bHyper){var NewRun= new ParaRun(Paragraph,false);var RunPr=Run.Pr.Copy();if(RunPr.RStyle!=undefined)RunPr.RStyle=undefined;RunPr.FontScale=undefined;if(bHyper){if(!RunPr.Unifill)RunPr.Unifill=AscFormat.CreateUniFillSchemeColorWidthTint(11,0);RunPr.Underline=true}if(RunPr.TextFill){RunPr.Unifill=RunPr.TextFill;RunPr.TextFill=undefined}NewRun.Set_Pr(RunPr);var PosToAdd=0;for(var CurPos=0;CurPos<Run.Content.length;CurPos++){var Item=Run.Content[CurPos];if(Item.Type!==para_End&&Item.Type!==para_Drawing&&Item.Type!==para_Comment&& Item.Type!==para_PageCount&&Item.Type!==para_FootnoteRef&&Item.Type!==para_FootnoteReference&&Item.Type!==para_PageNum&&Item.Type!==para_FieldChar&&Item.Type!==para_Bookmark&&Item.Type!==para_RevisionMove&&Item.Type!==para_InstrText&&Item.Type!==para_EndnoteReference&&Item.Type!==para_EndnoteRef){NewRun.Add_ToContent(PosToAdd,Item.Copy(),false);++PosToAdd}}return NewRun}function ConvertParagraphContentToPPTX(aOrigContent,oNewParagraph,bIsAddMath,bRemoveHyperlink){var Count=aOrigContent.length;for(var Index= 0;Index<Count;Index++){var Item=aOrigContent[Index];if(Item.Type===para_Run)oNewParagraph.Internal_Content_Add(oNewParagraph.Content.length,CopyRunToPPTX(Item,oNewParagraph),false);else if(Item.Type===para_Hyperlink)if(bRemoveHyperlink===true)for(var j=0;j<Item.Content.length;++j){if(Item.Content[j].Type===para_Run)oNewParagraph.Internal_Content_Add(oNewParagraph.Content.length,CopyRunToPPTX(Item.Content[j],oNewParagraph),false)}else oNewParagraph.Internal_Content_Add(oNewParagraph.Content.length, ConvertHyperlinkToPPTX(Item,oNewParagraph),false);else if(Item.Type===para_InlineLevelSdt)ConvertParagraphContentToPPTX(Item.Content,oNewParagraph,bIsAddMath,bRemoveHyperlink);else if(true===bIsAddMath&&Item.Type===para_Math)oNewParagraph.Internal_Content_Add(oNewParagraph.Content.length,Item.Copy(),false)}}function ConvertParagraphToPPTX(paragraph,drawingDocument,newParent,bIsAddMath,bRemoveHyperlink){var _drawing_document=isRealObject(drawingDocument)?drawingDocument:paragraph.DrawingDocument;var _new_parent= isRealObject(newParent)?newParent:null;var new_paragraph=new Paragraph(_drawing_document,_new_parent,true);if(!(paragraph instanceof Paragraph))return new_paragraph;var oCopyPr=paragraph.Pr.Copy();oCopyPr.ContextualSpacing=undefined;oCopyPr.KeepLines=undefined;oCopyPr.KeepNext=undefined;oCopyPr.PageBreakBefore=undefined;oCopyPr.Shd=undefined;oCopyPr.Brd.First=undefined;oCopyPr.Brd.Last=undefined;oCopyPr.Brd.Between=undefined;oCopyPr.Brd.Bottom=undefined;oCopyPr.Brd.Left=undefined;oCopyPr.Brd.Right= undefined;oCopyPr.Brd.Top=undefined;oCopyPr.WidowControl=undefined;oCopyPr.Tabs=undefined;oCopyPr.NumPr=undefined;oCopyPr.PStyle=undefined;oCopyPr.FramePr=undefined;new_paragraph.Set_Pr(oCopyPr);var oNewEndPr=paragraph.TextPr.Value.Copy();if(oNewEndPr.TextFill){oNewEndPr.Unifill=oNewEndPr.TextFill;oNewEndPr.TextFill=undefined}new_paragraph.TextPr.Set_Value(oNewEndPr);new_paragraph.Internal_Content_Remove2(0,new_paragraph.Content.length);ConvertParagraphContentToPPTX(paragraph.Content,new_paragraph, bIsAddMath,bRemoveHyperlink);var EndRun=new ParaRun(new_paragraph);EndRun.Add_ToContent(0,new ParaEnd);new_paragraph.Internal_Content_Add(new_paragraph.Content.length,EndRun,false);return new_paragraph}function ConvertElementsToPPTX(aResult,aElements,drawingDocument,newParent,bIsAddMath,bRemoveHyperlink){var i,j,oElement;for(i=0;i<aElements.length;++i){oElement=aElements[i];if(oElement instanceof AscCommonWord.Paragraph)aResult.push(ConvertParagraphToPPTX(oElement));else if(oElement instanceof AscCommonWord.CTable){var paragraphs= [];oElement.GetAllParagraphs({All:true},paragraphs);for(j=0;j<paragraphs.length;j++)aResult.push(AscFormat.ConvertParagraphToPPTX(paragraphs[j],drawingDocument,newParent,bIsAddMath,bRemoveHyperlink))}else if(oElement instanceof AscCommonWord.CBlockLevelSdt)ConvertElementsToPPTX(aResult,oElement.Content.Content,drawingDocument,newParent,bIsAddMath,bRemoveHyperlink)}}function ConvertHyperlinkToPPTX(hyperlink,paragraph){var hyperlink_ret=new ParaHyperlink,i,item,pos=0;hyperlink_ret.SetValue(hyperlink.Value); hyperlink_ret.SetToolTip(hyperlink.ToolTip);for(i=0;i<hyperlink.Content.length;++i){item=hyperlink.Content[i];if(item.Type===para_Run)hyperlink_ret.Add_ToContent(pos++,CopyRunToPPTX(item,paragraph,true));else if(item.Type===para_Hyperlink)hyperlink_ret.Add_ToContent(pos++,ConvertHyperlinkToPPTX(item,paragraph))}return hyperlink_ret}function ConvertParagraphToWord(paragraph,docContent){var _docContent=isRealObject(docContent)?docContent:paragraph.Parent;var oldFlag=paragraph.bFromDocument;paragraph.bFromDocument= true;var new_paragraph=paragraph.Copy(_docContent);CheckWordParagraphContent(new_paragraph.Content,new_paragraph.Pr.DefaultRunPr);var NewRPr=CheckWordRunPr(new_paragraph.TextPr.Value);var oCopyDefaultPr;if(NewRPr){if(new_paragraph.Pr.DefaultRunPr){oCopyDefaultPr=new_paragraph.Pr.DefaultRunPr.Copy();oCopyDefaultPr.Merge(NewRPr);NewRPr=CheckWordRunPr(oCopyDefaultPr);if(!NewRPr)NewRPr=oCopyDefaultPr}new_paragraph.TextPr.Apply_TextPr(NewRPr)}else if(new_paragraph.Pr.DefaultRunPr){oCopyDefaultPr=new_paragraph.Pr.DefaultRunPr.Copy(); oCopyDefaultPr.Merge(new_paragraph.TextPr.Value);NewRPr=CheckWordRunPr(oCopyDefaultPr);if(!NewRPr)NewRPr=oCopyDefaultPr;new_paragraph.TextPr.Apply_TextPr(NewRPr)}paragraph.bFromDocument=oldFlag;return new_paragraph}function CheckWordRunPr(Pr,bMath){var NewRPr=null;if(Pr.Unifill&&Pr.Unifill.fill)switch(Pr.Unifill.fill.type){case c_oAscFill.FILL_TYPE_SOLID:{if(Pr.Unifill.fill.color&&Pr.Unifill.fill.color.color)switch(Pr.Unifill.fill.color.color.type){case Asc.c_oAscColor.COLOR_TYPE_SCHEME:{if(Pr.Unifill.fill.color.Mods&& Pr.Unifill.fill.color.Mods.Mods.length!==0)if(!Pr.Unifill.fill.color.canConvertPPTXModsToWord()){NewRPr=Pr.Copy();NewRPr.TextFill=NewRPr.Unifill;NewRPr.Unifill=undefined}else{NewRPr=Pr.Copy();NewRPr.Unifill.convertToWordMods()}break}case Asc.c_oAscColor.COLOR_TYPE_SRGB:{NewRPr=Pr.Copy();var RGBA=Pr.Unifill.fill.color.color.RGBA;NewRPr.Color=new CDocumentColor(RGBA.R,RGBA.G,RGBA.B);NewRPr.Unifill=undefined;break}default:{NewRPr=Pr.Copy();NewRPr.TextFill=NewRPr.Unifill;NewRPr.Unifill=undefined}}break}case c_oAscFill.FILL_TYPE_PATT:case c_oAscFill.FILL_TYPE_BLIP:{NewRPr= Pr.Copy();NewRPr.TextFill=AscFormat.CreateUnfilFromRGB(0,0,0);NewRPr.Unifill=undefined;break}default:{NewRPr=Pr.Copy();NewRPr.TextFill=NewRPr.Unifill;NewRPr.Unifill=undefined;break}}if(bMath){NewRPr=Pr.Copy();NewRPr.RFonts.Set_All("Cambria Math",-1)}return NewRPr}function CheckWordParagraphContent(aContent,oTextPr){var NewRPr,MergePr;for(var i=0;i<aContent.length;++i){var oItem=aContent[i];switch(oItem.Type){case para_Run:{NewRPr=CheckWordRunPr(oItem.Pr);if(NewRPr){MergePr=NewRPr;if(oTextPr){MergePr= oTextPr.Copy();MergePr.Merge(NewRPr);NewRPr=CheckWordRunPr(MergePr);if(!NewRPr)NewRPr=MergePr}oItem.Set_Pr(NewRPr)}else if(oTextPr){MergePr=oTextPr.Copy();MergePr.Merge(oItem.Pr);NewRPr=CheckWordRunPr(MergePr);if(!NewRPr)NewRPr=MergePr;oItem.Set_Pr(NewRPr)}break}case para_Hyperlink:{CheckWordParagraphContent(oItem.Content);break}case para_Math:{if(oItem.Root&&oItem.Root.Content)CheckWordParagraphContent(oItem.Root.Content);break}case para_Math_Run:{NewRPr=CheckWordRunPr(oItem.Pr,true);if(NewRPr){MergePr= NewRPr;if(oTextPr){MergePr=oTextPr.Copy();MergePr.Merge(NewRPr);NewRPr=CheckWordRunPr(MergePr);if(!NewRPr)NewRPr=MergePr}oItem.Set_Pr(NewRPr)}else if(oTextPr){MergePr=oTextPr.Copy();MergePr.Merge(oItem.Pr);NewRPr=CheckWordRunPr(MergePr);if(!NewRPr)NewRPr=MergePr;oItem.Set_Pr(NewRPr)}break}}}}function ConvertGraphicFrameToWordTable(oGraphicFrame,oDocument){oGraphicFrame.setWordFlag(false,oDocument);return oGraphicFrame.graphicObject.Copy(oDocument)}function ConvertTableToGraphicFrame(oTable,oPresentation){var oGraphicFrame= new AscFormat.CGraphicFrame;var oTable2=new CTable(oPresentation.DrawingDocument,oGraphicFrame,true,0,[].concat(oTable.TableGrid),oTable.TableGrid.length,true);oTable2.Reset(0,0,50,1E5,0,0,1);oTable2.SetTableLayout(tbllayout_Fixed);oTable2.Set_Pr(oTable.Pr.Copy());oTable2.Set_TableLook(oTable.TableLook.Copy());for(var i=0;i<oTable.Content.length;++i){var oRow=oTable.Content[i];var oNewRow=new CTableRow(oTable2,oRow.Content.length,oTable2.TableGrid);for(var j=0;j<oRow.Content.length;++j){var oContent= oRow.Content[j].Content;var oNewContent=oNewRow.Content[j].Content;for(var t=0;t<oContent.Content.length;++t)if(oContent.Content[t].Get_Type()===type_Paragraph)oNewContent.Internal_Content_Add(oNewContent.Content.length,AscFormat.ConvertParagraphToPPTX(oContent.Content[t],oPresentation.DrawingDocument,oNewContent))}var nIndex=oTable2.Content.length;oTable2.Content[nIndex]=oNewRow;History.Add(new CChangesTableAddRow(oTable2,nIndex,[oNewRow]));oTable2.private_UpdateTableGrid()}if(!oGraphicFrame.spPr){oGraphicFrame.setSpPr(new AscFormat.CSpPr); oGraphicFrame.spPr.setParent(oGraphicFrame)}oGraphicFrame.spPr.setXfrm(new AscFormat.CXfrm);oGraphicFrame.spPr.xfrm.setExtX(50);oGraphicFrame.spPr.xfrm.setExtY(50);oGraphicFrame.spPr.xfrm.setParent(oGraphicFrame.spPr);var _nvGraphicFramePr=new AscFormat.UniNvPr;oGraphicFrame.setNvSpPr(_nvGraphicFramePr);if(AscCommon.isRealObject(_nvGraphicFramePr)&&AscFormat.isRealNumber(_nvGraphicFramePr.locks))oGraphicFrame.setLocks(_nvGraphicFramePr.locks);oGraphicFrame.setGraphicObject(oTable2);oGraphicFrame.setBDeleted(false); return oGraphicFrame}function fHandleContent(aContent,oMax){for(var i=0;i<aContent.length;++i){var oContentElement=aContent[i];if(oContentElement.Get_Type()===type_Paragraph){var paragraph_lines=aContent[i].Lines;for(var j=0;j<paragraph_lines.length;++j)if(paragraph_lines[j].Ranges[0].W>oMax.max_width)oMax.max_width=paragraph_lines[j].Ranges[0].X+paragraph_lines[j].Ranges[0].W}else if(oContentElement.Get_Type()===type_Table){if(oContentElement.Bounds.Right>oMax.max_width)oMax.max_width=oContentElement.Bounds.Right}else if(oContentElement.Get_Type()=== type_BlockLevelSdt)if(oContentElement&&oContentElement.Content)fHandleContent(oContentElement.Content.Content,oMax)}}function RecalculateDocContentByMaxLine(oDocContent,dMaxWidth,bNeedRecalcAllDrawings){var oMaxWidth={max_width:0},i;oDocContent.Reset(0,0,dMaxWidth,2E4);if(bNeedRecalcAllDrawings){var aAllDrawings=oDocContent.GetAllDrawingObjects();for(i=0;i<aAllDrawings.length;++i)aAllDrawings[i].GraphicObj.recalculate()}oDocContent.Recalculate_Page(0,true);fHandleContent(oDocContent.Content,oMaxWidth); if(oMaxWidth.max_width===0){if(oDocContent.Is_Empty())if(oDocContent.Content[0]&&oDocContent.Content[0].Content[0]&&oDocContent.Content[0].Content[0].Content[0])return oDocContent.Content[0].Content[0].Content[0].WidthVisible/TEXTWIDTH_DIVIDER;return.001}return oMaxWidth.max_width}function CheckExcelDrawingXfrm(xfrm){var rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;if(checkNormalRotate(rot)){if(xfrm.offX<0)xfrm.setOffX(0);if(xfrm.offY<0)xfrm.setOffY(0)}else{var dPosX=xfrm.offX+xfrm.extX/2-xfrm.extY/ 2;var dPosY=xfrm.offY+xfrm.extY/2-xfrm.extX/2;if(dPosX<0)xfrm.setOffX(xfrm.offX-dPosX);if(dPosY<0)xfrm.setOffY(xfrm.offY-dPosY)}}function SetXfrmFromMetrics(oDrawing,metrics){AscFormat.CheckSpPrXfrm(oDrawing);var rot=AscFormat.isRealNumber(oDrawing.spPr.xfrm.rot)?AscFormat.normalizeRotate(oDrawing.spPr.xfrm.rot):0;var metricExtX,metricExtY;if(!(oDrawing instanceof AscFormat.CGroupShape)){metricExtX=metrics.extX;metricExtY=metrics.extY;if(checkNormalRotate(rot)){oDrawing.spPr.xfrm.setExtX(metrics.extX); oDrawing.spPr.xfrm.setExtY(metrics.extY)}else{oDrawing.spPr.xfrm.setExtX(metrics.extY);oDrawing.spPr.xfrm.setExtY(metrics.extX)}}else if(AscFormat.isRealNumber(oDrawing.spPr.xfrm.extX)&&AscFormat.isRealNumber(oDrawing.spPr.xfrm.extY)){metricExtX=oDrawing.spPr.xfrm.extX;metricExtY=oDrawing.spPr.xfrm.extY}else{metricExtX=metrics.extX;metricExtY=metrics.extY}if(checkNormalRotate(rot)){oDrawing.spPr.xfrm.setOffX(metrics.x);oDrawing.spPr.xfrm.setOffY(metrics.y)}else{oDrawing.spPr.xfrm.setOffX(metrics.x+ metricExtX/2-metricExtY/2);oDrawing.spPr.xfrm.setOffY(metrics.y+metricExtY/2-metricExtX/2)}}AscDFH.changesFactory[AscDFH.historyitem_ShapeSetNvSpPr]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetSpPr]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetStyle]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetTxBody]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetTextBoxContent]= AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetBodyPr]=AscDFH.CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_SetBFromSerialize]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetParent]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetGroup]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetWordShape]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetSignature]= AscDFH.CChangesDrawingsObjectNoId;AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetNvSpPr]=function(oClass,value){oClass.nvSpPr=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetSpPr]=function(oClass,value){oClass.spPr=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetStyle]=function(oClass,value){oClass.style=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetTxBody]=function(oClass,value){oClass.txBody=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetTextBoxContent]= function(oClass,value){oClass.textBoxContent=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetBodyPr]=function(oClass,value){oClass.bodyPr=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_AutoShapes_SetBFromSerialize]=function(oClass,value){oClass.fromSerialize=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetParent]=function(oClass,value){oClass.parent=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetGroup]=function(oClass,value){oClass.group=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetWordShape]= function(oClass,value){oClass.bWordShape=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ShapeSetSignature]=function(oClass,value){var oldSignature=oClass.signatureLine;var newSignature=value;oClass.signatureLine=value;if(!AscCommon.isFileBuild()){var oApi=window["Asc"]&&window["Asc"]["editor"]||editor;if(oApi){if(oldSignature&&oldSignature.id)oApi.sendEvent("asc_onRemoveSignature",oldSignature.id);if(newSignature&&newSignature.id)oApi.sendEvent("asc_onAddSignature",newSignature.id)}}};function CSignatureLine(){this.id= null;this.signer=null;this.signer2=null;this.email=null;this.showDate=null;this.instructions=null}CSignatureLine.prototype.Write_ToBinary=function(writer){AscFormat.writeString(writer,this.id);AscFormat.writeString(writer,this.signer);AscFormat.writeString(writer,this.signer2);AscFormat.writeString(writer,this.email);AscFormat.writeBool(writer,this.showDate);AscFormat.writeString(writer,this.instructions)};CSignatureLine.prototype.Read_FromBinary=function(reader){this.id=AscFormat.readString(reader); this.signer=AscFormat.readString(reader);this.signer2=AscFormat.readString(reader);this.email=AscFormat.readString(reader);this.showDate=AscFormat.readBool(reader);this.instructions=AscFormat.readString(reader)};CSignatureLine.prototype.copy=function(){var ret=new CSignatureLine;ret.id=AscCommon.CreateGUID();ret.signer=this.signer;ret.signer2=this.signer2;ret.email=this.email;ret.showDate=this.showDate;ret.instructions=this.instructions;return ret};CSignatureLine.prototype.copyWithId=function(){var sId= this.id;var oCopy=this.copy();oCopy.id=sId;return oCopy};CSignatureLine.prototype.setProperties=function(oPr){this.signer=oPr.asc_getSigner1();this.signer2=oPr.asc_getSigner2();this.email=oPr.asc_getEmail();this.showDate=oPr.asc_getShowDate();this.instructions=oPr.asc_getInstructions()};AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ShapeSetBodyPr]=AscFormat.CBodyPr;AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ShapeSetSignature]=CSignatureLine;function CShape(){AscFormat.CGraphicObjectBase.call(this); this.nvSpPr=null;this.style=null;this.txBody=null;this.bodyPr=null;this.textBoxContent=null;this.drawingBase=null;this.bWordShape=null;this.bCheckAutoFitFlag=false;this.signatureLine=null;this.transformText=new CMatrix;this.invertTransformText=null;this.localTransformText=new CMatrix;this.worksheet=null;this.cachedImage=null;this.txWarpStruct=null;this.txWarpStructParamarks=null;this.txWarpStructNoTransform=null;this.txWarpStructParamarksNoTransform=null;this.tmpFontScale=undefined;this.tmpLnSpcReduction= undefined}CShape.prototype=Object.create(AscFormat.CGraphicObjectBase.prototype);CShape.prototype.constructor=CShape;CShape.prototype.getObjectType=function(){return AscDFH.historyitem_type_Shape};CShape.prototype.GetAllDrawingObjects=function(DrawingObjects){var oContent=this.getDocContent();if(oContent)oContent.GetAllDrawingObjects(DrawingObjects)};CShape.prototype.setSignature=function(oSignature){History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ShapeSetSignature,this.signatureLine, oSignature));this.signatureLine=oSignature};CShape.prototype.setSignaturePr=function(oPr,sUrl){if(!oPr||!this.signatureLine)return;var oCopy=this.signatureLine.copyWithId();oCopy.setProperties(oPr);this.setSignature(oCopy);if(sUrl)if(this.spPr){var oBlipFillUnifill=AscFormat.CreateBlipFillUniFillFromUrl(sUrl);this.spPr.setFill(oBlipFillUnifill)}};CShape.prototype.convertToWord=function(document){this.setBDeleted(true);var c=new CShape;c.setWordShape(true);c.setBDeleted(false);if(this.nvSpPr)c.setNvSpPr(this.nvSpPr.createDuplicate()); if(this.spPr){c.setSpPr(this.spPr.createDuplicate());if(!c.spPr.geometry)c.spPr.setGeometry(AscFormat.CreateGeometry("rect"));c.spPr.setParent(c)}if(this.style)c.setStyle(this.style.createDuplicate());if(this.txBody){if(this.txBody.bodyPr)c.setBodyPr(this.txBody.bodyPr.createDuplicate());if(this.txBody.content){var new_content=new CDocumentContent(c,document.DrawingDocument,0,0,0,2E4,false,false,false);var paragraphs=this.txBody.content.Content;new_content.Internal_Content_RemoveAll();for(var i=0;i< paragraphs.length;++i){var cur_par=paragraphs[i];var new_paragraph=ConvertParagraphToWord(cur_par,new_content);new_content.Internal_Content_Add(i,new_paragraph,false)}c.setTextBoxContent(new_content)}}if(this.signatureLine)c.setSignature(this.signatureLine.copy());return c};CShape.prototype.convertToPPTX=function(drawingDocument,worksheet,bIsAddMath){var c=new CShape;c.setWordShape(false);c.setBDeleted(false);c.setWorksheet(worksheet);if(this.nvSpPr)c.setNvSpPr(this.nvSpPr.createDuplicate());if(this.spPr){c.setSpPr(this.spPr.createDuplicate()); c.spPr.setParent(c)}if(this.style)c.setStyle(this.style.createDuplicate());if(this.textBoxContent){var tx_body=new AscFormat.CTextBody;tx_body.setParent(c);if(this.bodyPr)tx_body.setBodyPr(this.bodyPr.createDuplicate());var new_content=new AscFormat.CDrawingDocContent(tx_body,drawingDocument,0,0,0,0,false,false,true);new_content.Internal_Content_RemoveAll();var paragraphs=this.textBoxContent.Content;var index=0;for(var i=0;i<paragraphs.length;++i){var cur_par=paragraphs[i];if(cur_par instanceof Paragraph){var new_paragraph= ConvertParagraphToPPTX(cur_par,drawingDocument,new_content,bIsAddMath);new_content.Internal_Content_Add(index++,new_paragraph,false)}}tx_body.setContent(new_content);c.setTxBody(tx_body)}if(worksheet)if(this.signatureLine)c.setSignature(this.signatureLine.copy());return c};CShape.prototype.handleAllContents=function(fCallback){var content=this.getDocContent();if(content)fCallback(content)};CShape.prototype.documentGetAllFontNames=function(AllFonts){var content=this.getDocContent();if(content)content.Document_Get_AllFontNames(AllFonts)}; CShape.prototype.documentCreateFontMap=function(map){var content=this.getDocContent();if(content)content.Document_CreateFontMap(map)};CShape.prototype.setNvSpPr=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ShapeSetNvSpPr,this.nvSpPr,pr));this.nvSpPr=pr};CShape.prototype.setSpPr=function(spPr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ShapeSetSpPr,this.spPr,spPr));this.spPr=spPr};CShape.prototype.setStyle=function(style){History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_ShapeSetStyle,this.style,style));this.style=style;var content=this.getDocContent();this.recalcInfo.recalculateShapeStyleForParagraph=true;if(this.recalcTextStyles)this.recalcTextStyles();if(content)content.Recalc_AllParagraphs_CompiledPr()};CShape.prototype.setTxBody=function(txBody){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ShapeSetTxBody,this.txBody,txBody));this.txBody=txBody};CShape.prototype.setTextBoxContent=function(textBoxContent){History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_ShapeSetTextBoxContent,this.textBoxContent,textBoxContent));this.textBoxContent=textBoxContent};CShape.prototype.setBodyPr=function(pr){History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ShapeSetBodyPr,this.bodyPr,pr));this.bodyPr=pr;this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateTransformText=true;this.addToRecalculate()};CShape.prototype.createTextBody=function(){var tx_body=new AscFormat.CTextBody;tx_body.setParent(this);tx_body.setContent(new AscFormat.CDrawingDocContent(tx_body, this.getDrawingDocument(),0,0,0,2E4,false,false,true));var oBodyPr=new AscFormat.CBodyPr;if(this.worksheet){oBodyPr.vertOverflow=AscFormat.nOTClip;oBodyPr.horzOverflow=AscFormat.nOTClip}tx_body.setBodyPr(oBodyPr);tx_body.content.Content[0].Set_DocumentIndex(0);tx_body.content.MoveCursorToStartPos(false);this.setTxBody(tx_body)};CShape.prototype.createTextBoxContent=function(){var body_pr=new AscFormat.CBodyPr;body_pr.setAnchor(1);this.setBodyPr(body_pr);this.setTextBoxContent(new CDocumentContent(this, this.getDrawingDocument(),0,0,0,2E4,false,false));this.textBoxContent.SetParagraphAlign(AscCommon.align_Center);this.textBoxContent.MoveCursorToStartPos(false);this.textBoxContent.Content[0].Set_DocumentIndex(0)};CShape.prototype.paragraphAdd=function(paraItem,bRecalculate){var content_to_add=this.getDocContent();if(!content_to_add)if(!AscFormat.CheckLinePresetForParagraphAdd(this.getPresetGeom())){if(this.bWordShape)this.createTextBoxContent();else this.createTextBody();content_to_add=this.getDocContent()}if(content_to_add)content_to_add.AddToParagraph(paraItem, bRecalculate)};CShape.prototype.applyTextFunction=function(docContentFunction,tableFunction,args){var content_to_add=this.getDocContent();if(!content_to_add)if(!AscFormat.CheckLinePresetForParagraphAdd(this.getPresetGeom())){if(this.bWordShape)this.createTextBoxContent();else this.createTextBody();content_to_add=this.getDocContent();content_to_add.MoveCursorToStartPos()}if(content_to_add)docContentFunction.apply(content_to_add,args);if(!editor||!editor.noCreatePoint||editor.exucuteHistory)this.checkExtentsByDocContent()}; CShape.prototype.clearContent=function(){var content=this.getDocContent();if(content){content.Set_ApplyToAll(true);content.Remove(-1);content.AddToParagraph(new AscCommonWord.ParaTextPr({Lang:{Val:undefined}}),false);content.Set_ApplyToAll(false)}};CShape.prototype.getDocContent=function(){if(this.txBody)return this.txBody.content;else if(this.textBoxContent)return this.textBoxContent;return null};CShape.prototype.getBodyPr=function(){return AscFormat.ExecuteNoHistory(function(){if(this.bWordShape){var ret= new AscFormat.CBodyPr;ret.setDefault();if(this.bodyPr)ret.merge(this.bodyPr);return ret}else{if(this.txBody&&this.txBody.bodyPr)return this.txBody.getCompiledBodyPr();var ret=new AscFormat.CBodyPr;ret.setDefault();return ret}},this,[])};CShape.prototype.GetRevisionsChangeElement=function(SearchEngine){var oContent=this.getDocContent();if(oContent)oContent.GetRevisionsChangeElement(SearchEngine)};CShape.prototype.Search=function(Str,Props,SearchEngine,Type){if(this.textBoxContent){var dd=this.getDrawingDocument(); dd.StartSearchTransform(this.transformText);this.textBoxContent.Search(Str,Props,SearchEngine,Type);dd.EndSearchTransform()}else if(this.txBody&&this.txBody.content)this.txBody.content.Search(Str,Props,SearchEngine,Type)};CShape.prototype.GetSearchElementId=function(bNext,bCurrent){if(this.textBoxContent)return this.textBoxContent.GetSearchElementId(bNext,bCurrent);else if(this.txBody&&this.txBody.content)return this.txBody.content.GetSearchElementId(bNext,bCurrent);return null};CShape.prototype.documentUpdateRulersState= function(){var content=this.getDocContent();if(!content)return;var xc,yc;var l,t,r,b;var body_pr=this.getBodyPr();var l_ins,t_ins,r_ins,b_ins;if(typeof body_pr.lIns==="number")l_ins=body_pr.lIns;else l_ins=2.54;if(typeof body_pr.tIns==="number")t_ins=body_pr.tIns;else t_ins=1.27;if(typeof body_pr.rIns==="number")r_ins=body_pr.rIns;else r_ins=2.54;if(typeof body_pr.bIns==="number")b_ins=body_pr.bIns;else b_ins=1.27;if(this.spPr&&isRealObject(this.spPr.geometry)&&isRealObject(this.spPr.geometry.rect)){l= this.spPr.geometry.rect.l+l_ins;t=this.spPr.geometry.rect.t+t_ins;r=this.spPr.geometry.rect.r-r_ins;b=this.spPr.geometry.rect.b-b_ins}else{l=l_ins;t=t_ins;r=this.extX-r_ins;b=this.extY-b_ins}var x_lt,y_lt,x_rt,y_rt,x_rb,y_rb,x_lb,y_lb;var tr=this.transform;x_lt=tr.TransformPointX(l,t);y_lt=tr.TransformPointY(l,t);x_rb=tr.TransformPointX(r,b);y_rb=tr.TransformPointY(r,b);xc=(x_lt+x_rb)*.5;yc=(y_lt+y_rb)*.5;var hc=(r-l)*.5;var vc=(b-t)*.5;this.getDrawingDocument().Set_RulerState_Paragraph({L:xc-hc, T:yc-vc,R:xc+hc,B:yc+vc});content.Document_UpdateRulersState(AscFormat.isRealNumber(this.selectStartPage)?this.selectStartPage:0)};CShape.prototype.setParent=function(parent){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ShapeSetParent,this.parent,parent));this.parent=parent};CShape.prototype.setGroup=function(group){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ShapeSetGroup,this.group,group));this.group=group};CShape.prototype.getAllImages=function(images){if(this.spPr&& this.spPr.Fill&&this.spPr.Fill.fill instanceof AscFormat.CBlipFill&&typeof this.spPr.Fill.fill.RasterImageId==="string")images[AscCommon.getFullImageSrc2(this.spPr.Fill.fill.RasterImageId)]=true};CShape.prototype.getAllFonts=function(fonts){if(this.txBody){this.txBody.content.Document_Get_AllFontNames(fonts);if(this.txBody&&this.txBody.lstStyle)this.txBody.lstStyle.Document_Get_AllFontNames(fonts);delete fonts["+mj-lt"];delete fonts["+mn-lt"];delete fonts["+mj-ea"];delete fonts["+mn-ea"];delete fonts["+mj-cs"]; delete fonts["+mn-cs"]}};CShape.prototype.canFill=function(){if(this.spPr&&this.spPr.geometry)return this.spPr.geometry.canFill();return true};CShape.prototype.isShape=function(){return true};CShape.prototype.isImage=function(){return false};CShape.prototype.isChart=function(){return false};CShape.prototype.isGroup=function(){return false};CShape.prototype.getHierarchy=function(bIsSingleBody,info){{this.compiledHierarchy=[];if(this.parent){var hierarchy=this.compiledHierarchy;if(this.isPlaceholder()){var ph_type= this.getPlaceholderType();var ph_index=this.getPlaceholderIndex();var b_is_single_body;if(AscFormat.isRealBool(bIsSingleBody))b_is_single_body=bIsSingleBody;else b_is_single_body=this.getIsSingleBody&&this.getIsSingleBody();switch(this.parent.kind){case AscFormat.TYPE_KIND.SLIDE:{hierarchy.push(this.parent.Layout.getMatchingShape(ph_type,ph_index,b_is_single_body,info));hierarchy.push(this.parent.Layout.Master.getMatchingShape(ph_type,ph_index,true));break}case AscFormat.TYPE_KIND.LAYOUT:{hierarchy.push(this.parent.Master.getMatchingShape(ph_type, ph_index,true));break}case AscFormat.TYPE_KIND.NOTES:{if(this.parent.Master)hierarchy.push(this.parent.Master.getMatchingShape(ph_type,ph_index,true));break}}}this.recalcInfo.recalculateShapeHierarchy=true}}return this.compiledHierarchy};CShape.prototype.getPaddings=function(){var paddings=null;var shape=this;var body_pr;if(shape.txBody)if(shape.txBody.compiledBodyPr)body_pr=shape.txBody.compiledBodyPr;else body_pr=shape.txBody.getCompiledBodyPr();else if(shape.textBoxContent)body_pr=shape.bodyPr; if(body_pr){paddings=new Asc.asc_CPaddings;if(typeof body_pr.lIns==="number")paddings.Left=body_pr.lIns;else paddings.Left=2.54;if(typeof body_pr.tIns==="number")paddings.Top=body_pr.tIns;else paddings.Top=1.27;if(typeof body_pr.rIns==="number")paddings.Right=body_pr.rIns;else paddings.Right=2.54;if(typeof body_pr.bIns==="number")paddings.Bottom=body_pr.bIns;else paddings.Bottom=1.27}return paddings};CShape.prototype.getCompiledFill=function(){if(this.recalcInfo.recalculateFill){this.compiledFill= null;if(isRealObject(this.spPr)&&isRealObject(this.spPr.Fill)&&isRealObject(this.spPr.Fill.fill)){if(this.spPr.Fill.fill instanceof AscFormat.CGradFill&&this.spPr.Fill.fill.colors.length===0){var parent_objects=this.getParentObjects();var theme=parent_objects.theme;var fmt_scheme=theme.themeElements.fmtScheme;var fill_style_lst=fmt_scheme.fillStyleLst;for(var i=fill_style_lst.length-1;i>-1;--i)if(fill_style_lst[i]&&fill_style_lst[i].fill instanceof AscFormat.CGradFill){this.spPr.Fill=fill_style_lst[i].createDuplicate(); break}}this.compiledFill=this.spPr.Fill.createDuplicate();if(this.compiledFill&&this.compiledFill.fill&&this.compiledFill.fill.type===c_oAscFill.FILL_TYPE_GRP)if(this.group){var group_compiled_fill=this.group.getCompiledFill();if(isRealObject(group_compiled_fill)&&isRealObject(group_compiled_fill.fill))this.compiledFill=group_compiled_fill.createDuplicate();else this.compiledFill=null}else this.compiledFill=null}else if(isRealObject(this.group)){var group_compiled_fill=this.group.getCompiledFill(); if(isRealObject(group_compiled_fill)&&isRealObject(group_compiled_fill.fill))this.compiledFill=group_compiled_fill.createDuplicate();else{var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(isRealObject(hierarchy[i])&&isRealObject(hierarchy[i].spPr)&&isRealObject(hierarchy[i].spPr.Fill)&&isRealObject(hierarchy[i].spPr.Fill.fill)){this.compiledFill=hierarchy[i].spPr.Fill.createDuplicate();break}}}else{var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(isRealObject(hierarchy[i])&& isRealObject(hierarchy[i].spPr)&&isRealObject(hierarchy[i].spPr.Fill)&&isRealObject(hierarchy[i].spPr.Fill.fill)){this.compiledFill=hierarchy[i].spPr.Fill.createDuplicate();break}}this.recalcInfo.recalculateFill=false}return this.compiledFill};CShape.prototype.getMargins=function(){if(this.txBody)return this.txBody.getMargins();else return null};CShape.prototype.Document_UpdateRulersState=function(margins){if(this.txBody&&this.txBody.content)this.txBody.content.Document_UpdateRulersState(this.parent.num, this.getMargins())};CShape.prototype.getCompiledLine=function(){if(this.recalcInfo.recalculateLine){this.compiledLine=null;if(isRealObject(this.spPr)&&isRealObject(this.spPr.ln)&&isRealObject(this.spPr.ln))this.compiledLine=this.spPr.ln.createDuplicate();else if(isRealObject(this.group)){var group_compiled_line=this.group.getCompiledLine();if(isRealObject(group_compiled_line)&&isRealObject(group_compiled_line.fill))this.compiledLine=group_compiled_line.createDuplicate();else{var hierarchy=this.getHierarchy(); for(var i=0;i<hierarchy.length;++i)if(isRealObject(hierarchy[i])&&isRealObject(hierarchy[i].spPr)&&isRealObject(hierarchy[i].spPr.ln)){this.compiledLine=hierarchy[i].spPr.ln.createDuplicate();break}}}else{var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(isRealObject(hierarchy[i])&&isRealObject(hierarchy[i].spPr)&&isRealObject(hierarchy[i].spPr.ln)){this.compiledLine=hierarchy[i].spPr.ln.createDuplicate();break}}this.recalcInfo.recalculateLine=false}return this.compiledLine}; CShape.prototype.getCompiledTransparent=function(){if(this.recalcInfo.recalculateTransparent){this.compiledTransparent=null;if(isRealObject(this.spPr)&&isRealObject(this.spPr.Fill))if(AscFormat.isRealNumber(this.spPr.Fill.transparent))this.compiledTransparent=this.spPr.Fill.transparent;else if(this.spPr.Fill&&this.spPr.Fill.fill&&this.spPr.Fill.fill.type===c_oAscFill.FILL_TYPE_GRP)if(this.group&&this.group.spPr&&this.group.spPr.Fill&&AscFormat.isRealNumber(this.group.spPr.Fill.transparent))this.compiledTransparent= this.group.spPr.Fill.transparent;if(null!==this.compiledTransparent){this.recalcInfo.recalculateTransparent=false;return this.compiledTransparent}if(isRealObject(this.group)){var group_transparent=this.group.getCompiledTransparent();if(AscFormat.isRealNumber(group_transparent))this.compiledTransparent=group_transparent;else{var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(isRealObject(hierarchy[i])&&isRealObject(hierarchy[i].spPr)&&isRealObject(hierarchy[i].spPr.Fill)&&AscFormat.isRealNumber(hierarchy[i].spPr.Fill.transparent)){this.compiledTransparent= hierarchy[i].spPr.Fill.transparent;break}}}else{var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(isRealObject(hierarchy[i])&&isRealObject(hierarchy[i].spPr)&&isRealObject(hierarchy[i].spPr.Fill)&&AscFormat.isRealNumber(hierarchy[i].spPr.Fill.transparent)){this.compiledTransparent=hierarchy[i].spPr.Fill.transparent;break}}this.recalcInfo.recalculateTransparent=false}return this.compiledTransparent};CShape.prototype.isPlaceholder=function(){return isRealObject(this.nvSpPr)&&isRealObject(this.nvSpPr.nvPr)&& isRealObject(this.nvSpPr.nvPr.ph)};CShape.prototype.getPlaceholderType=function(){return this.isPlaceholder()?this.nvSpPr.nvPr.ph.type:null};CShape.prototype.getPlaceholderIndex=function(){return this.isPlaceholder()?this.nvSpPr.nvPr.ph.idx:null};CShape.prototype.getPhType=function(){return this.isPlaceholder()?this.nvSpPr.nvPr.ph.type:null};CShape.prototype.getPhIndex=function(){return this.isPlaceholder()?this.nvSpPr.nvPr.ph.idx:null};CShape.prototype.setVerticalAlign=function(align){var content_to_add= this.getDocContent();if(!content_to_add)if(!AscFormat.CheckLinePresetForParagraphAdd(this.getPresetGeom()))if(this.bWordShape)this.createTextBoxContent();else this.createTextBody();var new_body_pr=this.getBodyPr();if(new_body_pr){new_body_pr=new_body_pr.createDuplicate();new_body_pr.anchor=align;if(this.bWordShape)this.setBodyPr(new_body_pr);else if(this.txBody)this.txBody.setBodyPr(new_body_pr)}};CShape.prototype.setVert=function(vert){var content_to_add=this.getDocContent();if(!content_to_add)if(!AscFormat.CheckLinePresetForParagraphAdd(this.getPresetGeom()))if(this.bWordShape)this.createTextBoxContent(); else this.createTextBody();var new_body_pr=this.getBodyPr();if(new_body_pr){new_body_pr=new_body_pr.createDuplicate();new_body_pr.vert=vert;if(this.bWordShape)this.setBodyPr(new_body_pr);else if(this.txBody)this.txBody.setBodyPr(new_body_pr)}this.checkExtentsByDocContent&&this.checkExtentsByDocContent()};CShape.prototype.setTextFitType=function(type){if(AscFormat.isRealNumber(type)){var new_body_pr=this.getBodyPr();if(new_body_pr){new_body_pr=new_body_pr.createDuplicate();new_body_pr.textFit=new AscFormat.CTextFit; new_body_pr.textFit.type=type;if(this.bWordShape)this.setBodyPr(new_body_pr);else if(this.txBody)this.txBody.setBodyPr(new_body_pr)}this.checkExtentsByDocContent(true,true)}};CShape.prototype.setVertOverflowType=function(type){if(AscFormat.isRealNumber(type)){var new_body_pr=this.getBodyPr();if(new_body_pr){new_body_pr=new_body_pr.createDuplicate();new_body_pr.vertOverflow=type;if(this.bWordShape)this.setBodyPr(new_body_pr);else if(this.txBody)this.txBody.setBodyPr(new_body_pr)}this.checkExtentsByDocContent(true, true)}};CShape.prototype.setPaddings=function(paddings){if(paddings){var new_body_pr=this.getBodyPr();if(new_body_pr){new_body_pr=new_body_pr.createDuplicate();if(AscFormat.isRealNumber(paddings.Left))new_body_pr.lIns=paddings.Left;if(AscFormat.isRealNumber(paddings.Top))new_body_pr.tIns=paddings.Top;if(AscFormat.isRealNumber(paddings.Right))new_body_pr.rIns=paddings.Right;if(AscFormat.isRealNumber(paddings.Bottom))new_body_pr.bIns=paddings.Bottom;if(this.bWordShape)this.setBodyPr(new_body_pr);else if(this.txBody)this.txBody.setBodyPr(new_body_pr)}}}; CShape.prototype.recalculateTransformText=function(){var oContent=this.getDocContent();if(!oContent)return;var oBodyPr=this.getBodyPr();this.clipRect=this.checkTransformTextMatrix(this.localTransformText,oContent,oBodyPr,false);this.transformText=this.localTransformText.CreateDublicate();this.invertTransformText=global_MatrixTransformer.Invert(this.transformText);if(this.txBody&&this.txBody.content2){this.transformText2=new CMatrix;this.clipRect2=this.checkTransformTextMatrix(this.transformText2, this.txBody.content2,oBodyPr,false);this.invertTransformText2=global_MatrixTransformer.Invert(this.transformText2)}var bNoTextNoShape=oBodyPr.prstTxWarp&&oBodyPr.prstTxWarp.preset!=="textNoShape";{this.localTransformTextWordArt=new CMatrix;this.checkTransformTextMatrix(this.localTransformTextWordArt,oContent,oBodyPr,bNoTextNoShape,!this.bWordShape&&bNoTextNoShape);this.transformTextWordArt=this.localTransformTextWordArt.CreateDublicate();this.invertTransformTextWordArt=global_MatrixTransformer.Invert(this.transformTextWordArt)}if(this.txBody&& this.txBody.content2){this.checkTransformTextMatrix(this.transformText2,this.txBody.content2,oBodyPr,bNoTextNoShape,!this.bWordShape&&bNoTextNoShape);this.transformTextWordArt2=new CMatrix;this.checkTransformTextMatrix(this.transformTextWordArt2,this.txBody.content2,oBodyPr,bNoTextNoShape,!this.bWordShape&&bNoTextNoShape)}if(this.checkPosTransformText)this.checkPosTransformText();if(this.checkContentDrawings)this.checkContentDrawings()};CShape.prototype.getFullFlip=function(){var _transform=this.localTransform; var _full_rotate=this.getFullRotate();var _full_pos_x_lt=_transform.TransformPointX(0,0);var _full_pos_y_lt=_transform.TransformPointY(0,0);var _full_pos_x_rt=_transform.TransformPointX(this.extX,0);var _full_pos_y_rt=_transform.TransformPointY(this.extX,0);var _full_pos_x_rb=_transform.TransformPointX(this.extX,this.extY);var _full_pos_y_rb=_transform.TransformPointY(this.extX,this.extY);var _rotate_matrix=new CMatrix;global_MatrixTransformer.RotateRadAppend(_rotate_matrix,_full_rotate);var _rotated_pos_x_lt= _rotate_matrix.TransformPointX(_full_pos_x_lt,_full_pos_y_lt);var _rotated_pos_x_rt=_rotate_matrix.TransformPointX(_full_pos_x_rt,_full_pos_y_rt);var _rotated_pos_y_rt=_rotate_matrix.TransformPointY(_full_pos_x_rt,_full_pos_y_rt);var _rotated_pos_y_rb=_rotate_matrix.TransformPointY(_full_pos_x_rb,_full_pos_y_rb);return{flipH:_rotated_pos_x_lt>_rotated_pos_x_rt,flipV:_rotated_pos_y_rt>_rotated_pos_y_rb}};CShape.prototype.recalculateTransformText2=function(){if(this.txBody===null)return;if(!this.txBody.content2)return; this.transformText2=new CMatrix;var _text_transform=this.transformText2;var _shape_transform=this.transform;var _body_pr=this.txBody.getBodyPr();var _content_height=this.txBody.getSummaryHeight2();var _l,_t,_r,_b;var _t_x_lt,_t_y_lt,_t_x_rt,_t_y_rt,_t_x_lb,_t_y_lb,_t_x_rb,_t_y_rb;if(this.spPr&&isRealObject(this.spPr.geometry)&&isRealObject(this.spPr.geometry.rect)){var _rect=this.spPr.geometry.rect;_l=_rect.l+_body_pr.lIns;_t=_rect.t+_body_pr.tIns;_r=_rect.r-_body_pr.rIns;_b=_rect.b-_body_pr.bIns}else{_l= _body_pr.lIns;_t=_body_pr.tIns;_r=this.extX-_body_pr.rIns;_b=this.extY-_body_pr.bIns}if(_l>=_r){var _c=(_l+_r)*.5;_l=_c-.01;_r=_c+.01}if(_t>=_b){_c=(_t+_b)*.5;_t=_c-.01;_b=_c+.01}_t_x_lt=_shape_transform.TransformPointX(_l,_t);_t_y_lt=_shape_transform.TransformPointY(_l,_t);_t_x_rt=_shape_transform.TransformPointX(_r,_t);_t_y_rt=_shape_transform.TransformPointY(_r,_t);_t_x_lb=_shape_transform.TransformPointX(_l,_b);_t_y_lb=_shape_transform.TransformPointY(_l,_b);_t_x_rb=_shape_transform.TransformPointX(_r, _b);_t_y_rb=_shape_transform.TransformPointY(_r,_b);var _dx_t,_dy_t;_dx_t=_t_x_rt-_t_x_lt;_dy_t=_t_y_rt-_t_y_lt;var _dx_lt_rb,_dy_lt_rb;_dx_lt_rb=_t_x_rb-_t_x_lt;_dy_lt_rb=_t_y_rb-_t_y_lt;var _vertical_shift;var _text_rect_height=_b-_t;var _text_rect_width=_r-_l;if(!_body_pr.upright){if(!(_body_pr.vert===AscFormat.nVertTTvert||_body_pr.vert===AscFormat.nVertTTvert270||_body_pr.vert===AscFormat.nVertTTeaVert)){if(true)switch(_body_pr.anchor){case 0:{_vertical_shift=_text_rect_height-_content_height; break}case 1:{_vertical_shift=(_text_rect_height-_content_height)*.5;break}case 2:{_vertical_shift=(_text_rect_height-_content_height)*.5;break}case 3:{_vertical_shift=(_text_rect_height-_content_height)*.5;break}case 4:{_vertical_shift=0;break}}else _vertical_shift=0;global_MatrixTransformer.TranslateAppend(_text_transform,0,_vertical_shift);if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){var alpha=Math.atan2(_dy_t,_dx_t);global_MatrixTransformer.RotateRadAppend(_text_transform,-alpha);global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_lt,_t_y_lt)}else{alpha=Math.atan2(_dy_t,_dx_t);global_MatrixTransformer.RotateRadAppend(_text_transform,Math.PI-alpha);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_rt,_t_y_rt)}}else{if(true)switch(_body_pr.anchor){case 0:{_vertical_shift=_text_rect_width-_content_height;break}case 1:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 2:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 3:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 4:{_vertical_shift= 0;break}}else _vertical_shift=0;global_MatrixTransformer.TranslateAppend(_text_transform,0,_vertical_shift);var _alpha;_alpha=Math.atan2(_dy_t,_dx_t);if(_body_pr.vert===AscFormat.nVertTTvert||_body_pr.vert===AscFormat.nVertTTeaVert)if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){global_MatrixTransformer.RotateRadAppend(_text_transform,-_alpha-Math.PI*.5);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_rt,_t_y_rt)}else{global_MatrixTransformer.RotateRadAppend(_text_transform,Math.PI*.5-_alpha); global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_lt,_t_y_lt)}else if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){global_MatrixTransformer.RotateRadAppend(_text_transform,-_alpha-Math.PI*1.5);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_lb,_t_y_lb)}else{global_MatrixTransformer.RotateRadAppend(_text_transform,-Math.PI*.5-_alpha);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_rb,_t_y_rb)}}if(this.spPr&&isRealObject(this.spPr.geometry)&&isRealObject(this.spPr.geometry.rect)){var rect= this.spPr.geometry.rect;this.clipRect={x:-1,y:rect.t,w:this.extX+2,h:rect.b-rect.t}}else this.clipRect={x:-1,y:0,w:this.extX+2,h:this.extY}}else{var _full_rotate=this.getFullRotate();var _full_flip=this.getFullFlip();var _hc=this.extX*.5;var _vc=this.extY*.5;var _transformed_shape_xc=this.transform.TransformPointX(_hc,_vc);var _transformed_shape_yc=this.transform.TransformPointY(_hc,_vc);var _content_width,content_height2;if(checkNormalRotate(_full_rotate))if(!(_body_pr.vert===AscFormat.nVertTTvert|| _body_pr.vert===AscFormat.nVertTTvert270||_body_pr.vert===AscFormat.nVertTTeaVert)){_content_width=_r-_l;content_height2=_b-_t}else{_content_width=_b-_t;content_height2=_r-_l}else if(!(_body_pr.vert===AscFormat.nVertTTvert||_body_pr.vert===AscFormat.nVertTTvert270||_body_pr.vert===AscFormat.nVertTTeaVert)){_content_width=_b-_t;content_height2=_r-_l}else{_content_width=_r-_l;content_height2=_b-_t}if(true)switch(_body_pr.anchor){case 0:{_vertical_shift=content_height2-_content_height;break}case 1:{_vertical_shift= (content_height2-_content_height)*.5;break}case 2:{_vertical_shift=(content_height2-_content_height)*.5;break}case 3:{_vertical_shift=(content_height2-_content_height)*.5;break}case 4:{_vertical_shift=0;break}}else _vertical_shift=0;var _text_rect_xc=_l+(_r-_l)*.5;var _text_rect_yc=_t+(_b-_t)*.5;var _vx=_text_rect_xc-_hc;var _vy=_text_rect_yc-_vc;var _transformed_text_xc,_transformed_text_yc;if(!_full_flip.flipH)_transformed_text_xc=_transformed_shape_xc+_vx;else _transformed_text_xc=_transformed_shape_xc- _vx;if(!_full_flip.flipV)_transformed_text_yc=_transformed_shape_yc+_vy;else _transformed_text_yc=_transformed_shape_yc-_vy;global_MatrixTransformer.TranslateAppend(_text_transform,0,_vertical_shift);if(_body_pr.vert===AscFormat.nVertTTvert||_body_pr.vert===AscFormat.nVertTTeaVert){global_MatrixTransformer.TranslateAppend(_text_transform,-_content_width*.5,-content_height2*.5);global_MatrixTransformer.RotateRadAppend(_text_transform,-Math.PI*.5);global_MatrixTransformer.TranslateAppend(_text_transform, _content_width*.5,content_height2*.5)}if(_body_pr.vert===AscFormat.nVertTTvert270){global_MatrixTransformer.TranslateAppend(_text_transform,-_content_width*.5,-content_height2*.5);global_MatrixTransformer.RotateRadAppend(_text_transform,-Math.PI*1.5);global_MatrixTransformer.TranslateAppend(_text_transform,_content_width*.5,content_height2*.5)}global_MatrixTransformer.TranslateAppend(_text_transform,_transformed_text_xc-_content_width*.5,_transformed_text_yc-content_height2*.5);var body_pr=this.bodyPr; var l_ins=typeof body_pr.lIns==="number"?body_pr.lIns:2.54;var t_ins=typeof body_pr.tIns==="number"?body_pr.tIns:1.27;var r_ins=typeof body_pr.rIns==="number"?body_pr.rIns:2.54;var b_ins=typeof body_pr.bIns==="number"?body_pr.bIns:1.27;this.clipRect={x:-1,y:-_vertical_shift-t_ins,w:Math.max(this.extX,this.extY)+2,h:this.contentHeight+(b_ins+t_ins)}}this.invertTransformText2=global_MatrixTransformer.Invert(this.transformText2)};CShape.prototype.getTextRect=function(){return this.spPr&&this.spPr.geometry&& this.spPr.geometry.rect?this.spPr.geometry.rect:{l:0,t:0,r:this.extX,b:this.extY}};CShape.prototype.checkTransformTextMatrix=function(oMatrix,oContent,oBodyPr,bWordArtTransform,bIgnoreInsets){oMatrix.Reset();var _shape_transform=this.localTransform;var _content_height=oContent.GetSummaryHeight();var _l,_t,_r,_b;var _t_x_lt,_t_y_lt,_t_x_rt,_t_y_rt,_t_x_lb,_t_y_lb,_t_x_rb,_t_y_rb;var oRect=this.getTextRect();var l_ins=bIgnoreInsets?0:AscFormat.isRealNumber(oBodyPr.lIns)?oBodyPr.lIns:2.54;var t_ins= bIgnoreInsets?0:AscFormat.isRealNumber(oBodyPr.tIns)?oBodyPr.tIns:1.27;var r_ins=bIgnoreInsets?0:AscFormat.isRealNumber(oBodyPr.rIns)?oBodyPr.rIns:2.54;var b_ins=bIgnoreInsets?0:AscFormat.isRealNumber(oBodyPr.bIns)?oBodyPr.bIns:1.27;if(this.bWordShape){var oPen=this.pen;if(oPen){var penW=oPen.w==null?12700:parseInt(oPen.w);penW/=36E3;switch(oPen.algn){case 1:{break}default:{penW/=2;break}}l_ins+=penW;r_ins+=penW;t_ins+=penW;b_ins+=penW}}_l=oRect.l+l_ins;_t=oRect.t+t_ins;_r=oRect.r-r_ins;_b=oRect.b- b_ins;if(_l>=_r){var _c=(_l+_r)*.5;_l=_c-.01;_r=_c+.01}if(_t>=_b){_c=(_t+_b)*.5;_t=_c-.01;_b=_c+.01}var XC=oContent.XLimit/2;var YC=_content_height/2;var _rot_angle=AscFormat.normalizeRotate((AscFormat.isRealNumber(oBodyPr.rot)?oBodyPr.rot:0)*AscFormat.cToRad);if(!AscFormat.fApproxEqual(_rot_angle,0)){global_MatrixTransformer.TranslateAppend(oMatrix,-XC,-YC);global_MatrixTransformer.RotateRadAppend(oMatrix,-_rot_angle);global_MatrixTransformer.TranslateAppend(oMatrix,XC,YC)}_t_x_lt=_shape_transform.TransformPointX(_l, _t);_t_y_lt=_shape_transform.TransformPointY(_l,_t);_t_x_rt=_shape_transform.TransformPointX(_r,_t);_t_y_rt=_shape_transform.TransformPointY(_r,_t);_t_x_lb=_shape_transform.TransformPointX(_l,_b);_t_y_lb=_shape_transform.TransformPointY(_l,_b);_t_x_rb=_shape_transform.TransformPointX(_r,_b);_t_y_rb=_shape_transform.TransformPointY(_r,_b);var _dx_t,_dy_t;_dx_t=_t_x_rt-_t_x_lt;_dy_t=_t_y_rt-_t_y_lt;var _dx_lt_rb,_dy_lt_rb;_dx_lt_rb=_t_x_rb-_t_x_lt;_dy_lt_rb=_t_y_rb-_t_y_lt;var _vertical_shift;var _text_rect_height= _b-_t;var _text_rect_width=_r-_l;var oClipRect;if(!oBodyPr.upright){if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert)){if(bWordArtTransform)_vertical_shift=0;else if(!this.bWordShape&&oBodyPr.vertOverflow===AscFormat.nOTOwerflow||_content_height<_text_rect_height)switch(oBodyPr.anchor){case 0:{_vertical_shift=_text_rect_height-_content_height;break}case 1:{_vertical_shift=(_text_rect_height-_content_height)*.5;break}case 2:{_vertical_shift= (_text_rect_height-_content_height)*.5;break}case 3:{_vertical_shift=(_text_rect_height-_content_height)*.5;break}case 4:{_vertical_shift=0;break}}else if(!this.bWordShape&&oBodyPr.vertOverflow===AscFormat.nOTClip&&oContent.Content[0]&&oContent.Content[0].Lines[0]&&oContent.Content[0].Lines[0].Bottom>_text_rect_height){var _content_first_line=oContent.Content[0].Lines[0].Bottom;switch(oBodyPr.anchor){case 0:{_vertical_shift=_text_rect_height-_content_first_line;break}case 1:{_vertical_shift=(_text_rect_height- _content_first_line)*.5;break}case 2:{_vertical_shift=(_text_rect_height-_content_first_line)*.5;break}case 3:{_vertical_shift=(_text_rect_height-_content_first_line)*.5;break}case 4:{_vertical_shift=0;break}}}else{_vertical_shift=_text_rect_height-_content_height;if(oBodyPr.anchor===0)_vertical_shift=_text_rect_height-_content_height;else _vertical_shift=0}global_MatrixTransformer.TranslateAppend(oMatrix,0,_vertical_shift);if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){var alpha=Math.atan2(_dy_t,_dx_t); global_MatrixTransformer.RotateRadAppend(oMatrix,-alpha);global_MatrixTransformer.TranslateAppend(oMatrix,_t_x_lt,_t_y_lt)}else{alpha=Math.atan2(_dy_t,_dx_t);global_MatrixTransformer.RotateRadAppend(oMatrix,Math.PI-alpha);global_MatrixTransformer.TranslateAppend(oMatrix,_t_x_rt,_t_y_rt)}}else{if(bWordArtTransform)_vertical_shift=0;else if(!this.bWordShape&&oBodyPr.vertOverflow===AscFormat.nOTOwerflow||_content_height<=_text_rect_width)switch(oBodyPr.anchor){case 0:{_vertical_shift=_text_rect_width- _content_height;break}case 1:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 2:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 3:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 4:{_vertical_shift=0;break}}else if(oBodyPr.anchor===0)_vertical_shift=_text_rect_width-_content_height;else _vertical_shift=0;global_MatrixTransformer.TranslateAppend(oMatrix,0,_vertical_shift);var _alpha;_alpha=Math.atan2(_dy_t,_dx_t);if(oBodyPr.vert===AscFormat.nVertTTvert|| oBodyPr.vert===AscFormat.nVertTTeaVert)if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){global_MatrixTransformer.RotateRadAppend(oMatrix,-_alpha-Math.PI*.5);global_MatrixTransformer.TranslateAppend(oMatrix,_t_x_rt,_t_y_rt)}else{global_MatrixTransformer.RotateRadAppend(oMatrix,Math.PI*.5-_alpha);global_MatrixTransformer.TranslateAppend(oMatrix,_t_x_lt,_t_y_lt)}else if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){global_MatrixTransformer.RotateRadAppend(oMatrix,-_alpha-Math.PI*1.5);global_MatrixTransformer.TranslateAppend(oMatrix, _t_x_lb,_t_y_lb)}else{global_MatrixTransformer.RotateRadAppend(oMatrix,-Math.PI*.5-_alpha);global_MatrixTransformer.TranslateAppend(oMatrix,_t_x_rb,_t_y_rb)}}if(this.spPr&&isRealObject(this.spPr.geometry)&&isRealObject(this.spPr.geometry.rect)){var rect=this.spPr.geometry.rect;var Diff=1.6;var clipW=rect.r-rect.l+Diff;if(clipW<=0)clipW=.01;var clipH=rect.b-rect.t+Diff-b_ins-t_ins;if(clipH<0)clipH=.01;oClipRect={x:rect.l-Diff,y:rect.t-Diff+t_ins,w:clipW,h:clipH}}else oClipRect={x:-1.6,y:t_ins,w:this.extX+ 3.2,h:this.extY-b_ins}}else{var _full_rotate=this.getFullRotate();var _full_flip=this.getFullFlip();var _hc=this.extX*.5;var _vc=this.extY*.5;var _transformed_shape_xc=this.localTransform.TransformPointX(_hc,_vc);var _transformed_shape_yc=this.localTransform.TransformPointY(_hc,_vc);var _content_width,content_height2;if(checkNormalRotate(_full_rotate))if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert)){_content_width=_r-_l;content_height2= _b-_t}else{_content_width=_b-_t;content_height2=_r-_l}else if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert)){_content_width=_b-_t;content_height2=_r-_l}else{_content_width=_r-_l;content_height2=_b-_t}if(bWordArtTransform)_vertical_shift=0;else if(!(this.bWordShape||this.worksheet)||_content_height<content_height2)switch(oBodyPr.anchor){case 0:{_vertical_shift=content_height2-_content_height;break}case 1:{_vertical_shift=(content_height2- _content_height)*.5;break}case 2:{_vertical_shift=(content_height2-_content_height)*.5;break}case 3:{_vertical_shift=(content_height2-_content_height)*.5;break}case 4:{_vertical_shift=0;break}}else if(oBodyPr.anchor===0)_vertical_shift=content_height2-_content_height;else _vertical_shift=0;var _text_rect_xc=_l+(_r-_l)*.5;var _text_rect_yc=_t+(_b-_t)*.5;var _vx=_text_rect_xc-_hc;var _vy=_text_rect_yc-_vc;var _transformed_text_xc,_transformed_text_yc;if(!_full_flip.flipH)_transformed_text_xc=_transformed_shape_xc+ _vx;else _transformed_text_xc=_transformed_shape_xc-_vx;if(!_full_flip.flipV)_transformed_text_yc=_transformed_shape_yc+_vy;else _transformed_text_yc=_transformed_shape_yc-_vy;global_MatrixTransformer.TranslateAppend(oMatrix,0,_vertical_shift);if(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTeaVert){global_MatrixTransformer.TranslateAppend(oMatrix,-_content_width*.5,-content_height2*.5);global_MatrixTransformer.RotateRadAppend(oMatrix,-Math.PI*.5);global_MatrixTransformer.TranslateAppend(oMatrix, _content_width*.5,content_height2*.5)}if(oBodyPr.vert===AscFormat.nVertTTvert270){global_MatrixTransformer.TranslateAppend(oMatrix,-_content_width*.5,-content_height2*.5);global_MatrixTransformer.RotateRadAppend(oMatrix,-Math.PI*1.5);global_MatrixTransformer.TranslateAppend(oMatrix,_content_width*.5,content_height2*.5)}global_MatrixTransformer.TranslateAppend(oMatrix,_transformed_text_xc-_content_width*.5,_transformed_text_yc-content_height2*.5);var Diff=1.6;if(this.bWordShape){var DiffLeft=.8;var DiffRight= 1.6;var aContent=oContent.Content;for(var i=0;i<aContent.length;++i)if(aContent[i].GetType&&type_Paragraph===aContent[i].GetType()){var oCompiledParaPr=aContent[i].CompiledPr&&aContent[i].CompiledPr.Pr&&aContent[i].CompiledPr.Pr.ParaPr;if(oCompiledParaPr){var oBorders=oCompiledParaPr.Brd;if(oBorders){if(oBorders.Left&&AscFormat.isRealNumber(oBorders.Left.Space)&&AscFormat.isRealNumber(oBorders.Left.Size)&&oBorders.Left.Size>0){var DiffLeft2=oBorders.Left.Space+oBorders.Left.Size+1;if(DiffLeft2>DiffLeft)DiffLeft= DiffLeft2}if(oBorders.Right&&AscFormat.isRealNumber(oBorders.Right.Space)&&AscFormat.isRealNumber(oBorders.Right.Size)&&oBorders.Right.Size>0){var DiffRight2=oBorders.Right.Space+oBorders.Right.Size+1;if(oCompiledParaPr.Ind&&AscFormat.isRealNumber(oCompiledParaPr.Ind.Right))DiffRight2-=oCompiledParaPr.Ind.Right;if(DiffRight2>DiffRight)DiffRight=DiffRight2}}}}var clipW=oRect.r-oRect.l+DiffLeft+DiffRight-l_ins-r_ins;if(clipW<=0)clipW=.01;var clipH=oRect.b-oRect.t+Diff-b_ins-t_ins;if(clipH<0)clipH=.01; oClipRect={x:oRect.l+l_ins-DiffLeft,y:oRect.t-Diff+t_ins,w:clipW,h:clipH}}else{var clipW=oRect.r-oRect.l+Diff-l_ins-r_ins;if(clipW<=0)clipW=.01;var clipH=oRect.b-oRect.t+Diff-b_ins-t_ins;if(clipH<0)clipH=.01;oClipRect={x:oRect.l+l_ins-Diff,y:oRect.t-Diff+t_ins,w:clipW,h:clipH}}}return oClipRect};CShape.prototype.setWordShape=function(pr){History.Add(new AscDFH.CChangesDrawingsBool(this,AscDFH.historyitem_ShapeSetWordShape,this.bWordShape,pr));this.bWordShape=pr};CShape.prototype.selectionCheck=function(X, Y,PageAbs,NearPos){var content=this.getDocContent();if(content){if(undefined!==NearPos)return content.CheckPosInSelection(X,Y,0,NearPos);if(isRealObject(content)&&this.hitInTextRect(X,Y)&&this.invertTransformText){var t_x=this.invertTransformText.TransformPointX(X,Y);var t_y=this.invertTransformText.TransformPointY(X,Y);return content.CheckPosInSelection(t_x,t_y,0,NearPos)}}return false};CShape.prototype.fillObject=function(copy,oPr){if(this.nvSpPr)copy.setNvSpPr(this.nvSpPr.createDuplicate());if(this.spPr){copy.setSpPr(this.spPr.createDuplicate()); copy.spPr.setParent(copy)}if(this.style)copy.setStyle(this.style.createDuplicate());if(this.txBody){copy.setTxBody(this.txBody.createDuplicate());copy.txBody.setParent(copy)}if(this.bodyPr)copy.setBodyPr(this.bodyPr.createDuplicate());if(this.textBoxContent)copy.setTextBoxContent(this.textBoxContent.Copy(copy,oPr&&oPr.drawingDocument,oPr&&oPr.contentCopyPr));if(this.signatureLine&©.setSignature)copy.setSignature(this.signatureLine.copy());copy.setWordShape(this.bWordShape);copy.setBDeleted(this.bDeleted); copy.setLocks(this.locks);copy.cachedImage=this.getBase64Img();copy.cachedPixH=this.cachedPixH;copy.cachedPixW=this.cachedPixW};CShape.prototype.copy=function(oPr){var copy=new CShape;this.fillObject(copy,oPr);return copy};CShape.prototype.Get_Styles=function(level){var _level=AscFormat.isRealNumber(level)?level:0;if(this.recalcInfo.recalculateTextStyles[_level]){this.recalculateTextStyles(_level);this.recalcInfo.recalculateTextStyles[_level]=false}this.recalcInfo.recalculateTextStyles[_level]=true; var ret=this.compiledStyles[_level];this.compiledStyles[_level]=undefined;return ret};CShape.prototype.recalculateTextStyles=function(level){return AscFormat.ExecuteNoHistory(function(){var parent_objects=this.getParentObjects();var default_style=new CStyle("defaultStyle",null,null,null,true);default_style.ParaPr.Spacing.LineRule=Asc.linerule_Auto;default_style.ParaPr.Spacing.Line=1;default_style.ParaPr.Spacing.Before=0;default_style.ParaPr.Spacing.After=0;default_style.ParaPr.DefaultTab=25.4;default_style.ParaPr.Align= AscCommon.align_Center;if(parent_objects.theme){default_style.TextPr.RFonts.Ascii={Name:"+mn-lt",Index:-1};default_style.TextPr.RFonts.EastAsia={Name:"+mn-ea",Index:-1};default_style.TextPr.RFonts.CS={Name:"+mn-cs",Index:-1};default_style.TextPr.RFonts.HAnsi={Name:"+mn-lt",Index:-1}}if(!this.bCheckAutoFitFlag){var oBodyPr=this.getBodyPr&&this.getBodyPr();if(oBodyPr){default_style.ParaPr.LnSpcReduction=oBodyPr.getLnSpcReduction();default_style.TextPr.FontScale=oBodyPr.getFontScale()}}else{if(this.tmpLnSpcReduction!== null&&this.tmpLnSpcReduction!==undefined)default_style.ParaPr.LnSpcReduction=this.tmpLnSpcReduction/1E5;if(this.tmpFontScale!==null&&this.tmpFontScale!==undefined)default_style.TextPr.FontScale=this.tmpFontScale/1E5}if(this.getObjectType&&this.getObjectType()===AscDFH.historyitem_type_GraphicFrame)default_style.TextPr.FontSize=18;if(isRealObject(parent_objects.presentation)&&isRealObject(parent_objects.presentation.defaultTextStyle)){if(isRealObject(parent_objects.presentation.defaultTextStyle.levels[9])){var default_ppt_style= parent_objects.presentation.defaultTextStyle.levels[9];default_style.ParaPr.Merge(default_ppt_style.Copy());default_ppt_style.DefaultRunPr&&default_style.TextPr.Merge(default_ppt_style.DefaultRunPr.Copy())}if(!isRealObject(parent_objects.master)||!isRealObject(parent_objects.master.txStyles)||!this.isPlaceholder())if(isRealObject(parent_objects.presentation.defaultTextStyle.levels[level])){var default_ppt_style=parent_objects.presentation.defaultTextStyle.levels[level];default_style.ParaPr.Merge(default_ppt_style.Copy()); default_ppt_style.DefaultRunPr&&default_style.TextPr.Merge(default_ppt_style.DefaultRunPr.Copy())}}var master_style;if(isRealObject(parent_objects.master)&&isRealObject(parent_objects.master.txStyles)){var master_ppt_styles;master_style=new CStyle("masterStyle",null,null,null,true);if(parent_objects.master.kind===AscFormat.TYPE_KIND.NOTES_MASTER)master_ppt_styles=parent_objects.master.txStyles;else if(this.isPlaceholder()&&!(this instanceof AscFormat.CGraphicFrame))master_ppt_styles=parent_objects.master.txStyles.getStyleByPhType(this.getPlaceholderType()); else master_ppt_styles=parent_objects.master.txStyles.otherStyle;if(isRealObject(master_ppt_styles)&&isRealObject(master_ppt_styles.levels)&&isRealObject(master_ppt_styles.levels[level])){var master_ppt_style=master_ppt_styles.levels[level];master_style.ParaPr=master_ppt_style.Copy();if(master_ppt_style.DefaultRunPr)master_style.TextPr=master_ppt_style.DefaultRunPr.Copy()}}var hierarchy=this.getHierarchy(false);var hierarchy_styles=[];for(var i=0;i<hierarchy.length;++i){var hierarchy_shape=hierarchy[i]; if(isRealObject(hierarchy_shape)&&isRealObject(hierarchy_shape.txBody)&&isRealObject(hierarchy_shape.txBody.lstStyle)&&isRealObject(hierarchy_shape.txBody.lstStyle.levels)&&isRealObject(hierarchy_shape.txBody.lstStyle.levels[level])){var hierarchy_ppt_style=hierarchy_shape.txBody.lstStyle.levels[level];var hierarchy_style=new CStyle("hierarchyStyle"+i,null,null,null,true);hierarchy_style.ParaPr=hierarchy_ppt_style.Copy();if(hierarchy_ppt_style.DefaultRunPr)hierarchy_style.TextPr=hierarchy_ppt_style.DefaultRunPr.Copy(); hierarchy_styles.push(hierarchy_style)}}var ownStyle;if(isRealObject(this.txBody)&&isRealObject(this.txBody.lstStyle)&&isRealObject(this.txBody.lstStyle.levels[level])){ownStyle=new CStyle("ownStyle",null,null,null,true);var own_ppt_style=this.txBody.lstStyle.levels[level];ownStyle.ParaPr=own_ppt_style.Copy();if(own_ppt_style.DefaultRunPr)ownStyle.TextPr=own_ppt_style.DefaultRunPr.Copy();hierarchy_styles.splice(0,0,ownStyle)}var shape_text_style;var compiled_style=this.getCompiledStyle&&this.getCompiledStyle(); if(isRealObject(compiled_style)&&isRealObject(compiled_style.fontRef)){shape_text_style=new CStyle("shapeTextStyle",null,null,null,true);var first_name;if(compiled_style.fontRef.idx===AscFormat.fntStyleInd_major)first_name="+mj-";else first_name="+mn-";shape_text_style.TextPr.RFonts.Ascii={Name:first_name+"lt",Index:-1};shape_text_style.TextPr.RFonts.EastAsia={Name:first_name+"ea",Index:-1};shape_text_style.TextPr.RFonts.CS={Name:first_name+"cs",Index:-1};shape_text_style.TextPr.RFonts.HAnsi={Name:first_name+ "lt",Index:-1};if(compiled_style.fontRef.Color!=null&&compiled_style.fontRef.Color.color!=null){var unifill=new AscFormat.CUniFill;unifill.fill=new AscFormat.CSolidFill;unifill.fill.color=compiled_style.fontRef.Color;shape_text_style.TextPr.Unifill=unifill}}var Styles=new CStyles(false);var last_style_id;var b_checked=false;var isPlaceholder=this.isPlaceholder();if(isPlaceholder||this.graphicObject instanceof CTable){if(default_style){b_checked=true;Styles.Add(default_style);default_style.BasedOn= null;last_style_id=default_style.Id}if(master_style){Styles.Add(master_style);master_style.BasedOn=last_style_id;last_style_id=master_style.Id}}else{if(master_style){b_checked=true;Styles.Add(master_style);master_style.BasedOn=null;last_style_id=master_style.Id}if(default_style){Styles.Add(default_style);default_style.BasedOn=last_style_id;last_style_id=default_style.Id}}for(var i=hierarchy_styles.length-1;i>-1;--i)if(hierarchy_styles[i]){Styles.Add(hierarchy_styles[i]);hierarchy_styles[i].BasedOn= last_style_id;last_style_id=hierarchy_styles[i].Id}if(shape_text_style){Styles.Add(shape_text_style);shape_text_style.BasedOn=last_style_id;last_style_id=shape_text_style.Id}this.compiledStyles[level]={styles:Styles,lastId:last_style_id,shape:this,slide:parent_objects.slide,layout:parent_objects.layout,master:parent_objects.master,presentation:parent_objects.presentation,notes:parent_objects.notes};return this.compiledStyles[level]},this,[])};CShape.prototype.recalculateBrush=function(){var compiled_style= this.getCompiledStyle();var RGBA={R:0,G:0,B:0,A:255};var parents=this.getParentObjects();var oStyleBrush=null;var oLin;if(isRealObject(parents.theme)&&isRealObject(compiled_style)&&isRealObject(compiled_style.fillRef)){this.brush=parents.theme.getFillStyle(compiled_style.fillRef.idx,compiled_style.fillRef.Color);if(this.brush)oStyleBrush=this.brush.createDuplicate()}else this.brush=new AscFormat.CUniFill;this.brush.merge(this.getCompiledFill());this.brush.transparent=this.getCompiledTransparent(); this.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA);if(this.brush.fill&&this.brush.fill.type===Asc.c_oAscFill.FILL_TYPE_GRAD){var oGradFill=this.brush.fill;if(!oGradFill.lin&&!oGradFill.path){if(oStyleBrush&&oStyleBrush.fill&&oStyleBrush.fill.type===Asc.c_oAscFill.FILL_TYPE_GRAD&&oStyleBrush.fill.lin)oLin=oStyleBrush.fill.lin.createDuplicate();else{oLin=new AscFormat.GradLin;oLin.setScale(false);oLin.setAngle(0);oGradFill.setLin(oLin)}oGradFill.setLin(oLin)}}};CShape.prototype.recalculatePen= function(){var compiled_style=this.getCompiledStyle();var RGBA={R:0,G:0,B:0,A:255};var parents=this.getParentObjects();if(isRealObject(parents.theme)&&isRealObject(compiled_style)&&isRealObject(compiled_style.lnRef))this.pen=parents.theme.getLnStyle(compiled_style.lnRef.idx,compiled_style.lnRef.Color);else this.pen=null;var oCompiledLine=this.getCompiledLine();if(oCompiledLine){if(!this.pen)this.pen=new AscFormat.CLn;this.pen.merge(oCompiledLine)}if(this.pen)this.pen.calculate(parents.theme,parents.slide, parents.layout,parents.master,RGBA)};CShape.prototype.Get_ParentTextTransform=function(){return this.transformText.CreateDublicate()};CShape.prototype.isEmptyPlaceholder=function(){if(this.isPlaceholder()){if(this.nvSpPr.nvPr.ph.type==AscFormat.phType_title||this.nvSpPr.nvPr.ph.type==AscFormat.phType_ctrTitle||this.nvSpPr.nvPr.ph.type==AscFormat.phType_body||this.nvSpPr.nvPr.ph.type==AscFormat.phType_subTitle||this.nvSpPr.nvPr.ph.type==null||this.nvSpPr.nvPr.ph.type==AscFormat.phType_dt||this.nvSpPr.nvPr.ph.type== AscFormat.phType_ftr||this.nvSpPr.nvPr.ph.type==AscFormat.phType_hdr||this.nvSpPr.nvPr.ph.type==AscFormat.phType_sldNum||this.nvSpPr.nvPr.ph.type==AscFormat.phType_sldImg){if(this.txBody){if(this.txBody.content)return this.txBody.content.Is_Empty();return true}return true}if(this.nvSpPr.nvPr.ph.type==AscFormat.phType_chart||this.nvSpPr.nvPr.ph.type==AscFormat.phType_media)return true;if(this.nvSpPr.nvPr.ph.type==AscFormat.phType_pic){var _b_empty_text=true;if(this.txBody)if(this.txBody.content)_b_empty_text= this.txBody.content.Is_Empty();return _b_empty_text}}else return false};CShape.prototype.changeSize=function(kw,kh){if(this.spPr&&this.spPr.xfrm&&this.spPr.xfrm.isNotNull()){var xfrm=this.spPr.xfrm;{xfrm.setOffX(xfrm.offX*kw);xfrm.setOffY(xfrm.offY*kh);xfrm.setExtX(xfrm.extX*kw);xfrm.setExtY(xfrm.extY*kh)}}this.recalcTransform&&this.recalcTransform()};CShape.prototype.recalculateTransform=function(){this.cachedImage=null;this.recalculateLocalTransform(this.transform);this.invertTransform=global_MatrixTransformer.Invert(this.transform); this.localTransform=this.transform.CreateDublicate()};CShape.prototype.checkAutofit=function(bIgnoreWordShape){if(this.bWordShape||bIgnoreWordShape||this.bCheckAutoFitFlag){var content=this.getDocContent();if(content){var oBodyPr=this.getBodyPr();if(oBodyPr.textFit&&oBodyPr.textFit.type===AscFormat.text_fit_Auto||oBodyPr.wrap===AscFormat.nTWTNone)return true}}return false};CShape.prototype.Check_AutoFit=function(){return this.checkAutofit(true)||this.checkContentWordArt(this.getDocContent())||this.getBodyPr().prstTxWarp!= null};CShape.prototype.recalculateLocalTransform=function(transform){AscFormat.ExecuteNoHistory(function(){var bNotesShape=false;if(!isRealObject(this.group)){var bUserShape=false;if(this.parent instanceof AscFormat.CRelSizeAnchor||this.parent instanceof AscFormat.CAbsSizeAnchor)if(this.parent.parent instanceof AscFormat.CChartSpace){this.x=this.parent.parent.extX*this.parent.fromX;this.y=this.parent.parent.extY*this.parent.fromY;if(this.parent instanceof AscFormat.CRelSizeAnchor){this.extX=Math.max(0, this.parent.parent.extX*this.parent.toX-this.x);this.extY=Math.max(0,this.parent.parent.extY*this.parent.toY-this.y)}else{this.extX=Math.max(0,this.parent.toX);this.extY=Math.max(0,this.parent.toY)}var rot=0;if(this.spPr&&this.spPr.xfrm){if(AscFormat.isRealNumber(this.spPr.xfrm.rot))rot=AscFormat.normalizeRotate(this.spPr.xfrm.rot);this.flipH=this.spPr.xfrm.flipH===true;this.flipV=this.spPr.xfrm.flipV===true}this.rot=rot;bUserShape=true}if(bUserShape);else if(this.drawingBase&&!this.isCrop){var metrics= this.drawingBase.getGraphicObjectMetrics();this.x=metrics.x;this.y=metrics.y;var rot=0;if(this.spPr&&this.spPr.xfrm){if(AscFormat.isRealNumber(this.spPr.xfrm.rot))rot=AscFormat.normalizeRotate(this.spPr.xfrm.rot);this.flipH=this.spPr.xfrm.flipH===true;this.flipV=this.spPr.xfrm.flipV===true}this.rot=rot;var metricExtX,metricExtY;{metricExtX=metrics.extX;metricExtY=metrics.extY;if(checkNormalRotate(rot)){this.extX=metrics.extX;this.extY=metrics.extY}else{this.extX=metrics.extY;this.extY=metrics.extX}}if(checkNormalRotate(rot)){this.x= metrics.x;this.y=metrics.y}else{this.x=metrics.x+metricExtX/2-metricExtY/2;this.y=metrics.y+metricExtY/2-metricExtX/2}}else if(typeof AscCommonSlide!=="undefined"&&AscCommonSlide&&AscCommonSlide.CNotes&&this.parent&&this.parent instanceof AscCommonSlide.CNotes){bNotesShape=true;this.x=0;this.y=editor.WordControl.m_oLogicDocument.Height;this.extX=this.parent.getWidth();this.extY=2E3;this.rot=0;this.flipH=false;this.flipV=false}else if(this.spPr&&this.spPr.xfrm&&this.spPr.xfrm.isNotNull()){var xfrm= this.spPr.xfrm;var bAlign=false;if(this.parent)if(this.parent.PositionH&&this.parent.PositionH.Align||this.parent.PositionV&&this.parent.PositionV.Align)bAlign=true;if(bAlign){this.x=0;this.y=0}else{this.x=xfrm.offX;this.y=xfrm.offY}this.extX=xfrm.extX;this.extY=xfrm.extY;this.rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;this.flipH=xfrm.flipH===true;this.flipV=xfrm.flipV===true;if(this.extX<.01&&this.extY<.01){if(this.parent&&this.parent.Extent&&AscFormat.isRealNumber(this.parent.Extent.W)&&AscFormat.isRealNumber(this.parent.Extent.H)){this.extX= this.parent.Extent.W;this.extY=this.parent.Extent.H}}else{var oParaDrawing=getParaDrawing(this);if(oParaDrawing){if(oParaDrawing.Extent&&AscFormat.isRealNumber(oParaDrawing.Extent.W)&&AscFormat.isRealNumber(oParaDrawing.Extent.H)){this.extX=oParaDrawing.Extent.W;this.extY=oParaDrawing.Extent.H}if(oParaDrawing.SizeRelH||oParaDrawing.SizeRelV){this.m_oSectPr=null;var oParentParagraph=oParaDrawing.Get_ParentParagraph();if(oParentParagraph){var oSectPr=oParentParagraph.Get_SectPr();if(oSectPr){if(oParaDrawing.SizeRelH&& oParaDrawing.SizeRelH.Percent>0){switch(oParaDrawing.SizeRelH.RelativeFrom){case c_oAscSizeRelFromH.sizerelfromhMargin:{this.extX=oSectPr.GetContentFrameWidth();break}case c_oAscSizeRelFromH.sizerelfromhPage:{this.extX=oSectPr.GetPageWidth();break}case c_oAscSizeRelFromH.sizerelfromhLeftMargin:{this.extX=oSectPr.GetPageMarginLeft();break}case c_oAscSizeRelFromH.sizerelfromhRightMargin:{this.extX=oSectPr.GetPageMarginRight();break}default:{this.extX=oSectPr.GetPageMarginLeft();break}}this.extX*=oParaDrawing.SizeRelH.Percent}if(oParaDrawing.SizeRelV&& oParaDrawing.SizeRelV.Percent>0){switch(oParaDrawing.SizeRelV.RelativeFrom){case c_oAscSizeRelFromV.sizerelfromvMargin:{this.extY=oSectPr.GetContentFrameHeight();break}case c_oAscSizeRelFromV.sizerelfromvPage:{this.extY=oSectPr.GetPageHeight();break}case c_oAscSizeRelFromV.sizerelfromvTopMargin:{this.extY=oSectPr.GetPageMarginTop();break}case c_oAscSizeRelFromV.sizerelfromvBottomMargin:{this.extY=oSectPr.GetPageMarginBottom();break}default:{this.extY=oSectPr.GetPageMarginTop();break}}this.extY*=oParaDrawing.SizeRelV.Percent}this.m_oSectPr= new CSectionPr;this.m_oSectPr.Copy(oSectPr)}}}}}}else if(this.isPlaceholder()){var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i){var hierarchy_sp=hierarchy[i];if(isRealObject(hierarchy_sp)&&hierarchy_sp.spPr.xfrm&&hierarchy_sp.spPr.xfrm.isNotNull()){var xfrm=hierarchy_sp.spPr.xfrm;this.x=xfrm.offX;this.y=xfrm.offY;this.extX=xfrm.extX;this.extY=xfrm.extY;this.rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;this.flipH=xfrm.flipH===true;this.flipV=xfrm.flipV===true;break}}if(i=== hierarchy.length){this.x=0;this.y=0;this.extX=5;this.extY=5;this.rot=0;this.flipH=false;this.flipV=false}}else{var extX,extY;if(this.parent&&this.parent.Extent){this.x=0;this.y=0;extX=this.parent.Extent.W;extY=this.parent.Extent.H}else{this.x=0;this.y=0;extX=5;extY=5}this.extX=extX;this.extY=extY;this.rot=0;this.flipH=false;this.flipV=false}}else{var xfrm;if(this.spPr&&this.spPr.xfrm&&this.spPr.xfrm.isNotNull())xfrm=this.spPr.xfrm;else if(this.isPlaceholder()){var hierarchy=this.getHierarchy();for(var i= 0;i<hierarchy.length;++i){var hierarchy_sp=hierarchy[i];if(isRealObject(hierarchy_sp)&&hierarchy_sp.spPr.xfrm.isNotNull()){xfrm=hierarchy_sp.spPr.xfrm;break}}if(i===hierarchy.length){xfrm=new AscFormat.CXfrm;xfrm.offX=0;xfrm.offX=0;xfrm.extX=5;xfrm.extY=5}}else{xfrm=new AscFormat.CXfrm;xfrm.offX=0;xfrm.offY=0;xfrm.extX=5;xfrm.extY=5}var scale_scale_coefficients=this.group.getResultScaleCoefficients();this.x=scale_scale_coefficients.cx*(xfrm.offX-this.group.spPr.xfrm.chOffX);this.y=scale_scale_coefficients.cy* (xfrm.offY-this.group.spPr.xfrm.chOffY);this.extX=scale_scale_coefficients.cx*xfrm.extX;this.extY=scale_scale_coefficients.cy*xfrm.extY;this.rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;this.flipH=xfrm.flipH===true;this.flipV=xfrm.flipV===true}if(this.checkAutofit&&this.checkAutofit()&&(!this.bWordShape||!this.group||this.bCheckAutoFitFlag)&&!bNotesShape){var oBodyPr=this.getBodyPr();if(this.bWordShape){if(this.recalcInfo.recalculateTxBoxContent){this.recalcInfo.oContentMetrics=this.recalculateTxBoxContent(); this.recalcInfo.AllDrawings=[];var oContent=this.getDocContent();if(oContent)oContent.GetAllDrawingObjects(this.recalcInfo.AllDrawings)}}else if(this.recalcInfo.recalculateContent){this.recalcInfo.oContentMetrics=this.recalculateContent();this.recalcInfo.recalculateContent=false}var oContentMetrics=this.recalcInfo.oContentMetrics;var l_ins,t_ins,r_ins,b_ins;if(oBodyPr){l_ins=AscFormat.isRealNumber(oBodyPr.lIns)?oBodyPr.lIns:2.54;r_ins=AscFormat.isRealNumber(oBodyPr.rIns)?oBodyPr.rIns:2.54;t_ins=AscFormat.isRealNumber(oBodyPr.tIns)? oBodyPr.tIns:1.27;b_ins=AscFormat.isRealNumber(oBodyPr.bIns)?oBodyPr.bIns:1.27}else{l_ins=2.54;r_ins=2.54;t_ins=1.27;b_ins=1.27}var oGeometry=this.spPr&&this.spPr.geometry,oWH;var dOldExtX=this.extX,dOldExtY=this.extY,dDeltaX=0,dDeltaY=0;var bAutoFit=AscCommon.isRealObject(oBodyPr.textFit)&&oBodyPr.textFit.type===AscFormat.text_fit_Auto;if(oBodyPr.wrap===AscFormat.nTWTNone)if(!oBodyPr.upright)if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert))if(oGeometry){oWH= oGeometry.getNewWHByTextRect(oContentMetrics.w+l_ins+r_ins,oContentMetrics.contentH+t_ins+b_ins,undefined,bAutoFit?undefined:this.extY);if(!oWH.bError){this.extX=oWH.W;this.extY=oWH.H}}else{this.extX=oContentMetrics.w+l_ins+r_ins;this.extY=bAutoFit?oContentMetrics.contentH+t_ins+b_ins:this.extY}else if(oGeometry){oWH=oGeometry.getNewWHByTextRect(oContentMetrics.contentH+l_ins+r_ins,oContentMetrics.w+t_ins+b_ins,bAutoFit?undefined:this.extX);if(!oWH.bError){this.extX=oWH.W;this.extY=oWH.H}}else{this.extY= oContentMetrics.w+t_ins+b_ins;this.extX=bAutoFit?oContentMetrics.contentH+l_ins+r_ins:this.extX}else{var _full_rotate=this.getFullRotate();if(checkNormalRotate(_full_rotate))if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert))if(oGeometry){oWH=oGeometry.getNewWHByTextRect(oContentMetrics.w+l_ins+r_ins,oContentMetrics.contentH+t_ins+b_ins,undefined,bAutoFit?undefined:this.extY);if(!oWH.bError){this.extX=oWH.W;this.extY=oWH.H}}else{this.extX= oContentMetrics.w+l_ins+r_ins;this.extY=bAutoFit?oContentMetrics.contentH+t_ins+b_ins:this.extY}else if(oGeometry){oWH=oGeometry.getNewWHByTextRect(oContentMetrics.contentH+l_ins+r_ins,oContentMetrics.w+t_ins+b_ins,bAutoFit?undefined:this.extX);if(!oWH.bError){this.extX=oWH.W;this.extY=oWH.H}}else{this.extY=oContentMetrics.w+t_ins+b_ins;this.extX=bAutoFit?oContentMetrics.contentH+l_ins+r_ins:this.extX}else if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert=== AscFormat.nVertTTeaVert))if(oGeometry){oWH=oGeometry.getNewWHByTextRect(oContentMetrics.w+l_ins+r_ins,oContentMetrics.contentH+t_ins+b_ins,undefined,bAutoFit?undefined:this.extY);if(!oWH.bError){this.extX=oWH.W;this.extY=oWH.H}}else{this.extX=oContentMetrics.w+l_ins+r_ins;this.extY=bAutoFit?oContentMetrics.contentH+t_ins+b_ins:this.extY}else if(oGeometry){oWH=oGeometry.getNewWHByTextRect(oContentMetrics.contentH+l_ins+r_ins,oContentMetrics.w+t_ins+b_ins,bAutoFit?undefined:this.extX);if(!oWH.bError){this.extX= oWH.W;this.extY=oWH.H}}else{this.extY=oContentMetrics.w+t_ins+b_ins;this.extX=bAutoFit?oContentMetrics.contentH+l_ins+r_ins:this.extX}}else if(!oBodyPr.upright)if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert))if(oGeometry){oWH=oGeometry.getNewWHByTextRect(undefined,oContentMetrics.contentH+t_ins+b_ins,this.extX,undefined);if(!oWH.bError)this.extY=oWH.H}else this.extY=oContentMetrics.contentH+t_ins+b_ins;else if(oGeometry){oWH= oGeometry.getNewWHByTextRect(oContentMetrics.contentH+l_ins+b_ins,undefined,undefined,this.extY);if(!oWH.bError)this.extX=oWH.W}else this.extX=oContentMetrics.contentH+l_ins+r_ins;else{var _full_rotate=this.getFullRotate();if(checkNormalRotate(_full_rotate))if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert))if(oGeometry){oWH=oGeometry.getNewWHByTextRect(undefined,oContentMetrics.contentH+t_ins+b_ins,this.extX,undefined);if(!oWH.bError)this.extY= oWH.H}else this.extY=oContentMetrics.contentH+t_ins+b_ins;else if(oGeometry){oWH=oGeometry.getNewWHByTextRect(oContentMetrics.contentH+l_ins+r_ins,undefined,undefined,this.extY);if(!oWH.bError)this.extX=oWH.W}else this.extX=oContentMetrics.contentH+l_ins+r_ins;else if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert))if(oGeometry){oWH=oGeometry.getNewWHByTextRect(oContentMetrics.contentH+l_ins+r_ins,undefined,undefined,this.extY); if(!oWH.bError)this.extX=oWH.W}else this.extX=oContentMetrics.contentH+l_ins+r_ins;else if(oGeometry){oWH=oGeometry.getNewWHByTextRect(undefined,oContentMetrics.contentH+t_ins+b_ins,this.extX,undefined);if(!oWH.bError)this.extY=oWH.H}else this.extY=oContentMetrics.contentH+t_ins+b_ins}if(!this.bWordShape||this.group){var dSin=Math.sin(this.rot),dCos=Math.cos(this.rot);var oContent=this.getDocContent();var nJc,nAnchor;if(AscFormat.isRealNumber(this.rot)&&!AscFormat.fApproxEqual(this.rot,0)){nJc=AscCommon.align_Center; nAnchor=1}else{nJc=oContent.Content[0].CompiledPr.Pr.ParaPr.Jc;nAnchor=oBodyPr.anchor}var FreezePointX,FreezePointY;switch(nJc){case AscCommon.align_Right:{dDeltaX=dOldExtX-this.extX;FreezePointX=oContent.XLimit;break}case AscCommon.align_Left:{dDeltaX=0;FreezePointX=0;break}default:{dDeltaX=(dOldExtX-this.extX)/2;FreezePointX=oContent.XLimit/2;break}}switch(nAnchor){case 0:{dDeltaY=dOldExtY-this.extY;FreezePointY=oContent.GetSummaryHeight();break}case 1:case 2:case 3:{dDeltaY=(dOldExtY-this.extY)/ 2;FreezePointY=oContent.GetSummaryHeight()/2;break}default:{FreezePointY=0;break}}var dTrDeltaX,dTrDeltaY;{dTrDeltaX=dDeltaX;dTrDeltaY=dDeltaY}this.x+=dTrDeltaX;this.y+=dTrDeltaY}}this.localX=this.x;this.localY=this.y;transform.Reset();var hc=this.extX*.5;var vc=this.extY*.5;global_MatrixTransformer.TranslateAppend(transform,-hc,-vc);if(this.flipH)global_MatrixTransformer.ScaleAppend(transform,-1,1);if(this.flipV)global_MatrixTransformer.ScaleAppend(transform,1,-1);global_MatrixTransformer.RotateRadAppend(transform, -this.rot);global_MatrixTransformer.TranslateAppend(transform,this.x+hc,this.y+vc);if(isRealObject(this.group))global_MatrixTransformer.MultiplyAppend(transform,this.group.getLocalTransform());if(this.parent instanceof AscFormat.CRelSizeAnchor||this.parent instanceof AscFormat.CAbsSizeAnchor)if(this.parent.parent instanceof AscFormat.CChartSpace){if(this.parent.parent.recalcInfo.recalculateTransform){this.parent.parent.recalculateTransform();this.parent.parent.rectGeometry.Recalculate(this.parent.parent.extX, this.parent.parent.extY);this.parent.parent.recalcInfo.recalculateTransform=false}global_MatrixTransformer.MultiplyAppend(transform,this.parent.parent.localTransform)}var oParaDrawing=getParaDrawing(this);if(oParaDrawing){this.m_oSectPr=null;var oParentParagraph=oParaDrawing.Get_ParentParagraph();if(oParentParagraph){var oSectPr=oParentParagraph.Get_SectPr();if(oSectPr){this.m_oSectPr=new CSectionPr;this.m_oSectPr.Copy(oSectPr)}}}this.localTransform=transform;this.transform=transform},this,[])};CShape.prototype.CheckNeedRecalcAutoFit= function(oSectPr){var Width,Height,Width2,Height2;var bRet=false;var oParaDrawing=getParaDrawing(this);var bSizRel=oParaDrawing&&(oParaDrawing.SizeRelH||oParaDrawing.SizeRelV);if(this.checkAutofit()||bSizRel)if(oSectPr)if(!this.m_oSectPr){this.recalcBounds();this.recalcText();this.recalcGeometry();if(bSizRel)this.recalcTransform();bRet=true}else{Width=oSectPr.GetContentFrameWidth();Height=oSectPr.GetContentFrameHeight();Width2=this.m_oSectPr.GetContentFrameWidth();Height2=this.m_oSectPr.GetContentFrameHeight(); bRet=Math.abs(Width-Width2)>.001||Math.abs(Height-Height2)>.001;if(bRet){this.recalcBounds();this.recalcText();this.recalcGeometry();if(bSizRel)this.recalcTransform()}return bRet}else if(this.m_oSectPr){this.recalcBounds();this.recalcText();this.recalcGeometry();bRet=true}return bRet};CShape.prototype.recalculateDocContent=function(oDocContent,oBodyPr){var nStartPage=this.Get_AbsolutePage?this.Get_AbsolutePage():0;var oRet={w:0,h:0,contentH:0};var l_ins,t_ins,r_ins,b_ins;if(oBodyPr){l_ins=AscFormat.isRealNumber(oBodyPr.lIns)? oBodyPr.lIns:2.54;r_ins=AscFormat.isRealNumber(oBodyPr.rIns)?oBodyPr.rIns:2.54;t_ins=AscFormat.isRealNumber(oBodyPr.tIns)?oBodyPr.tIns:1.27;b_ins=AscFormat.isRealNumber(oBodyPr.bIns)?oBodyPr.bIns:1.27}else{l_ins=2.54;r_ins=2.54;t_ins=1.27;b_ins=1.27}if(this.bWordShape){var oPen=this.pen;if(oPen){var penW=oPen.w==null?12700:parseInt(oPen.w);penW/=36E3;switch(oPen.algn){case 1:{break}default:{penW/=2;break}}l_ins+=penW;r_ins+=penW;t_ins+=penW;b_ins+=penW}}var oRect=this.getTextRect();var w,h;w=oRect.r- oRect.l-(l_ins+r_ins);h=oRect.b-oRect.t-(t_ins+b_ins);if(oBodyPr.wrap===AscFormat.nTWTNone){var dMaxWidth=1E5;if(this.bWordShape){this.m_oSectPr=null;var oParaDrawing=getParaDrawing(this);if(oParaDrawing){var oParentParagraph=oParaDrawing.Get_ParentParagraph();if(oParentParagraph){var oSectPr=oParentParagraph.Get_SectPr();if(oSectPr){if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert))dMaxWidth=oSectPr.GetContentFrameWidth()- l_ins-r_ins;else dMaxWidth=oSectPr.GetContentFrameHeight();this.m_oSectPr=new CSectionPr;this.m_oSectPr.Copy(oSectPr)}}}}var dMaxWidthRec=RecalculateDocContentByMaxLine(oDocContent,dMaxWidth,this.bWordShape);if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert)){if(dMaxWidthRec<w&&(!this.bWordShape&&!this.bCheckAutoFitFlag)){oDocContent.RecalculateContent(w,h,nStartPage);oRet.w=w+.001;oRet.contentH=oDocContent.GetSummaryHeight(); oRet.h=oRet.contentH}else{oDocContent.RecalculateContent(dMaxWidthRec,h,nStartPage);oRet.w=dMaxWidthRec+.001;oRet.contentH=oDocContent.GetSummaryHeight();oRet.h=oRet.contentH}oRet.correctW=l_ins+r_ins;oRet.correctH=t_ins+b_ins;oRet.textRectW=w;oRet.textRectH=h}else{if(dMaxWidthRec<h&&!this.bWordShape){oDocContent.RecalculateContent(h,h,nStartPage);oRet.w=h+.001;oRet.contentH=oDocContent.GetSummaryHeight();oRet.h=oRet.contentH}else{oDocContent.RecalculateContent(dMaxWidthRec,h,nStartPage);oRet.w=dMaxWidthRec+ .001;oRet.contentH=oDocContent.GetSummaryHeight();oRet.h=oRet.contentH}oRet.correctW=t_ins+b_ins;oRet.correctH=l_ins+r_ins;oRet.textRectW=h;oRet.textRectH=w}}else{if(!oBodyPr.upright)if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert)){oRet.w=w+.001;oRet.h=h+.001;oRet.correctW=l_ins+r_ins;oRet.correctH=t_ins+b_ins}else{oRet.w=h+.001;oRet.h=w+.001;oRet.correctW=t_ins+b_ins;oRet.correctH=l_ins+r_ins}else{var _full_rotate=this.getFullRotate(); if(checkNormalRotate(_full_rotate))if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert)){oRet.w=w+.001;oRet.h=h+.001;oRet.correctW=l_ins+r_ins;oRet.correctH=t_ins+b_ins}else{oRet.w=h+.001;oRet.h=w+.001;oRet.correctW=t_ins+b_ins;oRet.correctH=l_ins+r_ins}else if(!(oBodyPr.vert===AscFormat.nVertTTvert||oBodyPr.vert===AscFormat.nVertTTvert270||oBodyPr.vert===AscFormat.nVertTTeaVert)){oRet.w=h+.001;oRet.h=w+.001;oRet.correctW=t_ins+ b_ins;oRet.correctH=l_ins+r_ins}else{oRet.w=w+.001;oRet.h=h+.001;oRet.correctW=l_ins+r_ins;oRet.correctH=t_ins+b_ins}}oRet.textRectW=oRet.w;oRet.textRectH=oRet.h;oDocContent.RecalculateContent(oRet.w,oRet.h,nStartPage);oRet.contentH=oDocContent.GetSummaryHeight();if(this.bWordShape){this.m_oSectPr=null;var oParaDrawing=getParaDrawing(this);if(oParaDrawing){var oParentParagraph=oParaDrawing.Get_ParentParagraph();if(oParentParagraph){var oSectPr=oParentParagraph.Get_SectPr();if(oSectPr){this.m_oSectPr= new CSectionPr;this.m_oSectPr.Copy(oSectPr)}}}}}return oRet};var aScales=[25E3,3E4,35E3,4E4,45E3,5E4,55E3,6E4,65E3,7E4,75E3,8E4,85E3,9E4,95E3,1E4];CShape.prototype.recalculateContentWitCompiledPr=function(){var oContent=this.getDocContent&&this.getDocContent();if(oContent){oContent.Recalc_AllParagraphs_CompiledPr();this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateTransformText=true;this.recalculate()}};CShape.prototype.checkExtentsByDocContent=function(bForce,bNeedRecalc){if((!this.bWordShape|| this.group||bForce)&&this.checkAutofit(true)){var oMainGroup=this.getMainGroup();if(oMainGroup&&!(bNeedRecalc===false))oMainGroup.normalize();this.tmpFontScale=undefined;this.tmpLnSpcReduction=undefined;this.bCheckAutoFitFlag=true;var oOldRecalcTitle=this.recalcInfo.recalcTitle;var bOldRecalcTitle=this.recalcInfo.bRecalculatedTitle;this.handleUpdateExtents();this.recalcInfo.bRecalculatedTitle=false;this.recalcInfo.recalcTitle=this;this.recalculate();this.bCheckAutoFitFlag=false;this.recalcInfo.recalcTitle= oOldRecalcTitle;this.recalcInfo.bRecalculatedTitle=bOldRecalcTitle;AscFormat.CheckSpPrXfrm(this,true);this.spPr.xfrm.setExtX(this.extX+.001);this.spPr.xfrm.setExtY(this.extY+.001);if(!this.bWordShape||this.group){this.spPr.xfrm.setOffX(this.x);this.spPr.xfrm.setOffY(this.y);if(this.drawingBase)CheckExcelDrawingXfrm(this.spPr.xfrm)}if(!(bNeedRecalc===false))if(oMainGroup){oMainGroup.updateCoordinatesAfterInternalResize();if(oMainGroup.parent&&oMainGroup.parent.CheckWH){oMainGroup.parent.CheckWH(); if(this.bWordShape)editor.WordControl.m_oLogicDocument.Recalculate()}}else this.checkDrawingBaseCoords();return true}else{var oBodyPr=this.getBodyPr&&this.getBodyPr();var oContent=this.getDocContent&&this.getDocContent();if(oBodyPr&&oContent&&this.clipRect){var oTextFit=oBodyPr.textFit;if(oTextFit&&oTextFit.type===AscFormat.text_fit_NormAuto){var dOldContentHeight=this.contentHeight;var dOldClipW=this.clipRect.w;var dOldClipH=this.clipRect.h;this.recalcInfo.recalculateContent=true;this.recalculate(); if(!AscFormat.isRealNumber(oTextFit.fontScale)&&!AscFormat.isRealNumber(oTextFit.lnSpcReduction)&&this.contentHeight<=this.clipRect.h)return;if(!bForce&&AscFormat.isRealNumber(dOldClipW)&&AscFormat.isRealNumber(dOldClipH)&&AscFormat.fApproxEqual(dOldClipW,this.clipRect.w)&&AscFormat.fApproxEqual(dOldClipH,this.clipRect.h)){if(AscFormat.isRealNumber(dOldContentHeight)&&AscFormat.fApproxEqual(dOldContentHeight,this.contentHeight))return;if(dOldContentHeight<this.contentHeight&&oTextFit.fontScale=== aScales[0])return}this.bCheckAutoFitFlag=true;this.tmpFontScale=undefined;this.tmpLnSpcReduction=undefined;this.recalculateContentWitCompiledPr();if(this.contentHeight<=this.clipRect.h){oBodyPr=oBodyPr.createDuplicate();oBodyPr.textFit.lnSpcReduction=this.tmpLnSpcReduction;oBodyPr.textFit.fontScale=this.tmpFontScale;if(this.bWordShape)this.setBodyPr(oBodyPr);else if(this.txBody)this.txBody.setBodyPr(oBodyPr);this.bCheckAutoFitFlag=false;this.tmpFontScale=undefined;this.tmpLnSpcReduction=undefined; return}var dReductionScale=.2;var nCurIndex=aScales.length-1;var nCurShift=-(aScales.length/2);while(true){nCurIndex+=nCurShift;if(nCurIndex-1>=0){this.tmpFontScale=aScales[nCurIndex-1];this.tmpLnSpcReduction=dReductionScale*(1E5-this.tmpFontScale)>>0;this.recalculateContentWitCompiledPr();if(this.contentHeight<=this.clipRect.h){this.tmpFontScale=aScales[nCurIndex];this.tmpLnSpcReduction=dReductionScale*(1E5-this.tmpFontScale)>>0;this.recalculateContentWitCompiledPr();if(this.contentHeight>=this.clipRect.h){this.tmpFontScale= aScales[nCurIndex-1];this.tmpLnSpcReduction=dReductionScale*(1E5-this.tmpFontScale)>>0;break}else nCurShift=Math.abs(nCurShift)/2}else nCurShift=-Math.abs(nCurShift)/2;if(Math.abs(nCurShift)<1)break}else{this.tmpFontScale=aScales[0];this.tmpLnSpcReduction=dReductionScale*(1E5-this.tmpFontScale)>>0;break}}if(AscFormat.isRealNumber(this.tmpFontScale)&&this.tmpFontScale<9E4)if(this.isPlaceholder()){var nType=this.getPlaceholderType();if(nType===AscFormat.phType_title||nType===AscFormat.phType_ctrTitle){this.tmpFontScale= 9E4;this.tmpLnSpcReduction=dReductionScale*(1E5-this.tmpFontScale)>>0}}if(oBodyPr.textFit.lnSpcReduction!==this.tmpLnSpcReduction||oBodyPr.textFit.fontScale!==this.tmpFontScale){oBodyPr=oBodyPr.createDuplicate();oBodyPr.textFit.lnSpcReduction=this.tmpLnSpcReduction;oBodyPr.textFit.fontScale=this.tmpFontScale;if(this.bWordShape)this.setBodyPr(oBodyPr);else if(this.txBody)this.txBody.setBodyPr(oBodyPr)}this.bCheckAutoFitFlag=false;this.tmpFontScale=undefined;this.tmpLnSpcReduction=undefined;this.recalculateContentWitCompiledPr()}else if(bForce)this.recalculateContentWitCompiledPr()}}return false}; CShape.prototype.getTransformMatrix=function(){return this.transform};CShape.prototype.getTransform=function(){return{x:this.x,y:this.y,extX:this.extX,extY:this.extY,rot:this.rot,flipH:this.flipH,flipV:this.flipV}};CShape.prototype.getAngle=function(x,y){var px=this.invertTransform.TransformPointX(x,y);var py=this.invertTransform.TransformPointY(x,y);return Math.PI*.5+Math.atan2(px-this.extX*.5,py-this.extY*.5)};CShape.prototype.recalculateGeometry=function(){if(this.spPr&&isRealObject(this.spPr.geometry)){var transform= this.getTransform();this.spPr.geometry.Recalculate(transform.extX,transform.extY)}};CShape.prototype.drawAdjustments=function(drawingDocument){if(this.spPr&&isRealObject(this.spPr.geometry))this.spPr.geometry.drawAdjustments(drawingDocument,this.transform,false);if(this.recalcInfo.warpGeometry)this.recalcInfo.warpGeometry.drawAdjustments(drawingDocument,this.transformTextWordArt,true)};CShape.prototype.getHandlePosByIndex=function(numHandle){var t=this.transform;switch(numHandle){case 0:return{x:t.TransformPointX(0, 0),y:t.TransformPointY(0,0)};case 1:return{x:t.TransformPointX(this.extX/2,0),y:t.TransformPointY(this.extX/2,0)};case 2:return{x:t.TransformPointX(this.extX,0),y:t.TransformPointY(this.extX,0)};case 3:return{x:t.TransformPointX(this.extX,this.extY/2),y:t.TransformPointY(this.extX,this.extY/2)};case 4:return{x:t.TransformPointX(this.extX,this.extY),y:t.TransformPointY(this.extX,this.extY)};case 5:return{x:t.TransformPointX(this.extX/2,this.extY),y:t.TransformPointY(this.extX/2,this.extY)};case 6:return{x:t.TransformPointX(0, this.extY),y:t.TransformPointY(0,this.extY)};case 7:return{x:t.TransformPointX(0,this.extY/2),y:t.TransformPointY(0,0)};default:}};CShape.prototype.select=function(drawingObjectsController,pageIndex){this.selected=true;this.selectStartPage=pageIndex;var content=this.getDocContent&&this.getDocContent();if(content)content.Set_StartPage(pageIndex);var selected_objects;if(!isRealObject(this.group))selected_objects=drawingObjectsController.selectedObjects;else selected_objects=this.group.getMainGroup().selectedObjects; for(var i=0;i<selected_objects.length;++i)if(selected_objects[i]===this)break;if(i===selected_objects.length)selected_objects.push(this)};CShape.prototype.deselect=function(drawingObjectsController){this.selected=false;var selected_objects;if(!isRealObject(this.group))selected_objects=drawingObjectsController.selectedObjects;else selected_objects=this.group.getMainGroup().selectedObjects;for(var i=0;i<selected_objects.length;++i)if(selected_objects[i]===this){selected_objects.splice(i,1);break}if(this.graphicObject)this.graphicObject.RemoveSelection(); return this};CShape.prototype.getGroupHierarchy=function(){if(this.recalcInfo.recalculateGroupHierarchy){this.groupHierarchy=[];if(isRealObject(this.group)){var parent_group_hierarchy=this.group.getGroupHierarchy();for(var i=0;i<parent_group_hierarchy.length;++i)this.groupHierarchy.push(parent_group_hierarchy[i]);this.groupHierarchy.push(this.group)}this.recalcInfo.recalculateGroupHierarchy=false}return this.groupHierarchy};CShape.prototype.hitInTextRectWord=function(x,y){var content=this.getDocContent&& this.getDocContent();if(content&&this.invertTransform){var t_x,t_y;t_x=this.invertTransform.TransformPointX(x,y);t_y=this.invertTransform.TransformPointY(x,y);var w,h,x_,y_;if(this.spPr&&this.spPr.geometry&&this.spPr.geometry.rect&&AscFormat.isRealNumber(this.spPr.geometry.rect.l)&&AscFormat.isRealNumber(this.spPr.geometry.rect.t)&&AscFormat.isRealNumber(this.spPr.geometry.rect.r)&&AscFormat.isRealNumber(this.spPr.geometry.rect.r)){x_=this.spPr.geometry.rect.l;y_=this.spPr.geometry.rect.t;w=this.spPr.geometry.rect.r- this.spPr.geometry.rect.l;h=this.spPr.geometry.rect.b-this.spPr.geometry.rect.t}else{x_=0;y_=0;w=this.extX;h=this.extY}return t_x>x_&&t_x<x_+w&&t_y>y_&&t_y<y_+h}return false};CShape.prototype.hitInTextRect=function(x,y){var oController=this.getDrawingObjectsController&&this.getDrawingObjectsController();if(this.parent&&this.parent.kind===AscFormat.TYPE_KIND.NOTES)return true;var bForceWord=this.isEmptyPlaceholder&&this.isEmptyPlaceholder()||this.isPlaceholder&&this.isPlaceholder()&&oController&&AscFormat.getTargetTextObject(oController)=== this;if(bForceWord)if(this.hitInTextRectWord(x,y))return true;if(!this.txWarpStruct||!this.recalcInfo.warpGeometry||this.recalcInfo.warpGeometry.preset==="textNoShape"||oController&&(AscFormat.getTargetTextObject(oController)===this||oController.curState.startTargetTextObject===this)){var content=this.getDocContent&&this.getDocContent();if(content&&this.invertTransformText){var t_x,t_y;t_x=this.invertTransformText.TransformPointX(x,y);t_y=this.invertTransformText.TransformPointY(x,y);return t_x>0&& t_x<this.contentWidth&&t_y>0&&t_y<this.contentHeight}}else return this.hitInTextRectWord(x,y);return false};CShape.prototype.updateCursorType=function(x,y,e){if(this.invertTransformText){var tx=this.invertTransformText.TransformPointX(x,y);var ty=this.invertTransformText.TransformPointY(x,y);this.txBody.content.UpdateCursorType(tx,ty,0)}};CShape.prototype.selectionSetStart=function(e,x,y,slideIndex){var content=this.getDocContent();if(isRealObject(content)){var tx,ty;tx=this.invertTransformText.TransformPointX(x, y);ty=this.invertTransformText.TransformPointY(x,y);if(e.Button===AscCommon.g_mouse_button_right)if(content.CheckPosInSelection(tx,ty,0)){this.rightButtonFlag=true;return}if(!e.ShiftKey)content.Selection_SetStart(tx,ty,slideIndex-content.Get_StartPage_Relative(),e);else{if(!content.IsTextSelectionUse())content.StartSelectionFromCurPos();content.Selection_SetEnd(tx,ty,slideIndex-content.Get_StartPage_Relative(),e)}}};CShape.prototype.selectionSetEnd=function(e,x,y,slideIndex){var content=this.getDocContent(); if(isRealObject(content)){var tx,ty;tx=this.invertTransformText.TransformPointX(x,y);ty=this.invertTransformText.TransformPointY(x,y);if(!(e.Type===AscCommon.g_mouse_event_type_up&&this.rightButtonFlag))content.Selection_SetEnd(tx,ty,slideIndex-content.Get_StartPage_Relative(),e)}delete this.rightButtonFlag};CShape.prototype.Get_Theme=function(){return this.getParentObjects().theme};CShape.prototype.updateSelectionState=function(){var drawing_document=this.getDrawingDocument();if(drawing_document){var content= this.getDocContent();if(content){var oMatrix=null;if(this.transformText)oMatrix=this.transformText.CreateDublicate();drawing_document.UpdateTargetTransform(oMatrix);if(true===content.IsSelectionUse())if(selectionflag_Numbering==content.Selection.Flag){drawing_document.TargetEnd();drawing_document.SelectEnabled(true);drawing_document.SelectClear();drawing_document.SelectShow()}else if(null!=content.Selection.Data&&true===content.Selection.Data.TableBorder&&type_Table==content.Content[content.Selection.Data.Pos].GetType())drawing_document.TargetEnd(); else if(false===content.IsSelectionEmpty()){drawing_document.TargetEnd();drawing_document.SelectEnabled(true);drawing_document.SelectClear();drawing_document.SelectShow()}else{if(true!==content.Selection.Start)content.RemoveSelection();drawing_document.SelectEnabled(false);content.RecalculateCurPos();drawing_document.TargetStart();drawing_document.TargetShow()}else{drawing_document.SelectEnabled(false);content.RecalculateCurPos();drawing_document.TargetStart();drawing_document.TargetShow()}}else{drawing_document.UpdateTargetTransform(new CMatrix); drawing_document.TargetEnd();drawing_document.SelectEnabled(false);drawing_document.SelectClear();drawing_document.SelectShow()}}};CShape.prototype.check_bounds=function(checker){if(this.spPr&&this.spPr.geometry)this.spPr.geometry.check_bounds(checker);else{checker._s();checker._m(0,0);checker._l(this.extX,0);checker._l(this.extX,this.extY);checker._l(0,this.extY);checker._z();checker._e()}};CShape.prototype.getBase64Img=function(){if(this.parent)if(this.parent.kind===AscFormat.TYPE_KIND.LAYOUT|| this.parent.kind===AscFormat.TYPE_KIND.MASTER||this.parent.kind===AscFormat.TYPE_KIND.NOTES||this.parent.kind===AscFormat.TYPE_KIND.NOTES_MASTER)return"";if(typeof this.cachedImage==="string"&&this.cachedImage.length>0)return this.cachedImage;if(!AscFormat.isRealNumber(this.x)||!AscFormat.isRealNumber(this.y)||!AscFormat.isRealNumber(this.extX)||!AscFormat.isRealNumber(this.extY)||AscFormat.fApproxEqual(this.extX,0)&&AscFormat.fApproxEqual(this.extY,0))return"";var img_object=AscCommon.ShapeToImageConverter(this, this.pageIndex);if(img_object){if(img_object.ImageNative)try{this.cachedPixW=img_object.ImageNative.width;this.cachedPixH=img_object.ImageNative.height}catch(e){this.cachedPixW=50;this.cachedPixH=50}return img_object.ImageUrl}else return""};CShape.prototype.haveSelectedDrawingInContent=function(){if(this.bWordShape){var aAllDrawings=this.recalcInfo.AllDrawings;for(var i=0;i<aAllDrawings.length;++i)if(aAllDrawings[i]&&aAllDrawings[i].GraphicObj&&aAllDrawings[i].GraphicObj.selected)return true}return false}; CShape.prototype.clipTextRect=function(graphics,transform,transformText,pageIndex){if(this.clipRect){var transform_=transform?transform:this.transform;var transformText_=transformText?transformText:this.transformText;var clip_rect=this.clipRect;var oBodyPr=this.getBodyPr();if(!this.bWordShape)if(oBodyPr.vertOverflow===AscFormat.nOTOwerflow)return;if(!oBodyPr||!oBodyPr.upright){graphics.transform3(transform_);graphics.AddClipRect(clip_rect.x,clip_rect.y,clip_rect.w,clip_rect.h);graphics.SetIntegerGrid(false); graphics.transform3(transformText_,true)}else{var oTransform=new CMatrix;var cX=transform_.TransformPointX(this.extX/2,this.extY/2);var cY=transform_.TransformPointY(this.extX/2,this.extY/2);if(checkNormalRotate(this.rot)){oTransform.tx=cX-this.extX/2;oTransform.ty=cY-this.extY/2}else{global_MatrixTransformer.TranslateAppend(oTransform,-this.extX/2,-this.extY/2);global_MatrixTransformer.RotateRadAppend(oTransform,Math.PI/2);global_MatrixTransformer.TranslateAppend(oTransform,cX,cY)}graphics.transform3(oTransform, true);graphics.AddClipRect(clip_rect.x,clip_rect.y,clip_rect.w,clip_rect.h);graphics.SetIntegerGrid(false);graphics.transform3(transformText_,true)}}};CShape.prototype.draw=function(graphics,transform,transformText,pageIndex){if(this.checkNeedRecalculate&&this.checkNeedRecalculate())return;var oUR=graphics.updatedRect;if(oUR&&this.bounds)if(!oUR.isIntersectOther(this.bounds))return;var _transform=transform?transform:this.transform;var _transform_text=transformText?transformText:this.transformText; var geometry=this.calcGeometry||this.spPr&&this.spPr.geometry;this.drawShdw&&this.drawShdw(graphics);if(graphics.IsSlideBoundsCheckerType===true){graphics.transform3(_transform);if(!this.spPr||null==geometry||geometry.pathLst.length===0||geometry.pathLst.length===1&&geometry.pathLst[0].ArrPathCommandInfo.length===0||!graphics.IsShapeNeedBounds(geometry.preset)){graphics._s();graphics._m(0,0);graphics._l(this.extX,0);graphics._l(this.extX,this.extY);graphics._l(0,this.extY);graphics._e()}else geometry.check_bounds(graphics); if(this.txBody){graphics.SetIntegerGrid(false);var transform_text;if((!this.txBody.content||this.txBody.content.Is_Empty())&&this.txBody.content2!=null&&!this.txBody.checkCurrentPlaceholder()&&(this.isEmptyPlaceholder?this.isEmptyPlaceholder():false)&&this.transformText2)transform_text=this.transformText2;else if(this.txBody.content)transform_text=_transform_text;graphics.transform3(transform_text);if(graphics.CheckUseFonts2!==undefined)graphics.CheckUseFonts2(transform_text);this.txBody.draw(graphics); if(graphics.UncheckUseFonts2!==undefined)graphics.UncheckUseFonts2(transform_text);graphics.SetIntegerGrid(true)}graphics.reset();return}var oClipRect;if(!graphics.IsSlideBoundsCheckerType&&this.getClipRect)oClipRect=this.getClipRect();if(oClipRect){graphics.SaveGrState();graphics.AddClipRect(oClipRect.x,oClipRect.y,oClipRect.w,oClipRect.h)}var _oldBrush=this.brush;if(this.signatureLine){var sSignatureUrl=null;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;if(_editor)sSignatureUrl= _editor.asc_getSignatureImage(this.signatureLine.id);if(typeof sSignatureUrl==="string"&&sSignatureUrl.length>0)this.brush=AscFormat.CreateBlipFillUniFillFromUrl(sSignatureUrl)}if((geometry||this.getObjectType&&(this.getObjectType()===AscDFH.historyitem_type_DLbl||this.getObjectType()===AscDFH.historyitem_type_Title||this.getObjectType()===AscDFH.historyitem_type_Legend))&&(this.style||this.brush&&this.brush.fill||this.pen&&this.pen.Fill&&this.pen.Fill.fill)){graphics.SetIntegerGrid(false);graphics.transform3(_transform, false);var shape_drawer=new AscCommon.CShapeDrawer;shape_drawer.fromShape2(this,graphics,geometry);shape_drawer.draw(geometry)}if(!this.bWordShape&&this.isEmptyPlaceholder()&&!(this.parent&&this.parent.kind===AscFormat.TYPE_KIND.NOTES)&&!(this.pen&&this.pen.Fill&&this.pen.Fill.fill&&!(this.pen.Fill.fill instanceof AscFormat.CNoFill))&&graphics.IsNoDrawingEmptyPlaceholder!==true&&!AscCommon.IsShapeToImageConverter){var drawingObjects=this.getDrawingObjectsController();if(typeof editor!=="undefined"&& editor&&graphics.m_oContext!==undefined&&graphics.m_oContext!==null&&graphics.IsTrack===undefined&&(!drawingObjects||AscFormat.getTargetTextObject(drawingObjects)!==this)){var angle=_transform.GetRotation();if(AscFormat.fApproxEqual(angle,0,0)||AscFormat.fApproxEqual(angle,90,0)||AscFormat.fApproxEqual(angle,180,0)||AscFormat.fApproxEqual(angle,270,0)){graphics.transform3(_transform,false);var tr=graphics.m_oFullTransform;graphics.SetIntegerGrid(true);var _x=tr.TransformPointX(0,0);var _y=tr.TransformPointY(0, 0);var _r=tr.TransformPointX(this.extX,this.extY);var _b=tr.TransformPointY(this.extX,this.extY);var __x=Math.min(_x,_r);var __y=Math.min(_y,_b);var __r=Math.max(_x,_r);var __b=Math.max(_y,_b);graphics.m_oContext.lineWidth=1;graphics.p_color(127,127,127,255);graphics._s();editor.WordControl.m_oDrawingDocument.AutoShapesTrack.AddRectDashClever(graphics.m_oContext,__x>>0,__y>>0,__r>>0,__b>>0,2,2,true);graphics._s()}else{graphics.transform3(_transform,false);var tr=graphics.m_oFullTransform;graphics.SetIntegerGrid(true); var _r=this.extX;var _b=this.extY;var x1=tr.TransformPointX(0,0)>>0;var y1=tr.TransformPointY(0,0)>>0;var x2=tr.TransformPointX(_r,0)>>0;var y2=tr.TransformPointY(_r,0)>>0;var x3=tr.TransformPointX(0,_b)>>0;var y3=tr.TransformPointY(0,_b)>>0;var x4=tr.TransformPointX(_r,_b)>>0;var y4=tr.TransformPointY(_r,_b)>>0;graphics.m_oContext.lineWidth=1;graphics.p_color(127,127,127,255);graphics._s();editor.WordControl.m_oDrawingDocument.AutoShapesTrack.AddRectDash(graphics.m_oContext,x1,y1,x2,y2,x3,y3,x4, y4,3,1,true);graphics._s()}}else{graphics.SetIntegerGrid(false);graphics.p_width(70);graphics.transform3(_transform,false);graphics.p_color(0,0,0,255);graphics._s();graphics._m(0,0);graphics._l(this.extX,0);graphics._l(this.extX,this.extY);graphics._l(0,this.extY);graphics._z();graphics.ds();graphics.SetIntegerGrid(true)}}this.brush=_oldBrush;var oController=this.getDrawingObjectsController&&this.getDrawingObjectsController();if(!this.cropObject)if(!this.txWarpStruct&&!this.txWarpStructParamarksNoTransform|| (!this.txWarpStructParamarksNoTransform&&oController&&AscFormat.getTargetTextObject(oController)===this||!this.txBody&&!this.textBoxContent)){if(this.txBody){graphics.SaveGrState();graphics.SetIntegerGrid(false);var transform_text;if((!this.txBody.content||this.txBody.content.Is_Empty())&&!AscCommon.IsShapeToImageConverter&&this.txBody.content2!=null&&!this.txBody.checkCurrentPlaceholder()&&(this.isEmptyPlaceholder?this.isEmptyPlaceholder():false)&&this.transformText2)transform_text=this.transformText2; else if(this.txBody.content)transform_text=_transform_text;if(this instanceof CShape)if(!(oController&&AscFormat.getTargetTextObject(oController)===this))this.clipTextRect(graphics,transform,transformText,pageIndex);graphics.transform3(transform_text,true);if(graphics.CheckUseFonts2!==undefined)graphics.CheckUseFonts2(transform_text);graphics.SetIntegerGrid(true);this.txBody.draw(graphics);if(graphics.UncheckUseFonts2!==undefined)graphics.UncheckUseFonts2(transform_text);graphics.RestoreGrState()}if(this.textBoxContent&& !graphics.IsNoSupportTextDraw&&this.transformText){var old_start_page=this.textBoxContent.Get_StartPage_Relative();this.textBoxContent.Set_StartPage(pageIndex);graphics.SaveGrState();graphics.SetIntegerGrid(false);this.clipTextRect(graphics,transform,transformText,pageIndex);var result_page_index=AscFormat.isRealNumber(graphics.shapePageIndex)?graphics.shapePageIndex:old_start_page;if(graphics.CheckUseFonts2!==undefined)graphics.CheckUseFonts2(this.transformText);if(AscCommon.IsShapeToImageConverter){this.textBoxContent.Set_StartPage(0); result_page_index=0}this.textBoxContent.Set_StartPage(result_page_index);this.textBoxContent.Draw(result_page_index,graphics);if(graphics.UncheckUseFonts2!==undefined)graphics.UncheckUseFonts2();this.textBoxContent.Set_StartPage(old_start_page);graphics.RestoreGrState()}}else{var oTheme=this.getParentObjects().theme;var oColorMap=this.Get_ColorMap();if(!this.bWordShape&&(!this.txBody.content||this.txBody.content.Is_Empty())&&!AscCommon.IsShapeToImageConverter&&this.txBody.content2!=null&&!this.txBody.checkCurrentPlaceholder()&& (this.isEmptyPlaceholder?this.isEmptyPlaceholder():false)){if(graphics.IsNoDrawingEmptyPlaceholder!==true&&graphics.IsNoDrawingEmptyPlaceholderText!==true)if(editor&&editor.ShowParaMarks)this.txWarpStructParamarks2.draw(graphics,this.transformTextWordArt2,oTheme,oColorMap);else if(this.txWarpStruct2)this.txWarpStruct2.draw(graphics,this.transformTextWordArt2,oTheme,oColorMap)}else{var oContent=this.getDocContent();var result_page_index=AscFormat.isRealNumber(graphics.shapePageIndex)?graphics.shapePageIndex: oContent?oContent.Get_StartPage_Relative():0;graphics.PageNum=result_page_index;var bNeedRestoreState=false;var bEditTextArt=isRealObject(oController)&&AscFormat.getTargetTextObject(oController)===this;if(this.bWordShape&&this.clipRect){bNeedRestoreState=true;var clip_rect=this.clipRect;if(!this.bodyPr.upright){graphics.SaveGrState();graphics.SetIntegerGrid(false);graphics.transform3(this.transform);graphics.AddClipRect(clip_rect.x,clip_rect.y,clip_rect.w,clip_rect.h)}else{graphics.SaveGrState(); graphics.SetIntegerGrid(false);graphics.transform3(this.transformText,true);graphics.AddClipRect(clip_rect.x,clip_rect.y,clip_rect.w,clip_rect.h)}}var oTransform=this.transformTextWordArt;if(editor&&editor.ShowParaMarks)if(bEditTextArt&&this.txWarpStructParamarksNoTransform)this.txWarpStructParamarksNoTransform.draw(graphics,this.transformText,oTheme,oColorMap);else{if(this.txWarpStructParamarks){this.txWarpStructParamarks.draw(graphics,oTransform,oTheme,oColorMap);if(this.checkNeedRecalcDocContentForTxWarp(this.bodyPr))if(this.txWarpStructParamarksNoTransform)this.txWarpStructParamarksNoTransform.drawComments(graphics, undefined,oTransform)}}else if(bEditTextArt&&this.txWarpStructNoTransform)this.txWarpStructNoTransform.draw(graphics,this.transformText,oTheme,oColorMap);else if(this.txWarpStruct){this.txWarpStruct.draw(graphics,oTransform,oTheme,oColorMap);if(this.checkNeedRecalcDocContentForTxWarp(this.bodyPr))if(this.txWarpStructNoTransform)this.txWarpStructNoTransform.drawComments(graphics,undefined,oTransform)}delete graphics.PageNum;if(bNeedRestoreState)graphics.RestoreGrState()}}this.drawLocks&&this.drawLocks(_transform, graphics);if(oClipRect)graphics.RestoreGrState();graphics.SetIntegerGrid(true);graphics.reset()};CShape.prototype.recalculateGeometry=function(){this.calcGeometry=null;if(isRealObject(this.spPr&&this.spPr.geometry))this.calcGeometry=this.spPr.geometry;else if(this.getHierarchy){var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(hierarchy[i]&&hierarchy[i].spPr&&hierarchy[i].spPr.geometry){var _g=hierarchy[i].spPr.geometry;this.calcGeometry=AscFormat.ExecuteNoHistory(function(){var _r= _g.createDuplicate();_r.setParent(this);return _r},this,[]);break}}if(isRealObject(this.calcGeometry)){var transform=this.getTransform();this.calcGeometry.Recalculate(transform.extX,transform.extY)}};CShape.prototype.getRotateAngle=function(x,y){var transform=this.getTransformMatrix();var rotate_distance=this.convertPixToMM(AscCommon.TRACK_DISTANCE_ROTATE);var hc=this.extX*.5;var vc=this.extY*.5;var xc_t=transform.TransformPointX(hc,vc);var yc_t=transform.TransformPointY(hc,vc);var rot_x_t=transform.TransformPointX(hc, -rotate_distance);var rot_y_t=transform.TransformPointY(hc,-rotate_distance);var invert_transform=this.getInvertTransform();if(!invert_transform)return 0;var rel_x=invert_transform.TransformPointX(x,y);var v1_x,v1_y,v2_x,v2_y;v1_x=x-xc_t;v1_y=y-yc_t;v2_x=rot_x_t-xc_t;v2_y=rot_y_t-yc_t;var flip_h=this.getFullFlipH();var flip_v=this.getFullFlipV();var same_flip=flip_h&&flip_v||!flip_h&&!flip_v;var angle=rel_x>this.extX*.5?Math.atan2(Math.abs(v1_x*v2_y-v1_y*v2_x),v1_x*v2_x+v1_y*v2_y):-Math.atan2(Math.abs(v1_x* v2_y-v1_y*v2_x),v1_x*v2_x+v1_y*v2_y);return same_flip?angle:-angle};CShape.prototype.getRectBounds=function(){var transform=this.getTransformMatrix();var w=this.extX;var h=this.extY;var rect_points=[{x:0,y:0},{x:w,y:0},{x:w,y:h},{x:0,y:h}];var min_x,max_x,min_y,max_y;min_x=transform.TransformPointX(rect_points[0].x,rect_points[0].y);min_y=transform.TransformPointY(rect_points[0].x,rect_points[0].y);max_x=min_x;max_y=min_y;var cur_x,cur_y;for(var i=1;i<4;++i){cur_x=transform.TransformPointX(rect_points[i].x, rect_points[i].y);cur_y=transform.TransformPointY(rect_points[i].x,rect_points[i].y);if(cur_x<min_x)min_x=cur_x;if(cur_x>max_x)max_x=cur_x;if(cur_y<min_y)min_y=cur_y;if(cur_y>max_y)max_y=cur_y}return{minX:min_x,maxX:max_x,minY:min_y,maxY:max_y}};CShape.prototype.getInvertTransform=function(){return this.invertTransform?this.invertTransform:new CMatrix};CShape.prototype.getFullOffset=function(){if(!isRealObject(this.group))return{offX:this.x,offY:this.y};var group_offset=this.group.getFullOffset(); return{offX:this.x+group_offset.offX,offY:this.y+group_offset.offY}};CShape.prototype.getTextArtProperties=function(){var oContent=this.getDocContent(),oTextPr,oRet=null;if(oContent){oRet={Fill:undefined,Line:undefined,Form:undefined};var oController=this.getDrawingObjectsController();{var oBodyPr=this.getBodyPr();if(oBodyPr&&oBodyPr.prstTxWarp)oRet.Form=oBodyPr.prstTxWarp.preset;else oRet.Form="textNoShape"}}return oRet};CShape.prototype.applyTextArtForm=function(sPreset){var oBodyPr=this.getBodyPr().createDuplicate(); oBodyPr.prstTxWarp=AscFormat.ExecuteNoHistory(function(){return AscFormat.CreatePrstTxWarpGeometry(sPreset)},this,[]);if(this.bWordShape)this.setBodyPr(oBodyPr);else if(this.txBody)this.txBody.setBodyPr(oBodyPr)};CShape.prototype.getParagraphParaPr=function(){if(this.txBody&&this.txBody.content){var _result;this.txBody.content.Set_ApplyToAll(true);_result=this.txBody.content.GetCalculatedParaPr();this.txBody.content.Set_ApplyToAll(false);return _result}return null};CShape.prototype.getParagraphTextPr= function(){if(this.txBody&&this.txBody.content){var _result;this.txBody.content.Set_ApplyToAll(true);_result=this.txBody.content.GetCalculatedTextPr();this.txBody.content.Set_ApplyToAll(false);return _result}return null};CShape.prototype.getAllRasterImages=function(images){if(this.spPr&&this.spPr.Fill&&this.spPr.Fill.fill&&typeof this.spPr.Fill.fill.RasterImageId==="string"&&this.spPr.Fill.fill.RasterImageId.length>0)images.push(this.spPr.Fill.fill.RasterImageId);var compiled_style=this.getCompiledStyle(); var parents=this.getParentObjects();if(isRealObject(parents.theme)&&isRealObject(compiled_style)&&isRealObject(compiled_style.fillRef)){var brush=parents.theme.getFillStyle(compiled_style.fillRef.idx,compiled_style.fillRef.Color);if(brush&&brush.fill&&typeof brush.fill.RasterImageId==="string"&&brush.fill.RasterImageId.length>0)images.push(brush.fill.RasterImageId)}var oContent=this.getDocContent();if(oContent){if(this.bWordShape){var drawings=oContent.GetAllDrawingObjects();for(var i=0;i<drawings.length;++i)drawings[i].GraphicObj&& drawings[i].GraphicObj.getAllRasterImages&&drawings[i].GraphicObj.getAllRasterImages(images)}var fCallback=function(oRun){var oTextPr=oRun&&oRun.Pr;if(oTextPr&&oTextPr.Unifill&&oTextPr.Unifill.fill&&oTextPr.Unifill.fill.type==c_oAscFill.FILL_TYPE_BLIP)images.push(oTextPr.Unifill.fill.RasterImageId);return false};oContent.CheckRunContent(fCallback)}};CShape.prototype.getAllDocContents=function(aDocContents){if(this.textBoxContent)aDocContents.push(this.textBoxContent)};CShape.prototype.changePresetGeom= function(sPreset){if(sPreset==="textRect"){this.spPr.setGeometry(AscFormat.CreateGeometry("rect"));if(this.bWordShape){if(this.style)this.setStyle(null)}else this.setStyle(AscFormat.CreateDefaultTextRectStyle());var fill=new AscFormat.CUniFill;fill.setFill(new AscFormat.CSolidFill);fill.fill.setColor(new AscFormat.CUniColor);fill.fill.color.setColor(new AscFormat.CSchemeColor);fill.fill.color.color.setId(12);this.spPr.setFill(fill);var ln=new AscFormat.CLn;ln.setW(6350);ln.setFill(new AscFormat.CUniFill); ln.Fill.setFill(new AscFormat.CSolidFill);ln.Fill.fill.setColor(new AscFormat.CUniColor);ln.Fill.fill.color.setColor(new AscFormat.CPrstColor);ln.Fill.fill.color.color.setId("black");this.spPr.setLn(ln);if(this.bWordShape){if(!this.textBoxContent){this.setTextBoxContent(new CDocumentContent(this,this.getDrawingDocument(),0,0,0,0,false,false,false));var body_pr=new AscFormat.CBodyPr;body_pr.setDefault();this.setBodyPr(body_pr)}}else if(!this.txBody){this.setTxBody(new AscFormat.CTextBody);var content= new AscFormat.CDrawingDocContent(this.txBody,this.getDrawingDocument(),0,0,0,0,false,false,true);this.txBody.setParent(this);this.txBody.setContent(content);var body_pr=new AscFormat.CBodyPr;body_pr.setDefault();this.txBody.setBodyPr(body_pr)}return}var _final_preset;var _old_line;var _new_line;if(this.spPr.ln==null)_old_line=null;else _old_line=this.spPr.ln.createDuplicate();switch(sPreset){case "lineWithArrow":{_final_preset="line";if(_old_line==null)_new_line=new AscFormat.CLn;else _new_line=this.spPr.ln.createDuplicate(); _new_line.tailEnd=new AscFormat.EndArrow;_new_line.tailEnd.type=AscFormat.LineEndType.Arrow;_new_line.tailEnd.len=AscFormat.LineEndSize.Mid;_new_line.tailEnd.w=AscFormat.LineEndSize.Mid;break}case "lineWithTwoArrows":{_final_preset="line";if(_old_line==null)_new_line=new AscFormat.CLn;else _new_line=this.spPr.ln.createDuplicate();_new_line.tailEnd=new AscFormat.EndArrow;_new_line.tailEnd.type=AscFormat.LineEndType.Arrow;_new_line.tailEnd.len=AscFormat.LineEndSize.Mid;_new_line.tailEnd.w=AscFormat.LineEndSize.Mid; _new_line.headEnd=new AscFormat.EndArrow;_new_line.headEnd.type=AscFormat.LineEndType.Arrow;_new_line.headEnd.len=AscFormat.LineEndSize.Mid;_new_line.headEnd.w=AscFormat.LineEndSize.Mid;break}case "bentConnector5WithArrow":{_final_preset="bentConnector5";if(_old_line==null)_new_line=new AscFormat.CLn;else _new_line=this.spPr.ln.createDuplicate();_new_line.tailEnd=new AscFormat.EndArrow;_new_line.tailEnd.type=AscFormat.LineEndType.Arrow;_new_line.tailEnd.len=AscFormat.LineEndSize.Mid;_new_line.tailEnd.w= AscFormat.LineEndSize.Mid;break}case "bentConnector5WithTwoArrows":{_final_preset="bentConnector5";if(_old_line==null)_new_line=new AscFormat.CLn;else _new_line=this.spPr.ln.createDuplicate();_new_line.tailEnd=new AscFormat.EndArrow;_new_line.tailEnd.type=AscFormat.LineEndType.Arrow;_new_line.tailEnd.len=AscFormat.LineEndSize.Mid;_new_line.tailEnd.w=AscFormat.LineEndSize.Mid;_new_line.headEnd=new AscFormat.EndArrow;_new_line.headEnd.type=AscFormat.LineEndType.Arrow;_new_line.headEnd.len=AscFormat.LineEndSize.Mid; _new_line.headEnd.w=AscFormat.LineEndSize.Mid;break}case "curvedConnector3WithArrow":{_final_preset="curvedConnector3";if(_old_line==null)_new_line=new AscFormat.CLn;else _new_line=this.spPr.ln.createDuplicate();_new_line.tailEnd=new AscFormat.EndArrow;_new_line.tailEnd.type=AscFormat.LineEndType.Arrow;_new_line.tailEnd.len=AscFormat.LineEndSize.Mid;_new_line.tailEnd.w=AscFormat.LineEndSize.Mid;break}case "curvedConnector3WithTwoArrows":{_final_preset="curvedConnector3";if(_old_line==null)_new_line= new AscFormat.CLn;else _new_line=this.spPr.ln.createDuplicate();_new_line.tailEnd=new AscFormat.EndArrow;_new_line.tailEnd.type=AscFormat.LineEndType.Arrow;_new_line.tailEnd.len=AscFormat.LineEndSize.Mid;_new_line.tailEnd.w=AscFormat.LineEndSize.Mid;_new_line.headEnd=new AscFormat.EndArrow;_new_line.headEnd.type=AscFormat.LineEndType.Arrow;_new_line.headEnd.len=AscFormat.LineEndSize.Mid;_new_line.headEnd.w=AscFormat.LineEndSize.Mid;break}default:{_final_preset=sPreset;if(_old_line==null)_new_line= new AscFormat.CLn;else _new_line=this.spPr.ln.createDuplicate();_new_line.tailEnd=null;_new_line.headEnd=null;break}}if(_final_preset!=null)this.spPr.setGeometry(AscFormat.CreateGeometry(_final_preset));else this.spPr.setGeometry(null);if(!this.bWordShape)this.checkExtentsByDocContent();if((!this.brush||!this.brush.fill)&&(!this.pen||!this.pen.Fill||!this.pen.Fill.fill)){var new_line2=new AscFormat.CLn;new_line2.Fill=new AscFormat.CUniFill;new_line2.Fill.fill=new AscFormat.CSolidFill;new_line2.Fill.fill.color= new AscFormat.CUniColor;new_line2.Fill.fill.color.color=new AscFormat.CSchemeColor;new_line2.Fill.fill.color.color.id=0;if(isRealObject(_new_line))new_line2.merge(_new_line);this.spPr.setLn(new_line2)}else this.spPr.setLn(_new_line)};CShape.prototype.changeFill=function(unifill){if(this.recalcInfo.recalculateBrush)this.recalculateBrush();var unifill2=AscFormat.CorrectUniFill(unifill,this.brush,this.getEditorType());unifill2.convertToPPTXMods();this.spPr.setFill(unifill2)};CShape.prototype.changeShadow= function(oShadow){this.spPr&&this.spPr.changeShadow(oShadow)};CShape.prototype.setFill=function(fill){this.spPr.setFill(fill)};CShape.prototype.changeLine=function(line){if(this.recalcInfo.recalculatePen)this.recalculatePen();var stroke=AscFormat.CorrectUniStroke(line,this.pen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.spPr.setLn(stroke)};CShape.prototype.hitToAdjustment=function(x,y){var invert_transform;var t_x,t_y,ret;var _calcGeoem=this.calcGeometry||this.spPr&&this.spPr.geometry;var _dist; if(global_mouseEvent&&global_mouseEvent.AscHitToHandlesEpsilon)_dist=global_mouseEvent.AscHitToHandlesEpsilon;else _dist=this.convertPixToMM(global_mouseEvent.KoefPixToMM*AscCommon.TRACK_CIRCLE_RADIUS);if(_calcGeoem){invert_transform=this.getInvertTransform();if(!invert_transform)return{hit:false,adjPolarFlag:null,adjNum:null,warp:false};t_x=invert_transform.TransformPointX(x,y);t_y=invert_transform.TransformPointY(x,y);ret=_calcGeoem.hitToAdj(t_x,t_y,_dist);if(ret.hit){t_x=invert_transform.TransformPointX(x, y);t_y=invert_transform.TransformPointY(x,y);ret=_calcGeoem.hitToAdj(t_x,t_y,this.convertPixToMM(global_mouseEvent.KoefPixToMM*AscCommon.TRACK_CIRCLE_RADIUS));if(ret.hit){ret.warp=false;return ret}}}if(this.recalcInfo.warpGeometry&&this.invertTransformTextWordArt){invert_transform=this.invertTransformTextWordArt;t_x=invert_transform.TransformPointX(x,y);t_y=invert_transform.TransformPointY(x,y);ret=this.recalcInfo.warpGeometry.hitToAdj(t_x,t_y,_dist);ret.warp=true;return ret}return{hit:false,adjPolarFlag:null, adjNum:null,warp:false}};CShape.prototype.hit=function(x,y){return this.hitInInnerArea(x,y)||this.hitInPath(x,y)||this.hitInTextRect(x,y)};CShape.prototype.hitInPath=function(x,y){if(!this.checkHitToBounds(x,y))return false;var invert_transform=this.getInvertTransform();if(!invert_transform)return false;var x_t=invert_transform.TransformPointX(x,y);var y_t=invert_transform.TransformPointY(x,y);if(isRealObject(this.spPr)&&isRealObject(this.spPr.geometry))return this.spPr.geometry.hitInPath(this.getCanvasContext(), x_t,y_t);else return this.hitInBoundingRect(x,y);return false};CShape.prototype.hitInInnerArea=function(x,y){if(this.getObjectType&&this.getObjectType()===AscDFH.historyitem_type_ChartSpace||this.getObjectType()===AscDFH.historyitem_type_Title||(this.brush!=null&&this.brush.fill!=null&&this.brush.fill.type!=c_oAscFill.FILL_TYPE_NOFILL||this.blipFill)&&this.checkHitToBounds(x,y)){var invert_transform=this.getInvertTransform();if(!invert_transform)return false;var x_t=invert_transform.TransformPointX(x, y);var y_t=invert_transform.TransformPointY(x,y);var oGeometry=this.spPr&&this.spPr.geometry||this.calcGeometry;if(isRealObject(oGeometry)&&oGeometry.pathLst.length>0&&!(this.getObjectType&&this.getObjectType()===AscDFH.historyitem_type_ChartSpace))return oGeometry.hitInInnerArea(this.getCanvasContext(),x_t,y_t);if(this.getObjectType()===AscDFH.historyitem_type_Shape)return false;return x_t>0&&x_t<this.extX&&y_t>0&&y_t<this.extY}return false};CShape.prototype.hitInBoundingRect=function(x,y){if(this.parent&& this.parent.kind===AscFormat.TYPE_KIND.NOTES)return false;var invert_transform=this.getInvertTransform();if(!invert_transform)return false;var x_t=invert_transform.TransformPointX(x,y);var y_t=invert_transform.TransformPointY(x,y);var _hit_context=this.getCanvasContext();return!CheckObjectLine(this)&&(HitInLine(_hit_context,x_t,y_t,0,0,this.extX,0)||HitInLine(_hit_context,x_t,y_t,this.extX,0,this.extX,this.extY)||HitInLine(_hit_context,x_t,y_t,this.extX,this.extY,0,this.extY)||HitInLine(_hit_context, x_t,y_t,0,this.extY,0,0)||this.canRotate&&this.canRotate()&&HitInLine(_hit_context,x_t,y_t,this.extX*.5,0,this.extX*.5,-this.convertPixToMM(AscCommon.TRACK_DISTANCE_ROTATE)))};CShape.prototype.canRotate=function(){if(this.cropObject)return false;if(this.signatureLine)return false;return AscFormat.CGraphicObjectBase.prototype.canRotate.call(this)};CShape.prototype.canGroup=function(){if(this.isPlaceholder())return false;if(this.signatureLine)return false;return AscFormat.CGraphicObjectBase.prototype.canGroup.call(this)}; CShape.prototype.createRotateTrack=function(){return new AscFormat.RotateTrackShapeImage(this)};CShape.prototype.createResizeTrack=function(cardDirection,oController){return new AscFormat.ResizeTrackShapeImage(this,cardDirection,oController)};CShape.prototype.createMoveTrack=function(){return new AscFormat.MoveShapeImageTrack(this)};CShape.prototype.remove=function(Count,bOnlyText,bRemoveOnlySelection,bOnTextAdd,isWord){if(this.txBody){this.txBody.content.Remove(Count,bOnlyText,bRemoveOnlySelection, bOnTextAdd,isWord);this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateTransformText=true}};CShape.prototype.isWatermark=function(){var oContent,oTextPr;if(!this.brush||!this.brush.fill||this.brush.fill.type==c_oAscFill.FILL_TYPE_NOFILL){oContent=this.getDocContent();if(oContent){oContent.Set_ApplyToAll(true);oTextPr=oContent.GetCalculatedTextPr();oContent.Set_ApplyToAll(false);if(oTextPr.FontSize>20&&oTextPr.TextFill)return true}}return false};CShape.prototype.getWatermarkProps=function(){var oProps= new Asc.CAscWatermarkProperties,oTextPr,oRGBAColor,oInterfaceTextPr,oContent;oContent=this.getDocContent();oProps.put_Type(Asc.c_oAscWatermarkType.Text);oProps.put_IsDiagonal(!AscFormat.fApproxEqual(this.rot,0));oContent.Set_ApplyToAll(true);oProps.put_Text(oContent.GetSelectedText(true,{NewLineParagraph:false,NewLine:false}));oTextPr=oContent.GetCalculatedTextPr();oProps.put_Opacity(255);if(oTextPr.FontSize-(oTextPr.FontSize>>0)>0)oTextPr.FontSize=-1;oInterfaceTextPr=new Asc.CTextProp(oTextPr);if(oTextPr.TextFill){oTextPr.TextFill.check(this.Get_Theme(), this.Get_ColorMap());if(oTextPr.TextFill.fill&&oTextPr.TextFill.fill.type===c_oAscFill.FILL_TYPE_SOLID&&oTextPr.TextFill.fill.color)oInterfaceTextPr.put_Color(AscCommon.CreateAscColor(oTextPr.TextFill.fill.color));else{oRGBAColor=oTextPr.TextFill.getRGBAColor();oInterfaceTextPr.put_Color(AscCommon.CreateAscColorCustom(oRGBAColor.R,oRGBAColor.G,oRGBAColor.B,false))}oProps.put_Opacity(AscFormat.isRealNumber(oTextPr.TextFill.transparent)?oTextPr.TextFill.transparent:255)}oProps.put_TextPr(oInterfaceTextPr); oContent.Set_ApplyToAll(false);return oProps};CShape.prototype.Restart_CheckSpelling=function(){this.recalcInfo.recalculateShapeStyleForParagraph=true;var content=this.getDocContent();content&&content.Restart_CheckSpelling()};CShape.prototype.Refresh_RecalcData=function(data){switch(data.Type){case AscDFH.historyitem_AutoShapes_SetDrawingBaseCoors:{break}case AscDFH.historyitem_AutoShapes_RemoveFromDrawingObjects:{break}case AscDFH.historyitem_AutoShapes_AddToDrawingObjects:{break}case AscDFH.historyitem_AutoShapes_SetWorksheet:{break}case AscDFH.historyitem_ShapeSetBDeleted:{break}case AscDFH.historyitem_ShapeSetNvSpPr:{break}case AscDFH.historyitem_ShapeSetSpPr:{break}case AscDFH.historyitem_ShapeSetStyle:{break}case AscDFH.historyitem_ShapeSetTxBody:{this.Refresh_RecalcData2(); break}case AscDFH.historyitem_ShapeSetTextBoxContent:{this.Refresh_RecalcData2();break}case AscDFH.historyitem_ShapeSetParent:{break}case AscDFH.historyitem_ShapeSetGroup:{break}case AscDFH.historyitem_ShapeSetBodyPr:{this.Refresh_RecalcData2();break}case AscDFH.historyitem_ShapeSetWordShape:{break}default:{this.Refresh_RecalcData2()}}};CShape.prototype.Refresh_RecalcData2=function(pageIndex){this.recalcContent();this.recalcContent2&&this.recalcContent2();this.recalcTransformText();this.addToRecalculate(); var oController=this.getDrawingObjectsController();if(oController&&AscFormat.getTargetTextObject(oController)===this){this.recalcInfo.recalcTitle=this.getDocContent();this.recalcInfo.bRecalculatedTitle=true}if(this.parent&&this.parent.getObjectType&&this.parent.getObjectType()===AscDFH.historyitem_type_Notes)if(this.parent.slide&&this.parent.slide.addToRecalculate)this.parent.slide.addToRecalculate()};CShape.prototype.Load_LinkData=function(linkData){};CShape.prototype.Get_PageContentStartPos=function(pageNum){if(this.textBoxContent)if(this.spPr&& this.spPr.geometry&&this.spPr.geometry.rect){var rect=this.spPr.geometry.rect;return{X:0,Y:0,XLimit:rect.r-rect.l,YLimit:2E4}}else return{X:0,Y:0,XLimit:this.extX,YLimit:2E4};return null};CShape.prototype.OnContentRecalculate=function(){};CShape.prototype.recalculateBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;this.draw(boundsChecker,this.localTransform,this.localTransformText);this.bounds.l=boundsChecker.Bounds.min_x;this.bounds.t=boundsChecker.Bounds.min_y;this.bounds.r= boundsChecker.Bounds.max_x;this.bounds.b=boundsChecker.Bounds.max_y;this.bounds.x=this.bounds.l;this.bounds.y=this.bounds.t;this.bounds.w=this.bounds.r-this.bounds.l;this.bounds.h=this.bounds.b-this.bounds.t};CShape.prototype.checkContentWordArt=function(oContent){return oContent.CheckRunContent(CheckWordArtTextPr)};CShape.prototype.checkNeedRecalcDocContentForTxWarp=function(oBodyPr){return oBodyPr&&oBodyPr.prstTxWarp&&oBodyPr.prstTxWarp.pathLst.length/2-(oBodyPr.prstTxWarp.pathLst.length/2>>0)> 0};CShape.prototype.chekBodyPrTransform=function(oBodyPr){return isRealObject(oBodyPr)&&isRealObject(oBodyPr.prstTxWarp)&&oBodyPr.prstTxWarp.preset!=="textNoShape"};CShape.prototype.checkTextWarp=function(oContent,oBodyPr,dWidth,dHeight,bNeedNoTransform,bNeedWarp){return AscFormat.ExecuteNoHistory(function(){var oRet={oTxWarpStruct:null,oTxWarpStructParamarks:null,oTxWarpStructNoTransform:null,oTxWarpStructParamarksNoTransform:null};if(window["IS_NATIVE_EDITOR"])return oRet;var bTransform=this.chekBodyPrTransform(oBodyPr)&& bNeedWarp;var warpGeometry=oBodyPr.prstTxWarp;warpGeometry&&warpGeometry.Recalculate(dWidth,dHeight);this.recalcInfo.warpGeometry=warpGeometry;var bCheckWordArtContent=this.checkContentWordArt(oContent);var bColumns=oContent.Get_ColumnsCount()>1;var bContentRecalculated=false;if(bTransform||bCheckWordArtContent){var bNeedRecalc=this.checkNeedRecalcDocContentForTxWarp(oBodyPr),dOneLineWidth,dMinPolygonLength=0,dKoeff=1;var oTheme=this.Get_Theme(),oColorMap=this.Get_ColorMap();var oTextDrawer=new AscFormat.CTextDrawer(dWidth, dHeight,true,oTheme,bNeedRecalc);oTextDrawer.bCheckLines=bTransform&&bNeedWarp;var oContentToDraw=oContent;if(bNeedRecalc&&bNeedWarp){oContentToDraw=oContent.Copy(oContent.Parent,oContent.DrawingDocument);var bNeedTurnOn=false;if(this.bWordShape&&editor&&editor.WordControl.m_oLogicDocument)if(!editor.WordControl.m_oLogicDocument.TurnOffRecalc){bNeedTurnOn=true;editor.WordControl.m_oLogicDocument.TurnOff_Recalculate()}oContentToDraw.Set_ApplyToAll(true);oContentToDraw.SetParagraphSpacing({Before:0, After:0});oContentToDraw.Set_ApplyToAll(false);if(bNeedTurnOn)editor.WordControl.m_oLogicDocument.TurnOn_Recalculate(false);dMinPolygonLength=warpGeometry.getMinPathPolygonLength();dOneLineWidth=AscFormat.GetRectContentWidth(oContentToDraw);if(dOneLineWidth>dMinPolygonLength){dKoeff=dMinPolygonLength/dOneLineWidth;oContentToDraw.Reset(0,0,dOneLineWidth,2E4)}else oContentToDraw.Reset(0,0,dMinPolygonLength,2E4);oContentToDraw.Recalculate_Page(0,true)}else if(bTransform&&bColumns){oContentToDraw=oContent.Copy(oContent.Parent, oContent.DrawingDocument);oContentToDraw.Reset(0,0,oContent.XLimit,2E4);oContentToDraw.Recalculate_Page(0,true)}var dContentHeight=oContentToDraw.GetSummaryHeight();var OldShowParaMarks,width_=dWidth*dKoeff,height_=dHeight*dKoeff;if(isRealObject(editor)){OldShowParaMarks=editor.ShowParaMarks;editor.ShowParaMarks=true}if(bNeedWarp){oContentToDraw.Draw(oContentToDraw.StartPage,oTextDrawer);oRet.oTxWarpStructParamarks=oTextDrawer.m_oDocContentStructure;oRet.oTxWarpStructParamarks.Recalculate(oTheme, oColorMap,width_,height_,this);if(bTransform){oRet.oTxWarpStructParamarks.checkByWarpStruct(warpGeometry,dWidth,dHeight,oTheme,oColorMap,this,dOneLineWidth,oContentToDraw.XLimit,dContentHeight,dKoeff);if(bNeedNoTransform&&bCheckWordArtContent){if(oRet.oTxWarpStructParamarks.m_aComments.length>0){oContent.Recalculate_Page(0,true);bContentRecalculated=true}oContent.Draw(oContent.StartPage,oTextDrawer);oRet.oTxWarpStructParamarksNoTransform=oTextDrawer.m_oDocContentStructure;oRet.oTxWarpStructParamarksNoTransform.Recalculate(oTheme, oColorMap,dWidth,dHeight,this);oRet.oTxWarpStructParamarksNoTransform.checkUnionPaths()}}else{oRet.oTxWarpStructParamarks.checkUnionPaths();if(bNeedNoTransform&&bCheckWordArtContent)oRet.oTxWarpStructParamarksNoTransform=oRet.oTxWarpStructParamarks}}else if(bNeedNoTransform&&bCheckWordArtContent){oContent.Draw(oContent.StartPage,oTextDrawer);oRet.oTxWarpStructParamarksNoTransform=oTextDrawer.m_oDocContentStructure;oRet.oTxWarpStructParamarksNoTransform.Recalculate(oTheme,oColorMap,dWidth,dHeight, this);oRet.oTxWarpStructParamarksNoTransform.checkUnionPaths()}if(isRealObject(editor))editor.ShowParaMarks=false;if(bNeedWarp){oContentToDraw.Draw(oContentToDraw.StartPage,oTextDrawer);oRet.oTxWarpStruct=oTextDrawer.m_oDocContentStructure;oRet.oTxWarpStruct.Recalculate(oTheme,oColorMap,width_,height_,this);if(bTransform){oRet.oTxWarpStruct.checkByWarpStruct(warpGeometry,dWidth,dHeight,oTheme,oColorMap,this,dOneLineWidth,oContentToDraw.XLimit,dContentHeight,dKoeff);if(bNeedNoTransform&&bCheckWordArtContent){if(oRet.oTxWarpStruct.m_aComments.length> 0&&!bContentRecalculated)oContent.Recalculate_Page(0,true);oContent.Draw(oContent.StartPage,oTextDrawer);oRet.oTxWarpStructNoTransform=oTextDrawer.m_oDocContentStructure;oRet.oTxWarpStructNoTransform.Recalculate(oTheme,oColorMap,dWidth,dHeight,this);oRet.oTxWarpStructNoTransform.checkUnionPaths()}}else{oRet.oTxWarpStruct.checkUnionPaths();if(bNeedNoTransform&&bCheckWordArtContent)oRet.oTxWarpStructNoTransform=oRet.oTxWarpStruct}}else if(bNeedNoTransform&&bCheckWordArtContent){oContent.Draw(oContent.StartPage, oTextDrawer);oRet.oTxWarpStructNoTransform=oTextDrawer.m_oDocContentStructure;oRet.oTxWarpStructNoTransform.Recalculate(oTheme,oColorMap,dWidth,dHeight,this);oRet.oTxWarpStructNoTransform.checkUnionPaths()}if(isRealObject(editor))editor.ShowParaMarks=OldShowParaMarks}return oRet},this,[])};CShape.prototype.checkTypeCorrect=function(){if(!this.spPr)return false;return true};CShape.prototype.getColumnNumber=function(){if(this.bWordShape)return 1;var oBodyPr=this.getBodyPr();if(AscFormat.isRealNumber(oBodyPr.numCol))return oBodyPr.numCol; return 1};CShape.prototype.getColumnSpace=function(){if(this.bWordShape)return 0;var oBodyPr=this.getBodyPr();if(AscFormat.isRealNumber(oBodyPr.spcCol))return oBodyPr.spcCol;return 0};CShape.prototype.getTextFitType=function(){var oBodyPr=this.getBodyPr();if(AscCommon.isRealObject(oBodyPr.textFit)&&AscFormat.isRealNumber(oBodyPr.textFit.type))return oBodyPr.textFit.type;return AscFormat.text_fit_No};CShape.prototype.getVertOverflowType=function(){var oBodyPr=this.getBodyPr();if(AscFormat.isRealNumber(oBodyPr.vertOverflow))return oBodyPr.vertOverflow; return AscFormat.nOTOwerflow};CShape.prototype.checkWrap=function(){if(!this.txBody)return;var new_body_pr=this.getBodyPr();if(new_body_pr)if(new_body_pr.numCol>1)if(new_body_pr.wrap===AscFormat.nTWTNone){new_body_pr=new_body_pr.createDuplicate();new_body_pr.wrap=AscFormat.nTWTSquare;this.txBody.setBodyPr(new_body_pr)}};CShape.prototype.setColumnNumber=function(num){if(!this.bWordShape&&!CheckObjectLine(this)){var new_body_pr=this.getBodyPr();if(new_body_pr){new_body_pr=new_body_pr.createDuplicate(); new_body_pr.numCol=num>>0;if(!this.txBody)this.createTextBody();if(this.txBody)this.txBody.setBodyPr(new_body_pr);this.checkWrap()}}};CShape.prototype.setColumnSpace=function(spcCol){if(!this.bWordShape&&!CheckObjectLine(this)){var new_body_pr=this.getBodyPr();if(new_body_pr){new_body_pr=new_body_pr.createDuplicate();new_body_pr.spcCol=spcCol;if(!this.txBody)this.createTextBody();if(this.txBody)this.txBody.setBodyPr(new_body_pr);this.checkWrap()}}};CShape.prototype.GetAllContentControls=function(arrContentControls){var oContent= this.getDocContent();if(oContent)oContent.GetAllContentControls(arrContentControls)};CShape.prototype.getCopyWithSourceFormatting=function(){var oCopy=this.copy(undefined);if(this.pen||this.brush){if(!oCopy.spPr){oCopy.setSpPr(AscFormat.CSpPr());oCopy.spPr.setParent(oCopy)}if(this.brush)oCopy.spPr.setFill(this.brush.saveSourceFormatting());if(this.pen)oCopy.spPr.setLn(this.pen.createDuplicate(true))}if(oCopy.txBody&&oCopy.txBody.content){var oTheme=this.Get_Theme();var oColorMap=this.Get_ColorMap(); if(this.txBody&&this.txBody.content)SaveContentSourceFormatting(this.txBody.content.Content,oCopy.txBody.content.Content,oTheme,oColorMap)}if(oCopy.isPlaceholder()&&!this.recalcInfo.recalculateTransform){var oXfrm=oCopy.spPr.xfrm;if(!oXfrm||!oXfrm.isNotNull()){oCopy.x=this.x;oCopy.y=this.y;oCopy.extX=this.extX;oCopy.extY=this.extY;AscFormat.CheckSpPrXfrm(oCopy,true)}}return oCopy};CShape.prototype.getSignatureLineGuid=function(){if(this.signatureLine)return this.signatureLine.id;return null};CShape.prototype.GetAllFields= function(isUseSelection,arrFields){var oContent=this.getDocContent();if(oContent)return oContent.GetAllFields(isUseSelection,arrFields);return arrFields?arrFields:[]};CShape.prototype.GetAllSeqFieldsByType=function(sType,aFields){var oContent=this.getDocContent();if(oContent)return oContent.GetAllSeqFieldsByType(sType,aFields)};CShape.prototype.Get_TextBackGroundColor=function(){if(!this.brush)return undefined;var oTheme=this.Get_Theme&&this.Get_Theme();var oColorMap=this.Get_ColorMap&&this.Get_ColorMap(); if(oTheme&&oColorMap)this.brush.check(oTheme,oColorMap);return this.brush.Get_TextBackGroundColor()};CShape.prototype.checkResetAutoFit=function(bCheckMinVal){if(this.txBody){var oCompiledBodyPr=this.getBodyPr();var oNewBodyPr;var oTextFit=oCompiledBodyPr.textFit;if(oTextFit)if(oTextFit.type===AscFormat.text_fit_NormAuto)if(AscFormat.isRealNumber(oTextFit.fontScale))if(oTextFit.fontScale<1E5){var bReset=false;if(bCheckMinVal){if(oTextFit.fontScale<=25E3){bReset=true;var oContent=this.txBody.content; if(oContent)oContent.CheckRunContent(function(oRun){var oTextPr=oRun.Pr;var oCompiledPr=oRun.CompiledPr;if(AscFormat.isRealNumber(oTextPr.FontSize)&&AscFormat.isRealNumber(oCompiledPr.FontSize)&&oTextPr.FontSize!==oCompiledPr.FontSize){oRun.Set_FontSize(oCompiledPr.FontSize);if(oRun.IsParaEndRun()){var oParagraph=oRun.Paragraph;if(oParagraph)oParagraph.TextPr.Apply_TextPr(oTextPr)}}})}}else bReset=true;if(bReset){oNewBodyPr=oCompiledBodyPr.createDuplicate();oNewBodyPr.textFit=new AscFormat.CTextFit; oNewBodyPr.textFit.type=AscFormat.text_fit_No;this.txBody.setBodyPr(oNewBodyPr)}}}};function CreateBinaryReader(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";for(;index<srcLen;){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);if(isNaN(dstLen))return null;var pointer=g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data; if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<= 6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream}function getParaDrawing(oDrawing){var oCurDrawing=oDrawing;while(oCurDrawing.group)oCurDrawing=oCurDrawing.group;if(oCurDrawing.parent instanceof ParaDrawing)return oCurDrawing.parent;return null}function checkDrawingsTransformBeforePaste(oEndContent,oSourceContent,oTempParent){var i,j;for(i=0;i<oEndContent.Drawings.length;++i){var shape=oEndContent.Drawings[i].Drawing; if(shape.isPlaceholder&&shape.isPlaceholder()&&(!shape.spPr||!shape.spPr.xfrm||!shape.spPr.xfrm.isNotNull())){var oOldParent=shape.parent;shape.parent=oTempParent;var hierarchy=shape.getHierarchy();for(j=0;j<hierarchy.length;++j)if(hierarchy[j]&&hierarchy[j].spPr&&hierarchy[j].spPr.xfrm&&hierarchy[j].spPr.xfrm.isNotNull())break;if(j===hierarchy.length)if(oSourceContent.Drawings[i]&&oSourceContent.Drawings[i].Drawing){var oSourceShape=oSourceContent.Drawings[i].Drawing;if(oSourceShape&&oSourceShape.spPr&& oSourceShape.spPr.xfrm&&oSourceShape.spPr.xfrm.isNotNull()){shape.x=oSourceShape.spPr.xfrm.offX;shape.y=oSourceShape.spPr.xfrm.offY;shape.extX=oSourceShape.spPr.xfrm.extX;shape.extY=oSourceShape.spPr.xfrm.extY;AscFormat.CheckSpPrXfrm(shape)}}shape.parent=oOldParent}}}function SaveSourceFormattingTextPr(oTextPr,oTheme,oColorMap){oTextPr.ReplaceThemeFonts(oTheme.themeElements.fontScheme);if(oTextPr.Unifill){oTextPr.Unifill.check(oTheme,oColorMap);oTextPr.Unifill=oTextPr.Unifill.saveSourceFormatting()}if(oTextPr.TextOutline&& oTextPr.TextOutline.Fill){oTextPr.TextOutline.Fill.check(oTheme,oColorMap);oTextPr.TextOutline.Fill=oTextPr.TextOutline.Fill.saveSourceFormatting()}return oTextPr}function SaveContentSourceFormatting(aSourceContent,aCopyContent,oTheme,oColorMap){if(aCopyContent.length===aSourceContent.length){var bMergeRunPr=aCopyContent===aSourceContent;var oElem;for(var i=0;i<aSourceContent.length;++i){oElem=aSourceContent[i];if(oElem.CompiledPr.Pr){var oPr=oElem.CompiledPr.Pr.ParaPr.Copy();oPr.DefaultRunPr=SaveSourceFormattingTextPr(oElem.CompiledPr.Pr.TextPr.Copy(), oTheme,oColorMap);aCopyContent[i].Set_Pr(oPr);SaveRunsFormatting(oElem.Content,aCopyContent[i].Content,oTheme,oColorMap,oPr)}else if(aCopyContent[i].Pr&&aCopyContent[i].Pr.DefaultRunPr&&aCopyContent[i].Pr.DefaultRunPr.Unifill){var oPr=aCopyContent[i].Pr.Copy();oPr.DefaultRunPr.Unifill.check(oTheme,oColorMap);oPr.DefaultRunPr.Unifill=oPr.DefaultRunPr.Unifill.saveSourceFormatting();oPr.DefaultRunPr=SaveSourceFormattingTextPr(oPr.DefaultRunPr.Copy(),oTheme,oColorMap);aCopyContent[i].Set_Pr(oPr)}}}}function SaveRunsFormatting(aSourceContent, aCopyContent,oTheme,oColorMap,oPr){var bMergeRunPr=aCopyContent===aSourceContent;for(var i=0;i<aCopyContent.length;++i)if(aCopyContent[i]instanceof ParaRun&&aCopyContent[i].Pr)if(bMergeRunPr){var oCoprPr=oPr.DefaultRunPr.Copy();oCoprPr.Merge(SaveSourceFormattingTextPr(aCopyContent[i].Pr.Copy(),oTheme,oColorMap));aCopyContent[i].Set_Pr(oCoprPr)}else aCopyContent[i].Set_Pr(SaveSourceFormattingTextPr(aCopyContent[i].Pr.Copy(),oTheme,oColorMap));else if(aSourceContent[i].Content){var oElem=aSourceContent[i]; SaveRunsFormatting(oElem.Content,aCopyContent[i].Content,oTheme,oColorMap,oPr);if(oElem.Get_CompiledCtrPrp&&aCopyContent[i].setCtrPrp){var oCtrPr=oElem.Get_CompiledCtrPrp();aCopyContent[i].setCtrPrp(oCtrPr)}}else if(aSourceContent[i]instanceof AscCommonWord.ParaMath&&aSourceContent[i].Root&&aSourceContent[i].Root.Content)SaveRunsFormatting(aSourceContent[i].Root.Content,aCopyContent[i].Root.Content,oTheme,oColorMap,oPr)}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CheckObjectLine= CheckObjectLine;window["AscFormat"].CreateUniFillByUniColorCopy=CreateUniFillByUniColorCopy;window["AscFormat"].CreateUniFillByUniColor=CreateUniFillByUniColor;window["AscFormat"].ConvertParagraphToPPTX=ConvertParagraphToPPTX;window["AscFormat"].ConvertElementsToPPTX=ConvertElementsToPPTX;window["AscFormat"].ConvertParagraphToWord=ConvertParagraphToWord;window["AscFormat"].SetXfrmFromMetrics=SetXfrmFromMetrics;window["AscFormat"].CShape=CShape;window["AscFormat"].CreateBinaryReader=CreateBinaryReader; window["AscFormat"].getParaDrawing=getParaDrawing;window["AscFormat"].ConvertGraphicFrameToWordTable=ConvertGraphicFrameToWordTable;window["AscFormat"].ConvertTableToGraphicFrame=ConvertTableToGraphicFrame;window["AscFormat"].CSignatureLine=CSignatureLine;window["AscFormat"].checkDrawingsTransformBeforePaste=checkDrawingsTransformBeforePaste;window["AscFormat"].SaveContentSourceFormatting=SaveContentSourceFormatting;window["AscFormat"].hitToHandles=hitToHandles})(window);"use strict";(function(undefined){var CONNECTOR_MARGIN= 6.35;function ConnectionParams(){this.bounds=new AscFormat.CGraphicBounds(0,0,0,0);this.dir=AscFormat.CARD_DIRECTION_E;this.x=0;this.y=0;this.idx=0}ConnectionParams.prototype.copy=function(){var _c=new ConnectionParams;_c.bounds.fromOther(this.bounds);_c.dir=this.dir;_c.x=this.x;_c.y=this.y;_c.idx=this.idx;return _c};ConnectionParams.prototype.transform=function(oTransform){this.bounds.transform(oTransform);var _x=oTransform.TransformPointX(this.x,this.y);var _y=oTransform.TransformPointY(this.x, this.y);this.x=_x;this.y=_y};function fCalculateSpPr(begin,end,sPreset,penW){return AscFormat.ExecuteNoHistory(function(){var oSpPr=new AscFormat.CSpPr;var oXfrm=new AscFormat.CXfrm;oSpPr.setXfrm(oXfrm);oXfrm.setParent(oSpPr);var _begin=begin.copy();var _end=end.copy();var fAngle=0;if(!penW)penW=12700;switch(begin.dir){case AscFormat.CARD_DIRECTION_N:{fAngle=Math.PI/2;switch(_end.dir){case AscFormat.CARD_DIRECTION_N:{_end.dir=AscFormat.CARD_DIRECTION_E;break}case AscFormat.CARD_DIRECTION_S:{_end.dir= AscFormat.CARD_DIRECTION_W;break}case AscFormat.CARD_DIRECTION_W:{_end.dir=AscFormat.CARD_DIRECTION_N;break}case AscFormat.CARD_DIRECTION_E:{_end.dir=AscFormat.CARD_DIRECTION_S;break}}break}case AscFormat.CARD_DIRECTION_S:{fAngle=-Math.PI/2;switch(_end.dir){case AscFormat.CARD_DIRECTION_N:{_end.dir=AscFormat.CARD_DIRECTION_W;break}case AscFormat.CARD_DIRECTION_S:{_end.dir=AscFormat.CARD_DIRECTION_E;break}case AscFormat.CARD_DIRECTION_W:{_end.dir=AscFormat.CARD_DIRECTION_S;break}case AscFormat.CARD_DIRECTION_E:{_end.dir= AscFormat.CARD_DIRECTION_N;break}}break}case AscFormat.CARD_DIRECTION_W:{fAngle=Math.PI;switch(_end.dir){case AscFormat.CARD_DIRECTION_N:{_end.dir=AscFormat.CARD_DIRECTION_S;break}case AscFormat.CARD_DIRECTION_S:{_end.dir=AscFormat.CARD_DIRECTION_N;break}case AscFormat.CARD_DIRECTION_W:{_end.dir=AscFormat.CARD_DIRECTION_E;break}case AscFormat.CARD_DIRECTION_E:{_end.dir=AscFormat.CARD_DIRECTION_W;break}}break}default:{fAngle=0;break}}var oTransform=new AscCommon.CMatrix;AscCommon.global_MatrixTransformer.RotateRadAppend(oTransform, -fAngle);_begin.transform(oTransform);_end.transform(oTransform);var extX=Math.max(0,Math.abs(_end.x-_begin.x));var extY=Math.max(0,Math.abs(_end.y-_begin.y));if(Math.abs(extX)<.5)extX=0;if(Math.abs(extY)<.5)extY=0;var flipV=false;var flipH=false;var rot=0;var oMapAdj={};if(sPreset==="line"||sPreset.indexOf("straightConnector")>-1){flipH=_begin.x>_end.x;flipV=_begin.y>_end.y}else{var sPrefix="bentConnector";if(sPreset.indexOf("curvedConnector")>-1)sPrefix="curvedConnector";switch(_end.dir){case AscFormat.CARD_DIRECTION_N:{if(_end.bounds.l> _begin.bounds.r)if(_end.bounds.t<_begin.y)if(_end.y<=_begin.y){sPreset="4";flipV=true;oMapAdj["adj1"]=1E5*(((_begin.bounds.r+_end.bounds.l)/2-_begin.x)/extX)+.5>>0;oMapAdj["adj2"]=1E5*(_begin.y-(_end.bounds.t-CONNECTOR_MARGIN))/extY+.5>>0}else{sPreset="4";oMapAdj["adj1"]=1E5*(((_begin.bounds.r+_end.bounds.l)/2-_begin.x)/extX)+.5>>0;oMapAdj["adj2"]=-1E5*((_begin.y-(_end.bounds.t-CONNECTOR_MARGIN))/extY)+.5>>0}else sPreset="2";else if(_end.bounds.t>_begin.bounds.b)if(_end.x<_begin.x){sPreset="4";flipH= true;oMapAdj["adj1"]=-(1E5*(_begin.bounds.r+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]=1E5*((_end.bounds.t+_begin.bounds.b)/2-_begin.y)/extY>>0}else sPreset="2";else if(_end.bounds.b<_begin.bounds.t)if(_end.x<_begin.x){sPreset="4";flipH=true;flipV=true;oMapAdj["adj1"]=-(1E5*(_begin.bounds.r+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]=1E5*(_begin.y-(_end.bounds.t-CONNECTOR_MARGIN))/extY+.5>>0}else{sPreset="4";flipV=true;oMapAdj["adj1"]=1E5*(Math.max(_begin.bounds.r,_end.bounds.r)+ CONNECTOR_MARGIN-_begin.x)/extX>>0;oMapAdj["adj2"]=1E5*(_begin.y-(_end.bounds.t-CONNECTOR_MARGIN))/extY+.5>>0}else if(_end.y<_begin.y)if(_end.x<_begin.x){sPreset="4";flipH=true;flipV=true;oMapAdj["adj1"]=-(1E5*(_begin.bounds.r+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]=1E5*(_begin.y-(_end.bounds.t-CONNECTOR_MARGIN))/extY+.5>>0}else{sPreset="4";flipV=true;oMapAdj["adj1"]=1E5*(Math.max(_begin.bounds.r,_end.bounds.r)+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0;oMapAdj["adj2"]=1E5*(_begin.y-(_end.bounds.t- CONNECTOR_MARGIN))/extY+.5>>0}else if(_end.x>_begin.x)sPreset="2";else{sPreset="4";flipH=true;oMapAdj["adj1"]=-(1E5*(Math.max(_begin.bounds.r,_end.bounds.r)+CONNECTOR_MARGIN-_begin.x)/extX+.5)>>0;oMapAdj["adj2"]=-(1E5*(_begin.y-(Math.min(_begin.bounds.t,_end.bounds.t)-CONNECTOR_MARGIN))/extY+.5>>0)}break}case AscFormat.CARD_DIRECTION_S:{if(_end.bounds.l>_begin.bounds.r)if(_end.bounds.b<_begin.y){sPreset="2";flipV=true}else if(_end.y<_begin.y){sPreset="4";flipV=true;oMapAdj["adj2"]=-(1E5*((_end.bounds.b+ CONNECTOR_MARGIN-_end.y)/extY)+.5>>0);oMapAdj["adj1"]=1E5*((_begin.bounds.r+_end.bounds.l)/2-_begin.x)/extX+.5>>0}else{sPreset="4";oMapAdj["adj1"]=1E5*(((_begin.bounds.r+_end.bounds.l)/2-_begin.x)/extX)+.5>>0;oMapAdj["adj2"]=1E5+(1E5*((_end.bounds.b+CONNECTOR_MARGIN-_end.y)/extY)+.5>>0)}else if(_end.bounds.b<_begin.bounds.t)if(_end.x>_begin.bounds.r){sPreset="2";flipV=true}else{sPreset="4";flipH=true;flipV=true;oMapAdj["adj1"]=-(1E5*(_begin.bounds.r+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]= 1E5*(_begin.y-(_end.bounds.b+_begin.bounds.t)/2)/extY+.5>>0}else if(_end.x<_begin.x)if(_end.y>_begin.y){sPreset="4";flipH=true;oMapAdj["adj1"]=-(1E5*(Math.max(_begin.bounds.r,_end.bounds.r)+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]=1E5*((Math.max(_end.bounds.b,_begin.bounds.b)-_begin.y+CONNECTOR_MARGIN)/extY)+.5>>0}else{sPreset="4";flipH=true;flipV=true;oMapAdj["adj1"]=-(1E5*(Math.max(_begin.bounds.r,_end.bounds.r)+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]=-(1E5*((Math.max(_end.bounds.b, _begin.bounds.b)-_begin.y+CONNECTOR_MARGIN)/extY)+.5)>>0}else if(_end.y>_begin.y){sPreset="4";oMapAdj["adj1"]=1E5*(Math.max(_begin.bounds.r,_end.bounds.r)+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0;oMapAdj["adj2"]=1E5*(_end.bounds.b+CONNECTOR_MARGIN-_begin.y)/extY+.5>>0}else{sPreset="2";flipV=true}break}case AscFormat.CARD_DIRECTION_W:{if(_begin.x<_end.x){sPreset="3";flipV=_begin.y>_end.y}else{sPreset="5";if(_end.bounds.t>_begin.bounds.b){flipH=true;oMapAdj["adj1"]=-(1E5*(_begin.bounds.r+CONNECTOR_MARGIN- _begin.x)/extX+.5>>0);oMapAdj["adj2"]=1E5*((_end.bounds.t+_begin.bounds.b)/2-_begin.y)/extY+.5>>0;oMapAdj["adj3"]=1E5*(_begin.x-(_end.bounds.l-CONNECTOR_MARGIN))/extX+.5>>0}else if(_end.bounds.b<_begin.bounds.t){flipH=true;flipV=true;oMapAdj["adj1"]=-(1E5*(_begin.bounds.r+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]=1E5*(_begin.y-(_end.bounds.b+_begin.bounds.t)/2)/extY+.5>>0;oMapAdj["adj3"]=1E5*(_begin.x-(_end.bounds.l-CONNECTOR_MARGIN))/extX+.5>>0}else if(_end.y>_begin.y){flipH=true;oMapAdj["adj1"]= -(1E5*(_begin.bounds.r+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]=1E5*(Math.max(_begin.bounds.b,_end.bounds.b)+CONNECTOR_MARGIN-_begin.y)/extY+.5>>0;oMapAdj["adj3"]=1E5*(_begin.x-(_end.bounds.l-CONNECTOR_MARGIN))/extX+.5>>0}else{flipH=true;flipV=true;oMapAdj["adj1"]=-(1E5*(_begin.bounds.r+CONNECTOR_MARGIN-_begin.x)/extX+.5>>0);oMapAdj["adj2"]=1E5*(_begin.y-(Math.min(_begin.bounds.t,_end.bounds.t)-CONNECTOR_MARGIN))/extY+.5>>0;oMapAdj["adj3"]=1E5*(_begin.x-(_end.bounds.l-CONNECTOR_MARGIN))/ extX+.5>>0}}break}case AscFormat.CARD_DIRECTION_E:{if(_end.bounds.l>_begin.bounds.r)if(_end.bounds.b<_begin.y){sPreset="3";flipV=true;oMapAdj["adj1"]=1E5*(_end.bounds.r+CONNECTOR_MARGIN-_begin.x)/extX>>0}else if(_end.bounds.t>_begin.y){sPreset="3";oMapAdj["adj1"]=1E5+(1E5*(CONNECTOR_MARGIN/extX)+.5)>>0}else if(_end.y<_begin.y){sPreset="5";flipV=true;oMapAdj["adj1"]=1E5*((_end.bounds.l+_begin.bounds.r)/2-_begin.x)/extX+.5>>0;oMapAdj["adj2"]=1E5+1E5*(_end.y-(_end.bounds.t-CONNECTOR_MARGIN))/extY+.5>> 0;oMapAdj["adj3"]=1E5+(1E5*(_end.bounds.r+CONNECTOR_MARGIN-_end.x)/extX+.5)>>0}else{sPreset="5";oMapAdj["adj1"]=1E5*((_end.bounds.l+_begin.bounds.r)/2-_begin.x)/extX+.5>>0;oMapAdj["adj2"]=-(1E5*(_begin.y-(_end.bounds.t-CONNECTOR_MARGIN))/extY+.5)>>0;oMapAdj["adj3"]=1E5+(1E5*(_end.bounds.r+CONNECTOR_MARGIN-_end.x)/extX+.5)>>0}else if(_end.x>=_begin.bounds.l||_end.y>_begin.bounds.b||_end.y<_begin.bounds.t)if(_end.y<_begin.y)if(_end.x<_begin.x){flipH=true;flipV=true;sPreset="3";oMapAdj["adj1"]=-(1E5* (Math.max(_end.bounds.r,_begin.bounds.r)+CONNECTOR_MARGIN-_begin.x)/extX+.5)>>0}else{flipV=true;sPreset="3";oMapAdj["adj1"]=1E5+(1E5*(Math.max(_end.bounds.r,_begin.bounds.r)+CONNECTOR_MARGIN-_end.x)/extX+.5)>>0}else if(_end.x<_begin.x){flipH=true;sPreset="3";oMapAdj["adj1"]=-(1E5*(Math.max(_end.bounds.r,_begin.bounds.r)+CONNECTOR_MARGIN-_begin.x)/extX+.5)>>0}else{sPreset="3";oMapAdj["adj1"]=1E5+(1E5*(Math.max(_end.bounds.r,_begin.bounds.r)+CONNECTOR_MARGIN-_end.x)/extX+.5)>>0}else if(_end.y>=_begin.y){sPreset= "5";flipH=true;oMapAdj["adj1"]=-(1E5*(CONNECTOR_MARGIN/extX)+.5>>0);oMapAdj["adj2"]=1E5+1E5*(_begin.bounds.b+CONNECTOR_MARGIN-_end.y)/extY+.5>>0;oMapAdj["adj3"]=1E5*(_begin.x-(_end.bounds.r+_begin.bounds.l)/2)/extX+.5>>0}else{sPreset="5";flipH=true;flipV=true;oMapAdj["adj1"]=-(1E5*(CONNECTOR_MARGIN/extX)+.5>>0);oMapAdj["adj2"]=-(1E5*(_begin.bounds.b+CONNECTOR_MARGIN-_begin.y)/extY+.5)>>0;oMapAdj["adj3"]=1E5*(_begin.x-(_end.bounds.r+_begin.bounds.l)/2)/extX+.5>>0}break}}sPreset=sPrefix+sPreset}var _posX= (end.x+begin.x)/2-extX/2;var _posY=(end.y+begin.y)/2-extY/2;var _fAng=AscFormat.normalizeRotate(rot-fAngle);var oGeometry=AscFormat.CreateGeometry(sPreset);for(var key in oMapAdj)if(oMapAdj.hasOwnProperty(key))oGeometry.setAdjValue(key,oMapAdj[key]);oSpPr.setGeometry(oGeometry);oGeometry.setParent(oSpPr);oXfrm.setOffX(_posX);oXfrm.setOffY(_posY);oXfrm.setExtX(extX);oXfrm.setExtY(extY);oXfrm.setRot(_fAng);oXfrm.setFlipH(flipH);oXfrm.setFlipV(flipV);return oSpPr},this,[])}function fCalculateConnectionInfo(oConnInfo, x,y){var oConnecInfo2=new ConnectionParams;oConnecInfo2.x=x;oConnecInfo2.y=y;oConnecInfo2.bounds.fromOther(new AscFormat.CGraphicBounds(x,y,x,y));var diffX=x-oConnInfo.x;var diffY=y-oConnInfo.y;if(Math.abs(diffX)>Math.abs(diffY))if(diffX<0)oConnecInfo2.dir=AscFormat.CARD_DIRECTION_E;else oConnecInfo2.dir=AscFormat.CARD_DIRECTION_W;else if(diffY<0)oConnecInfo2.dir=AscFormat.CARD_DIRECTION_S;else oConnecInfo2.dir=AscFormat.CARD_DIRECTION_N;return oConnecInfo2}function CConnectionShape(){AscFormat.CShape.call(this)} CConnectionShape.prototype=Object.create(AscFormat.CShape.prototype);CConnectionShape.prototype.constructor=CConnectionShape;CConnectionShape.prototype.getObjectType=function(){return AscDFH.historyitem_type_Cnx};CConnectionShape.prototype.copy=function(oPr){var copy=new CConnectionShape;this.fillObject(copy);return copy};CConnectionShape.prototype.resetShape=function(oShape){if(!this.nvSpPr)return;var cnxPr=this.nvSpPr.nvUniSpPr;if(cnxPr.stCnxId===oShape.Id||cnxPr.endCnxId===oShape.Id){var oNewPr= cnxPr.copy();if(cnxPr.stCnxId===oShape.Id){oNewPr.stCnxId=null;oNewPr.stCnxIdx=null}if(cnxPr.endCnxId===oShape.Id){oNewPr.endCnxId=null;oNewPr.endCnxIdx=null}this.nvSpPr.setUniSpPr(oNewPr)}};CConnectionShape.prototype.getStCxnId=function(){return this.nvSpPr.nvUniSpPr.stCnxId};CConnectionShape.prototype.getEndCxnId=function(){return this.nvSpPr.nvUniSpPr.endCnxId};CConnectionShape.prototype.getStCxnIdx=function(){return this.nvSpPr.nvUniSpPr.stCnxIdx};CConnectionShape.prototype.getEndCxnIdx=function(){return this.nvSpPr.nvUniSpPr.endCnxIdx}; CConnectionShape.prototype.calculateTransform=function(bMove){var oBeginDrawing=null;var oEndDrawing=null;var sStId=this.getStCxnId();var sEndId=this.getEndCxnId();var _group;if(null!==sStId){oBeginDrawing=AscCommon.g_oTableId.Get_ById(sStId);if(oBeginDrawing&&oBeginDrawing.bDeleted)oBeginDrawing=null;if(oBeginDrawing){_group=oBeginDrawing.getMainGroup();if(_group)_group.recalculate();else oBeginDrawing.recalculate()}}if(null!==sEndId){oEndDrawing=AscCommon.g_oTableId.Get_ById(sEndId);if(oEndDrawing&& oEndDrawing.bDeleted)oEndDrawing=null;if(oEndDrawing){_group=oEndDrawing.getMainGroup();if(_group)_group.recalculate();else oEndDrawing.recalculate()}}var _startConnectionParams,_endConnectionParams,_spPr,_xfrm2;var _xfrm=this.spPr.xfrm;if(oBeginDrawing&&oEndDrawing){_startConnectionParams=oBeginDrawing.getConnectionParams(this.getStCxnIdx(),null);_endConnectionParams=oEndDrawing.getConnectionParams(this.getEndCxnIdx(),null);_spPr=AscFormat.fCalculateSpPr(_startConnectionParams,_endConnectionParams, this.spPr.geometry.preset,this.pen.w);_xfrm2=_spPr.xfrm;_xfrm.setExtX(_xfrm2.extX);_xfrm.setExtY(_xfrm2.extY);if(!this.group){_xfrm.setOffX(_xfrm2.offX);_xfrm.setOffY(_xfrm2.offY);_xfrm.setFlipH(_xfrm2.flipH);_xfrm.setFlipV(_xfrm2.flipV);_xfrm.setRot(_xfrm2.rot)}else{var _xc=_xfrm2.offX+_xfrm2.extX/2;var _yc=_xfrm2.offY+_xfrm2.extY/2;var xc=this.group.invertTransform.TransformPointX(_xc,_yc);var yc=this.group.invertTransform.TransformPointY(_xc,_yc);_xfrm.setOffX(xc-_xfrm2.extX/2);_xfrm.setOffY(yc- _xfrm2.extY/2);_xfrm.setFlipH(this.group.getFullFlipH()?!_xfrm2.flipH:_xfrm2.flipH);_xfrm.setFlipV(this.group.getFullFlipV()?!_xfrm2.flipV:_xfrm2.flipV);_xfrm.setRot(AscFormat.normalizeRotate(_xfrm2.rot-this.group.getFullRotate()))}this.spPr.setGeometry(_spPr.geometry.createDuplicate());this.checkDrawingBaseCoords();this.recalculate()}else if(oBeginDrawing||oEndDrawing)if(bMove){var _x,_y;var _spX,_spY,diffX,diffY,bChecked=false;var _oCnxInfo;var _groupTransform;if(oBeginDrawing){_oCnxInfo=oBeginDrawing.getGeom().cnxLst[this.getStCxnIdx()]; if(_oCnxInfo){_spX=oBeginDrawing.transform.TransformPointX(_oCnxInfo.x,_oCnxInfo.y);_spY=oBeginDrawing.transform.TransformPointY(_oCnxInfo.x,_oCnxInfo.y);_x=this.transform.TransformPointX(0,0);_y=this.transform.TransformPointY(0,0);bChecked=true}}else{_oCnxInfo=oEndDrawing.getGeom().cnxLst[this.getEndCxnIdx()];if(_oCnxInfo){_spX=oEndDrawing.transform.TransformPointX(_oCnxInfo.x,_oCnxInfo.y);_spY=oEndDrawing.transform.TransformPointY(_oCnxInfo.x,_oCnxInfo.y);_x=this.transform.TransformPointX(this.extX, this.extY);_y=this.transform.TransformPointY(this.extX,this.extY);bChecked=true}}if(bChecked){if(this.group){_groupTransform=this.group.invertTransform.CreateDublicate();_groupTransform.tx=0;_groupTransform.ty=0;diffX=_groupTransform.TransformPointX(_spX-_x,_spY-_y);diffY=_groupTransform.TransformPointY(_spX-_x,_spY-_y)}else{diffX=_spX-_x;diffY=_spY-_y}this.spPr.xfrm.setOffX(this.spPr.xfrm.offX+diffX);this.spPr.xfrm.setOffY(this.spPr.xfrm.offY+diffY);this.recalculate()}}else{if(oBeginDrawing)_startConnectionParams= oBeginDrawing.getConnectionParams(this.getStCxnIdx(),null);if(oEndDrawing)_endConnectionParams=oEndDrawing.getConnectionParams(this.getEndCxnIdx(),null);var _tx,_ty;if(_startConnectionParams||_endConnectionParams){if(!_startConnectionParams){_tx=this.transform.TransformPointX(0,0);_ty=this.transform.TransformPointY(0,0);_startConnectionParams=AscFormat.fCalculateConnectionInfo(_endConnectionParams,_tx,_ty)}if(!_endConnectionParams){_tx=this.transform.TransformPointX(this.extX,this.extY);_ty=this.transform.TransformPointY(this.extX, this.extY);_endConnectionParams=AscFormat.fCalculateConnectionInfo(_startConnectionParams,_tx,_ty)}_spPr=AscFormat.fCalculateSpPr(_startConnectionParams,_endConnectionParams,this.spPr.geometry.preset,this.pen&&this.pen.w);_xfrm2=_spPr.xfrm;_xfrm.setExtX(_xfrm2.extX);_xfrm.setExtY(_xfrm2.extY);if(!this.group){_xfrm.setOffX(_xfrm2.offX);_xfrm.setOffY(_xfrm2.offY);_xfrm.setFlipH(_xfrm2.flipH);_xfrm.setFlipV(_xfrm2.flipV);_xfrm.setRot(_xfrm2.rot)}else{var _xc=_xfrm2.offX+_xfrm2.extX/2;var _yc=_xfrm2.offY+ _xfrm2.extY/2;var xc=this.group.invertTransform.TransformPointX(_xc,_yc);var yc=this.group.invertTransform.TransformPointY(_xc,_yc);_xfrm.setOffX(xc-_xfrm2.extX/2);_xfrm.setOffY(yc-_xfrm2.extY/2);_xfrm.setFlipH(this.group.getFullFlipH()?!_xfrm2.flipH:_xfrm2.flipH);_xfrm.setFlipV(this.group.getFullFlipV()?!_xfrm2.flipV:_xfrm2.flipV);_xfrm.setRot(AscFormat.normalizeRotate(_xfrm2.rot-this.group.getFullRotate()))}this.spPr.setGeometry(_spPr.geometry.createDuplicate());this.checkDrawingBaseCoords();this.recalculate()}}}; window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].fCalculateSpPr=fCalculateSpPr;window["AscFormat"].fCalculateConnectionInfo=fCalculateConnectionInfo;window["AscFormat"].ConnectionParams=ConnectionParams;window["AscFormat"].CConnectionShape=CConnectionShape})();"use strict";(function(window,undefined){var moveTo=0,lineTo=1,arcTo=2,bezier3=3,bezier4=4,close=5;var cToRad=AscFormat.cToRad;var HitToArc=AscFormat.HitToArc;var ArcToCurvers=AscFormat.ArcToCurvers;var ArcToOnCanvas=AscFormat.ArcToOnCanvas; var HitInLine=AscFormat.HitInLine;var HitInBezier4=AscFormat.HitInBezier4;var HitInBezier3=AscFormat.HitInBezier3;var MOVE_DELTA=AscFormat.MOVE_DELTA;var History=AscCommon.History;var cToRad2=Math.PI/6E4/180;function CChangesDrawingsAddPathCommand(Class,oCommand,nIndex,bReverse){this.Type=AscDFH.historyitem_PathAddPathCommand;this.Command=oCommand;this.Index=nIndex;this.bReverse=bReverse;AscDFH.CChangesBase.call(this,Class)}CChangesDrawingsAddPathCommand.prototype=Object.create(AscDFH.CChangesBase.prototype); CChangesDrawingsAddPathCommand.prototype.constructor=CChangesDrawingsAddPathCommand;CChangesDrawingsAddPathCommand.prototype.Undo=function(){if(this.bReverse)this.Class.ArrPathCommandInfo.splice(this.Index,0,this.Command);else this.Class.ArrPathCommandInfo.splice(this.Index,1)};CChangesDrawingsAddPathCommand.prototype.Redo=function(){if(this.bReverse)this.Class.ArrPathCommandInfo.splice(this.Index,1);else this.Class.ArrPathCommandInfo.splice(this.Index,0,this.Command)};CChangesDrawingsAddPathCommand.prototype.WriteToBinary= function(Writer){Writer.WriteLong(this.Index);Writer.WriteLong(this.Command.id);Writer.WriteBool(!!this.bReverse);switch(this.Command.id){case moveTo:case lineTo:{Writer.WriteString2(this.Command.X);Writer.WriteString2(this.Command.Y);break}case bezier3:{Writer.WriteString2(this.Command.X0);Writer.WriteString2(this.Command.Y0);Writer.WriteString2(this.Command.X1);Writer.WriteString2(this.Command.Y1);break}case bezier4:{Writer.WriteString2(this.Command.X0);Writer.WriteString2(this.Command.Y0);Writer.WriteString2(this.Command.X1); Writer.WriteString2(this.Command.Y1);Writer.WriteString2(this.Command.X2);Writer.WriteString2(this.Command.Y2);break}case arcTo:{Writer.WriteString2(this.Command.hR);Writer.WriteString2(this.Command.wR);Writer.WriteString2(this.Command.stAng);Writer.WriteString2(this.Command.swAng);break}case close:{break}}};CChangesDrawingsAddPathCommand.prototype.ReadFromBinary=function(Reader){this.Index=Reader.GetLong();this.Command={};this.Command.id=Reader.GetLong();this.bReverse=Reader.GetBool();switch(this.Command.id){case moveTo:case lineTo:{this.Command.X= Reader.GetString2();this.Command.Y=Reader.GetString2();break}case bezier3:{this.Command.X0=Reader.GetString2();this.Command.Y0=Reader.GetString2();this.Command.X1=Reader.GetString2();this.Command.Y1=Reader.GetString2();break}case bezier4:{this.Command.X0=Reader.GetString2();this.Command.Y0=Reader.GetString2();this.Command.X1=Reader.GetString2();this.Command.Y1=Reader.GetString2();this.Command.X2=Reader.GetString2();this.Command.Y2=Reader.GetString2();break}case arcTo:{this.Command.hR=Reader.GetString2(); this.Command.wR=Reader.GetString2();this.Command.stAng=Reader.GetString2();this.Command.swAng=Reader.GetString2();break}case close:{break}}};AscDFH.changesFactory[AscDFH.historyitem_PathSetStroke]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_PathSetExtrusionOk]=AscDFH.CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_PathSetFill]=AscDFH.CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_PathSetPathH]=AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PathSetPathW]= AscDFH.CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PathAddPathCommand]=CChangesDrawingsAddPathCommand;AscDFH.drawingsChangesMap[AscDFH.historyitem_PathSetStroke]=function(oClass,value){oClass.stroke=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_PathSetExtrusionOk]=function(oClass,value){oClass.extrusionOk=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_PathSetFill]=function(oClass,value){oClass.fill=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_PathSetPathH]=function(oClass, value){oClass.pathH=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_PathSetPathW]=function(oClass,value){oClass.pathW=value};function Path(){this.stroke=null;this.extrusionOk=null;this.fill=null;this.pathH=null;this.pathW=null;this.ArrPathCommandInfo=[];this.ArrPathCommand=[];this.Id=AscCommon.g_oIdCounter.Get_NewId();AscCommon.g_oTableId.Add(this,this.Id)}Path.prototype={Get_Id:function(){return this.Id},getObjectType:function(){return AscDFH.historyitem_type_Path},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},Refresh_RecalcData:function(){},createDuplicate:function(){var p=new Path;p.setStroke(this.stroke);p.setExtrusionOk(this.extrusionOk);p.setFill(this.fill);p.setPathH(this.pathH);p.setPathW(this.pathW);for(var i=0;i<this.ArrPathCommandInfo.length;++i){var command=this.ArrPathCommandInfo[i];switch(command.id){case moveTo:case lineTo:{var x=command.X;var y=command.Y;p.addPathCommand({id:command.id,X:x,Y:y});break}case bezier3:{var X0= command.X0;var Y0=command.Y0;var X1=command.X1;var Y1=command.Y1;p.addPathCommand({id:bezier3,X0:X0,Y0:Y0,X1:X1,Y1:Y1});break}case bezier4:{var X0=command.X0;var Y0=command.Y0;var X1=command.X1;var Y1=command.Y1;var X2=command.X2;var Y2=command.Y2;p.addPathCommand({id:bezier4,X0:X0,Y0:Y0,X1:X1,Y1:Y1,X2:X2,Y2:Y2});break}case arcTo:{var hR=command.hR;var wR=command.wR;var stAng=command.stAng;var swAng=command.swAng;p.addPathCommand({id:arcTo,hR:hR,wR:wR,stAng:stAng,swAng:swAng});break}case close:{p.addPathCommand({id:close}); break}}}return p},setStroke:function(pr){History.CanAddChanges()&&History.Add(new AscDFH.CChangesDrawingsBool(this,AscDFH.historyitem_PathSetStroke,this.stroke,pr));this.stroke=pr},setExtrusionOk:function(pr){History.CanAddChanges()&&History.Add(new AscDFH.CChangesDrawingsBool(this,AscDFH.historyitem_PathSetExtrusionOk,this.extrusionOk,pr));this.extrusionOk=pr},setFill:function(pr){History.CanAddChanges()&&History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_PathSetFill,this.fill, pr));this.fill=pr},setPathH:function(pr){History.CanAddChanges()&&History.Add(new AscDFH.CChangesDrawingsLong(this,AscDFH.historyitem_PathSetPathH,this.pathH,pr));this.pathH=pr},setPathW:function(pr){History.CanAddChanges()&&History.Add(new AscDFH.CChangesDrawingsLong(this,AscDFH.historyitem_PathSetPathW,this.pathW,pr));this.pathW=pr},addPathCommand:function(cmd){History.CanAddChanges()&&History.Add(new CChangesDrawingsAddPathCommand(this,cmd,this.ArrPathCommandInfo.length));this.ArrPathCommandInfo.push(cmd)}, moveTo:function(x,y){this.addPathCommand({id:moveTo,X:x,Y:y})},lnTo:function(x,y){this.addPathCommand({id:lineTo,X:x,Y:y})},arcTo:function(wR,hR,stAng,swAng){this.addPathCommand({id:arcTo,wR:wR,hR:hR,stAng:stAng,swAng:swAng})},quadBezTo:function(x0,y0,x1,y1){this.addPathCommand({id:bezier3,X0:x0,Y0:y0,X1:x1,Y1:y1})},cubicBezTo:function(x0,y0,x1,y1,x2,y2){this.addPathCommand({id:bezier4,X0:x0,Y0:y0,X1:x1,Y1:y1,X2:x2,Y2:y2})},close:function(){this.addPathCommand({id:close})},recalculate:function(gdLst, bResetPathsInfo){var ch,cw;if(this.pathW!=undefined)if(this.pathW>MOVE_DELTA)cw=gdLst["w"]/this.pathW;else cw=0;else cw=1;if(this.pathH!=undefined)if(this.pathH>MOVE_DELTA)ch=gdLst["h"]/this.pathH;else ch=0;else ch=1;var APCI=this.ArrPathCommandInfo,n=APCI.length,cmd;var x0,y0,x1,y1,x2,y2,wR,hR,stAng,swAng,lastX,lastY;for(var i=0;i<n;++i){cmd=APCI[i];switch(cmd.id){case moveTo:case lineTo:{x0=gdLst[cmd.X];if(x0===undefined)x0=parseInt(cmd.X,10);y0=gdLst[cmd.Y];if(y0===undefined)y0=parseInt(cmd.Y, 10);this.ArrPathCommand[i]={id:cmd.id,X:x0*cw,Y:y0*ch};lastX=x0*cw;lastY=y0*ch;break}case bezier3:{x0=gdLst[cmd.X0];if(x0===undefined)x0=parseInt(cmd.X0,10);y0=gdLst[cmd.Y0];if(y0===undefined)y0=parseInt(cmd.Y0,10);x1=gdLst[cmd.X1];if(x1===undefined)x1=parseInt(cmd.X1,10);y1=gdLst[cmd.Y1];if(y1===undefined)y1=parseInt(cmd.Y1,10);this.ArrPathCommand[i]={id:bezier3,X0:x0*cw,Y0:y0*ch,X1:x1*cw,Y1:y1*ch};lastX=x1*cw;lastY=y1*ch;break}case bezier4:{x0=gdLst[cmd.X0];if(x0===undefined)x0=parseInt(cmd.X0, 10);y0=gdLst[cmd.Y0];if(y0===undefined)y0=parseInt(cmd.Y0,10);x1=gdLst[cmd.X1];if(x1===undefined)x1=parseInt(cmd.X1,10);y1=gdLst[cmd.Y1];if(y1===undefined)y1=parseInt(cmd.Y1,10);x2=gdLst[cmd.X2];if(x2===undefined)x2=parseInt(cmd.X2,10);y2=gdLst[cmd.Y2];if(y2===undefined)y2=parseInt(cmd.Y2,10);this.ArrPathCommand[i]={id:bezier4,X0:x0*cw,Y0:y0*ch,X1:x1*cw,Y1:y1*ch,X2:x2*cw,Y2:y2*ch};lastX=x2*cw;lastY=y2*ch;break}case arcTo:{hR=gdLst[cmd.hR];if(hR===undefined)hR=parseInt(cmd.hR,10);wR=gdLst[cmd.wR]; if(wR===undefined)wR=parseInt(cmd.wR,10);stAng=gdLst[cmd.stAng];if(stAng===undefined)stAng=parseInt(cmd.stAng,10);swAng=gdLst[cmd.swAng];if(swAng===undefined)swAng=parseInt(cmd.swAng,10);var a1=stAng;var a2=stAng+swAng;var a3=swAng;stAng=Math.atan2(ch*Math.sin(a1*cToRad),cw*Math.cos(a1*cToRad))/cToRad;swAng=Math.atan2(ch*Math.sin(a2*cToRad),cw*Math.cos(a2*cToRad))/cToRad-stAng;if(swAng>0&&a3<0)swAng-=216E5;if(swAng<0&&a3>0)swAng+=216E5;if(swAng==0&&a3!=0)swAng=216E5;var a=wR*cw;var b=hR*ch;var sin2= Math.sin(stAng*cToRad);var cos2=Math.cos(stAng*cToRad);var _xrad=cos2/a;var _yrad=sin2/b;var l=1/Math.sqrt(_xrad*_xrad+_yrad*_yrad);var xc=lastX-l*cos2;var yc=lastY-l*sin2;var sin1=Math.sin((stAng+swAng)*cToRad);var cos1=Math.cos((stAng+swAng)*cToRad);var _xrad1=cos1/a;var _yrad1=sin1/b;var l1=1/Math.sqrt(_xrad1*_xrad1+_yrad1*_yrad1);this.ArrPathCommand[i]={id:arcTo,stX:lastX,stY:lastY,wR:wR*cw,hR:hR*ch,stAng:stAng*cToRad,swAng:swAng*cToRad};lastX=xc+l1*cos1;lastY=yc+l1*sin1;break}case close:{this.ArrPathCommand[i]= {id:close};break}default:{break}}}if(bResetPathsInfo)delete this.ArrPathCommandInfo},recalculate2:function(gdLst,bResetPathsInfo){var k=1E-9;var APCI=this.ArrPathCommandInfo,n=APCI.length,cmd;var stAng,swAng,lastX,lastY;for(var i=0;i<n;++i){cmd=APCI[i];switch(cmd.id){case moveTo:case lineTo:{lastX=cmd.X*k;lastY=cmd.Y*k;this.ArrPathCommand[i]={id:cmd.id,X:lastX,Y:lastY};break}case bezier3:{lastX=cmd.X1;lastY=cmd.Y1;this.ArrPathCommand[i]={id:bezier3,X0:cmd.X0*k,Y0:cmd.Y0*k,X1:lastX,Y1:lastY};break}case bezier4:{lastX= cmd.X2;lastY=cmd.Y2;this.ArrPathCommand[i]={id:bezier4,X0:cmd.X0*k,Y0:cmd.Y0*k,X1:cmd.X1*k,Y1:cmd.Y1*k,X2:lastX,Y2:lastY};break}case arcTo:{var a1=cmd.stAng;var a2=cmd.stAng+cmd.swAng;var a3=cmd.swAng;stAng=Math.atan2(k*Math.sin(a1*cToRad),k*Math.cos(a1*cToRad))/cToRad;swAng=Math.atan2(k*Math.sin(a2*cToRad),k*Math.cos(a2*cToRad))/cToRad-cmd.stAng;if(swAng>0&&a3<0)swAng-=216E5;if(swAng<0&&a3>0)swAng+=216E5;if(swAng==0&&a3!=0)swAng=216E5;var a=cmd.wR*k;var b=cmd.hR*k;var sin2=Math.sin(stAng*cToRad); var cos2=Math.cos(stAng*cToRad);var _xrad=cos2/a;var _yrad=sin2/b;var l=1/Math.sqrt(_xrad*_xrad+_yrad*_yrad);var xc=lastX-l*cos2;var yc=lastY-l*sin2;var sin1=Math.sin((stAng+swAng)*cToRad);var cos1=Math.cos((stAng+swAng)*cToRad);var _xrad1=cos1/a;var _yrad1=sin1/b;var l1=1/Math.sqrt(_xrad1*_xrad1+_yrad1*_yrad1);this.ArrPathCommand[i]={id:arcTo,stX:lastX,stY:lastY,wR:cmd.wR*k,hR:cmd.hR*k,stAng:stAng*cToRad,swAng:swAng*cToRad};lastX=xc+l1*cos1;lastY=yc+l1*sin1;break}case close:{this.ArrPathCommand[i]= {id:close};break}default:{break}}}{delete this.ArrPathCommandInfo}},draw:function(shape_drawer){if(shape_drawer.bIsCheckBounds===true&&this.fill=="none")return;var bIsDrawLast=false;var path=this.ArrPathCommand;shape_drawer._s();for(var j=0,l=path.length;j<l;++j){var cmd=path[j];switch(cmd.id){case moveTo:{bIsDrawLast=true;shape_drawer._m(cmd.X,cmd.Y);break}case lineTo:{bIsDrawLast=true;shape_drawer._l(cmd.X,cmd.Y);break}case bezier3:{bIsDrawLast=true;shape_drawer._c2(cmd.X0,cmd.Y0,cmd.X1,cmd.Y1); break}case bezier4:{bIsDrawLast=true;shape_drawer._c(cmd.X0,cmd.Y0,cmd.X1,cmd.Y1,cmd.X2,cmd.Y2);break}case arcTo:{bIsDrawLast=true;ArcToCurvers(shape_drawer,cmd.stX,cmd.stY,cmd.wR,cmd.hR,cmd.stAng,cmd.swAng);break}case close:{shape_drawer._z();break}}}if(bIsDrawLast)shape_drawer.drawFillStroke(true,this.fill,this.stroke&&!shape_drawer.bIsNoStrokeAttack);shape_drawer._e()},check_bounds:function(checker){var path=this.ArrPathCommand;for(var j=0,l=path.length;j<l;++j){var cmd=path[j];switch(cmd.id){case moveTo:{checker._m(cmd.X, cmd.Y);break}case lineTo:{checker._l(cmd.X,cmd.Y);break}case bezier3:{checker._c2(cmd.X0,cmd.Y0,cmd.X1,cmd.Y1);break}case bezier4:{checker._c(cmd.X0,cmd.Y0,cmd.X1,cmd.Y1,cmd.X2,cmd.Y2);break}case arcTo:{ArcToCurvers(checker,cmd.stX,cmd.stY,cmd.wR,cmd.hR,cmd.stAng,cmd.swAng);break}case close:{checker._z();break}}}},hitInInnerArea:function(canvasContext,x,y){if(this.fill==="none")return false;var _arr_commands=this.ArrPathCommand;var _commands_count=_arr_commands.length;var _command_index;var _command; canvasContext.beginPath();for(_command_index=0;_command_index<_commands_count;++_command_index){_command=_arr_commands[_command_index];switch(_command.id){case moveTo:{canvasContext.moveTo(_command.X,_command.Y);break}case lineTo:{canvasContext.lineTo(_command.X,_command.Y);break}case arcTo:{ArcToOnCanvas(canvasContext,_command.stX,_command.stY,_command.wR,_command.hR,_command.stAng,_command.swAng);break}case bezier3:{canvasContext.quadraticCurveTo(_command.X0,_command.Y0,_command.X1,_command.Y1); break}case bezier4:{canvasContext.bezierCurveTo(_command.X0,_command.Y0,_command.X1,_command.Y1,_command.X2,_command.Y2);break}case close:{canvasContext.closePath();if(canvasContext.isPointInPath(x,y))return true}}}return false},hitInPath:function(canvasContext,x,y){var _arr_commands=this.ArrPathCommand;var _commands_count=_arr_commands.length;var _command_index;var _command;var _last_x,_last_y;var _begin_x,_begin_y;for(_command_index=0;_command_index<_commands_count;++_command_index){_command=_arr_commands[_command_index]; switch(_command.id){case moveTo:{_last_x=_command.X;_last_y=_command.Y;_begin_x=_command.X;_begin_y=_command.Y;break}case lineTo:{if(HitInLine(canvasContext,x,y,_last_x,_last_y,_command.X,_command.Y))return true;_last_x=_command.X;_last_y=_command.Y;break}case arcTo:{if(HitToArc(canvasContext,x,y,_command.stX,_command.stY,_command.wR,_command.hR,_command.stAng,_command.swAng))return true;_last_x=_command.stX-_command.wR*Math.cos(_command.stAng)+_command.wR*Math.cos(_command.swAng);_last_y=_command.stY- _command.hR*Math.sin(_command.stAng)+_command.hR*Math.sin(_command.swAng);break}case bezier3:{if(HitInBezier3(canvasContext,x,y,_last_x,_last_y,_command.X0,_command.Y0,_command.X1,_command.Y1))return true;_last_x=_command.X1;_last_y=_command.Y1;break}case bezier4:{if(HitInBezier4(canvasContext,x,y,_last_x,_last_y,_command.X0,_command.Y0,_command.X1,_command.Y1,_command.X2,_command.Y2))return true;_last_x=_command.X2;_last_y=_command.Y2;break}case close:{if(HitInLine(canvasContext,x,y,_last_x,_last_y, _begin_x,_begin_y))return true}}}return false},isSmartLine:function(){if(this.ArrPathCommand.length!=2)return false;if(this.ArrPathCommand[0].id==moveTo&&this.ArrPathCommand[1].id==lineTo){if(Math.abs(this.ArrPathCommand[0].X-this.ArrPathCommand[1].X)<1E-4)return true;if(Math.abs(this.ArrPathCommand[0].Y-this.ArrPathCommand[1].Y)<1E-4)return true}return false},isSmartRect:function(){if(this.ArrPathCommand.length!=5)return false;if(this.ArrPathCommand[0].id!=moveTo||this.ArrPathCommand[1].id!=lineTo|| this.ArrPathCommand[2].id!=lineTo||this.ArrPathCommand[3].id!=lineTo||this.ArrPathCommand[4].id!=lineTo&&this.ArrPathCommand[4].id!=close)return false;var _float_eps=1E-4;if(Math.abs(this.ArrPathCommand[0].X-this.ArrPathCommand[1].X)<_float_eps){if(Math.abs(this.ArrPathCommand[1].Y-this.ArrPathCommand[2].Y)<_float_eps)if(Math.abs(this.ArrPathCommand[2].X-this.ArrPathCommand[3].X)<_float_eps&&Math.abs(this.ArrPathCommand[3].Y-this.ArrPathCommand[0].Y)<_float_eps){if(this.ArrPathCommand[4].id==close)return true; if(Math.abs(this.ArrPathCommand[0].X-this.ArrPathCommand[4].X)<_float_eps&&Math.abs(this.ArrPathCommand[0].Y-this.ArrPathCommand[4].Y)<_float_eps)return true}}else if(Math.abs(this.ArrPathCommand[0].Y-this.ArrPathCommand[1].Y)<_float_eps)if(Math.abs(this.ArrPathCommand[1].X-this.ArrPathCommand[2].X)<_float_eps)if(Math.abs(this.ArrPathCommand[2].Y-this.ArrPathCommand[3].Y)<_float_eps&&Math.abs(this.ArrPathCommand[3].X-this.ArrPathCommand[0].X)<_float_eps){if(this.ArrPathCommand[4].id==close)return true; if(Math.abs(this.ArrPathCommand[0].X-this.ArrPathCommand[4].X)<_float_eps&&Math.abs(this.ArrPathCommand[0].Y-this.ArrPathCommand[4].Y)<_float_eps)return true}return false},drawSmart:function(shape_drawer){var _graphics=shape_drawer.Graphics;var _full_trans=_graphics.m_oFullTransform;if(!_graphics||!_full_trans||undefined==_graphics.m_bIntegerGrid||true===shape_drawer.bIsNoSmartAttack)return this.draw(shape_drawer);var bIsTransformed=_full_trans.shx==0&&_full_trans.shy==0?false:true;if(bIsTransformed)return this.draw(shape_drawer); var isLine=this.isSmartLine();var isRect=false;if(!isLine)isRect=this.isSmartRect();if(window["NATIVE_EDITOR_ENJINE"]||!isLine&&!isRect)return this.draw(shape_drawer);var _old_int=_graphics.m_bIntegerGrid;if(false==_old_int)_graphics.SetIntegerGrid(true);var dKoefMMToPx=Math.max(_graphics.m_oCoordTransform.sx,.001);var _ctx=_graphics.m_oContext;var bIsStroke=shape_drawer.bIsNoStrokeAttack||this.stroke!==true?false:true;var bIsEven=false;if(bIsStroke){var _lineWidth=Math.max(shape_drawer.StrokeWidth* dKoefMMToPx+.5>>0,1);_ctx.lineWidth=_lineWidth;if((_lineWidth&1)==1)bIsEven=true;if(_graphics.dash_no_smart){for(var index=0;index<_graphics.dash_no_smart.length;index++)_graphics.dash_no_smart[index]=_graphics.m_oCoordTransform.sx*_graphics.dash_no_smart[index]+.5>>0;_graphics.m_oContext.setLineDash(_graphics.dash_no_smart);_graphics.dash_no_smart=null}}var bIsDrawLast=false;var path=this.ArrPathCommand;shape_drawer._s();if(!isRect)for(var j=0,l=path.length;j<l;++j){var cmd=path[j];switch(cmd.id){case moveTo:{bIsDrawLast= true;var _x=_full_trans.TransformPointX(cmd.X,cmd.Y)>>0;var _y=_full_trans.TransformPointY(cmd.X,cmd.Y)>>0;if(bIsEven){_x-=.5;_y-=.5}_ctx.moveTo(_x,_y);break}case lineTo:{bIsDrawLast=true;var _x=_full_trans.TransformPointX(cmd.X,cmd.Y)>>0;var _y=_full_trans.TransformPointY(cmd.X,cmd.Y)>>0;if(bIsEven){_x-=.5;_y-=.5}_ctx.lineTo(_x,_y);break}case close:{_ctx.closePath();break}}}else{var minX=1E5;var minY=1E5;var maxX=-1E5;var maxY=-1E5;bIsDrawLast=true;for(var j=0,l=path.length;j<l;++j){var cmd=path[j]; switch(cmd.id){case moveTo:case lineTo:{if(minX>cmd.X)minX=cmd.X;if(minY>cmd.Y)minY=cmd.Y;if(maxX<cmd.X)maxX=cmd.X;if(maxY<cmd.Y)maxY=cmd.Y;break}default:break}}var _x1=_full_trans.TransformPointX(minX,minY)>>0;var _y1=_full_trans.TransformPointY(minX,minY)>>0;var _x2=_full_trans.TransformPointX(maxX,maxY)>>0;var _y2=_full_trans.TransformPointY(maxX,maxY)>>0;if(bIsEven)_ctx.rect(_x1+.5,_y1+.5,_x2-_x1,_y2-_y1);else _ctx.rect(_x1,_y1,_x2-_x1,_y2-_y1)}if(bIsDrawLast)shape_drawer.drawFillStroke(true, this.fill,bIsStroke);shape_drawer._e();if(false==_old_int)_graphics.SetIntegerGrid(false)},isEmpty:function(){return this.ArrPathCommandInfo.length>0},checkBetweenPolygons:function(oBoundsController,oPolygonWrapper1,oPolygonWrapper2){},checkByPolygon:function(oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds){},transform:function(oTransform,dKoeff){}};function CheckPointByPaths(dX,dY,dWidth,dHeight,dMinX,dMinY,oPolygonWrapper1,oPolygonWrapper2){var cX,cY,point,topX,topY,bottomX,bottomY;cX=(dX-dMinX)/ dWidth;cY=(dY-dMinY)/dHeight;if(cX>1)cX=1;if(cX<0)cX=0;point=oPolygonWrapper1.getPointOnPolygon(cX);topX=point.x;topY=point.y;point=oPolygonWrapper2.getPointOnPolygon(cX);bottomX=point.x;bottomY=point.y;return{x:topX+cY*(bottomX-topX),y:topY+cY*(bottomY-topY)}}function Path2(oPathMemory){this.stroke=null;this.extrusionOk=null;this.fill=null;this.pathH=null;this.pathW=null;this.startPos=0;this.size=25;this.PathMemory=oPathMemory;this.ArrPathCommand=oPathMemory.ArrPathCommand;this.curLen=0;this.lastX= null;this.lastY=null;this.bEmpty=true}Path2.prototype={isEmpty:function(){return this.bEmpty},checkArray:function(nSize){this.bEmpty=false;this.ArrPathCommand[this.startPos]+=nSize;this.PathMemory.curPos=this.startPos+this.ArrPathCommand[this.startPos];if(this.PathMemory.curPos+1>this.ArrPathCommand.length){var aNewArray=new Float64Array((3/2*(this.PathMemory.curPos+1)>>0)+1);for(var i=0;i<this.ArrPathCommand.length;++i)aNewArray[i]=this.ArrPathCommand[i];this.PathMemory.ArrPathCommand=aNewArray; this.ArrPathCommand=aNewArray}},setStroke:function(pr){this.stroke=pr},setExtrusionOk:function(pr){this.extrusionOk=pr},setFill:function(pr){this.fill=pr},setPathH:function(pr){this.pathH=pr},setPathW:function(pr){this.pathW=pr},addPathCommand:function(cmd){this.ArrPathCommand.push(cmd)},moveTo:function(x,y){this.lastX=x*1E-9;this.lastY=y*1E-9;this.checkArray(3);this.ArrPathCommand[this.startPos+this.curLen++ +1]=moveTo;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastX;this.ArrPathCommand[this.startPos+ this.curLen++ +1]=this.lastY},lnTo:function(x,y){this.lastX=x*1E-9;this.lastY=y*1E-9;this.checkArray(3);this.ArrPathCommand[this.startPos+this.curLen++ +1]=lineTo;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastX;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastY},arcTo:function(wR,hR,stAng,swAng){var a1=stAng;var a2=stAng+swAng;var a3=swAng;stAng=Math.atan2(1E-9*Math.sin(a1*cToRad),1E-9*Math.cos(a1*cToRad))/cToRad;swAng=Math.atan2(1E-9*Math.sin(a2*cToRad),1E-9*Math.cos(a2* cToRad))/cToRad-stAng;if(swAng>0&&a3<0)swAng-=216E5;if(swAng<0&&a3>0)swAng+=216E5;if(swAng==0&&a3!=0)swAng=216E5;var a=wR*1E-9;var b=hR*1E-9;var sin2=Math.sin(stAng*cToRad);var cos2=Math.cos(stAng*cToRad);var _xrad=cos2/a;var _yrad=sin2/b;var l=1/Math.sqrt(_xrad*_xrad+_yrad*_yrad);var xc=this.lastX-l*cos2;var yc=this.lastY-l*sin2;var sin1=Math.sin((stAng+swAng)*cToRad);var cos1=Math.cos((stAng+swAng)*cToRad);var _xrad1=cos1/a;var _yrad1=sin1/b;var l1=1/Math.sqrt(_xrad1*_xrad1+_yrad1*_yrad1);this.checkArray(7); this.ArrPathCommand[this.startPos+this.curLen++ +1]=arcTo;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastX;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastY;this.ArrPathCommand[this.startPos+this.curLen++ +1]=wR*1E-9;this.ArrPathCommand[this.startPos+this.curLen++ +1]=hR*1E-9;this.ArrPathCommand[this.startPos+this.curLen++ +1]=stAng*cToRad;this.ArrPathCommand[this.startPos+this.curLen++ +1]=swAng*cToRad},quadBezTo:function(x0,y0,x1,y1){this.lastX=x1*1E-9;this.lastY=y1*1E-9; this.checkArray(5);this.ArrPathCommand[this.startPos+this.curLen++ +1]=bezier3;this.ArrPathCommand[this.startPos+this.curLen++ +1]=x0*1E-9;this.ArrPathCommand[this.startPos+this.curLen++ +1]=y0*1E-9;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastX;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastY},cubicBezTo:function(x0,y0,x1,y1,x2,y2){this.lastX=x2*1E-9;this.lastY=y2*1E-9;this.checkArray(7);this.ArrPathCommand[this.startPos+this.curLen++ +1]=bezier4;this.ArrPathCommand[this.startPos+ this.curLen++ +1]=x0*1E-9;this.ArrPathCommand[this.startPos+this.curLen++ +1]=y0*1E-9;this.ArrPathCommand[this.startPos+this.curLen++ +1]=x1*1E-9;this.ArrPathCommand[this.startPos+this.curLen++ +1]=y1*1E-9;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastX;this.ArrPathCommand[this.startPos+this.curLen++ +1]=this.lastY},close:function(){this.checkArray(1);this.ArrPathCommand[this.startPos+this.curLen++ +1]=close},draw:function(shape_drawer){if(this.isEmpty())return;if(shape_drawer.bIsCheckBounds=== true&&this.fill=="none")return;var bIsDrawLast=false;var path=this.ArrPathCommand;shape_drawer._s();var i=0;var len=this.PathMemory.ArrPathCommand[this.startPos];while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{bIsDrawLast=true;shape_drawer._m(path[this.startPos+i+2],path[this.startPos+i+3]);i+=3;break}case lineTo:{bIsDrawLast=true;shape_drawer._l(path[this.startPos+i+2],path[this.startPos+i+3]);i+=3;break}case bezier3:{bIsDrawLast=true;shape_drawer._c2(path[this.startPos+i+2], path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5]);i+=5;break}case bezier4:{bIsDrawLast=true;shape_drawer._c(path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]);i+=7;break}case arcTo:{bIsDrawLast=true;ArcToCurvers(shape_drawer,path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]);i+=7;break}case close:{shape_drawer._z(); i+=1;break}}}if(bIsDrawLast)shape_drawer.drawFillStroke(true,"normal",this.stroke&&!shape_drawer.bIsNoStrokeAttack);shape_drawer._e()},hitInInnerArea:function(canvasContext,x,y){var path=this.ArrPathCommand;canvasContext.beginPath();var i=0;var len=this.PathMemory.ArrPathCommand[this.startPos];while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{canvasContext.moveTo(path[this.startPos+i+2],path[this.startPos+i+3]);i+=3;break}case lineTo:{canvasContext.lineTo(path[this.startPos+i+ 2],path[this.startPos+i+3]);i+=3;break}case bezier3:{canvasContext.quadraticCurveTo(path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5]);i+=5;break}case bezier4:{canvasContext.bezierCurveTo(path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]);i+=7;break}case arcTo:{ArcToOnCanvas(canvasContext,path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4], path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]);i+=7;break}case close:{canvasContext.closePath();if(canvasContext.isPointInPath(x,y))return true;i+=1;break}}}canvasContext.closePath();if(canvasContext.isPointInPath(x,y))return true;return false},hitInPath:function(canvasContext,x,y){var _arr_commands=this.ArrPathCommand;var _commands_count=_arr_commands.length;var _command_index;var _command;var _last_x,_last_y;var _begin_x,_begin_y;var path=this.ArrPathCommand;var i=0;var len= this.PathMemory.ArrPathCommand[this.startPos];while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{canvasContext.moveTo(path[this.startPos+i+2],path[this.startPos+i+3]);_last_x=path[this.startPos+i+2];_last_y=path[this.startPos+i+3];_begin_x=path[this.startPos+i+2];_begin_y=path[this.startPos+i+3];i+=3;break}case lineTo:{if(HitInLine(canvasContext,x,y,_last_x,_last_y,path[this.startPos+i+2],path[this.startPos+i+3]))return true;_last_x=path[this.startPos+i+2];_last_y=path[this.startPos+ i+3];i+=3;break}case bezier3:{canvasContext.quadraticCurveTo(path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5]);if(HitInBezier3(canvasContext,x,y,_last_x,_last_y,path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5]))return true;_last_x=path[this.startPos+i+4];_last_y=path[this.startPos+i+5];i+=5;break}case bezier4:{if(HitInBezier4(canvasContext,x,y,_last_x,_last_y,path[this.startPos+i+2],path[this.startPos+i+ 3],path[this.startPos+i+4],path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]))return true;_last_x=path[this.startPos+i+6];_last_y=path[this.startPos+i+7];i+=7;break}case arcTo:{if(HitToArc(canvasContext,x,y,path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]))return true;_last_x=path[this.startPos+i+2]-path[this.startPos+i+4]*Math.cos(path[this.startPos+i+6])+path[this.startPos+i+4]*Math.cos(path[this.startPos+ i+7]);_last_y=path[this.startPos+i+3]-path[this.startPos+i+5]*Math.sin(path[this.startPos+i+6])+path[this.startPos+i+5]*Math.sin(path[this.startPos+i+7]);i+=7;break}case close:{if(HitInLine(canvasContext,x,y,_last_x,_last_y,_begin_x,_begin_y))return true;i+=1;break}}}return false},drawTracks:function(drawingDocument,transform){var i=0;var len=this.PathMemory.ArrPathCommand[this.startPos];var path=this.ArrPathCommand;var dDist=0;while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT, transform,path[this.startPos+i+2]-dDist,path[this.startPos+i+3]-dDist,2*dDist,2*dDist,false,false);i+=3;break}case lineTo:{drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,transform,path[this.startPos+i+2]-dDist,path[this.startPos+i+3]-dDist,2*dDist,2*dDist,false,false);i+=3;break}case bezier3:{drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,transform,path[this.startPos+i+4]-dDist,path[this.startPos+i+5]-dDist,2*dDist,2*dDist,false,false);i+=5;break}case bezier4:{drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT, transform,path[this.startPos+i+6]-dDist,path[this.startPos+i+7]-dDist,2*dDist,2*dDist,false,false);i+=7;break}case arcTo:{var path_accumulator=new AscFormat.PathAccumulator;ArcToCurvers(path_accumulator,path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]);var arc_to_path_commands=path_accumulator.pathCommand;var lastX,lastY;for(var arc_to_path_index=0;arc_to_path_index<arc_to_path_commands.length;++arc_to_path_index){var cur_arc_to_command= arc_to_path_commands[arc_to_path_index];switch(cur_arc_to_command.id){case AscFormat.moveTo:{lastX=cur_arc_to_command.X;lastY=cur_arc_to_command.Y;break}case AscFormat.bezier4:{lastX=cur_arc_to_command.X2;lastY=cur_arc_to_command.Y2;break}}}drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,transform,lastX-dDist,lastY-dDist,2*dDist,2*dDist,false,false);i+=7;break}case close:{i+=1;break}}}},getCommandByIndex:function(idx){var i=0;var path=this.PathMemory.ArrPathCommand;var len=path[this.startPos]; var commandIndex=0;while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{if(idx===commandIndex)return{id:moveTo,X:path[this.startPos+i+2],Y:path[this.startPos+i+3]};i+=3;break}case lineTo:{if(idx===commandIndex)return{id:moveTo,X:path[this.startPos+i+2],Y:path[this.startPos+i+3]};i+=3;break}case bezier3:{if(idx===commandIndex)return{id:bezier3,X0:path[this.startPos+i+2],Y0:path[this.startPos+i+3],X1:path[this.startPos+i+4],Y1:path[this.startPos+i+5]};i+=5;break}case bezier4:{if(idx=== commandIndex)return{id:bezier4,X0:path[this.startPos+i+2],Y0:path[this.startPos+i+3],X1:path[this.startPos+i+4],Y1:path[this.startPos+i+5],X2:path[this.startPos+i+6],Y2:path[this.startPos+i+7]};i+=7;break}case arcTo:{if(idx===commandIndex)return{id:arcTo,stX:path[this.startPos+i+2],stY:path[this.startPos+i+3],wR:path[this.startPos+i+4],hR:path[this.startPos+i+5],stAng:path[this.startPos+i+6],swAng:path[this.startPos+i+7]};i+=7;break}case close:{if(idx===commandIndex)return{id:close};i+=1;break}}++commandIndex}return null}, check_bounds:function(shape_drawer){var path=this.ArrPathCommand;var i=0;var len=this.PathMemory.ArrPathCommand[this.startPos];while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{shape_drawer._m(path[this.startPos+i+2],path[this.startPos+i+3]);i+=3;break}case lineTo:{shape_drawer._l(path[this.startPos+i+2],path[this.startPos+i+3]);i+=3;break}case bezier3:{shape_drawer._c2(path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5]);i+=5;break}case bezier4:{shape_drawer._c(path[this.startPos+ i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]);i+=7;break}case arcTo:{ArcToCurvers(shape_drawer,path[this.startPos+i+2],path[this.startPos+i+3],path[this.startPos+i+4],path[this.startPos+i+5],path[this.startPos+i+6],path[this.startPos+i+7]);i+=7;break}case close:{shape_drawer._z();i+=1;break}}}},isSmartLine:function(){var i=0;var path=this.PathMemory.ArrPathCommand;var len=path[this.startPos];var commandIndex=0;while(i< len){if(commandIndex>1)return false;var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{if(0!==commandIndex)return false;i+=3;break}case lineTo:{if(1!==commandIndex)return false;i+=3;break}default:{return false}}++commandIndex}return true},isSmartRect:function(){var i=0;var path=this.PathMemory.ArrPathCommand;var len=path[this.startPos];var commandIndex=0;var x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,isCommand4Close=false;while(i<len){if(commandIndex>4)return false;var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{if(0!== commandIndex)return false;x0=path[this.startPos+i+2];y0=path[this.startPos+i+3];i+=3;break}case lineTo:{if(commandIndex===1){x1=path[this.startPos+i+2];y1=path[this.startPos+i+3]}else if(commandIndex===2){x2=path[this.startPos+i+2];y2=path[this.startPos+i+3]}else if(commandIndex===3){x3=path[this.startPos+i+2];y3=path[this.startPos+i+3]}else if(commandIndex===4){x4=path[this.startPos+i+2];y4=path[this.startPos+i+3]}i+=3;break}case close:{if(4!==commandIndex)return false;isCommand4Close=true;break}default:{return false}}++commandIndex}if(AscFormat.fApproxEqual(x0, x1)){if(AscFormat.fApproxEqual(y1,y2))if(AscFormat.fApproxEqual(x2,x3)&&AscFormat.fApproxEqual(y3,y0)){if(isCommand4Close)return true;if(AscFormat.fApproxEqual(x0,x4)&&AscFormat.fApproxEqual(y0,y4))return true}}else if(AscFormat.fApproxEqual(y0,y1))if(AscFormat.fApproxEqual(x1,x2))if(AscFormat.fApproxEqual(y2,y3)&&AscFormat.fApproxEqual(x3,x0)){if(isCommand4Close)return true;if(AscFormat.fApproxEqual(x0,x4)&&AscFormat.fApproxEqual(y0,y4))return true}return false},drawSmart:function(shape_drawer){var _graphics= shape_drawer.Graphics;var _full_trans=_graphics.m_oFullTransform;if(!_graphics||!_full_trans||undefined==_graphics.m_bIntegerGrid||true===shape_drawer.bIsNoSmartAttack)return this.draw(shape_drawer);var bIsTransformed=_full_trans.shx==0&&_full_trans.shy==0?false:true;if(bIsTransformed)return this.draw(shape_drawer);var isLine=this.isSmartLine();var isRect=false;if(!isLine)isRect=this.isSmartRect();if(window["NATIVE_EDITOR_ENJINE"]||!isLine&&!isRect&&!shape_drawer.bDrawSmartAttack)return this.draw(shape_drawer); var _old_int=_graphics.m_bIntegerGrid;if(false==_old_int)_graphics.SetIntegerGrid(true);var dKoefMMToPx=Math.max(_graphics.m_oCoordTransform.sx,.001);var _ctx=_graphics.m_oContext;var bIsStroke=shape_drawer.bIsNoStrokeAttack||this.stroke!==true?false:true;var bIsEven=false;if(bIsStroke){var _lineWidth=Math.max(shape_drawer.StrokeWidth*dKoefMMToPx+.5>>0,1);_ctx.lineWidth=_lineWidth;if((_lineWidth&1)==1)bIsEven=true}var bIsDrawLast=false;var path=this.ArrPathCommand;shape_drawer._s();if(!isRect){var i= 0;var len=this.PathMemory.ArrPathCommand[this.startPos];var X,Y;while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:{bIsDrawLast=true;X=path[this.startPos+i+2];Y=path[this.startPos+i+3];var _x=_full_trans.TransformPointX(X,Y)>>0;var _y=_full_trans.TransformPointY(X,Y)>>0;if(bIsEven){_x-=.5;_y-=.5}_ctx.moveTo(_x,_y);if(_graphics.ArrayPoints!=null)_graphics.ArrayPoints.push({x:X,y:Y});i+=3;break}case lineTo:{bIsDrawLast=true;X=path[this.startPos+i+2];Y=path[this.startPos+i+3];var _x= _full_trans.TransformPointX(X,Y)>>0;var _y=_full_trans.TransformPointY(X,Y)>>0;if(bIsEven){_x-=.5;_y-=.5}_ctx.lineTo(_x,_y);if(_graphics.ArrayPoints!=null)_graphics.ArrayPoints.push({x:X,y:Y});i+=3;break}case bezier3:{bIsDrawLast=true;i+=5;break}case bezier4:{bIsDrawLast=true;i+=7;break}case arcTo:{bIsDrawLast=true;i+=7;break}case close:{_ctx.closePath();i+=1;break}}}}else{var minX=1E5;var minY=1E5;var maxX=-1E5;var maxY=-1E5;bIsDrawLast=true;var i=0;var len=this.PathMemory.ArrPathCommand[this.startPos], X,Y;while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:case lineTo:{bIsDrawLast=true;X=path[this.startPos+i+2];Y=path[this.startPos+i+3];if(minX>X)minX=X;if(minY>Y)minY=Y;if(maxX<X)maxX=X;if(maxY<Y)maxY=Y;i+=3;break}case bezier3:{bIsDrawLast=true;i+=5;break}case bezier4:{bIsDrawLast=true;i+=7;break}case arcTo:{bIsDrawLast=true;i+=7;break}case close:{i+=1;break}}}var _x1=_full_trans.TransformPointX(minX,minY)>>0;var _y1=_full_trans.TransformPointY(minX,minY)>>0;var _x2=_full_trans.TransformPointX(maxX, maxY)>>0;var _y2=_full_trans.TransformPointY(maxX,maxY)>>0;if(bIsEven)_ctx.rect(_x1+.5,_y1+.5,_x2-_x1,_y2-_y1);else _ctx.rect(_x1,_y1,_x2-_x1,_y2-_y1)}if(bIsDrawLast){shape_drawer.isArrPix=true;shape_drawer.drawFillStroke(true,this.fill,bIsStroke);shape_drawer.isArrPix=false}shape_drawer._e();if(false==_old_int)_graphics.SetIntegerGrid(false)},recalculate:function(gdLst,bResetPathsInfo){},recalculate2:function(gdLst,bResetPathsInfo){},transformPointPolygon:function(x,y,oPolygon,bFlag,XLimit,ContentHeight, dKoeff,oBounds){var oRet={x:0,y:0},y0,y1,cX,oPointOnPolygon,x1t,y1t,dX,dY,x0t,y0t;y0=y;if(bFlag){y1=0;if(oBounds)y0-=oBounds.min_y}else{y1=ContentHeight*dKoeff;if(oBounds){y1=oBounds.max_y-oBounds.min_y;y0-=oBounds.min_y}}cX=x/XLimit;oPointOnPolygon=oPolygon.getPointOnPolygon(cX,true);x1t=oPointOnPolygon.x;y1t=oPointOnPolygon.y;dX=oPointOnPolygon.oP2.x-oPointOnPolygon.oP1.x;dY=oPointOnPolygon.oP2.y-oPointOnPolygon.oP1.y;if(bFlag){dX=-dX;dY=-dY}var dNorm=Math.sqrt(dX*dX+dY*dY);if(bFlag){x0t=x1t+dY/ dNorm*y0;y0t=y1t-dX/dNorm*y0}else{x0t=x1t+dY/dNorm*(y1-y0);y0t=y1t-dX/dNorm*(y1-y0)}oRet.x=x0t;oRet.y=y0t;return oRet},checkBetweenPolygons:function(oBoundsController,oPolygonWrapper1,oPolygonWrapper2){var path=this.ArrPathCommand;var i=0;var len=this.PathMemory.ArrPathCommand[this.startPos];var p;var dMinX=oBoundsController.min_x,dMinY=oBoundsController.min_y,dWidth=oBoundsController.max_x-oBoundsController.min_x,dHeight=oBoundsController.max_y-oBoundsController.min_y;while(i<len){var cmd=path[this.startPos+ i+1];switch(cmd){case moveTo:case lineTo:{p=CheckPointByPaths(path[this.startPos+i+2],path[this.startPos+i+3],dWidth,dHeight,dMinX,dMinY,oPolygonWrapper1,oPolygonWrapper2);path[this.startPos+i+2]=p.x;path[this.startPos+i+3]=p.y;i+=3;break}case bezier3:{p=CheckPointByPaths(path[this.startPos+i+2],path[this.startPos+i+3],dWidth,dHeight,dMinX,dMinY,oPolygonWrapper1,oPolygonWrapper2);path[this.startPos+i+2]=p.x;path[this.startPos+i+3]=p.y;p=CheckPointByPaths(path[this.startPos+i+4],path[this.startPos+ i+5],dWidth,dHeight,dMinX,dMinY,oPolygonWrapper1,oPolygonWrapper2);path[this.startPos+i+4]=p.x;path[this.startPos+i+5]=p.y;i+=5;break}case bezier4:{p=CheckPointByPaths(path[this.startPos+i+2],path[this.startPos+i+3],dWidth,dHeight,dMinX,dMinY,oPolygonWrapper1,oPolygonWrapper2);path[this.startPos+i+2]=p.x;path[this.startPos+i+3]=p.y;p=CheckPointByPaths(path[this.startPos+i+4],path[this.startPos+i+5],dWidth,dHeight,dMinX,dMinY,oPolygonWrapper1,oPolygonWrapper2);path[this.startPos+i+4]=p.x;path[this.startPos+ i+5]=p.y;p=CheckPointByPaths(path[this.startPos+i+6],path[this.startPos+i+7],dWidth,dHeight,dMinX,dMinY,oPolygonWrapper1,oPolygonWrapper2);path[this.startPos+i+6]=p.x;path[this.startPos+i+7]=p.y;i+=7;break}case arcTo:{i+=7;break}case close:{i+=1;break}}}},checkByPolygon:function(oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds){var path=this.ArrPathCommand;var i=0;var len=this.PathMemory.ArrPathCommand[this.startPos];var p;while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:case lineTo:{p= this.transformPointPolygon(path[this.startPos+i+2],path[this.startPos+i+3],oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds);path[this.startPos+i+2]=p.x;path[this.startPos+i+3]=p.y;i+=3;break}case bezier3:{p=this.transformPointPolygon(path[this.startPos+i+2],path[this.startPos+i+3],oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds);path[this.startPos+i+2]=p.x;path[this.startPos+i+3]=p.y;p=this.transformPointPolygon(path[this.startPos+i+4],path[this.startPos+i+5],oPolygon,bFlag,XLimit,ContentHeight, dKoeff,oBounds);path[this.startPos+i+4]=p.x;path[this.startPos+i+5]=p.y;i+=5;break}case bezier4:{p=this.transformPointPolygon(path[this.startPos+i+2],path[this.startPos+i+3],oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds);path[this.startPos+i+2]=p.x;path[this.startPos+i+3]=p.y;p=this.transformPointPolygon(path[this.startPos+i+4],path[this.startPos+i+5],oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds);path[this.startPos+i+4]=p.x;path[this.startPos+i+5]=p.y;p=this.transformPointPolygon(path[this.startPos+ i+6],path[this.startPos+i+7],oPolygon,bFlag,XLimit,ContentHeight,dKoeff,oBounds);path[this.startPos+i+6]=p.x;path[this.startPos+i+7]=p.y;i+=7;break}case arcTo:{i+=7;break}case close:{i+=1;break}}}},transform:function(oTransform,dKoeff){var path=this.ArrPathCommand;var i=0;var len=this.PathMemory.ArrPathCommand[this.startPos];var p,x,y;while(i<len){var cmd=path[this.startPos+i+1];switch(cmd){case moveTo:case lineTo:{x=oTransform.TransformPointX(path[this.startPos+i+2]*dKoeff,path[this.startPos+i+3]* dKoeff);y=oTransform.TransformPointY(path[this.startPos+i+2]*dKoeff,path[this.startPos+i+3]*dKoeff);path[this.startPos+i+2]=x;path[this.startPos+i+3]=y;i+=3;break}case bezier3:{x=oTransform.TransformPointX(path[this.startPos+i+2]*dKoeff,path[this.startPos+i+3]*dKoeff);y=oTransform.TransformPointY(path[this.startPos+i+2]*dKoeff,path[this.startPos+i+3]*dKoeff);path[this.startPos+i+2]=x;path[this.startPos+i+3]=y;x=oTransform.TransformPointX(path[this.startPos+i+4]*dKoeff,path[this.startPos+i+5]*dKoeff); y=oTransform.TransformPointY(path[this.startPos+i+4]*dKoeff,path[this.startPos+i+5]*dKoeff);path[this.startPos+i+4]=x;path[this.startPos+i+5]=y;i+=5;break}case bezier4:{x=oTransform.TransformPointX(path[this.startPos+i+2]*dKoeff,path[this.startPos+i+3]*dKoeff);y=oTransform.TransformPointY(path[this.startPos+i+2]*dKoeff,path[this.startPos+i+3]*dKoeff);path[this.startPos+i+2]=x;path[this.startPos+i+3]=y;x=oTransform.TransformPointX(path[this.startPos+i+4]*dKoeff,path[this.startPos+i+5]*dKoeff);y=oTransform.TransformPointY(path[this.startPos+ i+4]*dKoeff,path[this.startPos+i+5]*dKoeff);path[this.startPos+i+4]=x;path[this.startPos+i+5]=y;x=oTransform.TransformPointX(path[this.startPos+i+6]*dKoeff,path[this.startPos+i+7]*dKoeff);y=oTransform.TransformPointY(path[this.startPos+i+6]*dKoeff,path[this.startPos+i+7]*dKoeff);path[this.startPos+i+6]=x;path[this.startPos+i+7]=y;i+=7;break}case arcTo:{i+=7;break}case close:{i+=1;break}}}}};function partition_bezier3(x0,y0,x1,y1,x2,y2,epsilon){var dx01=x1-x0;var dy01=y1-y0;var dx12=x2-x1;var dy12= y2-y1;var r01=Math.sqrt(dx01*dx01+dy01*dy01);var r12=Math.sqrt(dx12*dx12+dy12*dy12);if(Math.max(r01,r12)<epsilon)return[{x:x0,y:y0},{x:x1,y:y1},{x:x2,y:y2}];var x01=(x0+x1)*.5;var y01=(y0+y1)*.5;var x12=(x1+x2)*.5;var y12=(y1+y2)*.5;var x012=(x01+x12)*.5;var y012=(y01+y12)*.5;return partition_bezier3(x0,y0,x01,y01,x012,y012,epsilon).concat(partition_bezier3(x012,y012,x12,y12,x2,y2,epsilon))}function partition_bezier4(x0,y0,x1,y1,x2,y2,x3,y3,epsilon){var dx01=x1-x0;var dy01=y1-y0;var dx12=x2-x1;var dy12= y2-y1;var dx23=x3-x2;var dy23=y3-y2;var r01=Math.sqrt(dx01*dx01+dy01*dy01);var r12=Math.sqrt(dx12*dx12+dy12*dy12);var r23=Math.sqrt(dx23*dx23+dy23*dy23);if(Math.max(r01,r12,r23)<epsilon)return[{x:x0,y:y0},{x:x1,y:y1},{x:x2,y:y2},{x:x3,y:y3}];var x01=(x0+x1)*.5;var y01=(y0+y1)*.5;var x12=(x1+x2)*.5;var y12=(y1+y2)*.5;var x23=(x2+x3)*.5;var y23=(y2+y3)*.5;var x012=(x01+x12)*.5;var y012=(y01+y12)*.5;var x123=(x12+x23)*.5;var y123=(y12+y23)*.5;var x0123=(x012+x123)*.5;var y0123=(y012+y123)*.5;return partition_bezier4(x0, y0,x01,y01,x012,y012,x0123,y0123,epsilon).concat(partition_bezier4(x0123,y0123,x123,y123,x23,y23,x3,y3,epsilon))}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].moveTo=moveTo;window["AscFormat"].lineTo=lineTo;window["AscFormat"].arcTo=arcTo;window["AscFormat"].bezier3=bezier3;window["AscFormat"].bezier4=bezier4;window["AscFormat"].close=close;window["AscFormat"].cToRad2=cToRad2;window["AscFormat"].Path=Path;window["AscFormat"].Path2=Path2;window["AscFormat"].partition_bezier3=partition_bezier3; window["AscFormat"].partition_bezier4=partition_bezier4})(window);"use strict";(function(window,undefined){var CShape=AscFormat.CShape;var History=AscCommon.History;var global_MatrixTransformer=AscCommon.global_MatrixTransformer;var isRealObject=AscCommon.isRealObject;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetSpPr]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetBlipFill]=AscDFH.CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetParent]= AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetGroup]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetStyle]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetNvPicPr]=AscDFH.CChangesDrawingsObject;AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetSpPr]=function(oClass,value){oClass.spPr=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetBlipFill]=function(oClass,value, FromLoad){oClass.blipFill=value;if(FromLoad)if(typeof AscCommon.CollaborativeEditing!=="undefined")if(value&&typeof value.RasterImageId==="string"&&value.RasterImageId.length>0)AscCommon.CollaborativeEditing.Add_NewImage(value.RasterImageId)};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetParent]=function(oClass,value){oClass.parent=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetGroup]=function(oClass,value){oClass.group=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetStyle]= function(oClass,value){oClass.style=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetNvPicPr]=function(oClass,value){oClass.nvPicPr=value};AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ImageShapeSetBlipFill]=AscFormat.CBlipFill;function CImageShape(){AscFormat.CGraphicObjectBase.call(this);this.nvPicPr=null;this.blipFill=null;this.style=null;this.cropBrush=false;this.isCrop=false;this.parentCrop=null;this.shdwSp=null}CImageShape.prototype=Object.create(AscFormat.CGraphicObjectBase.prototype); CImageShape.prototype.constructor=CImageShape;CImageShape.prototype.getObjectType=function(){return AscDFH.historyitem_type_ImageShape};CImageShape.prototype.setNvPicPr=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ImageShapeSetNvPicPr,this.nvPicPr,pr));this.nvPicPr=pr};CImageShape.prototype.setSpPr=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ImageShapeSetSpPr,this.spPr,pr));this.spPr=pr};CImageShape.prototype.setBlipFill= function(pr){History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ImageShapeSetBlipFill,this.blipFill,pr));this.blipFill=pr};CImageShape.prototype.setParent=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ImageShapeSetParent,this.parent,pr));this.parent=pr};CImageShape.prototype.setGroup=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ImageShapeSetGroup,this.group,pr));this.group=pr};CImageShape.prototype.setStyle= function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ImageShapeSetStyle,this.style,pr));this.style=pr};CImageShape.prototype.copy=function(oPr){var copy=new CImageShape;if(this.nvPicPr)copy.setNvPicPr(this.nvPicPr.createDuplicate());if(this.spPr){copy.setSpPr(this.spPr.createDuplicate());copy.spPr.setParent(copy)}if(this.blipFill)copy.setBlipFill(this.blipFill.createDuplicate());if(this.style)copy.setStyle(this.style.createDuplicate());copy.setBDeleted(this.bDeleted); copy.cachedImage=this.getBase64Img();copy.cachedPixH=this.cachedPixH;copy.cachedPixW=this.cachedPixW;copy.setLocks(this.locks);return copy};CImageShape.prototype.getImageUrl=function(){if(isRealObject(this.blipFill))return this.blipFill.RasterImageId;return null};CImageShape.prototype.getSnapArrays=function(snapX,snapY){var transform=this.getTransformMatrix();snapX.push(transform.tx);snapX.push(transform.tx+this.extX*.5);snapX.push(transform.tx+this.extX);snapY.push(transform.ty);snapY.push(transform.ty+ this.extY*.5);snapY.push(transform.ty+this.extY)};CImageShape.prototype.checkDrawingBaseCoords=CShape.prototype.checkDrawingBaseCoords;CImageShape.prototype.setDrawingBaseCoords=CShape.prototype.setDrawingBaseCoords;CImageShape.prototype.isPlaceholder=function(){return this.nvPicPr!=null&&this.nvPicPr.nvPr!=undefined&&this.nvPicPr.nvPr.ph!=undefined};CImageShape.prototype.isShape=function(){return false};CImageShape.prototype.isImage=function(){return true};CImageShape.prototype.isChart=function(){return false}; CImageShape.prototype.isGroup=function(){return false};CImageShape.prototype.getWatermarkProps=function(){var oProps=new Asc.CAscWatermarkProperties;oProps.put_Type(Asc.c_oAscWatermarkType.Image);oProps.put_ImageUrl2(this.blipFill.RasterImageId);oProps.put_Scale(-1);var oApi;if(window["Asc"]&&window["Asc"]["editor"])oApi=window["Asc"]["editor"];else oApi=editor;if(oApi){var oImgP=new Asc.asc_CImgProperty;oImgP.ImageUrl=this.blipFill.RasterImageId;var oSize=oImgP.asc_getOriginSize(oApi);if(oSize){var dScale= (this.extX/oSize.Width*100+.5>>0)/100;oProps.put_Scale(dScale);var dAspect=this.extX/this.extY;var dAspect2=oSize.Width/oSize.Height;if(AscFormat.fApproxEqual(dAspect,dAspect2,.01)){var oParaDrawing=AscFormat.getParaDrawing(this);if(oParaDrawing){var oParentParagraph=oParaDrawing.Get_ParentParagraph();if(oParentParagraph){var oSectPr=oParentParagraph.Get_SectPr();if(oSectPr){var Width=oSectPr.GetContentFrameWidth();if(AscFormat.fApproxEqual(this.extX,Width,1))oProps.put_Scale(-1)}}}}}}return oProps}; CImageShape.prototype.getParentObjects=CShape.prototype.getParentObjects;CImageShape.prototype.hitInPath=CShape.prototype.hitInPath;CImageShape.prototype.hitInInnerArea=CShape.prototype.hitInInnerArea;CImageShape.prototype.getRotateAngle=CShape.prototype.getRotateAngle;CImageShape.prototype.changeSize=CShape.prototype.changeSize;CImageShape.prototype.getRectBounds=function(){var transform=this.getTransformMatrix();var w=this.extX;var h=this.extY;var rect_points=[{x:0,y:0},{x:w,y:0},{x:w,y:h},{x:0, y:h}];var min_x,max_x,min_y,max_y;min_x=transform.TransformPointX(rect_points[0].x,rect_points[0].y);min_y=transform.TransformPointY(rect_points[0].x,rect_points[0].y);max_x=min_x;max_y=min_y;var cur_x,cur_y;for(var i=1;i<4;++i){cur_x=transform.TransformPointX(rect_points[i].x,rect_points[i].y);cur_y=transform.TransformPointY(rect_points[i].x,rect_points[i].y);if(cur_x<min_x)min_x=cur_x;if(cur_x>max_x)max_x=cur_x;if(cur_y<min_y)min_y=cur_y;if(cur_y>max_y)max_y=cur_y}return{minX:min_x,maxX:max_x,minY:min_y, maxY:max_y}};CImageShape.prototype.canRotate=function(){if(this.isCrop)return false;if(this.cropObject)return false;return AscFormat.CGraphicObjectBase.prototype.canRotate.call(this)};CImageShape.prototype.createRotateTrack=function(){return new AscFormat.RotateTrackShapeImage(this)};CImageShape.prototype.createResizeTrack=function(cardDirection){return new AscFormat.ResizeTrackShapeImage(this,cardDirection)};CImageShape.prototype.createMoveTrack=function(){return new AscFormat.MoveShapeImageTrack(this)}; CImageShape.prototype.getInvertTransform=function(){if(this.recalcInfo.recalculateTransform){this.recalculateTransform();this.recalcInfo.recalculateTransform=true}return this.invertTransform};CImageShape.prototype.hitInTextRect=function(x,y){return false};CImageShape.prototype.getBase64Img=CShape.prototype.getBase64Img;CImageShape.prototype.convertToWord=function(document){this.setBDeleted(true);var oCopy=this.copy(undefined);oCopy.setBDeleted(false);return oCopy};CImageShape.prototype.convertToPPTX= function(drawingDocument,worksheet){var ret=this.copy(undefined);ret.setWorksheet(worksheet);ret.setParent(null);ret.setBDeleted(false);return ret};CImageShape.prototype.recalculateBrush=CShape.prototype.recalculateBrush;CImageShape.prototype.recalculatePen=function(){CShape.prototype.recalculatePen.call(this);if(this.pen)if(AscFormat.isRealNumber(this.pen.w))this.pen.w*=2};CImageShape.prototype.getCompiledLine=CShape.prototype.getCompiledLine;CImageShape.prototype.getCompiledFill=CShape.prototype.getCompiledFill; CImageShape.prototype.getCompiledTransparent=CShape.prototype.getCompiledTransparent;CImageShape.prototype.getAllRasterImages=function(images){this.blipFill&&typeof this.blipFill.RasterImageId==="string"&&this.blipFill.RasterImageId.length>0&&images.push(this.blipFill.RasterImageId)};CImageShape.prototype.getHierarchy=function(){if(this.recalcInfo.recalculateShapeHierarchy){this.compiledHierarchy.length=0;var hierarchy=this.compiledHierarchy;if(this.isPlaceholder()){var ph_type=this.getPlaceholderType(); var ph_index=this.getPlaceholderIndex();var b_is_single_body=this.getIsSingleBody();switch(this.parent.kind){case AscFormat.TYPE_KIND.SLIDE:{hierarchy.push(this.parent.Layout.getMatchingShape(ph_type,ph_index,b_is_single_body));hierarchy.push(this.parent.Layout.Master.getMatchingShape(ph_type,ph_index,b_is_single_body));break}case AscFormat.TYPE_KIND.LAYOUT:{hierarchy.push(this.parent.Master.getMatchingShape(ph_type,ph_index,b_is_single_body));break}}}this.recalcInfo.recalculateShapeHierarchy=true}return this.compiledHierarchy}; CImageShape.prototype.recalculateTransform=function(){this.cachedImage=null;if(!isRealObject(this.group))if(this.spPr.xfrm.isNotNull()){var xfrm=this.spPr.xfrm;this.x=xfrm.offX;this.y=xfrm.offY;this.extX=xfrm.extX;this.extY=xfrm.extY;this.rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;this.flipH=xfrm.flipH===true;this.flipV=xfrm.flipV===true}else if(this.isPlaceholder()){var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i){var hierarchy_sp=hierarchy[i];if(isRealObject(hierarchy_sp)&& hierarchy_sp.spPr.xfrm.isNotNull()){var xfrm=hierarchy_sp.spPr.xfrm;this.x=xfrm.offX;this.y=xfrm.offY;this.extX=xfrm.extX;this.extY=xfrm.extY;this.rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;this.flipH=xfrm.flipH===true;this.flipV=xfrm.flipV===true;break}}if(i===hierarchy.length){this.x=0;this.y=0;this.extX=5;this.extY=5;this.rot=0;this.flipH=false;this.flipV=false}}else{this.x=0;this.y=0;this.extX=5;this.extY=5;this.rot=0;this.flipH=false;this.flipV=false}else{var xfrm;if(this.spPr.xfrm.isNotNull())xfrm= this.spPr.xfrm;else if(this.isPlaceholder()){var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i){var hierarchy_sp=hierarchy[i];if(isRealObject(hierarchy_sp)&&hierarchy_sp.spPr.xfrm.isNotNull()){xfrm=hierarchy_sp.spPr.xfrm;break}}if(i===hierarchy.length){xfrm=new AscFormat.CXfrm;xfrm.offX=0;xfrm.offX=0;xfrm.extX=5;xfrm.extY=5}}else{xfrm=new AscFormat.CXfrm;xfrm.offX=0;xfrm.offY=0;xfrm.extX=5;xfrm.extY=5}var scale_scale_coefficients=this.group.getResultScaleCoefficients();this.x=scale_scale_coefficients.cx* (xfrm.offX-this.group.spPr.xfrm.chOffX);this.y=scale_scale_coefficients.cy*(xfrm.offY-this.group.spPr.xfrm.chOffY);this.extX=scale_scale_coefficients.cx*xfrm.extX;this.extY=scale_scale_coefficients.cy*xfrm.extY;this.rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;this.flipH=xfrm.flipH===true;this.flipV=xfrm.flipV===true}this.transform.Reset();var hc=this.extX*.5;var vc=this.extY*.5;global_MatrixTransformer.TranslateAppend(this.transform,-hc,-vc);if(this.flipH)global_MatrixTransformer.ScaleAppend(this.transform, -1,1);if(this.flipV)global_MatrixTransformer.ScaleAppend(this.transform,1,-1);global_MatrixTransformer.RotateRadAppend(this.transform,-this.rot);global_MatrixTransformer.TranslateAppend(this.transform,this.x+hc,this.y+vc);if(isRealObject(this.group))global_MatrixTransformer.MultiplyAppend(this.transform,this.group.getTransformMatrix());this.invertTransform=global_MatrixTransformer.Invert(this.transform)};CImageShape.prototype.Refresh_RecalcData=function(data){switch(data.Type){case AscDFH.historyitem_ImageShapeSetBlipFill:{this.recalcBrush(); this.recalcFill();this.addToRecalculate();break}case AscDFH.historyitem_ShapeSetBDeleted:{if(!this.bDeleted)this.addToRecalculate();break}}};CImageShape.prototype.recalculateGeometry=function(){this.calcGeometry=null;if(isRealObject(this.spPr.geometry))this.calcGeometry=this.spPr.geometry;else{var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(hierarchy[i]&&hierarchy[i].spPr&&hierarchy[i].spPr.geometry){var _g=hierarchy[i].spPr.geometry;this.calcGeometry=AscFormat.ExecuteNoHistory(function(){var _r= _g.createDuplicate();_r.setParent(this);return _r},this,[]);break}}if(isRealObject(this.calcGeometry)){var transform=this.getTransform();this.calcGeometry.Recalculate(transform.extX,transform.extY)}};CImageShape.prototype.getTransformMatrix=function(){if(this.recalcInfo.recalculateTransform){this.recalculateTransform();this.recalcInfo.recalculateTransform=false}return this.transform};CImageShape.prototype.getTransform=function(){if(this.recalcInfo.recalculateTransform){this.recalculateTransform(); this.recalcInfo.recalculateTransform=false}return{x:this.x,y:this.y,extX:this.extX,extY:this.extY,rot:this.rot,flipH:this.flipH,flipV:this.flipV}};CImageShape.prototype.draw=function(graphics,transform){if(this.checkNeedRecalculate&&this.checkNeedRecalculate())return;var oUR=graphics.updatedRect;if(oUR&&this.bounds)if(!oUR.isIntersectOther(this.bounds))return;this.drawShdw&&this.drawShdw(graphics);var oClipRect;if(!graphics.IsSlideBoundsCheckerType)oClipRect=this.getClipRect();if(oClipRect){graphics.SaveGrState(); graphics.AddClipRect(oClipRect.x,oClipRect.y,oClipRect.w,oClipRect.h)}var _transform=transform?transform:this.transform;graphics.SetIntegerGrid(false);graphics.transform3(_transform,false);var shape_drawer=new AscCommon.CShapeDrawer;if(this.getObjectType()!==AscDFH.historyitem_type_OleObject&&(this.pen||this.brush)){shape_drawer.fromShape2(this,graphics,this.calcGeometry);shape_drawer.draw(this.calcGeometry);shape_drawer.Clear()}var oldBrush=this.brush;var oldPen=this.pen;if(this.getObjectType()=== AscDFH.historyitem_type_OleObject){var sImageId=this.blipFill&&this.blipFill.RasterImageId;if(sImageId){var oApi=editor||window["Asc"]["editor"];if(oApi){sImageId=AscCommon.getFullImageSrc2(sImageId);var _img=oApi.ImageLoader.map_image_index[sImageId];if(_img&&_img.Status===AscFonts.ImageLoadStatus.Loading||_img&&_img.Image||true===graphics.IsSlideBoundsCheckerType||true==graphics.RENDERER_PDF_FLAG){this.brush=new AscFormat.CUniFill;this.brush.fill=this.blipFill;this.pen=null}else this.brush=AscFormat.CreateNoFillUniFill()}}else{this.brush= new AscFormat.CUniFill;this.brush.fill=this.blipFill;this.pen=null}}else{this.brush=new AscFormat.CUniFill;this.brush.fill=this.blipFill;this.pen=null}shape_drawer.fromShape2(this,graphics,this.calcGeometry);shape_drawer.draw(this.calcGeometry);if(this.cropBrush){this.brush=this.cropBrush;this.pen=null;shape_drawer.Clear();shape_drawer.fromShape2(this,graphics,this.calcGeometry);shape_drawer.draw(this.calcGeometry)}this.brush=oldBrush;this.pen=oldPen;this.drawLocks(_transform,graphics);if(oClipRect)graphics.RestoreGrState(); graphics.reset();graphics.SetIntegerGrid(true)};CImageShape.prototype.select=CShape.prototype.select;CImageShape.prototype.handleUpdateLn=function(){this.recalcLine();this.recalcPen();this.addToRecalculate()};CImageShape.prototype.changePresetGeom=function(sPreset){if(sPreset==="textRect")return;this.spPr.setGeometry(AscFormat.CreateGeometry(sPreset))};CImageShape.prototype.changeShadow=function(oShadow){this.spPr&&this.spPr.changeShadow(oShadow)};CImageShape.prototype.recalculateLocalTransform=CShape.prototype.recalculateLocalTransform; CImageShape.prototype.hit=CShape.prototype.hit;CImageShape.prototype.changeLine=function(line){if(this.recalcInfo.recalculatePen)this.recalculatePen();var stroke=AscFormat.CorrectUniStroke(line,this.pen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.spPr.setLn(stroke)};CImageShape.prototype.deselect=function(drawingObjectsController){this.selected=false;var selected_objects;if(!isRealObject(this.group))selected_objects=drawingObjectsController.selectedObjects;else selected_objects=this.group.getMainGroup().selectedObjects; for(var i=0;i<selected_objects.length;++i)if(selected_objects[i]===this){selected_objects.splice(i,1);break}return this};CImageShape.prototype.drawAdjustments=function(drawingDocument){if(this.calcGeometry)this.calcGeometry.drawAdjustments(drawingDocument,this.transform,false)};CImageShape.prototype.hitToAdjustment=CShape.prototype.hitToAdjustment;CImageShape.prototype.getPlaceholderType=function(){return this.isPlaceholder()?this.nvPicPr.nvPr.ph.type:null};CImageShape.prototype.getPlaceholderIndex= function(){return this.isPlaceholder()?this.nvPicPr.nvPr.ph.idx:null};CImageShape.prototype.getPhType=function(){return this.isPlaceholder()?this.nvPicPr.nvPr.ph.type:null};CImageShape.prototype.getPhIndex=function(){return this.isPlaceholder()?this.nvPicPr.nvPr.ph.idx:null};CImageShape.prototype.getMediaFileName=function(){if(this.nvPicPr&&this.nvPicPr.nvPr&&this.nvPicPr.nvPr.unimedia){var oUniMedia=this.nvPicPr.nvPr.unimedia;if(oUniMedia.type===7||oUniMedia.type===8)if(typeof oUniMedia.media=== "string"&&oUniMedia.media.length>0){var sExt=AscCommon.GetFileExtension(oUniMedia.media);if(this.blipFill&&typeof this.blipFill.RasterImageId==="string"){var sName=AscCommon.GetFileName(this.blipFill.RasterImageId);var sMediaFile=sName+"."+sExt;return sMediaFile}}}return null};CImageShape.prototype.setNvSpPr=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_ImageShapeSetNvPicPr,this.nvPicPr,pr));this.nvPicPr=pr};CImageShape.prototype.getAllImages=function(images){if(this.blipFill instanceof AscFormat.CBlipFill&&typeof this.blipFill.RasterImageId==="string")images[AscCommon.getFullImageSrc2(this.blipFill.RasterImageId)]=true};CImageShape.prototype.checkTypeCorrect=function(){if(!this.blipFill)return false;if(!this.spPr)return false;return true};CImageShape.prototype.Load_LinkData=function(linkData){};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CImageShape=CImageShape})(window);"use strict";(function(window,undefined){var c_oAscSizeRelFromH=AscCommon.c_oAscSizeRelFromH; var c_oAscSizeRelFromV=AscCommon.c_oAscSizeRelFromV;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var global_MatrixTransformer=AscCommon.global_MatrixTransformer;var CShape=AscFormat.CShape;AscDFH.changesFactory[AscDFH.historyitem_GroupShapeSetNvGrpSpPr]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_GroupShapeSetSpPr]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_GroupShapeSetParent]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_GroupShapeAddToSpTree]= AscDFH.CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_GroupShapeSetGroup]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_GroupShapeRemoveFromSpTree]=AscDFH.CChangesDrawingsContent;AscDFH.drawingsChangesMap[AscDFH.historyitem_GroupShapeSetNvGrpSpPr]=function(oClass,value){oClass.nvGrpSpPr=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_GroupShapeSetSpPr]=function(oClass,value){oClass.spPr=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_GroupShapeSetParent]= function(oClass,value){oClass.parent=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_GroupShapeSetGroup]=function(oClass,value){oClass.group=value};AscDFH.drawingContentChanges[AscDFH.historyitem_GroupShapeAddToSpTree]=AscDFH.drawingContentChanges[AscDFH.historyitem_GroupShapeRemoveFromSpTree]=function(oClass){return oClass.spTree};function CGroupShape(){AscFormat.CGraphicObjectBase.call(this);this.nvGrpSpPr=null;this.spTree=[];this.invertTransform=null;this.scaleCoefficients={cx:1,cy:1};this.arrGraphicObjects= [];this.selectedObjects=[];this.selection={groupSelection:null,chartSelection:null,textSelection:null}}CGroupShape.prototype=Object.create(AscFormat.CGraphicObjectBase.prototype);CGroupShape.prototype.constructor=CGroupShape;CGroupShape.prototype.getObjectType=function(){return AscDFH.historyitem_type_GroupShape};CGroupShape.prototype.GetAllDrawingObjects=function(DrawingObjects){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].GetAllDrawingObjects)this.spTree[i].GetAllDrawingObjects(DrawingObjects)}; CGroupShape.prototype.documentGetAllFontNames=function(allFonts){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].documentGetAllFontNames)this.spTree[i].documentGetAllFontNames(allFonts)};CGroupShape.prototype.handleAllContents=function(fCallback){for(var i=0;i<this.spTree.length;++i)this.spTree[i].handleAllContents(fCallback)};CGroupShape.prototype.getAllDocContents=function(aDocContents){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].getAllDocContents)this.spTree[i].getAllDocContents(aDocContents)}; CGroupShape.prototype.documentCreateFontMap=function(allFonts){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].documentCreateFontMap)this.spTree[i].documentCreateFontMap(allFonts)};CGroupShape.prototype.setBDeleted2=function(pr){this.bDeleted=pr;for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].setBDeleted2)this.spTree[i].setBDeleted2(pr);else this.spTree[i].bDeleted=pr};CGroupShape.prototype.checkRemoveCache=function(){for(var i=0;i<this.spTree.length;++i)this.spTree[i].checkRemoveCache&& this.spTree[i].checkRemoveCache()};CGroupShape.prototype.documentUpdateSelectionState=function(){if(this.selection.textSelection)this.selection.textSelection.updateSelectionState();else if(this.selection.groupSelection)this.selection.groupSelection.documentUpdateSelectionState();else if(this.selection.chartSelection)this.selection.chartSelection.documentUpdateSelectionState();else{this.getDrawingDocument().SelectClear();this.getDrawingDocument().TargetEnd()}};CGroupShape.prototype.drawSelectionPage= function(pageIndex){var oMatrix=null;if(this.selection.textSelection){if(this.selection.textSelection.transformText)oMatrix=this.selection.textSelection.transformText.CreateDublicate();this.getDrawingDocument().UpdateTargetTransform(oMatrix);this.selection.textSelection.getDocContent().DrawSelectionOnPage(pageIndex)}else if(this.selection.chartSelection&&this.selection.chartSelection.selection.textSelection){if(this.selection.chartSelection.selection.textSelection.transformText)oMatrix=this.selection.chartSelection.selection.textSelection.transformText.CreateDublicate(); this.getDrawingDocument().UpdateTargetTransform(oMatrix);this.selection.chartSelection.selection.textSelection.getDocContent().DrawSelectionOnPage(pageIndex)}};CGroupShape.prototype.setNvGrpSpPr=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GroupShapeSetNvGrpSpPr,this.nvGrpSpPr,pr));this.nvGrpSpPr=pr};CGroupShape.prototype.setSpPr=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GroupShapeSetSpPr,this.spPr,pr));this.spPr=pr};CGroupShape.prototype.addToSpTree= function(pos,item){if(!AscFormat.isRealNumber(pos))pos=this.spTree.length;History.Add(new AscDFH.CChangesDrawingsContent(this,AscDFH.historyitem_GroupShapeAddToSpTree,pos,[item],true));this.handleUpdateSpTree();this.spTree.splice(pos,0,item)};CGroupShape.prototype.setParent=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GroupShapeSetParent,this.parent,pr));this.parent=pr};CGroupShape.prototype.setGroup=function(group){History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_GroupShapeSetGroup,this.group,group));this.group=group};CGroupShape.prototype.removeFromSpTree=function(id){for(var i=this.spTree.length-1;i>-1;--i)if(this.spTree[i].Get_Id()===id)return this.removeFromSpTreeByPos(i);return null};CGroupShape.prototype.removeFromSpTreeByPos=function(pos){var aSplicedShape=this.spTree.splice(pos,1);History.Add(new AscDFH.CChangesDrawingsContent(this,AscDFH.historyitem_GroupShapeRemoveFromSpTree,pos,aSplicedShape,false));this.handleUpdateSpTree(); return aSplicedShape[0]};CGroupShape.prototype.handleUpdateSpTree=function(){if(!this.group){this.recalcInfo.recalculateArrGraphicObjects=true;this.recalcBounds();this.addToRecalculate()}else{this.recalcInfo.recalculateArrGraphicObjects=true;this.group.handleUpdateSpTree();this.recalcBounds()}};CGroupShape.prototype.copy=function(oPr){var copy=new CGroupShape;this.copy2(copy,oPr);return copy};CGroupShape.prototype.copy2=function(copy,oPr){if(this.nvGrpSpPr)copy.setNvGrpSpPr(this.nvGrpSpPr.createDuplicate()); if(this.spPr){copy.setSpPr(this.spPr.createDuplicate());copy.spPr.setParent(copy)}for(var i=0;i<this.spTree.length;++i){var _copy;if(this.spTree[i].getObjectType()===AscDFH.historyitem_type_GroupShape)_copy=this.spTree[i].copy(oPr);else if(oPr&&oPr.bSaveSourceFormatting)_copy=this.spTree[i].getCopyWithSourceFormatting();else _copy=this.spTree[i].copy(oPr);if(oPr&&AscCommon.isRealObject(oPr.idMap))oPr.idMap[this.spTree[i].Id]=_copy.Id;copy.addToSpTree(copy.spTree.length,_copy);copy.spTree[copy.spTree.length- 1].setGroup(copy)}copy.setBDeleted(this.bDeleted);copy.cachedImage=this.getBase64Img();copy.cachedPixH=this.cachedPixH;copy.cachedPixW=this.cachedPixW;copy.setLocks(this.locks);return copy};CGroupShape.prototype.getAllImages=function(images){for(var i=0;i<this.spTree.length;++i)if(typeof this.spTree[i].getAllImages==="function")this.spTree[i].getAllImages(images)};CGroupShape.prototype.getBase64Img=CShape.prototype.getBase64Img;CGroupShape.prototype.convertToWord=function(document){this.setBDeleted(true); var c=new CGroupShape;c.setBDeleted(false);if(this.nvGrpSpPr)c.setNvSpPr(this.nvGrpSpPr.createDuplicate());if(this.spPr){c.setSpPr(this.spPr.createDuplicate());c.spPr.setParent(c)}for(var i=0;i<this.spTree.length;++i){c.addToSpTree(c.spTree.length,this.spTree[i].convertToWord(document));c.spTree[c.spTree.length-1].setGroup(c)}return c};CGroupShape.prototype.convertToPPTX=function(drawingDocument,worksheet){var c=new CGroupShape;c.setBDeleted(false);c.setWorksheet(worksheet);if(this.nvGrpSpPr)c.setNvSpPr(this.nvGrpSpPr.createDuplicate()); if(this.spPr){c.setSpPr(this.spPr.createDuplicate());c.spPr.setParent(c)}for(var i=0;i<this.spTree.length;++i){c.addToSpTree(c.spTree.length,this.spTree[i].convertToPPTX(drawingDocument,worksheet));c.spTree[c.spTree.length-1].setGroup(c)}return c};CGroupShape.prototype.getAllFonts=function(fonts){for(var i=0;i<this.spTree.length;++i)if(typeof this.spTree[i].getAllFonts==="function")this.spTree[i].getAllFonts(fonts)};CGroupShape.prototype.isShape=function(){return false};CGroupShape.prototype.isImage= function(){return false};CGroupShape.prototype.isChart=function(){return false};CGroupShape.prototype.isGroup=function(){return true};CGroupShape.prototype.isPlaceholder=function(){return this.nvGrpSpPr!=null&&this.nvGrpSpPr.nvPr!=undefined&&this.nvGrpSpPr.nvPr.ph!=undefined};CGroupShape.prototype.getAllRasterImages=function(images){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].getAllRasterImages)this.spTree[i].getAllRasterImages(images)};CGroupShape.prototype.getAllSlicerViews=function(aSlicerView){for(var nSp= 0;nSp<this.spTree.length;++nSp)this.spTree[nSp].getAllSlicerViews(aSlicerView)};CGroupShape.prototype.hit=function(x,y){for(var i=this.spTree.length-1;i>-1;--i)if(this.spTree[i].hit(x,y))return true;return false};CGroupShape.prototype.onMouseMove=function(e,x,y){for(var i=this.spTree.length-1;i>-1;--i)if(this.spTree[i].onMouseMove(e,x,y))return true;return false};CGroupShape.prototype.draw=function(graphics){if(this.checkNeedRecalculate&&this.checkNeedRecalculate())return;var oClipRect;if(!graphics.IsSlideBoundsCheckerType)oClipRect= this.getClipRect();if(oClipRect){graphics.SaveGrState();graphics.AddClipRect(oClipRect.x,oClipRect.y,oClipRect.w,oClipRect.h)}for(var i=0;i<this.spTree.length;++i)this.spTree[i].draw(graphics);this.drawLocks(this.transform,graphics);if(oClipRect)graphics.RestoreGrState();graphics.reset();graphics.SetIntegerGrid(true)};CGroupShape.prototype.deselectObject=function(object){for(var i=0;i<this.selectedObjects.length;++i)if(this.selectedObjects[i]===object){object.selected=false;this.selectedObjects.splice(i, 1);return}};CGroupShape.prototype.getLocalTransform=function(){if(this.recalcInfo.recalculateTransform){this.recalculateTransform();this.recalcInfo.recalculateTransform=false}return this.localTransform};CGroupShape.prototype.getArrGraphicObjects=function(){if(this.recalcInfo.recalculateArrGraphicObjects)this.recalculateArrGraphicObjects();return this.arrGraphicObjects};CGroupShape.prototype.getInvertTransform=function(){return this.invertTransform};CGroupShape.prototype.getRectBounds=function(){var transform= this.getTransformMatrix();var w=this.extX;var h=this.extY;var rect_points=[{x:0,y:0},{x:w,y:0},{x:w,y:h},{x:0,y:h}];var min_x,max_x,min_y,max_y;min_x=transform.TransformPointX(rect_points[0].x,rect_points[0].y);min_y=transform.TransformPointY(rect_points[0].x,rect_points[0].y);max_x=min_x;max_y=min_y;var cur_x,cur_y;for(var i=1;i<4;++i){cur_x=transform.TransformPointX(rect_points[i].x,rect_points[i].y);cur_y=transform.TransformPointY(rect_points[i].x,rect_points[i].y);if(cur_x<min_x)min_x=cur_x;if(cur_x> max_x)max_x=cur_x;if(cur_y<min_y)min_y=cur_y;if(cur_y>max_y)max_y=cur_y}return{minX:min_x,maxX:max_x,minY:min_y,maxY:max_y}};CGroupShape.prototype.getResultScaleCoefficients=function(){if(this.recalcInfo.recalculateScaleCoefficients){var cx,cy;if(this.spPr.xfrm.isNotNullForGroup()){var dExtX=this.spPr.xfrm.extX,dExtY=this.spPr.xfrm.extY;var oParaDrawing=AscFormat.getParaDrawing(this);if(false&&oParaDrawing)if(oParaDrawing.SizeRelH||oParaDrawing.SizeRelV){this.m_oSectPr=null;var oParentParagraph=oParaDrawing.Get_ParentParagraph(); if(oParentParagraph){var oSectPr=oParentParagraph.Get_SectPr();if(oSectPr){if(oParaDrawing.SizeRelH&&oParaDrawing.SizeRelH.Percent>0){switch(oParaDrawing.SizeRelH.RelativeFrom){case c_oAscSizeRelFromH.sizerelfromhMargin:{dExtX=oSectPr.GetContentFrameWidth();break}case c_oAscSizeRelFromH.sizerelfromhPage:{dExtX=oSectPr.GetPageWidth();break}case c_oAscSizeRelFromH.sizerelfromhLeftMargin:{dExtX=oSectPr.GetPageMarginLeft();break}case c_oAscSizeRelFromH.sizerelfromhRightMargin:{dExtX=oSectPr.GetPageMarginRight(); break}default:{dExtX=oSectPr.GetPageMarginLeft();break}}dExtX*=oParaDrawing.SizeRelH.Percent}if(oParaDrawing.SizeRelV&&oParaDrawing.SizeRelV.Percent>0){switch(oParaDrawing.SizeRelV.RelativeFrom){case c_oAscSizeRelFromV.sizerelfromvMargin:{dExtY=oSectPr.GetContentFrameHeight();break}case c_oAscSizeRelFromV.sizerelfromvPage:{dExtY=oSectPr.GetPageHeight();break}case c_oAscSizeRelFromV.sizerelfromvTopMargin:{dExtY=oSectPr.GetPageMarginTop();break}case c_oAscSizeRelFromV.sizerelfromvBottomMargin:{dExtY= oSectPr.GetPageMarginBottom();break}default:{dExtY=oSectPr.GetPageMarginTop();break}}dExtY*=oParaDrawing.SizeRelV.Percent}}}}if(this.drawingBase&&!this.group){var metrics=this.drawingBase.getGraphicObjectMetrics();var rot=0;if(this.spPr&&this.spPr.xfrm)if(AscFormat.isRealNumber(this.spPr.xfrm.rot))rot=AscFormat.normalizeRotate(this.spPr.xfrm.rot);var metricExtX,metricExtY;{if(AscFormat.checkNormalRotate(rot)){dExtX=metrics.extX;dExtY=metrics.extY}else{dExtX=metrics.extY;dExtY=metrics.extX}}}if(this.spPr.xfrm.chExtX> 0)cx=dExtX/this.spPr.xfrm.chExtX;else cx=1;if(this.spPr.xfrm.chExtY>0)cy=dExtY/this.spPr.xfrm.chExtY;else cy=1}else{cx=1;cy=1}if(isRealObject(this.group)){var group_scale_coefficients=this.group.getResultScaleCoefficients();cx*=group_scale_coefficients.cx;cy*=group_scale_coefficients.cy}this.scaleCoefficients.cx=cx;this.scaleCoefficients.cy=cy;this.recalcInfo.recalculateScaleCoefficients=false}return this.scaleCoefficients};CGroupShape.prototype.getCompiledTransparent=function(){return null};CGroupShape.prototype.selectObject= function(object,pageIndex){object.select(this,pageIndex)};CGroupShape.prototype.recalculate=function(){var recalcInfo=this.recalcInfo;if(recalcInfo.recalculateBrush){this.recalculateBrush();recalcInfo.recalculateBrush=false}if(recalcInfo.recalculatePen){this.recalculatePen();recalcInfo.recalculatePen=false}if(recalcInfo.recalculateScaleCoefficients){this.getResultScaleCoefficients();recalcInfo.recalculateScaleCoefficients=false}if(recalcInfo.recalculateTransform){this.recalculateTransform();recalcInfo.recalculateTransform= false}if(recalcInfo.recalculateArrGraphicObjects)this.recalculateArrGraphicObjects();for(var i=0;i<this.spTree.length;++i)this.spTree[i].recalculate();if(recalcInfo.recalculateBounds){this.recalculateBounds();recalcInfo.recalculateBounds=false}};CGroupShape.prototype.recalcTransform=function(){this.recalcInfo.recalculateTransform=true;this.recalcInfo.recalculateScaleCoefficients=true;for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].recalcTransform)this.spTree[i].recalcTransform();else{this.spTree[i].recalcInfo.recalculateTransform= true;this.spTree[i].recalcInfo.recalculateTransformText=true}};CGroupShape.prototype.canRotate=function(){for(var i=0;i<this.spTree.length;++i)if(!this.spTree[i].canRotate())return false;return AscFormat.CGraphicObjectBase.prototype.canRotate.call(this)};CGroupShape.prototype.canResize=function(){for(var i=0;i<this.spTree.length;++i)if(!this.spTree[i].canResize())return false;return AscFormat.CGraphicObjectBase.prototype.canResize.call(this)};CGroupShape.prototype.drawAdjustments=function(){};CGroupShape.prototype.recalculateBrush= function(){};CGroupShape.prototype.recalculatePen=function(){};CGroupShape.prototype.recalculateArrGraphicObjects=function(){this.arrGraphicObjects.length=0;for(var i=0;i<this.spTree.length;++i)if(!this.spTree[i].isGroup())this.arrGraphicObjects.push(this.spTree[i]);else{var arr_graphic_objects=this.spTree[i].getArrGraphicObjects();for(var j=0;j<arr_graphic_objects.length;++j)this.arrGraphicObjects.push(arr_graphic_objects[j])}};CGroupShape.prototype.paragraphAdd=function(paraItem,bRecalculate){if(this.selection.textSelection)this.selection.textSelection.paragraphAdd(paraItem, bRecalculate);else if(this.selection.chartSelection)this.selection.chartSelection.paragraphAdd(paraItem,bRecalculate);else{var i;if(paraItem.Type===para_TextPr)AscFormat.DrawingObjectsController.prototype.applyDocContentFunction.call(this,CDocumentContent.prototype.AddToParagraph,[paraItem,bRecalculate],CTable.prototype.AddToParagraph);else if(this.selectedObjects.length===1&&this.selectedObjects[0].getObjectType()===AscDFH.historyitem_type_Shape&&!AscFormat.CheckLinePreset(this.selectedObjects[0].getPresetGeom())){this.selection.textSelection= this.selectedObjects[0];this.selection.textSelection.paragraphAdd(paraItem,bRecalculate);if(AscFormat.isRealNumber(this.selection.textSelection.selectStartPage))this.selection.textSelection.select(this,this.selection.textSelection.selectStartPage)}else if(this.selectedObjects.length>0)if(this.parent){this.parent.GoTo_Text();this.resetSelection()}}};CGroupShape.prototype.applyTextFunction=AscFormat.DrawingObjectsController.prototype.applyTextFunction;CGroupShape.prototype.applyDocContentFunction=AscFormat.DrawingObjectsController.prototype.applyDocContentFunction; CGroupShape.prototype.applyAllAlign=function(val){for(var i=0;i<this.spTree.length;++i)if(typeof this.spTree[i].applyAllAlign==="function")this.spTree[i].applyAllAlign(val)};CGroupShape.prototype.applyAllSpacing=function(val){for(var i=0;i<this.spTree.length;++i)if(typeof this.spTree[i].applyAllSpacing==="function")this.spTree[i].applyAllSpacing(val)};CGroupShape.prototype.applyAllNumbering=function(val){for(var i=0;i<this.spTree.length;++i)if(typeof this.spTree[i].applyAllNumbering==="function")this.spTree[i].applyAllNumbering(val)}; CGroupShape.prototype.applyAllIndent=function(val){for(var i=0;i<this.spTree.length;++i)if(typeof this.spTree[i].applyAllIndent==="function")this.spTree[i].applyAllIndent(val)};CGroupShape.prototype.checkExtentsByDocContent=function(){var bRet=false;for(var i=0;i<this.spTree.length;++i)if(typeof this.spTree[i].checkExtentsByDocContent==="function")if(this.spTree[i].checkExtentsByDocContent())bRet=true;return bRet};CGroupShape.prototype.changeSize=function(kw,kh){if(this.spPr&&this.spPr.xfrm&&this.spPr.xfrm.isNotNullForGroup()){var xfrm= this.spPr.xfrm;xfrm.setOffX(xfrm.offX*kw);xfrm.setOffY(xfrm.offY*kh);xfrm.setExtX(xfrm.extX*kw);xfrm.setExtY(xfrm.extY*kh);xfrm.setChExtX(xfrm.chExtX*kw);xfrm.setChExtY(xfrm.chExtY*kh);xfrm.setChOffX(xfrm.chOffX*kw);xfrm.setChOffY(xfrm.chOffY*kh)}for(var i=0;i<this.spTree.length;++i)this.spTree[i].changeSize(kw,kh)};CGroupShape.prototype.recalculateTransform=function(){this.cachedImage=null;var xfrm;if(this.spPr.xfrm.isNotNullForGroup())xfrm=this.spPr.xfrm;else{xfrm=new AscFormat.CXfrm;xfrm.offX= 0;xfrm.offY=0;xfrm.extX=5;xfrm.extY=5;xfrm.chOffX=0;xfrm.chOffY=0;xfrm.chExtX=5;xfrm.chExtY=5}if(!isRealObject(this.group)){this.x=xfrm.offX;this.y=xfrm.offY;this.extX=xfrm.extX;this.extY=xfrm.extY;this.rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;this.flipH=this.flipH===true;this.flipV=this.flipV===true}else{var scale_scale_coefficients=this.group.getResultScaleCoefficients();this.x=scale_scale_coefficients.cx*(xfrm.offX-this.group.spPr.xfrm.chOffX);this.y=scale_scale_coefficients.cy*(xfrm.offY- this.group.spPr.xfrm.chOffY);this.extX=scale_scale_coefficients.cx*xfrm.extX;this.extY=scale_scale_coefficients.cy*xfrm.extY;this.rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;this.flipH=xfrm.flipH===true;this.flipV=xfrm.flipV===true}this.transform.Reset();var hc=this.extX*.5;var vc=this.extY*.5;global_MatrixTransformer.TranslateAppend(this.transform,-hc,-vc);if(this.flipH)global_MatrixTransformer.ScaleAppend(this.transform,-1,1);if(this.flipV)global_MatrixTransformer.ScaleAppend(this.transform, 1,-1);global_MatrixTransformer.RotateRadAppend(this.transform,-this.rot);global_MatrixTransformer.TranslateAppend(this.transform,this.x+hc,this.y+vc);if(isRealObject(this.group))global_MatrixTransformer.MultiplyAppend(this.transform,this.group.getTransformMatrix());this.invertTransform=global_MatrixTransformer.Invert(this.transform)};CGroupShape.prototype.getTransformMatrix=function(){if(this.recalcInfo.recalculateTransform)this.recalculateTransform();return this.transform};CGroupShape.prototype.getSnapArrays= function(snapX,snapY){var transform=this.getTransformMatrix();snapX.push(transform.tx);snapX.push(transform.tx+this.extX*.5);snapX.push(transform.tx+this.extX);snapY.push(transform.ty);snapY.push(transform.ty+this.extY*.5);snapY.push(transform.ty+this.extY);for(var i=0;i<this.arrGraphicObjects.length;++i)if(this.arrGraphicObjects[i].getSnapArrays)this.arrGraphicObjects[i].getSnapArrays(snapX,snapY)};CGroupShape.prototype.getPlaceholderType=function(){return this.isPlaceholder()?this.nvGrpSpPr.nvPr.ph.type: null};CGroupShape.prototype.getPlaceholderIndex=function(){return this.isPlaceholder()?this.nvGrpSpPr.nvPr.ph.idx:null};CGroupShape.prototype.getPhType=function(){return this.isPlaceholder()?this.nvGrpSpPr.nvPr.ph.type:null};CGroupShape.prototype.getPhIndex=function(){return this.isPlaceholder()?this.nvGrpSpPr.nvPr.ph.idx:null};CGroupShape.prototype.getSelectionState=function(){var selection_state={};if(this.selection.textSelection){selection_state.textObject=this.selection.textSelection;selection_state.selectStartPage= this.selection.textSelection.selectStartPage;selection_state.textSelection=this.selection.textSelection.getDocContent().GetSelectionState()}else if(this.selection.chartSelection){selection_state.chartObject=this.selection.chartSelection;selection_state.selectStartPage=this.selection.chartSelection.selectStartPage;selection_state.chartSelection=this.selection.chartSelection.getSelectionState()}else{selection_state.selection=[];for(var i=0;i<this.selectedObjects.length;++i)selection_state.selection.push({object:this.selectedObjects[i], pageIndex:this.selectedObjects[i].selectStartPage})}return selection_state};CGroupShape.prototype.setSelectionState=function(selection_state){this.resetSelection(this);if(selection_state.textObject){this.selectObject(selection_state.textObject,selection_state.selectStartPage);this.selection.textSelection=selection_state.textObject;selection_state.textObject.getDocContent().SetSelectionState(selection_state.textSelection,selection_state.textSelection.length-1)}else if(selection_state.chartSelection){this.selectObject(selection_state.chartObject, selection_state.selectStartPage);this.selection.chartSelection=selection_state.chartObject;selection_state.chartObject.setSelectionState(selection_state.chartSelection)}else for(var i=0;i<selection_state.selection.length;++i)this.selectObject(selection_state.selection[i].object,selection_state.selection[i].pageIndex)};CGroupShape.prototype.documentUpdateRulersState=function(){if(this.selectedObjects.length===1&&this.selectedObjects[0].documentUpdateRulersState)this.selectedObjects[0].documentUpdateRulersState()}; CGroupShape.prototype.updateChartReferences=function(oldWorksheet,newWorksheet,bNoRebuildCache){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].updateChartReferences)this.spTree[i].updateChartReferences(oldWorksheet,newWorksheet,bNoRebuildCache)};CGroupShape.prototype.rebuildSeries=function(data){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].rebuildSeries)this.spTree[i].rebuildSeries(data)};CGroupShape.prototype.CheckNeedRecalcAutoFit=function(oSectPr){var bRet=false;for(var i=0;i< this.spTree.length;++i)if(this.spTree[i].CheckNeedRecalcAutoFit&&this.spTree[i].CheckNeedRecalcAutoFit(oSectPr))bRet=true;if(bRet)this.recalcWrapPolygon();return bRet};CGroupShape.prototype.CheckGroupSizes=function(){var bRet=false;for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].checkExtentsByDocContent)if(this.spTree[i].checkExtentsByDocContent(undefined,false))bRet=true;if(bRet){if(!this.group)this.updateCoordinatesAfterInternalResize();if(this.parent instanceof ParaDrawing)this.parent.CheckWH()}return bRet}; CGroupShape.prototype.GetRevisionsChangeElement=function(SearchEngine){var i;if(this.selectedObjects.length===0)if(SearchEngine.GetDirection()>0)i=0;else i=this.arrGraphicObjects.length-1;else if(SearchEngine.GetDirection()>0){for(i=0;i<this.arrGraphicObjects.length;++i)if(this.arrGraphicObjects[i].selected)break;if(i===this.arrGraphicObjects.length)return}else{for(i=this.arrGraphicObjects.length-1;i>-1;--i)if(this.arrGraphicObjects[i].selected)break;if(i===-1)return}while(!SearchEngine.IsFound()){if(this.arrGraphicObjects[i].GetRevisionsChangeElement)this.arrGraphicObjects[i].GetRevisionsChangeElement(SearchEngine); if(SearchEngine.GetDirection()>0){if(i===this.arrGraphicObjects.length-1)break;++i}else{if(i===0)break;--i}}};CGroupShape.prototype.Search=function(Str,Props,SearchEngine,Type){var Len=this.arrGraphicObjects.length;for(var i=0;i<Len;++i)if(this.arrGraphicObjects[i].Search)this.arrGraphicObjects[i].Search(Str,Props,SearchEngine,Type)};CGroupShape.prototype.GetSearchElementId=function(bNext,bCurrent){var Current=-1;var Len=this.arrGraphicObjects.length;var Id=null;if(true===bCurrent)for(var i=0;i<Len;++i)if(this.arrGraphicObjects[i]=== this.selection.textSelection){Current=i;break}if(true===bNext){var Start=-1!==Current?Current:0;for(var i=Start;i<Len;i++)if(this.arrGraphicObjects[i].GetSearchElementId){Id=this.arrGraphicObjects[i].GetSearchElementId(true,i===Current?true:false);if(null!==Id)return Id}}else{var Start=-1!==Current?Current:Len-1;for(var i=Start;i>=0;i--)if(this.arrGraphicObjects[i].GetSearchElementId){Id=this.arrGraphicObjects[i].GetSearchElementId(false,i===Current?true:false);if(null!==Id)return Id}}return null}; CGroupShape.prototype.getCompiledFill=function(){this.compiledFill=null;if(isRealObject(this.spPr)&&isRealObject(this.spPr.Fill)&&isRealObject(this.spPr.Fill.fill)){this.compiledFill=this.spPr.Fill.createDuplicate();if(this.compiledFill&&this.compiledFill.fill&&this.compiledFill.fill.type===Asc.c_oAscFill.FILL_TYPE_GRP)if(this.group){var group_compiled_fill=this.group.getCompiledFill();if(isRealObject(group_compiled_fill)&&isRealObject(group_compiled_fill.fill))this.compiledFill=group_compiled_fill.createDuplicate(); else this.compiledFill=null}else this.compiledFill=null}else if(isRealObject(this.group)){var group_compiled_fill=this.group.getCompiledFill();if(isRealObject(group_compiled_fill)&&isRealObject(group_compiled_fill.fill))this.compiledFill=group_compiled_fill.createDuplicate();else{var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(isRealObject(hierarchy[i])&&isRealObject(hierarchy[i].spPr)&&isRealObject(hierarchy[i].spPr.Fill)&&isRealObject(hierarchy[i].spPr.Fill.fill)){this.compiledFill= hierarchy[i].spPr.Fill.createDuplicate();break}}}else{var hierarchy=this.getHierarchy();for(var i=0;i<hierarchy.length;++i)if(isRealObject(hierarchy[i])&&isRealObject(hierarchy[i].spPr)&&isRealObject(hierarchy[i].spPr.Fill)&&isRealObject(hierarchy[i].spPr.Fill.fill)){this.compiledFill=hierarchy[i].spPr.Fill.createDuplicate();break}}return this.compiledFill};CGroupShape.prototype.getCompiledLine=function(){return null};CGroupShape.prototype.setVerticalAlign=function(align){for(var _shape_index=0;_shape_index< this.spTree.length;++_shape_index)if(this.spTree[_shape_index].setVerticalAlign)this.spTree[_shape_index].setVerticalAlign(align)};CGroupShape.prototype.setVert=function(vert){for(var _shape_index=0;_shape_index<this.spTree.length;++_shape_index)if(this.spTree[_shape_index].setVert)this.spTree[_shape_index].setVert(vert)};CGroupShape.prototype.setPaddings=function(paddings){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].setPaddings)this.spTree[i].setPaddings(paddings)};CGroupShape.prototype.setTextFitType= function(type){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].setTextFitType)this.spTree[i].setTextFitType(type)};CGroupShape.prototype.setVertOverflowType=function(type){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].setVertOverflowType)this.spTree[i].setVertOverflowType(type)};CGroupShape.prototype.setColumnNumber=function(num){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].setColumnNumber)this.spTree[i].setColumnNumber(num)};CGroupShape.prototype.setColumnSpace=function(spcCol){for(var i= 0;i<this.spTree.length;++i)if(this.spTree[i].setColumnSpace)this.spTree[i].setColumnSpace(spcCol)};CGroupShape.prototype.changePresetGeom=function(preset){for(var _shape_index=0;_shape_index<this.spTree.length;++_shape_index)if(this.spTree[_shape_index].getObjectType()===AscDFH.historyitem_type_Shape)this.spTree[_shape_index].changePresetGeom(preset)};CGroupShape.prototype.changeShadow=function(oShadow){for(var _shape_index=0;_shape_index<this.spTree.length;++_shape_index)if(this.spTree[_shape_index].changeShadow)this.spTree[_shape_index].changeShadow(oShadow)}; CGroupShape.prototype.changeFill=function(fill){for(var _shape_index=0;_shape_index<this.spTree.length;++_shape_index)if(this.spTree[_shape_index].changeFill)this.spTree[_shape_index].changeFill(fill)};CGroupShape.prototype.changeLine=function(line){for(var _shape_index=0;_shape_index<this.spTree.length;++_shape_index)if(this.spTree[_shape_index].changeLine)this.spTree[_shape_index].changeLine(line)};CGroupShape.prototype.normalize=function(){for(var i=0;i<this.spTree.length;++i)this.spTree[i].normalize(); AscFormat.CGraphicObjectBase.prototype.normalize.call(this);var xfrm=this.spPr.xfrm;xfrm.setChExtX(xfrm.extX);xfrm.setChExtY(xfrm.extY);xfrm.setChOffX(0);xfrm.setChOffY(0)};CGroupShape.prototype.updateCoordinatesAfterInternalResize=function(){this.normalize();for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].isGroup())this.spTree[i].updateCoordinatesAfterInternalResize();var sp_tree=this.spTree;var min_x,max_x,min_y,max_y;var sp=sp_tree[0];var xfrm=sp.spPr.xfrm;var rot=xfrm.rot==null?0:xfrm.rot; var xc,yc;if(AscFormat.checkNormalRotate(rot)){min_x=xfrm.offX;min_y=xfrm.offY;max_x=xfrm.offX+xfrm.extX;max_y=xfrm.offY+xfrm.extY}else{xc=xfrm.offX+xfrm.extX*.5;yc=xfrm.offY+xfrm.extY*.5;min_x=xc-xfrm.extY*.5;min_y=yc-xfrm.extX*.5;max_x=xc+xfrm.extY*.5;max_y=yc+xfrm.extX*.5}var cur_max_x,cur_min_x,cur_max_y,cur_min_y;for(i=1;i<sp_tree.length;++i){sp=sp_tree[i];xfrm=sp.spPr.xfrm;rot=xfrm.rot==null?0:xfrm.rot;if(AscFormat.checkNormalRotate(rot)){cur_min_x=xfrm.offX;cur_min_y=xfrm.offY;cur_max_x=xfrm.offX+ xfrm.extX;cur_max_y=xfrm.offY+xfrm.extY}else{xc=xfrm.offX+xfrm.extX*.5;yc=xfrm.offY+xfrm.extY*.5;cur_min_x=xc-xfrm.extY*.5;cur_min_y=yc-xfrm.extX*.5;cur_max_x=xc+xfrm.extY*.5;cur_max_y=yc+xfrm.extX*.5}if(cur_max_x>max_x)max_x=cur_max_x;if(cur_min_x<min_x)min_x=cur_min_x;if(cur_max_y>max_y)max_y=cur_max_y;if(cur_min_y<min_y)min_y=cur_min_y}var temp;var x_min_clear=min_x;var y_min_clear=min_y;if(this.spPr.xfrm.flipH===true){temp=max_x;max_x=this.spPr.xfrm.extX-min_x;min_x=this.spPr.xfrm.extX-temp}if(this.spPr.xfrm.flipV=== true){temp=max_y;max_y=this.spPr.xfrm.extY-min_y;min_y=this.spPr.xfrm.extY-temp}var old_x0,old_y0;var xfrm=this.spPr.xfrm;var rot=xfrm.rot==null?0:xfrm.rot;var hc=xfrm.extX*.5;var vc=xfrm.extY*.5;old_x0=this.spPr.xfrm.offX+hc-(hc*Math.cos(rot)-vc*Math.sin(rot));old_y0=this.spPr.xfrm.offY+vc-(hc*Math.sin(rot)+vc*Math.cos(rot));var t_dx=min_x*Math.cos(rot)-min_y*Math.sin(rot);var t_dy=min_x*Math.sin(rot)+min_y*Math.cos(rot);var new_x0,new_y0;new_x0=old_x0+t_dx;new_y0=old_y0+t_dy;var new_hc=Math.abs(max_x- min_x)*.5;var new_vc=Math.abs(max_y-min_y)*.5;var new_xc=new_x0+(new_hc*Math.cos(rot)-new_vc*Math.sin(rot));var new_yc=new_y0+(new_hc*Math.sin(rot)+new_vc*Math.cos(rot));var pos_x,pos_y;pos_x=new_xc-new_hc;pos_y=new_yc-new_vc;var xfrm=this.spPr.xfrm;if(this.group||!(editor&&editor.isDocumentEditor)){xfrm.setOffX(pos_x);xfrm.setOffY(pos_y)}xfrm.setExtX(Math.abs(max_x-min_x));xfrm.setExtY(Math.abs(max_y-min_y));xfrm.setChExtX(Math.abs(max_x-min_x));xfrm.setChExtY(Math.abs(max_y-min_y));xfrm.setChOffX(0); xfrm.setChOffY(0);for(i=0;i<sp_tree.length;++i){sp_tree[i].spPr.xfrm.setOffX(sp_tree[i].spPr.xfrm.offX-x_min_clear);sp_tree[i].spPr.xfrm.setOffY(sp_tree[i].spPr.xfrm.offY-y_min_clear)}this.checkDrawingBaseCoords();return{posX:pos_x,posY:pos_y}};CGroupShape.prototype.select=CShape.prototype.select;CGroupShape.prototype.deselect=function(drawingObjectsController){this.selected=false;var selected_objects;if(!isRealObject(this.group))selected_objects=drawingObjectsController.selectedObjects;else selected_objects= this.group.getMainGroup().selectedObjects;for(var i=0;i<selected_objects.length;++i)if(selected_objects[i]===this){selected_objects.splice(i,1);break}return this};CGroupShape.prototype.getParentObjects=function(){var parents={slide:null,layout:null,master:null,theme:null};return parents};CGroupShape.prototype.applyTextArtForm=function(sPreset){for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].applyTextArtForm)this.spTree[i].applyTextArtForm(sPreset)};CGroupShape.prototype.createRotateTrack=function(){return new AscFormat.RotateTrackGroup(this)}; CGroupShape.prototype.createMoveTrack=function(){return new AscFormat.MoveGroupTrack(this)};CGroupShape.prototype.createResizeTrack=function(cardDirection){return new AscFormat.ResizeTrackGroup(this,cardDirection)};CGroupShape.prototype.resetSelection=function(graphicObjects){this.selection.textSelection=null;if(this.selection.chartSelection)this.selection.chartSelection.resetSelection();this.selection.chartSelection=null;for(var i=this.selectedObjects.length-1;i>-1;--i){var old_gr=this.selectedObjects[i].group; var obj=this.selectedObjects[i];obj.group=this;obj.deselect(graphicObjects);obj.group=old_gr}};CGroupShape.prototype.resetInternalSelection=AscFormat.DrawingObjectsController.prototype.resetInternalSelection;CGroupShape.prototype.recalculateCurPos=AscFormat.DrawingObjectsController.prototype.recalculateCurPos;CGroupShape.prototype.loadDocumentStateAfterLoadChanges=AscFormat.DrawingObjectsController.prototype.loadDocumentStateAfterLoadChanges;CGroupShape.prototype.getAllConnectors=AscFormat.DrawingObjectsController.prototype.getAllConnectors; CGroupShape.prototype.getAllShapes=AscFormat.DrawingObjectsController.prototype.getAllShapes;CGroupShape.prototype.checkDrawingBaseCoords=CShape.prototype.checkDrawingBaseCoords;CGroupShape.prototype.setDrawingBaseCoords=CShape.prototype.setDrawingBaseCoords;CGroupShape.prototype.calculateSnapArrays=function(snapArrayX,snapArrayY){var sp;for(var i=0;i<this.arrGraphicObjects.length;++i){sp=this.arrGraphicObjects[i];sp.calculateSnapArrays(snapArrayX,snapArrayY);sp.recalculateSnapArrays()}};CGroupShape.prototype.setNvSpPr= function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GroupShapeSetNvGrpSpPr,this.nvGrpSpPr,pr));this.nvGrpSpPr=pr};CGroupShape.prototype.Restart_CheckSpelling=function(){for(var i=0;i<this.spTree.length;++i)this.spTree[i].Restart_CheckSpelling&&this.spTree[i].Restart_CheckSpelling()};CGroupShape.prototype.recalculateLocalTransform=CShape.prototype.recalculateLocalTransform;CGroupShape.prototype.bringToFront=function(){var i;var arrDrawings=[];for(i=this.spTree.length- 1;i>-1;--i)if(this.spTree[i].getObjectType()===AscDFH.historyitem_type_GroupShape)this.spTree[i].bringToFront();else if(this.spTree[i].selected)arrDrawings.push(this.removeFromSpTreeByPos(i));for(i=arrDrawings.length-1;i>-1;--i)this.addToSpTree(null,arrDrawings[i])};CGroupShape.prototype.bringForward=function(){var i;for(i=this.spTree.length-1;i>-1;--i)if(this.spTree[i].getObjectType()===AscDFH.historyitem_type_GroupShape)this.spTree[i].bringForward();else if(i<this.spTree.length-1&&this.spTree[i].selected&& !this.spTree[i+1].selected){var item=this.removeFromSpTreeByPos(i);this.addToSpTree(i+1,item)}};CGroupShape.prototype.sendToBack=function(){var i,arrDrawings=[];for(i=this.spTree.length-1;i>-1;--i)if(this.spTree[i].getObjectType()===AscDFH.historyitem_type_GroupShape)this.spTree[i].sendToBack();else if(this.spTree[i].selected)arrDrawings.push(this.removeFromSpTreeByPos(i));arrDrawings.reverse();for(i=0;i<arrDrawings.length;++i)this.addToSpTree(i,arrDrawings[i])};CGroupShape.prototype.bringBackward= function(){var i;for(i=0;i<this.spTree.length;++i)if(this.spTree[i].getObjectType()===AscDFH.historyitem_type_GroupShape)this.spTree[i].bringBackward();else if(i>0&&this.spTree[i].selected&&!this.spTree[i-1].selected)this.addToSpTree(i-1,this.removeFromSpTreeByPos(i))};CGroupShape.prototype.Refresh_RecalcData=function(oData){if(oData)switch(oData.Type){case AscDFH.historyitem_ShapeSetBDeleted:{if(!this.bDeleted)this.addToRecalculate();break}case AscDFH.historyitem_GroupShapeAddToSpTree:case AscDFH.historyitem_GroupShapeRemoveFromSpTree:{if(!this.bDeleted)this.handleUpdateSpTree(); break}}};CGroupShape.prototype.checkTypeCorrect=function(){if(!this.spPr)return false;if(this.spTree.length===0)return false;return true};CGroupShape.prototype.resetGroups=function(){for(var i=0;i<this.spTree.length;++i){if(this.spTree[i].resetGroups)this.spTree[i].resetGroups();if(this.spTree[i].group!==this)this.spTree[i].setGroup(this)}};CGroupShape.prototype.findConnector=function(x,y){for(var i=this.spTree.length-1;i>-1;--i){var oConInfo=this.spTree[i].findConnector(x,y);if(oConInfo)return oConInfo}return null}; CGroupShape.prototype.findConnectionShape=function(x,y){for(var i=this.spTree.length-1;i>-1;--i){var _ret=this.spTree[i].findConnectionShape(x,y);if(_ret)return _ret}return null};CGroupShape.prototype.GetAllContentControls=function(arrContentControls){for(var i=0;i<this.spTree.length;++i)this.spTree[i].GetAllContentControls(arrContentControls)};CGroupShape.prototype.getCopyWithSourceFormatting=function(oIdMap){var oPr=new AscFormat.CCopyObjectProperties;oPr.idMap=oIdMap;oPr.bSaveSourceFormatting= true;return this.copy(oPr)};CGroupShape.prototype.GetAllFields=function(isUseSelection,arrFields){var _arrFields=arrFields?arrFields:[],i;if(isUseSelection)for(i=0;i<this.selectedObjects.length;++i)this.selectedObjects[i].GetAllFields(isUseSelection,_arrFields);else for(i=0;i<this.spTree.length;++i)this.spTree[i].GetAllFields(isUseSelection,_arrFields);return _arrFields};CGroupShape.prototype.GetAllSeqFieldsByType=function(sType,aFields){for(var i=0;i<this.spTree.length;++i)this.spTree[i].GetAllSeqFieldsByType(sType, aFields)};CGroupShape.prototype.onSlicerUpdate=function(sName){var bRet=false;for(var i=0;i<this.spTree.length;++i)bRet=bRet||this.spTree[i].onSlicerUpdate(sName);return bRet};CGroupShape.prototype.onSlicerDelete=function(sName){var bRet=false;for(var i=0;i<this.spTree.length;++i)bRet=bRet||this.spTree[i].onSlicerDelete(sName);return bRet};CGroupShape.prototype.onSlicerLock=function(sName,bLock){for(var i=0;i<this.spTree.length;++i)this.spTree[i].onSlicerLock(sName,bLock)};CGroupShape.prototype.onSlicerChangeName= function(sName,sNewName){for(var i=0;i<this.spTree.length;++i)this.spTree[i].onSlicerChangeName(sName,sNewName)};CGroupShape.prototype.getSlicerViewByName=function(name){var res=null;for(var i=0;i<this.spTree.length;++i){res=this.spTree[i].getSlicerViewByName(name);if(res)return res}return res};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CGroupShape=CGroupShape})(window);"use strict";var GLOBAL_PATH_COUNT=0;(function(window,undefined){var MAX_LABELS_COUNT=300;var MAX_SERIES_COUNT= 255;var MAX_POINTS_COUNT=4096;var oNonSpaceRegExp=new RegExp(""+String.fromCharCode(160),"g");var c_oAscChartType=AscCommon.c_oAscChartType;var c_oAscChartSubType=AscCommon.c_oAscChartSubType;var parserHelp=AscCommon.parserHelp;var g_oIdCounter=AscCommon.g_oIdCounter;var g_oTableId=AscCommon.g_oTableId;var oNumFormatCache=AscCommon.oNumFormatCache;var CellAddress=AscCommon.CellAddress;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var global_MatrixTransformer=AscCommon.global_MatrixTransformer; var CShape=AscFormat.CShape;var Ax_Counter=AscFormat.Ax_Counter;var checkTxBodyDefFonts=AscFormat.checkTxBodyDefFonts;var c_oAscNumFormatType=Asc.c_oAscNumFormatType;var c_oAscTickLabelsPos=Asc.c_oAscTickLabelsPos;var c_oAscChartLegendShowSettings=Asc.c_oAscChartLegendShowSettings;var c_oAscTickMark=Asc.c_oAscTickMark;var EFFECT_NONE=0;var EFFECT_SUBTLE=1;var EFFECT_MODERATE=2;var EFFECT_INTENSE=3;var CHART_STYLE_MANAGER=null;var SKIP_LBL_LIMIT=100;var BAR_SHAPE_CONE=0;var BAR_SHAPE_CONETOMAX=1;var BAR_SHAPE_BOX= 2;var BAR_SHAPE_CYLINDER=3;var BAR_SHAPE_PYRAMID=4;var BAR_SHAPE_PYRAMIDTOMAX=5;var DISP_BLANKS_AS_GAP=0;var DISP_BLANKS_AS_SPAN=1;var DISP_BLANKS_AS_ZERO=2;function removePtsFromLit(lit){var i;if(Array.isArray(lit.pts))if(false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()){var start_idx=lit.pts.length-1;for(i=start_idx;i>-1;--i)lit.removeDPt(i)}else lit.pts.length=0}function checkVerticalTitle(title){return false}function checkNoFillMarkers(symbol){return symbol===AscFormat.SYMBOL_X|| symbol===AscFormat.SYMBOL_STAR||symbol===AscFormat.SYMBOL_PLUS}function GetTextPrFormArrObjects(aObjects,bFirstBreak,bLbl){var oResultTextPr;for(var i=0;i<aObjects.length;++i){var oContent=aObjects[i];if(!oContent)continue;oContent=bLbl?oContent.compiledDlb&&oContent.compiledDlb.txBody&&oContent.compiledDlb.txBody.content:oContent.txBody&&oContent.txBody.content;if(!oContent)continue;oContent.Set_ApplyToAll(true);var oTextPr=oContent.GetCalculatedTextPr();oContent.Set_ApplyToAll(false);if(!oResultTextPr){oResultTextPr= oTextPr;if(bFirstBreak)return oResultTextPr}else oResultTextPr.Compare(oTextPr)}return oResultTextPr}function checkBlackUnifill(unifill,bLines){if(unifill&&unifill.fill&&unifill.fill.color){var RGBA=unifill.fill.color.RGBA;if(RGBA.R===0&&RGBA.G===0&&RGBA.B===0)if(bLines){RGBA.R=134;RGBA.G=134;RGBA.B=134}else{RGBA.R=255;RGBA.G=255;RGBA.B=255}}}function CRect(x,y,w,h){this.x=x;this.y=y;this.w=w;this.h=h;this.fHorPadding=0;this.fVertPadding=0}CRect.prototype.copy=function(){var ret=new CRect(this.x, this.y,this.w,this.h);ret.fHorPadding=this.fHorPadding;ret.fVertPadding=this.fVertPadding;return ret};CRect.prototype.intersection=function(oRect){if(this.x+this.w<oRect.x||oRect.x+oRect.w<this.x||this.y+this.h<oRect.y||oRect.y+oRect.h<this.y)return false;var x0,y0,x1,y1;var bResetHorPadding=true,bResetVertPadding=true;if(this.fHorPadding>0&&oRect.fHorPadding>0){x0=this.x+oRect.fHorPadding;bResetHorPadding=false}else x0=Math.max(this.x,oRect.x);if(this.fVertPadding>0&&oRect.fVertPadding>0){y0=this.y+ oRect.fVertPadding;bResetVertPadding=false}else y0=Math.max(this.y,oRect.y);if(this.fHorPadding<0&&oRect.fHorPadding<0){x1=this.x+this.w+oRect.fHorPadding;bResetHorPadding=false}else x1=Math.min(this.x+this.w,oRect.x+oRect.w);if(this.fVertPadding<0&&oRect.fVertPadding<0){y1=this.y+this.h+oRect.fVertPadding;bResetVertPadding=false}else y1=Math.min(this.y+this.h,oRect.y+oRect.h);if(bResetHorPadding)this.fHorPadding=0;if(bResetVertPadding)this.fVertPadding=0;this.x=x0;this.y=y0;this.w=x1-x0;this.h=y1- y0;return true};function BBoxInfo(worksheet,bbox){this.worksheet=worksheet;if(window["Asc"]&&typeof window["Asc"].Range==="function")this.bbox=window["Asc"].Range(bbox.c1,bbox.r1,bbox.c2,bbox.r2,false);else this.bbox=bbox}BBoxInfo.prototype={checkIntersection:function(bboxInfo){if(this.worksheet!==bboxInfo.worksheet)return false;return this.bbox.isIntersect(bboxInfo.bbox)}};function CreateUnifillSolidFillSchemeColorByIndex(index){var ret=new AscFormat.CUniFill;ret.setFill(new AscFormat.CSolidFill); ret.fill.setColor(new AscFormat.CUniColor);ret.fill.color.setColor(new AscFormat.CSchemeColor);ret.fill.color.color.setId(index);return ret}function CChartStyleManager(){this.styles=[]}CChartStyleManager.prototype={init:function(){AscFormat.ExecuteNoHistory(function(){var DefaultDataPointPerDataPoint=[[CreateUniFillSchemeColorWidthTint(8,.885),CreateUniFillSchemeColorWidthTint(8,.55),CreateUniFillSchemeColorWidthTint(8,.78),CreateUniFillSchemeColorWidthTint(8,.925),CreateUniFillSchemeColorWidthTint(8, .7),CreateUniFillSchemeColorWidthTint(8,.3)],[CreateUniFillSchemeColorWidthTint(0,0),CreateUniFillSchemeColorWidthTint(1,0),CreateUniFillSchemeColorWidthTint(2,0),CreateUniFillSchemeColorWidthTint(3,0),CreateUniFillSchemeColorWidthTint(4,0),CreateUniFillSchemeColorWidthTint(5,0)],[CreateUniFillSchemeColorWidthTint(0,-.5),CreateUniFillSchemeColorWidthTint(1,-.5),CreateUniFillSchemeColorWidthTint(2,-.5),CreateUniFillSchemeColorWidthTint(3,-.5),CreateUniFillSchemeColorWidthTint(4,-.5),CreateUniFillSchemeColorWidthTint(5, -.5)],[CreateUniFillSchemeColorWidthTint(8,.05),CreateUniFillSchemeColorWidthTint(8,.55),CreateUniFillSchemeColorWidthTint(8,.78),CreateUniFillSchemeColorWidthTint(8,.15),CreateUniFillSchemeColorWidthTint(8,.7),CreateUniFillSchemeColorWidthTint(8,.3)]];var s=DefaultDataPointPerDataPoint;var f=CreateUniFillSchemeColorWidthTint;this.styles[0]=new CChartStyle(EFFECT_NONE,EFFECT_SUBTLE,s[0],EFFECT_SUBTLE,EFFECT_NONE,[],3,s[0],7);this.styles[1]=new CChartStyle(EFFECT_NONE,EFFECT_SUBTLE,s[1],EFFECT_SUBTLE, EFFECT_NONE,[],3,s[1],7);for(var i=2;i<8;++i)this.styles[i]=new CChartStyle(EFFECT_NONE,EFFECT_SUBTLE,[f(i-2,0)],EFFECT_SUBTLE,EFFECT_NONE,[],3,[f(i-2,0)],7);this.styles[8]=new CChartStyle(EFFECT_SUBTLE,EFFECT_SUBTLE,s[0],EFFECT_SUBTLE,EFFECT_SUBTLE,[f(12,0)],5,s[0],9);this.styles[9]=new CChartStyle(EFFECT_SUBTLE,EFFECT_SUBTLE,s[1],EFFECT_SUBTLE,EFFECT_SUBTLE,[f(12,0)],5,s[1],9);for(i=10;i<16;++i)this.styles[i]=new CChartStyle(EFFECT_SUBTLE,EFFECT_SUBTLE,[f(i-10,0)],EFFECT_SUBTLE,EFFECT_SUBTLE,[f(12, 0)],5,[f(i-10,0)],9);this.styles[16]=new CChartStyle(EFFECT_MODERATE,EFFECT_INTENSE,s[0],EFFECT_SUBTLE,EFFECT_NONE,[],5,s[0],9);this.styles[17]=new CChartStyle(EFFECT_MODERATE,EFFECT_INTENSE,s[1],EFFECT_INTENSE,EFFECT_NONE,[],5,s[1],9);for(i=18;i<24;++i)this.styles[i]=new CChartStyle(EFFECT_MODERATE,EFFECT_INTENSE,[f(i-18,0)],EFFECT_SUBTLE,EFFECT_NONE,[],5,[f(i-18,0)],9);this.styles[24]=new CChartStyle(EFFECT_INTENSE,EFFECT_INTENSE,s[0],EFFECT_SUBTLE,EFFECT_NONE,[],7,s[0],13);this.styles[25]=new CChartStyle(EFFECT_MODERATE, EFFECT_INTENSE,s[1],EFFECT_SUBTLE,EFFECT_NONE,[],7,s[1],13);for(i=26;i<32;++i)this.styles[i]=new CChartStyle(EFFECT_MODERATE,EFFECT_INTENSE,[f(i-26,0)],EFFECT_SUBTLE,EFFECT_NONE,[],7,[f(i-26,0)],13);this.styles[32]=new CChartStyle(EFFECT_NONE,EFFECT_SUBTLE,s[0],EFFECT_SUBTLE,EFFECT_SUBTLE,[f(8,-.5)],5,s[0],9);this.styles[33]=new CChartStyle(EFFECT_NONE,EFFECT_SUBTLE,s[1],EFFECT_SUBTLE,EFFECT_SUBTLE,s[2],5,s[1],9);for(i=34;i<40;++i)this.styles[i]=new CChartStyle(EFFECT_NONE,EFFECT_SUBTLE,[f(i-34,0)], EFFECT_SUBTLE,EFFECT_SUBTLE,[f(i-34,-.5)],5,[f(i-34,0)],9);this.styles[40]=new CChartStyle(EFFECT_INTENSE,EFFECT_INTENSE,s[3],EFFECT_SUBTLE,EFFECT_NONE,[],5,s[3],9);this.styles[41]=new CChartStyle(EFFECT_INTENSE,EFFECT_INTENSE,s[1],EFFECT_INTENSE,EFFECT_NONE,[],5,s[1],9);for(i=42;i<48;++i)this.styles[i]=new CChartStyle(EFFECT_INTENSE,EFFECT_INTENSE,[f(i-42,0)],EFFECT_SUBTLE,EFFECT_NONE,[],5,[f(i-42,0)],9);this.defaultLineStyles=[];this.defaultLineStyles[0]=new ChartLineStyle(f(15,.75),f(15,.5),f(15, .75),f(15,0),EFFECT_SUBTLE);for(i=0;i<32;++i)this.defaultLineStyles[i]=this.defaultLineStyles[0];this.defaultLineStyles[32]=new ChartLineStyle(f(8,.75),f(8,.5),f(8,.75),f(8,0),EFFECT_SUBTLE);this.defaultLineStyles[33]=this.defaultLineStyles[32];this.defaultLineStyles[34]=new ChartLineStyle(f(8,.75),f(8,.5),f(8,.75),f(8,0),EFFECT_SUBTLE);for(i=35;i<40;++i)this.defaultLineStyles[i]=this.defaultLineStyles[34];this.defaultLineStyles[40]=new ChartLineStyle(f(8,.75),f(8,.9),f(12,0),f(12,0),EFFECT_NONE); for(i=41;i<48;++i)this.defaultLineStyles[i]=this.defaultLineStyles[40]},this,[])},getStyleByIndex:function(index){if(AscFormat.isRealNumber(index))return this.styles[(index-1)%48];return this.styles[1]},getDefaultLineStyleByIndex:function(index){if(AscFormat.isRealNumber(index))return this.defaultLineStyles[(index-1)%48];return this.defaultLineStyles[2]}};CHART_STYLE_MANAGER=new CChartStyleManager;function ChartLineStyle(axisAndMajorGridLines,minorGridlines,chartArea,otherLines,floorChartArea){this.axisAndMajorGridLines= axisAndMajorGridLines;this.minorGridlines=minorGridlines;this.chartArea=chartArea;this.otherLines=otherLines;this.floorChartArea=floorChartArea}function CChartStyle(effect,fill1,fill2,fill3,line1,line2,line3,line4,markerSize){this.effect=effect;this.fill1=fill1;this.fill2=fill2;this.fill3=fill3;this.line1=line1;this.line2=line2;this.line3=line3;this.line4=line4;this.markerSize=markerSize}function CreateUniFillSchemeColorWidthTint(schemeColorId,tintVal){return AscFormat.ExecuteNoHistory(function(schemeColorId, tintVal){return CreateUniFillSolidFillWidthTintOrShade(CreateUnifillSolidFillSchemeColorByIndex(schemeColorId),tintVal)},this,[schemeColorId,tintVal])}function checkFiniteNumber(num){if(AscFormat.isRealNumber(num)&&isFinite(num)&&num>0)return num;return 0}var G_O_VISITED_HLINK_COLOR=CreateUniFillSolidFillWidthTintOrShade(CreateUnifillSolidFillSchemeColorByIndex(10),0);var G_O_HLINK_COLOR=CreateUniFillSolidFillWidthTintOrShade(CreateUnifillSolidFillSchemeColorByIndex(11),0);var G_O_NO_ACTIVE_COMMENT_BRUSH= AscFormat.CreateUniFillByUniColor(AscFormat.CreateUniColorRGB(248,231,195));var G_O_ACTIVE_COMMENT_BRUSH=AscFormat.CreateUniFillByUniColor(AscFormat.CreateUniColorRGB(240,200,120));var CChangesDrawingsBool=AscDFH.CChangesDrawingsBool;var CChangesDrawingsLong=AscDFH.CChangesDrawingsLong;var CChangesDrawingsDouble=AscDFH.CChangesDrawingsDouble;var CChangesDrawingsString=AscDFH.CChangesDrawingsString;var CChangesDrawingsObject=AscDFH.CChangesDrawingsObject;var drawingsChangesMap=window["AscDFH"].drawingsChangesMap; AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetNvGrFrProps]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetThemeOverride]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ShapeSetBDeleted]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetParent]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetChart]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetClrMapOvr]= CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetDate1904]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetExternalData]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetLang]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetPivotSource]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetPrintSettings]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetProtection]= CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetRoundedCorners]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetSpPr]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetStyle]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetTxPr]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetGroup]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ExternalData_SetAutoUpdate]= CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ExternalData_SetId]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_PivotSource_SetFmtId]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PivotSource_SetName]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_Protection_SetChartObject]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Protection_SetData]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Protection_SetFormatting]= CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Protection_SetSelection]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Protection_SetUserInterface]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_PrintSettingsSetHeaderFooter]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PrintSettingsSetPageMargins]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PrintSettingsSetPageSetup]=CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetAlignWithMargins]= CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetDifferentFirst]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetDifferentOddEven]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetEvenFooter]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetEvenHeader]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetFirstFooter]=CChangesDrawingsString; AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetFirstHeader]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetOddFooter]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_HeaderFooterChartSetOddHeader]=CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_PageMarginsSetB]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PageMarginsSetFooter]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PageMarginsSetHeader]= CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PageMarginsSetL]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PageMarginsSetR]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PageMarginsSetT]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetBlackAndWhite]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetCopies]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetDraft]=CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetFirstPageNumber]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetHorizontalDpi]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetOrientation]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetPaperHeight]=CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetPaperSize]=CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetPaperWidth]= CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetUseFirstPageNumb]=CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_PageSetupSetVerticalDpi]=CChangesDrawingsLong;function CheckParagraphTextPr(oParagraph,oTextPr){var oParaPr=oParagraph.Pr.Copy();var oParaPr2=new CParaPr;var oCopyTextPr=oTextPr.Copy();if(oCopyTextPr.FontFamily)oCopyTextPr.RFonts.Set_FromObject({Ascii:{Name:oCopyTextPr.FontFamily.Name,Index:-1},EastAsia:{Name:oCopyTextPr.FontFamily.Name,Index:-1}, HAnsi:{Name:oCopyTextPr.FontFamily.Name,Index:-1},CS:{Name:oCopyTextPr.FontFamily.Name,Index:-1}});oParaPr2.DefaultRunPr=oCopyTextPr;oParaPr.Merge(oParaPr2);oParagraph.Set_Pr(oParaPr)}function CheckObjectTextPr(oElement,oTextPr,oDrawingDocument){if(oElement){if(!oElement.txPr)oElement.setTxPr(AscFormat.CreateTextBodyFromString("",oDrawingDocument,oElement));oElement.txPr.content.Content[0].Set_DocumentIndex(0);CheckParagraphTextPr(oElement.txPr.content.Content[0],oTextPr);if(oElement.tx&&oElement.tx.rich){var aContent= oElement.tx.rich.content.Content;for(var i=0;i<aContent.length;++i)CheckParagraphTextPr(aContent[i],oTextPr);oElement.tx.rich.content.Set_ApplyToAll(true);var oParTextPr=new AscCommonWord.ParaTextPr(oTextPr);oElement.tx.rich.content.AddToParagraph(oParTextPr);oElement.tx.rich.content.Set_ApplyToAll(false)}CheckParagraphTextPr(oElement.txPr.content.Content[0],oTextPr)}}function CheckIncDecFontSize(oElement,bIncrease,oDrawingDocument,nDefaultSize){if(oElement){if(!oElement.txPr)oElement.setTxPr(AscFormat.CreateTextBodyFromString("", oDrawingDocument,oElement));var oParaPr=oElement.txPr.content.Content[0].Pr.Copy();oElement.txPr.content.Content[0].Set_DocumentIndex(0);var oCopyTextPr;if(oParaPr.DefaultRunPr)oCopyTextPr=oParaPr.DefaultRunPr.Copy();else oCopyTextPr=new CTextPr;if(!AscFormat.isRealNumber(oCopyTextPr.FontSize))oCopyTextPr.FontSize=nDefaultSize;oCopyTextPr.FontSize=oCopyTextPr.GetIncDecFontSize(bIncrease);oParaPr.DefaultRunPr=oCopyTextPr;oElement.txPr.content.Content[0].Set_Pr(oParaPr);if(oElement.tx&&oElement.tx.rich){oElement.tx.rich.content.Set_ApplyToAll(true); oElement.tx.rich.content.IncreaseDecreaseFontSize(bIncrease);oElement.tx.rich.content.Set_ApplyToAll(false)}}}function CPathMemory(){this.size=1E3;this.ArrPathCommand=new Float64Array(this.size);this.curPos=-1;this.path=new AscFormat.Path2(this)}CPathMemory.prototype.AllocPath=function(){if(this.curPos+1>=this.ArrPathCommand.length){var aNewArray=new Float64Array((3/2*(this.curPos+1)>>0)+1);for(var i=0;i<this.ArrPathCommand.length;++i)aNewArray[i]=this.ArrPathCommand[i];this.ArrPathCommand=aNewArray; this.path.ArrPathCommand=aNewArray}this.path.startPos=++this.curPos;this.path.curLen=0;this.ArrPathCommand[this.curPos]=0;return this.path};CPathMemory.prototype.AllocPath2=function(){this.path=new AscFormat.Path2(this);return this.AllocPath()};CPathMemory.prototype.GetPath=function(index){this.path.startPos=index;this.path.curLen=0;return this.path};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetNvGrFrProps]=function(oClass,value){oClass.nvGraphicFramePr=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetThemeOverride]= function(oClass,value){oClass.themeOverride=value};drawingsChangesMap[AscDFH.historyitem_ShapeSetBDeleted]=function(oClass,value){oClass.bDeleted=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetParent]=function(oClass,value){oClass.parent=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetChart]=function(oClass,value){oClass.chart=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetClrMapOvr]=function(oClass,value){oClass.clrMapOvr=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetDate1904]= function(oClass,value){oClass.date1904=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetExternalData]=function(oClass,value){oClass.externalData=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetLang]=function(oClass,value){oClass.lang=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetPivotSource]=function(oClass,value){oClass.pivotSource=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetPrintSettings]=function(oClass,value){oClass.printSettings=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetProtection]= function(oClass,value){oClass.protection=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetRoundedCorners]=function(oClass,value){oClass.roundedCorners=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetStyle]=function(oClass,value){oClass.style=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetTxPr]=function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetGroup]= function(oClass,value){oClass.group=value};drawingsChangesMap[AscDFH.historyitem_ExternalData_SetAutoUpdate]=function(oClass,value){oClass.autoUpdate=value};drawingsChangesMap[AscDFH.historyitem_ExternalData_SetId]=function(oClass,value){oClass.id=value};drawingsChangesMap[AscDFH.historyitem_PivotSource_SetFmtId]=function(oClass,value){oClass.fmtId=value};drawingsChangesMap[AscDFH.historyitem_PivotSource_SetName]=function(oClass,value){oClass.name=value};drawingsChangesMap[AscDFH.historyitem_Protection_SetChartObject]= function(oClass,value){oClass.chartObject=value};drawingsChangesMap[AscDFH.historyitem_Protection_SetData]=function(oClass,value){oClass.data=value};drawingsChangesMap[AscDFH.historyitem_Protection_SetFormatting]=function(oClass,value){oClass.formatting=value};drawingsChangesMap[AscDFH.historyitem_Protection_SetSelection]=function(oClass,value){oClass.selection=value};drawingsChangesMap[AscDFH.historyitem_Protection_SetUserInterface]=function(oClass,value){oClass.userInterface=value};drawingsChangesMap[AscDFH.historyitem_PrintSettingsSetHeaderFooter]= function(oClass,value){oClass.headerFooter=value};drawingsChangesMap[AscDFH.historyitem_PrintSettingsSetPageMargins]=function(oClass,value){oClass.pageMargins=value};drawingsChangesMap[AscDFH.historyitem_PrintSettingsSetPageSetup]=function(oClass,value){oClass.pageSetup=value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetAlignWithMargins]=function(oClass,value){oClass.alignWithMargins=value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetDifferentFirst]=function(oClass,value){oClass.differentFirst= value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetDifferentOddEven]=function(oClass,value){oClass.differentOddEven=value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetEvenFooter]=function(oClass,value){oClass.evenFooter=value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetEvenHeader]=function(oClass,value){oClass.evenHeader=value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetFirstFooter]=function(oClass,value){oClass.firstFooter=value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetFirstHeader]= function(oClass,value){oClass.firstHeader=value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetOddFooter]=function(oClass,value){oClass.oddFooter=value};drawingsChangesMap[AscDFH.historyitem_HeaderFooterChartSetOddHeader]=function(oClass,value){oClass.oddHeader=value};drawingsChangesMap[AscDFH.historyitem_PageMarginsSetB]=function(oClass,value){oClass.b=value};drawingsChangesMap[AscDFH.historyitem_PageMarginsSetFooter]=function(oClass,value){oClass.footer=value};drawingsChangesMap[AscDFH.historyitem_PageMarginsSetHeader]= function(oClass,value){oClass.header=value};drawingsChangesMap[AscDFH.historyitem_PageMarginsSetL]=function(oClass,value){oClass.l=value};drawingsChangesMap[AscDFH.historyitem_PageMarginsSetR]=function(oClass,value){oClass.r=value};drawingsChangesMap[AscDFH.historyitem_PageMarginsSetT]=function(oClass,value){oClass.t=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetBlackAndWhite]=function(oClass,value){oClass.blackAndWhite=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetCopies]=function(oClass, value){oClass.copies=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetDraft]=function(oClass,value){oClass.draft=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetFirstPageNumber]=function(oClass,value){oClass.firstPageNumber=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetHorizontalDpi]=function(oClass,value){oClass.horizontalDpi=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetOrientation]=function(oClass,value){oClass.orientation=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetPaperHeight]= function(oClass,value){oClass.paperHeight=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetPaperSize]=function(oClass,value){oClass.paperSize=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetPaperWidth]=function(oClass,value){oClass.paperWidth=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetUseFirstPageNumb]=function(oClass,value){oClass.useFirstPageNumb=value};drawingsChangesMap[AscDFH.historyitem_PageSetupSetVerticalDpi]=function(oClass,value){oClass.verticalDpi=value}; function CLabelsBox(aStrings,oAxis,oChartSpace){this.x=0;this.y=0;this.extX=0;this.extY=0;this.aLabels=[];this.maxMinWidth=-1;this.chartSpace=oChartSpace;this.axis=oAxis;this.count=0;var oStyle=null,oLbl,fMinW;var oFirstTextPr=null;for(var i=0;i<aStrings.length;++i)if(typeof aStrings[i]==="string"){oLbl=fCreateLabel(aStrings[i],i,oAxis,oChartSpace,oAxis.txPr,oAxis.spPr,oChartSpace.getDrawingDocument());if(oStyle)oLbl.lastStyleObject=oStyle;if(oFirstTextPr){var aRuns=oLbl.tx.rich.content.Content[0]&& oLbl.tx.rich.content.Content[0].Content;if(aRuns)for(var j=0;j<aRuns.length;++j){var oRun=aRuns[j];if(oRun.RecalcInfo&&true===oRun.RecalcInfo.TextPr){oRun.RecalcInfo.TextPr=false;oRun.CompiledPr=oFirstTextPr}}}fMinW=oLbl.tx.rich.content.RecalculateMinMaxContentWidth().Min;if(!oFirstTextPr)if(oLbl.tx.rich.content.Content[0])oFirstTextPr=oLbl.tx.rich.content.Content[0].Get_FirstTextPr2();if(fMinW>this.maxMinWidth)this.maxMinWidth=fMinW;this.aLabels.push(oLbl);if(!oStyle)oStyle=oLbl.lastStyleObject; ++this.count}else this.aLabels.push(null)}CLabelsBox.prototype.draw=function(graphics){for(var i=0;i<this.aLabels.length;++i)if(this.aLabels[i])this.aLabels[i].draw(graphics)};CLabelsBox.prototype.checkMaxMinWidth=function(){if(this.maxMinWidth<0){var oStyle=null,oLbl,fMinW;for(var i=0;i<this.aLabels.length;++i){oLbl=this.aLabels[i];if(oLbl){if(oStyle)oLbl.lastStyleObject=oStyle;fMinW=oLbl.tx.rich.content.RecalculateMinMaxContentWidth().Min;if(fMinW>this.maxMinWidth)this.maxMinWidth=fMinW;if(!oStyle)oStyle= oLbl.lastStyleObject}}}return this.maxMinWidth>=0?this.maxMinWidth:0};CLabelsBox.prototype.hit=function(x,y){var tx,ty;if(this.chartSpace&&this.chartSpace.invertTransform){tx=this.chartSpace.invertTransform.TransformPointX(x,y);ty=this.chartSpace.invertTransform.TransformPointY(x,y);return tx>=this.x&&ty>=this.y&&tx<=this.x+this.extX&&ty<=this.y+this.extY}return false};CLabelsBox.prototype.updatePosition=function(x,y){for(var i=0;i<this.aLabels.length;++i)if(this.aLabels[i])this.aLabels[i].updatePosition(x, y)};CLabelsBox.prototype.layoutHorNormal=function(fAxisY,fDistance,fXStart,fInterval,bOnTickMark,fForceContentWidth){var fMaxHeight=0;var fCurX=bOnTickMark?fXStart-fInterval/2:fXStart;if(fInterval<0)fCurX+=fInterval;var oFirstLabel=null,fFirstLabelCenterX=null,oLastLabel=null,fLastLabelCenterX=null;var fContentWidth=fForceContentWidth?fForceContentWidth:Math.abs(fInterval);var fHorShift=Math.abs(fInterval)/2-fContentWidth/2;for(var i=0;i<this.aLabels.length;++i){if(this.aLabels[i]){var oLabel=this.aLabels[i]; var oContent=oLabel.tx.rich.content;oContent.Reset(0,0,fContentWidth,2E4);oContent.Recalculate_Page(0,true);var fCurHeight=oContent.GetSummaryHeight();if(fCurHeight>fMaxHeight)fMaxHeight=fCurHeight;var fX,fY;fX=fCurX+fHorShift;if(fDistance>=0)fY=fAxisY+fDistance;else fY=fAxisY+fDistance-fCurHeight;var oTransform=oLabel.transformText;oTransform.Reset();global_MatrixTransformer.TranslateAppend(oTransform,fX,fY);oTransform=oLabel.localTransformText;oTransform.Reset();global_MatrixTransformer.TranslateAppend(oTransform, fX,fY);if(oFirstLabel===null){oFirstLabel=oLabel;fFirstLabelCenterX=fCurX+Math.abs(fInterval)/2}oLastLabel=oLabel;fLastLabelCenterX=fCurX+Math.abs(fInterval)/2}fCurX+=fInterval}var x0,x1;if(bOnTickMark&&oFirstLabel&&oLastLabel){var fFirstLabelContentWidth=oFirstLabel.tx.rich.getMaxContentWidth(fContentWidth);var fLastLabelContentWidth=oLastLabel.tx.rich.getMaxContentWidth(fContentWidth);x0=Math.min(fFirstLabelCenterX-fFirstLabelContentWidth/2,fLastLabelCenterX-fLastLabelContentWidth/2,fXStart,fXStart+ fInterval*(this.aLabels.length-1));x1=Math.max(fFirstLabelCenterX+fFirstLabelContentWidth/2,fLastLabelCenterX+fLastLabelContentWidth/2,fXStart,fXStart+fInterval*(this.aLabels.length-1))}else{x0=Math.min(fXStart,fXStart+fInterval*this.aLabels.length);x1=Math.max(fXStart,fXStart+fInterval*this.aLabels.length)}this.x=x0;this.extX=x1-x0;if(fDistance>=0){this.y=fAxisY;this.extY=fDistance+fMaxHeight}else{this.y=fAxisY+fDistance-fMaxHeight;this.extY=fMaxHeight-fDistance}};CLabelsBox.prototype.layoutHorRotated= function(fAxisY,fDistance,fXStart,fXEnd,fInterval,bOnTickMark){var bTickLblSkip=AscFormat.isRealNumber(this.axis.tickLblSkip);if(bTickLblSkip)this.layoutHorRotated2(this.aLabels,fAxisY,fDistance,fXStart,fInterval,bOnTickMark);else{var fAngle=Math.PI/4,fMultiplier=Math.sin(fAngle);var aLabelsSource=[].concat(this.aLabels);var oLabel=aLabelsSource[0];var i=1;while(!oLabel&&i<aLabelsSource.length)oLabel=aLabelsSource[i];if(oLabel){var oContent=oLabel.tx.rich.content;oContent.Set_ApplyToAll(true);oContent.SetParagraphAlign(AscCommon.align_Left); oContent.SetParagraphIndent({FirstLine:0,Left:0});oContent.Set_ApplyToAll(false);var oSize=oLabel.tx.rich.getContentOneStringSizes();var fInset=fMultiplier*oSize.h;fInset*=2;if(fInset<=fInterval)this.layoutHorRotated2(this.aLabels,fAxisY,fDistance,fXStart,fInterval,bOnTickMark);else{var nIntervalCount=bOnTickMark?this.count-1:this.count;var fInterval_=Math.abs(fXEnd-fXStart)/nIntervalCount;var nLblTickSkip=fInset/fInterval_+.5>>0;var aLabels=[].concat(aLabelsSource);var index=0;if(nLblTickSkip>1)for(i= 0;i<aLabels.length;++i)if(aLabels[i]){if(index%nLblTickSkip!==0)aLabels[i]=null;index++}this.layoutHorRotated2(aLabels,fAxisY,fDistance,fXStart,fInterval,bOnTickMark)}}}};CLabelsBox.prototype.layoutHorRotated2=function(aLabels,fAxisY,fDistance,fXStart,fInterval,bOnTickMark){var i;var fMaxHeight=0;var fCurX=bOnTickMark?fXStart:fXStart+fInterval/2;var fAngle=Math.PI/4,fMultiplier=Math.sin(fAngle);var fMinLeft=null,fMaxRight=null;for(i=0;i<aLabels.length;++i){if(aLabels[i]){var oLabel=aLabels[i];var oContent= oLabel.tx.rich.content;oContent.Set_ApplyToAll(true);oContent.SetParagraphAlign(AscCommon.align_Left);oContent.SetParagraphIndent({FirstLine:0,Left:0});oContent.Set_ApplyToAll(false);var oSize=oLabel.tx.rich.getContentOneStringSizes();var fBoxW=fMultiplier*(oSize.w+oSize.h);var fBoxH=fBoxW;if(fBoxH>fMaxHeight)fMaxHeight=fBoxH;var fX1,fY0,fXC,fYC;fY0=fAxisY+fDistance;if(fDistance>=0){fXC=fCurX-oSize.w*fMultiplier/2;fYC=fY0+fBoxH/2}else{fXC=fCurX+oSize.w*fMultiplier/2;fYC=fY0-fBoxH/2}var oTransform= oLabel.localTransformText;oTransform.Reset();global_MatrixTransformer.TranslateAppend(oTransform,-oSize.w/2,-oSize.h/2);global_MatrixTransformer.RotateRadAppend(oTransform,fAngle);global_MatrixTransformer.TranslateAppend(oTransform,fXC,fYC);oLabel.transformText=oTransform.CreateDublicate();if(null===fMinLeft||fXC-fBoxW/2<fMinLeft)fMinLeft=fXC-fBoxW/2;if(null===fMaxRight||fXC+fBoxW/2>fMaxRight)fMaxRight=fXC+fBoxW/2}fCurX+=fInterval}this.aLabels=aLabels;var aPoints=[];aPoints.push(fXStart);var nIntervalCount= bOnTickMark?aLabels.length-1:aLabels.length;aPoints.push(fXStart+fInterval*nIntervalCount);if(null!==fMinLeft)aPoints.push(fMinLeft);if(null!==fMaxRight)aPoints.push(fMaxRight);this.x=Math.min.apply(Math,aPoints);this.extX=Math.max.apply(Math,aPoints)-this.x;if(fDistance>=0){this.y=fAxisY;this.extY=fDistance+fMaxHeight}else{this.y=fAxisY+fDistance-fMaxHeight;this.extY=fMaxHeight-fDistance}};CLabelsBox.prototype.layoutVertNormal=function(fAxisX,fDistance,fYStart,fInterval,bOnTickMark,fMaxBlockWidth){var fCurY= bOnTickMark?fYStart:fYStart+fInterval/2;var fDistance_=Math.abs(fDistance);var oTransform,oContent,oLabel,fMinY=fYStart,fMaxY=fYStart+fInterval*(this.aLabels.length-1),fY,i;var fMaxContentWidth=0,oSize;var fLabelHeight=0;for(i=0;i<this.aLabels.length;++i){oLabel=this.aLabels[i];if(oLabel){oSize=oLabel.tx.rich.getContentOneStringSizes();fLabelHeight=oSize.h;break}}var nIntervalCount=bOnTickMark?this.count-1:this.count;var fInterval_=Math.abs(fMinY-fMaxY)/nIntervalCount;var nLblTickSkip=fLabelHeight/ fInterval_>>0,index=0;if(nLblTickSkip>1)for(i=0;i<this.aLabels.length;++i)if(this.aLabels[i]){if(index%nLblTickSkip!==0)this.aLabels[i]=null;index++}for(i=0;i<this.aLabels.length;++i){if(this.aLabels[i]){oLabel=this.aLabels[i];oContent=oLabel.tx.rich.content;oContent.Set_ApplyToAll(true);oContent.SetParagraphAlign(AscCommon.align_Left);oContent.Set_ApplyToAll(false);oSize=oLabel.tx.rich.getContentOneStringSizes();if(oSize.w+fDistance_>fMaxBlockWidth)break;if(oSize.w>fMaxContentWidth)fMaxContentWidth= oSize.w;oTransform=oLabel.localTransformText;oTransform.Reset();fY=fCurY-oSize.h/2;if(fDistance>0)global_MatrixTransformer.TranslateAppend(oTransform,fAxisX+fDistance,fY);else global_MatrixTransformer.TranslateAppend(oTransform,fAxisX+fDistance-oSize.w,fY);oLabel.transformText=oTransform.CreateDublicate();if(fY<fMinY)fMinY=fY;if(fY+oSize.h>fMaxY)fMaxY=fY+oSize.h}fCurY+=fInterval}if(i<this.aLabels.length){var fMaxMinWidth=this.checkMaxMinWidth();fMaxContentWidth=0;for(i=0;i<this.aLabels.length;++i){oLabel= this.aLabels[i];if(oLabel){oContent=oLabel.tx.rich.content;oContent.Set_ApplyToAll(true);oContent.SetParagraphAlign(AscCommon.align_Center);oContent.Set_ApplyToAll(false);var fContentWidth;if(fMaxMinWidth+fDistance_<fMaxBlockWidth)fContentWidth=oContent.RecalculateMinMaxContentWidth().Min+.1;else fContentWidth=fMaxBlockWidth-fDistance_;if(fContentWidth>fMaxContentWidth)fMaxContentWidth=fContentWidth;oContent.Reset(0,0,fContentWidth,2E4);oContent.Recalculate_Page(0,true);var fContentHeight=oContent.GetSummaryHeight(); oTransform=oLabel.localTransformText;oTransform.Reset();fY=fCurY-fContentHeight/2;if(fDistance>0)global_MatrixTransformer.TranslateAppend(oTransform,fAxisX+fDistance,fY);else global_MatrixTransformer.TranslateAppend(oTransform,fAxisX+fDistance-fContentWidth,fY);oLabel.transformText=oTransform.CreateDublicate();if(fY<fMinY)fMinY=fY;if(fY+fContentHeight>fMaxY)fMaxY=fY+fContentHeight}fCurY+=fInterval}}if(fDistance>0)this.x=fAxisX;else this.x=fAxisX+fDistance-fMaxContentWidth;this.extX=fMaxContentWidth+ fDistance_;this.y=fMinY;this.extY=fMaxY-fMinY};CLabelsBox.prototype.setPosition=function(x,y){this.x=x;this.y=y;for(var i=0;i<this.aLabels.length;++i)if(this.aLabels[i]){var lbl=this.aLabels[i];lbl.setPosition(lbl.relPosX+x,lbl.relPosY+y)}};CLabelsBox.prototype.checkShapeChildTransform=function(t){for(var i=0;i<this.aLabels.length;++i)if(this.aLabels[i])this.aLabels[i].checkShapeChildTransform(t)};function fCreateLabel(sText,idx,oParent,oChart,oTxPr,oSpPr,oDrawingDocument){var dlbl=new AscFormat.CDLbl; dlbl.parent=oParent;dlbl.chart=oChart;dlbl.spPr=oSpPr;dlbl.txPr=oTxPr;dlbl.idx=idx;dlbl.tx=new AscFormat.CChartText;dlbl.tx.rich=AscFormat.CreateTextBodyFromString(sText,oDrawingDocument,dlbl);var content=dlbl.tx.rich.content;content.Set_ApplyToAll(true);content.SetParagraphAlign(AscCommon.align_Center);content.Set_ApplyToAll(false);dlbl.txBody=dlbl.tx.rich;dlbl.oneStringWidth=-1;return dlbl}function fLayoutHorLabelsBox(oLabelsBox,fY,fXStart,fXEnd,bOnTickMark,fDistance,bForceVertical,bNumbers,fForceContentWidth){var fAxisLength= fXEnd-fXStart;var nLabelsCount=oLabelsBox.aLabels.length;var bOnTickMark_=bOnTickMark&&nLabelsCount>1;var nIntervalCount=bOnTickMark_?nLabelsCount-1:nLabelsCount;var fInterval=fAxisLength/nIntervalCount;if(!bForceVertical||true){var fMaxMinWidth=oLabelsBox.checkMaxMinWidth();var fCheckInterval=AscFormat.isRealNumber(fForceContentWidth)?fForceContentWidth:Math.abs(fInterval);if(fMaxMinWidth<=fCheckInterval)oLabelsBox.layoutHorNormal(fY,fDistance,fXStart,fInterval,bOnTickMark_,fForceContentWidth);else oLabelsBox.layoutHorRotated(fY, fDistance,fXStart,fXEnd,fInterval,bOnTickMark_)}}function fLayoutVertLabelsBox(oLabelsBox,fX,fYStart,fYEnd,bOnTickMark,fDistance,bForceVertical){var fAxisLength=fYEnd-fYStart;var nLabelsCount=oLabelsBox.aLabels.length;var bOnTickMark_=bOnTickMark&&nLabelsCount>1;var nIntervalCount=bOnTickMark_?nLabelsCount-1:nLabelsCount;var fInterval=fAxisLength/nIntervalCount;if(!bForceVertical||true)oLabelsBox.layoutVertNormal(fX,fDistance,fYStart,fInterval,bOnTickMark_);else;}function CAxisGrid(){this.nType=0; this.fStart=0;this.fStride=0;this.bOnTickMark=true;this.nCount=0;this.minVal=0;this.maxVal=0;this.aStrings=[]}function CChartSelection(){this.reset()}CChartSelection.prototype.reset=function(){this.title=null;this.legend=null;this.legendEntry=null;this.axisLbls=null;this.dataLbls=null;this.dataLbl=null;this.plotArea=null;this.rotatePlotArea=null;this.axis=null;this.minorGridlines=null;this.majorGridlines=null;this.gridLines=null;this.chart=null;this.series=null;this.datPoint=null;this.hiLowLines= null;this.upBars=null;this.downBars=null;this.markers=null;this.textSelection=null};function CChartSpace(){AscFormat.CGraphicObjectBase.call(this);this.nvGraphicFramePr=null;this.chart=null;this.clrMapOvr=null;this.date1904=null;this.externalData=null;this.lang=null;this.pivotSource=null;this.printSettings=null;this.protection=null;this.roundedCorners=null;this.spPr=null;this.style=2;this.txPr=null;this.themeOverride=null;this.pathMemory=new CPathMemory;this.cachedCanvas=null;this.userShapes=[];this.bbox= null;this.ptsCount=0;this.isSparkline=false;this.selection={title:null,legend:null,legendEntry:null,axisLbls:null,dataLbls:null,dataLbl:null,plotArea:null,rotatePlotArea:null,axis:null,minorGridlines:null,majorGridlines:null,gridLines:null,chart:null,series:null,datPoint:null,hiLowLines:null,upBars:null,downBars:null,markers:null,textSelection:null}}CChartSpace.prototype=Object.create(AscFormat.CGraphicObjectBase.prototype);CChartSpace.prototype.constructor=CChartSpace;CChartSpace.prototype.AllocPath= function(){return this.pathMemory.AllocPath().startPos};CChartSpace.prototype.GetPath=function(index){return this.pathMemory.GetPath(index)};CChartSpace.prototype.select=CShape.prototype.select;CChartSpace.prototype.checkDrawingBaseCoords=CShape.prototype.checkDrawingBaseCoords;CChartSpace.prototype.setDrawingBaseCoords=CShape.prototype.setDrawingBaseCoords;CChartSpace.prototype.checkTypeCorrect=function(){if(!this.chart)return false;if(!this.chart.plotArea)return false;if(this.chart.plotArea.charts.length=== 0)return false;var allSeries=this.getAllSeries();if(allSeries.length===0)return false;return true};CChartSpace.prototype.getSortedChartsId=function(){if(this.chartObj)return this.chartObj._sortChartsForDrawing(this);return[]};CChartSpace.prototype._getSeriesArrayIdx=function(oChart,nSeriesIdx){if(oChart.series[nSeriesIdx]&&oChart.series[nSeriesIdx].idx===nSeriesIdx)return nSeriesIdx;for(var i=0;i<oChart.series.length;++i)if(oChart.series[i].idx===nSeriesIdx)return i;return-1};CChartSpace.prototype._getPtArrayIdx= function(oChart,nSeriesIdx,nPtIdx){var oSeries=oChart.series[this._getSeriesArrayIdx(nSeriesIdx)];if(oSeries){var aPoints=getPtsFromSeries(oSeries);if(aPoints[nPtIdx]&&aPoints[nPtIdx].idx===nPtIdx)return nPtIdx;for(var i=0;i<aPoints.length;++i)if(aPoints[i].idx===nPtIdx)return i}return-1};CChartSpace.prototype.getMarkerPaths=function(sChartId,nSeriesIdx,nPtIdx){var oChartObj=this.chartObj;if(!oChartObj)return[];var oChart=AscCommon.g_oTableId.Get_ById(sChartId);if(!AscCommon.isRealObject(oChart))return[]; var oDrawChart=oChartObj.charts[sChartId];if(!AscCommon.isRealObject(oDrawChart))return[];if(!AscCommon.isRealObject(oDrawChart.paths))return[];if(!Array.isArray(oDrawChart.paths.points))return[];var nArrayIdx=this._getSeriesArrayIdx(oChart,nSeriesIdx);if(!AscCommon.isRealObject(oDrawChart.paths.points[nArrayIdx]))return[];if(!Array.isArray(oDrawChart.paths.points[nArrayIdx]))return[];var aMarkers=oDrawChart.paths.points[nArrayIdx];var nPtIdx=this._getPtArrayIdx(oChart,nSeriesIdx,nPtIdx);if(!AscFormat.isRealNumber(aMarkers[nPtIdx]))return[]; return[aMarkers[nPtIdx]]};CChartSpace.prototype.drawSelect=function(drawingDocument,nPageIndex){var i,oPath;if(this.selectStartPage===nPageIndex){drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE,this.getTransformMatrix(),0,0,this.extX,this.extY,false,this.canRotate());if(window["NATIVE_EDITOR_ENJINE"])return;if(this.selection.textSelection)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,this.selection.textSelection.transform,0,0,this.selection.textSelection.extX,this.selection.textSelection.extY, false,false,false);else if(this.selection.title)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,this.selection.title.transform,0,0,this.selection.title.extX,this.selection.title.extY,false,false,false);else if(AscFormat.isRealNumber(this.selection.dataLbls)){var series=this.getAllSeries();var ser=series[this.selection.dataLbls];if(ser){var pts=AscFormat.getPtsFromSeries(ser);if(!AscFormat.isRealNumber(this.selection.dataLbl))for(i=0;i<pts.length;++i){if(pts[i]&&pts[i].compiledDlb&&!pts[i].compiledDlb.bDelete)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT, pts[i].compiledDlb.transform,0,0,pts[i].compiledDlb.extX,pts[i].compiledDlb.extY,false,false)}else if(pts[this.selection.dataLbl]&&pts[this.selection.dataLbl].compiledDlb)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,pts[this.selection.dataLbl].compiledDlb.transform,0,0,pts[this.selection.dataLbl].compiledDlb.extX,pts[this.selection.dataLbl].compiledDlb.extY,false,false)}}else if(this.selection.dataLbl)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,this.selection.dataLbl.transform, 0,0,this.selection.dataLbl.extX,this.selection.dataLbl.extY,false,false);else if(this.selection.legend)if(AscFormat.isRealNumber(this.selection.legendEntry)){var oEntry=this.chart.legend.findCalcEntryByIdx(this.selection.legendEntry);if(oEntry)drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,oEntry.transformText,0,0,oEntry.contentWidth,oEntry.contentHeight,false,false)}else drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE,this.selection.legend.transform,0,0,this.selection.legend.extX, this.selection.legend.extY,false,false);else if(this.selection.axisLbls){var oLabels=this.selection.axisLbls.labels;drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.CHART_TEXT,this.transform,oLabels.x,oLabels.y,oLabels.extX,oLabels.extY,false,false)}else if(this.selection.hiLowLines){if(this.chartObj){var oDrawChart=this.chartObj.charts[this.selection.chart];if(oDrawChart){var seriesPaths=oDrawChart.paths.values;if(Array.isArray(seriesPaths))for(var i=0;i<seriesPaths.length;++i){if(AscFormat.isRealNumber(seriesPaths[i].lowLines)){oPath= this.GetPath(seriesPaths[i].lowLines);oPath.drawTracks(drawingDocument,this.transform)}if(AscFormat.isRealNumber(seriesPaths[i].highLines)){oPath=this.GetPath(seriesPaths[i].highLines);oPath.drawTracks(drawingDocument,this.transform)}}}}}else if(this.selection.upBars){if(this.chartObj){var oDrawChart=this.chartObj.charts[this.selection.chart];if(oDrawChart){var seriesPaths=oDrawChart.paths.values;if(Array.isArray(seriesPaths))for(var i=0;i<seriesPaths.length;++i)if(AscFormat.isRealNumber(seriesPaths[i].upBars)){oPath= this.GetPath(seriesPaths[i].upBars);oPath.drawTracks(drawingDocument,this.transform)}}}}else if(this.selection.downBars){if(this.chartObj){var oDrawChart=this.chartObj.charts[this.selection.chart];if(oDrawChart){var seriesPaths=oDrawChart.paths.values;if(Array.isArray(seriesPaths))for(var i=0;i<seriesPaths.length;++i)if(AscFormat.isRealNumber(seriesPaths[i].downBars)){oPath=this.GetPath(seriesPaths[i].downBars);oPath.drawTracks(drawingDocument,this.transform)}}}}else if(this.selection.plotArea){var oChartSize= this.getChartSizes(true);drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE,this.transform,oChartSize.startX,oChartSize.startY,oChartSize.w,oChartSize.h,false,false)}else if(AscFormat.isRealNumber(this.selection.series)){if(this.chartObj){var oDrawChart=this.chartObj.charts[this.selection.chart];if(oDrawChart){var seriesPaths=this.selection.markers?oDrawChart.paths.points:oDrawChart.paths.series;var Paths;var b3dPie=oDrawChart.chart.getObjectType()===AscDFH.historyitem_type_PieChart;if(b3dPie)Paths= seriesPaths;else if(Array.isArray(seriesPaths))Paths=seriesPaths[this.selection.series];if(Array.isArray(Paths)){var aPointsPaths=Paths;if(AscFormat.isRealNumber(this.selection.datPoint))if(AscFormat.isRealNumber(aPointsPaths[this.selection.datPoint])){oPath=this.GetPath(aPointsPaths[this.selection.datPoint]);oPath.drawTracks(drawingDocument,this.transform)}else if(Array.isArray(aPointsPaths[this.selection.datPoint])){var aPointsPaths2=aPointsPaths[this.selection.datPoint];for(var z=0;z<aPointsPaths2.length;++z)if(AscCommon.isRealObject(aPointsPaths2[z])){if(AscFormat.isRealNumber(aPointsPaths2[z].downPath)&& !b3dPie){oPath=this.GetPath(aPointsPaths2[z].downPath);oPath.drawTracks(drawingDocument,this.transform)}if(AscFormat.isRealNumber(aPointsPaths2[z].upPath)){oPath=this.GetPath(aPointsPaths2[z].upPath);oPath.drawTracks(drawingDocument,this.transform)}var aFrontPaths=aPointsPaths2[z].frontPath||aPointsPaths2[z].frontPaths;if(Array.isArray(aFrontPaths)&&!b3dPie)for(var s=0;s<aFrontPaths.length;++s)if(AscFormat.isRealNumber(aFrontPaths[s])){oPath=this.GetPath(aFrontPaths[s]);oPath.drawTracks(drawingDocument, this.transform)}aFrontPaths=aPointsPaths2[z].darkPaths;if(Array.isArray(aFrontPaths))for(var s=0;s<aFrontPaths.length;++s)if(AscFormat.isRealNumber(aFrontPaths[s])){oPath=this.GetPath(aFrontPaths[s]);oPath.drawTracks(drawingDocument,this.transform)}}else if(AscFormat.isRealNumber(aPointsPaths2[z])){oPath=this.GetPath(aPointsPaths2[z]);oPath.drawTracks(drawingDocument,this.transform)}}else{if(AscCommon.isRealObject(aPointsPaths[this.selection.datPoint])){if(Array.isArray(aPointsPaths[this.selection.datPoint].frontPaths))for(var l= 0;l<aPointsPaths[this.selection.datPoint].frontPaths.length;++l)if(AscFormat.isRealNumber(aPointsPaths[this.selection.datPoint].frontPaths[l])){oPath=this.GetPath(aPointsPaths[this.selection.datPoint].frontPaths[l]);oPath.drawTracks(drawingDocument,this.transform)}if(Array.isArray(aPointsPaths[this.selection.datPoint].darkPaths))for(var l=0;l<aPointsPaths[this.selection.datPoint].darkPaths.length;++l)if(AscFormat.isRealNumber(aPointsPaths[this.selection.datPoint].darkPaths[l])){oPath=this.GetPath(aPointsPaths[this.selection.datPoint].darkPaths[l]); oPath.drawTracks(drawingDocument,this.transform)}if(AscFormat.isRealNumber(aPointsPaths[this.selection.datPoint].path)){oPath=this.GetPath(aPointsPaths[this.selection.datPoint].path);oPath.drawTracks(drawingDocument,this.transform)}}}else for(var l=0;l<aPointsPaths.length;++l)if(AscFormat.isRealNumber(aPointsPaths[l])){oPath=this.GetPath(aPointsPaths[l]);oPath.drawTracks(drawingDocument,this.transform)}else if(Array.isArray(aPointsPaths[l])){var aPointsPaths2=aPointsPaths[l];for(var z=0;z<aPointsPaths2.length;++z)if(AscFormat.isRealNumber(aPointsPaths2[z])){oPath= this.GetPath(aPointsPaths2[z]);oPath.drawTracks(drawingDocument,this.transform)}else if(AscCommon.isRealObject(aPointsPaths2[z])){if(AscFormat.isRealNumber(aPointsPaths2[z].downPath)&&!b3dPie){oPath=this.GetPath(aPointsPaths2[z].downPath);oPath.drawTracks(drawingDocument,this.transform)}if(AscFormat.isRealNumber(aPointsPaths2[z].upPath)){oPath=this.GetPath(aPointsPaths2[z].upPath);oPath.drawTracks(drawingDocument,this.transform)}var aFrontPaths=aPointsPaths2[z].frontPath||aPointsPaths2[z].frontPaths; if(Array.isArray(aFrontPaths)&&!b3dPie)for(var s=0;s<aFrontPaths.length;++s)if(AscFormat.isRealNumber(aFrontPaths[s])){oPath=this.GetPath(aFrontPaths[s]);oPath.drawTracks(drawingDocument,this.transform)}aFrontPaths=aPointsPaths2[z].darkPaths;if(Array.isArray(aFrontPaths))for(var s=0;s<aFrontPaths.length;++s)if(AscFormat.isRealNumber(aFrontPaths[s])){oPath=this.GetPath(aFrontPaths[s]);oPath.drawTracks(drawingDocument,this.transform)}}}else if(AscCommon.isRealObject(aPointsPaths[l])){if(Array.isArray(aPointsPaths[l].frontPaths))for(var p= 0;p<aPointsPaths[l].frontPaths.length;++p)if(AscFormat.isRealNumber(aPointsPaths[l].frontPaths[p])){oPath=this.GetPath(aPointsPaths[l].frontPaths[p]);oPath.drawTracks(drawingDocument,this.transform)}if(Array.isArray(aPointsPaths[l].darkPaths))for(var p=0;p<aPointsPaths[l].darkPaths.length;++p)if(AscFormat.isRealNumber(aPointsPaths[l].darkPaths[p])){oPath=this.GetPath(aPointsPaths[l].darkPaths[p]);oPath.drawTracks(drawingDocument,this.transform)}if(AscFormat.isRealNumber(aPointsPaths[l].path)){oPath= this.GetPath(aPointsPaths[l].path);oPath.drawTracks(drawingDocument,this.transform)}}}else if(AscFormat.isRealNumber(Paths)){if(AscFormat.isRealNumber(this.selection.datPoint))Paths=seriesPaths[this.selection.datPoint];oPath=this.GetPath(Paths);oPath.drawTracks(drawingDocument,this.transform)}}}}else if(this.selection.axis){var oAxObj;var oChartObj=this.chartObj;if(this.selection.axis.getObjectType()===AscDFH.historyitem_type_CatAx||this.selection.axis.getObjectType()===AscDFH.historyitem_type_DateAx){if(Array.isArray(oChartObj.catAxisChart))for(i= 0;i<oChartObj.catAxisChart.length;++i)if(oChartObj.catAxisChart[i]&&oChartObj.catAxisChart[i].catAx===this.selection.axis){oAxObj=oChartObj.catAxisChart[i];break}}else if(this.selection.axis.getObjectType()===AscDFH.historyitem_type_ValAx)if(Array.isArray(oChartObj.valAxisChart))for(i=0;i<oChartObj.valAxisChart.length;++i)if(oChartObj.valAxisChart[i]&&oChartObj.valAxisChart[i].valAx===this.selection.axis){oAxObj=oChartObj.valAxisChart[i];break}if(this.selection.majorGridlines){if(oAxObj&&oAxObj.paths&& AscFormat.isRealNumber(oAxObj.paths.gridLines)){oPath=this.GetPath(oAxObj.paths.gridLines);oPath.drawTracks(drawingDocument,this.transform)}}else if(this.selection.minorGridlines)if(oAxObj&&oAxObj.paths&&AscFormat.isRealNumber(oAxObj.paths.minorGridLines)){oPath=this.GetPath(oAxObj.paths.minorGridLines);oPath.drawTracks(drawingDocument,this.transform)}}}};CChartSpace.prototype.recalculateTextPr=function(){if(this.txPr&&this.txPr.content){this.txPr.content.Reset(0,0,10,10);this.txPr.content.Recalculate_Page(0, true)}};CChartSpace.prototype.getSelectionState=function(){var content_selection=null,content=null;if(this.selection.textSelection){content=this.selection.textSelection.getDocContent();if(content)content_selection=content.GetSelectionState()}return{content:content,title:this.selection.title,legend:this.selection.legend,legendEntry:this.selection.legendEntry,axisLbls:this.selection.axisLbls,dataLbls:this.selection.dataLbls,dataLbl:this.selection.dataLbl,textSelection:this.selection.textSelection,plotArea:this.selection.plotArea, rotatePlotArea:this.selection.rotatePlotArea,contentSelection:content_selection,recalcTitle:this.recalcInfo.recalcTitle,bRecalculatedTitle:this.recalcInfo.bRecalculatedTitle,axis:this.selection.axis,minorGridlines:this.selection.minorGridlines,majorGridlines:this.selection.majorGridlines,gridLines:this.selection.gridLines,chart:this.selection.chart,series:this.selection.series,datPoint:this.selection.datPoint,markers:this.selection.markers,hiLowLines:this.selection.hiLowLines,upBars:this.selection.upBars, downBars:this.selection.downBars}};CChartSpace.prototype.setSelectionState=function(state){this.selection.title=state.title;this.selection.legend=state.legend;this.selection.legendEntry=state.legendEntry;this.selection.axisLbls=state.axisLbls;this.selection.dataLbls=state.dataLbls;this.selection.dataLbl=state.dataLbl;this.selection.rotatePlotArea=state.rotatePlotArea;this.selection.textSelection=state.textSelection;this.selection.plotArea=state.plotArea;this.selection.axis=state.axis;this.selection.minorGridlines= state.minorGridlines;this.selection.majorGridlines=state.majorGridlines;this.selection.gridLines=state.gridLines;this.selection.chart=state.chart;this.selection.datPoint=state.datPoint;this.selection.markers=state.markers;this.selection.series=state.series;this.selection.hiLowLines=state.hiLowLines;this.selection.downBars=state.downBars;this.selection.upBars=state.upBars;if(isRealObject(state.recalcTitle)){this.recalcInfo.recalcTitle=state.recalcTitle;this.recalcInfo.bRecalculatedTitle=state.bRecalculatedTitle}if(state.contentSelection)if(this.selection.textSelection){var content= this.selection.textSelection.getDocContent();if(content)content.SetSelectionState(state.contentSelection,state.contentSelection.length-1)}};CChartSpace.prototype.loadDocumentStateAfterLoadChanges=function(state){this.selection.title=null;this.selection.legend=null;this.selection.legendEntry=null;this.selection.axisLbls=null;this.selection.dataLbls=null;this.selection.dataLbl=null;this.selection.plotArea=null;this.selection.rotatePlotArea=null;this.selection.gridLine=null;this.selection.series=null; this.selection.datPoint=null;this.selection.markers=null;this.selection.textSelection=null;this.selection.axis=null;this.selection.minorGridlines=null;this.selection.majorGridlines=null;this.selection.hiLowLines=null;this.selection.upBars=null;this.selection.downBars=null;var bRet=false,aTitles,i;if(state.DrawingsSelectionState){var chartSelection=state.DrawingsSelectionState.chartSelection;if(chartSelection)if(this.chart)if(chartSelection.title){aTitles=this.getAllTitles();for(i=0;i<aTitles.length;++i)if(aTitles[i]=== chartSelection.title){this.selection.title=aTitles[i];bRet=true;break}if(this.selection.title)if(this.selection.title===chartSelection.textSelection){var oTitleContent=this.selection.title.getDocContent();if(oTitleContent&&oTitleContent===chartSelection.content){this.selection.textSelection=this.selection.title;if(true===state.DrawingSelection){oTitleContent.SetContentPosition(state.StartPos,0,0);oTitleContent.SetContentSelection(state.StartPos,state.EndPos,0,0,0)}else oTitleContent.SetContentPosition(state.Pos, 0,0)}}}}return bRet};CChartSpace.prototype.resetInternalSelection=function(noResetContentSelect){if(this.selection.title)this.selection.title.selected=false;if(this.selection.textSelection){if(!(noResetContentSelect===true)){var content=this.selection.textSelection.getDocContent();content&&content.RemoveSelection()}this.selection.textSelection=null}};CChartSpace.prototype.getDocContent=function(){return null};CChartSpace.prototype.resetSelection=function(noResetContentSelect){this.resetInternalSelection(noResetContentSelect); this.selection.title=null;this.selection.legend=null;this.selection.legendEntry=null;this.selection.axisLbls=null;this.selection.dataLbls=null;this.selection.dataLbl=null;this.selection.textSelection=null;this.selection.plotArea=null;this.selection.rotatePlotArea=null;this.selection.series=null;this.selection.chart=null;this.selection.datPoint=null;this.selection.markers=null;this.selection.axis=null;this.selection.minorGridlines=null;this.selection.majorGridlines=null;this.selection.hiLowLines=null; this.selection.upBars=null;this.selection.downBars=null};CChartSpace.prototype.getStyles=function(){return AscFormat.ExecuteNoHistory(function(){var styles=new CStyles(false);var style=new CStyle("dataLblStyle",null,null,null,true);var text_pr=new CTextPr;text_pr.FontSize=10;text_pr.Unifill=CreateUnfilFromRGB(0,0,0);var parent_objects=this.getParentObjects();var theme=parent_objects.theme;var para_pr=new CParaPr;para_pr.Jc=AscCommon.align_Center;para_pr.Spacing.Before=0;para_pr.Spacing.After=0;para_pr.Spacing.Line= 1;para_pr.Spacing.LineRule=Asc.linerule_Auto;style.ParaPr=para_pr;var minor_font=theme.themeElements.fontScheme.minorFont;if(minor_font){if(typeof minor_font.latin==="string"&&minor_font.latin.length>0)text_pr.RFonts.Ascii={Name:minor_font.latin,Index:-1};if(typeof minor_font.ea==="string"&&minor_font.ea.length>0)text_pr.RFonts.EastAsia={Name:minor_font.ea,Index:-1};if(typeof minor_font.cs==="string"&&minor_font.cs.length>0)text_pr.RFonts.CS={Name:minor_font.cs,Index:-1};if(typeof minor_font.sym=== "string"&&minor_font.sym.length>0)text_pr.RFonts.HAnsi={Name:minor_font.sym,Index:-1}}style.TextPr=text_pr;var chart_text_pr;if(this.txPr&&this.txPr.content&&this.txPr.content.Content[0]&&this.txPr.content.Content[0].Pr){style.ParaPr.Merge(this.txPr.content.Content[0].Pr);if(this.txPr.content.Content[0].Pr.DefaultRunPr){chart_text_pr=this.txPr.content.Content[0].Pr.DefaultRunPr;style.TextPr.Merge(chart_text_pr)}}if(this.txPr&&this.txPr.content&&this.txPr.content.Content[0]&&this.txPr.content.Content[0].Pr){style.ParaPr.Merge(this.txPr.content.Content[0].Pr); if(this.txPr.content.Content[0].Pr.DefaultRunPr)style.TextPr.Merge(this.txPr.content.Content[0].Pr.DefaultRunPr)}styles.Add(style);return{lastId:style.Id,styles:styles}},this,[])};CChartSpace.prototype.getParagraphTextPr=function(){if(this.selection.title&&!this.selection.textSelection)return GetTextPrFormArrObjects([this.selection.title]);else if(this.selection.legend)if(!AscFormat.isRealNumber(this.selection.legendEntry)){if(AscFormat.isRealNumber(this.legendLength)){var arrForProps=[];for(var i= 0;i<this.legendLength;++i)arrForProps.push(this.chart.legend.getCalcEntryByIdx(i,this.getDrawingDocument()));return GetTextPrFormArrObjects(arrForProps)}return GetTextPrFormArrObjects(this.chart.legend.calcEntryes)}else{var calcLegendEntry=this.chart.legend.getCalcEntryByIdx(this.selection.legendEntry,this.getDrawingDocument());if(calcLegendEntry)return GetTextPrFormArrObjects([calcLegendEntry])}else if(this.selection.textSelection)return this.selection.textSelection.txBody.content.GetCalculatedTextPr(); else if(this.selection.axisLbls&&this.selection.axisLbls.labels)return GetTextPrFormArrObjects(this.selection.axisLbls.labels.aLabels,true);else if(AscFormat.isRealNumber(this.selection.dataLbls)){var ser=this.getAllSeries()[this.selection.dataLbls];if(ser){var pts=AscFormat.getPtsFromSeries(ser);if(!AscFormat.isRealNumber(this.selection.dataLbl))return GetTextPrFormArrObjects(pts,undefined,true);else{var pt=pts[this.selection.dataLbl];if(pt)return GetTextPrFormArrObjects([pt],undefined,true)}}}var text_pr= new CTextPr;text_pr.InitDefault();text_pr.FontSize=10;if(AscFormat.isRealNumber(this.style))if(this.style>40)text_pr.Unifill=AscFormat.CreateUnfilFromRGB(255,255,255);else{var default_style=AscFormat.CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.style);var oUnifill=default_style.axisAndMajorGridLines.createDuplicate();if(oUnifill&&oUnifill.fill&&oUnifill.fill.color&&oUnifill.fill.color.Mods)oUnifill.fill.color.Mods.Mods.length=0;text_pr.Unifill=oUnifill}else text_pr.Unifill=AscFormat.CreateUnfilFromRGB(0, 0,0);text_pr.RFonts.Set_FromObject({Ascii:{Name:"+mn-lt",Index:-1},EastAsia:{Name:"+mn-ea",Index:-1},HAnsi:{Name:"+mn-lt",Index:-1},CS:{Name:"+mn-lt",Index:-1}});if(this.txPr&&this.txPr.content&&this.txPr.content.Content[0]&&this.txPr.content.Content[0].Pr.DefaultRunPr)text_pr.Merge(this.txPr.content.Content[0].Pr.DefaultRunPr.Copy());if(text_pr.RFonts&&text_pr.RFonts.Ascii&&text_pr.RFonts.Ascii.Name)text_pr.FontFamily.Name=text_pr.RFonts.Ascii.Name;return text_pr};CChartSpace.prototype.applyLabelsFunction= function(fCallback,value){if(this.selection.title){var DefaultFontSize=18;if(this.selection.title!==this.chart.title)DefaultFontSize=10;fCallback(this.selection.title,value,this.getDrawingDocument(),DefaultFontSize)}else if(this.selection.legend)if(!AscFormat.isRealNumber(this.selection.legendEntry)){fCallback(this.selection.legend,value,this.getDrawingDocument(),10);for(var i=0;i<this.selection.legend.legendEntryes.length;++i)fCallback(this.selection.legend.legendEntryes[i],value,this.getDrawingDocument(), 10)}else{var entry=this.selection.legend.findLegendEntryByIndex(this.selection.legendEntry);if(!entry){entry=new AscFormat.CLegendEntry;entry.setIdx(this.selection.legendEntry);if(this.selection.legend.txPr)entry.setTxPr(this.selection.legend.txPr.createDuplicate());this.selection.legend.addLegendEntry(entry)}if(entry)fCallback(entry,value,this.getDrawingDocument(),10)}else if(this.selection.axisLbls)fCallback(this.selection.axisLbls,value,this.getDrawingDocument(),10);else if(AscFormat.isRealNumber(this.selection.dataLbls)){var ser= this.getAllSeries()[this.selection.dataLbls];if(ser){var pts=AscFormat.getPtsFromSeries(ser);if(!ser.dLbls){var oDlbls;var oChart=ser.parent;if(oChart&&oChart.dLbls)oDlbls=oChart.dLbls.createDuplicate();else oDlbls=new AscFormat.CDLbls;ser.setDLbls(oDlbls)}if(!AscFormat.isRealNumber(this.selection.dataLbl)){fCallback(ser.dLbls,value,this.getDrawingDocument(),10);for(var i=0;i<pts.length;++i){var dLbl=ser.dLbls&&ser.dLbls.findDLblByIdx(pts[i].idx);if(dLbl){if(ser.dLbls.txPr&&!dLbl.txPr)dLbl.setTxPr(ser.dLbls.txPr.createDuplicate()); fCallback(dLbl,value,this.getDrawingDocument(),10)}}}else{var pt=pts[this.selection.dataLbl];if(pt){var dLbl=ser.dLbls&&ser.dLbls.findDLblByIdx(pt.idx);if(!dLbl){dLbl=new AscFormat.CDLbl;dLbl.setIdx(pt.idx);if(ser.dLbls.txPr)dLbl.merge(ser.dLbls);ser.dLbls.addDLbl(dLbl)}fCallback(dLbl,value,this.getDrawingDocument(),10)}}}}else{var oDD=this.getDrawingDocument();fCallback(this,value,oDD,10);var chart=this.chart,i;if(chart){for(i=0;i<chart.pivotFmts.length;++i)chart.pivotFmts[i]&&fCallback(chart.pivotFmts[i], value,oDD,10);if(chart.legend){fCallback(chart.legend,value,oDD,10);for(i=0;i<chart.legend.legendEntryes.length;++i)chart.legend.legendEntryes[i]&&fCallback(chart.legend.legendEntryes[i],value,oDD,10)}if(chart.title)fCallback(chart.title,value,oDD,18);var plot_area=chart.plotArea;if(plot_area){for(i=0;i<plot_area.charts.length;++i)plot_area.charts[i]&&plot_area.charts[i].applyLabelsFunction(fCallback,value,oDD);var cur_axis;for(i=0;i<plot_area.axId.length;++i){cur_axis=plot_area.axId[i];fCallback(cur_axis, value,oDD,10);if(cur_axis.title)fCallback(cur_axis.title,value,oDD,10)}}}}};CChartSpace.prototype.paragraphIncDecFontSize=function(bIncrease){if(this.selection.textSelection){this.selection.textSelection.checkDocContent();var content=this.selection.textSelection.getDocContent();if(content)content.IncreaseDecreaseFontSize(bIncrease);return}this.applyLabelsFunction(CheckIncDecFontSize,bIncrease)};CChartSpace.prototype.paragraphAdd=function(paraItem,bRecalculate){if(paraItem.Type===para_TextPr){var _paraItem; if(paraItem.Value.Unifill&¶Item.Value.Unifill.checkWordMods()){_paraItem=paraItem.Copy();_paraItem.Value.Unifill.convertToPPTXMods()}else _paraItem=paraItem;if(this.selection.textSelection){this.selection.textSelection.checkDocContent();this.selection.textSelection.paragraphAdd(paraItem,bRecalculate);return}this.applyLabelsFunction(CheckObjectTextPr,_paraItem.Value)}else if(paraItem.Type===para_Text||paraItem.Type===para_Space)if(this.selection.title){this.selection.textSelection=this.selection.title; this.selection.textSelection.checkDocContent();this.selection.textSelection.txBody.content.SelectAll();this.selection.textSelection.paragraphAdd(paraItem,bRecalculate)}else if(AscFormat.isRealNumber(this.selection.dataLbl)){var oDlbl=this.getCompiledDlblBySelect();if(oDlbl){this.selection.textSelection=oDlbl;this.selection.textSelection.checkDocContent();this.selection.textSelection.txBody.content.SelectAll();this.selection.textSelection.applyTextFunction(CDocumentContent.prototype.AddToParagraph, CTable.prototype.AddToParagraph,[paraItem,bRecalculate])}}};CChartSpace.prototype.applyTextFunction=function(docContentFunction,tableFunction,args){if(docContentFunction===CDocumentContent.prototype.AddToParagraph&&!this.selection.textSelection){this.paragraphAdd(args[0],args[1]);return}if(this.selection.textSelection){this.selection.textSelection.checkDocContent();var bTrackRevision=false;if(typeof editor!=="undefined"&&editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument.TrackRevisions=== true){bTrackRevision=true;editor.WordControl.m_oLogicDocument.TrackRevisions=false}this.selection.textSelection.applyTextFunction(docContentFunction,tableFunction,args);if(bTrackRevision)editor.WordControl.m_oLogicDocument.TrackRevisions=true}};CChartSpace.prototype.selectTitle=function(title,pageIndex){title.select(this,pageIndex);this.resetInternalSelection();this.selection.legend=null;this.selection.legendEntry=null;this.selection.axisLbls=null;this.selection.dataLbls=null;this.selection.dataLbl= null;this.selection.textSelection=null;this.selection.plotArea=null;this.selection.rotatePlotArea=null;this.selection.axis=null;this.selection.minorGridlines=null;this.selection.majorGridlines=null,this.selection.gridLines=null;this.selection.chart=null;this.selection.series=null;this.selection.datPoint=null;this.selection.markers=null;this.selection.hiLowLines=null;this.selection.upBars=null;this.selection.downBars=null;this.selection.hiLowLines=null;this.selection.upBars=null;this.selection.downBars= null};CChartSpace.prototype.recalculateCurPos=AscFormat.DrawingObjectsController.prototype.recalculateCurPos;CChartSpace.prototype.documentUpdateSelectionState=function(){if(this.selection.textSelection)this.selection.textSelection.updateSelectionState()};CChartSpace.prototype.getLegend=function(){if(this.chart)return this.chart.legend;return null};CChartSpace.prototype.getAllTitles=function(){var ret=[];if(this.chart){if(this.chart.title)ret.push(this.chart.title);if(this.chart.plotArea){var aAxes= this.chart.plotArea.axId;for(var i=0;i<aAxes.length;++i)if(aAxes[i]&&aAxes[i].title)ret.push(aAxes[i].title)}}return ret};CChartSpace.prototype.changeSize=CShape.prototype.changeSize;CChartSpace.prototype.getSelectedChart=function(){return AscCommon.g_oTableId.Get_ById(this.selection.chart)};CChartSpace.prototype.getSelectedSeries=function(){if(AscFormat.isRealNumber(this.selection.series)){var oTypedChart=this.getSelectedChart();if(oTypedChart){var aSeries,oSeries;if(oTypedChart.getObjectType()=== AscDFH.historyitem_type_BarChart){aSeries=this.getAllSeries();for(var nIdx=0;nIdx<aSeries.length;++nIdx){oSeries=aSeries[nIdx];if(oSeries.idx===this.selection.series)return oSeries}}else{aSeries=oTypedChart.series;oSeries=aSeries[this.selection.series];if(oSeries)return oSeries}}}return null};CChartSpace.prototype.getCompiledDlblBySelect=function(){var ser=this.getAllSeries()[this.selection.dataLbls];if(ser){var oDlbls=ser.dLbls;if(AscFormat.isRealNumber(this.selection.dataLbl)){var pts=AscFormat.getPtsFromSeries(ser); var pt=pts[this.selection.dataLbl];if(pt)return pt.compiledDlb}}return null};CChartSpace.prototype.getFill=function(){var ret=null;var oChart=this.getSelectedChart();if(this.selection.plotArea){if(this.chart.plotArea.brush&&this.chart.plotArea.brush.fill)ret=this.chart.plotArea.brush}else if(AscFormat.isRealNumber(this.selection.dataLbls)){var ser=this.getAllSeries()[this.selection.dataLbls];if(ser){var oDlbls=ser.dLbls;if(!AscFormat.isRealNumber(this.selection.dataLbl)){if(oDlbls&&oDlbls.spPr&&oDlbls.spPr.Fill&& oDlbls.spPr.Fill.fill)ret=oDlbls.spPr.Fill}else{var pts=AscFormat.getPtsFromSeries(ser);var pt=pts[this.selection.dataLbl];if(pt){var dLbl=ser.dLbls&&ser.dLbls.findDLblByIdx(pt.idx);if(dLbl&&dLbl.spPr&&dLbl.spPr.Fill&&dLbl.spPr.Fill.fill)ret=dLbl.spPr.Fill}}}}else if(this.selection.axisLbls){if(this.selection.axisLbls.spPr&&this.selection.axisLbls.spPr.Fill&&this.selection.axisLbls.spPr.Fill.fill)ret=this.selection.axisLbls.spPr.Fill}else if(this.selection.title){if(this.selection.title.spPr&&this.selection.title.spPr.Fill&& this.selection.title.spPr.Fill.fill)ret=this.selection.title.spPr.Fill}else if(this.selection.legend){if(this.selection.legend.spPr&&this.selection.legend.spPr.Fill&&this.selection.legend.spPr.Fill.fill)ret=this.selection.legend.spPr.Fill}else if(AscFormat.isRealNumber(this.selection.series)){var oSeries=this.getSelectedSeries();if(oSeries)if(AscFormat.isRealNumber(this.selection.datPoint)){var pts=AscFormat.getPtsFromSeries(oSeries);var datPoint=this.selection.datPoint;if(oSeries.getObjectType()=== AscDFH.historyitem_type_LineSeries||oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer)if(!this.selection.markers)datPoint++;for(var j=0;j<pts.length;++j){var pt=pts[j];if(pt.idx===datPoint){if(this.selection.markers){if(pt.compiledMarker&&pt.compiledMarker.brush&&pt.compiledMarker.brush.fill)ret=pt.compiledMarker.brush}else if(pt.brush&&pt.brush.fill)ret=pt.brush;break}}}else if(this.selection.markers){if(oSeries.compiledSeriesMarker&&oSeries.compiledSeriesMarker.brush&&oSeries.compiledSeriesMarker.brush.fill)ret= oSeries.compiledSeriesMarker.brush}else if(oSeries.compiledSeriesBrush&&oSeries.compiledSeriesBrush.fill)ret=oSeries.compiledSeriesBrush}else if(AscCommon.isRealObject(this.selection.hiLowLines))ret=AscFormat.CreateNoFillUniFill();else if(this.selection.upBars){if(oChart&&oChart.upDownBars&&oChart.upDownBars.upBarsBrush&&oChart.upDownBars.upBarsBrush.fill)ret=oChart.upDownBars.upBarsBrush}else if(this.selection.downBars){if(oChart&&oChart.upDownBars&&oChart.upDownBars.downBarsBrush&&oChart.upDownBars.downBarsBrush.fill)ret= oChart.upDownBars.downBarsBrush}else if(this.selection.axis);else if(this.brush&&this.brush.fill)ret=this.brush;if(!ret)ret=AscFormat.CreateNoFillUniFill();var parents=this.getParentObjects();var RGBA={R:255,G:255,B:255,A:255};ret.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);return ret};CChartSpace.prototype.getStroke=function(){var ret=null;var oChart=this.getSelectedChart();if(this.selection.plotArea){if(this.chart.plotArea.pen&&this.chart.plotArea.pen.Fill)ret= this.chart.plotArea.pen}else if(AscFormat.isRealNumber(this.selection.dataLbls)){var ser=this.getAllSeries()[this.selection.dataLbls];if(ser){var oDlbls=ser.dLbls;if(!AscFormat.isRealNumber(this.selection.dataLbl)){if(oDlbls&&oDlbls.spPr&&oDlbls.spPr.ln&&oDlbls.spPr.ln.Fill)ret=oDlbls.spPr.ln}else{var pts=AscFormat.getPtsFromSeries(ser);var pt=pts[this.selection.dataLbl];if(pt){var dLbl=ser.dLbls&&ser.dLbls.findDLblByIdx(pt.idx);if(dLbl&&dLbl.spPr&&dLbl.spPr.ln&&dLbl.spPr.ln.Fill)ret=dLbl.spPr.ln}}}}else if(this.selection.axisLbls){if(this.selection.axisLbls.spPr&& this.selection.axisLbls.spPr.ln&&this.selection.axisLbls.spPr.ln.Fill)ret=this.selection.axisLbls.spPr.ln}else if(this.selection.title){if(this.selection.title.spPr&&this.selection.title.spPr.ln&&this.selection.title.spPr.ln.Fill)ret=this.selection.title.spPr.ln}else if(this.selection.legend){if(this.selection.legend.spPr&&this.selection.legend.spPr.ln&&this.selection.legend.spPr.ln.Fill)ret=this.selection.legend.spPr.ln}else if(AscFormat.isRealNumber(this.selection.series)){var oSeries=this.getSelectedSeries(); if(oSeries)if(AscFormat.isRealNumber(this.selection.datPoint)){var pts=AscFormat.getPtsFromSeries(oSeries);var datPoint=this.selection.datPoint;if(oSeries.getObjectType()===AscDFH.historyitem_type_LineSeries||oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer)if(!this.selection.markers)datPoint++;for(var j=0;j<pts.length;++j){var pt=pts[j];if(pt.idx===datPoint){if(this.selection.markers){if(pt&&pt.compiledMarker&&pt.compiledMarker.pen&&pt.compiledMarker.pen.Fill)ret=pt.compiledMarker.pen}else if(pt.pen&& pt.pen.Fill)ret=pt.pen;break}}}else if(this.selection.markers){if(oSeries.compiledSeriesMarker&&oSeries.compiledSeriesMarker.pen&&oSeries.compiledSeriesMarker.pen.Fill)ret=oSeries.compiledSeriesMarker.pen}else if(oSeries.compiledSeriesPen&&oSeries.compiledSeriesPen.Fill)ret=oSeries.compiledSeriesPen}else if(AscCommon.isRealObject(this.selection.hiLowLines)){if(oChart&&oChart.calculatedHiLowLines&&oChart.calculatedHiLowLines.Fill)ret=oChart.calculatedHiLowLines}else if(this.selection.upBars){if(oChart&& oChart.upDownBars&&oChart.upDownBars.upBarsPen&&oChart.upDownBars.upBarsPen.Fill)ret=oChart.upDownBars.upBarsPen}else if(this.selection.downBars){if(oChart&&oChart.upDownBars&&oChart.upDownBars.downBarsPen&&oChart.upDownBars.downBarsPen.Fill)ret=oChart.upDownBars.downBarsPen}else if(this.selection.axis){if(this.selection.majorGridlines)if(this.selection.axis.majorGridlines&&this.selection.axis.majorGridlines.ln&&this.selection.axis.majorGridlines.ln.Fill)ret=this.selection.axis.majorGridlines.ln; if(this.selection.minorGridlines)if(this.selection.axis.minorGridlines&&this.selection.axis.minorGridlines.ln&&this.selection.axis.minorGridlines.ln.Fill)ret=this.selection.axis.minorGridlines.ln}else if(this.pen&&this.pen.Fill)ret=this.pen;if(!ret)ret=AscFormat.CreateNoFillLine();var parents=this.getParentObjects();var RGBA={R:255,G:255,B:255,A:255};ret.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);return ret};CChartSpace.prototype.canFill=function(){if(this.selection.axis)return false; if(this.selection.axisLbls)return false;if(AscCommon.isRealObject(this.selection.hiLowLines))return false;if(AscFormat.isRealNumber(this.selection.series)&&!this.selection.markers){var oChart=AscCommon.g_oTableId.Get_ById(this.selection.chart);if(oChart)if(oChart.getObjectType()===AscDFH.historyitem_type_LineChart||oChart.getObjectType()===AscDFH.historyitem_type_ScatterChart)return false}return true};CChartSpace.prototype.changeFill=function(unifill){var oChart=AscCommon.g_oTableId.Get_ById(this.selection.chart); var unifill2;if(this.selection.plotArea){if(!this.chart.plotArea.spPr){this.chart.plotArea.setSpPr(new AscFormat.CSpPr);this.chart.plotArea.spPr.setParent(this.chart.plotArea)}unifill2=AscFormat.CorrectUniFill(unifill,this.chart.plotArea.brush,this.getEditorType());unifill2.convertToPPTXMods();this.chart.plotArea.spPr.setFill(unifill2)}else if(AscFormat.isRealNumber(this.selection.dataLbls)){var ser=this.getAllSeries()[this.selection.dataLbls];if(ser){var oDlbls=ser.dLbls;if(!ser.dLbls){if(ser.parent&& ser.parent.dLbls)oDlbls=ser.parent.dLbls.createDuplicate();else oDlbls=new AscFormat.CDLbls;ser.setDLbls(oDlbls)}if(!AscFormat.isRealNumber(this.selection.dataLbl)){if(!oDlbls.spPr){oDlbls.setSpPr(new AscFormat.CSpPr);oDlbls.spPr.setParent(oDlbls)}var brush=null;unifill2=AscFormat.CorrectUniFill(unifill,oDlbls.spPr&&oDlbls.spPr.Fill?oDlbls.spPr.Fill.createDuplicate():null,this.getEditorType());unifill2.convertToPPTXMods();oDlbls.spPr.setFill(unifill2)}else{var pts=AscFormat.getPtsFromSeries(ser); var pt=pts[this.selection.dataLbl];if(pt){var dLbl=ser.dLbls&&ser.dLbls.findDLblByIdx(pt.idx);if(!dLbl){dLbl=new AscFormat.CDLbl;dLbl.setIdx(pt.idx);if(ser.dLbls.txPr)dLbl.merge(ser.dLbls);ser.dLbls.addDLbl(dLbl)}var brush=null;if(pt.compiledDlb)brush=pt.compiledDlb.brush;if(!dLbl.spPr){dLbl.setSpPr(new AscFormat.CSpPr);dLbl.spPr.setParent(dLbl)}var brush=null;unifill2=AscFormat.CorrectUniFill(unifill,dLbl.spPr&&dLbl.spPr.Fill?dLbl.spPr.Fill.createDuplicate():null,this.getEditorType());unifill2.convertToPPTXMods(); dLbl.spPr.setFill(unifill2)}}}}else if(this.selection.axisLbls){if(!this.selection.axisLbls.spPr){this.selection.axisLbls.setSpPr(new AscFormat.CSpPr);this.selection.axisLbls.spPr.setParent(this.selection.axisLbls)}unifill2=AscFormat.CorrectUniFill(unifill,this.selection.axisLbls.spPr&&this.selection.axisLbls.spPr.Fill?this.selection.axisLbls.spPr.Fill.createDuplicate():null,this.getEditorType());unifill2.convertToPPTXMods();this.selection.axisLbls.spPr.setFill(unifill2)}else if(this.selection.title){if(!this.selection.title.spPr){this.selection.title.setSpPr(new AscFormat.CSpPr); this.selection.title.spPr.setParent(this.selection.title)}unifill2=AscFormat.CorrectUniFill(unifill,this.selection.title.brush,this.getEditorType());unifill2.convertToPPTXMods();this.selection.title.spPr.setFill(unifill2)}else if(this.selection.legend){if(!this.chart.legend.spPr){this.chart.legend.setSpPr(new AscFormat.CSpPr);this.chart.legend.spPr.setParent(this.chart.legend)}unifill2=AscFormat.CorrectUniFill(unifill,this.chart.legend.brush,this.getEditorType());unifill2.convertToPPTXMods();this.chart.legend.spPr.setFill(unifill2)}else if(AscFormat.isRealNumber(this.selection.series)){var oSeries= this.getSelectedSeries();if(oSeries)if(AscFormat.isRealNumber(this.selection.datPoint)){var pts=AscFormat.getPtsFromSeries(oSeries);var datPoint=this.selection.datPoint;if(oSeries.getObjectType()===AscDFH.historyitem_type_LineSeries||oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer)if(!this.selection.markers)datPoint++;for(var j=0;j<pts.length;++j){var pt=pts[j];if(pt.idx===datPoint){var oDataPoint=null;if(Array.isArray(oSeries.dPt))for(var k=0;k<oSeries.dPt.length;++k)if(oSeries.dPt[k].idx=== pts[j].idx){oDataPoint=oSeries.dPt[k];break}if(!oDataPoint){oDataPoint=new AscFormat.CDPt;oDataPoint.setIdx(pt.idx);oSeries.addDPt(oDataPoint)}if(this.selection.markers){if(pt.compiledMarker){oDataPoint.setMarker(pt.compiledMarker.createDuplicate());if(!oDataPoint.marker.spPr){oDataPoint.marker.setSpPr(new AscFormat.CSpPr);oDataPoint.marker.spPr.setParent(oDataPoint.marker)}unifill2=AscFormat.CorrectUniFill(unifill,pt.compiledMarker.brush,this.getEditorType());unifill2.convertToPPTXMods();oDataPoint.marker.spPr.setFill(unifill2)}}else{if(!oDataPoint.spPr){oDataPoint.setSpPr(new AscFormat.CSpPr); oDataPoint.spPr.setParent(oDataPoint)}unifill2=AscFormat.CorrectUniFill(unifill,pt.brush,this.getEditorType());unifill2.convertToPPTXMods();oDataPoint.spPr.setFill(unifill2)}break}}}else if(this.selection.markers){if(oSeries.setMarker&&oSeries.compiledSeriesMarker){if(!oSeries.marker)oSeries.setMarker(oSeries.compiledSeriesMarker.createDuplicate());if(!oSeries.marker.spPr){oSeries.marker.setSpPr(new AscFormat.CSpPr);oSeries.marker.spPr.setParent(oSeries.marker)}unifill2=AscFormat.CorrectUniFill(unifill, oSeries.compiledSeriesMarker.brush,this.getEditorType());unifill2.convertToPPTXMods();oSeries.marker.spPr.setFill(unifill2);if(Array.isArray(oSeries.dPt))for(var i=0;i<oSeries.dPt.length;++i)if(oSeries.dPt[i].marker&&oSeries.dPt[i].marker.spPr)oSeries.dPt[i].marker.spPr.setFill(unifill2.createDuplicate())}}else{if(!oSeries.spPr){oSeries.setSpPr(new AscFormat.CSpPr);oSeries.spPr.setParent(oSeries)}unifill2=AscFormat.CorrectUniFill(unifill,oSeries.compiledSeriesBrush,this.getEditorType());unifill2.convertToPPTXMods(); oSeries.spPr.setFill(unifill2);if(Array.isArray(oSeries.dPt))for(var i=0;i<oSeries.dPt.length;++i)if(oSeries.dPt[i].spPr)oSeries.dPt[i].spPr.setFill(unifill2.createDuplicate())}}else if(this.selection.upBars){if(oChart&&oChart.upDownBars){if(!oChart.upDownBars.upBars){oChart.upDownBars.setUpBars(new AscFormat.CSpPr);oChart.upDownBars.upBars.setParent(oChart.upDownBars)}unifill2=AscFormat.CorrectUniFill(unifill,oChart.upDownBars.upBarsBrush,this.getEditorType());unifill2.convertToPPTXMods();oChart.upDownBars.upBars.setFill(unifill2)}}else if(this.selection.downBars){if(oChart&& oChart.upDownBars){if(!oChart.upDownBars.downBars){oChart.upDownBars.setDownBars(new AscFormat.CSpPr);oChart.upDownBars.downBars.setParent(oChart.upDownBars)}unifill2=AscFormat.CorrectUniFill(unifill,oChart.upDownBars.downBarsBrush,this.getEditorType());unifill2.convertToPPTXMods();oChart.upDownBars.downBars.setFill(unifill2)}}else{if(this.recalcInfo.recalculatePenBrush)this.recalculatePenBrush();unifill2=AscFormat.CorrectUniFill(unifill,this.brush,this.getEditorType());unifill2.convertToPPTXMods(); if(!this.spPr){this.setSpPr(new AscFormat.CSpPr);this.spPr.setParent(this)}this.spPr.setFill(unifill2)}if(!this.spPr){this.setSpPr(new AscFormat.CSpPr);this.spPr.setParent(this)}this.spPr.setFill(this.spPr.Fill?this.spPr.Fill.createDuplicate():this.spPr.Fill)};CChartSpace.prototype.setFill=function(fill){if(!this.spPr){this.setSpPr(new AscFormat.CSpPr);this.spPr.setParent(this)}this.spPr.setFill(fill)};CChartSpace.prototype.setNvSpPr=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetNvGrFrProps, this.nvGraphicFramePr,pr));this.nvGraphicFramePr=pr};CChartSpace.prototype.changeLine=function(line){var stroke;var oChart=AscCommon.g_oTableId.Get_ById(this.selection.chart);if(this.selection.plotArea){if(!this.chart.plotArea.spPr){this.chart.plotArea.setSpPr(new AscFormat.CSpPr);this.chart.plotArea.spPr.setParent(this.chart.plotArea)}stroke=AscFormat.CorrectUniStroke(line,this.chart.plotArea.pen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.chart.plotArea.spPr.setLn(stroke)}else if(AscFormat.isRealNumber(this.selection.dataLbls)){var ser= this.getAllSeries()[this.selection.dataLbls];if(ser){var oDlbls=ser.dLbls;if(!ser.dLbls){if(ser.parent&&ser.parent.dLbls)oDlbls=ser.parent.dLbls.createDuplicate();else oDlbls=new AscFormat.CDLbls;ser.setDLbls(oDlbls)}if(!AscFormat.isRealNumber(this.selection.dataLbl)){if(!oDlbls.spPr){oDlbls.setSpPr(new AscFormat.CSpPr);oDlbls.spPr.setParent(oDlbls)}stroke=AscFormat.CorrectUniStroke(line,oDlbls.spPr.ln?oDlbls.spPr.ln.createDuplicate():null,this.getEditorType());if(stroke.Fill)stroke.Fill.convertToPPTXMods(); oDlbls.spPr.setLn(stroke)}else{var pts=AscFormat.getPtsFromSeries(ser);var pt=pts[this.selection.dataLbl];if(pt){var dLbl=ser.dLbls&&ser.dLbls.findDLblByIdx(pt.idx);if(!dLbl){dLbl=new AscFormat.CDLbl;dLbl.setIdx(pt.idx);if(ser.dLbls.txPr)dLbl.merge(ser.dLbls);ser.dLbls.addDLbl(dLbl)}if(!dLbl.spPr){dLbl.setSpPr(new AscFormat.CSpPr);dLbl.spPr.setParent(dLbl)}stroke=AscFormat.CorrectUniStroke(line,dLbl.spPr.ln?dLbl.spPr.ln.createDuplicate():null,this.getEditorType());if(stroke.Fill)stroke.Fill.convertToPPTXMods(); dLbl.spPr.setLn(stroke)}}}}else if(this.selection.axisLbls){if(!this.selection.axisLbls.spPr){this.selection.axisLbls.setSpPr(new AscFormat.CSpPr);this.selection.axisLbls.spPr.setParent(this.selection.axisLbls)}stroke=AscFormat.CorrectUniStroke(line,this.selection.axisLbls.spPr.ln?this.selection.axisLbls.spPr.ln.createDuplicate():null,this.getEditorType());if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.selection.axisLbls.spPr.setLn(stroke)}else if(this.selection.legend){if(!this.chart.legend.spPr){this.chart.legend.setSpPr(new AscFormat.CSpPr); this.chart.legend.spPr.setParent(this.chart.legend)}stroke=AscFormat.CorrectUniStroke(line,this.chart.legend.pen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.chart.legend.spPr.setLn(stroke)}else if(this.selection.title){if(!this.selection.title.spPr){this.selection.title.setSpPr(new AscFormat.CSpPr);this.selection.title.spPr.setParent(this.selection.title)}stroke=AscFormat.CorrectUniStroke(line,this.selection.title.pen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.selection.title.spPr.setLn(stroke)}else if(AscFormat.isRealNumber(this.selection.series)){var oSeries= this.getSelectedSeries();if(oSeries)if(AscFormat.isRealNumber(this.selection.datPoint)){var pts=AscFormat.getPtsFromSeries(oSeries);var datPoint=this.selection.datPoint;if(oSeries.getObjectType()===AscDFH.historyitem_type_LineSeries||oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer)if(!this.selection.markers)datPoint++;for(var j=0;j<pts.length;++j){var pt=pts[j];if(pt.idx===datPoint){var oDataPoint=null;if(Array.isArray(oSeries.dPt))for(var k=0;k<oSeries.dPt.length;++k)if(oSeries.dPt[k].idx=== pts[j].idx){oDataPoint=oSeries.dPt[k];break}if(!oDataPoint){oDataPoint=new AscFormat.CDPt;oDataPoint.setIdx(pt.idx);oSeries.addDPt(oDataPoint)}if(this.selection.markers){if(pt.compiledMarker){oDataPoint.setMarker(pt.compiledMarker.createDuplicate());if(!oDataPoint.marker.spPr){oDataPoint.marker.setSpPr(new AscFormat.CSpPr);oDataPoint.marker.spPr.setParent(oDataPoint.marker)}stroke=AscFormat.CorrectUniStroke(line,pt.compiledMarker.pen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();oDataPoint.marker.spPr.setLn(stroke)}}else{if(!oDataPoint.spPr){oDataPoint.setSpPr(new AscFormat.CSpPr); oDataPoint.spPr.setParent(oDataPoint)}stroke=AscFormat.CorrectUniStroke(line,pt.pen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();oDataPoint.spPr.setLn(stroke)}break}}}else if(this.selection.markers){if(oSeries.setMarker&&oSeries.compiledSeriesMarker){if(!oSeries.marker)oSeries.setMarker(oSeries.compiledSeriesMarker.createDuplicate());if(!oSeries.marker.spPr){oSeries.marker.setSpPr(new AscFormat.CSpPr);oSeries.marker.spPr.setParent(oSeries.marker)}stroke=AscFormat.CorrectUniStroke(line,oSeries.compiledSeriesMarker.pen); if(stroke.Fill)stroke.Fill.convertToPPTXMods();oSeries.marker.spPr.setLn(stroke);if(Array.isArray(oSeries.dPt))for(var i=0;i<oSeries.dPt.length;++i)if(oSeries.dPt[i].marker&&oSeries.dPt[i].marker.spPr)oSeries.dPt[i].marker.spPr.setLn(stroke.createDuplicate())}}else{if(!oSeries.spPr){oSeries.setSpPr(new AscFormat.CSpPr);oSeries.spPr.setParent(oSeries)}stroke=AscFormat.CorrectUniStroke(line,oSeries.compiledSeriesPen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();oSeries.spPr.setLn(stroke);if(Array.isArray(oSeries.dPt))for(var i= 0;i<oSeries.dPt.length;++i)if(oSeries.dPt[i].spPr)oSeries.dPt[i].spPr.setLn(stroke.createDuplicate())}}else if(AscCommon.isRealObject(this.selection.hiLowLines)){if(oChart){stroke=AscFormat.CorrectUniStroke(line,oChart.calculatedHiLowLines);if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.selection.hiLowLines.setLn(stroke)}}else if(this.selection.upBars){if(oChart&&oChart.upDownBars){if(!oChart.upDownBars.upBars){oChart.upDownBars.setUpBars(new AscFormat.CSpPr);oChart.upDownBars.upBars.setParent(oChart.upDownBars)}stroke= AscFormat.CorrectUniStroke(line,oChart.upDownBars.upBarsPen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();oChart.upDownBars.upBars.setLn(stroke)}}else if(this.selection.downBars){if(oChart&&oChart.upDownBars){if(!oChart.upDownBars.downBars){oChart.upDownBars.setDownBars(new AscFormat.CSpPr);oChart.upDownBars.downBars.setParent(oChart.upDownBars)}stroke=AscFormat.CorrectUniStroke(line,oChart.upDownBars.downBarsPen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();oChart.upDownBars.downBars.setLn(stroke)}}else if(this.selection.axis){var oAxis= this.selection.axis;if(this.selection.majorGridlines){if(!this.selection.axis.majorGridlines){this.selection.axis.setMajorGridlines(new AscFormat.CSpPr);this.selection.axis.majorGridlines.setParent(this.selection.axis)}stroke=AscFormat.CorrectUniStroke(line,this.selection.axis.majorGridlines.ln?this.selection.axis.majorGridlines.ln.createDuplicate():null,this.getEditorType());if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.selection.axis.majorGridlines.setLn(stroke)}if(this.selection.minorGridlines){if(!this.selection.axis.minorGridlines){this.selection.axis.setMinorGridlines(new AscFormat.CSpPr); this.selection.axis.minorGridlines.setParent(this.selection.axis)}stroke=AscFormat.CorrectUniStroke(line,this.selection.axis.minorGridlines.ln?this.selection.axis.minorGridlines.ln.createDuplicate():null,this.getEditorType());if(stroke.Fill)stroke.Fill.convertToPPTXMods();this.selection.axis.minorGridlines.setLn(stroke)}}else{if(this.recalcInfo.recalculatePenBrush)this.recalculatePenBrush();var stroke=AscFormat.CorrectUniStroke(line,this.pen);if(stroke.Fill)stroke.Fill.convertToPPTXMods();if(!this.spPr){this.setSpPr(new AscFormat.CSpPr); this.spPr.setParent(this)}this.spPr.setLn(stroke)}if(!this.spPr){this.setSpPr(new AscFormat.CSpPr);this.spPr.setParent(this)}this.spPr.setFill(this.spPr.Fill?this.spPr.Fill.createDuplicate():this.spPr.Fill)};CChartSpace.prototype.checkBBoxIntersection=function(bbox1,bbox2){return!(bbox1.r1>bbox2.r2||bbox2.r1>bbox1.r2||bbox1.c1>bbox2.c2||bbox2.c1>bbox1.c2)};CChartSpace.prototype.checkSeriesIntersection=function(val,bbox,worksheet){if(val&&bbox&&worksheet){var parsed_formulas=val.parsedFormulas;for(var i= 0;i<parsed_formulas.length;++i)if(parsed_formulas[i].worksheet===worksheet&&this.checkBBoxIntersection(parsed_formulas[i].bbox,bbox))return true}return false};CChartSpace.prototype.checkVal=function(val){if(val){if(val.numRef)val.numRef.parsedFormulas=AscFormat.fParseChartFormula(val.numRef.f);if(val.strRef)val.strRef.parsedFormulas=AscFormat.fParseChartFormula(val.strRef.f)}};CChartSpace.prototype.recalculateSeriesFormulas=function(){this.checkSeriesRefs(this.checkVal)};CChartSpace.prototype.checkChartIntersection= function(bbox,worksheet){return this.checkSeriesRefs(this.checkSeriesIntersection,bbox,worksheet)};CChartSpace.prototype.changeListName=function(val,oldName,newName){if(val){if(val.numRef&&typeof val.numRef.f==="string")if(val.numRef.f.indexOf(newName)>-1)return;if(val.strRef&&typeof val.strRef.f==="string")if(val.strRef.f.indexOf(newName)>-1)return;if(val.numRef&&typeof val.numRef.f==="string"||val.strRef&&typeof val.strRef.f==="string"){var checkString=oldName.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");if(val.numRef&&typeof val.numRef.f==="string")val.numRef.setF(val.numRef.f.replace(new RegExp(checkString,"g"),newName));if(val.strRef&&typeof val.strRef.f==="string")val.strRef.setF(val.strRef.f.replace(new RegExp(checkString,"g"),newName))}}};CChartSpace.prototype.checkListName=function(val,oldName){if(val){if(val.numRef&&typeof val.numRef.f==="string")if(val.numRef.f.indexOf(oldName)>-1)return true;if(val.strRef&&typeof val.strRef.f==="string")if(val.strRef.f.indexOf(oldName)>-1)return true}return false}; CChartSpace.prototype.changeChartReferences=function(oldWorksheetName,newWorksheetName){this.checkSeriesRefs(this.changeListName,oldWorksheetName,newWorksheetName)};CChartSpace.prototype.checkChartReferences=function(oldWorksheetName){return this.checkSeriesRefs(this.checkListName,oldWorksheetName)};CChartSpace.prototype.updateChartReferences=function(oldWorksheetName,newWorksheetName,bNoRebuildCache){if(this.checkChartReferences(oldWorksheetName)){if(bNoRebuildCache===true)this.bNoHandleRecalc=true; this.changeChartReferences(oldWorksheetName,newWorksheetName);if(!(bNoRebuildCache===true))this.rebuildSeries();this.bNoHandleRecalc=false}};CChartSpace.prototype.updateChartReferences2=function(oldWorksheetName,newWorksheetName){if(this.checkChartReferences(oldWorksheetName))this.changeChartReferences(oldWorksheetName,newWorksheetName)};CChartSpace.prototype.checkSeriesRefs=function(callback,bbox,worksheet){if(this.chart&&this.chart.plotArea){var charts=this.chart.plotArea.charts,i,j,series,ser; for(i=0;i<charts.length;++i){series=charts[i].series;if(charts[i].getObjectType()===AscDFH.historyitem_type_ScatterChart)for(j=0;j<series.length;++j){ser=series[j];if(callback(ser.xVal,bbox,worksheet))return true;if(callback(ser.yVal,bbox,worksheet))return true;if(callback(ser.tx,bbox,worksheet))return true}else for(j=0;j<series.length;++j){ser=series[j];if(callback(ser.val,bbox,worksheet))return true;if(callback(ser.cat,bbox,worksheet))return true;if(callback(ser.tx,bbox,worksheet))return true}}}return false}; CChartSpace.prototype.clearCacheVal=function(val){if(!val)return;if(val.numRef)if(val.numRef.numCache)removePtsFromLit(val.numRef.numCache);if(val.strRef)if(val.strRef.strCache)val.strRef.setStrCache(null)};CChartSpace.prototype.checkIntersectionChangedRange=function(data){if(!data)return true;var i,j;if(this.seriesBBoxes)for(i=0;i<this.seriesBBoxes.length;++i)for(j=0;j<data.length;++j)if(this.seriesBBoxes[i].checkIntersection(data[j]))return true;if(this.seriesTitlesBBoxes)for(i=0;i<this.seriesTitlesBBoxes.length;++i)for(j= 0;j<data.length;++j)if(this.seriesTitlesBBoxes[i].checkIntersection(data[j]))return true;if(this.catTitlesBBoxes)for(i=0;i<this.catTitlesBBoxes.length;++i)for(j=0;j<data.length;++j)if(this.catTitlesBBoxes[i].checkIntersection(data[j]))return true;return false};CChartSpace.prototype.rebuildSeries=function(data){if(this.checkIntersectionChangedRange(data))AscFormat.ExecuteNoHistory(function(){this.checkRemoveCache();this.recalculateReferences();this.recalcInfo.recalculateReferences=false},this,[])}; CChartSpace.prototype.checkRemoveCache=function(){this.handleUpdateInternalChart();this.recalcInfo.recalculateReferences=true;this.checkSeriesRefs(this.clearCacheVal)};CChartSpace.prototype.getTypeSubType=function(){var type=null,subtype=null;if(this.chart&&this.chart.plotArea&&this.chart.plotArea.charts[0]){switch(this.chart.plotArea.charts[0].getObjectType()){case AscDFH.historyitem_type_LineChart:{type=c_oAscChartType.line;break}case AscDFH.historyitem_type_AreaChart:{type=c_oAscChartType.area; break}case AscDFH.historyitem_type_DoughnutChart:{type=c_oAscChartType.doughnut;break}case AscDFH.historyitem_type_PieChart:{type=c_oAscChartType.pie;break}case AscDFH.historyitem_type_ScatterChart:{type=c_oAscChartType.scatter;break}case AscDFH.historyitem_type_StockChart:{type=c_oAscChartType.stock;break}case AscDFH.historyitem_type_BarChart:{if(this.chart.plotArea.charts[0].barDir===AscFormat.BAR_DIR_BAR)type=c_oAscChartType.hbar;else type=c_oAscChartType.bar;break}}if(AscFormat.isRealNumber(this.chart.plotArea.charts[0].grouping))if(!this.chart.plotArea.charts[0].getObjectType()=== AscDFH.historyitem_type_BarChart)switch(this.chart.plotArea.charts[0].grouping){case AscFormat.GROUPING_STANDARD:{subtype=c_oAscChartSubType.normal;break}case AscFormat.GROUPING_STACKED:{subtype=c_oAscChartSubType.stacked;break}case AscFormat.GROUPING_PERCENT_STACKED:{subtype=c_oAscChartSubType.stackedPer;break}}else switch(this.chart.plotArea.charts[0].grouping){case AscFormat.BAR_GROUPING_CLUSTERED:case AscFormat.BAR_GROUPING_STANDARD:{subtype=c_oAscChartSubType.normal;break}case AscFormat.BAR_GROUPING_STACKED:{subtype= c_oAscChartSubType.stacked;break}case AscFormat.BAR_GROUPING_PERCENT_STACKED:{subtype=c_oAscChartSubType.stackedPer;break}}}return{type:type,subtype:subtype}};CChartSpace.prototype.clearFormatting=function(bNoClearShapeProps){if(this.spPr&&!(bNoClearShapeProps===true)){this.spPr.Fill&&this.spPr.setFill(null);this.spPr.ln&&this.spPr.setLn(null)}if(this.chart)if(this.chart.plotArea){if(this.chart.plotArea.spPr){this.chart.plotArea.spPr.Fill&&this.chart.plotArea.spPr.setFill(null);this.chart.plotArea.spPr.ln&& this.chart.plotArea.spPr.setLn(null)}var i,j,k,series,pts,chart,ser;for(i=this.chart.plotArea.charts.length-1;i>-1;--i){chart=this.chart.plotArea.charts[i];if(chart.upDownBars){if(chart.upDownBars.upBars){if(chart.upDownBars.upBars.Fill)chart.upDownBars.upBars.setFill(null);if(chart.upDownBars.upBars.ln)chart.upDownBars.upBars.setLn(null)}if(chart.upDownBars.downBars){if(chart.upDownBars.downBars.Fill)chart.upDownBars.downBars.setFill(null);if(chart.upDownBars.downBars.ln)chart.upDownBars.downBars.setLn(null)}}series= chart.series;for(j=series.length-1;j>-1;--j){ser=series[j];if(ser.spPr&&chart.getObjectType()!==AscDFH.historyitem_type_StockChart){if(ser.spPr.Fill)ser.spPr.setFill(null);if(ser.spPr.ln)ser.spPr.setLn(null)}AscFormat.removeDPtsFromSeries(ser)}}}};CChartSpace.prototype.remove=function(){if(this.selection.title){if(this.selection.title.parent)this.selection.title.parent.setTitle(null)}else if(this.selection.legend)if(!AscFormat.isRealNumber(this.selection.legendEntry)){if(this.selection.legend.parent&& this.selection.legend.parent.setLegend)this.selection.legend.parent.setLegend(null)}else{var entry=this.selection.legend.findLegendEntryByIndex(this.selection.legendEntry);if(!entry){entry=new AscFormat.CLegendEntry;entry.setIdx(this.selection.legendEntry);this.selection.legend.addLegendEntry(entry)}entry.setDelete(true)}else if(this.selection.axisLbls){if(this.selection.axisLbls&&this.selection.axisLbls.setDelete)this.selection.axisLbls.setDelete(true)}else if(AscFormat.isRealNumber(this.selection.dataLbls)){var ser= this.getAllSeries()[this.selection.dataLbls];if(ser){var oDlbls=ser.dLbls;if(!ser.dLbls){if(ser.parent&&ser.parent.dLbls)oDlbls=ser.parent.dLbls.createDuplicate();else oDlbls=new AscFormat.CDLbls;ser.setDLbls(oDlbls)}if(!AscFormat.isRealNumber(this.selection.dataLbl))oDlbls.setDelete(true);else{var pts=AscFormat.getPtsFromSeries(ser);var pt=pts[this.selection.dataLbl];if(pt){var dLbl=ser.dLbls&&ser.dLbls.findDLblByIdx(pt.idx);if(!dLbl){dLbl=new AscFormat.CDLbl;dLbl.setIdx(pt.idx);if(ser.dLbls.txPr)dLbl.merge(ser.dLbls); ser.dLbls.addDLbl(dLbl)}dLbl.setDelete(true)}}}}this.selection.title=null;this.selection.legend=null;this.selection.legendEntry=null;this.selection.axisLbls=null;this.selection.dataLbls=null;this.selection.dataLbl=null;this.selection.plotArea=null;this.selection.rotatePlotArea=null;this.selection.gridLine=null;this.selection.series=null;this.selection.datPoint=null;this.selection.markers=null;this.selection.textSelection=null;this.selection.axis=null;this.selection.minorGridlines=null;this.selection.majorGridlines= null;this.selection.hiLowLines=null;this.selection.downBars=null;this.selection.upBars=null};CChartSpace.prototype.copy=function(oPr){var drawingDocument=oPr&&oPr.drawingDocument;var copy=new CChartSpace;if(this.chart)copy.setChart(this.chart.createDuplicate(drawingDocument));if(this.clrMapOvr)copy.setClrMapOvr(this.clrMapOvr.createDuplicate());copy.setDate1904(this.date1904);if(this.externalData)copy.setExternalData(this.externalData.createDuplicate());copy.setLang(this.lang);if(this.pivotSource)copy.setPivotSource(this.pivotSource.createDuplicate()); if(this.printSettings)copy.setPrintSettings(this.printSettings.createDuplicate());if(this.protection)copy.setProtection(this.protection.createDuplicate());copy.setRoundedCorners(this.roundedCorners);if(this.spPr){copy.setSpPr(this.spPr.createDuplicate());copy.spPr.setParent(copy)}copy.setStyle(this.style);if(this.txPr)copy.setTxPr(this.txPr.createDuplicate(oPr));for(var i=0;i<this.userShapes.length;++i)copy.addUserShape(undefined,this.userShapes[i].copy(oPr));copy.setThemeOverride(this.themeOverride); copy.setBDeleted(this.bDeleted);copy.setLocks(this.locks);copy.cachedImage=this.getBase64Img();copy.cachedPixH=this.cachedPixH;copy.cachedPixW=this.cachedPixW;return copy};CChartSpace.prototype.convertToWord=function(document){this.setBDeleted(true);var oPr=undefined;if(document&&document.DrawingDocument){oPr=new AscFormat.CCopyObjectProperties;oPr.drawingDocument=document.DrawingDocument}var oCopy=this.copy(oPr);oCopy.setBDeleted(false);return oCopy};CChartSpace.prototype.convertToPPTX=function(drawingDocument, worksheet){var oPr=new AscFormat.CCopyObjectProperties;oPr.drawingDocument=drawingDocument;var copy=this.copy(oPr);copy.setBDeleted(false);copy.setWorksheet(worksheet);copy.setParent(null);return copy};CChartSpace.prototype.rebuildSeriesFromAsc=function(asc_chart){if(this.chart&&this.chart.plotArea&&this.chart.plotArea.charts[0]){this.chart.plotArea.removeCharts(1,this.chart.plotArea.charts.length-1);var asc_series=asc_chart.series;var chart_type=this.chart.plotArea.charts[0];var first_series=chart_type.series[0]? chart_type.series[0]:chart_type.getSeriesConstructor();var bAccent1Background=this.isAccent1Background();var oFirstSpPrPreset=first_series.getSpPrPreset();if(first_series.spPr){first_series.spPr.setFill(null);first_series.spPr.setLn(null)}var style=AscFormat.CHART_STYLE_MANAGER.getStyleByIndex(this.style);var base_fills=AscFormat.getArrayFillsFromBase(style.fill2,asc_series.length);if(chart_type.getObjectType()!==AscDFH.historyitem_type_ScatterChart){if(asc_series.length<chart_type.series.length)for(var i= chart_type.series.length-1;i>=asc_series.length;--i)chart_type.removeSeries(i);for(var i=0;i<asc_series.length;++i){var series=null,bNeedAdd=false;if(chart_type.series[i])series=chart_type.series[i];else{bNeedAdd=true;series=first_series.createDuplicate()}series.setIdx(i);series.setOrder(i);series.setVal(new AscFormat.CYVal);FillValNum(series.val,asc_series[i].Val,true,false);if(chart_type.getObjectType()===AscDFH.historyitem_type_PieChart||chart_type.getObjectType()===AscDFH.historyitem_type_DoughnutChart){if(oFirstSpPrPreset){var pts= AscFormat.getPtsFromSeries(series);for(var j=0;j<pts.length;++j){var oDPt=new AscFormat.CDPt;oDPt.setBubble3D(false);oDPt.setIdx(j);AscFormat.ApplySpPr(oFirstSpPrPreset,oDPt,j,base_fills,bAccent1Background);series.series[i].addDPt(oDPt)}}}else AscFormat.ApplySpPr(oFirstSpPrPreset,series,i,base_fills,bAccent1Background);if(asc_series[i].Cat&&asc_series[i].Cat.NumCache&&typeof asc_series[i].Cat.Formula==="string"&&asc_series[i].Cat.Formula.length>0){series.setCat(new AscFormat.CCat);FillCatStr(series.cat, asc_series[i].Cat,true,false)}else series.setCat(null);if(asc_series[i].TxCache&&typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,true,false);else series.setTx(null);if(bNeedAdd)chart_type.addSer(series)}}else{for(var i=chart_type.series.length-1;i>-1;--i)chart_type.removeSeries(i);var oXVal;var start_index=0;var minus=0;if(asc_series[0].xVal&&asc_series[0].xVal.NumCache&&typeof asc_series[0].xVal.Formula==="string"&& asc_series[0].xVal.Formula.length>0){oXVal=new AscFormat.CCat;FillCatStr(oXVal,asc_series[0].xVal,true,false)}else if(asc_series[0].Cat&&asc_series[0].Cat.NumCache&&typeof asc_series[0].Cat.Formula==="string"&&asc_series[0].Cat.Formula.length>0){oXVal=new AscFormat.CCat;FillCatStr(oXVal,asc_series[0].Cat,true,false)}for(var i=start_index;i<asc_series.length;++i){var series=new AscFormat.CScatterSeries;series.setIdx(i-minus);series.setOrder(i-minus);AscFormat.ApplySpPr(oFirstSpPrPreset,series,i,base_fills, bAccent1Background);if(oXVal)series.setXVal(oXVal.createDuplicate());series.setYVal(new AscFormat.CYVal);FillValNum(series.yVal,asc_series[i].Val,true,false);if(asc_series[i].TxCache&&typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,true,false);chart_type.addSer(series)}}this.recalculateReferences()}};CChartSpace.prototype.rebuildSeriesData=function(oValRange,oCatRange,oTxRange){var oSeries=this.getSelectedSeries();var oBBox, i,nSeriesIndex,startCell,endCell,aSeries;var oCat,oTx;var oWorksheet=this.worksheet;var bScatter;var oFirstSpPrPreset=0;var oFirstSpPrMarkerPrst=0;var bAccent1Background=false;var style=AscFormat.CHART_STYLE_MANAGER.getStyleByIndex(this.style);var nPointCount=0;if(oSeries){bScatter=oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer;if(oValRange){if(oSeries.getObjectType()===AscDFH.historyitem_type_PieSeries){oFirstSpPrPreset=oSeries.getSpPrPreset();if(oFirstSpPrPreset){bAccent1Background= this.isAccent1Background();nPointCount=Math.max(oValRange.r2-oValRange.r1+1,oValRange.c2-oValRange.c1+1);base_fills=AscFormat.getArrayFillsFromBase(style.fill2,nPointCount);for(var j=0;j<nPointCount;++j)if(!oSeries.getDptByIdx(j)){var oDPt=new AscFormat.CDPt;oDPt.setBubble3D(false);oDPt.setIdx(j);AscFormat.ApplySpPr(oFirstSpPrPreset,oDPt,j,base_fills,bAccent1Background);oSeries.addDPt(oDPt)}}}if(!bScatter){if(!oSeries.val)oSeries.setVal(new AscFormat.CYVal);if(!oSeries.val.numRef)oSeries.val.setNumRef(new AscFormat.CNumRef); this._setRefF(oSeries.val.numRef,oWorksheet,oValRange.r1,oValRange.r2,oValRange.c1,oValRange.c2)}else{if(!oSeries.yVal)oSeries.setYVal(new AscFormat.CYVal);if(!oSeries.yVal.numRef)oSeries.yVal.setNumRef(new AscFormat.CNumRef);this._setRefF(oSeries.yVal.numRef,oWorksheet,oValRange.r1,oValRange.r2,oValRange.c1,oValRange.c2)}}if(oTxRange){if(!oSeries.tx)oSeries.setTx(new AscFormat.CTx);oTx=oSeries.tx;if(!oTx.strRef)oTx.setStrRef(new AscFormat.CStrRef);this._setRefF(oTx.strRef,oWorksheet,oTxRange.r1, oTxRange.r2,oTxRange.c1,oTxRange.c2)}if(oCatRange){aSeries=this.getAllSeries();for(i=0;i<aSeries.length;++i){oSeries=aSeries[i];if(!bScatter){if(!oSeries.cat)oSeries.setCat(new AscFormat.CCat);oCat=oSeries.cat;if(!oCat.strRef)oCat.setStrRef(new AscFormat.CStrRef);this._setRefF(oCat.strRef,oWorksheet,oCatRange.r1,oCatRange.r2,oCatRange.c1,oCatRange.c2)}else{if(!oSeries.xVal)oSeries.setXVal(new AscFormat.CCat);oCat=oSeries.xVal;if(!oCat.strRef)oCat.setStrRef(new AscFormat.CStrRef);this._setRefF(oCat.strRef, oWorksheet,oCatRange.r1,oCatRange.r2,oCatRange.c1,oCatRange.c2)}}}}else{if(!oValRange)return;aSeries=this.getAllSeries();var oLastChart=this.chart.plotArea.charts[this.chart.plotArea.charts.length-1];bScatter=oLastChart.getObjectType()===AscDFH.historyitem_type_ScatterChart;if(aSeries.length>0){if(!bScatter)bAccent1Background=this.isAccent1Background();if(oLastChart.getObjectType()===AscDFH.historyitem_type_PieChart||oLastChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart){if(oLastChart.series[0]&& oLastChart.series[0].dPt[0]&&oLastChart.series[0].dPt[0].spPr&&!oLastChart.series[0].dPt[0].spPr.hasRGBFill())oFirstSpPrPreset=AscFormat.CollectSettingsSpPr(oLastChart.series[0].dPt[0].spPr)}else{if(oLastChart.series[0]&&oLastChart.series[0].spPr&&!oLastChart.series[0].spPr.hasRGBFill())oFirstSpPrPreset=AscFormat.CollectSettingsSpPr(oLastChart.series[0].spPr);if(oLastChart.series[0]&&oLastChart.series[0].marker&&oLastChart.series[0].marker.spPr&&!oLastChart.series[0].marker.spPr.hasRGBFill())oFirstSpPrMarkerPrst= AscFormat.CollectSettingsSpPr(oLastChart.series[0].marker.spPr)}oBBox=this._recalculateBBox(this.getAllSeries()).bbox;var bVert=oBBox.seriesBBox&&oBBox.seriesBBox.bVert;var nStartIndex,nEndIndex;var base_fills;if(bVert){nStartIndex=oValRange.r1;nEndIndex=oValRange.r2;nPointCount=oValRange.c2-oValRange.c1+1}else{nStartIndex=oValRange.c1;nEndIndex=oValRange.c2;nPointCount=oValRange.r2-oValRange.r1+1}base_fills=AscFormat.getArrayFillsFromBase(style.fill2,nEndIndex-nStartIndex+1);for(i=nStartIndex;i<= nEndIndex;++i){nSeriesIndex=i-nStartIndex;if(aSeries[nSeriesIndex])oSeries=aSeries[nSeriesIndex];else{oSeries=oLastChart.series[0]?oLastChart.series[0].createDuplicate():oLastChart.getSeriesConstructor();oLastChart.addSer(oSeries);if(!(oLastChart.getObjectType()===AscDFH.historyitem_type_PieChart||oLastChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart)){if(oFirstSpPrPreset)AscFormat.ApplySpPr(oFirstSpPrPreset,oSeries,nSeriesIndex,base_fills,bAccent1Background);if(oFirstSpPrMarkerPrst&& oSeries.marker)AscFormat.ApplySpPr(oFirstSpPrMarkerPrst,oSeries.marker,nSeriesIndex,base_fills,bAccent1Background)}}if(oLastChart.getObjectType()===AscDFH.historyitem_type_PieChart||oLastChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart)if(oFirstSpPrPreset){base_fills=AscFormat.getArrayFillsFromBase(style.fill2,nPointCount);for(var j=0;j<nPointCount;++j)if(!oSeries.getDptByIdx(j)){var oDPt=new AscFormat.CDPt;oDPt.setBubble3D(false);oDPt.setIdx(j);AscFormat.ApplySpPr(oFirstSpPrPreset,oDPt, j,base_fills,bAccent1Background);oSeries.addDPt(oDPt)}}oSeries.setIdx(nSeriesIndex);oSeries.setOrder(nSeriesIndex);bScatter=oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer;var oNumRef;if(!bScatter){if(!oSeries.val)oSeries.setVal(new AscFormat.CYVal);if(!oSeries.val.numRef)oSeries.val.setNumRef(new AscFormat.CNumRef);oNumRef=oSeries.val.numRef}else{if(!oSeries.yVal)oSeries.setYVal(new AscFormat.CYVal);if(!oSeries.yVal.numRef)oSeries.yVal.setNumRef(new AscFormat.CNumRef);oNumRef=oSeries.yVal.numRef}if(bVert)this._setRefF(oNumRef, oWorksheet,i,i,oValRange.c1,oValRange.c2);else this._setRefF(oNumRef,oWorksheet,oValRange.r1,oValRange.r2,i,i);if(oCatRange){if(!bScatter){if(!oSeries.cat)oSeries.setCat(new AscFormat.CCat);oCat=oSeries.cat;if(!oCat.strRef)oCat.setStrRef(new AscFormat.CStrRef)}else{if(!oSeries.xVal)oSeries.setXVal(new AscFormat.CCat);oCat=oSeries.xVal;if(!oCat.strRef)oCat.setStrRef(new AscFormat.CStrRef)}this._setRefF(oCat.strRef,oWorksheet,oCatRange.r1,oCatRange.r2,oCatRange.c1,oCatRange.c2)}if(oTxRange){if(!oSeries.tx)oSeries.setTx(new AscFormat.CTx); oTx=oSeries.tx;if(!oTx.strRef)oTx.setStrRef(new AscFormat.CStrRef);if(bVert)this._setRefF(oTx.strRef,oWorksheet,i,i,oTxRange.c1,oTxRange.c2);else this._setRefF(oTx.strRef,oWorksheet,oTxRange.r1,oTxRange.r2,i,i)}}var nLastIndex=nEndIndex-nStartIndex;for(i=aSeries.length-1;i>nLastIndex;--i)this._removeSeriesFromChart(aSeries[i])}}};CChartSpace.prototype._removeSeriesFromChart=function(oSeries){if(oSeries.parent){var oChart=oSeries.parent;var aSeries=oChart.series;if(Array.isArray(aSeries))if(aSeries[oSeries.idx]=== oSeries)oChart.removeSeries(oSeries.idx);else for(var i=0;i<aSeries.length;++i)if(aSeries[i]===oSeries){oChart.removeSeries(i);break}}};CChartSpace.prototype._setRefF=function(oRef,oWorksheet,r1,r2,c1,c2){var startCell=new CellAddress(r1,c1,0);var endCell=new CellAddress(r2,c2,0);var sStartCellId=startCell.getIDAbsolute();var sEndCellId=endCell.getIDAbsolute();if(sStartCellId===sEndCellId)oRef.setF(parserHelp.get3DRef(oWorksheet.sName,sStartCellId));else oRef.setF(parserHelp.get3DRef(oWorksheet.sName, sStartCellId+":"+sEndCellId))};CChartSpace.prototype.Write_ToBinary2=function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)};CChartSpace.prototype.Read_FromBinary2=function(r){this.Id=r.GetString2()};CChartSpace.prototype.handleUpdateType=function(){if(this.bNoHandleRecalc===true)return;this.recalcInfo.recalculateChart=true;this.recalcInfo.recalculateSeriesColors=true;this.recalcInfo.recalculatePenBrush=true;this.recalcInfo.recalculatePlotAreaBrush=true;this.recalcInfo.recalculatePlotAreaPen= true;this.recalcInfo.recalculateMarkers=true;this.recalcInfo.recalculateGridLines=true;this.recalcInfo.recalculateDLbls=true;this.recalcInfo.recalculateAxisLabels=true;this.recalcInfo.recalculateAxisVal=true;this.recalcInfo.recalculateAxisTickMark=true;this.recalcInfo.recalculateHiLowLines=true;this.recalcInfo.recalculateUpDownBars=true;this.recalcInfo.recalculateLegend=true;this.recalcInfo.recalculateReferences=true;this.recalcInfo.recalculateBBox=true;this.recalcInfo.recalculateFormulas=true;this.chartObj= null;this.addToRecalculate()};CChartSpace.prototype.handleUpdateExtents=function(bExtX){var oXfrm=this.spPr&&this.spPr.xfrm;if(undefined===bExtX||!oXfrm||bExtX&&!AscFormat.fApproxEqual(this.extX,oXfrm.extX,.01)||false===bExtX&&!AscFormat.fApproxEqual(this.extY,oXfrm.extY,.01)){this.recalcChart();this.recalcBounds();this.recalcTransform();if(this.recalcWrapPolygon)this.recalcWrapPolygon();this.recalcTitles();this.handleUpdateInternalChart(false)}};CChartSpace.prototype.handleUpdateInternalChart=function(bColors){if(this.bNoHandleRecalc=== true)return;this.recalcInfo.recalculateChart=true;if(bColors!==false){this.recalcInfo.recalculateSeriesColors=true;this.recalcInfo.recalculatePenBrush=true}this.recalcInfo.recalculateDLbls=true;this.recalcInfo.recalculateAxisLabels=true;this.recalcInfo.recalculateMarkers=true;this.recalcInfo.recalculateGridLines=true;this.recalcInfo.recalculateHiLowLines=true;this.recalcInfo.recalculatePlotAreaBrush=true;this.recalcInfo.recalculatePlotAreaPen=true;this.recalcInfo.recalculateAxisTickMark=true;this.recalcInfo.recalculateAxisVal= true;this.recalcInfo.recalculateLegend=true;this.recalcInfo.recalculateBBox=true;this.chartObj=null;for(var i=0;i<this.userShapes.length;++i)if(this.userShapes[i].object)this.userShapes[i].object.handleUpdateExtents();this.addToRecalculate()};CChartSpace.prototype.handleUpdateGridlines=function(){this.recalcInfo.recalculateGridLines=true;this.addToRecalculate()};CChartSpace.prototype.handleUpdateDataLabels=function(){this.recalcInfo.recalculateDLbls=true;this.addToRecalculate()};CChartSpace.prototype.updateChildLabelsTransform= function(posX,posY){if(this.localTransformText){this.transformText=this.localTransformText.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transformText,posX,posY);this.invertTransformText=global_MatrixTransformer.Invert(this.transformText)}if(this.chart){if(this.chart.plotArea){this.chart.plotArea.updatePosition(posX,posY);var aCharts=this.chart.plotArea.charts;for(var t=0;t<aCharts.length;++t){var oChart=aCharts[t];var series=oChart.series;for(var i=0;i<series.length;++i){var ser= series[i];var pts=AscFormat.getPtsFromSeries(ser);for(var j=0;j<pts.length;++j)if(pts[j].compiledDlb)pts[j].compiledDlb.updatePosition(posX,posY)}}var aAxes=this.chart.plotArea.axId;for(var i=0;i<aAxes.length;++i){var oAxis=aAxes[i];if(oAxis){if(oAxis.title)oAxis.title.updatePosition(posX,posY);if(oAxis.labels)oAxis.labels.updatePosition(posX,posY)}}}if(this.chart.title)this.chart.title.updatePosition(posX,posY);if(this.chart.legend)this.chart.legend.updatePosition(posX,posY)}for(var i=0;i<this.userShapes.length;++i)if(this.userShapes[i].object&& this.userShapes[i].object.updatePosition)this.userShapes[i].object.updatePosition(posX,posY)};CChartSpace.prototype.recalcTitles=function(){if(this.chart&&this.chart.title){this.chart.title.recalcInfo.recalculateContent=true;this.chart.title.recalcInfo.recalcTransform=true;this.chart.title.recalcInfo.recalculateTransformText=true}if(this.chart&&this.chart.plotArea){var aAxes=this.chart.plotArea.axId;if(aAxes)for(var i=0;i<aAxes.length;++i){var axis=aAxes[i];if(axis&&axis.title){axis.title.recalcInfo.recalculateContent= true;axis.title.recalcInfo.recalcTransform=true;axis.title.recalcInfo.recalculateTransformText=true}}}};CChartSpace.prototype.recalcTitles2=function(){if(this.chart&&this.chart.title){this.chart.title.recalcInfo.recalculateContent=true;this.chart.title.recalcInfo.recalcTransform=true;this.chart.title.recalcInfo.recalculateTransformText=true;this.chart.title.recalcInfo.recalculateTxBody=true}if(this.chart&&this.chart.plotArea){var aAxes=this.chart.plotArea.axId;if(aAxes)for(var i=0;i<aAxes.length;++i){var axis= aAxes[i];if(axis&&axis.title){axis.title.recalcInfo.recalculateContent=true;axis.title.recalcInfo.recalcTransform=true;axis.title.recalcInfo.recalculateTransformText=true;axis.title.recalcInfo.recalculateTxBody=true}}}};CChartSpace.prototype.refreshRecalcData2=function(pageIndex,object){var nObjectType=null;if(object&&object.getObjectType)nObjectType=object.getObjectType();if(nObjectType===AscDFH.historyitem_type_Title&&this.selection.title===object&&this.selection.textSelection===object)this.recalcInfo.recalcTitle= object;else if(nObjectType===AscDFH.historyitem_type_DLbl){var oSelectedDLbl=this.getCompiledDlblBySelect();if(this.selection.textSelection)this.selection.textSelection=oSelectedDLbl;this.recalcInfo.recalcTitle=oSelectedDLbl}else{var bOldRecalculateRef=this.recalcInfo.recalculateReferences;this.setRecalculateInfo();this.handleTitlesAfterChangeTheme();this.recalcInfo.recalculateReferences=bOldRecalculateRef}this.addToRecalculate()};CChartSpace.prototype.Refresh_RecalcData2=function(pageIndex,object){this.refreshRecalcData2(pageIndex, object)};CChartSpace.prototype.Refresh_RecalcData=function(data){switch(data.Type){case AscDFH.historyitem_ChartSpace_SetStyle:{this.handleUpdateStyle();break}case AscDFH.historyitem_ChartSpace_SetTxPr:{this.recalcInfo.recalculateChart=true;this.recalcInfo.recalculateLegend=true;this.recalcInfo.recalculateDLbls=true;this.recalcInfo.recalculateAxisVal=true;this.recalcInfo.recalculateAxisCat=true;this.recalcInfo.recalculateAxisLabels=true;this.addToRecalculate();break}case AscDFH.historyitem_ChartSpace_SetChart:{this.handleUpdateType(); break}case AscDFH.historyitem_ShapeSetBDeleted:{if(!this.bDeleted)this.handleUpdateType();break}}};CChartSpace.prototype.getObjectType=function(){return AscDFH.historyitem_type_ChartSpace};CChartSpace.prototype.getAllRasterImages=function(images){if(this.spPr)this.spPr.checkBlipFillRasterImage(images);var chart=this.chart;if(chart){chart.backWall&&chart.backWall.spPr&&chart.backWall.spPr.checkBlipFillRasterImage(images);chart.floor&&chart.floor.spPr&&chart.floor.spPr.checkBlipFillRasterImage(images); chart.legend&&chart.legend.spPr&&chart.legend.spPr.checkBlipFillRasterImage(images);chart.sideWall&&chart.sideWall.spPr&&chart.sideWall.spPr.checkBlipFillRasterImage(images);chart.title&&chart.title.spPr&&chart.title.spPr.checkBlipFillRasterImage(images);var plot_area=this.chart.plotArea;if(plot_area){plot_area.spPr&&plot_area.spPr.checkBlipFillRasterImage(images);var i;for(i=0;i<plot_area.axId.length;++i){var axis=plot_area.axId[i];if(axis){axis.spPr&&axis.spPr.checkBlipFillRasterImage(images);axis.title&& axis.title&&axis.title.spPr&&axis.title.spPr.checkBlipFillRasterImage(images)}}for(i=0;i<plot_area.charts.length;++i)plot_area.charts[i].getAllRasterImages(images)}}for(var i=0;i<this.userShapes.length;++i)if(this.userShapes[i].object&&this.userShapes[i].object.getAllRasterImages)this.userShapes[i].object.getAllRasterImages(images)};CChartSpace.prototype.getAllContents=function(){};CChartSpace.prototype.getAllFonts=function(allFonts){this.documentGetAllFontNames(allFonts)};CChartSpace.prototype.documentGetAllFontNames= function(allFonts){allFonts["+mn-lt"]=1;allFonts["+mn-ea"]=1;allFonts["+mn-cs"]=1;checkTxBodyDefFonts(allFonts,this.txPr);var chart=this.chart,i;if(chart){for(i=0;i<chart.pivotFmts.length;++i)chart.pivotFmts[i]&&checkTxBodyDefFonts(allFonts,chart.pivotFmts[i].txPr);if(chart.legend){checkTxBodyDefFonts(allFonts,chart.legend.txPr);for(i=0;i<chart.legend.legendEntryes.length;++i)chart.legend.legendEntryes[i]&&checkTxBodyDefFonts(allFonts,chart.legend.legendEntryes[i].txPr)}if(chart.title){checkTxBodyDefFonts(allFonts, chart.title.txPr);if(chart.title.tx&&chart.title.tx.rich){checkTxBodyDefFonts(allFonts,chart.title.tx.rich);chart.title.tx.rich.content&&chart.title.tx.rich.content.Document_Get_AllFontNames(allFonts)}}var plot_area=chart.plotArea;if(plot_area){for(i=0;i<plot_area.charts.length;++i)plot_area.charts[i]&&plot_area.charts[i].documentCreateFontMap(allFonts);var cur_axis;for(i=0;i<plot_area.axId.length;++i){cur_axis=plot_area.axId[i];checkTxBodyDefFonts(allFonts,cur_axis.txPr);if(cur_axis.title){checkTxBodyDefFonts(allFonts, cur_axis.title.txPr);if(cur_axis.title.tx&&cur_axis.title.tx.rich){checkTxBodyDefFonts(allFonts,cur_axis.title.tx.rich);cur_axis.title.tx.rich.content&&cur_axis.title.tx.rich.content.Document_Get_AllFontNames(allFonts)}}}}}for(var i=0;i<this.userShapes.length;++i)if(this.userShapes[i].object&&this.userShapes[i].object.documentGetAllFontNames)this.userShapes[i].object.documentGetAllFontNames(allFonts);if(this.themeOverride&&this.themeOverride.themeElements&&this.themeOverride.themeElements.fontScheme)AscFormat.checkThemeFonts(allFonts, this.themeOverride.themeElements.fontScheme)};CChartSpace.prototype.documentCreateFontMap=function(allFonts){if(this.chart){this.chart.title&&this.chart.title.txBody&&this.chart.title.txBody.content.Document_CreateFontMap(allFonts);var i,j,k;if(this.chart.legend){var calc_entryes=this.chart.legend.calcEntryes;for(i=0;i<calc_entryes.length;++i)calc_entryes[i].txBody.content.Document_CreateFontMap(allFonts)}var axis=this.chart.plotArea.axId,cur_axis;for(i=axis.length-1;i>-1;--i){cur_axis=axis[i];if(cur_axis){cur_axis&& cur_axis.title&&cur_axis.title.txBody&&cur_axis.title.txBody.content.Document_CreateFontMap(allFonts);if(cur_axis.labels)for(j=cur_axis.labels.aLabels.length-1;j>-1;--j)cur_axis.labels.aLabels[j]&&cur_axis.labels.aLabels[j].txBody&&cur_axis.labels.aLabels[j].txBody.content.Document_CreateFontMap(allFonts)}}var series,pts;for(i=this.chart.plotArea.charts.length-1;i>-1;--i){series=this.chart.plotArea.charts[i].series;for(j=series.length-1;j>-1;--j){pts=AscFormat.getPtsFromSeries(series[i]);if(Array.isArray(pts))for(k= pts.length-1;k>-1;--k)pts[k].compiledDlb&&pts[k].compiledDlb.txBody&&pts[k].compiledDlb.txBody.content.Document_CreateFontMap(allFonts)}}}for(var i=0;i<this.userShapes.length;++i)if(this.userShapes[i].object&&this.userShapes[i].object.documentCreateFontMap)this.userShapes[i].object.documentCreateFontMap(allFonts)};CChartSpace.prototype.setThemeOverride=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetThemeOverride,this.themeOverride,pr));this.themeOverride= pr};CChartSpace.prototype.addUserShape=function(pos,item){if(!AscFormat.isRealNumber(pos))pos=this.userShapes.length;History.Add(new AscDFH.CChangesDrawingsContent(this,AscDFH.historyitem_ChartSpace_AddUserShape,pos,[item],true));this.userShapes.splice(pos,0,item);item.setParent(this)};CChartSpace.prototype.removeUserShape=function(pos){var aSplicedShape=this.userShapes.splice(pos,1);History.Add(new AscDFH.CChangesDrawingsContent(this,AscDFH.historyitem_ChartSpace_RemoveUserShape,pos,aSplicedShape, false));return aSplicedShape[0]};CChartSpace.prototype.recalculateUserShapes=function(){for(var i=0;i<this.userShapes.length;++i)if(this.userShapes[i].object)this.userShapes[i].object.recalculate()};CChartSpace.prototype.setParent=function(parent){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetParent,this.parent,parent));this.parent=parent};CChartSpace.prototype.setChart=function(chart){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetChart, this.chart,chart));this.chart=chart;if(chart)chart.setParent(this)};CChartSpace.prototype.setClrMapOvr=function(clrMapOvr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetClrMapOvr,this.clrMapOvr,clrMapOvr));this.clrMapOvr=clrMapOvr};CChartSpace.prototype.setDate1904=function(date1904){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_ChartSpace_SetDate1904,this.date1904,date1904));this.date1904=date1904};CChartSpace.prototype.setExternalData=function(externalData){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_ChartSpace_SetExternalData,this.externalData,externalData));this.externalData=externalData};CChartSpace.prototype.setLang=function(lang){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_ChartSpace_SetLang,this.lang,lang));this.lang=lang};CChartSpace.prototype.setPivotSource=function(pivotSource){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetPivotSource,this.pivotSource,pivotSource));this.pivotSource=pivotSource};CChartSpace.prototype.setPrintSettings= function(printSettings){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetPrintSettings,this.printSettings,printSettings));this.printSettings=printSettings};CChartSpace.prototype.setProtection=function(protection){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetProtection,this.protection,protection));this.protection=protection};CChartSpace.prototype.setRoundedCorners=function(roundedCorners){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_ChartSpace_SetRoundedCorners, this.roundedCorners,roundedCorners));this.roundedCorners=roundedCorners};CChartSpace.prototype.setSpPr=function(spPr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetSpPr,this.spPr,spPr));this.spPr=spPr};CChartSpace.prototype.setStyle=function(style){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ChartSpace_SetStyle,this.style,style));this.style=style;this.handleUpdateStyle()};CChartSpace.prototype.setTxPr=function(txPr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_ChartSpace_SetTxPr,this.txPr,txPr));this.txPr=txPr;if(txPr)txPr.setParent(this)};CChartSpace.prototype.getTransformMatrix=function(){return this.transform};CChartSpace.prototype.canRotate=function(){return false};CChartSpace.prototype.drawAdjustments=function(){};CChartSpace.prototype.isChart=function(){return true};CChartSpace.prototype.isShape=function(){return false};CChartSpace.prototype.isImage=function(){return false};CChartSpace.prototype.isGroup=function(){return false}; CChartSpace.prototype.isPlaceholder=CShape.prototype.isPlaceholder;CChartSpace.prototype.setGroup=function(group){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartSpace_SetGroup,this.group,group));this.group=group};CChartSpace.prototype.getBase64Img=CShape.prototype.getBase64Img;CChartSpace.prototype.getRangeObjectStr=function(){if(this.recalcInfo.recalculateBBox){this.recalculateBBox();this.recalcInfo.recalculateBBox=false}var ret={range:null,bVert:null};if(this.bbox&&this.bbox.seriesBBox){var r1= this.bbox.seriesBBox.r1,r2=this.bbox.seriesBBox.r2,c1=this.bbox.seriesBBox.c1,c2=this.bbox.seriesBBox.c2;ret.bVert=this.bbox.seriesBBox.bVert;if(this.bbox.seriesBBox.bVert){if(this.bbox.catBBox)if(r1>0)--r1;if(this.bbox.serBBox)if(c1>0)--c1}else{if(this.bbox.catBBox)if(c1>0)--c1;if(this.bbox.serBBox)if(r1>0)--r1}if(this.bbox.worksheet){var sRef=(new Asc.Range(c1,r1,c2,r2)).getName(AscCommonExcel.referenceType.A);ret.range=parserHelp.get3DRef(this.bbox.worksheet.sName,sRef)}}return ret};CChartSpace.prototype.getDataRanges= function(){var oSelectedSeries=this.getSelectedSeries();var aSeries;if(oSelectedSeries)aSeries=[oSelectedSeries];else aSeries=this.getAllSeries();return this._recalculateBBox(aSeries)};CChartSpace.prototype._recalculateBBox=function(series){var bbox=null;var seriesBBoxes=[];var seriesTitlesBBoxes=[];var catTitlesBBoxes=[];var oSelectedSeries=this.getSelectedSeries();var series_bboxes=[],cat_bboxes=[],ser_titles_bboxes=[];var series_sheet,cur_bbox,parsed_formulas;if(Array.isArray(series)&&series.length> 0){series.sort(function(a,b){return a.order-b.order});var series_title_f=[],cat_title_f,series_f=[],i,range1;var ref;var b_vert,b_titles_vert;var first_series_sheet;for(i=0;i<series.length;++i){var numRef=null;if(series[i].val)numRef=series[i].val.numRef;else if(series[i].yVal)numRef=series[i].yVal.numRef;if(numRef){parsed_formulas=AscFormat.fParseChartFormula(numRef.f);if(parsed_formulas&&parsed_formulas.length>0&&parsed_formulas[0].worksheet){series_bboxes=series_bboxes.concat(parsed_formulas); if(series_f!==null&&parsed_formulas.length===1){series_sheet=parsed_formulas[0].worksheet;if(!first_series_sheet)first_series_sheet=series_sheet;if(series_sheet!==first_series_sheet)series_f=null;if(parsed_formulas[0].bbox){cur_bbox=parsed_formulas[0].bbox;if(cur_bbox.r1!==cur_bbox.r2&&cur_bbox.c1!==cur_bbox.c2)series_f=null;if(series_f&&series_f.length>0){if(!AscFormat.isRealBool(b_vert))if(series_f[0].c1===cur_bbox.c1&&series_f[0].c2===cur_bbox.c2)b_vert=true;else if(series_f[0].r1===cur_bbox.r1&& series_f[0].r2===cur_bbox.r2)b_vert=false;else series_f=null;else if(b_vert){if(!(series_f[0].c1===cur_bbox.c1&&series_f[0].c2===cur_bbox.c2))series_f=null}else if(!(series_f[0].r1===cur_bbox.r1&&series_f[0].r2===cur_bbox.r2))series_f=null;if(series_f)if(b_vert){if(cur_bbox.r1-series_f[series_f.length-1].r1!==1)series_f=null}else if(cur_bbox.c1-series_f[series_f.length-1].c1!==1)series_f=null}if(series_f!==null)series_f.push(cur_bbox)}else series_f=null}}}else series_f=null;if(series[i].tx&&series[i].tx.strRef){parsed_formulas= AscFormat.fParseChartFormula(series[i].tx.strRef.f);if(parsed_formulas&&parsed_formulas.length>0&&parsed_formulas[0].worksheet)ser_titles_bboxes=ser_titles_bboxes.concat(parsed_formulas);if(series_title_f!==null){if(!parsed_formulas||parsed_formulas.length!==1||!parsed_formulas[0].worksheet){series_title_f=null;continue}var series_cat_sheet=parsed_formulas[0].worksheet;if(series_cat_sheet!==first_series_sheet){series_title_f=null;continue}cur_bbox=parsed_formulas[0].bbox;if(cur_bbox){if(!oSelectedSeries)if(cur_bbox.r1!== cur_bbox.r2||cur_bbox.c1!==cur_bbox.c2){series_title_f=null;continue}if(!AscFormat.isRealBool(b_titles_vert)){if(series_title_f.length>0)if(cur_bbox.r1-series_title_f[0].r1===1)b_titles_vert=true;else if(cur_bbox.c1-series_title_f[0].c1===1)b_titles_vert=false;else if(!oSelectedSeries){series_title_f=null;continue}}else if(b_titles_vert){if(!oSelectedSeries)if(cur_bbox.r1-series_title_f[series_title_f.length-1].r1!==1){series_title_f=null;continue}}else if(!oSelectedSeries)if(cur_bbox.c1-series_title_f[series_title_f.length- 1].c1!==1){series_title_f=null;continue}series_title_f.push(cur_bbox)}else if(!oSelectedSeries){series_title_f=null;continue}}}else series_title_f=null}if(series[0].cat)if(series[0].cat.strRef)ref=series[0].cat.strRef;else{if(series[0].cat.numRef)ref=series[0].cat.numRef}else if(series[0].xVal)if(series[0].xVal.strRef)ref=series[0].xVal.strRef;else if(series[0].xVal.numRef)ref=series[0].xVal.numRef;if(ref){parsed_formulas=AscFormat.fParseChartFormula(ref.f);if(parsed_formulas&&parsed_formulas.length=== 1&&parsed_formulas[0].worksheet){cat_bboxes=cat_bboxes.concat(parsed_formulas);if(parsed_formulas.length===1){var cat_title_sheet=parsed_formulas[0].worksheet;if(cat_title_sheet===first_series_sheet)if(parsed_formulas[0].bbox)cat_title_f=parsed_formulas[0].bbox}}}if(series_f!==null&&series_f.length===1){if(series_f[0].r1===series_f[0].r2&&series_f[0].c1!==series_f[0].c2)b_vert=true;else if(series_f[0].c1===series_f[0].c2&&series_f[0].r1!==series_f[0].r2)b_vert=false;if(!AscFormat.isRealBool(b_vert)&& Array.isArray(series_title_f))if(series_f[0].r1===series_f[0].r2&&series_title_f[0].r1===series_f[0].r1)b_vert=true;else if(series_f[0].c1===series_f[0].c2&&series_title_f[0].c1===series_f[0].c1)b_vert=false;if(!AscFormat.isRealBool(b_vert)){if(cat_title_f)if(series_f[0].r1===series_f[0].r2&&cat_title_f.c1===series_f[0].c1&&cat_title_f.c2===series_f[0].c2)b_vert=true;else if(series_f[0].c1===series_f[0].c2&&cat_title_f.r1===series_f[0].r1&&cat_title_f.r2===series_f[0].r2)b_vert=false;if(!AscFormat.isRealBool(b_vert))b_vert= true}}if(series_f!==null&&series_f.length>0){bbox={seriesBBox:null,catBBox:null,serBBox:null,worksheet:first_series_sheet};bbox.seriesBBox=new window["Asc"].Range(series_f[0].c1,series_f[0].r1,series_f[series_f.length-1].c2,series_f[series_f.length-1].r2,false);bbox.seriesBBox.bVert=b_vert;seriesBBoxes.push(new BBoxInfo(first_series_sheet,bbox.seriesBBox));if(cat_title_f){if(!this.getSelectedSeries())if(b_vert){if(cat_title_f.c1!==bbox.seriesBBox.c1||cat_title_f.c2!==bbox.seriesBBox.c2||cat_title_f.r1!== cat_title_f.r1)cat_title_f=null}else if(cat_title_f.c1!==cat_title_f.c2||cat_title_f.r1!==bbox.seriesBBox.r1||cat_title_f.r2!==bbox.seriesBBox.r2)cat_title_f=null;bbox.catBBox=cat_title_f;if(cat_title_f)catTitlesBBoxes.push(new BBoxInfo(first_series_sheet,cat_title_f))}if(Array.isArray(series_title_f)){bbox.serBBox=new window["Asc"].Range(series_title_f[0].c1,series_title_f[0].r1,series_title_f[series_title_f.length-1].c2,series_title_f[series_title_f.length-1].r2,false);seriesTitlesBBoxes.push(new BBoxInfo(first_series_sheet, bbox.serBBox))}}else{for(i=0;i<series_bboxes.length;++i)seriesBBoxes.push(new BBoxInfo(series_bboxes[i].worksheet,series_bboxes[i].bbox));for(i=0;i<cat_bboxes.length;++i)catTitlesBBoxes.push(new BBoxInfo(cat_bboxes[i].worksheet,cat_bboxes[i].bbox));for(i=0;i<ser_titles_bboxes.length;++i)seriesTitlesBBoxes.push(new BBoxInfo(ser_titles_bboxes[i].worksheet,ser_titles_bboxes[i].bbox))}}return{bbox:bbox,seriesBBoxes:seriesBBoxes,seriesTitlesBBoxes:seriesTitlesBBoxes,catTitlesBBoxes:catTitlesBBoxes}};CChartSpace.prototype.recalculateBBox= function(){var BBoxObj=this._recalculateBBox(this.getAllSeries());this.bbox=BBoxObj.bbox;this.seriesBBoxes=BBoxObj.seriesBBoxes;this.seriesTitlesBBoxes=BBoxObj.seriesTitlesBBoxes;this.catTitlesBBoxes=BBoxObj.catTitlesBBoxes};CChartSpace.prototype.getCommonBBox=function(){var oBBoxInfo=this.getCommonBBoxInfo();if(oBBoxInfo)return oBBoxInfo.bbox};CChartSpace.prototype.recalculateReferences=function(){var oSelectedSeries=this.getSelectedSeries();if(AscFormat.isRealNumber(this.selection.series))if(!oSelectedSeries){this.selection.series= null;this.selection.datPoint=null;this.selection.markers=null}var worksheet=this.worksheet;if(!worksheet)return;if(this.recalcInfo.recalculateBBox){this.recalculateBBox();this.recalcInfo.recalculateBBox=false}var charts,series,i,j,ser;charts=this.chart.plotArea.charts;for(i=0;i<charts.length;++i){series=charts[i].series;for(j=0;j<series.length;++j)series[j].updateData(this.displayEmptyCellsAs,this.displayHidden)}var aTitles=this.getAllTitles();for(i=0;i<aTitles.length;++i){var oTitle=aTitles[i];if(oTitle.tx)oTitle.tx.update()}var aAxis= this.chart.plotArea.axId;for(i=0;i<aAxis.length;++i){var oAxis=aAxis[i];if(oAxis.getObjectType()===AscDFH.historyitem_type_ValAx){var aCharts=this.chart.plotArea.getChartsForAxis(oAxis);for(j=0;j<aCharts.length;++j){var oChart=aCharts[j];if(oChart.getObjectType()===AscDFH.historyitem_type_BarChart&&oChart.grouping===AscFormat.BAR_GROUPING_PERCENT_STACKED||oChart.getObjectType()!==AscDFH.historyitem_type_BarChart&&oChart.grouping===AscFormat.GROUPING_PERCENT_STACKED||oChart.getObjectType()===AscDFH.historyitem_type_ScatterChart)break}if(j=== aCharts.length)if(oAxis.numFmt&&oAxis.numFmt.sourceLinked){var aPoints=AscFormat.getPtsFromSeries(ser);if(aPoints[0]&&typeof aPoints[0].formatCode==="string"&&aPoints[0].formatCode.length>0)oAxis.numFmt.setFormatCode(aPoints[0].formatCode);else if(oAxis.numFmt.formatCode===null||oAxis.numFmt.formatCode==="")oAxis.numFmt.setFormatCode("General")}}}};CChartSpace.prototype.checkEmptyVal=function(val){if(val.numRef){if(!val.numRef.numCache)return true;if(val.numRef.numCache.pts.length===0)return true}else if(val.numLit){if(val.numLit.pts.length=== 0)return true}else return true;return false};CChartSpace.prototype.isEmptySeries=function(series,nSeriesLength){for(var i=0;i<series.length&&i<nSeriesLength;++i){var ser=series[i];if(ser.val)if(!this.checkEmptyVal(ser.val))return false;if(ser.yVal)if(!this.checkEmptyVal(ser.yVal))return false}return true};CChartSpace.prototype.checkEmptySeries=function(){for(var t=0;t<this.chart.plotArea.charts.length;++t){var chart_type=this.chart.plotArea.charts[t];var series=chart_type.series;var nChartType=chart_type.getObjectType(); var nSeriesLength=(nChartType===AscDFH.historyitem_type_PieChart||nChartType===AscDFH.historyitem_type_DoughnutChart)&&this.chart.plotArea.charts.length===1?Math.min(1,series.length):series.length;if(this.isEmptySeries(series,nSeriesLength))return true}return t<1};CChartSpace.prototype.getNeedReflect=function(){if(!this.chartObj)this.chartObj=new AscFormat.CChartsDrawer;return this.chartObj.calculatePositionLabelsCatAxFromAngle(this)};CChartSpace.prototype.isChart3D=function(oChart){var oOldFirstChart= this.chart.plotArea.charts[0];this.chart.plotArea.charts[0]=oChart;var ret=AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this);this.chart.plotArea.charts[0]=oOldFirstChart;return ret};CChartSpace.prototype.getAxisCrossType=function(oAxis){if(oAxis.getObjectType()===AscDFH.historyitem_type_ValAx)return AscFormat.CROSS_BETWEEN_MID_CAT;var oCrossAxis=oAxis.crossAx;if(oCrossAxis&&oCrossAxis.getObjectType()===AscDFH.historyitem_type_ValAx){var oChart=this.chart.plotArea.getChartsForAxis(oCrossAxis)[0]; if(oChart){var nChartType=oChart.getObjectType();if(nChartType===AscDFH.historyitem_type_ScatterChart)return null;else if(nChartType!==AscDFH.historyitem_type_BarChart&&(nChartType!==AscDFH.historyitem_type_PieChart&&nChartType!==AscDFH.historyitem_type_DoughnutChart)||nChartType===AscDFH.historyitem_type_BarChart&&oChart.barDir!==AscFormat.BAR_DIR_BAR){if(oCrossAxis)if(this.isChart3D(oChart))if(nChartType===AscDFH.historyitem_type_AreaChart||nChartType===AscDFH.historyitem_type_SurfaceChart)return AscFormat.isRealNumber(oCrossAxis.crossBetween)? oCrossAxis.crossBetween:AscFormat.CROSS_BETWEEN_MID_CAT;else if(nChartType===AscDFH.historyitem_type_LineChart)return AscFormat.isRealNumber(oCrossAxis.crossBetween)?oCrossAxis.crossBetween:AscFormat.CROSS_BETWEEN_BETWEEN;else return AscFormat.CROSS_BETWEEN_BETWEEN;else return AscFormat.isRealNumber(oCrossAxis.crossBetween)?oCrossAxis.crossBetween:nChartType===AscDFH.historyitem_type_AreaChart||nChartType===AscDFH.historyitem_type_SurfaceChart?AscFormat.CROSS_BETWEEN_MID_CAT:AscFormat.CROSS_BETWEEN_BETWEEN}else if(nChartType=== AscDFH.historyitem_type_BarChart&&oChart.barDir===AscFormat.BAR_DIR_BAR)return AscFormat.isRealNumber(oCrossAxis.crossBetween)&&!this.isChart3D(oChart)?oCrossAxis.crossBetween:AscFormat.CROSS_BETWEEN_BETWEEN}}switch(oAxis.getObjectType()){case AscDFH.historyitem_type_ValAx:{return AscFormat.CROSS_BETWEEN_MID_CAT}case AscDFH.historyitem_type_CatAx:case AscDFH.historyitem_type_DateAx:{return AscFormat.CROSS_BETWEEN_BETWEEN}default:{return AscFormat.CROSS_BETWEEN_BETWEEN}}return AscFormat.CROSS_BETWEEN_BETWEEN}; CChartSpace.prototype.getValAxisCrossType=function(){if(this.chart&&this.chart.plotArea&&this.chart.plotArea.charts[0]){var chartType=this.chart.plotArea.charts[0].getObjectType();var valAx=this.chart.plotArea.valAx;if(chartType===AscDFH.historyitem_type_ScatterChart)return null;else if(chartType!==AscDFH.historyitem_type_BarChart&&(chartType!==AscDFH.historyitem_type_PieChart&&chartType!==AscDFH.historyitem_type_DoughnutChart)||chartType===AscDFH.historyitem_type_BarChart&&this.chart.plotArea.charts[0].barDir!== AscFormat.BAR_DIR_BAR){if(valAx)if(AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this))if(chartType===AscDFH.historyitem_type_AreaChart||chartType===AscDFH.historyitem_type_SurfaceChart)return AscFormat.isRealNumber(valAx.crossBetween)?valAx.crossBetween:AscFormat.CROSS_BETWEEN_MID_CAT;else if(chartType===AscDFH.historyitem_type_LineChart)return AscFormat.isRealNumber(valAx.crossBetween)?valAx.crossBetween:AscFormat.CROSS_BETWEEN_BETWEEN;else return AscFormat.CROSS_BETWEEN_BETWEEN;else return AscFormat.isRealNumber(valAx.crossBetween)? valAx.crossBetween:chartType===AscDFH.historyitem_type_AreaChart||chartType===AscDFH.historyitem_type_SurfaceChart?AscFormat.CROSS_BETWEEN_MID_CAT:AscFormat.CROSS_BETWEEN_BETWEEN}else if(chartType===AscDFH.historyitem_type_BarChart&&this.chart.plotArea.charts[0].barDir===AscFormat.BAR_DIR_BAR)if(valAx)return AscFormat.isRealNumber(valAx.crossBetween)&&!AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this)?valAx.crossBetween:AscFormat.CROSS_BETWEEN_BETWEEN}return null};CChartSpace.prototype.calculatePosByLayout= function(fPos,nLayoutMode,fLayoutValue,fSize,fChartSize){if(!AscFormat.isRealNumber(fLayoutValue))return fPos;var fRetPos=0;if(nLayoutMode===AscFormat.LAYOUT_MODE_EDGE)fRetPos=fChartSize*fLayoutValue;else fRetPos=fPos+fChartSize*fLayoutValue;if(fRetPos+fSize>fChartSize)fRetPos-=fRetPos+fSize-fChartSize;if(fRetPos<0)fRetPos=0;return fRetPos};CChartSpace.prototype.calculateSizeByLayout=function(fPos,fChartSize,fLayoutSize,nSizeMode){if(!AscFormat.isRealNumber(fLayoutSize))return-1;var fRetSize=Math.min(fChartSize* fLayoutSize,fChartSize);if(nSizeMode===AscFormat.LAYOUT_MODE_EDGE)fRetSize=fRetSize-fPos;return fRetSize};CChartSpace.prototype.calculateLayoutByPos=function(fPos,nLayoutMode,fPosValue,fChartSize){var fRetLayoutValue=0;if(nLayoutMode===AscFormat.LAYOUT_MODE_EDGE)fRetLayoutValue=fPosValue/fChartSize;else fRetLayoutValue=(fPosValue-fPos)/fChartSize;return fRetLayoutValue};CChartSpace.prototype.calculateLayoutBySize=function(fPos,nSizeMode,fChartSize,fSize){var fRetLayout;if(nSizeMode===AscFormat.LAYOUT_MODE_EDGE)fRetLayout= (fSize-fPos)/fChartSize;else fRetLayout=fSize/fChartSize;return fRetLayout};CChartSpace.prototype.calculateLabelsPositions=function(b_recalc_labels,b_recalc_legend){var layout;for(var i=0;i<this.recalcInfo.dataLbls.length;++i){var series=this.getAllSeries();if(this.recalcInfo.dataLbls[i].series&&this.recalcInfo.dataLbls[i].pt){var ser_idx=this.recalcInfo.dataLbls[i].series.idx;for(var j=0;j<series.length;++j)if(series[j].idx===this.recalcInfo.dataLbls[i].series.idx){var bLayout=AscCommon.isRealObject(this.recalcInfo.dataLbls[i].layout)&& (AscFormat.isRealNumber(this.recalcInfo.dataLbls[i].layout.x)||AscFormat.isRealNumber(this.recalcInfo.dataLbls[i].layout.y));var pos=this.chartObj.recalculatePositionText(this.recalcInfo.dataLbls[i]);var oLbl=this.recalcInfo.dataLbls[i];if(oLbl.layout){layout=oLbl.layout;if(AscFormat.isRealNumber(layout.x))pos.x=this.calculatePosByLayout(pos.x,layout.xMode,layout.x,this.recalcInfo.dataLbls[i].extX,this.extX);if(AscFormat.isRealNumber(layout.y))pos.y=this.calculatePosByLayout(pos.y,layout.yMode,layout.y, this.recalcInfo.dataLbls[i].extY,this.extY)}if(pos.x+oLbl.extX>this.extX)pos.x-=pos.x+oLbl.extX-this.extX;if(pos.y+oLbl.extY>this.extY)pos.y-=pos.y+oLbl.extY-this.extY;if(pos.x<0)pos.x=0;if(pos.y<0)pos.y=0;oLbl.setPosition(pos.x,pos.y);break}}}this.recalcInfo.dataLbls.length=0;if(b_recalc_labels){if(this.chart&&this.chart.title){var pos=this.chartObj.recalculatePositionText(this.chart.title);if(this.chart.title.layout){layout=this.chart.title.layout;if(AscFormat.isRealNumber(layout.x))pos.x=this.calculatePosByLayout(pos.x, layout.xMode,layout.x,this.chart.title.extX,this.extX);if(AscFormat.isRealNumber(layout.y))pos.y=this.calculatePosByLayout(pos.y,layout.yMode,layout.y,this.chart.title.extY,this.extY)}this.chart.title.setPosition(pos.x,pos.y)}if(this.chart&&this.chart.plotArea){var aAxes=this.chart.plotArea.axId;for(var i=0;i<aAxes.length;++i){var oAxis=aAxes[i];if(oAxis&&oAxis.title){var pos=this.chartObj.recalculatePositionText(oAxis);if(oAxis.title.layout){layout=oAxis.title.layout;if(AscFormat.isRealNumber(layout.x))pos.x= this.calculatePosByLayout(pos.x,layout.xMode,layout.x,oAxis.title.extX,this.extX);if(AscFormat.isRealNumber(layout.y))pos.y=this.calculatePosByLayout(pos.y,layout.yMode,layout.y,oAxis.title.extY,this.extY)}oAxis.title.setPosition(pos.x,pos.y)}}}}if(b_recalc_legend&&this.chart&&this.chart.legend){var bResetLegendPos=false;if(!AscFormat.isRealNumber(this.chart.legend.legendPos)){this.chart.legend.legendPos=Asc.c_oAscChartLegendShowSettings.bottom;bResetLegendPos=true}var pos=this.chartObj.recalculatePositionText(this.chart.legend); if(this.chart.legend.layout){layout=this.chart.legend.layout;if(AscFormat.isRealNumber(layout.x))pos.x=this.calculatePosByLayout(pos.x,layout.xMode,layout.x,this.chart.legend.extX,this.extX);if(AscFormat.isRealNumber(layout.y))pos.y=this.calculatePosByLayout(pos.y,layout.yMode,layout.y,this.chart.legend.extY,this.extY)}this.chart.legend.setPosition(pos.x,pos.y);if(bResetLegendPos)this.chart.legend.legendPos=null}};CChartSpace.prototype.getCatValues=function(){var ret=[];var aAllSeries=this.getAllSeries(), oFirstSeries;if(aAllSeries.length===0)return[];if(aAllSeries.length>0){oFirstSeries=aAllSeries[0];if(oFirstSeries.getObjectType()!==AscDFH.historyitem_type_ScatterSer)return oFirstSeries.getValues(oFirstSeries.getValuesCount());else{if(oFirstSeries.xVal)return oFirstSeries.xVal.getValues();var oAxes=this.chart.plotArea.getAxisByTypes();var oValAxis=null;for(var nAxis=0;nAxis<oAxes.valAx.length;++nAxis)if(oAxes.valAx[nAxis].axPos===AscFormat.AX_POS_B||oAxes.valAx[nAxis].axPos===AscFormat.AX_POS_T){oValAxis= oAxes.valAx[nAxis];break}if(oValAxis)if(Array.isArray(oValAxis.scale))for(var nVal=0;nVal<oValAxis.scale.length;++nVal)ret.push(oValAxis.scale[nVal]+"")}}return ret};CChartSpace.prototype.getLabelsForAxis=function(oAxis){var aStrings=[];var oPlotArea=this.chart.plotArea,i;var nAxisType=oAxis.getObjectType();var oSeries=oPlotArea.getSeriesWithSmallestIndexForAxis(oAxis);var bCat=false;switch(nAxisType){case AscDFH.historyitem_type_DateAx:case AscDFH.historyitem_type_CatAx:{var nPtsLen=0;var aScale= [];if(Array.isArray(oAxis.scale))aScale=aScale.concat(oAxis.scale);if(oSeries&&oSeries.cat){var oCat=oSeries.cat;var oLit=oCat.getLit();if(oLit){bCat=true;var oLitFormat=null,oPtFormat=null;if(typeof oLit.formatCode==="string"&&oLit.formatCode.length>0)oLitFormat=oNumFormatCache.get(oLit.formatCode);if(oAxis.numFmt&&typeof oAxis.numFmt.formatCode==="string"&&oAxis.numFmt.formatCode.length>0)oLitFormat=oNumFormatCache.get(oAxis.numFmt.formatCode);nPtsLen=oLit.ptCount;var bTickSkip=AscFormat.isRealNumber(oAxis.tickLblSkip)|| nPtsLen>=SKIP_LBL_LIMIT;var nTickLblSkip=AscFormat.isRealNumber(oAxis.tickLblSkip)?oAxis.tickLblSkip:nPtsLen<SKIP_LBL_LIMIT?1:Math.floor(nPtsLen/SKIP_LBL_LIMIT)+1;for(i=0;i<nPtsLen;++i)if(!bTickSkip||i%nTickLblSkip===0){var oPt=oLit.getPtByIndex(i);if(oPt){var sPt;if(typeof oPt.formatCode==="string"&&oPt.formatCode.length>0){oPtFormat=oNumFormatCache.get(oPt.formatCode);if(oPtFormat)sPt=oPtFormat.formatToChart(oPt.val);else sPt=oPt.val+""}else if(oLitFormat)sPt=oLitFormat.formatToChart(oPt.val);else sPt= oPt.val+"";aStrings.push(sPt)}else aStrings.push("")}else aStrings.push(null)}}var nPtsLength=0;var aChartsForAxis=oPlotArea.getChartsForAxis(oAxis);for(i=0;i<aChartsForAxis.length;++i){var oChart=aChartsForAxis[i];for(var j=0;j<oChart.series.length;++j){var oCurPts=null;oSeries=oChart.series[j];if(oSeries.val){if(oSeries.val.numRef&&oSeries.val.numRef.numCache)oCurPts=oSeries.val.numRef.numCache;else if(oSeries.val.numLit)oCurPts=oSeries.val.numLit;if(oCurPts)nPtsLength=Math.max(nPtsLength,oCurPts.ptCount)}}}var nCrossBetween= this.getAxisCrossType(oAxis);if(nCrossBetween===AscFormat.CROSS_BETWEEN_MID_CAT&&nPtsLength<2)nPtsLength=2;var oLitFormatDate=null;if(nAxisType===AscDFH.historyitem_type_DateAx&&oAxis.numFmt&&typeof oAxis.numFmt.formatCode==="string"&&oAxis.numFmt.formatCode.length>0)oLitFormatDate=oNumFormatCache.get(oAxis.numFmt.formatCode);if(nPtsLength>aStrings.length){bTickSkip=AscFormat.isRealNumber(oAxis.tickLblSkip)||nPtsLength>=SKIP_LBL_LIMIT;nTickLblSkip=AscFormat.isRealNumber(oAxis.tickLblSkip)?oAxis.tickLblSkip: nPtsLength<SKIP_LBL_LIMIT?1:Math.floor(nPtsLength/SKIP_LBL_LIMIT)+1;var nStartLength=aStrings.length;for(i=aStrings.length;i<nPtsLength;++i)if(!bCat&&(!bTickSkip||(nStartLength+i)%nTickLblSkip===0))if(oLitFormatDate)aStrings.push(oLitFormatDate.formatToChart(i+1));else aStrings.push(i+1+"");else aStrings.push(null)}else aStrings.splice(nPtsLength,aStrings.length-nPtsLength);if(aScale.length>0){while(aStrings.length<aScale[aScale.length-1])aStrings.push("");for(i=0;i<aScale.length;++i){if(aScale[i]> 0)break;aStrings.splice(0,0,"")}}break}case AscDFH.historyitem_type_ValAx:{var aVal=[].concat(oAxis.scale);var fMultiplier;if(oAxis.dispUnits)fMultiplier=oAxis.dispUnits.getMultiplier();else fMultiplier=1;var oNumFormat=null;var sFormatCode=oAxis.getFormatCode(this,oSeries);if(typeof sFormatCode==="string")oNumFormat=oNumFormatCache.get(sFormatCode);if(!oNumFormat)oNumFormat=oNumFormatCache.get("General");for(var t=0;t<aVal.length;++t){var fCalcValue=aVal[t]*fMultiplier;var sRichValue;if(oNumFormat)sRichValue= oNumFormat.formatToChart(fCalcValue);else sRichValue=fCalcValue+"";aStrings.push(sRichValue)}break}case AscDFH.historyitem_type_SerAx:{break}}return aStrings};CChartSpace.prototype.calculateAxisGrid=function(oAxis,oRect){if(!oAxis)return;var oAxisGrid=new CAxisGrid;oAxis.grid=oAxisGrid;var nOrientation=oAxis.scaling&&AscFormat.isRealNumber(oAxis.scaling.orientation)?oAxis.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX;var aStrings=this.getLabelsForAxis(oAxis);var nCrossType=this.getAxisCrossType(oAxis); var bOnTickMark=nCrossType===AscFormat.CROSS_BETWEEN_MID_CAT&&aStrings.length>1;var nIntervalsCount=bOnTickMark?aStrings.length-1:aStrings.length;var fInterval;oAxisGrid.nCount=nIntervalsCount;oAxisGrid.bOnTickMark=bOnTickMark;oAxisGrid.aStrings=aStrings;if(oAxis.axPos===AscFormat.AX_POS_B||oAxis.axPos===AscFormat.AX_POS_T){oAxisGrid.nType=0;fInterval=oRect.w/nIntervalsCount;if(nOrientation===AscFormat.ORIENTATION_MIN_MAX){oAxisGrid.fStart=oRect.x;oAxisGrid.fStride=fInterval}else{oAxisGrid.fStart= oRect.x+oRect.w;oAxisGrid.fStride=-fInterval}}else{oAxis.yPoints=[];oAxisGrid.nType=1;fInterval=oRect.h/nIntervalsCount;if(nOrientation===AscFormat.ORIENTATION_MIN_MAX){oAxisGrid.fStart=oRect.y+oRect.h;oAxisGrid.fStride=-fInterval}else{oAxisGrid.fStart=oRect.y;oAxisGrid.fStride=fInterval}}};CChartSpace.prototype.recalculateAxesSet=function(aAxesSet,oRect,oBaseRect,nIndex,fForceContentWidth){var oCorrectedRect=null;var bWithoutLabels=false;if(this.chart.plotArea.layout&&this.chart.plotArea.layout.layoutTarget=== AscFormat.LAYOUT_TARGET_INNER)bWithoutLabels=true;var bCorrected=false;var fL=oRect.x,fT=oRect.y,fR=oRect.x+oRect.w,fB=oRect.y+oRect.h;var fHorPadding=0;var fVertPadding=0;var fHorInterval=null;var oCalcMap={};for(var i=0;i<aAxesSet.length;++i){var oCurAxis=aAxesSet[i];var oCrossAxis=oCurAxis.crossAx;if(!oCalcMap[oCurAxis.Id]){this.calculateAxisGrid(oCurAxis,oRect);oCalcMap[oCurAxis.Id]=true}if(!oCalcMap[oCrossAxis.Id]){this.calculateAxisGrid(oCrossAxis,oRect);oCalcMap[oCrossAxis.Id]=true}var fCrossValue; var fAxisPos;var fDistance=10*(25.4/72);var nLabelsPos;var bLabelsExtremePosition=false;var bOnTickMark=oCurAxis.grid.bOnTickMark;if(oCurAxis.bDelete)nLabelsPos=c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE;else if(null!==oCurAxis.tickLblPos)nLabelsPos=oCurAxis.tickLblPos;else nLabelsPos=c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO;var bCrossAt=false;var oCrossGrid=oCrossAxis.grid;if(AscFormat.isRealNumber(oCurAxis.crossesAt)&&oCrossAxis.scale[0]<=oCurAxis.crossesAt&&oCrossAxis.scale[oCrossAxis.scale.length- 1]>=oCurAxis.crossesAt){if(oCrossAxis.getObjectType()===AscDFH.historyitem_type_ValAx)fCrossValue=oCurAxis.crossesAt;else fCrossValue=oCurAxis.crossesAt-1;bCrossAt=true}else switch(oCurAxis.crosses){case AscFormat.CROSSES_MAX:{fCrossValue=oCrossAxis.scale[oCrossAxis.scale.length-1];if(!oCrossGrid.bOnTickMark)fCrossValue+=1;if(nLabelsPos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO){fDistance=-fDistance;bLabelsExtremePosition=true}break}case AscFormat.CROSSES_MIN:{fCrossValue=oCrossAxis.scale[0]; if(nLabelsPos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO)bLabelsExtremePosition=true;if(!oCrossGrid.bOnTickMark)fCrossValue-=1}default:{if(oCrossAxis.scale[0]<=0&&oCrossAxis.scale[oCrossAxis.scale.length-1]>=0)fCrossValue=0;else if(oCrossAxis.scale[0]>0)fCrossValue=oCrossAxis.scale[0];else fCrossValue=oCrossAxis.scale[oCrossAxis.scale.length-1]}}if(AscFormat.fApproxEqual(fCrossValue,oCrossAxis.scale[0])||AscFormat.fApproxEqual(fCrossValue,oCrossAxis.scale[oCrossAxis.scale.length-1]))bLabelsExtremePosition= true;var fTickAdd=0;var bKoeff=1;if(oCrossAxis.scale.length>1)bKoeff=oCrossAxis.scale[1]-oCrossAxis.scale[0];fAxisPos=oCrossGrid.fStart;if(oCrossAxis.scale.length>0)fAxisPos+=(fCrossValue-oCrossAxis.scale[0])*oCrossGrid.fStride/bKoeff;var nOrientation=isRealObject(oCrossAxis.scaling)&&AscFormat.isRealNumber(oCrossAxis.scaling.orientation)?oCrossAxis.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX;if(nOrientation===AscFormat.ORIENTATION_MAX_MIN)fDistance=-fDistance;var oLabelsBox=null,fPos;var fPosStart= oCurAxis.grid.fStart;var fPosEnd=oCurAxis.grid.fStart+oCurAxis.grid.nCount*oCurAxis.grid.fStride;var bForceVertical=false;var bNumbers=false;if(nLabelsPos!==c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE){oLabelsBox=new CLabelsBox(oCurAxis.grid.aStrings,oCurAxis,this);switch(nLabelsPos){case c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO:{fPos=fAxisPos;break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH:{fPos=oCrossGrid.fStart+oCrossGrid.nCount*oCrossGrid.fStride;fDistance=-fDistance;break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW:{fPos= oCrossGrid.fStart;break}}}oCurAxis.labels=oLabelsBox;oCurAxis.posX=null;oCurAxis.posY=null;oCurAxis.xPoints=null;oCurAxis.yPoints=null;var aPoints=null;if(oCurAxis.getObjectType()===AscDFH.historyitem_type_SerAx);else if(oCurAxis.axPos===AscFormat.AX_POS_B||oCurAxis.axPos===AscFormat.AX_POS_T){oCurAxis.posY=fAxisPos;oCurAxis.xPoints=[];aPoints=oCurAxis.xPoints;if(oLabelsBox){if(!AscFormat.fApproxEqual(oRect.fVertPadding,0)){fPos-=oRect.fVertPadding;if(nLabelsPos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO)oCurAxis.posY-= oRect.fVertPadding}var nTickLblSkip=AscFormat.isRealNumber(oCurAxis.tickLblSkip)?oCurAxis.tickLblSkip:1;var bTickSkip=nTickLblSkip>1;var fAxisLength=fPosEnd-fPosStart;var nLabelsCount=oLabelsBox.aLabels.length;var bOnTickMark_=bOnTickMark&&nLabelsCount>1;var nIntervalCount=bOnTickMark_?nLabelsCount-1:nLabelsCount;fHorInterval=Math.abs(fAxisLength/nIntervalCount);if(bTickSkip&&!AscFormat.isRealNumber(fForceContentWidth))fForceContentWidth=Math.abs(fHorInterval)+fHorInterval/nTickLblSkip;if(AscFormat.isRealNumber(oCurAxis.lblOffset)){var fStakeOffset= oCurAxis.lblOffset/100;var oFirstTextPr=null;for(var tt=0;tt<oLabelsBox.aLabels.length;++tt){var oLbl=oLabelsBox.aLabels[tt];if(oLbl&&oLbl.tx&&oLbl.tx.rich&&oLbl.tx.rich.content&&oLbl.tx.rich.content.Content[0]){oFirstTextPr=oLbl.tx.rich.content.Content[0].Get_FirstTextPr2();break}}if(oFirstTextPr&&AscFormat.isRealNumber(oFirstTextPr.FontSize))fDistance=fStakeOffset*oFirstTextPr.FontSize*fDistance/10}fLayoutHorLabelsBox(oLabelsBox,fPos,fPosStart,fPosEnd,bOnTickMark,fDistance,bForceVertical,bNumbers, fForceContentWidth);if(bLabelsExtremePosition)if(fDistance>0)fVertPadding=-oLabelsBox.extY;else fVertPadding=oLabelsBox.extY}}else{fDistance=-fDistance;oCurAxis.posX=fAxisPos;oCurAxis.yPoints=[];aPoints=oCurAxis.yPoints;if(oLabelsBox){if(!AscFormat.fApproxEqual(oRect.fHorPadding,0)){fPos-=oRect.fHorPadding;if(nLabelsPos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO)oCurAxis.posX-=oRect.fHorPadding}fLayoutVertLabelsBox(oLabelsBox,fPos,fPosStart,fPosEnd,bOnTickMark,fDistance,bForceVertical);if(bLabelsExtremePosition)if(fDistance> 0)fHorPadding=-oLabelsBox.extX;else fHorPadding=oLabelsBox.extX}}if(null!==aPoints){var fStartSeriesPos=0;if(!bOnTickMark)fStartSeriesPos=oCurAxis.grid.fStride/2;for(var j=0;j<oCurAxis.grid.aStrings.length;++j)aPoints.push({val:oCurAxis.scale[j],pos:oCurAxis.grid.fStart+j*oCurAxis.grid.fStride+fStartSeriesPos})}if(oLabelsBox){if(oLabelsBox.x<fL)fL=oLabelsBox.x;if(oLabelsBox.x+oLabelsBox.extX>fR)fR=oLabelsBox.x+oLabelsBox.extX;if(oLabelsBox.y<fT)fT=oLabelsBox.y;if(oLabelsBox.y+oLabelsBox.extY>fB)fB= oLabelsBox.y+oLabelsBox.extY}}if(nIndex<2){var fDiff;var fPrecision=.01;oCorrectedRect=new CRect(oRect.x,oRect.y,oRect.w,oRect.h);if(bWithoutLabels){fDiff=fL;if(fDiff<0&&!AscFormat.fApproxEqual(fDiff,0,fPrecision)){oCorrectedRect.x-=fDiff;bCorrected=true}fDiff=fR-this.extX;if(fDiff>0&&!AscFormat.fApproxEqual(fDiff,0,fPrecision)){oCorrectedRect.w-=fDiff;bCorrected=true}fDiff=fT;if(fDiff<0&&!AscFormat.fApproxEqual(fDiff,0,fPrecision)){oCorrectedRect.y-=fDiff;bCorrected=true}fDiff=fB-this.extY;if(fDiff> 0&&!AscFormat.fApproxEqual(fDiff,0,fPrecision)){oCorrectedRect.h-=fB-this.extY;bCorrected=true}}else{fDiff=oBaseRect.x-fL;if(!AscFormat.fApproxEqual(fDiff,0,fPrecision)){oCorrectedRect.x+=fDiff;oCorrectedRect.w-=fDiff;bCorrected=true}fDiff=oBaseRect.x+oBaseRect.w-fR;if(!AscFormat.fApproxEqual(fDiff,0,fPrecision)){oCorrectedRect.w+=fDiff;bCorrected=true}fDiff=oBaseRect.y-fT;if(!AscFormat.fApproxEqual(fDiff,0,fPrecision)){oCorrectedRect.y+=fDiff;oCorrectedRect.h-=fDiff;bCorrected=true}fDiff=oBaseRect.y+ oBaseRect.h-fB;if(!AscFormat.fApproxEqual(fDiff,0,fPrecision)){oCorrectedRect.h+=fDiff;bCorrected=true}}if(oCorrectedRect&&bCorrected)if(oCorrectedRect.w>oRect.w)return this.recalculateAxesSet(aAxesSet,oCorrectedRect,oBaseRect,++nIndex,fHorInterval);else return this.recalculateAxesSet(aAxesSet,oCorrectedRect,oBaseRect,++nIndex)}var _ret=oRect.copy();_ret.fHorPadding=fHorPadding;_ret.fVertPadding=fVertPadding;return _ret};CChartSpace.prototype.getReplaceAxis=function(oAxis){var aAxes=this.chart.plotArea.axId; if(oAxis.bDelete&&oAxis.getObjectType()===AscDFH.historyitem_type_ValAx){var bHorizontal=oAxis.axPos===AscFormat.AX_POS_T||oAxis.axPos===AscFormat.AX_POS_B;for(var j=0;j<aAxes.length;++j){var oCheckAxis=aAxes[j];if(!oCheckAxis.bDelete)if(bHorizontal){if(oCheckAxis.axPos===AscFormat.AX_POS_T||oCheckAxis.axPos===AscFormat.AX_POS_B)if(!oAxis.crossAx||oAxis.crossAx&&oCheckAxis.crossAx&&oAxis.crossAx.getObjectType()===oCheckAxis.crossAx.getObjectType())return oCheckAxis}else if(oCheckAxis.axPos===AscFormat.AX_POS_R|| oCheckAxis.axPos===AscFormat.AX_POS_L)if(!oAxis.crossAx||oAxis.crossAx&&oCheckAxis.crossAx&&oAxis.crossAx.getObjectType()===oCheckAxis.crossAx.getObjectType())return oCheckAxis}}return null};CChartSpace.prototype.recalculateAxes=function(){this.cachedCanvas=null;this.plotAreaRect=null;this.bEmptySeries=this.checkEmptySeries();if(this.chart&&this.chart.plotArea){var oPlotArea=this.chart.plotArea;for(i=0;i<oPlotArea.axId.length;++i){oCurAxis=oPlotArea.axId[i];oCurAxis.posY=null;oCurAxis.posX=null;oCurAxis.xPoints= null;oCurAxis.yPoints=null}if(this.bEmptySeries)return;if(!this.chartObj)this.chartObj=new AscFormat.CChartsDrawer;var i,j;var aCharts=this.chart.plotArea.charts,oChart;var oCurAxis,oCurAxis2,aCurAxesSet;var oChartsToAxesCount={};var bAdd,nAxesCount;var oReplaceAxis;for(i=0;i<aCharts.length;++i){bAdd=false;oChart=aCharts[i];if(oChart.axId){nAxesCount=oChart.axId.length;for(j=nAxesCount-1;j>-1;--j){oCurAxis=oChart.axId[j];oReplaceAxis=this.getReplaceAxis(oCurAxis);if(oReplaceAxis){bAdd=true;oChart.axId.push(oReplaceAxis)}}if(bAdd)oChartsToAxesCount[oChart.Id]= nAxesCount}}this.chartObj.preCalculateData(this);for(i in oChartsToAxesCount)if(oChartsToAxesCount.hasOwnProperty(i)){oChart=AscCommon.g_oTableId.Get_ById(i);if(oChart)oChart.axId.length=oChartsToAxesCount[i]}var aAxes=[].concat(oPlotArea.axId);var aAllAxes=[];while(aAxes.length>0){oCurAxis=aAxes.splice(0,1)[0];aCurAxesSet=[];aCurAxesSet.push(oCurAxis);for(i=aAxes.length-1;i>-1;--i){oCurAxis2=aAxes[i];for(j=0;j<aCurAxesSet.length;++j)if(aCurAxesSet[j].crossAx===oCurAxis2||oCurAxis2.crossAx===aCurAxesSet[j])aCurAxesSet.push(oCurAxis2)}if(aCurAxesSet.length> 1)aAllAxes.push(aCurAxesSet)}var oSize=this.getChartSizes();var oRect=new CRect(oSize.startX,oSize.startY,oSize.w,oSize.h);var oBaseRect=oRect;var aRects=[];for(i=0;i<aAllAxes.length;++i){aCurAxesSet=aAllAxes[i];aRects.push(this.recalculateAxesSet(aCurAxesSet,oRect,oBaseRect,0))}if(aRects.length>1){oRect=aRects[0].copy();for(i=1;i<aRects.length;++i)if(!oRect.intersection(aRects[i]))break;var fOldHorPadding=0,fOldVertPadding=0;if(i===aRects.length){var aRects2=[];for(i=0;i<aAllAxes.length;++i){aCurAxesSet= aAllAxes[i];if(i===0){fOldHorPadding=oRect.fHorPadding;fOldVertPadding=oRect.fVertPadding;oRect.fHorPadding=0;oRect.fVertPadding=0}aRects2.push(this.recalculateAxesSet(aCurAxesSet,oRect,oBaseRect,2));if(i===0){oRect.fHorPadding=fOldHorPadding;oRect.fVertPadding=fOldVertPadding}}var bCheckPaddings=false;for(i=0;i<aRects.length;++i){if(Math.abs(aRects2[i].fVertPadding)>Math.abs(aRects[i].fVertPadding)){if(aRects2[i].fVertPadding>0){aRects[i].y+=aRects2[i].fVertPadding-aRects[i].fVertPadding;aRects[i].h-= aRects2[i].fVertPadding-aRects[i].fVertPadding}else aRects[i].h-=Math.abs(aRects2[i].fVertPadding-aRects[i].fVertPadding);aRects[i].fVertPadding=aRects2[i].fVertPadding;bCheckPaddings=true}if(Math.abs(aRects2[i].fHorPadding)>Math.abs(aRects[i].fHorPadding)){if(aRects2[i].fHorPadding>0){aRects[i].x+=aRects2[i].fHorPadding-aRects[i].fHorPadding;aRects[i].w-=aRects2[i].fHorPadding-aRects[i].fHorPadding}else aRects[i].w-=Math.abs(aRects2[i].fHorPadding-aRects[i].fHorPadding);aRects[i].fHorPadding=aRects2[i].fHorPadding; bCheckPaddings=true}}if(bCheckPaddings){oRect=aRects[0].copy();for(i=1;i<aRects.length;++i)if(!oRect.intersection(aRects[i]))break;if(i===aRects.length){var aRects2=[];for(i=0;i<aAllAxes.length;++i){aCurAxesSet=aAllAxes[i];if(i===0){fOldHorPadding=oRect.fHorPadding;fOldVertPadding=oRect.fVertPadding;oRect.fHorPadding=0;oRect.fVertPadding=0}aRects2.push(this.recalculateAxesSet(aCurAxesSet,oRect,oBaseRect,2));if(i===0){oRect.fHorPadding=fOldHorPadding;oRect.fVertPadding=fOldVertPadding}}}}}this.plotAreaRect= oRect.copy()}else if(aRects[0])this.plotAreaRect=aRects[0].copy();aAxes=oPlotArea.axId;var oCheckAxis;for(i=0;i<aAxes.length;++i){oCurAxis=aAxes[i];var bHorizontal=oCurAxis.axPos===AscFormat.AX_POS_T||oCurAxis.axPos===AscFormat.AX_POS_B;oReplaceAxis=this.getReplaceAxis(oCurAxis);if(oReplaceAxis)if(bHorizontal)oCurAxis.xPoints=oReplaceAxis.xPoints;else oCurAxis.yPoints=oReplaceAxis.yPoints}var oChartSize=this.getChartSizes(true);this.chart.plotArea.x=oChartSize.startX;this.chart.plotArea.y=oChartSize.startY; this.chart.plotArea.extX=oChartSize.w;this.chart.plotArea.extY=oChartSize.h;this.chart.plotArea.localTransform.Reset();AscCommon.global_MatrixTransformer.TranslateAppend(this.chart.plotArea.localTransform,oChartSize.startX,oChartSize.startY)}};CChartSpace.prototype.recalculateAxis=function(){if(this.chart&&this.chart.plotArea&&this.chart.plotArea.charts[0]){this.cachedCanvas=null;var b_checkEmpty=this.checkEmptySeries();this.bEmptySeries=b_checkEmpty;var plot_area=this.chart.plotArea;var chart_object= plot_area.chart;var i;var chart_type=chart_object.getObjectType();var bWithoutLabels=false;if(plot_area.layout&&plot_area.layout.layoutTarget===AscFormat.LAYOUT_TARGET_INNER)bWithoutLabels=true;this.plotAreaRect=null;var rect;var bCorrectedLayoutRect=false;if(b_checkEmpty){if(chart_type===AscDFH.historyitem_type_ScatterChart){var x_ax,y_ax;y_ax=this.chart.plotArea.valAx;x_ax=this.chart.plotArea.catAx;y_ax.labels=null;x_ax.labels=null;y_ax.posX=null;x_ax.posY=null;y_ax.posY=null;x_ax.posX=null;y_ax.xPoints= null;x_ax.yPoints=null;y_ax.yPoints=null;x_ax.xPoints=null}else if(chart_type!==AscDFH.historyitem_type_BarChart&&(chart_type!==AscDFH.historyitem_type_PieChart&&chart_type!==AscDFH.historyitem_type_DoughnutChart)||chart_type===AscDFH.historyitem_type_BarChart&&chart_object.barDir!==AscFormat.BAR_DIR_BAR){var cat_ax,val_ax;val_ax=this.chart.plotArea.valAx;cat_ax=this.chart.plotArea.catAx;if(val_ax&&cat_ax){val_ax.labels=null;cat_ax.labels=null;val_ax.posX=null;cat_ax.posY=null;val_ax.posY=null;cat_ax.posX= null;val_ax.xPoints=null;cat_ax.yPoints=null;val_ax.yPoints=null;cat_ax.xPoints=null;val_ax.transformYPoints=null;cat_ax.transformXPoints=null;val_ax.transformXPoints=null;cat_ax.transformYPoints=null}}else if(chart_type===AscDFH.historyitem_type_BarChart&&chart_object.barDir===AscFormat.BAR_DIR_BAR){var cat_ax,val_ax;var axis_by_types=chart_object.getAxisByTypes();cat_ax=axis_by_types.catAx[0];val_ax=axis_by_types.valAx[0];if(cat_ax&&val_ax){val_ax.labels=null;cat_ax.labels=null;val_ax.posX=null; cat_ax.posY=null;val_ax.posY=null;cat_ax.posX=null;val_ax.xPoints=null;cat_ax.yPoints=null;val_ax.yPoints=null;cat_ax.xPoints=null;val_ax.transformYPoints=null;cat_ax.transformXPoints=null;val_ax.transformXPoints=null;cat_ax.transformYPoints=null}}return}var bNeedReflect=this.getNeedReflect();if(chart_type===AscDFH.historyitem_type_ScatterChart){var x_ax,y_ax;y_ax=this.chart.plotArea.valAx;x_ax=this.chart.plotArea.catAx;if(x_ax&&y_ax){y_ax.labels=null;x_ax.labels=null;y_ax.posX=null;x_ax.posY=null; y_ax.posY=null;x_ax.posX=null;y_ax.xPoints=null;x_ax.yPoints=null;y_ax.yPoints=null;x_ax.xPoints=null;var sizes=this.getChartSizes();rect={x:sizes.startX,y:sizes.startY,w:sizes.w,h:sizes.h};var arr_val=this.getValAxisValues();var arr_strings=[];var multiplier;if(y_ax.dispUnits)multiplier=y_ax.dispUnits.getMultiplier();else multiplier=1;var num_fmt=y_ax.numFmt;if(num_fmt&&typeof num_fmt.formatCode==="string"){var num_format=oNumFormatCache.get(num_fmt.formatCode);for(i=0;i<arr_val.length;++i){var calc_value= arr_val[i]*multiplier;var rich_value=num_format.formatToChart(calc_value);arr_strings.push(rich_value)}}else for(i=0;i<arr_val.length;++i){var calc_value=arr_val[i]*multiplier;arr_strings.push(calc_value+"")}var left_align_labels=true;y_ax.labels=new AscFormat.CValAxisLabels(this,y_ax);y_ax.yPoints=[];var max_width=0;for(i=0;i<arr_strings.length;++i){var dlbl=new AscFormat.CDLbl;dlbl.parent=y_ax;dlbl.chart=this;dlbl.spPr=y_ax.spPr;dlbl.txPr=y_ax.txPr;dlbl.tx=new AscFormat.CChartText;dlbl.tx.rich= AscFormat.CreateTextBodyFromString(arr_strings[i],this.getDrawingDocument(),dlbl);if(i>0)dlbl.lastStyleObject=y_ax.labels.aLabels[0].lastStyleObject;var oRecalculateByMaxWord=dlbl.tx.rich.recalculateByMaxWord();var cur_width=oRecalculateByMaxWord.w;if(i===arr_strings.length-1)rect.y+=oRecalculateByMaxWord.h/2;if(cur_width>max_width)max_width=cur_width;y_ax.labels.aLabels.push(dlbl)}var hor_gap=y_ax.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize*(25.4/72);y_ax.labels.extX= max_width+hor_gap;var arr_x_val=this.getXValAxisValues();var num_fmt=x_ax.numFmt;var string_pts=[];if(num_fmt&&typeof num_fmt.formatCode==="string"){var num_format=oNumFormatCache.get(num_fmt.formatCode);for(i=0;i<arr_x_val.length;++i){var calc_value=arr_x_val[i]*multiplier;var rich_value=num_format.formatToChart(calc_value);string_pts.push({val:rich_value})}}else for(i=0;i<arr_x_val.length;++i){var calc_value=arr_x_val[i]*multiplier;string_pts.push({val:calc_value+""})}x_ax.labels=new AscFormat.CValAxisLabels(this, x_ax);var bottom_align_labels=true;var max_height=0;for(i=0;i<string_pts.length;++i){var dlbl=new AscFormat.CDLbl;dlbl.parent=x_ax;dlbl.chart=this;dlbl.spPr=x_ax.spPr;dlbl.txPr=x_ax.txPr;dlbl.tx=new AscFormat.CChartText;dlbl.tx.rich=AscFormat.CreateTextBodyFromString(string_pts[i].val.replace(oNonSpaceRegExp," "),this.getDrawingDocument(),dlbl);if(x_ax.labels.aLabels[0])dlbl.lastStyleObject=x_ax.labels.aLabels[0].lastStyleObject;var oWH=dlbl.tx.rich.recalculateByMaxWord();var cur_height=oWH.h;if(cur_height> max_height)max_height=cur_height;if(i===string_pts.length-1)rect.w-=oWH.w/2;x_ax.labels.aLabels.push(dlbl)}var vert_gap=x_ax.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize*(25.4/72);x_ax.labels.extY=max_height+vert_gap;var x_ax_orientation=isRealObject(x_ax.scaling)&&AscFormat.isRealNumber(x_ax.scaling.orientation)?x_ax.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX;var crosses;if(y_ax.crosses===AscFormat.CROSSES_AUTO_ZERO)if(arr_x_val[0]<=0&&arr_x_val[arr_x_val.length- 1]>=0)crosses=0;else if(arr_x_val[0]>0)crosses=arr_x_val[0];else crosses=arr_x_val[arr_x_val.length-1];else if(y_ax.crosses===AscFormat.CROSSES_MAX)crosses=arr_x_val[arr_x_val.length-1];else if(y_ax.crosses===AscFormat.CROSSES_MIN)crosses=arr_x_val[0];else if(AscFormat.isRealNumber(y_ax.crossesAt)&&arr_val[0]<=y_ax.crossesAt&&arr_val[arr_val.length-1]>=y_ax.crossesAt)crosses=y_ax.crossesAt;else if(arr_x_val[0]<=0&&arr_x_val[arr_x_val.length-1]>=0)crosses=0;else if(arr_x_val[0]>0)crosses=arr_x_val[0]; else crosses=arr_x_val[arr_x_val.length-1];var hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));var vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));var arr_x_points=[],arr_y_points=[];var labels_pos=y_ax.tickLblPos;var first_hor_label_half_width=x_ax.tickLblPos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE||x_ax.bDelete?0:x_ax.labels.aLabels[0].tx.rich.content.XLimit/2;var last_hor_label_half_width=x_ax.tickLblPos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE|| x_ax.bDelete?0:x_ax.labels.aLabels[x_ax.labels.aLabels.length-1].tx.rich.content.XLimit/2;var left_gap=0,right_gap=0;if(x_ax_orientation===AscFormat.ORIENTATION_MIN_MAX)switch(labels_pos){case c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH:{left_align_labels=false;if(bNeedReflect)right_gap=Math.max(last_hor_label_half_width,0);else right_gap=Math.max(last_hor_label_half_width,y_ax.labels.extX);if(!bWithoutLabels){hor_interval_width=checkFiniteNumber((rect.w-right_gap-first_hor_label_half_width)/(arr_x_val[arr_x_val.length- 1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+first_hor_label_half_width+hor_interval_width*(arr_x_val[i]-arr_x_val[0]);y_ax.labels.x=rect.x+first_hor_label_half_width+hor_interval_width*(arr_x_val[arr_x_val.length-1]-arr_x_val[0]);y_ax.posX=rect.x+first_hor_label_half_width+(crosses-arr_x_val[0])*hor_interval_width}else{hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+hor_interval_width* (arr_x_val[i]-arr_x_val[0]);y_ax.labels.x=rect.x+hor_interval_width*(arr_x_val[arr_x_val.length-1]-arr_x_val[0]);y_ax.posX=rect.x+(crosses-arr_x_val[0])*hor_interval_width;if(y_ax.labels.x<0&&!bNeedReflect){rect.x-=y_ax.labels.x;rect.w+=y_ax.labels.x;bCorrectedLayoutRect=true}if(y_ax.labels.x+y_ax.labels.extX>this.extX&&!bNeedReflect){rect.w-=y_ax.labels.x+y_ax.labels.extX-this.extX;bCorrectedLayoutRect=true}if(bCorrectedLayoutRect){hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length- 1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+hor_interval_width*(arr_x_val[i]-arr_x_val[0]);y_ax.labels.x=rect.x+hor_interval_width*(arr_x_val[arr_x_val.length-1]-arr_x_val[0]);y_ax.posX=rect.x+(crosses-arr_x_val[0])*hor_interval_width}}break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW:{if(bNeedReflect)left_gap=Math.max(first_hor_label_half_width,0);else left_gap=Math.max(first_hor_label_half_width,y_ax.labels.extX);if(!bWithoutLabels){hor_interval_width=checkFiniteNumber((rect.w- left_gap-last_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+left_gap+hor_interval_width*(arr_x_val[i]-arr_x_val[0]);y_ax.labels.x=rect.x-y_ax.labels.extX;y_ax.posX=rect.x+(crosses-arr_x_val[0])*hor_interval_width}else{hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+hor_interval_width*(arr_x_val[i]-arr_x_val[0]);y_ax.labels.x=rect.x- y_ax.labels.extX;y_ax.posX=rect.x+(crosses-arr_x_val[0])*hor_interval_width;if(y_ax.labels.x<0&&!bNeedReflect){rect.x-=y_ax.labels.x;rect.w+=y_ax.labels.x;bCorrectedLayoutRect=true}if(y_ax.labels.x+y_ax.labels.extX>this.extX&&!bNeedReflect){rect.w-=y_ax.labels.x+y_ax.labels.extX-this.extX;bCorrectedLayoutRect=true}if(bCorrectedLayoutRect){hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+hor_interval_width* (arr_x_val[i]-arr_x_val[0]);y_ax.labels.x=rect.x-y_ax.labels.extX;y_ax.posX=rect.x+(crosses-arr_x_val[0])*hor_interval_width}}break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE:{if(!bWithoutLabels){y_ax.labels=null;hor_interval_width=checkFiniteNumber((rect.w-first_hor_label_half_width-last_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+first_hor_label_half_width+hor_interval_width*(arr_x_val[i]-arr_x_val[0]);y_ax.posX= rect.x+first_hor_label_half_width+hor_interval_width*(crosses-arr_x_val[0])}else{y_ax.labels=null;hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+first_hor_label_half_width+hor_interval_width*(arr_x_val[i]-arr_x_val[0]);y_ax.posX=rect.x+hor_interval_width*(crosses-arr_x_val[0])}break}default:{if(y_ax.crosses===AscFormat.CROSSES_MAX){left_align_labels=false;if(bNeedReflect)right_gap=Math.max(right_gap,0); else right_gap=Math.max(right_gap,y_ax.labels.extX);if(!bWithoutLabels){y_ax.labels.x=rect.x+rect.w-right_gap;y_ax.posX=rect.x+rect.w-right_gap;hor_interval_width=checkFiniteNumber((rect.w-right_gap-first_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+first_hor_label_half_width+hor_interval_width*(arr_x_val[i]-arr_x_val[0])}else{y_ax.labels.x=rect.x+rect.w;y_ax.posX=rect.x+rect.w;hor_interval_width=checkFiniteNumber(rect.w/ (arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+hor_interval_width*(arr_x_val[i]-arr_x_val[0]);if(y_ax.labels.x<0&&!bNeedReflect){rect.x-=y_ax.labels.x;rect.w+=y_ax.labels.x;bCorrectedLayoutRect=true}if(y_ax.labels.x+y_ax.labels.extX>this.extX&&!bNeedReflect){rect.w-=y_ax.labels.x+y_ax.labels.extX-this.extX;bCorrectedLayoutRect=true}if(bCorrectedLayoutRect){y_ax.labels.x=rect.x+rect.w;y_ax.posX=rect.x+rect.w;hor_interval_width=checkFiniteNumber(rect.w/ (arr_x_val[arr_x_val.length-1]-arr_x_val[0]));for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=rect.x+hor_interval_width*(arr_x_val[i]-arr_x_val[0])}}}else if(!bWithoutLabels){hor_interval_width=checkFiniteNumber((rect.w-first_hor_label_half_width-last_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));if(!bNeedReflect&&first_hor_label_half_width+(crosses-arr_x_val[0])*hor_interval_width<y_ax.labels.extX)hor_interval_width=checkFiniteNumber((rect.w-y_ax.labels.extX-last_hor_label_half_width)/ (arr_x_val[arr_x_val.length-1]-crosses));y_ax.posX=rect.x+rect.w-last_hor_label_half_width-(arr_x_val[arr_x_val.length-1]-crosses)*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=y_ax.posX+(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=y_ax.posX-y_ax.labels.extX}else{hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(arr_x_val[arr_x_val.length-1]-crosses)*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]= y_ax.posX+(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=y_ax.posX-y_ax.labels.extX;if(y_ax.labels.x<0&&!bNeedReflect){rect.x-=y_ax.labels.x;rect.w+=y_ax.labels.x;bCorrectedLayoutRect=true}if(y_ax.labels.x+y_ax.labels.extX>this.extX&&!bNeedReflect){rect.w-=y_ax.labels.x+y_ax.labels.extX-this.extX;bCorrectedLayoutRect=true}if(bCorrectedLayoutRect){hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(arr_x_val[arr_x_val.length-1]- crosses)*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=y_ax.posX+(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=y_ax.posX-y_ax.labels.extX}}break}}else switch(labels_pos){case c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH:{if(bNeedReflect)left_gap=Math.max(0,last_hor_label_half_width);else left_gap=Math.max(y_ax.labels.extX,last_hor_label_half_width);if(!bWithoutLabels){hor_interval_width=checkFiniteNumber((rect.w-left_gap-first_hor_label_half_width)/(arr_x_val[arr_x_val.length- 1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(crosses-arr_x_val[0])*hor_interval_width-first_hor_label_half_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=y_ax.posX-(arr_x_val[arr_x_val.length-1]-crosses)*hor_interval_width-y_ax.labels.extX}else{hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(crosses-arr_x_val[0])*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]= y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=y_ax.posX-(arr_x_val[arr_x_val.length-1]-crosses)*hor_interval_width-y_ax.labels.extX;if(y_ax.labels.x<0&&!bNeedReflect){rect.x-=y_ax.labels.x;rect.w+=y_ax.labels.x;bCorrectedLayoutRect=true}if(y_ax.labels.x+y_ax.labels.extX>this.extX&&!bNeedReflect){rect.w-=y_ax.labels.x+y_ax.labels.extX-this.extX;bCorrectedLayoutRect=true}if(bCorrectedLayoutRect){hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0])); y_ax.posX=rect.x+rect.w-(crosses-arr_x_val[0])*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=y_ax.posX-(arr_x_val[arr_x_val.length-1]-crosses)*hor_interval_width-y_ax.labels.extX}}break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW:{left_align_labels=false;if(bNeedReflect)right_gap=Math.max(0,first_hor_label_half_width);else right_gap=Math.max(y_ax.labels.extX,first_hor_label_half_width);if(!bWithoutLabels){hor_interval_width= checkFiniteNumber((rect.w-right_gap-last_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-right_gap-(crosses-arr_x_val[0])*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=rect.x+rect.w-right_gap}else{hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(crosses-arr_x_val[0])*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]= y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=rect.x+rect.w;if(y_ax.labels.x<0&&!bNeedReflect){rect.x-=y_ax.labels.x;rect.w+=y_ax.labels.x;bCorrectedLayoutRect=true}if(y_ax.labels.x+y_ax.labels.extX>this.extX&&!bNeedReflect){rect.w-=y_ax.labels.x+y_ax.labels.extX-this.extX;bCorrectedLayoutRect=true}if(bCorrectedLayoutRect){hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(crosses-arr_x_val[0])*hor_interval_width; for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width;y_ax.labels.x=rect.x+rect.w}}break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE:{y_ax.labels=null;if(!bWithoutLabels){hor_interval_width=checkFiniteNumber((rect.w-first_hor_label_half_width-last_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-first_hor_label_half_width-(crosses-arr_x_val[0])*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]= y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width}else{hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(crosses-arr_x_val[0])*hor_interval_width;for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width}break}default:{if(y_ax.crosses===AscFormat.CROSSES_MAX){if(bNeedReflect)left_gap=Math.max(0,last_hor_label_half_width);else left_gap=Math.max(y_ax.labels.extX,last_hor_label_half_width);if(!bWithoutLabels){hor_interval_width= checkFiniteNumber((rect.w-left_gap-first_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-first_hor_label_half_width-(crosses-arr_x_val[0])*hor_interval_width;y_ax.labels.x=y_ax.posX-(arr_x_val[arr_x_val.length-1]-crosses)*hor_interval_width-y_ax.labels.extX}else{hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(crosses-arr_x_val[0])*hor_interval_width;y_ax.labels.x=y_ax.posX-(arr_x_val[arr_x_val.length- 1]-crosses)*hor_interval_width-y_ax.labels.extX;if(y_ax.labels.x<0&&!bNeedReflect){rect.x-=y_ax.labels.x;rect.w+=y_ax.labels.x;bCorrectedLayoutRect=true}if(y_ax.labels.x+y_ax.labels.extX>this.extX&&!bNeedReflect){rect.w-=y_ax.labels.x+y_ax.labels.extX-this.extX;bCorrectedLayoutRect=true}if(bCorrectedLayoutRect){hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));y_ax.posX=rect.x+rect.w-(crosses-arr_x_val[0])*hor_interval_width;y_ax.labels.x=y_ax.posX-(arr_x_val[arr_x_val.length- 1]-crosses)*hor_interval_width-y_ax.labels.extX}}}else{left_align_labels=false;if(!bWithoutLabels){hor_interval_width=checkFiniteNumber((rect.w-first_hor_label_half_width-last_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));if(!bNeedReflect&&first_hor_label_half_width+(crosses-arr_x_val[0])*hor_interval_width<y_ax.labels.extX)hor_interval_width=checkFiniteNumber((rect.w-y_ax.labels.extX-last_hor_label_half_width)/(arr_x_val[arr_x_val.length-1]-crosses));left_align_labels=false; y_ax.posX=rect.x+last_hor_label_half_width+hor_interval_width*(arr_x_val[arr_x_val.length-1]-crosses);y_ax.labels.x=y_ax.posX}else{hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));left_align_labels=false;y_ax.posX=rect.x+hor_interval_width*(arr_x_val[arr_x_val.length-1]-crosses);y_ax.labels.x=y_ax.posX;if(y_ax.labels.x<0&&!bNeedReflect){rect.x-=y_ax.labels.x;rect.w+=y_ax.labels.x;bCorrectedLayoutRect=true}if(y_ax.labels.x+y_ax.labels.extX>this.extX&&!bNeedReflect){rect.w-= y_ax.labels.x+y_ax.labels.extX-this.extX;bCorrectedLayoutRect=true}if(bCorrectedLayoutRect){hor_interval_width=checkFiniteNumber(rect.w/(arr_x_val[arr_x_val.length-1]-arr_x_val[0]));left_align_labels=false;y_ax.posX=rect.x+hor_interval_width*(arr_x_val[arr_x_val.length-1]-crosses);y_ax.labels.x=y_ax.posX}}}for(i=0;i<arr_x_val.length;++i)arr_x_points[i]=y_ax.posX-(arr_x_val[i]-crosses)*hor_interval_width;break}}x_ax.interval=hor_interval_width;var y_ax_orientation=isRealObject(y_ax.scaling)&&AscFormat.isRealNumber(y_ax.scaling.orientation)? y_ax.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX;var crosses_x;if(x_ax.crosses===AscFormat.CROSSES_AUTO_ZERO)if(arr_val[0]<=0&&arr_val[arr_val.length-1]>=0)crosses_x=0;else if(arr_val[0]>0)crosses_x=arr_val[0];else crosses_x=arr_val[arr_val.length-1];else if(x_ax.crosses===AscFormat.CROSSES_MAX)crosses_x=arr_val[arr_val.length-1];else if(x_ax.crosses===AscFormat.CROSSES_MIN)crosses_x=arr_val[0];else if(AscFormat.isRealNumber(x_ax.crossesAt)&&arr_val[0]<=x_ax.crossesAt&&arr_val[arr_val.length- 1]>=x_ax.crossesAt)crosses_x=x_ax.crossesAt;else if(arr_val[0]<=0&&arr_val[arr_val.length-1]>=0)crosses_x=0;else if(arr_val[0]>0)crosses_x=arr_val[0];else crosses_x=arr_val[arr_val.length-1];var tick_labels_pos_x=x_ax.tickLblPos;var first_vert_label_half_height=0;var last_vert_label_half_height=0;var bottom_gap=0,top_height=0;if(y_ax_orientation===AscFormat.ORIENTATION_MIN_MAX)switch(tick_labels_pos_x){case c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH:{bottom_align_labels=false;var bottom_start_point= rect.y+rect.h-first_vert_label_half_height;top_height=Math.max(x_ax.labels.extY,last_vert_label_half_height);if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-top_height-first_vert_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.labels.y=bottom_start_point-(arr_val[arr_val.length-1]-arr_val[0])*vert_interval_height-x_ax.labels.extY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=bottom_start_point-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=bottom_start_point- (crosses_x-arr_val[0])*vert_interval_height}else{vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.labels.y=rect.y+rect.h-(arr_val[arr_val.length-1]-arr_val[0])*vert_interval_height-x_ax.labels.extY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-(crosses_x-arr_val[0])*vert_interval_height;var bCheckXLabels=false;if(x_ax.labels.y<0){bCheckXLabels=true;rect.y-=x_ax.labels.y;rect.h-= x_ax.labels.h}if(x_ax.labels.y+x_ax.labels.extY>this.extY){bCheckXLabels=true;rect.h-=x_ax.labels.y+x_ax.labels.extY-this.extY}if(bCheckXLabels){vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.labels.y=rect.y+rect.h-(arr_val[arr_val.length-1]-arr_val[0])*vert_interval_height-x_ax.labels.extY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-(crosses_x-arr_val[0])*vert_interval_height}}break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW:{bottom_gap= Math.max(x_ax.labels.extY,first_vert_label_half_height);if(!bWithoutLabels){x_ax.labels.y=rect.y+rect.h-bottom_gap;vert_interval_height=checkFiniteNumber((rect.h-bottom_gap-last_vert_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-bottom_gap-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-bottom_gap-(crosses_x-arr_val[0])*vert_interval_height}else{x_ax.labels.y=rect.y+rect.h;vert_interval_height=checkFiniteNumber(rect.h/ (arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-(crosses_x-arr_val[0])*vert_interval_height;var bCheckXLabels=false;if(x_ax.labels.y<0){bCheckXLabels=true;rect.y-=x_ax.labels.y;rect.h-=x_ax.labels.h}if(x_ax.labels.y+x_ax.labels.extY>this.extY){bCheckXLabels=true;rect.h-=x_ax.labels.y+x_ax.labels.extY-this.extY}if(bCheckXLabels){x_ax.labels.y=rect.y+rect.h;vert_interval_height=checkFiniteNumber(rect.h/ (arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-(crosses_x-arr_val[0])*vert_interval_height}}break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE:{x_ax.labels=null;if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-first_vert_label_half_height-last_vert_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+ rect.h-first_vert_label_half_height-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-first_vert_label_half_height-(crosses_x-arr_val[0])*vert_interval_height}else{vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-(crosses_x-arr_val[0])*vert_interval_height}break}default:{if(x_ax.crosses===AscFormat.CROSSES_MAX){bottom_align_labels= false;top_height=Math.max(x_ax.labels.extY,last_vert_label_half_height);if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-top_height-first_vert_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-first_vert_label_half_height-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-first_vert_label_half_height-(arr_val[arr_val.length-1]-arr_val[0])*vert_interval_height;x_ax.labels.y=x_ax.posY-x_ax.labels.extY}else{vert_interval_height= checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-(arr_val[arr_val.length-1]-arr_val[0])*vert_interval_height;x_ax.labels.y=x_ax.posY-x_ax.labels.extY;var bCheckXLabels=false;if(x_ax.labels.y<0){bCheckXLabels=true;rect.y-=x_ax.labels.y;rect.h-=x_ax.labels.h}if(x_ax.labels.y+x_ax.labels.extY>this.extY){bCheckXLabels=true;rect.h-=x_ax.labels.y+x_ax.labels.extY- this.extY}if(bCheckXLabels){vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+rect.h-(arr_val[i]-arr_val[0])*vert_interval_height;x_ax.posY=rect.y+rect.h-(arr_val[arr_val.length-1]-arr_val[0])*vert_interval_height;x_ax.labels.y=x_ax.posY-x_ax.labels.extY}}}else if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-first_vert_label_half_height-last_vert_label_half_height)/(arr_val[arr_val.length-1]- arr_val[0]));if(first_vert_label_half_height+(crosses_x-arr_val[0])*vert_interval_height<x_ax.labels.extY)vert_interval_height=checkFiniteNumber((rect.h-x_ax.labels.extY-last_vert_label_half_height)/(arr_val[arr_val.length-1]-crosses_x));x_ax.posY=rect.y+last_vert_label_half_height+(arr_val[arr_val.length-1]-crosses_x)*vert_interval_height;x_ax.labels.y=x_ax.posY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=x_ax.posY-(arr_val[i]-crosses_x)*vert_interval_height}else{vert_interval_height=checkFiniteNumber(rect.h/ (arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(arr_val[arr_val.length-1]-crosses_x)*vert_interval_height;x_ax.labels.y=x_ax.posY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=x_ax.posY-(arr_val[i]-crosses_x)*vert_interval_height;var bCheckXLabels=false;if(x_ax.labels.y<0){bCheckXLabels=true;rect.y-=x_ax.labels.y;rect.h-=x_ax.labels.h}if(x_ax.labels.y+x_ax.labels.extY>this.extY){bCheckXLabels=true;rect.h-=x_ax.labels.y+x_ax.labels.extY-this.extY}if(bCheckXLabels){vert_interval_height=checkFiniteNumber(rect.h/ (arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(arr_val[arr_val.length-1]-crosses_x)*vert_interval_height;x_ax.labels.y=x_ax.posY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=x_ax.posY-(arr_val[i]-crosses_x)*vert_interval_height}}break}}else switch(tick_labels_pos_x){case c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH:{bottom_gap=Math.max(last_vert_label_half_height,x_ax.labels.extY);if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-bottom_gap-first_vert_label_half_height)/ (arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+first_vert_label_half_height+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=x_ax.posY+vert_interval_height*(arr_val[i]-crosses_x);x_ax.labels.y=x_ax.posY+vert_interval_height*(arr_val[arr_val.length-1]-crosses_x)}else{vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]= x_ax.posY+vert_interval_height*(arr_val[i]-crosses_x);x_ax.labels.y=x_ax.posY+vert_interval_height*(arr_val[arr_val.length-1]-crosses_x);var bCheckXLabels=false;if(x_ax.labels.y<0){bCheckXLabels=true;rect.y-=x_ax.labels.y;rect.h-=x_ax.labels.h}if(x_ax.labels.y+x_ax.labels.extY>this.extY){bCheckXLabels=true;rect.h-=x_ax.labels.y+x_ax.labels.extY-this.extY}if(bCheckXLabels){vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(crosses_x-arr_val[0])* vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=x_ax.posY+vert_interval_height*(arr_val[i]-crosses_x);x_ax.labels.y=x_ax.posY+vert_interval_height*(arr_val[arr_val.length-1]-crosses_x)}}break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW:{top_height=Math.max(x_ax.labels.extY,first_vert_label_half_height);bottom_align_labels=false;if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-top_height-last_vert_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY= rect.y+top_height+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+top_height+vert_interval_height*(arr_val[i]-arr_val[0]);x_ax.labels.y=rect.y+top_height-x_ax.labels.extY}else{vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+vert_interval_height*(arr_val[i]-arr_val[0]);x_ax.labels.y=rect.y-x_ax.labels.extY; var bCheckXLabels=false;if(x_ax.labels.y<0){bCheckXLabels=true;rect.y-=x_ax.labels.y;rect.h-=x_ax.labels.h}if(x_ax.labels.y+x_ax.labels.extY>this.extY){bCheckXLabels=true;rect.h-=x_ax.labels.y+x_ax.labels.extY-this.extY}if(bCheckXLabels){vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+vert_interval_height*(arr_val[i]-arr_val[0]);x_ax.labels.y=rect.y- x_ax.labels.extY}}break}case c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE:{x_ax.labels=null;if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-first_vert_label_half_height-last_vert_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+first_vert_label_half_height+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+first_vert_label_half_height+vert_interval_height*(arr_val[i]-arr_val[0])}else{vert_interval_height=checkFiniteNumber(rect.h/ (arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+vert_interval_height*(arr_val[i]-arr_val[0])}break}default:{if(x_ax.crosses===AscFormat.CROSSES_MAX){bottom_gap=Math.max(x_ax.labels.extY,last_vert_label_half_height);if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-bottom_gap-first_vert_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+first_vert_label_half_height+ (crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+first_vert_label_half_height+vert_interval_height*(arr_val[i]-arr_val[0]);x_ax.labels.y=rect.y+rect.extY-bottom_gap}else{vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+vert_interval_height*(arr_val[i]-arr_val[0]);x_ax.labels.y=rect.y+rect.extY;var bCheckXLabels= false;if(x_ax.labels.y<0){bCheckXLabels=true;rect.y-=x_ax.labels.y;rect.h-=x_ax.labels.h}if(x_ax.labels.y+x_ax.labels.extY>this.extY){bCheckXLabels=true;rect.h-=x_ax.labels.y+x_ax.labels.extY-this.extY}if(bCheckXLabels){vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+(crosses_x-arr_val[0])*vert_interval_height;for(i=0;i<arr_val.length;++i)arr_y_points[i]=rect.y+vert_interval_height*(arr_val[i]-arr_val[0]);x_ax.labels.y=rect.y+rect.extY}}}else{bottom_align_labels= false;if(!bWithoutLabels){vert_interval_height=checkFiniteNumber((rect.h-last_vert_label_half_height-first_vert_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));if(first_vert_label_half_height+(crosses_x-arr_val[0])*vert_interval_height<x_ax.labels.extY){x_ax.posY=rect.y+x_ax.labels.extY;vert_interval_height=checkFiniteNumber((rect.h-x_ax.labels.extY-last_vert_label_half_height)/(arr_val[arr_val.length-1]-crosses_x))}else x_ax.posY=rect.y+rect.h-vert_interval_height*(arr_val[arr_val.length- 1]-crosses_x)-last_vert_label_half_height;x_ax.labels.y=x_ax.posY-x_ax.labels.extY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=x_ax.posY+vert_interval_height*(arr_val[i]-crosses_x)}else{vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+rect.h-vert_interval_height*(arr_val[arr_val.length-1]-crosses_x);x_ax.labels.y=x_ax.posY-x_ax.labels.extY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=x_ax.posY+vert_interval_height*(arr_val[i]-crosses_x);var bCheckXLabels= false;if(x_ax.labels.y<0){bCheckXLabels=true;rect.y-=x_ax.labels.y;rect.h-=x_ax.labels.h}if(x_ax.labels.y+x_ax.labels.extY>this.extY){bCheckXLabels=true;rect.h-=x_ax.labels.y+x_ax.labels.extY-this.extY}if(bCheckXLabels){vert_interval_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));x_ax.posY=rect.y+rect.h-vert_interval_height*(arr_val[arr_val.length-1]-crosses_x);x_ax.labels.y=x_ax.posY-x_ax.labels.extY;for(i=0;i<arr_val.length;++i)arr_y_points[i]=x_ax.posY+vert_interval_height* (arr_val[i]-crosses_x)}}}break}}y_ax.interval=vert_interval_height;y_ax.yPoints=[];for(i=0;i<arr_val.length;++i)y_ax.yPoints.push({pos:arr_y_points[i],val:arr_val[i]});x_ax.xPoints=[];for(i=0;i<arr_x_val.length;++i)x_ax.xPoints.push({pos:arr_x_points[i],val:arr_x_val[i]});var arr_labels;var text_transform;var local_text_transform;if(x_ax.bDelete)x_ax.labels=null;if(y_ax.bDelete)y_ax.labels=null;if(x_ax.labels){arr_labels=x_ax.labels.aLabels;x_ax.labels.align=bottom_align_labels;if(bottom_align_labels){var top_line= x_ax.labels.y+vert_gap;for(i=0;i<arr_labels.length;++i)if(arr_labels[i]){arr_labels[i].txBody=arr_labels[i].tx.rich;text_transform=arr_labels[i].transformText;text_transform.Reset();global_MatrixTransformer.TranslateAppend(text_transform,arr_x_points[i]-arr_labels[i].tx.rich.content.XLimit/2,top_line);local_text_transform=arr_labels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,arr_x_points[i]-arr_labels[i].tx.rich.content.XLimit/ 2,top_line)}}else for(i=0;i<arr_labels.length;++i)if(arr_labels[i]){arr_labels[i].txBody=arr_labels[i].tx.rich;text_transform=arr_labels[i].transformText;text_transform.Reset();global_MatrixTransformer.TranslateAppend(text_transform,arr_x_points[i]-arr_labels[i].tx.rich.content.XLimit/2,x_ax.labels.y+x_ax.labels.extY-vert_gap-arr_labels[i].tx.rich.content.GetSummaryHeight());local_text_transform=arr_labels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform, arr_x_points[i]-arr_labels[i].tx.rich.content.XLimit/2,x_ax.labels.y+x_ax.labels.extY-vert_gap-arr_labels[i].tx.rich.content.GetSummaryHeight())}}if(y_ax.labels){if(bNeedReflect)if(left_align_labels){left_align_labels=false;y_ax.labels.x+=y_ax.labels.extX}else{left_align_labels=true;y_ax.labels.x-=y_ax.labels.extX}y_ax.labels.align=left_align_labels;arr_labels=y_ax.labels.aLabels;if(left_align_labels)for(i=0;i<arr_labels.length;++i){if(arr_labels[i]){arr_labels[i].txBody=arr_labels[i].tx.rich;text_transform= arr_labels[i].transformText;text_transform.Reset();global_MatrixTransformer.TranslateAppend(text_transform,y_ax.labels.x+y_ax.labels.extX-hor_gap-arr_labels[i].tx.rich.content.XLimit,arr_y_points[i]-arr_labels[i].tx.rich.content.GetSummaryHeight()/2);local_text_transform=arr_labels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,y_ax.labels.x+y_ax.labels.extX-hor_gap-arr_labels[i].tx.rich.content.XLimit,arr_y_points[i]-arr_labels[i].tx.rich.content.GetSummaryHeight()/ 2)}}else for(i=0;i<arr_labels.length;++i)if(arr_labels[i]){arr_labels[i].txBody=arr_labels[i].tx.rich;text_transform=arr_labels[i].transformText;text_transform.Reset();global_MatrixTransformer.TranslateAppend(text_transform,y_ax.labels.x+hor_gap,arr_y_points[i]-arr_labels[i].tx.rich.content.GetSummaryHeight()/2);local_text_transform=arr_labels[i].transformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,y_ax.labels.x+hor_gap,arr_y_points[i]-arr_labels[i].tx.rich.content.GetSummaryHeight()/ 2)}}if(y_ax.labels)if(y_ax_orientation===AscFormat.ORIENTATION_MIN_MAX){var t=y_ax.labels.aLabels[y_ax.labels.aLabels.length-1].tx.rich.content.GetSummaryHeight()/2;y_ax.labels.y=arr_y_points[arr_y_points.length-1]-t;y_ax.labels.extY=arr_y_points[0]-arr_y_points[arr_y_points.length-1]+t+y_ax.labels.aLabels[0].tx.rich.content.GetSummaryHeight()/2}else{var t=y_ax.labels.aLabels[0].tx.rich.content.GetSummaryHeight()/2;y_ax.labels.y=arr_y_points[0]-t;y_ax.labels.extY=arr_y_points[arr_y_points.length- 1]-arr_y_points[0]+t+y_ax.labels.aLabels[y_ax.labels.aLabels.length-1].tx.rich.content.GetSummaryHeight()/2}if(x_ax.labels)if(x_ax_orientation===AscFormat.ORIENTATION_MIN_MAX){var t=x_ax.labels.aLabels[0].tx.rich.content.XLimit/2;x_ax.labels.x=arr_x_points[0]-t;x_ax.labels.extX=arr_x_points[arr_x_points.length-1]+x_ax.labels.aLabels[x_ax.labels.aLabels.length-1].tx.rich.content.XLimit/2-x_ax.labels.x}else{var t=x_ax.labels.aLabels[x_ax.labels.aLabels.length-1].tx.rich.content.XLimit/2;x_ax.labels.x= arr_x_points[arr_x_points.length-1]-t;x_ax.labels.extX=arr_x_points[0]+x_ax.labels.aLabels[0].tx.rich.content.XLimit/2-x_ax.labels.x}}}else if(chart_type!==AscDFH.historyitem_type_BarChart&&(chart_type!==AscDFH.historyitem_type_PieChart&&chart_type!==AscDFH.historyitem_type_DoughnutChart)||chart_type===AscDFH.historyitem_type_BarChart&&chart_object.barDir!==AscFormat.BAR_DIR_BAR){var cat_ax,val_ax,ser_ax;val_ax=this.chart.plotArea.valAx;cat_ax=this.chart.plotArea.catAx;ser_ax=this.chart.plotArea.serAx; if(val_ax&&cat_ax){val_ax.labels=null;cat_ax.labels=null;if(ser_ax){ser_ax.labels=null;ser_ax.posY=null;ser_ax.posX=null;ser_ax.xPoints=null;ser_ax.yPoints=null}val_ax.posX=null;cat_ax.posY=null;val_ax.posY=null;cat_ax.posX=null;val_ax.xPoints=null;cat_ax.yPoints=null;val_ax.yPoints=null;cat_ax.xPoints=null;var sizes=this.getChartSizes();rect={x:sizes.startX,y:sizes.startY,w:sizes.w,h:sizes.h};var arr_val=this.getValAxisValues();var arr_strings=[];var multiplier;if(val_ax.dispUnits)multiplier=val_ax.dispUnits.getMultiplier(); else multiplier=1;var num_fmt=val_ax.numFmt;if(num_fmt&&typeof num_fmt.formatCode==="string"){var num_format=oNumFormatCache.get(num_fmt.formatCode);for(i=0;i<arr_val.length;++i){var calc_value=arr_val[i]*multiplier;var rich_value=num_format.formatToChart(calc_value);arr_strings.push(rich_value)}}else for(i=0;i<arr_val.length;++i){var calc_value=arr_val[i]*multiplier;arr_strings.push(calc_value+"")}val_ax.labels=new AscFormat.CValAxisLabels(this,val_ax);var max_width=0;val_ax.yPoints=[];var max_val_labels_text_height= 0;var lastStyleObject=null;for(i=0;i<arr_strings.length;++i){var dlbl=new AscFormat.CDLbl;if(lastStyleObject)dlbl.lastStyleObject=lastStyleObject;dlbl.parent=val_ax;dlbl.chart=this;dlbl.spPr=val_ax.spPr;dlbl.txPr=val_ax.txPr;dlbl.tx=new AscFormat.CChartText;dlbl.tx.rich=AscFormat.CreateTextBodyFromString(arr_strings[i],this.getDrawingDocument(),dlbl);var t=dlbl.tx.rich.recalculateByMaxWord();if(!lastStyleObject)lastStyleObject=dlbl.lastStyleObject;var cur_width=t.w;if(cur_width>max_width)max_width= cur_width;if(t.h>max_val_labels_text_height)max_val_labels_text_height=t.h;val_ax.labels.aLabels.push(dlbl);val_ax.yPoints.push({val:arr_val[i],pos:null})}var val_axis_labels_gap=val_ax.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize*25.4/72;val_ax.labels.extX=max_width+val_axis_labels_gap;var ser=chart_object.series[0];var string_pts=[],pts_len=0;if(ser&&ser.cat){var lit,b_num_lit=true;lit=ser.cat.getLit();if(lit){b_num_lit=lit.getObjectType()===AscDFH.historyitem_type_NumLit; var lit_format=null,pt_format=null;if(b_num_lit&&typeof lit.formatCode==="string"&&lit.formatCode.length>0)lit_format=oNumFormatCache.get(lit.formatCode);pts_len=lit.ptCount;for(i=0;i<pts_len;++i){var pt=lit.getPtByIndex(i);if(pt){var str_pt;if(b_num_lit)if(typeof pt.formatCode==="string"&&pt.formatCode.length>0){pt_format=oNumFormatCache.get(pt.formatCode);if(pt_format)str_pt=pt_format.formatToChart(pt.val);else str_pt=pt.val}else if(lit_format)str_pt=lit_format.formatToChart(pt.val);else str_pt= pt.val;else str_pt=pt.val;string_pts.push({val:str_pt+""})}else string_pts.push({val:""})}}}var cross_between=this.getValAxisCrossType();if(cross_between===null)cross_between=AscFormat.CROSS_BETWEEN_BETWEEN;{pts_len=0;for(i=0;i<chart_object.series.length;++i){var cur_pts=null;ser=chart_object.series[i];if(ser.val){if(ser.val.numRef&&ser.val.numRef.numCache)cur_pts=ser.val.numRef.numCache;else if(ser.val.numLit)cur_pts=ser.val.numLit;if(cur_pts)pts_len=Math.max(pts_len,cur_pts.ptCount)}}if(cross_between=== AscFormat.CROSS_BETWEEN_MID_CAT&&pts_len<2)pts_len=2;if(pts_len>string_pts.length)for(i=string_pts.length;i<pts_len;++i)string_pts.push({val:i+1+""});else string_pts.splice(pts_len,string_pts.length-pts_len)}var crosses;if(val_ax.crosses===AscFormat.CROSSES_AUTO_ZERO||val_ax.crosses===AscFormat.CROSSES_MIN)crosses=1;else if(val_ax.crosses===AscFormat.CROSSES_MAX)crosses=string_pts.length;else if(AscFormat.isRealNumber(val_ax.crossesAt))if(val_ax.crossesAt<=string_pts.length+1&&val_ax.crossesAt>0)crosses= val_ax.crossesAt;else if(val_ax.crossesAt<=0)crosses=1;else crosses=string_pts.length;else crosses=1;cat_ax.maxCatVal=string_pts.length;var cat_ax_orientation=cat_ax.scaling&&AscFormat.isRealNumber(cat_ax.scaling.orientation)?cat_ax.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX;var point_width=rect.w/string_pts.length;var labels_pos=val_ax.tickLblPos;if(val_ax.bDelete)labels_pos=c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE;var left_val_ax_labels_align=true;var intervals_count=cross_between=== AscFormat.CROSS_BETWEEN_MID_CAT?string_pts.length-1:string_pts.length;var point_interval=rect.w/intervals_count;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)point_interval=checkFiniteNumber(rect.w/(string_pts.length-1));else point_interval=checkFiniteNumber(rect.w/string_pts.length);var left_points_width,right_point_width;var arr_cat_labels_points=[];if(cat_ax_orientation===AscFormat.ORIENTATION_MIN_MAX)if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO||!AscFormat.isRealNumber(labels_pos))if(val_ax.crosses=== AscFormat.CROSSES_MAX){left_val_ax_labels_align=false;if(!bWithoutLabels){val_ax.labels.x=rect.x+rect.w-val_ax.labels.extX;if(!bNeedReflect)point_interval=checkFiniteNumber((rect.w-val_ax.labels.extX)/intervals_count);else point_interval=checkFiniteNumber(rect.w/intervals_count);val_ax.posX=val_ax.labels.x;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]= point_interval/2+rect.x+point_interval*i}else{val_ax.labels.x=rect.x+rect.w;if(val_ax.labels.x<0&&!bNeedReflect){rect.x-=val_ax.labels.x;rect.w+=val_ax.labels.x;val_ax.labels.x=0;bCorrectedLayoutRect=true}if(rect.x+rect.w>this.extX){rect.w-=rect.x+rect.w-this.extX;bCorrectedLayoutRect=true}point_interval=checkFiniteNumber(rect.w/intervals_count);val_ax.posX=val_ax.labels.x;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+point_interval* i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=point_interval/2+rect.x+point_interval*i}}else{left_points_width=point_interval*(crosses-1);if(!bWithoutLabels){if(!bNeedReflect&&left_points_width<val_ax.labels.extX){var right_intervals_count=intervals_count-(crosses-1);point_interval=checkFiniteNumber((rect.w-val_ax.labels.extX)/right_intervals_count);val_ax.labels.x=rect.x;var start_point=val_ax.labels.x+val_ax.labels.extX-(crosses-1)*point_interval;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i= 0;i<string_pts.length;++i)arr_cat_labels_points[i]=start_point+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=point_interval/2+start_point+point_interval*i}else{val_ax.labels.x=rect.x+left_points_width-val_ax.labels.extX;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=point_interval/2+rect.x+point_interval*i}val_ax.posX=val_ax.labels.x+ val_ax.labels.extX}else{val_ax.labels.x=rect.x+left_points_width-val_ax.labels.extX;if(val_ax.labels.x<0&&!bNeedReflect){rect.x-=val_ax.labels.x;rect.w+=val_ax.labels.x;val_ax.labels.x=0;bCorrectedLayoutRect=true}if(rect.x+rect.w>this.extX){rect.w-=rect.x+rect.w-this.extX;bCorrectedLayoutRect=true}point_interval=checkFiniteNumber(rect.w/intervals_count);if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+point_interval*i;else for(i=0;i< string_pts.length;++i)arr_cat_labels_points[i]=point_interval/2+rect.x+point_interval*i;val_ax.posX=val_ax.labels.x+val_ax.labels.extX}}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW){if(!bNeedReflect)point_interval=checkFiniteNumber((rect.w-val_ax.labels.extX)/intervals_count);else point_interval=checkFiniteNumber(rect.w/intervals_count);val_ax.labels.x=rect.x;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)if(!bNeedReflect)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]= rect.x+val_ax.labels.extX+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+point_interval*i;else if(!bNeedReflect)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+val_ax.labels.extX+point_interval/2+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+point_interval/2+point_interval*i;val_ax.posX=val_ax.labels.x+val_ax.labels.extX+point_interval*(crosses-1)}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH){if(!bNeedReflect)point_interval= checkFiniteNumber((rect.w-val_ax.labels.extX)/intervals_count);else point_interval=checkFiniteNumber(rect.w/intervals_count);val_ax.labels.x=rect.x+rect.w-val_ax.labels.extX;left_val_ax_labels_align=false;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=point_interval/2+rect.x+point_interval*i;val_ax.posX=rect.x+point_interval*(crosses-1)}else{val_ax.labels= null;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=point_interval/2+rect.x+point_interval*i;val_ax.posX=rect.x+point_interval*(crosses-1)}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO||!AscFormat.isRealNumber(labels_pos))if(val_ax.crosses===AscFormat.CROSSES_MAX)if(!bWithoutLabels){val_ax.labels.x=rect.x;if(!bNeedReflect)point_interval= checkFiniteNumber((rect.w-val_ax.labels.extX)/intervals_count);else point_interval=checkFiniteNumber(rect.w/intervals_count);if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval/2-point_interval*i;if(!bNeedReflect)val_ax.posX=val_ax.labels.x+val_ax.labels.extX;else val_ax.posX=val_ax.labels.x}else{val_ax.labels.x=rect.x-val_ax.labels.extX; if(val_ax.labels.x<0&&!bNeedReflect){rect.x-=val_ax.labels.x;rect.w+=val_ax.labels.x;val_ax.labels.x=0;bCorrectedLayoutRect=true}if(rect.x+rect.w>this.extX){rect.w-=rect.x+rect.w-this.extX;bCorrectedLayoutRect=true}point_interval=checkFiniteNumber(rect.w/intervals_count);if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval/ 2-point_interval*i;if(!bNeedReflect)val_ax.posX=val_ax.labels.x+val_ax.labels.extX;else val_ax.posX=val_ax.labels.x}else{left_val_ax_labels_align=false;right_point_width=point_interval*(crosses-1);if(!bNeedReflect&&right_point_width<val_ax.labels.extX&&!bWithoutLabels){val_ax.labels.x=rect.x+rect.w-val_ax.labels.extX;var left_points_interval_count=intervals_count-(crosses-1);point_interval=checkFiniteNumber(checkFiniteNumber((val_ax.labels.x-rect.x)/left_points_interval_count));var start_point_right= rect.x+point_interval*intervals_count;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=start_point_right-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=start_point_right-point_interval/2-point_interval*i}else{val_ax.labels.x=rect.x+rect.w-right_point_width;if(val_ax.labels.x<0&&!bNeedReflect){rect.x-=val_ax.labels.x;rect.w+=val_ax.labels.x;val_ax.labels.x=0;bCorrectedLayoutRect=true}if(rect.x+rect.w>this.extX){rect.w-= rect.x+rect.w-this.extX;bCorrectedLayoutRect=true}point_interval=checkFiniteNumber(rect.w/intervals_count);if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval/2-point_interval*i}val_ax.posX=val_ax.labels.x}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW){left_val_ax_labels_align=false;if(!bNeedReflect&&!bWithoutLabels)point_interval= checkFiniteNumber((rect.w-val_ax.labels.extX)/intervals_count);else point_interval=checkFiniteNumber(rect.w/intervals_count);if(!bWithoutLabels){val_ax.labels.x=rect.x+rect.w-val_ax.labels.extX;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=val_ax.labels.x-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=val_ax.labels.x-point_interval/2-point_interval*i;if(!bNeedReflect)val_ax.posX=rect.x+rect.w-point_interval* (crosses-1)-val_ax.labels.extX;else val_ax.posX=rect.x+rect.w-point_interval*(crosses-1)}else{val_ax.labels.x=rect.x+rect.w;if(val_ax.labels.x<0&&!bNeedReflect){rect.x-=val_ax.labels.x;rect.w+=val_ax.labels.x;val_ax.labels.x=0;bCorrectedLayoutRect=true}if(rect.x+rect.w>this.extX){rect.w-=rect.x+rect.w-this.extX;bCorrectedLayoutRect=true}point_interval=checkFiniteNumber(rect.w/intervals_count);if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]= val_ax.labels.x-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=val_ax.labels.x-point_interval/2-point_interval*i;if(!bNeedReflect)val_ax.posX=rect.x+rect.w-point_interval*(crosses-1)-val_ax.labels.extX;else val_ax.posX=rect.x+rect.w-point_interval*(crosses-1)}}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH){if(!bNeedReflect&&!bWithoutLabels)point_interval=checkFiniteNumber((rect.w-val_ax.labels.extX)/intervals_count);else point_interval=checkFiniteNumber(rect.w/ intervals_count);if(!bWithoutLabels){val_ax.labels.x=rect.x;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval/2-point_interval*i;val_ax.posX=rect.x+rect.w-point_interval*(crosses-1)}else{val_ax.labels.x=rect.x-val_ax.labels.extX;if(val_ax.labels.x<0&&!bNeedReflect){rect.x-=val_ax.labels.x;rect.w+=val_ax.labels.x;val_ax.labels.x= 0;bCorrectedLayoutRect=true}if(rect.x+rect.w>this.extX){rect.w-=rect.x+rect.w-this.extX;bCorrectedLayoutRect=true}point_interval=checkFiniteNumber(rect.w/intervals_count);if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval/2-point_interval*i;val_ax.posX=rect.x+rect.w-point_interval*(crosses-1)}}else{val_ax.labels=null;if(cross_between=== AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.x+rect.w-point_interval/2-point_interval*i;val_ax.posX=rect.x+rect.w-point_interval*(crosses-1)}cat_ax.interval=point_interval;var diagram_width=point_interval*intervals_count;var bTickSkip=AscFormat.isRealNumber(cat_ax.tickLblSkip);var tick_lbl_skip=AscFormat.isRealNumber(cat_ax.tickLblSkip)?cat_ax.tickLblSkip:1; var max_cat_label_width=diagram_width/string_pts.length;cat_ax.labels=null;var b_rotated=false;if(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE!==cat_ax.tickLblPos&&!(cat_ax.bDelete===true)){cat_ax.labels=new AscFormat.CValAxisLabels(this,cat_ax);var max_min_width=0;var max_max_width=0;var arr_max_contents=[];var fMaxContentStringH=0;for(i=0;i<string_pts.length;++i){var dlbl=null;if(i%tick_lbl_skip===0){dlbl=new AscFormat.CDLbl;dlbl.parent=cat_ax;dlbl.chart=this;dlbl.spPr=cat_ax.spPr;dlbl.txPr=cat_ax.txPr; dlbl.tx=new AscFormat.CChartText;dlbl.tx.rich=AscFormat.CreateTextBodyFromString(string_pts[i].val.replace(oNonSpaceRegExp," "),this.getDrawingDocument(),dlbl);var content=dlbl.tx.rich.content;content.Set_ApplyToAll(true);content.SetParagraphAlign(AscCommon.align_Center);content.Set_ApplyToAll(false);dlbl.txBody=dlbl.tx.rich;if(cat_ax.labels.aLabels.length>0)dlbl.lastStyleObject=cat_ax.labels.aLabels[0].lastStyleObject;var min_max=dlbl.tx.rich.content.RecalculateMinMaxContentWidth();var max_min_content_width= min_max.Min;if(max_min_content_width>max_min_width)max_min_width=max_min_content_width;if(min_max.Max>max_max_width)max_max_width=min_max.Max;if(dlbl.tx.rich.content.Content[0].Content[0].TextHeight>fMaxContentStringH)fMaxContentStringH=dlbl.tx.rich.content.Content[0].Content[0].TextHeight}cat_ax.labels.aLabels.push(dlbl)}fMaxContentStringH*=1;var stake_offset=AscFormat.isRealNumber(cat_ax.lblOffset)?cat_ax.lblOffset/100:1;var labels_offset=cat_ax.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize* (25.4/72)*stake_offset;if(max_min_width<max_cat_label_width){var max_height=0;for(i=0;i<cat_ax.labels.aLabels.length;++i)if(cat_ax.labels.aLabels[i]){var content=cat_ax.labels.aLabels[i].tx.rich.content;content.Reset(0,0,max_cat_label_width,2E4);content.Recalculate_Page(0,true);var cur_height=content.GetSummaryHeight();if(cur_height>max_height)max_height=cur_height}cat_ax.labels.extY=max_height+labels_offset;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT){var left_gap_point,right_gap_point;if(cat_ax_orientation=== AscFormat.ORIENTATION_MIN_MAX){var first_label_left_gap=cat_ax.labels.aLabels[0].tx.rich.getMaxContentWidth(max_cat_label_width)/2;var last_labels_right_gap=cat_ax.labels.aLabels[cat_ax.labels.aLabels.length-1]?cat_ax.labels.aLabels[cat_ax.labels.aLabels.length-1].tx.rich.getMaxContentWidth(max_cat_label_width)/2:0;left_gap_point=arr_cat_labels_points[0]-first_label_left_gap;if(rect.x>left_gap_point&&!bWithoutLabels){if(val_ax.labels)val_ax.labels.x=rect.x+(val_ax.labels.x-left_gap_point)*checkFiniteNumber(rect.w/ (rect.x+rect.w-left_gap_point));point_interval*=checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point));for(i=0;i<arr_cat_labels_points.length;++i)arr_cat_labels_points[i]=rect.x+(arr_cat_labels_points[i]-left_gap_point)*checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point));val_ax.posX=rect.x+(val_ax.posX-left_gap_point)*checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point))}right_gap_point=arr_cat_labels_points[arr_cat_labels_points.length-1]+last_labels_right_gap;if(right_gap_point>rect.x+ rect.w&&!bWithoutLabels){if(val_ax.labels)val_ax.labels.x=rect.x+(val_ax.labels.x-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x));point_interval*=checkFiniteNumber(rect.w/(right_gap_point-rect.x));for(i=0;i<arr_cat_labels_points.length;++i)arr_cat_labels_points[i]=rect.x+(arr_cat_labels_points[i]-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x));val_ax.posX=rect.x+(val_ax.posX-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x))}}else{var last_label_left_gap=cat_ax.labels.aLabels[cat_ax.labels.aLabels.length- 1]?cat_ax.labels.aLabels[cat_ax.labels.aLabels.length-1].tx.rich.getMaxContentWidth(max_cat_label_width)/2:0;var first_label_right_gap=cat_ax.labels.aLabels[0].tx.rich.getMaxContentWidth(max_cat_label_width)/2;left_gap_point=arr_cat_labels_points[arr_cat_labels_points.length-1]-last_label_left_gap;right_gap_point=arr_cat_labels_points[0]+first_label_right_gap;if(rect.x>left_gap_point&&!bWithoutLabels){if(val_ax.labels)val_ax.labels.x=rect.x+(val_ax.labels.x-left_gap_point)*checkFiniteNumber(rect.w/ (rect.x+rect.w-left_gap_point));point_interval*=checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point));for(i=0;i<arr_cat_labels_points.length;++i)arr_cat_labels_points[i]=rect.x+(arr_cat_labels_points[i]-left_gap_point)*checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point));val_ax.posX=rect.x+(val_ax.posX-left_gap_point)*checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point))}if(right_gap_point>rect.x+rect.w&&!bWithoutLabels){if(val_ax.labels)val_ax.labels.x=rect.x+(val_ax.labels.x-rect.x)*checkFiniteNumber(rect.w/ (right_gap_point-rect.x));point_interval*=checkFiniteNumber(rect.w/(right_gap_point-rect.x));for(i=0;i<arr_cat_labels_points.length;++i)arr_cat_labels_points[i]=rect.x+(arr_cat_labels_points[i]-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x));val_ax.posX=rect.x+(val_ax.posX-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x))}}}}else{b_rotated=true;var arr_left_points=[];var arr_right_points=[];var max_rotated_height=0;cat_ax.labels.bRotated=true;var nMaxCount=1;var nLblCount=0;var nCount= 0;var nSkip=1;if(!bTickSkip&&fMaxContentStringH>0){nMaxCount=diagram_width/fMaxContentStringH;nSkip=Math.max(1,cat_ax.labels.aLabels.length/nMaxCount+1>>0)}else bTickSkip=true;for(i=0;i<cat_ax.labels.aLabels.length;++i)if(cat_ax.labels.aLabels[i]){if(i%nSkip!==0){cat_ax.labels.aLabels[i]=null;arr_left_points[i]=arr_cat_labels_points[i];arr_right_points[i]=arr_cat_labels_points[i];nCount++;continue}var wh=cat_ax.labels.aLabels[i].tx.rich.getContentOneStringSizes();arr_left_points[i]=arr_cat_labels_points[i]- (wh.w*Math.cos(Math.PI/4)+wh.h*Math.sin(Math.PI/4)-wh.h*Math.sin(Math.PI/4)/2);arr_right_points[i]=arr_cat_labels_points[i]+wh.h*Math.sin(Math.PI/4)/2;var h2=wh.w*Math.sin(Math.PI/4)+wh.h*Math.cos(Math.PI/4);if(h2>max_rotated_height)max_rotated_height=h2;nLblCount++;nCount++;cat_ax.labels.aLabels[i].widthForTransform=wh.w}else{arr_left_points[i]=arr_cat_labels_points[i];arr_right_points[i]=arr_cat_labels_points[i]}cat_ax.labels.extY=max_rotated_height+labels_offset;left_gap_point=Math.max(0,Math.min.apply(Math, arr_left_points));right_gap_point=Math.max(0,Math.max.apply(Math,arr_right_points));if(!bWithoutLabels)if(AscFormat.ORIENTATION_MIN_MAX===cat_ax_orientation){if(rect.x>left_gap_point){if(val_ax.labels)val_ax.labels.x=rect.x+(val_ax.labels.x-left_gap_point)*checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point));point_interval*=checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point));for(i=0;i<arr_cat_labels_points.length;++i)arr_cat_labels_points[i]=rect.x+(arr_cat_labels_points[i]-left_gap_point)* checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point));val_ax.posX=rect.x+(val_ax.posX-left_gap_point)*checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point))}if(right_gap_point>rect.x+rect.w){if(val_ax.labels)val_ax.labels.x=rect.x+(val_ax.labels.x-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x));point_interval*=checkFiniteNumber((right_gap_point-rect.x)/(rect.x+rect.w-rect.x));for(i=0;i<arr_cat_labels_points.length;++i)arr_cat_labels_points[i]=rect.x+(arr_cat_labels_points[i]-rect.x)* checkFiniteNumber(rect.w/(right_gap_point-rect.x));val_ax.posX=rect.x+(val_ax.posX-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x))}}else{if(rect.x>left_gap_point){if(val_ax.labels)val_ax.labels.x=rect.x+(val_ax.labels.x-left_gap_point)*checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point));point_interval*=rect.w/checkFiniteNumber(rect.x+rect.w-left_gap_point);for(i=0;i<arr_cat_labels_points.length;++i)arr_cat_labels_points[i]=rect.x+(arr_cat_labels_points[i]-left_gap_point)*checkFiniteNumber(rect.w/ (rect.x+rect.w-left_gap_point));val_ax.posX=rect.x+(val_ax.posX-left_gap_point)*checkFiniteNumber(rect.w/(rect.x+rect.w-left_gap_point))}if(right_gap_point>rect.x+rect.w){if(val_ax.labels)val_ax.labels.x=rect.x+(val_ax.labels.x-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x));point_interval*=checkFiniteNumber((right_gap_point-rect.x)/(rect.x+rect.w-rect.x));for(i=0;i<arr_cat_labels_points.length;++i)arr_cat_labels_points[i]=rect.x+(arr_cat_labels_points[i]-rect.x)*checkFiniteNumber(rect.w/ (right_gap_point-rect.x));val_ax.posX=rect.x+(val_ax.posX-rect.x)*checkFiniteNumber(rect.w/(right_gap_point-rect.x))}}}}if(ser_ax)if(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE!==ser_ax.tickLblPos&&!(ser_ax.bDelete===true)){var arr_series_labels_str=[];var aSeries=chart_object.series;for(var i=0;i<aSeries.length;++i)if(aSeries[i].getSeriesName)arr_series_labels_str.push(aSeries[i].getSeriesName());else arr_series_labels_str.push("Series "+(i+1));ser_ax.labels=new AscFormat.CValAxisLabels(this,ser_ax); tick_lbl_skip=AscFormat.isRealNumber(ser_ax.tickLblSkip)?ser_ax.tickLblSkip:1;var lastStyleObject=null;max_val_labels_text_height=0;max_width=0;for(i=0;i<arr_series_labels_str.length;++i){var dlbl=null;if(i%tick_lbl_skip===0){var dlbl=new AscFormat.CDLbl;if(lastStyleObject)dlbl.lastStyleObject=lastStyleObject;dlbl.parent=val_ax;dlbl.chart=this;dlbl.spPr=val_ax.spPr;dlbl.txPr=val_ax.txPr;dlbl.tx=new AscFormat.CChartText;dlbl.tx.rich=AscFormat.CreateTextBodyFromString(arr_series_labels_str[i],this.getDrawingDocument(), dlbl);var t=dlbl.tx.rich.recalculateByMaxWord();if(!lastStyleObject)lastStyleObject=dlbl.lastStyleObject;var cur_width=t.w;if(cur_width>max_width)max_width=cur_width;if(t.h>max_val_labels_text_height)max_val_labels_text_height=t.h;ser_ax.labels.aLabels.push(dlbl)}}var ser_axis_labels_gap=ser_ax.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize*25.4/72;ser_ax.labels.extX=max_width+ser_axis_labels_gap;ser_ax.labels.extY=max_val_labels_text_height}else ser_ax.labels=null;var cat_labels_align_bottom= true;var crosses_val_ax;if(cat_ax.crosses===AscFormat.CROSSES_AUTO_ZERO)if(arr_val[0]<=0&&arr_val[arr_val.length-1]>=0)crosses_val_ax=0;else if(arr_val[arr_val.length-1]<0)crosses_val_ax=arr_val[arr_val.length-1];else crosses_val_ax=arr_val[0];else if(cat_ax.crosses===AscFormat.CROSSES_MIN)crosses_val_ax=arr_val[0];else if(cat_ax.crosses===AscFormat.CROSSES_MAX)crosses_val_ax=arr_val[arr_val.length-1];else if(AscFormat.isRealNumber(cat_ax.crossesAt)&&cat_ax.crossesAt>=arr_val[0]&&cat_ax.crossesAt<= arr_val[arr_val.length-1]){if(cat_ax.crossesAt>=arr_val[0]&&cat_ax.crossesAt<=arr_val[arr_val.length-1])crosses_val_ax=cat_ax.crossesAt}else if(arr_val[0]<=0&&arr_val[arr_val.length-1]>=0)crosses_val_ax=0;else if(arr_val[arr_val.length-1]<0)crosses_val_ax=arr_val[arr_val.length-1];else crosses_val_ax=arr_val[0];var val_ax_orientation=val_ax.scaling&&AscFormat.isRealNumber(val_ax.scaling.orientation)?val_ax.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX;var hor_labels_pos=cat_ax.tickLblPos;var arr_val_labels_points= [];var top_val_axis_gap,bottom_val_axis_gap;var first_val_axis_label_half_height=0;var last_val_axis_label_half_height=0;var unit_height;if(!bWithoutLabels)unit_height=checkFiniteNumber((rect.h-first_val_axis_label_half_height-last_val_axis_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));else unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));var cat_ax_ext_y=cat_ax.labels?cat_ax.labels.extY:0;if(val_ax_orientation===AscFormat.ORIENTATION_MIN_MAX)if(hor_labels_pos=== c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO||!AscFormat.isRealNumber(hor_labels_pos)){if(cat_ax.crosses===AscFormat.CROSSES_MAX){cat_labels_align_bottom=false;top_val_axis_gap=Math.max(last_val_axis_label_half_height,cat_ax_ext_y);if(!bWithoutLabels){unit_height=checkFiniteNumber((rect.h-top_val_axis_gap-first_val_axis_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));cat_labels_align_bottom=false;cat_ax.posY=rect.y+rect.h-first_val_axis_label_half_height-(crosses_val_ax-arr_val[0])* unit_height;if(cat_ax.labels)cat_ax.labels.y=cat_ax.posY-cat_ax_ext_y}else{unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_labels_align_bottom=false;cat_ax.posY=rect.y+rect.h-(crosses_val_ax-arr_val[0])*unit_height;if(cat_ax.labels){cat_ax.labels.y=cat_ax.posY-cat_ax_ext_y;if(true){var bCorrectedCat=false;if(cat_ax.labels.y<0){rect.y-=cat_ax.labels.y;rect.h+=cat_ax.labels.y;cat_ax.labels.y=0;bCorrectedCat=true}if(cat_ax.labels.y+cat_ax.labels.extY>this.extY){rect.h-= cat_ax.labels.y+cat_ax.labels.extY-this.extY;bCorrectedCat=true}if(bCorrectedCat){unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_labels_align_bottom=false;cat_ax.posY=rect.y+rect.h-(crosses_val_ax-arr_val[0])*unit_height}}}}}else if(!bWithoutLabels){var bottom_points_height=first_val_axis_label_half_height+(crosses_val_ax-arr_val[0])*unit_height;if(bottom_points_height<cat_ax_ext_y)unit_height=checkFiniteNumber((rect.h-last_val_axis_label_half_height-cat_ax_ext_y)/ (arr_val[arr_val.length-1]-crosses_val_ax));cat_ax.posY=rect.y+last_val_axis_label_half_height+(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;if(cat_ax.labels)cat_ax.labels.y=cat_ax.posY}else{cat_ax.posY=rect.y+(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;if(cat_ax.labels){cat_ax.labels.y=cat_ax.posY;if(true){var bCorrectedCat=false;if(cat_ax.labels.y<0){rect.y-=cat_ax.labels.y;rect.h+=cat_ax.labels.y;cat_ax.labels.y=0;bCorrectedCat=true}if(cat_ax.labels.y+cat_ax.labels.extY>this.extY){rect.h-= cat_ax.labels.y+cat_ax.labels.extY-this.extY;bCorrectedCat=true}if(bCorrectedCat){unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;cat_ax.labels.y=cat_ax.posY}}}}for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY-(arr_val[i]-crosses_val_ax)*unit_height}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW)if(!bWithoutLabels){bottom_val_axis_gap=Math.max(cat_ax_ext_y, first_val_axis_label_half_height);unit_height=checkFiniteNumber((rect.h-bottom_val_axis_gap-last_val_axis_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+last_val_axis_label_half_height+(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;if(cat_ax.labels)cat_ax.labels.y=rect.y+rect.h-bottom_val_axis_gap;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY-(arr_val[i]-crosses_val_ax)*unit_height}else{unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length- 1]-arr_val[0]));cat_ax.posY=rect.y+(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;if(cat_ax.labels){cat_ax.labels.y=rect.y+rect.h;if(true){var bCorrectedCat=false;if(cat_ax.labels.y<0){rect.y-=cat_ax.labels.y;rect.h+=cat_ax.labels.y;cat_ax.labels.y=0;bCorrectedCat=true}if(cat_ax.labels.y+cat_ax.labels.extY>this.extY){rect.h-=cat_ax.labels.y+cat_ax.labels.extY-this.extY;bCorrectedCat=true}if(bCorrectedCat){unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY= rect.y+(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;cat_ax.labels.y=rect.y+rect.h}}}for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY-(arr_val[i]-crosses_val_ax)*unit_height}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH)if(!bWithoutLabels){top_val_axis_gap=Math.max(last_val_axis_label_half_height,cat_ax_ext_y);unit_height=checkFiniteNumber((rect.h-top_val_axis_gap-first_val_axis_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));cat_labels_align_bottom= false;cat_ax.posY=rect.y+rect.h-first_val_axis_label_half_height-(crosses_val_ax-arr_val[0])*unit_height;if(cat_ax.labels)cat_ax.labels.y=rect.y+top_val_axis_gap-cat_ax_ext_y;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY-(arr_val[i]-crosses_val_ax)*unit_height}else{unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_labels_align_bottom=false;cat_ax.posY=rect.y+rect.h-(crosses_val_ax-arr_val[0])*unit_height;if(cat_ax.labels){cat_ax.labels.y=rect.y-cat_ax_ext_y; if(true){var bCorrectedCat=false;if(cat_ax.labels.y<0){rect.y-=cat_ax.labels.y;rect.h+=cat_ax.labels.y;cat_ax.labels.y=0;bCorrectedCat=true}if(cat_ax.labels.y+cat_ax.labels.extY>this.extY){rect.h-=cat_ax.labels.y+cat_ax.labels.extY-this.extY;bCorrectedCat=true}if(bCorrectedCat){unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+rect.h-(crosses_val_ax-arr_val[0])*unit_height;cat_ax.labels.y=rect.y-cat_ax_ext_y}}}for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]= cat_ax.posY-(arr_val[i]-crosses_val_ax)*unit_height}else{cat_ax.labels=null;if(!bWithoutLabels){for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=rect.y+rect.h-first_val_axis_label_half_height-(arr_val[i]-arr_val[0])*unit_height;cat_ax.posY=rect.y+rect.h-first_val_axis_label_half_height-(crosses_val_ax-arr_val[0])*unit_height}else{for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=rect.y+rect.h-(arr_val[i]-arr_val[0])*unit_height;cat_ax.posY=rect.y+rect.h-(crosses_val_ax-arr_val[0])*unit_height}}else if(hor_labels_pos=== c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO||!AscFormat.isRealNumber(hor_labels_pos)){if(cat_ax.crosses===AscFormat.CROSSES_MAX)if(!bWithoutLabels){bottom_val_axis_gap=Math.max(cat_ax_ext_y,last_val_axis_label_half_height);unit_height=checkFiniteNumber((rect.h-bottom_val_axis_gap-first_val_axis_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+first_val_axis_label_half_height+(crosses_val_ax-arr_val[0])*unit_height;if(cat_ax.labels)cat_ax.labels.y=rect.y+rect.h-bottom_val_axis_gap}else{unit_height= checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+(crosses_val_ax-arr_val[0])*unit_height;if(cat_ax.labels){cat_ax.labels.y=rect.y+rect.h;if(true){var bCorrectedCat=false;if(cat_ax.labels.y<0){rect.y-=cat_ax.labels.y;rect.h+=cat_ax.labels.y;cat_ax.labels.y=0;bCorrectedCat=true}if(cat_ax.labels.y+cat_ax.labels.extY>this.extY){rect.h-=cat_ax.labels.y+cat_ax.labels.extY-this.extY;bCorrectedCat=true}if(bCorrectedCat){unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length- 1]-arr_val[0]));cat_ax.posY=rect.y+(crosses_val_ax-arr_val[0])*unit_height;cat_ax.labels.y=rect.y+rect.h}}}}else{cat_labels_align_bottom=false;if(!bWithoutLabels){var top_points_height=first_val_axis_label_half_height+(crosses_val_ax-arr_val[0])*unit_height;if(top_points_height<cat_ax_ext_y)unit_height=checkFiniteNumber((rect.h-cat_ax_ext_y-last_val_axis_label_half_height)/(arr_val[arr_val.length-1]-crosses_val_ax));cat_ax.posY=rect.y+rect.h-last_val_axis_label_half_height-(arr_val[arr_val.length- 1]-crosses_val_ax)*unit_height;if(cat_ax.labels)cat_ax.labels.y=cat_ax.posY-cat_ax_ext_y}else{cat_ax.posY=rect.y+rect.h-(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;if(cat_ax.labels){cat_ax.labels.y=cat_ax.posY-cat_ax_ext_y;if(true){var bCorrectedCat=false;if(cat_ax.labels.y<0){rect.y-=cat_ax.labels.y;rect.h+=cat_ax.labels.y;cat_ax.labels.y=0;bCorrectedCat=true}if(cat_ax.labels.y+cat_ax.labels.extY>this.extY){rect.h-=cat_ax.labels.y+cat_ax.labels.extY-this.extY;bCorrectedCat=true}if(bCorrectedCat){unit_height= checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+rect.h-(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;cat_ax.labels.y=cat_ax.posY-cat_ax_ext_y}}}}}for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY+(arr_val[i]-crosses_val_ax)*unit_height}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW){cat_labels_align_bottom=false;if(!bWithoutLabels){top_val_axis_gap=Math.max(first_val_axis_label_half_height,cat_ax_ext_y);unit_height= checkFiniteNumber((rect.h-top_val_axis_gap-last_val_axis_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+rect.h-last_val_axis_label_half_height-(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY+(arr_val[i]-crosses_val_ax)*unit_height;if(cat_ax.labels)cat_ax.labels.y=cat_ax.posY+(arr_val[0]-crosses_val_ax)*unit_height-cat_ax_ext_y}else{unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]- arr_val[0]));cat_ax.posY=rect.y+rect.h-(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY+(arr_val[i]-crosses_val_ax)*unit_height;if(cat_ax.labels){cat_ax.labels.y=cat_ax.posY+(arr_val[0]-crosses_val_ax)*unit_height-cat_ax_ext_y;if(true){var bCorrectedCat=false;if(cat_ax.labels.y<0){rect.y-=cat_ax.labels.y;rect.h+=cat_ax.labels.y;cat_ax.labels.y=0;bCorrectedCat=true}if(cat_ax.labels.y+cat_ax.labels.extY>this.extY){rect.h-=cat_ax.labels.y+ cat_ax.labels.extY-this.extY;bCorrectedCat=true}if(bCorrectedCat){unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+rect.h-(arr_val[arr_val.length-1]-crosses_val_ax)*unit_height;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY+(arr_val[i]-crosses_val_ax)*unit_height;cat_ax.labels.y=cat_ax.posY+(arr_val[0]-crosses_val_ax)*unit_height-cat_ax_ext_y}}}}}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH)if(!bWithoutLabels){bottom_val_axis_gap= Math.max(cat_ax_ext_y,last_val_axis_label_half_height);unit_height=checkFiniteNumber((rect.h-bottom_val_axis_gap-first_val_axis_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+first_val_axis_label_half_height+(crosses_val_ax-arr_val[0])*unit_height;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY+(arr_val[i]-crosses_val_ax)*unit_height;if(cat_ax.labels)cat_ax.labels.y=rect.y+rect.h-bottom_val_axis_gap}else{unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length- 1]-arr_val[0]));cat_ax.posY=rect.y+(crosses_val_ax-arr_val[0])*unit_height;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY+(arr_val[i]-crosses_val_ax)*unit_height;if(cat_ax.labels){cat_ax.labels.y=rect.y+rect.h;if(true){var bCorrectedCat=false;if(cat_ax.labels.y<0){rect.y-=cat_ax.labels.y;rect.h+=cat_ax.labels.y;cat_ax.labels.y=0;bCorrectedCat=true}if(cat_ax.labels.y+cat_ax.labels.extY>this.extY){rect.h-=cat_ax.labels.y+cat_ax.labels.extY-this.extY;bCorrectedCat=true}if(bCorrectedCat){unit_height= checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posY=rect.y+(crosses_val_ax-arr_val[0])*unit_height;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posY+(arr_val[i]-crosses_val_ax)*unit_height;cat_ax.labels.y=rect.y+rect.h}}}}else{cat_ax.labels=null;if(!bWithoutLabels){unit_height=checkFiniteNumber((rect.h-last_val_axis_label_half_height-first_val_axis_label_half_height)/(arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]= rect.y+first_val_axis_label_half_height+(arr_val[i]-arr_val[0])*unit_height}else{unit_height=checkFiniteNumber(rect.h/(arr_val[arr_val.length-1]-arr_val[0]));for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=rect.y+(arr_val[i]-arr_val[0])*unit_height}}cat_ax.interval=unit_height;var arr_labels,transform_text,local_text_transform;if(val_ax.labels){if(bNeedReflect)if(left_val_ax_labels_align){left_val_ax_labels_align=false;val_ax.labels.x+=val_ax.labels.extX}else{left_val_ax_labels_align=true;val_ax.labels.x-= val_ax.labels.extX}val_ax.labels.align=left_val_ax_labels_align;val_ax.labels.y=Math.min.apply(Math,arr_val_labels_points)-max_val_labels_text_height/2;val_ax.labels.extY=Math.max.apply(Math,arr_val_labels_points)-Math.min.apply(Math,arr_val_labels_points)+max_val_labels_text_height;arr_labels=val_ax.labels.aLabels;if(left_val_ax_labels_align)for(i=0;i<arr_labels.length;++i){arr_labels[i].txBody=arr_labels[i].tx.rich;transform_text=arr_labels[i].transformText;transform_text.Reset();global_MatrixTransformer.TranslateAppend(transform_text, val_ax.labels.x+val_ax.labels.extX-val_axis_labels_gap-arr_labels[i].tx.rich.content.XLimit,arr_val_labels_points[i]-val_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2);local_text_transform=arr_labels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,val_ax.labels.x+val_ax.labels.extX-val_axis_labels_gap-arr_labels[i].tx.rich.content.XLimit,arr_val_labels_points[i]-val_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/ 2)}else{var left_line=val_ax.labels.x+val_axis_labels_gap;for(i=0;i<arr_labels.length;++i){arr_labels[i].txBody=arr_labels[i].tx.rich;transform_text=arr_labels[i].transformText;transform_text.Reset();global_MatrixTransformer.TranslateAppend(transform_text,left_line,arr_val_labels_points[i]-val_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2);local_text_transform=arr_labels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,left_line, arr_val_labels_points[i]-val_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2)}}}val_ax.yPoints=[];for(i=0;i<arr_val_labels_points.length;++i)val_ax.yPoints[i]={val:arr_val[i],pos:arr_val_labels_points[i]};cat_ax.xPoints=[];for(i=0;i<arr_cat_labels_points.length;++i)cat_ax.xPoints[i]={val:i+1,pos:arr_cat_labels_points[i]};if(cat_ax.labels){cat_ax.labels.align=cat_labels_align_bottom;if(!b_rotated){if(cat_ax_orientation===AscFormat.ORIENTATION_MIN_MAX)cat_ax.labels.x=arr_cat_labels_points[0]- max_cat_label_width/2;else cat_ax.labels.x=arr_cat_labels_points[arr_cat_labels_points.length-1]-max_cat_label_width/2;cat_ax.labels.extX=arr_cat_labels_points[arr_cat_labels_points.length-1]+max_cat_label_width/2-cat_ax.labels.x;if(cat_labels_align_bottom)for(i=0;i<cat_ax.labels.aLabels.length;++i){if(cat_ax.labels.aLabels[i]){var label_text_transform=cat_ax.labels.aLabels[i].transformText;label_text_transform.Reset();global_MatrixTransformer.TranslateAppend(label_text_transform,arr_cat_labels_points[i]- max_cat_label_width/2,cat_ax.labels.y+labels_offset);local_text_transform=cat_ax.labels.aLabels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,arr_cat_labels_points[i]-max_cat_label_width/2,cat_ax.labels.y+labels_offset)}}else for(i=0;i<cat_ax.labels.aLabels.length;++i)if(cat_ax.labels.aLabels[i]){var label_text_transform=cat_ax.labels.aLabels[i].transformText;label_text_transform.Reset();global_MatrixTransformer.TranslateAppend(label_text_transform, arr_cat_labels_points[i]-max_cat_label_width/2,cat_ax.labels.y+cat_ax.labels.extY-labels_offset-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight());local_text_transform=cat_ax.labels.aLabels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,arr_cat_labels_points[i]-max_cat_label_width/2,cat_ax.labels.y+cat_ax.labels.extY-labels_offset-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight())}}else{var left_x,right_x;var w2, h2,x1,xc,yc,y0;if(cat_labels_align_bottom)for(i=0;i<cat_ax.labels.aLabels.length;++i){if(cat_ax.labels.aLabels[i]){var label_text_transform=cat_ax.labels.aLabels[i].transformText;cat_ax.labels.aLabels[i].tx.rich.content.Set_ApplyToAll(true);cat_ax.labels.aLabels[i].tx.rich.content.SetParagraphAlign(AscCommon.align_Left);cat_ax.labels.aLabels[i].tx.rich.content.Set_ApplyToAll(false);var wh=cat_ax.labels.aLabels[i].tx.rich.getContentOneStringSizes();w2=wh.w*Math.cos(Math.PI/4)+wh.h*Math.sin(Math.PI/ 4);h2=wh.w*Math.sin(Math.PI/4)+wh.h*Math.cos(Math.PI/4);x1=arr_cat_labels_points[i]+wh.h*Math.sin(Math.PI/4);y0=cat_ax.labels.y+labels_offset;xc=x1-w2/2;yc=y0+h2/2;label_text_transform.Reset();global_MatrixTransformer.TranslateAppend(label_text_transform,-wh.w/2,-wh.h/2);global_MatrixTransformer.RotateRadAppend(label_text_transform,Math.PI/4);global_MatrixTransformer.TranslateAppend(label_text_transform,xc,yc);global_MatrixTransformer.MultiplyAppend(label_text_transform,this.transform);if(!AscFormat.isRealNumber(left_x)){left_x= xc-w2/2;right_x=xc+w2/2}else{if(xc-w2/2<left_x)left_x=xc-w2/2;if(xc+w2/2>right_x)right_x=xc+w2/2}local_text_transform=cat_ax.labels.aLabels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,-wh.w/2,-wh.h/2);global_MatrixTransformer.RotateRadAppend(local_text_transform,Math.PI/4);global_MatrixTransformer.TranslateAppend(local_text_transform,xc,yc)}}else for(i=0;i<cat_ax.labels.aLabels.length;++i)if(cat_ax.labels.aLabels[i]){var label_text_transform= cat_ax.labels.aLabels[i].transformText;cat_ax.labels.aLabels[i].tx.rich.content.Set_ApplyToAll(true);cat_ax.labels.aLabels[i].tx.rich.content.SetParagraphAlign(AscCommon.align_Left);cat_ax.labels.aLabels[i].tx.rich.content.Set_ApplyToAll(false);var wh=cat_ax.labels.aLabels[i].tx.rich.getContentOneStringSizes();w2=wh.w*Math.cos(Math.PI/4)+wh.h*Math.sin(Math.PI/4);h2=wh.w*Math.sin(Math.PI/4)+wh.h*Math.cos(Math.PI/4);x1=arr_cat_labels_points[i]-wh.h*Math.sin(Math.PI/4);y0=cat_ax.labels.y+cat_ax.labels.extY- labels_offset;xc=x1+w2/2;yc=y0-h2/2;label_text_transform.Reset();global_MatrixTransformer.TranslateAppend(label_text_transform,-wh.w/2,-wh.h/2);global_MatrixTransformer.RotateRadAppend(label_text_transform,Math.PI/4);global_MatrixTransformer.TranslateAppend(label_text_transform,xc,yc);global_MatrixTransformer.MultiplyAppend(label_text_transform,this.transform);if(!AscFormat.isRealNumber(left_x)){left_x=xc-w2/2;right_x=xc+w2/2}else{if(xc-w2/2<left_x)left_x=xc-w2/2;if(xc+w2/2>right_x)right_x=xc+w2/ 2}local_text_transform=cat_ax.labels.aLabels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,-wh.w/2,-wh.h/2);global_MatrixTransformer.RotateRadAppend(local_text_transform,Math.PI/4);global_MatrixTransformer.TranslateAppend(local_text_transform,xc,yc)}cat_ax.labels.x=left_x;cat_ax.labels.extX=right_x-left_x}}cat_ax.xPoints.sort(function(a,b){return a.val-b.val});val_ax.yPoints.sort(function(a,b){return a.val-b.val})}else this.bEmptySeries= true}else if(chart_type===AscDFH.historyitem_type_BarChart&&chart_object.barDir===AscFormat.BAR_DIR_BAR){var cat_ax,val_ax;var axis_by_types=chart_object.getAxisByTypes();cat_ax=axis_by_types.catAx[0];val_ax=axis_by_types.valAx[0];if(cat_ax&&val_ax){val_ax.labels=null;cat_ax.labels=null;val_ax.posX=null;cat_ax.posY=null;val_ax.posY=null;cat_ax.posX=null;val_ax.xPoints=null;cat_ax.yPoints=null;val_ax.yPoints=null;cat_ax.xPoints=null;val_ax.transformYPoints=null;cat_ax.transformXPoints=null;val_ax.transformXPoints= null;cat_ax.transformYPoints=null;var sizes=this.getChartSizes();rect={x:sizes.startX,y:sizes.startY,w:sizes.w,h:sizes.h};var arr_val=this.getValAxisValues();var arr_strings=[];var multiplier;if(val_ax.dispUnits)multiplier=val_ax.dispUnits.getMultiplier();else multiplier=1;var num_fmt=val_ax.numFmt;if(num_fmt&&typeof num_fmt.formatCode==="string"){var num_format=oNumFormatCache.get(num_fmt.formatCode);for(i=0;i<arr_val.length;++i){var calc_value=arr_val[i]*multiplier;var rich_value=num_format.formatToChart(calc_value); arr_strings.push(rich_value)}}else for(i=0;i<arr_val.length;++i){var calc_value=arr_val[i]*multiplier;arr_strings.push(calc_value+"")}val_ax.labels=new AscFormat.CValAxisLabels(this,val_ax);var max_height=0;val_ax.xPoints=[];var max_val_ax_label_width=0;for(i=0;i<arr_strings.length;++i){var dlbl=new AscFormat.CDLbl;dlbl.parent=val_ax;dlbl.chart=this;dlbl.spPr=val_ax.spPr;dlbl.txPr=val_ax.txPr;dlbl.tx=new AscFormat.CChartText;dlbl.tx.rich=AscFormat.CreateTextBodyFromString(arr_strings[i],this.getDrawingDocument(), dlbl);dlbl.txBody=dlbl.tx.rich;if(val_ax.labels.aLabels[0])dlbl.lastStyleObject=val_ax.labels.aLabels[0].lastStyleObject;var t=dlbl.tx.rich.recalculateByMaxWord();var h=t.h;if(t.w>max_val_ax_label_width)max_val_ax_label_width=t.w;if(h>max_height)max_height=h;val_ax.labels.aLabels.push(dlbl);val_ax.xPoints.push({val:arr_val[i],pos:null})}var val_axis_labels_gap=val_ax.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize*25.4/72;val_ax.labels.extY=max_height+val_axis_labels_gap; var ser=chart_object.series[0];var string_pts=[],pts_len=0;if(ser&&ser.cat){var lit,b_num_lit=true;lit=ser.cat.getLit();if(lit){b_num_lit=lit.getObjectType()===AscDFH.historyitem_type_NumLit;var lit_format=null,pt_format=null;if(b_num_lit&&typeof lit.formatCode==="string"&&lit.formatCode.length>0)lit_format=oNumFormatCache.get(lit.formatCode);pts_len=lit.ptCount;for(i=0;i<pts_len;++i){var pt=lit.getPtByIndex(i);if(pt){var str_pt;if(b_num_lit)if(typeof pt.formatCode==="string"&&pt.formatCode.length> 0){pt_format=oNumFormatCache.get(pt.formatCode);if(pt_format)str_pt=pt_format.formatToChart(pt.val);else str_pt=pt.val}else if(lit_format)str_pt=lit_format.formatToChart(pt.val);else str_pt=pt.val;else str_pt=pt.val;string_pts.push({val:str_pt+""})}else string_pts.push({val:i+""})}}}{pts_len=0;for(i=0;i<chart_object.series.length;++i){var cur_pts=null;ser=chart_object.series[i];if(ser.val){if(ser.val.numRef&&ser.val.numRef.numCache)cur_pts=ser.val.numRef.numCache;else if(ser.val.numLit)cur_pts=ser.val.numLit; if(cur_pts)pts_len=Math.max(pts_len,cur_pts.ptCount)}}if(pts_len>string_pts.length)for(i=string_pts.length;i<pts_len;++i)string_pts.push({val:i+1+""});else string_pts.splice(pts_len,string_pts.length-pts_len)}var crosses;if(val_ax.crosses===AscFormat.CROSSES_AUTO_ZERO||val_ax.crosses===AscFormat.CROSSES_MIN)crosses=1;else if(val_ax.crosses===AscFormat.CROSSES_MAX)crosses=string_pts.length;else if(AscFormat.isRealNumber(val_ax.crossesAt))if(val_ax.crossesAt<=string_pts.length+1&&val_ax.crossesAt>0)crosses= val_ax.crossesAt;else if(val_ax.crossesAt<=0)crosses=1;else crosses=string_pts.length;else crosses=1;cat_ax.maxCatVal=string_pts.length;var cat_ax_orientation=cat_ax.scaling&&AscFormat.isRealNumber(cat_ax.scaling.orientation)?cat_ax.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX;var labels_pos=val_ax.tickLblPos;var cross_between=this.getValAxisCrossType();if(cross_between===null)cross_between=AscFormat.CROSS_BETWEEN_BETWEEN;var bottom_val_ax_labels_align=true;var intervals_count=cross_between=== AscFormat.CROSS_BETWEEN_MID_CAT?string_pts.length-1:string_pts.length;var point_interval=rect.h/intervals_count;var bottom_points_height,top_point_height;var arr_cat_labels_points=[];if(cat_ax_orientation===AscFormat.ORIENTATION_MIN_MAX)if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE||val_ax.bDelete===true){val_ax.labels=null;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+rect.h-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]= rect.y+rect.h-(point_interval/2+point_interval*i);val_ax.posY=rect.y+rect.h-point_interval*(crosses-1)}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO||!AscFormat.isRealNumber(labels_pos))if(val_ax.crosses===AscFormat.CROSSES_MAX){if(!bWithoutLabels){val_ax.labels.y=rect.y;point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/intervals_count)}else val_ax.labels.y=rect.y-val_ax.labels.extY;bottom_val_ax_labels_align=false;val_ax.posY=val_ax.labels.y+val_ax.labels.extY;if(cross_between=== AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+rect.h-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=point_interval/2+rect.y+rect.h-point_interval*i}else{bottom_points_height=point_interval*(crosses-1);if(bottom_points_height<val_ax.labels.extY&&!bWithoutLabels){var top_intervals_count=intervals_count-(crosses-1);point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/top_intervals_count);val_ax.labels.y=rect.y+ rect.h-val_ax.labels.extY;var start_point=val_ax.labels.y+(crosses-1)*point_interval;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=start_point-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=start_point-point_interval/2-point_interval*i}else{val_ax.labels.y=rect.y+rect.h-bottom_points_height;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+ rect.h-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+rect.h-(point_interval/2+point_interval*i)}val_ax.posY=val_ax.labels.y}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW){if(!bWithoutLabels){point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/intervals_count);val_ax.labels.y=rect.y+rect.h-val_ax.labels.extY}else val_ax.labels.y=rect.y+rect.h;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]= val_ax.labels.y-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+rect.h-val_ax.labels.extY-point_interval/2-point_interval*i;val_ax.posY=val_ax.labels.y-point_interval*(crosses-1)}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH){if(!bWithoutLabels){point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/intervals_count);val_ax.labels.y=rect.y}else val_ax.labels.y=rect.y-val_ax.labels.extY;point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/ intervals_count);val_ax.labels.y=rect.y;bottom_val_ax_labels_align=false;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+rect.h-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+rect.h-(point_interval/2+point_interval*i);val_ax.posY=rect.y+rect.h-point_interval*(crosses-1)}else{val_ax.labels=null;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]= rect.y+rect.h-point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+rect.h-(point_interval/2+point_interval*i);val_ax.posY=rect.y+rect.h-point_interval*(crosses-1)}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE||val_ax.bDelete===true){val_ax.labels=null;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+ point_interval/2+point_interval*i;val_ax.posY=rect.y+point_interval*(crosses-1)}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO||!AscFormat.isRealNumber(labels_pos))if(val_ax.crosses===AscFormat.CROSSES_MAX){if(!bWithoutLabels){val_ax.labels.y=rect.y+rect.h-val_ax.labels.extY;point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/intervals_count)}else val_ax.labels.y=rect.y+rect.h;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]= rect.y+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+point_interval/2+point_interval*i;val_ax.posY=val_ax.labels.y}else{bottom_val_ax_labels_align=false;top_point_height=point_interval*(crosses-1);if(top_point_height<val_ax.labels.extY&&!bWithoutLabels){val_ax.labels.y=rect.y;var bottom_points_interval_count=intervals_count-(crosses-1);point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/bottom_points_interval_count);var start_point_bottom=rect.y+rect.h- point_interval*intervals_count;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=start_point_bottom+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=start_point_bottom+point_interval/2+point_interval*i}else{val_ax.labels.y=rect.y+point_interval*(crosses-1)-val_ax.labels.extY;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+point_interval*i;else for(i= 0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+point_interval/2+point_interval*i}val_ax.posY=val_ax.labels.y+val_ax.labels.extY}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW){bottom_val_ax_labels_align=false;if(!bWithoutLabels){point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/intervals_count);val_ax.labels.y=rect.y}else val_ax.labels.y=rect.y-val_ax.labels.extY;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]= val_ax.labels.y+val_ax.labels.extY+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=val_ax.labels.y+val_ax.labels.extY+point_interval/2+point_interval*i;val_ax.posY=rect.y+val_ax.labels.extY+point_interval*(crosses-1)}else if(labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH){if(!bWithoutLabels){point_interval=checkFiniteNumber((rect.h-val_ax.labels.extY)/intervals_count);val_ax.labels.y=rect.y+rect.h-val_ax.labels.extY}else val_ax.labels.y=rect.y+rect.h;if(cross_between=== AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+point_interval/2+point_interval*i;val_ax.posY=rect.y+point_interval*(crosses-1)}else{val_ax.labels=null;if(cross_between===AscFormat.CROSS_BETWEEN_MID_CAT)for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+point_interval*i;else for(i=0;i<string_pts.length;++i)arr_cat_labels_points[i]=rect.y+point_interval/ 2+point_interval*i;val_ax.posY=rect.y+point_interval*(crosses-1)}cat_ax.interval=point_interval;var diagram_height=point_interval*intervals_count;var max_cat_label_height=diagram_height/string_pts.length;cat_ax.labels=null;var max_cat_labels_block_width=rect.w/2;if(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE!==cat_ax.tickLblPos&&!(cat_ax.bDelete===true)){cat_ax.labels=new AscFormat.CValAxisLabels(this,cat_ax);var tick_lbl_skip=AscFormat.isRealNumber(cat_ax.tickLblSkip)?cat_ax.tickLblSkip:string_pts.length< SKIP_LBL_LIMIT?1:Math.floor(string_pts.length/SKIP_LBL_LIMIT);var max_min_width=0;var max_max_width=0;var max_content_width=0;var arr_min_max_min=[];for(i=0;i<string_pts.length;++i){var dlbl=null;if(i%tick_lbl_skip===0){dlbl=new AscFormat.CDLbl;dlbl.parent=cat_ax;dlbl.chart=this;dlbl.spPr=cat_ax.spPr;dlbl.txPr=cat_ax.txPr;dlbl.tx=new AscFormat.CChartText;dlbl.tx.rich=AscFormat.CreateTextBodyFromString(string_pts[i].val.replace(oNonSpaceRegExp," "),this.getDrawingDocument(),dlbl);if(cat_ax.labels.aLabels[0])dlbl.lastStyleObject= cat_ax.labels.aLabels[0].lastStyleObject;dlbl.tx.rich.content.Set_ApplyToAll(true);dlbl.tx.rich.content.SetParagraphAlign(AscCommon.align_Center);dlbl.tx.rich.content.Set_ApplyToAll(false);var min_max=dlbl.tx.rich.content.RecalculateMinMaxContentWidth();var max_min_content_width=min_max.Min;if(min_max.Max>max_max_width)max_max_width=min_max.Max;if(min_max.Min>max_min_width)max_min_width=min_max.Min;arr_min_max_min[i]=min_max.Min;dlbl.getMaxWidth=function(){return 2E4};dlbl.recalcInfo.recalculatePen= false;dlbl.recalcInfo.recalculateBrush=false;dlbl.recalculate();delete dlbl.getMaxWidth;if(dlbl.tx.rich.content.XLimit>max_content_width)max_content_width=dlbl.tx.rich.content.XLimit}cat_ax.labels.aLabels.push(dlbl)}var stake_offset=AscFormat.isRealNumber(cat_ax.lblOffset)?cat_ax.lblOffset/100:1;var labels_offset=cat_ax.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize*(25.4/72)*stake_offset;var width_flag;if(max_content_width+labels_offset<max_cat_labels_block_width){width_flag= 0;cat_ax.labels.extX=max_content_width+labels_offset}else if(max_min_width+labels_offset<max_cat_labels_block_width){width_flag=1;cat_ax.labels.extX=max_min_width+labels_offset}else{width_flag=2;cat_ax.labels.extX=max_cat_labels_block_width}}var cat_labels_align_left=true;var crosses_val_ax;if(cat_ax.crosses===AscFormat.CROSSES_AUTO_ZERO)if(arr_val[0]<=0&&arr_val[arr_val.length-1]>=0)crosses_val_ax=0;else if(arr_val[arr_val.length-1]<0)crosses_val_ax=arr_val[arr_val.length-1];else crosses_val_ax= arr_val[0];else if(cat_ax.crosses===AscFormat.CROSSES_MIN)crosses_val_ax=arr_val[0];else if(cat_ax.crosses===AscFormat.CROSSES_MAX)crosses_val_ax=arr_val[arr_val.length-1];else if(AscFormat.isRealNumber(cat_ax.crossesAt)&&cat_ax.crossesAt>=arr_val[0]&&cat_ax.crossesAt<=arr_val[arr_val.length-1]){if(cat_ax.crossesAt>=arr_val[0]&&cat_ax.crossesAt<=arr_val[arr_val.length-1])crosses_val_ax=cat_ax.crossesAt}else if(arr_val[0]<=0&&arr_val[arr_val.length-1]>=0)crosses_val_ax=0;else if(arr_val[arr_val.length- 1]<0)crosses_val_ax=arr_val[arr_val.length-1];else crosses_val_ax=arr_val[0];var val_ax_orientation=val_ax.scaling&&AscFormat.isRealNumber(val_ax.scaling.orientation)?val_ax.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX;var hor_labels_pos=cat_ax.tickLblPos;var first_val_lbl_half_width=val_ax.tickLblPos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE||val_ax.bDelete?0:val_ax.labels.aLabels[0].tx.rich.content.XLimit/2;var last_val_lbl_half_width=val_ax.tickLblPos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE|| val_ax.bDelete?0:val_ax.labels.aLabels[val_ax.labels.aLabels.length-1].tx.rich.content.XLimit/2;var right_gap,left_gap;var arr_val_labels_points=[];var unit_width=checkFiniteNumber((rect.w-first_val_lbl_half_width-last_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));var cat_ax_ext_x=cat_ax.labels&&!bWithoutLabels?cat_ax.labels.extX:0;if(val_ax_orientation===AscFormat.ORIENTATION_MIN_MAX)if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO||!AscFormat.isRealNumber(hor_labels_pos)){if(cat_ax.crosses=== AscFormat.CROSSES_MAX){if(!bNeedReflect)right_gap=Math.max(last_val_lbl_half_width,cat_ax_ext_x);else right_gap=Math.max(last_val_lbl_half_width,0);cat_labels_align_left=false;if(cat_ax.labels)cat_ax.labels.x=rect.x+rect.w-right_gap;unit_width=checkFiniteNumber((rect.w-right_gap-first_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+first_val_lbl_half_width+(crosses_val_ax-arr_val[0])*unit_width}else{if(!bNeedReflect&&(crosses_val_ax-arr_val[0])*unit_width+first_val_lbl_half_width< cat_ax_ext_x)unit_width=checkFiniteNumber((rect.w-cat_ax_ext_x-last_val_lbl_half_width)/(arr_val[arr_val.length-1]-crosses_val_ax));cat_ax.posX=rect.x+rect.w-last_val_lbl_half_width-(arr_val[arr_val.length-1]-crosses_val_ax)*unit_width;if(cat_ax.labels)cat_ax.labels.x=cat_ax.posX-cat_ax.labels.extX}for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posX+(arr_val[i]-crosses_val_ax)*unit_width}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW){if(!bNeedReflect)left_gap= Math.max(first_val_lbl_half_width,cat_ax_ext_x);else left_gap=Math.max(first_val_lbl_half_width,0);unit_width=checkFiniteNumber((rect.w-left_gap-last_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+rect.w-(arr_val[arr_val.length-1]-crosses_val_ax)*unit_width-last_val_lbl_half_width;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posX+(arr_val[i]-crosses_val_ax)*unit_width;if(cat_ax.labels)cat_ax.labels.x=cat_ax.posX+(arr_val[i]-crosses_val_ax)*unit_width- cat_ax.labels.extX}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH){cat_labels_align_left=false;if(!bNeedReflect)right_gap=Math.max(last_val_lbl_half_width,cat_ax_ext_x);else right_gap=Math.max(last_val_lbl_half_width,0);unit_width=checkFiniteNumber((rect.w-right_gap-first_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+first_val_lbl_half_width+(crosses_val_ax-arr_val[0])*unit_width;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posX+ (arr_val[i]-crosses_val_ax)*unit_width}else{cat_ax.labels=null;unit_width=checkFiniteNumber((rect.w-last_val_lbl_half_width-first_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+first_val_lbl_half_width+(crosses_val_ax-arr_val[0])*unit_width;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posX+(arr_val[i]-crosses_val_ax)*unit_width}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO||!AscFormat.isRealNumber(hor_labels_pos)){if(cat_ax.crosses=== AscFormat.CROSSES_MAX){if(!bNeedReflect)left_gap=Math.max(cat_ax_ext_x,last_val_lbl_half_width);else left_gap=Math.max(0,last_val_lbl_half_width);unit_width=checkFiniteNumber((rect.w-left_gap-first_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+rect.w-first_val_lbl_half_width-(crosses_val_ax-arr_val[0])*unit_width;if(cat_ax.labels)cat_ax.labels.x=cat_ax.posX-cat_ax.labels.extX}else{cat_labels_align_left=false;if(!bNeedReflect&&first_val_lbl_half_width<cat_ax_ext_x)unit_width= checkFiniteNumber((rect.w-cat_ax_ext_x-last_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+last_val_lbl_half_width+(arr_val[arr_val.length-1]-crosses_val_ax)*unit_width;if(cat_ax.labels)cat_ax.labels.x=cat_ax.posX}for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posX-(arr_val[i]-crosses_val_ax)*unit_width}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW){cat_labels_align_left=false;if(!bNeedReflect)right_gap=Math.max(first_val_lbl_half_width, cat_ax_ext_x);else right_gap=Math.max(first_val_lbl_half_width,0);unit_width=checkFiniteNumber((rect.w-last_val_lbl_half_width-right_gap)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+last_val_lbl_half_width+(arr_val[arr_val.length-1]-crosses_val_ax)*crosses_val_ax;if(cat_ax.labels)cat_ax.labels.x=cat_ax.posX-(arr_val[0]-crosses_val_ax)*unit_width;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posX-(arr_val[i]-crosses_val_ax)*unit_width}else if(hor_labels_pos===c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH){if(!bNeedReflect)left_gap= Math.max(cat_ax_ext_x,last_val_lbl_half_width);else left_gap=Math.max(0,last_val_lbl_half_width);unit_width=checkFiniteNumber((rect.w-left_gap-first_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+rect.w-first_val_lbl_half_width-(crosses_val_ax-arr_val[0])*unit_width;if(cat_ax.labels)cat_ax.labels.x=cat_ax.posX-(arr_val[arr_val.length-1]-crosses_val_ax)*unit_width-cat_ax.labels.extX;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posX-(arr_val[i]-crosses_val_ax)* unit_width}else{cat_ax.labels=null;unit_width=checkFiniteNumber((rect.w-last_val_lbl_half_width-first_val_lbl_half_width)/(arr_val[arr_val.length-1]-arr_val[0]));cat_ax.posX=rect.x+rect.w-first_val_lbl_half_width-(crosses_val_ax-arr_val[0])*unit_width;for(i=0;i<arr_val.length;++i)arr_val_labels_points[i]=cat_ax.posX-(arr_val[i]-crosses_val_ax)*unit_width}val_ax.interval=unit_width;var local_transform_text;if(val_ax.labels){val_ax.labels.x=Math.min.apply(Math,arr_val_labels_points)-max_val_ax_label_width/ 2;val_ax.labels.extX=Math.max.apply(Math,arr_val_labels_points)-Math.min.apply(Math,arr_val_labels_points)+max_val_ax_label_width;val_ax.labels.align=bottom_val_ax_labels_align;if(bottom_val_ax_labels_align){var y_pos=val_ax.labels.y+val_axis_labels_gap;for(i=0;i<val_ax.labels.aLabels.length;++i){var text_transform=val_ax.labels.aLabels[i].transformText;text_transform.Reset();global_MatrixTransformer.TranslateAppend(text_transform,arr_val_labels_points[i]-val_ax.labels.aLabels[i].tx.rich.content.XLimit/ 2,y_pos);var local_transform_text=val_ax.labels.aLabels[i].localTransformText;local_transform_text.Reset();global_MatrixTransformer.TranslateAppend(local_transform_text,arr_val_labels_points[i]-val_ax.labels.aLabels[i].tx.rich.content.XLimit/2,y_pos)}}else for(i=0;i<val_ax.labels.aLabels.length;++i){var text_transform=val_ax.labels.aLabels[i].transformText;text_transform.Reset();global_MatrixTransformer.TranslateAppend(text_transform,arr_val_labels_points[i]-val_ax.labels.aLabels[i].tx.rich.content.XLimit/ 2,val_ax.labels.y+val_ax.labels.extY-val_axis_labels_gap-val_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight());var local_transform_text=val_ax.labels.aLabels[i].localTransformText;local_transform_text.Reset();global_MatrixTransformer.TranslateAppend(local_transform_text,arr_val_labels_points[i]-val_ax.labels.aLabels[i].tx.rich.content.XLimit/2,val_ax.labels.y+val_ax.labels.extY-val_axis_labels_gap-val_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight())}}val_ax.xPoints=[];for(i=0;i<arr_val_labels_points.length;++i)val_ax.xPoints[i]= {val:arr_val[i],pos:arr_val_labels_points[i]};cat_ax.yPoints=[];for(i=0;i<arr_cat_labels_points.length;++i)cat_ax.yPoints[i]={val:i+1,pos:arr_cat_labels_points[i]};if(cat_ax.labels){cat_ax.labels.y=rect.y;cat_ax.labels.extY=point_interval*intervals_count;if(bNeedReflect)if(cat_labels_align_left){cat_labels_align_left=false;cat_ax.labels.x+=cat_ax.labels.extX}else{cat_labels_align_left=true;cat_ax.labels.x-=cat_ax.labels.extX}if(cat_labels_align_left)if(width_flag===0)for(i=0;i<cat_ax.labels.aLabels.length;++i){if(cat_ax.labels.aLabels[i]){var transform_text= cat_ax.labels.aLabels[i].transformText;transform_text.Reset();global_MatrixTransformer.TranslateAppend(transform_text,cat_ax.labels.x+cat_ax.labels.extX-cat_ax.labels.aLabels[i].tx.rich.content.XLimit-labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2);local_transform_text=cat_ax.labels.aLabels[i].localTransformText;local_transform_text.Reset();global_MatrixTransformer.TranslateAppend(local_transform_text,cat_ax.labels.x+cat_ax.labels.extX-cat_ax.labels.aLabels[i].tx.rich.content.XLimit- labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2)}}else if(width_flag===1)for(i=0;i<cat_ax.labels.aLabels.length;++i){if(cat_ax.labels.aLabels[i]){cat_ax.labels.aLabels[i].tx.rich.content.Reset(0,0,arr_min_max_min[i],2E4);cat_ax.labels.aLabels[i].tx.rich.content.Recalculate_Page(0,true);var transform_text=cat_ax.labels.aLabels[i].transformText;transform_text.Reset();global_MatrixTransformer.TranslateAppend(transform_text,cat_ax.labels.x+cat_ax.labels.extX- cat_ax.labels.aLabels[i].tx.rich.content.XLimit-labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2);local_transform_text=cat_ax.labels.aLabels[i].localTransformText;local_transform_text.Reset();global_MatrixTransformer.TranslateAppend(local_transform_text,cat_ax.labels.x+cat_ax.labels.extX-cat_ax.labels.aLabels[i].tx.rich.content.XLimit-labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2)}}else for(i= 0;i<cat_ax.labels.aLabels.length;++i){if(cat_ax.labels.aLabels[i]){cat_ax.labels.aLabels[i].tx.rich.content.Reset(0,0,cat_ax.labels.extX-labels_offset,2E4);cat_ax.labels.aLabels[i].tx.rich.content.Recalculate_Page(0,true);var transform_text=cat_ax.labels.aLabels[i].transformText;transform_text.Reset();global_MatrixTransformer.TranslateAppend(transform_text,cat_ax.labels.x+cat_ax.labels.extX-cat_ax.labels.aLabels[i].tx.rich.content.XLimit-labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/ 2);local_text_transform=cat_ax.labels.aLabels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,cat_ax.labels.x+cat_ax.labels.extX-cat_ax.labels.aLabels[i].tx.rich.content.XLimit-labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2)}}else if(width_flag===0)for(i=0;i<cat_ax.labels.aLabels.length;++i){if(cat_ax.labels.aLabels[i]){var transform_text=cat_ax.labels.aLabels[i].transformText;transform_text.Reset(); global_MatrixTransformer.TranslateAppend(transform_text,cat_ax.labels.x+labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2);local_text_transform=cat_ax.labels.aLabels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,cat_ax.labels.x+labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2)}}else if(width_flag===1)for(i=0;i<cat_ax.labels.aLabels.length;++i){if(cat_ax.labels.aLabels[i]){cat_ax.labels.aLabels[i].tx.rich.content.Reset(0, 0,arr_min_max_min[i],2E4);cat_ax.labels.aLabels[i].tx.rich.content.Recalculate_Page(0,true);var transform_text=cat_ax.labels.aLabels[i].transformText;transform_text.Reset();global_MatrixTransformer.TranslateAppend(transform_text,cat_ax.labels.x+labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2);local_text_transform=cat_ax.labels.aLabels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform, cat_ax.labels.x+labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2)}}else for(i=0;i<cat_ax.labels.aLabels.length;++i)if(cat_ax.labels.aLabels[i]){cat_ax.labels.aLabels[i].tx.rich.content.Reset(0,0,cat_ax.labels.extX-labels_offset,2E4);cat_ax.labels.aLabels[i].tx.rich.content.Recalculate_Page(0,true);var transform_text=cat_ax.labels.aLabels[i].transformText;transform_text.Reset();global_MatrixTransformer.TranslateAppend(transform_text,cat_ax.labels.x+ labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2);local_text_transform=cat_ax.labels.aLabels[i].localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,cat_ax.labels.x+labels_offset,arr_cat_labels_points[i]-cat_ax.labels.aLabels[i].tx.rich.content.GetSummaryHeight()/2)}}cat_ax.yPoints.sort(function(a,b){return a.val-b.val});val_ax.xPoints.sort(function(a,b){return a.val-b.val})}else this.bEmptySeries= true}this.plotAreaRect=rect}};CChartSpace.prototype.checkAxisLabelsTransform=function(){if(this.chart&&this.chart.plotArea&&this.chart.plotArea.charts[0]&&this.chart.plotArea.charts[0].getAxisByTypes){var oAxisByTypes=this.chart.plotArea.charts[0].getAxisByTypes();var oCatAx=oAxisByTypes.catAx[0],oValAx=oAxisByTypes.valAx[0],deltaX,deltaY,i,oAxisLabels,oLabel,oNewPos;var oProcessor3D=this.chartObj&&this.chartObj.processor3D;var aXPoints=[],aYPoints=[];if(oCatAx&&oValAx&&oProcessor3D)if((oCatAx.axPos=== AscFormat.AX_POS_B||oCatAx.axPos===AscFormat.AX_POS_T)&&oCatAx.xPoints&&((oValAx.axPos===AscFormat.AX_POS_L||oValAx.axPos===AscFormat.AX_POS_R)&&oValAx.yPoints)){oAxisLabels=oCatAx.labels;if(oAxisLabels){var dZPositionCatAxis=oProcessor3D.calculateZPositionCatAxis();var dPosY,dPosY2;if(oAxisLabels.align){dPosY=oAxisLabels.y*this.chartObj.calcProp.pxToMM;dPosY2=oAxisLabels.y}else{dPosY=(oAxisLabels.y+oAxisLabels.extY)*this.chartObj.calcProp.pxToMM;dPosY2=oAxisLabels.y+oAxisLabels.extY}var fBottomLabels= -100;if(!oAxisLabels.bRotated)for(i=0;i<oAxisLabels.aLabels.length;++i){oLabel=oAxisLabels.aLabels[i];if(oLabel){var oCPosLabelX;oCPosLabelX=oLabel.localTransformText.TransformPointX(oLabel.txBody.content.XLimit/2,0);oNewPos=oProcessor3D.convertAndTurnPoint(oCPosLabelX*this.chartObj.calcProp.pxToMM,dPosY,dZPositionCatAxis);oLabel.setPosition2(oNewPos.x/this.chartObj.calcProp.pxToMM+oLabel.localTransformText.tx-oCPosLabelX,oLabel.localTransformText.ty-dPosY2+oNewPos.y/this.chartObj.calcProp.pxToMM); var fBottomContent=oLabel.y+oLabel.tx.rich.content.GetSummaryHeight();if(fBottomContent>fBottomLabels)fBottomLabels=fBottomContent}}else if(oAxisLabels.align){var stake_offset=AscFormat.isRealNumber(oCatAx.lblOffset)?oCatAx.lblOffset/100:1;var labels_offset=oCatAx.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize*(25.4/72)*stake_offset;for(i=0;i<oAxisLabels.aLabels.length;++i)if(oAxisLabels.aLabels[i]){oLabel=oAxisLabels.aLabels[i];var wh={w:oLabel.widthForTransform,h:oLabel.tx.rich.content.GetSummaryHeight()}, w2,h2,x1,y0,xc,yc;w2=wh.w*Math.cos(Math.PI/4)+wh.h*Math.sin(Math.PI/4);h2=wh.w*Math.sin(Math.PI/4)+wh.h*Math.cos(Math.PI/4);x1=oCatAx.xPoints[i].pos+wh.h*Math.sin(Math.PI/4);y0=oAxisLabels.y+labels_offset;var x1t,y0t;var oRes=oProcessor3D.convertAndTurnPoint(x1*this.chartObj.calcProp.pxToMM,y0*this.chartObj.calcProp.pxToMM,dZPositionCatAxis);x1t=oRes.x/this.chartObj.calcProp.pxToMM;y0t=oRes.y/this.chartObj.calcProp.pxToMM;xc=x1t-w2/2;yc=y0t+h2/2;var local_text_transform=oLabel.localTransformText; local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,-wh.w/2,-wh.h/2);global_MatrixTransformer.RotateRadAppend(local_text_transform,Math.PI/4);global_MatrixTransformer.TranslateAppend(local_text_transform,xc,yc);var fBottomContent=y0t+h2;if(fBottomContent>fBottomLabels)fBottomLabels=fBottomContent}}else{var stake_offset=AscFormat.isRealNumber(oCatAx.lblOffset)?oCatAx.lblOffset/100:1;var labels_offset=oCatAx.labels.aLabels[0].tx.rich.content.Content[0].CompiledPr.Pr.TextPr.FontSize* (25.4/72)*stake_offset;for(i=0;i<oAxisLabels.aLabels.length;++i)if(oAxisLabels.aLabels[i]){oLabel=oAxisLabels.aLabels[i];var wh={w:oLabel.widthForTransform,h:oLabel.tx.rich.content.GetSummaryHeight()},w2,h2,x1,y0,xc,yc;w2=wh.w*Math.cos(Math.PI/4)+wh.h*Math.sin(Math.PI/4);h2=wh.w*Math.sin(Math.PI/4)+wh.h*Math.cos(Math.PI/4);x1=oCatAx.xPoints[i].pos-wh.h*Math.sin(Math.PI/4);y0=oAxisLabels.y+oAxisLabels.extY-labels_offset;var x1t,y0t;var oRes=oProcessor3D.convertAndTurnPoint(x1*this.chartObj.calcProp.pxToMM, y0*this.chartObj.calcProp.pxToMM,dZPositionCatAxis);x1t=oRes.x/this.chartObj.calcProp.pxToMM;y0t=oRes.y/this.chartObj.calcProp.pxToMM;xc=x1t+w2/2;yc=y0t-h2/2;local_text_transform=oLabel.localTransformText;local_text_transform.Reset();global_MatrixTransformer.TranslateAppend(local_text_transform,-wh.w/2,-wh.h/2);global_MatrixTransformer.RotateRadAppend(local_text_transform,Math.PI/4);global_MatrixTransformer.TranslateAppend(local_text_transform,xc,yc)}}oNewPos=oProcessor3D.convertAndTurnPoint(oAxisLabels.x* this.chartObj.calcProp.pxToMM,oAxisLabels.y*this.chartObj.calcProp.pxToMM,dZPositionCatAxis);aXPoints.push(oNewPos.x/this.chartObj.calcProp.pxToMM);aYPoints.push(oNewPos.y/this.chartObj.calcProp.pxToMM);oNewPos=oProcessor3D.convertAndTurnPoint((oAxisLabels.x+oAxisLabels.extX)*this.chartObj.calcProp.pxToMM,oAxisLabels.y*this.chartObj.calcProp.pxToMM,dZPositionCatAxis);aXPoints.push(oNewPos.x/this.chartObj.calcProp.pxToMM);aYPoints.push(oNewPos.y/this.chartObj.calcProp.pxToMM);oNewPos=oProcessor3D.convertAndTurnPoint((oAxisLabels.x+ oAxisLabels.extX)*this.chartObj.calcProp.pxToMM,(oAxisLabels.y+oAxisLabels.extY)*this.chartObj.calcProp.pxToMM,dZPositionCatAxis);aXPoints.push(oNewPos.x/this.chartObj.calcProp.pxToMM);aYPoints.push(oNewPos.y/this.chartObj.calcProp.pxToMM);oNewPos=oProcessor3D.convertAndTurnPoint(oAxisLabels.x*this.chartObj.calcProp.pxToMM,(oAxisLabels.y+oAxisLabels.extY)*this.chartObj.calcProp.pxToMM,dZPositionCatAxis);aXPoints.push(oNewPos.x/this.chartObj.calcProp.pxToMM);aYPoints.push(oNewPos.y/this.chartObj.calcProp.pxToMM); oAxisLabels.x=Math.min.apply(Math,aXPoints);oAxisLabels.y=Math.min.apply(Math,aYPoints);oAxisLabels.extX=Math.max.apply(Math,aXPoints)-oAxisLabels.x;oAxisLabels.extY=Math.max(Math.max.apply(Math,aYPoints),fBottomLabels)-oAxisLabels.y}oAxisLabels=oValAx.labels;if(oAxisLabels){var dZPositionCatAxis=oProcessor3D.calculateZPositionValAxis();var dPosX,dPosX2;if(!oAxisLabels.align){dPosX2=oAxisLabels.x;dPosX=oAxisLabels.x*this.chartObj.calcProp.pxToMM}else{dPosX2=oAxisLabels.x+oAxisLabels.extX;dPosX=(oAxisLabels.x+ oAxisLabels.extX)*this.chartObj.calcProp.pxToMM}aXPoints.length=0;aYPoints.length=0;for(i=0;i<oAxisLabels.aLabels.length;++i){oLabel=oAxisLabels.aLabels[i];if(oLabel){oNewPos=oProcessor3D.convertAndTurnPoint(dPosX,oLabel.localTransformText.ty*this.chartObj.calcProp.pxToMM,dZPositionCatAxis);oLabel.setPosition2(oLabel.localTransformText.tx-dPosX2+oNewPos.x/this.chartObj.calcProp.pxToMM,oNewPos.y/this.chartObj.calcProp.pxToMM);aXPoints.push(oLabel.x);aYPoints.push(oLabel.y);aXPoints.push(oLabel.x+oLabel.txBody.content.XLimit); aYPoints.push(oLabel.y+oLabel.txBody.content.GetSummaryHeight())}}if(aXPoints.length>0&&aYPoints.length>0){oAxisLabels.x=Math.min.apply(Math,aXPoints);oAxisLabels.y=Math.min.apply(Math,aYPoints);oAxisLabels.extX=Math.max.apply(Math,aXPoints)-oAxisLabels.x;oAxisLabels.extY=Math.max.apply(Math,aYPoints)-oAxisLabels.y}}}else if((oCatAx.axPos===AscFormat.AX_POS_L||oCatAx.axPos===AscFormat.AX_POS_R)&&oCatAx.yPoints&&((oValAx.axPos===AscFormat.AX_POS_T||oValAx.axPos===AscFormat.AX_POS_B)&&oValAx.xPoints)){oAxisLabels= oValAx.labels;if(oAxisLabels){var dZPositionValAxis=oProcessor3D.calculateZPositionValAxis();var dPosY,dPosY2;if(oAxisLabels.align){dPosY=oAxisLabels.y*this.chartObj.calcProp.pxToMM;dPosY2=oAxisLabels.y}else{dPosY=(oAxisLabels.y+oAxisLabels.extY)*this.chartObj.calcProp.pxToMM;dPosY2=oAxisLabels.y+oAxisLabels.extY}for(i=0;i<oAxisLabels.aLabels.length;++i){oLabel=oAxisLabels.aLabels[i];if(oLabel){var oCPosLabelX=oLabel.localTransformText.TransformPointX(oLabel.txBody.content.XLimit/2,0);var oCPosLabelY= oLabel.localTransformText.TransformPointY(oLabel.txBody.content.XLimit/2,0);oNewPos=oProcessor3D.convertAndTurnPoint(oCPosLabelX*this.chartObj.calcProp.pxToMM,dPosY,dZPositionValAxis);oLabel.setPosition2(oNewPos.x/this.chartObj.calcProp.pxToMM+oLabel.localTransformText.tx-oCPosLabelX,oLabel.localTransformText.ty-dPosY2+oNewPos.y/this.chartObj.calcProp.pxToMM)}}oNewPos=oProcessor3D.convertAndTurnPoint(oAxisLabels.x*this.chartObj.calcProp.pxToMM,oAxisLabels.y*this.chartObj.calcProp.pxToMM,dZPositionValAxis); aXPoints.push(oNewPos.x/this.chartObj.calcProp.pxToMM);aYPoints.push(oNewPos.y/this.chartObj.calcProp.pxToMM);oNewPos=oProcessor3D.convertAndTurnPoint((oAxisLabels.x+oAxisLabels.extX)*this.chartObj.calcProp.pxToMM,oAxisLabels.y*this.chartObj.calcProp.pxToMM,dZPositionValAxis);aXPoints.push(oNewPos.x/this.chartObj.calcProp.pxToMM);aYPoints.push(oNewPos.y/this.chartObj.calcProp.pxToMM);oNewPos=oProcessor3D.convertAndTurnPoint((oAxisLabels.x+oAxisLabels.extX)*this.chartObj.calcProp.pxToMM,(oAxisLabels.y+ oAxisLabels.extY)*this.chartObj.calcProp.pxToMM,dZPositionValAxis);aXPoints.push(oNewPos.x/this.chartObj.calcProp.pxToMM);aYPoints.push(oNewPos.y/this.chartObj.calcProp.pxToMM);oNewPos=oProcessor3D.convertAndTurnPoint(oAxisLabels.x*this.chartObj.calcProp.pxToMM,(oAxisLabels.y+oAxisLabels.extY)*this.chartObj.calcProp.pxToMM,dZPositionValAxis);aXPoints.push(oNewPos.x/this.chartObj.calcProp.pxToMM);aYPoints.push(oNewPos.y/this.chartObj.calcProp.pxToMM);oAxisLabels.x=Math.min.apply(Math,aXPoints);oAxisLabels.y= Math.min.apply(Math,aYPoints);oAxisLabels.extX=Math.max.apply(Math,aXPoints)-oAxisLabels.x;oAxisLabels.extY=Math.max.apply(Math,aYPoints)-oAxisLabels.y}oAxisLabels=oCatAx.labels;aXPoints.length=0;aYPoints.length=0;if(oAxisLabels){var dZPositionCatAxis=oProcessor3D.calculateZPositionCatAxis();var dPosX,dPosX2;if(oAxisLabels.align){dPosX2=oAxisLabels.x;dPosX=oAxisLabels.x*this.chartObj.calcProp.pxToMM}else{dPosX2=oAxisLabels.x+oAxisLabels.extX;dPosX=(oAxisLabels.x+oAxisLabels.extX)*this.chartObj.calcProp.pxToMM}for(i= 0;i<oAxisLabels.aLabels.length;++i){oLabel=oAxisLabels.aLabels[i];if(oLabel){oNewPos=oProcessor3D.convertAndTurnPoint(dPosX,oLabel.localTransformText.ty*this.chartObj.calcProp.pxToMM,dZPositionCatAxis);oLabel.setPosition2(oLabel.localTransformText.tx-dPosX2+oNewPos.x/this.chartObj.calcProp.pxToMM,oNewPos.y/this.chartObj.calcProp.pxToMM);aXPoints.push(oLabel.x);aYPoints.push(oLabel.y);aXPoints.push(oLabel.x+oLabel.txBody.content.XLimit);aYPoints.push(oLabel.y+oLabel.txBody.content.GetSummaryHeight())}}if(aXPoints.length> 0&&aYPoints.length>0){oAxisLabels.x=Math.min.apply(Math,aXPoints);oAxisLabels.y=Math.min.apply(Math,aYPoints);oAxisLabels.extX=Math.max.apply(Math,aXPoints)-oAxisLabels.x;oAxisLabels.extY=Math.max.apply(Math,aYPoints)-oAxisLabels.y}}}}};CChartSpace.prototype.layoutLegendEntry=function(oEntry,fX,fY,fDistance){oEntry.localY=fY;var oFirstLine=oEntry.txBody.content.Content[0].Lines[0];var fYFirstLineMiddle=oEntry.localY+oFirstLine.Top+oFirstLine.Metrics.Descent/2+oFirstLine.Metrics.TextAscent-oFirstLine.Metrics.TextAscent2/ 2;var fPenWidth;var oUnionMarker=oEntry.calcMarkerUnion;var oLineMarker=oUnionMarker.lineMarker;var oMarker=oUnionMarker.marker;if(oLineMarker){oLineMarker.localX=fX;if(oLineMarker.pen)if(AscFormat.isRealNumber(oLineMarker.pen.w))fPenWidth=oLineMarker.pen.w/36E3;else fPenWidth=12700/36E3;else fPenWidth=0;oLineMarker.localY=fYFirstLineMiddle-fPenWidth/2;if(oMarker){oMarker.localX=oLineMarker.localX+oLineMarker.spPr.geometry.gdLst["w"]/2-oMarker.spPr.geometry.gdLst["w"]/2;oMarker.localY=fYFirstLineMiddle- oMarker.spPr.geometry.gdLst["h"]/2}oEntry.localX=oLineMarker.localX+oLineMarker.spPr.geometry.gdLst["w"]+fDistance}else if(oMarker){oMarker.localX=fX;oMarker.localY=fYFirstLineMiddle-oMarker.spPr.geometry.gdLst["h"]/2;oEntry.localX=oMarker.localX+oMarker.spPr.geometry.gdLst["w"]+fDistance}else oEntry.localX=fX+fDistance};CChartSpace.prototype.hitInTextRect=function(){return false};CChartSpace.prototype.recalculateLegend=function(){if(this.chart&&this.chart.legend){var parents=this.getParentObjects(); var RGBA={R:0,G:0,B:0,A:255};var legend=this.chart.legend;var arr_str_labels=[],i,j;var calc_entryes=legend.calcEntryes;calc_entryes.length=0;var series;var legend_pos=c_oAscChartLegendShowSettings.right;if(AscFormat.isRealNumber(legend.legendPos))legend_pos=legend.legendPos;var aCharts=this.chart.plotArea.charts;var oTypedChart;var aOrderedSeries=[];var aChartSeries;var nChart;var bStraightOrder;var bVericalLegend=false;if(aCharts.length===1&&(legend_pos===c_oAscChartLegendShowSettings.left||legend_pos=== c_oAscChartLegendShowSettings.right||legend_pos===c_oAscChartLegendShowSettings.leftOverlay||legend_pos===c_oAscChartLegendShowSettings.rightOverlay||legend_pos===c_oAscChartLegendShowSettings.topRight))bVericalLegend=true;for(nChart=0;nChart<aCharts.length;++nChart){oTypedChart=aCharts[nChart];aChartSeries=[].concat(oTypedChart.series);bStraightOrder=true;if(bVericalLegend)if(oTypedChart.getObjectType()===AscDFH.historyitem_type_BarChart){if(oTypedChart.grouping===AscFormat.BAR_GROUPING_STACKED|| oTypedChart.grouping===AscFormat.BAR_GROUPING_PERCENT_STACKED)bStraightOrder=false}else if(oTypedChart.grouping===AscFormat.GROUPING_STACKED||oTypedChart.grouping===AscFormat.GROUPING_PERCENT_STACKED)bStraightOrder=false;if(bStraightOrder)aChartSeries.sort(function(a,b){return a.order-b.order});else aChartSeries.sort(function(a,b){return b.order-a.order});if(oTypedChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart||oTypedChart.getObjectType()===AscDFH.historyitem_type_PieChart||oTypedChart.getObjectType()=== AscDFH.historyitem_type_OfPieChart)aOrderedSeries=aChartSeries.concat(aOrderedSeries);else aOrderedSeries=aOrderedSeries.concat(aChartSeries)}series=aOrderedSeries;var calc_entry,union_marker,entry;var max_width=0,cur_width,max_font_size=0,cur_font_size,ser,b_line_series;var max_word_width=0;var b_no_line_series=false;this.chart.legend.chart=this;var b_scatter_no_line=false;this.legendLength=null;var oFirstChart=aCharts[0];var bNoPieChart=oFirstChart.getObjectType()!==AscDFH.historyitem_type_PieChart&& oFirstChart.getObjectType()!==AscDFH.historyitem_type_DoughnutChart;var bSurfaceChart=oFirstChart.getObjectType()===AscDFH.historyitem_type_SurfaceChart;var bSeriesLegend=aCharts.length>1||bNoPieChart&&(!(oFirstChart.varyColors&&series.length===1)||bSurfaceChart);if(bSeriesLegend){if(bSurfaceChart){this.legendLength=this.chart.plotArea.charts[0].compiledBandFormats.length;ser=series[0]}else this.legendLength=series.length;for(i=0;i<this.legendLength;++i){if(!bSurfaceChart){ser=series[i];if(ser.isHidden)continue; entry=legend.findLegendEntryByIndex(i);if(entry&&entry.bDelete)continue;arr_str_labels.push(ser.getSeriesName())}else{entry=legend.findLegendEntryByIndex(i);if(entry&&entry.bDelete)continue;var oBandFmt=this.chart.plotArea.charts[0].compiledBandFormats[i];arr_str_labels.push(oBandFmt.startValue+"-"+oBandFmt.endValue)}calc_entry=new AscFormat.CalcLegendEntry(legend,this,i);calc_entry.series=ser;calc_entry.txBody=AscFormat.CreateTextBodyFromString(arr_str_labels[arr_str_labels.length-1],this.getDrawingDocument(), calc_entry);calc_entryes.push(calc_entry);cur_width=calc_entry.txBody.getRectWidth(2E3);if(cur_width>max_width)max_width=cur_width;cur_font_size=calc_entry.txBody.content.Content[0].CompiledPr.Pr.TextPr.FontSize;if(cur_font_size>max_font_size)max_font_size=cur_font_size;calc_entry.calcMarkerUnion=new AscFormat.CUnionMarker;union_marker=calc_entry.calcMarkerUnion;var pts=AscFormat.getPtsFromSeries(ser);switch(ser.getObjectType()){case AscDFH.historyitem_type_BarSeries:case AscDFH.historyitem_type_BubbleSeries:case AscDFH.historyitem_type_AreaSeries:{union_marker.marker= AscFormat.CreateMarkerGeometryByType(AscFormat.SYMBOL_SQUARE,null);union_marker.marker.pen=ser.compiledSeriesPen;union_marker.marker.brush=ser.compiledSeriesBrush;break}case AscDFH.historyitem_type_PieSeries:{union_marker.marker=AscFormat.CreateMarkerGeometryByType(AscFormat.SYMBOL_SQUARE,null);if(pts.length>0){union_marker.marker.pen=pts[0].pen;union_marker.marker.brush=pts[0].brush}else{union_marker.marker.pen=ser.compiledSeriesPen;union_marker.marker.brush=ser.compiledSeriesBrush}break}case AscDFH.historyitem_type_SurfaceSeries:{var oBandFmt= this.chart.plotArea.charts[0].compiledBandFormats[i];union_marker.marker=AscFormat.CreateMarkerGeometryByType(AscFormat.SYMBOL_SQUARE,null);union_marker.marker.pen=oBandFmt.spPr.ln;union_marker.marker.brush=oBandFmt.spPr.Fill;break}case AscDFH.historyitem_type_LineSeries:case AscDFH.historyitem_type_ScatterSer:{if(AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this)){union_marker.marker=AscFormat.CreateMarkerGeometryByType(AscFormat.SYMBOL_SQUARE,null);union_marker.marker.pen=ser.compiledSeriesPen; union_marker.marker.brush=ser.compiledSeriesBrush;break}if(ser.compiledSeriesMarker){var pts=AscFormat.getPtsFromSeries(ser);union_marker.marker=AscFormat.CreateMarkerGeometryByType(ser.compiledSeriesMarker.symbol,null);if(pts[0]&&pts[0].compiledMarker){union_marker.marker.brush=pts[0].compiledMarker.brush;union_marker.marker.pen=pts[0].compiledMarker.pen}}if(ser.compiledSeriesPen&&!b_scatter_no_line){union_marker.lineMarker=AscFormat.CreateMarkerGeometryByType(AscFormat.SYMBOL_DASH,null);union_marker.lineMarker.pen= ser.compiledSeriesPen.createDuplicate()}if(!b_scatter_no_line&&!AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this))b_line_series=true;break}}if(union_marker.marker){union_marker.marker.pen&&union_marker.marker.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);union_marker.marker.brush&&union_marker.marker.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}union_marker.lineMarker&&union_marker.lineMarker.pen&& union_marker.lineMarker.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}else{ser=series[0];i=1;while(ser&&ser.isHidden){ser=series[i];++i}var pts=AscFormat.getPtsFromSeries(ser),pt;var cat_str_lit;if(ser&&ser.cat)cat_str_lit=ser.cat.getStringPointsLit();this.legendLength=pts.length;var oNumLit=getNumLit(ser);var nEndIndex=pts.length;if(oNumLit)nEndIndex=oNumLit.ptCount;for(i=0;i<nEndIndex;++i){entry=legend.findLegendEntryByIndex(i);if(entry&&entry.bDelete)continue; if(oNumLit)pt=oNumLit.getPtByIndex(i);else pt=pts[i];var str_pt=cat_str_lit?cat_str_lit.getPtByIndex(i):null;if(str_pt)arr_str_labels.push(str_pt.val);else arr_str_labels.push((pt?pt.idx+1:"")+"");calc_entry=new AscFormat.CalcLegendEntry(legend,this,i);calc_entry.txBody=AscFormat.CreateTextBodyFromString(arr_str_labels[arr_str_labels.length-1],this.getDrawingDocument(),calc_entry);calc_entryes.push(calc_entry);cur_width=calc_entry.txBody.getRectWidth(2E3);if(cur_width>max_width)max_width=cur_width; cur_font_size=calc_entry.txBody.content.Content[0].CompiledPr.Pr.TextPr.FontSize;if(cur_font_size>max_font_size)max_font_size=cur_font_size;calc_entry.calcMarkerUnion=new AscFormat.CUnionMarker;union_marker=calc_entry.calcMarkerUnion;if(ser.getObjectType()===AscDFH.historyitem_type_LineSeries&&!AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this)||ser.getObjectType()===AscDFH.historyitem_type_ScatterSer){if(pt){if(pt.compiledMarker){union_marker.marker=AscFormat.CreateMarkerGeometryByType(pt.compiledMarker.symbol, null);union_marker.marker.brush=pt.compiledMarker.pen.Fill;union_marker.marker.pen=pt.compiledMarker.pen}if(pt.pen){union_marker.lineMarker=AscFormat.CreateMarkerGeometryByType(AscFormat.SYMBOL_DASH,null);union_marker.lineMarker.pen=pt.pen}}if(!b_scatter_no_line&&!AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this))b_line_series=true}else{b_no_line_series=false;union_marker.marker=AscFormat.CreateMarkerGeometryByType(AscFormat.SYMBOL_SQUARE,null);if(pt){union_marker.marker.pen=pt.pen; union_marker.marker.brush=pt.brush}else{var style=AscFormat.CHART_STYLE_MANAGER.getStyleByIndex(this.style);var base_fills=AscFormat.getArrayFillsFromBase(style.fill2,nEndIndex);union_marker.marker.brush=base_fills[i]}}if(union_marker.marker){union_marker.marker.pen&&union_marker.marker.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);union_marker.marker.brush&&union_marker.marker.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master, RGBA,this.clrMapOvr)}union_marker.lineMarker&&union_marker.lineMarker.pen&&union_marker.lineMarker.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}var marker_size;var distance_to_text;var line_marker_width;if(b_line_series){marker_size=2.5;line_marker_width=7.7;for(i=0;i<calc_entryes.length;++i){calc_entry=calc_entryes[i];if(calc_entry.calcMarkerUnion.lineMarker){calc_entry.calcMarkerUnion.lineMarker.spPr.geometry.Recalculate(line_marker_width,1);if(calc_entry.calcMarkerUnion.lineMarker.pen&& AscFormat.isRealNumber(calc_entry.calcMarkerUnion.lineMarker.pen.w)&&calc_entry.calcMarkerUnion.lineMarker.pen.w>133E3)calc_entry.calcMarkerUnion.lineMarker.pen.w=133E3;calc_entry.calcMarkerUnion.lineMarker.penWidth=calc_entry.calcMarkerUnion.lineMarker.pen&&AscFormat.isRealNumber(calc_entry.calcMarkerUnion.lineMarker.pen.w)?calc_entry.calcMarkerUnion.lineMarker.pen.w/36E3:0}if(calc_entryes[i].calcMarkerUnion.marker){var marker_width=marker_size;if(calc_entryes[i].series)if(calc_entryes[i].series.getObjectType()!== AscDFH.historyitem_type_LineSeries&&calc_entryes[i].series.getObjectType()!==AscDFH.historyitem_type_ScatterSer)marker_width=line_marker_width;calc_entryes[i].calcMarkerUnion.marker.spPr.geometry.Recalculate(marker_width,marker_size);calc_entryes[i].calcMarkerUnion.marker.extX=marker_width;calc_entryes[i].calcMarkerUnion.marker.extY=marker_size}}distance_to_text=.5}else{marker_size=.2*max_font_size;for(i=0;i<calc_entryes.length;++i)calc_entryes[i].calcMarkerUnion.marker.spPr.geometry.Recalculate(marker_size, marker_size);distance_to_text=marker_size*.7}var left_inset=marker_size+3*distance_to_text;var legend_width,legend_height;var fFixedWidth=null,fFixedHeight=null;var bFixedSize=false;if(legend.layout){fFixedWidth=this.calculateSizeByLayout(0,this.extX,legend.layout.w,legend.layout.wMode);fFixedHeight=this.calculateSizeByLayout(0,this.extY,legend.layout.h,legend.layout.hMode);bFixedSize=AscFormat.isRealNumber(fFixedWidth)&&fFixedWidth>0&&AscFormat.isRealNumber(fFixedHeight)&&fFixedHeight>0;if(bFixedSize){var oOldLayout= legend.layout;legend.layout=null;calc_entryes=[].concat(calc_entryes);this.recalculateLegend();legend.calcEntryes=calc_entryes;legend.naturalWidth=legend.extX;legend.naturalHeight=legend.extY;legend.layout=oOldLayout;var bResetLegendPos=false;if(!AscFormat.isRealNumber(this.chart.legend.legendPos)){bResetLegendPos=true;this.chart.legend.legendPos=Asc.c_oAscChartLegendShowSettings.bottom}if(!this.chartObj)this.chartObj=new AscFormat.CChartsDrawer;this.chartObj.preCalculateData(this);var pos=this.chartObj.recalculatePositionText(this.chart.legend); if(this.chart.legend.layout){if(AscFormat.isRealNumber(legend.layout.x))pos.x=this.calculatePosByLayout(pos.x,legend.layout.xMode,legend.layout.x,this.chart.legend.extX,this.extX);if(AscFormat.isRealNumber(legend.layout.y))pos.y=this.calculatePosByLayout(pos.y,legend.layout.yMode,legend.layout.y,this.chart.legend.extY,this.extY)}if(bResetLegendPos)this.chart.legend.legendPos=null;fFixedWidth=this.calculateSizeByLayout(pos.x,this.extX,legend.layout.w,legend.layout.wMode);fFixedHeight=this.calculateSizeByLayout(pos.y, this.extY,legend.layout.h,legend.layout.hMode)}}if(AscFormat.isRealNumber(legend_pos)){var max_legend_width,max_legend_height;var cut_index;if((legend_pos===c_oAscChartLegendShowSettings.left||legend_pos===c_oAscChartLegendShowSettings.leftOverlay||legend_pos===c_oAscChartLegendShowSettings.right||legend_pos===c_oAscChartLegendShowSettings.rightOverlay||legend_pos===c_oAscChartLegendShowSettings.topRight)&&!bFixedSize){max_legend_width=this.extX/3;var sizes=this.getChartSizes();max_legend_height= sizes.h;if(b_line_series){left_inset=line_marker_width+3*distance_to_text;var content_width=max_legend_width-left_inset;if(content_width<=0)content_width=.01;var cur_content_width,max_content_width=0;var arr_heights=[];var arr_heights2=[];for(i=0;i<calc_entryes.length;++i){calc_entry=calc_entryes[i];cur_content_width=calc_entry.txBody.getMaxContentWidth(content_width,true);if(cur_content_width>max_content_width)max_content_width=cur_content_width;arr_heights.push(calc_entry.txBody.getSummaryHeight()); arr_heights2.push(calc_entry.txBody.getSummaryHeight3())}if(max_content_width<max_legend_width-left_inset)legend_width=max_content_width+left_inset;else legend_width=max_legend_width;var max_entry_height2=Math.max(0,Math.max.apply(Math,arr_heights));for(i=0;i<arr_heights.length;++i)arr_heights[i]=max_entry_height2;var max_entry_height2=Math.max(0,Math.max.apply(Math,arr_heights2));for(i=0;i<arr_heights2.length;++i)arr_heights2[i]=max_entry_height2;var height_summ=0;var height_summ2=0;for(i=0;i<arr_heights2.length;++i){height_summ+= arr_heights2[i];height_summ2+=arr_heights[i];if(height_summ>max_legend_height){cut_index=i;break}}if(AscFormat.isRealNumber(cut_index))if(cut_index>0)legend_height=height_summ2-arr_heights[cut_index];else legend_height=max_legend_height;else{cut_index=arr_heights.length;legend_height=height_summ2}legend.x=0;legend.y=0;legend.extX=legend_width;legend.extY=legend_height;var summ_h=0;calc_entryes.splice(cut_index,calc_entryes.length-cut_index);for(i=0;i<cut_index&&i<calc_entryes.length;++i){calc_entry= calc_entryes[i];this.layoutLegendEntry(calc_entry,distance_to_text,summ_h,distance_to_text);summ_h+=arr_heights[i]}legend.setPosition(0,0)}else{var content_width=max_legend_width-left_inset;if(content_width<=0)content_width=.01;var cur_content_width,max_content_width=0;var arr_heights=[];var arr_heights2=[];for(i=0;i<calc_entryes.length;++i){calc_entry=calc_entryes[i];cur_content_width=calc_entry.txBody.getMaxContentWidth(content_width,true);if(cur_content_width>max_content_width)max_content_width= cur_content_width;arr_heights.push(calc_entry.txBody.getSummaryHeight());arr_heights2.push(calc_entry.txBody.getSummaryHeight3())}var chart_object;if(this.chart&&this.chart.plotArea&&this.chart.plotArea.charts[0])chart_object=this.chart.plotArea.charts[0];var b_reverse_order=false;if(chart_object&&chart_object.getObjectType()===AscDFH.historyitem_type_BarChart&&chart_object.barDir===AscFormat.BAR_DIR_BAR&&(cat_ax&&cat_ax.scaling&&AscFormat.isRealNumber(cat_ax.scaling.orientation)?cat_ax.scaling.orientation: AscFormat.ORIENTATION_MIN_MAX)===AscFormat.ORIENTATION_MIN_MAX||chart_object&&chart_object.getObjectType()===AscDFH.historyitem_type_SurfaceChart)b_reverse_order=true;var max_entry_height2=Math.max(0,Math.max.apply(Math,arr_heights));for(i=0;i<arr_heights.length;++i)arr_heights[i]=max_entry_height2;var max_entry_height2=Math.max(0,Math.max.apply(Math,arr_heights2));for(i=0;i<arr_heights2.length;++i)arr_heights2[i]=max_entry_height2;if(max_content_width<max_legend_width-left_inset)legend_width=max_content_width+ left_inset;else legend_width=max_legend_width;var height_summ=0;var height_summ2=0;for(i=0;i<arr_heights.length;++i){height_summ+=arr_heights2[i];height_summ2+=arr_heights[i];if(height_summ>max_legend_height){cut_index=i;break}}if(AscFormat.isRealNumber(cut_index))if(cut_index>0)legend_height=height_summ2-arr_heights[cut_index];else legend_height=max_legend_height;else{cut_index=arr_heights.length;legend_height=height_summ2}legend.x=0;legend.y=0;legend.extX=legend_width;legend.extY=legend_height; var summ_h=0;var b_reverse_order=false;var chart_object,cat_ax,start_index,end_index;if(this.chart&&this.chart.plotArea&&this.chart.plotArea.charts[0]){chart_object=this.chart.plotArea.charts[0];if(chart_object&&chart_object.getAxisByTypes){var axis_by_types=chart_object.getAxisByTypes();cat_ax=axis_by_types.catAx[0]}}if(chart_object&&chart_object.getObjectType()===AscDFH.historyitem_type_BarChart&&chart_object.barDir===AscFormat.BAR_DIR_BAR&&(cat_ax&&cat_ax.scaling&&AscFormat.isRealNumber(cat_ax.scaling.orientation)? cat_ax.scaling.orientation:AscFormat.ORIENTATION_MIN_MAX)===AscFormat.ORIENTATION_MIN_MAX)b_reverse_order=true;if(!b_reverse_order){calc_entryes.splice(cut_index,calc_entryes.length-cut_index);for(i=0;i<cut_index&&i<calc_entryes.length;++i){calc_entry=calc_entryes[i];this.layoutLegendEntry(calc_entry,distance_to_text,summ_h,distance_to_text);summ_h+=arr_heights[i]}}else{calc_entryes.splice(0,calc_entryes.length-cut_index);for(i=calc_entryes.length-1;i>-1;--i){calc_entry=calc_entryes[i];this.layoutLegendEntry(calc_entry, distance_to_text,summ_h,distance_to_text);summ_h+=arr_heights[i]}}legend.setPosition(0,0)}}else{var fMaxLegendHeight,fMaxLegendWidth;if(bFixedSize){fMaxLegendWidth=fFixedWidth;fMaxLegendHeight=fFixedHeight}else{fMaxLegendWidth=.9*this.extX;fMaxLegendHeight=(this.extY-(this.chart.title?this.chart.title.extY:0))*.6}var fMarkerWidth;if(b_line_series)fMarkerWidth=line_marker_width;else fMarkerWidth=marker_size;var oUnionMarker;var fMaxEntryWidth=0;var fSummWidth=0;var fCurEntryWidth,oCurEntry;var fLegendWidth, fLegendHeight;var aHeights=[];var aHeights2=[];var fMaxEntryHeight=0;var fCurEntryHeight=0;var fCurEntryHeight2=0;var aWidths=[];var fCurPosX;var fCurPosY;var fDistanceBetweenLabels;var fVertDistanceBetweenLabels;var oLineMarker,fPenWidth,oMarker;for(i=0;i<calc_entryes.length;++i){oCurEntry=calc_entryes[i];var fWidth=oCurEntry.txBody.getMaxContentWidth(2E4,true);aWidths.push(fWidth);fCurEntryWidth=distance_to_text+fMarkerWidth+distance_to_text+fWidth;if(fMaxEntryWidth<fCurEntryWidth)fMaxEntryWidth= fCurEntryWidth;fCurEntryHeight=oCurEntry.txBody.getSummaryHeight();fCurEntryHeight2=oCurEntry.txBody.getSummaryHeight3();aHeights.push(fCurEntryHeight);aHeights2.push(fCurEntryHeight2);if(fMaxEntryHeight<fCurEntryHeight2)fMaxEntryHeight=fCurEntryHeight2;fSummWidth+=fCurEntryWidth}if(fSummWidth<=fMaxLegendWidth){if(bFixedSize){fLegendWidth=fFixedWidth;fLegendHeight=fFixedHeight}else{fLegendWidth=fSummWidth;fLegendHeight=Math.max.apply(Math,aHeights)}fDistanceBetweenLabels=(fLegendWidth-fSummWidth)/ (calc_entryes.length+1);fCurPosX=0;legend.extX=fLegendWidth;legend.extY=fLegendHeight;for(i=0;i<calc_entryes.length;++i){fCurPosX+=fDistanceBetweenLabels;oCurEntry=calc_entryes[i];this.layoutLegendEntry(oCurEntry,fCurPosX+distance_to_text,Math.max(0,fLegendHeight/2-aHeights[i]/2),distance_to_text);fCurPosX+=distance_to_text+fMarkerWidth+distance_to_text+aWidths[i]}legend.setPosition(0,0)}else{if(fMaxLegendWidth<fMaxEntryWidth){var fTextWidth=Math.max(1,fMaxLegendWidth-distance_to_text-fMarkerWidth- distance_to_text);fMaxEntryWidth=0;fMaxEntryHeight=0;aWidths.length=0;aHeights.length=0;for(i=0;i<calc_entryes.length;++i){oCurEntry=calc_entryes[i];var fWidth=oCurEntry.txBody.getMaxContentWidth(fTextWidth,true);aWidths.push(fWidth);fCurEntryWidth=distance_to_text+fMarkerWidth+distance_to_text+fWidth;if(fMaxEntryWidth<fCurEntryWidth)fMaxEntryWidth=fCurEntryWidth;fCurEntryHeight=oCurEntry.txBody.getSummaryHeight();fCurEntryHeight2=oCurEntry.txBody.getSummaryHeight3();aHeights.push(fCurEntryHeight); aHeights2.push(fCurEntryHeight2);if(fMaxEntryHeight<fCurEntryHeight2)fMaxEntryHeight=fCurEntryHeight2;fSummWidth+=fCurEntryWidth}}var nColsCount=Math.max(1,fMaxLegendWidth/fMaxEntryWidth>>0);var nMaxRowsCount=Math.max(1,fMaxLegendHeight/fMaxEntryHeight>>0);var nMaxEntriesCount=nColsCount*nMaxRowsCount;if(calc_entryes.length>nMaxEntriesCount){calc_entryes.splice(nMaxEntriesCount,calc_entryes.length-nMaxEntriesCount);aWidths.splice(nMaxEntriesCount,aWidths.length-nMaxEntriesCount);aHeights.splice(nMaxEntriesCount, aHeights.length-nMaxEntriesCount);aHeights2.splice(nMaxEntriesCount,aHeights2.length-nMaxEntriesCount);fMaxEntryWidth=distance_to_text+fMarkerWidth+distance_to_text+Math.max.apply(Math,aWidths);fMaxEntryHeight=Math.max.apply(Math,aHeights2)}var nRowsCount=Math.ceil(calc_entryes.length/nColsCount);if(bFixedSize){fLegendWidth=fFixedWidth;fLegendHeight=fFixedHeight}else{fLegendWidth=fMaxEntryWidth*nColsCount;fLegendHeight=nRowsCount*Math.max.apply(Math,aHeights)}fDistanceBetweenLabels=(fLegendWidth- nColsCount*fMaxEntryWidth)/nColsCount;fVertDistanceBetweenLabels=(fLegendHeight-nRowsCount*Math.max.apply(Math,aHeights))/nRowsCount;legend.extX=fLegendWidth;legend.extY=fLegendHeight;fCurPosY=fVertDistanceBetweenLabels/2;for(i=0;i<nRowsCount;++i){fCurPosX=fDistanceBetweenLabels/2;for(j=0;j<nColsCount&&i*nColsCount+j<calc_entryes.length;++j){var nEntryIndex=i*nColsCount+j;oCurEntry=calc_entryes[nEntryIndex];this.layoutLegendEntry(oCurEntry,fCurPosX+distance_to_text,Math.max(0,fCurPosY+Math.max.apply(Math, aHeights)/2-aHeights[nEntryIndex]/2),distance_to_text);fCurPosX+=fMaxEntryWidth+fDistanceBetweenLabels}fCurPosY+=Math.max.apply(Math,aHeights)+fVertDistanceBetweenLabels}legend.setPosition(0,0)}}}else;legend.recalcInfo={recalculateLine:true,recalculateFill:true,recalculateTransparent:true};legend.recalculatePen();legend.recalculateBrush();legend.calcGeometry=null;if(legend.spPr)legend.calcGeometry=legend.spPr.geometry;if(legend.calcGeometry)legend.calcGeometry.Recalculate(legend.extX,legend.extY); for(i=0;i<calc_entryes.length;++i)calc_entryes[i].checkWidhtContent()}};CChartSpace.prototype.internalCalculatePenBrushFloorWall=function(oSide,nSideType){if(!oSide)return;var parent_objects=this.getParentObjects();if(oSide.spPr&&oSide.spPr.ln)oSide.pen=oSide.spPr.ln.createDuplicate();else{var oCompiledPen=null;if(this.style>=1&&this.style<=40&&2===nSideType)if(parent_objects.theme&&parent_objects.theme.themeElements&&parent_objects.theme.themeElements.fmtScheme&&parent_objects.theme.themeElements.fmtScheme.lnStyleLst&& parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0]){oCompiledPen=parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0].createDuplicate();if(this.style>=1&&this.style<=32)oCompiledPen.Fill=CreateUnifillSolidFillSchemeColor(15,.75);else oCompiledPen.Fill=CreateUnifillSolidFillSchemeColor(8,.75)}oSide.pen=oCompiledPen}if(this.style>=1&&this.style<=32)if(oSide.spPr&&oSide.spPr.Fill){oSide.brush=oSide.spPr.Fill.createDuplicate();if(nSideType===0||nSideType===2){var cColorMod=new AscFormat.CColorMod; if(nSideType===2)cColorMod.val=45E3;else cColorMod.val=35E3;cColorMod.name="shade";oSide.brush.addColorMod(cColorMod)}}else oSide.brush=null;else{var oSubtleFill;if(parent_objects.theme&&parent_objects.theme.themeElements&&parent_objects.theme.themeElements.fmtScheme&&parent_objects.theme.themeElements.fmtScheme.fillStyleLst)oSubtleFill=parent_objects.theme.themeElements.fmtScheme.fillStyleLst[0];var oDefaultBrush;var tint=.2;if(this.style>=33&&this.style<=34)oDefaultBrush=CreateUnifillSolidFillSchemeColor(8, .2);else if(this.style>=35&&this.style<=40)oDefaultBrush=CreateUnifillSolidFillSchemeColor(this.style-35,tint);else oDefaultBrush=CreateUnifillSolidFillSchemeColor(8,.95);if(oSide.spPr)oDefaultBrush.merge(oSide.spPr.Fill);if(nSideType===0||nSideType===2){var cColorMod=new AscFormat.CColorMod;if(nSideType===0)cColorMod.val=45E3;else cColorMod.val=35E3;cColorMod.name="shade";oDefaultBrush.addColorMod(cColorMod)}oSide.brush=oDefaultBrush}if(oSide.brush)oSide.brush.calculate(parent_objects.theme,parent_objects.slide, parent_objects.layout,parent_objects.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);if(oSide.pen)oSide.pen.calculate(parent_objects.theme,parent_objects.slide,parent_objects.layout,parent_objects.master,{R:0,G:0,B:0,A:255},this.clrMapOvr)};CChartSpace.prototype.recalculateWalls=function(){if(this.chart){this.internalCalculatePenBrushFloorWall(this.chart.sideWall,0);this.internalCalculatePenBrushFloorWall(this.chart.backWall,1);this.internalCalculatePenBrushFloorWall(this.chart.floor,2)}};CChartSpace.prototype.recalculateUpDownBars= function(){if(this.chart&&this.chart.plotArea){var aCharts=this.chart.plotArea.charts;for(var t=0;t<aCharts.length;++t){var oChart=aCharts[t];if(oChart&&oChart.upDownBars){var bars=oChart.upDownBars;var up_bars=bars.upBars;var down_bars=bars.downBars;var parents=this.getParentObjects();bars.upBarsBrush=null;bars.upBarsPen=null;bars.downBarsBrush=null;bars.downBarsPen=null;if(up_bars||down_bars){var default_bar_line=new AscFormat.CLn;if(parents.theme&&parents.theme.themeElements&&parents.theme.themeElements.fmtScheme&& parents.theme.themeElements.fmtScheme.lnStyleLst)default_bar_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[0]);if(this.style>=1&&this.style<=16)default_bar_line.setFill(CreateUnifillSolidFillSchemeColor(15,0));else if(this.style>=17&&this.style<=32||this.style>=41&&this.style<=48)default_bar_line=CreateNoFillLine();else if(this.style===33||this.style===34)default_bar_line.setFill(CreateUnifillSolidFillSchemeColor(8,0));else if(this.style>=35&&this.style<=40)default_bar_line.setFill(CreateUnifillSolidFillSchemeColor(this.style- 35,-.25))}if(up_bars){var default_up_bars_fill;if(this.style===1||this.style===9||this.style===17||this.style===25||this.style===41)default_up_bars_fill=CreateUnifillSolidFillSchemeColor(8,.25);else if(this.style===2||this.style===10||this.style===18||this.style===26)default_up_bars_fill=CreateUnifillSolidFillSchemeColor(8,.05);else if(this.style>=3&&this.style<=8)default_up_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-3,.25);else if(this.style>=11&&this.style<=16)default_up_bars_fill=CreateUnifillSolidFillSchemeColor(this.style- 11,.25);else if(this.style>=19&&this.style<=24)default_up_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-19,.25);else if(this.style>=27&&this.style<=32)default_up_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-27,.25);else if(this.style>=33&&this.style<=40||this.style===42)default_up_bars_fill=CreateUnifillSolidFillSchemeColor(12,0);else default_up_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-43,.25);if(up_bars.Fill)default_up_bars_fill.merge(up_bars.Fill);default_up_bars_fill.calculate(parents.theme, parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);oChart.upDownBars.upBarsBrush=default_up_bars_fill;var up_bars_line=default_bar_line.createDuplicate();if(up_bars.ln)up_bars_line.merge(up_bars.ln);up_bars_line.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);oChart.upDownBars.upBarsPen=up_bars_line}if(down_bars){var default_down_bars_fill;if(this.style===1||this.style===9||this.style===17||this.style===25||this.style=== 41||this.style===33)default_down_bars_fill=CreateUnifillSolidFillSchemeColor(8,.85);else if(this.style===2||this.style===10||this.style===18||this.style===26||this.style===34)default_down_bars_fill=CreateUnifillSolidFillSchemeColor(8,.95);else if(this.style>=3&&this.style<=8)default_down_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-3,-.25);else if(this.style>=11&&this.style<=16)default_down_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-11,-.25);else if(this.style>=19&&this.style<= 24)default_down_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-19,-.25);else if(this.style>=27&&this.style<=32)default_down_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-27,-.25);else if(this.style>=35&&this.style<=40)default_down_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-35,-.25);else if(this.style===42)default_down_bars_fill=CreateUnifillSolidFillSchemeColor(8,0);else default_down_bars_fill=CreateUnifillSolidFillSchemeColor(this.style-43,-.25);if(down_bars.Fill)default_down_bars_fill.merge(down_bars.Fill); default_down_bars_fill.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);oChart.upDownBars.downBarsBrush=default_down_bars_fill;var down_bars_line=default_bar_line.createDuplicate();if(down_bars.ln)down_bars_line.merge(down_bars.ln);down_bars_line.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);oChart.upDownBars.downBarsPen=down_bars_line}}}}};CChartSpace.prototype.recalculatePlotAreaChartPen= function(){if(this.chart&&this.chart.plotArea)if(this.chart.plotArea.spPr&&this.chart.plotArea.spPr.ln){this.chart.plotArea.pen=this.chart.plotArea.spPr.ln;var parents=this.getParentObjects();this.chart.plotArea.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr)}else this.chart.plotArea.pen=null};CChartSpace.prototype.recalculatePenBrush=function(){var parents=this.getParentObjects(),RGBA={R:0,G:0,B:0,A:255};if(this.brush)this.brush.calculate(parents.theme, parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(this.pen){this.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);checkBlackUnifill(this.pen.Fill,true)}if(this.chart){if(this.chart.title){if(this.chart.title.brush)this.chart.title.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(this.chart.title.pen)this.chart.title.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master, RGBA,this.clrMapOvr)}if(this.chart.plotArea){if(this.chart.plotArea.brush)this.chart.plotArea.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(this.chart.plotArea.pen)this.chart.plotArea.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);for(var t=0;t<this.chart.plotArea.axId.length;++t){var oAxis=this.chart.plotArea.axId[t];if(oAxis.compiledTickMarkLn){oAxis.compiledTickMarkLn.calculate(parents.theme,parents.slide, parents.layout,parents.master,RGBA,this.clrMapOvr);checkBlackUnifill(oAxis.compiledTickMarkLn.Fill,true)}if(oAxis.compiledMajorGridLines){oAxis.compiledMajorGridLines.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);checkBlackUnifill(oAxis.compiledMajorGridLines.Fill,true)}if(oAxis.compiledMinorGridLines){oAxis.compiledMinorGridLines.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);checkBlackUnifill(oAxis.compiledMinorGridLines.Fill, true)}if(oAxis.title){if(oAxis.title.brush)oAxis.title.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(oAxis.title.pen)oAxis.title.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}for(t=0;t<this.chart.plotArea.charts.length;++t){var oChart=this.chart.plotArea.charts[t];var series=oChart.series;for(var i=0;i<series.length;++i){var pts=AscFormat.getPtsFromSeries(series[i]);var oCalcObjects=[],nCalcId=0;for(var j= 0;j<pts.length;++j){var pt=pts[j];if(pt.brush)if(!oCalcObjects[pt.brush.calcId]){pt.brush.calcId=++nCalcId;oCalcObjects[pt.brush.calcId]=pt.brush;pt.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}if(pt.pen)if(!oCalcObjects[pt.pen.calcId]){pt.pen.calcId=++nCalcId;oCalcObjects[pt.pen.calcId]=pt.pen;pt.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}if(pt.compiledMarker){if(pt.compiledMarker.brush)if(!oCalcObjects[pt.compiledMarker.brush.calcId]){pt.compiledMarker.brush.calcId= ++nCalcId;oCalcObjects[pt.compiledMarker.brush.calcId]=pt.compiledMarker.brush;pt.compiledMarker.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}if(pt.compiledMarker.pen)if(!oCalcObjects[pt.compiledMarker.pen.calcId]){pt.compiledMarker.pen.calcId=++nCalcId;oCalcObjects[pt.compiledMarker.pen.calcId]=pt.compiledMarker.pen;pt.compiledMarker.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}if(pt.compiledDlb){if(pt.compiledDlb.brush)if(!oCalcObjects[pt.compiledDlb.brush.calcId]){pt.compiledDlb.brush.calcId= ++nCalcId;oCalcObjects[pt.compiledDlb.brush.calcId]=pt.compiledDlb.brush;pt.compiledDlb.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}if(pt.compiledDlb.pen)if(!oCalcObjects[pt.compiledDlb.pen.calcId]){pt.compiledDlb.pen.calcId=++nCalcId;oCalcObjects[pt.compiledDlb.pen.calcId]=pt.compiledDlb.pen;pt.compiledDlb.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}}}if(oChart.calculatedHiLowLines)oChart.calculatedHiLowLines.calculate(parents.theme, parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(oChart.upDownBars){if(oChart.upDownBars.upBarsBrush)oChart.upDownBars.upBarsBrush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(oChart.upDownBars.upBarsPen)oChart.upDownBars.upBarsPen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(oChart.upDownBars.downBarsBrush)oChart.upDownBars.downBarsBrush.calculate(parents.theme,parents.slide,parents.layout, parents.master,RGBA,this.clrMapOvr);if(oChart.upDownBars.downBarsPen)oChart.upDownBars.downBarsPen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}}if(this.chart.legend){if(this.chart.legend.brush)this.chart.legend.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(this.chart.legend.pen)this.chart.legend.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);var legend=this.chart.legend; for(var i=0;i<legend.calcEntryes.length;++i){var union_marker=legend.calcEntryes[i].calcMarkerUnion;if(union_marker){if(union_marker.marker){if(union_marker.marker.pen)union_marker.marker.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(union_marker.marker.brush)union_marker.marker.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}if(union_marker.lineMarker){if(union_marker.lineMarker.pen)union_marker.lineMarker.pen.calculate(parents.theme, parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(union_marker.lineMarker.brush)union_marker.lineMarker.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}}}if(this.chart.floor){if(this.chart.floor.brush)this.chart.floor.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(this.chart.floor.pen)this.chart.floor.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}if(this.chart.sideWall){if(this.chart.sideWall.brush)this.chart.sideWall.brush.calculate(parents.theme, parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(this.chart.sideWall.pen)this.chart.sideWall.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}if(this.chart.backWall){if(this.chart.backWall.brush)this.chart.backWall.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);if(this.chart.backWall.pen)this.chart.backWall.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}}; function fSaveChartObjectSourceFormatting(oObject,oObjectCopy,oTheme,oColorMap){if(oObject===oObjectCopy||!oObjectCopy||!oObject)return;if(oObject.pen||oObject.brush)if(oObject.pen||oObject.brush){if(!oObjectCopy.spPr)if(oObjectCopy.setSpPr){oObjectCopy.setSpPr(new AscFormat.CSpPr);oObjectCopy.spPr.setParent(oObjectCopy)}if(oObject.brush){if(oTheme&&oColorMap)oObject.brush.check(oTheme,oColorMap);oObjectCopy.spPr.setFill(oObject.brush.saveSourceFormatting())}if(oObject.pen){if(oObject.pen.Fill&&oTheme&& oColorMap)oObject.pen.Fill.check(oTheme,oColorMap);oObjectCopy.spPr.setLn(oObject.pen.createDuplicate(true))}}if(oObject.txPr&&oObject.txPr.content)AscFormat.SaveContentSourceFormatting(oObject.txPr.content.Content,oObjectCopy.txPr.content.Content,oTheme,oColorMap);if(oObject.tx&&oObject.tx.rich&&oObject.tx.rich.content)AscFormat.SaveContentSourceFormatting(oObject.tx.rich.content.Content,oObjectCopy.tx.rich.content.Content,oTheme,oColorMap)}CChartSpace.prototype.getCopyWithSourceFormatting=function(oIdMap){var oPr= new AscFormat.CCopyObjectProperties;oPr.idMap=oIdMap;oPr.drawingDocument=this.getDrawingDocument();var oCopy=this.copy(oPr);oCopy.updateLinks();if(oIdMap)oIdMap[this.Id]=oCopy.Id;var oTheme=this.Get_Theme();var oColorMap=this.Get_ColorMap();fSaveChartObjectSourceFormatting(this,oCopy,oTheme,oColorMap);if(!oCopy.txPr||!oCopy.txPr.content||!oCopy.txPr.content.Content[0]||!oCopy.txPr.content.Content[0].Pr)oCopy.setTxPr(AscFormat.CreateTextBodyFromString("",this.getDrawingDocument(),oCopy));var bMerge= false;var oTextPr=new CTextPr;if(!oCopy.txPr.content.Content[0].Pr.DefaultRunPr||!oCopy.txPr.content.Content[0].Pr.DefaultRunPr.RFonts||!oCopy.txPr.content.Content[0].Pr.DefaultRunPr.RFonts.Ascii||!oCopy.txPr.content.Content[0].Pr.DefaultRunPr.RFonts.Ascii.Name){bMerge=true;oTextPr.RFonts.Set_FromObject({Ascii:{Name:"+mn-lt",Index:-1},EastAsia:{Name:"+mn-ea",Index:-1},HAnsi:{Name:"+mn-lt",Index:-1},CS:{Name:"+mn-lt",Index:-1}})}if(this.txPr&&this.txPr.content&&this.txPr.content.Content[0]&&this.txPr.content.Content[0].Pr.DefaultRunPr&& this.txPr.content.Content[0].Pr.DefaultRunPr.Unifill){bMerge=true;var oUnifill=this.txPr.content.Content[0].Pr.DefaultRunPr.Unifill.createDuplicate();oUnifill.check(this.Get_Theme(),this.Get_ColorMap());oTextPr.Unifill=oUnifill.saveSourceFormatting()}else if(!AscFormat.isRealNumber(this.style)||this.style<33){bMerge=true;var oUnifill=CreateUnifillSolidFillSchemeColor(15,0);oUnifill.check(this.Get_Theme(),this.Get_ColorMap());oTextPr.Unifill=oUnifill.saveSourceFormatting()}else{bMerge=true;var oUnifill= CreateUnifillSolidFillSchemeColor(6,0);oUnifill.check(this.Get_Theme(),this.Get_ColorMap());oTextPr.Unifill=oUnifill.saveSourceFormatting()}if(bMerge){var oParaPr=oCopy.txPr.content.Content[0].Pr.Copy();var oParaPr2=new CParaPr;var oCopyTextPr=oTextPr.Copy();oParaPr2.DefaultRunPr=oCopyTextPr;oParaPr.Merge(oParaPr2);oCopy.txPr.content.Content[0].Set_Pr(oParaPr)}if(this.chart){if(this.chart.title)fSaveChartObjectSourceFormatting(this.chart.title,oCopy.chart.title,oTheme,oColorMap);if(this.chart.plotArea){fSaveChartObjectSourceFormatting(this.chart.plotArea, oCopy.chart.plotArea,oTheme,oColorMap);var aAxes=oCopy.chart.plotArea.axId;if(aAxes)for(var i=0;i<aAxes.length;++i)if(aAxes[i]&&this.chart.plotArea.axId[i]){fSaveChartObjectSourceFormatting(this.chart.plotArea.axId[i],aAxes[i],oTheme,oColorMap);if(this.chart.plotArea.axId[i].compiledLn){if(!aAxes[i].spPr)aAxes[i].setSpPr(new AscFormat.CSpPr);aAxes[i].spPr.setLn(this.chart.plotArea.axId[i].compiledLn.createDuplicate(true))}if(this.chart.plotArea.axId[i].compiledMajorGridLines){if(!aAxes[i].majorGridlines)aAxes[i].setMajorGridlines(new AscFormat.CSpPr); aAxes[i].majorGridlines.setLn(this.chart.plotArea.axId[i].compiledMajorGridLines.createDuplicate(true))}if(this.chart.plotArea.axId[i].compiledMinorGridLines){if(!aAxes[i].minorGridlines)aAxes[i].setMinorGridlines(new AscFormat.CSpPr);aAxes[i].minorGridlines.setLn(this.chart.plotArea.axId[i].compiledMinorGridLines.createDuplicate(true))}if(aAxes[i].title)fSaveChartObjectSourceFormatting(this.chart.plotArea.axId[i].title,aAxes[i].title,oTheme,oColorMap)}for(var t=0;t<this.chart.plotArea.charts.length;++t)if(this.chart.plotArea.charts[t]){var oChartOrig= this.chart.plotArea.charts[t];var oChartCopy=oCopy.chart.plotArea.charts[t];var series=oChartOrig.series;var seriesCopy=oChartCopy.series;var oDataPoint;for(var i=0;i<series.length;++i){series[i].brush=series[i].compiledSeriesBrush;series[i].pen=series[i].compiledSeriesPen;fSaveChartObjectSourceFormatting(series[i],seriesCopy[i],oTheme,oColorMap);var pts=AscFormat.getPtsFromSeries(series[i]);var ptsCopy=AscFormat.getPtsFromSeries(seriesCopy[i]);for(var j=0;j<pts.length;++j){var pt=pts[j];oDataPoint= null;if(Array.isArray(seriesCopy[i].dPt))for(var k=0;k<seriesCopy[i].dPt.length;++k)if(seriesCopy[i].dPt[k].idx===pts[j].idx){oDataPoint=seriesCopy[i].dPt[k];break}if(!oDataPoint){oDataPoint=new AscFormat.CDPt;oDataPoint.setIdx(pt.idx);seriesCopy[i].addDPt(oDataPoint)}fSaveChartObjectSourceFormatting(pt,oDataPoint,oTheme,oColorMap);if(pt.compiledMarker){var oMarker=pt.compiledMarker.createDuplicate();oDataPoint.setMarker(oMarker);fSaveChartObjectSourceFormatting(pt.compiledMarker,oMarker,oTheme,oColorMap)}}}if(oChartOrig.calculatedHiLowLines){if(!oChartCopy.hiLowLines)oChartCopy.setHiLowLines(new AscFormat.CSpPr); oChartCopy.hiLowLines.setLn(oChartOrig.calculatedHiLowLines.createDuplicate(true))}if(oChartOrig.upDownBars){if(oChartOrig.upDownBars.upBarsBrush){if(!oChartCopy.upDownBars.upBars)oChartCopy.upDownBars.setUpBars(new AscFormat.CSpPr);oChartCopy.upDownBars.upBars.setFill(oChartOrig.upDownBars.upBarsBrush.saveSourceFormatting())}if(oChartOrig.upDownBars.upBarsPen){if(!oChartCopy.upDownBars.upBars)oChartCopy.upDownBars.setUpBars(new AscFormat.CSpPr);oChartCopy.upDownBars.upBars.setLn(oChartOrig.upDownBars.upBarsPen.createDuplicate(true))}if(oChartOrig.upDownBars.downBarsBrush){if(!oChartCopy.upDownBars.downBars)oChartCopy.upDownBars.setDownBars(new AscFormat.CSpPr); oChartCopy.upDownBars.downBars.setFill(oChartOrig.upDownBars.downBarsBrush.saveSourceFormatting())}if(oChartOrig.upDownBars.downBarsPen){if(!oChartCopy.upDownBars.downBars)oChartCopy.upDownBars.setDownBars(new AscFormat.CSpPr);oChartCopy.upDownBars.downBars.setLn(oChartOrig.upDownBars.downBarsPen.createDuplicate(true))}}}}if(this.chart.legend){fSaveChartObjectSourceFormatting(this.chart.legend,oCopy.chart.legend,oTheme,oColorMap);var legend=this.chart.legend;for(var i=0;i<legend.legendEntryes.length;++i)fSaveChartObjectSourceFormatting(legend.legendEntryes[i], oCopy.chart.legend.legendEntryes[i],oTheme,oColorMap)}if(this.chart.floor)fSaveChartObjectSourceFormatting(this.chart.floor,oCopy.chart.floor,oTheme,oColorMap);if(this.chart.sideWall)fSaveChartObjectSourceFormatting(this.chart.sideWall,oCopy.chart.sideWall,oTheme,oColorMap);if(this.chart.backWall)fSaveChartObjectSourceFormatting(this.chart.backWall,oCopy.chart.backWall,oTheme,oColorMap)}return oCopy};CChartSpace.prototype.getChartSizes=function(bNotRecalculate){if(this.plotAreaRect&&!this.recalcInfo.recalculateAxisVal)return{startX:this.plotAreaRect.x, startY:this.plotAreaRect.y,w:this.plotAreaRect.w,h:this.plotAreaRect.h};if(!this.chartObj)this.chartObj=new AscFormat.CChartsDrawer;var oChartSize=this.chartObj.calculateSizePlotArea(this,bNotRecalculate);var oLayout=this.chart.plotArea.layout;if(oLayout){oChartSize.startX=this.calculatePosByLayout(oChartSize.startX,oLayout.xMode,oLayout.x,oChartSize.w,this.extX);oChartSize.startY=this.calculatePosByLayout(oChartSize.startY,oLayout.yMode,oLayout.y,oChartSize.h,this.extY);var fSize=this.calculateSizeByLayout(oChartSize.startX, this.extX,oLayout.w,oLayout.wMode);if(AscFormat.isRealNumber(fSize)&&fSize>0){var fSize2=this.calculateSizeByLayout(oChartSize.startY,this.extY,oLayout.h,oLayout.hMode);if(AscFormat.isRealNumber(fSize2)&&fSize2>0){oChartSize.w=fSize;oChartSize.h=fSize2;oChartSize.startX=this.calculatePosByLayout(oChartSize.startX,oLayout.xMode,oLayout.x,oChartSize.w,this.extX);oChartSize.startY=this.calculatePosByLayout(oChartSize.startY,oLayout.yMode,oLayout.y,oChartSize.h,this.extY);var aCharts=this.chart.plotArea.charts; for(var i=0;i<aCharts.length;++i){var nChartType=aCharts[i].getObjectType();if(nChartType===AscDFH.historyitem_type_PieChart||nChartType===AscDFH.historyitem_type_DoughnutChart){var fCX=oChartSize.startX+oChartSize.w/2;var fCY=oChartSize.startY+oChartSize.h/2;var fPieSize=Math.min(oChartSize.w,oChartSize.h);oChartSize.startX=fCX-fPieSize/2;oChartSize.startY=fCY-fPieSize/2;oChartSize.w=fPieSize;oChartSize.h=fPieSize;break}}}}}if(oChartSize.w<=0)oChartSize.w=1;if(oChartSize.h<=0)oChartSize.h=1;return oChartSize}; CChartSpace.prototype.reindexSeries=function(){var aAllSeries=this.getAllSeries();for(var nIndex=0;nIndex<aAllSeries.length;++nIndex)aAllSeries[nIndex].setIdx(nIndex);aAllSeries.sort(function(a,b){return a.order-b.order});for(nIndex=0;nIndex<aAllSeries.length;++nIndex)aAllSeries[nIndex].setOrder(nIndex)};CChartSpace.prototype.reorderSeries=function(){var aAllSeries=this.getAllSeries();aAllSeries.sort(function(a,b){return a.order-b.order});var oSeries;for(var nIndex=0;nIndex<aAllSeries.length;++nIndex){oSeries= aAllSeries[nIndex];if(nIndex!==oSeries.order)oSeries.setOrder(nIndex)}};CChartSpace.prototype.sortSeries=function(){if(this.chart&&this.chart.plotArea){var aCharts=this.chart.plotArea.charts;for(var i=0;i<aCharts.length;++i)aCharts[i].sortSeries()}};CChartSpace.prototype.moveSeriesUp=function(oSeries){var aAllSeries=this.getAllSeries();aAllSeries.sort(function(a,b){return a.order-b.order});for(var i=0;i<aAllSeries.length;++i)if(oSeries===aAllSeries[i]){if(i>0){var nOrder=oSeries.order;oSeries.setOrder(aAllSeries[i- 1].order);aAllSeries[i-1].setOrder(nOrder)}break}this.sortSeries()};CChartSpace.prototype.moveSeriesDown=function(oSeries){var aAllSeries=this.getAllSeries();aAllSeries.sort(function(a,b){return a.order-b.order});for(var i=0;i<aAllSeries.length;++i)if(oSeries===aAllSeries[i]){if(i<aAllSeries.length-1){var nOrder=oSeries.order;oSeries.setOrder(aAllSeries[i+1].order);aAllSeries[i+1].setOrder(nOrder)}break}this.sortSeries()};CChartSpace.prototype.getAllSeries=function(){var _ret=[];if(this.chart&&this.chart.plotArea){var aCharts= this.chart.plotArea.charts;for(var i=0;i<aCharts.length;++i)_ret=_ret.concat(aCharts[i].series)}_ret.sort(function(a,b){return a.idx-b.idx});return _ret};CChartSpace.prototype.recalculatePlotAreaChartBrush=function(){if(this.chart&&this.chart.plotArea){var plot_area=this.chart.plotArea;var default_brush;if(AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this))default_brush=CreateNoFillUniFill();else if(this.chart.plotArea&&this.chart.plotArea.charts.length===1&&this.chart.plotArea.charts[0]&& (this.chart.plotArea.charts[0].getObjectType()===AscDFH.historyitem_type_PieChart||this.chart.plotArea.charts[0].getObjectType()===AscDFH.historyitem_type_DoughnutChart))default_brush=CreateNoFillUniFill();else{var tint=.2;if(this.style>=1&&this.style<=32)default_brush=CreateUnifillSolidFillSchemeColor(6,tint);else if(this.style>=33&&this.style<=34)default_brush=CreateUnifillSolidFillSchemeColor(8,.2);else if(this.style>=35&&this.style<=40)default_brush=CreateUnifillSolidFillSchemeColor(this.style- 35,tint);else default_brush=CreateUnifillSolidFillSchemeColor(8,.95)}if(plot_area.spPr&&plot_area.spPr.Fill)default_brush.merge(plot_area.spPr.Fill);var parents=this.getParentObjects();default_brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);plot_area.brush=default_brush}};CChartSpace.prototype.recalculateChartPen=function(){var parent_objects=this.getParentObjects();var default_line=new AscFormat.CLn;if(parent_objects.theme&&parent_objects.theme.themeElements&& parent_objects.theme.themeElements.fmtScheme&&parent_objects.theme.themeElements.fmtScheme.lnStyleLst)default_line.merge(parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0]);var fill;if(this.style>=1&&this.style<=32)fill=CreateUnifillSolidFillSchemeColor(15,.75);else if(this.style>=33&&this.style<=40)fill=CreateUnifillSolidFillSchemeColor(8,.75);else fill=CreateUnifillSolidFillSchemeColor(12,0);default_line.setFill(fill);if(this.spPr&&this.spPr.ln)default_line.merge(this.spPr.ln);var parents= this.getParentObjects();default_line.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);this.pen=default_line;checkBlackUnifill(this.pen.Fill,true)};CChartSpace.prototype.recalculateChartBrush=function(){var default_brush;if(this.style>=1&&this.style<=32)default_brush=CreateUnifillSolidFillSchemeColor(6,0);else if(this.style>=33&&this.style<=40)default_brush=CreateUnifillSolidFillSchemeColor(12,0);else default_brush=CreateUnifillSolidFillSchemeColor(8, 0);if(this.spPr&&this.spPr.Fill)default_brush.merge(this.spPr.Fill);var parents=this.getParentObjects();default_brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);this.brush=default_brush};CChartSpace.prototype.recalculateAxisTickMark=function(){if(this.chart&&this.chart.plotArea){var oThis=this;var calcMajorMinorGridLines=function(axis,defaultStyle,subtleLine,parents){function calcGridLine(defaultStyle,spPr,subtleLine,parents){var compiled_grid_lines= new AscFormat.CLn;compiled_grid_lines.merge(subtleLine);if(!compiled_grid_lines.Fill)compiled_grid_lines.setFill(new AscFormat.CUniFill);compiled_grid_lines.Fill.merge(defaultStyle);if(subtleLine&&subtleLine.Fill&&subtleLine.Fill.fill&&subtleLine.Fill.fill.color&&subtleLine.Fill.fill.color.Mods&&compiled_grid_lines.Fill&&compiled_grid_lines.Fill.fill&&compiled_grid_lines.Fill.fill.color)compiled_grid_lines.Fill.fill.color.Mods=subtleLine.Fill.fill.color.Mods.createDuplicate();compiled_grid_lines.calculate(parents.theme, parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},oThis.clrMapOvr);checkBlackUnifill(compiled_grid_lines.Fill,true);if(spPr&&spPr.ln){compiled_grid_lines.merge(spPr.ln);compiled_grid_lines.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},oThis.clrMapOvr)}return compiled_grid_lines}axis.compiledLn=calcGridLine(defaultStyle.axisAndMajorGridLines,axis.spPr,subtleLine,parents);axis.compiledTickMarkLn=axis.compiledLn.createDuplicate();axis.compiledTickMarkLn.calculate(parents.theme, parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},oThis.clrMapOvr);checkBlackUnifill(axis.compiledTickMarkLn.Fill,true)};var default_style=CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.style);var parent_objects=this.getParentObjects();var subtle_line;if(parent_objects.theme&&parent_objects.theme.themeElements&&parent_objects.theme.themeElements.fmtScheme&&parent_objects.theme.themeElements.fmtScheme.lnStyleLst)subtle_line=parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0]; var aAxes=this.chart.plotArea.axId;for(var i=0;i<aAxes.length;++i)calcMajorMinorGridLines(aAxes[i],default_style,subtle_line,parent_objects)}};CChartSpace.prototype.getXValAxisValues=function(){if(!this.chartObj)this.chartObj=new AscFormat.CChartsDrawer;this.chartObj.preCalculateData(this);return[].concat(this.chart.plotArea.catAx.scale)};CChartSpace.prototype.getValAxisValues=function(){if(!this.chartObj)this.chartObj=new AscFormat.CChartsDrawer;this.chartObj.preCalculateData(this);return[].concat(this.chart.plotArea.valAx.scale)}; CChartSpace.prototype.getCalcProps=function(){if(!this.chartObj)this.chartObj=new AscFormat.CChartsDrawer;this.chartObj.preCalculateData(this);return this.chartObj.calcProp};CChartSpace.prototype.recalculateDLbls=function(){if(this.chart&&this.chart.plotArea){this.cachedCanvas=null;var aCharts=this.chart.plotArea.charts;for(var t=0;t<aCharts.length;++t){var series=aCharts[t].series;var nDefaultPosition;if(aCharts[t].getDefaultDataLabelsPosition)nDefaultPosition=aCharts[t].getDefaultDataLabelsPosition(); var default_lbl=new AscFormat.CDLbl;default_lbl.initDefault(nDefaultPosition);var bSkip=false;if(this.ptsCount>MAX_LABELS_COUNT)bSkip=true;var nCount=0;var nLblCount=0;for(var i=0;i<series.length;++i){var ser=series[i];var pts=AscFormat.getPtsFromSeries(ser);var series_dlb=new AscFormat.CDLbl;series_dlb.merge(default_lbl);series_dlb.merge(aCharts[t].dLbls);series_dlb.merge(ser.dLbls);var bCheckAll=true,j;if(series_dlb.checkNoLbl())if(!aCharts[t].dLbls||aCharts[t].dLbls.dLbl.length===0&&!ser.dLbls|| ser.dLbls.dLbl.length===0){for(j=0;j<pts.length;++j)pts[j].compiledDlb=null;bCheckAll=false}if(bCheckAll)for(j=0;j<pts.length;++j){var pt=pts[j];if(bSkip)if(nLblCount>MAX_LABELS_COUNT*(nCount/this.ptsCount)){pt.compiledDlb=null;nCount++;continue}var compiled_dlb=new AscFormat.CDLbl;compiled_dlb.merge(default_lbl);compiled_dlb.merge(aCharts[t].dLbls);if(aCharts[t].dLbls)compiled_dlb.merge(aCharts[t].dLbls.findDLblByIdx(pt.idx),false);compiled_dlb.merge(ser.dLbls);if(ser.dLbls){var oSeriesDLbl=ser.dLbls.findDLblByIdx(pt.idx); if(oSeriesDLbl){oSeriesDLbl.chart=this;compiled_dlb.merge(oSeriesDLbl);if(oSeriesDLbl.tx)compiled_dlb.tx=oSeriesDLbl.tx}}if(compiled_dlb.checkNoLbl())pt.compiledDlb=null;else{pt.compiledDlb=compiled_dlb;pt.compiledDlb.chart=this;pt.compiledDlb.series=ser;pt.compiledDlb.pt=pt;pt.compiledDlb.recalculate();nLblCount++}++nCount}}}}};CChartSpace.prototype.recalculateHiLowLines=function(){if(this.chart&&this.chart.plotArea){var aCharts=this.chart.plotArea.charts;var parents=this.getParentObjects();for(var i= 0;i<aCharts.length;++i){var oCurChart=aCharts[i];if((oCurChart instanceof AscFormat.CStockChart||oCurChart instanceof AscFormat.CLineChart)&&oCurChart.hiLowLines){var default_line=parents.theme.themeElements.fmtScheme.lnStyleLst[0].createDuplicate();if(this.style>=1&&this.style<=32)default_line.setFill(CreateUnifillSolidFillSchemeColor(15,0));else if(this.style>=33&&this.style<=34)default_line.setFill(CreateUnifillSolidFillSchemeColor(8,0));else if(this.style>=35&&this.style<=40)default_line.setFill(CreateUnifillSolidFillSchemeColor(8, -.25));else default_line.setFill(CreateUnifillSolidFillSchemeColor(12,0));default_line.merge(oCurChart.hiLowLines.ln);oCurChart.calculatedHiLowLines=default_line;default_line.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr)}else oCurChart.calculatedHiLowLines=null}}};CChartSpace.prototype.recalculateSeriesColors=function(){this.cachedCanvas=null;this.ptsCount=0;if(this.chart&&this.chart.plotArea){var style=CHART_STYLE_MANAGER.getStyleByIndex(this.style); var parents=this.getParentObjects();var RGBA={R:0,G:0,B:0,A:255};var aCharts=this.chart.plotArea.charts;var aAllSeries=[];for(var t=0;t<aCharts.length;++t)aAllSeries=aAllSeries.concat(aCharts[t].series);var nMaxSeriesIdx=getMaxIdx(aAllSeries);for(t=0;t<aCharts.length;++t){var oChart=aCharts[t];var series=oChart.series;if(oChart.varyColors&&(series.length===1||oChart.getObjectType()===AscDFH.historyitem_type_PieChart||oChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart)){var base_fills2= getArrayFillsFromBase(style.fill2,getMaxIdx(series));for(var ii=0;ii<series.length;++ii){var ser=series[ii];var pts=AscFormat.getPtsFromSeries(ser);this.ptsCount+=pts.length;ser.compiledSeriesBrush=new AscFormat.CUniFill;ser.compiledSeriesBrush.merge(base_fills2[ser.idx]);if(ser.spPr&&ser.spPr.Fill)ser.compiledSeriesBrush.merge(ser.spPr.Fill);ser.compiledSeriesPen=new AscFormat.CLn;if(style.line1===EFFECT_NONE)ser.compiledSeriesPen.w=0;else if(style.line1===EFFECT_SUBTLE)ser.compiledSeriesPen.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[0]); else if(style.line1===EFFECT_MODERATE)ser.compiledSeriesPen.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[1]);else if(style.line1===EFFECT_INTENSE)ser.compiledSeriesPen.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[2]);var base_line_fills2;if(this.style===34)base_line_fills2=getArrayFillsFromBase(style.line2,getMaxIdx(series));ser.compiledSeriesPen.Fill=new AscFormat.CUniFill;if(this.style!==34)ser.compiledSeriesPen.Fill.merge(style.line2[0]);else ser.compiledSeriesPen.Fill.merge(base_line_fills2[ser.idx]); if(ser.spPr&&ser.spPr.ln)ser.compiledSeriesPen.merge(ser.spPr.ln);if(!(oChart.getObjectType()===AscDFH.historyitem_type_LineChart||oChart.getObjectType()===AscDFH.historyitem_type_ScatterChart)){var base_fills=getArrayFillsFromBase(style.fill2,getMaxIdx(pts));for(var i=0;i<pts.length;++i){var compiled_brush=new AscFormat.CUniFill;compiled_brush.merge(base_fills[pts[i].idx]);if(ser.spPr&&ser.spPr.Fill)compiled_brush.merge(ser.spPr.Fill);if(Array.isArray(ser.dPt))for(var j=0;j<ser.dPt.length;++j)if(ser.dPt[j].idx=== pts[i].idx){if(ser.dPt[j].spPr)compiled_brush.merge(ser.dPt[j].spPr.Fill);break}pts[i].brush=compiled_brush;pts[i].brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}default_line=new AscFormat.CLn;if(style.line1===EFFECT_NONE)default_line.w=0;else if(style.line1===EFFECT_SUBTLE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[0]);else if(style.line1===EFFECT_MODERATE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[1]); else if(style.line1===EFFECT_INTENSE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[2]);var base_line_fills;if(this.style===34)base_line_fills=getArrayFillsFromBase(style.line2,getMaxIdx(pts));for(i=0;i<pts.length;++i){var compiled_line=new AscFormat.CLn;compiled_line.merge(default_line);compiled_line.Fill=new AscFormat.CUniFill;if(this.style!==34)compiled_line.Fill.merge(style.line2[0]);else compiled_line.Fill.merge(base_line_fills[pts[i].idx]);if(ser.spPr&&ser.spPr.ln)compiled_line.merge(ser.spPr.ln); if(Array.isArray(ser.dPt)&&!(ser.getObjectType&&ser.getObjectType()===AscDFH.historyitem_type_AreaSeries))for(var j=0;j<ser.dPt.length;++j)if(ser.dPt[j].idx===pts[i].idx){if(ser.dPt[j].spPr)compiled_line.merge(ser.dPt[j].spPr.ln);break}pts[i].pen=compiled_line;pts[i].pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}else{var default_line;if(oChart.getObjectType()===AscDFH.historyitem_type_ScatterChart&&oChart.scatterStyle===AscFormat.SCATTER_STYLE_MARKER|| oChart.scatterStyle===AscFormat.SCATTER_STYLE_NONE){default_line=new AscFormat.CLn;default_line.setFill(new AscFormat.CUniFill);default_line.Fill.setFill(new AscFormat.CNoFill)}else default_line=parents.theme.themeElements.fmtScheme.lnStyleLst[0];var base_line_fills=getArrayFillsFromBase(style.line4,getMaxIdx(pts));for(var i=0;i<pts.length;++i){var compiled_line=new AscFormat.CLn;compiled_line.merge(default_line);if(!(oChart.getObjectType()===AscDFH.historyitem_type_ScatterChart&&oChart.scatterStyle=== AscFormat.SCATTER_STYLE_MARKER||oChart.scatterStyle===AscFormat.SCATTER_STYLE_NONE))compiled_line.Fill.merge(base_line_fills[pts[i].idx]);compiled_line.w*=style.line3;if(ser.spPr&&ser.spPr.ln)compiled_line.merge(ser.spPr.ln);if(Array.isArray(ser.dPt))for(var j=0;j<ser.dPt.length;++j)if(ser.dPt[j].idx===pts[i].idx){if(ser.dPt[j].spPr)compiled_line.merge(ser.dPt[j].spPr.ln);break}pts[i].brush=null;pts[i].pen=compiled_line;pts[i].pen.calculate(parents.theme,parents.slide,parents.layout,parents.master, RGBA,this.clrMapOvr)}}for(var j=0;j<pts.length;++j)if(pts[j].compiledMarker){pts[j].compiledMarker.pen&&pts[j].compiledMarker.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);pts[j].compiledMarker.brush&&pts[j].compiledMarker.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}}else switch(oChart.getObjectType()){case AscDFH.historyitem_type_LineChart:case AscDFH.historyitem_type_RadarChart:{var base_line_fills= getArrayFillsFromBase(style.line4,nMaxSeriesIdx);if(!AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this))for(var i=0;i<series.length;++i){var default_line=parents.theme.themeElements.fmtScheme.lnStyleLst[0];var ser=series[i];var pts=AscFormat.getPtsFromSeries(ser);this.ptsCount+=pts.length;var compiled_line=new AscFormat.CLn;compiled_line.merge(default_line);compiled_line.Fill&&compiled_line.Fill.merge(base_line_fills[ser.idx]);compiled_line.w*=style.line3;if(ser.spPr&&ser.spPr.ln)compiled_line.merge(ser.spPr.ln); ser.compiledSeriesPen=compiled_line;for(var j=0;j<pts.length;++j){var oPointLine=null;if(Array.isArray(ser.dPt))for(var k=0;k<ser.dPt.length;++k)if(ser.dPt[k].idx===pts[j].idx){if(ser.dPt[k].spPr)oPointLine=ser.dPt[k].spPr.ln;break}if(oPointLine){compiled_line=ser.compiledSeriesPen.createDuplicate();compiled_line.merge(oPointLine)}else compiled_line=ser.compiledSeriesPen;pts[j].brush=null;pts[j].pen=compiled_line}}else{var base_fills=getArrayFillsFromBase(style.fill2,nMaxSeriesIdx);var base_line_fills= null;if(style.line1===EFFECT_SUBTLE&&this.style===34)base_line_fills=getArrayFillsFromBase(style.line2,nMaxSeriesIdx);for(var i=0;i<series.length;++i){var ser=series[i];var compiled_brush=new AscFormat.CUniFill;compiled_brush.merge(base_fills[ser.idx]);if(ser.spPr&&ser.spPr.Fill)compiled_brush.merge(ser.spPr.Fill);ser.compiledSeriesBrush=compiled_brush;ser.compiledSeriesBrush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);var pts=AscFormat.getPtsFromSeries(ser); for(var j=0;j<pts.length;++j){pts[j].brush=ser.compiledSeriesBrush;if(Array.isArray(ser.dPt)&&!(ser.getObjectType&&ser.getObjectType()===AscDFH.historyitem_type_AreaSeries))for(var k=0;k<ser.dPt.length;++k)if(ser.dPt[k].idx===pts[j].idx){if(ser.dPt[k].spPr)if(ser.dPt[k].spPr.Fill&&ser.dPt[k].spPr.Fill.fill){pts[j].brush=ser.dPt[k].spPr.Fill.createDuplicate();pts[j].brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}break}}{default_line=new AscFormat.CLn; if(style.line1===EFFECT_NONE)default_line.w=0;else if(style.line1===EFFECT_SUBTLE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[0]);else if(style.line1===EFFECT_MODERATE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[1]);else if(style.line1===EFFECT_INTENSE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[2]);var base_line_fills;if(this.style===34)base_line_fills=getArrayFillsFromBase(style.line2,getMaxIdx(pts));var compiled_line=new AscFormat.CLn; compiled_line.merge(default_line);compiled_line.Fill=new AscFormat.CUniFill;if(this.style!==34)compiled_line.Fill.merge(style.line2[0]);else compiled_line.Fill.merge(base_line_fills[ser.idx]);if(ser.spPr&&ser.spPr.ln)compiled_line.merge(ser.spPr.ln);ser.compiledSeriesPen=compiled_line;ser.compiledSeriesPen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);for(var j=0;j<pts.length;++j){if(Array.isArray(ser.dPt)&&!(ser.getObjectType&&ser.getObjectType()===AscDFH.historyitem_type_AreaSeries))for(var k= 0;k<ser.dPt.length;++k)if(ser.dPt[k].idx===pts[j].idx){if(ser.dPt[k].spPr){compiled_line=ser.compiledSeriesPen.createDuplicate();compiled_line.merge(ser.dPt[k].spPr.ln);pts[j].pen=compiled_line;pts[j].pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}break}if(pts[j].compiledMarker){pts[j].compiledMarker.pen&&pts[j].compiledMarker.pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);pts[j].compiledMarker.brush&&pts[j].compiledMarker.brush.calculate(parents.theme, parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}}}}}break}case AscDFH.historyitem_type_ScatterChart:{var base_line_fills=getArrayFillsFromBase(style.line4,nMaxSeriesIdx);for(var i=0;i<series.length;++i){var default_line=parents.theme.themeElements.fmtScheme.lnStyleLst[0];var ser=series[i];var pts=AscFormat.getPtsFromSeries(ser);this.ptsCount+=pts.length;if(oChart.scatterStyle===AscFormat.SCATTER_STYLE_SMOOTH||oChart.scatterStyle===AscFormat.SCATTER_STYLE_SMOOTH_MARKER)if(!AscFormat.isRealBool(ser.smooth))ser.smooth= true;if(oChart.scatterStyle===AscFormat.SCATTER_STYLE_MARKER||oChart.scatterStyle===AscFormat.SCATTER_STYLE_NONE){default_line=new AscFormat.CLn;default_line.setFill(new AscFormat.CUniFill);default_line.Fill.setFill(new AscFormat.CNoFill)}var compiled_line=new AscFormat.CLn;compiled_line.merge(default_line);if(!(oChart.scatterStyle===AscFormat.SCATTER_STYLE_MARKER||oChart.scatterStyle===AscFormat.SCATTER_STYLE_NONE))compiled_line.Fill&&compiled_line.Fill.merge(base_line_fills[ser.idx]);compiled_line.w*= style.line3;if(ser.spPr&&ser.spPr.ln)compiled_line.merge(ser.spPr.ln);ser.compiledSeriesPen=compiled_line;for(var j=0;j<pts.length;++j){pts[j].brush=null;pts[j].pen=ser.compiledSeriesPen;if(Array.isArray(ser.dPt))for(var k=0;k<ser.dPt.length;++k)if(ser.dPt[k].idx===pts[j].idx){if(ser.dPt[k].spPr){pts[j].pen=ser.compiledSeriesPen.createDuplicate();pts[j].pen.merge(ser.dPt[k].spPr.ln);pts[j].pen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr)}break}}}break}case AscDFH.historyitem_type_SurfaceChart:{var oSurfaceChart= oChart;var aValAxArray=this.getValAxisValues();var nFmtsCount=aValAxArray.length-1;var oSpPr,oBandFmt,oCompiledBandFmt;oSurfaceChart.compiledBandFormats.length=0;var multiplier;var axis_by_types=oSurfaceChart.getAxisByTypes();var val_ax=axis_by_types.valAx[0];if(val_ax.dispUnits)multiplier=val_ax.dispUnits.getMultiplier();else multiplier=1;var num_fmt=val_ax.numFmt,num_format=null,calc_value,rich_value;if(num_fmt&&typeof num_fmt.formatCode==="string")num_format=oNumFormatCache.get(num_fmt.formatCode); var oParentObjects=this.getParentObjects();var RGBA={R:255,G:255,B:255,A:255};if(oSurfaceChart.isWireframe()){var base_line_fills=getArrayFillsFromBase(style.line4,nFmtsCount);var default_line=parents.theme.themeElements.fmtScheme.lnStyleLst[0];for(var i=0;i<nFmtsCount;++i){oBandFmt=oSurfaceChart.getBandFmtByIndex(i);oSpPr=new AscFormat.CSpPr;oSpPr.setFill(AscFormat.CreateNoFillUniFill());var compiled_line=new AscFormat.CLn;compiled_line.merge(default_line);compiled_line.Fill.merge(base_line_fills[i]); compiled_line.Join=new AscFormat.LineJoin;compiled_line.Join.type=AscFormat.LineJoinType.Bevel;if(oBandFmt&&oBandFmt.spPr)compiled_line.merge(oBandFmt.spPr.ln);compiled_line.calculate(oParentObjects.theme,oParentObjects.slide,oParentObjects.layout,oParentObjects.master,RGBA,this.clrMapOvr);oSpPr.setLn(compiled_line);oCompiledBandFmt=new AscFormat.CBandFmt;oCompiledBandFmt.setIdx(i);oCompiledBandFmt.setSpPr(oSpPr);if(num_format){oCompiledBandFmt.startValue=num_format.formatToChart(aValAxArray[i]*multiplier); oCompiledBandFmt.endValue=num_format.formatToChart(aValAxArray[i+1]*multiplier)}else{oCompiledBandFmt.startValue=""+aValAxArray[i]*multiplier;oCompiledBandFmt.endValue=""+aValAxArray[i+1]*multiplier}oCompiledBandFmt.setSpPr(oSpPr);oSurfaceChart.compiledBandFormats.push(oCompiledBandFmt)}}else{var base_fills=getArrayFillsFromBase(style.fill2,nFmtsCount);var base_line_fills=null;if(style.line1===EFFECT_SUBTLE&&this.style===34)base_line_fills=getArrayFillsFromBase(style.line2,nFmtsCount);var default_line= new AscFormat.CLn;if(style.line1===EFFECT_NONE)default_line.w=0;else if(style.line1===EFFECT_SUBTLE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[0]);else if(style.line1===EFFECT_MODERATE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[1]);else if(style.line1===EFFECT_INTENSE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[2]);for(var i=0;i<nFmtsCount;++i){oBandFmt=oSurfaceChart.getBandFmtByIndex(i);var compiled_brush=new AscFormat.CUniFill; oSpPr=new AscFormat.CSpPr;compiled_brush.merge(base_fills[i]);if(oBandFmt&&oBandFmt.spPr)compiled_brush.merge(oBandFmt.spPr.Fill);oSpPr.setFill(compiled_brush);var compiled_line=new AscFormat.CLn;compiled_line.merge(default_line);compiled_line.Fill=new AscFormat.CUniFill;if(this.style!==34)compiled_line.Fill.merge(style.line2[0]);else compiled_line.Fill.merge(base_line_fills[i]);if(oBandFmt&&oBandFmt.spPr&&oBandFmt.spPr.ln)compiled_line.merge(oBandFmt.spPr.ln);oSpPr.setLn(compiled_line);compiled_line.calculate(oParentObjects.theme, oParentObjects.slide,oParentObjects.layout,oParentObjects.master,RGBA,this.clrMapOvr);compiled_brush.calculate(oParentObjects.theme,oParentObjects.slide,oParentObjects.layout,oParentObjects.master,RGBA,this.clrMapOvr);oCompiledBandFmt=new AscFormat.CBandFmt;oCompiledBandFmt.setIdx(i);oCompiledBandFmt.setSpPr(oSpPr);if(num_format){oCompiledBandFmt.startValue=num_format.formatToChart(aValAxArray[i]*multiplier);oCompiledBandFmt.endValue=num_format.formatToChart(aValAxArray[i+1]*multiplier)}else{oCompiledBandFmt.startValue= ""+aValAxArray[i]*multiplier;oCompiledBandFmt.endValue=""+aValAxArray[i+1]*multiplier}oSurfaceChart.compiledBandFormats.push(oCompiledBandFmt)}}break}default:{var base_fills=getArrayFillsFromBase(style.fill2,nMaxSeriesIdx);var base_line_fills=null;if(style.line1===EFFECT_SUBTLE&&this.style===34)base_line_fills=getArrayFillsFromBase(style.line2,nMaxSeriesIdx);for(var i=0;i<series.length;++i){var ser=series[i];var compiled_brush=new AscFormat.CUniFill;compiled_brush.merge(base_fills[ser.idx]);if(ser.spPr&& ser.spPr.Fill)compiled_brush.merge(ser.spPr.Fill);ser.compiledSeriesBrush=compiled_brush.createDuplicate();var pts=AscFormat.getPtsFromSeries(ser);this.ptsCount+=pts.length;for(var j=0;j<pts.length;++j){pts[j].brush=ser.compiledSeriesBrush;if(Array.isArray(ser.dPt)&&!(ser.getObjectType&&ser.getObjectType()===AscDFH.historyitem_type_AreaSeries))for(var k=0;k<ser.dPt.length;++k)if(ser.dPt[k].idx===pts[j].idx){if(ser.dPt[k].spPr)if(ser.dPt[k].spPr.Fill&&ser.dPt[k].spPr.Fill.fill){compiled_brush=ser.dPt[k].spPr.Fill.createDuplicate(); pts[j].brush=compiled_brush}break}}{default_line=new AscFormat.CLn;if(style.line1===EFFECT_NONE)default_line.w=0;else if(style.line1===EFFECT_SUBTLE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[0]);else if(style.line1===EFFECT_MODERATE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[1]);else if(style.line1===EFFECT_INTENSE)default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[2]);var base_line_fills;if(this.style===34)base_line_fills=getArrayFillsFromBase(style.line2, getMaxIdx(pts));var compiled_line=new AscFormat.CLn;compiled_line.merge(default_line);compiled_line.Fill=new AscFormat.CUniFill;if(this.style!==34)compiled_line.Fill.merge(style.line2[0]);else compiled_line.Fill.merge(base_line_fills[ser.idx]);if(ser.spPr&&ser.spPr.ln)compiled_line.merge(ser.spPr.ln);ser.compiledSeriesPen=compiled_line.createDuplicate();ser.compiledSeriesPen.calculate(parents.theme,parents.slide,parents.layout,parents.master,RGBA,this.clrMapOvr);for(var j=0;j<pts.length;++j){pts[j].pen= ser.compiledSeriesPen;if(Array.isArray(ser.dPt)&&!(ser.getObjectType&&ser.getObjectType()===AscDFH.historyitem_type_AreaSeries))for(var k=0;k<ser.dPt.length;++k)if(ser.dPt[k].idx===pts[j].idx){if(ser.dPt[k].spPr){compiled_line=ser.compiledSeriesPen.createDuplicate();compiled_line.merge(ser.dPt[k].spPr.ln);pts[j].pen=compiled_line}break}}}}break}}}}};CChartSpace.prototype.recalculateChartTitleEditMode=function(bWord){var old_pos_x,old_pos_y,old_pos_cx,old_pos_cy;var pos_x,pos_y;old_pos_x=this.recalcInfo.recalcTitle.x; old_pos_y=this.recalcInfo.recalcTitle.y;old_pos_cx=this.recalcInfo.recalcTitle.x+this.recalcInfo.recalcTitle.extX/2;old_pos_cy=this.recalcInfo.recalcTitle.y+this.recalcInfo.recalcTitle.extY/2;this.cachedCanvas=null;this.recalculateAxisLabels();this.recalculateDLbls();var oDlbl=this.getCompiledDlblBySelect();if(oDlbl&&this.selection.textSelection instanceof AscFormat.CDLbl)this.selection.textSelection=oDlbl;if(checkVerticalTitle(this.recalcInfo.recalcTitle)){pos_x=old_pos_x;pos_y=old_pos_cy-this.recalcInfo.recalcTitle.extY/ 2}else{pos_x=old_pos_cx-this.recalcInfo.recalcTitle.extX/2;pos_y=old_pos_y}this.recalcInfo.recalcTitle.setPosition(pos_x,pos_y);if(bWord)this.recalcInfo.recalcTitle.updatePosition(this.posX,this.posY)};CChartSpace.prototype.recalculateMarkers=function(){if(this.chart&&this.chart.plotArea){var aCharts=this.chart.plotArea.charts;var oCurChart;var aAllsSeries=[];for(var t=0;t<aCharts.length;++t){oCurChart=aCharts[t];var series=oCurChart.series,pts;aAllsSeries=aAllsSeries.concat(series);for(var i=0;i< series.length;++i){var ser=series[i];ser.compiledSeriesMarker=null;pts=AscFormat.getPtsFromSeries(ser);for(var j=0;j<pts.length;++j)pts[j].compiledMarker=null}var oThis=this;var recalculateMarkers2=function(){var chart_style=CHART_STYLE_MANAGER.getStyleByIndex(oThis.style);var effect_fill=chart_style.fill1;var fill=chart_style.fill2;var line=chart_style.line4;var masrker_default_size=AscFormat.isRealNumber(oThis.style)?chart_style.markerSize:5;var default_marker=new AscFormat.CMarker;default_marker.setSize(masrker_default_size); var parent_objects=oThis.getParentObjects();if(parent_objects.theme&&parent_objects.theme.themeElements&&parent_objects.theme.themeElements.fmtScheme&&parent_objects.theme.themeElements.fmtScheme.lnStyleLst){default_marker.setSpPr(new AscFormat.CSpPr);default_marker.spPr.setLn(new AscFormat.CLn);default_marker.spPr.ln.merge(parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0])}var RGBA={R:0,G:0,B:0,A:255};if(oCurChart.varyColors&&(oCurChart.series.length===1||oCurChart.getObjectType()===AscDFH.historyitem_type_PieChart|| oCurChart.getObjectType()===AscDFH.historyitem_type_DoughnutChart)){if(oCurChart.series.length<1)return;var ser=oCurChart.series[0],pts;if(ser.marker&&ser.marker.symbol===AscFormat.SYMBOL_NONE&&(!Array.isArray(ser.dPt)||ser.dPt.length===0))return;pts=AscFormat.getPtsFromSeries(ser);var series_marker=ser.marker;var brushes=getArrayFillsFromBase(fill,getMaxIdx(pts));for(var i=0;i<pts.length;++i){var d_pt=null;if(Array.isArray(ser.dPt))for(var j=0;j<ser.dPt.length;++j)if(ser.dPt[j].idx===pts[i].idx){d_pt= ser.dPt[j];break}var d_pt_marker=null;if(d_pt)d_pt_marker=d_pt.marker;var symbol=GetTypeMarkerByIndex(i);if(series_marker&&AscFormat.isRealNumber(series_marker.symbol))symbol=series_marker.symbol;if(d_pt_marker&&AscFormat.isRealNumber(d_pt_marker.symbol))symbol=d_pt_marker.symbol;var compiled_marker=new AscFormat.CMarker;compiled_marker.merge(default_marker);if(!compiled_marker.spPr)compiled_marker.setSpPr(new AscFormat.CSpPr);compiled_marker.setSymbol(symbol);if(!checkNoFillMarkers(symbol))compiled_marker.spPr.setFill(brushes[pts[i].idx]); else compiled_marker.spPr.setFill(AscFormat.CreateNoFillUniFill());compiled_marker.spPr.Fill.merge(pts[i].brush);if(!compiled_marker.spPr.ln)compiled_marker.spPr.setLn(new AscFormat.CLn);compiled_marker.spPr.ln.merge(pts[i].pen);compiled_marker.merge(series_marker);if(d_pt){if(d_pt.spPr){if(d_pt.spPr.Fill)compiled_marker.spPr.setFill(d_pt.spPr.Fill.createDuplicate());if(d_pt.spPr.ln){if(!compiled_marker.spPr.ln)compiled_marker.spPr.setLn(new AscFormat.CLn);compiled_marker.spPr.ln.merge(d_pt.spPr.ln)}}compiled_marker.merge(d_pt.marker)}pts[i].compiledMarker= compiled_marker;pts[i].compiledMarker.pen=compiled_marker.spPr.ln;pts[i].compiledMarker.brush=compiled_marker.spPr.Fill;pts[i].compiledMarker.brush.calculate(parent_objects.theme,parent_objects.slide,parent_objects.layout,parent_objects.master,RGBA,oThis.clrMapOvr);pts[i].compiledMarker.pen.calculate(parent_objects.theme,parent_objects.slide,parent_objects.layout,parent_objects.master,RGBA,oThis.clrMapOvr)}}else{var series=oCurChart.series;var brushes=getArrayFillsFromBase(fill,getMaxIdx(aAllsSeries)); var pens_fills=getArrayFillsFromBase(line,getMaxIdx(aAllsSeries));for(var i=0;i<series.length;++i){var ser=series[i];if(ser.marker&&ser.marker.symbol===AscFormat.SYMBOL_NONE&&(!Array.isArray(ser.dPt)||ser.dPt.length===0))continue;var compiled_marker=new AscFormat.CMarker;var symbol;if(ser.marker&&AscFormat.isRealNumber(ser.marker.symbol))symbol=ser.marker.symbol;else symbol=GetTypeMarkerByIndex(ser.idx);compiled_marker.merge(default_marker);if(!compiled_marker.spPr)compiled_marker.setSpPr(new AscFormat.CSpPr); compiled_marker.setSymbol(symbol);if(!checkNoFillMarkers(compiled_marker.symbol))compiled_marker.spPr.setFill(brushes[ser.idx]);else compiled_marker.spPr.setFill(AscFormat.CreateNoFillUniFill());if(!compiled_marker.spPr.ln)compiled_marker.spPr.setLn(new AscFormat.CLn);compiled_marker.spPr.ln.setFill(pens_fills[ser.idx]);compiled_marker.merge(ser.marker);ser.compiledSeriesMarker=compiled_marker.createDuplicate();ser.compiledSeriesMarker.pen=compiled_marker.spPr.ln;ser.compiledSeriesMarker.brush=compiled_marker.spPr.Fill; ser.compiledSeriesMarker.brush.calculate(parent_objects.theme,parent_objects.slide,parent_objects.layout,parent_objects.master,RGBA,oThis.clrMapOvr);ser.compiledSeriesMarker.pen.calculate(parent_objects.theme,parent_objects.slide,parent_objects.layout,parent_objects.master,RGBA,oThis.clrMapOvr);pts=AscFormat.getPtsFromSeries(ser);for(var j=0;j<pts.length;++j){var d_pt=null;if(Array.isArray(ser.dPt))for(var k=0;k<ser.dPt.length;++k)if(ser.dPt[k].idx===pts[j].idx){d_pt=ser.dPt[k];break}if(d_pt){compiled_marker= ser.compiledSeriesMarker.createDuplicate();compiled_marker.merge(d_pt.marker);compiled_marker.pen=compiled_marker.spPr.ln;compiled_marker.brush=compiled_marker.spPr.Fill;compiled_marker.brush.calculate(parent_objects.theme,parent_objects.slide,parent_objects.layout,parent_objects.master,RGBA,oThis.clrMapOvr);compiled_marker.pen.calculate(parent_objects.theme,parent_objects.slide,parent_objects.layout,parent_objects.master,RGBA,oThis.clrMapOvr);pts[j].compiledMarker=compiled_marker}else pts[j].compiledMarker= ser.compiledSeriesMarker}}}};switch(oCurChart.getObjectType()){case AscDFH.historyitem_type_LineChart:case AscDFH.historyitem_type_RadarChart:{if(oCurChart.marker!==false)recalculateMarkers2();break}case AscDFH.historyitem_type_ScatterChart:{if(oCurChart.scatterStyle===AscFormat.SCATTER_STYLE_MARKER||oCurChart.scatterStyle===AscFormat.SCATTER_STYLE_LINE_MARKER||oCurChart.scatterStyle===AscFormat.SCATTER_STYLE_SMOOTH_MARKER)recalculateMarkers2();break}default:{recalculateMarkers2();break}}}}};CChartSpace.prototype.calcGridLine= function(defaultStyle,spPr,subtleLine,parents){if(spPr){var compiled_grid_lines=new AscFormat.CLn;compiled_grid_lines.merge(subtleLine);if(!compiled_grid_lines.Fill)compiled_grid_lines.setFill(new AscFormat.CUniFill);compiled_grid_lines.Fill.merge(defaultStyle);if(subtleLine&&subtleLine.Fill&&subtleLine.Fill.fill&&subtleLine.Fill.fill.color&&subtleLine.Fill.fill.color.Mods&&compiled_grid_lines.Fill&&compiled_grid_lines.Fill.fill&&compiled_grid_lines.Fill.fill.color)compiled_grid_lines.Fill.fill.color.Mods= subtleLine.Fill.fill.color.Mods.createDuplicate();compiled_grid_lines.merge(spPr.ln);compiled_grid_lines.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255},this.clrMapOvr);checkBlackUnifill(compiled_grid_lines.Fill,true);return compiled_grid_lines}return null};CChartSpace.prototype.calcMajorMinorGridLines=function(axis,defaultStyle,subtleLine,parents){if(!axis)return;axis.compiledMajorGridLines=this.calcGridLine(defaultStyle.axisAndMajorGridLines,axis.majorGridlines, subtleLine,parents);axis.compiledMinorGridLines=this.calcGridLine(defaultStyle.minorGridlines,axis.minorGridlines,subtleLine,parents)};CChartSpace.prototype.handleTitlesAfterChangeTheme=function(){if(this.chart&&this.chart.title)this.chart.title.checkAfterChangeTheme();if(this.chart&&this.chart.plotArea){var hor_axis=this.chart.plotArea.getHorizontalAxis();if(hor_axis&&hor_axis.title)hor_axis.title.checkAfterChangeTheme();var vert_axis=this.chart.plotArea.getVerticalAxis();if(vert_axis&&vert_axis.title)vert_axis.title.checkAfterChangeTheme()}}; CChartSpace.prototype.recalculateGridLines=function(){if(this.chart&&this.chart.plotArea){var default_style=CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.style);var parent_objects=this.getParentObjects();var subtle_line;if(parent_objects.theme&&parent_objects.theme.themeElements&&parent_objects.theme.themeElements.fmtScheme&&parent_objects.theme.themeElements.fmtScheme.lnStyleLst)subtle_line=parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0];var aAxes=this.chart.plotArea.axId;for(var i= 0;i<aAxes.length;++i){var oCurAxis=aAxes[i];this.calcMajorMinorGridLines(oCurAxis,default_style,subtle_line,parent_objects);this.calcMajorMinorGridLines(oCurAxis,default_style,subtle_line,parent_objects)}}};CChartSpace.prototype.recalculateAxisLabels=function(){if(this.chart&&this.chart.title){var title=this.chart.title;title.chart=this;title.recalculate()}if(this.chart&&this.chart.plotArea){var aAxis=this.chart.plotArea.axId;for(var i=0;i<aAxis.length;++i){var title=aAxis[i].title;if(title){title.chart= this;title.recalculate()}}}};CChartSpace.prototype.updateLinks=function(){if(this.chart&&this.chart.plotArea){var oCheckChart;var oPlotArea=this.chart.plotArea;var aCharts=oPlotArea.charts;this.chart.plotArea.chart=aCharts[0];for(var i=0;i<aCharts.length;++i)if(aCharts[i].getObjectType()!==AscDFH.historyitem_type_PieChart&&aCharts[i].getObjectType()!==AscDFH.historyitem_type_DoughnutChart){oCheckChart=aCharts[i];break}if(oCheckChart){this.chart.plotArea.chart=oCheckChart;this.chart.plotArea.serAx= null;if(oCheckChart.getAxisByTypes){var axis_by_types=oCheckChart.getAxisByTypes();if(axis_by_types.valAx.length>0&&axis_by_types.catAx.length>0){for(var i=0;i<axis_by_types.valAx.length;++i)if(axis_by_types.valAx[i].crossAx){for(var j=0;j<axis_by_types.catAx.length;++j)if(axis_by_types.catAx[j]===axis_by_types.valAx[i].crossAx){this.chart.plotArea.valAx=axis_by_types.valAx[i];this.chart.plotArea.catAx=axis_by_types.catAx[j];break}if(j<axis_by_types.catAx.length)break}if(i===axis_by_types.valAx.length){this.chart.plotArea.valAx= axis_by_types.valAx[0];this.chart.plotArea.catAx=axis_by_types.catAx[0]}if(this.chart.plotArea.valAx&&this.chart.plotArea.catAx)for(i=0;i<axis_by_types.serAx.length;++i)if(axis_by_types.serAx[i].crossAx===this.chart.plotArea.valAx){this.chart.plotArea.serAx=axis_by_types.serAx[i];break}}else if(axis_by_types.valAx.length>1){this.chart.plotArea.valAx=axis_by_types.valAx[1];this.chart.plotArea.catAx=axis_by_types.valAx[0]}}else{this.chart.plotArea.valAx=null;this.chart.plotArea.catAx=null}}}};CChartSpace.prototype.checkDrawingCache= function(graphics){if(window["NATIVE_EDITOR_ENJINE"]||graphics.RENDERER_PDF_FLAG||this.isSparkline)return false;if(graphics.IsSlideBoundsCheckerType)return false;if(!this.transform.IsIdentity2())return false;var dBorderW=this.getBorderWidth();var dWidth=this.extX+2*dBorderW;var dHeight=this.extY+2*dBorderW;var nWidth=graphics.m_oCoordTransform.sx*dWidth+.5>>0;var nHeight=graphics.m_oCoordTransform.sy*dHeight+.5>>0;if(nWidth===0||nHeight===0)return false;if(this.cachedCanvas)if(this.cachedCanvas.width!== nWidth||this.cachedCanvas.height!==nHeight)this.cachedCanvas=null;var ctx;if(!this.cachedCanvas){var aImages=[];this.getAllRasterImages(aImages);var oApi=window["Asc"]["editor"]||editor;if(oApi&&oApi.ImageLoader)for(var i=0;i<aImages.length;++i){var _image=oApi.ImageLoader.map_image_index[AscCommon.getFullImageSrc2(aImages[i])];if(_image!=undefined&&_image.Image!=null&&_image.Status===window["AscFonts"].ImageLoadStatus.Loading)return false}this.cachedCanvas=document.createElement("canvas");this.cachedCanvas.width= nWidth;this.cachedCanvas.height=nHeight;ctx=this.cachedCanvas.getContext("2d");var g=new AscCommon.CGraphics;g.init(ctx,nWidth,nHeight,nWidth/graphics.m_oCoordTransform.sx,nHeight/graphics.m_oCoordTransform.sy);g.m_oFontManager=AscCommon.g_fontManager;g.m_oCoordTransform.tx=-((this.transform.tx-dBorderW)*graphics.m_oCoordTransform.sx+.5)>>0;g.m_oCoordTransform.ty=-((this.transform.ty-dBorderW)*graphics.m_oCoordTransform.sy+.5)>>0;g.transform(1,0,0,1,0,0);this.drawInternal(g)}var _x1=graphics.m_oCoordTransform.TransformPointX(this.transform.tx- dBorderW,this.transform.ty-dBorderW)+.5>>0;var _y1=graphics.m_oCoordTransform.TransformPointY(this.transform.tx-dBorderW,this.transform.ty-dBorderW)+.5>>0;graphics.SaveGrState();graphics.SetIntegerGrid(true);graphics.m_oContext.drawImage(this.cachedCanvas,_x1,_y1,nWidth,nHeight);graphics.RestoreGrState();graphics.FreeFont();return true};CChartSpace.prototype.getBorderWidth=function(){var ln_width;if(this.pen&&AscFormat.isRealNumber(this.pen.w))ln_width=this.pen.w/36E3;else ln_width=0;return ln_width}; CChartSpace.prototype.drawInternal=function(graphics){var oClipRect=this.getClipRect();if(oClipRect){graphics.SaveGrState();graphics.AddClipRect(oClipRect.x,oClipRect.y,oClipRect.w,oClipRect.h)}graphics.SaveGrState();graphics.SetIntegerGrid(false);graphics.transform3(this.transform,false);var ln_width=this.getBorderWidth();graphics.AddClipRect(-ln_width,-ln_width,this.extX+2*ln_width,this.extY+2*ln_width);if(this.chartObj)this.chartObj.draw(this,graphics);if(this.chart&&!this.bEmptySeries){if(this.chart.plotArea){var aCharts= this.chart.plotArea.charts;for(var t=0;t<aCharts.length;++t){var oChart=aCharts[t];if(oChart&&oChart.series){var series=oChart.series;var _len=oChart.getObjectType()===AscDFH.historyitem_type_PieChart?1:series.length;for(var i=0;i<_len;++i){var ser=series[i];var pts=AscFormat.getPtsFromSeries(ser);for(var j=0;j<pts.length;++j)if(pts[j].compiledDlb)pts[j].compiledDlb.draw(graphics)}}}for(var i=0;i<this.chart.plotArea.axId.length;++i){var oAxis=this.chart.plotArea.axId[i];if(oAxis.title)oAxis.title.draw(graphics); if(oAxis.labels)oAxis.labels.draw(graphics)}}if(this.chart.title)this.chart.title.draw(graphics);if(this.chart.legend)this.chart.legend.draw(graphics)}for(var i=0;i<this.userShapes.length;++i)if(this.userShapes[i].object)this.userShapes[i].object.draw(graphics);graphics.RestoreGrState();if(oClipRect)graphics.RestoreGrState()};CChartSpace.prototype.draw=function(graphics){if(this.checkNeedRecalculate&&this.checkNeedRecalculate())return;if(graphics.IsSlideBoundsCheckerType){graphics.transform3(this.transform); graphics._s();graphics._m(0,0);graphics._l(this.extX,0);graphics._l(this.extX,this.extY);graphics._l(0,this.extY);graphics._e();return}var oUR=graphics.updatedRect;if(oUR&&this.bounds)if(!oUR.isIntersectOther(this.bounds))return;var oldShowParaMarks;if(editor){oldShowParaMarks=editor.ShowParaMarks;editor.ShowParaMarks=false}if(!this.checkDrawingCache(graphics))this.drawInternal(graphics);if(editor)editor.ShowParaMarks=oldShowParaMarks;if(this.drawLocks(this.transform,graphics))graphics.RestoreGrState()}; CChartSpace.prototype.addToSetPosition=function(dLbl){if(dLbl instanceof AscFormat.CDLbl)this.recalcInfo.dataLbls.push(dLbl);else if(dLbl instanceof AscFormat.CTitle)this.recalcInfo.axisLabels.push(dLbl)};CChartSpace.prototype.recalculateChart=function(){this.pathMemory.curPos=-1;if(this.chartObj==null)this.chartObj=new AscFormat.CChartsDrawer;this.chartObj.recalculate(this);var oChartSize=this.getChartSizes(true);this.chart.plotArea.x=oChartSize.startX;this.chart.plotArea.y=oChartSize.startY;this.chart.plotArea.extX= oChartSize.w;this.chart.plotArea.extY=oChartSize.h;this.chart.plotArea.localTransform.Reset();AscCommon.global_MatrixTransformer.TranslateAppend(this.chart.plotArea.localTransform,oChartSize.startX,oChartSize.startY)};CChartSpace.prototype.GetRevisionsChangeElement=function(SearchEngine){var titles=this.getAllTitles(),i;if(titles.length===0)return;var oSelectedTitle=this.selection.title||this.selection.textSelection;if(oSelectedTitle){for(i=0;i<titles.length;++i)if(oSelectedTitle===titles[i])break; if(i===titles.length)return}else if(SearchEngine.GetDirection()>0)i=0;else i=titles.length-1;while(!SearchEngine.IsFound()){titles[i].GetRevisionsChangeElement(SearchEngine);if(SearchEngine.GetDirection()>0){if(i===titles.length-1)break;++i}else{if(i===0)break;--i}}};CChartSpace.prototype.Search=function(Str,Props,SearchEngine,Type){var titles=this.getAllTitles();for(var i=0;i<titles.length;++i)titles[i].Search(Str,Props,SearchEngine,Type)};CChartSpace.prototype.GetSearchElementId=function(bNext, bCurrent){var Current=-1;var titles=this.getAllTitles();var Len=titles.length;var Id=null;if(true===bCurrent)for(var i=0;i<Len;++i)if(titles[i]===this.selection.textSelection){Current=i;break}if(true===bNext){var Start=-1!==Current?Current:0;for(var i=Start;i<Len;i++)if(titles[i].GetSearchElementId){Id=titles[i].GetSearchElementId(true,i===Current?true:false);if(null!==Id)return Id}}else{var Start=-1!==Current?Current:Len-1;for(var i=Start;i>=0;i--)if(titles[i].GetSearchElementId){Id=titles[i].GetSearchElementId(false, i===Current?true:false);if(null!==Id)return Id}}return null};CChartSpace.prototype.isAccent1Background=function(){return this.spPr&&this.spPr.Fill&&this.spPr.Fill.isAccent1()};CChartSpace.prototype.addNewSeries=function(){var oLastChart=this.chart.plotArea.charts[this.chart.plotArea.charts.length-1];if(!oLastChart)return null;if(oLastChart.getObjectType()===AscDFH.historyitem_type_ScatterChart)return this.addScatterSeries(null,null,"={1}");else return this.addSeries(null,"={1}")};CChartSpace.prototype.setNewSeriesIdxAndOrder= function(oSeries){var aAllSeries=this.getAllSeries();var nSeries;var oFirstSeries=aAllSeries[0];var nIdx=0,nOrder=0;if(aAllSeries.length>0){if(oFirstSeries.idx>0)nIdx=0;else{var oCurSeries,oNextSeries;for(nSeries=0;nSeries<aAllSeries.length-1;++nSeries){oCurSeries=aAllSeries[nSeries];oNextSeries=aAllSeries[nSeries+1];if(oNextSeries.idx-oCurSeries.idx>1){nIdx=oCurSeries.idx+1;break}}if(nSeries===aAllSeries.length-1)nIdx=aAllSeries[aAllSeries.length-1].idx+1}aAllSeries.sort(function(a,b){return a.order- b.order});nOrder=aAllSeries[aAllSeries.length-1].order+1}oSeries.setIdx(nIdx);oSeries.setOrder(nOrder)};CChartSpace.prototype.addSeries=function(sName,sValues){var oLastChart=this.chart.plotArea.charts[this.chart.plotArea.charts.length-1];if(!oLastChart)return null;History.Create_NewPoint(0);var bAccent1Background=this.isAccent1Background();var aAllSeries=this.getAllSeries();var oFirstSeries=aAllSeries[0];var oFirstSpPrPreset=0;if(oFirstSeries&&oFirstSeries.idx===0)oFirstSpPrPreset=oFirstSeries.getSpPrPreset(); var oSeries;oSeries=oLastChart.series[0]?oLastChart.series[0].createDuplicate():oLastChart.getSeriesConstructor();oSeries.setName(sName);oSeries.setValues(sValues);this.setNewSeriesIdxAndOrder(oSeries);oLastChart.addSer(oSeries);this.reorderSeries();var oStyle,aBaseFills,aPts,nPt;if(oSeries.spPr)oSeries.setSpPr(null);if(oFirstSpPrPreset){oStyle=AscFormat.CHART_STYLE_MANAGER.getStyleByIndex(this.style);if(oSeries.getObjectType()===AscDFH.historyitem_type_PieSeries){aPts=AscFormat.getPtsFromSeries(oSeries); aBaseFills=AscFormat.getArrayFillsFromBase(oStyle.fill2,aPts.length);for(nPt=0;nPt<aPts.length;++nPt){var oDPt=new AscFormat.CDPt;oDPt.setBubble3D(false);oDPt.setIdx(nPt);AscFormat.ApplySpPr(oFirstSpPrPreset,oDPt,nPt,aBaseFills,bAccent1Background);oSeries.addDPt(oDPt)}}else{aBaseFills=AscFormat.getArrayFillsFromBase(oStyle.fill2,aAllSeries.length+1);AscFormat.ApplySpPr(oFirstSpPrPreset,oSeries,oSeries.idx,aBaseFills,bAccent1Background)}}return oSeries};CChartSpace.prototype.addScatterSeries=function(sName, sXValues,sYValues){var oLastChart=this.chart.plotArea.charts[this.chart.plotArea.charts.length-1];if(!oLastChart||oLastChart.getObjectType()!==AscDFH.historyitem_type_ScatterChart)return;History.Create_NewPoint(0);var aAllSeries=this.getAllSeries();var oFirstSeries=aAllSeries[0];var bAccent1Background=this.isAccent1Background();var oFirstSpPrPreset=0;var oFirstSpPrMarkerPrst=0;if(oFirstSeries&&oFirstSeries.idx===0){oFirstSpPrPreset=oFirstSeries.getSpPrPreset();oFirstSpPrMarkerPrst=oFirstSeries.getMarkerPreset()}var oSeries; oSeries=oLastChart.series[0]?oLastChart.series[0].createDuplicate():oLastChart.getSeriesConstructor();oSeries.setName(sName);oSeries.setYValues(sYValues);oSeries.setXValues(sXValues);this.setNewSeriesIdxAndOrder(oSeries);oLastChart.addSer(oSeries);var oStyle,aBaseFills;oStyle=AscFormat.CHART_STYLE_MANAGER.getStyleByIndex(this.style);aBaseFills=AscFormat.getArrayFillsFromBase(oStyle.fill2,aAllSeries.length+1);if(oSeries.spPr)oSeries.setSpPr(null);if(oFirstSpPrPreset)AscFormat.ApplySpPr(oFirstSpPrPreset, oSeries,oSeries.idx,aBaseFills,bAccent1Background);if(oSeries.marker){if(oSeries.marker.spPr)oSeries.marker.setSpPr(null);if(oFirstSpPrMarkerPrst)AscFormat.ApplySpPr(oFirstSpPrMarkerPrst,oSeries.marker,oSeries.idx,aBaseFills,bAccent1Background)}return oSeries};CChartSpace.prototype.checkTopBottomSeriesPlacement=function(oValBB,oCatBB,oTxBB,nOrder,oFirstVal){if(oValBB.r2-oValBB.r1>0)return false;if(oFirstVal)if(oValBB.r1-oFirstVal.r1!==nOrder)return false;if(oCatBB){if(oCatBB.r2-oCatBB.r1>0)return false; if(oCatBB.c1!==oValBB.c1||oCatBB.c2!==oValBB.c2)return false;if(oValBB.r1-oCatBB.r1!==nOrder+1)return false}if(oTxBB){if(oTxBB.c1!==oTxBB.c2||oTxBB.r1!==oTxBB.r2)return false;if(oTxBB.r1!==oValBB.r1)return false;if(oTxBB.c1!==oValBB.c1-1)return false}return true};CChartSpace.prototype.checkLeftRightSeriesPlacement=function(oValBB,oCatBB,oTxBB,nOrder,oFirstVal){if(oValBB.c2-oValBB.c1>0)return false;if(oFirstVal)if(oValBB.c1-oFirstVal.c1!==nOrder)return false;if(oCatBB){if(oCatBB.c2-oCatBB.c1>0)return false; if(oCatBB.r1!==oValBB.r1||oCatBB.r2!==oValBB.r2)return false;if(oValBB.c1-oCatBB.c1!==nOrder+1)return false}if(oTxBB){if(oTxBB.c1!==oTxBB.c2||oTxBB.r1!==oTxBB.r2)return false;if(oTxBB.c1!==oValBB.c1)return false;if(oTxBB.r1!==oValBB.r1-1)return false}return true};CChartSpace.prototype.getCommonBBoxInfo=function(){var aAllSeries=this.getAllSeries();if(aAllSeries.length===0)return null;aAllSeries.sort(function(a,b){return a.order-b.order});var oWorksheet,oFirstSeries,oCatBB,oValBB,oTxBB,nSeries,oSeries; oFirstSeries=aAllSeries[0];var oBBoxInfo=oFirstSeries.getBBoxInfo();if(oBBoxInfo===null)return null;oValBB=oBBoxInfo.val;oCatBB=oBBoxInfo.cat;oTxBB=oBBoxInfo.tx;oWorksheet=oBBoxInfo.ws;var r1,r2,c1,c2,oCatRange=null,oTxRange=null;if(!oCatBB&&!oTxBB&&oValBB.isOneCell())if(aAllSeries.length===1)return{bbox:new Asc.Range(oValBB.c1,oValBB.r1,oValBB.c2,oValBB.r2,false),worksheet:oWorksheet,val:new Asc.Range(oValBB.c1,oValBB.r1,oValBB.c2,oValBB.r2,false),cat:null,tx:null,tb:true};else{var oSecondSeries= aAllSeries[1];oBBoxInfo=oSecondSeries.getBBoxInfo();if(oBBoxInfo===null)return null;if(oBBoxInfo.ws!==oWorksheet)return null;if(oBBoxInfo.cat)return null;if(oBBoxInfo.tx)return null;if(!oBBoxInfo.val.isOneCell())return null;if(oBBoxInfo.val.r1===oValBB.r1+1){for(nSeries=2;nSeries<aAllSeries.length;++nSeries){oBBoxInfo=aAllSeries[nSeries].getBBoxInfo();if(oBBoxInfo===null)return null;if(oBBoxInfo.ws!==oWorksheet)return null;if(oBBoxInfo.cat)return null;if(oBBoxInfo.tx)return null;if(!oBBoxInfo.val.isOneCell())return null; if(oBBoxInfo.val.r1!==oValBB.r1+nSeries)return null}return{bbox:new Asc.Range(oValBB.c1,oValBB.r1,oValBB.c2,oValBB.r2+aAllSeries.length-1,false),worksheet:oWorksheet,val:new Asc.Range(oValBB.c1,oValBB.r1,oValBB.c2,oValBB.r2+aAllSeries.length-1,false),tx:null,cat:null,tb:true}}else if(oBBoxInfo.val.c1===oValBB.c1+1){for(nSeries=2;nSeries<aAllSeries.length;++nSeries){oBBoxInfo=aAllSeries[nSeries].getBBoxInfo();if(oBBoxInfo===null)return null;if(oBBoxInfo.ws!==oWorksheet)return null;if(oBBoxInfo.cat)return null; if(oBBoxInfo.tx)return null;if(!oBBoxInfo.val.isOneCell())return null;if(oBBoxInfo.val.c1!==oValBB.c1+nSeries)return null}return{bbox:new Asc.Range(oValBB.c1,oValBB.r1,oValBB.c2+aAllSeries.length-1,oValBB.r2,false),worksheet:oWorksheet,val:new Asc.Range(oValBB.c1,oValBB.r1,oValBB.c2+aAllSeries.length-1,oValBB.r2,false),tx:null,cat:null,tb:false}}else return null}else{var bTB=this.checkTopBottomSeriesPlacement(oValBB,oCatBB,oTxBB,oFirstSeries.order,oValBB);var bLR=false;if(!bTB)bLR=this.checkLeftRightSeriesPlacement(oValBB, oCatBB,oTxBB,oFirstSeries.order,oValBB);if(bTB||bLR){for(nSeries=1;nSeries<aAllSeries.length;++nSeries){oSeries=aAllSeries[nSeries];oBBoxInfo=oSeries.getBBoxInfo();if(!oBBoxInfo)return null;if(oWorksheet!==oBBoxInfo.ws)return null;if(oValBB&&!oBBoxInfo.val||oBBoxInfo.val&&!oValBB)return null;if(oCatBB&&!oBBoxInfo.cat||oBBoxInfo.cat&&!oCatBB)return null;if(oTxBB&&!oBBoxInfo.tx||oBBoxInfo.tx&&!oTxBB)return null;if(bTB){if(!this.checkTopBottomSeriesPlacement(oBBoxInfo.val,oBBoxInfo.cat,oBBoxInfo.tx, oSeries.order,oValBB))return null}else if(!this.checkLeftRightSeriesPlacement(oBBoxInfo.val,oBBoxInfo.cat,oBBoxInfo.tx,oSeries.order,oValBB))return null}if(bTB){if(oCatBB){r1=oCatBB.r1;oCatRange=new Asc.Range(oCatBB.c1,oCatBB.r1,oCatBB.c2,oCatBB.r2)}else r1=oValBB.r1;r2=oValBB.r1+aAllSeries.length-1;if(oTxBB){c1=oTxBB.c1;oTxRange=new Asc.Range(oTxBB.c1,oTxBB.r1,oTxBB.c1,oTxBB.r1+aAllSeries.length-1)}else c1=oValBB.c1;c2=oValBB.c2}else{if(oCatBB){c1=oCatBB.c1;oCatRange=new Asc.Range(oCatBB.c1,oCatBB.r1, oCatBB.c2,oCatBB.r2)}else c1=oValBB.c1;c2=oValBB.c1+aAllSeries.length-1;if(oTxBB){r1=oTxBB.r1;oTxRange=new Asc.Range(oTxBB.c1,oTxBB.r1,oTxBB.c1+aAllSeries.length-1,oTxBB.r1)}else r1=oValBB.r1;r2=oValBB.r2}return{bbox:new Asc.Range(c1,r1,c2,r2,false),val:new Asc.Range(oValBB.c1,oValBB.r1,c2,r2),cat:oCatRange,tx:oTxRange,worksheet:oWorksheet,tb:bTB}}else return null}return null};CChartSpace.prototype.getCommonRange=function(){var aAllSeries=this.getAllSeries();if(aAllSeries.length===0)return"";var sRes= AscFormat.fCreateRef(this.getCommonBBoxInfo());if(sRes)sRes="="+sRes;return sRes};CChartSpace.prototype.switchRowCol=function(){var oBBoxInfo=this.getCommonBBoxInfo();if(!oBBoxInfo)return Asc.c_oAscError.ID.No;var oPlotArea=this.chart.plotArea;var oFirstChart=oPlotArea.charts[0];if(!oFirstChart)return Asc.c_oAscError.ID.No;var nSeriesCount=0,nPtCount=0;var oValBB=oBBoxInfo.val;if(oBBoxInfo.tb){nSeriesCount=oValBB.c2-oValBB.c1+1;nPtCount=oValBB.r2-oValBB.r1+1}else{nSeriesCount=oValBB.r2-oValBB.r1+ 1;nPtCount=oValBB.c2-oValBB.c1+1}if(nSeriesCount>MAX_SERIES_COUNT)return Asc.c_oAscError.ID.MaxDataSeriesError;if(oPlotArea.charts.length>1)oPlotArea.removeCharts(1,oPlotArea.charts.length-1);var oFirstSeries=oFirstChart.series[0];var aOldSeries=[].concat(oFirstChart.series);oFirstChart.removeAllSeries();var bAccent1Background=this.isAccent1Background();var oFirstSpPrPreset=0;var oFirstSpPrMarkerPrst=0;if(oFirstSeries&&oFirstSeries.idx===0){oFirstSpPrPreset=oFirstSeries.getSpPrPreset();oFirstSpPrMarkerPrst= oFirstSeries.getMarkerPreset()}var nSeries,oSeries;var oRange,r1,r2,c1,c2,sValues,sTx,sCat;var oWorksheet=oBBoxInfo.worksheet;var nOldSeries,oOldSeries;var nMinStartIdx;if(oBBoxInfo.tb){nSeriesCount=oValBB.c2-oValBB.c1+1;nMinStartIdx=nSeriesCount;for(nSeries=0;nSeries<nSeriesCount;++nSeries){oSeries=null;for(nOldSeries=0;nOldSeries<aOldSeries.length;++nOldSeries){oOldSeries=aOldSeries[nOldSeries];if(oOldSeries.idx===nSeries){oSeries=oOldSeries.createDuplicate();break}}if(!oSeries){oSeries=oFirstSeries? oFirstSeries.createDuplicate():oFirstChart.getSeriesConstructor();oSeries.setSpPr(null);nMinStartIdx=Math.min(nSeries,nMinStartIdx)}r1=oValBB.r1;r2=oValBB.r2;c1=oValBB.c1+nSeries;c2=c1;oRange=new Asc.Range(c1,r1,c2,r2);sValues=AscFormat.fCreateRef({worksheet:oWorksheet,bbox:oRange});sTx=null;if(oBBoxInfo.cat){r1=oBBoxInfo.cat.r1;r2=r1;c1=oValBB.c1+nSeries;c2=c1;oRange=new Asc.Range(c1,r1,c2,r2);sTx=AscFormat.fCreateRef({worksheet:oWorksheet,bbox:oRange})}sCat=null;if(oBBoxInfo.tx){r1=oBBoxInfo.tx.r1; r2=oBBoxInfo.tx.r2;c1=oBBoxInfo.tx.c1;c2=oBBoxInfo.tx.c2;oRange=new Asc.Range(c1,r1,c2,r2);sCat=AscFormat.fCreateRef({worksheet:oWorksheet,bbox:oRange})}oSeries.setName(sTx);if(oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer){oSeries.setYValues(sValues);oSeries.setXValues(sCat)}else{oSeries.setValues(sValues);oSeries.setCategories(sCat)}oSeries.setIdx(nSeries);oSeries.setOrder(nSeries);oFirstChart.addSer(oSeries)}}else{nSeriesCount=oValBB.r2-oValBB.r1+1;nMinStartIdx=nSeriesCount;for(nSeries= 0;nSeries<nSeriesCount;++nSeries){oSeries=null;for(nOldSeries=0;nOldSeries<aOldSeries.length;++nOldSeries){oOldSeries=aOldSeries[nOldSeries];if(oOldSeries.idx===nSeries){oSeries=oOldSeries.createDuplicate();break}}if(!oSeries){oSeries=oFirstSeries?oFirstSeries.createDuplicate():oFirstChart.getSeriesConstructor();oSeries.setSpPr(null);nMinStartIdx=Math.min(nSeries,nMinStartIdx)}r1=oValBB.r1+nSeries;r2=r1;c1=oValBB.c1;c2=oValBB.c2;oRange=new Asc.Range(c1,r1,c2,r2);sValues=AscFormat.fCreateRef({worksheet:oWorksheet, bbox:oRange});sTx=null;if(oBBoxInfo.cat){r1=oBBoxInfo.cat.r1+nSeries;r2=r1;c1=oBBoxInfo.cat.c1;c2=c1;oRange=new Asc.Range(c1,r1,c2,r2);sTx=AscFormat.fCreateRef({worksheet:oWorksheet,bbox:oRange})}sCat=null;if(oBBoxInfo.tx){r1=oBBoxInfo.tx.r1;r2=oBBoxInfo.tx.r2;c1=oBBoxInfo.tx.c1;c2=oBBoxInfo.tx.c2;oRange=new Asc.Range(c1,r1,c2,r2);sCat=AscFormat.fCreateRef({worksheet:oWorksheet,bbox:oRange})}oSeries.setName(sTx);if(oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer){oSeries.setYValues(sValues); oSeries.setXValues(sCat)}else{oSeries.setValues(sValues);oSeries.setCategories(sCat)}oSeries.setIdx(nSeries);oSeries.setOrder(nSeries);oFirstChart.addSer(oSeries)}}nSeriesCount=oFirstChart.series.length;var oStyle,aBaseFills;oStyle=AscFormat.CHART_STYLE_MANAGER.getStyleByIndex(this.style);aBaseFills=AscFormat.getArrayFillsFromBase(oStyle.fill2,nSeriesCount);for(nSeries=nMinStartIdx;nSeries<nSeriesCount;++nSeries){oSeries=oFirstChart.series[nSeries];if(oFirstSpPrPreset){if(oSeries.getObjectType()!== AscDFH.historyitem_type_PieSeries){var oUniFill=AscFormat.CreateUnifillFromPreset(oFirstSpPrPreset[0],oSeries.idx,aBaseFills,bAccent1Background);if(oUniFill&&oUniFill.isSolidFillRGB())continue}AscFormat.ApplySpPr(oFirstSpPrPreset,oSeries,oSeries.idx,aBaseFills,bAccent1Background)}if(oFirstSpPrMarkerPrst&&oSeries.marker)AscFormat.ApplySpPr(oFirstSpPrMarkerPrst,oSeries.marker,oSeries.idx,aBaseFills,bAccent1Background)}this.recalculate();this.checkLegendLayoutSize();return Asc.c_oAscError.ID.No};CChartSpace.prototype.checkLegendLayoutSize= function(){var oChart=this.chart;if(!oChart)return;var oLegend=oChart.legend;if(oLegend){var oLayout=oLegend.layout;if(oLayout)if(AscFormat.isRealNumber(oLayout.w)||AscFormat.isRealNumber(oLayout.h)){oLegend.setLayout(null);this.recalcInfo.recalculateLegend=true;this.recalculate();if(AscFormat.isRealNumber(oLayout.w))oLayout.setW(this.calculateLayoutBySize(oLegend.x,oLayout.wMode,this.extX,oLegend.extX));if(AscFormat.isRealNumber(oLayout.h))oLayout.setH(this.calculateLayoutBySize(oLegend.y,oLayout.hMode, this.extY,oLegend.extY));oLegend.setLayout(oLayout);this.recalcInfo.recalculateLegend=true;this.recalculate()}}};CChartSpace.prototype.getCatFormula=function(){var aAllSeries=this.getAllSeries();var oFirstSeries=aAllSeries[0];if(oFirstSeries)if(oFirstSeries.cat)return oFirstSeries.cat.getFormula();return""};CChartSpace.prototype.setCatFormula=function(sFormula){var aAllSeries=this.getAllSeries();for(var i=0;i<aAllSeries.length;++i)aAllSeries[i].setCategories(sFormula)};CChartSpace.prototype.setRange= function(sRange){var oPlotArea=this.chart.plotArea;var oFirstChart;if(sRange===""){oPlotArea.removeCharts(1,oPlotArea.charts.length);oFirstChart=oPlotArea.charts[0];if(oFirstChart)oFirstChart.removeAllSeries();return}var sCheck=sRange;if(sRange[0]==="=")sCheck=sRange.slice(1);var aRanges=AscFormat.fParseChartFormula(sCheck);if(aRanges.length===0)return;oPlotArea.removeCharts(1,oPlotArea.charts.length);this.recalculateBBox();var catHeadersBBox,serHeadersBBox;if(this.bbox){if(this.bbox.catBBox)serHeadersBBox= {r1:this.bbox.catBBox.r1,r2:this.bbox.catBBox.r2,c1:this.bbox.catBBox.c1,c2:this.bbox.catBBox.c2};if(this.bbox.serBBox)catHeadersBBox={r1:this.bbox.serBBox.r1,r2:this.bbox.serBBox.r2,c1:this.bbox.serBBox.c1,c2:this.bbox.serBBox.c2}}var chartSettings=new Asc.asc_ChartSettings;var aF=[];for(var nRange=0;nRange<aRanges.length;++nRange)aF.push(AscFormat.fCreateRef(aRanges[nRange]));if(aF.length===0){oPlotArea.removeCharts(1,oPlotArea.charts.length);oFirstChart=oPlotArea.charts[0];if(oFirstChart)oFirstChart.removeAllSeries(); return}chartSettings.aRanges=aF;var range_obj=this.getRangeObjectStr();if(range_obj)if(typeof range_obj.range==="string"&&range_obj.range.length>0)chartSettings.putInColumns(!range_obj.bVert);var chartSeries=AscFormat.getChartSeries(this.worksheet,chartSettings,catHeadersBBox,serHeadersBBox);this.rebuildSeriesFromAsc(chartSeries);if(this.pivotSource)this.setPivotSource(null)};CChartSpace.prototype.onDataUpdate=function(){this.handleUpdateInternalChart();this.recalcInfo.recalculateReferences=true; this.recalculate();this.onUpdate(null)};function getNumLit(ser){if(ser)if(ser.val)if(ser.val.numRef&&ser.val.numRef.numCache)return ser.val.numRef.numCache;else{if(ser.val.numLit)return ser.val.numLit}else if(ser.yVal)if(ser.yVal.numRef&&ser.yVal.numRef.numCache)return ser.yVal.numRef.numCache;else if(ser.yVal.numLit)return ser.yVal.numLit;return null}function getPtsFromSeries(ser){var oNumLit=getNumLit(ser);if(oNumLit)return oNumLit.pts;return[]}function getMaxIdx(arr){var max_idx=0;for(var i=0;i< arr.length;++i)arr[i].idx>max_idx&&(max_idx=arr[i].idx);return max_idx+1}function getArrayFillsFromBase(arrBaseFills,needFillsCount){var ret=[];var nMaxCycleIdx=parseInt((needFillsCount-1)/arrBaseFills.length);for(var i=0;i<needFillsCount;++i){var nCycleIdx=i/arrBaseFills.length>>0;var fShadeTint=(nCycleIdx+1)/(nMaxCycleIdx+2)*1.4-.7;if(fShadeTint<0)fShadeTint=-(1+fShadeTint);else fShadeTint=1-fShadeTint;var color=CreateUniFillSolidFillWidthTintOrShade(arrBaseFills[i%arrBaseFills.length],fShadeTint); ret.push(color)}return ret}function GetTypeMarkerByIndex(index){return AscFormat.MARKER_SYMBOL_TYPE[index%9]}function CreateUnfilFromRGB(r,g,b){var ret=new AscFormat.CUniFill;ret.setFill(new AscFormat.CSolidFill);ret.fill.setColor(new AscFormat.CUniColor);ret.fill.color.setColor(new AscFormat.CRGBColor);ret.fill.color.color.setColor(r,g,b);return ret}function CreateColorMapByIndex(index){var ret=[];switch(index){case 1:{ret.push(CreateUnfilFromRGB(85,85,85));ret.push(CreateUnfilFromRGB(158,158,158)); ret.push(CreateUnfilFromRGB(114,114,114));ret.push(CreateUnfilFromRGB(70,70,70));ret.push(CreateUnfilFromRGB(131,131,131));ret.push(CreateUnfilFromRGB(193,193,193));break}case 2:{for(var i=0;i<6;++i)ret.push(CreateUnifillSolidFillSchemeColorByIndex(i));break}default:{ret.push(CreateUnifillSolidFillSchemeColorByIndex(index-3));break}}return ret}function CreateUniFillSolidFillWidthTintOrShade(unifill,effectVal){var ret=unifill.createDuplicate();var unicolor=ret.fill.color;if(effectVal!==0){effectVal*= 1E5;if(!unicolor.Mods)unicolor.setMods(new AscFormat.CColorModifiers);var mod=new AscFormat.CColorMod;if(effectVal>0){mod.setName("tint");mod.setVal(effectVal)}else{mod.setName("shade");mod.setVal(Math.abs(effectVal))}unicolor.Mods.addMod(mod)}return ret}function CreateUnifillSolidFillSchemeColor(colorId,tintOrShade){var unifill=new AscFormat.CUniFill;unifill.setFill(new AscFormat.CSolidFill);unifill.fill.setColor(new AscFormat.CUniColor);unifill.fill.color.setColor(new AscFormat.CSchemeColor);unifill.fill.color.color.setId(colorId); return CreateUniFillSolidFillWidthTintOrShade(unifill,tintOrShade)}function CreateNoFillLine(){var ret=new AscFormat.CLn;ret.setFill(CreateNoFillUniFill());return ret}function CreateNoFillUniFill(){var ret=new AscFormat.CUniFill;ret.setFill(new AscFormat.CNoFill);return ret}function CExternalData(){this.autoUpdate=null;this.id=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CExternalData.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},getObjectType:function(){return AscDFH.historyitem_type_ExternalData},setAutoUpdate:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_ExternalData_SetAutoUpdate,this.autoUpdate,pr));this.autoUpdate=pr},setId:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_ExternalData_SetId,this.id,pr));this.id=pr}};function CPivotSource(){this.fmtId=null;this.name=null;this.Id=g_oIdCounter.Get_NewId(); g_oTableId.Add(this,this.Id)}CPivotSource.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_PivotSource},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},setFmtId:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PivotSource_SetFmtId,this.fmtId,pr));this.fmtId=pr},setName:function(pr){History.Add(new CChangesDrawingsString(this, AscDFH.historyitem_PivotSource_SetName,this.name,pr));this.name=pr},createDuplicate:function(){var copy=new CPivotSource;if(AscFormat.isRealNumber(this.fmtId))copy.setFmtId(this.fmtId);if(typeof this.name==="string")copy.setName(this.name);return copy}};function CProtection(){this.chartObject=null;this.data=null;this.formatting=null;this.selection=null;this.userInterface=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CProtection.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){}, getObjectType:function(){return AscDFH.historyitem_type_Protection},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},setChartObject:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Protection_SetChartObject,this.chartObject,pr));this.chartObject=pr},setData:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Protection_SetData,this.data,pr));this.data=pr},setFormatting:function(pr){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_Protection_SetFormatting,this.formatting,pr));this.formatting=pr},setSelection:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Protection_SetSelection,this.selection,pr));this.selection=pr},setUserInterface:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Protection_SetUserInterface,this.userInterface,pr));this.userInterface=pr},createDuplicate:function(){var c=new CProtection;if(this.chartObject!==null)c.setChartObject(this.chartObject); if(this.data!==null)c.setData(this.data);if(this.formatting!==null)c.setFormatting(this.formatting);if(this.selection!==null)c.setSelection(this.selection);if(this.userInterface!==null)c.setUserInterface(this.userInterface);return c}};function CPrintSettings(){this.headerFooter=null;this.pageMargins=null;this.pageSetup=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CPrintSettings.prototype={Get_Id:function(){return this.Id},createDuplicate:function(){var oPS=new CPrintSettings; if(this.headerFooter)oPS.setHeaderFooter(this.headerFooter.createDuplicate());if(this.pageMargins)oPS.setPageMargins(this.pageMargins.createDuplicate());if(this.pageSetup)oPS.setPageSetup(this.pageSetup.createDuplicate());return oPS},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_PrintSettings},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},setHeaderFooter:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_PrintSettingsSetHeaderFooter,this.headerFooter,pr));this.headerFooter=pr},setPageMargins:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PrintSettingsSetPageMargins,this.pageMargins,pr));this.pageMargins=pr},setPageSetup:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PrintSettingsSetPageSetup,this.pageSetup,pr));this.pageSetup=pr}};function CHeaderFooterChart(){this.alignWithMargins=null;this.differentFirst=null;this.differentOddEven= null;this.evenFooter=null;this.evenHeader=null;this.firstFooter=null;this.firstHeader=null;this.oddFooter=null;this.oddHeader=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CHeaderFooterChart.prototype={Get_Id:function(){return this.Id},createDuplicate:function(){var oHFC=new CHeaderFooterChart;if(this.alignWithMargins!==null)oHFC.setAlignWithMargins(this.alignWithMargins);if(this.differentFirst!==null)oHFC.setDifferentFirst(this.differentFirst);if(this.differentOddEven!==null)oHFC.setDifferentOddEven(this.differentOddEven); if(this.evenFooter!==null)oHFC.setEvenFooter(this.evenFooter);if(this.evenHeader!==null)oHFC.setEvenHeader(this.evenHeader);if(this.firstFooter!==null)oHFC.setFirstFooter(this.firstFooter);if(this.firstHeader!==null)oHFC.setFirstHeader(this.firstHeader);if(this.oddFooter!==null)oHFC.setOddFooter(this.oddFooter);if(this.oddHeader!==null)oHFC.setOddHeader(this.oddHeader);return oHFC},Refresh_RecalcData:function(){},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)}, Read_FromBinary2:function(r){this.Id=r.GetString2()},getObjectType:function(){return AscDFH.historyitem_type_HeaderFooterChart},setAlignWithMargins:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_HeaderFooterChartSetAlignWithMargins,this.alignWithMargins,pr));this.alignWithMargins=pr},setDifferentFirst:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_HeaderFooterChartSetDifferentFirst,this.differentFirst,pr));this.differentFirst=pr},setDifferentOddEven:function(pr){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_HeaderFooterChartSetDifferentOddEven,this.differentOddEven,pr));this.differentOddEven=pr},setEvenFooter:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_HeaderFooterChartSetEvenFooter,this.evenFooter,pr));this.evenFooter=pr},setEvenHeader:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_HeaderFooterChartSetEvenHeader,this.evenHeader,pr));this.evenHeader=pr},setFirstFooter:function(pr){History.Add(new CChangesDrawingsString(this, AscDFH.historyitem_HeaderFooterChartSetFirstFooter,this.firstFooter,pr));this.firstFooter=pr},setFirstHeader:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_HeaderFooterChartSetFirstHeader,this.firstHeader,pr));this.firstHeader=pr},setOddFooter:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_HeaderFooterChartSetOddFooter,this.oddFooter,pr));this.oddFooter=pr},setOddHeader:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_HeaderFooterChartSetOddHeader, this.oddHeader,pr));this.oddHeader=pr}};function CPageMarginsChart(){this.b=null;this.footer=null;this.header=null;this.l=null;this.r=null;this.t=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CPageMarginsChart.prototype={Get_Id:function(){return this.Id},createDuplicate:function(){var oPMC=new CPageMarginsChart;if(this.b!==null)oPMC.setB(this.b);if(this.footer!==null)oPMC.setFooter(this.footer);if(this.header!==null)oPMC.setHeader(this.header);if(this.l!==null)oPMC.setL(this.l); if(this.r!==null)oPMC.setR(this.r);if(this.t!==null)oPMC.setT(this.t);return oPMC},Refresh_RecalcData:function(){},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},getObjectType:function(){return AscDFH.historyitem_type_PageMarginsChart},setB:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_PageMarginsSetB,this.b,pr));this.b=pr},setFooter:function(pr){History.Add(new CChangesDrawingsDouble(this, AscDFH.historyitem_PageMarginsSetFooter,this.footer,pr));this.footer=pr},setHeader:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_PageMarginsSetHeader,this.header,pr));this.header=pr},setL:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_PageMarginsSetL,this.l,pr));this.l=pr},setR:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_PageMarginsSetR,this.r,pr));this.r=pr},setT:function(pr){History.Add(new CChangesDrawingsDouble(this, AscDFH.historyitem_PageMarginsSetT,this.t,pr));this.t=pr}};function CPageSetup(){this.blackAndWhite=null;this.copies=null;this.draft=null;this.firstPageNumber=null;this.horizontalDpi=null;this.orientation=null;this.paperHeight=null;this.paperSize=null;this.paperWidth=null;this.useFirstPageNumb=null;this.verticalDpi=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CPageSetup.prototype={Get_Id:function(){return this.Id},createDuplicate:function(){var oPS=new CPageSetup;if(this.blackAndWhite!== null)oPS.setBlackAndWhite(this.blackAndWhite);if(this.copies!==null)oPS.setCopies(this.copies);if(this.draft!==null)oPS.setDraft(this.draft);if(this.firstPageNumber!==null)oPS.setFirstPageNumber(this.firstPageNumber);if(this.horizontalDpi!==null)oPS.setHorizontalDpi(this.horizontalDpi);if(this.orientation!==null)oPS.setOrientation(this.orientation);if(this.paperHeight!==null)oPS.setPaperHeight(this.paperHeight);if(this.paperSize!==null)oPS.setPaperSize(this.paperSize);if(this.paperWidth!==null)oPS.setPaperWidth(this.paperWidth); if(this.useFirstPageNumb!==null)oPS.setUseFirstPageNumb(this.useFirstPageNumb);if(this.verticalDpi!==null)oPS.setVerticalDpi(this.verticalDpi);return oPS},Refresh_RecalcData:function(){},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},getObjectType:function(){return AscDFH.historyitem_type_PageSetup},setBlackAndWhite:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_PageSetupSetBlackAndWhite, this.blackAndWhite,pr));this.blackAndWhite=pr},setCopies:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PageSetupSetCopies,this.copies,pr));this.copies=pr},setDraft:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_PageSetupSetDraft,this.draft,pr));this.draft=pr},setFirstPageNumber:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PageSetupSetFirstPageNumber,this.firstPageNumber,pr));this.firstPageNumber=pr},setHorizontalDpi:function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_PageSetupSetHorizontalDpi,this.horizontalDpi,pr));this.horizontalDpi=pr},setOrientation:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PageSetupSetOrientation,this.orientation,pr));this.orientation=pr},setPaperHeight:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_PageSetupSetPaperHeight,this.paperHeight,pr));this.paperHeight=pr},setPaperSize:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PageSetupSetPaperSize, this.paperSize,pr));this.paperSize=pr},setPaperWidth:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_PageSetupSetPaperWidth,this.paperWidth,pr));this.paperWidth=pr},setUseFirstPageNumb:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_PageSetupSetUseFirstPageNumb,this.useFirstPageNumb,pr));this.useFirstPageNumb=pr},setVerticalDpi:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PageSetupSetVerticalDpi,this.verticalDpi,pr)); this.verticalDpi=pr}};function CreateView3d(nRotX,nRotY,bRAngAx,nDepthPercent){var oView3d=new AscFormat.CView3d;AscFormat.isRealNumber(nRotX)&&oView3d.setRotX(nRotX);AscFormat.isRealNumber(nRotY)&&oView3d.setRotY(nRotY);AscFormat.isRealBool(bRAngAx)&&oView3d.setRAngAx(bRAngAx);AscFormat.isRealNumber(nDepthPercent)&&oView3d.setDepthPercent(nDepthPercent);return oView3d}function GetNumFormatFromSeries(aAscSeries){if(aAscSeries&&aAscSeries[0]&&aAscSeries[0].Val&&aAscSeries[0].Val.NumCache&&aAscSeries[0].Val.NumCache[0])if(typeof aAscSeries[0].Val.NumCache[0].numFormatStr=== "string"&&aAscSeries[0].Val.NumCache[0].numFormatStr.length>0)return aAscSeries[0].Val.NumCache[0].numFormatStr;return"General"}function FillCatAxNumFormat(oCatAxis,aAscSeries){if(!oCatAxis)return;var sFormatCode=null;if(aAscSeries&&aAscSeries[0]&&aAscSeries[0].Cat&&aAscSeries[0].Cat.NumCache&&aAscSeries[0].Cat.NumCache[0])if(typeof aAscSeries[0].Cat.NumCache[0].numFormatStr==="string"&&aAscSeries[0].Cat.NumCache[0].numFormatStr.length>0)sFormatCode=aAscSeries[0].Cat.NumCache[0].numFormatStr;if(sFormatCode){oCatAxis.setNumFmt(new AscFormat.CNumFmt); oCatAxis.numFmt.setFormatCode(sFormatCode?sFormatCode:"General");oCatAxis.numFmt.setSourceLinked(true)}}function CreateLineChart(chartSeries,type,bUseCache,oOptions,b3D){var asc_series=chartSeries.series;var chart_space=new CChartSpace;chart_space.setDate1904(false);chart_space.setLang("en-US");chart_space.setRoundedCorners(false);chart_space.setChart(new AscFormat.CChart);chart_space.setPrintSettings(new CPrintSettings);var chart=chart_space.chart;if(b3D){chart.setView3D(CreateView3d(15,20,true, 100));chart.setDefaultWalls()}chart.setAutoTitleDeleted(false);chart.setPlotArea(new AscFormat.CPlotArea);chart.setPlotVisOnly(true);var disp_blanks_as;if(type===AscFormat.GROUPING_STANDARD)disp_blanks_as=DISP_BLANKS_AS_GAP;else disp_blanks_as=DISP_BLANKS_AS_ZERO;chart.setDispBlanksAs(disp_blanks_as);chart.setShowDLblsOverMax(false);var plot_area=chart.plotArea;plot_area.setLayout(new AscFormat.CLayout);plot_area.addChart(new AscFormat.CLineChart);var cat_ax=new AscFormat.CCatAx;var val_ax=new AscFormat.CValAx; cat_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);val_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);cat_ax.setCrossAx(val_ax);val_ax.setCrossAx(cat_ax);plot_area.addAxis(cat_ax);plot_area.addAxis(val_ax);var line_chart=plot_area.charts[0];line_chart.setGrouping(type);line_chart.setVaryColors(false);line_chart.setMarker(true);line_chart.setSmooth(false);line_chart.addAxId(cat_ax);line_chart.addAxId(val_ax);val_ax.setCrosses(2);var parsedHeaders=chartSeries.parsedHeaders;var bInCols;if(isRealObject(oOptions))bInCols= oOptions.inColumns===true;else bInCols=false;for(var i=0;i<asc_series.length;++i){var series=new AscFormat.CLineSeries;series.setIdx(i);series.setOrder(i);series.setMarker(new AscFormat.CMarker);series.marker.setSymbol(AscFormat.SYMBOL_NONE);series.setSmooth(false);series.setVal(new AscFormat.CYVal);FillValNum(series.val,asc_series[i].Val,bUseCache);if(asc_series[i].Cat&&typeof asc_series[i].Cat.Formula==="string"&&asc_series[i].Cat.Formula.length>0){series.setCat(new AscFormat.CCat);FillCatStr(series.cat, asc_series[i].Cat,bUseCache)}if(asc_series[i].TxCache&&typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,bUseCache);line_chart.addSer(series)}cat_ax.setScaling(new AscFormat.CScaling);cat_ax.setDelete(false);cat_ax.setAxPos(AscFormat.AX_POS_B);cat_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO); cat_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);cat_ax.setAuto(true);cat_ax.setLblAlgn(AscFormat.LBL_ALG_CTR);cat_ax.setLblOffset(100);cat_ax.setNoMultiLvlLbl(false);var scaling=cat_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);FillCatAxNumFormat(cat_ax,asc_series);val_ax.setScaling(new AscFormat.CScaling);val_ax.setDelete(false);val_ax.setAxPos(AscFormat.AX_POS_L);val_ax.setMajorGridlines(new AscFormat.CSpPr);val_ax.setNumFmt(new AscFormat.CNumFmt);val_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT); val_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);val_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);val_ax.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN);scaling=val_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);var num_fmt=val_ax.numFmt;var format_code;if(type===AscFormat.GROUPING_PERCENT_STACKED)format_code="0%";else format_code=GetNumFormatFromSeries(asc_series);num_fmt.setFormatCode(format_code);num_fmt.setSourceLinked(true); if(asc_series.length>1){chart.setLegend(new AscFormat.CLegend);var legend=chart.legend;legend.setLegendPos(c_oAscChartLegendShowSettings.right);legend.setLayout(new AscFormat.CLayout);legend.setOverlay(false)}var print_settings=chart_space.printSettings;print_settings.setHeaderFooter(new CHeaderFooterChart);print_settings.setPageMargins(new CPageMarginsChart);print_settings.setPageSetup(new CPageSetup);var page_margins=print_settings.pageMargins;page_margins.setB(.75);page_margins.setL(.7);page_margins.setR(.7); page_margins.setT(.75);page_margins.setHeader(.3);page_margins.setFooter(.3);return chart_space}function CreateBarChart(chartSeries,type,bUseCache,oOptions,b3D,bDepth){var asc_series=chartSeries.series;var chart_space=new CChartSpace;chart_space.setDate1904(false);chart_space.setLang("en-US");chart_space.setRoundedCorners(false);chart_space.setChart(new AscFormat.CChart);chart_space.setPrintSettings(new CPrintSettings);var chart=chart_space.chart;chart.setAutoTitleDeleted(false);if(b3D){chart.setView3D(CreateView3d(15, 20,true,bDepth?100:undefined));chart.setDefaultWalls()}chart.setPlotArea(new AscFormat.CPlotArea);chart.setPlotVisOnly(true);chart.setDispBlanksAs(DISP_BLANKS_AS_GAP);chart.setShowDLblsOverMax(false);var plot_area=chart.plotArea;plot_area.setLayout(new AscFormat.CLayout);plot_area.addChart(new AscFormat.CBarChart);var bInCols;if(isRealObject(oOptions))bInCols=oOptions.inColumns===true;else bInCols=false;var cat_ax=new AscFormat.CCatAx;var val_ax=new AscFormat.CValAx;cat_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER); val_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);cat_ax.setCrossAx(val_ax);val_ax.setCrossAx(cat_ax);plot_area.addAxis(cat_ax);plot_area.addAxis(val_ax);var bar_chart=plot_area.charts[0];if(b3D)bar_chart.set3D(true);bar_chart.setBarDir(AscFormat.BAR_DIR_COL);bar_chart.setGrouping(type);bar_chart.setVaryColors(false);var parsedHeaders=chartSeries.parsedHeaders;for(var i=0;i<asc_series.length;++i){var series=new AscFormat.CBarSeries;series.setIdx(i);series.setOrder(i);series.setInvertIfNegative(false); series.setVal(new AscFormat.CYVal);FillValNum(series.val,asc_series[i].Val,bUseCache);if(asc_series[i].Cat&&typeof asc_series[i].Cat.Formula==="string"&&asc_series[i].Cat.Formula.length>0){series.setCat(new AscFormat.CCat);FillCatStr(series.cat,asc_series[i].Cat,bUseCache)}if(asc_series[i].TxCache&&typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,bUseCache);bar_chart.addSer(series)}bar_chart.setGapWidth(150);if(AscFormat.BAR_GROUPING_PERCENT_STACKED=== type||AscFormat.BAR_GROUPING_STACKED===type)bar_chart.setOverlap(100);if(b3D)bar_chart.setShape(BAR_SHAPE_BOX);bar_chart.addAxId(cat_ax);bar_chart.addAxId(val_ax);cat_ax.setScaling(new AscFormat.CScaling);cat_ax.setDelete(false);cat_ax.setAxPos(AscFormat.AX_POS_B);cat_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);cat_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);cat_ax.setAuto(true);cat_ax.setLblAlgn(AscFormat.LBL_ALG_CTR);cat_ax.setLblOffset(100); cat_ax.setNoMultiLvlLbl(false);var scaling=cat_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);FillCatAxNumFormat(cat_ax,asc_series);val_ax.setScaling(new AscFormat.CScaling);val_ax.setDelete(false);val_ax.setAxPos(AscFormat.AX_POS_L);val_ax.setMajorGridlines(new AscFormat.CSpPr);val_ax.setNumFmt(new AscFormat.CNumFmt);var num_fmt=val_ax.numFmt;var format_code;if(type===AscFormat.BAR_GROUPING_PERCENT_STACKED)format_code="0%";else format_code=GetNumFormatFromSeries(asc_series);num_fmt.setFormatCode(format_code); num_fmt.setSourceLinked(true);val_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);val_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);val_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);val_ax.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN);scaling=val_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);if(asc_series.length>1){chart.setLegend(new AscFormat.CLegend);var legend=chart.legend;legend.setLegendPos(c_oAscChartLegendShowSettings.right); legend.setLayout(new AscFormat.CLayout);legend.setOverlay(false)}var print_settings=chart_space.printSettings;print_settings.setHeaderFooter(new CHeaderFooterChart);print_settings.setPageMargins(new CPageMarginsChart);print_settings.setPageSetup(new CPageSetup);var page_margins=print_settings.pageMargins;page_margins.setB(.75);page_margins.setL(.7);page_margins.setR(.7);page_margins.setT(.75);page_margins.setHeader(.3);page_margins.setFooter(.3);return chart_space}function CreateHBarChart(chartSeries, type,bUseCache,oOptions,b3D){var asc_series=chartSeries.series;var chart_space=new CChartSpace;chart_space.setDate1904(false);chart_space.setLang("en-US");chart_space.setRoundedCorners(false);chart_space.setChart(new AscFormat.CChart);chart_space.setPrintSettings(new CPrintSettings);var chart=chart_space.chart;chart.setAutoTitleDeleted(false);if(b3D){chart.setView3D(CreateView3d(15,20,true,undefined));chart.setDefaultWalls()}chart.setPlotArea(new AscFormat.CPlotArea);chart.setPlotVisOnly(true);chart.setDispBlanksAs(DISP_BLANKS_AS_GAP); chart.setShowDLblsOverMax(false);var plot_area=chart.plotArea;plot_area.setLayout(new AscFormat.CLayout);plot_area.addChart(new AscFormat.CBarChart);var cat_ax=new AscFormat.CCatAx;var val_ax=new AscFormat.CValAx;cat_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);val_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);cat_ax.setCrossAx(val_ax);val_ax.setCrossAx(cat_ax);plot_area.addAxis(cat_ax);plot_area.addAxis(val_ax);var bar_chart=plot_area.charts[0];bar_chart.setBarDir(AscFormat.BAR_DIR_BAR);bar_chart.setGrouping(type); bar_chart.setVaryColors(false);var parsedHeaders=chartSeries.parsedHeaders;var bInCols;if(isRealObject(oOptions))bInCols=oOptions.inColumns===true;else bInCols=false;for(var i=0;i<asc_series.length;++i){var series=new AscFormat.CBarSeries;series.setIdx(i);series.setOrder(i);series.setInvertIfNegative(false);series.setVal(new AscFormat.CYVal);FillValNum(series.val,asc_series[i].Val,bUseCache);if(parsedHeaders.bTop&&!bInCols||bInCols&&parsedHeaders.bLeft){series.setCat(new AscFormat.CCat);FillCatStr(series.cat, asc_series[i].Cat,bUseCache)}if((parsedHeaders.bLeft&&!bInCols||bInCols&&parsedHeaders.bTop)&&asc_series[i].TxCache&&typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,bUseCache);bar_chart.addSer(series);if(b3D)bar_chart.setShape(BAR_SHAPE_BOX)}bar_chart.setGapWidth(150);if(AscFormat.BAR_GROUPING_PERCENT_STACKED===type||AscFormat.BAR_GROUPING_STACKED===type)bar_chart.setOverlap(100);bar_chart.addAxId(cat_ax);bar_chart.addAxId(val_ax); cat_ax.setScaling(new AscFormat.CScaling);cat_ax.setDelete(false);cat_ax.setAxPos(AscFormat.AX_POS_L);cat_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);cat_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);cat_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);cat_ax.setAuto(true);cat_ax.setLblAlgn(AscFormat.LBL_ALG_CTR);cat_ax.setLblOffset(100);cat_ax.setNoMultiLvlLbl(false);var scaling=cat_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX); FillCatAxNumFormat(cat_ax,asc_series);val_ax.setScaling(new AscFormat.CScaling);val_ax.setDelete(false);val_ax.setAxPos(AscFormat.AX_POS_B);val_ax.setMajorGridlines(new AscFormat.CSpPr);val_ax.setNumFmt(new AscFormat.CNumFmt);val_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);val_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);val_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);val_ax.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN); scaling=val_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);var num_fmt=val_ax.numFmt;var format_code;{format_code=GetNumFormatFromSeries(asc_series)}num_fmt.setFormatCode(format_code);num_fmt.setSourceLinked(true);if(asc_series.length>1){chart.setLegend(new AscFormat.CLegend);var legend=chart.legend;legend.setLegendPos(c_oAscChartLegendShowSettings.right);legend.setLayout(new AscFormat.CLayout);legend.setOverlay(false)}var print_settings=chart_space.printSettings;print_settings.setHeaderFooter(new CHeaderFooterChart); print_settings.setPageMargins(new CPageMarginsChart);print_settings.setPageSetup(new CPageSetup);var page_margins=print_settings.pageMargins;page_margins.setB(.75);page_margins.setL(.7);page_margins.setR(.7);page_margins.setT(.75);page_margins.setHeader(.3);page_margins.setFooter(.3);return chart_space}function CreateAreaChart(chartSeries,type,bUseCache,oOptions){var asc_series=chartSeries.series;var chart_space=new CChartSpace;chart_space.setDate1904(false);chart_space.setLang("en-US");chart_space.setRoundedCorners(false); chart_space.setChart(new AscFormat.CChart);chart_space.setPrintSettings(new CPrintSettings);var chart=chart_space.chart;chart.setAutoTitleDeleted(false);chart.setPlotArea(new AscFormat.CPlotArea);chart.setPlotVisOnly(true);chart.setDispBlanksAs(DISP_BLANKS_AS_ZERO);chart.setShowDLblsOverMax(false);var plot_area=chart.plotArea;plot_area.setLayout(new AscFormat.CLayout);plot_area.addChart(new AscFormat.CAreaChart);var cat_ax=new AscFormat.CCatAx;var val_ax=new AscFormat.CValAx;cat_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER); val_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);cat_ax.setCrossAx(val_ax);val_ax.setCrossAx(cat_ax);plot_area.addAxis(cat_ax);plot_area.addAxis(val_ax);var bInCols;if(isRealObject(oOptions))bInCols=oOptions.inColumns===true;else bInCols=false;var area_chart=plot_area.charts[0];area_chart.setGrouping(type);area_chart.setVaryColors(false);var parsedHeaders=chartSeries.parsedHeaders;for(var i=0;i<asc_series.length;++i){var series=new AscFormat.CAreaSeries;series.setIdx(i);series.setOrder(i);series.setVal(new AscFormat.CYVal); FillValNum(series.val,asc_series[i].Val,bUseCache);if(asc_series[i].Cat&&typeof asc_series[i].Cat.Formula==="string"&&asc_series[i].Cat.Formula.length>0){series.setCat(new AscFormat.CCat);FillCatStr(series.cat,asc_series[i].Cat,bUseCache)}if(asc_series[i].TxCache&&typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,bUseCache);area_chart.addSer(series)}area_chart.addAxId(cat_ax);area_chart.addAxId(val_ax);cat_ax.setScaling(new AscFormat.CScaling); cat_ax.setDelete(false);cat_ax.setAxPos(AscFormat.AX_POS_B);cat_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);cat_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);cat_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);cat_ax.setAuto(true);cat_ax.setLblAlgn(AscFormat.LBL_ALG_CTR);cat_ax.setLblOffset(100);cat_ax.setNoMultiLvlLbl(false);cat_ax.scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);FillCatAxNumFormat(cat_ax,asc_series); val_ax.setScaling(new AscFormat.CScaling);val_ax.setDelete(false);val_ax.setAxPos(AscFormat.AX_POS_L);val_ax.setMajorGridlines(new AscFormat.CSpPr);val_ax.setNumFmt(new AscFormat.CNumFmt);val_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);val_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);val_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);val_ax.setCrossBetween(AscFormat.CROSS_BETWEEN_MID_CAT);var scaling=val_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX); var num_fmt=val_ax.numFmt;var format_code;if(type===AscFormat.GROUPING_PERCENT_STACKED)format_code="0%";else format_code=GetNumFormatFromSeries(asc_series);num_fmt.setFormatCode(format_code);num_fmt.setSourceLinked(true);if(asc_series.length>1){chart.setLegend(new AscFormat.CLegend);var legend=chart.legend;legend.setLegendPos(c_oAscChartLegendShowSettings.right);legend.setLayout(new AscFormat.CLayout);legend.setOverlay(false)}var print_settings=chart_space.printSettings;print_settings.setHeaderFooter(new CHeaderFooterChart); print_settings.setPageMargins(new CPageMarginsChart);print_settings.setPageSetup(new CPageSetup);var page_margins=print_settings.pageMargins;page_margins.setB(.75);page_margins.setL(.7);page_margins.setR(.7);page_margins.setT(.75);page_margins.setHeader(.3);page_margins.setFooter(.3);return chart_space}function CreatePieChart(chartSeries,bDoughnut,bUseCache,oOptions,b3D){var asc_series=chartSeries.series;var chart_space=new CChartSpace;chart_space.setDate1904(false);chart_space.setLang("en-US");chart_space.setRoundedCorners(false); chart_space.setStyle(2);chart_space.setChart(new AscFormat.CChart);var chart=chart_space.chart;chart.setAutoTitleDeleted(false);if(b3D){chart.setView3D(CreateView3d(30,0,true,100));chart.setDefaultWalls()}chart.setPlotArea(new AscFormat.CPlotArea);var plot_area=chart.plotArea;plot_area.setLayout(new AscFormat.CLayout);plot_area.addChart(bDoughnut?new AscFormat.CDoughnutChart:new AscFormat.CPieChart);var pie_chart=plot_area.charts[0];pie_chart.setVaryColors(true);var parsedHeaders=chartSeries.parsedHeaders; var bInCols;if(isRealObject(oOptions))bInCols=oOptions.inColumns===true;else bInCols=false;for(var i=0;i<asc_series.length;++i){var series=new AscFormat.CPieSeries;series.setIdx(i);series.setOrder(i);series.setVal(new AscFormat.CYVal);var val=series.val;FillValNum(series.val,asc_series[i].Val,bUseCache);if(asc_series[i].Cat&&typeof asc_series[i].Cat.Formula==="string"&&asc_series[i].Cat.Formula.length>0){series.setCat(new AscFormat.CCat);FillCatStr(series.cat,asc_series[i].Cat,bUseCache)}if(asc_series[i].TxCache&& typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,bUseCache);pie_chart.addSer(series)}pie_chart.setFirstSliceAng(0);if(bDoughnut)pie_chart.setHoleSize(75);chart.setLegend(new AscFormat.CLegend);var legend=chart.legend;legend.setLegendPos(c_oAscChartLegendShowSettings.right);legend.setLayout(new AscFormat.CLayout);legend.setOverlay(false);chart.setPlotVisOnly(true);chart.setDispBlanksAs(DISP_BLANKS_AS_GAP);chart.setShowDLblsOverMax(false); chart_space.setPrintSettings(new CPrintSettings);var print_settings=chart_space.printSettings;print_settings.setHeaderFooter(new CHeaderFooterChart);print_settings.setPageMargins(new CPageMarginsChart);print_settings.setPageSetup(new CPageSetup);var page_margins=print_settings.pageMargins;page_margins.setB(.75);page_margins.setL(.7);page_margins.setR(.7);page_margins.setT(.75);page_margins.setHeader(.3);page_margins.setFooter(.3);return chart_space}function FillCatStr(oCat,oCatCache,bUseCache,bFillCache){oCat.setStrRef(new AscFormat.CStrRef); var str_ref=oCat.strRef;str_ref.setF(oCatCache.Formula);if(bUseCache){str_ref.setStrCache(new AscFormat.CStrCache);var str_cache=str_ref.strCache;var cat_num_cache=oCatCache.NumCache;str_cache.setPtCount(cat_num_cache.length);if(!(bFillCache===false))for(var j=0;j<cat_num_cache.length;++j){var string_pt=new AscFormat.CStringPoint;string_pt.setIdx(j);string_pt.setVal(cat_num_cache[j].val);str_cache.addPt(string_pt)}}}function FillValNum(oVal,oValCache,bUseCache,bFillCache){oVal.setNumRef(new AscFormat.CNumRef); var num_ref=oVal.numRef;num_ref.setF(oValCache.Formula);if(bUseCache){num_ref.setNumCache(new AscFormat.CNumLit);var num_cache=num_ref.numCache;num_cache.setPtCount(oValCache.NumCache.length);if(!(bFillCache===false))for(var j=0;j<oValCache.NumCache.length;++j){var pt=new AscFormat.CNumericPoint;pt.setIdx(j);pt.setFormatCode(oValCache.NumCache[j].numFormatStr);pt.setVal(oValCache.NumCache[j].val);num_cache.addPt(pt)}}}function FillSeriesTx(oSeries,oTxCache,bUseCache,bFillCache){oSeries.setTx(new AscFormat.CTx); var tx=oSeries.tx;tx.setStrRef(new AscFormat.CStrRef);var str_ref=tx.strRef;str_ref.setF(oTxCache.Formula);if(bUseCache){str_ref.setStrCache(new AscFormat.CStrCache);var str_cache=str_ref.strCache;str_cache.setPtCount(1);if(!(bFillCache===false)){str_cache.addPt(new AscFormat.CStringPoint);var pt=str_cache.pts[0];pt.setIdx(0);pt.setVal(oTxCache.Tx)}}}function CreateScatterChart(chartSeries,bUseCache,oOptions){var asc_series=chartSeries.series;var chart_space=new CChartSpace;chart_space.setDate1904(false); chart_space.setLang("en-US");chart_space.setRoundedCorners(false);chart_space.setStyle(2);chart_space.setChart(new AscFormat.CChart);var chart=chart_space.chart;chart.setAutoTitleDeleted(false);chart.setPlotArea(new AscFormat.CPlotArea);var plot_area=chart.plotArea;plot_area.setLayout(new AscFormat.CLayout);plot_area.addChart(new AscFormat.CScatterChart);var scatter_chart=plot_area.charts[0];scatter_chart.setScatterStyle(AscFormat.SCATTER_STYLE_MARKER);scatter_chart.setVaryColors(false);var bInCols; if(isRealObject(oOptions))bInCols=oOptions.inColumns===true;else bInCols=false;var parsedHeaders=chartSeries.parsedHeaders;var cat_ax=new AscFormat.CValAx;var val_ax=new AscFormat.CValAx;cat_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);val_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);cat_ax.setCrossAx(val_ax);val_ax.setCrossAx(cat_ax);plot_area.addAxis(cat_ax);plot_area.addAxis(val_ax);var oXVal;var first_series=null;var start_index=0;var minus=0;first_series=asc_series.length>1?asc_series[0]:null; if(first_series&&first_series.xVal&&typeof first_series.xVal.Formula==="string"&&first_series.xVal.Formula.length>0){oXVal=new AscFormat.CCat;var bVal=true;var oValCache=first_series.xVal;var aPts=oValCache.NumCache,oPt,nPt;for(nPt=0;nPt<aPts.length;++nPt){oPt=aPts[nPt];if(oPt)if(!oPt.isDateTimeFormat&&!AscFormat.isRealNumber(parseFloat(oPt.val))){bVal=false;break}}if(bVal)FillValNum(oXVal,first_series.xVal,bUseCache);else FillCatStr(oXVal,first_series.xVal,bUseCache)}else{start_index=asc_series.length> 1?1:0;minus=start_index===1?1:0;if(first_series){oXVal=new AscFormat.CCat;FillValNum(oXVal,first_series.Val,bUseCache)}}for(var i=start_index;i<asc_series.length;++i){var series=new AscFormat.CScatterSeries;series.setIdx(i-minus);series.setOrder(i-minus);if(oXVal)series.setXVal(oXVal.createDuplicate());series.setYVal(new AscFormat.CYVal);FillValNum(series.yVal,asc_series[i].Val,bUseCache);if(asc_series[i].TxCache&&typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length> 0)FillSeriesTx(series,asc_series[i].TxCache,bUseCache);scatter_chart.addSer(series)}scatter_chart.addAxId(cat_ax);scatter_chart.addAxId(val_ax);cat_ax.setScaling(new AscFormat.CScaling);cat_ax.setDelete(false);cat_ax.setAxPos(AscFormat.AX_POS_B);cat_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);cat_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);cat_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);cat_ax.scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX); val_ax.setScaling(new AscFormat.CScaling);val_ax.setDelete(false);val_ax.setAxPos(AscFormat.AX_POS_L);val_ax.setMajorGridlines(new AscFormat.CSpPr);val_ax.setNumFmt(new AscFormat.CNumFmt);val_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);val_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);val_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);val_ax.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN);var scaling=val_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX); var num_fmt=val_ax.numFmt;var format_code=GetNumFormatFromSeries(asc_series);num_fmt.setFormatCode(format_code);num_fmt.setSourceLinked(true);if(scatter_chart.series.length>1){chart.setLegend(new AscFormat.CLegend);var legend=chart.legend;legend.setLegendPos(c_oAscChartLegendShowSettings.right);legend.setLayout(new AscFormat.CLayout);legend.setOverlay(false)}chart_space.setPrintSettings(new CPrintSettings);var print_settings=chart_space.printSettings;print_settings.setHeaderFooter(new CHeaderFooterChart); print_settings.setPageMargins(new CPageMarginsChart);print_settings.setPageSetup(new CPageSetup);var page_margins=print_settings.pageMargins;page_margins.setB(.75);page_margins.setL(.7);page_margins.setR(.7);page_margins.setT(.75);page_margins.setHeader(.3);page_margins.setFooter(.3);return chart_space}function CreateStockChart(chartSeries,bUseCache,oOptions){var asc_series=chartSeries.series;var chart_space=new CChartSpace;chart_space.setDate1904(false);chart_space.setLang("en-US");chart_space.setRoundedCorners(false); chart_space.setChart(new AscFormat.CChart);chart_space.setPrintSettings(new CPrintSettings);var chart=chart_space.chart;chart.setAutoTitleDeleted(false);chart.setPlotArea(new AscFormat.CPlotArea);chart.setLegend(new AscFormat.CLegend);chart.setPlotVisOnly(true);var disp_blanks_as;disp_blanks_as=DISP_BLANKS_AS_GAP;chart.setDispBlanksAs(disp_blanks_as);chart.setShowDLblsOverMax(false);var plot_area=chart.plotArea;plot_area.setLayout(new AscFormat.CLayout);plot_area.addChart(new AscFormat.CStockChart); var bInCols;if(isRealObject(oOptions))bInCols=oOptions.inColumns===true;else bInCols=false;var cat_ax=new AscFormat.CCatAx;var val_ax=new AscFormat.CValAx;cat_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);val_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);cat_ax.setCrossAx(val_ax);val_ax.setCrossAx(cat_ax);plot_area.addAxis(cat_ax);plot_area.addAxis(val_ax);var line_chart=plot_area.charts[0];line_chart.addAxId(cat_ax);line_chart.addAxId(val_ax);line_chart.setHiLowLines(new AscFormat.CSpPr);line_chart.setUpDownBars(new AscFormat.CUpDownBars); line_chart.upDownBars.setGapWidth(150);line_chart.upDownBars.setUpBars(new AscFormat.CSpPr);line_chart.upDownBars.setDownBars(new AscFormat.CSpPr);var parsedHeaders=chartSeries.parsedHeaders;for(var i=0;i<asc_series.length;++i){var series=new AscFormat.CLineSeries;series.setIdx(i);series.setOrder(i);series.setMarker(new AscFormat.CMarker);series.setSpPr(new AscFormat.CSpPr);series.spPr.setLn(new AscFormat.CLn);series.spPr.ln.setW(28575);series.spPr.ln.setFill(CreateNoFillUniFill());series.marker.setSymbol(AscFormat.SYMBOL_NONE); series.setSmooth(false);series.setVal(new AscFormat.CYVal);var val=series.val;FillValNum(val,asc_series[i].Val,bUseCache);if(parsedHeaders.bTop&&!bInCols||bInCols&&parsedHeaders.bLeft){series.setCat(new AscFormat.CCat);var cat=series.cat;if(typeof asc_series[i].Cat.formatCode==="string"&&asc_series[i].Cat.formatCode.length>0){cat.setNumRef(new AscFormat.CNumRef);var num_ref=cat.numRef;num_ref.setF(asc_series[i].Cat.Formula);if(bUseCache){num_ref.setNumCache(new AscFormat.CNumLit);var num_cache=num_ref.numCache; var cat_num_cache=asc_series[i].Cat.NumCache;num_cache.setPtCount(cat_num_cache.length);num_cache.setFormatCode(asc_series[i].Cat.formatCode);for(var j=0;j<cat_num_cache.length;++j){var pt=new AscFormat.CNumericPoint;pt.setIdx(j);pt.setVal(cat_num_cache[j].val);if(cat_num_cache[j].numFormatStr!==asc_series[i].Cat.formatCode)pt.setFormatCode(cat_num_cache[j].numFormatStr);num_cache.addPt(pt)}}}else FillCatStr(cat,asc_series[i].Cat,bUseCache)}if((parsedHeaders.bLeft&&!bInCols||bInCols&&parsedHeaders.bTop)&& asc_series[i].TxCache&&typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,bUseCache);line_chart.addSer(series)}cat_ax.setScaling(new AscFormat.CScaling);cat_ax.setDelete(false);cat_ax.setAxPos(AscFormat.AX_POS_B);cat_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);cat_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO); cat_ax.setAuto(true);cat_ax.setLblAlgn(AscFormat.LBL_ALG_CTR);cat_ax.setLblOffset(100);cat_ax.setNoMultiLvlLbl(false);var scaling=cat_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);val_ax.setScaling(new AscFormat.CScaling);val_ax.setDelete(false);val_ax.setAxPos(AscFormat.AX_POS_L);val_ax.setMajorGridlines(new AscFormat.CSpPr);val_ax.setNumFmt(new AscFormat.CNumFmt);val_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);val_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO); val_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);val_ax.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN);scaling=val_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);var num_fmt=val_ax.numFmt;var format_code;format_code=GetNumFormatFromSeries(asc_series);num_fmt.setFormatCode(format_code);num_fmt.setSourceLinked(true);var legend=chart.legend;legend.setLegendPos(c_oAscChartLegendShowSettings.right);legend.setLayout(new AscFormat.CLayout);legend.setOverlay(false);var print_settings=chart_space.printSettings; print_settings.setHeaderFooter(new CHeaderFooterChart);print_settings.setPageMargins(new CPageMarginsChart);print_settings.setPageSetup(new CPageSetup);var page_margins=print_settings.pageMargins;page_margins.setB(.75);page_margins.setL(.7);page_margins.setR(.7);page_margins.setT(.75);page_margins.setHeader(.3);page_margins.setFooter(.3);return chart_space}function CreateSurfaceChart(chartSeries,bUseCache,oOptions,bContour,bWireFrame){var asc_series=chartSeries.series;var oChartSpace=new AscFormat.CChartSpace; oChartSpace.setDate1904(false);oChartSpace.setLang("en-US");oChartSpace.setRoundedCorners(false);oChartSpace.setStyle(2);oChartSpace.setChart(new AscFormat.CChart);var oChart=oChartSpace.chart;oChart.setAutoTitleDeleted(false);var oView3D=new AscFormat.CView3d;oChart.setView3D(oView3D);if(!bContour){oView3D.setRotX(15);oView3D.setRotY(20);oView3D.setRAngAx(false);oView3D.setPerspective(30)}else{oView3D.setRotX(90);oView3D.setRotY(0);oView3D.setRAngAx(false);oView3D.setPerspective(0)}oChart.setFloor(new AscFormat.CChartWall); oChart.floor.setThickness(0);oChart.setSideWall(new AscFormat.CChartWall);oChart.sideWall.setThickness(0);oChart.setBackWall(new AscFormat.CChartWall);oChart.backWall.setThickness(0);oChart.setPlotArea(new AscFormat.CPlotArea);oChart.plotArea.setLayout(new AscFormat.CLayout);var oSurfaceChart;oSurfaceChart=new AscFormat.CSurfaceChart;if(bWireFrame)oSurfaceChart.setWireframe(true);else oSurfaceChart.setWireframe(false);oChart.plotArea.addChart(oSurfaceChart);var bInCols;if(isRealObject(oOptions))bInCols= oOptions.inColumns===true;else bInCols=false;var parsedHeaders=chartSeries.parsedHeaders;for(var i=0;i<asc_series.length;++i){var series=new AscFormat.CSurfaceSeries;series.setIdx(i);series.setOrder(i);series.setVal(new AscFormat.CYVal);FillValNum(series.val,asc_series[i].Val,bUseCache);if(asc_series[i].Cat&&typeof asc_series[i].Cat.Formula==="string"&&asc_series[i].Cat.Formula.length>0){series.setCat(new AscFormat.CCat);FillCatStr(series.cat,asc_series[i].Cat,bUseCache)}if(asc_series[i].TxCache&& typeof asc_series[i].TxCache.Formula==="string"&&asc_series[i].TxCache.Formula.length>0)FillSeriesTx(series,asc_series[i].TxCache,bUseCache);oSurfaceChart.addSer(series)}var oCatAx=new AscFormat.CCatAx;oCatAx.setAxId(++AscFormat.Ax_Counter.GLOBAL_AX_ID_COUNTER);var oScaling=new AscFormat.CScaling;oScaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);oCatAx.setScaling(oScaling);oCatAx.setDelete(false);oCatAx.setAxPos(AscFormat.AX_POS_B);oCatAx.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);oCatAx.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE); oCatAx.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);oCatAx.setCrosses(AscFormat.CROSSES_AUTO_ZERO);oCatAx.setAuto(true);oCatAx.setLblAlgn(AscFormat.LBL_ALG_CTR);oCatAx.setLblOffset(100);oCatAx.setNoMultiLvlLbl(false);var oValAx=new AscFormat.CValAx;oValAx.setAxId(++AscFormat.Ax_Counter.GLOBAL_AX_ID_COUNTER);var oValScaling=new AscFormat.CScaling;oValScaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);oValAx.setScaling(oValScaling);oValAx.setDelete(false);oValAx.setAxPos(AscFormat.AX_POS_L); oValAx.setMajorGridlines(new AscFormat.CSpPr);var oNumFmt=new AscFormat.CNumFmt;oNumFmt.setFormatCode(GetNumFormatFromSeries(asc_series));oNumFmt.setSourceLinked(true);oValAx.setNumFmt(oNumFmt);oValAx.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);oValAx.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);oValAx.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);oCatAx.setCrossAx(oValAx);oValAx.setCrossAx(oCatAx);oValAx.setCrosses(AscFormat.CROSSES_AUTO_ZERO);oValAx.setCrossBetween(AscFormat.CROSS_BETWEEN_MID_CAT); var oSerAx=new AscFormat.CSerAx;oSerAx.setAxId(++AscFormat.Ax_Counter.GLOBAL_AX_ID_COUNTER);var oSerScaling=new AscFormat.CScaling;oSerScaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);oSerAx.setScaling(oSerScaling);oSerAx.setDelete(false);oSerAx.setAxPos(AscFormat.AX_POS_B);oSerAx.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);oSerAx.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);oSerAx.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);oSerAx.setCrossAx(oCatAx);oSerAx.setCrosses(AscFormat.CROSSES_AUTO_ZERO); oChart.plotArea.addAxis(oCatAx);oChart.plotArea.addAxis(oValAx);oChart.plotArea.addAxis(oSerAx);oSurfaceChart.addAxId(oCatAx);oSurfaceChart.addAxId(oValAx);oSurfaceChart.addAxId(oSerAx);var oLegend=new AscFormat.CLegend;oLegend.setLegendPos(c_oAscChartLegendShowSettings.right);oLegend.setLayout(new AscFormat.CLayout);oLegend.setOverlay(false);oChart.setLegend(oLegend);oChart.setPlotVisOnly(true);oChart.setDispBlanksAs(DISP_BLANKS_AS_ZERO);oChart.setShowDLblsOverMax(false);var oPrintSettings=new AscFormat.CPrintSettings; oPrintSettings.setHeaderFooter(new AscFormat.CHeaderFooterChart);var oPageMargins=new AscFormat.CPageMarginsChart;oPageMargins.setB(.75);oPageMargins.setL(.7);oPageMargins.setR(.7);oPageMargins.setT(.75);oPageMargins.setHeader(.3);oPageMargins.setFooter(.3);oPrintSettings.setPageMargins(oPageMargins);oPrintSettings.setPageSetup(new AscFormat.CPageSetup);oChartSpace.setPrintSettings(oPrintSettings);return oChartSpace}function CreateDefaultAxises(valFormatCode){var cat_ax=new AscFormat.CCatAx;var val_ax= new AscFormat.CValAx;cat_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);val_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);cat_ax.setCrossAx(val_ax);val_ax.setCrossAx(cat_ax);cat_ax.setScaling(new AscFormat.CScaling);cat_ax.setDelete(false);cat_ax.setAxPos(AscFormat.AX_POS_B);cat_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);cat_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);cat_ax.setAuto(true);cat_ax.setLblAlgn(AscFormat.LBL_ALG_CTR);cat_ax.setLblOffset(100); cat_ax.setNoMultiLvlLbl(false);var scaling=cat_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);val_ax.setScaling(new AscFormat.CScaling);val_ax.setDelete(false);val_ax.setAxPos(AscFormat.AX_POS_L);val_ax.setMajorGridlines(new AscFormat.CSpPr);val_ax.setNumFmt(new AscFormat.CNumFmt);var num_fmt=val_ax.numFmt;num_fmt.setFormatCode(valFormatCode);num_fmt.setSourceLinked(true);val_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);val_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE); val_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);val_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);val_ax.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN);scaling=val_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);return{valAx:val_ax,catAx:cat_ax}}function CreateScatterAxis(){var cat_ax=new AscFormat.CValAx;var val_ax=new AscFormat.CValAx;cat_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);val_ax.setAxId(++Ax_Counter.GLOBAL_AX_ID_COUNTER);cat_ax.setCrossAx(val_ax); val_ax.setCrossAx(cat_ax);cat_ax.setScaling(new AscFormat.CScaling);cat_ax.setDelete(false);cat_ax.setAxPos(AscFormat.AX_POS_B);cat_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);cat_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);cat_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);cat_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);cat_ax.scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);val_ax.setScaling(new AscFormat.CScaling);val_ax.setDelete(false);val_ax.setAxPos(AscFormat.AX_POS_L); val_ax.setMajorGridlines(new AscFormat.CSpPr);val_ax.setNumFmt(new AscFormat.CNumFmt);val_ax.setMajorTickMark(c_oAscTickMark.TICK_MARK_OUT);val_ax.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);val_ax.setCrosses(AscFormat.CROSSES_AUTO_ZERO);val_ax.setCrossBetween(AscFormat.CROSS_BETWEEN_BETWEEN);var scaling=val_ax.scaling;scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);var num_fmt=val_ax.numFmt;var format_code="General"; num_fmt.setFormatCode(format_code);num_fmt.setSourceLinked(true);return{valAx:val_ax,catAx:cat_ax}}function fCheckNumFormatType(numFormatType){return numFormatType===c_oAscNumFormatType.Time||numFormatType===c_oAscNumFormatType.Date||numFormatType===c_oAscNumFormatType.Percent}function parseSeriesHeaders(ws,rangeBBox){var cntLeft=0,cntTop=0;var headers={bLeft:false,bTop:false};var i,cell,value,numFormatType,j;var bLeftOnlyDateTime=true,bTopOnlyDateTime=true;var nStartIndex;if(rangeBBox){if(rangeBBox.c2- rangeBBox.c1>0){var nStartIndex=rangeBBox.r1===rangeBBox.r2?rangeBBox.r1:rangeBBox.r1+1;cell=ws.getCell3(rangeBBox.r1,rangeBBox.c1);if(cell.isEmptyTextString())headers.bLeft=true;for(i=nStartIndex;i<=rangeBBox.r2;i++){cell=ws.getCell3(i,rangeBBox.c1);value=cell.getValue();numFormatType=cell.getNumFormatType();if(!AscCommon.isNumber(value)&&value!==""){bLeftOnlyDateTime=false;headers.bLeft=true}else if(fCheckNumFormatType(numFormatType))headers.bLeft=true}}if(rangeBBox.r2-rangeBBox.r1>0){cell=ws.getCell3(rangeBBox.r1, rangeBBox.c1);if(cell.isEmptyTextString())headers.bTop=true;var nStartIndex=rangeBBox.c1===rangeBBox.c2?rangeBBox.c1:rangeBBox.c1+1;for(i=nStartIndex;i<=rangeBBox.c2;i++){cell=ws.getCell3(rangeBBox.r1,i);value=cell.getValue();numFormatType=cell.getNumFormatType();if(!AscCommon.isNumber(value)&&value!==""){bTopOnlyDateTime=false;headers.bTop=true}else if(fCheckNumFormatType(numFormatType))headers.bTop=true}}if(headers.bTop||headers.bLeft){var nRowStart=headers.bTop?rangeBBox.r1+1:rangeBBox.r1,nColStart= headers.bLeft?rangeBBox.c1+1:rangeBBox.c1;for(i=nRowStart;i<=rangeBBox.r2;++i){for(j=nColStart;j<=rangeBBox.c2;++j){cell=ws.getCell3(i,j);value=cell.getValue();numFormatType=cell.getNumFormatType();if(!fCheckNumFormatType(numFormatType)&&value!=="")break}if(j<=rangeBBox.c2)break}if(i===rangeBBox.r2+1){if(headers.bLeft&&bLeftOnlyDateTime)headers.bLeft=false;if(headers.bTop&&bTopOnlyDateTime)headers.bTop=false}}}else headers={bLeft:true,bTop:true};return headers}function getNumCache(ws,c1,c2,r1,r2){var cache= [],cell,item;if(c1==c2)for(var row=r1;row<=r2;row++){cell=ws.getCell3(row,c1);item={};item.numFormatStr=cell.getNumFormatStr();item.isDateTimeFormat=cell.getNumFormat().isDateTimeFormat();item.val=cell.getValue();item.isHidden=ws.getColHidden(c1)||ws.getRowHidden(row);cache.push(item)}else for(var col=c1;col<=c2;col++){cell=ws.getCell3(r1,col,0);item={};item.numFormatStr=cell.getNumFormatStr();item.isDateTimeFormat=cell.getNumFormat().isDateTimeFormat();item.val=cell.getValue();item.isHidden=ws.getColHidden(col)|| ws.getRowHidden(r1);cache.push(item)}return cache}function getChartSeries(worksheet,options,catHeadersBBox,serHeadersBBox){var ws,range;var nameIndex=1;var aRanges=options.getRanges();var i,j,series=[],bbox;var result;var oWorksheet=null,r1=null,r2=null,c1=null,c2=null,r1temp,r2temp,c1temp,c2temp,bRows=null;var nSumRows=0,nSumCols=0;var nRangeIndex;var parsedHeaders;var aBBoxes=[];var bIsScatter=Asc.c_oAscChartTypeSettings.scatter<=options.type&&options.type<=Asc.c_oAscChartTypeSettings.scatterSmoothMarker; var top_header_bbox,left_header_bbox,ser,startCell,endCell,formulaCell,start,end,formula,numCache,sStartCellId,sEndCellId;var nStartCol,nStartRow,sFormula,sCatFormula,aCatCache;var aParsedRanges=[],oRange;for(nRangeIndex=0;nRangeIndex<aRanges.length;++nRangeIndex){var aParsed=AscFormat.fParseChartFormula(aRanges[nRangeIndex]);if(aParsed.length>0){oRange=aParsed[0].getMinimalCellsRange();if(oRange)aParsedRanges.push(AscFormat.fCreateRef(oRange))}}aRanges=aParsedRanges;if(aRanges.length>1){for(nRangeIndex= 0;nRangeIndex<aRanges.length;++nRangeIndex){result=parserHelp.parse3DRef(aRanges[nRangeIndex]);if(!result)break;if(result){ws=worksheet.workbook.getWorksheetByName(result.sheet);if(!ws)break;if(ws){range=ws.getRange2(result.range);if(!range)break;bbox=range.getBBox0();aBBoxes.push(bbox);r1temp=Math.min(bbox.r1,bbox.r1);r2temp=Math.max(bbox.r1,bbox.r2);c1temp=Math.min(bbox.c1,bbox.c1);c2temp=Math.max(bbox.c1,bbox.c2);if(!oWorksheet){oWorksheet=ws;r1=r1temp;r2=r2temp;c1=c1temp;c2=c2temp}else{if(oWorksheet!== ws)break;if(r1temp===r1&&r2temp===r2)if(bRows===null)bRows=true;else{if(bRows===false)break}else if(c1temp===c1&&c2temp===c2)if(bRows===null)bRows=false;else{if(bRows===true)break}else break}if(bRows===null||bRows===true)nSumCols+=c2temp-c1temp+1;if(bRows===null||bRows===false)nSumRows+=r2temp-r1temp+1}}}if(nRangeIndex===aRanges.length)if(bRows){aBBoxes.sort(function(a,b){return Math.min(a.c1,a.c2)-Math.min(b.c1,b.c2)});parsedHeaders=parseSeriesHeaders(oWorksheet,aBBoxes[0]);if(parsedHeaders.bLeft){--nSumCols; ++c1}if(parsedHeaders.bTop)++r1;if(nSumCols>=r2-r1+1){for(i=r1;i<=r2;++i){ser=new AscFormat.asc_CChartSeria;series.push(ser);sFormula="(";if(parsedHeaders.bLeft){formulaCell=new CellAddress(i,Math.min(aBBoxes[0].c1,aBBoxes[0].c2),0);ser.TxCache.Formula=parserHelp.get3DRef(oWorksheet.sName,formulaCell.getIDAbsolute())}if(parsedHeaders.bTop){sCatFormula="(";aCatCache=[]}for(j=0;j<aBBoxes.length;++j){bbox=aBBoxes[j];if(j===0&&parsedHeaders.bLeft){if(Math.max(bbox.c1,bbox.c2)-Math.min(bbox.c1,bbox.c2)=== 0)continue;nStartCol=Math.min(bbox.c1,bbox.c2)+1}else nStartCol=Math.min(bbox.c1,bbox.c2);startCell=new CellAddress(i,nStartCol,0);endCell=new CellAddress(i,Math.max(bbox.c1,bbox.c2),0);ser.isHidden=!!ws.getRowHidden(i);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();if(sFormula.length>1)sFormula+=",";sFormula+=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId:sStartCellId+":"+sEndCellId);ser.Val.NumCache=ser.Val.NumCache.concat(getNumCache(ws,nStartCol, Math.max(bbox.c1,bbox.c2),i,i));if(parsedHeaders.bTop){aCatCache=aCatCache.concat(getNumCache(ws,nStartCol,Math.max(bbox.c1,bbox.c2),Math.min(aBBoxes[0].r1,aBBoxes[0].r2)-1,Math.min(aBBoxes[0].r1,aBBoxes[0].r2)-1));startCell=new CellAddress(r1-1,nStartCol,0);endCell=new CellAddress(r1-1,Math.max(bbox.c1,bbox.c2),0);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();if(sCatFormula.length>1)sCatFormula+=",";sCatFormula+=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId: sStartCellId+":"+sEndCellId)}}sFormula+=")";ser.Val.Formula=sFormula;if(parsedHeaders.bTop){sCatFormula+=")";if(bIsScatter){ser.xVal.Formula=sCatFormula;ser.xVal.NumCache=aCatCache}else{ser.Cat.Formula=sCatFormula;ser.Cat.NumCache=aCatCache}}}return{series:series,parsedHeaders:parsedHeaders}}else{for(i=0;i<aBBoxes.length;++i){bbox=aBBoxes[i];if(i===0&&parsedHeaders.bLeft){if(Math.max(bbox.c1,bbox.c2)-Math.min(bbox.c1,bbox.c2)===0)continue;nStartCol=Math.min(bbox.c1,bbox.c2)+1}else nStartCol=Math.min(bbox.c1, bbox.c2);for(j=nStartCol;j<=Math.max(bbox.c1,bbox.c2);++j){startCell=new CellAddress(r1,j,0);endCell=new CellAddress(r2,j,0);ser=new AscFormat.asc_CChartSeria;series.push(ser);ser.isHidden=!!ws.getColHidden(j);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();ser.Val.Formula=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId:sStartCellId+":"+sEndCellId);ser.Val.NumCache=getNumCache(ws,j,j,r1,r2);if(parsedHeaders.bLeft){aCatCache=getNumCache(ws,Math.min(aBBoxes[0].c1, aBBoxes[0].c2),Math.min(aBBoxes[0].c1,aBBoxes[0].c2),Math.min(aBBoxes[0].r1,aBBoxes[0].r2),Math.max(aBBoxes[0].r1,aBBoxes[0].r2));startCell=new CellAddress(Math.min(r1,r2),Math.min(aBBoxes[0].c1,aBBoxes[0].c2),0);endCell=new CellAddress(Math.max(r1,r2),Math.min(aBBoxes[0].c1,aBBoxes[0].c2),0);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();sCatFormula=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId:sStartCellId+":"+sEndCellId);if(bIsScatter){ser.xVal.Formula= sCatFormula;ser.xVal.NumCache=aCatCache}else{ser.Cat.Formula=sCatFormula;ser.Cat.NumCache=aCatCache}}if(parsedHeaders.bTop){formulaCell=new CellAddress(Math.min(aBBoxes[0].r1,aBBoxes[0].r2),j,0);ser.TxCache.Formula=parserHelp.get3DRef(oWorksheet.sName,formulaCell.getIDAbsolute())}}}return{series:series,parsedHeaders:parsedHeaders}}}else{aBBoxes.sort(function(a,b){return Math.min(a.r1,a.r2)-Math.min(b.r1,b.r2)});parsedHeaders=parseSeriesHeaders(oWorksheet,aBBoxes[0]);if(parsedHeaders.bTop){--nSumRows; ++r1}if(parsedHeaders.bLeft)++c1;if(nSumRows>c2-c1+1){if(nSumRows>c2-c1+1){for(i=c1;i<=c2;++i){ser=new AscFormat.asc_CChartSeria;series.push(ser);sFormula="(";if(parsedHeaders.bTop){formulaCell=new CellAddress(Math.min(aBBoxes[0].r1,aBBoxes[0].r2),i,0);ser.TxCache.Formula=parserHelp.get3DRef(oWorksheet.sName,formulaCell.getIDAbsolute())}if(parsedHeaders.bLeft){sCatFormula="(";aCatCache=[]}for(j=0;j<aBBoxes.length;++j){bbox=aBBoxes[j];if(j===0&&parsedHeaders.bTop){if(Math.max(bbox.r1,bbox.r2)-Math.min(bbox.r1, bbox.r2)===0)continue;nStartRow=Math.min(bbox.r1,bbox.r2)+1}else nStartRow=Math.min(bbox.r1,bbox.r2);startCell=new CellAddress(nStartRow,i,0);endCell=new CellAddress(Math.max(bbox.r1,bbox.r2),i,0);ser.isHidden=!!ws.getColHidden(i);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();if(sFormula.length>1)sFormula+=",";sFormula+=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId:sStartCellId+":"+sEndCellId);ser.Val.NumCache=ser.Val.NumCache.concat(getNumCache(ws, i,i,nStartRow,Math.max(bbox.r1,bbox.r2)));if(parsedHeaders.bLeft){aCatCache=aCatCache.concat(getNumCache(ws,c1-1,c1-1,nStartRow,Math.max(bbox.r1,bbox.r2)));startCell=new CellAddress(nStartRow,c1-1,0);endCell=new CellAddress(Math.max(bbox.r1,bbox.r2),c1-1,0);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();if(sCatFormula.length>1)sCatFormula+=",";sCatFormula+=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId:sStartCellId+":"+sEndCellId)}}sFormula+=")";ser.Val.Formula= sFormula;if(parsedHeaders.bLeft){sCatFormula+=")";if(bIsScatter){ser.xVal.Formula=sCatFormula;ser.xVal.NumCache=aCatCache}else{ser.Cat.Formula=sCatFormula;ser.Cat.NumCache=aCatCache}}}return{series:series,parsedHeaders:parsedHeaders}}}else{for(i=0;i<aBBoxes.length;++i){bbox=aBBoxes[i];if(i===0&&parsedHeaders.bTop){if(Math.max(bbox.r1,bbox.r2)-Math.min(bbox.r1,bbox.r2)===0)continue;nStartRow=Math.min(bbox.r1,bbox.r2)+1}else nStartRow=Math.min(bbox.r1,bbox.r2);for(j=nStartRow;j<=Math.max(bbox.r1,bbox.r2);++j){startCell= new CellAddress(j,c1,0);endCell=new CellAddress(j,c2,0);ser=new AscFormat.asc_CChartSeria;series.push(ser);ser.isHidden=!!ws.getColHidden(j);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();ser.Val.Formula=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId:sStartCellId+":"+sEndCellId);ser.Val.NumCache=getNumCache(ws,c1,c2,j,j);if(parsedHeaders.bTop){aCatCache=getNumCache(ws,Math.min(c1,c2),Math.max(c1,c2),Math.min(aBBoxes[0].r1,aBBoxes[0].r2),Math.min(aBBoxes[0].r1, aBBoxes[0].r2));startCell=new CellAddress(Math.min(aBBoxes[0].r1,aBBoxes[0].r2),Math.min(c1,c2),0);endCell=new CellAddress(Math.min(aBBoxes[0].r1,aBBoxes[0].r2),Math.max(c1,c2),0);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();sCatFormula=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId:sStartCellId+":"+sEndCellId);if(bIsScatter){ser.xVal.Formula=sCatFormula;ser.xVal.NumCache=aCatCache}else{ser.Cat.Formula=sCatFormula;ser.Cat.NumCache=aCatCache}}if(parsedHeaders.bLeft){formulaCell= new CellAddress(j,Math.min(aBBoxes[0].c1,aBBoxes[0].c2),0);ser.TxCache.Formula=parserHelp.get3DRef(oWorksheet.sName,formulaCell.getIDAbsolute())}}}return{series:series,parsedHeaders:parsedHeaders}}}}var oFirstBBox;for(nRangeIndex=0;nRangeIndex<aRanges.length;++nRangeIndex){top_header_bbox=null;left_header_bbox=null;result=parserHelp.parse3DRef(aRanges[nRangeIndex]);if(result){ws=worksheet.workbook.getWorksheetByName(result.sheet);if(ws)range=ws.getRange2(result.range)}if(!range)continue;bbox=range.getBBox0(); if(nRangeIndex===0){oFirstBBox=bbox;parsedHeaders=parseSeriesHeaders(ws,bbox)}var data_bbox={r1:bbox.r1,r2:bbox.r2,c1:bbox.c1,c2:bbox.c2};if(parsedHeaders.bTop){if(oFirstBBox&&bbox.r1===oFirstBBox.r1)++data_bbox.r1}else if(!options.getInColumns()){if(catHeadersBBox&&catHeadersBBox.c1===data_bbox.c1&&catHeadersBBox.c2===data_bbox.c2&&catHeadersBBox.r1===catHeadersBBox.r2&&catHeadersBBox.r1===data_bbox.r1)++data_bbox.r1}else if(serHeadersBBox&&serHeadersBBox.c1===data_bbox.c1&&serHeadersBBox.c2===data_bbox.c2&& serHeadersBBox.r1===serHeadersBBox.r2&&serHeadersBBox.r1===data_bbox.r1)++data_bbox.r1;if(parsedHeaders.bLeft){if(oFirstBBox&&oFirstBBox.c1===bbox.c1)++data_bbox.c1}else if(!options.getInColumns()){if(serHeadersBBox&&serHeadersBBox.c1===serHeadersBBox.c2&&serHeadersBBox.r1===data_bbox.r1&&serHeadersBBox.r2===data_bbox.r2&&serHeadersBBox.c1===data_bbox.c1)++data_bbox.c1}else if(catHeadersBBox&&catHeadersBBox.c1===catHeadersBBox.c2&&catHeadersBBox.r1===data_bbox.r1&&catHeadersBBox.r2===data_bbox.r2&& catHeadersBBox.c1===data_bbox.c1)++data_bbox.c1;if(!options.getInColumns()){if(parsedHeaders.bTop){if(oFirstBBox&&oFirstBBox.r1===bbox.r1)top_header_bbox={r1:bbox.r1,c1:data_bbox.c1,r2:bbox.r1,c2:data_bbox.c2}}else if(catHeadersBBox&&catHeadersBBox.c1===data_bbox.c1&&catHeadersBBox.c2===data_bbox.c2&&catHeadersBBox.r1===catHeadersBBox.r2)top_header_bbox={r1:catHeadersBBox.r1,c1:catHeadersBBox.c1,r2:catHeadersBBox.r1,c2:catHeadersBBox.c2};if(parsedHeaders.bLeft){if(oFirstBBox&&oFirstBBox.c1===bbox.c1)left_header_bbox= {r1:data_bbox.r1,r2:data_bbox.r2,c1:bbox.c1,c2:bbox.c1}}else if(serHeadersBBox&&serHeadersBBox.c1===serHeadersBBox.c2&&serHeadersBBox.r1===data_bbox.r1&&serHeadersBBox.r2===data_bbox.r2)left_header_bbox={r1:serHeadersBBox.r1,c1:serHeadersBBox.c1,r2:serHeadersBBox.r1,c2:serHeadersBBox.c2};for(i=data_bbox.r1;i<=data_bbox.r2;++i){ser=new AscFormat.asc_CChartSeria;startCell=new CellAddress(i,data_bbox.c1,0);endCell=new CellAddress(i,data_bbox.c2,0);ser.isHidden=!!ws.getRowHidden(i);sStartCellId=startCell.getIDAbsolute(); sEndCellId=endCell.getIDAbsolute();ser.Val.Formula=parserHelp.get3DRef(ws.sName,sStartCellId===sEndCellId?sStartCellId:sStartCellId+":"+sEndCellId);ser.Val.NumCache=getNumCache(ws,data_bbox.c1,data_bbox.c2,i,i);if(left_header_bbox){formulaCell=new CellAddress(i,left_header_bbox.c1,0);ser.TxCache.Formula=parserHelp.get3DRef(ws.sName,formulaCell.getIDAbsolute())}if(top_header_bbox){start=new CellAddress(top_header_bbox.r1,top_header_bbox.c1,0);end=new CellAddress(top_header_bbox.r1,top_header_bbox.c2, 0);formula=parserHelp.get3DRef(ws.sName,start.getIDAbsolute()+":"+end.getIDAbsolute());numCache=getNumCache(ws,top_header_bbox.c1,top_header_bbox.c2,top_header_bbox.r1,top_header_bbox.r1);if(bIsScatter){ser.xVal.Formula=formula;ser.xVal.NumCache=numCache}else{ser.Cat.Formula=formula;ser.Cat.NumCache=numCache}}ser.TxCache.Tx=left_header_bbox?ws.getCell3(i,left_header_bbox.c1).getValue():AscCommon.translateManager.getValue("Series")+" "+nameIndex;series.push(ser);nameIndex++}}else{if(parsedHeaders.bTop){if(oFirstBBox&& oFirstBBox.r1===bbox.r1)top_header_bbox={r1:bbox.r1,c1:data_bbox.c1,r2:bbox.r1,c2:data_bbox.c2}}else if(serHeadersBBox&&serHeadersBBox.r1===serHeadersBBox.r2&&serHeadersBBox.c1===data_bbox.c1&&serHeadersBBox.c2===data_bbox.c2)top_header_bbox={r1:serHeadersBBox.r1,c1:serHeadersBBox.c1,r2:serHeadersBBox.r2,c2:serHeadersBBox.c2};if(parsedHeaders.bLeft){if(oFirstBBox&&oFirstBBox.c1===bbox.c1)left_header_bbox={r1:data_bbox.r1,c1:bbox.c1,r2:data_bbox.r2,c2:bbox.c1}}else if(catHeadersBBox&&catHeadersBBox.c1=== catHeadersBBox.c2&&catHeadersBBox.r1===data_bbox.r1&&catHeadersBBox.r2===data_bbox.r2)left_header_bbox={r1:catHeadersBBox.r1,c1:catHeadersBBox.c1,r2:catHeadersBBox.r2,c2:catHeadersBBox.c2};for(i=data_bbox.c1;i<=data_bbox.c2;i++){ser=new AscFormat.asc_CChartSeria;startCell=new CellAddress(data_bbox.r1,i,0);endCell=new CellAddress(data_bbox.r2,i,0);ser.isHidden=!!ws.getColHidden(i);sStartCellId=startCell.getIDAbsolute();sEndCellId=endCell.getIDAbsolute();if(sStartCellId==sEndCellId)ser.Val.Formula= parserHelp.get3DRef(ws.sName,sStartCellId);else ser.Val.Formula=parserHelp.get3DRef(ws.sName,sStartCellId+":"+sEndCellId);ser.Val.NumCache=getNumCache(ws,i,i,data_bbox.r1,bbox.r2);if(left_header_bbox){start=new CellAddress(left_header_bbox.r1,left_header_bbox.c1,0);end=new CellAddress(left_header_bbox.r2,left_header_bbox.c1,0);formula=parserHelp.get3DRef(ws.sName,start.getIDAbsolute()+":"+end.getIDAbsolute());numCache=getNumCache(ws,left_header_bbox.c1,left_header_bbox.c1,left_header_bbox.r1,left_header_bbox.r2); if(bIsScatter){ser.xVal.Formula=formula;ser.xVal.NumCache=numCache}else{ser.Cat.Formula=formula;ser.Cat.NumCache=numCache}}if(top_header_bbox){formulaCell=new CellAddress(top_header_bbox.r1,i,0);ser.TxCache.Formula=parserHelp.get3DRef(ws.sName,formulaCell.getIDAbsolute())}ser.TxCache.Tx=top_header_bbox?ws.getCell3(top_header_bbox.r1,i).getValue():AscCommon.translateManager.getValue("Series")+" "+nameIndex;series.push(ser);nameIndex++}}}return{series:series,parsedHeaders:parsedHeaders}}function checkSpPrRasterImages(spPr){if(spPr&& spPr.Fill&&spPr.Fill&&spPr.Fill.fill&&spPr.Fill.fill.type===Asc.c_oAscFill.FILL_TYPE_BLIP){var copyBlipFill=spPr.Fill.createDuplicate();copyBlipFill.fill.setRasterImageId(spPr.Fill.fill.RasterImageId);spPr.setFill(copyBlipFill)}}function checkBlipFillRasterImages(sp){switch(sp.getObjectType()){case AscDFH.historyitem_type_Shape:{checkSpPrRasterImages(sp.spPr);break}case AscDFH.historyitem_type_ImageShape:case AscDFH.historyitem_type_OleObject:{if(sp.blipFill){var newBlipFill=sp.blipFill.createDuplicate(); newBlipFill.setRasterImageId(sp.blipFill.RasterImageId);sp.setBlipFill(newBlipFill)}break}case AscDFH.historyitem_type_ChartSpace:{checkSpPrRasterImages(sp.spPr);var chart=sp.chart;if(chart){chart.backWall&&checkSpPrRasterImages(chart.backWall.spPr);chart.floor&&checkSpPrRasterImages(chart.floor.spPr);chart.legend&&checkSpPrRasterImages(chart.legend.spPr);chart.sideWall&&checkSpPrRasterImages(chart.sideWall.spPr);chart.title&&checkSpPrRasterImages(chart.title.spPr);var plot_area=sp.chart.plotArea; if(plot_area){checkSpPrRasterImages(plot_area.spPr);for(var j=0;j<plot_area.axId.length;++j){var axis=plot_area.axId[j];if(axis){checkSpPrRasterImages(axis.spPr);axis.title&&axis.title&&checkSpPrRasterImages(axis.title.spPr)}}for(j=0;j<plot_area.charts.length;++j)plot_area.charts[j].checkSpPrRasterImages()}}break}case AscDFH.historyitem_type_GroupShape:{for(var i=0;i<sp.spTree.length;++i)checkBlipFillRasterImages(sp.spTree[i]);break}case AscDFH.historyitem_type_GraphicFrame:{break}}}function initStyleManager(){CHART_STYLE_MANAGER.init()} window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].BAR_SHAPE_CONE=BAR_SHAPE_CONE;window["AscFormat"].BAR_SHAPE_CONETOMAX=BAR_SHAPE_CONETOMAX;window["AscFormat"].BAR_SHAPE_BOX=BAR_SHAPE_BOX;window["AscFormat"].BAR_SHAPE_CYLINDER=BAR_SHAPE_CYLINDER;window["AscFormat"].BAR_SHAPE_PYRAMID=BAR_SHAPE_PYRAMID;window["AscFormat"].BAR_SHAPE_PYRAMIDTOMAX=BAR_SHAPE_PYRAMIDTOMAX;window["AscFormat"].DISP_BLANKS_AS_GAP=DISP_BLANKS_AS_GAP;window["AscFormat"].DISP_BLANKS_AS_SPAN=DISP_BLANKS_AS_SPAN;window["AscFormat"].DISP_BLANKS_AS_ZERO= DISP_BLANKS_AS_ZERO;window["AscFormat"].checkBlackUnifill=checkBlackUnifill;window["AscFormat"].BBoxInfo=BBoxInfo;window["AscFormat"].CreateUnifillSolidFillSchemeColorByIndex=CreateUnifillSolidFillSchemeColorByIndex;window["AscFormat"].CreateUniFillSchemeColorWidthTint=CreateUniFillSchemeColorWidthTint;window["AscFormat"].G_O_VISITED_HLINK_COLOR=G_O_VISITED_HLINK_COLOR;window["AscFormat"].G_O_HLINK_COLOR=G_O_HLINK_COLOR;window["AscFormat"].G_O_NO_ACTIVE_COMMENT_BRUSH=G_O_NO_ACTIVE_COMMENT_BRUSH;window["AscFormat"].G_O_ACTIVE_COMMENT_BRUSH= G_O_ACTIVE_COMMENT_BRUSH;window["AscFormat"].CChartSpace=CChartSpace;window["AscFormat"].getPtsFromSeries=getPtsFromSeries;window["AscFormat"].CreateUnfilFromRGB=CreateUnfilFromRGB;window["AscFormat"].CreateUniFillSolidFillWidthTintOrShade=CreateUniFillSolidFillWidthTintOrShade;window["AscFormat"].CreateUnifillSolidFillSchemeColor=CreateUnifillSolidFillSchemeColor;window["AscFormat"].CreateNoFillLine=CreateNoFillLine;window["AscFormat"].CreateNoFillUniFill=CreateNoFillUniFill;window["AscFormat"].CExternalData= CExternalData;window["AscFormat"].CPivotSource=CPivotSource;window["AscFormat"].CProtection=CProtection;window["AscFormat"].CPrintSettings=CPrintSettings;window["AscFormat"].CHeaderFooterChart=CHeaderFooterChart;window["AscFormat"].CPageMarginsChart=CPageMarginsChart;window["AscFormat"].CPageSetup=CPageSetup;window["AscFormat"].CreateView3d=CreateView3d;window["AscFormat"].CreateLineChart=CreateLineChart;window["AscFormat"].CreateBarChart=CreateBarChart;window["AscFormat"].CreateHBarChart=CreateHBarChart; window["AscFormat"].CreateAreaChart=CreateAreaChart;window["AscFormat"].CreatePieChart=CreatePieChart;window["AscFormat"].CreateScatterChart=CreateScatterChart;window["AscFormat"].CreateStockChart=CreateStockChart;window["AscFormat"].CreateDefaultAxises=CreateDefaultAxises;window["AscFormat"].CreateScatterAxis=CreateScatterAxis;window["AscFormat"].getChartSeries=getChartSeries;window["AscFormat"].parseSeriesHeaders=parseSeriesHeaders;window["AscFormat"].checkSpPrRasterImages=checkSpPrRasterImages; window["AscFormat"].checkBlipFillRasterImages=checkBlipFillRasterImages;window["AscFormat"].PAGE_SETUP_ORIENTATION_DEFAULT=0;window["AscFormat"].PAGE_SETUP_ORIENTATION_LANDSCAPE=1;window["AscFormat"].PAGE_SETUP_ORIENTATION_PORTRAIT=2;window["AscFormat"].MAX_SERIES_COUNT=MAX_SERIES_COUNT;window["AscFormat"].MAX_POINTS_COUNT=MAX_POINTS_COUNT;window["AscFormat"].initStyleManager=initStyleManager;window["AscFormat"].CHART_STYLE_MANAGER=CHART_STYLE_MANAGER;window["AscFormat"].CheckParagraphTextPr=CheckParagraphTextPr; window["AscFormat"].CheckObjectTextPr=CheckObjectTextPr;window["AscFormat"].CreateColorMapByIndex=CreateColorMapByIndex;window["AscFormat"].getArrayFillsFromBase=getArrayFillsFromBase;window["AscFormat"].getMaxIdx=getMaxIdx;window["AscFormat"].CreateSurfaceChart=CreateSurfaceChart;window["AscFormat"].CPathMemory=CPathMemory})(window);"use strict";(function(window,undefined){var drawingsChangesMap=window["AscDFH"].drawingsChangesMap;var drawingContentChanges=window["AscDFH"].drawingContentChanges; drawingsChangesMap[AscDFH.historyitem_DLbl_SetDelete]=function(oClass,value){oClass.bDelete=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetDLblPos]=function(oClass,value){oClass.dLblPos=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetLayout]=function(oClass,value){oClass.layout=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetNumFmt]=function(oClass,value){oClass.numFmt=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetSeparator]= function(oClass,value){oClass.separator=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetShowBubbleSize]=function(oClass,value){oClass.showBubbleSize=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetShowCatName]=function(oClass,value){oClass.showCatName=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetShowLegendKey]=function(oClass,value){oClass.showLegendKey=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetShowPercent]=function(oClass,value){oClass.showPercent=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetShowSerName]= function(oClass,value){oClass.showSerName=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetShowVal]=function(oClass,value){oClass.showVal=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetTx]=function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetTxPr]=function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_DLbl_SetParent]=function(oClass,value){oClass.parent= value};drawingsChangesMap[AscDFH.historyitem_PlotArea_SetCatAx]=function(oClass,value){oClass.catAx=value};drawingsChangesMap[AscDFH.historyitem_PlotArea_SetDateAx]=function(oClass,value){oClass.dateAx=value};drawingsChangesMap[AscDFH.historyitem_PlotArea_SetDTable]=function(oClass,value){oClass.dTable=value};drawingsChangesMap[AscDFH.historyitem_PlotArea_SetLayout]=function(oClass,value){oClass.layout=value};drawingsChangesMap[AscDFH.historyitem_PlotArea_SetSpPr]=function(oClass,value){oClass.spPr= value};drawingsChangesMap[AscDFH.historyitem_CommonChartFormat_SetParent]=function(oClass,value){oClass.parent=value};drawingsChangesMap[AscDFH.historyitem_CommonChart_SetDlbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_BarChart_Set3D]=function(oClass,value){oClass.b3D=value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetGapDepth]=function(oClass,value){oClass.gapDepth=value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetShape]=function(oClass,value){oClass.shape= value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetBarDir]=function(oClass,value){oClass.barDir=value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetGapWidth]=function(oClass,value){oClass.gapWidth=value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetGrouping]=function(oClass,value){oClass.grouping=value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetOverlap]=function(oClass,value){oClass.overlap= value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetSerLines]=function(oClass,value){oClass.serLines=value};drawingsChangesMap[AscDFH.historyitem_BarChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_CommonChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_AreaChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_AreaChart_SetDropLines]=function(oClass, value){oClass.dropLines=value};drawingsChangesMap[AscDFH.historyitem_AreaChart_SetGrouping]=function(oClass,value){oClass.grouping=value};drawingsChangesMap[AscDFH.historyitem_AreaChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetCat]=function(oClass,value){oClass.cat=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetErrBars]= function(oClass,value){oClass.errBars=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetPictureOptions]=function(oClass,value){oClass.pictureOptions=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetTrendline]= function(oClass,value){oClass.trendline=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetTx]=function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_AreaSeries_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetAuto]=function(oClass,value){oClass.auto=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetAxId]=function(oClass,value){oClass.axId=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetAxPos]=function(oClass,value){oClass.axPos= value};drawingsChangesMap[AscDFH.historyitem_CatAxSetCrossAx]=function(oClass,value){oClass.crossAx=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetCrosses]=function(oClass,value){oClass.crosses=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetCrossesAt]=function(oClass,value){oClass.crossesAt=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetDelete]=function(oClass,value){oClass.bDelete=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetLblAlgn]=function(oClass,value){oClass.lblAlgn= value};drawingsChangesMap[AscDFH.historyitem_CatAxSetLblOffset]=function(oClass,value){oClass.lblOffset=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetMajorGridlines]=function(oClass,value){oClass.majorGridlines=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetMajorTickMark]=function(oClass,value){oClass.majorTickMark=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetMinorGridlines]=function(oClass,value){oClass.minorGridlines=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetMinorTickMark]= function(oClass,value){oClass.minorTickMark=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetNoMultiLvlLbl]=function(oClass,value){oClass.noMultiLvlLbl=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetNumFmt]=function(oClass,value){oClass.numFmt=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetScaling]=function(oClass,value){oClass.scaling=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetTickLblPos]= function(oClass,value){oClass.tickLblPos=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetTickLblSkip]=function(oClass,value){oClass.tickLblSkip=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetTickMarkSkip]=function(oClass,value){oClass.tickMarkSkip=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetTitle]=function(oClass,value){oClass.title=value};drawingsChangesMap[AscDFH.historyitem_CatAxSetTxPr]=function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_DateAxAuto]= function(oClass,value){oClass.auto=value};drawingsChangesMap[AscDFH.historyitem_DateAxAxId]=function(oClass,value){oClass.axId=value};drawingsChangesMap[AscDFH.historyitem_DateAxAxPos]=function(oClass,value){oClass.axPos=value};drawingsChangesMap[AscDFH.historyitem_DateAxBaseTimeUnit]=function(oClass,value){oClass.baseTimeUnit=value};drawingsChangesMap[AscDFH.historyitem_DateAxCrossAx]=function(oClass,value){oClass.crossAx=value};drawingsChangesMap[AscDFH.historyitem_DateAxCrosses]=function(oClass, value){oClass.crosses=value};drawingsChangesMap[AscDFH.historyitem_DateAxCrossesAt]=function(oClass,value){oClass.crossesAt=value};drawingsChangesMap[AscDFH.historyitem_DateAxDelete]=function(oClass,value){oClass.bDelete=value};drawingsChangesMap[AscDFH.historyitem_DateAxLblOffset]=function(oClass,value){oClass.lblOffset=value};drawingsChangesMap[AscDFH.historyitem_DateAxMajorGridlines]=function(oClass,value){oClass.majorGridlines=value};drawingsChangesMap[AscDFH.historyitem_DateAxMajorTickMark]= function(oClass,value){oClass.majorTickMark=value};drawingsChangesMap[AscDFH.historyitem_DateAxMajorTimeUnit]=function(oClass,value){oClass.majorTimeUnit=value};drawingsChangesMap[AscDFH.historyitem_DateAxMajorUnit]=function(oClass,value){oClass.majorUnit=value};drawingsChangesMap[AscDFH.historyitem_DateAxMajorGridlines]=function(oClass,value){oClass.majorGridlines=value};drawingsChangesMap[AscDFH.historyitem_DateAxMinorTickMark]=function(oClass,value){oClass.minorTickMark=value};drawingsChangesMap[AscDFH.historyitem_DateAxMinorTimeUnit]= function(oClass,value){oClass.minorTimeUnit=value};drawingsChangesMap[AscDFH.historyitem_DateAxMinorUnit]=function(oClass,value){oClass.minorUnit=value};drawingsChangesMap[AscDFH.historyitem_DateAxNumFmt]=function(oClass,value){oClass.numFmt=value};drawingsChangesMap[AscDFH.historyitem_DateAxScaling]=function(oClass,value){oClass.scaling=value};drawingsChangesMap[AscDFH.historyitem_DateAxSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_DateAxTickLblPos]=function(oClass, value){oClass.tickLblPos=value};drawingsChangesMap[AscDFH.historyitem_DateAxTitle]=function(oClass,value){oClass.title=value};drawingsChangesMap[AscDFH.historyitem_DateAxTxPr]=function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetAxId]=function(oClass,value){oClass.axId=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetAxPos]=function(oClass,value){oClass.axPos=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetCrossAx]=function(oClass,value){oClass.crossAx= value};drawingsChangesMap[AscDFH.historyitem_SerAxSetCrosses]=function(oClass,value){oClass.crosses=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetCrossesAt]=function(oClass,value){oClass.crossesAt=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetDelete]=function(oClass,value){oClass.bDelete=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetMajorGridlines]=function(oClass,value){oClass.majorGridlines=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetMajorTickMark]=function(oClass, value){oClass.majorTickMark=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetMinorGridlines]=function(oClass,value){oClass.minorGridlines=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetMinorTickMark]=function(oClass,value){oClass.minorTickMark=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetNumFmt]=function(oClass,value){oClass.numFmt=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetScaling]=function(oClass,value){oClass.scaling=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetSpPr]= function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetTickLblPos]=function(oClass,value){oClass.tickLblPos=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetTickLblSkip]=function(oClass,value){oClass.tickLblSkip=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetTickMarkSkip]=function(oClass,value){oClass.tickMarkSkip=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetTitle]=function(oClass,value){oClass.title=value};drawingsChangesMap[AscDFH.historyitem_SerAxSetTxPr]= function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetAxId]=function(oClass,value){oClass.axId=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetAxPos]=function(oClass,value){oClass.axPos=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetCrossAx]=function(oClass,value){oClass.crossAx=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetCrossBetween]=function(oClass,value){oClass.crossBetween=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetCrosses]=function(oClass, value){oClass.crosses=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetCrossesAt]=function(oClass,value){oClass.crossesAt=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetDelete]=function(oClass,value){oClass.bDelete=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetDispUnits]=function(oClass,value){oClass.dispUnits=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetMajorGridlines]=function(oClass,value){oClass.majorGridlines=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetMajorTickMark]= function(oClass,value){oClass.majorTickMark=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetMajorUnit]=function(oClass,value){oClass.majorUnit=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetMinorGridlines]=function(oClass,value){oClass.minorGridlines=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetMinorTickMark]=function(oClass,value){oClass.minorTickMark=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetMinorUnit]=function(oClass,value){oClass.minorUnit=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetNumFmt]= function(oClass,value){oClass.numFmt=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetScaling]=function(oClass,value){oClass.scaling=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetTickLblPos]=function(oClass,value){oClass.tickLblPos=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetTitle]=function(oClass,value){oClass.title=value};drawingsChangesMap[AscDFH.historyitem_ValAxSetTxPr]=function(oClass, value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_BandFmt_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_BandFmt_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetCat]=function(oClass,value){oClass.cat=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetErrBars]=function(oClass,value){oClass.errBars= value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetInvertIfNegative]=function(oClass,value){oClass.invertIfNegative=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetPictureOptions]=function(oClass,value){oClass.pictureOptions=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetShape]= function(oClass,value){oClass.shape=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetTrendline]=function(oClass,value){oClass.trendline=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetTx]=function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_BarSeries_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_BubbleChart_SetBubble3D]= function(oClass,value){oClass.bubble3D=value};drawingsChangesMap[AscDFH.historyitem_BubbleChart_SetBubbleScale]=function(oClass,value){oClass.bubbleScale=value};drawingsChangesMap[AscDFH.historyitem_BubbleChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_BubbleChart_SetShowNegBubbles]=function(oClass,value){oClass.showNegBubbles=value};drawingsChangesMap[AscDFH.historyitem_BubbleChart_SetSizeRepresents]=function(oClass,value){oClass.sizeRepresents=value}; drawingsChangesMap[AscDFH.historyitem_BubbleChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetBubble3D]=function(oClass,value){oClass.bubble3D=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetBubbleSize]=function(oClass,value){oClass.bubbleSize=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetErrBars]= function(oClass,value){oClass.errBars=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetInvertIfNegative]=function(oClass,value){oClass.invertIfNegative=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetTrendline]= function(oClass,value){oClass.trendline=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetTx]=function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetXVal]=function(oClass,value){oClass.xVal=value};drawingsChangesMap[AscDFH.historyitem_BubbleSeries_SetYVal]=function(oClass,value){oClass.yVal=value};drawingsChangesMap[AscDFH.historyitem_Cat_SetMultiLvlStrRef]=function(oClass,value){oClass.multiLvlStrRef=value};drawingsChangesMap[AscDFH.historyitem_Cat_SetNumLit]= function(oClass,value){oClass.numLit=value};drawingsChangesMap[AscDFH.historyitem_Cat_SetNumRef]=function(oClass,value){oClass.numRef=value};drawingsChangesMap[AscDFH.historyitem_Cat_SetStrLit]=function(oClass,value){oClass.strLit=value};drawingsChangesMap[AscDFH.historyitem_Cat_SetStrRef]=function(oClass,value){oClass.strRef=value};drawingsChangesMap[AscDFH.historyitem_ChartText_SetRich]=function(oClass,value){oClass.rich=value};drawingsChangesMap[AscDFH.historyitem_ChartText_SetStrRef]=function(oClass, value){oClass.strRef=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetDelete]=function(oClass,value){oClass.bDelete=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetDLblPos]=function(oClass,value){oClass.dLblPos=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetLeaderLines]=function(oClass,value){oClass.leaderLines=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetNumFmt]=function(oClass,value){oClass.numFmt=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetSeparator]=function(oClass, value){oClass.separator=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetShowBubbleSize]=function(oClass,value){oClass.showBubbleSize=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetShowCatName]=function(oClass,value){oClass.showCatName=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetShowLeaderLines]=function(oClass,value){oClass.showLeaderLines=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetShowLegendKey]=function(oClass,value){oClass.showLegendKey=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetShowPercent]= function(oClass,value){oClass.showPercent=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetShowSerName]=function(oClass,value){oClass.showSerName=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetShowVal]=function(oClass,value){oClass.showVal=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_DLbls_SetTxPr]=function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_DPt_SetBubble3D]= function(oClass,value){oClass.bubble3D=value};drawingsChangesMap[AscDFH.historyitem_DPt_SetExplosion]=function(oClass,value){oClass.explosion=value};drawingsChangesMap[AscDFH.historyitem_DPt_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_DPt_SetInvertIfNegative]=function(oClass,value){oClass.invertIfNegative=value};drawingsChangesMap[AscDFH.historyitem_DPt_SetMarker]=function(oClass,value){oClass.marker=value};drawingsChangesMap[AscDFH.historyitem_DPt_SetPictureOptions]= function(oClass,value){oClass.pictureOptions=value};drawingsChangesMap[AscDFH.historyitem_DPt_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_DTable_SetShowHorzBorder]=function(oClass,value){oClass.showHorzBorder=value};drawingsChangesMap[AscDFH.historyitem_DTable_SetShowKeys]=function(oClass,value){oClass.showKeys=value};drawingsChangesMap[AscDFH.historyitem_DTable_SetShowOutline]=function(oClass,value){oClass.showOutline=value};drawingsChangesMap[AscDFH.historyitem_DTable_SetShowVertBorder]= function(oClass,value){oClass.showVertBorder=value};drawingsChangesMap[AscDFH.historyitem_DTable_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_DTable_SetTxPr]=function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_DispUnitsSetParent]=function(oClass,value){oClass.parent=value};drawingsChangesMap[AscDFH.historyitem_DispUnitsSetBuiltInUnit]=function(oClass,value){oClass.builtInUnit=value};drawingsChangesMap[AscDFH.historyitem_DispUnitsSetCustUnit]= function(oClass,value){oClass.custUnit=value};drawingsChangesMap[AscDFH.historyitem_DispUnitsSetDispUnitsLbl]=function(oClass,value){oClass.dispUnitsLbl=value};drawingsChangesMap[AscDFH.historyitem_DoughnutChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_DoughnutChart_SetFirstSliceAng]=function(oClass,value){oClass.firstSliceAng=value};drawingsChangesMap[AscDFH.historyitem_DoughnutChart_SetHoleSize]=function(oClass,value){oClass.holeSize=value};drawingsChangesMap[AscDFH.historyitem_DoughnutChart_SetVaryColor]= function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_ErrBars_SetErrBarType]=function(oClass,value){oClass.errBarType=value};drawingsChangesMap[AscDFH.historyitem_ErrBars_SetErrDir]=function(oClass,value){oClass.errDir=value};drawingsChangesMap[AscDFH.historyitem_ErrBars_SetErrValType]=function(oClass,value){oClass.errValType=value};drawingsChangesMap[AscDFH.historyitem_ErrBars_SetMinus]=function(oClass,value){oClass.minus=value};drawingsChangesMap[AscDFH.historyitem_ErrBars_SetNoEndCap]= function(oClass,value){oClass.noEndCap=value};drawingsChangesMap[AscDFH.historyitem_ErrBars_SetPlus]=function(oClass,value){oClass.plus=value};drawingsChangesMap[AscDFH.historyitem_ErrBars_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_ErrBars_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetH]=function(oClass,value){oClass.h=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetHMode]=function(oClass,value){oClass.hMode= value};drawingsChangesMap[AscDFH.historyitem_Layout_SetLayoutTarget]=function(oClass,value){oClass.layoutTarget=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetW]=function(oClass,value){oClass.w=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetWMode]=function(oClass,value){oClass.wMode=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetX]=function(oClass,value){oClass.x=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetXMode]=function(oClass,value){oClass.xMode=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetY]= function(oClass,value){oClass.y=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetYMode]=function(oClass,value){oClass.yMode=value};drawingsChangesMap[AscDFH.historyitem_Layout_SetParent]=function(oClass,value){oClass.parent=value};drawingsChangesMap[AscDFH.historyitem_Legend_SetLayout]=function(oClass,value){oClass.layout=value};drawingsChangesMap[AscDFH.historyitem_Legend_SetLegendPos]=function(oClass,value){oClass.legendPos=value};drawingsChangesMap[AscDFH.historyitem_Legend_SetOverlay]=function(oClass, value){oClass.overlay=value};drawingsChangesMap[AscDFH.historyitem_Legend_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_Legend_SetTxPr]=function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_LegendEntry_SetDelete]=function(oClass,value){oClass.bDelete=value};drawingsChangesMap[AscDFH.historyitem_LegendEntry_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_LegendEntry_SetTxPr]=function(oClass, value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_LineChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_LineChart_SetDropLines]=function(oClass,value){oClass.dropLines=value};drawingsChangesMap[AscDFH.historyitem_LineChart_SetGrouping]=function(oClass,value){oClass.grouping=value};drawingsChangesMap[AscDFH.historyitem_LineChart_SetHiLowLines]=function(oClass,value){oClass.hiLowLines=value};drawingsChangesMap[AscDFH.historyitem_LineChart_SetMarker]= function(oClass,value){oClass.marker=value};drawingsChangesMap[AscDFH.historyitem_LineChart_SetSmooth]=function(oClass,value){oClass.smooth=value};drawingsChangesMap[AscDFH.historyitem_LineChart_SetUpDownBars]=function(oClass,value){oClass.upDownBars=value};drawingsChangesMap[AscDFH.historyitem_LineChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetCat]=function(oClass,value){oClass.cat=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetDLbls]= function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetErrBars]=function(oClass,value){oClass.errBars=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetMarker]=function(oClass,value){oClass.marker=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetSmooth]= function(oClass,value){oClass.smooth=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetTrendline]=function(oClass,value){oClass.trendline=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetTx]=function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_LineSeries_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_Marker_SetSize]= function(oClass,value){oClass.size=value};drawingsChangesMap[AscDFH.historyitem_Marker_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_Marker_SetSymbol]=function(oClass,value){oClass.symbol=value};drawingsChangesMap[AscDFH.historyitem_MinusPlus_SetnNumLit]=function(oClass,value){oClass.numLit=value};drawingsChangesMap[AscDFH.historyitem_MinusPlus_SetnNumRef]=function(oClass,value){oClass.numRef=value};drawingsChangesMap[AscDFH.historyitem_MultiLvlStrRef_SetF]= function(oClass,value){oClass.f=value};drawingsChangesMap[AscDFH.historyitem_MultiLvlStrRef_SetMultiLvlStrCache]=function(oClass,value){oClass.multiLvlStrCache=value};drawingsChangesMap[AscDFH.historyitem_NumRef_SetF]=function(oClass,value){oClass.f=value};drawingsChangesMap[AscDFH.historyitem_NumRef_SetNumCache]=function(oClass,value){oClass.numCache=value};drawingsChangesMap[AscDFH.historyitem_NumericPoint_SetFormatCode]=function(oClass,value){oClass.formatCode=value};drawingsChangesMap[AscDFH.historyitem_NumericPoint_SetIdx]= function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_NumericPoint_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_NumFmt_SetFormatCode]=function(oClass,value){oClass.formatCode=value};drawingsChangesMap[AscDFH.historyitem_NumFmt_SetSourceLinked]=function(oClass,value){oClass.sourceLinked=value};drawingsChangesMap[AscDFH.historyitem_NumLit_SetFormatCode]=function(oClass,value){oClass.formatCode=value};drawingsChangesMap[AscDFH.historyitem_NumLit_SetPtCount]= function(oClass,value){oClass.ptCount=value};drawingsChangesMap[AscDFH.historyitem_OfPieChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_OfPieChart_SetGapWidth]=function(oClass,value){oClass.gapWidth=value};drawingsChangesMap[AscDFH.historyitem_OfPieChart_SetOfPieType]=function(oClass,value){oClass.ofPieType=value};drawingsChangesMap[AscDFH.historyitem_OfPieChart_SetSecondPieSize]=function(oClass,value){oClass.secondPieSize=value};drawingsChangesMap[AscDFH.historyitem_OfPieChart_SetSerLines]= function(oClass,value){oClass.serLines=value};drawingsChangesMap[AscDFH.historyitem_OfPieChart_SetSplitPos]=function(oClass,value){oClass.splitPos=value};drawingsChangesMap[AscDFH.historyitem_OfPieChart_SetSplitType]=function(oClass,value){oClass.splitType=value};drawingsChangesMap[AscDFH.historyitem_OfPieChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_PictureOptions_SetApplyToEnd]=function(oClass,value){oClass.applyToEnd=value};drawingsChangesMap[AscDFH.historyitem_PictureOptions_SetApplyToFront]= function(oClass,value){oClass.applyToFront=value};drawingsChangesMap[AscDFH.historyitem_PictureOptions_SetApplyToSides]=function(oClass,value){oClass.applyToSides=value};drawingsChangesMap[AscDFH.historyitem_PictureOptions_SetPictureFormat]=function(oClass,value){oClass.pictureFormat=value};drawingsChangesMap[AscDFH.historyitem_PictureOptions_SetPictureStackUnit]=function(oClass,value){oClass.pictureStackUnit=value};drawingsChangesMap[AscDFH.historyitem_PieChart_SetDLbls]=function(oClass,value){oClass.dLbls= value};drawingsChangesMap[AscDFH.historyitem_PieChart_SetFirstSliceAng]=function(oClass,value){oClass.firstSliceAng=value};drawingsChangesMap[AscDFH.historyitem_PieChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_PieChart_3D]=function(oClass,value){oClass.b3D=value};drawingsChangesMap[AscDFH.historyitem_PieSeries_SetCat]=function(oClass,value){oClass.cat=value};drawingsChangesMap[AscDFH.historyitem_PieSeries_SetDLbls]=function(oClass,value){oClass.dLbls= value};drawingsChangesMap[AscDFH.historyitem_PieSeries_SetExplosion]=function(oClass,value){oClass.explosion=value};drawingsChangesMap[AscDFH.historyitem_PieSeries_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_PieSeries_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_PieSeries_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_PieSeries_SetTx]=function(oClass,value){oClass.tx= value};drawingsChangesMap[AscDFH.historyitem_PieSeries_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_PivotFmt_SetDLbl]=function(oClass,value){oClass.dLbl=value};drawingsChangesMap[AscDFH.historyitem_PivotFmt_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_PivotFmt_SetMarker]=function(oClass,value){oClass.marker=value};drawingsChangesMap[AscDFH.historyitem_PivotFmt_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_PivotFmt_SetTxPr]= function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_RadarChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_RadarChart_SetRadarStyle]=function(oClass,value){oClass.radarStyle=value};drawingsChangesMap[AscDFH.historyitem_RadarChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_RadarSeries_SetCat]=function(oClass,value){oClass.cat=value};drawingsChangesMap[AscDFH.historyitem_RadarSeries_SetDLbls]= function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_RadarSeries_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_RadarSeries_SetMarker]=function(oClass,value){oClass.marker=value};drawingsChangesMap[AscDFH.historyitem_RadarSeries_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_RadarSeries_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_RadarSeries_SetTx]= function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_RadarSeries_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_Scaling_SetParent]=function(oClass,value){oClass.parent=value};drawingsChangesMap[AscDFH.historyitem_Scaling_SetLogBase]=function(oClass,value){oClass.logBase=value};drawingsChangesMap[AscDFH.historyitem_Scaling_SetMax]=function(oClass,value){oClass.max=value};drawingsChangesMap[AscDFH.historyitem_Scaling_SetMin]=function(oClass, value){oClass.min=value};drawingsChangesMap[AscDFH.historyitem_Scaling_SetOrientation]=function(oClass,value){oClass.orientation=value};drawingsChangesMap[AscDFH.historyitem_ScatterChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_ScatterChart_SetScatterStyle]=function(oClass,value){oClass.scatterStyle=value};drawingsChangesMap[AscDFH.historyitem_ScatterChart_SetVaryColors]=function(oClass,value){oClass.varyColors=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetDLbls]= function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetErrBars]=function(oClass,value){oClass.errBars=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetMarker]=function(oClass,value){oClass.marker=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetSmooth]= function(oClass,value){oClass.smooth=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetTrendline]=function(oClass,value){oClass.trendline=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetTx]=function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetXVal]=function(oClass,value){oClass.xVal=value};drawingsChangesMap[AscDFH.historyitem_ScatterSer_SetYVal]= function(oClass,value){oClass.yVal=value};drawingsChangesMap[AscDFH.historyitem_Tx_SetStrRef]=function(oClass,value){oClass.strRef=value};drawingsChangesMap[AscDFH.historyitem_Tx_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_StockChart_SetDLbls]=function(oClass,value){oClass.dLbls=value};drawingsChangesMap[AscDFH.historyitem_StockChart_SetDropLines]=function(oClass,value){oClass.dropLines=value};drawingsChangesMap[AscDFH.historyitem_StockChart_SetHiLowLines]= function(oClass,value){oClass.hiLowLines=value};drawingsChangesMap[AscDFH.historyitem_StockChart_SetUpDownBars]=function(oClass,value){oClass.upDownBars=value};drawingsChangesMap[AscDFH.historyitem_StrCache_SetPtCount]=function(oClass,value){oClass.ptCount=value};drawingsChangesMap[AscDFH.historyitem_StrPoint_SetIdx]=function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_StrPoint_SetVal]=function(oClass,value){oClass.val=value;if(AscFonts.IsCheckSymbols)if(typeof value==="string"&& value.length>0)AscFonts.FontPickerByCharacter.getFontsByString(value)};drawingsChangesMap[AscDFH.historyitem_StrRef_SetF]=function(oClass,value){oClass.f=value};drawingsChangesMap[AscDFH.historyitem_StrRef_SetStrCache]=function(oClass,value){oClass.strCache=value};drawingsChangesMap[AscDFH.historyitem_SurfaceChart_SetWireframe]=function(oClass,value){oClass.wireframe=value};drawingsChangesMap[AscDFH.historyitem_SurfaceSeries_SetCat]=function(oClass,value){oClass.cat=value};drawingsChangesMap[AscDFH.historyitem_SurfaceSeries_SetIdx]= function(oClass,value){oClass.idx=value};drawingsChangesMap[AscDFH.historyitem_SurfaceSeries_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_SurfaceSeries_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_SurfaceSeries_SetTx]=function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_SurfaceSeries_SetVal]=function(oClass,value){oClass.val=value};drawingsChangesMap[AscDFH.historyitem_Title_SetLayout]= function(oClass,value){oClass.layout=value};drawingsChangesMap[AscDFH.historyitem_Title_SetOverlay]=function(oClass,value){oClass.overlay=value};drawingsChangesMap[AscDFH.historyitem_Title_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_Title_SetTx]=function(oClass,value){oClass.tx=value};drawingsChangesMap[AscDFH.historyitem_Title_SetTxPr]=function(oClass,value){oClass.txPr=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetBackward]=function(oClass, value){oClass.backward=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetDispEq]=function(oClass,value){oClass.dispEq=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetDispRSqr]=function(oClass,value){oClass.dispRSqr=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetForward]=function(oClass,value){oClass.forward=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetIntercept]=function(oClass,value){oClass.intercept=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetName]= function(oClass,value){oClass.name=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetOrder]=function(oClass,value){oClass.order=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetPeriod]=function(oClass,value){oClass.period=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetTrendlineLbl]=function(oClass,value){oClass.trendlineLbl=value};drawingsChangesMap[AscDFH.historyitem_Trendline_SetTrendlineType]= function(oClass,value){oClass.trendlineType=value};drawingsChangesMap[AscDFH.historyitem_UpDownBars_SetDownBars]=function(oClass,value){oClass.downBars=value};drawingsChangesMap[AscDFH.historyitem_UpDownBars_SetGapWidth]=function(oClass,value){oClass.gapWidth=value};drawingsChangesMap[AscDFH.historyitem_UpDownBars_SetUpBars]=function(oClass,value){oClass.upBars=value};drawingsChangesMap[AscDFH.historyitem_XVal_SetMultiLvlStrRef]=function(oClass,value){oClass.multiLvlStrRef=value};drawingsChangesMap[AscDFH.historyitem_XVal_SetNumLit]= function(oClass,value){oClass.numLit=value};drawingsChangesMap[AscDFH.historyitem_XVal_SetNumRef]=function(oClass,value){oClass.numRef=value};drawingsChangesMap[AscDFH.historyitem_XVal_SetStrLit]=function(oClass,value){oClass.strLit=value};drawingsChangesMap[AscDFH.historyitem_XVal_SetStrRef]=function(oClass,value){oClass.strRef=value};drawingsChangesMap[AscDFH.historyitem_YVal_SetNumLit]=function(oClass,value){oClass.numLit=value};drawingsChangesMap[AscDFH.historyitem_YVal_SetNumRef]=function(oClass, value){oClass.numRef=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetAutoTitleDeleted]=function(oClass,value){oClass.autoTitleDeleted=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetBackWall]=function(oClass,value){oClass.backWall=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetDispBlanksAs]=function(oClass,value){oClass.dispBlanksAs=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetFloor]=function(oClass,value){oClass.floor=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetLegend]= function(oClass,value){oClass.legend=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetPlotArea]=function(oClass,value){oClass.plotArea=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetPlotVisOnly]=function(oClass,value){oClass.plotVisOnly=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetShowDLblsOverMax]=function(oClass,value){oClass.showDLblsOverMax=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetSideWall]=function(oClass,value){oClass.sideWall=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetTitle]= function(oClass,value){oClass.title=value};drawingsChangesMap[AscDFH.historyitem_Chart_SetView3D]=function(oClass,value){oClass.view3D=value;oClass.Refresh_RecalcData()};drawingsChangesMap[AscDFH.historyitem_ChartWall_SetPictureOptions]=function(oClass,value){oClass.pictureOptions=value};drawingsChangesMap[AscDFH.historyitem_ChartWall_SetSpPr]=function(oClass,value){oClass.spPr=value};drawingsChangesMap[AscDFH.historyitem_ChartWall_SetThickness]=function(oClass,value){oClass.thickness=value};drawingsChangesMap[AscDFH.historyitem_View3d_SetDepthPercent]= function(oClass,value){oClass.depthPercent=value;oClass.Refresh_RecalcData()};drawingsChangesMap[AscDFH.historyitem_View3d_SetHPercent]=function(oClass,value){oClass.hPercent=value;oClass.Refresh_RecalcData()};drawingsChangesMap[AscDFH.historyitem_View3d_SetPerspective]=function(oClass,value){oClass.perspective=value;oClass.Refresh_RecalcData()};drawingsChangesMap[AscDFH.historyitem_View3d_SetRAngAx]=function(oClass,value){oClass.rAngAx=value;oClass.Refresh_RecalcData()};drawingsChangesMap[AscDFH.historyitem_View3d_SetRotX]= function(oClass,value){oClass.rotX=value;oClass.Refresh_RecalcData()};drawingsChangesMap[AscDFH.historyitem_View3d_SetRotY]=function(oClass,value){oClass.rotY=value;oClass.Refresh_RecalcData()};drawingsChangesMap[AscDFH.historyitem_CommonSeries_SetIdx]=function(oClass,value){oClass.idx=value;oClass.Refresh_RecalcData({Type:AscDFH.historyitem_CommonSeries_SetIdx})};drawingsChangesMap[AscDFH.historyitem_CommonSeries_SetOrder]=function(oClass,value){oClass.order=value;oClass.Refresh_RecalcData({Type:AscDFH.historyitem_CommonSeries_SetOrder})}; drawingsChangesMap[AscDFH.historyitem_CommonSeries_SetTx]=function(oClass,value){oClass.tx=value;oClass.Refresh_RecalcData({Type:AscDFH.historyitem_CommonSeries_SetTx})};drawingsChangesMap[AscDFH.historyitem_CommonSeries_SetSpPr]=function(oClass,value){oClass.spPr=value;oClass.Refresh_RecalcData({Type:AscDFH.historyitem_CommonSeries_SetSpPr})};AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetDelete]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetShowBubbleSize]= window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetShowCatName]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetShowLegendKey]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetShowPercent]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetShowSerName]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetShowVal]=window["AscDFH"].CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_BarChart_Set3D]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_CommonChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_AreaChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetAuto]=window["AscDFH"].CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_CatAxSetDelete]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetNoMultiLvlLbl]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DateAxAuto]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DateAxDelete]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetDelete]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetDelete]= window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetInvertIfNegative]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_BubbleChart_SetBubble3D]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_BubbleChart_SetShowNegBubbles]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_BubbleChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetBubble3D]= window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetInvertIfNegative]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetDelete]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetShowBubbleSize]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetShowCatName]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetShowLeaderLines]= window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetShowLegendKey]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetShowPercent]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetShowSerName]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetShowVal]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DPt_SetBubble3D]=window["AscDFH"].CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_DPt_SetInvertIfNegative]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DTable_SetShowHorzBorder]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DTable_SetShowKeys]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DTable_SetShowOutline]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DTable_SetShowVertBorder]=window["AscDFH"].CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_DoughnutChart_SetVaryColor]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetNoEndCap]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Legend_SetOverlay]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_LegendEntry_SetDelete]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetMarker]=window["AscDFH"].CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetSmooth]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetSmooth]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_NumFmt_SetSourceLinked]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_PieChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_PieChart_3D]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_RadarChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ScatterChart_SetVaryColors]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetSmooth]=window["AscDFH"].CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_SurfaceChart_SetWireframe]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Title_SetOverlay]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetDispEq]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetDispRSqr]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetAutoTitleDeleted]=window["AscDFH"].CChangesDrawingsBool; AscDFH.changesFactory[AscDFH.historyitem_Chart_SetPlotVisOnly]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetShowDLblsOverMax]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_View3d_SetRAngAx]=window["AscDFH"].CChangesDrawingsBool;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetDLblPos]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetGapDepth]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetShape]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetBarDir]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetGapWidth]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetGrouping]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetOverlap]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_AreaChart_SetGrouping]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetAxId]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetAxPos]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetCrosses]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetLblAlgn]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetLblOffset]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetMajorTickMark]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetMinorTickMark]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetTickLblPos]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_CatAxSetTickLblSkip]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetTickMarkSkip]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DateAxAxPos]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DateAxCrosses]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DateAxLblOffset]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DateAxMajorTickMark]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DateAxMinorTickMark]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DateAxTickLblPos]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetAxId]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetAxPos]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetMajorTickMark]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_SerAxSetMinorTickMark]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetTickLblPos]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetTickLblSkip]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetTickMarkSkip]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetAxId]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetAxPos]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetCrossBetween]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetMajorTickMark]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetMinorTickMark]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetTickLblPos]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BandFmt_SetIdx]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BubbleChart_SetBubbleScale]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BubbleChart_SetSizeRepresents]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetIdx]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetDLblPos]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DPt_SetExplosion]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DPt_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DispUnitsSetParent]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DoughnutChart_SetFirstSliceAng]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_DoughnutChart_SetHoleSize]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetErrBarType]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetErrDir]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetErrValType]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetHMode]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetLayoutTarget]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetWMode]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetXMode]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetYMode]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Legend_SetLegendPos]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_LegendEntry_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetGrouping]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Marker_SetSize]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Marker_SetSymbol]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_MultiLvlStrCache_SetPtCount]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_NumLit_SetPtCount]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_SetGapWidth]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_SetOfPieType]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_SetSecondPieSize]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_SetSplitType]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PictureOptions_SetPictureFormat]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PieChart_SetFirstSliceAng]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetExplosion]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetIdx]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_PivotFmt_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Scaling_SetOrientation]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ScatterChart_SetScatterStyle]= window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_StrCache_SetPtCount]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_StringLiteral_SetPtCount]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_StrPoint_SetIdx]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_SurfaceSeries_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_SurfaceSeries_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetPeriod]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetTrendlineType]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_UpDownBars_SetGapWidth]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetDispBlanksAs]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_ChartWall_SetThickness]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_View3d_SetDepthPercent]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_View3d_SetHPercent]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_View3d_SetPerspective]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_View3d_SetRotX]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_View3d_SetRotY]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_NumericPoint_SetIdx]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetCrossesAt]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_DateAxBaseTimeUnit]= window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_DateAxCrossesAt]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_DateAxMajorTimeUnit]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_DateAxMajorUnit]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_DateAxMinorTimeUnit]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_DateAxMinorUnit]=window["AscDFH"].CChangesDrawingsDouble; AscDFH.changesFactory[AscDFH.historyitem_SerAxSetCrosses]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetCrossesAt]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetCrosses]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetCrossesAt]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetMajorUnit]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetMinorUnit]= window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_DispUnitsSetBuiltInUnit]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetVal]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetH]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetW]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetX]=window["AscDFH"].CChangesDrawingsDouble; AscDFH.changesFactory[AscDFH.historyitem_Layout_SetY]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Layout_SetParent]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_SetSplitPos]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_PictureOptions_SetPictureStackUnit]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Scaling_SetLogBase]=window["AscDFH"].CChangesDrawingsDouble2; AscDFH.changesFactory[AscDFH.historyitem_Scaling_SetMax]=window["AscDFH"].CChangesDrawingsDouble2;AscDFH.changesFactory[AscDFH.historyitem_Scaling_SetMin]=window["AscDFH"].CChangesDrawingsDouble2;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetBackward]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetForward]=window["AscDFH"].CChangesDrawingsDouble;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetIntercept]=window["AscDFH"].CChangesDrawingsDouble; AscDFH.changesFactory[AscDFH.historyitem_NumericPoint_SetVal]=window["AscDFH"].CChangesDrawingsDouble2;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetSeparator]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_DateAxAxId]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetSeparator]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_MultiLvlStrRef_SetF]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_NumRef_SetF]= window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_NumericPoint_SetFormatCode]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_NumFmt_SetFormatCode]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_NumLit_SetFormatCode]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_Tx_SetVal]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_StrPoint_SetVal]= window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_StrRef_SetF]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetName]=window["AscDFH"].CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetLayout]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetNumFmt]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetSpPr]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetTxPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetParent]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PlotArea_SetDTable]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PlotArea_SetLayout]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PlotArea_SetSpPr]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CommonChartFormat_SetParent]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CommonChart_SetDlbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarChart_SetSerLines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaChart_SetDLbls]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaChart_SetDropLines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetErrBars]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetPictureOptions]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetTrendline]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetVal]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetCrossAx]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetMajorGridlines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetMinorGridlines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetNumFmt]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetScaling]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetSpPr]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_CatAxSetTitle]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CatAxSetTxPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DateAxCrossAx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DateAxMajorGridlines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DateAxMajorGridlines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DateAxNumFmt]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DateAxScaling]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DateAxSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DateAxTitle]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DateAxTxPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetCrossAx]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_SerAxSetMajorGridlines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetMinorGridlines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetNumFmt]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetScaling]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetTitle]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SerAxSetTxPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetCrossAx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetDispUnits]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetMajorGridlines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetMinorGridlines]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetNumFmt]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetScaling]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetTitle]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ValAxSetTxPr]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_BandFmt_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetErrBars]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetPictureOptions]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetShape]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetTrendline]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetVal]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_BubbleChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetBubbleSize]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetDPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetErrBars]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetTrendline]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetXVal]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_BubbleSeries_SetYVal]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_Cat_SetMultiLvlStrRef]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Cat_SetNumLit]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Cat_SetNumRef]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Cat_SetStrLit]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Cat_SetStrRef]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartFormatSetChart]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartText_SetRich]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartText_SetStrRef]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetLeaderLines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetNumFmt]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetSpPr]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetTxPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DPt_SetMarker]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DPt_SetPictureOptions]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DPt_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DTable_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DTable_SetTxPr]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DispUnitsSetCustUnit]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DispUnitsSetDispUnitsLbl]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_DoughnutChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetMinus]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetPlus]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Legend_SetLayout]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Legend_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Legend_SetTxPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LegendEntry_SetTxPr]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetDropLines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetHiLowLines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetUpDownBars]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetErrBars]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetMarker]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetTrendline]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetVal]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Marker_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_MinusPlus_SetnNumLit]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_MinusPlus_SetnNumRef]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_MultiLvlStrRef_SetMultiLvlStrCache]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_NumRef_SetNumCache]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_SetSerLines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PictureOptions_SetApplyToEnd]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_PictureOptions_SetApplyToFront]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PictureOptions_SetApplyToSides]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PieChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetDLbls]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetVal]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PivotFmt_SetDLbl]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PivotFmt_SetMarker]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PivotFmt_SetSpPr]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PivotFmt_SetTxPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarChart_SetRadarStyle]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetDLbls]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetCat]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Scaling_SetParent]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetDPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetErrBars]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetMarker]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetTrendline]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetXVal]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ScatterSer_SetYVal]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Tx_SetStrRef]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_StockChart_SetDLbls]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_StockChart_SetDropLines]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_StockChart_SetHiLowLines]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_StockChart_SetUpDownBars]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_StrRef_SetStrCache]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SurfaceSeries_SetCat]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SurfaceSeries_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SurfaceSeries_SetTx]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_SurfaceSeries_SetVal]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Title_SetLayout]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Title_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Title_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Title_SetTxPr]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetTrendlineLbl]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_UpDownBars_SetDownBars]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_UpDownBars_SetUpBars]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_XVal_SetMultiLvlStrRef]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_XVal_SetNumLit]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_XVal_SetNumRef]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_XVal_SetStrLit]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_XVal_SetStrRef]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_YVal_SetNumLit]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_YVal_SetNumRef]= window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetBackWall]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetFloor]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetLegend]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetPlotArea]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetSideWall]=window["AscDFH"].CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_Chart_SetTitle]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_Chart_SetView3D]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartWall_SetPictureOptions]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_ChartWall_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_PlotArea_AddAxis]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_PlotArea_AddChart]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_PlotArea_RemoveChart]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_PlotArea_RemoveAxis]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_CommonChart_RemoveSeries]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_CommonChart_AddSeries]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_CommonChart_AddFilteredSeries]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_CommonChart_RemoveFilteredSeries]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_BarChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_CommonChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_BarChart_AddSer]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_AreaChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_AreaChart_AddSer]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_AreaSeries_SetDPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_CommonSeries_RemoveDPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_BarSeries_SetDPt]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_BubbleChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_BubbleChart_AddSerie]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetDLbl]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_DoughnutChart_AddSer]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_Legend_AddLegendEntry]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_LineChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_LineChart_AddSer]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_LineSeries_SetDPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_MultiLvlStrCache_SetLvl]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_CommonLit_RemoveDPt]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_NumLit_AddPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_AddCustSplit]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_OfPieChart_AddSer]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_PieChart_AddSer]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_PieSeries_SetDPt]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_RadarChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_RadarChart_AddSer]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_RadarSeries_SetDPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_ScatterChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_ScatterChart_AddSer]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_StockChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_StockChart_AddSer]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_CommonLit_RemoveDPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_StrCache_AddPt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_StringLiteral_SetPt]=window["AscDFH"].CChangesDrawingsContent; AscDFH.changesFactory[AscDFH.historyitem_SurfaceChart_AddAxId]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_SurfaceChart_AddBandFmt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_SurfaceChart_AddSer]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_Chart_AddPivotFmt]=window["AscDFH"].CChangesDrawingsContent;AscDFH.changesFactory[AscDFH.historyitem_CommonSeries_SetIdx]=window["AscDFH"].CChangesDrawingsLong; AscDFH.changesFactory[AscDFH.historyitem_CommonSeries_SetOrder]=window["AscDFH"].CChangesDrawingsLong;AscDFH.changesFactory[AscDFH.historyitem_CommonSeries_SetTx]=window["AscDFH"].CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_CommonSeries_SetSpPr]=window["AscDFH"].CChangesDrawingsObject;drawingContentChanges[AscDFH.historyitem_PlotArea_AddAxis]=drawingContentChanges[AscDFH.historyitem_BarChart_AddAxId]=drawingContentChanges[AscDFH.historyitem_AreaChart_AddAxId]=drawingContentChanges[AscDFH.historyitem_CommonChart_AddAxId]= drawingContentChanges[AscDFH.historyitem_BubbleChart_AddAxId]=drawingContentChanges[AscDFH.historyitem_LineChart_AddAxId]=drawingContentChanges[AscDFH.historyitem_RadarChart_AddAxId]=drawingContentChanges[AscDFH.historyitem_ScatterChart_AddAxId]=drawingContentChanges[AscDFH.historyitem_StockChart_AddAxId]=drawingContentChanges[AscDFH.historyitem_SurfaceChart_AddAxId]=drawingContentChanges[AscDFH.historyitem_PlotArea_RemoveAxis]=function(oClass){return oClass.axId};drawingContentChanges[AscDFH.historyitem_PlotArea_AddChart]= drawingContentChanges[AscDFH.historyitem_PlotArea_RemoveChart]=function(oClass){return oClass.charts};drawingContentChanges[AscDFH.historyitem_CommonChart_RemoveSeries]=drawingContentChanges[AscDFH.historyitem_CommonChart_AddSeries]=drawingContentChanges[AscDFH.historyitem_BarChart_AddSer]=drawingContentChanges[AscDFH.historyitem_AreaChart_AddSer]=drawingContentChanges[AscDFH.historyitem_AreaChart_AddSer]=drawingContentChanges[AscDFH.historyitem_BubbleChart_AddSerie]=drawingContentChanges[AscDFH.historyitem_DoughnutChart_AddSer]= drawingContentChanges[AscDFH.historyitem_LineChart_AddSer]=drawingContentChanges[AscDFH.historyitem_OfPieChart_AddSer]=drawingContentChanges[AscDFH.historyitem_PieChart_AddSer]=drawingContentChanges[AscDFH.historyitem_RadarChart_AddSer]=drawingContentChanges[AscDFH.historyitem_ScatterChart_AddSer]=drawingContentChanges[AscDFH.historyitem_StockChart_AddSer]=drawingContentChanges[AscDFH.historyitem_SurfaceChart_AddSer]=function(oClass){return oClass.series};drawingContentChanges[AscDFH.historyitem_CommonChart_AddFilteredSeries]= drawingContentChanges[AscDFH.historyitem_CommonChart_RemoveFilteredSeries]=function(oClass){return oClass.filteredSeries};drawingContentChanges[AscDFH.historyitem_AreaSeries_SetDPt]=drawingContentChanges[AscDFH.historyitem_CommonSeries_RemoveDPt]=drawingContentChanges[AscDFH.historyitem_BarSeries_SetDPt]=drawingContentChanges[AscDFH.historyitem_LineSeries_SetDPt]=drawingContentChanges[AscDFH.historyitem_PieSeries_SetDPt]=drawingContentChanges[AscDFH.historyitem_ScatterSer_SetDPt]=drawingContentChanges[AscDFH.historyitem_BubbleSeries_SetDPt]= drawingContentChanges[AscDFH.historyitem_RadarSeries_SetDPt]=drawingContentChanges[AscDFH.historyitem_PieSeries_SetDPt]=drawingContentChanges[AscDFH.historyitem_LineSeries_SetDPt]=drawingContentChanges[AscDFH.historyitem_RadarSeries_SetDPt]=function(oClass){return oClass.dPt};drawingContentChanges[AscDFH.historyitem_DLbls_SetDLbl]=function(oClass){return oClass.dLbl};drawingContentChanges[AscDFH.historyitem_Legend_AddLegendEntry]=function(oClass){return oClass.legendEntryes};drawingContentChanges[AscDFH.historyitem_MultiLvlStrCache_SetLvl]= function(oClass){return oClass.lvl};drawingContentChanges[AscDFH.historyitem_CommonLit_RemoveDPt]=drawingContentChanges[AscDFH.historyitem_NumLit_AddPt]=drawingContentChanges[AscDFH.historyitem_StrCache_AddPt]=drawingContentChanges[AscDFH.historyitem_StringLiteral_SetPt]=function(oClass){return oClass.pts};drawingContentChanges[AscDFH.historyitem_OfPieChart_AddCustSplit]=function(oClass){return oClass.custSplit};drawingContentChanges[AscDFH.historyitem_SurfaceChart_AddBandFmt]=function(oClass){return oClass.bandFmts}; drawingContentChanges[AscDFH.historyitem_Chart_AddPivotFmt]=function(oClass){return oClass.pivotFmts};var g_oIdCounter=AscCommon.g_oIdCounter;var g_oTableId=AscCommon.g_oTableId;var CMatrix=AscCommon.CMatrix;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var global_MatrixTransformer=AscCommon.global_MatrixTransformer;var CShape=AscFormat.CShape;var checkSpPrRasterImages=AscFormat.checkSpPrRasterImages;var c_oAscChartLegendShowSettings=Asc.c_oAscChartLegendShowSettings;var c_oAscChartDataLabelsPos= Asc.c_oAscChartDataLabelsPos;var c_oAscValAxisRule=Asc.c_oAscValAxisRule;var c_oAscValAxUnits=Asc.c_oAscValAxUnits;var c_oAscTickMark=Asc.c_oAscTickMark;var c_oAscTickLabelsPos=Asc.c_oAscTickLabelsPos;var c_oAscCrossesRule=Asc.c_oAscCrossesRule;var c_oAscBetweenLabelsRule=Asc.c_oAscBetweenLabelsRule;var c_oAscLabelsPosition=Asc.c_oAscLabelsPosition;var c_oAscAxisType=Asc.c_oAscAxisType;var CChangesDrawingsBool=AscDFH.CChangesDrawingsBool;var CChangesDrawingsLong=AscDFH.CChangesDrawingsLong;var CChangesDrawingsDouble= AscDFH.CChangesDrawingsDouble;var CChangesDrawingsString=AscDFH.CChangesDrawingsString;var CChangesDrawingsObjectNoId=AscDFH.CChangesDrawingsObjectNoId;var CChangesDrawingsObject=AscDFH.CChangesDrawingsObject;var CChangesDrawingsContent=AscDFH.CChangesDrawingsContent;var CChangesDrawingsDouble2=AscDFH.CChangesDrawingsDouble2;function getMinMaxFromArrPoints(aPoints){if(Array.isArray(aPoints)&&aPoints.length>0)if(isRealObject(aPoints[0])&&AscFormat.isRealNumber(aPoints[0].val)&&isRealObject(aPoints[aPoints.length- 1])&&AscFormat.isRealNumber(aPoints[aPoints.length-1].val))if(aPoints[0].val-aPoints[aPoints.length-1].val<=0)return{min:aPoints[0].val,max:aPoints[aPoints.length-1].val};else return{min:aPoints[aPoints.length-1].val,max:aPoints[0].val};return{min:null,max:null}}var SCALE_INSET_COEFF=1.016;function CDLbl(){AscFormat.CBaseObject.call(this);this.bDelete=null;this.dLblPos=null;this.idx=null;this.layout=null;this.numFmt=null;this.separator=null;this.showBubbleSize=null;this.showCatName=null;this.showLegendKey= null;this.showPercent=null;this.showSerName=null;this.showVal=null;this.spPr=null;this.tx=null;this.txPr=null;this.parent=null;this.recalcInfo={recalcTransform:true,recalculateTransformText:true,recalcStyle:true,recalculateTxBody:true,recalculateBrush:true,recalculatePen:true,recalculateContent:true};this.chart=null;this.series=null;this.x=0;this.y=0;this.calcX=null;this.calcY=null;this.relPosX=null;this.relPosY=null;this.txBody=null;this.transform=new CMatrix;this.transformText=new CMatrix;this.ownTransform= new CMatrix;this.ownTransformText=new CMatrix;this.localTransform=new CMatrix;this.localTransformText=new CMatrix;this.compiledStyles=null;this.parent=null}CDLbl.prototype=Object.create(AscFormat.CBaseObject.prototype);CDLbl.prototype.constructor=CDLbl;CDLbl.prototype.Refresh_RecalcData=function(){this.Refresh_RecalcData2()};CDLbl.prototype.getObjectType=function(){return AscDFH.historyitem_type_DLbl};CDLbl.prototype.Check_AutoFit=function(){return true};CDLbl.prototype.createDuplicate=function(){var c= new CDLbl;c.setDelete(this.bDelete);c.setDLblPos(this.dLblPos);c.setIdx(this.idx);if(this.layout)c.setLayout(this.layout.createDuplicate());if(this.numFmt)c.setNumFmt(this.numFmt.createDuplicate());c.setSeparator(this.separator);c.setShowBubbleSize(this.showBubbleSize);c.setShowCatName(this.showCatName);c.setShowLegendKey(this.showLegendKey);c.setShowPercent(this.showPercent);c.setShowSerName(this.showSerName);c.setShowVal(this.showVal);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate()); if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c};CDLbl.prototype.checkShapeChildTransform=function(transform){this.updatePosition(this.posX,this.posY);global_MatrixTransformer.MultiplyAppend(this.transform,transform);global_MatrixTransformer.MultiplyAppend(this.transformText,transform);if(this instanceof CTitle||this instanceof CDLbl){this.invertTransform=global_MatrixTransformer.Invert(this.transform);this.invertTransformText=global_MatrixTransformer.Invert(this.transformText)}};CDLbl.prototype.getCompiledFill= function(){return this.spPr&&this.spPr.Fill?this.spPr.Fill:null};CDLbl.prototype.getCompiledLine=function(){return this.spPr&&this.spPr.ln?this.spPr.ln:null};CDLbl.prototype.getCompiledTransparent=function(){return this.spPr&&this.spPr.Fill?this.spPr.Fill.transparent:null};CDLbl.prototype.recalculate=function(){if(this.bDelete)return;AscFormat.ExecuteNoHistory(function(){if(this.recalcInfo.recalculateBrush){this.recalculateBrush();this.recalcInfo.recalculateBrush=false}if(this.recalcInfo.recalculatePen){this.recalculatePen(); this.recalcInfo.recalculatePen=false}if(this.recalcInfo.recalcStyle)this.recalculateStyle();if(this.recalcInfo.recalculateTxBody){this.recalculateTxBody();this.recalcInfo.recalculateTxBody=false}if(this.recalcInfo.recalculateContent)this.recalculateContent();if(this.recalcInfo.recalcTransform)this.recalculateTransform();if(this.recalcInfo.recalculateTransformText)this.recalculateTransformText();if(this.chart)this.chart.addToSetPosition(this)},this,[])};CDLbl.prototype.recalculateBrush=CShape.prototype.recalculateBrush; CDLbl.prototype.recalculatePen=CShape.prototype.recalculatePen;CDLbl.prototype.check_bounds=CShape.prototype.check_bounds;CDLbl.prototype.selectionCheck=CShape.prototype.selectionCheck;CDLbl.prototype.getInvertTransform=CShape.prototype.getInvertTransform;CDLbl.prototype.getDocContent=CShape.prototype.getDocContent;CDLbl.prototype.updateSelectionState=function(){if(this.txBody&&this.txBody.content)if(!this.txBody.content.DrawingDocument)if(this.chart){var oDrawingDocument=this.chart.getDrawingDocument(); if(oDrawingDocument){this.txBody.content.DrawingDocument=oDrawingDocument;var aContent=this.txBody.content.Content;for(var i=0;i<aContent.length;++i)aContent[i].DrawingDocument=oDrawingDocument}}CShape.prototype.updateSelectionState.call(this)};CDLbl.prototype.selectionSetStart=CShape.prototype.selectionSetStart;CDLbl.prototype.selectionSetEnd=CShape.prototype.selectionSetEnd;CDLbl.prototype.getDrawingDocument=function(){return this.chart&&this.chart.getDrawingDocument&&this.chart.getDrawingDocument()}; CDLbl.prototype.checkHitToBounds=function(x,y){var oInvertTransform=this.getInvertTransform();var _x,_y;if(oInvertTransform){_x=oInvertTransform.TransformPointX(x,y);_y=oInvertTransform.TransformPointY(x,y)}else{_x=x-this.transform.tx;_y=y-this.transform.ty}return _x>=0&&_x<=this.extX&&_y>=0&&_y<this.extY};CDLbl.prototype.getCanvasContext=function(){return this.chart&&this.chart.getCanvasContext()};CDLbl.prototype.convertPixToMM=function(pix){return this.chart&&this.chart.convertPixToMM(pix)};CDLbl.prototype.checkDlbl= function(){if(this.series&&this.pt){var oSeries=this.series;if(oSeries){var oDlbls;if(!oSeries.dLbls){var oChart=oSeries.parent;if(oChart&&oChart.dLbls)oDlbls=oChart.dLbls.createDuplicate();else oDlbls=new AscFormat.CDLbls;oSeries.setDLbls(oDlbls)}else oDlbls=oSeries.dLbls;var dLbl=oDlbls.findDLblByIdx(this.pt.idx);if(!dLbl){dLbl=this.createDuplicate();dLbl.setDelete(undefined);dLbl.setIdx(this.pt.idx);dLbl.setParent(oSeries.dLbls);oSeries.dLbls.addDLbl(dLbl);dLbl.series=oSeries}dLbl.series=this.series; dLbl.chart=this.chart;return dLbl}}return null};CDLbl.prototype.checkDocContent=function(){var oDlbl=this.checkDlbl();if(oDlbl){oDlbl.txBody=this.txBody;CTitle.prototype.checkDocContent.call(oDlbl);this.txBody=oDlbl.tx.rich;if(oDlbl.tx&&oDlbl.tx.rich&&oDlbl.tx.rich.content)if(!oDlbl.tx.rich.content.DrawingDocument)if(this.chart){var oDrawingDocument=this.chart.getDrawingDocument();if(oDrawingDocument){oDlbl.tx.rich.content.DrawingDocument=oDrawingDocument;var aContent=oDlbl.tx.rich.content.Content; for(var i=0;i<aContent.length;++i)aContent[i].DrawingDocument=oDrawingDocument}}}};CDLbl.prototype.applyTextFunction=function(docContentFunction,tableFunction,args){var oDlbl=this.checkDlbl();if(!oDlbl)return;if(oDlbl.tx&&oDlbl.tx.rich&&oDlbl.tx.rich.content)docContentFunction.apply(oDlbl.tx.rich.content,args)};CDLbl.prototype.hit=function(x,y){var tx=this.invertTransform.TransformPointX(x,y);var ty=this.invertTransform.TransformPointY(x,y);return tx>=0&&tx<=this.extX&&ty>=0&&ty<=this.extY};CDLbl.prototype.hitInPath= CShape.prototype.hitInPath;CDLbl.prototype.hitInInnerArea=CShape.prototype.hitInInnerArea;CDLbl.prototype.hitInBoundingRect=CShape.prototype.hitInBoundingRect;CDLbl.prototype.hitInTextRect=CShape.prototype.hitInTextRect;CDLbl.prototype.getCompiledStyle=function(){return null};CDLbl.prototype.getParentObjects=function(){return this.chart.getParentObjects()};CDLbl.prototype.recalculateTransform=function(){};CDLbl.prototype.recalculateTransformText=function(){if(this.txBody===null)return;this.ownTransformText.Reset(); var _text_transform=this.ownTransformText;var _shape_transform=this.ownTransform;var _body_pr=this.getBodyPr();var _content_height=this.txBody.content.GetSummaryHeight();var _l,_t,_r,_b;var _t_x_lt,_t_y_lt,_t_x_rt,_t_y_rt,_t_x_lb,_t_y_lb,_t_x_rb,_t_y_rb;if(isRealObject(this.spPr)&&isRealObject(this.spPr.geometry)&&isRealObject(this.spPr.geometry.rect)){var _rect=this.spPr.geometry.rect;_l=_rect.l+_body_pr.lIns;_t=_rect.t+_body_pr.tIns;_r=_rect.r-_body_pr.rIns;_b=_rect.b-_body_pr.bIns}else{_l=_body_pr.lIns; _t=_body_pr.tIns;_r=this.extX-_body_pr.rIns;_b=this.extY-_body_pr.bIns}if(_l>=_r){var _c=(_l+_r)*.5;_l=_c-.01;_r=_c+.01}if(_t>=_b){_c=(_t+_b)*.5;_t=_c-.01;_b=_c+.01}_t_x_lt=_shape_transform.TransformPointX(_l,_t);_t_y_lt=_shape_transform.TransformPointY(_l,_t);_t_x_rt=_shape_transform.TransformPointX(_r,_t);_t_y_rt=_shape_transform.TransformPointY(_r,_t);_t_x_lb=_shape_transform.TransformPointX(_l,_b);_t_y_lb=_shape_transform.TransformPointY(_l,_b);_t_x_rb=_shape_transform.TransformPointX(_r,_b); _t_y_rb=_shape_transform.TransformPointY(_r,_b);var _dx_t,_dy_t;_dx_t=_t_x_rt-_t_x_lt;_dy_t=_t_y_rt-_t_y_lt;var _dx_lt_rb,_dy_lt_rb;_dx_lt_rb=_t_x_rb-_t_x_lt;_dy_lt_rb=_t_y_rb-_t_y_lt;var _vertical_shift;var _text_rect_height=_b-_t;var _text_rect_width=_r-_l;var nVert=_body_pr.vert;if(!_body_pr.upright)if(!(nVert===AscFormat.nVertTTvert||nVert===AscFormat.nVertTTvert270)){switch(_body_pr.anchor){case 0:{_vertical_shift=_text_rect_height-_content_height;break}case 1:{_vertical_shift=(_text_rect_height- _content_height)*.5;break}case 2:{_vertical_shift=(_text_rect_height-_content_height)*.5;break}case 3:{_vertical_shift=(_text_rect_height-_content_height)*.5;break}case 4:{_vertical_shift=0;break}}global_MatrixTransformer.TranslateAppend(_text_transform,0,_vertical_shift);if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){var alpha=Math.atan2(_dy_t,_dx_t);global_MatrixTransformer.RotateRadAppend(_text_transform,-alpha);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_lt,_t_y_lt)}else{alpha=Math.atan2(_dy_t, _dx_t);global_MatrixTransformer.RotateRadAppend(_text_transform,Math.PI-alpha);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_rt,_t_y_rt)}}else{switch(_body_pr.anchor){case 0:{_vertical_shift=_text_rect_width-_content_height;break}case 1:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 2:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 3:{_vertical_shift=(_text_rect_width-_content_height)*.5;break}case 4:{_vertical_shift=0;break}}global_MatrixTransformer.TranslateAppend(_text_transform, 0,_vertical_shift);var _alpha;_alpha=Math.atan2(_dy_t,_dx_t);if(nVert===AscFormat.nVertTTvert)if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){global_MatrixTransformer.RotateRadAppend(_text_transform,-_alpha-Math.PI*.5);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_rt,_t_y_rt)}else{global_MatrixTransformer.RotateRadAppend(_text_transform,Math.PI*.5-_alpha);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_lt,_t_y_lt)}else if(_dx_lt_rb*_dy_t-_dy_lt_rb*_dx_t<=0){global_MatrixTransformer.RotateRadAppend(_text_transform, -_alpha-Math.PI*1.5);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_lb,_t_y_lb)}else{global_MatrixTransformer.RotateRadAppend(_text_transform,-Math.PI*.5-_alpha);global_MatrixTransformer.TranslateAppend(_text_transform,_t_x_rb,_t_y_rb)}}else{var _full_flip={flipH:false,flipV:false};var _hc=this.extX*.5;var _vc=this.extY*.5;var _transformed_shape_xc=this.transform.TransformPointX(_hc,_vc);var _transformed_shape_yc=this.transform.TransformPointY(_hc,_vc);var _content_width,content_height2; if(!(nVert===AscFormat.nVertTTvert||nVert===AscFormat.nVertTTvert270)){_content_width=_r-_l;content_height2=_b-_t}else{_content_width=_b-_t;content_height2=_r-_l}switch(_body_pr.anchor){case 0:{_vertical_shift=content_height2-_content_height;break}case 1:{_vertical_shift=(content_height2-_content_height)*.5;break}case 2:{_vertical_shift=(content_height2-_content_height)*.5;break}case 3:{_vertical_shift=(content_height2-_content_height)*.5;break}case 4:{_vertical_shift=0;break}}var _text_rect_xc=_l+ (_r-_l)*.5;var _text_rect_yc=_t+(_b-_t)*.5;var _vx=_text_rect_xc-_hc;var _vy=_text_rect_yc-_vc;var _transformed_text_xc,_transformed_text_yc;if(!_full_flip.flipH)_transformed_text_xc=_transformed_shape_xc+_vx;else _transformed_text_xc=_transformed_shape_xc-_vx;if(!_full_flip.flipV)_transformed_text_yc=_transformed_shape_yc+_vy;else _transformed_text_yc=_transformed_shape_yc-_vy;global_MatrixTransformer.TranslateAppend(_text_transform,0,_vertical_shift);if(nVert===AscFormat.nVertTTvert){global_MatrixTransformer.TranslateAppend(_text_transform, -_content_width*.5,-content_height2*.5);global_MatrixTransformer.RotateRadAppend(_text_transform,-Math.PI*1.5);global_MatrixTransformer.TranslateAppend(_text_transform,_content_width*.5,content_height2*.5)}if(nVert===AscFormat.nVertTTvert270){global_MatrixTransformer.TranslateAppend(_text_transform,-_content_width*.5,-content_height2*.5);global_MatrixTransformer.RotateRadAppend(_text_transform,-Math.PI*1.5);global_MatrixTransformer.TranslateAppend(_text_transform,_content_width*.5,content_height2* .5)}global_MatrixTransformer.TranslateAppend(_text_transform,_transformed_text_xc-_content_width*.5,_transformed_text_yc-content_height2*.5);this.clipRect={x:-_body_pr.lIns,y:-_vertical_shift-_body_pr.tIns,w:this.contentWidth+(_body_pr.rIns+_body_pr.lIns),h:this.contentHeight+(_body_pr.bIns+_body_pr.tIns)}}this.transformText=this.ownTransformText.CreateDublicate()};CDLbl.prototype.getStyles=function(){if(this.lastStyleObject)return this.lastStyleObject;return AscFormat.ExecuteNoHistory(function(){var styles= new CStyles(false);var style=new CStyle("dataLblStyle",null,null,null,true);var text_pr=new CTextPr;text_pr.FontSize=10;if(this.chart&&AscFormat.isRealNumber(this.chart.style))if(this.chart.style>40)text_pr.Unifill=AscFormat.CreateUnfilFromRGB(255,255,255);else{var default_style=AscFormat.CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.chart.style);var oUnifill=default_style.axisAndMajorGridLines.createDuplicate();if(oUnifill&&oUnifill.fill&&oUnifill.fill.color&&oUnifill.fill.color.Mods)oUnifill.fill.color.Mods.Mods.length= 0;text_pr.Unifill=oUnifill}else text_pr.Unifill=AscFormat.CreateUnfilFromRGB(0,0,0);var para_pr=new CParaPr;para_pr.Jc=AscCommon.align_Center;para_pr.Spacing.Before=0;para_pr.Spacing.After=0;para_pr.Spacing.Line=1;para_pr.Spacing.LineRule=Asc.linerule_Auto;style.ParaPr=para_pr;text_pr.RFonts.Set_FromObject({Ascii:{Name:"+mn-lt",Index:-1},EastAsia:{Name:"+mn-ea",Index:-1},HAnsi:{Name:"+mn-lt",Index:-1},CS:{Name:"+mn-lt",Index:-1}});style.TextPr=text_pr;var chart_text_pr;if(this.chart&&this.chart.txPr&& this.chart.txPr.content&&this.chart.txPr.content.Content[0]&&this.chart.txPr.content.Content[0].Pr){this.chart.txPr.content.Content[0].Set_DocumentIndex(0);style.ParaPr.Merge(this.chart.txPr.content.Content[0].Pr);if(this.chart.txPr.content.Content[0].Pr.DefaultRunPr){chart_text_pr=this.chart.txPr.content.Content[0].Pr.DefaultRunPr;style.TextPr.Merge(chart_text_pr)}}if(this instanceof CTitle||this.parent instanceof CTitle){style.TextPr.Bold=true;if(this.parent instanceof CChart||this.parent&&this.parent.parent instanceof CChart)if(chart_text_pr&&typeof chart_text_pr.FontSize==="number")style.TextPr.FontSize=chart_text_pr.FontSize*1.2>>0;else style.TextPr.FontSize=18}if(this instanceof CalcLegendEntry&&this.legend){if(this.legend.txPr&&this.legend.txPr.content&&this.legend.txPr.content.Content[0]&&this.legend.txPr.content.Content[0].Pr){this.legend.txPr.content.Content[0].Set_DocumentIndex(0);style.ParaPr.Merge(this.legend.txPr.content.Content[0].Pr);if(this.legend.txPr.content.Content[0].Pr.DefaultRunPr)style.TextPr.Merge(this.legend.txPr.content.Content[0].Pr.DefaultRunPr)}if(AscFormat.isRealNumber(this.idx)){var aLegendEntries= this.legend.legendEntryes;for(var i=0;i<aLegendEntries.length;++i)if(this.idx===aLegendEntries[i].idx){var oLegendEntry=aLegendEntries[i];if(oLegendEntry.txPr&&oLegendEntry.txPr.content&&oLegendEntry.txPr.content.Content[0]&&oLegendEntry.txPr.content.Content[0].Pr){style.ParaPr.Merge(oLegendEntry.txPr.content.Content[0].Pr);if(oLegendEntry.txPr.content.Content[0].Pr.DefaultRunPr)style.TextPr.Merge(oLegendEntry.txPr.content.Content[0].Pr.DefaultRunPr)}break}}}if(!(this instanceof CTitle)&&this.parent&& this.parent.txPr&&this.parent.txPr.content&&this.parent.txPr.content.Content[0]&&this.parent.txPr.content.Content[0].Pr){this.parent.txPr.content.Content[0].Set_DocumentIndex(0);style.ParaPr.Merge(this.parent.txPr.content.Content[0].Pr);if(this.parent.txPr.content.Content[0].Pr.DefaultRunPr)style.TextPr.Merge(this.parent.txPr.content.Content[0].Pr.DefaultRunPr)}if(this.txPr&&this.txPr.content&&this.txPr.content.Content[0]&&this.txPr.content.Content[0].Pr){this.txPr.content.Content[0].Set_DocumentIndex(0); style.ParaPr.Merge(this.txPr.content.Content[0].Pr);if(this.txPr.content.Content[0].Pr.DefaultRunPr)style.TextPr.Merge(this.txPr.content.Content[0].Pr.DefaultRunPr)}styles.Add(style);if(!(this instanceof CTitle))this.lastStyleObject={lastId:style.Id,styles:styles,shape:this,slide:null};return{lastId:style.Id,styles:styles,shape:this,slide:null}},this,[])};CDLbl.prototype.Get_Theme=function(){if(this.chart)return this.chart.Get_Theme();else if(this.series&&this.series.Get_Theme)return this.series.Get_Theme(); return null};CDLbl.prototype.Get_ColorMap=function(){if(this.chart)return this.chart.Get_ColorMap();else if(this.series&&this.series.Get_ColorMap)return this.series.Get_ColorMap();return AscFormat.G_O_DEFAULT_COLOR_MAP};CDLbl.prototype.Get_AbsolutePage=function(){if(this.chart&&this.chart.Get_AbsolutePage)return this.chart.Get_AbsolutePage();return 0};CDLbl.prototype.recalculateStyle=function(){AscFormat.ExecuteNoHistory(function(){this.compiledStyles=this.getStyles()},this,[])};CDLbl.prototype.Get_Styles= function(lvl){if(this.recalcInfo.recalcStyle){this.recalculateStyle();this.recalcInfo.recalcStyle=false}return this.compiledStyles};CDLbl.prototype.checkNoLbl=function(){if(this.tx&&this.tx.rich)return false;else return!(this.showSerName||this.showCatName||this.showVal||this.showPercent)};CDLbl.prototype.getPercentageString=function(){if(this.series&&this.pt)return this.series.getValByIndex(this.pt.idx,true);return""};CDLbl.prototype.getValueString=function(){var sFormatCode;if(this.pt&&this.series){if(this.numFmt&& typeof this.numFmt.formatCode==="string"&&this.numFmt.formatCode.length>0)sFormatCode=this.numFmt.formatCode;else if(typeof this.pt.formatCode==="string"&&this.pt.formatCode.length>0)sFormatCode=this.pt.formatCode;else sFormatCode=this.series.getFormatCode();var num_format=AscCommon.oNumFormatCache.get(sFormatCode);return num_format.formatToChart(this.series.getValByIndex(this.pt.idx))}return""};CDLbl.prototype.getDefaultTextForTxBody=function(){var compiled_string="";var separator;if(typeof this.separator=== "string")separator=this.separator+" ";else if(this.series.getObjectType()===AscDFH.historyitem_type_PieSeries)if(this.showPercent&&this.showCatName&&!this.showSerName&&!this.showVal)separator="\n";else separator=", ";else separator=", ";if(this.showSerName)compiled_string+=this.series.getSeriesName();if(this.showCatName){if(compiled_string.length>0)compiled_string+=separator;compiled_string+=this.series.getCatName(this.pt.idx)}if(this.showVal){if(compiled_string.length>0)compiled_string+=separator; compiled_string+=this.getValueString()}if(this.showPercent){if(compiled_string.length>0)compiled_string+=separator;compiled_string+=this.getPercentageString()}return compiled_string};CDLbl.prototype.getMaxWidth=function(bodyPr){if(!(this.parent&&(this.parent.axPos===AX_POS_L||this.parent.axPos===AX_POS_R))){switch(bodyPr.vert){case AscFormat.nVertTTeaVert:case AscFormat.nVertTTmongolianVert:case AscFormat.nVertTTvert:case AscFormat.nVertTTwordArtVert:case AscFormat.nVertTTwordArtVertRtl:case AscFormat.nVertTTvert270:{return this.chart.extY/ 2}case AscFormat.nVertTThorz:{return this.chart.extX/5}}return this.chart.extX/5}else return 2E4};CDLbl.prototype.getBodyPr=function(){var ret=new AscFormat.CBodyPr;ret.setDefault();ret.anchor=1;var oBaseBodyPr=new AscFormat.CBodyPr;if(this.txPr&&this.txPr.bodyPr)oBaseBodyPr.merge(this.txPr.bodyPr);if(this.tx&&this.tx.rich)oBaseBodyPr.merge(this.tx.rich.bodyPr);if(this.parent&&(this.parent.axPos===AX_POS_L||this.parent.axPos===AX_POS_R)&&(oBaseBodyPr.vert===null&&oBaseBodyPr.rot===null))ret.vert= AscFormat.nVertTTvert270;ret.merge(oBaseBodyPr);var nVert=ret.vert;if(AscFormat.isRealNumber(ret.rot)&&0!==ret.rot)if(Math.abs(ret.rot-54E5)<1E3)if(ret.vert===AscFormat.nVertTTvert270)nVert=AscFormat.nVertTThorz;else{if(ret.vert===AscFormat.nVertTThorz)nVert=AscFormat.nVertTTvert}else if(Math.abs(ret.rot+54E5)<1E3)if(ret.vert===AscFormat.nVertTTvert)nVert=AscFormat.nVertTThorz;else if(ret.vert===AscFormat.nVertTThorz)nVert=AscFormat.nVertTTvert270;switch(nVert){case AscFormat.nVertTTeaVert:case AscFormat.nVertTTmongolianVert:case AscFormat.nVertTTvert:case AscFormat.nVertTTwordArtVert:case AscFormat.nVertTTwordArtVertRtl:case AscFormat.nVertTTvert270:{ret.lIns= SCALE_INSET_COEFF;ret.rIns=SCALE_INSET_COEFF;ret.tIns=SCALE_INSET_COEFF*.5;ret.bIns=SCALE_INSET_COEFF*.5;break}case AscFormat.nVertTThorz:{ret.lIns=SCALE_INSET_COEFF;ret.rIns=SCALE_INSET_COEFF;ret.tIns=SCALE_INSET_COEFF*.5;ret.bIns=SCALE_INSET_COEFF*.5;break}}ret.vert=nVert;return ret};CDLbl.prototype.recalculateContent=function(){if(this.txBody){var bodyPr=this.getBodyPr();var max_box_width=this.getMaxWidth(bodyPr);var max_content_width=max_box_width-2*SCALE_INSET_COEFF;var content=this.txBody.content; var sParPasteId=null;if(window["AscCommon"].g_specialPasteHelper&&window["AscCommon"].g_specialPasteHelper.showButtonIdParagraph){sParPasteId=window["AscCommon"].g_specialPasteHelper.showButtonIdParagraph;window["AscCommon"].g_specialPasteHelper.showButtonIdParagraph=null}content.RecalculateContent(max_content_width,2E4,0);if(sParPasteId)window["AscCommon"].g_specialPasteHelper.showButtonIdParagraph=sParPasteId;var pargs=content.Content;var max_width=0;for(var i=0;i<pargs.length;++i){var par=pargs[i]; for(var j=0;j<par.Lines.length;++j)if(par.Lines[j].Ranges[0].W>max_width)max_width=par.Lines[j].Ranges[0].W}max_width+=1;content.RecalculateContent(max_width,2E4,0);switch(bodyPr.vert){case AscFormat.nVertTTeaVert:case AscFormat.nVertTTmongolianVert:case AscFormat.nVertTTvert:case AscFormat.nVertTTwordArtVert:case AscFormat.nVertTTwordArtVertRtl:case AscFormat.nVertTTvert270:{this.extX=Math.min(content.GetSummaryHeight()+4.4*SCALE_INSET_COEFF,max_box_width);this.extY=max_width+2*SCALE_INSET_COEFF; this.x=0;this.y=0;this.txBody.contentWidth=this.extY;this.txBody.contentHeight=this.extX;this.contentWidth=this.extY;this.contentHeight=this.extX;break}default:{var _rot=AscFormat.isRealNumber(bodyPr.rot)?bodyPr.rot*AscFormat.cToRad2:0;var t=new CMatrix;global_MatrixTransformer.RotateRadAppend(t,-_rot);var w,h,x0,y0,x1,y1,x2,y2,x3,y3;w=max_width;h=this.txBody.content.GetSummaryHeight();x0=0;y0=0;x1=t.TransformPointX(w,0);y1=t.TransformPointY(w,0);x2=t.TransformPointX(w,h);y2=t.TransformPointY(w,h); x3=t.TransformPointX(0,h);y3=t.TransformPointY(0,h);this.extX=Math.max(x0,x1,x2,x3)-Math.min(x0,x1,x2,x3)+1.25;this.extY=Math.max(y0,y1,y2,y3)-Math.min(y0,y1,y2,y3)+SCALE_INSET_COEFF;this.x=0;this.y=0;this.txBody.contentWidth=this.extX;this.txBody.contentHeight=this.extY;this.contentWidth=this.extX;this.contentHeight=this.extY;break}}}};CDLbl.prototype.recalculateTxBody=function(){if(this.tx&&this.tx.rich){this.txBody=this.tx.rich;this.txBody.parent=this}else this.txBody=AscFormat.CreateTextBodyFromString(this.getDefaultTextForTxBody(), this.chart.getDrawingDocument(),this)};CDLbl.prototype.initDefault=function(nDefaultPosition){this.setDelete(false);this.setDLblPos(AscFormat.isRealNumber(nDefaultPosition)?nDefaultPosition:c_oAscChartDataLabelsPos.inBase);this.setIdx(null);this.setLayout(null);this.setNumFmt(null);this.setSeparator(null);this.setShowBubbleSize(false);this.setShowCatName(false);this.setShowLegendKey(false);this.setShowPercent(false);this.setShowSerName(false);this.setShowVal(false);this.setSpPr(null);this.setTx(null); this.setTxPr(null)};CDLbl.prototype.merge=function(dLbl,noCopyTxBody){if(!dLbl)return;if(dLbl.bDelete!=null)this.setDelete(dLbl.bDelete);if(dLbl.dLblPos!=null)this.setDLblPos(dLbl.dLblPos);if(dLbl.idx!=null)this.setIdx(dLbl.idx);if(dLbl.layout!=null)this.setLayout(dLbl.layout.createDuplicate());if(dLbl.numFmt!=null)this.setNumFmt(dLbl.numFmt);if(dLbl.separator!=null)this.setSeparator(dLbl.separator);if(dLbl.showBubbleSize!=null)this.setShowBubbleSize(dLbl.showBubbleSize);if(dLbl.showCatName!=null)this.setShowCatName(dLbl.showCatName); if(dLbl.showLegendKey!=null)this.setShowLegendKey(dLbl.showLegendKey);if(dLbl.showPercent!=null)this.setShowPercent(dLbl.showPercent);if(dLbl.showSerName!=null)this.setShowSerName(dLbl.showSerName);if(dLbl.showVal!=null)this.setShowVal(dLbl.showVal);if(dLbl.spPr!=null){if(this.spPr==null)this.setSpPr(new AscFormat.CSpPr);if(dLbl.spPr.Fill){if(this.spPr.Fill==null)this.spPr.setFill(new AscFormat.CUniFill);this.spPr.Fill.merge(dLbl.spPr.Fill)}if(dLbl.spPr.ln){if(this.spPr.ln==null)this.spPr.setLn(new AscFormat.CLn); this.spPr.ln.merge(dLbl.spPr.ln)}}if(dLbl.tx){if(this.tx==null)this.setTx(new CChartText);this.tx.merge(dLbl.tx,noCopyTxBody)}if(dLbl.txPr){if(noCopyTxBody===true){var oldParent=dLbl.txPr.parent;this.setTxPr(dLbl.txPr);dLbl.txPr.parent=oldParent}else this.setTxPr(dLbl.txPr.createDuplicate());this.txPr.setParent(this)}};CDLbl.prototype.draw=CShape.prototype.draw;CDLbl.prototype.isEmptyPlaceholder=function(){return false};CDLbl.prototype.setPosition=function(x,y){this.x=x;this.y=y;this.calcX=this.x; this.calcY=this.y;this.localTransform.Reset();global_MatrixTransformer.TranslateAppend(this.localTransform,this.calcX,this.calcY);this.transform=this.localTransform.CreateDublicate();this.invertTransform=global_MatrixTransformer.Invert(this.transform);this.localTransformText=this.ownTransformText.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.localTransformText,this.calcX,this.calcY);this.transformText=this.localTransformText.CreateDublicate();this.invertTransformText=global_MatrixTransformer.Invert(this.transformText)}; CDLbl.prototype.setPosition2=function(x,y){this.x=x;this.y=y;this.calcX=this.x;this.calcY=this.y;this.localTransform.tx=x;this.localTransform.ty=y;this.transform=this.localTransform.CreateDublicate();this.invertTransform=global_MatrixTransformer.Invert(this.transform);this.localTransformText.tx=x;this.localTransformText.ty=y;this.transformText=this.localTransformText.CreateDublicate();this.invertTransformText=global_MatrixTransformer.Invert(this.transformText)};CDLbl.prototype.updateTransformMatrix= function(){this.transform=this.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transform,this.posX,this.posY);this.invertTransform=global_MatrixTransformer.Invert(this.transform);if(this.localTransformText){this.transformText=this.localTransformText.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transformText,this.posX,this.posY);this.invertTransformText=global_MatrixTransformer.Invert(this.transformText)}};CDLbl.prototype.updatePosition=function(x, y){this.posX=x;this.posY=y;this.transform=this.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transform,x,y);this.transformText=this.localTransformText.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transformText,x,y);this.invertTransform=global_MatrixTransformer.Invert(this.transform);this.invertTransformText=global_MatrixTransformer.Invert(this.transformText)};CDLbl.prototype.setParent=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&& History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbl_SetParent,this.parent,pr));this.parent=pr;this.Refresh_RecalcData2()};CDLbl.prototype.setDelete=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbl_SetDelete,this.bDelete,pr));this.bDelete=pr;this.Refresh_RecalcData2()};CDLbl.prototype.setDLblPos=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_DLbl_SetDLblPos,this.dLblPos,pr));this.dLblPos=pr};CDLbl.prototype.setIdx=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DLbl_SetIdx,this.idx,pr));this.idx=pr};CDLbl.prototype.setLayout=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbl_SetLayout,this.layout,pr));this.layout=pr;if(this.layout)this.layout.setParent(this)}; CDLbl.prototype.setNumFmt=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbl_SetNumFmt,this.numFmt,pr));this.numFmt=pr};CDLbl.prototype.setSeparator=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_DLbl_SetSeparator,this.separator,pr));this.separator=pr};CDLbl.prototype.setShowBubbleSize=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&& true===History.Is_On()&&History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbl_SetShowBubbleSize,this.showBubbleSize,pr));this.showBubbleSize=pr};CDLbl.prototype.setShowCatName=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbl_SetShowCatName,this.showCatName,pr));this.showCatName=pr};CDLbl.prototype.setShowLegendKey=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_DLbl_SetShowLegendKey,this.showLegendKey,pr));this.showLegendKey=pr};CDLbl.prototype.setShowPercent=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbl_SetShowPercent,this.showPercent,pr));this.showPercent=pr};CDLbl.prototype.setShowSerName=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbl_SetShowSerName, this.showSerName,pr));this.showSerName=pr};CDLbl.prototype.setShowVal=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbl_SetShowVal,this.showVal,pr));this.showVal=pr};CDLbl.prototype.setSpPr=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbl_SetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)}; CDLbl.prototype.setTx=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbl_SetTx,this.tx,pr));this.tx=pr};CDLbl.prototype.setTxPr=function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbl_SetTxPr,this.txPr,pr));this.txPr=pr;if(this.txPr)this.txPr.setParent(this)};CDLbl.prototype.handleUpdateFill=function(){this.Refresh_RecalcData2()}; CDLbl.prototype.handleUpdateLn=function(){this.Refresh_RecalcData2()};CDLbl.prototype.Refresh_RecalcData2=function(pageIndex){if(this.parent&&this.parent.Refresh_RecalcData2)this.parent.Refresh_RecalcData2(pageIndex,this);else if(this.chart)this.chart.Refresh_RecalcData2(pageIndex,this)};function CParseResult(){this.error=Asc.c_oAscError.ID.No;this.obj=null}CParseResult.prototype.setError=function(val){this.error=val;if(val!==Asc.c_oAscError.ID.No)this.obj=null};CParseResult.prototype.setObject=function(val){this.obj= val};CParseResult.prototype.isSuccessful=function(){return this.error===Asc.c_oAscError.ID.No&&this.obj!==null};CParseResult.prototype.getObject=function(){return this.obj};CParseResult.prototype.getError=function(){return this.error};function fParseChartFormula(sFormula){if(!(typeof sFormula==="string"&&sFormula.length>0))return[];var oWB=Asc.editor&&Asc.editor.wbModel;if(!oWB)return[];var oWS=oWB.getWorksheet(0);if(!oWS)return[];var res;AscCommonExcel.executeInR1C1Mode(false,function(){res=AscCommonExcel.getRangeByRef(sFormula, oWS)});return res}function fCreateRef(oBBoxInfo){if(oBBoxInfo)return AscCommon.parserHelp.getEscapeSheetName(oBBoxInfo.worksheet.getName())+"!"+oBBoxInfo.bbox.getAbsName();return null}function fParseSingleRow(sVal,fCallback){if(sVal[0]!=="{"||sVal[sVal.length-1]!=="}")return null;var oParser,bResult,result=null;oParser=new AscCommonExcel.parserFormula(sVal,null,Asc.editor.wbModel.aWorksheets[0]);bResult=oParser.parse(true,true);if(bResult&&oParser.outStack.length===1){var oLastElem=oParser.outStack[0]; if(oLastElem.type===AscCommonExcel.cElementType.array&&oLastElem.getRowCount()===1){var aRow=oLastElem.getRow(0);result=fCallback(aRow)}}return result}function fParseNumArray(sVal,bForce){return fParseSingleRow(sVal,function(bForce){return function(aRow){var result=null,oToken,nIndex;if(aRow.length>0){result=[];for(nIndex=0;nIndex<aRow.length;++nIndex){oToken=aRow[nIndex];if(oToken.type===AscCommonExcel.cElementType.number)result.push(oToken.toNumber());else if(bForce)result.push(oToken.getValue()); else return null}}return result}}(bForce))}function fParseStrArray(sVal){return fParseSingleRow(sVal,function(){return function(aRow){var result=null,oToken,nIndex;if(aRow.length>0){result=[];for(nIndex=0;nIndex<aRow.length;++nIndex){oToken=aRow[nIndex];result.push(oToken.toString())}}return result}}())}function fParseNumLit(sVal,bForce,oResult){var result=null;var sParsed,aNumbers,nIndex;if(typeof sVal==="string"&&sVal.length>0){if(sVal[0]==="="){sParsed=sVal.slice(1);aNumbers=fParseNumArray(sParsed, bForce)}else{sParsed=sVal;aNumbers=fParseNumArray(sParsed,bForce);if(!Array.isArray(aNumbers)){sParsed="{"+sParsed+"}";aNumbers=fParseNumArray(sParsed,bForce)}}if(Array.isArray(aNumbers)&&aNumbers.length>0){result=new CNumLit;result.setFormatCode("General");for(nIndex=0;nIndex<aNumbers.length;++nIndex)result.addNumericPoint(nIndex,aNumbers[nIndex]);oResult.setError(Asc.c_oAscError.ID.No);oResult.setObject(result)}else oResult.setError(Asc.c_oAscError.ID.ErrorInFormula)}else oResult.setError(Asc.c_oAscError.ID.ErrorInFormula)} function fParseStrLit(sVal,oResult){var result=null;var sParsed,aStr,nIndex;if(typeof sVal==="string"&&sVal.length>0){if(sVal[0]==="="){sParsed=sVal.slice(1);aStr=fParseStrArray(sParsed)}else{sParsed=sVal;aStr=fParseStrArray(sParsed);if(!Array.isArray(aStr)){sParsed="{"+sParsed+"}";aStr=fParseStrArray(sParsed)}}if(Array.isArray(aStr)&&aStr.length>0){result=new CStrCache;for(nIndex=0;nIndex<aStr.length;++nIndex)result.addStringPoint(nIndex,aStr[nIndex]);oResult.setError(Asc.c_oAscError.ID.No);oResult.setObject(result)}else oResult.setError(Asc.c_oAscError.ID.ErrorInFormula)}else oResult.setError(Asc.c_oAscError.ID.ErrorInFormula)} function fParseNumRef(sVal,bForce,oResult){var result=null,aParsed,nIndex,oParsedRef,sRef,oWS,oRange,nRow,nCol,oCell;if(typeof sVal==="string"&&sVal.length>0){if(sVal[0]==="=")aParsed=sVal.slice(1).split(",");else aParsed=sVal.split(",");if(Array.isArray(aParsed)&&aParsed.length>0){var sFormula;if(aParsed.length>1)sFormula="(";else sFormula="";for(nIndex=0;nIndex<aParsed.length;++nIndex){sRef=aParsed[nIndex];oParsedRef=AscCommon.parserHelp.parse3DRef(sRef);if(!oParsedRef){oResult.setError(Asc.c_oAscError.ID.InvalidReference); return}oWS=Asc.editor.wbModel.getWorksheetByName(oParsedRef.sheet);if(!oWS){oResult.setError(Asc.c_oAscError.ID.InvalidReference);return}oRange=oWS.getRange2(oParsedRef.range);if(!oRange){oResult.setError(Asc.c_oAscError.ID.DataRangeError);return}if(Math.abs(oRange.bbox.r2-oRange.bbox.r1)!==0&&Math.abs(oRange.bbox.c2-oRange.bbox.c1)!==0){oResult.setError(Asc.c_oAscError.ID.NoSingleRowCol);return}if(bForce===false)for(nRow=oRange.bbox.r1;nRow<=oRange.bbox.r2;++nRow)for(nCol=oRange.bbox.c1;nCol<=oRange.bbox.c2;++nCol){oCell= oWS.getCell3(nRow,nCol);var value=oCell.getNumberValue();if(!AscFormat.isRealNumber(value)){oResult.setError(Asc.c_oAscError.ID.DataRangeError);return}}if(nIndex>0)sFormula+=","+sRef;else sFormula+=sRef}if(nIndex===aParsed.length){if(aParsed.length>1)sFormula+=")";result=new CNumRef;result.setF(sFormula);oResult.setError(Asc.c_oAscError.ID.No);oResult.setObject(result)}else oResult.setError(Asc.c_oAscError.ID.ErrorInFormula)}else oResult.setError(Asc.c_oAscError.ID.ErrorInFormula)}else oResult.setError(Asc.c_oAscError.ID.ErrorInFormula)} function fParseStrRef(sVal,bMultiLvl,oResult){var result=null,aParsed,nIndex,oParsedRef,sRef,oWS,oRange;var bMultyRange=false;if(typeof sVal==="string"&&sVal.length>0){if(sVal[0]==="=")aParsed=sVal.slice(1).split(",");else aParsed=sVal.split(",");if(Array.isArray(aParsed)&&aParsed.length>0){var sFormula;if(aParsed.length>1)sFormula="(";else sFormula="";for(nIndex=0;nIndex<aParsed.length;++nIndex){sRef=aParsed[nIndex];oParsedRef=AscCommon.parserHelp.parse3DRef(sRef);if(!oParsedRef){oResult.setError(Asc.c_oAscError.ID.InvalidReference); return}oWS=Asc.editor.wbModel.getWorksheetByName(oParsedRef.sheet);if(!oWS){oResult.setError(Asc.c_oAscError.ID.InvalidReference);return}oRange=oWS.getRange2(oParsedRef.range);if(!oRange){oResult.setError(Asc.c_oAscError.ID.DataRangeError);return}if(Math.abs(oRange.bbox.r2-oRange.bbox.r1)!==0&&Math.abs(oRange.bbox.c2-oRange.bbox.c1)!==0){if(bMultiLvl!==true){oResult.setError(Asc.c_oAscError.ID.NoSingleRowCol);return}bMultyRange=true}if(nIndex>0)sFormula+=","+sRef;else sFormula+=sRef}if(nIndex===aParsed.length){if(aParsed.length> 1)sFormula+=")";if(bMultyRange){result=new CMultiLvlStrRef;result.setF(sFormula)}else{result=new CStrRef;result.setF(sFormula)}oResult.setError(Asc.c_oAscError.ID.No);oResult.setObject(result)}}}}function CSeriesBase(){AscFormat.CBaseObject.call(this);this.idx=null;this.order=null;this.tx=null;this.spPr=null;this.parent=null}CSeriesBase.prototype=Object.create(AscFormat.CBaseObject.prototype);CSeriesBase.prototype.constructor=CSeriesBase;CSeriesBase.prototype.updateData=function(displayEmptyCellsAs, displayHidden){if(this.val)this.val.update(displayEmptyCellsAs,displayHidden,this);if(this.yVal)this.yVal.update(displayEmptyCellsAs,displayHidden,this);if(this.cat)this.cat.update(this);if(this.xVal)this.xVal.update(this);if(this.tx)this.tx.update()};CSeriesBase.prototype.Refresh_RecalcData=function(oData){var oChart=this.parent;if(oChart&&oChart.parent&&oChart.parent.parent&&oChart.parent.parent.parent)oChart.parent.parent.parent.handleUpdateType()};CSeriesBase.prototype.setIdx=function(val){if(History.CanAddChanges())History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_CommonSeries_SetIdx,this.idx,val));this.idx=val};CSeriesBase.prototype.setOrder=function(val){if(History.CanAddChanges())History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CommonSeries_SetOrder,this.order,val));this.order=val};CSeriesBase.prototype.setTx=function(val){if(History.CanAddChanges())History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonSeries_SetTx,this.tx,val));this.tx=val};CSeriesBase.prototype.setSpPr=function(val){if(History.CanAddChanges())History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_CommonSeries_SetSpPr,this.spPr,val));this.spPr=val};CSeriesBase.prototype.setParent=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr};CSeriesBase.prototype.getSeriesName=function(){if(this.tx){if(typeof this.tx.val==="string")return this.tx.val;if(this.tx.strRef&&this.tx.strRef.strCache&&AscFormat.isRealNumber(this.tx.strRef.strCache.ptCount)&&this.tx.strRef.strCache.ptCount>0){if(this.tx.strRef.strCache.pts.length> 0)return this.tx.getText();return""}}return AscCommon.translateManager.getValue("Series")+" "+(this.idx+1)};CSeriesBase.prototype.handleUpdateFill=function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()};CSeriesBase.prototype.handleUpdateLn=function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&& this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()};CSeriesBase.prototype.documentCreateFontMap=function(allFonts){this.dLbls&&this.dLbls.documentCreateFontMap(allFonts)};CSeriesBase.prototype.applyLabelsFunction=function(fCallback,value,oDD){this.dLbls&&this.dLbls.applyLabelsFunction(fCallback,value,oDD)};CSeriesBase.prototype.getAllRasterImages=function(images){this.spPr&&this.spPr.checkBlipFillRasterImage(images);this.dLbls&& this.dLbls.getAllRasterImages(images);this.marker&&this.marker.spPr&&this.marker.spPr.checkBlipFillRasterImage(images);if(this.dPt)for(var i=0;i<this.dPt.length;++i){this.dPt[i].spPr&&this.dPt[i].spPr.checkBlipFillRasterImage(images);this.dPt[i].marker&&this.dPt[i].marker.spPr&&this.dPt[i].marker.spPr.checkBlipFillRasterImage(images)}};CSeriesBase.prototype.checkSpPrRasterImages=function(images){checkSpPrRasterImages(this.spPr);checkSpPrRasterImages(this.dLbls);for(var i=0;i<this.dPt.length;++i){checkSpPrRasterImages(this.dPt[i].spPr); this.dPt[i].marker&&checkSpPrRasterImages(this.dPt[i].marker.spPr)}};CSeriesBase.prototype.getValRefFormula=function(){var oVal=this.val||this.yVal;if(oVal)return oVal.getRefFormula();return null};CSeriesBase.prototype.getCatName=function(idx){var pts;var cat;if(this.cat)cat=this.cat;else if(this.xVal)cat=this.xVal;if(cat){if(cat&&cat.strRef&&cat.strRef.strCache)pts=cat.strRef.strCache.pts;else if(cat.numRef&&cat.numRef.numCache)pts=cat.numRef.numCache.pts;if(Array.isArray(pts))for(var i=0;i<pts.length;++i)if(pts[i].idx=== idx)return pts[i].val+""}return idx+1+""};CSeriesBase.prototype.getFormatCode=function(){var pts;var val;if(this.val)val=this.val;else if(this.yVal)val=this.yVal;if(val)if(val&&val.strRef&&val.strRef.strCache&&val.strRef.strCache.formatCode)return val.strRef.strCache.formatCode;else if(val.strLit&&val.strLit.formatCode)return val.strLit.formatCode;else if(val.numRef&&val.numRef.numCache&&val.numRef.numCache.formatCode)return val.numRef.numCache.formatCode;else if(val.numLit&&val.numLit.formatCode)return val.numLit.formatCode; return"General"};CSeriesBase.prototype.getValByIndex=function(idx,bPercent){var pts;var val;if(this.val)val=this.val;else if(this.yVal)val=this.yVal;if(val){if(val&&val.strRef&&val.strRef.strCache)pts=val.strRef.strCache.pts;else if(val.strLit)pts=val.strLit.pts;else if(val.numRef&&val.numRef.numCache)pts=val.numRef.numCache.pts;else if(val.numLit)pts=val.numLit.pts;if(Array.isArray(pts)){var i;if(!(bPercent===true))for(i=0;i<pts.length;++i){if(pts[i].idx===idx)return pts[i].val+""}else{var summ= 0,value;for(i=0;i<pts.length;++i){if(AscFormat.isRealNumber(pts[i].val))summ+=Math.abs(pts[i].val);if(pts[i].idx===idx)value=pts[i].val}if(summ>0&&AscFormat.isRealNumber(value))return Math.round(100*(value/summ))+"%"}}}return""};CSeriesBase.prototype.isFiltered=function(){return!this.parent.isVisible(this)};CSeriesBase.prototype.isVisible=function(){if(!this.parent)return true;return this.parent.getSeriesArrayIdx(this)>-1};CSeriesBase.prototype.setVisible=function(bVal){if(!this.parent)return;if(bVal)if(this.isVisible())return; else{this.parent.removeFilteredSeries(this.parent.getFilteredSeriesArrayIdx(this));this.parent.addSer(this)}else if(this.isVisible()){this.parent.removeSeries(this.getSeriesArrayIdx(this));this.parent.addFilteredSeries(this)}else return};CSeriesBase.prototype.getOrder=function(){return this.order};CSeriesBase.prototype.setName=function(sName){var oResult;if(typeof sName==="string"&&sName.length>0){var oTx=new CTx;oResult=oTx.setValues(sName);if(oResult.isSuccessful()&&oTx.isValid())this.setTx(oTx); else{oResult=new CParseResult;this.setTx(null)}}else{oResult=new CParseResult;this.setTx(null)}return oResult.getError()};CSeriesBase.prototype.getName=function(){if(this.tx)return this.tx.getFormula();return""};CSeriesBase.prototype.setValues=function(sValues){var oResult;if(sValues===""||sValues===null){oResult=new CParseResult;oResult.setError(Asc.c_oAscError.ID.NoValues);return oResult}var oVal=new CYVal;oResult=oVal.setValues(sValues);if(oVal.isValid())this.setVal(oVal);else{oResult=new CParseResult; oResult.setError(Asc.c_oAscError.ID.DataRangeError)}return oResult};CSeriesBase.prototype.setCategories=function(sValues){if(!this.setCat)return;var oResult;if(sValues===null||typeof sValues==="string"&&sValues.length===0){if(this.cat)this.setCat(null);oResult=new CParseResult;oResult.setError(Asc.c_oAscError.ID.No)}else{var oCat=new CCat;oResult=oCat.setValues(sValues);if(oCat.isValid())this.setCat(oCat);else{if(this.cat)this.setCat(null);oResult=new CParseResult;oResult.setError(Asc.c_oAscError.ID.DataRangeError)}}return oResult}; CSeriesBase.prototype.getValues=function(nMaxValues){if(this.cat)return this.cat.getValues(nMaxValues);if(this.val){var ret=[];for(var nIndex=0;nIndex<nMaxValues;++nIndex)ret.push(nIndex+1+"");return ret}return[]};CSeriesBase.prototype.getCatRefs=function(){if(this.cat)return this.cat.getParsedRefs();if(this.xVal)return this.xVal.getParsedRefs();return[]};CSeriesBase.prototype.getTxRefs=function(){if(this.tx)return this.tx.getParsedRefs();return[]};CSeriesBase.prototype.getValRefs=function(){if(this.val)return this.val.getParsedRefs(); if(this.yVal)return this.yVal.getParsedRefs();return[]};CSeriesBase.prototype.getBBoxInfo=function(){var aValRefs=this.getValRefs();var oWorksheet,oCatBB,oValBB,oTxBB,oValRef,aCatRefs,oCatRef,aTxRefs,oTxRef;if(aValRefs.length!==1)return null;oValRef=aValRefs[0];oValBB=oValRef.bbox;oWorksheet=oValRef.worksheet;aCatRefs=this.getCatRefs();if(aCatRefs.length>1)return null;oCatRef=null;if(aCatRefs.length===1){oCatRef=aCatRefs[0];if(oValRef.worksheet!==oCatRef.worksheet)return null;oCatBB=oCatRef.bbox}aTxRefs= this.getTxRefs();if(aTxRefs.length>1)return null;if(aTxRefs.length===1){oTxRef=aTxRefs[0];if(oTxRef.worksheet!==oValRef.worksheet)return null;oTxBB=oTxRef.bbox}return{ws:oWorksheet,val:oValBB,cat:oCatBB,tx:oTxBB}};CSeriesBase.prototype.getSpPrPreset=function(){var oFirstSpPrPreset=0;if(this.getObjectType()===AscDFH.historyitem_type_PieSeries){if(this.dPt[0]&&this.dPt[0].spPr&&!this.dPt[0].spPr.hasRGBFill())oFirstSpPrPreset=AscFormat.CollectSettingsSpPr(this.dPt[0].spPr)}else oFirstSpPrPreset=AscFormat.CollectSettingsSpPr(this.spPr); return oFirstSpPrPreset};CSeriesBase.prototype.getMarkerPreset=function(){var oFirstSpPrMarkerPrst=0;if(this.marker&&this.marker.spPr&&!this.marker.spPr.hasRGBFill())oFirstSpPrMarkerPrst=AscFormat.CollectSettingsSpPr(this.marker.spPr);return oFirstSpPrMarkerPrst};CSeriesBase.prototype.getValuesCount=function(){if(this.val)return this.val.getValuesCount();return 0};CSeriesBase.prototype.setXValues=function(sValues){var oResult;if(sValues===""||sValues===null){this.setXVal(null);oResult=new CParseResult; oResult.setError(Asc.c_oAscError.ID.No)}else{var oCat=new CCat;oResult=oCat.setValues(sValues);if(oCat.isValid())this.setXVal(oCat);else{if(this.xVal)this.setXVal(null);oResult=new CParseResult;oResult.setError(Asc.c_oAscError.ID.DataRangeError)}}return oResult};CSeriesBase.prototype.setYValues=function(sValues){var oResult;if(sValues===""||sValues===null){oResult=new CParseResult;oResult.setError(Asc.c_oAscError.ID.NoValues);return oResult}var oVal=new CYVal;oResult=oVal.setValues(sValues);if(oVal.isValid())this.setYVal(oVal); else{oResult=new CParseResult;oResult.setError(Asc.c_oAscError.ID.DataRangeError)}return oResult};CSeriesBase.prototype.remove=function(){if(!this.parent)return;this.parent.removeSeries(this.parent.getSeriesArrayIdx(this));this.parent.reorderSeries()};CSeriesBase.prototype.asc_getName=function(){return AscFormat.ExecuteNoHistory(CSeriesBase.prototype.getName,this,[])};CSeriesBase.prototype["asc_getName"]=CSeriesBase.prototype.asc_getName;CSeriesBase.prototype.asc_getNameVal=function(){return AscFormat.ExecuteNoHistory(function(){if(this.tx)return this.tx.getText(); return""},this,[])};CSeriesBase.prototype["asc_getNameVal"]=CSeriesBase.prototype.asc_getNameVal;CSeriesBase.prototype.asc_getSeriesName=function(){return this.getSeriesName()};CSeriesBase.prototype["asc_getSeriesName"]=CSeriesBase.prototype.asc_getSeriesName;CSeriesBase.prototype.asc_setName=function(sName){this.setName(sName);this.onDataUpdate()};CSeriesBase.prototype["asc_setName"]=CSeriesBase.prototype.asc_setName;CSeriesBase.prototype.asc_IsValidName=function(sName){return AscFormat.ExecuteNoHistory(function(){if(sName=== ""||sName===null)return Asc.c_oAscError.ID.No;var oTx=new CTx;return oTx.setValues(sName).getError()},this,[])};CSeriesBase.prototype["asc_IsValidName"]=CSeriesBase.prototype.asc_IsValidName;CSeriesBase.prototype.asc_setValues=function(sValues){this.setValues(sValues);this.onDataUpdate()};CSeriesBase.prototype["asc_setValues"]=CSeriesBase.prototype.asc_setValues;CSeriesBase.prototype.asc_IsValidValues=function(sValues){return AscFormat.ExecuteNoHistory(function(){if(sValues===""||sValues===null)return Asc.c_oAscError.ID.NoValues; var oVal=new CYVal;return oVal.setValues(sValues).getError()},this,[])};CSeriesBase.prototype["asc_IsValidValues"]=CSeriesBase.prototype.asc_IsValidValues;CSeriesBase.prototype.asc_getValues=function(){return AscFormat.ExecuteNoHistory(function(){return this.val.getFormula()},this,[])};CSeriesBase.prototype["asc_getValues"]=CSeriesBase.prototype.asc_getValues;CSeriesBase.prototype.asc_getValuesArr=function(){return AscFormat.ExecuteNoHistory(function(){return this.val.getValues(this.val.getValuesCount())}, this,[])};CSeriesBase.prototype["asc_getValuesArr"]=CSeriesBase.prototype.asc_getValuesArr;CSeriesBase.prototype.asc_setXValues=function(sValues){this.setXValues(sValues);this.onDataUpdate()};CSeriesBase.prototype["asc_setXValues"]=CSeriesBase.prototype.asc_setXValues;CSeriesBase.prototype.asc_IsValidXValues=function(sValues){return AscFormat.ExecuteNoHistory(function(){if(sValues===""||sValues===null)return Asc.c_oAscError.ID.No;else{var oCat=new CCat;return oCat.setValues(sValues).getError()}}, this,[])};CSeriesBase.prototype["asc_IsValidXValues"]=CSeriesBase.prototype.asc_IsValidXValues;CSeriesBase.prototype.asc_getXValues=function(){return AscFormat.ExecuteNoHistory(function(){if(this.xVal)return this.xVal.getFormula();return""},this,[])};CSeriesBase.prototype["asc_getXValues"]=CSeriesBase.prototype.asc_getXValues;CSeriesBase.prototype.asc_getXValuesArr=function(){return AscFormat.ExecuteNoHistory(function(){if(this.xVal)return this.xVal.getValues();return[]},this,[])};CSeriesBase.prototype["asc_getXValuesArr"]= CSeriesBase.prototype.asc_getXValuesArr;CSeriesBase.prototype.asc_setYValues=function(sValues){this.setYValues(sValues);this.onDataUpdate()};CSeriesBase.prototype["asc_setYValues"]=CSeriesBase.prototype.asc_setYValues;CSeriesBase.prototype.asc_IsValidYValues=function(sValues){return this.asc_IsValidValues(sValues)};CSeriesBase.prototype["asc_IsValidYValues"]=CSeriesBase.prototype.asc_IsValidYValues;CSeriesBase.prototype.asc_getYValues=function(){return AscFormat.ExecuteNoHistory(function(){if(this.yVal)return this.yVal.getFormula(); return""},this,[])};CSeriesBase.prototype["asc_getYValues"]=CSeriesBase.prototype.asc_getYValues;CSeriesBase.prototype.asc_getYValuesArr=function(){return AscFormat.ExecuteNoHistory(function(){if(this.yVal)return this.yVal.getValues();return[]},this,[])};CSeriesBase.prototype["asc_getYValuesArr"]=CSeriesBase.prototype.asc_getYValuesArr;CSeriesBase.prototype.asc_Remove=function(){History.Create_NewPoint(0);this.remove();this.onDataUpdate()};CSeriesBase.prototype["asc_Remove"]=CSeriesBase.prototype.asc_Remove; CSeriesBase.prototype.asc_IsScatter=function(){return this.getObjectType()===AscDFH.historyitem_type_ScatterSer};CSeriesBase.prototype["asc_IsScatter"]=CSeriesBase.prototype.asc_IsScatter;CSeriesBase.prototype.asc_getOrder=CSeriesBase.prototype.getOrder;CSeriesBase.prototype["asc_getOrder"]=CSeriesBase.prototype.asc_getOrder;CSeriesBase.prototype.asc_setOrder=function(nVal){History.Create_NewPoint(0);this.setOrder(nVal);this.onDataUpdate()};CSeriesBase.prototype["asc_setOrder"]=CSeriesBase.prototype.asc_setOrder; CSeriesBase.prototype.asc_getIdx=function(){return this.idx};CSeriesBase.prototype["asc_getIdx"]=CSeriesBase.prototype.asc_getIdx;CSeriesBase.prototype.asc_MoveUp=function(){if(!this.parent)return;this.parent.moveSeriesUp(this);this.onDataUpdate()};CSeriesBase.prototype["asc_MoveUp"]=CSeriesBase.prototype.asc_MoveUp;CSeriesBase.prototype.asc_MoveDown=function(){if(!this.parent)return;this.parent.moveSeriesDown(this);this.onDataUpdate()};CSeriesBase.prototype["asc_MoveDown"]=CSeriesBase.prototype.asc_MoveDown; CSeriesBase.prototype.onDataUpdate=function(){if(!this.parent)return;this.parent.onDataUpdate()};function CPlotArea(){this.charts=[];this.dTable=null;this.layout=null;this.serAx=null;this.spPr=null;this.axId=[];this.valAx=null;this.catAx=null;this.serAx=null;this.dateAx=null;this.chart=null;this.parent=null;this.posX=0;this.posY=0;this.x=0;this.y=0;this.rot=0;this.extX=5;this.extY=5;this.localTransform=new AscCommon.CMatrix;this.transform=new AscCommon.CMatrix;this.invertTransform=new AscCommon.CMatrix; this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CPlotArea.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(data){switch(data.Type){case AscDFH.historyitem_CommonChartFormat_SetParent:{break}case AscDFH.historyitem_PlotArea_RemoveAxis:{break}case AscDFH.historyitem_PlotArea_RemoveChart:{break}case AscDFH.historyitem_PlotArea_AddChart:{if(this.parent&&this.parent.parent)this.parent.parent.handleUpdateType();break}case AscDFH.historyitem_PlotArea_SetCatAx:{break}case AscDFH.historyitem_PlotArea_SetDateAx:{break}case AscDFH.historyitem_PlotArea_SetDTable:{break}case AscDFH.historyitem_PlotArea_SetLayout:{break}case AscDFH.historyitem_PlotArea_SetSerAx:{break}case AscDFH.historyitem_PlotArea_SetSpPr:{break}case AscDFH.historyitem_PlotArea_SetValAx:{break}case AscDFH.historyitem_PlotArea_AddAxis:{break}}}, Refresh_RecalcData2:function(data){if(this.parent&&this.parent.Refresh_RecalcData2)this.parent.Refresh_RecalcData2(data)},checkShapeChildTransform:function(t){this.transform=this.localTransform.CreateDublicate();global_MatrixTransformer.MultiplyAppend(this.transform,t);this.invertTransform=global_MatrixTransformer.Invert(this.transform)},updatePosition:function(x,y){this.posX=x;this.posY=y;this.transform=this.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transform, x,y);this.invertTransform=global_MatrixTransformer.Invert(this.transform)},getObjectType:function(){return AscDFH.historyitem_type_PlotArea},createDuplicate:function(){var c=new CPlotArea,i,j,k;if(this.dTable)c.setDTable(this.dTable.createDuplicate());if(this.layout)c.setLayout(this.layout.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());var len=this.axId.length;for(i=0;i<len;i++){var oAxis=this.axId[i].createDuplicate();oAxis.setAxId(++AscFormat.Ax_Counter.GLOBAL_AX_ID_COUNTER); c.addAxis(oAxis)}var cur_chart,cur_axis;for(i=0;i<this.charts.length;++i){cur_chart=this.charts[i];c.addChart(cur_chart.createDuplicate(),c.charts.length);if(Array.isArray(cur_chart.axId))for(j=0;j<cur_chart.axId.length;++j){cur_axis=cur_chart.axId[j];for(k=0;k<this.axId.length;++k)if(cur_axis===this.axId[k])c.charts[i].addAxId(c.axId[k])}}for(i=0;i<this.axId.length;++i){cur_axis=this.axId[i];for(j=0;j<this.axId.length;++j)if(cur_axis.crossAx===this.axId[j]){c.axId[i].setCrossAx(c.axId[j]);break}}return c}, getSeriesWithSmallestIndexForAxis:function(oAxis){var aCharts=this.charts;var oRet=null;var oChart,aSeries;for(var i=0;i<aCharts.length;++i){oChart=aCharts[i];var aAxes=aCharts[i].axId;if(!aAxes)continue;for(var j=0;j<aAxes.length;++j)if(aAxes[j]===oAxis){aSeries=oChart.series;for(var k=0;k<aSeries.length;++k)if(oRet===null||aSeries[k].cat&&!oRet.cat||aSeries[k].idx<oRet.idx&&aSeries[k].cat&&oRet.cat)oRet=aSeries[k]}}return oRet},getChartsForAxis:function(oAxis){var aCharts=this.charts;var oRet=null; var oChart,aSeries;var aRet=[];for(var i=0;i<aCharts.length;++i){oChart=aCharts[i];var aAxes=aCharts[i].axId;if(!aAxes)continue;for(var j=0;j<aAxes.length;++j)if(aAxes[j]===oAxis){aRet.push(oChart);break}}return aRet},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},addAxis:function(axis){if(!axis)return;var i;for(i=0;i<this.axId.length;++i)if(this.axId[i]===axis)return;History.Add(new CChangesDrawingsContent(this, AscDFH.historyitem_PlotArea_AddAxis,this.axId.length,[axis],true));this.axId.push(axis);axis.setParent(this)},addChart:function(pr,idx){var pos;if(AscFormat.isRealNumber(idx))pos=idx;else pos=this.charts.length;History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_PlotArea_AddChart,pos,[pr],true));this.charts.splice(pos,0,pr);pr.setParent(this);if(this.parent&&this.parent.parent)this.parent.parent.handleUpdateType()},removeChartByPos:function(pos){if(this.charts[pos]){var chart=this.charts.splice(pos, 1)[0];History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_PlotArea_RemoveChart,pos,[chart],false));if(Array.isArray(chart.axId)){var chart_axis=chart.axId;for(var i=0;i<chart_axis.length;++i){var axis=chart_axis[i];for(var j=0;j<this.charts.length;++j){var other_chart=this.charts[j];if(Array.isArray(other_chart.axId)){for(var k=0;k<other_chart.axId.length;++k)if(other_chart.axId[k]===axis)break;if(k<other_chart.axId.length)break}}if(j===this.charts.length)this.removeAxis(axis)}}}},removeCharts:function(startPos, endPos){for(var i=endPos;i>=startPos;--i)this.removeChartByPos(i)},removeAxis:function(axis){for(var i=this.axId.length-1;i>-1;--i)if(this.axId[i]===axis){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_PlotArea_RemoveAxis,i,[axis],false));this.axId.splice(i,1)}},setDTable:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PlotArea_SetDTable,this.dTable,pr));this.dTable=pr},setLayout:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PlotArea_SetLayout, this.layout,pr));this.layout=pr;if(this.layout)this.layout.setParent(this)},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PlotArea_SetSpPr,this.spPr,pr));this.spPr=pr;if(pr)pr.setParent(this)},getHorizontalAxis:function(){if(this.charts[0]){var aAxes=this.charts[0].axId;if(aAxes)for(var i=0;i<aAxes.length;++i)if(aAxes[i].axPos===AX_POS_B||aAxes[i].axPos===AX_POS_T)return aAxes[i]}return null},getVerticalAxis:function(){if(this.charts[0]){var aAxes=this.charts[0].axId; if(aAxes)for(var i=0;i<aAxes.length;++i)if(aAxes[i].axPos===AX_POS_L||aAxes[i].axPos===AX_POS_R)return aAxes[i]}return null},getAxisByTypes:function(){var ret={valAx:[],catAx:[],dateAx:[],serAx:[]};for(var i=0;i<this.axId.length;++i){var axis=this.axId[i];switch(axis.getObjectType()){case AscDFH.historyitem_type_CatAx:case AscDFH.historyitem_type_DateAx:{ret.catAx.push(axis);break}case AscDFH.historyitem_type_ValAx:{ret.valAx.push(axis);break}case AscDFH.historyitem_type_SerAx:{ret.serAx.push(axis); break}}}return ret},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},handleUpdateFill:function(){if(this.parent&&this.parent.handleUpdateFill)this.parent.handleUpdateFill()},handleUpdateLn:function(){if(this.parent&&this.parent.handleUpdateLn)this.parent.handleUpdateLn()},getCompiledLine:CShape.prototype.getCompiledLine,getCompiledFill:CShape.prototype.getCompiledFill,getCompiledTransparent:CShape.prototype.getCompiledTransparent, check_bounds:CShape.prototype.check_bounds,getCardDirectionByNum:CShape.prototype.getCardDirectionByNum,getNumByCardDirection:CShape.prototype.getNumByCardDirection,getResizeCoefficients:CShape.prototype.getResizeCoefficients,getInvertTransform:CShape.prototype.getInvertTransform,getTransformMatrix:CShape.prototype.getTransformMatrix,hitToHandles:CShape.prototype.hitToHandles,getFullFlipH:CShape.prototype.getFullFlipH,getFullFlipV:CShape.prototype.getFullFlipV,getAspect:CShape.prototype.getAspect, getGeom:CShape.prototype.getGeom,convertPixToMM:function(pix){return this.parent&&this.parent.parent&&this.parent.parent.convertPixToMM(pix)},hitInBoundingRect:CShape.prototype.hitInBoundingRect,hitInInnerArea:CShape.prototype.hitInInnerArea,hitInPath:CShape.prototype.hitInPath,checkHitToBounds:function(x,y){CDLbl.prototype.checkHitToBounds.call(this,x,y)},getCanvasContext:function(){return this.parent&&this.parent.parent&&this.parent.parent.getCanvasContext()},canRotate:function(){return false}, getNoChangeAspect:function(){return false},isChart:function(){return false},canMove:function(){return true},reindexSeries:function(){if(this.parent)this.parent.reindexSeries()},reorderSeries:function(){if(this.parent)this.parent.reorderSeries()},moveSeriesUp:function(oSeries){if(this.parent)this.parent.moveSeriesUp(oSeries)},moveSeriesDown:function(oSeries){if(this.parent)this.parent.moveSeriesDown(oSeries)},onDataUpdate:function(){if(this.parent)this.parent.onDataUpdate()}};function CChartBase(){AscFormat.CBaseObject.call(this); this.series=[];this.filteredSeries=[];this.axId=[];this.parent=null;this.dLbls=null;this.varyColors=null;if(this.Id===null)this.Id=AscCommon.g_oIdCounter.Get_NewId()}CChartBase.prototype=Object.create(AscFormat.CBaseObject.prototype);CChartBase.prototype.constructor=CChartBase;CChartBase.prototype.removeSeries=function(idx){if(this.series[idx]){var arrSeries=this.series.splice(idx,1);History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonChart_RemoveSeries,idx,arrSeries,false))}};CChartBase.prototype.removeAllSeries= function(){for(var nSeries=this.series.length-1;nSeries>-1;--nSeries)this.removeSeries(nSeries)};CChartBase.prototype.reindexSeries=function(){if(this.parent)this.parent.reindexSeries()};CChartBase.prototype.reorderSeries=function(){if(this.parent)this.parent.reorderSeries()};CChartBase.prototype.moveSeriesUp=function(oSeries){if(this.parent)this.parent.moveSeriesUp(oSeries)};CChartBase.prototype.moveSeriesDown=function(oSeries){if(this.parent)this.parent.moveSeriesDown(oSeries)};CChartBase.prototype.sortSeries= function(){var aAllSeries=[].concat(this.series);this.removeAllSeries();aAllSeries.sort(function(a,b){return a.order-b.order});for(var nSeries=0;nSeries<aAllSeries.length;++nSeries)this.addSer(aAllSeries[nSeries])};CChartBase.prototype.onDataUpdate=function(){if(this.parent)this.parent.onDataUpdate()};CChartBase.prototype.addSer=function(ser){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonChart_AddSeries,this.series.length,[ser],true));this.series.push(ser);ser.setParent(this); if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType()};CChartBase.prototype.setDLbls=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChart_SetDlbls,this.dLbls,pr));this.dLbls=pr;if(this.dLbls)this.dLbls.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateDataLabels()};CChartBase.prototype.setParent=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr};CChartBase.prototype.documentCreateFontMap=function(allFonts){this.dLbls&&this.dLbls.documentCreateFontMap(allFonts);for(var i=0;i<this.series.length;++i)this.series[i].documentCreateFontMap(allFonts)};CChartBase.prototype.applyLabelsFunction=function(fCallback,value,oDD){this.dLbls&&this.dLbls.applyLabelsFunction(fCallback,value,oDD);for(var i=0;i<this.series.length;++i)this.series[i].applyLabelsFunction(fCallback,value, oDD)};CChartBase.prototype.getAllRasterImages=function(images){this.dLbls&&this.dLbls.getAllRasterImages(images);for(var i=0;i<this.series.length;++i)this.series[i].getAllRasterImages(images)};CChartBase.prototype.checkSpPrRasterImages=function(images){this.dLbls&&this.dLbls.checkSpPrRasterImages(images);for(var i=0;i<this.series.length;++i)this.series[i].checkSpPrRasterImages(images)};CChartBase.prototype.removeDataLabels=function(){var i;for(i=0;i<this.series.length;++i)if(typeof this.series[i].setDLbls=== "function"&&this.series[i].dLbls)this.series[i].setDLbls(null)};CChartBase.prototype.addAxId=function(pr){if(!pr)return;History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonChart_AddAxId,this.axId.length,[pr],true));this.axId.push(pr)};CChartBase.prototype.getAxisByTypes=CPlotArea.prototype.getAxisByTypes;CChartBase.prototype.setVaryColors=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_CommonChart_SetVaryColors,this.varyColors,pr));this.varyColors=pr};CChartBase.prototype.getSeriesArrayIdx= function(oSeries){for(var i=0;i<this.series.length;++i)if(this.series[i]===oSeries)return i;return-1};CChartBase.prototype.getFilteredSeriesArrayIdx=function(oSeries){for(var i=0;i<this.filteredSeries.length;++i)if(this.filteredSeries[i]===oSeries)return i;return-1};CChartBase.prototype.addFilteredSeries=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonChart_AddFilteredSeries,this.filteredSeries.length,[pr],true));this.filteredSeries.push(pr)};CChartBase.prototype.removeFilteredSeries= function(idx){if(this.filteredSeries[idx])History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonChart_AddFilteredSeries,idx,this.filteredSeries.splice(idx,1),false))};function CBarChart(){CChartBase.call(this);this.barDir=null;this.gapWidth=null;this.grouping=null;this.overlap=null;this.serLines=null;this.varyColors=null;this.b3D=null;this.gapDepth=null;this.shape=null}CBarChart.prototype=Object.create(CChartBase.prototype);CBarChart.prototype.constructor=CBarChart;CBarChart.prototype.set3D= function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_BarChart_Set3D,this.b3D,pr));this.b3D=pr};CBarChart.prototype.setGapDepth=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_BarChart_SetGapDepth,this.gapDepth,pr));this.gapDepth=pr};CBarChart.prototype.setShape=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_BarChart_SetShape,this.shape,pr));this.shape=pr};CBarChart.prototype.getSeriesConstructor=function(){return new CBarSeries}; CBarChart.prototype.createDuplicate=function(){var c=new CBarChart;c.setBarDir(this.barDir);if(this.b3D)c.set3D(true);if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());c.setGapWidth(this.gapWidth);c.setGrouping(this.grouping);c.setOverlap(this.overlap);c.setGapDepth(this.gapDepth);c.setShape(this.shape);for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());if(this.serLines)c.setSerLines(this.serLines.createDuplicate());c.setVaryColors(this.varyColors);return c};CBarChart.prototype.getDefaultDataLabelsPosition= function(){if(!AscFormat.isRealNumber(this.grouping)||this.grouping===AscFormat.BAR_GROUPING_CLUSTERED||this.grouping===AscFormat.BAR_GROUPING_STANDARD)return c_oAscChartDataLabelsPos.outEnd;return c_oAscChartDataLabelsPos.ctr};CBarChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_BarChart};CBarChart.prototype.Refresh_RecalcData=function(data){if(!isRealObject(data))return;switch(data.Type){case AscDFH.historyitem_CommonChartFormat_SetParent:{break}case AscDFH.historyitem_BarChart_AddAxId:case AscDFH.historyitem_CommonChart_AddAxId:{break}case AscDFH.historyitem_BarChart_SetBarDir:case AscDFH.historyitem_BarChart_Set3D:case AscDFH.historyitem_BarChart_SetGapDepth:case AscDFH.historyitem_BarChart_SetShape:{if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart();break}case AscDFH.historyitem_BarChart_SetDLbls:case AscDFH.historyitem_CommonChart_SetDlbls:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateDataLabels();break}case AscDFH.historyitem_BarChart_SetGapWidth:{break}case AscDFH.historyitem_BarChart_SetGrouping:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart(); break}case AscDFH.historyitem_BarChart_SetOverlap:{break}case AscDFH.historyitem_BarChart_AddSer:case AscDFH.historyitem_CommonChart_AddSeries:case AscDFH.historyitem_CommonChart_AddFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveSeries:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType();break}case AscDFH.historyitem_BarChart_SetSerLines:{break}case AscDFH.historyitem_BarChart_SetVaryColors:case AscDFH.historyitem_CommonChart_SetVaryColors:{break}}}; CBarChart.prototype.setFromOtherChart=function(c){var i;if(AscFormat.isRealNumber(c.barDir))this.setBarDir(c.barDir);if(c.dLbls)this.setDLbls(c.dLbls);if(AscFormat.isRealNumber(c.gapWidth))this.setGapWidth(c.gapWidth);if(AscFormat.isRealNumber(c.grouping))this.setGrouping(c.grouping);if(AscFormat.isRealNumber(c.overlap))this.setOverlap(c.overlap);if(Array.isArray(c.series))for(i=0;i<c.series.length;++i){var ser=new CBarSeries;ser.setFromOtherSeries(c.series[i]);this.addSer(ser)}if(AscFormat.isRealBool(c.varyColors))this.setVaryColors(c.varyColors)}; CBarChart.prototype.setBarDir=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_BarChart_SetBarDir,this.barDir,pr));this.barDir=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()};CBarChart.prototype.setGapWidth=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_BarChart_SetGapWidth,this.gapWidth,pr));this.gapWidth=pr};CBarChart.prototype.setGrouping=function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_BarChart_SetGrouping,this.grouping,pr));this.grouping=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()};CBarChart.prototype.setOverlap=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_BarChart_SetOverlap,this.overlap,pr));this.overlap=pr};CBarChart.prototype.setSerLines=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BarChart_SetSerLines,this.serLines,pr)); this.serLines=pr};function CAreaChart(){CChartBase.call(this);this.dropLines=null;this.grouping=null}CAreaChart.prototype=Object.create(CChartBase.prototype);CAreaChart.prototype.constructor=CAreaChart;CAreaChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.ctr};CAreaChart.prototype.getSeriesConstructor=function(){return new CAreaSeries};CAreaChart.prototype.createDuplicate=function(){var c=new CAreaChart;if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate()); if(this.dropLines)c.setDropLines(this.dropLines.createDuplicate());c.setGrouping(this.grouping);for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());c.setVaryColors(this.varyColors);return c};CAreaChart.prototype.Refresh_RecalcData=function(data){if(!isRealObject(data))return;switch(data.Type){case AscDFH.historyitem_CommonChartFormat_SetParent:{break}case AscDFH.historyitem_AreaChart_AddAxId:case AscDFH.historyitem_CommonChart_AddAxId:{break}case AscDFH.historyitem_AreaChart_SetDLbls:case AscDFH.historyitem_CommonChart_SetDlbls:{if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateDataLabels();break}case AscDFH.historyitem_AreaChart_SetDropLines:{break}case AscDFH.historyitem_AreaChart_SetGrouping:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart();break}case AscDFH.historyitem_AreaChart_SetVaryColors:case AscDFH.historyitem_CommonChart_SetVaryColors:{break}case AscDFH.historyitem_AreaChart_AddSer:case AscDFH.historyitem_CommonChart_AddSeries:case AscDFH.historyitem_CommonChart_AddFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveSeries:{if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType();break}}};CAreaChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_AreaChart};CAreaChart.prototype.setFromOtherChart=function(c){var i;if(c.dLbls)this.setDLbls(c.dLbls);if(c.dropLines)this.setDropLines(c.dropLines);if(AscFormat.isRealNumber(c.grouping))this.setGrouping(c.grouping);if(Array.isArray(c.series))for(i=0;i<c.series.length;++i){var ser=new CAreaSeries;ser.setFromOtherSeries(c.series[i]); this.addSer(ser)}if(AscFormat.isRealBool(c.varyColors))this.setVaryColors(c.varyColors)};CAreaChart.prototype.setDropLines=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_AreaChart_SetDropLines,this.dropLines,pr));this.dropLines=pr};CAreaChart.prototype.setGrouping=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_AreaChart_SetGrouping,this.grouping,pr));this.grouping=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}; function CAreaSeries(){CSeriesBase.call(this);this.cat=null;this.dLbls=null;this.dPt=[];this.errBars=null;this.pictureOptions=null;this.trendline=null;this.parent=null;this.val=null}CAreaSeries.prototype=Object.create(CSeriesBase.prototype);CAreaSeries.prototype.constructor=CAreaSeries;CAreaSeries.prototype.createDuplicate=function(){var c=new CAreaSeries;if(this.cat)c.setCat(this.cat.createDuplicate());if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());for(var i=0;i<this.dPt.length;++i)c.addDPt(this.dPt[i].createDuplicate()); if(this.errBars)c.setErrBars(this.errBars.createDuplicate());c.setIdx(this.idx);c.setOrder(this.order);if(this.pictureOptions)c.setPictureOptions(this.pictureOptions.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.trendline)c.setTrendline(this.trendline.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate());if(this.val)c.setVal(this.val.createDuplicate());return c};CAreaSeries.prototype.getObjectType=function(){return AscDFH.historyitem_type_AreaSeries};CAreaSeries.prototype.setFromOtherSeries= function(o){if(o.cat)this.setCat(o.cat);if(o.dLbls)this.setDLbls(o.dLbls);if(o.dPt)for(var i=0;i<o.dPt.length;++i)this.addDPt(o.dPt[i]);if(o.errBars)this.setErrBars(o.errBars);if(AscFormat.isRealNumber(o.idx))this.setIdx(o.idx);if(AscFormat.isRealNumber(o.order))this.setOrder(o.order);if(o.pictureOptions)this.setPictureOptions(o.pictureOptions);if(o.spPr){this.setSpPr(o.spPr);if(o instanceof AscFormat.CLineSeries||o instanceof AscFormat.CScatterSeries)if(this.spPr&&this.spPr.Fill&&this.spPr.Fill.fill&& this.spPr.Fill.fill.type===window["Asc"].c_oAscFill.FILL_TYPE_NOFILL)this.spPr.setFill(null)}if(o.trendline)this.setTrendline(o.trendline);if(o.tx)this.setTx(o.tx);if(o.val)this.setVal(o.val);if(o.xVal){this.setCat(new CCat);this.cat.setFromOtherObject(o.xVal)}if(o.yVal){this.setVal(new CYVal);this.val.setFromOtherObject(o.yVal)}};CAreaSeries.prototype.setCat=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_AreaSeries_SetCat,this.cat,pr));this.cat=pr};CAreaSeries.prototype.setDLbls= function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_AreaSeries_SetDLbls,this.dLbls,pr));this.dLbls=pr;if(this.dLbls)this.dLbls.setParent(this)};CAreaSeries.prototype.addDPt=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_AreaSeries_SetDPt,this.dPt.length,[pr],true));this.dPt.push(pr)};CAreaSeries.prototype.removeDPt=function(idx){if(this.dPt[idx]){var arrPt=this.dPt.splice(idx,1);History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonSeries_RemoveDPt, idx,arrPt,false))}};CAreaSeries.prototype.setErrBars=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_AreaSeries_SetErrBars,this.errBars,pr));this.errBars=pr};CAreaSeries.prototype.setPictureOptions=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_AreaSeries_SetPictureOptions,this.pictureOptions,pr));this.pictureOptions=pr};CAreaSeries.prototype.setTrendline=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_AreaSeries_SetTrendline, this.trendline,pr));this.trendline=pr};CAreaSeries.prototype.setVal=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_AreaSeries_SetVal,this.val,pr));this.val=pr;if(this.val&&this.val.setParent)this.val.setParent(this)};var AX_POS_L=0;var AX_POS_T=1;var AX_POS_R=2;var AX_POS_B=3;var CROSSES_AUTO_ZERO=0;var CROSSES_MAX=1;var CROSSES_MIN=2;var LBL_ALG_CTR=0;var LBL_ALG_L=1;var LBL_ALG_R=2;var TIME_UNIT_DAYS=0;var TIME_UNIT_MONTHS=1;var TIME_UNIT_YEARS=2;var CROSS_BETWEEN_BETWEEN= 0;var CROSS_BETWEEN_MID_CAT=1;function CCatAx(){this.auto=null;this.axId=null;this.axPos=null;this.crossAx=null;this.crosses=null;this.crossesAt=null;this.bDelete=null;this.extLst=null;this.lblAlgn=null;this.lblOffset=null;this.majorGridlines=null;this.majorTickMark=null;this.minorGridlines=null;this.minorTickMark=null;this.noMultiLvlLbl=null;this.numFmt=null;this.scaling=null;this.spPr=null;this.tickLblPos=null;this.tickLblSkip=null;this.tickMarkSkip=null;this.title=null;this.txPr=null;this.parent= null;this.posX=null;this.posY=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CCatAx.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent){this.parent.parent.parent.handleUpdateInternalChart();this.parent.parent.parent.addToRecalculate()}},Refresh_RecalcData2:function(pageIndex,object){this.parent&&this.parent.parent&&this.parent.parent.Refresh_RecalcData2(pageIndex,object)},getDrawingDocument:function(){return this.parent&& this.parent.parent&&this.parent.parent.getDrawingDocument&&this.parent.parent.getDrawingDocument()},createDuplicate:function(){var c=new CCatAx;c.setAuto(this.auto);c.setAxPos(this.axPos);c.setCrosses(this.crosses);c.setCrossesAt(this.crossesAt);c.setDelete(this.bDelete);c.setLblAlgn(this.lblAlgn);c.setLblOffset(this.lblOffset);if(this.majorGridlines)c.setMajorGridlines(this.majorGridlines.createDuplicate());c.setMajorTickMark(this.majorTickMark);if(this.minorGridlines)c.setMinorGridlines(this.minorGridlines.createDuplicate()); c.setMinorTickMark(this.minorTickMark);c.setNoMultiLvlLbl(this.noMultiLvlLbl);if(this.numFmt)c.setNumFmt(this.numFmt.createDuplicate());if(this.scaling)c.setScaling(this.scaling.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());c.setTickLblPos(this.tickLblPos);c.setTickLblSkip(this.tickLblSkip);c.setTickMarkSkip(this.tickMarkSkip);if(this.title)c.setTitle(this.title.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},getMenuProps:function(){var ret= new AscCommon.asc_CatAxisSettings;if(AscFormat.isRealNumber(this.tickMarkSkip))ret.putIntervalBetweenTick(this.tickMarkSkip);else ret.putIntervalBetweenTick(1);if(!AscFormat.isRealNumber(this.tickLblSkip))ret.putIntervalBetweenLabelsRule(c_oAscBetweenLabelsRule.auto);else{ret.putIntervalBetweenLabelsRule(c_oAscBetweenLabelsRule.manual);ret.putIntervalBetweenLabels(this.tickLblSkip)}var scaling=this.scaling;if(!scaling||scaling.orientation!==ORIENTATION_MAX_MIN)ret.putInvertCatOrder(false);else ret.putInvertCatOrder(true); var crossAx=this.crossAx;if(crossAx){if(AscFormat.isRealNumber(this.maxCatVal))ret.putCrossMaxVal(this.maxCatVal);ret.putCrossMinVal(1);if(AscFormat.isRealNumber(crossAx.crossesAt)){ret.putCrossesRule(c_oAscCrossesRule.value);ret.putCrosses(crossAx.crossesAt)}else if(crossAx.crosses===CROSSES_MAX){ret.putCrossesRule(c_oAscCrossesRule.maxValue);if(AscFormat.isRealNumber(this.maxCatVal))ret.putCrosses(this.maxCatVal)}else if(crossAx.crosses===CROSSES_MIN){ret.putCrossesRule(c_oAscCrossesRule.minValue); ret.putCrosses(1)}else{ret.putCrossesRule(c_oAscCrossesRule.auto);ret.putCrosses(1)}}if(AscFormat.isRealNumber(this.lblOffset))ret.putLabelsAxisDistance(this.lblOffset);else ret.putLabelsAxisDistance(100);if(this.crossAx)ret.putLabelsPosition(this.crossAx.crossBetween===CROSS_BETWEEN_MID_CAT?c_oAscLabelsPosition.byDivisions:c_oAscLabelsPosition.betweenDivisions);else ret.putLabelsPosition(c_oAscLabelsPosition.betweenDivisions);if(AscFormat.isRealNumber(this.tickLblPos))ret.putTickLabelsPos(this.tickLblPos); else ret.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);if(AscFormat.isRealNumber(this.majorTickMark))ret.putMajorTickMark(this.majorTickMark);else ret.putMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);if(AscFormat.isRealNumber(this.minorTickMark))ret.putMinorTickMark(this.minorTickMark);else ret.putMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);return ret},setMenuProps:function(props){if(!(isRealObject(props)&&typeof props.getAxisType==="function"&&(props.getAxisType()===c_oAscAxisType.cat|| props.getAxisType()===c_oAscAxisType.date)))return;var intervalBetweenTick=props.getIntervalBetweenTick();var intervalBetweenLabelsRule=props.getIntervalBetweenLabelsRule();var intervalBetweenLabels=props.getIntervalBetweenLabels();var invertCatOrder=props.getInvertCatOrder();var labelsAxisDistance=props.getLabelsAxisDistance();var axisType=props.getAxisType();var majorTickMark=props.getMajorTickMark();var minorTickMark=props.getMinorTickMark();var tickLabelsPos=props.getTickLabelsPos();var crossesRule= props.getCrossesRule();var crosses=props.getCrosses();var labelsPosition=props.getLabelsPosition();var bChanged=false;if(AscFormat.isRealNumber(intervalBetweenTick)&&this.tickMarkSkip!==intervalBetweenTick&&this.setTickMarkSkip){this.setTickMarkSkip(intervalBetweenTick);bChanged=true}if(AscFormat.isRealNumber(intervalBetweenLabelsRule)&&this.setTickLblSkip)if(intervalBetweenLabelsRule===c_oAscBetweenLabelsRule.auto){if(AscFormat.isRealNumber(this.tickLblSkip)){this.setTickLblSkip(null);bChanged=true}}else if(intervalBetweenLabelsRule=== c_oAscBetweenLabelsRule.manual&&AscFormat.isRealNumber(intervalBetweenLabels)&&this.tickLblSkip!==intervalBetweenLabels){this.setTickLblSkip(intervalBetweenLabels);bChanged=true}if(!this.scaling)this.setScaling(new CScaling);var scaling=this.scaling;if(AscFormat.isRealBool(invertCatOrder)){var new_orientation=invertCatOrder?ORIENTATION_MAX_MIN:ORIENTATION_MIN_MAX;if(scaling.orientation!==new_orientation){scaling.setOrientation(invertCatOrder?ORIENTATION_MAX_MIN:ORIENTATION_MIN_MAX);bChanged=true}}if(AscFormat.isRealNumber(labelsAxisDistance)&& this.lblOffset!==labelsAxisDistance&&this.setLblOffset){this.setLblOffset(labelsAxisDistance);bChanged=true}if(AscFormat.isRealNumber(axisType));if(AscFormat.isRealNumber(majorTickMark)&&this.majorTickMark!==majorTickMark){this.setMajorTickMark(majorTickMark);bChanged=true}if(AscFormat.isRealNumber(minorTickMark)&&this.minorTickMark!==minorTickMark){this.setMinorTickMark(minorTickMark);bChanged=true}if(bChanged)if(this.spPr&&this.spPr.ln&&this.spPr.ln.Fill&&this.spPr.ln.Fill.fill&&this.spPr.ln.Fill.fill.type=== window["Asc"].c_oAscFill.FILL_TYPE_NOFILL&&(this.majorTickMark!==c_oAscTickMark.TICK_MARK_NONE||this.minorTickMark!==c_oAscTickMark.TICK_MARK_NONE))this.spPr.setLn(null);if(AscFormat.isRealNumber(tickLabelsPos)&&this.tickLblPos!==tickLabelsPos){this.setTickLblPos(tickLabelsPos);bChanged=true}if(AscFormat.isRealNumber(crossesRule)&&isRealObject(this.crossAx))if(crossesRule===c_oAscCrossesRule.auto){if(this.crossAx.crossesAt!==null){this.crossAx.setCrossesAt(null);bChanged=true}if(this.crossAx.crosses!== CROSSES_AUTO_ZERO){this.crossAx.setCrosses(CROSSES_AUTO_ZERO);bChanged=true}}else if(crossesRule===c_oAscCrossesRule.value){if(AscFormat.isRealNumber(crosses)){if(this.crossAx.crossesAt!==crosses){this.crossAx.setCrossesAt(crosses);bChanged=true}if(this.crossAx!==null){this.crossAx.setCrosses(null);bChanged=true}}}else if(crossesRule===c_oAscCrossesRule.maxValue){if(this.crossAx.crossesAt!==null){this.crossAx.setCrossesAt(null);bChanged=true}if(this.crossAx.crosses!==CROSSES_MAX){this.crossAx.setCrosses(CROSSES_MAX); bChanged=true}}else if(crossesRule===c_oAscCrossesRule.minValue){if(this.crossAx.crossesAt!==null){this.crossAx.setCrossesAt(null);bChanged=true}if(this.crossAx.crosses!==CROSSES_MIN){this.crossAx.setCrosses(CROSSES_MIN);bChanged=true}}if(AscFormat.isRealNumber(labelsPosition)&&isRealObject(this.crossAx)&&this.crossAx.setCrossBetween){var new_lbl_position=labelsPosition===c_oAscLabelsPosition.byDivisions?CROSS_BETWEEN_MID_CAT:CROSS_BETWEEN_BETWEEN;if(this.crossAx.crossBetween!==new_lbl_position){this.crossAx.setCrossBetween(new_lbl_position); bChanged=true}}if(bChanged)if(this.bDelete===true)this.setDelete(false)},getObjectType:function(){return AscDFH.historyitem_type_CatAx},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},setAuto:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_CatAxSetAuto, this.auto,pr));this.auto=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setAxId:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CatAxSetAxId,this.axId,pr));this.axId=pr},setAxPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CatAxSetAxPos,this.axPos,pr));this.axPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setCrossAx:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CatAxSetCrossAx,this.crossAx,pr));this.crossAx=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setCrosses:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CatAxSetCrosses,this.crosses,pr));this.crosses=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setCrossesAt:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_CatAxSetCrossesAt,this.crossesAt,pr));this.crossesAt=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setDelete:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_CatAxSetDelete,this.bDelete,pr));this.bDelete=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setLblAlgn:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CatAxSetLblAlgn,this.lblAlgn,pr));this.lblAlgn=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setLblOffset:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CatAxSetLblOffset,this.lblOffset,pr));this.lblOffset=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setMajorGridlines:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CatAxSetMajorGridlines,this.majorGridlines,pr));this.majorGridlines=pr;if(this.majorGridlines)this.majorGridlines.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()},setMajorTickMark:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CatAxSetMajorTickMark,this.majorTickMark,pr));this.majorTickMark=pr;if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMinorGridlines:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CatAxSetMinorGridlines,this.minorGridlines,pr));this.minorGridlines=pr;if(this.minorGridlines)this.minorGridlines.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()},setMinorTickMark:function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_CatAxSetMinorTickMark,this.minorTickMark,pr));this.minorTickMark=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setNoMultiLvlLbl:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_CatAxSetNoMultiLvlLbl,this.noMultiLvlLbl,pr));this.noMultiLvlLbl=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setNumFmt:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_CatAxSetNumFmt,this.numFmt,pr));this.numFmt=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setScaling:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CatAxSetScaling,this.scaling,pr));this.scaling=pr;if(this.scaling)this.scaling.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_CatAxSetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTickLblPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CatAxSetTickLblPos,this.tickLblPos,pr));this.tickLblPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTickLblSkip:function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_CatAxSetTickLblSkip,this.tickLblSkip,pr));this.tickLblSkip=pr},setTickMarkSkip:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_CatAxSetTickMarkSkip,this.tickMarkSkip,pr));this.tickMarkSkip=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTitle:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CatAxSetTitle,this.title,pr));this.title=pr;if(pr)pr.setParent(this); if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},getParentObjects:function(){return this.parent&&this.parent.getParentObjects()},setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CatAxSetTxPr,this.txPr,pr));this.txPr=pr;if(this.txPr)this.txPr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.handleUpdateInternalChart()}, handleUpdateFill:function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},handleUpdateLn:function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}};function CDateAx(){this.auto=null;this.axId=null;this.axPos=null;this.baseTimeUnit=null;this.crossAx=null;this.crosses=null;this.crossesAt=null;this.bDelete=null;this.extLst=null;this.lblOffset=null;this.majorGridlines= null;this.majorTickMark=null;this.majorTimeUnit=null;this.majorUnit=null;this.minorGridlines=null;this.minorTickMark=null;this.minorTimeUnit=null;this.minorUnit=null;this.numFmt=null;this.scaling=null;this.spPr=null;this.tickLblPos=null;this.title=null;this.txPr=null;this.parent=null;this.posX=null;this.posY=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CDateAx.prototype={Get_Id:function(){return this.Id},getObjectType:function(){return AscDFH.historyitem_type_DateAx},Refresh_RecalcData2:function(pageIndex, object){this.parent&&this.parent.parent&&this.parent.parent.Refresh_RecalcData2(pageIndex,object)},getDrawingDocument:function(){return this.parent&&this.parent.parent&&this.parent.parent.getDrawingDocument&&this.parent.parent.getDrawingDocument()},Refresh_RecalcData:function(pageIndex,object){if(this.parent&&this.parent.parent&&this.parent.parent.parent){this.parent.parent.parent.handleUpdateInternalChart();this.parent.parent.parent.addToRecalculate()}},getMenuProps:CCatAx.prototype.getMenuProps, setMenuProps:CCatAx.prototype.setMenuProps,createDuplicate:function(){var c=new CDateAx;c.setAuto(this.auto);c.setAxPos(this.axPos);c.setBaseTimeUnit(this.baseTimeUnit);c.setCrosses(this.crosses);c.setCrossesAt(this.crossesAt);c.setDelete(this.bDelete);c.setLblOffset(this.lblOffset);if(this.majorGridlines)c.setMajorGridlines(this.majorGridlines.createDuplicate());c.setMajorTickMark(this.majorTickMark);c.setMajorTimeUnit(this.majorTimeUnit);if(this.minorGridlines)c.setMinorGridlines(this.minorGridlines.createDuplicate()); c.setMinorTickMark(this.minorTickMark);c.setMinorTimeUnit(this.minorTimeUnit);if(this.numFmt)c.setNumFmt(this.numFmt.createDuplicate());if(this.scaling)c.setScaling(this.scaling.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());c.setTickLblPos(this.tickLblPos);if(this.title)c.setTitle(this.title.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},setAuto:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DateAxAuto,this.auto, pr));this.auto=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setAxId:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_DateAxAxId,this.axId,pr));this.axId=pr},setAxPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DateAxAxPos,this.axPos,pr));this.axPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setBaseTimeUnit:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_DateAxBaseTimeUnit,this.baseTimeUnit,pr));this.baseTimeUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setCrossAx:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DateAxCrossAx,this.crossAx,pr));this.crossAx=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setCrosses:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DateAxCrosses,this.crosses,pr));this.crosses=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setCrossesAt:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_DateAxCrossesAt,this.crossesAt,pr));this.crossesAt=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setDelete:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DateAxDelete,this.bDelete,pr));this.bDelete=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setLblOffset:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DateAxLblOffset,this.lblOffset,pr));this.lblOffset=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setMajorGridlines:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DateAxMajorGridlines,this.majorGridlines,pr));this.majorGridlines=pr;if(this.majorGridlines)this.majorGridlines.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()},setMajorTickMark:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DateAxMajorTickMark,this.majorTickMark,pr));this.majorTickMark=pr;if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMajorTimeUnit:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_DateAxMajorTimeUnit,this.majorTimeUnit,pr));this.majorTimeUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMajorUnit:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_DateAxMajorUnit,this.majorUnit,pr)); this.majorUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMinorGridlines:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DateAxMajorGridlines,this.majorGridlines,pr));this.minorGridlines=pr;if(this.minorGridlines)this.minorGridlines.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()},setMinorTickMark:function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_DateAxMinorTickMark,this.minorTickMark,pr));this.minorTickMark=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMinorTimeUnit:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_DateAxMinorTimeUnit,this.minorTimeUnit,pr));this.minorTimeUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMinorUnit:function(pr){History.Add(new CChangesDrawingsDouble(this, AscDFH.historyitem_DateAxMinorUnit,this.minorUnit,pr));this.minorUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setNumFmt:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DateAxNumFmt,this.numFmt,pr));this.numFmt=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setScaling:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_DateAxScaling,this.scaling,pr));this.scaling=pr;if(this.scaling)this.scaling.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DateAxSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setTickLblPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DateAxTickLblPos,this.tickLblPos,pr));this.tickLblPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTitle:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DateAxTitle,this.title,pr));this.title=pr;if(pr)pr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, getParentObjects:function(){return this.parent&&this.parent.getParentObjects()},setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DateAxTxPr,this.txPr,pr));this.txPr=pr;if(this.txPr)this.txPr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.handleUpdateInternalChart()},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())}, Read_FromBinary2:function(r){this.Id=r.GetString2()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr}};function CSerAx(){this.axId=null;this.axPos=null;this.crossAx=null;this.crosses=null;this.crossesAt=null;this.bDelete=null;this.extLst=null;this.majorGridlines=null;this.majorTickMark=null;this.minorGridlines=null;this.minorTickMark=null;this.numFmt=null;this.scaling=null;this.spPr=null;this.tickLblPos= null;this.tickLblSkip=null;this.tickMarkSkip=null;this.title=null;this.txPr=null;this.parent=null;this.posX=null;this.posY=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CSerAx.prototype={getObjectType:function(){return AscDFH.historyitem_type_SerAx},Get_Id:function(){return this.Id},Refresh_RecalcData2:function(pageIndex,object){this.parent&&this.parent.parent&&this.parent.parent.Refresh_RecalcData2(pageIndex,object)},getMenuProps:CCatAx.prototype.getMenuProps,setMenuProps:CCatAx.prototype.setMenuProps, getDrawingDocument:function(){return this.parent&&this.parent.parent&&this.parent.parent.getDrawingDocument&&this.parent.parent.getDrawingDocument()},Refresh_RecalcData:function(pageIndex,object){if(this.parent&&this.parent.parent&&this.parent.parent.parent){this.parent.parent.parent.handleUpdateInternalChart();this.parent.parent.parent.addToRecalculate()}},createDuplicate:function(){var c=new CSerAx;c.setAxPos(this.axPos);c.setCrosses(this.crosses);c.setCrossesAt(this.crossesAt);c.setDelete(this.bDelete); if(this.majorGridlines)c.setMajorGridlines(this.majorGridlines.createDuplicate());c.setMajorTickMark(this.majorTickMark);if(this.minorGridlines)c.setMajorGridlines(this.minorGridlines.createDuplicate());c.setMajorTickMark(this.minorTickMark);if(this.numFmt)c.setNumFmt(this.numFmt.createDuplicate());if(this.scaling)c.setScaling(this.scaling.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());c.setTickLblPos(this.tickLblPos);c.setTickLblSkip(this.tickLblSkip);c.setTickMarkSkip(this.tickMarkSkip); if(this.title)c.setTitle(this.title.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},setAxId:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_SerAxSetAxId,this.axId,pr));this.axId=pr},setAxPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_SerAxSetAxPos,this.axPos,pr));this.axPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setCrossAx:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_SerAxSetCrossAx,this.crossAx,pr));this.crossAx=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setCrosses:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_SerAxSetCrosses,this.crosses,pr));this.crosses=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setCrossesAt:function(pr){History.Add(new CChangesDrawingsDouble(this, AscDFH.historyitem_SerAxSetCrossesAt,this.crossesAt,pr));this.crossesAt=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setDelete:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_SerAxSetDelete,this.bDelete,pr));this.bDelete=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMajorGridlines:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_SerAxSetMajorGridlines,this.majorGridlines,pr));this.majorGridlines=pr;if(this.majorGridlines)this.majorGridlines.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()},setMajorTickMark:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_SerAxSetMajorTickMark,this.majorTickMark,pr));this.majorTickMark=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()}, setMinorGridlines:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SerAxSetMinorGridlines,this.majorGridlines,pr));this.minorGridlines=pr;if(this.minorGridlines)this.minorGridlines.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()},setMinorTickMark:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_SerAxSetMinorTickMark,this.minorTickMark,pr));this.minorTickMark=pr;if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setNumFmt:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SerAxSetNumFmt,this.numFmt,pr));this.numFmt=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setScaling:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SerAxSetScaling,this.scaling,pr));this.scaling=pr;if(this.scaling)this.scaling.setParent(this); if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SerAxSetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTickLblPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_SerAxSetTickLblPos, this.tickLblPos,pr));this.tickLblPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTickLblSkip:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_SerAxSetTickLblSkip,this.tickLblSkip,pr));this.tickLblSkip=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTickMarkSkip:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_SerAxSetTickMarkSkip, this.tickMarkSkip,pr));this.tickMarkSkip=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTitle:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SerAxSetTitle,this.title,pr));this.title=pr;if(pr)pr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},getParentObjects:function(){return this.parent&&this.parent.getParentObjects()}, setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SerAxSetTxPr,this.txPr,pr));this.txPr=pr;if(this.txPr)this.txPr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.handleUpdateInternalChart()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()}};function CValAx(){this.axId=null;this.axPos=null;this.crossAx=null;this.crossBetween=null;this.crosses=null;this.crossesAt=null;this.bDelete=null;this.dispUnits=null;this.extLst=null;this.majorGridlines=null;this.majorTickMark=null;this.majorUnit=null;this.minorGridlines=null;this.minorTickMark=null;this.minorUnit=null;this.numFmt=null;this.scaling=null;this.spPr=null;this.tickLblPos=null;this.title=null;this.txPr= null;this.parent=null;this.posX=null;this.posY=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CValAx.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent){this.parent.parent.parent.handleUpdateInternalChart();this.parent.parent.parent.addToRecalculate()}},Refresh_RecalcData2:function(pageIndex,object){this.parent&&this.parent.parent&&this.parent.parent.Refresh_RecalcData2(pageIndex,object)},getDrawingDocument:function(){return this.parent&& this.parent.parent&&this.parent.parent.getDrawingDocument&&this.parent.parent.getDrawingDocument()},createDuplicate:function(o){var c;if(o)c=o;else c=new CValAx;c.setAxPos(this.axPos);c.setCrossBetween(this.crossBetween);c.setCrosses(this.crosses);c.setCrossesAt(this.crossesAt);c.setDelete(this.bDelete);if(this.dispUnits)c.setDispUnits(this.dispUnits.createDuplicate());if(this.majorGridlines)c.setMajorGridlines(this.majorGridlines.createDuplicate());c.setMajorTickMark(this.majorTickMark);c.setMajorUnit(this.majorUnit); if(this.minorGridlines)c.setMinorGridlines(this.minorGridlines.createDuplicate());c.setMinorTickMark(this.minorTickMark);c.setMinorUnit(this.minorUnit);this.numFmt&&c.setNumFmt(this.numFmt.createDuplicate());this.scaling&&c.setScaling(this.scaling.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());c.setTickLblPos(this.tickLblPos);if(this.title)c.setTitle(this.title.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());c.scale=this.scale;return c},getObjectType:function(){return AscDFH.historyitem_type_ValAx}, Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setAxId:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ValAxSetAxId,this.axId,pr));this.axId=pr},setAxPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ValAxSetAxPos,this.axPos,pr));this.axPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setCrossAx:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ValAxSetCrossAx,this.crossAx,pr));this.crossAx=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setCrossBetween:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ValAxSetCrossBetween,this.crossBetween,pr));this.crossBetween=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setCrosses:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_ValAxSetCrosses,this.crosses,pr));this.crosses=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setCrossesAt:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_ValAxSetCrossesAt,this.crossesAt,pr));this.crossesAt=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setDelete:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_ValAxSetDelete,this.bDelete,pr));this.bDelete=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setDispUnits:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ValAxSetDispUnits,this.dispUnits,pr));this.dispUnits=pr;if(this.dispUnits)this.dispUnits.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setMajorGridlines:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ValAxSetMajorGridlines,this.majorGridlines,pr));this.majorGridlines=pr;if(this.majorGridlines)this.majorGridlines.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()},setMajorTickMark:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ValAxSetMajorTickMark,this.majorTickMark,pr));this.majorTickMark=pr;if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMajorUnit:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_ValAxSetMajorUnit,this.majorUnit,pr));this.majorUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMinorGridlines:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ValAxSetMinorGridlines,this.minorGridlines,pr)); this.minorGridlines=pr;if(this.minorGridlines)this.minorGridlines.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateGridlines()},setMinorTickMark:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ValAxSetMinorTickMark,this.minorTickMark,pr));this.minorTickMark=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setMinorUnit:function(pr){History.Add(new CChangesDrawingsDouble(this, AscDFH.historyitem_ValAxSetMinorUnit,this.minorUnit,pr));this.minorUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setNumFmt:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ValAxSetNumFmt,this.numFmt,pr));this.numFmt=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setScaling:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_ValAxSetScaling,this.scaling,pr));this.scaling=pr;if(this.scaling)this.scaling.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ValAxSetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, setTickLblPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ValAxSetTickLblPos,this.tickLblPos,pr));this.tickLblPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},setTitle:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ValAxSetTitle,this.title,pr));this.title=pr;if(pr)pr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()}, getParentObjects:function(){return this.parent&&this.parent.getParentObjects()},setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ValAxSetTxPr,this.txPr,pr));this.txPr=pr;if(this.txPr)this.txPr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.handleUpdateInternalChart()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent, this.parent,pr));this.parent=pr},handleUpdateFill:function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},handleUpdateLn:function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()},getMenuProps:function(){var ret=new AscCommon.asc_ValAxisSettings;var scaling=this.scaling;if(scaling&&AscFormat.isRealNumber(scaling.logBase)){ret.putLogScale(true);ret.putLogBase(scaling.logBase)}else ret.putLogScale(false); var oMinMaxOnAxis;if(this.axPos===AX_POS_L||this.axPos===AX_POS_R)oMinMaxOnAxis=getMinMaxFromArrPoints(this.yPoints);else oMinMaxOnAxis=getMinMaxFromArrPoints(this.xPoints);if(scaling&&AscFormat.isRealNumber(scaling.max)){ret.putMaxValRule(c_oAscValAxisRule.fixed);ret.putMaxVal(scaling.max)}else{ret.putMaxValRule(c_oAscValAxisRule.auto);ret.putMaxVal(oMinMaxOnAxis.max)}if(scaling&&AscFormat.isRealNumber(scaling.min)){ret.putMinValRule(c_oAscValAxisRule.fixed);ret.putMinVal(scaling.min)}else{ret.putMinValRule(c_oAscValAxisRule.auto); ret.putMinVal(oMinMaxOnAxis.min)}ret.putInvertValOrder(scaling&&scaling.orientation===ORIENTATION_MAX_MIN);if(isRealObject(this.dispUnits)){var disp_units=this.dispUnits;if(AscFormat.isRealNumber(disp_units.builtInUnit)){ret.putDispUnitsRule(disp_units.builtInUnit);ret.putShowUnitsOnChart(isRealObject(disp_units.dispUnitsLbl))}else if(AscFormat.isRealNumber(disp_units.custUnit)){ret.putDispUnitsRule(c_oAscValAxUnits.CUSTOM);ret.putUnits(disp_units.custUnit);ret.putShowUnitsOnChart(isRealObject(disp_units.dispUnitsLbl))}else{ret.putDispUnitsRule(c_oAscValAxUnits.none); ret.putShowUnitsOnChart(false)}}else{ret.putDispUnitsRule(c_oAscValAxUnits.none);ret.putShowUnitsOnChart(false)}if(AscFormat.isRealNumber(this.majorTickMark))ret.putMajorTickMark(this.majorTickMark);else ret.putMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);if(AscFormat.isRealNumber(this.minorTickMark))ret.putMinorTickMark(this.minorTickMark);else ret.putMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);if(AscFormat.isRealNumber(this.tickLblPos))ret.putTickLabelsPos(this.tickLblPos);else ret.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO); var crossAx=this.crossAx;if(crossAx)if(AscFormat.isRealNumber(crossAx.crossesAt)){ret.putCrossesRule(c_oAscCrossesRule.value);ret.putCrosses(crossAx.crossesAt)}else if(crossAx.crosses===CROSSES_MAX){ret.putCrossesRule(c_oAscCrossesRule.maxValue);ret.putCrosses(oMinMaxOnAxis.max)}else if(crossAx.crosses===CROSSES_MIN){ret.putCrossesRule(c_oAscCrossesRule.minValue);ret.putCrosses(oMinMaxOnAxis.min)}else{ret.putCrossesRule(c_oAscCrossesRule.auto);if(AscFormat.isRealNumber(oMinMaxOnAxis.min)&&AscFormat.isRealNumber(oMinMaxOnAxis.max))if(0>= oMinMaxOnAxis.min&&0<=oMinMaxOnAxis.max)ret.putCrosses(0);else if(oMinMaxOnAxis.min>0)ret.putCrosses(oMinMaxOnAxis.min);else ret.putCrosses(oMinMaxOnAxis.max)}return ret},setMenuProps:function(props){var bChanged=false;if(!(isRealObject(props)&&typeof props.getAxisType==="function"&&props.getAxisType()===c_oAscAxisType.val))return;if(!this.scaling)this.setScaling(new CScaling);var scaling=this.scaling;if(AscFormat.isRealNumber(props.minValRule))if(props.minValRule===c_oAscValAxisRule.auto){if(AscFormat.isRealNumber(scaling.min)){scaling.setMin(null); bChanged=true}}else if(AscFormat.isRealNumber(props.minVal))if(!(props.maxValRule===c_oAscValAxisRule.fixed&&props.maxVal<props.minVal)&&scaling.min!==props.minVal){scaling.setMin(props.minVal);bChanged=true}if(AscFormat.isRealNumber(props.maxValRule))if(props.maxValRule===c_oAscValAxisRule.auto){if(AscFormat.isRealNumber(scaling.max)){scaling.setMax(null);bChanged=true}}else if(AscFormat.isRealNumber(props.maxVal))if(!AscFormat.isRealNumber(scaling.min)||scaling.min<props.maxVal)if(scaling.max!== props.maxVal){scaling.setMax(props.maxVal);bChanged=true}if(AscFormat.isRealBool(props.invertValOrder)){var new_or=props.invertValOrder?ORIENTATION_MAX_MIN:ORIENTATION_MIN_MAX;if(scaling.orientation!==new_or){scaling.setOrientation(new_or);bChanged=true}}if(AscFormat.isRealBool(props.logScale))if(props.logScale&&AscFormat.isRealNumber(props.logBase)&&props.logBase>=2&&props.logBase<=1E3){if(scaling.logBase!==props.logBase){scaling.setLogBase(props.logBase);bChanged=true}}else if(!props.logBase&&scaling.logBase!== null){scaling.setLogBase(null);bChanged=true}if(AscFormat.isRealNumber(props.dispUnitsRule))if(props.dispUnitsRule===c_oAscValAxUnits.none){if(this.dispUnits){this.setDispUnits(null);bChanged=true}}else{if(!this.dispUnits){this.setDispUnits(new CDispUnits);bChanged=true}if(this.dispUnits.builtInUnit!==props.dispUnitsRule){this.dispUnits.setBuiltInUnit(props.dispUnitsRule);bChanged=true}if(AscFormat.isRealBool(this.showUnitsOnChart)){this.dispUnits.setDispUnitsLbl(new CDLbl);bChanged=true}}if(AscFormat.isRealNumber(props.majorTickMark)&& this.majorTickMark!==props.majorTickMark){this.setMajorTickMark(props.majorTickMark);bChanged=true}if(AscFormat.isRealNumber(props.minorTickMark)&&this.minorTickMark!==props.minorTickMark){this.setMinorTickMark(props.minorTickMark);bChanged=true}if(bChanged)if(this.spPr&&this.spPr.ln&&this.spPr.ln.Fill&&this.spPr.ln.Fill.fill&&this.spPr.ln.Fill.fill.type===window["Asc"].c_oAscFill.FILL_TYPE_NOFILL&&(this.majorTickMark!==c_oAscTickMark.TICK_MARK_NONE||this.minorTickMark!==c_oAscTickMark.TICK_MARK_NONE))this.spPr.setLn(null); if(AscFormat.isRealNumber(props.tickLabelsPos)&&this.tickLblPos!==props.tickLabelsPos){this.setTickLblPos(props.tickLabelsPos);bChanged=true}if(AscFormat.isRealNumber(props.crossesRule)&&isRealObject(this.crossAx))if(props.crossesRule===c_oAscCrossesRule.auto){if(this.crossAx.crossesAt!==null){this.crossAx.setCrossesAt(null);bChanged=true}if(this.crossAx.crosses!==CROSSES_AUTO_ZERO){this.crossAx.setCrosses(CROSSES_AUTO_ZERO);bChanged=true}}else if(props.crossesRule===c_oAscCrossesRule.value){if(AscFormat.isRealNumber(props.crosses)){if(this.crossAx.crossesAt!== props.crosses){this.crossAx.setCrossesAt(props.crosses);bChanged=true}if(this.crossAx.crosses!==null){this.crossAx.setCrosses(null);bChanged=true}}}else if(props.crossesRule===c_oAscCrossesRule.maxValue){if(this.crossAx.crossesAt!==null){this.crossAx.setCrossesAt(null);bChanged=true}if(this.crossAx.crosses!==CROSSES_MAX){this.crossAx.setCrosses(CROSSES_MAX);bChanged=true}}else if(props.crossesRule===c_oAscCrossesRule.minValue){if(this.crossAx.crossesAt!==null){this.crossAx.setCrossesAt(null);bChanged= true}if(this.crossAx.crosses!==CROSSES_MIN){this.crossAx.setCrosses(CROSSES_MIN);bChanged=true}}if(bChanged)if(this.bDelete===true)this.setDelete(false)},getFormatCode:function(oChartSpace,oSeries){var oNumFmt=this.numFmt;var sFormatCode=null;if(oNumFmt){sFormatCode=oNumFmt.formatCode;if(false===oNumFmt.sourceLinked&&typeof sFormatCode==="string"&&sFormatCode.length>0)return sFormatCode}if(oSeries)if(oSeries.getObjectType()===AscDFH.historyitem_type_ScatterSer&&(this.axPos===AscFormat.AX_POS_B||this.axPos=== AscFormat.AX_POS_T)){var oXVal=oSeries.xVal;if(oXVal){var oXValLit=oXVal.numRef&&oXVal.numRef.numCache||oXVal.numLit||oXVal.strRef&&oXVal.strRef.strCache;if(oXValLit){var aXPts=oXValLit.pts;if(aXPts[0]&&aXPts[0].idx===0&&typeof aXPts[0].formatCode==="string"&&aXPts[0].formatCode.length>0)sFormatCode=aXPts[0].formatCode;else if(oXValLit.formatCode)sFormatCode=oXValLit.formatCode}}}else{var aPoints=AscFormat.getPtsFromSeries(oSeries);if(aPoints[0]&&aPoints[0].idx===0&&typeof aPoints[0].formatCode=== "string"&&aPoints[0].formatCode.length>0)sFormatCode=aPoints[0].formatCode;else if(oSeries.parent&&(oSeries.parent.getObjectType()===AscDFH.historyitem_type_BarChart&&oSeries.parent.grouping===AscFormat.BAR_GROUPING_PERCENT_STACKED||oSeries.parent.getObjectType()!==AscDFH.historyitem_type_BarChart&&oSeries.parent.grouping===AscFormat.GROUPING_PERCENT_STACKED))sFormatCode="0%";else if(oChartSpace.worksheet){var oBBox=oChartSpace._recalculateBBox([oSeries]);if(oBBox&&oBBox.seriesBBoxes[0]&&oBBox.seriesBBoxes[0].bbox){var cell= oChartSpace.worksheet.getCell3(oBBox.seriesBBoxes[0].bbox.r1,oBBox.seriesBBoxes[0].bbox.c1);sFormatCode=cell.getNumFormatStr()}}if(!sFormatCode)sFormatCode=oSeries.getFormatCode()}return sFormatCode}};function CBandFmt(){this.idx=null;this.spPr=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CBandFmt.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CBandFmt;c.setIdx(this.idx);if(this.spPr)c.setSpPr(this.spPr.createDuplicate()); return c},getObjectType:function(){return AscDFH.historyitem_type_BandFmt},setIdx:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_BandFmt_SetIdx,this.idx,pr));this.idx=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BandFmt_SetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this);if(this.spPr)this.spPr.setParent(this)},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id= r.GetString2()}};function CBarSeries(){CSeriesBase.call(this);this.cat=null;this.dLbls=null;this.dPt=[];this.errBars=null;this.invertIfNegative=null;this.pictureOptions=null;this.shape=null;this.trendline=null;this.val=null}CBarSeries.prototype=Object.create(CSeriesBase.prototype);CBarSeries.prototype.constructor=CBarSeries;CBarSeries.prototype.removeDPt=function(idx){if(this.dPt[idx]){var arrPt=this.dPt.splice(idx,1);History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonSeries_RemoveDPt, idx,arrPt,false))}};CBarSeries.prototype.getObjectType=function(){return AscDFH.historyitem_type_BarSeries};CBarSeries.prototype.createDuplicate=function(){var c=new CBarSeries;if(this.cat)c.setCat(this.cat.createDuplicate());if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());for(var i=0;i<this.dPt.length;++i)c.addDPt(this.dPt[i].createDuplicate());if(this.errBars)c.setErrBars(this.errBars.createDuplicate());c.setIdx(this.idx);c.setInvertIfNegative(this.invertIfNegative);c.setOrder(this.order); if(this.pictureOptions)c.setPictureOptions(this.pictureOptions.createDuplicate());c.setShape(this.shape);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.trendline)c.setTrendline(this.trendline.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate());if(this.val)c.setVal(this.val.createDuplicate());return c};CBarSeries.prototype.setFromOtherSeries=function(o){if(o.cat)this.setCat(o.cat);if(o.dLbls)this.setDLbls(o.dLbls);if(o.dPt)for(var i=0;i<o.dPt.length;++i)this.addDPt(o.dPt[i]); if(o.errBars)this.setErrBars(o.errBars);if(AscFormat.isRealNumber(o.idx))this.setIdx(o.idx);if(AscFormat.isRealBool(o.invertIfNegative))this.setInvertIfNegative(o.invertIfNegative);if(AscFormat.isRealNumber(o.order))this.setOrder(o.order);if(o.pictureOptions)this.setPictureOptions(o.pictureOptions);if(o.shape)this.setShape(o.shape);if(o.spPr){this.setSpPr(o.spPr);if(o instanceof AscFormat.CLineSeries||o instanceof AscFormat.CScatterSeries)if(this.spPr&&this.spPr.Fill&&this.spPr.Fill.fill&&this.spPr.Fill.fill.type=== window["Asc"].c_oAscFill.FILL_TYPE_NOFILL)this.spPr.setFill(null)}if(o.trendline)this.setTrendline(o.trendline);if(o.tx)this.setTx(o.tx);if(o.val)this.setVal(o.val);if(o.xVal){this.setCat(new CCat);this.cat.setFromOtherObject(o.xVal)}if(o.yVal){this.setVal(new CYVal);this.val.setFromOtherObject(o.yVal)}};CBarSeries.prototype.setCat=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BarSeries_SetCat,this.cat,pr));this.cat=pr};CBarSeries.prototype.setDLbls=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_BarSeries_SetDLbls,this.dLbls,pr));this.dLbls=pr;if(this.dLbls)this.dLbls.setParent(this)};CBarSeries.prototype.addDPt=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_BarSeries_SetDPt,this.dPt.length,[pr],true));this.dPt.push(pr)};CBarSeries.prototype.setErrBars=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BarSeries_SetErrBars,this.errBars,pr));this.errBars=pr};CBarSeries.prototype.setInvertIfNegative=function(pr){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_BarSeries_SetInvertIfNegative,this.invertIfNegative,pr));this.invertIfNegative=pr};CBarSeries.prototype.setPictureOptions=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BarSeries_SetPictureOptions,this.pictureOptions,pr));this.pictureOptions=pr};CBarSeries.prototype.setShape=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BarSeries_SetShape,this.shape,pr));this.shape=pr};CBarSeries.prototype.setTrendline=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_BarSeries_SetTrendline,this.trendline,pr));this.trendline=pr};CBarSeries.prototype.setVal=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BarSeries_SetVal,this.val,pr));this.val=pr;if(this.val&&this.val.setParent)this.val.setParent(this)};function CBubbleChart(){CChartBase.call(this);this.bubble3D=null;this.bubbleScale=null;this.showNegBubbles=null;this.sizeRepresents=null;this.varyColors=null}CBubbleChart.prototype=Object.create(CChartBase.prototype); CBubbleChart.prototype.constructor=CBubbleChart;CBubbleChart.prototype.Refresh_RecalcData=function(){};CBubbleChart.prototype.getSeriesConstructor=function(){return new CBubbleSeries};CBubbleChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_BubbleChart};CBubbleChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.r};CBubbleChart.prototype.createDuplicate=function(){var c=new CBubbleChart;c.setBubble3D(this.bubble3D);c.setBubbleScale(this.bubbleScale); if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());c.setShowNegBubbles(this.showNegBubbles);c.setSizeRepresents(this.sizeRepresents);c.setVaryColors(this.varyColors);return c};CBubbleChart.prototype.setBubble3D=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_BubbleChart_SetBubble3D,this.bubble3D,pr));this.bubble3D=pr};CBubbleChart.prototype.setBubbleScale=function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_BubbleChart_SetBubbleScale,this.bubbleScale,pr));this.bubbleScale=pr};CBubbleChart.prototype.setShowNegBubbles=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_BubbleChart_SetShowNegBubbles,this.showNegBubbles,pr));this.showNegBubbles=pr};CBubbleChart.prototype.setSizeRepresents=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_BubbleChart_SetSizeRepresents,this.sizeRepresents,pr));this.sizeRepresents=pr};function CBubbleSeries(){CSeriesBase.call(this); this.bubble3D=null;this.bubbleSize=null;this.dLbls=null;this.dPt=[];this.errBars=null;this.invertIfNegative=null;this.trendline=null;this.xVal=null;this.yVal=null}CBubbleSeries.prototype=Object.create(CSeriesBase.prototype);CBubbleSeries.prototype.constructor=CBubbleSeries;CBubbleSeries.prototype.getObjectType=function(){return AscDFH.historyitem_type_BubbleSeries};CBubbleSeries.prototype.removeDPt=function(idx){if(this.dPt[idx])History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonSeries_RemoveDPt, idx,this.dPt.splice(idx,1),false))};CBubbleSeries.prototype.createDuplicate=function(){var c=new CBubbleSeries;c.setBubble3D(this.bubble3D);c.setBubbleSize(this.bubbleSize);if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());for(var i=0;i<this.dPt.length;++i)c.addDPt(this.dPt[i].createDuplicate());if(this.errBars)c.setErrBars(this.errBars.createDuplicate());c.setIdx(this.idx);c.setInvertIfNegative(this.invertIfNegative);c.setOrder(this.order);if(this.spPr)c.setSpPr(this.spPr.createDuplicate()); if(this.trendline)c.setTrendline(this.trendline.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate());if(this.xVal)c.setXVal(this.xVal.createDuplicate());if(this.yVal)c.setYVal(this.yVal.createDuplicate());return c};CBubbleSeries.prototype.setFromOtherSeries=function(o){};CBubbleSeries.prototype.setBubble3D=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_BubbleSeries_SetBubble3D,this.bubble3D,pr));this.bubble3D=pr};CBubbleSeries.prototype.setBubbleSize=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_BubbleSeries_SetBubbleSize,this.bubbleSize,pr));this.bubbleSize=pr};CBubbleSeries.prototype.setDLbls=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BubbleSeries_SetDLbls,this.dLbls,pr));this.dLbls=pr;if(this.dLbls)this.dLbls.setParent(this)};CBubbleSeries.prototype.addDPt=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_BubbleSeries_SetDPt,this.dPt.length,[pr],true));this.dPt.push(pr)};CBubbleSeries.prototype.setErrBars=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_BubbleSeries_SetErrBars,this.errBars,pr));this.errBars=pr};CBubbleSeries.prototype.setInvertIfNegative=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_BubbleSeries_SetInvertIfNegative,this.invertIfNegative,pr));this.invertIfNegative=pr};CBubbleSeries.prototype.setTrendline=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BubbleSeries_SetTrendline,this.trendline,pr));this.trendline=pr};CBubbleSeries.prototype.setXVal=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_BubbleSeries_SetXVal,this.xVal,pr));this.xVal=pr};CBubbleSeries.prototype.setYVal=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_BubbleSeries_SetYVal,this.yVal,pr));this.yVal=pr;if(this.yVal&&this.yVal.setParent)this.yVal.setParent(this)};function CCat(){this.multiLvlStrRef=null;this.numLit=null;this.numRef=null;this.strLit=null;this.strRef=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CCat.prototype={Get_Id:function(){return this.Id}, Refresh_RecalcData:function(){},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},createDuplicate:function(){var c=new CCat;if(this.multiLvlStrRef)c.setMultiLvlStrRef(this.multiLvlStrRef.createDuplicate());if(this.numLit)c.setNumLit(this.numLit.createDuplicate());if(this.numRef)c.setNumRef(this.numRef.createDuplicate());if(this.strLit)c.setStrLit(this.strLit.createDuplicate());if(this.strRef)c.setStrRef(this.strRef.createDuplicate()); return c},getObjectType:function(){return AscDFH.historyitem_type_Cat},setFromOtherObject:function(o){if(o.multiLvlStrRef)this.setMultiLvlStrRef(o.multiLvlStrRef);if(o.numLit)this.setNumLit(o.numLit);if(o.numRef)this.setNumRef(o.numRef);if(o.strLit)this.setStrLit(o.strLit);if(o.strRef)this.setStrRef(o.strRef)},setMultiLvlStrRef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Cat_SetMultiLvlStrRef,this.multiLvlStrRef,pr));this.multiLvlStrRef=pr},setNumLit:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_Cat_SetNumLit,this.multiLvlStrRef,pr));this.numLit=pr},setNumRef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Cat_SetNumRef,this.multiLvlStrRef,pr));this.numRef=pr},setStrLit:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Cat_SetStrLit,this.multiLvlStrRef,pr));this.strLit=pr},setStrRef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Cat_SetStrRef,this.multiLvlStrRef,pr));this.strRef=pr},setValues:function(sValues){var oNumRef, oNumLit,oStrRef,oStrLit,oMultiLvl,oRef,oResult;oResult=new CParseResult;fParseNumRef(sValues,false,oResult);oNumRef=oResult.getObject();if(!oNumRef){fParseStrRef(sValues,true,oResult);oRef=oResult.getObject();if(oRef)if(oRef.getObjectType()===AscDFH.historyitem_type_StrRef)oStrRef=oRef;else if(oRef.getObjectType()===AscDFH.historyitem_type_MultiLvlStrRef)oMultiLvl=oRef;if(!oStrRef&&!oMultiLvl){fParseNumLit(sValues,false,oResult);oNumLit=oResult.getObject();if(!oNumLit){fParseStrLit(sValues,oResult); oStrLit=oResult.getObject()}}}if(oNumRef||oNumLit||oStrRef||oStrLit||oMultiLvl){if(oNumRef)this.setNumRef(oNumRef);else if(this.numRef)this.setNumRef(null);if(oNumLit)this.setNumLit(oNumLit);else if(this.numLit)this.setNumLit(null);if(oStrRef)this.setStrRef(oStrRef);else if(this.strRef)this.setStrRef(null);if(oStrLit)this.setStrLit(oStrLit);else if(this.strLit)this.setStrLit(null);if(oMultiLvl)this.setMultiLvlStrRef(oMultiLvl);else if(this.multiLvlStrRef)this.setMultiLvlStrRef(null)}return oResult}, getValues:function(nMaxCount){if(this.numLit)return this.numLit.getValues(nMaxCount);if(this.numRef)return this.numRef.getValues(nMaxCount);if(this.strLit)return this.strLit.getValues(nMaxCount);if(this.strRef)return this.strRef.getValues(nMaxCount,true);if(this.multiLvlStrRef)return this.multiLvlStrRef.getValues(nMaxCount)},getFormula:function(){if(this.numLit)return this.numLit.getFormula();if(this.numRef)return this.numRef.getFormula();if(this.strLit)return this.strLit.getFormula();if(this.strRef)return this.strRef.getFormula(); if(this.multiLvlStrRef)return this.multiLvlStrRef.getFormula();return""},getParsedRefs:function(){if(this.numRef)return this.numRef.getParsedRefs();if(this.strRef)return this.strRef.getParsedRefs();if(this.multiLvlStrRef)return this.multiLvlStrRef.getParsedRefs();return[]},isValid:function(){if(this.multiLvlStrRef||this.numLit||this.numRef||this.strLit||this.strRef)return true;return false},getStringPointsLit:function(){if(this.strRef&&this.strRef.strCache)return this.strRef.strCache;else if(this.strLit)return this.strLit; else if(this.multiLvlStrRef)return this.multiLvlStrRef.getFirstLvlCache();return null},getLit:function(){var oLit=null;if(this.strRef&&this.strRef.strCache)oLit=this.strRef.strCache;else if(this.strLit)oLit=this.strLit;else if(this.numRef&&this.numRef.numCache)oLit=this.numRef.numCache;else if(this.numLit)oLit=this.numLit;else if(this.multiLvlStrRef)oLit=this.multiLvlStrRef.getFirstLvlCache();return oLit},update:function(oSeries){if(this.multiLvlStrRef)this.multiLvlStrRef.updateCache(oSeries);if(this.numRef)this.numRef.updateCache(); if(this.strRef)this.strRef.updateCache()}};function CChartText(){this.rich=null;this.strRef=null;this.chart=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CChartText.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CChartText;if(this.rich){c.setRich(this.rich.createDuplicate());c.rich.setParent(c)}if(this.strRef)c.setStrRef(this.strRef.createDuplicate());return c},getStyles:CDLbl.prototype.getStyles, Get_Theme:CDLbl.prototype.Get_Theme,Get_ColorMap:CDLbl.prototype.Get_ColorMap,setChart:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartFormatSetChart,this.chart,pr));this.chart=pr},getDrawingDocument:function(){return this.parent&&this.parent.getDrawingDocument&&this.parent.getDrawingDocument()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},merge:function(tx,noCopyTextBody){if(tx.rich){if(noCopyTextBody=== true)this.setRich(tx.rich);else this.setRich(tx.rich.createDuplicate());this.rich.setParent(this)}if(tx.strRef)this.strRef=tx.strRef},getObjectType:function(){return AscDFH.historyitem_type_ChartText},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setRich:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartText_SetRich,this.rich,pr));this.rich=pr},setStrRef:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_ChartText_SetStrRef,this.strRef,pr));this.strRef=pr},update:function(){if(this.strRef)this.strRef.updateCache()}};function CDLbls(){this.bDelete=null;this.dLbl=[];this.dLblPos=null;this.leaderLines=null;this.numFmt=null;this.separator=null;this.showBubbleSize=null;this.showCatName=null;this.showLeaderLines=null;this.showLegendKey=null;this.showPercent=null;this.showSerName=null;this.showVal=null;this.spPr=null;this.txPr=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this, this.Id)}CDLbls.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){this.Refresh_RecalcData2()},Refresh_RecalcData2:function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent)if(this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels();else if(this.parent.parent.parent.parent.parent&&this.parent.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.parent.handleUpdateDataLabels()}, handleUpdateFill:function(){this.Refresh_RecalcData2()},handleUpdateLn:function(){this.Refresh_RecalcData2()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},createDuplicate:function(){var c=new CDLbls;c.setDelete(this.bDelete);for(var i=0;i<this.dLbl.length;++i)c.addDLbl(this.dLbl[i].createDuplicate());c.setDLblPos(this.dLblPos);if(this.leaderLines)c.setLeaderLines(this.leaderLines.createDuplicate()); if(this.numFmt)c.setNumFmt(this.numFmt.createDuplicate());c.setSeparator(this.separator);c.setShowBubbleSize(this.showBubbleSize);c.setShowCatName(this.showCatName);c.setShowLeaderLines(this.showLeaderLines);c.setShowLegendKey(this.showLegendKey);c.setShowPercent(this.showPercent);c.setShowSerName(this.showSerName);c.setShowVal(this.showVal);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},documentCreateFontMap:function(allFonts){AscFormat.checkTxBodyDefFonts(allFonts, this.txPr);for(var i=0;i<this.dLbl.length;++i){this.dLbl[i]&&AscFormat.checkTxBodyDefFonts(allFonts,this.dLbl[i].txPr);this.dLbl[i].tx&&this.dLbl[i].tx.rich&&this.dLbl[i].tx.rich.content&&this.dLbl[i].tx.rich.content.Document_Get_AllFontNames(allFonts)}},applyLabelsFunction:function(fCallback,value,oDD){fCallback(this,value,oDD,10);for(var i=0;i<this.dLbl.length;++i)this.dLbl[i]&&fCallback(this.dLbl[i],value,oDD,10)},getObjectType:function(){return AscDFH.historyitem_type_DLbls},findDLblByIdx:function(idx){for(var i= 0;i<this.dLbl.length;++i)if(this.dLbl[i].idx===idx)return this.dLbl[i];return null},getAllRasterImages:function(images){this.spPr&&this.spPr.checkBlipFillRasterImage(images);for(var i=0;i<this.dLbl.length;++i)this.dLbl[i]&&this.dLbl[i].spPr&&this.dLbl[i].spPr.checkBlipFillRasterImage(images)},checkSpPrRasterImages:function(){checkSpPrRasterImages(this.spPr);for(var i=0;i<this.dLbl.length;++i)this.dLbl[i]&&checkSpPrRasterImages(this.dLbl[i].spPr)},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setDelete:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbls_SetDelete,this.bDelete,pr));this.bDelete=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()},addDLbl:function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_DLbls_SetDLbl, this.dLbl.length,[pr],true));this.dLbl.push(pr);if(pr)pr.setParent(this)},removeDLbl:function(nIndex){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_DLbls_SetDLbl,nIndex,this.dLbl.splice(nIndex,1),false))},removeAllDLbls:function(){for(var i=this.dLbl.length-1;i>-1;--i)this.removeDLbl(i)},setDLblPos:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DLbls_SetDLblPos,this.dLblPos,pr));this.dLblPos=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&& this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()},setLeaderLines:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbls_SetLeaderLines,this.leaderLines,pr));this.leaderLines=pr},setNumFmt:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbls_SetNumFmt,this.numFmt,pr));this.numFmt=pr},setSeparator:function(pr){History.Add(new CChangesDrawingsString(this, AscDFH.historyitem_DLbls_SetSeparator,this.separator,pr));this.separator=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()},setShowBubbleSize:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbls_SetShowBubbleSize,this.showBubbleSize,pr));this.showBubbleSize=pr},setShowCatName:function(pr){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_DLbls_SetShowCatName,this.showCatName,pr));this.showCatName=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()},setShowLeaderLines:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbls_SetShowLeaderLines,this.showLeaderLines,pr));this.showLeaderLines=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&& this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()},setShowLegendKey:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbls_SetShowLegendKey,this.showLegendKey,pr));this.showLegendKey=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()}, setShowPercent:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbls_SetShowPercent,this.showPercent,pr));this.showPercent=pr},setShowSerName:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbls_SetShowSerName,this.showSerName,pr));this.showSerName=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()}, setShowVal:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DLbls_SetShowVal,this.showVal,pr));this.showVal=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbls_SetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this); if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()},setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DLbls_SetTxPr,this.txPr,pr));this.txPr=pr;if(pr)pr.setParent(this);if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateDataLabels)this.parent.parent.parent.parent.handleUpdateDataLabels()}}; function CDPt(){this.bubble3D=null;this.explosion=null;this.idx=null;this.invertIfNegative=null;this.marker=null;this.pictureOptions=null;this.spPr=null;this.recalcInfo={recalcLbl:true};this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CDPt.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_DPt},createDuplicate:function(){var c=new CDPt;c.setBubble3D(this.bubble3D);c.setExplosion(this.explosion);c.setIdx(this.idx); c.setInvertIfNegative(this.invertIfNegative);if(this.marker)c.setMarker(this.marker.createDuplicate());if(this.pictureOptions)c.setPictureOptions(this.pictureOptions.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());return c},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setBubble3D:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DPt_SetBubble3D,this.bubble3D, pr));this.bubble3D=pr},setExplosion:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DPt_SetExplosion,this.explosion,pr));this.explosion=pr},setIdx:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DPt_SetIdx,this.idx,pr));this.idx=pr},setInvertIfNegative:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DPt_SetInvertIfNegative,this.invertIfNegative,pr));this.invertIfNegative=pr},setMarker:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_DPt_SetMarker,this.marker,pr));this.marker=pr},setPictureOptions:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DPt_SetPictureOptions,this.pictureOptions,pr));this.pictureOptions=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DPt_SetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)}};function CDTable(){this.showHorzBorder=null;this.showKeys=null;this.showOutline=null;this.showVertBorder= null;this.spPr=null;this.txPr=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CDTable.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_DTable},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},createDuplicate:function(){var c=new CDTable;c.setShowHorzBorder(this.showHorzBorder);c.setShowKeys(this.showKeys); c.setShowOutline(this.showOutline);c.setShowVertBorder(this.showVertBorder);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},setShowHorzBorder:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DTable_SetShowHorzBorder,this.showHorzBorder,pr));this.showHorzBorder=pr},setShowKeys:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DTable_SetShowKeys,this.showHorzBorder,pr));this.showKeys=pr}, setShowOutline:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DTable_SetShowOutline,this.showHorzBorder,pr));this.showOutline=pr},setShowVertBorder:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_DTable_SetShowVertBorder,this.showHorzBorder,pr));this.showVertBorder=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DTable_SetSpPr,this.showHorzBorder,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)},setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_DTable_SetTxPr,this.showHorzBorder,pr));this.txPr=pr}};var UNIT_MULTIPLIERS=[];UNIT_MULTIPLIERS[c_oAscValAxUnits.BILLIONS]=1/1E9;UNIT_MULTIPLIERS[c_oAscValAxUnits.HUNDRED_MILLIONS]=1/1E8;UNIT_MULTIPLIERS[c_oAscValAxUnits.HUNDREDS]=1/100;UNIT_MULTIPLIERS[c_oAscValAxUnits.HUNDRED_THOUSANDS]=1/1E5;UNIT_MULTIPLIERS[c_oAscValAxUnits.MILLIONS]=1/1E6;UNIT_MULTIPLIERS[c_oAscValAxUnits.TEN_MILLIONS]=1/1E7;UNIT_MULTIPLIERS[c_oAscValAxUnits.TEN_THOUSANDS]=1/1E4;UNIT_MULTIPLIERS[c_oAscValAxUnits.TRILLIONS]= 1/1E12;UNIT_MULTIPLIERS[c_oAscValAxUnits.THOUSANDS]=1/1E3;function CDispUnits(){this.builtInUnit=null;this.custUnit=null;this.dispUnitsLbl=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CDispUnits.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CDispUnits;c.setBuiltInUnit(this.builtInUnit);c.setCustUnit(this.custUnit);if(this.dispUnitsLbl)c.setDispUnitsLbl(this.dispUnitsLbl.createDuplicate());return c}, setParent:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DispUnitsSetParent,this.parent,pr));this.parent=pr},getMultiplier:function(){if(AscFormat.isRealNumber(this.builtInUnit)){if(AscFormat.isRealNumber(UNIT_MULTIPLIERS[this.builtInUnit]))return UNIT_MULTIPLIERS[this.builtInUnit]}else if(AscFormat.isRealNumber(this.custUnit)&&this.custUnit>0)return 1/this.custUnit;return 1},getObjectType:function(){return AscDFH.historyitem_type_DispUnits},setBuiltInUnit:function(pr){History.Add(new CChangesDrawingsDouble(this, AscDFH.historyitem_DispUnitsSetBuiltInUnit,this.builtInUnit,pr));this.builtInUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()},setCustUnit:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DispUnitsSetCustUnit,this.custUnit,pr));this.custUnit=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&& this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()},setDispUnitsLbl:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_DispUnitsSetDispUnitsLbl,this.dispUnitsLbl,pr));this.dispUnitsLbl=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()}, Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()}};function CDoughnutChart(){CChartBase.call(this);this.firstSliceAng=null;this.holeSize=null;this.varyColors=null}CDoughnutChart.prototype=Object.create(CChartBase.prototype);CDoughnutChart.prototype.constructor=CDoughnutChart;CDoughnutChart.prototype.Refresh_RecalcData=function(data){if(!isRealObject(data))return;switch(data.Type){case AscDFH.historyitem_CommonChartFormat_SetParent:{break}case AscDFH.historyitem_DoughnutChart_SetDLbls:{if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateDataLabels();break}case AscDFH.historyitem_DoughnutChart_SetFirstSliceAng:{break}case AscDFH.historyitem_DoughnutChart_SetHoleSize:{break}case AscDFH.historyitem_DoughnutChart_AddSer:case AscDFH.historyitem_CommonChart_AddSeries:case AscDFH.historyitem_CommonChart_AddFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveSeries:{if(this.parent&&this.parent.parent&& this.parent.parent.parent)this.parent.parent.parent.handleUpdateType();break}case AscDFH.historyitem_DoughnutChart_SetVaryColor:{break}}};CDoughnutChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.ctr};CDoughnutChart.prototype.getSeriesConstructor=function(){return new CPieSeries};CDoughnutChart.prototype.createDuplicate=function(){var c=new CDoughnutChart;if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());c.setFirstSliceAng(this.firstSliceAng);c.setHoleSize(this.holeSize); for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());c.setVaryColors(this.varyColors);return c};CDoughnutChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_DoughnutChart};CDoughnutChart.prototype.setFromOtherChart=function(c){if(c.dLbls)this.setDLbls(c.dLbls);if(AscFormat.isRealNumber(c.firstSliceAng))this.setFirstSliceAng(c.firstSliceAng);if(AscFormat.isRealNumber(c.holeSize))this.setHoleSize(c.holeSize);if(Array.isArray(c.series)){var i;for(i=0;i< c.series.length;++i){var ser=new CPieSeries;ser.setFromOtherSeries(c.series[i]);this.addSer(ser)}}if(AscFormat.isRealBool(c.varyColors))this.setVaryColors(c.varyColors)};CDoughnutChart.prototype.setFirstSliceAng=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DoughnutChart_SetFirstSliceAng,this.firstSliceAng,pr));this.firstSliceAng=pr};CDoughnutChart.prototype.setHoleSize=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_DoughnutChart_SetHoleSize, this.holeSize,pr));this.holeSize=pr};function CErrBars(){this.errBarType=null;this.errDir=null;this.errValType=null;this.minus=null;this.noEndCap=null;this.plus=null;this.spPr=null;this.val=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CErrBars.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CErrBars;c.setErrBarType(this.errBarType);c.setErrDir(this.errDir);c.setErrValType(this.errValType);if(this.minus)c.setMinus(this.minus.createDuplicate()); c.setNoEndCap(this.noEndCap);if(this.plus)c.setPlus(this.plus.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());c.setVal(this.val);return c},getObjectType:function(){return AscDFH.historyitem_type_ErrBars},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setErrBarType:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ErrBars_SetErrBarType,this.errBarType,pr)); this.errBarType=pr},setErrDir:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ErrBars_SetErrDir,this.errDir,pr));this.errDir=pr},setErrValType:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ErrBars_SetErrValType,this.errDir,pr));this.errValType=pr},setMinus:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ErrBars_SetMinus,this.minus,pr));this.minus=pr},setNoEndCap:function(pr){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_ErrBars_SetNoEndCap,this.noEndCap,pr));this.noEndCap=pr},setPlus:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ErrBars_SetPlus,this.plus,pr));this.plus=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ErrBars_SetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)},setVal:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_ErrBars_SetVal,this.val,pr));this.val=pr}};function CLayout(){this.h= null;this.hMode=null;this.layoutTarget=null;this.w=null;this.wMode=null;this.x=null;this.xMode=null;this.y=null;this.yMode=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CLayout.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(Data){if(this.parent&&this.parent.Refresh_RecalcData2)this.parent.Refresh_RecalcData2()},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id= r.GetString2()},createDuplicate:function(){var c=new CLayout;c.setH(this.h);c.setHMode(this.hMode);c.setLayoutTarget(this.layoutTarget);c.setW(this.w);c.setWMode(this.wMode);c.setX(this.x);c.setXMode(this.xMode);c.setY(this.y);c.setYMode(this.yMode);return c},getObjectType:function(){return AscDFH.historyitem_type_Layout},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Layout_SetParent,this.parent,pr));this.parent=pr},setH:function(pr){History.Add(new CChangesDrawingsDouble(this, AscDFH.historyitem_Layout_SetH,this.h,pr));this.h=pr},setHMode:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Layout_SetHMode,this.hMode,pr));this.hMode=pr},setLayoutTarget:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Layout_SetLayoutTarget,this.layoutTarget,pr));this.layoutTarget=pr},setW:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Layout_SetW,this.w,pr));this.w=pr},setWMode:function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_Layout_SetWMode,this.wMode,pr));this.wMode=pr},setX:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Layout_SetX,this.x,pr));this.x=pr},setXMode:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Layout_SetXMode,this.xMode,pr));this.xMode=pr},setY:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Layout_SetY,this.y,pr));this.y=pr},setYMode:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Layout_SetYMode, this.yMode,pr));this.yMode=pr}};function CLegend(){this.layout=null;this.legendEntryes=[];this.legendPos=null;this.overlay=false;this.spPr=null;this.txPr=null;this.rot=0;this.flipH=false;this.flipV=false;this.x=null;this.y=null;this.extX=null;this.extY=null;this.calcEntryes=[];this.parent=null;this.transform=new CMatrix;this.invertTransform=new CMatrix;this.localTransform=new CMatrix;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CLegend.prototype={Get_Id:function(){return this.Id}, Refresh_RecalcData:function(){this.Refresh_RecalcData2()},convertPixToMM:function(pix){return this.parent&&this.parent.parent&&this.parent.parent.convertPixToMM&&this.parent.parent.convertPixToMM(pix)},findCalcEntryByIdx:function(idx){for(var i=0;i<this.calcEntryes.length;++i)if(this.calcEntryes[i]&&this.calcEntryes[i].idx===idx)return this.calcEntryes[i];return null},createDuplicate:function(){var c=new CLegend;if(this.layout)c.setLayout(this.layout.createDuplicate());for(var i=0;i<this.legendEntryes.length;++i)c.addLegendEntry(this.legendEntryes[i].createDuplicate()); c.setLegendPos(this.legendPos);c.setOverlay(this.overlay);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},getCalcEntryByIdx:function(idx,drawingDocument){for(var i=0;i<this.calcEntryes.length;++i)if(this.calcEntryes[i]&&this.calcEntryes[i].idx==idx)return this.calcEntryes[i];return AscFormat.ExecuteNoHistory(function(){var calcEntry=new AscFormat.CalcLegendEntry(this,this.chart,idx);calcEntry.txBody=AscFormat.CreateTextBodyFromString(""+ idx,drawingDocument,calcEntry);calcEntry.txBody.getRectWidth(2E3);return calcEntry},this,[])},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},updateLegendPos:function(){if(this.overlay)if(c_oAscChartLegendShowSettings.left===this.legendPos)this.legendPos=c_oAscChartLegendShowSettings.leftOverlay;else if(c_oAscChartLegendShowSettings.right===this.legendPos)this.legendPos=c_oAscChartLegendShowSettings.rightOverlay}, recalculatePen:CShape.prototype.recalculatePen,recalculateBrush:CShape.prototype.recalculateBrush,getCompiledStyle:function(){return null},getParentObjects:function(){if(this.chart)return this.chart.getParentObjects();else return{}},getCompiledLine:CShape.prototype.getCompiledLine,getCompiledFill:CShape.prototype.getCompiledFill,getCompiledTransparent:CShape.prototype.getCompiledTransparent,check_bounds:CShape.prototype.check_bounds,getCardDirectionByNum:CShape.prototype.getCardDirectionByNum,getNumByCardDirection:CShape.prototype.getNumByCardDirection, getResizeCoefficients:CShape.prototype.getResizeCoefficients,getInvertTransform:CShape.prototype.getInvertTransform,getTransformMatrix:CShape.prototype.getTransformMatrix,hitToHandles:CShape.prototype.hitToHandles,getFullFlipH:CShape.prototype.getFullFlipH,getFullFlipV:CShape.prototype.getFullFlipV,getAspect:CShape.prototype.getAspect,getGeom:CShape.prototype.getGeom,hitInBoundingRect:CShape.prototype.hitInBoundingRect,hitInInnerArea:CShape.prototype.hitInInnerArea,hitInPath:CShape.prototype.hitInPath, checkHitToBounds:function(x,y){CDLbl.prototype.checkHitToBounds.call(this,x,y)},getCanvasContext:function(){return CDLbl.prototype.getCanvasContext.call(this)},canRotate:function(){return false},getNoChangeAspect:function(){return false},isChart:function(){return false},canMove:function(){return true},selectObject:function(){},getHierarchy:function(){return this.chart?this.chart.getHierarchy():[]},isEmptyPlaceholder:function(){return false},isPlaceholder:function(){return false},draw:function(g){g.bDrawSmart= true;CShape.prototype.draw.call(this,g);for(var i=0;i<this.calcEntryes.length;++i)this.calcEntryes[i].draw(g);g.bDrawSmart=false},hit:function(x,y){var t_x=this.invertTransform.TransformPointX(x,y);var t_y=this.invertTransform.TransformPointY(x,y);return t_x>=0&&t_y>=0&&t_x<=this.extX&&t_y<=this.extY},setPosition:function(x,y){this.x=x;this.y=y;this.localTransform.Reset();global_MatrixTransformer.TranslateAppend(this.localTransform,this.x,this.y);this.transform=this.localTransform.CreateDublicate(); this.invertTransform=global_MatrixTransformer.Invert(this.transform);var entry;for(var i=0;i<this.calcEntryes.length;++i){entry=this.calcEntryes[i];entry.localTransformText.Reset();global_MatrixTransformer.TranslateAppend(entry.localTransformText,entry.localX,entry.localY);global_MatrixTransformer.MultiplyAppend(entry.localTransformText,this.localTransform);entry.transformText=entry.localTransformText.CreateDublicate();entry.invertTransformText=global_MatrixTransformer.Invert(entry.transformText); if(entry.calcMarkerUnion.marker){entry.calcMarkerUnion.marker.localTransform.Reset();global_MatrixTransformer.TranslateAppend(entry.calcMarkerUnion.marker.localTransform,entry.calcMarkerUnion.marker.localX,entry.calcMarkerUnion.marker.localY);global_MatrixTransformer.MultiplyAppend(entry.calcMarkerUnion.marker.localTransform,this.localTransform);entry.calcMarkerUnion.marker.transform=entry.calcMarkerUnion.marker.localTransform.CreateDublicate();entry.calcMarkerUnion.marker.invertTransform=global_MatrixTransformer.Invert(entry.calcMarkerUnion.marker.transform)}if(entry.calcMarkerUnion.lineMarker){entry.calcMarkerUnion.lineMarker.localTransform.Reset(); global_MatrixTransformer.TranslateAppend(entry.calcMarkerUnion.lineMarker.localTransform,entry.calcMarkerUnion.lineMarker.localX,entry.calcMarkerUnion.lineMarker.localY);global_MatrixTransformer.MultiplyAppend(entry.calcMarkerUnion.lineMarker.localTransform,this.localTransform);entry.calcMarkerUnion.lineMarker.transform=entry.calcMarkerUnion.lineMarker.localTransform.CreateDublicate();entry.calcMarkerUnion.lineMarker.invertTransform=global_MatrixTransformer.Invert(entry.calcMarkerUnion.lineMarker.transform)}}}, updatePosition:function(x,y){this.posX=x;this.posY=y;this.transform=this.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transform,x,y);this.invertTransform=global_MatrixTransformer.Invert(this.transform);var entry;for(var i=0;i<this.calcEntryes.length;++i){entry=this.calcEntryes[i];entry.transformText=entry.localTransformText.CreateDublicate();global_MatrixTransformer.TranslateAppend(entry.transformText,x,y);entry.invertTransformText=global_MatrixTransformer.Invert(entry.transformText); if(entry.calcMarkerUnion.marker){entry.calcMarkerUnion.marker.transform=entry.calcMarkerUnion.marker.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(entry.calcMarkerUnion.marker.transform,x,y);entry.calcMarkerUnion.marker.invertTransform=global_MatrixTransformer.Invert(entry.calcMarkerUnion.marker.transform)}if(entry.calcMarkerUnion.lineMarker){entry.calcMarkerUnion.lineMarker.transform=entry.calcMarkerUnion.lineMarker.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(entry.calcMarkerUnion.lineMarker.transform, x,y);entry.calcMarkerUnion.lineMarker.invertTransform=global_MatrixTransformer.Invert(entry.calcMarkerUnion.lineMarker.transform)}}},checkShapeChildTransform:function(t){this.transform=this.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transform,this.posX,this.posY);global_MatrixTransformer.MultiplyAppend(this.transform,t);this.invertTransform=global_MatrixTransformer.Invert(this.transform);var entry;for(var i=0;i<this.calcEntryes.length;++i){entry=this.calcEntryes[i]; entry.transformText=entry.localTransformText.CreateDublicate();global_MatrixTransformer.TranslateAppend(entry.transformText,this.posX,this.posY);global_MatrixTransformer.MultiplyAppend(entry.transformText,t);entry.invertTransformText=global_MatrixTransformer.Invert(entry.transformText);if(entry.calcMarkerUnion.marker){entry.calcMarkerUnion.marker.transform=entry.calcMarkerUnion.marker.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(entry.calcMarkerUnion.marker.transform, this.posX,this.posY);global_MatrixTransformer.MultiplyAppend(entry.calcMarkerUnion.marker.transform,t);entry.calcMarkerUnion.marker.invertTransform=global_MatrixTransformer.Invert(entry.calcMarkerUnion.marker.transform)}if(entry.calcMarkerUnion.lineMarker){entry.calcMarkerUnion.lineMarker.transform=entry.calcMarkerUnion.lineMarker.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(entry.calcMarkerUnion.lineMarker.transform,this.posX,this.posY);global_MatrixTransformer.MultiplyAppend(entry.calcMarkerUnion.lineMarker.transform, t);entry.calcMarkerUnion.lineMarker.invertTransform=global_MatrixTransformer.Invert(entry.calcMarkerUnion.lineMarker.transform)}}},getObjectType:function(){return AscDFH.historyitem_type_Legend},setLayout:function(layout){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Legend_SetLayout,this.layout,layout));this.layout=layout;if(this.layout)this.layout.setParent(this)},addLegendEntry:function(legendEntry){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_Legend_AddLegendEntry, this.legendEntryes.length,[legendEntry],true));this.legendEntryes.push(legendEntry);legendEntry.parent=this},setLegendPos:function(legendPos){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Legend_SetLegendPos,this.legendPos,legendPos));this.legendPos=legendPos;if(this.parent&&this.parent.parent)this.parent.parent.handleUpdateInternalChart()},setOverlay:function(overlay){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Legend_SetOverlay,this.overlay,overlay));this.overlay= overlay;if(this.parent&&this.parent.parent)this.parent.parent.handleUpdateInternalChart()},setSpPr:function(spPr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Legend_SetSpPr,this.spPr,spPr));this.spPr=spPr;if(this.spPr)this.spPr.setParent(this)},setTxPr:function(txPr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Legend_SetTxPr,this.txPr,txPr));this.txPr=txPr;if(txPr)txPr.setParent(this)},Refresh_RecalcData2:function(){if(this.parent&&this.parent.parent)this.parent.parent.handleUpdateInternalChart()}, findLegendEntryByIndex:function(idx){for(var i=0;i<this.legendEntryes.length;++i)if(this.legendEntryes[i].idx===idx)return this.legendEntryes[i];return null},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr}};function CLegendEntry(){this.bDelete=null;this.idx=null;this.txPr=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CLegendEntry.prototype={getObjectType:function(){return AscDFH.historyitem_type_LegendEntry}, createDuplicate:function(){var c=new CLegendEntry;c.setDelete(this.bDelete);c.setIdx(this.idx);if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},Get_Id:function(){return this.Id},Refresh_RecalcData:function(){this.Refresh_RecalcData2()},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},setDelete:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_LegendEntry_SetDelete,this.bDelete, pr));this.bDelete=pr;this.Refresh_RecalcData2()},setIdx:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_LegendEntry_SetIdx,this.idx,pr));this.idx=pr},Refresh_RecalcData2:function(){if(this.parent&&this.parent.Refresh_RecalcData2)this.parent.Refresh_RecalcData2()},setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LegendEntry_SetTxPr,this.txPr,pr));this.txPr=pr;if(this.txPr)this.txPr.setParent(this)}};function CLineChart(){CChartBase.call(this); this.dropLines=null;this.grouping=null;this.hiLowLines=null;this.marker=null;this.smooth=null;this.upDownBars=null}CLineChart.prototype=Object.create(CChartBase.prototype);CLineChart.prototype.constructor=CLineChart;CLineChart.prototype.Refresh_RecalcData=function(data){if(!isRealObject(data))return;switch(data.Type){case AscDFH.historyitem_CommonChartFormat_SetParent:{break}case AscDFH.historyitem_LineChart_AddAxId:case AscDFH.historyitem_CommonChart_AddAxId:{break}case AscDFH.historyitem_LineChart_SetDLbls:case AscDFH.historyitem_CommonChart_SetDlbls:{if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateDataLabels();break}case AscDFH.historyitem_LineChart_SetDropLines:{break}case AscDFH.historyitem_LineChart_SetGrouping:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart();break}case AscDFH.historyitem_LineChart_SetHiLowLines:{break}case AscDFH.historyitem_LineChart_SetMarker:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType(); break}case AscDFH.historyitem_LineChart_AddSer:case AscDFH.historyitem_CommonChart_AddSeries:case AscDFH.historyitem_CommonChart_AddFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveSeries:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType();break}case AscDFH.historyitem_LineChart_SetSmooth:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType(); break}case AscDFH.historyitem_LineChart_SetUpDownBars:{break}case AscDFH.historyitem_LineChart_SetVaryColors:case AscDFH.historyitem_CommonChart_SetVaryColors:{break}}};CLineChart.prototype.getSeriesConstructor=function(){return new CLineSeries};CLineChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.r};CLineChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_LineChart};CLineChart.prototype.createDuplicate=function(){var c=new CLineChart;if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate()); if(this.dropLines)c.setDropLines(this.dropLines.createDuplicate());c.setGrouping(this.grouping);if(this.hiLowLines)c.setHiLowLines(this.hiLowLines.createDuplicate());c.setMarker(this.marker);for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());c.setSmooth(this.smooth);if(this.upDownBars)c.setUpDownBars(this.upDownBars.createDuplicate());c.setVaryColors(this.varyColors);return c};CLineChart.prototype.getAllRasterImages=function(images){CChartBase.prototype.getAllRasterImages.call(this, images);if(this.upDownBars){this.upDownBars.upBars&&this.upDownBars.upBars.checkBlipFillRasterImage(images);this.upDownBars.downBars&&this.upDownBars.downBars.checkBlipFillRasterImage(images)}};CLineChart.prototype.checkSpPrRasterImages=function(images){CChartBase.prototype.checkSpPrRasterImages.call(this,images);if(this.upDownBars){checkSpPrRasterImages(this.upDownBars.upBars);checkSpPrRasterImages(this.upDownBars.downBars)}};CLineChart.prototype.setFromOtherChart=function(c){var i;if(c.dLbls)this.setDLbls(c.dLbls); if(c.dropLines)this.setDropLines(c.dropLines);if(AscFormat.isRealNumber(c.grouping))this.setGrouping(c.grouping);if(c.hiLowLines)this.setHiLowLines(c.hiLowLines);if(c.marker)this.setMarker(c.marker);if(Array.isArray(c.series))for(i=0;i<c.series.length;++i){var ser=new CLineSeries;ser.setFromOtherSeries(c.series[i]);this.addSer(ser)}if(AscFormat.isRealBool(c.smooth))this.setSmooth(c.smooth);if(AscFormat.isRealBool(c.varyColors))this.setVaryColors(c.varyColors)};CLineChart.prototype.setDropLines=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_LineChart_SetDropLines,this.dropLines,pr));this.dropLines=pr};CLineChart.prototype.setGrouping=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_LineChart_SetGrouping,this.grouping,pr));this.grouping=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateInternalChart()};CLineChart.prototype.setHiLowLines=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LineChart_SetHiLowLines,this.hiLowLines, pr));this.hiLowLines=pr};CLineChart.prototype.setMarker=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_LineChart_SetMarker,this.marker,pr));this.marker=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType()};CLineChart.prototype.setSmooth=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_LineChart_SetSmooth,this.smooth,pr));this.smooth=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType()}; CLineChart.prototype.setUpDownBars=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LineChart_SetUpDownBars,this.upDownBars,pr));this.upDownBars=pr;if(pr&&pr.setParent)pr.setParent(this)};function CLineSeries(){CSeriesBase.call(this);this.cat=null;this.dLbls=null;this.dPt=[];this.errBars=null;this.marker=null;this.smooth=null;this.trendline=null;this.val=null}CLineSeries.prototype=Object.create(CSeriesBase.prototype);CLineSeries.prototype.constructor=CLineSeries;CLineSeries.prototype.removeDPt= function(idx){if(this.dPt[idx]){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonSeries_RemoveDPt,idx,this.dPt.splice(idx,1),false));this.dPt.splice(idx,1)}};CLineSeries.prototype.createDuplicate=function(){var c=new CLineSeries;if(this.cat)c.setCat(this.cat.createDuplicate());if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());for(var i=0;i<this.dPt.length;++i)c.addDPt(this.dPt[i].createDuplicate());if(this.errBars)c.setErrBars(this.errBars.createDuplicate());c.setIdx(this.idx); if(this.marker)c.setMarker(this.marker.createDuplicate());c.setOrder(this.order);c.setSmooth(this.smooth);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.trendline)c.setTrendline(this.trendline.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate());if(this.val)c.setVal(this.val.createDuplicate());return c};CLineSeries.prototype.getObjectType=function(){return AscDFH.historyitem_type_LineSeries};CLineSeries.prototype.setFromOtherSeries=function(other){if(other.cat)this.setCat(other.cat); if(other.dLbls)this.setDLbls(other.dLbls);if(other.dPt)copyDPt(this,other.dPt);if(other.errBars)this.setErrBars(other.errBars);if(AscFormat.isRealNumber(other.idx))this.setIdx(other.idx);if(other.marker)this.setMarker(other.marker);if(AscFormat.isRealNumber(other.order))this.setOrder(other.order);if(AscFormat.isRealBool(other.smooth))this.setSmooth(other.smooth);if(other.spPr){this.setSpPr(other.spPr);if(this.spPr&&this.spPr.Fill&&this.spPr.Fill.fill&&this.spPr.Fill.fill.type===window["Asc"].c_oAscFill.FILL_TYPE_NOFILL)this.spPr.setFill(null); if(this.spPr&&this.spPr.ln&&this.spPr.ln&&this.spPr.ln.Fill&&this.spPr.ln.Fill.fill&&this.spPr.ln.Fill.fill.type===window["Asc"].c_oAscFill.FILL_TYPE_NOFILL)this.spPr.setLn(null)}if(other.trendline)this.setTrendline(other.trendline);if(other.tx)this.setTx(other.tx);if(other.val)this.setVal(other.val);if(other.xVal){this.setCat(new CCat);this.cat.setFromOtherObject(other.xVal)}if(other.yVal){this.setVal(new CYVal);this.val.setFromOtherObject(other.yVal)}};CLineSeries.prototype.recalculateBrush=function(){}; CLineSeries.prototype.setCat=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LineSeries_SetCat,this.cat,pr));this.cat=pr};CLineSeries.prototype.setDLbls=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LineSeries_SetDLbls,this.dLbls,pr));this.dLbls=pr;if(this.dLbls)this.dLbls.setParent(this)};CLineSeries.prototype.addDPt=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_LineSeries_SetDPt,this.dPt.length,[pr],true)); this.dPt.push(pr)};CLineSeries.prototype.setErrBars=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LineSeries_SetErrBars,this.errBars,pr));this.errBars=pr};CLineSeries.prototype.setMarker=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LineSeries_SetMarker,this.marker,pr));this.marker=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()}; CLineSeries.prototype.setSmooth=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_LineSeries_SetSmooth,this.smooth,pr));this.smooth=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()};CLineSeries.prototype.setTrendline=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LineSeries_SetTrendline, this.trendline,pr));this.trendline=pr};CLineSeries.prototype.setVal=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_LineSeries_SetVal,this.val,pr));this.val=pr;if(this.val&&this.val.setParent)this.val.setParent(this)};var SYMBOL_CIRCLE=0;var SYMBOL_DASH=1;var SYMBOL_DIAMOND=2;var SYMBOL_DOT=3;var SYMBOL_NONE=4;var SYMBOL_PICTURE=5;var SYMBOL_PLUS=6;var SYMBOL_SQUARE=7;var SYMBOL_STAR=8;var SYMBOL_TRIANGLE=9;var SYMBOL_X=10;var MARKER_SYMBOL_TYPE=[];MARKER_SYMBOL_TYPE[0]= SYMBOL_DIAMOND;MARKER_SYMBOL_TYPE[1]=SYMBOL_SQUARE;MARKER_SYMBOL_TYPE[2]=SYMBOL_TRIANGLE;MARKER_SYMBOL_TYPE[3]=SYMBOL_X;MARKER_SYMBOL_TYPE[4]=SYMBOL_STAR;MARKER_SYMBOL_TYPE[5]=SYMBOL_CIRCLE;MARKER_SYMBOL_TYPE[6]=SYMBOL_PLUS;MARKER_SYMBOL_TYPE[7]=SYMBOL_DOT;MARKER_SYMBOL_TYPE[8]=SYMBOL_DASH;function CMarker(){this.size=null;this.spPr=null;this.symbol=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CMarker.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){}, getObjectType:function(){return AscDFH.historyitem_type_Marker},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},merge:function(otherMarker){if(isRealObject(otherMarker)){if(AscFormat.isRealNumber(otherMarker.size))this.setSize(otherMarker.size);if(AscFormat.isRealNumber(otherMarker.symbol))this.setSymbol(otherMarker.symbol);if(otherMarker.spPr&&(otherMarker.spPr.Fill||otherMarker.spPr.ln)){if(!this.spPr)this.setSpPr(new AscFormat.CSpPr); if(otherMarker.spPr.Fill)this.spPr.setFill(otherMarker.spPr.Fill.createDuplicate());if(otherMarker.spPr.ln){if(!this.spPr.ln)this.spPr.setLn(new AscFormat.CLn);this.spPr.ln.merge(otherMarker.spPr.ln)}}}return this},createDuplicate:function(){return(new CMarker).merge(this)},setSize:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Marker_SetSize,this.size,pr));this.size=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Marker_SetSpPr,this.spPr, pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)},setSymbol:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Marker_SetSymbol,this.symbol,pr));this.symbol=pr}};function CMinusPlus(){this.numLit=null;this.numRef=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CMinusPlus.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CMinusPlus;if(this.numRef)c.setNumRef(this.numRef.createDuplicate()); if(this.numLit)c.setNumLit(this.numLit.createDuplicate());return c},getObjectType:function(){return AscDFH.historyitem_type_MinusPlus},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setNumLit:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_MinusPlus_SetnNumLit,this.numLit,pr));this.numLit=pr},setNumRef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_MinusPlus_SetnNumRef, this.numRef,pr));this.numRef=pr}};function CMultiLvlStrCache(){this.lvl=[];this.ptCount=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CMultiLvlStrCache.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CMultiLvlStrCache;for(var i=0;i<this.lvl.length;++i)c.addLvl(this.lvl[i].createDuplicate());c.setPtCount(this.ptCount);return c},getObjectType:function(){return AscDFH.historyitem_type_MultiLvlStrCache},addLvl:function(pr){History.Add(new CChangesDrawingsContent(this, AscDFH.historyitem_MultiLvlStrCache_SetLvl,this.lvl.length,[pr],true));this.lvl.push(pr)},setPtCount:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_MultiLvlStrCache_SetPtCount,this.ptCount,pr));this.ptCount=pr},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},update:function(sFormula,oSeries){if(!(typeof sFormula==="string"&&sFormula.length>0))return;var nPtCount=0;var aParsedRef= AscFormat.fParseChartFormula(sFormula);if(aParsedRef.length>0){var nRows=0,nRef,oRef,oBBox,nPtIdx,nCol,oWS,oCell,sVal,nCols=0,nRow;var nLvl,oLvl;var bLvlsByRows=true;if(oSeries){var sSeriesFormula=oSeries.getValRefFormula();if(sSeriesFormula){if(sSeriesFormula.charAt(0)==="=")sSeriesFormula=sSeriesFormula.slice(1);var aParsedSeriesRef=AscFormat.fParseChartFormula(sSeriesFormula);if(aParsedSeriesRef.length===aParsedRef.length){var oSeriesRef;for(nRef=0;nRef<aParsedRef.length;++nRef){oRef=aParsedRef[nRef]; oSeriesRef=aParsedSeriesRef[nRef];if(oSeriesRef.bbox.r1!==oRef.bbox.r1||oSeriesRef.bbox.r2!==oRef.bbox.r2)break}if(nRef===aParsedRef.length)bLvlsByRows=false}}}if(bLvlsByRows){for(nRef=0;nRef<aParsedRef.length;++nRef){oRef=aParsedRef[nRef];oBBox=oRef.bbox;nPtCount+=oBBox.c2-oBBox.c1+1;nRows=Math.max(nRows,oBBox.r2-oBBox.r1+1)}for(nLvl=0;nLvl<nRows;++nLvl){oLvl=new CStrCache;nPtIdx=0;for(nRef=0;nRef<aParsedRef.length;++nRef){oRef=aParsedRef[nRef];oBBox=oRef.bbox;oWS=oRef.worksheet;if(nLvl<oBBox.r2- oBBox.r1+1)for(nCol=oBBox.c1;nCol<=oBBox.c2;++nCol){oCell=oWS.getCell3(nLvl+oBBox.r1,nCol);sVal=oCell.getValueWithFormat();if(typeof sVal==="string"&&sVal.length>0)oLvl.addStringPoint(nPtIdx,sVal);++nPtIdx}else nPtIdx+=oBBox.c2-oBBox.c1+1}nPtCount=Math.max(nPtCount,nPtIdx);oLvl.setPtCount(nPtIdx);this.addLvl(oLvl)}}else{for(nRef=0;nRef<aParsedRef.length;++nRef){oRef=aParsedRef[nRef];oBBox=oRef.bbox;nPtCount+=oBBox.r2-oBBox.r1+1;nCols=Math.max(nCols,oBBox.c2-oBBox.c1+1)}for(nLvl=0;nLvl<nCols;++nLvl){oLvl= new CStrCache;nPtIdx=0;for(nRef=0;nRef<aParsedRef.length;++nRef){oRef=aParsedRef[nRef];oBBox=oRef.bbox;oWS=oRef.worksheet;if(nLvl<oBBox.c2-oBBox.c1+1)for(nRow=oBBox.r1;nRow<=oBBox.r2;++nRow){oCell=oWS.getCell3(nRow,nLvl+oBBox.c1);sVal=oCell.getValueWithFormat();if(typeof sVal==="string"&&sVal.length>0)oLvl.addStringPoint(nPtIdx,sVal);++nPtIdx}else nPtIdx+=oBBox.r2-oBBox.r1+1}nPtCount=Math.max(nPtCount,nPtIdx);oLvl.setPtCount(nPtIdx);this.addLvl(oLvl)}}}this.setPtCount(nPtCount)},getValues:function(nMaxValues){var ret= [];var nEnd=nMaxValues||this.ptCount;for(var nIndex=0;nIndex<nEnd;++nIndex){var sValue="";for(var nLvl=0;nLvl<this.lvl.length;++nLvl){var oLvl=this.lvl[nLvl];var oPt=oLvl.getPtByIndex(nIndex);if(oPt)sValue+=oPt.val+" "}ret.push(sValue)}return ret}};function CMultiLvlStrRef(){this.f=null;this.multiLvlStrCache=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CMultiLvlStrRef.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_MultiLvlStrRef}, Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},createDuplicate:function(){var c=new CMultiLvlStrRef;c.setF(this.f);if(this.multiLvlStrCache)c.setMultiLvlStrCache(this.multiLvlStrCache.createDuplicate());return c},setF:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_MultiLvlStrRef_SetF,this.f,pr));this.f=pr},setMultiLvlStrCache:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_MultiLvlStrRef_SetMultiLvlStrCache,this.multiLvlStrCache,pr));this.multiLvlStrCache=pr},updateCache:function(oSeries){this.setMultiLvlStrCache(new CMultiLvlStrCache);this.multiLvlStrCache.update(this.f,oSeries)},getValues:function(nMaxValues){if(!this.multiLvlStrCache)this.updateCache();return this.multiLvlStrCache.getValues(nMaxValues)},getFormula:function(){return"="+this.f},getParsedRefs:function(){return AscFormat.fParseChartFormula(this.f)},getFirstLvlCache:function(){var oCache= this.multiLvlStrCache;if(oCache&&oCache.lvl[0])return oCache.lvl[0];return null}};function CNumRef(){this.f=null;this.numCache=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CNumRef.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(data){if(data&&data.Type===AscDFH.historyitem_NumRef_SetF&&this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.parent&&this.parent.parent.parent.parent.parent.parent&& this.parent.parent.parent.parent.parent.parent.handleUpdateInternalChart){this.parent.parent.parent.parent.parent.parent.handleUpdateInternalChart();this.parent.parent.parent.parent.parent.parent.recalcInfo.recalculateReferences=true;this.parent.parent.parent.parent.parent.parent.addToRecalculate()}},createDuplicate:function(){var c=new CNumRef;c.setF(this.f);if(this.numCache)c.setNumCache(this.numCache.createDuplicate());return c},getObjectType:function(){return AscDFH.historyitem_type_NumRef},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},setF:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_NumRef_SetF,this.f,pr));this.f=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.parent&&this.parent.parent.parent.parent.parent.parent&& this.parent.parent.parent.parent.parent.parent.handleUpdateInternalChart){if(this.parent.parent.parent.parent.parent.parent.bNoHandleRecalc===true)return;this.parent.parent.parent.parent.parent.parent.recalcInfo.recalculateReferences=true;this.parent.parent.parent.parent.parent.parent.handleUpdateInternalChart()}},setNumCache:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_NumRef_SetNumCache,this.numCache,pr));this.numCache=pr},updateCache:function(displayEmptyCellsAs, displayHidden,ser){if(!this.numCache){this.setNumCache(new CNumLit);this.numCache.setFormatCode("General");this.numCache.setPtCount(0)}else this.numCache.removeAllPts();if(ser)ser.isHidden=true;this.numCache.update(this.f,displayEmptyCellsAs,displayHidden,ser)},getValuesCount:function(){if(!this.numCache)this.updateCache();return this.numCache.ptCount},getValues:function(nMaxValues){if(!this.numCache)this.updateCache();return this.numCache.getValues(nMaxValues)},getFormula:function(){return"="+this.f}, getParsedRefs:function(){return AscFormat.fParseChartFormula(this.f)}};function CNumericPoint(){this.formatCode=null;this.idx=null;this.val=null;if(true===History.Is_On()){this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}}CNumericPoint.prototype={Get_Id:function(){return this.Id},createDuplicate:function(){var c=new CNumericPoint;c.setFormatCode(this.formatCode);c.setIdx(this.idx);c.setVal(this.val);return c},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_NumericPoint}, Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setFormatCode:function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_NumericPoint_SetFormatCode,this.formatCode,pr));this.formatCode=pr},setIdx:function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_NumericPoint_SetIdx, this.idx,pr));this.idx=pr},setVal:function(pr){var _pr=parseFloat(pr);if(isNaN(_pr))_pr=0;false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsDouble2(this,AscDFH.historyitem_NumericPoint_SetVal,this.val,_pr));this.val=_pr}};function CNumFmt(){this.formatCode=null;this.sourceLinked=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CNumFmt.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c= new CNumFmt;c.setFormatCode(this.formatCode);c.setSourceLinked(this.sourceLinked);return c},getObjectType:function(){return AscDFH.historyitem_type_NumFmt},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setFormatCode:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_NumFmt_SetFormatCode,this.formatCode,pr));this.formatCode=pr},setSourceLinked:function(pr){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_NumFmt_SetSourceLinked,this.sourceLinked,pr));this.sourceLinked=pr}};function CNumLit(){this.formatCode=null;this.pts=[];this.ptCount=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CNumLit.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},removeDPt:function(idx){if(this.pts[idx]){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonLit_RemoveDPt,idx,[this.pts[idx]], false));this.pts.splice(idx,1)}},createDuplicate:function(){var c=new CNumLit;c.setFormatCode(this.formatCode);for(var i=0;i<this.pts.length;++i)c.addPt(this.pts[i].createDuplicate());c.setPtCount(this.ptCount);return c},getPtByIndex:function(idx){if(this.pts[idx]&&this.pts[idx].idx===idx)return this.pts[idx];for(var i=0;i<this.pts.length;++i)if(this.pts[i].idx===idx)return this.pts[i];return null},getPtCount:function(){if(AscFormat.isRealNumber(this.ptCount))return this.ptCount;return this.pts.length}, getObjectType:function(){return AscDFH.historyitem_type_NumLit},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setFormatCode:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_NumLit_SetFormatCode,this.formatCode,pr));this.formatCode=pr},addPt:function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_NumLit_AddPt, this.pts.length,[pr],true));this.pts.push(pr)},setPtCount:function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_NumLit_SetPtCount,this.ptCount,pr));this.ptCount=pr},removeAllPts:function(){var start_idx=this.pts.length-1;for(var i=start_idx;i>-1;--i)this.removeDPt(i);this.setPtCount(0)},addNumericPoint:function(idx,dNumber){var oPt=new CNumericPoint;oPt.setIdx(idx);oPt.setVal(dNumber);this.addPt(oPt);this.setPtCount(Math.max(this.pts.length, idx+1))},update:function(sFormula,displayEmptyCellsAs,displayHidden,ser){AscFormat.ExecuteNoHistory(function(){this.removeAllPts();if(!(typeof sFormula==="string"&&sFormula.length>0)){this.setPtCount(0);return}var aParsedRef=AscFormat.fParseChartFormula(sFormula);var nRef,oRef,oMinRef,oWS,oBB,nPtIdx,nPtCount,nCount;var oHM,nHidden,nR,nC,oMinBB,oCell,aSpanPoints=[],oStartPoint;var dVal,sVal,oPt,sCellFC,nSpan,nLastNoEmptyIndex,nSpliceIndex;var sFC=typeof this.formatCode==="string"&&this.formatCode.length> 0?this.formatCode:"General";var bHaveTotalRow;nPtCount=0;nPtIdx=0;for(nRef=0;nRef<aParsedRef.length;++nRef){oRef=aParsedRef[nRef];oWS=oRef.worksheet;if(!oWS)continue;oHM=oWS.hiddenManager;oBB=oRef.bbox;if(!oBB)continue;if(displayHidden)nHidden=0;else nHidden=oHM.getHiddenRowsCount(oBB.r1,oBB.r2+1)*oBB.getWidth()+oHM.getHiddenColsCount(oBB.c1,oBB.c2+1)*oBB.getHeight();bHaveTotalRow=oWS.isTableTotalRow(new Asc.Range(oBB.c1,oBB.r2,oBB.c1,oBB.r2))&&oBB.r1!==oBB.r2;if(bHaveTotalRow)nHidden+=1;nCount=Math.max(0, oBB.getHeight()*oBB.getWidth()-nHidden);nPtCount+=nCount;oMinRef=oRef.getMinimalCellsRange();if(!oMinRef)continue;oMinBB=oMinRef.bbox;nPtIdx+=(oMinBB.r1-oBB.r1)*oBB.getWidth()+(oMinBB.c1-oBB.c1)*oMinBB.getHeight();for(nR=oMinBB.r1;nR<=oMinBB.r2;++nR){if(!displayHidden&&oWS.getRowHidden(nR))continue;if(nR===oBB.r2&&bHaveTotalRow)continue;for(nC=oMinBB.c1;nC<=oMinBB.c2;++nC){if(!displayHidden&&oWS.getColHidden(nC))continue;if(ser)ser.isHidden=false;oCell=oWS.getCell3(nR,nC);dVal=oCell.getNumberValue(); if(!AscFormat.isRealNumber(dVal)&&(!AscFormat.isRealNumber(displayEmptyCellsAs)||displayEmptyCellsAs===1)){sVal=oCell.getValueForEdit();if(typeof sVal==="string"&&sVal.length>0)dVal=0}if(AscFormat.isRealNumber(dVal)){oPt=new AscFormat.CNumericPoint;oPt.setIdx(nPtIdx);oPt.setVal(dVal);sCellFC=oCell.getNumFormatStr();if(sCellFC!==sFC)oPt.setFormatCode(sCellFC);this.addPt(oPt);if(aSpanPoints.length>0){if(AscFormat.isRealNumber(nLastNoEmptyIndex)){oStartPoint=this.getPtByIndex(nLastNoEmptyIndex);if(oStartPoint)for(nSpan= 0;nSpan<aSpanPoints.length;++nSpan){aSpanPoints[nSpan].setVal(oStartPoint.val+(oPt.val-oStartPoint.val)/(aSpanPoints.length+1)*(nSpan+1));this.pts.splice(nSpliceIndex+nSpan,0,aSpanPoints[nSpan])}}aSpanPoints.length=0}nLastNoEmptyIndex=oPt.idx;nSpliceIndex=this.pts.length}else if(AscFormat.isRealNumber(displayEmptyCellsAs)&&displayEmptyCellsAs!==1){sVal=oCell.getValue();if(displayEmptyCellsAs===2||typeof sVal==="string"&&sVal.length>0){oPt=new AscFormat.CNumericPoint;oPt.setIdx(nPtIdx);oPt.setVal(0); this.addPt(oPt);if(aSpanPoints.length>0){if(AscFormat.isRealNumber(nLastNoEmptyIndex)){oStartPoint=this.getPtByIndex(nLastNoEmptyIndex);if(oStartPoint)for(nSpan=0;nSpan<aSpanPoints.length;++nSpan){aSpanPoints[nSpan].setVal(oStartPoint.val+(oPt.val-oStartPoint.val)/(aSpanPoints.length+1)*(nSpan+1));this.pts.splice(nSpliceIndex+nSpan,0,aSpanPoints[nSpan])}}aSpanPoints.length=0}nLastNoEmptyIndex=oPt.idx;nSpliceIndex=this.pts.length}else if(displayEmptyCellsAs===0&&ser&&ser.getObjectType()===AscDFH.historyitem_type_LineSeries){oPt= new AscFormat.CNumericPoint;oPt.setIdx(nPtIdx);oPt.setVal(0);aSpanPoints.push(oPt)}}nPtIdx++}}}this.setPtCount(nPtCount)},this,[])},getValues:function(nMaxCount){var ret=[];var nEnd=nMaxCount||this.ptCount;for(var nIndex=0;nIndex<nEnd;++nIndex){var oPt=this.getPtByIndex(nIndex);if(oPt){var sFormatCode=oPt.formatCode||this.formatCode;if(sFormatCode){var oNumFmt=AscCommon.oNumFormatCache.get(sFormatCode);ret.push(oNumFmt.formatToChart(oPt.val))}else ret.push(oPt.val+"")}else ret.push("")}return ret}, getFormula:function(){var sRet="={";for(var nIndex=0;nIndex<this.pts.length;++nIndex){sRet+=this.pts[nIndex].val;if(nIndex<this.pts.length-1)sRet+=", "}sRet+="}";return sRet}};function COfPieChart(){CChartBase.call(this);this.custSplit=[];this.gapWidth=null;this.ofPieType=null;this.secondPieSize=null;this.serLines=null;this.splitPos=null;this.splitType=null}COfPieChart.prototype=Object.create(CChartBase.prototype);COfPieChart.prototype.constructor=COfPieChart;COfPieChart.prototype.Refresh_RecalcData= function(){};COfPieChart.prototype.getSeriesConstructor=function(){return new CPieSeries};COfPieChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.bestFit};COfPieChart.prototype.createDuplicate=function(){var c=new COfPieChart,i;for(i=0;i<this.custSplit.length;++i)c.addCustSplit(this.custSplit[i].createDuplicate());if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());c.setGapWidth(this.gapWidth);c.setOfPieType(this.ofPieType);c.setSecondPieSize(this.secondPieSize); for(i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());if(this.serLines)c.setSerLines(this.serLines.createDuplicate());c.setSplitPos(this.splitPos);c.setSplitType(this.splitType);c.setVaryColors(this.varyColors);return c};COfPieChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_OfPieChart};COfPieChart.prototype.getAllRasterImages=function(images){CChartBase.prototype.getAllRasterImages.call(this,images);if(this.serLines&&this.serLines.spPr)this.serLines.spPr.checkBlipFillRasterImage(images)}; COfPieChart.prototype.checkSpPrRasterImages=function(images){CChartBase.prototype.checkSpPrRasterImages.call(this,images);if(this.serLines&&this.serLines.spPr)checkSpPrRasterImages(this.serLines.spPr)};COfPieChart.prototype.addCustSplit=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_OfPieChart_AddCustSplit,this.custSplit.length,[pr],true));this.custSplit.push(pr)};COfPieChart.prototype.setGapWidth=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_OfPieChart_SetGapWidth, this.gapWidth,pr));this.gapWidth=pr};COfPieChart.prototype.setOfPieType=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_OfPieChart_SetOfPieType,this.ofPieType,pr));this.ofPieType=pr};COfPieChart.prototype.setSecondPieSize=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_OfPieChart_SetSecondPieSize,this.secondPieSize,pr));this.secondPieSize=pr};COfPieChart.prototype.setSerLines=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_OfPieChart_SetSerLines, this.serLines,pr));this.serLines=pr};COfPieChart.prototype.setSplitPos=function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_OfPieChart_SetSplitPos,this.splitPos,pr));this.splitPos=pr};COfPieChart.prototype.setSplitType=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_OfPieChart_SetSplitType,this.splitType,pr));this.splitType=pr};function CPictureOptions(){this.applyToEnd=null;this.applyToFront=null;this.applyToSides=null;this.pictureFormat=null;this.pictureStackUnit= null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CPictureOptions.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CPictureOptions;c.setApplyToEnd(this.applyToEnd);c.setApplyToFront(this.applyToFront);c.setApplyToSides(this.applyToSides);c.setPictureFormat(this.pictureFormat);c.setPictureStackUnit(this.pictureStackUnit);return c},getObjectType:function(){return AscDFH.historyitem_type_PictureOptions},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setApplyToEnd:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PictureOptions_SetApplyToEnd,this.applyToEnd,pr));this.applyToEnd=pr},setApplyToFront:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PictureOptions_SetApplyToFront,this.applyToFront,pr));this.applyToFront=pr},setApplyToSides:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PictureOptions_SetApplyToSides, this.applyToSides,pr));this.applyToSides=pr},setPictureFormat:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PictureOptions_SetPictureFormat,this.pictureFormat,pr));this.pictureFormat=pr},setPictureStackUnit:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_PictureOptions_SetPictureStackUnit,this.pictureStackUnit,pr));this.pictureStackUnit=pr}};function CPieChart(){CChartBase.call(this);this.firstSliceAng=null;this.varyColors=null;this.b3D=null} CPieChart.prototype=Object.create(CChartBase.prototype);CPieChart.prototype.constructor=CPieChart;CPieChart.prototype.set3D=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_PieChart_3D,this.b3D,pr));this.b3D=pr};CPieChart.prototype.Refresh_RecalcData=function(data){if(!isRealObject(data))return;switch(data.Type){case AscDFH.historyitem_CommonChartFormat_SetParent:{break}case AscDFH.historyitem_PieChart_SetDLbls:case AscDFH.historyitem_CommonChart_SetDlbls:{if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateDataLabels();break}case AscDFH.historyitem_PieChart_SetFirstSliceAng:{break}case AscDFH.historyitem_PieChart_AddSer:case AscDFH.historyitem_CommonChart_AddSeries:case AscDFH.historyitem_CommonChart_AddFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveSeries:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType(); break}case AscDFH.historyitem_PieChart_SetVaryColors:case AscDFH.historyitem_CommonChart_SetVaryColors:{break}}};CPieChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.bestFit};CPieChart.prototype.getSeriesConstructor=function(){return new CPieSeries};CPieChart.prototype.createDuplicate=function(){var c=new CPieChart;if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());c.setFirstSliceAng(this.firstSliceAng);for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate()); c.setVaryColors(this.varyColors);if(this.b3D)c.set3D(this.b3D);return c};CPieChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_PieChart};CPieChart.prototype.setFromOtherChart=function(c){var i;if(c.dLbls)this.setDLbls(c.dLbls);if(AscFormat.isRealNumber(c.firstSliceAng))this.setFirstSliceAng(c.firstSliceAng);if(Array.isArray(c.series))for(i=0;i<c.series.length;++i){var ser=new CPieSeries;ser.setFromOtherSeries(c.series[i]);this.addSer(ser)}if(AscFormat.isRealBool(c.varyColors))this.setVaryColors(c.varyColors)}; CPieChart.prototype.setFirstSliceAng=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PieChart_SetFirstSliceAng,this.firstSliceAng,pr));this.firstSliceAng=pr};function CPieSeries(){CSeriesBase.call(this);this.cat=null;this.dLbls=null;this.dPt=[];this.explosion=null;this.val=null}CPieSeries.prototype=Object.create(CSeriesBase.prototype);CPieSeries.prototype.constructor=CPieSeries;CPieSeries.prototype.getDptByIdx=function(idx){for(var i=0;i<this.dPt.length;++i)if(this.dPt[i].idx=== idx)return this.dPt[i];return null};CPieSeries.prototype.removeDPt=function(idx){if(this.dPt[idx]){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonSeries_RemoveDPt,idx,this.dPt.splice(idx,1),false));this.dPt.splice(idx,1)}};CPieSeries.prototype.createDuplicate=function(){var c=new CPieSeries;if(this.cat)c.setCat(this.cat.createDuplicate());if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());for(var i=0;i<this.dPt.length;++i)c.addDPt(this.dPt[i].createDuplicate());c.setExplosion(this.explosion); c.setIdx(this.idx);c.setOrder(this.order);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate());if(this.val)c.setVal(this.val.createDuplicate());return c};CPieSeries.prototype.getObjectType=function(){return AscDFH.historyitem_type_PieSeries};CPieSeries.prototype.setFromOtherSeries=function(o){if(o.cat)this.setCat(o.cat);if(o.dLbls)this.setDLbls(o.dLbls);if(o.dPt)for(var i=0;i<o.dPt.length;++i)this.addDPt(o.dPt[i]);if(o.explosion)this.setExplosion(o.explosion); if(AscFormat.isRealNumber(o.idx))this.setIdx(o.idx);if(AscFormat.isRealNumber(o.order))this.setOrder(o.order);if(o.spPr){this.setSpPr(o.spPr);if(!(o instanceof AscFormat.CPieSeries))this.spPr.setFill(null)}if(o.tx)this.setTx(o.tx);if(o.val)this.setVal(o.val);if(o.xVal){this.setCat(new CCat);this.cat.setFromOtherObject(o.xVal)}if(o.yVal){this.setVal(new CYVal);this.val.setFromOtherObject(o.yVal)}};CPieSeries.prototype.setCat=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PieSeries_SetCat, this.cat,pr));this.cat=pr};CPieSeries.prototype.setDLbls=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PieSeries_SetDLbls,this.dLbls,pr));this.dLbls=pr;if(this.dLbls)this.dLbls.setParent(this)};CPieSeries.prototype.addDPt=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_PieSeries_SetDPt,this.dPt.length,[pr],true));this.dPt.push(pr)};CPieSeries.prototype.setExplosion=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PieSeries_SetExplosion, this.explosion,pr));this.explosion=pr};CPieSeries.prototype.setVal=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PieSeries_SetVal,this.val,pr));this.val=pr;if(this.val&&this.val.setParent)this.val.setParent(this)};function CPivotFmt(){this.dLbl=null;this.idx=null;this.marker=null;this.spPr=null;this.txPr=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CPivotFmt.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c= new CPivotFmt;if(this.dLbl)c.setLbl(this.dLbl.createDuplicate());c.setIdx(this.idx);if(this.marker)c.setMarker(this.marker.createDuplicate());if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},getObjectType:function(){return AscDFH.historyitem_type_PivotFmt},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setLbl:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_PivotFmt_SetDLbl,this.dLbl,pr));this.dLbl=pr},setIdx:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_PivotFmt_SetIdx,this.idx,pr));this.idx=pr},setMarker:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PivotFmt_SetMarker,this.marker,pr));this.marker=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_PivotFmt_SetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)},setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_PivotFmt_SetTxPr,this.txPr,pr));this.txPr=pr}};function CRadarChart(){CChartBase.call(this);this.radarStyle=null}CRadarChart.prototype=Object.create(CChartBase.prototype);CRadarChart.prototype.constructor=CRadarChart;CRadarChart.prototype.getSeriesConstructor=function(){return new CRadarSeries};CRadarChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.outEnd};CRadarChart.prototype.Refresh_RecalcData=function(data){if(!isRealObject(data))return; switch(data.Type){case AscDFH.historyitem_CommonChartFormat_SetParent:{break}case AscDFH.historyitem_RadarChart_AddAxId:case AscDFH.historyitem_CommonChart_AddAxId:{break}case AscDFH.historyitem_RadarChart_SetDLbls:case AscDFH.historyitem_CommonChart_SetDlbls:{if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateDataLabels();break}case AscDFH.historyitem_RadarChart_SetRadarStyle:{break}case AscDFH.historyitem_RadarChart_AddSer:case AscDFH.historyitem_CommonChart_AddSeries:case AscDFH.historyitem_CommonChart_AddFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveSeries:{if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType();break}case AscDFH.historyitem_RadarChart_SetVaryColors:case AscDFH.historyitem_CommonChart_SetVaryColors:{break}}};CRadarChart.prototype.createDuplicate=function(){var c=new CRadarChart;if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());c.setRadarStyle(this.radarStyle);for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());c.setVaryColors(this.varyColors);return c};CRadarChart.prototype.getObjectType= function(){return AscDFH.historyitem_type_RadarChart};CRadarChart.prototype.setRadarStyle=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_RadarChart_SetRadarStyle,this.radarStyle,pr));this.radarStyle=pr};function copyDPt(oThis,pt){for(var i=0;i<pt.length;++i)oThis.addDPt(pt[i])}function CRadarSeries(){CSeriesBase.call(this);this.cat=null;this.dLbls=null;this.dPt=[];this.marker=null;this.val=null}CRadarSeries.prototype=Object.create(CSeriesBase.prototype);CRadarSeries.prototype.constructor= CRadarSeries;CRadarSeries.prototype.removeDPt=function(idx){if(this.dPt[idx])History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonSeries_RemoveDPt,idx,this.dPt.splice(idx,1),false))};CRadarSeries.prototype.createDuplicate=function(){var c=new CRadarSeries;if(this.cat)c.setCat(this.cat.createDuplicate());if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());for(var i=0;i<this.dPt.length;++i)c.addDPt(this.dPt[i].createDuplicate());c.setIdx(this.idx);if(this.marker)c.setMarker(this.marker.createDuplicate()); c.setOrder(this.order);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate());if(this.val)c.setVal(this.val.createDuplicate());return c};CRadarSeries.prototype.getObjectType=function(){return AscDFH.historyitem_type_RadarSeries};CRadarSeries.prototype.setCat=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_RadarSeries_SetCat,this.cat,pr));this.cat=pr};CRadarSeries.prototype.setFromOtherSeries=function(o){if(o.cat)this.setCat(o.cat); if(o.dLbls)this.setDLbls(o.dLbls);if(o.dPt)copyDPt(this,o.dPt);if(o.marker)this.setMarker(o.marker);if(AscFormat.isRealNumber(o.idx))this.setIdx(o.idx);if(AscFormat.isRealNumber(o.order))this.setOrder(o.order);if(o.spPr)this.setSpPr(o.spPr);if(o.tx)this.setTx(o.tx);if(o.val)this.setVal(o.val);if(o.xVal){this.setCat(new CCat);this.cat.setFromOtherObject(o.xVal)}if(o.yVal){this.setVal(new CYVal);this.val.setFromOtherObject(o.yVal)}};CRadarSeries.prototype.setDLbls=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_RadarSeries_SetDLbls,this.dLbls,pr));this.dLbls=pr;if(this.dLbls)this.dLbls.setParent(this)};CRadarSeries.prototype.addDPt=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_RadarSeries_SetDPt,this.dPt.length,[pr],true));this.dPt.push(pr)};CRadarSeries.prototype.setMarker=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_RadarSeries_SetCat,this.marker,pr));this.marker=pr};CRadarSeries.prototype.setVal=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_RadarSeries_SetCat,this.val,pr));this.val=pr;if(this.val&&this.val.setParent)this.val.setParent(this)};var ORIENTATION_MAX_MIN=0;var ORIENTATION_MIN_MAX=1;function CScaling(){this.logBase=null;this.max=null;this.min=null;this.orientation=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CScaling.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CScaling;c.setLogBase(this.logBase);c.setMax(this.max); c.setMin(this.min);c.setOrientation(this.orientation);return c},getObjectType:function(){return AscDFH.historyitem_type_Scaling},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Scaling_SetParent,this.parent,pr));this.parent=pr},setLogBase:function(pr){History.Add(new CChangesDrawingsDouble2(this,AscDFH.historyitem_Scaling_SetLogBase, this.logBase,pr));this.logBase=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()},setMax:function(pr){History.Add(new CChangesDrawingsDouble2(this,AscDFH.historyitem_Scaling_SetMax,this.max,pr));this.max=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()}, setMin:function(pr){History.Add(new CChangesDrawingsDouble2(this,AscDFH.historyitem_Scaling_SetMin,this.min,pr));this.min=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()},setOrientation:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Scaling_SetOrientation,this.orientation,pr));this.orientation=pr;if(this.parent&& this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.handleUpdateInternalChart)this.parent.parent.parent.parent.handleUpdateInternalChart()}};function CScatterChart(){CChartBase.call(this);this.scatterStyle=null}CScatterChart.prototype=Object.create(CChartBase.prototype);CScatterChart.prototype.constructor=CScatterChart;CScatterChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.r};CScatterChart.prototype.getSeriesConstructor= function(){return new CScatterSeries};CScatterChart.prototype.createDuplicate=function(){var c=new CScatterChart;if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());c.setScatterStyle(this.scatterStyle);for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());c.setVaryColors(this.varyColors);return c};CScatterChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_ScatterChart};CScatterChart.prototype.setFromOtherChart=function(o){if(o.dLbls)this.setDLbls(o.dLbls); if(AscFormat.isRealNumber(o.scatterStyle))this.setScatterStyle(o.scatterStyle);if(Array.isArray(o.series))for(var i=0;i<o.series.length;++i){var ser=new CScatterSeries;ser.setFromOtherSeries(o.series[i]);this.addSer(ser)}};CScatterChart.prototype.setScatterStyle=function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ScatterChart_SetScatterStyle,this.scatterStyle,pr));this.scatterStyle=pr;if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType()}; function CScatterSeries(){CSeriesBase.call(this);this.dLbls=null;this.dPt=[];this.errBars=null;this.marker=null;this.smooth=null;this.trendline=null;this.xVal=null;this.yVal=null}CScatterSeries.prototype=Object.create(CSeriesBase.prototype);CScatterSeries.prototype.constructor=CScatterSeries;CScatterSeries.prototype.removeDPt=function(idx){if(this.dPt[idx])History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonSeries_RemoveDPt,idx,this.dPt.splice(idx,1),false))};CScatterSeries.prototype.createDuplicate= function(){var c=new CScatterSeries;this.dLbls&&c.setDLbls(this.dLbls.createDuplicate());for(var i=0;i<this.dPt.length;++i)c.addDPt(this.dPt[i].createDuplicate());if(this.errBars)c.setErrBars(this.errBars.createDuplicate());c.setIdx(this.idx);if(this.marker)c.setMarker(this.marker.createDuplicate());c.setOrder(this.order);c.setSmooth(this.smooth);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.trendline)c.setTrendline(this.trendline.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate()); if(this.xVal)c.setXVal(this.xVal.createDuplicate());if(this.yVal)c.setYVal(this.yVal.createDuplicate());return c};CScatterSeries.prototype.getObjectType=function(){return AscDFH.historyitem_type_ScatterSer};CScatterSeries.prototype.setFromOtherSeries=function(o){if(o.dLbls)this.setDLbls(o.dLbls);if(o.dPt)copyDPt(this,o.dPt);if(o.errBars)this.setErrBars(o.errBars);if(AscFormat.isRealNumber(o.idx))this.setIdx(o.idx);if(o.marker)this.setMarker(o.marker);if(AscFormat.isRealNumber(o.order))this.setOrder(o.order); if(AscFormat.isRealBool(o.smooth))this.setSmooth(o.smooth);if(o.spPr)this.setSpPr(o.spPr);if(o.trendline)this.setTrendline(o.trendline);if(o.tx)this.setTx(o.tx);if(o.xVal)this.setXVal(o.xVal);if(o.yVal)this.setYVal(o.yVal);if(o.cat){this.setXVal(new CCat);this.xVal.setFromOtherObject(o.cat)}if(o.val){this.setYVal(new CYVal);this.yVal.setFromOtherObject(o.val)}};CScatterSeries.prototype.setDLbls=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ScatterSer_SetDLbls,this.dLbls, pr));this.dLbls=pr;if(this.dLbls)this.dLbls.setParent(this)};CScatterSeries.prototype.addDPt=function(pr){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_ScatterSer_SetDPt,this.dPt.length,[pr],true));this.dPt.push(pr)};CScatterSeries.prototype.setErrBars=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ScatterSer_SetErrBars,this.errBars,pr));this.errBars=pr};CScatterSeries.prototype.setMarker=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ScatterSer_SetMarker, this.marker,pr));this.marker=pr};CScatterSeries.prototype.setSmooth=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_ScatterSer_SetSmooth,this.smooth,pr));this.smooth=pr};CScatterSeries.prototype.setTrendline=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ScatterSer_SetTrendline,this.trendline,pr));this.trendline=pr};CScatterSeries.prototype.setXVal=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ScatterSer_SetXVal, this.xVal,pr));this.xVal=pr};CScatterSeries.prototype.setYVal=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ScatterSer_SetYVal,this.yVal,pr));this.yVal=pr;if(this.yVal&&this.yVal.setParent)this.yVal.setParent(this)};function CTx(){this.strRef=null;this.val=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CTx.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CTx;if(this.strRef)c.setStrRef(this.strRef.createDuplicate()); c.setVal(this.val);return c},getObjectType:function(){return AscDFH.historyitem_type_Tx},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setStrRef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Tx_SetStrRef,this.strRef,pr));this.strRef=pr},setVal:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_Tx_SetVal,this.strRef,pr));this.val=pr},getText:function(bNoUpdate){var sRet= "";if(typeof this.val==="string"&&this.val.length>0)sRet=this.val;else if(this.strRef)sRet=this.strRef.getText(bNoUpdate);return sRet},getFormula:function(){var sRet="";if(typeof this.val==="string"&&this.val.length>0)sRet='="'+this.val+'"';else if(this.strRef)sRet=this.strRef.getFormula();return sRet},getParsedRefs:function(){if(this.strRef)return this.strRef.getParsedRefs();return[]},setValues:function(sName){var oResult=new CParseResult;var oParser,bResult,oLastElem;if(typeof sName==="string"&& sName.length>0){fParseStrRef(sName,false,oResult);if(oResult.isSuccessful()){this.setStrRef(oResult.getObject());this.setVal(null)}else{var aParsed=AscFormat.fParseChartFormula(sName);if(aParsed.length>0)return oResult;if(sName[0]==="="){oParser=new AscCommonExcel.parserFormula(sName.slice(1),null,Asc.editor.wbModel.aWorksheets[0]);bResult=oParser.parse(true,true);if(bResult&&oParser.outStack.length===1&&(oLastElem=oParser.outStack[0])&&oLastElem.type===AscCommonExcel.cElementType.string){if(this.strRef)this.setStrRef(null); this.setVal(oLastElem.getValue());oResult.setError(Asc.c_oAscError.ID.No);oResult.setObject(oLastElem.getValue())}else oResult.setError(Asc.c_oAscError.ID.ErrorInFormula)}else{if(this.strRef)this.setStrRef(null);this.setVal(sName);oResult.setError(Asc.c_oAscError.ID.No);oResult.setObject(sName)}}}else oResult.setError(Asc.c_oAscError.ID.DataRangeError);return oResult},isValid:function(){if(this.strRef||typeof this.val==="string")return true;return false},update:function(){if(this.strRef)this.strRef.updateCache()}}; function CStockChart(){CChartBase.call(this);this.dropLines=null;this.hiLowLines=null;this.upDownBars=null}CStockChart.prototype=Object.create(CChartBase.prototype);CStockChart.prototype.constructor=CStockChart;CStockChart.prototype.getDefaultDataLabelsPosition=function(){return c_oAscChartDataLabelsPos.r};CStockChart.prototype.setFromOtherChart=function(c){var i;if(c.dLbls)this.setDLbls(c.dLbls);if(c.dropLines)this.setDropLines(c.dropLines);if(c.hiLowLines)this.setHiLowLines(c.hiLowLines);if(Array.isArray(c.series))for(i= 0;i<c.series.length;++i){var ser=new CLineSeries;ser.setFromOtherSeries(c.series[i]);ser.setMarker(new CMarker);ser.setSpPr(new AscFormat.CSpPr);ser.spPr.setLn(new AscFormat.CLn);ser.spPr.ln.setW(28575);ser.spPr.ln.setFill(AscFormat.CreateNoFillUniFill());ser.marker.setSymbol(SYMBOL_NONE);ser.setSmooth(false);this.addSer(ser)}if(c.upDownBars)this.setUpDownBars(c.upDownBars)};CStockChart.prototype.Refresh_RecalcData=function(){if(this.parent&&this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType()}; CStockChart.prototype.getSeriesConstructor=function(){return new CLineSeries};CStockChart.prototype.createDuplicate=function(){var c=new CStockChart;if(this.dLbls)c.setDLbls(this.dLbls.createDuplicate());if(this.dropLines)c.setDropLines(this.dropLines.createDuplicate());if(this.hiLowLines)c.setHiLowLines(this.hiLowLines.createDuplicate());for(var i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());if(this.upDownBars)c.setUpDownBars(this.upDownBars.createDuplicate());return c}; CStockChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_StockChart};CStockChart.prototype.setDropLines=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_StockChart_SetDropLines,this.dropLines,pr));this.dropLines=pr};CStockChart.prototype.setHiLowLines=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_StockChart_SetHiLowLines,this.hiLowLines,pr));this.hiLowLines=pr};CStockChart.prototype.setUpDownBars=function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_StockChart_SetUpDownBars,this.upDownBars,pr));this.upDownBars=pr;if(pr&&pr.setParent)pr.setParent(this)};function CStrCache(){this.pts=[];this.ptCount=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CStrCache.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},removeDPt:function(idx){if(this.pts[idx]){if(false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On())History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_CommonLit_RemoveDPt, idx,[this.pts[idx]],false));this.pts.splice(idx,1)}},removeAllPts:function(){var start_idx=this.pts.length-1;for(var i=start_idx;i>-1;--i)this.removeDPt(i);this.setPtCount(0)},createDuplicate:function(){var c=new CStrCache;for(var i=0;i<this.pts.length;++i)c.addPt(this.pts[i].createDuplicate());c.setPtCount(this.ptCount);return c},getPtByIndex:function(idx){if(this.pts[idx]&&this.pts[idx].idx===idx)return this.pts[idx];for(var i=0;i<this.pts.length;++i)if(this.pts[i].idx===idx)return this.pts[i]; return null},getPtCount:function(){if(AscFormat.isRealNumber(this.ptCount))return this.ptCount;return this.pts.length},getObjectType:function(){return AscDFH.historyitem_type_StrCache},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},addPt:function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_StrCache_AddPt,this.pts.length, [pr],true));this.pts.push(pr)},setPtCount:function(pr){false===AscCommon.g_oIdCounter.m_bLoad&&true===History.Is_On()&&History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_StrCache_SetPtCount,this.ptCount,pr));this.ptCount=pr},update:function(sFormula){AscFormat.ExecuteNoHistory(function(){if(!(typeof sFormula==="string"&&sFormula.length>0))return;var pt_index=0,i,j,cell,pt,value_width_format,row_hidden,col_hidden,nPtCount=0;var aParsedRef=AscFormat.fParseChartFormula(sFormula);var str_cache= this;var fParseTableDataString=function(oRef,oCache){if(Array.isArray(oRef))for(var i=0;i<oRef.length;++i)if(Array.isArray(oRef[i]))fParseTableDataString(oRef,oCache);else{pt=new AscFormat.CStringPoint;pt.setIdx(pt_index);pt.setVal(oRef[i].value);str_cache.addPt(pt);++pt_index;++nPtCount}};for(i=0;i<aParsedRef.length;++i){var oCurRef=aParsedRef[i];var source_worksheet=oCurRef.worksheet;if(source_worksheet){var range=oCurRef.bbox;if(range.r1===range.r2){row_hidden=source_worksheet.getRowHidden(range.r1); j=range.c1;while(i===0&&source_worksheet.getColHidden(j)&&j<=range.c2)++j;for(;j<=range.c2;++j){if(!row_hidden&&!source_worksheet.getColHidden(j)){cell=source_worksheet.getCell3(range.r1,j);value_width_format=cell.getValueWithFormat();if(typeof value_width_format==="string"&&value_width_format.length>0){pt=new AscFormat.CStringPoint;pt.setIdx(nPtCount);pt.setVal(value_width_format);if(str_cache.pts.length===0)pt.formatCode=cell.getNumFormatStr();str_cache.addPt(pt)}++nPtCount}pt_index++}}else{col_hidden= source_worksheet.getColHidden(range.c1);j=range.r1;while(i===0&&source_worksheet.getRowHidden(j)&&j<=range.r2)++j;for(;j<=range.r2;++j){if(!col_hidden&&!source_worksheet.getRowHidden(j)){cell=source_worksheet.getCell3(j,range.c1);value_width_format=cell.getValueWithFormat();if(typeof value_width_format==="string"&&value_width_format.length>0){pt=new AscFormat.CStringPoint;pt.setIdx(nPtCount);pt.setVal(cell.getValueWithFormat());if(str_cache.pts.length===0)pt.formatCode=cell.getNumFormatStr();str_cache.addPt(pt)}++nPtCount}pt_index++}}}else fParseTableDataString(oCurRef)}this.setPtCount(nPtCount)}, this,[])},addStringPoint:function(idx,sStr){var oPt=new CStringPoint;oPt.setIdx(idx);oPt.setVal(sStr);this.addPt(oPt);this.setPtCount(Math.max(this.pts.length,idx+1))},getValues:function(nMaxCount,bAddEmpty){var ret=[];var nEnd=nMaxCount||this.ptCount;for(var nIndex=0;nIndex<nEnd;++nIndex){var oPt=this.getPtByIndex(nIndex);if(oPt)ret.push(oPt.val+"");else if(bAddEmpty)ret.push("")}return ret},getFormula:function(){var sRet="={";for(var nIndex=0;nIndex<this.pts.length;++nIndex){sRet+='"'+this.pts[nIndex].val+ '"';if(nIndex<this.pts.length-1)sRet+=", "}sRet+="}";return sRet}};function CStringPoint(){this.idx=null;this.val=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CStringPoint.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CStringPoint;c.setIdx(this.idx);c.setVal(this.val);return c},getObjectType:function(){return AscDFH.historyitem_type_StrPoint},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())}, Read_FromBinary2:function(r){this.Id=r.GetString2()},setIdx:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_StrPoint_SetIdx,this.idx,pr));this.idx=pr},setVal:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_StrPoint_SetVal,this.val,pr));this.val=pr;if(AscFonts.IsCheckSymbols)if(typeof pr==="string"&&pr.length>0)AscFonts.FontPickerByCharacter.getFontsByString(pr)}};function CStrRef(){this.f=null;this.strCache=null;this.Id=g_oIdCounter.Get_NewId(); g_oTableId.Add(this,this.Id)}CStrRef.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var c=new CStrRef;c.setF(this.f);if(this.strCache)c.setStrCache(this.strCache.createDuplicate());return c},getObjectType:function(){return AscDFH.historyitem_type_StrRef},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()},setF:function(pr){History.Add(new CChangesDrawingsString(this, AscDFH.historyitem_StrRef_SetF,this.f,pr));this.f=pr},setStrCache:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_StrRef_SetStrCache,this.strCache,pr));this.strCache=pr},updateCache:function(){if(!this.strCache)this.setStrCache(new CStrCache);this.strCache.removeAllPts();this.strCache.update(this.f)},getText:function(bNoUpdate){if(!this.strCache)if(bNoUpdate!==true)this.updateCache();var aValues=this.strCache.getValues(null);var sRet="";for(var i=0;i<aValues.length;++i){if(i> 0)sRet+=" ";sRet+=aValues[i]}return sRet},getValues:function(nMaxCount,bAddEmpty){if(!this.strCache)this.updateCache();return this.strCache.getValues(nMaxCount,bAddEmpty)},getFormula:function(){return"="+this.f},getParsedRefs:function(){return AscFormat.fParseChartFormula(this.f)}};function CSurfaceChart(){CChartBase.call(this);this.bandFmts=[];this.wireframe=null;this.compiledBandFormats=[]}CSurfaceChart.prototype=Object.create(CChartBase.prototype);CSurfaceChart.prototype.constructor=CSurfaceChart; CSurfaceChart.prototype.Refresh_RecalcData=function(data){if(!isRealObject(data))return;switch(data.Type){case AscDFH.historyitem_CommonChartFormat_SetParent:{break}case AscDFH.historyitem_SurfaceChart_AddAxId:case AscDFH.historyitem_CommonChart_AddAxId:{break}case AscDFH.historyitem_SurfaceChart_AddBandFmt:{break}case AscDFH.historyitem_SurfaceChart_AddSer:case AscDFH.historyitem_CommonChart_AddSeries:case AscDFH.historyitem_CommonChart_AddFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveFilteredSeries:case AscDFH.historyitem_CommonChart_RemoveSeries:{if(this.parent&& this.parent.parent&&this.parent.parent.parent)this.parent.parent.parent.handleUpdateType();break}case AscDFH.historyitem_SurfaceChart_SetWireframe:{break}}};CSurfaceChart.prototype.isWireframe=function(){return this.wireframe===true};CSurfaceChart.prototype.getBandFmtByIndex=function(idx){for(var i=0;i<this.bandFmts.length;++i)if(this.bandFmts[i].idx===idx)return this.bandFmts[i];return null};CSurfaceChart.prototype.getSeriesConstructor=function(){return new CSurfaceSeries};CSurfaceChart.prototype.getDefaultDataLabelsPosition= function(){return c_oAscChartDataLabelsPos.ctr};CSurfaceChart.prototype.createDuplicate=function(){var c=new CSurfaceChart,i;for(i=0;i<this.bandFmts.length;++i)c.addBandFmt(this.bandFmts[i].createDuplicate());for(i=0;i<this.series.length;++i)c.addSer(this.series[i].createDuplicate());c.setWireframe(this.wireframe);return c};CSurfaceChart.prototype.getObjectType=function(){return AscDFH.historyitem_type_SurfaceChart};CSurfaceChart.prototype.getAllRasterImages=function(images){CChartBase.prototype.getAllRasterImages.call(this, images);for(var i=0;i<this.bandFmts.length;++i)this.bandFmts[i]&&this.bandFmts[i].spPr&&this.bandFmts[i].spPr.checkBlipFillRasterImage(images)};CSurfaceChart.prototype.checkSpPrRasterImages=function(images){CChartBase.prototype.checkSpPrRasterImages.call(this,images);for(var i=0;i<this.bandFmts.length;++i)this.bandFmts[i]&&checkSpPrRasterImages(this.bandFmts[i].spPr)};CSurfaceChart.prototype.addBandFmt=function(fmt){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_SurfaceChart_AddBandFmt, this.bandFmts.length,[fmt],true));this.bandFmts.push(fmt)};CSurfaceChart.prototype.setWireframe=function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_SurfaceChart_SetWireframe,this.wireframe,pr));this.wireframe=pr};function CSurfaceSeries(){CSeriesBase.call(this);this.cat=null;this.val=null}CSurfaceSeries.prototype=Object.create(CSeriesBase.prototype);CSurfaceSeries.prototype.constructor=CSurfaceSeries;CSurfaceSeries.prototype.removeDPt=function(idx){if(this.dPt[idx])History.Add(new CChangesDrawingsContent(this, AscDFH.historyitem_CommonSeries_RemoveDPt,idx,this.dPt.splice(idx,1),false))};CSurfaceSeries.prototype.createDuplicate=function(){var c=new CSurfaceSeries;if(this.cat)c.setCat(this.cat.createDuplicate());c.setIdx(this.idx);c.setOrder(this.order);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate());if(this.val)c.setVal(this.val.createDuplicate());return c};CSurfaceSeries.prototype.getObjectType=function(){return AscDFH.historyitem_type_SurfaceSeries};CSurfaceSeries.prototype.setFromOtherSeries= function(o){if(o.cat)this.setCat(o.cat);if(AscFormat.isRealNumber(o.idx))this.setIdx(o.idx);if(AscFormat.isRealNumber(o.order))this.setOrder(o.order);if(o.spPr)this.setSpPr(o.spPr);if(o.tx)this.setTx(o.tx);if(o.val)this.setVal(o.val);if(o.xVal){this.setCat(new CCat);this.cat.setFromOtherObject(o.xVal)}if(o.yVal){this.setVal(new CYVal);this.val.setFromOtherObject(o.yVal)}};CSurfaceSeries.prototype.setCat=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SurfaceSeries_SetCat, this.cat,pr));this.cat=pr};CSurfaceSeries.prototype.setVal=function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_SurfaceSeries_SetVal,this.val,pr));this.val=pr;if(this.val&&this.val.setParent)this.val.setParent(this)};function CTitle(){this.layout=null;this.overlay=false;this.spPr=null;this.tx=null;this.txPr=null;this.parent=null;this.txBody=null;this.x=null;this.y=null;this.calcX=null;this.calcY=null;this.extX=null;this.extY=null;this.transform=new CMatrix;this.transformText= new CMatrix;this.ownTransform=new CMatrix;this.ownTransformText=new CMatrix;this.localTransform=new CMatrix;this.localTransformText=new CMatrix;this.recalcInfo={recalculateTxBody:true,recalcTransform:true,recalculateTransformText:true,recalculateContent:true,recalculateBrush:true,recalculatePen:true,recalcStyle:true,recalculateGeometry:true};this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CTitle.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){this.Refresh_RecalcData2()}, chekBodyPrTransform:function(){return false},checkContentWordArt:function(){return false},Get_AbsolutePage:function(){if(this.chart&&this.chart.Get_AbsolutePage)return this.chart.Get_AbsolutePage();return 0},Refresh_RecalcData2:function(pageIndex){this.recalcInfo.recalculateTxBody=true;this.recalcInfo.recalcTransform=true;this.recalcInfo.recalculateTransformText=true;this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateGeometry=true;this.parent&& this.parent.Refresh_RecalcData2&&this.parent.Refresh_RecalcData2(pageIndex,this)},checkAfterChangeTheme:function(){this.recalcInfo.recalculateTxBody=true;this.recalcInfo.recalcTransform=true;this.recalcInfo.recalculateTransformText=true;this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateGeometry=true;if(this.tx&&this.tx.rich&&this.tx.rich.content)this.tx.rich.content.Recalc_AllParagraphs_CompiledPr()},GetRevisionsChangeElement:function(SearchEngine){var oContent=this.getDocContent(); if(oContent)oContent.GetRevisionsChangeElement(SearchEngine)},handleUpdateFill:function(){this.recalcInfo.recalculateBrush=true;this.Refresh_RecalcData()},handleUpdateLn:function(){this.recalcInfo.recalculatePen=true;this.Refresh_RecalcData()},Search:function(Str,Props,SearchEngine,Type){var content=this.getDocContent();if(content&&this.tx&&this.tx.rich){var dd=this.getDrawingDocument();dd.StartSearchTransform&&dd.StartSearchTransform(this.transformText);content.Search(Str,Props,SearchEngine,Type); dd.EndSearchTransform&&dd.EndSearchTransform()}},GetSearchElementId:function(bNext,bCurrent){var content=this.getDocContent();if(content&&this.tx&&this.tx.rich)return content.GetSearchElementId(bNext,bCurrent);return null},Set_CurrentElement:function(bUpdate,pageIndex){var chart=this.chart,controller;if(chart&&typeof editor!=="undefined"&&editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument){var bDocument=false,bPresentation=false,drawing_objects;if(editor.WordControl.m_oLogicDocument instanceof CDocument){bDocument=true;drawing_objects=editor.WordControl.m_oLogicDocument.DrawingObjects}else if(editor.WordControl.m_oLogicDocument instanceof CPresentation){bPresentation=true;if(chart.parent)drawing_objects=chart.parent.graphicObject}if(drawing_objects){drawing_objects.resetSelection(true);var para_drawing;if(chart.group){var main_group=chart.group.getMainGroup();drawing_objects.selectObject(main_group,pageIndex);main_group.selectObject(chart,pageIndex);main_group.selection.chartSelection= chart;chart.selection.textSelection=this;chart.selection.title=this;drawing_objects.selection.groupSelection=main_group;para_drawing=main_group.parent}else{drawing_objects.selectObject(chart,pageIndex);drawing_objects.selection.chartSelection=chart;chart.selection.textSelection=this;chart.selection.title=this;para_drawing=chart.parent}if(bDocument&¶_drawing instanceof ParaDrawing){var hdr_ftr=para_drawing.DocumentContent.IsHdrFtr(true);if(hdr_ftr){hdr_ftr.Content.SetDocPosType(docpostype_DrawingObjects); hdr_ftr.Set_CurrentElement(bUpdate)}else drawing_objects.document.SetDocPosType(docpostype_DrawingObjects)}}}},createDuplicate:function(){var c=new CTitle;if(this.layout)c.setLayout(this.layout.createDuplicate());c.setOverlay(this.overlay);if(this.spPr)c.setSpPr(this.spPr.createDuplicate());if(this.tx)c.setTx(this.tx.createDuplicate());if(this.txPr)c.setTxPr(this.txPr.createDuplicate());return c},getObjectType:function(){return AscDFH.historyitem_type_Title},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType()); w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},paragraphAdd:function(paraItem,bRecalculate){var content=this.getDocContent();if(content)content.AddToParagraph(paraItem,bRecalculate)},applyTextFunction:function(docContentFunction,tableFunction,args){var content=this.getDocContent();if(content)docContentFunction.apply(content,args)},setPosition:CDLbl.prototype.setPosition,hitInPath:CShape.prototype.hitInPath,hitInInnerArea:CShape.prototype.hitInInnerArea,hitInBoundingRect:CShape.prototype.hitInBoundingRect, hitInTextRect:CShape.prototype.hitInTextRect,recalculateGeometry:CShape.prototype.recalculateGeometry,getTransform:CShape.prototype.getTransform,checkHitToBounds:CDLbl.prototype.checkHitToBounds,checkDocContent:function(){if(this.tx&&this.tx.rich&&this.tx.rich.content)return;else if(this.txBody&&this.txBody.content){var StartPage=this.txBody.content.StartPage;if(!this.tx)this.setTx(new CChartText);this.tx.setRich(this.txBody.createDuplicate2());this.tx.rich.setParent(this);if(this.txPr){if(this.txPr.content&& this.txPr.content.Content[0]&&this.txPr.content.Content[0].Pr.DefaultRunPr)for(var i=0;i<this.tx.rich.content.Content.length;++i)AscFormat.CheckParagraphTextPr(this.tx.rich.content.Content[i],this.txPr.content.Content[0].Pr.DefaultRunPr);if(this.txPr.bodyPr)this.tx.rich.setBodyPr(this.txPr.bodyPr.createDuplicate())}var selection_state=this.txBody.content.GetSelectionState();this.txBody=this.tx.rich;this.txBody.content.SetSelectionState(selection_state,selection_state.length-1);if(AscFormat.isRealNumber(StartPage))this.txBody.content.Set_StartPage(StartPage)}}, getDocContent:function(){if(this.recalcInfo.recalculateTxBody){AscFormat.ExecuteNoHistory(this.recalculateTxBody,this,[]);this.recalcInfo.recalculateTxBody=false}if(this.txBody&&this.txBody.content)return this.txBody.content},selectionSetStart:CShape.prototype.selectionSetStart,selectionSetEnd:CShape.prototype.selectionSetEnd,select:function(chartSpace,pageIndex){this.selected=true;this.selectStartPage=pageIndex;var content=this.getDocContent&&this.getDocContent();if(content)content.Set_StartPage(pageIndex); chartSpace.selection.title=this},getMaxWidth:function(bodyPr){switch(bodyPr.vert){case AscFormat.nVertTTeaVert:case AscFormat.nVertTTmongolianVert:case AscFormat.nVertTTvert:case AscFormat.nVertTTwordArtVert:case AscFormat.nVertTTwordArtVertRtl:case AscFormat.nVertTTvert270:{var vert_axis=this.chart.chart.plotArea.getVerticalAxis();if(vert_axis&&vert_axis.title===this){var hor_axis=this.chart.chart.plotArea.getHorizontalAxis();return this.chart.extY-(hor_axis&&hor_axis.title?hor_axis.title.extY:0)}return this.chart.extY/ 2}case AscFormat.nVertTThorz:{return this.chart.extX*.8}}return this.chart.extX*.5},Is_UseInDocument:function(){if(this.parent&&this.parent.title===this&&this.chart&&this.chart.Is_UseInDocument)return this.chart.Is_UseInDocument();return false},Check_AutoFit:function(){return true},getBodyPr:CDLbl.prototype.getBodyPr,getCompiledStyle:CDLbl.prototype.getCompiledStyle,getCompiledFill:CDLbl.prototype.getCompiledFill,getCompiledLine:CDLbl.prototype.getCompiledLine,getCompiledTransparent:CDLbl.prototype.getCompiledTransparent, Get_Styles:CDLbl.prototype.Get_Styles,check_bounds:CShape.prototype.check_bounds,selectionCheck:CShape.prototype.selectionCheck,getInvertTransform:CShape.prototype.getInvertTransform,getCanvasContext:CDLbl.prototype.getCanvasContext,convertPixToMM:CDLbl.prototype.convertPixToMM,getDrawingDocument:function(){if(this.chart&&this.chart.getDrawingDocument)return this.chart&&this.chart.getDrawingDocument();return this.parent&&this.parent.getDrawingDocument&&this.parent.getDrawingDocument()},draw:function(graphics){CDLbl.prototype.draw.call(this, graphics)},isEmptyPlaceholder:CDLbl.prototype.isEmptyPlaceholder,recalculatePen:CShape.prototype.recalculatePen,recalculateBrush:CShape.prototype.recalculateBrush,updateSelectionState:CShape.prototype.updateSelectionState,checkShapeChildTransform:CDLbl.prototype.checkShapeChildTransform,updatePosition:function(x,y){this.posX=x;this.posY=y;this.transform=this.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transform,x,y);this.transformText=this.localTransformText.CreateDublicate(); global_MatrixTransformer.TranslateAppend(this.transformText,x,y);this.invertTransform=global_MatrixTransformer.Invert(this.transform);this.invertTransformText=global_MatrixTransformer.Invert(this.transformText)},getParentObjects:function(){if(this.chart)return this.chart.getParentObjects();else if(this.parent)return this.parent.getParentObjects();return null},getDefaultTextForTxBody:function(){var sText;if(this.tx&&this.tx.strRef){sText=this.tx.strRef.getText(true);if(typeof sText==="string"&&sText.length> 0)return sText}var key="Axis Title";if(this.parent)if(this.parent.getObjectType()===AscDFH.historyitem_type_Chart){if(this.parent.plotArea&&this.parent.plotArea.charts.length===1&&Array.isArray(this.parent.plotArea.charts[0].series)&&this.parent.plotArea.charts[0].series.length===1&&this.parent.plotArea.charts[0].series[0].tx){var oTx=this.parent.plotArea.charts[0].series[0].tx;sText=oTx.getText(true);if(typeof sText==="string"&&sText.length>0)return sText}key="Diagram Title"}else if(this.parent.axPos=== AX_POS_B||this.parent.axPos===AX_POS_T)key="X Axis";else key="Y Axis";return AscCommon.translateManager.getValue(key)},getStyles:CDLbl.prototype.getStyles,Get_Theme:CDLbl.prototype.Get_Theme,Get_ColorMap:CDLbl.prototype.Get_ColorMap,recalculateStyle:CDLbl.prototype.recalculateStyle,recalculateTxBody:CDLbl.prototype.recalculateTxBody,recalculateTransform:CDLbl.prototype.recalculateTransform,recalculateTransformText:CDLbl.prototype.recalculateTransformText,recalculateContent:CDLbl.prototype.recalculateContent, recalculate:function(){AscFormat.ExecuteNoHistory(function(){if(this.recalcInfo.recalculateBrush){this.recalculateBrush();this.recalcInfo.recalculateBrush=false}if(this.recalcInfo.recalculatePen){this.recalculatePen();this.recalcInfo.recalculatePen=false}if(this.recalcInfo.recalcStyle){this.recalculateStyle();this.recalcInfo.recalcStyle=false}if(this.recalcInfo.recalculateTxBody){this.recalculateTxBody();this.recalcInfo.recalculateTxBody=false}if(this.recalcInfo.recalculateContent){this.recalculateContent(); this.recalcInfo.recalculateContent=false}if(this.recalcInfo.recalcTransform){this.recalculateTransform();this.recalcInfo.recalcTransform=false}if(this.recalcInfo.recalculateGeometry){this.recalculateGeometry&&this.recalculateGeometry();this.recalcInfo.recalculateGeometry=false}if(this.recalcInfo.recalculateTransformText){this.recalculateTransformText();this.recalcInfo.recalculateTransformText=false}if(this.chart)this.chart.addToSetPosition(this)},this,[])},setLayout:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_Title_SetLayout,this.layout,pr));this.layout=pr;if(this.layout)this.layout.setParent(this)},setOverlay:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Title_SetOverlay,this.overlay,pr));this.overlay=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Title_SetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)},setTx:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Title_SetTx, this.tx,pr));this.tx=pr;if(this.tx)this.tx.setParent(this)},setTxPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Title_SetTxPr,this.txPr,pr));this.txPr=pr;if(this.txPr)this.txPr.setParent(this)},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr}};function CTrendLine(){this.backward=null;this.dispEq=null;this.dispRSqr=null;this.forward=null;this.intercept=null;this.name=null; this.order=null;this.period=null;this.spPr=null;this.trendlineLbl=null;this.trendlineType=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CTrendLine.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_TrendLine},setBackward:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Trendline_SetBackward,this.backward,pr));this.backward=pr},setDispEq:function(pr){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_Trendline_SetDispEq,this.dispEq,pr));this.dispEq=pr},setDispRSqr:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Trendline_SetDispRSqr,this.dispRSqr,pr));this.dispRSqr=pr},setForward:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Trendline_SetForward,this.forward,pr));this.forward=pr},setIntercept:function(pr){History.Add(new CChangesDrawingsDouble(this,AscDFH.historyitem_Trendline_SetIntercept,this.intercept,pr));this.intercept= pr},setName:function(pr){History.Add(new CChangesDrawingsString(this,AscDFH.historyitem_Trendline_SetName,this.name,pr));this.name=pr},setOrder:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Trendline_SetOrder,this.order,pr));this.order=pr},setPeriod:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Trendline_SetPeriod,this.period,pr));this.period=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Trendline_SetSpPr, this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)},setTrendlineLbl:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Trendline_SetTrendlineLbl,this.trendlineLbl,pr));this.trendlineLbl=pr},setTrendlineType:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Trendline_SetTrendlineType,this.trendlineType,pr));this.trendlineType=pr},createDuplicate:function(){var c=new CTrendLine;if(AscFormat.isRealNumber(this.backward))c.setBackward(this.backward); if(AscFormat.isRealBool(this.dispEq))c.setDispEq(this.dispEq);if(AscFormat.isRealBool(this.dispRSqr))c.setDispRSqr(this.dispRSqr);if(AscFormat.isRealNumber(this.forward))c.setForward(this.forward);if(AscFormat.isRealNumber(this.intercept))c.setIntercept(this.intercept);if(typeof this.name==="string")c.setName(this.name);if(AscFormat.isRealNumber(this.order))c.setOrder(this.order);if(AscFormat.isRealNumber(this.period))c.setPeriod(this.period);if(isRealObject(this.spPr))c.setSpPr(this.spPr.createDuplicate()); if(AscFormat.isRealNumber(this.trendlineType))c.setTrendlineType(this.trendlineType);return c},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()}};function CUpDownBars(){this.downBars=null;this.gapWidth=null;this.upBars=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CUpDownBars.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){if(this.parent)this.parent.Refresh_RecalcData&& this.parent.Refresh_RecalcData()},getObjectType:function(){return AscDFH.historyitem_type_UpDownBars},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},setDownBars:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_UpDownBars_SetDownBars,this.downBars,pr));this.downBars=pr;if(this.downBars)this.downBars.setParent(this)},setGapWidth:function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_UpDownBars_SetGapWidth,this.downBars,pr));this.gapWidth=pr},setUpBars:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_UpDownBars_SetUpBars,this.downBars,pr));this.upBars=pr;if(this.upBars)this.upBars.setParent(this)},handleUpdateFill:function(){this.Refresh_RecalcData()},handleUpdateLn:function(){this.Refresh_RecalcData()},createDuplicate:function(){var c=new CUpDownBars;if(AscFormat.isRealNumber(this.gapWidth))c.setGapWidth(this.gapWidth);if(isRealObject(this.upBars))c.setUpBars(this.upBars.createDuplicate()); if(isRealObject(this.downBars))c.setDownBars(this.downBars.createDuplicate());return c},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id=r.GetString2()}};function CYVal(){this.numLit=null;this.numRef=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CYVal.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},createDuplicate:function(){var copy=new CYVal;if(this.numLit)copy.setNumLit(this.numLit.createDuplicate()); if(this.numRef)copy.setNumRef(this.numRef.createDuplicate());return copy},getObjectType:function(){return AscDFH.historyitem_type_YVal},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},setFromOtherObject:function(o){if(o.numLit)this.setNumLit(o.numLit);if(o.numRef)this.setNumRef(o.numRef)},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Get_Id())},Read_FromBinary2:function(r){this.Id= r.GetString2()},setNumLit:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_YVal_SetNumLit,this.numLit,pr));this.numLit=pr},setNumRef:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_YVal_SetNumRef,this.numRef,pr));this.numRef=pr;if(this.numRef&&this.numRef.setParent)this.numRef.setParent(this)},setValues:function(sValues){var oResult;if(typeof sValues==="string"&&sValues.length>0){oResult=new CParseResult;fParseNumLit(sValues,true,oResult);if(oResult.isSuccessful()){if(this.numRef)this.setNumRef(null); this.setNumLit(oResult.getObject())}else{oResult=new CParseResult;fParseNumRef(sValues,true,oResult);if(oResult.isSuccessful()){if(this.numLit)this.setNumLit(null);this.setNumRef(oResult.getObject())}}}else{oResult=new CParseResult;oResult.setError(Asc.c_oAscError.NoValues)}return oResult},getValuesCount:function(){if(this.numLit)return this.numLit.ptCount;if(this.numRef)return this.numRef.getValuesCount();return 0},getValues:function(nMaxValues){if(this.numLit)return this.numLit.getValues(nMaxValues); if(this.numRef)return this.numRef.getValues(nMaxValues)},getFormula:function(){if(this.numLit)return this.numLit.getFormula();if(this.numRef)return this.numRef.getFormula()},getRefFormula:function(){if(this.numRef)return this.numRef.getFormula();return null},getParsedRefs:function(){if(this.numRef)return this.numRef.getParsedRefs();return[]},isValid:function(){if(this.numRef||this.numLit)return true;return false},update:function(displayEmptyCellsAs,displayHidden,ser){if(this.numRef)this.numRef.updateCache(displayEmptyCellsAs, displayHidden,ser)}};function CChart(){this.autoTitleDeleted=null;this.backWall=null;this.dispBlanksAs=null;this.floor=null;this.legend=null;this.pivotFmts=[];this.plotArea=null;this.plotVisOnly=null;this.showDLblsOverMax=null;this.sideWall=null;this.title=null;this.view3D=null;this.parent=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CChart.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){if(this.parent)this.parent.handleUpdateInternalChart()},CheckCorrect:function(){if(!this.plotArea)return false; return true},getView3d:function(){return AscFormat.ExecuteNoHistory(function(){var _ret;var oChart=this.plotArea&&this.plotArea.charts[0];if(oChart){if(this.view3D){_ret=this.view3D.createDuplicate();if(oChart.getObjectType()===AscDFH.historyitem_type_SurfaceChart){if(!AscFormat.isRealNumber(_ret.rotX))_ret.rotX=15;if(!AscFormat.isRealNumber(_ret.rotY))_ret.rotY=20}else{if(!AscFormat.isRealNumber(_ret.rotX))_ret.rotX=0;if(!AscFormat.isRealNumber(_ret.rotY))_ret.rotY=0}return _ret}if(oChart.b3D){_ret= new CView3d;_ret.setRotX(30);_ret.setRotY(0);_ret.setRAngAx(false);_ret.setDepthPercent(100);return _ret}}return null},this,[])},getObjectType:function(){return AscDFH.historyitem_type_Chart},getParentObjects:function(){return this.parent&&this.parent.getParentObjects()},handleUpdateDataLabels:function(){if(this.parent&&this.parent.handleUpdateDataLabels)this.parent.handleUpdateDataLabels()},handleUpdateFill:function(){if(this.parent&&this.parent.handleUpdateFill)this.parent.handleUpdateFill()},handleUpdateLn:function(){if(this.parent&& this.parent.handleUpdateLn)this.parent.handleUpdateLn()},setDefaultWalls:function(){var oFloor=new CChartWall;oFloor.setThickness(0);this.setFloor(oFloor);var oSideWall=new CChartWall;oSideWall.setThickness(0);this.setSideWall(oSideWall);var oBackWall=new CChartWall;oBackWall.setThickness(0);this.setBackWall(oBackWall)},createDuplicate:function(){var c=new CChart;c.autoTitleDeleted=this.autoTitleDeleted;if(this.backWall)c.setBackWall(this.backWall.createDuplicate());c.setDispBlanksAs(this.dispBlanksAs); if(this.floor)c.setFloor(this.floor.createDuplicate());if(this.legend)c.setLegend(this.legend.createDuplicate());var Count=this.pivotFmts.length;for(var i=0;i<Count;i++)c.setPivotFmts(this.pivotFmts[i].createDuplicate());if(this.plotArea)c.setPlotArea(this.plotArea.createDuplicate());c.setPlotVisOnly(this.plotVisOnly);c.setShowDLblsOverMax(this.showDLblsOverMax);if(this.sideWall)c.setSideWall(this.sideWall.createDuplicate());if(this.title)c.setTitle(this.title.createDuplicate());if(this.view3D)c.setView3D(this.view3D.createDuplicate()); return c},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},Refresh_RecalcData2:function(pageIndex,object){this.parent&&this.parent.Refresh_RecalcData2&&this.parent.Refresh_RecalcData2(pageIndex,object)},getDrawingDocument:function(){return this.parent&&this.parent&&this.parent.getDrawingDocument&&this.parent.getDrawingDocument()},setAutoTitleDeleted:function(autoTitleDeleted){History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_Chart_SetAutoTitleDeleted,this.autoTitleDeleted,autoTitleDeleted));this.autoTitleDeleted=autoTitleDeleted},setBackWall:function(backWall){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Chart_SetBackWall,this.backWall,backWall));this.backWall=backWall},setDispBlanksAs:function(dispBlanksAs){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_Chart_SetDispBlanksAs,this.dispBlanksAs,dispBlanksAs));this.dispBlanksAs=dispBlanksAs},setFloor:function(floor){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_Chart_SetFloor,this.floor,floor));this.floor=floor},setLegend:function(legend){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Chart_SetLegend,this.legend,legend));this.legend=legend;if(legend)legend.setParent(this)},setPivotFmts:function(pivotFmt){History.Add(new CChangesDrawingsContent(this,AscDFH.historyitem_Chart_AddPivotFmt,this.pivotFmts.length,[pivotFmt],true));this.pivotFmts.push(pivotFmt)},setPlotArea:function(plotArea){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_Chart_SetPlotArea,this.plotArea,plotArea));this.plotArea=plotArea;if(plotArea)plotArea.setParent(this)},setPlotVisOnly:function(plotVisOnly){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Chart_SetPlotVisOnly,this.plotVisOnly,plotVisOnly));this.plotVisOnly=plotVisOnly},setShowDLblsOverMax:function(showDLblsOverMax){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_Chart_SetShowDLblsOverMax,this.showDLblsOverMax,showDLblsOverMax));this.showDLblsOverMax=showDLblsOverMax}, setSideWall:function(sideWall){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Chart_SetSideWall,this.sideWall,sideWall));this.sideWall=sideWall},setTitle:function(title){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Chart_SetTitle,this.title,title));this.title=title;if(title)title.setParent(this);if(this.parent)this.parent.handleUpdateInternalChart()},setView3D:function(view3D){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_Chart_SetView3D,this.view3D, view3D));this.view3D=view3D;if(this.parent)this.parent.handleUpdateInternalChart()},setParent:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_CommonChartFormat_SetParent,this.parent,pr));this.parent=pr},reindexSeries:function(){if(this.parent)this.parent.reindexSeries()},reorderSeries:function(){if(this.parent)this.parent.reorderSeries()},moveSeriesUp:function(oSeries){if(this.parent)this.parent.moveSeriesUp(oSeries)},moveSeriesDown:function(oSeries){if(this.parent)this.parent.moveSeriesDown(oSeries)}, onDataUpdate:function(){if(this.parent)this.parent.onDataUpdate()}};function CChartWall(){this.pictureOptions=null;this.spPr=null;this.thickness=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CChartWall.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){},getObjectType:function(){return AscDFH.historyitem_type_ChartWall},createDuplicate:function(){var copy=new CChartWall;if(this.pictureOptions)copy.setPictureOptions(this.pictureOptions.createDuplicate()); if(this.spPr)copy.setSpPr(this.spPr.createDuplicate());if(AscFormat.isRealNumber(this.thickness))copy.setThickness(this.thickness);return copy},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},setPictureOptions:function(pr){History.Add(new CChangesDrawingsObject(this,AscDFH.historyitem_ChartWall_SetPictureOptions,this.pictureOptions,pr));this.pictureOptions=pr},setSpPr:function(pr){History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_ChartWall_SetSpPr,this.spPr,pr));this.spPr=pr;if(this.spPr)this.spPr.setParent(this)},setThickness:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_ChartWall_SetThickness,this.thickness,pr));this.thickness=pr}};function CView3d(){this.depthPercent=null;this.hPercent=null;this.perspective=null;this.rAngAx=null;this.rotX=null;this.rotY=null;this.Id=g_oIdCounter.Get_NewId();g_oTableId.Add(this,this.Id)}CView3d.prototype={Get_Id:function(){return this.Id},Refresh_RecalcData:function(){}, getObjectType:function(){return AscDFH.historyitem_type_View3d},createDuplicate:function(){var c=new CView3d;AscFormat.isRealNumber(this.depthPercent)&&c.setDepthPercent(this.depthPercent);AscFormat.isRealNumber(this.hPercent)&&c.setHPercent(this.hPercent);AscFormat.isRealNumber(this.perspective)&&c.setPerspective(this.perspective);AscFormat.isRealBool(this.rAngAx)&&c.setRAngAx(this.rAngAx);AscFormat.isRealNumber(this.rotX)&&c.setRotX(this.rotX);AscFormat.isRealNumber(this.rotY)&&c.setRotY(this.rotY); return c},Write_ToBinary2:function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},setDepthPercent:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_View3d_SetDepthPercent,this.depthPercent,pr));this.depthPercent=pr},setHPercent:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_View3d_SetHPercent,this.hPercent,pr));this.hPercent=pr},setPerspective:function(pr){History.Add(new CChangesDrawingsLong(this, AscDFH.historyitem_View3d_SetPerspective,this.perspective,pr));this.perspective=pr},setRAngAx:function(pr){History.Add(new CChangesDrawingsBool(this,AscDFH.historyitem_View3d_SetRAngAx,this.rAngAx,pr));this.rAngAx=pr},getRAngAx:function(){if(AscFormat.isRealBool(this.rAngAx))return this.rAngAx;if(AscFormat.isRealNumber(this.perspective))return false;return this.rAngAx!==false},setRotX:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_View3d_SetRotX,this.rotX,pr));this.rotX= pr},setRotY:function(pr){History.Add(new CChangesDrawingsLong(this,AscDFH.historyitem_View3d_SetRotY,this.rotY,pr));this.rotY=pr}};function CreateTextBodyFromString(str,drawingDocument,parent){var tx_body=new AscFormat.CTextBody;tx_body.setParent(parent);tx_body.setBodyPr(new AscFormat.CBodyPr);var old_is_doc_editor=false;if(typeof editor!=="undefined"&&editor&&editor.isDocumentEditor){editor.isDocumentEditor=false;old_is_doc_editor=true}tx_body.setContent(CreateDocContentFromString(str,drawingDocument, tx_body));if(typeof editor!=="undefined"&&editor&&old_is_doc_editor)editor.isDocumentEditor=true;return tx_body}function CreateDocContentFromString(str,drawingDocument,parent){var content=new AscFormat.CDrawingDocContent(parent,drawingDocument,0,0,0,0,false,false,true);AddToContentFromString(content,str);return content}function CheckContentTextAndAdd(oContent,sText){oContent.Set_ApplyToAll(true);var sContentText=oContent.GetSelectedText(false,{NewLine:true,NewParagraph:true});oContent.Set_ApplyToAll(false); if(sContentText!==sText){oContent.ClearContent(true);AddToContentFromString(oContent,sText)}}function AddToContentFromString(content,str){content.MoveCursorToStartPos(false);content.AddText(str)}function CValAxisLabels(chart,axis){this.x=null;this.y=null;this.extX=null;this.extY=null;this.transform=new CMatrix;this.localTransform=new CMatrix;this.aLabels=[];this.chart=chart;this.posX=null;this.posY=null;this.axis=axis}CValAxisLabels.prototype={recalculateExtX:function(){var max_ext_x=0;for(var i= 0;i<this.aLabels.length;++i)if(this.aLabels[i].extX>max_ext_x)max_ext_x=this.aLabels[i].extX;this.extX=max_ext_x},hit:function(x,y){var tx,ty;if(this.chart&&this.chart.invertTransform){tx=this.chart.invertTransform.TransformPointX(x,y);ty=this.chart.invertTransform.TransformPointY(x,y);return tx>=this.x&&ty>=this.y&&tx<=this.x+this.extX&&ty<=this.y+this.extY}return false},getMinWidth:function(){var max_min_width=this.aLabels[0].txBody.content.RecalculateMinMaxContentWidth().Min;for(var i=1;i<this.aLabels.length;++i){var t= this.aLabels[i].txBody.content.RecalculateMinMaxContentWidth().Min;if(t>max_min_width)max_min_width=t}return max_min_width},draw:function(g){if(this.chart);for(var i=0;i<this.aLabels.length;++i)if(this.aLabels[i])this.aLabels[i].draw(g)},setPosition:function(x,y){this.x=x;this.y=y;for(var i=0;i<this.aLabels.length;++i)if(this.aLabels[i]){var lbl=this.aLabels[i];lbl.setPosition(lbl.relPosX+x,lbl.relPosY+y)}},updatePosition:function(x,y){this.posX=x;this.posY=y;this.transform=this.localTransform.CreateDublicate(); global_MatrixTransformer.TranslateAppend(this.transform,x,y);this.invertTransform=global_MatrixTransformer.Invert(this.transform);for(var i=0;i<this.aLabels.length;++i)if(this.aLabels[i])this.aLabels[i].updatePosition(x,y)},checkShapeChildTransform:function(t){this.transform=this.localTransform.CreateDublicate();global_MatrixTransformer.TranslateAppend(this.transform,this.posX,this.posY);this.invertTransform=global_MatrixTransformer.Invert(this.transform);for(var i=0;i<this.aLabels.length;++i)if(this.aLabels[i])this.aLabels[i].checkShapeChildTransform(t)}}; function CalcLegendEntry(legend,chart,idx){this.chart=chart;this.legend=legend;this.idx=idx;this.x=null;this.y=null;this.extX=null;this.extY=null;this.calcMarkerUnion=null;this.txBody=null;this.txPr=null;this.spPr=new AscFormat.CSpPr;this.transform=new CMatrix;this.transformText=new CMatrix;this.contentWidth=0;this.contentHeight=0;this.localTransform=new CMatrix;this.localTransformText=new CMatrix;this.localX=null;this.localY=null;this.recalcInfo={recalcStyle:true}}CalcLegendEntry.prototype={recalculate:function(){}, getStyles:CDLbl.prototype.getStyles,recalculateStyle:CDLbl.prototype.recalculateStyle,Get_Styles:CDLbl.prototype.Get_Styles,Get_Theme:CDLbl.prototype.Get_Theme,Get_ColorMap:CDLbl.prototype.Get_ColorMap,draw:function(g){CShape.prototype.draw.call(this,g);if(this.calcMarkerUnion)this.calcMarkerUnion.draw(g)},isEmptyPlaceholder:function(){return false},updatePosition:CShape.prototype.updatePosition,checkWidhtContent:function(){var par=this.txBody.content.Content[0];var max_width=0;for(var j=0;j<par.Lines.length;++j)if(par.Lines[j].Ranges[0].W> max_width)max_width=par.Lines[j].Ranges[0].W;this.contentWidth=max_width;this.contentHeight=this.txBody.getSummaryHeight()},hit:function(x,y){var tx,ty,oGeometry;if(this.invertTransformText){tx=this.invertTransformText.TransformPointX(x,y);ty=this.invertTransformText.TransformPointY(x,y);if(tx>=0&&tx<=this.contentWidth&&ty>=0&&ty<=this.contentHeight)return true}if(this.chart){var oCanvasHit=this.chart.getCanvasContext();var calcMarkerUnion=this.calcMarkerUnion;if(calcMarkerUnion.marker&&calcMarkerUnion.marker.invertTransform){tx= calcMarkerUnion.marker.invertTransform.TransformPointX(x,y);ty=calcMarkerUnion.marker.invertTransform.TransformPointY(x,y);oGeometry=calcMarkerUnion.marker.spPr.geometry;if(oGeometry.hitInInnerArea(oCanvasHit,tx,ty)||oGeometry.hitInPath(oCanvasHit,tx,ty))return true}if(calcMarkerUnion.lineMarker&&calcMarkerUnion.lineMarker.invertTransform){tx=calcMarkerUnion.lineMarker.invertTransform.TransformPointX(x,y);ty=calcMarkerUnion.lineMarker.invertTransform.TransformPointY(x,y);oGeometry=calcMarkerUnion.lineMarker.spPr.geometry; if(oGeometry.hitInInnerArea(oCanvasHit,tx,ty)||oGeometry.hitInPath(oCanvasHit,tx,ty))return true}}return false}};function CompiledMarker(){this.spPr=new AscFormat.CSpPr;this.x=null;this.y=null;this.extX=null;this.extY=null;this.localX=null;this.localY=null;this.transform=new CMatrix;this.localTransform=new CMatrix;this.pen=null;this.brush=null}CompiledMarker.prototype={draw:CShape.prototype.draw,check_bounds:CShape.prototype.check_bounds,isEmptyPlaceholder:function(){return false}};function CUnionMarker(){this.lineMarker= null;this.marker=null}CUnionMarker.prototype={draw:function(g){this.lineMarker&&this.lineMarker.draw(g);this.marker&&this.marker.draw(g)}};function CreateMarkerGeometryByType(type,src){var ret=new AscFormat.Geometry;var w=43200,h=43200;function AddRect(geom,w,h){geom.AddPathCommand(1,"0","0");geom.AddPathCommand(2,w+"","0");geom.AddPathCommand(2,w+"",h+"");geom.AddPathCommand(2,"0",h+"");geom.AddPathCommand(6)}function AddPlus(geom,w,h){geom.AddPathCommand(0,undefined,"none",undefined,w,h);geom.AddPathCommand(1, w/2+"","0");geom.AddPathCommand(2,w/2+"",h+"");geom.AddPathCommand(1,"0",h/2+"");geom.AddPathCommand(2,w+"",h/2+"")}function AddX(geom,w,h){geom.AddPathCommand(0,undefined,"none",undefined,w,h);geom.AddPathCommand(1,"0","0");geom.AddPathCommand(2,w+"",h+"");geom.AddPathCommand(1,w+"","0");geom.AddPathCommand(2,"0",h+"")}switch(type){case SYMBOL_CIRCLE:{ret.AddPathCommand(0,undefined,undefined,undefined,w,h);ret.AddPathCommand(1,"0",h/2+"");ret.AddPathCommand(3,w/2+"",h/2+"","cd2","cd4");ret.AddPathCommand(3, w/2+"",h/2+"","_3cd4","cd4");ret.AddPathCommand(3,w/2+"",h/2+"","0","cd4");ret.AddPathCommand(3,w/2+"",h/2+"","cd4","cd4");ret.AddPathCommand(6);break}case SYMBOL_DASH:case SYMBOL_DOT:{ret.AddPathCommand(0,undefined,"none",undefined,w,h);ret.AddPathCommand(1,type===SYMBOL_DASH?"0":w/2+"",h/2+"");ret.AddPathCommand(2,w+"",h/2+"");break}case SYMBOL_DIAMOND:{ret.AddPathCommand(0,undefined,undefined,undefined,w,h);ret.AddPathCommand(1,w/2+"","0");ret.AddPathCommand(2,w+"",h/2+"");ret.AddPathCommand(2, w/2+"",h+"");ret.AddPathCommand(2,"0",h/2+"");ret.AddPathCommand(6);break}case SYMBOL_NONE:{break}case SYMBOL_PICTURE:case SYMBOL_SQUARE:{ret.AddPathCommand(0,undefined,undefined,undefined,w,h);AddRect(ret,w,h);break}case SYMBOL_PLUS:{ret.AddPathCommand(0,undefined,undefined,false,w,h);AddRect(ret,w,h);ret.AddPathCommand(0,undefined,"none",false,w,h);AddPlus(ret,w,h);break}case SYMBOL_STAR:{ret.AddPathCommand(0,undefined,undefined,false,w,h);AddRect(ret,w,h);ret.AddPathCommand(0,undefined,"none", false,w,h);AddPlus(ret,w,h);AddX(ret,w,h);break}case SYMBOL_TRIANGLE:{ret.AddPathCommand(0,undefined,undefined,undefined,w,h);ret.AddPathCommand(1,w/2+"","0");ret.AddPathCommand(2,w+"",h+"");ret.AddPathCommand(2,"0",h+"");ret.AddPathCommand(6);break}case SYMBOL_X:{ret.AddPathCommand(0,undefined,undefined,false,w,h);AddRect(ret,w,h);ret.AddPathCommand(0,undefined,"none",false,w,h);AddX(ret,w,h);break}}var ret2=new CompiledMarker;ret2.spPr.geometry=ret;return ret2}window["AscFormat"]=window["AscFormat"]|| {};window["AscFormat"].CDLbl=CDLbl;window["AscFormat"].CPlotArea=CPlotArea;window["AscFormat"].CBarChart=CBarChart;window["AscFormat"].CAreaChart=CAreaChart;window["AscFormat"].CAreaSeries=CAreaSeries;window["AscFormat"].CCatAx=CCatAx;window["AscFormat"].CDateAx=CDateAx;window["AscFormat"].CSerAx=CSerAx;window["AscFormat"].CValAx=CValAx;window["AscFormat"].CBandFmt=CBandFmt;window["AscFormat"].CBarSeries=CBarSeries;window["AscFormat"].CBubbleChart=CBubbleChart;window["AscFormat"].CBubbleSeries=CBubbleSeries; window["AscFormat"].CCat=CCat;window["AscFormat"].CChartText=CChartText;window["AscFormat"].CDLbls=CDLbls;window["AscFormat"].CDPt=CDPt;window["AscFormat"].CDTable=CDTable;window["AscFormat"].CDispUnits=CDispUnits;window["AscFormat"].CDoughnutChart=CDoughnutChart;window["AscFormat"].CErrBars=CErrBars;window["AscFormat"].CLayout=CLayout;window["AscFormat"].CLegend=CLegend;window["AscFormat"].CLegendEntry=CLegendEntry;window["AscFormat"].CLineChart=CLineChart;window["AscFormat"].CLineSeries=CLineSeries; window["AscFormat"].CMarker=CMarker;window["AscFormat"].CMinusPlus=CMinusPlus;window["AscFormat"].CMultiLvlStrCache=CMultiLvlStrCache;window["AscFormat"].CMultiLvlStrRef=CMultiLvlStrRef;window["AscFormat"].CNumRef=CNumRef;window["AscFormat"].CNumericPoint=CNumericPoint;window["AscFormat"].CNumFmt=CNumFmt;window["AscFormat"].CNumLit=CNumLit;window["AscFormat"].COfPieChart=COfPieChart;window["AscFormat"].CPictureOptions=CPictureOptions;window["AscFormat"].CPieChart=CPieChart;window["AscFormat"].CPieSeries= CPieSeries;window["AscFormat"].CPivotFmt=CPivotFmt;window["AscFormat"].CRadarChart=CRadarChart;window["AscFormat"].CRadarSeries=CRadarSeries;window["AscFormat"].CScaling=CScaling;window["AscFormat"].CScatterChart=CScatterChart;window["AscFormat"].CScatterSeries=CScatterSeries;window["AscFormat"].CTx=CTx;window["AscFormat"].CStockChart=CStockChart;window["AscFormat"].CStrCache=CStrCache;window["AscFormat"].CStringPoint=CStringPoint;window["AscFormat"].CStrRef=CStrRef;window["AscFormat"].CSurfaceChart= CSurfaceChart;window["AscFormat"].CSurfaceSeries=CSurfaceSeries;window["AscFormat"].CTitle=CTitle;window["AscFormat"].CTrendLine=CTrendLine;window["AscFormat"].CUpDownBars=CUpDownBars;window["AscFormat"].CYVal=CYVal;window["AscFormat"].CChart=CChart;window["AscFormat"].CChartWall=CChartWall;window["AscFormat"].CView3d=CView3d;window["AscFormat"].CreateTextBodyFromString=CreateTextBodyFromString;window["AscFormat"].CreateDocContentFromString=CreateDocContentFromString;window["AscFormat"].AddToContentFromString= AddToContentFromString;window["AscFormat"].CheckContentTextAndAdd=CheckContentTextAndAdd;window["AscFormat"].CValAxisLabels=CValAxisLabels;window["AscFormat"].CalcLegendEntry=CalcLegendEntry;window["AscFormat"].CUnionMarker=CUnionMarker;window["AscFormat"].CreateMarkerGeometryByType=CreateMarkerGeometryByType;window["AscFormat"].AX_POS_L=AX_POS_L;window["AscFormat"].AX_POS_T=AX_POS_T;window["AscFormat"].AX_POS_R=AX_POS_R;window["AscFormat"].AX_POS_B=AX_POS_B;window["AscFormat"].CROSSES_AUTO_ZERO= CROSSES_AUTO_ZERO;window["AscFormat"].CROSSES_MAX=CROSSES_MAX;window["AscFormat"].CROSSES_MIN=CROSSES_MIN;window["AscFormat"].LBL_ALG_CTR=LBL_ALG_CTR;window["AscFormat"].LBL_ALG_L=LBL_ALG_L;window["AscFormat"].LBL_ALG_R=LBL_ALG_R;window["AscFormat"].TIME_UNIT_DAYS=TIME_UNIT_DAYS;window["AscFormat"].TIME_UNIT_MONTHS=TIME_UNIT_MONTHS;window["AscFormat"].TIME_UNIT_YEARS=TIME_UNIT_YEARS;window["AscFormat"].CROSS_BETWEEN_BETWEEN=CROSS_BETWEEN_BETWEEN;window["AscFormat"].CROSS_BETWEEN_MID_CAT=CROSS_BETWEEN_MID_CAT; window["AscFormat"].SYMBOL_CIRCLE=SYMBOL_CIRCLE;window["AscFormat"].SYMBOL_DASH=SYMBOL_DASH;window["AscFormat"].SYMBOL_DIAMOND=SYMBOL_DIAMOND;window["AscFormat"].SYMBOL_DOT=SYMBOL_DOT;window["AscFormat"].SYMBOL_NONE=SYMBOL_NONE;window["AscFormat"].SYMBOL_PICTURE=SYMBOL_PICTURE;window["AscFormat"].SYMBOL_PLUS=SYMBOL_PLUS;window["AscFormat"].SYMBOL_SQUARE=SYMBOL_SQUARE;window["AscFormat"].SYMBOL_STAR=SYMBOL_STAR;window["AscFormat"].SYMBOL_TRIANGLE=SYMBOL_TRIANGLE;window["AscFormat"].SYMBOL_X=SYMBOL_X; window["AscFormat"].MARKER_SYMBOL_TYPE=MARKER_SYMBOL_TYPE;window["AscFormat"].ORIENTATION_MAX_MIN=ORIENTATION_MAX_MIN;window["AscFormat"].ORIENTATION_MIN_MAX=ORIENTATION_MIN_MAX;window["AscFormat"].fParseChartFormula=fParseChartFormula;window["AscFormat"].fCreateRef=fCreateRef})(window);"use strict";(function(window,undefined){var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var field_type_slidenum=0;var field_type_datetime=1;var field_type_datetime1=2;var field_type_datetime2= 3;var field_type_datetime3=4;var field_type_datetime4=5;var field_type_datetime5=6;var field_type_datetime6=7;var field_type_datetime7=8;var field_type_datetime8=9;var field_type_datetime9=10;var field_type_datetime10=11;var field_type_datetime11=12;var field_type_datetime12=13;var field_type_datetime13=14;var field_months=[];field_months[0]=[];field_months[0][0]="\u044f\u043d\u0432\u0430\u0440\u044f";field_months[0][1]="\u0444\u0435\u0432\u0440\u0430\u043b\u044f";field_months[0][2]="\u043c\u0430\u0440\u0442\u0430"; field_months[0][3]="\u0430\u043f\u0440\u0435\u043b\u044f";field_months[0][4]="\u043c\u0430\u044f";field_months[0][5]="\u0438\u044e\u043d\u044f";field_months[0][6]="\u0438\u044e\u043b\u044f";field_months[0][7]="\u0430\u0432\u0433\u0443\u0441\u0442\u0430";field_months[0][8]="\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f";field_months[0][9]="\u043e\u043a\u0442\u044f\u0431\u0440\u044f";field_months[0][10]="\u043d\u043e\u044f\u0431\u0440\u044f";field_months[0][11]="\u0434\u0435\u043a\u0430\u0431\u0440\u044f"; AscDFH.changesFactory[AscDFH.historyitem_TextBodySetParent]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_TextBodySetBodyPr]=AscDFH.CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_TextBodySetContent]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_TextBodySetLstStyle]=AscDFH.CChangesDrawingsObjectNoId;AscDFH.drawingsChangesMap[AscDFH.historyitem_TextBodySetParent]=function(oClass,value){oClass.parent=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_TextBodySetBodyPr]= function(oClass,value){if(CheckNeedRecalcAutoFit(oClass.bodyPr,value))if(oClass.parent){oClass.parent.recalcInfo.recalculateContent=true;oClass.parent.recalcInfo.recalculateContent2=true;oClass.parent.recalcInfo.recalculateTransformText=true}if(oClass.content)oClass.content.Recalc_AllParagraphs_CompiledPr();oClass.bodyPr=value;oClass.recalcInfo.recalculateBodyPr=true};AscDFH.drawingsChangesMap[AscDFH.historyitem_TextBodySetContent]=function(oClass,value){oClass.content=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_TextBodySetLstStyle]= function(oClass,value){oClass.lstStyle=value};AscDFH.drawingsConstructorsMap[AscDFH.historyitem_TextBodySetBodyPr]=AscFormat.CBodyPr;AscDFH.drawingsConstructorsMap[AscDFH.historyitem_TextBodySetLstStyle]=AscFormat.TextListStyle;function CTextBody(){this.bodyPr=null;this.lstStyle=null;this.content=null;this.parent=null;this.content2=null;this.compiledBodyPr=null;this.parent=null;this.bFit=true;this.recalcInfo={recalculateBodyPr:true,recalculateContent2:true};this.Id=AscCommon.g_oIdCounter.Get_NewId(); AscCommon.g_oTableId.Add(this,this.Id)}CTextBody.prototype={createDuplicate:function(){var ret=new CTextBody;if(this.bodyPr)ret.setBodyPr(this.bodyPr.createDuplicate());if(this.lstStyle)ret.setLstStyle(this.lstStyle.createDuplicate());if(this.content)ret.setContent(this.content.Copy(ret));return ret},createDuplicate2:function(){var ret=new CTextBody;if(this.bodyPr)ret.setBodyPr(this.bodyPr.createDuplicate());if(this.lstStyle)ret.setLstStyle(this.lstStyle.createDuplicate());if(this.content){var bTrackRevision= false;if(typeof editor!=="undefined"&&editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument.TrackRevisions===true){bTrackRevision=true;editor.WordControl.m_oLogicDocument.TrackRevisions=false}ret.setContent(this.content.Copy3(ret));if(bTrackRevision)editor.WordControl.m_oLogicDocument.TrackRevisions=true}return ret},Get_Id:function(){return this.Id},Is_TopDocument:function(){return false},Is_DrawingShape:function(bRetShape){if(bRetShape===true)return this.parent;return true},IsInTable:function(bReturnTopTable){if(true=== bReturnTopTable)return null;return false},Get_Theme:function(){if(this.parent)return this.parent.Get_Theme();return null},Get_ColorMap:function(){if(this.parent)return this.parent.Get_ColorMap();return null},setParent:function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_TextBodySetParent,this.parent,pr));this.parent=pr},setBodyPr:function(pr){History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_TextBodySetBodyPr,this.bodyPr,pr));this.bodyPr=pr;if(this.parent&& this.parent.recalcInfo){this.parent.recalcInfo.recalculateContent=true;this.parent.recalcInfo.recalculateContent2=true;this.parent.recalcInfo.recalculateTransformText=true;if(this.content)this.content.Recalc_AllParagraphs_CompiledPr();if(this.parent.addToRecalculate)this.parent.addToRecalculate()}if(this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.parent&&this.parent.parent.parent.parent.parent&&this.parent.parent.parent.parent.parent.handleUpdateInternalChart&& History.Is_On())this.parent.parent.parent.parent.parent.handleUpdateInternalChart(false)},setContent:function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_TextBodySetContent,this.content,pr));this.content=pr},setLstStyle:function(lstStyle){History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_TextBodySetLstStyle,this.lstStyle,lstStyle));this.lstStyle=lstStyle},getObjectType:function(){return AscDFH.historyitem_type_TextBody},Write_ToBinary2:function(w){w.WriteLong(AscDFH.historyitem_type_TextBody); w.WriteString2(this.Id)},Read_FromBinary2:function(r){this.Id=r.GetString2()},recalculate:function(){},getFieldText:function(fieldType,slide,firstSlideNum){var ret="";if(this.parent&&this.parent.isPlaceholder()){var _ph_type=this.parent.getPlaceholderType();switch(_ph_type){case AscFormat.phType_dt:{var _cur_date=new Date;var _cur_year=_cur_date.getFullYear();var _cur_month=_cur_date.getMonth();var _cur_month_day=_cur_date.getDate();ret+=(_cur_month_day>9?_cur_month_day:"0"+_cur_month_day)+"."+(_cur_month+ 1>9?_cur_month+1:"0"+(_cur_month+1))+"."+_cur_year;break}case AscFormat.phType_sldNum:{var _firstSlideNum=AscFormat.isRealNumber(firstSlideNum)?firstSlideNum:1;if(slide instanceof Slide)ret+=""+(slide.num+_firstSlideNum);break}}}return ret},recalculateBodyPr:function(){AscFormat.ExecuteNoHistory(function(){if(!this.compiledBodyPr)this.compiledBodyPr=new AscFormat.CBodyPr;this.compiledBodyPr.setDefault();if(this.parent&&this.parent.isPlaceholder&&this.parent.isPlaceholder()){var hierarchy=this.parent.getHierarchy(); for(var i=hierarchy.length-1;i>-1;--i)if(isRealObject(hierarchy[i])&&isRealObject(hierarchy[i].txBody)&&isRealObject(hierarchy[i].txBody.bodyPr))this.compiledBodyPr.merge(hierarchy[i].txBody.bodyPr)}if(isRealObject(this.bodyPr))this.compiledBodyPr.merge(this.bodyPr)},this,[])},Check_AutoFit:function(){return this.parent&&this.parent.Check_AutoFit&&this.parent.Check_AutoFit(true)||false},Refresh_RecalcData:function(Data){if(this.parent&&this.parent.recalcInfo){this.parent.recalcInfo.recalculateContent= true;this.parent.recalcInfo.recalculateContent2=true;this.parent.recalcInfo.recalculateTransformText=true;if(this.parent.addToRecalculate)this.parent.addToRecalculate()}if(AscCommon.isRealObject(Data))if(Data.Type===AscDFH.historyitem_TextBodySetBodyPr)this.recalcInfo.recalculateBodyPr=true},isEmpty:function(){return this.content.Is_Empty()},OnContentReDraw:function(){if(this.parent&&this.parent.OnContentReDraw)this.parent.OnContentReDraw()},Get_StartPage_Absolute:function(){return 0},Get_AbsolutePage:function(CurPage){if(this.parent&& this.parent.Get_AbsolutePage)return this.parent.Get_AbsolutePage();return 0},Get_AbsoluteColumn:function(CurPage){return 0},Get_TextBackGroundColor:function(){if(this.parent&&this.parent.Get_TextBackGroundColor)return this.parent.Get_TextBackGroundColor();return undefined},IsHdrFtr:function(bReturnHdrFtr){if(bReturnHdrFtr)return null;return false},IsFootnote:function(bReturnFootnote){if(bReturnFootnote)return null;return false},Get_PageContentStartPos:function(pageNum){return{X:0,Y:0,XLimit:this.contentWidth, YLimit:2E4}},Get_Numbering:function(){return new CNumbering},Set_CurrentElement:function(bUpdate,pageIndex){if(this.parent.Set_CurrentElement)this.parent.Set_CurrentElement(bUpdate,pageIndex)},checkDocContent:function(){this.parent&&this.parent.checkDocContent&&this.parent.checkDocContent()},getBodyPr:function(){if(this.recalcInfo.recalculateBodyPr){this.recalculateBodyPr();this.recalcInfo.recalculateBodyPr=false}return this.compiledBodyPr},getSummaryHeight:function(){return this.content.GetSummaryHeight()}, getSummaryHeight2:function(){return this.content2?this.content2.GetSummaryHeight():0},getSummaryHeight3:function(){if(this.content&&this.content.GetSummaryHeight_)return this.content.GetSummaryHeight_();return 0},getCompiledBodyPr:function(){this.recalculateBodyPr();return this.compiledBodyPr},Get_TableStyleForPara:function(){return null},checkCurrentPlaceholder:function(){return false},draw:function(graphics){if((!this.content||this.content.Is_Empty())&&!AscCommon.IsShapeToImageConverter&&this.parent.isEmptyPlaceholder()&& !this.checkCurrentPlaceholder()){if(graphics.IsNoDrawingEmptyPlaceholder!==true&&graphics.IsNoDrawingEmptyPlaceholderText!==true&&this.content2){if(graphics.IsNoSupportTextDraw){var _w2=this.content2.XLimit;var _h2=this.content2.GetSummaryHeight();graphics.rect(this.content2.X,this.content2.Y,_w2,_h2)}this.content2.Set_StartPage(0);this.content2.Draw(0,graphics)}}else if(this.content){if(graphics.IsNoSupportTextDraw){var bEmpty=this.content.IsEmpty();var _w=bEmpty?.1:this.content.XLimit;var _h=this.content.GetSummaryHeight(); graphics.rect(this.content.X,this.content.Y,_w,_h)}var old_start_page=this.content.StartPage;this.content.Set_StartPage(0);this.content.Draw(0,graphics);this.content.Set_StartPage(old_start_page)}},Get_Styles:function(level){if(this.parent&&this.parent.getStyles)return this.parent.getStyles(level);return AscFormat.ExecuteNoHistory(function(){var oStyles=new CStyles(false);var Style_Para_Def=new CStyle("Normal",null,null,styletype_Paragraph);Style_Para_Def.CreateNormal();oStyles.Default.Paragraph= oStyles.Add(Style_Para_Def);return{styles:oStyles,lastId:oStyles.Default.Paragraph}},this,[])},IsCell:function(isReturnCell){if(true===isReturnCell)return null;return false},OnContentRecalculate:function(){},getMargins:function(){var _parent_transform=this.parent.transform;var _l;var _r;var _b;var _t;var _body_pr=this.getBodyPr();var sp=this.parent;if(isRealObject(sp.spPr)&&isRealObject(sp.spPr.geometry)&&isRealObject(sp.spPr.geometry.rect)){var _rect=sp.spPr.geometry.rect;_l=_rect.l+_body_pr.lIns; _t=_rect.t+_body_pr.tIns;_r=_rect.r-_body_pr.rIns;_b=_rect.b-_body_pr.bIns}else{_l=_body_pr.lIns;_t=_body_pr.tIns;_r=sp.extX-_body_pr.rIns;_b=sp.extY-_body_pr.bIns}var x_lt,y_lt,x_rb,y_rb;x_lt=_parent_transform.TransformPointX(_l,_t);y_lt=_parent_transform.TransformPointY(_l,_t);x_rb=_parent_transform.TransformPointX(_r,_b);y_rb=_parent_transform.TransformPointY(_r,_b);var hc=(_r-_l)/2;var vc=(_b-_t)/2;var xc=(x_lt+x_rb)/2;var yc=(y_lt+y_rb)/2;return{L:xc-hc,T:yc-vc,R:xc+hc,B:yc+vc,textMatrix:this.parent.transform}}, Refresh_RecalcData2:function(pageIndex){this.parent&&this.parent.Refresh_RecalcData2&&this.parent.Refresh_RecalcData2(pageIndex,this)},checkContentFit:function(sText){var oContent=this.content;if(!oContent.Is_Empty()){var oFirstPara=oContent.Content[0];oFirstPara.Content=[oFirstPara.Content[oFirstPara.Content.length-1]]}AscFormat.AddToContentFromString(oContent,sText);AscFormat.CShape.prototype.recalculateContent.call(this.parent);var oFirstParagraph=oContent.Content[0];return oFirstParagraph.Lines.length=== 1},recalculateOneString:function(sText){if(this.checkContentFit(sText)){this.bFit=true;return}this.bFit=false;var nLeftPos=0,nRightPos=sText.length;var nMiddlePos;var sEnd="...";var sFitText=sText+sEnd;while(nRightPos-nLeftPos>1){nMiddlePos=(nRightPos+nLeftPos)/2+.5>>0;sFitText=sText.slice(0,nMiddlePos-1);sFitText+=sEnd;if(!this.checkContentFit(sFitText))nRightPos=nMiddlePos;else nLeftPos=nMiddlePos}sFitText=sText.slice(0,nLeftPos-1);sFitText+=sEnd;if(!this.checkContentFit(sFitText)){var bFound=false; for(var i=sEnd.length-1;i>-1;i--){sFitText=sEnd.slice(0,i);if(this.checkContentFit(sFitText)){bFound=true;break}}if(!bFound)this.checkContentFit("")}},getContentOneStringSizes:function(){return GetContentOneStringSizes(this.content)},recalculateByMaxWord:function(){var max_content=this.content.RecalculateMinMaxContentWidth().Max;this.content.Set_ApplyToAll(true);this.content.SetParagraphAlign(AscCommon.align_Center);this.content.Set_ApplyToAll(false);this.content.Reset(0,0,max_content,2E4);this.content.Recalculate_Page(0, true);return{w:max_content,h:this.content.GetSummaryHeight()}},GetFirstElementInNextCell:function(){return null},GetLastElementInPrevCell:function(){return null},getRectWidth:function(maxWidth){var body_pr=this.getBodyPr();var r_ins=body_pr.rIns;var l_ins=body_pr.lIns;var max_content_width=maxWidth-r_ins-l_ins;this.content.Reset(0,0,max_content_width,2E4);this.content.Recalculate_Page(0,true);var max_width=0;for(var i=0;i<this.content.Content.length;++i){var par=this.content.Content[i];for(var j= 0;j<par.Lines.length;++j)if(par.Lines[j].Ranges[0].W>max_width)max_width=par.Lines[j].Ranges[0].W}return max_width+2+r_ins+l_ins},getMaxContentWidth:function(maxWidth,bLeft){this.content.Reset(0,0,maxWidth-.01,2E4);if(bLeft){this.content.Set_ApplyToAll(true);this.content.SetParagraphAlign(AscCommon.align_Left);this.content.Set_ApplyToAll(false)}this.content.Recalculate_Page(0,true);var max_width=0,arr_content=this.content.Content,paragraph_lines,i,j;for(i=0;i<arr_content.length;++i){paragraph_lines= arr_content[i].Lines;for(j=0;j<paragraph_lines.length;++j)if(paragraph_lines[j].Ranges[0].W>max_width)max_width=paragraph_lines[j].Ranges[0].W}return max_width+.01},GetPrevElementEndInfo:function(CurElement){return null},Is_UseInDocument:function(Id){if(Id!=undefined)if(!this.content||this.content.Get_Id()!==Id)return false;if(this.parent&&this.parent.Is_UseInDocument)return this.parent.Is_UseInDocument();return false},Get_ParentTextTransform:function(){if(this.parent&&this.parent.transformText)return this.parent.transformText.CreateDublicate(); return null},Is_ThisElementCurrent:function(){if(this.parent&&this.parent.Is_ThisElementCurrent)return this.parent.Is_ThisElementCurrent();return false}};function CalculateReductionParams(oBodyPrHolder,oContent){if(!oBodyPrHolder||!oContent)return;var oBodyPr=oBodyPrHolder.bodyPr?oBodyPrHolder.bodyPr.createDuplicate():new AscFormat.CBodyPr;return oBodyPr}function GetContentOneStringSizes(oContent){oContent.Reset(0,0,2E4,2E4);oContent.Recalculate_Page(0,true);return{w:oContent.Content[0].Lines[0].Ranges[0].W+ .1,h:oContent.GetSummaryHeight()+.1}}function CheckNeedRecalcAutoFit(oBP1,oBP2){if(AscCommon.isFileBuild())return false;var oTF1=oBP1&&oBP1.textFit;var oTF2=oBP2&&oBP2.textFit;var oTFType1=oTF1&&oTF1.type||0;var oTFType2=oTF2&&oTF2.type||0;if(oTFType1===AscFormat.text_fit_NormAuto&&oTFType2===AscFormat.text_fit_NormAuto)return oTF1.lnSpcReduction!==oTF2.lnSpcReduction||oTF1.fontScale!==oTF2.fontScale;return oTFType1===AscFormat.text_fit_NormAuto||oTFType2===AscFormat.text_fit_NormAuto}window["AscFormat"]= window["AscFormat"]||{};window["AscFormat"].GetContentOneStringSizes=GetContentOneStringSizes;window["AscFormat"].CTextBody=CTextBody;window["AscFormat"].CheckNeedRecalcAutoFit=CheckNeedRecalcAutoFit})(window);"use strict";(function(window,undefined){var CShape=AscFormat.CShape;var HitInLine=AscFormat.HitInLine;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;window["AscDFH"].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSpPr]=function(oClass,value){oClass.spPr=value}; window["AscDFH"].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetGraphicObject]=function(oClass,value){oClass.graphicObject=value;if(value){value.Parent=oClass;oClass.graphicObject.Index=0}};window["AscDFH"].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSetNvSpPr]=function(oClass,value){oClass.nvGraphicFramePr=value};window["AscDFH"].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSetParent]=function(oClass,value){oClass.parent=value};window["AscDFH"].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSetGroup]= function(oClass,value){oClass.group=value};AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSpPr]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetGraphicObject]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSetNvSpPr]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSetParent]=AscDFH.CChangesDrawingsObject;AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSetGroup]=AscDFH.CChangesDrawingsObject; function CGraphicFrame(){AscFormat.CGraphicObjectBase.call(this);this.graphicObject=null;this.nvGraphicFramePr=null;this.compiledHierarchy=[];this.Pages=[];this.compiledStyles=[];this.recalcInfo={recalculateTransform:true,recalculateSizes:true,recalculateNumbering:true,recalculateShapeHierarchy:true,recalculateTable:true};this.RecalcInfo={}}CGraphicFrame.prototype=Object.create(AscFormat.CGraphicObjectBase.prototype);CGraphicFrame.prototype.constructor=CGraphicFrame;CGraphicFrame.prototype.addToRecalculate= CShape.prototype.addToRecalculate;CGraphicFrame.prototype.Get_Theme=CShape.prototype.Get_Theme;CGraphicFrame.prototype.Get_ColorMap=CShape.prototype.Get_ColorMap;CGraphicFrame.prototype.setBDeleted=CShape.prototype.setBDeleted;CGraphicFrame.prototype.getBase64Img=CShape.prototype.getBase64Img;CGraphicFrame.prototype.checkDrawingBaseCoords=CShape.prototype.checkDrawingBaseCoords;CGraphicFrame.prototype.getSlideIndex=CShape.prototype.getSlideIndex;CGraphicFrame.prototype.Is_UseInDocument=CShape.prototype.Is_UseInDocument; CGraphicFrame.prototype.convertPixToMM=CShape.prototype.convertPixToMM;CGraphicFrame.prototype.hit=CShape.prototype.hit;CGraphicFrame.prototype.GetDocumentPositionFromObject=function(arrPos){if(!arrPos)arrPos=[];return arrPos};CGraphicFrame.prototype.Is_DrawingShape=function(bRetShape){if(bRetShape===true)return null;return false};CGraphicFrame.prototype.handleUpdatePosition=function(){this.recalcInfo.recalculateTransform=true;this.addToRecalculate()};CGraphicFrame.prototype.handleUpdateTheme=function(){this.compiledStyles= [];if(this.graphicObject){this.graphicObject.Recalc_CompiledPr2();this.graphicObject.RecalcInfo.Recalc_AllCells();this.recalcInfo.recalculateSizes=true;this.recalcInfo.recalculateShapeHierarchy=true;this.recalcInfo.recalculateTable=true;this.addToRecalculate()}};CGraphicFrame.prototype.handleUpdateFill=function(){};CGraphicFrame.prototype.handleUpdateLn=function(){};CGraphicFrame.prototype.handleUpdateExtents=function(){this.recalcInfo.recalculateTransform=true;this.addToRecalculate()};CGraphicFrame.prototype.recalcText= function(){this.compiledStyles=[];if(this.graphicObject){this.graphicObject.Recalc_CompiledPr2();this.graphicObject.RecalcInfo.Reset(true)}this.recalcInfo.recalculateTable=true;this.recalcInfo.recalculateSizes=true};CGraphicFrame.prototype.Get_TextBackGroundColor=function(){return undefined};CGraphicFrame.prototype.GetPrevElementEndInfo=function(){return null};CGraphicFrame.prototype.Get_PageFields=function(){return editor.WordControl.m_oLogicDocument.Get_PageFields()};CGraphicFrame.prototype.Get_ParentTextTransform= function(){return this.transformText};CGraphicFrame.prototype.getDocContent=function(){if(this.graphicObject&&this.graphicObject.CurCell&&(false===this.graphicObject.Selection.Use||true===this.graphicObject.Selection.Use&&table_Selection_Text===this.graphicObject.Selection.Type))return this.graphicObject.CurCell.Content;return null};CGraphicFrame.prototype.setSpPr=function(spPr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GraphicFrameSetSpPr,this.spPr,spPr));this.spPr=spPr}; CGraphicFrame.prototype.setGraphicObject=function(graphicObject){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GraphicFrameSetGraphicObject,this.graphicObject,graphicObject));this.graphicObject=graphicObject;if(this.graphicObject){this.graphicObject.Index=0;this.graphicObject.Parent=this}};CGraphicFrame.prototype.setNvSpPr=function(pr){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GraphicFrameSetSetNvSpPr,this.nvGraphicFramePr,pr));this.nvGraphicFramePr= pr};CGraphicFrame.prototype.setParent=function(parent){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GraphicFrameSetSetParent,this.parent,parent));this.parent=parent};CGraphicFrame.prototype.setGroup=function(group){History.Add(new AscDFH.CChangesDrawingsObject(this,AscDFH.historyitem_GraphicFrameSetSetGroup,this.group,group));this.group=group};CGraphicFrame.prototype.getObjectType=function(){return AscDFH.historyitem_type_GraphicFrame};CGraphicFrame.prototype.Search=function(Str, Props,SearchEngine,Type){if(this.graphicObject)this.graphicObject.Search(Str,Props,SearchEngine,Type)};CGraphicFrame.prototype.GetSearchElementId=function(bNext,bCurrent){if(this.graphicObject)return this.graphicObject.GetSearchElementId(bNext,bCurrent);return null};CGraphicFrame.prototype.copy=function(oPr){var ret=new CGraphicFrame;if(this.graphicObject){ret.setGraphicObject(this.graphicObject.Copy(ret));if(editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument&&isRealObject(editor.WordControl.m_oLogicDocument.globalTableStyles))ret.graphicObject.Reset(0, 0,this.graphicObject.XLimit,this.graphicObject.YLimit,ret.graphicObject.PageNum)}if(this.nvGraphicFramePr)ret.setNvSpPr(this.nvGraphicFramePr.createDuplicate());if(this.spPr){ret.setSpPr(this.spPr.createDuplicate());ret.spPr.setParent(ret)}ret.setBDeleted(false);if(!this.recalcInfo.recalculateTable&&!this.recalcInfo.recalculateSizes&&!this.recalcInfo.recalculateTransform){ret.cachedImage=this.getBase64Img();ret.cachedPixW=this.cachedPixW;ret.cachedPixH=this.cachedPixH}return ret};CGraphicFrame.prototype.getAllFonts= function(fonts){if(this.graphicObject){for(var i=0;i<this.graphicObject.Content.length;++i){var row=this.graphicObject.Content[i];var cells=row.Content;for(var j=0;j<cells.length;++j)cells[j].Content.Document_Get_AllFontNames(fonts)}delete fonts["+mj-lt"];delete fonts["+mn-lt"];delete fonts["+mj-ea"];delete fonts["+mn-ea"];delete fonts["+mj-cs"];delete fonts["+mn-cs"]}};CGraphicFrame.prototype.MoveCursorToStartPos=function(){if(isRealObject(this.graphicObject)){this.graphicObject.MoveCursorToStartPos(); this.graphicObject.RecalculateCurPos()}};CGraphicFrame.prototype.MoveCursorToEndPos=function(){if(isRealObject(this.graphicObject)){this.graphicObject.MoveCursorToEndPos();this.graphicObject.RecalculateCurPos()}};CGraphicFrame.prototype.hitInPath=function(){return false};CGraphicFrame.prototype.paragraphFormatPaste=function(CopyTextPr,CopyParaPr,Bool){if(isRealObject(this.graphicObject)){this.graphicObject.PasteFormatting(CopyTextPr,CopyParaPr,Bool);this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateTransformText= true;editor.WordControl.m_oLogicDocument.recalcMap[this.Id]=this}};CGraphicFrame.prototype.ClearParagraphFormatting=function(isClearParaPr,isClearTextPr){if(isRealObject(this.graphicObject)){this.graphicObject.ClearParagraphFormatting(isClearParaPr,isClearTextPr);this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateTransformText=true;editor.WordControl.m_oLogicDocument.recalcMap[this.Id]=this}};CGraphicFrame.prototype.Set_Props=function(props){if(this.graphicObject){var bApplyToAll= this.parent.graphicObjects.State.textObject!==this;this.graphicObject.Set_Props(props,bApplyToAll);this.OnContentRecalculate();editor.WordControl.m_oLogicDocument.recalcMap[this.Id]=this}};CGraphicFrame.prototype.updateCursorType=function(x,y,e){var tx=this.invertTransform.TransformPointX(x,y);var ty=this.invertTransform.TransformPointY(x,y);this.graphicObject.UpdateCursorType(tx,ty,0)};CGraphicFrame.prototype.getIsSingleBody=CShape.prototype.getIsSingleBody;CGraphicFrame.prototype.getHierarchy=CShape.prototype.getHierarchy; CGraphicFrame.prototype.getAllImages=function(images){};CGraphicFrame.prototype.recalculateTable=function(){if(this.graphicObject){this.graphicObject.Set_PositionH(Asc.c_oAscHAnchor.Page,false,0,false);this.graphicObject.Set_PositionV(Asc.c_oAscVAnchor.Page,false,0,false);this.graphicObject.Parent=this;this.graphicObject.Reset(0,0,this.extX,1E4,0);this.graphicObject.Recalculate_Page(0)}};CGraphicFrame.prototype.recalculate=function(){if(this.bDeleted||!this.parent)return;AscFormat.ExecuteNoHistory(function(){if(this.recalcInfo.recalculateTransform){this.recalculateTransform(); this.recalculateSnapArrays();this.recalcInfo.recalculateTransform=false;this.transformText=this.transform;this.invertTransformText=this.invertTransform;this.cachedImage=null;this.recalcInfo.recalculateSizes=true}if(this.recalcInfo.recalculateTable){this.recalculateTable();this.recalcInfo.recalculateTable=false}if(this.recalcInfo.recalculateSizes){this.recalculateSizes();this.recalcInfo.recalculateSizes=false;this.bounds.l=this.x;this.bounds.t=this.y;this.bounds.r=this.x+this.extX;this.bounds.b=this.y+ this.extY;this.bounds.x=this.x;this.bounds.y=this.y;this.bounds.w=this.extX;this.bounds.h=this.extY}},this,[])};CGraphicFrame.prototype.recalculateSizes=function(){if(this.graphicObject){this.graphicObject.XLimit-=this.graphicObject.X;this.graphicObject.X=0;this.graphicObject.Y=0;this.graphicObject.X_origin=0;var _page_bounds=this.graphicObject.Get_PageBounds(0);this.extX=_page_bounds.Right-_page_bounds.Left;this.extY=_page_bounds.Bottom-_page_bounds.Top}};CGraphicFrame.prototype.IsSelectedSingleElement= function(){return true};CGraphicFrame.prototype.recalculateCurPos=function(){this.graphicObject.RecalculateCurPos()};CGraphicFrame.prototype.isShape=function(){return false};CGraphicFrame.prototype.isImage=function(){return false};CGraphicFrame.prototype.isGroup=function(){return false};CGraphicFrame.prototype.isChart=function(){return false};CGraphicFrame.prototype.isTable=function(){return this.graphicObject instanceof CTable};CGraphicFrame.prototype.CanAddHyperlink=function(bCheck){if(this.graphicObject)return this.graphicObject.CanAddHyperlink(bCheck); return false};CGraphicFrame.prototype.IsCursorInHyperlink=function(bCheck){if(this.graphicObject)return this.graphicObject.IsCursorInHyperlink(bCheck);return false};CGraphicFrame.prototype.getTransformMatrix=function(){return this.transform;if(this.recalcInfo.recalculateTransform){this.recalculateTransform();this.recalcInfo.recalculateTransform=false}return this.transform};CGraphicFrame.prototype.OnContentReDraw=function(){};CGraphicFrame.prototype.getRectBounds=function(){var transform=this.getTransformMatrix(); var w=this.extX;var h=this.extY;var rect_points=[{x:0,y:0},{x:w,y:0},{x:w,y:h},{x:0,y:h}];var min_x,max_x,min_y,max_y;min_x=transform.TransformPointX(rect_points[0].x,rect_points[0].y);min_y=transform.TransformPointY(rect_points[0].x,rect_points[0].y);max_x=min_x;max_y=min_y;var cur_x,cur_y;for(var i=1;i<4;++i){cur_x=transform.TransformPointX(rect_points[i].x,rect_points[i].y);cur_y=transform.TransformPointY(rect_points[i].x,rect_points[i].y);if(cur_x<min_x)min_x=cur_x;if(cur_x>max_x)max_x=cur_x; if(cur_y<min_y)min_y=cur_y;if(cur_y>max_y)max_y=cur_y}return{minX:min_x,maxX:max_x,minY:min_y,maxY:max_y}};CGraphicFrame.prototype.changeSize=function(kw,kh){if(this.spPr&&this.spPr.xfrm&&this.spPr.xfrm.isNotNull()){var xfrm=this.spPr.xfrm;xfrm.setOffX(xfrm.offX*kw);xfrm.setOffY(xfrm.offY*kh)}this.recalcTransform&&this.recalcTransform()};CGraphicFrame.prototype.recalcTransform=function(){this.recalcInfo.recalculateTransform=true};CGraphicFrame.prototype.getTransform=function(){if(this.recalcInfo.recalculateTransform){this.recalculateTransform(); this.recalcInfo.recalculateTransform=false}return{x:this.x,y:this.y,extX:this.extX,extY:this.extY,rot:this.rot,flipH:this.flipH,flipV:this.flipV}};CGraphicFrame.prototype.canRotate=function(){return false};CGraphicFrame.prototype.canGroup=function(){return false};CGraphicFrame.prototype.createRotateTrack=function(){return new AscFormat.RotateTrackShapeImage(this)};CGraphicFrame.prototype.createResizeTrack=function(cardDirection){return new AscFormat.ResizeTrackShapeImage(this,cardDirection)};CGraphicFrame.prototype.createMoveTrack= function(){return new AscFormat.MoveShapeImageTrack(this)};CGraphicFrame.prototype.getSnapArrays=function(snapX,snapY){var transform=this.getTransformMatrix();snapX.push(transform.tx);snapX.push(transform.tx+this.extX*.5);snapX.push(transform.tx+this.extX);snapY.push(transform.ty);snapY.push(transform.ty+this.extY*.5);snapY.push(transform.ty+this.extY)};CGraphicFrame.prototype.hitInInnerArea=function(x,y){var invert_transform=this.getInvertTransform();if(!invert_transform)return false;var x_t=invert_transform.TransformPointX(x, y);var y_t=invert_transform.TransformPointY(x,y);return x_t>0&&x_t<this.extX&&y_t>0&&y_t<this.extY};CGraphicFrame.prototype.hitInTextRect=function(x,y){return this.hitInInnerArea(x,y)};CGraphicFrame.prototype.getInvertTransform=function(){if(this.recalcInfo.recalculateTransform)this.recalculateTransform();return this.invertTransform};CGraphicFrame.prototype.hitInBoundingRect=function(x,y){var invert_transform=this.getInvertTransform();if(!invert_transform)return false;var x_t=invert_transform.TransformPointX(x, y);var y_t=invert_transform.TransformPointY(x,y);var _hit_context=this.getParentObjects().presentation.DrawingDocument.CanvasHitContext;return HitInLine(_hit_context,x_t,y_t,0,0,this.extX,0)||HitInLine(_hit_context,x_t,y_t,this.extX,0,this.extX,this.extY)||HitInLine(_hit_context,x_t,y_t,this.extX,this.extY,0,this.extY)||HitInLine(_hit_context,x_t,y_t,0,this.extY,0,0)};CGraphicFrame.prototype.Document_UpdateRulersState=function(margins){if(this.graphicObject)this.graphicObject.Document_UpdateRulersState(this.parent.num)}; CGraphicFrame.prototype.Get_PageLimits=function(PageIndex){return{X:0,Y:0,XLimit:Page_Width,YLimit:Page_Height}};CGraphicFrame.prototype.getParentObjects=CShape.prototype.getParentObjects;CGraphicFrame.prototype.IsHdrFtr=function(bool){if(bool)return null;return false};CGraphicFrame.prototype.IsFootnote=function(bReturnFootnote){if(bReturnFootnote)return null;return false};CGraphicFrame.prototype.IsTableCellContent=function(isReturnCell){if(true===isReturnCell)return null;return false};CGraphicFrame.prototype.Check_AutoFit= function(){return false};CGraphicFrame.prototype.IsInTable=function(){return null};CGraphicFrame.prototype.selectionSetStart=function(e,x,y,slideIndex){if(AscCommon.g_mouse_button_right===e.Button){this.rightButtonFlag=true;return}if(isRealObject(this.graphicObject)){var tx,ty;tx=this.invertTransform.TransformPointX(x,y);ty=this.invertTransform.TransformPointY(x,y);if(AscCommon.g_mouse_event_type_down===e.Type)if(this.graphicObject.IsTableBorder(tx,ty,0))if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Drawing_Props)!== false)return;else;if(!e.ShiftKey){if(editor.WordControl.m_oLogicDocument.CurPosition){editor.WordControl.m_oLogicDocument.CurPosition.X=tx;editor.WordControl.m_oLogicDocument.CurPosition.Y=ty}this.graphicObject.Selection_SetStart(tx,ty,this.parent.num,e)}else{if(!this.graphicObject.IsSelectionUse())this.graphicObject.StartSelectionFromCurPos();this.graphicObject.Selection_SetEnd(tx,ty,this.parent.num,e)}this.graphicObject.RecalculateCurPos();return}};CGraphicFrame.prototype.selectionSetEnd=function(e, x,y,slideIndex){if(AscCommon.g_mouse_event_type_move===e.Type)this.rightButtonFlag=false;if(this.rightButtonFlag&&AscCommon.g_mouse_event_type_up===e.Type){this.rightButtonFlag=false;return}if(isRealObject(this.graphicObject)){var tx,ty;tx=this.invertTransform.TransformPointX(x,y);ty=this.invertTransform.TransformPointY(x,y);this.graphicObject.Selection_SetEnd(tx,ty,0,e)}};CGraphicFrame.prototype.updateSelectionState=function(){if(isRealObject(this.graphicObject)){var drawingDocument=this.parent.presentation.DrawingDocument; var Doc=this.graphicObject;if(true===Doc.IsSelectionUse()&&!Doc.IsSelectionEmpty()){drawingDocument.UpdateTargetTransform(this.transform);drawingDocument.TargetEnd();drawingDocument.SelectEnabled(true);drawingDocument.SelectClear();Doc.DrawSelectionOnPage(0);drawingDocument.SelectShow()}else{drawingDocument.SelectEnabled(false);Doc.RecalculateCurPos();drawingDocument.UpdateTargetTransform(this.transform);drawingDocument.TargetShow()}}else{this.parent.presentation.DrawingDocument.UpdateTargetTransform(null); this.parent.presentation.DrawingDocument.TargetEnd();this.parent.presentation.DrawingDocument.SelectEnabled(false);this.parent.presentation.DrawingDocument.SelectClear();this.parent.presentation.DrawingDocument.SelectShow()}};CGraphicFrame.prototype.Get_AbsolutePage=function(CurPage){return this.Get_StartPage_Absolute()};CGraphicFrame.prototype.Get_AbsoluteColumn=function(CurPage){return 0};CGraphicFrame.prototype.Is_TopDocument=function(){return false};CGraphicFrame.prototype.GetTopElement=function(){return null}; CGraphicFrame.prototype.drawAdjustments=function(){};CGraphicFrame.prototype.recalculateTransform=CShape.prototype.recalculateTransform;CGraphicFrame.prototype.recalculateLocalTransform=CShape.prototype.recalculateLocalTransform;CGraphicFrame.prototype.deleteDrawingBase=CShape.prototype.deleteDrawingBase;CGraphicFrame.prototype.addToDrawingObjects=CShape.prototype.addToDrawingObjects;CGraphicFrame.prototype.select=CShape.prototype.select;CGraphicFrame.prototype.deselect=CShape.prototype.deselect; CGraphicFrame.prototype.Update_ContentIndexing=function(){};CGraphicFrame.prototype.GetTopDocumentContent=function(isOneLevel){return null};CGraphicFrame.prototype.GetElement=function(nIndex){return this.graphicObject};CGraphicFrame.prototype.draw=function(graphics){if(graphics.IsSlideBoundsCheckerType===true){graphics.transform3(this.transform);graphics._s();graphics._m(0,0);graphics._l(this.extX,0);graphics._l(this.extX,this.extY);graphics._l(0,this.extY);graphics._e();return}if(this.graphicObject){graphics.SaveGrState(); graphics.transform3(this.transform);graphics.SetIntegerGrid(true);this.graphicObject.Draw(0,graphics);this.drawLocks(this.transform,graphics);graphics.RestoreGrState()}};CGraphicFrame.prototype.Select=function(){};CGraphicFrame.prototype.Set_CurrentElement=function(){if(this.parent&&this.parent.graphicObjects){this.parent.graphicObjects.resetSelection(true);if(this.group){var main_group=this.group.getMainGroup();this.parent.graphicObjects.selectObject(main_group,0);main_group.selectObject(this,0); main_group.selection.textSelection=this}else{this.parent.graphicObjects.selectObject(this,0);this.parent.graphicObjects.selection.textSelection=this}if(editor.WordControl.m_oLogicDocument.CurPage!==this.parent.num){editor.WordControl.m_oLogicDocument.Set_CurPage(this.parent.num);editor.WordControl.GoToPage(this.parent.num)}}};CGraphicFrame.prototype.OnContentRecalculate=function(){this.recalcInfo.recalculateSizes=true;this.recalcInfo.recalculateTransform=true;editor.WordControl.m_oLogicDocument.Document_UpdateRulersState()}; CGraphicFrame.prototype.getTextSelectionState=function(){return this.graphicObject.GetSelectionState()};CGraphicFrame.prototype.setTextSelectionState=function(Sate){return this.graphicObject.SetSelectionState(Sate,Sate.length-1)};CGraphicFrame.prototype.isPlaceholder=function(){return this.nvGraphicFramePr&&this.nvGraphicFramePr.nvPr&&this.nvGraphicFramePr.nvPr.ph!==null};CGraphicFrame.prototype.getPhType=function(){if(this.isPlaceholder())return this.nvGraphicFramePr.nvPr.ph.type;return null};CGraphicFrame.prototype.getPhIndex= function(){if(this.isPlaceholder())return this.nvGraphicFramePr.nvPr.ph.idx;return null};CGraphicFrame.prototype.getPlaceholderType=function(){return this.getPhType()};CGraphicFrame.prototype.getPlaceholderIndex=function(){return this.getPhIndex()};CGraphicFrame.prototype.paragraphAdd=function(paraItem,bRecalculate){};CGraphicFrame.prototype.applyTextFunction=function(docContentFunction,tableFunction,args){if(tableFunction===CTable.prototype.AddToParagraph){if((args[0].Type===para_NewLine||args[0].Type=== para_Text||args[0].Type===para_Space||args[0].Type===para_Tab||args[0].Type===para_PageNum)&&this.graphicObject.Selection.Use)this.graphicObject.Remove(1,true,undefined,true)}else if(tableFunction===CTable.prototype.AddNewParagraph)this.graphicObject.Selection.Use&&this.graphicObject.Remove(1,true,undefined,true);tableFunction.apply(this.graphicObject,args)};CGraphicFrame.prototype.remove=function(Count,bOnlyText,bRemoveOnlySelection,bOnTextAdd,isWord){this.graphicObject.Remove(Count,bOnlyText,bRemoveOnlySelection, bOnTextAdd,isWord);this.recalcInfo.recalculateSizes=true;this.recalcInfo.recalculateTransform=true};CGraphicFrame.prototype.addNewParagraph=function(){this.graphicObject.AddNewParagraph(false);this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateTransformText=true};CGraphicFrame.prototype.setParagraphAlign=function(val){if(isRealObject(this.graphicObject)){this.graphicObject.SetParagraphAlign(val);this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateTransform=true}};CGraphicFrame.prototype.applyAllAlign= function(val){if(isRealObject(this.graphicObject)){this.graphicObject.Set_ApplyToAll(true);this.graphicObject.SetParagraphAlign(val);this.graphicObject.Set_ApplyToAll(false)}};CGraphicFrame.prototype.setParagraphSpacing=function(val){if(isRealObject(this.graphicObject))this.graphicObject.SetParagraphSpacing(val)};CGraphicFrame.prototype.applyAllSpacing=function(val){if(isRealObject(this.graphicObject)){this.graphicObject.Set_ApplyToAll(true);this.graphicObject.SetParagraphSpacing(val);this.graphicObject.Set_ApplyToAll(false)}}; CGraphicFrame.prototype.setParagraphNumbering=function(val){if(isRealObject(this.graphicObject))this.graphicObject.SetParagraphNumbering(val)};CGraphicFrame.prototype.setParagraphIndent=function(val){if(isRealObject(this.graphicObject))this.graphicObject.SetParagraphIndent(val)};CGraphicFrame.prototype.setWordFlag=function(bPresentation,Document){if(this.graphicObject){this.graphicObject.bPresentation=bPresentation;for(var i=0;i<this.graphicObject.Content.length;++i){var row=this.graphicObject.Content[i]; for(var j=0;j<row.Content.length;++j){var content=row.Content[j].Content;if(!bPresentation&&Document)content.Styles=Document.Styles;else content.Styles=null;content.bPresentation=bPresentation;for(var k=0;k<content.Content.length;++k)content.Content[k].bFromDocument=!bPresentation}}}};CGraphicFrame.prototype.Get_Styles=function(level){if(AscFormat.isRealNumber(level)){if(!this.compiledStyles[level])CShape.prototype.recalculateTextStyles.call(this,level);return this.compiledStyles[level]}else return editor.WordControl.m_oLogicDocument.globalTableStyles}; CGraphicFrame.prototype.Get_StartPage_Absolute=function(){if(this.parent)return this.parent.num;return 0};CGraphicFrame.prototype.Get_PageContentStartPos=function(PageNum){var presentation=editor.WordControl.m_oLogicDocument;return{X:0,XLimit:presentation.Width,Y:0,YLimit:presentation.Height,MaxTopBorder:0}};CGraphicFrame.prototype.Get_PageContentStartPos2=function(){return this.Get_PageContentStartPos()};CGraphicFrame.prototype.Refresh_RecalcData=function(){this.Refresh_RecalcData2()};CGraphicFrame.prototype.Refresh_RecalcData2= function(){this.recalcInfo.recalculateTable=true;this.recalcInfo.recalculateSizes=true;this.addToRecalculate()};CGraphicFrame.prototype.checkTypeCorrect=function(){if(!this.graphicObject)return false;return true};CGraphicFrame.prototype.Is_ThisElementCurrent=function(){if(this.parent&&this.parent.graphicObjects)if(this.group){var main_group=this.group.getMainGroup();return main_group.selection.textSelection===this}else return this.parent.graphicObjects.selection.textSelection===this;return false}; CGraphicFrame.prototype.GetAllContentControls=function(arrContentControls){if(this.graphicObject)this.graphicObject.GetAllContentControls(arrContentControls)};CGraphicFrame.prototype.IsElementStartOnNewPage=function(){return true};CGraphicFrame.prototype.getCopyWithSourceFormatting=function(){var ret=this.copy(undefined);var oCopyTable=ret.graphicObject;var oSourceTable=this.graphicObject;var oTheme=this.Get_Theme();var oColorMap=this.Get_ColorMap();var RGBA;if(oCopyTable&&oSourceTable){var oPr2= oCopyTable.Pr;if(oSourceTable.CompiledPr.Pr&&oSourceTable.CompiledPr.Pr.TablePr){oCopyTable.Set_Pr(oSourceTable.CompiledPr.Pr.TablePr.Copy());oPr2=oCopyTable.Pr;if(oPr2.TableBorders)if(oPr2.TableBorders){if(oPr2.TableBorders.Bottom&&oPr2.TableBorders.Bottom.Unifill){oPr2.TableBorders.Bottom.Unifill.check(oTheme,oColorMap);RGBA=oPr2.TableBorders.Bottom.Unifill.getRGBAColor();oPr2.TableBorders.Bottom.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}if(oPr2.TableBorders.Left&&oPr2.TableBorders.Left.Unifill){oPr2.TableBorders.Left.Unifill.check(oTheme, oColorMap);RGBA=oPr2.TableBorders.Left.Unifill.getRGBAColor();oPr2.TableBorders.Left.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}if(oPr2.TableBorders.Right&&oPr2.TableBorders.Right.Unifill){oPr2.TableBorders.Right.Unifill.check(oTheme,oColorMap);RGBA=oPr2.TableBorders.Right.Unifill.getRGBAColor();oPr2.TableBorders.Right.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}if(oPr2.TableBorders.Top&&oPr2.TableBorders.Top.Unifill){oPr2.TableBorders.Top.Unifill.check(oTheme, oColorMap);RGBA=oPr2.TableBorders.Top.Unifill.getRGBAColor();oPr2.TableBorders.Top.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}if(oPr2.TableBorders.InsideH&&oPr2.TableBorders.InsideH.Unifill){oPr2.TableBorders.InsideH.Unifill.check(oTheme,oColorMap);RGBA=oPr2.TableBorders.InsideH.Unifill.getRGBAColor();oPr2.TableBorders.InsideH.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}if(oPr2.TableBorders.InsideV&&oPr2.TableBorders.InsideV.Unifill){oPr2.TableBorders.InsideV.Unifill.check(oTheme, oColorMap);RGBA=oPr2.TableBorders.InsideV.Unifill.getRGBAColor();oPr2.TableBorders.InsideV.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}}}if(oCopyTable.Content.length===oSourceTable.Content.length)for(var i=0;i<oCopyTable.Content.length;++i){var aSourceCells=oSourceTable.Content[i].Content;var aCopyCells=oCopyTable.Content[i].Content;if(aSourceCells.length===aCopyCells.length)for(var j=0;j<aSourceCells.length;++j){var aSourceContent=aSourceCells[j].Content.Content;var aCopyContent= aCopyCells[j].Content.Content;AscFormat.SaveContentSourceFormatting(aSourceContent,aCopyContent,oTheme,oColorMap);if(aSourceCells[j].CompiledPr.Pr){var oCellPr=new CTableCellPr;if(oPr2.TableBorders){if(i===0)if(oPr2.TableBorders.Top)oCellPr.TableCellBorders.Top=oPr2.TableBorders.Top.Copy();if(i===oCopyTable.Content.length-1)if(oPr2.TableBorders.Bottom)oCellPr.TableCellBorders.Bottom=oPr2.TableBorders.Bottom.Copy();if(oPr2.TableBorders.InsideH){if(i!==0)oCellPr.TableCellBorders.Top=oPr2.TableBorders.InsideH.Copy(); if(i!==oCopyTable.Content.length-1)oCellPr.TableCellBorders.Bottom=oPr2.TableBorders.InsideH.Copy()}if(j===0)if(oPr2.TableBorders.Left)oCellPr.TableCellBorders.Left=oPr2.TableBorders.Left.Copy();if(j===aSourceCells.length-1)if(oPr2.TableBorders.Right)oCellPr.TableCellBorders.Right=oPr2.TableBorders.Right.Copy();if(oPr2.TableBorders.InsideV){if(j!==0)oCellPr.TableCellBorders.Left=oPr2.TableBorders.InsideV.Copy();if(j!==aSourceCells.length-1)oCellPr.TableCellBorders.Right=oPr2.TableBorders.InsideV.Copy()}}oCellPr.Merge(aSourceCells[j].CompiledPr.Pr.Copy()); aCopyCells[j].Set_Pr(oCellPr);var oPr=aCopyCells[j].Pr;if(oPr.Shd&&oPr.Shd.Unifill)if(oPr.Shd.Unifill){oPr.Shd.Unifill.check(oTheme,oColorMap);RGBA=oPr.Shd.Unifill.getRGBAColor();oPr.Shd.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}if(oPr.TableCellBorders){if(oPr.TableCellBorders.Bottom&&oPr.TableCellBorders.Bottom.Unifill){oPr.TableCellBorders.Bottom.Unifill.check(oTheme,oColorMap);RGBA=oPr.TableCellBorders.Bottom.Unifill.getRGBAColor();oPr.TableCellBorders.Bottom.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R, RGBA.G,RGBA.B,255)}if(oPr.TableCellBorders.Left&&oPr.TableCellBorders.Left.Unifill){oPr.TableCellBorders.Left.Unifill.check(oTheme,oColorMap);RGBA=oPr.TableCellBorders.Left.Unifill.getRGBAColor();oPr.TableCellBorders.Left.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}if(oPr.TableCellBorders.Right&&oPr.TableCellBorders.Right.Unifill){oPr.TableCellBorders.Right.Unifill.check(oTheme,oColorMap);RGBA=oPr.TableCellBorders.Right.Unifill.getRGBAColor();oPr.TableCellBorders.Right.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R, RGBA.G,RGBA.B,255)}if(oPr.TableCellBorders.Top&&oPr.TableCellBorders.Top.Unifill){oPr.TableCellBorders.Top.Unifill.check(oTheme,oColorMap);RGBA=oPr.TableCellBorders.Top.Unifill.getRGBAColor();oPr.TableCellBorders.Top.Unifill=AscFormat.CreteSolidFillRGB(RGBA.R,RGBA.G,RGBA.B,255)}}}}}}return ret};CGraphicFrame.prototype.documentCreateFontMap=function(oMap){if(this.graphicObject&&this.graphicObject.Document_CreateFontMap)this.graphicObject.Document_CreateFontMap(oMap)};window["AscFormat"]=window["AscFormat"]|| {};window["AscFormat"].CGraphicFrame=CGraphicFrame})(window);"use strict";(function(window,undefined){var CreateNoFillLine=AscFormat.CreateNoFillLine;var CreateNoFillUniFill=AscFormat.CreateNoFillUniFill;var c_oAscChartTypeSettings=Asc.c_oAscChartTypeSettings;var c_oAscTickMark=Asc.c_oAscTickMark;var c_oAscTickLabelsPos=Asc.c_oAscTickLabelsPos;var fChartSize=75;function ChartPreviewManager(){this.previewGroups=[];this.chartsByTypes=[];this.CHART_PREVIEW_WIDTH_PIX=50;this.CHART_PREVIEW_HEIGHT_PIX= 50;this._canvas_charts=null}ChartPreviewManager.prototype.getAscChartSeriesDefault=function(type){function createItem(value){return{numFormatStr:"General",isDateTimeFormat:false,val:value,isHidden:false}}var series=[],ser;switch(type){case c_oAscChartTypeSettings.lineNormal:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(2),createItem(3),createItem(2),createItem(3)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1),createItem(2),createItem(3),createItem(2)]; series.push(ser);break}case c_oAscChartTypeSettings.line3d:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1),createItem(2),createItem(1),createItem(2)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(3),createItem(2.5),createItem(3),createItem(3.5)];series.push(ser);break}case c_oAscChartTypeSettings.lineStacked:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1),createItem(6),createItem(2),createItem(8)];series.push(ser);ser=new AscFormat.asc_CChartSeria; ser.Val.NumCache=[createItem(4),createItem(4),createItem(4),createItem(5)];series.push(ser);break}case c_oAscChartTypeSettings.lineStackedPer:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(2),createItem(4),createItem(2),createItem(4)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(2),createItem(2),createItem(2),createItem(2)];series.push(ser);break}case c_oAscChartTypeSettings.hBarNormal:case c_oAscChartTypeSettings.hBarNormal3d:{ser=new AscFormat.asc_CChartSeria; ser.Val.NumCache=[createItem(4)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(3)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(2)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1)];series.push(ser);break}case c_oAscChartTypeSettings.hBarStacked:case c_oAscChartTypeSettings.hBarStacked3d:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(4),createItem(3),createItem(2),createItem(1)]; series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(5),createItem(4),createItem(3),createItem(2)];series.push(ser);break}case c_oAscChartTypeSettings.hBarStackedPer:case c_oAscChartTypeSettings.hBarStackedPer3d:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(7),createItem(5),createItem(3),createItem(1)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(7),createItem(6),createItem(5),createItem(4)];series.push(ser);break}case c_oAscChartTypeSettings.barNormal:case c_oAscChartTypeSettings.barNormal3d:{ser= new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(2)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(3)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(4)];series.push(ser);break}case c_oAscChartTypeSettings.barStacked:case c_oAscChartTypeSettings.barStacked3d:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1),createItem(2), createItem(3),createItem(4)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(2),createItem(3),createItem(4),createItem(5)];series.push(ser);break}case c_oAscChartTypeSettings.barStackedPer:case c_oAscChartTypeSettings.barStackedPer3d:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1),createItem(3),createItem(5),createItem(7)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(4),createItem(5),createItem(6),createItem(7)]; series.push(ser);break}case c_oAscChartTypeSettings.barNormal3dPerspective:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1),createItem(2),createItem(3),createItem(4)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(2),createItem(3),createItem(4),createItem(5)];series.push(ser);break}case c_oAscChartTypeSettings.pie:case c_oAscChartTypeSettings.doughnut:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(3),createItem(1)];series.push(ser); break}case c_oAscChartTypeSettings.areaNormal:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(0),createItem(8),createItem(5),createItem(6)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(0),createItem(4),createItem(2),createItem(9)];series.push(ser);break}case c_oAscChartTypeSettings.areaStacked:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(0),createItem(8),createItem(5),createItem(11)];series.push(ser);ser=new AscFormat.asc_CChartSeria; ser.Val.NumCache=[createItem(4),createItem(4),createItem(4),createItem(4)];series.push(ser);break}case c_oAscChartTypeSettings.areaStackedPer:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(0),createItem(4),createItem(1),createItem(16)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(4),createItem(4),createItem(4),createItem(4)];series.push(ser);break}case c_oAscChartTypeSettings.scatter:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1), createItem(5)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(2),createItem(6)];series.push(ser);break}default:{ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(3),createItem(5),createItem(7)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(10),createItem(12),createItem(14)];series.push(ser);ser=new AscFormat.asc_CChartSeria;ser.Val.NumCache=[createItem(1),createItem(3),createItem(5)];series.push(ser);ser=new AscFormat.asc_CChartSeria; ser.Val.NumCache=[createItem(8),createItem(10),createItem(12)];series.push(ser);break}}return series};ChartPreviewManager.prototype.getChartByType=function(type){return AscFormat.ExecuteNoHistory(function(){var settings=new Asc.asc_ChartSettings;settings.type=type;var chartSeries={series:this.getAscChartSeriesDefault(type),parsedHeaders:{bLeft:true,bTop:true}};var chart_space=AscFormat.DrawingObjectsController.prototype._getChartSpace(chartSeries,settings,true);chart_space.bPreview=true;if(Asc["editor"]&& AscCommon.c_oEditorId.Spreadsheet===Asc["editor"].getEditorId()){var api_sheet=Asc["editor"];chart_space.setWorksheet(api_sheet.wb.getWorksheet().model)}else if(editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument.Slides&&editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage])chart_space.setParent(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]);AscFormat.CheckSpPrXfrm(chart_space);chart_space.spPr.xfrm.setOffX(0); chart_space.spPr.xfrm.setOffY(0);chart_space.spPr.xfrm.setExtX(fChartSize);chart_space.spPr.xfrm.setExtY(fChartSize);settings.putTitle(Asc.c_oAscChartTitleShowSettings.noOverlay);var val_ax_props=new AscCommon.asc_ValAxisSettings;val_ax_props.putMinValRule(Asc.c_oAscValAxisRule.auto);val_ax_props.putMaxValRule(Asc.c_oAscValAxisRule.auto);val_ax_props.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);val_ax_props.putInvertValOrder(false);val_ax_props.putDispUnitsRule(Asc.c_oAscValAxUnits.none); val_ax_props.putMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax_props.putMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);val_ax_props.putCrossesRule(Asc.c_oAscCrossesRule.auto);var cat_ax_props=new AscCommon.asc_CatAxisSettings;cat_ax_props.putIntervalBetweenLabelsRule(Asc.c_oAscBetweenLabelsRule.auto);cat_ax_props.putLabelsPosition(Asc.c_oAscLabelsPosition.betweenDivisions);cat_ax_props.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);cat_ax_props.putLabelsAxisDistance(100);cat_ax_props.putMajorTickMark(c_oAscTickMark.TICK_MARK_NONE); cat_ax_props.putMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);cat_ax_props.putIntervalBetweenTick(1);cat_ax_props.putCrossesRule(Asc.c_oAscCrossesRule.auto);var vert_axis_settings,hor_axis_settings,isScatter;switch(type){case c_oAscChartTypeSettings.hBarNormal:case c_oAscChartTypeSettings.hBarStacked:case c_oAscChartTypeSettings.hBarStackedPer:{vert_axis_settings=cat_ax_props;hor_axis_settings=val_ax_props;break}case c_oAscChartTypeSettings.scatter:case c_oAscChartTypeSettings.scatterLine:case c_oAscChartTypeSettings.scatterLineMarker:case c_oAscChartTypeSettings.scatterMarker:case c_oAscChartTypeSettings.scatterNone:case c_oAscChartTypeSettings.scatterSmooth:case c_oAscChartTypeSettings.scatterSmoothMarker:{vert_axis_settings= val_ax_props;hor_axis_settings=val_ax_props;isScatter=true;settings.showMarker=true;settings.smooth=false;settings.bLine=false;break}case c_oAscChartTypeSettings.areaNormal:case c_oAscChartTypeSettings.areaStacked:case c_oAscChartTypeSettings.areaStackedPer:{cat_ax_props.putLabelsPosition(AscFormat.CROSS_BETWEEN_BETWEEN);vert_axis_settings=val_ax_props;hor_axis_settings=cat_ax_props;break}default:{vert_axis_settings=val_ax_props;hor_axis_settings=cat_ax_props;break}}settings.putVertAxisProps(vert_axis_settings); settings.putHorAxisProps(hor_axis_settings);AscFormat.DrawingObjectsController.prototype.applyPropsToChartSpace(settings,chart_space);chart_space.setBDeleted(false);chart_space.updateLinks();if(!(isScatter||type===c_oAscChartTypeSettings.stock)){if(chart_space.chart.plotArea.valAx)chart_space.chart.plotArea.valAx.setDelete(true);if(chart_space.chart.plotArea.catAx)chart_space.chart.plotArea.catAx.setDelete(true)}else{if(chart_space.chart.plotArea.valAx){chart_space.chart.plotArea.valAx.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE); chart_space.chart.plotArea.valAx.setMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);chart_space.chart.plotArea.valAx.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE)}if(chart_space.chart.plotArea.catAx){chart_space.chart.plotArea.catAx.setTickLblPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE);chart_space.chart.plotArea.catAx.setMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);chart_space.chart.plotArea.catAx.setMinorTickMark(c_oAscTickMark.TICK_MARK_NONE)}}if(!chart_space.spPr)chart_space.setSpPr(new AscFormat.CSpPr); var new_line=new AscFormat.CLn;new_line.setFill(new AscFormat.CUniFill);new_line.Fill.setFill(new AscFormat.CNoFill);chart_space.spPr.setLn(new_line);chart_space.recalcInfo.recalculateReferences=false;chart_space.recalculate();return chart_space},this,[])};ChartPreviewManager.prototype.clearPreviews=function(){this.previewGroups.length=0};ChartPreviewManager.prototype.createChartPreview=function(graphics,type,preset){if(!this.chartsByTypes[type])this.chartsByTypes[type]=this.getChartByType(type); var chart_space=this.chartsByTypes[type];AscFormat.ApplyPresetToChartSpace(chart_space,preset);chart_space.recalcInfo.recalculateReferences=false;chart_space.recalculate();graphics.save();chart_space.draw(graphics);graphics.restore()};ChartPreviewManager.prototype._isCachedChartStyles=function(chartType){var res=this.previewGroups.hasOwnProperty(chartType);if(!res)this.previewGroups[chartType]=[];return res};ChartPreviewManager.prototype._getGraphics=function(){if(null===this._canvas_charts){this._canvas_charts= document.createElement("canvas");this._canvas_charts.width=this.CHART_PREVIEW_WIDTH_PIX;this._canvas_charts.height=this.CHART_PREVIEW_HEIGHT_PIX;if(AscCommon.AscBrowser.isRetina){this._canvas_charts.width=AscCommon.AscBrowser.convertToRetinaValue(this._canvas_charts.width,true);this._canvas_charts.height=AscCommon.AscBrowser.convertToRetinaValue(this._canvas_charts.height,true)}}var _canvas=this._canvas_charts;var ctx=_canvas.getContext("2d");var graphics=new AscCommon.CGraphics;graphics.init(ctx, _canvas.width,_canvas.height,fChartSize,fChartSize);graphics.m_oFontManager=AscCommon.g_fontManager;graphics.transform(1,0,0,1,0,0);return graphics};ChartPreviewManager.prototype.getChartPreviews=function(chartType){if(AscFormat.isRealNumber(chartType))if(!this._isCachedChartStyles(chartType)){var presets=AscCommon.g_oChartPresets[chartType];if(presets){AscFormat.ExecuteNoHistory(function(){var graphics=this._getGraphics();for(var i=0;i<presets.length;++i){this.createChartPreview(graphics,chartType, presets[i]);if(!window["IS_NATIVE_EDITOR"]){var chartStyle=new AscCommon.CStyleImage;chartStyle.name=i+1;chartStyle.image=this._canvas_charts.toDataURL("image/png");this.previewGroups[chartType].push(chartStyle)}}},this,[]);var api=Asc["editor"];if(api&&AscCommon.c_oEditorId.Spreadsheet===api.getEditorId()){var _graphics=api.wb.shapeCtx;if(_graphics.ClearLastFont)_graphics.ClearLastFont()}}}return this.previewGroups[chartType]};function CreateAscColorByIndex(nIndex){var oColor=new Asc.asc_CColor; oColor.type=Asc.c_oAscColor.COLOR_TYPE_SCHEME;oColor.value=nIndex;return oColor}function CreateAscFillByIndex(nIndex){var oAscFill=new Asc.asc_CShapeFill;oAscFill.type=Asc.c_oAscFill.FILL_TYPE_SOLID;oAscFill.fill=new Asc.asc_CFillSolid;oAscFill.fill.color=CreateAscColorByIndex(nIndex);return oAscFill}function CreateAscGradFillByIndex(nIndex1,nIndex2,nAngle){var oAscFill=new Asc.asc_CShapeFill;oAscFill.type=Asc.c_oAscFill.FILL_TYPE_GRAD;oAscFill.fill=new Asc.asc_CFillGrad;oAscFill.fill.GradType=Asc.c_oAscFillGradType.GRAD_LINEAR; oAscFill.fill.LinearAngle=nAngle;oAscFill.fill.LinearScale=true;oAscFill.fill.Colors=[CreateAscColorByIndex(nIndex1),CreateAscColorByIndex(nIndex2)];oAscFill.fill.Positions=[0,1E5];oAscFill.fill.LinearAngle=nAngle;oAscFill.fill.LinearScale=true;return oAscFill}function TextArtPreviewManager(){this.canvas=null;this.canvasWidth=50;this.canvasHeight=50;this.shapeWidth=50;this.shapeHeight=50;this.TAShape=null;this.TextArtStyles=[];this.aStylesByIndex=[];this.aStylesByIndexToApply=[];this.dKoeff=4}TextArtPreviewManager.prototype.initStyles= function(){var oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscFillByIndex(24),new AscFormat.CUniFill,0);oTextPr.TextOutline=CreateNoFillLine();this.aStylesByIndex[0]=oTextPr;this.aStylesByIndexToApply[0]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscGradFillByIndex(52,24,54E5),new AscFormat.CUniFill,0);oTextPr.TextOutline=CreateNoFillLine();this.aStylesByIndex[4]=oTextPr;this.aStylesByIndexToApply[4]=oTextPr; oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscGradFillByIndex(44,42,54E5),new AscFormat.CUniFill,0);oTextPr.TextOutline=CreateNoFillLine();this.aStylesByIndex[8]=oTextPr;this.aStylesByIndexToApply[8]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=CreateNoFillUniFill();oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(34),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,15773/36E3* this.dKoeff);this.aStylesByIndex[1]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=CreateNoFillUniFill();oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(34),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,15773/36E3);this.aStylesByIndexToApply[1]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=CreateNoFillUniFill();oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(59), new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,15773/36E3*this.dKoeff);this.aStylesByIndex[5]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=CreateNoFillUniFill();oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(59),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,15773/36E3);this.aStylesByIndexToApply[5]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=CreateNoFillUniFill();oTextPr.TextOutline= AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(52),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,15773/36E3*this.dKoeff);this.aStylesByIndex[9]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=CreateNoFillUniFill();oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(52),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,15773/36E3);this.aStylesByIndexToApply[9]=oTextPr;oTextPr= new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscFillByIndex(27),new AscFormat.CUniFill,0);oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(52),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,12700/36E3*this.dKoeff);this.aStylesByIndex[2]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscFillByIndex(27),new AscFormat.CUniFill,0);oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(52), new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,12700/36E3);this.aStylesByIndexToApply[2]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscFillByIndex(42),new AscFormat.CUniFill,0);oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(46),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,12700/36E3*this.dKoeff);this.aStylesByIndex[6]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold= true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscFillByIndex(42),new AscFormat.CUniFill,0);oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(46),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,12700/36E3);this.aStylesByIndexToApply[6]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscFillByIndex(57),new AscFormat.CUniFill,0);oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(54), new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,12700/36E3*this.dKoeff);this.aStylesByIndex[10]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscFillByIndex(57),new AscFormat.CUniFill,0);oTextPr.TextOutline=AscFormat.CreatePenFromParams(AscFormat.CorrectUniFill(CreateAscFillByIndex(54),new AscFormat.CUniFill,0),undefined,undefined,undefined,undefined,12700/36E3);this.aStylesByIndexToApply[10]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold= true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscGradFillByIndex(45,57,0),new AscFormat.CUniFill,0);oTextPr.TextOutline=CreateNoFillLine();this.aStylesByIndex[3]=oTextPr;this.aStylesByIndexToApply[3]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true;oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscGradFillByIndex(52,33,0),new AscFormat.CUniFill,0);oTextPr.TextOutline=CreateNoFillLine();this.aStylesByIndex[7]=oTextPr;this.aStylesByIndexToApply[7]=oTextPr;oTextPr=new CTextPr;oTextPr.Bold=true; oTextPr.TextFill=AscFormat.CorrectUniFill(CreateAscGradFillByIndex(27,45,54E5),new AscFormat.CUniFill,0);oTextPr.TextOutline=CreateNoFillLine();this.aStylesByIndex[11]=oTextPr;this.aStylesByIndexToApply[11]=oTextPr};TextArtPreviewManager.prototype.getStylesToApply=function(){if(this.aStylesByIndex.length===0)this.initStyles();return this.aStylesByIndexToApply};TextArtPreviewManager.prototype.clear=function(){this.TextArtStyles.length=0};TextArtPreviewManager.prototype.getWordArtStyles=function(){if(this.TextArtStyles.length=== 0)this.generateTextArtStyles();return this.TextArtStyles};TextArtPreviewManager.prototype.getCanvas=function(){if(null===this.canvas){this.canvas=document.createElement("canvas");this.canvas.width=this.canvasWidth;this.canvas.height=this.canvasHeight;if(AscCommon.AscBrowser.isRetina){this.canvas.width<<=1;this.canvas.height<<=1}}return this.canvas};TextArtPreviewManager.prototype.getShapeByPrst=function(prst){var oShape=this.getShape();if(!oShape)return null;var oContent=oShape.getDocContent();var TextSpacing= undefined;switch(prst){case "textButton":{TextSpacing=4;oContent.AddText("abcde");oContent.AddNewParagraph();oContent.AddText("Fghi");oContent.AddNewParagraph();oContent.AddText("Jklmn");break}case "textArchUp":case "textArchDown":{TextSpacing=4;oContent.AddText("abcdefg");break}case "textCircle":{TextSpacing=4;oContent.AddText("abcdefghijklmnop");break}case "textButtonPour":{oContent.AddText("abcde");oContent.AddNewParagraph();oContent.AddText("abc");oContent.AddNewParagraph();oContent.AddText("abcde"); break}case "textDeflateInflate":{oContent.AddText("abcde");oContent.AddNewParagraph();oContent.AddText("abcde");break}case "textDeflateInflateDeflate":{oContent.AddText("abcde");oContent.AddNewParagraph();oContent.AddText("abcde");oContent.AddNewParagraph();oContent.AddText("abcde");break}default:{oContent.AddText("abcde");break}}oContent.Set_ApplyToAll(true);oContent.SetParagraphAlign(AscCommon.align_Center);oContent.AddToParagraph(new ParaTextPr({FontSize:36,Spacing:TextSpacing}));oContent.Set_ApplyToAll(false); var oBodypr=oShape.getBodyPr().createDuplicate();oBodypr.prstTxWarp=AscFormat.ExecuteNoHistory(function(){return AscFormat.CreatePrstTxWarpGeometry(prst)},[]);if(!oShape.bWordShape)oShape.txBody.setBodyPr(oBodypr);else oShape.setBodyPr(oBodypr);oShape.setBDeleted(false);oShape.recalculate();return oShape};TextArtPreviewManager.prototype.getShape=function(){var oShape=new AscFormat.CShape;var oParent=null,oWorkSheet=null;var bWord=true;if(Asc["editor"]&&AscCommon.c_oEditorId.Spreadsheet===Asc["editor"].getEditorId()){var api_sheet= Asc["editor"];oShape.setWorksheet(api_sheet.wb.getWorksheet().model);oWorkSheet=api_sheet.wb.getWorksheet().model;bWord=false}else if(editor&&editor.WordControl&&Array.isArray(editor.WordControl.m_oLogicDocument.Slides))if(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]){oShape.setParent(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]);oParent=editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]; bWord=false}else return null;var oParentObjects=oShape.getParentObjects();var oTrack=new AscFormat.NewShapeTrack("textRect",0,0,oParentObjects.theme,oParentObjects.master,oParentObjects.layout,oParentObjects.slide,0);oTrack.track({},oShape.convertPixToMM(this.canvasWidth),oShape.convertPixToMM(this.canvasHeight));oShape=oTrack.getShape(bWord,oShape.getDrawingDocument(),oShape.drawingObjects);oShape.setStyle(null);oShape.spPr.setFill(AscFormat.CreateUnfilFromRGB(255,255,255));var oBodypr=oShape.getBodyPr().createDuplicate(); oBodypr.lIns=0;oBodypr.tIns=0;oBodypr.rIns=0;oBodypr.bIns=0;oBodypr.anchor=1;if(!bWord)oShape.txBody.setBodyPr(oBodypr);else oShape.setBodyPr(oBodypr);oShape.spPr.setLn(AscFormat.CreatePenFromParams(CreateNoFillUniFill(),null,null,null,2,null));if(oWorkSheet)oShape.setWorksheet(oWorkSheet);if(oParent)oShape.setParent(oParent);oShape.spPr.xfrm.setOffX(0);oShape.spPr.xfrm.setOffY(0);oShape.spPr.xfrm.setExtX(this.shapeWidth);oShape.spPr.xfrm.setExtY(this.shapeHeight);return oShape};TextArtPreviewManager.prototype.getTAShape= function(){if(!this.TAShape){var MainLogicDocument=editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument?editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument:null;var TrackRevisions=MainLogicDocument&&MainLogicDocument.IsTrackRevisions?MainLogicDocument.IsTrackRevisions():false;if(MainLogicDocument&&true===TrackRevisions)MainLogicDocument.SetTrackRevisions(false);var oShape=this.getShape();if(!oShape){if(MainLogicDocument&&true===TrackRevisions)MainLogicDocument.SetTrackRevisions(true); return null}var oContent=oShape.getDocContent();if(oContent){if(oContent.MoveCursorToStartPos)oContent.MoveCursorToStartPos();oContent.AddText("Ta");oContent.Set_ApplyToAll(true);oContent.AddToParagraph(new ParaTextPr({FontSize:109,RFonts:{Ascii:{Name:"Arial",Index:-1}}}));oContent.SetParagraphAlign(AscCommon.align_Center);oContent.SetParagraphIndent({FirstLine:0,Left:0,Right:0});oContent.Set_ApplyToAll(false)}if(MainLogicDocument&&true===TrackRevisions)MainLogicDocument.SetTrackRevisions(true);this.TAShape= oShape}return this.TAShape};TextArtPreviewManager.prototype.getWordArtPreview=function(prst){var _canvas=this.getCanvas();var ctx=_canvas.getContext("2d");var graphics=new AscCommon.CGraphics;var oShape=this.getShapeByPrst(prst);if(!oShape)return"";graphics.init(ctx,_canvas.width,_canvas.height,oShape.extX,oShape.extY);graphics.m_oFontManager=AscCommon.g_fontManager;graphics.transform(1,0,0,1,0,0);var oldShowParaMarks;if(editor){oldShowParaMarks=editor.ShowParaMarks;editor.ShowParaMarks=false}oShape.draw(graphics); if(editor)editor.ShowParaMarks=oldShowParaMarks;return _canvas.toDataURL("image/png")};TextArtPreviewManager.prototype.generateTextArtStyles=function(){AscFormat.ExecuteNoHistory(function(){if(this.aStylesByIndex.length===0)this.initStyles();var _canvas=this.getCanvas();var ctx=_canvas.getContext("2d");var graphics=new AscCommon.CGraphics;var oShape=this.getTAShape();if(!oShape){this.TextArtStyles.length=0;return}oShape.recalculate();graphics.m_oFontManager=AscCommon.g_fontManager;var oldShowParaMarks; if(editor){oldShowParaMarks=editor.ShowParaMarks;editor.ShowParaMarks=false}var oContent=oShape.getDocContent();oContent.Set_ApplyToAll(true);for(var i=0;i<this.aStylesByIndex.length;++i){oContent.AddToParagraph(new ParaTextPr(this.aStylesByIndex[i]));graphics.init(ctx,_canvas.width,_canvas.height,oShape.extX,oShape.extY);graphics.transform(1,0,0,1,0,0);oShape.recalcText();if(!oShape.bWordShape)oShape.recalculate();else oShape.recalculateText();oShape.draw(graphics);this.TextArtStyles[i]=_canvas.toDataURL("image/png")}oContent.Set_ApplyToAll(false); if(editor)editor.ShowParaMarks=oldShowParaMarks},this,[])};function GenerateWordArtPrewiewCode(){var oWordArtPreview=new TextArtPreviewManager;var i,j;var oRetString="g_PresetTxWarpTypes = \n [";for(i=0;i<AscCommon.g_PresetTxWarpTypes.length;++i){var aByTypes=AscCommon.g_PresetTxWarpTypes[i];oRetString+="\n\t[";for(j=0;j<aByTypes.length;++j)oRetString+='\n\t\t{Type: "'+aByTypes[j]["Type"]+'", Image: "'+oWordArtPreview.getWordArtPreview(aByTypes[j]["Image"])+'"}'+(j===aByTypes.length-1?"":",");oRetString+= "\n\t]"+(i<AscCommon.g_PresetTxWarpTypes.length-1?",":"")}oRetString+="\n];";return oRetString}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].ChartPreviewManager=ChartPreviewManager;window["AscCommon"].TextArtPreviewManager=TextArtPreviewManager})(window);"use strict";(function(window,undefined){var sFrozenImageUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAICAQAAACSE13KAAAAH0lEQVQI12NgV2L6+YuJAYh+M4n/YuL8y8DAwsDABABYogY5EHbuKgAAAABJRU5ErkJggg==";var sFrozenImageRotUrl= "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAABCAYAAADjAO9DAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAnSURBVBhXY2ZnZ1f6+/cvNwMDAwcQs4mLizOLiooyf/jwAchlYAAAc8kGpR10sBYAAAAASUVORK5CYII=";var SHADOW_LENGTH=8;var FrozenAreaType={Top:"Top",Bottom:"Bottom",Left:"Left",Right:"Right",Center:"Center",LeftTop:"LeftTop",RightTop:"RightTop",LeftBottom:"LeftBottom",RightBottom:"RightBottom"};function FrozenPlace(ws,type){var log=false;var _this=this;var asc=window["Asc"];var asc_Range= asc.Range;_this.worksheet=ws;_this.type=type;_this.range=null;_this.frozenCell={col:_this.worksheet.topLeftFrozenCell?_this.worksheet.topLeftFrozenCell.getCol0():0,row:_this.worksheet.topLeftFrozenCell?_this.worksheet.topLeftFrozenCell.getRow0():0};_this.isValid=true;_this.initRange=function(){switch(_this.type){case FrozenAreaType.Top:{if(!_this.frozenCell.col&&_this.frozenCell.row)_this.range=new asc_Range(_this.worksheet.getFirstVisibleCol(),0,_this.worksheet.getLastVisibleCol(),_this.frozenCell.row- 1);else _this.isValid=false}break;case FrozenAreaType.Bottom:{if(!_this.frozenCell.col&&_this.frozenCell.row)_this.range=new asc_Range(0,_this.worksheet.getFirstVisibleRow(),_this.worksheet.getLastVisibleCol(),_this.worksheet.getLastVisibleRow());else _this.isValid=false}break;case FrozenAreaType.Left:{if(_this.frozenCell.col&&!_this.frozenCell.row)_this.range=new asc_Range(0,0,_this.frozenCell.col-1,_this.worksheet.getLastVisibleRow());else _this.isValid=false}break;case FrozenAreaType.Right:{if(_this.frozenCell.col&& !_this.frozenCell.row)_this.range=new asc_Range(_this.worksheet.getFirstVisibleCol(),0,_this.worksheet.getLastVisibleCol(),_this.worksheet.getLastVisibleRow());else _this.isValid=false}break;case FrozenAreaType.Center:{if(!_this.frozenCell.col&&!_this.frozenCell.row)_this.range=new asc_Range(_this.worksheet.getFirstVisibleCol(true),_this.worksheet.getFirstVisibleRow(true),_this.worksheet.getLastVisibleCol(),_this.worksheet.getLastVisibleRow());else _this.isValid=false}break;case FrozenAreaType.LeftTop:{if(_this.frozenCell.col&& _this.frozenCell.row)_this.range=new asc_Range(0,0,_this.frozenCell.col-1,_this.frozenCell.row-1);else _this.isValid=false}break;case FrozenAreaType.RightTop:{if(_this.frozenCell.col&&_this.frozenCell.row)_this.range=new asc_Range(_this.worksheet.getFirstVisibleCol(),0,_this.worksheet.getLastVisibleCol(),_this.frozenCell.row-1);else _this.isValid=false}break;case FrozenAreaType.LeftBottom:{if(_this.frozenCell.col&&_this.frozenCell.row)_this.range=new asc_Range(0,_this.worksheet.getFirstVisibleRow(), _this.frozenCell.col-1,_this.worksheet.getLastVisibleRow());else _this.isValid=false}break;case FrozenAreaType.RightBottom:{if(_this.frozenCell.col&&_this.frozenCell.row)_this.range=new asc_Range(_this.worksheet.getFirstVisibleCol(),_this.worksheet.getFirstVisibleRow(),_this.worksheet.getLastVisibleCol(),_this.worksheet.getLastVisibleRow());else _this.isValid=false}break}};_this.getVisibleRange=function(){var vr=_this.range.clone();var fv=_this.getFirstVisible();switch(_this.type){case FrozenAreaType.Top:{}break; case FrozenAreaType.Bottom:{vr.r1=fv.row;vr.r2=_this.worksheet.getLastVisibleRow()}break;case FrozenAreaType.Left:{vr.r1=fv.row;vr.r2=_this.worksheet.getLastVisibleRow()}break;case FrozenAreaType.Right:{vr.c1=fv.col;vr.c2=_this.worksheet.getLastVisibleCol()}break;case FrozenAreaType.LeftTop:{}break;case FrozenAreaType.RightTop:{vr.c1=fv.col;vr.c2=_this.worksheet.getLastVisibleCol()}break;case FrozenAreaType.LeftBottom:{vr.r1=fv.row;vr.r2=_this.worksheet.getLastVisibleRow()}break;case FrozenAreaType.RightBottom:{vr.c1= fv.col;vr.c2=_this.worksheet.getLastVisibleCol();vr.r1=fv.row;vr.r2=_this.worksheet.getLastVisibleRow()}break;case FrozenAreaType.Center:{vr.c1=fv.col;vr.c2=_this.worksheet.getLastVisibleCol();vr.r1=fv.row;vr.r2=_this.worksheet.getLastVisibleRow()}break}return vr};_this.getRect=function(bEvent){var rect=_this.worksheet.rangeToRectRel(_this.range,0);switch(_this.type){case FrozenAreaType.Top:{rect.w=+Infinity;rect.r=+Infinity;if(bEvent){rect.x=-Infinity;rect.y=-Infinity}break}case FrozenAreaType.Bottom:{rect.w= +Infinity;rect.h=+Infinity;rect.r=+Infinity;rect.b=+Infinity;if(bEvent)rect.x=-Infinity;break}case FrozenAreaType.Left:{rect.h=+Infinity;rect.b=+Infinity;if(bEvent){rect.x=-Infinity;rect.y=-Infinity}break}case FrozenAreaType.Right:{rect.w=+Infinity;rect.h=+Infinity;rect.r=+Infinity;rect.b=+Infinity;if(bEvent)rect.y=-Infinity;break}case FrozenAreaType.Center:{rect.w=+Infinity;rect.h=+Infinity;rect.r=+Infinity;rect.b=+Infinity;if(bEvent){rect.x=-Infinity;rect.y=-Infinity}break}case FrozenAreaType.LeftTop:{if(bEvent){rect.x= -Infinity;rect.y=-Infinity}break}case FrozenAreaType.RightTop:{rect.w=+Infinity;rect.r=+Infinity;if(bEvent)rect.y=-Infinity;break}case FrozenAreaType.LeftBottom:{rect.h=+Infinity;rect.b=+Infinity;if(bEvent)rect.x=-Infinity;break}case FrozenAreaType.RightBottom:{rect.w=+Infinity;rect.h=+Infinity;rect.r=+Infinity;rect.b=+Infinity;break}}return rect};_this.getFirstVisible=function(){var fv={col:0,row:0};switch(_this.type){case FrozenAreaType.Top:{fv.col=_this.worksheet.getFirstVisibleCol()}break;case FrozenAreaType.Bottom:{fv.col= _this.worksheet.getFirstVisibleCol();fv.row=_this.worksheet.getFirstVisibleRow()}break;case FrozenAreaType.Left:{fv.row=_this.worksheet.getFirstVisibleRow()}break;case FrozenAreaType.Right:{fv.col=_this.worksheet.getFirstVisibleCol();fv.row=_this.worksheet.getFirstVisibleRow()}break;case FrozenAreaType.LeftTop:{}break;case FrozenAreaType.RightTop:{fv.col=_this.worksheet.getFirstVisibleCol()}break;case FrozenAreaType.LeftBottom:{fv.row=_this.worksheet.getFirstVisibleRow()}break;case FrozenAreaType.RightBottom:{fv.col= _this.worksheet.getFirstVisibleCol();fv.row=_this.worksheet.getFirstVisibleRow()}break;case FrozenAreaType.Center:{fv.col=_this.worksheet.getFirstVisibleCol();fv.row=_this.worksheet.getFirstVisibleRow()}break}return fv};_this.isPointInside=function(x,y,bEvent){var rect=_this.getRect(bEvent);var result=x>=rect.x&&y>=rect.y&&x<=rect.r&&y<=rect.b;if(log&&result)console.log(x+","+y+" in "+_this.type);return result};_this.isCellInside=function(cell){var result=false;if(cell&&_this.range){var cellRange= new asc_Range(cell.col,cell.row,cell.col,cell.row);result=_this.range.isIntersect(cellRange)}return result};_this.isObjectInside=function(object){var boundsFromTo=object.boundsFromTo;var objectRange=new asc_Range(boundsFromTo.from.col,boundsFromTo.from.row,boundsFromTo.to.col,boundsFromTo.to.row);return _this.range.isIntersect(objectRange)};_this.getVerticalScroll=function(){var scroll=0;var fv=_this.getFirstVisible();var headerPx=_this.worksheet._getRowTop(0);switch(_this.type){case FrozenAreaType.Top:{scroll= headerPx}break;case FrozenAreaType.Bottom:{scroll=-(_this.worksheet._getRowTop(fv.row)-_this.worksheet._getRowTop(_this.frozenCell.row))+headerPx}break;case FrozenAreaType.Left:case FrozenAreaType.Right:{scroll=-(_this.worksheet._getRowTop(fv.row)-_this.worksheet.cellsTop)+headerPx}break;case FrozenAreaType.LeftTop:case FrozenAreaType.RightTop:{scroll=headerPx}break;case FrozenAreaType.LeftBottom:case FrozenAreaType.RightBottom:{scroll=-(_this.worksheet._getRowTop(fv.row)-_this.worksheet._getRowTop(_this.frozenCell.row))+ headerPx}break;case FrozenAreaType.Center:{scroll=-(_this.worksheet._getRowTop(fv.row)-_this.worksheet.cellsTop)+headerPx}break}return scroll};_this.getHorizontalScroll=function(){var scroll=0;var fv=_this.getFirstVisible();var headerPx=_this.worksheet._getColLeft(0);switch(_this.type){case FrozenAreaType.Top:case FrozenAreaType.Bottom:{scroll=-(_this.worksheet._getColLeft(fv.col)-_this.worksheet.cellsLeft)+headerPx}break;case FrozenAreaType.Left:{scroll=headerPx}break;case FrozenAreaType.Right:{scroll= -(_this.worksheet._getColLeft(fv.col)-_this.worksheet._getColLeft(_this.frozenCell.col))+headerPx}break;case FrozenAreaType.LeftTop:case FrozenAreaType.LeftBottom:{scroll=headerPx}break;case FrozenAreaType.RightTop:case FrozenAreaType.RightBottom:{scroll=-(_this.worksheet._getColLeft(fv.col)-_this.worksheet._getColLeft(_this.frozenCell.col))+headerPx}break;case FrozenAreaType.Center:{scroll=-(_this.worksheet._getColLeft(fv.col)-_this.worksheet.cellsLeft)+headerPx}break}return scroll};_this.clip=function(canvas, rect){canvas.m_oContext.save();canvas.m_oContext.beginPath();canvas.m_oContext.rect(rect.x,rect.y,rect.w,rect.h);canvas.m_oContext.clip();canvas.m_oContext.save()};_this.restore=function(canvas){canvas.m_oContext.restore();canvas.m_oContext.restore()};_this.drawObject=function(object,oRect){var oUpdateRect=_this.worksheet.rangeToRectAbs(_this.range,3);if(oRect){oUpdateRect=oUpdateRect.intersection(oRect);if(!oUpdateRect)return}var canvas=_this.worksheet.objectRender.getDrawingCanvas();_this.setTransform(canvas.shapeCtx, canvas.shapeOverlayCtx,canvas.autoShapeTrack);var oClipRect;if(!oRect)oClipRect=_this.worksheet.rangeToRectRel(_this.range,0);else{var oT=canvas.shapeCtx.m_oCoordTransform;var l=(oT.TransformPointX(oUpdateRect.l,oUpdateRect.t)>>0)-1;var t=(oT.TransformPointY(oUpdateRect.l,oUpdateRect.t)>>0)-1;var r=(oT.TransformPointX(oUpdateRect.r,oUpdateRect.b)>>0)+1;var b=(oT.TransformPointY(oUpdateRect.r,oUpdateRect.b)>>0)+1;oClipRect=new AscFormat.CGraphicBounds(l,t,r,b)}_this.clip(canvas.shapeCtx,oClipRect); canvas.shapeCtx.updatedRect=oUpdateRect;object.draw(canvas.shapeCtx);canvas.shapeCtx.updatedRect=null;if(object.graphicObject.lockType!==undefined&&object.graphicObject.lockType!==AscCommon.c_oAscLockTypes.kLockTypeNone){var oApi=Asc["editor"];if(oApi)if(!oApi.collaborativeEditing.getFast()||object.graphicObject.lockType!==AscCommon.c_oAscLockTypes.kLockTypeMine){canvas.shapeCtx.SetIntegerGrid(false);canvas.shapeCtx.transform3(object.graphicObject.transform,false);canvas.shapeCtx.DrawLockObjectRect(object.graphicObject.lockType, 0,0,object.graphicObject.extX,object.graphicObject.extY);canvas.shapeCtx.reset();canvas.shapeCtx.SetIntegerGrid(true)}}_this.restore(canvas.shapeCtx)};_this.updateRange=function(object,oRange){var oClipRange=_this.range.intersectionSimple(oRange);if(!oClipRange)return;var canvas=_this.worksheet.objectRender.getDrawingCanvas();_this.setTransform(canvas.shapeCtx,canvas.shapeOverlayCtx,canvas.autoShapeTrack);_this.clip(canvas.shapeCtx,_this.worksheet.rangeToRectRel(oClipRange,0));canvas.shapeCtx.updatedRect= _this.worksheet.rangeToRectAbs(oClipRange,3);object.draw(canvas.shapeCtx);canvas.shapeCtx.updatedRect=null;if(object.graphicObject.lockType!==undefined&&object.graphicObject.lockType!==AscCommon.c_oAscLockTypes.kLockTypeNone){var oApi=Asc["editor"];if(oApi)if(!oApi.collaborativeEditing.getFast()||object.graphicObject.lockType!==AscCommon.c_oAscLockTypes.kLockTypeMine){canvas.shapeCtx.SetIntegerGrid(false);canvas.shapeCtx.transform3(object.graphicObject.transform,false);canvas.shapeCtx.DrawLockObjectRect(object.graphicObject.lockType, 0,0,object.graphicObject.extX,object.graphicObject.extY);canvas.shapeCtx.reset();canvas.shapeCtx.SetIntegerGrid(true)}}_this.restore(canvas.shapeCtx)};_this.drawFrozenPaneBorderHor=function(autoShapeTrack,y,left,right){if(Asc.editor.asc_getFrozenPaneBorderType()===Asc.c_oAscFrozenPaneBorderType.shadow){var nH=SHADOW_LENGTH;if(AscCommon.AscBrowser.isRetina)nH=AscCommon.AscBrowser.convertToRetinaValue(nH,true);autoShapeTrack.m_oOverlay.CheckPoint1(left,y-nH);autoShapeTrack.m_oOverlay.CheckPoint2(right, y+nH);autoShapeTrack.drawImage(sFrozenImageUrl,left,y,right,nH)}else autoShapeTrack.m_oOverlay.DrawFrozenPlaceHorLine(y,left,right)};_this.drawFrozenPaneBorderVer=function(autoShapeTrack,x,top,bottom){if(Asc.editor.asc_getFrozenPaneBorderType()===Asc.c_oAscFrozenPaneBorderType.shadow){var nW=SHADOW_LENGTH;if(AscCommon.AscBrowser.isRetina)nW=AscCommon.AscBrowser.convertToRetinaValue(nW,true);autoShapeTrack.m_oOverlay.CheckPoint1(x-nW,top);autoShapeTrack.m_oOverlay.CheckPoint2(x+nW,bottom);autoShapeTrack.drawImage(sFrozenImageRotUrl, x,top,nW,bottom)}else autoShapeTrack.m_oOverlay.DrawFrozenPlaceVerLine(x,top,bottom)};_this.drawSelection=function(drawingDocument,shapeCtx,shapeOverlayCtx,autoShapeTrack,trackOverlay){var ctx=trackOverlay.m_oContext;_this.setTransform(shapeCtx,shapeOverlayCtx,autoShapeTrack,trackOverlay);_this.clip(shapeOverlayCtx,_this.worksheet.rangeToRectRel(_this.range,0));if(drawingDocument.m_bIsSelection){if(!window["IS_NATIVE_EDITOR"]){drawingDocument.SelectionMatrix=null;trackOverlay.m_oControl.HtmlElement.style.display= "block";if(null==trackOverlay.m_oContext)trackOverlay.m_oContext=trackOverlay.m_oControl.HtmlElement.getContext("2d")}drawingDocument.private_StartDrawSelection(trackOverlay);this.worksheet.objectRender.controller.drawTextSelection();drawingDocument.private_EndDrawSelection();this.worksheet.handlers.trigger("drawMobileSelection",trackOverlay,undefined)}if(drawingDocument.MathTrack.IsActive())drawingDocument.DrawMathTrack(trackOverlay);ctx.globalAlpha=1;this.worksheet.objectRender.controller.drawSelection(drawingDocument); if(this.worksheet.objectRender.controller.needUpdateOverlay()){trackOverlay.Show();autoShapeTrack.Graphics.put_GlobalAlpha(true,.5);this.worksheet.objectRender.controller.drawTracks(autoShapeTrack);autoShapeTrack.Graphics.put_GlobalAlpha(true,1);_this.restore(autoShapeTrack)}_this.restore(autoShapeTrack)};_this.setTransform=function(shapeCtx,shapeOverlayCtx,autoShapeTrack,trackOverlay){if(shapeCtx&&shapeOverlayCtx&&autoShapeTrack){var x=_this.getHorizontalScroll();var y=_this.getVerticalScroll(); shapeCtx.m_oCoordTransform.tx=x;shapeCtx.m_oCoordTransform.ty=y;shapeCtx.CalculateFullTransform();shapeOverlayCtx.m_oCoordTransform.tx=x;shapeOverlayCtx.m_oCoordTransform.ty=y;shapeOverlayCtx.CalculateFullTransform();autoShapeTrack.Graphics.m_oCoordTransform.tx=x;autoShapeTrack.Graphics.m_oCoordTransform.ty=y;autoShapeTrack.Graphics.CalculateFullTransform();_this.worksheet.objectRender.controller.recalculateCurPos()}if(trackOverlay&&trackOverlay.m_oHtmlPage){var width=trackOverlay.m_oHtmlPage.drawingPage.right- trackOverlay.m_oHtmlPage.drawingPage.left;var height=trackOverlay.m_oHtmlPage.drawingPage.bottom-trackOverlay.m_oHtmlPage.drawingPage.top;trackOverlay.m_oHtmlPage.drawingPage.left=x;trackOverlay.m_oHtmlPage.drawingPage.top=y;trackOverlay.m_oHtmlPage.drawingPage.right=x+width;trackOverlay.m_oHtmlPage.drawingPage.bottom=y+height}};_this.drawPaneBorder=function(autoShapeTrack){var fLeft,fTop,fRight,fBottom;if(_this.type===FrozenAreaType.Bottom){fTop=this.worksheet._getRowTop(_this.frozenCell.row);fLeft= 0;this.drawFrozenPaneBorderHor(autoShapeTrack,fTop,fLeft,autoShapeTrack.Graphics.m_lWidthPix)}else if(_this.type===FrozenAreaType.Right){fTop=0;fLeft=this.worksheet._getColLeft(_this.frozenCell.col);this.drawFrozenPaneBorderVer(autoShapeTrack,fLeft,fTop,autoShapeTrack.Graphics.m_lHeightPix)}else if(_this.type===FrozenAreaType.RightBottom){fTop=this.worksheet._getRowTop(_this.frozenCell.row);fLeft=this.worksheet._getColLeft(_this.frozenCell.col);this.drawFrozenPaneBorderHor(autoShapeTrack,fTop,fLeft, autoShapeTrack.Graphics.m_lWidthPix);this.drawFrozenPaneBorderVer(autoShapeTrack,fLeft,fTop,autoShapeTrack.Graphics.m_lHeightPix)}else if(_this.type===FrozenAreaType.LeftBottom){fTop=this.worksheet._getRowTop(_this.frozenCell.row);fLeft=0;fRight=this.worksheet._getColLeft(_this.frozenCell.col);this.drawFrozenPaneBorderHor(autoShapeTrack,fTop,fLeft,fRight)}else if(_this.type===FrozenAreaType.RightTop){fTop=0;fLeft=this.worksheet._getColLeft(_this.frozenCell.col);fBottom=this.worksheet._getRowTop(_this.frozenCell.row); this.drawFrozenPaneBorderVer(autoShapeTrack,fLeft,fTop,fBottom)}};_this.initRange()}function DrawingArea(ws){var asc=window["Asc"];this.api=asc["editor"];this.worksheet=ws;this.frozenPlaces=[]}DrawingArea.prototype.init=function(){this.frozenPlaces=[];if(this.worksheet){var place;if(this.worksheet.topLeftFrozenCell){place=new FrozenPlace(this.worksheet,FrozenAreaType.Top);if(place.isValid)this.frozenPlaces.push(place);place=new FrozenPlace(this.worksheet,FrozenAreaType.Bottom);if(place.isValid)this.frozenPlaces.push(place); place=new FrozenPlace(this.worksheet,FrozenAreaType.Left);if(place.isValid)this.frozenPlaces.push(place);place=new FrozenPlace(this.worksheet,FrozenAreaType.Right);if(place.isValid)this.frozenPlaces.push(place);place=new FrozenPlace(this.worksheet,FrozenAreaType.LeftTop);if(place.isValid)this.frozenPlaces.push(place);place=new FrozenPlace(this.worksheet,FrozenAreaType.RightTop);if(place.isValid)this.frozenPlaces.push(place);place=new FrozenPlace(this.worksheet,FrozenAreaType.LeftBottom);if(place.isValid)this.frozenPlaces.push(place); place=new FrozenPlace(this.worksheet,FrozenAreaType.RightBottom);if(place.isValid)this.frozenPlaces.push(place)}else this.frozenPlaces.push(new FrozenPlace(this.worksheet,FrozenAreaType.Center))}};DrawingArea.prototype.clear=function(){this.worksheet.drawingGraphicCtx.clear()};DrawingArea.prototype.drawObject=function(object,oRect){for(var i=0;i<this.frozenPlaces.length;i++)if(this.frozenPlaces[i].isObjectInside(object))this.frozenPlaces[i].drawObject(object,oRect)};DrawingArea.prototype.updateRange= function(object,oRange){for(var i=0;i<this.frozenPlaces.length;i++)if(this.frozenPlaces[i].isObjectInside(object))this.frozenPlaces[i].updateRange(object,oRange)};DrawingArea.prototype.reinitRanges=function(){for(var i=0;i<this.frozenPlaces.length;i++)this.frozenPlaces[i].initRange()};DrawingArea.prototype.drawSelection=function(drawingDocument){if(window["IS_NATIVE_EDITOR"])AscCommon.g_oTextMeasurer.Flush();var oWS=this.worksheet;var canvas=oWS.objectRender.getDrawingCanvas();var shapeCtx=canvas.shapeCtx; var shapeOverlayCtx=canvas.shapeOverlayCtx;var autoShapeTrack=canvas.autoShapeTrack;var trackOverlay=canvas.trackOverlay;var ctx=trackOverlay.m_oContext;trackOverlay.Clear();drawingDocument.Overlay=trackOverlay;oWS.overlayCtx.clear();oWS.overlayGraphicCtx.clear();oWS._drawCollaborativeElements(autoShapeTrack);var controller=oWS.objectRender.controller;if(!controller.selectedObjects.length&&!this.api.isStartAddShape)oWS._drawSelection();var chart;var selected_objects=controller.selection.groupSelection? controller.selection.groupSelection.selectedObjects:controller.selectedObjects;if(selected_objects.length===1&&selected_objects[0].getObjectType()===AscDFH.historyitem_type_ChartSpace){chart=selected_objects[0];oWS.objectRender.selectDrawingObjectRange(chart)}for(var i=0;i<this.frozenPlaces.length;i++)this.frozenPlaces[i].drawSelection(drawingDocument,shapeCtx,shapeOverlayCtx,autoShapeTrack,trackOverlay);this.drawFrozenPaneBorders(autoShapeTrack);var oWatermark=this.api.watermarkDraw;if(oWatermark){oWatermark.zoom= 1;oWatermark.Generate();oWatermark.Draw(ctx,ctx.canvas.width,ctx.canvas.height)}};DrawingArea.prototype.drawFrozenPaneBorders=function(autoShapeTrack){for(var i=0;i<this.frozenPlaces.length;i++)this.frozenPlaces[i].drawPaneBorder(autoShapeTrack)};DrawingArea.prototype.getOffsets=function(x,y,bEvents){for(var i=0;i<this.frozenPlaces.length;i++)if(this.frozenPlaces[i].isPointInside(x,y,bEvents))return{x:this.frozenPlaces[i].getHorizontalScroll(),y:this.frozenPlaces[i].getVerticalScroll()};return null}; window["AscFormat"]=window["AscFormat"]||{};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscFormat"].DrawingArea=DrawingArea;window["AscCommonExcel"].sFrozenImageUrl=sFrozenImageUrl;window["AscCommonExcel"].sFrozenImageRotUrl=sFrozenImageRotUrl})(window);"use strict";(function(window,undefined){var c_oAscCellAnchorType=AscCommon.c_oAscCellAnchorType;var c_oAscLockTypes=AscCommon.c_oAscLockTypes;var parserHelp=AscCommon.parserHelp;var gc_nMaxRow=AscCommon.gc_nMaxRow;var gc_nMaxCol= AscCommon.gc_nMaxCol;var History=AscCommon.History;var BBoxInfo=AscFormat.BBoxInfo;var MOVE_DELTA=AscFormat.MOVE_DELTA;var c_oAscError=Asc.c_oAscError;var c_oAscChartTypeSettings=Asc.c_oAscChartTypeSettings;var c_oAscChartTitleShowSettings=Asc.c_oAscChartTitleShowSettings;var c_oAscGridLinesSettings=Asc.c_oAscGridLinesSettings;var c_oAscValAxisRule=Asc.c_oAscValAxisRule;var c_oAscInsertOptions=Asc.c_oAscInsertOptions;var c_oAscDeleteOptions=Asc.c_oAscDeleteOptions;var c_oAscSelectionType=Asc.c_oAscSelectionType; var global_mouseEvent=AscCommon.global_mouseEvent;var aSparklinesStyles=[[[4,-.499984740745262],[5,0],[4,-.499984740745262],[4,.3999755851924192],[4,.3999755851924192],[4,0],[4,0]],[[5,-.499984740745262],[6,0],[5,-.499984740745262],[5,.3999755851924192],[5,.3999755851924192],[5,0],[5,0]],[[6,-.499984740745262],[7,0],[6,-.499984740745262],[6,.3999755851924192],[6,.3999755851924192],[6,0],[6,0]],[[7,-.499984740745262],[8,0],[7,-.499984740745262],[7,.3999755851924192],[7,.3999755851924192],[7,0],[7, 0]],[[8,-.499984740745262],[9,0],[8,-.499984740745262],[8,.3999755851924192],[8,.3999755851924192],[8,0],[8,0]],[[9,-.499984740745262],[4,0],[9,-.499984740745262],[9,.3999755851924192],[9,.3999755851924192],[9,0],[9,0]],[[4,-.249977111117893],[5,0],[5,-.249977111117893],[5,-.249977111117893],[5,-.249977111117893],[5,-.249977111117893],[5,-.249977111117893]],[[5,-.249977111117893],[6,0],[6,-.249977111117893],[6,-.249977111117893],[6,-.249977111117893],[6,-.249977111117893],[6,-.249977111117893]],[[6, -.249977111117893],[7,0],[7,-.249977111117893],[7,-.249977111117893],[7,-.249977111117893],[7,-.249977111117893],[7,-.249977111117893]],[[7,-.249977111117893],[8,0],[8,-.249977111117893],[8,-.249977111117893],[8,-.249977111117893],[8,-.249977111117893],[8,-.249977111117893]],[[8,-.249977111117893],[9,0],[9,-.249977111117893],[9,-.249977111117893],[9,-.249977111117893],[9,-.249977111117893],[9,-.249977111117893]],[[9,-.249977111117893],[4,0],[4,-.249977111117893],[4,-.249977111117893],[4,-.249977111117893], [4,-.249977111117893],[4,-.249977111117893]],[[4,0],[5,0],[4,-.249977111117893],[4,-.249977111117893],[4,-.249977111117893],[4,-.249977111117893],[4,-.249977111117893]],[[5,0],[6,0],[5,-.249977111117893],[5,-.249977111117893],[5,-.249977111117893],[5,-.249977111117893],[5,-.249977111117893]],[[6,0],[7,0],[6,-.249977111117893],[6,-.249977111117893],[6,-.249977111117893],[6,-.249977111117893],[6,-.249977111117893]],[[7,0],[8,0],[7,-.249977111117893],[7,-.249977111117893],[7,-.249977111117893],[7,-.249977111117893], [7,-.249977111117893]],[[8,0],[9,0],[8,-.249977111117893],[8,-.249977111117893],[8,-.249977111117893],[8,-.249977111117893],[8,-.249977111117893]],[[9,0],[4,0],[9,-.249977111117893],[9,-.249977111117893],[9,-.249977111117893],[9,-.249977111117893],[9,-.249977111117893]],[[4,.3999755851924192],[0,-.499984740745262],[4,.7999816888943144],[4,-.249977111117893],[4,-.249977111117893],[4,-.499984740745262],[4,-.499984740745262]],[[5,.3999755851924192],[0,-.499984740745262],[5,.7999816888943144],[5,-.249977111117893], [5,-.249977111117893],[5,-.499984740745262],[5,-.499984740745262]],[[6,.3999755851924192],[0,-.499984740745262],[6,.7999816888943144],[6,-.249977111117893],[6,-.249977111117893],[6,-.499984740745262],[6,-.499984740745262]],[[7,.3999755851924192],[0,-.499984740745262],[7,.7999816888943144],[7,-.249977111117893],[7,-.249977111117893],[7,-.499984740745262],[7,-.499984740745262]],[[8,.3999755851924192],[0,-.499984740745262],[8,.7999816888943144],[8,-.249977111117893],[8,-.249977111117893],[8,-.499984740745262], [8,-.499984740745262]],[[9,.3999755851924192],[0,-.499984740745262],[9,.7999816888943144],[9,-.249977111117893],[9,-.249977111117893],[9,-.499984740745262],[9,-.499984740745262]],[[1,.499984740745262],[1,.249977111117893],[1,.249977111117893],[1,.249977111117893],[1,.249977111117893],[1,.249977111117893],[1,.249977111117893]],[[1,.3499862666707358],[0,-.249977111117893],[0,-.249977111117893],[0,-.249977111117893],[0,-.249977111117893],[0,-.249977111117893],[0,-.249977111117893]],[[4281479730],[4291821568], [4291821568],[4291821568],[4291821568],[4291821568],[4291821568]],[[4278190080],[4278218944],[4278218944],[4278218944],[4278218944],[4278218944],[4278218944]],[[4281819282],[4291821568],[4291821568],[4291821568],[4291821568],[4291821568],[4291821568]],[[4278218944],[4278190080],[4278190080],[4278190080],[4278190080],[4278190080],[4278190080]],[[4284440415],[4294948384],[4292280439],[4283860930],[4281703659],[4283874937],[4294922325]],[[4283860930],[4294948384],[4292280439],[4286019447],[4281703659], [4283874937],[4294922325]],[[4291227598],[4294952910],[4287409622],[4294958151],[4294962076],[4284535414],[4294923111]],[[4278235216],[4294901760],[4278218944],[4294950912],[4294950912],[4278235216],[4294901760]],[[3,0],[9,0],[8,0],[4,0],[5,0],[6,0],[7,0]],[[1,0],[9,0],[8,0],[4,0],[5,0],[6,0],[7,0]]];function isObject(what){return what!=null&&typeof what=="object"}function DrawingBounds(minX,maxX,minY,maxY){this.minX=minX;this.maxX=maxX;this.minY=minY;this.maxY=maxY}function getCurrentTime(){var currDate= new Date;return currDate.getTime()}function roundPlus(x,n){if(isNaN(x)||isNaN(n))return false;var m=Math.pow(10,n);return Math.round(x*m)/m}function CCellObjectInfo(){this.col=0;this.row=0;this.colOff=0;this.rowOff=0;this.colOffPx=0;this.rowOffPx=0}function asc_CChartBinary(chart){this["binary"]=null;if(chart&&chart.getObjectType()===AscDFH.historyitem_type_ChartSpace){var writer=new AscCommon.BinaryChartWriter(new AscCommon.CMemory(false)),pptx_writer;writer.WriteCT_ChartSpace(chart);this["binary"]= writer.memory.pos+";"+writer.memory.GetBase64Memory();if(chart.theme){pptx_writer=new AscCommon.CBinaryFileWriter;pptx_writer.WriteTheme(chart.theme);this["themeBinary"]=pptx_writer.pos+";"+pptx_writer.GetBase64Memory()}if(chart.colorMapOverride){pptx_writer=new AscCommon.CBinaryFileWriter;pptx_writer.WriteRecord1(1,chart.colorMapOverride,pptx_writer.WriteClrMap);this["colorMapBinary"]=pptx_writer.pos+";"+pptx_writer.GetBase64Memory()}this["urls"]=JSON.stringify(AscCommon.g_oDocumentUrls.getUrls()); if(chart.parent&&chart.parent.docPr){this["cTitle"]=chart.parent.docPr.title;this["cDescription"]=chart.parent.docPr.descr}else{this["cTitle"]=chart.getTitle();this["cDescription"]=chart.getDescription()}}}asc_CChartBinary.prototype={asc_getBinary:function(){return this["binary"]},asc_setBinary:function(val){this["binary"]=val},asc_getThemeBinary:function(){return this["themeBinary"]},asc_setThemeBinary:function(val){this["themeBinary"]=val},asc_setColorMapBinary:function(val){this["colorMapBinary"]= val},asc_getColorMapBinary:function(){return this["colorMapBinary"]},getChartSpace:function(workSheet){var binary=this["binary"];var stream=AscFormat.CreateBinaryReader(this["binary"],0,this["binary"].length);AscCommon.pptx_content_loader.Clear();var oNewChartSpace=new AscFormat.CChartSpace;var oBinaryChartReader=new AscCommon.BinaryChartReader(stream);oBinaryChartReader.ExternalReadCT_ChartSpace(stream.size,oNewChartSpace,workSheet);return oNewChartSpace},getTheme:function(){var binary=this["themeBinary"]; if(binary){var stream=AscFormat.CreateBinaryReader(binary,0,binary.length);var oBinaryReader=new AscCommon.BinaryPPTYLoader;oBinaryReader.stream=new AscCommon.FileStream;oBinaryReader.stream.obj=stream.obj;oBinaryReader.stream.data=stream.data;oBinaryReader.stream.size=stream.size;oBinaryReader.stream.pos=stream.pos;oBinaryReader.stream.cur=stream.cur;return oBinaryReader.ReadTheme()}return null},getColorMap:function(){var binary=this["colorMapBinary"];if(binary){var stream=AscFormat.CreateBinaryReader(binary, 0,binary.length);var oBinaryReader=new AscCommon.BinaryPPTYLoader;oBinaryReader.stream=new AscCommon.FileStream;oBinaryReader.stream.obj=stream.obj;oBinaryReader.stream.data=stream.data;oBinaryReader.stream.size=stream.size;oBinaryReader.stream.pos=stream.pos;oBinaryReader.stream.cur=stream.cur;var _rec=oBinaryReader.stream.GetUChar();var ret=new AscFormat.ClrMap;oBinaryReader.ReadClrMap(ret);return ret}return null}};function asc_CChartSeria(){this.Val={Formula:"",NumCache:[]};this.xVal={Formula:"", NumCache:[]};this.Cat={Formula:"",NumCache:[]};this.TxCache={Formula:"",Tx:""};this.Marker={Size:0,Symbol:""};this.FormatCode="";this.isHidden=false}asc_CChartSeria.prototype={asc_getValFormula:function(){return this.Val.Formula},asc_setValFormula:function(formula){this.Val.Formula=formula},asc_getxValFormula:function(){return this.xVal.Formula},asc_setxValFormula:function(formula){this.xVal.Formula=formula},asc_getCatFormula:function(){return this.Cat.Formula},asc_setCatFormula:function(formula){this.Cat.Formula= formula},asc_getTitle:function(){return this.TxCache.Tx},asc_setTitle:function(title){this.TxCache.Tx=title},asc_getTitleFormula:function(){return this.TxCache.Formula},asc_setTitleFormula:function(val){this.TxCache.Formula=val},asc_getMarkerSize:function(){return this.Marker.Size},asc_setMarkerSize:function(size){this.Marker.Size=size},asc_getMarkerSymbol:function(){return this.Marker.Symbol},asc_setMarkerSymbol:function(symbol){this.Marker.Symbol=symbol},asc_getFormatCode:function(){return this.FormatCode}, asc_setFormatCode:function(format){this.FormatCode=format}};var nSparklineMultiplier=3.75;function CSparklineView(){this.col=null;this.row=null;this.ws=null;this.extX=null;this.extY=null;this.chartSpace=null}function CreateSparklineMarker(oUniFill,bPreview){var oMarker=new AscFormat.CMarker;oMarker.symbol=AscFormat.SYMBOL_DIAMOND;oMarker.size=10;if(bPreview)oMarker.size=30;oMarker.spPr=new AscFormat.CSpPr;oMarker.spPr.Fill=oUniFill;oMarker.spPr.ln=AscFormat.CreateNoFillLine();return oMarker}function CreateUniFillFromExcelColor(oExcelColor){var oUnifill; {oUnifill=AscFormat.CreateUnfilFromRGB(oExcelColor.getR(),oExcelColor.getG(),oExcelColor.getB())}return oUnifill}CSparklineView.prototype.initFromSparkline=function(oSparkline,oSparklineGroup,worksheetView,bForPreview){AscFormat.ExecuteNoHistory(function(){this.ws=worksheetView;var settings=new Asc.asc_ChartSettings;var nSparklineType=oSparklineGroup.asc_getType();switch(nSparklineType){case Asc.c_oAscSparklineType.Column:{settings.type=c_oAscChartTypeSettings.barNormal;break}case Asc.c_oAscSparklineType.Stacked:{settings.type= c_oAscChartTypeSettings.barStackedPer;break}default:{settings.type=c_oAscChartTypeSettings.lineNormal;break}}var ser=new asc_CChartSeria;ser.Val.Formula=oSparkline.f;if(oSparkline.oCache)ser.Val.NumCache=oSparkline.oCache;var chartSeries={series:[ser],parsedHeaders:{bLeft:false,bTop:false}};var chart_space=AscFormat.DrawingObjectsController.prototype._getChartSpace(chartSeries,settings,true);chart_space.isSparkline=true;chart_space.setBDeleted(false);if(worksheetView)chart_space.setWorksheet(worksheetView.model); chart_space.displayHidden=oSparklineGroup.asc_getDisplayHidden();chart_space.displayEmptyCellsAs=oSparklineGroup.asc_getDisplayEmpty();settings.putTitle(c_oAscChartTitleShowSettings.none);settings.putHorAxisLabel(c_oAscChartTitleShowSettings.none);settings.putVertAxisLabel(c_oAscChartTitleShowSettings.none);settings.putLegendPos(Asc.c_oAscChartLegendShowSettings.none);settings.putHorGridLines(c_oAscGridLinesSettings.none);settings.putVertGridLines(c_oAscGridLinesSettings.none);chart_space.recalculateReferences(); chart_space.recalcInfo.recalculateReferences=false;var oSerie=chart_space.chart.plotArea.charts[0].series[0];var aSeriesPoints=AscFormat.getPtsFromSeries(oSerie);var val_ax_props=new AscCommon.asc_ValAxisSettings;var i,fMinVal=null,fMaxVal=null;if(settings.type!==c_oAscChartTypeSettings.barStackedPer){if(oSparklineGroup.asc_getMinAxisType()===Asc.c_oAscSparklineAxisMinMax.Custom&&oSparklineGroup.asc_getManualMin()!==null){val_ax_props.putMinValRule(c_oAscValAxisRule.fixed);val_ax_props.putMinVal(oSparklineGroup.asc_getManualMin())}else{val_ax_props.putMinValRule(c_oAscValAxisRule.auto); for(i=0;i<aSeriesPoints.length;++i)if(fMinVal===null)fMinVal=aSeriesPoints[i].val;else if(fMinVal>aSeriesPoints[i].val)fMinVal=aSeriesPoints[i].val}if(oSparklineGroup.asc_getMaxAxisType()===Asc.c_oAscSparklineAxisMinMax.Custom&&oSparklineGroup.asc_getManualMax()!==null){val_ax_props.putMinValRule(c_oAscValAxisRule.fixed);val_ax_props.putMinVal(oSparklineGroup.asc_getManualMax())}else{val_ax_props.putMaxValRule(c_oAscValAxisRule.auto);for(i=0;i<aSeriesPoints.length;++i)if(fMaxVal===null)fMaxVal=aSeriesPoints[i].val; else if(fMaxVal<aSeriesPoints[i].val)fMaxVal=aSeriesPoints[i].val}if(fMinVal!==null&&fMaxVal!==null){if(fMinVal!==fMaxVal){val_ax_props.putMinValRule(c_oAscValAxisRule.fixed);val_ax_props.putMinVal(fMinVal);val_ax_props.putMaxValRule(c_oAscValAxisRule.fixed);val_ax_props.putMaxVal(fMaxVal)}}else if(fMinVal!==null){val_ax_props.putMinValRule(c_oAscValAxisRule.fixed);val_ax_props.putMinVal(fMinVal)}else if(fMaxVal!==null){val_ax_props.putMaxValRule(c_oAscValAxisRule.fixed);val_ax_props.putMaxVal(fMaxVal)}}else{val_ax_props.putMinValRule(c_oAscValAxisRule.fixed); val_ax_props.putMinVal(-1);val_ax_props.putMaxValRule(c_oAscValAxisRule.fixed);val_ax_props.putMaxVal(1)}val_ax_props.putTickLabelsPos(Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE);val_ax_props.putInvertValOrder(false);val_ax_props.putDispUnitsRule(Asc.c_oAscValAxUnits.none);val_ax_props.putMajorTickMark(Asc.c_oAscTickMark.TICK_MARK_NONE);val_ax_props.putMinorTickMark(Asc.c_oAscTickMark.TICK_MARK_NONE);val_ax_props.putCrossesRule(Asc.c_oAscCrossesRule.auto);var cat_ax_props=new AscCommon.asc_CatAxisSettings; cat_ax_props.putIntervalBetweenLabelsRule(Asc.c_oAscBetweenLabelsRule.auto);cat_ax_props.putLabelsPosition(Asc.c_oAscLabelsPosition.betweenDivisions);cat_ax_props.putTickLabelsPos(Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE);cat_ax_props.putLabelsAxisDistance(100);cat_ax_props.putMajorTickMark(Asc.c_oAscTickMark.TICK_MARK_NONE);cat_ax_props.putMinorTickMark(Asc.c_oAscTickMark.TICK_MARK_NONE);cat_ax_props.putIntervalBetweenTick(1);cat_ax_props.putCrossesRule(Asc.c_oAscCrossesRule.auto);if(oSparklineGroup.rightToLeft)cat_ax_props.putInvertCatOrder(true); settings.putVertAxisProps(val_ax_props);settings.putHorAxisProps(cat_ax_props);AscFormat.DrawingObjectsController.prototype.applyPropsToChartSpace(settings,chart_space);oSerie=chart_space.chart.plotArea.charts[0].series[0];aSeriesPoints=AscFormat.getPtsFromSeries(oSerie);if(!chart_space.spPr)chart_space.setSpPr(new AscFormat.CSpPr);var new_line=new AscFormat.CLn;new_line.setFill(AscFormat.CreateNoFillUniFill());chart_space.spPr.setLn(new_line);chart_space.spPr.setFill(AscFormat.CreateNoFillUniFill()); var dLineWidthSpaces=500;if(!chart_space.chart.plotArea.spPr){chart_space.chart.plotArea.setSpPr(new AscFormat.CSpPr);chart_space.chart.plotArea.spPr.setFill(AscFormat.CreateNoFillUniFill())}var oAxis=chart_space.chart.plotArea.getAxisByTypes();oAxis.valAx[0].setDelete(true);if(!oSerie.spPr)oSerie.setSpPr(new AscFormat.CSpPr);var fCallbackSeries=null;if(nSparklineType===Asc.c_oAscSparklineType.Line){var oLn=new AscFormat.CLn;oLn.setW(36E3*nSparklineMultiplier*25.4*(bForPreview?2.25:oSparklineGroup.asc_getLineWeight())/ 72);oSerie.spPr.setLn(oLn);if(oSparklineGroup.markers&&oSparklineGroup.colorMarkers)oSerie.marker=CreateSparklineMarker(CreateUniFillFromExcelColor(oSparklineGroup.colorMarkers),bForPreview);fCallbackSeries=function(oSeries,nIdx,oExcelColor){for(var t=0;t<oSeries.dPt.length;++t)if(oSeries.dPt[t].idx===nIdx){if(oSeries.dPt[t].marker&&oSeries.dPt[t].marker.spPr)oSeries.dPt[t].marker.spPr.Fill=CreateUniFillFromExcelColor(oExcelColor);return}var oDPt=new AscFormat.CDPt;oDPt.idx=nIdx;oDPt.marker=CreateSparklineMarker(CreateUniFillFromExcelColor(oExcelColor), bForPreview);oSeries.addDPt(oDPt)}}else{chart_space.chart.plotArea.charts[0].setGapWidth(30);chart_space.chart.plotArea.charts[0].setOverlap(50);fCallbackSeries=function(oSeries,nIdx,oExcelColor){for(var t=0;t<oSeries.dPt.length;++t)if(oSeries.dPt[t].idx===nIdx){if(oSeries.dPt[t].spPr)if(oExcelColor){oSeries.dPt[t].spPr.Fill=CreateUniFillFromExcelColor(oExcelColor);oSeries.dPt[t].spPr.ln=new AscFormat.CLn;oSeries.dPt[t].spPr.ln.Fill=oSeries.dPt[t].spPr.Fill.createDuplicate();oSeries.dPt[t].spPr.ln.w= dLineWidthSpaces}else{oSeries.dPt[t].spPr.Fill=AscFormat.CreateNoFillUniFill();oSeries.dPt[t].spPr.ln=AscFormat.CreateNoFillLine()}return}var oDPt=new AscFormat.CDPt;oDPt.idx=nIdx;oDPt.spPr=new AscFormat.CSpPr;if(oExcelColor){oDPt.spPr.Fill=CreateUniFillFromExcelColor(oExcelColor);oDPt.spPr.ln=new AscFormat.CLn;oDPt.spPr.ln.Fill=oDPt.spPr.Fill.createDuplicate();oDPt.spPr.ln.w=dLineWidthSpaces}else{oDPt.spPr.Fill=AscFormat.CreateNoFillUniFill();oDPt.spPr.ln=AscFormat.CreateNoFillLine()}oSeries.addDPt(oDPt)}}var aMaxPoints= null,aMinPoints=null;if(aSeriesPoints.length>0)if(fCallbackSeries){if(oSparklineGroup.negative&&oSparklineGroup.colorNegative)for(i=0;i<aSeriesPoints.length;++i)if(aSeriesPoints[i].val<0)fCallbackSeries(oSerie,aSeriesPoints[i].idx,oSparklineGroup.colorNegative);if(oSparklineGroup.last&&oSparklineGroup.colorLast)fCallbackSeries(oSerie,aSeriesPoints[aSeriesPoints.length-1].idx,oSparklineGroup.colorLast);if(oSparklineGroup.first&&oSparklineGroup.colorFirst)fCallbackSeries(oSerie,aSeriesPoints[0].idx, oSparklineGroup.colorFirst);if(oSparklineGroup.high&&oSparklineGroup.colorHigh){aMaxPoints=[aSeriesPoints[0]];for(i=1;i<aSeriesPoints.length;++i)if(aSeriesPoints[i].val>aMaxPoints[0].val){aMaxPoints.length=0;aMaxPoints.push(aSeriesPoints[i])}else if(aSeriesPoints[i].val===aMaxPoints[0].val)aMaxPoints.push(aSeriesPoints[i]);for(i=0;i<aMaxPoints.length;++i)fCallbackSeries(oSerie,aMaxPoints[i].idx,oSparklineGroup.colorHigh)}if(oSparklineGroup.low&&oSparklineGroup.colorLow){aMinPoints=[aSeriesPoints[0]]; for(i=1;i<aSeriesPoints.length;++i)if(aSeriesPoints[i].val<aMinPoints[0].val){aMinPoints.length=0;aMinPoints.push(aSeriesPoints[i])}else if(aSeriesPoints[i].val===aMinPoints[0].val)aMinPoints.push(aSeriesPoints[i]);for(i=0;i<aMinPoints.length;++i)fCallbackSeries(oSerie,aMinPoints[i].idx,oSparklineGroup.colorLow)}if(nSparklineType!==Asc.c_oAscSparklineType.Line)for(i=0;i<aSeriesPoints.length;++i)if(AscFormat.fApproxEqual(aSeriesPoints[i].val,0))fCallbackSeries(oSerie,aSeriesPoints[i].idx,null)}if(!oSparklineGroup.displayXAxis)oAxis.catAx[0].setDelete(true); else if(aSeriesPoints.length>1){aSeriesPoints=[].concat(aSeriesPoints);var dMinVal,dMaxVal,bSorted=false;if(val_ax_props.minVal==null)if(aMinPoints)dMinVal=aMinPoints[0].val;else{aSeriesPoints.sort(function(a,b){return a.val-b.val});bSorted=true;dMinVal=aSeriesPoints[0].val}else dMinVal=val_ax_props.minVal;if(val_ax_props.maxVal==null)if(aMaxPoints)dMaxVal=aMaxPoints[0].val;else{if(!bSorted){aSeriesPoints.sort(function(a,b){return a.val-b.val});bSorted=true}dMaxVal=aSeriesPoints[aSeriesPoints.length- 1].val}else dMaxVal=val_ax_props.maxVal;if(dMaxVal!==dMinVal&&(dMaxVal<0||dMinVal>0))oAxis.catAx[0].setDelete(true)}if(oSparklineGroup.colorSeries){var oUnifill=CreateUniFillFromExcelColor(oSparklineGroup.colorSeries);var oSerie=chart_space.chart.plotArea.charts[0].series[0];if(nSparklineType===Asc.c_oAscSparklineType.Line){var oLn=oSerie.spPr.ln;oLn.setFill(oUnifill);oSerie.spPr.setLn(oLn)}else{oSerie.spPr.setFill(oUnifill);oSerie.spPr.ln=new AscFormat.CLn;oSerie.spPr.ln.Fill=oSerie.spPr.Fill.createDuplicate(); oSerie.spPr.ln.w=dLineWidthSpaces}}this.chartSpace=chart_space;if(worksheetView){var oBBox=oSparkline.sqRef;this.col=oBBox.c1;this.row=oBBox.r1;this.x=worksheetView.getCellLeft(oBBox.c1,3);this.y=worksheetView.getCellTop(oBBox.r1,3);var oMergeInfo=worksheetView.model.getMergedByCell(oBBox.r1,oBBox.c1);if(oMergeInfo){this.extX=0;for(i=oMergeInfo.c1;i<=oMergeInfo.c2;++i)this.extX+=worksheetView.getColumnWidth(i,3);this.extY=0;for(i=oMergeInfo.r1;i<=oMergeInfo.r2;++i)this.extY=worksheetView.getRowHeight(i, 3)}else{this.extX=worksheetView.getColumnWidth(oBBox.c1,3);this.extY=worksheetView.getRowHeight(oBBox.r1,3)}AscFormat.CheckSpPrXfrm(this.chartSpace);this.updatePlotAreaLayout();this.chartSpace.recalculate()}},this,[])};CSparklineView.prototype.updatePlotAreaLayout=function(){if(!this.chartSpace)return;var offX=this.x*nSparklineMultiplier;var offY=this.y*nSparklineMultiplier;var extX=this.extX*nSparklineMultiplier;var extY=this.extY*nSparklineMultiplier;this.chartSpace.spPr.xfrm.setOffX(offX);this.chartSpace.spPr.xfrm.setOffY(offY); this.chartSpace.spPr.xfrm.setExtX(extX);this.chartSpace.spPr.xfrm.setExtY(extY);var oLayout=new AscFormat.CLayout;oLayout.setXMode(AscFormat.LAYOUT_MODE_EDGE);oLayout.setYMode(AscFormat.LAYOUT_MODE_EDGE);oLayout.setLayoutTarget(AscFormat.LAYOUT_TARGET_INNER);var fInset=2;var fPosX,fPosY,fExtX,fExtY;fExtX=extX-2*fInset;fExtY=extY-2*fInset;this.chartSpace.bEmptySeries=false;if(fExtX<=0||fExtY<=0){this.chartSpace.bEmptySeries=true;return}fPosX=(extX-fExtX)/2;fPosY=(extY-fExtY)/2;var fLayoutX=this.chartSpace.calculateLayoutByPos(0, oLayout.xMode,fPosX,extX);var fLayoutY=this.chartSpace.calculateLayoutByPos(0,oLayout.yMode,fPosY,extY);var fLayoutW=this.chartSpace.calculateLayoutBySize(fPosX,oLayout.wMode,extX,fExtX);var fLayoutH=this.chartSpace.calculateLayoutBySize(fPosY,oLayout.hMode,extY,fExtY);oLayout.setX(fLayoutX);oLayout.setY(fLayoutY);oLayout.setW(fLayoutW);oLayout.setH(fLayoutH);this.chartSpace.chart.plotArea.setLayout(oLayout)};CSparklineView.prototype.draw=function(graphics,offX,offY){var x=this.ws.getCellLeft(this.col, 3)-offX;var y=this.ws.getCellTop(this.row,3)-offY;var i;var extX;var extY;var oMergeInfo=this.ws.model.getMergedByCell(this.row,this.col);if(oMergeInfo){extX=0;for(i=oMergeInfo.c1;i<=oMergeInfo.c2;++i)extX+=this.ws.getColumnWidth(i,3);extY=0;for(i=oMergeInfo.r1;i<=oMergeInfo.r2;++i)extY=this.ws.getRowHeight(i,3)}else{extX=this.ws.getColumnWidth(this.col,3);extY=this.ws.getRowHeight(this.row,3)}var bExtent=Math.abs(this.extX-extX)>.01||Math.abs(this.extY-extY)>.01;var bPosition=Math.abs(this.x-x)> .01||Math.abs(this.y-y)>.01;if(bExtent||bPosition){this.x=x;this.y=y;this.extX=extX;this.extY=extY;AscFormat.ExecuteNoHistory(function(){if(bPosition){this.chartSpace.spPr.xfrm.setOffX(x*nSparklineMultiplier);this.chartSpace.spPr.xfrm.setOffY(y*nSparklineMultiplier)}if(bExtent){this.chartSpace.spPr.xfrm.setExtX(extX*nSparklineMultiplier);this.chartSpace.spPr.xfrm.setExtY(extY*nSparklineMultiplier);this.updatePlotAreaLayout()}},this,[]);if(bExtent){this.chartSpace.handleUpdateExtents();this.chartSpace.recalculate()}else{this.chartSpace.x= x*nSparklineMultiplier;this.chartSpace.y=y*nSparklineMultiplier;this.chartSpace.transform.tx=this.chartSpace.x;this.chartSpace.transform.ty=this.chartSpace.y}}var _true_height=this.chartSpace.chartObj.calcProp.trueHeight;var _true_width=this.chartSpace.chartObj.calcProp.trueWidth;this.chartSpace.chartObj.calcProp.trueWidth=this.chartSpace.extX*this.chartSpace.chartObj.calcProp.pxToMM;this.chartSpace.chartObj.calcProp.trueHeight=this.chartSpace.extY*this.chartSpace.chartObj.calcProp.pxToMM;this.chartSpace.draw(graphics); this.chartSpace.chartObj.calcProp.trueWidth=_true_width;this.chartSpace.chartObj.calcProp.trueHeight=_true_height};CSparklineView.prototype.setMinMaxValAx=function(minVal,maxVal,oSparklineGroup){var oAxis=this.chartSpace.chart.plotArea.getAxisByTypes();var oValAx=oAxis.valAx[0];if(oValAx){if(minVal!==null){if(!oValAx.scaling)oValAx.setScaling(new AscFormat.CScaling);if(oValAx.scaling.min===null||!AscFormat.fApproxEqual(oValAx.scaling.min,minVal))oValAx.scaling.setMin(minVal)}if(maxVal!==null){if(!oValAx.scaling)oValAx.setScaling(new AscFormat.CScaling); if(oValAx.scaling.max===null||!AscFormat.fApproxEqual(oValAx.scaling.max,maxVal))oValAx.scaling.setMax(maxVal)}if(oSparklineGroup.displayXAxis){var aSeriesPoints=AscFormat.getPtsFromSeries(this.chartSpace.chart.plotArea.charts[0].series[0]);if(aSeriesPoints.length>1){aSeriesPoints=[].concat(aSeriesPoints);var dMinVal,dMaxVal,bSorted=false;if(minVal==null){aSeriesPoints.sort(function(a,b){return a.val-b.val});bSorted=true;dMinVal=aSeriesPoints[0].val}else dMinVal=minVal;if(maxVal==null){if(!bSorted){aSeriesPoints.sort(function(a, b){return a.val-b.val});bSorted=true}dMaxVal=aSeriesPoints[aSeriesPoints.length-1].val}else dMaxVal=maxVal;if(dMaxVal<0||dMinVal>0)oAxis.catAx[0].setDelete(true);else oAxis.catAx[0].setDelete(false)}}this.chartSpace.recalculate()}};function GraphicOption(rect){this.rect=null;if(rect)this.rect=rect.copy()}GraphicOption.prototype.getRect=function(){return this.rect};GraphicOption.prototype.union=function(oGraphicOption){if(!this.rect)return this;if(!oGraphicOption.rect)return oGraphicOption;this.rect.checkByOther(oGraphicOption.rect); return this};var rAF=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){return setTimeout(callback,1E3/60)}}();var cAF=function(){return window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame|| window.msCancelRequestAnimationFrame||clearTimeout}();function DrawingObjects(){var ScrollOffset=function(){this.getX=function(){return 2*worksheet._getColLeft(0)-worksheet._getColLeft(worksheet.getFirstVisibleCol(true))};this.getY=function(){return 2*worksheet._getRowTop(0)-worksheet._getRowTop(worksheet.getFirstVisibleRow(true))}};var _this=this;var asc=window["Asc"];var api=asc["editor"];var worksheet=null;var drawingCtx=null;var overlayCtx=null;var scrollOffset=new ScrollOffset;var aObjects=[]; var aImagesSync=[];var oStateBeforeLoadChanges=null;_this.zoom={last:1,current:1};_this.canEdit=null;_this.objectLocker=null;_this.drawingArea=null;_this.drawingDocument=null;_this.asyncImageEndLoaded=null;_this.CompositeInput=null;_this.lastX=0;_this.lastY=0;_this.nCurPointItemsLength=-1;_this.bUpdateMetrics=true;_this.shiftMap={};_this.animId=null;_this.drawTask=null;function drawTaskFunction(){_this.drawingDocument.CheckTargetShow();if(_this.drawTask){_this.showDrawingObjectsEx(_this.drawTask.getRect()); _this.drawTask=null}_this.animId=null}function DrawingBase(ws){this.worksheet=ws;this.Type=c_oAscCellAnchorType.cellanchorTwoCell;this.Pos={X:0,Y:0};this.editAs=c_oAscCellAnchorType.cellanchorTwoCell;this.from=new CCellObjectInfo;this.to=new CCellObjectInfo;this.ext={cx:0,cy:0};this.graphicObject=null;this.boundsFromTo={from:new CCellObjectInfo,to:new CCellObjectInfo}}DrawingBase.prototype.isUseInDocument=function(){if(worksheet&&worksheet.model){var aDrawings=worksheet.model.Drawings;for(var i=0;i< aDrawings.length;++i)if(aDrawings[i]===this)return true}return false};DrawingBase.prototype.getAllFonts=function(AllFonts){var _t=this;_t.graphicObject&&_t.graphicObject.documentGetAllFontNames&&_t.graphicObject.documentGetAllFontNames(AllFonts)};DrawingBase.prototype.isImage=function(){var _t=this;return _t.graphicObject?_t.graphicObject.isImage():false};DrawingBase.prototype.isShape=function(){var _t=this;return _t.graphicObject?_t.graphicObject.isShape():false};DrawingBase.prototype.isGroup=function(){var _t= this;return _t.graphicObject?_t.graphicObject.isGroup():false};DrawingBase.prototype.isChart=function(){var _t=this;return _t.graphicObject?_t.graphicObject.isChart():false};DrawingBase.prototype.isGraphicObject=function(){var _t=this;return _t.graphicObject!=null};DrawingBase.prototype.isLocked=function(){var _t=this;return _t.graphicObject.lockType!=c_oAscLockTypes.kLockTypeNone&&_t.graphicObject.lockType!=c_oAscLockTypes.kLockTypeMine};DrawingBase.prototype.getCanvasContext=function(){return _this.drawingDocument.CanvasHitContext}; DrawingBase.prototype.getGraphicObjectMetrics=function(){var _t=this;var metrics={x:0,y:0,extX:0,extY:0};var coordsFrom,coordsTo;switch(_t.Type){case c_oAscCellAnchorType.cellanchorAbsolute:{metrics.x=this.Pos.X;metrics.y=this.Pos.Y;metrics.extX=this.ext.cx;metrics.extY=this.ext.cy;break}case c_oAscCellAnchorType.cellanchorOneCell:{if(worksheet){coordsFrom=_this.calculateCoords(_t.from);metrics.x=pxToMm(coordsFrom.x);metrics.y=pxToMm(coordsFrom.y);metrics.extX=this.ext.cx;metrics.extY=this.ext.cy}break}case c_oAscCellAnchorType.cellanchorTwoCell:{if(worksheet){coordsFrom= _this.calculateCoords(_t.from);metrics.x=pxToMm(coordsFrom.x);metrics.y=pxToMm(coordsFrom.y);coordsTo=_this.calculateCoords(_t.to);metrics.extX=pxToMm(coordsTo.x-coordsFrom.x);metrics.extY=pxToMm(coordsTo.y-coordsFrom.y)}break}}if(metrics.extX<0)metrics.extX=0;if(metrics.extY<0)metrics.extY=0;return metrics};DrawingBase.prototype._getGraphicObjectCoords=function(){var _t=this;if(_t.isGraphicObject()){var ret={Pos:{},ext:{},from:{},to:{}};var rot=AscFormat.isRealNumber(_t.graphicObject.rot)?_t.graphicObject.rot: 0;rot=AscFormat.normalizeRotate(rot);var fromX,fromY,toX,toY;if(AscFormat.checkNormalRotate(rot)){fromX=mmToPx(_t.graphicObject.x);fromY=mmToPx(_t.graphicObject.y);toX=mmToPx(_t.graphicObject.x+_t.graphicObject.extX);toY=mmToPx(_t.graphicObject.y+_t.graphicObject.extY);ret.Pos.X=_t.graphicObject.x;ret.Pos.Y=_t.graphicObject.y;ret.ext.cx=_t.graphicObject.extX;ret.ext.cy=_t.graphicObject.extY}else{var _xc,_yc;_xc=_t.graphicObject.x+_t.graphicObject.extX/2;_yc=_t.graphicObject.y+_t.graphicObject.extY/ 2;fromX=mmToPx(_xc-_t.graphicObject.extY/2);fromY=mmToPx(_yc-_t.graphicObject.extX/2);toX=mmToPx(_xc+_t.graphicObject.extY/2);toY=mmToPx(_yc+_t.graphicObject.extX/2);ret.Pos.X=_xc-_t.graphicObject.extY/2;ret.Pos.Y=_yc-_t.graphicObject.extX/2;ret.ext.cx=_t.graphicObject.extY;ret.ext.cy=_t.graphicObject.extX}var fromColCell=worksheet.findCellByXY(fromX,fromY,true,false,true);var fromRowCell=worksheet.findCellByXY(fromX,fromY,true,true,false);var toColCell=worksheet.findCellByXY(toX,toY,true,false,true); var toRowCell=worksheet.findCellByXY(toX,toY,true,true,false);ret.from.col=fromColCell.col;ret.from.colOff=pxToMm(fromColCell.colOff);ret.from.row=fromRowCell.row;ret.from.rowOff=pxToMm(fromRowCell.rowOff);ret.to.col=toColCell.col;ret.to.colOff=pxToMm(toColCell.colOff);ret.to.row=toRowCell.row;ret.to.rowOff=pxToMm(toRowCell.rowOff);return ret}return null};DrawingBase.prototype.setGraphicObjectCoords=function(){var _t=this;var oCoords=this._getGraphicObjectCoords();if(oCoords){this.Pos.X=oCoords.Pos.X; this.Pos.Y=oCoords.Pos.Y;this.ext.cx=oCoords.ext.cx;this.ext.cy=oCoords.ext.cy;this.from.col=oCoords.from.col;this.from.colOff=oCoords.from.colOff;this.from.row=oCoords.from.row;this.from.rowOff=oCoords.from.rowOff;this.to.col=oCoords.to.col;this.to.colOff=oCoords.to.colOff;this.to.row=oCoords.to.row;this.to.rowOff=oCoords.to.rowOff}if(_t.isGraphicObject()){var rot=AscFormat.isRealNumber(_t.graphicObject.rot)?_t.graphicObject.rot:0;rot=AscFormat.normalizeRotate(rot);var fromX,fromY,toX,toY;if(AscFormat.checkNormalRotate(rot)){fromX= mmToPx(_t.graphicObject.x);fromY=mmToPx(_t.graphicObject.y);toX=mmToPx(_t.graphicObject.x+_t.graphicObject.extX);toY=mmToPx(_t.graphicObject.y+_t.graphicObject.extY);this.Pos.X=_t.graphicObject.x;this.Pos.Y=_t.graphicObject.y;this.ext.cx=_t.graphicObject.extX;this.ext.cy=_t.graphicObject.extY}else{var _xc,_yc;_xc=_t.graphicObject.x+_t.graphicObject.extX/2;_yc=_t.graphicObject.y+_t.graphicObject.extY/2;fromX=mmToPx(_xc-_t.graphicObject.extY/2);fromY=mmToPx(_yc-_t.graphicObject.extX/2);toX=mmToPx(_xc+ _t.graphicObject.extY/2);toY=mmToPx(_yc+_t.graphicObject.extX/2);this.Pos.X=_xc-_t.graphicObject.extY/2;this.Pos.Y=_yc-_t.graphicObject.extX/2;this.ext.cx=_t.graphicObject.extY;this.ext.cy=_t.graphicObject.extX}var fromColCell=worksheet.findCellByXY(fromX,fromY,true,false,true);var fromRowCell=worksheet.findCellByXY(fromX,fromY,true,true,false);var toColCell=worksheet.findCellByXY(toX,toY,true,false,true);var toRowCell=worksheet.findCellByXY(toX,toY,true,true,false);_t.from.col=fromColCell.col;_t.from.colOff= pxToMm(fromColCell.colOff);_t.from.row=fromRowCell.row;_t.from.rowOff=pxToMm(fromRowCell.rowOff);_t.to.col=toColCell.col;_t.to.colOff=pxToMm(toColCell.colOff);_t.to.row=toRowCell.row;_t.to.rowOff=pxToMm(toRowCell.rowOff)}};DrawingBase.prototype.checkBoundsFromTo=function(){var _t=this;if(_t.isGraphicObject()&&_t.graphicObject.bounds){var bounds=_t.graphicObject.bounds;var fromX=mmToPx(bounds.x>0?bounds.x:0),fromY=mmToPx(bounds.y>0?bounds.y:0),toX=mmToPx(bounds.x+bounds.w),toY=mmToPx(bounds.y+bounds.h); if(toX<0)toX=0;if(toY<0)toY=0;var fromColCell=worksheet.findCellByXY(fromX,fromY,true,false,true);var fromRowCell=worksheet.findCellByXY(fromX,fromY,true,true,false);var toColCell=worksheet.findCellByXY(toX,toY,true,false,true);var toRowCell=worksheet.findCellByXY(toX,toY,true,true,false);_t.boundsFromTo.from.col=fromColCell.col;_t.boundsFromTo.from.colOff=pxToMm(fromColCell.colOff);_t.boundsFromTo.from.row=fromRowCell.row;_t.boundsFromTo.from.rowOff=pxToMm(fromRowCell.rowOff);_t.boundsFromTo.to.col= toColCell.col;_t.boundsFromTo.to.colOff=pxToMm(toColCell.colOff);_t.boundsFromTo.to.row=toRowCell.row;_t.boundsFromTo.to.rowOff=pxToMm(toRowCell.rowOff)}};DrawingBase.prototype.getRealTopOffset=function(){var _t=this;var val=_t.worksheet._getRowTop(_t.from.row)+mmToPx(_t.from.rowOff);return asc.round(val)};DrawingBase.prototype.getRealLeftOffset=function(){var _t=this;var val=_t.worksheet._getColLeft(_t.from.col)+mmToPx(_t.from.colOff);return asc.round(val)};DrawingBase.prototype.getWidthFromTo=function(){return this.worksheet._getColLeft(this.to.col)+ mmToPx(this.to.colOff)-this.worksheet._getColLeft(this.from.col)-mmToPx(this.from.colOff)};DrawingBase.prototype.getHeightFromTo=function(){return this.worksheet._getRowTop(this.to.row)+mmToPx(this.to.rowOff)-this.worksheet._getRowTop(this.from.row)-mmToPx(this.from.rowOff)};DrawingBase.prototype.getVisibleTopOffset=function(withHeader){var _t=this;var headerRowOff=_t.worksheet._getRowTop(0);var fvr=_t.worksheet._getRowTop(_t.worksheet.getFirstVisibleRow(true));var off=_t.getRealTopOffset()-fvr;off= off>0?off:0;return withHeader?headerRowOff+off:off};DrawingBase.prototype.getVisibleLeftOffset=function(withHeader){var _t=this;var headerColOff=_t.worksheet._getColLeft(0);var fvc=_t.worksheet._getColLeft(_t.worksheet.getFirstVisibleCol(true));var off=_t.getRealLeftOffset()-fvc;off=off>0?off:0;return withHeader?headerColOff+off:off};DrawingBase.prototype.getDrawingObjects=function(){return _this};DrawingBase.prototype.checkTarget=function(target,bEdit){if(!this.graphicObject)return false;if(AscCommon.isFileBuild())return false; var bUpdateExtents=false;var nType=bEdit?this.graphicObject.getDrawingBaseType():this.Type;if(target.target===AscCommonExcel.c_oTargetType.RowResize)if(nType===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell||nType===AscCommon.c_oAscCellAnchorType.cellanchorOneCell)if(this.from.row>=target.row)bUpdateExtents=true;else{if(this.to.row>=target.row&&nType===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)bUpdateExtents=true}else{this.checkBoundsFromTo();if(this.boundsFromTo.to.row>=target.row)bUpdateExtents= true}else if(nType===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell||nType===AscCommon.c_oAscCellAnchorType.cellanchorOneCell)if(this.from.col>=target.col)bUpdateExtents=true;else{if(this.to.col>=target.col&&nType===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)bUpdateExtents=true}else{this.checkBoundsFromTo();if(this.boundsFromTo.to.col>=target.col)bUpdateExtents=true}return bUpdateExtents};DrawingBase.prototype.draw=function(graphics){if(this.graphicObject)this.graphicObject.draw(graphics)}; DrawingBase.prototype.getBoundsFromTo=function(){return this.boundsFromTo};DrawingBase.prototype.onUpdate=function(oRect){if(AscCommon.isFileBuild())return;var oDO=this.getDrawingObjects();if(!oDO)return;var oRange,oClipRect=null;if(this.isUseInDocument())if(!oRect){var oB=this.getBoundsFromTo();var c1=oB.from.col;var r1=oB.from.row;var c2=oB.to.col;var r2=oB.to.row;oRange=new Asc.Range(c1,r1,c2,r2,true);oClipRect=worksheet.rangeToRectAbs(oRange,3)}else oClipRect=oRect;oDO.showDrawingObjects(new AscFormat.GraphicOption(oClipRect))}; DrawingBase.prototype.onSlicerUpdate=function(sName){if(!this.graphicObject)return false;return this.graphicObject.onSlicerUpdate(sName)};DrawingBase.prototype.onSlicerDelete=function(sName){if(!this.graphicObject)return false;return this.graphicObject.onSlicerDelete(sName)};DrawingBase.prototype.onSlicerLock=function(sName,bLock){if(!this.graphicObject)return;this.graphicObject.onSlicerLock(sName,bLock)};DrawingBase.prototype.onSlicerChangeName=function(sName,sNewName){if(!this.graphicObject)return; this.graphicObject.onSlicerChangeName(sName,sNewName)};DrawingBase.prototype.getSlicerViewByName=function(name){if(!this.graphicObject)return;return this.graphicObject.getSlicerViewByName(name)};_this.addShapeOnSheet=function(sType){if(this.controller)if(_this.canEdit()){_this.controller.resetSelection();var activeCell=worksheet.model.selectionRange.activeCell;var metrics={};metrics.col=activeCell.col;metrics.colOff=0;metrics.row=activeCell.row;metrics.rowOff=0;var coordsFrom=_this.calculateCoords(metrics); var ext_x,ext_y;var oExt=AscFormat.fGetDefaultShapeExtents(sType);ext_x=oExt.x;ext_y=oExt.y;History.Create_NewPoint();var posX=pxToMm(coordsFrom.x)+MOVE_DELTA;var posY=pxToMm(coordsFrom.y)+MOVE_DELTA;var oTrack=new AscFormat.NewShapeTrack(sType,posX,posY,_this.controller.getTheme(),null,null,null,0);oTrack.track({},posX+ext_x,posY+ext_y);var oShape=oTrack.getShape(false,_this.drawingDocument,null);oShape.setWorksheet(worksheet.model);oShape.addToDrawingObjects();oShape.checkDrawingBaseCoords();oShape.select(_this.controller, 0);_this.controller.startRecalculate();worksheet.setSelectionShape(true)}};_this.getScrollOffset=function(){return scrollOffset};_this.saveStateBeforeLoadChanges=function(){if(this.controller){oStateBeforeLoadChanges={};this.controller.Save_DocumentStateBeforeLoadChanges(oStateBeforeLoadChanges)}else oStateBeforeLoadChanges=null;return oStateBeforeLoadChanges};_this.loadStateAfterLoadChanges=function(){if(_this.controller){_this.controller.clearPreTrackObjects();_this.controller.clearTrackObjects(); _this.controller.resetSelection();_this.controller.changeCurrentState(new AscFormat.NullState(this.controller));if(oStateBeforeLoadChanges)_this.controller.loadDocumentStateAfterLoadChanges(oStateBeforeLoadChanges)}oStateBeforeLoadChanges=null;return oStateBeforeLoadChanges};_this.getStateBeforeLoadChanges=function(){return oStateBeforeLoadChanges};_this.createDrawingObject=function(type){var drawingBase=new DrawingBase(worksheet);if(AscFormat.isRealNumber(type))drawingBase.Type=type;return drawingBase}; _this.cloneDrawingObject=function(object){var copyObject=_this.createDrawingObject();copyObject.Type=object.Type;copyObject.editAs=object.editAs;copyObject.Pos.X=object.Pos.X;copyObject.Pos.Y=object.Pos.Y;copyObject.ext.cx=object.ext.cx;copyObject.ext.cy=object.ext.cy;copyObject.from.col=object.from.col;copyObject.from.colOff=object.from.colOff;copyObject.from.row=object.from.row;copyObject.from.rowOff=object.from.rowOff;copyObject.to.col=object.to.col;copyObject.to.colOff=object.to.colOff;copyObject.to.row= object.to.row;copyObject.to.rowOff=object.to.rowOff;copyObject.boundsFromTo.from.col=object.boundsFromTo.from.col;copyObject.boundsFromTo.from.colOff=object.boundsFromTo.from.colOff;copyObject.boundsFromTo.from.row=object.boundsFromTo.from.row;copyObject.boundsFromTo.from.rowOff=object.boundsFromTo.from.rowOff;copyObject.boundsFromTo.to.col=object.boundsFromTo.to.col;copyObject.boundsFromTo.to.colOff=object.boundsFromTo.to.colOff;copyObject.boundsFromTo.to.row=object.boundsFromTo.to.row;copyObject.boundsFromTo.to.rowOff= object.boundsFromTo.to.rowOff;copyObject.graphicObject=object.graphicObject;return copyObject};_this.createShapeAndInsertContent=function(oParaContent){var track_object=new AscFormat.NewShapeTrack("textRect",0,0,Asc["editor"].wbModel.theme,null,null,null,0);track_object.track({},0,0);var shape=track_object.getShape(false,_this.drawingDocument,this);shape.spPr.setFill(AscFormat.CreateNoFillUniFill());shape.txBody.content.Content[0].Add_ToContent(0,oParaContent.Copy());var body_pr=shape.getBodyPr(); var w=shape.txBody.getMaxContentWidth(150,true)+body_pr.lIns+body_pr.rIns;var h=shape.txBody.content.GetSummaryHeight()+body_pr.tIns+body_pr.bIns;shape.spPr.xfrm.setExtX(w);shape.spPr.xfrm.setExtY(h);shape.spPr.xfrm.setOffX(0);shape.spPr.xfrm.setOffY(0);shape.spPr.setLn(AscFormat.CreateNoFillLine());shape.setWorksheet(worksheet.model);return shape};_this.init=function(currentSheet){var api=window["Asc"]["editor"];worksheet=currentSheet;drawingCtx=currentSheet.drawingGraphicCtx;overlayCtx=currentSheet.overlayGraphicCtx; _this.objectLocker=new ObjectLocker(worksheet);_this.drawingArea=currentSheet.drawingArea;_this.drawingArea.init();_this.drawingDocument=currentSheet.getDrawingDocument();_this.drawingDocument.drawingObjects=this;_this.drawingDocument.AutoShapesTrack=api.wb.autoShapeTrack;_this.drawingDocument.TargetHtmlElement=document.getElementById("id_target_cursor");_this.drawingDocument.InitGuiCanvasShape(api.shapeElementId);_this.controller=new AscFormat.DrawingObjectsController(_this);_this.canEdit=function(){return api.canEdit()}; aImagesSync=[];var i;aObjects=currentSheet.model.Drawings;for(i=0;currentSheet.model.Drawings&&i<currentSheet.model.Drawings.length;i++){aObjects[i]=_this.cloneDrawingObject(aObjects[i]);var drawingObject=aObjects[i];drawingObject.drawingArea=_this.drawingArea;drawingObject.worksheet=currentSheet;drawingObject.graphicObject.drawingBase=aObjects[i];drawingObject.graphicObject.drawingObjects=_this;drawingObject.graphicObject.getAllRasterImages(aImagesSync)}for(i=0;i<aImagesSync.length;++i){var localUrl= aImagesSync[i];if(api.DocInfo&&api.DocInfo.get_OfflineApp())AscCommon.g_oDocumentUrls.addImageUrl(localUrl,"/sdkjs/cell/document/media/"+localUrl);aImagesSync[i]=AscCommon.getFullImageSrc2(localUrl)}if(aImagesSync.length>0){var old_val=api.ImageLoader.bIsAsyncLoadDocumentImages;api.ImageLoader.bIsAsyncLoadDocumentImages=true;api.ImageLoader.LoadDocumentImages(aImagesSync);api.ImageLoader.bIsAsyncLoadDocumentImages=old_val}_this.recalculate(true);worksheet.model.Drawings=aObjects};_this.getSelectedDrawingsRange= function(){var i,rmin=gc_nMaxRow,rmax=0,cmin=gc_nMaxCol,cmax=0,selectedObjects=this.controller.selectedObjects,drawingBase;for(i=0;i<selectedObjects.length;++i){drawingBase=selectedObjects[i].drawingBase;if(drawingBase){if(drawingBase.from.col<cmin)cmin=drawingBase.from.col;if(drawingBase.from.row<rmin)rmin=drawingBase.from.row;if(drawingBase.to.col>cmax)cmax=drawingBase.to.col;if(drawingBase.to.row>rmax)rmax=drawingBase.to.row}}return new Asc.Range(cmin,rmin,cmax,rmax,true)};_this.getContextMenuPosition= function(){if(!worksheet)return new AscCommon.asc_CRect(0,0,5,5);var oPos=this.controller.getContextMenuPosition(0);var _x=oPos.X*Asc.getCvtRatio(3,0,worksheet._getPPIX())+scrollOffset.getX();var _y=oPos.Y*Asc.getCvtRatio(3,0,worksheet._getPPIY())+scrollOffset.getY();return new AscCommon.asc_CRect(_x,_y,0,0)};_this.recalculate=function(all){_this.controller.recalculate2(all)};_this.preCopy=function(){_this.shiftMap={};var selected_objects=_this.controller.selectedObjects;if(selected_objects.length> 0){var min_x,min_y,i;min_x=selected_objects[0].x;min_y=selected_objects[0].y;for(i=1;i<selected_objects.length;++i){if(selected_objects[i].x<min_x)min_x=selected_objects[i].x;if(selected_objects[i].y<min_y)min_y=selected_objects[i].y}for(i=0;i<selected_objects.length;++i)_this.shiftMap[selected_objects[i].Get_Id()]={x:selected_objects[i].x-min_x,y:selected_objects[i].y-min_y}}};_this.getAllFonts=function(AllFonts){};_this.getOverlay=function(){return api.wb.trackOverlay};_this.OnUpdateOverlay=function(){_this.drawingArea.drawSelection(_this.drawingDocument)}; _this.changeZoom=function(factor){_this.zoom.last=_this.zoom.current;_this.zoom.current=factor;_this.resizeCanvas()};_this.resizeCanvas=function(){_this.drawingArea.init()};_this.getCanvasContext=function(){return _this.drawingDocument.CanvasHitContext};_this.getDrawingObjects=function(){return aObjects};_this.getWorksheet=function(){return worksheet};_this.getContextWidth=function(){return drawingCtx.getWidth()};_this.getContextHeight=function(){return drawingCtx.getHeight()};_this.getContext=function(){return drawingCtx}; _this.getWorksheetModel=function(){return worksheet.model};_this.callTrigger=function(triggerName,param){if(triggerName)worksheet.model.workbook.handlers.trigger(triggerName,param)};_this.getDrawingObjectsBounds=function(){var arr_x=[],arr_y=[],bounds;for(var i=0;i<aObjects.length;++i){bounds=aObjects[i].graphicObject.bounds;arr_x.push(bounds.l);arr_x.push(bounds.r);arr_y.push(bounds.t);arr_y.push(bounds.b)}return new DrawingBounds(Math.min.apply(Math,arr_x),Math.max.apply(Math,arr_x),Math.min.apply(Math, arr_y),Math.max.apply(Math,arr_y))};_this.showDrawingObjects=function(graphicOption){if(!worksheet||!worksheet.model||!api||!api.wb||!api.wb.model)return;if(worksheet.model.index!==api.wb.model.getActive())return;var oNewTask;if(graphicOption)oNewTask=graphicOption;else oNewTask=new GraphicOption(null);if(window["IS_NATIVE_EDITOR"]){_this.showDrawingObjectsEx(oNewTask.getRect());return}if(_this.drawTask===null)_this.drawTask=oNewTask;else _this.drawTask=_this.drawTask.union(oNewTask);if(_this.animId=== null)_this.animId=rAF(drawTaskFunction)};_this.showDrawingObjectsEx=function(oUpdateRect){if(!drawingCtx)return;if(worksheet.model.index!==api.wb.model.getActive())return;if(!oUpdateRect)if(!window["IS_NATIVE_EDITOR"])_this.drawingArea.clear();for(var nDrawing=0;nDrawing<aObjects.length;nDrawing++)_this.drawingArea.drawObject(aObjects[nDrawing],oUpdateRect);_this.OnUpdateOverlay();_this.controller.updateSelectionState(true)};_this.updateRange=function(oRange){if(!drawingCtx)return;if(worksheet.model.index!== api.wb.model.getActive())return;for(var nDrawing=0;nDrawing<aObjects.length;nDrawing++)_this.drawingArea.updateRange(aObjects[nDrawing],oRange);_this.OnUpdateOverlay();_this.controller.updateSelectionState(true)};_this.print=function(oOptions){for(var nObject=0;nObject<aObjects.length;++nObject){var oDrawing=aObjects[nObject];oDrawing.draw(oOptions.ctx.DocumentRenderer)}};_this.getDrawingDocument=function(){return _this.drawingDocument};_this.printGraphicObject=function(graphicObject,ctx){if(graphicObject&& ctx)if(graphicObject instanceof AscFormat.CImageShape)printImage(graphicObject,ctx);else if(graphicObject instanceof AscFormat.CShape)printShape(graphicObject,ctx);else if(graphicObject instanceof AscFormat.CChartSpace)printChart(graphicObject,ctx);else if(graphicObject instanceof AscFormat.CGroupShape)printGroup(graphicObject,ctx);function printImage(graphicObject,ctx){if(graphicObject instanceof AscFormat.CImageShape&&graphicObject&&ctx)graphicObject.draw(ctx)}function printShape(graphicObject, ctx){if(graphicObject instanceof AscFormat.CShape&&graphicObject&&ctx)graphicObject.draw(ctx)}function printChart(graphicObject,ctx){if(graphicObject instanceof AscFormat.CChartSpace&&graphicObject&&ctx)graphicObject.draw(ctx)}function printGroup(graphicObject,ctx){if(graphicObject instanceof AscFormat.CGroupShape&&graphicObject&&ctx)for(var i=0;i<graphicObject.arrGraphicObjects.length;i++){var graphicItem=graphicObject.arrGraphicObjects[i];if(graphicItem instanceof AscFormat.CImageShape)printImage(graphicItem, ctx);else if(graphicItem instanceof AscFormat.CShape)printShape(graphicItem,ctx);else if(graphicItem instanceof AscFormat.CChartSpace)printChart(graphicItem,ctx)}}};_this.getMaxColRow=function(){var r=-1,c=-1;aObjects.forEach(function(item){r=Math.max(r,item.boundsFromTo.to.row);c=Math.max(c,item.boundsFromTo.to.col)});return new AscCommon.CellBase(r,c)};_this.calculateObjectMetrics=function(object,width,height){var bCorrect=false;var metricCoeff=1;var coordsFrom=_this.calculateCoords(object.from); var realTopOffset=coordsFrom.y;var realLeftOffset=coordsFrom.x;var areaWidth=worksheet._getColLeft(worksheet.getLastVisibleCol())-worksheet._getColLeft(worksheet.getFirstVisibleCol(true));if(areaWidth<width){metricCoeff=width/areaWidth;width=areaWidth;height/=metricCoeff;bCorrect=true}var areaHeight=worksheet._getRowTop(worksheet.getLastVisibleRow())-worksheet._getRowTop(worksheet.getFirstVisibleRow(true));if(areaHeight<height){metricCoeff=height/areaHeight;height=areaHeight;width/=metricCoeff;bCorrect= true}var toCell=worksheet.findCellByXY(realLeftOffset+width,realTopOffset+height,true,false,false);object.to.col=toCell.col;object.to.colOff=pxToMm(toCell.colOff);object.to.row=toCell.row;object.to.rowOff=pxToMm(toCell.rowOff);return bCorrect};_this.addImageObjectCallback=function(_image,options){var isOption=options&&options.cell;if(!_image.Image)worksheet.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.UplImageUrl,c_oAscError.Level.NoCritical);else{var drawingObject=_this.createDrawingObject(); drawingObject.worksheet=worksheet;var activeCell=worksheet.model.selectionRange.activeCell;drawingObject.from.col=isOption?options.cell.col:activeCell.col;drawingObject.from.row=isOption?options.cell.row:activeCell.row;var oSize;if(!isOption){var oImgP=new Asc.asc_CImgProperty;oImgP.ImageUrl=_image.src;oSize=oImgP.asc_getOriginSize(api)}else oSize=new asc_CImageSize(Math.max(options.width*AscCommon.g_dKoef_pix_to_mm,1),Math.max(options.height*AscCommon.g_dKoef_pix_to_mm,1),true);var bCorrect=_this.calculateObjectMetrics(drawingObject, mmToPx(oSize.asc_getImageWidth()),mmToPx(oSize.asc_getImageHeight()));var coordsFrom=_this.calculateCoords(drawingObject.from);var coordsTo=_this.calculateCoords(drawingObject.to);if(bCorrect)_this.controller.addImageFromParams(_image.src,pxToMm(coordsFrom.x)+MOVE_DELTA,pxToMm(coordsFrom.y)+MOVE_DELTA,pxToMm(coordsTo.x-coordsFrom.x),pxToMm(coordsTo.y-coordsFrom.y));else _this.controller.addImageFromParams(_image.src,pxToMm(coordsFrom.x)+MOVE_DELTA,pxToMm(coordsFrom.y)+MOVE_DELTA,oSize.asc_getImageWidth(), oSize.asc_getImageHeight())}};_this.addImageDrawingObject=function(imageUrls,options){if(imageUrls&&_this.canEdit())api.ImageLoader.LoadImagesWithCallback(imageUrls,function(){_this.controller.resetSelection();History.Create_NewPoint();for(var i=0;i<imageUrls.length;++i){var sImageUrl=imageUrls[i];var _image=api.ImageLoader.LoadImage(sImageUrl,1);if(null!=_image)_this.addImageObjectCallback(_image,options);else{worksheet.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.UplImageUrl,c_oAscError.Level.NoCritical); break}}_this.controller.startRecalculate();worksheet.setSelectionShape(true)},[])};_this.addTextArt=function(nStyle){if(_this.canEdit()){var oVisibleRange=worksheet.getVisibleRange();_this.controller.resetSelection();var dLeft=worksheet.getCellLeft(oVisibleRange.c1,3);var dTop=worksheet.getCellTop(oVisibleRange.r1,3);var dRight=worksheet.getCellLeft(oVisibleRange.c2,3)+worksheet.getColumnWidth(oVisibleRange.c2,3);var dBottom=worksheet.getCellTop(oVisibleRange.r2,3)+worksheet.getRowHeight(oVisibleRange.r2, 3);_this.controller.addTextArtFromParams(nStyle,dLeft,dTop,dRight-dLeft,dBottom-dTop,worksheet.model);worksheet.setSelectionShape(true)}};_this.addSlicers=function(aNames){if(_this.canEdit())if(Array.isArray(aNames)&&aNames.length>0){var oVisibleRange=worksheet.getVisibleRange();var nSlicerCount=aNames.length;var dSlicerWidth=2*25.4;var dSlicerHeight=2.76*25.4;var dSlicerInset=10;var dTotalWidth=dSlicerWidth+nSlicerCount*dSlicerInset;var dTotalHeight=dSlicerHeight+nSlicerCount*dSlicerInset;var dLeft= worksheet.getCellLeft(oVisibleRange.c1,3);var dTop=worksheet.getCellTop(oVisibleRange.r1,3);var dRight=worksheet.getCellLeft(oVisibleRange.c2,3)+worksheet.getColumnWidth(oVisibleRange.c2,3);var dBottom=worksheet.getCellTop(oVisibleRange.r2,3)+worksheet.getRowHeight(oVisibleRange.r2,3);_this.controller.resetSelection();var dStartPosX=Math.max(0,(dLeft+dRight)/2-dTotalWidth/2);var dStartPosY=Math.max(0,(dTop+dBottom)/2-dTotalHeight/2);var oSlicer,x,y;for(var nSlicerIndex=0;nSlicerIndex<nSlicerCount;++nSlicerIndex){oSlicer= new AscFormat.CSlicer;oSlicer.setName(aNames[nSlicerIndex]);x=dStartPosX+dSlicerInset*nSlicerIndex;y=dStartPosY+dSlicerInset*nSlicerIndex;oSlicer.setBDeleted(false);oSlicer.setWorksheet(worksheet.model);oSlicer.setTransformParams(x,y,dSlicerWidth,dSlicerHeight,0,false,false);oSlicer.addToDrawingObjects(undefined,AscCommon.c_oAscCellAnchorType.cellanchorAbsolute);oSlicer.checkDrawingBaseCoords()}_this.controller.startRecalculate();oSlicer.select(_this.controller,0);worksheet.setSelectionShape(true)}}; _this.addSignatureLine=function(oPr,Width,Height,sImgUrl){var oApi=window["Asc"]["editor"];var sGuid=oPr.asc_getGuid();var oSpToEdit=null;if(sGuid){var oDrawingObjects=this.controller;var ret=[],allSpr=[];allSpr=allSpr.concat(allSpr.concat(oDrawingObjects.getAllSignatures2(ret,oDrawingObjects.getDrawingArray())));for(var i=0;i<allSpr.length;++i)if(allSpr[i].getSignatureLineGuid()===sGuid){oSpToEdit=allSpr[i];break}}History.Create_NewPoint();if(!oSpToEdit){_this.controller.resetSelection();var dLeft= worksheet.getCellLeft(worksheet.model.selectionRange.activeCell.col,3);var dTop=worksheet.getCellTop(worksheet.model.selectionRange.activeCell.row,3);var oSignatureLine=AscFormat.fCreateSignatureShape(oPr,false,worksheet.model,Width,Height,sImgUrl);oSignatureLine.spPr.xfrm.setOffX(dLeft);oSignatureLine.spPr.xfrm.setOffY(dTop);oSignatureLine.addToDrawingObjects();oSignatureLine.checkDrawingBaseCoords();_this.controller.selectObject(oSignatureLine,0);worksheet.setSelectionShape(true);oApi.sendEvent("asc_onAddSignature", oSignatureLine.signatureLine.id)}else{oSpToEdit.setSignaturePr(oPr,sImgUrl);oApi.sendEvent("asc_onAddSignature",sGuid)}_this.controller.startRecalculate()};_this.addMath=function(Type){if(_this.canEdit()&&_this.controller){var oTargetContent=_this.controller.getTargetDocContent();if(oTargetContent){_this.controller.checkSelectedObjectsAndCallback(function(){var MathElement=new AscCommonWord.MathMenu(Type);_this.controller.paragraphAdd(MathElement,false)},[],false,AscDFH.historydescription_Spreadsheet_CreateGroup); return}_this.controller.resetSelection();var activeCell=worksheet.model.selectionRange.activeCell;var coordsFrom=_this.calculateCoords({col:activeCell.col,row:activeCell.row,colOff:0,rowOff:0});History.Create_NewPoint();var oSp=_this.controller.createTextArt(0,false,worksheet.model,"");_this.controller.resetSelection();oSp.setWorksheet(_this.controller.drawingObjects.getWorksheetModel());oSp.setDrawingObjects(_this.controller.drawingObjects);oSp.addToDrawingObjects();var oContent=oSp.getDocContent(); if(oContent){oContent.MoveCursorToStartPos(false);oContent.AddToParagraph(new AscCommonWord.MathMenu(Type),false)}oSp.checkExtentsByDocContent();oSp.spPr.xfrm.setOffX(pxToMm(coordsFrom.x)+MOVE_DELTA);oSp.spPr.xfrm.setOffY(pxToMm(coordsFrom.y)+MOVE_DELTA);oSp.checkDrawingBaseCoords();_this.controller.selectObject(oSp,0);_this.controller.selection.textSelection=oSp;oSp.addToRecalculate();_this.controller.startRecalculate();worksheet.setSelectionShape(true)}};_this.setMathProps=function(MathProps){_this.controller.setMathProps(MathProps)}; _this.setListType=function(type,subtype){var NumberInfo={Type:0,SubType:-1};NumberInfo.Type=type;NumberInfo.SubType=subtype;_this.controller.checkSelectedObjectsAndCallback(_this.controller.setParagraphNumbering,[AscFormat.fGetPresentationBulletByNumInfo(NumberInfo)],false,AscDFH.historydescription_Presentation_SetParagraphNumbering)};_this.editImageDrawingObject=function(imageUrl,obj){if(imageUrl){var _image=api.ImageLoader.LoadImage(imageUrl,1);var addImageObject=function(_image){if(!_image.Image)worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl,c_oAscError.Level.NoCritical);else{if(obj&&obj.isImageChangeUrl){var imageProp=new Asc.asc_CImgProperty;imageProp.ImageUrl=_image.src;_this.setGraphicObjectProps(imageProp)}else if(obj&&obj.isShapeImageChangeUrl){var imgProps=new Asc.asc_CImgProperty;var shapeProp=new Asc.asc_CShapeProperty;imgProps.ShapeProperties=shapeProp;shapeProp.fill=new Asc.asc_CShapeFill;shapeProp.fill.type=Asc.c_oAscFill.FILL_TYPE_BLIP;shapeProp.fill.fill=new Asc.asc_CFillBlip;shapeProp.fill.fill.asc_putUrl(_image.src); if(obj.textureType!==null&&obj.textureType!==undefined)shapeProp.fill.fill.asc_putType(obj.textureType);_this.setGraphicObjectProps(imgProps)}else if(obj&&obj.isTextArtChangeUrl){var imgProps=new Asc.asc_CImgProperty;var AscShapeProp=new Asc.asc_CShapeProperty;imgProps.ShapeProperties=AscShapeProp;var oFill=new Asc.asc_CShapeFill;oFill.type=Asc.c_oAscFill.FILL_TYPE_BLIP;oFill.fill=new Asc.asc_CFillBlip;oFill.fill.asc_putUrl(imageUrl);if(obj.textureType!==null&&obj.textureType!==undefined)oFill.fill.asc_putType(obj.textureType); AscShapeProp.textArtProperties=new Asc.asc_TextArtProperties;AscShapeProp.textArtProperties.asc_putFill(oFill);_this.setGraphicObjectProps(imgProps)}_this.showDrawingObjects()}};if(null!=_image)addImageObject(_image);else _this.asyncImageEndLoaded=function(_image){addImageObject(_image);_this.asyncImageEndLoaded=null}}};_this.addChartDrawingObject=function(chart){if(!_this.canEdit())return;worksheet.setSelectionShape(true);if(chart instanceof Asc.asc_ChartSettings){if(api.isChartEditor){_this.controller.selectObject(aObjects[0].graphicObject, 0);_this.controller.editChartDrawingObjects(chart);return}_this.controller.addChartDrawingObject(chart)}else if(isObject(chart)&&chart["binary"]){var model=worksheet.model;History.Clear();for(var i=0;i<aObjects.length;i++)aObjects[i].graphicObject.deleteDrawingBase();aObjects.length=0;var oAllRange=model.getRange3(0,0,model.getRowsCount(),model.getColsCount());oAllRange.cleanAll();worksheet.endEditChart();var asc_chart_binary=new Asc.asc_CChartBinary;asc_chart_binary.asc_setBinary(chart["binary"]); asc_chart_binary.asc_setThemeBinary(chart["themeBinary"]);asc_chart_binary.asc_setColorMapBinary(chart["colorMapBinary"]);var oNewChartSpace=asc_chart_binary.getChartSpace(model);var theme=asc_chart_binary.getTheme();if(theme)model.workbook.theme=theme;if(chart["cTitle"]||chart["cDescription"]){if(!oNewChartSpace.nvGraphicFramePr){var nv_sp_pr=new AscFormat.UniNvPr;nv_sp_pr.cNvPr.setId(1024);oNewChartSpace.setNvSpPr(nv_sp_pr)}oNewChartSpace.setTitle(chart["cTitle"]);oNewChartSpace.setDescription(chart["cDescription"])}var colorMapOverride= asc_chart_binary.getColorMap();if(colorMapOverride)AscFormat.DEFAULT_COLOR_MAP=colorMapOverride;if(typeof chart["urls"]==="string")AscCommon.g_oDocumentUrls.addUrls(JSON.parse(chart["urls"]));var font_map={};oNewChartSpace.documentGetAllFontNames(font_map);AscFormat.checkThemeFonts(font_map,model.workbook.theme.themeElements.fontScheme);window["Asc"]["editor"]._loadFonts(font_map,function(){var max_r=0,max_c=0;var series=oNewChartSpace.getAllSeries(),ser;function fFillCell(oCell,sNumFormat,value){var oCellValue= new AscCommonExcel.CCellValue;if(AscFormat.isRealNumber(value)){oCellValue.number=value;oCellValue.type=AscCommon.CellValueType.Number}else{oCellValue.text=value;oCellValue.type=AscCommon.CellValueType.String}oCell.setNumFormat(sNumFormat);oCell.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,oCellValue))}function fillTableFromRef(ref){var cache=ref.numCache?ref.numCache:ref.strCache?ref.strCache:null;var lit_format_code;if(cache){lit_format_code=typeof cache.formatCode==="string"&& cache.formatCode.length>0?cache.formatCode:"General";var sFormula=ref.f+"";if(sFormula[0]==="(")sFormula=sFormula.slice(1);if(sFormula[sFormula.length-1]===")")sFormula=sFormula.slice(0,-1);var f1=sFormula;var arr_f=f1.split(",");var pt_index=0,i,j,pt,nPtCount,k;for(i=0;i<arr_f.length;++i){var parsed_ref=parserHelp.parse3DRef(arr_f[i]);if(parsed_ref){var source_worksheet=model.workbook.getWorksheetByName(parsed_ref.sheet);if(source_worksheet===model){var range=source_worksheet.getRange2(parsed_ref.range); if(range){range=range.bbox;if(range.r1>max_r)max_r=range.r1;if(range.r2>max_r)max_r=range.r2;if(range.c1>max_c)max_c=range.c1;if(range.c2>max_c)max_c=range.c2;if(i===arr_f.length-1){nPtCount=cache.getPtCount();if(nPtCount-pt_index<=range.r2-range.r1+1){for(k=range.c1;k<=range.c2;++k)for(j=range.r1;j<=range.r2;++j)source_worksheet._getCell(j,k,function(cell){pt=cache.getPtByIndex(pt_index+j-range.r1);if(pt)fFillCell(cell,typeof pt.formatCode==="string"&&pt.formatCode.length>0?pt.formatCode:lit_format_code, pt.val)});pt_index+=range.r2-range.r1+1}else if(nPtCount-pt_index<=range.c2-range.c1+1){for(k=range.r1;k<=range.r2;++k)for(j=range.c1;j<=range.c2;++j)source_worksheet._getCell(k,j,function(cell){pt=cache.getPtByIndex(pt_index+j-range.c1);if(pt)fFillCell(cell,typeof pt.formatCode==="string"&&pt.formatCode.length>0?pt.formatCode:lit_format_code,pt.val)});pt_index+=range.c2-range.c1+1}}else if(range.r1===range.r2)for(j=range.c1;j<=range.c2;++j)source_worksheet._getCell(range.r1,j,function(cell){pt=cache.getPtByIndex(pt_index); if(pt)fFillCell(cell,typeof pt.formatCode==="string"&&pt.formatCode.length>0?pt.formatCode:lit_format_code,pt.val);++pt_index});else for(j=range.r1;j<=range.r2;++j)source_worksheet._getCell(j,range.c1,function(cell){pt=cache.getPtByIndex(pt_index);if(pt)fFillCell(cell,typeof pt.formatCode==="string"&&pt.formatCode.length>0?pt.formatCode:lit_format_code,pt.val);++pt_index})}}}}}}var first_num_ref;if(series[0])if(series[0].val)first_num_ref=series[0].val.numRef;else if(series[0].yVal)first_num_ref= series[0].yVal.numRef;if(first_num_ref){var resultRef=parserHelp.parse3DRef(first_num_ref.f);if(resultRef){model.workbook.aWorksheets[0].sName=resultRef.sheet;var oCat,oVal;for(var i=0;i<series.length;++i){ser=series[i];oVal=ser.val||ser.yVal;if(oVal&&oVal.numRef)fillTableFromRef(oVal.numRef);oCat=ser.cat||ser.xVal;if(oCat){if(oCat.numRef)fillTableFromRef(oCat.numRef);if(oCat.strRef)fillTableFromRef(oCat.strRef)}if(ser.tx&&ser.tx.strRef)fillTableFromRef(ser.tx.strRef)}}}oAllRange=oAllRange.bbox;oAllRange.r2= Math.max(oAllRange.r2,max_r);oAllRange.c2=Math.max(oAllRange.c2,max_c);worksheet._updateRange(oAllRange);worksheet.draw();aImagesSync.length=0;oNewChartSpace.getAllRasterImages(aImagesSync);oNewChartSpace.setBDeleted(false);oNewChartSpace.setWorksheet(model);oNewChartSpace.addToDrawingObjects();oNewChartSpace.recalcInfo.recalculateReferences=false;var oDrawingBase_=oNewChartSpace.drawingBase;oNewChartSpace.drawingBase=null;oNewChartSpace.recalculate();AscFormat.CheckSpPrXfrm(oNewChartSpace);oNewChartSpace.drawingBase= oDrawingBase_;var canvas_height=worksheet.drawingCtx.getHeight(3);var pos_y=(canvas_height-oNewChartSpace.spPr.xfrm.extY)/2;if(pos_y<0)pos_y=0;var canvas_width=worksheet.drawingCtx.getWidth(3);var pos_x=(canvas_width-oNewChartSpace.spPr.xfrm.extX)/2;if(pos_x<0)pos_x=0;oNewChartSpace.spPr.xfrm.setOffX(pos_x);oNewChartSpace.spPr.xfrm.setOffY(pos_y);oNewChartSpace.checkDrawingBaseCoords();oNewChartSpace.recalculate();worksheet._scrollToRange(_this.getSelectedDrawingsRange());_this.showDrawingObjects(); _this.controller.resetSelection();_this.controller.selectObject(oNewChartSpace,0);_this.controller.updateSelectionState();_this.sendGraphicObjectProps();if(aImagesSync.length>0)window["Asc"]["editor"].ImageLoader.LoadDocumentImages(aImagesSync);History.Clear()})}};_this.editChartDrawingObject=function(chart){if(chart){if(api.isChartEditor)_this.controller.selectObject(aObjects[0].graphicObject,0);_this.controller.editChartDrawingObjects(chart)}};_this.checkSparklineGroupMinMaxVal=function(oSparklineGroup){var maxVal= null,minVal=null,i,j,sparkline,nPtCount=0;if(oSparklineGroup.type!==Asc.c_oAscSparklineType.Stacked&&(Asc.c_oAscSparklineAxisMinMax.Group===oSparklineGroup.minAxisType||Asc.c_oAscSparklineAxisMinMax.Group===oSparklineGroup.maxAxisType)){for(i=0;i<oSparklineGroup.arrSparklines.length;++i){sparkline=oSparklineGroup.arrSparklines[i];if(!sparkline.oCacheView){sparkline.oCacheView=new CSparklineView;sparkline.oCacheView.initFromSparkline(sparkline,oSparklineGroup,worksheet)}var aPoints=AscFormat.getPtsFromSeries(sparkline.oCacheView.chartSpace.chart.plotArea.charts[0].series[0]); for(j=0;j<aPoints.length;++j){++nPtCount;if(Asc.c_oAscSparklineAxisMinMax.Group===oSparklineGroup.maxAxisType)if(maxVal===null)maxVal=aPoints[j].val;else if(maxVal<aPoints[j].val)maxVal=aPoints[j].val;if(Asc.c_oAscSparklineAxisMinMax.Group===oSparklineGroup.minAxisType)if(minVal===null)minVal=aPoints[j].val;else if(minVal>aPoints[j].val)minVal=aPoints[j].val}}if(maxVal!==null||minVal!==null){if(maxVal!==null&&minVal!==null&&AscFormat.fApproxEqual(minVal,maxVal))if(nPtCount>1){minVal-=.1;maxVal+=.1}else if(maxVal>= 0)minVal=null;else maxVal=null;if(maxVal!==null)maxVal-=.01;if(minVal!==null)minVal+=.01;for(i=0;i<oSparklineGroup.arrSparklines.length;++i)oSparklineGroup.arrSparklines[i].oCacheView.setMinMaxValAx(minVal,maxVal,oSparklineGroup)}}};_this.drawSparkLineGroups=function(oDrawingContext,aSparklineGroups,range,offsetX,offsetY){var graphics,i,j,sparkline;if(oDrawingContext instanceof AscCommonExcel.CPdfPrinter)graphics=oDrawingContext.DocumentRenderer;else{graphics=new AscCommon.CGraphics;graphics.init(oDrawingContext.ctx, oDrawingContext.getWidth(0),oDrawingContext.getHeight(0),oDrawingContext.getWidth(3)*nSparklineMultiplier,oDrawingContext.getHeight(3)*nSparklineMultiplier);graphics.m_oFontManager=AscCommon.g_fontManager}for(i=0;i<aSparklineGroups.length;++i){var oSparklineGroup=aSparklineGroups[i];if(oSparklineGroup.type!==Asc.c_oAscSparklineType.Stacked&&(Asc.c_oAscSparklineAxisMinMax.Group===oSparklineGroup.minAxisType||Asc.c_oAscSparklineAxisMinMax.Group===oSparklineGroup.maxAxisType))AscFormat.ExecuteNoHistory(function(){_this.checkSparklineGroupMinMaxVal(oSparklineGroup)}, _this,[]);if(oDrawingContext instanceof AscCommonExcel.CPdfPrinter){graphics.SaveGrState();var _baseTransform;if(!oDrawingContext.Transform)_baseTransform=new AscCommon.CMatrix;else _baseTransform=oDrawingContext.Transform.CreateDublicate();_baseTransform.sx/=nSparklineMultiplier;_baseTransform.sy/=nSparklineMultiplier;graphics.SetBaseTransform(_baseTransform)}for(j=0;j<oSparklineGroup.arrSparklines.length;++j){sparkline=oSparklineGroup.arrSparklines[j];if(!sparkline.checkInRange(range))continue; if(!sparkline.oCacheView){sparkline.oCacheView=new CSparklineView;sparkline.oCacheView.initFromSparkline(sparkline,oSparklineGroup,worksheet)}sparkline.oCacheView.draw(graphics,offsetX,offsetY)}if(oDrawingContext instanceof AscCommonExcel.CPdfPrinter){graphics.SetBaseTransform(null);graphics.RestoreGrState()}}if(oDrawingContext instanceof AscCommonExcel.CPdfPrinter);else oDrawingContext.restore()};_this.rebuildChartGraphicObjects=function(data){if(!worksheet)return;if(data.length===0)return;AscFormat.ExecuteNoHistory(function(){var wsViews= Asc["editor"].wb.wsViews;var changedArr=[];for(var i=0;i<data.length;++i)if(Array.isArray(data[i])){var aData=data[i];for(var j=0;j<aData.length;++j){var oRange=aData[j]&&aData[j].range;if(oRange&&oRange.worksheet&&oRange.bbox)changedArr.push(new BBoxInfo(oRange.worksheet,oRange.bbox))}}else changedArr.push(new BBoxInfo(worksheet.model,data[i]));for(i=0;i<wsViews.length;++i)if(wsViews[i]&&wsViews[i].objectRender){wsViews[i].objectRender.rebuildCharts(changedArr);wsViews[i].objectRender.recalculate()}}, _this,[])};_this.pushToAObjects=function(aDrawing){aObjects=[];for(var i=0;i<aDrawing.length;++i)aObjects.push(aDrawing[i])};_this.rebuildCharts=function(data){for(var i=0;i<aObjects.length;++i)if(aObjects[i].graphicObject.rebuildSeries)aObjects[i].graphicObject.rebuildSeries(data)};_this.updateDrawingObject=function(bInsert,operType,updateRange){if(!History.CanAddChanges()||History.CanNotAddChanges)return;var metrics=null;var count,bNeedRedraw=false,offset;for(var i=0;i<aObjects.length;i++){var obj= aObjects[i];metrics={from:{},to:{}};metrics.from.col=obj.from.col;metrics.to.col=obj.to.col;metrics.from.colOff=obj.from.colOff;metrics.to.colOff=obj.to.colOff;metrics.from.row=obj.from.row;metrics.to.row=obj.to.row;metrics.from.rowOff=obj.from.rowOff;metrics.to.rowOff=obj.to.rowOff;var bCanMove=false;var bCanResize=false;var nDrawingBaseType=obj.graphicObject.getDrawingBaseType();switch(nDrawingBaseType){case AscCommon.c_oAscCellAnchorType.cellanchorTwoCell:{bCanMove=true;bCanResize=true;break}case AscCommon.c_oAscCellAnchorType.cellanchorOneCell:{bCanMove= true;break}}if(bInsert)switch(operType){case c_oAscInsertOptions.InsertColumns:{count=updateRange.c2-updateRange.c1+1;if(updateRange.c1<=obj.from.col)if(bCanMove){metrics.from.col+=count;metrics.to.col+=count}else metrics=null;else if(updateRange.c1>obj.from.col&&updateRange.c1<=obj.to.col)if(bCanResize)metrics.to.col+=count;else metrics=null;else metrics=null;break}case c_oAscInsertOptions.InsertCellsAndShiftRight:{break}case c_oAscInsertOptions.InsertRows:{count=updateRange.r2-updateRange.r1+1; if(updateRange.r1<=obj.from.row)if(bCanMove){metrics.from.row+=count;metrics.to.row+=count}else metrics=null;else if(updateRange.r1>obj.from.row&&updateRange.r1<=obj.to.row)if(bCanResize)metrics.to.row+=count;else metrics=null;else metrics=null;break}case c_oAscInsertOptions.InsertCellsAndShiftDown:{break}}else switch(operType){case c_oAscDeleteOptions.DeleteColumns:{count=updateRange.c2-updateRange.c1+1;if(updateRange.c1<=obj.from.col)if(updateRange.c2<obj.from.col)if(bCanMove){metrics.from.col-= count;metrics.to.col-=count}else metrics=null;else if(bCanResize){metrics.from.col=updateRange.c1;metrics.from.colOff=0;offset=0;if(obj.to.col-updateRange.c2-1>0)offset=obj.to.col-updateRange.c2-1;else{offset=1;metrics.to.colOff=0}metrics.to.col=metrics.from.col+offset}else metrics=null;else if(updateRange.c1>obj.from.col&&updateRange.c1<=obj.to.col)if(bCanResize)if(updateRange.c2>=obj.to.col){metrics.to.col=updateRange.c1;metrics.to.colOff=0}else metrics.to.col-=count;else metrics=null;else metrics= null;break}case c_oAscDeleteOptions.DeleteCellsAndShiftLeft:{break}case c_oAscDeleteOptions.DeleteRows:{count=updateRange.r2-updateRange.r1+1;if(updateRange.r1<=obj.from.row)if(updateRange.r2<obj.from.row)if(bCanMove){metrics.from.row-=count;metrics.to.row-=count}else metrics=null;else if(bCanResize){metrics.from.row=updateRange.r1;metrics.from.colOff=0;offset=0;if(obj.to.row-updateRange.r2-1>0)offset=obj.to.row-updateRange.r2-1;else{offset=1;metrics.to.colOff=0}metrics.to.row=metrics.from.row+offset}else metrics= null;else if(updateRange.r1>obj.from.row&&updateRange.r1<=obj.to.row)if(bCanResize)if(updateRange.r2>=obj.to.row){metrics.to.row=updateRange.r1;metrics.to.colOff=0}else metrics.to.row-=count;else metrics=null;else metrics=null;break}case c_oAscDeleteOptions.DeleteCellsAndShiftTop:{break}}if(metrics){if(metrics.from.col<0){metrics.from.col=0;metrics.from.colOff=0}if(metrics.to.col<=0){metrics.to.col=1;metrics.to.colOff=0}if(metrics.from.row<0){metrics.from.row=0;metrics.from.rowOff=0}if(metrics.to.row<= 0){metrics.to.row=1;metrics.to.rowOff=0}if(metrics.from.col==metrics.to.col){metrics.to.col++;metrics.to.colOff=0}if(metrics.from.row==metrics.to.row){metrics.to.row++;metrics.to.rowOff=0}obj.graphicObject.setDrawingBaseCoords(metrics.from.col,metrics.from.colOff,metrics.from.row,metrics.from.rowOff,metrics.to.col,metrics.to.colOff,metrics.to.row,metrics.to.rowOff,obj.Pos.X,obj.Pos.Y,obj.ext.cx,obj.ext.cy);obj.graphicObject.recalculate();if(obj.graphicObject.spPr&&obj.graphicObject.spPr.xfrm){obj.graphicObject.spPr.xfrm.setOffX(obj.graphicObject.x); obj.graphicObject.spPr.xfrm.setOffY(obj.graphicObject.y);obj.graphicObject.spPr.xfrm.setExtX(obj.graphicObject.extX);obj.graphicObject.spPr.xfrm.setExtY(obj.graphicObject.extY)}obj.graphicObject.recalculate();bNeedRedraw=true}}bNeedRedraw&&_this.showDrawingObjects()};_this.updateDrawingsTransform=function(target){if(false===_this.bUpdateMetrics)return;if(!AscCommon.isRealObject(target))return;if(target.target===AscCommonExcel.c_oTargetType.RowResize||target.target===AscCommonExcel.c_oTargetType.ColumnResize)for(var i= 0;i<aObjects.length;++i){var oDrawingBase=aObjects[i];var oGraphicObject=oDrawingBase.graphicObject;if(oDrawingBase.checkTarget(target,false)){oGraphicObject.handleUpdateExtents();oGraphicObject.recalculate()}}};_this.updateSizeDrawingObjects=function(target){if(AscCommon.isFileBuild())return;var oGraphicObject;var bCheck,bRecalculate;if(!History.CanAddChanges()||History.CanNotAddChanges){_this.updateDrawingsTransform(target);return}var aObjectsForCheck=[],i,drawingObject,bDraw=false;if(target.target=== AscCommonExcel.c_oTargetType.RowResize||target.target===AscCommonExcel.c_oTargetType.ColumnResize)for(i=0;i<aObjects.length;i++){drawingObject=aObjects[i];bCheck=drawingObject.checkTarget(target,false);if(bCheck){oGraphicObject=drawingObject.graphicObject;bRecalculate=true;if(oGraphicObject)if(drawingObject.Type===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell&&drawingObject.editAs!==AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)if(drawingObject.editAs===AscCommon.c_oAscCellAnchorType.cellanchorAbsolute)aObjectsForCheck.push({object:drawingObject, coords:drawingObject._getGraphicObjectCoords()});else{var oldExtX=oGraphicObject.extX;var oldExtY=oGraphicObject.extY;oGraphicObject.recalculateTransform();oGraphicObject.extX=oldExtX;oGraphicObject.extY=oldExtY;aObjectsForCheck.push({object:drawingObject,coords:drawingObject._getGraphicObjectCoords()})}else{if(oGraphicObject.recalculateTransform){var oldX=oGraphicObject.x;var oldY=oGraphicObject.y;var oldExtX=oGraphicObject.extX;var oldExtY=oGraphicObject.extY;oGraphicObject.recalculateTransform(); var fDelta=.01;bRecalculate=false;if(!AscFormat.fApproxEqual(oldX,oGraphicObject.x,fDelta)||!AscFormat.fApproxEqual(oldY,oGraphicObject.y,fDelta)||!AscFormat.fApproxEqual(oldExtX,oGraphicObject.extX,fDelta)||!AscFormat.fApproxEqual(oldExtY,oGraphicObject.extY,fDelta))bRecalculate=true}if(bRecalculate){oGraphicObject.handleUpdateExtents();oGraphicObject.recalculate();bDraw=true}else drawingObject.checkBoundsFromTo()}}else drawingObject.checkBoundsFromTo()}if(aObjectsForCheck.length>0){_this.objectLocker.reset(); for(i=0;i<aObjectsForCheck.length;++i)_this.objectLocker.addObjectId(aObjectsForCheck[i].object.graphicObject.Get_Id());_this.objectLocker.checkObjects(function(bLock){var i,oObjectToCheck,oGraphicObject;var bUpdateDrawingBaseCoords=bLock===true&&History.CanAddChanges()&&!History.CanNotAddChanges;for(i=0;i<aObjectsForCheck.length;++i){oObjectToCheck=aObjectsForCheck[i];oGraphicObject=oObjectToCheck.object.graphicObject;if(bUpdateDrawingBaseCoords){var oC=oObjectToCheck.coords;oGraphicObject.setDrawingBaseCoords(oC.from.col, oC.from.colOff,oC.from.row,oC.from.rowOff,oC.to.col,oC.to.colOff,oC.to.row,oC.to.rowOff,oC.Pos.X,oC.Pos.Y,oC.ext.cx,oC.ext.cy)}oGraphicObject.handleUpdateExtents();oGraphicObject.recalculate()}_this.showDrawingObjects()})}else if(bDraw)_this.showDrawingObjects()};_this.applyMoveResizeRange=function(oRanges){var oChart=null;var aSelectedObjects=_this.controller.selection.groupSelection?_this.controller.selection.groupSelection.selectedObjects:_this.controller.selectedObjects;if(aSelectedObjects.length=== 1&&aSelectedObjects[0].getObjectType()===AscDFH.historyitem_type_ChartSpace)oChart=aSelectedObjects[0];else return;var oValRange=null,oCatRange=null,oTxRange=null;var ranges=oRanges.ranges;for(var i=0;i<ranges.length;++i)if(ranges[i].chartRangeIndex===0)oValRange=ranges[i].clone();else if(ranges[i].chartRangeIndex===1)oTxRange=ranges[i].clone();else if(ranges[i].chartRangeIndex===2)oCatRange=ranges[i].clone();_this.controller.checkSelectedObjectsAndCallback(function(){oChart.rebuildSeriesData(oValRange, oCatRange,oTxRange)},[],false,AscDFH.historydescription_ChartDrawingObjects)};_this.moveRangeDrawingObject=function(oBBoxFrom,oBBoxTo){if(oBBoxFrom&&oBBoxTo){var selected_objects=_this.controller.selection.groupSelection?_this.controller.selection.groupSelection.selectedObjects:_this.controller.selectedObjects;var chart;if(selected_objects.length===1&&selected_objects[0].getObjectType()===AscDFH.historyitem_type_ChartSpace)chart=selected_objects[0];var object_to_check=_this.controller.selection.groupSelection? _this.controller.selection.groupSelection:chart;if(chart&&!(!chart.bbox||!chart.bbox.seriesBBox||oBBoxTo.isEqual(chart.bbox.seriesBBox))){var editChart=function(drawingObject){var options=new Asc.asc_ChartSettings;var catHeadersBBox,serHeadersBBox;var final_bbox=oBBoxTo.clone();var bOneCell=false;if(!chart.bbox.catBBox&&!chart.bbox.serBBox)if(chart.bbox.seriesBBox.r1===chart.bbox.seriesBBox.r2&&chart.bbox.seriesBBox.c1===chart.bbox.seriesBBox.c2)bOneCell=true;if(!bOneCell&&chart.bbox.seriesBBox.bVert|| bOneCell&&final_bbox.r1===final_bbox.r2){options.putInColumns(false);if(chart.bbox.catBBox&&chart.bbox.catBBox.r1===chart.bbox.catBBox.r2&&oBBoxTo.r1>chart.bbox.catBBox.r1)catHeadersBBox={r1:chart.bbox.catBBox.r1,r2:chart.bbox.catBBox.r1,c1:oBBoxTo.c1,c2:oBBoxTo.c2};if(chart.bbox.serBBox&&chart.bbox.serBBox&&chart.bbox.serBBox.c1===chart.bbox.serBBox.c2&&chart.bbox.serBBox.c1<oBBoxTo.c1)serHeadersBBox={r1:oBBoxTo.r1,r2:oBBoxTo.r2,c1:chart.bbox.serBBox.c1,c2:chart.bbox.serBBox.c2}}else{options.putInColumns(true); if(chart.bbox.catBBox&&chart.bbox.catBBox.c1===chart.bbox.catBBox.c2&&oBBoxTo.c1>chart.bbox.catBBox.c1)catHeadersBBox={r1:oBBoxTo.r1,r2:oBBoxTo.r2,c1:chart.bbox.catBBox.c1,c2:chart.bbox.catBBox.c2};if(chart.bbox.serBBox&&chart.bbox.serBBox&&chart.bbox.serBBox.r1===chart.bbox.serBBox.r2&&chart.bbox.serBBox.r1<oBBoxTo.r1)serHeadersBBox={r1:chart.bbox.serBBox.r1,r2:chart.bbox.serBBox.r2,c1:oBBoxTo.c1,c2:oBBoxTo.c2}}var sRef=(new Asc.Range(final_bbox.c1,final_bbox.r1,final_bbox.c2,final_bbox.r2)).getName(AscCommonExcel.referenceType.A); options.putRange(parserHelp.get3DRef(worksheet.model.sName,sRef));var chartSeries=AscFormat.getChartSeries(worksheet.model,options,catHeadersBBox,serHeadersBBox);drawingObject.rebuildSeriesFromAsc(chartSeries);_this.controller.startRecalculate();_this.sendGraphicObjectProps()};var callbackCheck=function(result){if(result){History.Create_NewPoint(AscDFH.historydescription_ChartDrawingObjects);editChart(chart);_this.showDrawingObjects()}else _this.selectDrawingObjectRange(chart)};_this.objectLocker.reset(); _this.objectLocker.addObjectId(object_to_check.Get_Id());_this.objectLocker.checkObjects(callbackCheck)}}};_this.updateChartReferences=function(oldWorksheet,newWorksheet,bNoRedraw){AscFormat.ExecuteNoHistory(function(){for(var i=0;i<aObjects.length;i++){var graphicObject=aObjects[i].graphicObject;if(graphicObject.updateChartReferences)graphicObject.updateChartReferences(oldWorksheet,newWorksheet)}},this,[])};_this.updateChartReferences2=function(oldWorksheet,newWorksheet){for(var i=0;i<aObjects.length;i++){var graphicObject= aObjects[i].graphicObject;if(graphicObject.updateChartReferences2)graphicObject.updateChartReferences2(oldWorksheet,newWorksheet)}};_this.addGraphicObject=function(graphic,position,lockByDefault){worksheet.cleanSelection();var drawingObject=_this.createDrawingObject();drawingObject.graphicObject=graphic;graphic.setDrawingBase(drawingObject);var ret;if(AscFormat.isRealNumber(position)){aObjects.splice(position,0,drawingObject);ret=position}else{ret=aObjects.length;aObjects.push(drawingObject)}if(lockByDefault){_this.objectLocker.reset(); _this.objectLocker.addObjectId(drawingObject.graphicObject.Id);_this.objectLocker.checkObjects(function(result){})}worksheet.setSelectionShape(true);return ret};_this.addOleObject=function(fWidth,fHeight,nWidthPix,nHeightPix,sLocalUrl,sData,sApplicationId){var drawingObject=_this.createDrawingObject();drawingObject.worksheet=worksheet;var activeCell=worksheet.model.selectionRange.activeCell;drawingObject.from.col=activeCell.col;drawingObject.from.row=activeCell.row;_this.calculateObjectMetrics(drawingObject, nWidthPix,nHeightPix);var coordsFrom=_this.calculateCoords(drawingObject.from);_this.controller.resetSelection();_this.controller.addOleObjectFromParams(pxToMm(coordsFrom.x),pxToMm(coordsFrom.y),fWidth,fHeight,nWidthPix,nHeightPix,sLocalUrl,sData,sApplicationId);worksheet.setSelectionShape(true)};_this.editOleObject=function(oOleObject,sData,sImageUrl,nPixWidth,nPixHeight,bResize){this.controller.editOleObjectFromParams(oOleObject,sData,sImageUrl,nPixWidth,nPixHeight,bResize)};_this.startEditCurrentOleObject= function(){this.controller.startEditCurrentOleObject()};_this.groupGraphicObjects=function(){if(_this.controller.canGroup()){_this.controller.checkSelectedObjectsAndCallback(_this.controller.createGroup,[],false,AscDFH.historydescription_Spreadsheet_CreateGroup);worksheet.setSelectionShape(true)}};_this.unGroupGraphicObjects=function(){if(_this.controller.canUnGroup()){_this.controller.unGroup();worksheet.setSelectionShape(true);api.isStartAddShape=false}};_this.getDrawingBase=function(graphicId){var oDrawing= AscCommon.g_oTableId.Get_ById(graphicId);if(oDrawing){if(oDrawing.chart&&oDrawing.chart.getObjectType&&oDrawing.chart.getObjectType()===AscDFH.historyitem_type_ChartSpace)oDrawing=oDrawing.chart;while(oDrawing.group)oDrawing=oDrawing.group;if(oDrawing.drawingBase)for(var i=0;i<aObjects.length;i++)if(aObjects[i]===oDrawing.drawingBase)return aObjects[i]}return null};_this.deleteDrawingBase=function(graphicId){var position=null;var bRedraw=false;for(var i=0;i<aObjects.length;i++)if(aObjects[i].graphicObject.Id== graphicId){aObjects[i].graphicObject.deselect(_this.controller);if(aObjects[i].isChart())worksheet.endEditChart();aObjects.splice(i,1);bRedraw=true;position=i;break}return position};_this.checkGraphicObjectPosition=function(x,y,w,h){var response={result:true,x:0,y:0};if(y<0){response.result=false;response.y=Math.abs(y)}if(x<0){response.result=false;response.x=Math.abs(x)}return response};_this.resetLockedGraphicObjects=function(){for(var i=0;i<aObjects.length;i++)aObjects[i].graphicObject.lockType= c_oAscLockTypes.kLockTypeNone};_this.tryResetLockedGraphicObject=function(id){var bObjectFound=false;for(var i=0;i<aObjects.length;i++)if(aObjects[i].graphicObject.Id==id){aObjects[i].graphicObject.lockType=c_oAscLockTypes.kLockTypeNone;bObjectFound=true;break}return bObjectFound};_this.getDrawingCanvas=function(){return{shapeCtx:api.wb.shapeCtx,shapeOverlayCtx:api.wb.shapeOverlayCtx,autoShapeTrack:api.wb.autoShapeTrack,trackOverlay:api.wb.trackOverlay}};_this.convertMetric=function(val,from,to){return val* ascCvtRatio(from,to)};_this.convertPixToMM=function(pix){return _this.convertMetric(pix,0,3)};_this.getSelectedGraphicObjects=function(){return _this.controller.selectedObjects};_this.selectedGraphicObjectsExists=function(){return _this.controller&&_this.controller.selectedObjects.length>0};_this.loadImageRedraw=function(imageUrl){var _image=api.ImageLoader.LoadImage(imageUrl,1);if(null!=_image)imageLoaded(_image);else _this.asyncImageEndLoaded=function(_image){imageLoaded(_image);_this.asyncImageEndLoaded= null};function imageLoaded(_image){if(!_image.Image)worksheet.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.UplImageUrl,c_oAscError.Level.NoCritical);else _this.showDrawingObjects()}};_this.getOriginalImageSize=function(){var selectedObjects=_this.controller.selectedObjects;if(selectedObjects.length==1){if(AscFormat.isRealNumber(selectedObjects[0].m_fDefaultSizeX)&&AscFormat.isRealNumber(selectedObjects[0].m_fDefaultSizeY))return new AscCommon.asc_CImageSize(selectedObjects[0].m_fDefaultSizeX, selectedObjects[0].m_fDefaultSizeY,true);if(selectedObjects[0].isImage()){var imageUrl=selectedObjects[0].getImageUrl();var oImagePr=new Asc.asc_CImgProperty;oImagePr.asc_putImageUrl(imageUrl);return oImagePr.asc_getOriginSize(api)}}return new AscCommon.asc_CImageSize(50,50,false)};_this.getSelectionImg=function(){return _this.controller.getSelectionImage().asc_getImageUrl()};_this.sendGraphicObjectProps=function(){if(worksheet)worksheet.handlers.trigger("selectionChanged")};_this.setGraphicObjectProps= function(props){var objectProperties=props;var _img;if(!AscCommon.isNullOrEmptyString(objectProperties.ImageUrl)){_img=api.ImageLoader.LoadImage(objectProperties.ImageUrl,1);if(null!=_img)_this.controller.setGraphicObjectProps(objectProperties);else _this.asyncImageEndLoaded=function(_image){_this.controller.setGraphicObjectProps(objectProperties);_this.asyncImageEndLoaded=null}}else if(objectProperties.ShapeProperties&&objectProperties.ShapeProperties.fill&&objectProperties.ShapeProperties.fill.fill&& !AscCommon.isNullOrEmptyString(objectProperties.ShapeProperties.fill.fill.url))if(window["IS_NATIVE_EDITOR"])_this.controller.setGraphicObjectProps(objectProperties);else{_img=api.ImageLoader.LoadImage(objectProperties.ShapeProperties.fill.fill.url,1);if(null!=_img)_this.controller.setGraphicObjectProps(objectProperties);else _this.asyncImageEndLoaded=function(_image){_this.controller.setGraphicObjectProps(objectProperties);_this.asyncImageEndLoaded=null}}else if(objectProperties.ShapeProperties&& objectProperties.ShapeProperties.textArtProperties&&objectProperties.ShapeProperties.textArtProperties.Fill&&objectProperties.ShapeProperties.textArtProperties.Fill.fill&&!AscCommon.isNullOrEmptyString(objectProperties.ShapeProperties.textArtProperties.Fill.fill.url))if(window["IS_NATIVE_EDITOR"])_this.controller.setGraphicObjectProps(objectProperties);else{_img=api.ImageLoader.LoadImage(objectProperties.ShapeProperties.textArtProperties.Fill.fill.url,1);if(null!=_img)_this.controller.setGraphicObjectProps(objectProperties); else _this.asyncImageEndLoaded=function(_image){_this.controller.setGraphicObjectProps(objectProperties);_this.asyncImageEndLoaded=null}}else{objectProperties.ImageUrl=null;if(!api.noCreatePoint||api.exucuteHistory){if(!api.noCreatePoint&&!api.exucuteHistory&&api.exucuteHistoryEnd){if(_this.nCurPointItemsLength===-1)_this.controller.setGraphicObjectProps(props);else{_this.controller.setGraphicObjectPropsCallBack(props);_this.controller.startRecalculate();_this.sendGraphicObjectProps()}api.exucuteHistoryEnd= false;_this.nCurPointItemsLength=-1}else _this.controller.setGraphicObjectProps(props);if(api.exucuteHistory){var Point=History.Points[History.Index];if(Point)_this.nCurPointItemsLength=Point.Items.length;else _this.nCurPointItemsLength=-1;api.exucuteHistory=false}if(api.exucuteHistoryEnd)api.exucuteHistoryEnd=false}else{var Point=History.Points[History.Index];if(Point&&Point.Items.length>0)if(this.nCurPointItemsLength>-1){var nBottomIndex=-1;for(var Index=Point.Items.length-1;Index>nBottomIndex;Index--){var Item= Point.Items[Index];if(!Item.Class.Read_FromBinary2)Item.Class.Undo(Item.Type,Item.Data,Item.SheetId);else Item.Class.Undo(Item.Data)}_this.controller.setSelectionState(Point.SelectionState);Point.Items.length=0;_this.controller.setGraphicObjectPropsCallBack(props);_this.controller.startRecalculate()}else{_this.controller.setGraphicObjectProps(props);var Point=History.Points[History.Index];if(Point)_this.nCurPointItemsLength=Point.Items.length;else _this.nCurPointItemsLength=-1}}api.exucuteHistoryEnd= false}};_this.showChartSettings=function(){api.wb.handlers.trigger("asc_onShowChartDialog",true)};_this.setDrawImagePlaceParagraph=function(element_id,props){_this.drawingDocument.InitGuiCanvasTextProps(element_id);_this.drawingDocument.DrawGuiCanvasTextProps(props)};_this.graphicObjectMouseDown=function(e,x,y){var offsets=_this.drawingArea.getOffsets(x,y,true);if(offsets)_this.controller.onMouseDown(e,pxToMm(x-offsets.x),pxToMm(y-offsets.y))};_this.graphicObjectMouseMove=function(e,x,y){e.IsLocked= e.isLocked;_this.lastX=x;_this.lastY=y;var offsets=_this.drawingArea.getOffsets(x,y,true);if(offsets)_this.controller.onMouseMove(e,pxToMm(x-offsets.x),pxToMm(y-offsets.y))};_this.graphicObjectMouseUp=function(e,x,y){var offsets=_this.drawingArea.getOffsets(x,y,true);if(offsets)_this.controller.onMouseUp(e,pxToMm(x-offsets.x),pxToMm(y-offsets.y))};_this.graphicObjectKeyDown=function(e){return _this.controller.onKeyDown(e)};_this.graphicObjectKeyUp=function(e){return _this.controller.onKeyUp(e)};_this.graphicObjectKeyPress= function(e){e.KeyCode=e.keyCode;e.CtrlKey=e.metaKey||e.ctrlKey;e.AltKey=e.altKey;e.ShiftKey=e.shiftKey;e.Which=e.which;return _this.controller.onKeyPress(e)};_this.cleanWorksheet=function(){};_this.getWordChartObject=function(){for(var i=0;i<aObjects.length;i++){var drawingObject=aObjects[i];if(drawingObject.isChart()){var oChartSpace=drawingObject.graphicObject;if(!oChartSpace.recalcInfo.recalculateTransform)if(oChartSpace.spPr&&oChartSpace.spPr.xfrm){oChartSpace.spPr.xfrm.extX=oChartSpace.extX; oChartSpace.spPr.xfrm.extY=oChartSpace.extY}return new asc_CChartBinary(oChartSpace)}}return null};_this.getAscChartObject=function(bNoLock){var settings;if(api.isChartEditor)return _this.controller.getPropsFromChart(aObjects[0].graphicObject);settings=_this.controller.getChartProps();if(!settings){settings=new Asc.asc_ChartSettings;var selectedRange=worksheet.getSelectedRange();if(selectedRange){var box=selectedRange.getBBox0();var nRows=box.r2-box.r1+1;var nCols=box.c2-box.c1+1;if(nRows===nCols)if(nRows<= 4096&&nCols<=4096&&worksheet&&worksheet.model){var oHeaders=AscFormat.parseSeriesHeaders(worksheet.model,box);if(oHeaders.bTop)--nRows;if(oHeaders.bLeft)--nCols}settings.putInColumns(nRows>nCols)}settings.putRanges(worksheet.getSelectionRangeValues(true,true));settings.putStyle(2);settings.putType(Asc.c_oAscChartTypeSettings.lineNormal);settings.putTitle(Asc.c_oAscChartTitleShowSettings.noOverlay);settings.putShowHorAxis(true);settings.putShowVerAxis(true);settings.putHorAxisLabel(Asc.c_oAscChartHorAxisLabelShowSettings.none); settings.putVertAxisLabel(Asc.c_oAscChartVertAxisLabelShowSettings.none);settings.putDataLabelsPos(Asc.c_oAscChartDataLabelsPos.none);settings.putHorGridLines(Asc.c_oAscGridLinesSettings.major);settings.putVertGridLines(Asc.c_oAscGridLinesSettings.none);settings.putSeparator(",");settings.putLine(true);settings.putShowMarker(false);var vert_axis_settings=new AscCommon.asc_ValAxisSettings;settings.putVertAxisProps(vert_axis_settings);vert_axis_settings.setDefault();var hor_axis_settings=new AscCommon.asc_CatAxisSettings; settings.putHorAxisProps(hor_axis_settings);hor_axis_settings.setDefault()}else if(true!==bNoLock)this.controller.checkSelectedObjectsAndFireCallback(function(){});return settings};_this.selectDrawingObjectRange=function(drawing){worksheet.cleanSelection();worksheet.endEditChart();var BBoxObjects=drawing.getDataRanges();var BB,range;var oSelectedSeries=drawing.getSelectedSeries();var oSelectionRange;var aCheckRanges,i,j;var oSeriesBBox=null,oTxBBox=null,oCatBBox=null;if(!oSelectedSeries){if(BBoxObjects.bbox&& BBoxObjects.bbox.worksheet===worksheet.model){oSeriesBBox=BBoxObjects.bbox.seriesBBox;oTxBBox=BBoxObjects.bbox.serBBox;oCatBBox=BBoxObjects.bbox.catBBox;aCheckRanges=[oSeriesBBox,oTxBBox,oCatBBox];for(i=0;i<aCheckRanges.length;++i)for(j=i+1;j<aCheckRanges.length;++j)if(aCheckRanges[i]&&aCheckRanges[j]&&aCheckRanges[i].isIntersect&&aCheckRanges[i].isIntersect(aCheckRanges[j]))return}}else{if(BBoxObjects.bbox)if(BBoxObjects.bbox.worksheet===worksheet.model){oSeriesBBox=BBoxObjects.bbox.seriesBBox;oTxBBox= BBoxObjects.bbox.serBBox;oCatBBox=BBoxObjects.bbox.catBBox}if(!oSeriesBBox)if(BBoxObjects.seriesBBoxes.length===1)oSeriesBBox=BBoxObjects.seriesBBoxes[0];if(!oTxBBox)if(BBoxObjects.seriesTitlesBBoxes.length===1)oSeriesBBox=BBoxObjects.seriesTitlesBBoxes[0];if(!oCatBBox)if(BBoxObjects.catTitlesBBoxes.length===1)oSeriesBBox=BBoxObjects.catTitlesBBoxes[0]}oSelectionRange=new AscCommonExcel.SelectionRange(worksheet);oSelectionRange.ranges=[];if(oSeriesBBox){worksheet.isChartAreaEditMode=true;BB=oSeriesBBox; oSelectionRange.addRange();range=oSelectionRange.getLast();range.assign(BB.c1,BB.r1,BB.c2,BB.r2,true);range.separated=AscCommon.isRealObject(oSelectedSeries);range.chartRangeIndex=0;range.vert=BB.bVert}if(oTxBBox){worksheet.isChartAreaEditMode=true;BB=oTxBBox;oSelectionRange.addRange();range=oSelectionRange.getLast();range.assign(BB.c1,BB.r1,BB.c2,BB.r2,true);range.separated=AscCommon.isRealObject(oSelectedSeries);range.chartRangeIndex=1}if(oCatBBox){worksheet.isChartAreaEditMode=true;BB=oCatBBox; oSelectionRange.addRange();range=oSelectionRange.getLast();range.assign(BB.c1,BB.r1,BB.c2,BB.r2,true);range.separated=AscCommon.isRealObject(oSelectedSeries);range.chartRangeIndex=2}if(worksheet.isChartAreaEditMode){worksheet.oOtherRanges=oSelectionRange;worksheet._drawSelection()}};_this.unselectDrawingObjects=function(){worksheet.endEditChart();_this.controller.resetSelectionState();_this.OnUpdateOverlay()};_this.getDrawingObject=function(id){for(var i=0;i<aObjects.length;i++)if(aObjects[i].graphicObject.Id== id)return aObjects[i];return null};_this.getGraphicSelectionType=function(id){var selected_objects,selection,controller=_this.controller;if(controller.selection.groupSelection){selected_objects=controller.selection.groupSelection.selectedObjects;selection=controller.selection.groupSelection.selection}else{selected_objects=controller.selectedObjects;selection=controller.selection}if(selection.chartSelection&&selection.chartSelection.selection.textSelection)return c_oAscSelectionType.RangeChartText; if(selection.textSelection)return c_oAscSelectionType.RangeShapeText;if(selected_objects[0]){if(selected_objects[0].getObjectType()===AscDFH.historyitem_type_ChartSpace&&selected_objects.length===1)return c_oAscSelectionType.RangeChart;if(selected_objects[0].getObjectType()===AscDFH.historyitem_type_ImageShape)return c_oAscSelectionType.RangeImage;if(selected_objects[0].getObjectType()===AscDFH.historyitem_type_SlicerView)return c_oAscSelectionType.RangeSlicer;return c_oAscSelectionType.RangeShape}return undefined}; _this.setGraphicObjectLayer=function(layerType){_this.controller.setGraphicObjectLayer(layerType)};_this.setGraphicObjectAlign=function(alignType){_this.controller.setGraphicObjectAlign(alignType)};_this.distributeGraphicObjectHor=function(){_this.controller.distributeGraphicObjectHor()};_this.distributeGraphicObjectVer=function(){_this.controller.distributeGraphicObjectVer()};_this.getSelectedDrawingObjectsCount=function(){var selectedObjects=_this.controller.selection.groupSelection?this.controller.selection.groupSelection.selectedObjects: this.controller.selectedObjects;return selectedObjects.length};_this.checkCursorDrawingObject=function(x,y){var offsets=_this.drawingArea.getOffsets(x,y);if(offsets){var objectInfo={cursor:null,id:null,object:null};var graphicObjectInfo=_this.controller.isPointInDrawingObjects(pxToMm(x-offsets.x),pxToMm(y-offsets.y));if(graphicObjectInfo&&graphicObjectInfo.objectId){objectInfo.object=_this.getDrawingBase(graphicObjectInfo.objectId);if(objectInfo.object){objectInfo.id=graphicObjectInfo.objectId;objectInfo.cursor= graphicObjectInfo.cursorType;objectInfo.hyperlink=graphicObjectInfo.hyperlink;objectInfo.tooltip=graphicObjectInfo.tooltip}else return null;return objectInfo}}return null};_this.getPositionInfo=function(x,y){var info=new CCellObjectInfo;var tmp=worksheet._findColUnderCursor(x,true);if(tmp){info.col=tmp.col;info.colOff=pxToMm(x-worksheet._getColLeft(info.col))}tmp=worksheet._findRowUnderCursor(y,true);if(tmp){info.row=tmp.row;info.rowOff=pxToMm(y-worksheet._getRowTop(info.row))}return info};_this.checkCurrentTextObjectExtends= function(){var oController=this.controller;if(oController){var oTargetTextObject=AscFormat.getTargetTextObject(oController);if(oTargetTextObject.checkExtentsByDocContent)oTargetTextObject.checkExtentsByDocContent(true,true)}};_this.beginCompositeInput=function(){_this.controller.CreateDocContent();_this.drawingDocument.TargetStart();_this.drawingDocument.TargetShow();var oContent=_this.controller.getTargetDocContent(true);if(!oContent)return false;var oPara=oContent.GetCurrentParagraph();if(!oPara)return false; if(true===oContent.IsSelectionUse())oContent.Remove(1,true,false,true);var oRun=oPara.Get_ElementByPos(oPara.Get_ParaContentPos(false,false));if(!oRun||!(oRun instanceof ParaRun))return false;_this.CompositeInput={Run:oRun,Pos:oRun.State.ContentPos,Length:0};oRun.Set_CompositeInput(_this.CompositeInput);_this.controller.startRecalculate();_this.sendGraphicObjectProps()};_this.Begin_CompositeInput=function(){History.Create_NewPoint(AscDFH.historydescription_Document_CompositeInput);_this.beginCompositeInput(); _this.controller.recalculateCurPos(true,true)};_this.addCompositeText=function(nCharCode){if(null===_this.CompositeInput)return;var oRun=_this.CompositeInput.Run;var nPos=_this.CompositeInput.Pos+_this.CompositeInput.Length;var oChar;if(para_Math_Run===oRun.Type){oChar=new CMathText;oChar.add(nCharCode)}else if(32==nCharCode||12288==nCharCode)oChar=new ParaSpace;else oChar=new ParaText(nCharCode);oRun.Add_ToContent(nPos,oChar,true);_this.CompositeInput.Length++};_this.Add_CompositeText=function(nCharCode){if(null=== _this.CompositeInput)return;History.Create_NewPoint(AscDFH.historydescription_Document_CompositeInputReplace);_this.addCompositeText(nCharCode);_this.checkCurrentTextObjectExtends();_this.controller.recalculate();_this.controller.recalculateCurPos(true,true);_this.controller.updateSelectionState()};_this.removeCompositeText=function(nCount){if(null===_this.CompositeInput)return;var oRun=_this.CompositeInput.Run;var nPos=_this.CompositeInput.Pos+_this.CompositeInput.Length;var nDelCount=Math.max(0, Math.min(nCount,_this.CompositeInput.Length,oRun.Content.length,nPos));oRun.Remove_FromContent(nPos-nDelCount,nDelCount,true);_this.CompositeInput.Length-=nDelCount};_this.Remove_CompositeText=function(nCount){_this.removeCompositeText(nCount);_this.checkCurrentTextObjectExtends();_this.controller.recalculate();_this.controller.recalculateCurPos(true,true);_this.controller.updateSelectionState()};_this.Replace_CompositeText=function(arrCharCodes){if(null===_this.CompositeInput)return;History.Create_NewPoint(AscDFH.historydescription_Document_CompositeInputReplace); _this.removeCompositeText(_this.CompositeInput.Length);for(var nIndex=0,nCount=arrCharCodes.length;nIndex<nCount;++nIndex)_this.addCompositeText(arrCharCodes[nIndex]);_this.checkCurrentTextObjectExtends();_this.controller.startRecalculate();_this.controller.recalculateCurPos(true,true);_this.controller.updateSelectionState()};_this.Set_CursorPosInCompositeText=function(nPos){if(null===_this.CompositeInput)return;var oRun=_this.CompositeInput.Run;var nInRunPos=Math.max(Math.min(_this.CompositeInput.Pos+ nPos,_this.CompositeInput.Pos+_this.CompositeInput.Length,oRun.Content.length),_this.CompositeInput.Pos);oRun.State.ContentPos=nInRunPos;_this.controller.recalculateCurPos(true,true);_this.controller.updateSelectionState()};_this.Get_CursorPosInCompositeText=function(){if(null===_this.CompositeInput)return 0;var oRun=_this.CompositeInput.Run;var nInRunPos=oRun.State.ContentPos;var nPos=Math.min(_this.CompositeInput.Length,Math.max(0,nInRunPos-_this.CompositeInput.Pos));return nPos};_this.End_CompositeInput= function(){if(null===_this.CompositeInput)return;var oRun=_this.CompositeInput.Run;oRun.Set_CompositeInput(null);_this.CompositeInput=null;var oController=_this.controller;if(oController){var oTargetTextObject=AscFormat.getTargetTextObject(oController);if(oTargetTextObject&&oTargetTextObject.txWarpStructNoTransform)oTargetTextObject.recalculateContent()}_this.controller.recalculateCurPos(true,true);_this.sendGraphicObjectProps();_this.showDrawingObjects()};_this.Get_MaxCursorPosInCompositeText=function(){if(null=== _this.CompositeInput)return 0;return _this.CompositeInput.Length};function ascCvtRatio(fromUnits,toUnits){return asc.getCvtRatio(fromUnits,toUnits,drawingCtx.getPPIX())}function mmToPx(val){return val*ascCvtRatio(3,0)}function pxToMm(val){return val*ascCvtRatio(0,3)}}DrawingObjects.prototype.calculateCoords=function(cell){var ws=this.getWorksheet();var coords={x:0,y:0};if(cell&&ws){var rowHeight=ws.getRowHeight(cell.row,3);var colWidth=ws.getColumnWidth(cell.col,3);var resultRowOff=cell.rowOff>rowHeight? rowHeight:cell.rowOff;var resultColOff=cell.colOff>colWidth?colWidth:cell.colOff;coords.y=ws._getRowTop(cell.row)+ws.objectRender.convertMetric(resultRowOff,3,0)-ws._getRowTop(0);coords.x=ws._getColLeft(cell.col)+ws.objectRender.convertMetric(resultColOff,3,0)-ws._getColLeft(0)}return coords};function ObjectLocker(ws){var asc_applyFunction=AscCommonExcel.applyFunction;var _t=this;_t.bLock=true;var aObjectId=[];var worksheet=ws;_t.reset=function(){_t.bLock=true;aObjectId=[]};_t.addObjectId=function(id){aObjectId.push(id)}; _t.checkObjects=function(callback){var callbackEx=function(result,sync){if(callback)callback(result,sync)};var api=Asc.editor;if(api&&(api.collaborativeEditing&&api.collaborativeEditing.getGlobalLock()||!api.canEdit())){callbackEx(false,true);return false}var bRet=true;if(!aObjectId.length){asc_applyFunction(callbackEx,true,true);return bRet}var sheetId=worksheet.model.getId();worksheet.collaborativeEditing.onStartCheckLock();for(var i=0;i<aObjectId.length;i++){var lockInfo=worksheet.collaborativeEditing.getLockInfo(AscCommonExcel.c_oAscLockTypeElem.Object, null,sheetId,aObjectId[i]);if(false===worksheet.collaborativeEditing.getCollaborativeEditing()){asc_applyFunction(callbackEx,true,true);callbackEx=undefined}if(false!==worksheet.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeMine))continue;else if(false!==worksheet.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther)){asc_applyFunction(callbackEx,false);return false}if(_t.bLock)worksheet.collaborativeEditing.addCheckLock(lockInfo)}if(_t.bLock)worksheet.collaborativeEditing.onEndCheckLock(callbackEx); else asc_applyFunction(callbackEx,true,true);return bRet}}function ClickCounter(){this.x=0;this.y=0;this.lastX=-1E3;this.lastY=-1E3;this.button=0;this.time=0;this.clickCount=0;this.log=false}ClickCounter.prototype.mouseDownEvent=function(x,y,button){var currTime=getCurrentTime();if(undefined===button)button=0;var _eps=3*global_mouseEvent.KoefPixToMM;var oApi=Asc&&Asc.editor;if(oApi&&oApi.isMobileVersion&&!window["NATIVE_EDITOR_ENJINE"])_eps*=2;if(Math.abs(global_mouseEvent.X-global_mouseEvent.LastX)> _eps||Math.abs(global_mouseEvent.Y-global_mouseEvent.LastY)>_eps){global_mouseEvent.LastClickTime=-1;global_mouseEvent.ClickCount=0}this.x=x;this.y=y;if(this.button===button&&Math.abs(this.x-this.lastX)<=_eps&&Math.abs(this.y-this.lastY)<=_eps&&currTime-this.time<500)++this.clickCount;else this.clickCount=1;this.lastX=this.x;this.lastY=this.y;if(this.log){console.log("-----");console.log("x-> "+this.x+" : "+x);console.log("y-> "+this.y+" : "+y);console.log("Time: "+(currTime-this.time));console.log("Count: "+ this.clickCount);console.log("")}this.time=currTime};ClickCounter.prototype.mouseMoveEvent=function(x,y){if(this.x!==x||this.y!==y){this.x=x;this.y=y;this.clickCount=0;if(this.log)console.log("Reset counter")}};ClickCounter.prototype.getClickCount=function(){return this.clickCount};var prot;window["AscFormat"]=window["AscFormat"]||{};window["Asc"]=window["Asc"]||{};window["AscFormat"].isObject=isObject;window["AscFormat"].CCellObjectInfo=CCellObjectInfo;window["Asc"]["asc_CChartBinary"]=window["Asc"].asc_CChartBinary= asc_CChartBinary;prot=asc_CChartBinary.prototype;prot["asc_getBinary"]=prot.asc_getBinary;prot["asc_setBinary"]=prot.asc_setBinary;prot["asc_getThemeBinary"]=prot.asc_getThemeBinary;prot["asc_setThemeBinary"]=prot.asc_setThemeBinary;prot["asc_setColorMapBinary"]=prot.asc_setColorMapBinary;prot["asc_getColorMapBinary"]=prot.asc_getColorMapBinary;window["AscFormat"].asc_CChartSeria=asc_CChartSeria;prot=asc_CChartSeria.prototype;prot["asc_getValFormula"]=prot.asc_getValFormula;prot["asc_setValFormula"]= prot.asc_setValFormula;prot["asc_getxValFormula"]=prot.asc_getxValFormula;prot["asc_setxValFormula"]=prot.asc_setxValFormula;prot["asc_getCatFormula"]=prot.asc_getCatFormula;prot["asc_setCatFormula"]=prot.asc_setCatFormula;prot["asc_getTitle"]=prot.asc_getTitle;prot["asc_setTitle"]=prot.asc_setTitle;prot["asc_getTitleFormula"]=prot.asc_getTitleFormula;prot["asc_setTitleFormula"]=prot.asc_setTitleFormula;prot["asc_getMarkerSize"]=prot.asc_getMarkerSize;prot["asc_setMarkerSize"]=prot.asc_setMarkerSize; prot["asc_getMarkerSymbol"]=prot.asc_getMarkerSymbol;prot["asc_setMarkerSymbol"]=prot.asc_setMarkerSymbol;prot["asc_getFormatCode"]=prot.asc_getFormatCode;prot["asc_setFormatCode"]=prot.asc_setFormatCode;window["AscFormat"].GraphicOption=GraphicOption;window["AscFormat"].DrawingObjects=DrawingObjects;window["AscFormat"].ClickCounter=ClickCounter;window["AscFormat"].aSparklinesStyles=aSparklinesStyles;window["AscFormat"].CSparklineView=CSparklineView})(window);"use strict";(function(window,undefined){var ORIENTATION_MIN_MAX= AscFormat.ORIENTATION_MIN_MAX;var globalBasePercent=100;var global3DPersperctive=30;var c_oChartFloorPosition={None:0,Left:1,Right:2,Bottom:3,Top:4};function Processor3D(width,height,left,right,bottom,top,chartSpace,chartsDrawer){this.widthCanvas=width;this.heightCanvas=height;this.left=left?left:0;this.right=right?right:0;this.bottom=bottom?bottom:0;this.top=top?top:0;this.cameraDiffZ=0;this.cameraDiffX=0;this.cameraDiffY=0;this.scaleY=1;this.scaleX=1;this.scaleZ=1;this.aspectRatioY=1;this.aspectRatioX= 1;this.aspectRatioZ=1;this.specialStandardScaleX=1;this.view3D=chartSpace.chart.getView3d();this.chartSpace=chartSpace;this.chartsDrawer=chartsDrawer;this.rPerspective=0;this.hPercent=null;this.angleOx=this.view3D&&this.view3D.rotX?-this.view3D.rotX/360*(Math.PI*2):0;this.angleOy=this.view3D&&this.view3D.rotY?-this.view3D.rotY/360*(Math.PI*2):0;if(!this.view3D.getRAngAx()&&AscFormat.c_oChartTypes.Pie===this.chartsDrawer.calcProp.type)this.angleOy=0;this.orientationCatAx=null;this.orientationValAx= null;this.matrixRotateOx=null;this.matrixRotateOy=null;this.matrixRotateAllAxis=null;this.matrixShearXY=null;this.projectMatrix=null}Processor3D.prototype.calaculate3DProperties=function(baseDepth,gapDepth,bIsCheck){this.calculateCommonOptions();this._calculateAutoHPercent();this._calcAspectRatio();this.depthPerspective=this.view3D.getRAngAx()?this._calculateDepth():this._calculateDepthPerspective();this._calculatePerspective(this.view3D);if(this.view3D.getRAngAx())this._calculateScaleFromDepth(); if(!bIsCheck){this._calculateCameraDiff();if(this.view3D.getRAngAx())this._recalculateScaleWithMaxWidth()}if(AscFormat.c_oChartTypes.Pie===this.chartsDrawer.calcProp.type&&!this.view3D.getRAngAx())this.tempChangeAspectRatioForPie()};Processor3D.prototype.tempChangeAspectRatioForPie=function(){var perspectiveDepth=this.depthPerspective;var widthCanvas=this.widthCanvas;var originalWidthChart=widthCanvas-this.left-this.right;var heightCanvas=this.heightCanvas;var heightChart=heightCanvas-this.top-this.bottom; var points=[],faces=[];points.push(new Point3D(this.left+originalWidthChart/2,this.top,perspectiveDepth,this));points.push(new Point3D(this.left,this.top,perspectiveDepth/2,this));points.push(new Point3D(this.left+originalWidthChart,this.top,perspectiveDepth/2,this));points.push(new Point3D(this.left+originalWidthChart/2,this.top,0,this));points.push(new Point3D(this.left+originalWidthChart/2,this.top+heightChart,perspectiveDepth,this));points.push(new Point3D(this.left,this.top+heightChart,perspectiveDepth/ 2,this));points.push(new Point3D(this.left+originalWidthChart,this.top+heightChart,perspectiveDepth/2,this));points.push(new Point3D(this.left+originalWidthChart/2,this.top+heightChart,0,this));faces.push([0,1,2,3]);faces.push([2,5,4,3]);faces.push([1,6,7,0]);faces.push([6,5,4,7]);faces.push([7,4,3,0]);faces.push([1,6,2,5]);var minMaxOx=this._getMinMaxOx(points,faces);var minMaxOy=this._getMinMaxOy(points,faces);var kF=(minMaxOx.right-minMaxOx.left)/originalWidthChart;if((minMaxOy.bottom-minMaxOy.top)/ kF>heightChart)kF=(minMaxOy.bottom-minMaxOy.top)/heightChart;this.aspectRatioX=this.aspectRatioX*kF;this.aspectRatioY=this.aspectRatioY*kF;this.aspectRatioZ=this.aspectRatioZ*kF};Processor3D.prototype.calculateCommonOptions=function(){this.orientationCatAx=this.chartSpace&&this.chartSpace.chart.plotArea.catAx?this.chartSpace.chart.plotArea.catAx.scaling.orientation:ORIENTATION_MIN_MAX;this.orientationValAx=this.chartSpace&&this.chartSpace.chart.plotArea.valAx?this.chartSpace.chart.plotArea.valAx.scaling.orientation: ORIENTATION_MIN_MAX};Processor3D.prototype._calculateAutoHPercent=function(){var widthLine=this.widthCanvas-(this.left+this.right);var heightLine=this.heightCanvas-(this.top+this.bottom);if(this.hPercent==null){this.hPercent=this.view3D.hPercent===null?heightLine/widthLine:this.view3D.hPercent/100;if(this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.HBar&&(this.view3D.hPercent===null&&this.view3D.getRAngAx()||this.view3D.hPercent!==null&&!this.view3D.getRAngAx()))this.hPercent=1/this.hPercent; if(AscFormat.c_oChartTypes.Pie===this.chartsDrawer.calcProp.type)this.hPercent=.12}};Processor3D.prototype._recalculateScaleWithMaxWidth=function(){var widthLine=this.widthCanvas-(this.left+this.right);var heightLine=this.heightCanvas-(this.top+this.bottom);var widthCanvas=this.widthCanvas;var optimalWidth=heightLine*10;var subType=this.chartsDrawer.calcProp.subType;var type=this.chartsDrawer.calcProp.type;var isStandardType=subType==="standard"||type===AscFormat.c_oChartTypes.Line||type===AscFormat.c_oChartTypes.Area&& subType==="normal"||type===AscFormat.c_oChartTypes.Surface;var optimalWidthLine,kF;if(!isStandardType){this.widthCanvas=optimalWidth+(this.left+this.right);this._calculateScaleNStandard();optimalWidthLine=Math.abs(this.depthPerspective*Math.sin(-this.angleOy))+(this.widthCanvas-(this.left+this.right))/this.aspectRatioX/this.scaleX;kF=optimalWidthLine/widthLine;if(optimalWidthLine<widthLine){this.widthCanvas=widthCanvas;this._calculateScaleNStandard()}else{this.aspectRatioX=widthLine/((optimalWidthLine- Math.abs(this.depthPerspective*Math.sin(-this.angleOy)))/kF);this.scaleY=this.scaleY*kF;this.scaleZ=this.scaleZ*kF;this.widthCanvas=widthCanvas}this._recalculateCameraDiff()}else{var scaleX=this.scaleX;var scaleY=this.scaleY;var scaleZ=this.scaleZ;var aspectRatioX=this.aspectRatioX;var aspectRatioY=this.aspectRatioY;var aspectRatioZ=this.aspectRatioZ;if(Math.abs(this.angleOy)>Math.PI){this.widthCanvas=optimalWidth+(this.left+this.right);this.calaculate3DProperties(null,null,true);var newDepth=Math.abs(this.depthPerspective* Math.sin(-this.angleOy));optimalWidthLine=newDepth+(this.widthCanvas-(this.left+this.right))/this.aspectRatioX/this.scaleX;kF=optimalWidthLine/widthLine;if(optimalWidthLine<widthLine){this.widthCanvas=widthCanvas;this.scaleX=scaleX;this.scaleY=scaleY;this.scaleZ=scaleZ;this.aspectRatioX=aspectRatioX;this.aspectRatioY=aspectRatioY;this.aspectRatioZ=aspectRatioZ;return}this.aspectRatioX=widthLine/((optimalWidthLine-newDepth)/kF);this.scaleY=this.scaleY*kF;this.scaleZ=this.scaleZ*kF;this.widthCanvas= widthCanvas;this._recalculateCameraDiff()}else{this.widthCanvas=optimalWidth+(this.left+this.right);this.calaculate3DProperties(null,null,true);optimalWidthLine=this.depthPerspective*Math.sin(-this.angleOy)+(this.widthCanvas-(this.left+this.right))/this.aspectRatioX/this.scaleX;if(optimalWidthLine<widthLine){this.widthCanvas=widthCanvas;this.scaleX=scaleX;this.scaleY=scaleY;this.scaleZ=scaleZ;this.aspectRatioX=aspectRatioX;this.aspectRatioY=aspectRatioY;this.aspectRatioZ=aspectRatioZ;return}kF=optimalWidthLine/ widthLine;this.aspectRatioX=widthLine/((optimalWidthLine-this.depthPerspective*Math.sin(-this.angleOy))/kF);this.scaleY=this.scaleY*kF;this.scaleZ=this.scaleZ*kF;this.widthCanvas=widthCanvas;this._recalculateCameraDiff()}}};Processor3D.prototype._calculateScaleNStandard=function(){var ptCount=this.chartsDrawer.calcProp.ptCount;var widthLine=this.widthCanvas-(this.left+this.right);var heightLine=this.heightCanvas-(this.top+this.bottom);var trueDepth=Math.abs(this.depthPerspective*Math.sin(-this.angleOx)); var mustHeight=heightLine-trueDepth;var mustWidth=this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.HBar?mustHeight*this.hPercent:mustHeight/this.hPercent;var areaStackedKf=this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Area&&this.chartsDrawer.calcProp.subType!=="normal"?ptCount/(ptCount-1):1;if(this.angleOy===0){this.aspectRatioX=(this.widthCanvas-(this.left+this.right))/mustWidth/areaStackedKf;this.scaleX=1;this.scaleY=1;this.aspectRatioY=heightLine/mustHeight}else{this.aspectRatioX= (this.widthCanvas-(this.left+this.right))/mustWidth/areaStackedKf;this.scaleX=1;this.scaleY=1;this.aspectRatioY=heightLine/mustHeight}var optimalWidthLine=widthLine/this.aspectRatioX/this.scaleX;if(optimalWidthLine<widthLine)return;var kF=optimalWidthLine/widthLine;this.aspectRatioX=kF*this.aspectRatioX;this.scaleY=this.scaleY*kF;this.scaleZ=this.scaleZ*kF};Processor3D.prototype._recalculateCameraDiff=function(){this.cameraDiffX=0;this.cameraDiffY=0;this.cameraDiffZ=0;this._calculateCameraDiff()}; Processor3D.prototype.calculateZPositionValAxis=function(){var result=0;if(!this.view3D.getRAngAx()){var angleOyAbs=Math.abs(this.angleOy);if(angleOyAbs>=Math.PI/2&&angleOyAbs<Math.PI||angleOyAbs>=3*Math.PI/2&&angleOyAbs<2*Math.PI)result=this.depthPerspective}else if(this.chartsDrawer.calcProp.type!==AscFormat.c_oChartTypes.HBar&&this.orientationCatAx!==ORIENTATION_MIN_MAX&&this.depthPerspective!==undefined)result=this.depthPerspective;else if(this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.HBar&& this.orientationCatAx!==ORIENTATION_MIN_MAX&&this.depthPerspective!==undefined)result=this.depthPerspective;return result};Processor3D.prototype.calculateZPositionCatAxis=function(){var result=0;if(!this.view3D.getRAngAx())result=Math.cos(this.angleOy)>0?0:this.depthPerspective;else if(this.chartsDrawer.calcProp.type!==AscFormat.c_oChartTypes.HBar&&this.orientationValAx!==ORIENTATION_MIN_MAX&&this.depthPerspective!==undefined){if(this.chartSpace.chart.plotArea.valAx&&this.chartSpace.chart.plotArea.valAx.yPoints&& this.chartSpace.chart.plotArea.catAx.posY===this.chartSpace.chart.plotArea.valAx.yPoints[0].pos)result=this.depthPerspective}else if(this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.HBar&&this.orientationValAx!==ORIENTATION_MIN_MAX&&this.depthPerspective!==undefined)result=this.depthPerspective;return result};Processor3D.prototype.calculateFloorPosition=function(){var res,absOy;if(this.view3D.getRAngAx())if(this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.HBar){absOy=Math.abs(this.angleOy); res=c_oChartFloorPosition.Left;if(absOy>Math.PI)res=c_oChartFloorPosition.Right}else{res=c_oChartFloorPosition.Bottom;if(this.angleOx>0)res=c_oChartFloorPosition.None}else if(this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.HBar){absOy=Math.abs(this.angleOy);res=c_oChartFloorPosition.Left;if(absOy>Math.PI)res=c_oChartFloorPosition.Right}else{res=c_oChartFloorPosition.Bottom;if(this.angleOx>0)res=c_oChartFloorPosition.None}return res};Processor3D.prototype.convertAndTurnPoint=function(x,y, z,isNScale,isNRotate,isNProject){var res=null;if(this.view3D.getRAngAx())res=this.convertAndTurnPointRAngAx(x,y,z);else res=this.convertAndTurnPointPerspective(x,y,z,isNScale,isNRotate,isNProject);return res};Processor3D.prototype.convertAndTurnPointRAngAx=function(x,y,z){var heightChart=this.heightCanvas-this.top-this.bottom;var widthOriginalChart=this.widthCanvas-this.left-this.right;var point3D=new Point3D(x,y,z,this);this.scale(point3D);var centerXDiff=heightChart/2+this.left/2;var centerYDiff= heightChart/2+this.top;var centerZDiff=this.depthPerspective/2;point3D.offset(-centerXDiff,-centerYDiff,-centerZDiff);var matrixRotateAllAxis=this._shearXY();point3D.multiplyPointOnMatrix1(matrixRotateAllAxis);point3D.offset(this.cameraDiffX,this.cameraDiffY,this.cameraDiffZ);var specialReverseDiff=this.widthCanvas/2+(this.left-this.right)/2;point3D.offset(specialReverseDiff,centerYDiff,centerZDiff);return{x:point3D.x,y:point3D.y,z:z}};Processor3D.prototype.convertAndTurnPointPerspective=function(x, y,z,isNScale,isNRotate,isNProject){var point3D=new Point3D(x,y,z,this);if(!isNScale)this.scale(point3D);if(!isNRotate)this.rotatePerspective(point3D);if(!isNProject)this.projectPerspective(point3D);return{x:point3D.x,y:point3D.y,z:point3D.z}};Processor3D.prototype.scale=function(point3D){point3D.x=point3D.x/this.aspectRatioX;point3D.y=point3D.y/this.aspectRatioY;point3D.x=point3D.x/this.scaleX;point3D.y=point3D.y/this.scaleY;point3D.z=point3D.z/this.scaleZ};Processor3D.prototype.rotatePerspective= function(point3D){point3D.offset(-this.widthCanvas/2/this.aspectRatioX,-this.heightCanvas/2/this.aspectRatioY,0);var matrixRotateAllAxis=this._getMatrixRotateAllAxis();point3D.multiplyPointOnMatrix1(matrixRotateAllAxis);point3D.offset(this.widthCanvas/2/this.aspectRatioX,this.heightCanvas/2/this.aspectRatioY,0)};Processor3D.prototype.projectPerspective=function(point3D){point3D.offset(-this.widthCanvas/2/this.aspectRatioX,-this.heightCanvas/2/this.aspectRatioY,0);point3D.offset(this.cameraDiffX,this.cameraDiffY, this.cameraDiffZ);var projectiveMatrix=this._getPerspectiveProjectionMatrix(1/this.rPerspective);point3D.project(projectiveMatrix);var specialReverseDiffX=this.widthCanvas/2+(this.left-this.right)/2;var specialReverseDiffY=this.heightCanvas/2+(this.top-this.bottom)/2;point3D.offset(specialReverseDiffX,specialReverseDiffY,0)};Processor3D.prototype.calculatePointManual=function(x,y,z,diffX,diffY,diffZ){diffX=diffX!==undefined?diffX:this.cameraDiffX;diffY=diffY!==undefined?diffY:this.cameraDiffY;diffZ= diffZ!==undefined?diffZ:this.cameraDiffZ;var diffAndScalePoints=this.diffAndScale(x,y,z);var x11=diffAndScalePoints.x;var y11=diffAndScalePoints.y;var z11=diffAndScalePoints.z;var rotatePoints=this.rotate(x11,y11,z11);var x111=rotatePoints.x;var y111=rotatePoints.y;var z111=rotatePoints.z;var x1111=x111+diffX;var y1111=y111+diffY;var z1111=z111+diffZ;var projectPoints=this.project(x1111,y1111,z1111);var x11111=projectPoints.x;var y11111=projectPoints.y;return{x:x11111,y:y11111}};Processor3D.prototype.diffAndScale= function(x,y,z){var aRX=this.aspectRatioX;var aRY=this.aspectRatioY;var w=this.widthCanvas;var h=this.heightCanvas;var x1=x/aRX;var x11=x1-w/2/aRX;var z1=z;var z11=z1;var y1=y/aRY;var y11=y1-h/2/aRY;return{x:x11,y:y11,z:z11}};Processor3D.prototype.rotate=function(x11,y11,z11){var sinOY=Math.sin(-this.angleOy);var cosOY=Math.cos(-this.angleOy);var sinOX=Math.sin(-this.angleOx);var cosOX=Math.cos(-this.angleOx);var x111=z11*sinOY+x11*cosOY;var y111=x11*sinOX*sinOY+y11*cosOX-z11*sinOX*cosOY;var z111= -x11*sinOY*cosOX+y11*sinOX+z11*(cosOY*cosOX);return{x:x111,y:y111,z:z111}};Processor3D.prototype.project=function(x1111,y1111,z1111){var fov=1/this.rPerspective;var w=this.widthCanvas;var h=this.heightCanvas;var x11111=fov*x1111/(z1111+fov)+w/2;var y11111=fov*y1111/(z1111+fov)+h/2;return{x:x11111,y:y11111}};Processor3D.prototype.convertAndTurnPointForPie=function(x,y,z,cameraDiffZ){var heightChart=this.heightCanvas-this.top-this.bottom;var point3D=new Point3D(x,y,z,this);var centerXDiff=heightChart/ 2+this.left/2;var centerYDiff=heightChart/2+this.top;var centerZDiff=this.depthPerspective/2;point3D.offset(-centerXDiff,-centerYDiff,-centerZDiff);var matrixRotateAllAxis;if(!this.view3D.getRAngAx())matrixRotateAllAxis=this._getMatrixRotateAllAxis();else matrixRotateAllAxis=this._shearXY();point3D.multiplyPointOnMatrix1(matrixRotateAllAxis);point3D.offset(this.cameraDiffX,this.cameraDiffY,this.cameraDiffZ);var projectionPoint=point3D;if(!this.view3D.getRAngAx()){var projectiveMatrix=this._getPerspectiveProjectionMatrix(1/ this.rPerspective);projectionPoint=point3D.project(projectiveMatrix)}var specialReverseDiff=this.widthCanvas/2+(this.left-this.right)/2;projectionPoint.offset(specialReverseDiff,centerYDiff,centerZDiff);return{x:projectionPoint.x,y:projectionPoint.y}};Processor3D.prototype.calculatePropertiesForPieCharts=function(){var sinAngleOx=Math.sin(-this.angleOx);var cosAngleOx=Math.cos(-this.angleOx);var widthCharts=this.widthCanvas-this.left-this.right;var heightCharts=this.heightCanvas-this.bottom-this.top; var radius1=widthCharts/2;var radius2=radius1*sinAngleOx;var depth=(widthCharts+4.89)/8.37*cosAngleOx;if(radius2*2+depth>heightCharts){var kF=(radius2*2+depth)/heightCharts;radius1=radius1/kF;radius2=radius2/kF;depth=depth/kF}if(0===radius2)radius2=1;return{radius1:radius1,radius2:radius2,depth:depth}};Processor3D.prototype._shearXY=function(){if(null===this.matrixShearXY){this.matrixShearXY=new Matrix4D;this.matrixShearXY.a31=Math.sin(-this.angleOy);this.matrixShearXY.a32=Math.sin(this.angleOx); this.matrixShearXY.a33=0;this.matrixShearXY.a44=0}return this.matrixShearXY};Processor3D.prototype._shearXY2=function(){if(null===this.matrixShearXY)this.matrixShearXY=[[1,0,0,0],[0,1,0,0],[Math.sin(-this.angleOy),Math.sin(this.angleOx),0,0],[0,0,0,0]];return this.matrixShearXY};Processor3D.prototype._getMatrixRotateAllAxis=function(){var matrixRotateOY=this._getMatrixRotateOy();var matrixRotateOX=this._getMatrixRotateOx();if(null===this.matrixRotateAllAxis)this.matrixRotateAllAxis=matrixRotateOY.multiply(matrixRotateOX); return this.matrixRotateAllAxis};Processor3D.prototype._getMatrixRotateOx=function(){if(null===this.matrixRotateOx){this.matrixRotateOx=new Matrix4D;var cos=Math.cos(-this.angleOx);var sin=Math.sin(-this.angleOx);this.matrixRotateOx.a22=cos;this.matrixRotateOx.a23=sin;this.matrixRotateOx.a32=-sin;this.matrixRotateOx.a33=cos;this.matrixRotateOx.a34=1}return this.matrixRotateOx};Processor3D.prototype._getMatrixRotateOy=function(){if(null===this.matrixRotateOy){this.matrixRotateOy=new Matrix4D;var cos= Math.cos(-this.angleOy);var sin=Math.sin(-this.angleOy);this.matrixRotateOy.a11=cos;this.matrixRotateOy.a13=-sin;this.matrixRotateOy.a31=sin;this.matrixRotateOy.a33=cos;this.matrixRotateOy.a34=1}return this.matrixRotateOy};Processor3D.prototype._getMatrixRotateOz=function(){return[[1,0,0,0],[0,1,0,0],[0,0,0,1],[0,0,0,1]]};Processor3D.prototype._getPerspectiveProjectionMatrix=function(fov){if(null===this.projectMatrix){this.projectMatrix=new Matrix4D;this.projectMatrix.a33=0;this.projectMatrix.a34= 1/fov}return this.projectMatrix};Processor3D.prototype.correctPointsPosition=function(chartSpace){if(this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Pie)return;var pxToMM=1/AscCommon.g_dKoef_pix_to_mm;var t=this;var xPoints=chartSpace.chart.plotArea&&chartSpace.chart.plotArea.catAx?chartSpace.chart.plotArea.catAx.xPoints:null;if(!xPoints)xPoints=chartSpace.chart.plotArea&&chartSpace.chart.plotArea.valAx?chartSpace.chart.plotArea.valAx.xPoints:null;var coordYAxisOx=chartSpace.chart.plotArea.catAx.posY; if(!coordYAxisOx)coordYAxisOx=chartSpace.chart.plotArea.valAx.posY!=undefined?chartSpace.chart.plotArea.valAx.posY:chartSpace.chart.plotArea.valAx.posY;var yPoints=chartSpace.chart.plotArea&&chartSpace.chart.plotArea.valAx?chartSpace.chart.plotArea.valAx.yPoints:null;if(!yPoints)yPoints=chartSpace.chart.plotArea&&chartSpace.chart.plotArea.catAx?chartSpace.chart.plotArea.catAx.yPoints:null;var coordXAxisOy=chartSpace.chart.plotArea.catAx.posX?chartSpace.chart.plotArea.catAx.posX:chartSpace.chart.plotArea.catAx.xPos; if(!coordXAxisOy)coordXAxisOy=chartSpace.chart.plotArea.valAx.posX!=undefined?chartSpace.chart.plotArea.valAx.posX:null;var correctPointsOx=function(){var z=t.calculateZPositionCatAxis();var valCatAx=chartSpace.chart.plotArea.catAx;if(!valCatAx.transformXPoints)valCatAx.transformXPoints=[];for(var i=0;i<xPoints.length;i++){var widthText=0;if(valCatAx&&valCatAx.labels&&t.orientationValAx!==ORIENTATION_MIN_MAX)widthText=valCatAx.labels.extY*pxToMM;var point=t.convertAndTurnPoint(xPoints[i].pos*pxToMM, coordYAxisOx*pxToMM-widthText,z);valCatAx.transformXPoints[i]={x:point.x/pxToMM,y:point.y/pxToMM}}};var correctPointsOxHBar=function(){var z=t.calculateZPositionValAxis();var valCatAx=chartSpace.chart.plotArea.valAx;if(!valCatAx.transformXPoints)valCatAx.transformXPoints=[];for(var i=0;i<xPoints.length;i++){var widthText=0;if(t.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.HBar&&valCatAx&&valCatAx.labels&&t.orientationCatAx!==ORIENTATION_MIN_MAX)widthText=valCatAx.labels.extY*pxToMM;var point= t.convertAndTurnPoint(xPoints[i].pos*pxToMM,coordYAxisOx*pxToMM-widthText,z);valCatAx.transformXPoints[i]={x:point.x/pxToMM,y:point.y/pxToMM}}};var correctPointsOy=function(){var zPosition=t.calculateZPositionValAxis();var valCatAx=chartSpace.chart.plotArea.valAx;if(!valCatAx.transformYPoints)valCatAx.transformYPoints=[];for(var i=0;i<yPoints.length;i++){var point=t.convertAndTurnPoint(coordXAxisOy*pxToMM,yPoints[i].pos*pxToMM,zPosition);var widthText=5;if(valCatAx&&valCatAx.labels)widthText=valCatAx.labels.extX* pxToMM;if(t.orientationCatAx!==ORIENTATION_MIN_MAX)widthText=0;var diffXText=0;var angleOyAbs=Math.abs(t.angleOy);if(!t.view3D.getRAngAx()&&(angleOyAbs>=Math.PI/2&&angleOyAbs<3*Math.PI/2))diffXText=-diffXText;valCatAx.transformYPoints[i]={x:(point.x-(diffXText+widthText))/pxToMM,y:point.y/pxToMM}}};var correctPointsOyHBar=function(){var zPosition=t.calculateZPositionCatAxis();var valCatAx=chartSpace.chart.plotArea.catAx;if(!valCatAx.transformYPoints)valCatAx.transformYPoints=[];for(var i=0;i<yPoints.length;i++){var point= t.convertAndTurnPoint(coordXAxisOy*pxToMM,yPoints[i].pos*pxToMM,zPosition);var widthText=0;if(valCatAx&&valCatAx.labels)widthText=valCatAx.labels.extX*pxToMM;if(t.orientationValAx!==ORIENTATION_MIN_MAX)widthText-=10;else widthText+=5;valCatAx.transformYPoints[i]={x:(point.x-widthText)/pxToMM,y:point.y/pxToMM}}};if(xPoints)if(this.chartsDrawer.calcProp.type!==AscFormat.c_oChartTypes.HBar)correctPointsOx(xPoints);else correctPointsOxHBar(xPoints);if(yPoints)if(this.chartsDrawer.calcProp.type!==AscFormat.c_oChartTypes.HBar)correctPointsOy(yPoints); else correctPointsOyHBar(yPoints)};Processor3D.prototype._calculatePerspective=function(view3D){var heightLine=this.heightCanvas-(this.top+this.bottom);var perspective=view3D&&view3D.perspective?view3D.perspective:global3DPersperctive;if(view3D&&0===view3D.perspective&&this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Surface)perspective=1;var alpha=perspective/4;var catt=(heightLine/2+Math.abs(this.top-this.bottom))/Math.tan(alpha/360*(Math.PI*2));var rPerspective;if(catt===0)rPerspective= 0;else rPerspective=1/catt;this.rPerspective=rPerspective};Processor3D.prototype._calculateDepth=function(){var widthOriginalChart=this.widthCanvas-(this.left+this.right);var heightOriginalChart=this.heightCanvas-(this.top+this.bottom);var subType=this.chartsDrawer.calcProp.subType;var type=this.chartsDrawer.calcProp.type;var defaultOverlap=subType=="stacked"||subType=="stackedPer"||subType=="standard"||type==AscFormat.c_oChartTypes.Line||type==AscFormat.c_oChartTypes.Area||type==AscFormat.c_oChartTypes.Surface? 100:0;var overlap=AscFormat.isRealNumber(this.chartSpace.chart.plotArea.chart.overlap)?this.chartSpace.chart.plotArea.chart.overlap/100:defaultOverlap/100;var gapWidth=this.chartSpace.chart.plotArea.chart.gapWidth!=null?this.chartSpace.chart.plotArea.chart.gapWidth/100:150/100;var gapDepth=this.chartSpace.chart.plotArea.chart.gapDepth!=null?this.chartSpace.chart.plotArea.chart.gapDepth/100:type===AscFormat.c_oChartTypes.Area&&subType!=="normal"?1:150/100;var seriesCount=this.chartsDrawer.calcProp.seriesCount; var ptCount=this.chartsDrawer.calcProp.ptCount;var sinOx=Math.abs(Math.sin(-this.angleOx));var sinOy=Math.sin(-this.angleOy);var hPercent=type==AscFormat.c_oChartTypes.HBar?1:this.hPercent;var depthPercent=this._getDepthPercent();var t=this;var areaStackedKf=type===AscFormat.c_oChartTypes.Area&&subType!=="normal"||type===AscFormat.c_oChartTypes.Surface?ptCount/(2*(ptCount-1)):1;var depth=0;var chartWidth=0;var standardType=false;if(subType=="standard"||type==AscFormat.c_oChartTypes.Line||type==AscFormat.c_oChartTypes.Area&& subType=="normal"||type===AscFormat.c_oChartTypes.Surface)standardType=true;var heightHPercent=heightOriginalChart/hPercent;var angleOxKf;if(!standardType){var widthOneBar=heightHPercent/seriesCount/(ptCount-(ptCount-1)*overlap+gapWidth)*sinOy;var a,b;if(this.angleOx===0&&this.angleOy===0)chartWidth=widthOneBar+heightHPercent;else if(this.angleOx!==0){b=seriesCount-(seriesCount-1)*overlap+gapWidth;a=depthPercent/(ptCount*b)/hPercent;var width=heightOriginalChart*areaStackedKf;depth=(width*a+gapDepth* width*a)/(1/sinOx+gapDepth*a+a);chartWidth=heightHPercent-depth}else if(this.angleOy!==0){var widthChart=widthOriginalChart/t.aspectRatioX/t.specialStandardScaleX;b=seriesCount-(seriesCount-1)*overlap+gapWidth;if(subType=="standard"||type==AscFormat.c_oChartTypes.Line||type==AscFormat.c_oChartTypes.Area||type===AscFormat.c_oChartTypes.Surface)b=b/seriesCount;angleOxKf=sinOx===0?1:sinOx;a=depthPercent/(t.chartsDrawer.calcProp.ptCount*b);depth=(widthChart*a+gapDepth*widthChart*a)/(1/angleOxKf+gapDepth* a+a);depth=depth/angleOxKf}}else{angleOxKf=sinOx===0?0:sinOx;if(type==AscFormat.c_oChartTypes.Area)depth=depthPercent/(angleOxKf*depthPercent+(ptCount+Math.floor((seriesCount-ptCount)/2-.5))/seriesCount*hPercent)*heightOriginalChart;else depth=depthPercent/(angleOxKf*depthPercent+(ptCount+Math.floor((seriesCount-ptCount)/2))/seriesCount*hPercent)*heightOriginalChart;if(this.angleOx!==0)depth=depth*Math.sin(-this.angleOx)}return sinOx!==0?Math.abs(depth/sinOx):Math.abs(depth)};Processor3D.prototype._calculateDepthPerspective= function(){var widthCanvas=this.widthCanvas;var widthOriginalChart=widthCanvas-(this.left+this.right);var aspectRatio=this.aspectRatioX/this.specialStandardScaleX;var widthChart=widthOriginalChart/aspectRatio;widthChart=widthChart/this.scaleX;var seriesCount=this.chartsDrawer.calcProp.seriesCount;var width=widthChart/this.chartsDrawer.calcProp.ptCount;var isNormalArea=this.chartsDrawer.calcProp.subType=="normal"&&this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Area||this.chartsDrawer.calcProp.type=== AscFormat.c_oChartTypes.Surface;var defaultOverlap=this.chartsDrawer.calcProp.subType=="stacked"||this.chartsDrawer.calcProp.subType=="stackedPer"||this.chartsDrawer.calcProp.subType=="standard"||this.chartsDrawer.calcProp.type==AscFormat.c_oChartTypes.Line||isNormalArea?100:0;var overlap=AscFormat.isRealNumber(this.chartSpace.chart.plotArea.chart.overlap)?this.chartSpace.chart.plotArea.chart.overlap/100:defaultOverlap/100;var gapWidth=this.chartSpace.chart.plotArea.chart.gapWidth!=null?this.chartSpace.chart.plotArea.chart.gapWidth/ 100:150/100;var gapDepth=this.chartSpace.chart.plotArea.chart.gapDepth!=null?this.chartSpace.chart.plotArea.chart.gapDepth/100:150/100;if(AscFormat.c_oChartTypes.Area===this.chartsDrawer.calcProp.type||AscFormat.c_oChartTypes.Surface===this.chartsDrawer.calcProp.type){gapWidth=0;gapDepth=0}var baseDepth=width/(seriesCount-(seriesCount-1)*overlap+gapWidth);if(this.chartsDrawer.calcProp.subType=="standard"||this.chartsDrawer.calcProp.type==AscFormat.c_oChartTypes.Line||isNormalArea)baseDepth=width/ (seriesCount-(seriesCount-1)*overlap+gapWidth)*seriesCount;var basePercent=this._getDepthPercent();var depth=baseDepth*basePercent;depth=depth+depth*gapDepth;if(this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.HBar&&this.hPercent!==null)depth=this.hPercent*depth;if(this.chartsDrawer.calcProp.subType==="standard"||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Line||isNormalArea){var b=1/seriesCount;var sinOx=Math.sin(-this.angleOx);var angleOxKf=1;var a=basePercent/(this.chartsDrawer.calcProp.ptCount* b);depth=(widthChart*a+widthChart*a)/(1/angleOxKf+a);depth=depth/angleOxKf}return depth};Processor3D.prototype._calcSpecialStandardScaleX=function(){if(!(this.chartsDrawer.calcProp.subType=="standard"||this.chartsDrawer.calcProp.type==AscFormat.c_oChartTypes.Line||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Area&&this.chartsDrawer.calcProp.subType=="normal"||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Surface))return;var n=Math.floor((this.chartsDrawer.calcProp.seriesCount+ this.chartsDrawer.calcProp.ptCount)/2);var kf=this.chartsDrawer.calcProp.ptCount/n;this.specialStandardScaleX=1/kf};Processor3D.prototype._calculateScaleFromDepth=function(){if(this.view3D.getRAngAx()&&this.aspectRatioY===1){var heightCanvas=this.heightCanvas;var heightChart=heightCanvas-this.top-this.bottom;this.scaleY=heightChart/(-this.depthPerspective*Math.sin(Math.abs(this.angleOx))+heightChart);var subType=this.chartsDrawer.calcProp.subType;var newDepth,newWidth;if(!(subType=="standard"||this.chartsDrawer.calcProp.type=== AscFormat.c_oChartTypes.Line||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Surface||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Area&&subType=="normal")){newDepth=this.depthPerspective*Math.sin(-this.angleOx);newWidth=heightChart-newDepth;this.scaleX=heightChart/newWidth}}};Processor3D.prototype._calculateCameraDiff=function(){var perspectiveDepth=this.depthPerspective;var widthCanvas=this.widthCanvas;var originalWidthChart=widthCanvas-this.left-this.right;var heightCanvas= this.heightCanvas;var heightChart=heightCanvas-this.top-this.bottom;var points=[];var faces=[];points.push(new Point3D(this.left,this.top,perspectiveDepth,this));points.push(new Point3D(this.left,heightChart+this.top,perspectiveDepth,this));points.push(new Point3D(originalWidthChart+this.left,heightChart+this.top,perspectiveDepth,this));points.push(new Point3D(originalWidthChart+this.left,this.top,perspectiveDepth,this));points.push(new Point3D(originalWidthChart+this.left,this.top,0,this));points.push(new Point3D(originalWidthChart+ this.left,heightChart+this.top,0,this));points.push(new Point3D(this.left,heightChart+this.top,0,this));points.push(new Point3D(this.left,this.top,0,this));faces.push([0,1,2,3]);faces.push([2,5,4,3]);faces.push([1,6,7,0]);faces.push([6,5,4,7]);faces.push([7,4,3,0]);faces.push([1,6,2,5]);if(!this.view3D.getRAngAx())this._calculateCameraDiffZX(points,faces);if(this.view3D.getRAngAx()){var minMaxOx=this._getMinMaxOx(points,faces);this._calculateCameraDiffX(minMaxOx);var minMaxOy=this._getMinMaxOy(points, faces);this._calculateCameraDiffY(minMaxOy.top,minMaxOy.bottom)}};Processor3D.prototype._calculateCameraDiffZX=function(newPoints){var heightChart=this.heightCanvas-this.top-this.bottom;var widthOriginalChart=this.widthCanvas-this.left-this.right;var heightOriginalChart=heightChart;var minX=null;var maxX=null;var minZ=null;var aspectRatio=widthOriginalChart/heightOriginalChart;for(var i=0;i<newPoints.length;i++){var point3D=new Point3D(newPoints[i].x,newPoints[i].y,newPoints[i].z,this);point3D.scale(aspectRatio, 1,1);point3D.offset(-this.widthCanvas/2/aspectRatio,-this.heightCanvas/2,0);var matrixRotateAllAxis=this._getMatrixRotateAllAxis();point3D.multiplyPointOnMatrix1(matrixRotateAllAxis);if(minZ===null||point3D.z<minZ)minZ=point3D.z;if(minX===null||point3D.x<minX)minX=point3D.x;if(maxX===null||point3D.x>maxX)maxX=point3D.x}this.cameraDiffZ=-minZ;this.checkOutSideArea2(newPoints)};Processor3D.prototype.checkOutSideArea2=function(newPoints){var i=0;var maxI=1E3;var t=this;var heightChart=this.heightCanvas- this.top-this.bottom;var widthChart=this.widthCanvas-this.left-this.right;var calculateZ=function(step){var minMaxOx=t._getMinMaxOxPoints(newPoints,-t.cameraDiffZ);t.cameraDiffX=-minMaxOx.diffX;var x111=t.convertAndTurnPoint(minMaxOx.tempX1,minMaxOx.tempY1,minMaxOx.tempZ1);var x222=t.convertAndTurnPoint(minMaxOx.tempX2,minMaxOx.tempY2,minMaxOx.tempZ2);var diffX=Math.abs(x222.x-x111.x);var minMaxOy=t._getMinMaxOyPoints(newPoints,t.cameraDiffZ);t.cameraDiffY=-minMaxOy.diffY;var y111=t.convertAndTurnPoint(minMaxOy.tempX1, minMaxOy.tempY1,minMaxOy.tempZ1);var y222=t.convertAndTurnPoint(minMaxOy.tempX2,minMaxOy.tempY2,minMaxOy.tempZ2);var diffY=Math.abs(y222.y-y111.y);if(diffX<widthChart&&diffY<heightChart)while(diffX<widthChart&&diffY<heightChart){t.cameraDiffZ-=step;i++;minMaxOx=t._getMinMaxOxPoints(newPoints,-t.cameraDiffZ);t.cameraDiffX=-minMaxOx.diffX;x111=t.convertAndTurnPoint(minMaxOx.tempX1,minMaxOx.tempY1,minMaxOx.tempZ1);x222=t.convertAndTurnPoint(minMaxOx.tempX2,minMaxOx.tempY2,minMaxOx.tempZ2);diffX=Math.abs(x222.x- x111.x);minMaxOy=t._getMinMaxOyPoints(newPoints,t.cameraDiffZ);t.cameraDiffY=-minMaxOy.diffY;y111=t.convertAndTurnPoint(minMaxOy.tempX1,minMaxOy.tempY1,minMaxOy.tempZ1);y222=t.convertAndTurnPoint(minMaxOy.tempX2,minMaxOy.tempY2,minMaxOy.tempZ2);diffY=Math.abs(y222.y-y111.y);if(i>maxI)break}else if(diffX>widthChart||diffY>heightChart)while(diffX>widthChart||diffY>heightChart){t.cameraDiffZ+=step;i++;minMaxOx=t._getMinMaxOxPoints(newPoints,-t.cameraDiffZ);t.cameraDiffX=-minMaxOx.diffX;x111=t.convertAndTurnPoint(minMaxOx.tempX1, minMaxOx.tempY1,minMaxOx.tempZ1);x222=t.convertAndTurnPoint(minMaxOx.tempX2,minMaxOx.tempY2,minMaxOx.tempZ2);diffX=Math.abs(x222.x-x111.x);minMaxOy=t._getMinMaxOyPoints(newPoints,t.cameraDiffZ);t.cameraDiffY=-minMaxOy.diffY;y111=t.convertAndTurnPoint(minMaxOy.tempX1,minMaxOy.tempY1,minMaxOy.tempZ1);y222=t.convertAndTurnPoint(minMaxOy.tempX2,minMaxOy.tempY2,minMaxOy.tempZ2);diffY=Math.abs(y222.y-y111.y);if(i>maxI)break}};calculateZ(100);calculateZ(10);calculateZ(1)};Processor3D.prototype.checkOutSideArea= function(newPoints){var t=this;var heightChart=this.heightCanvas-this.top-this.bottom;var widthChart=this.widthCanvas-this.left-this.right;var DELTA=3;var maxCount=1E3;var calculateZ=function(){var minMaxOx=t._getMinMaxOxPoints(newPoints,-t.cameraDiffZ);t.cameraDiffX=-minMaxOx.diffX;var x111=t.convertAndTurnPoint(minMaxOx.tempX1,minMaxOx.tempY1,minMaxOx.tempZ1);var x222=t.convertAndTurnPoint(minMaxOx.tempX2,minMaxOx.tempY2,minMaxOx.tempZ2);var diffX=Math.abs(x222.x-x111.x);var minMaxOy=t._getMinMaxOyPoints(newPoints, t.cameraDiffZ);t.cameraDiffY=-minMaxOy.diffY;var y111=t.convertAndTurnPoint(minMaxOy.tempX1,minMaxOy.tempY1,minMaxOy.tempZ1);var y222=t.convertAndTurnPoint(minMaxOy.tempX2,minMaxOy.tempY2,minMaxOy.tempZ2);var diffY=Math.abs(y222.y-y111.y);if(diffX<=widthChart&&diffY<=heightChart&&(widthChart-diffX<DELTA||heightChart-diffY<DELTA))return;var count=0;var fStart=t.cameraDiffZ?t.cameraDiffZ:1;var fLeftDiffZ,fRightDiffZ;if(diffX<widthChart&&diffY<heightChart){fLeftDiffZ=0;fRightDiffZ=t.cameraDiffZ}else{fLeftDiffZ= t.cameraDiffZ;while(diffX>=widthChart||diffY>=heightChart){count++;t.cameraDiffZ+=fStart/2;minMaxOx=t._getMinMaxOxPoints(newPoints,-t.cameraDiffZ);t.cameraDiffX=-minMaxOx.diffX;x111=t.convertAndTurnPoint(minMaxOx.tempX1,minMaxOx.tempY1,minMaxOx.tempZ1);x222=t.convertAndTurnPoint(minMaxOx.tempX2,minMaxOx.tempY2,minMaxOx.tempZ2);diffX=Math.abs(x222.x-x111.x);minMaxOy=t._getMinMaxOyPoints(newPoints,t.cameraDiffZ);t.cameraDiffY=-minMaxOy.diffY;y111=t.convertAndTurnPoint(minMaxOy.tempX1,minMaxOy.tempY1, minMaxOy.tempZ1);y222=t.convertAndTurnPoint(minMaxOy.tempX2,minMaxOy.tempY2,minMaxOy.tempZ2);diffY=Math.abs(y222.y-y111.y);if(count>maxCount)return}if(diffX<=widthChart&&diffY<=heightChart&&(widthChart-diffX<DELTA||heightChart-diffY<DELTA))return;fRightDiffZ=t.cameraDiffZ}while(diffX>widthChart||diffY>heightChart||fRightDiffZ-fLeftDiffZ>DELTA){t.cameraDiffZ=fLeftDiffZ+(fRightDiffZ-fLeftDiffZ)/2;count++;minMaxOx=t._getMinMaxOxPoints(newPoints,-t.cameraDiffZ);t.cameraDiffX=-minMaxOx.diffX;var x111= t.convertAndTurnPoint(minMaxOx.tempX1,minMaxOx.tempY1,minMaxOx.tempZ1);var x222=t.convertAndTurnPoint(minMaxOx.tempX2,minMaxOx.tempY2,minMaxOx.tempZ2);var diffX=Math.abs(x222.x-x111.x);var minMaxOy=t._getMinMaxOyPoints(newPoints,t.cameraDiffZ);t.cameraDiffY=-minMaxOy.diffY;var y111=t.convertAndTurnPoint(minMaxOy.tempX1,minMaxOy.tempY1,minMaxOy.tempZ1);var y222=t.convertAndTurnPoint(minMaxOy.tempX2,minMaxOy.tempY2,minMaxOy.tempZ2);var diffY=Math.abs(y222.y-y111.y);if(diffX<widthChart&&diffY<heightChart){if(widthChart- diffX<DELTA||heightChart-diffY<DELTA)break;fRightDiffZ=t.cameraDiffZ}else fLeftDiffZ=t.cameraDiffZ;if(count>maxCount)return}};calculateZ()};Processor3D.prototype._getMinMaxOxPoints=function(points,minZ){var fov=1/this.rPerspective;var t=this;var aspectRatioX=this.aspectRatioX;var aspectRatioY=this.aspectRatioY;var diffAndRotatePoint=function(point){var point3D=new Point3D(point.x,point.y,point.z,t);point3D.scale(aspectRatioX,aspectRatioY,1);point3D.offset(-t.widthCanvas/2/aspectRatioX,-t.heightCanvas/ 2/aspectRatioY,0);var matrixRotateAllAxis=t._getMatrixRotateAllAxis();point3D.multiplyPointOnMatrix1(matrixRotateAllAxis);return point3D};var calculateDiffX=function(x1,x2,z1,z2,minZ,y1,y2){var diffAndScalePoints1=t.diffAndScale(x1,y1,z1);x1=diffAndScalePoints1.x;y1=diffAndScalePoints1.y;z1=diffAndScalePoints1.z;var rotatePoints1=t.rotate(x1,y1,z1);var a1=rotatePoints1.x;var z1S=rotatePoints1.z-minZ;var diffAndScalePoints2=t.diffAndScale(x2,y2,z2);x2=diffAndScalePoints2.x;y2=diffAndScalePoints2.y; z2=diffAndScalePoints2.z;var rotatePoints2=t.rotate(x2,y2,z2);var a2=rotatePoints2.x;var z2S=rotatePoints2.z-minZ;return(-a1*z2S-a1*fov-a2*z1S-a2*fov)/(-z2S-fov-z1S-fov)};var w=t.widthCanvas;var tempArray=this._getArrayAllVergeCube(points);var x11,x22,y11,y22,z11,z22;var tempX1,tempY1,tempZ1,tempX2,tempY2,tempZ2,start,end;for(var i=0;i<tempArray.length-1;i++){start=i;end=i+1;x11=tempArray[start].x-t.widthCanvas/2;x22=tempArray[end].x-t.widthCanvas/2;y11=tempArray[start].y-t.heightCanvas/2;y22=tempArray[end].y- t.heightCanvas/2;z11=tempArray[start].z;z22=tempArray[end].z;tempX1=tempArray[start].x;tempY1=tempArray[start].y;tempZ1=tempArray[start].z;tempX2=tempArray[end].x;tempY2=tempArray[end].y;tempZ2=tempArray[end].z;if(x11>x22){start=i+1;end=i;x11=tempArray[start].x-t.widthCanvas/2;x22=tempArray[end].x-t.widthCanvas/2;y11=tempArray[start].y-t.heightCanvas/2;y22=tempArray[end].y-t.heightCanvas/2;z11=tempArray[start].z;z22=tempArray[end].z;tempX1=tempArray[start].x;tempY1=tempArray[start].y;tempZ1=tempArray[start].z; tempX2=tempArray[end].x;tempY2=tempArray[end].y;tempZ2=tempArray[end].z}var diffX=calculateDiffX(tempX1,tempX2,tempZ1,tempZ2,minZ,tempY1,tempY2);var projectiveMatrix=t._getPerspectiveProjectionMatrix(1/t.rPerspective);var rotatePoint1=diffAndRotatePoint(tempArray[start]);rotatePoint1.offset(-diffX,0,-minZ);rotatePoint1=rotatePoint1.project(projectiveMatrix);var x1=Math.floor(rotatePoint1.x+t.widthCanvas/2);var rotatePoint2=diffAndRotatePoint(tempArray[end]);rotatePoint2.offset(-diffX,0,-minZ);rotatePoint2= rotatePoint2.project(projectiveMatrix);var x2=Math.floor(rotatePoint2.x+t.widthCanvas/2);var leftMargin=x1;var rightMargin=Math.floor(w-x2);if(!(leftMargin>=rightMargin-1&&leftMargin<=rightMargin+1))continue;var isTrue=true;for(var l=0;l<tempArray.length-1;l++){var rotatePoint=diffAndRotatePoint(tempArray[l]);rotatePoint.offset(-diffX,0,-minZ);rotatePoint=rotatePoint.project(projectiveMatrix);var tempX11=Math.floor(rotatePoint.x+t.widthCanvas/2);if(x1<x2){if(tempX11<x1||tempX11>x2){isTrue=false;break}}else if(tempX11> x1||tempX11<x2){isTrue=false;break}}if(isTrue)break}return{diffX:diffX,tempX1:tempX1,tempY1:tempY1,tempZ1:tempZ1,tempX2:tempX2,tempY2:tempY2,tempZ2:tempZ2,x11:x11,z11:z11,x22:x22,z22:z22,y11:y11,y22:y22}};Processor3D.prototype._getMinMaxOyPoints=function(points,minZ){var fov=1/this.rPerspective;var t=this;var h=t.heightCanvas;var w=t.widthCanvas;var calculateDiffY=function(x1,x2,y1,y2,z1,z2,minZ){var diffY=0;var diffAndScalePoints=t.diffAndScale(x1,y1,z1);var x1=diffAndScalePoints.x;var y1=diffAndScalePoints.y; var z1=diffAndScalePoints.z;var rotatePoints=t.rotate(x1,y1,z1);var a1=rotatePoints.y;var z1S=rotatePoints.z+minZ;diffAndScalePoints=t.diffAndScale(x2,y2,z2);x2=diffAndScalePoints.x;y2=diffAndScalePoints.y;z2=diffAndScalePoints.z;rotatePoints=t.rotate(x2,y2,z2);var a2=rotatePoints.y;var z2S=rotatePoints.z+minZ;diffY=(a1*z2S+a1*fov+fov*a2+z1S*a2)/(z2S+fov+z1S+fov);return diffY};var tempArray=this._getArrayAllVergeCube(points);var tempX1,tempY1,tempZ1,tempX2,tempY2,tempZ2;for(var i=0;i<tempArray.length- 1;i++){var start=i;var end=i+1;tempX1=tempArray[start].x;tempY1=tempArray[start].y;tempZ1=tempArray[start].z;tempX2=tempArray[end].x;tempY2=tempArray[end].y;tempZ2=tempArray[end].z;if(tempY1>tempY2){start=i+1;end=i;tempX1=tempArray[start].x;tempY1=tempArray[start].y;tempZ1=tempArray[start].z;tempX2=tempArray[end].x;tempY2=tempArray[end].y;tempZ2=tempArray[end].z}var diffY=calculateDiffY(tempX1,tempX2,tempY1,tempY2,tempZ1,tempZ2,minZ);var rotatePoint1=this.calculatePointManual(tempX1,tempY1,tempZ1, this.cameraDiffX,-diffY,minZ);var y1=rotatePoint1.y;var rotatePoint2=this.calculatePointManual(tempX2,tempY2,tempZ2,this.cameraDiffX,-diffY,minZ);var y2=rotatePoint2.y;var topMargin=y1;var bottomMargin=Math.floor(h-y2);if(!(topMargin>=bottomMargin-1&&topMargin<=bottomMargin+1))continue;var isTrue=true;for(var l=0;l<tempArray.length-1;l++){var rotatePoint=this.calculatePointManual(tempArray[l].x,tempArray[l].y,tempArray[l].z,this.cameraDiffX,-diffY,minZ);var tempY11=rotatePoint.y;if(y1<y2){if(tempY11< y1||tempY11>y2){isTrue=false;break}}else if(tempY11>y1||tempY11<y2){isTrue=false;break}}if(isTrue)break}return{diffY:diffY,tempX1:tempX1,tempY1:tempY1,tempZ1:tempZ1,tempX2:tempX2,tempY2:tempY2,tempZ2:tempZ2}};Processor3D.prototype._getArrayAllVergeCube=function(points){var res=[];res[0]=points[0];res[1]=points[1];res[2]=points[2];res[3]=points[3];res[4]=points[0];res[5]=points[4];res[6]=points[7];res[7]=points[6];res[8]=points[5];res[9]=points[2];res[10]=points[6];res[11]=points[1];res[12]=points[7]; res[13]=points[0];res[14]=points[5];res[15]=points[1];res[16]=points[4];res[17]=points[3];res[18]=points[6];res[19]=points[0];res[20]=points[2];res[21]=points[7];res[22]=points[3];res[23]=points[5];res[24]=points[7];res[25]=points[4];res[26]=points[2];res[27]=points[3];res[28]=points[1];res[29]=points[4];res[30]=points[5];res[31]=points[6];res[32]=points[4];return res};Processor3D.prototype._getMinMaxOyPoints2=function(points,minZ){var t=this;var h=t.heightCanvas;var tempArray=[];tempArray[0]=points[0]; tempArray[1]=points[1];tempArray[2]=points[2];tempArray[3]=points[3];tempArray[4]=points[4];tempArray[5]=points[5];tempArray[6]=points[6];tempArray[7]=points[7];tempArray[8]=points[4];tempArray[9]=points[1];tempArray[10]=points[3];tempArray[11]=points[0];tempArray[12]=points[7];tempArray[13]=points[2];tempArray[14]=points[0];tempArray[15]=points[6];tempArray[16]=points[5];tempArray[17]=points[0];tempArray[18]=points[4];var tempX1,tempY1,tempZ1,tempX2,tempY2,tempZ2;for(var i=0;i<tempArray.length-1;i++){var start= i;var end=i+1;tempX1=tempArray[start].x;tempY1=tempArray[start].y;tempZ1=tempArray[start].z;tempX2=tempArray[end].x;tempY2=tempArray[end].y;tempZ2=tempArray[end].z;if(tempY1>tempY2){start=i+1;end=i;tempX1=tempArray[start].x;tempY1=tempArray[start].y;tempZ1=tempArray[start].z;tempX2=tempArray[end].x;tempY2=tempArray[end].y;tempZ2=tempArray[end].z}var correctOffset=this._correctZPositionOY(tempX1,tempX2,tempZ1,tempZ2,minZ,tempY1,tempY2);var diffZ=correctOffset.minZ;var diffY=correctOffset.diffY;var rotatePoint1= this.calculatePointManual(tempX1,tempY1,tempZ1,this.cameraDiffX,diffY,diffZ);var y1=rotatePoint1.y;var rotatePoint2=this.calculatePointManual(tempX2,tempY2,tempZ2,this.cameraDiffX,diffY,diffZ);var y2=rotatePoint2.y;var topMargin=y1;var bottomMargin=Math.floor(h-y2);if(!(topMargin>=bottomMargin-1&&topMargin<=bottomMargin+1))continue;var isTrue=true;for(var l=0;l<tempArray.length-1;l++){var rotatePoint=this.calculatePointManual(tempArray[l].x,tempArray[l].y,tempArray[l].z,this.cameraDiffX,diffY,diffZ); var tempY11=rotatePoint.y;if(y1<y2){if(tempY11<y1||tempY11>y2){isTrue=false;break}}else if(tempY11>y1||tempY11<y2){isTrue=false;break}}if(isTrue)break}return{diffY:diffY,tempX1:tempX1,tempY1:tempY1,tempZ1:tempZ1,tempX2:tempX2,tempY2:tempY2,tempZ2:tempZ2,diffZ:diffZ}};Processor3D.prototype._correctZPosition4=function(x1,x2,z1,z2,minZ,y1,y2){var t=this;var getDiffXZ3=function(x1,x2,z1,z2,y1,y2){var w=t.widthCanvas;var fov=1/t.rPerspective;var diffAndScalePoints=t.diffAndScale(x1,y1,z1);var x11=diffAndScalePoints.x; var y11=diffAndScalePoints.y;var z11=diffAndScalePoints.z;var rotatePoints=t.rotate(x11,y11,z11);var x111=rotatePoints.x;var z111=rotatePoints.z;var wL=t.left-w/2;diffAndScalePoints=t.diffAndScale(x2,y2,z2);var x22=diffAndScalePoints.x;var y22=diffAndScalePoints.y;var z22=diffAndScalePoints.z;rotatePoints=t.rotate(x22,y22,z22);var x222=rotatePoints.x;var z222=rotatePoints.z;var wR=w/2-t.left;var diffZ=(fov*x222+wL*z111+wL*fov-fov*x111-wR*z222-wR*fov)/(wR-wL);var diffX=(wL*z111+wL*diffZ+wL*fov-fov* x111)/fov;return{minZ:diffZ,diffX:diffX}};var diffXZ3=getDiffXZ3(x1,x2,z1,z2,y1,y2);return{minZ:diffXZ3.minZ,diffX:diffXZ3.diffX}};Processor3D.prototype._correctZPositionOY=function(x1,x2,z1,z2,minZ,y1,y2){var t=this;var getDiffXZ3=function(x1,x2,z1,z2,y1,y2){var h=t.heightCanvas;var fov=1/t.rPerspective;var diffAndScalePoints=t.diffAndScale(x1,y1,z1);var x11=diffAndScalePoints.x;var y11=diffAndScalePoints.y;var z11=diffAndScalePoints.z;var rotatePoints=t.rotate(x11,y11,z11);var y111=rotatePoints.y; var z111=rotatePoints.z;diffAndScalePoints=t.diffAndScale(x2,y2,z2);var x22=diffAndScalePoints.x;var y22=diffAndScalePoints.y;var z22=diffAndScalePoints.z;rotatePoints=t.rotate(x22,y22,z22);var y222=rotatePoints.y;var z222=rotatePoints.z;var wL=t.top-h/2;var wR=h/2-t.bottom;var diffZ=(fov*y111+wR*z222+wR*fov-fov*y222-wL*z111-wL*fov)/(wL-wR);var diffY=(wR*z222+wR*diffZ+wR*fov-fov*y222)/fov;return{minZ:diffZ,diffY:diffY}};var diffXZ3=getDiffXZ3(x1,x2,z1,z2,y1,y2);return{minZ:diffXZ3.minZ,diffY:diffXZ3.diffY}}; Processor3D.prototype._calculateCameraDiffX=function(minMaxOx){var maxLeftPoint=minMaxOx.left;var maxRightPoint=minMaxOx.right;var widthCanvas=this.widthCanvas;var originalWidthChart=widthCanvas-this.left-this.right;var diffLeft=maxLeftPoint-this.left;var diffRight=this.left+originalWidthChart-maxRightPoint;this.cameraDiffX=(diffRight-diffLeft)/2*(1/this.rPerspective+this.cameraDiffZ)/(1/this.rPerspective)};Processor3D.prototype._calculateCameraDiffY=function(maxTopPoint,maxBottomPoint){var top=this.top; var bottom=this.bottom;var heightCanvas=this.heightCanvas;var heightChart=heightCanvas-top-bottom;var diffTop=maxTopPoint-top;var diffBottom=heightChart+top-maxBottomPoint;this.cameraDiffY=(diffBottom-diffTop)/2};Processor3D.prototype._getMinMaxOx=function(points,faces){var mostLeftPointX;var mostRightPointX;var xRight;var xLeft;for(var i=0;i<faces.length-1;i++)for(var k=0;k<=3;k++){var point1=this.convertAndTurnPoint(points[faces[i][k]].x,points[faces[i][k]].y,points[faces[i][k]].z);var x1=point1.x; if(!xLeft){xLeft=x1;mostLeftPointX=new Point3D(points[faces[i][k]].x,points[faces[i][k]].y,points[faces[i][k]].z,this.cChartDrawer);xRight=x1;mostRightPointX=new Point3D(points[faces[i][k]].x,points[faces[i][k]].y,points[faces[i][k]].z,this.cChartDrawer)}else{if(x1<xLeft){xLeft=x1;mostLeftPointX=new Point3D(points[faces[i][k]].x,points[faces[i][k]].y,points[faces[i][k]].z,this.cChartDrawer)}if(x1>xRight){xRight=x1;mostRightPointX=new Point3D(points[faces[i][k]].x,points[faces[i][k]].y,points[faces[i][k]].z, this.cChartDrawer)}}}return{left:xLeft,right:xRight,mostLeftPointX:mostLeftPointX,mostRightPointX:mostRightPointX}};Processor3D.prototype._getMinMaxOy=function(points,faces){var mostTopPointY;var mostBottomPointY;var xTop=this.top+this.heightCanvas;var xBottom=0;for(var i=0;i<faces.length-1;i++)for(var k=0;k<3;k++){var point1=this.convertAndTurnPoint(points[faces[i][k]].x,points[faces[i][k]].y,points[faces[i][k]].z);var point2=this.convertAndTurnPoint(points[faces[i][k+1]].x,points[faces[i][k+1]].y, points[faces[i][k+1]].z);var y1=point1.y;var y2=point2.y;if(y1<=xTop){xTop=y1;mostTopPointY=new Point3D(points[faces[i][k]].x,points[faces[i][k]].y,points[faces[i][k]].z,this.cChartDrawer)}if(y2<=xTop){xTop=y2;mostTopPointY=new Point3D(points[faces[i][k+1]].x,points[faces[i][k+1]].y,points[faces[i][k+1]].z,this.cChartDrawer)}if(y1>=xBottom){xBottom=y1;mostBottomPointY=new Point3D(points[faces[i][k]].x,points[faces[i][k]].y,points[faces[i][k]].z,this.cChartDrawer)}if(y2>=xBottom){xBottom=y2;mostBottomPointY= new Point3D(points[faces[i][k+1]].x,points[faces[i][k+1]].y,points[faces[i][k+1]].z,this.cChartDrawer)}}return{top:xTop,bottom:xBottom,mostTopPointY:mostTopPointY,mostBottomPointY:mostBottomPointY}};Processor3D.prototype._calcAspectRatio=function(){var widthOriginalChart=this.widthCanvas-(this.left+this.right);var heightOriginalChart=this.heightCanvas-(this.top+this.bottom);var hPercent=this.hPercent;var depthPercent=this._getDepthPercent();var aspectRatioX=1;var aspectRatioY=1;var subType=this.chartsDrawer.calcProp.subType; if((subType==="standard"||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Line||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Area&&subType=="normal"||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Surface)&&!this.view3D.getRAngAx()){this._calcSpecialStandardScaleX();aspectRatioX=widthOriginalChart/(heightOriginalChart/hPercent)*this.specialStandardScaleX}else if(subType==="standard"||this.chartsDrawer.calcProp.type===AscFormat.c_oChartTypes.Line||this.chartsDrawer.calcProp.type=== AscFormat.c_oChartTypes.Surface){var seriesCount=this.chartsDrawer.calcProp.seriesCount;var ptCount=this.chartsDrawer.calcProp.ptCount;var depth=this.view3D.getRAngAx()?this._calculateDepth():this._calculateDepthPerspective();var width=depth/depthPercent*(ptCount/seriesCount);aspectRatioX=widthOriginalChart/width}else if(hPercent!==null)aspectRatioX=widthOriginalChart/(heightOriginalChart/hPercent);if(aspectRatioX<1&&this.view3D.getRAngAx()){aspectRatioY=1/aspectRatioX;aspectRatioX=1}this.aspectRatioX= aspectRatioX;this.aspectRatioY=aspectRatioY};Processor3D.prototype._getDepthPercent=function(){if(AscFormat.c_oChartTypes.Pie===this.chartsDrawer.calcProp.type)return globalBasePercent/100;return this.view3D&&this.view3D.depthPercent?this.view3D.depthPercent/100:globalBasePercent/100};function Point3D(x,y,z,chartsDrawer){this.x=x;this.y=y;this.z=z;this.t=1;if(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace}}Point3D.prototype= {constructor:Point3D,rotate:function(angleOx,angleOy,angleOz){var x=this.x;var y=this.y;var z=this.z;var cosy=Math.cos(angleOy);var siny=Math.sin(angleOy);var cosx=Math.cos(angleOx);var sinx=Math.sin(angleOx);var cosz=Math.cos(angleOz);var sinz=Math.sin(angleOz);var newX=cosy*(sinz*y+cosz*x)-siny*z;var newY=sinx*(cosy*z+siny*(sinz*y+cosz*x))+cosx*(cosz*y-sinz*x);var newZ=cosx*(cosy*z+siny*(sinz*y+cosz*x))-sinx*(cosz*y-sinz*x);this.x=newX;this.y=newY;this.z=newZ;return this},project:function(matrix){var projectPoint= matrix.multiplyPoint(this);var newX=projectPoint.x/projectPoint.t;var newY=projectPoint.y/projectPoint.t;this.x=newX;this.y=newY;return this},offset:function(offsetX,offsetY,offsetZ){this.x=this.x+offsetX;this.y=this.y+offsetY;this.z=this.z+offsetZ;return this},scale:function(aspectRatioOx,aspectRatioOy,aspectRatioOz){this.x=this.x/aspectRatioOx;this.y=this.y/aspectRatioOy;this.z=this.z/aspectRatioOz;return this},multiplyPointOnMatrix1:function(matrix){var multiplyMatrix=matrix.multiplyPoint(this); this.x=multiplyMatrix.x;this.y=multiplyMatrix.y;this.z=multiplyMatrix.z}};function Matrix4D(){this.a11=1;this.a12=0;this.a13=0;this.a14=0;this.a21=0;this.a22=1;this.a23=0;this.a24=0;this.a31=0;this.a32=0;this.a33=1;this.a34=0;this.a41=0;this.a42=0;this.a43=0;this.a44=1;return this}Matrix4D.prototype.reset=function(){this.a11=1;this.a12=0;this.a13=0;this.a14=0;this.a21=0;this.a22=1;this.a23=0;this.a24=0;this.a31=0;this.a32=0;this.a33=1;this.a34=0;this.a41=0;this.a42=0;this.a43=0;this.a44=1};Matrix4D.prototype.multiply= function(m){var res=new Matrix4D;res.a11=this.a11*m.a11+this.a12*m.a21+this.a13*m.a31+this.a14*m.a41;res.a12=this.a11*m.a12+this.a12*m.a22+this.a13*m.a32+this.a14*m.a42;res.a13=this.a11*m.a13+this.a12*m.a23+this.a13*m.a33+this.a14*m.a43;res.a14=this.a11*m.a14+this.a12*m.a24+this.a13*m.a34+this.a14*m.a44;res.a21=this.a21*m.a11+this.a22*m.a21+this.a23*m.a31+this.a24*m.a41;res.a22=this.a21*m.a12+this.a22*m.a22+this.a23*m.a32+this.a24*m.a42;res.a23=this.a21*m.a13+this.a22*m.a23+this.a23*m.a33+this.a24* m.a43;res.a24=this.a21*m.a14+this.a22*m.a24+this.a23*m.a34+this.a24*m.a44;res.a31=this.a31*m.a11+this.a32*m.a21+this.a33*m.a31+this.a34*m.a41;res.a32=this.a31*m.a12+this.a32*m.a22+this.a33*m.a32+this.a34*m.a42;res.a33=this.a31*m.a13+this.a32*m.a23+this.a33*m.a33+this.a34*m.a43;res.a34=this.a31*m.a14+this.a32*m.a24+this.a33*m.a34+this.a34*m.a44;res.a41=this.a41*m.a11+this.a42*m.a21+this.a43*m.a31+this.a44*m.a41;res.a42=this.a41*m.a12+this.a42*m.a22+this.a43*m.a32+this.a44*m.a42;res.a43=this.a41*m.a13+ this.a42*m.a23+this.a43*m.a33+this.a44*m.a43;res.a44=this.a41*m.a14+this.a42*m.a24+this.a43*m.a34+this.a44*m.a44;return res};Matrix4D.prototype.multiplyPoint=function(p){var res=new Point3D;res.x=p.x*this.a11+p.y*this.a21+p.z*this.a31+this.a41;res.y=p.x*this.a12+p.y*this.a22+p.z*this.a32+this.a42;res.z=p.x*this.a13+p.y*this.a23+p.z*this.a33+this.a43;res.t=p.x*this.a14+p.y*this.a24+p.z*this.a34+this.a44;return res};function CSortFaces(cChartDrawer,centralViewPoint){this.cChartDrawer=cChartDrawer;this.chartProp= cChartDrawer.calcProp;this.centralViewPoint=null;this._initProperties(centralViewPoint)}CSortFaces.prototype={constructor:CSortFaces,_initProperties:function(centralViewPoint){if(!centralViewPoint){var top=this.chartProp.chartGutter._top;var bottom=this.chartProp.chartGutter._bottom;var left=this.chartProp.chartGutter._left;var right=this.chartProp.chartGutter._right;var widthCanvas=this.chartProp.widthCanvas;var heightCanvas=this.chartProp.heightCanvas;var heightChart=heightCanvas-top-bottom;var widthChart= widthCanvas-left-right;var centerChartY=top+heightChart/2;var centerChartX=left+widthChart/2;var diffX=centerChartX;var diffY=centerChartY;var diffZ=-1/this.cChartDrawer.processor3D.rPerspective;if(!this.cChartDrawer.processor3D.view3D.getRAngAx()&&this.chartProp.type===AscFormat.c_oChartTypes.Bar){diffX-=this.cChartDrawer.processor3D.cameraDiffX;diffY-=this.cChartDrawer.processor3D.cameraDiffY;diffZ-=this.cChartDrawer.processor3D.cameraDiffZ}if(diffZ>0&&this.chartProp.type===AscFormat.c_oChartTypes.Bar&& this.cChartDrawer.processor3D.view3D.getRAngAx()&&(this.chartProp.subType==="stackedPer"||this.chartProp.subType=="stacked"))diffZ-=500;this.centralViewPoint={x:diffX,y:diffY,z:diffZ}}else this.centralViewPoint=centralViewPoint},sortParallelepipeds:function(parallelepipeds){var intersectionsParallelepipeds=this._getIntersectionsParallelepipeds(parallelepipeds);var revIntersections=intersectionsParallelepipeds.reverseIntersections;var countIntersection=intersectionsParallelepipeds.countIntersection; var startIndexes=[];for(var i=0;i<countIntersection.length;i++)if(countIntersection[i]===0)startIndexes.push({index:parseInt(i)});if(startIndexes.length===0){var minZ=parallelepipeds[0].z;var minZArray=[];for(var i=0;i<parallelepipeds.length;i++){if(parallelepipeds[i].z<minZ){minZ=parallelepipeds[i].z;minZArray=[]}if(minZ===parallelepipeds[i].z)minZArray.push({index:parseInt(i)})}startIndexes=minZArray.reverse()}var g=revIntersections;var color={};var time_in={},time_out={};var dfs_timer=0;var dfs= function(v){time_in[v]=dfs_timer++;color[v]=1;for(var i in g[v])if(!color[i])dfs(i);color[v]=2;time_out[v]=dfs_timer++};var getMax=function(){var max=0;var res=null;for(var i in time_out)if(!addIndexes[i]&&time_out[i]>max){max=time_out[i];res=i}return res};for(var i=0;i<startIndexes.length;i++)dfs(startIndexes[i].index);var addIndexes={};var res=[];while(true){var index=getMax();if(null===index)break;res.push({nextIndex:index});addIndexes[index]=1}return res.reverse()},_getIntersectionsParallelepipeds:function(parallelepipeds){var usuallyIntersect= {};var usuallyIntersectRev={};var intersections=[];var reverseIntersections=[];var countIntersection=[];for(var i=0;i<parallelepipeds.length;i++){var fromParallalepiped=parallelepipeds[i];countIntersection[i]=0;for(var m=0;m<parallelepipeds.length;m++){if(m===i||usuallyIntersect[i]===m||usuallyIntersectRev[i]===m)continue;for(var l=0;l<fromParallalepiped.arrPoints.length;l++){var point=fromParallalepiped.arrPoints[l];var toParallalepiped=parallelepipeds[m];for(var n=0;n<toParallalepiped.faces.length;n++){var toVerge= toParallalepiped.faces[n];var lineEqucation=this.cChartDrawer.getLineEquation(point,this.centralViewPoint);var intersection=this._isIntersectionFaceAndLine(toVerge,lineEqucation,point);if(intersection){usuallyIntersect[i]=m;usuallyIntersectRev[m]=i;if(!intersections[i])intersections[i]=[];if(!reverseIntersections[m])reverseIntersections[m]=[];countIntersection[i]++;intersections[i][m]=1;reverseIntersections[m][i]=1;l=point.length;break}}}}}return{intersections:intersections,reverseIntersections:reverseIntersections, countIntersection:countIntersection}},_isIntersectionFacesPointLines:function(plainVerge,i,sortZIndexPaths){var res=false;var t=this;for(var j=0;j<plainVerge.points.length;j++){var pointFromVerge=plainVerge.points[j];var lineEqucation=t.cChartDrawer.getLineEquation(pointFromVerge,this.centralViewPoint);if(t._isIntersectionFacesAndLine(lineEqucation,pointFromVerge,i,j,sortZIndexPaths)){res=true;break}}return res},_isIntersectionFacesAndLine:function(lineEqucation,pointFromVerge,i,j,sortZIndexPaths){var res= false;for(var k=0;k<sortZIndexPaths.length;k++){if(k===i)continue;if(this._isIntersectionFaceAndLine(sortZIndexPaths[k],lineEqucation,pointFromVerge,i,j,k)){res=true;break}}return res},_isIntersectionFaceAndLine:function(plain,lineEquation,pointFromVerge){var res=false;var t=this;var nIntersectionPlainAndLine=t.cChartDrawer.isIntersectionPlainAndLine(plain.plainEquation,lineEquation);if(null===nIntersectionPlainAndLine)return res;var iSX=nIntersectionPlainAndLine.x;var iSY=nIntersectionPlainAndLine.y; var iSZ=nIntersectionPlainAndLine.z;if(Math.round(iSZ*1E3)/1E3<Math.round(pointFromVerge.z*1E3)/1E3){var minMaxpoints=t.cChartDrawer.getMinMaxPoints(plain.points);var minX=minMaxpoints.minX,maxX=minMaxpoints.maxX,minY=minMaxpoints.minY,maxY=minMaxpoints.maxY,minZ=minMaxpoints.minZ,maxZ=minMaxpoints.maxZ;var isBeetwenX=t._isBetweenPoint(iSX,minX,maxX);var isBeetwenY=t._isBetweenPoint(iSY,minY,maxY);var isBeetwenZ=t._isBetweenPoint(iSZ,minZ,maxZ);if(isBeetwenX&&isBeetwenY&&isBeetwenZ){var point0=plain.points2[0]; var point1=plain.points2[1];var point2=plain.points2[2];var point3=plain.points2[3];var projectIntersection=nIntersectionPlainAndLine;if(!this.cChartDrawer.processor3D.view3D.getRAngAx())projectIntersection=t.cChartDrawer._convertAndTurnPoint(nIntersectionPlainAndLine.x,nIntersectionPlainAndLine.y,nIntersectionPlainAndLine.z,true,true);var areaQuadrilateral=plain.plainArea;var areaTriangle1=t.cChartDrawer.getAreaTriangle(point0,projectIntersection,point1);var areaTriangle2=t.cChartDrawer.getAreaTriangle(point1, projectIntersection,point2);var areaTriangle3=t.cChartDrawer.getAreaTriangle(point2,projectIntersection,point3);var areaTriangle4=t.cChartDrawer.getAreaTriangle(point3,projectIntersection,point0);if(parseInt(areaQuadrilateral)===parseInt(areaTriangle1+areaTriangle2+areaTriangle3+areaTriangle4))res=nIntersectionPlainAndLine}}return res},_isBetweenPoint:function(point,start,end){var res=false;point=Math.round(point*100)/100;start=Math.round(start*100)/100;end=Math.round(end*100)/100;if(point>=start&& point<=end)res=true;return res},_isEqualPoints:function(point1,point2){var res=false;if(parseInt(point1.x)===parseInt(point2.x)&&parseInt(point1.y)===parseInt(point2.y)&&parseInt(point1.y)===parseInt(point2.y))res=true;return res}};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].Processor3D=Processor3D;window["AscFormat"].Point3D=Point3D;window["AscFormat"].CSortFaces=CSortFaces;window["AscCommon"].c_oChartFloorPosition=c_oChartFloorPosition})(window);"use strict";(function(window, undefined){var cToDeg=AscFormat.cToDeg;var ORIENTATION_MIN_MAX=AscFormat.ORIENTATION_MIN_MAX;var Point3D=AscFormat.Point3D;var c_oAscTickMark=Asc.c_oAscTickMark;var c_oAscChartDataLabelsPos=Asc.c_oAscChartDataLabelsPos;var c_oAscChartLegendShowSettings=Asc.c_oAscChartLegendShowSettings;var test_compare_paths=false;var test_compare_paths_arr;var c_oChartTypes={Bar:0,Line:1,HBar:2,Pie:3,Scatter:4,Area:5,Stock:6,DoughnutChart:7,Radar:8,BubbleChart:9,Surface:10};var c_oChartBar3dFaces={front:0,up:1,left:2, right:3,down:4,back:5};var globalGapDepth=150;var isTurnOn3DCharts=true;var standartMarginForCharts=13;function arrReverse(arr){if(!arr||!arr.length)return;var newarr=[];for(var i=0;i<arr[0].length;++i){newarr[i]=[];for(var j=0;j<arr.length;++j)newarr[i][j]=arr[j][i]}return newarr}function CChartsDrawer(){this.calcProp={};this.areaChart=null;this.chart=null;this.cChartSpace=null;this.cShapeDrawer=null;this.processor3D=null;this.areaChart=null;this.catAxisChart=null;this.valAxisChart=null;this.serAxisChart= null;this.floor3DChart=null;this.sideWall3DChart=null;this.backWall3DChart=null;this.changeAxisMap=null}CChartsDrawer.prototype={constructor:CChartsDrawer,recalculate:function(chartSpace){this.cChartSpace=chartSpace;this.calcProp={};if(this._isSwitchCurrent3DChart(chartSpace)){standartMarginForCharts=16;this.nDimensionCount=3}else this.nDimensionCount=2;if(!chartSpace.bEmptySeries)this._calculateProperties(chartSpace);if(this.calcProp.widthCanvas==undefined&&this.calcProp.pxToMM==undefined){this.calcProp.pathH= 1E9;this.calcProp.pathW=1E9;this.calcProp.pxToMM=1/AscCommon.g_dKoef_pix_to_mm;this.calcProp.widthCanvas=chartSpace.extX*this.calcProp.pxToMM;this.calcProp.heightCanvas=chartSpace.extY*this.calcProp.pxToMM}this.init(chartSpace);if(!chartSpace.bEmptySeries){if(this.nDimensionCount===3)this._calaculate3DProperties(chartSpace);this.plotAreaChart.recalculate(this)}this.areaChart.recalculate(this);if(!chartSpace.bEmptySeries){this.valAxisChart=[];this.catAxisChart=[];this.serAxisChart=[];for(var i=0;i< chartSpace.chart.plotArea.axId.length;i++){var axId=chartSpace.chart.plotArea.axId[i];if(axId instanceof AscFormat.CCatAx){var catAx=new catAxisChart;catAx.recalculate(this,axId);this.catAxisChart.push(catAx)}else if(axId instanceof AscFormat.CValAx){var valAx=new valAxisChart;valAx.recalculate(this,axId);this.valAxisChart.push(valAx)}else if(axId instanceof AscFormat.CSerAx){var serAx=new serAxisChart;serAx.recalculate(this,axId);this.serAxisChart.push(serAx)}else if(axId instanceof AscFormat.CDateAx){var catAx= new serAxisChart;catAx.recalculate(this,axId);this.catAxisChart.push(catAx)}}if(this.nDimensionCount===3){this.floor3DChart.recalculate(this);this.sideWall3DChart.recalculate(this);this.backWall3DChart.recalculate(this)}}if(!chartSpace.bEmptySeries)for(var i in this.charts)this.charts[i].recalculate();this._testChartsPaths()},init:function(chartSpace){this.areaChart=new areaChart;this.plotAreaChart=new plotAreaChart;this.floor3DChart=new floor3DChart;this.sideWall3DChart=new sideWall3DChart;this.backWall3DChart= new backWall3DChart;var newChart;for(var i=0;i<chartSpace.chart.plotArea.charts.length;i++){var chart=chartSpace.chart.plotArea.charts[i];switch(this._getChartType(chart)){case c_oChartTypes.Bar:{newChart=new drawBarChart(chart,this);break}case c_oChartTypes.Line:{newChart=new drawLineChart(chart,this);break}case c_oChartTypes.HBar:{newChart=new drawHBarChart(chart,this);break}case c_oChartTypes.Pie:{newChart=new drawPieChart(chart,this);break}case c_oChartTypes.Scatter:{newChart=new drawScatterChart(chart, this);break}case c_oChartTypes.Area:{newChart=new drawAreaChart(chart,this);break}case c_oChartTypes.Stock:{newChart=new drawStockChart(chart,this);break}case c_oChartTypes.DoughnutChart:{newChart=new drawDoughnutChart(chart,this);break}case c_oChartTypes.Radar:{newChart=new drawRadarChart(chart,this);break}case c_oChartTypes.BubbleChart:{newChart=new drawBubbleChart(chart,this);break}case c_oChartTypes.Surface:{newChart=new drawSurfaceChart(chart,this);break}}if(i===0){this.chart=newChart;this.charts= {}}this.charts[chart.Id]=newChart}},draw:function(chartSpace,graphics){var t=this;this.cChartSpace=chartSpace;var cShapeDrawer=new AscCommon.CShapeDrawer;cShapeDrawer.Graphics=graphics;this.calcProp.series=chartSpace.chart.plotArea.chart.series;this.cShapeDrawer=cShapeDrawer;this.areaChart.draw(this);var drawCharts=function(bBeforeAxes){if(!bBeforeAxes&&t.nDimensionCount===3)return;var sortCharts=t._sortChartsForDrawing(chartSpace);for(var i=0;i<sortCharts.length;i++){var id=sortCharts[i];var chartModel= t._getChartModelById(chartSpace.chart.plotArea,id);if(!chartModel)continue;var type=chartModel.getObjectType();var isLinesChart=type===AscDFH.historyitem_type_LineChart||type===AscDFH.historyitem_type_ScatterChart;if(t.nDimensionCount!==3&&(isLinesChart&&bBeforeAxes||!isLinesChart&&!bBeforeAxes))continue;var bIsNoSmartAttack=false;if(t.nDimensionCount===3||isLinesChart)bIsNoSmartAttack=true;if(bIsNoSmartAttack)t.cShapeDrawer.bIsNoSmartAttack=true;t.calcProp.series=chartModel.series;t.charts[id].draw(); if(bIsNoSmartAttack)t.cShapeDrawer.bIsNoSmartAttack=false}};if(!chartSpace.bEmptySeries){this.plotAreaChart.draw(this,true);if(this.calcProp.type!==c_oChartTypes.Pie&&this.calcProp.type!==c_oChartTypes.DoughnutChart){if(this.nDimensionCount===3){this.floor3DChart.draw(this);this.sideWall3DChart.draw(this);this.backWall3DChart.draw(this)}for(var i=0;i<this.catAxisChart.length;i++)this.catAxisChart[i].draw(this,null,true);for(var i=0;i<this.valAxisChart.length;i++)this.valAxisChart[i].draw(this,null, true);this.plotAreaChart.draw(this,null,true)}drawCharts(true);for(var i=0;i<this.catAxisChart.length;i++)this.catAxisChart[i].draw(this);for(var i=0;i<this.valAxisChart.length;i++)this.valAxisChart[i].draw(this);for(var i=0;i<this.serAxisChart.length;i++)this.serAxisChart[i].draw(this);drawCharts()}},_testChartsPaths:function(){var buildAllPaths=false;var col=41;if(test_compare_paths){if(undefined===window.test_compare_paths_count)window.test_compare_paths_count=0;if(!test_compare_paths_arr){var row= 0;var str="";while(true){var val=this.cChartSpace.worksheet.getCell3(row,col).getValue();if(""!==val){str+=val;row++}else break}if(""!==str)test_compare_paths_arr=JSON.parse(str)}if(!test_compare_paths_arr)test_compare_paths_arr=[];if(test_compare_paths_arr[window.test_compare_paths_count]!==JSON.stringify(this.cChartSpace.GetPath().ArrPathCommand))console.log("error drawing charts"+window.test_compare_paths_count);if(buildAllPaths){test_compare_paths_arr[window.test_compare_paths_count]=JSON.stringify(this.cChartSpace.GetPath().ArrPathCommand); console.log(JSON.stringify(test_compare_paths_arr))}window.test_compare_paths_count++}},_sortChartsForDrawing:function(chartSpace){var arr=[];var pushIndex=function(index){if(!arr[index])arr[index]=[];arr[index].push(i)};for(var i in this.charts){var chartModel=this._getChartModelById(chartSpace.chart.plotArea,i);if(!chartModel)continue;var type=chartModel.getObjectType();switch(type){case AscDFH.historyitem_type_DoughnutChart:{pushIndex(0);break}case AscDFH.historyitem_type_PieChart:{pushIndex(1); break}case AscDFH.historyitem_type_AreaChart:{pushIndex(2);break}case AscDFH.historyitem_type_BarChart:{pushIndex(3);break}case AscDFH.historyitem_type_StockChart:{pushIndex(4);break}case AscDFH.historyitem_type_LineChart:{pushIndex(5);break}case AscDFH.historyitem_type_ScatterChart:{pushIndex(6);break}case AscDFH.historyitem_type_RadarChart:{pushIndex(7);break}default:{pushIndex(8);break}}}var sortArr=[];for(var j=0;j<arr.length;j++)if(arr[j])for(var k=0;k<arr[j].length;k++)sortArr.push(arr[j][k]); return sortArr},recalculateOnly3dProps:function(chartSpace){this.calcProp={};if(this._isSwitchCurrent3DChart(chartSpace)){standartMarginForCharts=16;this.nDimensionCount=3;if(!chartSpace.bEmptySeries)this._calculateProperties(chartSpace);if(this.calcProp.widthCanvas==undefined&&this.calcProp.pxToMM==undefined){this.calcProp.pathH=1E9;this.calcProp.pathW=1E9;this.calcProp.pxToMM=1/AscCommon.g_dKoef_pix_to_mm;this.calcProp.widthCanvas=chartSpace.extX*this.calcProp.pxToMM;this.calcProp.heightCanvas= chartSpace.extY*this.calcProp.pxToMM}if(!chartSpace.bEmptySeries)if(this.nDimensionCount===3)this._calaculate3DProperties(chartSpace)}},_getChartModelById:function(plotArea,id){var res=null;var charts=plotArea.charts;if(charts)for(var i=0;i<charts.length;i++)if(id===charts[i].Id){res=charts[i];break}return res},_getChartModelIdBySerIdx:function(plotArea,idx){var res=null;var charts=plotArea.charts;if(charts)for(var i=0;i<charts.length;i++)for(var j=0;j<charts[i].series.length;j++)if(idx===charts[i].series[j].idx){res= charts[i].Id;break}return res},_getIndexByIdxSeria:function(series,val){for(var i=0;i<series.length;i++)if(series[i].idx===val)return i},recalculatePositionText:function(obj){var pos;if(!this.cChartSpace.bEmptySeries){var type=obj.getObjectType();switch(type){case AscDFH.historyitem_type_DLbl:{pos=this._calculatePositionDlbl(obj);break}case AscDFH.historyitem_type_Title:{pos=this._calculatePositionTitle(obj);break}case AscDFH.historyitem_type_ValAx:case AscDFH.historyitem_type_CatAx:case AscDFH.historyitem_type_DateAx:{pos= this._calculatePositionAxisTitle(obj);break}case AscDFH.historyitem_type_Legend:{pos=this._calculatePositionLegend(obj);break}default:{pos={x:0,y:0};break}}}return{x:pos?pos.x:undefined,y:pos?pos.y:undefined}},_calculatePositionDlbl:function(obj){var res=null;var chartSpace=obj.chart;var bLayout=AscCommon.isRealObject(obj.layout)&&(AscFormat.isRealNumber(obj.layout.x)||AscFormat.isRealNumber(obj.layout.y));var serIdx=obj.series.idx;var valIdx=obj.pt.idx;var chartId=this._getChartModelIdBySerIdx(chartSpace.chart.plotArea, serIdx);if(null!==chartId&&this.charts[chartId]&&this.charts[chartId].chart&&this.charts[chartId].chart.series){var serIndex=this._getIndexByIdxSeria(this.charts[chartId].chart.series,serIdx);res=this.charts[chartId]._calculateDLbl(chartSpace,serIndex,valIdx,bLayout,serIdx)}return res},_calculatePositionTitle:function(title){var widthGraph=title.chart.extX;var widthTitle=title.extX;var standartMargin=7;var y=standartMargin/this.calcProp.pxToMM;var x=widthGraph/2-widthTitle/2;return{x:x,y:y}},_calculatePositionAxisTitle:function(axis){var chart= axis.parent&&axis.parent.parent?axis.parent.parent:null;var legend=chart?chart.legend:null;var title=chart?chart.title:null;var x=0,y=0,pxToMM=this.calcProp.pxToMM;if(axis&&axis.title){var widthAxisTitle=axis.title.extX;var heightAxisTitle=axis.title.extY;var layout=this.cChartSpace.chart.plotArea.layout;if(layout){var x1=layout.x*this.calcProp.widthCanvas;var y1=layout.y*this.calcProp.heightCanvas;var w=layout.w*this.calcProp.widthCanvas;var h=layout.h*this.calcProp.heightCanvas;var hLabels=axis.labels? axis.labels.extY:0;switch(axis.axPos){case window["AscFormat"].AX_POS_B:{y=(y1+h)/pxToMM+hLabels;if(y+heightAxisTitle>this.calcProp.heightCanvas/pxToMM)y=this.calcProp.heightCanvas/pxToMM-heightAxisTitle;x=(this.calcProp.chartGutter._left+this.calcProp.trueWidth/2)/pxToMM-widthAxisTitle/2;break}case window["AscFormat"].AX_POS_T:{y=standartMarginForCharts/pxToMM;x=(this.calcProp.chartGutter._left+this.calcProp.trueWidth/2)/pxToMM-widthAxisTitle/2;if(legend&&legend.legendPos===c_oAscChartLegendShowSettings.top)y+= legend.extY+standartMarginForCharts/2/pxToMM;if(title!==null&&!title.overlay)y+=title.extY+standartMarginForCharts/2/pxToMM;break}case window["AscFormat"].AX_POS_L:{y=(this.calcProp.chartGutter._top+this.calcProp.trueHeight/2)/pxToMM-heightAxisTitle/2;x=standartMarginForCharts/pxToMM;if(legend&&legend.legendPos===c_oAscChartLegendShowSettings.left)x+=legend.extX;break}case window["AscFormat"].AX_POS_R:{y=(this.calcProp.chartGutter._top+this.calcProp.trueHeight/2)/pxToMM-heightAxisTitle/2;x=(this.calcProp.widthCanvas- standartMarginForCharts)/pxToMM-widthAxisTitle;if(legend&&legend.legendPos===c_oAscChartLegendShowSettings.right)x-=legend.extX;break}}}else switch(axis.axPos){case window["AscFormat"].AX_POS_B:{y=(this.calcProp.heightCanvas-standartMarginForCharts)/pxToMM-heightAxisTitle;x=(this.calcProp.chartGutter._left+this.calcProp.trueWidth/2)/pxToMM-widthAxisTitle/2;if(legend&&legend.legendPos===c_oAscChartLegendShowSettings.bottom)y-=legend.extY+standartMarginForCharts/2/pxToMM;break}case window["AscFormat"].AX_POS_T:{y= standartMarginForCharts/pxToMM;x=(this.calcProp.chartGutter._left+this.calcProp.trueWidth/2)/pxToMM-widthAxisTitle/2;if(legend&&legend.legendPos===c_oAscChartLegendShowSettings.top)y+=legend.extY+standartMarginForCharts/2/pxToMM;if(title!==null&&!title.overlay)y+=title.extY+standartMarginForCharts/2/pxToMM;break}case window["AscFormat"].AX_POS_L:{y=(this.calcProp.chartGutter._top+this.calcProp.trueHeight/2)/pxToMM-heightAxisTitle/2;x=standartMarginForCharts/pxToMM;if(legend&&legend.legendPos===c_oAscChartLegendShowSettings.left)x+= legend.extX;break}case window["AscFormat"].AX_POS_R:{y=(this.calcProp.chartGutter._top+this.calcProp.trueHeight/2)/pxToMM-heightAxisTitle/2;x=(this.calcProp.widthCanvas-standartMarginForCharts)/pxToMM-widthAxisTitle;if(legend&&legend.legendPos===c_oAscChartLegendShowSettings.right)x-=legend.extX;break}}if(this.nDimensionCount===3){var convertResult;if(axis instanceof AscFormat.CCatAx){convertResult=this._convertAndTurnPoint((x+widthAxisTitle/2)*pxToMM,y*pxToMM,this.processor3D.calculateZPositionCatAxis()); x=convertResult.x/pxToMM-widthAxisTitle/2}else if(!this.processor3D.view3D.getRAngAx()&&(this.calcProp.type===c_oChartTypes.Bar||this.calcProp.type===c_oChartTypes.Line)){var posX=axis.posX;var widthLabels=axis.labels&&axis.labels.extX?axis.labels.extX:0;var yPoints=axis.yPoints;var upYPoint=yPoints&&yPoints[0]?yPoints[0].pos:0;var downYPoint=yPoints&&yPoints[yPoints.length-1]?yPoints[yPoints.length-1].pos:0;var tempX=posX-widthLabels;var convertResultX=this._convertAndTurnPoint(tempX*pxToMM,y*pxToMM, 0);x=convertResultX.x/pxToMM-widthAxisTitle;var convertResultY1=this._convertAndTurnPoint(posX*pxToMM,upYPoint*pxToMM,0);var convertResultY2=this._convertAndTurnPoint(posX*pxToMM,downYPoint*pxToMM,0);var heightPerspectiveChart=convertResultY1.y-convertResultY2.y;y=(convertResultY2.y+heightPerspectiveChart/2)/pxToMM-heightAxisTitle/2}else{convertResult=this._convertAndTurnPoint(x*pxToMM,y*pxToMM,0);y=convertResult.y/pxToMM}}}return{x:x,y:y}},_calculatePositionLegend:function(legend){var widthLegend= legend.extX;var heightLegend=legend.extY;var x,y;var nLegendPos=legend.legendPos!==null?legend.legendPos:c_oAscChartLegendShowSettings.right;switch(nLegendPos){case c_oAscChartLegendShowSettings.left:case c_oAscChartLegendShowSettings.leftOverlay:{x=standartMarginForCharts/2/this.calcProp.pxToMM;y=this.calcProp.heightCanvas/2/this.calcProp.pxToMM-heightLegend/2;break}case c_oAscChartLegendShowSettings.top:{x=this.calcProp.widthCanvas/2/this.calcProp.pxToMM-widthLegend/2;y=standartMarginForCharts/ 2/this.calcProp.pxToMM;if(legend.parent.title!==null&&!legend.parent.title.overlay)y+=legend.parent.title.extY+standartMarginForCharts/2/this.calcProp.pxToMM;break}case c_oAscChartLegendShowSettings.right:case c_oAscChartLegendShowSettings.rightOverlay:{x=(this.calcProp.widthCanvas-standartMarginForCharts/2)/this.calcProp.pxToMM-widthLegend;y=this.calcProp.heightCanvas/2/this.calcProp.pxToMM-heightLegend/2;break}case c_oAscChartLegendShowSettings.bottom:{x=this.calcProp.widthCanvas/2/this.calcProp.pxToMM- widthLegend/2;y=(this.calcProp.heightCanvas-standartMarginForCharts/2)/this.calcProp.pxToMM-heightLegend;break}case c_oAscChartLegendShowSettings.topRight:{x=(this.calcProp.widthCanvas-standartMarginForCharts/2)/this.calcProp.pxToMM-widthLegend;y=standartMarginForCharts/2/this.calcProp.pxToMM;if(legend.parent.title!==null&&!legend.parent.title.overlay)y+=legend.parent.title.extY+standartMarginForCharts/2/this.calcProp.pxToMM;break}default:{x=(this.calcProp.widthCanvas-standartMarginForCharts/2)/this.calcProp.pxToMM- widthLegend;y=this.calcProp.heightCanvas/this.calcProp.pxToMM-heightLegend/2;break}}return{x:x,y:y}},_calculateMarginsChart:function(chartSpace,dNotPutResult){this.calcProp.chartGutter={};if(this._isSwitchCurrent3DChart(chartSpace))standartMarginForCharts=16;if(!this.calcProp.pxToMM)this.calcProp.pxToMM=1/AscCommon.g_dKoef_pix_to_mm;var pxToMM=this.calcProp.pxToMM;var plotArea=chartSpace.chart.plotArea;var marginOnPoints=this._calculateMarginOnPoints(chartSpace);var calculateLeft=marginOnPoints.calculateLeft, calculateRight=marginOnPoints.calculateRight,calculateTop=marginOnPoints.calculateTop,calculateBottom=marginOnPoints.calculateBottom;var labelsMargin=this._calculateMarginLabels(chartSpace);var left=labelsMargin.left,right=labelsMargin.right,top=labelsMargin.top,bottom=labelsMargin.bottom;var leftTextLabels=0;var rightTextLabels=0;var topTextLabels=0;var bottomTextLabels=0;var axId=chartSpace.chart.plotArea.axId;if(axId)for(var i=0;i<axId.length;i++)if(null!==axId[i].title)switch(axId[i].axPos){case window["AscFormat"].AX_POS_B:{bottomTextLabels+= axId[i].title.extY;break}case window["AscFormat"].AX_POS_T:{topTextLabels+=axId[i].title.extY;break}case window["AscFormat"].AX_POS_L:{leftTextLabels+=axId[i].title.extX;break}case window["AscFormat"].AX_POS_R:{rightTextLabels+=axId[i].title.extX;break}}var topMainTitle=0;if(chartSpace.chart.title!==null&&!chartSpace.chart.title.overlay)topMainTitle+=chartSpace.chart.title.extY;var leftKey=0,rightKey=0,topKey=0,bottomKey=0;if(chartSpace.chart.legend&&!chartSpace.chart.legend.overlay){var fLegendExtX= chartSpace.chart.legend.extX;var fLegendExtY=chartSpace.chart.legend.extY;if(chartSpace.chart.legend.layout)if(AscFormat.isRealNumber(chartSpace.chart.legend.naturalWidth)&&AscFormat.isRealNumber(chartSpace.chart.legend.naturalHeight)){fLegendExtX=chartSpace.chart.legend.naturalWidth;fLegendExtY=chartSpace.chart.legend.naturalHeight}var nLegendPos=chartSpace.chart.legend.legendPos!==null?chartSpace.chart.legend.legendPos:c_oAscChartLegendShowSettings.right;switch(nLegendPos){case c_oAscChartLegendShowSettings.left:case c_oAscChartLegendShowSettings.leftOverlay:{leftKey+= fLegendExtX;break}case c_oAscChartLegendShowSettings.top:{topKey+=fLegendExtY;break}case c_oAscChartLegendShowSettings.right:case c_oAscChartLegendShowSettings.rightOverlay:{rightKey+=fLegendExtX;break}case c_oAscChartLegendShowSettings.bottom:{bottomKey+=fLegendExtY;break}case c_oAscChartLegendShowSettings.topRight:{rightKey+=fLegendExtX;break}}}var pieChart=null;var charts=plotArea.charts;for(i=0;i<charts.length;i++){var chartType=this._getChartType(charts[i]);if(c_oChartTypes.Pie===chartType|| c_oChartTypes.DoughnutChart===chartType){pieChart=charts[i];break}}var is3dChart=this._isSwitchCurrent3DChart(chartSpace);if(!is3dChart&&null!==pieChart){left=this._getStandartMargin(left,leftKey,leftTextLabels,0)+leftKey+leftTextLabels;bottom=this._getStandartMargin(bottom,bottomKey,bottomTextLabels,0)+bottomKey+bottomTextLabels;top=this._getStandartMargin(top,topKey,topTextLabels,topMainTitle)+topKey+topTextLabels+topMainTitle;right=this._getStandartMargin(right,rightKey,rightTextLabels,0)+rightKey+ rightTextLabels;var width=chartSpace.extX-left-right;var height=chartSpace.extY-top-bottom;var pieSize=width>height?height:width;left+=(width-pieSize)/2;right+=(width-pieSize)/2;top+=(height-pieSize)/2;bottom+=(height-pieSize)/2}if(null===pieChart||is3dChart){left+=this._getStandartMargin(left,leftKey,leftTextLabels,0)+leftKey+leftTextLabels;bottom+=this._getStandartMargin(bottom,bottomKey,bottomTextLabels,0)+bottomKey+bottomTextLabels;top+=this._getStandartMargin(top,topKey,topTextLabels,topMainTitle)+ topKey+topTextLabels+topMainTitle;right+=this._getStandartMargin(right,rightKey,rightTextLabels,0)+rightKey+rightTextLabels}var pxLeft=calculateLeft?calculateLeft*pxToMM:left*pxToMM;var pxRight=calculateRight?calculateRight*pxToMM:right*pxToMM;var pxTop=calculateTop?calculateTop*pxToMM:top*pxToMM;var pxBottom=calculateBottom?calculateBottom*pxToMM:bottom*pxToMM;if(topMainTitle&&topMainTitle*pxToMM>pxTop)pxTop=(this._getStandartMargin(top,topKey,topTextLabels,topMainTitle)/2+topMainTitle)*pxToMM;if(pieChart&& plotArea.charts.length===1)if(plotArea.layout){var oLayout=plotArea.layout;pxLeft=chartSpace.calculatePosByLayout(pxLeft/pxToMM,oLayout.xMode,oLayout.x,(pxRight-pxLeft)/pxToMM,chartSpace.extX)*pxToMM;pxTop=chartSpace.calculatePosByLayout(pxTop/pxToMM,oLayout.yMode,oLayout.y,(pxBottom-pxTop)/pxToMM,chartSpace.extY)*pxToMM;var fWidthPlotArea=chartSpace.calculateSizeByLayout(pxLeft/pxToMM,chartSpace.extX,oLayout.w,oLayout.wMode);if(fWidthPlotArea>0)pxRight=chartSpace.extX*pxToMM-(pxLeft+fWidthPlotArea* pxToMM);var fHeightPlotArea=chartSpace.calculateSizeByLayout(pxTop/pxToMM,chartSpace.extY,oLayout.h,oLayout.hMode);if(fHeightPlotArea>0)pxBottom=chartSpace.extY*pxToMM-(pxTop+fHeightPlotArea*pxToMM)}if(dNotPutResult)return{left:pxLeft,right:pxRight,top:pxTop,bottom:pxBottom};else{this.calcProp.chartGutter._left=pxLeft;this.calcProp.chartGutter._right=pxRight;this.calcProp.chartGutter._top=pxTop;this.calcProp.chartGutter._bottom=pxBottom}this._checkMargins()},_checkMargins:function(){if(this.calcProp.chartGutter._left< 0)this.calcProp.chartGutter._left=standartMarginForCharts;if(this.calcProp.chartGutter._right<0)this.calcProp.chartGutter._right=standartMarginForCharts;if(this.calcProp.chartGutter._top<0)this.calcProp.chartGutter._top=standartMarginForCharts;if(this.calcProp.chartGutter._bottom<0)this.calcProp.chartGutter._bottom=standartMarginForCharts;if(this.calcProp.chartGutter._left+this.calcProp.chartGutter._right>this.calcProp.widthCanvas)this.calcProp.chartGutter._left=standartMarginForCharts;if(this.calcProp.chartGutter._right> this.calcProp.widthCanvas)this.calcProp.chartGutter._right=standartMarginForCharts;if(this.calcProp.chartGutter._top+this.calcProp.chartGutter._bottom>this.calcProp.heightCanvas)this.calcProp.chartGutter._top=0;if(this.calcProp.chartGutter._bottom>this.calcProp.heightCanvas)this.calcProp.chartGutter._bottom=0},_calculateMarginOnPoints:function(chartSpace){var calculateLeft=0,calculateRight=0,calculateTop=0,calculateBottom=0,diffPoints,curBetween;var pxToMM=this.calcProp.pxToMM;var horizontalAxes= this._getHorizontalAxes(chartSpace);var verticalAxes=this._getVerticalAxes(chartSpace);var horizontalAxis=horizontalAxes?horizontalAxes[0]:null;var verticalAxis=verticalAxes?verticalAxes[0]:null;var crossBetween=null;if(verticalAxis instanceof AscFormat.CValAx)crossBetween=verticalAxis.crossBetween;else if(horizontalAxis instanceof AscFormat.CValAx)crossBetween=horizontalAxis.crossBetween;if(horizontalAxis&&horizontalAxis.xPoints&&horizontalAxis.xPoints.length&&this.calcProp.widthCanvas!=undefined)if(horizontalAxis instanceof AscFormat.CValAx)if(horizontalAxis.scaling.orientation==ORIENTATION_MIN_MAX){calculateLeft=horizontalAxis.xPoints[0].pos;calculateRight=this.calcProp.widthCanvas/pxToMM-horizontalAxis.xPoints[horizontalAxis.xPoints.length-1].pos}else{calculateLeft=horizontalAxis.xPoints[horizontalAxis.xPoints.length-1].pos;calculateRight=this.calcProp.widthCanvas/pxToMM-horizontalAxis.xPoints[0].pos}else if((horizontalAxis instanceof AscFormat.CCatAx||horizontalAxis instanceof AscFormat.CDateAx)&&verticalAxis&&!isNaN(verticalAxis.posX)){diffPoints= horizontalAxis.xPoints[1]?Math.abs(horizontalAxis.xPoints[1].pos-horizontalAxis.xPoints[0].pos):Math.abs(horizontalAxis.xPoints[0].pos-verticalAxis.posX)*2;curBetween=0;if(horizontalAxis.scaling.orientation===ORIENTATION_MIN_MAX){if(crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN)curBetween=diffPoints/2;calculateLeft=horizontalAxis.xPoints[0].pos-curBetween;calculateRight=this.calcProp.widthCanvas/pxToMM-(horizontalAxis.xPoints[horizontalAxis.xPoints.length-1].pos+curBetween)}else{if(crossBetween=== AscFormat.CROSS_BETWEEN_BETWEEN)curBetween=diffPoints/2;calculateLeft=horizontalAxis.xPoints[horizontalAxis.xPoints.length-1].pos-curBetween;calculateRight=this.calcProp.widthCanvas/pxToMM-(horizontalAxis.xPoints[0].pos+curBetween)}}if(verticalAxis&&verticalAxis.yPoints&&verticalAxis.yPoints.length&&this.calcProp.heightCanvas!=undefined)if(verticalAxis instanceof AscFormat.CValAx)if(verticalAxis.scaling.orientation===ORIENTATION_MIN_MAX){calculateTop=verticalAxis.yPoints[verticalAxis.yPoints.length- 1].pos;calculateBottom=this.calcProp.heightCanvas/pxToMM-verticalAxis.yPoints[0].pos}else{calculateTop=verticalAxis.yPoints[0].pos;calculateBottom=this.calcProp.heightCanvas/pxToMM-verticalAxis.yPoints[verticalAxis.yPoints.length-1].pos}else if((verticalAxis instanceof AscFormat.CCatAx||verticalAxis instanceof AscFormat.CDateAx)&&horizontalAxis&&!isNaN(horizontalAxis.posY)){diffPoints=verticalAxis.yPoints[1]?Math.abs(verticalAxis.yPoints[1].pos-verticalAxis.yPoints[0].pos):Math.abs(verticalAxis.yPoints[0].pos- horizontalAxis.posY)*2;curBetween=0;if(verticalAxis.scaling.orientation===ORIENTATION_MIN_MAX){if(crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN)curBetween=diffPoints/2;calculateTop=verticalAxis.yPoints[verticalAxis.yPoints.length-1].pos-curBetween;calculateBottom=this.calcProp.heightCanvas/pxToMM-(verticalAxis.yPoints[0].pos+curBetween)}else{if(crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN)curBetween=diffPoints/2;calculateTop=verticalAxis.yPoints[0].pos-curBetween;calculateBottom=this.calcProp.heightCanvas/ pxToMM-(verticalAxis.yPoints[verticalAxis.yPoints.length-1].pos+curBetween)}}return{calculateLeft:calculateLeft,calculateRight:calculateRight,calculateTop:calculateTop,calculateBottom:calculateBottom}},_getStandartMargin:function(labelsMargin,keyMargin,textMargin,topMainTitleMargin){var defMargin=standartMarginForCharts/this.calcProp.pxToMM;var result;if(labelsMargin==0&&keyMargin==0&&textMargin==0&&topMainTitleMargin==0)result=defMargin;else if(labelsMargin!=0&&keyMargin==0&&textMargin==0&&topMainTitleMargin== 0)result=defMargin/2;else if(labelsMargin!=0&&keyMargin==0&&textMargin!=0&&topMainTitleMargin==0)result=defMargin;else if(labelsMargin!=0&&keyMargin!=0&&textMargin!=0&&topMainTitleMargin==0)result=defMargin+defMargin/2;else if(labelsMargin==0&&keyMargin!=0&&textMargin==0&&topMainTitleMargin==0)result=defMargin;else if(labelsMargin==0&&keyMargin==0&&textMargin!=0&&topMainTitleMargin==0)result=defMargin;else if(labelsMargin==0&&keyMargin!=0&&textMargin!=0&&topMainTitleMargin==0)result=defMargin+defMargin/ 2;else if(labelsMargin!=0&&keyMargin!=0&&textMargin==0&&topMainTitleMargin==0)result=defMargin;else if(labelsMargin==0&&keyMargin!=0&&textMargin!=0&&topMainTitleMargin==0)result=defMargin+defMargin/2;else if(labelsMargin==0&&keyMargin==0&&topMainTitleMargin!=0)result=defMargin+defMargin/2;else if(labelsMargin==0&&keyMargin!=0&&topMainTitleMargin!=0)result=2*defMargin;else if(labelsMargin!=0&&keyMargin==0&&topMainTitleMargin!=0)result=defMargin;else if(labelsMargin!=0&&keyMargin!=0&&topMainTitleMargin!= 0)result=2*defMargin;return result},_calculateMarginLabels:function(chartSpace){var left=0,right=0,bottom=0,top=0;var leftDownPointX,leftDownPointY,rightUpPointX,rightUpPointY;var crossBetween=chartSpace.getValAxisCrossType();var horizontalAxes=this._getHorizontalAxes(chartSpace);var verticalAxes=this._getVerticalAxes(chartSpace);var horizontalAxis=horizontalAxes?horizontalAxes[0]:null;var verticalAxis=verticalAxes?verticalAxes[0]:null;var diffPoints;if(horizontalAxis&&horizontalAxis.xPoints&&horizontalAxis.xPoints.length){var orientationHorAxis= horizontalAxis.scaling.orientation===ORIENTATION_MIN_MAX;diffPoints=0;if((horizontalAxis instanceof AscFormat.CDateAx||horizontalAxis instanceof AscFormat.CCatAx)&&crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN)diffPoints=Math.abs(horizontalAxis.interval/2);if(orientationHorAxis){leftDownPointX=horizontalAxis.xPoints[0].pos-diffPoints;rightUpPointX=horizontalAxis.xPoints[horizontalAxis.xPoints.length-1].pos+diffPoints}else{leftDownPointX=horizontalAxis.xPoints[horizontalAxis.xPoints.length-1].pos- diffPoints;rightUpPointX=horizontalAxis.xPoints[0].pos+diffPoints}if(verticalAxis.labels&&!verticalAxis.bDelete)if(leftDownPointX>=verticalAxis.labels.x)left=leftDownPointX-verticalAxis.labels.x;else if(verticalAxis.labels.x+verticalAxis.labels.extX>=rightUpPointX)right=verticalAxis.labels.x+verticalAxis.labels.extX-rightUpPointX}if(verticalAxis&&verticalAxis.yPoints&&verticalAxis.yPoints.length){var orientationVerAxis=verticalAxis.scaling.orientation===ORIENTATION_MIN_MAX;diffPoints=0;if((verticalAxis instanceof AscFormat.CDateAx||verticalAxis instanceof AscFormat.CCatAx)&&crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN)diffPoints=Math.abs(verticalAxis.interval/2);if(orientationVerAxis){leftDownPointY=verticalAxis.yPoints[0].pos+diffPoints;rightUpPointY=verticalAxis.yPoints[verticalAxis.yPoints.length-1].pos-diffPoints}else{leftDownPointY=verticalAxis.yPoints[verticalAxis.yPoints.length-1].pos+diffPoints;rightUpPointY=verticalAxis.yPoints[0].pos-diffPoints}if(horizontalAxis.labels&&!horizontalAxis.bDelete)if(horizontalAxis.labels.y+ horizontalAxis.labels.extY>=leftDownPointY)bottom=horizontalAxis.labels.y+horizontalAxis.labels.extY-leftDownPointY;else if(horizontalAxis.labels.y<=rightUpPointY)top=rightUpPointY-horizontalAxis.labels.y}return{left:left,right:right,top:top,bottom:bottom}},_getHorizontalAxes:function(chartSpace){var res=null;var axId=chartSpace.chart.plotArea.axId;for(var i=0;i<axId.length;i++){var axis=chartSpace.chart.plotArea.axId[i];if(axis.axPos===window["AscFormat"].AX_POS_B||axis.axPos===window["AscFormat"].AX_POS_T){if(!res)res= [];res.push(axis)}}return res},_getVerticalAxes:function(chartSpace){var res=null;var axId=chartSpace.chart.plotArea.axId;for(var i=0;i<axId.length;i++){var axis=chartSpace.chart.plotArea.axId[i];if(axis.axPos===window["AscFormat"].AX_POS_R||axis.axPos===window["AscFormat"].AX_POS_L){if(!res)res=[];res.push(axis)}}return res},_calculateProperties:function(chartSpace){if(!this.calcProp.scale)this.preCalculateData(chartSpace);this._calculateMarginsChart(chartSpace);this.calcProp.trueWidth=this.calcProp.widthCanvas- this.calcProp.chartGutter._left-this.calcProp.chartGutter._right;this.calcProp.trueHeight=this.calcProp.heightCanvas-this.calcProp.chartGutter._top-this.calcProp.chartGutter._bottom},_calculateStackedData2:function(data,chart){if(!data)return;var maxMinObj;var grouping=this.getChartGrouping(chart);var chartType=this._getChartType(chart);var t=this;var calculateStacked=function(sum){if(c_oChartTypes.HBar===chartType||c_oChartTypes.Bar===chartType){var originalData=$.extend(true,[],data);for(var j= 0;j<data.length;j++)for(var i=0;i<data[j].length;i++)data[j][i]=t._findPrevValue(originalData,j,i);if(sum)for(var j=0;j<data.length;j++)for(var i=0;i<data[j].length;i++)data[j][i]=data[j][i]/sum[j]}else{for(var j=0;j<data.length-1;j++)for(var i=0;i<data[j].length;i++){if(!data[j+1])data[j+1]=[];data[j+1][i]=data[j+1][i]+data[j][i]}if(sum&&data[0])for(var j=0;j<data[0].length;j++)for(var i=0;i<data.length;i++)if(sum[j]==0)data[i][j]=0;else data[i][j]=data[i][j]/sum[j]}};var calculateSum=function(){var res= [];if(c_oChartTypes.HBar===chartType||c_oChartTypes.Bar===chartType)for(var j=0;j<data.length;j++){res[j]=0;for(var i=0;i<data[j].length;i++)res[j]+=Math.abs(data[j][i])}else if(data[0])for(var j=0;j<data[0].length;j++){res[j]=0;for(var i=0;i<data.length;i++)res[j]+=Math.abs(data[i][j])}return res};if(grouping==="stacked")calculateStacked();else if(grouping==="stackedPer")calculateStacked(calculateSum());maxMinObj=this._getMaxMinValueArray(data);return maxMinObj},_calculateExtremumAllCharts:function(chartSpace, isFirstChart){var t=this,isStackedType;var plotArea=chartSpace.chart.plotArea;var charts=plotArea.charts;if(!charts||isFirstChart)charts=[plotArea.chart];var getMinMaxCurCharts=function(axisCharts,axis){isStackedType=false;for(var i=0;i<axisCharts.length;i++){grouping=t.getChartGrouping(axisCharts[i]);if("stackedPer"===grouping){isStackedType=true;break}}var minMaxData,min,max,chart,grouping;for(var i=0;i<axisCharts.length;i++){chart=axisCharts[i];grouping=t.getChartGrouping(chart);minMaxData=t._calculateData2(chart, grouping,axis);if(AscDFH.historyitem_type_ScatterChart===chart.getObjectType())if(axis.axPos===window["AscFormat"].AX_POS_B||axis.axPos===window["AscFormat"].AX_POS_T){if(i==0||minMaxData.min<min)min=minMaxData.min;if(i==0||minMaxData.max>max)max=minMaxData.max}else{if(i==0||minMaxData.ymin<min)min=minMaxData.ymin;if(i==0||minMaxData.ymax>max)max=minMaxData.ymax}else{if(i==0||minMaxData.min<min)min=minMaxData.min;if(i==0||minMaxData.max>max)max=minMaxData.max}}return{min:min,max:max}};for(var j=0;j< plotArea.axId.length;j++){var axObj=plotArea.axId[j];var axisCharts=this._getChartsByAxisId(charts,axObj.axId);var minMaxAxis=getMinMaxCurCharts(axisCharts,axObj);axObj.min=minMaxAxis.min;axObj.max=minMaxAxis.max;axObj.scale=this._roundValues(this._getAxisValues2(axObj,chartSpace,isStackedType));if(isStackedType){if(axObj.scale[0]!==0&&axObj.min===axObj.scale[1])axObj.scale.splice(0,1);if(axObj.max===axObj.scale[axObj.scale.length-2])axObj.scale.splice(axObj.scale.length-1,1)}}},_getChartsByAxisId:function(charts, id){var res=[];for(var i=0;i<charts.length;i++){if(!charts[i].axId)continue;for(var j=0;j<charts[i].axId.length;j++)if(id===this._searchChangedAxisId(charts[i].axId[j].axId)){res.push(charts[i]);break}}return res},_searchChangedAxisId:function(id){var res=id;if(this.changeAxisMap&&this.changeAxisMap[id])res=this.changeAxisMap[id];return res},_searchChangedAxis:function(axis){var res=axis;if(this.changeAxisMap&&axis.axId&&this.changeAxisMap[axis.axId]){var newId=this.changeAxisMap[axis.axId];var newAxis= this._searchAxisById(newId);if(null!==newAxis)res=newAxis}return res},_searchAxisById:function(id,chartSpace){var res=null;chartSpace=chartSpace||this.cChartSpace;if(chartSpace){var axId=chartSpace.chart.plotArea.axId;for(var i=0;i<axId.length;i++)if(id===axId[i].axId){res=axId[i];break}}return res},_calculateChangeAxisMap:function(chartSpace){this.changeAxisMap={};var axId=chartSpace.chart.plotArea.axId;var searchNeedAxis=function(excludeAxis){var res=null;var needPos=excludeAxis.axPos===window["AscFormat"].AX_POS_L|| excludeAxis.axPos===window["AscFormat"].AX_POS_R;for(var j=0;j<axId.length;j++){var curAxis=axId[j];var curPos=curAxis.axPos===window["AscFormat"].AX_POS_L||curAxis.axPos===window["AscFormat"].AX_POS_R;if(excludeAxis.axId!==axId[j].axId&&needPos===curPos)if(excludeAxis.getObjectType()===curAxis.getObjectType()){res=curAxis;break}}return res};if(axId)for(var i=0;i<axId.length;i++)if(axId[i].bDelete&&AscDFH.historyitem_type_ValAx===axId[i].getObjectType()){var needAxis=searchNeedAxis(axId[i]);if(needAxis)this.changeAxisMap[axId[i].axId]= needAxis.axId}},_calculateData2:function(chart,grouping,axis){var xNumCache,yNumCache,newArr,arrValues=[],max=0,min=0,minY=0,maxY=0;var series=chart.series;var chartType=this._getChartType(chart);var t=this;var bFirst=true;var addValues=function(tempValX,tempValY){if(bFirst){min=tempValX;max=tempValX;minY=tempValY;maxY=tempValY;bFirst=false}if(tempValX<min)min=tempValX;if(tempValX>max)max=tempValX;if(tempValY<minY)minY=tempValY;if(tempValY>maxY)maxY=tempValY};var generateArrValues=function(){var seria, numCache,pts;if(AscDFH.historyitem_type_ValAx===axis.getObjectType()){var isEn=false,numSeries=0;for(var l=0;l<series.length;l++){seria=series[l];numCache=t.getNumCache(seria.val);pts=numCache?numCache.pts:null;if(!pts||!pts.length||seria.isHidden===true)continue;var n=0;arrValues[numSeries]=[];for(var col=0;col<numCache.ptCount;col++){var curPoint=numCache.pts[col];if(!curPoint&&(t.calcProp.subType==="stackedPer"||t.calcProp.subType==="stacked"))curPoint={val:0};else if(!curPoint||curPoint.isHidden=== true)continue;var val=curPoint.val;var value=parseFloat(val);if(!isEn&&!isNaN(value)){min=value;max=value;isEn=true}if(!isNaN(value)&&value>max)max=value;if(!isNaN(value)&&value<min)min=value;if(isNaN(value)&&val==""&&(chartType===c_oChartTypes.Line&&grouping==="normal"))value="";else if(isNaN(value))value=0;if(chartType===c_oChartTypes.Pie||chartType===c_oChartTypes.DoughnutChart)value=Math.abs(value);arrValues[numSeries][n]=value;n++}numSeries++}if(min===max)if(min<0)max=0;else min=0}else if(series.length> 0){seria=series[0];numCache=t.getNumCache(seria.val);min=1;if(numCache)max=numCache.ptCount;else max=1}};var generateArrValuesScatter=function(){newArr=[];for(var l=0;l<series.length;++l){newArr[l]=[];yNumCache=t.getNumCache(series[l].yVal);if(!yNumCache)continue;for(var j=0;j<yNumCache.ptCount;++j){var val=t._getScatterPointVal(series[l],j);if(val){addValues(val.x,val.y);newArr[l][j]=[val.x,val.y]}}}};if(chartType!==c_oChartTypes.Scatter)generateArrValues();else generateArrValuesScatter();if(chartType=== c_oChartTypes.Bar||chartType===c_oChartTypes.HBar)arrValues=arrReverse(arrValues);if(AscDFH.historyitem_type_ValAx===axis.getObjectType()&&("stackedPer"===grouping||"stacked"===grouping)){if(newArr)arrValues=newArr;var stackedExtremum=this._calculateStackedData2(arrValues,chart);if(stackedExtremum){min=stackedExtremum.min;max=stackedExtremum.max}}return{min:min,max:max,ymin:minY,ymax:maxY}},_getScatterPointVal:function(seria,idx){var yNumCache=this.getNumCache(seria.yVal);if(!yNumCache)return null; var xNumCache=seria.xVal?this.getNumCache(seria.xVal):null;var yPoint,xPoint,xVal,yVal;var res=null;if(yNumCache&&xNumCache){yPoint=yNumCache.getPtByIndex(idx);xPoint=xNumCache.getPtByIndex(idx);if(xPoint){yVal=yPoint?parseFloat(yPoint.val):0;xVal=parseFloat(xPoint.val);res={x:xVal,y:yVal}}}else if(yNumCache){yPoint=yNumCache.getPtByIndex(idx);var dispBlanksAs=this.cChartSpace.chart.dispBlanksAs;if(yPoint)yVal=parseFloat(yPoint.val);else if(dispBlanksAs===AscFormat.DISP_BLANKS_AS_ZERO)yVal=0;else yVal= null;xVal=idx+1;res={x:xVal,y:yVal,xPoint:xPoint,yPoint:yPoint}}return res},_getAxisValues2:function(axis,chartSpace,isStackedType){var arrayValues;if(AscDFH.historyitem_type_CatAx===axis.getObjectType()||AscDFH.historyitem_type_DateAx===axis.getObjectType()){arrayValues=[];var max=axis.max;for(var i=axis.min;i<=max;i++)arrayValues.push(i);return arrayValues}var axisMin,axisMax,firstDegree,step;var yMin=axis.min;var yMax=axis.max;var logBase=axis.scaling&&axis.scaling.logBase;var manualMin=axis.scaling&& axis.scaling.min!==null?axis.scaling.min:null;var manualMax=axis.scaling&&axis.scaling.max!==null?axis.scaling.max:null;if(logBase){arrayValues=this._getLogArray(yMin,yMax,logBase,axis);return arrayValues}var trueMinMax=this._getTrueMinMax(yMin,yMax,isStackedType);if(manualMax&&manualMin&&manualMax<manualMin)if(manualMax<0)manualMax=0;else manualMin=0;axisMin=manualMin!==null&&manualMin!==undefined?manualMin:trueMinMax.min;axisMax=manualMax!==null&&manualMax!==undefined?manualMax:trueMinMax.max;if(axisMax< axisMin)if(axisMax>0){manualMax=2*axisMin;axisMax=manualMax}else axisMin=2*axisMax;firstDegree=this._getFirstDegree(Math.abs(axisMax-axisMin)/10);var bIsManualStep=false;if(axis&&axis.majorUnit!=null){step=axis.majorUnit;bIsManualStep=true}else{if(axis.axPos===window["AscFormat"].AX_POS_B||axis.axPos===window["AscFormat"].AX_POS_T)step=this._getStep(firstDegree.val+firstDegree.val/10*3);else step=this._getStep(firstDegree.val);step=step*firstDegree.numPow}if(isNaN(step)||step===0)arrayValues=[0,.2, .4,.6,.8,1,1.2];else arrayValues=this._getArrayDataValues(step,axisMin,axisMax,manualMin,manualMax);if(!bIsManualStep&&!chartSpace.isSparkline){var props={arrayValues:arrayValues,step:step,axisMin:axisMin,axisMax:axisMax,manualMin:manualMin,manualMax:manualMax};arrayValues=this._correctDataValuesFromHeight(props,chartSpace)}if(this._isSwitchCurrent3DChart(chartSpace))if(yMax>0&&yMin<0){if(manualMax==null&&yMax<=arrayValues[arrayValues.length-2])arrayValues.splice(arrayValues.length-1,1);if(manualMin== null&&yMin>=arrayValues[1])arrayValues.splice(0,1)}else if(yMax>0&&yMin>=0){if(manualMax==null&&yMax<=arrayValues[arrayValues.length-2])arrayValues.splice(arrayValues.length-1,1)}else if(yMin<0&&yMax<=0)if(manualMin==null&&yMin>=arrayValues[1])arrayValues.splice(0,1);return arrayValues},_correctDataValuesFromHeight:function(props,chartSpace,isOxAxis){var res=props.arrayValues;var heightCanvas=chartSpace.extY*this.calcProp.pxToMM;var margins=this._calculateMarginsChart(chartSpace,true);var trueHeight= heightCanvas-margins.top-margins.bottom;var axisMin=props.axisMin;var axisMax=props.axisMax;var manualMin=props.manualMin;var manualMax=props.manualMax;var newStep=props.step;if(isOxAxis);else if(axisMin<0&&axisMax>0);else{var limitArr=[0,0,32,26,24,22,21,19,18,17,16];var limit=limitArr[res.length-1];var heightGrid=Math.round(trueHeight/(res.length-1));while(heightGrid<=limit){var firstDegreeStep=this._getFirstDegree(newStep);var tempStep=this._getNextStep(firstDegreeStep.val);newStep=tempStep*firstDegreeStep.numPow; res=this._getArrayDataValues(newStep,axisMin,axisMax,manualMin,manualMax);if(res.length<=2)break;limit=limitArr[res.length-1];heightGrid=Math.round(trueHeight/(res.length-1))}}return res},_getNextStep:function(step){if(step===1)step=2;else if(step===2)step=5;else if(step===5)step=10;return step},_getArrayDataValues:function(step,axisMin,axisMax,manualMin,manualMax){var arrayValues;var minUnit=0;if(manualMin!=null)minUnit=manualMin;else if(manualMin==null&&axisMin!=null&&axisMin!=0&&axisMin>0&&axisMax> 0)minUnit=parseInt(axisMin/step)*step;else if(axisMin<0)while(minUnit>axisMin)minUnit-=step;else if(axisMin>0)while(minUnit<axisMin&&minUnit>axisMin-step)minUnit+=step;arrayValues=this._getArrayAxisValues(minUnit,axisMin,axisMax,step,manualMin,manualMax);return arrayValues},_getLogArray:function(yMin,yMax,logBase,axis){var result=[];var temp;var pow=0;var tempPow=yMin;var kF=1E9;var manualMin=axis.scaling&&axis.scaling.min!==null?Math.round(axis.scaling.min*kF)/kF:null;var manualMax=axis.scaling&& axis.scaling.max!==null?Math.round(axis.scaling.max*kF)/kF:null;if(manualMin!==null)yMin=manualMin;if(yMin<1&&yMin>0){temp=this._getFirstDegree(yMin).numPow;tempPow=temp;while(tempPow<1){pow--;tempPow=tempPow*10}}else temp=Math.pow(logBase,0);if(logBase<1)logBase=2;var step=0;var lMax=1;if(yMin<1&&yMin>0){if(lMax<yMax)lMax=yMax;if(manualMax!==null&&manualMax>lMax)lMax=manualMax;while(temp<lMax){temp=Math.pow(logBase,pow);if(manualMin!==null&&manualMin>temp){pow++;continue}if(manualMax!==null&&manualMax< temp)break;result[step]=temp;pow++;step++}}else{if(manualMax!==null&&manualMax>yMax)yMax=manualMax;while(temp<=yMax){temp=Math.pow(logBase,pow);if(manualMin!==null&&manualMin>temp){pow++;continue}if(manualMax!==null&&manualMax<temp)break;result[step]=temp;pow++;step++}}return result},_getArrayAxisValues:function(minUnit,axisMin,axisMax,step,manualMin,manualMax){var arrayValues=[];var stackedPerMax=null!==manualMax?manualMax:100;if(this.calcProp.subType==="stackedPer"&&step>stackedPerMax)stackedPerMax= step;var maxPointsCount=40;for(var i=0;i<maxPointsCount;i++){if(this.calcProp.subType==="stackedPer"&&minUnit+step*i>stackedPerMax)break;arrayValues[i]=minUnit+step*i;if(axisMax==0&&axisMin<0&&arrayValues[i]==axisMax)break;else if(manualMax!=null&&arrayValues[i]>=axisMax||manualMax==null&&arrayValues[i]>axisMax){if(this.calcProp.subType==="stackedPer")arrayValues[i]=arrayValues[i];break}else if(this.calcProp.subType==="stackedPer")arrayValues[i]=arrayValues[i]}if(!arrayValues.length)arrayValues=[.2, .4,.6,.8,1,1.2];return arrayValues},_getStep:function(step){if(step>1&&step<=2)step=2;else if(step>2&&step<=5)step=5;else if(step>5&&step<=10)step=10;else if(step>10&&step<=20)step=20;return step},_getTrueMinMax:function(yMin,yMax,isStackedType){var axisMax,axisMin,diffMaxMin;var cDiff=1/6;if(yMin>=0&&yMax>=0){diffMaxMin=(yMax-yMin)/yMax;if(cDiff>diffMaxMin){axisMin=yMin-(yMax-yMin)/2;axisMax=isStackedType?yMax:yMax+.05*(yMax-yMin)}else{axisMin=0;axisMax=isStackedType?yMax:yMax+.05*(yMax-0)}}else if(yMin<= 0&&yMax<=0){diffMaxMin=(yMin-yMax)/yMin;axisMin=isStackedType?yMin:yMin+.05*(yMin-yMax);if(cDiff<diffMaxMin)axisMax=0;else axisMax=yMax-(yMin-yMax)/2}else if(yMax>0&&yMin<0){axisMax=isStackedType?yMax:yMax+.05*(yMax-yMin);axisMin=isStackedType?yMin:yMin+.05*(yMin-yMax)}if(axisMin===axisMax)if(axisMin<0)axisMax=0;else axisMin=0;return{min:axisMin,max:axisMax}},preCalculateData:function(chartSpace){this._calculateChangeAxisMap(chartSpace);this.cChartSpace=chartSpace;this.calcProp.pxToMM=1/AscCommon.g_dKoef_pix_to_mm; this.calcProp.pathH=1E9;this.calcProp.pathW=1E9;this.calcProp.type=this._getChartType(chartSpace.chart.plotArea.chart);this.calcProp.subType=this.getChartGrouping(chartSpace.chart.plotArea.chart);this.calcProp.xaxispos=null;this.calcProp.yaxispos=null;this._calculateExtremumAllCharts(chartSpace);this.calcProp.series=chartSpace.chart.plotArea.chart.series;var countSeries=this.calculateCountSeries(chartSpace.chart.plotArea.chart);this.calcProp.seriesCount=countSeries.series;this.calcProp.ptCount=countSeries.points; this.calcProp.widthCanvas=chartSpace.extX*this.calcProp.pxToMM;this.calcProp.heightCanvas=chartSpace.extY*this.calcProp.pxToMM},_getChartType:function(chart){var res;var typeChart=chart.getObjectType();switch(typeChart){case AscDFH.historyitem_type_LineChart:{res=c_oChartTypes.Line;break}case AscDFH.historyitem_type_BarChart:{if(chart.barDir!==AscFormat.BAR_DIR_BAR)res=c_oChartTypes.Bar;else res=c_oChartTypes.HBar;break}case AscDFH.historyitem_type_PieChart:{res=c_oChartTypes.Pie;break}case AscDFH.historyitem_type_AreaChart:{res= c_oChartTypes.Area;break}case AscDFH.historyitem_type_ScatterChart:{res=c_oChartTypes.Scatter;break}case AscDFH.historyitem_type_StockChart:{res=c_oChartTypes.Stock;break}case AscDFH.historyitem_type_DoughnutChart:{res=c_oChartTypes.DoughnutChart;break}case AscDFH.historyitem_type_RadarChart:{res=c_oChartTypes.Radar;break}case AscDFH.historyitem_type_BubbleChart:{res=c_oChartTypes.BubbleChart;break}case AscDFH.historyitem_type_SurfaceChart:{res=c_oChartTypes.Surface;break}}return res},getChartGrouping:function(chart){var res= null;var grouping=chart.grouping;var typeChart=chart.getObjectType();if(typeChart===AscDFH.historyitem_type_LineChart||typeChart===AscDFH.historyitem_type_AreaChart)res=grouping===AscFormat.GROUPING_PERCENT_STACKED?"stackedPer":grouping===AscFormat.GROUPING_STACKED?"stacked":"normal";else if(this.nDimensionCount===3&&grouping===AscFormat.BAR_GROUPING_STANDARD)res="standard";else res=grouping===AscFormat.BAR_GROUPING_PERCENT_STACKED?"stackedPer":grouping===AscFormat.BAR_GROUPING_STACKED?"stacked": "normal";return res},calculateSizePlotArea:function(chartSpace,bNotRecalculate){if(!bNotRecalculate||undefined===this.calcProp.chartGutter)this._calculateMarginsChart(chartSpace);var widthCanvas=chartSpace.extX;var heightCanvas=chartSpace.extY;var w=widthCanvas-(this.calcProp.chartGutter._left+this.calcProp.chartGutter._right)/this.calcProp.pxToMM;var h=heightCanvas-(this.calcProp.chartGutter._top+this.calcProp.chartGutter._bottom)/this.calcProp.pxToMM;return{w:w,h:h,startX:this.calcProp.chartGutter._left/ this.calcProp.pxToMM,startY:this.calcProp.chartGutter._top/this.calcProp.pxToMM}},drawPaths:function(paths,series,useNextPoint,bIsYVal,byIdx){var seria,brush,pen,numCache,point;var seriesPaths=paths.series;var pointDiff=useNextPoint?1:0;if(!seriesPaths)return;var getSerByIdx=function(_idx){for(var k=0;k<series.length;k++)if(series[k]&&series[k].idx===_idx)return series[k];return null};for(var i=0;i<seriesPaths.length;i++){if(!seriesPaths[i])continue;if(byIdx)seria=getSerByIdx(i);else seria=series[i]; if(!seria)continue;brush=seria.brush;pen=seria.pen;for(var j=0;j<seriesPaths[i].length;j++){if(bIsYVal)numCache=this.getNumCache(seria.yVal);else numCache=this.getNumCache(seria.val);if(numCache){if(byIdx)point=numCache.getPtByIndex(j+pointDiff);else point=numCache.pts[j+pointDiff];if(point&&point.pen)pen=point.pen;if(point&&point.brush)brush=point.brush}if(seriesPaths[i][j])this.drawPath(seriesPaths[i][j],pen,brush)}}},drawPathsPoints:function(paths,series,bIsYVal){var seria,brush,pen,dataSeries, markerBrush,markerPen,numCache;if(!paths.series)return;for(var i=0;i<paths.series.length;i++){seria=series[i];brush=seria.brush;pen=seria.pen;if(bIsYVal)numCache=this.getNumCache(seria.yVal);else numCache=this.getNumCache(seria.val);dataSeries=paths.series[i];if(!dataSeries)continue;for(var k=0;k<paths.points[i].length;k++){var numPoint=numCache?numCache.getPtByIndex(k):null;if(numPoint){markerBrush=numPoint.compiledMarker?numPoint.compiledMarker.brush:null;markerPen=numPoint.compiledMarker?numPoint.compiledMarker.pen: null}if(paths.points[i][k]&&paths.points[i][k].framePaths)this.drawPath(paths.points[i][k].framePaths,null,markerBrush,false);if(paths.points[i][k])this.drawPath(paths.points[i][k].path,markerPen,markerBrush,true)}}},drawPathsByIdx:function(paths,series,useNextPoint,bIsYVal){var seria,brush,pen,numCache,point;var seriesPaths=paths.series;if(!seriesPaths)return;for(var i=0;i<seriesPaths.length;i++){if(!seriesPaths[i])continue;seria=series[i];brush=seria.brush;pen=seria.pen;for(var j=0;j<seriesPaths[i].length;j++){if(bIsYVal)numCache= this.getNumCache(seria.yVal);else numCache=this.getNumCache(seria.val);var idx=seriesPaths[i][j].idx;if(numCache)if(useNextPoint){idx=seriesPaths[i][j+1]?seriesPaths[i][j+1].idx:seriesPaths[i][j].idx;point=numCache.getPtByIndex(idx)}else point=numCache.getPtByIndex(idx);if(point&&point.pen)pen=point.pen;if(point&&point.brush)brush=point.brush;if(seriesPaths[i][j])this.drawPath(seriesPaths[i][j].path,pen,brush)}}},drawPath:function(path,pen,brush){if(!AscFormat.isRealNumber(path))return;var oPath= this.cChartSpace.GetPath(path);if(!oPath)return;if(pen)oPath.stroke=true;var cGeometry=new CGeometry2;this.cShapeDrawer.Clear();cGeometry.AddPath(oPath);this.cShapeDrawer.fromShape2(new CColorObj(pen,brush,cGeometry),this.cShapeDrawer.Graphics,cGeometry);this.cShapeDrawer.draw(cGeometry)},calculatePoint:function(x,y,size,symbol){size=size/2.69;var halfSize=size/2;var dashDotHeight=size/5;var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.calcProp.pathH; var pathW=this.calcProp.pathW;var framePaths=null,framePathsId=null;path.moveTo(x*pathW,y*pathW);switch(symbol){case AscFormat.SYMBOL_DASH:{path.moveTo((x-halfSize)*pathW,(y-dashDotHeight/2)*pathW);path.lnTo((x+halfSize)*pathW,(y-dashDotHeight/2)*pathW);path.lnTo((x+halfSize)*pathW,(y+dashDotHeight/2)*pathW);path.lnTo((x-halfSize)*pathW,(y+dashDotHeight/2)*pathW);break}case AscFormat.SYMBOL_DOT:{path.moveTo(x*pathW,(y-dashDotHeight/2)*pathW);path.lnTo((x+halfSize)*pathW,(y-dashDotHeight/2)*pathW); path.lnTo((x+halfSize)*pathW,(y+dashDotHeight/2)*pathW);path.lnTo(x*pathW,(y+dashDotHeight/2)*pathW);break}case AscFormat.SYMBOL_PLUS:{path.moveTo(x*pathW,(y+halfSize)*pathW);path.lnTo(x*pathW,(y-halfSize)*pathW);path.moveTo((x-halfSize)*pathW,y*pathW);path.lnTo((x+halfSize)*pathW,y*pathW);break}case AscFormat.SYMBOL_CIRCLE:{path.moveTo((x+halfSize)*pathW,y*pathW);path.arcTo(halfSize*pathW,halfSize*pathW,0,Math.PI*2*cToDeg);break}case AscFormat.SYMBOL_STAR:{path.moveTo((x-halfSize)*pathW,(y+halfSize)* pathW);path.lnTo((x+halfSize)*pathW,(y-halfSize)*pathW);path.moveTo((x+halfSize)*pathW,(y+halfSize)*pathW);path.lnTo((x-halfSize)*pathW,(y-halfSize)*pathW);path.moveTo(x*pathW,(y+halfSize)*pathW);path.lnTo(x*pathW,(y-halfSize)*pathW);break}case AscFormat.SYMBOL_X:{path.moveTo((x-halfSize)*pathW,(y+halfSize)*pathW);path.lnTo((x+halfSize)*pathW,(y-halfSize)*pathW);path.moveTo((x+halfSize)*pathW,(y+halfSize)*pathW);path.lnTo((x-halfSize)*pathW,(y-halfSize)*pathW);break}case AscFormat.SYMBOL_TRIANGLE:{path.moveTo((x- size/Math.sqrt(3))*pathW,(y+size/3)*pathW);path.lnTo(x*pathW,(y-2/3*size)*pathW);path.lnTo((x+size/Math.sqrt(3))*pathW,(y+size/3)*pathW);path.lnTo((x-size/Math.sqrt(3))*pathW,(y+size/3)*pathW);break}case AscFormat.SYMBOL_SQUARE:{path.moveTo((x-halfSize)*pathW,(y+halfSize)*pathW);path.lnTo((x-halfSize)*pathW,(y-halfSize)*pathW);path.lnTo((x+halfSize)*pathW,(y-halfSize)*pathW);path.lnTo((x+halfSize)*pathW,(y+halfSize)*pathW);path.lnTo((x-halfSize)*pathW,(y+halfSize)*pathW);break}case AscFormat.SYMBOL_DIAMOND:{path.moveTo((x- halfSize)*pathW,y*pathW);path.lnTo(x*pathW,(y-halfSize)*pathW);path.lnTo((x+halfSize)*pathW,y*pathW);path.lnTo(x*pathW,(y+halfSize)*pathW);path.lnTo((x-halfSize)*pathW,y*pathW);break}}if(symbol===AscFormat.SYMBOL_PLUS||symbol===AscFormat.SYMBOL_STAR||symbol===AscFormat.SYMBOL_X){framePathsId=this.cChartSpace.AllocPath();framePaths=this.cChartSpace.GetPath(framePathsId);framePaths.moveTo((x-halfSize)*pathW,(y+halfSize)*pathW);framePaths.lnTo((x-halfSize)*pathW,(y-halfSize)*pathW);framePaths.lnTo((x+ halfSize)*pathW,(y-halfSize)*pathW);framePaths.lnTo((x+halfSize)*pathW,(y+halfSize)*pathW);framePaths.lnTo((x-halfSize)*pathW,(y+halfSize)*pathW)}return{framePaths:framePathsId,path:pathId}},getYPosition:function(val,axis,ignoreAxisLimits){var yPoints=axis.yPoints?axis.yPoints:axis.xPoints;var isOx=axis.axPos===window["AscFormat"].AX_POS_T||axis.axPos===window["AscFormat"].AX_POS_B;var logBase=axis.scaling.logBase;if(logBase)return this._getYPositionLogBase(val,yPoints,isOx,logBase);var result,resPos, resVal,diffVal;var plotArea=this.cChartSpace.chart.plotArea;if(!yPoints[1]&&val===yPoints[0].val)result=yPoints[0].pos;else if(val<yPoints[0].val){resPos=Math.abs(yPoints[1].pos-yPoints[0].pos);resVal=yPoints[1].val-yPoints[0].val;diffVal=Math.abs(yPoints[0].val)-Math.abs(val);if(isOx)result=yPoints[0].pos-Math.abs(diffVal/resVal*resPos);else result=yPoints[0].pos+Math.abs(diffVal/resVal*resPos);if(!ignoreAxisLimits&&(result>yPoints[yPoints.length-1].pos||result<yPoints[0].pos))result=yPoints[0].pos}else if(val> yPoints[yPoints.length-1].val){var test=yPoints[1]?yPoints[1]:yPoints[0];resPos=Math.abs(test.pos-yPoints[0].pos);resVal=test.val-yPoints[0].val;diffVal=Math.abs(yPoints[yPoints.length-1].val-val);if(axis.scaling.orientation===ORIENTATION_MIN_MAX)if(isOx)result=yPoints[yPoints.length-1].pos+diffVal/resVal*resPos;else result=yPoints[yPoints.length-1].pos-diffVal/resVal*resPos;else if(isOx)result=yPoints[yPoints.length-1].pos-diffVal/resVal*resPos;else result=yPoints[yPoints.length-1].pos+diffVal/resVal* resPos;if(!ignoreAxisLimits&&(result>yPoints[yPoints.length-1].pos||result<yPoints[0].pos))result=yPoints[yPoints.length-1].pos}else{var getResult=function(index){resPos=Math.abs(yPoints[index+1].pos-yPoints[index].pos);resVal=yPoints[index+1].val-yPoints[index].val;if(resVal===0)resVal=1;var res;var startPos=yPoints[index].pos;if(!isOx)if(axis.scaling.orientation===ORIENTATION_MIN_MAX)res=-(resPos/resVal)*Math.abs(val-yPoints[index].val)+startPos;else res=resPos/resVal*Math.abs(val-yPoints[index].val)+ startPos;else if(axis.scaling.orientation!==ORIENTATION_MIN_MAX)res=-(resPos/resVal)*Math.abs(val-yPoints[index].val)+startPos;else res=resPos/resVal*Math.abs(val-yPoints[index].val)+startPos;return res};var i=0,j=yPoints.length-1,k;while(i<=j){k=Math.floor((i+j)/2);if(val>=yPoints[k].val&&yPoints[k+1]&&val<=yPoints[k+1].val){result=getResult(k);break}else if(val<yPoints[k].val)j=k-1;else i=k+1}}return result},_getYPositionLogBase:function(val,yPoints,isOx,logBase){if(val<0)return 0;var logVal=Math.log(val)/ Math.log(logBase);var result;var parseVal,maxVal,minVal,startPos=0,diffPos;if(logVal<0){parseVal=logVal.toString().split(".");maxVal=Math.pow(logBase,parseVal[0]);minVal=Math.pow(logBase,parseFloat(parseVal[0])-1);for(var i=0;i<yPoints.length;i++)if(yPoints[i].val<maxVal&&yPoints[i].val>=minVal){if(yPoints[i+1]){startPos=yPoints[i+1].pos;diffPos=yPoints[i].pos-yPoints[i+1].pos}else{startPos=yPoints[i].pos;diffPos=yPoints[i-1].pos-yPoints[i].pos}break}result=startPos+parseFloat("0."+parseVal[1])*diffPos}else{parseVal= logVal.toString().split(".");minVal=Math.pow(logBase,parseVal[0]);maxVal=Math.pow(logBase,parseFloat(parseVal[0])+1);for(var i=0;i<yPoints.length;i++)if(yPoints[i].val<maxVal&&yPoints[i].val>=minVal){if(yPoints[i+1]){startPos=yPoints[i].pos;diffPos=yPoints[i].pos-yPoints[i+1].pos}else{startPos=yPoints[i].pos;diffPos=yPoints[i-1].pos-yPoints[i].pos}break}result=startPos-parseFloat("0."+parseVal[1])*diffPos}return result},getLogarithmicValue:function(val,logBase){if(val<0)return 0;var logVal=Math.log(val)/ Math.log(logBase);var temp=0;if(logVal>0)for(var l=0;l<logVal;l++){if(l!==0)temp+=Math.pow(logBase,l);if(l+1>logVal){temp+=(logVal-l)*Math.pow(logBase,l+1);break}}else{var parseTemp=logVal.toString().split(".");temp=Math.pow(logBase,parseFloat(parseTemp[0]));temp=temp-temp*parseFloat("0."+parseTemp[1])}return temp},_calaculate3DProperties:function(chartSpace){var widthCanvas=this.calcProp.widthCanvas;var heightCanvas=this.calcProp.heightCanvas;var left=this.calcProp.chartGutter._left;var right=this.calcProp.chartGutter._right; var bottom=this.calcProp.chartGutter._bottom;var top=this.calcProp.chartGutter._top;standartMarginForCharts=17;this.processor3D=new AscFormat.Processor3D(widthCanvas,heightCanvas,left,right,bottom,top,chartSpace,this);this.processor3D.calaculate3DProperties();this.processor3D.correctPointsPosition(chartSpace)},_convertAndTurnPoint:function(x,y,z,isNScale,isNRotate,isNProject){return this.processor3D.convertAndTurnPoint(x,y,z,isNScale,isNRotate,isNProject)},calculatePositionLabelsCatAxFromAngle:function(chartSpace){var res= null;var oView3D=chartSpace.chart.getView3d();var angleOy=oView3D&&oView3D.rotY?-oView3D.rotY/360*(Math.PI*2):0;if(oView3D&&!oView3D.getRAngAx()&&angleOy!==0){angleOy=Math.abs(angleOy);res=angleOy>=Math.PI/2&&angleOy<3*Math.PI/2}return res},_getSumArray:function(arr,isAbs){if(typeof arr==="number")return arr;else if(typeof arr==="string")return parseFloat(arr);var i,sum;for(i=0,sum=0;i<arr.length;i++)if(typeof arr[i]==="object"&&arr[i].val!=null&&arr[i].val!=undefined)sum+=parseFloat(isAbs?Math.abs(arr[i].val): arr[i].val);else if(arr[i])sum+=isAbs?Math.abs(arr[i]):arr[i];return sum},_getMaxMinValueArray:function(array){var max=0,min=0;for(var i=0;i<array.length;i++)for(var j=0;j<array[i].length;j++){if(i===0&&j===0){min=array[i][j];max=array[i][j]}if(array[i][j]>max)max=array[i][j];if(array[i][j]<min)min=array[i][j]}return{max:max,min:min}},_findPrevValue:function(originalData,num,max){var summ=0;for(var i=0;i<=max;i++)if(originalData[num][max]>=0){if(originalData[num][i]>=0)summ+=originalData[num][i]}else if(originalData[num][i]< 0)summ+=originalData[num][i];return summ},_getFirstDegree:function(val){var secPart=val.toString().split(".");var numPow=1,tempMax,expNum;if(secPart[1]&&secPart[1].toString().indexOf("e+")!=-1&&secPart[0]&&secPart[0].toString().length==1){expNum=secPart[1].toString().split("e+");numPow=Math.pow(10,expNum[1])}else if(secPart[1]&&secPart[1].toString().indexOf("e-")!=-1&&secPart[0]&&secPart[0].toString().length==1){expNum=secPart[1].toString().split("e");numPow=Math.pow(10,expNum[1])}else if(0!=secPart[0])numPow= Math.pow(10,secPart[0].toString().length-1);else if(0==secPart[0]&&secPart[1]!=undefined){tempMax=val;var num=0;while(1>tempMax){tempMax=tempMax*10;num--}numPow=Math.pow(10,num);val=tempMax}if(tempMax==undefined)val=val/numPow;return{val:val,numPow:numPow}},getIdxPoint:function(seria,index,bXVal){var res=null;var ser;if(bXVal)ser=seria.val?seria.val:seria.xVal;else ser=seria.val?seria.val:seria.yVal;if(!ser)return null;var numCache=this.getNumCache(ser);var pts=numCache?numCache.pts:null;if(pts== null)return null;if(pts[index]&&pts[index].idx===index)return pts[index];for(var i=0;i<pts.length;i++)if(pts[i].idx===index){res=pts[i];break}return res},getPointByIndex:function(seria,index,bXVal){var ser;if(bXVal)ser=seria.val?seria.val:seria.xVal;else ser=seria.val?seria.val:seria.yVal;if(!ser)return null;var oCache=ser.numRef&&ser.numRef.numCache||ser.numLit;if(oCache)return oCache.getPtByIndex(index);if(pts==null)return null;return pts[index]},getPtCount:function(series){var numCache;for(var i= 0;i<series.length;i++){numCache=series[i].val&&series[i].val.numRef?series[i].val.numRef.numCache:series[i].val.numLit;if(numCache&&numCache.ptCount)return numCache.ptCount}return 0},_roundValues:function(values){var kF=1E9;if(values.length)for(var i=0;i<values.length;i++)values[i]=Math.round(values[i]*kF)/kF;return values},calculate_Bezier2:function(x,y,x1,y1,x2,y2,x3,y3){var pts=[],bz=[];pts[0]={x:x,y:y};pts[1]={x:x1,y:y1};pts[2]={x:x2,y:y2};pts[3]={x:x3,y:y3};var d01=this.XYZDist(pts[0],pts[1]); var d12=this.XYZDist(pts[1],pts[2]);var d23=this.XYZDist(pts[2],pts[3]);var d02=this.XYZDist(pts[0],pts[2]);var d13=this.XYZDist(pts[1],pts[3]);bz[0]=pts[1];if(d02/6<d12/2&&d13/6<d12/2){var f;if(x!==x1)f=1/6;else f=1/3;bz[1]=this.XYZAdd(pts[1],this.XYZMult(this.XYZSub(pts[2],pts[0]),f));if(x2!==x3)f=1/6;else f=1/3;bz[2]=this.XYZAdd(pts[2],this.XYZMult(this.XYZSub(pts[1],pts[3]),f))}else if(d02/6>=d12/2&&d13/6>=d12/2){bz[1]=this.XYZAdd(pts[1],this.XYZMult(this.XYZSub(pts[2],pts[0]),d12/2/d02));bz[2]= this.XYZAdd(pts[2],this.XYZMult(this.XYZSub(pts[1],pts[3]),d12/2/d13))}else if(d02/6>=d12/2){bz[1]=this.XYZAdd(pts[1],this.XYZMult(this.XYZSub(pts[2],pts[0]),d12/2/d02));bz[2]=this.XYZAdd(pts[2],this.XYZMult(this.XYZSub(pts[1],pts[3]),d12/2/d13*(d13/d02)))}else{bz[1]=this.XYZAdd(pts[1],this.XYZMult(this.XYZSub(pts[2],pts[0]),d12/2/d02*(d02/d13)));bz[2]=this.XYZAdd(pts[2],this.XYZMult(this.XYZSub(pts[1],pts[3]),d12/2/d13))}bz[3]=pts[2];return bz},calculate_Bezier:function(x,y,x1,y1,x2,y2,x3,y3,t){var pts= [],bz=[];pts[0]={x:x,y:y};pts[1]={x:x1,y:y1};pts[2]={x:x2,y:y2};pts[3]={x:x3,y:y3};var d01=this.XYZDist(pts[0],pts[1]);var d12=this.XYZDist(pts[1],pts[2]);var d23=this.XYZDist(pts[2],pts[3]);var d02=this.XYZDist(pts[0],pts[2]);var d13=this.XYZDist(pts[1],pts[3]);bz[0]=pts[1];if(d02/6<d12/2&&d13/6<d12/2){var f;if(x!==x1)f=1/6;else f=1/3;bz[1]=this.XYZAdd(pts[1],this.XYZMult(this.XYZSub(pts[2],pts[0]),f));if(x2!==x3)f=1/6;else f=1/3;bz[2]=this.XYZAdd(pts[2],this.XYZMult(this.XYZSub(pts[1],pts[3]),f))}else if(d02/ 6>=d12/2&&d13/6>=d12/2){bz[1]=this.XYZAdd(pts[1],this.XYZMult(this.XYZSub(pts[2],pts[0]),d12/2/d02));bz[2]=this.XYZAdd(pts[2],this.XYZMult(this.XYZSub(pts[1],pts[3]),d12/2/d13))}else if(d02/6>=d12/2){bz[1]=this.XYZAdd(pts[1],this.XYZMult(this.XYZSub(pts[2],pts[0]),d12/2/d02));bz[2]=this.XYZAdd(pts[2],this.XYZMult(this.XYZSub(pts[1],pts[3]),d12/2/d13*(d13/d02)))}else{bz[1]=this.XYZAdd(pts[1],this.XYZMult(this.XYZSub(pts[2],pts[0]),d12/2/d02*(d02/d13)));bz[2]=this.XYZAdd(pts[2],this.XYZMult(this.XYZSub(pts[1], pts[3]),d12/2/d13))}bz[3]=pts[2];var pt=this._bezier4(bz[0],bz[1],bz[2],bz[3],t);return[pt.x,pt.y]},_bezier4:function(p1,p2,p3,p4,t){var mum1,mum13,t3,mum12,t2;var p={};mum1=1-t;mum13=mum1*mum1*mum1;mum12=mum1*mum1;t2=t*t;t3=t*t*t;p.x=mum13*p1.x+3*t*mum12*p2.x+3*t2*mum1*p3.x+t3*p4.x;p.y=mum13*p1.y+3*t*mum12*p2.y+3*t2*mum1*p3.y+t3*p4.y;return p},XYZAdd:function(a,b){return{x:a.x+b.x,y:a.y+b.y}},XYZSub:function(a,b){return{x:a.x-b.x,y:a.y-b.y}},XYZMult:function(a,b){return{x:a.x*b,y:a.y*b}},XYZDist:function(a, b){return Math.pow(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2),.5)},calculateCountSeries:function(chart){var series=chart.series;var typeChart=chart.getObjectType();var counter=0,numCache,seriaVal,ptCount;for(var i=0;i<series.length;i++){seriaVal=series[i].val?series[i].val:series[i].yVal;numCache=this.getNumCache(seriaVal);if(!series[i].isHidden){if(AscDFH.historyitem_type_PieChart===typeChart)ptCount=1;else if(numCache&&(ptCount===undefined||ptCount<numCache.ptCount))ptCount=numCache.ptCount;counter++}else if(3=== this.nDimensionCount)counter++}if(AscDFH.historyitem_type_PieChart===typeChart)counter=1;return{series:counter,points:ptCount}},getLineEquation:function(point1,point2){var x0=point1.x,y0=point1.y,z0=point1.z;var x1=point2.x,y1=point2.y,z1=point2.z;var l=x1-x0;var m=y1-y0;var n=z1-z0;return{l:l,m:m,n:n,x1:x0,y1:y0,z1:z0}},getLineEquation2d:function(point1,point2){var x1=point1.x,y1=point1.y;var x2=point2.x,y2=point2.y;var k=(y2-y1)/(x2-x1);var b=y1-k*x1;return{k:k,b:b}},isIntersectionLineAndLine:function(equation1, equation2){var xo=equation1.x1;var yo=equation1.y1;var zo=equation1.z1;var p=equation1.l;var q=equation1.m;var r=equation1.n;var x1=equation2.x1;var y1=equation2.y1;var z1=equation2.z1;var p1=equation2.l;var q1=equation2.m;var r1=equation2.n;var x=(xo*q*p1-x1*q1*p-yo*p*p1+y1*p*p1)/(q*p1-q1*p);var y=(yo*p*q1-y1*p1*q-xo*q*q1+x1*q*q1)/(p*q1-p1*q);var z=(zo*q*r1-z1*q1*r-yo*r*r1+y1*r*r1)/(q*r1-q1*r);return{x:x,y:y,z:z}},isIntersectionPlainAndLine:function(plainEquation,lineEquation){var A=plainEquation.a; var B=plainEquation.b;var C=plainEquation.c;var D=plainEquation.d;var l=lineEquation.l;var m=lineEquation.m;var n=lineEquation.n;var x1=lineEquation.x1;var y1=lineEquation.y1;var z1=lineEquation.z1;var t=-(A*x1+B*y1+C*z1+D)/(A*l+B*m+C*n);var x=t*l+x1;var y=t*m+y1;var z=t*n+z1;return{x:x,y:y,z:z}},isIntersectionPlainAndLineSegment:function(plainEquation,point1,point2,projPoint1,projPoint2){var res=null;var lineEquation=this.getLineEquation(point1,point2);var intersection=this.isIntersectionPlainAndLine(plainEquation, lineEquation);var convertResult=this._convertAndTurnPoint(intersection.x,intersection.y,intersection.z);var isBetweenX=convertResult.x>=projPoint1.x&&convertResult.x<=projPoint2.x||convertResult.x<=projPoint1.x&&convertResult.x>=projPoint2.x;var isBetweenY=convertResult.y>=projPoint1.y&&convertResult.y<=projPoint2.y||convertResult.y<=projPoint1.y&&convertResult.y>=projPoint2.y;if(isBetweenX&&isBetweenY){var vectorMultiplication=(convertResult.x-projPoint1.x)*(projPoint2.y-projPoint1.y)-(convertResult.y- projPoint1.y)*(projPoint2.x-projPoint1.x);if(Math.round(vectorMultiplication)===0)res=convertResult}return res},isPoint2DLieOnLine:function(lineEquation,point){return Math.round(point.y*1E3)/1E3===Math.round((lineEquation.k*point.x+lineEquation.b)*1E3)/1E3},isPointLieIntoPlane:function(planeEquation,point){var resEquation=planeEquation.a*point.x+planeEquation.b*point.y+planeEquation.c*point.z+planeEquation.d;return Math.round(resEquation)===0},isPointsLieIntoOnePlane2:function(point1,point2,point3, point4){var bRes=false;var plain1=this.getPlainEquation(point1,point2,point3);var plain2=this.getPlainEquation(point3,point4,point1);if(Math.round(plain1.a)===Math.round(plain2.a)&&Math.round(plain1.b)===Math.round(plain2.b)&&Math.round(plain1.c)===Math.round(plain2.c)&&Math.round(plain1.d)===Math.round(plain2.d))bRes=true;return bRes},isPointsLieIntoOnePlane:function(point1,point2,point3,point4){var bRes=false;var plain1=this.getPlainEquation(point1,point2,point3);if(this.isPointLieIntoPlane(plain1, point4))bRes=true;return bRes},isPointsLieIntoOnePlane3:function(point1,point2,point3,point4){var vector1={x:point4.x-point1.x,y:point4.y-point1.y,z:point4.z-point1.z};var vector2={x:point4.x-point2.x,y:point4.y-point2.y,z:point4.z-point2.z};var vector3={x:point4.x-point3.x,y:point4.y-point3.y,z:point4.z-point3.z};var a1=vector1.x;var b1=vector1.y;var c1=vector1.z;var a2=vector2.x;var b2=vector2.y;var c2=vector2.z;var a3=vector3.x;var b3=vector3.y;var c3=vector3.z;var res=a1*b2*c3+a3*b1*c2+a2*b3* c1-a3*b2*c1-a1*b3*c2-a2*b1*c3;return res},getAreaQuadrilateral:function(point0,point1,point2,point3){var a=Math.sqrt(Math.pow(point3.x-point0.x,2)+Math.pow(point3.y-point0.y,2));var b=Math.sqrt(Math.pow(point1.x-point0.x,2)+Math.pow(point1.y-point0.y,2));var c=Math.sqrt(Math.pow(point2.x-point1.x,2)+Math.pow(point2.y-point1.y,2));var d=Math.sqrt(Math.pow(point3.x-point2.x,2)+Math.pow(point3.y-point2.y,2));var e=Math.sqrt(Math.pow(point3.x-point1.x,2)+Math.pow(point3.y-point1.y,2));var f=Math.sqrt(Math.pow(point0.x- point2.x,2)+Math.pow(point0.y-point2.y,2));var p=(a+b+c+d)/2;var res=Math.sqrt((p-a)*(p-b)*(p-c)*(p-d)+1/4*((e*f+a*c+b*d)*(e*f-a*c-b*d)));return res},getAreaTriangle:function(point0,point1,point2){var a=Math.sqrt(Math.pow(point1.x-point0.x,2)+Math.pow(point1.y-point0.y,2));var b=Math.sqrt(Math.pow(point2.x-point1.x,2)+Math.pow(point2.y-point1.y,2));var c=Math.sqrt(Math.pow(point2.x-point0.x,2)+Math.pow(point2.y-point0.y,2));var p=(a+b+c)/2;return Math.sqrt(p*(p-a)*(p-b)*(p-c))},getMinMaxPoints:function(points){var minX, maxX,minY,maxY,minZ,maxZ;for(var n=0;n<points.length;n++)if(0===n){minX=points[0].x;maxX=points[0].x;minY=points[0].y;maxY=points[0].y;minZ=points[0].z;maxZ=points[0].z}else{if(points[n].x<minX)minX=points[n].x;if(points[n].x>maxX)maxX=points[n].x;if(points[n].y<minY)minY=points[n].y;if(points[n].y>maxY)maxY=points[n].y;if(points[n].z<minZ)minZ=points[n].z;if(points[n].z>maxZ)maxZ=points[n].z}return{minX:minX,maxX:maxX,minY:minY,maxY:maxY,minZ:minZ,maxZ:maxZ}},getPlainEquation3:function(point1,point2, point3){var a1=point1.x,b1=point1.y,c1=point1.z,a2=point2.x,b2=point2.y,c2=point2.z,a3=point3.x,b3=point3.y,c3=point3.z;var subMatrix=function(oldmat,row,col){var i;var j;var m=0;var k=0;var len=oldmat.length;var retmat=[];if(len<=row||len<=col)return 0;for(j=0;j<len;j++){if(j!==row){retmat[k]=[];for(i=0;i<len;i++)if(i!==col){retmat[k][m]=oldmat[j][i];m++}k++}m=0}return retmat};var determinant=function(mat){var i;var tmpVal=0;var row=mat.length;var newDet=[];newDet[0]=[];switch(row){case 1:return mat[0][0]; case 2:return mat[0][0]*mat[1][1]-mat[0][1]*mat[1][0];default:for(i=0;i<row;i++){if(mat[0][i]===0)i++;if(i<row){newDet=subMatrix(mat,0,i);if(!isNaN(mat[0][i]))tmpVal+=parseFloat(mat[0][i])*Math.pow(-1,i)*determinant(newDet)}}return tmpVal}};var replaceCol=function(mat,col,vec){var i=0;var j=0;var tmp=[];for(i=0;i<mat.length;i++){tmp[i]=[];for(j=0;j<mat.length;j++)if(col===j)tmp[i][col]=vec[i];else tmp[i][j]=mat[i][j]}return tmp};var mat=[];mat[0]=[];mat[1]=[];mat[2]=[];mat[0][0]=a1;mat[0][1]=b1;mat[0][2]= c1;mat[1][0]=a2;mat[1][1]=b2;mat[1][2]=c2;mat[2][0]=a3;mat[2][1]=b3;mat[2][2]=c3;var det=determinant(mat);var vec=[-1,-1,-1];var factor;var a=determinant(replaceCol(mat,0,vec));if(a<0)factor=-1;else factor=1;a*=factor;var b=determinant(replaceCol(mat,1,vec))*factor;var c=determinant(replaceCol(mat,2,vec))*factor;var d=det*factor;return{a:a,b:b,c:c,d:d}},getPlainEquation:function(point1,point2,point3){var x1=point1.x,y1=point1.y,z1=point1.z;var x2=point2.x,y2=point2.y,z2=point2.z;var x3=point3.x,y3= point3.y,z3=point3.z;var a=x2-x1;var b=y2-y1;var c=z2-z1;var d=x3-x1;var e=y3-y1;var f=z3-z1;var xK=b*f-e*c;var yK=-(a*f-d*c);var zK=a*e-d*b;var a1=-xK;var b1=-yK;var c1=-zK;var d1=-(-y1*yK-x1*xK-z1*zK);return{a:a1,b:b1,c:c1,d:d1}},getPlainEquation2:function(point1,point2,point3){var x1=point1.x,y1=point1.y,z1=point1.z;var x2=point2.x,y2=point2.y,z2=point2.z;var x3=point3.x,y3=point3.y,z3=point3.z;var x21=x2-x1;var y21=y2-y1;var z21=z2-z1;var x31=x3-x1;var y31=y3-y1;var z31=z3-z1;var tempA=y21*z31- z21*y31;var tempB=x21*z31-z21*x31;var tempC=x21*y31-y21*x31;var a=tempA;var b=tempB;var c=tempC;var d=y1*tempB-x1*tempA-z1*tempC;return{a:a,b:b,c:c,d:d}},calculateRect3D:function(points,val,isNotDrawDownVerge,isNotOnlyFrontFaces){var res;var point1=points[0];var point2=points[1];var point3=points[2];var point4=points[3];var point5=points[4];var point6=points[5];var point7=points[6];var point8=points[7];var frontPaths=[];var darkPaths=[];var addPathToArr=function(isFront,face,index){frontPaths[index]= null;darkPaths[index]=null;if(isFront)frontPaths[index]=face;else darkPaths[index]=face};var face;face=this._calculatePathFace(point1,point5,point8,point4,true);addPathToArr(this._isVisibleVerge3D(point5,point1,point4,val),face,0);if(val===0&&this.calcProp.type===c_oChartTypes.Bar){face=this._calculatePathFace(point1,point2,point3,point4,true);addPathToArr(true,face,1)}else{face=this._calculatePathFace(point1,point2,point3,point4,true);addPathToArr(this._isVisibleVerge3D(point4,point1,point2,val), face,1)}if(val===0&&this.calcProp.type===c_oChartTypes.HBar){face=this._calculatePathFace(point1,point5,point6,point2,true);addPathToArr(!isNotDrawDownVerge,face,2)}else{face=this._calculatePathFace(point1,point5,point6,point2,true);addPathToArr(!isNotDrawDownVerge&&this._isVisibleVerge3D(point2,point1,point5,val),face,2)}if(val===0&&this.calcProp.type===c_oChartTypes.HBar){face=this._calculatePathFace(point4,point8,point7,point3,true);addPathToArr(true,face,3)}else{face=this._calculatePathFace(point4, point8,point7,point3,true);addPathToArr(this._isVisibleVerge3D(point8,point4,point3,val),face,3)}if(val===0&&this.calcProp.type===c_oChartTypes.Bar){face=this._calculatePathFace(point5,point6,point7,point8,true);addPathToArr(true,face,4)}else{face=this._calculatePathFace(point5,point6,point7,point8,true);addPathToArr(this._isVisibleVerge3D(point6,point5,point8,val),face,4)}face=this._calculatePathFace(point2,point6,point7,point3,true);addPathToArr(this._isVisibleVerge3D(point3,point2,point6,val), face,5);if(!isNotOnlyFrontFaces)res=frontPaths;else res={frontPaths:frontPaths,darkPaths:darkPaths};return res},_calculatePathFace:function(point1,point2,point3,point4,isConvertPxToMM){var pxToMm=1;if(isConvertPxToMM)pxToMm=this.calcProp.pxToMM;var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.calcProp.pathH;var pathW=this.calcProp.pathW;path.moveTo(point1.x/pxToMm*pathW,point1.y/pxToMm*pathH);path.lnTo(point2.x/pxToMm*pathW,point2.y/pxToMm*pathH);path.lnTo(point3.x/ pxToMm*pathW,point3.y/pxToMm*pathH);path.lnTo(point4.x/pxToMm*pathW,point4.y/pxToMm*pathH);path.lnTo(point1.x/pxToMm*pathW,point1.y/pxToMm*pathH);return pathId},calculatePathFacesArray:function(faceArr,isConvertPxToMM){var pxToMm=1;if(isConvertPxToMM)pxToMm=this.calcProp.pxToMM;var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.calcProp.pathH;var pathW=this.calcProp.pathW;var firstPoint=null;for(var i=0;i<faceArr.length;i++)if(faceArr[i]&&faceArr[i].point)if(null=== firstPoint){path.moveTo(faceArr[i].point.x/pxToMm*pathW,faceArr[i].point.y/pxToMm*pathH);firstPoint=faceArr[i].point}else path.lnTo(faceArr[i].point.x/pxToMm*pathW,faceArr[i].point.y/pxToMm*pathH);if(null!==firstPoint)path.lnTo(firstPoint.x/pxToMm*pathW,firstPoint.y/pxToMm*pathH);return pathId},_isVisibleVerge3D:function(k,n,m,val){var aX=n.x*m.y-m.x*n.y;var bY=-(k.x*m.y-m.x*k.y);var cZ=k.x*n.y-n.x*k.y;var visible=aX+bY+cZ;var result;if(this.calcProp.type===c_oChartTypes.Bar){result=val>0&&visible< 0||val<0&&visible>0;if(!(this.calcProp.subType==="stacked")&&!(this.calcProp.subType==="stackedPer")&&this.cChartSpace.chart.plotArea.valAx.scaling.orientation!==ORIENTATION_MIN_MAX)result=!result}else if(this.calcProp.type===c_oChartTypes.Line)result=visible<0;else if(this.calcProp.type===c_oChartTypes.HBar){result=val<0&&visible<0||val>0&&visible>0;if(!(this.calcProp.subType==="stacked")&&!(this.calcProp.subType==="stackedPer")&&this.cChartSpace.chart.plotArea.valAx.scaling.orientation!==ORIENTATION_MIN_MAX)result= !result}return result},calculatePolygon:function(array){if(!array)return null;var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.calcProp.pathH;var pathW=this.calcProp.pathW;for(var i=0;i<array.length;i++){var point=array[i];if(i===0)path.moveTo(point.x*pathW,point.y*pathH);else path.lnTo(point.x*pathW,point.y*pathH);if(i===array.length-1)path.lnTo(array[0].x*pathW,array[0].y*pathH)}return pathId},_isSwitchCurrent3DChart:function(chartSpace){var res=false; var chart=chartSpace&&chartSpace.chart?chartSpace.chart.plotArea.charts[0]:null;var typeChart=chart?chart.getObjectType():null;var oView3D=chartSpace&&chartSpace.chart&&chartSpace.chart.getView3d();if(isTurnOn3DCharts&&oView3D){var isPerspective=!oView3D.getRAngAx();var isBar=typeChart===AscDFH.historyitem_type_BarChart&&chart&&chart.barDir!==AscFormat.BAR_DIR_BAR;var isHBar=typeChart===AscDFH.historyitem_type_BarChart&&chart&&chart.barDir===AscFormat.BAR_DIR_BAR;var isLine=typeChart===AscDFH.historyitem_type_LineChart; var isPie=typeChart===AscDFH.historyitem_type_PieChart;var isArea=typeChart===AscDFH.historyitem_type_AreaChart;var isSurface=typeChart===AscDFH.historyitem_type_SurfaceChart;if(!isPerspective&&(isBar||isLine||isHBar||isPie||isArea||isSurface))res=true;else if(isPerspective&&(isBar||isLine||isHBar||isArea||isPie||isSurface))res=true}return res},getNumCache:function(val){var res=null;if(val)if(val.numRef&&val.numRef.numCache)res=val.numRef.numCache;else if(val.numLit)res=val.numLit;return res},getHorizontalPoints:function(chartSpace){var res= null;if(!chartSpace)chartSpace=this.cChartSpace;var plotArea=chartSpace.chart.plotArea;if(plotArea.valAx&&plotArea.valAx.xPoints)res=plotArea.valAx.xPoints;else if(plotArea.catAx&&plotArea.catAx.xPoints)res=plotArea.catAx.xPoints;return res},getVerticalPoints:function(chartSpace){var res=null;if(!chartSpace)chartSpace=this.cChartSpace;var plotArea=chartSpace.chart.plotArea;if(plotArea.valAx&&plotArea.valAx.yPoints)res=plotArea.valAx.yPoints;else if(plotArea.catAx&&plotArea.catAx.yPoints)res=plotArea.catAx.yPoints; return res},getPlotAreaPoints:function(chartSpace){if(!chartSpace)chartSpace=this.cChartSpace;var xPoints=this.getHorizontalPoints(chartSpace);var yPoints=this.getVerticalPoints(chartSpace);var pxToMm=this.calcProp.pxToMM;var plotArea=chartSpace.chart.plotArea;var left,right,bottom,top;var t=this;var defaultCalculate=function(){var widthGraph=t.calcProp.widthCanvas;var heightGraph=t.calcProp.heightCanvas;var leftMargin=t.calcProp.chartGutter._left;var rightMargin=t.calcProp.chartGutter._right;var topMargin= t.calcProp.chartGutter._top;var bottomMargin=t.calcProp.chartGutter._bottom;left=leftMargin/pxToMm;right=(widthGraph-rightMargin)/pxToMm;bottom=(heightGraph-bottomMargin)/pxToMm;top=topMargin/pxToMm};if(xPoints&&yPoints){var crossBetweenX=chartSpace.getValAxisCrossType();var crossDiffX=0;if(crossBetweenX===AscFormat.CROSS_BETWEEN_BETWEEN&&plotArea.valAx.posX&&this.calcProp.type!==c_oChartTypes.HBar)crossDiffX=xPoints[1]?Math.abs((xPoints[1].pos-xPoints[0].pos)/2):Math.abs(xPoints[0].pos-plotArea.valAx.posX); left=xPoints[0].pos-crossDiffX;right=xPoints[xPoints.length-1].pos+crossDiffX;var crossBetweenY=chartSpace.getValAxisCrossType();var crossDiffY=0;if(crossBetweenY===AscFormat.CROSS_BETWEEN_BETWEEN&&plotArea.valAx.posY)crossDiffY=yPoints[1]?Math.abs((yPoints[1].pos-yPoints[0].pos)/2):Math.abs(yPoints[0].pos-plotArea.valAx.posY);bottom=yPoints[0].pos+crossDiffY;top=yPoints[yPoints.length-1].pos-crossDiffY}else defaultCalculate();if(isNaN(left)||isNaN(top)||isNaN(bottom)||isNaN(right))defaultCalculate(); return{left:left,right:right,bottom:bottom,top:top}},getHorizontalGridLines:function(axis,isCatAxis){var t=this;var gridLines,minorGridLines;var crossBetween=this.cChartSpace.getValAxisCrossType();var points=axis.yPoints;if(!points)return;if(!axis.majorGridlines&&!axis.minorGridlines)return;var widthLine=this.calcProp.widthCanvas-(this.calcProp.chartGutter._left+this.calcProp.chartGutter._right);var bottomMargin=this.calcProp.heightCanvas-this.calcProp.chartGutter._bottom;var posX=this.calcProp.chartGutter._left; var posMinorY,posY,crossDiff;if(crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN&&isCatAxis){var posAxis=(this.calcProp.heightCanvas-this.calcProp.chartGutter._bottom)/this.calcProp.pxToMM;crossDiff=points[1]?Math.abs((points[1].pos-points[0].pos)/2):Math.abs(points[0].pos-posAxis)}var numCache,tempAngle,trueHeight,trueWidth,xDiff,xCenter,yCenter;if(this.calcProp.type===c_oChartTypes.Radar){numCache=this.getNumCache(this.calcProp.series[0].val);if(numCache){tempAngle=2*Math.PI/numCache.length;trueHeight= this.calcProp.trueHeight;trueWidth=this.calcProp.trueWidth;xDiff=trueHeight/2/points.length/this.calcProp.pxToMM;xCenter=(this.calcProp.chartGutter._left+trueWidth/2)/this.calcProp.pxToMM;yCenter=(this.calcProp.chartGutter._top+trueHeight/2)/this.calcProp.pxToMM}}var calculateRadarGridLines=function(){var y,x,radius,xFirst,yFirst;for(var k=0;k<numCache.length;k++){y=i*xDiff;x=xCenter;radius=y;y=yCenter-radius*Math.cos(k*tempAngle);x=x+radius*Math.sin(k*tempAngle);var pathH=t.calcProp.pathH;var pathW= t.calcProp.pathW;path.stroke=true;if(k===0){xFirst=x;yFirst=y;path.moveTo(x*pathW,y*pathH)}else if(k===numCache.length-1){path.lnTo(x*pathW,y*pathH);path.lnTo(xFirst*pathW,yFirst*pathH)}else path.lnTo(x*pathW,y*pathH)}if(!gridLines)gridLines=pathId};var minorLinesCount=isCatAxis?2:5;var stepY=points[1]?Math.abs(points[1].pos-points[0].pos):Math.abs(points[0].pos-axis.posY)*2;var minorStep=stepY/minorLinesCount*this.calcProp.pxToMM;var pathId=t.cChartSpace.AllocPath();var path=t.cChartSpace.GetPath(pathId); var i;for(i=0;i<points.length;i++)if(this.calcProp.type===c_oChartTypes.Radar){if(numCache)calculateRadarGridLines()}else{if(isCatAxis&&points[i].val<0)continue;if(crossDiff)posY=(points[i].pos+crossDiff)*this.calcProp.pxToMM;else posY=points[i].pos*this.calcProp.pxToMM;if(!gridLines)gridLines=pathId;this._calculateGridLine(posX,posY,posX+widthLine,posY,path);if(crossDiff&&i===points.length-1){if(crossDiff)posY=(points[i].pos-crossDiff)*this.calcProp.pxToMM;i++;if(!gridLines)gridLines=pathId;this._calculateGridLine(posX, posY,posX+widthLine,posY,path)}}var pathIdMinor=t.cChartSpace.AllocPath();var pathMinor=t.cChartSpace.GetPath(pathIdMinor);for(i=0;i<points.length;i++)if(this.calcProp.type!==c_oChartTypes.Radar){if(isCatAxis&&points[i].val<0)continue;if(crossDiff)posY=(points[i].pos+crossDiff)*this.calcProp.pxToMM;else posY=points[i].pos*this.calcProp.pxToMM;for(var n=0;n<minorLinesCount;n++){posMinorY=posY+n*minorStep;if(posMinorY<this.calcProp.chartGutter._top||posMinorY>bottomMargin)break;if(!minorGridLines)minorGridLines= pathIdMinor;this._calculateGridLine(posX,posMinorY,posX+widthLine,posMinorY,pathMinor)}}return{gridLines:gridLines,minorGridLines:minorGridLines}},getVerticalGridLines:function(axis,isCatAxis){var gridLines,minorGridLines;var crossBetween=this.cChartSpace.getValAxisCrossType();if(null===crossBetween&&isCatAxis)crossBetween=axis.crossAx?axis.crossAx.crossBetween:null;var heightLine=this.calcProp.heightCanvas-(this.calcProp.chartGutter._bottom+this.calcProp.chartGutter._top);var rightMargin=this.calcProp.widthCanvas- this.calcProp.chartGutter._right;var posY=this.calcProp.chartGutter._top;var posMinorX;var points=axis.xPoints;if(!points)return;if(!axis.majorGridlines&&!axis.minorGridlines)return;var minorLinesCount=isCatAxis?2:5;var posAxis=this.calcProp.chartGutter._left/this.calcProp.pxToMM;var stepX=points[1]?Math.abs(points[1].pos-points[0].pos):Math.abs(points[0].pos-posAxis)*2;var minorStep=stepX*this.calcProp.pxToMM/minorLinesCount;var posX,crossDiff;if(crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN&&isCatAxis)crossDiff= points[1]?Math.abs((points[1].pos-points[0].pos)/2):Math.abs(points[0].pos-posAxis);var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var i;for(i=0;i<points.length;i++){if(isCatAxis&&points[i].val<0)continue;if(crossDiff)posX=(points[i].pos-crossDiff)*this.calcProp.pxToMM;else posX=points[i].pos*this.calcProp.pxToMM;if(!gridLines)gridLines=pathId;this._calculateGridLine(posX,posY,posX,posY+heightLine,path);if(crossDiff&&i===points.length-1){if(crossDiff)posX=(points[i].pos+ crossDiff)*this.calcProp.pxToMM;i++;if(!gridLines)gridLines=pathId;this._calculateGridLine(posX,posY,posX,posY+heightLine,path)}}var pathIdMinor=this.cChartSpace.AllocPath();var pathMinor=this.cChartSpace.GetPath(pathIdMinor);for(i=0;i<points.length;i++){if(isCatAxis&&points[i].val<0)continue;if(crossDiff)posX=(points[i].pos-crossDiff)*this.calcProp.pxToMM;else posX=points[i].pos*this.calcProp.pxToMM;for(var n=0;n<=minorLinesCount;n++){posMinorX=posX+n*minorStep;if(posMinorX<this.calcProp.chartGutter._left|| posMinorX>rightMargin)break;if(!minorGridLines)minorGridLines=pathIdMinor;this._calculateGridLine(posMinorX,posY,posMinorX,posY+heightLine,pathMinor)}}return{gridLines:gridLines,minorGridLines:minorGridLines}},_calculateGridLine:function(x,y,x1,y1,path){var t=this;var calculate2DLine=function(x,y,x1,y1){if(!path){var pathId=t.cChartSpace.AllocPath();path=t.cChartSpace.GetPath(pathId)}var pathH=t.calcProp.pathH;var pathW=t.calcProp.pathW;path.stroke=true;var pxToMm=t.calcProp.pxToMM;path.moveTo(x/ pxToMm*pathW,y/pxToMm*pathH);path.lnTo(x1/pxToMm*pathW,y1/pxToMm*pathH);return pathId};var calculate3DLine=function(x,y,x1,y1,x2,y2,x3,y3){if(!path){var pathId=t.cChartSpace.AllocPath();path=t.cChartSpace.GetPath(pathId)}var pathH=t.calcProp.pathH;var pathW=t.calcProp.pathW;path.stroke=true;var pxToMm=t.calcProp.pxToMM;path.moveTo(x/pxToMm*pathW,y/pxToMm*pathH);path.lnTo(x1/pxToMm*pathW,y1/pxToMm*pathH);path.lnTo(x2/pxToMm*pathW,y2/pxToMm*pathH);if(x3!==undefined&&y3!==undefined){path.lnTo(x3/pxToMm* pathW,y3/pxToMm*pathH);path.lnTo(x/pxToMm*pathW,y/pxToMm*pathH)}return pathId};if(this.nDimensionCount===3){var view3DProp=this.cChartSpace.chart.getView3d();var angleOx=view3DProp&&view3DProp.rotX?-view3DProp.rotX/360*(Math.PI*2):0;var angleOy=view3DProp&&view3DProp.rotY?-view3DProp.rotY/360*(Math.PI*2):0;var perspectiveDepth=this.processor3D.depthPerspective;var angleOz=0;var rAngAx=this.processor3D.view3D.getRAngAx();var isVertLine=x===x1;var convertResult=this._convertAndTurnPoint(x,y,0);var x1n= convertResult.x;var y1n=convertResult.y;convertResult=this._convertAndTurnPoint(x,y,perspectiveDepth);var x2n=convertResult.x;var y2n=convertResult.y;convertResult=this._convertAndTurnPoint(x1,y1,perspectiveDepth);var x3n=convertResult.x;var y3n=convertResult.y;convertResult=this._convertAndTurnPoint(x1,y1,0);var x4n=convertResult.x;var y4n=convertResult.y;if(!isVertLine)if(rAngAx)path=calculate3DLine(x1n,y1n,x2n,y2n,x3n,y3n);else{var angleOyAbs=Math.abs(angleOy);if(angleOyAbs>=0&&angleOyAbs<Math.PI/ 2)path=calculate3DLine(x1n,y1n,x2n,y2n,x3n,y3n);else if(angleOyAbs>=Math.PI/2&&angleOyAbs<Math.PI)path=calculate3DLine(x4n,y4n,x1n,y1n,x2n,y2n);else if(angleOyAbs>=Math.PI&&angleOyAbs<3*Math.PI/2)path=calculate3DLine(x1n,y1n,x4n,y4n,x3n,y3n);else path=calculate3DLine(x2n,y2n,x3n,y3n,x4n,y4n)}else if(rAngAx)path=calculate3DLine(x2n,y2n,x3n,y3n,x4n,y4n);else path=calculate3DLine(x2n,y2n,x3n,y3n,x4n,y4n)}else path=calculate2DLine(x,y,x1,y1);return path},getAxisFromAxId:function(axId,type){var res=null; for(var i=0;i<axId.length;i++)if(axId[i].getObjectType()===type){res=this._searchChangedAxis(axId[i]);break}return res},getPositionZero:function(axis){var res=null;var points=axis.xPoints?axis.xPoints:axis.yPoints;if(points){for(var i=0;i<points.length;i++)if(0===points[i].val){res=points[i].pos*this.calcProp.pxToMM;break}if(null===res)if(points[0].val<0)res=points[points.length-1].pos*this.calcProp.pxToMM;else res=points[0].pos*this.calcProp.pxToMM}return res},calculateSplineLine:function(x,y,x1, y1,x2,y2,x3,y3,catAx,valAx){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.calcProp.pathH;var pathW=this.calcProp.pathW;var startCoords;var endCoords;for(var i=0;i<=1;){var splineCoords=this.calculate_Bezier(x,y,x1,y1,x2,y2,x3,y3,i);if(i===0)startCoords={x:this.getYPosition(splineCoords[0],catAx),y:this.getYPosition(splineCoords[1],valAx)};endCoords={x:this.getYPosition(splineCoords[0],catAx),y:this.getYPosition(splineCoords[1],valAx)};if(i===0)path.moveTo(startCoords.x* pathW,startCoords.y*pathH);path.lnTo(endCoords.x*pathW,endCoords.y*pathH);i=i+.1}return pathId}};function drawBarChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace;this.chart=chart;this.catAx=null;this.valAx=null;this.ptCount=null;this.seriesCount=null;this.subType=null;this.paths={};this.sortZIndexPaths=[];this.summBarVal=[];this.temp=[];this.temp2=[]}drawBarChart.prototype={constructor:drawBarChart,recalculate:function(){this.paths= {};this.summBarVal=[];this.sortZIndexPaths=[];var countSeries=this.cChartDrawer.calculateCountSeries(this.chart);this.seriesCount=countSeries.series;this.ptCount=countSeries.points;this.subType=this.cChartDrawer.getChartGrouping(this.chart);this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_CatAx);if(!this.catAx)this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_DateAx);this.valAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId, AscDFH.historyitem_type_ValAx);this._recalculateBars()},draw:function(){if(this.cChartDrawer.nDimensionCount===3)this._DrawBars3D();else this._DrawBars()},_DrawBars:function(){this.cChartDrawer.cShapeDrawer.Graphics.SaveGrState();var left=(this.chartProp.chartGutter._left-1)/this.chartProp.pxToMM;var top=(this.chartProp.chartGutter._top-1)/this.chartProp.pxToMM;var right=this.chartProp.trueWidth/this.chartProp.pxToMM;var bottom=this.chartProp.trueHeight/this.chartProp.pxToMM;this.cChartDrawer.cShapeDrawer.Graphics.AddClipRect(left, top,right,bottom);this.cChartDrawer.drawPaths(this.paths,this.chart.series,null,null,true);this.cChartDrawer.cShapeDrawer.Graphics.RestoreGrState()},_recalculateBars:function(){var xPoints=this.catAx.xPoints;var yPoints=this.valAx.yPoints;var scaleAxis=this.valAx.scale;var axisMin=scaleAxis[0]<scaleAxis[scaleAxis.length-1]?scaleAxis[0]:scaleAxis[scaleAxis.length-1];var axisMax=scaleAxis[0]<scaleAxis[scaleAxis.length-1]?scaleAxis[scaleAxis.length-1]:scaleAxis[0];if(!xPoints||!yPoints)return;var widthGraph= this.chartProp.widthCanvas-this.chartProp.chartGutter._left-this.chartProp.chartGutter._right;var defaultOverlap=this.subType==="stacked"||this.subType==="stackedPer"||this.subType==="standard"?100:0;var overlap=AscFormat.isRealNumber(this.chart.overlap)?this.chart.overlap:defaultOverlap;var numCache=this.cChartDrawer.getNumCache(this.chart.series[0].val);var width=widthGraph/xPoints.length;if(this.cChartSpace.getValAxisCrossType()&&numCache)width=widthGraph/(xPoints.length-1);var gapWidth=AscFormat.isRealNumber(this.chart.gapWidth)? this.chart.gapWidth:150;var individualBarWidth=width/(this.seriesCount-(this.seriesCount-1)*(overlap/100)+gapWidth/100);var widthOverLap=individualBarWidth*(overlap/100);var hmargin=gapWidth/100*individualBarWidth/2;var nullPositionOX=this.catAx.posY*this.chartProp.pxToMM;var height,startX,startY,val,paths,seriesHeight=[],tempValues=[],seria,startYColumnPosition,startXPosition,prevVal,idx,seriesCounter=0;var cubeCount=0,k;for(var i=0;i<this.chart.series.length;i++){numCache=this.cChartDrawer.getNumCache(this.chart.series[i].val); seria=numCache?numCache.pts:[];seriesHeight[i]=[];tempValues[i]=[];if(numCache==null||this.chart.series[i].isHidden)continue;var isValMoreZero=false;var isValLessZero=0;for(var j=0;j<seria.length;j++){if(val>0)isValMoreZero=true;else if(val<0)isValLessZero++;val=parseFloat(seria[j].val);idx=seria[j].idx!=null?seria[j].idx:j;prevVal=0;if(this.subType==="stacked"||this.subType==="stackedPer")for(k=0;k<tempValues.length;k++)if(tempValues[k][idx]&&tempValues[k][idx]>0)prevVal+=tempValues[k][idx];tempValues[i][idx]= val;startYColumnPosition=this._getStartYColumnPosition(seriesHeight,i,idx,val,yPoints,prevVal);startY=startYColumnPosition.startY;height=startYColumnPosition.height;seriesHeight[i][idx]=height;if(this.catAx.scaling.orientation===ORIENTATION_MIN_MAX)if(xPoints[1]&&xPoints[1].pos&&xPoints[idx])startXPosition=xPoints[idx].pos-Math.abs((xPoints[1].pos-xPoints[0].pos)/2);else if(xPoints[idx])startXPosition=xPoints[idx].pos-Math.abs(xPoints[0].pos-this.valAx.posX);else startXPosition=xPoints[0].pos-Math.abs(xPoints[0].pos- this.valAx.posX);else if(xPoints[1]&&xPoints[1].pos&&xPoints[idx])startXPosition=xPoints[idx].pos+Math.abs((xPoints[1].pos-xPoints[0].pos)/2);else if(xPoints[idx])startXPosition=xPoints[idx].pos+Math.abs(xPoints[0].pos-this.valAx.posX);else startXPosition=xPoints[0].pos+Math.abs(xPoints[0].pos-this.valAx.posX);if(this.catAx.scaling.orientation===ORIENTATION_MIN_MAX)if(seriesCounter===0)startX=startXPosition*this.chartProp.pxToMM+hmargin+seriesCounter*individualBarWidth;else startX=startXPosition* this.chartProp.pxToMM+hmargin+(seriesCounter*individualBarWidth-seriesCounter*widthOverLap);else if(i===0)startX=startXPosition*this.chartProp.pxToMM-hmargin-seriesCounter*individualBarWidth;else startX=startXPosition*this.chartProp.pxToMM-hmargin-(seriesCounter*individualBarWidth-seriesCounter*widthOverLap);if(this.catAx.scaling.orientation!==ORIENTATION_MIN_MAX)startX=startX-individualBarWidth;if(this.valAx.scaling.orientation!==ORIENTATION_MIN_MAX&&(this.subType==="stackedPer"||this.subType=== "stacked"))startY=startY+height;if(this.cChartDrawer.nDimensionCount===3){paths=this._calculateRect3D(startX,startY,individualBarWidth,height,val,isValMoreZero,isValLessZero,i);for(k=0;k<paths.paths.length;k++)this.sortZIndexPaths.push({seria:i,point:idx,verge:k,paths:paths.paths[k],x:paths.sortPaths[k].x,y:paths.sortPaths[k].y,zIndex:paths.sortPaths[k].z,facePoint:paths.facePoints[k]});paths=paths.paths;var testHeight;if(axisMax>0&&axisMin>0||axisMax<0&&axisMin<0)testHeight=Math.abs(yPoints[0].pos- yPoints[yPoints.length-1].pos)*this.chartProp.pxToMM;else{var endBlockPosition,startBlockPosition;if(val>0){endBlockPosition=this.cChartDrawer.getYPosition(axisMax,this.valAx)*this.chartProp.pxToMM;startBlockPosition=prevVal?this.cChartDrawer.getYPosition(0,this.valAx)*this.chartProp.pxToMM:nullPositionOX;testHeight=startBlockPosition-endBlockPosition}else{endBlockPosition=this.cChartDrawer.getYPosition(axisMin,this.valAx)*this.chartProp.pxToMM;startBlockPosition=prevVal?this.cChartDrawer.getYPosition(0, this.valAx)*this.chartProp.pxToMM:nullPositionOX;testHeight=startBlockPosition-endBlockPosition}}this.calculateParallalepiped(startX,startY,individualBarWidth,testHeight,val,isValMoreZero,isValLessZero,i,idx,cubeCount,this.temp2);this.calculateParallalepiped(startX,startY,individualBarWidth,height,val,isValMoreZero,isValLessZero,i,idx,cubeCount,this.temp);cubeCount++}else paths=this._calculateRect(startX,startY,individualBarWidth,height);var serIdx=this.chart.series[i].idx;if(!this.paths.series)this.paths.series= [];if(!this.paths.series[serIdx])this.paths.series[serIdx]=[];this.paths.series[serIdx][idx]=paths}seriesCounter++}var cSortFaces;if(this.cChartDrawer.nDimensionCount===3)if(this.subType==="stacked"||this.subType==="stackedPer"){cSortFaces=new window["AscFormat"].CSortFaces(this.cChartDrawer);this.sortParallelepipeds=cSortFaces.sortParallelepipeds(this.temp)}else if("normal"===this.subType){cSortFaces=new window["AscFormat"].CSortFaces(this.cChartDrawer);this.sortParallelepipeds=cSortFaces.sortParallelepipeds(this.temp2)}else{var getMinZ= function(arr){var zIndex=0;for(var i=0;i<arr.length;i++)if(i===0)zIndex=arr[i].z;else if(arr[i].z<zIndex)zIndex=arr[i].z;return zIndex};this.sortZIndexPaths.sort(function sortArr(a,b){var minZA=getMinZ(a.facePoint);var minZB=getMinZ(b.facePoint);if(minZB==minZA)return b.y-a.y;else return minZB-minZA})}},_getStartYColumnPosition:function(seriesHeight,i,j,val,yPoints){var startY,height,curVal,prevVal,endBlockPosition,startBlockPosition;var nullPositionOX=this.subType==="stacked"?this.cChartDrawer.getPositionZero(this.valAx): this.catAx.posY*this.chartProp.pxToMM;if(this.subType==="stacked"){curVal=this._getStackedValue(this.chart.series,i,j,val);prevVal=this._getStackedValue(this.chart.series,i-1,j,val);endBlockPosition=this.cChartDrawer.getYPosition(curVal,this.valAx)*this.chartProp.pxToMM;startBlockPosition=prevVal?this.cChartDrawer.getYPosition(prevVal,this.valAx)*this.chartProp.pxToMM:nullPositionOX;startY=startBlockPosition;height=startBlockPosition-endBlockPosition;if(this.valAx.scaling.orientation!=ORIENTATION_MIN_MAX)height= -height}else if(this.subType==="stackedPer"){this._calculateSummStacked(j);curVal=this._getStackedValue(this.chart.series,i,j,val);prevVal=this._getStackedValue(this.chart.series,i-1,j,val);endBlockPosition=this.cChartDrawer.getYPosition(curVal/this.summBarVal[j],this.valAx)*this.chartProp.pxToMM;startBlockPosition=this.summBarVal[j]?this.cChartDrawer.getYPosition(prevVal/this.summBarVal[j],this.valAx)*this.chartProp.pxToMM:nullPositionOX;startY=startBlockPosition;height=startBlockPosition-endBlockPosition; if(this.valAx.scaling.orientation!==ORIENTATION_MIN_MAX)height=-height}else{startY=nullPositionOX;if(this.valAx&&this.valAx.scaling.logBase)height=nullPositionOX-this.cChartDrawer.getYPosition(val,this.valAx)*this.chartProp.pxToMM;else height=nullPositionOX-this.cChartDrawer.getYPosition(val,this.valAx)*this.chartProp.pxToMM}return{startY:startY,height:height}},calculateParallalepiped:function(startX,startY,individualBarWidth,height,val,isValMoreZero,isValLessZero,i,idx,cubeCount,arr){var perspectiveDepth= this.cChartDrawer.processor3D.depthPerspective;var gapDepth=this.chart.gapDepth!=null?this.chart.gapDepth:globalGapDepth;if(this.subType==="standard")perspectiveDepth=perspectiveDepth/(gapDepth/100+1)/this.seriesCount;else perspectiveDepth=perspectiveDepth/(gapDepth/100+1);var DiffGapDepth=perspectiveDepth*(gapDepth/2)/100;if(this.subType==="standard")gapDepth=(perspectiveDepth+DiffGapDepth+DiffGapDepth)*i+DiffGapDepth;else gapDepth=DiffGapDepth;var x1=startX,y1=startY,z1=0+gapDepth;var x2=startX, y2=startY,z2=perspectiveDepth+gapDepth;var x3=startX+individualBarWidth,y3=startY,z3=perspectiveDepth+gapDepth;var x4=startX+individualBarWidth,y4=startY,z4=0+gapDepth;var x5=startX,y5=startY-height,z5=0+gapDepth;var x6=startX,y6=startY-height,z6=perspectiveDepth+gapDepth;var x7=startX+individualBarWidth,y7=startY-height,z7=perspectiveDepth+gapDepth;var x8=startX+individualBarWidth,y8=startY-height,z8=0+gapDepth;var point1=this.cChartDrawer._convertAndTurnPoint(x1,y1,z1);var point2=this.cChartDrawer._convertAndTurnPoint(x2, y2,z2);var point3=this.cChartDrawer._convertAndTurnPoint(x3,y3,z3);var point4=this.cChartDrawer._convertAndTurnPoint(x4,y4,z4);var point5=this.cChartDrawer._convertAndTurnPoint(x5,y5,z5);var point6=this.cChartDrawer._convertAndTurnPoint(x6,y6,z6);var point7=this.cChartDrawer._convertAndTurnPoint(x7,y7,z7);var point8=this.cChartDrawer._convertAndTurnPoint(x8,y8,z8);var points=[point1,point2,point3,point4,point5,point6,point7,point8];var paths=this.cChartDrawer.calculateRect3D(points,val,null,true); var point11=this.cChartDrawer._convertAndTurnPoint(x1,y1,z1,null,null,true);var point22=this.cChartDrawer._convertAndTurnPoint(x2,y2,z2,null,null,true);var point33=this.cChartDrawer._convertAndTurnPoint(x3,y3,z3,null,null,true);var point44=this.cChartDrawer._convertAndTurnPoint(x4,y4,z4,null,null,true);var point55=this.cChartDrawer._convertAndTurnPoint(x5,y5,z5,null,null,true);var point66=this.cChartDrawer._convertAndTurnPoint(x6,y6,z6,null,null,true);var point77=this.cChartDrawer._convertAndTurnPoint(x7, y7,z7,null,null,true);var point88=this.cChartDrawer._convertAndTurnPoint(x8,y8,z8,null,null,true);var arrPoints=[[point1,point4,point8,point5],[point1,point2,point3,point4],[point1,point2,point6,point5],[point4,point8,point7,point3],[point5,point6,point7,point8],[point6,point2,point3,point7]];var arrPoints2=[[point11,point44,point88,point55],[point11,point22,point33,point44],[point11,point22,point66,point55],[point44,point88,point77,point33],[point55,point66,point77,point88],[point66,point22,point33, point77]];if(!arr)arr=[];if(!arr[cubeCount])arr[cubeCount]={};if(!arr[cubeCount].faces){arr[cubeCount].faces=[];arr[cubeCount].arrPoints=[point11,point22,point33,point44,point55,point66,point77,point88];arr[cubeCount].z=point11.z;arr[cubeCount].y=point11.y}for(var k=0;k<paths.frontPaths.length;k++){if(null===paths.frontPaths[k]&&null===paths.darkPaths[k])continue;var plainEquation=this.cChartDrawer.getPlainEquation(arrPoints2[k][0],arrPoints2[k][1],arrPoints2[k][2],arrPoints2[k][3]);var plainArea= this.cChartDrawer.getAreaQuadrilateral(arrPoints[k][0],arrPoints[k][1],arrPoints[k][2],arrPoints[k][3]);arr[cubeCount].faces.push({seria:i,point:idx,verge:k,frontPaths:paths.frontPaths[k],darkPaths:paths.darkPaths[k],points:arrPoints2[k],points2:arrPoints[k],plainEquation:plainEquation,plainArea:plainArea})}return paths},_calculateSummStacked:function(j){if(!this.summBarVal[j]){var curVal;var temp=0;var idxPoint;for(var k=0;k<this.chart.series.length;k++){idxPoint=this.cChartDrawer.getIdxPoint(this.chart.series[k], j);curVal=idxPoint?parseFloat(idxPoint.val):0;if(curVal)temp+=Math.abs(curVal)}this.summBarVal[j]=temp}},_getStackedValue:function(series,i,j,val){var result=0,curVal,idxPoint;for(var k=0;k<=i;k++){idxPoint=this.cChartDrawer.getIdxPoint(this.chart.series[k],j);curVal=idxPoint?idxPoint.val:0;if(idxPoint&&val>=0&&curVal>0)result+=parseFloat(curVal);else if(idxPoint&&val<=0&&curVal<0)result+=parseFloat(curVal)}return result},_calculateDLbl:function(chartSpace,ser,val,bLayout,serIdx){var point=this.cChartDrawer.getIdxPoint(this.chart.series[ser], val);if(!this.paths.series[serIdx][val]||!point||!point.compiledDlb)return;var path=this.paths.series[serIdx][val];if(this.cChartDrawer.nDimensionCount===3)if(AscFormat.isRealNumber(path[0]))path=path[0];else if(AscFormat.isRealNumber(path[5]))path=path[5];else if(AscFormat.isRealNumber(path[2]))path=path[2];else if(AscFormat.isRealNumber(path[3]))path=path[3];else if(AscFormat.isRealNumber(path[1]))path=path[1];if(!AscFormat.isRealNumber(path))return;var oPath=this.cChartSpace.GetPath(path);var oCommand0= oPath.getCommandByIndex(0);var oCommand1=oPath.getCommandByIndex(1);var oCommand2=oPath.getCommandByIndex(2);var x=oCommand0.X;var y=oCommand0.Y;var h=oCommand0.Y-oCommand1.Y;var w=oCommand2.X-oCommand1.X;var pxToMm=this.chartProp.pxToMM;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var centerX,centerY;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.bestFit:{break}case c_oAscChartDataLabelsPos.ctr:{centerX=x+w/2-width/2;centerY=y-h/2-height/2;break}case c_oAscChartDataLabelsPos.inBase:{centerX= x+w/2-width/2;centerY=y;if(point.val>0)centerY=y-height;break}case c_oAscChartDataLabelsPos.inEnd:{centerX=x+w/2-width/2;centerY=y-h;if(point.val<0)centerY=centerY-height;break}case c_oAscChartDataLabelsPos.outEnd:{centerX=x+w/2-width/2;centerY=y-h-height;if(point.val<0)centerY=centerY+height;break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX=this.chartProp.widthCanvas/pxToMm-width;if(centerY<0)centerY=0;if(centerY+height>this.chartProp.heightCanvas/pxToMm)centerY= this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_calculateRect:function(x,y,w,h){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var pxToMm=this.chartProp.pxToMM;path.moveTo(x/pxToMm*pathW,y/pxToMm*pathH);path.lnTo(x/pxToMm*pathW,(y-h)/pxToMm*pathH);path.lnTo((x+w)/pxToMm*pathW,(y-h)/pxToMm*pathH);path.lnTo((x+w)/pxToMm*pathW,y/pxToMm*pathH);path.lnTo(x/pxToMm*pathW,y/pxToMm*pathH); return pathId},_DrawBars3D2:function(){var t=this;var processor3D=this.cChartDrawer.processor3D;var verges={front:0,down:1,left:2,right:3,up:4,unfront:5};var drawVerges=function(i,j,paths,onlyLessNull,start,stop){var brush,pen,options;options=t._getOptionsForDrawing(i,j,onlyLessNull);if(options!==null){pen=options.pen;brush=options.brush;for(var k=start;k<=stop;k++)t._drawBar3D(paths[k],pen,brush,k)}};var draw=function(onlyLessNull,start,stop){for(var i=0;i<t.sortZIndexPaths.length;i++)drawVerges(t.sortZIndexPaths[i].seria, t.sortZIndexPaths[i].point,t.sortZIndexPaths[i].paths,onlyLessNull,start,stop)};if(this.subType==="standard"){draw(true,verges.front,verges.unfront);draw(false,verges.front,verges.unfront)}else{draw(true,verges.down,verges.up);draw(false,verges.down,verges.up);draw(true,verges.unfront,verges.unfront);draw(false,verges.unfront,verges.unfront);draw(true,verges.front,verges.front);draw(false,verges.front,verges.front)}},_DrawBars3D:function(){var t=this;var drawVerges=function(i,j,paths,onlyLessNull, k,isNotPen,isNotBrush){var brush=null,pen=null,options;options=t._getOptionsForDrawing(i,j,onlyLessNull);if(paths!==null&&options!==null){if(!isNotPen)pen=options.pen;if(!isNotBrush)brush=options.brush;t._drawBar3D(paths,pen,brush,k,options.val)}};var index,faces,face;if(this.subType==="stacked"||this.subType==="stackedPer"){for(var i=0;i<this.sortParallelepipeds.length;i++){index=this.sortParallelepipeds[i].nextIndex;faces=this.temp[index].faces;for(var j=0;j<faces.length;j++){face=faces[j];drawVerges(face.seria, face.point,face.darkPaths,null,face.verge,null,true)}}for(var i=0;i<this.sortParallelepipeds.length;i++){index=this.sortParallelepipeds[i].nextIndex;faces=this.temp[index].faces;for(var j=0;j<faces.length;j++){face=faces[j];drawVerges(face.seria,face.point,face.frontPaths,null,face.verge)}}}else if("normal"===this.subType){for(var i=0;i<this.sortParallelepipeds.length;i++){index=this.sortParallelepipeds[i].nextIndex;faces=this.temp[index].faces;for(var j=0;j<faces.length;j++){face=faces[j];drawVerges(face.seria, face.point,face.darkPaths,null,face.verge,null,true)}}for(var i=0;i<this.sortParallelepipeds.length;i++){index=this.sortParallelepipeds[i].nextIndex;faces=this.temp[index].faces;for(var j=0;j<faces.length;j++){face=faces[j];drawVerges(face.seria,face.point,face.frontPaths,null,face.verge)}}}else{for(var i=0;i<this.sortZIndexPaths.length;i++)drawVerges(this.sortZIndexPaths[i].seria,this.sortZIndexPaths[i].point,this.sortZIndexPaths[i].paths,true,this.sortZIndexPaths[i].verge);for(var i=0;i<this.sortZIndexPaths.length;i++)drawVerges(this.sortZIndexPaths[i].seria, this.sortZIndexPaths[i].point,this.sortZIndexPaths[i].paths,false,this.sortZIndexPaths[i].verge)}},_getOptionsForDrawing:function(ser,point,onlyLessNull){var seria=this.chart.series[ser];var numCache=this.cChartDrawer.getNumCache(seria.val);if(!numCache)return null;var pt=numCache.getPtByIndex(point);if(!seria||!this.paths.series[ser]||!this.paths.series[ser][point]||!pt)return null;var brush=seria.brush;var pen=seria.pen;if(pt.val>0&&onlyLessNull===true||pt.val<0&&onlyLessNull===false)return null; if(pt.pen)pen=pt.pen;if(pt.brush)brush=pt.brush;return{pen:pen,brush:brush,val:pt.val}},_drawBar3D:function(path,pen,brush,k,val){if(null===pen||null!==pen&&null===pen.Fill||null!==pen&&null!==pen.Fill&&null===pen.Fill.fill)pen=AscFormat.CreatePenFromParams(brush,undefined,undefined,undefined,undefined,.1);if(k!==5&&k!==0){var props=this.cChartSpace.getParentObjects();var duplicateBrush=brush;if(null!==brush){duplicateBrush=brush.createDuplicate();var cColorMod=new AscFormat.CColorMod;if(k===1||k=== 4){if(duplicateBrush.fill&&AscDFH.historyitem_type_GradFill===duplicateBrush.fill.getObjectType()){var colors=duplicateBrush.fill.colors;var color;var valAxOrientation=this.valAx.scaling.orientation;if(val>0&&valAxOrientation===ORIENTATION_MIN_MAX||val<0&&valAxOrientation!==ORIENTATION_MIN_MAX)if(k===4&&colors&&colors[0]&&colors[0].color)color=colors[0].color;else{if(k===1&&colors[colors.length-1]&&colors[colors.length-1].color)color=colors[colors.length-1].color}else if(k===4&&colors&&colors[0]&& colors[0].color)color=colors[colors.length-1].color;else if(k===1&&colors[colors.length-1]&&colors[colors.length-1].color)color=colors[0].color;var tempColor=new AscFormat.CUniFill;tempColor.setFill(new AscFormat.CSolidFill);tempColor.fill.setColor(color);duplicateBrush=tempColor}cColorMod.val=45E3}else cColorMod.val=35E3;cColorMod.name="shade";duplicateBrush.addColorMod(cColorMod);duplicateBrush.calculate(props.theme,props.slide,props.layout,props.master,(new AscFormat.CUniColor).RGBA,this.cChartSpace.clrMapOvr); if(null===pen)pen.setFill(duplicateBrush)}this.cChartDrawer.drawPath(path,pen,duplicateBrush)}else this.cChartDrawer.drawPath(path,pen,brush)},_calculateRect3D:function(startX,startY,individualBarWidth,height,val,isValMoreZero,isValLessZero,serNum){var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var gapDepth=this.chart.gapDepth!=null?this.chart.gapDepth:globalGapDepth;if(this.subType==="standard")perspectiveDepth=perspectiveDepth/(gapDepth/100+1)/this.seriesCount;else perspectiveDepth= perspectiveDepth/(gapDepth/100+1);var DiffGapDepth=perspectiveDepth*(gapDepth/2)/100;if(this.subType==="standard")gapDepth=(perspectiveDepth+DiffGapDepth+DiffGapDepth)*serNum+DiffGapDepth;else gapDepth=DiffGapDepth;var x1=startX,y1=startY,z1=0+gapDepth;var x2=startX,y2=startY,z2=perspectiveDepth+gapDepth;var x3=startX+individualBarWidth,y3=startY,z3=perspectiveDepth+gapDepth;var x4=startX+individualBarWidth,y4=startY,z4=0+gapDepth;var x5=startX,y5=startY-height,z5=0+gapDepth;var x6=startX,y6=startY- height,z6=perspectiveDepth+gapDepth;var x7=startX+individualBarWidth,y7=startY-height,z7=perspectiveDepth+gapDepth;var x8=startX+individualBarWidth,y8=startY-height,z8=0+gapDepth;var point1=this.cChartDrawer._convertAndTurnPoint(x1,y1,z1);var point2=this.cChartDrawer._convertAndTurnPoint(x2,y2,z2);var point3=this.cChartDrawer._convertAndTurnPoint(x3,y3,z3);var point4=this.cChartDrawer._convertAndTurnPoint(x4,y4,z4);var point5=this.cChartDrawer._convertAndTurnPoint(x5,y5,z5);var point6=this.cChartDrawer._convertAndTurnPoint(x6, y6,z6);var point7=this.cChartDrawer._convertAndTurnPoint(x7,y7,z7);var point8=this.cChartDrawer._convertAndTurnPoint(x8,y8,z8);var isNotDrawDownVerge;var points=[point1,point2,point3,point4,point5,point6,point7,point8];var paths=this.cChartDrawer.calculateRect3D(points,val,isNotDrawDownVerge);height=this.chartProp.heightCanvas-this.chartProp.chartGutter._top-this.chartProp.chartGutter._bottom;var controlPoint1=this.cChartDrawer._convertAndTurnPoint(x1+individualBarWidth/2,y1-height/2,z1);var controlPoint2= this.cChartDrawer._convertAndTurnPoint(x1+individualBarWidth/2,y1,z1+perspectiveDepth/2);var controlPoint3=this.cChartDrawer._convertAndTurnPoint(x1,y1-height/2,z1+perspectiveDepth/2);var controlPoint4=this.cChartDrawer._convertAndTurnPoint(x4,y4-height/2,z4+perspectiveDepth/2);var controlPoint5=this.cChartDrawer._convertAndTurnPoint(x5+individualBarWidth/2,y5,z5+perspectiveDepth/2);var controlPoint6=this.cChartDrawer._convertAndTurnPoint(x2+individualBarWidth/2,y2-height/2,z2);var facePoints=[[point1, point5,point8,point4],[point1,point2,point3,point4],[point1,point2,point6,point5],[point4,point3,point7,point8],[point5,point6,point7,point8],[point2,point3,point7,point6]];var sortPaths=[controlPoint1,controlPoint2,controlPoint3,controlPoint4,controlPoint5,controlPoint6];return{paths:paths,x:point1.x,y:point1.y,zIndex:point1.z,sortPaths:sortPaths,facePoints:facePoints}}};function drawLineChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace= chartsDrawer.cChartSpace;this.chart=chart;this.catAx=null;this.valAx=null;this.ptCount=null;this.seriesCount=null;this.subType=null;this.paths={}}drawLineChart.prototype={constructor:drawLineChart,draw:function(){if(this.cChartDrawer.nDimensionCount===3)this._drawLines3D();else this._drawLines()},recalculate:function(){this.paths={};var countSeries=this.cChartDrawer.calculateCountSeries(this.chart);this.seriesCount=countSeries.series;this.ptCount=countSeries.points;this.subType=this.cChartDrawer.getChartGrouping(this.chart); this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_CatAx);if(!this.catAx)this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_DateAx);this.valAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_ValAx);this._calculateLines()},_calculateLines:function(){var xPoints=this.catAx.xPoints;var yPoints=this.valAx.yPoints;if(!xPoints||!yPoints)return;var points,y,x,val,seria,dataSeries,compiledMarkerSize,compiledMarkerSymbol, idx,numCache,idxPoint;for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i];numCache=this.cChartDrawer.getNumCache(seria.val);if(!numCache)continue;dataSeries=numCache.pts;for(var n=0;n<numCache.ptCount;n++){val=this._getYVal(n,i);x=this.catAx?this.cChartDrawer.getYPosition(n+1,this.catAx):xPoints[n].pos;y=this.cChartDrawer.getYPosition(val,this.valAx);if(!this.paths.points)this.paths.points=[];if(!this.paths.points[i])this.paths.points[i]=[];if(!points)points=[];if(!points[i])points[i]= [];idxPoint=this.cChartDrawer.getIdxPoint(seria,n);compiledMarkerSize=idxPoint&&idxPoint.compiledMarker&&idxPoint.compiledMarker.size?idxPoint.compiledMarker.size:null;compiledMarkerSymbol=idxPoint&&idxPoint.compiledMarker&&AscFormat.isRealNumber(idxPoint.compiledMarker.symbol)?idxPoint.compiledMarker.symbol:null;if(val!=null){this.paths.points[i][n]=this.cChartDrawer.calculatePoint(x,y,compiledMarkerSize,compiledMarkerSymbol);points[i][n]={x:x,y:y}}else{this.paths.points[i][n]=null;points[i][n]= null}}}this._calculateAllLines(points)},_calculateAllLines:function(points){if(!points)return;var xPoints=this.catAx.xPoints;var yPoints=this.valAx.yPoints;if(this.cChartDrawer.nDimensionCount===3){var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var seriaDiff=perspectiveDepth/this.seriesCount;var gapDepth=this.chart.gapDepth!=null?this.chart.gapDepth:globalGapDepth;var depthSeria=seriaDiff/(gapDepth/100+1);var DiffGapDepth=depthSeria*(gapDepth/100)/2;depthSeria=perspectiveDepth/ this.seriesCount-2*DiffGapDepth}var x,y,x1,y1,x2,y2,x3,y3,isSplineLine;for(var i=0;i<points.length;i++){isSplineLine=this.chart.series[i].smooth!==false;if(!points[i])continue;for(var n=0;n<points[i].length;n++){if(!this.paths.series)this.paths.series=[];if(!this.paths.series[i])this.paths.series[i]=[];if(points[i][n]!=null&&points[i][n+1]!=null)if(this.cChartDrawer.nDimensionCount===3){x=points[i][n].x*this.chartProp.pxToMM;y=points[i][n].y*this.chartProp.pxToMM;x1=points[i][n+1].x*this.chartProp.pxToMM; y1=points[i][n+1].y*this.chartProp.pxToMM;if(!this.paths.series)this.paths.series=[];if(!this.paths.series[i])this.paths.series[i]=[];var point1,point2,point3,point4,point5,point6,point7,point8,widthLine=.5;point1=this.cChartDrawer._convertAndTurnPoint(x,y-widthLine,DiffGapDepth+seriaDiff*i);point2=this.cChartDrawer._convertAndTurnPoint(x1,y1-widthLine,DiffGapDepth+seriaDiff*i);point3=this.cChartDrawer._convertAndTurnPoint(x1,y1-widthLine,DiffGapDepth+depthSeria+seriaDiff*i);point4=this.cChartDrawer._convertAndTurnPoint(x, y-widthLine,DiffGapDepth+depthSeria+seriaDiff*i);point5=this.cChartDrawer._convertAndTurnPoint(x,y+widthLine,DiffGapDepth+seriaDiff*i);point6=this.cChartDrawer._convertAndTurnPoint(x1,y1+widthLine,DiffGapDepth+seriaDiff*i);point7=this.cChartDrawer._convertAndTurnPoint(x1,y1+widthLine,DiffGapDepth+depthSeria+seriaDiff*i);point8=this.cChartDrawer._convertAndTurnPoint(x,y+widthLine,DiffGapDepth+depthSeria+seriaDiff*i);this.paths.series[i][n]=this.cChartDrawer.calculateRect3D([point1,point2,point3,point4, point5,point6,point7,point8])}else if(isSplineLine){x=points[i][n-1]?n-1:0;y=this._getYVal(x,i);x1=n;y1=this._getYVal(x1,i);x2=points[i][n+1]?n+1:n;y2=this._getYVal(x2,i);x3=points[i][n+2]?n+2:points[i][n+1]?n+1:n;y3=this._getYVal(x3,i);this.paths.series[i][n]=this.cChartDrawer.calculateSplineLine(x+1,y,x1+1,y1,x2+1,y2,x3+1,y3,this.catAx,this.valAx)}else this.paths.series[i][n]=this._calculateLine(points[i][n].x,points[i][n].y,points[i][n+1].x,points[i][n+1].y)}}},_calculateDLbl:function(chartSpace, ser,val){var point=this.cChartDrawer.getIdxPoint(this.chart.series[ser],val);var path;if(!point)return;var commandIndex=0;if(this.cChartDrawer.nDimensionCount===3){var curSer=this.paths.series[ser];if(val===curSer.length&&curSer[val-1]){if(AscFormat.isRealNumber(curSer[val-1][5]))path=curSer[val-1][5];else if(AscFormat.isRealNumber(curSer[val-1][2]))path=curSer[val-1][2];commandIndex=3}else if(curSer[val]&&AscFormat.isRealNumber(curSer[val][3]))path=curSer[val][3];else if(curSer[val]&&AscFormat.isRealNumber(curSer[val][2]))path= curSer[val][2]}else if(this.paths.points[ser]&&this.paths.points[ser][val])path=this.paths.points[ser][val].path;if(!AscFormat.isRealNumber(path))return;var oPath=this.cChartSpace.GetPath(path);var oCommand0=oPath.getCommandByIndex(commandIndex);var x=oCommand0.X;var y=oCommand0.Y;var pxToMm=this.chartProp.pxToMM;var constMargin=5/pxToMm;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var centerX=x-width/2;var centerY=y-height/2;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.b:{centerY= centerY+height/2+constMargin;break}case c_oAscChartDataLabelsPos.bestFit:{break}case c_oAscChartDataLabelsPos.ctr:{break}case c_oAscChartDataLabelsPos.l:{centerX=centerX-width/2-constMargin;break}case c_oAscChartDataLabelsPos.r:{centerX=centerX+width/2+constMargin;break}case c_oAscChartDataLabelsPos.t:{centerY=centerY-height/2-constMargin;break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX=this.chartProp.widthCanvas/pxToMm-width;if(centerY<0)centerY=0;if(centerY+ height>this.chartProp.heightCanvas/pxToMm)centerY=this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_drawLines:function(){var diffPen=3;var leftRect=this.chartProp.chartGutter._left/this.chartProp.pxToMM;var topRect=(this.chartProp.chartGutter._top-diffPen)/this.chartProp.pxToMM;var rightRect=this.chartProp.trueWidth/this.chartProp.pxToMM;var bottomRect=(this.chartProp.trueHeight+diffPen)/this.chartProp.pxToMM;this.cChartDrawer.cShapeDrawer.Graphics.SaveGrState();this.cChartDrawer.cShapeDrawer.Graphics.AddClipRect(leftRect, topRect,rightRect,bottomRect);this.cChartDrawer.drawPaths(this.paths,this.chart.series,true);this.cChartDrawer.cShapeDrawer.Graphics.RestoreGrState();this.cChartDrawer.drawPathsPoints(this.paths,this.chart.series)},_getYVal:function(n,i){var tempVal;var val=0;var idxPoint;var k;if(this.subType==="stacked")for(k=0;k<=i;k++){idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[k],n);tempVal=idxPoint?parseFloat(idxPoint.val):0;if(tempVal)val+=tempVal}else if(this.subType==="stackedPer"){var sumVal= 0;for(k=0;k<this.chart.series.length;k++){idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[k],n);tempVal=idxPoint?parseFloat(idxPoint.val):0;if(tempVal){if(k<=i)val+=tempVal;sumVal+=Math.abs(tempVal)}}if(sumVal===0)val=0;else val=val/sumVal}else{idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[i],n);var dispBlanksAs=this.cChartSpace.chart.dispBlanksAs;if(idxPoint)val=parseFloat(idxPoint.val);else if(dispBlanksAs===AscFormat.DISP_BLANKS_AS_ZERO)val=0;else val=null}return val}, _calculateLine:function(x,y,x1,y1){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo(x*pathW,y*pathH);path.lnTo(x1*pathW,y1*pathH);return pathId},_calculateSplineLine2:function(x,y,x1,y1,x2,y2,x3,y3,xPoints,yPoints){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var splineCoords=this.cChartDrawer.calculate_Bezier(x, y,x1,y1,x2,y2,x3,y3);x=this.cChartDrawer.getYPosition(splineCoords[0].x,this.catAx);y=this.cChartDrawer.getYPosition(splineCoords[0].y,this.valAx);x1=this.cChartDrawer.getYPosition(splineCoords[1].x,this.catAx);y1=this.cChartDrawer.getYPosition(splineCoords[1].y,this.valAx);x2=this.cChartDrawer.getYPosition(splineCoords[2].x,this.catAx);y2=this.cChartDrawer.getYPosition(splineCoords[2].y,this.valAx);x3=this.cChartDrawer.getYPosition(splineCoords[3].x,this.catAx);y3=this.cChartDrawer.getYPosition(splineCoords[3].y, this.valAx);path.moveTo(x*pathW,y*pathH);path.cubicBezTo(x1*pathW,y1*pathH,x2*pathW,y2*pathH,x3*pathW,y3*pathH);return pathId},_drawLines3D:function(){var t=this;var drawVerges=function(j,i){var brush,pen,seria;seria=t.chart.series[j];brush=seria.brush;pen=seria.pen;if(!(!t.paths.series[j]||!t.paths.series[j][i]||!seria.val.numRef.numCache.pts[i])){if(seria.val.numRef.numCache&&seria.val.numRef.numCache.pts[i].pen)pen=seria.val.numRef.numCache.pts[i].pen;if(seria.val.numRef.numCache&&seria.val.numRef.numCache.pts[i].brush)brush= seria.val.numRef.numCache.pts[i].brush;for(var k=0;k<t.paths.series[j][i].length;k++)t._drawLine3D(t.paths.series[j][i][k],pen,brush,k)}};var onSeries=function(onlyLessNull){var drawNeedVerge=function(){for(var j=0;j<t.paths.series.length;j++)for(var i=0;i<t.ptCount;i++)drawVerges(j,i,onlyLessNull)};drawNeedVerge()};var reverseSeriesOnSeries=function(onlyLessNull){var drawNeedVerge=function(){for(var j=t.paths.series.length-1;j>=0;j--){if(!t.paths.series)return;for(var i=0;i<t.ptCount;i++)drawVerges(j, i,onlyLessNull)}};drawNeedVerge()};if(!this.cChartDrawer.processor3D.view3D.getRAngAx()){var angle=Math.abs(this.cChartDrawer.processor3D.angleOy);if(angle>Math.PI/2&&angle<3*Math.PI/2)onSeries();else reverseSeriesOnSeries()}else reverseSeriesOnSeries()},_drawLine3D:function(path,pen,brush,k){if(k!==2){var props=this.cChartSpace.getParentObjects();var duplicateBrush=brush.createDuplicate();var cColorMod=new AscFormat.CColorMod;cColorMod.name="shade";if(k===1||k===4)cColorMod.val=45E3;else cColorMod.val= 35E3;this._addColorMods(cColorMod,duplicateBrush);duplicateBrush.calculate(props.theme,props.slide,props.layout,props.master,(new AscFormat.CUniColor).RGBA,this.cChartSpace.clrMapOvr);pen=AscFormat.CreatePenFromParams(duplicateBrush,undefined,undefined,undefined,undefined,.1);this.cChartDrawer.drawPath(path,pen,duplicateBrush)}else{pen=AscFormat.CreatePenFromParams(brush,undefined,undefined,undefined,undefined,.1);this.cChartDrawer.drawPath(path,pen,brush)}},_addColorMods:function(cColorMod,duplicateBrush){if(duplicateBrush)duplicateBrush.addColorMod(cColorMod)}}; function drawAreaChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace;this.chart=chart;this.catAx=null;this.valAx=null;this.ptCount=null;this.seriesCount=null;this.subType=null;this.points=null;this.paths={};this.upFaces=[];this.downFaces=[];this.sortZIndexPaths=[];this.sortZIndexPathsFront=[];this.sortZIndexPathsBack=[];this.sortZIndexPathsRight=[];this.sortZIndexPathsLeft=[];this.intersections=[];this.intersectionsFar= [];this.xPoints=null;this.yPoints=null;this.darkFaces=null;this.gapDepth=null;this.perspectiveDepth=null}drawAreaChart.prototype={constructor:drawAreaChart,draw:function(){if(this.cChartDrawer.nDimensionCount===3)this._drawBars3D();else this._drawLines()},recalculate:function(){this.paths={};this.points=null;var countSeries=this.cChartDrawer.calculateCountSeries(this.chart);this.seriesCount=countSeries.series;this.ptCount=countSeries.points;this.subType=this.cChartDrawer.getChartGrouping(this.chart); this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_CatAx);if(!this.catAx)this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_DateAx);this.valAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_ValAx);this._calculateProps();this._calculate()},_calculateProps:function(){if(this.cChartDrawer.nDimensionCount===3){var gapDepth=this.chart.gapDepth!=null?this.chart.gapDepth:globalGapDepth;var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective; perspectiveDepth=this.subType==="normal"?perspectiveDepth/(gapDepth/100+1)/this.seriesCount:perspectiveDepth/(gapDepth/100+1);var DiffGapDepth=perspectiveDepth*(gapDepth/2)/100;this.perspectiveDepth=perspectiveDepth;if(this.subType==="normal"){this.gapDepth=[];for(var i=0;i<this.seriesCount;i++)this.gapDepth[i]=(this.perspectiveDepth+DiffGapDepth+DiffGapDepth)*i+DiffGapDepth}else this.gapDepth=DiffGapDepth}this.xPoints=this.catAx.xPoints;this.yPoints=this.valAx.yPoints},_calculate:function(){var y, x,val,seria,dataSeries,numCache;var pxToMm=this.chartProp.pxToMM;var nullPositionOX=this.catAx.posY;for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i];numCache=this.cChartDrawer.getNumCache(seria.val);if(!numCache)continue;dataSeries=numCache.pts;for(var n=0;n<numCache.ptCount;n++){val=this._getYVal(n,i);if(null===val&&this.cChartDrawer.nDimensionCount!==3)continue;x=this.xPoints[n].pos;y=this.cChartDrawer.getYPosition(val,this.valAx);if(!this.points)this.points=[];if(!this.points[i])this.points[i]= [];if(val!=null)this.points[i][n]={x:x,y:y,val:val};else this.points[i][n]={x:x,y:nullPositionOX,val:val}}if(this.cChartDrawer.nDimensionCount===3)if(this.subType==="normal")this._calculateDarkSideOfTheFace(i);else if(this.darkFaces===null)this._calculateDarkSideOfTheFace(null)}if(this.cChartDrawer.nDimensionCount===3){this._calculatePaths3D();var upDownFaces=this.upFaces.concat(this.downFaces);var angle=this.cChartDrawer.processor3D.angleOx;if(angle<0)upDownFaces.sort(function sortArr(a,b){if(b.midY=== a.midY)return a.seria-b.seria;else return b.midY-a.midY});else upDownFaces.sort(function sortArr(a,b){if(b.midY===a.midY)return a.seria-b.seria;else return a.midY-b.midY});var anotherFaces=this.sortZIndexPathsFront.concat(this.sortZIndexPathsBack).concat(this.sortZIndexPathsLeft).concat(this.sortZIndexPathsRight);this.sortZIndexPaths=upDownFaces.concat(anotherFaces)}else this._calculatePaths()},_calculatePaths:function(){var points=this.points;var prevPoints;var isStacked=this.subType==="stackedPer"|| this.subType==="stacked";for(var i=0;i<points.length;i++){if(!this.paths.series)this.paths.series=[];prevPoints=isStacked?this._getPrevSeriesPoints(points,i):null;if(points[i])this.paths.series[i]=this._calculateLine(points[i],prevPoints)}},_calculatePaths3D:function(){var points=this.points;var prevPoints;var isStacked=this.subType==="stackedPer"||this.subType==="stacked";if(isStacked)this._calculateAllIntersection();for(var i=0;i<points.length;i++){if(!this.paths.series)this.paths.series=[];prevPoints= isStacked?this._getPrevSeriesPoints(points,i):null;if(points[i])if(isStacked)this.paths.series[i]=this._calculateStacked3D(prevPoints,i,points);else this.paths.series[i]=this._calculateLine3D(points[i],i,points)}},_calculateLine:function(points,prevPoints){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var point;var pxToMm=this.chartProp.pxToMM;var nullPositionOX=this.catAx.posY*this.chartProp.pxToMM; if(this.subType==="stacked"||this.subType==="stackedPer"){var pointsLength=points.length;for(var i=0;i<pointsLength;i++){point=points[i];if(!point);else if(i===0)path.moveTo(point.x*pathW,point.y*pathH);else path.lnTo(point.x*pathW,point.y*pathH)}if(prevPoints!=null&&pointsLength)for(var i=pointsLength-1;i>=0;i--){point=prevPoints[i];path.lnTo(point.x*pathW,point.y*pathH);if(i===0)path.lnTo(points[0].x*pathW,points[0].y*pathH)}else{path.lnTo(points[points.length-1].x*pathW,nullPositionOX/pxToMm*pathH); path.lnTo(points[0].x*pathW,nullPositionOX/pxToMm*pathH);path.lnTo(points[0].x*pathW,points[0].y*pathH)}}else{var startSegmentPoint;for(var i=0;i<points.length;i++){point=points[i];if(!point){if(startSegmentPoint){path.lnTo(points[i-1].x*pathW,nullPositionOX/pxToMm*pathH);path.lnTo(startSegmentPoint.x*pathW,nullPositionOX/pxToMm*pathH);path.lnTo(startSegmentPoint.x*pathW,startSegmentPoint.y*pathH)}startSegmentPoint=null}else{if(!startSegmentPoint){startSegmentPoint=point;path.moveTo(point.x*pathW, nullPositionOX/pxToMm*pathH)}path.lnTo(point.x*pathW,point.y*pathH)}if(i===points.length-1&&point)if(startSegmentPoint){path.lnTo(point.x*pathW,nullPositionOX/pxToMm*pathH);path.lnTo(startSegmentPoint.x*pathW,nullPositionOX/pxToMm*pathH);path.lnTo(startSegmentPoint.x*pathW,startSegmentPoint.y*pathH)}}}return pathId},_calculateLine3D:function(points,seriaNum){var pointsIn3D=[],t=this,pxToMm=this.chartProp.pxToMM;var nullPosition=this.catAx.posY*this.chartProp.pxToMM;var gapDepth=this.gapDepth[seriaNum]; var getProjectPoints=function(currentZ,startN){pointsIn3D[startN]=[];pointsIn3D[startN+1]=[];for(var i=0;i<points.length;i++){pointsIn3D[startN][i]=t.cChartDrawer._convertAndTurnPoint(points[i].x*pxToMm,points[i].y*pxToMm,currentZ+gapDepth);pointsIn3D[startN+1][i]=t.cChartDrawer._convertAndTurnPoint(points[i].x*pxToMm,nullPosition,currentZ+gapDepth)}};var zNear=0;var zFar=this.perspectiveDepth;getProjectPoints(zNear,0);getProjectPoints(zFar,2);return this._calculateRect3D(pointsIn3D,seriaNum)},_calculateStacked3D:function(prevPoints, seria,allPoints){var points=allPoints[seria];var t=this,nullPositionOX=this.catAx.posY*this.chartProp.pxToMM,pxToMm=this.chartProp.pxToMM,res=[];for(var i=0;i<points.length-1;i++){var x=points[i].x*pxToMm;var y=points[i].y*pxToMm;var x1=points[i+1].x*pxToMm;var y1=points[i+1].y*pxToMm;var prevX=prevPoints?prevPoints[i].x*pxToMm:x;var prevY=prevPoints?prevPoints[i].y*pxToMm:nullPositionOX;var prevX1=prevPoints?prevPoints[i+1].x*pxToMm:x1;var prevY1=prevPoints?prevPoints[i+1].y*pxToMm:nullPositionOX; if(prevY<y&&prevY1<y1){var temp=y;y=prevY;prevY=temp;var temp1=y1;y1=prevY1;prevY1=temp1;temp=x;x=prevX;prevX=temp;temp1=x1;x1=prevX1;prevX1=temp1}if(!this.prevPoints)this.prevPoints=[];if(!this.prevPoints[i])this.prevPoints[i]=[];var p1={x:x,y:y,z:this.gapDepth};var p2={x:x,y:y,z:this.gapDepth+this.perspectiveDepth};var p3={x:x1,y:y1,z:this.gapDepth+this.perspectiveDepth};var p4={x:x1,y:y1,z:this.gapDepth};var p5={x:prevX,y:prevY,z:this.gapDepth};var p6={x:prevX,y:prevY,z:this.gapDepth+this.perspectiveDepth}; var p7={x:prevX1,y:prevY1,z:this.gapDepth+this.perspectiveDepth};var p8={x:prevX1,y:prevY1,z:this.gapDepth};var arrNotRotatePoints=[p1,p2,p3,p4,p5,p6,p7,p8];var point11=t.cChartDrawer._convertAndTurnPoint(p1.x,p1.y,p1.z,null,null,true);var point22=t.cChartDrawer._convertAndTurnPoint(p2.x,p2.y,p2.z,null,null,true);var point33=t.cChartDrawer._convertAndTurnPoint(p3.x,p3.y,p3.z,null,null,true);var point44=t.cChartDrawer._convertAndTurnPoint(p4.x,p4.y,p4.z,null,null,true);var point55=t.cChartDrawer._convertAndTurnPoint(p5.x, p5.y,p5.z,null,null,true);var point66=t.cChartDrawer._convertAndTurnPoint(p6.x,p6.y,p6.z,null,null,true);var point77=t.cChartDrawer._convertAndTurnPoint(p7.x,p7.y,p7.z,null,null,true);var point88=t.cChartDrawer._convertAndTurnPoint(p8.x,p8.y,p8.z,null,null,true);var arrPoints=[point11,point22,point33,point44,point55,point66,point77,point88];var point1=t.cChartDrawer._convertAndTurnPoint(p1.x,p1.y,p1.z);var point2=t.cChartDrawer._convertAndTurnPoint(p2.x,p2.y,p2.z);var point3=t.cChartDrawer._convertAndTurnPoint(p3.x, p3.y,p3.z);var point4=t.cChartDrawer._convertAndTurnPoint(p4.x,p4.y,p4.z);var point5=t.cChartDrawer._convertAndTurnPoint(p5.x,p5.y,p5.z);var point6=t.cChartDrawer._convertAndTurnPoint(p6.x,p6.y,p6.z);var point7=t.cChartDrawer._convertAndTurnPoint(p7.x,p7.y,p7.z);var point8=t.cChartDrawer._convertAndTurnPoint(p8.x,p8.y,p8.z);var arrPointsProject=[point1,point2,point3,point4,point5,point6,point7,point8];var paths=this._calculateRect3DStacked(arrPoints,arrPointsProject,arrNotRotatePoints,i,seria);res.push(paths)}return res}, _calculateDarkSideOfTheFace:function(seria){var pxToMm=this.chartProp.pxToMM;var minX=this.xPoints[0].pos<this.xPoints[this.xPoints.length-1].pos?this.xPoints[0].pos*pxToMm:this.xPoints[this.xPoints.length-1].pos*pxToMm;var maxX=this.xPoints[0].pos<this.xPoints[this.xPoints.length-1].pos?this.xPoints[this.xPoints.length-1].pos*pxToMm:this.xPoints[0].pos*pxToMm;var minValue=this.valAx.min;var maxValue=this.valAx.max;if(this.subType==="stackedPer"){minValue=minValue/100;maxValue=maxValue/100}var maxY= this.cChartDrawer.getYPosition(minValue,this.valAx)*pxToMm;var minY=this.cChartDrawer.getYPosition(maxValue,this.valAx)*pxToMm;var gapDepth=seria===null?this.gapDepth:this.gapDepth[seria];var point1=this.cChartDrawer._convertAndTurnPoint(minX,maxY,gapDepth);var point2=this.cChartDrawer._convertAndTurnPoint(minX,maxY,gapDepth+this.perspectiveDepth);var point3=this.cChartDrawer._convertAndTurnPoint(maxX,maxY,gapDepth+this.perspectiveDepth);var point4=this.cChartDrawer._convertAndTurnPoint(maxX,maxY, gapDepth);var point5=this.cChartDrawer._convertAndTurnPoint(minX,minY,gapDepth);var point6=this.cChartDrawer._convertAndTurnPoint(minX,minY,gapDepth+this.perspectiveDepth);var point7=this.cChartDrawer._convertAndTurnPoint(maxX,minY,gapDepth+this.perspectiveDepth);var point8=this.cChartDrawer._convertAndTurnPoint(maxX,minY,gapDepth);var darkFaces;if(seria===null){this.darkFaces={};darkFaces=this.darkFaces}else{if(null===this.darkFaces)this.darkFaces=[];this.darkFaces[seria]={};darkFaces=this.darkFaces[seria]}darkFaces["front"]= null;if(this._isVisibleVerge3D(point5,point1,point4))darkFaces["front"]=1;darkFaces["down"]=null;if(this._isVisibleVerge3D(point4,point1,point2))darkFaces["down"]=1;darkFaces["left"]=null;if(this._isVisibleVerge3D(point2,point1,point5))darkFaces["left"]=1;darkFaces["right"]=null;if(this._isVisibleVerge3D(point8,point4,point3))darkFaces["right"]=1;darkFaces["up"]=null;if(this._isVisibleVerge3D(point6,point5,point8))darkFaces["up"]=1;darkFaces["unfront"]=null;if(this._isVisibleVerge3D(point3,point2, point6))darkFaces["unfront"]=1},_calculateRect3D:function(pointsIn3D,seriaNum){var path,pathId;var pxToMm=this.chartProp.pxToMM;var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var oThis=this;var calculateFace=function(number,isReverse,isFirstPoint){if(!isReverse)for(var i=0;i<pointsIn3D[number].length;i++)if(i===0&&isFirstPoint)path.moveTo(pointsIn3D[number][i].x/pxToMm*pathW,pointsIn3D[number][i].y/pxToMm*pathH);else path.lnTo(pointsIn3D[number][i].x/pxToMm*pathW,pointsIn3D[number][i].y/ pxToMm*pathH);else for(var i=pointsIn3D[number].length-1;i>=0;i--)if(i===pointsIn3D[number].length-1&&isFirstPoint)path.moveTo(pointsIn3D[number][i].x/pxToMm*pathW,pointsIn3D[number][i].y/pxToMm*pathH);else path.lnTo(pointsIn3D[number][i].x/pxToMm*pathW,pointsIn3D[number][i].y/pxToMm*pathH)};var calculateRect=function(p1,p2,p3,p4){var pathId=oThis.cChartSpace.AllocPath();var path=oThis.cChartSpace.GetPath(pathId);path.moveTo(p1.x/pxToMm*pathW,p1.y/pxToMm*pathH);path.lnTo(p2.x/pxToMm*pathW,p2.y/pxToMm* pathH);path.lnTo(p3.x/pxToMm*pathW,p3.y/pxToMm*pathH);path.lnTo(p4.x/pxToMm*pathW,p4.y/pxToMm*pathH);path.lnTo(p1.x/pxToMm*pathW,p1.y/pxToMm*pathH);return pathId};var calculateUpDownFace=function(isDown){var arrayPaths=[];for(var i=0;i<pointsIn3D[0].length-1;i++){var point1Up=pointsIn3D[0][i];var point2Up=pointsIn3D[0][i+1];var point1UpFar=pointsIn3D[2][i];var point2UpFar=pointsIn3D[2][i+1];var point1Down=pointsIn3D[1][i];var point2Down=pointsIn3D[1][i+1];var point1DownFar=pointsIn3D[3][i];var point2DownFar= pointsIn3D[3][i+1];var path=null;if(!isDown)if(point1Up.y>point1Down.y&&point2Up.y<point2Down.y){path=calculateRect(point1Up,point1UpFar,point2UpFar,point2Up);arrayPaths.push(path);path=calculateRect(point1Down,point1DownFar,point2DownFar,point2Down);arrayPaths.push(path)}else if(point1Up.y<point1Down.y&&point2Up.y>point2Down.y){path=calculateRect(point1Down,point1DownFar,point2DownFar,point2Down);arrayPaths.push(path);path=calculateRect(point1Up,point1UpFar,point2UpFar,point2Up);arrayPaths.push(path)}else{path= calculateRect(point1Up,point1UpFar,point2UpFar,point2Up);arrayPaths.push(path)}else if(point1Up.y>point1Down.y&&point2Up.y<point2Down.y){path=calculateRect(point1Up,point1UpFar,point2UpFar,point2Up);arrayPaths.push(path);path=calculateRect(point1Down,point1DownFar,point2DownFar,point2Down);arrayPaths.push(path)}else if(point1Up.y<point1Down.y&&point2Up.y>point2Down.y){path=calculateRect(point1Up,point1UpFar,point2UpFar,point2Up);arrayPaths.push(path);path=calculateRect(point1Down,point1DownFar,point2DownFar, point2Down);arrayPaths.push(path)}else{path=calculateRect(point1Down,point1DownFar,point2DownFar,point2Down);arrayPaths.push(path)}}return arrayPaths};var paths=[];var upNear=0,downNear=1,upFar=2,downFar=3;var point1=pointsIn3D[downNear][0];var point2=pointsIn3D[downFar][0];var point3=pointsIn3D[downFar][pointsIn3D[downFar].length-1];var point4=pointsIn3D[downNear][pointsIn3D[downNear].length-1];var point5=pointsIn3D[upNear][0];var point6=pointsIn3D[upFar][0];var point7=pointsIn3D[upFar][pointsIn3D[upFar].length- 1];var point8=pointsIn3D[upNear][pointsIn3D[upNear].length-1];paths[0]=null;if(this.darkFaces[seriaNum]["front"]){pathId=this.cChartSpace.AllocPath();path=this.cChartSpace.GetPath(pathId);calculateFace(upNear,false,true);calculateFace(downNear,true);path.lnTo(point5.x/pxToMm*pathW,point5.y/pxToMm*pathH);paths[0]=pathId}paths[1]=null;var arrayPaths=calculateUpDownFace(true);paths[1]=arrayPaths;paths[2]=null;if(this.darkFaces[seriaNum]["left"]){arrayPaths=calculateRect(pointsIn3D[0][0],pointsIn3D[1][0], pointsIn3D[3][0],pointsIn3D[2][0]);paths[2]=arrayPaths}paths[3]=null;if(this.darkFaces[seriaNum]["right"]){arrayPaths=calculateRect(pointsIn3D[0][pointsIn3D[0].length-1],pointsIn3D[1][pointsIn3D[1].length-1],pointsIn3D[3][pointsIn3D[3].length-1],pointsIn3D[2][pointsIn3D[2].length-1]);paths[3]=arrayPaths}paths[4]=null;arrayPaths=calculateUpDownFace();paths[4]=arrayPaths;paths[5]=null;if(this.darkFaces[seriaNum]["unfront"]){pathId=this.cChartSpace.AllocPath();path=this.cChartSpace.GetPath(pathId);calculateFace(upFar, false,true);calculateFace(downFar,true);path.lnTo(pointsIn3D[upFar][0].x/pxToMm*pathW,pointsIn3D[upFar][0].y/pxToMm*pathH);paths[5]=pathId}return paths},_calculateRect3DStacked:function(arrPoints,arrPointsProject,arrNotRotatePoints,point,seria){var pxToMm=this.chartProp.pxToMM,t=this;var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var p1=arrNotRotatePoints[0];var p2=arrNotRotatePoints[1];var p3=arrNotRotatePoints[2];var p4=arrNotRotatePoints[3];var p5=arrNotRotatePoints[4];var p6=arrNotRotatePoints[5]; var p7=arrNotRotatePoints[6];var p8=arrNotRotatePoints[7];var point1=arrPointsProject[0];var point2=arrPointsProject[1];var point3=arrPointsProject[2];var point4=arrPointsProject[3];var point5=arrPointsProject[4];var point6=arrPointsProject[5];var point7=arrPointsProject[6];var point8=arrPointsProject[7];var point11=arrPoints[0];var point22=arrPoints[1];var point33=arrPoints[2];var point44=arrPoints[3];var point55=arrPoints[4];var point66=arrPoints[5];var point77=arrPoints[6];var point88=arrPoints[7]; var oThis=this;var generateFace=function(p11,p22,p33,p44,p111,p222,p333,p444,p1111,p2222,p3333,p4444,faceIndex,ser){if(ser===undefined)ser=seria;var pathId=oThis.cChartSpace.AllocPath();var path=oThis.cChartSpace.GetPath(pathId);path.moveTo(p11.x/pxToMm*pathW,p11.y/pxToMm*pathH);path.lnTo(p22.x/pxToMm*pathW,p22.y/pxToMm*pathH);path.lnTo(p33.x/pxToMm*pathW,p33.y/pxToMm*pathH);path.lnTo(p44.x/pxToMm*pathW,p44.y/pxToMm*pathH);path.lnTo(p11.x/pxToMm*pathW,p11.y/pxToMm*pathH);var arrPoints=[p11,p22,p33, p44];var arrPoints2=[p111,p222,p333,p444];var plainEquation=t.cChartDrawer.getPlainEquation(p111,p222,p333);var plainArea=t.cChartDrawer.getAreaQuadrilateral(p11,p22,p33,p44);var arrPointsNotRotate=[p1111,p2222,p3333,p4444];var midY=(p1111.y+p2222.y+p3333.y+p4444.y)/4;return{seria:ser,point:0,verge:faceIndex,paths:pathId,points:arrPoints2,points2:arrPoints,plainEquation:plainEquation,plainArea:plainArea,arrPointsNotRotate:arrPointsNotRotate,midY:midY}};this._calculateSimpleRect(arrPoints,arrPointsProject, point,seria);var breakFaces=this.intersections[point]&&this.intersections[point][seria]?this.intersections[point][seria]:null;if(breakFaces&&breakFaces.up&&breakFaces.up.length){breakFaces.up=breakFaces.up.sort(function sortArr(a,b){return a.x-b.x});var prevNear,prevFar,prevNearProject,prevFarProject,prevNotRotateNear,prevNotRotateFar,prevPoint;var near,far,nearProject,farProject,notRotateNear,notRotateFar,face;for(var i=0;i<breakFaces.up.length-1;i++){prevPoint=breakFaces.up[i];prevNearProject=t.cChartDrawer._convertAndTurnPoint(prevPoint.x, prevPoint.y,this.gapDepth);prevFarProject=t.cChartDrawer._convertAndTurnPoint(prevPoint.x,prevPoint.y,this.gapDepth+this.perspectiveDepth);prevNear=t.cChartDrawer._convertAndTurnPoint(prevPoint.x,prevPoint.y,this.gapDepth,null,null,true);prevFar=t.cChartDrawer._convertAndTurnPoint(prevPoint.x,prevPoint.y,this.gapDepth+this.perspectiveDepth,null,null,true);prevNotRotateNear={x:prevPoint.x,y:prevPoint.y,z:this.gapDepth};prevNotRotateFar={x:prevPoint.x,y:prevPoint.y,z:this.gapDepth+this.perspectiveDepth}; point=breakFaces.up[i+1];nearProject=t.cChartDrawer._convertAndTurnPoint(point.x,point.y,this.gapDepth);farProject=t.cChartDrawer._convertAndTurnPoint(point.x,point.y,this.gapDepth+this.perspectiveDepth);near=t.cChartDrawer._convertAndTurnPoint(point.x,point.y,this.gapDepth,null,null,true);far=t.cChartDrawer._convertAndTurnPoint(point.x,point.y,this.gapDepth+this.perspectiveDepth,null,null,true);notRotateNear={x:point.x,y:point.y,z:this.gapDepth};notRotateFar={x:point.x,y:point.y,z:this.gapDepth+ this.perspectiveDepth};face=generateFace(prevNearProject,prevFarProject,farProject,nearProject,prevNear,prevFar,far,near,prevNotRotateNear,prevNotRotateFar,notRotateNear,notRotateFar,1);this.upFaces.push(face)}}if(breakFaces&&breakFaces.down&&breakFaces.down.length){breakFaces.down=breakFaces.down.sort(function sortArr(a,b){return a.x-b.x});for(var i=0;i<breakFaces.down.length-1;i++){prevPoint=breakFaces.down[i];prevNearProject=t.cChartDrawer._convertAndTurnPoint(prevPoint.x,prevPoint.y,this.gapDepth); prevFarProject=t.cChartDrawer._convertAndTurnPoint(prevPoint.x,prevPoint.y,this.gapDepth+this.perspectiveDepth);prevNear=t.cChartDrawer._convertAndTurnPoint(prevPoint.x,prevPoint.y,this.gapDepth,null,null,true);prevFar=t.cChartDrawer._convertAndTurnPoint(prevPoint.x,prevPoint.y,this.gapDepth+this.perspectiveDepth,null,null,true);prevNotRotateNear={x:prevPoint.x,y:prevPoint.y,z:this.gapDepth};prevNotRotateFar={x:prevPoint.x,y:prevPoint.y,z:this.gapDepth+this.perspectiveDepth};point=breakFaces.down[i+ 1];nearProject=t.cChartDrawer._convertAndTurnPoint(point.x,point.y,this.gapDepth);farProject=t.cChartDrawer._convertAndTurnPoint(point.x,point.y,this.gapDepth+this.perspectiveDepth);near=t.cChartDrawer._convertAndTurnPoint(point.x,point.y,this.gapDepth,null,null,true);far=t.cChartDrawer._convertAndTurnPoint(point.x,point.y,this.gapDepth+this.perspectiveDepth,null,null,true);notRotateNear={x:point.x,y:point.y,z:this.gapDepth};notRotateFar={x:point.x,y:point.y,z:this.gapDepth+this.perspectiveDepth}; face=generateFace(prevNearProject,prevFarProject,farProject,nearProject,prevNear,prevFar,far,near,prevNotRotateNear,prevNotRotateFar,notRotateNear,notRotateFar,1);this.downFaces.push(face)}}else{face=generateFace(point1,point2,point3,point4,point11,point22,point33,point44,p1,p2,p3,p4,1);this.downFaces.push(face)}return[]},_calculateAllIntersection:function(){var allPoints=this.points;var prevPoints;var nullPositionOX=this.catAx.posY*this.chartProp.pxToMM;var pxToMm=this.chartProp.pxToMM;for(var seria= 0;seria<allPoints.length;seria++){var points=allPoints[seria];if(!points)continue;for(var i=0;i<points.length-1;i++){var x=points[i].x*pxToMm;var y=points[i].y*pxToMm;var x1=points[i+1].x*pxToMm;var y1=points[i+1].y*pxToMm;prevPoints=this._getPrevSeriesPoints(allPoints,seria);var prevX=prevPoints?prevPoints[i].x*pxToMm:x;var prevY=prevPoints?prevPoints[i].y*pxToMm:nullPositionOX;var prevX1=prevPoints?prevPoints[i+1].x*pxToMm:x1;var prevY1=prevPoints?prevPoints[i+1].y*pxToMm:nullPositionOX;if(!this.prevPoints)this.prevPoints= [];if(!this.prevPoints[i])this.prevPoints[i]=[];var curRect={point1:{x:x,y:y,z:this.gapDepth},point2:{x:x1,y:y1,z:this.gapDepth},prevPoint1:{x:prevX,y:prevY,z:this.gapDepth},prevPoint2:{x:prevX1,y:prevY1,z:this.gapDepth}};this._checkIntersection(curRect,i,seria);this.prevPoints[i][seria]=curRect}}},_checkIntersection:function(curRect,pointIndex,seriaIndex){var t=this;var curPoint1=curRect.point1;var curPoint2=curRect.point2;var curPoint3=curRect.prevPoint1;var curPoint4=curRect.prevPoint2;if(curPoint1.y> curPoint3.y){curPoint1=curRect.prevPoint1;curPoint2=curRect.prevPoint2;curPoint3=curRect.point1;curPoint4=curRect.point2}var addToArr=function(point,seria,isDown,elem){if(!t.intersections[point])t.intersections[point]=[];if(!t.intersections[point][seria])t.intersections[point][seria]={};if(isDown&&!t.intersections[point][seria].down)t.intersections[point][seria].down=[];if(!isDown&&!t.intersections[point][seria].up)t.intersections[point][seria].up=[];var arr=isDown?t.intersections[point][seria].down: t.intersections[point][seria].up;arr.push(elem)};var curLine1=this.cChartDrawer.getLineEquation(curPoint1,curPoint2);var curLine2=this.cChartDrawer.getLineEquation(curPoint3,curPoint4);var curTempIntersection=this.cChartDrawer.isIntersectionLineAndLine(curLine1,curLine2);var curDown=[{start:curPoint3,end:curPoint4,eq:curLine2}];var curIntersection=null;if(curTempIntersection&&curTempIntersection.x>curPoint3.x&&curTempIntersection.x<curPoint4.x){curIntersection=curTempIntersection;curDown[0]={start:curPoint3, end:curIntersection,eq:curLine2};curDown[1]={start:curIntersection,end:curPoint4,eq:curLine1}}var curUp=[{start:curPoint1,end:curPoint2,eq:curLine1}];curIntersection=null;if(curTempIntersection&&curTempIntersection.x>curPoint1.x&&curTempIntersection.x<curPoint2.x){curIntersection=curTempIntersection;curUp[0]={start:curPoint1,end:curIntersection,eq:curLine1};curUp[1]={start:curIntersection,end:curPoint2,eq:curLine2}}if(!this.prevPoints[pointIndex].length||this.prevPoints[pointIndex].length&&!this.prevPoints[pointIndex][seriaIndex]){addToArr(pointIndex, seriaIndex,true,curPoint3);addToArr(pointIndex,seriaIndex,null,curPoint1);if(curIntersection){addToArr(pointIndex,seriaIndex,true,curIntersection);addToArr(pointIndex,seriaIndex,null,curIntersection);addToArr(pointIndex,seriaIndex,true,curPoint2);addToArr(pointIndex,seriaIndex,null,curPoint4)}else{addToArr(pointIndex,seriaIndex,true,curPoint4);addToArr(pointIndex,seriaIndex,null,curPoint2)}}var line1,line2,intersection;if(this.prevDown&&this.prevDown[pointIndex])for(var i=0;i<this.prevDown[pointIndex].length;i++){var prevDown= this.prevDown[pointIndex][i];for(var j=0;j<this.prevDown[pointIndex][i].length;j++)for(var k=0;k<curDown.length;k++){line1=this.prevDown[pointIndex][i][j];line2=curDown[k];intersection=this.cChartDrawer.isIntersectionLineAndLine(line1.eq,line2.eq);if(intersection){if(intersection.x>line1.start.x&&intersection.x<line1.end.x)addToArr(pointIndex,i,true,intersection);if(intersection.x>line2.start.x&&intersection.x<line2.end.x)addToArr(pointIndex,seriaIndex,true,intersection)}}}if(this.prevUp&&this.prevUp[pointIndex])for(var i= 0;i<this.prevUp[pointIndex].length;i++){var prevUp=this.prevUp[pointIndex][i];for(var j=0;j<this.prevUp[pointIndex][i].length;j++)for(var k=0;k<curUp.length;k++){line1=this.prevUp[pointIndex][i][j];line2=curUp[k];intersection=this.cChartDrawer.isIntersectionLineAndLine(line1.eq,line2.eq);if(intersection){if(intersection.x>line1.start.x&&intersection.x<line1.end.x)addToArr(pointIndex,i,null,intersection);if(intersection.x>line2.start.x&&intersection.x<line2.end.x)addToArr(pointIndex,seriaIndex,null, intersection)}}}if(!this.prevDown)this.prevDown=[];if(!this.prevDown[pointIndex])this.prevDown[pointIndex]=[];this.prevDown[pointIndex][seriaIndex]=curDown;if(!this.prevUp)this.prevUp=[];if(!this.prevUp[pointIndex])this.prevUp[pointIndex]=[];this.prevUp[pointIndex][seriaIndex]=curUp},_calculateSimpleRect:function(arrPoints,arrPointsProject,point,seria){var pxToMm=this.chartProp.pxToMM,t=this,paths=[];var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var point1=arrPointsProject[0];var point2= arrPointsProject[1];var point3=arrPointsProject[2];var point4=arrPointsProject[3];var point5=arrPointsProject[4];var point6=arrPointsProject[5];var point7=arrPointsProject[6];var point8=arrPointsProject[7];var point11=arrPoints[0];var point22=arrPoints[1];var point33=arrPoints[2];var point44=arrPoints[3];var point55=arrPoints[4];var point66=arrPoints[5];var point77=arrPoints[6];var point88=arrPoints[7];var insidePoint={};insidePoint.x=(point11.x+point22.x+point33.x+point44.x+point55.x+point66.x+point77.x+ point88.x)/8;insidePoint.y=(point11.y+point22.y+point33.y+point44.y+point55.y+point66.y+point77.y+point88.y)/8;insidePoint.z=(point11.z+point22.z+point33.z+point44.z+point55.z+point66.z+point77.z+point88.z)/8;var oThis=this;var calculateSimpleFace=function(p1,p2,p3,p4,p11,p22,p33,p44,faceIndex){var pathId=oThis.cChartSpace.AllocPath();var path=oThis.cChartSpace.GetPath(pathId);path.pathH=pathH;path.pathW=pathW;path.moveTo(p1.x/pxToMm*pathW,p1.y/pxToMm*pathH);path.lnTo(p2.x/pxToMm*pathW,p2.y/pxToMm* pathH);path.lnTo(p3.x/pxToMm*pathW,p3.y/pxToMm*pathH);path.lnTo(p4.x/pxToMm*pathW,p4.y/pxToMm*pathH);path.lnTo(p1.x/pxToMm*pathW,p1.y/pxToMm*pathH);var arrPoints=[p1,p2,p3,p4];var arrPoints2=[p11,p22,p33,p44];var plainEquation=t.cChartDrawer.getPlainEquation(p11,p22,p33);var plainArea=t.cChartDrawer.getAreaQuadrilateral(p1,p2,p3,p4);if(faceIndex===0)t.sortZIndexPathsFront.push({seria:seria,point:0,verge:faceIndex,paths:pathId,points:arrPoints2,points2:arrPoints,plainEquation:plainEquation,plainArea:plainArea, z:insidePoint.z});else if(faceIndex===5)t.sortZIndexPathsBack.push({seria:seria,point:0,verge:faceIndex,paths:pathId,points:arrPoints2,points2:arrPoints,plainEquation:plainEquation,plainArea:plainArea,z:insidePoint.z});else if(faceIndex===2)t.sortZIndexPathsLeft.push({seria:seria,point:0,verge:faceIndex,paths:pathId,points:arrPoints2,points2:arrPoints,plainEquation:plainEquation,plainArea:plainArea,z:insidePoint.z});else if(faceIndex===3)t.sortZIndexPathsRight.push({seria:seria,point:0,verge:faceIndex, paths:pathId,points:arrPoints2,points2:arrPoints,plainEquation:plainEquation,plainArea:plainArea,z:insidePoint.z});return pathId};paths[2]=null;if(this.darkFaces["left"]&&point===0)paths[2]=calculateSimpleFace(point1,point2,point6,point5,point11,point22,point66,point55,2);paths[3]=null;if(this.darkFaces["right"]&&point===t.cChartDrawer.calcProp.ptCount-2)paths[3]=calculateSimpleFace(point4,point8,point7,point3,point44,point88,point77,point33,3);if(this.darkFaces["front"])paths[0]=calculateSimpleFace(point1, point5,point8,point4,point11,point55,point88,point44,0);if(this.darkFaces["unfront"])paths[5]=calculateSimpleFace(point2,point6,point7,point3,point22,point66,point77,point33,5)},_getPrevSeriesPoints:function(points,i){var prevPoints=null;for(var p=i-1;p>=0;p--)if(points[p]){prevPoints=points[p];break}return prevPoints},_calculateDLbl:function(chartSpace,ser,val){var pxToMm=this.chartProp.pxToMM;var point=this.cChartDrawer.getIdxPoint(this.chart.series[ser],val);var path;if(!point)return;path=this.points[ser][val]; if(!path)return;var x=path.x;var y=path.y;if(this.cChartDrawer.nDimensionCount===3){var gapDepth=this.gapDepth;if(this.subType==="normal")gapDepth=this.gapDepth[ser];var turnPoint=this.cChartDrawer._convertAndTurnPoint(x*pxToMm,y*pxToMm,gapDepth);x=turnPoint.x/pxToMm;y=turnPoint.y/pxToMm}var constMargin=5/pxToMm;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var centerX=x-width/2;var centerY=y-height/2;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.b:{centerY= centerY+height/2+constMargin;break}case c_oAscChartDataLabelsPos.bestFit:{break}case c_oAscChartDataLabelsPos.ctr:{break}case c_oAscChartDataLabelsPos.l:{centerX=centerX-width/2-constMargin;break}case c_oAscChartDataLabelsPos.r:{centerX=centerX+width/2+constMargin;break}case c_oAscChartDataLabelsPos.t:{centerY=centerY-height/2-constMargin;break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX=this.chartProp.widthCanvas/pxToMm-width;if(centerY<0)centerY=0;if(centerY+ height>this.chartProp.heightCanvas/pxToMm)centerY=this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_drawLines:function(){var brush;var pen;var seria,dataSeries,numCache;this.cChartDrawer.cShapeDrawer.Graphics.SaveGrState();this.cChartDrawer.cShapeDrawer.Graphics.AddClipRect(this.chartProp.chartGutter._left/this.chartProp.pxToMM,(this.chartProp.chartGutter._top-1)/this.chartProp.pxToMM,this.chartProp.trueWidth/this.chartProp.pxToMM,this.chartProp.trueHeight/this.chartProp.pxToMM); for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i];numCache=this.cChartDrawer.getNumCache(seria.val);dataSeries=numCache&&numCache.pts?numCache.pts:null;if(!dataSeries)continue;if(dataSeries[0]&&dataSeries[0].pen)pen=dataSeries[0].pen;if(dataSeries[0]&&dataSeries[0].brush)brush=dataSeries[0].brush;if(this.cChartDrawer.nDimensionCount===3)for(var j=0;j<this.paths.series[i].length;j++)this.cChartDrawer.drawPath(this.paths.series[i][j],pen,brush);else this.cChartDrawer.drawPath(this.paths.series[i], pen,brush)}this.cChartDrawer.cShapeDrawer.Graphics.RestoreGrState()},_getYVal:function(n,i){var tempVal;var val=0;var idxPoint;var k;if(this.subType==="stacked")for(k=0;k<=i;k++){idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[k],n);tempVal=idxPoint?parseFloat(idxPoint.val):0;if(tempVal)val+=tempVal}else if(this.subType==="stackedPer"){var sumVal=0;for(k=0;k<this.chart.series.length;k++){idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[k],n);tempVal=idxPoint?parseFloat(idxPoint.val): 0;if(tempVal){if(k<=i)val+=tempVal;sumVal+=Math.abs(tempVal)}}if(sumVal===0)val=0;else val=val/sumVal}else{idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[i],n);var dispBlanksAs=this.cChartSpace.chart.dispBlanksAs;if(idxPoint)val=parseFloat(idxPoint.val);else if(dispBlanksAs===AscFormat.DISP_BLANKS_AS_ZERO)val=0;else val=null}return val},_drawLines3D:function(){var brush;var pen;var seria,dataSeries,numCache;this.cChartDrawer.cShapeDrawer.Graphics.SaveGrState();this.cChartDrawer.cShapeDrawer.Graphics.AddClipRect(this.chartProp.chartGutter._left/ this.chartProp.pxToMM,(this.chartProp.chartGutter._top-1)/this.chartProp.pxToMM,this.chartProp.trueWidth/this.chartProp.pxToMM,this.chartProp.trueHeight/this.chartProp.pxToMM);for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i];numCache=this.cChartDrawer.getNumCache(seria.val);dataSeries=numCache&&numCache.pts?numCache.pts:null;if(!dataSeries)continue;if(dataSeries[0]&&dataSeries[0].pen)pen=dataSeries[0].pen;if(dataSeries[0]&&dataSeries[0].brush)brush=dataSeries[0].brush;for(var j= 0;j<this.paths.series[i].length;j++)this.cChartDrawer.drawPath(this.paths.series[i][j],pen,brush)}this.cChartDrawer.cShapeDrawer.Graphics.RestoreGrState()},_drawBar3D:function(path,pen,brush,k){pen=AscFormat.CreatePenFromParams(brush,undefined,undefined,undefined,undefined,.2);if(k!==5&&k!==0){var props=this.cChartSpace.getParentObjects();if(brush.fill.type===Asc.c_oAscFill.FILL_TYPE_NOFILL)return;var duplicateBrush=brush.createDuplicate();var cColorMod=new AscFormat.CColorMod;if(k===1||k===4)cColorMod.val= 45E3;else cColorMod.val=35E3;cColorMod.name="shade";duplicateBrush.fill.color.Mods.addMod(cColorMod);duplicateBrush.calculate(props.theme,props.slide,props.layout,props.master,(new AscFormat.CUniColor).RGBA,this.cChartSpace.clrMapOvr);pen.setFill(duplicateBrush);if(path&&path.length)for(var i=0;i<path.length;i++)this.cChartDrawer.drawPath(path[i],pen,duplicateBrush);else this.cChartDrawer.drawPath(path,pen,duplicateBrush)}else if(path&&path.length)for(var i=0;i<path.length;i++)this.cChartDrawer.drawPath(path[i], pen,brush);else this.cChartDrawer.drawPath(path,pen,brush)},_drawBars3D:function(){var t=this;var isStacked=this.subType==="stackedPer"||this.subType==="stacked";if(!isStacked){var angle=Math.abs(this.cChartDrawer.processor3D.angleOy);var seria,brush,pen,numCache;if(!this.cChartDrawer.processor3D.view3D.getRAngAx()&&angle>Math.PI/2&&angle<3*Math.PI/2)for(var j=0;j<this.paths.series.length;j++){seria=this.chart.series[j];brush=seria.brush;pen=seria.pen;numCache=this.cChartDrawer.getNumCache(seria.val); if(numCache&&numCache.pts[0].pen)pen=numCache.pts[0].pen;if(numCache&&numCache.pts[0].brush)brush=numCache.pts[0].brush;this._drawBar3D(this.paths.series[j][1],pen,brush,1);this._drawBar3D(this.paths.series[j][4],pen,brush,4);this._drawBar3D(this.paths.series[j][2],pen,brush,2);this._drawBar3D(this.paths.series[j][3],pen,brush,3);this._drawBar3D(this.paths.series[j][5],pen,brush,5);this._drawBar3D(this.paths.series[j][0],pen,brush,0)}else for(var j=this.paths.series.length-1;j>=0;j--){seria=this.chart.series[j]; brush=seria.brush;pen=seria.pen;numCache=this.cChartDrawer.getNumCache(seria.val);if(numCache.pts[0]&&numCache.pts[0].pen)pen=numCache.pts[0].pen;if(numCache.pts[0]&&numCache.pts[0].brush)brush=numCache.pts[0].brush;if(!this.paths.series[j])continue;this._drawBar3D(this.paths.series[j][1],pen,brush,1);this._drawBar3D(this.paths.series[j][4],pen,brush,4);this._drawBar3D(this.paths.series[j][2],pen,brush,2);this._drawBar3D(this.paths.series[j][3],pen,brush,3);this._drawBar3D(this.paths.series[j][5], pen,brush,5);this._drawBar3D(this.paths.series[j][0],pen,brush,0)}}else{var drawVerges=function(i,j,paths,onlyLessNull,k){var brush,pen,options;options=t._getOptionsForDrawing(i,j,onlyLessNull);if(paths!==null&&options!==null){pen=options.pen;brush=options.brush;t._drawBar3D(paths,pen,brush,k)}};for(var i=0;i<this.sortZIndexPaths.length;i++)drawVerges(this.sortZIndexPaths[i].seria,this.sortZIndexPaths[i].point,this.sortZIndexPaths[i].paths,null,this.sortZIndexPaths[i].verge)}},_getOptionsForDrawing:function(ser, point,onlyLessNull){var seria=this.chart.series[ser];var numCache=this.cChartDrawer.getNumCache(seria.val);if(!numCache)return null;var pt=numCache.getPtByIndex(point);if(!seria||!this.paths.series[ser]||!this.paths.series[ser][point]||!pt)return null;var brush=seria.brush;var pen=seria.pen;if(pt.val>0&&onlyLessNull===true||pt.val<0&&onlyLessNull===false)return null;if(pt.pen)pen=pt.pen;if(pt.brush)brush=pt.brush;return{pen:pen,brush:brush}},_isVisibleVerge3D:function(k,n,m){var aX=n.x*m.y-m.x*n.y; var bY=-(k.x*m.y-m.x*k.y);var cZ=k.x*n.y-n.x*k.y;var visible=aX+bY+cZ;return visible<0},_getIntersectionLines:function(line1Point1,line1Point2,line2Point1,line2Point2){var chartHeight=this.chartProp.trueHeight;var top=this.chartProp.chartGutter._top;var x1=line1Point1.x;var x2=line1Point2.x;var y1=line1Point1.y;var y2=line1Point2.y;var x3=line2Point1.x;var x4=line2Point2.x;var y3=line2Point1.y;var y4=line2Point2.y;var x=((x1*y2-x2*y1)*(x4-x3)-(x3*y4-x4*y3)*(x2-x1))/((y1-y2)*(x4-x3)-(y3-y4)*(x2-x1)); var y=((y3-y4)*x-(x3*y4-x4*y3))/(x4-x3);x=-x;var res=null;if(y<top+chartHeight&&y>top&&x>line1Point1.x&&x<line1Point2.x)res={x:x,y:y};return res}};function drawHBarChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace;this.chart=chart;this.catAx=null;this.valAx=null;this.ptCount=null;this.seriesCount=null;this.subType=null;this.paths={};this.sortZIndexPaths=[];this.summBarVal=[]}drawHBarChart.prototype={constructor:drawHBarChart, recalculate:function(){this.paths={};this.summBarVal=[];this.sortZIndexPaths=[];var countSeries=this.cChartDrawer.calculateCountSeries(this.chart);this.seriesCount=countSeries.series;this.ptCount=countSeries.points;this.subType=this.cChartDrawer.getChartGrouping(this.chart);this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_CatAx);if(!this.catAx)this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_DateAx);this.valAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId, AscDFH.historyitem_type_ValAx);this._recalculateBars()},draw:function(){if(this.cChartDrawer.nDimensionCount===3)this._DrawBars3D();else this._drawBars()},_recalculateBars:function(){var xPoints=this.valAx.xPoints;var yPoints=this.catAx.yPoints;var heightGraph=this.chartProp.heightCanvas-this.chartProp.chartGutter._top-this.chartProp.chartGutter._bottom;var defaultOverlap=this.subType==="stacked"||this.subType==="stackedPer"?100:0;var overlap=AscFormat.isRealNumber(this.chart.overlap)?this.chart.overlap: defaultOverlap;var ptCount=this.cChartDrawer.getPtCount(this.chart.series);var height=heightGraph/ptCount;var crossBetween=this.cChartSpace.getValAxisCrossType();if(crossBetween)height=heightGraph/(ptCount-1);var gapWidth=AscFormat.isRealNumber(this.chart.gapWidth)?this.chart.gapWidth:150;var individualBarHeight=height/(this.seriesCount-(this.seriesCount-1)*(overlap/100)+gapWidth/100);var widthOverLap=individualBarHeight*(overlap/100);var hmargin=gapWidth/100*individualBarHeight/2;var width,startX, startY,val,paths,seriesHeight=[],seria,startXColumnPosition,startYPosition,newStartX,newStartY,idx,seriesCounter=0,numCache;var perspectiveDepth,gapDepth,DiffGapDepth;if(this.cChartDrawer.nDimensionCount===3){perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;gapDepth=this.chart.gapDepth!=null?this.chart.gapDepth:globalGapDepth;perspectiveDepth=perspectiveDepth/(gapDepth/100+1);DiffGapDepth=perspectiveDepth*(gapDepth/2)/100}var cubeCount=0;for(var i=0;i<this.chart.series.length;i++){numCache= this.cChartDrawer.getNumCache(this.chart.series[i].val);if(!numCache||this.chart.series[i].isHidden)continue;seria=numCache.pts;seriesHeight[i]=[];var isValMoreZero=false;var isValLessZero=0;for(var j=0;j<seria.length;j++){val=parseFloat(seria[j].val);if(val>0)isValMoreZero=true;else if(val<0)isValLessZero++;if(this.valAx&&this.valAx.scaling.logBase)val=this.cChartDrawer.getLogarithmicValue(val,this.valAx.scaling.logBase,xPoints);idx=seria[j].idx!=null?seria[j].idx:j;startXColumnPosition=this._getStartYColumnPosition(seriesHeight, idx,i,val,xPoints);startX=startXColumnPosition.startY/this.chartProp.pxToMM;width=startXColumnPosition.width/this.chartProp.pxToMM;seriesHeight[i][idx]=startXColumnPosition.width;if(this.catAx.scaling.orientation===ORIENTATION_MIN_MAX)if(yPoints[1]&&yPoints[1].pos&&yPoints[idx])startYPosition=yPoints[idx].pos+Math.abs((yPoints[1].pos-yPoints[0].pos)/2);else if(yPoints[idx])startYPosition=yPoints[idx].pos+Math.abs(yPoints[0].pos-this.valAx.posY);else startYPosition=yPoints[0].pos+Math.abs(yPoints[0].pos- this.valAx.posY);else if(yPoints[1]&&yPoints[1].pos&&yPoints[idx])startYPosition=yPoints[idx].pos-Math.abs((yPoints[1].pos-yPoints[0].pos)/2);else if(yPoints[idx])startYPosition=yPoints[idx].pos-Math.abs(yPoints[0].pos-this.valAx.posY);else startYPosition=yPoints[0].pos-Math.abs(yPoints[0].pos-this.valAx.posY);if(this.catAx.scaling.orientation===ORIENTATION_MIN_MAX)if(seriesCounter===0)startY=startYPosition*this.chartProp.pxToMM-hmargin-seriesCounter*individualBarHeight;else startY=startYPosition* this.chartProp.pxToMM-hmargin-(seriesCounter*individualBarHeight-seriesCounter*widthOverLap);else if(i===0)startY=startYPosition*this.chartProp.pxToMM+hmargin+seriesCounter*individualBarHeight;else startY=startYPosition*this.chartProp.pxToMM+hmargin+(seriesCounter*individualBarHeight-seriesCounter*widthOverLap);newStartY=startY;if(this.catAx.scaling.orientation!==ORIENTATION_MIN_MAX)newStartY=startY+individualBarHeight;newStartX=startX;if(this.valAx.scaling.orientation!==ORIENTATION_MIN_MAX&&(this.subType=== "stackedPer"||this.subType==="stacked"))newStartX=startX-width;if(this.cChartDrawer.nDimensionCount===3){paths=this.calculateParallalepiped(newStartX,newStartY,val,width,DiffGapDepth,perspectiveDepth,individualBarHeight,seriesHeight,i,idx,cubeCount);cubeCount++}else paths=this._calculateRect(newStartX,newStartY/this.chartProp.pxToMM,width,individualBarHeight/this.chartProp.pxToMM);var serIdx=this.chart.series[i].idx;if(!this.paths.series)this.paths.series=[];if(!this.paths.series[serIdx])this.paths.series[serIdx]= [];if(height!==0)this.paths.series[serIdx][idx]=paths}seriesCounter++}if(this.cChartDrawer.nDimensionCount===3)if(this.cChartDrawer.processor3D.view3D.getRAngAx()){var angle=Math.abs(this.cChartDrawer.processor3D.angleOy);this.sortZIndexPaths.sort(function sortArr(a,b){if(b.zIndex===a.zIndex)if(angle<Math.PI)return a.x-b.x;else return b.x-a.x;else return b.zIndex-a.zIndex})}else{var cSortFaces=new window["AscFormat"].CSortFaces(this.cChartDrawer);this.sortParallelepipeds=cSortFaces.sortParallelepipeds(this.temp, this.sortZIndexPaths)}},_calculateLine:function(x,y,x1,y1){var pxToMm=this.chartProp.pxToMM;var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo(x/pxToMm*pathW,y/pxToMm*pathH);path.lnTo(x1/pxToMm*pathW,y1/pxToMm*pathH);return pathId},_getOptionsForDrawing:function(ser,point,onlyLessNull){var seria=this.chart.series[ser];var numCache=this.cChartDrawer.getNumCache(seria.val);if(!numCache)return null; var pt=numCache.getPtByIndex(point);if(!seria||!this.paths.series[ser]||!this.paths.series[ser][point]||!pt)return null;var brush=seria.brush;var pen=seria.pen;if(pt.val>0&&onlyLessNull===true||pt.val<0&&onlyLessNull===false)return null;if(pt.pen)pen=pt.pen;if(pt.brush)brush=pt.brush;return{pen:pen,brush:brush}},_getStartYColumnPosition:function(seriesHeight,j,i,val,xPoints){var startY,width,curVal,prevVal,endBlockPosition,startBlockPosition;var catAx=this.catAx;var axisMin=xPoints[0].val<xPoints[xPoints.length- 1].val?xPoints[0].val:xPoints[xPoints.length-1].val;var axisMax=xPoints[0].val<xPoints[xPoints.length-1].val?xPoints[xPoints.length-1].val:xPoints[0].val;var nullPositionOX=this.subType==="stacked"?this.cChartDrawer.getPositionZero(this.valAx):catAx.posX*this.chartProp.pxToMM;if(this.subType==="stacked"||this.subType==="stackedPer"){curVal=this._getStackedValue(this.chart.series,i,j,val);prevVal=this._getStackedValue(this.chart.series,i-1,j,val);if(this.subType==="stacked"){if(curVal>axisMax)curVal= axisMax;if(curVal<axisMin)curVal=axisMin;endBlockPosition=this.cChartDrawer.getYPosition(curVal,this.valAx)*this.chartProp.pxToMM;startBlockPosition=prevVal?this.cChartDrawer.getYPosition(prevVal,this.valAx)*this.chartProp.pxToMM:nullPositionOX}else{this._calculateSummStacked(j);var test=this.summBarVal[j];if(curVal/test>axisMax)curVal=axisMax*test;if(curVal/test<axisMin)curVal=axisMin*test;if(prevVal/test>axisMax)prevVal=axisMax*test;if(prevVal/test<axisMin)prevVal=axisMin*test;endBlockPosition= this.cChartDrawer.getYPosition(curVal/test,this.valAx)*this.chartProp.pxToMM;startBlockPosition=test?this.cChartDrawer.getYPosition(prevVal/test,this.valAx)*this.chartProp.pxToMM:nullPositionOX}startY=startBlockPosition;width=endBlockPosition-startBlockPosition;if(this.valAx.scaling.orientation!==ORIENTATION_MIN_MAX)width=-width}else{width=this.cChartDrawer.getYPosition(val,this.valAx)*this.chartProp.pxToMM-nullPositionOX;startY=nullPositionOX}return{startY:startY,width:width}},_calculateSummStacked:function(j){if(!this.summBarVal[j]){var curVal; var temp=0,idxPoint;for(var k=0;k<this.chart.series.length;k++){idxPoint=this.cChartDrawer.getIdxPoint(this.chart.series[k],j);curVal=idxPoint?parseFloat(idxPoint.val):0;if(curVal)temp+=Math.abs(curVal)}this.summBarVal[j]=temp}},_getStackedValue:function(series,i,j,val){var result=0,curVal,idxPoint;for(var k=0;k<=i;k++){idxPoint=this.cChartDrawer.getIdxPoint(series[k],j);curVal=idxPoint?idxPoint.val:0;if(idxPoint&&val>0&&curVal>0)result+=parseFloat(curVal);else if(idxPoint&&val<0&&curVal<0)result+= parseFloat(curVal)}return result},_drawBars:function(){this.cChartDrawer.cShapeDrawer.Graphics.SaveGrState();this.cChartDrawer.cShapeDrawer.Graphics.AddClipRect((this.chartProp.chartGutter._left-1)/this.chartProp.pxToMM,(this.chartProp.chartGutter._top-1)/this.chartProp.pxToMM,this.chartProp.trueWidth/this.chartProp.pxToMM,this.chartProp.trueHeight/this.chartProp.pxToMM);this.cChartDrawer.drawPaths(this.paths,this.chart.series,null,null,true);this.cChartDrawer.cShapeDrawer.Graphics.RestoreGrState()}, _calculateDLbl:function(chartSpace,ser,val,bLayout,serIdx){var point=this.cChartDrawer.getIdxPoint(this.chart.series[ser],val);var path=this.paths.series[serIdx][val];if(!point)return;if(this.cChartDrawer.nDimensionCount===3&&path.frontPaths){var frontPaths=path.frontPaths;if(this.cChartDrawer.nDimensionCount===3)if(AscFormat.isRealNumber(frontPaths[0]))path=frontPaths[0];else if(AscFormat.isRealNumber(frontPaths[5]))path=frontPaths[5];else if(AscFormat.isRealNumber(frontPaths[2]))path=frontPaths[2]; else if(AscFormat.isRealNumber(frontPaths[3]))path=frontPaths[3]}if(!AscFormat.isRealNumber(path))return;var oPath=this.cChartSpace.GetPath(path);var oCommand0=oPath.getCommandByIndex(0);var oCommand1=oPath.getCommandByIndex(1);var oCommand2=oPath.getCommandByIndex(2);var x=oCommand0.X;var y=oCommand0.Y;var h=oCommand0.Y-oCommand1.Y;var w=oCommand2.X-oCommand1.X;var pxToMm=this.chartProp.pxToMM;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var centerX,centerY;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.bestFit:{break}case c_oAscChartDataLabelsPos.ctr:{centerX= x+w/2-width/2;centerY=y-h/2-height/2;break}case c_oAscChartDataLabelsPos.inBase:{centerX=x;centerY=y-h/2-height/2;if(point.val<0)centerX=x-width;break}case c_oAscChartDataLabelsPos.inEnd:{centerX=x+w-width;centerY=y-h/2-height/2;if(point.val<0)centerX=x+w;break}case c_oAscChartDataLabelsPos.outEnd:{centerX=x+w;centerY=y-h/2-height/2;if(point.val<0)centerX=x+w-width;break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX=this.chartProp.widthCanvas/pxToMm-width;if(centerY< 0)centerY=0;if(centerY+height>this.chartProp.heightCanvas/pxToMm)centerY=this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_calculateRect:function(x,y,w,h){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo(x*pathW,y*pathH);path.lnTo(x*pathW,(y-h)*pathH);path.lnTo((x+w)*pathW,(y-h)*pathH);path.lnTo((x+w)*pathW,y*pathH);path.lnTo(x*pathW,y*pathH);return pathId},calculateParallalepiped:function(newStartX, newStartY,val,width,DiffGapDepth,perspectiveDepth,individualBarHeight,seriesHeight,i,idx,cubeCount){var paths;var point1,point2,point3,point4,point5,point6,point7,point8;var x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,x5,y5,z5,x6,y6,z6,x7,y7,z7,x8,y8,z8;var xPoints=this.valAx.xPoints;var scaleAxis=this.valAx.scale;var axisMax=scaleAxis[0]<scaleAxis[scaleAxis.length-1]?scaleAxis[scaleAxis.length-1]:scaleAxis[0];width=width*this.chartProp.pxToMM;newStartX=newStartX*this.chartProp.pxToMM;newStartY=newStartY- individualBarHeight;x1=newStartX,y1=newStartY,z1=DiffGapDepth;x2=newStartX,y2=newStartY,z2=perspectiveDepth+DiffGapDepth;x3=newStartX+width,y3=newStartY,z3=perspectiveDepth+DiffGapDepth;x4=newStartX+width,y4=newStartY,z4=DiffGapDepth;x5=newStartX,y5=newStartY+individualBarHeight,z5=DiffGapDepth;x6=newStartX,y6=newStartY+individualBarHeight,z6=perspectiveDepth+DiffGapDepth;x7=newStartX+width,y7=newStartY+individualBarHeight,z7=perspectiveDepth+DiffGapDepth;x8=newStartX+width,y8=newStartY+individualBarHeight, z8=DiffGapDepth;point1=this.cChartDrawer._convertAndTurnPoint(x1,y1,z1);point2=this.cChartDrawer._convertAndTurnPoint(x2,y2,z2);point3=this.cChartDrawer._convertAndTurnPoint(x3,y3,z3);point4=this.cChartDrawer._convertAndTurnPoint(x4,y4,z4);point5=this.cChartDrawer._convertAndTurnPoint(x5,y5,z5);point6=this.cChartDrawer._convertAndTurnPoint(x6,y6,z6);point7=this.cChartDrawer._convertAndTurnPoint(x7,y7,z7);point8=this.cChartDrawer._convertAndTurnPoint(x8,y8,z8);var points=[point1,point2,point3,point4, point5,point6,point7,point8];paths=this.cChartDrawer.calculateRect3D(points,val,null,true);if(this.cChartDrawer.processor3D.view3D.getRAngAx()){var controlPoint1=this.cChartDrawer._convertAndTurnPoint(x5+width/2,y5-individualBarHeight/2,z5);var controlPoint2=this.cChartDrawer._convertAndTurnPoint(x5+width/2,y5,z5+perspectiveDepth/2);var controlPoint3=this.cChartDrawer._convertAndTurnPoint(x5,y5-individualBarHeight/2,z5+perspectiveDepth/2);var controlPoint4=this.cChartDrawer._convertAndTurnPoint(x8, y8-individualBarHeight/2,z8+perspectiveDepth/2);var controlPoint5=this.cChartDrawer._convertAndTurnPoint(x1+width/2,y1,z1+perspectiveDepth/2);var controlPoint6=this.cChartDrawer._convertAndTurnPoint(x6+width/2,y6-individualBarHeight/2,z6);var sortPaths=[controlPoint1,controlPoint2,controlPoint3,controlPoint4,controlPoint5,controlPoint6];for(var k=0;k<paths.frontPaths.length;k++)this.sortZIndexPaths.push({seria:i,point:idx,verge:k,frontPaths:paths.frontPaths[k],darkPaths:paths.darkPaths[k],x:sortPaths[k].x, y:sortPaths[k].y,zIndex:sortPaths[k].z})}else{if(this.subType==="normal"){var startXColumnPosition=this._getStartYColumnPosition(seriesHeight,idx,i,axisMax,xPoints);width=startXColumnPosition.width/this.chartProp.pxToMM;x3=newStartX+width,y3=newStartY,z3=perspectiveDepth+DiffGapDepth;x4=newStartX+width,y4=newStartY,z4=DiffGapDepth;x7=newStartX+width,y7=newStartY+individualBarHeight,z7=perspectiveDepth+DiffGapDepth;x8=newStartX+width,y8=newStartY+individualBarHeight,z8=DiffGapDepth;point3=this.cChartDrawer._convertAndTurnPoint(x3, y3,z3);point4=this.cChartDrawer._convertAndTurnPoint(x4,y4,z4);point7=this.cChartDrawer._convertAndTurnPoint(x7,y7,z7);point8=this.cChartDrawer._convertAndTurnPoint(x8,y8,z8)}var point11=this.cChartDrawer._convertAndTurnPoint(x1,y1,z1,null,null,true);var point22=this.cChartDrawer._convertAndTurnPoint(x2,y2,z2,null,null,true);var point33=this.cChartDrawer._convertAndTurnPoint(x3,y3,z3,null,null,true);var point44=this.cChartDrawer._convertAndTurnPoint(x4,y4,z4,null,null,true);var point55=this.cChartDrawer._convertAndTurnPoint(x5, y5,z5,null,null,true);var point66=this.cChartDrawer._convertAndTurnPoint(x6,y6,z6,null,null,true);var point77=this.cChartDrawer._convertAndTurnPoint(x7,y7,z7,null,null,true);var point88=this.cChartDrawer._convertAndTurnPoint(x8,y8,z8,null,null,true);var arrPoints=[[point1,point4,point8,point5],[point1,point2,point3,point4],[point1,point2,point6,point5],[point4,point8,point7,point3],[point5,point6,point7,point8],[point6,point2,point3,point7]];var arrPoints2=[[point11,point44,point88,point55],[point11, point22,point33,point44],[point11,point22,point66,point55],[point44,point88,point77,point33],[point55,point66,point77,point88],[point66,point22,point33,point77]];if(!this.temp)this.temp=[];if(!this.temp[cubeCount])this.temp[cubeCount]={};if(!this.temp[cubeCount].faces){this.temp[cubeCount].faces=[];this.temp[cubeCount].arrPoints=[point11,point22,point33,point44,point55,point66,point77,point88];this.temp[cubeCount].z=point11.z}for(var k=0;k<paths.frontPaths.length;k++){if(null===paths.frontPaths[k]&& null===paths.darkPaths[k])continue;var plainEquation=this.cChartDrawer.getPlainEquation(arrPoints2[k][0],arrPoints2[k][1],arrPoints2[k][2],arrPoints2[k][3]);var plainArea=this.cChartDrawer.getAreaQuadrilateral(arrPoints[k][0],arrPoints[k][1],arrPoints[k][2],arrPoints[k][3]);this.temp[cubeCount].faces.push({seria:i,point:idx,verge:k,frontPaths:paths.frontPaths[k],darkPaths:paths.darkPaths[k],points:arrPoints2[k],points2:arrPoints[k],plainEquation:plainEquation,plainArea:plainArea})}}return paths}, _DrawBars3D2:function(){var t=this;var draw=function(onlyLessNull){var brush,pen,options;for(var i=0;i<t.ptCount;i++){if(!t.paths.series)return;for(var j=0;j<t.paths.series.length;++j){options=t._getOptionsForDrawing(j,i,onlyLessNull);if(options!==null){pen=options.pen;brush=options.brush}else continue;for(var k=0;k<t.paths.series[j][i].length;k++)t._drawBar3D(t.paths.series[j][i][k],pen,brush,k)}}};var drawReverse=function(onlyLessNull){var brush,pen,options;for(var i=0;i<t.ptCount;i++){if(!t.paths.series)return; for(var j=t.paths.series.length-1;j>=0;--j){options=t._getOptionsForDrawing(j,i,onlyLessNull);if(options!==null){pen=options.pen;brush=options.brush}else continue;for(var k=0;k<t.paths.series[j][i].length;k++)t._drawBar3D(t.paths.series[j][i][k],pen,brush,k)}}};if(this.subType==="stacked"||this.subType==="stackedPer")if(this.valAx.scaling.orientation===ORIENTATION_MIN_MAX){drawReverse(true);draw(false)}else{drawReverse(false);draw(true)}else if(this.catAx.scaling.orientation===ORIENTATION_MIN_MAX)draw(); else drawReverse()},_DrawBars3D3:function(){var t=this;var verges={front:0,down:1,left:2,right:3,up:4,unfront:5};var drawVerges=function(i,j,paths,onlyLessNull,start,stop){var brush,pen,options;options=t._getOptionsForDrawing(i,j,onlyLessNull);if(options!==null){pen=options.pen;brush=options.brush;for(var k=start;k<=stop;k++)t._drawBar3D(paths[k],pen,brush,k)}};var draw=function(onlyLessNull,start,stop){for(var i=0;i<t.sortZIndexPaths.length;i++)drawVerges(t.sortZIndexPaths[i].seria,t.sortZIndexPaths[i].point, t.sortZIndexPaths[i].paths,onlyLessNull,start,stop)};if(this.subType==="standard"){draw(true,verges.front,verges.unfront);draw(false,verges.front,verges.unfront)}else{draw(true,verges.down,verges.up);draw(false,verges.down,verges.up);draw(true,verges.unfront,verges.unfront);draw(false,verges.unfront,verges.unfront);draw(true,verges.front,verges.front);draw(false,verges.front,verges.front)}},_DrawBars3D1:function(){var t=this;var processor3D=this.cChartDrawer.processor3D;var drawVerges=function(i, j,paths,onlyLessNull,k){var brush,pen,options;options=t._getOptionsForDrawing(i,j,onlyLessNull);if(paths!==null&&options!==null){pen=options.pen;brush=options.brush;t._drawBar3D(paths,pen,brush,k)}};for(var i=0;i<this.sortZIndexPaths.length;i++)if(this.sortZIndexPaths[i].seria!==undefined)drawVerges(this.sortZIndexPaths[i].seria,this.sortZIndexPaths[i].point,this.sortZIndexPaths[i].paths,null,this.sortZIndexPaths[i].verge);else{var pen=t.valAx.compiledMajorGridLines;var brush=null;this.cChartDrawer.drawPath(this.sortZIndexPaths[i].paths, pen,brush)}},_DrawBars3D:function(){var t=this;var drawVerges=function(i,j,paths,onlyLessNull,k,isNotPen,isNotBrush){var brush,pen,options;options=t._getOptionsForDrawing(i,j,onlyLessNull);if(paths!==null&&options!==null){if(!isNotPen)pen=options.pen;if(!isNotBrush)brush=options.brush;t._drawBar3D(paths,pen,brush,k)}};var index,faces,face;if(this.cChartDrawer.processor3D.view3D.getRAngAx()){for(var i=0;i<this.sortZIndexPaths.length;i++)drawVerges(this.sortZIndexPaths[i].seria,this.sortZIndexPaths[i].point, this.sortZIndexPaths[i].darkPaths,null,this.sortZIndexPaths[i].verge,null,true);for(var i=0;i<this.sortZIndexPaths.length;i++)drawVerges(this.sortZIndexPaths[i].seria,this.sortZIndexPaths[i].point,this.sortZIndexPaths[i].frontPaths,null,this.sortZIndexPaths[i].verge)}else{for(var i=0;i<this.sortParallelepipeds.length;i++){index=this.sortParallelepipeds[i].nextIndex;faces=this.temp[index].faces;for(var j=0;j<faces.length;j++){face=faces[j];drawVerges(face.seria,face.point,face.darkPaths,null,face.verge, null,true)}}for(var i=0;i<this.sortParallelepipeds.length;i++){index=this.sortParallelepipeds[i].nextIndex;faces=this.temp[index].faces;for(var j=0;j<faces.length;j++){face=faces[j];drawVerges(face.seria,face.point,face.frontPaths,null,face.verge)}}}},_drawBar3D:function(path,pen,brush,k){var fill=this._getFill(pen,brush,k);var newBrush=fill.brush;var newPen=fill.pen;this.cChartDrawer.drawPath(path,newPen,newBrush)},_getFill:function(pen,brush,face){var shade="shade";var shadeValue1=35E3;var shadeValue2= 45E3;var newBrush=brush;var newPen=pen;var t=this;var color;if(brush&&brush.fill&&AscDFH.historyitem_type_GradFill===brush.fill.getObjectType())switch(face){case c_oChartBar3dFaces.front:case c_oChartBar3dFaces.back:{break}case c_oChartBar3dFaces.up:{color=this._getGradFill(brush,pen,c_oChartBar3dFaces.up);newBrush=color.brush;newPen=color.pen;break}case c_oChartBar3dFaces.left:{color=this._getGradFill(brush,pen,c_oChartBar3dFaces.left);newBrush=color.brush;newPen=color.pen;break}case c_oChartBar3dFaces.right:{color= this._getGradFill(brush,pen,c_oChartBar3dFaces.right);newBrush=color.brush;newPen=color.pen;break}case c_oChartBar3dFaces.down:{color=this._getGradFill(brush,pen,c_oChartBar3dFaces.down);newBrush=color.brush;newPen=color.pen;break}}else if(brush&&brush.fill)switch(face){case c_oChartBar3dFaces.front:case c_oChartBar3dFaces.back:{break}case c_oChartBar3dFaces.up:case c_oChartBar3dFaces.down:{newBrush=this._applyColorModeByBrush(brush,shadeValue1);if(null===pen)newPen=pen.setFill(newBrush);break}case c_oChartBar3dFaces.left:case c_oChartBar3dFaces.right:{newBrush= this._applyColorModeByBrush(brush,shadeValue2);if(null===pen)newPen=pen.setFill(newBrush);break}}return{brush:newBrush,pen:newPen}},_getGradFill:function(brushFill,penFill,faceIndex){var gradientPen=penFill;var gradientBrush=brushFill;var angleKf=6E4;var shade="shade";var shadeValue1=35E3;var t=this;if(brushFill.fill.lin&&null!==brushFill.fill.lin.angle){var getCSolidColor=function(color,colorMod){var duplicateBrush=brushFill.createDuplicate();var tempColor=new AscFormat.CUniFill;tempColor.setFill(new AscFormat.CSolidFill); tempColor.fill.setColor(color);if(colorMod)tempColor=t._applyColorModeByBrush(tempColor,colorMod);return tempColor};var angle=brushFill.fill.lin.angle/angleKf;var colors=brushFill.fill.colors;if(angle>=0&&angle<45)if(faceIndex===c_oChartBar3dFaces.up||faceIndex===c_oChartBar3dFaces.down)gradientBrush=this._applyColorModeByBrush(brushFill,shadeValue1);else if(faceIndex===c_oChartBar3dFaces.left)gradientBrush=getCSolidColor(colors[0].color);else{if(faceIndex===c_oChartBar3dFaces.right)gradientBrush= getCSolidColor(colors[colors.length-1].color)}else if(angle>=45&&angle<90)if(faceIndex===c_oChartBar3dFaces.up||faceIndex===c_oChartBar3dFaces.left)gradientBrush=getCSolidColor(colors[0].color,shadeValue1);else if(faceIndex===c_oChartBar3dFaces.right)gradientBrush=this._applyColorModeByBrush(brushFill,shadeValue1);else{if(faceIndex===c_oChartBar3dFaces.down)gradientBrush=getCSolidColor(colors[colors.length-1].color)}else if(angle>=90&&angle<135)if(faceIndex===c_oChartBar3dFaces.up||faceIndex===c_oChartBar3dFaces.left)gradientBrush= getCSolidColor(colors[0].color,shadeValue1);else if(faceIndex===c_oChartBar3dFaces.right)gradientBrush=this._applyColorModeByBrush(brushFill,shadeValue1);else{if(faceIndex===c_oChartBar3dFaces.down)gradientBrush=getCSolidColor(colors[colors.length-1].color)}else if(angle>=135&&angle<180)if(faceIndex===c_oChartBar3dFaces.up||faceIndex===c_oChartBar3dFaces.left||faceIndex===c_oChartBar3dFaces.right)gradientBrush=getCSolidColor(colors[0].color,shadeValue1);else{if(faceIndex===c_oChartBar3dFaces.down)gradientBrush= this._applyColorModeByBrush(brushFill,shadeValue1)}else if(angle>=180&&angle<225)if(faceIndex===c_oChartBar3dFaces.up||faceIndex===c_oChartBar3dFaces.down)gradientBrush=this._applyColorModeByBrush(brushFill,shadeValue1);else if(faceIndex===c_oChartBar3dFaces.right)gradientBrush=getCSolidColor(colors[0].color,shadeValue1);else{if(faceIndex===c_oChartBar3dFaces.left)gradientBrush=getCSolidColor(colors[colors.length-1].color,shadeValue1)}else if(angle>=225&&angle<270)if(faceIndex===c_oChartBar3dFaces.up)gradientBrush= this._applyColorModeByBrush(brushFill,shadeValue1);else{if(faceIndex===c_oChartBar3dFaces.left||faceIndex===c_oChartBar3dFaces.down||faceIndex===c_oChartBar3dFaces.right)gradientBrush=getCSolidColor(colors[0].color,shadeValue1)}else if(angle>=270&&angle<315)if(faceIndex===c_oChartBar3dFaces.up)gradientBrush=getCSolidColor(colors[colors.length-1].color);else if(faceIndex===c_oChartBar3dFaces.left||faceIndex===c_oChartBar3dFaces.down)gradientBrush=getCSolidColor(colors[0].color,shadeValue1);else{if(faceIndex=== c_oChartBar3dFaces.right)gradientBrush=this._applyColorModeByBrush(brushFill,shadeValue1)}else if(angle>=315&&angle<=360)if(faceIndex===c_oChartBar3dFaces.up||faceIndex===c_oChartBar3dFaces.right)gradientBrush=this._applyColorModeByBrush(brushFill,shadeValue1);else if(faceIndex===c_oChartBar3dFaces.left||faceIndex===c_oChartBar3dFaces.down)gradientBrush=getCSolidColor(colors[0].color,shadeValue1)}return{pen:gradientPen,brush:gradientBrush}},_applyColorModeByBrush:function(brushFill,val){var props= this.cChartSpace.getParentObjects();var duplicateBrush=brushFill.createDuplicate();var cColorMod=new AscFormat.CColorMod;cColorMod.val=val;cColorMod.name="shade";duplicateBrush.addColorMod(cColorMod);duplicateBrush.calculate(props.theme,props.slide,props.layout,props.master,(new AscFormat.CUniColor).RGBA,this.cChartSpace.clrMapOvr);return duplicateBrush}};function drawPieChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace; this.chart=chart;this.tempAngle=null;this.paths={};this.cX=null;this.cY=null;this.angleFor3D=null;this.properties3d=null;this.usually3dPropsCalc=[];this.tempDrawOrder=null}drawPieChart.prototype={constructor:drawPieChart,draw:function(){if(this.cChartDrawer.nDimensionCount===3)this._drawPie3D();else this._drawPie()},recalculate:function(){this.tempAngle=null;this.paths={};if(this.cChartDrawer.nDimensionCount===3)if(this.cChartDrawer.processor3D.view3D.getRAngAx()){this.properties3d=this.cChartDrawer.processor3D.calculatePropertiesForPieCharts(); this._recalculatePie3D()}else this._recalculatePie3DPerspective();else this._recalculatePie()},_drawPie:function(){var numCache=this._getFirstRealNumCache(true);if(!numCache)return;var brush,pen,val,path;for(var i=numCache.ptCount-1;i>=0;i--){var point=numCache.getPtByIndex(i);brush=point?point.brush:null;pen=point?point.pen:null;path=this.paths.series[i];this.cChartDrawer.drawPath(path,pen,brush)}},_recalculatePie:function(){var trueWidth=this.chartProp.trueWidth;var trueHeight=this.chartProp.trueHeight; var numCache=this._getFirstRealNumCache(true);if(!numCache)return;var sumData=this.cChartDrawer._getSumArray(numCache.pts,true);var radius=Math.min(trueHeight,trueWidth)/2;var xCenter=this.chartProp.chartGutter._left+trueWidth/2;var yCenter=this.chartProp.chartGutter._top+trueHeight/2;var firstSliceAng=this.chart&&this.chart.firstSliceAng?this.chart.firstSliceAng:0;this.tempAngle=Math.PI/2-firstSliceAng/180*Math.PI;var angle;for(var i=numCache.ptCount-1;i>=0;i--){var point=numCache.getPtByIndex(i); var val=point?point.val:0;angle=Math.abs(parseFloat(val/sumData)*(Math.PI*2));if(angle<1E-15)angle=0;if(!this.paths.series)this.paths.series=[];if(sumData===0)this.paths.series[i]=this._calculateEmptySegment(radius,xCenter,yCenter);else this.paths.series[i]=this._calculateSegment(angle,radius,xCenter,yCenter)}},_getFirstRealNumCache:function(returnCache){var series=this.chart.series;var numCache;for(var i=0;i<series.length;i++)if(returnCache){numCache=series[i].val.numRef&&series[i].val.numRef.numCache? series[i].val.numRef.numCache:series[i].val.numLit;if(numCache)return numCache}else{numCache=series[i].val.numRef&&series[i].val.numRef.numCache?series[i].val.numRef.numCache.pts:series[i].val.numLit.pts;if(numCache&&numCache.length)return numCache}if(returnCache)numCache=series[0].val.numRef&&series[0].val.numRef.numCache?series[0].val.numRef.numCache:series[0].val.numLit;else numCache=series[0].val.numRef&&series[0].val.numRef.numCache?series[0].val.numRef.numCache.pts:series[0].val.numLit.pts; return numCache},_calculateSegment:function(angle,radius,xCenter,yCenter){if(isNaN(angle))return null;var startAngle=this.tempAngle;var endAngle=angle;if(radius<0)radius=0;var path=this._calculateArc(radius,startAngle,endAngle,xCenter,yCenter);this.tempAngle+=angle;return path},_calculateEmptySegment:function(radius,xCenter,yCenter){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var pxToMm=this.chartProp.pxToMM; var x0=xCenter+radius*Math.cos(this.tempAngle);var y0=yCenter-radius*Math.sin(this.tempAngle);path.moveTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);path.lnTo(x0/pxToMm*pathW,y0/pxToMm*pathH);path.arcTo(radius/pxToMm*pathW,radius/pxToMm*pathH,this.tempAngle,this.tempAngle);path.lnTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);return pathId},_calculateArc:function(radius,stAng,swAng,xCenter,yCenter){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH; var pathW=this.chartProp.pathW;var pxToMm=this.chartProp.pxToMM;var x0=xCenter+radius*Math.cos(stAng);var y0=yCenter-radius*Math.sin(stAng);path.moveTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);path.lnTo(x0/pxToMm*pathW,y0/pxToMm*pathH);path.arcTo(radius/pxToMm*pathW,radius/pxToMm*pathH,-1*stAng*cToDeg,-1*swAng*cToDeg);path.lnTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);return pathId},_changeAngle:function(radius,stAng,swAng,xCenter,yCenter,depth,radius1,radius2){yCenter=yCenter-depth/2;var x0= xCenter+radius*Math.cos(stAng);var y0=yCenter-radius*Math.sin(stAng);var kFX=radius/radius1;var kFY=radius/radius2;var cX;if(x0<xCenter)cX=xCenter-(xCenter-x0)/kFX;else if(x0>xCenter)cX=xCenter+(x0-xCenter)/kFX;else cX=xCenter;var cY;if(y0<yCenter)cY=yCenter-(yCenter-y0)/kFY;else if(y0>yCenter)cY=yCenter+(y0-yCenter)/kFY;else cY=yCenter;var x01=xCenter+radius*Math.cos(stAng+swAng);var y01=yCenter-radius*Math.sin(stAng+swAng);var aX;if(x01<xCenter)aX=xCenter-(xCenter-x01)/kFX;else if(x01>xCenter)aX= xCenter+(x01-xCenter)/kFX;else aX=xCenter;var aY;if(y01<yCenter)aY=yCenter-(yCenter-y01)/kFY;else if(y01>yCenter)aY=yCenter+(y01-yCenter)/kFY;else aY=yCenter;this.cX=aX;this.cY=aY;var a=Math.sqrt(Math.pow(cX-xCenter,2)+Math.pow(cY-yCenter,2));var b=Math.sqrt(Math.pow(aX-cX,2)+Math.pow(aY-cY,2));var c=Math.sqrt(Math.pow(aX-xCenter,2)+Math.pow(aY-yCenter,2));var cosNewAngle=(Math.pow(c,2)+Math.pow(a,2)-Math.pow(b,2))/(2*c*a);if(cosNewAngle>1)cosNewAngle=1;if(cosNewAngle<-1)cosNewAngle=-1;var res;if(Math.abs(swAng)> Math.PI)res=2*Math.PI-Math.acos(cosNewAngle);else res=Math.acos(cosNewAngle);return res},_calculateDLbl:function(chartSpace,ser,val,bLayout){var pxToMm=this.chartProp.pxToMM;if(!this.paths.series[val]){var numCache=this._getFirstRealNumCache();if(numCache)for(var i=0;i<numCache.length;i++)if(val===numCache[i].idx){val=i;break}if(!this.paths.series[val])return}var path;if(this.cChartDrawer.nDimensionCount===3){if(this.paths.series[val][ser]&&this.paths.series[val][ser].upPath)path=this.paths.series[val][ser].upPath}else path= this.paths.series[val];if(!AscFormat.isRealNumber(path))return;var getEllipseRadius=function(radius1,radius2,alpha){var a=radius1*radius2;var b=Math.sqrt(Math.pow(radius2,2)*Math.pow(Math.cos(alpha),2)+Math.pow(radius1,2)*Math.pow(Math.sin(alpha),2));return a/b};var oPath=this.cChartSpace.GetPath(path);var oCommand0=oPath.getCommandByIndex(0);var oCommand1=oPath.getCommandByIndex(1);var oCommand2=oPath.getCommandByIndex(2);var centerX=oCommand0.X;var centerY=oCommand0.Y;var radius=oCommand2.hR;var stAng= oCommand2.stAng;var swAng=oCommand2.swAng;if(this.cChartDrawer.nDimensionCount===3&&oCommand2.wR)radius=getEllipseRadius(oCommand2.hR,oCommand2.wR,-1*stAng-swAng/2-Math.PI/2);var _numCache=this.chart.series[0].val.numRef?this.chart.series[0].val.numRef.numCache:this.chart.series[0].val.numLit;var point=_numCache?_numCache.getPtByIndex(val):null;if(!point||!point.compiledDlb)return;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var tempCenterX,tempCenterY;var oPos;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.bestFit:{oPos= this._calculateBestFitPosition(stAng,swAng,radius,width,height,centerX,centerY,bLayout);if(!oPos.bError){centerX=oPos.fX;centerY=oPos.fY}else{centerX=centerX+radius/2*Math.cos(-1*stAng-swAng/2)-width/2;centerY=centerY-radius/2*Math.sin(-1*stAng-swAng/2)-height/2}break}case c_oAscChartDataLabelsPos.ctr:{centerX=centerX+radius/2*Math.cos(-1*stAng-swAng/2)-width/2;centerY=centerY-radius/2*Math.sin(-1*stAng-swAng/2)-height/2;break}case c_oAscChartDataLabelsPos.inBase:{centerX=centerX+radius/2*Math.cos(-1* stAng-swAng/2)-width/2;centerY=centerY-radius/2*Math.sin(-1*stAng-swAng/2)-height/2;break}case c_oAscChartDataLabelsPos.inEnd:{oPos=this._calculateInEndDLblPosition(stAng,swAng,radius,width,height,centerX,centerY);if(!oPos.bError){centerX=oPos.fX;centerY=oPos.fY;break}tempCenterX=centerX+radius*Math.cos(-1*stAng-swAng/2);tempCenterY=centerY-radius*Math.sin(-1*stAng-swAng/2);if(tempCenterX<centerX&&tempCenterY<centerY){centerX=tempCenterX;centerY=tempCenterY}else if(tempCenterX>centerX&&tempCenterY< centerY){centerX=tempCenterX-width;centerY=tempCenterY}else if(tempCenterX<centerX&&tempCenterY>centerY){centerX=tempCenterX;centerY=tempCenterY-height}else{centerX=tempCenterX-width;centerY=tempCenterY-height}break}case c_oAscChartDataLabelsPos.outEnd:{tempCenterX=centerX+radius*Math.cos(-1*stAng-swAng/2);tempCenterY=centerY-radius*Math.sin(-1*stAng-swAng/2);if(tempCenterX<centerX&&tempCenterY<centerY){centerX=tempCenterX-width;centerY=tempCenterY-height}else if(tempCenterX>centerX&&tempCenterY< centerY){centerX=tempCenterX;centerY=tempCenterY-height}else if(tempCenterX<centerX&&tempCenterY>centerY){centerX=tempCenterX-width;centerY=tempCenterY}else{centerX=tempCenterX;centerY=tempCenterY}break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX=this.chartProp.widthCanvas/pxToMm-width;if(centerY<0)centerY=0;if(centerY+height>this.chartProp.heightCanvas/pxToMm)centerY=this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_recalculatePie3D:function(){var trueWidth= this.chartProp.trueWidth;var trueHeight=this.chartProp.trueHeight;var numCache=this._getFirstRealNumCache(true);if(!numCache||!numCache.pts)return;var sumData=this.cChartDrawer._getSumArray(numCache.pts,true);var radius=Math.min(trueHeight,trueWidth)/2;if(radius<0)radius=0;var xCenter=this.chartProp.chartGutter._left+trueWidth/2;var yCenter=this.chartProp.chartGutter._top+trueHeight/2;var startAngle=this.cChartDrawer.processor3D.angleOy?this.cChartDrawer.processor3D.angleOy:0;var startAngle3D=startAngle!== 0&&startAngle!==undefined?this._changeAngle(radius,Math.PI/2,startAngle,xCenter,yCenter,this.properties3d.depth,this.properties3d.radius1,this.properties3d.radius2):0;this.angleFor3D=Math.PI/2-startAngle3D;startAngle=startAngle+Math.PI/2;for(var i=numCache.ptCount-1;i>=0;i--){var point=numCache.getPtByIndex(i);var val=point?point.val:0;var partOfSum=val/sumData;var swapAngle=Math.abs(parseFloat(partOfSum)*(Math.PI*2));if(!this.paths.series)this.paths.series=[];this.paths.series[i]=this._calculateSegment3D(startAngle, swapAngle,radius,xCenter,yCenter);startAngle+=swapAngle}},_recalculatePie3DPerspective:function(){var left=this.chartProp.chartGutter._left;var right=this.chartProp.chartGutter._right;var top=this.chartProp.chartGutter._top;var bottom=this.chartProp.chartGutter._bottom;var trueWidth=this.chartProp.trueWidth;var widthCanvas=this.chartProp.widthCanvas;var heightCanvas=this.chartProp.heightCanvas;var height=heightCanvas-(top+bottom);var width=widthCanvas-(left+right);var tempDepth=this.cChartDrawer.processor3D.depthPerspective; var x1=left,y1=top+height,z1=0;var x2=left,y2=top,z2=0;var x3=left+width,y3=top,z3=0;var x4=left+width,y4=top+height,z4=0;var x5=left,y5=top+height,z5=tempDepth;var x6=left,y6=top,z6=tempDepth;var x7=left+width,y7=top,z7=tempDepth;var x8=left+width,y8=top+height,z8=tempDepth;var point1=this.cChartDrawer._convertAndTurnPoint(x1,y1,z1);var point2=this.cChartDrawer._convertAndTurnPoint(x2,y2,z2);var point5=this.cChartDrawer._convertAndTurnPoint(x5,y5,z5);var point6=this.cChartDrawer._convertAndTurnPoint(x6, y6,z6);var radius3D1=(z6-z2)/2;var radius3D2=(z5-z1)/2;var center3D1=new Point3D(x2+(x3-x2)/2,y2,z2+radius3D1);var center3D2=new Point3D(x1+(x4-x1)/2,y1,z1+radius3D2);var pointCenter1=this.cChartDrawer._convertAndTurnPoint(center3D1.x,center3D1.y,center3D1.z);var pointCenter2=this.cChartDrawer._convertAndTurnPoint(center3D2.x,center3D2.y,center3D2.z);var test1=this.cChartDrawer._convertAndTurnPoint(x2,y2,center3D1.z);var test2=this.cChartDrawer._convertAndTurnPoint(x3,y3,center3D1.z);var test11=this.cChartDrawer._convertAndTurnPoint(x4, y4,center3D2.z);var test22=this.cChartDrawer._convertAndTurnPoint(x1,y1,center3D2.z);var radius11=Math.abs((test2.x-test1.x)/2);var radius12=Math.abs((point6.y-point2.y)/2);var radius21=Math.abs((test22.x-test11.x)/2);var radius22=Math.abs((point5.y-point1.y)/2);var center1={x:this.chartProp.chartGutter._left+trueWidth/2,y:(point2.y-point6.y)/2+point6.y};var center2={x:this.chartProp.chartGutter._left+trueWidth/2,y:(point1.y-point5.y)/2+point5.y};var angles1=this._calculateAngles3DPerspective(center1.x, center1.y,radius11,radius12,radius3D1,center3D1);var angles2=this._calculateAngles3DPerspective(center2.x,center2.y,radius21,radius22,radius3D2,center3D2);if(!this.paths.series)this.paths.series=[];for(var i=0;i<angles1.length;i++){var start=angles1[i].start;var start1=angles2[i].start;if(i===angles1.length-1){var end=angles1[0].start+2*Math.PI;angles1[i].swap=end-start;var end1=angles2[0].start+2*Math.PI;angles2[i].swap=end1-start1}var paths=this._calculateSegment3DPerspective(radius11,radius12, radius21,radius22,angles1[i],angles2[i],center1,center2,pointCenter1,pointCenter2,Math.sign(point2.y-point6.y));if(null===this.tempDrawOrder)this.tempDrawOrder=Math.sign(point2.y-point6.y)<0?true:null;if(!this.paths.series[angles1.length-i-1])this.paths.series[angles1.length-i-1]=[];this.paths.series[angles1.length-i-1].push(paths)}},_calculateAngles3DPerspective:function(xCenter,yCenter,radius1,radius2,radius3D1,center3D1){var t=this;var widthCanvas=this.chartProp.widthCanvas;var numCache=this._getFirstRealNumCache(true); if(!numCache)return;var sumData=this.cChartDrawer._getSumArray(numCache.pts,true);var startAngle=Math.PI/2;var newStartAngle=startAngle;var oView3D=this.cChartSpace.chart.getView3d();var firstAngle=oView3D&&oView3D.rotY?-oView3D.rotY/360*(Math.PI*2):0;var getAngleByCoordsSidesTriangle=function(aC,bC,cC){var res;var a=Math.sqrt(Math.pow(aC.x,2)+Math.pow(aC.y,2));var b=Math.sqrt(Math.pow(bC.x,2)+Math.pow(bC.y,2));var c=Math.sqrt(Math.pow(cC.x,2)+Math.pow(cC.y,2));res=Math.acos((Math.pow(b,2)+Math.pow(c, 2)-Math.pow(a,2))/(2*b*c));return res};var getPointsByAngle=function(angle){var point1=t.cChartDrawer._convertAndTurnPoint(center3D1.x+radius3D1*Math.cos(angle),center3D1.y,center3D1.z+radius3D1*Math.sin(angle));var y11=point1.y;var x11=Math.sqrt(Math.abs(Math.pow(radius1,2)*(1-Math.pow(y11-yCenter,2)/Math.pow(radius2,2))));var x111;if(angle<=3*Math.PI/2&&angle>=Math.PI/2||angle>=-3*Math.PI/2&&angle<=-Math.PI/2)x111=xCenter-x11;else x111=widthCanvas-(xCenter-x11);return{x:x111,y:y11}};var angles= [];for(var i=numCache.ptCount;i>=0;i--){var swapAngle;if(i===numCache.ptCount)swapAngle=firstAngle;else{var point=numCache.getPtByIndex(i);var val=point?point.val:0;var partOfSum=val/sumData;swapAngle=Math.abs(parseFloat(partOfSum)*(Math.PI*2))}var tempSwapAngle=0,newSwapAngle=0,tempStartAngle=startAngle;while(true){if(i===numCache.length&&swapAngle<0)if(tempStartAngle-Math.PI/2>startAngle+swapAngle)tempSwapAngle=-Math.PI/2;else tempSwapAngle=startAngle+swapAngle-tempStartAngle;else if(tempStartAngle+ Math.PI/2<startAngle+swapAngle)tempSwapAngle=Math.PI/2;else tempSwapAngle=startAngle+swapAngle-tempStartAngle;var p1=getPointsByAngle(tempStartAngle);var p2=getPointsByAngle(tempStartAngle+tempSwapAngle);newSwapAngle+=getAngleByCoordsSidesTriangle({x:p2.x-p1.x,y:p2.y-p1.y},{x:xCenter-p1.x,y:yCenter-p1.y},{x:xCenter-p2.x,y:yCenter-p2.y});if(i===numCache.ptCount&&swapAngle<0)if(tempStartAngle-Math.PI/2>startAngle+swapAngle)tempStartAngle-=Math.PI/2;else{if(i!==numCache.ptCount)angles.push({start:newStartAngle, swap:newSwapAngle,end:newStartAngle+newSwapAngle});break}else if(tempStartAngle+Math.PI/2<startAngle+swapAngle)tempStartAngle+=Math.PI/2;else{if(i!==numCache.ptCount)angles.push({start:newStartAngle,swap:newSwapAngle,end:newStartAngle+newSwapAngle});break}}startAngle+=swapAngle;if(i===numCache.ptCount)if(swapAngle<0)newStartAngle-=newSwapAngle;else newStartAngle+=newSwapAngle;else newStartAngle+=newSwapAngle}return angles},_calculateArc3D:function(radius,stAng,swAng,xCenter,yCenter,bIsNotDrawFrontFace, depth,radius1,radius2){var properties=this.cChartDrawer.processor3D.calculatePropertiesForPieCharts();var oChartSpace=this.cChartSpace;depth=!depth?properties.depth:depth;radius1=!radius1?properties.radius1:radius1;radius2=!radius2?properties.radius2:radius2;var pxToMm=this.chartProp.pxToMM;var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;swAng=this._changeAngle(radius,stAng,swAng,xCenter,yCenter,depth,radius1,radius2);stAng=this.angleFor3D;yCenter=yCenter-depth/2;var getSegmentPoints= function(startAng,endAng){var radiusSpec=radius1*radius2/Math.sqrt(Math.pow(radius2,2)*Math.pow(Math.cos(startAng),2)+Math.pow(radius1,2)*Math.pow(Math.sin(startAng),2));var radiusSpec2=radius1*radius2/Math.sqrt(Math.pow(radius2,2)*Math.pow(Math.cos(endAng),2)+Math.pow(radius1,2)*Math.pow(Math.sin(endAng),2));var x0=xCenter+radiusSpec*Math.cos(startAng);var y0=yCenter-radiusSpec*Math.sin(startAng);var x1=xCenter+radiusSpec*Math.cos(startAng);var y1=yCenter+depth-radiusSpec*Math.sin(startAng);var x2= xCenter+radiusSpec2*Math.cos(endAng);var y2=yCenter-radiusSpec2*Math.sin(endAng);var x3=xCenter+radiusSpec2*Math.cos(endAng);var y3=yCenter+depth-radiusSpec2*Math.sin(endAng);return{x0:x0,y0:y0,x1:x1,y1:y1,x2:x2,y2:y2,x3:x3,y3:y3}};var breakAng=function(startAng,swapAng){var res=[];var endAng=startAng+swapAng;var _compare=function(_ang){var deltaAng=1E-14;return startAng<_ang&&endAng>_ang&&_ang-startAng>deltaAng&&endAng-_ang>deltaAng};res.push({angle:startAng});if(_compare(-2*Math.PI))res.push({angle:-2* Math.PI});if(_compare(-Math.PI))res.push({angle:-Math.PI});if(startAng<0&&endAng>0)res.push({angle:0});if(_compare(Math.PI))res.push({angle:Math.PI});if(_compare(2*Math.PI))res.push({angle:2*Math.PI});res.push({angle:endAng});return res};var calculateInsideFaces=function(startAng,swapAng){var pathId=oChartSpace.AllocPath();var path=oChartSpace.GetPath(pathId);var endAng=startAng+swapAng;var p=getSegmentPoints(startAng,endAng);path.moveTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);path.lnTo(p.x0/pxToMm* pathW,p.y0/pxToMm*pathH);path.lnTo(p.x1/pxToMm*pathW,p.y1/pxToMm*pathH);path.lnTo(xCenter/pxToMm*pathW,(yCenter+depth)/pxToMm*pathH);path.moveTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);path.lnTo(p.x2/pxToMm*pathW,p.y2/pxToMm*pathH);path.lnTo(p.x3/pxToMm*pathW,p.y3/pxToMm*pathH);path.lnTo(xCenter/pxToMm*pathW,(yCenter+depth)/pxToMm*pathH);return pathId};var calculateFrontFace=function(startAng,swapAng){var pathId=oChartSpace.AllocPath();var path=oChartSpace.GetPath(pathId);var endAng=startAng+swapAng; var p=getSegmentPoints(startAng,endAng);path.moveTo(p.x0/pxToMm*pathW,p.y0/pxToMm*pathH);path.arcTo(radius1/pxToMm*pathW,radius2/pxToMm*pathH,-1*startAng*cToDeg,-1*swapAng*cToDeg);path.lnTo(p.x3/pxToMm*pathW,p.y3/pxToMm*pathH);path.arcTo(radius1/pxToMm*pathW,radius2/pxToMm*pathH,-1*startAng*cToDeg-1*swapAng*cToDeg,1*swapAng*cToDeg);path.lnTo(p.x0/pxToMm*pathW,p.y0/pxToMm*pathH);return pathId};var calculateUpFace=function(startAng,swapAng){var pathId=oChartSpace.AllocPath();var path=oChartSpace.GetPath(pathId); var endAng=startAng+swapAng;var p=getSegmentPoints(startAng,endAng);path.moveTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);path.lnTo(p.x0/pxToMm*pathW,p.y0/pxToMm*pathH);path.arcTo(radius1/pxToMm*pathW,radius2/pxToMm*pathH,-1*stAng*cToDeg,-1*swapAng*cToDeg);path.lnTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);return pathId};var calculateDownFace=function(startAng,swapAng){var pathId=oChartSpace.AllocPath();var path=oChartSpace.GetPath(pathId);var endAng=startAng+swapAng;var p=getSegmentPoints(startAng, endAng);path.moveTo(xCenter/pxToMm*pathW,(yCenter+depth)/pxToMm*pathH);path.lnTo(p.x0/pxToMm*pathW,(p.y0+depth)/pxToMm*pathH);path.arcTo(radius1/pxToMm*pathW,radius2/pxToMm*pathH,-1*stAng*cToDeg,-1*swapAng*cToDeg);path.lnTo(xCenter/pxToMm*pathW,(yCenter+depth)/pxToMm*pathH);return pathId};var arrAngles=breakAng(stAng,swAng);var frontPath=[];for(var i=1;i<arrAngles.length;i++){var start=arrAngles[i-1].angle;var end=arrAngles[i].angle;var swap=end-start;if(start>=0&&start>=Math.PI&&start<=2*Math.PI|| start<0&&start>=-Math.PI&&start<=0)frontPath.push(calculateFrontFace(start,swap))}var insidePath=calculateInsideFaces(stAng,swAng);var upPath=calculateUpFace(stAng,swAng);var downPath=calculateDownFace(stAng,swAng);this.angleFor3D+=swAng;return{frontPath:frontPath,upPath:upPath,insidePath:insidePath,downPath:downPath}},_calculateSegment3D:function(startAngle,swapAngle,radius,xCenter,yCenter){if(isNaN(swapAngle))return null;if(radius<0)radius=0;var path=[];path.push(this._calculateArc3D(radius,startAngle, swapAngle,xCenter,yCenter));return path},_calculateSegment3DPerspective:function(radiusUp1,radiusUp2,radiusDown1,radiusDown2,angles1,angles2,center1,center2,pointCenter1,pointCenter2,upFaceSign){var xCenter=center1.x,yCenter=center1.y,xCenter1=center2.x,yCenter1=center2.y;var startAngle1=angles1.start,swapAngle1=angles1.swap,startAngle2=angles2.start,swapAngle2=angles2.swap;var pxToMm=this.chartProp.pxToMM;var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var oThis=this;var getSegmentPoints= function(startAng,endAng,startAng2,endAng2){var radiusSpec=radiusUp1*radiusUp2/Math.sqrt(Math.pow(radiusUp2,2)*Math.pow(Math.cos(startAng),2)+Math.pow(radiusUp1,2)*Math.pow(Math.sin(startAng),2));var radiusSpec2=radiusUp1*radiusUp2/Math.sqrt(Math.pow(radiusUp2,2)*Math.pow(Math.cos(endAng),2)+Math.pow(radiusUp1,2)*Math.pow(Math.sin(endAng),2));var radiusSpec11=radiusDown1*radiusDown2/Math.sqrt(Math.pow(radiusDown2,2)*Math.pow(Math.cos(startAng2),2)+Math.pow(radiusDown1,2)*Math.pow(Math.sin(startAng2), 2));var radiusSpec12=radiusDown1*radiusDown2/Math.sqrt(Math.pow(radiusDown2,2)*Math.pow(Math.cos(endAng2),2)+Math.pow(radiusDown1,2)*Math.pow(Math.sin(endAng2),2));var x0=xCenter+radiusSpec*Math.cos(startAng);var y0=yCenter-radiusSpec*Math.sin(startAng);var x1=xCenter1+radiusSpec11*Math.cos(startAng2);var y1=yCenter1-radiusSpec11*Math.sin(startAng2);var x2=xCenter+radiusSpec2*Math.cos(endAng);var y2=yCenter-radiusSpec2*Math.sin(endAng);var x3=xCenter1+radiusSpec12*Math.cos(endAng2);var y3=yCenter1- radiusSpec12*Math.sin(endAng2);return{x0:x0,y0:y0,x1:x1,y1:y1,x2:x2,y2:y2,x3:x3,y3:y3}};var breakAng=function(startAng,swapAng){var res=[];var endAng=startAng+swapAng;res.push({angle:startAng});var tempStartAng=startAng;var tempEndAng=endAng;var tempPI=Math.PI;if(tempStartAng<=-2*tempPI&&tempEndAng>-2*tempPI)res.push({angle:-2*Math.PI});if(tempStartAng<=-tempPI&&tempEndAng>-tempPI)res.push({angle:-Math.PI});if(tempStartAng<=0&&tempEndAng>0)res.push({angle:0});if(tempStartAng<=tempPI&&tempEndAng>tempPI)res.push({angle:Math.PI}); if(tempStartAng<=2*tempPI&&tempEndAng>2*tempPI)res.push({angle:2*Math.PI});res.push({angle:endAng});return res};var calculateInsideFaces=function(startAng1,swapAng1,startAng2,swapAng2){var pathId=oThis.cChartSpace.AllocPath();var path=oThis.cChartSpace.GetPath(pathId);var endAng1=startAng1+swapAng1;var endAng2=startAng2+swapAng2;var p=getSegmentPoints(startAng1,endAng1,startAng2,endAng2);path.moveTo(pointCenter1.x/pxToMm*pathW,pointCenter1.y/pxToMm*pathH);path.lnTo(p.x0/pxToMm*pathW,p.y0/pxToMm*pathH); path.lnTo(p.x1/pxToMm*pathW,p.y1/pxToMm*pathH);path.lnTo(pointCenter2.x/pxToMm*pathW,pointCenter2.y/pxToMm*pathH);path.moveTo(pointCenter1.x/pxToMm*pathW,pointCenter1.y/pxToMm*pathH);path.lnTo(p.x2/pxToMm*pathW,p.y2/pxToMm*pathH);path.lnTo(p.x3/pxToMm*pathW,p.y3/pxToMm*pathH);path.lnTo(pointCenter2.x/pxToMm*pathW,pointCenter2.y/pxToMm*pathH);return pathId};var calculateFrontFace=function(startAng,swapAng,startAng2,swapAng2){if(isNaN(startAng)||isNaN(swapAng))return null;var pathId=oThis.cChartSpace.AllocPath(); var path=oThis.cChartSpace.GetPath(pathId);var endAng=startAng+swapAng;var endAng2=startAng2+swapAng2;var p=getSegmentPoints(startAng,endAng,startAng2,endAng2);path.moveTo(p.x0/pxToMm*pathW,p.y0/pxToMm*pathH);path.arcTo(radiusUp1/pxToMm*pathW,radiusUp2/pxToMm*pathH,-1*startAng*cToDeg,-1*swapAng*cToDeg);path.lnTo(p.x3/pxToMm*pathW,p.y3/pxToMm*pathH);path.arcTo(radiusDown1/pxToMm*pathW,radiusDown2/pxToMm*pathH,-1*startAng2*cToDeg-1*swapAng2*cToDeg,1*swapAng2*cToDeg);path.lnTo(p.x0/pxToMm*pathW,p.y0/ pxToMm*pathH);return pathId};var calculateUpFace=function(startAng,swapAng){if(isNaN(startAng)||isNaN(swapAng))return null;var pathId=oThis.cChartSpace.AllocPath();var path=oThis.cChartSpace.GetPath(pathId);var radiusSpec=radiusUp1*radiusUp2/Math.sqrt(Math.pow(radiusUp2,2)*Math.pow(Math.cos(startAng),2)+Math.pow(radiusUp1,2)*Math.pow(Math.sin(startAng),2));var x0=xCenter+radiusSpec*Math.cos(startAng);var y0=yCenter-radiusSpec*Math.sin(startAng);path.moveTo(pointCenter1.x/pxToMm*pathW,pointCenter1.y/ pxToMm*pathH);path.lnTo(x0/pxToMm*pathW,y0/pxToMm*pathH);path.arcTo(radiusUp1/pxToMm*pathW,radiusUp2/pxToMm*pathH,-1*startAng*cToDeg,-1*swapAng*cToDeg);path.lnTo(pointCenter1.x/pxToMm*pathW,pointCenter1.y/pxToMm*pathH);return pathId};var calculateDownFace=function(startAng,swapAng){if(isNaN(startAng)||isNaN(swapAng))return null;var pathId=oThis.cChartSpace.AllocPath();var path=oThis.cChartSpace.GetPath(pathId);var radiusSpec=radiusDown1*radiusDown2/Math.sqrt(Math.pow(radiusDown2,2)*Math.pow(Math.cos(startAng), 2)+Math.pow(radiusDown1,2)*Math.pow(Math.sin(startAng),2));var x=xCenter1+radiusSpec*Math.cos(startAng);var y=yCenter1-radiusSpec*Math.sin(startAng);path.moveTo(pointCenter2.x/pxToMm*pathW,pointCenter2.y/pxToMm*pathH);path.lnTo(x/pxToMm*pathW,y/pxToMm*pathH);path.arcTo(radiusDown1/pxToMm*pathW,radiusDown2/pxToMm*pathH,-1*startAng*cToDeg,-1*swapAng*cToDeg);path.lnTo(pointCenter2.x/pxToMm*pathW,pointCenter2.y/pxToMm*pathH);return pathId};var arrAngles=breakAng(startAngle1,swapAngle1);var arrAngles2= breakAng(startAngle2,swapAngle2);var frontPath=[];for(var i=1;i<arrAngles.length;i++){var start=arrAngles[i-1].angle;var end=arrAngles[i].angle;var swap=end-start;var start2=arrAngles2[i-1].angle;var end2;if(!arrAngles2[i])end2=arrAngles2[i-1].angle;else end2=arrAngles2[i].angle;var swap2=end2-start2;if(start>=0&&start>=Math.PI&&start<=2*Math.PI||start<0&&start>=-Math.PI&&start<=0)frontPath.push(calculateFrontFace(upFaceSign*start,upFaceSign*swap,start2,swap2))}var insidePath=calculateInsideFaces(upFaceSign* startAngle1,upFaceSign*swapAngle1,startAngle2,swapAngle2);var upPath=calculateUpFace(upFaceSign*startAngle1,upFaceSign*swapAngle1);var downPath=calculateDownFace(startAngle2,swapAngle2);return{frontPath:frontPath,upPath:upPath,insidePath:insidePath,downPath:downPath}},_drawPie3D:function(){var numCache=this._getFirstRealNumCache(true);var t=this;var shade="shade";var shadeValue=35E3;var drawPath=function(path,pen,brush,isShadePen,isShadeBrush){if(path){if(brush){var props=t.cChartSpace.getParentObjects(); var duplicateBrush=brush.createDuplicate();var cColorMod=new AscFormat.CColorMod;cColorMod.val=shadeValue;cColorMod.name=shade;if(duplicateBrush){duplicateBrush.addColorMod(cColorMod);duplicateBrush.calculate(props.theme,props.slide,props.layout,props.master,(new AscFormat.CUniColor).RGBA,t.cChartSpace.clrMapOvr)}if(isShadePen)pen=AscFormat.CreatePenFromParams(duplicateBrush,undefined,undefined,undefined,undefined,0);if(isShadeBrush)brush=duplicateBrush}t.cChartDrawer.drawPath(path,pen,brush)}};var _firstPoint= numCache.getPtByIndex(0);var pen=_firstPoint?_firstPoint.pen:null;drawPath(this.paths.test,pen,null);var sides={down:0,inside:1,up:2,front:3};var drawPaths=function(side){for(var i=0,len=numCache.ptCount;i<len;i++){var point=numCache.getPtByIndex(i);var brush=point?point.brush:null;var pen=point?point.pen:null;var path=t.paths.series[i];if(path)for(var j=path.length-1;j>=0;j--)if(side===sides.down)drawPath(path[j].downPath,pen,null);else if(side===sides.inside){if(pen&&pen.Join){pen=pen.createDuplicate(); pen.Join.type=Asc["c_oAscLineJoinType"].Round}drawPath(path[j].insidePath,pen,brush,null,true)}else if(side===sides.up)drawPath(path[j].upPath,pen,brush);else if(side===sides.front)for(var k=0;k<path[j].frontPath.length;k++)drawPath(path[j].frontPath[k],pen,brush,true,true)}};drawPaths(sides.down);drawPaths(sides.inside);if(this.tempDrawOrder!==null){drawPaths(sides.up);drawPaths(sides.front)}else{drawPaths(sides.front);drawPaths(sides.up)}},_calculateBestFitPosition:function(fStartAngle,fSweepAngle, fRadius,fWidth,fHeight,fCenterX,fCenterY,bLayout){var fStartAngle_=fStartAngle;var fEndAngle=fStartAngle+fSweepAngle;if(bLayout)return this._calculateBestFitPositionOuter(fStartAngle_,fEndAngle,fRadius,fWidth,fHeight,fCenterX,fCenterY);var oRet=this._calculateBestFitPositionInner(fStartAngle_,fEndAngle,fRadius,fWidth,fHeight,fCenterX,fCenterY);if(!oRet.bError)if(AscFormat.fCheckBoxIntersectionSegment(oRet.fX,oRet.fY,fWidth,fHeight,fCenterX,fCenterY,fCenterX+fRadius*Math.cos(fStartAngle_),fCenterY+ fRadius*Math.sin(fStartAngle_))||AscFormat.fCheckBoxIntersectionSegment(oRet.fX,oRet.fY,fWidth,fHeight,fCenterX,fCenterY,fCenterX+fRadius*Math.cos(fEndAngle),fCenterY+fRadius*Math.sin(fEndAngle)))oRet.bError=true;if(oRet.bError)return this._calculateBestFitPositionOuter(fStartAngle_,fEndAngle,fRadius,fWidth,fHeight,fCenterX,fCenterY);return oRet},_calculateBestFitPositionInner:function(fStartAngle,fEndAngle,fPieRadius,fLabelWidth,fLabelHeight,fCenterX,fCenterY){var oResult={bError:true};var fBisectAngle= AscFormat.normalizeRotate((fStartAngle+fEndAngle)/2);if(AscFormat.fApproxEqual(fBisectAngle,0)||AscFormat.fApproxEqual(fBisectAngle,Math.PI/2)||AscFormat.fApproxEqual(fBisectAngle,Math.PI)||AscFormat.fApproxEqual(fBisectAngle,3*Math.PI/2))return this._calculateInEndDLblPosition(fStartAngle,fEndAngle-fStartAngle,fPieRadius,fLabelWidth,fLabelHeight,fCenterX,fCenterY);var fBisectAngle2=AscFormat.normalizeRotate(fBisectAngle+Math.PI/4)-Math.PI/4;var nIndexArea=(fBisectAngle2+Math.PI/4)/(Math.PI/2)>>0; var fLengthCoeff=(fBisectAngle2+Math.PI/4-Math.PI/2*nIndexArea)/(Math.PI/2);var fXs=fCenterX+fPieRadius*Math.cos(fBisectAngle);var fYs=fCenterY+fPieRadius*Math.sin(fBisectAngle);var fDeltaX,fDeltaY,oSolvation;switch(nIndexArea){case 0:{if(fBisectAngle2<0){fDeltaX=fLabelWidth;fDeltaY=-(1-fLengthCoeff)*fLabelHeight}else{fDeltaX=fLabelWidth;fDeltaY=fLabelHeight*fLengthCoeff}oSolvation=AscFormat.fSolveQuadraticEquation(fPieRadius*fPieRadius,2*(fDeltaX*(fXs-fCenterX)+fDeltaY*(fYs-fCenterY)),fDeltaX*fDeltaX+ fDeltaY*fDeltaY-fPieRadius*fPieRadius);if(!oSolvation.bError)if(oSolvation.x1>0&&oSolvation.x1<1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX);oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)-(1-fLengthCoeff)*fLabelHeight}else if(oSolvation.x2>0&&oSolvation.x2<1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX);oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-(1-fLengthCoeff)*fLabelHeight}break}case 1:{if(fBisectAngle<Math.PI/2){fDeltaX=(1-fLengthCoeff)* fLabelWidth;fDeltaY=fLabelHeight}else{fDeltaX=-fLengthCoeff*fLabelWidth;fDeltaY=fLabelHeight}oSolvation=AscFormat.fSolveQuadraticEquation(fPieRadius*fPieRadius,2*(fDeltaX*(fXs-fCenterX)+fDeltaY*(fYs-fCenterY)),fDeltaX*fDeltaX+fDeltaY*fDeltaY-fPieRadius*fPieRadius);if(!oSolvation.bError)if(oSolvation.x1>0&&oSolvation.x1<1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-fLabelWidth*fLengthCoeff;oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)}else if(oSolvation.x2>0&&oSolvation.x2< 1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)-fLabelWidth*fLengthCoeff;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)}break}case 2:{if(fBisectAngle<Math.PI){fDeltaX=-fLabelWidth;fDeltaY=(1-fLengthCoeff)*fLabelHeight}else{fDeltaX=-fLabelWidth;fDeltaY=-fLengthCoeff*fLabelHeight}oSolvation=AscFormat.fSolveQuadraticEquation(fPieRadius*fPieRadius,2*(fDeltaX*(fXs-fCenterX)+fDeltaY*(fYs-fCenterY)),fDeltaX*fDeltaX+fDeltaY*fDeltaY-fPieRadius*fPieRadius);if(!oSolvation.bError)if(oSolvation.x1> 0&&oSolvation.x1<1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-fLabelWidth;oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)-fLabelHeight*fLengthCoeff}else if(oSolvation.x2>0&&oSolvation.x2<1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)-fLabelWidth;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-fLabelHeight*fLengthCoeff}break}case 3:{fLengthCoeff=1-fLengthCoeff;if(fBisectAngle<3*Math.PI/2){fDeltaX=-fLabelWidth*fLengthCoeff;fDeltaY=-fLabelHeight}else{fDeltaX= (1-fLengthCoeff)*fLabelWidth;fDeltaY=-fLabelHeight}oSolvation=AscFormat.fSolveQuadraticEquation(fPieRadius*fPieRadius,2*(fDeltaX*(fXs-fCenterX)+fDeltaY*(fYs-fCenterY)),fDeltaX*fDeltaX+fDeltaY*fDeltaY-fPieRadius*fPieRadius);if(!oSolvation.bError)if(oSolvation.x1>0&&oSolvation.x1<1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-fLabelWidth*fLengthCoeff;oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)-fLabelHeight}else if(oSolvation.x2>0&&oSolvation.x2<1){oResult.bError=false; oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)-fLabelWidth*fLengthCoeff;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-fLabelHeight}break}}return oResult},_calculateBestFitPositionOuter:function(fStartAngle,fEndAngle,fPieRadius,fLabelWidth,fLabelHeight,fCenterX,fCenterY){var oResult={bError:true};var fBisectAngle=AscFormat.normalizeRotate((fStartAngle+fEndAngle)/2);var fBisectAngle2=AscFormat.normalizeRotate(fBisectAngle+Math.PI/4)-Math.PI/4;var nIndexArea=(fBisectAngle2+Math.PI/4)/(Math.PI/2)>> 0;var fLengthCoeff=(fBisectAngle2+Math.PI/4-Math.PI/2*nIndexArea)/(Math.PI/2);var fXs=fCenterX+fPieRadius*Math.cos(fBisectAngle);var fYs=fCenterY+fPieRadius*Math.sin(fBisectAngle);var fDeltaX,fDeltaY,oSolvation;var fAngleApproxDelta=1E-4;switch(nIndexArea){case 0:{if(AscFormat.fApproxEqual(fBisectAngle2,0,fAngleApproxDelta)){fDeltaX=0;fDeltaY=0}else if(fBisectAngle2<0){fDeltaX=0;fDeltaY=fLengthCoeff*fLabelHeight}else{fDeltaX=0;fDeltaY=-(1-fLengthCoeff)*fLabelHeight}oSolvation=AscFormat.fSolveQuadraticEquation(fPieRadius* fPieRadius,2*(fDeltaX*(fXs-fCenterX)+fDeltaY*(fYs-fCenterY)),fDeltaX*fDeltaX+fDeltaY*fDeltaY-fPieRadius*fPieRadius);if(!oSolvation.bError)if(oSolvation.x1>=1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX);oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)-(1-fLengthCoeff)*fLabelHeight}else if(oSolvation.x2>=1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX);oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-(1-fLengthCoeff)*fLabelHeight}else if(oSolvation.x1>= 0){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX);oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)-(1-fLengthCoeff)*fLabelHeight}else if(oSolvation.x2>=0){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX);oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-(1-fLengthCoeff)*fLabelHeight}break}case 1:{if(AscFormat.fApproxEqual(fBisectAngle,Math.PI/2,fAngleApproxDelta)){fDeltaX=0;fDeltaY=0}else if(fBisectAngle<Math.PI/2){fDeltaX=-fLengthCoeff*fLabelWidth;fDeltaY= 0}else{fDeltaX=(1-fLengthCoeff)*fLabelWidth;fDeltaY=0}oSolvation=AscFormat.fSolveQuadraticEquation(fPieRadius*fPieRadius,2*(fDeltaX*(fXs-fCenterX)+fDeltaY*(fYs-fCenterY)),fDeltaX*fDeltaX+fDeltaY*fDeltaY-fPieRadius*fPieRadius);if(!oSolvation.bError)if(oSolvation.x1>=1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-fLabelWidth*fLengthCoeff;oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)}else if(oSolvation.x2>=1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)- fLabelWidth*fLengthCoeff;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)}else if(oSolvation.x1>=0){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-fLabelWidth*fLengthCoeff;oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)}else if(oSolvation.x2>=0){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)-fLabelWidth*fLengthCoeff;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)}break}case 2:{if(AscFormat.fApproxEqual(fBisectAngle,Math.PI,fAngleApproxDelta)){fDeltaX= 0;fDeltaY=0}else if(fBisectAngle<Math.PI){fDeltaX=0;fDeltaY=-fLengthCoeff*fLabelHeight}else{fDeltaX=0;fDeltaY=(1-fLengthCoeff)*fLabelHeight}oSolvation=AscFormat.fSolveQuadraticEquation(fPieRadius*fPieRadius,2*(fDeltaX*(fXs-fCenterX)+fDeltaY*(fYs-fCenterY)),fDeltaX*fDeltaX+fDeltaY*fDeltaY-fPieRadius*fPieRadius);if(!oSolvation.bError)if(oSolvation.x1>=1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-fLabelWidth;oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)-fLabelHeight*fLengthCoeff}else if(oSolvation.x2>= 1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)-fLabelWidth;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-fLabelHeight*fLengthCoeff}else if(oSolvation.x1>=0){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-fLabelWidth;oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)-fLabelHeight*fLengthCoeff}else if(oSolvation.x2>=0){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)-fLabelWidth;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-fLabelHeight* fLengthCoeff}break}case 3:{if(fBisectAngle<3*Math.PI/2){fDeltaX=fLabelWidth*fLengthCoeff;fDeltaY=0}else{fDeltaX=-(1-fLengthCoeff)*fLabelWidth;fDeltaY=0}oSolvation=AscFormat.fSolveQuadraticEquation(fPieRadius*fPieRadius,2*(fDeltaX*(fXs-fCenterX)+fDeltaY*(fYs-fCenterY)),fDeltaX*fDeltaX+fDeltaY*fDeltaY-fPieRadius*fPieRadius);if(!oSolvation.bError)if(oSolvation.x1>=1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-(1-fLengthCoeff)*fLabelWidth;oResult.fY=fCenterY+oSolvation.x1*(fYs- fCenterY)-fLabelHeight}else if(oSolvation.x2>=1){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)-(1-fLengthCoeff)*fLabelWidth;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-fLabelHeight}else if(oSolvation.x1>=0){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x1*(fXs-fCenterX)-(1-fLengthCoeff)*fLabelWidth;oResult.fY=fCenterY+oSolvation.x1*(fYs-fCenterY)-fLabelHeight}else if(oSolvation.x2>=0){oResult.bError=false;oResult.fX=fCenterX+oSolvation.x2*(fXs-fCenterX)-(1-fLengthCoeff)* fLabelWidth;oResult.fY=fCenterY+oSolvation.x2*(fYs-fCenterY)-fLabelHeight}break}}return oResult},_calculateInEndDLblPosition:function(fStartAngle,fSweepAngle,fPieRadius,fLabelWidth,fLabelHeight,fCenterX,fCenterY){var fEndAngle=fStartAngle+fSweepAngle;var oResult={bError:true,fX:0,fY:0};var fBisectAngle=AscFormat.normalizeRotate((fStartAngle+fEndAngle)/2);var nQuadrantIndex=2*fBisectAngle/Math.PI>>0;var fHalfRectWidthVector=fLabelWidth/2,fHalfRectHeightVector=fLabelHeight/2;if(nQuadrantIndex===1|| nQuadrantIndex==2)fHalfRectWidthVector=-fHalfRectWidthVector;if(nQuadrantIndex===2||nQuadrantIndex==3)fHalfRectHeightVector=-fHalfRectHeightVector;var fXs=fCenterX+fPieRadius*Math.cos(fBisectAngle),fYs=fCenterY+fPieRadius*Math.sin(fBisectAngle);var a=fPieRadius*fPieRadius,b=2*((fXs-fCenterX)*fHalfRectWidthVector+(fYs-fCenterY)*fHalfRectHeightVector),c=fHalfRectWidthVector*fHalfRectWidthVector+fHalfRectHeightVector*fHalfRectHeightVector-fPieRadius*fPieRadius;var oSolution=AscFormat.fSolveQuadraticEquation(a, b,c);if(oSolution.bError)return oResult;var D=b*b-4*a*c;if(D<0)return oResult;var t1=oSolution.x1,t2=oSolution.x2;if(t1>0&&t1<1){oResult.bError=false;oResult.fX=fCenterX+t1*(fXs-fCenterX)-fLabelWidth/2;oResult.fY=fCenterY+t1*(fYs-fCenterY)-fLabelHeight/2;return oResult}if(t2>0&&t2<1){oResult.bError=false;oResult.fX=fCenterX+t2*(fXs-fCenterX)-fLabelWidth/2;oResult.fY=fCenterY+t2*(fYs-fCenterY)-fLabelHeight/2;return oResult}return oResult},_calculateTestFrame:function(point1,point2,point3,point4,point5, point6,point7,point8){var pxToMm=this.chartProp.pxToMM;var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);path.moveTo(point1.x/pxToMm*pathW,point1.y/pxToMm*pathH);path.lnTo(point2.x/pxToMm*pathW,point2.y/pxToMm*pathH);path.lnTo(point3.x/pxToMm*pathW,point3.y/pxToMm*pathH);path.lnTo(point4.x/pxToMm*pathW,point4.y/pxToMm*pathH);path.lnTo(point1.x/pxToMm*pathW,point1.y/pxToMm*pathH);path.moveTo(point5.x/pxToMm* pathW,point5.y/pxToMm*pathH);path.lnTo(point6.x/pxToMm*pathW,point6.y/pxToMm*pathH);path.lnTo(point7.x/pxToMm*pathW,point7.y/pxToMm*pathH);path.lnTo(point8.x/pxToMm*pathW,point8.y/pxToMm*pathH);path.lnTo(point5.x/pxToMm*pathW,point5.y/pxToMm*pathH);path.moveTo(point1.x/pxToMm*pathW,point1.y/pxToMm*pathH);path.lnTo(point5.x/pxToMm*pathW,point5.y/pxToMm*pathH);path.moveTo(point2.x/pxToMm*pathW,point2.y/pxToMm*pathH);path.lnTo(point6.x/pxToMm*pathW,point6.y/pxToMm*pathH);path.moveTo(point3.x/pxToMm* pathW,point3.y/pxToMm*pathH);path.lnTo(point7.x/pxToMm*pathW,point7.y/pxToMm*pathH);path.moveTo(point4.x/pxToMm*pathW,point4.y/pxToMm*pathH);path.lnTo(point8.x/pxToMm*pathW,point8.y/pxToMm*pathH);this.paths.test=pathId},_recalculatePie3D_Slow:function(){var trueWidth=this.chartProp.trueWidth;var trueHeight=this.chartProp.trueHeight;var numCache=this._getFirstRealNumCache();if(!numCache)return;var sumData=this.cChartDrawer._getSumArray(numCache,true);var radius=Math.min(trueHeight,trueWidth)/2;if(radius< 0)radius=0;var xCenter=this.chartProp.chartGutter._left+trueWidth/2;var yCenter=this.chartProp.chartGutter._top+trueHeight/2;var startAngle=this.cChartDrawer.processor3D.angleOy?this.cChartDrawer.processor3D.angleOy:0;var startAngle3D=startAngle!==0&&startAngle!==undefined?this._changeAngle(radius,Math.PI/2,startAngle,xCenter,yCenter,this.properties3d):0;this.tempAngle=Math.PI/2+startAngle;this.angleFor3D=Math.PI/2-startAngle3D;var depth=this.properties3d.depth;for(var n=0;n<depth;n++){if(!this.paths.series)this.paths.series= [];for(var i=numCache.length-1;i>=0;i--){var angle=Math.abs(parseFloat(numCache[i].val/sumData)*(Math.PI*2));if(!this.paths.series[n])this.paths.series[n]=[];if(sumData===0)this.paths.series[n][i]=this._calculateEmptySegment(radius,xCenter,yCenter);else this.paths.series[n][i]=this._calculateSegment3D(angle,radius,xCenter,yCenter,n,i)}}},_calculateSegment3D_Slow:function(angle,radius,xCenter,yCenter,depth,i){if(isNaN(angle))return null;var startAngle=this.tempAngle;var path=this._calculateArc3D(radius, startAngle,angle,xCenter,yCenter,depth,i);this.tempAngle+=angle;return path},_calculateArc3D_Slow:function(radius,stAng,swAng,xCenter,yCenter,depth,seriaNum){var radius1=this.properties3d.radius1;var radius2=this.properties3d.radius2;var pxToMm=this.chartProp.pxToMM;var t=this;var x0,y0,radiusSpec;var calculateProps=function(){if(t.usually3dPropsCalc&&t.usually3dPropsCalc[seriaNum]){swAng=t.usually3dPropsCalc[seriaNum].swAng;stAng=t.usually3dPropsCalc[seriaNum].stAng;radiusSpec=t.usually3dPropsCalc[seriaNum].radiusSpec; x0=t.usually3dPropsCalc[seriaNum].x0;yCenter=yCenter+t.properties3d.depth/2-depth;y0=yCenter-radiusSpec*Math.sin(stAng)}else{swAng=t._changeAngle(radius,stAng,swAng,xCenter,yCenter,t.properties3d);stAng=t.angleFor3D;yCenter=yCenter+t.properties3d.depth/2-depth;radiusSpec=radius1*radius2/Math.sqrt(Math.pow(radius2,2)*Math.pow(Math.cos(stAng),2)+Math.pow(radius1,2)*Math.pow(Math.sin(stAng),2));x0=xCenter+radiusSpec*Math.cos(stAng);y0=yCenter-radiusSpec*Math.sin(stAng)}};var pathId=this.cChartSpace.AllocPath(); var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;calculateProps();path.moveTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);path.lnTo(x0/pxToMm*pathW,y0/pxToMm*pathH);path.arcTo(radius1/pxToMm*pathW,radius2/pxToMm*pathH,-1*stAng*cToDeg,-1*swAng*cToDeg);path.lnTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);this.angleFor3D+=swAng;if(!this.usually3dPropsCalc[seriaNum])this.usually3dPropsCalc[seriaNum]={swAng:swAng,stAng:stAng,xCenter:xCenter,x0:x0,radiusSpec:radiusSpec}; return pathId},_drawPie3D_Slow:function(){var numCache=this._getFirstRealNumCache();if(!numCache)return;var props=this.cChartSpace.getParentObjects();var brush,pen,val;var path;for(var n=0;n<this.paths.series.length;n++)for(var i=0,len=numCache.length;i<len;i++){val=numCache[i];brush=val.brush;if(n===0||n===this.paths.series.length-1)pen=val.pen;else pen=null;path=this.paths.series[n][i];var duplicateBrush=brush;if(n!==this.paths.series.length-1){duplicateBrush=brush.createDuplicate();var cColorMod= new AscFormat.CColorMod;cColorMod.val=35E3;cColorMod.name="shade";duplicateBrush.addColorMod(cColorMod);duplicateBrush.calculate(props.theme,props.slide,props.layout,props.master,(new AscFormat.CUniColor).RGBA,this.cChartSpace.clrMapOvr)}this.cChartDrawer.drawPath(path,pen,duplicateBrush)}}};function drawDoughnutChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace;this.chart=chart;this.tempAngle=null;this.paths={}} drawDoughnutChart.prototype={constructor:drawDoughnutChart,draw:function(){this._drawPie()},recalculate:function(){var countSeries=this.cChartDrawer.calculateCountSeries(this.chart);this.seriesCount=countSeries.series;this.tempAngle=null;this.paths={};this._reCalculatePie()},_drawPie:function(){var brush,pen;var path;var idxPoint,numCache;for(var n=0;n<this.chart.series.length;n++){numCache=this.cChartDrawer.getNumCache(this.chart.series[n].val);if(!numCache)continue;for(var k=0;k<numCache.ptCount;k++){if(!this.paths.series[n]|| !this.paths.series[n][k])continue;idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[n],k);brush=idxPoint?idxPoint.brush:null;pen=idxPoint?idxPoint.pen:null;path=this.paths.series[n][k];this.cChartDrawer.drawPath(path,pen,brush)}}},_reCalculatePie:function(){var trueWidth=this.chartProp.trueWidth;var trueHeight=this.chartProp.trueHeight;var sumData;var outRadius=Math.min(trueHeight,trueWidth)/2;var defaultSize=50;var holeSize=this.chart.holeSize?this.chart.holeSize:defaultSize;var firstSliceAng= this.chart.firstSliceAng?this.chart.firstSliceAng:0;firstSliceAng=firstSliceAng/360*(Math.PI*2);var radius=outRadius*(holeSize/100);var step=(outRadius-radius)/this.seriesCount;var xCenter=this.chartProp.chartGutter._left+trueWidth/2;var yCenter=this.chartProp.chartGutter._top+trueHeight/2;var numCache,idxPoint,angle,curVal,seriesCounter=0;for(var n=0;n<this.chart.series.length;n++){this.tempAngle=Math.PI/2;numCache=this.cChartDrawer.getNumCache(this.chart.series[n].val);if(!numCache||this.chart.series[n].isHidden)continue; sumData=this.cChartDrawer._getSumArray(numCache.pts,true);for(var k=numCache.ptCount-1;k>=0;k--){idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[n],k);curVal=idxPoint?idxPoint.val:0;angle=Math.abs(parseFloat(curVal/sumData)*(Math.PI*2));if(angle<1E-15)angle=0;if(!this.paths.series)this.paths.series=[];if(!this.paths.series[n])this.paths.series[n]=[];if(angle)this.paths.series[n][k]=this._calculateSegment(angle,radius,xCenter,yCenter,radius+step*(seriesCounter+1),radius+step*seriesCounter, firstSliceAng);else this.paths.series[n][k]=null}if(numCache.pts.length)seriesCounter++}},_calculateSegment:function(angle,radius,xCenter,yCenter,radius1,radius2,firstSliceAng){var startAngle=this.tempAngle-firstSliceAng;var endAngle=angle;if(radius<0)radius=0;var path=this._calculateArc(radius,startAngle,endAngle,xCenter,yCenter,radius1,radius2);this.tempAngle+=angle;return path},_calculateArc:function(radius,stAng,swAng,xCenter,yCenter,radius1,radius2){var pathId=this.cChartSpace.AllocPath();var path= this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var pxToMm=this.chartProp.pxToMM;var x2=xCenter+radius1*Math.cos(stAng);var y2=yCenter-radius1*Math.sin(stAng);var x1=xCenter+radius2*Math.cos(stAng);var y1=yCenter-radius2*Math.sin(stAng);var x4=xCenter+radius2*Math.cos(stAng+swAng);var y4=yCenter-radius2*Math.sin(stAng+swAng);path.moveTo(x1/pxToMm*pathW,y1/pxToMm*pathH);path.lnTo(x2/pxToMm*pathW,y2/pxToMm*pathH);path.arcTo(radius1/pxToMm*pathW,radius1/ pxToMm*pathH,-1*stAng*cToDeg,-1*swAng*cToDeg);path.lnTo(x4/pxToMm*pathW,y4/pxToMm*pathH);path.arcTo(radius2/pxToMm*pathW,radius2/pxToMm*pathH,-1*stAng*cToDeg-swAng*cToDeg,swAng*cToDeg);path.moveTo(xCenter/pxToMm*pathW,yCenter/pxToMm*pathH);return pathId},_calculateDLbl:function(chartSpace,ser,val){if(!AscFormat.isRealNumber(this.paths.series[ser][val]))return;var path=this.paths.series[ser][val];var oPath=this.cChartSpace.GetPath(path);var oCommand2=oPath.getCommandByIndex(2);var oCommand4=oPath.getCommandByIndex(4); var oCommand5=oPath.getCommandByIndex(5);var radius1=oCommand2.hR;var stAng=oCommand2.stAng;var swAng=oCommand2.swAng;var radius2=oCommand4.hR;var xCenter=oCommand5.X;var yCenter=oCommand5.Y;var newRadius=radius2+(radius1-radius2)/2;var centerX=xCenter+newRadius*Math.cos(-1*stAng-swAng/2);var centerY=yCenter-newRadius*Math.sin(-1*stAng-swAng/2);var numCache=this.cChartDrawer.getNumCache(this.chart.series[ser].val);var point=null;if(numCache)point=numCache.getPtByIndex(val);if(!point)return;var width= point.compiledDlb.extX;var height=point.compiledDlb.extY;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.ctr:{centerX=centerX-width/2;centerY=centerY-height/2;break}case c_oAscChartDataLabelsPos.inBase:{centerX=centerX-width/2;centerY=centerY-height/2;break}}if(centerX<0)centerX=0;if(centerY<0)centerY=0;return{x:centerX,y:centerY}}};function drawRadarChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace; this.chart=chart;this.subType=null;this.valAx=null;this.paths={}}drawRadarChart.prototype={constructor:drawRadarChart,draw:function(){this._drawLines()},recalculate:function(){this.paths={};this.subType=this.cChartDrawer.getChartGrouping(this.chart);this.valAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_ValAx);this._calculateLines()},_calculateLines:function(){var yPoints=this.valAx.yPoints;var trueWidth=this.chartProp.trueWidth;var trueHeight=this.chartProp.trueHeight; var xCenter=(this.chartProp.chartGutter._left+trueWidth/2)/this.chartProp.pxToMM;var yCenter=(this.chartProp.chartGutter._top+trueHeight/2)/this.chartProp.pxToMM;var y,y1,x,x1,val,nextVal,seria,dataSeries;var numCache=this.cChartDrawer.getNumCache(this.chart.series[0].val).pts;if(!numCache)return;var tempAngle=2*Math.PI/numCache.length;var xDiff=trueHeight/2/yPoints.length/this.chartProp.pxToMM;var radius,radius1,xFirst,yFirst;for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i]; dataSeries=this.cChartDrawer.getNumCache(seria.val);if(!dataSeries)continue;if(dataSeries.length===1){n=0;val=this._getYVal(n,i);y=val*xDiff;x=xCenter;radius=y;y=yCenter-radius*Math.cos(n*tempAngle);x=x+radius*Math.sin(n*tempAngle);if(!this.paths.points)this.paths.points=[];if(!this.paths.points[i])this.paths.points[i]=[];this.paths.points[i][n]=this.cChartDrawer.calculatePoint(x,y,dataSeries[n].compiledMarker.size,dataSeries[n].compiledMarker.symbol)}else for(var n=0;n<dataSeries.length-1;n++){val= this._getYVal(n,i);nextVal=this._getYVal(n+1,i);y=val*xDiff;y1=nextVal*xDiff;x=xCenter;x1=xCenter;radius=y;radius1=y1;y=yCenter-radius*Math.cos(n*tempAngle);y1=yCenter-radius1*Math.cos((n+1)*tempAngle);x=x+radius*Math.sin(n*tempAngle);x1=x1+radius1*Math.sin((n+1)*tempAngle);if(!this.paths.series)this.paths.series=[];if(!this.paths.series[i])this.paths.series[i]=[];this.paths.series[i][n]=this._calculateLine(x,y,x1,y1);if(n===0){xFirst=x;yFirst=y}if(n===dataSeries.length-2)this.paths.series[i][n+1]= this._calculateLine(x1,y1,xFirst,yFirst);if(!this.paths.points)this.paths.points=[];if(!this.paths.points[i])this.paths.points[i]=[];if(dataSeries[n].compiledMarker)if(n===0){this.paths.points[i][n]=this.cChartDrawer.calculatePoint(x,y,dataSeries[n].compiledMarker.size,dataSeries[n].compiledMarker.symbol);this.paths.points[i][n+1]=this.cChartDrawer.calculatePoint(x1,y1,dataSeries[n+1].compiledMarker.size,dataSeries[n+1].compiledMarker.symbol)}else this.paths.points[i][n+1]=this.cChartDrawer.calculatePoint(x1, y1,dataSeries[n+1].compiledMarker.size,dataSeries[n+1].compiledMarker.symbol)}}},_calculateDLbl:function(chartSpace,ser,val){var numCache=this.cChartDrawer.getNumCache(this.chart.series[ser].val);if(!numCache)return;var point=numCache.pts[val];var path;var oCommand,oPath;if(this.paths.series)if(val===numCache.pts.length-1){oPath=this.cChartSpace.GetPath(this.paths.series[ser][val-1]);oCommand=oPath.getCommandByIndex(1)}else{oPath=this.cChartSpace.GetPath(this.paths.series[ser][val]);oCommand=oPath.getCommandByIndex(0)}else if(this.paths.points)if(this.paths.points[ser]&& this.paths.points[ser][val]){oPath=this.cChartSpace.GetPath(this.paths.points[ser][val].path);oCommand=oPath.getCommandByIndex(0)}if(!oCommand)return;var x=oCommand.X;var y=oCommand.Y;var pxToMm=this.chartProp.pxToMM;var constMargin=5/pxToMm;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var centerX=x-width/2;var centerY=y-height/2;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.b:{centerY=centerY+height/2+constMargin;break}case c_oAscChartDataLabelsPos.bestFit:{break}case c_oAscChartDataLabelsPos.ctr:{break}case c_oAscChartDataLabelsPos.l:{centerX= centerX-width/2-constMargin;break}case c_oAscChartDataLabelsPos.r:{centerX=centerX+width/2+constMargin;break}case c_oAscChartDataLabelsPos.t:{centerY=centerY-height/2-constMargin;break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX=this.chartProp.widthCanvas/pxToMm-width;if(centerY<0)centerY=0;if(centerY+height>this.chartProp.heightCanvas/pxToMm)centerY=this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_drawLines:function(){var brush,pen,dataSeries, seria,markerBrush,markerPen,numCache;for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i];brush=seria.brush;pen=seria.pen;numCache=this.cChartDrawer.getNumCache(seria.val);if(!numCache)continue;dataSeries=numCache.pts;for(var n=0;n<dataSeries.length-1;n++){if(numCache.pts[n].pen)pen=numCache.pts[n].pen;if(numCache.pts[n].brush)brush=numCache.pts[n].brush;this.cChartDrawer.drawPath(this.paths.series[i][n],pen,brush);if(n===dataSeries.length-2&&this.paths.series[i][n+1])this.cChartDrawer.drawPath(this.paths.series[i][n+ 1],pen,brush)}for(var k=0;k<this.paths.points[i].length;k++){markerBrush=numCache.pts[k].compiledMarker.brush;markerPen=numCache.pts[k].compiledMarker.pen;if(this.paths.points[i][0].framePaths)this.cChartDrawer.drawPath(this.paths.points[i][k].framePaths,null,markerBrush,false);this.cChartDrawer.drawPath(this.paths.points[i][k].path,markerPen,markerBrush,true)}}},_getYVal:function(n,i){var tempVal;var val=0;var numCache;if(this.subType==="stacked")for(var k=0;k<=i;k++){numCache=this.cChartDrawer.getNumCache(this.chart.series[k].val); if(!numCache)continue;tempVal=parseFloat(numCache.pts[n].val);if(tempVal)val+=tempVal}else if(this.subType==="stackedPer"){var summVal=0;for(var k=0;k<this.chart.series.length;k++){numCache=this.cChartDrawer.getNumCache(this.chart.series[k].val);if(!numCache)continue;tempVal=parseFloat(numCache.pts[n].val);if(tempVal){if(k<=i)val+=tempVal;summVal+=Math.abs(tempVal)}}val=val/summVal}else{numCache=this.cChartDrawer.getNumCache(this.chart.series[i].val);if(!numCache)return;val=parseFloat(numCache.pts[n].val)}return val}, _calculateLine:function(x,y,x1,y1){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo(x*pathW,y*pathH);path.lnTo(x1*pathW,y1*pathH);return pathId}};function drawScatterChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace;this.chart=chart;this.catAx=null;this.valAx=null;this.paths={}}drawScatterChart.prototype={constructor:drawScatterChart, recalculate:function(){this.paths={};this.catAx=this.chart.axId[0].xPoints?this.chart.axId[0]:this.chart.axId[1];this.catAx=this.cChartDrawer._searchChangedAxis(this.catAx);this.valAx=this.chart.axId[0].yPoints?this.chart.axId[0]:this.chart.axId[1];this.valAx=this.cChartDrawer._searchChangedAxis(this.valAx);this._recalculateScatter()},draw:function(){this._drawScatter()},_recalculateScatter:function(){var seria,yVal,xVal,points,yNumCache,compiledMarkerSize,compiledMarkerSymbol,yPoint,idx,xPoint;for(var i= 0;i<this.chart.series.length;i++){seria=this.chart.series[i];yNumCache=this.cChartDrawer.getNumCache(seria.yVal);if(!yNumCache)continue;compiledMarkerSize=seria&&seria.compiledSeriesMarker?seria.compiledSeriesMarker.size:null;compiledMarkerSymbol=seria&&seria.compiledSeriesMarker?seria.compiledSeriesMarker.symbol:null;for(var n=0;n<yNumCache.ptCount;n++){var values=this.cChartDrawer._getScatterPointVal(seria,n);if(values){yVal=values.y;xVal=values.x;xPoint=values.xPoint;yPoint=values.yPoint;if(yPoint&& yPoint.compiledMarker)compiledMarkerSize=yPoint.compiledMarker.size;if(yPoint&&yPoint.compiledMarker)compiledMarkerSymbol=yPoint.compiledMarker.symbol;if(!this.paths.points)this.paths.points=[];if(!this.paths.points[i])this.paths.points[i]=[];if(!points)points=[];if(!points[i])points[i]=[];if(yVal!=null){this.paths.points[i][n]=this.cChartDrawer.calculatePoint(this.cChartDrawer.getYPosition(xVal,this.catAx),this.cChartDrawer.getYPosition(yVal,this.valAx,true),compiledMarkerSize,compiledMarkerSymbol); points[i][n]={x:xVal,y:yVal}}else{this.paths.points[i][n]=null;points[i][n]=null}}}}this._calculateAllLines(points)},_recalculateScatter2:function(){var xPoints=this.catAx.xPoints;var yPoints=this.valAx.yPoints;var betweenAxisCross=this.valAx.crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN;var seria,yVal,xVal,points,yNumCache,compiledMarkerSize,compiledMarkerSymbol,yPoint,idx,xPoint;for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i];yNumCache=this.cChartDrawer.getNumCache(seria.yVal); if(!yNumCache)continue;for(var n=0;n<yNumCache.ptCount;n++){idx=yNumCache.pts&&undefined!==yNumCache.pts[n]?yNumCache.pts[n].idx:null;if(null===idx)continue;yVal=this._getYVal(n,i);xPoint=this.cChartDrawer.getIdxPoint(seria,idx,true);if(xPoint){xVal=xPoint.val;if(!isNaN(parseFloat(xVal)))xVal=parseFloat(xVal);else xVal=n+1}else xVal=n+1;yPoint=this.cChartDrawer.getIdxPoint(seria,idx);compiledMarkerSize=yPoint&&yPoint.compiledMarker?yPoint.compiledMarker.size:null;compiledMarkerSymbol=yPoint&&yPoint.compiledMarker? yPoint.compiledMarker.symbol:null;if(!this.paths.points)this.paths.points=[];if(!this.paths.points[i])this.paths.points[i]=[];if(!points)points=[];if(!points[i])points[i]=[];if(yVal!=null){this.paths.points[i][n]=this.cChartDrawer.calculatePoint(this.cChartDrawer.getYPosition(xVal,this.catAx,true),this.cChartDrawer.getYPosition(yVal,this.valAx),compiledMarkerSize,compiledMarkerSymbol);points[i][n]={x:xVal,y:yVal}}else{this.paths.points[i][n]=null;points[i][n]=null}}}this._calculateAllLines(points)}, _calculateAllLines:function(points){var xPoints=this.catAx.xPoints;var yPoints=this.valAx.yPoints;var allAxisLog=this.catAx.scaling&&this.catAx.scaling.logBase&&this.valAx.scaling&&this.valAx.scaling.logBase;var x,y,x1,y1,x2,y2,x3,y3,isSplineLine;if(!points)return;for(var i=0;i<points.length;i++){isSplineLine=!allAxisLog&&this.chart.series[i].smooth!==false;if(!points[i])continue;for(var n=0;n<points[i].length;n++){if(!this.paths.series)this.paths.series=[];if(!this.paths.series[i])this.paths.series[i]= [];if(points[i][n]!=null&&points[i][n+1]!=null)if(isSplineLine){x=points[i][n-1]?points[i][n-1].x:points[i][n].x;y=points[i][n-1]?points[i][n-1].y:points[i][n].y;x1=points[i][n].x;y1=points[i][n].y;x2=points[i][n+1]?points[i][n+1].x:points[i][n].x;y2=points[i][n+1]?points[i][n+1].y:points[i][n].y;x3=points[i][n+2]?points[i][n+2].x:points[i][n+1]?points[i][n+1].x:points[i][n].x;y3=points[i][n+2]?points[i][n+2].y:points[i][n+1]?points[i][n+1].y:points[i][n].y;this.paths.series[i][n]=this.cChartDrawer.calculateSplineLine(x, y,x1,y1,x2,y2,x3,y3,this.catAx,this.valAx)}else{x=this.cChartDrawer.getYPosition(points[i][n].x,this.catAx);y=this.cChartDrawer.getYPosition(points[i][n].y,this.valAx,true);x1=this.cChartDrawer.getYPosition(points[i][n+1].x,this.catAx);y1=this.cChartDrawer.getYPosition(points[i][n+1].y,this.valAx,true);this.paths.series[i][n]=this._calculateLine(x,y,x1,y1)}}}},_getYVal:function(n,i){var idxPoint=this.cChartDrawer.getPointByIndex(this.chart.series[i],n);return idxPoint?parseFloat(idxPoint.val):null}, _drawScatter:function(){var diffPen=2;var leftRect=this.chartProp.chartGutter._left/this.chartProp.pxToMM;var topRect=(this.chartProp.chartGutter._top-diffPen)/this.chartProp.pxToMM;var rightRect=this.chartProp.trueWidth/this.chartProp.pxToMM;var bottomRect=(this.chartProp.trueHeight+diffPen)/this.chartProp.pxToMM;this.cChartDrawer.cShapeDrawer.Graphics.SaveGrState();this.cChartDrawer.cShapeDrawer.Graphics.AddClipRect(leftRect,topRect,rightRect,bottomRect);this.cChartDrawer.drawPaths(this.paths,this.chart.series, true,true);this.cChartDrawer.cShapeDrawer.Graphics.RestoreGrState();this.cChartDrawer.drawPathsPoints(this.paths,this.chart.series,true)},_calculateLine:function(x,y,x1,y1){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo(x*pathH,y*pathW);path.lnTo(x1*pathH,y1*pathW);return pathId},_calculateDLbl:function(chartSpace,ser,val){var point=this.cChartDrawer.getIdxPoint(this.chart.series[ser],val); var path;if(!point)return;if(this.paths.points)if(this.paths.points[ser]&&this.paths.points[ser][val]){var oPath=this.cChartSpace.GetPath(this.paths.points[ser][val].path);path=oPath.getCommandByIndex(0)}if(!path)return;var x=path.X;var y=path.Y;var pxToMm=this.chartProp.pxToMM;var constMargin=5/pxToMm;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var centerX=x-width/2;var centerY=y-height/2;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.b:{centerY=centerY+height/ 2+constMargin;break}case c_oAscChartDataLabelsPos.bestFit:{break}case c_oAscChartDataLabelsPos.ctr:{break}case c_oAscChartDataLabelsPos.l:{centerX=centerX-width/2-constMargin;break}case c_oAscChartDataLabelsPos.r:{centerX=centerX+width/2+constMargin;break}case c_oAscChartDataLabelsPos.t:{centerY=centerY-height/2-constMargin;break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX=this.chartProp.widthCanvas/pxToMm-width;if(centerY<0)centerY=0;if(centerY+height>this.chartProp.heightCanvas/ pxToMm)centerY=this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_calculateSplineLine2:function(points,k,xPoints,yPoints){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var x=points[k-1]?points[k-1].x:points[k].x;var y=points[k-1]?points[k-1].y:points[k].y;var x1=points[k].x;var y1=points[k].y;var x2=points[k+1]?points[k+1].x:points[k].x;var y2=points[k+1]?points[k+1].y:points[k].y; var x3=points[k+2]?points[k+2].x:points[k+1]?points[k+1].x:points[k].x;var y3=points[k+2]?points[k+2].y:points[k+1]?points[k+1].y:points[k].y;var splineCoords=this.cChartDrawer.calculate_Bezier(x,y,x1,y1,x2,y2,x3,y3);x=this.cChartDrawer.getYPosition(splineCoords[0].x,this.catAx);y=this.cChartDrawer.getYPosition(splineCoords[0].y,this.valAx);x1=this.cChartDrawer.getYPosition(splineCoords[1].x,this.catAx);y1=this.cChartDrawer.getYPosition(splineCoords[1].y,this.valAx);x2=this.cChartDrawer.getYPosition(splineCoords[2].x, this.catAx);y2=this.cChartDrawer.getYPosition(splineCoords[2].y,this.valAx);x3=this.cChartDrawer.getYPosition(splineCoords[3].x,this.catAx);y3=this.cChartDrawer.getYPosition(splineCoords[3].y,this.valAx);path.moveTo(x*pathW,y*pathH);path.cubicBezTo(x1*pathW,y1*pathH,x2*pathW,y2*pathH,x3*pathW,y3*pathH);return pathId}};function drawStockChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace;this.chart=chart;this.catAx= null;this.valAx=null;this.paths={}}drawStockChart.prototype={constructor:drawStockChart,draw:function(){this._drawLines()},recalculate:function(){this.paths={};this.catAx=this.chart.axId[0].xPoints?this.chart.axId[0]:this.chart.axId[1];this.catAx=this.cChartDrawer._searchChangedAxis(this.catAx);this.valAx=this.chart.axId[0].yPoints?this.chart.axId[0]:this.chart.axId[1];this.valAx=this.cChartDrawer._searchChangedAxis(this.valAx);this._calculateLines()},_calculateLines:function(){var xPoints=this.catAx.xPoints; var yPoints=this.valAx.yPoints;var trueWidth=this.chartProp.trueWidth;var numCache=this.cChartDrawer.getNumCache(this.chart.series[0].val);if(!numCache)return;var koffX=trueWidth/numCache.pts.length;var gapWidth=this.chart.upDownBars&&AscFormat.isRealNumber(this.chart.upDownBars.gapWidth)?this.chart.upDownBars.gapWidth:150;var widthBar=koffX/(1+gapWidth/100);var val1,val2,val3,val4,xVal,yVal1,yVal2,yVal3,yVal4,curNumCache,lastNamCache;for(var i=0;i<numCache.pts.length;i++){val1=null,val2=null,val3= null,val4=null;val1=numCache.pts[i].val;lastNamCache=this.cChartDrawer.getNumCache(this.chart.series[this.chart.series.length-1].val);lastNamCache=lastNamCache?lastNamCache.pts:null;val4=lastNamCache&&lastNamCache[i]?lastNamCache[i].val:null;for(var k=1;k<this.chart.series.length-1;k++){curNumCache=this.cChartDrawer.getNumCache(this.chart.series[k].val);if(curNumCache&&curNumCache.pts[i])if(k===1){val2=curNumCache.pts[i].val;val3=curNumCache.pts[i].val}else{if(parseFloat(val2)>parseFloat(curNumCache.pts[i].val))val2= curNumCache.pts[i].val;if(parseFloat(val3)<parseFloat(curNumCache.pts[i].val))val3=curNumCache.pts[i].val}}if(!this.paths.values)this.paths.values=[];if(!this.paths.values[i])this.paths.values[i]={};xVal=this.cChartDrawer.getYPosition(i+1,this.catAx);yVal1=this.cChartDrawer.getYPosition(val1,this.valAx);yVal2=this.cChartDrawer.getYPosition(val2,this.valAx);yVal3=this.cChartDrawer.getYPosition(val3,this.valAx);yVal4=this.cChartDrawer.getYPosition(val4,this.valAx);if(val2!==null&&val1!==null)this.paths.values[i].lowLines= this._calculateLine(xVal,yVal2,xVal,yVal1);if(val3!==null&&val4!==null)this.paths.values[i].highLines=this._calculateLine(xVal,yVal4,xVal,yVal3);if(val1!==null&&val4!==null)if(parseFloat(val1)>parseFloat(val4))this.paths.values[i].downBars=this._calculateUpDownBars(xVal,yVal1,xVal,yVal4,widthBar/this.chartProp.pxToMM);else this.paths.values[i].upBars=this._calculateUpDownBars(xVal,yVal1,xVal,yVal4,widthBar/this.chartProp.pxToMM)}},_drawLines:function(){var brush;var pen;var numCache=this.cChartDrawer.getNumCache(this.chart.series[0].val); if(!numCache)return;for(var i=0;i<numCache.pts.length;i++){pen=this.chart.calculatedHiLowLines;this.cChartDrawer.drawPath(this.paths.values[i].lowLines,pen,brush);this.cChartDrawer.drawPath(this.paths.values[i].highLines,pen,brush);if(this.paths.values[i].downBars){brush=this.chart.upDownBars?this.chart.upDownBars.downBarsBrush:null;pen=this.chart.upDownBars?this.chart.upDownBars.downBarsPen:null;this.cChartDrawer.drawPath(this.paths.values[i].downBars,pen,brush)}else{brush=this.chart.upDownBars? this.chart.upDownBars.upBarsBrush:null;pen=this.chart.upDownBars?this.chart.upDownBars.upBarsPen:null;this.cChartDrawer.drawPath(this.paths.values[i].upBars,pen,brush)}}},_calculateLine:function(x,y,x1,y1){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo(x*pathW,y*pathH);path.lnTo(x1*pathW,y1*pathH);return pathId},_calculateDLbl:function(chartSpace,ser,val){var pxToMm=this.chartProp.pxToMM;var min= this.valAx.scale[0];var max=this.valAx.scale[this.valAx.scale.length-1];var digHeight=Math.abs(max-min);if(min<0&&max<=0)min=-1*max;var numCache=this.cChartDrawer.getNumCache(this.chart.series[0].val);if(!numCache)return{x:null,y:null};var koffX=this.chartProp.trueWidth/numCache.pts.length;var koffY=this.chartProp.trueHeight/digHeight;var point=this.chart.series[ser].val.numRef?this.chart.series[ser].val.numRef.numCache.pts[val]:this.chart.series[ser].val.numLit.pts[val];var x=this.chartProp.chartGutter._left+ val*koffX+koffX/2;var y=this.chartProp.trueHeight-(point.val-min)*koffY+this.chartProp.chartGutter._top;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var centerX=x/pxToMm-width/2;var centerY=y/pxToMm-height/2;var constMargin=5/pxToMm;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.b:{centerY=centerY+height/2+constMargin;break}case c_oAscChartDataLabelsPos.bestFit:{break}case c_oAscChartDataLabelsPos.ctr:{break}case c_oAscChartDataLabelsPos.l:{centerX=centerX-width/ 2-constMargin;break}case c_oAscChartDataLabelsPos.r:{centerX=centerX+width/2+constMargin;break}case c_oAscChartDataLabelsPos.t:{centerY=centerY-height/2-constMargin;break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX=this.chartProp.widthCanvas/pxToMm-width;if(centerY<0)centerY=0;if(centerY+height>this.chartProp.heightCanvas/pxToMm)centerY=this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_calculateUpDownBars:function(x,y,x1,y1,width){var pathId= this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo((x-width/2)*pathW,y*pathH);path.lnTo((x-width/2)*pathW,y1*pathH);path.lnTo((x+width/2)*pathW,y1*pathH);path.lnTo((x+width/2)*pathW,y*pathH);path.lnTo((x-width/2)*pathW,y*pathH);return pathId}};function drawBubbleChart(chart,chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace;this.chart= chart;this.catAx=null;this.valAx=null;this.paths={}}drawBubbleChart.prototype={constructor:drawBubbleChart,recalculate:function(){this.paths={};this.catAx=this.chart.axId[0].xPoints?this.chart.axId[0]:this.chart.axId[1];this.catAx=this.cChartDrawer._searchChangedAxis(this.catAx);this.valAx=this.chart.axId[0].yPoints?this.chart.axId[0]:this.chart.axId[1];this.valAx=this.cChartDrawer._searchChangedAxis(this.valAx);this._recalculateScatter()},draw:function(){this._drawScatter()},_recalculateScatter:function(){var xPoints= this.catAx.xPoints;var yPoints=this.valAx.yPoints;var seria,yVal,xVal,points,x,y,yNumCache,xNumCache;for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i];points=[];yNumCache=this.cChartDrawer.getNumCache(seria.yVal);if(!yNumCache)continue;for(var n=0;n<yNumCache.pts.length;n++){yVal=parseFloat(yNumCache.pts[n].val);xNumCache=this.cChartDrawer.getNumCache(seria.xVal);if(xNumCache&&xNumCache.pts[n]&&xNumCache.pts[n].val)if(!isNaN(parseFloat(xNumCache.pts[n].val)))xVal=parseFloat(xNumCache.pts[n].val); else xVal=n+1;else xVal=n+1;points[n]={x:xVal,y:yVal}}for(var k=0;k<points.length;k++){y=this.cChartDrawer.getYPosition(points[k].y,this.valAx);x=this.cChartDrawer.getYPosition(points[k].x,this.catAx);if(!this.paths.points)this.paths.points=[];if(!this.paths.points[i])this.paths.points[i]=[];this.paths.points[i][k]=this._calculateBubble(x,y,seria.bubbleSize,k)}}},_drawScatter:function(){var seria,brush,pen,markerBrush,markerPen,yNumCache;for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i]; brush=seria.brush;pen=seria.pen;if(this.paths.points&&this.paths.points[i])for(var k=0;k<this.paths.points[i].length;k++){yNumCache=this.cChartDrawer.getNumCache(this.chart.series[i].yVal);if(!yNumCache)continue;markerBrush=yNumCache.pts[k].compiledMarker.brush;markerPen=yNumCache.pts[k].compiledMarker.pen;this.cChartDrawer.drawPath(this.paths.points[i][k],markerPen,markerBrush,true)}}},_calculateDLbl:function(chartSpace,ser,val){var point;if(this.chart.series[ser-1])point=this.cChartDrawer.getNumCache(this.chart.series[ser- 1].yVal);else point=this.cChartDrawer.getNumCache(this.chart.series[ser].yVal);if(!point)return{x:null,y:null};var path;if(this.paths.points)if(this.paths.points[ser]&&this.paths.points[ser][val]){var oPath=this.cChartSpace.GetPath(this.paths.points[ser][val].path);path=oPath.getCommandByIndex(0)}if(!path)return;var x=path.X;var y=path.Y;var pxToMm=this.chartProp.pxToMM;var constMargin=5/pxToMm;var width=point.compiledDlb.extX;var height=point.compiledDlb.extY;var centerX=x-width/2;var centerY=y- height/2;switch(point.compiledDlb.dLblPos){case c_oAscChartDataLabelsPos.b:{centerY=centerY+height/2+constMargin;break}case c_oAscChartDataLabelsPos.bestFit:{break}case c_oAscChartDataLabelsPos.ctr:{break}case c_oAscChartDataLabelsPos.l:{centerX=centerX-width/2-constMargin;break}case c_oAscChartDataLabelsPos.r:{centerX=centerX+width/2+constMargin;break}case c_oAscChartDataLabelsPos.t:{centerY=centerY-height/2-constMargin;break}}if(centerX<0)centerX=0;if(centerX+width>this.chartProp.widthCanvas/pxToMm)centerX= this.chartProp.widthCanvas/pxToMm-width;if(centerY<0)centerY=0;if(centerY+height>this.chartProp.heightCanvas/pxToMm)centerY=this.chartProp.heightCanvas/pxToMm-height;return{x:centerX,y:centerY}},_calculateBubble:function(x,y,bubbleSize,k){var defaultSize=4;if(bubbleSize){var maxSize,curSize,yPoints,maxDiamBubble,diffSize,maxArea;maxSize=this.cChartDrawer._getMaxMinValueArray(bubbleSize).max;curSize=bubbleSize[k].val;yPoints=this.valAx.yPoints?this.valAx.yPoints:this.catAx.yPoints;maxDiamBubble=Math.abs(yPoints[1].pos- yPoints[0].pos)*2;diffSize=maxSize/curSize;var isDiam=false;if(isDiam)defaultSize=maxDiamBubble/diffSize/2;else{maxArea=1/4*(Math.PI*(maxDiamBubble*maxDiamBubble));defaultSize=Math.sqrt(maxArea/diffSize/Math.PI)}}var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo((x+defaultSize)*pathW,y*pathH);path.arcTo(defaultSize*pathW,defaultSize*pathW,0,Math.PI*2*cToDeg);return pathId}};function drawSurfaceChart(chart, chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartDrawer=chartsDrawer;this.cChartSpace=chartsDrawer.cChartSpace;this.chart=chart;this.catAx=null;this.valAx=null;this.paths={}}drawSurfaceChart.prototype={constructor:drawSurfaceChart,recalculate:function(){this.paths={};var countSeries=this.cChartDrawer.calculateCountSeries(this.chart);this.ptCount=countSeries.points;this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_CatAx);if(!this.catAx)this.catAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId, AscDFH.historyitem_type_DateAx);this.valAx=this.cChartDrawer.getAxisFromAxId(this.chart.axId,AscDFH.historyitem_type_ValAx);this._recalculate()},draw:function(){this._draw()},_recalculate:function(){var yPoints=this.valAx.yPoints;var xPoints=this.catAx.xPoints;var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var y,x,z,val,seria,dataSeries,idx,numCache,idxPoint,points=[],points3d=[],idx2,val2;for(var i=0;i<this.chart.series.length;i++){seria=this.chart.series[i];numCache=this.cChartDrawer.getNumCache(seria.val); if(!numCache)continue;dataSeries=numCache.pts;for(var n=0;n<this.ptCount;n++){idx=dataSeries[n]&&dataSeries[n].idx!=null?dataSeries[n].idx:n;val=this._getYVal(n,i);if(null===val)val=0;x=xPoints[n].pos*this.chartProp.pxToMM;y=this.cChartDrawer.getYPosition(val,this.valAx)*this.chartProp.pxToMM;z=perspectiveDepth/(this.chart.series.length-1)*i;idx2=dataSeries[n+1]&&dataSeries[n+1].idx!=null?dataSeries[n+1].idx:null;val2=this._getYVal(n+1,i);if(null===val2)val2=0;if(!points)points=[];if(!points[i])points[i]= [];if(!points3d)points3d=[];if(!points3d[i])points3d[i]=[];if(val!=null){points3d[i][n]={x:x,y:y,z:z,val:val};var convertResult=this.cChartDrawer._convertAndTurnPoint(x,y,z);var x1=convertResult.x;var y1=convertResult.y;points[i][n]={x:x1,y:y1,val:val}}else points[i][n]=null}}this._calculateAllFaces(points,points3d)},_calculateAllFaces:function(points,points3d){if(!this.paths.test)this.paths.test=[];if(!this.paths.test2)this.paths.test2=[];for(var i=0;i<points.length-1;i++)for(var j=0;j<points[i].length- 1;j++){var p1=points[i][j];var p2=points[i+1][j];var p3=points[i][j+1];var p4=points[i+1][j+1];this.paths.test.push(this.cChartDrawer._calculatePathFace(p1,p3,p4,p2,true));var p13d=points3d[i][j];var p23d=points3d[i+1][j];var p33d=points3d[i][j+1];var p43d=points3d[i+1][j+1];this._calculateFace(p1,p2,p3,p4,p13d,p23d,p33d,p43d)}},_calculateFace:function(p,p1,p2,p21,p3d,p13d,p23d,p213d){var t=this;var lines=[];lines[0]={p1:p3d,p2:p23d,p111:p,p222:p2};lines[1]={p1:p13d,p2:p213d,p111:p1,p222:p21};lines[2]= {p1:p3d,p2:p13d,p111:p,p222:p1};lines[3]={p1:p23d,p2:p213d,p111:p2,p222:p21};var pointsValue=[p1,p2,p21,p];if(this.cChartDrawer.isPointsLieIntoOnePlane(p3d,p13d,p213d,p23d))this._getIntersectionPlanesAndLines(lines,pointsValue,true);else{var max=p.val;var maxIndex=0;var arrVal=[p,p1,p2,p21];for(var m=0;m<arrVal.length;m++)if(arrVal[m].val>max){max=arrVal[m].val;maxIndex=m}var lines1,pointsValue1,lines2,pointsValue2;if(p1.val+p2.val<p21.val+p.val){lines.push({p1:p213d,p2:p3d,p111:p21,p222:p});lines1= [lines[0],lines[3],lines[4]];pointsValue1=[p,p21,p2];lines2=[lines[2],lines[1],lines[4]];pointsValue2=[p,p1,p21]}else{lines.push({p1:p13d,p2:p23d,p111:p1,p222:p2});lines1=[lines[2],lines[0],lines[4]];pointsValue1=[p,p1,p2];lines2=[lines[4],lines[1],lines[3]];pointsValue2=[p2,p1,p21]}var bIsWireframeChart=false;var pointsFace1=this._getIntersectionPlanesAndLines(lines1,pointsValue1,!bIsWireframeChart);var pointsFace2=this._getIntersectionPlanesAndLines(lines2,pointsValue2,!bIsWireframeChart);if(bIsWireframeChart){var lengthFaces= Math.max(pointsFace1.length,pointsFace2.length);for(var l=0;l<lengthFaces;l++){var newPath=null;if(pointsFace1[l]&&pointsFace2[l]){var cleanPoints1=this._getArrayWithoutRepeatePoints(pointsFace1[l]);var cleanPoints2=this._getArrayWithoutRepeatePoints(pointsFace2[l]);if(cleanPoints1.length>=3&&cleanPoints2.length>=3)newPath=cleanPoints1.concat(cleanPoints2)}else if(pointsFace1[l])newPath=pointsFace1[l];else if(pointsFace2[l])newPath=pointsFace2[l];if(newPath){if(!t.paths.test2[l])t.paths.test2[l]= [];var path2=t._calculateTempFace(newPath);t.paths.test2[l].push(path2)}}}}},_getIntersectionPlanesAndLines:function(lines,pointsValue,bIsAddIntoPaths){var t=this;var yPoints=this.valAx.yPoints;var xPoints=this.catAx.xPoints;var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var getGridPlain=function(index){var gridX1=xPoints[0].pos*t.chartProp.pxToMM;var gridX2=xPoints[xPoints.length-1].pos*t.chartProp.pxToMM;var gridY1=yPoints[index].pos*t.chartProp.pxToMM;var gridY2=yPoints[index].pos* t.chartProp.pxToMM;var gridPlain=t.cChartDrawer.getPlainEquation({x:gridX1,y:gridY1,z:0},{x:gridX2,y:gridY2,z:0},{x:gridX2,y:gridY2,z:perspectiveDepth});return gridPlain};var getMinMaxValArray=function(pointsValue){var min,max;if(pointsValue.length===4){min=Math.min(pointsValue[0].val,pointsValue[1].val,pointsValue[2].val,pointsValue[3].val);max=Math.max(pointsValue[0].val,pointsValue[1].val,pointsValue[2].val,pointsValue[3].val)}else{min=Math.min(pointsValue[0].val,pointsValue[1].val,pointsValue[2].val); max=Math.max(pointsValue[0].val,pointsValue[1].val,pointsValue[2].val)}return{min:min,max:max}};var calculateFaceBetween2GridLines=function(minVal,maxVal,k,pointsValue,res){var result=false;if(yPoints[k-1]&&minVal>=yPoints[k-1].val&&maxVal<=yPoints[k].val){var p1=pointsValue[0];var p2=pointsValue[1];var p3=pointsValue[2];var p4=pointsValue[3]?pointsValue[3]:pointsValue[2];var path=t._calculateTempFace([p1,p2,p3,p4]);var addIndex=k;if(minVal===maxVal&&yPoints[k]&&minVal===yPoints[k].val)addIndex=k+ 1;if(bIsAddIntoPaths){if(!t.paths.test2[addIndex])t.paths.test2[addIndex]=[];t.paths.test2[addIndex].push(path)}res[k]=[p1,p2,p3,p4];result=true}return result};var minMaxVal=getMinMaxValArray(pointsValue);var minVal=minMaxVal.min;var maxVal=minMaxVal.max;var res=[];var prevPoints=null;for(var k=0;k<yPoints.length;k++){if(calculateFaceBetween2GridLines(minVal,maxVal,k,pointsValue,res))break;if(yPoints[k-1]&&yPoints[k].val>maxVal&&yPoints[k-1].val>=maxVal)break;var pointNeedAddIntoFace=null;if(yPoints[k- 1])for(var i=0;i<pointsValue.length;i++)if(yPoints[k-1].val<=pointsValue[i].val&&yPoints[k].val>=pointsValue[i].val){if(null===pointNeedAddIntoFace)pointNeedAddIntoFace=[];pointNeedAddIntoFace.push(pointsValue[i])}var isCalculatePrevPoints=false;if(null===prevPoints)for(var j=0;j<pointsValue.length;j++)if(pointsValue[j].val<=yPoints[k].val){if(!prevPoints)prevPoints=[];prevPoints.push(pointsValue[j]);isCalculatePrevPoints=true}var gridPlane=getGridPlain(k);var points=this._getIntersectionPlaneAndLines(gridPlane, lines,pointsValue);if(!isCalculatePrevPoints&&null===points&&prevPoints)for(var j=0;j<pointsValue.length;j++)if(pointsValue[j].val>=yPoints[k-1].val){if(!points)points=[];points.push(pointsValue[j]);isCalculatePrevPoints=true}var arrPoints=null,p1,p2,p3,p4;if(null!==points&&prevPoints){p1=prevPoints[0];p2=prevPoints[1]?prevPoints[1]:prevPoints[0];p3=points[0];p4=points[1]?points[1]:points[0];arrPoints=[p1,p2,p3,p4];if(points[2])arrPoints.push(points[2]);res[k]=arrPoints}else if(prevPoints&&prevPoints.length=== 3&&!points&&isCalculatePrevPoints){p1=prevPoints[0];p2=prevPoints[1];p3=prevPoints[2];p4=prevPoints[3]?prevPoints[3]:prevPoints[2];arrPoints=[p1,p2,p3,p4];res[k]=arrPoints}if(arrPoints&&null!==pointNeedAddIntoFace)for(var i=0;i<pointNeedAddIntoFace.length;i++)arrPoints.push(pointNeedAddIntoFace[i]);if(arrPoints&&bIsAddIntoPaths){var path=t._calculateTempFace(arrPoints);if(!t.paths.test2[k])t.paths.test2[k]=[];t.paths.test2[k].push(path)}if(points!==null)prevPoints=points}return res},_getIntersectionPlaneAndLines:function(gridPlain, lines,pointsValue){var res=null;var clearIntersectionPoints=[];var segmentIntersectionPoints=[];for(var n=0;n<lines.length;n++){var convertResult=this.cChartDrawer.isIntersectionPlainAndLineSegment(gridPlain,lines[n].p1,lines[n].p2,lines[n].p111,lines[n].p222);if(!convertResult)continue;if(null===this._isEqualPoints(pointsValue,convertResult))clearIntersectionPoints.push(convertResult);else if(null===this._isEqualPoints(segmentIntersectionPoints,convertResult))segmentIntersectionPoints.push(convertResult)}var p1, p2;if(!segmentIntersectionPoints.length)if(clearIntersectionPoints.length===2){p1=clearIntersectionPoints[0];p2=clearIntersectionPoints[1];res=[p1,p2]}else{if(clearIntersectionPoints.length===1){p1=clearIntersectionPoints[0];res=[p1]}}else if(segmentIntersectionPoints.length&&clearIntersectionPoints.length){if(1===segmentIntersectionPoints.length&&1===clearIntersectionPoints.length){p1=segmentIntersectionPoints[0];p2=clearIntersectionPoints[0];res=[p1,p2]}}else if(segmentIntersectionPoints.length)if(2=== segmentIntersectionPoints.length){p1=segmentIntersectionPoints[0];p2=segmentIntersectionPoints[1];res=[p1,p2]}else if(1===segmentIntersectionPoints.length){p1=segmentIntersectionPoints[0];res=[p1]}return res},_isEqualPoints:function(arr,point){var res=null;for(var p=0;p<arr.length;p++)if(arr[p]&&parseInt(point.x)===parseInt(arr[p].x)&&parseInt(point.y)===parseInt(arr[p].y)){res=p;break}return res},_getArrayWithoutRepeatePoints:function(arr){var newArray=[];for(var i=0;i<arr.length;i++)if(null===this._isEqualPoints(newArray, arr[i]))newArray.push(arr[i]);return newArray},_calculateTempFace:function(points){var summX=0;var summY=0;for(var i=0;i<points.length;i++){summX+=points[i].x;summY+=points[i].y}var x=1/points.length*summX;var y=1/points.length*summY;var sortArray=[];var repeatePoint=[];var nIndividualPoints=0;for(var i=0;i<points.length;i++){var tan=Math.atan2(points[i].x-x,points[i].y-y);if(!repeatePoint[tan]){sortArray[i]={tan:tan,point:points[i]};repeatePoint[tan]=1;nIndividualPoints++}}var path=null;if(nIndividualPoints> 2){sortArray.sort(function sortArr(a,b){return b.tan-a.tan});path=this.cChartDrawer.calculatePathFacesArray(sortArray,true)}return path},_getYVal:function(n,i){var idxPoint=this.cChartDrawer.getIdxPoint(this.chart.series[i],n);var val=idxPoint?parseFloat(idxPoint.val):null;return val},_calculatePath:function(x,y,x1,y1){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pxToMm=this.chartProp.pxToMM;var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var gdLst= [];path.pathH=pathH;path.pathW=pathW;gdLst["w"]=1;gdLst["h"]=1;path.moveTo(x/pxToMm*pathW,y/pxToMm*pathH);path.lnTo(x1/pxToMm*pathW,y1/pxToMm*pathH);return pathId},_draw:function(){var style=AscFormat.CHART_STYLE_MANAGER.getStyleByIndex(this.cChartSpace.style);for(var i=0;i<this.paths.test2.length;i++){if(!this.paths.test2[i])continue;for(var j=0;j<this.paths.test2[i].length;j++){style=this.chart.compiledBandFormats[i-1];var brush=style&&style.spPr?style.spPr.Fill:null;var pen=style&&style.spPr?style.spPr.ln: null;if(!pen||pen&&0===pen.w)pen=AscFormat.CreatePenFromParams(brush,undefined,undefined,undefined,undefined,.13);this.cChartDrawer.drawPath(this.paths.test2[i][j],pen,brush)}}}};function catAxisChart(){this.chartProp=null;this.cChartSpace=null;this.cChartDrawer=null;this.catAx=null;this.paths={}}catAxisChart.prototype={constructor:catAxisChart,draw:function(chartsDrawer,catAx,isDrawGrid){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer; if(catAx)this.catAx=catAx;if(isDrawGrid)this._drawGridLines();else{this._drawAxis();this._drawTickMark()}},recalculate:function(chartsDrawer,catAx){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this.catAx=catAx;this.paths={};this._calculateGridLines();if(this.catAx.bDelete!==true){this._calculateAxis();this._calculateTickMark()}},_calculateGridLines:function(){var paths;if(this.catAx.axPos===window["AscFormat"].AX_POS_L||this.catAx.axPos=== window["AscFormat"].AX_POS_R)paths=this.cChartDrawer.getHorizontalGridLines(this.catAx,true);else paths=this.cChartDrawer.getVerticalGridLines(this.catAx,true);this.paths.gridLines=paths?paths.gridLines:null;this.paths.minorGridLines=paths?paths.minorGridLines:null},_calculateAxis:function(){var axisPos;var left=this.chartProp.chartGutter._left/this.chartProp.pxToMM;var right=(this.chartProp.widthCanvas-this.chartProp.chartGutter._right)/this.chartProp.pxToMM;var top=this.chartProp.chartGutter._top/ this.chartProp.pxToMM;var bottom=(this.chartProp.heightCanvas-this.chartProp.chartGutter._bottom)/this.chartProp.pxToMM;if(this.catAx.axPos===window["AscFormat"].AX_POS_R||this.catAx.axPos===window["AscFormat"].AX_POS_L){axisPos=this.catAx.posX;this.paths.axisLine=this._calculateLine(axisPos,top,axisPos,bottom)}else{axisPos=this.catAx.posY;this.paths.axisLine=this._calculateLine(left,axisPos,right,axisPos)}},_calculateTickMark:function(){var widthLine=0,widthMinorLine=0;var crossMajorStep=0,crossMinorStep= 0;switch(this.catAx.majorTickMark){case c_oAscTickMark.TICK_MARK_CROSS:{widthLine=5;crossMajorStep=5;break}case c_oAscTickMark.TICK_MARK_IN:{widthLine=-5;break}case c_oAscTickMark.TICK_MARK_NONE:{widthLine=0;break}case c_oAscTickMark.TICK_MARK_OUT:{widthLine=5;break}}switch(this.catAx.minorTickMark){case c_oAscTickMark.TICK_MARK_CROSS:{widthMinorLine=3;crossMinorStep=3;break}case c_oAscTickMark.TICK_MARK_IN:{widthMinorLine=-3;break}case c_oAscTickMark.TICK_MARK_NONE:{widthMinorLine=0;break}case c_oAscTickMark.TICK_MARK_OUT:{widthMinorLine= 3;break}}var axPos=this.catAx.axPos;if(axPos===window["AscFormat"].AX_POS_T||axPos===window["AscFormat"].AX_POS_L){widthMinorLine=-widthMinorLine;widthLine=-widthLine;crossMajorStep=-crossMajorStep;crossMinorStep=-crossMinorStep}if(!(widthLine===0&&widthMinorLine===0))this._calculateTickMarks(widthLine,widthMinorLine,crossMajorStep,crossMinorStep)},_calculateTickMarks:function(widthLine,widthMinorLine,crossMajorStep,crossMinorStep){var orientation=this.catAx?this.catAx.scaling.orientation:ORIENTATION_MIN_MAX; var minorStep,posX,posY,k,firstDiff=0;var tickMarkSkip=this.catAx.tickMarkSkip?this.catAx.tickMarkSkip:1;var pathId=this.cChartSpace.AllocPath(),path=this.cChartSpace.GetPath(pathId);var i,n;var minorLinesCount=2;if(this.catAx.axPos===window["AscFormat"].AX_POS_R||this.catAx.axPos===window["AscFormat"].AX_POS_L){var yPoints=this.catAx.yPoints;if(!yPoints)return;var stepY=yPoints[1]?Math.abs(yPoints[1].pos-yPoints[0].pos):Math.abs(yPoints[0].pos-this.chartProp.chartGutter._bottom/this.chartProp.pxToMM); minorStep=stepY/minorLinesCount;posX=this.catAx.posX;if(this.catAx.crossAx.crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN)firstDiff=yPoints[1]?Math.abs(yPoints[1].pos-yPoints[0].pos):Math.abs(yPoints[0].pos-this.cChartSpace.chart.plotArea.valAx.posY)*2;if(orientation!==ORIENTATION_MIN_MAX){minorStep=-minorStep;firstDiff=-firstDiff}for(i=0;i<yPoints.length;i++){k=i*tickMarkSkip;if(k>=yPoints.length)break;if(yPoints[k].val<0)continue;posY=yPoints[k].pos+firstDiff/2;if(!this.paths.tickMarks)this.paths.tickMarks= pathId;this._calculateLine(posX,posY,posX+widthLine/this.chartProp.pxToMM,posY,path);if((i+1)*tickMarkSkip===yPoints.length){var posYtemp=yPoints[yPoints.length-1].pos-firstDiff/2;this._calculateLine(posX-crossMajorStep/this.chartProp.pxToMM,posYtemp,posX+widthLine/this.chartProp.pxToMM,posYtemp,path)}if(widthMinorLine!==0)for(n=1;n<minorLinesCount;n++){var posMinorY=posY-n*minorStep*tickMarkSkip;if(posMinorY<yPoints[yPoints.length-1].pos-firstDiff/2&&orientation===ORIENTATION_MIN_MAX||posMinorY> yPoints[yPoints.length-1].pos-firstDiff/2&&orientation!==ORIENTATION_MIN_MAX)break;this._calculateLine(posX-crossMinorStep/this.chartProp.pxToMM,posMinorY,posX+widthMinorLine/this.chartProp.pxToMM,posMinorY,path)}}}else{var xPoints=this.catAx.xPoints;if(!xPoints)return;var stepX=xPoints[1]?Math.abs(xPoints[1].pos-xPoints[0].pos):Math.abs(xPoints[0].pos-this.catAx.posX)*2;minorStep=stepX/minorLinesCount;posY=this.catAx.posY;var posMinorX;if(this.catAx.crossAx.crossBetween===AscFormat.CROSS_BETWEEN_BETWEEN)if(xPoints[1])firstDiff= Math.abs(xPoints[1].pos-xPoints[0].pos);else if(this.cChartSpace.chart.plotArea.valAx.posX)firstDiff=Math.abs(this.cChartSpace.chart.plotArea.valAx.posX-xPoints[0].pos)*2;if(orientation!==ORIENTATION_MIN_MAX){minorStep=-minorStep;firstDiff=-firstDiff}for(i=0;i<xPoints.length;i++){k=i*tickMarkSkip;if(k>=xPoints.length)break;if(xPoints[k].val<0)continue;posX=xPoints[k].pos-firstDiff/2;if(!this.paths.tickMarks)this.paths.tickMarks=pathId;this._calculateLine(posX,posY-crossMajorStep/this.chartProp.pxToMM, posX,posY+widthLine/this.chartProp.pxToMM,path);if((i+1)*tickMarkSkip===xPoints.length){var posXtemp=xPoints[xPoints.length-1].pos+firstDiff/2;this._calculateLine(posXtemp,posY-crossMajorStep/this.chartProp.pxToMM,posXtemp,posY+widthLine/this.chartProp.pxToMM,path)}if(widthMinorLine!==0)for(n=1;n<minorLinesCount;n++){posMinorX=posX+n*minorStep*tickMarkSkip;if(posMinorX>xPoints[xPoints.length-1].pos+firstDiff/2&&orientation===ORIENTATION_MIN_MAX||posMinorX<xPoints[xPoints.length-1].pos+firstDiff/2&& orientation!==ORIENTATION_MIN_MAX)break;this._calculateLine(posMinorX,posY-crossMinorStep/this.chartProp.pxToMM,posMinorX,posY+widthMinorLine/this.chartProp.pxToMM,path)}}}},_calculateLine:function(x,y,x1,y1,path){if(this.cChartDrawer.nDimensionCount===3){var view3DProp=this.cChartSpace.chart.getView3d();var z=this.cChartDrawer.processor3D.calculateZPositionCatAxis();var convertResult=this.cChartDrawer._convertAndTurnPoint(x*this.chartProp.pxToMM,y*this.chartProp.pxToMM,z);x=convertResult.x/this.chartProp.pxToMM; y=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(x1*this.chartProp.pxToMM,y1*this.chartProp.pxToMM,z);x1=convertResult.x/this.chartProp.pxToMM;y1=convertResult.y/this.chartProp.pxToMM}var pathId;if(!path){pathId=this.cChartSpace.AllocPath();path=this.cChartSpace.GetPath(pathId)}var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;if(this.catAx.axPos===window["AscFormat"].AX_POS_L||this.catAx.axPos===window["AscFormat"].AX_POS_R){path.moveTo(x1* pathW,y1*pathH);path.lnTo(x*pathW,y*pathH)}else{path.moveTo(x*pathW,y*pathH);path.lnTo(x1*pathW,y1*pathH)}return pathId},_drawGridLines:function(){var pen;var path;if(!this.paths.gridLines)return;if(!this.catAx.compiledMajorGridLines&&!this.catAx.compiledMinorGridLines)return;this.cChartDrawer.cShapeDrawer.bDrawSmartAttack=true;if(this.paths.minorGridLines){path=this.paths.minorGridLines;pen=this.catAx.compiledMinorGridLines;this.cChartDrawer.drawPath(path,pen)}if(this.paths.gridLines){pen=this.catAx.compiledMajorGridLines; path=this.paths.gridLines;this.cChartDrawer.drawPath(path,pen)}this.cChartDrawer.cShapeDrawer.bDrawSmartAttack=false},_drawAxis:function(){var pen;var path;pen=this.catAx.compiledLn;path=this.paths.axisLine;this.cChartDrawer.drawPath(path,pen)},_drawTickMark:function(){var pen,path;if(this.paths.tickMarks){this.cChartDrawer.cShapeDrawer.bDrawSmartAttack=true;pen=this.catAx.compiledTickMarkLn;path=this.paths.tickMarks;this.cChartDrawer.drawPath(path,pen);this.cChartDrawer.cShapeDrawer.bDrawSmartAttack= false}}};function valAxisChart(){this.chartProp=null;this.cChartSpace=null;this.cChartDrawer=null;this.valAx=null;this.paths={}}valAxisChart.prototype={constructor:valAxisChart,draw:function(chartsDrawer,valAx,isDrawGrid){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;if(valAx)this.valAx=valAx;if(isDrawGrid)this._drawGridLines();else{this._drawAxis();this._drawTickMark()}},recalculate:function(chartsDrawer,valAx){this.chartProp=chartsDrawer.calcProp; this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this.valAx=valAx;this.paths={};this._calculateGridLines();if(this.valAx.bDelete!==true){this._calculateAxis();this._calculateTickMark()}},_calculateGridLines:function(){var paths;if(this.valAx.axPos===window["AscFormat"].AX_POS_L||this.valAx.axPos===window["AscFormat"].AX_POS_R)paths=this.cChartDrawer.getHorizontalGridLines(this.valAx);else paths=this.cChartDrawer.getVerticalGridLines(this.valAx);this.paths.gridLines=paths?paths.gridLines: null;this.paths.minorGridLines=paths?paths.minorGridLines:null},_calculateAxis:function(){var nullPosition=this.valAx.posX;var left=this.chartProp.chartGutter._left/this.chartProp.pxToMM;var right=(this.chartProp.widthCanvas-this.chartProp.chartGutter._right)/this.chartProp.pxToMM;var top=this.chartProp.chartGutter._top/this.chartProp.pxToMM;var bottom=(this.chartProp.heightCanvas-this.chartProp.chartGutter._bottom)/this.chartProp.pxToMM;if(this.valAx.axPos===window["AscFormat"].AX_POS_T||this.valAx.axPos=== window["AscFormat"].AX_POS_B){nullPosition=this.valAx.posY;this.paths.axisLine=this._calculateLine(left,nullPosition,right,nullPosition)}else this.paths.axisLine=this._calculateLine(nullPosition,top,nullPosition,bottom)},_calculateTickMark:function(){var widthLine=0,widthMinorLine=0;var crossMajorStep=0;var crossMinorStep=0;switch(this.valAx.majorTickMark){case c_oAscTickMark.TICK_MARK_CROSS:{widthLine=5;crossMajorStep=5;break}case c_oAscTickMark.TICK_MARK_IN:{widthLine=5;break}case c_oAscTickMark.TICK_MARK_NONE:{widthLine= 0;break}case c_oAscTickMark.TICK_MARK_OUT:{widthLine=-5;break}}switch(this.valAx.minorTickMark){case c_oAscTickMark.TICK_MARK_CROSS:{widthMinorLine=3;crossMinorStep=3;break}case c_oAscTickMark.TICK_MARK_IN:{widthMinorLine=3;break}case c_oAscTickMark.TICK_MARK_NONE:{widthMinorLine=0;break}case c_oAscTickMark.TICK_MARK_OUT:{widthMinorLine=-3;break}}var orientation=this.valAx?this.valAx.scaling.orientation:ORIENTATION_MIN_MAX;var minorLinesCount=5;var axPos=this.valAx.axPos;if(axPos!==window["AscFormat"].AX_POS_L&& axPos!==window["AscFormat"].AX_POS_T){widthMinorLine=-widthMinorLine;widthLine=-widthLine;crossMajorStep=-crossMajorStep;crossMinorStep=-crossMinorStep}var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);if(!(widthLine===0&&widthMinorLine===0)){var points,minorStep,posY,posX;if(axPos===window["AscFormat"].AX_POS_T||axPos===window["AscFormat"].AX_POS_B){points=this.valAx.xPoints;if(!points)return;var stepX=points[1]?Math.abs(points[1].pos-points[0].pos):Math.abs(points[1].pos- this.chartProp.chartGutter._bottom/this.chartProp.pxToMM);minorStep=stepX/minorLinesCount;posY=this.valAx.posY;var posMinorX;for(var i=0;i<points.length;i++){posX=points[i].pos;if(!this.paths.tickMarks)this.paths.tickMarks=pathId;this._calculateLine(posX,posY-crossMajorStep/this.chartProp.pxToMM,posX,posY+widthLine/this.chartProp.pxToMM,path);if(widthMinorLine!==0&&!(orientation===ORIENTATION_MIN_MAX&&i===points.length-1||orientation!==ORIENTATION_MIN_MAX&&i===0))for(var n=0;n<minorLinesCount;n++){posMinorX= posX+n*minorStep;this._calculateLine(posMinorX,posY-crossMinorStep/this.chartProp.pxToMM,posMinorX,posY+widthMinorLine/this.chartProp.pxToMM,path)}}}else{points=this.valAx.yPoints;if(!points)return;var stepY=points[1]?Math.abs(points[1].pos-points[0].pos):Math.abs(points[0].pos-this.chartProp.chartGutter._bottom/this.chartProp.pxToMM);minorStep=stepY/minorLinesCount;posX=this.valAx.posX;var posMinorY;for(var i=0;i<points.length;i++){posY=points[i].pos;if(!this.paths.tickMarks)this.paths.tickMarks= pathId;this._calculateLine(posX-crossMajorStep/this.chartProp.pxToMM,posY,posX+widthLine/this.chartProp.pxToMM,posY,path);if(widthMinorLine!==0&&!(orientation===ORIENTATION_MIN_MAX&&i===points.length-1||orientation!==ORIENTATION_MIN_MAX&&i===0))for(var n=0;n<minorLinesCount;n++){posMinorY=posY-n*minorStep;this._calculateLine(posX-crossMinorStep/this.chartProp.pxToMM,posMinorY,posX+widthMinorLine/this.chartProp.pxToMM,posMinorY,path)}}}}},_calculateLine:function(x,y,x1,y1,path){if(this.cChartDrawer.nDimensionCount=== 3){var z=this.cChartDrawer.processor3D.calculateZPositionValAxis();var convertResult=this.cChartDrawer._convertAndTurnPoint(x*this.chartProp.pxToMM,y*this.chartProp.pxToMM,z);x=convertResult.x/this.chartProp.pxToMM;y=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(x1*this.chartProp.pxToMM,y1*this.chartProp.pxToMM,z);x1=convertResult.x/this.chartProp.pxToMM;y1=convertResult.y/this.chartProp.pxToMM}var pathId;if(!path){pathId=this.cChartSpace.AllocPath();path= this.cChartSpace.GetPath(pathId)}var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;if(this.valAx.axPos===window["AscFormat"].AX_POS_L||this.valAx.axPos===window["AscFormat"].AX_POS_R){path.moveTo(x1*pathW,y1*pathH);path.lnTo(x*pathW,y*pathH)}else{path.moveTo(x*pathW,y*pathH);path.lnTo(x1*pathW,y1*pathH)}return pathId},_drawGridLines:function(){var pen;var path;if(!this.paths.gridLines)return;if(!this.valAx.compiledMajorGridLines&&!this.valAx.compiledMinorGridLines)return;this.cChartDrawer.cShapeDrawer.bDrawSmartAttack= true;if(this.paths.minorGridLines){path=this.paths.minorGridLines;pen=this.valAx.compiledMinorGridLines;this.cChartDrawer.drawPath(path,pen)}if(this.paths.gridLines){pen=this.valAx.compiledMajorGridLines;path=this.paths.gridLines;this.cChartDrawer.drawPath(path,pen)}this.cChartDrawer.cShapeDrawer.bDrawSmartAttack=false},_drawAxis:function(){var pen;var path;pen=this.valAx.compiledLn;path=this.paths.axisLine;this.cChartDrawer.drawPath(path,pen)},_drawTickMark:function(){var pen,path;if(this.paths.tickMarks){this.cChartDrawer.cShapeDrawer.bDrawSmartAttack= true;pen=this.valAx.compiledTickMarkLn;path=this.paths.tickMarks;this.cChartDrawer.drawPath(path,pen);this.cChartDrawer.cShapeDrawer.bDrawSmartAttack=false}}};function serAxisChart(){this.chartProp=null;this.cChartSpace=null;this.cChartDrawer=null;this.serAx=null;this.paths={}}serAxisChart.prototype={constructor:serAxisChart,draw:function(chartsDrawer,serAx){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;if(serAx)this.serAx=serAx;this._drawAxis(); this._drawTickMark()},recalculate:function(chartsDrawer,serAx){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this.serAx=serAx;this.paths={};if(this.cChartSpace.chart.plotArea.serAx&&this.cChartSpace.chart.plotArea.serAx.bDelete!==true){this._calculateAxis();this._calculateTickMark()}},_calculateAxis:function(){var nullPositionOx=this.chartProp.nullPositionOX;var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var x=this.chartProp.widthCanvas- this.chartProp.chartGutter._right;var y=nullPositionOx;var convertResult=this.cChartDrawer._convertAndTurnPoint(x,y,0);x=convertResult.x/this.chartProp.pxToMM;y=convertResult.y/this.chartProp.pxToMM;var x1=this.chartProp.widthCanvas-this.chartProp.chartGutter._right;var y1=nullPositionOx;convertResult=this.cChartDrawer._convertAndTurnPoint(x1,y1,perspectiveDepth);x1=convertResult.x/this.chartProp.pxToMM;y1=convertResult.y/this.chartProp.pxToMM;this.paths.axisLine=this._calculateLine(x,y,x1,y1)},_calculateTickMark:function(){var perspectiveDepth= this.cChartDrawer.processor3D.depthPerspective;var tickmarksProps=this._getTickmarksProps();var widthLine=tickmarksProps.widthLine;if(widthLine!==0){var stepY=perspectiveDepth/this.chartProp.seriesCount;var startX=this.chartProp.widthCanvas-this.chartProp.chartGutter._right;var startY=this.chartProp.nullPositionOX;for(var i=0;i<=this.chartProp.seriesCount;i++){if(!this.paths.tickMarks)this.paths.tickMarks=[];var convertResult=this.cChartDrawer._convertAndTurnPoint(startX,startY,i*stepY);var x=convertResult.x/ this.chartProp.pxToMM;var y=convertResult.y/this.chartProp.pxToMM;this.paths.tickMarks[i]=this._calculateLine(x,y,x+widthLine/this.chartProp.pxToMM,y)}}},_getTickmarksProps:function(){var widthLine=0;var crossMajorStep=0;switch(this.serAx.majorTickMark){case c_oAscTickMark.TICK_MARK_CROSS:{widthLine=-5;crossMajorStep=5;break}case c_oAscTickMark.TICK_MARK_IN:{widthLine=-5;break}case c_oAscTickMark.TICK_MARK_NONE:{widthLine=0;break}case c_oAscTickMark.TICK_MARK_OUT:{widthLine=5;break}}if(this.serAx.axPos=== window["AscFormat"].AX_POS_B){widthLine=-widthLine;crossMajorStep=-crossMajorStep}return{widthLine:widthLine,crossMajorStep:crossMajorStep}},_calculateLine:function(x,y,x1,y1){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;path.moveTo(x*pathW,y*pathH);path.lnTo(x1*pathW,y1*pathH);return pathId},_drawAxis:function(){var pen=this.serAx?this.serAx.compiledLn:null;var path=this.paths.axisLine;this.cChartDrawer.drawPath(path, pen)},_drawTickMark:function(){var pen,path;if(!this.paths.tickMarks)return;for(var i=0;i<this.paths.tickMarks.length;i++){pen=this.serAx?this.serAx.compiledTickMarkLn:null;path=this.paths.tickMarks[i];this.cChartDrawer.drawPath(path,pen)}}};function floor3DChart(){this.chartProp=null;this.cChartSpace=null;this.cChartDrawer=null;this.paths={}}floor3DChart.prototype={constructor:floor3DChart,draw:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace; this.cChartDrawer=chartsDrawer;this._draw()},recalculate:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this.paths={};this._calculate()},_calculate:function(){var nullPositionOy=this.chartProp.heightCanvas-this.chartProp.chartGutter._bottom;var maxPositionOy=this.chartProp.chartGutter._top;var yPoints=this.cChartSpace.chart.plotArea.valAx?this.cChartSpace.chart.plotArea.valAx.yPoints:null;if(yPoints&&yPoints[0]&& yPoints[yPoints.length-1]){nullPositionOy=yPoints[0].pos>yPoints[yPoints.length-1].pos?yPoints[0].pos*this.chartProp.pxToMM:yPoints[yPoints.length-1].pos*this.chartProp.pxToMM;maxPositionOy=yPoints[0].pos<yPoints[yPoints.length-1].pos?yPoints[0].pos*this.chartProp.pxToMM:yPoints[yPoints.length-1].pos*this.chartProp.pxToMM}var pxToMm=this.chartProp.pxToMM;var poisition=this.cChartDrawer.processor3D.calculateFloorPosition();var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var point1, point2,point3,point4;switch(poisition){case AscCommon.c_oChartFloorPosition.Left:{point1=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,0);point2=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,maxPositionOy,0);point3=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,maxPositionOy,perspectiveDepth);point4=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,perspectiveDepth);break}case AscCommon.c_oChartFloorPosition.Right:{point1= this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,nullPositionOy,0);point2=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,maxPositionOy,0);point3=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,maxPositionOy,perspectiveDepth);point4=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,nullPositionOy, perspectiveDepth);break}case AscCommon.c_oChartFloorPosition.Bottom:{point1=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,0);point2=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,perspectiveDepth);point3=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,nullPositionOy,perspectiveDepth);point4=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right, nullPositionOy,0);break}case AscCommon.c_oChartFloorPosition.Top:{point1=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,maxPositionOy,0);point2=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,maxPositionOy,perspectiveDepth);point3=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,maxPositionOy,perspectiveDepth);point4=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right, maxPositionOy,0);break}}if(point1)this.paths.chartFloor=this.cChartDrawer.calculatePolygon([{x:point1.x/pxToMm,y:point1.y/pxToMm},{x:point2.x/pxToMm,y:point2.y/pxToMm},{x:point3.x/pxToMm,y:point3.y/pxToMm},{x:point4.x/pxToMm,y:point4.y/pxToMm}])},_draw:function(){var brush=this.cChartSpace.chart.floor?this.cChartSpace.chart.floor.brush:null;var pen=this.cChartSpace.chart.floor?this.cChartSpace.chart.floor.pen:null;var path=this.paths.chartFloor;this.cChartDrawer.drawPath(path,pen,brush)}};function sideWall3DChart(){this.chartProp= null;this.cChartSpace=null;this.cChartDrawer=null;this.paths={}}sideWall3DChart.prototype={constructor:sideWall3DChart,draw:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this._draw()},recalculate:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this.paths={};this._calculate()},_calculate:function(){var nullPositionOy=this.chartProp.heightCanvas- this.chartProp.chartGutter._bottom;var maxPositionOy=this.chartProp.chartGutter._top;var yPoints=this.cChartSpace.chart.plotArea.valAx?this.cChartSpace.chart.plotArea.valAx.yPoints:null;if(yPoints&&yPoints[0]&&yPoints[yPoints.length-1]){nullPositionOy=yPoints[0].pos>yPoints[yPoints.length-1].pos?yPoints[0].pos*this.chartProp.pxToMM:yPoints[yPoints.length-1].pos*this.chartProp.pxToMM;maxPositionOy=yPoints[0].pos<yPoints[yPoints.length-1].pos?yPoints[0].pos*this.chartProp.pxToMM:yPoints[yPoints.length- 1].pos*this.chartProp.pxToMM}var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var convertResult,x1n,y1n,x2n,y2n,x3n,y3n,x4n,y4n;if(this.chartProp.type===c_oChartTypes.HBar){convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,0);x1n=convertResult.x/this.chartProp.pxToMM;y1n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,perspectiveDepth);x2n= convertResult.x/this.chartProp.pxToMM;y2n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,nullPositionOy,perspectiveDepth);x3n=convertResult.x/this.chartProp.pxToMM;y3n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,nullPositionOy,0);x4n=convertResult.x/this.chartProp.pxToMM;y4n=convertResult.y/ this.chartProp.pxToMM}else{convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,0);x1n=convertResult.x/this.chartProp.pxToMM;y1n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,this.chartProp.chartGutter._top,0);x2n=convertResult.x/this.chartProp.pxToMM;y2n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left, this.chartProp.chartGutter._top,perspectiveDepth);x3n=convertResult.x/this.chartProp.pxToMM;y3n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,perspectiveDepth);x4n=convertResult.x/this.chartProp.pxToMM;y4n=convertResult.y/this.chartProp.pxToMM}this.paths=this.cChartDrawer.calculatePolygon([{x:x1n,y:y1n},{x:x2n,y:y2n},{x:x3n,y:y3n},{x:x4n,y:y4n}])},_draw:function(){var brush=this.cChartSpace.chart.sideWall? this.cChartSpace.chart.sideWall.brush:null;var pen=this.cChartSpace.chart.sideWall?this.cChartSpace.chart.sideWall.pen:null;var path=this.paths;this.cChartDrawer.drawPath(path,pen,brush)}};function backWall3DChart(){this.chartProp=null;this.cChartSpace=null;this.cChartDrawer=null;this.paths={}}backWall3DChart.prototype={constructor:backWall3DChart,draw:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this._draw()}, recalculate:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this.paths={};this._calculate()},_calculate:function(){var nullPositionOy=this.chartProp.heightCanvas-this.chartProp.chartGutter._bottom;var maxPositionOy=this.chartProp.chartGutter._top;var yPoints=this.cChartSpace.chart.plotArea.valAx?this.cChartSpace.chart.plotArea.valAx.yPoints:null;if(yPoints&&yPoints[0]&&yPoints[yPoints.length-1]){nullPositionOy=yPoints[0].pos> yPoints[yPoints.length-1].pos?yPoints[0].pos*this.chartProp.pxToMM:yPoints[yPoints.length-1].pos*this.chartProp.pxToMM;maxPositionOy=yPoints[0].pos<yPoints[yPoints.length-1].pos?yPoints[0].pos*this.chartProp.pxToMM:yPoints[yPoints.length-1].pos*this.chartProp.pxToMM}var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var convertResult,x1n,y1n,x2n,y2n,x3n,y3n,x4n,y4n;if(this.chartProp.type===c_oChartTypes.HBar){convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left, nullPositionOy,perspectiveDepth);x1n=convertResult.x/this.chartProp.pxToMM;y1n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,this.chartProp.chartGutter._top,perspectiveDepth);x2n=convertResult.x/this.chartProp.pxToMM;y2n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,this.chartProp.chartGutter._top,perspectiveDepth); x3n=convertResult.x/this.chartProp.pxToMM;y3n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,nullPositionOy,perspectiveDepth);x4n=convertResult.x/this.chartProp.pxToMM;y4n=convertResult.y/this.chartProp.pxToMM}else{convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,nullPositionOy,perspectiveDepth);x1n=convertResult.x/this.chartProp.pxToMM;y1n=convertResult.y/ this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.chartGutter._left,this.chartProp.chartGutter._top,perspectiveDepth);x2n=convertResult.x/this.chartProp.pxToMM;y2n=convertResult.y/this.chartProp.pxToMM;convertResult=this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,this.chartProp.chartGutter._top,perspectiveDepth);x3n=convertResult.x/this.chartProp.pxToMM;y3n=convertResult.y/this.chartProp.pxToMM;convertResult= this.cChartDrawer._convertAndTurnPoint(this.chartProp.widthCanvas-this.chartProp.chartGutter._right,nullPositionOy,perspectiveDepth);x4n=convertResult.x/this.chartProp.pxToMM;y4n=convertResult.y/this.chartProp.pxToMM}this.paths=this.cChartDrawer.calculatePolygon([{x:x1n,y:y1n},{x:x2n,y:y2n},{x:x3n,y:y3n},{x:x4n,y:y4n}])},_draw:function(){var brush=this.cChartSpace.chart.backWall?this.cChartSpace.chart.backWall.brush:null;var pen=this.cChartSpace.chart.backWall?this.cChartSpace.chart.backWall.pen: null;var path=this.paths;this.cChartDrawer.drawPath(path,pen,brush)}};function areaChart(){this.chartProp=null;this.cChartSpace=null;this.cChartDrawer=null;this.paths=null}areaChart.prototype={constructor:areaChart,draw:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this._drawArea()},recalculate:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer= chartsDrawer;this.paths=null;this._calculateArea()},_calculateArea:function(){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var pxToMm=this.chartProp.pxToMM;path.moveTo(0,0);path.lnTo(0/pxToMm*pathW,this.chartProp.heightCanvas/pxToMm*pathH);path.lnTo(this.chartProp.widthCanvas/pxToMm*pathW,this.chartProp.heightCanvas/pxToMm*pathH);path.lnTo(this.chartProp.widthCanvas/pxToMm*pathW,0/pxToMm*pathH);path.lnTo(0, 0);this.paths=pathId},_drawArea:function(){var pen=this.cChartSpace.pen;var brush=this.cChartSpace.brush;this.cChartDrawer.drawPath(this.paths,pen,brush)}};function plotAreaChart(){this.chartProp=null;this.cChartSpace=null;this.cChartDrawer=null;this.paths=null}plotAreaChart.prototype={constructor:plotAreaChart,draw:function(chartsDrawer,ignorePen,ignoreBrush){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this._drawArea(ignorePen,ignoreBrush)}, recalculate:function(chartsDrawer){this.chartProp=chartsDrawer.calcProp;this.cChartSpace=chartsDrawer.cChartSpace;this.cChartDrawer=chartsDrawer;this.paths=null;if(this.cChartDrawer.nDimensionCount===3&&this.chartProp.type!==c_oChartTypes.Pie)this._calculateArea3D();else this._calculateArea()},_calculateArea:function(){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH;var pathW=this.chartProp.pathW;var px=1/this.chartProp.pxToMM;var plotAreaPoints= this.cChartDrawer.getPlotAreaPoints();var left=plotAreaPoints.left-px;var right=plotAreaPoints.right-px;var top=plotAreaPoints.top-px;var bottom=plotAreaPoints.bottom-px;path.moveTo(left*pathW,bottom*pathH);path.lnTo(right*pathW,bottom*pathH);path.lnTo(right*pathW,top*pathH);path.lnTo(left*pathW,top*pathH);path.lnTo(left*pathW,bottom*pathH);this.paths=pathId},_calculateArea3D:function(){var pathId=this.cChartSpace.AllocPath();var path=this.cChartSpace.GetPath(pathId);var pathH=this.chartProp.pathH; var pathW=this.chartProp.pathW;var pxToMm=this.chartProp.pxToMM;var plotAreaPoints=this.cChartDrawer.getPlotAreaPoints();var left=plotAreaPoints.left*pxToMm-1;var right=plotAreaPoints.right*pxToMm-1;var top=plotAreaPoints.top*pxToMm-1;var bottom=plotAreaPoints.bottom*pxToMm-1;var perspectiveDepth=this.cChartDrawer.processor3D.depthPerspective;var convertResult=this.cChartDrawer._convertAndTurnPoint(left,bottom,perspectiveDepth);var x1n=convertResult.x;var y1n=convertResult.y;convertResult=this.cChartDrawer._convertAndTurnPoint(right, bottom,perspectiveDepth);var x2n=convertResult.x;var y2n=convertResult.y;convertResult=this.cChartDrawer._convertAndTurnPoint(right,top,perspectiveDepth);var x3n=convertResult.x;var y3n=convertResult.y;convertResult=this.cChartDrawer._convertAndTurnPoint(left,top,perspectiveDepth);var x4n=convertResult.x;var y4n=convertResult.y;convertResult=this.cChartDrawer._convertAndTurnPoint(left,bottom,perspectiveDepth);var x5n=convertResult.x;var y5n=convertResult.y;path.moveTo(x1n/pxToMm*pathW,y1n/pxToMm* pathH);path.lnTo(x2n/pxToMm*pathW,y2n/pxToMm*pathH);path.lnTo(x3n/pxToMm*pathW,y3n/pxToMm*pathH);path.lnTo(x4n/pxToMm*pathW,y4n/pxToMm*pathH);path.moveTo(x5n/pxToMm*pathW,y5n/pxToMm*pathH);this.paths=pathId},_drawArea:function(ignorePen,ignoreBrush){var pen=ignorePen?null:this.cChartSpace.chart.plotArea.pen;var brush=ignoreBrush?null:this.cChartSpace.chart.plotArea.brush;this.cChartDrawer.drawPath(this.paths,pen,brush)}};function CGeometry2(){this.pathLst=[];this.isLine=false;this.gdLst=[]}CGeometry2.prototype= {constructor:CGeometry2,canFill:function(){if(this.preset==="line")return false;for(var i=0;i<this.pathLst.length;++i)if(this.pathLst[i].fill!=="none")return true;return false},AddPath:function(path){this.pathLst.push(path)},AddRect:function(l,t,r,b){this.rectS={};this.rectS.l=l;this.rectS.t=t;this.rectS.r=r;this.rectS.b=b},draw:function(shape_drawer){for(var i=0,n=this.pathLst.length;i<n;++i)this.pathLst[i].drawSmart(shape_drawer)},check_bounds:function(checker){for(var i=0,n=this.pathLst.length;i< n;++i)this.pathLst[i].check_bounds(checker)}};function CColorObj(pen,brush,geometry){this.pen=pen;this.brush=brush;this.geometry=geometry}CColorObj.prototype={constructor:CColorObj,check_bounds:function(checker){if(this.geometry)this.geometry.check_bounds(checker)}};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CChartsDrawer=CChartsDrawer;window["AscFormat"].CColorObj=CColorObj;window["AscFormat"].c_oChartTypes=c_oChartTypes})(window);"use strict";(function(window,undefined){function XYAdjustmentTrack(originalShape, adjIndex,bTextWarp){AscFormat.ExecuteNoHistory(function(){this.originalShape=originalShape;this.bIsTracked=false;var oPen,oBrush;if(bTextWarp!==true){if(originalShape.spPr&&originalShape.spPr.geometry)this.geometry=originalShape.spPr.geometry.createDuplicate();else if(originalShape.calcGeometry)this.geometry=originalShape.calcGeometry.createDuplicate();this.shapeWidth=originalShape.extX;this.shapeHeight=originalShape.extY;this.transform=originalShape.transform.CreateDublicate();this.invertTransform= originalShape.invertTransform;oPen=originalShape.pen;oBrush=originalShape.brush}else{this.geometry=originalShape.recalcInfo.warpGeometry.createDuplicate();this.shapeWidth=originalShape.recalcInfo.warpGeometry.gdLst["w"];this.shapeHeight=originalShape.recalcInfo.warpGeometry.gdLst["h"];this.transform=originalShape.transformTextWordArt;this.invertTransform=originalShape.invertTransformTextWordArt;oPen=null;oBrush=null}this.bTextWarp=bTextWarp===true;this.geometry.Recalculate(this.shapeWidth,this.shapeHeight); this.adjastment=this.geometry.ahXYLst[adjIndex];this.xFlag=false;this.yFlag=false;this.refX=null;this.refY=null;this.originalObject=originalShape;if(this.adjastment!==null&&typeof this.adjastment==="object"){var _ref_x=this.adjastment.gdRefX;var _gd_lst=this.geometry.gdLst;if(typeof _ref_x==="string"&&typeof _gd_lst[_ref_x]==="number"&&typeof this.adjastment.minX==="number"&&typeof this.adjastment.maxX==="number"){_gd_lst[_ref_x]=this.adjastment.minX;this.geometry.Recalculate(this.shapeWidth,this.shapeHeight); this.minRealX=this.adjastment.posX;_gd_lst[_ref_x]=this.adjastment.maxX;this.geometry.Recalculate(this.shapeWidth,this.shapeHeight);this.maxRealX=this.adjastment.posX;this.maximalRealX=Math.max(this.maxRealX,this.minRealX);this.minimalRealX=Math.min(this.maxRealX,this.minRealX);this.minimalRealativeX=Math.min(this.adjastment.minX,this.adjastment.maxX);this.maximalRealativeX=Math.max(this.adjastment.minX,this.adjastment.maxX);if(this.maximalRealX-this.minimalRealX>0){this.coeffX=(this.adjastment.maxX- this.adjastment.minX)/(this.maxRealX-this.minRealX);this.xFlag=true}}var _ref_y=this.adjastment.gdRefY;if(typeof _ref_y==="string"&&typeof _gd_lst[_ref_y]==="number"&&typeof this.adjastment.minY==="number"&&typeof this.adjastment.maxY==="number"){_gd_lst[_ref_y]=this.adjastment.minY;this.geometry.Recalculate(this.shapeWidth,this.shapeHeight);this.minRealY=this.adjastment.posY;_gd_lst[_ref_y]=this.adjastment.maxY;this.geometry.Recalculate(this.shapeWidth,this.shapeHeight);this.maxRealY=this.adjastment.posY; this.maximalRealY=Math.max(this.maxRealY,this.minRealY);this.minimalRealY=Math.min(this.maxRealY,this.minRealY);this.minimalRealativeY=Math.min(this.adjastment.minY,this.adjastment.maxY);this.maximalRealativeY=Math.max(this.adjastment.minY,this.adjastment.maxY);if(this.maximalRealY-this.minimalRealY>0){this.coeffY=(this.adjastment.maxY-this.adjastment.minY)/(this.maxRealY-this.minRealY);this.yFlag=true}}if(this.xFlag)this.refX=_ref_x;if(this.yFlag)this.refY=_ref_y}this.overlayObject=new AscFormat.OverlayObject(this.geometry, this.shapeWidth,this.shapeHeight,oBrush,oPen,this.transform)},this,[])}XYAdjustmentTrack.prototype.getBounds=function(){var bounds_checker=new AscFormat.CSlideBoundsChecker;bounds_checker.init(Page_Width,Page_Height,Page_Width,Page_Height);this.draw(bounds_checker);var tr=this.originalShape.transform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0,0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.originalShape.extX,0));arr_p_y.push(tr.TransformPointY(this.originalShape.extX, 0));arr_p_x.push(tr.TransformPointX(this.originalShape.extX,this.originalShape.extY));arr_p_y.push(tr.TransformPointY(this.originalShape.extX,this.originalShape.extY));arr_p_x.push(tr.TransformPointX(0,this.originalShape.extY));arr_p_y.push(tr.TransformPointY(0,this.originalShape.extY));arr_p_x.push(bounds_checker.Bounds.min_x);arr_p_x.push(bounds_checker.Bounds.max_x);arr_p_y.push(bounds_checker.Bounds.min_y);arr_p_y.push(bounds_checker.Bounds.max_y);bounds_checker.Bounds.min_x=Math.min.apply(Math, arr_p_x);bounds_checker.Bounds.max_x=Math.max.apply(Math,arr_p_x);bounds_checker.Bounds.min_y=Math.min.apply(Math,arr_p_y);bounds_checker.Bounds.max_y=Math.max.apply(Math,arr_p_y);bounds_checker.Bounds.posX=this.originalShape.x;bounds_checker.Bounds.posY=this.originalShape.y;bounds_checker.Bounds.extX=this.originalShape.extX;bounds_checker.Bounds.extY=this.originalShape.extY;return bounds_checker.Bounds};XYAdjustmentTrack.prototype.draw=function(overlay){if(AscFormat.isRealNumber(this.originalShape.selectStartPage)&& overlay.SetCurrentPage)overlay.SetCurrentPage(this.originalShape.selectStartPage);this.overlayObject.draw(overlay)};XYAdjustmentTrack.prototype.track=function(posX,posY){this.bIsTracked=true;var invert_transform=this.invertTransform;var _relative_x=invert_transform.TransformPointX(posX,posY);var _relative_y=invert_transform.TransformPointY(posX,posY);var bRecalculate=false;if(this.xFlag){var _new_x=this.adjastment.minX+this.coeffX*(_relative_x-this.minRealX);if(_new_x<=this.maximalRealativeX&&_new_x>= this.minimalRealativeX){if(this.geometry.gdLst[this.adjastment.gdRefX]!==_new_x)bRecalculate=true;this.geometry.gdLst[this.adjastment.gdRefX]=_new_x}else if(_new_x>this.maximalRealativeX){if(this.geometry.gdLst[this.adjastment.gdRefX]!==this.maximalRealativeX)bRecalculate=true;this.geometry.gdLst[this.adjastment.gdRefX]=this.maximalRealativeX}else{if(this.geometry.gdLst[this.adjastment.gdRefX]!==this.minimalRealativeX)bRecalculate=true;this.geometry.gdLst[this.adjastment.gdRefX]=this.minimalRealativeX}}if(this.yFlag){var _new_y= this.adjastment.minY+this.coeffY*(_relative_y-this.minRealY);if(_new_y<=this.maximalRealativeY&&_new_y>=this.minimalRealativeY){if(this.geometry.gdLst[this.adjastment.gdRefY]!==_new_y)bRecalculate=true;this.geometry.gdLst[this.adjastment.gdRefY]=_new_y}else if(_new_y>this.maximalRealativeY){if(this.geometry.gdLst[this.adjastment.gdRefY]!==this.maximalRealativeY)bRecalculate=true;this.geometry.gdLst[this.adjastment.gdRefY]=this.maximalRealativeY}else{if(this.geometry.gdLst[this.adjastment.gdRefY]!== this.minimalRealativeY)bRecalculate=true;this.geometry.gdLst[this.adjastment.gdRefY]=this.minimalRealativeY}}if(bRecalculate)this.geometry.Recalculate(this.shapeWidth,this.shapeHeight)};XYAdjustmentTrack.prototype.trackEnd=function(){if(!this.bIsTracked)return;var oGeometryToSet;if(!this.bTextWarp){if(!this.originalShape.spPr.geometry)this.originalShape.spPr.setGeometry(this.geometry.createDuplicate());oGeometryToSet=this.originalShape.spPr.geometry;if(this.xFlag)oGeometryToSet.setAdjValue(this.refX, this.geometry.gdLst[this.adjastment.gdRefX]+"");if(this.yFlag)oGeometryToSet.setAdjValue(this.refY,this.geometry.gdLst[this.adjastment.gdRefY]+"");if(this.originalShape.checkExtentsByDocContent)this.originalShape.checkExtentsByDocContent(true,true)}else{var new_body_pr=this.originalShape.getBodyPr();if(new_body_pr){oGeometryToSet=AscFormat.ExecuteNoHistory(function(){var oGeom=this.geometry.createDuplicate();if(this.xFlag)oGeom.setAdjValue(this.refX,this.geometry.gdLst[this.adjastment.gdRefX]+""); if(this.yFlag)oGeom.setAdjValue(this.refY,this.geometry.gdLst[this.adjastment.gdRefY]+"");return oGeom},this,[]);new_body_pr=new_body_pr.createDuplicate();new_body_pr.prstTxWarp=oGeometryToSet;if(this.originalShape.bWordShape)this.originalShape.setBodyPr(new_body_pr);else if(this.originalShape.txBody)this.originalShape.txBody.setBodyPr(new_body_pr)}}};function PolarAdjustmentTrack(originalShape,adjIndex,bTextWarp){AscFormat.ExecuteNoHistory(function(){this.bIsTracked=false;this.originalShape=originalShape; var oPen,oBrush;if(bTextWarp!==true){if(originalShape.spPr&&originalShape.spPr.geometry)this.geometry=originalShape.spPr.geometry.createDuplicate();else if(originalShape.calcGeometry)this.geometry=originalShape.calcGeometry.createDuplicate();this.shapeWidth=originalShape.extX;this.shapeHeight=originalShape.extY;this.transform=originalShape.transform;this.invertTransform=originalShape.invertTransform;oPen=originalShape.pen;oBrush=originalShape.brush}else{this.geometry=originalShape.recalcInfo.warpGeometry.createDuplicate(); this.shapeWidth=originalShape.recalcInfo.warpGeometry.gdLst["w"];this.shapeHeight=originalShape.recalcInfo.warpGeometry.gdLst["h"];this.transform=originalShape.transformTextWordArt;this.invertTransform=originalShape.invertTransformTextWordArt;oPen=null;oBrush=null}this.geometry.Recalculate(this.shapeWidth,this.shapeHeight);this.adjastment=this.geometry.ahPolarLst[adjIndex];this.bTextWarp=bTextWarp===true;this.radiusFlag=false;this.angleFlag=false;this.originalObject=originalShape;if(this.adjastment!== null&&typeof this.adjastment==="object"){var _ref_r=this.adjastment.gdRefR;var _gd_lst=this.geometry.gdLst;if(typeof _ref_r==="string"&&typeof _gd_lst[_ref_r]==="number"&&typeof this.adjastment.minR==="number"&&typeof this.adjastment.maxR==="number"){_gd_lst[_ref_r]=this.adjastment.minR;this.geometry.Recalculate(this.shapeWidth,this.shapeHeight);var _dx=this.adjastment.posX-this.shapeWidth*.5;var _dy=this.adjastment.posY-this.shapeWidth*.5;this.minRealR=Math.sqrt(_dx*_dx+_dy*_dy);_gd_lst[_ref_r]= this.adjastment.maxR;this.geometry.Recalculate(this.shapeWidth,this.shapeHeight);_dx=this.adjastment.posX-this.shapeWidth*.5;_dy=this.adjastment.posY-this.shapeHeight*.5;this.maxRealR=Math.sqrt(_dx*_dx+_dy*_dy);this.maximalRealRadius=Math.max(this.maxRealR,this.minRealR);this.minimalRealRadius=Math.min(this.maxRealR,this.minRealR);this.minimalRealativeRadius=Math.min(this.adjastment.minR,this.adjastment.maxR);this.maximalRealativeRadius=Math.max(this.adjastment.minR,this.adjastment.maxR);if(this.maximalRealRadius- this.minimalRealRadius>0){this.coeffR=(this.adjastment.maxR-this.adjastment.minR)/(this.maxRealR-this.minRealR);this.radiusFlag=true}}var _ref_ang=this.adjastment.gdRefAng;if(typeof _ref_ang==="string"&&typeof _gd_lst[_ref_ang]==="number"&&typeof this.adjastment.minAng==="number"&&typeof this.adjastment.maxAng==="number"){this.angleFlag=true;this.minimalAngle=Math.min(this.adjastment.minAng,this.adjastment.maxAng);this.maximalAngle=Math.max(this.adjastment.minAng,this.adjastment.maxAng)}}this.overlayObject= new AscFormat.OverlayObject(this.geometry,this.shapeWidth,this.shapeHeight,oBrush,oPen,this.transform)},this,[]);this.draw=function(overlay){if(this.originalShape.parent&&AscFormat.isRealNumber(this.originalShape.selectStartPage)&&overlay.SetCurrentPage)overlay.SetCurrentPage(this.originalShape.selectStartPage);this.overlayObject.draw(overlay)};this.track=function(posX,posY){this.bIsTracked=true;var invert_transform=this.invertTransform;var _relative_x=invert_transform.TransformPointX(posX,posY); var _relative_y=invert_transform.TransformPointY(posX,posY);var _pos_x_relative_center=_relative_x-this.shapeWidth*.5;var _pos_y_relative_center=_relative_y-this.shapeHeight*.5;if(this.radiusFlag){var _radius=Math.sqrt(_pos_x_relative_center*_pos_x_relative_center+_pos_y_relative_center*_pos_y_relative_center);var _new_radius=this.adjastment.minR+this.coeffR*(_radius-this.minRealR);if(_new_radius<=this.maximalRealativeRadius&&_new_radius>=this.minimalRealativeRadius)this.geometry.gdLst[this.adjastment.gdRefR]= _new_radius;else if(_new_radius>this.maximalRealativeRadius)this.geometry.gdLst[this.adjastment.gdRefR]=this.maximalRealativeRadius;else this.geometry.gdLst[this.adjastment.gdRefR]=this.minimalRealativeRadius}if(this.angleFlag){if(this.geometry.preset==="mathNotEqual"){_pos_y_relative_center=-_pos_y_relative_center;_pos_x_relative_center=-_pos_x_relative_center}var _angle=Math.atan2(_pos_y_relative_center,_pos_x_relative_center);while(_angle<0)_angle+=2*Math.PI;while(_angle>=2*Math.PI)_angle-=2*Math.PI; _angle*=AscFormat.cToDeg;if(_angle>=this.minimalAngle&&_angle<=this.maximalAngle)this.geometry.gdLst[this.adjastment.gdRefAng]=_angle;else if(_angle>=this.maximalAngle)this.geometry.gdLst[this.adjastment.gdRefAng]=this.maximalAngle;else if(_angle<=this.minimalAngle)this.geometry.gdLst[this.adjastment.gdRefAng]=this.minimalAngle}this.geometry.Recalculate(this.shapeWidth,this.shapeHeight)};this.trackEnd=function(){if(!this.bIsTracked)return;var oGeometryToSet;if(!this.bTextWarp){if(!this.originalShape.spPr.geometry)this.originalShape.spPr.setGeometry(this.geometry.createDuplicate()); oGeometryToSet=this.originalShape.spPr.geometry;if(this.radiusFlag)oGeometryToSet.setAdjValue(this.adjastment.gdRefR,this.geometry.gdLst[this.adjastment.gdRefR]+"");if(this.angleFlag)oGeometryToSet.setAdjValue(this.adjastment.gdRefAng,this.geometry.gdLst[this.adjastment.gdRefAng]+"");if(this.originalShape.checkExtentsByDocContent)this.originalShape.checkExtentsByDocContent(true,true)}else{var new_body_pr=this.originalShape.getBodyPr();if(new_body_pr){oGeometryToSet=AscFormat.ExecuteNoHistory(function(){var oGeom= this.geometry.createDuplicate();if(this.radiusFlag)oGeom.setAdjValue(this.adjastment.gdRefR,this.geometry.gdLst[this.adjastment.gdRefR]+"");if(this.angleFlag)oGeom.setAdjValue(this.adjastment.gdRefAng,this.geometry.gdLst[this.adjastment.gdRefAng]+"");return oGeom},this,[]);new_body_pr=new_body_pr.createDuplicate();new_body_pr.prstTxWarp=oGeometryToSet;if(this.originalShape.bWordShape)this.originalShape.setBodyPr(new_body_pr);else if(this.originalShape.txBody)this.originalShape.txBody.setBodyPr(new_body_pr)}}}} PolarAdjustmentTrack.prototype.getBounds=XYAdjustmentTrack.prototype.getBounds;window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].XYAdjustmentTrack=XYAdjustmentTrack;window["AscFormat"].PolarAdjustmentTrack=PolarAdjustmentTrack})(window);"use strict";(function(window,undefined){var CMatrix=AscCommon.CMatrix;var global_MatrixTransformer=AscCommon.global_MatrixTransformer;function MoveShapeImageTrack(originalObject){this.bIsTracked=false;this.originalObject=originalObject;this.transform= new CMatrix;this.x=null;this.y=null;this.pageIndex=null;this.originalShape=originalObject;this.lastDx=0;this.lastDy=0;var nObjectType=originalObject.getObjectType&&originalObject.getObjectType();if(nObjectType===AscDFH.historyitem_type_ChartSpace||nObjectType===AscDFH.historyitem_type_GraphicFrame||nObjectType===AscDFH.historyitem_type_SlicerView){var pen_brush=AscFormat.CreatePenBrushForChartTrack();this.brush=pen_brush.brush;this.pen=pen_brush.pen}else{if(originalObject.blipFill){this.brush=new AscFormat.CUniFill; this.brush.fill=originalObject.blipFill}else this.brush=originalObject.brush;this.pen=originalObject.pen}if(this.originalObject.cropObject&&this.brush)this.brush=this.brush.createDuplicate();if(this.originalObject.cropObject)this.cropObject=this.originalObject.cropObject;this.overlayObject=new AscFormat.OverlayObject(originalObject.getGeom(),this.originalObject.extX,this.originalObject.extY,this.brush,this.pen,this.transform);this.groupInvertMatrix=null;if(this.originalObject.group){this.groupInvertMatrix= this.originalObject.group.invertTransform.CreateDublicate();this.groupInvertMatrix.tx=0;this.groupInvertMatrix.ty=0}this.track=function(dx,dy,pageIndex){this.bIsTracked=true;this.lastDx=dx;this.lastDy=dy;var original=this.originalObject;var dx2,dy2;if(this.groupInvertMatrix){dx2=this.groupInvertMatrix.TransformPointX(dx,dy);dy2=this.groupInvertMatrix.TransformPointY(dx,dy)}else{dx2=dx;dy2=dy}this.x=original.x+dx2;this.y=original.y+dy2;this.transform.Reset();var hc=original.extX*.5;var vc=original.extY* .5;global_MatrixTransformer.TranslateAppend(this.transform,-hc,-vc);if(original.flipH)global_MatrixTransformer.ScaleAppend(this.transform,-1,1);if(original.flipV)global_MatrixTransformer.ScaleAppend(this.transform,1,-1);global_MatrixTransformer.RotateRadAppend(this.transform,-original.rot);global_MatrixTransformer.TranslateAppend(this.transform,this.x+hc,this.y+vc);if(this.originalObject.group)global_MatrixTransformer.MultiplyAppend(this.transform,this.originalObject.group.transform);if(AscFormat.isRealNumber(pageIndex))this.pageIndex= pageIndex;if(this.originalObject.cropObject){var oShapeDrawer=new AscCommon.CShapeDrawer;oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;this.originalObject.check_bounds(oShapeDrawer);this.brush.fill.srcRect=AscFormat.CalculateSrcRect(this.transform,oShapeDrawer,global_MatrixTransformer.Invert(this.originalObject.cropObject.transform),this.originalObject.cropObject.extX,this.originalObject.cropObject.extY)}};this.draw=function(overlay){if(AscFormat.isRealNumber(this.pageIndex)&& overlay.SetCurrentPage)overlay.SetCurrentPage(this.pageIndex);if(this.originalObject.isCrop){var dOldAlpha=null;var oGraphics=overlay.Graphics?overlay.Graphics:overlay;if(AscFormat.isRealNumber(oGraphics.globalAlpha)&&oGraphics.put_GlobalAlpha){dOldAlpha=oGraphics.globalAlpha;oGraphics.put_GlobalAlpha(false,1)}this.overlayObject.draw(overlay);var oldFill=this.brush.fill;this.brush.fill=this.originalObject.cropBrush.fill;this.overlayObject.shapeDrawer.Clear();this.overlayObject.draw(overlay);this.brush.fill= oldFill;var oldSrcRect,oldPen;var parentCrop=this.originalObject.parentCrop;var oShapeDrawer=new AscCommon.CShapeDrawer;oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;parentCrop.check_bounds(oShapeDrawer);var srcRect=AscFormat.CalculateSrcRect(parentCrop.transform,oShapeDrawer,global_MatrixTransformer.Invert(this.transform),this.originalObject.extX,this.originalObject.extY);oldPen=this.originalObject.parentCrop.pen;this.originalObject.parentCrop.pen=AscFormat.CreatePenBrushForChartTrack().pen; if(this.originalObject.parentCrop.blipFill){oldSrcRect=this.originalObject.parentCrop.blipFill.srcRect;this.originalObject.parentCrop.blipFill.srcRect=srcRect;this.originalObject.parentCrop.draw(overlay);this.originalObject.parentCrop.blipFill.srcRect=oldSrcRect}else{oldSrcRect=this.originalObject.parentCrop.brush.fill.srcRect;this.originalObject.parentCrop.brush.fill.srcRect=srcRect;this.originalObject.parentCrop.draw(overlay);this.originalObject.parentCrop.brush.fill.srcRect=oldSrcRect}this.originalObject.parentCrop.pen= oldPen;if(AscFormat.isRealNumber(dOldAlpha)&&oGraphics.put_GlobalAlpha)oGraphics.put_GlobalAlpha(true,dOldAlpha);return}if(this.originalObject.cropObject){var dOldAlpha=null;var oGraphics=overlay.Graphics?overlay.Graphics:overlay;if(AscFormat.isRealNumber(oGraphics.globalAlpha)&&oGraphics.put_GlobalAlpha){dOldAlpha=oGraphics.globalAlpha;oGraphics.put_GlobalAlpha(false,1)}this.originalObject.cropObject.draw(overlay);var oldCropObj=this.originalObject.cropObject;var oldSrcRect,oldTransform,oldPen;var parentCrop= this.originalObject;oldTransform=parentCrop.transform;parentCrop.transform=this.transform;var oShapeDrawer=new AscCommon.CShapeDrawer;oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;parentCrop.check_bounds(oShapeDrawer);var srcRect=AscFormat.CalculateSrcRect(this.transform,oShapeDrawer,global_MatrixTransformer.Invert(oldCropObj.transform),oldCropObj.extX,oldCropObj.extY);oldPen=this.originalObject.pen;this.originalObject.pen=AscFormat.CreatePenBrushForChartTrack().pen; if(this.originalObject.blipFill){oldSrcRect=this.originalObject.blipFill.srcRect;this.originalObject.blipFill.srcRect=srcRect;this.originalObject.draw(overlay);this.originalObject.blipFill.srcRect=oldSrcRect}else{oldSrcRect=this.originalObject.brush.fill.srcRect;this.originalObject.brush.fill.srcRect=srcRect;this.originalObject.draw(overlay);this.originalObject.brush.fill.srcRect=oldSrcRect}this.originalObject.pen=oldPen;parentCrop.transform=oldTransform;if(AscFormat.isRealNumber(dOldAlpha)&&oGraphics.put_GlobalAlpha)oGraphics.put_GlobalAlpha(true, dOldAlpha);return}this.overlayObject.draw(overlay)};this.trackEnd=function(bWord,bNoResetCnx){if(!this.bIsTracked)return;if(bWord)if(this.originalObject.selectStartPage!==this.pageIndex)this.originalObject.selectStartPage=this.pageIndex;var scale_coefficients,ch_off_x,ch_off_y;if(this.originalObject.isCrop)AscFormat.ExecuteNoHistory(function(){AscFormat.CheckSpPrXfrm(this.originalObject)},this,[]);else if(!this.originalObject.group)AscFormat.CheckSpPrXfrm3(this.originalObject,true);else AscFormat.CheckSpPrXfrm(this.originalObject, true);if(this.originalObject.group){scale_coefficients=this.originalObject.group.getResultScaleCoefficients();ch_off_x=this.originalObject.group.spPr.xfrm.chOffX;ch_off_y=this.originalObject.group.spPr.xfrm.chOffY}else{if(bWord&&!this.originalObject.isCrop)if(this.originalObject.spPr.xfrm.offX===0&&this.originalObject.spPr.xfrm.offY===0){if(this.originalObject.cropObject){this.originalObject.transform=this.transform;this.originalObject.invertTransform=AscCommon.global_MatrixTransformer.Invert(this.transform); this.originalObject.calculateSrcRect();var oParaDrawing=this.originalObject.parent;if(oParaDrawing&&oParaDrawing.Check_WrapPolygon)oParaDrawing.Check_WrapPolygon()}return}scale_coefficients={cx:1,cy:1};ch_off_x=0;ch_off_y=0;if(bWord&&!this.originalObject.isCrop){this.x=0;this.y=0}}var _xfrm=this.originalObject.spPr.xfrm;var _x=_xfrm.offX;var _y=_xfrm.offY;if(this.originalObject.isCrop)AscFormat.ExecuteNoHistory(function(){this.originalObject.spPr.xfrm.setOffX(this.x/scale_coefficients.cx+ch_off_x); this.originalObject.spPr.xfrm.setOffY(this.y/scale_coefficients.cy+ch_off_y)},this,[]);else{this.originalObject.spPr.xfrm.setOffX(this.x/scale_coefficients.cx+ch_off_x);this.originalObject.spPr.xfrm.setOffY(this.y/scale_coefficients.cy+ch_off_y)}if(this.originalObject.getObjectType()===AscDFH.historyitem_type_Cnx)if(!AscFormat.fApproxEqual(_x,_xfrm.offX)||!AscFormat.fApproxEqual(_y,_xfrm.offY)){var nvUniSpPr=this.originalObject.nvSpPr.nvUniSpPr;var bResetBegin=false,bResetEnd=false;var oBeginShape= AscCommon.g_oTableId.Get_ById(nvUniSpPr.stCnxId);var oEndShape=AscCommon.g_oTableId.Get_ById(nvUniSpPr.endCnxId);if(oBeginShape)if(oBeginShape.bDeleted)bResetBegin=true;else if(!oBeginShape.selected)bResetBegin=true;if(oEndShape)if(oEndShape.bDeleted)bResetEnd=true;else if(!oEndShape.selected)bResetEnd=true;if((bResetEnd||bResetBegin)&&bNoResetCnx!==false){var _copy_nv_sp_pr=nvUniSpPr.copy();if(bResetBegin){_copy_nv_sp_pr.stCnxId=null;_copy_nv_sp_pr.stCnxIdx=null}if(bResetEnd){_copy_nv_sp_pr.endCnxId= null;_copy_nv_sp_pr.endCnxIdx=null}this.originalObject.nvSpPr.setUniSpPr(_copy_nv_sp_pr)}}if(this.originalObject.isCrop){AscFormat.ExecuteNoHistory(function(){this.originalObject.checkDrawingBaseCoords()},this,[]);this.originalObject.transform=this.transform;this.originalObject.invertTransform=AscCommon.global_MatrixTransformer.Invert(this.transform)}else this.originalObject.checkDrawingBaseCoords();if(this.originalObject.isCrop){if(!this.originalObject.parentCrop.cropObject)this.originalObject.parentCrop.cropObject= this.originalObject;this.originalObject.parentCrop.calculateSrcRect()}if(this.cropObject&&!this.originalObject.cropObject)this.originalObject.cropObject=this.cropObject;if(this.originalObject.cropObject){this.originalObject.transform=this.transform;this.originalObject.invertTransform=AscCommon.global_MatrixTransformer.Invert(this.transform);this.originalObject.calculateSrcRect()}}}MoveShapeImageTrack.prototype.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;this.draw(boundsChecker); var tr=this.transform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0,0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.originalObject.extX,0));arr_p_y.push(tr.TransformPointY(this.originalObject.extX,0));arr_p_x.push(tr.TransformPointX(this.originalObject.extX,this.originalObject.extY));arr_p_y.push(tr.TransformPointY(this.originalObject.extX,this.originalObject.extY));arr_p_x.push(tr.TransformPointX(0,this.originalObject.extY));arr_p_y.push(tr.TransformPointY(0, this.originalObject.extY));arr_p_x.push(boundsChecker.Bounds.min_x);arr_p_x.push(boundsChecker.Bounds.max_x);arr_p_y.push(boundsChecker.Bounds.min_y);arr_p_y.push(boundsChecker.Bounds.max_y);boundsChecker.Bounds.min_x=Math.min.apply(Math,arr_p_x);boundsChecker.Bounds.max_x=Math.max.apply(Math,arr_p_x);boundsChecker.Bounds.min_y=Math.min.apply(Math,arr_p_y);boundsChecker.Bounds.max_y=Math.max.apply(Math,arr_p_y);boundsChecker.Bounds.posX=this.x;boundsChecker.Bounds.posY=this.y;boundsChecker.Bounds.extX= this.originalObject.extX;boundsChecker.Bounds.extY=this.originalObject.extY;return boundsChecker.Bounds};function MoveGroupTrack(originalObject){this.bIsTracked=false;this.x=null;this.y=null;this.originalObject=originalObject;this.transform=new CMatrix;this.pageIndex=null;this.overlayObjects=[];this.arrTransforms2=[];var arr_graphic_objects=originalObject.getArrGraphicObjects();var group_invert_transform=originalObject.invertTransform;for(var i=0;i<arr_graphic_objects.length;++i){var gr_obj_transform_copy= arr_graphic_objects[i].transform.CreateDublicate();global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy,group_invert_transform);this.arrTransforms2[i]=gr_obj_transform_copy;this.overlayObjects[i]=new AscFormat.OverlayObject(arr_graphic_objects[i].getGeom(),arr_graphic_objects[i].extX,arr_graphic_objects[i].extY,arr_graphic_objects[i].brush,arr_graphic_objects[i].pen,new CMatrix)}this.track=function(dx,dy,pageIndex){this.bIsTracked=true;this.pageIndex=pageIndex;var original=this.originalObject; this.x=original.x+dx;this.y=original.y+dy;this.transform.Reset();var hc=original.extX*.5;var vc=original.extY*.5;global_MatrixTransformer.TranslateAppend(this.transform,-hc,-vc);if(original.flipH)global_MatrixTransformer.ScaleAppend(this.transform,-1,1);if(original.flipV)global_MatrixTransformer.ScaleAppend(this.transform,1,-1);global_MatrixTransformer.RotateRadAppend(this.transform,-original.rot);global_MatrixTransformer.TranslateAppend(this.transform,this.x+hc,this.y+vc);for(var i=0;i<this.overlayObjects.length;++i){var new_transform= this.arrTransforms2[i].CreateDublicate();global_MatrixTransformer.MultiplyAppend(new_transform,this.transform);this.overlayObjects[i].updateTransformMatrix(new_transform)}};this.draw=function(overlay){if(AscFormat.isRealNumber(this.pageIndex)&&overlay.SetCurrentPage)overlay.SetCurrentPage(this.pageIndex);for(var i=0;i<this.overlayObjects.length;++i)this.overlayObjects[i].draw(overlay)};this.getBounds=function(){var bounds_checker=new AscFormat.CSlideBoundsChecker;for(var i=0;i<this.overlayObjects.length;++i)this.overlayObjects[i].draw(bounds_checker); bounds_checker.Bounds.posX=this.x;bounds_checker.Bounds.posY=this.y;bounds_checker.Bounds.extX=this.originalObject.extX;bounds_checker.Bounds.extY=this.originalObject.extY;return bounds_checker.Bounds};this.trackEnd=function(bWord){if(!this.bIsTracked)return;if(bWord){this.x=0;this.y=0}AscFormat.CheckSpPrXfrm3(this.originalObject);var xfrm=this.originalObject.spPr.xfrm;xfrm.setOffX(this.x);xfrm.setOffY(this.y);if(bWord)if(this.originalObject.selectStartPage!==this.pageIndex)this.originalObject.selectStartPage= this.pageIndex;this.originalObject.checkDrawingBaseCoords()}}function MoveComment(comment){this.bIsTracked=false;this.comment=comment;this.x=comment.x;this.y=comment.y;this.track=function(dx,dy){this.bIsTracked=true;var original=this.comment;this.x=original.x+dx;this.y=original.y+dy};this.getFlags=function(){var Flags=0;Flags|=1;if(this.comment.Data.m_aReplies.length>0)Flags|=2;return Flags};this.draw=function(overlay){var Flags=this.getFlags();var dd=editor.WordControl.m_oDrawingDocument;overlay.DrawPresentationComment(Flags, this.x,this.y,dd.GetCommentWidth(Flags),dd.GetCommentHeight(Flags))};this.trackEnd=function(){if(!this.bIsTracked)return;this.comment.setPosition(this.x,this.y)};this.getBounds=function(){var dd=editor.WordControl.m_oDrawingDocument;var Flags=this.getFlags();var W=dd.GetCommentWidth(Flags);var H=dd.GetCommentHeight(Flags);var boundsChecker=new AscFormat.CSlideBoundsChecker;boundsChecker.Bounds.min_x=this.x;boundsChecker.Bounds.max_x=this.x+W;boundsChecker.Bounds.min_y=this.y;boundsChecker.Bounds.max_y= this.y+H;boundsChecker.Bounds.posX=this.x;boundsChecker.Bounds.posY=this.y;boundsChecker.Bounds.extX=W;boundsChecker.Bounds.extY=H;return boundsChecker.Bounds}}function MoveChartObjectTrack(oObject,oChartSpace){this.bIsTracked=false;this.originalObject=oObject;this.x=oObject.x;this.y=oObject.y;this.chartSpace=oChartSpace;this.transform=oObject.transform.CreateDublicate();this.overlayObject=new AscFormat.OverlayObject(oObject.calcGeometry?oObject.calcGeometry:AscFormat.ExecuteNoHistory(function(){var geom= AscFormat.CreateGeometry("rect");geom.Recalculate(oObject.extX,oObject.extY);return geom},this,[]),oObject.extX,oObject.extY,oObject.brush,oObject.pen,this.transform);this.track=function(dx,dy){this.bIsTracked=true;var original=this.originalObject;this.x=original.x+dx;this.y=original.y+dy;this.transform.Reset();this.transform.Translate(this.x,this.y,true);this.transform.Multiply(this.chartSpace.transform)};this.draw=function(overlay){if(AscFormat.isRealNumber(this.chartSpace.selectStartPage)&&overlay.SetCurrentPage)overlay.SetCurrentPage(this.chartSpace.selectStartPage); this.overlayObject.draw(overlay)};this.trackEnd=function(){if(!this.bIsTracked)return;History.Create_NewPoint(1);var oObjectToSet=null;if(this.originalObject instanceof AscFormat.CDLbl)oObjectToSet=this.originalObject.checkDlbl();else oObjectToSet=this.originalObject;if(!oObjectToSet)return;if(!oObjectToSet.layout)oObjectToSet.setLayout(new AscFormat.CLayout);if(oObjectToSet.getObjectType()===AscDFH.historyitem_type_PlotArea){oObjectToSet.layout.setLayoutTarget(AscFormat.LAYOUT_TARGET_INNER);oObjectToSet.layout.setXMode(AscFormat.LAYOUT_MODE_EDGE); oObjectToSet.layout.setYMode(AscFormat.LAYOUT_MODE_EDGE);var fLayoutW=this.chartSpace.calculateLayoutBySize(this.resizedPosX,oObjectToSet.layout.wMode,this.chartSpace.extX,oObjectToSet.extX);var fLayoutH=this.chartSpace.calculateLayoutBySize(this.resizedPosY,oObjectToSet.layout.hMode,this.chartSpace.extY,oObjectToSet.extY);oObjectToSet.layout.setW(fLayoutW);oObjectToSet.layout.setH(fLayoutH)}var pos=this.chartSpace.chartObj.recalculatePositionText(this.originalObject);var fLayoutX=this.chartSpace.calculateLayoutByPos(pos.x, oObjectToSet.layout.xMode,this.x,this.chartSpace.extX);var fLayoutY=this.chartSpace.calculateLayoutByPos(pos.y,oObjectToSet.layout.yMode,this.y,this.chartSpace.extY);oObjectToSet.layout.setX(fLayoutX);oObjectToSet.layout.setY(fLayoutY)};this.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;boundsChecker.Bounds.min_x=this.x;boundsChecker.Bounds.max_x=this.x+oObject.extX;boundsChecker.Bounds.min_y=this.y;boundsChecker.Bounds.max_y=this.y+oObject.extY;boundsChecker.Bounds.posX= this.x;boundsChecker.Bounds.posY=this.y;boundsChecker.Bounds.extX=oObject.extX;boundsChecker.Bounds.extY=oObject.extY;return boundsChecker.Bounds}}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].MoveShapeImageTrack=MoveShapeImageTrack;window["AscFormat"].MoveGroupTrack=MoveGroupTrack;window["AscFormat"].MoveComment=MoveComment;window["AscFormat"].MoveChartObjectTrack=MoveChartObjectTrack})(window);"use strict";(function(window,undefined){var MIN_SHAPE_SIZE=1.27;var MIN_SHAPE_SIZE_DIV2= MIN_SHAPE_SIZE/2;var SHAPE_ASPECTS={};SHAPE_ASPECTS["can"]=3616635/4810125;SHAPE_ASPECTS["moon"]=457200/914400;SHAPE_ASPECTS["leftBracket"]=73152/914400;SHAPE_ASPECTS["rightBracket"]=73152/914400;SHAPE_ASPECTS["leftBrace"]=155448/914400;SHAPE_ASPECTS["rightBrace"]=155448/914400;SHAPE_ASPECTS["triangle"]=1060704/914400;SHAPE_ASPECTS["parallelogram"]=1216152/914400;SHAPE_ASPECTS["trapezoid"]=914400/1216152;SHAPE_ASPECTS["pentagon"]=960120/914400;SHAPE_ASPECTS["hexagon"]=1060704/914400;SHAPE_ASPECTS["bracePair"]= 1069848/914400;SHAPE_ASPECTS["rightArrow"]=978408/484632;SHAPE_ASPECTS["leftArrow"]=978408/484632;SHAPE_ASPECTS["upArrow"]=484632/978408;SHAPE_ASPECTS["downArrow"]=484632/978408;SHAPE_ASPECTS["leftRightArrow"]=1216152/484632;SHAPE_ASPECTS["upDownArrow"]=484632/1216152;SHAPE_ASPECTS["bentArrow"]=813816/868680;SHAPE_ASPECTS["uturnArrow"]=886968/877824;SHAPE_ASPECTS["bentUpArrow"]=850392/731520;SHAPE_ASPECTS["curvedRightArrow"]=731520/1216152;SHAPE_ASPECTS["curvedLeftArrow"]=731520/1216152;SHAPE_ASPECTS["curvedUpArrow"]= 1216152/731520;SHAPE_ASPECTS["curvedDownArrow"]=1216152/731520;SHAPE_ASPECTS["stripedRightArrow"]=978408/484632;SHAPE_ASPECTS["notchedRightArrow"]=978408/484632;SHAPE_ASPECTS["homePlate"]=978408/484632;SHAPE_ASPECTS["leftRightArrowCallout"]=1216152/576072;SHAPE_ASPECTS["flowChartProcess"]=914400/612648;SHAPE_ASPECTS["flowChartAlternateProcess"]=914400/612648;SHAPE_ASPECTS["flowChartDecision"]=914400/612648;SHAPE_ASPECTS["flowChartInputOutput"]=914400/612648;SHAPE_ASPECTS["flowChartPredefinedProcess"]= 914400/612648;SHAPE_ASPECTS["flowChartDocument"]=914400/612648;SHAPE_ASPECTS["flowChartMultidocument"]=1060704/758952;SHAPE_ASPECTS["flowChartTerminator"]=914400/301752;SHAPE_ASPECTS["flowChartPreparation"]=1060704/612648;SHAPE_ASPECTS["flowChartManualInput"]=914400/457200;SHAPE_ASPECTS["flowChartManualOperation"]=914400/612648;SHAPE_ASPECTS["flowChartPunchedCard"]=914400/804672;SHAPE_ASPECTS["flowChartPunchedTape"]=914400/804672;SHAPE_ASPECTS["flowChartPunchedTape"]=457200/914400;SHAPE_ASPECTS["flowChartSort"]= 457200/914400;SHAPE_ASPECTS["flowChartOnlineStorage"]=914400/612648;SHAPE_ASPECTS["flowChartMagneticDisk"]=914400/612648;SHAPE_ASPECTS["flowChartMagneticDrum"]=914400/685800;SHAPE_ASPECTS["flowChartDisplay"]=914400/612648;SHAPE_ASPECTS["ribbon2"]=1216152/612648;SHAPE_ASPECTS["ribbon"]=1216152/612648;SHAPE_ASPECTS["ellipseRibbon2"]=1216152/758952;SHAPE_ASPECTS["ellipseRibbon"]=1216152/758952;SHAPE_ASPECTS["verticalScroll"]=1033272/1143E3;SHAPE_ASPECTS["horizontalScroll"]=1143E3/1033272;SHAPE_ASPECTS["wedgeRectCallout"]= 914400/612648;SHAPE_ASPECTS["wedgeRoundRectCallout"]=914400/612648;SHAPE_ASPECTS["wedgeEllipseCallout"]=914400/612648;SHAPE_ASPECTS["cloudCallout"]=914400/612648;SHAPE_ASPECTS["borderCallout1"]=914400/612648;SHAPE_ASPECTS["borderCallout2"]=914400/612648;SHAPE_ASPECTS["borderCallout3"]=914400/612648;SHAPE_ASPECTS["accentCallout1"]=914400/612648;SHAPE_ASPECTS["accentCallout2"]=914400/612648;SHAPE_ASPECTS["accentCallout3"]=914400/612648;SHAPE_ASPECTS["callout1"]=914400/612648;SHAPE_ASPECTS["callout2"]= 914400/612648;SHAPE_ASPECTS["callout3"]=914400/612648;SHAPE_ASPECTS["accentBorderCallout1"]=914400/612648;SHAPE_ASPECTS["accentBorderCallout2"]=914400/612648;SHAPE_ASPECTS["accentBorderCallout3"]=914400/612648;function NewShapeTrack(presetGeom,startX,startY,theme,master,layout,slide,pageIndex,drawingsController){this.presetGeom=presetGeom;this.startX=startX;this.startY=startY;this.x=null;this.y=null;this.extX=null;this.extY=null;this.rot=0;this.arrowsCount=0;this.transform=new AscCommon.CMatrix;this.pageIndex= pageIndex;this.theme=theme;this.drawingsController=drawingsController;this.bConnector=false;this.startConnectionInfo=null;this.oShapeDrawConnectors=null;this.lastSpPr=null;this.startShape=null;this.endShape=null;this.endConnectionInfo=null;AscFormat.ExecuteNoHistory(function(){if(this.drawingsController){this.bConnector=AscFormat.isConnectorPreset(presetGeom);if(this.bConnector){var aSpTree=[];this.drawingsController.getAllSingularDrawings(this.drawingsController.getDrawingArray(),aSpTree);var oConnector= null;for(var i=aSpTree.length-1;i>-1;--i){oConnector=aSpTree[i].findConnector(startX,startY);if(oConnector){this.startConnectionInfo=oConnector;this.startX=oConnector.x;this.startY=oConnector.y;this.startShape=aSpTree[i];break}}}}var style;if(presetGeom.indexOf("WithArrow")>-1){presetGeom=presetGeom.substr(0,presetGeom.length-9);this.presetGeom=presetGeom;this.arrowsCount=1}if(presetGeom.indexOf("WithTwoArrows")>-1){presetGeom=presetGeom.substr(0,presetGeom.length-13);this.presetGeom=presetGeom;this.arrowsCount= 2}var spDef=theme.spDef;if(presetGeom!=="textRect")if(spDef&&spDef.style)style=spDef.style.createDuplicate();else style=AscFormat.CreateDefaultShapeStyle(this.presetGeom);else style=AscFormat.CreateDefaultTextRectStyle();var brush=theme.getFillStyle(style.fillRef.idx);style.fillRef.Color.Calculate(theme,slide,layout,master,{R:0,G:0,B:0,A:255});var RGBA=style.fillRef.Color.RGBA;if(style.fillRef.Color.color)if(brush.fill&&brush.fill.type===Asc.c_oAscFill.FILL_TYPE_SOLID)brush.fill.color=style.fillRef.Color.createDuplicate(); var pen=theme.getLnStyle(style.lnRef.idx,style.lnRef.Color);style.lnRef.Color.Calculate(theme,slide,layout,master);RGBA=style.lnRef.Color.RGBA;if(presetGeom==="textRect"){var ln,fill;ln=new AscFormat.CLn;ln.w=6350;ln.Fill=new AscFormat.CUniFill;ln.Fill.fill=new AscFormat.CSolidFill;ln.Fill.fill.color=new AscFormat.CUniColor;ln.Fill.fill.color.color=new AscFormat.CPrstColor;ln.Fill.fill.color.color.id="black";fill=new AscFormat.CUniFill;fill.fill=new AscFormat.CSolidFill;fill.fill.color=new AscFormat.CUniColor; fill.fill.color.color=new AscFormat.CSchemeColor;fill.fill.color.color.id=12;pen.merge(ln);brush.merge(fill);if(slide){brush=AscFormat.CreateNoFillUniFill();pen=AscFormat.CreateNoFillLine()}}if(this.arrowsCount>0){pen.setTailEnd(new AscFormat.EndArrow);pen.tailEnd.setType(AscFormat.LineEndType.Arrow);pen.tailEnd.setLen(AscFormat.LineEndSize.Mid);if(this.arrowsCount===2){pen.setHeadEnd(new AscFormat.EndArrow);pen.headEnd.setType(AscFormat.LineEndType.Arrow);pen.headEnd.setLen(AscFormat.LineEndSize.Mid)}}if(presetGeom!== "textRect")if(spDef&&spDef.spPr){if(spDef.spPr.Fill)brush.merge(spDef.spPr.Fill);if(spDef.spPr.ln)pen.merge(spDef.spPr.ln)}var geometry=AscFormat.CreateGeometry(presetGeom!=="textRect"?presetGeom:"rect");this.startGeom=geometry;if(pen.Fill)pen.Fill.calculate(theme,slide,layout,master,RGBA);brush.calculate(theme,slide,layout,master,RGBA);this.isLine=this.presetGeom==="line";this.overlayObject=new AscFormat.OverlayObject(geometry,5,5,brush,pen,this.transform);this.shape=null},this,[]);this.track=function(e, x,y){var bConnectorHandled=false;this.oShapeDrawConnectors=null;this.lastSpPr=null;this.endShape=null;this.endConnectionInfo=null;if(this.bConnector){var aSpTree=[];this.drawingsController.getAllSingularDrawings(this.drawingsController.getDrawingArray(),aSpTree);var oConnector=null;var oEndConnectionInfo=null;for(var i=aSpTree.length-1;i>-1;--i){oConnector=aSpTree[i].findConnector(x,y);if(oConnector){oEndConnectionInfo=oConnector;this.oShapeDrawConnectors=aSpTree[i];this.endShape=aSpTree[i];this.endConnectionInfo= oEndConnectionInfo;break}}if(this.startConnectionInfo||oEndConnectionInfo){var _startInfo=this.startConnectionInfo;var _endInfo=oEndConnectionInfo;if(!_startInfo)_startInfo=AscFormat.fCalculateConnectionInfo(_endInfo,this.startX,this.startY);else if(!_endInfo)_endInfo=AscFormat.fCalculateConnectionInfo(_startInfo,x,y);var oSpPr=AscFormat.fCalculateSpPr(_startInfo,_endInfo,this.presetGeom,this.overlayObject.pen.w);this.flipH=oSpPr.xfrm.flipH===true;this.flipV=oSpPr.xfrm.flipV===true;this.rot=AscFormat.isRealNumber(oSpPr.xfrm.rot)? oSpPr.xfrm.rot:0;this.extX=oSpPr.xfrm.extX;this.extY=oSpPr.xfrm.extY;this.x=oSpPr.xfrm.offX;this.y=oSpPr.xfrm.offY;this.overlayObject=new AscFormat.OverlayObject(oSpPr.geometry,5,5,this.overlayObject.brush,this.overlayObject.pen,this.transform);bConnectorHandled=true;this.lastSpPr=oSpPr}if(!this.oShapeDrawConnectors)for(var i=aSpTree.length-1;i>-1;--i){var oCs=aSpTree[i].findConnectionShape(x,y);if(oCs){oEndConnectionInfo=oConnector;this.oShapeDrawConnectors=oCs;break}}if(false===bConnectorHandled)this.overlayObject= new AscFormat.OverlayObject(this.startGeom,5,5,this.overlayObject.brush,this.overlayObject.pen,this.transform)}if(false===bConnectorHandled){var real_dist_x=x-this.startX;var abs_dist_x=Math.abs(real_dist_x);var real_dist_y=y-this.startY;var abs_dist_y=Math.abs(real_dist_y);this.flipH=false;this.flipV=false;this.rot=0;if(this.isLine||this.bConnector){if(x<this.startX)this.flipH=true;if(y<this.startY)this.flipV=true}if(!(e.CtrlKey||e.ShiftKey)||e.CtrlKey&&!e.ShiftKey&&this.isLine){this.extX=abs_dist_x>= MIN_SHAPE_SIZE?abs_dist_x:this.isLine?0:MIN_SHAPE_SIZE;this.extY=abs_dist_y>=MIN_SHAPE_SIZE?abs_dist_y:this.isLine?0:MIN_SHAPE_SIZE;if(real_dist_x>=0)this.x=this.startX;else this.x=abs_dist_x>=MIN_SHAPE_SIZE?x:this.startX-this.extX;if(real_dist_y>=0)this.y=this.startY;else this.y=abs_dist_y>=MIN_SHAPE_SIZE?y:this.startY-this.extY}else if(e.CtrlKey&&!e.ShiftKey){if(abs_dist_x>=MIN_SHAPE_SIZE_DIV2){this.x=this.startX-abs_dist_x;this.extX=2*abs_dist_x}else{this.x=this.startX-MIN_SHAPE_SIZE_DIV2;this.extX= MIN_SHAPE_SIZE}if(abs_dist_y>=MIN_SHAPE_SIZE_DIV2){this.y=this.startY-abs_dist_y;this.extY=2*abs_dist_y}else{this.y=this.startY-MIN_SHAPE_SIZE_DIV2;this.extY=MIN_SHAPE_SIZE}}else if(!e.CtrlKey&&e.ShiftKey){var new_width,new_height;var prop_coefficient=typeof AscFormat.SHAPE_ASPECTS[this.presetGeom]==="number"?AscFormat.SHAPE_ASPECTS[this.presetGeom]:1;if(abs_dist_y===0){new_width=abs_dist_x>MIN_SHAPE_SIZE?abs_dist_x:MIN_SHAPE_SIZE;new_height=abs_dist_x/prop_coefficient}else{var new_aspect=abs_dist_x/ abs_dist_y;if(new_aspect>=prop_coefficient){new_width=abs_dist_x;new_height=abs_dist_x/prop_coefficient}else{new_height=abs_dist_y;new_width=abs_dist_y*prop_coefficient}}if(new_width<MIN_SHAPE_SIZE||new_height<MIN_SHAPE_SIZE){var k_wh=new_width/new_height;if(new_height<MIN_SHAPE_SIZE&&new_width<MIN_SHAPE_SIZE)if(new_height<new_width){new_height=MIN_SHAPE_SIZE;new_width=new_height*k_wh}else{new_width=MIN_SHAPE_SIZE;new_height=new_width/k_wh}else if(new_height<MIN_SHAPE_SIZE){new_height=MIN_SHAPE_SIZE; new_width=new_height*k_wh}else{new_width=MIN_SHAPE_SIZE;new_height=new_width/k_wh}}this.extX=new_width;this.extY=new_height;if(real_dist_x>=0)this.x=this.startX;else this.x=this.startX-this.extX;if(real_dist_y>=0)this.y=this.startY;else this.y=this.startY-this.extY;if(this.isLine){var angle=Math.atan2(real_dist_y,real_dist_x);if(angle>=0&&angle<=Math.PI/8||angle<=0&&angle>=-Math.PI/8||angle>=7*Math.PI/8&&angle<=Math.PI){this.extY=0;this.y=this.startY}else if(angle>=3*Math.PI/8&&angle<=5*Math.PI/8|| angle<=-3*Math.PI/8&&angle>=-5*Math.PI/8){this.extX=0;this.x=this.startX}}}else{var new_width,new_height;var prop_coefficient=typeof AscFormat.SHAPE_ASPECTS[this.presetGeom]==="number"?AscFormat.SHAPE_ASPECTS[this.presetGeom]:1;if(abs_dist_y===0){new_width=abs_dist_x>MIN_SHAPE_SIZE_DIV2?abs_dist_x*2:MIN_SHAPE_SIZE;new_height=new_width/prop_coefficient}else{var new_aspect=abs_dist_x/abs_dist_y;if(new_aspect>=prop_coefficient){new_width=abs_dist_x*2;new_height=new_width/prop_coefficient}else{new_height= abs_dist_y*2;new_width=new_height*prop_coefficient}}if(new_width<MIN_SHAPE_SIZE||new_height<MIN_SHAPE_SIZE){var k_wh=new_width/new_height;if(new_height<MIN_SHAPE_SIZE&&new_width<MIN_SHAPE_SIZE)if(new_height<new_width){new_height=MIN_SHAPE_SIZE;new_width=new_height*k_wh}else{new_width=MIN_SHAPE_SIZE;new_height=new_width/k_wh}else if(new_height<MIN_SHAPE_SIZE){new_height=MIN_SHAPE_SIZE;new_width=new_height*k_wh}else{new_width=MIN_SHAPE_SIZE;new_height=new_width/k_wh}}this.extX=new_width;this.extY=new_height; this.x=this.startX-this.extX*.5;this.y=this.startY-this.extY*.5}}this.overlayObject.updateExtents(this.extX,this.extY);this.transform.Reset();var hc=this.extX*.5;var vc=this.extY*.5;AscCommon.global_MatrixTransformer.TranslateAppend(this.transform,-hc,-vc);if(this.flipH)AscCommon.global_MatrixTransformer.ScaleAppend(this.transform,-1,1);if(this.flipV)AscCommon.global_MatrixTransformer.ScaleAppend(this.transform,1,-1);AscCommon.global_MatrixTransformer.RotateRadAppend(this.transform,-this.rot);AscCommon.global_MatrixTransformer.TranslateAppend(this.transform, this.x+hc,this.y+vc)};this.draw=function(overlay){if(AscFormat.isRealNumber(this.pageIndex)&&overlay.SetCurrentPage)overlay.SetCurrentPage(this.pageIndex);if(this.oShapeDrawConnectors)this.oShapeDrawConnectors.drawConnectors(overlay);this.overlayObject.draw(overlay)};this.getShape=function(bFromWord,DrawingDocument,drawingObjects){var _sp_pr,shape;if(this.bConnector){shape=new AscFormat.CConnectionShape;if(drawingObjects)shape.setDrawingObjects(drawingObjects);if(this.lastSpPr)_sp_pr=this.lastSpPr.createDuplicate(); else{_sp_pr=new AscFormat.CSpPr;_sp_pr.setXfrm(new AscFormat.CXfrm);var xfrm=_sp_pr.xfrm;xfrm.setParent(_sp_pr);var x,y;if(bFromWord){x=0;y=0}else{x=this.x;y=this.y}xfrm.setOffX(x);xfrm.setOffY(y);xfrm.setExtX(this.extX);xfrm.setExtY(this.extY);xfrm.setFlipH(this.flipH);xfrm.setFlipV(this.flipV)}shape.setSpPr(_sp_pr);_sp_pr.setParent(shape);var nv_sp_pr=new AscFormat.UniNvPr;nv_sp_pr.cNvPr.setId(0);shape.setNvSpPr(nv_sp_pr);var nvUniSpPr=new AscFormat.CNvUniSpPr;if(this.startShape&&this.startConnectionInfo){nvUniSpPr.stCnxIdx= this.startConnectionInfo.idx;nvUniSpPr.stCnxId=this.startShape.Id}if(this.endShape&&this.endConnectionInfo){nvUniSpPr.endCnxIdx=this.endConnectionInfo.idx;nvUniSpPr.endCnxId=this.endShape.Id}shape.nvSpPr.setUniSpPr(nvUniSpPr)}else{shape=new AscFormat.CShape;if(drawingObjects)shape.setDrawingObjects(drawingObjects);shape.setSpPr(new AscFormat.CSpPr);shape.spPr.setParent(shape);if(bFromWord)shape.setWordShape(true);var x,y;if(bFromWord){x=0;y=0}else{x=this.x;y=this.y}shape.spPr.setXfrm(new AscFormat.CXfrm); var xfrm=shape.spPr.xfrm;xfrm.setParent(shape.spPr);xfrm.setOffX(x);xfrm.setOffY(y);xfrm.setExtX(this.extX);xfrm.setExtY(this.extY);xfrm.setFlipH(this.flipH);xfrm.setFlipV(this.flipV)}shape.setBDeleted(false);if(this.presetGeom==="textRect"){shape.spPr.setGeometry(AscFormat.CreateGeometry("rect"));var fill,ln;if(!drawingObjects||!drawingObjects.cSld){if(!bFromWord)shape.setStyle(AscFormat.CreateDefaultTextRectStyle());fill=new AscFormat.CUniFill;fill.setFill(new AscFormat.CSolidFill);fill.fill.setColor(new AscFormat.CUniColor); fill.fill.color.setColor(new AscFormat.CSchemeColor);fill.fill.color.color.setId(12);shape.spPr.setFill(fill);ln=new AscFormat.CLn;ln.setW(6350);ln.setFill(new AscFormat.CUniFill);ln.Fill.setFill(new AscFormat.CSolidFill);ln.Fill.fill.setColor(new AscFormat.CUniColor);ln.Fill.fill.color.setColor(new AscFormat.CPrstColor);ln.Fill.fill.color.color.setId("black");shape.spPr.setLn(ln)}else{fill=new AscFormat.CUniFill;fill.setFill(new AscFormat.CNoFill);shape.spPr.setFill(fill)}if(bFromWord){shape.setTextBoxContent(new CDocumentContent(shape, DrawingDocument,0,0,0,0,false,false,false));var body_pr=new AscFormat.CBodyPr;body_pr.setDefault();shape.setBodyPr(body_pr)}else{shape.setTxBody(new AscFormat.CTextBody);var content=new AscFormat.CDrawingDocContent(shape.txBody,DrawingDocument,0,0,0,0,false,false,true);shape.txBody.setParent(shape);shape.txBody.setContent(content);var body_pr=new AscFormat.CBodyPr;body_pr.setDefault();var bNeedCheckExtents=false;if(drawingObjects)if(!drawingObjects.cSld)body_pr.vertOverflow=AscFormat.nOTClip;else{body_pr.textFit= new AscFormat.CTextFit;body_pr.textFit.type=AscFormat.text_fit_Auto;body_pr.wrap=AscFormat.nTWTSquare;bNeedCheckExtents=true}shape.txBody.setBodyPr(body_pr);if(bNeedCheckExtents){var dOldX=shape.spPr.xfrm.offX;var dOldY=shape.spPr.xfrm.offY;shape.setParent(drawingObjects);shape.recalculateContent();shape.checkExtentsByDocContent(true,true);shape.spPr.xfrm.setExtX(this.extX);shape.spPr.xfrm.setOffX(dOldX);shape.spPr.xfrm.setOffY(dOldY)}}}else{if(!shape.spPr.geometry)shape.spPr.setGeometry(AscFormat.CreateGeometry(this.presetGeom)); shape.setStyle(AscFormat.CreateDefaultShapeStyle(this.presetGeom));if(this.arrowsCount>0){var ln=new AscFormat.CLn;ln.setTailEnd(new AscFormat.EndArrow);ln.tailEnd.setType(AscFormat.LineEndType.Arrow);ln.tailEnd.setLen(AscFormat.LineEndSize.Mid);if(this.arrowsCount===2){ln.setHeadEnd(new AscFormat.EndArrow);ln.headEnd.setType(AscFormat.LineEndType.Arrow);ln.headEnd.setLen(AscFormat.LineEndSize.Mid)}shape.spPr.setLn(ln)}var spDef=this.theme&&this.theme.spDef;if(spDef){if(spDef.style)shape.setStyle(spDef.style.createDuplicate()); if(spDef.spPr){if(spDef.spPr.Fill)shape.spPr.setFill(spDef.spPr.Fill.createDuplicate());if(spDef.spPr.ln)if(shape.spPr.ln)shape.spPr.ln.merge(spDef.spPr.ln);else shape.spPr.setLn(spDef.spPr.ln.createDuplicate())}}}shape.x=this.x;shape.y=this.y;return shape};this.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;this.draw(boundsChecker);var tr=this.transform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0,0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.extX, 0));arr_p_y.push(tr.TransformPointY(this.extX,0));arr_p_x.push(tr.TransformPointX(this.extX,this.extY));arr_p_y.push(tr.TransformPointY(this.extX,this.extY));arr_p_x.push(tr.TransformPointX(0,this.extY));arr_p_y.push(tr.TransformPointY(0,this.extY));arr_p_x.push(boundsChecker.Bounds.min_x);arr_p_x.push(boundsChecker.Bounds.max_x);arr_p_y.push(boundsChecker.Bounds.min_y);arr_p_y.push(boundsChecker.Bounds.max_y);boundsChecker.Bounds.min_x=Math.min.apply(Math,arr_p_x);boundsChecker.Bounds.max_x=Math.max.apply(Math, arr_p_x);boundsChecker.Bounds.min_y=Math.min.apply(Math,arr_p_y);boundsChecker.Bounds.max_y=Math.max.apply(Math,arr_p_y);boundsChecker.Bounds.posX=this.x;boundsChecker.Bounds.posY=this.y;boundsChecker.Bounds.extX=this.extX;boundsChecker.Bounds.extY=this.extY;return boundsChecker.Bounds}}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].SHAPE_ASPECTS=SHAPE_ASPECTS;window["AscFormat"].NewShapeTrack=NewShapeTrack})(window);"use strict";(function(window,undefined){function PolyLine(drawingObjects, theme,master,layout,slide,pageIndex){AscFormat.ExecuteNoHistory(function(){this.drawingObjects=drawingObjects;this.arrPoint=[];this.Matrix=new AscCommon.CMatrixL;this.TransformMatrix=new AscCommon.CMatrixL;this.pageIndex=pageIndex;this.style=AscFormat.CreateDefaultShapeStyle();var style=this.style;style.fillRef.Color.Calculate(theme,slide,layout,master,{R:0,G:0,B:0,A:255});var RGBA=style.fillRef.Color.RGBA;var pen=theme.getLnStyle(style.lnRef.idx,style.lnRef.Color);style.lnRef.Color.Calculate(theme, slide,layout,master);RGBA=style.lnRef.Color.RGBA;if(pen.Fill)pen.Fill.calculate(theme,slide,layout,master,RGBA);this.pen=pen;this.polylineForDrawer=new PolylineForDrawer(this)},this,[]);this.Draw=function(graphics){graphics.SetIntegerGrid(false);graphics.transform3(this.Matrix);var shape_drawer=new AscCommon.CShapeDrawer;shape_drawer.fromShape(this,graphics);shape_drawer.draw(this)};this.draw=function(g){if(AscFormat.isRealNumber(this.pageIndex)&&g.SetCurrentPage)g.SetCurrentPage(this.pageIndex); this.polylineForDrawer.Draw(g);return;if(this.arrPoint.length<2)return;g._m(this.arrPoint[0].x,this.arrPoint[0].y);for(var i=1;i<this.arrPoint.length;++i)g._l(this.arrPoint[i].x,this.arrPoint[i].y);g.ds()};this.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;this.draw(boundsChecker);boundsChecker.Bounds.posX=boundsChecker.Bounds.min_x;boundsChecker.Bounds.posY=boundsChecker.Bounds.min_y;boundsChecker.Bounds.extX=boundsChecker.Bounds.max_x-boundsChecker.Bounds.min_x;boundsChecker.Bounds.extY= boundsChecker.Bounds.max_y-boundsChecker.Bounds.min_y;return boundsChecker.Bounds};this.getShape=function(bWord,drawingDocument,drawingObjects){var xMax=this.arrPoint[0].x,yMax=this.arrPoint[0].y,xMin=xMax,yMin=yMax;var i;var bClosed=false;var min_dist;if(drawingObjects)min_dist=drawingObjects.convertPixToMM(3);else min_dist=editor.WordControl.m_oDrawingDocument.GetMMPerDot(3);if(this.arrPoint.length>2){var dx=this.arrPoint[0].x-this.arrPoint[this.arrPoint.length-1].x;var dy=this.arrPoint[0].y-this.arrPoint[this.arrPoint.length- 1].y;if(Math.sqrt(dx*dx+dy*dy)<min_dist)bClosed=true}var _n=bClosed?this.arrPoint.length-1:this.arrPoint.length;for(i=1;i<_n;++i){if(this.arrPoint[i].x>xMax)xMax=this.arrPoint[i].x;if(this.arrPoint[i].y>yMax)yMax=this.arrPoint[i].y;if(this.arrPoint[i].x<xMin)xMin=this.arrPoint[i].x;if(this.arrPoint[i].y<yMin)yMin=this.arrPoint[i].y}var shape=new AscFormat.CShape;shape.setSpPr(new AscFormat.CSpPr);shape.spPr.setParent(shape);shape.spPr.setXfrm(new AscFormat.CXfrm);shape.spPr.xfrm.setParent(shape.spPr); if(!bWord){shape.spPr.xfrm.setOffX(xMin);shape.spPr.xfrm.setOffY(yMin)}else{shape.setWordShape(true);shape.spPr.xfrm.setOffX(0);shape.spPr.xfrm.setOffY(0)}shape.spPr.xfrm.setExtX(xMax-xMin);shape.spPr.xfrm.setExtY(yMax-yMin);shape.setStyle(AscFormat.CreateDefaultShapeStyle());var geometry=new AscFormat.Geometry;var w=xMax-xMin,h=yMax-yMin;var kw,kh,pathW,pathH;if(w>0){pathW=43200;kw=43200/w}else{pathW=0;kw=0}if(h>0){pathH=43200;kh=43200/h}else{pathH=0;kh=0}geometry.AddPathCommand(0,undefined,bClosed? "norm":"none",undefined,pathW,pathH);geometry.AddRect("l","t","r","b");geometry.AddPathCommand(1,((this.arrPoint[0].x-xMin)*kw>>0)+"",((this.arrPoint[0].y-yMin)*kh>>0)+"");for(i=1;i<_n;++i)geometry.AddPathCommand(2,((this.arrPoint[i].x-xMin)*kw>>0)+"",((this.arrPoint[i].y-yMin)*kh>>0)+"");if(bClosed)geometry.AddPathCommand(6);shape.spPr.setGeometry(geometry);shape.setBDeleted(false);shape.recalculate();shape.x=xMin;shape.y=yMin;return shape}}function PolylineForDrawer(polyline){this.polyline=polyline; this.pen=polyline.pen;this.brush=polyline.brush;this.TransformMatrix=polyline.TransformMatrix;this.Matrix=polyline.Matrix;this.Draw=function(graphics){graphics.SetIntegerGrid(false);graphics.transform3(this.Matrix);var shape_drawer=new AscCommon.CShapeDrawer;shape_drawer.fromShape(this,graphics);shape_drawer.draw(this)};this.draw=function(g){g._e();if(this.polyline.arrPoint.length<2)return;g._m(this.polyline.arrPoint[0].x,this.polyline.arrPoint[0].y);for(var i=1;i<this.polyline.arrPoint.length;++i)g._l(this.polyline.arrPoint[i].x, this.polyline.arrPoint[i].y);g.ds()}}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].PolyLine=PolyLine})(window);"use strict";(function(window,undefined){var global_MatrixTransformer=AscCommon.global_MatrixTransformer;var TRANSLATE_HANDLE_NO_FLIP=[];TRANSLATE_HANDLE_NO_FLIP[0]=0;TRANSLATE_HANDLE_NO_FLIP[1]=1;TRANSLATE_HANDLE_NO_FLIP[2]=2;TRANSLATE_HANDLE_NO_FLIP[3]=3;TRANSLATE_HANDLE_NO_FLIP[4]=4;TRANSLATE_HANDLE_NO_FLIP[5]=5;TRANSLATE_HANDLE_NO_FLIP[6]=6;TRANSLATE_HANDLE_NO_FLIP[7]= 7;var TRANSLATE_HANDLE_FLIP_H=[];TRANSLATE_HANDLE_FLIP_H[0]=2;TRANSLATE_HANDLE_FLIP_H[1]=1;TRANSLATE_HANDLE_FLIP_H[2]=0;TRANSLATE_HANDLE_FLIP_H[3]=7;TRANSLATE_HANDLE_FLIP_H[4]=6;TRANSLATE_HANDLE_FLIP_H[5]=5;TRANSLATE_HANDLE_FLIP_H[6]=4;TRANSLATE_HANDLE_FLIP_H[7]=3;var TRANSLATE_HANDLE_FLIP_V=[];TRANSLATE_HANDLE_FLIP_V[0]=6;TRANSLATE_HANDLE_FLIP_V[1]=5;TRANSLATE_HANDLE_FLIP_V[2]=4;TRANSLATE_HANDLE_FLIP_V[3]=3;TRANSLATE_HANDLE_FLIP_V[4]=2;TRANSLATE_HANDLE_FLIP_V[5]=1;TRANSLATE_HANDLE_FLIP_V[6]=0;TRANSLATE_HANDLE_FLIP_V[7]= 7;var TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V=[];TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[0]=4;TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[1]=5;TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[2]=6;TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[3]=7;TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[4]=0;TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[5]=1;TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[6]=2;TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[7]=3;var SHAPE_EXT={};SHAPE_EXT["can"]=3616635/36E3;SHAPE_EXT["moon"]=457200/36E3;SHAPE_EXT["leftBracket"]=73152/36E3;SHAPE_EXT["rightBracket"]= 73152/36E3;SHAPE_EXT["leftBrace"]=155448/36E3;SHAPE_EXT["rightBrace"]=155448/36E3;SHAPE_EXT["triangle"]=1060704/36E3;SHAPE_EXT["parallelogram"]=1216152/36E3;SHAPE_EXT["trapezoid"]=914400/36E3;SHAPE_EXT["pentagon"]=960120/36E3;SHAPE_EXT["hexagon"]=1060704/36E3;SHAPE_EXT["bracePair"]=1069848/36E3;SHAPE_EXT["rightArrow"]=978408/36E3;SHAPE_EXT["leftArrow"]=978408/36E3;SHAPE_EXT["upArrow"]=484632/36E3;SHAPE_EXT["downArrow"]=484632/36E3;SHAPE_EXT["leftRightArrow"]=1216152/36E3;SHAPE_EXT["upDownArrow"]= 484632/36E3;SHAPE_EXT["bentArrow"]=813816/36E3;SHAPE_EXT["uturnArrow"]=886968/36E3;SHAPE_EXT["bentUpArrow"]=850392/36E3;SHAPE_EXT["curvedRightArrow"]=731520/36E3;SHAPE_EXT["curvedLeftArrow"]=731520/36E3;SHAPE_EXT["curvedUpArrow"]=1216152/36E3;SHAPE_EXT["curvedDownArrow"]=1216152/36E3;SHAPE_EXT["stripedRightArrow"]=978408/36E3;SHAPE_EXT["notchedRightArrow"]=978408/36E3;SHAPE_EXT["homePlate"]=978408/36E3;SHAPE_EXT["leftRightArrowCallout"]=1216152/36E3;SHAPE_EXT["flowChartProcess"]=914400/36E3;SHAPE_EXT["flowChartAlternateProcess"]= 914400/36E3;SHAPE_EXT["flowChartDecision"]=914400/36E3;SHAPE_EXT["flowChartInputOutput"]=914400/36E3;SHAPE_EXT["flowChartPredefinedProcess"]=914400/36E3;SHAPE_EXT["flowChartDocument"]=914400/36E3;SHAPE_EXT["flowChartMultidocument"]=1060704/36E3;SHAPE_EXT["flowChartTerminator"]=914400/36E3;SHAPE_EXT["flowChartPreparation"]=1060704/36E3;SHAPE_EXT["flowChartManualInput"]=914400/36E3;SHAPE_EXT["flowChartManualOperation"]=914400/36E3;SHAPE_EXT["flowChartPunchedCard"]=914400/36E3;SHAPE_EXT["flowChartPunchedTape"]= 914400/36E3;SHAPE_EXT["flowChartPunchedTape"]=457200/36E3;SHAPE_EXT["flowChartSort"]=457200/36E3;SHAPE_EXT["flowChartOnlineStorage"]=914400/36E3;SHAPE_EXT["flowChartMagneticDisk"]=914400/36E3;SHAPE_EXT["flowChartMagneticDrum"]=914400/36E3;SHAPE_EXT["flowChartDisplay"]=914400/36E3;SHAPE_EXT["ribbon2"]=1216152/36E3;SHAPE_EXT["ribbon"]=1216152/36E3;SHAPE_EXT["ellipseRibbon2"]=1216152/36E3;SHAPE_EXT["ellipseRibbon"]=1216152/36E3;SHAPE_EXT["verticalScroll"]=1033272/36E3;SHAPE_EXT["horizontalScroll"]=1143E3/ 36E3;SHAPE_EXT["wedgeRectCallout"]=914400/36E3;SHAPE_EXT["wedgeRoundRectCallout"]=914400/36E3;SHAPE_EXT["wedgeEllipseCallout"]=914400/36E3;SHAPE_EXT["cloudCallout"]=914400/36E3;SHAPE_EXT["borderCallout1"]=914400/36E3;SHAPE_EXT["borderCallout2"]=914400/36E3;SHAPE_EXT["borderCallout3"]=914400/36E3;SHAPE_EXT["accentCallout1"]=914400/36E3;SHAPE_EXT["accentCallout2"]=914400/36E3;SHAPE_EXT["accentCallout3"]=914400/36E3;SHAPE_EXT["callout1"]=914400/36E3;SHAPE_EXT["callout2"]=914400/36E3;SHAPE_EXT["callout3"]= 914400/36E3;SHAPE_EXT["accentBorderCallout1"]=914400/36E3;SHAPE_EXT["accentBorderCallout2"]=914400/36E3;SHAPE_EXT["accentBorderCallout3"]=914400/36E3;SHAPE_EXT["cube"]=1216152/36E3;SHAPE_EXT["bevel"]=1042416/36E3;SHAPE_EXT["quadArrow"]=1216152/36E3;SHAPE_EXT["leftUpArrow"]=850392/36E3;SHAPE_EXT["chevron"]=484632/36E3;SHAPE_EXT["quadArrowCallout"]=1216152/36E3;SHAPE_EXT["circularArrow"]=978408/36E3;SHAPE_EXT["flowChartInternalStorage"]=612648/36E3;SHAPE_EXT["flowChartConnector"]=457200/36E3;SHAPE_EXT["flowChartOffpageConnector"]= 612648/36E3;SHAPE_EXT["flowChartSummingJunction"]=612648/36E3;SHAPE_EXT["flowChartOr"]=612648/36E3;SHAPE_EXT["flowChartExtract"]=685800/36E3;SHAPE_EXT["flowChartMerge"]=685800/36E3;SHAPE_EXT["flowChartDelay"]=612648/36E3;SHAPE_EXT["flowChartMagneticTape"]=612648/36E3;SHAPE_EXT["actionButtonHome"]=1042416/36E3;var MIN_SHAPE_SIZE=1.27;function CreatePenBrushForChartTrack(){return AscFormat.ExecuteNoHistory(function(){var brush=new AscFormat.CUniFill;brush.setFill(new AscFormat.CSolidFill);brush.fill.setColor(new AscFormat.CUniColor); brush.fill.color.RGBA={R:255,G:255,B:255,A:255};brush.fill.color.setColor(new AscFormat.CRGBColor);brush.fill.color.color.RGBA={R:255,G:255,B:255,A:255};var pen=new AscFormat.CLn;pen.setFill(new AscFormat.CUniFill);pen.Fill.setFill(new AscFormat.CSolidFill);pen.Fill.fill.setColor(new AscFormat.CUniColor);pen.Fill.fill.color.setColor(new AscFormat.CRGBColor);return{brush:brush,pen:pen}},this,[])}function ResizeTrackShapeImage(originalObject,cardDirection,drawingsController){AscFormat.ExecuteNoHistory(function(){this.bLastCenter= false;this.bIsTracked=false;this.originalObject=originalObject;this.numberHandle=originalObject.getNumByCardDirection(cardDirection);this.lastSpPr=null;this.startShape=null;this.endShape=null;this.beginShapeId=null;this.beginShapeIdx=null;this.endShapeId=null;this.endShapeIdx=null;if(drawingsController&&drawingsController.selectedObjects.length===1)if(originalObject.getObjectType()===AscDFH.historyitem_type_Cnx){this.drawingsController=drawingsController;var stId=originalObject.nvSpPr.nvUniSpPr.stCnxId; var endId=originalObject.nvSpPr.nvUniSpPr.endCnxId;this.startShape=AscCommon.g_oTableId.Get_ById(stId);this.endShape=AscCommon.g_oTableId.Get_ById(endId);this.bConnector=true}this.pageIndex=null;var numberHandle=this.numberHandle;this.flipH=originalObject.flipH;this.flipV=originalObject.flipV;var _flip_h=originalObject.flipH;var _flip_v=originalObject.flipV;var _half_height=originalObject.extY*.5;var _half_width=originalObject.extX*.5;var _sin=Math.sin(originalObject.rot);var _cos=Math.cos(originalObject.rot); var _translated_num_handle;if(!_flip_h&&!_flip_v)_translated_num_handle=numberHandle;else if(_flip_h&&!_flip_v)_translated_num_handle=TRANSLATE_HANDLE_FLIP_H[numberHandle];else if(!_flip_h&&_flip_v)_translated_num_handle=TRANSLATE_HANDLE_FLIP_V[numberHandle];else _translated_num_handle=TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[numberHandle];this.bAspect=numberHandle%2===0;this.aspect=this.bAspect===true?this.originalObject.getAspect(_translated_num_handle):0;this.sin=_sin;this.cos=_cos;this.translatetNumberHandle= _translated_num_handle;switch(_translated_num_handle){case 0:case 1:{this.fixedPointX=_half_width*_cos-_half_height*_sin+_half_width+originalObject.x;this.fixedPointY=_half_width*_sin+_half_height*_cos+_half_height+originalObject.y;break}case 2:case 3:{this.fixedPointX=-_half_width*_cos-_half_height*_sin+_half_width+originalObject.x;this.fixedPointY=-_half_width*_sin+_half_height*_cos+_half_height+originalObject.y;break}case 4:case 5:{this.fixedPointX=-_half_width*_cos+_half_height*_sin+_half_width+ originalObject.x;this.fixedPointY=-_half_width*_sin-_half_height*_cos+_half_height+originalObject.y;break}case 6:case 7:{this.fixedPointX=_half_width*_cos+_half_height*_sin+_half_width+originalObject.x;this.fixedPointY=_half_width*_sin-_half_height*_cos+_half_height+originalObject.y;break}}this.mod=this.translatetNumberHandle%4;this.centerPointX=originalObject.x+_half_width;this.centerPointY=originalObject.y+_half_height;this.originalExtX=originalObject.extX;this.originalExtY=originalObject.extY; this.originalFlipH=_flip_h;this.originalFlipV=_flip_v;this.usedExtX=this.originalExtX===0?.01:this.originalExtX;this.usedExtY=this.originalExtY===0?.01:this.originalExtY;this.resizedExtX=this.originalExtX;this.resizedExtY=this.originalExtY;this.resizedflipH=_flip_h;this.resizedflipV=_flip_v;this.resizedPosX=originalObject.x;this.resizedPosY=originalObject.y;this.resizedRot=originalObject.rot;this.transform=originalObject.transform.CreateDublicate();this.geometry=AscFormat.ExecuteNoHistory(function(){return originalObject.getGeom().createDuplicate()}, this,[]);this.cropObject=originalObject.cropObject;var nObjectType=originalObject.getObjectType&&originalObject.getObjectType();if(nObjectType===AscDFH.historyitem_type_Chart||nObjectType===AscDFH.historyitem_type_GraphicFrame||nObjectType===AscDFH.historyitem_type_SlicerView){var pen_brush=CreatePenBrushForChartTrack();this.brush=pen_brush.brush;this.pen=pen_brush.pen}else{if(originalObject.blipFill){this.brush=new AscFormat.CUniFill;this.brush.fill=originalObject.blipFill}else this.brush=originalObject.brush; this.pen=originalObject.pen}this.isLine=originalObject.spPr&&originalObject.spPr.geometry&&originalObject.spPr.geometry.preset==="line";this.bChangeCoef=this.translatetNumberHandle%2===0&&this.originalFlipH!==this.originalFlipV;if(this.originalObject.cropObject){if(this.brush)this.brush=this.brush.createDuplicate();this.pen=AscFormat.CreatePenBrushForChartTrack().pen}this.overlayObject=new AscFormat.OverlayObject(this.geometry,this.resizedExtX,this.resizedExtY,this.brush,this.pen,this.transform); this.resizeConnector=function(kd1,kd2,e,x,y){var oConnectorInfo=this.originalObject.nvSpPr.nvUniSpPr;var oBeginShape=AscCommon.g_oTableId.Get_ById(oConnectorInfo.stCnxId);if(oBeginShape&&oBeginShape.bDeleted)oBeginShape=null;var oEndShape=AscCommon.g_oTableId.Get_ById(oConnectorInfo.endCnxId);if(oEndShape&&oEndShape.bDeleted)oEndShape=null;var aDrawings=[];this.drawingsController.getAllSingularDrawings(this.drawingsController.getDrawingArray(),aDrawings);var oConnectionInfo=null;var oNewShape=null; this.oNewShape=null;this.beginShapeId=null;this.beginShapeIdx=null;this.endShapeId=null;this.endShapeIdx=null;for(var i=aDrawings.length-1;i>-1;--i){if(aDrawings[i]===this.originalObject)continue;oConnectionInfo=aDrawings[i].findConnector(x,y);if(oConnectionInfo){oNewShape=aDrawings[i];this.oNewShape=oNewShape;break}}if(!this.oNewShape)for(var i=aDrawings.length-1;i>-1;--i){if(aDrawings[i]===this.originalObject)continue;var oCs=aDrawings[i].findConnectionShape(x,y);if(oCs){this.oNewShape=oCs;break}}var _beginConnectionInfo, _endConnectionInfo;if(this.numberHandle===0){if(oEndShape){var oConectionObject=oEndShape.getGeom().cnxLst[oConnectorInfo.endCnxIdx];var g_conn_info={idx:oConnectorInfo.endCnxIdx,ang:oConectionObject.ang,x:oConectionObject.x,y:oConectionObject.y};var _flipH=oEndShape.flipH;var _flipV=oEndShape.flipV;var _rot=oEndShape.rot;if(oEndShape.group){_rot=AscFormat.normalizeRotate(oEndShape.group.getFullRotate()+_rot);if(oEndShape.group.getFullFlipH())_flipH=!_flipH;if(oEndShape.group.getFullFlipV())_flipV= !_flipV}_endConnectionInfo=oEndShape.convertToConnectionParams(_rot,_flipH,_flipV,oEndShape.transform,oEndShape.bounds,g_conn_info)}_beginConnectionInfo=oConnectionInfo;if(_beginConnectionInfo){this.beginShapeId=this.oNewShape.Id;this.beginShapeIdx=_beginConnectionInfo.idx}}else{if(oBeginShape){var oConectionObject=oBeginShape.getGeom().cnxLst[oConnectorInfo.stCnxIdx];var g_conn_info={idx:oConnectorInfo.stCnxIdx,ang:oConectionObject.ang,x:oConectionObject.x,y:oConectionObject.y};var _flipH=oBeginShape.flipH; var _flipV=oBeginShape.flipV;var _rot=oBeginShape.rot;if(oBeginShape.group){_rot=AscFormat.normalizeRotate(oBeginShape.group.getFullRotate()+_rot);if(oBeginShape.group.getFullFlipH())_flipH=!_flipH;if(oBeginShape.group.getFullFlipV())_flipV=!_flipV}_beginConnectionInfo=oBeginShape.convertToConnectionParams(_rot,_flipH,_flipV,oBeginShape.transform,oBeginShape.bounds,g_conn_info)}_endConnectionInfo=oConnectionInfo;if(_endConnectionInfo){this.endShapeId=this.oNewShape.Id;this.endShapeIdx=_endConnectionInfo.idx}}var _x, _y;if(_beginConnectionInfo||_endConnectionInfo){if(!_beginConnectionInfo)if(this.numberHandle===0)_beginConnectionInfo=AscFormat.fCalculateConnectionInfo(_endConnectionInfo,x,y);else{_x=this.originalObject.transform.TransformPointX(0,0);_y=this.originalObject.transform.TransformPointY(0,0);_beginConnectionInfo=AscFormat.fCalculateConnectionInfo(_endConnectionInfo,_x,_y)}if(!_endConnectionInfo)if(this.numberHandle===0){_x=this.originalObject.transform.TransformPointX(this.originalObject.extX,this.originalObject.extY); _y=this.originalObject.transform.TransformPointY(this.originalObject.extX,this.originalObject.extY);_endConnectionInfo=AscFormat.fCalculateConnectionInfo(_beginConnectionInfo,_x,_y)}else _endConnectionInfo=AscFormat.fCalculateConnectionInfo(_beginConnectionInfo,x,y)}if(_beginConnectionInfo&&_endConnectionInfo){this.oSpPr=AscFormat.fCalculateSpPr(_beginConnectionInfo,_endConnectionInfo,this.originalObject.spPr.geometry.preset,this.overlayObject.pen.w);if(this.originalObject.group){var _xc=this.oSpPr.xfrm.offX+ this.oSpPr.xfrm.extX/2;var _yc=this.oSpPr.xfrm.offY+this.oSpPr.xfrm.extY/2;var xc=this.originalObject.group.invertTransform.TransformPointX(_xc,_yc);var yc=this.originalObject.group.invertTransform.TransformPointY(_xc,_yc);this.oSpPr.xfrm.setOffX(xc-this.oSpPr.xfrm.extX/2);this.oSpPr.xfrm.setOffY(yc-this.oSpPr.xfrm.extY/2);this.oSpPr.xfrm.setFlipH(this.originalObject.group.getFullFlipH()?!this.oSpPr.xfrm.flipH:this.oSpPr.xfrm.flipH);this.oSpPr.xfrm.setFlipV(this.originalObject.group.getFullFlipV()? !this.oSpPr.xfrm.flipV:this.oSpPr.xfrm.flipV);this.oSpPr.xfrm.setRot(AscFormat.normalizeRotate(this.oSpPr.xfrm.rot-this.originalObject.group.getFullRotate()))}var _xfrm=this.oSpPr.xfrm;this.resizedExtX=_xfrm.extX;this.resizedExtY=_xfrm.extY;this.resizedflipH=_xfrm.flipH;this.resizedflipV=_xfrm.flipV;this.resizedPosX=_xfrm.offX;this.resizedPosY=_xfrm.offY;this.resizedRot=_xfrm.rot;this.recalculateTransform();this.geometry=this.oSpPr.geometry;this.overlayObject.geometry=this.geometry;this.geometry.Recalculate(this.oSpPr.xfrm.extX, this.oSpPr.xfrm.extY)}else{this.oSpPr=null;this.resizedRot=this.originalObject.rot;this.geometry=AscFormat.ExecuteNoHistory(function(){return originalObject.spPr.geometry.createDuplicate()},this,[]);this.overlayObject.geometry=this.geometry;this.resize(kd1,kd2,e.ShiftKey)}};this.track=function(kd1,kd2,e,x,y){AscFormat.ExecuteNoHistory(function(){this.bIsTracked=true;if(this.bConnector)this.resizeConnector(kd1,kd2,e,x,y);else if(!e.CtrlKey)this.resize(kd1,kd2,e.ShiftKey);else this.resizeRelativeCenter(kd1, kd2,e.ShiftKey)},this,[])};this.resize=function(kd1,kd2,ShiftKey){this.bLastCenter=false;var _cos=this.cos;var _sin=this.sin;var _real_height,_real_width;var _abs_height,_abs_width;var _new_resize_half_width;var _new_resize_half_height;var _new_used_half_width;var _new_used_half_height;var _temp;if(this.originalObject.getObjectType&&this.originalObject.getObjectType()===AscDFH.historyitem_type_GraphicFrame){if(kd1<0)kd1=0;if(kd2<0)kd2=0}var isCrop=this.originalObject.isCrop||!!this.originalObject.cropObject; if((ShiftKey===true||window.AscAlwaysSaveAspectOnResizeTrack===true&&!this.isLine||!isCrop&&this.originalObject.getNoChangeAspect())&&this.bAspect===true){var _new_aspect=this.aspect*Math.abs(kd1/kd2);if(_new_aspect>=this.aspect)kd2=Math.abs(kd1)*(kd2>=0?1:-1);else kd1=Math.abs(kd2)*(kd1>=0?1:-1)}if(this.bChangeCoef){_temp=kd1;kd1=kd2;kd2=_temp}switch(this.translatetNumberHandle){case 0:case 1:{if(this.translatetNumberHandle===0){_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);if(!this.isLine)this.resizedExtX= _abs_width>=MIN_SHAPE_SIZE?_abs_width:MIN_SHAPE_SIZE;else this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE?_abs_width:0;if(_real_width<0)this.resizedflipH=!this.originalFlipH;else this.resizedflipH=this.originalFlipH}if(this.translatetNumberHandle===1){_temp=kd1;kd1=kd2;kd2=_temp}_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);if(!this.isLine)this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE?_abs_height:MIN_SHAPE_SIZE;else this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE?_abs_height:0;this.resizedExtY= _abs_height>=MIN_SHAPE_SIZE||this.isLine?_abs_height:MIN_SHAPE_SIZE;if(_real_height<0){this.resizedflipV=!this.originalFlipV;if(this.isLine&&ShiftKey)this.resizedflipH=!this.originalFlipH}else{this.resizedflipV=this.originalFlipV;if(this.isLine&&ShiftKey&&this.resizedflipH!==this.originalFlipH)this.resizedflipV=!this.originalFlipV}_new_resize_half_width=this.resizedExtX*.5;_new_resize_half_height=this.resizedExtY*.5;if(this.resizedflipH!==this.originalFlipH)_new_used_half_width=-_new_resize_half_width; else _new_used_half_width=_new_resize_half_width;if(this.resizedflipV!==this.originalFlipV)_new_used_half_height=-_new_resize_half_height;else _new_used_half_height=_new_resize_half_height;this.resizedPosX=this.fixedPointX+(-_new_used_half_width*_cos+_new_used_half_height*_sin)-_new_resize_half_width;this.resizedPosY=this.fixedPointY+(-_new_used_half_width*_sin-_new_used_half_height*_cos)-_new_resize_half_height;break}case 2:case 3:{if(this.translatetNumberHandle===2){_temp=kd2;kd2=kd1;kd1=_temp; _real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE?_abs_height:this.isLine?0:MIN_SHAPE_SIZE;if(_real_height<0)this.resizedflipV=!this.originalFlipV;else this.resizedflipV=this.originalFlipV}_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE?_abs_width:this.isLine?0:MIN_SHAPE_SIZE;if(_real_width<0){this.resizedflipH=!this.originalFlipH;if(this.isLine&&ShiftKey)this.resizedflipV=!this.originalFlipV}else{this.resizedflipH= this.originalFlipH;if(this.isLine&&ShiftKey&&this.resizedflipV!==this.originalFlipV)this.resizedflipH=!this.originalFlipH}_new_resize_half_width=this.resizedExtX*.5;_new_resize_half_height=this.resizedExtY*.5;if(this.resizedflipH!==this.originalFlipH)_new_used_half_width=-_new_resize_half_width;else _new_used_half_width=_new_resize_half_width;if(this.resizedflipV!==this.originalFlipV)_new_used_half_height=-_new_resize_half_height;else _new_used_half_height=_new_resize_half_height;this.resizedPosX= this.fixedPointX+(_new_used_half_width*_cos+_new_used_half_height*_sin)-_new_resize_half_width;this.resizedPosY=this.fixedPointY+(_new_used_half_width*_sin-_new_used_half_height*_cos)-_new_resize_half_height;break}case 4:case 5:{if(this.translatetNumberHandle===4){_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE?_abs_width:this.isLine?0:MIN_SHAPE_SIZE;if(_real_width<0)this.resizedflipH=!this.originalFlipH;else this.resizedflipH=this.originalFlipH}else{_temp= kd2;kd2=kd1;kd1=_temp}_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE?_abs_height:this.isLine?0:MIN_SHAPE_SIZE;if(_real_height<0){this.resizedflipV=!this.originalFlipV;if(this.isLine&&ShiftKey)this.resizedflipH=!this.originalFlipH}else{this.resizedflipV=this.originalFlipV;if(this.isLine&&ShiftKey&&this.resizedflipH!==this.originalFlipH)this.resizedflipV=!this.originalFlipV}_new_resize_half_width=this.resizedExtX*.5;_new_resize_half_height= this.resizedExtY*.5;if(this.resizedflipH!==this.originalFlipH)_new_used_half_width=-_new_resize_half_width;else _new_used_half_width=_new_resize_half_width;if(this.resizedflipV!==this.originalFlipV)_new_used_half_height=-_new_resize_half_height;else _new_used_half_height=_new_resize_half_height;this.resizedPosX=this.fixedPointX+(_new_used_half_width*_cos-_new_used_half_height*_sin)-_new_resize_half_width;this.resizedPosY=this.fixedPointY+(_new_used_half_width*_sin+_new_used_half_height*_cos)-_new_resize_half_height; break}case 6:case 7:{if(this.translatetNumberHandle===6){_real_height=this.usedExtY*kd1;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE?_abs_height:this.isLine?0:MIN_SHAPE_SIZE;if(_real_height<0)this.resizedflipV=!this.originalFlipV;else this.resizedflipV=this.originalFlipV}else{_temp=kd2;kd2=kd1;kd1=_temp}_real_width=this.usedExtX*kd2;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE?_abs_width:this.isLine?0:MIN_SHAPE_SIZE;if(_real_width< 0){this.resizedflipH=!this.originalFlipH;if(this.isLine&&ShiftKey)this.resizedflipV=!this.originalFlipV}else{this.resizedflipH=this.originalFlipH;if(this.isLine&&ShiftKey&&this.resizedflipV!==this.originalFlipV)this.resizedflipH=!this.originalFlipH}_new_resize_half_width=this.resizedExtX*.5;_new_resize_half_height=this.resizedExtY*.5;if(this.resizedflipH!==this.originalFlipH)_new_used_half_width=-_new_resize_half_width;else _new_used_half_width=_new_resize_half_width;if(this.resizedflipV!==this.originalFlipV)_new_used_half_height= -_new_resize_half_height;else _new_used_half_height=_new_resize_half_height;this.resizedPosX=this.fixedPointX+(-_new_used_half_width*_cos-_new_used_half_height*_sin)-_new_resize_half_width;this.resizedPosY=this.fixedPointY+(-_new_used_half_width*_sin+_new_used_half_height*_cos)-_new_resize_half_height;break}}if(isCrop){this.resizedflipH=this.originalFlipH;this.resizedflipV=this.originalFlipV}if(this.originalObject.signatureLine||this.originalObject.getObjectType&&this.originalObject.getObjectType()=== AscDFH.historyitem_type_OleObject){this.resizedflipH=false;this.resizedflipV=false}this.geometry.Recalculate(this.resizedExtX,this.resizedExtY);this.overlayObject.updateExtents(this.resizedExtX,this.resizedExtY);this.recalculateTransform();if(this.bConnector)if(this.numberHandle===0){this.beginShapeIdx=null;this.beginShapeId=null}else{this.endShapeIdx=null;this.endShapeId=null}};this.resizeRelativeCenter=function(kd1,kd2,ShiftKey){if(this.isLine){this.resize(kd1,kd2,ShiftKey);return}this.bLastCenter= true;kd1=2*kd1-1;kd2=2*kd2-1;if(this.originalObject.getObjectType&&this.originalObject.getObjectType()===AscDFH.historyitem_type_GraphicFrame){if(kd1<0)kd1=0;if(kd2<0)kd2=0}var _real_height,_real_width;var _abs_height,_abs_width;var isCrop=this.originalObject.isCrop||!!this.originalObject.cropObject;if((ShiftKey===true||window.AscAlwaysSaveAspectOnResizeTrack===true||!isCrop&&this.originalObject.getNoChangeAspect())&&this.bAspect===true){var _new_aspect=this.aspect*Math.abs(kd1/kd2);if(_new_aspect>= this.aspect)kd2=Math.abs(kd1)*(kd2>=0?1:-1);else kd1=Math.abs(kd2)*(kd1>=0?1:-1)}var _temp;if(this.bChangeCoef){_temp=kd1;kd1=kd2;kd2=_temp}if(this.mod===0||this.mod===1){if(this.mod===0){_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE||this.isLine?_abs_width:MIN_SHAPE_SIZE;this.resizedflipH=_real_width<0?!this.originalFlipH:this.originalFlipH}else{_temp=kd1;kd1=kd2;kd2=_temp}_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height); this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE||this.isLine?_abs_height:MIN_SHAPE_SIZE;this.resizedflipV=_real_height<0?!this.originalFlipV:this.originalFlipV}else{if(this.mod===2){_temp=kd1;kd1=kd2;kd2=_temp;_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE||this.isLine?_abs_height:MIN_SHAPE_SIZE;this.resizedflipV=_real_height<0?!this.originalFlipV:this.originalFlipV}_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);this.resizedExtX= _abs_width>=MIN_SHAPE_SIZE||this.isLine?_abs_width:MIN_SHAPE_SIZE;this.resizedflipH=_real_width<0?!this.originalFlipH:this.originalFlipH}if(isCrop){this.resizedflipH=this.originalFlipH;this.resizedflipV=this.originalFlipV}this.resizedPosX=this.centerPointX-this.resizedExtX*.5;this.resizedPosY=this.centerPointY-this.resizedExtY*.5;this.geometry.Recalculate(this.resizedExtX,this.resizedExtY);this.overlayObject.updateExtents(this.resizedExtX,this.resizedExtY);this.recalculateTransform()};this.recalculateTransform= function(){var _transform=this.transform;_transform.Reset();var _horizontal_center=this.resizedExtX*.5;var _vertical_center=this.resizedExtY*.5;global_MatrixTransformer.TranslateAppend(_transform,-_horizontal_center,-_vertical_center);if(this.resizedflipH)global_MatrixTransformer.ScaleAppend(_transform,-1,1);if(this.resizedflipV)global_MatrixTransformer.ScaleAppend(_transform,1,-1);global_MatrixTransformer.RotateRadAppend(_transform,-this.resizedRot);global_MatrixTransformer.TranslateAppend(_transform, this.resizedPosX,this.resizedPosY);global_MatrixTransformer.TranslateAppend(_transform,_horizontal_center,_vertical_center);if(this.originalObject.group)global_MatrixTransformer.MultiplyAppend(_transform,this.originalObject.group.transform);if(this.originalObject.parent){var parent_transform=this.originalObject.parent.Get_ParentTextTransform&&this.originalObject.parent.Get_ParentTextTransform();if(parent_transform)global_MatrixTransformer.MultiplyAppend(_transform,parent_transform)}if(this.chartSpace)global_MatrixTransformer.MultiplyAppend(_transform, this.chartSpace.transform);if(this.originalObject.cropObject){var oShapeDrawer=new AscCommon.CShapeDrawer;oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;this.overlayObject.check_bounds(oShapeDrawer);this.brush.fill.srcRect=AscFormat.CalculateSrcRect(_transform,oShapeDrawer,this.originalObject.cropObject.invertTransform,this.originalObject.cropObject.extX,this.originalObject.cropObject.extY)}};this.draw=function(overlay,transform){if(AscFormat.isRealNumber(this.originalObject.selectStartPage)&& overlay.SetCurrentPage)overlay.SetCurrentPage(this.originalObject.selectStartPage);if(this.originalObject.isCrop){var dOldAlpha=null;var oGraphics=overlay.Graphics?overlay.Graphics:overlay;if(AscFormat.isRealNumber(oGraphics.globalAlpha)&&oGraphics.put_GlobalAlpha){dOldAlpha=oGraphics.globalAlpha;oGraphics.put_GlobalAlpha(false,1)}this.overlayObject.draw(overlay);var oldFill=this.brush.fill;this.brush.fill=this.originalObject.cropBrush.fill;this.overlayObject.shapeDrawer.Clear();this.overlayObject.draw(overlay); this.brush.fill=oldFill;var oldSrcRect,oldPen;var parentCrop=this.originalObject.parentCrop;var oShapeDrawer=new AscCommon.CShapeDrawer;oShapeDrawer.bIsCheckBounds=true;oShapeDrawer.Graphics=new AscFormat.CSlideBoundsChecker;parentCrop.check_bounds(oShapeDrawer);var srcRect=AscFormat.CalculateSrcRect(parentCrop.transform,oShapeDrawer,global_MatrixTransformer.Invert(this.transform),this.resizedExtX,this.resizedExtY);oldPen=this.originalObject.parentCrop.pen;this.originalObject.parentCrop.pen=AscFormat.CreatePenBrushForChartTrack().pen; if(this.originalObject.parentCrop.blipFill){oldSrcRect=this.originalObject.parentCrop.blipFill.srcRect;this.originalObject.parentCrop.blipFill.srcRect=srcRect;this.originalObject.parentCrop.draw(overlay);this.originalObject.parentCrop.blipFill.srcRect=oldSrcRect}else{oldSrcRect=this.originalObject.parentCrop.brush.fill.srcRect;this.originalObject.parentCrop.brush.fill.srcRect=srcRect;this.originalObject.parentCrop.draw(overlay);this.originalObject.parentCrop.brush.fill.srcRect=oldSrcRect}this.originalObject.parentCrop.pen= oldPen;if(AscFormat.isRealNumber(dOldAlpha)&&oGraphics.put_GlobalAlpha)oGraphics.put_GlobalAlpha(true,dOldAlpha);return}if(this.originalObject.cropObject){var dOldAlpha=null;var oGraphics=overlay.Graphics?overlay.Graphics:overlay;if(AscFormat.isRealNumber(oGraphics.globalAlpha)&&oGraphics.put_GlobalAlpha){dOldAlpha=oGraphics.globalAlpha;oGraphics.put_GlobalAlpha(false,1)}this.originalObject.cropObject.draw(overlay);this.overlayObject.pen=AscFormat.CreatePenBrushForChartTrack().pen;this.overlayObject.draw(overlay, transform);if(AscFormat.isRealNumber(dOldAlpha)&&oGraphics.put_GlobalAlpha)oGraphics.put_GlobalAlpha(true,dOldAlpha);return}if(this.oNewShape)this.oNewShape.drawConnectors(overlay);this.overlayObject.draw(overlay,transform)};this.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;var tr=null;if(this.originalObject&&this.originalObject.parent){var parent_transform=this.originalObject.parent.Get_ParentTextTransform&&this.originalObject.parent.Get_ParentTextTransform();if(parent_transform){tr= this.transform.CreateDublicate();global_MatrixTransformer.MultiplyAppend(tr,global_MatrixTransformer.Invert(parent_transform))}}this.draw(boundsChecker,tr?tr:null);tr=this.transform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0,0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.resizedExtX,0));arr_p_y.push(tr.TransformPointY(this.resizedExtX,0));arr_p_x.push(tr.TransformPointX(this.resizedExtX,this.resizedExtY));arr_p_y.push(tr.TransformPointY(this.resizedExtX, this.resizedExtY));arr_p_x.push(tr.TransformPointX(0,this.resizedExtY));arr_p_y.push(tr.TransformPointY(0,this.resizedExtY));arr_p_x.push(boundsChecker.Bounds.min_x);arr_p_x.push(boundsChecker.Bounds.max_x);arr_p_y.push(boundsChecker.Bounds.min_y);arr_p_y.push(boundsChecker.Bounds.max_y);boundsChecker.Bounds.min_x=Math.min.apply(Math,arr_p_x);boundsChecker.Bounds.max_x=Math.max.apply(Math,arr_p_x);boundsChecker.Bounds.min_y=Math.min.apply(Math,arr_p_y);boundsChecker.Bounds.max_y=Math.max.apply(Math, arr_p_y);boundsChecker.Bounds.posX=this.resizedPosX;boundsChecker.Bounds.posY=this.resizedPosY;boundsChecker.Bounds.extX=this.resizedExtX;boundsChecker.Bounds.extY=this.resizedExtY;return boundsChecker.Bounds};this.trackEnd=function(bWord){if(!this.bIsTracked)return;if(this.chartSpace){var oObjectToSet=this.originalObject;if(!oObjectToSet.layout)oObjectToSet.setLayout(new AscFormat.CLayout);var pos=this.chartSpace.chartObj.recalculatePositionText(this.originalObject);oObjectToSet.layout.setXMode(AscFormat.LAYOUT_MODE_EDGE); oObjectToSet.layout.setYMode(AscFormat.LAYOUT_MODE_EDGE);if(oObjectToSet instanceof AscFormat.CPlotArea)oObjectToSet.layout.setLayoutTarget(AscFormat.LAYOUT_TARGET_INNER);var fLayoutX=this.chartSpace.calculateLayoutByPos(pos.x,oObjectToSet.layout.xMode,this.resizedPosX,this.chartSpace.extX);var fLayoutY=this.chartSpace.calculateLayoutByPos(pos.y,oObjectToSet.layout.yMode,this.resizedPosY,this.chartSpace.extY);var fLayoutW=this.chartSpace.calculateLayoutBySize(this.resizedPosX,oObjectToSet.layout.wMode, this.chartSpace.extX,this.resizedExtX);var fLayoutH=this.chartSpace.calculateLayoutBySize(this.resizedPosY,oObjectToSet.layout.hMode,this.chartSpace.extY,this.resizedExtY);oObjectToSet.layout.setX(fLayoutX);oObjectToSet.layout.setY(fLayoutY);oObjectToSet.layout.setW(fLayoutW);oObjectToSet.layout.setH(fLayoutH);return}if(!this.bConnector||!this.oSpPr){var scale_coefficients,ch_off_x,ch_off_y;if(this.originalObject.group){scale_coefficients=this.originalObject.group.getResultScaleCoefficients();ch_off_x= this.originalObject.group.spPr.xfrm.chOffX;ch_off_y=this.originalObject.group.spPr.xfrm.chOffY}else{scale_coefficients={cx:1,cy:1};ch_off_x=0;ch_off_y=0;if(bWord){this.resizedPosX=0;this.resizedPosY=0}}if(!this.originalObject.isCrop)AscFormat.CheckSpPrXfrm(this.originalObject);else AscFormat.ExecuteNoHistory(function(){AscFormat.CheckSpPrXfrm(this.originalObject)},this,[]);var xfrm=this.originalObject.spPr.xfrm;if(this.originalObject.getObjectType()!==AscDFH.historyitem_type_GraphicFrame)if(!this.originalObject.isCrop){xfrm.setOffX(this.resizedPosX/ scale_coefficients.cx+ch_off_x);xfrm.setOffY(this.resizedPosY/scale_coefficients.cy+ch_off_y);xfrm.setExtX(this.resizedExtX/scale_coefficients.cx);xfrm.setExtY(this.resizedExtY/scale_coefficients.cy)}else AscFormat.ExecuteNoHistory(function(){xfrm.setOffX(this.resizedPosX/scale_coefficients.cx+ch_off_x);xfrm.setOffY(this.resizedPosY/scale_coefficients.cy+ch_off_y);xfrm.setExtX(this.resizedExtX/scale_coefficients.cx);xfrm.setExtY(this.resizedExtY/scale_coefficients.cy)},this,[]);else{var oldX=xfrm.offX; var oldY=xfrm.offY;var newX=this.resizedPosX/scale_coefficients.cx+ch_off_x;var newY=this.resizedPosY/scale_coefficients.cy+ch_off_y;this.originalObject.graphicObject.Resize(this.resizedExtX,this.resizedExtY);this.originalObject.recalculateTable();this.originalObject.recalculateSizes();if(!this.bLastCenter){if(!AscFormat.fApproxEqual(oldX,newX,.5))xfrm.setOffX(this.resizedPosX/scale_coefficients.cx+ch_off_x-this.originalObject.extX+this.resizedExtX);if(!AscFormat.fApproxEqual(oldY,newY,.5))xfrm.setOffY(this.resizedPosY/ scale_coefficients.cy+ch_off_y-this.originalObject.extY+this.resizedExtY)}else{xfrm.setOffX(this.resizedPosX+this.resizedExtX/2-this.originalObject.extX/2);xfrm.setOffY(this.resizedPosY+this.resizedExtY/2-this.originalObject.extY/2)}}if(this.originalObject.getObjectType()!==AscDFH.historyitem_type_ChartSpace&&this.originalObject.getObjectType()!==AscDFH.historyitem_type_GraphicFrame&&this.originalObject.getObjectType()!==AscDFH.historyitem_type_SlicerView)if(!this.originalObject.isCrop){xfrm.setFlipH(this.resizedflipH); xfrm.setFlipV(this.resizedflipV)}else AscFormat.ExecuteNoHistory(function(){xfrm.setFlipH(this.resizedflipH);xfrm.setFlipV(this.resizedflipV)},this,[]);if(this.originalObject.getObjectType&&this.originalObject.getObjectType()===AscDFH.historyitem_type_OleObject){var api=window.editor||window["Asc"]["editor"];if(api){var pluginData=new Asc.CPluginData;pluginData.setAttribute("data",this.originalObject.m_sData);pluginData.setAttribute("guid",this.originalObject.m_sApplicationId);pluginData.setAttribute("width", xfrm.extX);pluginData.setAttribute("height",xfrm.extY);pluginData.setAttribute("objectId",this.originalObject.Get_Id());api.asc_pluginResize(pluginData)}}if(this.bConnector){var nvUniSpPr=this.originalObject.nvSpPr.nvUniSpPr.copy();if(this.numberHandle===0){nvUniSpPr.stCnxIdx=this.beginShapeIdx;nvUniSpPr.stCnxId=this.beginShapeId;this.originalObject.nvSpPr.setUniSpPr(nvUniSpPr)}else{nvUniSpPr.endCnxIdx=this.endShapeIdx;nvUniSpPr.endCnxId=this.endShapeId;this.originalObject.nvSpPr.setUniSpPr(nvUniSpPr)}}if(this.originalObject.isCrop){AscFormat.ExecuteNoHistory(function(){this.originalObject.recalculateGeometry()}, this,[]);this.originalObject.transform=this.transform;this.originalObject.invertTransform=AscCommon.global_MatrixTransformer.Invert(this.transform);this.originalObject.extX=this.resizedExtX;this.originalObject.extY=this.resizedExtY;if(!this.originalObject.parentCrop.cropObject)this.originalObject.parentCrop.cropObject=this.originalObject;this.originalObject.parentCrop.calculateSrcRect()}if(this.cropObject&&!this.originalObject.cropObject)this.originalObject.cropObject=this.cropObject;if(this.originalObject.cropObject){this.originalObject.transform= this.transform;this.originalObject.invertTransform=AscCommon.global_MatrixTransformer.Invert(this.transform);this.originalObject.extX=this.resizedExtX;this.originalObject.extY=this.resizedExtY;this.originalObject.calculateSrcRect()}}else{var _xfrm=this.originalObject.spPr.xfrm;var _xfrm2=this.oSpPr.xfrm;_xfrm.setOffX(_xfrm2.offX);_xfrm.setOffY(_xfrm2.offY);_xfrm.setExtX(_xfrm2.extX);_xfrm.setExtY(_xfrm2.extY);_xfrm.setFlipH(_xfrm2.flipH);_xfrm.setFlipV(_xfrm2.flipV);_xfrm.setRot(_xfrm2.rot);this.originalObject.spPr.setGeometry(this.oSpPr.geometry.createDuplicate()); var nvUniSpPr=this.originalObject.nvSpPr.nvUniSpPr.copy();if(this.numberHandle===0){nvUniSpPr.stCnxIdx=this.beginShapeIdx;nvUniSpPr.stCnxId=this.beginShapeId;this.originalObject.nvSpPr.setUniSpPr(nvUniSpPr)}else{nvUniSpPr.endCnxIdx=this.endShapeIdx;nvUniSpPr.endCnxId=this.endShapeId;this.originalObject.nvSpPr.setUniSpPr(nvUniSpPr)}}if(!this.originalObject.isCrop){AscFormat.CheckShapeBodyAutoFitReset(this.originalObject);this.originalObject.checkDrawingBaseCoords();if(this.originalObject.checkExtentsByDocContent)this.originalObject.checkExtentsByDocContent(true, true)}else AscFormat.ExecuteNoHistory(function(){AscFormat.CheckShapeBodyAutoFitReset(this.originalObject);this.originalObject.checkDrawingBaseCoords()},this,[])}},this,[])}function ResizeTrackGroup(originalObject,cardDirection,parentTrack){AscFormat.ExecuteNoHistory(function(){this.bIsTracked=false;this.original=originalObject;this.originalObject=originalObject;this.parentTrack=parentTrack;var numberHandle;if(AscFormat.isRealNumber(cardDirection)){this.numberHandle=originalObject.getNumByCardDirection(cardDirection); numberHandle=this.numberHandle}this.x=originalObject.x;this.y=originalObject.y;this.extX=originalObject.extX;this.extY=originalObject.extY;this.rot=originalObject.rot;this.flipH=originalObject.flipH;this.flipV=originalObject.flipV;this.transform=originalObject.transform.CreateDublicate();this.bSwapCoef=!AscFormat.checkNormalRotate(this.rot);this.childs=[];var a=originalObject.spTree;for(var i=0;i<a.length;++i)if(a[i].isGroup())this.childs[i]=new ResizeTrackGroup(a[i],null,this);else this.childs[i]= new ShapeForResizeInGroup(a[i],this);if(typeof numberHandle==="number"){var _translated_num_handle;var _flip_h=this.flipH;var _flip_v=this.flipV;var _sin=Math.sin(this.rot);var _cos=Math.cos(this.rot);var _half_width=this.extX*.5;var _half_height=this.extY*.5;if(!_flip_h&&!_flip_v)_translated_num_handle=numberHandle;else if(_flip_h&&!_flip_v)_translated_num_handle=TRANSLATE_HANDLE_FLIP_H[numberHandle];else if(!_flip_h&&_flip_v)_translated_num_handle=TRANSLATE_HANDLE_FLIP_V[numberHandle];else _translated_num_handle= TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[numberHandle];this.bAspect=numberHandle%2===0;this.aspect=this.bAspect===true?this.original.getAspect(_translated_num_handle):0;this.sin=_sin;this.cos=_cos;this.translatetNumberHandle=_translated_num_handle;switch(_translated_num_handle){case 0:case 1:{this.fixedPointX=_half_width*_cos-_half_height*_sin+_half_width+this.x;this.fixedPointY=_half_width*_sin+_half_height*_cos+_half_height+this.y;break}case 2:case 3:{this.fixedPointX=-_half_width*_cos-_half_height*_sin+ _half_width+this.x;this.fixedPointY=-_half_width*_sin+_half_height*_cos+_half_height+this.y;break}case 4:case 5:{this.fixedPointX=-_half_width*_cos+_half_height*_sin+_half_width+this.x;this.fixedPointY=-_half_width*_sin-_half_height*_cos+_half_height+this.y;break}case 6:case 7:{this.fixedPointX=_half_width*_cos+_half_height*_sin+_half_width+this.x;this.fixedPointY=_half_width*_sin-_half_height*_cos+_half_height+this.y;break}}this.mod=this.translatetNumberHandle%4;this.centerPointX=this.x+_half_width; this.centerPointY=this.y+_half_height;this.lineFlag=false;this.originalExtX=this.extX;this.originalExtY=this.extY;this.originalFlipH=_flip_h;this.originalFlipV=_flip_v;this.usedExtX=this.originalExtX===0?.01:this.originalExtX;this.usedExtY=this.originalExtY===0?.01:this.originalExtY;this.resizedExtX=this.originalExtX;this.resizedExtY=this.originalExtY;this.resizedflipH=_flip_h;this.resizedflipV=_flip_v;this.resizedPosX=this.x;this.resizedPosY=this.y;this.resizedRot=this.rot;this.bChangeCoef=this.translatetNumberHandle% 2===0&&this.originalFlipH!==this.originalFlipV}if(this.parentTrack){this.centerDistX=this.x+this.extX*.5-this.parentTrack.extX*.5;this.centerDistY=this.y+this.extY*.5-this.parentTrack.extY*.5}this.track=function(kd1,kd2,e){AscFormat.ExecuteNoHistory(function(){this.bIsTracked=true;if(!e.CtrlKey)this.resize(kd1,kd2,e.ShiftKey);else this.resizeRelativeCenter(kd1,kd2,e.ShiftKey)},this,[])};this.resize=function(kd1,kd2,ShiftKey){var _cos=this.cos;var _sin=this.sin;var _real_height,_real_width;var _abs_height, _abs_width;var _new_resize_half_width;var _new_resize_half_height;var _new_used_half_width;var _new_used_half_height;var _temp;var isCrop=this.originalObject.isCrop||!!this.originalObject.cropObject;if((ShiftKey===true||window.AscAlwaysSaveAspectOnResizeTrack===true||!isCrop&&this.originalObject.getNoChangeAspect())&&this.bAspect===true){var _new_aspect=this.aspect*Math.abs(kd1/kd2);if(_new_aspect>=this.aspect)kd2=Math.abs(kd1)*(kd2>=0?1:-1);else kd1=Math.abs(kd2)*(kd1>=0?1:-1)}if(this.bChangeCoef){_temp= kd1;kd1=kd2;kd2=_temp}switch(this.translatetNumberHandle){case 0:case 1:{if(this.translatetNumberHandle===0){_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE||this.lineFlag?_abs_width:MIN_SHAPE_SIZE;if(_real_width<0)this.resizedflipH=!this.originalFlipH;else this.resizedflipH=this.originalFlipH}if(this.translatetNumberHandle===1){_temp=kd1;kd1=kd2;kd2=_temp}_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);this.resizedExtY= _abs_height>=MIN_SHAPE_SIZE||this.lineFlag?_abs_height:MIN_SHAPE_SIZE;if(_real_height<0)this.resizedflipV=!this.originalFlipV;else this.resizedflipV=this.originalFlipV;_new_resize_half_width=this.resizedExtX*.5;_new_resize_half_height=this.resizedExtY*.5;if(this.resizedflipH!==this.originalFlipH)_new_used_half_width=-_new_resize_half_width;else _new_used_half_width=_new_resize_half_width;if(this.resizedflipV!==this.originalFlipV)_new_used_half_height=-_new_resize_half_height;else _new_used_half_height= _new_resize_half_height;this.resizedPosX=this.fixedPointX+(-_new_used_half_width*_cos+_new_used_half_height*_sin)-_new_resize_half_width;this.resizedPosY=this.fixedPointY+(-_new_used_half_width*_sin-_new_used_half_height*_cos)-_new_resize_half_height;break}case 2:case 3:{if(this.translatetNumberHandle===2){_temp=kd2;kd2=kd1;kd1=_temp;_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE||this.lineFlag?_abs_height:MIN_SHAPE_SIZE;if(_real_height< 0)this.resizedflipV=!this.originalFlipV;else this.resizedflipV=this.originalFlipV}_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE||this.lineFlag?_abs_width:MIN_SHAPE_SIZE;if(_real_width<0)this.resizedflipH=!this.originalFlipH;else this.resizedflipH=this.originalFlipH;_new_resize_half_width=this.resizedExtX*.5;_new_resize_half_height=this.resizedExtY*.5;if(this.resizedflipH!==this.originalFlipH)_new_used_half_width=-_new_resize_half_width; else _new_used_half_width=_new_resize_half_width;if(this.resizedflipV!==this.originalFlipV)_new_used_half_height=-_new_resize_half_height;else _new_used_half_height=_new_resize_half_height;this.resizedPosX=this.fixedPointX+(_new_used_half_width*_cos+_new_used_half_height*_sin)-_new_resize_half_width;this.resizedPosY=this.fixedPointY+(_new_used_half_width*_sin-_new_used_half_height*_cos)-_new_resize_half_height;break}case 4:case 5:{if(this.translatetNumberHandle===4){_real_width=this.usedExtX*kd1; _abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE||this.lineFlag?_abs_width:MIN_SHAPE_SIZE;if(_real_width<0)this.resizedflipH=!this.originalFlipH;else this.resizedflipH=this.originalFlipH}else{_temp=kd2;kd2=kd1;kd1=_temp}_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE||this.lineFlag?_abs_height:MIN_SHAPE_SIZE;if(_real_height<0)this.resizedflipV=!this.originalFlipV;else this.resizedflipV=this.originalFlipV;_new_resize_half_width= this.resizedExtX*.5;_new_resize_half_height=this.resizedExtY*.5;if(this.resizedflipH!==this.originalFlipH)_new_used_half_width=-_new_resize_half_width;else _new_used_half_width=_new_resize_half_width;if(this.resizedflipV!==this.originalFlipV)_new_used_half_height=-_new_resize_half_height;else _new_used_half_height=_new_resize_half_height;this.resizedPosX=this.fixedPointX+(_new_used_half_width*_cos-_new_used_half_height*_sin)-_new_resize_half_width;this.resizedPosY=this.fixedPointY+(_new_used_half_width* _sin+_new_used_half_height*_cos)-_new_resize_half_height;break}case 6:case 7:{if(this.translatetNumberHandle===6){_real_height=this.usedExtY*kd1;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE||this.lineFlag?_abs_height:MIN_SHAPE_SIZE;if(_real_height<0)this.resizedflipV=!this.originalFlipV;else this.resizedflipV=this.originalFlipV}else{_temp=kd2;kd2=kd1;kd1=_temp}_real_width=this.usedExtX*kd2;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE|| this.lineFlag?_abs_width:MIN_SHAPE_SIZE;if(_real_width<0)this.resizedflipH=!this.originalFlipH;else this.resizedflipH=this.originalFlipH;_new_resize_half_width=this.resizedExtX*.5;_new_resize_half_height=this.resizedExtY*.5;if(this.resizedflipH!==this.originalFlipH)_new_used_half_width=-_new_resize_half_width;else _new_used_half_width=_new_resize_half_width;if(this.resizedflipV!==this.originalFlipV)_new_used_half_height=-_new_resize_half_height;else _new_used_half_height=_new_resize_half_height;this.resizedPosX= this.fixedPointX+(-_new_used_half_width*_cos-_new_used_half_height*_sin)-_new_resize_half_width;this.resizedPosY=this.fixedPointY+(-_new_used_half_width*_sin+_new_used_half_height*_cos)-_new_resize_half_height;break}}this.x=this.resizedPosX;this.y=this.resizedPosY;this.extX=this.resizedExtX;this.extY=this.resizedExtY;this.flipH=this.resizedflipH;this.flipV=this.resizedflipV;var _transform=this.transform;_transform.Reset();var _horizontal_center=this.resizedExtX*.5;var _vertical_center=this.resizedExtY* .5;global_MatrixTransformer.TranslateAppend(_transform,-_horizontal_center,-_vertical_center);if(this.resizedflipH)global_MatrixTransformer.ScaleAppend(_transform,-1,1);if(this.resizedflipV)global_MatrixTransformer.ScaleAppend(_transform,1,-1);global_MatrixTransformer.RotateRadAppend(_transform,-this.resizedRot);global_MatrixTransformer.TranslateAppend(_transform,this.resizedPosX,this.resizedPosY);global_MatrixTransformer.TranslateAppend(_transform,_horizontal_center,_vertical_center);var originalExtX, originalExtY;if(AscFormat.isRealNumber(this.original.extX)&&AscFormat.isRealNumber(this.original.extY)){originalExtX=this.original.extX;originalExtY=this.original.extY;if(AscFormat.fApproxEqual(0,originalExtX))originalExtX=1;if(AscFormat.fApproxEqual(0,originalExtY))originalExtY=1}else{var xfrm=this.original.spPr.xfrm;if(xfrm){originalExtX=xfrm.extX;originalExtY=xfrm.extY}if(!AscFormat.isRealNumber(originalExtX))originalExtX=1;if(!AscFormat.isRealNumber(originalExtY))originalExtY=1}if(AscFormat.fApproxEqual(0, originalExtX))originalExtX=1;if(AscFormat.fApproxEqual(0,originalExtY))originalExtY=1;var kw=this.resizedExtX/originalExtX;var kh=this.resizedExtY/originalExtY;for(var i=0;i<this.childs.length;++i){var cur_child=this.childs[i];cur_child.updateSize(kw,kh)}};this.resizeRelativeCenter=function(kd1,kd2,ShiftKey){kd1=2*kd1-1;kd2=2*kd2-1;var _real_height,_real_width;var _abs_height,_abs_width;var isCrop=this.originalObject.isCrop||!!this.originalObject.cropObject;if((ShiftKey===true||window.AscAlwaysSaveAspectOnResizeTrack=== true||!isCrop&&this.originalObject.getNoChangeAspect())&&this.bAspect===true){var _new_aspect=this.aspect*Math.abs(kd1/kd2);if(_new_aspect>=this.aspect)kd2=Math.abs(kd1)*(kd2>=0?1:-1);else kd1=Math.abs(kd2)*(kd1>=0?1:-1)}var _temp;if(this.bChangeCoef){_temp=kd1;kd1=kd2;kd2=_temp}if(this.mod===0||this.mod===1){if(this.mod===0){_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE||this.lineFlag?_abs_width:MIN_SHAPE_SIZE;this.resizedflipH=_real_width< 0?!this.originalFlipH:this.originalFlipH}else{_temp=kd1;kd1=kd2;kd2=_temp}_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE||this.lineFlag?_abs_height:MIN_SHAPE_SIZE;this.resizedflipV=_real_height<0?!this.originalFlipV:this.originalFlipV}else{if(this.mod===2){_temp=kd1;kd1=kd2;kd2=_temp;_real_height=this.usedExtY*kd2;_abs_height=Math.abs(_real_height);this.resizedExtY=_abs_height>=MIN_SHAPE_SIZE||this.lineFlag?_abs_height:MIN_SHAPE_SIZE; this.resizedflipV=_real_height<0?!this.originalFlipV:this.originalFlipV}_real_width=this.usedExtX*kd1;_abs_width=Math.abs(_real_width);this.resizedExtX=_abs_width>=MIN_SHAPE_SIZE||this.lineFlag?_abs_width:MIN_SHAPE_SIZE;this.resizedflipH=_real_width<0?!this.originalFlipH:this.originalFlipH}this.resizedPosX=this.centerPointX-this.resizedExtX*.5;this.resizedPosY=this.centerPointY-this.resizedExtY*.5;this.x=this.resizedPosX;this.y=this.resizedPosY;this.extX=this.resizedExtX;this.extY=this.resizedExtY; this.flipH=this.resizedflipH;this.flipV=this.resizedflipV;var _transform=this.transform;_transform.Reset();var _horizontal_center=this.resizedExtX*.5;var _vertical_center=this.resizedExtY*.5;global_MatrixTransformer.TranslateAppend(_transform,-_horizontal_center,-_vertical_center);if(this.resizedflipH)global_MatrixTransformer.ScaleAppend(_transform,-1,1);if(this.resizedflipV)global_MatrixTransformer.ScaleAppend(_transform,1,-1);global_MatrixTransformer.RotateRadAppend(_transform,-this.resizedRot); global_MatrixTransformer.TranslateAppend(_transform,this.resizedPosX,this.resizedPosY);global_MatrixTransformer.TranslateAppend(_transform,_horizontal_center,_vertical_center);var xfrm=this.original.spPr.xfrm;var kw=this.resizedExtX/xfrm.extX;var kh=this.resizedExtY/xfrm.extY;for(var i=0;i<this.childs.length;++i)this.childs[i].updateSize(kw,kh)};this.updateSize=function(kw,kh){this.bIsTracked=true;var _kw,_kh;if(this.bSwapCoef){_kw=kh;_kh=kw}else{_kw=kw;_kh=kh}var xfrm=this.original.spPr.xfrm;this.extX= xfrm.extX*_kw;this.extY=xfrm.extY*_kh;this.x=this.centerDistX*kw+this.parentTrack.extX*.5-this.extX*.5;this.y=this.centerDistY*kh+this.parentTrack.extY*.5-this.extY*.5;this.transform.Reset();var t=this.transform;global_MatrixTransformer.TranslateAppend(t,-this.extX*.5,-this.extY*.5);if(xfrm.flipH==null?false:xfrm.flipH)global_MatrixTransformer.ScaleAppend(t,-1,1);if(xfrm.flipV==null?false:xfrm.flipV)global_MatrixTransformer.ScaleAppend(t,1,-1);global_MatrixTransformer.RotateRadAppend(t,xfrm.rot== null?0:-xfrm.rot);global_MatrixTransformer.TranslateAppend(t,this.x+this.extX*.5,this.y+this.extY*.5);global_MatrixTransformer.MultiplyAppend(t,this.parentTrack.transform);for(var i=0;i<this.childs.length;++i)this.childs[i].updateSize(_kw,_kh)};this.draw=function(graphics){if(AscFormat.isRealNumber(this.originalObject.selectStartPage)&&graphics.SetCurrentPage)graphics.SetCurrentPage(this.originalObject.selectStartPage);for(var i=0;i<this.childs.length;++i)this.childs[i].draw(graphics)};this.getBounds= function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;this.draw(boundsChecker);var tr=this.transform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0,0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.resizedExtX,0));arr_p_y.push(tr.TransformPointY(this.resizedExtX,0));arr_p_x.push(tr.TransformPointX(this.resizedExtX,this.resizedExtY));arr_p_y.push(tr.TransformPointY(this.resizedExtX,this.resizedExtY));arr_p_x.push(tr.TransformPointX(0,this.resizedExtY)); arr_p_y.push(tr.TransformPointY(0,this.resizedExtY));arr_p_x.push(boundsChecker.Bounds.min_x);arr_p_x.push(boundsChecker.Bounds.max_x);arr_p_y.push(boundsChecker.Bounds.min_y);arr_p_y.push(boundsChecker.Bounds.max_y);boundsChecker.Bounds.min_x=Math.min.apply(Math,arr_p_x);boundsChecker.Bounds.max_x=Math.max.apply(Math,arr_p_x);boundsChecker.Bounds.min_y=Math.min.apply(Math,arr_p_y);boundsChecker.Bounds.max_y=Math.max.apply(Math,arr_p_y);boundsChecker.Bounds.posX=this.resizedPosX;boundsChecker.Bounds.posY= this.resizedPosY;boundsChecker.Bounds.extX=this.resizedExtX;boundsChecker.Bounds.extY=this.resizedExtY;return boundsChecker.Bounds};this.trackEnd=function(bWord){if(!this.bIsTracked)return;if(!AscCommon.isRealObject(this.original.group))this.original.normalize();if(!this.original.spPr)this.original.setSpPr(new AscFormat.CSpPr);if(!this.original.spPr.xfrm){this.original.spPr.setXfrm(new AscFormat.CXfrm);this.original.spPr.xfrm.setParent(this.original.spPr)}var xfrm=this.original.spPr.xfrm;if(bWord){this.x= 0;this.y=0}xfrm.setOffX(this.x);xfrm.setOffY(this.y);xfrm.setExtX(this.extX);xfrm.setExtY(this.extY);xfrm.setChExtX(this.extX);xfrm.setChExtY(this.extY);xfrm.setFlipH(this.flipH);xfrm.setFlipV(this.flipV);for(var i=0;i<this.childs.length;++i)this.childs[i].trackEnd();this.original.checkDrawingBaseCoords();AscFormat.CheckShapeBodyAutoFitReset(this.original)}},this,[])}function ShapeForResizeInGroup(originalObject,parentTrack){AscFormat.ExecuteNoHistory(function(){this.originalObject=originalObject; this.parentTrack=parentTrack;this.x=originalObject.x;this.y=originalObject.y;this.extX=originalObject.extX;this.extY=originalObject.extY;this.rot=originalObject.rot;this.flipH=originalObject.flipH;this.flipV=originalObject.flipV;this.transform=originalObject.transform.CreateDublicate();this.bSwapCoef=!AscFormat.checkNormalRotate(this.rot);this.centerDistX=this.x+this.extX*.5-this.parentTrack.extX*.5;this.centerDistY=this.y+this.extY*.5-this.parentTrack.extY*.5;this.geometry=AscFormat.ExecuteNoHistory(function(){return originalObject.getGeom().createDuplicate()}, this,[]);if(this.geometry)this.geometry.Recalculate(this.extX,this.extY);var brush;if(originalObject.blipFill){brush=new AscFormat.CUniFill;brush.fill=originalObject.blipFill}else brush=originalObject.brush;this.overlayObject=new AscFormat.OverlayObject(this.geometry,this.extX,this.extY,brush,originalObject.pen,this.transform);this.updateSize=function(kw,kh){var _kw,_kh;if(this.bSwapCoef){_kw=kh;_kh=kw}else{_kw=kw;_kh=kh}this.extX=this.originalObject.extX*_kw;this.extY=this.originalObject.extY*_kh; this.x=this.centerDistX*kw+this.parentTrack.extX*.5-this.extX*.5;this.y=this.centerDistY*kh+this.parentTrack.extY*.5-this.extY*.5;this.overlayObject.updateExtents(this.extX,this.extY);this.transform.Reset();var t=this.transform;global_MatrixTransformer.TranslateAppend(t,-this.extX*.5,-this.extY*.5);if(this.flipH)global_MatrixTransformer.ScaleAppend(t,-1,1);if(this.flipV)global_MatrixTransformer.ScaleAppend(t,1,-1);global_MatrixTransformer.RotateRadAppend(t,-this.rot);global_MatrixTransformer.TranslateAppend(t, this.x+this.extX*.5,this.y+this.extY*.5);global_MatrixTransformer.MultiplyAppend(t,this.parentTrack.transform)};this.draw=function(overlay){this.overlayObject.draw(overlay)};this.getBounds=function(){var bounds_checker=new AscFormat.CSlideBoundsChecker;bounds_checker.init(Page_Width,Page_Height,Page_Width,Page_Height);this.draw(bounds_checker);return{l:bounds_checker.Bounds.min_x,t:bounds_checker.Bounds.min_y,r:bounds_checker.Bounds.max_x,b:bounds_checker.Bounds.max_y}};this.trackEnd=function(){if(!this.originalObject.spPr.xfrm){this.originalObject.spPr.setXfrm(new AscFormat.CXfrm); this.originalObject.spPr.xfrm.setParent(this.originalObject.spPr)}var xfrm=this.originalObject.spPr.xfrm;xfrm.setOffX(this.x);xfrm.setOffY(this.y);xfrm.setExtX(this.extX);xfrm.setExtY(this.extY);AscFormat.CheckShapeBodyAutoFitReset(this.originalObject)};this.updateTransform=function(){this.transform.Reset();var t=this.transform;global_MatrixTransformer.TranslateAppend(t,-this.extX*.5,-this.extY*.5);if(this.flipH)global_MatrixTransformer.ScaleAppend(t,-1,1);if(this.flipV)global_MatrixTransformer.ScaleAppend(t, 1,-1);global_MatrixTransformer.RotateRadAppend(t,-this.rot);global_MatrixTransformer.TranslateAppend(t,this.x+this.extX*.5,this.y+this.extY*.5);if(this.parentTrack)global_MatrixTransformer.MultiplyAppend(t,this.parentTrack.transform)}},this,[])}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].SHAPE_EXT=SHAPE_EXT;window["AscFormat"].CreatePenBrushForChartTrack=CreatePenBrushForChartTrack;window["AscFormat"].ResizeTrackShapeImage=ResizeTrackShapeImage;window["AscFormat"].ResizeTrackGroup= ResizeTrackGroup})(window);"use strict";(function(window,undefined){var CMatrix=AscCommon.CMatrix;var global_MatrixTransformer=AscCommon.global_MatrixTransformer;var c_oAscFill=Asc.c_oAscFill;var MIN_ANGLE=.07;function OverlayObject(geometry,extX,extY,brush,pen,transform){this.geometry=geometry;this.ext={};this.ext.cx=extX;this.ext.cy=extY;this.extX=extX;this.extY=extY;var _brush,_pen;if((!brush||!brush.fill||brush.fill.type===c_oAscFill.FILL_TYPE_NOFILL)&&(!pen||!pen.Fill||!pen.Fill||!pen.Fill.fill|| pen.Fill.fill.type===c_oAscFill.FILL_TYPE_NOFILL||pen.w===0)){var penBrush=AscFormat.CreatePenBrushForChartTrack();_brush=penBrush.brush;_pen=penBrush.pen}else{_brush=brush;_pen=pen}this.brush=_brush;this.pen=_pen;this.TransformMatrix=transform;this.shapeDrawer=new AscCommon.CShapeDrawer;this.updateTransform=function(extX,extY,transform){this.ext.cx=extX;this.ext.cy=extY;this.extX=extX;this.extY=extY;this.transform=transform};this.updateExtents=function(extX,extY){this.ext.cx=extX;this.ext.cy=extY; this.extX=extX;this.extY=extY;this.geometry&&this.geometry.Recalculate(extX,extY)};this.updateTransformMatrix=function(transform){this.TransformMatrix=transform};this.draw=function(overlay,transform){var oldTransform=this.TransformMatrix;if(transform)this.updateTransformMatrix(transform);if(this.checkDrawGeometry()){overlay.SaveGrState();overlay.SetIntegerGrid(false);overlay.transform3(this.TransformMatrix,false);this.shapeDrawer.fromShape2(this,overlay,this.geometry);this.shapeDrawer.draw(this.geometry); overlay.RestoreGrState()}else if(window["NATIVE_EDITOR_ENJINE"]===true){var _shape=new AscFormat.CShape;_shape.extX=this.ext.cx;_shape.extY=this.ext.cy;_shape.brush=AscFormat.CreateSolidFillRGBA(255,255,255,128);_shape.pen=new AscFormat.CLn;_shape.pen.Fill=AscFormat.CreateSolidFillRGBA(0,0,0,160);_shape.pen.w=18E3;overlay.SaveGrState();overlay.SetIntegerGrid(false);overlay.transform3(this.TransformMatrix,false);this.shapeDrawer.fromShape2(_shape,overlay,null);this.shapeDrawer.draw(null);overlay.RestoreGrState()}else{overlay.SaveGrState(); overlay.SetIntegerGrid(false);overlay.transform3(this.TransformMatrix);overlay._s();overlay._m(0,0);overlay._l(this.ext.cx,0);overlay._l(this.ext.cx,this.ext.cy);overlay._l(0,this.ext.cy);overlay._z();overlay.p_color(0,0,0,160);overlay.p_width(500);overlay.ds();overlay.b_color1(255,255,255,128);overlay.df();overlay._e();overlay.RestoreGrState();if(overlay.m_oOverlay)overlay.m_oOverlay.ClearAll=true}if(transform)this.updateTransformMatrix(oldTransform)};this.checkDrawGeometry=function(){return this.geometry&& (this.pen&&this.pen.Fill&&this.pen.Fill.fill&&this.pen.Fill.fill.type!=c_oAscFill.FILL_TYPE_NOFILL&&this.pen.Fill.fill.type!=c_oAscFill.FILL_TYPE_NONE||this.brush&&this.brush.fill&&this.brush.fill&&this.brush.fill.type!=c_oAscFill.FILL_TYPE_NOFILL&&this.brush.fill.type!=c_oAscFill.FILL_TYPE_NONE)};this.check_bounds=function(boundsChecker){if(this.geometry)this.geometry.check_bounds(boundsChecker);else{boundsChecker._s();boundsChecker._m(0,0);boundsChecker._l(this.ext.cx,0);boundsChecker._l(this.ext.cx, this.ext.cy);boundsChecker._l(0,this.ext.cy);boundsChecker._z();boundsChecker._e()}}}function ObjectToDraw(brush,pen,extX,extY,geometry,transform,x,y,oComment){this.extX=extX;this.extY=extY;this.transform=transform;this.TransformMatrix=transform;this.geometry=geometry;this.parentShape=null;this.Comment=oComment;this.pen=pen;this.brush=brush;this.x=x;this.y=y}ObjectToDraw.prototype={check_bounds:function(boundsChecker){if(this.geometry)this.geometry.check_bounds(boundsChecker);else{boundsChecker._s(); boundsChecker._m(0,0);boundsChecker._l(this.extX,0);boundsChecker._l(this.extX,this.extY);boundsChecker._l(0,this.extY);boundsChecker._z();boundsChecker._e()}},resetBrushPen:function(brush,pen,x,y){this.brush=brush;this.pen=pen;if(AscFormat.isRealNumber(x)&&AscFormat.isRealNumber(y)){this.x=x;this.y=y}},Recalculate:function(oTheme,oColorMap,dWidth,dHeight,oShape,bResetPathsInfo){if(this.brush)this.brush.check(oTheme,oColorMap);if(this.pen&&this.pen.Fill)this.pen.Fill.check(oTheme,oColorMap);if(this.geometry)this.geometry.Recalculate(dWidth, dHeight,bResetPathsInfo);this.parentShape=oShape},getTransform:function(oTransformMatrix,bNoParentShapeTransform){var oTransform;if(oTransformMatrix)oTransform=oTransformMatrix;else if(this.parentShape&&!(bNoParentShapeTransform===true))oTransform=this.parentShape.transformText;else oTransform=this.TransformMatrix;return oTransform},drawComment2:function(graphics,bNoParentShapeTransform,oTransformMatrix){var oTransform=this.getTransform(oTransformMatrix,bNoParentShapeTransform);this.DrawComment(graphics, oTransform)},DrawComment:function(graphics,oTransform){if(this.Comment){var oComment=AscCommon.g_oTableId.Get_ById(this.Comment.Additional.CommentId);if(oComment){var Para=AscCommon.g_oTableId.Get_ById(oComment.StartId);if(editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument&&editor.WordControl.m_oLogicDocument.Comments&&graphics instanceof AscCommon.CGraphics&&(editor.WordControl.m_oLogicDocument.Comments.Is_Use()&&true!=editor.isViewMode)){if(this.Comment.Additional.CommentId===editor.WordControl.m_oLogicDocument.Comments.Get_CurrentId())this.brush= AscFormat.G_O_ACTIVE_COMMENT_BRUSH;else this.brush=AscFormat.G_O_NO_ACTIVE_COMMENT_BRUSH;var oComm=this.Comment;Para&&editor.WordControl.m_oLogicDocument.Comments.Add_DrawingRect(oComm.x0,oComm.y0,oComm.x1-oComm.x0,oComm.y1-oComm.y0,graphics.PageNum,this.Comment.Additional.CommentId,global_MatrixTransformer.Invert(oTransform))}}}},draw:function(graphics,bNoParentShapeTransform,oTransformMatrix,oTheme,oColorMap){var oTransform=this.getTransform(oTransformMatrix,bNoParentShapeTransform);this.DrawComment(graphics, oTransform);if(oTheme&&oColorMap){if(this.brush)this.brush.check(oTheme,oColorMap);if(this.pen&&this.pen.Fill)this.pen.Fill.check(oTheme,oColorMap)}graphics.SaveGrState();graphics.SetIntegerGrid(false);graphics.transform3(oTransform,false);var shape_drawer=new AscCommon.CShapeDrawer;shape_drawer.fromShape2(this,graphics,this.geometry);if(graphics.IsSlideBoundsCheckerType)shape_drawer.bIsNoFillAttack=false;shape_drawer.draw(this.geometry);graphics.RestoreGrState()},createDuplicate:function(){}};function RotateTrackShapeImage(originalObject){this.bIsTracked= false;this.originalObject=originalObject;this.transform=new CMatrix;var brush;if(originalObject.blipFill){brush=new AscFormat.CUniFill;brush.fill=originalObject.blipFill}else brush=originalObject.brush;this.overlayObject=new OverlayObject(originalObject.getGeom(),originalObject.extX,originalObject.extY,brush,originalObject.pen,this.transform);this.angle=originalObject.rot;var full_flip_h=this.originalObject.getFullFlipH();var full_flip_v=this.originalObject.getFullFlipV();this.signum=!full_flip_h&& !full_flip_v||full_flip_h&&full_flip_v?1:-1;this.draw=function(overlay,transform){if(AscFormat.isRealNumber(this.originalObject.selectStartPage)&&overlay.SetCurrentPage)overlay.SetCurrentPage(this.originalObject.selectStartPage);this.overlayObject.draw(overlay,transform)};this.track=function(angle,e){this.bIsTracked=true;var new_rot=angle+this.originalObject.rot;while(new_rot<0)new_rot+=2*Math.PI;while(new_rot>=2*Math.PI)new_rot-=2*Math.PI;if(new_rot<MIN_ANGLE||new_rot>2*Math.PI-MIN_ANGLE)new_rot= 0;if(Math.abs(new_rot-Math.PI*.5)<MIN_ANGLE)new_rot=Math.PI*.5;if(Math.abs(new_rot-Math.PI)<MIN_ANGLE)new_rot=Math.PI;if(Math.abs(new_rot-1.5*Math.PI)<MIN_ANGLE)new_rot=1.5*Math.PI;if(e.ShiftKey)new_rot=Math.PI/12*Math.floor(12*new_rot/Math.PI);this.angle=new_rot;var hc,vc;hc=this.originalObject.extX*.5;vc=this.originalObject.extY*.5;this.transform.Reset();global_MatrixTransformer.TranslateAppend(this.transform,-hc,-vc);if(this.originalObject.flipH)global_MatrixTransformer.ScaleAppend(this.transform, -1,1);if(this.originalObject.flipV)global_MatrixTransformer.ScaleAppend(this.transform,1,-1);global_MatrixTransformer.RotateRadAppend(this.transform,-this.angle);global_MatrixTransformer.TranslateAppend(this.transform,this.originalObject.x+hc,this.originalObject.y+vc);if(this.originalObject.group)global_MatrixTransformer.MultiplyAppend(this.transform,this.originalObject.group.transform);if(this.originalObject.parent){var parent_transform=this.originalObject.parent.Get_ParentTextTransform&&this.originalObject.parent.Get_ParentTextTransform(); if(parent_transform)global_MatrixTransformer.MultiplyAppend(this.transform,parent_transform)}};this.trackEnd=function(){if(!this.bIsTracked)return;AscFormat.CheckSpPrXfrm(this.originalObject);this.originalObject.spPr.xfrm.setRot(this.angle)};this.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;var tr=null;if(this.originalObject&&this.originalObject.parent){var parent_transform=this.originalObject.parent.Get_ParentTextTransform&&this.originalObject.parent.Get_ParentTextTransform(); if(parent_transform){tr=this.transform.CreateDublicate();global_MatrixTransformer.MultiplyAppend(tr,global_MatrixTransformer.Invert(parent_transform))}}this.draw(boundsChecker,tr?tr:null);tr=this.transform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0,0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.originalObject.extX,0));arr_p_y.push(tr.TransformPointY(this.originalObject.extX,0));arr_p_x.push(tr.TransformPointX(this.originalObject.extX,this.originalObject.extY)); arr_p_y.push(tr.TransformPointY(this.originalObject.extX,this.originalObject.extY));arr_p_x.push(tr.TransformPointX(0,this.originalObject.extY));arr_p_y.push(tr.TransformPointY(0,this.originalObject.extY));arr_p_x.push(boundsChecker.Bounds.min_x);arr_p_x.push(boundsChecker.Bounds.max_x);arr_p_y.push(boundsChecker.Bounds.min_y);arr_p_y.push(boundsChecker.Bounds.max_y);boundsChecker.Bounds.min_x=Math.min.apply(Math,arr_p_x);boundsChecker.Bounds.max_x=Math.max.apply(Math,arr_p_x);boundsChecker.Bounds.min_y= Math.min.apply(Math,arr_p_y);boundsChecker.Bounds.max_y=Math.max.apply(Math,arr_p_y);boundsChecker.Bounds.posX=this.originalObject.x;boundsChecker.Bounds.posY=this.originalObject.y;boundsChecker.Bounds.extX=this.originalObject.extX;boundsChecker.Bounds.extY=this.originalObject.extY;return boundsChecker.Bounds}}function RotateTrackGroup(originalObject){this.bIsTracked=false;this.originalObject=originalObject;this.transform=new CMatrix;this.overlayObjects=[];this.arrTransforms=[];this.arrTransforms2= [];var arr_graphic_objects=originalObject.getArrGraphicObjects();var group_invert_transform=originalObject.getInvertTransform();if(group_invert_transform)for(var i=0;i<arr_graphic_objects.length;++i){var gr_obj_transform_copy=arr_graphic_objects[i].getTransformMatrix().CreateDublicate();global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy,group_invert_transform);this.arrTransforms2[i]=gr_obj_transform_copy;this.overlayObjects[i]=new OverlayObject(arr_graphic_objects[i].getGeom(),arr_graphic_objects[i].extX, arr_graphic_objects[i].extY,arr_graphic_objects[i].brush,arr_graphic_objects[i].pen,new CMatrix)}this.angle=originalObject.rot;this.draw=function(overlay){if(AscFormat.isRealNumber(this.originalObject.selectStartPage)&&overlay.SetCurrentPage)overlay.SetCurrentPage(this.originalObject.selectStartPage);for(var i=0;i<this.overlayObjects.length;++i)this.overlayObjects[i].draw(overlay)};this.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;this.draw(boundsChecker);var tr=this.transform; var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0,0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.originalObject.extX,0));arr_p_y.push(tr.TransformPointY(this.originalObject.extX,0));arr_p_x.push(tr.TransformPointX(this.originalObject.extX,this.originalObject.extY));arr_p_y.push(tr.TransformPointY(this.originalObject.extX,this.originalObject.extY));arr_p_x.push(tr.TransformPointX(0,this.originalObject.extY));arr_p_y.push(tr.TransformPointY(0,this.originalObject.extY)); arr_p_x.push(boundsChecker.Bounds.min_x);arr_p_x.push(boundsChecker.Bounds.max_x);arr_p_y.push(boundsChecker.Bounds.min_y);arr_p_y.push(boundsChecker.Bounds.max_y);boundsChecker.Bounds.min_x=Math.min.apply(Math,arr_p_x);boundsChecker.Bounds.max_x=Math.max.apply(Math,arr_p_x);boundsChecker.Bounds.min_y=Math.min.apply(Math,arr_p_y);boundsChecker.Bounds.max_y=Math.max.apply(Math,arr_p_y);boundsChecker.Bounds.posX=this.originalObject.x;boundsChecker.Bounds.posY=this.originalObject.y;boundsChecker.Bounds.extX= this.originalObject.extX;boundsChecker.Bounds.extY=this.originalObject.extY;return boundsChecker.Bounds};this.track=function(angle,e){this.bIsTracked=true;var new_rot=angle+this.originalObject.rot;while(new_rot<0)new_rot+=2*Math.PI;while(new_rot>=2*Math.PI)new_rot-=2*Math.PI;if(new_rot<MIN_ANGLE||new_rot>2*Math.PI-MIN_ANGLE)new_rot=0;if(Math.abs(new_rot-Math.PI*.5)<MIN_ANGLE)new_rot=Math.PI*.5;if(Math.abs(new_rot-Math.PI)<MIN_ANGLE)new_rot=Math.PI;if(Math.abs(new_rot-1.5*Math.PI)<MIN_ANGLE)new_rot= 1.5*Math.PI;if(e.ShiftKey)new_rot=Math.PI/12*Math.floor(12*new_rot/Math.PI);this.angle=new_rot;var hc,vc;hc=this.originalObject.extX*.5;vc=this.originalObject.extY*.5;this.transform.Reset();global_MatrixTransformer.TranslateAppend(this.transform,-hc,-vc);if(this.originalObject.flipH)global_MatrixTransformer.ScaleAppend(this.transform,-1,1);if(this.originalObject.flipV)global_MatrixTransformer.ScaleAppend(this.transform,1,-1);global_MatrixTransformer.RotateRadAppend(this.transform,-this.angle);global_MatrixTransformer.TranslateAppend(this.transform, this.originalObject.x+hc,this.originalObject.y+vc);for(var i=0;i<this.overlayObjects.length;++i){var new_transform=this.arrTransforms2[i].CreateDublicate();global_MatrixTransformer.MultiplyAppend(new_transform,this.transform);this.overlayObjects[i].updateTransformMatrix(new_transform)}};this.trackEnd=function(bWord){if(!this.bIsTracked)return;var x=this.originalObject.x;var y=this.originalObject.y;if(bWord){this.originalObject.x=0;this.originalObject.y=0}AscFormat.CheckSpPrXfrm3(this.originalObject); if(bWord){this.originalObject.x=x;this.originalObject.y=y}this.originalObject.spPr.xfrm.setRot(this.angle)}}function Chart3dAdjustTrack(oChartSpace,numHandle,startX,startY){this.bIsTracked=false;this.chartSpace=oChartSpace;this.originalObject=oChartSpace;this.originalShape=oChartSpace;this.transform=this.originalObject.transform;this.processor3D=oChartSpace.chartObj.processor3D;this.depthPerspective=oChartSpace.chartObj.processor3D.depthPerspective;this.startX=oChartSpace.invertTransform.TransformPointX(startX, startY);this.startY=oChartSpace.invertTransform.TransformPointY(startX,startY);this.bChartTrack=false;var oChartObj=oChartSpace.chart.plotArea.charts[0];if(oChartObj){var nPointsCount=0;if(oChartObj.getObjectType()===AscDFH.historyitem_type_PieChart||oChartObj.getObjectType()===AscDFH.historyitem_type_PieChart){if(oChartObj.series[0])nPointsCount=AscFormat.getPtsFromSeries(oChartObj.series[0]).length}else for(var i=0;i<oChartObj.series.length;++i)nPointsCount+=AscFormat.getPtsFromSeries(oChartObj.series[i]).length; if(nPointsCount<30)this.bChartTrack=true}AscFormat.ExecuteNoHistory(function(){this.view3D=oChartSpace.chart.getView3d();this.chartSizes=this.chartSpace.getChartSizes();this.cX=this.chartSizes.startX+this.chartSizes.w/2;this.cY=this.chartSizes.startY+this.chartSizes.h/2;this.geometry=new AscFormat.Geometry;var oPen=new AscFormat.CLn;oPen.w=15E3;oPen.Fill=AscFormat.CreateSolidFillRGBA(255,255,255,255);this.objectToDraw=new OverlayObject(this.geometry,oChartSpace.extX,oChartSpace.extY,null,oPen,oChartSpace.transform); var oPen2=new AscFormat.CLn;oPen2.w=15E3;oPen2.Fill=AscFormat.CreateSolidFillRGBA(97,158,222,255);oPen2.prstDash=0;this.objectToDraw2=new OverlayObject(this.geometry,oChartSpace.extX,oChartSpace.extY,null,oPen2,oChartSpace.transform);var pxToMM=this.chartSpace.chartObj.calcProp.pxToMM;var oChSz=this.chartSizes;this.centerPoint=this.processor3D.convertAndTurnPoint((oChSz.startX+oChSz.w/2)*pxToMM,(oChSz.startY+oChSz.h/2)*pxToMM,this.depthPerspective/2)},this,[]);this.draw=function(overlay,transform){if(this.bChartTrack){if(AscFormat.isRealNumber(this.chartSpace.selectStartPage)&& overlay.SetCurrentPage)overlay.SetCurrentPage(this.chartSpace.selectStartPage);var dOldAlpha=null;var oGraphics=overlay.Graphics?overlay.Graphics:overlay;if(AscFormat.isRealNumber(oGraphics.globalAlpha)&&oGraphics.put_GlobalAlpha){var graphics=oGraphics;graphics.SaveGrState();graphics.SetIntegerGrid(false);graphics.transform3(oChartSpace.transform,false);oChartSpace.chartObj.draw(oChartSpace,graphics);graphics.RestoreGrState()}}else{if(AscFormat.isRealNumber(this.chartSpace.selectStartPage)&&overlay.SetCurrentPage)overlay.SetCurrentPage(this.chartSpace.selectStartPage); var dOldAlpha=null;var oGraphics=overlay.Graphics?overlay.Graphics:overlay;if(AscFormat.isRealNumber(oGraphics.globalAlpha)&&oGraphics.put_GlobalAlpha){dOldAlpha=oGraphics.globalAlpha;oGraphics.put_GlobalAlpha(false,1)}this.objectToDraw.draw(overlay,transform);this.objectToDraw2.draw(overlay,transform);if(AscFormat.isRealNumber(dOldAlpha)&&oGraphics.put_GlobalAlpha)oGraphics.put_GlobalAlpha(true,dOldAlpha)}};this.calculateGeometry=function(){AscFormat.ExecuteNoHistory(function(){this.geometry.pathLst.length= 0;var path=new AscFormat.Path;path.pathW=this.chartSpace.extX;path.pathH=this.chartSpace.extY;path.stroke=true;var pxToMM=this.chartSpace.chartObj.calcProp.pxToMM;this.geometry.pathLst.push(path);var oChSz=this.chartSizes;var processor3D=this.chartSpace.chartObj.processor3D;var centerPoint2=this.processor3D.convertAndTurnPoint((oChSz.startX+oChSz.w/2)*pxToMM,(oChSz.startY+oChSz.h/2)*pxToMM,this.depthPerspective/2);var deltaX=(this.centerPoint.x-centerPoint2.x)/pxToMM;var deltaY=(this.centerPoint.y- centerPoint2.y)/pxToMM;var point1=processor3D.convertAndTurnPoint(oChSz.startX*pxToMM,oChSz.startY*pxToMM,0);path.moveTo(point1.x/pxToMM+deltaX,point1.y/pxToMM+deltaY);var point2=processor3D.convertAndTurnPoint((oChSz.startX+oChSz.w)*pxToMM,oChSz.startY*pxToMM,0);path.lnTo(point2.x/pxToMM+deltaX,point2.y/pxToMM+deltaY);var point3=processor3D.convertAndTurnPoint((oChSz.startX+oChSz.w)*pxToMM,(oChSz.startY+oChSz.h)*pxToMM,0);path.lnTo(point3.x/pxToMM+deltaX,point3.y/pxToMM+deltaY);var point4=processor3D.convertAndTurnPoint(oChSz.startX* pxToMM,(oChSz.startY+oChSz.h)*pxToMM,0);path.lnTo(point4.x/pxToMM+deltaX,point4.y/pxToMM+deltaY);path.close();var point1d=processor3D.convertAndTurnPoint(oChSz.startX*pxToMM,oChSz.startY*pxToMM,this.depthPerspective);path.moveTo(point1d.x/pxToMM+deltaX,point1d.y/pxToMM+deltaY);var point2d=processor3D.convertAndTurnPoint((oChSz.startX+oChSz.w)*pxToMM,oChSz.startY*pxToMM,this.depthPerspective);path.lnTo(point2d.x/pxToMM+deltaX,point2d.y/pxToMM+deltaY);var point3d=processor3D.convertAndTurnPoint((oChSz.startX+ oChSz.w)*pxToMM,(oChSz.startY+oChSz.h)*pxToMM,this.depthPerspective);path.lnTo(point3d.x/pxToMM+deltaX,point3d.y/pxToMM+deltaY);var point4d=processor3D.convertAndTurnPoint(oChSz.startX*pxToMM,(oChSz.startY+oChSz.h)*pxToMM,this.depthPerspective);path.lnTo(point4d.x/pxToMM+deltaX,point4d.y/pxToMM+deltaY);path.close();path.moveTo(point1.x/pxToMM+deltaX,point1.y/pxToMM+deltaY);path.lnTo(point1d.x/pxToMM+deltaX,point1d.y/pxToMM+deltaY);path.moveTo(point2.x/pxToMM+deltaX,point2.y/pxToMM+deltaY);path.lnTo(point2d.x/ pxToMM+deltaX,point2d.y/pxToMM+deltaY);path.moveTo(point3.x/pxToMM+deltaX,point3.y/pxToMM+deltaY);path.lnTo(point3d.x/pxToMM+deltaX,point3d.y/pxToMM+deltaY);path.moveTo(point4.x/pxToMM+deltaX,point4.y/pxToMM+deltaY);path.lnTo(point4d.x/pxToMM+deltaX,point4d.y/pxToMM+deltaY);this.geometry.Recalculate(this.chartSpace.extX,this.chartSpace.extY)},this,[])};this.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;var tr=this.transform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0, 0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.originalObject.extX,0));arr_p_y.push(tr.TransformPointY(this.originalObject.extX,0));arr_p_x.push(tr.TransformPointX(this.originalObject.extX,this.originalObject.extY));arr_p_y.push(tr.TransformPointY(this.originalObject.extX,this.originalObject.extY));arr_p_x.push(tr.TransformPointX(0,this.originalObject.extY));arr_p_y.push(tr.TransformPointY(0,this.originalObject.extY));arr_p_x.push(boundsChecker.Bounds.min_x);arr_p_x.push(boundsChecker.Bounds.max_x); arr_p_y.push(boundsChecker.Bounds.min_y);arr_p_y.push(boundsChecker.Bounds.max_y);boundsChecker.Bounds.min_x=Math.min.apply(Math,arr_p_x);boundsChecker.Bounds.max_x=Math.max.apply(Math,arr_p_x);boundsChecker.Bounds.min_y=Math.min.apply(Math,arr_p_y);boundsChecker.Bounds.max_y=Math.max.apply(Math,arr_p_y);boundsChecker.Bounds.posX=this.originalObject.x;boundsChecker.Bounds.posY=this.originalObject.y;boundsChecker.Bounds.extX=this.originalObject.extX;boundsChecker.Bounds.extY=this.originalObject.extY; return boundsChecker.Bounds};this.track=function(x,y){this.bIsTracked=true;var tx=this.chartSpace.invertTransform.TransformPointX(x,y);var ty=this.chartSpace.invertTransform.TransformPointY(x,y);var _view3d=oChartSpace.chart.getView3d();var StratRotY=_view3d&&_view3d.rotY?_view3d.rotY:0;var deltaAng=-90*(tx-this.startX)/(this.chartSizes.w/2);this.view3D.rotY=StratRotY+deltaAng;if(_view3d.getRAngAx()){if(this.view3D.rotY<0)this.view3D.rotY=0;if(this.view3D.rotY>90)this.view3D.rotY=90}while(this.view3D.rotY< 0)this.view3D.rotY+=360;while(this.view3D.rotY>=360)this.view3D.rotY-=360;var StratRotX=_view3d&&_view3d.rotX?_view3d.rotX:0;deltaAng=90*(ty-this.startY)/(this.chartSizes.h/2);this.view3D.rotX=StratRotX+deltaAng;if(oChartSpace.chart.plotArea&&oChartSpace.chart.plotArea.charts[0]&&oChartSpace.chart.plotArea.charts[0].getObjectType()===AscDFH.historyitem_type_PieChart)if(this.view3D.rotX<0)this.view3D.rotX=0;if(this.view3D.rotX<-90)this.view3D.rotX=-90;if(this.view3D.rotX>90)this.view3D.rotX=90;var OldView= oChartSpace.chart.view3D;if(this.bChartTrack){oChartSpace.chart.view3D=this.view3D;oChartSpace.recalcInfo.recalculateChart=true;oChartSpace.recalculate();oChartSpace.chart.view3D=OldView}else{oChartSpace.chart.view3D=this.view3D;oChartSpace.chartObj.recalculateOnly3dProps(oChartSpace);oChartSpace.chart.view3D=OldView;this.calculateGeometry()}};this.trackEnd=function(){if(!this.bIsTracked)return;oChartSpace.chart.setView3D(this.view3D.createDuplicate());oChartSpace.setRecalculateInfo()}}window["AscFormat"]= window["AscFormat"]||{};window["AscFormat"].OverlayObject=OverlayObject;window["AscFormat"].ObjectToDraw=ObjectToDraw;window["AscFormat"].RotateTrackShapeImage=RotateTrackShapeImage;window["AscFormat"].RotateTrackGroup=RotateTrackGroup;window["AscFormat"].Chart3dAdjustTrack=Chart3dAdjustTrack})(window);"use strict";(function(window,undefined){function SplineCommandMoveTo(x,y){this.id=0;this.x=x;this.y=y}function SplineCommandLineTo(x,y){this.id=1;this.x=x;this.y=y;this.changeLastPoint=function(x, y){this.x=x;this.y=y}}function SplineCommandBezier(x1,y1,x2,y2,x3,y3){this.id=2;this.x1=x1;this.y1=y1;this.x2=x2;this.y2=y2;this.x3=x3;this.y3=y3;this.changeLastPoint=function(x,y){this.x3=x;this.y3=y;this.x2=this.x1+(this.x3-this.x1)*.5;this.y2=this.y1+(this.y3-this.y1)*.5}}function Spline(drawingObjects,theme,master,layout,slide,pageIndex){AscFormat.ExecuteNoHistory(function(){this.pageIndex=pageIndex;this.path=[];this.drawingObjects=drawingObjects;this.Matrix=new AscCommon.CMatrix;this.TransformMatrix= new AscCommon.CMatrix;this.style=AscFormat.CreateDefaultShapeStyle();var style=this.style;style.fillRef.Color.Calculate(theme,slide,layout,master,{R:0,G:0,B:0,A:255});var RGBA=style.fillRef.Color.RGBA;var pen=theme.getLnStyle(style.lnRef.idx,style.lnRef.Color);style.lnRef.Color.Calculate(theme,slide,layout,master);RGBA=style.lnRef.Color.RGBA;if(pen.Fill)pen.Fill.calculate(theme,slide,layout,master,RGBA);this.pen=pen;this.splineForDraw=new SplineForDrawer(this)},this,[]);this.Draw=function(graphics){graphics.SetIntegerGrid(false); graphics.transform3(this.Matrix);var shape_drawer=new AscCommon.CShapeDrawer;shape_drawer.fromShape(this,graphics);shape_drawer.draw(this)};this.draw=function(g){if(AscFormat.isRealNumber(this.pageIndex)&&g.SetCurrentPage)g.SetCurrentPage(this.pageIndex);this.splineForDraw.Draw(g);return;for(var i=0;i<this.path.length;++i){var lastX,lastY;switch(this.path[i].id){case 0:{g._m(this.path[i].x,this.path[i].y);lastX=this.path[i].x;lastY=this.path[i].y;break}case 1:{g._l(this.path[i].x,this.path[i].y); lastX=this.path[i].x;lastY=this.path[i].y;break}case 2:{g._c(this.path[i].x1,this.path[i].y1,this.path[i].x2,this.path[i].y2,this.path[i].x3,this.path[i].y3);lastX=this.path[i].x3;lastY=this.path[i].y3;break}}}g.ds()};this.getShape=function(bWord,drawingDocument,drawingObjects){var xMax=this.path[0].x,yMax=this.path[0].y,xMin=xMax,yMin=yMax;var i;var bClosed=false;if(this.path.length>2){var dx=this.path[0].x-this.path[this.path.length-1].x3;var dy=this.path[0].y-this.path[this.path.length-1].y3;if(Math.sqrt(dx* dx+dy*dy)<3){bClosed=true;this.path[this.path.length-1].x3=this.path[0].x;this.path[this.path.length-1].y3=this.path[0].y;if(this.path.length>3){var vx=(this.path[1].x3-this.path[this.path.length-2].x3)/6;var vy=(this.path[1].y3-this.path[this.path.length-2].y3)/6}else{vx=-(this.path[1].y3-this.path[0].y)/6;vy=(this.path[1].x3-this.path[0].x)/6}this.path[1].x1=this.path[0].x+vx;this.path[1].y1=this.path[0].y+vy;this.path[this.path.length-1].x2=this.path[0].x-vx;this.path[this.path.length-1].y2=this.path[0].y- vy}}var min_x=this.path[0].x;var max_x=min_x;var min_y=this.path[0].y;var max_y=min_y;var last_x=this.path[0].x,last_y=this.path[0].y;for(var index=1;index<this.path.length;++index){var path_command=this.path[index];if(path_command.id===1){if(min_x>path_command.x)min_x=path_command.x;if(max_x<path_command.x)max_x=path_command.x;if(min_y>path_command.y)min_y=path_command.y;if(max_y<path_command.y)max_y=path_command.y;last_x=path_command.x;last_y=path_command.y}else{var bezier_polygon=AscFormat.partition_bezier4(last_x, last_y,path_command.x1,path_command.y1,path_command.x2,path_command.y2,path_command.x3,path_command.y3,AscFormat.APPROXIMATE_EPSILON);for(var point_index=1;point_index<bezier_polygon.length;++point_index){var cur_point=bezier_polygon[point_index];if(min_x>cur_point.x)min_x=cur_point.x;if(max_x<cur_point.x)max_x=cur_point.x;if(min_y>cur_point.y)min_y=cur_point.y;if(max_y<cur_point.y)max_y=cur_point.y;last_x=path_command.x3;last_y=path_command.y3}}}xMin=min_x;xMax=max_x;yMin=min_y;yMax=max_y;var shape= new AscFormat.CShape;shape.setSpPr(new AscFormat.CSpPr);shape.spPr.setParent(shape);shape.spPr.setXfrm(new AscFormat.CXfrm);shape.spPr.xfrm.setParent(shape.spPr);if(!bWord){shape.spPr.xfrm.setOffX(xMin);shape.spPr.xfrm.setOffY(yMin)}else{shape.setWordShape(true);shape.spPr.xfrm.setOffX(0);shape.spPr.xfrm.setOffY(0)}shape.spPr.xfrm.setExtX(xMax-xMin);shape.spPr.xfrm.setExtY(yMax-yMin);shape.setStyle(AscFormat.CreateDefaultShapeStyle());var geometry=new AscFormat.Geometry;var w=xMax-xMin,h=yMax-yMin; var kw,kh,pathW,pathH;if(w>0){pathW=43200;kw=43200/w}else{pathW=0;kw=0}if(h>0){pathH=43200;kh=43200/h}else{pathH=0;kh=0}geometry.AddPathCommand(0,undefined,bClosed?"norm":"none",undefined,pathW,pathH);geometry.AddRect("l","t","r","b");for(i=0;i<this.path.length;++i)switch(this.path[i].id){case 0:{geometry.AddPathCommand(1,((this.path[i].x-xMin)*kw>>0)+"",((this.path[i].y-yMin)*kh>>0)+"");break}case 1:{geometry.AddPathCommand(2,((this.path[i].x-xMin)*kw>>0)+"",((this.path[i].y-yMin)*kh>>0)+"");break}case 2:{geometry.AddPathCommand(5, ((this.path[i].x1-xMin)*kw>>0)+"",((this.path[i].y1-yMin)*kh>>0)+"",((this.path[i].x2-xMin)*kw>>0)+"",((this.path[i].y2-yMin)*kh>>0)+"",((this.path[i].x3-xMin)*kw>>0)+"",((this.path[i].y3-yMin)*kh>>0)+"");break}}if(bClosed)geometry.AddPathCommand(6);shape.spPr.setGeometry(geometry);shape.setBDeleted(false);shape.recalculate();shape.x=xMin;shape.y=yMin;return shape};this.addPathCommand=function(pathCommand){this.path.push(pathCommand)};this.getBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker; this.draw(boundsChecker);boundsChecker.Bounds.posX=boundsChecker.Bounds.min_x;boundsChecker.Bounds.posY=boundsChecker.Bounds.min_y;boundsChecker.Bounds.extX=boundsChecker.Bounds.max_x-boundsChecker.Bounds.min_x;boundsChecker.Bounds.extY=boundsChecker.Bounds.max_y-boundsChecker.Bounds.min_y;return boundsChecker.Bounds}}function SplineForDrawer(spline){this.spline=spline;this.pen=spline.pen;this.brush=spline.brush;this.TransformMatrix=spline.TransformMatrix;this.Matrix=spline.Matrix;this.Draw=function(graphics){graphics.SetIntegerGrid(false); graphics.transform3(this.Matrix);var shape_drawer=new AscCommon.CShapeDrawer;shape_drawer.fromShape(this,graphics);shape_drawer.draw(this)};this.draw=function(g){g._e();for(var i=0;i<this.spline.path.length;++i){var lastX,lastY;switch(this.spline.path[i].id){case 0:{g._m(this.spline.path[i].x,this.spline.path[i].y);lastX=this.spline.path[i].x;lastY=this.spline.path[i].y;break}case 1:{g._l(this.spline.path[i].x,this.spline.path[i].y);lastX=this.spline.path[i].x;lastY=this.spline.path[i].y;break}case 2:{g._c(this.spline.path[i].x1, this.spline.path[i].y1,this.spline.path[i].x2,this.spline.path[i].y2,this.spline.path[i].x3,this.spline.path[i].y3);lastX=this.spline.path[i].x3;lastY=this.spline.path[i].y3;break}}}g.ds()}}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].SplineCommandMoveTo=SplineCommandMoveTo;window["AscFormat"].SplineCommandLineTo=SplineCommandLineTo;window["AscFormat"].SplineCommandBezier=SplineCommandBezier;window["AscFormat"].Spline=Spline})(window);"use strict";(function(){function CConnectorTrack(oConnector, oBeginTrack,oEndTrack,oBeginShape,oEndShape){this.originalObject=oConnector;this.beginTrack=oBeginTrack;this.endTrack=oEndTrack;this.beginShape=oBeginShape;this.endShape=oEndShape;this.startX=this.originalObject.transform.TransformPointX(0,0);this.startY=this.originalObject.transform.TransformPointY(0,0);if(this.originalObject.group);this.endX=this.originalObject.transform.TransformPointX(this.originalObject.extX,this.originalObject.extY);this.endY=this.originalObject.transform.TransformPointY(this.originalObject.extX, this.originalObject.extY);this.oSpPr=AscFormat.ExecuteNoHistory(function(){return oConnector.spPr.createDuplicate()},this,[]);AscFormat.XYAdjustmentTrack.call(this,oConnector,-1,false)}CConnectorTrack.prototype=Object.create(AscFormat.XYAdjustmentTrack.prototype);CConnectorTrack.prototype.track=function(){AscFormat.ExecuteNoHistory(function(){return this.track_()},this,[])};CConnectorTrack.prototype.track_=function(){var oConnectorInfo=this.originalObject.nvSpPr.nvUniSpPr;var _rot,track_bounds,g_conn_info, oConnectionObject,_flipH,_flipV,_bounds,_transform;var _startConnectionParams=null;var _endConnectionParams=null;var _group=null;if(this.originalObject.group)_group=this.originalObject.group;if(this.beginTrack){track_bounds=this.convertTrackBounds(this.beginTrack.getBounds());_rot=AscFormat.isRealNumber(this.beginTrack.angle)?this.beginTrack.angle:this.beginTrack.originalObject.rot;_flipH=AscFormat.isRealBool(this.beginTrack.resizedflipH)?this.beginTrack.resizedflipH:this.beginTrack.originalObject.flipH; _flipV=AscFormat.isRealBool(this.beginTrack.resizedflipV)?this.beginTrack.resizedflipV:this.beginTrack.originalObject.flipV;if(this.beginTrack.originalObject.group){_rot=AscFormat.normalizeRotate(this.beginTrack.originalObject.group.getFullRotate()+_rot);if(this.beginTrack.originalObject.group.getFullFlipH())_flipH=!_flipH;if(this.beginTrack.originalObject.group.getFullFlipV())_flipV=!_flipV}_bounds=track_bounds;_transform=this.beginTrack.overlayObject.TransformMatrix;oConnectionObject=this.beginTrack.overlayObject.geometry.cnxLst[oConnectorInfo.stCnxIdx]; g_conn_info={idx:oConnectorInfo.stCnxIdx,ang:oConnectionObject.ang,x:oConnectionObject.x,y:oConnectionObject.y};_startConnectionParams=this.originalObject.convertToConnectionParams(_rot,_flipH,_flipV,_transform,_bounds,g_conn_info)}if(this.endTrack){track_bounds=this.convertTrackBounds(this.endTrack.getBounds());_rot=AscFormat.isRealNumber(this.endTrack.angle)?this.endTrack.angle:this.endTrack.originalObject.rot;_flipH=AscFormat.isRealBool(this.endTrack.resizedflipH)?this.endTrack.resizedflipH:this.endTrack.originalObject.flipH; _flipV=AscFormat.isRealBool(this.endTrack.resizedflipV)?this.endTrack.resizedflipV:this.endTrack.originalObject.flipV;if(this.endTrack.originalObject.group){_rot=AscFormat.normalizeRotate(this.endTrack.originalObject.group.getFullRotate()+_rot);if(this.endTrack.originalObject.group.getFullFlipH())_flipH=!_flipH;if(this.endTrack.originalObject.group.getFullFlipV())_flipV=!_flipV}_bounds=track_bounds;_transform=this.endTrack.overlayObject.TransformMatrix;oConnectionObject=this.endTrack.overlayObject.geometry.cnxLst[oConnectorInfo.endCnxIdx]; g_conn_info={idx:oConnectorInfo.endCnxIdx,ang:oConnectionObject.ang,x:oConnectionObject.x,y:oConnectionObject.y};_endConnectionParams=this.originalObject.convertToConnectionParams(_rot,_flipH,_flipV,_transform,_bounds,g_conn_info)}if(_startConnectionParams||_endConnectionParams){var bMoveInGroup=false;if(!_startConnectionParams){if(this.beginShape&&oConnectorInfo.stCnxIdx!==null)_startConnectionParams=this.beginShape.getConnectionParams(oConnectorInfo.stCnxIdx,null);else if(this.endTrack instanceof AscFormat.MoveShapeImageTrack){var _dx,_dy;if(this.originalObject.group){bMoveInGroup=true;var _oCopyMatrix=this.originalObject.group.invertTransform.CreateDublicate();_oCopyMatrix.tx=0;_oCopyMatrix.ty=0;_dx=_oCopyMatrix.TransformPointX(this.endTrack.lastDx,this.endTrack.lastDy);_dy=_oCopyMatrix.TransformPointY(this.endTrack.lastDx,this.endTrack.lastDy)}else{_dx=this.endTrack.lastDx;_dy=this.endTrack.lastDy}this.oSpPr=AscFormat.ExecuteNoHistory(function(){return this.originalObject.spPr.createDuplicate()}, this,[]);this.oSpPr.xfrm.offX+=_dx;this.oSpPr.xfrm.offY+=_dy;this.geometry=this.oSpPr.geometry;this.overlayObject.geometry=this.geometry;this.calculateTransform();return}if(!_startConnectionParams)_startConnectionParams=AscFormat.fCalculateConnectionInfo(_endConnectionParams,this.startX,this.startY)}if(!_endConnectionParams){if(this.endShape&&oConnectorInfo.endCnxIdx!==null)_endConnectionParams=this.endShape.getConnectionParams(oConnectorInfo.endCnxIdx,null);else if(this.beginTrack instanceof AscFormat.MoveShapeImageTrack){var _dx, _dy;if(this.originalObject.group){bMoveInGroup=true;var _oCopyMatrix=this.originalObject.group.invertTransform.CreateDublicate();_oCopyMatrix.tx=0;_oCopyMatrix.ty=0;_dx=_oCopyMatrix.TransformPointX(this.beginTrack.lastDx,this.beginTrack.lastDy);_dy=_oCopyMatrix.TransformPointY(this.beginTrack.lastDx,this.beginTrack.lastDy)}else{_dx=this.beginTrack.lastDx;_dy=this.beginTrack.lastDy}this.oSpPr=AscFormat.ExecuteNoHistory(function(){return this.originalObject.spPr.createDuplicate()},this,[]);this.oSpPr.xfrm.offX+= _dx;this.oSpPr.xfrm.offY+=_dy;this.geometry=this.oSpPr.geometry;this.overlayObject.geometry=this.geometry;if(!this.originalObject.group||bMoveInGroup){this.oSpPr.xfrm.setOffX(this.oSpPr.xfrm.offX);this.oSpPr.xfrm.setOffY(this.oSpPr.xfrm.offY);this.oSpPr.xfrm.setFlipH(this.oSpPr.xfrm.flipH);this.oSpPr.xfrm.setFlipV(this.oSpPr.xfrm.flipV);this.oSpPr.xfrm.setRot(this.oSpPr.xfrm.rot)}else{var _xc=this.oSpPr.xfrm.offX+this.oSpPr.xfrm.extX/2;var _yc=this.oSpPr.xfrm.offY+this.oSpPr.xfrm.extY/2;var xc=this.originalObject.group.invertTransform.TransformPointX(_xc, _yc);var yc=this.originalObject.group.invertTransform.TransformPointY(_xc,_yc);this.oSpPr.xfrm.setOffX(xc-this.oSpPr.xfrm.extX/2);this.oSpPr.xfrm.setOffY(yc-this.oSpPr.xfrm.extY/2);this.oSpPr.xfrm.setFlipH(this.originalObject.group.getFullFlipH()?!this.oSpPr.xfrm.flipH:this.oSpPr.xfrm.flipH);this.oSpPr.xfrm.setFlipV(this.originalObject.group.getFullFlipV()?!this.oSpPr.xfrm.flipV:this.oSpPr.xfrm.flipV);this.oSpPr.xfrm.setRot(AscFormat.normalizeRotate(this.oSpPr.xfrm.rot-this.originalObject.group.getFullRotate()))}this.calculateTransform(); return}if(!_endConnectionParams)_endConnectionParams=AscFormat.fCalculateConnectionInfo(_startConnectionParams,this.endX,this.endY)}this.oSpPr=AscFormat.fCalculateSpPr(_startConnectionParams,_endConnectionParams,this.originalObject.spPr.geometry.preset,this.overlayObject.pen.w);if(!this.originalObject.group){this.oSpPr.xfrm.setOffX(this.oSpPr.xfrm.offX);this.oSpPr.xfrm.setOffY(this.oSpPr.xfrm.offY);this.oSpPr.xfrm.setFlipH(this.oSpPr.xfrm.flipH);this.oSpPr.xfrm.setFlipV(this.oSpPr.xfrm.flipV);this.oSpPr.xfrm.setRot(this.oSpPr.xfrm.rot)}else{var _xc= this.oSpPr.xfrm.offX+this.oSpPr.xfrm.extX/2;var _yc=this.oSpPr.xfrm.offY+this.oSpPr.xfrm.extY/2;var xc=this.originalObject.group.invertTransform.TransformPointX(_xc,_yc);var yc=this.originalObject.group.invertTransform.TransformPointY(_xc,_yc);this.oSpPr.xfrm.setOffX(xc-this.oSpPr.xfrm.extX/2);this.oSpPr.xfrm.setOffY(yc-this.oSpPr.xfrm.extY/2);this.oSpPr.xfrm.setFlipH(this.originalObject.group.getFullFlipH()?!this.oSpPr.xfrm.flipH:this.oSpPr.xfrm.flipH);this.oSpPr.xfrm.setFlipV(this.originalObject.group.getFullFlipV()? !this.oSpPr.xfrm.flipV:this.oSpPr.xfrm.flipV);this.oSpPr.xfrm.setRot(AscFormat.normalizeRotate(this.oSpPr.xfrm.rot-this.originalObject.group.getFullRotate()))}this.geometry=this.oSpPr.geometry;this.overlayObject.geometry=this.geometry;this.calculateTransform()}};CConnectorTrack.prototype.calculateTransform=function(){this.geometry.Recalculate(this.oSpPr.xfrm.extX,this.oSpPr.xfrm.extY);var _transform=this.transform;_transform.Reset();var _horizontal_center=this.oSpPr.xfrm.extX*.5;var _vertical_center= this.oSpPr.xfrm.extY*.5;global_MatrixTransformer.TranslateAppend(_transform,-_horizontal_center,-_vertical_center);if(this.oSpPr.xfrm.flipH)global_MatrixTransformer.ScaleAppend(_transform,-1,1);if(this.oSpPr.xfrm.flipV)global_MatrixTransformer.ScaleAppend(_transform,1,-1);global_MatrixTransformer.RotateRadAppend(_transform,-(AscFormat.isRealNumber(this.oSpPr.xfrm.rot)?this.oSpPr.xfrm.rot:0));global_MatrixTransformer.TranslateAppend(_transform,this.oSpPr.xfrm.offX,this.oSpPr.xfrm.offY);global_MatrixTransformer.TranslateAppend(_transform, _horizontal_center,_vertical_center);if(this.originalObject.group)global_MatrixTransformer.MultiplyAppend(_transform,this.originalObject.group.transform)};CConnectorTrack.prototype.trackEnd=function(){var _xfrm=this.originalObject.spPr.xfrm;var _xfrm2=this.oSpPr.xfrm;_xfrm.setOffX(_xfrm2.offX);_xfrm.setOffY(_xfrm2.offY);_xfrm.setExtX(_xfrm2.extX);_xfrm.setExtY(_xfrm2.extY);_xfrm.setFlipH(_xfrm2.flipH);_xfrm.setFlipV(_xfrm2.flipV);_xfrm.setRot(_xfrm2.rot);this.originalObject.spPr.setGeometry(this.oSpPr.geometry.createDuplicate()); this.originalObject.checkDrawingBaseCoords()};CConnectorTrack.prototype.convertTrackBounds=function(trackBounds){return new AscFormat.CGraphicBounds(trackBounds.min_x,trackBounds.min_y,trackBounds.max_x,trackBounds.max_y)};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CConnectorTrack=CConnectorTrack})();"use strict";(function(window,undefined){var HANDLE_EVENT_MODE_HANDLE=AscFormat.HANDLE_EVENT_MODE_HANDLE;function CheckCoordsNeedPage(x,y,pageIndex,needPageIndex,drawingDocument){if(pageIndex=== needPageIndex)return{x:x,y:y};else{var t=drawingDocument.ConvertCoordsToAnotherPage(x,y,pageIndex,needPageIndex);return{x:t.X,y:t.Y}}}function handleSelectedObjects(drawingObjectsController,e,x,y,group,pageIndex,bWord){if(drawingObjectsController.isSlideShow())return false;var selected_objects=group?group.selectedObjects:drawingObjectsController.getSelectedObjects();var oCropSelection=drawingObjectsController.selection.cropSelection?drawingObjectsController.selection.cropSelection:null;var tx,ty, t,hit_to_handles;var ret=null;var drawing=null;if(oCropSelection&&!window["IS_NATIVE_EDITOR"]){var oCropObject=oCropSelection.getCropObject();if(oCropObject){if(bWord&&pageIndex!==oCropSelection.selectStartPage){t=drawingObjectsController.drawingDocument.ConvertCoordsToAnotherPage(x,y,pageIndex,oCropSelection.selectStartPage);tx=t.X;ty=t.Y}else{tx=x;ty=y}hit_to_handles=oCropSelection.hitToHandles(tx,ty);if(hit_to_handles>-1){ret=drawingObjectsController.handleHandleHit(hit_to_handles,oCropSelection, group);drawing=oCropSelection}if(!ret)if(oCropSelection.hitInBoundingRect(tx,ty))ret=drawingObjectsController.handleMoveHit(oCropSelection,e,tx,ty,group,true,oCropSelection.selectStartPage,true);var oldSelectedObjects;if(group){oldSelectedObjects=group.selectedObjects;group.selectedObjects=[oCropObject]}else{oldSelectedObjects=drawingObjectsController.selectedObjects;drawingObjectsController.selectedObjects=[oCropObject]}if(!ret){hit_to_handles=oCropObject.hitToHandles(tx,ty);if(hit_to_handles>-1){ret= drawingObjectsController.handleHandleHit(hit_to_handles,oCropObject,group);drawing=oCropObject}}if(!ret)if(oCropObject.hitInBoundingRect(tx,ty))ret=drawingObjectsController.handleMoveHit(oCropObject,e,tx,ty,group,true,oCropSelection.selectStartPage,true);if(!ret)if(oCropSelection.hit(tx,ty))ret=drawingObjectsController.handleMoveHit(oCropObject,e,tx,ty,group,true,oCropSelection.selectStartPage,true);if(!ret)if(oCropObject.hit(tx,ty))ret=drawingObjectsController.handleMoveHit(oCropObject,e,tx,ty,group, true,oCropSelection.selectStartPage,true);if(group)group.selectedObjects=oldSelectedObjects;else drawingObjectsController.selectedObjects=oldSelectedObjects}}if(!ret)if(selected_objects.length===1){if(window["IS_NATIVE_EDITOR"]&&e.ClickCount>1)if(selected_objects[0].getObjectType()===AscDFH.historyitem_type_Shape)return null;if(bWord&&pageIndex!==selected_objects[0].selectStartPage){t=drawingObjectsController.drawingDocument.ConvertCoordsToAnotherPage(x,y,pageIndex,selected_objects[0].selectStartPage); tx=t.X;ty=t.Y}else{tx=x;ty=y}if(selected_objects[0].canChangeAdjustments()){var hit_to_adj=selected_objects[0].hitToAdjustment(tx,ty);if(hit_to_adj.hit){ret=drawingObjectsController.handleAdjustmentHit(hit_to_adj,selected_objects[0],group,pageIndex);drawing=selected_objects[0]}}}if(!ret)for(var i=selected_objects.length-1;i>-1;--i){if(bWord&&pageIndex!==selected_objects[i].selectStartPage){t=drawingObjectsController.drawingDocument.ConvertCoordsToAnotherPage(x,y,pageIndex,selected_objects[i].selectStartPage); tx=t.X;ty=t.Y}else{tx=x;ty=y}if(selected_objects[i].getObjectType()===AscDFH.historyitem_type_ChartSpace){ret=handleInternalChart(selected_objects[i],drawingObjectsController,e,tx,ty,group,pageIndex,bWord);if(ret){drawing=selected_objects[i];break}}if(!ret){hit_to_handles=selected_objects[i].hitToHandles(tx,ty);if(hit_to_handles>-1){if(window["IS_NATIVE_EDITOR"]&&e.ClickCount>1)if(selected_objects[i].getObjectType()===AscDFH.historyitem_type_Shape)return null;ret=drawingObjectsController.handleHandleHit(hit_to_handles, selected_objects[i],group);drawing=selected_objects[i];break}}}if(!ret)for(i=selected_objects.length-1;i>-1;--i){if(bWord&&pageIndex!==selected_objects[i].selectStartPage){t=drawingObjectsController.drawingDocument.ConvertCoordsToAnotherPage(x,y,pageIndex,selected_objects[i].selectStartPage);tx=t.X;ty=t.Y}else{tx=x;ty=y}if(selected_objects[i].getObjectType()===AscDFH.historyitem_type_ChartSpace){ret=handleInternalChart(selected_objects[i],drawingObjectsController,e,tx,ty,group,pageIndex,bWord);drawing= selected_objects[i]}if(!ret)if(selected_objects[i].hitInBoundingRect(tx,ty)){if(window["IS_NATIVE_EDITOR"])if(selected_objects[i]===AscFormat.getTargetTextObject(drawingObjectsController))return null;if(bWord&&selected_objects[i].parent&&selected_objects[i].parent.Is_Inline())ret=handleInlineHitNoText(selected_objects[i],drawingObjectsController,e,tx,ty,pageIndex,true);else ret=drawingObjectsController.handleMoveHit(selected_objects[i],e,tx,ty,group,true,selected_objects[i].selectStartPage,true)}if(ret){drawing= selected_objects[i];break}}if(ret&&drawing)if(drawingObjectsController.handleEventMode===AscFormat.HANDLE_EVENT_MODE_CURSOR&&drawingObjectsController&&drawingObjectsController.drawingObjects&&drawingObjectsController.drawingObjects.cSld)if(drawing.Lock.Is_Locked()){var MMData=new AscCommon.CMouseMoveData;var Coords=drawingObjectsController.getDrawingDocument().ConvertCoordsToCursorWR(drawing.bounds.x,drawing.bounds.y,pageIndex,null);MMData.X_abs=Coords.X-5;MMData.Y_abs=Coords.Y;MMData.Type=Asc.c_oAscMouseMoveDataTypes.LockedObject; MMData.UserId=drawing.Lock.Get_UserId();MMData.HaveChanges=drawing.Lock.Have_Changes();editor.sync_MouseMoveCallback(MMData)}return ret}function handleFloatObjects(drawingObjectsController,drawingArr,e,x,y,group,pageIndex,bWord){var ret=null,drawing;for(var i=drawingArr.length-1;i>-1;--i){drawing=drawingArr[i];switch(drawing.getObjectType()){case AscDFH.historyitem_type_SlicerView:{ret=handleSlicer(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord);break}case AscDFH.historyitem_type_Shape:case AscDFH.historyitem_type_ImageShape:case AscDFH.historyitem_type_OleObject:case AscDFH.historyitem_type_Cnx:case AscDFH.historyitem_type_LockedCanvas:{ret= handleShapeImage(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord);break}case AscDFH.historyitem_type_ChartSpace:{ret=handleChart(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord);break}case AscDFH.historyitem_type_GroupShape:{ret=handleGroup(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord);break}case AscDFH.historyitem_type_GraphicFrame:{ret=!drawingObjectsController.isSlideShow()&&handleFloatTable(drawing,drawingObjectsController,e,x,y,group,pageIndex);break}}if(ret){if(drawingObjectsController.handleEventMode=== AscFormat.HANDLE_EVENT_MODE_CURSOR&&drawingObjectsController&&drawingObjectsController.drawingObjects&&drawingObjectsController.drawingObjects.cSld)if(drawing.Lock.Is_Locked()){var MMData=new AscCommon.CMouseMoveData;var Coords=drawingObjectsController.getDrawingDocument().ConvertCoordsToCursorWR(drawing.bounds.x,drawing.bounds.y,pageIndex,null);MMData.X_abs=Coords.X-5;MMData.Y_abs=Coords.Y;MMData.Type=Asc.c_oAscMouseMoveDataTypes.LockedObject;MMData.UserId=drawing.Lock.Get_UserId();MMData.HaveChanges= drawing.Lock.Have_Changes();editor.sync_MouseMoveCallback(MMData)}return ret}}return ret}function handleSlicer(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord){if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){var bRet=drawing.onMouseDown(e,x,y);if(!bRet)return handleShapeImage(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord);else drawingObjectsController.changeCurrentState(new AscFormat.SlicerState(drawingObjectsController,drawing));return bRet}else{var oCursorInfo= drawing.getCursorInfo(e,x,y);if(oCursorInfo)return oCursorInfo;return handleShapeImage(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord)}}function handleSlicerInGroup(drawingObjectsController,drawing,shape,e,x,y,pageIndex,bWord){if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){var bRet=shape.onMouseDown(e,x,y);if(!bRet)return handleShapeImageInGroup(drawingObjectsController,drawing,shape,e,x,y,pageIndex,bWord);else drawingObjectsController.changeCurrentState(new AscFormat.SlicerState(drawingObjectsController, shape));return bRet}else{var oCursorInfo=shape.getCursorInfo(e,x,y);if(oCursorInfo)return oCursorInfo;return handleShapeImageInGroup(drawingObjectsController,drawing,shape,e,x,y,pageIndex,bWord)}}function handleShapeImage(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord){var hit_in_inner_area=drawing.hitInInnerArea&&drawing.hitInInnerArea(x,y);var hit_in_path=drawing.hitInPath&&drawing.hitInPath(x,y);var hit_in_text_rect=drawing.hitInTextRect&&drawing.hitInTextRect(x,y);if(hit_in_inner_area|| hit_in_path)if(drawingObjectsController.checkDrawingHyperlink){var ret=drawingObjectsController.checkDrawingHyperlink(drawing,e,hit_in_text_rect,x,y,pageIndex);if(ret)return ret}if(window["IS_NATIVE_EDITOR"])if(drawing.getObjectType()===AscDFH.historyitem_type_Shape&&drawing.getDocContent&&drawing.getDocContent())if(e.ClickCount>1&&!e.ShiftKey&&!e.CtrlKey&&(drawingObjectsController.selection.groupSelection&&drawingObjectsController.selection.groupSelection.selectedObjects.length===1||drawingObjectsController.selectedObjects.length=== 1))if(!hit_in_text_rect&&(hit_in_inner_area||hit_in_path)){hit_in_text_rect=true;hit_in_inner_area=false;hit_in_path=false}if(!hit_in_text_rect&&(hit_in_inner_area||hit_in_path)){if(drawingObjectsController.isSlideShow()){var sMediaFile=drawing.getMediaFileName();if(!sMediaFile)return false}return drawingObjectsController.handleMoveHit(drawing,e,x,y,group,false,pageIndex,bWord)}else if(hit_in_text_rect){if(bWord){var all_drawings=drawing.getDocContent().GetAllDrawingObjects();var drawings2=[];for(var i= 0;i<all_drawings.length;++i)drawings2.push(all_drawings[i].GraphicObj);var ret=handleInlineObjects(drawingObjectsController,drawings2,e,x,y,pageIndex,bWord);if(ret)return ret}if(drawingObjectsController.isSlideShow())if(!AscFormat.fCheckObjectHyperlink(drawing,x,y))return false;var oTextObject=AscFormat.getTargetTextObject(drawingObjectsController);if(!e.CtrlKey&&!e.ShiftKey||oTextObject===drawing)return drawingObjectsController.handleTextHit(drawing,e,x,y,group,pageIndex,bWord);else return drawingObjectsController.handleMoveHit(drawing, e,x,y,group,false,pageIndex,bWord)}return false}function handleShapeImageInGroup(drawingObjectsController,drawing,shape,e,x,y,pageIndex,bWord){var hit_in_inner_area=shape.hitInInnerArea&&shape.hitInInnerArea(x,y);var hit_in_path=shape.hitInPath&&shape.hitInPath(x,y);var hit_in_text_rect=shape.hitInTextRect&&shape.hitInTextRect(x,y);var ret;if(hit_in_inner_area||hit_in_path)if(drawingObjectsController.checkDrawingHyperlink){var ret=drawingObjectsController.checkDrawingHyperlink(shape,e,hit_in_text_rect, x,y,pageIndex);if(ret)return ret}if(!hit_in_text_rect&&(hit_in_inner_area||hit_in_path)){if(drawingObjectsController.isSlideShow()){var sMediaFile=drawing.getMediaFileName();if(!sMediaFile)return false}return drawingObjectsController.handleMoveHit(drawing,e,x,y,null,false,pageIndex,true)}else if(hit_in_text_rect){if(bWord){var all_drawings=shape.getDocContent().GetAllDrawingObjects();var drawings2=[];for(var i=0;i<all_drawings.length;++i)drawings2.push(all_drawings[i].GraphicObj);ret=handleInlineObjects(drawingObjectsController, drawings2,e,x,y,pageIndex,true);if(ret)return ret}if(drawingObjectsController.isSlideShow())if(!AscFormat.fCheckObjectHyperlink(drawing,x,y))return false;var oTextObject=AscFormat.getTargetTextObject(drawingObjectsController);if(!e.CtrlKey&&!e.ShiftKey||oTextObject===drawing)return drawingObjectsController.handleTextHit(shape,e,x,y,drawing,pageIndex,bWord);else return drawingObjectsController.handleMoveHit(drawing,e,x,y,null,false,pageIndex,true)}}function handleGroup(drawing,drawingObjectsController, e,x,y,group,pageIndex,bWord){var grouped_objects=drawing.getArrGraphicObjects();var ret;for(var j=grouped_objects.length-1;j>-1;--j){var cur_grouped_object=grouped_objects[j];switch(cur_grouped_object.getObjectType()){case AscDFH.historyitem_type_SlicerView:{ret=handleSlicerInGroup(drawingObjectsController,drawing,cur_grouped_object,e,x,y,pageIndex,bWord);if(ret)return ret;break}case AscDFH.historyitem_type_Shape:case AscDFH.historyitem_type_ImageShape:case AscDFH.historyitem_type_OleObject:case AscDFH.historyitem_type_Cnx:case AscDFH.historyitem_type_LockedCanvas:{ret= handleShapeImageInGroup(drawingObjectsController,drawing,cur_grouped_object,e,x,y,pageIndex,bWord);if(ret)return ret;break}case AscDFH.historyitem_type_ChartSpace:{if(!drawingObjectsController.isSlideShow()){var ret,i,title;if(cur_grouped_object.hit(x,y)){var chart_titles=cur_grouped_object.getAllTitles();for(i=0;i<chart_titles.length;++i){title=chart_titles[i];var hit_in_inner_area=title.hitInInnerArea(x,y);var hit_in_path=title.hitInPath(x,y);var hit_in_text_rect=title.hitInTextRect(x,y);if(hit_in_inner_area&& !hit_in_text_rect||hit_in_path)if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();drawingObjectsController.resetSelection();drawingObjectsController.selectObject(drawing,pageIndex);drawingObjectsController.selection.groupSelection=drawing;drawing.selectObject(cur_grouped_object,pageIndex);drawing.chartSelection=cur_grouped_object;drawing.selection.title=title;cur_grouped_object.selectTitle(title,pageIndex);drawingObjectsController.updateSelectionState(); return true}else return{objectId:drawing.Get_Id(),cursorType:"move",bMarker:false};else if(hit_in_text_rect)if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();drawingObjectsController.resetSelection();drawingObjectsController.selectObject(drawing,pageIndex);drawingObjectsController.selection.groupSelection=drawing;drawing.selectObject(cur_grouped_object,pageIndex);drawing.selection.chartSelection=cur_grouped_object;cur_grouped_object.selectTitle(title, pageIndex);cur_grouped_object.selection.textSelection=title;title.selectionSetStart(e,x,y,pageIndex);drawingObjectsController.changeCurrentState(new AscFormat.TextAddState(drawingObjectsController,title,x,y));if(e.ClickCount<=1)drawingObjectsController.updateSelectionState();return true}else{if(drawingObjectsController.document){var content=title.getDocContent();var invert_transform_text=title.invertTransformText,tx,ty;if(content&&invert_transform_text){tx=invert_transform_text.TransformPointX(x, y);ty=invert_transform_text.TransformPointY(x,y);content.UpdateCursorType(tx,ty,0)}}return{objectId:drawing.Get_Id(),cursorType:"text"}}}}}ret=handleShapeImageInGroup(drawingObjectsController,drawing,cur_grouped_object,e,x,y,pageIndex,bWord);if(ret)return ret;break}}}return false}function handleChartElements(drawing,drawingObjectsController,e,dTx,dTy,group,pageIndex,bWord){var selector=group?group:drawingObjectsController;var bSeries=false;if(drawing.chartObj){var t=drawing.chartObj;var sortCharts= t._sortChartsForDrawing(drawing);var oCanvas=drawing.getCanvasContext();if(!Array.isArray(t.chart.sortZIndexPaths)||t.chart.sortZIndexPaths.length===0)for(var j=sortCharts.length-1;j>-1;j--){var id=sortCharts[j];var chartModel=t._getChartModelById(drawing.chart.plotArea,id);if(!chartModel)continue;var oDrawChart=t.charts[id];var pointsPaths=oDrawChart.paths.points;if(Array.isArray(pointsPaths)){for(var k=pointsPaths.length-1;k>-1;--k)if(Array.isArray(pointsPaths[k])){var aPointsPaths=pointsPaths[k]; for(var l=0;l<aPointsPaths.length;++l)if(AscCommon.isRealObject(aPointsPaths[l])){if(AscFormat.isRealNumber(aPointsPaths[l].path)){var oPath=drawing.pathMemory.GetPath(aPointsPaths[l].path);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))bSeries=true}if(bSeries){if(drawing.selection.chart===id&&drawing.selection.series===k){selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series= k;drawing.selection.markers=true;drawing.selection.datPoint=l}else{selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=k;drawing.selection.markers=true;drawing.selection.datPoint=null}break}}if(l<aPointsPaths.length)break}if(k>-1)break}var seriesPaths=oDrawChart.paths.series;var bPie=chartModel.getObjectType()===AscDFH.historyitem_type_PieChart;if(Array.isArray(seriesPaths)){for(var k=seriesPaths.length- 1;k>-1;--k)if(Array.isArray(seriesPaths[k])){var aPointsPaths=seriesPaths[k];for(var l=0;l<aPointsPaths.length;++l){if(AscFormat.isRealNumber(aPointsPaths[l])){var oPath=drawing.pathMemory.GetPath(aPointsPaths[l]);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy)){bSeries=true;if(bPie)if(drawing.selection.series===0){selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series= 0;drawing.selection.datPoint=k}else{selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=0;drawing.selection.datPoint=null}else if(drawing.selection.chart===id&&drawing.selection.series===k){selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=k;drawing.selection.datPoint=l}else{selector.resetSelection(); selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=k;drawing.selection.datPoint=null}break}}if(Array.isArray(aPointsPaths[l])){var aPointsPaths2=aPointsPaths[l];for(var z=0;z<aPointsPaths2.length;++z)if(AscFormat.isRealNumber(aPointsPaths2[z])){var oPath=drawing.pathMemory.GetPath(aPointsPaths2[z]);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy)){bSeries=true;if(bPie)if(drawing.selection.series=== 0){selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=0;drawing.selection.datPoint=k}else{selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=0;drawing.selection.datPoint=null}else if(drawing.selection.chart===id&&drawing.selection.series===k){selector.resetSelection();selector.selectObject(drawing, pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=k;drawing.selection.datPoint=l}else{selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=k;drawing.selection.datPoint=null}break}}if(z<aPointsPaths2.length)break}else if(AscCommon.isRealObject(aPointsPaths[l])){if(AscFormat.isRealNumber(aPointsPaths[l].upPath)){var oPath=drawing.pathMemory.GetPath(aPointsPaths[l].upPath); if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))bSeries=true}var aFrontPaths=aPointsPaths[l].frontPath||aPointsPaths[l].frontPaths;if(!bSeries&&Array.isArray(aFrontPaths))for(var s=0;s<aFrontPaths.length;++s)if(AscFormat.isRealNumber(aFrontPaths[s])){var oPath=drawing.pathMemory.GetPath(aFrontPaths[s]);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy)){bSeries=true;break}}aFrontPaths=aPointsPaths[l].darkPaths;if(!bSeries&&Array.isArray(aFrontPaths))for(var s= 0;s<aFrontPaths.length;++s)if(AscFormat.isRealNumber(aFrontPaths[s])){var oPath=drawing.pathMemory.GetPath(aFrontPaths[s]);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy)){bSeries=true;break}}if(bSeries){if(bPie)if(drawing.selection.series===0){selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=0;drawing.selection.datPoint=k}else{selector.resetSelection();selector.selectObject(drawing, pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=0;drawing.selection.datPoint=null}else if(drawing.selection.chart===id&&drawing.selection.series===k){selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=k;drawing.selection.datPoint=l}else{selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection= drawing;drawing.selection.chart=id;drawing.selection.series=k;drawing.selection.datPoint=null}break}}}if(l<aPointsPaths.length)break}else if(AscFormat.isRealNumber(seriesPaths[k])){var oPath=drawing.pathMemory.GetPath(seriesPaths[k]);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)){bSeries=true;if(bPie)if(drawing.selection.series===0){selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=0;drawing.selection.datPoint= k}else{selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.series=0;drawing.selection.datPoint=null}else{selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.plotArea=null;drawing.selection.chart=id;drawing.selection.series=k;drawing.selection.datPoint=null}break}}if(k>-1)break}else if(chartModel.getObjectType()===AscDFH.historyitem_type_StockChart){seriesPaths= oDrawChart.paths.values;if(Array.isArray(seriesPaths))for(var k=0;k<seriesPaths.length;++k){if(AscFormat.isRealNumber(seriesPaths[k].upBars)){var oPath=drawing.pathMemory.GetPath(seriesPaths[k].upBars);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))if(chartModel&&chartModel.upDownBars&&chartModel.upDownBars.upBars){bSeries=true;selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.upBars= chartModel.upDownBars.upBars;break}}else if(AscFormat.isRealNumber(seriesPaths[k].downBars)){var oPath=drawing.pathMemory.GetPath(seriesPaths[k].downBars);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))if(chartModel&&chartModel.upDownBars&&chartModel.upDownBars.downBars){bSeries=true;selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.downBars=chartModel.upDownBars.downBars; break}}if(!bSeries&&AscFormat.isRealNumber(seriesPaths[k].lowLines)){var oPath=drawing.pathMemory.GetPath(seriesPaths[k].lowLines);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))if(chartModel&&chartModel.hiLowLines){bSeries=true;selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.hiLowLines=chartModel.hiLowLines;break}var oPath=drawing.pathMemory.GetPath(seriesPaths[k].highLines); if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))if(chartModel&&chartModel.hiLowLines){bSeries=true;selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=id;drawing.selection.hiLowLines=chartModel.hiLowLines;break}}}}}else for(var i=t.chart.sortZIndexPaths.length-1;i>-1;i--){var oPathsObject=t.chart.sortZIndexPaths[i];if(AscFormat.isRealNumber(t.chart.sortZIndexPaths[i].paths)){var oPath=drawing.pathMemory.GetPath(t.chart.sortZIndexPaths[i].paths); if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))bSeries=true}else{if(!bSeries&&AscFormat.isRealNumber(t.chart.sortZIndexPaths[i].frontPaths)){var oPath=drawing.pathMemory.GetPath(t.chart.sortZIndexPaths[i].frontPaths);if(oPath.hitInInnerArea(oCanvas,dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))bSeries=true}if(!bSeries&&AscFormat.isRealNumber(t.chart.sortZIndexPaths[i].darkPaths)){var oPath=drawing.pathMemory.GetPath(t.chart.sortZIndexPaths[i].darkPaths);if(oPath.hitInInnerArea(oCanvas, dTx,dTy)||oPath.hitInPath(oCanvas,dTx,dTy))bSeries=true}}if(bSeries){if(drawing.selection.chart===t.chart.chart.Id&&drawing.selection.series===t.chart.sortZIndexPaths[i].seria){selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=t.chart.chart.Id;drawing.selection.series=t.chart.sortZIndexPaths[i].seria;drawing.selection.datPoint=t.chart.sortZIndexPaths[i].point}else{selector.resetSelection();selector.selectObject(drawing, pageIndex);selector.selection.chartSelection=drawing;drawing.selection.chart=t.chart.chart.Id;drawing.selection.series=t.chart.sortZIndexPaths[i].seria;drawing.selection.datPoint=null}break}}if(!bSeries){j=0;if(Array.isArray(t.catAxisChart))for(j=0;j<t.catAxisChart.length;++j){var oAxObj=t.catAxisChart[j];if(oAxObj&&oAxObj.paths){if(oAxObj.catAx&&oAxObj.catAx.compiledMajorGridLines&&oAxObj.catAx.compiledMajorGridLines.isVisible()&&AscFormat.isRealNumber(oAxObj.paths.gridLines)){var oPath=drawing.pathMemory.GetPath(oAxObj.paths.gridLines); if(oPath.hitInPath(oCanvas,dTx,dTy)){bSeries=true;selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.axis=oAxObj.catAx;drawing.selection.majorGridlines=true;break}}if(!bSeries&&oAxObj.catAx&&oAxObj.catAx.compiledMinorGridLines&&oAxObj.catAx.compiledMinorGridLines.isVisible()&&AscFormat.isRealNumber(oAxObj.paths.minorGridLines)){var oPath=drawing.pathMemory.GetPath(oAxObj.paths.minorGridLines);if(oPath.hitInPath(oCanvas,dTx, dTy)){bSeries=true;selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.axis=oAxObj.catAx;drawing.selection.minorGridlines=true;break}}}}if(!Array.isArray(t.catAxisChart)||j===t.catAxisChart.length)if(Array.isArray(t.valAxisChart))for(j=0;j<t.valAxisChart.length;++j){var oAxObj=t.valAxisChart[j];if(oAxObj&&oAxObj.paths){if(oAxObj.valAx.compiledMajorGridLines&&oAxObj.valAx.compiledMajorGridLines.isVisible()&&AscFormat.isRealNumber(oAxObj.paths.gridLines)){var oPath= drawing.pathMemory.GetPath(oAxObj.paths.gridLines);if(oPath.hitInPath(oCanvas,dTx,dTy)){bSeries=true;selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.axis=oAxObj.valAx;drawing.selection.majorGridlines=true;break}}if(!bSeries&&oAxObj.valAx.compiledMinorGridLines&&oAxObj.valAx.compiledMinorGridLines.isVisible()&&AscFormat.isRealNumber(oAxObj.paths.minorGridLines)){var oPath=drawing.pathMemory.GetPath(oAxObj.paths.minorGridLines); if(oPath.hitInPath(oCanvas,dTx,dTy)){bSeries=true;selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.axis=oAxObj.valAx;drawing.selection.minorGridlines=true;break}}}}}}return bSeries}function handleInternalChart(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord){if(e.CtrlKey||e.Button===AscCommon.g_mouse_button_right&&drawingObjectsController.selectedObjects.length>1)return false;var ret=false,i,title,hit_to_handles; var bIsMobileVersion=oApi&&oApi.isMobileVersion;if(drawing.hit(x,y)){var bClickFlag=!window["IS_NATIVE_EDITOR"]&&(drawingObjectsController.handleEventMode===AscFormat.HANDLE_EVENT_MODE_CURSOR||e.ClickCount<2);var selector=group?group:drawingObjectsController;var legend=drawing.getLegend();if(legend&&(legend.hit(x,y)||drawing.selection.legend===legend&&!AscFormat.isRealNumber(drawing.selection.legendEntry)&&(legend.hitInBoundingRect(x,y)||legend.hitToHandles(x,y)>-1))&&bClickFlag)if(drawing.selection.legend!== legend)if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.legend=legend;drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(legend,drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController, x,y,false,false,drawing,true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"move",bMarker:false};else{if(!AscFormat.isRealNumber(drawing.selection.legendEntry)){hit_to_handles=legend.hitToHandles(x,y);if(hit_to_handles>-1)if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.arrPreTrackObjects.length=0;var oTrack=new AscFormat.ResizeTrackShapeImage(legend, legend.getCardDirectionByNum(hit_to_handles),drawingObjectsController);oTrack.chartSpace=drawing;drawingObjectsController.arrPreTrackObjects.push(oTrack);legend.selectStartPage=drawing.selectStartPage;drawingObjectsController.changeCurrentState(new AscFormat.PreResizeState(drawingObjectsController,legend,legend.getCardDirectionByNum(hit_to_handles)));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else{var card_direction=legend.getCardDirectionByNum(hit_to_handles); return{objectId:drawing.Get_Id(),cursorType:AscFormat.CURSOR_TYPES_BY_CARD_DIRECTION[card_direction],bMarker:true}}if(legend.hitInBoundingRect(x,y))if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.legend=legend;drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(legend, drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController,x,y,false,false,drawing,true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"move",title:null}}var aCalcEntries=legend.calcEntryes;for(var i=0;i<aCalcEntries.length;++i)if(aCalcEntries[i].hit(x,y))if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection(); selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.legend=legend;drawing.selection.legendEntry=aCalcEntries[i].idx;drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"default",bMarker:false};if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();selector.resetSelection(); selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.legend=legend;drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(legend,drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController,x,y,false,false,drawing,true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(), cursorType:"move",title:null}}if(true){var oPlotArea=drawing.chart.plotArea;if(drawing.selection.plotArea){hit_to_handles=oPlotArea.hitToHandles(x,y);if(hit_to_handles>-1)if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.arrPreTrackObjects.length=0;var oTrack=new AscFormat.ResizeTrackShapeImage(oPlotArea,oPlotArea.getCardDirectionByNum(hit_to_handles),drawingObjectsController);oTrack.chartSpace=drawing;drawingObjectsController.arrPreTrackObjects.push(oTrack); oPlotArea.selectStartPage=drawing.selectStartPage;drawingObjectsController.changeCurrentState(new AscFormat.PreResizeState(drawingObjectsController,oPlotArea,oPlotArea.getCardDirectionByNum(hit_to_handles)));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else{var card_direction=oPlotArea.getCardDirectionByNum(hit_to_handles);return{objectId:drawing.Get_Id(),cursorType:AscFormat.CURSOR_TYPES_BY_CARD_DIRECTION[card_direction],bMarker:true}}if(oPlotArea.hitInBoundingRect(x, y))if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.plotArea=oPlotArea;drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(oPlotArea,drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController, x,y,false,false,drawing,true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"move",title:null}}var aCharts=drawing.chart.plotArea.charts;var series=drawing.getAllSeries();var _len=aCharts.length===1&&aCharts[0].getObjectType()===AscDFH.historyitem_type_PieChart?1:series.length;for(var i=_len-1;i>-1;--i){var ser=series[i];var pts=AscFormat.getPtsFromSeries(ser);var oDLbl;for(var j=0;j<pts.length;++j){oDLbl= pts[j].compiledDlb;if(oDLbl)if(oDLbl.hit(x,y)){var nDlbls=drawing.selection.dataLbls;var nDlbl=drawing.selection.dataLbl;if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.dataLbls=i}if(nDlbls===i)if(nDlbl===j){var hit_in_inner_area=oDLbl.hitInInnerArea(x,y);var hit_in_path=oDLbl.hitInPath(x,y);var hit_in_text_rect= oDLbl.hitInTextRect(x,y);if((hit_in_inner_area&&!hit_in_text_rect||hit_in_path&&bIsMobileVersion!==true)&&!window["NATIVE_EDITOR_ENJINE"])if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawing.selection.dataLbl=j;drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(oDLbl,drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController,x,y,false,false, drawing,true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"move",title:null};else if(hit_in_text_rect)if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawing.selection.dataLbl=j;drawing.selection.textSelection=oDLbl;oDLbl.selectionSetStart(e,x,y,pageIndex);drawingObjectsController.changeCurrentState(new AscFormat.TextAddState(drawingObjectsController,oDLbl,x,y)); if(e.ClickCount<=1)drawingObjectsController.updateSelectionState();return true}else{if(drawingObjectsController.document){var content=oDLbl.getDocContent();var invert_transform_text=oDLbl.invertTransformText,tx,ty;if(content&&invert_transform_text){tx=invert_transform_text.TransformPointX(x,y);ty=invert_transform_text.TransformPointY(x,y);content.UpdateCursorType(tx,ty,0)}}return{objectId:drawing.Get_Id(),cursorType:"text",title:oDLbl}}}else if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawing.selection.dataLbl= j;drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(oDLbl,drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController,x,y,false,false,drawing,true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"default",title:oDLbl};if(drawingObjectsController.handleEventMode=== HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"default",title:oDLbl}}}}}var chart_titles=drawing.getAllTitles();var oApi=editor||Asc["editor"];for(i=0;i<chart_titles.length;++i){title=chart_titles[i];var hit_in_inner_area=title.hitInInnerArea(x,y);var hit_in_path=title.hitInPath(x,y);var hit_in_text_rect=title.hitInTextRect(x,y);if(hit_in_inner_area&&(!hit_in_text_rect|| drawing.selection.title!==title)||hit_in_path&&bIsMobileVersion!==true||drawing.selection.title===title&&title.hitInBoundingRect(x,y)&&!window["NATIVE_EDITOR_ENJINE"]){var selector=group?group:drawingObjectsController;if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;if(title.select)drawing.selectTitle(title,pageIndex); drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(title,drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController,x,y,false,false,drawing,true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();if(Asc["editor"]&&Asc["editor"].wb){var ws=Asc["editor"].wb.getWorksheet();if(ws){var ct=ws.getCursorTypeFromXY(ws.objectRender.lastX, ws.objectRender.lastY);if(ct)Asc["editor"].wb._onUpdateCursor(ct.cursor)}}return true}else return{objectId:drawing.Get_Id(),cursorType:"move",bMarker:false}}else if(hit_in_text_rect)if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){var oTargetTextObject=AscFormat.getTargetTextObject(drawingObjectsController);if(title!==oTargetTextObject){drawingObjectsController.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection= drawing;drawing.selectTitle(title,pageIndex);drawing.selection.textSelection=title}title.selectionSetStart(e,x,y,pageIndex);drawingObjectsController.changeCurrentState(new AscFormat.TextAddState(drawingObjectsController,title,x,y));if(e.ClickCount<=1)drawingObjectsController.updateSelectionState();return true}else{if(drawingObjectsController.document){var content=title.getDocContent();var invert_transform_text=title.invertTransformText,tx,ty;if(content&&invert_transform_text){tx=invert_transform_text.TransformPointX(x, y);ty=invert_transform_text.TransformPointY(x,y);content.UpdateCursorType(tx,ty,0)}}return{objectId:drawing.Get_Id(),cursorType:"text",title:title}}}if(bClickFlag){var oPlotArea=drawing.chart.plotArea;if(oPlotArea.hitInBoundingRect(x,y))if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.plotArea=oPlotArea; drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(oPlotArea,drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController,x,y,false,false,drawing,true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"move",title:null};var oChartSizes=drawing.getChartSizes(true); var oInvertTransform=drawing.invertTransform;var dTx=oInvertTransform.TransformPointX(x,y);var dTy=oInvertTransform.TransformPointY(x,y);if(dTx>=oChartSizes.startX&&dTx<=oChartSizes.startX+oChartSizes.w&&dTy>=oChartSizes.startY&&dTy<=oChartSizes.startY+oChartSizes.h)if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){if(drawing.selection.plotArea==null||!AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(drawing)||!drawing.chartObj||!drawing.chartObj.processor3D||!drawingObjectsController.canEdit()){drawingObjectsController.checkChartTextSelection(); var bSeries=handleChartElements(drawing,drawingObjectsController,e,dTx,dTy,group,pageIndex,bWord);if(!bSeries){var oLabels;var aAxes=drawing.chart.plotArea.axId;for(var i=0;i<aAxes.length;++i)if(aAxes[i].labels){oLabels=aAxes[i].labels;if(oLabels.hit(x,y)){drawingObjectsController.checkChartTextSelection();selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.axisLbls=oLabels.axis;drawingObjectsController.updateSelectionState(); drawingObjectsController.updateOverlay();return true}}selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.plotArea=drawing.chart.plotArea;drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.MoveChartObjectTrack(drawing.chart.plotArea,drawing));drawingObjectsController.changeCurrentState(new AscFormat.PreMoveState(drawingObjectsController,x,y,false,false,drawing, true,true));drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay()}}else{var bSeries=false;if(AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(drawing))bSeries=handleChartElements(drawing,drawingObjectsController,e,dTx,dTy,group,pageIndex,bWord);if(!bSeries){var oLabels;var aAxes=drawing.chart.plotArea.axId;for(var i=0;i<aAxes.length;++i)if(aAxes[i].labels){oLabels=aAxes[i].labels;if(oLabels.hit(x,y))if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection(); selector.resetSelection();selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.axisLbls=oLabels.axis;drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"default",bMarker:false}}drawing.selection.plotArea=drawing.chart.plotArea;drawing.selection.rotatePlotArea=true;drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay(); drawingObjectsController.arrPreTrackObjects.length=0;drawingObjectsController.arrPreTrackObjects.push(new AscFormat.Chart3dAdjustTrack(drawing,0,x,y));if(!isRealObject(group))drawingObjectsController.changeCurrentState(new AscFormat.PreChangeAdjState(drawingObjectsController,drawing));else drawingObjectsController.changeCurrentState(new AscFormat.PreChangeAdjInGroupState(drawingObjectsController,group));var bOldIsLocked=e.IsLocked;e.IsLocked=true;drawingObjectsController.OnMouseMove(e,x,y,pageIndex); e.IsLocked=bOldIsLocked;return true}}drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"default",bMarker:false}}var oLabels;var aAxes=drawing.chart.plotArea.axId;for(var i=0;i<aAxes.length;++i)if(aAxes[i].labels){oLabels=aAxes[i].labels;if(oLabels.hit(x,y))if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.checkChartTextSelection();selector.resetSelection(); selector.selectObject(drawing,pageIndex);selector.selection.chartSelection=drawing;drawing.selection.axisLbls=oLabels.axis;drawingObjectsController.updateSelectionState();drawingObjectsController.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"default",bMarker:false}}}return ret}function handleChart(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord){var ret=!drawingObjectsController.isSlideShow()&&handleInternalChart(drawing,drawingObjectsController,e,x,y, group,pageIndex,bWord);if(ret)return ret;ret=handleShapeImage(drawing,drawingObjectsController,e,x,y,group,pageIndex,bWord);if(ret)return ret;return false}function handleInlineShapeImage(drawing,drawingObjectsController,e,x,y,pageIndex){var _hit=drawing.hit&&drawing.hit(x,y);var _hit_to_path=drawing.hitInPath&&drawing.hitInPath(x,y);var b_hit_to_text=drawing.hitInTextRect&&drawing.hitInTextRect(x,y);if(_hit&&!b_hit_to_text||_hit_to_path)return handleInlineHitNoText(drawing,drawingObjectsController, e,x,y,pageIndex,false);else if(b_hit_to_text){if(drawing.bWordShape){var all_drawings=drawing.getDocContent().GetAllDrawingObjects();var drawings2=[];for(var i=0;i<all_drawings.length;++i)drawings2.push(all_drawings[i].GraphicObj);var ret=handleInlineObjects(drawingObjectsController,drawings2,e,x,y,pageIndex,true);if(ret)return ret}return drawingObjectsController.handleTextHit(drawing,e,x,y,null,pageIndex,true)}}function handleInlineChart(drawing,drawingObjectsController,e,x,y,pageIndex){var ret= handleInternalChart(drawing,drawingObjectsController,e,x,y,null,pageIndex,true);if(ret)return ret;return handleInlineShapeImage(drawing,drawingObjectsController,e,x,y,pageIndex)}function handleInlineHitNoText(drawing,drawingObjects,e,x,y,pageIndex,bInSelect){var selected_objects=drawingObjects.selectedObjects;if(!(e.CtrlKey||e.ShiftKey)||selected_objects.length===0||selected_objects.length===1&&selected_objects[0]===drawing)if(drawingObjects.handleEventMode===HANDLE_EVENT_MODE_HANDLE){var bIsSelected= drawing.selected;drawingObjects.checkChartTextSelection();drawingObjects.resetSelection();drawing.select(drawingObjects,pageIndex);drawingObjects.changeCurrentState(new AscFormat.PreMoveInlineObject(drawingObjects,drawing,bIsSelected,!bInSelect,pageIndex,x,y));if(e.ClickCount>1&&!e.ShiftKey&&!e.CtrlKey&&(drawingObjects.selection.groupSelection&&drawingObjects.selection.groupSelection.selectedObjects.length===1||drawingObjects.selectedObjects.length===1))if(drawing.getObjectType()===AscDFH.historyitem_type_ChartSpace&& drawingObjects.handleChartDoubleClick)drawingObjects.handleChartDoubleClick(drawing.parent,drawing,e,x,y,pageIndex);else if(drawing.getObjectType()===AscDFH.historyitem_type_OleObject&&drawingObjects.handleOleObjectDoubleClick)drawingObjects.handleOleObjectDoubleClick(drawing.parent,drawing,e,x,y,pageIndex);else if(drawing.signatureLine&&drawingObjects.handleSignatureDblClick)drawingObjects.handleSignatureDblClick(drawing.signatureLine.id,drawing.extX,drawing.extY);else if(2===e.ClickCount&&drawing.parent instanceof ParaDrawing&&drawing.parent.IsMathEquation())drawingObjects.handleMathDrawingDoubleClick(drawing.parent,e,x,y,pageIndex);else if(drawing.getObjectType()===AscDFH.historyitem_type_Shape)drawingObjects.handleDblClickEmptyShape(drawing);drawingObjects.updateOverlay();return true}else return{objectId:drawing.Get_Id(),cursorType:"move"};if(drawingObjects.handleEventMode===HANDLE_EVENT_MODE_HANDLE)return{objectId:drawing.Get_Id(),cursorType:"move"};return false}function handleInlineObjects(drawingObjectsController, drawingArr,e,x,y,pageIndex,bWord){var i;var drawing,ret;for(i=drawingArr.length-1;i>-1;--i){drawing=drawingArr[i];if(drawing.parent&&AscFormat.isRealNumber(drawing.parent.LineTop)&&AscFormat.isRealNumber(drawing.parent.LineBottom))if(y<drawing.parent.LineTop||y>drawing.parent.LineBottom)continue;switch(drawing.getObjectType()){case AscDFH.historyitem_type_Shape:case AscDFH.historyitem_type_ImageShape:case AscDFH.historyitem_type_OleObject:case AscDFH.historyitem_type_Cnx:case AscDFH.historyitem_type_LockedCanvas:{ret= handleInlineShapeImage(drawing,drawingObjectsController,e,x,y,pageIndex);if(ret)return ret;break}case AscDFH.historyitem_type_ChartSpace:{ret=handleInlineChart(drawing,drawingObjectsController,e,x,y,pageIndex);if(ret)return ret;break}case AscDFH.historyitem_type_GroupShape:{ret=handleGroup(drawing,drawingObjectsController,e,x,y,null,pageIndex,bWord);if(ret)return ret;break}}}return false}function handleMouseUpPreMoveState(drawingObjects,e,x,y,pageIndex,bWord){var state=drawingObjects.curState;state.drawingObjects.clearPreTrackObjects(); state.drawingObjects.changeCurrentState(new AscFormat.NullState(state.drawingObjects));var bHandle=false;if(!state.shift&&!state.ctrl&&state.bInside&&state.majorObjectIsSelected&&e.Button!==AscCommon.g_mouse_button_right)switch(state.majorObject.getObjectType()){case AscDFH.historyitem_type_GroupShape:{state.drawingObjects.checkChartTextSelection();state.drawingObjects.resetSelection();state.drawingObjects.selectObject(state.majorObject,pageIndex);state.drawingObjects.selection.groupSelection=state.majorObject; state.drawingObjects.OnMouseDown(e,x,y,pageIndex);state.drawingObjects.OnMouseUp(e,x,y,pageIndex);state.drawingObjects.drawingObjects&&state.drawingObjects.drawingObjects.sendGraphicObjectProps&&state.drawingObjects.drawingObjects.sendGraphicObjectProps();state.drawingObjects.document&&state.drawingObjects.document.Document_UpdateInterfaceState();bHandle=true;break}case AscDFH.historyitem_type_ChartSpace:{break}case AscDFH.historyitem_type_ImageShape:{break}}if(!bHandle)if(!state.shift&&!state.ctrl&& state.bInside&&state.majorObject.getObjectType()===AscDFH.historyitem_type_ImageShape){var sMediaName=state.majorObject.getMediaFileName();if(sMediaName){var oApi=state.drawingObjects.getEditorApi();if(oApi&&oApi.showVideoControl){oApi.showVideoControl(sMediaName,state.majorObject.extX,state.majorObject.extY,state.majorObject.transform);bHandle=true}}}if(!bHandle)if(e.CtrlKey&&state.majorObjectIsSelected){drawingObjects.deselectObject(state.majorObject);state.drawingObjects.drawingObjects&&state.drawingObjects.drawingObjects.sendGraphicObjectProps&& state.drawingObjects.drawingObjects.sendGraphicObjectProps();state.drawingObjects.document&&state.drawingObjects.document.Document_UpdateInterfaceState();drawingObjects.updateOverlay()}}function handleFloatTable(drawing,drawingObjectsController,e,x,y,group,pageIndex){if(drawing.hitInBoundingRect(x,y))return drawingObjectsController.handleMoveHit(drawing,e,x,y,group,false,pageIndex,false);else if(drawing.hitInInnerArea(x,y)){var content,invert_transform_text,tx,ty,hit_paragraph,par,check_hyperlink; if(drawingObjectsController.handleEventMode===HANDLE_EVENT_MODE_HANDLE){drawingObjectsController.resetSelection(true);(group?group:drawingObjectsController).selectObject(drawing,pageIndex);if(!group){drawingObjectsController.selection.textSelection=drawing;drawing.selectionSetStart(e,x,y,pageIndex)}else{group.selection.textSelection=drawing;drawing.selectionSetStart(e,x,y,pageIndex);drawingObjectsController.selectObject(group,pageIndex);drawingObjectsController.selection.groupSelection=group}drawingObjectsController.changeCurrentState(new AscFormat.TextAddState(drawingObjectsController, drawing,x,y));return true}else{drawing.updateCursorType(x,y,e);return{objectId:drawing.Get_Id(),cursorType:"text",updated:true}}}return false}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CheckCoordsNeedPage=CheckCoordsNeedPage;window["AscFormat"].handleSelectedObjects=handleSelectedObjects;window["AscFormat"].handleFloatObjects=handleFloatObjects;window["AscFormat"].handleInlineObjects=handleInlineObjects;window["AscFormat"].handleMouseUpPreMoveState=handleMouseUpPreMoveState})(window); "use strict";(function(window,undefined){var g_fontApplication=AscFonts.g_fontApplication;var g_oTextMeasurer=AscCommon.g_oTextMeasurer;var Geometry=AscFormat.Geometry;var EPSILON_TEXT_AUTOFIT=AscFormat.EPSILON_TEXT_AUTOFIT;var ObjectToDraw=AscFormat.ObjectToDraw;var PATH_DIV_EPSILON=.1;var UNDERLINE_DIV_EPSILON=3;function ParaDrawingStruct(nPageIndex,pDrawing){this.oDrawing=pDrawing;this.nPageIndex=nPageIndex}ParaDrawingStruct.prototype.Draw=function(pGraphics){if(this.oDrawing)this.oDrawing.Draw(0, 0,pGraphics,this.nPageIndex,0)};function CDocContentStructure(){this.m_nType=DRAW_COMMAND_CONTENT;this.m_aContent=[];this.m_aByLines=null;this.m_aDrawingsStruct=[];this.m_aBackgrounds=[];this.m_aBorders=[];this.m_aParagraphBackgrounds=[];this.m_oBoundsRect1=null;this.m_oBoundsRect2=null;this.m_aComments=[]}CDocContentStructure.prototype.Recalculate=function(oTheme,oColorMap,dWidth,dHeight,oShape){for(var i=0;i<this.m_aContent.length;++i)this.m_aContent[i].Recalculate(oTheme,oColorMap,dWidth,dHeight, oShape)};CDocContentStructure.prototype.CheckContentStructs=function(aContentStructs){for(var i=0;i<this.m_aContent.length;++i)this.m_aContent[i].CheckContentStructs(aContentStructs)};CDocContentStructure.prototype.draw=function(graphics,transform,oTheme,oColorMap){var i;for(i=0;i<this.m_aDrawingsStruct.length;++i)this.m_aDrawingsStruct[i].Draw(graphics);for(i=0;i<this.m_aParagraphBackgrounds.length;++i)this.m_aParagraphBackgrounds[i].draw(graphics,undefined,transform,oTheme,oColorMap);for(i=0;i< this.m_aBorders.length;++i)this.m_aBorders[i].draw(graphics);for(i=0;i<this.m_aBackgrounds.length;++i)this.m_aBackgrounds[i].draw(graphics,undefined,transform,oTheme,oColorMap);for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].draw(graphics,transform,oTheme,oColorMap)};CDocContentStructure.prototype.drawComments=function(graphics,transform){var i;for(i=0;i<this.m_aComments.length;++i)this.m_aComments[i].drawComment2(graphics,undefined,transform)};CDocContentStructure.prototype.checkByWarpStruct= function(oWarpStruct,dWidth,dHeight,oTheme,oColorMap,oShape,dOneLineWidth,XLimit,dContentHeight,dKoeff){var i,j,t,aByPaths,aWarpedObjects=[];var bOddPaths=oWarpStruct.pathLst.length/2-(oWarpStruct.pathLst.length/2>>0)>0;var nDivCount=bOddPaths?oWarpStruct.pathLst.length:oWarpStruct.pathLst.length>>1,oNextPointOnPolygon,oObjectToDrawNext,oMatrix=new AscCommon.CMatrix;aByPaths=oWarpStruct.getArrayPolygonsByPaths(PATH_DIV_EPSILON);var nLastIndex=0,dTmp,oBoundsChecker,oTemp,nIndex,aWarpedObjects2=[]; oBoundsChecker=new AscFormat.CSlideBoundsChecker;oBoundsChecker.init(100,100,100,100);var dMinX,dMaxX;for(j=0;j<this.m_aByLines.length;++j){oTemp=this.m_aByLines[j];for(t=0;t<oTemp.length;++t){oTemp[t].GetAllWarped(aWarpedObjects2);oTemp[t].CheckBoundsWarped(oBoundsChecker)}}dMinX=oBoundsChecker.Bounds.min_x;dMaxX=oBoundsChecker.Bounds.max_x;for(i=0;i<nDivCount;++i){dTmp=(this.m_aByLines.length-nLastIndex)/(nDivCount-i);nIndex=nLastIndex+(dTmp>>0)+(dTmp-(dTmp>>0)>0?1:0);aWarpedObjects.length=0;oBoundsChecker.Bounds.ClearNoAttack(); for(j=nLastIndex;j<nIndex;++j){oTemp=this.m_aByLines[j];for(t=0;t<oTemp.length;++t){oTemp[t].GetAllWarped(aWarpedObjects);oTemp[t].CheckBoundsWarped(oBoundsChecker)}}if(oBoundsChecker.Bounds.min_x>dMinX)oBoundsChecker.Bounds.min_x=dMinX;if(oBoundsChecker.Bounds.max_x<dMaxX)oBoundsChecker.Bounds.max_x=dMaxX;if(!bOddPaths)ObjectsToDrawBetweenTwoPolygons(aWarpedObjects,oBoundsChecker.Bounds,new PolygonWrapper(aByPaths[i<<1]),new PolygonWrapper(aByPaths[(i<<1)+1]));else{oNextPointOnPolygon=null;oObjectToDrawNext= null;var oPolygon=new PolygonWrapper(aByPaths[i]);for(t=0;t<aWarpedObjects.length;++t){var oWarpedObject=aWarpedObjects[t];var bArcDown="textArchDown"!==oWarpStruct.preset&&i<1;if(!AscFormat.isRealNumber(oWarpedObject.x)||!AscFormat.isRealNumber(oWarpedObject.y))oWarpedObject.geometry.checkByPolygon(oPolygon,bArcDown,XLimit*dKoeff,dContentHeight,dKoeff,nDivCount>1?oBoundsChecker.Bounds:null);else{oNextPointOnPolygon=this.checkTransformByOddPath(oMatrix,oWarpedObject,aWarpedObjects[t+1],oNextPointOnPolygon, dContentHeight,dKoeff,bArcDown,oPolygon,XLimit);oWarpedObject.geometry.transform(oMatrix,dKoeff)}}}nLastIndex=nIndex}this.checkUnionPaths(aWarpedObjects2)};CDocContentStructure.prototype.checkContentReduct=function(oWarpStruct,dWidth,dHeight,oTheme,oColorMap,oShape,dOneLineWidth,XLimit,dContentHeight,dKoeff){var i,j,t,aByPaths,aWarpedObjects=[];var bOddPaths=oWarpStruct.pathLst.length/2-(oWarpStruct.pathLst.length/2>>0)>0;var nDivCount=bOddPaths?oWarpStruct.pathLst.length:oWarpStruct.pathLst.length>> 1,oNextPointOnPolygon,oObjectToDrawNext,oMatrix;aByPaths=oWarpStruct.getArrayPolygonsByPaths(PATH_DIV_EPSILON);var nLastIndex=0,dTmp,oBoundsChecker,oTemp,nIndex,aWarpedObjects2=[];oBoundsChecker=new AscFormat.CSlideBoundsChecker;oBoundsChecker.init(100,100,100,100);for(j=0;j<this.m_aByLines.length;++j){oTemp=this.m_aByLines[j];for(t=0;t<oTemp.length;++t){oTemp[t].GetAllWarped(aWarpedObjects2);oTemp[t].CheckBoundsWarped(oBoundsChecker)}}var aBounds=[];var oRet={maxDx:0,maxDy:0};for(i=0;i<nDivCount;++i){dTmp= (this.m_aByLines.length-nLastIndex)/(nDivCount-i);nIndex=nLastIndex+(dTmp>>0)+(dTmp-(dTmp>>0)>0?1:0);aWarpedObjects.length=0;for(j=nLastIndex;j<nIndex;++j){oTemp=this.m_aByLines[j];for(t=0;t<oTemp.length;++t)oTemp[t].GetAllWarped(aWarpedObjects)}var bArcDown="textArchDown"!==oWarpStruct.preset&&i<1;if(bOddPaths){oNextPointOnPolygon=null;oObjectToDrawNext=null;var oPolygon=new PolygonWrapper(aByPaths[i]);for(t=0;t<aWarpedObjects.length;++t){var oWarpedObject=aWarpedObjects[t];if(AscFormat.isRealNumber(oWarpedObject.x)&& AscFormat.isRealNumber(oWarpedObject.y)){oMatrix=new AscCommon.CMatrix;oBoundsChecker.Bounds.ClearNoAttack();oNextPointOnPolygon=this.checkTransformByOddPath(oMatrix,oWarpedObject,aWarpedObjects[t+1],oNextPointOnPolygon,dContentHeight,dKoeff,bArcDown,oPolygon,XLimit);oWarpedObject.draw(oBoundsChecker);var oBounds=new AscFormat.CBoundsController;for(var k=0;k<aBounds.length;++k){var oIntersection=this.checkIntersectionBounds(aBounds[k].Bounds,aBounds[k].Transform,oBounds,oMatrix,aBounds.length-k); if(oIntersection.DX>oRet.maxDx)oRet.maxDx=oIntersection.DX;if(oIntersection.DY<oRet.maxDy)oRet.maxDy=oIntersection.DY}aBounds.push({Bounds:oBounds,Transform:oMatrix})}}}nLastIndex=nIndex}return oRet};CDocContentStructure.prototype.getAllBackgroundsBorders=function(aParaBackgrounds,aBackgrounds,aBorders,aComments){for(var i=0;i<this.m_aContent.length;++i)this.m_aContent[i].getAllBackgroundsBorders(aParaBackgrounds,aBackgrounds,aBorders,aComments)};function CheckIntervalIntersection(X1,Y1,X2,Y2,X3, Y3,X4,Y4){return((X3-X1)*(Y2-Y1)-(Y3-Y1)*(X2-X1))*((X4-X1)*(Y2-Y1)-(Y4-Y1)*(X2-X1))>=0&&((X1-X3)*(Y4-Y3)-(Y1-Y3)*(X4-X3))*((X2-X3)*(Y4-Y3)-(Y2-Y3)*(X4-X3))>=0}function BoundsRect(){this.arrBounds=[{X0:0,Y0:0,X1:0,Y1:0},{X0:0,Y0:0,X1:0,Y1:0},{X0:0,Y0:0,X1:0,Y1:0},{X0:0,Y0:0,X1:0,Y1:0}]}BoundsRect.prototype.fromBoundsAndTransform=function(oBounds,oTransform){this.arrBounds[0].X0=oTransform.TransformPointX(oBounds.min_x,oBounds.min_y);this.arrBounds[0].Y0=oTransform.TransformPointY(oBounds.min_x,oBounds.min_y); this.arrBounds[0].X1=oTransform.TransformPointX(oBounds.max_x,oBounds.min_y);this.arrBounds[0].Y1=oTransform.TransformPointY(oBounds.max_x,oBounds.min_y);this.arrBounds[1].X0=oTransform.TransformPointX(oBounds.max_x,oBounds.max_y);this.arrBounds[1].Y0=oTransform.TransformPointY(oBounds.max_x,oBounds.max_y);this.arrBounds[1].X1=oTransform.TransformPointX(oBounds.max_x,oBounds.min_y);this.arrBounds[1].Y1=oTransform.TransformPointY(oBounds.max_x,oBounds.min_y);this.arrBounds[2].X0=oTransform.TransformPointX(oBounds.max_x, oBounds.max_y);this.arrBounds[2].Y0=oTransform.TransformPointY(oBounds.max_x,oBounds.max_y);this.arrBounds[2].X1=oTransform.TransformPointX(oBounds.min_x,oBounds.max_y);this.arrBounds[2].Y1=oTransform.TransformPointY(oBounds.min_x,oBounds.max_y);this.arrBounds[3].X0=oTransform.TransformPointX(oBounds.min_x,oBounds.max_y);this.arrBounds[3].Y0=oTransform.TransformPointY(oBounds.min_x,oBounds.max_y);this.arrBounds[3].X1=oTransform.TransformPointX(oBounds.min_x,oBounds.min_y);this.arrBounds[3].Y1=oTransform.TransformPointY(oBounds.min_x, oBounds.min_y)};BoundsRect.prototype.checkIntersection=function(oBoundsRect){var i,j,oCurBound1,oCurBound2;for(i=0;i<4;++i){oCurBound1=this.arrBounds[i];for(j=0;j<4;++j){oCurBound2=oBoundsRect[j];if(CheckIntervalIntersection(oCurBound1.X0,oCurBound1.Y0,oCurBound1.X1,oCurBound1.Y1,oCurBound2.X0,oCurBound2.Y0,oCurBound2.X1,oCurBound2.Y1))return true}}return false};BoundsRect.prototype.getParamValueProjection=function(x0,y0,x1,y1,x,y){var dX=x1-x0,dY=y1-y0;if(Math.abs(dX)>0){var dXSq=dX*dX;var xi=(x* dXSq+dX*dY*y-dY*(x1*y0-x0*y1))/(dXSq+dY*dY);return(xi-x1)/dX}else if(Math.abs(dY)>0){var dYSq=dY*dY;var yi=(y*dYSq+dX*dY*x+dX*(x1*y0-x0*y1))/(dX*dX+dYSq);return(yi-y1)/dY}return-1};BoundsRect.prototype.checkIntervalProjection=function(oInterval1,oInterval2){var param0=this.getParamValueProjection(oInterval1.X0,oInterval1.Y0,oInterval1.X1,oInterval1.Y1,oInterval2.X0,oInterval2.Y0);var param1=this.getParamValueProjection(oInterval1.X0,oInterval1.Y0,oInterval1.X1,oInterval1.Y1,oInterval2.X1,oInterval2.Y1); if(Math.abs(param0-.5)<=.5||Math.abs(param1-.5)<=.5){var dX=oInterval1.X0-oInterval1.X1,dY=oInterval1.Y0-oInterval1.Y1;var dLen=Math.sqrt(dX*dX+dY*dY);return((param1>1?1:param1<0?0:param1)-(param0>1?1:param0<0?0:param0))*dLen}else return 0};BoundsRect.prototype.checkBoundsRectProjection=function(oBoundsRect){var dX=0,dY=0,dLTemp;dLTemp=this.checkIntervalProjection(this.arrBounds[1],oBoundsRect.arrBounds[1]);if(dLTemp<dY)dY=dLTemp;dLTemp=this.checkIntervalProjection(this.arrBounds[1],oBoundsRect.arrBounds[3]); if(dLTemp<dY)dY=dLTemp;dLTemp=this.checkIntervalProjection(this.arrBounds[3],oBoundsRect.arrBounds[1]);if(dLTemp<dY)dY=dLTemp;dLTemp=this.checkIntervalProjection(this.arrBounds[3],oBoundsRect.arrBounds[3]);if(dLTemp<dY)dY=dLTemp;dLTemp=this.checkIntervalProjection(this.arrBounds[2],oBoundsRect.arrBounds[1]);if(Math.abs(dLTemp)>dX)dX=Math.abs(dLTemp);dLTemp=this.checkIntervalProjection(this.arrBounds[2],oBoundsRect.arrBounds[3]);if(Math.abs(dLTemp)>dX)dX=Math.abs(dLTemp);dLTemp=this.checkIntervalProjection(this.arrBounds[0], oBoundsRect.arrBounds[1]);if(Math.abs(dLTemp)>dX)dX=Math.abs(dLTemp);dLTemp=this.checkIntervalProjection(this.arrBounds[0],oBoundsRect.arrBounds[3]);if(Math.abs(dLTemp)>dX)dX=Math.abs(dLTemp);return{DX:dX,DY:dY}};CDocContentStructure.prototype.checkIntersectionBounds=function(oBounds1,oTransform1,oBounds2,oTransform2,nDist){if(!this.m_oBoundsRect1){this.m_oBoundsRect1=new BoundsRect;this.m_oBoundsRect2=new BoundsRect}this.m_oBoundsRect1.fromBoundsAndTransform(oBounds1,oTransform1);this.m_oBoundsRect2.fromBoundsAndTransform(oBounds2, oTransform2);if(this.m_oBoundsRect1.checkIntersection(this.m_oBoundsRect2.arrBounds)){var oBounds=this.m_oBoundsRect1.checkBoundsRectProjection(this.m_oBoundsRect2);oBounds.DX/=nDist;return oBounds}return{DX:0,DY:0}};CDocContentStructure.prototype.checkTransformByOddPath=function(oMatrix,oWarpedObject,oObjectToDrawNext,oNextPointOnPolygon,dContentHeight,dKoeff,bArcDown,oPolygon,XLimit){var x0,y0,x1,y1,x0t,y0t,x1t,y1t,cX,cX2,dX,dY,dX2,dY2,dNorm,oPointOnPolygon;x0=oWarpedObject.x*dKoeff;y0=oWarpedObject.y* dKoeff;x1=x0;if(bArcDown)y1=0;else y1=dContentHeight*dKoeff;cX=oWarpedObject.x/XLimit;var oRet=null;if(oNextPointOnPolygon)oPointOnPolygon=oNextPointOnPolygon;else oPointOnPolygon=oPolygon.getPointOnPolygon(cX,true);x1t=oPointOnPolygon.x;y1t=oPointOnPolygon.y;dX=oPointOnPolygon.oP2.x-oPointOnPolygon.oP1.x;dY=oPointOnPolygon.oP2.y-oPointOnPolygon.oP1.y;if(bArcDown){dX=-dX;dY=-dY}if(oObjectToDrawNext&&AscFormat.isRealNumber(oObjectToDrawNext.x)&&AscFormat.isRealNumber(oObjectToDrawNext.y)&&oObjectToDrawNext.x> oWarpedObject.x){cX2=oObjectToDrawNext.x/XLimit;oRet=oPolygon.getPointOnPolygon(cX2,true);dX2=oRet.oP2.x-oRet.oP1.x;dY2=oRet.oP2.y-oRet.oP1.y;if(bArcDown){dX2=-dX2;dY2=-dY2}dX=dX+dX2;dY=dY+dY2}else oRet=null;dNorm=Math.sqrt(dX*dX+dY*dY);if(bArcDown){x0t=x1t+dY/dNorm*y0;y0t=y1t-dX/dNorm*y0}else{x0t=x1t+dY/dNorm*(dContentHeight*dKoeff-y0);y0t=y1t-dX/dNorm*(dContentHeight*dKoeff-y0)}oMatrix.shx=(x1t-x0t)/(y1-y0);oMatrix.sy=(y1t-y0t)/(y1-y0);oMatrix.sx=oMatrix.sy;oMatrix.shy=-oMatrix.shx;oMatrix.tx=x0t- x0*oMatrix.sx-y0*oMatrix.shx;oMatrix.ty=y0t-x0*oMatrix.shy-y0*oMatrix.sy;return oRet};CDocContentStructure.prototype.checkUnionPaths=function(aWarpedObjects){var aToCheck=[];var aWarpedObjects2,i,j,k;if(Array.isArray(aWarpedObjects))aToCheck.push(aWarpedObjects);else for(j=0;j<this.m_aByLines.length;++j){aWarpedObjects2=[];var oTemp=this.m_aByLines[j];for(var t=0;t<oTemp.length;++t)oTemp[t].GetAllWarped(aWarpedObjects2);aToCheck.push(aWarpedObjects2)}for(j=0;j<aToCheck.length;++j){var aByProps=[], oCurObjectToDraw;aWarpedObjects2=aToCheck[j];for(i=0;i<aWarpedObjects2.length;++i){oCurObjectToDraw=aWarpedObjects2[i];for(k=0;k<aByProps.length;++k){var oObjToDraw=aByProps[k];if(CompareBrushes(oObjToDraw.brush,oCurObjectToDraw.brush)&&ComparePens(oObjToDraw.pen,oCurObjectToDraw.pen)&&!oCurObjectToDraw.Comment&&!oObjToDraw.Comment&&!oCurObjectToDraw.geometry.bDrawSmart&&!oObjToDraw.geometry.bDrawSmart){oObjToDraw.geometry.pathLst=oObjToDraw.geometry.pathLst.concat(oCurObjectToDraw.geometry.pathLst); oCurObjectToDraw.geometry.pathLst.length=0;break}}if(k===aByProps.length)aByProps.push(oCurObjectToDraw)}}this.m_aBackgrounds.length=0;this.m_aBorders.length=0;this.getAllBackgroundsBorders(this.m_aParagraphBackgrounds,this.m_aBackgrounds,this.m_aBorders,this.m_aComments)};function CParagraphStructure(){this.m_nType=DRAW_COMMAND_PARAGRAPH;this.m_aContent=[]}CParagraphStructure.prototype.Recalculate=function(oTheme,oColorMap,dWidth,dHeight,oShape){var i;for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].Recalculate(oTheme, oColorMap,dWidth,dHeight,oShape)};CParagraphStructure.prototype.CheckContentStructs=function(aContentStructs){var i;for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].CheckContentStructs(aContentStructs)};CParagraphStructure.prototype.draw=function(graphics,transform,oTheme,oColorMap){var i;for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].draw(graphics,transform,oTheme,oColorMap)};CParagraphStructure.prototype.getAllBackgroundsBorders=function(aParaBackgrounds,aBackgrounds,aBorders,aComments){var i; for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].getAllBackgroundsBorders(aParaBackgrounds,aBackgrounds,aBorders,aComments)};function CTableStructure(){this.m_nType=DRAW_COMMAND_TABLE;this.m_aContent=[];this.m_aBorders=[]}CTableStructure.prototype.Recalculate=function(oTheme,oColorMap,dWidth,dHeight,oShape){var i;for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].Recalculate(oTheme,oColorMap,dWidth,dHeight,oShape,true);for(i=0;i<this.m_aBorders.length;++i)this.m_aBorders[i].Recalculate(oTheme, oColorMap,dWidth,dHeight,oShape,true)};CTableStructure.prototype.CheckContentStructs=function(aContentStructs){var i;for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].CheckContentStructs(aContentStructs)};CTableStructure.prototype.draw=function(graphics,transform,oTheme,oColorMap){var i;for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].draw(graphics,transform,oTheme,oColorMap)};CTableStructure.prototype.getAllBackgroundsBorders=function(aParaBackgrounds,aBackgrounds,aBorders,aComments){var i; for(i=0;i<this.m_aBorders.length;++i)aBorders.push(this.m_aBorders[i]);for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].getAllBackgroundsBorders(aParaBackgrounds,aBackgrounds,aBorders,aComments)};function CLineStructure(oLine){this.m_nType=DRAW_COMMAND_LINE;this.m_oLine=oLine;this.m_aContent=[];this.m_aBorders=[];this.m_aBackgrounds=[];this.m_aUnderlinesStrikeouts=[];this.m_aParagraphBackgrounds=[];this.m_nDrawType=0}CLineStructure.prototype.Recalculate=function(oTheme,oColorMap,dWidth,dHeight, oShape){var i;for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].Recalculate(oTheme,oColorMap,dWidth,dHeight,oShape,true);for(i=0;i<this.m_aBorders.length;++i)this.m_aBorders[i].Recalculate(oTheme,oColorMap,dWidth,dHeight,oShape,true);for(i=0;i<this.m_aBackgrounds.length;++i)this.m_aBackgrounds[i].Recalculate(oTheme,oColorMap,dWidth,dHeight,oShape,true);for(i=0;i<this.m_aUnderlinesStrikeouts.length;++i)this.m_aUnderlinesStrikeouts[i].Recalculate(oTheme,oColorMap,dWidth,dHeight,oShape,true);for(i= 0;i<this.m_aParagraphBackgrounds.length;++i)this.m_aParagraphBackgrounds[i].Recalculate(oTheme,oColorMap,dWidth,dHeight,oShape,true)};CLineStructure.prototype.CheckContentStructs=function(aContentStructs){var i;for(i=0;i<this.m_aContent.length;++i)aContentStructs.push(this.m_aContent[i])};CLineStructure.prototype.GetAllWarped=function(aWarpedObjects){var i;for(i=0;i<this.m_aContent.length;++i)aWarpedObjects.push(this.m_aContent[i]);for(i=0;i<this.m_aBackgrounds.length;++i)aWarpedObjects.push(this.m_aBackgrounds[i]); for(i=0;i<this.m_aUnderlinesStrikeouts.length;++i)aWarpedObjects.push(this.m_aUnderlinesStrikeouts[i])};CLineStructure.prototype.CheckBoundsWarped=function(graphics){var i;for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].draw(graphics,true);for(i=0;i<this.m_aBackgrounds.length;++i)this.m_aBackgrounds[i].draw(graphics,true);for(i=0;i<this.m_aUnderlinesStrikeouts.length;++i)this.m_aUnderlinesStrikeouts[i].draw(graphics,true)};CLineStructure.prototype.draw=function(graphics,transform,oTheme,oColorMap){var i; for(i=0;i<this.m_aContent.length;++i)this.m_aContent[i].draw(graphics,undefined,transform,oTheme,oColorMap);for(i=0;i<this.m_aUnderlinesStrikeouts.length;++i)this.m_aUnderlinesStrikeouts[i].draw(graphics,undefined,transform,oTheme,oColorMap)};CLineStructure.prototype.getAllBackgroundsBorders=function(aParaBackgrounds,aBackgrounds,aBorders,aComments){var i;for(i=0;i<this.m_aParagraphBackgrounds.length;++i)aParaBackgrounds.push(this.m_aParagraphBackgrounds[i]);for(i=0;i<this.m_aBackgrounds.length;++i){aBackgrounds.push(this.m_aBackgrounds[i]); if(this.m_aBackgrounds[i].Comment)aComments.push(this.m_aBackgrounds[i])}for(i=0;i<this.m_aBorders.length;++i)aBorders.push(this.m_aBorders[i])};var DRAW_COMMAND_TABLE=1;var DRAW_COMMAND_CONTENT=2;var DRAW_COMMAND_PARAGRAPH=3;var DRAW_COMMAND_LINE=4;var DRAW_COMMAND_DRAWING=5;var DRAW_COMMAND_HIDDEN_ELEM=6;var DRAW_COMMAND_NO_CREATE_GEOM=7;var DRAW_COMMAND_TABLE_ROW=8;function GetConstDescription(nConst){switch(nConst){case DRAW_COMMAND_TABLE:{return"DRAW_COMMAND_TABLE"}case DRAW_COMMAND_CONTENT:{return"DRAW_COMMAND_CONTENT"}case DRAW_COMMAND_PARAGRAPH:{return"DRAW_COMMAND_PARAGRAPH"}case DRAW_COMMAND_LINE:{return"DRAW_COMMAND_LINE"}case DRAW_COMMAND_DRAWING:{return"DRAW_COMMAND_DRAWING"}case DRAW_COMMAND_HIDDEN_ELEM:{return"DRAW_COMMAND_HIDDEN_ELEM"}case DRAW_COMMAND_NO_CREATE_GEOM:{return"DRAW_COMMAND_NO_CREATE_GEOM"}case DRAW_COMMAND_TABLE_ROW:{return"DRAW_COMMAND_TABLE_ROW"}default:{return"Unknown"}}} function CreatePenFromParams(oUnifill,nStyle,nLineCap,nLineJoin,dLineWidth,dSize){var oLine=new AscFormat.CLn;oLine.setW(dSize*36E3>>0);oLine.setFill(oUnifill);return oLine}function CTextDrawer(dWidth,dHeight,bDivByLInes,oTheme,bDivGlyphs){this.m_oFont={Name:"",FontSize:-1,Style:-1};this.m_oTheme=oTheme;this.Width=dWidth;this.Height=dHeight;this.m_oTransform=new AscCommon.CMatrix;this.pathW=1E9;this.pathH=1E9;this.xKoeff=this.pathW;this.yKoeff=this.pathH;this.m_aStack=[];this.m_oDocContentStructure= null;this.m_aCommands=[];this.m_aDrawings=[];this.m_oTextPr=null;this.m_oGrFonts=new AscCommon.CGrRFonts;this.m_oCurComment=null;this.m_oPen=new AscCommon.CPen;this.m_oBrush=new AscCommon.CBrush;this.m_oLine=null;this.m_oFill=null;this.m_oPen.Color.R=-1;this.m_oBrush.Color1.R=-1;this.m_oBrush.Color2.R=-1;this.m_oFontSlotFont=new AscCommon.CFontSetup;this.LastFontOriginInfo={Name:"",Replace:null};this.GrState=new AscCommon.CGrState;this.GrState.Parent=this;this.m_bDivByLines=bDivByLInes===true;this.m_bDivGlyphs= bDivGlyphs===true;this.m_aByLines=null;this.m_nCurLineIndex=-1;this.m_aStackLineIndex=null;this.m_aStackCurRowMaxIndex=null;this.m_aByParagraphs=null;this.m_oObjectToDraw=null;this.m_bTurnOff=false;this.bCheckLines=false;this.lastX=null;this.lastY=null;if(this.m_bDivByLines){this.m_aByLines=[];this.m_aStackLineIndex=[];this.m_aStackCurRowMaxIndex=[]}else this.m_aByParagraphs=[];this.m_bIsTextDrawer=true;this.pathMemory=new AscFormat.CPathMemory}CTextDrawer.prototype={SetObjectToDraw:function(oObjectToDraw){this.m_oObjectToDraw= oObjectToDraw},p_color:function(r,g,b,a){if(this.m_oPen.Color.R!=r||this.m_oPen.Color.G!=g||this.m_oPen.Color.B!=b){this.m_oPen.Color.R=r;this.m_oPen.Color.G=g;this.m_oPen.Color.B=b}if(this.m_oPen.Color.A!=a)this.m_oPen.Color.A=a;var oLastCommand=this.m_aStack[this.m_aStack.length-1];if(oLastCommand)if(oLastCommand.m_nType===DRAW_COMMAND_LINE&&oLastCommand.m_nDrawType===3)if(this.m_oTextPr&&this.m_oTheme){var oTextPr=this.m_oTextPr.Copy();if(!oTextPr.TextOutline)oTextPr.TextOutline=new AscFormat.CLn; oTextPr.TextOutline.Fill=AscFormat.CreateUnfilFromRGB(r,g,b);this.SetTextPr(oTextPr,this.m_oTheme);return}this.Get_PathToDraw(false,true)},AddSmartRect:function(){},p_width:function(w){var val=w/1E3;if(this.m_oPen.Size!=val)this.m_oPen.Size=val;this.Get_PathToDraw(false,true)},p_dash:function(w){},b_color1:function(r,g,b,a){if(this.m_oBrush.Color1.R!==r||this.m_oBrush.Color1.G!==g||this.m_oBrush.Color1.B!==b){this.m_oBrush.Color1.R=r;this.m_oBrush.Color1.G=g;this.m_oBrush.Color1.B=b}if(this.m_oBrush.Color1.A!== a)this.m_oBrush.Color1.A=a;var oLastCommand=this.m_aStack[this.m_aStack.length-1];if(oLastCommand)if(oLastCommand.m_nType===DRAW_COMMAND_LINE&&oLastCommand.m_nDrawType===0)if(this.m_oTextPr&&this.m_oTheme){var oTextPr=this.m_oTextPr.Copy();oTextPr.Unifill=undefined;oTextPr.TextFill=undefined;oTextPr.FontRef=undefined;oTextPr.Color=new CDocumentColor(r,g,b,false);this.SetTextPr(oTextPr,this.m_oTheme);return}this.Get_PathToDraw(false,true)},set_fillColor:function(R,G,B){this.m_oFill=AscFormat.CreateUniFillByUniColor(AscFormat.CreateUniColorRGB(R, G,B));this.Get_PathToDraw(false,true)},b_color2:function(r,g,b,a){if(this.m_oBrush.Color2.R!=r||this.m_oBrush.Color2.G!=g||this.m_oBrush.Color2.B!=b){this.m_oBrush.Color2.R=r;this.m_oBrush.Color2.G=g;this.m_oBrush.Color2.B=b}if(this.m_oBrush.Color2.A!=a)this.m_oBrush.Color2.A=a;this.Get_PathToDraw(false,true)},put_brushTexture:function(src,mode){this.m_oBrush.Color1.R=-1;this.m_oBrush.Color1.G=-1;this.m_oBrush.Color1.B=-1;this.m_oBrush.Color1.A=-1;this.Get_PathToDraw(false,true)},SetShd:function(oShd){if(oShd)if(oShd.Value!== Asc.c_oAscShdNil)if(oShd.Unifill)this.m_oFill=oShd.Unifill;else if(oShd.Color)this.m_oFill=AscFormat.CreateUnfilFromRGB(oShd.Color.r,oShd.Color.g,oShd.Color.b);else this.m_oFill=null;else this.m_oFill=null;else this.m_oFill=null;this.Get_PathToDraw(false,true)},SetBorder:function(oBorder){if(oBorder&&oBorder.Value!==border_None)this.m_oLine=CreatePenFromParams(oBorder.Unifill?oBorder.Unifill:AscFormat.CreateUnfilFromRGB(oBorder.Color.r,oBorder.Color.g,oBorder.Color.b),this.m_oPen.Style,this.m_oPen.LineCap, this.m_oPen.LineJoin,this.m_oPen.LineWidth,this.m_oPen.Size);else this.m_oLine=null},SetAdditionalProps:function(oProps){oProps&&this.SetTextPr(oProps,this.m_oTheme)},put_BrushTextureAlpha:function(alpha){},put_BrushGradient:function(gradFill,points,transparent){},StartCheckTableDraw:function(){this.Start_Command(DRAW_COMMAND_TABLE)},EndCheckTableDraw:function(){this.End_Command()},Start_Command:function(commandId,param,index,nType){this.m_aCommands.push(commandId);var oNewStructure=null;switch(commandId){case DRAW_COMMAND_NO_CREATE_GEOM:{break}case DRAW_COMMAND_CONTENT:{oNewStructure= new CDocContentStructure;this.m_aStackLineIndex.push(this.m_nCurLineIndex);break}case DRAW_COMMAND_PARAGRAPH:{oNewStructure=new CParagraphStructure;if(!this.m_bDivByLines)this.m_aByParagraphs[this.m_aByParagraphs.length]=[];break}case DRAW_COMMAND_LINE:{var oPrevStruct=this.m_aStack[this.m_aStack.length-1];if(oPrevStruct.m_nType===DRAW_COMMAND_PARAGRAPH&&oPrevStruct.m_aContent[index]){oPrevStruct.m_aContent[index].m_nDrawType=nType;this.m_aStack.push(oPrevStruct.m_aContent[index])}else{oNewStructure= new CLineStructure(param);oNewStructure.m_nDrawType=nType;if(this.m_bDivByLines){++this.m_nCurLineIndex;if(!Array.isArray(this.m_aByLines[this.m_nCurLineIndex]))this.m_aByLines[this.m_nCurLineIndex]=[];this.m_aByLines[this.m_nCurLineIndex].push(oNewStructure);if(this.m_aStackCurRowMaxIndex[this.m_aStackCurRowMaxIndex.length-1]<this.m_nCurLineIndex)this.m_aStackCurRowMaxIndex[this.m_aStackCurRowMaxIndex.length-1]=this.m_nCurLineIndex}else this.m_aByParagraphs[this.m_aByParagraphs.length-1].push(oNewStructure)}break}case DRAW_COMMAND_TABLE:{oNewStructure= new CTableStructure;break}case DRAW_COMMAND_DRAWING:{break}case DRAW_COMMAND_HIDDEN_ELEM:{break}case DRAW_COMMAND_TABLE_ROW:{this.m_aStackCurRowMaxIndex[this.m_aStackCurRowMaxIndex.length]=-1;break}}if(oNewStructure){if(this.m_aStack[this.m_aStack.length-1])this.m_aStack[this.m_aStack.length-1].m_aContent.push(oNewStructure);this.m_aStack.push(oNewStructure)}},End_Command:function(){var nCommandId=this.m_aCommands.pop();switch(nCommandId){case DRAW_COMMAND_NO_CREATE_GEOM:{break}case DRAW_COMMAND_CONTENT:{var oDocContentStructure= this.m_aStack.pop();if(this.m_aStack.length===0){this.m_oDocContentStructure=oDocContentStructure;this.m_oDocContentStructure.m_aByLines=this.m_aByLines;this.m_oDocContentStructure.m_aByParagraphs=this.m_aByParagraphs;this.m_oDocContentStructure.m_aDrawingsStruct=this.m_aDrawings;this.m_aByLines=[];this.m_aByParagraphs=[];this.m_aDrawings=[]}if(this.m_bDivByLines)this.m_nCurLineIndex=this.m_aStackLineIndex.pop();break}case DRAW_COMMAND_PARAGRAPH:{this.m_aStack.pop();break}case DRAW_COMMAND_LINE:{this.m_aStack.pop(); break}case DRAW_COMMAND_TABLE:{this.m_aStack.pop();break}case DRAW_COMMAND_DRAWING:{break}case DRAW_COMMAND_HIDDEN_ELEM:{break}case DRAW_COMMAND_TABLE_ROW:{this.m_nCurLineIndex=this.m_aStackCurRowMaxIndex.pop();break}}},Get_PathToDraw:function(bStart,bStart2,x,y){var oPath=null;var oLastCommand=this.m_aStack[this.m_aStack.length-1];var oLastObjectToDraw,oBrushColor=this.m_oBrush.Color1,oPenColor=this.m_oPen.Color;if(oLastCommand)switch(oLastCommand.m_nType){case DRAW_COMMAND_LINE:{switch(oLastCommand.m_nDrawType){case 0:{if(oLastCommand.m_aContent.length=== 0)oLastCommand.m_aContent.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr),this.GetPenFromTextPr(this.m_oTextPr),this.Width,this.Height,new Geometry,this.m_oTransform,x,y,this.m_oCurComment));oLastObjectToDraw=oLastCommand.m_aContent[oLastCommand.m_aContent.length-1];if(bStart2)if(oLastObjectToDraw.geometry.pathLst.length===0||oLastObjectToDraw.geometry.pathLst.length===1&&oLastObjectToDraw.geometry.pathLst[0].isEmpty())oLastObjectToDraw.resetBrushPen(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr),x,y);else{oLastCommand.m_aContent.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr),this.GetPenFromTextPr(this.m_oTextPr),this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw=oLastCommand.m_aContent[oLastCommand.m_aContent.length-1]}break}case 1:{if(oLastCommand.m_aBorders.length===0)oLastCommand.m_aBorders.push(new ObjectToDraw(this.m_oFill,this.m_oLine,this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw= oLastCommand.m_aBorders[oLastCommand.m_aBorders.length-1];if(bStart2)if(oLastObjectToDraw.geometry.pathLst.length===0||oLastObjectToDraw.geometry.pathLst.length===1&&oLastObjectToDraw.geometry.pathLst[0].isEmpty())oLastObjectToDraw.resetBrushPen(this.m_oFill,this.m_oLine,x,y);else{oLastCommand.m_aBorders.push(new ObjectToDraw(this.m_oFill,this.m_oLine,this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw=oLastCommand.m_aBorders[oLastCommand.m_aBorders.length-1]}break}case 2:{if(oLastCommand.m_aBackgrounds.length=== 0)oLastCommand.m_aBackgrounds.push(new ObjectToDraw(this.m_oFill,this.m_oLine,this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw=oLastCommand.m_aBackgrounds[oLastCommand.m_aBackgrounds.length-1];if(bStart2)if(oLastObjectToDraw.geometry.pathLst.length===0||oLastObjectToDraw.geometry.pathLst.length===1&&oLastObjectToDraw.geometry.pathLst[0].isEmpty())oLastObjectToDraw.resetBrushPen(this.m_oFill,this.m_oLine,x,y);else{oLastCommand.m_aBackgrounds.push(new ObjectToDraw(this.m_oFill, this.m_oLine,this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw=oLastCommand.m_aBackgrounds[oLastCommand.m_aBackgrounds.length-1]}break}case 3:{if(oLastCommand.m_aUnderlinesStrikeouts.length===0){oBrushColor=this.m_oBrush.Color1;oPenColor=this.m_oPen.Color;oLastCommand.m_aUnderlinesStrikeouts.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr),this.GetPenFromTextPr(this.m_oTextPr),this.Width,this.Height,new Geometry,this.m_oTransform,x,y))}oLastObjectToDraw=oLastCommand.m_aUnderlinesStrikeouts[oLastCommand.m_aUnderlinesStrikeouts.length- 1];if(bStart2)if(oLastObjectToDraw.geometry.pathLst.length===0||oLastObjectToDraw.geometry.pathLst.length===1&&oLastObjectToDraw.geometry.pathLst[0].isEmpty())oLastObjectToDraw.resetBrushPen(this.GetFillFromTextPr(this.m_oTextPr),this.GetPenFromTextPr(this.m_oTextPr),x,y);else{oLastCommand.m_aUnderlinesStrikeouts.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr),this.GetPenFromTextPr(this.m_oTextPr),this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw=oLastCommand.m_aUnderlinesStrikeouts[oLastCommand.m_aUnderlinesStrikeouts.length- 1]}break}case 4:{if(oLastCommand.m_aParagraphBackgrounds.length===0)oLastCommand.m_aParagraphBackgrounds.push(new ObjectToDraw(this.m_oFill,this.m_oLine,this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw=oLastCommand.m_aParagraphBackgrounds[oLastCommand.m_aParagraphBackgrounds.length-1];if(bStart2)if(oLastObjectToDraw.geometry.pathLst.length===0||oLastObjectToDraw.geometry.pathLst.length===1&&oLastObjectToDraw.geometry.pathLst[0].isEmpty())oLastObjectToDraw.resetBrushPen(this.m_oFill, this.m_oLine,x,y);else{oLastCommand.m_aParagraphBackgrounds.push(new ObjectToDraw(this.m_oFill,this.m_oLine,this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw=oLastCommand.m_aParagraphBackgrounds[oLastCommand.m_aParagraphBackgrounds.length-1]}break}}break}case DRAW_COMMAND_TABLE:{if(oLastCommand.m_aBorders.length===0||bStart2){oBrushColor=this.m_oBrush.Color1;oPenColor=this.m_oPen.Color;oLastCommand.m_aBorders.push(new ObjectToDraw(this.m_oFill,this.m_oLine,this.Width,this.Height, new Geometry,this.m_oTransform,x,y))}oLastObjectToDraw=oLastCommand.m_aBorders[oLastCommand.m_aBorders.length-1];if(bStart2)if(oLastObjectToDraw.geometry.pathLst.length===0||oLastObjectToDraw.geometry.pathLst.length===1&&oLastObjectToDraw.geometry.pathLst[0].isEmpty())oLastObjectToDraw.resetBrushPen(this.m_oFill,this.m_oLine,x,y);else{oLastCommand.m_aBorders.push(new ObjectToDraw(this.m_oFill,this.m_oLine,this.Width,this.Height,new Geometry,this.m_oTransform,x,y));oLastObjectToDraw=oLastCommand.m_aBorders[oLastCommand.m_aBorders.length- 1]}oLastObjectToDraw.geometry.bDrawSmart=true;break}case DRAW_COMMAND_PARAGRAPH:{break}}else if(this.m_oObjectToDraw)oLastObjectToDraw=this.m_oObjectToDraw;if(oLastObjectToDraw&&oLastObjectToDraw.geometry){oLastObjectToDraw.Comment=this.m_oCurComment;if(oLastObjectToDraw.geometry.pathLst.length===0||bStart){oPath=this.pathMemory.AllocPath2();oPath.setPathW(this.pathW);oPath.setPathH(this.pathH);oPath.setExtrusionOk(false);oPath.setFill("none");oPath.setStroke(true);oLastObjectToDraw.geometry.AddPath(oPath)}else oPath= oLastObjectToDraw.geometry.pathLst[oLastObjectToDraw.geometry.pathLst.length-1]}return oPath},transform:function(sx,shy,shx,sy,tx,ty){if(this.m_oTransform.sx!=sx||this.m_oTransform.shx!=shx||this.m_oTransform.shy!=shy||this.m_oTransform.sy!=sy||this.m_oTransform.tx!=tx||this.m_oTransform.ty!=ty){this.m_oTransform.sx=sx;this.m_oTransform.shx=shx;this.m_oTransform.shy=shy;this.m_oTransform.sy=sy;this.m_oTransform.tx=tx;this.m_oTransform.ty=ty}},_s:function(){if(this.m_bTurnOff)return;this.Get_PathToDraw(true)}, _e:function(){},_z:function(){var oPathToDraw=this.Get_PathToDraw();if(oPathToDraw)oPathToDraw.close()},_m:function(x,y){if(this.m_bTurnOff)return;var oPathToDraw=this.Get_PathToDraw();if(oPathToDraw)oPathToDraw.moveTo(this.xKoeff*x,this.yKoeff*y);this.lastX=x;this.lastY=y},_l:function(x,y){if(this.m_bTurnOff)return;if(this.bCheckLines)if(Math.abs(x-this.lastX)<EPSILON_TEXT_AUTOFIT&&Math.abs(x-this.lastX)<Math.abs(y-this.lastY)){this.checkCurveBezier(this.lastX,this.lastY,this.lastX,this.lastY+(y- this.lastY)/3,this.lastX,this.lastY+2*(y-this.lastY)/3,x,y,PATH_DIV_EPSILON);this.lastX=x;this.lastY=y;return}else if(Math.abs(y-this.lastY)<EPSILON_TEXT_AUTOFIT&&Math.abs(y-this.lastY)<Math.abs(x-this.lastX)){this.checkCurveBezier(this.lastX,this.lastY,this.lastX+(x-this.lastX)/3,this.lastY,this.lastX+2*(x-this.lastX)/3,this.lastY,x,y,PATH_DIV_EPSILON);this.lastX=x;this.lastY=y;return}var oPathToDraw=this.Get_PathToDraw();if(oPathToDraw)oPathToDraw.lnTo(this.xKoeff*x,this.yKoeff*y);this.lastX=x; this.lastY=y},_c:function(x1,y1,x2,y2,x3,y3){var oPathToDraw=this.Get_PathToDraw();if(oPathToDraw)oPathToDraw.cubicBezTo(this.xKoeff*x1,this.yKoeff*y1,this.xKoeff*x2,this.yKoeff*y2,this.xKoeff*x3,this.yKoeff*y3);this.lastX=x3;this.lastY=y3},_c2:function(x1,y1,x2,y2){var oPathToDraw=this.Get_PathToDraw();if(oPathToDraw)oPathToDraw.quadBezTo(this.xKoeff*x1,this.yKoeff*y1,this.xKoeff*x2,this.yKoeff*y2);this.lastX=x2;this.lastY=y2},ds:function(){},df:function(){var oPathToDraw=this.Get_PathToDraw();if(oPathToDraw)oPathToDraw.setFill("norm")}, drawpath:function(type){},save:function(){},restore:function(){},clip:function(){},SetIntegerGrid:function(){},drawImage:function(img,x,y,w,h){},SetFont:function(font){if(null==font)return;var style=0;if(font.Italic==true)style+=2;if(font.Bold==true)style+=1;var fontinfo=g_fontApplication.GetFontInfo(font.FontFamily.Name,style,this.LastFontOriginInfo);style=fontinfo.GetBaseStyle(style);if(this.m_oFont.Name!=fontinfo.Name)this.m_oFont.Name=fontinfo.Name;if(this.m_oFont.FontSize!=font.FontSize)this.m_oFont.FontSize= font.FontSize;if(this.m_oFont.Style!=style)this.m_oFont.Style=style},FillText:function(x,y,text){this.FillTextCode(x,y,text.charCodeAt(0))},FillTextCode:function(x,y,code){if(this.m_bDivGlyphs===true)this.Get_PathToDraw(false,true,x,y);AscCommon.g_oTextMeasurer.SetFontInternal(this.m_oFont.Name,this.m_oFont.FontSize,Math.max(this.m_oFont.Style,0));if(null!=this.LastFontOriginInfo.Replace)code=g_fontApplication.GetReplaceGlyph(code,this.LastFontOriginInfo.Replace);if(AscCommon.g_oTextMeasurer.m_oManager)AscCommon.g_oTextMeasurer.m_oManager.LoadStringPathCode(code, false,x,y,this)},tg:function(gid,x,y){g_oTextMeasurer.SetFontInternal(this.m_oFont.Name,this.m_oFont.FontSize,Math.max(this.m_oFont.Style,0));g_oTextMeasurer.m_oManager.LoadStringPathCode(gid,true,x,y,this)},charspace:function(space){},beginCommand:function(command){},endCommand:function(command){},put_PenLineJoin:function(_join){},put_TextureBounds:function(x,y,w,h){},put_TextureBoundsEnabled:function(bIsEnabled){},SetFontSlot:function(slot,fontSizeKoef){var _rfonts=this.m_oGrFonts;var _lastFont= this.m_oFontSlotFont;switch(slot){case fontslot_ASCII:{_lastFont.Name=_rfonts.Ascii.Name;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}case fontslot_CS:{_lastFont.Name=_rfonts.CS.Name;_lastFont.Size=this.m_oTextPr.FontSizeCS;_lastFont.Bold=this.m_oTextPr.BoldCS;_lastFont.Italic=this.m_oTextPr.ItalicCS;break}case fontslot_EastAsia:{_lastFont.Name=_rfonts.EastAsia.Name;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold; _lastFont.Italic=this.m_oTextPr.Italic;break}case fontslot_HAnsi:default:{_lastFont.Name=_rfonts.HAnsi.Name;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}}if(undefined!==fontSizeKoef)_lastFont.Size*=fontSizeKoef;var style=0;if(_lastFont.Italic==true)style+=2;if(_lastFont.Bold==true)style+=1;var fontinfo=g_fontApplication.GetFontInfo(_lastFont.Name,style,this.LastFontOriginInfo);if(this.m_oFont.Name!=fontinfo.Name)this.m_oFont.Name= fontinfo.Name;if(this.m_oFont.FontSize!=_lastFont.Size)this.m_oFont.FontSize=_lastFont.Size;if(this.m_oFont.Style!=style)this.m_oFont.Style=style},BeginPage:function(width,height){},EndPage:function(){},transform3:function(m){this.transform(m.sx,m.shy,m.shx,m.sy,m.tx,m.ty)},reset:function(){this.transform(1,0,0,1,0,0)},FillText2:function(x,y,text){this.FillText(x,y,text)},GetIntegerGrid:function(){},GetFont:function(){return this.m_oFont},put_GlobalAlpha:function(enable,alpha){},Start_GlobalAlpha:function(){}, End_GlobalAlpha:function(){},DrawHeaderEdit:function(yPos){},DrawFooterEdit:function(yPos){},drawCollaborativeChanges:function(x,y,w,h){},drawSearchResult:function(x,y,w,h){},DrawEmptyTableLine:function(x1,y1,x2,y2){},DrawLockParagraph:function(lock_type,x,y1,y2){},DrawLockObjectRect:function(lock_type,x,y,w,h){},DrawSpellingLine:function(y0,x0,x1,w){},checkCurveBezier:function(x0,y0,x1,y1,x2,y2,x3,y3,dEpsilon){var _epsilon=dEpsilon?dEpsilon:UNDERLINE_DIV_EPSILON;var arr_point=AscFormat.partition_bezier4(x0, y0,x1,y1,x2,y2,x3,y3,_epsilon),i,count=arr_point.length>>2;for(i=0;i<count;++i){var k=4*i;this._c(arr_point[k+1].x,arr_point[k+1].y,arr_point[k+2].x,arr_point[k+2].y,arr_point[k+3].x,arr_point[k+3].y)}},drawHorLine:function(align,y,x,r,penW,bMath){if(bMath){var oTextPr=this.GetTextPr();var oCopyTextPr;if(oTextPr){oCopyTextPr=oTextPr.Copy();oCopyTextPr.TextOutline=new AscFormat.CLn;oCopyTextPr.TextOutline.w=36E3*penW>>0;var oUnifill=oCopyTextPr.TextFill?oCopyTextPr.TextFill:oCopyTextPr.Unifill;if((!oUnifill|| !oUnifill.fill||!oUnifill.fill.type===Asc.c_oAscFill._SOLID||!oUnifill.fill.color)&&oCopyTextPr.Color)oUnifill=AscFormat.CreateUniFillByUniColor(AscFormat.CreateUniColorRGB(oCopyTextPr.Color.r,oCopyTextPr.Color.g,oCopyTextPr.Color.b));if(oUnifill)oCopyTextPr.TextOutline.Fill=oUnifill;this.SetTextPr(oCopyTextPr,this.m_oTheme)}this._s();this._m(x,y);this._l(r,y);this.ds();if(oCopyTextPr)this.SetTextPr(oTextPr,this.m_oTheme);return}this._s();this._m(x,y);this.checkCurveBezier(x,y,x+(r-x)/3,y,x+2/3*(r- x),y,r,y);this._l(r,y+penW);this.checkCurveBezier(r,y+penW,x+2/3*(r-x),y+penW,x+(r-x)/3,y+penW,x,y+penW);this._z();this.ds();this.df()},drawHorLine2:function(align,y,x,r,penW){var _y=y;switch(align){case 0:{_y=y+penW/2;break}case 1:{break}case 2:{_y=y-penW/2;break}}{this._s();this._m(x,_y-penW);this.checkCurveBezier(x,_y-penW,x+(r-x)/3,_y-penW,x+2/3*(r-x),_y-penW,r,_y-penW);this._l(r,_y);this.checkCurveBezier(r,_y,x+2/3*(r-x),_y,x+(r-x)/3,_y,x,_y);this._z();this.ds();this.df();this._s();this._m(x, _y+penW);this.checkCurveBezier(x,_y+penW,x+(r-x)/3,_y+penW,x+2/3*(r-x),_y+penW,r,_y+penW);this._l(r,_y+penW+penW);this.checkCurveBezier(r,_y+penW+penW,x+2/3*(r-x),_y+penW+penW,x+(r-x)/3,_y+penW+penW,x,_y+penW+penW);this._z();this.ds();this._e()}},drawVerLine:function(align,x,y,b,penW,bMath){if(bMath){var oTextPr=this.GetTextPr();var oCopyTextPr;if(oTextPr){oCopyTextPr=oTextPr.Copy();oCopyTextPr.TextOutline=new AscFormat.CLn;oCopyTextPr.TextOutline.w=36E3*penW>>0;var oUnifill=oCopyTextPr.TextFill? oCopyTextPr.TextFill:oCopyTextPr.Unifill;if((!oUnifill||!oUnifill.fill||!oUnifill.fill.type===Asc.c_oAscFill.FILL_TYPE_SOLID||!oUnifill.fill.color)&&oCopyTextPr.Color)oUnifill=AscFormat.CreateUniFillByUniColor(AscFormat.CreateUniColorRGB(oCopyTextPr.Color.r,oCopyTextPr.Color.g,oCopyTextPr.Color.b));if(oUnifill)oCopyTextPr.TextOutline.Fill=oUnifill;this.SetTextPr(oCopyTextPr,this.m_oTheme)}this._s();var _x=x;switch(align){case 0:{_x=x+penW/2;break}case 1:{break}case 2:{_x=x-penW/2}}this._m(_x,y);this._l(_x, b);this.ds();if(oCopyTextPr)this.SetTextPr(oTextPr,this.m_oTheme);return}var nLastCommand=this.m_aCommands[this.m_aCommands.length-1],bOldVal;if(nLastCommand===DRAW_COMMAND_TABLE){bOldVal=this.bCheckLines;this.bCheckLines=false}this.p_width(1E3*penW);this._s();var _x=x;switch(align){case 0:{_x=x+penW/2;break}case 1:{break}case 2:{_x=x-penW/2}}this._m(_x,y);this._l(_x,b);this.ds();if(nLastCommand===DRAW_COMMAND_TABLE)this.bCheckLines=bOldVal},drawHorLineExt:function(align,y,x,r,penW,leftMW,rightMW){var nLastCommand= this.m_aCommands[this.m_aCommands.length-1];if(nLastCommand===DRAW_COMMAND_TABLE){var bOldVal=this.bCheckLines;this.bCheckLines=false;this.p_width(penW*1E3);this._s();this._m(x,y);this._l(r,y);this.ds();this.bCheckLines=bOldVal}else this.drawHorLine(align,y,x+leftMW,r+rightMW,penW)},DrawTextArtComment:function(Element){this.m_oCurComment=Element;this.rect(Element.x0,Element.y0,Element.x1-Element.x0,Element.y1-Element.y0);this.df();this.m_oCurComment=null},rect:function(x,y,w,h){if(this.m_bTurnOff)return; var oLastCommand=this.m_aStack[this.m_aStack.length-1];if(oLastCommand&&(oLastCommand.m_nDrawType===2||oLastCommand.m_nDrawType===4)){this.Get_PathToDraw(true,true);this._m(x,y);this.checkCurveBezier(x,y,x+w/3,y,x+2/3*w,y,x+w,y);this._l(x+w,y+h);this.checkCurveBezier(x+w,y+h,x+2/3*w,y+h,x+w/3,y+h,x,y+h);this._z();this.ds()}else{var _x=x;var _y=y;var _r=x+w;var _b=y+h;this.Get_PathToDraw(true,true);this._m(_x,_y);this._l(_r,_y);this._l(_r,_b);this._l(_x,_b);this._l(_x,_y)}},TableRect:function(x,y, w,h){this.rect(x,y,w,h);this.df()},AddClipRect:function(x,y,w,h){var __rect=new AscCommon._rect;__rect.x=x;__rect.y=y;__rect.w=w;__rect.h=h;this.GrState.AddClipRect(__rect)},RemoveClipRect:function(){},SetClip:function(r){},RemoveClip:function(){},GetTransform:function(){return this.m_oTransform},GetLineWidth:function(){return 0},GetPen:function(){return 0},GetBrush:function(){return 0},drawFlowAnchor:function(x,y){},SavePen:function(){this.GrState.SavePen()},RestorePen:function(){this.GrState.RestorePen()}, SaveBrush:function(){this.GrState.SaveBrush()},RestoreBrush:function(){this.GrState.RestoreBrush()},SavePenBrush:function(){this.GrState.SavePenBrush()},RestorePenBrush:function(){this.GrState.RestorePenBrush()},SaveGrState:function(){this.GrState.SaveGrState()},RestoreGrState:function(){this.GrState.RestoreGrState()},StartClipPath:function(){this.m_bTurnOff=true},EndClipPath:function(){this.m_bTurnOff=false},SetTextPr:function(textPr,theme){var bNeedGetPath=false;if(!this.CheckCompareFillBrush(textPr, this.m_oTextPr))bNeedGetPath=true;this.m_oTextPr=textPr;if(bNeedGetPath)this.Get_PathToDraw(false,true);if(theme)this.m_oGrFonts.checkFromTheme(theme.themeElements.fontScheme,this.m_oTextPr.RFonts);else this.m_oGrFonts=this.m_oTextPr.RFonts},CheckCompareFillBrush:function(oTextPr1,oTextPr2){if(!oTextPr1&&oTextPr2||oTextPr1&&!oTextPr2)return false;if(oTextPr1&&oTextPr2){var oFill1=this.GetFillFromTextPr(oTextPr1);var oFill2=this.GetFillFromTextPr(oTextPr2);if(!CompareBrushes(oFill1,oFill2))return false; var oPen1=this.GetPenFromTextPr(oTextPr1);var oPen2=this.GetPenFromTextPr(oTextPr2);if(!CompareBrushes(oPen1,oPen2))return false}return true},GetFillFromTextPr:function(oTextPr){if(oTextPr){if(oTextPr.TextFill)return oTextPr.TextFill;if(oTextPr.Unifill)return oTextPr.Unifill;if(oTextPr.Color){var oColor=oTextPr.Color;if(oColor.Auto&&oTextPr.FontRef&&oTextPr.FontRef.Color&&this.m_oTheme){var oColorMap=AscFormat.DEFAULT_COLOR_MAP;var oApi=window&&window.editor;if(oApi){var oDoc=oApi.WordControl&&oApi.WordControl.m_oLogicDocument; if(oDoc&&oDoc.Get_ColorMap){var _cm=oDoc.Get_ColorMap();if(_cm)oColorMap=_cm}}oTextPr.FontRef.Color.check(this.m_oTheme,oColorMap);var RGBA=oTextPr.FontRef.Color.RGBA;oColor=new CDocumentColor(RGBA.R,RGBA.G,RGBA.B,RGBA.A)}return AscFormat.CreateUnfilFromRGB(oColor.r,oColor.g,oColor.b)}return null}else if(this.m_oBrush.Color1.R!==-1){var Color=this.m_oBrush.Color1;return AscFormat.CreateUnfilFromRGB(Color.R,Color.G,Color.B)}else return AscFormat.CreateUnfilFromRGB(0,0,0)},GetPenFromTextPr:function(oTextPr){if(oTextPr)return oTextPr.TextOutline; return null},GetTextPr:function(){return this.m_oTextPr},DrawPresentationComment:function(type,x,y,w,h){},private_removeVectors:function(){},private_restoreVectors:function(){},drawMailMergeField:function(x,y,w,h){}};function PolygonWrapper(oPolygon){this.oPolygon=oPolygon;var dCurLen=0;this.aLength=[];this.aLength[0]=0;var oPrevPoint=oPolygon[0],oCurPoint,dDX,dDY;for(var i=1;i<oPolygon.length;++i){oCurPoint=oPolygon[i];dDX=oCurPoint.x-oPrevPoint.x;dDY=oCurPoint.y-oPrevPoint.y;dCurLen+=Math.sqrt(dDX* dDX+dDY*dDY);this.aLength[i]=dCurLen;oPrevPoint=oCurPoint}this.dLen=dCurLen;this.nPointsCount=this.aLength.length}PolygonWrapper.prototype.getPointOnPolygon=function(dCT,bNeedPoints){var dFindLen=this.dLen*dCT;var nIndex=this.nPointsCount>>1;var nStartIndex=0,nDelta=nIndex-nStartIndex,dNextBool,nTempIndex;nTempIndex=nIndex+1;dNextBool=nTempIndex<this.nPointsCount&&this.aLength[nTempIndex]<=dFindLen;while(nDelta>0&&(this.aLength[nIndex]>dFindLen||dNextBool)){if(dNextBool)nStartIndex=nIndex;nIndex= nStartIndex+(nDelta>>1);nTempIndex=nIndex+1;dNextBool=nTempIndex<this.nPointsCount&&this.aLength[nTempIndex]<=dFindLen;nDelta=nIndex-nStartIndex}if(nTempIndex===this.nPointsCount){--nTempIndex;--nIndex}var t;var dDiv=this.aLength[nTempIndex]-this.aLength[nIndex];if(dDiv!==0)t=(dFindLen-this.aLength[nIndex])/dDiv;else t=0;var oPoint1=this.oPolygon[nIndex],oPoint2=this.oPolygon[nTempIndex];var oRetPoint1=oPoint1,oRetPoint2=oPoint2;if(bNeedPoints){var nRightIndex=nTempIndex,nLeftIndex=nIndex;var oLeftPoint= oPoint1,oRightPoint=oPoint2;var dx=oPoint1.x-oPoint2.x,dy=oPoint1.y-oPoint2.y;while(nRightIndex+1<this.oPolygon.length&&Math.abs(dx)<EPSILON_TEXT_AUTOFIT&&Math.abs(dy)<EPSILON_TEXT_AUTOFIT){dx=oRightPoint.x-oLeftPoint.x;dy=oRightPoint.y-oLeftPoint.y;oRightPoint=this.oPolygon[++nRightIndex]}while(nLeftIndex>0&&Math.abs(dx)<EPSILON_TEXT_AUTOFIT&&Math.abs(dy)<EPSILON_TEXT_AUTOFIT){dx=oRightPoint.x-oLeftPoint.x;dy=oRightPoint.y-oLeftPoint.y;oLeftPoint=this.oPolygon[--nLeftIndex]}if(Math.abs(dx)<EPSILON_TEXT_AUTOFIT&& Math.abs(dy)<EPSILON_TEXT_AUTOFIT)oRetPoint1={x:oRetPoint1.x+EPSILON_TEXT_AUTOFIT,y:oRetPoint1.y};else{oRetPoint1=oLeftPoint;oRetPoint2=oRightPoint}}return{x:oPoint1.x+t*(oPoint2.x-oPoint1.x),y:oPoint1.y+t*(oPoint2.y-oPoint1.y),oP1:oRetPoint1,oP2:oRetPoint2}};function ObjectsToDrawBetweenTwoPolygons(aObjectsToDraw,oBoundsController,oPolygonWrapper1,oPolygonWrapper2){var i;for(i=0;i<aObjectsToDraw.length;++i)aObjectsToDraw[i].geometry.checkBetweenPolygons(oBoundsController,oPolygonWrapper1,oPolygonWrapper2)} function CompareBrushes(oFill1,oFill2){if(oFill1&&!oFill2||!oFill1&&oFill2||oFill1&&oFill2&&!oFill1.IsIdentical(oFill2))return false;return true}function ComparePens(oPen1,oPen2){if(oPen1&&!oPen2||!oPen1&&oPen2||oPen1&&oPen2&&!oPen1.IsIdentical(oPen2))return false;return true}function GetRectContentWidth(oContent,dMaxWidth){var _maxWidth=AscFormat.isRealNumber(dMaxWidth)?dMaxWidth:1E5;oContent.Reset(0,0,_maxWidth,1E5);oContent.Recalculate_Page(0,true);var max_width=0;for(var i=0;i<oContent.Content.length;++i){var par= oContent.Content[i];if(par instanceof Paragraph)for(var j=0;j<par.Lines.length;++j)if(par.Lines[j].Ranges[0].W>max_width)max_width=par.Lines[j].Ranges[0].W}return max_width+2}window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].PATH_DIV_EPSILON=PATH_DIV_EPSILON;window["AscFormat"].ParaDrawingStruct=ParaDrawingStruct;window["AscFormat"].DRAW_COMMAND_TABLE=DRAW_COMMAND_TABLE;window["AscFormat"].DRAW_COMMAND_CONTENT=DRAW_COMMAND_CONTENT;window["AscFormat"].DRAW_COMMAND_PARAGRAPH=DRAW_COMMAND_PARAGRAPH; window["AscFormat"].DRAW_COMMAND_LINE=DRAW_COMMAND_LINE;window["AscFormat"].DRAW_COMMAND_DRAWING=DRAW_COMMAND_DRAWING;window["AscFormat"].DRAW_COMMAND_HIDDEN_ELEM=DRAW_COMMAND_HIDDEN_ELEM;window["AscFormat"].DRAW_COMMAND_NO_CREATE_GEOM=DRAW_COMMAND_NO_CREATE_GEOM;window["AscFormat"].DRAW_COMMAND_TABLE_ROW=DRAW_COMMAND_TABLE_ROW;window["AscFormat"].CreatePenFromParams=CreatePenFromParams;window["AscFormat"].CTextDrawer=CTextDrawer;window["AscFormat"].PolygonWrapper=PolygonWrapper;window["AscFormat"].GetRectContentWidth= GetRectContentWidth})(window);"use strict";(function(window,document){var FontStyle=AscFonts.FontStyle;var DecodeBase64Char=AscFonts.DecodeBase64Char;var b64_decode=AscFonts.b64_decode;var g_map_font_index={};var g_fonts_streams=[];function ZBase32Encoder(){this.EncodingTable="ybndrfg8ejkmcpqxot1uwisza345h769";this.DecodingTable="undefined"==typeof Uint8Array?new Array(128):new Uint8Array(128);var ii=0;for(ii=0;ii<128;ii++)this.DecodingTable[ii]=255;var _len_32=this.EncodingTable.length;for(ii=0;ii< _len_32;ii++)this.DecodingTable[this.EncodingTable.charCodeAt(ii)]=ii;this.GetUTF16_fromUnicodeChar=function(code){if(code<65536)return String.fromCharCode(code);else{code-=65536;return String.fromCharCode(55296|code>>10&1023)+String.fromCharCode(56320|code&1023)}};this.GetUTF16_fromUTF8=function(pBuffer){var _res="";var lIndex=0;var lCount=pBuffer.length;var val=0;while(lIndex<lCount){var byteMain=pBuffer[lIndex];if(0==(byteMain&128)){_res+=this.GetUTF16_fromUnicodeChar(byteMain);++lIndex}else if(0== (byteMain&32)){val=(byteMain&31)<<6|pBuffer[lIndex+1]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=2}else if(0==(byteMain&16)){val=(byteMain&15)<<12|(pBuffer[lIndex+1]&63)<<6|pBuffer[lIndex+2]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=3}else if(0==(byteMain&8)){val=(byteMain&7)<<18|(pBuffer[lIndex+1]&63)<<12|(pBuffer[lIndex+2]&63)<<6|pBuffer[lIndex+3]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=4}else if(0==(byteMain&4)){val=(byteMain&3)<<24|(pBuffer[lIndex+1]&63)<<18|(pBuffer[lIndex+ 2]&63)<<12|(pBuffer[lIndex+3]&63)<<6|pBuffer[lIndex+4]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=5}else{val=(byteMain&1)<<30|(pBuffer[lIndex+1]&63)<<24|(pBuffer[lIndex+2]&63)<<18|(pBuffer[lIndex+3]&63)<<12|(pBuffer[lIndex+4]&63)<<6|pBuffer[lIndex+5]&63;_res+=this.GetUTF16_fromUnicodeChar(val);lIndex+=5}}return _res};this.GetUTF8_fromUTF16=function(sData){var pCur=0;var pEnd=sData.length;var result=[];while(pCur<pEnd){var code=sData.charCodeAt(pCur++);if(code>=55296&&code<=57343&&pCur<pEnd)code= 65536+((code&1023)<<10|1023&sData.charCodeAt(pCur++));if(code<128)result.push(code);else if(code<2048){result.push(192|code>>6);result.push(128|code&63)}else if(code<65536){result.push(224|code>>12);result.push(128|code>>6&63);result.push(128|code&63)}else if(code<2097151){result.push(240|code>>18);result.push(128|code>>12&63);result.push(128|code>>6&63);result.push(128|code&63)}else if(code<67108863){result.push(248|code>>24);result.push(128|code>>18&63);result.push(128|code>>12&63);result.push(128| code>>6&63);result.push(128|code&63)}else if(code<2147483647){result.push(252|code>>30);result.push(128|code>>24&63);result.push(128|code>>18&63);result.push(128|code>>12&63);result.push(128|code>>6&63);result.push(128|code&63)}}return result};this.Encode=function(sData){return encodeURIComponent(sData);var data=this.GetUTF8_fromUTF16(sData);var encodedResult="";var len=data.length;for(var i=0;i<len;i+=5){var byteCount=Math.min(5,len-i);var buffer=0;for(var j=0;j<byteCount;++j){buffer*=256;buffer+= data[i+j]}var bitCount=byteCount*8;while(bitCount>0){var index=0;if(bitCount>=5){var _del=Math.pow(2,bitCount-5);index=buffer/_del&31}else{index=buffer&31>>5-bitCount;index<<=5-bitCount}encodedResult+=this.EncodingTable.charAt(index);bitCount-=5}}return encodedResult};this.Decode=function(data){var result=[];var _len=data.length;var obj={data:data,index:new Array(8)};var cur=0;while(cur<_len){cur=this.CreateIndexByOctetAndMovePosition(obj,cur);var shortByteCount=0;var buffer=0;for(var j=0;j<8&&obj.index[j]!= -1;++j){buffer*=32;buffer+=this.DecodingTable[obj.index[j]]&31;shortByteCount++}var bitCount=shortByteCount*5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]= obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>=128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT", text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1;this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]: window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,Asc.c_oAscError.Level.Critical);return}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData4(window[oThis.Id]);oThis.SetStreamIndex(__font_data_idx);oThis.Status=0;delete window[oThis.Id];if(null!=oThis.callback)oThis.callback()};this.LoadFontAsync2=function(basePath,_callback){this.callback=_callback;if(-1!=this.Status)return true;if(bIsLocalFontsUse){postLoadScript(this.Id); return}this.Status=2;var xhr=new XMLHttpRequest;xhr.open("GET",basePath+this.Id+"?"+window.CP_urlArgs,true);if(typeof ArrayBuffer!=="undefined"&&!window.opera)xhr.responseType="arraybuffer";if(xhr.overrideMimeType)xhr.overrideMimeType("text/plain; charset=x-user-defined");else xhr.setRequestHeader("Accept-Charset","x-user-defined");xhr.onload=function(){if(this.status!=200){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor= window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,Asc.c_oAscError.Level.Critical);return}oThis.Status=0;if(typeof ArrayBuffer!=="undefined"&&!window.opera&&this.response){var __font_data_idx=g_fonts_streams.length;var _uintData=new Uint8Array(this.response);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_uintData,_uintData.length);oThis.SetStreamIndex(__font_data_idx)}else if(AscCommon.AscBrowser.isIE){var _response= (new VBArray(this["responseBody"])).toArray();var srcLen=_response.length;var stream=new AscFonts.FontStream(AscFonts.allocate(srcLen),srcLen);var dstPx=stream.data;var index=0;while(index<srcLen){dstPx[index]=_response[index];index++}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=stream;oThis.SetStreamIndex(__font_data_idx)}else{var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData3(this.responseText);oThis.SetStreamIndex(__font_data_idx)}var guidOdttf= [160,102,214,32,20,150,71,250,149,105,184,80,176,65,73,72];var _stream=g_fonts_streams[g_fonts_streams.length-1];var _data=_stream.data};xhr.send(null)};this.LoadFontNative=function(){if(window["use_native_fonts_only"]===true){this.Status=0;return}var __font_data_idx=g_fonts_streams.length;var _data=window["native"]["GetFontBinary"](this.Id);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_data,_data.length);this.SetStreamIndex(__font_data_idx);this.Status=0}}CFontFileLoader.prototype.GetMaxLoadingCount= function(){return 3};CFontFileLoader.prototype.SetStreamIndex=function(index){this.stream_index=index};CFontFileLoader.prototype.LoadFontAsync=function(basePath,_callback,isEmbed){var oThis=this;if(window["AscDesktopEditor"]!==undefined&&this.CanUseOriginalFormat){if(-1!=this.Status)return true;this.callback=null;this.Status=2;window["AscDesktopEditor"]["LoadFontBase64"](this.Id);this._callback_font_load();return}if(this.CanUseOriginalFormat&&bIsSupportOriginalFormatFonts){this.LoadFontAsync2(basePath, _callback);return}this.callback=_callback;if(-1!=this.Status)return true;this.Status=2;if(bIsLocalFontsUse){postLoadScript(this.Id);return}var scriptElem=document.createElement("script");if(scriptElem.readyState&&false)scriptElem.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded"){scriptElem.onreadystatechange=null;setTimeout(oThis._callback_font_load,0)}};scriptElem.onload=scriptElem.onerror=oThis._callback_font_load;var src=basePath+this.Id+".js";if(isEmbed)src= AscCommon.g_oDocumentUrls.getUrl(src);scriptElem.setAttribute("src",src);scriptElem.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(scriptElem);return false};var FONT_TYPE_ADDITIONAL=0;var FONT_TYPE_STANDART=1;var FONT_TYPE_EMBEDDED=2;var FONT_TYPE_ADDITIONAL_CUT=3;var fontstyle_mask_regular=1;var fontstyle_mask_italic=2;var fontstyle_mask_bold=4;var fontstyle_mask_bolditalic=8;function GenerateMapId(api,name,style,size){var fontInfo=api.FontLoader.fontInfos[api.FontLoader.map_font_index[name]]; var index=-1;var bNeedBold=false;var bNeedItalic=false;var index=-1;var faceIndex=0;var bSrcItalic=false;var bSrcBold=false;switch(style){case FontStyle.FontStyleBoldItalic:{bSrcItalic=true;bSrcBold=true;bNeedBold=true;bNeedItalic=true;if(-1!=fontInfo.indexBI){index=fontInfo.indexBI;faceIndex=fontInfo.faceIndexBI;bNeedBold=false;bNeedItalic=false}else if(-1!=fontInfo.indexB){index=fontInfo.indexB;faceIndex=fontInfo.faceIndexB;bNeedBold=false}else if(-1!=fontInfo.indexI){index=fontInfo.indexI;faceIndex= fontInfo.faceIndexI;bNeedItalic=false}else{index=fontInfo.indexR;faceIndex=fontInfo.faceIndexR}break}case FontStyle.FontStyleBold:{bSrcBold=true;bNeedBold=true;bNeedItalic=false;if(-1!=fontInfo.indexB){index=fontInfo.indexB;faceIndex=fontInfo.faceIndexB;bNeedBold=false}else if(-1!=fontInfo.indexR){index=fontInfo.indexR;faceIndex=fontInfo.faceIndexR}else if(-1!=fontInfo.indexBI){index=fontInfo.indexBI;faceIndex=fontInfo.faceIndexBI;bNeedBold=false}else{index=fontInfo.indexI;faceIndex=fontInfo.faceIndexI}break}case FontStyle.FontStyleItalic:{bSrcItalic= true;bNeedBold=false;bNeedItalic=true;if(-1!=fontInfo.indexI){index=fontInfo.indexI;faceIndex=fontInfo.faceIndexI;bNeedItalic=false}else if(-1!=fontInfo.indexR){index=fontInfo.indexR;faceIndex=fontInfo.faceIndexR}else if(-1!=fontInfo.indexBI){index=fontInfo.indexBI;faceIndex=fontInfo.faceIndexBI;bNeedItalic=false}else{index=fontInfo.indexB;faceIndex=fontInfo.faceIndexB}break}case FontStyle.FontStyleRegular:{bNeedBold=false;bNeedItalic=false;if(-1!=fontInfo.indexR){index=fontInfo.indexR;faceIndex= fontInfo.faceIndexR}else if(-1!=fontInfo.indexI){index=fontInfo.indexI;faceIndex=fontInfo.faceIndexI}else if(-1!=fontInfo.indexB){index=fontInfo.indexB;faceIndex=fontInfo.faceIndexB}else{index=fontInfo.indexBI;faceIndex=fontInfo.faceIndexBI}}}var _ext="";if(bNeedBold)_ext+="nbold";if(bNeedItalic)_ext+="nitalic";var fontfile=api.FontLoader.fontFiles[index];return fontfile.Id+faceIndex+size+_ext}function CFontInfo(sName,thumbnail,type,indexR,faceIndexR,indexI,faceIndexI,indexB,faceIndexB,indexBI,faceIndexBI){this.Name= sName;this.Thumbnail=thumbnail;this.Type=type;this.NeedStyles=0;this.indexR=indexR;this.faceIndexR=faceIndexR;this.needR=false;this.indexI=indexI;this.faceIndexI=faceIndexI;this.needI=false;this.indexB=indexB;this.faceIndexB=faceIndexB;this.needB=false;this.indexBI=indexBI;this.faceIndexBI=faceIndexBI;this.needBI=false}CFontInfo.prototype={CheckFontLoadStyles:function(global_loader){if((this.NeedStyles&15)==15){this.needR=true;this.needI=true;this.needB=true;this.needBI=true}else{if((this.NeedStyles& 1)!=0)if(false===this.needR){this.needR=true;if(-1==this.indexR)if(-1!=this.indexI)this.needI=true;else if(-1!=this.indexB)this.needB=true;else this.needBI=true}if((this.NeedStyles&2)!=0)if(false===this.needI){this.needI=true;if(-1==this.indexI)if(-1!=this.indexR)this.needR=true;else if(-1!=this.indexBI)this.needBI=true;else this.needB=true}if((this.NeedStyles&4)!=0)if(false===this.needB){this.needB=true;if(-1==this.indexB)if(-1!=this.indexR)this.needR=true;else if(-1!=this.indexBI)this.needBI=true; else this.needI=true}if((this.NeedStyles&8)!=0)if(false===this.needBI){this.needBI=true;if(-1==this.indexBI)if(-1!=this.indexB)this.needB=true;else if(-1!=this.indexI)this.needI=true;else this.needR=true}}var isEmbed=FONT_TYPE_EMBEDDED==this.Type;var fonts=isEmbed?global_loader.embeddedFontFiles:global_loader.fontFiles;var basePath=isEmbed?global_loader.embeddedFilesPath:global_loader.fontFilesPath;var isNeed=false;if(this.needR===true&&-1!=this.indexR&&fonts[this.indexR].CheckLoaded()===false){fonts[this.indexR].LoadFontAsync(basePath, null,isEmbed);isNeed=true}if(this.needI===true&&-1!=this.indexI&&fonts[this.indexI].CheckLoaded()===false){fonts[this.indexI].LoadFontAsync(basePath,null,isEmbed);isNeed=true}if(this.needB===true&&-1!=this.indexB&&fonts[this.indexB].CheckLoaded()===false){fonts[this.indexB].LoadFontAsync(basePath,null,isEmbed);isNeed=true}if(this.needBI===true&&-1!=this.indexBI&&fonts[this.indexBI].CheckLoaded()===false){fonts[this.indexBI].LoadFontAsync(basePath,null,isEmbed);isNeed=true}return isNeed},CheckFontLoadStylesNoLoad:function(global_loader){var fonts= FONT_TYPE_EMBEDDED==this.Type?global_loader.embeddedFontFiles:global_loader.fontFiles;var _isNeed=false;if(-1!=this.indexR&&fonts[this.indexR].CheckLoaded()===false)_isNeed=true;if(-1!=this.indexI&&fonts[this.indexI].CheckLoaded()===false)_isNeed=true;if(-1!=this.indexB&&fonts[this.indexB].CheckLoaded()===false)_isNeed=true;if(-1!=this.indexBI&&fonts[this.indexBI].CheckLoaded()===false)_isNeed=true;return _isNeed},LoadFontsFromServer:function(global_loader){var fonts=global_loader.fontFiles;var basePath= global_loader.fontFilesPath;if(-1!=this.indexR&&fonts[this.indexR].CheckLoaded()===false)fonts[this.indexR].LoadFontAsync(basePath,null);if(-1!=this.indexI&&fonts[this.indexI].CheckLoaded()===false)fonts[this.indexI].LoadFontAsync(basePath,null);if(-1!=this.indexB&&fonts[this.indexB].CheckLoaded()===false)fonts[this.indexB].LoadFontAsync(basePath,null);if(-1!=this.indexBI&&fonts[this.indexBI].CheckLoaded()===false)fonts[this.indexBI].LoadFontAsync(basePath,null)},LoadFont:function(font_loader,fontManager, fEmSize,lStyle,dHorDpi,dVerDpi,transform,isNoSetupToManager){var sReturnName=this.Name;var bNeedBold=false;var bNeedItalic=false;var index=-1;var faceIndex=0;var bSrcItalic=false;var bSrcBold=false;switch(lStyle){case FontStyle.FontStyleBoldItalic:{bSrcItalic=true;bSrcBold=true;bNeedBold=true;bNeedItalic=true;if(-1!=this.indexBI){index=this.indexBI;faceIndex=this.faceIndexBI;bNeedBold=false;bNeedItalic=false}else if(-1!=this.indexB){index=this.indexB;faceIndex=this.faceIndexB;bNeedBold=false}else if(-1!= this.indexI){index=this.indexI;faceIndex=this.faceIndexI;bNeedItalic=false}else{index=this.indexR;faceIndex=this.faceIndexR}break}case FontStyle.FontStyleBold:{bSrcBold=true;bNeedBold=true;bNeedItalic=false;if(-1!=this.indexB){index=this.indexB;faceIndex=this.faceIndexB;bNeedBold=false}else if(-1!=this.indexR){index=this.indexR;faceIndex=this.faceIndexR}else if(-1!=this.indexBI){index=this.indexBI;faceIndex=this.faceIndexBI;bNeedBold=false}else{index=this.indexI;faceIndex=this.faceIndexI}break}case FontStyle.FontStyleItalic:{bSrcItalic= true;bNeedBold=false;bNeedItalic=true;if(-1!=this.indexI){index=this.indexI;faceIndex=this.faceIndexI;bNeedItalic=false}else if(-1!=this.indexR){index=this.indexR;faceIndex=this.faceIndexR}else if(-1!=this.indexBI){index=this.indexBI;faceIndex=this.faceIndexBI;bNeedItalic=false}else{index=this.indexB;faceIndex=this.faceIndexB}break}case FontStyle.FontStyleRegular:{bNeedBold=false;bNeedItalic=false;if(-1!=this.indexR){index=this.indexR;faceIndex=this.faceIndexR}else if(-1!=this.indexI){index=this.indexI; faceIndex=this.faceIndexI}else if(-1!=this.indexB){index=this.indexB;faceIndex=this.faceIndexB}else{index=this.indexBI;faceIndex=this.faceIndexBI}}}var fontfile=null;if(this.Type==FONT_TYPE_EMBEDDED)fontfile=font_loader.embeddedFontFiles[index];else fontfile=font_loader.fontFiles[index];if(window["NATIVE_EDITOR_ENJINE"]&&fontfile.Status!=0)fontfile.LoadFontNative();var pFontFile=fontManager.LoadFont(fontfile,faceIndex,fEmSize,bSrcBold,bSrcItalic,bNeedBold,bNeedItalic,isNoSetupToManager);if(!pFontFile&& -1===fontfile.stream_index&&true===AscFonts.IsLoadFontOnCheckSymbols&&true!=AscFonts.IsLoadFontOnCheckSymbolsWait){AscFonts.IsLoadFontOnCheckSymbols=false;AscFonts.IsLoadFontOnCheckSymbolsWait=true;AscFonts.FontPickerByCharacter.loadFonts(window.editor,function(){AscFonts.IsLoadFontOnCheckSymbolsWait=false;this.WordControl&&this.WordControl.private_RefreshAll()})}if(pFontFile&&true!==isNoSetupToManager){var newEmSize=fontManager.UpdateSize(fEmSize,dVerDpi,dVerDpi);pFontFile.SetSizeAndDpi(newEmSize, dHorDpi,dVerDpi);if(undefined!==transform)fontManager.SetTextMatrix2(transform.sx,transform.shy,transform.shx,transform.sy,transform.tx,transform.ty);else fontManager.SetTextMatrix(1,0,0,1,0,0)}return pFontFile},GetFontID:function(font_loader,lStyle){var sReturnName=this.Name;var bNeedBold=false;var bNeedItalic=false;var index=-1;var faceIndex=0;var bSrcItalic=false;var bSrcBold=false;switch(lStyle){case FontStyle.FontStyleBoldItalic:{bSrcItalic=true;bSrcBold=true;bNeedBold=true;bNeedItalic=true; if(-1!=this.indexBI){index=this.indexBI;faceIndex=this.faceIndexBI;bNeedBold=false;bNeedItalic=false}else if(-1!=this.indexB){index=this.indexB;faceIndex=this.faceIndexB;bNeedBold=false}else if(-1!=this.indexI){index=this.indexI;faceIndex=this.faceIndexI;bNeedItalic=false}else{index=this.indexR;faceIndex=this.faceIndexR}break}case FontStyle.FontStyleBold:{bSrcBold=true;bNeedBold=true;bNeedItalic=false;if(-1!=this.indexB){index=this.indexB;faceIndex=this.faceIndexB;bNeedBold=false}else if(-1!=this.indexR){index= this.indexR;faceIndex=this.faceIndexR}else if(-1!=this.indexBI){index=this.indexBI;faceIndex=this.faceIndexBI;bNeedBold=false}else{index=this.indexI;faceIndex=this.faceIndexI}break}case FontStyle.FontStyleItalic:{bSrcItalic=true;bNeedBold=false;bNeedItalic=true;if(-1!=this.indexI){index=this.indexI;faceIndex=this.faceIndexI;bNeedItalic=false}else if(-1!=this.indexR){index=this.indexR;faceIndex=this.faceIndexR}else if(-1!=this.indexBI){index=this.indexBI;faceIndex=this.faceIndexBI;bNeedItalic=false}else{index= this.indexB;faceIndex=this.faceIndexB}break}case FontStyle.FontStyleRegular:{bNeedBold=false;bNeedItalic=false;if(-1!=this.indexR){index=this.indexR;faceIndex=this.faceIndexR}else if(-1!=this.indexI){index=this.indexI;faceIndex=this.faceIndexI}else if(-1!=this.indexB){index=this.indexB;faceIndex=this.faceIndexB}else{index=this.indexBI;faceIndex=this.faceIndexBI}}}var fontfile=this.Type==FONT_TYPE_EMBEDDED?font_loader.embeddedFontFiles[index]:font_loader.fontFiles[index];return{id:fontfile.Id,faceIndex:faceIndex, file:fontfile}},GetBaseStyle:function(lStyle){switch(lStyle){case FontStyle.FontStyleBoldItalic:{if(-1!=this.indexBI)return FontStyle.FontStyleBoldItalic;else if(-1!=this.indexB)return FontStyle.FontStyleBold;else if(-1!=this.indexI)return FontStyle.FontStyleItalic;else return FontStyle.FontStyleRegular;break}case FontStyle.FontStyleBold:{if(-1!=this.indexB)return FontStyle.FontStyleBold;else if(-1!=this.indexR)return FontStyle.FontStyleRegular;else if(-1!=this.indexBI)return FontStyle.FontStyleBoldItalic; else return FontStyle.FontStyleItalic;break}case FontStyle.FontStyleItalic:{if(-1!=this.indexI)return FontStyle.FontStyleItalic;else if(-1!=this.indexR)return FontStyle.FontStyleRegular;else if(-1!=this.indexBI)return FontStyle.FontStyleBoldItalic;else return FontStyle.FontStyleBold;break}case FontStyle.FontStyleRegular:{if(-1!=this.indexR)return FontStyle.FontStyleRegular;else if(-1!=this.indexI)return FontStyle.FontStyleItalic;else if(-1!=this.indexB)return FontStyle.FontStyleBold;else return FontStyle.FontStyleBoldItalic}}return FontStyle.FontStyleRegular}}; function CFont(name,id,type,thumbnail,style){this.name=name;this.id=id;this.type=type;this.thumbnail=thumbnail;if(null!=style)this.NeedStyles=style;else this.NeedStyles=fontstyle_mask_regular|fontstyle_mask_italic|fontstyle_mask_bold|fontstyle_mask_bolditalic}CFont.prototype.asc_getFontId=function(){return this.id};CFont.prototype.asc_getFontName=function(){return this.name};CFont.prototype.asc_getFontThumbnail=function(){return this.thumbnail};CFont.prototype.asc_getFontType=function(){return this.type}; var ImageLoadStatus={Loading:0,Complete:1};function CImage(src){this.src=src;this.Image=null;this.Status=ImageLoadStatus.Complete}function DecodeBase64(imData,szSrc){var srcLen=szSrc.length;var nWritten=0;var dstPx=imData.data;var index=0;if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]= (dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}}var g_font_files,g_font_infos;(function(){var i,l;var files=window["__fonts_files"];if(!files&&window["native"]&&window["native"]["GenerateAllFonts"])window["native"]["GenerateAllFonts"](); files=window["__fonts_files"];l=files?files.length:0;g_font_files=new Array(l);for(i=0;i<l;i++)g_font_files[i]=new CFontFileLoader(files[i]);files=window["__fonts_infos"];l=files?files.length:0;g_font_infos=new Array(l);for(i=0;i<l;i++){var _info=files[i];g_font_infos[i]=new CFontInfo(_info[0],i,0,_info[1],_info[2],_info[3],_info[4],_info[5],_info[6],_info[7],_info[8]);g_map_font_index[_info[0]]=i}var _wngds3=new CFontFileLoader("ASC.ttf");_wngds3.Status=0;l=g_fonts_streams.length;g_fonts_streams[l]= AscFonts.CreateFontData2("AAEAAAARAQAABAAQTFRTSMgBAWkAAAIMAAAACU9TLzI5/eoAAAABmAAAAGBWRE1Yb8J3OwAAAhgAAAXgY21hcPBr8H4AAAjAAAAASGN2dCBAjTlRAAASGAAAAn5mcGdtgM3J1AAACQgAAAdFZ2FzcAAXAAkAABmgAAAAEGdseWalB9HFAAAUmAAAAORoZG14G81RIAAAB/gAAADIaGVhZAUoUMgAAAEcAAAANmhoZWEOZANxAAABVAAAACRobXR4FGIB2gAAAfgAAAAUbG9jYQBoALoAABV8AAAADG1heHAITQdkAAABeAAAACBuYW1lDC7+vAAAFYgAAAPJcG9zdONgvM0AABlUAAAASXByZXB9uZ8bAAAQUAAAAcYAAQAAAAEAAPQVs0xfDzz1ABsIAAAAAADPTriwAAAAAM+3TU8AgAAABnUFyAAAAAwAAQAAAAAAAAABAAAHbP5QAAAHIQCA/foGdQABAAAAAAAAAAAAAAAAAAAABQABAAAABQAJAAIAAAAAAAIAEAAUAE0AAAfoB0UAAAAAAAMFGAGQAAUAAATOBM4AAAMWBM4EzgAAAxYAZAMgDAAFBAECAQgHBwcHAAAAAAAAAAAAAAAAAAAAAE1TICAAQPAi8DgGKwGkADEHbAGwgAAAAAAAAAD/////AAAAIAAABAAAgAAAAAAE0gAAByEArQRvAK0AAAAFZAEBZGQAAAAAAAABAAEBAQEBAAwA+Aj/AAgACP/+AAkACP/9AAoACf/+AAsACv/+AAwAC//+AA0ADP/9AA4ADf/9AA8ADv/9ABAADv/9ABEAD//9ABIAEf/8ABMAEv/7ABQAE//7ABUAFP/7ABYAFf/7ABcAFv/7ABgAF//7ABkAGP/6ABoAGP/6ABsAGP/6ABwAGf/7AB0AGv/7AB4AHP/5AB8AHf/5ACAAHv/5ACEAH//4ACIAIP/5ACMAIf/5ACQAIf/4ACUAIv/4ACYAI//4ACcAJP/4ACgAJf/4ACkAJv/3ACoAKP/2ACsAKf/2ACwAKf/2AC0AKv/2AC4AKv/3AC8AK//2ADAALP/2ADEALf/2ADIALv/2ADMAL//1ADQAMP/1ADUAMf/1ADYAM//0ADcANP/0ADgANP/0ADkANf/zADoANv/zADsAN//zADwAOP/zAD0AOf/zAD4AOf/zAD8AOv/zAEAAO//yAEEAPP/zAEIAPf/yAEMAPv/yAEQAP//xAEUAQP/xAEYAQf/xAEcAQv/xAEgAQ//xAEkARP/xAEoARf/wAEsARv/wAEwARv/wAE0ASP/vAE4ASf/vAE8ASf/vAFAASv/vAFEAS//uAFIATP/uAFMATf/vAFQATv/vAFUAT//uAFYAT//uAFcAUP/uAFgAUf/uAFkAU//tAFoAVP/sAFsAVf/sAFwAVv/sAF0AV//sAF4AWP/sAF8AWf/sAGAAWf/rAGEAWf/rAGIAWv/rAGMAW//rAGQAXP/rAGUAXv/qAGYAX//qAGcAYP/qAGgAYf/qAGkAYv/qAGoAYv/pAGsAY//pAGwAZP/pAG0AZf/pAG4AZv/pAG8AZ//pAHAAaP/oAHEAav/nAHIAav/nAHMAa//nAHQAa//nAHUAbP/nAHYAbf/nAHcAbv/mAHgAb//nAHkAcP/nAHoAcf/nAHsAcv/mAHwAc//mAH0Adf/lAH4Adf/lAH8Adv/lAIAAd//lAIEAeP/kAIIAef/kAIMAev/kAIQAev/kAIUAe//kAIYAfP/kAIcAff/kAIgAff/jAIkAf//iAIoAgP/iAIsAgf/iAIwAgv/iAI0Ag//iAI4AhP/iAI8Ahf/iAJAAhv/hAJEAh//hAJIAh//hAJMAiP/hAJQAiv/gAJUAiv/gAJYAi//gAJcAjP/gAJgAjf/gAJkAjv/fAJoAj//fAJsAkP/fAJwAkP/fAJ0Akf/fAJ4Akv/fAJ8Ak//fAKAAlf/eAKEAlv/dAKIAl//dAKMAmP/dAKQAmf/dAKUAmv/dAKYAmv/dAKcAmv/dAKgAm//cAKkAnP/cAKoAnf/cAKsAnv/cAKwAoP/bAK0Aof/bAK4Aov/bAK8Ao//aALAAo//bALEApP/bALIApf/aALMApv/aALQAp//aALUAqP/aALYAqf/aALcAqv/ZALgAq//ZALkArP/YALoArP/YALsArf/YALwArv/YAL0Ar//YAL4AsP/YAL8Asf/XAMAAsv/XAMEAs//XAMIAtP/XAMMAtf/XAMQAtv/WAMUAt//WAMYAuP/WAMcAuf/VAMgAuv/VAMkAu//VAMoAu//VAMsAvP/VAMwAvf/VAM0Avv/VAM4Avv/VAM8Av//VANAAwf/TANEAwv/TANIAw//TANMAxP/TANQAxf/TANUAxv/TANYAx//TANcAyP/TANgAyP/SANkAyf/SANoAyv/SANsAy//RANwAzP/RAN0Azf/RAN4Azv/RAN8Az//QAOAA0P/RAOEA0f/QAOIA0f/QAOMA0v/QAOQA0//QAOUA1P/QAOYA1f/PAOcA1//PAOgA2P/OAOkA2f/OAOoA2v/OAOsA2//OAOwA3P/OAO0A2//OAO4A3P/OAO8A3f/OAPAA3v/NAPEA3//NAPIA4P/NAPMA4v/MAPQA4//MAPUA5P/MAPYA5f/MAPcA5f/LAPgA5v/LAPkA5//LAPoA6P/LAPsA6f/LAPwA6v/LAP0A6//LAP4A6//KAP8A7f/KAAAAGAAAAAgLCgYABwoKAAwLBgAHCwsADQwHAAgMDAAPDQgACQ0NABAOCAAKDg4AEQ8JAAoPDwATEQoACxERABUTCwANExMAGBUMAA4VFQAbGA4AEBgYAB0aDwARGhoAIB0QABMdHQAhHREAFB0dACUhEwAWISEAKiUVABklJQAuKRcAHCkpADItGQAeLS0ANjAbACEwMAA6NB0AIzQ0AEM8IgAoPDwAS0MmAC1DQwBTSioAMkpKAFxSLgA3UlIAZFkyADxZWQAAAAACAAEAAAAAABQAAwAAAAAAIAAGAAwAAP//AAEAAAAEACgAAAAGAAQAAQAC8CLwOP//AADwIvA4//8P4Q/MAAEAAAAAAABANzg3NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAsRSNGYCCwJmCwBCYjSEgtLEUjRiNhILAmYbAEJiNISC0sRSNGYLAgYSCwRmCwBCYjSEgtLEUjRiNhsCBgILAmYbAgYbAEJiNISC0sRSNGYLBAYSCwZmCwBCYjSEgtLEUjRiNhsEBgILAmYbBAYbAEJiNISC0sARAgPAA8LSwgRSMgsM1EIyC4AVpRWCMgsI1EI1kgsO1RWCMgsE1EI1kgsAQmUVgjILANRCNZISEtLCAgRRhoRCCwAWAgRbBGdmiKRWBELSwBsQsKQyNDZQotLACxCgtDI0MLLSwAsEYjcLEBRj4BsEYjcLECRkU6sQIACA0tLEWwSiNERbBJI0QtLCBFsAMlRWFksFBRWEVEGyEhWS0ssAFDYyNisAAjQrAPKy0sIEWwAENgRC0sAbAGQ7AHQ2UKLSwgabBAYbAAiyCxLMCKjLgQAGJgKwxkI2RhXFiwA2FZLSxFsBErsEcjRLBHeuQYLSy4AaZUWLAJQ7gBAFRYuQBK/4CxSYBERFlZLSywEkNYh0WwESuwFyNEsBd65BsDikUYaSCwFyNEioqHILCgUViwESuwFyNEsBd65BshsBd65FlZGC0sLSxLUlghRUQbI0WMILADJUVSWEQbISFZWS0sARgvLSwgsAMlRbBJI0RFsEojREVlI0UgsAMlYGogsAkjQiNoimpgYSCwGoqwAFJ5IbIaSkC5/+AASkUgilRYIyGwPxsjWWFEHLEUAIpSebNJQCBJRSCKVFgjIbA/GyNZYUQtLLEQEUMjQwstLLEOD0MjQwstLLEMDUMjQwstLLEMDUMjQ2ULLSyxDg9DI0NlCy0ssRARQyNDZQstLEtSWEVEGyEhWS0sASCwAyUjSbBAYLAgYyCwAFJYI7ACJTgjsAIlZTgAimM4GyEhISEhWQEtLEVpsAlDYIoQOi0sAbAFJRAjIIr1ALABYCPt7C0sAbAFJRAjIIr1ALABYSPt7C0sAbAGJRD1AO3sLSwgsAFgARAgPAA8LSwgsAFhARAgPAA8LSywKyuwKiotLACwB0OwBkMLLSw+sCoqLSw1LSx2sEsjcBAgsEtFILAAUFiwAWFZOi8YLSwhIQxkI2SLuEAAYi0sIbCAUVgMZCNki7ggAGIbsgBALytZsAJgLSwhsMBRWAxkI2SLuBVVYhuyAIAvK1mwAmAtLAxkI2SLuEAAYmAjIS0stAABAAAAFbAIJrAIJrAIJrAIJg8QFhNFaDqwARYtLLQAAQAAABWwCCawCCawCCawCCYPEBYTRWhlOrABFi0sRSMgRSCxBAUlilBYJmGKixsmYIqMWUQtLEYjRmCKikYjIEaKYIphuP+AYiMgECOKsUtLinBFYCCwAFBYsAFhuP/AixuwQIxZaAE6LSywMyuwKiotLLATQ1gDGwJZLSywE0NYAhsDWS24ADksS7gADFBYsQEBjlm4Af+FuABEHbkADAADX14tuAA6LCAgRWlEsAFgLbgAOyy4ADoqIS24ADwsIEawAyVGUlgjWSCKIIpJZIogRiBoYWSwBCVGIGhhZFJYI2WKWS8gsABTWGkgsABUWCGwQFkbaSCwAFRYIbBAZVlZOi24AD0sIEawBCVGUlgjilkgRiBqYWSwBCVGIGphZFJYI4pZL/0tuAA+LEsgsAMmUFhRWLCARBuwQERZGyEhIEWwwFBYsMBEGyFZWS24AD8sICBFaUSwAWAgIEV9aRhEsAFgLbgAQCy4AD8qLbgAQSxLILADJlNYsEAbsABZioogsAMmU1gjIbCAioobiiNZILADJlNYIyG4AMCKihuKI1kgsAMmU1gjIbgBAIqKG4ojWSCwAyZTWCMhuAFAioobiiNZILgAAyZTWLADJUW4AYBQWCMhuAGAIyEbsAMlRSMhIyFZGyFZRC24AEIsS1NYRUQbISFZLbgAQyxLuAAMUFixAQGOWbgB/4W4AEQduQAMAANfXi24AEQsICBFaUSwAWAtuABFLLgARCohLbgARiwgRrADJUZSWCNZIIogiklkiiBGIGhhZLAEJUYgaGFkUlgjZYpZLyCwAFNYaSCwAFRYIbBAWRtpILAAVFghsEBlWVk6LbgARywgRrAEJUZSWCOKWSBGIGphZLAEJUYgamFkUlgjilkv/S24AEgsSyCwAyZQWFFYsIBEG7BARFkbISEgRbDAUFiwwEQbIVlZLbgASSwgIEVpRLABYCAgRX1pGESwAWAtuABKLLgASSotuABLLEsgsAMmU1iwQBuwAFmKiiCwAyZTWCMhsICKihuKI1kgsAMmU1gjIbgAwIqKG4ojWSCwAyZTWCMhuAEAioobiiNZILADJlNYIyG4AUCKihuKI1kguAADJlNYsAMlRbgBgFBYIyG4AYAjIRuwAyVFIyEjIVkbIVlELbgATCxLU1hFRBshIVktAAAAuABDKwC6AT0AAQBKK7gBPCBFfWkYRLgAOSsBugE5AAEAOysBvwE5AE0APwAxACMAFQAAAEErALoBOgABAEAruAE4IEV9aRhEQAwARkYAAAASEQhASCC4ARyySDIguAEDQGFIMiC/SDIgiUgyIIdIMiCGSDIgZ0gyIGVIMiBhSDIgXEgyIFVIMiCISDIgZkgyIGJIMiBgSDI3kGoHJAgiCCAIHggcCBoIGAgWCBQIEggQCA4IDAgKCAgIBggECAIIAAgAsBMDSwJLU0IBS7DAYwBLYiCw9lMjuAEKUVqwBSNCAbASSwBLVEIYuQABB8CFjbA4K7ACiLgBAFRYuAH/sQEBjoUbsBJDWLkAAQH/hY0buQABAf+FjVlZABYrKysrKysrKysrKysrKysrKysrGCsYKwGyUAAyS2GLYB0AKysrKwErKysrKysrKysrKwFFaVNCAUtQWLEIAEJZQ1xYsQgAQlmzAgsKEkNYYBshWUIWEHA+sBJDWLk7IRh+G7oEAAGoAAsrWbAMI0KwDSNCsBJDWLktQS1BG7oEAAQAAAsrWbAOI0KwDyNCsBJDWLkYfjshG7oBqAQAAAsrWbAQI0KwESNCAQAAAAAAAAAAAAAAAAAAEDgF4gAAAAAA7gAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////8AAAAAAGMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYwCUAJQAlACUBcgFyABiAJQAlAXIAGIAYgBjAJQBUQBjAGMAgACUAYoCTwLkBcgAlACUAJQAlAC6APcBKAEoASgBWQHuAh8FyADFAMYBKAEoBEsEVgRWBS8FyAXIBisAMQBiAGIAYwBjAJQAlACUAJQAlADFAMYAxgDeAPYA9wD3APcBKAEoASgBKAFZAXIBcgGKAYoBvAHtAe0B7gJQAlACUAJRApoCmgLkAuQDTQOzBEsESwRWBKAEqwSrBQIFAgXIBcgGBAYEBjIGrQatBq0GrQBjAJQAlADFASgBKAEoASgBKAFyAYoBiwG0Ae0B7gHuAlACUQKiAuQC5AMAAxUDFgMuA0cDlQOyA9oESwRLBQIFAwU+BT4FPgVbBVsFawV+BcgFyAXIBcgFyAXIBcgGMQZQBoEG1wdTB4sAegCeAHYAAAAAAAAAAAAAAAAAAACUAJQAlAKBAHMAxQVrA3gCmgEoA0cDLgFyAXICaQGLB1MCHwNNA5UAlAFQAlEBWQBiA7IAzAD3AxwA9wC7AVkAAQatBq0GrQXIBq0FyAUCBQIFAgDeAbwBKAGKAlABigMWAuQG1wEoAe4GBAHtBgQB7QJRACoAlAAAAAAAKgAAAAAAAAACAIAAAAOABcgAAwAHACBAEQddAQRdAe0AAARnAAVnA9QAL/7tEO0AP+7tEO0xMDMRIRElIREhgAMA/YACAP4ABcj6OIAEyAABAK0BcgZ1BFYABgAXuABDKwC4AAUvuAAAL7oABAABAEYrMDEBESE1IREBBQP7qgRWAXIBcgEolAEo/o4AAAAAAQCtAXIGdQXIAAgALrUAB/4CAQK4AQZACQR+CAIICAIAA7gBALIGWwAv/e0ROTkvLwAv/eQ5EO05MTATAREhETMRIRGtAXIDwpT7qgLkAXL+2AKa/NL+2AAAAAAAACQAJAAkAEQAcgAAAB0BYgABAAAAAAAAAEAAAAABAAAAAAABAAUAQAABAAAAAAACAAcARQABAAAAAAADAAUATAABAAAAAAAEAAUAUQABAAAAAAAFAAsAVgABAAAAAAAGAAUAYQABAAAAAAAHACwAZgABAAAAAAASAAUAkgADAAAEBgACAAwAlwADAAAEBwACABAAowADAAAECQAAAIAAswADAAAECQABAAoBMwADAAAECQACAA4BPQADAAAECQADAAoBSwADAAAECQAEAAoBVQADAAAECQAFABYBXwADAAAECQAGABYBdQADAAAECQAHAFgBiwADAAAECgACAAwB4wADAAAECwACABAB7wADAAAEDAACAAwB/wADAAAEEAACAA4CCwADAAAEEwACABICGQADAAAEFAACAAwCKwADAAAEHQACAAwCNwADAAAIFgACAAwCQwADAAAMCgACAAwCTwADAAAMDAACAAwCW0NvcHlyaWdodCAoYykgQXNjZW5zaW8gU3lzdGVtIFNJQSAyMDEyLTIwMTQuIEFsbCByaWdodHMgcmVzZXJ2ZWRBU0NXM1JlZ3VsYXJBU0NXM0FTQ1czVmVyc2lvbiAxLjBBU0NXM0FTQ1czIGlzIGEgdHJhZGVtYXJrIG9mIEFzY2Vuc2lvIFN5c3RlbSBTSUEuQVNDVzMAbgBvAHIAbQBhAGwAUwB0AGEAbgBkAGEAcgBkAEMAbwBwAHkAcgBpAGcAaAB0ACAAKABjACkAIABBAHMAYwBlAG4AcwBpAG8AIABTAHkAcwB0AGUAbQAgAFMASQBBACAAMgAwADEAMgAtADIAMAAxADQALgAgAEEAbABsACAAcgBpAGcAaAB0AHMAIAByAGUAcwBlAHIAdgBlAGQAQQBTAEMAVwAzAFIAZQBnAHUAbABhAHIAQQBTAEMAVwAzAEEAUwBDAFcAMwBWAGUAcgBzAGkAbwBuACAAMQAuADAAVgBlAHIAcwBpAG8AbgAgADEALgAwAEEAUwBDAFcAMwAgAGkAcwAgAGEAIAB0AHIAYQBkAGUAbQBhAHIAawAgAG8AZgAgAEEAcwBjAGUAbgBzAGkAbwAgAFMAeQBzAHQAZQBtACAAUwBJAEEALgBOAG8AcgBtAGEAbABOAG8AcgBtAGEAYQBsAGkATgBvAHIAbQBhAGwATgBvAHIAbQBhAGwAZQBTAHQAYQBuAGQAYQBhAHIAZABOAG8AcgBtAGEAbABOAG8AcgBtAGEAbABOAG8AcgBtAGEAbABOAG8AcgBtAGEAbABOAG8AcgBtAGEAbAAAAAACAAAAAAAA/zgAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAECAAIBAwEEBE5VTEwHYTJyaWdodA9hMmNvcm5lcmR3bmxlZnQAAAAAAAADAAgAAgAQAAH//wAD"); _wngds3.SetStreamIndex(l);g_font_files.push(_wngds3);l=g_font_infos.length;g_font_infos[l]=new CFontInfo("ASCW3",0,FONT_TYPE_ADDITIONAL,g_font_files.length-1,0,-1,-1,-1,-1,-1,-1);g_map_font_index["ASCW3"]=l;if(AscFonts.FontPickerByCharacter)AscFonts.FontPickerByCharacter.init(window["__fonts_infos"]);delete window["__fonts_files"];delete window["__fonts_infos"]})();var prot;window["AscFonts"]=window["AscFonts"]||{};window["AscFonts"].g_font_files=g_font_files;window["AscFonts"].g_font_infos=g_font_infos; window["AscFonts"].g_map_font_index=g_map_font_index;window["AscFonts"].g_fonts_streams=g_fonts_streams;window["AscFonts"].FONT_TYPE_ADDITIONAL=FONT_TYPE_ADDITIONAL;window["AscFonts"].FONT_TYPE_STANDART=FONT_TYPE_STANDART;window["AscFonts"].FONT_TYPE_EMBEDDED=FONT_TYPE_EMBEDDED;window["AscFonts"].FONT_TYPE_ADDITIONAL_CUT=FONT_TYPE_ADDITIONAL_CUT;window["AscFonts"].CFontFileLoader=CFontFileLoader;window["AscFonts"].GenerateMapId=GenerateMapId;window["AscFonts"].CFontInfo=CFontInfo;window["AscFonts"].CFont= CFont;prot=CFont.prototype;prot["asc_getFontId"]=prot.asc_getFontId;prot["asc_getFontName"]=prot.asc_getFontName;prot["asc_getFontThumbnail"]=prot.asc_getFontThumbnail;prot["asc_getFontType"]=prot.asc_getFontType;window["AscFonts"].ImageLoadStatus=ImageLoadStatus;window["AscFonts"].CImage=CImage;window["AscFonts"].DecodeBase64=DecodeBase64})(window,window.document);"use strict";(function(window,document){var g_fontApplication=AscFonts.g_fontApplication;var CFontFileLoader=AscFonts.CFontFileLoader; var FONT_TYPE_EMBEDDED=AscFonts.FONT_TYPE_EMBEDDED;var CFontInfo=AscFonts.CFontInfo;var ImageLoadStatus=AscFonts.ImageLoadStatus;var CImage=AscFonts.CImage;function CGlobalFontLoader(){this.fonts_streams=[];this.fontFilesPath="../../../../fonts/";this.fontFiles=AscFonts.g_font_files;this.fontInfos=AscFonts.g_font_infos;this.map_font_index=AscFonts.g_map_font_index;this.embeddedFilesPath="";this.embeddedFontFiles=[];this.embeddedFontInfos=[];this.ThemeLoader=null;this.Api=null;this.fonts_loading=[]; this.fonts_loading_after_style=[];this.bIsLoadDocumentFirst=false;this.currentInfoLoaded=null;this.loadFontCallBack=null;this.loadFontCallBackArgs=null;this.IsLoadDocumentFonts2=false;this.put_Api=function(_api){this.Api=_api};this.LoadEmbeddedFonts=function(url,_fonts){this.embeddedFilesPath=url;var _count=_fonts.length;if(0==_count)return;this.embeddedFontInfos=new Array(_count);var map_files={};for(var i=0;i<_count;i++)map_files[_fonts[i].id]=_fonts[i].id;var index=0;for(var i in map_files){this.embeddedFontFiles[index]= new CFontFileLoader(map_files[i]);this.embeddedFontFiles[index].CanUseOriginalFormat=false;this.embeddedFontFiles[index].IsNeedAddJSToFontPath=false;map_files[i]=index++}for(var i=0;i<_count;i++){var lStyle=0;if(0==lStyle)this.embeddedFontInfos[i]=new CFontInfo(_fonts[i].name,"",FONT_TYPE_EMBEDDED,map_files[_fonts[i].id],0,-1,-1,-1,-1,-1,-1);else if(2==lStyle)this.embeddedFontInfos[i]=new CFontInfo(_fonts[i].name,"",FONT_TYPE_EMBEDDED,-1,-1,map_files[_fonts[i].id],_fonts[i].faceindex,-1,-1,-1,-1); else if(1==lStyle)this.embeddedFontInfos[i]=new CFontInfo(_fonts[i].name,"",FONT_TYPE_EMBEDDED,-1,-1,-1,-1,map_files[_fonts[i].id],_fonts[i].faceindex,-1,-1);else this.embeddedFontInfos[i]=new CFontInfo(_fonts[i].name,"",FONT_TYPE_EMBEDDED,-1,-1,-1,-1,-1,-1,map_files[_fonts[i].id],_fonts[i].faceindex)}var _count_infos_=this.fontInfos.length;for(var i=0;i<_count;i++){this.map_font_index[_fonts[i].name]=i+_count_infos_;this.fontInfos[i+_count_infos_]=this.embeddedFontInfos[i]}};this.SetStandartFonts= function(){var standarts=window["standarts"];if(undefined==standarts){standarts=[];for(var i=0;i<this.fontInfos.length;i++)if(this.fontInfos[i].Name!="ASCW3")standarts.push(this.fontInfos[i].Name)}var _count=standarts.length;var _infos=this.fontInfos;var _map=this.map_font_index;for(var i=0;i<_count;i++)_infos[_map[standarts[i]]].Type=AscFonts.FONT_TYPE_STANDART};this.AddLoadFonts=function(name,need_styles){var fontinfo=g_fontApplication.GetFontInfo(name);this.fonts_loading[this.fonts_loading.length]= fontinfo;this.fonts_loading[this.fonts_loading.length-1].NeedStyles=need_styles==undefined?15:need_styles;return fontinfo};this.AddLoadFontsNotPick=function(info,need_styles){this.fonts_loading[this.fonts_loading.length]=info;this.fonts_loading[this.fonts_loading.length-1].NeedStyles=need_styles==undefined?15:need_styles};this.LoadDocumentFonts=function(_fonts,is_default){if(this.IsLoadDocumentFonts2)return this.LoadDocumentFonts2(_fonts);var gui_fonts=[];var gui_count=0;for(var i=0;i<this.fontInfos.length;i++){var info= this.fontInfos[i];if(AscFonts.FONT_TYPE_STANDART==info.Type){var __font=new AscFonts.CFont(info.Name,"",info.Type,info.Thumbnail);gui_fonts[gui_count++]=__font}}for(var i in _fonts)if(_fonts[i].type!=FONT_TYPE_EMBEDDED){var info=this.AddLoadFonts(_fonts[i].name,_fonts[i].NeedStyles);if(info.Type==AscFonts.FONT_TYPE_ADDITIONAL)if(info.name!="ASCW3"){var __font=new AscFonts.CFont(info.Name,"",info.Type,info.Thumbnail);gui_fonts[gui_count++]=__font}}else{var ind=-1;for(var j=0;j<this.embeddedFontInfos.length;j++)if(this.embeddedFontInfos[j].Name== _fonts[i].name){this.AddLoadFontsNotPick(this.embeddedFontInfos[j],15);break}}this.Api.sync_InitEditorFonts(gui_fonts);if(this.Api.IsNeedDefaultFonts()){this.AddLoadFonts("Arial",15);this.AddLoadFonts("Symbol",15);this.AddLoadFonts("Wingdings",15);this.AddLoadFonts("Courier New",15);this.AddLoadFonts("Times New Roman",15)}this.Api.asyncFontsDocumentStartLoaded();this.bIsLoadDocumentFirst=true;this.CheckFontsNeedLoadingLoad();this._LoadFonts()};this.CheckFontsNeedLoadingLoad=function(){var _fonts= this.fonts_loading;var _fonts_len=_fonts.length;var _need=false;for(var i=0;i<_fonts_len;i++)if(true==_fonts[i].CheckFontLoadStyles(this))_need=true;return _need};this.CheckFontsNeedLoading=function(_fonts){for(var i in _fonts){var info=g_fontApplication.GetFontInfo(_fonts[i].name);var _isNeed=info.CheckFontLoadStylesNoLoad(this);if(_isNeed===true)return true}return false};this.LoadDocumentFonts2=function(_fonts){for(var i in _fonts)this.AddLoadFonts(_fonts[i].name,15);if(null==this.ThemeLoader)this.Api.asyncFontsDocumentStartLoaded(); else this.ThemeLoader.asyncFontsStartLoaded();this.CheckFontsNeedLoadingLoad();this._LoadFonts()};var oThis=this;this._LoadFonts=function(){if(0==this.fonts_loading.length){if(null==this.ThemeLoader)this.Api.asyncFontsDocumentEndLoaded();else this.ThemeLoader.asyncFontsEndLoaded();if(this.bIsLoadDocumentFirst===true){var _count=this.fonts_loading_after_style.length;for(var i=0;i<_count;i++){var _info=this.fonts_loading_after_style[i];_info.NeedStyles=15;_info.CheckFontLoadStyles(this)}this.fonts_loading_after_style.splice(0, this.fonts_loading_after_style.length);this.bIsLoadDocumentFirst=false}return}var fontinfo=this.fonts_loading[0];var IsNeed=fontinfo.CheckFontLoadStyles(this);if(IsNeed)setTimeout(oThis._check_loaded,50);else{if(this.bIsLoadDocumentFirst===true){this.Api.OpenDocumentProgress.CurrentFont++;this.Api.SendOpenProgress()}this.fonts_loading_after_style[this.fonts_loading_after_style.length]=this.fonts_loading[0];this.fonts_loading.shift();this._LoadFonts()}};this._check_loaded=function(){var IsNeed=false; if(0==oThis.fonts_loading.length){oThis._LoadFonts();return}var current=oThis.fonts_loading[0];var IsNeed=current.CheckFontLoadStyles(oThis);if(true===IsNeed)setTimeout(oThis._check_loaded,50);else{if(oThis.bIsLoadDocumentFirst===true){oThis.Api.OpenDocumentProgress.CurrentFont++;oThis.Api.SendOpenProgress()}oThis.fonts_loading_after_style[oThis.fonts_loading_after_style.length]=oThis.fonts_loading[0];oThis.fonts_loading.shift();oThis._LoadFonts()}};this.LoadFont=function(fontinfo,loadFontCallBack, loadFontCallBackArgs){this.currentInfoLoaded=fontinfo;this.currentInfoLoaded=fontinfo;this.currentInfoLoaded.NeedStyles=15;var IsNeed=this.currentInfoLoaded.CheckFontLoadStyles(this);if(undefined===loadFontCallBack){this.loadFontCallBack=this.Api.asyncFontEndLoaded;this.loadFontCallBackArgs=this.currentInfoLoaded}else{this.loadFontCallBack=loadFontCallBack;this.loadFontCallBackArgs=loadFontCallBackArgs}if(IsNeed){this.Api.asyncFontStartLoaded();setTimeout(this.check_loaded,20);return true}else{this.currentInfoLoaded= null;return false}};this.check_loaded=function(){var current=oThis.currentInfoLoaded;if(null==current)return;var IsNeed=current.CheckFontLoadStyles(oThis);if(IsNeed)setTimeout(oThis.check_loaded,50);else{oThis.loadFontCallBack.call(oThis.Api,oThis.loadFontCallBackArgs);oThis.currentInfoLoaded=null}};this.LoadFontsFromServer=function(_fonts){var _count=_fonts.length;for(var i=0;i<_count;i++){var _info=g_fontApplication.GetFontInfo(_fonts[i]);if(undefined!==_info)_info.LoadFontsFromServer(this)}}}CGlobalFontLoader.prototype.SetStreamIndexEmb= function(font_index,stream_index){this.embeddedFontFiles[font_index].SetStreamIndex(stream_index)};function CGlobalImageLoader(){this.map_image_index={};this.Api=null;this.ThemeLoader=null;this.images_loading=null;this.bIsLoadDocumentFirst=false;this.bIsAsyncLoadDocumentImages=true;this.bIsLoadDocumentImagesNoByOrder=true;this.nNoByOrderCounter=0;this.loadImageCallBackCounter=0;this.loadImageCallBackCounterMax=0;this.loadImageCallBack=null;this.loadImageCallBackArgs=null;this.isBlockchainSupport= false;var oThis=this;if(window["AscDesktopEditor"]&&window["AscDesktopEditor"]["IsLocalFile"]&&window["AscDesktopEditor"]["isBlockchainSupport"]){this.isBlockchainSupport=window["AscDesktopEditor"]["isBlockchainSupport"]()&&!window["AscDesktopEditor"]["IsLocalFile"]();if(this.isBlockchainSupport){Image.prototype.preload_crypto=function(_url){window["crypto_images_map"]=window["crypto_images_map"]||{};if(!window["crypto_images_map"][_url])window["crypto_images_map"][_url]=[];window["crypto_images_map"][_url].push(this); window["AscDesktopEditor"]["PreloadCryptoImage"](_url,AscCommon.g_oDocumentUrls.getLocal(_url));oThis.Api.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.LoadImage)};Image.prototype["onload_crypto"]=function(_src,_crypto_data){if(_crypto_data&&AscCommon.EncryptionWorker&&AscCommon.EncryptionWorker.isCryptoImages()){AscCommon.EncryptionWorker.decryptImage(_src,this,_crypto_data);return}this.crossOrigin="";this.src=_src;oThis.Api.sync_EndAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.LoadImage)}}}this.put_Api=function(_api){this.Api=_api;if(this.Api.IsAsyncOpenDocumentImages!==undefined){this.bIsAsyncLoadDocumentImages=this.Api.IsAsyncOpenDocumentImages();if(this.bIsAsyncLoadDocumentImages)if(undefined===this.Api.asyncImageEndLoadedBackground)this.bIsAsyncLoadDocumentImages=false}};this.LoadDocumentImagesCallback=function(){if(this.ThemeLoader==null)this.Api.asyncImagesDocumentEndLoaded();else this.ThemeLoader.asyncImagesEndLoaded()};this.LoadDocumentImages= function(_images){if(this.ThemeLoader==null)this.Api.asyncImagesDocumentStartLoaded();else this.ThemeLoader.asyncImagesStartLoaded();this.images_loading=[];for(var id in _images)this.images_loading[this.images_loading.length]=AscCommon.getFullImageSrc2(_images[id]);if(!this.bIsAsyncLoadDocumentImages){this.nNoByOrderCounter=0;this._LoadImages()}else{var _len=this.images_loading.length;if(_len===0)return void this.LoadDocumentImagesCallback();var todo=_len;var that=this;var done=function(){todo--; if(todo===0){that.images_loading.splice(0,_len);setTimeout(function(){that.LoadDocumentImagesCallback()},100);done=function(){}}};for(var i=0;i<_len;i++)this.LoadImageAsync(i,done);return;this.images_loading.splice(0,_len);var that=this;setTimeout(function(){that.LoadDocumentImagesCallback()},3E3)}};this.loadImageByUrl=function(_image,_url){if(this.isBlockchainSupport)_image.preload_crypto(_url);else _image.src=_url};this._LoadImages=function(){var _count_images=this.images_loading.length;if(0==_count_images){this.nNoByOrderCounter= 0;if(this.ThemeLoader==null)this.Api.asyncImagesDocumentEndLoaded();else this.ThemeLoader.asyncImagesEndLoaded();return}for(var i=0;i<_count_images;i++){var _id=this.images_loading[i];var oImage=new CImage(_id);oImage.Status=ImageLoadStatus.Loading;oImage.Image=new Image;oThis.map_image_index[oImage.src]=oImage;oImage.Image.parentImage=oImage;oImage.Image.onload=function(){this.parentImage.Status=ImageLoadStatus.Complete;oThis.nNoByOrderCounter++;if(oThis.bIsLoadDocumentFirst===true){oThis.Api.OpenDocumentProgress.CurrentImage++; oThis.Api.SendOpenProgress()}if(!oThis.bIsLoadDocumentImagesNoByOrder){oThis.images_loading.shift();oThis._LoadImages()}else if(oThis.nNoByOrderCounter==oThis.images_loading.length){oThis.images_loading=[];oThis._LoadImages()}};oImage.Image.onerror=function(){this.parentImage.Status=ImageLoadStatus.Complete;this.parentImage.Image=null;oThis.nNoByOrderCounter++;if(oThis.bIsLoadDocumentFirst===true){oThis.Api.OpenDocumentProgress.CurrentImage++;oThis.Api.SendOpenProgress()}if(!oThis.bIsLoadDocumentImagesNoByOrder){oThis.images_loading.shift(); oThis._LoadImages()}else if(oThis.nNoByOrderCounter==oThis.images_loading.length){oThis.images_loading=[];oThis._LoadImages()}};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});oThis.loadImageByUrl(oImage.Image,oImage.src);if(!oThis.bIsLoadDocumentImagesNoByOrder)return}};this.LoadImage=function(src,Type){var _image=this.map_image_index[src];if(undefined!=_image)return _image;this.Api.asyncImageStartLoaded();var oImage=new CImage(src);oImage.Type=Type;oImage.Image= new Image;oImage.Status=ImageLoadStatus.Loading;oThis.map_image_index[oImage.src]=oImage;oImage.Image.onload=function(){oImage.Status=ImageLoadStatus.Complete;oThis.Api.asyncImageEndLoaded(oImage)};oImage.Image.onerror=function(){oImage.Image=null;oImage.Status=ImageLoadStatus.Complete;oThis.Api.asyncImageEndLoaded(oImage)};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});this.loadImageByUrl(oImage.Image,oImage.src);return null};this.LoadImageAsync=function(i, cb){var _id=oThis.images_loading[i];var oImage=new CImage(_id);oImage.Status=ImageLoadStatus.Loading;oImage.Image=new Image;oThis.map_image_index[oImage.src]=oImage;var oThat=oThis;oImage.Image.onload=function(){oImage.Status=ImageLoadStatus.Complete;oThat.Api.asyncImageEndLoadedBackground(oImage)};oImage.Image.onerror=function(){oImage.Status=ImageLoadStatus.Complete;oImage.Image=null;oThat.Api.asyncImageEndLoadedBackground(oImage)};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img, img.src)});window.parent.APP.getImageURL(oImage.src,function(url){if(url=="")oThis.loadImageByUrl(oImage.Image,oImage.src);else{oThis.loadImageByUrl(oImage.Image,url);oThis.map_image_index[url]=oImage}if(typeof cb==="function")cb()})};this.LoadImagesWithCallback=function(arr,loadImageCallBack,loadImageCallBackArgs){var arrAsync=[];var i=0;for(i=0;i<arr.length;i++)if(this.map_image_index[arr[i]]===undefined)arrAsync.push(arr[i]);if(arrAsync.length==0){loadImageCallBack.call(this.Api,loadImageCallBackArgs); return}this.loadImageCallBackCounter=0;this.loadImageCallBackCounterMax=arrAsync.length;this.loadImageCallBack=loadImageCallBack;this.loadImageCallBackArgs=loadImageCallBackArgs;for(i=0;i<arrAsync.length;i++){var oImage=new CImage(arrAsync[i]);oImage.Image=new Image;oImage.Image.parentImage=oImage;oImage.Status=ImageLoadStatus.Loading;this.map_image_index[oImage.src]=oImage;oImage.Image.onload=function(){this.parentImage.Status=ImageLoadStatus.Complete;oThis.loadImageCallBackCounter++;if(oThis.loadImageCallBackCounter== oThis.loadImageCallBackCounterMax)oThis.LoadImagesWithCallbackEnd()};oImage.Image.onerror=function(){this.parentImage.Image=null;this.parentImage.Status=ImageLoadStatus.Complete;oThis.loadImageCallBackCounter++;if(oThis.loadImageCallBackCounter==oThis.loadImageCallBackCounterMax)oThis.LoadImagesWithCallbackEnd()};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});this.loadImageByUrl(oImage.Image,oImage.src)}};this.LoadImagesWithCallbackEnd=function(){this.loadImageCallBack.call(this.Api, this.loadImageCallBackArgs);this.loadImageCallBack=null;this.loadImageCallBackArgs=null;this.loadImageCallBackCounterMax=0;this.loadImageCallBackCounter=0}}var g_flow_anchor=new Image;g_flow_anchor.asc_complete=false;g_flow_anchor.onload=function(){g_flow_anchor.asc_complete=true};g_flow_anchor.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPBAMAAADNDVhEAAAAIVBMVEUAAAANDQ0NDQ0NDQ0NDQ0NDQ0AAAANDQ0NDQ0NDQ0NDQ1jk7YPAAAACnRSTlMAGkD4mb9c5s9TDghpXQAAAFZJREFUCNdjYGBgW8YABlxcIBLBZ1gAEfZa5QWiGRkWMAIpAaA4iHQE0YwODEtANMsChkIwv4BBWQBICyswMC1iWADEDAzKoUuDFUAGNC9uABvIaQkkABpxD6lFb9lRAAAAAElFTkSuQmCC"; var g_flow_anchor2=new Image;g_flow_anchor2.asc_complete=false;g_flow_anchor2.onload=function(){g_flow_anchor2.asc_complete=true};g_flow_anchor2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAMAAAAFBf7qAAAAOVBMVEUAAAAAAAAAAAAAAAAJCQkAAAAJCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQknI0ZQAAAAEnRSTlMAx9ITlAfyPHxn68yecTAl5qt6y0BvAAAAt0lEQVQoz8WS0QrDIAxFk0ajtlXb+/8fuzAprltg7Gnn4aIcvAgJTSSoBiGPoIAGV60qoquvIIL110IJgPONmKIlMI73MiwGRoZvahbKVSizcDKU8QeVPDXEIr6ShVB9VUEn2FOMkwL8VwjUtuypvDWiHeVTFeyWkZHfVQZHGm4XMhKQyJB9GKMxuHQSBlioF7u2q7kzgO2AcWwW3F8mWRmGKgyu91mK1Tzh4ixVVkBzJI/EnGjyACbfCaO3eIWRAAAAAElFTkSuQmCC"; window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_font_loader=new CGlobalFontLoader;window["AscCommon"].g_image_loader=new CGlobalImageLoader;window["AscCommon"].g_flow_anchor=g_flow_anchor;window["AscCommon"].g_flow_anchor2=g_flow_anchor2})(window,window.document);"use strict";(function(window,undefined){var FOREIGN_CURSOR_LABEL_HIDETIME=1500;function CCollaborativeChanges(){this.m_pData=null;this.m_oColor=null}CCollaborativeChanges.prototype.Set_Data=function(pData){this.m_pData= pData};CCollaborativeChanges.prototype.Set_Color=function(oColor){this.m_oColor=oColor};CCollaborativeChanges.prototype.Set_FromUndoRedo=function(Class,Data,Binary){if(!Class.Get_Id)return false;this.m_pData=this.private_SaveData(Binary);return true};CCollaborativeChanges.prototype.Apply_Data=function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false; var nReaderPos=Reader.GetCurPos();var nChangesType=Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor);return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData= function(szSrc){return this.GetStream(szSrc,0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index< srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|= nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions= [];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex= 0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors(); this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType= 0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index<Len;Index++)if(this.m_aUsers[Index]===UserId)return Index;return-1};CCollaborativeEditingBase.prototype.Remove_User=function(UserId){var Pos=this.Find_User(UserId);if(-1!=Pos)this.m_aUsers.splice(Pos,1)};CCollaborativeEditingBase.prototype.Add_Changes=function(Changes){this.m_aChanges.push(Changes)}; CCollaborativeEditingBase.prototype.Add_Unlock=function(LockClass){this.m_aNeedUnlock.push(LockClass)};CCollaborativeEditingBase.prototype.Add_Unlock2=function(Lock){this.m_aNeedUnlock2.push(Lock);editor._onUpdateDocumentCanSave()};CCollaborativeEditingBase.prototype.Have_OtherChanges=function(){return 0<this.m_aChanges.length};CCollaborativeEditingBase.prototype.Apply_Changes=function(){var OtherChanges=this.m_aChanges.length>0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate(); editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length> 0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length}; CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i<aImages.length;++i)rData["data"].push(aImages[i]);var aImagesToLoad=[].concat(AscCommon.CollaborativeEditing.m_aNewImages); this.CheckWaitingImages(aImagesToLoad);AscCommon.CollaborativeEditing.m_aNewImages.length=0;if(false===oApi.isSaveFonts_Images)oApi.isSaveFonts_Images=true;AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad)};CCollaborativeEditingBase.prototype.SendImagesCallback=function(aImages){var oApi=editor||Asc["editor"];oApi.pre_Save(aImages)};CCollaborativeEditingBase.prototype.CollectImagesFromChanges=function(){var oApi=editor||Asc["editor"];var aImages=[],sImagePath,i,sImageFromChanges,oThemeUrls= {};var aNewImages=this.m_aNewImages;var oMap={};for(i=0;i<aNewImages.length;++i){sImageFromChanges=aNewImages[i];if(oMap[sImageFromChanges])continue;oMap[sImageFromChanges]=1;if(sImageFromChanges.indexOf("theme")===0&&oApi.ThemeLoader)oThemeUrls[sImageFromChanges]=oApi.ThemeLoader.ThemesUrlAbs+sImageFromChanges;else if(0===sImageFromChanges.indexOf("http:")||0===sImageFromChanges.indexOf("data:")||0===sImageFromChanges.indexOf("https:")||0===sImageFromChanges.indexOf("file:")||0===sImageFromChanges.indexOf("ftp:")); else{sImagePath=AscCommon.g_oDocumentUrls.mediaPrefix+sImageFromChanges;if(!AscCommon.g_oDocumentUrls.getUrl(sImagePath))aImages.push(sImagePath)}}AscCommon.g_oDocumentUrls.addUrls(oThemeUrls);return aImages};CCollaborativeEditingBase.prototype.OnStart_Load_Objects=function(){this.Set_GlobalLock(true);this.Set_GlobalLockSelection(true);var aImages=this.CollectImagesFromChanges();if(aImages.length>0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages)); this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aLinkData[Index];Item.Class.Load_LinkData(Item.LinkData)}this.Clear_LinkData()}; CCollaborativeEditingBase.prototype.Check_MergeData=function(){};CCollaborativeEditingBase.prototype.Get_GlobalLock=function(){return 0===this.m_bGlobalLock?false:true};CCollaborativeEditingBase.prototype.Set_GlobalLock=function(isLock){if(isLock)this.m_bGlobalLock++;else this.m_bGlobalLock=Math.max(0,this.m_bGlobalLock-1)};CCollaborativeEditingBase.prototype.Set_GlobalLockSelection=function(isLock){if(isLock)this.m_bGlobalLockSelection++;else this.m_bGlobalLockSelection=Math.max(0,this.m_bGlobalLockSelection- 1)};CCollaborativeEditingBase.prototype.Get_GlobalLockSelection=function(){return 0===this.m_bGlobalLockSelection?false:true};CCollaborativeEditingBase.prototype.OnStart_CheckLock=function(){this.m_aCheckLocks.length=0;this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.Add_CheckLock=function(oItem){this.m_aCheckLocks.push(oItem);this.m_aCheckLocksInstance.push(oItem)};CCollaborativeEditingBase.prototype.OnEnd_CheckLock=function(){};CCollaborativeEditingBase.prototype.OnCallback_AskLock= function(result){};CCollaborativeEditingBase.prototype.OnStartCheckLockInstance=function(){this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.OnEndCheckLockInstance=function(){var isLocked=false;for(var nIndex=0,nCount=this.m_aCheckLocksInstance.length;nIndex<nCount;++nIndex)if(true===this.m_aCheckLocksInstance[nIndex]){isLocked=true;break}if(isLocked){var nCount=this.m_aCheckLocksInstance.length;this.m_aCheckLocks.splice(this.m_aCheckLocks.length-nCount,nCount)}this.m_aCheckLocksInstance.length= 0;return isLocked};CCollaborativeEditingBase.prototype.Reset_NeedLock=function(){this.m_aNeedLock={}};CCollaborativeEditingBase.prototype.Add_NeedLock=function(Id,sUser){this.m_aNeedLock[Id]=sUser};CCollaborativeEditingBase.prototype.Remove_NeedLock=function(Id){delete this.m_aNeedLock[Id]};CCollaborativeEditingBase.prototype.Lock_NeedLock=function(){for(var Id in this.m_aNeedLock){var Class=AscCommon.g_oTableId.Get_ById(Id);if(null!=Class){var Lock=Class.Lock;Lock.Set_Type(AscCommon.locktype_Other, false);if(Class.getObjectType&&Class.getObjectType()===AscDFH.historyitem_type_Slide)editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide&&editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide(Class.num);Lock.Set_UserId(this.m_aNeedLock[Id])}}this.Reset_NeedLock()};CCollaborativeEditingBase.prototype.Clear_NewObjects=function(){this.m_aNewObjects.length=0};CCollaborativeEditingBase.prototype.Add_NewObject=function(Class){this.m_aNewObjects.push(Class);Class.FromBinary=true};CCollaborativeEditingBase.prototype.Clear_EndActions= function(){this.m_aEndActions.length=0};CCollaborativeEditingBase.prototype.Add_EndActions=function(Class,Data){this.m_aEndActions.push({Class:Class,Data:Data})};CCollaborativeEditingBase.prototype.OnEnd_ReadForeignChanges=function(){var Count=this.m_aNewObjects.length;for(var Index=0;Index<Count;Index++){var Class=this.m_aNewObjects[Index];Class.FromBinary=false}Count=this.m_aEndActions.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aEndActions[Index];Item.Class.Process_EndLoad(Item.Data)}this.Clear_EndActions(); this.Clear_NewObjects()};CCollaborativeEditingBase.prototype.Clear_NewImages=function(){this.m_aNewImages.length=0};CCollaborativeEditingBase.prototype.Add_NewImage=function(Url){this.m_aNewImages.push(Url)};CCollaborativeEditingBase.prototype.Add_NewDC=function(Class){var Id=Class.Get_Id();this.m_aDC[Id]=Class};CCollaborativeEditingBase.prototype.Clear_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Clear_ContentChanges();this.m_aDC={}};CCollaborativeEditingBase.prototype.Refresh_DCChanges= function(){for(var Id in this.m_aDC)this.m_aDC[Id].Refresh_ContentChanges();this.Clear_DCChanges()};CCollaborativeEditingBase.prototype.AddPosExtChanges=function(Item,ChangeObject){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.RewritePosExtChanges=function(changesArr,scale,Binary_Writer){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.Add_ChangedClass=function(Class){var Id=Class.Get_Id(); this.m_aChangedClasses[Id]=Class};CCollaborativeEditingBase.prototype.Clear_CollaborativeMarks=function(bRepaint){for(var Id in this.m_aChangedClasses)this.m_aChangedClasses[Id].Clear_CollaborativeMarks();this.m_aChangedClasses={};if(true===bRepaint){editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint()}};CCollaborativeEditingBase.prototype.Add_ForeignCursorToUpdate=function(UserId,CursorInfo,UserShortId){this.m_aCursorsToUpdate[UserId]= CursorInfo;this.m_aCursorsToUpdateShortId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Refresh_ForeignCursors=function(){if(!this.m_oLogicDocument)return;for(var UserId in this.m_aCursorsToUpdate){var CursorInfo=this.m_aCursorsToUpdate[UserId];this.m_oLogicDocument.Update_ForeignCursor(CursorInfo,UserId,false,this.m_aCursorsToUpdateShortId[UserId]);if(this.Add_ForeignCursorToShow)this.Add_ForeignCursorToShow(UserId)}this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={}};CCollaborativeEditingBase.prototype.Clear_DocumentPositions= function(){this.m_aDocumentPositions.Clear_DocumentPositions()};CCollaborativeEditingBase.prototype.Add_DocumentPosition=function(DocumentPos){this.m_aDocumentPositions.Add_DocumentPosition(DocumentPos)};CCollaborativeEditingBase.prototype.Add_ForeignCursor=function(UserId,DocumentPos,UserShortId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);this.m_aForeignCursors[UserId]=DocumentPos;this.m_aForeignCursorsPos.Add_DocumentPosition(DocumentPos);this.m_aForeignCursorsId[UserId]= UserShortId};CCollaborativeEditingBase.prototype.Remove_ForeignCursor=function(UserId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);delete this.m_aForeignCursors[UserId]};CCollaborativeEditingBase.prototype.Remove_AllForeignCursors=function(){};CCollaborativeEditingBase.prototype.RemoveMyCursorFromOthers=function(){};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){this.m_aDocumentPositions.Update_DocumentPositionsOnAdd(Class, Pos);this.m_aForeignCursorsPos.Update_DocumentPositionsOnAdd(Class,Pos)};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){this.m_aDocumentPositions.Update_DocumentPositionsOnRemove(Class,Pos,Count);this.m_aForeignCursorsPos.Update_DocumentPositionsOnRemove(Class,Pos,Count)};CCollaborativeEditingBase.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositions.OnStart_SplitRun(SplitRun,SplitPos);this.m_aForeignCursorsPos.OnStart_SplitRun(SplitRun, SplitPos)};CCollaborativeEditingBase.prototype.OnEnd_SplitRun=function(NewRun){this.m_aDocumentPositions.OnEnd_SplitRun(NewRun);this.m_aForeignCursorsPos.OnEnd_SplitRun(NewRun)};CCollaborativeEditingBase.prototype.Update_DocumentPosition=function(DocPos){this.m_aDocumentPositions.Update_DocumentPosition(DocPos)};CCollaborativeEditingBase.prototype.Update_ForeignCursorsPositions=function(){};CCollaborativeEditingBase.prototype.InitMemory=function(){if(!this.m_oMemory)this.m_oMemory=new AscCommon.CMemory}; CCollaborativeEditingBase.prototype.private_SaveDocumentState=function(){var LogicDocument=editor.WordControl.m_oLogicDocument;var DocState;if(true!==this.Is_Fast()){DocState=LogicDocument.Get_SelectionState2();this.m_aCursorsToUpdate={}}else DocState=LogicDocument.Save_DocumentStateBeforeLoadChanges();return DocState};CCollaborativeEditingBase.prototype.private_RestoreDocumentState=function(DocState){var LogicDocument=editor.WordControl.m_oLogicDocument;if(true!==this.Is_Fast())LogicDocument.Set_SelectionState2(DocState); else{LogicDocument.Load_DocumentStateAfterLoadChanges(DocState);this.Refresh_ForeignCursors()}};CCollaborativeEditingBase.prototype.WatchDocumentPositionsByState=function(DocState){this.Clear_DocumentPositions();if(DocState.Pos)this.Add_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Add_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Add_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Add_DocumentPosition(DocState.FootnotesStart.Pos); if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Add_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Add_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Add_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Add_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Add_DocumentPosition(DocState.FootnotesEnd.EndPos)}; CCollaborativeEditingBase.prototype.UpdateDocumentPositionsByState=function(DocState){if(DocState.Pos)this.Update_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Update_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Update_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Update_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Update_DocumentPosition(DocState.FootnotesStart.StartPos); if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Update_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Update_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Update_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Update_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.private_ClearChanges= function(){this.m_aChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange){return true};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[];this.m_oOwnChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){var StartPoint=null===AscCommon.History.SavedIndex?0:AscCommon.History.SavedIndex+1;var LastPoint=-1;if(this.m_nUseType<= 0)LastPoint=AscCommon.History.Points.length-1;else LastPoint=AscCommon.History.Index;for(var PointIndex=StartPoint;PointIndex<=LastPoint;PointIndex++){var Point=AscCommon.History.Points[PointIndex];for(var Index=0;Index<Point.Items.length;Index++){var Item=Point.Items[Index];this.m_oOwnChanges.push(Item.Data)}}};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange,isSave){for(var nIndex=0,nCount=this.m_oOwnChanges.length;nIndex<nCount;++nIndex)if(oChange&&oChange.Merge&&false=== oChange.Merge(this.m_oOwnChanges[nIndex]))return false;if(false!==isSave)this.m_aAllChanges.push(oChange);return true};CCollaborativeEditingBase.prototype.private_OnSendOwnChanges=function(arrChanges,nDeleteIndex){if(null!==nDeleteIndex)this.m_aAllChanges.length=this.m_nAllChangesSavedIndex+nDeleteIndex;else this.m_nAllChangesSavedIndex=this.m_aAllChanges.length;if(arrChanges.length>0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges= this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange= oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=0,nCount=arrChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrChanges[nIndex].CreateReverseChange();if(oReverseChange){arrReverseChanges.push(oReverseChange); oReverseChange.SetReverted(true)}}var oLogicDocument=this.m_oLogicDocument;oLogicDocument.DrawingDocument.EndTrackTable(null,true);oLogicDocument.TurnOffCheckChartSelection();var DocState=this.private_SaveDocumentState();var mapDrawings={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oClass=arrReverseChanges[nIndex].GetClass();if(oClass&&oClass.parent&&oClass.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.parent.Get_Id()]=oClass.parent;arrReverseChanges[nIndex].Load(); this.m_aAllChanges.push(arrReverseChanges[nIndex])}var mapDocumentContents={};var mapParagraphs={};var mapRuns={};var mapTables={};var mapGrObjects={};var mapSlides={};var mapLayouts={};var bChangedLayout=false;var bAddSlides=false;var mapAddedSlides={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oChange=arrReverseChanges[nIndex];var oClass=oChange.GetClass();if(oClass instanceof AscCommonWord.CDocument||oClass instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oClass.Get_Id()]= oClass;else if(oClass instanceof AscCommonWord.Paragraph)mapParagraphs[oClass.Get_Id()]=oClass;else if(oClass.IsParagraphContentElement&&true===oClass.IsParagraphContentElement()&&true===oChange.IsContentChange()&&oClass.GetParagraph()){mapParagraphs[oClass.GetParagraph().Get_Id()]=oClass.GetParagraph();if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass}else if(oClass instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]= oClass;else if(oClass instanceof AscCommonWord.CTable)mapTables[oClass.Get_Id()]=oClass;else if(oClass instanceof AscFormat.CShape||oClass instanceof AscFormat.CImageShape||oClass instanceof AscFormat.CChartSpace||oClass instanceof AscFormat.CGroupShape||oClass instanceof AscFormat.CGraphicFrame)mapGrObjects[oClass.Get_Id()]=oClass;else if(typeof AscCommonSlide!=="undefined")if(AscCommonSlide.Slide&&oClass instanceof AscCommonSlide.Slide)mapSlides[oClass.Get_Id()]=oClass;else if(AscCommonSlide.SlideLayout&& oClass instanceof AscCommonSlide.SlideLayout){mapLayouts[oClass.Get_Id()]=oClass;bChangedLayout=true}else if(AscCommonSlide.CPresentation&&oClass instanceof AscCommonSlide.CPresentation)if(oChange.Type===AscDFH.historyitem_Presentation_RemoveSlide||oChange.Type===AscDFH.historyitem_Presentation_AddSlide){bAddSlides=true;for(var i=0;i<oChange.Items.length;++i)mapAddedSlides[oChange.Items[i].Get_Id()]=oChange.Items[i]}}var oHistory=AscCommon.History;oHistory.CreateNewPointForCollectChanges();if(bAddSlides)for(var i= oLogicDocument.Slides.length-1;i>-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape= mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing= mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1, false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent= mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen=oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph= new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges=[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrReverseChanges[nIndex];var oChangeClass=oReverseChange.GetClass(); var nBinaryPos=oBinaryWriter.GetCurPosition();oBinaryWriter.WriteString2(oChangeClass.Get_Id());oBinaryWriter.WriteLong(oReverseChange.Type);oReverseChange.WriteToBinary(oBinaryWriter);var nBinaryLen=oBinaryWriter.GetCurPosition()-nBinaryPos;var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:nBinaryPos,Len:nBinaryLen});aSendingChanges.push(oChange.m_pData)}var oHistoryPoint=oHistory.Points[oHistory.Points.length-1];for(var nIndex=0,nCount=oHistoryPoint.Items.length;nIndex< nCount;++nIndex){var oReverseChange=oHistoryPoint.Items[nIndex].Data;var oChangeClass=oReverseChange.GetClass();var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:oHistoryPoint.Items[nIndex].Binary.Pos,Len:oHistoryPoint.Items[nIndex].Binary.Len});aSendingChanges.push(oChange.m_pData);arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data)}oHistory.Remove_LastPoint();this.Clear_DCChanges();editor.CoAuthoringApi.saveChanges(aSendingChanges,null, null,false,this.getCollaborativeEditing());this.private_RestoreDocumentState(DocState);oLogicDocument.TurnOnCheckChartSelection();this.private_RecalculateDocument(AscCommon.History.Get_RecalcData(null,arrReverseChanges));oLogicDocument.Document_UpdateSelectionState();oLogicDocument.Document_UpdateInterfaceState();oLogicDocument.Document_UpdateRulersState()};CCollaborativeEditingBase.prototype.CanUndo=function(){return this.m_aOwnChangesIndexes.length<=0?false:true};CCollaborativeEditingBase.prototype.private_CommutateContentChanges= function(oChange,nStartPosition){var arrActions=oChange.ConvertToSimpleActions();var arrCommutateActions=[];for(var nActionIndex=arrActions.length-1;nActionIndex>=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex<nOverallCount;++nIndex){var oTempChange=this.m_aAllChanges[nIndex];if(!oTempChange)continue;if(oChange.IsRelated(oTempChange)&&true!==oTempChange.IsReverted()){var arrOtherActions=oTempChange.ConvertToSimpleActions(); for(var nIndex2=0,nOtherActionsCount2=arrOtherActions.length;nIndex2<nOtherActionsCount2;++nIndex2){var oOtherAction=arrOtherActions[nIndex2];if(false===this.private_Commutate(oAction,oOtherAction)){arrOtherActions.splice(nIndex2,1);oResult=null;break}}oTempChange.ConvertFromSimpleActions(arrOtherActions)}if(!oResult)break}if(null!==oResult)arrCommutateActions.push(oResult)}if(arrCommutateActions.length>0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate= function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange, nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition= function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];for(var ClassPos=0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(Class===_Pos.Class&&undefined!==_Pos.Position&&(_Pos.Position>Pos||_Pos.Position===Pos&&!(Class instanceof AscCommonWord.ParaRun))){_Pos.Position++; break}}}};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];for(var ClassPos=0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(Class===_Pos.Class&&undefined!==_Pos.Position){if(_Pos.Position>Pos+Count)_Pos.Position-=Count;else if(_Pos.Position>=Pos){_Pos.Position=Pos;_Pos.Deleted=true}break}}}}; CDocumentPositionsManager.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositionsSplit=[];for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];for(var ClassPos=0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(SplitRun===_Pos.Class&&_Pos.Position&&_Pos.Position>=SplitPos)this.m_aDocumentPositionsSplit.push({DocPos:DocPos,NewRunPos:_Pos.Position-SplitPos})}}}; CDocumentPositionsManager.prototype.OnEnd_SplitRun=function(NewRun){if(!NewRun)return;for(var PosIndex=0,PosCount=this.m_aDocumentPositionsSplit.length;PosIndex<PosCount;++PosIndex){var NewDocPos=[];NewDocPos.push({Class:NewRun,Position:this.m_aDocumentPositionsSplit[PosIndex].NewRunPos});this.m_aDocumentPositions.push(NewDocPos);this.m_aDocumentPositionsMap.push({StartPos:this.m_aDocumentPositionsSplit[PosIndex].DocPos,EndPos:NewDocPos})}};CDocumentPositionsManager.prototype.Update_DocumentPosition= function(DocPos){var NewDocPos=DocPos;for(var PosIndex=0,PosCount=this.m_aDocumentPositionsMap.length;PosIndex<PosCount;++PosIndex)if(this.m_aDocumentPositionsMap[PosIndex].StartPos===NewDocPos)NewDocPos=this.m_aDocumentPositionsMap[PosIndex].EndPos;if(NewDocPos!==DocPos&&NewDocPos.length===1&&NewDocPos[0].Class instanceof AscCommonWord.ParaRun){var Run=NewDocPos[0].Class;var Para=Run.GetParagraph();if(AscCommonWord.CanUpdatePosition(Para,Run)){DocPos.length=0;Run.GetDocumentPositionFromObject(DocPos); DocPos.push({Class:Run,Position:NewDocPos[0].Position})}}else if(DocPos.length>0&&DocPos[DocPos.length-1].Class instanceof AscCommonWord.ParaRun){var Run=DocPos[DocPos.length-1].Class;var RunPos=DocPos[DocPos.length-1].Position;var Para=Run.GetParagraph();if(AscCommonWord.CanUpdatePosition(Para,Run)){DocPos.length=0;Run.GetDocumentPositionFromObject(DocPos);DocPos.push({Class:Run,Position:RunPos})}}};CDocumentPositionsManager.prototype.Remove_DocumentPosition=function(DocPos){for(var Pos=0,Count= this.m_aDocumentPositions.length;Pos<Count;++Pos)if(this.m_aDocumentPositions[Pos]===DocPos){this.m_aDocumentPositions.splice(Pos,1);return}};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].FOREIGN_CURSOR_LABEL_HIDETIME=FOREIGN_CURSOR_LABEL_HIDETIME;window["AscCommon"].CCollaborativeChanges=CCollaborativeChanges;window["AscCommon"].CCollaborativeEditingBase=CCollaborativeEditingBase;window["AscCommon"].CDocumentPositionsManager=CDocumentPositionsManager})(window);"use strict";(function(window, undefined){var g_dKoef_mm_to_pix=AscCommon.g_dKoef_mm_to_pix;function CBounds(){this.L=0;this.T=0;this.R=0;this.B=0;this.isAbsL=false;this.isAbsT=false;this.isAbsR=false;this.isAbsB=false;this.AbsW=-1;this.AbsH=-1;this.SetParams=function(_l,_t,_r,_b,abs_l,abs_t,abs_r,abs_b,absW,absH){this.L=_l;this.T=_t;this.R=_r;this.B=_b;this.isAbsL=abs_l;this.isAbsT=abs_t;this.isAbsR=abs_r;this.isAbsB=abs_b;this.AbsW=absW;this.AbsH=absH}}function CAbsolutePosition(){this.L=0;this.T=0;this.R=0;this.B=0}var g_anchor_left= 1;var g_anchor_top=2;var g_anchor_right=4;var g_anchor_bottom=8;function CControl(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent=null;this.TabIndex=null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Resize=function(_width,_height,api){if(null==this.Parent||null==this.HtmlElement)return;var _x=0;var _y=0;var _r=0;var _b=0;var hor_anchor=this.Anchor&5;var ver_anchor=this.Anchor&10;if(g_anchor_left==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L; else _x=this.Bounds.L*_width/1E3;if(-1!=this.Bounds.AbsW)_r=_x+this.Bounds.AbsW;else if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else if(g_anchor_right==hor_anchor){if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3;if(-1!=this.Bounds.AbsW)_x=_r-this.Bounds.AbsW;else if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3}else if((g_anchor_left|g_anchor_right)==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x= this.Bounds.L*_width/1E3;if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else{_x=this.Bounds.L;_r=this.Bounds.R}if(g_anchor_top==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(-1!=this.Bounds.AbsH)_b=_y+this.Bounds.AbsH;else if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else if(g_anchor_bottom==ver_anchor){if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3;if(-1!= this.Bounds.AbsH)_y=_b-this.Bounds.AbsH;else if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3}else if((g_anchor_top|g_anchor_bottom)==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else{_y=this.Bounds.T;_b=this.Bounds.B}if(_r<_x)_r=_x;if(_b<_y)_b=_y;this.AbsolutePosition.L=_x;this.AbsolutePosition.T=_y;this.AbsolutePosition.R=_r;this.AbsolutePosition.B=_b; this.HtmlElement.style.left=(_x*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";if(api!==undefined&&api.CheckRetinaElement&&api.CheckRetinaElement(this.HtmlElement)){var _W=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;var _H=(_b-_y)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.width=AscCommon.AscBrowser.convertToRetinaValue(_W,true);this.HtmlElement.height= AscCommon.AscBrowser.convertToRetinaValue(_H,true)}else{this.HtmlElement.width=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.height=(_b-_y)*g_dKoef_mm_to_pix+.5>>0}};this.GetCSS_width=function(){return(this.AbsolutePosition.R-this.AbsolutePosition.L)*g_dKoef_mm_to_pix+.5>>0};this.GetCSS_height=function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CControlContainer(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent= null;this.TabIndex=null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Controls=[];this.AddControl=function(ctrl){ctrl.Parent=this;this.Controls[this.Controls.length]=ctrl};this.Resize=function(_width,_height,api){if(null==this.Parent){this.AbsolutePosition.L=0;this.AbsolutePosition.T=0;this.AbsolutePosition.R=_width;this.AbsolutePosition.B=_height;if(null!=this.HtmlElement){var lCount=this.Controls.length;for(var i=0;i<lCount;i++)this.Controls[i].Resize(_width,_height,api)}return}var _x= 0;var _y=0;var _r=0;var _b=0;var hor_anchor=this.Anchor&5;var ver_anchor=this.Anchor&10;if(g_anchor_left==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(-1!=this.Bounds.AbsW)_r=_x+this.Bounds.AbsW;else if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else if(g_anchor_right==hor_anchor){if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3;if(-1!=this.Bounds.AbsW)_x=_r-this.Bounds.AbsW;else if(this.Bounds.isAbsL)_x= this.Bounds.L;else _x=this.Bounds.L*_width/1E3}else if((g_anchor_left|g_anchor_right)==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else{_x=this.Bounds.L;_r=this.Bounds.R}if(g_anchor_top==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(-1!=this.Bounds.AbsH)_b=_y+this.Bounds.AbsH;else if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B* _height/1E3}else if(g_anchor_bottom==ver_anchor){if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3;if(-1!=this.Bounds.AbsH)_y=_b-this.Bounds.AbsH;else if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3}else if((g_anchor_top|g_anchor_bottom)==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else{_y=this.Bounds.T;_b=this.Bounds.B}if(_r< _x)_r=_x;if(_b<_y)_b=_y;this.AbsolutePosition.L=_x;this.AbsolutePosition.T=_y;this.AbsolutePosition.R=_r;this.AbsolutePosition.B=_b;this.HtmlElement.style.left=(_x*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";var lCount=this.Controls.length;for(var i=0;i<lCount;i++)this.Controls[i].Resize(_r-_x,_b-_y,api)};this.GetCSS_width= function(){return(this.AbsolutePosition.R-this.AbsolutePosition.L)*g_dKoef_mm_to_pix+.5>>0};this.GetCSS_height=function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CreateControlContainer(name){var ctrl=new CControlContainer;ctrl.Name=name;ctrl.HtmlElement=document.getElementById(name);return ctrl}function CreateControl(name){var ctrl=new CControl;ctrl.Name=name;ctrl.HtmlElement=document.getElementById(name);return ctrl}window["AscCommon"]=window["AscCommon"]|| {};window["AscCommon"].g_anchor_left=g_anchor_left;window["AscCommon"].g_anchor_top=g_anchor_top;window["AscCommon"].g_anchor_right=g_anchor_right;window["AscCommon"].g_anchor_bottom=g_anchor_bottom;window["AscCommon"].CreateControlContainer=CreateControlContainer;window["AscCommon"].CreateControl=CreateControl})(window);"use strict";(function(window,undefined){var AscBrowser=AscCommon.AscBrowser;var TRACK_CIRCLE_RADIUS=5;var TRACK_RECT_SIZE2=4;var TRACK_RECT_SIZE=8;var TRACK_RECT_SIZE_CT=6;var TRACK_DISTANCE_ROTATE= 25;var TRACK_DISTANCE_ROTATE2=25;var TRACK_ADJUSTMENT_SIZE=10;var TRACK_WRAPPOINTS_SIZE=6;var IMAGE_ROTATE_TRACK_W=21;var bIsUseImageRotateTrack=true;if(bIsUseImageRotateTrack){window.g_track_rotate_marker=new Image;window.g_track_rotate_marker;window.g_track_rotate_marker.asc_complete=false;window.g_track_rotate_marker.onload=function(){window.g_track_rotate_marker.asc_complete=true};window.g_track_rotate_marker.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAAVFBMVEUAAAD///////////////////////////////////////////////////////98fHy2trb09PTT09OysrKqqqqJiYng4ODr6+uamprGxsbi4uKGhoYjgM0eAAAADnRSTlMAy00k7/z0jbeuMzDljsugwZgAAACpSURBVBjTdZHbEoMgDESDAl6bgIqX9v//s67UYpm6D0xyYMImoaiuUr3pVdVRUtnwqaY8YaE5SRcfaPgqc+DSIh7WIGGaEVoUqRGN4oZlcDIiqYlaPjQz5CNu6cFJwLiuSO3nlLBDrKhn3l4rcnH4NcAdGd5EZMfCsoMFBxM6CD57G+u6vC48PMVnHtrYhP/x+7+3cw7zdJnD3cyA7QXa4nYXaW+a9Xdvb6zqE5Jb7LmzAAAAAElFTkSuQmCC"; window.g_track_rotate_marker2=new Image;window.g_track_rotate_marker2;window.g_track_rotate_marker2.asc_complete=false;window.g_track_rotate_marker2.onload=function(){window.g_track_rotate_marker2.asc_complete=true};window.g_track_rotate_marker2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAeFBMVEUAAAD///////////////////////////////////////////////////////////////////////////+Tk5Obm5v8/PzAwMD5+fmWlpbt7e3k5OSfn5/z8/PLy8vn5+fExMSsrKyqqqrf39+vr6+9vb2urq7c3NxSmuRpAAAAE3RSTlMA+u2XA+PTrId4WBwTN7EKtLY4iqQP6AAAAWhJREFUOMudVe2SgjAMLN+goN51CxTLp3r3/m943BAqIJTR/RU6O02yTRY2g5tEgW9blu0HUeKyLRxDj0/ghcdVWuxYfAHLiV95B5uvwD4saK7DN+DMSj1f+CYu58l9J27A6XnnJG9R3ZWU6l4Vk+y6D310baHRXvUxdRSP/aYZILJbmebFLRNAlo69x7PEeQdZ5Xz8qiS6fJr8aOnEquATFApdSsr/v1HINUo+Q6nwoDDspfH4JmoJ6shzWcINaNBSlLCI6uvLfyXmAlR2xIKBB/A1ZKiGIGA+8QCtphBawRt+hsBnNvE0M0OPZmwcijRnFvE0U6CuIcbrIUlJRnJL9L0YifTQCgU3p/aH4I7fnWaCIajwMMszCl5A7Aj+TWctGuMT6qG4QtbGodBj9oAyjpke3LSDYXCXq9A8V6GZrsLGcqXlcrneW9elAQgpxdwA3rcUdv4ymdQHtrdvpPvW/LHZ7/8+/gBTWGFPbAkGiAAAAABJRU5ErkJggg=="; TRACK_DISTANCE_ROTATE2=18}function COverlay(){this.m_oControl=null;this.m_oContext=null;this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535;this.m_bIsShow=false;this.m_bIsAlwaysUpdateOverlay=false;this.m_oHtmlPage=null;this.DashLineColor="#000000";this.ClearAll=false;this.IsRetina=false;this.IsCellEditor=false}COverlay.prototype={init:function(context,controlName,x,y,w_pix,h_pix,w_mm,h_mm){this.m_oContext=context;this.m_oControl=AscCommon.CreateControl(controlName);this.m_oHtmlPage= new AscCommon.CHtmlPage;this.m_oHtmlPage.init(x,y,w_pix,h_pix,w_mm,h_mm)},Clear:function(){if(null==this.m_oContext){this.m_oContext=this.m_oControl.HtmlElement.getContext("2d");this.m_oContext.imageSmoothingEnabled=false;this.m_oContext.mozImageSmoothingEnabled=false;this.m_oContext.oImageSmoothingEnabled=false;this.m_oContext.webkitImageSmoothingEnabled=false}this.SetBaseTransform();this.m_oContext.beginPath();if(this.max_x!=-65535&&this.max_y!=-65535)if(this.ClearAll===true){this.m_oContext.clearRect(0, 0,this.m_oControl.HtmlElement.width,this.m_oControl.HtmlElement.height);this.ClearAll=false}else{var _eps=5;this.m_oContext.clearRect(this.min_x-_eps,this.min_y-_eps,this.max_x-this.min_x+2*_eps,this.max_y-this.min_y+2*_eps)}this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535},GetImageTrackRotationImage:function(){return this.IsRetina?window.g_track_rotate_marker2:window.g_track_rotate_marker},SetTransform:function(sx,shy,shx,sy,tx,ty){this.SetBaseTransform();this.m_oContext.setTransform(sx, shy,shx,sy,tx,ty)},SetBaseTransform:function(){if(this.IsRetina)this.m_oContext.setTransform(AscCommon.AscBrowser.retinaPixelRatio,0,0,AscCommon.AscBrowser.retinaPixelRatio,0,0);else this.m_oContext.setTransform(1,0,0,1,0,0)},Show:function(){if(this.m_bIsShow)return;this.m_bIsShow=true;this.m_oControl.HtmlElement.style.display="block"},UnShow:function(){if(!this.m_bIsShow)return;this.m_bIsShow=false;this.m_oControl.HtmlElement.style.display="none"},VertLine:function(position,bIsSimpleAdd){if(bIsSimpleAdd!== true){this.Clear();if(this.m_bIsAlwaysUpdateOverlay||true)if(!editor.WordControl.OnUpdateOverlay())editor.WordControl.EndUpdateOverlay()}if(this.min_x>position)this.min_x=position;if(this.max_x<position)this.max_x=position;this.min_y=0;this.max_y=this.m_oControl.HtmlElement.height;this.m_oContext.lineWidth=1;var x=(position+.5>>0)+.5;var y=0;this.m_oContext.strokeStyle=this.DashLineColor;this.m_oContext.beginPath();while(y<this.max_y){this.m_oContext.moveTo(x,y);y++;this.m_oContext.lineTo(x,y);y+= 1;this.m_oContext.moveTo(x,y);y++;this.m_oContext.lineTo(x,y);y+=1;this.m_oContext.moveTo(x,y);y++;this.m_oContext.lineTo(x,y);y++;y+=5}this.m_oContext.stroke();y=1;this.m_oContext.strokeStyle="#FFFFFF";this.m_oContext.beginPath();while(y<this.max_y){this.m_oContext.moveTo(x,y);y++;this.m_oContext.lineTo(x,y);y+=1;this.m_oContext.moveTo(x,y);y++;this.m_oContext.lineTo(x,y);y+=1;this.m_oContext.moveTo(x,y);y++;this.m_oContext.lineTo(x,y);y++;y+=5}this.m_oContext.stroke();this.Show()},VertLine2:function(position){if(this.min_x> position)this.min_x=position;if(this.max_x<position)this.max_x=position;var _old_global=this.m_oContext.globalAlpha;this.m_oContext.globalAlpha=1;this.min_y=0;this.max_y=this.m_oControl.HtmlElement.height;this.m_oContext.lineWidth=1;var x=(position+.5>>0)+.5;var y=0;this.m_oContext.strokeStyle=this.DashLineColor;this.m_oContext.beginPath();var dist=1;while(y<this.max_y){this.m_oContext.moveTo(x,y);y+=dist;this.m_oContext.lineTo(x,y);y+=dist}this.m_oContext.stroke();this.m_oContext.beginPath();this.Show(); this.m_oContext.globalAlpha=_old_global},HorLine:function(position,bIsSimpleAdd){if(bIsSimpleAdd!==true){this.Clear();if(this.m_bIsAlwaysUpdateOverlay||true)if(!editor.WordControl.OnUpdateOverlay())editor.WordControl.EndUpdateOverlay()}this.min_x=0;this.max_x=this.m_oControl.HtmlElement.width;if(this.min_y>position)this.min_y=position;if(this.max_y<position)this.max_y=position;this.m_oContext.lineWidth=1;var y=(position+.5>>0)+.5;var x=0;this.m_oContext.strokeStyle=this.DashLineColor;this.m_oContext.beginPath(); while(x<this.max_x){this.m_oContext.moveTo(x,y);x++;this.m_oContext.lineTo(x,y);x+=1;this.m_oContext.moveTo(x,y);x++;this.m_oContext.lineTo(x,y);x+=1;this.m_oContext.moveTo(x,y);x++;this.m_oContext.lineTo(x,y);x++;x+=5}this.m_oContext.stroke();x=1;this.m_oContext.strokeStyle="#FFFFFF";this.m_oContext.beginPath();while(x<this.max_x){this.m_oContext.moveTo(x,y);x++;this.m_oContext.lineTo(x,y);x+=1;this.m_oContext.moveTo(x,y);x++;this.m_oContext.lineTo(x,y);x+=1;this.m_oContext.moveTo(x,y);x++;this.m_oContext.lineTo(x, y);x++;x+=5}this.m_oContext.stroke();this.Show()},HorLine2:function(position){if(this.min_y>position)this.min_y=position;if(this.max_y<position)this.max_y=position;var _old_global=this.m_oContext.globalAlpha;this.m_oContext.globalAlpha=1;this.min_x=0;this.max_x=this.m_oControl.HtmlElement.width;this.m_oContext.lineWidth=1;var y=(position+.5>>0)+.5;var x=0;this.m_oContext.strokeStyle=this.DashLineColor;this.m_oContext.beginPath();var dist=1;while(x<this.max_x){this.m_oContext.moveTo(x,y);x+=dist;this.m_oContext.lineTo(x, y);x+=dist}this.m_oContext.stroke();this.m_oContext.beginPath();this.Show();this.m_oContext.globalAlpha=_old_global},CheckPoint1:function(x,y){if(x<this.min_x)this.min_x=x;if(y<this.min_y)this.min_y=y},CheckPoint2:function(x,y){if(x>this.max_x)this.max_x=x;if(y>this.max_y)this.max_y=y},CheckPoint:function(x,y){if(x<this.min_x)this.min_x=x;if(y<this.min_y)this.min_y=y;if(x>this.max_x)this.max_x=x;if(y>this.max_y)this.max_y=y},AddRect2:function(x,y,r){var _x=x-(r/2>>0);var _y=y-(r/2>>0);this.CheckPoint1(_x, _y);this.CheckPoint2(_x+r,_y+r);this.m_oContext.moveTo(_x,_y);this.m_oContext.rect(_x,_y,r,r)},AddRect3:function(x,y,r,ex1,ey1,ex2,ey2){var _r=r/2;var x1=x+_r*(ex2-ex1);var y1=y+_r*(ey2-ey1);var x2=x+_r*(ex2+ex1);var y2=y+_r*(ey2+ey1);var x3=x+_r*(-ex2+ex1);var y3=y+_r*(-ey2+ey1);var x4=x+_r*(-ex2-ex1);var y4=y+_r*(-ey2-ey1);this.CheckPoint(x1,y1);this.CheckPoint(x2,y2);this.CheckPoint(x3,y3);this.CheckPoint(x4,y4);var ctx=this.m_oContext;ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.lineTo(x3,y3);ctx.lineTo(x4, y4);ctx.closePath()},AddRect:function(x,y,w,h){this.CheckPoint1(x,y);this.CheckPoint2(x+w,y+h);this.m_oContext.moveTo(x,y);this.m_oContext.rect(x,y,w,h)},CheckRectT:function(x,y,w,h,trans,eps){var x1=trans.TransformPointX(x,y);var y1=trans.TransformPointY(x,y);var x2=trans.TransformPointX(x+w,y);var y2=trans.TransformPointY(x+w,y);var x3=trans.TransformPointX(x+w,y+h);var y3=trans.TransformPointY(x+w,y+h);var x4=trans.TransformPointX(x,y+h);var y4=trans.TransformPointY(x,y+h);this.CheckPoint(x1,y1); this.CheckPoint(x2,y2);this.CheckPoint(x3,y3);this.CheckPoint(x4,y4);if(eps!==undefined){this.min_x-=eps;this.min_y-=eps;this.max_x+=eps;this.max_y+=eps}},CheckRect:function(x,y,w,h){this.CheckPoint1(x,y);this.CheckPoint2(x+w,y+h)},AddEllipse:function(x,y,r){this.CheckPoint1(x-r,y-r);this.CheckPoint2(x+r,y+r);this.m_oContext.moveTo(x+r,y);this.m_oContext.arc(x,y,r,0,Math.PI*2,false)},AddEllipse2:function(x,y,r){this.m_oContext.moveTo(x+r,y);this.m_oContext.arc(x,y,r,0,Math.PI*2,false)},AddDiamond:function(x, y,r){this.CheckPoint1(x-r,y-r);this.CheckPoint2(x+r,y+r);this.m_oContext.moveTo(x-r,y);this.m_oContext.lineTo(x,y-r);this.m_oContext.lineTo(x+r,y);this.m_oContext.lineTo(x,y+r);this.m_oContext.lineTo(x-r,y)},AddRoundRect:function(x,y,w,h,r){if(w<2*r||h<2*r)return this.AddRect(x,y,w,h);this.CheckPoint1(x,y);this.CheckPoint2(x+w,y+h);var _ctx=this.m_oContext;_ctx.moveTo(x+r,y);_ctx.lineTo(x+w-r,y);_ctx.quadraticCurveTo(x+w,y,x+w,y+r);_ctx.lineTo(x+w,y+h-r);_ctx.quadraticCurveTo(x+w,y+h,x+w-r,y+h);_ctx.lineTo(x+ r,y+h);_ctx.quadraticCurveTo(x,y+h,x,y+h-r);_ctx.lineTo(x,y+r);_ctx.quadraticCurveTo(x,y,x+r,y)},AddRoundRectCtx:function(ctx,x,y,w,h,r){if(w<2*r||h<2*r)return ctx.rect(x,y,w,h);var _ctx=this.m_oContext;_ctx.moveTo(x+r,y);_ctx.lineTo(x+w-r,y);_ctx.quadraticCurveTo(x+w,y,x+w,y+r);_ctx.lineTo(x+w,y+h-r);_ctx.quadraticCurveTo(x+w,y+h,x+w-r,y+h);_ctx.lineTo(x+r,y+h);_ctx.quadraticCurveTo(x,y+h,x,y+h-r);_ctx.lineTo(x,y+r);_ctx.quadraticCurveTo(x,y,x+r,y)},DrawFrozenPlaceHorLine:function(y,left,right){this.m_oContext.strokeStyle= "#AAAAAA";var nW=2;if(AscCommon.AscBrowser.isRetina)nW=AscCommon.AscBrowser.convertToRetinaValue(nW,true);this.CheckPoint1(left,y-nW);this.CheckPoint2(right,y+nW);this.m_oContext.lineWidth=nW;this.m_oContext.beginPath();this.m_oContext.moveTo(left,y);this.m_oContext.lineTo(right,y);this.m_oContext.stroke()},DrawFrozenPlaceVerLine:function(x,top,bottom){this.m_oContext.strokeStyle="#AAAAAA";var nW=2;if(AscCommon.AscBrowser.isRetina)nW=AscCommon.AscBrowser.convertToRetinaValue(nW,true);this.CheckPoint1(x- nW,top);this.CheckPoint2(x+nW,bottom);this.m_oContext.lineWidth=nW;this.m_oContext.beginPath();this.m_oContext.moveTo(x,top);this.m_oContext.lineTo(x,bottom);this.m_oContext.stroke()}};function CAutoshapeTrack(){this.m_oContext=null;this.m_oOverlay=null;this.Graphics=null;this.MaxEpsLine=0;this.IsTrack=true;this.PageIndex=-1;this.CurrentPageInfo=null}CAutoshapeTrack.prototype={SetFont:function(font){},init:function(overlay,x,y,r,b,w_mm,h_mm){this.m_oOverlay=overlay;this.m_oContext=this.m_oOverlay.m_oContext; this.Graphics=new AscCommon.CGraphics;var _scale=this.m_oOverlay.IsRetina?AscCommon.AscBrowser.retinaPixelRatio:1;this.Graphics.init(this.m_oContext,_scale*(r-x),_scale*(b-y),w_mm,h_mm);this.Graphics.m_oCoordTransform.tx=_scale*x;this.Graphics.m_oCoordTransform.ty=_scale*y;this.Graphics.SetIntegerGrid(false);this.Graphics.globalAlpha=.5;this.m_oContext.globalAlpha=.5},SetIntegerGrid:function(b){},p_color:function(r,g,b,a){this.Graphics.p_color(r,g,b,a)},p_width:function(w){this.Graphics.p_width(w); var xx1=0;var yy1=0;var xx2=1;var yy2=1;var xxx1=this.Graphics.m_oFullTransform.TransformPointX(xx1,yy1);var yyy1=this.Graphics.m_oFullTransform.TransformPointY(xx1,yy1);var xxx2=this.Graphics.m_oFullTransform.TransformPointX(xx2,yy2);var yyy2=this.Graphics.m_oFullTransform.TransformPointY(xx2,yy2);var _len2=(xxx2-xxx1)*(xxx2-xxx1)+(yyy2-yyy1)*(yyy2-yyy1);var koef=Math.sqrt(_len2/2);var _EpsLine=w*koef/1E3>>0;_EpsLine+=5;if(_EpsLine>this.MaxEpsLine)this.MaxEpsLine=_EpsLine},p_dash:function(params){this.Graphics.p_dash(params)}, b_color1:function(r,g,b,a){this.Graphics.b_color1(r,g,b,a)},_s:function(){this.Graphics._s()},_e:function(){this.Graphics._e()},_z:function(){this.Graphics._z()},_m:function(x,y){this.Graphics._m(x,y);var _x=this.Graphics.m_oFullTransform.TransformPointX(x,y);var _y=this.Graphics.m_oFullTransform.TransformPointY(x,y);this.m_oOverlay.CheckPoint(_x,_y)},_l:function(x,y){this.Graphics._l(x,y);var _x=this.Graphics.m_oFullTransform.TransformPointX(x,y);var _y=this.Graphics.m_oFullTransform.TransformPointY(x, y);this.m_oOverlay.CheckPoint(_x,_y)},_c:function(x1,y1,x2,y2,x3,y3){this.Graphics._c(x1,y1,x2,y2,x3,y3);var _x1=this.Graphics.m_oFullTransform.TransformPointX(x1,y1);var _y1=this.Graphics.m_oFullTransform.TransformPointY(x1,y1);var _x2=this.Graphics.m_oFullTransform.TransformPointX(x2,y2);var _y2=this.Graphics.m_oFullTransform.TransformPointY(x2,y2);var _x3=this.Graphics.m_oFullTransform.TransformPointX(x3,y3);var _y3=this.Graphics.m_oFullTransform.TransformPointY(x3,y3);this.m_oOverlay.CheckPoint(_x1, _y1);this.m_oOverlay.CheckPoint(_x2,_y2);this.m_oOverlay.CheckPoint(_x3,_y3)},_c2:function(x1,y1,x2,y2){this.Graphics._c2(x1,y1,x2,y2);var _x1=this.Graphics.m_oFullTransform.TransformPointX(x1,y1);var _y1=this.Graphics.m_oFullTransform.TransformPointY(x1,y1);var _x2=this.Graphics.m_oFullTransform.TransformPointX(x2,y2);var _y2=this.Graphics.m_oFullTransform.TransformPointY(x2,y2);this.m_oOverlay.CheckPoint(_x1,_y1);this.m_oOverlay.CheckPoint(_x2,_y2)},ds:function(){this.Graphics.ds()},df:function(){this.Graphics.df()}, save:function(){this.Graphics.save()},restore:function(){this.Graphics.restore()},clip:function(){this.Graphics.clip()},reset:function(){this.Graphics.reset()},transform3:function(m){this.Graphics.transform3(m)},transform:function(sx,shy,shx,sy,tx,ty){this.Graphics.transform(sx,shy,shx,sy,tx,ty)},drawImage:function(image,x,y,w,h,alpha,srcRect,nativeImage){this.Graphics.drawImage(image,x,y,w,h,undefined,srcRect,nativeImage);var _x1=this.Graphics.m_oFullTransform.TransformPointX(x,y);var _y1=this.Graphics.m_oFullTransform.TransformPointY(x, y);var _x2=this.Graphics.m_oFullTransform.TransformPointX(x+w,y);var _y2=this.Graphics.m_oFullTransform.TransformPointY(x+w,y);var _x3=this.Graphics.m_oFullTransform.TransformPointX(x+w,y+h);var _y3=this.Graphics.m_oFullTransform.TransformPointY(x+w,y+h);var _x4=this.Graphics.m_oFullTransform.TransformPointX(x,y+h);var _y4=this.Graphics.m_oFullTransform.TransformPointY(x,y+h);this.m_oOverlay.CheckPoint(_x1,_y1);this.m_oOverlay.CheckPoint(_x2,_y2);this.m_oOverlay.CheckPoint(_x3,_y3);this.m_oOverlay.CheckPoint(_x4, _y4)},CorrectOverlayBounds:function(){this.m_oOverlay.SetBaseTransform();this.m_oOverlay.min_x-=this.MaxEpsLine;this.m_oOverlay.min_y-=this.MaxEpsLine;this.m_oOverlay.max_x+=this.MaxEpsLine;this.m_oOverlay.max_y+=this.MaxEpsLine},SetCurrentPage:function(nPageIndex,isAttack){if(nPageIndex==this.PageIndex&&!isAttack)return;var oPage=this.m_oOverlay.m_oHtmlPage.GetDrawingPageInfo(nPageIndex);this.PageIndex=nPageIndex;var drawPage=oPage.drawingPage;this.Graphics=new AscCommon.CGraphics;var _scale=this.m_oOverlay.IsRetina? AscCommon.AscBrowser.retinaPixelRatio:1;this.Graphics.init(this.m_oContext,_scale*(drawPage.right-drawPage.left),_scale*(drawPage.bottom-drawPage.top),oPage.width_mm,oPage.height_mm);this.Graphics.m_oCoordTransform.tx=_scale*drawPage.left;this.Graphics.m_oCoordTransform.ty=_scale*drawPage.top;this.Graphics.SetIntegerGrid(false);this.Graphics.globalAlpha=.5;this.m_oContext.globalAlpha=.5},init2:function(overlay){this.m_oOverlay=overlay;this.m_oContext=this.m_oOverlay.m_oContext;this.PageIndex=-1}, SetClip:function(r){},AddClipRect:function(){},RemoveClip:function(){},SavePen:function(){this.Graphics.SavePen()},RestorePen:function(){this.Graphics.RestorePen()},SaveBrush:function(){this.Graphics.SaveBrush()},RestoreBrush:function(){this.Graphics.RestoreBrush()},SavePenBrush:function(){this.Graphics.SavePenBrush()},RestorePenBrush:function(){this.Graphics.RestorePenBrush()},SaveGrState:function(){this.Graphics.SaveGrState()},RestoreGrState:function(){this.Graphics.RestoreGrState()},StartClipPath:function(){this.Graphics.StartClipPath()}, EndClipPath:function(){this.Graphics.EndClipPath()},DrawTrack:function(type,matrix,left,top,width,height,isLine,isCanRotate,isNoMove){if(true===isNoMove)return;var _retina=this.m_oOverlay.IsRetina;if(!_retina&&this.m_oOverlay.IsCellEditor&&AscCommon.AscBrowser.isRetina){this.m_oOverlay.IsRetina=true;this.m_oOverlay.m_oContext.setTransform(1,0,0,1,0,0);left/=AscCommon.AscBrowser.retinaPixelRatio;top/=AscCommon.AscBrowser.retinaPixelRatio;width/=AscCommon.AscBrowser.retinaPixelRatio;height/=AscCommon.AscBrowser.retinaPixelRatio; if(matrix){matrix.tx/=AscCommon.AscBrowser.retinaPixelRatio;matrix.ty/=AscCommon.AscBrowser.retinaPixelRatio}this.m_oOverlay.m_oContext.translate(this.Graphics.m_oCoordTransform.tx,this.Graphics.m_oCoordTransform.ty);this.m_oOverlay.m_oContext.scale(AscCommon.AscBrowser.retinaPixelRatio,AscCommon.AscBrowser.retinaPixelRatio);this.m_oOverlay.m_oContext.translate(-this.Graphics.m_oCoordTransform.tx,-this.Graphics.m_oCoordTransform.ty)}var overlay=this.m_oOverlay;overlay.Show();var bIsClever=false;this.CurrentPageInfo= overlay.m_oHtmlPage.GetDrawingPageInfo(this.PageIndex);var drPage=this.CurrentPageInfo.drawingPage;var xDst=drPage.left;var yDst=drPage.top;var wDst=drPage.right-drPage.left;var hDst=drPage.bottom-drPage.top;var dKoefX=wDst/this.CurrentPageInfo.width_mm;var dKoefY=hDst/this.CurrentPageInfo.height_mm;var r=left+width;var b=top+height;var dx1=xDst+dKoefX*matrix.TransformPointX(left,top);var dy1=yDst+dKoefY*matrix.TransformPointY(left,top);var dx2=xDst+dKoefX*matrix.TransformPointX(r,top);var dy2=yDst+ dKoefY*matrix.TransformPointY(r,top);var dx3=xDst+dKoefX*matrix.TransformPointX(left,b);var dy3=yDst+dKoefY*matrix.TransformPointY(left,b);var dx4=xDst+dKoefX*matrix.TransformPointX(r,b);var dy4=yDst+dKoefY*matrix.TransformPointY(r,b);var x1=dx1>>0;var y1=dy1>>0;var x2=dx2>>0;var y2=dy2>>0;var x3=dx3>>0;var y3=dy3>>0;var x4=dx4>>0;var y4=dy4>>0;var _eps=.01;if(Math.abs(dx1-dx3)<_eps&&Math.abs(dx2-dx4)<_eps&&Math.abs(dy1-dy2)<_eps&&Math.abs(dy3-dy4)<_eps&&x1<x2&&y1<y3){x3=x1;x4=x2;y2=y1;y4=y3;bIsClever= true}var nIsCleverWithTransform=bIsClever;var nType=0;if(!nIsCleverWithTransform&&Math.abs(dx1-dx3)<_eps&&Math.abs(dx2-dx4)<_eps&&Math.abs(dy1-dy2)<_eps&&Math.abs(dy3-dy4)<_eps){x3=x1;x4=x2;y2=y1;y4=y3;nIsCleverWithTransform=true;nType=1;if(false){if(x1>x2){var tmp=x1;x1=x2;x3=x2;x2=tmp;x4=tmp}if(y1>y3){var tmp=y1;y1=y3;y2=y3;y3=tmp;y4=tmp}nType=0;bIsClever=true}}if(!nIsCleverWithTransform&&Math.abs(dx1-dx2)<_eps&&Math.abs(dx3-dx4)<_eps&&Math.abs(dy1-dy3)<_eps&&Math.abs(dy2-dy4)<_eps){x2=x1;x4=x3; y3=y1;y4=y2;nIsCleverWithTransform=true;nType=2}var ctx=overlay.m_oContext;var bIsEllipceCorner=false;var _style_blue="#939393";var _style_green="#84E036";var _style_white="#FFFFFF";var _style_black="#000000";var _len_x=Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));var _len_y=Math.sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));if(_len_x<1)_len_x=1;if(_len_y<1)_len_y=1;var bIsRectsTrackX=_len_x>=30?true:false;var bIsRectsTrackY=_len_y>=30?true:false;var bIsRectsTrack=bIsRectsTrackX||bIsRectsTrackY?true:false; if(bIsRectsTrack&&type==AscFormat.TYPE_TRACK.CHART_TEXT)bIsRectsTrack=false;if(nType==2){var _tmp=bIsRectsTrackX;bIsRectsTrackX=bIsRectsTrackY;bIsRectsTrackY=_tmp}ctx.lineWidth=1;ctx.beginPath();var _oldGlobalAlpha=ctx.globalAlpha;ctx.globalAlpha=1;switch(type){case AscFormat.TYPE_TRACK.SHAPE:case AscFormat.TYPE_TRACK.GROUP:case AscFormat.TYPE_TRACK.CHART_TEXT:{if(bIsClever){overlay.CheckRect(x1,y1,x4-x1,y4-y1);ctx.strokeStyle=_style_blue;if(!isLine){ctx.rect(x1+.5,y2+.5,x4-x1,y4-y1);ctx.stroke(); ctx.beginPath()}var xC=(x1+x2)/2>>0;if(!isLine&&isCanRotate){if(!bIsUseImageRotateTrack){ctx.beginPath();overlay.AddEllipse(xC,y1-TRACK_DISTANCE_ROTATE,TRACK_CIRCLE_RADIUS);ctx.fillStyle=_style_green;ctx.fill();ctx.stroke()}else{var _image_track_rotate=overlay.GetImageTrackRotationImage();if(_image_track_rotate.asc_complete){var _w=IMAGE_ROTATE_TRACK_W;var _xI=xC+.5-_w/2>>0;var _yI=y1-TRACK_DISTANCE_ROTATE-(_w>>1);overlay.CheckRect(_xI,_yI,_w,_w);ctx.drawImage(_image_track_rotate,_xI,_yI,_w,_w)}}ctx.beginPath(); ctx.moveTo(xC+.5,y1);ctx.lineTo(xC+.5,y1-TRACK_DISTANCE_ROTATE2);ctx.stroke();ctx.beginPath()}ctx.fillStyle=type!=AscFormat.TYPE_TRACK.CHART_TEXT?_style_white:_style_blue;var TRACK_RECT_SIZE_CUR=type!=AscFormat.TYPE_TRACK.CHART_TEXT?TRACK_RECT_SIZE:TRACK_RECT_SIZE_CT;if(type==AscFormat.TYPE_TRACK.CHART_TEXT)ctx.strokeStyle=_style_white;if(bIsEllipceCorner){overlay.AddEllipse(x1,y1,TRACK_CIRCLE_RADIUS);if(!isLine){overlay.AddEllipse(x2,y2,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x3,y3,TRACK_CIRCLE_RADIUS)}overlay.AddEllipse(x4, y4,TRACK_CIRCLE_RADIUS)}else{overlay.AddRect2(x1+.5,y1+.5,TRACK_RECT_SIZE_CUR);if(!isLine){overlay.AddRect2(x2+.5,y2+.5,TRACK_RECT_SIZE_CUR);overlay.AddRect2(x3+.5,y3+.5,TRACK_RECT_SIZE_CUR)}overlay.AddRect2(x4+.5,y4+.5,TRACK_RECT_SIZE_CUR)}if(bIsRectsTrack&&!isLine){var _xC=((x1+x2)/2>>0)+.5;var _yC=((y1+y3)/2>>0)+.5;if(bIsRectsTrackX){overlay.AddRect2(_xC,y1+.5,TRACK_RECT_SIZE);overlay.AddRect2(_xC,y3+.5,TRACK_RECT_SIZE)}if(bIsRectsTrackY){overlay.AddRect2(x2+.5,_yC,TRACK_RECT_SIZE);overlay.AddRect2(x1+ .5,_yC,TRACK_RECT_SIZE)}}ctx.fill();ctx.stroke();ctx.beginPath()}else{var _x1=x1;var _y1=y1;var _x2=x2;var _y2=y2;var _x3=x3;var _y3=y3;var _x4=x4;var _y4=y4;if(nIsCleverWithTransform){var _x1=x1;if(x2<_x1)_x1=x2;if(x3<_x1)_x1=x3;if(x4<_x1)_x1=x4;var _x4=x1;if(x2>_x4)_x4=x2;if(x3>_x4)_x4=x3;if(x4>_x4)_x4=x4;var _y1=y1;if(y2<_y1)_y1=y2;if(y3<_y1)_y1=y3;if(y4<_y1)_y1=y4;var _y4=y1;if(y2>_y4)_y4=y2;if(y3>_y4)_y4=y3;if(y4>_y4)_y4=y4;_x2=_x4;_y2=_y1;_x3=_x1;_y3=_y4}ctx.strokeStyle=_style_blue;if(!isLine)if(nIsCleverWithTransform){ctx.rect(_x1+ .5,_y2+.5,_x4-_x1,_y4-_y1);ctx.stroke();ctx.beginPath()}else{ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.lineTo(x4,y4);ctx.lineTo(x3,y3);ctx.closePath();ctx.stroke()}overlay.CheckPoint(x1,y1);overlay.CheckPoint(x2,y2);overlay.CheckPoint(x3,y3);overlay.CheckPoint(x4,y4);var ex1=(x2-x1)/_len_x;var ey1=(y2-y1)/_len_x;var ex2=(x1-x3)/_len_y;var ey2=(y1-y3)/_len_y;var _bAbsX1=Math.abs(ex1)<.01;var _bAbsY1=Math.abs(ey1)<.01;var _bAbsX2=Math.abs(ex2)<.01;var _bAbsY2=Math.abs(ey2)<.01;if(_bAbsX2&&_bAbsY2)if(_bAbsX1&& _bAbsY1){ex1=1;ey1=0;ex2=0;ey2=1}else{ex2=-ey1;ey2=ex1}else if(_bAbsX1&&_bAbsY1){ex1=ey2;ey1=-ex2}var xc1=(x1+x2)/2;var yc1=(y1+y2)/2;ctx.beginPath();if(!isLine&&isCanRotate){if(!bIsUseImageRotateTrack){ctx.beginPath();overlay.AddEllipse(xc1+ex2*TRACK_DISTANCE_ROTATE,yc1+ey2*TRACK_DISTANCE_ROTATE,TRACK_CIRCLE_RADIUS);ctx.fillStyle=_style_green;ctx.fill();ctx.stroke()}else{var _image_track_rotate=overlay.GetImageTrackRotationImage();if(_image_track_rotate.asc_complete){var _xI=xc1+ex2*TRACK_DISTANCE_ROTATE; var _yI=yc1+ey2*TRACK_DISTANCE_ROTATE;var _w=IMAGE_ROTATE_TRACK_W;var _w2=IMAGE_ROTATE_TRACK_W/2;if(nIsCleverWithTransform){_xI>>=0;_yI>>=0;_w2>>=0;_w2+=1}var _matrix=matrix.CreateDublicate();_matrix.tx=0;_matrix.ty=0;var _xx=_matrix.TransformPointX(0,1);var _yy=_matrix.TransformPointY(0,1);var _angle=Math.atan2(_xx,-_yy)-Math.PI;var _px=Math.cos(_angle);var _py=Math.sin(_angle);ctx.save();ctx.translate(_xI,_yI);ctx.transform(_px,_py,-_py,_px,0,0);ctx.drawImage(_image_track_rotate,-_w2,-_w2,_w,_w); ctx.restore();overlay.CheckRect(_xI-_w2,_yI-_w2,_w,_w)}}ctx.beginPath();if(!nIsCleverWithTransform){ctx.moveTo(xc1,yc1);ctx.lineTo(xc1+ex2*TRACK_DISTANCE_ROTATE2,yc1+ey2*TRACK_DISTANCE_ROTATE2)}else{ctx.moveTo((xc1>>0)+.5,(yc1>>0)+.5);ctx.lineTo((xc1+ex2*TRACK_DISTANCE_ROTATE2>>0)+.5,(yc1+ey2*TRACK_DISTANCE_ROTATE2>>0)+.5)}ctx.stroke();ctx.beginPath()}ctx.fillStyle=type!=AscFormat.TYPE_TRACK.CHART_TEXT?_style_white:_style_blue;var TRACK_RECT_SIZE_CUR=type!=AscFormat.TYPE_TRACK.CHART_TEXT?TRACK_RECT_SIZE: TRACK_RECT_SIZE_CT;if(type==AscFormat.TYPE_TRACK.CHART_TEXT)ctx.strokeStyle=_style_white;if(!nIsCleverWithTransform)if(bIsEllipceCorner){overlay.AddEllipse(x1,y1,TRACK_CIRCLE_RADIUS);if(!isLine){overlay.AddEllipse(x2,y2,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x3,y3,TRACK_CIRCLE_RADIUS)}overlay.AddEllipse(x4,y4,TRACK_CIRCLE_RADIUS)}else{overlay.AddRect3(x1,y1,TRACK_RECT_SIZE_CUR,ex1,ey1,ex2,ey2);if(!isLine){overlay.AddRect3(x2,y2,TRACK_RECT_SIZE_CUR,ex1,ey1,ex2,ey2);overlay.AddRect3(x3,y3,TRACK_RECT_SIZE_CUR, ex1,ey1,ex2,ey2)}overlay.AddRect3(x4,y4,TRACK_RECT_SIZE_CUR,ex1,ey1,ex2,ey2)}else if(bIsEllipceCorner){overlay.AddEllipse(_x1,_y1,TRACK_CIRCLE_RADIUS);if(!isLine){overlay.AddEllipse(_x2,_y2,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(_x3,_y3,TRACK_CIRCLE_RADIUS)}overlay.AddEllipse(_x4,_y4,TRACK_CIRCLE_RADIUS)}else if(!isLine){overlay.AddRect2(_x1+.5,_y1+.5,TRACK_RECT_SIZE_CUR);overlay.AddRect2(_x2+.5,_y2+.5,TRACK_RECT_SIZE_CUR);overlay.AddRect2(_x3+.5,_y3+.5,TRACK_RECT_SIZE_CUR);overlay.AddRect2(_x4+ .5,_y4+.5,TRACK_RECT_SIZE_CUR)}else{overlay.AddRect2(x1+.5,y1+.5,TRACK_RECT_SIZE_CUR);overlay.AddRect2(x4+.5,y4+.5,TRACK_RECT_SIZE_CUR)}if(!isLine)if(!nIsCleverWithTransform){if(bIsRectsTrack){if(bIsRectsTrackX){overlay.AddRect3((x1+x2)/2,(y1+y2)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3((x3+x4)/2,(y3+y4)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2)}if(bIsRectsTrackY){overlay.AddRect3((x2+x4)/2,(y2+y4)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3((x3+x1)/2,(y3+y1)/2,TRACK_RECT_SIZE,ex1,ey1, ex2,ey2)}}}else{var _xC=((_x1+_x2)/2>>0)+.5;var _yC=((_y1+_y3)/2>>0)+.5;if(bIsRectsTrackX){overlay.AddRect2(_xC,_y1+.5,TRACK_RECT_SIZE);overlay.AddRect2(_xC,_y3+.5,TRACK_RECT_SIZE)}if(bIsRectsTrackY){overlay.AddRect2(_x2+.5,_yC,TRACK_RECT_SIZE);overlay.AddRect2(_x1+.5,_yC,TRACK_RECT_SIZE)}}ctx.fill();ctx.stroke();ctx.beginPath()}break}case AscFormat.TYPE_TRACK.TEXT:case AscFormat.TYPE_TRACK.GROUP_PASSIVE:{if(bIsClever){overlay.CheckRect(x1,y1,x4-x1,y4-y1);ctx.strokeStyle=_style_blue;this.AddRectDashClever(ctx, x1,y1,x4,y4,8,3,true);ctx.beginPath();if(isCanRotate){var xC=(x1+x2)/2>>0;if(!bIsUseImageRotateTrack){ctx.beginPath();overlay.AddEllipse(xC,y1-TRACK_DISTANCE_ROTATE,TRACK_CIRCLE_RADIUS);ctx.fillStyle=_style_green;ctx.fill();ctx.stroke()}else{var _image_track_rotate=overlay.GetImageTrackRotationImage();if(_image_track_rotate.asc_complete){var _w=IMAGE_ROTATE_TRACK_W;var _xI=xC+.5-_w/2>>0;var _yI=y1-TRACK_DISTANCE_ROTATE-(_w>>1);overlay.CheckRect(_xI,_yI,_w,_w);ctx.drawImage(_image_track_rotate,_xI, _yI,_w,_w)}}ctx.beginPath();ctx.moveTo(xC+.5,y1);ctx.lineTo(xC+.5,y1-TRACK_DISTANCE_ROTATE2);ctx.stroke();ctx.beginPath()}ctx.fillStyle=_style_white;if(bIsEllipceCorner){overlay.AddEllipse(x1,y1,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x2,y2,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x3,y3,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x4,y4,TRACK_CIRCLE_RADIUS)}else{overlay.AddRect2(x1+.5,y1+.5,TRACK_RECT_SIZE);overlay.AddRect2(x2+.5,y2+.5,TRACK_RECT_SIZE);overlay.AddRect2(x3+.5,y3+.5,TRACK_RECT_SIZE);overlay.AddRect2(x4+ .5,y4+.5,TRACK_RECT_SIZE)}if(bIsRectsTrack){var _xC=((x1+x2)/2>>0)+.5;var _yC=((y1+y3)/2>>0)+.5;if(bIsRectsTrackX){overlay.AddRect2(_xC,y1+.5,TRACK_RECT_SIZE);overlay.AddRect2(_xC,y3+.5,TRACK_RECT_SIZE)}if(bIsRectsTrackY){overlay.AddRect2(x2+.5,_yC,TRACK_RECT_SIZE);overlay.AddRect2(x1+.5,_yC,TRACK_RECT_SIZE)}}ctx.fill();ctx.stroke();ctx.beginPath()}else{var _x1=x1;var _y1=y1;var _x2=x2;var _y2=y2;var _x3=x3;var _y3=y3;var _x4=x4;var _y4=y4;if(nIsCleverWithTransform){var _x1=x1;if(x2<_x1)_x1=x2;if(x3< _x1)_x1=x3;if(x4<_x1)_x1=x4;var _x4=x1;if(x2>_x4)_x4=x2;if(x3>_x4)_x4=x3;if(x4>_x4)_x4=x4;var _y1=y1;if(y2<_y1)_y1=y2;if(y3<_y1)_y1=y3;if(y4<_y1)_y1=y4;var _y4=y1;if(y2>_y4)_y4=y2;if(y3>_y4)_y4=y3;if(y4>_y4)_y4=y4;_x2=_x4;_y2=_y1;_x3=_x1;_y3=_y4}overlay.CheckPoint(x1,y1);overlay.CheckPoint(x2,y2);overlay.CheckPoint(x3,y3);overlay.CheckPoint(x4,y4);ctx.strokeStyle=_style_blue;if(!nIsCleverWithTransform)this.AddRectDash(ctx,x1,y1,x2,y2,x3,y3,x4,y4,8,3,true);else this.AddRectDashClever(ctx,_x1,_y1,_x4, _y4,8,3,true);var ex1=(x2-x1)/_len_x;var ey1=(y2-y1)/_len_x;var ex2=(x1-x3)/_len_y;var ey2=(y1-y3)/_len_y;var _bAbsX1=Math.abs(ex1)<.01;var _bAbsY1=Math.abs(ey1)<.01;var _bAbsX2=Math.abs(ex2)<.01;var _bAbsY2=Math.abs(ey2)<.01;if(_bAbsX2&&_bAbsY2)if(_bAbsX1&&_bAbsY1){ex1=1;ey1=0;ex2=0;ey2=1}else{ex2=-ey1;ey2=ex1}else if(_bAbsX1&&_bAbsY1){ex1=ey2;ey1=-ex2}var xc1=(x1+x2)/2;var yc1=(y1+y2)/2;ctx.beginPath();if(isCanRotate){if(!bIsUseImageRotateTrack){ctx.beginPath();overlay.AddEllipse(xc1+ex2*TRACK_DISTANCE_ROTATE, yc1+ey2*TRACK_DISTANCE_ROTATE,TRACK_CIRCLE_RADIUS);ctx.fillStyle=_style_green;ctx.fill();ctx.stroke()}else{var _image_track_rotate=overlay.GetImageTrackRotationImage();if(_image_track_rotate.asc_complete){var _xI=xc1+ex2*TRACK_DISTANCE_ROTATE;var _yI=yc1+ey2*TRACK_DISTANCE_ROTATE;var _w=IMAGE_ROTATE_TRACK_W;var _w2=IMAGE_ROTATE_TRACK_W/2;if(nIsCleverWithTransform){_xI>>=0;_yI>>=0;_w2>>=0;_w2+=1}var _matrix=matrix.CreateDublicate();_matrix.tx=0;_matrix.ty=0;var _xx=_matrix.TransformPointX(0,1);var _yy= _matrix.TransformPointY(0,1);var _angle=Math.atan2(_xx,-_yy)-Math.PI;var _px=Math.cos(_angle);var _py=Math.sin(_angle);ctx.save();ctx.translate(_xI,_yI);ctx.transform(_px,_py,-_py,_px,0,0);ctx.drawImage(_image_track_rotate,-_w2,-_w2,_w,_w);ctx.restore();overlay.CheckRect(_xI-_w2,_yI-_w2,_w,_w)}}ctx.beginPath();if(!nIsCleverWithTransform){ctx.moveTo(xc1,yc1);ctx.lineTo(xc1+ex2*TRACK_DISTANCE_ROTATE2,yc1+ey2*TRACK_DISTANCE_ROTATE2)}else{ctx.moveTo((xc1>>0)+.5,(yc1>>0)+.5);ctx.lineTo((xc1+ex2*TRACK_DISTANCE_ROTATE2>> 0)+.5,(yc1+ey2*TRACK_DISTANCE_ROTATE2>>0)+.5)}ctx.stroke();ctx.beginPath()}ctx.fillStyle=_style_white;if(!nIsCleverWithTransform)if(bIsEllipceCorner){overlay.AddEllipse(x1,y1,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x2,y2,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x3,y3,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x4,y4,TRACK_CIRCLE_RADIUS)}else{overlay.AddRect3(x1,y1,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3(x2,y2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3(x3,y3,TRACK_RECT_SIZE,ex1,ey1,ex2, ey2);overlay.AddRect3(x4,y4,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2)}else if(bIsEllipceCorner){overlay.AddEllipse(x1,y1,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x2,y2,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x3,y3,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x4,y4,TRACK_CIRCLE_RADIUS)}else{overlay.AddRect2(_x1+.5,_y1+.5,TRACK_RECT_SIZE);overlay.AddRect2(_x2+.5,_y2+.5,TRACK_RECT_SIZE);overlay.AddRect2(_x3+.5,_y3+.5,TRACK_RECT_SIZE);overlay.AddRect2(_x4+.5,_y4+.5,TRACK_RECT_SIZE)}if(!nIsCleverWithTransform){if(bIsRectsTrack){if(bIsRectsTrackX){overlay.AddRect3((x1+ x2)/2,(y1+y2)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3((x3+x4)/2,(y3+y4)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2)}if(bIsRectsTrackY){overlay.AddRect3((x2+x4)/2,(y2+y4)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3((x3+x1)/2,(y3+y1)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2)}}}else if(bIsRectsTrack){var _xC=((_x1+_x2)/2>>0)+.5;var _yC=((_y1+_y3)/2>>0)+.5;if(bIsRectsTrackX){overlay.AddRect2(_xC,_y1+.5,TRACK_RECT_SIZE);overlay.AddRect2(_xC,_y3+.5,TRACK_RECT_SIZE)}if(bIsRectsTrackY){overlay.AddRect2(_x2+ .5,_yC,TRACK_RECT_SIZE);overlay.AddRect2(_x1+.5,_yC,TRACK_RECT_SIZE)}}ctx.fill();ctx.stroke();ctx.beginPath()}break}case AscFormat.TYPE_TRACK.EMPTY_PH:{if(bIsClever){overlay.CheckRect(x1,y1,x4-x1,y4-y1);ctx.rect(x1+.5,y2+.5,x4-x1+1,y4-y1);ctx.fillStyle=_style_white;ctx.stroke();ctx.beginPath();ctx.strokeStyle=_style_blue;this.AddRectDashClever(ctx,x1,y1,x4,y4,8,3,true);ctx.beginPath();var xC=(x1+x2)/2>>0;if(!bIsUseImageRotateTrack){ctx.beginPath();overlay.AddEllipse(xC,y1-TRACK_DISTANCE_ROTATE);ctx.fillStyle= _style_green;ctx.fill();ctx.stroke()}else{var _image_track_rotate=overlay.GetImageTrackRotationImage();if(_image_track_rotate.asc_complete){var _w=IMAGE_ROTATE_TRACK_W;var _xI=xC+.5-_w/2>>0;var _yI=y1-TRACK_DISTANCE_ROTATE-(_w>>1);overlay.CheckRect(_xI,_yI,_w,_w);ctx.drawImage(_image_track_rotate,_xI,_yI,_w,_w)}}ctx.beginPath();ctx.moveTo(xC+.5,y1);ctx.lineTo(xC+.5,y1-TRACK_DISTANCE_ROTATE2);ctx.stroke();ctx.beginPath();ctx.fillStyle=_style_white;if(bIsEllipceCorner){overlay.AddEllipse(x1,y1,TRACK_CIRCLE_RADIUS); overlay.AddEllipse(x2,y2,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x3,y3,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x4,y4,TRACK_CIRCLE_RADIUS)}else{overlay.AddRect2(x1+.5,y1+.5,TRACK_RECT_SIZE);overlay.AddRect2(x2+.5,y2+.5,TRACK_RECT_SIZE);overlay.AddRect2(x3+.5,y3+.5,TRACK_RECT_SIZE);overlay.AddRect2(x4+.5,y4+.5,TRACK_RECT_SIZE)}if(bIsRectsTrack&&false){var _xC=((x1+x2)/2>>0)+.5;var _yC=((y1+y3)/2>>0)+.5;overlay.AddRect2(_xC,y1+.5,TRACK_RECT_SIZE);overlay.AddRect2(x2+.5,_yC,TRACK_RECT_SIZE);overlay.AddRect2(_xC, y3+.5,TRACK_RECT_SIZE);overlay.AddRect2(x1+.5,_yC,TRACK_RECT_SIZE)}ctx.fill();ctx.stroke();ctx.beginPath()}else{overlay.CheckPoint(x1,y1);overlay.CheckPoint(x2,y2);overlay.CheckPoint(x3,y3);overlay.CheckPoint(x4,y4);ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.lineTo(x3,y3);ctx.lineTo(x4,y4);ctx.closePath();overlay.CheckPoint(x1,y1);overlay.CheckPoint(x2,y2);overlay.CheckPoint(x3,y3);overlay.CheckPoint(x4,y4);ctx.strokeStyle=_style_white;ctx.stroke();ctx.beginPath();ctx.strokeStyle=_style_blue;this.AddRectDash(ctx, x1,y1,x2,y2,x3,y3,x4,y4,8,3,true);ctx.beginPath();var ex1=(x2-x1)/_len_x;var ey1=(y2-y1)/_len_x;var ex2=(x1-x3)/_len_y;var ey2=(y1-y3)/_len_y;var _bAbsX1=Math.abs(ex1)<.01;var _bAbsY1=Math.abs(ey1)<.01;var _bAbsX2=Math.abs(ex2)<.01;var _bAbsY2=Math.abs(ey2)<.01;if(_bAbsX2&&_bAbsY2)if(_bAbsX1&&_bAbsY1){ex1=1;ey1=0;ex2=0;ey2=1}else{ex2=-ey1;ey2=ex1}else if(_bAbsX1&&_bAbsY1){ex1=ey2;ey1=-ex2}var xc1=(x1+x2)/2;var yc1=(y1+y2)/2;ctx.beginPath();if(!bIsUseImageRotateTrack){ctx.beginPath();overlay.AddEllipse(xc1+ ex2*TRACK_DISTANCE_ROTATE,yc1+ey2*TRACK_DISTANCE_ROTATE,TRACK_DISTANCE_ROTATE);ctx.fillStyle=_style_green;ctx.fill();ctx.stroke()}else{var _image_track_rotate=overlay.GetImageTrackRotationImage();if(_image_track_rotate.asc_complete){var _xI=xc1+ex2*TRACK_DISTANCE_ROTATE;var _yI=yc1+ey2*TRACK_DISTANCE_ROTATE;var _w=IMAGE_ROTATE_TRACK_W;var _w2=IMAGE_ROTATE_TRACK_W/2;ctx.save();overlay.transform(ex1,ey1,-ey1,ex1,_xI,_yI);ctx.drawImage(_image_track_rotate,-_w2,-_w2,_w,_w);overlay.SetBaseTransform(); ctx.restore();overlay.CheckRect(_xI-_w2,_yI-_w2,_w,_w)}}ctx.beginPath();ctx.moveTo(xc1,yc1);ctx.lineTo(xc1+ex2*TRACK_DISTANCE_ROTATE2,yc1+ey2*TRACK_DISTANCE_ROTATE2);ctx.stroke();ctx.beginPath();ctx.fillStyle=_style_white;if(bIsEllipceCorner){overlay.AddEllipse(x1,y1,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x2,y2,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x3,y3,TRACK_CIRCLE_RADIUS);overlay.AddEllipse(x4,y4,TRACK_CIRCLE_RADIUS)}else{overlay.AddRect3(x1,y1,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3(x2, y2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3(x3,y3,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3(x4,y4,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2)}if(bIsRectsTrack){overlay.AddRect3((x1+x2)/2,(y1+y2)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3((x2+x4)/2,(y2+y4)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3((x3+x4)/2,(y3+y4)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2);overlay.AddRect3((x3+x1)/2,(y3+y1)/2,TRACK_RECT_SIZE,ex1,ey1,ex2,ey2)}ctx.fill();ctx.stroke();ctx.beginPath()}break}case AscFormat.TYPE_TRACK.CROP:{if(bIsClever){overlay.CheckRect(x1, y1,x4-x1,y4-y1);var widthCorner=x4-x1+1>>1;var isCentralMarkerX=widthCorner>40?true:false;if(widthCorner>17)widthCorner=17;var heightCorner=y4-y1+1>>1;var isCentralMarkerY=heightCorner>40?true:false;if(heightCorner>17)heightCorner=17;ctx.rect(x1+.5,y2+.5,x4-x1+1,y4-y1);ctx.strokeStyle=_style_black;ctx.stroke();ctx.beginPath();ctx.strokeStyle=_style_white;ctx.fillStyle=_style_black;ctx.moveTo(x1+.5,y1+.5);ctx.lineTo(x1+widthCorner+.5,y1+.5);ctx.lineTo(x1+widthCorner+.5,y1+5.5);ctx.lineTo(x1+5.5,y1+ 5.5);ctx.lineTo(x1+5.5,y1+widthCorner+.5);ctx.lineTo(x1+.5,y1+widthCorner+.5);ctx.closePath();ctx.moveTo(x2-widthCorner+.5,y2+.5);ctx.lineTo(x2+.5,y2+.5);ctx.lineTo(x2+.5,y2+heightCorner+.5);ctx.lineTo(x2-4.5,y2+heightCorner+.5);ctx.lineTo(x2-4.5,y2+5.5);ctx.lineTo(x2-widthCorner+.5,y2+5.5);ctx.closePath();ctx.moveTo(x4-4.5,y4-heightCorner+.5);ctx.lineTo(x4+.5,y4-heightCorner+.5);ctx.lineTo(x4+.5,y4+.5);ctx.lineTo(x4-widthCorner+.5,y4+.5);ctx.lineTo(x4-widthCorner+.5,y4-4.5);ctx.lineTo(x4-4.5,y4- 4.5);ctx.closePath();ctx.moveTo(x3+.5,y3-heightCorner+.5);ctx.lineTo(x3+5.5,y3-heightCorner+.5);ctx.lineTo(x3+5.5,y3-4.5);ctx.lineTo(x3+widthCorner+.5,y3-4.5);ctx.lineTo(x3+widthCorner+.5,y3+.5);ctx.lineTo(x3+.5,y3+.5);ctx.closePath();if(isCentralMarkerX){var xCentral=x4+x1-widthCorner>>1;ctx.moveTo(xCentral+.5,y1+.5);ctx.lineTo(xCentral+widthCorner+.5,y1+.5);ctx.lineTo(xCentral+widthCorner+.5,y1+5.5);ctx.lineTo(xCentral+.5,y1+5.5);ctx.closePath();ctx.moveTo(xCentral+.5,y4-4.5);ctx.lineTo(xCentral+ widthCorner+.5,y4-4.5);ctx.lineTo(xCentral+widthCorner+.5,y4);ctx.lineTo(xCentral+.5,y4+.5);ctx.closePath()}if(isCentralMarkerY){var yCentral=y4+y1-heightCorner>>1;ctx.moveTo(x1+.5,yCentral+.5);ctx.lineTo(x1+5.5,yCentral+.5);ctx.lineTo(x1+5.5,yCentral+heightCorner+.5);ctx.lineTo(x1+.5,yCentral+heightCorner+.5);ctx.closePath();ctx.moveTo(x4-4.5,yCentral+.5);ctx.lineTo(x4+.5,yCentral+.5);ctx.lineTo(x4+.5,yCentral+heightCorner+.5);ctx.lineTo(x4-4.5,yCentral+heightCorner+.5);ctx.closePath()}ctx.fill(); ctx.stroke();ctx.beginPath()}else{overlay.CheckPoint(x1,y1);overlay.CheckPoint(x2,y2);overlay.CheckPoint(x3,y3);overlay.CheckPoint(x4,y4);var ex1=(x2-x1)/_len_x;var ey1=(y2-y1)/_len_x;var ex2=(x1-x3)/_len_y;var ey2=(y1-y3)/_len_y;var _bAbsX1=Math.abs(ex1)<.01;var _bAbsY1=Math.abs(ey1)<.01;var _bAbsX2=Math.abs(ex2)<.01;var _bAbsY2=Math.abs(ey2)<.01;if(_bAbsX2&&_bAbsY2)if(_bAbsX1&&_bAbsY1){ex1=1;ey1=0;ex2=0;ey2=1}else{ex2=-ey1;ey2=ex1}else if(_bAbsX1&&_bAbsY1){ex1=ey2;ey1=-ex2}var widthCorner=_len_x>> 1;var isCentralMarkerX=widthCorner>40?true:false;if(widthCorner>17)widthCorner=17;var heightCorner=_len_y>>1;var isCentralMarkerY=heightCorner>40?true:false;if(heightCorner>17)heightCorner=17;ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.lineTo(x4,y4);ctx.lineTo(x3,y3);ctx.closePath();ctx.strokeStyle=_style_black;ctx.stroke();ctx.beginPath();ctx.strokeStyle=_style_white;ctx.fillStyle=_style_black;var xOff1=widthCorner*ex1;var xOff2=5*ex1;var xOff3=-heightCorner*ex2;var xOff4=-5*ex2;var yOff1=widthCorner* ey1;var yOff2=5*ey1;var yOff3=-heightCorner*ey2;var yOff4=-5*ey2;ctx.moveTo(x1,y1);ctx.lineTo(x1+xOff1,y1+yOff1);ctx.lineTo(x1+xOff1+xOff4,y1+yOff1+yOff4);ctx.lineTo(x1+xOff2+xOff4,y1+yOff2+yOff4);ctx.lineTo(x1+xOff2+xOff3,y1+yOff2+yOff3);ctx.lineTo(x1+xOff3,y1+yOff3);ctx.closePath();ctx.moveTo(x2-xOff1,y2-yOff1);ctx.lineTo(x2,y2);ctx.lineTo(x2+xOff3,y2+yOff3);ctx.lineTo(x2+xOff3-xOff2,y2+yOff3-yOff2);ctx.lineTo(x2-xOff2+xOff4,y2-yOff2+yOff4);ctx.lineTo(x2-xOff1+xOff4,y2-yOff1+yOff4);ctx.closePath(); ctx.moveTo(x4-xOff3-xOff2,y4-yOff3-yOff2);ctx.lineTo(x4-xOff3,y4-yOff3);ctx.lineTo(x4,y4);ctx.lineTo(x4-xOff1,y4-yOff1);ctx.lineTo(x4-xOff1-xOff4,y4-yOff1-yOff4);ctx.lineTo(x4-xOff2-xOff4,y4-yOff2-yOff4);ctx.closePath();ctx.moveTo(x3-xOff3,y3-yOff3);ctx.lineTo(x3-xOff3+xOff2,y3-yOff3+yOff2);ctx.lineTo(x3-xOff4+xOff2,y3-yOff4+yOff2);ctx.lineTo(x3+xOff1-xOff4,y3+yOff1-yOff4);ctx.lineTo(x3+xOff1,y3+yOff1);ctx.lineTo(x3,y3);ctx.closePath();if(isCentralMarkerX){var xCentral=x1+ex1*(_len_x-widthCorner)/ 2;var yCentral=y1+ey1*(_len_x-widthCorner)/2;ctx.moveTo(xCentral,yCentral);ctx.lineTo(xCentral+xOff1,yCentral+yOff1);ctx.lineTo(xCentral+xOff1+xOff4,yCentral+yOff1+yOff4);ctx.lineTo(xCentral+xOff4,yCentral+yOff4);ctx.closePath();xCentral=x3+ex1*(_len_x-widthCorner)/2-xOff4;yCentral=y3+ey1*(_len_x-widthCorner)/2-yOff4;ctx.moveTo(xCentral,yCentral);ctx.lineTo(xCentral+xOff1,yCentral+yOff1);ctx.lineTo(xCentral+xOff1+xOff4,yCentral+yOff1+yOff4);ctx.lineTo(xCentral+xOff4,yCentral+yOff4);ctx.closePath()}if(isCentralMarkerY){var xCentral= x1-ex2*(_len_y-heightCorner)/2;var yCentral=y1-ey2*(_len_y-heightCorner)/2;ctx.moveTo(xCentral,yCentral);ctx.lineTo(xCentral+xOff2,yCentral+yOff2);ctx.lineTo(xCentral+xOff2+xOff3,yCentral+yOff2+yOff3);ctx.lineTo(xCentral+xOff3,yCentral+yOff3);ctx.closePath();xCentral=x2-ex2*(_len_y-heightCorner)/2-xOff2;yCentral=y2-ey2*(_len_y-heightCorner)/2-yOff2;ctx.moveTo(xCentral,yCentral);ctx.lineTo(xCentral+xOff2,yCentral+yOff2);ctx.lineTo(xCentral+xOff2+xOff3,yCentral+yOff2+yOff3);ctx.lineTo(xCentral+xOff3, yCentral+yOff3);ctx.closePath()}ctx.fill();ctx.stroke();ctx.beginPath()}break}default:break}ctx.globalAlpha=_oldGlobalAlpha;if(!_retina&&this.m_oOverlay.IsCellEditor&&AscCommon.AscBrowser.isRetina){this.m_oOverlay.IsRetina=false;this.m_oOverlay.SetBaseTransform();if(matrix){matrix.tx*=AscCommon.AscBrowser.retinaPixelRatio;matrix.ty*=AscCommon.AscBrowser.retinaPixelRatio}}},DrawTrackSelectShapes:function(x,y,w,h){var overlay=this.m_oOverlay;overlay.Show();this.CurrentPageInfo=overlay.m_oHtmlPage.GetDrawingPageInfo(this.PageIndex); var drPage=this.CurrentPageInfo.drawingPage;var xDst=drPage.left;var yDst=drPage.top;var wDst=drPage.right-drPage.left;var hDst=drPage.bottom-drPage.top;var dKoefX=wDst/this.CurrentPageInfo.width_mm;var dKoefY=hDst/this.CurrentPageInfo.height_mm;var x1=xDst+dKoefX*x>>0;var y1=yDst+dKoefY*y>>0;var x2=xDst+dKoefX*(x+w)>>0;var y2=yDst+dKoefY*(y+h)>>0;if(x1>x2){var tmp=x1;x1=x2;x2=tmp}if(y1>y2){var tmp=y1;y1=y2;y2=tmp}overlay.CheckRect(x1,y1,x2-x1,y2-y1);var ctx=overlay.m_oContext;overlay.SetBaseTransform(); var globalAlphaOld=ctx.globalAlpha;ctx.globalAlpha=.5;ctx.beginPath();ctx.fillStyle="rgba(51,102,204,255)";ctx.strokeStyle="#9ADBFE";ctx.lineWidth=1;ctx.fillRect(x1,y1,x2-x1,y2-y1);ctx.beginPath();ctx.strokeRect(x1-.5,y1-.5,x2-x1+1,y2-y1+1);ctx.globalAlpha=globalAlphaOld},AddRect:function(ctx,x,y,r,b,bIsClever){if(bIsClever)ctx.rect(x+.5,y+.5,r-x+1,b-y+1);else{ctx.moveTo(x,y);ctx.rect(x,y,r-x+1,b-y+1)}},AddRectDashClever:function(ctx,x,y,r,b,w_dot,w_dist,bIsStrokeAndCanUseNative){var _support_native_dash= undefined!==ctx.setLineDash;var _x=x+.5;var _y=y+.5;var _r=r+.5;var _b=b+.5;if(_support_native_dash&&bIsStrokeAndCanUseNative===true){ctx.setLineDash([w_dot,w_dist]);ctx.moveTo(x,_y);ctx.lineTo(r-1,_y);ctx.moveTo(_r,y);ctx.lineTo(_r,b-1);ctx.moveTo(r+1,_b);ctx.lineTo(x+2,_b);ctx.moveTo(_x,b+1);ctx.lineTo(_x,y+2);ctx.stroke();ctx.setLineDash([]);return}for(var i=x;i<r;i+=w_dist){ctx.moveTo(i,_y);i+=w_dot;if(i>r-1)i=r-1;ctx.lineTo(i,_y)}for(var i=y;i<b;i+=w_dist){ctx.moveTo(_r,i);i+=w_dot;if(i>b-1)i= b-1;ctx.lineTo(_r,i)}for(var i=r+1;i>x+1;i-=w_dist){ctx.moveTo(i,_b);i-=w_dot;if(i<x+2)i=x+2;ctx.lineTo(i,_b)}for(var i=b+1;i>y+1;i-=w_dist){ctx.moveTo(_x,i);i-=w_dot;if(i<y+2)i=y+2;ctx.lineTo(_x,i)}if(bIsStrokeAndCanUseNative)ctx.stroke()},AddLineDash:function(ctx,x1,y1,x2,y2,w_dot,w_dist){var len=Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));if(len<1)len=1;var len_x1=Math.abs(w_dot*(x2-x1)/len);var len_y1=Math.abs(w_dot*(y2-y1)/len);var len_x2=Math.abs(w_dist*(x2-x1)/len);var len_y2=Math.abs(w_dist* (y2-y1)/len);if(len_x1<.01&&len_y1<.01)return;if(len_x2<.01&&len_y2<.01)return;if(x1<=x2&&y1<=y2)for(var i=x1,j=y1;i<=x2&&j<=y2;i+=len_x2,j+=len_y2){ctx.moveTo(i,j);i+=len_x1;j+=len_y1;if(i>x2)i=x2;if(j>y2)j=y2;ctx.lineTo(i,j)}else if(x1<=x2&&y1>y2)for(var i=x1,j=y1;i<=x2&&j>=y2;i+=len_x2,j-=len_y2){ctx.moveTo(i,j);i+=len_x1;j-=len_y1;if(i>x2)i=x2;if(j<y2)j=y2;ctx.lineTo(i,j)}else if(x1>x2&&y1<=y2)for(var i=x1,j=y1;i>=x2&&j<=y2;i-=len_x2,j+=len_y2){ctx.moveTo(i,j);i-=len_x1;j+=len_y1;if(i<x2)i=x2; if(j>y2)j=y2;ctx.lineTo(i,j)}else for(var i=x1,j=y1;i>=x2&&j>=y2;i-=len_x2,j-=len_y2){ctx.moveTo(i,j);i-=len_x1;j-=len_y1;if(i<x2)i=x2;if(j<y2)j=y2;ctx.lineTo(i,j)}},AddRectDash:function(ctx,x1,y1,x2,y2,x3,y3,x4,y4,w_dot,w_dist,bIsStrokeAndCanUseNative){var _support_native_dash=undefined!==ctx.setLineDash;if(_support_native_dash&&bIsStrokeAndCanUseNative===true){ctx.setLineDash([w_dot,w_dist]);ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.lineTo(x4,y4);ctx.lineTo(x3,y3);ctx.closePath();ctx.stroke();ctx.setLineDash([]); return}this.AddLineDash(ctx,x1,y1,x2,y2,w_dot,w_dist);this.AddLineDash(ctx,x2,y2,x4,y4,w_dot,w_dist);this.AddLineDash(ctx,x4,y4,x3,y3,w_dot,w_dist);this.AddLineDash(ctx,x3,y3,x1,y1,w_dot,w_dist);if(bIsStrokeAndCanUseNative)ctx.stroke()},DrawAdjustment:function(matrix,x,y,bTextWarp){var overlay=this.m_oOverlay;this.CurrentPageInfo=overlay.m_oHtmlPage.GetDrawingPageInfo(this.PageIndex);var drPage=this.CurrentPageInfo.drawingPage;var xDst=drPage.left;var yDst=drPage.top;var wDst=drPage.right-drPage.left; var hDst=drPage.bottom-drPage.top;var dKoefX=wDst/this.CurrentPageInfo.width_mm;var dKoefY=hDst/this.CurrentPageInfo.height_mm;var cx=xDst+dKoefX*matrix.TransformPointX(x,y)>>0;var cy=yDst+dKoefY*matrix.TransformPointY(x,y)>>0;var _style_blue="#4D7399";var _style_yellow="#FDF54A";var _style_text_adj="#F888FF";var ctx=overlay.m_oContext;var dist=TRACK_ADJUSTMENT_SIZE/2;if(!overlay.IsRetina&&overlay.IsCellEditor&&AscCommon.AscBrowser.isRetina)dist*=AscCommon.AscBrowser.retinaPixelRatio;ctx.moveTo(cx- dist,cy);ctx.lineTo(cx,cy-dist);ctx.lineTo(cx+dist,cy);ctx.lineTo(cx,cy+dist);ctx.closePath();overlay.CheckRect(cx-dist,cy-dist,TRACK_ADJUSTMENT_SIZE,TRACK_ADJUSTMENT_SIZE);if(bTextWarp===true)ctx.fillStyle=_style_text_adj;else ctx.fillStyle=_style_yellow;ctx.strokeStyle=_style_blue;ctx.fill();ctx.stroke();ctx.beginPath()},DrawEditWrapPointsPolygon:function(points,matrix){var _len=points.length;if(0==_len)return;var overlay=this.m_oOverlay;overlay.SetBaseTransform();var ctx=overlay.m_oContext;this.CurrentPageInfo= overlay.m_oHtmlPage.GetDrawingPageInfo(this.PageIndex);var drPage=this.CurrentPageInfo.drawingPage;var xDst=drPage.left;var yDst=drPage.top;var wDst=drPage.right-drPage.left;var hDst=drPage.bottom-drPage.top;var dKoefX=wDst/this.CurrentPageInfo.width_mm;var dKoefY=hDst/this.CurrentPageInfo.height_mm;var _tr_points_x=new Array(_len);var _tr_points_y=new Array(_len);for(var i=0;i<_len;i++){_tr_points_x[i]=xDst+dKoefX*matrix.TransformPointX(points[i].x,points[i].y)>>0;_tr_points_y[i]=yDst+dKoefY*matrix.TransformPointY(points[i].x, points[i].y)>>0}ctx.beginPath();for(var i=0;i<_len;i++){if(0==i)ctx.moveTo(_tr_points_x[i],_tr_points_y[i]);else ctx.lineTo(_tr_points_x[i],_tr_points_y[i]);overlay.CheckPoint(_tr_points_x[i],_tr_points_y[i])}ctx.closePath();ctx.lineWidth=1;ctx.strokeStyle="#FF0000";ctx.stroke();ctx.beginPath();for(var i=0;i<_len;i++)overlay.AddRect2(_tr_points_x[i]+.5,_tr_points_y[i]+.5,TRACK_WRAPPOINTS_SIZE);ctx.strokeStyle="#FFFFFF";ctx.fillStyle="#000000";ctx.fill();ctx.stroke();ctx.beginPath()},DrawEditWrapPointsTrackLines:function(points, matrix){var _len=points.length;if(0==_len)return;var overlay=this.m_oOverlay;overlay.SetBaseTransform();var ctx=overlay.m_oContext;this.CurrentPageInfo=overlay.m_oHtmlPage.GetDrawingPageInfo(this.PageIndex);var drPage=this.CurrentPageInfo.drawingPage;var xDst=drPage.left;var yDst=drPage.top;var wDst=drPage.right-drPage.left;var hDst=drPage.bottom-drPage.top;var dKoefX=wDst/this.CurrentPageInfo.width_mm;var dKoefY=hDst/this.CurrentPageInfo.height_mm;var _tr_points_x=new Array(_len);var _tr_points_y= new Array(_len);for(var i=0;i<_len;i++){_tr_points_x[i]=xDst+dKoefX*matrix.TransformPointX(points[i].x,points[i].y)>>0;_tr_points_y[i]=yDst+dKoefY*matrix.TransformPointY(points[i].x,points[i].y)>>0}var globalAlpha=ctx.globalAlpha;ctx.globalAlpha=1;ctx.beginPath();for(var i=0;i<_len;i++){if(0==i)ctx.moveTo(_tr_points_x[i],_tr_points_y[i]);else ctx.lineTo(_tr_points_x[i],_tr_points_y[i]);overlay.CheckPoint(_tr_points_x[i],_tr_points_y[i])}ctx.lineWidth=1;ctx.strokeStyle="#FFFFFF";ctx.stroke();ctx.beginPath(); for(var i=1;i<_len;i++)this.AddLineDash(ctx,_tr_points_x[i-1],_tr_points_y[i-1],_tr_points_x[i],_tr_points_y[i],4,4);ctx.lineWidth=1;ctx.strokeStyle="#000000";ctx.stroke();ctx.beginPath();ctx.globalAlpha=globalAlpha},DrawInlineMoveCursor:function(x,y,h,matrix,overlayNotes){var overlay=this.m_oOverlay;this.CurrentPageInfo=overlay.m_oHtmlPage.GetDrawingPageInfo(this.PageIndex);var drPage=this.CurrentPageInfo.drawingPage;var xDst=drPage.left;var yDst=drPage.top;var wDst=drPage.right-drPage.left;var hDst= drPage.bottom-drPage.top;var dKoefX=wDst/this.CurrentPageInfo.width_mm;var dKoefY=hDst/this.CurrentPageInfo.height_mm;if(overlayNotes){dKoefX=AscCommon.g_dKoef_mm_to_pix;dKoefY=AscCommon.g_dKoef_mm_to_pix;overlay=overlayNotes;var offsets=overlayNotes.getNotesOffsets();xDst=offsets.X;yDst=offsets.Y}var bIsIdentMatr=true;if(matrix!==undefined&&matrix!=null)if(matrix.IsIdentity2()){x+=matrix.tx;y+=matrix.ty}else bIsIdentMatr=false;overlay.SetBaseTransform();if(bIsIdentMatr){var __x=xDst+dKoefX*x>>0; var __y=yDst+dKoefY*y>>0;var __h=h*dKoefY>>0;overlay.CheckRect(__x,__y,2,__h);var ctx=overlay.m_oContext;var _oldAlpha=ctx.globalAlpha;ctx.globalAlpha=1;ctx.lineWidth=1;ctx.strokeStyle="#000000";for(var i=0;i<__h;i+=2){ctx.moveTo(__x,__y+i+.5);ctx.lineTo(__x+2,__y+i+.5)}ctx.stroke();ctx.beginPath();ctx.strokeStyle="#FFFFFF";for(var i=1;i<__h;i+=2){ctx.moveTo(__x,__y+i+.5);ctx.lineTo(__x+2,__y+i+.5)}ctx.stroke();ctx.globalAlpha=_oldAlpha}else{var _x1=matrix.TransformPointX(x,y);var _y1=matrix.TransformPointY(x, y);var _x2=matrix.TransformPointX(x,y+h);var _y2=matrix.TransformPointY(x,y+h);_x1=xDst+dKoefX*_x1;_y1=yDst+dKoefY*_y1;_x2=xDst+dKoefX*_x2;_y2=yDst+dKoefY*_y2;overlay.CheckPoint(_x1,_y1);overlay.CheckPoint(_x2,_y2);var ctx=overlay.m_oContext;var _oldAlpha=ctx.globalAlpha;ctx.globalAlpha=1;ctx.lineWidth=2;ctx.beginPath();ctx.strokeStyle="#FFFFFF";ctx.moveTo(_x1,_y1);ctx.lineTo(_x2,_y2);ctx.stroke();ctx.beginPath();ctx.strokeStyle="#000000";var _vec_len=Math.sqrt((_x2-_x1)*(_x2-_x1)+(_y2-_y1)*(_y2- _y1));var _dx=(_x2-_x1)/_vec_len;var _dy=(_y2-_y1)/_vec_len;var __x=_x1;var __y=_y1;for(var i=0;i<_vec_len;i+=2){ctx.moveTo(__x,__y);__x+=_dx;__y+=_dy;ctx.lineTo(__x,__y);__x+=_dx;__y+=_dy}ctx.stroke();ctx.globalAlpha=_oldAlpha}},drawFlowAnchor:function(x,y){var _flow_anchor=this.m_oOverlay.IsRetina?AscCommon.g_flow_anchor2:AscCommon.g_flow_anchor;if(!_flow_anchor||!_flow_anchor.asc_complete||(!editor||!editor.ShowParaMarks))return;var overlay=this.m_oOverlay;this.CurrentPageInfo=overlay.m_oHtmlPage.GetDrawingPageInfo(this.PageIndex); var drPage=this.CurrentPageInfo.drawingPage;var xDst=drPage.left;var yDst=drPage.top;var wDst=drPage.right-drPage.left;var hDst=drPage.bottom-drPage.top;var dKoefX=wDst/this.CurrentPageInfo.width_mm;var dKoefY=hDst/this.CurrentPageInfo.height_mm;var __x=xDst+dKoefX*x>>0;var __y=yDst+dKoefY*y>>0;__x-=8;overlay.CheckRect(__x,__y,13,15);var ctx=overlay.m_oContext;var _oldAlpha=ctx.globalAlpha;ctx.globalAlpha=1;overlay.SetBaseTransform();ctx.drawImage(_flow_anchor,__x,__y,13,15);ctx.globalAlpha=_oldAlpha}, DrawPresentationComment:function(type,x,y,w,h){if(!AscCommon.g_comment_image||!AscCommon.g_comment_image.asc_complete)return;var overlay=this.m_oOverlay;this.CurrentPageInfo=overlay.m_oHtmlPage.GetDrawingPageInfo(this.PageIndex);var drPage=this.CurrentPageInfo.drawingPage;var xDst=drPage.left;var yDst=drPage.top;var wDst=drPage.right-drPage.left;var hDst=drPage.bottom-drPage.top;var dKoefX=wDst/this.CurrentPageInfo.width_mm;var dKoefY=hDst/this.CurrentPageInfo.height_mm;var __x=xDst+dKoefX*x>>0;var __y= yDst+dKoefY*y>>0;var ctx=overlay.m_oContext;var _oldAlpha=ctx.globalAlpha;ctx.globalAlpha=.5;overlay.SetBaseTransform();var _index=0;if((type&2)==2)_index=2;if((type&1)==1)_index+=1;var _offset=AscCommon.g_comment_image_offsets[_index];overlay.CheckRect(__x,__y,_offset[2],_offset[3]);this.m_oContext.drawImage(AscCommon.g_comment_image,_offset[0],_offset[1],_offset[2],_offset[3],__x,__y,_offset[2],_offset[3]);ctx.globalAlpha=_oldAlpha},DrawFrozenPaneBorderHor:function(y,left,right){this.m_oOverlay.SetBaseTransform(); autoShapeTrack.p_color(170,170,170);var nW=BORDER_WIDTH;if(AscCommon.AscBrowser.isRetina)nW=AscCommon.AscBrowser.convertToRetinaValue(nW,true);autoShapeTrack.Graphics.SetIntegerGrid(true);autoShapeTrack.p_width(nW);autoShapeTrack._s();autoShapeTrack._m(left,y);autoShapeTrack._l(right,y);autoShapeTrack.ds();autoShapeTrack.Graphics.SetIntegerGrid(false)}};function DrawTextByCenter(){var shape=new AscFormat.CShape;shape.setTxBody(AscFormat.CreateTextBodyFromString("",this,shape));var par=shape.txBody.content.Content[0]; par.Reset(0,0,1E3,1E3,0);par.MoveCursorToStartPos();var _paraPr=new CParaPr;par.Pr=_paraPr;var _textPr=new CTextPr;_textPr.FontFamily={Name:this.Font,Index:-1};_textPr.RFonts.Ascii={Name:this.Font,Index:-1};_textPr.RFonts.EastAsia={Name:this.Font,Index:-1};_textPr.RFonts.CS={Name:this.Font,Index:-1};_textPr.RFonts.HAnsi={Name:this.Font,Index:-1};_textPr.Bold=this.Bold;_textPr.Italic=this.Italic;_textPr.FontSize=this.Size;_textPr.FontSizeCS=this.Size;var parRun=new ParaRun(par);var Pos=0;parRun.Set_Pr(_textPr); parRun.AddText(this.Text);par.AddToContent(0,parRun);par.Recalculate_Page(0);par.Recalculate_Page(0);var _bounds=par.Get_PageBounds(0);var _canvas=this.getCanvas();var _ctx=_canvas.getContext("2d");var _wPx=_canvas.width;var _hPx=_canvas.height;var _wMm=_wPx*AscCommon.g_dKoef_pix_to_mm;var _hMm=_hPx*AscCommon.g_dKoef_pix_to_mm;_ctx.clearRect(0,0,_wPx,_hPx);var _pxBoundsW=par.Lines[0].Ranges[0].W*AscCommon.g_dKoef_mm_to_pix;var _pxBoundsH=(_bounds.Bottom-_bounds.Top)*AscCommon.g_dKoef_mm_to_pix;var _yOffset= _hPx-_pxBoundsH>>1;var _xOffset=_wPx-_pxBoundsW>>1;var graphics=new AscCommon.CGraphics;graphics.init(_ctx,_wPx,_hPx,_wMm,_hMm);graphics.m_oFontManager=AscCommon.g_fontManager;graphics.m_oCoordTransform.tx=_xOffset;graphics.m_oCoordTransform.ty=_yOffset;graphics.transform(1,0,0,1,0,0);par.Draw(0,graphics)}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].TRACK_CIRCLE_RADIUS=TRACK_CIRCLE_RADIUS;window["AscCommon"].TRACK_DISTANCE_ROTATE=TRACK_DISTANCE_ROTATE;window["AscCommon"].COverlay= COverlay;window["AscCommon"].CAutoshapeTrack=CAutoshapeTrack;window["AscCommon"].DrawTextByCenter=DrawTextByCenter})(window);"use strict";(function(window,undefined){var global_hatch_data=[0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1,1, 1,1,1,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,0,0, 1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1, 1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,0, 1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,1,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, 1,0,0,1,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1, 1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1, 0,1,0,1,1,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,1,0,0,1,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,0, 0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1, 0,0,0,0,1,1,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,1,0,1,0,0,0,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,1,0,1,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,0,1,1,1,0,0,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,1,1, 0,0,1,1,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,1,1,0,0,1,1,1];var HATCH_TX_SIZE=8;var global_hatch_offsets={};global_hatch_offsets["cross"]=0;global_hatch_offsets["dashDnDiag"]=1;global_hatch_offsets["dashHorz"]=2;global_hatch_offsets["dashUpDiag"]=3;global_hatch_offsets["dashVert"]=4;global_hatch_offsets["diagBrick"]=5;global_hatch_offsets["diagCross"]=6;global_hatch_offsets["divot"]=7;global_hatch_offsets["dkDnDiag"]=8;global_hatch_offsets["dkHorz"]=9;global_hatch_offsets["dkUpDiag"]= 10;global_hatch_offsets["dkVert"]=11;global_hatch_offsets["dnDiag"]=12;global_hatch_offsets["dotDmnd"]=13;global_hatch_offsets["dotGrid"]=14;global_hatch_offsets["horz"]=15;global_hatch_offsets["horzBrick"]=16;global_hatch_offsets["lgCheck"]=17;global_hatch_offsets["lgConfetti"]=18;global_hatch_offsets["lgGrid"]=19;global_hatch_offsets["ltDnDiag"]=20;global_hatch_offsets["ltHorz"]=21;global_hatch_offsets["ltUpDiag"]=22;global_hatch_offsets["ltVert"]=23;global_hatch_offsets["narHorz"]=24;global_hatch_offsets["narVert"]= 25;global_hatch_offsets["openDmnd"]=26;global_hatch_offsets["pct10"]=27;global_hatch_offsets["pct20"]=28;global_hatch_offsets["pct25"]=29;global_hatch_offsets["pct30"]=30;global_hatch_offsets["pct40"]=31;global_hatch_offsets["pct5"]=32;global_hatch_offsets["pct50"]=33;global_hatch_offsets["pct60"]=34;global_hatch_offsets["pct70"]=35;global_hatch_offsets["pct75"]=36;global_hatch_offsets["pct80"]=37;global_hatch_offsets["pct90"]=38;global_hatch_offsets["plaid"]=39;global_hatch_offsets["shingle"]=40; global_hatch_offsets["smCheck"]=41;global_hatch_offsets["smConfetti"]=42;global_hatch_offsets["smGrid"]=43;global_hatch_offsets["solidDmnd"]=44;global_hatch_offsets["sphere"]=45;global_hatch_offsets["trellis"]=46;global_hatch_offsets["upDiag"]=47;global_hatch_offsets["vert"]=48;global_hatch_offsets["wave"]=49;global_hatch_offsets["wdDnDiag"]=50;global_hatch_offsets["wdUpDiag"]=51;global_hatch_offsets["weave"]=52;global_hatch_offsets["zigZag"]=53;var global_hatch_names=["cross","dashDnDiag","dashHorz", "dashUpDiag","dashVert","diagBrick","diagCross","divot","dkDnDiag","dkHorz","dkUpDiag","dkVert","dnDiag","dotDmnd","dotGrid","horz","horzBrick","lgCheck","lgConfetti","lgGrid","ltDnDiag","ltHorz","ltUpDiag","ltVert","narHorz","narVert","openDmnd","pct10","pct20","pct25","pct30","pct40","pct5","pct50","pct60","pct70","pct75","pct80","pct90","plaid","shingle","smCheck","smConfetti","smGrid","solidDmnd","sphere","trellis","upDiag","vert","wave","wdDnDiag","wdUpDiag","weave","zigZag"];var global_hatch_offsets_count= 54;var global_hatch_brushes={};function CHatchBrush(){this.Name="";this.Canvas=null;this.Ctx=null;this.Data=null;this.fgClr={R:-1,G:-1,B:-1,A:255};this.bgClr={R:-1,G:-1,B:-1,A:255}}CHatchBrush.prototype={Create:function(name){this.Name=name;if(undefined===global_hatch_offsets[name])this.Name="cross";if(!window["NATIVE_EDITOR_ENJINE"]){this.Canvas=document.createElement("canvas");this.Canvas.width=HATCH_TX_SIZE;this.Canvas.height=HATCH_TX_SIZE;this.Ctx=this.Canvas.getContext("2d");this.Data=this.Ctx.createImageData(HATCH_TX_SIZE, HATCH_TX_SIZE)}else this.Data=new Uint8Array(4*HATCH_TX_SIZE*HATCH_TX_SIZE)},CheckColors:function(r,g,b,a,br,bg,bb,ba){if(null==this.Data)return;if(this.fgClr.R==r&&this.fgClr.G==g&&this.fgClr.B==b&&this.fgClr.A==a&&this.bgClr.R==br&&this.bgClr.G==bg&&this.bgClr.B==bb&&this.bgClr.A==ba)return;this.fgClr.R=r;this.fgClr.G=g;this.fgClr.B=b;this.fgClr.A=a;this.bgClr.R=br;this.bgClr.G=bg;this.bgClr.B=bb;this.bgClr.A=ba;var _len=HATCH_TX_SIZE*HATCH_TX_SIZE;var _src_data_offset=global_hatch_offsets[this.Name]* _len;var _src_data=global_hatch_data;var _dst_data=this.Canvas?this.Data.data:this.Data;var _ind=0;for(var i=0;i<_len;i++)if(_src_data[_src_data_offset+i]==0){_dst_data[_ind++]=r;_dst_data[_ind++]=g;_dst_data[_ind++]=b;_dst_data[_ind++]=a}else{_dst_data[_ind++]=br;_dst_data[_ind++]=bg;_dst_data[_ind++]=bb;_dst_data[_ind++]=ba}if(this.Canvas)this.Ctx.putImageData(this.Data,0,0)},toDataURL:function(){if(this.Canvas)return this.Canvas.toDataURL("image/png");return"data:onlyoffice_hatch,"+AscCommon.Base64Encode(this.Data, 4*HATCH_TX_SIZE*HATCH_TX_SIZE)}};function GetHatchBrush(name,r,g,b,a,br,bg,bb,ba){var _brush=global_hatch_brushes[name];if(_brush!==undefined){_brush.CheckColors(r,g,b,a,br,bg,bb,ba);return _brush}_brush=new CHatchBrush;_brush.Create(name);_brush.CheckColors(r,g,b,a,br,bg,bb,ba);global_hatch_brushes[name]=_brush;return _brush}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].global_hatch_names=global_hatch_names;window["AscCommon"].global_hatch_offsets=global_hatch_offsets;window["AscCommon"].GetHatchBrush= GetHatchBrush})(window);"use strict";(function(window,undefined){var AscBrowser=window["AscCommon"].AscBrowser;var debug=false;var ArrowType={NONE:0,ARROW_TOP:1,ARROW_RIGHT:2,ARROW_BOTTOM:3,ARROW_LEFT:4};var AnimationType={NONE:0,SCROLL_HOVER:1,ARROW_HOVER:2,SCROLL_ACTIVE:3,ARROW_ACTIVE:4};function GetClientWidth(elem){var _w=elem.clientWidth;if(0!=_w)return _w;var _string_w=""+elem.style.width;if(-1<_string_w.indexOf("%"))return 0;var _intVal=parseInt(_string_w);if(!isNaN(_intVal)&&0<_intVal)return _intVal; return 0}function GetClientHeight(elem){var _w=elem.clientHeight;if(0!=_w)return _w;var _string_w=""+elem.style.height;if(-1<_string_w.indexOf("%"))return 0;var _intVal=parseInt(_string_w);if(!isNaN(_intVal)&&0<_intVal)return _intVal;return 0}function CArrowDrawer(settings){this.Size=16;this.SizeW=16;this.SizeH=16;this.SizeNaturalW=this.SizeW;this.SizeNaturalH=this.SizeH;this.IsRetina=false;this.ColorGradStart={R:settings.arrowColor,G:settings.arrowColor,B:settings.arrowColor};this.ColorBorderNone= settings.arrowBorderColor;this.ColorBorderOver=settings.arrowOverBorderColor;this.ColorBorderActive=settings.arrowActiveBorderColor;this.ColorBackNone=settings.arrowBackgroundColor;this.ColorBackOver=settings.arrowOverBackgroundColor;this.ColorBackActive=settings.arrowActiveBackgroundColor;this.IsDrawBorderInNoneMode=false;this.IsDrawBorders=true;this.pxCount=settings.slimScroll?4:6;this.ImageLeft=null;this.ImageTop=null;this.ImageRight=null;this.ImageBottom=null;this.fadeInFadeOutDelay=settings.fadeInFadeOutDelay|| 30}CArrowDrawer.prototype.InitSize=function(sizeW,sizeH,is_retina){var dPR=AscBrowser.retinaPixelRatio;this.SizeW=Math.max(sizeW,1);this.SizeH=Math.max(sizeH,1);this.IsRetina=is_retina;this.SizeNaturalW=this.SizeW;this.SizeNaturalH=this.SizeH;if(null==this.ImageLeft||null==this.ImageTop||null==this.ImageRight||null==this.ImageBottom){this.ImageLeft=document.createElement("canvas");this.ImageTop=document.createElement("canvas");this.ImageRight=document.createElement("canvas");this.ImageBottom=document.createElement("canvas")}var len= Math.floor(this.pxCount*dPR);if(this.SizeH<this.pxCount)return;if(0==(len&1))len+=1;var countPart=len+1>>1,_data,px,_x=this.SizeW-len>>1,_y=this.SizeH-(this.SizeH-countPart>>1),r,g,b;var __x=_x,__y=_y,_len=len;r=this.ColorGradStart.R;g=this.ColorGradStart.G;b=this.ColorGradStart.B;this.ImageTop.width=this.SizeW;this.ImageTop.height=this.SizeH;this.ImageBottom.width=this.SizeW;this.ImageBottom.height=this.SizeH;this.ImageLeft.width=this.SizeW;this.ImageLeft.height=this.SizeH;this.ImageRight.width= this.SizeW;this.ImageRight.height=this.SizeH;var ctx=this.ImageTop.getContext("2d");var ctxBottom=this.ImageBottom.getContext("2d");var ctxLeft=this.ImageLeft.getContext("2d");var ctxRight=this.ImageRight.getContext("2d");_data=ctx.createImageData(this.SizeW,this.SizeH);px=_data.data;while(_len>0){var ind=4*(this.SizeW*__y+__x);for(var i=0;i<_len;i++){px[ind++]=r;px[ind++]=g;px[ind++]=b;px[ind++]=255}r=r>>0;g=g>>0;b=b>>0;__x+=1;__y-=1;_len-=2}var dy=dPR<=1?-1:0;ctx.putImageData(_data,0,dy);_data= ctxLeft.createImageData(this.SizeW,this.SizeH);px=_data.data;_len=len;__x=_x,__y=_y;while(_len>0){var ind=4*(this.SizeH*__x+__y);var xx=__x;for(var i=0;i<_len;i++){px[ind++]=r;px[ind++]=g;px[ind++]=b;px[ind++]=255;++xx;ind=4*(this.SizeH*xx+__y)}r=r>>0;g=g>>0;b=b>>0;__x+=1;__y-=1;_len-=2}var dx=dPR<=1?-1:0;var dy=this.SizeW%2===0?1:0;ctxLeft.putImageData(_data,dx,dy);dx=this.SizeW%2===0?1:0;ctxBottom.translate(this.SizeW/2,this.SizeH/2);ctxBottom.rotate(Math.PI);ctxBottom.translate(-this.SizeW/2,-this.SizeH/ 2);ctxBottom.drawImage(this.ImageTop,dx,0,this.ImageBottom.width,this.ImageBottom.height);dy=this.SizeH%2===0?-1:0;ctxRight.translate(this.SizeW/2,this.SizeH/2);ctxRight.rotate(Math.PI);ctxRight.translate(-this.SizeW/2,-this.SizeH/2);ctxRight.drawImage(this.ImageLeft,0,dy,this.ImageRight.width,this.ImageRight.height)};function ScrollSettings(){this.showArrows=true;this.screenW=-1;this.screenH=-1;this.screenAddH=0;this.contentH=0;this.contentW=0;this.initialDelay=300;this.arrowRepeatFreq=50;this.trackClickRepeatFreq= 70;this.scrollPagePercent=1/8;this.scrollerMinHeight=34;this.scrollerMaxHeight=99999;this.scrollerMinWidth=34;this.scrollerMaxWidth=99999;this.arrowDim=Math.round(13*AscBrowser.retinaPixelRatio);this.scrollerColor=241;this.scrollBackgroundColor="#f4f4f4";this.scrollBackgroundColorHover="#f4f4f4";this.scrollBackgroundColorActive="#f4f4f4";this.strokeStyleNone="#cfcfcf";this.strokeStyleOver="#cfcfcf";this.strokeStyleActive="#ADADAD";this.vscrollStep=10;this.hscrollStep=10;this.wheelScrollLines=1;this.arrowColor= 173;this.arrowBackgroundColor=241;this.arrowBorderColor="#cfcfcf";this.arrowOverBorderColor="#cfcfcf";this.arrowOverBackgroundColor="#cfcfcf";this.arrowActiveBorderColor="#ADADAD";this.arrowActiveBackgroundColor="#ADADAD";this.fadeInFadeOutDelay=20;this.piperColor="#cfcfcf";this.piperColorHover="#f1f1f1";this.defaultColor=241;this.hoverColor=207;this.activeColor=173;this.arrowSizeW=Math.round(13*AscBrowser.retinaPixelRatio);this.arrowSizeH=Math.round(13*AscBrowser.retinaPixelRatio);this.cornerRadius= 0;this.slimScroll=false;this.alwaysVisible=false;this.isVerticalScroll=true;this.isHorizontalScroll=false}function ScrollObject(elemID,settings,dbg){if(dbg)debug=dbg;this.that=this;this.settings=settings;this.ArrowDrawer=new CArrowDrawer(this.settings);this.mouseUp=false;this.mouseDown=false;this.that.mouseover=false;this.scrollerMouseDown=false;this.animState=AnimationType.NONE;this.lastAnimState=this.animState;this.arrowState=ArrowType.NONE;this.lastArrowState=this.arrowState;this.moveble=false; this.lock=false;this.scrollTimeout=null;this.StartMousePosition={x:0,y:0};this.EndMousePosition={x:0,y:0};this.dragMinY=0;this.dragMaxY=0;this.scrollVCurrentY=0;this.scrollHCurrentX=0;this.arrowPosition=0;this.verticalTrackHeight=0;this.horizontalTrackWidth=0;this.paneHeight=0;this.paneWidth=0;this.maxScrollY=0;this.maxScrollX=0;this.maxScrollY2=0;this.maxScrollX2=0;this.scrollCoeff=0;this.isResizeArrows=false;this.scroller={x:0,y:1,h:0,w:0};this.canvas=null;this.context=null;this.eventListeners= [];this.IsRetina=false;this.canvasW=1;this.canvasH=1;this.canvasOriginalW=1;this.canvasOriginalH=1;this.scrollColor=this.settings.scrollerColor;this.arrowColor=this.settings.arrowColor;this.firstArrow={arrowColor:this.settings.arrowColor,arrowBackColor:this.ArrowDrawer.ColorBackNone};this.secondArrow={arrowColor:this.settings.arrowColor,arrowBackColor:this.ArrowDrawer.ColorBackNone};this.piperColor=207;this.fadeTimeoutScroll=null;this.fadeTimeoutArrows=null;this.IsRetina=AscBrowser.isRetina;this.disableCurrentScroll= false;this._initPiperImg();this._init(elemID)}ScrollObject.prototype._initPiperImg=function(){var dPR=AscBrowser.retinaPixelRatio;this.piperImgVert=document.createElement("canvas");this.piperImgHor=document.createElement("canvas");this.piperImgVert.height=Math.round(13*dPR);this.piperImgVert.width=Math.round(5*dPR);this.piperImgHor.width=Math.round(13*dPR);this.piperImgHor.height=Math.round(5*dPR);if(this.settings.slimScroll)this.piperImgVert.width=this.piperImgHor.height=Math.round(3*dPR);var ctx_piperImg; ctx_piperImg=this.piperImgVert.getContext("2d");ctx_piperImg.beginPath();ctx_piperImg.lineWidth=Math.floor(dPR);var count=0;var _dPR=dPR<.5?Math.ceil(dPR):Math.round(dPR);for(var i=0;i<this.piperImgVert.height;i+=_dPR+Math.floor(dPR)){ctx_piperImg.moveTo(0,i+.5*ctx_piperImg.lineWidth);ctx_piperImg.lineTo(this.piperImgVert.width,i+.5*ctx_piperImg.lineWidth);ctx_piperImg.stroke();++count;if(count>6&&dPR>=1)break}ctx_piperImg=this.piperImgHor.getContext("2d");ctx_piperImg.beginPath();ctx_piperImg.lineWidth= Math.floor(dPR);var count=0;for(var i=0;i<this.piperImgHor.width;i+=_dPR+Math.floor(dPR)){ctx_piperImg.moveTo(i+.5*ctx_piperImg.lineWidth,0);ctx_piperImg.lineTo(i+.5*ctx_piperImg.lineWidth,this.piperImgHor.height);ctx_piperImg.stroke();++count;if(count>6&&dPR>=1)break}};ScrollObject.prototype._init=function(elemID){if(!elemID)return false;var dPR=AscBrowser.retinaPixelRatio;var holder=document.getElementById(elemID);if(holder.getElementsByTagName("canvas").length==0)this.canvas=holder.appendChild(document.createElement("CANVAS")); else this.canvas=holder.children[1];this.canvas.style.width="100%";this.canvas.style.height="100%";this.canvas.that=this;this.canvas.style.zIndex=100;this.canvas.style.position="absolute";this.canvas.style.top="0px";this.canvas.style["msTouchAction"]="none";if(navigator.userAgent.toLowerCase().indexOf("webkit")!=-1)this.canvas.style.webkitUserSelect="none";this.context=this.canvas.getContext("2d");this._setDimension(holder.clientHeight,holder.clientWidth);this.maxScrollY=this.maxScrollY2=this.settings.contentH- this.settings.screenH>0?this.settings.contentH-this.settings.screenH:0;this.maxScrollX=this.maxScrollX2=this.settings.contentW-this.settings.screenW>0?this.settings.contentW-this.settings.screenW:0;if(this.settings.isVerticalScroll&&!this.settings.alwaysVisible)this.canvas.style.display=this.maxScrollY==0?"none":"";if(this.settings.isHorizontalScroll&&!this.settings.alwaysVisible)this.canvas.style.display=this.maxScrollX==0?"none":"";this._setScrollerHW();this.settings.arrowDim=this.settings.slimScroll&& this.settings.isVerticalScroll?this.scroller.w:this.settings.arrowDim;this.settings.arrowDim=this.settings.slimScroll&&this.settings.isHorizontalScroll?this.scroller.h:this.settings.arrowDim;this.arrowPosition=this.settings.showArrows?Math.round(this.settings.arrowDim+this._roundForScale(dPR)+this._roundForScale(dPR)):Math.round(dPR);this.paneHeight=this.canvasH-this.arrowPosition*2;this.paneWidth=this.canvasW-this.arrowPosition*2;this.RecalcScroller();AscCommon.addMouseEvent(this.canvas,"down",this.evt_mousedown); AscCommon.addMouseEvent(this.canvas,"move",this.evt_mousemove);AscCommon.addMouseEvent(this.canvas,"up",this.evt_mouseup);AscCommon.addMouseEvent(this.canvas,"over",this.evt_mouseover);AscCommon.addMouseEvent(this.canvas,"out",this.evt_mouseout);this.canvas.onmousewheel=this.evt_mousewheel;var _that=this;this.canvas.ontouchstart=function(e){_that.evt_mousedown(e.touches[0]);return false};this.canvas.ontouchmove=function(e){_that.evt_mousemove(e.touches[0]);return false};this.canvas.ontouchend=function(e){_that.evt_mouseup(e.changedTouches[0]); return false};if(this.canvas.addEventListener)this.canvas.addEventListener("DOMMouseScroll",this.evt_mousewheel,false);this.context.fillStyle=this.settings.scrollBackgroundColor;this.context.fillRect(0,0,this.canvasW,this.canvasH);this._drawArrows();this._draw();return true};ScrollObject.prototype.disableCurrentScroll=function(){this.disableCurrentScroll=true};ScrollObject.prototype.checkDisableCurrentScroll=function(){var ret=this.disableCurrentScroll;this.disableCurrentScroll=false;return ret}; ScrollObject.prototype.getMousePosition=function(evt){var obj=this.canvas;var top=0;var left=0;while(obj&&obj.tagName!="BODY"){top+=obj.offsetTop;left+=obj.offsetLeft;obj=obj.offsetParent}var dPR=AscBrowser.retinaPixelRatio;var mouseX=((evt.clientX*AscBrowser.zoom>>0)-left+window.pageXOffset)*dPR;var mouseY=((evt.clientY*AscBrowser.zoom>>0)-top+window.pageYOffset)*dPR;return{x:mouseX,y:mouseY}};ScrollObject.prototype.RecalcScroller=function(startpos){var dPR=AscBrowser.retinaPixelRatio;if(this.settings.isVerticalScroll){if(this.settings.showArrows){this.verticalTrackHeight= this.canvasH-this.arrowPosition*2;this.scroller.y=this.arrowPosition}else{this.verticalTrackHeight=this.canvasH;this.scroller.y=Math.round(dPR)}var percentInViewV;percentInViewV=(this.maxScrollY*dPR+this.paneHeight)/this.paneHeight;this.scroller.h=Math.ceil(Math.ceil(1/percentInViewV*this.verticalTrackHeight/dPR)*dPR);var scrollMinH=Math.round(this.settings.scrollerMinHeight*dPR);if(this.scroller.h<scrollMinH)this.scroller.h=scrollMinH;else if(this.scroller.h>this.settings.scrollerMaxHeight)this.scroller.h= this.settings.scrollerMaxHeight;this.scrollCoeff=this.maxScrollY/Math.max(1,this.paneHeight-this.scroller.h);if(startpos)this.scroller.y=startpos/this.scrollCoeff+this.arrowPosition;this.dragMaxY=this.canvasH-this.arrowPosition-this.scroller.h+1;this.dragMinY=this.arrowPosition}if(this.settings.isHorizontalScroll){if(this.settings.showArrows){this.horizontalTrackWidth=this.canvasW-this.arrowPosition*2;this.scroller.x=this.arrowPosition}else{this.horizontalTrackWidth=this.canvasW;this.scroller.x=Math.round(dPR)}var percentInViewH; percentInViewH=(this.maxScrollX*dPR+this.paneWidth)/this.paneWidth;this.scroller.w=Math.ceil(Math.ceil(1/percentInViewH*this.horizontalTrackWidth/dPR)*dPR);var scrollMinW=Math.round(this.settings.scrollerMinWidth*dPR);if(this.scroller.w<scrollMinW)this.scroller.w=scrollMinW;else if(this.scroller.w>this.settings.scrollerMaxWidth)this.scroller.w=this.settings.scrollerMaxWidth;this.scrollCoeff=this.maxScrollX/Math.max(1,this.paneWidth-this.scroller.w);if(typeof startpos!=="undefined")this.scroller.x= startpos/this.scrollCoeff+this.arrowPosition;this.dragMaxX=this.canvasW-this.arrowPosition-this.scroller.w;this.dragMinX=this.arrowPosition}};ScrollObject.prototype.Repos=function(settings,bIsHorAttack,bIsVerAttack,pos){var dPR=AscBrowser.retinaPixelRatio;if(this.settings.showArrows){this.settings.arrowSizeW=Math.round(13*dPR);this.settings.arrowSizeH=Math.round(13*dPR);this.ArrowDrawer.InitSize(this.settings.arrowSizeH,this.settings.arrowSizeW,this.IsRetina)}if(bIsVerAttack){var _canvasH=settings.screenH; if(undefined!==_canvasH&&settings.screenAddH)_canvasH+=settings.screenAddH;if(_canvasH==this.canvasH&&undefined!==settings.contentH){var _maxScrollY=settings.contentH-settings.screenH>0?settings.contentH-settings.screenH:0;if(_maxScrollY==this.maxScrollY)return}}if(bIsHorAttack)if(settings.screenW==this.canvasW&&undefined!==settings.contentW){var _maxScrollX=settings.contentW-settings.screenW>0?settings.contentW-settings.screenW:0;if(_maxScrollX==this.maxScrollX)return}var dPR=AscBrowser.retinaPixelRatio; var _parentClientW=GetClientWidth(this.canvas.parentNode);var _parentClientH=GetClientHeight(this.canvas.parentNode);var _firstChildW=settings.contentW;var _firstChildH=settings.contentH;this.maxScrollY=this.maxScrollY2=_firstChildH-settings.screenH>0?_firstChildH-settings.screenH:0;this.maxScrollX=this.maxScrollX2=_firstChildW-settings.screenW>0?_firstChildW-settings.screenW:0;this._setDimension(_parentClientH,_parentClientW);this._setScrollerHW();this.settings.arrowDim=Math.round(13*dPR);this.settings.arrowDim= this.settings.slimScroll&&this.settings.isVerticalScroll?this.scroller.w:this.settings.arrowDim;this.settings.arrowDim=this.settings.slimScroll&&this.settings.isHorizontalScroll?this.scroller.h:this.settings.arrowDim;this.arrowPosition=this.settings.showArrows?Math.round(this.settings.arrowDim+this._roundForScale(dPR)+this._roundForScale(dPR)):Math.round(dPR);this.paneHeight=this.canvasH-this.arrowPosition*2;this.paneWidth=this.canvasW-this.arrowPosition*2;this.RecalcScroller();if(this.settings.isVerticalScroll&& !this.settings.alwaysVisible){if(this.scrollVCurrentY>this.maxScrollY)this.scrollVCurrentY=this.maxScrollY;this.scrollToY(this.scrollVCurrentY);if(this.maxScrollY==0)this.canvas.style.display="none";else this.canvas.style.display=""}else if(this.settings.isHorizontalScroll){if(this.scrollHCurrentX>this.maxScrollX)this.scrollHCurrentX=this.maxScrollX;this.scrollToX(this.scrollHCurrentX);if(this.maxScrollX==0&&!this.settings.alwaysVisible)this.canvas.style.display="none";else this.canvas.style.display= ""}this.reinit=true;if(this.settings.isVerticalScroll&&pos)pos!==undefined?this.scrollByY(pos-this.scrollVCurrentY):this.scrollToY(this.scrollVCurrentY);if(this.settings.isHorizontalScroll&&pos)pos!==undefined?this.scrollByX(pos-this.scrollHCurrentX):this.scrollToX(this.scrollHCurrentX);this.reinit=false;if(this.isResizeArrows){this.context=this.canvas.getContext("2d");this.context.fillStyle=this.settings.scrollBackgroundColor;this.context.fillRect(0,0,this.canvasW,this.canvasH);this._drawArrows()}this._initPiperImg(); this._draw()};ScrollObject.prototype._scrollV=function(that,evt,pos,isTop,isBottom,bIsAttack){if(!this.settings.isVerticalScroll)return;if(that.scrollVCurrentY!==pos||bIsAttack===true){var oldPos=that.scrollVCurrentY;that.scrollVCurrentY=pos;evt.scrollD=evt.scrollPositionY=that.scrollVCurrentY;evt.maxScrollY=that.maxScrollY;that.handleEvents("onscrollvertical",evt);if(that.checkDisableCurrentScroll()){that.scrollVCurrentY=oldPos;return}that._draw()}else if(that.scrollVCurrentY===pos&&pos>0&&!this.reinit&& !this.moveble&&!this.lock){evt.pos=pos;that.handleEvents("onscrollVEnd",evt)}};ScrollObject.prototype._correctScrollV=function(that,yPos){if(!this.settings.isVerticalScroll)return null;var events=that.eventListeners["oncorrectVerticalScroll"];if(events){if(events.length!=1)return null;return events[0].handler.apply(that,[yPos])}return null};ScrollObject.prototype._correctScrollByYDelta=function(that,delta){if(!this.settings.isVerticalScroll)return null;var events=that.eventListeners["oncorrectVerticalScrollDelta"]; if(events){if(events.length!=1)return null;return events[0].handler.apply(that,[delta])}return null};ScrollObject.prototype._scrollH=function(that,evt,pos,isTop,isBottom){if(!this.settings.isHorizontalScroll)return;if(that.scrollHCurrentX!==pos){that.scrollHCurrentX=pos;evt.scrollD=evt.scrollPositionX=that.scrollHCurrentX;evt.maxScrollX=that.maxScrollX;that._draw();that.handleEvents("onscrollhorizontal",evt)}else if(that.scrollHCurrentX===pos&&pos>0&&!this.reinit&&!this.moveble&&!this.lock){evt.pos= pos;that.handleEvents("onscrollHEnd",evt)}};ScrollObject.prototype.scrollByY=function(delta,isAttack){if(!this.settings.isVerticalScroll)return;var dPR=AscBrowser.retinaPixelRatio;var result=this._correctScrollByYDelta(this,delta);if(result!=null&&result.isChange===true)delta=result.Pos;var destY=this.scrollVCurrentY+delta,isTop=false,isBottom=false,vend=false;if(this.scrollVCurrentY+delta<0){destY=0;isTop=true;isBottom=false}else if(this.scrollVCurrentY+delta>this.maxScrollY2){this.handleEvents("onscrollVEnd", destY-this.maxScrollY);vend=true;destY=this.maxScrollY2;isTop=false;isBottom=true}var scrollCoeff=this.scrollCoeff===0?1:this.scrollCoeff;this.scroller.y=destY/scrollCoeff+this.arrowPosition;if(this.scroller.y<this.dragMinY)this.scroller.y=this.dragMinY+1;else if(this.scroller.y>this.dragMaxY)this.scroller.y=this.dragMaxY;var arrow=this.settings.showArrows?this.arrowPosition:0;if(this.scroller.y+this.scroller.h>this.canvasH-arrow)this.scroller.y-=Math.abs(this.canvasH-arrow-this.scroller.y-this.scroller.h); this.scroller.y=Math.round(this.scroller.y);if(vend)this.moveble=true;this._scrollV(this,{},destY,isTop,isBottom,isAttack);if(vend)this.moveble=false};ScrollObject.prototype.scrollToY=function(destY){if(!this.settings.isVerticalScroll)return;this.scroller.y=destY/Math.max(1,this.scrollCoeff)+this.arrowPosition;if(this.scroller.y<this.dragMinY)this.scroller.y=this.dragMinY+1;else if(this.scroller.y>this.dragMaxY)this.scroller.y=this.dragMaxY;var arrow=this.settings.showArrows?this.arrowPosition:0; if(this.scroller.y+this.scroller.h>this.canvasH-arrow)this.scroller.y-=Math.abs(this.canvasH-arrow-this.scroller.y-this.scroller.h);this.scroller.y=Math.round(this.scroller.y);this._scrollV(this,{},destY,false,false)};ScrollObject.prototype.scrollByX=function(delta){if(!this.settings.isHorizontalScroll)return;var dPR=AscBrowser.retinaPixelRatio;var destX=this.scrollHCurrentX+delta,isTop=false,isBottom=false,hend=false;if(destX<0){destX=0;isTop=true;isBottom=false}else if(destX>this.maxScrollX2){this.handleEvents("onscrollHEnd", destX-this.maxScrollX);hend=true;destX=this.maxScrollX2;isTop=false;isBottom=true}var scrollCoeff=this.scrollCoeff===0?1:this.scrollCoeff;this.scroller.x=destX/scrollCoeff+this.arrowPosition;if(this.scroller.x<this.dragMinX)this.scroller.x=this.dragMinX+1;else if(this.scroller.x>this.dragMaxX)this.scroller.x=this.dragMaxX;var arrow=this.settings.showArrows?this.arrowPosition:0;if(this.scroller.x+this.scroller.w>this.canvasW-arrow)this.scroller.x-=Math.abs(this.canvasW-arrow-this.scroller.x-this.scroller.w); this.scroller.x=Math.round(this.scroller.x);if(hend)this.moveble=true;this._scrollH(this,{},destX,isTop,isBottom);if(hend)this.moveble=true};ScrollObject.prototype.scrollToX=function(destX){if(!this.settings.isHorizontalScroll)return;this.scroller.x=destX/Math.max(1,this.scrollCoeff)+this.arrowPosition;if(this.scroller.x<this.dragMinX)this.scroller.x=this.dragMinX+1;else if(this.scroller.x>this.dragMaxX)this.scroller.x=this.dragMaxX;var arrow=this.settings.showArrows?this.arrowPosition:0;if(this.scroller.x+ this.scroller.w>this.canvasW-arrow)this.scroller.x-=Math.abs(this.canvasW-arrow-this.scroller.x-this.scroller.w);this.scroller.x=Math.round(this.scroller.x);this._scrollH(this,{},destX,false,false)};ScrollObject.prototype.scrollTo=function(destX,destY){this.scrollToX(destX);this.scrollToY(destY)};ScrollObject.prototype.scrollBy=function(deltaX,deltaY){this.scrollByX(deltaX);this.scrollByY(deltaY)};ScrollObject.prototype.roundRect=function(x,y,width,height,radius){if(typeof radius==="undefined")radius= 1;this.context.beginPath();this.context.moveTo(x+radius,y);this.context.lineTo(x+width-radius,y);this.context.quadraticCurveTo(x+width,y,x+width,y+radius);this.context.lineTo(x+width,y+height-radius);this.context.quadraticCurveTo(x+width,y+height,x+width-radius,y+height);this.context.lineTo(x+radius,y+height);this.context.quadraticCurveTo(x,y+height,x,y+height-radius);this.context.lineTo(x,y+radius);this.context.quadraticCurveTo(x,y,x+radius,y);this.context.closePath()};ScrollObject.prototype._clearContent= function(){this.context.clearRect(0,0,this.canvasW,this.canvasH)};ScrollObject.prototype._drawArrows=function(){var that=this;if(!that.settings.showArrows)return;var t=that.ArrowDrawer;var xDeltaBORDER=.5,yDeltaBORDER=1.5;var roundDPR=that._roundForScale(AscBrowser.retinaPixelRatio);var x1=that.settings.isVerticalScroll?0:roundDPR;var y1=that.settings.isVerticalScroll?yDeltaBORDER*roundDPR:-roundDPR;var x2=0;var y2=that.settings.isVerticalScroll?0:0;var strokeW=t.SizeW-roundDPR;var strokeH=t.SizeH- roundDPR;var ctx=that.context;ctx.beginPath();ctx.fillStyle="rgb("+t.ColorBackNone+","+t.ColorBackNone+","+t.ColorBackNone+")";var arrowImage=that.ArrowDrawer.ImageTop;if(that.settings.isVerticalScroll)for(var i=0;i<2;i++){ctx.fillRect(x1+xDeltaBORDER*ctx.lineWidth,y1,strokeW,strokeH);ctx.drawImage(arrowImage,x1,y2,t.SizeW,t.SizeH);if(t.IsDrawBorders){ctx.strokeStyle=t.ColorBorderNone;ctx.lineWidth=roundDPR;ctx.rect(x1+xDeltaBORDER*ctx.lineWidth,y1,strokeW,strokeH);ctx.stroke()}y1=that.canvasH-t.SizeH+ roundDPR-yDeltaBORDER*roundDPR;y2=that.canvasH-t.SizeH;arrowImage=that.ArrowDrawer.ImageBottom}var arrowImage=that.ArrowDrawer.ImageLeft;if(that.settings.isHorizontalScroll)for(var i=0;i<2;i++){ctx.fillRect(x1+xDeltaBORDER*ctx.lineWidth,y1+yDeltaBORDER*ctx.lineWidth,strokeW,strokeH);ctx.drawImage(arrowImage,x2,y2,t.SizeW,t.SizeH);if(t.IsDrawBorders){ctx.strokeStyle=t.ColorBorderNone;ctx.lineWidth=roundDPR;ctx.rect(x1+xDeltaBORDER*ctx.lineWidth,y1+yDeltaBORDER*ctx.lineWidth,strokeW,strokeH);ctx.stroke()}x1= that.canvasW-t.SizeW-roundDPR;x2=that.canvasW-t.SizeW;y2=0;arrowImage=that.ArrowDrawer.ImageRight}};ScrollObject.prototype._drawScroll=function(fillColor,piperColor){var that=this;that.context.beginPath();var roundDPR=this._roundForScale(AscBrowser.retinaPixelRatio);that.context.lineWidth=roundDPR;if(that.settings.isVerticalScroll){var _y=that.settings.showArrows?that.arrowPosition:0,_h=that.canvasH-(_y<<1);if(_h>0)that.context.rect(0,_y,that.canvasW,_h)}else if(that.settings.isHorizontalScroll){var _x= that.settings.showArrows?that.arrowPosition:0,_w=that.canvasW-(_x<<1);if(_w>0)that.context.rect(_x,0,_w,that.canvasH)}switch(that.animState){case AnimationType.SCROLL_HOVER:{that.context.fillStyle=that.settings.scrollBackgroundColorHover;break}case AnimationType.SCROLL_ACTIVE:{that.context.fillStyle=that.settings.scrollBackgroundColorActive;break}case AnimationType.NONE:default:{that.context.fillStyle=that.settings.scrollBackgroundColor;that.context.strokeStyle=that.settings.strokeStyleNone;break}}that.context.fill(); that.context.beginPath();if(that.settings.isVerticalScroll&&that.maxScrollY!=0){var _y=that.scroller.y>>0,arrow=that.settings.showArrows?that.arrowPosition:0;if(_y<arrow)_y=arrow;var _b=Math.round(that.scroller.y+that.scroller.h);if(_b>that.canvasH-arrow-1)_b=that.canvasH-arrow-1;if(_b>_y)that.roundRect(that.scroller.x-.5*that.context.lineWidth,_y+.5*that.context.lineWidth,that.scroller.w-roundDPR,that.scroller.h-roundDPR,that.settings.cornerRadius*roundDPR)}else if(that.settings.isHorizontalScroll&& that.maxScrollX!=0){var _x=that.scroller.x>>0,arrow=that.settings.showArrows?that.arrowPosition:0;if(_x<arrow)_x=arrow;var _r=that.scroller.x+that.scroller.w>>0;if(_r>that.canvasW-arrow-2)_r=that.canvasW-arrow-1;if(_r>_x)that.roundRect(_x+.5*that.context.lineWidth,that.scroller.y-.5*that.context.lineWidth,that.scroller.w-roundDPR,that.scroller.h-roundDPR,that.settings.cornerRadius*roundDPR)}that.context.fillStyle="rgb("+fillColor+","+fillColor+","+fillColor+")";that.context.strokeStyle=fillColor=== 173?"rgb("+173+","+173+","+173+")":this.settings.strokeStyleOver;that.context.fill();that.context.stroke();var ctx_piperImg,_data,px,img,x,y;if(that._checkPiperImagesV()){x=Math.round((that.scroller.w-that.piperImgVert.width)/2);y=Math.floor(that.scroller.y+Math.floor(that.scroller.h/2)-6*AscBrowser.retinaPixelRatio);ctx_piperImg=that.piperImgVert.getContext("2d");ctx_piperImg.globalCompositeOperation="source-in";ctx_piperImg.fillStyle="rgb("+piperColor+","+piperColor+","+piperColor+")";ctx_piperImg.fillRect(0, 0,that.scroller.w-1,that.scroller.h-1);img=that.piperImgVert}else if(that._checkPiperImagesH()){x=Math.round(that.scroller.x+(that.scroller.w-that.piperImgHor.width)/2);y=Math.round((that.scroller.h-that.piperImgHor.height)/2);ctx_piperImg=that.piperImgHor.getContext("2d");ctx_piperImg.globalCompositeOperation="source-in";ctx_piperImg.fillStyle="rgb("+piperColor+","+piperColor+","+piperColor+")";ctx_piperImg.fillRect(0,0,that.scroller.w-1,that.scroller.h-1);img=that.piperImgHor}if(img)that.context.drawImage(img, x,y);that.scrollColor=fillColor;that.piperColor=piperColor};ScrollObject.prototype._animateArrow=function(fadeIn,curArrowType,backgroundColorUnfade){var that=this;var roundDPR=that._roundForScale(AscBrowser.retinaPixelRatio);var sizeW=that.ArrowDrawer.SizeW,sizeH=that.ArrowDrawer.SizeH;if(!that.settings.showArrows||!curArrowType)return;var cnvs=document.createElement("canvas"),arrowType,ctx=cnvs.getContext("2d"),context=that.context,hoverColor=that.settings.hoverColor,defaultColor=that.settings.defaultColor, activeColor=that.settings.activeColor;cnvs.width=sizeW;cnvs.height=sizeH;if(curArrowType===ArrowType.ARROW_TOP||curArrowType===ArrowType.ARROW_LEFT)arrowType=this.firstArrow;else if(curArrowType===ArrowType.ARROW_BOTTOM||curArrowType===ArrowType.ARROW_RIGHT)arrowType=this.secondArrow;else return;var x=0,y=0,fillRectX=0,fillRectY=0,strokeRectX=0,strokeRectY=0;var arrowImage=that.settings.isVerticalScroll?that.ArrowDrawer.ImageTop:that.ArrowDrawer.ImageLeft;switch(curArrowType){case ArrowType.ARROW_TOP:{fillRectX= roundDPR;fillRectY=roundDPR;break}case ArrowType.ARROW_BOTTOM:{y=that.canvasH-sizeH;fillRectY=-roundDPR;strokeRectY=-2*roundDPR;arrowImage=that.ArrowDrawer.ImageBottom;break}case ArrowType.ARROW_RIGHT:{y=0;x=that.canvasW-sizeW;fillRectX=-roundDPR;strokeRectX=-roundDPR;strokeRectY=-roundDPR;arrowImage=that.ArrowDrawer.ImageRight;break}case ArrowType.ARROW_LEFT:{y=0;x=0;fillRectX=roundDPR;strokeRectX=roundDPR;strokeRectY=-roundDPR;break}}if(fadeIn){if(arrowType.arrowBackColor<=hoverColor&&arrowType.arrowColor>= defaultColor)return;if(arrowType.arrowBackColor>hoverColor)arrowType.arrowBackColor-=2;if(arrowType.arrowColor<defaultColor)arrowType.arrowColor+=4}else if(fadeIn===false){if(arrowType.arrowBackColor>=defaultColor&&arrowType.arrowColor<=hoverColor)return;if(arrowType.arrowBackColor<defaultColor)arrowType.arrowBackColor+=2;if(arrowType.arrowColor>activeColor)arrowType.arrowColor-=4}else{arrowType.arrowBackColor=backgroundColorUnfade;arrowType.arrowColor=backgroundColorUnfade===defaultColor?activeColor: defaultColor;ctx=that.context}ctx.fillStyle="rgb("+arrowType.arrowBackColor+","+arrowType.arrowBackColor+","+arrowType.arrowBackColor+")";var x1=fadeIn===undefined?x:0;var y1=fadeIn===undefined?y:0;ctx.fillRect(x1+fillRectX,y1+fillRectY,sizeW-roundDPR,sizeH-roundDPR);if(that.ArrowDrawer.IsDrawBorders){var borderColor=hoverColor;if(backgroundColorUnfade===activeColor)borderColor=activeColor;ctx.strokeStyle="rgb("+borderColor+","+borderColor+","+borderColor+")";ctx.lineWidth=roundDPR;ctx.strokeRect(x1+ .5*ctx.lineWidth+strokeRectX,y1+1.5*ctx.lineWidth+strokeRectY,sizeW-roundDPR,sizeH-roundDPR)}var imgContext=arrowImage.getContext("2d");imgContext.globalCompositeOperation="source-in";imgContext.fillStyle="rgb("+arrowType.arrowColor+","+arrowType.arrowColor+","+arrowType.arrowColor+")";imgContext.fillRect(.5,1.5,sizeW,sizeH);ctx.drawImage(arrowImage,x1,y1,sizeW,sizeH);context.drawImage(cnvs,x,y,sizeW,sizeH);if(fadeIn===undefined)return;that.fadeTimeoutArrows=setTimeout(function(){that._animateArrow(fadeIn, curArrowType,backgroundColorUnfade)},that.settings.fadeInFadeOutDelay)};ScrollObject.prototype._animateScroll=function(fadeIn){var that=this;that.context.beginPath();that._drawScroll(that.scrollColor,that.piperColor);if(fadeIn&&that.scrollColor<=207&&that.piperColor>=241||!fadeIn&&that.scrollColor>=241&&that.piperColor<=207)return;if(fadeIn){that.scrollColor-=2;that.piperColor+=2}else if(fadeIn===false){that.scrollColor+=2;that.piperColor-=2}that.fadeTimeoutScroll=setTimeout(function(){that._animateScroll(fadeIn)}, that.settings.fadeInFadeOutDelay)};ScrollObject.prototype._doAnimation=function(lastAnimState){var that=this,hoverColor=that.settings.hoverColor,defaultColor=that.settings.defaultColor,activeColor=that.settings.activeColor,secondArrow;switch(that.arrowState){case ArrowType.ARROW_TOP:secondArrow=ArrowType.ARROW_BOTTOM;break;case ArrowType.ARROW_BOTTOM:secondArrow=ArrowType.ARROW_TOP;break;case ArrowType.ARROW_LEFT:secondArrow=ArrowType.ARROW_RIGHT;break;case ArrowType.ARROW_RIGHT:secondArrow=ArrowType.ARROW_LEFT; break}if(that.animState===AnimationType.NONE&&lastAnimState===AnimationType.NONE)that._drawScroll(defaultColor,hoverColor);else if(that.animState===AnimationType.SCROLL_HOVER&&lastAnimState===AnimationType.SCROLL_HOVER){that._animateArrow(false,that.arrowState);that._animateScroll(true)}else if(that.animState===AnimationType.ARROW_HOVER&&lastAnimState===AnimationType.NONE){that._animateArrow(false,secondArrow);that._animateArrow(true,that.arrowState);that._animateScroll(true)}else if(that.animState=== AnimationType.SCROLL_HOVER&&lastAnimState===AnimationType.NONE){that._animateArrow(false,that.arrowState);that._animateScroll(true)}else if(that.animState===AnimationType.NONE&&lastAnimState===AnimationType.ARROW_HOVER){that._animateArrow(false,that.arrowState);that._animateScroll(false)}else if(that.animState===AnimationType.NONE&&lastAnimState===AnimationType.SCROLL_ACTIVE){that._animateArrow(false,that.arrowState);that._drawScroll(defaultColor,hoverColor)}else if(that.animState===AnimationType.SCROLL_HOVER&& lastAnimState===AnimationType.ARROW_HOVER){that._animateArrow(false,that.arrowState);that._animateScroll(true)}else if(that.animState===AnimationType.NONE&&lastAnimState===AnimationType.SCROLL_HOVER){that._animateArrow(false,that.arrowState);that._animateScroll(false)}else if(that.animState===AnimationType.ARROW_HOVER&&lastAnimState===AnimationType.SCROLL_HOVER){that._animateArrow(false,secondArrow);that._animateArrow(true,that.arrowState);that._animateScroll(true)}else if(this.animState===AnimationType.SCROLL_HOVER&& lastAnimState===AnimationType.SCROLL_ACTIVE){that._animateArrow(undefined,that.arrowState,defaultColor);that._drawScroll(hoverColor,defaultColor)}else if(this.animState===AnimationType.SCROLL_HOVER&&lastAnimState===AnimationType.ARROW_ACTIVE){that._animateArrow(undefined,that.arrowState,defaultColor);that._drawScroll(hoverColor,defaultColor)}else if(this.animState===AnimationType.ARROW_ACTIVE){that._animateArrow(undefined,that.arrowState,activeColor);that._animateScroll(true)}else if(this.animState=== AnimationType.ARROW_HOVER&&lastAnimState===AnimationType.ARROW_ACTIVE)if(this.lastArrowState&&this.lastArrowState!==this.arrowState){that._animateArrow(undefined,secondArrow,defaultColor);that._animateArrow(true,that.arrowState);that._animateScroll(true)}else{that._animateArrow(undefined,that.arrowState,hoverColor);that._animateScroll(true)}else if(this.animState===AnimationType.NONE&&lastAnimState===AnimationType.ARROW_ACTIVE){that._animateArrow(undefined,that.arrowState,defaultColor);that._animateScroll(false)}else if(this.animState=== AnimationType.ARROW_HOVER&&lastAnimState===AnimationType.SCROLL_ACTIVE){that._animateArrow(false,secondArrow);that._animateArrow(true,that.arrowState);if(that.mouseUp&&!that.mouseDown)that._drawScroll(hoverColor,defaultColor);else if(that.mouseDown&&that.scrollerMouseDown)that._drawScroll(activeColor,defaultColor)}else if(this.animState===AnimationType.SCROLL_ACTIVE){that._animateArrow(false,that.arrowState);that._drawScroll(activeColor,defaultColor)}else return};ScrollObject.prototype._draw=function(){clearTimeout(this.fadeTimeoutScroll); this.fadeTimeoutScroll=null;clearTimeout(this.fadeTimeoutArrows);this.fadeTimeoutArrows=null;this._doAnimation(this.lastAnimState);this.lastAnimState=this.animState};ScrollObject.prototype._checkPiperImagesV=function(){if(this.settings.isVerticalScroll&&this.maxScrollY!=0&&this.scroller.h>=Math.round(13*AscBrowser.retinaPixelRatio))return true;return false};ScrollObject.prototype._checkPiperImagesH=function(){if(this.settings.isHorizontalScroll&&this.maxScrollX!=0&&this.scroller.w>=Math.round(13* AscBrowser.retinaPixelRatio))return true;return false};ScrollObject.prototype._setDimension=function(h,w){var dPR=AscBrowser.retinaPixelRatio;if(this.canvasH===Math.round(h*dPR)&&this.canvasW===Math.round(w*dPR)){this.isResizeArrows=false;return}this.isResizeArrows=true;this.canvasH=Math.round(h*dPR);this.canvasW=Math.round(w*dPR);this.canvasOriginalH=h;this.canvasOriginalW=w;this.canvas.height=this.canvasH;this.canvas.width=this.canvasW};ScrollObject.prototype._setScrollerHW=function(){var dPR=AscBrowser.retinaPixelRatio; if(this.settings.isVerticalScroll){this.scroller.x=this._roundForScale(dPR);this.scroller.w=Math.round((this.canvasOriginalW-1)*dPR);if(this.settings.slimScroll)this.settings.arrowSizeW=this.settings.arrowSizeH=this.scroller.w;if(this.settings.showArrows)this.ArrowDrawer.InitSize(this.settings.arrowSizeW,this.settings.arrowSizeH,this.IsRetina)}else if(this.settings.isHorizontalScroll){this.scroller.y=this._roundForScale(dPR);this.scroller.h=Math.round((this.canvasOriginalH-1)*dPR);if(this.settings.slimScroll)this.settings.arrowSizeH= this.settings.arrowSizeW=this.scroller.h;if(this.settings.showArrows)this.ArrowDrawer.InitSize(this.settings.arrowSizeH,this.settings.arrowSizeW,this.IsRetina)}};ScrollObject.prototype._MouseHoverOnScroller=function(mp){if(this.settings.isVerticalScroll&&mp.x>=0&&mp.x<=this.scroller.x+this.scroller.w&&mp.y>=this.scroller.y&&mp.y<=this.scroller.y+this.scroller.h)return true;else if(this.settings.isHorizontalScroll&&mp.x>=this.scroller.x&&mp.x<=this.scroller.x+this.scroller.w&&mp.y>=0&&mp.y<=this.scroller.y+ this.scroller.h)return true;else return false};ScrollObject.prototype._MouseArrowHover=function(mp){var arrowDim=this.settings.arrowDim;if(this.settings.isVerticalScroll)if(mp.x>=0&&mp.x<=this.canvasW&&mp.y>=0&&mp.y<=arrowDim)return ArrowType.ARROW_TOP;else if(mp.x>=0&&mp.x<=this.canvasW&&mp.y>=this.canvasH-arrowDim&&mp.y<=this.canvasH)return ArrowType.ARROW_BOTTOM;else return ArrowType.NONE;if(this.settings.isHorizontalScroll)if(mp.x>=0&&mp.x<=arrowDim&&mp.y>=0&&mp.y<=this.canvasH)return ArrowType.ARROW_LEFT; else if(mp.x>=this.canvasW-arrowDim&&mp.x<=this.canvasW&&mp.y>=0&&mp.y<=this.canvasH)return ArrowType.ARROW_RIGHT;else return ArrowType.NONE};ScrollObject.prototype._arrowDownMouseDown=function(){var that=this,scrollTimeout,isFirst=true,doScroll=function(){if(that.settings.isVerticalScroll)that.scrollByY(that.settings.vscrollStep);else if(that.settings.isHorizontalScroll)that.scrollByX(that.settings.hscrollStep);if(that.mouseDown)scrollTimeout=setTimeout(doScroll,isFirst?that.settings.initialDelay: that.settings.arrowRepeatFreq);isFirst=false};doScroll();this.bind("mouseup.main mouseout",function(){scrollTimeout&&clearTimeout(scrollTimeout);scrollTimeout=null})};ScrollObject.prototype._arrowUpMouseDown=function(){var that=this,scrollTimeout,isFirst=true,doScroll=function(){if(that.settings.isVerticalScroll)that.scrollByY(-that.settings.vscrollStep);else if(that.settings.isHorizontalScroll)that.scrollByX(-that.settings.hscrollStep);if(that.mouseDown)scrollTimeout=setTimeout(doScroll,isFirst? that.settings.initialDelay:that.settings.arrowRepeatFreq);isFirst=false};doScroll();this.bind("mouseup.main mouseout",function(){scrollTimeout&&clearTimeout(scrollTimeout);scrollTimeout=null})};ScrollObject.prototype.getCurScrolledX=function(){return this.scrollHCurrentX};ScrollObject.prototype.getCurScrolledY=function(){return this.scrollVCurrentY};ScrollObject.prototype.getMaxScrolledY=function(){return this.maxScrollY};ScrollObject.prototype.getMaxScrolledX=function(){return this.maxScrollX};ScrollObject.prototype.getIsLockedMouse= function(){return this.that.mouseDownArrow||this.that.mouseDown};ScrollObject.prototype.evt_mousemove=function(e){if(this.style)this.style.cursor="default";var evt=e||window.event;if(evt.preventDefault)evt.preventDefault();else evt.returnValue=false;var mousePos=this.that.getMousePosition(evt);this.that.EndMousePosition.x=mousePos.x;this.that.EndMousePosition.y=mousePos.y;var arrowHover=this.that._MouseArrowHover(mousePos);var dPR=AscBrowser.retinaPixelRatio;if(this.that.settings.showArrows&&this.that.mouseDownArrow){if(arrowHover&& arrowHover===this.that.arrowState)this.that.arrowState=arrowHover;this.that.animState=AnimationType.ARROW_ACTIVE}else if(!this.that.mouseDownArrow)if(!arrowHover||!this.that.settings.showArrows)this.that.animState=AnimationType.SCROLL_HOVER;else{this.that.animState=AnimationType.ARROW_HOVER;this.that.arrowState=arrowHover}if(this.that.mouseDown&&this.that.scrollerMouseDown)this.that.moveble=true;else this.that.moveble=false;if(this.that.settings.isVerticalScroll){if(this.that.moveble&&this.that.scrollerMouseDown){var isTop= false,isBottom=false;if(arrowHover&&this.that.settings.showArrows)this.that.animState=AnimationType.ARROW_HOVER;else this.that.animState=AnimationType.SCROLL_ACTIVE;var _dlt=this.that.EndMousePosition.y-this.that.StartMousePosition.y;_dlt=_dlt>=0?Math.floor(_dlt):Math.ceil(_dlt);if(this.that.EndMousePosition.y==this.that.StartMousePosition.y)return;else if(this.that.EndMousePosition.y<this.that.arrowPosition){this.that.EndMousePosition.y=this.that.arrowPosition;this.that.scroller.y=this.that.arrowPosition}else if(this.that.EndMousePosition.y> this.that.canvasH-this.that.arrowPosition){this.that.EndMousePosition.y=this.that.canvasH-this.that.arrowPosition;this.that.scroller.y=this.that.canvasH-this.that.arrowPosition-this.that.scroller.h}else{var dltY=_dlt>0?this.that.canvasH-this.that.arrowPosition-this.that.scroller.h-this.that.scroller.y:this.that.arrowPosition-this.that.scroller.y;_dlt=_dlt>0?dltY<_dlt?dltY:_dlt:dltY>_dlt?dltY:_dlt;if(_dlt>0&&this.that.scroller.y+this.that.scroller.h+_dlt+Math.round(dPR)<=this.that.canvasH-this.that.arrowPosition|| _dlt<0&&this.that.scroller.y+_dlt>=this.that.arrowPosition)this.that.scroller.y+=_dlt;else if(_dlt>0)this.that.scroller.y=this.that.canvasH-this.that.arrowPosition-this.that.scroller.h;else if(_dlt<0)this.that.scroller.y=this.that.arrowPosition}var destY=(this.that.scroller.y-this.that.arrowPosition)*this.that.scrollCoeff;var result=this.that._correctScrollV(this.that,destY);if(result!=null&&result.isChange===true)destY=result.Pos;this.that._scrollV(this.that,evt,destY,isTop,isBottom);this.that.StartMousePosition.x= this.that.EndMousePosition.x;this.that.StartMousePosition.y=this.that.EndMousePosition.y}}else if(this.that.settings.isHorizontalScroll)if(this.that.moveble&&this.that.scrollerMouseDown){var isTop=false,isBottom=false;if(arrowHover&&this.that.settings.showArrows)this.that.animState=AnimationType.ARROW_HOVER;else this.that.animState=AnimationType.SCROLL_ACTIVE;var _dlt=this.that.EndMousePosition.x-this.that.StartMousePosition.x;_dlt=_dlt>=0?Math.floor(_dlt):Math.ceil(_dlt);if(this.that.EndMousePosition.x== this.that.StartMousePosition.x)return;else if(this.that.EndMousePosition.x<this.that.arrowPosition){this.that.EndMousePosition.x=this.that.arrowPosition;this.that.scroller.x=this.that.arrowPosition}else if(this.that.EndMousePosition.x>this.that.canvasW-this.that.arrowPosition){this.that.EndMousePosition.x=this.that.canvasW-this.that.arrowPosition;this.that.scroller.x=this.that.canvasW-this.that.arrowPosition-this.that.scroller.w}else{var dltX=_dlt>0?this.that.canvasW-this.that.arrowPosition-this.that.scroller.w- this.that.scroller.x:this.that.arrowPosition-this.that.scroller.x;_dlt=_dlt>0?dltX<_dlt?dltX:_dlt:dltX>_dlt?dltX:_dlt;if(_dlt>0&&this.that.scroller.x+this.that.scroller.w+_dlt<=this.that.canvasW-this.that.arrowPosition||_dlt<0&&this.that.scroller.x+_dlt>=this.that.arrowPosition)this.that.scroller.x+=_dlt;else if(_dlt>0)this.that.scroller.x=this.that.canvasW-this.that.arrowPosition-this.that.scroller.w;else if(_dlt<0)this.that.scroller.x=this.that.arrowPosition}var destX=(this.that.scroller.x-this.that.arrowPosition+ Math.round(dPR))*this.that.scrollCoeff;this.that._scrollH(this.that,evt,destX,isTop,isBottom);this.that.StartMousePosition.x=this.that.EndMousePosition.x;this.that.StartMousePosition.y=this.that.EndMousePosition.y}this.that.moveble=false;if(this.that.lastAnimState!=this.that.animState)this.that._draw()};ScrollObject.prototype.evt_mouseout=function(e){var evt=e||window.event;if(this.that.settings.showArrows){this.that.mouseDown=this.that.mouseDownArrow?false:this.that.mouseDown;this.that.mouseDownArrow= false;this.that.handleEvents("onmouseout",evt)}if(this.that.mouseDown&&this.that.scrollerMouseDown)this.that.animState=AnimationType.SCROLL_ACTIVE;else this.that.animState=AnimationType.NONE;this.that._draw()};ScrollObject.prototype.evt_mouseover=function(e){this.that.mouseover=true};ScrollObject.prototype.evt_mouseup=function(e){var evt=e||window.event;this.that.handleEvents("onmouseup",evt);if(window.g_asc_plugins)window.g_asc_plugins.enablePointerEvents();if(evt.preventDefault)evt.preventDefault(); else evt.returnValue=false;this.that.mouseDown=false;var mousePos=this.that.getMousePosition(evt);var arrowHover=this.that._MouseArrowHover(mousePos);var mouseHover=this.that._MouseHoverOnScroller(mousePos);this.that.scrollTimeout&&clearTimeout(this.that.scrollTimeout);this.that.scrollTimeout=null;if(this.that.scrollerMouseDown){this.that.mouseUp=true;this.that.scrollerMouseDown=false;this.that.mouseDownArrow=false;if(this.that._MouseHoverOnScroller(mousePos))this.that.animState=AnimationType.SCROLL_HOVER; else if(arrowHover&&this.that.settings.showArrows){this.that.lastAnimState=AnimationType.SCROLL_ACTIVE;this.that.animState=AnimationType.ARROW_HOVER}else if(mouseHover)this.that.animState=AnimationType.SCROLL_HOVER;else this.that.animState=AnimationType.NONE}else{if(arrowHover&&this.that.settings.showArrows){this.that.lastArrowState=this.that.arrowState;this.that.arrowState=arrowHover;this.that.animState=AnimationType.ARROW_HOVER}else if(this.that._MouseHoverOnScroller(mousePos))this.that.animState= AnimationType.SCROLL_HOVER;else this.that.animState=AnimationType.NONE;this.that.mouseDownArrow=false}this.that._draw();if(this.that.onLockMouse&&this.that.offLockMouse)this.that.offLockMouse(evt)};ScrollObject.prototype.evt_mousedown=function(e){var evt=e||window.event;if(window.g_asc_plugins)window.g_asc_plugins.disablePointerEvents();var mousePos=this.that.getMousePosition(evt),arrowHover=this.that._MouseArrowHover(mousePos);this.that.mouseDown=true;if(this.that.settings.showArrows&&arrowHover){this.that.mouseDownArrow= true;this.that.arrowState=arrowHover;this.that.animState=AnimationType.ARROW_ACTIVE;if(arrowHover===ArrowType.ARROW_TOP||arrowHover===ArrowType.ARROW_LEFT)this.that._arrowUpMouseDown();else if(arrowHover===ArrowType.ARROW_BOTTOM||arrowHover===ArrowType.ARROW_RIGHT)this.that._arrowDownMouseDown();this.that._draw()}else{this.that.mouseUp=false;if(this.that._MouseHoverOnScroller(mousePos)){this.that.scrollerMouseUp=false;this.that.scrollerMouseDown=true;if(this.that.onLockMouse)this.that.onLockMouse(evt); this.that.StartMousePosition.x=mousePos.x;this.that.StartMousePosition.y=mousePos.y;this.that.animState=AnimationType.SCROLL_ACTIVE;this.that._draw()}else{if(this.that.settings.isVerticalScroll){var _tmp=this,direction=mousePos.y-this.that.scroller.y-this.that.scroller.h/2,step=this.that.paneHeight*this.that.settings.scrollPagePercent,isFirst=true,doScroll=function(){_tmp.that.lock=true;if(direction>0)if(_tmp.that.scroller.y+_tmp.that.scroller.h/2+step<mousePos.y)_tmp.that.scrollByY(step*_tmp.that.scrollCoeff); else{var _step=Math.abs(_tmp.that.scroller.y+_tmp.that.scroller.h/2-mousePos.y);_tmp.that.scrollByY(_step*_tmp.that.scrollCoeff);cancelClick();return}else if(direction<0)if(_tmp.that.scroller.y+_tmp.that.scroller.h/2-step>mousePos.y)_tmp.that.scrollByY(-step*_tmp.that.scrollCoeff);else{var _step=Math.abs(_tmp.that.scroller.y+_tmp.that.scroller.h/2-mousePos.y);_tmp.that.scrollByY(-_step*_tmp.that.scrollCoeff);cancelClick();return}_tmp.that.scrollTimeout=setTimeout(doScroll,isFirst?_tmp.that.settings.initialDelay: _tmp.that.settings.trackClickRepeatFreq);isFirst=false},cancelClick=function(){_tmp.that.scrollTimeout&&clearTimeout(_tmp.that.scrollTimeout);_tmp.that.scrollTimeout=null;_tmp.that.unbind("mouseup.main",cancelClick);_tmp.that.lock=false};if(this.that.onLockMouse)this.that.onLockMouse(evt);doScroll();this.that.bind("mouseup.main",cancelClick)}if(this.that.settings.isHorizontalScroll){var _tmp=this,direction=mousePos.x-this.that.scroller.x-this.that.scroller.w/2,step=this.that.paneWidth*this.that.settings.scrollPagePercent, isFirst=true,doScroll=function(){_tmp.that.lock=true;if(direction>0)if(_tmp.that.scroller.x+_tmp.that.scroller.w/2+step<mousePos.x)_tmp.that.scrollByX(step*_tmp.that.scrollCoeff);else{var _step=Math.abs(_tmp.that.scroller.x+_tmp.that.scroller.w/2-mousePos.x);_tmp.that.scrollByX(_step*_tmp.that.scrollCoeff);cancelClick();return}else if(direction<0)if(_tmp.that.scroller.x+_tmp.that.scroller.w/2-step>mousePos.x)_tmp.that.scrollByX(-step*_tmp.that.scrollCoeff);else{var _step=Math.abs(_tmp.that.scroller.x+ _tmp.that.scroller.w/2-mousePos.x);_tmp.that.scrollByX(-_step*_tmp.that.scrollCoeff);cancelClick();return}_tmp.that.scrollTimeout=setTimeout(doScroll,isFirst?_tmp.that.settings.initialDelay:_tmp.that.settings.trackClickRepeatFreq);isFirst=false},cancelClick=function(){_tmp.that.scrollTimeout&&clearTimeout(_tmp.that.scrollTimeout);_tmp.that.scrollTimeout=null;_tmp.that.unbind("mouseup.main",cancelClick);_tmp.that.lock=false};if(this.that.onLockMouse)this.that.onLockMouse(evt);doScroll();this.that.bind("mouseup.main", cancelClick)}}}};ScrollObject.prototype.evt_mousewheel=function(e){var evt=e||window.event;var delta=1;if(this.that.settings.isHorizontalScroll)return;if(undefined!=evt.wheelDelta)delta=evt.wheelDelta>0?-this.that.settings.vscrollStep:this.that.settings.vscrollStep;else delta=evt.detail>0?this.that.settings.vscrollStep:-this.that.settings.vscrollStep;delta*=this.that.settings.wheelScrollLines;this.that.scroller.y+=delta;if(this.that.scroller.y<0)this.that.scroller.y=0;else if(this.that.scroller.y+ this.that.scroller.h>this.that.canvasH)this.that.scroller.y=this.that.canvasH-this.that.arrowPosition-this.that.scroller.h;this.that.scrollByY(delta)};ScrollObject.prototype.evt_click=function(e){var evt=e||window.event;var mousePos=this.that.getMousePosition(evt);if(this.that.settings.isHorizontalScroll)if(mousePos.x>this.arrowPosition&&mousePos.x<this.that.canvasW-this.that.arrowPosition){if(this.that.scroller.x>mousePos.x)this.that.scrollByX(-this.that.settings.vscrollStep);if(this.that.scroller.x< mousePos.x&&this.that.scroller.x+this.that.scroller.w>mousePos.x)return false;if(this.that.scroller.x+this.that.scroller.w<mousePos.x)this.that.scrollByX(this.that.settings.hscrollStep)}if(this.that.settings.isVerticalScroll)if(mousePos.y>this.that.arrowPosition&&mousePos.y<this.that.canvasH-this.that.arrowPosition){if(this.that.scroller.y>mousePos.y)this.that.scrollByY(-this.that.settings.vscrollStep);if(this.that.scroller.y<mousePos.y&&this.that.scroller.y+this.that.scroller.h>mousePos.y)return false; if(this.that.scroller.y+this.that.scroller.h<mousePos.y)this.that.scrollByY(this.that.settings.hscrollStep)}};ScrollObject.prototype.bind=function(typesStr,handler){var types=typesStr.split(" ");for(var n=0;n<types.length;n++){var type=types[n];var event=type.indexOf("touch")==-1?"on"+type:type;var parts=event.split(".");var baseEvent=parts[0];var name=parts.length>1?parts[1]:"";if(!this.eventListeners[baseEvent])this.eventListeners[baseEvent]=[];this.eventListeners[baseEvent].push({name:name,handler:handler})}}; ScrollObject.prototype.unbind=function(typesStr){var types=typesStr.split(" ");for(var n=0;n<types.length;n++){var type=types[n];var event=type.indexOf("touch")==-1?"on"+type:type;var parts=event.split(".");var baseEvent=parts[0];if(this.eventListeners[baseEvent]&&parts.length>1){var name=parts[1];for(var i=0;i<this.eventListeners[baseEvent].length;i++)if(this.eventListeners[baseEvent][i].name==name){this.eventListeners[baseEvent].splice(i,1);if(this.eventListeners[baseEvent].length===0)this.eventListeners[baseEvent]= undefined;break}}else this.eventListeners[baseEvent]=undefined}};ScrollObject.prototype.handleEvents=function(eventType,evt,p){var that=this;function handle(obj){var el=obj.eventListeners;if(el[eventType]){var events=el[eventType];for(var i=0;i<events.length;i++)events[i].handler.apply(obj,[evt])}}handle(that)};ScrollObject.prototype._roundForScale=function(value){return value-Math.floor(value)<=.5?Math.floor(value):Math.round(value)};window["AscCommon"].ScrollSettings=ScrollSettings;window["AscCommon"].ScrollObject= ScrollObject})(window);(function(window,document,Math){var rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1E3/60)};var utils=function(){var me={};var _elementStyle=document.createElement("div").style;var _vendor=function(){var vendors=["t","webkitT","MozT","msT","OT"],transform,i=0,l=vendors.length;for(;i<l;i++){transform=vendors[i]+"ransform"; if(transform in _elementStyle)return vendors[i].substr(0,vendors[i].length-1)}return false}();function _prefixStyle(style){if(_vendor===false)return false;if(_vendor==="")return style;return _vendor+style.charAt(0).toUpperCase()+style.substr(1)}me.getTime=Date.now||function getTime(){return(new Date).getTime()};me.extend=function(target,obj){for(var i in obj)target[i]=obj[i]};me.addEvent=function(el,type,fn,capture){el.addEventListener(type,fn,!!capture)};me.removeEvent=function(el,type,fn,capture){el.removeEventListener(type, fn,!!capture)};me.prefixPointerEvent=function(pointerEvent){return window.MSPointerEvent?"MSPointer"+pointerEvent.charAt(7).toUpperCase()+pointerEvent.substr(8):pointerEvent};me.momentum=function(current,start,time,lowerMargin,wrapperSize,deceleration){var distance=current-start,speed=Math.abs(distance)/time,destination,duration;deceleration=deceleration===undefined?6E-4:deceleration;destination=current+speed*speed/(2*deceleration)*(distance<0?-1:1);duration=speed/deceleration;if(destination<lowerMargin){destination= wrapperSize?lowerMargin-wrapperSize/2.5*(speed/8):lowerMargin;distance=Math.abs(destination-current);duration=distance/speed}else if(destination>0){destination=wrapperSize?wrapperSize/2.5*(speed/8):0;distance=Math.abs(current)+destination;duration=distance/speed}return{destination:Math.round(destination),duration:duration}};var _transform=_prefixStyle("transform");var _hasPointer=AscCommon.AscBrowser.isIE?!("ontouchstart"in window)&&!!(window.PointerEvent||window.MSPointerEvent):false;if(AscCommon.AscBrowser.isAppleDevices&& AscCommon.AscBrowser.iosVersion>=13)_hasPointer=true;me.extend(me,{hasTransform:_transform!==false,hasPerspective:_prefixStyle("perspective")in _elementStyle,hasTouch:"ontouchstart"in window,hasPointer:_hasPointer,hasTransition:_prefixStyle("transition")in _elementStyle});me.isBadAndroid=function(){var appVersion=window.navigator.appVersion;if(/Android/.test(appVersion)&&!/Chrome\/\d/.test(appVersion)){var safariVersion=appVersion.match(/Safari\/(\d+.\d)/);if(safariVersion&&typeof safariVersion=== "object"&&safariVersion.length>=2)return parseFloat(safariVersion[1])<535.19;else return true}else return false}();me.extend(me.style={},{transform:_transform,transitionTimingFunction:_prefixStyle("transitionTimingFunction"),transitionDuration:_prefixStyle("transitionDuration"),transitionDelay:_prefixStyle("transitionDelay"),transformOrigin:_prefixStyle("transformOrigin")});me.hasClass=function(e,c){var re=new RegExp("(^|\\s)"+c+"(\\s|$)");return re.test(e.className)};me.addClass=function(e,c){if(me.hasClass(e, c))return;var newclass=e.className.split(" ");newclass.push(c);e.className=newclass.join(" ")};me.removeClass=function(e,c){if(!me.hasClass(e,c))return;var re=new RegExp("(^|\\s)"+c+"(\\s|$)","g");e.className=e.className.replace(re," ")};me.offset=function(el){var left=-el.offsetLeft,top=-el.offsetTop;while(el=el.offsetParent){left-=el.offsetLeft;top-=el.offsetTop}return{left:left,top:top}};me.preventDefaultException=function(el,exceptions){for(var i in exceptions)if(exceptions[i].test(el[i]))return true; return false};me.extend(me.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,pointerdown:3,pointermove:3,pointerup:3,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3});me.extend(me.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(k){return k*(2-k)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(k){return Math.sqrt(1- --k*k)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(k){var b=4;return(k=k-1)*k*((b+1)* k+b)+1}},bounce:{style:"",fn:function(k){if((k/=1)<1/2.75)return 7.5625*k*k;else if(k<2/2.75)return 7.5625*(k-=1.5/2.75)*k+.75;else if(k<2.5/2.75)return 7.5625*(k-=2.25/2.75)*k+.9375;else return 7.5625*(k-=2.625/2.75)*k+.984375}},elastic:{style:"",fn:function(k){var f=.22,e=.4;if(k===0)return 0;if(k==1)return 1;return e*Math.pow(2,-10*k)*Math.sin((k-f/4)*(2*Math.PI)/f)+1}}});me.tap=function(e,eventName){var ev=document.createEvent("Event");ev.initEvent(eventName,true,true);ev.pageX=e.pageX;ev.pageY= e.pageY;e.target.dispatchEvent(ev)};me.click=function(e){var target=e.target,ev;if(!/(SELECT|INPUT|TEXTAREA)/i.test(target.tagName)){ev=document.createEvent(window.MouseEvent?"MouseEvents":"Event");ev.initEvent("click",true,true);ev.view=e.view||window;ev.detail=1;ev.screenX=target.screenX||0;ev.screenY=target.screenY||0;ev.clientX=target.clientX||0;ev.clientY=target.clientY||0;ev.ctrlKey=!!e.ctrlKey;ev.altKey=!!e.altKey;ev.shiftKey=!!e.shiftKey;ev.metaKey=!!e.metaKey;ev.button=0;ev.relatedTarget= null;ev._constructed=true;target.dispatchEvent(ev)}};return me}();function IScroll(el,options){this.wrapper=typeof el=="string"?document.querySelector(el):el;this.scroller=typeof options.scroller_id=="string"?document.getElementById(options.scroller_id):this.wrapper.children[0];this.scrollerStyle=this.scroller.style;this.eventsElement=options.eventsElement;this.options={resizeScrollbars:true,mouseWheelSpeed:20,snapThreshold:.334,disablePointer:!utils.hasPointer,disableTouch:utils.hasPointer||!utils.hasTouch, disableMouse:utils.hasPointer||utils.hasTouch,startX:0,startY:0,scrollY:true,directionLockThreshold:5,momentum:true,bounce:true,bounceTime:600,bounceEasing:"",preventDefault:true,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:true,useTransition:true,useTransform:true,bindToWrapper:typeof window.onmousedown==="undefined"};for(var i in options)this.options[i]=options[i];this.translateZ=this.options.HWCompositing&&utils.hasPerspective?" translateZ(0)":"";this.options.useTransition= utils.hasTransition&&this.options.useTransition;this.options.useTransform=utils.hasTransform&&this.options.useTransform;this.options.eventPassthrough=this.options.eventPassthrough===true?"vertical":this.options.eventPassthrough;this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault;this.options.scrollY=this.options.eventPassthrough=="vertical"?false:this.options.scrollY;this.options.scrollX=this.options.eventPassthrough=="horizontal"?false:this.options.scrollX;this.options.freeScroll= this.options.freeScroll&&!this.options.eventPassthrough;this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold;this.options.bounceEasing=typeof this.options.bounceEasing=="string"?utils.ease[this.options.bounceEasing]||utils.ease.circular:this.options.bounceEasing;this.options.resizePolling=this.options.resizePolling===undefined?60:this.options.resizePolling;if(this.options.tap===true)this.options.tap="tap";if(!this.options.useTransition&&!this.options.useTransform)if(!/relative|absolute/i.test(this.scrollerStyle.position))this.scrollerStyle.position= "relative";if(this.options.shrinkScrollbars=="scale")this.options.useTransition=false;this.options.invertWheelDirection=this.options.invertWheelDirection?-1:1;this.x=0;this.y=0;this.directionX=0;this.directionY=0;this._events={};this._init();this.refresh();this.scrollTo(this.options.startX,this.options.startY);this.enable();this.isDown=false}IScroll.prototype={version:"5.2.0",_init:function(){this._initEvents();if(this.options.scrollbars||this.options.indicators)this._initIndicators();if(this.options.mouseWheel)this._initWheel(); if(this.options.snap)this._initSnap();if(this.options.keyBindings)this._initKeys()},destroy:function(){this._initEvents(true);clearTimeout(this.resizeTimeout);this.resizeTimeout=null;this._execEvent("destroy")},_transitionEnd:function(e){if(e.target!=this.scroller||!this.isInTransition)return;this._transitionTime();if(!this.resetPosition(this.options.bounceTime)){this.isInTransition=false;this._execEvent("scrollEnd")}},_start:function(e){if(utils.eventType[e.type]!=1){var button;if(!e.which)button= e.button<2?0:e.button==4?1:2;else button=e.button;if(button!==0)return}if(!this.enabled||this.initiated&&utils.eventType[e.type]!==this.initiated)return;if(this.options.preventDefault&&!utils.isBadAndroid&&!utils.preventDefaultException(e.target,this.options.preventDefaultException))e.preventDefault();var point=e.touches?e.touches[0]:e,pos;this.initiated=utils.eventType[e.type];this.moved=false;this.distX=0;this.distY=0;this.directionX=0;this.directionY=0;this.directionLocked=0;this.startTime=utils.getTime(); if(this.options.useTransition&&this.isInTransition){this._transitionTime();this.isInTransition=false;pos=this.getComputedPosition();this._translate(Math.round(pos.x),Math.round(pos.y));this._execEvent("scrollEnd")}else if(!this.options.useTransition&&this.isAnimating){this.isAnimating=false;this._execEvent("scrollEnd")}this.startX=this.x;this.startY=this.y;this.absStartX=this.x;this.absStartY=this.y;this.pointX=point.pageX;this.pointY=point.pageY;this._execEvent("beforeScrollStart")},_move:function(e){if(!this.enabled|| utils.eventType[e.type]!==this.initiated)return;if(this.options.preventDefault)e.preventDefault();var point=e.touches?e.touches[0]:e,deltaX=point.pageX-this.pointX,deltaY=point.pageY-this.pointY,timestamp=utils.getTime(),newX,newY,absDistX,absDistY;this.pointX=point.pageX;this.pointY=point.pageY;this.distX+=deltaX;this.distY+=deltaY;absDistX=Math.abs(this.distX);absDistY=Math.abs(this.distY);if(timestamp-this.endTime>300&&(absDistX<10&&absDistY<10))return;if(!this.directionLocked&&!this.options.freeScroll)if(absDistX> absDistY+this.options.directionLockThreshold)this.directionLocked="h";else if(absDistY>=absDistX+this.options.directionLockThreshold)this.directionLocked="v";else this.directionLocked="n";if(this.directionLocked=="h"){if(this.options.eventPassthrough=="vertical")e.preventDefault();else if(this.options.eventPassthrough=="horizontal"){this.initiated=false;return}deltaY=0}else if(this.directionLocked=="v"){if(this.options.eventPassthrough=="horizontal")e.preventDefault();else if(this.options.eventPassthrough== "vertical"){this.initiated=false;return}deltaX=0}deltaX=this.hasHorizontalScroll?deltaX:0;deltaY=this.hasVerticalScroll?deltaY:0;newX=this.x+deltaX;newY=this.y+deltaY;if(newX>0||newX<this.maxScrollX)newX=this.options.bounce?this.x+deltaX/3:newX>0?0:this.maxScrollX;if(newY>0||newY<this.maxScrollY)newY=this.options.bounce?this.y+deltaY/3:newY>0?0:this.maxScrollY;this.directionX=deltaX>0?-1:deltaX<0?1:0;this.directionY=deltaY>0?-1:deltaY<0?1:0;if(!this.moved)this._execEvent("scrollStart");this.moved= true;this._translate(newX,newY);if(timestamp-this.startTime>300){this.startTime=timestamp;this.startX=this.x;this.startY=this.y}this._execEvent("scroll")},_end:function(e){if(!this.enabled||utils.eventType[e.type]!==this.initiated)return;if(this.options.preventDefault&&!utils.preventDefaultException(e.target,this.options.preventDefaultException))e.preventDefault();var point=e.changedTouches?e.changedTouches[0]:e,momentumX,momentumY,duration=utils.getTime()-this.startTime,newX=Math.round(this.x),newY= Math.round(this.y),distanceX=Math.abs(newX-this.startX),distanceY=Math.abs(newY-this.startY),time=0,easing="";this.isInTransition=0;this.initiated=0;this.endTime=utils.getTime();if(this.resetPosition(this.options.bounceTime))return;this.scrollTo(newX,newY);if(!this.moved){if(this.options.tap)utils.tap(e,this.options.tap);if(this.options.click)utils.click(e);this._execEvent("scrollCancel");return}if(this._events.flick&&duration<200&&distanceX<100&&distanceY<100){this._execEvent("flick");return}if(this.options.momentum&& duration<300){momentumX=this.hasHorizontalScroll?utils.momentum(this.x,this.startX,duration,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:newX,duration:0};momentumY=this.hasVerticalScroll?utils.momentum(this.y,this.startY,duration,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:newY,duration:0};newX=momentumX.destination;newY=momentumY.destination;time=Math.max(momentumX.duration,momentumY.duration); this.isInTransition=1}if(this.options.snap){var snap=this._nearestSnap(newX,newY);this.currentPage=snap;time=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(newX-snap.x),1E3),Math.min(Math.abs(newY-snap.y),1E3)),300);newX=snap.x;newY=snap.y;this.directionX=0;this.directionY=0;easing=this.options.bounceEasing}if(newX!=this.x||newY!=this.y){if(newX>0||newX<this.maxScrollX||newY>0||newY<this.maxScrollY)easing=utils.ease.quadratic;this.scrollTo(newX,newY,time,easing);return}this._execEvent("scrollEnd")}, _resize:function(){var that=this;clearTimeout(this.resizeTimeout);this.resizeTimeout=setTimeout(function(){that.refresh()},this.options.resizePolling)},resetPosition:function(time){var x=this.x,y=this.y;time=time||0;if(!this.hasHorizontalScroll||this.x>0)x=0;else if(this.x<this.maxScrollX)x=this.maxScrollX;if(!this.hasVerticalScroll||this.y>0)y=0;else if(this.y<this.maxScrollY)y=this.maxScrollY;if(x==this.x&&y==this.y)return false;this.scrollTo(x,y,time,this.options.bounceEasing);return true},disable:function(){this.enabled= false},enable:function(){this.enabled=true},refresh:function(_position){var rf=this.wrapper.offsetHeight;this.wrapperWidth=this.wrapper.clientWidth;this.wrapperHeight=this.wrapper.clientHeight;this.scrollerWidth=this.scroller.offsetWidth;this.scrollerHeight=this.scroller.offsetHeight;this.maxScrollX=this.wrapperWidth-this.scrollerWidth;this.maxScrollY=this.wrapperHeight-this.scrollerHeight;this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<0;this.hasVerticalScroll=this.options.scrollY&& this.maxScrollY<0;if(!this.hasHorizontalScroll){this.maxScrollX=0;this.scrollerWidth=this.wrapperWidth}if(!this.hasVerticalScroll){this.maxScrollY=0;this.scrollerHeight=this.wrapperHeight}this.endTime=0;this.directionX=0;this.directionY=0;this.wrapperOffset=utils.offset(this.wrapper);this._execEvent("refresh");if(_position){this.x=_position.X;this.y=_position.Y}this.resetPosition()},on:function(type,fn){if(!this._events[type])this._events[type]=[];this._events[type].push(fn)},off:function(type,fn){if(!this._events[type])return; var index=this._events[type].indexOf(fn);if(index>-1)this._events[type].splice(index,1)},_execEvent:function(type){if(!this._events[type])return;var i=0,l=this._events[type].length;if(!l)return;for(;i<l;i++)this._events[type][i].apply(this,[].slice.call(arguments,1))},scrollBy:function(x,y,time,easing){x=this.x+x;y=this.y+y;time=time||0;this.scrollTo(x,y,time,easing)},scrollTo:function(x,y,time,easing){easing=easing||utils.ease.circular;this.isInTransition=this.options.useTransition&&time>0;var transitionType= this.options.useTransition&&easing.style;if(!time||transitionType){if(transitionType){this._transitionTimingFunction(easing.style);this._transitionTime(time)}this._translate(x,y)}else this._animate(x,y,time,easing.fn)},scrollToElement:function(el,time,offsetX,offsetY,easing){el=el.nodeType?el:this.scroller.querySelector(el);if(!el)return;var pos=utils.offset(el);pos.left-=this.wrapperOffset.left;pos.top-=this.wrapperOffset.top;if(offsetX===true)offsetX=Math.round(el.offsetWidth/2-this.wrapper.offsetWidth/ 2);if(offsetY===true)offsetY=Math.round(el.offsetHeight/2-this.wrapper.offsetHeight/2);pos.left-=offsetX||0;pos.top-=offsetY||0;pos.left=pos.left>0?0:pos.left<this.maxScrollX?this.maxScrollX:pos.left;pos.top=pos.top>0?0:pos.top<this.maxScrollY?this.maxScrollY:pos.top;time=time===undefined||time===null||time==="auto"?Math.max(Math.abs(this.x-pos.left),Math.abs(this.y-pos.top)):time;this.scrollTo(pos.left,pos.top,time,easing)},_transitionTime:function(time){if(!this.options.useTransition)return;time= time||0;var durationProp=utils.style.transitionDuration;if(!durationProp)return;this.scrollerStyle[durationProp]=time+"ms";if(!time&&utils.isBadAndroid){this.scrollerStyle[durationProp]="0.0001ms";var self=this;rAF(function(){if(self.scrollerStyle[durationProp]==="0.0001ms")self.scrollerStyle[durationProp]="0s"})}if(this.indicators)for(var i=this.indicators.length;i--;)this.indicators[i].transitionTime(time)},_transitionTimingFunction:function(easing){this.scrollerStyle[utils.style.transitionTimingFunction]= easing;if(this.indicators)for(var i=this.indicators.length;i--;)this.indicators[i].transitionTimingFunction(easing)},_translate:function(x,y){if(this.options.useTransform)this.scrollerStyle[utils.style.transform]="translate("+x+"px,"+y+"px)"+this.translateZ;else{x=Math.round(x);y=Math.round(y);this.scrollerStyle.left=x+"px";this.scrollerStyle.top=y+"px"}this.x=x;this.y=y;if(this.indicators)for(var i=this.indicators.length;i--;)this.indicators[i].updatePosition()},_initEvents:function(remove){if(typeof this.eventsElement== "string"){var _element=document.getElementById(this.eventsElement);if(!_element)return;this.eventsElement=_element}var eventType=remove?utils.removeEvent:utils.addEvent,target=this.options.bindToWrapper?this.eventsElement?this.eventsElement:this.wrapper:window;var _wrapper=this.eventsElement?this.eventsElement:this.wrapper;if(this.options.resizeDetect){eventType(window,"orientationchange",this);eventType(window,"resize",this)}if(this.options.click)eventType(_wrapper,"click",this,true);if(!this.options.disableMouse){eventType(_wrapper, "mousedown",this);eventType(target,"mousemove",this);eventType(target,"mousecancel",this);eventType(target,"mouseup",this)}if(utils.hasPointer&&!this.options.disablePointer){eventType(_wrapper,utils.prefixPointerEvent("pointerdown"),this);eventType(target,utils.prefixPointerEvent("pointermove"),this);eventType(target,utils.prefixPointerEvent("pointercancel"),this);eventType(target,utils.prefixPointerEvent("pointerup"),this)}if(utils.hasTouch&&!this.options.disableTouch){eventType(_wrapper,"touchstart", this);eventType(target,"touchmove",this);eventType(target,"touchcancel",this);eventType(target,"touchend",this)}eventType(this.scroller,"transitionend",this);eventType(this.scroller,"webkitTransitionEnd",this);eventType(this.scroller,"oTransitionEnd",this);eventType(this.scroller,"MSTransitionEnd",this)},getComputedPosition:function(){var matrix=window.getComputedStyle(this.scroller,null),x,y;if(this.options.useTransform){matrix=matrix[utils.style.transform].split(")")[0].split(", ");x=+(matrix[12]|| matrix[4]);y=+(matrix[13]||matrix[5])}else{x=+matrix.left.replace(/[^-\d.]/g,"");y=+matrix.top.replace(/[^-\d.]/g,"")}return{x:x,y:y}},_initIndicators:function(){var interactive=this.options.interactiveScrollbars,customStyle=typeof this.options.scrollbars!="string",indicators=[],indicator;var that=this;this.indicators=[];if(this.options.scrollbars){if(this.options.scrollY){indicator={el:createDefaultScrollbar("v",interactive,this.options.scrollbars),interactive:interactive,defaultScrollbars:true, customStyle:customStyle,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenX:false};this.wrapper.appendChild(indicator.el);indicators.push(indicator)}if(this.options.scrollX){indicator={el:createDefaultScrollbar("h",interactive,this.options.scrollbars),interactive:interactive,defaultScrollbars:true,customStyle:customStyle,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenY:false}; this.wrapper.appendChild(indicator.el);indicators.push(indicator)}}if(this.options.indicators)indicators=indicators.concat(this.options.indicators);for(var i=indicators.length;i--;)this.indicators.push(new Indicator(this,indicators[i]));function _indicatorsMap(fn){if(that.indicators)for(var i=that.indicators.length;i--;)fn.call(that.indicators[i])}if(this.options.fadeScrollbars){this.on("scrollEnd",function(){_indicatorsMap(function(){this.fade()})});this.on("scrollCancel",function(){_indicatorsMap(function(){this.fade()})}); this.on("scrollStart",function(){_indicatorsMap(function(){this.fade(1)})});this.on("beforeScrollStart",function(){_indicatorsMap(function(){this.fade(1,true)})})}this.on("refresh",function(){_indicatorsMap(function(){this.refresh()})});this.on("destroy",function(){_indicatorsMap(function(){this.destroy()});delete this.indicators})},_initWheel:function(){utils.addEvent(this.wrapper,"wheel",this);utils.addEvent(this.wrapper,"mousewheel",this);utils.addEvent(this.wrapper,"DOMMouseScroll",this);this.on("destroy", function(){clearTimeout(this.wheelTimeout);this.wheelTimeout=null;utils.removeEvent(this.wrapper,"wheel",this);utils.removeEvent(this.wrapper,"mousewheel",this);utils.removeEvent(this.wrapper,"DOMMouseScroll",this)})},_wheel:function(e){if(!this.enabled)return;e.preventDefault();var wheelDeltaX,wheelDeltaY,newX,newY,that=this;if(this.wheelTimeout===undefined)that._execEvent("scrollStart");clearTimeout(this.wheelTimeout);this.wheelTimeout=setTimeout(function(){if(!that.options.snap)that._execEvent("scrollEnd"); that.wheelTimeout=undefined},400);if("deltaX"in e)if(e.deltaMode===1){wheelDeltaX=-e.deltaX*this.options.mouseWheelSpeed;wheelDeltaY=-e.deltaY*this.options.mouseWheelSpeed}else{wheelDeltaX=-e.deltaX;wheelDeltaY=-e.deltaY}else if("wheelDeltaX"in e){wheelDeltaX=e.wheelDeltaX/120*this.options.mouseWheelSpeed;wheelDeltaY=e.wheelDeltaY/120*this.options.mouseWheelSpeed}else if("wheelDelta"in e)wheelDeltaX=wheelDeltaY=e.wheelDelta/120*this.options.mouseWheelSpeed;else if("detail"in e)wheelDeltaX=wheelDeltaY= -e.detail/3*this.options.mouseWheelSpeed;else return;wheelDeltaX*=this.options.invertWheelDirection;wheelDeltaY*=this.options.invertWheelDirection;if(!this.hasVerticalScroll){wheelDeltaX=wheelDeltaY;wheelDeltaY=0}if(this.options.snap){newX=this.currentPage.pageX;newY=this.currentPage.pageY;if(wheelDeltaX>0)newX--;else if(wheelDeltaX<0)newX++;if(wheelDeltaY>0)newY--;else if(wheelDeltaY<0)newY++;this.goToPage(newX,newY);return}newX=this.x+Math.round(this.hasHorizontalScroll?wheelDeltaX:0);newY=this.y+ Math.round(this.hasVerticalScroll?wheelDeltaY:0);this.directionX=wheelDeltaX>0?-1:wheelDeltaX<0?1:0;this.directionY=wheelDeltaY>0?-1:wheelDeltaY<0?1:0;if(newX>0)newX=0;else if(newX<this.maxScrollX)newX=this.maxScrollX;if(newY>0)newY=0;else if(newY<this.maxScrollY)newY=this.maxScrollY;this.scrollTo(newX,newY,0);this._execEvent("scroll")},_initSnap:function(){this.currentPage={};if(typeof this.options.snap=="string")this.options.snap=this.scroller.querySelectorAll(this.options.snap);this.on("refresh", function(){var i=0,l,m=0,n,cx,cy,x=0,y,stepX=this.options.snapStepX||this.wrapperWidth,stepY=this.options.snapStepY||this.wrapperHeight,el;this.pages=[];if(!this.wrapperWidth||!this.wrapperHeight||!this.scrollerWidth||!this.scrollerHeight)return;if(this.options.snap===true){cx=Math.round(stepX/2);cy=Math.round(stepY/2);while(x>-this.scrollerWidth){this.pages[i]=[];l=0;y=0;while(y>-this.scrollerHeight){this.pages[i][l]={x:Math.max(x,this.maxScrollX),y:Math.max(y,this.maxScrollY),width:stepX,height:stepY, cx:x-cx,cy:y-cy};y-=stepY;l++}x-=stepX;i++}}else{el=this.options.snap;l=el.length;n=-1;for(;i<l;i++){if(i===0||el[i].offsetLeft<=el[i-1].offsetLeft){m=0;n++}if(!this.pages[m])this.pages[m]=[];x=Math.max(-el[i].offsetLeft,this.maxScrollX);y=Math.max(-el[i].offsetTop,this.maxScrollY);cx=x-Math.round(el[i].offsetWidth/2);cy=y-Math.round(el[i].offsetHeight/2);this.pages[m][n]={x:x,y:y,width:el[i].offsetWidth,height:el[i].offsetHeight,cx:cx,cy:cy};if(x>this.maxScrollX)m++}}this.goToPage(this.currentPage.pageX|| 0,this.currentPage.pageY||0,0);if(this.options.snapThreshold%1===0){this.snapThresholdX=this.options.snapThreshold;this.snapThresholdY=this.options.snapThreshold}else{this.snapThresholdX=Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold);this.snapThresholdY=Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold)}});this.on("flick",function(){var time=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(this.x- this.startX),1E3),Math.min(Math.abs(this.y-this.startY),1E3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,time)})},_nearestSnap:function(x,y){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var i=0,l=this.pages.length,m=0;if(Math.abs(x-this.absStartX)<this.snapThresholdX&&Math.abs(y-this.absStartY)<this.snapThresholdY)return this.currentPage;if(x>0)x=0;else if(x<this.maxScrollX)x=this.maxScrollX;if(y>0)y=0;else if(y<this.maxScrollY)y=this.maxScrollY; for(;i<l;i++)if(x>=this.pages[i][0].cx){x=this.pages[i][0].x;break}l=this.pages[i].length;for(;m<l;m++)if(y>=this.pages[0][m].cy){y=this.pages[0][m].y;break}if(i==this.currentPage.pageX){i+=this.directionX;if(i<0)i=0;else if(i>=this.pages.length)i=this.pages.length-1;x=this.pages[i][0].x}if(m==this.currentPage.pageY){m+=this.directionY;if(m<0)m=0;else if(m>=this.pages[0].length)m=this.pages[0].length-1;y=this.pages[0][m].y}return{x:x,y:y,pageX:i,pageY:m}},goToPage:function(x,y,time,easing){easing= easing||this.options.bounceEasing;if(x>=this.pages.length)x=this.pages.length-1;else if(x<0)x=0;if(y>=this.pages[x].length)y=this.pages[x].length-1;else if(y<0)y=0;var posX=this.pages[x][y].x,posY=this.pages[x][y].y;time=time===undefined?this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(posX-this.x),1E3),Math.min(Math.abs(posY-this.y),1E3)),300):time;this.currentPage={x:posX,y:posY,pageX:x,pageY:y};this.scrollTo(posX,posY,time,easing)},next:function(time,easing){var x=this.currentPage.pageX, y=this.currentPage.pageY;x++;if(x>=this.pages.length&&this.hasVerticalScroll){x=0;y++}this.goToPage(x,y,time,easing)},prev:function(time,easing){var x=this.currentPage.pageX,y=this.currentPage.pageY;x--;if(x<0&&this.hasVerticalScroll){x=0;y--}this.goToPage(x,y,time,easing)},_initKeys:function(e){var keys={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};var i;if(typeof this.options.keyBindings=="object")for(i in this.options.keyBindings){if(typeof this.options.keyBindings[i]== "string")this.options.keyBindings[i]=this.options.keyBindings[i].toUpperCase().charCodeAt(0)}else this.options.keyBindings={};for(i in keys)this.options.keyBindings[i]=this.options.keyBindings[i]||keys[i];utils.addEvent(window,"keydown",this);this.on("destroy",function(){utils.removeEvent(window,"keydown",this)})},_key:function(e){if(!this.enabled)return;var snap=this.options.snap,newX=snap?this.currentPage.pageX:this.x,newY=snap?this.currentPage.pageY:this.y,now=utils.getTime(),prevTime=this.keyTime|| 0,acceleration=.25,pos;if(this.options.useTransition&&this.isInTransition){pos=this.getComputedPosition();this._translate(Math.round(pos.x),Math.round(pos.y));this.isInTransition=false}this.keyAcceleration=now-prevTime<200?Math.min(this.keyAcceleration+acceleration,50):0;switch(e.keyCode){case this.options.keyBindings.pageUp:if(this.hasHorizontalScroll&&!this.hasVerticalScroll)newX+=snap?1:this.wrapperWidth;else newY+=snap?1:this.wrapperHeight;break;case this.options.keyBindings.pageDown:if(this.hasHorizontalScroll&& !this.hasVerticalScroll)newX-=snap?1:this.wrapperWidth;else newY-=snap?1:this.wrapperHeight;break;case this.options.keyBindings.end:newX=snap?this.pages.length-1:this.maxScrollX;newY=snap?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:newX=0;newY=0;break;case this.options.keyBindings.left:newX+=snap?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.up:newY+=snap?1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.right:newX-=snap?-1:5+this.keyAcceleration>> 0;break;case this.options.keyBindings.down:newY-=snap?1:5+this.keyAcceleration>>0;break;default:return}if(snap){this.goToPage(newX,newY);return}if(newX>0){newX=0;this.keyAcceleration=0}else if(newX<this.maxScrollX){newX=this.maxScrollX;this.keyAcceleration=0}if(newY>0){newY=0;this.keyAcceleration=0}else if(newY<this.maxScrollY){newY=this.maxScrollY;this.keyAcceleration=0}this.scrollTo(newX,newY,0);this.keyTime=now},_animate:function(destX,destY,duration,easingFn){var that=this,startX=this.x,startY= this.y,startTime=utils.getTime(),destTime=startTime+duration;function step(){var now=utils.getTime(),newX,newY,easing;if(now>=destTime){that.isAnimating=false;that._translate(destX,destY);if(!that.resetPosition(that.options.bounceTime))that._execEvent("scrollEnd");return}now=(now-startTime)/duration;easing=easingFn(now);newX=(destX-startX)*easing+startX;newY=(destY-startY)*easing+startY;that._translate(newX,newY);if(that.isAnimating)rAF(step);that._execEvent("scroll")}this.isAnimating=true;step()}, handleEvent:function(e){switch(e.type){case "touchstart":case "pointerdown":case "MSPointerDown":case "mousedown":this.isDown=true;this.eventsElement?this.manager.mainOnTouchStart(e):this._start(e);break;case "touchmove":case "pointermove":case "MSPointerMove":case "mousemove":if(this.isDown||e.srcElement==this.eventsElement)this.eventsElement?this.manager.mainOnTouchMove(e):e;break;case "touchend":case "pointerup":case "MSPointerUp":case "mouseup":case "touchcancel":case "pointercancel":case "MSPointerCancel":case "mousecancel":if(this.isDown|| e.srcElement==this.eventsElement)this.eventsElement?this.manager.mainOnTouchEnd(e):this._end(e);this.isDown=false;break;case "orientationchange":case "resize":this._resize();break;case "transitionend":case "webkitTransitionEnd":case "oTransitionEnd":case "MSTransitionEnd":this._transitionEnd(e);break;case "wheel":case "DOMMouseScroll":case "mousewheel":this._wheel(e);break;case "keydown":this._key(e);break;case "click":if(this.enabled&&!e._constructed){e.preventDefault();e.stopPropagation()}break}}}; function createDefaultScrollbar(direction,interactive,type){var scrollbar=document.createElement("div"),indicator=document.createElement("div");if(type===true){scrollbar.style.cssText="position:absolute;z-index:9999";indicator.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px"}indicator.className="iScrollIndicator";if(direction=="h"){if(type===true){scrollbar.style.cssText+= ";height:7px;left:2px;right:2px;bottom:0";indicator.style.height="100%"}scrollbar.className="iScrollHorizontalScrollbar"}else{if(type===true){scrollbar.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px";indicator.style.width="100%"}scrollbar.className="iScrollVerticalScrollbar"}scrollbar.style.cssText+=";overflow:hidden";if(!interactive)scrollbar.style.pointerEvents="none";scrollbar.appendChild(indicator);return scrollbar}function Indicator(scroller,options){this.wrapper=typeof options.el== "string"?document.querySelector(options.el):options.el;this.wrapperStyle=this.wrapper.style;this.indicator=this.wrapper.children[0];this.indicatorStyle=this.indicator.style;this.scroller=scroller;this.options={listenX:true,listenY:true,interactive:false,resize:true,defaultScrollbars:false,shrink:false,fade:false,speedRatioX:0,speedRatioY:0};for(var i in options)this.options[i]=options[i];this.sizeRatioX=1;this.sizeRatioY=1;this.maxPosX=0;this.maxPosY=0;if(this.options.interactive){if(!this.options.disableTouch){utils.addEvent(this.indicator, "touchstart",this);utils.addEvent(window,"touchend",this)}if(!this.options.disablePointer){utils.addEvent(this.indicator,utils.prefixPointerEvent("pointerdown"),this);utils.addEvent(window,utils.prefixPointerEvent("pointerup"),this)}if(!this.options.disableMouse){utils.addEvent(this.indicator,"mousedown",this);utils.addEvent(window,"mouseup",this)}}if(this.options.fade){this.wrapperStyle[utils.style.transform]=this.scroller.translateZ;var durationProp=utils.style.transitionDuration;if(!durationProp)return; this.wrapperStyle[durationProp]=utils.isBadAndroid?"0.0001ms":"0ms";var self=this;if(utils.isBadAndroid)rAF(function(){if(self.wrapperStyle[durationProp]==="0.0001ms")self.wrapperStyle[durationProp]="0s"});this.wrapperStyle.opacity="0"}}Indicator.prototype={handleEvent:function(e){switch(e.type){case "touchstart":case "pointerdown":case "MSPointerDown":case "mousedown":this._start(e);break;case "touchmove":case "pointermove":case "MSPointerMove":case "mousemove":this._move(e);break;case "touchend":case "pointerup":case "MSPointerUp":case "mouseup":case "touchcancel":case "pointercancel":case "MSPointerCancel":case "mousecancel":this._end(e); break}},destroy:function(){if(this.options.fadeScrollbars){clearTimeout(this.fadeTimeout);this.fadeTimeout=null}if(this.options.interactive){utils.removeEvent(this.indicator,"touchstart",this);utils.removeEvent(this.indicator,utils.prefixPointerEvent("pointerdown"),this);utils.removeEvent(this.indicator,"mousedown",this);utils.removeEvent(window,"touchmove",this);utils.removeEvent(window,utils.prefixPointerEvent("pointermove"),this);utils.removeEvent(window,"mousemove",this);utils.removeEvent(window, "touchend",this);utils.removeEvent(window,utils.prefixPointerEvent("pointerup"),this);utils.removeEvent(window,"mouseup",this)}if(this.options.defaultScrollbars)this.wrapper.parentNode.removeChild(this.wrapper)},_start:function(e){var point=e.touches?e.touches[0]:e;e.preventDefault();e.stopPropagation();this.transitionTime();this.initiated=true;this.moved=false;this.lastPointX=point.pageX;this.lastPointY=point.pageY;this.startTime=utils.getTime();if(!this.options.disableTouch)utils.addEvent(window, "touchmove",this);if(!this.options.disablePointer)utils.addEvent(window,utils.prefixPointerEvent("pointermove"),this);if(!this.options.disableMouse)utils.addEvent(window,"mousemove",this);this.scroller._execEvent("beforeScrollStart")},_move:function(e){var point=e.touches?e.touches[0]:e,deltaX,deltaY,newX,newY,timestamp=utils.getTime();if(!this.moved)this.scroller._execEvent("scrollStart");this.moved=true;deltaX=point.pageX-this.lastPointX;this.lastPointX=point.pageX;deltaY=point.pageY-this.lastPointY; this.lastPointY=point.pageY;newX=this.x+deltaX;newY=this.y+deltaY;this._pos(newX,newY);e.preventDefault();e.stopPropagation()},_end:function(e){if(!this.initiated)return;this.initiated=false;e.preventDefault();e.stopPropagation();utils.removeEvent(window,"touchmove",this);utils.removeEvent(window,utils.prefixPointerEvent("pointermove"),this);utils.removeEvent(window,"mousemove",this);if(this.scroller.options.snap){var snap=this.scroller._nearestSnap(this.scroller.x,this.scroller.y);var time=this.options.snapSpeed|| Math.max(Math.max(Math.min(Math.abs(this.scroller.x-snap.x),1E3),Math.min(Math.abs(this.scroller.y-snap.y),1E3)),300);if(this.scroller.x!=snap.x||this.scroller.y!=snap.y){this.scroller.directionX=0;this.scroller.directionY=0;this.scroller.currentPage=snap;this.scroller.scrollTo(snap.x,snap.y,time,this.scroller.options.bounceEasing)}}if(this.moved)this.scroller._execEvent("scrollEnd")},transitionTime:function(time){time=time||0;var durationProp=utils.style.transitionDuration;if(!durationProp)return; this.indicatorStyle[durationProp]=time+"ms";if(!time&&utils.isBadAndroid){this.indicatorStyle[durationProp]="0.0001ms";var self=this;rAF(function(){if(self.indicatorStyle[durationProp]==="0.0001ms")self.indicatorStyle[durationProp]="0s"})}},transitionTimingFunction:function(easing){this.indicatorStyle[utils.style.transitionTimingFunction]=easing},refresh:function(){this.transitionTime();if(this.options.listenX&&!this.options.listenY)this.indicatorStyle.display=this.scroller.hasHorizontalScroll?"block": "none";else if(this.options.listenY&&!this.options.listenX)this.indicatorStyle.display=this.scroller.hasVerticalScroll?"block":"none";else this.indicatorStyle.display=this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none";if(this.scroller.hasHorizontalScroll&&this.scroller.hasVerticalScroll){utils.addClass(this.wrapper,"iScrollBothScrollbars");utils.removeClass(this.wrapper,"iScrollLoneScrollbar");if(this.options.defaultScrollbars&&this.options.customStyle)if(this.options.listenX)this.wrapper.style.right= "8px";else this.wrapper.style.bottom="8px"}else{utils.removeClass(this.wrapper,"iScrollBothScrollbars");utils.addClass(this.wrapper,"iScrollLoneScrollbar");if(this.options.defaultScrollbars&&this.options.customStyle)if(this.options.listenX)this.wrapper.style.right="2px";else this.wrapper.style.bottom="2px"}var r=this.wrapper.offsetHeight;if(this.options.listenX){this.wrapperWidth=this.wrapper.clientWidth;if(this.options.resize){this.indicatorWidth=Math.max(Math.round(this.wrapperWidth*this.wrapperWidth/ (this.scroller.scrollerWidth||this.wrapperWidth||1)),8);this.indicatorStyle.width=this.indicatorWidth+"px"}else this.indicatorWidth=this.indicator.clientWidth;this.maxPosX=this.wrapperWidth-this.indicatorWidth;if(this.options.shrink=="clip"){this.minBoundaryX=-this.indicatorWidth+8;this.maxBoundaryX=this.wrapperWidth-8}else{this.minBoundaryX=0;this.maxBoundaryX=this.maxPosX}this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX}if(this.options.listenY){this.wrapperHeight= this.wrapper.clientHeight;if(this.options.resize){this.indicatorHeight=Math.max(Math.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8);this.indicatorStyle.height=this.indicatorHeight+"px"}else this.indicatorHeight=this.indicator.clientHeight;this.maxPosY=this.wrapperHeight-this.indicatorHeight;if(this.options.shrink=="clip"){this.minBoundaryY=-this.indicatorHeight+8;this.maxBoundaryY=this.wrapperHeight-8}else{this.minBoundaryY=0;this.maxBoundaryY= this.maxPosY}this.maxPosY=this.wrapperHeight-this.indicatorHeight;this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY}this.updatePosition()},updatePosition:function(){var x=this.options.listenX&&Math.round(this.sizeRatioX*this.scroller.x)||0,y=this.options.listenY&&Math.round(this.sizeRatioY*this.scroller.y)||0;if(!this.options.ignoreBoundaries){if(x<this.minBoundaryX){if(this.options.shrink=="scale"){this.width=Math.max(this.indicatorWidth+x, 8);this.indicatorStyle.width=this.width+"px"}x=this.minBoundaryX}else if(x>this.maxBoundaryX)if(this.options.shrink=="scale"){this.width=Math.max(this.indicatorWidth-(x-this.maxPosX),8);this.indicatorStyle.width=this.width+"px";x=this.maxPosX+this.indicatorWidth-this.width}else x=this.maxBoundaryX;else if(this.options.shrink=="scale"&&this.width!=this.indicatorWidth){this.width=this.indicatorWidth;this.indicatorStyle.width=this.width+"px"}if(y<this.minBoundaryY){if(this.options.shrink=="scale"){this.height= Math.max(this.indicatorHeight+y*3,8);this.indicatorStyle.height=this.height+"px"}y=this.minBoundaryY}else if(y>this.maxBoundaryY)if(this.options.shrink=="scale"){this.height=Math.max(this.indicatorHeight-(y-this.maxPosY)*3,8);this.indicatorStyle.height=this.height+"px";y=this.maxPosY+this.indicatorHeight-this.height}else y=this.maxBoundaryY;else if(this.options.shrink=="scale"&&this.height!=this.indicatorHeight){this.height=this.indicatorHeight;this.indicatorStyle.height=this.height+"px"}}this.x= x;this.y=y;if(this.scroller.options.useTransform)this.indicatorStyle[utils.style.transform]="translate("+x+"px,"+y+"px)"+this.scroller.translateZ;else{this.indicatorStyle.left=x+"px";this.indicatorStyle.top=y+"px"}},_pos:function(x,y){if(x<0)x=0;else if(x>this.maxPosX)x=this.maxPosX;if(y<0)y=0;else if(y>this.maxPosY)y=this.maxPosY;x=this.options.listenX?Math.round(x/this.sizeRatioX):this.scroller.x;y=this.options.listenY?Math.round(y/this.sizeRatioY):this.scroller.y;this.scroller.scrollTo(x,y)},fade:function(val, hold){if(hold&&!this.visible)return;clearTimeout(this.fadeTimeout);this.fadeTimeout=null;var time=val?250:500,delay=val?0:300;val=val?"1":"0";this.wrapperStyle[utils.style.transitionDuration]=time+"ms";this.fadeTimeout=setTimeout(function(val){this.wrapperStyle.opacity=val;this.visible=+val}.bind(this,val),delay)}};IScroll.utils=utils;IScroll.prototype["handleEvent"]=IScroll.prototype.handleEvent;Indicator.prototype["handleEvent"]=Indicator.prototype.handleEvent;window.IScrollMobile=IScroll})(window, document,Math);"use strict";(function(window,undefined){var AscCommon=window["AscCommon"];var global_mouseEvent=AscCommon.global_mouseEvent;AscCommon.MobileTouchMode={None:0,Scroll:1,Zoom:2,Select:3,InlineObj:4,FlowObj:5,Cursor:6,TableMove:7,TableRuler:8,SelectTrack:9};AscCommon.MobileTouchContextMenuType={None:0,Target:1,Select:2,Object:3,Slide:4};function MobileTouchContextMenuLastInfo(){this.targetPos=null;this.selectText=null;this.selectCell=null;this.objectBounds=null;this.objectSlideThumbnail= null}MobileTouchContextMenuLastInfo.prototype={Clear:function(){this.targetPos=null;this.selectText=null;this.selectCell=null;this.objectBounds=null;this.objectSlideThumbnail=null},CopyTo:function(dst){dst.targetPos=this.targetPos;dst.selectText=this.selectText;dst.selectCell=this.selectCell;dst.objectBounds=this.objectBounds;dst.objectSlideThumbnail=this.objectSlideThumbnail}};AscCommon.MobileTouchContextMenuLastInfo=MobileTouchContextMenuLastInfo;AscCommon.MOBILE_SELECT_TRACK_ROUND=14;AscCommon.MOBILE_TABLE_RULER_DIAMOND= 7;function CMobileDelegateSimple(_manager){this.Manager=_manager;this.Api=_manager.Api}CMobileDelegateSimple.prototype.Init=function(){this.Manager.iScroll.manager=this.Manager;this.Manager.iScroll.on("scroll",function(){this.manager.delegate.ScrollTo(this)});this.Manager.iScroll.on("scrollEnd",function(){this.manager.delegate.ScrollEnd(this)})};CMobileDelegateSimple.prototype.Resize=function(){return null};CMobileDelegateSimple.prototype.GetSelectionTransform=function(){return null};CMobileDelegateSimple.prototype.ConvertCoordsToCursor= function(x,y,page,isCanvas){return null};CMobileDelegateSimple.prototype.ConvertCoordsFromCursor=function(x,y){return null};CMobileDelegateSimple.prototype.GetElementOffset=function(){return null};CMobileDelegateSimple.prototype.GetTableDrawing=function(){return null};CMobileDelegateSimple.prototype.GetZoom=function(){return null};CMobileDelegateSimple.prototype.SetZoom=function(_value){};CMobileDelegateSimple.prototype.GetObjectTrack=function(x,y,page,bSelected,bText){return false};CMobileDelegateSimple.prototype.GetContextMenuType= function(){return AscCommon.MobileTouchContextMenuType.None};CMobileDelegateSimple.prototype.GetContextMenuInfo=function(info){info.Clear()};CMobileDelegateEditor.prototype.GetContextMenuPosition=function(){return null};CMobileDelegateSimple.prototype.GetZoomFit=function(){return 100};CMobileDelegateSimple.prototype.GetScrollerParent=function(){return null};CMobileDelegateSimple.prototype.GetScrollerSize=function(){return{W:100,H:100}};CMobileDelegateSimple.prototype.GetScrollPosition=function(){return null}; CMobileDelegateSimple.prototype.ScrollTo=function(_scroll){return};CMobileDelegateSimple.prototype.ScrollEnd=function(_scroll){return};CMobileDelegateSimple.prototype.GetSelectionRectsBounds=function(){return this.LogicDocument.GetSelectionBounds()};CMobileDelegateSimple.prototype.IsReader=function(){return false};function CMobileDelegateEditor(_manager){CMobileDelegateSimple.call(this,_manager);this.HtmlPage=this.Api.WordControl;this.LogicDocument=this.Api.WordControl.m_oLogicDocument;this.DrawingDocument= this.Api.WordControl.m_oDrawingDocument}CMobileDelegateEditor.prototype=Object.create(CMobileDelegateSimple.prototype);CMobileDelegateEditor.prototype.constructor=CMobileDelegateEditor;CMobileDelegateEditor.prototype.GetSelectionTransform=function(){return this.DrawingDocument.SelectionMatrix};CMobileDelegateEditor.prototype.ConvertCoordsToCursor=function(x,y,page,isGlobal){return this.DrawingDocument.ConvertCoordsToCursor3(x,y,page,isGlobal!==false)};CMobileDelegateEditor.prototype.ConvertCoordsFromCursor= function(x,y){return this.DrawingDocument.ConvertCoordsFromCursor2(x,y)};CMobileDelegateEditor.prototype.GetElementOffset=function(){var _xOffset=this.HtmlPage.X;var _yOffset=this.HtmlPage.Y;if(true===this.HtmlPage.m_bIsRuler){_xOffset+=5*AscCommon.g_dKoef_mm_to_pix;_yOffset+=7*AscCommon.g_dKoef_mm_to_pix}return{X:_xOffset,Y:_yOffset}};CMobileDelegateEditor.prototype.GetTableDrawing=function(){return this.DrawingDocument.TableOutlineDr};CMobileDelegateEditor.prototype.GetZoom=function(){return this.HtmlPage.m_nZoomValue}; CMobileDelegateEditor.prototype.SetZoom=function(_value){this.HtmlPage.m_oApi.zoom(_value)};CMobileDelegateEditor.prototype.GetObjectTrack=function(x,y,page,bSelected,bText){return this.LogicDocument.DrawingObjects.isPointInDrawingObjects3(x,y,page,bSelected,bText)};CMobileDelegateEditor.prototype.GetContextMenuType=function(){var _mode=AscCommon.MobileTouchContextMenuType.None;if(!this.LogicDocument.IsSelectionUse())_mode=AscCommon.MobileTouchContextMenuType.Target;var selectionBounds=this.LogicDocument.GetSelectionBounds(); var eps=1E-4;if(selectionBounds&&selectionBounds.Start&&selectionBounds.End&&Math.abs(selectionBounds.Start.W)>eps&&Math.abs(selectionBounds.End.W)>eps)_mode=AscCommon.MobileTouchContextMenuType.Select;if(_mode==0&&this.LogicDocument.DrawingObjects.getSelectedObjectsBounds())_mode=AscCommon.MobileTouchContextMenuType.Object;return _mode};CMobileDelegateEditor.prototype.GetContextMenuInfo=function(info){info.Clear();var _info=null;var _transform=null;var _x=0;var _y=0;var _target=this.LogicDocument.IsSelectionUse(); if(_target===false){_info={X:this.LogicDocument.TargetPos.X,Y:this.LogicDocument.TargetPos.Y,Page:this.LogicDocument.TargetPos.PageNum};_transform=this.DrawingDocument.TextMatrix;if(_transform){_x=_transform.TransformPointX(_info.X,_info.Y);_y=_transform.TransformPointY(_info.X,_info.Y);_info.X=_x;_info.Y=_y}info.targetPos=_info;return}var _select=this.LogicDocument.GetSelectionBounds();if(_select){var _rect1=_select.Start;var _rect2=_select.End;_info={X1:_rect1.X,Y1:_rect1.Y,Page1:_rect1.Page,X2:_rect2.X+ _rect2.W,Y2:_rect2.Y+_rect2.H,Page2:_rect2.Page};_transform=this.DrawingDocument.SelectionMatrix;if(_transform){_x=_transform.TransformPointX(_info.X1,_info.Y1);_y=_transform.TransformPointY(_info.X1,_info.Y1);_info.X1=_x;_info.Y1=_y;_x=_transform.TransformPointX(_info.X2,_info.Y2);_y=_transform.TransformPointY(_info.X2,_info.Y2);_info.X2=_x;_info.Y2=_y}info.selectText=_info;return}var _object_bounds=this.LogicDocument.DrawingObjects.getSelectedObjectsBounds();if(_object_bounds)info.objectBounds= {X:_object_bounds.minX,Y:_object_bounds.minY,R:_object_bounds.maxX,B:_object_bounds.maxY,Page:_object_bounds.pageIndex}};CMobileDelegateEditor.prototype.GetContextMenuPosition=function(){var _posX=0;var _posY=0;var _page=0;var _transform=null;var tmpX,tmpY,tmpX2,tmpY2;var _pos=null;var _mode=0;var _target=this.LogicDocument.IsSelectionUse();if(_target===false){_posX=this.DrawingDocument.m_dTargetX;_posY=this.DrawingDocument.m_dTargetY;_page=this.DrawingDocument.m_lTargetPage;_transform=this.DrawingDocument.TextMatrix; if(_transform){tmpX=_transform.TransformPointX(_posX,_posY);tmpY=_transform.TransformPointY(_posX,_posY)}else{tmpX=_posX;tmpY=_posY}_pos=this.DrawingDocument.ConvertCoordsToCursorWR(tmpX,tmpY,_page);_posX=_pos.X;_posY=_pos.Y;_mode=1}var _select=this.LogicDocument.GetSelectionBounds();if(_select){var _rect1=_select.Start;var _rect2=_select.End;tmpX=_rect1.X;tmpY=_rect1.Y;tmpX2=_rect2.X+_rect2.W;tmpY2=_rect2.Y+_rect2.H;_transform=this.DrawingDocument.SelectionMatrix;if(_transform){_posX=_transform.TransformPointX(tmpX, tmpY);_posY=_transform.TransformPointY(tmpX,tmpY);tmpX=_posX;tmpY=_posY;_posX=_transform.TransformPointX(tmpX2,tmpY2);_posY=_transform.TransformPointY(tmpX2,tmpY2);tmpX2=_posX;tmpY2=_posY}_pos=this.DrawingDocument.ConvertCoordsToCursorWR(tmpX,tmpY,_rect1.Page);_posX=_pos.X;_posY=_pos.Y;_pos=this.DrawingDocument.ConvertCoordsToCursorWR(tmpX2,tmpY2,_rect2.Page);_posX+=_pos.X;_posX=_posX>>1;_mode=2}var _object_bounds=this.LogicDocument.DrawingObjects.getSelectedObjectsBounds(true);if(_object_bounds){_pos= this.DrawingDocument.ConvertCoordsToCursorWR(_object_bounds.minX,_object_bounds.minY,_object_bounds.pageIndex);_posX=_pos.X;_posY=_pos.Y;_pos=this.DrawingDocument.ConvertCoordsToCursorWR(_object_bounds.maxX,_object_bounds.maxY,_object_bounds.pageIndex);_posX+=_pos.X;_posX=_posX>>1;_mode=3}return{X:_posX,Y:_posY,Mode:_mode}};CMobileDelegateEditor.prototype.GetZoomFit=function(){var Zoom=100;var w=this.HtmlPage.m_oEditor.AbsolutePosition.R-this.HtmlPage.m_oEditor.AbsolutePosition.L;if(0!=this.HtmlPage.m_dDocumentPageWidth){Zoom= 100*(w-10)/this.HtmlPage.m_dDocumentPageWidth;if(Zoom<5)Zoom=5;if(this.HtmlPage.m_oApi.isMobileVersion){var _w=this.HtmlPage.m_oEditor.HtmlElement.width;if(this.HtmlPage.bIsRetinaSupport)_w/=AscCommon.AscBrowser.retinaPixelRatio;Zoom=100*_w*AscCommon.g_dKoef_pix_to_mm/this.HtmlPage.m_dDocumentPageWidth}}return Zoom-.5>>0};CMobileDelegateEditor.prototype.GetScrollerParent=function(){return this.HtmlPage.m_oMainView.HtmlElement};CMobileDelegateEditor.prototype.GetScrollerSize=function(){return{W:this.HtmlPage.m_dDocumentWidth, H:this.HtmlPage.m_dDocumentHeight}};CMobileDelegateEditor.prototype.ScrollTo=function(_scroll){this.HtmlPage.NoneRepaintPages=true===_scroll.isAnimating?true:false;if(_scroll.directionLocked=="v")this.HtmlPage.m_oScrollVerApi.scrollToY(-_scroll.y);else if(_scroll.directionLocked=="h")this.HtmlPage.m_oScrollHorApi.scrollToX(-_scroll.x);else if(_scroll.directionLocked=="n"){this.HtmlPage.m_oScrollHorApi.scrollToX(-_scroll.x);this.HtmlPage.m_oScrollVerApi.scrollToY(-_scroll.y)}};CMobileDelegateEditor.prototype.ScrollEnd= function(_scroll){this.HtmlPage.NoneRepaintPages=true===_scroll.isAnimating?true:false;this.HtmlPage.OnScroll();_scroll.manager.OnScrollAnimationEnd()};CMobileDelegateEditor.prototype.GetSelectionRectsBounds=function(){return this.LogicDocument.GetSelectionBounds()};CMobileDelegateEditor.prototype.IsReader=function(){return null!=this.DrawingDocument.m_oDocumentRenderer};CMobileDelegateEditor.prototype.Logic_GetNearestPos=function(x,y,page){return this.LogicDocument.Get_NearestPos(page,x,y)};CMobileDelegateEditor.prototype.Logic_OnMouseDown= function(e,x,y,page){return this.LogicDocument.OnMouseDown(e,x,y,page)};CMobileDelegateEditor.prototype.Logic_OnMouseMove=function(e,x,y,page){return this.LogicDocument.OnMouseMove(e,x,y,page)};CMobileDelegateEditor.prototype.Logic_OnMouseUp=function(e,x,y,page){return this.LogicDocument.OnMouseUp(e,x,y,page)};CMobileDelegateEditor.prototype.Drawing_OnMouseDown=function(e){return this.HtmlPage.onMouseDown(e)};CMobileDelegateEditor.prototype.Drawing_OnMouseMove=function(e){return this.HtmlPage.onMouseMove(e)}; CMobileDelegateEditor.prototype.Drawing_OnMouseUp=function(e){return this.HtmlPage.onMouseUp(e)};function CMobileTouchManagerBase(_config){this.Api=null;this.Mode=AscCommon.MobileTouchMode.None;this.IsTouching=false;this.ReadingGlassTime=750;this.TimeDown=0;this.DownPoint=null;this.DownPointOriginal={X:0,Y:0};this.MoveAfterDown=false;this.MoveMinDist=10;this.SelectEnabled=_config.isSelection!==false;this.RectSelect1=null;this.RectSelect2=null;this.PageSelect1=0;this.PageSelect2=0;this.RectSelectType= 0;this.TrackTargetEps=20;this.ZoomEnabled=_config.isZoomEnabled!==false;this.ZoomDistance=0;this.ZoomValue=100;this.ZoomValueMin=50;this.ZoomValueMax=300;this.TableTrackEnabled=_config.isTableTrack!==false;this.TableMovePoint=null;this.TableHorRulerPoints=null;this.TableVerRulerPoints=null;this.TableStartTrack_Check=false;this.TableRulersRectOffset=5;this.TableRulersRectSize=20;this.TableCurrentMoveDir=-1;this.TableCurrentMovePos=-1;this.TableCurrentMoveValue=0;this.TableCurrentMoveValueOld=0;this.TableCurrentMoveValueMin= null;this.TableCurrentMoveValueMax=null;this.ContextMenuLastMode=AscCommon.MobileTouchContextMenuType.None;this.ContextMenuLastInfo=new AscCommon.MobileTouchContextMenuLastInfo;this.ContextMenuLastShow=false;this.ContextMenuLastModeCounter=0;this.ContextMenuShowTimerId=-1;this.iScroll=null;this.iScrollElement="mobile_scroller_id";this.delegate=null;this.eventsElement=_config.eventsElement;this.pointerTouchesCoords={};this.IsZoomCheckFit=false;this.isShowingContextMenu=false;this.isMobileContextMenuShowResize= false}CMobileTouchManagerBase.prototype.initEvents=function(_id){this.eventsElement=_id;this.iScroll.eventsElement=this.eventsElement;this.iScroll._initEvents()};CMobileTouchManagerBase.prototype.CreateScrollerDiv=function(_wrapper){var _scroller=document.createElement("div");var _style="position: absolute; z-index: 0; margin: 0; padding: 0; -webkit-tap-highlight-color: rgba(0,0,0,0); width: 100%; heigth: 100%; display: block;";_style+="-webkit-transform: translateZ(0); -moz-transform: translateZ(0); -ms-transform: translateZ(0); -o-transform: translateZ(0); transform: translateZ(0);"; _style+="-webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;";_style+="-webkit-text-size-adjust: none; -moz-text-size-adjust: none; -ms-text-size-adjust: none; -o-text-size-adjust: none; text-size-adjust: none;";_scroller.setAttribute("style",_style);_scroller.id=this.iScrollElement;_wrapper.appendChild(_scroller)};CMobileTouchManagerBase.prototype.LoadMobileImages=function(){window.g_table_track_mobile_move=document.createElement("canvas"); if(AscCommon.AscBrowser.isRetina){window.g_table_track_mobile_move.width=20*AscCommon.AscBrowser.retinaPixelRatio>>0;window.g_table_track_mobile_move.height=20*AscCommon.AscBrowser.retinaPixelRatio>>0}else{window.g_table_track_mobile_move.width=20;window.g_table_track_mobile_move.height=20}window.g_table_track_mobile_move.asc_complete=true;window.g_table_track_mobile_move.size=20;var _ctx=window.g_table_track_mobile_move.getContext("2d");if(AscCommon.AscBrowser.isRetina)_ctx.setTransform(2,0,0,2, 0,0);_ctx.lineWidth=1;var r=4;var w=19;var h=19;var x=.5;var y=.5;_ctx.moveTo(x+r,y);_ctx.lineTo(x+w-r,y);_ctx.quadraticCurveTo(x+w,y,x+w,y+r);_ctx.lineTo(x+w,y+h-r);_ctx.quadraticCurveTo(x+w,y+h,x+w-r,y+h);_ctx.lineTo(x+r,y+h);_ctx.quadraticCurveTo(x,y+h,x,y+h-r);_ctx.lineTo(x,y+r);_ctx.quadraticCurveTo(x,y,x+r,y);_ctx.strokeStyle="#747474";_ctx.fillStyle="#DFDFDF";_ctx.fill();_ctx.stroke();_ctx.beginPath();_ctx.moveTo(2,10);_ctx.lineTo(10,2);_ctx.lineTo(18,10);_ctx.lineTo(10,18);_ctx.closePath(); _ctx.fillStyle="#146FE1";_ctx.fill();_ctx.beginPath();_ctx.fillStyle="#DFDFDF";_ctx.fillRect(6,6,8,8);_ctx.beginPath()};CMobileTouchManagerBase.prototype.CheckSelectTrack=function(){if(!this.SelectEnabled)return false;var _matrix=this.delegate.GetSelectionTransform();if(_matrix&&global_MatrixTransformer.IsIdentity(_matrix))_matrix=null;if(null!=this.RectSelect1&&null!=this.RectSelect2){var pos1=null;var pos4=null;if(!_matrix){pos1=this.delegate.ConvertCoordsToCursor(this.RectSelect1.x,this.RectSelect1.y, this.PageSelect1);pos4=this.delegate.ConvertCoordsToCursor(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+this.RectSelect2.h,this.PageSelect2)}else{var _xx1=_matrix.TransformPointX(this.RectSelect1.x,this.RectSelect1.y);var _yy1=_matrix.TransformPointY(this.RectSelect1.x,this.RectSelect1.y);var _xx2=_matrix.TransformPointX(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+this.RectSelect2.h);var _yy2=_matrix.TransformPointY(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+ this.RectSelect2.h);pos1=this.delegate.ConvertCoordsToCursor(_xx1,_yy1,this.PageSelect1);pos4=this.delegate.ConvertCoordsToCursor(_xx2,_yy2,this.PageSelect2)}if(Math.abs(pos1.X-global_mouseEvent.X)<this.TrackTargetEps&&Math.abs(pos1.Y-global_mouseEvent.Y)<this.TrackTargetEps){this.Mode=AscCommon.MobileTouchMode.Select;this.DragSelect=1}else if(Math.abs(pos4.X-global_mouseEvent.X)<this.TrackTargetEps&&Math.abs(pos4.Y-global_mouseEvent.Y)<this.TrackTargetEps){this.Mode=AscCommon.MobileTouchMode.Select; this.DragSelect=2}}return this.Mode==AscCommon.MobileTouchMode.Select};CMobileTouchManagerBase.prototype.CheckTableTrack=function(){if(!this.TableTrackEnabled)return false;var _eps=this.TrackTargetEps;var bIsTable=false;var _table_outline_dr=this.delegate.GetTableDrawing();if(this.TableMovePoint!=null&&_table_outline_dr){var _Transform=_table_outline_dr.TableMatrix;var _PageNum=_table_outline_dr.CurrentPageIndex;var _PageNumOrigin=_PageNum;if(_table_outline_dr.TableOutline)_PageNumOrigin=_table_outline_dr.TableOutline.PageNum; if(!_Transform||global_MatrixTransformer.IsIdentity(_Transform)){var _x=global_mouseEvent.X;var _y=global_mouseEvent.Y;var posLT=this.delegate.ConvertCoordsToCursor(this.TableMovePoint.X,this.TableMovePoint.Y,_PageNum);var _offset=this.TableRulersRectSize+this.TableRulersRectOffset;if(_x>posLT.X-_offset-_eps&&_x<posLT.X-this.TableRulersRectOffset+_eps&&_y>posLT.Y-_offset-_eps&&_y<posLT.Y-this.TableRulersRectOffset+_eps&&_PageNumOrigin==_PageNum){this.Mode=AscCommon.MobileTouchMode.TableMove;bIsTable= true}if(!bIsTable){if(_y>posLT.Y-_offset-_eps&&_y<posLT.Y-this.TableRulersRectOffset+_eps){var _len=this.TableHorRulerPoints.length;var _indexF=-1;var _minF=1E6;for(var i=0;i<_len;i++){var posM1=this.delegate.ConvertCoordsToCursor(this.TableHorRulerPoints[i].C,this.TableMovePoint.Y,_PageNum);var _dist=Math.abs(_x-posM1.X);if(_minF>_dist){_indexF=i;_minF=_dist}}if(_minF<_eps){var _p=this.TableHorRulerPoints[_indexF];this.TableCurrentMoveDir=0;this.TableCurrentMovePos=_indexF;this.TableCurrentMoveValue= _p.X;this.TableCurrentMoveValueOld=this.TableCurrentMoveValue;this.Mode=AscCommon.MobileTouchMode.TableRuler;if(_indexF==0)this.TableCurrentMoveValueMin=this.TableMovePoint.X;else this.TableCurrentMoveValueMin=this.TableHorRulerPoints[_indexF-1].X+this.TableHorRulerPoints[_indexF-1].W;if(_indexF<_len-1)this.TableCurrentMoveValueMax=this.TableHorRulerPoints[_indexF+1].X;else this.TableCurrentMoveValueMax=null;bIsTable=true}}if(!bIsTable&&_x>=posLT.X-_offset-_eps&&_x<=posLT.X-this.TableRulersRectOffset+ _eps){var _len=this.TableVerRulerPoints.length;var _indexF=-1;var _minF=1E6;for(var i=0;i<_len;i++){var posM1=this.delegate.ConvertCoordsToCursor(this.TableMovePoint.X,this.TableVerRulerPoints[i].Y,_PageNum);var posM2=this.delegate.ConvertCoordsToCursor(this.TableMovePoint.X,this.TableVerRulerPoints[i].Y+this.TableVerRulerPoints[i].H,_PageNum);if(_y>=posM1.Y-_eps&&_y<=posM2.Y+_eps){var _dist=Math.abs(_y-(posM1.Y+posM2.Y)/2);if(_minF>_dist){_indexF=i;_minF=_dist}}}if(_indexF!=-1){var _p=this.TableVerRulerPoints[_indexF]; this.TableCurrentMoveDir=1;this.TableCurrentMovePos=_indexF;this.TableCurrentMoveValue=_p.Y;this.TableCurrentMoveValueOld=this.TableCurrentMoveValue;this.Mode=AscCommon.MobileTouchMode.TableRuler;if(_indexF==0)this.TableCurrentMoveValueMin=this.TableMovePoint.Y;else this.TableCurrentMoveValueMin=this.TableVerRulerPoints[_indexF-1].Y+this.TableVerRulerPoints[_indexF-1].H;if(_indexF<_len-1)this.TableCurrentMoveValueMax=this.TableVerRulerPoints[_indexF+1].Y;else this.TableCurrentMoveValueMax=null;bIsTable= true}}}}else{var pos=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);if(pos.Page==_PageNum){var _invert=global_MatrixTransformer.Invert(_Transform);var _posx=_invert.TransformPointX(pos.X,pos.Y);var _posy=_invert.TransformPointY(pos.X,pos.Y);var _koef=AscCommon.g_dKoef_pix_to_mm*100/this.delegate.GetZoom();var _eps1=this.TrackTargetEps*_koef;var _offset1=this.TableRulersRectOffset*_koef;var _offset2=_offset1+this.TableRulersRectSize*_koef;if(_posx>=this.TableMovePoint.X- _offset2-_eps1&&_posx<=this.TableMovePoint.X-_offset1+_eps1&&_posy>=this.TableMovePoint.Y-_offset2-_eps1&&_posy<=this.TableMovePoint.Y-_offset1+_eps1){this.Mode=AscCommon.MobileTouchMode.TableMove;bIsTable=true}if(!bIsTable){if(_posy>this.TableMovePoint.Y-_offset2-_eps1&&_posy<this.TableMovePoint.Y-_offset1+_eps1){var _len=this.TableHorRulerPoints.length;for(var i=0;i<_len;i++){var _p=this.TableHorRulerPoints[i];if(_posx>_p.X-_eps1&&_posx<_p.X+_p.W+_eps1){this.TableCurrentMoveDir=0;this.TableCurrentMovePos= i;this.TableCurrentMoveValue=this.TableHorRulerPoints[i].X;this.TableCurrentMoveValueOld=this.TableCurrentMoveValue;this.Mode=AscCommon.MobileTouchMode.TableRuler;if(i==0)this.TableCurrentMoveValueMin=this.TableMovePoint.X;else this.TableCurrentMoveValueMin=this.TableHorRulerPoints[i-1].X+this.TableHorRulerPoints[i-1].W;if(i<_len-1)this.TableCurrentMoveValueMax=this.TableHorRulerPoints[i+1].X;else this.TableCurrentMoveValueMax=null;bIsTable=true;break}}}if(!bIsTable&&_posx>=this.TableMovePoint.X- _offset2-_eps1&&_posx<=this.TableMovePoint.X-_offset1+_eps1){var _len=this.TableVerRulerPoints.length;for(var i=0;i<_len;i++){var _p=this.TableVerRulerPoints[i];if(_posy>=_p.Y-_eps1&&_posy<=_p.Y+_p.H+_eps1){this.TableCurrentMoveDir=1;this.TableCurrentMovePos=i;this.TableCurrentMoveValue=this.TableVerRulerPoints[i].Y;this.TableCurrentMoveValueOld=this.TableCurrentMoveValue;this.Mode=AscCommon.MobileTouchMode.TableRuler;if(i==0)this.TableCurrentMoveValueMin=this.TableMovePoint.Y;else this.TableCurrentMoveValueMin= this.TableVerRulerPoints[i-1].Y+this.TableVerRulerPoints[i-1].H;if(i<_len-1)this.TableCurrentMoveValueMax=this.TableVerRulerPoints[i+1].Y;else this.TableCurrentMoveValueMax=null;bIsTable=true;break}}}}}}}return bIsTable};CMobileTouchManagerBase.prototype.CheckObjectTrack=function(){var pos=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);global_mouseEvent.KoefPixToMM=5;if(this.delegate.GetObjectTrack(pos.X,pos.Y,pos.Page,true))this.Mode=AscCommon.MobileTouchMode.FlowObj; else this.Mode=AscCommon.MobileTouchMode.None;global_mouseEvent.KoefPixToMM=1;return AscCommon.MobileTouchMode.FlowObj==this.Mode};CMobileTouchManagerBase.prototype.CheckObjectTrackBefore=function(){var pos=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);global_mouseEvent.KoefPixToMM=5;var bResult=this.delegate.GetObjectTrack(pos.X,pos.Y,pos.Page,false);global_mouseEvent.KoefPixToMM=1;return bResult};CMobileTouchManagerBase.prototype.CheckObjectText=function(){var pos= this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);global_mouseEvent.KoefPixToMM=5;var bResult=this.delegate.GetObjectTrack(pos.X,pos.Y,pos.Page,false,true);global_mouseEvent.KoefPixToMM=1;return bResult};CMobileTouchManagerBase.prototype.CheckZoomCriticalValues=function(zoomMin){if(zoomMin!==undefined){this.ZoomValueMin=zoomMin;return}var _new_value=this.delegate.GetZoomFit();this.ZoomValueMin=_new_value;if(this.ZoomValue<this.ZoomValueMin){this.ZoomValue=this.ZoomValueMin; this.delegate.SetZoom(this.ZoomValue)}};CMobileTouchManagerBase.prototype.BeginZoomCheck=function(){var _zoomCurrent=this.delegate.GetZoom();var _zoomFit=this.delegate.GetZoomFit();this.IsZoomCheckFit=_zoomCurrent==_zoomFit?true:false};CMobileTouchManagerBase.prototype.EndZoomCheck=function(){var _zoomCurrent=this.delegate.GetZoom();var _zoomFit=this.delegate.GetZoomFit();if(this.IsZoomCheckFit||_zoomCurrent<_zoomFit)this.delegate.SetZoom(this.delegate.GetZoomFit());this.IsZoomCheckFit=false};CMobileTouchManagerBase.prototype.Resize= function(){this.delegate.Resize();this.CheckZoomCriticalValues();if(this.iScroll!=null){var _size=this.delegate.GetScrollerSize();this.iScroll.scroller.style.width=_size.W+"px";this.iScroll.scroller.style.height=_size.H+"px";var _position=this.delegate.GetScrollPosition();this.iScroll.refresh(_position)}if(this.isMobileContextMenuShowResize)this.SendShowContextMenu()};CMobileTouchManagerBase.prototype.Resize_Before=function(){this.isMobileContextMenuShowResize=this.isShowingContextMenu};CMobileTouchManagerBase.prototype.Resize_After= function(){if(this.isMobileContextMenuShowResize)this.SendShowContextMenu();this.isMobileContextMenuShowResize=false};CMobileTouchManagerBase.prototype.IsWorkedPosition=function(){if(this.IsTouching)return true;if(this.iScroll&&this.iScroll.isAnimating)return true;return false};CMobileTouchManagerBase.prototype.Destroy=function(){var _scroller=document.getElementById(this.iScrollElement);this.delegate.GetScrollerParent().removeChild(_scroller);if(this.iScroll!=null)this.iScroll.destroy()};CMobileTouchManagerBase.prototype.SendShowContextMenu= function(){if(-1!=this.ContextMenuShowTimerId)clearTimeout(this.ContextMenuShowTimerId);this.isShowingContextMenu=true;var that=this;this.ContextMenuShowTimerId=setTimeout(function(){that.ContextMenuShowTimerId=-1;var _pos=that.delegate.GetContextMenuPosition();that.Api.sendEvent("asc_onShowPopMenu",_pos.X,_pos.Y,_pos.Mode>1?true:false)},500)};CMobileTouchManagerBase.prototype.CheckContextMenuTouchEndOld=function(isCheck,isSelectTouch,isGlassTouch,isTableRuler){if(isCheck){var _mode=this.delegate.GetContextMenuType(); if(_mode==this.ContextMenuLastMode){this.ContextMenuLastModeCounter++;this.ContextMenuLastModeCounter&=1}else this.ContextMenuLastModeCounter=0;this.ContextMenuLastMode=_mode}if(this.ContextMenuLastMode>AscCommon.MobileTouchContextMenuType.None&&1==this.ContextMenuLastModeCounter)this.SendShowContextMenu()};CMobileTouchManagerBase.prototype.CheckContextMenuTouchEnd=function(isCheck,isSelectTouch,isGlassTouch,isTableRuler){var isShowContextMenu=false;var isSelectCell=false;if(isCheck){var oldLastInfo= new AscCommon.MobileTouchContextMenuLastInfo;this.ContextMenuLastInfo.CopyTo(oldLastInfo);var oldLasdMode=this.ContextMenuLastMode;this.ContextMenuLastMode=this.delegate.GetContextMenuType();this.delegate.GetContextMenuInfo(this.ContextMenuLastInfo);isSelectCell=this.ContextMenuLastInfo.selectCell!=null;var _data1=null;var _data2=null;if(this.ContextMenuLastMode==oldLasdMode){var isEqual=false;switch(this.ContextMenuLastMode){case AscCommon.MobileTouchContextMenuType.Target:{_data1=this.ContextMenuLastInfo.targetPos; _data2=oldLastInfo.targetPos;if(_data1&&_data2)if(_data1.Page==_data1.Page&&Math.abs(_data1.X-_data2.X)<10&&Math.abs(_data1.Y-_data2.Y)<10)isEqual=true;break}case AscCommon.MobileTouchContextMenuType.Select:{_data1=this.ContextMenuLastInfo.selectText;_data2=oldLastInfo.selectText;if(_data1&&_data2){if(_data1.Page1==_data2.Page1&&_data1.Page2==_data2.Page2&&Math.abs(_data1.X1-_data2.X1)<.1&&Math.abs(_data1.Y1-_data2.Y1)<.1&&Math.abs(_data1.X2-_data2.X2)<.1&&Math.abs(_data1.Y2-_data2.Y2)<.1)isEqual= true}else{_data1=this.ContextMenuLastInfo.selectCell;_data2=oldLastInfo.selectCell;if(_data1&&_data2)if(Math.abs(_data1.X-_data2.X)<.1&&Math.abs(_data1.Y-_data2.Y)<.1&&Math.abs(_data1.W-_data2.W)<.1&&Math.abs(_data1.H-_data2.H)<.1)isEqual=true}break}case AscCommon.MobileTouchContextMenuType.Object:{_data1=this.ContextMenuLastInfo.objectBounds;_data2=oldLastInfo.objectBounds;if(_data1&&_data2)if(_data1.Page==_data2.Page&&Math.abs(_data1.X-_data2.X)<.1&&Math.abs(_data1.Y-_data2.Y)<.1&&Math.abs(_data1.R- _data2.R)<.1&&Math.abs(_data1.B-_data2.B)<.1)isEqual=true;break}case AscCommon.MobileTouchContextMenuType.Slide:{_data1=this.ContextMenuLastInfo.objectSlideThumbnail;_data2=oldLastInfo.objectSlideThumbnail;if(_data1&&_data2){if(_data1.Slide==_data2.Slide)isEqual=true}else isEqual=true;break}default:break}}if(isTableRuler)isEqual=false;if(this.ContextMenuLastMode==oldLasdMode&&isEqual){this.ContextMenuLastModeCounter++;this.ContextMenuLastModeCounter&=1}else this.ContextMenuLastModeCounter=0;switch(this.ContextMenuLastMode){case AscCommon.MobileTouchContextMenuType.Target:{isShowContextMenu= 1==this.ContextMenuLastModeCounter;break}case AscCommon.MobileTouchContextMenuType.Select:{if(isSelectCell)isShowContextMenu=1==this.ContextMenuLastModeCounter;else isShowContextMenu=true;break}case AscCommon.MobileTouchContextMenuType.Object:{isShowContextMenu=0==this.ContextMenuLastModeCounter;break}case AscCommon.MobileTouchContextMenuType.Slide:{isShowContextMenu=1==this.ContextMenuLastModeCounter;break}default:{isShowContextMenu=1==this.ContextMenuLastModeCounter;break}}}else{isSelectCell=this.ContextMenuLastInfo&& this.ContextMenuLastInfo.selectCell!=null?true:false;isShowContextMenu=!isSelectCell&&this.ContextMenuLastMode==AscCommon.MobileTouchContextMenuType.Select;if(this.ContextMenuLastShow||isTableRuler)switch(this.ContextMenuLastMode){case AscCommon.MobileTouchContextMenuType.Target:case AscCommon.MobileTouchContextMenuType.Select:{this.ContextMenuLastModeCounter=0;break}case AscCommon.MobileTouchContextMenuType.Object:{this.ContextMenuLastModeCounter=1;break}case AscCommon.MobileTouchContextMenuType.Slide:{this.ContextMenuLastModeCounter= 0;break}default:{break}}}if(isSelectTouch)isShowContextMenu=true;if(isGlassTouch)isShowContextMenu=true;if(this.ContextMenuLastMode>AscCommon.MobileTouchContextMenuType.None&&isShowContextMenu){this.ContextMenuLastShow=true;this.SendShowContextMenu()}else this.ContextMenuLastShow=false};CMobileTouchManagerBase.prototype.ClearContextMenu=function(){if(this.ContextMenuShowTimerId!=-1)clearTimeout(this.ContextMenuShowTimerId);this.isShowingContextMenu=false;this.Api.sendEvent("asc_onHidePopMenu")};CMobileTouchManagerBase.prototype.OnScrollAnimationEnd= function(){if(this.Api.isViewMode)return;this.CheckContextMenuTouchEnd(false)};CMobileTouchManagerBase.prototype.CheckSelectRects=function(){this.RectSelect1=null;this.RectSelect2=null;var _select=this.delegate.GetSelectionRectsBounds();if(!_select)return;this.RectSelectType=_select.Type===undefined?0:_select.Type;var _rect1=_select.Start;var _rect2=_select.End;if(!_rect1||!_rect2)return;if(0==_rect1.W&&0==_rect1.H&&_rect2.W==0&&_rect2.H==0)return;this.RectSelect1=new AscCommon._rect;this.RectSelect1.x= _rect1.X;this.RectSelect1.y=_rect1.Y;this.RectSelect1.w=_rect1.W;this.RectSelect1.h=_rect1.H;this.PageSelect1=_rect1.Page;this.RectSelect2=new AscCommon._rect;this.RectSelect2.x=_rect2.X;this.RectSelect2.y=_rect2.Y;this.RectSelect2.w=_rect2.W;this.RectSelect2.h=_rect2.H;this.PageSelect2=_rect2.Page};CMobileTouchManagerBase.prototype.CheckSelect=function(overlay){if(!this.SelectEnabled)return;this.CheckSelectRects();if(null==this.RectSelect1||null==this.RectSelect2)return;var _matrix=this.delegate.GetSelectionTransform(); var ctx=overlay.m_oContext;ctx.strokeStyle="#146FE1";ctx.fillStyle="#146FE1";var _oldGlobalAlpha=ctx.globalAlpha;ctx.globalAlpha=1;if(!_matrix||global_MatrixTransformer.IsIdentity(_matrix)){var pos1=this.delegate.ConvertCoordsToCursor(this.RectSelect1.x,this.RectSelect1.y,this.PageSelect1,false);var pos2=this.delegate.ConvertCoordsToCursor(this.RectSelect1.x,this.RectSelect1.y+this.RectSelect1.h,this.PageSelect1,false);var pos3=this.delegate.ConvertCoordsToCursor(this.RectSelect2.x+this.RectSelect2.w, this.RectSelect2.y,this.PageSelect2,false);var pos4=this.delegate.ConvertCoordsToCursor(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+this.RectSelect2.h,this.PageSelect2,false);ctx.beginPath();ctx.moveTo(pos1.X>>0,pos1.Y>>0);ctx.lineTo(pos2.X>>0,pos2.Y>>0);ctx.moveTo(pos3.X>>0,pos3.Y>>0);ctx.lineTo(pos4.X>>0,pos4.Y>>0);ctx.lineWidth=2;ctx.stroke();ctx.beginPath();overlay.AddEllipse(pos1.X,pos1.Y-5,AscCommon.MOBILE_SELECT_TRACK_ROUND/2);overlay.AddEllipse(pos4.X,pos4.Y+5,AscCommon.MOBILE_SELECT_TRACK_ROUND/ 2);ctx.fill();ctx.beginPath()}else{var _xx11=_matrix.TransformPointX(this.RectSelect1.x,this.RectSelect1.y);var _yy11=_matrix.TransformPointY(this.RectSelect1.x,this.RectSelect1.y);var _xx12=_matrix.TransformPointX(this.RectSelect1.x,this.RectSelect1.y+this.RectSelect1.h);var _yy12=_matrix.TransformPointY(this.RectSelect1.x,this.RectSelect1.y+this.RectSelect1.h);var _xx21=_matrix.TransformPointX(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y);var _yy21=_matrix.TransformPointY(this.RectSelect2.x+ this.RectSelect2.w,this.RectSelect2.y);var _xx22=_matrix.TransformPointX(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+this.RectSelect2.h);var _yy22=_matrix.TransformPointY(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+this.RectSelect2.h);var pos1=this.delegate.ConvertCoordsToCursor(_xx11,_yy11,this.PageSelect1,false);var pos2=this.delegate.ConvertCoordsToCursor(_xx12,_yy12,this.PageSelect1,false);var pos3=this.delegate.ConvertCoordsToCursor(_xx21,_yy21,this.PageSelect2,false); var pos4=this.delegate.ConvertCoordsToCursor(_xx22,_yy22,this.PageSelect2,false);ctx.beginPath();ctx.moveTo(pos1.X,pos1.Y);ctx.lineTo(pos2.X,pos2.Y);ctx.moveTo(pos3.X,pos3.Y);ctx.lineTo(pos4.X,pos4.Y);ctx.lineWidth=2;ctx.stroke();ctx.beginPath();var ex01=_matrix.TransformPointX(0,0);var ey01=_matrix.TransformPointY(0,0);var ex11=_matrix.TransformPointX(0,1);var ey11=_matrix.TransformPointY(0,1);var _len=Math.sqrt((ex11-ex01)*(ex11-ex01)+(ey11-ey01)*(ey11-ey01));if(_len==0)_len=.01;var ex=5*(ex11- ex01)/_len;var ey=5*(ey11-ey01)/_len;var _x1=pos1.X-ex>>0;var _y1=pos1.Y-ey>>0;var _x2=pos4.X+ex>>0;var _y2=pos4.Y+ey>>0;overlay.AddEllipse(_x1,_y1,AscCommon.MOBILE_SELECT_TRACK_ROUND/2);overlay.AddEllipse(_x2,_y2,AscCommon.MOBILE_SELECT_TRACK_ROUND/2);ctx.fill();ctx.beginPath()}ctx.globalAlpha=_oldGlobalAlpha};CMobileTouchManagerBase.prototype.CheckTableRules=function(overlay){if(this.Api.isViewMode||!this.TableTrackEnabled)return;var HtmlPage=this.delegate.HtmlPage;var DrawingDocument=this.delegate.DrawingDocument; var horRuler=HtmlPage.m_oHorRuler;var verRuler=HtmlPage.m_oVerRuler;var _table_outline_dr=this.delegate.GetTableDrawing();var _tableOutline=_table_outline_dr.TableOutline;if(horRuler.CurrentObjectType!=RULER_OBJECT_TYPE_TABLE||verRuler.CurrentObjectType!=RULER_OBJECT_TYPE_TABLE||!_tableOutline){this.TableMovePoint=null;this.TableHorRulerPoints=null;this.TableVerRulerPoints=null;return}if(!window.g_table_track_mobile_move.asc_complete)return;var _table_markup=horRuler.m_oTableMarkup;if(_table_markup.Rows.length== 0)return;HtmlPage.CheckShowOverlay();var _epsRects=this.TableRulersRectOffset;var _rectWidth=this.TableRulersRectSize;var ctx=overlay.m_oContext;ctx.strokeStyle="#616161";ctx.lineWidth=1;var _tableW=0;var _cols=_table_markup.Cols;for(var i=0;i<_cols.length;i++)_tableW+=_cols[i];var _mainFillStyle="rgba(223, 223, 223, 0.5)";var _drawingPage=null;if(DrawingDocument.m_arrPages)_drawingPage=DrawingDocument.m_arrPages[DrawingDocument.m_lCurrentPage].drawingPage;else _drawingPage=DrawingDocument.SlideCurrectRect; var _posMoveX=0;var _posMoveY=0;var _PageNum=_table_outline_dr.CurrentPageIndex;if(!_table_outline_dr.TableMatrix||global_MatrixTransformer.IsIdentity(_table_outline_dr.TableMatrix)){this.TableMovePoint={X:_tableOutline.X,Y:_tableOutline.Y};var pos1=DrawingDocument.ConvertCoordsToCursorWR(_tableOutline.X,_tableOutline.Y,_tableOutline.PageNum);var pos2=DrawingDocument.ConvertCoordsToCursorWR(_tableOutline.X+_tableW,_tableOutline.Y,_tableOutline.PageNum);ctx.beginPath();var TableMoveRect_x=(pos1.X>> 0)+.5-(_epsRects+_rectWidth);var TableMoveRect_y=(pos1.Y>>0)+.5-(_epsRects+_rectWidth);overlay.CheckPoint(TableMoveRect_x,TableMoveRect_y);overlay.CheckPoint(TableMoveRect_x+_rectWidth,TableMoveRect_y+_rectWidth);if(this.delegate.Name!="slide")ctx.drawImage(window.g_table_track_mobile_move,TableMoveRect_x,TableMoveRect_y,window.g_table_track_mobile_move.size,window.g_table_track_mobile_move.size);ctx.fillStyle=_mainFillStyle;overlay.AddRoundRect((pos1.X>>0)+.5,TableMoveRect_y,pos2.X-pos1.X>>0,_rectWidth, 4);ctx.fill();ctx.stroke();ctx.beginPath();var _count=_table_markup.Rows.length;var _y1=0;var _y2=0;for(var i=0;i<_count;i++){if(i==0)_y1=_table_markup.Rows[i].Y;_y2=_table_markup.Rows[i].Y;_y2+=_table_markup.Rows[i].H}var pos3=DrawingDocument.ConvertCoordsToCursorWR(_tableOutline.X,_y1,DrawingDocument.m_lCurrentPage);var pos4=DrawingDocument.ConvertCoordsToCursorWR(_tableOutline.X,_y2,DrawingDocument.m_lCurrentPage);var _ttX=(pos1.X>>0)+.5-(_epsRects+_rectWidth);ctx.fillStyle=_mainFillStyle;overlay.AddRoundRect((pos1.X>> 0)+1.5-(_epsRects+_rectWidth),(pos3.Y>>0)+.5,_rectWidth-1,pos4.Y-pos3.Y>>0,4);ctx.fill();ctx.stroke();ctx.beginPath();var dKoef=HtmlPage.m_nZoomValue*AscCommon.g_dKoef_mm_to_pix/100;var xDst=_drawingPage.left;var yDst=_drawingPage.top;var _oldY=_table_markup.Rows[0].Y+_table_markup.Rows[0].H;this.TableVerRulerPoints=[];var _rectIndex=0;var _x=pos1.X-_epsRects-_rectWidth>>0;ctx.fillStyle="#146FE1";for(var i=1;i<=_count;i++){var _newPos=i!=_count?_table_markup.Rows[i].Y:_oldY;var _p={Y:_oldY,H:_newPos- _oldY};var _y=DrawingDocument.ConvertCoordsToCursorWR(0,_oldY,_PageNum);ctx.beginPath();overlay.AddDiamond(_x+1.5+(_rectWidth>>1),_y.Y,AscCommon.MOBILE_TABLE_RULER_DIAMOND);ctx.fill();ctx.beginPath();this.TableVerRulerPoints[_rectIndex++]=_p;if(i!=_count)_oldY=_table_markup.Rows[i].Y+_table_markup.Rows[i].H}this.TableHorRulerPoints=[];_rectIndex=0;var _col=_table_markup.X;for(var i=1;i<=_cols.length;i++){_col+=_cols[i-1];var _x=_col-_table_markup.Margins[i-1].Right;var _r=_col+(i==_cols.length?0: _table_markup.Margins[i].Left);var __c=(xDst+dKoef*_col>>0)+.5;ctx.beginPath();overlay.AddDiamond(__c,TableMoveRect_y+_rectWidth/2,AscCommon.MOBILE_TABLE_RULER_DIAMOND);ctx.fill();ctx.beginPath();this.TableHorRulerPoints[_rectIndex++]={X:_x,W:_r-_x,C:_col}}ctx.beginPath();if(this.Mode==AscCommon.MobileTouchMode.TableRuler)if(0==this.TableCurrentMoveDir){var _pos=this.delegate.ConvertCoordsToCursor(this.TableCurrentMoveValue,0,_table_outline_dr.CurrentPageIndex,false);overlay.VertLine(_pos.X,true)}else{var _pos= this.delegate.ConvertCoordsToCursor(0,this.TableCurrentMoveValue,_table_outline_dr.CurrentPageIndex,false);overlay.HorLine(_pos.Y,true)}}else{var dKoef=HtmlPage.m_nZoomValue*AscCommon.g_dKoef_mm_to_pix/100;var xDst=_drawingPage.left;var yDst=_drawingPage.top;ctx.lineWidth=1/dKoef;if(overlay.IsRetina)dKoef*=AscCommon.AscBrowser.retinaPixelRatio;var _coord_transform=new AscCommon.CMatrix;_coord_transform.sx=dKoef;_coord_transform.sy=dKoef;_coord_transform.tx=xDst;_coord_transform.ty=yDst;var _diamond_size= AscCommon.MOBILE_TABLE_RULER_DIAMOND;if(overlay.IsRetina){_coord_transform.tx*=AscCommon.AscBrowser.retinaPixelRatio;_coord_transform.ty*=AscCommon.AscBrowser.retinaPixelRatio;_diamond_size*=AscCommon.AscBrowser.retinaPixelRatio}ctx.save();_coord_transform.Multiply(_table_outline_dr.TableMatrix,AscCommon.MATRIX_ORDER_PREPEND);ctx.setTransform(_coord_transform.sx,_coord_transform.shy,_coord_transform.shx,_coord_transform.sy,_coord_transform.tx,_coord_transform.ty);this.TableMovePoint={X:_tableOutline.X, Y:_tableOutline.Y};ctx.beginPath();var _rectW=_rectWidth/dKoef;var _offset=(_epsRects+_rectWidth)/dKoef;if(overlay.IsRetina){_rectW*=AscCommon.AscBrowser.retinaPixelRatio;_offset*=AscCommon.AscBrowser.retinaPixelRatio}if(this.delegate.Name!="slide")ctx.drawImage(window.g_table_track_mobile_move,this.TableMovePoint.X-_offset,this.TableMovePoint.Y-_offset,_rectW,_rectW);ctx.fillStyle=_mainFillStyle;overlay.AddRoundRectCtx(ctx,this.TableMovePoint.X,this.TableMovePoint.Y-_offset,_tableW,_rectW,5/dKoef); ctx.fill();ctx.stroke();ctx.beginPath();var _count=_table_markup.Rows.length;var _y1=0;var _y2=0;for(var i=0;i<_count;i++){if(i==0)_y1=_table_markup.Rows[i].Y;_y2=_table_markup.Rows[i].Y;_y2+=_table_markup.Rows[i].H}ctx.fillStyle=_mainFillStyle;overlay.AddRoundRectCtx(ctx,this.TableMovePoint.X-_offset,this.TableMovePoint.Y,_rectW,_y2-_y1,5/dKoef);overlay.CheckRectT(this.TableMovePoint.X,this.TableMovePoint.Y,_tableW,_y2-_y1,_coord_transform,2*(_epsRects+_rectWidth));ctx.fill();ctx.stroke();ctx.beginPath(); var _oldY=_table_markup.Rows[0].Y+_table_markup.Rows[0].H;_oldY-=_table_outline_dr.TableMatrix.ty;ctx.fillStyle="#146FE1";this.TableVerRulerPoints=[];var _rectIndex=0;var _xx=this.TableMovePoint.X-_offset;for(var i=1;i<=_count;i++){var _newPos=i!=_count?_table_markup.Rows[i].Y-_table_outline_dr.TableMatrix.ty:_oldY;var _p={Y:_oldY,H:_newPos-_oldY};var ___y=_p.Y+_p.H/2;ctx.beginPath();overlay.AddDiamond(_xx+_rectW/2,___y,_diamond_size/dKoef);ctx.fill();ctx.beginPath();this.TableVerRulerPoints[_rectIndex++]= _p;if(i!=_count){_oldY=_table_markup.Rows[i].Y+_table_markup.Rows[i].H;_oldY-=_table_outline_dr.TableMatrix.ty}}this.TableHorRulerPoints=[];_rectIndex=0;var _col=this.TableMovePoint.X;for(var i=1;i<=_cols.length;i++){_col+=_cols[i-1];var _x=_col-_table_markup.Margins[i-1].Right;var _r=_col+(i==_cols.length?0:_table_markup.Margins[i].Left);ctx.beginPath();overlay.AddDiamond(_col,this.TableMovePoint.Y-_offset+_rectW/2,_diamond_size/dKoef);ctx.fill();ctx.beginPath();this.TableHorRulerPoints[_rectIndex++]= {X:_x,W:_r-_x,C:_col}}ctx.restore();ctx.beginPath();if(this.Mode==AscCommon.MobileTouchMode.TableRuler)if(0==this.TableCurrentMoveDir){_posMoveX=_table_outline_dr.TableMatrix.TransformPointX(this.TableCurrentMoveValue,0);_posMoveY=_table_outline_dr.TableMatrix.TransformPointY(this.TableCurrentMoveValue,0);var _pos=this.delegate.ConvertCoordsToCursor(_posMoveX,_posMoveY,_table_outline_dr.CurrentPageIndex,false);overlay.VertLine(_pos.X,true)}else{_posMoveX=_table_outline_dr.TableMatrix.TransformPointX(0, this.TableCurrentMoveValue);_posMoveY=_table_outline_dr.TableMatrix.TransformPointY(0,this.TableCurrentMoveValue);var _pos=this.delegate.ConvertCoordsToCursor(_posMoveX,_posMoveY,_table_outline_dr.CurrentPageIndex,false);overlay.HorLine(_pos.Y,true)}}};CMobileTouchManagerBase.prototype.onTouchStart_renderer=function(e){AscCommon.check_MouseDownEvent(e.touches?e.touches[0]:e,true);global_mouseEvent.LockMouse();this.MoveAfterDown=false;if(e.touches&&2==e.touches.length||2==this.getPointerCount())this.Mode= AscCommon.MobileTouchMode.Zoom;switch(this.Mode){case AscCommon.MobileTouchMode.None:{this.Mode=AscCommon.MobileTouchMode.Scroll;this.DownPoint=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);this.DownPointOriginal.X=global_mouseEvent.X;this.DownPointOriginal.Y=global_mouseEvent.Y;this.iScroll._start(e);break}case AscCommon.MobileTouchMode.Scroll:{this.DownPoint=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);this.DownPointOriginal.X=global_mouseEvent.X; this.DownPointOriginal.Y=global_mouseEvent.Y;this.iScroll._start(e);break}case AscCommon.MobileTouchMode.Zoom:{this.delegate.HtmlPage.NoneRepaintPages=true;this.ZoomDistance=this.getPointerDistance(e);this.ZoomValue=this.delegate.GetZoom();break}}AscCommon.stopEvent(e);return false};CMobileTouchManagerBase.prototype.onTouchMove_renderer=function(e){AscCommon.check_MouseMoveEvent(e.touches?e.touches[0]:e);if(!this.MoveAfterDown)if(Math.abs(this.DownPointOriginal.X-global_mouseEvent.X)>this.MoveMinDist|| Math.abs(this.DownPointOriginal.Y-global_mouseEvent.Y)>this.MoveMinDist)this.MoveAfterDown=true;switch(this.Mode){case AscCommon.MobileTouchMode.Scroll:{var _offsetX=global_mouseEvent.X-this.DownPointOriginal.X;var _offsetY=global_mouseEvent.Y-this.DownPointOriginal.Y;this.iScroll._move(e);break}case AscCommon.MobileTouchMode.Zoom:{var isTouch2=e.touches&&2==e.touches.length||2==this.getPointerCount();if(!isTouch2){this.Mode=AscCommon.MobileTouchMode.None;return}var zoomCurrentDist=this.getPointerDistance(e); if(zoomCurrentDist==0)zoomCurrentDist=1;var _zoomFix=this.ZoomValue/100;var _zoomCur=_zoomFix*(zoomCurrentDist/this.ZoomDistance);_zoomCur=_zoomCur*100>>0;if(_zoomCur<this.ZoomValueMin)_zoomCur=this.ZoomValueMin;else if(_zoomCur>this.ZoomValueMax)_zoomCur=this.ZoomValueMax;this.delegate.SetZoom(_zoomCur);break}default:break}AscCommon.stopEvent(e);return false};CMobileTouchManagerBase.prototype.onTouchEnd_renderer=function(e){AscCommon.check_MouseUpEvent(e.changedTouches?e.changedTouches[0]:e);switch(this.Mode){case AscCommon.MobileTouchMode.Scroll:{this.iScroll._end(e); this.Mode=AscCommon.MobileTouchMode.None;if(!this.MoveAfterDown)this.Api.sendEvent("asc_onTapEvent",e);break}case AscCommon.MobileTouchMode.Zoom:{this.delegate.HtmlPage.NoneRepaintPages=false;this.delegate.HtmlPage.m_bIsFullRepaint=true;this.delegate.HtmlPage.OnScroll();this.Mode=AscCommon.MobileTouchMode.None;break}default:break}if(!AscCommon.AscBrowser.isAndroid)AscCommon.stopEvent(e);return false};CMobileTouchManagerBase.prototype.MoveCursorToPoint=function(isHalfHeight){var pos=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X, global_mouseEvent.Y);var old_click_count=global_mouseEvent.ClickCount;global_mouseEvent.ClickCount=1;var nearPos=this.delegate.Logic_GetNearestPos(pos.X,pos.Y,pos.Page);if(!nearPos)return;this.delegate.DrawingDocument.NeedScrollToTargetFlag=true;var y=nearPos.Y;nearPos.Paragraph.Parent.MoveCursorToNearestPos(nearPos);this.delegate.LogicDocument.Document_UpdateSelectionState();this.delegate.DrawingDocument.NeedScrollToTargetFlag=false;global_mouseEvent.ClickCount=old_click_count};CMobileTouchManagerBase.prototype.onTouchStart= function(e){AscCommon.stopEvent(e);return false};CMobileTouchManagerBase.prototype.onTouchMove=function(e){AscCommon.stopEvent(e);return false};CMobileTouchManagerBase.prototype.onTouchEnd=function(e){AscCommon.stopEvent(e);return false};CMobileTouchManagerBase.prototype.mainOnTouchStart=function(e){AscCommon.stopEvent(e);return false};CMobileTouchManagerBase.prototype.mainOnTouchMove=function(e){AscCommon.stopEvent(e);return false};CMobileTouchManagerBase.prototype.mainOnTouchEnd=function(e){AscCommon.stopEvent(e); return false};CMobileTouchManagerBase.prototype.checkPointerMultiTouchAdd=function(e){if(!this.checkPointerEvent(e))return;this.pointerTouchesCoords[e["pointerId"]]={X:e.pageX,Y:e.pageY}};CMobileTouchManagerBase.prototype.checkPointerMultiTouchRemove=function(e){if(!this.checkPointerEvent(e))return;this.pointerTouchesCoords={}};CMobileTouchManagerBase.prototype.checkPointerEvent=function(e){if(!AscCommon.AscBrowser.isIE)return false;var _type=e.type;if(_type.toLowerCase)_type=_type.toLowerCase(); if(-1==_type.indexOf("pointer"))return-1;if(undefined==e["pointerId"])return false;return true};CMobileTouchManagerBase.prototype.getPointerDistance=function(e){var isPointers=this.checkPointerEvent(e);if(e.touches&&e.touches.length>1&&!isPointers){var _x1=e.touches[0].pageX!==undefined?e.touches[0].pageX:e.touches[0].clientX;var _y1=e.touches[0].pageY!==undefined?e.touches[0].pageY:e.touches[0].clientY;var _x2=e.touches[1].pageX!==undefined?e.touches[1].pageX:e.touches[1].clientX;var _y2=e.touches[1].pageY!== undefined?e.touches[1].pageY:e.touches[1].clientY;return Math.sqrt((_x1-_x2)*(_x1-_x2)+(_y1-_y2)*(_y1-_y2))}else if(isPointers){var _touch1={X:0,Y:0};var _touch2={X:0,Y:0};var _counter=0;for(var i in this.pointerTouchesCoords){if(_counter==0)_touch1=this.pointerTouchesCoords[i];else _touch2=this.pointerTouchesCoords[i];++_counter;if(_counter>1)break}return Math.sqrt((_touch1.X-_touch2.X)*(_touch1.X-_touch2.X)+(_touch1.Y-_touch2.Y)*(_touch1.Y-_touch2.Y))}return 0};CMobileTouchManagerBase.prototype.getPointerCount= function(e){var _count=0;for(var i in this.pointerTouchesCoords)++_count;return _count};CMobileTouchManagerBase.prototype.showKeyboard=function(){if(AscCommon.g_inputContext)if(this.ContextMenuLastMode==AscCommon.MobileTouchContextMenuType.Target)AscCommon.g_inputContext.HtmlArea.focus()};CMobileTouchManagerBase.prototype.scrollTo=function(x,y){if(this.iScroll){this.iScroll.scrollTo(-x,-y);this.iScroll._execEvent("scroll")}};CMobileTouchManagerBase.prototype.scrollBy=function(x,y){if(this.iScroll){this.iScroll.scrollBy(-x, -y);this.iScroll._execEvent("scroll")}};AscCommon.CMobileDelegateSimple=CMobileDelegateSimple;AscCommon.CMobileTouchManagerBase=CMobileTouchManagerBase;AscCommon.CMobileDelegateEditor=CMobileDelegateEditor})(window);"use strict";(function(window,undefined){var prot;var g_fontApplication=AscFonts.g_fontApplication;var CFont=AscFonts.CFont;var AscBrowser=AscCommon.AscBrowser;var align_Right=AscCommon.align_Right;var align_Left=AscCommon.align_Left;var align_Center=AscCommon.align_Center;var align_Justify= AscCommon.align_Justify;var g_oDocumentUrls=AscCommon.g_oDocumentUrls;var History=AscCommon.History;var pptx_content_loader=AscCommon.pptx_content_loader;var pptx_content_writer=AscCommon.pptx_content_writer;var g_dKoef_pix_to_mm=AscCommon.g_dKoef_pix_to_mm;var g_dKoef_mm_to_pix=AscCommon.g_dKoef_mm_to_pix;var CShape=AscFormat.CShape;var CGraphicFrame=AscFormat.CGraphicFrame;var c_oAscError=Asc.c_oAscError;var c_oAscShdClear=Asc.c_oAscShdClear;var c_oAscShdNil=Asc.c_oAscShdNil;var c_oAscXAlign=Asc.c_oAscXAlign; function CDocumentReaderMode(){this.DefaultFontSize=12;this.CorrectDefaultFontSize=function(size){if(size<6)return;this.DefaultFontSize=size};this.CorrectFontSize=function(size){var dRes=size/this.DefaultFontSize;dRes=(1+dRes)/2;dRes=100*dRes>>0;dRes/=100;return""+dRes+"em"}}function GetObjectsForImageDownload(aBuilderImages,bSameDoc){var oMapImages={},aBuilderImagesByUrl=[],aUrls=[];for(var i=0;i<aBuilderImages.length;++i)if(!g_oDocumentUrls.getImageLocal(aBuilderImages[i].Url)){if(!Array.isArray(oMapImages[aBuilderImages[i].Url]))oMapImages[aBuilderImages[i].Url]= [];oMapImages[aBuilderImages[i].Url].push(aBuilderImages[i])}for(var key in oMapImages)if(oMapImages.hasOwnProperty(key)){aUrls.push(key);aBuilderImagesByUrl.push(oMapImages[key])}if(bSameDoc!==true)for(var i=0;i<aBuilderImages.length;++i){var oBuilderImage=aBuilderImages[i];if(!g_oDocumentUrls.getImageLocal(oBuilderImage.Url))if(oBuilderImage.AdditionalUrls)for(var j=0;j<oBuilderImage.AdditionalUrls.length;++j)aUrls.push(oBuilderImage.AdditionalUrls[j])}return{aUrls:aUrls,aBuilderImagesByUrl:aBuilderImagesByUrl}} function ResetNewUrls(data,aUrls,aBuilderImagesByUrl,oImageMap){for(var i=0,length=Math.min(data.length,aBuilderImagesByUrl.length);i<length;++i){var elem=data[i];if(null!=elem.url){var name=g_oDocumentUrls.imagePath2Local(elem.path);var aImageElem=aBuilderImagesByUrl[i];if(Array.isArray(aImageElem))for(var j=0;j<aImageElem.length;++j){var imageElem=aImageElem[j];if(null!=imageElem)imageElem.SetUrl(name)}oImageMap[i]=name}else oImageMap[i]=aUrls[i]}}var PasteElementsId={copyPasteUseBinary:true,g_bIsDocumentCopyPaste:true}; function CopyElement(sName,bText){this.sName=sName;this.oAttributes={};this.aChildren=[];this.bText=bText}CopyElement.prototype.addChild=function(child){if(child.bText&&this.aChildren.length>0&&this.aChildren[this.aChildren.length-1].bText)this.aChildren[this.aChildren.length-1].sName+=child.sName;else this.aChildren.push(child)};CopyElement.prototype.wrapChild=function(child){for(var i=0;i<this.aChildren.length;++i)child.addChild(this.aChildren[i]);this.aChildren=[child]};CopyElement.prototype.isEmptyChild= function(){return 0===this.aChildren.length};CopyElement.prototype.getInnerText=function(){if(this.bText)return this.sName;else{var sRes="";for(var i=0;i<this.aChildren.length;++i)sRes+=this.aChildren[i].getInnerText();return sRes}};CopyElement.prototype.getInnerHtml=function(){if(this.bText)return this.sName;else{var sRes="";for(var i=0;i<this.aChildren.length;++i)sRes+=this.aChildren[i].getOuterHtml();return sRes}};CopyElement.prototype.getOuterHtml=function(){if(this.bText)return this.sName;else{var sRes= "<"+this.sName;for(var i in this.oAttributes)sRes+=" "+i+'="'+this.oAttributes[i]+'"';var sInner=this.getInnerHtml();if(sInner.length>0)sRes+=">"+sInner+"</"+this.sName+">";else sRes+="/>";return sRes}};function CopyProcessor(api,onlyBinaryCopy){this.api=api;this.oDocument=api.WordControl.m_oLogicDocument;this.onlyBinaryCopy=onlyBinaryCopy;this.oBinaryFileWriter=new AscCommonWord.BinaryFileWriter(this.oDocument);this.oPresentationWriter=new AscCommon.CBinaryFileWriter;this.oPresentationWriter.Start_UseFullUrl(); if(this.api.ThemeLoader)this.oPresentationWriter.Start_UseDocumentOrigin(this.api.ThemeLoader.ThemesUrlAbs);this.oRoot=new CopyElement("root")}CopyProcessor.prototype={getInnerHtml:function(){return this.oRoot.getInnerHtml()},getInnerText:function(){return this.oRoot.getInnerText()},RGBToCSS:function(rgb,unifill){if(null==rgb&&null!=unifill){unifill.check(this.oDocument.Get_Theme(),this.oDocument.Get_ColorMap());var RGBA=unifill.getRGBAColor();rgb=new CDocumentColor(RGBA.R,RGBA.G,RGBA.B)}var sResult= "#";var sR=rgb.r.toString(16);if(sR.length===1)sR="0"+sR;var sG=rgb.g.toString(16);if(sG.length===1)sG="0"+sG;var sB=rgb.b.toString(16);if(sB.length===1)sB="0"+sB;return"#"+sR+sG+sB},Commit_pPr:function(Item,Para){var apPr=[];var Def_pPr=this.oDocument.Styles?this.oDocument.Styles.Default.ParaPr:null;var Item_pPr=Item.CompiledPr&&Item.CompiledPr.Pr&&Item.CompiledPr.Pr.ParaPr?Item.CompiledPr.Pr.ParaPr:Item.Pr;if(Item_pPr&&Def_pPr){if(Def_pPr.Ind.Left!==Item_pPr.Ind.Left)apPr.push("margin-left:"+Item_pPr.Ind.Left* g_dKoef_mm_to_pt+"pt");if(Def_pPr.Ind.Right!==Item_pPr.Ind.Right)apPr.push("margin-right:"+Item_pPr.Ind.Right*g_dKoef_mm_to_pt+"pt");if(Def_pPr.Ind.FirstLine!==Item_pPr.Ind.FirstLine)apPr.push("text-indent:"+Item_pPr.Ind.FirstLine*g_dKoef_mm_to_pt+"pt");if(Def_pPr.Jc!==Item_pPr.Jc)switch(Item_pPr.Jc){case align_Left:apPr.push("text-align:left");break;case align_Center:apPr.push("text-align:center");break;case align_Right:apPr.push("text-align:right");break;case align_Justify:apPr.push("text-align:justify"); break}if(Def_pPr.KeepLines!==Item_pPr.KeepLines||Def_pPr.WidowControl!==Item_pPr.WidowControl)if(Def_pPr.KeepLines!==Item_pPr.KeepLines&&Def_pPr.WidowControl!==Item_pPr.WidowControl)apPr.push("mso-pagination:none lines-together");else if(Def_pPr.KeepLines!==Item_pPr.KeepLines)apPr.push("mso-pagination:widow-orphan lines-together");else if(Def_pPr.WidowControl!==Item_pPr.WidowControl)apPr.push("mso-pagination:none");if(Def_pPr.KeepNext!==Item_pPr.KeepNext)apPr.push("page-break-after:avoid");if(Def_pPr.PageBreakBefore!== Item_pPr.PageBreakBefore)apPr.push("page-break-before:always");if(Def_pPr.Spacing.Line!==Item_pPr.Spacing.Line)if(Asc.linerule_AtLeast===Item_pPr.Spacing.LineRule)apPr.push("line-height:"+Item_pPr.Spacing.Line*g_dKoef_mm_to_pt+"pt");else if(Asc.linerule_Auto===Item_pPr.Spacing.LineRule)if(1===Item_pPr.Spacing.Line)apPr.push("line-height:normal");else apPr.push("line-height:"+parseInt(Item_pPr.Spacing.Line*100)+"%");if(Def_pPr.Spacing.LineRule!==Item_pPr.Spacing.LineRule)if(Asc.linerule_Exact===Item_pPr.Spacing.LineRule)apPr.push("mso-line-height-rule:exactly"); apPr.push("margin-top:"+Item_pPr.Spacing.Before*g_dKoef_mm_to_pt+"pt");apPr.push("margin-bottom:"+Item_pPr.Spacing.After*g_dKoef_mm_to_pt+"pt");if(null!=Item_pPr.Shd&&c_oAscShdNil!==Item_pPr.Shd.Value&&(null!=Item_pPr.Shd.Color||null!=Item_pPr.Shd.Unifill))apPr.push("background-color:"+this.RGBToCSS(Item_pPr.Shd.Color,Item_pPr.Shd.Unifill));if(Item_pPr.Tabs.Get_Count()>0){var sTabs="";for(var i=0,length=Item_pPr.Tabs.Get_Count();i<length;i++){if(0!==i)sTabs+=" ";sTabs+=Item_pPr.Tabs.Get(i).Pos/10+ "cm"}apPr.push("tab-stops:"+sTabs)}if(null!=Item_pPr.Brd){apPr.push("border:none");var borderStyle=this._BordersToStyle(Item_pPr.Brd,false,true,"mso-","-alt");if(null!=borderStyle){var nborderStyleLength=borderStyle.length;if(nborderStyleLength>0)borderStyle=borderStyle.substring(0,nborderStyleLength-1);apPr.push(borderStyle)}}}if(apPr.length>0)Para.oAttributes["style"]=apPr.join(";")},parse_para_TextPr:function(Value,oTarget){var aProp=[];if(null!=Value.RFonts){var sFontName=null;if(null!=Value.RFonts.Ascii)sFontName= Value.RFonts.Ascii.Name;else if(null!=Value.RFonts.HAnsi)sFontName=Value.RFonts.HAnsi.Name;else if(null!=Value.RFonts.EastAsia)sFontName=Value.RFonts.EastAsia.Name;else if(null!=Value.RFonts.CS)sFontName=Value.RFonts.CS.Name;if(null!=sFontName){var oTheme=this.oDocument&&this.oDocument.Get_Theme&&this.oDocument.Get_Theme();if(oTheme&&oTheme.themeElements&&oTheme.themeElements.fontScheme)sFontName=oTheme.themeElements.fontScheme.checkFont(sFontName);aProp.push("font-family:"+"'"+CopyPasteCorrectString(sFontName)+ "'")}}if(null!=Value.FontSize)if(!this.api.DocumentReaderMode)aProp.push("font-size:"+Value.FontSize+"pt");else aProp.push("font-size:"+this.api.DocumentReaderMode.CorrectFontSize(Value.FontSize));if(true==Value.Bold)oTarget.wrapChild(new CopyElement("b"));if(true==Value.Italic)oTarget.wrapChild(new CopyElement("i"));if(true==Value.Underline)oTarget.wrapChild(new CopyElement("u"));if(true==Value.Strikeout)oTarget.wrapChild(new CopyElement("s"));if(true==Value.DStrikeout)oTarget.wrapChild(new CopyElement("s")); if(null!=Value.Shd&&c_oAscShdNil!==Value.Shd.Value&&(null!=Value.Shd.Color||null!=Value.Shd.Unifill))aProp.push("background-color:"+this.RGBToCSS(Value.Shd.Color,Value.Shd.Unifill));else if(null!=Value.HighLight&&highlight_None!==Value.HighLight)aProp.push("background-color:"+this.RGBToCSS(Value.HighLight,null));if(null!=Value.Color||null!=Value.Unifill){var color;if(null!=Value.Unifill)color=this.RGBToCSS(null,Value.Unifill);else color=this.RGBToCSS(Value.Color,Value.Unifill);aProp.push("color:"+ color);aProp.push("mso-style-textfill-fill-color:"+color)}if(null!=Value.VertAlign)if(AscCommon.vertalign_SuperScript===Value.VertAlign)aProp.push("vertical-align:super");else if(AscCommon.vertalign_SubScript===Value.VertAlign)aProp.push("vertical-align:sub");if(aProp.length>0)oTarget.oAttributes["style"]=aProp.join(";")},ParseItem:function(ParaItem,oTarget,nextParaItem,lengthContent){switch(ParaItem.Type){case para_Text:var sValue=AscCommon.encodeSurrogateChar(ParaItem.Value);if(sValue)oTarget.addChild(new CopyElement(CopyPasteCorrectString(sValue), true));break;case para_Space:if(nextParaItem&&nextParaItem.Type===para_Space||lengthContent===1)oTarget.addChild(new CopyElement(" ",true));else oTarget.addChild(new CopyElement(" ",true));break;case para_Tab:var oSpan=new CopyElement("span");oSpan.oAttributes["style"]="white-space:pre;";oSpan.oAttributes["style"]="mso-tab-count:1;";oSpan.addChild(new CopyElement(String.fromCharCode(9),true));oTarget.addChild(oSpan);break;case para_NewLine:var oBr=new CopyElement("br");if(break_Page===ParaItem.BreakType){oBr.oAttributes["clear"]= "all";oBr.oAttributes["style"]="mso-special-character:line-break;page-break-before:always;"}else oBr.oAttributes["style"]="mso-special-character:line-break;";oTarget.addChild(oBr);var oSpan=new CopyElement("span");oSpan.addChild(new CopyElement(" ",true));oTarget.addChild(oSpan);break;case para_Drawing:var oGraphicObj=ParaItem.GraphicObj;var sSrc=oGraphicObj.getBase64Img();if(sSrc.length>0){var _h,_w;if(oGraphicObj.cachedPixH)_h=oGraphicObj.cachedPixH;else _h=ParaItem.Extent.H*g_dKoef_mm_to_pix; if(oGraphicObj.cachedPixW)_w=oGraphicObj.cachedPixW;else _w=ParaItem.Extent.W*g_dKoef_mm_to_pix;var oImg=new CopyElement("img");oImg.oAttributes["style"]="max-width:100%;";oImg.oAttributes["width"]=Math.round(_w);oImg.oAttributes["height"]=Math.round(_h);oImg.oAttributes["src"]=sSrc;oTarget.addChild(oImg);break}break;case para_PageNum:if(null!=ParaItem.String&&"string"===typeof ParaItem.String)oTarget.addChild(new CopyElement(CopyPasteCorrectString(ParaItem.String),true));break}},CopyRun:function(Item, oTarget){for(var i=0;i<Item.Content.length;i++)this.ParseItem(Item.Content[i],oTarget,Item.Content[i+1],Item.Content.length)},CopyRunContent:function(Container,oTarget,bOmitHyperlink){for(var i=0;i<Container.Content.length;i++){var item=Container.Content[i];if(para_Run===item.Type){var oSpan=new CopyElement("span");this.CopyRun(item,oSpan);if(!oSpan.isEmptyChild()){this.parse_para_TextPr(item.Get_CompiledTextPr(),oSpan);oTarget.addChild(oSpan)}}else if(para_Hyperlink===item.Type)if(!bOmitHyperlink){var oHyperlink= new CopyElement("a");var sValue=item.GetValue();var sToolTip=item.GetToolTip();oHyperlink.oAttributes["href"]=CopyPasteCorrectString(sValue);oHyperlink.oAttributes["title"]=CopyPasteCorrectString(sToolTip);this.CopyRunContent(item,oHyperlink,true);oTarget.addChild(oHyperlink)}else this.CopyRunContent(item,oTarget,true);else if(para_Math===item.Type){var sSrc=item.MathToImageConverter();if(null!=sSrc&&null!=sSrc.ImageUrl){var oImg=new CopyElement("img");if(sSrc.w_px>0)oImg.oAttributes["width"]=sSrc.w_px; if(sSrc.h_px>0)oImg.oAttributes["height"]=sSrc.h_px;oImg.oAttributes["src"]=sSrc.ImageUrl;oTarget.addChild(oImg)}}else if(para_InlineLevelSdt===item.Type)this.CopyRunContent(item,oTarget);else if(para_Field===item.Type)this.CopyRunContent(item,oTarget)}},CopyParagraph:function(oDomTarget,Item,selectedAll){var oDocument=this.oDocument;var Para=null;var styleId=Item.Style_Get();if(styleId){var styleName=oDocument.Styles.Get_Name(styleId).toLowerCase();if(0===styleName.indexOf("heading")){var nLevel= parseInt(styleName.substring("heading".length));if(1<=nLevel&&nLevel<=6)Para=new CopyElement("h"+nLevel)}}if(null==Para)Para=new CopyElement("p");var oNumPr;var bIsNullNumPr=false;if(PasteElementsId.g_bIsDocumentCopyPaste){oNumPr=Item.GetNumPr();bIsNullNumPr=null==oNumPr||0==oNumPr.NumId}else{oNumPr=Item.PresentationPr.Bullet;bIsNullNumPr=0==oNumPr.m_nType}var bBullet=false;var sListStyle="";if(!bIsNullNumPr)if(PasteElementsId.g_bIsDocumentCopyPaste){var oNum=this.oDocument.GetNumbering().GetNum(oNumPr.NumId); if(oNum){var oNumberingLvl=oNum.GetLvl(oNumPr.Lvl);if(oNumberingLvl)switch(oNumberingLvl.GetFormat()){case Asc.c_oAscNumberingFormat.Decimal:sListStyle="decimal";break;case Asc.c_oAscNumberingFormat.LowerRoman:sListStyle="lower-roman";break;case Asc.c_oAscNumberingFormat.UpperRoman:sListStyle="upper-roman";break;case Asc.c_oAscNumberingFormat.LowerLetter:sListStyle="lower-alpha";break;case Asc.c_oAscNumberingFormat.UpperLetter:sListStyle="upper-alpha";break;default:sListStyle="disc";bBullet=true; break}}}else{var _presentation_bullet=Item.PresentationPr.Bullet;switch(_presentation_bullet.m_nType){case numbering_presentationnumfrmt_ArabicParenBoth:case numbering_presentationnumfrmt_ArabicParenR:case numbering_presentationnumfrmt_ArabicPeriod:case numbering_presentationnumfrmt_ArabicPlain:{sListStyle="decimal";break}case numbering_presentationnumfrmt_RomanLcParenBoth:case numbering_presentationnumfrmt_RomanLcParenR:case numbering_presentationnumfrmt_RomanLcPeriod:{sListStyle="lower-roman";break}case numbering_presentationnumfrmt_RomanUcParenBoth:case numbering_presentationnumfrmt_RomanUcParenR:case numbering_presentationnumfrmt_RomanUcPeriod:{sListStyle= "upper-roman";break}case numbering_presentationnumfrmt_AlphaLcParenBoth:case numbering_presentationnumfrmt_AlphaLcParenR:case numbering_presentationnumfrmt_AlphaLcPeriod:{sListStyle="lower-alpha";break}case numbering_presentationnumfrmt_AlphaUcParenR:case numbering_presentationnumfrmt_AlphaUcPeriod:case numbering_presentationnumfrmt_AlphaUcParenBoth:{sListStyle="upper-alpha";break}default:sListStyle="disc";bBullet=true;break}}this.Commit_pPr(Item,Para);if(false===selectedAll)this.CopyRunContent(Item, oDomTarget,false);else{this.CopyRunContent(Item,Para,false);if(Para.isEmptyChild())Para.addChild(new CopyElement(" ",true));if(bIsNullNumPr)oDomTarget.addChild(Para);else{var Li=new CopyElement("li");Li.oAttributes["style"]="list-style-type: "+sListStyle;Li.addChild(Para);var oTargetList=null;if(oDomTarget.aChildren.length>0){var oPrevElem=oDomTarget.aChildren[oDomTarget.aChildren.length-1];if(bBullet&&"ul"===oPrevElem.sName||!bBullet&&"ol"===oPrevElem.sName)oTargetList=oPrevElem}if(null==oTargetList){if(bBullet)oTargetList= new CopyElement("ul");else oTargetList=new CopyElement("ol");oTargetList.oAttributes["style"]="padding-left:40px";oDomTarget.addChild(oTargetList)}oTargetList.addChild(Li)}}},_BorderToStyle:function(border,name){var res="";if(border_None===border.Value)res+=name+":none;";else{var size=.5;var color=border.Color;var unifill=border.Unifill;if(null!=border.Size)size=border.Size*g_dKoef_mm_to_pt;if(null==color)color={r:0,g:0,b:0};res+=name+":"+size+"pt solid "+this.RGBToCSS(color,unifill)+";"}return res}, _MarginToStyle:function(margins,styleName){var res="";var nMarginLeft=1.9;var nMarginTop=0;var nMarginRight=1.9;var nMarginBottom=0;if(null!=margins.Left&&tblwidth_Mm===margins.Left.Type&&null!=margins.Left.W)nMarginLeft=margins.Left.W;if(null!=margins.Top&&tblwidth_Mm===margins.Top.Type&&null!=margins.Top.W)nMarginTop=margins.Top.W;if(null!=margins.Right&&tblwidth_Mm===margins.Right.Type&&null!=margins.Right.W)nMarginRight=margins.Right.W;if(null!=margins.Bottom&&tblwidth_Mm===margins.Bottom.Type&& null!=margins.Bottom.W)nMarginBottom=margins.Bottom.W;res=styleName+":"+nMarginTop*g_dKoef_mm_to_pt+"pt "+nMarginRight*g_dKoef_mm_to_pt+"pt "+nMarginBottom*g_dKoef_mm_to_pt+"pt "+nMarginLeft*g_dKoef_mm_to_pt+"pt;";return res},_BordersToStyle:function(borders,bUseInner,bUseBetween,mso,alt){var res="";if(null==mso)mso="";if(null==alt)alt="";if(null!=borders.Left)res+=this._BorderToStyle(borders.Left,mso+"border-left"+alt);if(null!=borders.Top)res+=this._BorderToStyle(borders.Top,mso+"border-top"+alt); if(null!=borders.Right)res+=this._BorderToStyle(borders.Right,mso+"border-right"+alt);if(null!=borders.Bottom)res+=this._BorderToStyle(borders.Bottom,mso+"border-bottom"+alt);if(bUseInner){if(null!=borders.InsideV)res+=this._BorderToStyle(borders.InsideV,"mso-border-insidev");if(null!=borders.InsideH)res+=this._BorderToStyle(borders.InsideH,"mso-border-insideh")}if(bUseBetween)if(null!=borders.Between)res+=this._BorderToStyle(borders.Between,"mso-border-between");return res},_MergeProp:function(elem1, elem2){if(!elem1||!elem2)return;var p,v;for(p in elem2)if(elem2.hasOwnProperty(p)&&!elem1.hasOwnProperty(p)){v=elem2[p];if(null!=v)elem1[p]=v}},CopyCell:function(tr,cell,tablePr,width,rowspan){var tc=new CopyElement("td");var tcStyle="";if(width>0){tc.oAttributes["width"]=Math.round(width*g_dKoef_mm_to_pix);tcStyle+="width:"+width*g_dKoef_mm_to_pt+"pt;"}if(rowspan>1)tc.oAttributes["rowspan"]=rowspan;var cellPr=null;var tablePr=null;if(!PasteElementsId.g_bIsDocumentCopyPaste&&editor.WordControl.m_oLogicDocument&& null!=cell.CompiledPr&&null!=cell.CompiledPr.Pr){var presentation=editor.WordControl.m_oLogicDocument;var curSlide=presentation.Slides[presentation.CurPage];if(presentation&&curSlide&&curSlide.Layout&&curSlide.Layout.Master&&curSlide.Layout.Master.Theme)AscFormat.checkTableCellPr(cell.CompiledPr.Pr,curSlide,curSlide.Layout,curSlide.Layout.Master,curSlide.Layout.Master.Theme)}if(null!=cell.CompiledPr&&null!=cell.CompiledPr.Pr){cellPr=cell.CompiledPr.Pr;if(null!=cellPr.GridSpan&&cellPr.GridSpan>1)tc.oAttributes["colspan"]= cellPr.GridSpan}if(null!=cellPr&&null!=cellPr.Shd){if(c_oAscShdNil!==cellPr.Shd.Value&&(null!=cellPr.Shd.Color||null!=cellPr.Shd.Unifill))tcStyle+="background-color:"+this.RGBToCSS(cellPr.Shd.Color,cellPr.Shd.Unifill)+";"}else if(null!=tablePr&&null!=tablePr.Shd)if(c_oAscShdNil!==tablePr.Shd.Value&&(null!=tablePr.Shd.Color||null!=tablePr.Shd.Unifill))tcStyle+="background-color:"+this.RGBToCSS(tablePr.Shd.Color,tablePr.Shd.Unifill)+";";var oCellMar={};if(null!=cellPr&&null!=cellPr.TableCellMar)this._MergeProp(oCellMar, cellPr.TableCellMar);if(null!=tablePr&&null!=tablePr.TableCellMar)this._MergeProp(oCellMar,tablePr.TableCellMar);tcStyle+=this._MarginToStyle(oCellMar,"padding");var oCellBorder=cell.Get_Borders();tcStyle+=this._BordersToStyle(oCellBorder,false,false);if(""!=tcStyle)tc.oAttributes["style"]=tcStyle;this.CopyDocument2(tc,cell.Content);tr.addChild(tc)},CopyRow:function(oDomTarget,table,nCurRow,elems,nMaxRow){var row=table.Content[nCurRow];if(null==elems)elems={gridStart:0,gridEnd:table.TableGrid.length- 1,indexStart:null,indexEnd:null,after:null,before:null,cells:row.Content};var tr=new CopyElement("tr");var gridSum=table.TableSumGrid;var trStyle="";var nGridBefore=0;var rowPr=null;var CompiledPr=row.Get_CompiledPr();if(null!=CompiledPr)rowPr=CompiledPr;if(null!=rowPr){if(null==elems.before&&null!=rowPr.GridBefore&&rowPr.GridBefore>0){elems.before=rowPr.GridBefore;elems.gridStart+=rowPr.GridBefore}if(null==elems.after&&null!=rowPr.GridAfter&&rowPr.GridAfter>0){elems.after=rowPr.GridAfter;elems.gridEnd-= rowPr.GridAfter}if(null!=rowPr.Height&&Asc.linerule_Auto!=rowPr.Height.HRule&&null!=rowPr.Height.Value)trStyle+="height:"+rowPr.Height.Value*g_dKoef_mm_to_pt+"pt;"}if(null!=elems.before)if(elems.before>0){nGridBefore=elems.before;var nWBefore=gridSum[elems.gridStart-1]-gridSum[elems.gridStart-nGridBefore-1];trStyle+="mso-row-margin-left:"+nWBefore*g_dKoef_mm_to_pt+"pt;";var oNewTd=new CopyElement("td");oNewTd.oAttributes["style"]="mso-cell-special:placeholder;border:none;padding:0cm 0cm 0cm 0cm"; oNewTd.oAttributes["width"]=Math.round(nWBefore*g_dKoef_mm_to_pix);if(nGridBefore>1)oNewTd.oAttributes["colspan"]=nGridBefore;var oNewP=new CopyElement("p");oNewP.oAttributes["style"]="margin:0cm";oNewP.addChild(new CopyElement(" ",true));oNewTd.addChild(oNewP);tr.addChild(oNewTd)}var tablePr=null;var compiledTablePr=table.Get_CompiledPr();if(null!=compiledTablePr&&null!=compiledTablePr.TablePr)tablePr=compiledTablePr.TablePr;for(var i in elems.cells){var cell=row.Content[i];if(vmerge_Continue!== cell.GetVMerge()){var StartGridCol=cell.Metrics.StartGridCol;var GridSpan=cell.Get_GridSpan();var width=gridSum[StartGridCol+GridSpan-1]-gridSum[StartGridCol-1];var nRowSpan=table.Internal_GetVertMergeCount(nCurRow,StartGridCol,GridSpan);if(nCurRow+nRowSpan-1>nMaxRow){nRowSpan=nMaxRow-nCurRow+1;if(nRowSpan<=0)nRowSpan=1}this.CopyCell(tr,cell,tablePr,width,nRowSpan)}}if(null!=elems.after)if(elems.after>0){var nGridAfter=elems.after;var nWAfter=gridSum[elems.gridEnd+nGridAfter]-gridSum[elems.gridEnd]; trStyle+="mso-row-margin-right:"+nWAfter*g_dKoef_mm_to_pt+"pt;";var oNewTd=new CopyElement("td");oNewTd.oAttributes["style"]="mso-cell-special:placeholder;border:none;padding:0cm 0cm 0cm 0cm";oNewTd.oAttributes["width"]=Math.round(nWAfter*g_dKoef_mm_to_pix);if(nGridAfter>1)oNewTd.oAttributes["colspan"]=nGridAfter;var oNewP=new CopyElement("p");oNewP.oAttributes["style"]="margin:0cm";oNewP.addChild(new CopyElement(" ",true));oNewTd.addChild(oNewP);tr.addChild(oNewTd)}if(""!=trStyle)tr.oAttributes["style"]= trStyle;oDomTarget.addChild(tr)},CopyTable:function(oDomTarget,table,aRowElems){var DomTable=new CopyElement("table");var compiledPr=table.Get_CompiledPr();var Pr=null;if(compiledPr&&null!=compiledPr.TablePr)Pr=compiledPr.TablePr;var tblStyle="";var bBorder=false;if(null!=Pr){var align="";if(true!=table.Inline&&null!=table.PositionH){var PositionH=table.PositionH;if(true===PositionH.Align)switch(PositionH.Value){case c_oAscXAlign.Outside:case c_oAscXAlign.Right:align="right";break;case c_oAscXAlign.Center:align= "center";break}else if(table.TableSumGrid){var TableWidth=table.TableSumGrid[table.TableSumGrid.length-1];var nLeft=PositionH.Value;var nRight=nLeft+TableWidth;var nFromLeft=Math.abs(nLeft-X_Left_Margin);var nFromCenter=Math.abs((Page_Width-X_Right_Margin+X_Left_Margin)/2-(nLeft+nRight)/2);var nFromRight=Math.abs(Page_Width-nRight-X_Right_Margin);if(nFromRight<nFromLeft||nFromCenter<nFromLeft)if(nFromRight<nFromCenter)align="right";else align="center"}}else if(null!=Pr.Jc)switch(Pr.Jc){case align_Center:align= "center";break;case align_Right:align="right";break}if(""!=align)DomTable.oAttributes["align"]=align;if(null!=Pr.TableInd)tblStyle+="margin-left:"+Pr.TableInd*g_dKoef_mm_to_pt+"pt;";if(null!=Pr.Shd&&c_oAscShdNil!==Pr.Shd.Value&&(null!=Pr.Shd.Color||null!=Pr.Shd.Unifill))tblStyle+="background:"+this.RGBToCSS(Pr.Shd.Color,Pr.Shd.Unifill)+";";if(null!=Pr.TableCellMar)tblStyle+=this._MarginToStyle(Pr.TableCellMar,"mso-padding-alt");if(null!=Pr.TableBorders)tblStyle+=this._BordersToStyle(Pr.TableBorders, true,false)}var bAddSpacing=false;if(table.Content.length>0){var firstRow=table.Content[0];var rowPr=firstRow.Get_CompiledPr();if(null!=rowPr&&null!=rowPr.TableCellSpacing){bAddSpacing=true;var cellSpacingMM=rowPr.TableCellSpacing;tblStyle+="mso-cellspacing:"+cellSpacingMM*g_dKoef_mm_to_pt+"pt;";DomTable.oAttributes["cellspacing"]=Math.round(cellSpacingMM*g_dKoef_mm_to_pix)}}if(!bAddSpacing)DomTable.oAttributes["cellspacing"]=0;DomTable.oAttributes["border"]=false==bBorder?0:1;DomTable.oAttributes["cellpadding"]= 0;if(""!=tblStyle)DomTable.oAttributes["style"]=tblStyle;table.Recalculate_Grid();if(null==aRowElems)for(var i=0,length=table.Content.length;i<length;i++)this.CopyRow(DomTable,table,i,null,table.Content.length-1);else{var nMaxRow=0;for(var i=0,length=aRowElems.length;i<length;++i){var elem=aRowElems[i];if(elem.row>nMaxRow)nMaxRow=elem.row}for(var i=0,length=aRowElems.length;i<length;++i){var elem=aRowElems[i];this.CopyRow(DomTable,table,elem.row,elem,nMaxRow)}}oDomTarget.addChild(DomTable)},CopyDocument2:function(oDomTarget, oDocument,elementsContent,dNotGetBinary){if(PasteElementsId.g_bIsDocumentCopyPaste){if(!elementsContent&&oDocument&&oDocument.Content)elementsContent=oDocument.Content;for(var Index=0;Index<elementsContent.length;Index++){var Item;if(elementsContent[Index].Element)Item=elementsContent[Index].Element;else Item=elementsContent[Index];if(type_Table===Item.GetType()){this.oBinaryFileWriter.copyParams.bLockCopyElems++;if(!this.onlyBinaryCopy)this.CopyTable(oDomTarget,Item,null);this.oBinaryFileWriter.copyParams.bLockCopyElems--; if(!dNotGetBinary)this.oBinaryFileWriter.CopyTable(Item,null)}else if(type_Paragraph===Item.GetType()){var SelectedAll=Index===elementsContent.length-1?elementsContent[Index].SelectedAll:true;if(!dNotGetBinary)this.oBinaryFileWriter.CopyParagraph(Item,SelectedAll);if(!this.onlyBinaryCopy)this.CopyParagraph(oDomTarget,Item,SelectedAll)}else if(type_BlockLevelSdt===Item.GetType()){this.oBinaryFileWriter.copyParams.bLockCopyElems++;if(!this.onlyBinaryCopy)this.CopyDocument2(oDomTarget,oDocument,Item.Content.Content, true);this.oBinaryFileWriter.copyParams.bLockCopyElems--;if(!dNotGetBinary)this.oBinaryFileWriter.CopySdt(Item)}}}else this.copyPresentation2(oDomTarget,oDocument,elementsContent)},copyPresentation2:function(oDomTarget,oDocument,elementsContent){var presentation=this.oDocument;if(elementsContent&&elementsContent.length){if(elementsContent[0].DocContent||elementsContent[0].Drawings&&elementsContent[0].Drawings.length||elementsContent[0].SlideObjects&&elementsContent[0].SlideObjects.length){var themeName= elementsContent[0].ThemeName?elementsContent[0].ThemeName:"";this.oPresentationWriter.WriteString2(this.api.documentId);this.oPresentationWriter.WriteString2(themeName);this.oPresentationWriter.WriteDouble(presentation.Width);this.oPresentationWriter.WriteDouble(presentation.Height);this.oPresentationWriter.WriteBool(true)}this.oPresentationWriter.WriteULong(elementsContent.length);for(var i=0;i<elementsContent.length;i++)if(i===0)this.copyPresentationContent(elementsContent[i],oDomTarget);else this.copyPresentationContent(elementsContent[i])}else this.copyPresentationContent(oDocument, oDomTarget)},copyPresentationContent:function(elementsContent,oDomTarget){if(elementsContent instanceof PresentationSelectedContent)this._writePresentationSelectedContent(elementsContent,oDomTarget);else if(elementsContent&&elementsContent.Content&&elementsContent.Content.length)for(var Index=0;Index<elementsContent.Content.length;Index++){var Item=elementsContent.Content[Index];if(type_Table===Item.GetType())this.CopyTable(oDomTarget,Item,null);else if(type_Paragraph===Item.GetType())this.CopyParagraph(oDomTarget, Item,true)}},_writePresentationSelectedContent:function(elementsContent,oDomTarget){var oThis=this;var copyDocContent=function(){var docContent=elementsContent.DocContent;if(docContent.Elements){var elements=docContent.Elements;oThis.oPresentationWriter.WriteString2("DocContent");oThis.oPresentationWriter.WriteDouble(elements.length);for(var Index=0;Index<elements.length;Index++){var Item;if(elements[Index].Element)Item=elements[Index].Element;else Item=elements[Index];if(type_Paragraph===Item.GetType()){oThis.oPresentationWriter.StartRecord(0); oThis.oPresentationWriter.WriteParagraph(Item);oThis.oPresentationWriter.EndRecord();if(oDomTarget)oThis.CopyParagraph(oDomTarget,Item,true)}}}};var copyDrawings=function(){var elements=elementsContent.Drawings;oThis.oPresentationWriter.WriteString2("Drawings");oThis.oPresentationWriter.WriteULong(elements.length);pptx_content_writer.Start_UseFullUrl();pptx_content_writer.BinaryFileWriter.ClearIdMap();for(var i=0;i<elements.length;++i)if(!(elements[i].Drawing instanceof CGraphicFrame)){oThis.oPresentationWriter.WriteBool(true); oThis.CopyGraphicObject(oDomTarget,elements[i].Drawing,elements[i]);oThis.oPresentationWriter.WriteDouble(elements[i].X);oThis.oPresentationWriter.WriteDouble(elements[i].Y);oThis.oPresentationWriter.WriteDouble(elements[i].ExtX);oThis.oPresentationWriter.WriteDouble(elements[i].ExtY);if(elements[i].Drawing.isImage())oThis.oPresentationWriter.WriteString2("");else oThis.oPresentationWriter.WriteString2(elements[i].ImageUrl)}else{var isOnlyTable=elements.length===1;oThis.CopyPresentationTableFull(oDomTarget, elements[i].Drawing,isOnlyTable);oThis.oPresentationWriter.WriteDouble(elements[i].X);oThis.oPresentationWriter.WriteDouble(elements[i].Y);oThis.oPresentationWriter.WriteDouble(elements[i].ExtX);oThis.oPresentationWriter.WriteDouble(elements[i].ExtY);oThis.oPresentationWriter.WriteString2(elements[i].ImageUrl)}pptx_content_writer.BinaryFileWriter.ClearIdMap();pptx_content_writer.End_UseFullUrl()};var copySlideObjects=function(){var selected_slides=elementsContent.SlideObjects;oThis.oPresentationWriter.WriteString2("SlideObjects"); oThis.oPresentationWriter.WriteULong(selected_slides.length);var layouts_map={};var layout_count=0;editor.WordControl.m_oLogicDocument.CalculateComments();var slide;for(var i=0;i<selected_slides.length;++i){slide=selected_slides[i];if(i===0)oThis.CopySlide(oDomTarget,slide);else oThis.CopySlide(null,slide)}};var copyLayouts=function(){var selected_layouts=elementsContent.Layouts;oThis.oPresentationWriter.WriteString2("Layouts");oThis.oPresentationWriter.WriteULong(selected_layouts.length);for(var i= 0;i<selected_layouts.length;++i)oThis.CopyLayout(selected_layouts[i])};var copyMasters=function(){var selected_masters=elementsContent.Masters;oThis.oPresentationWriter.WriteString2("Masters");oThis.oPresentationWriter.WriteULong(selected_masters.length);for(var i=0;i<selected_masters.length;++i)oThis.oPresentationWriter.WriteSlideMaster(selected_masters[i])};var copyNotes=function(){var selected_notes=elementsContent.Notes;oThis.oPresentationWriter.WriteString2("Notes");oThis.oPresentationWriter.WriteULong(selected_notes.length); for(var i=0;i<selected_notes.length;++i)oThis.oPresentationWriter.WriteSlideNote(selected_notes[i])};var copyNoteMasters=function(){var selected_note_master=elementsContent.NotesMasters;oThis.oPresentationWriter.WriteString2("NotesMasters");oThis.oPresentationWriter.WriteULong(selected_note_master.length);for(var i=0;i<selected_note_master.length;++i)oThis.oPresentationWriter.WriteNoteMaster(selected_note_master[i])};var copyNoteTheme=function(){var selected_themes=elementsContent.NotesThemes;oThis.oPresentationWriter.WriteString2("NotesThemes"); oThis.oPresentationWriter.WriteULong(selected_themes.length);for(var i=0;i<selected_themes.length;++i)oThis.oPresentationWriter.WriteTheme(selected_themes[i])};var copyTheme=function(){var selected_themes=elementsContent.Themes;oThis.oPresentationWriter.WriteString2("Themes");oThis.oPresentationWriter.WriteULong(selected_themes.length);for(var i=0;i<selected_themes.length;++i)oThis.oPresentationWriter.WriteTheme(selected_themes[i])};var copyIndexes=function(selected_indexes){oThis.oPresentationWriter.WriteULong(selected_indexes.length); for(var i=0;i<selected_indexes.length;++i)oThis.oPresentationWriter.WriteULong(selected_indexes[i])};var contentCount=0;for(var i in elementsContent)if(elementsContent[i]&&typeof elementsContent[i]==="object"&&elementsContent[i].length)contentCount++;else if(null!==elementsContent[i]&&elementsContent[i]instanceof CSelectedContent)contentCount++;oThis.oPresentationWriter.WriteString2("SelectedContent");oThis.oPresentationWriter.WriteULong(elementsContent.PresentationWidth*1E5>>0);oThis.oPresentationWriter.WriteULong(elementsContent.PresentationHeight* 1E5>>0);oThis.oPresentationWriter.WriteULong(contentCount);if(elementsContent.DocContent)copyDocContent();if(elementsContent.Drawings&&elementsContent.Drawings.length)copyDrawings();if(elementsContent.SlideObjects&&elementsContent.SlideObjects.length)copySlideObjects();if(elementsContent.Layouts&&elementsContent.Layouts.length)copyLayouts();if(elementsContent.LayoutsIndexes&&elementsContent.LayoutsIndexes.length){oThis.oPresentationWriter.WriteString2("LayoutsIndexes");copyIndexes(elementsContent.LayoutsIndexes)}if(elementsContent.Masters&& elementsContent.Masters.length)copyMasters();if(elementsContent.MastersIndexes&&elementsContent.MastersIndexes.length){oThis.oPresentationWriter.WriteString2("MastersIndexes");copyIndexes(elementsContent.MastersIndexes)}if(elementsContent.Notes&&elementsContent.Notes.length)if(!(elementsContent.Notes.length===1&&null===elementsContent.Notes[0]))copyNotes();if(elementsContent.NotesMasters&&elementsContent.NotesMasters.length)copyNoteMasters();if(elementsContent.NotesMastersIndexes&&elementsContent.NotesMastersIndexes.length){oThis.oPresentationWriter.WriteString2("NotesMastersIndexes"); copyIndexes(elementsContent.NotesMastersIndexes)}if(elementsContent.NotesThemes&&elementsContent.NotesThemes.length)copyNoteTheme();if(elementsContent.Themes&&elementsContent.Themes.length)copyTheme();if(elementsContent.ThemesIndexes&&elementsContent.ThemesIndexes.length){oThis.oPresentationWriter.WriteString2("ThemeIndexes");copyIndexes(elementsContent.ThemesIndexes)}},getSelectedBinary:function(){var oDocument=this.oDocument;if(PasteElementsId.g_bIsDocumentCopyPaste){var selectedContent=oDocument.GetSelectedContent(); var elementsContent;if(selectedContent&&selectedContent.Elements&&selectedContent.Elements[0]&&selectedContent.Elements[0].Element)elementsContent=selectedContent.Elements;else return false;var drawingUrls=[];if(selectedContent.DrawingObjects&&selectedContent.DrawingObjects.length){var url,correctUrl,graphicObj;for(var i=0;i<selectedContent.DrawingObjects.length;i++){graphicObj=selectedContent.DrawingObjects[i].GraphicObj;if(graphicObj.isImage()){url=graphicObj.getImageUrl();if(window["NativeCorrectImageUrlOnCopy"]){correctUrl= window["NativeCorrectImageUrlOnCopy"](url);drawingUrls[i]=correctUrl}}}}this.oBinaryFileWriter.Document=elementsContent[0].Element.LogicDocument;this.oBinaryFileWriter.CopyStart();this.CopyDocument2(null,oDocument,elementsContent);this.oBinaryFileWriter.CopyEnd();var sBase64=this.oBinaryFileWriter.GetResult();var text="";if(oDocument.GetSelectedText)text=oDocument.GetSelectedText();return{sBase64:"docData;"+sBase64,text:text,drawingUrls:drawingUrls}}},Start:function(){var oDocument=this.oDocument; var bFromPresentation;window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();var selectedContent;if(PasteElementsId.g_bIsDocumentCopyPaste){selectedContent=oDocument.GetSelectedContent();var elementsContent;if(selectedContent&&selectedContent.Elements&&selectedContent.Elements[0]&&selectedContent.Elements[0].Element)elementsContent=selectedContent.Elements;else return"";if(selectedContent.Elements[0].Element&&selectedContent.Elements[0].Element.bFromDocument===false)this.oBinaryFileWriter.Document= this.oDocument;else this.oBinaryFileWriter.Document=elementsContent[0].Element.LogicDocument;this.oBinaryFileWriter.CopyStart();this.CopyDocument2(this.oRoot,oDocument,elementsContent,bFromPresentation);this.oBinaryFileWriter.CopyEnd()}else{selectedContent=oDocument.GetSelectedContent2();if(!selectedContent[0].DocContent&&(!selectedContent[0].Drawings||selectedContent[0].Drawings&&!selectedContent[0].Drawings.length)&&(!selectedContent[0].SlideObjects||selectedContent[0].SlideObjects&&!selectedContent[0].SlideObjects.length))return false; this.CopyDocument2(this.oRoot,oDocument,selectedContent);var sBase64=this.oPresentationWriter.GetBase64Memory();sBase64="pptData;"+this.oPresentationWriter.pos+";"+sBase64;if(this.oRoot.aChildren&&this.oRoot.aChildren.length===1&&AscBrowser.isSafariMacOs){var oElem=this.oRoot.aChildren[0];var sStyle=oElem.oAttributes["style"];if(null==sStyle)oElem.oAttributes["style"]="font-weight:normal";else oElem.oAttributes["style"]=sStyle+";font-weight:normal";this.oRoot.wrapChild(new CopyElement("b"))}if(this.oRoot.aChildren&& this.oRoot.aChildren.length>0)this.oRoot.aChildren[0].oAttributes["class"]=sBase64}if(PasteElementsId.g_bIsDocumentCopyPaste&&PasteElementsId.copyPasteUseBinary&&this.oBinaryFileWriter.copyParams.itemCount>0&&!bFromPresentation){var sBase64="docData;"+this.oBinaryFileWriter.GetResult();if(this.oRoot.aChildren&&this.oRoot.aChildren.length==1&&AscBrowser.isSafariMacOs){var oElem=this.oRoot.aChildren[0];var sStyle=oElem.oAttributes["style"];if(null==sStyle)oElem.oAttributes["style"]="font-weight:normal"; else oElem.oAttributes["style"]=sStyle+";font-weight:normal";this.oRoot.wrapChild(new CopyElement("b"))}if(this.oRoot.aChildren&&this.oRoot.aChildren.length>0)this.oRoot.aChildren[0].oAttributes["class"]=sBase64}return sBase64},CopySlide:function(oDomTarget,slide){if(oDomTarget){var sSrc=slide.getBase64Img();var _bounds_cheker=new AscFormat.CSlideBoundsChecker;slide.draw(_bounds_cheker,0);var oImg=new CopyElement("img");oImg.oAttributes["width"]=Math.round((_bounds_cheker.Bounds.max_x-_bounds_cheker.Bounds.min_x+ 1)*g_dKoef_mm_to_pix);oImg.oAttributes["height"]=Math.round((_bounds_cheker.Bounds.max_y-_bounds_cheker.Bounds.min_y+1)*g_dKoef_mm_to_pix);oImg.oAttributes["src"]=sSrc;oDomTarget.addChild(oImg)}var presentation=editor.WordControl.m_oLogicDocument;for(var key in presentation.TableStylesIdMap)if(presentation.TableStylesIdMap.hasOwnProperty(key))this.oPresentationWriter.tableStylesGuides[key]=key;this.oPresentationWriter.WriteSlide(slide)},CopyLayout:function(layout){this.oPresentationWriter.WriteSlideLayout(layout)}, CopyPresentationTableCells:function(oDomTarget,graphicFrame){var aSelectedRows=[];var oRowElems={};var Item=graphicFrame.graphicObject;if(Item.Selection.Data.length>0)for(var i=0,length=Item.Selection.Data.length;i<length;++i){var elem=Item.Selection.Data[i];var rowElem=oRowElems[elem.Row];if(null==rowElem){rowElem={row:elem.Row,gridStart:null,gridEnd:null,indexStart:null,indexEnd:null,after:null,before:null,cells:{}};oRowElems[elem.Row]=rowElem;aSelectedRows.push(rowElem)}if(null==rowElem.indexEnd|| elem.Cell>rowElem.indexEnd)rowElem.indexEnd=elem.Cell;if(null==rowElem.indexStart||elem.Cell<rowElem.indexStart)rowElem.indexStart=elem.Cell;rowElem.cells[elem.Cell]=1}aSelectedRows.sort(function(a,b){return a.row-b.row});var nMinGrid=null;var nMaxGrid=null;var nPrevStartGrid=null;var nPrevEndGrid=null;var nPrevRowIndex=null;for(var i=0,length=aSelectedRows.length;i<length;++i){var elem=aSelectedRows[i];var nRowIndex=elem.row;if(null!=nPrevRowIndex)if(nPrevRowIndex+1!==nRowIndex){nMinGrid=null;nMaxGrid= null;break}nPrevRowIndex=nRowIndex;var row=Item.Content[nRowIndex];var cellFirst=row.Get_Cell(elem.indexStart);var cellLast=row.Get_Cell(elem.indexEnd);var nCurStartGrid=cellFirst.Metrics.StartGridCol;var nCurEndGrid=cellLast.Metrics.StartGridCol+cellLast.Get_GridSpan()-1;if(null!=nPrevStartGrid&&null!=nPrevEndGrid){if(nCurStartGrid>nPrevStartGrid)for(var j=elem.indexStart-1;j>=0;--j){var cellCur=row.Get_Cell(j);if(vmerge_Continue===cellCur.GetVMerge()){var nCurGridCol=cellCur.Metrics.StartGridCol; if(nCurGridCol>=nPrevStartGrid){nCurStartGrid=nCurGridCol;elem.indexStart=j}else break}else break}if(nCurEndGrid<nPrevEndGrid)for(var j=elem.indexEnd+1;j<row.Get_CellsCount();++j){var cellCur=row.Get_Cell(j);if(vmerge_Continue===cellCur.GetVMerge()){var nCurGridCol=cellCur.Metrics.StartGridCol+cellCur.Get_GridSpan()-1;if(nCurGridCol<=nPrevEndGrid){nCurEndGrid=nCurGridCol;elem.indexEnd=j}else break}else break}}elem.gridStart=nPrevStartGrid=nCurStartGrid;elem.gridEnd=nPrevEndGrid=nCurEndGrid;if(null== nMinGrid||nMinGrid>nCurStartGrid)nMinGrid=nCurStartGrid;if(null==nMaxGrid||nMaxGrid<nCurEndGrid)nMaxGrid=nCurEndGrid}if(null!=nMinGrid&&null!=nMaxGrid){for(var i=0,length=aSelectedRows.length;i<length;++i){var elem=aSelectedRows[i];elem.before=elem.gridStart-nMinGrid;elem.after=nMaxGrid-elem.gridEnd}this.CopyTable(oDomTarget,Item,aSelectedRows)}History.TurnOff();var graphic_frame=new CGraphicFrame(graphicFrame.parent);var grid=[];for(var i=nMinGrid;i<=nMaxGrid;++i)grid.push(graphicFrame.graphicObject.TableGrid[i]); var table=new CTable(editor.WordControl.m_oDrawingDocument,graphicFrame,false,aSelectedRows.length,nMaxGrid-nMinGrid+1,grid);table.setStyleIndex(graphicFrame.graphicObject.styleIndex);graphic_frame.setGraphicObject(table);graphic_frame.setXfrm(0,0,20,30,0,false,false);var b_style_index=false;if(AscFormat.isRealNumber(graphic_frame.graphicObject.styleIndex)&&graphic_frame.graphicObject.styleIndex>-1)b_style_index=true;this.oPresentationWriter.WriteULong(1);this.oPresentationWriter.WriteBool(false); this.oPresentationWriter.WriteBool(b_style_index);if(b_style_index)this.oPresentationWriter.WriteULong(graphic_frame.graphicObject.styleIndex);var old_style_index=graphic_frame.graphicObject.styleIndex;graphic_frame.graphicObject.styleIndex=-1;this.oPresentationWriter.WriteGrFrame(graphic_frame);graphic_frame.graphicObject.styleIndex=old_style_index;History.TurnOn();this.oBinaryFileWriter.copyParams.itemCount=0},CopyPresentationTableFull:function(oDomTarget,graphicFrame,isOnlyTable){var aSelectedRows= [];var oRowElems={};var Item=graphicFrame.graphicObject;var b_style_index=false;var presentation=editor.WordControl.m_oLogicDocument;if(Item.TableStyle&&presentation.globalTableStyles.Style[Item.TableStyle])b_style_index=true;for(var key in presentation.TableStylesIdMap)if(presentation.TableStylesIdMap.hasOwnProperty(key))this.oPresentationWriter.tableStylesGuides[key]="{"+AscCommon.GUID()+"}";this.oPresentationWriter.WriteBool(!b_style_index);if(b_style_index){var tableStyle=presentation.globalTableStyles.Style[Item.TableStyle]; this.oPresentationWriter.WriteBool(true);this.oPresentationWriter.WriteTableStyle(Item.TableStyle,tableStyle);this.oPresentationWriter.WriteBool(true);this.oPresentationWriter.WriteString2(Item.TableStyle)}History.TurnOff();this.oPresentationWriter.WriteGrFrame(graphicFrame);if(isOnlyTable){this.convertToCompileStylesTable(Item);this.oPresentationWriter.WriteGrFrame(graphicFrame)}History.TurnOn();if(oDomTarget)this.CopyTable(oDomTarget,Item,null)},convertToCompileStylesTable:function(table){var t= this;for(var i=0;i<table.Content.length;i++){var row=table.Content[i];for(var j=0;j<row.Content.length;j++){var cell=row.Content[j];var compilePr=cell.Get_CompiledPr();cell.Pr=compilePr;var shd=compilePr.Shd;var color=shd.Get_Color2(this.oDocument.Get_Theme(),this.oDocument.Get_ColorMap());cell.Pr.Shd.Unifill=AscFormat.CreteSolidFillRGB(color.r,color.g,color.b);if(compilePr.TableCellBorders.Bottom){color=compilePr.TableCellBorders.Bottom.Get_Color2(this.oDocument.Get_Theme(),this.oDocument.Get_ColorMap()); cell.Pr.TableCellBorders.Bottom.Unifill=AscFormat.CreteSolidFillRGB(color.r,color.g,color.b)}if(compilePr.TableCellBorders.Top){color=compilePr.TableCellBorders.Top.Get_Color2(this.oDocument.Get_Theme(),this.oDocument.Get_ColorMap());cell.Pr.TableCellBorders.Top.Unifill=AscFormat.CreteSolidFillRGB(color.r,color.g,color.b)}if(compilePr.TableCellBorders.Left){color=compilePr.TableCellBorders.Left.Get_Color2(this.oDocument.Get_Theme(),this.oDocument.Get_ColorMap());cell.Pr.TableCellBorders.Left.Unifill= AscFormat.CreteSolidFillRGB(color.r,color.g,color.b)}if(compilePr.TableCellBorders.Right){color=compilePr.TableCellBorders.Right.Get_Color2(this.oDocument.Get_Theme(),this.oDocument.Get_ColorMap());cell.Pr.TableCellBorders.Right.Unifill=AscFormat.CreteSolidFillRGB(color.r,color.g,color.b)}}}},CopyGraphicObject:function(oDomTarget,oGraphicObj,drawingCopyObject){var sSrc=drawingCopyObject.ImageUrl;if(oDomTarget&&sSrc.length>0){var _bounds_cheker=new AscFormat.CSlideBoundsChecker;oGraphicObj.draw(_bounds_cheker, 0);var width,height;if(drawingCopyObject&&drawingCopyObject.ExtX)width=Math.round(drawingCopyObject.ExtX*g_dKoef_mm_to_pix);else width=Math.round((_bounds_cheker.Bounds.max_x-_bounds_cheker.Bounds.min_x+1)*g_dKoef_mm_to_pix);if(drawingCopyObject&&drawingCopyObject.ExtY)height=Math.round(drawingCopyObject.ExtY*g_dKoef_mm_to_pix);else height=Math.round((_bounds_cheker.Bounds.max_y-_bounds_cheker.Bounds.min_y+1)*g_dKoef_mm_to_pix);var oImg=new CopyElement("img");oImg.oAttributes["width"]=width;oImg.oAttributes["height"]= height;oImg.oAttributes["src"]=sSrc;if(this.api.DocumentReaderMode)oImg.oAttributes["style"]="max-width:100%;";oDomTarget.addChild(oImg)}this.oPresentationWriter.WriteSpTreeElem(oGraphicObj)}};function CopyPasteCorrectString(str){if(!str)return"";var res=str;res=res.replace(/&/g,"&");res=res.replace(/</g,"<");res=res.replace(/>/g,">");res=res.replace(/'/g,"'");res=res.replace(/"/g,""");return res}function Editor_Paste_Exec(api,_format,data1,data2,text_data,specialPasteProps,callback){var oPasteProcessor= new PasteProcessor(api,true,true,false,undefined,callback);window["AscCommon"].g_specialPasteHelper.endRecalcDocument=false;if(undefined===specialPasteProps){window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();window["AscCommon"].g_specialPasteHelper.specialPasteData._format=_format;window["AscCommon"].g_specialPasteHelper.specialPasteData.data1=data1;window["AscCommon"].g_specialPasteHelper.specialPasteData.data2=data2;window["AscCommon"].g_specialPasteHelper.specialPasteData.text_data= text_data}else{window["AscCommon"].g_specialPasteHelper.specialPasteProps=specialPasteProps;_format=window["AscCommon"].g_specialPasteHelper.specialPasteData._format;data1=window["AscCommon"].g_specialPasteHelper.specialPasteData.data1;data2=window["AscCommon"].g_specialPasteHelper.specialPasteData.data2;text_data=window["AscCommon"].g_specialPasteHelper.specialPasteData.text_data;if(specialPasteProps===Asc.c_oSpecialPasteProps.keepTextOnly&&_format!==AscCommon.c_oAscClipboardDataFormat.Text&&text_data){_format= AscCommon.c_oAscClipboardDataFormat.Text;data1=text_data}}switch(_format){case AscCommon.c_oAscClipboardDataFormat.HtmlElement:{oPasteProcessor.Start(data1,data2);break}case AscCommon.c_oAscClipboardDataFormat.Internal:{oPasteProcessor.Start(null,null,null,data1);break}case AscCommon.c_oAscClipboardDataFormat.Text:{oPasteProcessor.Start(null,null,null,null,data1);break}}}function trimString(str){return str.replace(/^\s+|\s+$/g,"")}function sendImgUrls(api,images,callback,bExcel,bNotShowError,token){if(window["NATIVE_EDITOR_ENJINE"]=== true&&window["IS_NATIVE_EDITOR"]!==true){var _data=[];for(var i=0;i<images.length;i++){var _url=window["native"]["getImageUrl"](images[i]);var _full_path=window["native"]["getImagesDirectory"]()+"/"+_url;var _local_url="media/"+_url;AscCommon.g_oDocumentUrls.addUrls({_local_url:_full_path});_data[i]={url:_full_path,path:_local_url}}callback(_data);return}if(window["AscDesktopEditor"])for(var nIndex=images.length-1;nIndex>=0;nIndex--)if(0==images[nIndex].indexOf("file:/"))images[nIndex]=window["AscDesktopEditor"]["GetImageBase64"](images[nIndex]); if(AscCommon.EncryptionWorker&&AscCommon.EncryptionWorker.isCryptoImages())return AscCommon.EncryptionWorker.addCryproImagesFromUrls(images,callback);if(window["IS_NATIVE_EDITOR"]){callback([]);return}var rData={"id":api.documentId,"c":"imgurls","userid":api.documentUserId,"saveindex":g_oDocumentUrls.getMaxIndex(),"tokenDownload":token,"data":images};api.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.LoadImage);api.fCurCallback=function(input){api.sync_EndAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.LoadImage);var nError=c_oAscError.ID.No;var data;if(null!=input&&"imgurls"==input["type"])if("ok"==input["status"]){data=input["data"]["urls"];nError=AscCommon.mapAscServerErrorToAscError(input["data"]["error"]);var urls={};for(var i=0,length=data.length;i<length;++i){var elem=data[i];if(null!=elem.url)urls[elem.path]=elem.url}g_oDocumentUrls.addUrls(urls)}else nError=AscCommon.mapAscServerErrorToAscError(parseInt(input["data"]));else nError=c_oAscError.ID.Unknown;if(c_oAscError.ID.No!== nError&&!bNotShowError)if(!bExcel)api.sendEvent("asc_onError",nError,c_oAscError.Level.NoCritical);else api.handlers.trigger("asc_onError",nError,c_oAscError.Level.NoCritical);if(!data){data=[];for(var i=0;i<images.length;++i)data.push({"url":"error","path":"error"})}callback(data)};AscCommon.sendCommand(api,null,rData)}function PasteProcessor(api,bUploadImage,bUploadFonts,bNested,pasteInExcel,pasteCallback){this.oRootNode=null;this.api=api;this.bIsDoublePx=api.WordControl.bIsDoublePx;this.oDocument= api.WordControl.m_oLogicDocument;this.oLogicDocument=this.oDocument;this.oRecalcDocument=this.oDocument;this.map_font_index=api.FontLoader.map_font_index;this.bUploadImage=bUploadImage;this.bUploadFonts=bUploadFonts;this.bNested=bNested;this.oFonts={};this.oImages={};this.aContent=[];this.pasteInExcel=pasteInExcel;this.pasteInPresentationShape=null;this.pasteCallback=pasteCallback;this.maxTableCell=null;this.bIgnoreNoBlockText=false;this.oCurRun=null;this.oCurRunContentPos=0;this.oCurPar=null;this.oCurParContentPos= 0;this.oCurHyperlink=null;this.oCurHyperlinkContentPos=0;this.oCur_rPr=new CTextPr;this.nBrCount=0;this.bInBlock=null;this.dMaxWidth=Page_Width-X_Left_Margin-X_Right_Margin;this.dScaleKoef=1;this.bUseScaleKoef=false;this.bIsPlainText=false;this.defaultImgWidth=50;this.defaultImgHeight=50;this.MsoStyles={"mso-style-type":1,"mso-pagination":1,"mso-line-height-rule":1,"mso-style-textfill-fill-color":1,"mso-tab-count":1,"tab-stops":1,"list-style-type":1,"mso-special-character":1,"mso-column-break-before":1, "mso-break-type":1,"mso-padding-alt":1,"mso-border-insidev":1,"mso-border-insideh":1,"mso-row-margin-left":1,"mso-row-margin-right":1,"mso-cellspacing":1,"mso-border-alt":1,"mso-border-left-alt":1,"mso-border-top-alt":1,"mso-border-right-alt":1,"mso-border-bottom-alt":1,"mso-border-between":1,"mso-list":1,"mso-comment-reference":1,"mso-comment-date":1,"mso-comment-continuation":1};this.oBorderCache={};this.msoListMap=[];this.pasteTypeContent=undefined;this.pasteList=undefined;this.pasteIntoElem=undefined; this.apiEditor=window["Asc"]["editor"]?window["Asc"]["editor"]:window["editor"];this.msoComments=[];this.startMsoAnnotation=undefined;this.needAddCommentStart;this.needAddCommentEnd;this.rtfImages}PasteProcessor.prototype={_GetTargetDocument:function(oDocument){if(PasteElementsId.g_bIsDocumentCopyPaste){var nDocPosType=oDocument.GetDocPosType();if(docpostype_HdrFtr===nDocPosType){if(null!=oDocument.HdrFtr&&null!=oDocument.HdrFtr.CurHdrFtr&&null!=oDocument.HdrFtr.CurHdrFtr.Content){oDocument=oDocument.HdrFtr.CurHdrFtr.Content; this.oRecalcDocument=oDocument}}else if(nDocPosType===docpostype_DrawingObjects){var content=oDocument.DrawingObjects.getTargetDocContent(true);if(content)oDocument=content}else if(nDocPosType===docpostype_Footnotes)if(oDocument.Footnotes&&oDocument.Footnotes.CurFootnote)oDocument=oDocument.Footnotes.CurFootnote;var Item=oDocument.Content[oDocument.CurPos.ContentPos];if(type_Table===Item.GetType()&&null!=Item.CurCell){this.dMaxWidth=this._CalcMaxWidthByCell(Item.CurCell);oDocument=this._GetTargetDocument(Item.CurCell.Content)}}else; return oDocument},_CalcMaxWidthByCell:function(cell){var row=cell.Row;var table=row.Table;var grid=table.TableGrid;var nGridBefore=0;if(null!=row.Pr&&null!=row.Pr.GridBefore)nGridBefore=row.Pr.GridBefore;var nCellIndex=cell.Index;var nCellGrid=1;if(null!=cell.Pr&&null!=cell.Pr.GridSpan)nCellGrid=cell.Pr.GridSpan;var nMarginLeft=0;if(null!=cell.Pr&&null!=cell.Pr.TableCellMar&&null!=cell.Pr.TableCellMar.Left&&tblwidth_Mm===cell.Pr.TableCellMar.Left.Type&&null!=cell.Pr.TableCellMar.Left.W)nMarginLeft= cell.Pr.TableCellMar.Left.W;else if(null!=table.Pr&&null!=table.Pr.TableCellMar&&null!=table.Pr.TableCellMar.Left&&tblwidth_Mm===table.Pr.TableCellMar.Left.Type&&null!=table.Pr.TableCellMar.Left.W)nMarginLeft=table.Pr.TableCellMar.Left.W;var nMarginRight=0;if(null!=cell.Pr&&null!=cell.Pr.TableCellMar&&null!=cell.Pr.TableCellMar.Right&&tblwidth_Mm===cell.Pr.TableCellMar.Right.Type&&null!=cell.Pr.TableCellMar.Right.W)nMarginRight=cell.Pr.TableCellMar.Right.W;else if(null!=table.Pr&&null!=table.Pr.TableCellMar&& null!=table.Pr.TableCellMar.Right&&tblwidth_Mm===table.Pr.TableCellMar.Right.Type&&null!=table.Pr.TableCellMar.Right.W)nMarginRight=table.Pr.TableCellMar.Right.W;var nPrevSumGrid=nGridBefore;for(var i=0;i<nCellIndex;++i){var oTmpCell=row.Content[i];var nGridSpan=1;if(null!=cell.Pr&&null!=cell.Pr.GridSpan)nGridSpan=cell.Pr.GridSpan;nPrevSumGrid+=nGridSpan}var dCellWidth=0;for(var i=nPrevSumGrid,length=grid.length;i<nPrevSumGrid+nCellGrid&&i<length;++i)dCellWidth+=grid[i];if(dCellWidth-nMarginLeft- nMarginRight<=0)dCellWidth=4;else dCellWidth-=nMarginLeft+nMarginRight;return dCellWidth},InsertInDocument:function(dNotShowOptions){var oDocument=this.oDocument;this.curDocSelection=this.oDocument.GetSelectionState();if(this.curDocSelection&&this.curDocSelection[1]&&this.curDocSelection[1].CurPos)this.pasteIntoElem=this.oDocument.Content[this.curDocSelection[1].CurPos.ContentPos];var nInsertLength=this.aContent.length;if(nInsertLength>0){this.InsertInPlace(oDocument,this.aContent);if(false===PasteElementsId.g_bIsDocumentCopyPaste){oDocument.Recalculate(); if(oDocument.Parent!=null&&oDocument.Parent.txBody!=null)oDocument.Parent.txBody.recalculate()}}var bNeedRecalculate=false===this.bNested&&nInsertLength>0;var bNeedMoveCursor=false;if(bNeedRecalculate)if(History.Is_LastPointNeedRecalc()&&(this.oLogicDocument.DrawingObjects.selectedObjects.length===0||true===this.oLogicDocument.DrawingObjects.isSelectedText()))bNeedMoveCursor=true;if(dNotShowOptions&&!window["AscCommon"].g_specialPasteHelper.specialPasteStart)window["AscCommon"].g_specialPasteHelper.CleanButtonInfo(); else this._specialPasteSetShowOptions();window["AscCommon"].g_specialPasteHelper.Paste_Process_End(true);if(bNeedRecalculate){this.oRecalcDocument.Recalculate();if(bNeedMoveCursor)this.oLogicDocument.MoveCursorRight(false,false,true);this.oLogicDocument.Document_UpdateInterfaceState();this.oLogicDocument.Document_UpdateSelectionState()}},InsertInPlace:function(oDoc,aNewContent){if(!PasteElementsId.g_bIsDocumentCopyPaste)return;var specialPasteHelper=window["AscCommon"].g_specialPasteHelper;var bIsSpecialPaste= specialPasteHelper.specialPasteStart;var paragraph=oDoc.GetCurrentParagraph();if(null!=paragraph){var NearPos=paragraph.GetCurrentAnchorPosition();this.pasteTypeContent=null;var oSelectedContent=new CSelectedContent;var tableSpecialPaste=false;if(bIsSpecialPaste)if(Asc.c_oSpecialPasteProps.insertAsNestedTable===specialPasteHelper.specialPasteProps||Asc.c_oSpecialPasteProps.overwriteCells===specialPasteHelper.specialPasteProps){tableSpecialPaste=true;oSelectedContent.SetInsertOptionForTable(specialPasteHelper.specialPasteProps)}for(var i= 0;i<aNewContent.length;++i){if(bIsSpecialPaste&&!tableSpecialPaste){var parseItem=this._specialPasteItemConvert(aNewContent[i]);if(parseItem&&parseItem.length)for(var j=0;j<parseItem.length;j++)if(j===0)aNewContent.splice(i+j,1,parseItem[j]);else aNewContent.splice(i+j,0,parseItem[j])}var oSelectedElement=new CSelectedElement;oSelectedElement.Element=aNewContent[i];var type=this._specialPasteGetElemType(aNewContent[i]);if(0===i)this.pasteTypeContent=type;else if(type!==this.pasteTypeContent)this.pasteTypeContent= null;if(i===aNewContent.length-1&&true!=this.bInBlock&&type_Paragraph===oSelectedElement.Element.GetType())oSelectedElement.SelectedAll=false;else oSelectedElement.SelectedAll=true;oSelectedContent.Add(oSelectedElement)}oSelectedContent.On_EndCollectElements(this.oLogicDocument,true);if(!this.pasteInExcel&&!this.oLogicDocument.Can_InsertContent(oSelectedContent,NearPos)){if(!this.pasteInExcel){this.oLogicDocument.Document_Undo();History.Clear_Redo()}return}var bPasteMath=false;if(this.pasteInExcel){var Para= NearPos.Paragraph;var ParaNearPos=Para.Get_ParaNearestPos(NearPos);var LastClass=ParaNearPos.Classes[ParaNearPos.Classes.length-1];if(para_Math_Run===LastClass.Type){var MathRun=LastClass;var NewMathRun=MathRun.Split(ParaNearPos.NearPos.ContentPos,ParaNearPos.Classes.length-1);var MathContent=ParaNearPos.Classes[ParaNearPos.Classes.length-2];var MathContentPos=ParaNearPos.NearPos.ContentPos.Data[ParaNearPos.Classes.length-2];var Element=oSelectedContent.Elements[0].Element;var InsertMathContent=null; for(var nPos=0,nParaLen=Element.Content.length;nPos<nParaLen;nPos++)if(para_Math===Element.Content[nPos].Type){InsertMathContent=Element.Content[nPos];break}if(null===InsertMathContent)InsertMathContent=oSelectedContent.ConvertToMath();if(null!==InsertMathContent){MathContent.Add_ToContent(MathContentPos+1,NewMathRun);MathContent.Insert_MathContent(InsertMathContent.Root,MathContentPos+1,true);bPasteMath=true}}}if(!bPasteMath)paragraph.Parent.InsertContent(oSelectedContent,NearPos);if(this.pasteIntoElem&& 1===this.aContent.length&&type_Table===this.aContent[0].GetType()&&this.pasteIntoElem.Parent&&this.pasteIntoElem.Parent.IsInTable()&&(!bIsSpecialPaste||bIsSpecialPaste&&Asc.c_oSpecialPasteProps.overwriteCells===specialPasteHelper.specialPasteProps)){var table;var tableCell=paragraph&¶graph.Parent&¶graph.Parent.Parent;if(tableCell&&tableCell.GetTable)table=tableCell.GetTable();else table=this.pasteIntoElem.Parent.Parent.Get_Table();specialPasteHelper.showButtonIdParagraph=table.Id}else if(oSelectedContent.Elements.length=== 1){var curDocSelection=this.oDocument.GetSelectionState();if(curDocSelection&&curDocSelection[1]&&curDocSelection[1].CurPos){var selectParagraph=this.oDocument.Content[curDocSelection[1].CurPos.ContentPos];specialPasteHelper.showButtonIdParagraph=selectParagraph.Id;if(selectParagraph.GetType&&type_BlockLevelSdt===selectParagraph.GetType()){var currentParagraph=this.oDocument.GetCurrentParagraph();specialPasteHelper.showButtonIdParagraph=currentParagraph?currentParagraph.Id:null}}}else specialPasteHelper.showButtonIdParagraph= oSelectedContent.Elements[oSelectedContent.Elements.length-1].Element.Id;if(this.oLogicDocument&&this.oLogicDocument.DrawingObjects){var oTargetTextObject=AscFormat.getTargetTextObject(this.oLogicDocument.DrawingObjects);oTargetTextObject&&oTargetTextObject.checkExtentsByDocContent&&oTargetTextObject.checkExtentsByDocContent()}this._selectShapesBeforeInsert(aNewContent,oDoc);paragraph.Clear_NearestPosArray(aNewContent)}},_specialPasteGetElemType:function(elem){var type=elem.GetType();if(type_Paragraph=== type)for(var i=0;i<elem.Content.length;i++){if(elem.Content[i]&&elem.Content[i].Content)for(var j=0;j<elem.Content[i].Content.length;j++){var contentElem=elem.Content[i].Content[j];if(!(contentElem instanceof ParaEnd)){var typeElem=contentElem.GetType?contentElem.GetType():null;if(para_Drawing===typeElem)type=para_Drawing;else{if(para_Drawing!==type)type=type_Paragraph;else type=null;break}}}if(type_Paragraph===type)if(elem.Pr&&elem.Pr.NumPr)if(undefined===this.pasteList)this.pasteList=elem.Pr.NumPr; else if(this.pasteList&&!elem.Pr.NumPr.Is_Equal(this.pasteList))this.pasteList=null}return type},_specialPasteSetShowOptions:function(){if(para_Drawing===this.pasteTypeContent){window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();if(window["AscCommon"].g_specialPasteHelper.buttonInfo){window["AscCommon"].g_specialPasteHelper.showButtonIdParagraph=null;window["AscCommon"].g_specialPasteHelper.CleanButtonInfo()}return}var specialPasteShowOptions=!window["AscCommon"].g_specialPasteHelper.buttonInfo.isClean()? window["AscCommon"].g_specialPasteHelper.buttonInfo:null;if(!window["AscCommon"].g_specialPasteHelper.specialPasteStart){specialPasteShowOptions=window["AscCommon"].g_specialPasteHelper.buttonInfo;var sProps=Asc.c_oSpecialPasteProps;var aContent=this.aContent;var props=null;if(this.pasteIntoElem&&1===aContent.length&&type_Table===this.aContent[0].GetType()&&this.pasteIntoElem.Parent&&this.pasteIntoElem.Parent.IsInTable())props=[sProps.overwriteCells,sProps.insertAsNestedTable,sProps.keepTextOnly]; else props=[sProps.sourceformatting,sProps.keepTextOnly];if(null!==props)specialPasteShowOptions.asc_setOptions(props);else{window["AscCommon"].g_specialPasteHelper.showButtonIdParagraph=null;window["AscCommon"].g_specialPasteHelper.CleanButtonInfo()}}if(specialPasteShowOptions)if(window["AscCommon"].g_specialPasteHelper.endRecalcDocument)window["AscCommon"].g_specialPasteHelper.SpecialPasteButtonById_Show()},_specialPasteItemConvert:function(item){var res=item;var type=item.GetType();switch(type){case type_Paragraph:{res= this._specialPasteParagraphConvert(item);break}case type_Table:{res=this._specialPasteTableConvert(item);break}}return res},_specialPasteTableConvert:function(table){var res=table;var props=window["AscCommon"].g_specialPasteHelper.specialPasteProps;if(props===Asc.c_oSpecialPasteProps.keepTextOnly)res=this._convertTableToText(table);else for(var i=0;i<table.Content.length;i++)for(var j=0;j<table.Content[i].Content.length;j++){var cDocumentContent=table.Content[i].Content[j].Content;for(var n=0;n<cDocumentContent.Content.length;n++)if(cDocumentContent.Content[n]instanceof Paragraph)this._specialPasteParagraphConvert(cDocumentContent.Content[n]);else if(cDocumentContent.Content[n]instanceof CTable)this._specialPasteTableConvert(cDocumentContent.Content[n])}return res},_specialPasteParagraphConvert:function(paragraph){var res=paragraph;var props=window["AscCommon"].g_specialPasteHelper.specialPasteProps;var pasteIntoParagraphPr=this.oDocument.GetDirectParaPr();var pasteIntoParaRunPr=this.oDocument.GetDirectTextPr();switch(props){case Asc.c_oSpecialPasteProps.paste:{break}case Asc.c_oSpecialPasteProps.keepTextOnly:{var numbering= paragraph.GetNumPr();if(numbering){var parentContent=paragraph.Parent instanceof CDocument?this.aContent:paragraph.Parent.Content;for(var i=0;i<parentContent.length;i++){var tempParagraph=parentContent[i];var numbering2=tempParagraph.GetNumPr?tempParagraph.GetNumPr():null;if(numbering2){var NumberingEngine=new CDocumentNumberingInfoEngine(tempParagraph.Id,numbering2,this.oLogicDocument.Get_Numbering());var numInfo2=tempParagraph.Numbering.Internal.NumInfo;if(!numInfo2||numInfo2&&!numInfo2[numbering.Lvl]){for(var nIndex= 0,nCount=parentContent.length;nIndex<nCount;++nIndex)parentContent[nIndex].GetNumberingInfo(NumberingEngine);tempParagraph.Numbering.Internal.NumInfo=NumberingEngine.NumInfo}}}this._checkNumberingText(paragraph,paragraph.Numbering.Internal.NumInfo,numbering)}if(pasteIntoParagraphPr){paragraph.Set_Pr(pasteIntoParagraphPr.Copy());if(paragraph.TextPr&&pasteIntoParaRunPr)paragraph.TextPr.Value=pasteIntoParaRunPr.Copy()}this._specialPasteParagraphContentConvert(paragraph.Content,pasteIntoParaRunPr);break}case Asc.c_oSpecialPasteProps.mergeFormatting:{if(pasteIntoParagraphPr){paragraph.Pr.Merge(pasteIntoParagraphPr); if(paragraph.TextPr)paragraph.TextPr.Value.Merge(pasteIntoParaRunPr)}this._specialPasteParagraphContentConvert(paragraph.Content,pasteIntoParaRunPr);break}}return res},_specialPasteParagraphContentConvert:function(paragraphContent,pasteIntoParaRunPr){var props=window["AscCommon"].g_specialPasteHelper.specialPasteProps;var checkInsideDrawings=function(runContent){for(var j=0;j<runContent.length;j++){var item=runContent[j];switch(item.Type){case para_Run:{checkInsideDrawings(item.Content);break}case para_Drawing:{runContent.splice(j, 1);break}}}};switch(props){case Asc.c_oSpecialPasteProps.paste:{break}case Asc.c_oSpecialPasteProps.keepTextOnly:{if(pasteIntoParaRunPr)for(var i=0;i<paragraphContent.length;i++){var elem=paragraphContent[i];var type=elem.Type;switch(type){case para_Run:{if(pasteIntoParaRunPr&&elem.Set_Pr)elem.Set_Pr(pasteIntoParaRunPr.Copy());checkInsideDrawings(elem.Content);break}case para_Field:case para_InlineLevelSdt:case para_Hyperlink:{paragraphContent.splice(i,1);for(var n=0;n<elem.Content.length;n++)paragraphContent.splice(i+ n,0,elem.Content[n]);i--;break}case para_Math:{var mathToParaRun=this._convertParaMathToText(elem);if(mathToParaRun){paragraphContent.splice(i,1,mathToParaRun);i--}break}case para_Comment:{paragraphContent.splice(i,1,new ParaRun);i--;break}}}break}case Asc.c_oSpecialPasteProps.mergeFormatting:{if(pasteIntoParaRunPr)for(var i=0;i<paragraphContent.length;i++){var elem=paragraphContent[i];if(pasteIntoParaRunPr&&elem.Pr)elem.Pr.Merge(pasteIntoParaRunPr)}break}}},_convertParaMathToText:function(paraMath){var res= null;var oDoc=this.oLogicDocument;var mathText=paraMath.Root.GetTextContent();if(mathText&&mathText.str){var newParaRun=new ParaRun;addTextIntoRun(newParaRun,mathText.str);res=newParaRun}return res},_convertTableToText:function(table,obj,newParagraph){var oDoc=this.oLogicDocument;var t=this;if(!obj)obj=[];for(var i=0;i<table.Content.length;i++){if(!newParagraph)newParagraph=new Paragraph(oDoc.DrawingDocument,oDoc);for(var j=0;j<table.Content[i].Content.length;j++){var cDocumentContent=table.Content[i].Content[j].Content; var createNewParagraph=false;var previousTableAdd=false;for(var n=0;n<cDocumentContent.Content.length;n++){previousTableAdd=false;if(createNewParagraph){newParagraph=new Paragraph(oDoc.DrawingDocument,oDoc);createNewParagraph=false}if(cDocumentContent.Content[n]instanceof Paragraph){this._specialPasteParagraphConvert(cDocumentContent.Content[n]);var value=cDocumentContent.Content[n].GetText();var newParaRun=new ParaRun;var bIsAddTabBefore=false;if(newParagraph.Content.length>1)bIsAddTabBefore=true; addTextIntoRun(newParaRun,value,bIsAddTabBefore,true);newParagraph.Internal_Content_Add(newParagraph.Content.length-1,newParaRun,false)}else if(cDocumentContent.Content[n]instanceof CTable){t._convertTableToText(cDocumentContent.Content[n],obj,newParagraph);createNewParagraph=true;previousTableAdd=true}if(!previousTableAdd&&cDocumentContent.Content.length>1&&n!==cDocumentContent.Content.length-1){obj.push(newParagraph);createNewParagraph=true}}}obj.push(newParagraph);newParagraph=null}return obj}, _checkNumberingText:function(paragraph,oNumInfo,oNumPr){if(oNumPr){var oNum=this.oLogicDocument.GetNumbering().GetNum(oNumPr.NumId);if(oNum){var sNumberingText=oNum.GetText(oNumPr.Lvl,oNumInfo);var newParaRun=new ParaRun;addTextIntoRun(newParaRun,sNumberingText,false,true,true);paragraph.Internal_Content_Add(0,newParaRun,false)}}},InsertInPlacePresentation:function(aNewContent,isText){var presentation=editor.WordControl.m_oLogicDocument;var presentationSelectedContent=new PresentationSelectedContent; presentationSelectedContent.DocContent=new CSelectedContent;for(var i=0,length=aNewContent.length;i<length;++i){var oSelectedElement=new CSelectedElement;if(window["AscCommon"].g_specialPasteHelper.specialPasteStart&&!isText)aNewContent[i]=this._specialPasteItemConvert(aNewContent[i]);oSelectedElement.Element=aNewContent[i];presentationSelectedContent.DocContent.Elements[i]=oSelectedElement}if(presentation.InsertContent(presentationSelectedContent)){presentation.Recalculate();presentation.Check_CursorMoveRight(); presentation.Document_UpdateInterfaceState();this._setSpecialPasteShowOptionsPresentation()}else;window["AscCommon"].g_specialPasteHelper.Paste_Process_End()},_setSpecialPasteShowOptionsPresentation:function(props){var presentation=editor.WordControl.m_oLogicDocument;var stateSelection=presentation.GetSelectionState();var curPage=stateSelection.CurPage;var pos=presentation.GetTargetPosition();props=!props?[Asc.c_oSpecialPasteProps.sourceformatting,Asc.c_oSpecialPasteProps.keepTextOnly]:props;var x, y,w,h;if(null===pos){pos=presentation.GetSelectedBounds();w=pos.w;h=pos.h;x=pos.x+w;y=pos.y+h}else{x=pos.X;y=pos.Y}var screenPos=window["editor"].WordControl.m_oLogicDocument.DrawingDocument.ConvertCoordsToCursorWR(x,y,curPage);var specialPasteShowOptions=window["AscCommon"].g_specialPasteHelper.buttonInfo;specialPasteShowOptions.asc_setOptions(props);var targetDocContent=presentation.Get_TargetDocContent();if(targetDocContent&&targetDocContent.Id)specialPasteShowOptions.setShapeId(targetDocContent.Id); else specialPasteShowOptions.setShapeId(null);var curCoord=new AscCommon.asc_CRect(screenPos.X,screenPos.Y,0,0);specialPasteShowOptions.asc_setCellCoord(curCoord);specialPasteShowOptions.setFixPosition({x:x,y:y,pageNum:curPage,w:w,h:h})},insertInPlace2:function(oDoc,aNewContent){var nNewContentLength=aNewContent.length;for(var i=0;i<aNewContent.length;++i){aNewContent[i].Clear_TextFormatting();aNewContent[i].Clear_Formatting(true)}oDoc.Remove(1,true,true);var Item=oDoc.Content[oDoc.CurPos.ContentPos]; if(type_Paragraph===Item.GetType())if(1===nNewContentLength&&type_Paragraph===aNewContent[0].GetType()&&Item.CurPos.ContentPos!==1){var oInsertPar=aNewContent[0];var nContentLength=oInsertPar.Content.length;if(nContentLength>2){var oFindObj=Item.Internal_FindBackward(Item.CurPos.ContentPos,[para_TextPr]);var TextPr=null;if(true===oFindObj.Found&¶_TextPr===oFindObj.Type)TextPr=Item.Content[oFindObj.LetterPos].Copy();else TextPr=new ParaTextPr;var nContentPos=Item.CurPos.ContentPos;for(var i=0;i< nContentLength-2;++i){var oCurInsItem=oInsertPar.Content[i];if(para_Numbering!==oCurInsItem.Type){Item.Internal_Content_Add(nContentPos,oCurInsItem);nContentPos++}}Item.Internal_Content_Add(nContentPos,TextPr)}Item.RecalcInfo.Set_Type_0(pararecalc_0_All);Item.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All)}else{var LastPos=this.oRecalcDocument.CurPos.ContentPos;var LastPosCurDoc=oDoc.CurPos.ContentPos;var oSourceFirstPar=Item;var oSourceLastPar=new Paragraph(oDoc.DrawingDocument,oDoc);if(true!== oSourceFirstPar.IsCursorAtEnd()||oSourceFirstPar.IsEmpty())oSourceFirstPar.Split(oSourceLastPar);var oInsFirstPar=aNewContent[0];var oInsLastPar=null;if(nNewContentLength>1)oInsLastPar=aNewContent[nNewContentLength-1];var nStartIndex=0;var nEndIndex=nNewContentLength-1;if(type_Paragraph===oInsFirstPar.GetType()){oInsFirstPar.CopyPr_Open(oSourceFirstPar);oSourceFirstPar.Concat(oInsFirstPar);if(AscCommon.isRealObject(oInsFirstPar.bullet))oSourceFirstPar.setPresentationBullet(oInsFirstPar.bullet.createDuplicate()); nStartIndex++}else if(type_Table===oInsFirstPar.GetType())if(oSourceFirstPar.IsEmpty())oSourceFirstPar=null;if(null!=oInsLastPar&&type_Paragraph==oInsLastPar.GetType()&&true!=this.bInBlock){var nNewContentPos=oInsLastPar.Content.length-2;var ind=oInsLastPar.Pr.Ind;if(null!=oInsLastPar)oSourceLastPar.CopyPr(oInsLastPar);if(oInsLastPar.bullet)oInsLastPar.Set_Ind(ind);oInsLastPar.Concat(oSourceLastPar);oInsLastPar.CurPos.ContentPos=nNewContentPos;oSourceLastPar=oInsLastPar;nEndIndex--}for(var i=nStartIndex;i<= nEndIndex;++i){var oElemToAdd=aNewContent[i];LastPosCurDoc++;oDoc.Internal_Content_Add(LastPosCurDoc,oElemToAdd)}if(null!=oSourceLastPar){LastPosCurDoc++;oDoc.Internal_Content_Add(LastPosCurDoc,oSourceLastPar)}if(null==oSourceFirstPar){oDoc.Internal_Content_Remove(LastPosCurDoc,1);LastPosCurDoc--}Item.RecalcInfo.Set_Type_0(pararecalc_0_All);Item.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All);oDoc.CurPos.ContentPos=LastPosCurDoc}var content=oDoc.Content;for(var i=0;i<content.length;++i){content[i].Recalc_CompiledPr(); content[i].RecalcInfo.Set_Type_0(pararecalc_0_All)}},ReadFromBinary:function(sBase64,oDocument){var oDocumentParams=PasteElementsId.g_bIsDocumentCopyPaste?this.oDocument:null;var openParams={checkFileSize:false,charCount:0,parCount:0,bCopyPaste:true,oDocument:oDocumentParams};var doc=oDocument?oDocument:this.oLogicDocument;var oBinaryFileReader=new AscCommonWord.BinaryFileReader(doc,openParams);var oRes=oBinaryFileReader.ReadFromString(sBase64,{wordCopyPaste:true});this.bInBlock=oRes.bInBlock;if(!oRes.content.length&& !oRes.aPastedImages.length&&!oRes.images.length)oRes=null;return oRes},SetShortImageId:function(aPastedImages){if(!aPastedImages)return;for(var i=0,length=aPastedImages.length;i<length;++i){var imageElem=aPastedImages[i];if(null!=imageElem)imageElem.SetUrl(imageElem.Url)}},getRtfImages:function(rtf,html){var getRtfImg=function(sRtf){var res=[];var rg_rtf=/\{\\pict[\s\S]+?\\bliptag\-?\d+(\\blipupi\-?\d+)?(\{\\\*\\blipuid\s?[\da-fA-F]+)?[\s\}]*?/,d;var rg_rtf_all=new RegExp("(?:("+rg_rtf.source+"))([\\da-fA-F\\s]+)\\}", "g");var pngStr="\\pngblip";var jpegStr="\\jpegblip";var pngTypeStr="image/png";var jpegTypeStr="image/jpeg";var type;sRtf=sRtf.match(rg_rtf_all);if(!sRtf)return res;for(var i=0;i<sRtf.length;i++)if(rg_rtf.test(sRtf[i])){if(-1!==sRtf[i].indexOf(jpegStr))type=pngTypeStr;else if(-1!==sRtf[i].indexOf(pngStr))type=jpegTypeStr;else continue;res.push({data:sRtf[i].replace(rg_rtf,"").replace(/[^\da-fA-F]/g,""),type:type})}return res};var getHtmlImg=function(sHtml){var rg_html=/<img[^>]+src="([^"]+)[^>]+/g; var res=[];var img;while(true){img=rg_html.exec(sHtml);if(!img)break;res.push(img[1])}return res};function hexToBytes(hex){var res=[];for(var i=0;i<hex.length;i+=2)res.push(parseInt(hex.substr(i,2),16));return res}function bytesToBase64(val){var res="";var bytes=new Uint8Array(val);for(var i=0;i<bytes.byteLength;i++)res+=String.fromCharCode(bytes[i]);return window.btoa(res)}var rtfImages=getRtfImg(rtf);var htmlImages=getHtmlImg(html);var map={};if(rtfImages.length===htmlImages.length)for(var i=0;i< rtfImages.length;i++){var a=rtfImages[i];if(a.type){var bytes=hexToBytes(a.data);map[htmlImages[i]]="data:"+a.type+";base64,"+bytesToBase64(bytes)}}return map},Start:function(node,nodeDisplay,bDuplicate,fromBinary,text,callback){var tempPresentation=!PasteElementsId.g_bIsDocumentCopyPaste&&editor&&editor.WordControl?editor.WordControl.m_oLogicDocument:null;var insertToPresentationWithoutSlides=tempPresentation&&tempPresentation.Slides&&!tempPresentation.Slides.length;if(text){if(insertToPresentationWithoutSlides){window["AscCommon"].g_specialPasteHelper.CleanButtonInfo(); window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return}this.oLogicDocument.RemoveBeforePaste();this.oDocument=this._GetTargetDocument(this.oDocument);this._pasteText(text);return}var bInsertFromBinary=false;if(!node&&""===fromBinary)return;if(PasteElementsId.copyPasteUseBinary){var base64FromWord=null,base64FromExcel=null,base64FromPresentation;var binaryObj=this._getClassBinaryFromHtml(node,fromBinary);base64FromExcel=binaryObj.base64FromExcel;base64FromWord=binaryObj.base64FromWord; base64FromPresentation=binaryObj.base64FromPresentation;var bTurnOffTrackRevisions=false;if(PasteElementsId.g_bIsDocumentCopyPaste){var oThis=this;this.oLogicDocument.RemoveBeforePaste();this.oDocument=this._GetTargetDocument(this.oDocument);if(this.oDocument&&this.oDocument.bPresentation)if(oThis.api.WordControl.m_oLogicDocument.TrackRevisions){oThis.api.WordControl.m_oLogicDocument.TrackRevisions=false;bTurnOffTrackRevisions=true}}if(insertToPresentationWithoutSlides&&!base64FromPresentation){window["AscCommon"].g_specialPasteHelper.CleanButtonInfo(); window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return}if(base64FromExcel)if(PasteElementsId.g_bIsDocumentCopyPaste)bInsertFromBinary=null!==this._pasteBinaryFromExcelToWord(base64FromExcel);else bInsertFromBinary=null!==this._pasteBinaryFromExcelToPresentation(base64FromExcel);else if(base64FromWord)if(PasteElementsId.g_bIsDocumentCopyPaste)bInsertFromBinary=null!==this._pasteBinaryFromWordToWord(base64FromWord,!!fromBinary);else bInsertFromBinary=null!==this._pasteBinaryFromWordToPresentation(base64FromWord, !!fromBinary);else if(base64FromPresentation)if(PasteElementsId.g_bIsDocumentCopyPaste)bInsertFromBinary=null!==this._pasteBinaryFromPresentationToWord(base64FromPresentation,bDuplicate);else bInsertFromBinary=null!==this._pasteBinaryFromPresentationToPresentation(base64FromPresentation)}if(true===bInsertFromBinary){if(bTurnOffTrackRevisions)oThis.api.WordControl.m_oLogicDocument.TrackRevisions=true}else if(node)this._pasteFromHtml(node,bTurnOffTrackRevisions);else{window["AscCommon"].g_specialPasteHelper.CleanButtonInfo(); window["AscCommon"].g_specialPasteHelper.Paste_Process_End()}},_pasteBinaryFromExcelToWord:function(base64FromExcel){var oThis=this;var fPrepasteCallback=function(){if(false===oThis.bNested){oThis.InsertInDocument();if(oThis.aContent.bAddNewStyles)oThis.api.GenerateStyles();if(oThis.pasteCallback)oThis.pasteCallback()}};History.TurnOff();var aContentExcel=this._readFromBinaryExcel(base64FromExcel);History.TurnOn();if(null===aContentExcel)return null;var oldLocale=AscCommon.g_oDefaultCultureInfo?AscCommon.g_oDefaultCultureInfo.LCID: AscCommon.g_oDefaultCultureInfo;AscCommon.setCurrentCultureInfo(aContentExcel.workbook.Core.language);var revertLocale=function(){if(oldLocale)AscCommon.setCurrentCultureInfo(oldLocale);else AscCommon.g_oDefaultCultureInfo=oldLocale};var aContent;if(window["AscCommon"].g_specialPasteHelper.specialPasteStart&&Asc.c_oSpecialPasteProps.keepTextOnly===window["AscCommon"].g_specialPasteHelper.specialPasteProps){aContent=oThis._convertExcelBinary(aContentExcel);revertLocale();oThis.aContent=aContent.content; fPrepasteCallback()}else if(aContentExcel.arrImages&&aContentExcel.arrImages.length){var oObjectsForDownload=GetObjectsForImageDownload(aContentExcel.arrImages);AscCommon.sendImgUrls(oThis.api,oObjectsForDownload.aUrls,function(data){var oImageMap={};ResetNewUrls(data,oObjectsForDownload.aUrls,oObjectsForDownload.aBuilderImagesByUrl,oImageMap);var aContent=oThis._convertExcelBinary(aContentExcel,aContentExcel?aContentExcel.pDrawings:null);revertLocale();oThis.aContent=aContent.content;oThis.api.pre_Paste(aContent.fonts, oImageMap,fPrepasteCallback)},null,true)}else{aContent=oThis._convertExcelBinary(aContentExcel);revertLocale();oThis.aContent=aContent.content;oThis.api.pre_Paste(aContent.fonts,aContent.images,fPrepasteCallback)}},_pasteBinaryFromExcelToPresentation:function(base64FromExcel){var oThis=this;var presentation=editor.WordControl.m_oLogicDocument;var excelContent=AscFormat.ExecuteNoHistory(this._readFromBinaryExcel,this,[base64FromExcel]);if(null===excelContent)return null;var aContentExcel=excelContent.workbook; var aPastedImages=excelContent.arrImages;var aContent;var _sheet=aContentExcel&&aContentExcel.aWorksheets&&aContentExcel.aWorksheets[0];var drawings=excelContent.pDrawings?excelContent.pDrawings:_sheet&&_sheet.Drawings;if(drawings&&drawings.length){var paste_callback=function(){if(false===oThis.bNested){var oIdMap={};var aCopies=[];var oCopyPr=new AscFormat.CCopyObjectProperties;oCopyPr.idMap=oIdMap;var l=null,t=null,r=null,b=null,oXfrm;for(var i=0;i<arr_shapes.length;++i){shape=arr_shapes[i].graphicObject.copy(oCopyPr); aCopies.push(shape);oIdMap[arr_shapes[i].graphicObject.Id]=shape.Id;shape.worksheet=null;shape.drawingBase=null;arr_shapes[i]=new DrawingCopyObject(shape,0,0,0,0);if(shape.spPr&&shape.spPr.xfrm&&AscFormat.isRealNumber(shape.spPr.xfrm.offX)&&AscFormat.isRealNumber(shape.spPr.xfrm.offY)&&AscFormat.isRealNumber(shape.spPr.xfrm.extX)&&AscFormat.isRealNumber(shape.spPr.xfrm.extY)){oXfrm=shape.spPr.xfrm;if(l===null)l=oXfrm.offX;else if(oXfrm.offX<l)l=oXfrm.offX;if(t===null)t=oXfrm.offY;else if(oXfrm.offY< t)t=oXfrm.offY;if(r===null)r=oXfrm.offX+oXfrm.extX;else if(oXfrm.offX+oXfrm.extX>r)r=oXfrm.offX+oXfrm.extX;if(b===null)b=oXfrm.offY+oXfrm.extY;else if(oXfrm.offY+oXfrm.extY>b)b=oXfrm.offY+oXfrm.extY}}if(AscFormat.isRealNumber(l)&&AscFormat.isRealNumber(t)&&AscFormat.isRealNumber(r)&&AscFormat.isRealNumber(b)){var fSlideCX=presentation.Width/2;var fSlideCY=presentation.Height/2;var fBoundsCX=(r+l)/2;var fBoundsCY=(t+b)/2;var fDiffX=fBoundsCX-fSlideCX;var fDiffY=fBoundsCY-fSlideCY;if(!AscFormat.fApproxEqual(fDiffX, 0)||!AscFormat.fApproxEqual(fDiffY,0))for(var i=0;i<arr_shapes.length;++i){shape=arr_shapes[i].Drawing;if(shape.spPr&&shape.spPr.xfrm&&AscFormat.isRealNumber(shape.spPr.xfrm.offX)&&AscFormat.isRealNumber(shape.spPr.xfrm.offY)&&AscFormat.isRealNumber(shape.spPr.xfrm.extX)&&AscFormat.isRealNumber(shape.spPr.xfrm.extY)){shape.spPr.xfrm.setOffX(shape.spPr.xfrm.offX-fDiffX);shape.spPr.xfrm.setOffY(shape.spPr.xfrm.offY-fDiffY)}}}AscFormat.fResetConnectorsIds(aCopies,oIdMap);var presentationSelectedContent= new PresentationSelectedContent;presentationSelectedContent.Drawings=arr_shapes;if(presentation.InsertContent(presentationSelectedContent)){presentation.Recalculate();presentation.Check_CursorMoveRight();presentation.Document_UpdateInterfaceState()}else window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.Paste_Process_End()}};var arr_shapes=drawings;var aImagesToDownload=[];for(var i=0;i<aPastedImages.length;i++)aImagesToDownload.push(aPastedImages[i].Url); aContent={aPastedImages:aPastedImages,images:aImagesToDownload};var font_map={};for(var i=0;i<arr_shapes.length;++i){var shape=arr_shapes[i].graphicObject;if(shape)shape.getAllFonts(font_map)}var fonts=[];for(var i in font_map)fonts.push(new CFont(i,0,"",0));var images=aContent.images;var arrImages=aContent.aPastedImages;var oObjectsForDownload=GetObjectsForImageDownload(arrImages);if(oObjectsForDownload.aUrls.length>0)AscCommon.sendImgUrls(oThis.api,oObjectsForDownload.aUrls,function(data){var oImageMap= {};History.TurnOff();ResetNewUrls(data,oObjectsForDownload.aUrls,oObjectsForDownload.aBuilderImagesByUrl,oImageMap);oThis.api.pre_Paste(fonts,oImageMap,paste_callback);History.TurnOn()},null,true);else{var im_arr=[];for(var key in images)im_arr.push(key);this.SetShortImageId(arrImages);this.api.pre_Paste(fonts,im_arr,paste_callback)}}else{var presentationSelectedContent=new PresentationSelectedContent;presentationSelectedContent.DocContent=new CSelectedContent;aContent=AscFormat.ExecuteNoHistory(this._convertExcelBinary, this,[excelContent]);var selectedElement,element,pDrawings=[],drawingCopyObject;for(var i=0;i<aContent.content.length;++i){selectedElement=new CSelectedElement;element=aContent.content[i];if(type_Table===element.GetType()){var W=100;var Rows=3;var graphic_frame=new CGraphicFrame;graphic_frame.setSpPr(new AscFormat.CSpPr);graphic_frame.spPr.setParent(graphic_frame);graphic_frame.spPr.setXfrm(new AscFormat.CXfrm);graphic_frame.spPr.xfrm.setParent(graphic_frame.spPr);graphic_frame.spPr.xfrm.setOffX((this.oDocument.Width- W)/2);graphic_frame.spPr.xfrm.setOffY(this.oDocument.Height/5);graphic_frame.spPr.xfrm.setExtX(W);graphic_frame.spPr.xfrm.setExtY(7.478268771701388*Rows);graphic_frame.setNvSpPr(new AscFormat.UniNvPr);element=this._convertTableToPPTX(element);graphic_frame.setGraphicObject(element.Copy(graphic_frame));drawingCopyObject=new DrawingCopyObject;drawingCopyObject.Drawing=graphic_frame;pDrawings.push(drawingCopyObject)}}presentationSelectedContent.Drawings=pDrawings;var paste_callback_presentation=function(){if(false== oThis.bNested){if(presentation.InsertContent(presentationSelectedContent)){presentation.Recalculate();presentation.Check_CursorMoveRight();presentation.Document_UpdateInterfaceState();var props=[Asc.c_oSpecialPasteProps.destinationFormatting,Asc.c_oSpecialPasteProps.keepTextOnly];oThis._setSpecialPasteShowOptionsPresentation(props)}else window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.Paste_Process_End()}};oThis.api.pre_Paste(aContent.fonts,null, paste_callback_presentation)}},_pasteBinaryFromWordToWord:function(base64FromWord,bIsOnlyFromBinary){var oThis=this;var aContent=this.ReadFromBinary(base64FromWord);if(null===aContent)return null;if(aContent&&aContent.content&&this.oDocument.bPresentation&&oThis.oDocument&&oThis.oDocument.Parent&&oThis.oDocument.Parent.parent&&oThis.oDocument.Parent.parent.parent&&oThis.oDocument.Parent.parent.parent.getObjectType&&oThis.oDocument.Parent.parent.parent.getObjectType()===AscDFH.historyitem_type_Chart){aContent.images= [];aContent.aPastedImages=[];var newContent=[];for(var i=0;i<aContent.content.length;i++)if(type_Paragraph===aContent.content[i].Get_Type())newContent.push(AscFormat.ConvertParagraphToPPTX(aContent.content[i],this.oDocument.DrawingDocument,this.oDocument,false,true));aContent.content=newContent}var fPrepasteCallback=function(){if(false===oThis.bNested){oThis.InsertInDocument();if(aContent.bAddNewStyles)oThis.api.GenerateStyles();if(oThis.pasteCallback)oThis.pasteCallback()}};this.aContent=aContent.content; aContent.fonts=oThis._checkFontsOnLoad(aContent.fonts);var oObjectsForDownload=GetObjectsForImageDownload(aContent.aPastedImages);if(window["AscCommon"].g_specialPasteHelper.specialPasteStart&&Asc.c_oSpecialPasteProps.keepTextOnly===window["AscCommon"].g_specialPasteHelper.specialPasteProps)oThis.api.pre_Paste([],[],fPrepasteCallback);else if(oObjectsForDownload.aUrls.length>0)if(window["IS_NATIVE_EDITOR"])oThis.api.pre_Paste(aContent.fonts,aContent.images,fPrepasteCallback);else if(bIsOnlyFromBinary&& window["NativeCorrectImageUrlOnPaste"]){var url;for(var i=0,length=aContent.aPastedImages.length;i<length;++i){url=window["NativeCorrectImageUrlOnPaste"](aContent.aPastedImages[i].Url);aContent.images[i]=url;var imageElem=aContent.aPastedImages[i];if(null!=imageElem)imageElem.SetUrl(url)}oThis.api.pre_Paste(aContent.fonts,aContent.images,fPrepasteCallback)}else AscCommon.sendImgUrls(oThis.api,oObjectsForDownload.aUrls,function(data){ResetNewUrls(data,oObjectsForDownload.aUrls,oObjectsForDownload.aBuilderImagesByUrl, aContent.images);oThis.api.pre_Paste(aContent.fonts,aContent.images,fPrepasteCallback)},null,true);else{oThis.SetShortImageId(aContent.aPastedImages);oThis.api.pre_Paste(aContent.fonts,aContent.images,fPrepasteCallback)}},_pasteBinaryFromWordToPresentation:function(base64FromWord){var oThis=this;var presentation=editor.WordControl.m_oLogicDocument;var trueDocument=this.oDocument;var tempCDocument=function(){return new CDocument(oThis.oDocument.DrawingDocument,false)};this.oDocument=AscFormat.ExecuteNoHistory(tempCDocument, this,[]);AscCommon.g_oIdCounter.m_bRead=true;var aContent=AscFormat.ExecuteNoHistory(this.ReadFromBinary,this,[base64FromWord,this.oDocument]);AscCommon.g_oIdCounter.m_bRead=false;if(null===aContent)return null;this.oDocument=trueDocument;History.Document=trueDocument;var presentationSelectedContent=new PresentationSelectedContent;presentationSelectedContent.DocContent=new CSelectedContent;var parseContent=function(content){for(var i=0;i<content.length;++i){selectedElement=new CSelectedElement;element= content[i];element.GetAllDrawingObjects(drawings);if(type_Paragraph===element.GetType()){selectedElement.Element=AscFormat.ConvertParagraphToPPTX(element,null,null,true,false);elements.push(selectedElement)}else if(type_Table===element.GetType()){element=oThis._convertTableToPPTX(element,true);var W=oThis.oDocument.Width/1.45;var Rows=element.GetRowsCount();var H=Rows*7.478268771701388;var graphic_frame=new CGraphicFrame;graphic_frame.setSpPr(new AscFormat.CSpPr);graphic_frame.spPr.setParent(graphic_frame); graphic_frame.spPr.setXfrm(new AscFormat.CXfrm);graphic_frame.spPr.xfrm.setParent(graphic_frame.spPr);graphic_frame.spPr.xfrm.setOffX(oThis.oDocument.Width/2-W/2);graphic_frame.spPr.xfrm.setOffY(oThis.oDocument.Height/2-H/2);graphic_frame.spPr.xfrm.setExtX(W);graphic_frame.spPr.xfrm.setExtY(H);graphic_frame.setNvSpPr(new AscFormat.UniNvPr);graphic_frame.setGraphicObject(element.Copy(graphic_frame));graphic_frame.graphicObject.Set_TableStyle(defaultTableStyleId);drawingCopyObject=new DrawingCopyObject; drawingCopyObject.Drawing=graphic_frame;pDrawings.push(drawingCopyObject)}else if(type_BlockLevelSdt===element.GetType())parseContent(element.Content.Content)}};var elements=[],selectedElement,element,drawings=[],pDrawings=[],drawingCopyObject;var defaultTableStyleId=presentation.DefaultTableStyleId;parseContent(aContent.content);var onlyImages=false;if(drawings&&drawings.length){if(elements&&1===elements.length&&elements[0].Element&&type_Paragraph===elements[0].Element.Get_Type())if(true===this._isParagraphContainsOnlyDrawing(elements[0].Element)){elements= [];onlyImages=true}for(var j=0;j<drawings.length;j++){drawingCopyObject=new DrawingCopyObject;drawingCopyObject.Drawing=drawings[j].GraphicObj;pDrawings.push(drawingCopyObject)}}presentationSelectedContent.DocContent.Elements=elements;presentationSelectedContent.Drawings=pDrawings;var paste_callback=function(){if(false===oThis.bNested){var slide=presentation.Slides[0];for(var i=0;i<presentationSelectedContent.Drawings.length;i++)if(presentationSelectedContent.Drawings[i].Drawing instanceof CGraphicFrame){var drawing= presentationSelectedContent.Drawings[i].Drawing;var oldParent=drawing.parent;var bDeleted=drawing.bDeleted;drawing.parent=slide;drawing.bDeleted=false;drawing.recalculate();drawing.parent=oldParent;drawing.bDeleted=bDeleted;drawing.spPr.xfrm.setOffX(oThis.oDocument.Width/2-drawing.extX/2);drawing.spPr.xfrm.setOffY(oThis.oDocument.Height/2-drawing.extY/2)}if(presentation.InsertContent(presentationSelectedContent)){presentation.Recalculate();presentation.Check_CursorMoveRight();presentation.Document_UpdateInterfaceState(); if(!onlyImages){var props=[Asc.c_oSpecialPasteProps.destinationFormatting,Asc.c_oSpecialPasteProps.keepTextOnly];oThis._setSpecialPasteShowOptionsPresentation(props)}else window["AscCommon"].g_specialPasteHelper.CleanButtonInfo()}else window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.Paste_Process_End()}};var font_map={};var images=[];var fonts=[];for(var i in font_map)fonts.push(new CFont(i,0,"",0));var oObjectsForDownload=GetObjectsForImageDownload(aContent.aPastedImages); if(oObjectsForDownload.aUrls.length>0)AscCommon.sendImgUrls(oThis.api,oObjectsForDownload.aUrls,function(data){var oImageMap={};ResetNewUrls(data,oObjectsForDownload.aUrls,oObjectsForDownload.aBuilderImagesByUrl,oImageMap);for(var i=0;i<presentationSelectedContent.Drawings.length;i++)if(!(presentationSelectedContent.Drawings[i].Drawing instanceof CGraphicFrame)){AscFormat.ExecuteNoHistory(function(){if(presentationSelectedContent.Drawings[i].Drawing.setBDeleted2)presentationSelectedContent.Drawings[i].Drawing.setBDeleted2(true); else presentationSelectedContent.Drawings[i].Drawing.setBDeleted(true)},this,[]);presentationSelectedContent.Drawings[i].Drawing=presentationSelectedContent.Drawings[i].Drawing.convertToPPTX(oThis.oDocument.DrawingDocument,undefined,true);AscFormat.checkBlipFillRasterImages(presentationSelectedContent.Drawings[i].Drawing)}oThis.api.pre_Paste(fonts,oImageMap,paste_callback)},null,true);else{for(var i=0;i<presentationSelectedContent.Drawings.length;i++)if(!(presentationSelectedContent.Drawings[i].Drawing instanceof CGraphicFrame)){presentationSelectedContent.Drawings[i].Drawing=presentationSelectedContent.Drawings[i].Drawing.convertToPPTX(oThis.oDocument.DrawingDocument,undefined,true);AscFormat.checkBlipFillRasterImages(presentationSelectedContent.Drawings[i].Drawing)}oThis.api.pre_Paste(aContent.fonts,aContent.images,paste_callback)}},_pasteBinaryFromPresentationToWord:function(base64){var oThis=this;var fPrepasteCallback=function(){if(false===oThis.bNested){oThis.InsertInDocument();if(aContent.bAddNewStyles)oThis.api.GenerateStyles(); if(oThis.pasteCallback)oThis.pasteCallback()}};var oSelectedContent2=this._readPresentationSelectedContent2(base64);var selectedContent2=oSelectedContent2.content;var defaultSelectedContent=selectedContent2[1]?selectedContent2[1]:selectedContent2[0];var bSlideObjects=defaultSelectedContent&&defaultSelectedContent.content&&defaultSelectedContent.content.SlideObjects&&defaultSelectedContent.content.SlideObjects.length>0;var pasteObj=bSlideObjects&&PasteElementsId.g_bIsDocumentCopyPaste?selectedContent2[2]: defaultSelectedContent;var arr_Images,fonts,content=null,font_map={};if(pasteObj){arr_Images=pasteObj.images;fonts=pasteObj.fonts;content=pasteObj.content}if(null===content)return null;if(content&&content.DocContent){var elements=content.DocContent.Elements;var aContent=[];for(var i=0;i<elements.length;i++)aContent[i]=AscFormat.ConvertParagraphToWord(elements[i].Element,this.oDocument);this.aContent=aContent;oThis.api.pre_Paste(fonts,arr_Images,fPrepasteCallback)}else if(content&&content.Drawings){var arr_shapes= content.Drawings;var arrImages=pasteObj.images;if(!bSlideObjects&&content.Drawings.length===selectedContent2[1].content.Drawings.length)AscFormat.checkDrawingsTransformBeforePaste(content,selectedContent2[1].content,null);if(!arrImages.length&&arr_shapes.length===1&&arr_shapes[0]&&arr_shapes[0].Drawing&&arr_shapes[0].Drawing.graphicObject){var drawing=arr_shapes[0].Drawing;if(typeof CGraphicFrame!=="undefined"&&drawing instanceof CGraphicFrame){var aContent=[];var table=AscFormat.ConvertGraphicFrameToWordTable(drawing, this.oLogicDocument);table.Document_Get_AllFontNames(font_map);for(var i in font_map)fonts.push(new CFont(i,0,"",0));table.TableStyle=null;aContent.push(table);this.aContent=aContent;oThis.api.pre_Paste(fonts,aContent.images,fPrepasteCallback);return}}if(arr_shapes.length>1)for(var i=0;i<arr_shapes.length;i++)if(typeof CGraphicFrame!=="undefined"&&arr_shapes[i].Drawing instanceof CGraphicFrame)arrImages.push(new AscCommon.CBuilderImages(null,arr_shapes[i].base64,arr_shapes[i],null,null));var oObjectsForDownload= GetObjectsForImageDownload(arrImages);var aImagesToDownload=oObjectsForDownload.aUrls;AscCommon.sendImgUrls(oThis.api,aImagesToDownload,function(data){var image_map={};for(var i=0,length=Math.min(data.length,arrImages.length);i<length;++i){var elem=data[i];if(null!=elem.url){var name=g_oDocumentUrls.imagePath2Local(elem.path);var imageElem=oObjectsForDownload.aBuilderImagesByUrl[i];if(null!=imageElem)if(Array.isArray(imageElem))for(var j=0;j<imageElem.length;++j){var curImageElem=imageElem[j];if(null!= curImageElem)if(curImageElem.ImageShape&&curImageElem.ImageShape.base64)curImageElem.ImageShape.base64=name;else curImageElem.SetUrl(name)}else if(imageElem.ImageShape&&imageElem.ImageShape.base64)imageElem.ImageShape.base64=name;else imageElem.SetUrl(name);image_map[i]=name}else image_map[i]=aImagesToDownload[i]}aContent=oThis._convertExcelBinary(null,arr_shapes);oThis.aContent=aContent.content;oThis.api.pre_Paste(fonts,image_map,fPrepasteCallback)},null,true)}},_pasteBinaryFromPresentationToPresentation:function(base64, bDuplicate){var oThis=this;var presentation=editor.WordControl.m_oLogicDocument;var oSelectedContent2=this._readPresentationSelectedContent2(base64,bDuplicate);var p_url=oSelectedContent2.p_url;var p_theme=oSelectedContent2.p_theme;var selectedContent2=oSelectedContent2.content;var multipleParamsCount=selectedContent2?selectedContent2.length:0;if(multipleParamsCount){var aContents=[];for(var i=0;i<multipleParamsCount;i++){var curContent=selectedContent2[i];aContents.push(curContent.content)}var specialOptionsArr= [];var specialProps=Asc.c_oSpecialPasteProps;if(1===multipleParamsCount)specialOptionsArr=[specialProps.destinationFormatting];else if(2===multipleParamsCount)specialOptionsArr=[specialProps.destinationFormatting,specialProps.sourceformatting];else if(3===multipleParamsCount)specialOptionsArr=[specialProps.destinationFormatting,specialProps.sourceformatting,specialProps.picture];var pasteObj=selectedContent2[0];var nIndex=0;if(window["AscCommon"].g_specialPasteHelper.specialPasteStart){var props= window["AscCommon"].g_specialPasteHelper.specialPasteProps;switch(props){case Asc.c_oSpecialPasteProps.destinationFormatting:{break}case Asc.c_oSpecialPasteProps.sourceformatting:{if(selectedContent2[1]){pasteObj=selectedContent2[1];nIndex=1}break}case Asc.c_oSpecialPasteProps.picture:{if(selectedContent2[2]){pasteObj=selectedContent2[2];nIndex=2}break}case Asc.c_oSpecialPasteProps.keepTextOnly:{break}}}var arr_Images=pasteObj.images;var fonts=pasteObj.fonts;var presentationSelectedContent=pasteObj.content; if(null===presentationSelectedContent)return null;if(presentationSelectedContent.Drawings&&presentationSelectedContent.Drawings.length>0){var controller=this.oDocument.GetCurrentController();var curTheme=controller?controller.getTheme():null;if(curTheme&&curTheme.name===p_theme)specialOptionsArr.splice(1,1)}var paste_callback=function(){if(false===oThis.bNested){var bPaste=presentation.InsertContent2(aContents,nIndex);presentation.Recalculate();presentation.Check_CursorMoveRight();presentation.Document_UpdateInterfaceState(); var bSlideObjects=aContents[nIndex]&&aContents[nIndex].SlideObjects&&aContents[nIndex].SlideObjects.length>0;if(specialOptionsArr.length>=1&&!bSlideObjects&&bPaste){if(presentationSelectedContent&&presentationSelectedContent.DocContent)specialOptionsArr.push(Asc.c_oSpecialPasteProps.keepTextOnly);oThis._setSpecialPasteShowOptionsPresentation(specialOptionsArr)}else window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.Paste_Process_End()}};var oObjectsForDownload= GetObjectsForImageDownload(arr_Images,p_url===this.api.documentId);if(oObjectsForDownload.aUrls.length>0)AscCommon.sendImgUrls(oThis.api,oObjectsForDownload.aUrls,function(data){var oImageMap={};ResetNewUrls(data,oObjectsForDownload.aUrls,oObjectsForDownload.aBuilderImagesByUrl,oImageMap);oThis.api.pre_Paste(fonts,oImageMap,paste_callback)},null,true);else oThis.api.pre_Paste(fonts,{},paste_callback)}else return null},_readPresentationSelectedContent2:function(base64,bDuplicate){pptx_content_loader.Clear(); var _stream=AscFormat.CreateBinaryReader(base64,0,base64.length);var stream=new AscCommon.FileStream(_stream.data,_stream.size);var p_url=stream.GetString2();var p_theme=stream.GetString2();var p_width=stream.GetULong()/1E5;var p_height=stream.GetULong()/1E5;var bIsMultipleContent=stream.GetBool();var selectedContent2=[];if(true===bIsMultipleContent){var multipleParamsCount=stream.GetULong();for(var i=0;i<multipleParamsCount;i++)selectedContent2.push(this._readPresentationSelectedContent(stream,bDuplicate))}return{content:selectedContent2, p_url:p_url,p_theme:p_theme}},_readPresentationSelectedContent:function(stream,bDuplicate){return AscFormat.ExecuteNoHistory(function(){var presentationSelectedContent=null;var fonts=[];var arr_Images=[];var oThis=this;var oFontMap={};var readContent=function(){var docContent=oThis.ReadPresentationText(stream);if(docContent.length===0)return;presentationSelectedContent.DocContent=new CSelectedContent;presentationSelectedContent.DocContent.Elements=docContent;for(var i in oThis.oFonts)oFontMap[i]= 1;bIsEmptyContent=false};var readDrawings=function(){if(PasteElementsId.g_bIsDocumentCopyPaste)History.TurnOff();var objects=oThis.ReadPresentationShapes(stream);if(PasteElementsId.g_bIsDocumentCopyPaste)History.TurnOn();presentationSelectedContent.Drawings=objects.arrShapes;var arr_shapes=objects.arrShapes;for(var i=0;i<arr_shapes.length;++i)if(arr_shapes[i].Drawing.getAllFonts)arr_shapes[i].Drawing.getAllFonts(oFontMap);arr_Images=arr_Images.concat(objects.arrImages)};var readSlideObjects=function(){var arr_slides= [];var loader=new AscCommon.BinaryPPTYLoader;if(!(bDuplicate===true))loader.Start_UseFullUrl();loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var _globalTableStyles=editor.WordControl.m_oLogicDocument.globalTableStyles;if(_globalTableStyles)for(var key in _globalTableStyles.Style)if(_globalTableStyles.Style.hasOwnProperty(key))loader.map_table_styles[_globalTableStyles.Style[key].Id]=_globalTableStyles.Style[key]; var slide_count=stream.GetULong();for(var i=0;i<slide_count;++i)if(PasteElementsId.g_bIsDocumentCopyPaste){loader.stream.GetUChar();loader.stream.SkipRecord();arr_slides[i]=null}else arr_slides[i]=loader.ReadSlide(0);var font_map={};var slideCopyObjects=[];for(var i=0;i<arr_slides.length;++i){if(arr_slides[i]&&arr_slides[i].getAllFonts){arr_slides[i].fontMap={};arr_slides[i].getAllFonts(arr_slides[i].fontMap)}slideCopyObjects[i]=arr_slides[i]}arr_Images=arr_Images.concat(loader.End_UseFullUrl()); presentationSelectedContent.SlideObjects=slideCopyObjects};var readLayouts=function(){var loader=new AscCommon.BinaryPPTYLoader;if(!(bDuplicate===true))loader.Start_UseFullUrl();loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var selected_layouts=stream.GetULong();var layouts=[];for(var i=0;i<selected_layouts;++i)if(PasteElementsId.g_bIsDocumentCopyPaste){loader.stream.GetUChar();loader.stream.SkipRecord()}else layouts.push(loader.ReadSlideLayout()); arr_Images=arr_Images.concat(loader.End_UseFullUrl());presentationSelectedContent.Layouts=layouts};var readMasters=function(){var loader=new AscCommon.BinaryPPTYLoader;if(!(bDuplicate===true))loader.Start_UseFullUrl();loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var count=stream.GetULong();var array=[];for(var i=0;i<count;++i)if(PasteElementsId.g_bIsDocumentCopyPaste){loader.stream.GetUChar(); loader.stream.SkipRecord()}else array.push(loader.ReadSlideMaster());arr_Images=arr_Images.concat(loader.End_UseFullUrl());presentationSelectedContent.Masters=array};var readNotes=function(){var loader=new AscCommon.BinaryPPTYLoader;loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var selected_notes=stream.GetULong();var notes=[];for(var i=0;i<selected_notes;++i)if(PasteElementsId.g_bIsDocumentCopyPaste){loader.stream.GetUChar(); loader.stream.SkipRecord()}else notes.push(loader.ReadNote());presentationSelectedContent.Notes=notes};var readNotesMasters=function(){var loader=new AscCommon.BinaryPPTYLoader;loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var count=stream.GetULong();var array=[];for(var i=0;i<count;++i)if(PasteElementsId.g_bIsDocumentCopyPaste){loader.stream.GetUChar();loader.stream.SkipRecord()}else array.push(loader.ReadNoteMaster()); presentationSelectedContent.NotesMasters=array};var readNotesThemes=function(){var loader=new AscCommon.BinaryPPTYLoader;loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var count=stream.GetULong();var array=[];for(var i=0;i<count;++i)array.push(loader.ReadTheme());presentationSelectedContent.NotesThemes=array};var readThemes=function(){var loader=new AscCommon.BinaryPPTYLoader;if(!(bDuplicate=== true))loader.Start_UseFullUrl();loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var count=stream.GetULong();var array=[];for(var i=0;i<count;++i)array.push(loader.ReadTheme());arr_Images=arr_Images.concat(loader.End_UseFullUrl());presentationSelectedContent.Themes=array};var readIndexes=function(){var count=stream.GetULong();var array=[];for(var i=0;i<count;++i)array.push(stream.GetULong());return array}; var bIsEmptyContent=true;var first_content=stream.GetString2();if(first_content==="SelectedContent"){var PresentationWidth=stream.GetULong()/1E5;var PresentationHeight=stream.GetULong()/1E5;var countContent=stream.GetULong();for(var i=0;i<countContent;i++){if(null===presentationSelectedContent){presentationSelectedContent=typeof PresentationSelectedContent!=="undefined"?new PresentationSelectedContent:{};presentationSelectedContent.PresentationWidth=PresentationWidth;presentationSelectedContent.PresentationHeight= PresentationHeight}var first_string=stream.GetString2();if("DocContent"!==first_string)bIsEmptyContent=false;switch(first_string){case "DocContent":{readContent();break}case "Drawings":{readDrawings();break}case "SlideObjects":{readSlideObjects();break}case "Layouts":{History.TurnOff();readLayouts();History.TurnOn();break}case "LayoutsIndexes":{presentationSelectedContent.LayoutsIndexes=readIndexes();break}case "Masters":{readMasters();break}case "MastersIndexes":{presentationSelectedContent.MastersIndexes= readIndexes();break}case "Notes":{readNotes();break}case "NotesMasters":{History.TurnOff();readNotesMasters();History.TurnOn();break}case "NotesMastersIndexes":{presentationSelectedContent.NotesMastersIndexes=readIndexes();break}case "NotesThemes":{readNotesThemes();break}case "Themes":{readThemes();break}case "ThemeIndexes":{presentationSelectedContent.ThemeIndexes=readIndexes();break}}}}if(presentationSelectedContent){var aSlides=presentationSelectedContent.SlideObjects;if(Array.isArray(aSlides))for(var i= 0;i<aSlides.length;++i){var oCurSlide=aSlides[i];var oSlideFontMap=oCurSlide?oCurSlide.fontMap:null;if(oSlideFontMap){var oTheme=null;if(Array.isArray(presentationSelectedContent.LayoutsIndexes)){var nLayoutIndex=presentationSelectedContent.LayoutsIndexes[i];if(AscFormat.isRealNumber(nLayoutIndex))if(Array.isArray(presentationSelectedContent.MastersIndexes)){var nMasterIndex=presentationSelectedContent.MastersIndexes[nLayoutIndex];if(AscFormat.isRealNumber(nMasterIndex))if(Array.isArray(presentationSelectedContent.ThemesIndexes)){var nThemeIndex= presentationSelectedContent.ThemesIndexes[nMasterIndex];if(AscFormat.isRealNumber(nThemeIndex))if(Array.isArray(presentationSelectedContent.Themes))oTheme=presentationSelectedContent.Themes[nThemeIndex]}}}if(oTheme)AscFormat.checkThemeFonts(oSlideFontMap,oTheme.themeElements.fontScheme);for(var key in oSlideFontMap)if(oSlideFontMap.hasOwnProperty(key))oFontMap[key]=1;AscFormat.checkThemeFonts(oFontMap,{});delete oCurSlide.fontMap}}for(var key in oFontMap)fonts.push(new CFont(key,0,"",0))}if(bIsEmptyContent)presentationSelectedContent= null;return{content:presentationSelectedContent,fonts:fonts,images:arr_Images}},this,[])},_pasteFromHtml:function(node,bTurnOffTrackRevisions){var oThis=this;var fPasteHtmlPresentationCallback=function(fonts,images){oThis.aContent=[];var arrShapes=[],arrImages=[],arrTables=[];var executePastePresentation=function(){if(arrShapes.length===1&&arrShapes[0].txBody&&arrShapes[0].txBody.content&&arrShapes[0].txBody.content.Content&&arrShapes[0].txBody.content.Content.length===1){var txBodyContent=arrShapes[0].txBody.content.Content[0].Content; if(txBodyContent&&txBodyContent.length===2&&txBodyContent[0].Content&&txBodyContent[0].Content.length===0)arrShapes=[]}var i,w,h;for(i=0;i<arrShapes.length;++i){shape=arrShapes[i];var txBobyContent=shape.txBody.content.Content;if(txBobyContent.length>1&&txBobyContent[0].Content)if(txBobyContent[0].Content.length===1||txBobyContent[0].Content.length===2&&txBobyContent[0].Content[0].Content&&txBobyContent[0].Content[0].Content.length===0)shape.txBody.content.Internal_Content_Remove(0,1);w=shape.txBody.getRectWidth(presentation.Width* 2/3);h=shape.txBody.content.GetSummaryHeight();AscFormat.CheckSpPrXfrm(shape);shape.spPr.xfrm.setExtX(w);shape.spPr.xfrm.setExtY(h);shape.spPr.xfrm.setOffX((presentation.Width-w)/2);shape.spPr.xfrm.setOffY((presentation.Height-h)/2);var oBodyPr=shape.getBodyPr().createDuplicate();oBodyPr.rot=0;oBodyPr.spcFirstLastPara=false;oBodyPr.vertOverflow=AscFormat.nOTOwerflow;oBodyPr.horzOverflow=AscFormat.nOTOwerflow;oBodyPr.vert=AscFormat.nVertTThorz;oBodyPr.lIns=2.54;oBodyPr.tIns=1.27;oBodyPr.rIns=2.54; oBodyPr.bIns=1.27;oBodyPr.numCol=1;oBodyPr.spcCol=0;oBodyPr.rtlCol=0;oBodyPr.fromWordArt=false;oBodyPr.anchor=4;oBodyPr.anchorCtr=false;oBodyPr.forceAA=false;oBodyPr.compatLnSpc=true;oBodyPr.prstTxWarp=AscFormat.ExecuteNoHistory(function(){return AscFormat.CreatePrstTxWarpGeometry("textNoShape")},this,[]);oBodyPr.textFit=new AscFormat.CTextFit;oBodyPr.textFit.type=AscFormat.text_fit_Auto;shape.txBody.setBodyPr(oBodyPr);shape.txBody.content.MoveCursorToEndPos();arrShapes[i]=new DrawingCopyObject(shape, 0,0,w,h)}for(i=0;i<arrTables.length;++i){shape=arrTables[i];w=100;h=100;AscFormat.CheckSpPrXfrm(shape);shape.spPr.xfrm.setExtX(w);shape.spPr.xfrm.setExtY(h);shape.spPr.xfrm.setOffX(0);shape.spPr.xfrm.setOffY(0);arrShapes[arrShapes.length]=new DrawingCopyObject(shape,0,0,w,h)}for(i=0;i<arrImages.length;++i){shape=arrImages[i];AscFormat.CheckSpPrXfrm(shape);shape.spPr.xfrm.setOffX(0);shape.spPr.xfrm.setOffY(0);arrShapes[arrShapes.length]=new DrawingCopyObject(shape,0,0,w,h)}var oController=presentation.GetCurrentController(); var targetDocContent=oController&&oController.getTargetDocContent();if(targetDocContent&&arrShapes.length===1&&arrImages.length===0&&arrTables.length===0){var aNewContent=arrShapes[0].Drawing.txBody.content.Content;oThis.InsertInPlacePresentation(aNewContent)}else{var presentationSelectedContent=new PresentationSelectedContent;presentationSelectedContent.Drawings=arrShapes;var bPaste=presentation.InsertContent(presentationSelectedContent);presentation.Recalculate();presentation.Check_CursorMoveRight(); presentation.Document_UpdateInterfaceState();var pasteOnlyImg=false;if(2===presentationSelectedContent.getContentType()){pasteOnlyImg=true;for(i=0;i<presentationSelectedContent.Drawings.length;i++)if(presentationSelectedContent.Drawings[i].Drawing.getObjectType()!==AscDFH.historyitem_type_ImageShape){pasteOnlyImg=false;break}}if(pasteOnlyImg||!bPaste){window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();if(window["AscCommon"].g_specialPasteHelper.buttonInfo){window["AscCommon"].g_specialPasteHelper.showButtonIdParagraph= null;window["AscCommon"].g_specialPasteHelper.CleanButtonInfo()}}else oThis._setSpecialPasteShowOptionsPresentation([Asc.c_oSpecialPasteProps.sourceformatting,Asc.c_oSpecialPasteProps.keepTextOnly]);window["AscCommon"].g_specialPasteHelper.Paste_Process_End()}};var presentation=editor.WordControl.m_oLogicDocument;if(presentation.Slides.length===0)presentation.addNextSlide();var shape=new CShape;shape.setParent(presentation.Slides[presentation.CurPage]);shape.setTxBody(AscFormat.CreateTextBodyFromString("", presentation.DrawingDocument,shape));arrShapes.push(shape);oThis._Execute(node,{},true,true,false,arrShapes,arrImages,arrTables);if(!fonts)fonts=[];if(!images)images=[];oThis.api.pre_Paste(fonts,images,executePastePresentation)};var fPasteHtmlWordCallback=function(fonts,images){var executePasteWord=function(){if(false===oThis.bNested)oThis.InsertInDocument();if(bTurnOffTrackRevisions)oThis.api.WordControl.m_oLogicDocument.TrackRevisions=true;if(false===oThis.bNested)if(oThis.pasteCallback)oThis.pasteCallback()}; oThis.aContent=[];if(oThis.oDocument&&oThis.oDocument.Parent&&oThis.oDocument.Parent.parent&&oThis.oDocument.Parent.parent.parent&&oThis.oDocument.Parent.parent.parent.getObjectType&&oThis.oDocument.Parent.parent.parent.getObjectType()==AscDFH.historyitem_type_Chart){var hyperlinks=node.getElementsByTagName("a");if(hyperlinks&&hyperlinks.length){var newElement;for(var i=0;i<hyperlinks.length;i++){newElement=document.createElement("span");var cssText=hyperlinks[i].getAttribute("style");if(cssText)newElement.getAttribute("style", cssText);$(newElement).append(hyperlinks[i].children);hyperlinks[i].parentNode.replaceChild(newElement,hyperlinks[i])}}var htmlImages=node.getElementsByTagName("img");if(htmlImages&&htmlImages.length)for(var i=0;i<htmlImages.length;i++)htmlImages[i].parentNode.removeChild(htmlImages[i])}if(bTurnOffTrackRevisions)oThis.api.WordControl.m_oLogicDocument.TrackRevisions=false;oThis._Execute(node,{},true,true,false);oThis._AddNextPrevToContent(oThis.oDocument);oThis.api.pre_Paste(fonts,images,executePasteWord)}; this.oRootNode=node;if(PasteElementsId.g_bIsDocumentCopyPaste){this.bIsPlainText=this._CheckIsPlainText(node);if(window["AscCommon"].g_specialPasteHelper.specialPasteStart&&Asc.c_oSpecialPasteProps.keepTextOnly===window["AscCommon"].g_specialPasteHelper.specialPasteProps)fPasteHtmlWordCallback();else this._Prepeare(node,fPasteHtmlWordCallback);if(bTurnOffTrackRevisions)oThis.api.WordControl.m_oLogicDocument.TrackRevisions=true}else{this.oRootNode=node;if(window["AscCommon"].g_specialPasteHelper.specialPasteStart&& Asc.c_oSpecialPasteProps.keepTextOnly===window["AscCommon"].g_specialPasteHelper.specialPasteProps)fPasteHtmlPresentationCallback();else this._Prepeare(node,fPasteHtmlPresentationCallback)}},_getClassBinaryFromHtml:function(node,onlyBinary){var classNode,base64FromExcel=null,base64FromWord=null,base64FromPresentation=null;if(onlyBinary)if(typeof onlyBinary==="object"){var prefix=String.fromCharCode(onlyBinary[0],onlyBinary[1],onlyBinary[2],onlyBinary[3]);if("PPTY"===prefix)base64FromPresentation= onlyBinary;else if("DOCY"===prefix)base64FromWord=onlyBinary;else if("XLSY"===prefix)base64FromExcel=onlyBinary}else if(onlyBinary.indexOf("pptData;")>-1)base64FromPresentation=onlyBinary.split("pptData;")[1];else if(onlyBinary.indexOf("docData;")>-1)base64FromWord=onlyBinary.split("docData;")[1];else{if(onlyBinary.indexOf("xslData;")>-1)base64FromExcel=onlyBinary.split("xslData;")[1]}else if(node){classNode=searchBinaryClass(node);if(classNode!=null){var cL=classNode.split(" ");for(var i=0;i<cL.length;i++)if(cL[i].indexOf("xslData;")> -1)base64FromExcel=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}}return{base64FromExcel:base64FromExcel,base64FromWord:base64FromWord,base64FromPresentation:base64FromPresentation}},_pasteText:function(text){var oThis=this;var fPasteTextWordCallback=function(){var executePasteWord=function(){if(false===oThis.bNested)oThis.InsertInDocument(!window["AscCommon"].g_specialPasteHelper.specialPasteStart)}; oThis.aContent=[];oThis._getContentFromText(text,true);oThis._AddNextPrevToContent(oThis.oDocument);oThis.api.pre_Paste([],[],executePasteWord)};var fPasteTextPresentationCallback=function(){var executePastePresentation=function(){oThis.InsertInPlacePresentation(oThis.aContent,true)};var presentation=editor.WordControl.m_oLogicDocument;if(presentation.Slides.length===0)presentation.addNextSlide();var shape=new CShape;shape.setParent(presentation.Slides[presentation.CurPage]);shape.setTxBody(AscFormat.CreateTextBodyFromString("", presentation.DrawingDocument,shape));oThis.aContent=shape.txBody.content.Content;text=text.replace(/^(\r|\t)+|(\r|\t)+$/g,"");if(text.length>0){var oContent=shape.txBody.content;oThis.oDocument=oContent;var bAddParagraph=false;var oCurParagraph=oContent.Content[0];var oCurRun=new ParaRun(oCurParagraph,false);var nCharPos=0;oCurParagraph.Internal_Content_Add(0,oCurRun);for(var oIterator=text.getUnicodeIterator();oIterator.check();oIterator.next()){if(bAddParagraph){oContent.Internal_Content_Add(oContent.Content.length, new Paragraph(oContent.DrawingDocument,oContent,oContent.bPresentation===true));oCurRun=new ParaRun(oCurParagraph,false);oCurParagraph.Internal_Content_Add(0,oCurRun);bAddParagraph=false;nCharPos=0}var nUnicode=oIterator.value();if(null!==nUnicode)if(null!==nUnicode&&13!==nUnicode)if(10===nUnicode||13===nUnicode)bAddParagraph=true;else if(9===nUnicode)oCurRun.AddToContent(nCharPos++,new ParaTab,true);else if(10===nUnicode)oCurRun.AddToContent(nCharPos++,new ParaNewLine(break_Line),true);else if(13=== nUnicode)continue;else if(AscCommon.IsSpace(nUnicode))oCurRun.AddToContent(nCharPos++,new ParaSpace(nUnicode),true);else oCurRun.AddToContent(nCharPos++,new ParaText(nUnicode),true)}}var oTextPr=presentation.GetCalculatedTextPr();shape.txBody.content.Set_ApplyToAll(true);var paraTextPr=new AscCommonWord.ParaTextPr(oTextPr);shape.txBody.content.AddToParagraph(paraTextPr);shape.txBody.content.Set_ApplyToAll(false);oThis.api.pre_Paste([],[],executePastePresentation)};if(PasteElementsId.g_bIsDocumentCopyPaste)fPasteTextWordCallback(); else fPasteTextPresentationCallback()},_getContentFromText:function(text,getStyleCurSelection){var t=this;var Count=text.length;var pasteIntoParagraphPr=this.oDocument.GetDirectParaPr();var pasteIntoParaRunPr=this.oDocument.GetDirectTextPr();var bPresentation=false;var oCurParagraph=this.oDocument.GetCurrentParagraph();var Parent=t.oDocument;if(oCurParagraph&&!oCurParagraph.bFromDocument){bPresentation=true;Parent=oCurParagraph.Parent}var getNewParagraph=function(){var paragraph=new Paragraph(t.oDocument.DrawingDocument, Parent,bPresentation);var copyParaPr;if(getStyleCurSelection)if(pasteIntoParagraphPr){copyParaPr=pasteIntoParagraphPr.Copy();copyParaPr.NumPr=undefined;paragraph.Set_Pr(copyParaPr);if(paragraph.TextPr&&pasteIntoParaRunPr)paragraph.TextPr.Value=pasteIntoParaRunPr.Copy()}return paragraph};var getNewParaRun=function(){var paraRun=new ParaRun;if(getStyleCurSelection)if(pasteIntoParaRunPr&¶Run.Set_Pr)paraRun.Set_Pr(pasteIntoParaRunPr.Copy());return paraRun};var _addToRun=function(_nUnicode){var Item; if(8201===_nUnicode||9===_nUnicode)Item=new ParaTab;else if(32!==_nUnicode&&160!==_nUnicode)Item=new ParaText(_nUnicode);else Item=new ParaSpace;newParaRun.AddToContent(-1,Item,false)};var newParagraph=getNewParagraph();var partTextCount=0;var newParaRun=getNewParaRun();for(var oIterator=text.getUnicodeIterator();oIterator.check();oIterator.next()){var pos=oIterator.position();var nUnicode=oIterator.value();if(10===nUnicode||pos===Count-1){if(pos===Count-1&&10!==nUnicode)_addToRun(nUnicode);newParagraph.Internal_Content_Add(newParagraph.Content.length- 1,newParaRun,false);this.aContent.push(newParagraph);newParagraph=getNewParagraph();newParaRun=getNewParaRun();partTextCount=0}else if(partTextCount===Asc.c_dMaxParaRunContentLength){_addToRun(nUnicode);newParagraph.Internal_Content_Add(newParagraph.Content.length-1,newParaRun,false);newParaRun=getNewParaRun();partTextCount=0}else if(13===nUnicode)continue;else{partTextCount++;_addToRun(nUnicode)}}if(partTextCount){newParagraph.Internal_Content_Add(newParagraph.Content.length-1,newParaRun,false); this.aContent.push(newParagraph)}},_isParagraphContainsOnlyDrawing:function(par){var res=true;if(par.Content)for(var i=0;i<par.Content.length;i++)if(par.Content[i]&&par.Content[i].Content&&par.Content[i].Content.length)for(var j=0;j<par.Content[i].Content.length;j++){var elem=par.Content[i].Content[j];if(!(para_Drawing===elem.Get_Type()||para_End===elem.Get_Type()))res=false}return res},_convertExcelBinary:function(aContentExcel,pDrawings){var aContent=null,tempParagraph=null;var imageUrl,isGraphicFrame, extX,extY;var fonts=null;var drawings=pDrawings?pDrawings:aContentExcel.workbook.aWorksheets[0].Drawings;if(drawings&&drawings.length){var drawing,graphicObj,paraRun,tempParaRun;aContent=[];var font_map={};for(var i=0;i<drawings.length;i++){drawing=drawings[i]&&drawings[i].Drawing?drawings[i].Drawing:drawings[i];isGraphicFrame=typeof CTable!=="undefined"&&drawing.graphicObject instanceof CTable;if(isGraphicFrame&&drawings.length>1&&drawings[i].base64){if(!tempParagraph)tempParagraph=new Paragraph(this.oDocument.DrawingDocument, this.oDocument);extX=drawings[i].ExtX;extY=drawings[i].ExtY;imageUrl=drawings[i].base64;graphicObj=AscFormat.DrawingObjectsController.prototype.createImage(imageUrl,0,0,extX,extY);tempParaRun=new ParaRun;tempParaRun.Paragraph=null;tempParaRun.Add_ToContent(0,new ParaDrawing,false);tempParaRun.Content[0].Set_GraphicObject(graphicObj);tempParaRun.Content[0].GraphicObj.setParent(tempParaRun.Content[0]);tempParaRun.Content[0].CheckWH();tempParagraph.Content.splice(tempParagraph.Content.length-1,0,tempParaRun)}else if(isGraphicFrame){drawing.setBDeleted(true); drawing.setWordFlag(false);var copyObj=drawing.graphicObject.Copy();copyObj.Set_Parent(this.oDocument);aContent[aContent.length]=copyObj;drawing.setWordFlag(true);drawing.getAllFonts(font_map)}else{if(!tempParagraph)tempParagraph=new Paragraph(this.oDocument.DrawingDocument,this.oDocument);extX=drawings[i].ExtX;extY=drawings[i].ExtY;drawing.getAllFonts(font_map);graphicObj=drawing.graphicObject?drawing.graphicObject.convertToWord(this.oLogicDocument):drawing.convertToWord(this.oLogicDocument);tempParaRun= new ParaRun;tempParaRun.Paragraph=null;var newParaDrawing=new ParaDrawing;tempParaRun.Add_ToContent(0,newParaDrawing,false);tempParaRun.Content[0].Set_GraphicObject(graphicObj);tempParaRun.Content[0].GraphicObj.setParent2(tempParaRun.Content[0]);var oGraphicObj=tempParaRun.Content[0].GraphicObj;if(oGraphicObj.spPr&&oGraphicObj.spPr.xfrm){oGraphicObj.spPr.xfrm.setOffX(0);oGraphicObj.spPr.xfrm.setOffY(0)}tempParaRun.Content[0].CheckWH();tempParagraph.Content.splice(tempParagraph.Content.length-1,0, tempParaRun)}}fonts=[];for(var i in font_map)fonts.push(new CFont(i,0,"",0));if(tempParagraph)aContent[aContent.length]=tempParagraph}else{if(!this.oDocument.bPresentation){fonts=this._convertTableFromExcel(aContentExcel);if(PasteElementsId.g_bIsDocumentCopyPaste&&this.aContent&&this.aContent.length===1&&1===this.aContent[0].Rows&&this.aContent[0].Content[0]){var _content=this.aContent[0].Content[0];if(_content&&_content.Content&&1===_content.Content.length&&_content.Content[0].Content&&_content.Content[0].Content.Content[0])this.aContent[0]= _content.Content[0].Content.Content[0]}}else fonts=this._convertTableFromExcelForChartTitle(aContentExcel);aContent=this.aContent}return{content:aContent,fonts:fonts}},_convertTableFromExcel:function(aContentExcel){var worksheet=aContentExcel.workbook.aWorksheets[0];var range;var tempActiveRef=aContentExcel.activeRange;var activeRange=AscCommonExcel.g_oRangeCache.getAscRange(tempActiveRef);var t=this;var fonts=[];var charToMM=function(mcw){var maxDigitWidth=7;var px=Asc.floor((256*mcw+Asc.floor(128/ maxDigitWidth))/256*maxDigitWidth);return px*g_dKoef_pix_to_mm};var convertBorder=function(border){var res=new CDocumentBorder;if(border.w){res.Value=border_Single;res.Size=border.w*g_dKoef_pix_to_mm}res.Color=new CDocumentColor(border.c.getR(),border.c.getG(),border.c.getB());return res};var addFont=function(fontFamily){if(!t.aContent.fonts)t.aContent.fonts=[];if(!t.oFonts)t.oFonts=[];if(!t.oFonts[fontFamily]){t.oFonts[fontFamily]={Name:fontFamily,Index:-1};fonts.push(new CFont(fontFamily,0,"",0))}}; var grid=[];var standardWidth=9;for(var i=activeRange.c1;i<=activeRange.c2;i++)if(worksheet.aCols[i])grid[i-activeRange.c1]=charToMM(worksheet.aCols[i].width);else grid[i-activeRange.c1]=charToMM(standardWidth);var table;if(editor.WordControl.m_oLogicDocument&&editor.WordControl.m_oLogicDocument.Slides){table=this._createNewPresentationTable(grid);table.Set_TableStyle(editor.WordControl.m_oLogicDocument.DefaultTableStyleId)}else table=new CTable(this.oDocument.DrawingDocument,this.oDocument,true, 0,0,grid);this.aContent.push(table);var diffRow=activeRange.r2-activeRange.r1;var diffCol=activeRange.c2-activeRange.c1;for(var i=0;i<=diffRow;i++){var row=table.private_AddRow(table.Content.length,0);var heightRowPt=worksheet.getRowHeight(i+activeRange.r1);row.SetHeight(heightRowPt*g_dKoef_pt_to_mm,linerule_AtLeast);for(var j=0;j<=diffCol;j++){if(!table.Selection.Data)table.Selection.Data=[];table.Selection.Data[table.Selection.Data.length]={Cell:j,Row:i};range=worksheet.getCell3(i+activeRange.r1, j+activeRange.c1);var oCurCell=row.Add_Cell(row.Get_CellsCount(),row,null,false);table.CurCell=oCurCell;var isMergedCell=range.hasMerged();var gridSpan=1;var vMerge=1;if(isMergedCell){gridSpan=isMergedCell.c2-isMergedCell.c1+1;vMerge=isMergedCell.r2-isMergedCell.r1+1}var sumWidthGrid=0;for(var l=0;l<gridSpan;l++)sumWidthGrid+=grid[j+l];oCurCell.Set_W(new CTableMeasurement(tblwidth_Mm,sumWidthGrid));oCurCell.Set_Margins({W:0,Type:tblwidth_Mm},3);oCurCell.Set_Margins({W:0,Type:tblwidth_Mm},1);oCurCell.Set_Margins({W:0, Type:tblwidth_Mm},0);oCurCell.Set_Margins({W:0,Type:tblwidth_Mm},2);var background_color=range.getFillColor();if(null!=background_color){var Shd=new CDocumentShd;Shd.Value=c_oAscShdClear;Shd.Color=new CDocumentColor(background_color.getR(),background_color.getG(),background_color.getB());oCurCell.Set_Shd(Shd)}var borders=range.getBorderFull();var border=convertBorder(borders.l);if(null!=border)oCurCell.Set_Border(border,3);border=convertBorder(borders.t);if(null!=border)oCurCell.Set_Border(border, 0);border=convertBorder(borders.r);if(null!=border)oCurCell.Set_Border(border,1);border=convertBorder(borders.b);if(null!=border)oCurCell.Set_Border(border,2);oCurCell.Set_GridSpan(gridSpan);if(vMerge!=1)if(isMergedCell.r1===i+activeRange.r1)oCurCell.SetVMerge(vmerge_Restart);else oCurCell.SetVMerge(vmerge_Continue);var align=range.getAlign();var textAngle=align?align.getAngle():null;if(textAngle===90)oCurCell.Pr.TextDirection=c_oAscCellTextDirection.BTLR;else if(textAngle===-90)oCurCell.Pr.TextDirection= c_oAscCellTextDirection.TBRL;var vAlign=align?align.getAlignVertical():null;switch(vAlign){case Asc.c_oAscVAlign.Bottom:oCurCell.Pr.VAlign=vertalignjc_Bottom;break;case Asc.c_oAscVAlign.Center:case Asc.c_oAscVAlign.Dist:case Asc.c_oAscVAlign.Just:oCurCell.Pr.VAlign=vertalignjc_Center;break;case Asc.c_oAscVAlign.Top:oCurCell.Pr.VAlign=vertalignjc_Top;break}var oCurPar=oCurCell.Content.Content[0];if(align){var type=range.getType();if(null!=align.hor)oCurPar.Pr.Jc=align.hor;else if(AscCommon.CellValueType.Number=== type)oCurPar.Pr.Jc=AscCommon.align_Right}var hyperLink=range.getHyperlink();var oCurHyperlink=null;if(hyperLink){oCurHyperlink=new ParaHyperlink;oCurHyperlink.SetParagraph(this.oCurPar);oCurHyperlink.Set_Value(hyperLink.Hyperlink);if(hyperLink.Tooltip)oCurHyperlink.SetToolTip(hyperLink.Tooltip)}var value2=range.getValue2();for(var n=0;n<value2.length;n++){var oCurRun=new ParaRun(oCurPar);var format=value2[n].format;oCurRun.Pr.Bold=format.getBold();var fc=format.getColor();if(fc)oCurRun.Pr.Color=new CDocumentColor(fc.getR(), fc.getG(),fc.getB());var font_family=format.getName();addFont(font_family);oCurRun.Pr.FontFamily=font_family;var oFontItem=this.oFonts[font_family];if(null!=oFontItem&&null!=oFontItem.Name){oCurRun.Pr.RFonts.Ascii={Name:oFontItem.Name,Index:oFontItem.Index};oCurRun.Pr.RFonts.HAnsi={Name:oFontItem.Name,Index:oFontItem.Index};oCurRun.Pr.RFonts.CS={Name:oFontItem.Name,Index:oFontItem.Index};oCurRun.Pr.RFonts.EastAsia={Name:oFontItem.Name,Index:oFontItem.Index}}oCurRun.Pr.FontSize=format.getSize();oCurRun.Pr.Italic= format.getItalic();oCurRun.Pr.Strikeout=format.getStrikeout();oCurRun.Pr.Underline=format.getUnderline()!==2;oCurRun.Pr.VertAlign=format.va;if(true===format.skip||true===format.repeat)oCurRun.AddToContent(-1,new ParaSpace,false);else{var value=value2[n].text;for(var oIterator=value.getUnicodeIterator();oIterator.check();oIterator.next()){var nUnicode=oIterator.value();var Item;if(10===nUnicode||13===nUnicode)Item=new ParaNewLine(break_Line);else if(32!==nUnicode&&160!==nUnicode&&8201!==nUnicode)Item= new ParaText(nUnicode);else Item=new ParaSpace;oCurRun.AddToContent(-1,Item,false)}}if(oCurHyperlink)oCurHyperlink.Add_ToContent(n,oCurRun,false);else oCurPar.Internal_Content_Add(n,oCurRun,false)}if(oCurHyperlink)oCurPar.Internal_Content_Add(n,oCurHyperlink,false);j=j+gridSpan-1}}return fonts},_convertTableFromExcelForChartTitle:function(aContentExcel){var worksheet=aContentExcel.workbook.aWorksheets[0];var range;var tempActiveRef=aContentExcel.activeRange;var activeRange=AscCommonExcel.g_oRangeCache.getAscRange(tempActiveRef); var t=this;var fonts=[];var addFont=function(fontFamily){if(!t.aContent.fonts)t.aContent.fonts=[];if(!t.oFonts)t.oFonts=[];if(!t.oFonts[fontFamily]){t.oFonts[fontFamily]={Name:fontFamily,Index:-1};fonts.push(new CFont(fontFamily,0,"",0))}};var paragraph=new Paragraph(this.oDocument.DrawingDocument,this.oDocument,true);this.aContent.push(paragraph);var diffRow=activeRange.r2-activeRange.r1;var diffCol=activeRange.c2-activeRange.c1;for(var i=0;i<=diffRow;i++)for(var j=0;j<=diffCol;j++){range=worksheet.getCell3(i+ activeRange.r1,j+activeRange.c1);var isMergedCell=range.hasMerged();var gridSpan=1;var vMerge=1;if(isMergedCell){gridSpan=isMergedCell.c2-isMergedCell.c1+1;vMerge=isMergedCell.r2-isMergedCell.r1+1}var hyperLink=range.getHyperlink();var oCurHyperlink=null;if(hyperLink){oCurHyperlink=new ParaHyperlink;oCurHyperlink.SetParagraph(paragraph);oCurHyperlink.Set_Value(hyperLink.Hyperlink);if(hyperLink.Tooltip)oCurHyperlink.SetToolTip(hyperLink.Tooltip)}var value2=range.getValue2();for(var n=0;n<value2.length;n++){var oCurRun= new ParaRun(paragraph);var format=value2[n].format;oCurRun.Pr.Bold=format.getBold();var fc=format.getColor();if(fc)oCurRun.Set_Unifill(AscFormat.CreateUnfilFromRGB(fc.getR(),fc.getG(),fc.getB()),true);var font_family=format.getName();addFont(font_family);var oFontItem=this.oFonts[font_family];if(null!=oFontItem&&null!=oFontItem.Name){oCurRun.Set_RFonts_Ascii({Name:oFontItem.Name,Index:oFontItem.Index});oCurRun.Set_RFonts_HAnsi({Name:oFontItem.Name,Index:oFontItem.Index});oCurRun.Set_RFonts_CS({Name:oFontItem.Name, Index:oFontItem.Index});oCurRun.Set_RFonts_EastAsia({Name:oFontItem.Name,Index:oFontItem.Index})}oCurRun.Set_FontSize(format.getSize());oCurRun.Set_Italic(format.getItalic());oCurRun.Set_Strikeout(format.getStrikeout());oCurRun.Set_Underline(format.getUnderline()!==2);var value=value2[n].text;for(var oIterator=value.getUnicodeIterator();oIterator.check();oIterator.next()){var nUnicode=oIterator.value();var Item;if(32!==nUnicode&&160!==nUnicode&&8201!==nUnicode)Item=new ParaText(nUnicode);else Item= new ParaSpace;oCurRun.AddToContent(-1,Item,false)}if(i!==diffRow||j!==diffCol)oCurRun.Add_ToContent(oIterator.position(),new ParaSpace,false);if(oCurHyperlink)oCurHyperlink.Add_ToContent(n,oCurRun,false);else paragraph.Internal_Content_Add(paragraph.Content.length-1,oCurRun,false)}if(oCurHyperlink)paragraph.Internal_Content_Add(paragraph.Content.length-1,oCurHyperlink,false);j=j+gridSpan-1}return fonts},_convertTableToPPTX:function(table,isFromWord){var oTable=AscFormat.ExecuteNoHistory(function(){var allRows= [];this.maxTableCell=0;if(isFromWord)table=this._replaceInnerTables(table,allRows,true);table.bPresentation=true;for(var i=0;i<table.Content.length;i++)for(var j=0;j<table.Content[i].Content.length;j++){var cDocumentContent=table.Content[i].Content[j].Content;cDocumentContent.bPresentation=true;var nIndex=0;for(var n=0;n<cDocumentContent.Content.length;n++)if(cDocumentContent.Content[n]instanceof Paragraph){cDocumentContent.Content[nIndex]=AscFormat.ConvertParagraphToPPTX(cDocumentContent.Content[nIndex], null,null,true,false);++nIndex}}table.SetTableLayout(tbllayout_Fixed);return table},this,[]);return oTable},_replaceInnerTables:function(table,allRows,isRoot){for(var i=0;i<table.Content.length;i++){allRows[allRows.length]=table.Content[i];if(this.maxTableCell<table.Content[i].Content.length)this.maxTableCell=table.Content[i].Content.length;for(var j=0;j<table.Content[i].Content.length;j++){var cDocumentContent=table.Content[i].Content[j].Content;cDocumentContent.bPresentation=true;var k=0;for(var n= 0;n<cDocumentContent.Content.length;n++)if(cDocumentContent.Content[n]instanceof CTable){this._replaceInnerTables(cDocumentContent.Content[n],allRows);cDocumentContent.Content.splice(n,1);n--}}}if(isRoot===true){for(var row=0;row<allRows.length;row++){var cells=allRows[row].Content;var cellsLength=0;for(var m=0;m<cells.length;m++)cellsLength+=cells[m].GetGridSpan();if(cellsLength<this.maxTableCell)for(var cell=cellsLength;cell<this.maxTableCell;cell++)allRows[row].Add_Cell(allRows[row].Get_CellsCount(), allRows[row],null,false)}table.Content=allRows;table.Rows=allRows.length}return table},_createNewPresentationTable:function(grid){var presentation=editor.WordControl.m_oLogicDocument;var graphicFrame=new CGraphicFrame(presentation.Slides[presentation.CurPage]);var table=new CTable(this.oDocument.DrawingDocument,graphicFrame,true,0,0,grid,true);table.SetTableLayout(tbllayout_Fixed);graphicFrame.setGraphicObject(table);graphicFrame.setNvSpPr(new AscFormat.UniNvPr);return table},_getImagesFromExcelShapes:function(aDrawings, aSpTree,aPastedImages,aUrls){var sImageUrl,nDrawingsCount,oGraphicObj,bDrawings;if(Array.isArray(aDrawings)){nDrawingsCount=aDrawings.length;bDrawings=true}else if(Array.isArray(aSpTree)){nDrawingsCount=aSpTree.length;bDrawings=false}else return;for(var i=0;i<nDrawingsCount;i++){if(bDrawings)oGraphicObj=aDrawings[i].graphicObject;else oGraphicObj=aSpTree[i];if(oGraphicObj){if(oGraphicObj.spPr){if(oGraphicObj.spPr.Fill&&oGraphicObj.spPr.Fill.fill&&typeof oGraphicObj.spPr.Fill.fill.RasterImageId=== "string"&&oGraphicObj.spPr.Fill.fill.RasterImageId.length>0){sImageUrl=oGraphicObj.spPr.Fill.fill.RasterImageId;aPastedImages[aPastedImages.length]=new AscCommon.CBuilderImages(oGraphicObj.spPr.Fill.fill,sImageUrl,null,oGraphicObj.spPr,null);aUrls[aUrls.length]=sImageUrl}if(oGraphicObj.spPr.ln&&oGraphicObj.spPr.ln.Fill&&oGraphicObj.spPr.ln.Fill.fill&&typeof oGraphicObj.spPr.ln.Fill.fill.RasterImageId==="string"&&oGraphicObj.spPr.ln.Fill.fill.RasterImageId.length>0){sImageUrl=oGraphicObj.spPr.ln.Fill.fill.RasterImageId; aPastedImages[aPastedImages.length]=new AscCommon.CBuilderImages(oGraphicObj.spPr.ln.Fill.fill,sImageUrl,null,oGraphicObj.spPr,oGraphicObj.spPr.ln.Fill.fill.RasterImageId);aUrls[aUrls.length]=sImageUrl}}switch(oGraphicObj.getObjectType()){case AscDFH.historyitem_type_ImageShape:{sImageUrl=oGraphicObj.getImageUrl();if(typeof sImageUrl==="string"&&sImageUrl.length>0){aPastedImages[aPastedImages.length]=new AscCommon.CBuilderImages(oGraphicObj.blipFill,sImageUrl,oGraphicObj,null,null);aUrls[aUrls.length]= sImageUrl}break}case AscDFH.historyitem_type_Shape:{break}case AscDFH.historyitem_type_ChartSpace:{break}case AscDFH.historyitem_type_GroupShape:{this._getImagesFromExcelShapes(null,oGraphicObj.spTree,aPastedImages,aUrls);break}}}}},_selectShapesBeforeInsert:function(aNewContent,oDoc){var content,drawingObj,allDrawingObj=[];for(var i=0;i<aNewContent.length;i++){content=aNewContent[i];drawingObj=content.GetAllDrawingObjects();if(!drawingObj||drawingObj&&!drawingObj.length||content.GetType()===type_Table){allDrawingObj= null;break}for(var n=0;n<drawingObj.length;n++)allDrawingObj[allDrawingObj.length]=drawingObj[n]}if(allDrawingObj&&allDrawingObj.length)this.oLogicDocument.SelectDrawings(allDrawingObj,oDoc)},_readFromBinaryExcel:function(base64){var oBinaryFileReader=new AscCommonExcel.BinaryFileReader(true);var tempWorkbook=new AscCommonExcel.Workbook;tempWorkbook.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;tempWorkbook.theme=this.oDocument.theme?this.oDocument.theme:this.oLogicDocument.theme; if(!tempWorkbook.theme&&this.oLogicDocument.Get_Theme)tempWorkbook.theme=this.oLogicDocument.Get_Theme();Asc.getBinaryOtherTableGVar(tempWorkbook);pptx_content_loader.Start_UseFullUrl();pptx_content_loader.Reader.ClearConnectorsMaps();oBinaryFileReader.Read(base64,tempWorkbook);pptx_content_loader.Reader.AssignConnectorsId();if(!tempWorkbook.aWorksheets.length)return null;var arrImages;var _sheet=tempWorkbook.aWorksheets[0];var pDrawings;if(_sheet&&_sheet.aSlicers&&_sheet.aSlicers.length){if(tempWorkbook.Core&& tempWorkbook.Core.subject){var _str=tempWorkbook.Core.subject;var _parseStr=_str.split(";");var _width=_parseStr[0];var _height=_parseStr[1];var _base64=_str.substring(_width.length+_height.length+2);if(_base64&&_width&&_height){var drawing=AscFormat.DrawingObjectsController.prototype.createImage(_base64,0,0,parseFloat(_width),parseFloat(_height));arrImages=[new AscCommon.CBuilderImages(new AscFormat.CBlipFill,_base64,drawing,null,null)];var objectRender=new AscFormat.DrawingObjects;var oFlags={from:false, to:false,pos:false,ext:false,editAs:window["AscCommon"].c_oAscCellAnchorType.cellanchorTwoCell};var oNewDrawing=objectRender.createDrawingObject();oNewDrawing.graphicObject=drawing;pDrawings=[oNewDrawing]}}}else arrImages=pptx_content_loader.End_UseFullUrl();return{workbook:tempWorkbook,activeRange:oBinaryFileReader.copyPasteObj.activeRange,arrImages:arrImages,pDrawings:pDrawings}},ReadPresentationText:function(stream){var loader=new AscCommon.BinaryPPTYLoader;loader.Start_UseFullUrl();loader.stream= stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var presentation=editor.WordControl.m_oLogicDocument;var shape;if(presentation.Slides)shape=new CShape(presentation.Slides[presentation.CurPage]);else shape=new CShape(presentation);shape.setTxBody(new AscFormat.CTextBody(shape));var count=stream.GetULong()/1E5;var newDocContent=new AscFormat.CDrawingDocContent(shape.txBody,editor.WordControl.m_oDrawingDocument, 0,0,0,0,false,false);var elements=[],paragraph,selectedElement;for(var i=0;i<count;++i){loader.stream.Skip2(1);paragraph=loader.ReadParagraph(newDocContent);paragraph.Document_Get_AllFontNames(this.oFonts);selectedElement=new CSelectedElement;selectedElement.Element=paragraph;elements.push(selectedElement)}return elements},ReadPresentationShapes:function(stream){var loader=new AscCommon.BinaryPPTYLoader;loader.Start_UseFullUrl();loader.ClearConnectorsMaps();pptx_content_loader.Reader.Start_UseFullUrl(); loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var presentation=editor.WordControl.m_oLogicDocument;var count=stream.GetULong();var arr_shapes=[];var arr_transforms=[];var cStyle;var foundTableStylesIdMap={};for(var i=0;i<count;++i){loader.TempMainObject=presentation&&presentation.Slides?presentation.Slides[presentation.CurPage]:presentation;var style_index=null;if(!loader.stream.GetBool())if(loader.stream.GetBool()){loader.stream.Skip2(1); cStyle=loader.ReadTableStyle(true);loader.stream.GetBool();style_index=stream.GetString2()}var drawing=loader.ReadGraphicObject();if(count===1&&typeof AscFormat.CGraphicFrame!=="undefined"&&drawing instanceof AscFormat.CGraphicFrame)if(presentation.Slides){loader.stream.Skip2(1);loader.stream.SkipRecord()}else drawing=loader.ReadGraphicObject();var x=stream.GetULong()/1E5;var y=stream.GetULong()/1E5;var extX=stream.GetULong()/1E5;var extY=stream.GetULong()/1E5;var base64=stream.GetString2();if(presentation.Slides)arr_shapes[i]= new DrawingCopyObject;else arr_shapes[i]={};arr_shapes[i].Drawing=drawing;arr_shapes[i].X=x;arr_shapes[i].Y=y;arr_shapes[i].ExtX=extX;arr_shapes[i].ExtY=extY;if(!presentation.Slides)arr_shapes[i].base64=base64;if(style_index!=null&&arr_shapes[i].Drawing.graphicObject&&arr_shapes[i].Drawing.graphicObject.Set_TableStyle)if(!PasteElementsId.g_bIsDocumentCopyPaste)if(foundTableStylesIdMap[style_index])arr_shapes[i].Drawing.graphicObject.Set_TableStyle(foundTableStylesIdMap[style_index],true);else if(cStyle&& presentation.globalTableStyles&&presentation.globalTableStyles.Style){var isFoundStyle=false;for(var j in presentation.globalTableStyles.Style)if(presentation.globalTableStyles.Style[j].isEqual(cStyle)){arr_shapes[i].Drawing.graphicObject.Set_TableStyle(j,true);foundTableStylesIdMap[style_index]=j;isFoundStyle=true;break}if(!isFoundStyle);}else{if(presentation.TableStylesIdMap[style_index])arr_shapes[i].Drawing.graphicObject.Set_TableStyle(style_index,true)}else if(cStyle);}var chartImages=pptx_content_loader.Reader.End_UseFullUrl(); var images=loader.End_UseFullUrl();loader.AssignConnectorsId();var allImages=chartImages.concat(images);return{arrShapes:arr_shapes,arrImages:allImages,arrTransforms:arr_transforms}},ReadPresentationSlides:function(stream){var loader=new AscCommon.BinaryPPTYLoader;loader.Start_UseFullUrl();loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var presentation=editor.WordControl.m_oLogicDocument;var count= stream.GetULong();var arr_slides=[];var slide;for(var i=0;i<count;++i){loader.ClearConnectorsMaps();slide=loader.ReadSlide(0);loader.AssignConnectorsId();arr_slides.push(slide)}return arr_slides},ReadSlide:function(stream){var loader=new AscCommon.BinaryPPTYLoader;loader.Start_UseFullUrl();loader.stream=stream;loader.presentation=editor.WordControl.m_oLogicDocument;loader.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;var presentation=editor.WordControl.m_oLogicDocument;return loader.ReadSlide(0)}, _Prepeare:function(node,fCallback){var oThis=this;if(true===this.bUploadImage||true===this.bUploadFonts){var aPrepeareFonts=this._Prepeare_recursive(node,true,true);var aImagesToDownload=[];var _mapLocal={};var originalSrcArr=[];for(var image in this.oImages){var src=this.oImages[image];if(undefined!==window["Native"]&&undefined!==window["Native"]["GetImageUrl"])this.oImages[image]=window["Native"]["GetImageUrl"](this.oImages[image]);else if(!g_oDocumentUrls.getImageLocal(src))if(oThis.rtfImages&& oThis.rtfImages[src]){aImagesToDownload.push(oThis.rtfImages[src]);originalSrcArr.push(src)}else{aImagesToDownload.push(src);originalSrcArr.push(src)}}if(aImagesToDownload.length>0)AscCommon.sendImgUrls(oThis.api,aImagesToDownload,function(data){var image_map={};for(var i=0,length=Math.min(data.length,aImagesToDownload.length);i<length;++i){var elem=data[i];var sFrom=originalSrcArr[i]?originalSrcArr[i]:aImagesToDownload[i];if(null!=elem.url){var name=g_oDocumentUrls.imagePath2Local(elem.path);oThis.oImages[sFrom]= name;image_map[i]=name}else image_map[i]=sFrom}fCallback(aPrepeareFonts,image_map)},null,true);else fCallback(aPrepeareFonts,this.oImages)}else fCallback()},_Prepeare_recursive:function(node,bIgnoreStyle,isCheckFonts){var nodeName=node.nodeName.toLowerCase();var nodeType=node.nodeType;if(!bIgnoreStyle)if(Node.TEXT_NODE===nodeType){var computedStyle=this._getComputedStyle(node.parentNode);var fontFamily=CheckDefaultFontFamily(this._getStyle(node.parentNode,computedStyle,"font-family"),this.apiEditor); if(fontFamily)this.oFonts[fontFamily]={Name:g_fontApplication.GetFontNameDictionary(fontFamily,true),Index:-1}}else{var src=node.getAttribute("src");if(src)this.oImages[src]=src}for(var i=0,length=node.childNodes.length;i<length;i++){var child=node.childNodes[i];var style=child.getAttribute?child.getAttribute("style"):null;if(style&&-1!==style.indexOf("mso-element:comment")&&-1===style.indexOf("mso-element:comment-list"))this._parseMsoElementComment(child);var child_nodeType=child.nodeType;if(!(Node.ELEMENT_NODE=== child_nodeType||Node.TEXT_NODE===child_nodeType))continue;if(Node.TEXT_NODE===child.nodeType){var value=child.nodeValue;if(!value)continue;value=value.replace(/(\r|\t|\n)/g,"");if(""==value)continue}this._Prepeare_recursive(child,false)}if(isCheckFonts){var aPrepeareFonts=[];for(var font_family in this.oFonts){var oFontItem=this.oFonts[font_family];this.oFonts[font_family].Index=-1;aPrepeareFonts.push(new CFont(oFontItem.Name,0,"",0))}return aPrepeareFonts}},_parseMsoElementComment:function(node){var msoTextNode= node.getElementsByClassName("MsoCommentText");if(msoTextNode&&msoTextNode[0]){var msoComment=this._getMsoCommentText(msoTextNode[0]);var msoCommentId=msoTextNode[0].parentElement.id;if(msoCommentId){var id=msoCommentId.split("_com_");if(id&&undefined!==id[1])this.msoComments[id[1]]={text:msoComment,start:false}}}},_getMsoCommentText:function(node){var res="";var bMsoAnnotation=false;var elems=node.childNodes;if(elems&&elems.length)for(var i=0;i<elems.length;i++){var child=elems[i];if(child.nodeName=== "#comment")if(child.nodeValue==="[if !supportAnnotations]")bMsoAnnotation=true;else if(bMsoAnnotation&&child.nodeValue==="[endif]")bMsoAnnotation=false;if(bMsoAnnotation)continue;if(Node.TEXT_NODE===child.nodeType){var value=child.nodeValue;if(value==="\u00a0"&&child.parentElement&&child.parentElement.getAttribute("style")==="mso-special-character:comment")continue;if(!value)continue;value=value.replace(/(\r|\t|\n)/g,"");if(""===value)continue;res+=value}else res+=this._getMsoCommentText(child)}return res}, _checkFontsOnLoad:function(fonts){if(!fonts)return;return fonts},_IsBlockElem:function(name){if("p"===name||"div"===name||"ul"===name||"ol"===name||"li"===name||"table"===name||"tbody"===name||"tr"===name||"td"===name||"th"===name||"h1"===name||"h2"===name||"h3"===name||"h4"===name||"h5"===name||"h6"===name||"center"===name||"dd"===name||"dt"===name)return true;return false},_getComputedStyle:function(node){var computedStyle=null;if(null!=node&&Node.ELEMENT_NODE===node.nodeType){var defaultView=node.ownerDocument.defaultView; computedStyle=defaultView.getComputedStyle(node,null)}return computedStyle},_getStyle:function(node,computedStyle,styleProp){var getStyle=function(){var style=null;if(computedStyle)style=computedStyle.getPropertyValue(styleProp);if(!style)if(node&&node.currentStyle)style=node.currentStyle[styleProp];return style};var res=getStyle();var sNodeName=node.nodeName.toLowerCase();if(!res)switch(styleProp){case "font-family":{res=node.fontFamily;break}case "background-color":{res=node.style.backgroundColor; if("td"===sNodeName&&!res)res=node.bgColor;break}case "font-weight":{res=node.style.fontWeight}}return res},_ParseColor:function(color){if(!color||color.length==0)return null;if("transparent"===color)return null;if("aqua"===color)return new CDocumentColor(0,255,255);else if("black"===color)return new CDocumentColor(0,0,0);else if("blue"===color)return new CDocumentColor(0,0,255);else if("fuchsia"===color)return new CDocumentColor(255,0,255);else if("gray"===color)return new CDocumentColor(128,128, 128);else if("green"===color)return new CDocumentColor(0,128,0);else if("lime"===color)return new CDocumentColor(0,255,0);else if("maroon"===color)return new CDocumentColor(128,0,0);else if("navy"===color)return new CDocumentColor(0,0,128);else if("olive"===color)return new CDocumentColor(128,128,0);else if("purple"===color)return new CDocumentColor(128,0,128);else if("red"===color)return new CDocumentColor(255,0,0);else if("silver"===color)return new CDocumentColor(192,192,192);else if("teal"=== color)return new CDocumentColor(0,128,128);else if("white"===color)return new CDocumentColor(255,255,255);else if("yellow"===color)return new CDocumentColor(255,255,0);else{if(0===color.indexOf("#")){var hex=color.substring(1);if(hex.length===3)hex=hex.charAt(0)+hex.charAt(0)+hex.charAt(1)+hex.charAt(1)+hex.charAt(2)+hex.charAt(2);if(hex.length===6){var r=parseInt("0x"+hex.substring(0,2));var g=parseInt("0x"+hex.substring(2,4));var b=parseInt("0x"+hex.substring(4,6));return new CDocumentColor(r,g, b)}}if(0===color.indexOf("rgb")){var nStart=color.indexOf("(");var nEnd=color.indexOf(")");if(-1!==nStart&&-1!==nEnd&&nStart<nEnd){var temp=color.substring(nStart+1,nEnd);var aParems=temp.split(",");if(aParems.length>=3){if(aParems.length>=4){var oA=AscCommon.valueToMmType(aParems[3]);if(0==oA.val)return null}var oR=AscCommon.valueToMmType(aParems[0]);var oG=AscCommon.valueToMmType(aParems[1]);var oB=AscCommon.valueToMmType(aParems[2]);var r,g,b;if(oR&&"%"===oR.type)r=parseInt(255*oR.val/100);else r= oR.val;if(oG&&"%"===oG.type)g=parseInt(255*oG.val/100);else g=oG.val;if(oB&&"%"===oB.type)b=parseInt(255*oB.val/100);else b=oB.val;return new CDocumentColor(r,g,b)}}}}return null},_isEmptyProperty:function(prop){var bIsEmpty=true;for(var i in prop)if(null!=prop[i]){bIsEmpty=false;break}return bIsEmpty},_set_pPr:function(node,Para,pNoHtmlPr){var t=this;var sNodeName=node.nodeName.toLowerCase();if(node!==this.oRootNode)while(false===this._IsBlockElem(sNodeName))if(this.oRootNode!==node.parentNode){node= node.parentNode;sNodeName=node.nodeName.toLowerCase()}else break;var _applyTextAlign=function(){var text_align=t._getStyle(node,computedStyle,"text-align");if(text_align){var Jc=null;if(-1!==text_align.indexOf("center"))Jc=align_Center;else if(-1!==text_align.indexOf("right"))Jc=align_Right;else if(-1!==text_align.indexOf("justify"))Jc=align_Justify;if(null!=Jc)Para.Set_Align(Jc,false)}};var computedStyle=this._getComputedStyle(node);if("td"===sNodeName||"th"===sNodeName){_applyTextAlign();var oNewSpacing= new CParaSpacing;oNewSpacing.Set_FromObject({After:0,Before:0,Line:Asc.linerule_Auto});Para.Set_Spacing(oNewSpacing);return}var oDocument=this.oDocument;if(null!=pNoHtmlPr.hLevel&&oDocument.Styles)Para.SetOutlineLvl(pNoHtmlPr.hLevel);var pPr=Para.Pr;var oNewBorder={Left:null,Top:null,Right:null,Bottom:null,Between:null};var sBorder=pNoHtmlPr["mso-border-alt"];if(null!=sBorder){var oNewBrd=this._ExecuteParagraphBorder(sBorder);oNewBorder.Left=oNewBrd;oNewBorder.Top=oNewBrd.Copy();oNewBorder.Right= oNewBrd.Copy();oNewBorder.Bottom=oNewBrd.Copy()}else{sBorder=pNoHtmlPr["mso-border-left-alt"];if(null!=sBorder){var oNewBrd=this._ExecuteParagraphBorder(sBorder);oNewBorder.Left=oNewBrd}sBorder=pNoHtmlPr["mso-border-top-alt"];if(null!=sBorder){var oNewBrd=this._ExecuteParagraphBorder(sBorder);oNewBorder.Top=oNewBrd}sBorder=pNoHtmlPr["mso-border-right-alt"];if(null!=sBorder){var oNewBrd=this._ExecuteParagraphBorder(sBorder);oNewBorder.Right=oNewBrd}sBorder=pNoHtmlPr["mso-border-bottom-alt"];if(null!= sBorder){var oNewBrd=this._ExecuteParagraphBorder(sBorder);oNewBorder.Bottom=oNewBrd}}sBorder=pNoHtmlPr["mso-border-between"];if(null!=sBorder){var oNewBrd=this._ExecuteParagraphBorder(sBorder);oNewBorder.Between=oNewBrd}if(computedStyle){var font_family=CheckDefaultFontFamily(this._getStyle(node,computedStyle,"font-family"),this.apiEditor);if(font_family&&""!=font_family){var oFontItem=this.oFonts[font_family];if(null!=oFontItem&&null!=oFontItem.Name&&Para.TextPr&&Para.TextPr.Value&&Para.TextPr.Value.RFonts){Para.TextPr.Value.RFonts.Ascii= {Name:oFontItem.Name,Index:oFontItem.Index};Para.TextPr.Value.RFonts.HAnsi={Name:oFontItem.Name,Index:oFontItem.Index};Para.TextPr.Value.RFonts.CS={Name:oFontItem.Name,Index:oFontItem.Index};Para.TextPr.Value.RFonts.EastAsia={Name:oFontItem.Name,Index:oFontItem.Index}}}var font_size=node.style?node.style.fontSize:null;if(!font_size)font_size=this._getStyle(node,computedStyle,"font-size");font_size=CheckDefaultFontSize(font_size,this.apiEditor);if(font_size&&Para.TextPr&&Para.TextPr.Value){var obj= AscCommon.valueToMmType(font_size);if(obj&&"%"!==obj.type&&"none"!==obj.type){font_size=obj.val;if("px"===obj.type&&false===this.bIsDoublePx)font_size=Math.round(font_size*g_dKoef_mm_to_pt);else font_size=Math.round(2*font_size*g_dKoef_mm_to_pt)/2;if(font_size>300)font_size=300;else if(font_size===0)font_size=1;Para.TextPr.Value.FontSize=font_size}}var Ind=new CParaInd;var margin_left=this._getStyle(node,computedStyle,"margin-left");var curContent=this.oLogicDocument.Content[this.oLogicDocument.CurPos.ContentPos]; var curIndexColumn=curContent&&curContent.Get_CurrentColumn?curContent.Get_CurrentColumn(this.oLogicDocument.CurPage):null;var curPage=this.oLogicDocument.Pages[this.oLogicDocument.CurPage];var pageColumn=null!==curIndexColumn&&curPage&&curPage.Sections&&curPage.Sections[0]&&curPage.Sections[0].Columns?curPage.Sections[0].Columns[curIndexColumn]:null;if(margin_left&&null!=(margin_left=AscCommon.valueToMm(margin_left)))if(!pageColumn||pageColumn&&pageColumn.X+margin_left<pageColumn.XLimit)Ind.Left= margin_left;var margin_right=this._getStyle(node,computedStyle,"margin-right");if(margin_right&&null!=(margin_right=AscCommon.valueToMm(margin_right)))if(!pageColumn||pageColumn&&pageColumn.XLimit-margin_right>pageColumn.X)Ind.Right=margin_right;if(null!=Ind.Left&&null!=Ind.Right){var dif=Page_Width-X_Left_Margin-X_Right_Margin-Ind.Left-Ind.Right;if(dif<30)Ind.Right=Page_Width-X_Left_Margin-X_Right_Margin-Ind.Left-30}var text_indent=this._getStyle(node,computedStyle,"text-indent");if(text_indent&& null!=(text_indent=AscCommon.valueToMm(text_indent)))Ind.FirstLine=text_indent;if(false===this._isEmptyProperty(Ind)&&!pNoHtmlPr["mso-list"])Para.Set_Ind(Ind);_applyTextAlign();var Spacing=new CParaSpacing;var margin_top=this._getStyle(node,computedStyle,"margin-top");if(margin_top&&null!=(margin_top=AscCommon.valueToMm(margin_top))&&margin_top>=0)Spacing.Before=margin_top;var margin_bottom=this._getStyle(node,computedStyle,"margin-bottom");if(margin_bottom&&null!=(margin_bottom=AscCommon.valueToMm(margin_bottom))&& margin_bottom>=0)Spacing.After=margin_bottom;var line_height=node.style&&node.style.lineHeight?node.style.lineHeight:this._getStyle(node,computedStyle,"line-height");if(line_height){var oLineHeight=AscCommon.valueToMmType(line_height);if(oLineHeight&&"%"===oLineHeight.type)Spacing.Line=oLineHeight.val;else if(line_height&&null!=(line_height=AscCommon.valueToMm(line_height))&&line_height>=0){Spacing.Line=line_height;Spacing.LineRule=Asc.linerule_AtLeast}}if(false===this._isEmptyProperty(Spacing))Para.Set_Spacing(Spacing); var background_color=null;var oTempNode=node;while(true){var tempComputedStyle=this._getComputedStyle(oTempNode);if(null==tempComputedStyle)break;background_color=this._getStyle(oTempNode,tempComputedStyle,"background-color");if(null!=background_color&&(background_color=this._ParseColor(background_color)))break;oTempNode=oTempNode.parentNode;if(this.oRootNode===oTempNode||"body"===oTempNode.nodeName.toLowerCase()||true===this._IsBlockElem(oTempNode.nodeName.toLowerCase()))break}if(PasteElementsId.g_bIsDocumentCopyPaste)if(background_color){var Shd= new CDocumentShd;Shd.Value=c_oAscShdClear;Shd.Color=background_color;Para.Set_Shd(Shd)}if(null==oNewBorder.Left)oNewBorder.Left=this._ExecuteBorder(computedStyle,node,"left","Left",false);if(null==oNewBorder.Top)oNewBorder.Top=this._ExecuteBorder(computedStyle,node,"top","Top",false);if(null==oNewBorder.Right)oNewBorder.Right=this._ExecuteBorder(computedStyle,node,"left","Left",false);if(null==oNewBorder.Bottom)oNewBorder.Bottom=this._ExecuteBorder(computedStyle,node,"bottom","Bottom",false)}if(false=== this._isEmptyProperty(oNewBorder))Para.Set_Borders(oNewBorder);var pagination=pNoHtmlPr["mso-pagination"];if(pagination)if("none"===pagination);else if(-1!==pagination.indexOf("widow-orphan")&&-1!==pagination.indexOf("lines-together"))Para.Set_KeepLines(true);else if(-1!==pagination.indexOf("none")&&-1!==pagination.indexOf("lines-together"))Para.Set_KeepLines(true);if("avoid"===pNoHtmlPr["page-break-after"]);if("always"===pNoHtmlPr["page-break-before"])Para.Set_PageBreakBefore(true);var tab_stops= pNoHtmlPr["tab-stops"];if(tab_stops&&""!=pNoHtmlPr["tab-stops"]){var aTabs=tab_stops.split(" ");var nTabLen=aTabs.length;if(nTabLen>0){var Tabs=new CParaTabs;for(var i=0;i<nTabLen;i++){var val=AscCommon.valueToMm(aTabs[i]);if(val)Tabs.Add(new CParaTab(tab_Left,val))}Para.Set_Tabs(Tabs)}}if(PasteElementsId.g_bIsDocumentCopyPaste)if(true===pNoHtmlPr.bNum){var setListTextPr=function(oNum){var oFirstTextChild=node;while(true){var bContinue=false;for(var i=0,length=oFirstTextChild.childNodes.length;i< length;i++){var child=oFirstTextChild.childNodes[i];var nodeType=child.nodeType;if(!(Node.ELEMENT_NODE===nodeType||Node.TEXT_NODE===nodeType))continue;if(Node.TEXT_NODE===child.nodeType){var value=child.nodeValue;if(!value)continue;value=value.replace(/(\r|\t|\n)/g,"");if(""===value)continue}if(Node.ELEMENT_NODE===nodeType){oFirstTextChild=child;bContinue=true;break}}if(false===bContinue)break}if(node!=oFirstTextChild)if(!t.bIsPlainText){var oLvl=oNum.GetLvl(0);var oTextPr=t._read_rPr(oFirstTextChild); if(Asc.c_oAscNumberingFormat.Bullet===num)oTextPr.RFonts=oLvl.GetTextPr().RFonts.Copy();oTextPr.Bold=oTextPr.Underline=oTextPr.Italic=undefined;if(oFirstTextChild.nodeName.toLowerCase()==="a"&&oTextPr.Color)oTextPr.Color.Set(0,0,0);oNum.ApplyTextPr(0,oTextPr)}};if(pNoHtmlPr["mso-list"]){var level=0;var listId=null;var startIndex;if(-1!==(startIndex=pNoHtmlPr["mso-list"].indexOf("level")))level=parseInt(pNoHtmlPr["mso-list"].substr(startIndex+5,1))-1;if(-1!==(startIndex=pNoHtmlPr["mso-list"].indexOf("lfo")))listId= pNoHtmlPr["mso-list"].substr(startIndex,4);var NumId=null;if(listId&&this.msoListMap[listId])NumId=this.msoListMap[listId];var msoListIgnoreSymbol=this._getMsoListSymbol(node);if(!msoListIgnoreSymbol)msoListIgnoreSymbol="ol"===node.parentElement.nodeName.toLowerCase()?"1.":".";var listObj=this._getTypeMsoListSymbol(msoListIgnoreSymbol,null===NumId);var num=listObj.type;var startPos=listObj.startPos;if(null==NumId&&this.pasteInExcel!==true){var oNum=this.oLogicDocument.GetNumbering().CreateNum();NumId= oNum.GetId();if(Asc.c_oAscNumberingFormat.Bullet===num){oNum.CreateDefault(c_oAscMultiLevelNumbering.Bullet);var LvlText=String.fromCharCode(183);var NumTextPr=new CTextPr;NumTextPr.RFonts.Set_All("Symbol",-1);switch(type){case "disc":{NumTextPr.RFonts.Set_All("Symbol",-1);LvlText=String.fromCharCode(183);break}case "circle":{NumTextPr.RFonts.Set_All("Courier New",-1);LvlText="o";break}case "square":{NumTextPr.RFonts.Set_All("Wingdings",-1);LvlText=String.fromCharCode(167);break}}}else oNum.CreateDefault(c_oAscMultiLevelNumbering.Numbered); switch(num){case Asc.c_oAscNumberingFormat.Bullet:oNum.SetLvlByType(level,c_oAscNumberingLevel.Bullet,LvlText,NumTextPr);break;case Asc.c_oAscNumberingFormat.Decimal:oNum.SetLvlByType(level,c_oAscNumberingLevel.DecimalDot_Left);break;case Asc.c_oAscNumberingFormat.LowerRoman:oNum.SetLvlByType(level,c_oAscNumberingLevel.LowerRomanDot_Right);break;case Asc.c_oAscNumberingFormat.UpperRoman:oNum.SetLvlByType(level,c_oAscNumberingLevel.UpperRomanDot_Right);break;case Asc.c_oAscNumberingFormat.LowerLetter:oNum.SetLvlByType(level, c_oAscNumberingLevel.LowerLetterDot_Left);break;case Asc.c_oAscNumberingFormat.UpperLetter:oNum.SetLvlByType(level,c_oAscNumberingLevel.UpperLetterDot_Left);break}if(null!==startPos)oNum.SetLvlStart(level,startPos)}if(!this.msoListMap[listId])this.msoListMap[listId]=NumId;if(this.pasteInExcel!==true&&Para.bFromDocument===true)Para.SetNumPr(NumId,level)}else{var num=Asc.c_oAscNumberingFormat.Bullet;if(null!=pNoHtmlPr.numType)num=pNoHtmlPr.numType;var type=pNoHtmlPr["list-style-type"];if(type)switch(type){case "disc":num= Asc.c_oAscNumberingFormat.Bullet;break;case "decimal":num=Asc.c_oAscNumberingFormat.Decimal;break;case "lower-roman":num=Asc.c_oAscNumberingFormat.LowerRoman;break;case "upper-roman":num=Asc.c_oAscNumberingFormat.UpperRoman;break;case "lower-alpha":num=Asc.c_oAscNumberingFormat.LowerLetter;break;case "upper-alpha":num=Asc.c_oAscNumberingFormat.UpperLetter;break}if(this.aContent.length>1){var prevElem=this.aContent[this.aContent.length-2];if(null!=prevElem&&type_Paragraph===prevElem.GetType()){var PrevNumPr= prevElem.GetNumPr();if(null!=PrevNumPr&&true===this.oLogicDocument.Numbering.CheckFormat(PrevNumPr.NumId,PrevNumPr.Lvl,num))NumId=PrevNumPr.NumId}}if(null==NumId&&this.pasteInExcel!==true){var oNum=this.oLogicDocument.GetNumbering().CreateNum();NumId=oNum.GetId();if(Asc.c_oAscNumberingFormat.Bullet===num){oNum.CreateDefault(c_oAscMultiLevelNumbering.Bullet);var LvlText=String.fromCharCode(183);var NumTextPr=new CTextPr;NumTextPr.RFonts.Set_All("Symbol",-1);switch(type){case "disc":{NumTextPr.RFonts.Set_All("Symbol", -1);LvlText=String.fromCharCode(183);break}case "circle":{NumTextPr.RFonts.Set_All("Courier New",-1);LvlText="o";break}case "square":{NumTextPr.RFonts.Set_All("Wingdings",-1);LvlText=String.fromCharCode(167);break}}}else oNum.CreateDefault(c_oAscMultiLevelNumbering.Numbered);for(var iLvl=0;iLvl<=8;iLvl++)switch(num){case Asc.c_oAscNumberingFormat.Bullet:oNum.SetLvlByType(iLvl,c_oAscNumberingLevel.Bullet,LvlText,NumTextPr);break;case Asc.c_oAscNumberingFormat.Decimal:oNum.SetLvlByType(iLvl,c_oAscNumberingLevel.DecimalDot_Right); break;case Asc.c_oAscNumberingFormat.LowerRoman:oNum.SetLvlByType(iLvl,c_oAscNumberingLevel.LowerRomanDot_Right);break;case Asc.c_oAscNumberingFormat.UpperRoman:oNum.SetLvlByType(iLvl,c_oAscNumberingLevel.UpperRomanDot_Right);break;case Asc.c_oAscNumberingFormat.LowerLetter:oNum.SetLvlByType(iLvl,c_oAscNumberingLevel.LowerLetterDot_Left);break;case Asc.c_oAscNumberingFormat.UpperLetter:oNum.SetLvlByType(iLvl,c_oAscNumberingLevel.UpperLetterDot_Left);break}setListTextPr(oNum)}if(this.pasteInExcel!== true&&Para.bFromDocument===true)Para.ApplyNumPr(NumId,0)}}else{var numPr=Para.GetNumPr();if(numPr)Para.RemoveNumPr()}else if(true===pNoHtmlPr.bNum){var num=numbering_presentationnumfrmt_Char;if(null!=pNoHtmlPr.numType)num=pNoHtmlPr.numType;var type=pNoHtmlPr["list-style-type"];var oBullet=null;if(type)switch(type){case "disc":{oBullet=AscFormat.fGetPresentationBulletByNumInfo({Type:0,SubType:1});break}case "decimal":{oBullet=AscFormat.fGetPresentationBulletByNumInfo({Type:1,SubType:0});break}case "lower-roman":{oBullet= AscFormat.fGetPresentationBulletByNumInfo({Type:1,SubType:7});break}case "upper-roman":{oBullet=AscFormat.fGetPresentationBulletByNumInfo({Type:1,SubType:3});break}case "lower-alpha":{oBullet=AscFormat.fGetPresentationBulletByNumInfo({Type:1,SubType:6});break}case "upper-alpha":{oBullet=AscFormat.fGetPresentationBulletByNumInfo({Type:1,SubType:4});break}default:{oBullet=AscFormat.fGetPresentationBulletByNumInfo({Type:0,SubType:1});break}}Para.Add_PresentationNumbering(oBullet)}else Para.Remove_PresentationNumbering(); Para.CompiledPr.NeedRecalc=true},_commit_rPr:function(node,bUseOnlyInherit){if(!this.bIsPlainText){var rPr=this._read_rPr(node,bUseOnlyInherit);var tempRpr;var bSaveExcelFormat=window["AscCommon"].g_clipboardBase.bSaveFormat;if(this.pasteInExcel===true&&!bSaveExcelFormat&&this.oDocument&&this.oDocument.Parent&&this.oDocument.Parent.parent&&this.oDocument.Parent.parent.getObjectType()===AscDFH.historyitem_type_Shape){tempRpr=new CTextPr;tempRpr.Underline=rPr.Underline;tempRpr.Bold=rPr.Bold;tempRpr.Italic= rPr.Italic;rPr=tempRpr}if(!this.oCur_rPr.Is_Equal(rPr)){this._Set_Run_Pr(rPr);this.oCur_rPr=rPr}}},_read_rPr:function(node,bUseOnlyInherit){var oDocument=this.oDocument;var rPr=new CTextPr;if(false==PasteElementsId.g_bIsDocumentCopyPaste)rPr.Set_FromObject({Bold:false,Italic:false,Underline:false,Strikeout:false,RFonts:{Ascii:{Name:"Arial",Index:-1},EastAsia:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1},CS:{Name:"Arial",Index:-1}},FontSize:11,Color:{r:0,g:0,b:0},VertAlign:AscCommon.vertalign_Baseline, HighLight:highlight_None});var computedStyle=this._getComputedStyle(node);if(computedStyle){var font_family=CheckDefaultFontFamily(this._getStyle(node,computedStyle,"font-family"),this.apiEditor);if(font_family&&""!=font_family){var oFontItem=this.oFonts[font_family];if(null!=oFontItem&&null!=oFontItem.Name){rPr.RFonts.Ascii={Name:oFontItem.Name,Index:oFontItem.Index};rPr.RFonts.HAnsi={Name:oFontItem.Name,Index:oFontItem.Index};rPr.RFonts.CS={Name:oFontItem.Name,Index:oFontItem.Index};rPr.RFonts.EastAsia= {Name:oFontItem.Name,Index:oFontItem.Index}}}var font_size=node.style?node.style.fontSize:null;if(!font_size)font_size=this._getStyle(node,computedStyle,"font-size");font_size=CheckDefaultFontSize(font_size,this.apiEditor);if(font_size){var obj=AscCommon.valueToMmType(font_size);if(obj&&"%"!==obj.type&&"none"!==obj.type){font_size=obj.val;if("px"===obj.type&&false===this.bIsDoublePx)font_size=Math.round(font_size*g_dKoef_mm_to_pt);else font_size=Math.round(2*font_size*g_dKoef_mm_to_pt)/2;if(font_size> 300)font_size=300;else if(font_size===0)font_size=1;rPr.FontSize=font_size}}var font_weight=this._getStyle(node,computedStyle,"font-weight");if(font_weight)if("bold"===font_weight||"bolder"===font_weight||400<font_weight)rPr.Bold=true;var font_style=this._getStyle(node,computedStyle,"font-style");if("italic"===font_style)rPr.Italic=true;var color=this._getStyle(node,computedStyle,"color");if(color&&(color=this._ParseColor(color)))if(PasteElementsId.g_bIsDocumentCopyPaste)rPr.Color=color;else if(color)rPr.Unifill= AscFormat.CreateUnfilFromRGB(color.r,color.g,color.b);var spacing=this._getStyle(node,computedStyle,"letter-spacing");if(spacing&&null!=(spacing=AscCommon.valueToMm(spacing)))rPr.Spacing=spacing;var background_color=null;var underline=null;var Strikeout=null;var vertical_align=null;var oTempNode=node;while(true!==bUseOnlyInherit&&true){var tempComputedStyle=this._getComputedStyle(oTempNode);if(null==tempComputedStyle)break;if(null==underline||null==Strikeout){var text_decoration=this._getStyle(node, tempComputedStyle,"text-decoration");if(text_decoration){if(-1!==text_decoration.indexOf("underline"))underline=true;else if(-1!==text_decoration.indexOf("none")&&node.parentElement&&node.parentElement.nodeName.toLowerCase()==="a")underline=false;if(-1!==text_decoration.indexOf("line-through"))Strikeout=true}}if(null==background_color){background_color=this._getStyle(node,tempComputedStyle,"background-color");if(background_color)background_color=this._ParseColor(background_color);else background_color= null}if(null==vertical_align||"baseline"===vertical_align){vertical_align=this._getStyle(node,tempComputedStyle,"vertical-align");if(!vertical_align)vertical_align=null}if(vertical_align&&background_color&&Strikeout&&underline)break;oTempNode=oTempNode.parentNode;if(this.oRootNode===oTempNode||"body"===oTempNode.nodeName.toLowerCase()||true===this._IsBlockElem(oTempNode.nodeName.toLowerCase()))break}if(PasteElementsId.g_bIsDocumentCopyPaste){if(background_color)rPr.HighLight=background_color}else delete rPr.HighLight; if(null!=underline)rPr.Underline=underline;if(null!=Strikeout)rPr.Strikeout=Strikeout;switch(vertical_align){case "sub":rPr.VertAlign=AscCommon.vertalign_SubScript;break;case "super":rPr.VertAlign=AscCommon.vertalign_SuperScript;break}}return rPr},_parseCss:function(sStyles,pPr){var aStyles=sStyles.split(";");if(aStyles)for(var i=0,length=aStyles.length;i<length;i++){var style=aStyles[i];var aPair=style.split(":");if(aPair&&aPair.length>1){var prop_name=trimString(aPair[0]);var prop_value=trimString(aPair[1]); if(null!=this.MsoStyles[prop_name])pPr[prop_name]=prop_value}}},_PrepareContent:function(){if(this.aContent.length>0){var last=this.aContent[this.aContent.length-1];if(type_Table===last.GetType())this._Add_NewParagraph()}},_getMsoListSymbol:function(node){var res=null;var nodeList=this._getMsoListIgnore(node);if(nodeList){var value=nodeList.innerText;if(value)for(var pos=value.getUnicodeIterator();pos.check();pos.next()){var nUnicode=pos.value();if(null!==nUnicode)if(32!==nUnicode&&160!==nUnicode&& 8201!==nUnicode){if(!res)res="";res+=value.charAt(pos.position())}}}return res},_getMsoListIgnore:function(node){if(!node||node&&!node.children)return null;for(var i=0;i<node.children.length;i++){var child=node.children[i];var style=child.getAttribute("style");if(style){var pNoHtml={};this._parseCss(style,pNoHtml);if("Ignore"===pNoHtml["mso-list"])return child}if(child.children&&child.children.length)return this._getMsoListIgnore(child)}},_getTypeMsoListSymbol:function(str,getStartPosition){var symbolsArr= ["ivxlcdm","IVXLCDM","abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ"];var romanToIndex=function(text){var arab_number=[1,4,5,9,10,40,50,90,100,400,500,900,1E3,4E3,5E3,9E3,1E4];var rom_number=["I","IV","V","IX","X","XL","L","XC","C","CD","D","CM","M","Mↁ","ↁ","ↁↂ","ↂ"];var text=text.toUpperCase();var result=0;var pos=0;var i=arab_number.length-1;while(i>=0&&pos<text.length)if(text.substr(pos,rom_number[i].length)===rom_number[i]){result+=arab_number[i];pos+= rom_number[i].length}else i--;return result};var latinToIndex=function(text){var text=text.toUpperCase();var index=0;for(var i=0;i<text.length;i++)index+=symbolsArr[3].indexOf(text[i])+1;return index};var getFullListIndex=function(indexStr,str){var fullListIndex="";for(var i=0;i<str.length;i++){var symbol=str[i];if(-1!==indexStr.indexOf(symbol))fullListIndex+=symbol;else break}return fullListIndex};var resType=Asc.c_oAscNumberingFormat.Bullet;var number=parseInt(str);var startPos=null,fullListIndex; if(!isNaN(number)){resType=Asc.c_oAscNumberingFormat.Decimal;startPos=number}else if(1===str.length&&-1!==str.indexOf("o"))resType=Asc.c_oAscNumberingFormat.Bullet;else{var firstSymbol=str[0];if(-1!==symbolsArr[0].indexOf(firstSymbol)){if(getStartPosition){fullListIndex=getFullListIndex(symbolsArr[0],str);startPos=romanToIndex(fullListIndex)}resType=Asc.c_oAscNumberingFormat.LowerRoman}else if(-1!==symbolsArr[1].indexOf(firstSymbol)){if(getStartPosition){fullListIndex=getFullListIndex(symbolsArr[1], str);startPos=romanToIndex(fullListIndex)}resType=Asc.c_oAscNumberingFormat.UpperRoman}else if(-1!==symbolsArr[2].indexOf(firstSymbol)){if(getStartPosition){fullListIndex=getFullListIndex(symbolsArr[2],str);startPos=latinToIndex(fullListIndex)}resType=Asc.c_oAscNumberingFormat.LowerLetter}else if(-1!==symbolsArr[3].indexOf(firstSymbol)){if(getStartPosition){fullListIndex=getFullListIndex(symbolsArr[3],str);startPos=latinToIndex(fullListIndex)}resType=Asc.c_oAscNumberingFormat.UpperLetter}}return{type:resType, startPos:startPos}},_AddNextPrevToContent:function(oDoc){var prev=null;for(var i=0,length=this.aContent.length;i<length;++i){var cur=this.aContent[i];cur.Set_DocumentPrev(prev);cur.Parent=oDoc;if(prev)prev.Set_DocumentNext(cur);prev=cur}},_Set_Run_Pr:function(oPr){this._CommitRunToParagraph(false);if(null!=this.oCurRun)this.oCurRun.Set_Pr(oPr)},_CommitRunToParagraph:function(bCreateNew){if(bCreateNew||this.oCurRun.Content.length>0){this.oCurRun=new ParaRun(this.oCurPar);this.oCurRunContentPos=0}}, _CommitElemToParagraph:function(elem){if(null!=this.oCurHyperlink){this.oCurHyperlink.Add_ToContent(this.oCurHyperlinkContentPos,elem,false);this.oCurHyperlinkContentPos++}else{this.oCurPar.Internal_Content_Add(this.oCurParContentPos,elem,false);this.oCurParContentPos++}},_AddToParagraph:function(elem){if(null!=this.oCurRun)if(para_Hyperlink===elem.Type){this._CommitRunToParagraph(true);this._CommitElemToParagraph(elem)}else{if(this.oCurRun.Content.length===Asc.c_dMaxParaRunContentLength)if(this.oCurRun&& this.oCurRun.Pr&&this.oCurRun.Pr.Copy)this._Set_Run_Pr(this.oCurRun.Pr.Copy());this.oCurRun.Add_ToContent(this.oCurRunContentPos,elem,false);this.oCurRunContentPos++;if(1===this.oCurRun.Content.length)this._CommitElemToParagraph(this.oCurRun)}},_Add_NewParagraph:function(){var bFromPresentation=false;if(this.pasteInPresentationShape)bFromPresentation=true;this.oCurPar=new Paragraph(this.oDocument.DrawingDocument,this.oDocument,this.oDocument.bPresentation===true);this.oCurParContentPos=this.oCurPar.CurPos.ContentPos; this.oCurRun=new ParaRun(this.oCurPar);this.oCurRunContentPos=0;this.aContent.push(this.oCurPar);this.oCur_rPr=new CTextPr},_Execute_AddParagraph:function(node,pPr){this._Add_NewParagraph();this._set_pPr(node,this.oCurPar,pPr)},_Decide_AddParagraph:function(node,pPr,bParagraphAdded,bCommitBr){if(true==bParagraphAdded){if(false!=bCommitBr)this._Commit_Br(2,node,pPr);this._Execute_AddParagraph(node,pPr)}else if(false!=bCommitBr)this._Commit_Br(0,node,pPr);return false},_Commit_Br:function(nIgnore,node, pPr){for(var i=0,length=this.nBrCount-nIgnore;i<length;i++)if("always"===pPr["mso-column-break-before"])this._AddToParagraph(new ParaNewLine(break_Page));else if(this.bInBlock)this._AddToParagraph(new ParaNewLine(break_Line));else this._Execute_AddParagraph(node,pPr);this.nBrCount=0},_StartExecuteTable:function(node,pPr,arrShapes,arrImages,arrTables){var oDocument=this.oDocument;var tableNode=node,newNode,headNode;var bPresentation=!PasteElementsId.g_bIsDocumentCopyPaste;var i,length,j,length2;for(i= 0,length=node.childNodes.length;i<length;++i){var nodeName=node.childNodes[i].nodeName.toLowerCase();if("tbody"===nodeName)if(!newNode){newNode=node.childNodes[i];if(headNode){for(j=0;j<headNode.childNodes.length;j++)newNode.insertBefore(headNode.childNodes[0],newNode.childNodes[0]);pPr.repeatHeaderRow=true}}else{var lengthChild=node.childNodes[i].childNodes.length;for(j=0;j<lengthChild;j++)newNode.appendChild(node.childNodes[i].childNodes[0])}else if("thead"===nodeName)headNode=node.childNodes[i]}if(newNode){node= newNode;tableNode=newNode}var nRowCount=0;var nMinColCount=0;var nMaxColCount=0;var aColsCountByRow=[];var oRowSums={};oRowSums[0]=0;var dMaxSum=0;var nCurColWidth=0;var nCurSum=0;var nAllSum=0;var oRowSpans={};var columnSize;if(!bPresentation&&(!window["Asc"]||window["Asc"]&&window["Asc"]["editor"]===undefined)&&this.oLogicDocument)columnSize=this.oLogicDocument.GetColumnSize();var fParseSpans=function(){var spans=oRowSpans[nCurColWidth];while(null!=spans&&spans.row>0){spans.row--;nCurColWidth+= spans.col;nCurSum+=spans.width;spans=oRowSpans[nCurColWidth]}};var tc,tcName,nCurRowSpan;for(i=0,length=node.childNodes.length;i<length;++i){var tr=node.childNodes[i];if("tr"===tr.nodeName.toLowerCase()){nCurSum=0;nCurColWidth=0;var minRowSpanIndex=null;var nMinRowSpanCount=null;for(j=0,length2=tr.childNodes.length;j<length2;++j){tc=tr.childNodes[j];tcName=tc.nodeName.toLowerCase();if("td"===tcName||"th"===tcName){fParseSpans();var dWidth=null;var computedStyle=this._getComputedStyle(tc);var computedWidth= this._getStyle(tc,computedStyle,"width");if(null!=computedWidth&&null!=(computedWidth=AscCommon.valueToMm(computedWidth)))dWidth=computedWidth;if(null==dWidth)dWidth=tc.clientWidth*g_dKoef_pix_to_mm;var nColSpan=tc.getAttribute("colspan");if(null!=nColSpan)nColSpan=nColSpan-0;else nColSpan=1;nCurRowSpan=tc.getAttribute("rowspan");if(null!=nCurRowSpan){nCurRowSpan=nCurRowSpan-0;if(null==nMinRowSpanCount){nMinRowSpanCount=nCurRowSpan;minRowSpanIndex=j}else if(nMinRowSpanCount>nCurRowSpan){nMinRowSpanCount= nCurRowSpan;minRowSpanIndex=j}if(nCurRowSpan>1)oRowSpans[nCurColWidth]={row:nCurRowSpan-1,col:nColSpan,width:dWidth}}else{nMinRowSpanCount=0;minRowSpanIndex=j}nCurSum+=dWidth;if(null==oRowSums[nCurColWidth+nColSpan])oRowSums[nCurColWidth+nColSpan]=nCurSum;else if(null!=oRowSums[nCurColWidth+nColSpan-1]&&oRowSums[nCurColWidth+nColSpan-1]>=oRowSums[nCurColWidth+nColSpan])oRowSums[nCurColWidth+nColSpan]+=nCurSum;nCurColWidth+=nColSpan}}nAllSum+=nCurSum;fParseSpans();if(nMinRowSpanCount>1)for(j=0,length2= tr.childNodes.length;j<length2;++j){tc=tr.childNodes[j];tcName=tc.nodeName.toLowerCase();if(minRowSpanIndex!==j&&("td"===tcName||"th"===tcName)){nCurRowSpan=tc.getAttribute("rowspan");if(null!=nCurRowSpan)tc.setAttribute("rowspan",nCurRowSpan-nMinRowSpanCount)}}if(dMaxSum<nCurSum)dMaxSum=nCurSum;if(0===nCurColWidth){node.removeChild(tr);length--;i--}else{if(0===nMinColCount||nMinColCount>nCurColWidth)nMinColCount=nCurColWidth;if(nMaxColCount<nCurColWidth)nMaxColCount=nCurColWidth;nRowCount++;aColsCountByRow.push(nCurColWidth)}}}if(nMaxColCount!== nMinColCount)for(i=0,length=aColsCountByRow.length;i<length;++i)aColsCountByRow[i]=nMaxColCount-aColsCountByRow[i];if(nRowCount>0&&nMaxColCount>0){var bUseScaleKoef=this.bUseScaleKoef;var dScaleKoef=this.dScaleKoef;if(dMaxSum*dScaleKoef>this.dMaxWidth){dScaleKoef=dScaleKoef*this.dMaxWidth/dMaxSum;bUseScaleKoef=true}var aGrid=[];var nPrevIndex=null;var nPrevVal=0;for(i in oRowSums){var nCurIndex=i-0;var nCurVal=oRowSums[i];var nCurWidth=nCurVal-nPrevVal;if(bUseScaleKoef)nCurWidth*=dScaleKoef;if(null!= nPrevIndex){var nDif=nCurIndex-nPrevIndex;if(1===nDif)if(!nCurWidth&&!nAllSum&&columnSize)aGrid.push(columnSize.W/nMaxColCount);else aGrid.push(nCurWidth);else{var nPartVal=nCurWidth/nDif;for(j=0;j<nDif;++j)aGrid.push(nPartVal)}}nPrevVal=nCurVal;nPrevIndex=nCurIndex}var table;if(bPresentation){table=this._createNewPresentationTable(aGrid);var graphicFrame=table.Parent;table.Set_TableStyle(0);arrTables.push(graphicFrame)}else table=new CTable(oDocument.DrawingDocument,oDocument,true,0,0,aGrid);var aSumGrid= [];aSumGrid[-1]=0;var nSum=0;for(i=0,length=aGrid.length;i<length;++i){nSum+=aGrid[i];aSumGrid[i]=nSum}this._ExecuteTable(tableNode,node,table,aSumGrid,nMaxColCount!==nMinColCount?aColsCountByRow:null,pPr,bUseScaleKoef,dScaleKoef,arrShapes,arrImages,arrTables);table.MoveCursorToStartPos();if(!bPresentation)this.aContent.push(table)}},_ExecuteBorder:function(computedStyle,node,type,type2,bAddIfNull,setUnifill){var res=null;var style=this._getStyle(node,computedStyle,"border-"+type+"-style");if(null!= style){res=new CDocumentBorder;if("none"===style||""===style)res.Value=border_None;else{res.Value=border_Single;var width=node.style["border"+type2+"Width"];if(!width)width=this._getStyle(node,computedStyle,"border-"+type+"-width");if(null!=width&&null!=(width=AscCommon.valueToMm(width)))res.Size=width;var color=this._getStyle(node,computedStyle,"border-"+type+"-color");if(null!=color&&(color=this._ParseColor(color)))if(setUnifill&&color)res.Unifill=AscFormat.CreteSolidFillRGB(color.r,color.g,color.b); else res.Color=color}}if(bAddIfNull&&null==res)res=new CDocumentBorder;return res},_ExecuteParagraphBorder:function(border){var res=this.oBorderCache[border];if(null!=res)return res.Copy();else{res=new CDocumentBorder;var oTestDiv=document.createElement("div");oTestDiv.setAttribute("style","border-left:"+border);document.body.appendChild(oTestDiv);var computedStyle=this._getComputedStyle(oTestDiv);if(null!=computedStyle)res=this._ExecuteBorder(computedStyle,oTestDiv,"left","Left",true);document.body.removeChild(oTestDiv); this.oBorderCache[border]=res;return res}},_ExecuteTable:function(tableNode,node,table,aSumGrid,aColsCountByRow,pPr,bUseScaleKoef,dScaleKoef,arrShapes,arrImages,arrTables){var bPresentation=!PasteElementsId.g_bIsDocumentCopyPaste;table.SetTableLayout(tbllayout_AutoFit);var Pr=table.Pr;var sTableAlign=null;if(null!=tableNode.align)sTableAlign=tableNode.align;else if(null!=tableNode.parentNode&&this.oRootNode!==tableNode.parentNode){var computedStyleParent=this._getComputedStyle(tableNode.parentNode); sTableAlign=this._getStyle(tableNode.parentNode,computedStyleParent,"text-align")}if(null!=sTableAlign)if(-1!==sTableAlign.indexOf("center"))table.Set_TableAlign(align_Center);else if(-1!==sTableAlign.indexOf("right"))table.Set_TableAlign(align_Right);var spacing=null;table.Set_TableBorder_InsideH(new CDocumentBorder);table.Set_TableBorder_InsideV(new CDocumentBorder);var style=tableNode.getAttribute("style");if(style){var tblPrMso={};this._parseCss(style,tblPrMso);var spacing=tblPrMso["mso-cellspacing"]; if(null!=spacing&&null!=(spacing=AscCommon.valueToMm(spacing)));var padding=tblPrMso["mso-padding-alt"];if(null!=padding){padding=trimString(padding);var aMargins=padding.split(" ");if(4===aMargins.length){var top=aMargins[0];if(null!=top&&null!=(top=AscCommon.valueToMm(top)));else top=Pr.TableCellMar.Top.W;var right=aMargins[1];if(null!=right&&null!=(right=AscCommon.valueToMm(right)));else right=Pr.TableCellMar.Right.W;var bottom=aMargins[2];if(null!=bottom&&null!=(bottom=AscCommon.valueToMm(bottom))); else bottom=Pr.TableCellMar.Bottom.W;var left=aMargins[3];if(null!=left&&null!=(left=AscCommon.valueToMm(left)));else left=Pr.TableCellMar.Left.W;table.Set_TableCellMar(left,top,right,bottom)}}var insideh=tblPrMso["mso-border-insideh"];if(null!=insideh)table.Set_TableBorder_InsideH(this._ExecuteParagraphBorder(insideh));var insidev=tblPrMso["mso-border-insidev"];if(null!=insidev)table.Set_TableBorder_InsideV(this._ExecuteParagraphBorder(insidev))}var computedStyle=this._getComputedStyle(tableNode); if(align_Left===table.Get_TableAlign()){var margin_left=this._getStyle(tableNode,computedStyle,"margin-left");if(margin_left&&null!=(margin_left=AscCommon.valueToMm(margin_left))&&margin_left<Page_Width-X_Left_Margin)table.Set_TableInd(margin_left)}var background_color=this._getStyle(tableNode,computedStyle,"background-color");if(null!=background_color&&(background_color=this._ParseColor(background_color)))table.Set_TableShd(c_oAscShdClear,background_color.r,background_color.g,background_color.b); var oLeftBorder=this._ExecuteBorder(computedStyle,tableNode,"left","Left",bPresentation);if(null!=oLeftBorder)table.Set_TableBorder_Left(oLeftBorder);var oTopBorder=this._ExecuteBorder(computedStyle,tableNode,"top","Top",bPresentation);if(null!=oTopBorder)table.Set_TableBorder_Top(oTopBorder);var oRightBorder=this._ExecuteBorder(computedStyle,tableNode,"right","Right",bPresentation);if(null!=oRightBorder)table.Set_TableBorder_Right(oRightBorder);var oBottomBorder=this._ExecuteBorder(computedStyle, tableNode,"bottom","Bottom",bPresentation);if(null!=oBottomBorder)table.Set_TableBorder_Bottom(oBottomBorder);if(null==spacing){spacing=this._getStyle(tableNode,computedStyle,"padding");if(!spacing)spacing=tableNode.style.padding;if(!spacing)spacing=null;if(spacing&&null!=(spacing=AscCommon.valueToMm(spacing)));}var oRowSpans={};var bFirstRow=true;for(var i=0,length=node.childNodes.length;i<length;++i){var tr=node.childNodes[i];if("tr"===tr.nodeName.toLowerCase()&&tr.childNodes&&tr.childNodes.length){var row= table.private_AddRow(table.Content.length,0);if(bFirstRow&&pPr.repeatHeaderRow)row.Pr.TableHeader=true;bFirstRow=false;this._ExecuteTableRow(tr,row,aSumGrid,spacing,oRowSpans,bUseScaleKoef,dScaleKoef,arrShapes,arrImages,arrTables)}}},_ExecuteTableRow:function(node,row,aSumGrid,spacing,oRowSpans,bUseScaleKoef,dScaleKoef,arrShapes,arrImages,arrTables){var oThis=this;var table=row.Table;var oTableSpacingMinValue="undefined"!==typeof tableSpacingMinValue?tableSpacingMinValue:.02;if(null!=spacing&&spacing>= oTableSpacingMinValue)row.Set_CellSpacing(spacing);if(node.style.height){var height=node.style.height;if(!("auto"===height||"inherit"===height||-1!==height.indexOf("%"))&&null!=(height=AscCommon.valueToMm(height)))row.Set_Height(height,Asc.linerule_AtLeast)}var bBefore=false;var bAfter=false;var style=node.getAttribute("style");if(null!=style){var tcPr={};this._parseCss(style,tcPr);var margin_left=tcPr["mso-row-margin-left"];if(margin_left&&null!=(margin_left=AscCommon.valueToMm(margin_left)))bBefore= true;var margin_right=tcPr["mso-row-margin-right"];if(margin_right&&null!=(margin_right=AscCommon.valueToMm(margin_right)))bAfter=true}var nCellIndex=0;var nCellIndexSpan=0;var fParseSpans=function(){var spans=oRowSpans[nCellIndexSpan];while(null!=spans){var oCurCell=row.Add_Cell(row.Get_CellsCount(),row,null,false);oCurCell.SetVMerge(vmerge_Continue);if(spans.col>1)oCurCell.Set_GridSpan(spans.col);spans.row--;if(spans.row<=0)delete oRowSpans[nCellIndexSpan];nCellIndexSpan+=spans.col;spans=oRowSpans[nCellIndexSpan]}}; var oBeforeCell=null;var oAfterCell=null;if(bBefore||bAfter)for(var i=0,length=node.childNodes.length;i<length;++i){var tc=node.childNodes[i];var tcName=tc.nodeName.toLowerCase();if("td"===tcName||"th"===tcName)if(bBefore&&null!=oBeforeCell)oBeforeCell=tc;else if(bAfter)oAfterCell=tc}var computedStyle=this._getComputedStyle(node);var background_color=this._getStyle(node,computedStyle,"background-color");var Shd;if(null!=background_color&&(background_color=this._ParseColor(background_color))){Shd= new CDocumentShd;Shd.Value=c_oAscShdClear;Shd.Color=background_color}for(var i=0,length=node.childNodes.length;i<length;++i){fParseSpans();var tc=node.childNodes[i];var tcName=tc.nodeName.toLowerCase();if("td"===tcName||"th"===tcName){var nColSpan=tc.getAttribute("colspan");if(null!=nColSpan)nColSpan=nColSpan-0;else nColSpan=1;if(tc===oBeforeCell)row.Set_Before(nColSpan);else if(tc===oAfterCell)row.Set_After(nColSpan);else{var oCurCell=row.Add_Cell(row.Get_CellsCount(),row,null,false);if(nColSpan> 1)oCurCell.Set_GridSpan(nColSpan);if(Shd)oCurCell.Set_Shd(Shd);var width=aSumGrid[nCellIndexSpan+nColSpan-1]-aSumGrid[nCellIndexSpan-1];oCurCell.Set_W(new CTableMeasurement(tblwidth_Mm,width));var nRowSpan=tc.getAttribute("rowspan");if(null!=nRowSpan)nRowSpan=nRowSpan-0;else nRowSpan=1;if(nRowSpan>1)oRowSpans[nCellIndexSpan]={row:nRowSpan-1,col:nColSpan};this._ExecuteTableCell(tc,oCurCell,bUseScaleKoef,dScaleKoef,spacing,arrShapes,arrImages,arrTables)}nCellIndexSpan+=nColSpan}}fParseSpans()},_ExecuteTableCell:function(node, cell,bUseScaleKoef,dScaleKoef,spacing,arrShapes,arrImages,arrTables){var Pr=cell.Pr;var bAddIfNull=false;if(null!=spacing)bAddIfNull=true;var computedStyle=this._getComputedStyle(node);var background_color=this._getStyle(node,computedStyle,"background-color");if(null!=background_color&&(background_color=this._ParseColor(background_color))){var Shd=new CDocumentShd;Shd.Value=c_oAscShdClear;Shd.Color=background_color;cell.Set_Shd(Shd)}var border=this._ExecuteBorder(computedStyle,node,"left","Left", bAddIfNull);if(null!=border)cell.Set_Border(border,3);border=this._ExecuteBorder(computedStyle,node,"top","Top",bAddIfNull);if(null!=border)cell.Set_Border(border,0);border=this._ExecuteBorder(computedStyle,node,"right","Right",bAddIfNull);if(null!=border)cell.Set_Border(border,1);border=this._ExecuteBorder(computedStyle,node,"bottom","Bottom",bAddIfNull);if(null!=border)cell.Set_Border(border,2);var top=this._getStyle(node,computedStyle,"padding-top");if(null!=top&&null!=(top=AscCommon.valueToMm(top)))cell.Set_Margins({W:top, Type:tblwidth_Mm},0);var right=this._getStyle(node,computedStyle,"padding-right");if(null!=right&&null!=(right=AscCommon.valueToMm(right)))cell.Set_Margins({W:right,Type:tblwidth_Mm},1);var bottom=this._getStyle(node,computedStyle,"padding-bottom");if(null!=bottom&&null!=(bottom=AscCommon.valueToMm(bottom)))cell.Set_Margins({W:bottom,Type:tblwidth_Mm},2);var left=this._getStyle(node,computedStyle,"padding-left");if(null!=left&&null!=(left=AscCommon.valueToMm(left)))cell.Set_Margins({W:left,Type:tblwidth_Mm}, 3);var whiteSpace=this._getStyle(node,computedStyle,"white-space");if("nowrap"===whiteSpace||true===node.noWrap)cell.SetNoWrap(true);var vAlign=this._getStyle(node,computedStyle,"vertical-align");switch(vAlign){case "middle":cell.Set_VAlign(vertalignjc_Center);break;case "bottom":cell.Set_VAlign(vertalignjc_Bottom);break;case "baseline":case "top":cell.Set_VAlign(vertalignjc_Top);break}var i,length;var bPresentation=!PasteElementsId.g_bIsDocumentCopyPaste;if(bPresentation){var arrShapes2=[],arrImages2= [],arrTables2=[];var presentation=editor.WordControl.m_oLogicDocument;var shape=new CShape;shape.setParent(presentation.Slides[presentation.CurPage]);shape.setTxBody(AscFormat.CreateTextBodyFromString("",presentation.DrawingDocument,shape));arrShapes2.push(shape);this._Execute(node,{},true,true,false,arrShapes2,arrImages2,arrTables);if(arrShapes2.length>0){var first_shape=arrShapes2[0];var content=first_shape.txBody.content;for(i=0,length=content.Content.length;i<length;++i)if(i===length-1)cell.Content.Internal_Content_Add(i+ 1,content.Content[i],true);else cell.Content.Internal_Content_Add(i+1,content.Content[i],false);cell.Content.Internal_Content_Remove(0,1);arrShapes2.splice(0,1)}for(i=0;i<arrShapes2.length;++i)arrShapes.push(arrShapes2[i]);for(i=0;i<arrImages2.length;++i)arrImages.push(arrImages2[i]);for(i=0;i<arrTables2.length;++i)arrTables.push(arrTables2[i])}else{var oPasteProcessor=new PasteProcessor(this.api,false,false,true);oPasteProcessor.msoComments=this.msoComments;oPasteProcessor.oFonts=this.oFonts;oPasteProcessor.oImages= this.oImages;oPasteProcessor.oDocument=cell.Content;oPasteProcessor.bIgnoreNoBlockText=true;oPasteProcessor.dMaxWidth=this._CalcMaxWidthByCell(cell);if(true===bUseScaleKoef){oPasteProcessor.bUseScaleKoef=bUseScaleKoef;oPasteProcessor.dScaleKoef=dScaleKoef}oPasteProcessor._Execute(node,{},true,true,false);oPasteProcessor._PrepareContent();oPasteProcessor._AddNextPrevToContent(cell.Content);if(0===oPasteProcessor.aContent.length){var oDocContent=cell.Content;var oNewPar=new Paragraph(oDocContent.DrawingDocument, oDocContent);var oNewSpacing=new CParaSpacing;oNewSpacing.Set_FromObject({After:0,Before:0,Line:Asc.linerule_Auto});oNewPar.Set_Spacing(oNewSpacing);oPasteProcessor.aContent.push(oNewPar)}for(i=0,length=oPasteProcessor.aContent.length;i<length;++i)if(i===length-1)cell.Content.Internal_Content_Add(i+1,oPasteProcessor.aContent[i],true);else cell.Content.Internal_Content_Add(i+1,oPasteProcessor.aContent[i],false);cell.Content.Internal_Content_Remove(0,1)}},_CheckIsPlainText:function(node,dNotCheckFirstElem){var bIsPlainText= true;var checkStyle=function(elem){var res=false;var _nodeName=elem.nodeName.toLowerCase();if("h1"===_nodeName||"h2"===_nodeName||"h3"===_nodeName||"h4"===_nodeName||"h5"===_nodeName||"h6"===_nodeName)return true;var sClass=elem.getAttribute("class");var sStyle=elem.getAttribute("style");var sHref=elem.getAttribute("href");if(sClass||sStyle||sHref)res=true;return res};if("body"!==node.nodeName.toLowerCase()&&!dNotCheckFirstElem)if(Node.ELEMENT_NODE===node.nodeType)if(checkStyle(node))return false; for(var i=0,length=node.childNodes.length;i<length;i++){var child=node.childNodes[i];if(Node.ELEMENT_NODE===child.nodeType)if(checkStyle(child)){bIsPlainText=false;break}else if(!this._CheckIsPlainText(child,true)){bIsPlainText=false;break}}return bIsPlainText},_Execute:function(node,pPr,bRoot,bAddParagraph,bInBlock,arrShapes,arrImages,arrTables){var oThis=this;var bRootHasBlock=false;var parseTextNode=function(){var value=node.nodeValue;if(!value)value="";var whiteSpacing=false;if(node.parentNode){var computedStyle= oThis._getComputedStyle(node.parentNode);var tempWhiteSpacing=oThis._getStyle(node.parentNode,computedStyle,"white-space");whiteSpacing="pre"===tempWhiteSpacing||"pre-wrap"===tempWhiteSpacing}if(!whiteSpacing){value=value.replace(/^(\r|\t|\n)+|(\r|\t|\n)+$/g,"");value=value.replace(/(\r|\t|\n)/g," ");if(value.charCodeAt(0)!==160){var checkSpaces=value.replace(/(\s)/g,"");if(checkSpaces==="")value=""}}var Item;if(value.length>0){if(bPresentation){oThis.oDocument=shape.txBody.content;if(bAddParagraph)shape.txBody.content.AddNewParagraph(); if(!oThis.bIsPlainText){var rPr=oThis._read_rPr(node.parentNode);Item=new ParaTextPr(rPr);shape.paragraphAdd(Item,false)}}else{var oTargetNode=node.parentNode;var bUseOnlyInherit=false;if(oThis._IsBlockElem(oTargetNode.nodeName.toLowerCase()))bUseOnlyInherit=true;bAddParagraph=oThis._Decide_AddParagraph(oTargetNode,pPr,bAddParagraph);oThis._commit_rPr(oTargetNode,bUseOnlyInherit)}var ignoreFirstSpaces=false;if(AscCommon.g_clipboardBase.pastedFrom===AscCommon.c_oClipboardPastedFrom.Excel)ignoreFirstSpaces= true;var bIsPreviousSpace=false,clonePr;for(var oIterator=value.getUnicodeIterator();oIterator.check();oIterator.next()){if(oThis.needAddCommentStart){for(var i=0;i<oThis.needAddCommentStart.length;i++){oThis._CommitElemToParagraph(oThis.needAddCommentStart[i]);clonePr=oThis.oCurRun.Pr.Copy();oThis.oCurRun=new ParaRun(oThis.oCurPar);oThis.oCurRun.Set_Pr(clonePr)}oThis.needAddCommentStart=null}else if(oThis.needAddCommentEnd)oThis._commitCommentEnd();var nUnicode=oIterator.value();if(ignoreFirstSpaces)if(nUnicode=== 32)continue;else ignoreFirstSpaces=false;if(bPresentation){if(null!==nUnicode){if(32!==nUnicode&&160!==nUnicode&&8201!==nUnicode)Item=new ParaText(nUnicode);else Item=new ParaSpace;shape.paragraphAdd(Item,false)}}else if(null!=nUnicode){if(whiteSpacing&&10===nUnicode){Item=null;bAddParagraph=oThis._Decide_AddParagraph(oTargetNode,pPr,true);oThis._commit_rPr(oTargetNode,bUseOnlyInherit)}else if(whiteSpacing&&(9===nUnicode||8201===nUnicode))Item=new ParaTab;else if(32!==nUnicode&&8201!==nUnicode){Item= new ParaText(nUnicode);bIsPreviousSpace=false}else{Item=new ParaSpace;if(bIsPreviousSpace)continue;if(!oThis.bIsPlainText&&!whiteSpacing)bIsPreviousSpace=true}if(null!==Item)oThis._AddToParagraph(Item)}}}};var parseNumbering=function(){if("ul"===sNodeName||"ol"===sNodeName||"li"===sNodeName)if(bPresentation){pPr.bNum=true;if(PasteElementsId.g_bIsDocumentCopyPaste)if("ul"===sNodeName)pPr.numType=Asc.c_oAscNumberingFormat.Bullet;else{if("ol"===sNodeName)pPr.numType=Asc.c_oAscNumberingFormat.Decimal}else if("ul"=== sNodeName)pPr.numType=numbering_presentationnumfrmt_Char;else if("ol"===sNodeName)pPr.numType=numbering_presentationnumfrmt_ArabicPeriod}else{if("li"===sNodeName)pPr.bNum=true;if(PasteElementsId.g_bIsDocumentCopyPaste)if("ul"===sNodeName)pPr.numType=Asc.c_oAscNumberingFormat.Bullet;else{if("ol"===sNodeName)pPr.numType=Asc.c_oAscNumberingFormat.Decimal}else if("ul"===sNodeName)pPr.numType=numbering_presentationnumfrmt_Char;else if("ol"===sNodeName)pPr.numType=numbering_presentationnumfrmt_ArabicPeriod}else if(pPr["mso-list"]&& !bPresentation)if("p"===sNodeName)pPr.bNum=true};var parseStyle=function(){var style=node.getAttribute("style");if(style)oThis._parseCss(style,pPr);if("h1"===sNodeName)pPr.hLevel=0;else if("h2"===sNodeName)pPr.hLevel=1;else if("h3"===sNodeName)pPr.hLevel=2;else if("h4"===sNodeName)pPr.hLevel=3;else if("h5"===sNodeName)pPr.hLevel=4;else if("h6"===sNodeName)pPr.hLevel=5};var parseImage=function(){var nWidth=parseInt(node.getAttribute("width"));var nHeight=parseInt(node.getAttribute("height"));if(!nWidth|| !nHeight){var computedStyle=oThis._getComputedStyle(node);nWidth=parseInt(oThis._getStyle(node,computedStyle,"width"));nHeight=parseInt(oThis._getStyle(node,computedStyle,"height"))}if(!nWidth||!nHeight)if(AscBrowser.isMozilla||AscBrowser.isIE){nWidth=parseInt(node.width);nHeight=parseInt(node.height)}else if(AscBrowser.isChrome)if(nWidth&&!nHeight)nHeight=nWidth;else if(!nWidth&&nHeight)nWidth=nHeight;else{nWidth=parseInt(node.width);nHeight=parseInt(node.height)}var sSrc=node.getAttribute("src"); if((!window["Asc"]||window["Asc"]&&window["Asc"]["editor"]===undefined)&&(isNaN(nWidth)||isNaN(nHeight)||!(typeof nWidth==="number")||!(typeof nHeight==="number")||nWidth===0||nHeight===0)&&sSrc){var img_prop=new Asc.asc_CImgProperty;img_prop.asc_putImageUrl(sSrc);var or_sz=img_prop.asc_getOriginSize(editor);nWidth=or_sz.Width/g_dKoef_pix_to_mm;nHeight=or_sz.Height/g_dKoef_pix_to_mm}else if(bPresentation){nWidth*=g_dKoef_pix_to_mm;nHeight*=g_dKoef_pix_to_mm}if(!nWidth)nWidth=bPresentation?oThis.defaultImgWidth: oThis.defaultImgWidth/g_dKoef_pix_to_mm;if(!nHeight)nHeight=bPresentation?oThis.defaultImgHeight:oThis.defaultImgHeight/g_dKoef_pix_to_mm;if(bPresentation){if(nWidth&&nHeight&&sSrc){sSrc=oThis.oImages[sSrc];if(sSrc){var image=AscFormat.DrawingObjectsController.prototype.createImage(sSrc,0,0,nWidth,nHeight);arrImages.push(image)}}return bAddParagraph}else if(PasteElementsId.g_bIsDocumentCopyPaste){bAddParagraph=oThis._Decide_AddParagraph(node,pPr,bAddParagraph);if(nWidth&&nHeight&&sSrc){sSrc=oThis.oImages[sSrc]; if(sSrc){nWidth=nWidth*g_dKoef_pix_to_mm;nHeight=nHeight*g_dKoef_pix_to_mm;var bUseScaleKoef=oThis.bUseScaleKoef;var dScaleKoef=oThis.dScaleKoef;if(nWidth*dScaleKoef>oThis.dMaxWidth){dScaleKoef=dScaleKoef*oThis.dMaxWidth/nWidth;bUseScaleKoef=true}var oTargetDocument=oThis.oDocument;var oDrawingDocument=oThis.oDocument.DrawingDocument;if(oTargetDocument&&oDrawingDocument){if(oThis.oCurHyperlink){oThis._CommitElemToParagraph(oThis.oCurRun);oThis.oCurRun=new ParaRun(oThis.oCurPar);oThis.oCurRun.Pr.Underline= false}var Drawing=CreateImageFromBinary(sSrc,nWidth,nHeight);oThis._AddToParagraph(Drawing);if(oThis.oCurHyperlink)oThis.oCurRun=new ParaRun(oThis.oCurPar)}}}return bAddParagraph}else return false};var parseLineBreak=function(){if(bPresentation){if("br"===sNodeName||"always"===node.style.pageBreakBefore)shape.paragraphAdd(new ParaNewLine(break_Line),false)}else{var bPageBreakBefore="always"===node.style.pageBreakBefore||"left"===node.style.pageBreakBefore||"right"===node.style.pageBreakBefore;if("br"== sNodeName||bPageBreakBefore)if(bPageBreakBefore){bAddParagraph=oThis._Decide_AddParagraph(node.parentNode,pPr,bAddParagraph);bAddParagraph=true;oThis._Commit_Br(0,node,pPr);oThis._AddToParagraph(new ParaNewLine(break_Page))}else if(AscCommon.g_clipboardBase.pastedFrom===AscCommon.c_oClipboardPastedFrom.Excel){bAddParagraph=oThis._Decide_AddParagraph(node.parentNode,pPr,bAddParagraph);oThis._Commit_Br(0,node,pPr);oThis._AddToParagraph(new ParaNewLine(break_Line))}else{bAddParagraph=oThis._Decide_AddParagraph(node.parentNode, pPr,bAddParagraph,false);oThis.nBrCount++;if("line-break"===pPr["mso-special-character"]||"always"===pPr["mso-column-break-before"])oThis._Commit_Br(0,node,pPr);return bAddParagraph}}return null};var parseTab=function(){var nTabCount;if(bPresentation){nTabCount=parseInt(pPr["mso-tab-count"]||0);if(nTabCount>0){if(!oThis.bIsPlainText){var rPr=oThis._read_rPr(node);var Item=new ParaTextPr(rPr);shape.paragraphAdd(Item,false)}for(var i=0;i<nTabCount;i++)shape.paragraphAdd(new ParaTab,false);return}}else{nTabCount= parseInt(pPr["mso-tab-count"]||0);if(nTabCount>0){bAddParagraph=oThis._Decide_AddParagraph(node,pPr,bAddParagraph);oThis._commit_rPr(node);for(var i=0;i<nTabCount;i++)oThis._AddToParagraph(new ParaTab);return bAddParagraph}}return null};var parseChildNodes=function(){var sChildNodeName;if(bPresentation){var sChildNodeName=child.nodeName.toLowerCase();if(!(Node.ELEMENT_NODE===nodeType||Node.TEXT_NODE===nodeType)||sChildNodeName==="style"||sChildNodeName==="#comment"||sChildNodeName==="script")return; if(Node.TEXT_NODE===child.nodeType){var value=child.nodeValue;if(!value)return;value=value.replace(/(\r|\t|\n)/g,"");if(""==value)return}sChildNodeName=child.nodeName.toLowerCase();var bIsBlockChild=oThis._IsBlockElem(sChildNodeName);if(bRoot)oThis.bInBlock=false;if(bIsBlockChild){bAddParagraph=true;oThis.bInBlock=true}var bHyperlink=false;var isPasteHyperlink=null;if("a"===sChildNodeName){var href=child.href;if(null!=href){bHyperlink=true;var title=child.getAttribute("title");oThis.oDocument=shape.txBody.content; var Pos=true===oThis.oDocument.Selection.Use?oThis.oDocument.Selection.StartPos:oThis.oDocument.CurPos.ContentPos;isPasteHyperlink=node.getElementsByTagName("img");var text=null;if(isPasteHyperlink&&isPasteHyperlink.length)isPasteHyperlink=null;else text=child.innerText?child.innerText:child.textContent;if(isPasteHyperlink){var HyperProps=new Asc.CHyperlinkProperty({Text:text,Value:href,ToolTip:title});oThis.oDocument.Content[Pos].AddHyperlink(HyperProps)}}}if(!child.style&&Node.TEXT_NODE!==child.nodeType)child.style= {};if(!isPasteHyperlink)bAddParagraph=oThis._Execute(child,Common_CopyObj(pPr),false,bAddParagraph,bIsBlockChild||bInBlock,arrShapes,arrImages,arrTables);if(bIsBlockChild)bAddParagraph=true}else{sChildNodeName=child.nodeName.toLowerCase();if(!(Node.ELEMENT_NODE===nodeType||Node.TEXT_NODE===nodeType)||sChildNodeName==="style"||sChildNodeName==="#comment"||sChildNodeName==="script"){if(sChildNodeName==="#comment")if(child.nodeValue==="[if !supportAnnotations]")oThis.startMsoAnnotation=true;else if(oThis.startMsoAnnotation&& child.nodeValue==="[endif]")oThis.startMsoAnnotation=false;return}if(oThis.startMsoAnnotation){if(child.id){var idAnchor=child.id.split("_anchor_");if(idAnchor&&idAnchor[1]&&oThis.msoComments[idAnchor[1]]&&oThis.msoComments[idAnchor[1]].start)if(null!=oThis.oCurRun){if(!oThis.needAddCommentEnd)oThis.needAddCommentEnd=[];oThis.needAddCommentEnd.push(new AscCommon.ParaComment(false,oThis.msoComments[idAnchor[1]].start));delete oThis.msoComments[idAnchor[1]]}}return}var msoCommentReference=pPr["mso-comment-reference"]; if(msoCommentReference){var commentId=msoCommentReference.split("_");if(commentId&&undefined!==commentId[1]){var startComment=oThis.msoComments[commentId[1]];if(startComment&&!startComment.start){var newCCommentId=oThis._addComment({Date:pPr["mso-comment-date"],Text:startComment.text});oThis.msoComments[commentId[1]].start=newCCommentId;if(!oThis.needAddCommentStart)oThis.needAddCommentStart=[];oThis.needAddCommentStart.push(new AscCommon.ParaComment(true,newCCommentId))}}}if("comment"===pPr["mso-special-character"])return; if(Node.TEXT_NODE===child.nodeType){var value=child.nodeValue;if(!value)return;value=value.replace(/(\r|\t|\n)/g,"");if(""==value)return}var bIsBlockChild=oThis._IsBlockElem(sChildNodeName);if(bRoot)oThis.bInBlock=false;if(bIsBlockChild){bAddParagraph=true;oThis.bInBlock=true}var oOldHyperlink=null;var oOldHyperlinkContentPos=null;var oHyperlink=null;if("a"===sChildNodeName){var href=child.href;if(null!=href)if(href&&href.length>0){var title=child.getAttribute("title");bAddParagraph=oThis._Decide_AddParagraph(child, pPr,bAddParagraph);oHyperlink=new ParaHyperlink;oHyperlink.SetParagraph(oThis.oCurPar);oHyperlink.Set_Value(href);if(null!=title)oHyperlink.SetToolTip(title);oOldHyperlink=oThis.oCurHyperlink;oOldHyperlinkContentPos=oThis.oCurHyperlinkContentPos;oThis.oCurHyperlink=oHyperlink;oThis.oCurHyperlinkContentPos=0}}if(!child.style&&Node.TEXT_NODE!==child.nodeType)child.style={};bAddParagraph=oThis._Execute(child,Common_CopyObj(pPr),false,bAddParagraph,bIsBlockChild||bInBlock);if(bIsBlockChild)bAddParagraph= true;if("a"===sChildNodeName&&null!=oHyperlink){oThis.oCurHyperlink=oOldHyperlink;oThis.oCurHyperlinkContentPos=oOldHyperlinkContentPos;if(oHyperlink.Content.length>0){if(oThis.pasteInExcel){var TextPr=new CTextPr;TextPr.Unifill=AscFormat.CreateUniFillSchemeColorWidthTint(11,0);TextPr.Underline=true;oHyperlink.Apply_TextPr(TextPr,undefined,true)}if(oHyperlink.Content&&oHyperlink.Content.length&&oHyperlink.Paragraph.bFromDocument)if(oThis.oLogicDocument&&oThis.oLogicDocument.Styles&&oThis.oLogicDocument.Styles.Default&& oThis.oLogicDocument.Styles.Default.Hyperlink&&oThis.oLogicDocument.Styles.Style){var hyperLinkStyle=oThis.oLogicDocument.Styles.Default.Hyperlink;for(var k=0;k<oHyperlink.Content.length;k++)if(oHyperlink.Content[k].Type===para_Run)oHyperlink.Content[k].Set_RStyle(hyperLinkStyle)}oThis._AddToParagraph(oHyperlink)}}}};var bPresentation=!PasteElementsId.g_bIsDocumentCopyPaste;if(bPresentation){var shape=arrShapes[arrShapes.length-1];this.aContent=shape.txBody.content.Content}if(true===bRoot){var bExist= false;for(var i=0,length=node.childNodes.length;i<length;i++){var child=node.childNodes[i];var bIsBlockChild=this._IsBlockElem(child.nodeName.toLowerCase());if(true===bIsBlockChild){bRootHasBlock=true;bExist=true;break}}if(false===bExist&&true===this.bIgnoreNoBlockText)this.bIgnoreNoBlockText=false}else{if(Node.TEXT_NODE===node.nodeType){if(false===this.bIgnoreNoBlockText||true===bInBlock||node.parentElement&&"a"===node.parentElement.nodeName.toLowerCase())parseTextNode();return bPresentation?false: bAddParagraph}var sNodeName=node.nodeName.toLowerCase();if(bPresentation){if("table"===sNodeName){this._StartExecuteTable(node,pPr,arrShapes,arrImages,arrTables);return}}else if("table"===sNodeName&&this.pasteInExcel!==true&&this.pasteInPresentationShape!==true)if(PasteElementsId.g_bIsDocumentCopyPaste){this._Commit_Br(1,node,pPr);this._StartExecuteTable(node,pPr);return bAddParagraph}else return false;parseStyle();parseNumbering();if("img"===sNodeName&&(bPresentation||!bPresentation&&this.pasteInExcel!== true))return parseImage();var lineBreak=parseLineBreak();if(null!==lineBreak)return lineBreak;if("span"===sNodeName){var tab=parseTab();if(null!==tab)return tab}}for(var i=0,length=node.childNodes.length;i<length;i++){var child=node.childNodes[i];var nodeType=child.nodeType;if(Node.COMMENT_NODE===nodeType){var value=child.nodeValue;var bSkip=false;if(value){if(-1!==value.indexOf("supportLists")){pPr.bNum=true;bSkip=true}if(-1!==value.indexOf("supportLineBreakNewLine"))bSkip=true}if(true===bSkip){var j= i+1;for(;j<length;j++){var tempNode=node.childNodes[j];var tempNodeType=tempNode.nodeType;if(Node.COMMENT_NODE===tempNodeType){var tempvalue=tempNode.nodeValue;if(tempvalue&&-1!==tempvalue.indexOf("endif"))break}}i=j;continue}}parseChildNodes();if(i===length-1)oThis._commitCommentEnd()}if(bRoot&&bPresentation)this._Commit_Br(2,node,pPr);return bAddParagraph},_commitCommentEnd:function(){if(this.needAddCommentEnd&&this.oCurRun&&this.oCurPar){for(var n=0;n<this.needAddCommentEnd.length;n++){this._CommitElemToParagraph(this.needAddCommentEnd[n]); var clonePr=this.oCurRun.Pr.Copy();this.oCurRun=new ParaRun(this.oCurPar);this.oCurRun.Set_Pr(clonePr)}this.needAddCommentEnd=null}},_applyStylesToTable:function(cTable,cStyle){if(!cTable||!cStyle||cTable&&!cTable.Content)return;var row,tableCell;for(var i=0;i<cTable.Content.length;i++){row=cTable.Content[i];for(var j=0;j<row.Content.length;j++){tableCell=row.Content[j];var test=this.Internal_Compile_Pr(cTable,cStyle,tableCell);tableCell.Set_Pr(test.CellPr)}}},_addComment:function(oOldComment){var convertMsDate= function(msDate){var res="";if(msDate){var dateTimeSplit=msDate.split("T");if(dateTimeSplit[0]&&dateTimeSplit[1]){var year=dateTimeSplit[0].substring(0,4);var month=dateTimeSplit[0].substring(4,6);var day=dateTimeSplit[0].substring(6,8);var hour=dateTimeSplit[1].substring(0,2);var min=dateTimeSplit[1].substring(2,4);var date=new Date(year,month-1,day,hour,min);res=(date.getTime()-(new Date).getTimezoneOffset()*6E4).toString()}}return res};var fInitCommentData=function(comment){var oCommentObj=new AscCommon.CCommentData; oCommentObj.m_nDurableId=AscCommon.CreateDurableId();if(null!=comment.UserName)oCommentObj.m_sUserName=comment.UserName;if(null!=comment.UserId)oCommentObj.m_sUserId=comment.UserId;if(null!=comment.Date)oCommentObj.m_sTime=convertMsDate(comment.Date);if(null!=comment.m_sQuoteText)oCommentObj.m_sQuoteText=comment.m_sQuoteText;if(null!=comment.Text)oCommentObj.m_sText=comment.Text;if(null!=comment.Solved)oCommentObj.m_bSolved=comment.Solved;if(null!=comment.Replies)for(var i=0,length=comment.Replies.length;i< length;++i)oCommentObj.Add_Reply(fInitCommentData(comment.Replies[i]));return oCommentObj};var oCommentsNewId={};var isIntoShape=this.oDocument&&this.oDocument.Parent&&this.oDocument.Parent instanceof AscFormat.CShape?true:false;var isIntoDocumentContent=this.oDocument instanceof CDocumentContent?true:false;var document=this.oDocument&&isIntoDocumentContent&&!isIntoShape?this.oDocument.LogicDocument:this.oDocument;var oNewComment=new AscCommon.CComment(document.Comments,fInitCommentData(oOldComment)); document.Comments.Add(oNewComment);this.api.sync_AddComment(oNewComment.Id,oNewComment.Data);return oNewComment.Id}};function CheckDefaultFontFamily(val,api){return"onlyofficeDefaultFont"===val&&api&&api.getDefaultFontFamily?api.getDefaultFontFamily():val}function CheckDefaultFontSize(val,api){return"0px"===val&&api&&api.getDefaultFontSize?api.getDefaultFontSize()+"pt":val}function CreateImageFromBinary(bin,nW,nH){var w,h;if(nW===undefined||nH===undefined){var _image=editor.ImageLoader.map_image_index[bin]; if(_image!=undefined&&_image.Image!=null&&_image.Status==AscFonts.ImageLoadStatus.Complete){var _w=Math.max(1,Page_Width-(X_Left_Margin+X_Right_Margin));var _h=Math.max(1,Page_Height-(Y_Top_Margin+Y_Bottom_Margin));var bIsCorrect=false;if(_image.Image!=null){var __w=Math.max(parseInt(_image.Image.width*g_dKoef_pix_to_mm),1);var __h=Math.max(parseInt(_image.Image.height*g_dKoef_pix_to_mm),1);var dKoef=Math.max(__w/_w,__h/_h);if(dKoef>1){_w=Math.max(5,__w/dKoef);_h=Math.max(5,__h/dKoef);bIsCorrect= true}else{_w=__w;_h=__h}}w=__w;h=__h}else{w=50;h=50}}else{w=nW;h=nH}var para_drawing=new ParaDrawing(w,h,null,editor.WordControl.m_oLogicDocument.DrawingDocument,editor.WordControl.m_oLogicDocument,null);var word_image=AscFormat.DrawingObjectsController.prototype.createImage(bin,0,0,w,h);para_drawing.Set_GraphicObject(word_image);word_image.setParent(para_drawing);para_drawing.Set_GraphicObject(word_image);return para_drawing}function Check_LoadingDataBeforePrepaste(_api,_fonts,_images,_callback){var aPrepeareFonts= [];for(var font_family in _fonts)aPrepeareFonts.push(new CFont(font_family,0,"",0));AscFonts.FontPickerByCharacter.extendFonts(aPrepeareFonts);var aImagesToDownload=[];for(var image in _images){var src=_images[image];if(undefined!==window["Native"]&&undefined!==window["Native"]["GetImageUrl"])_images[image]=window["Native"]["GetImageUrl"](_images[image]);else if(!g_oDocumentUrls.getImageUrl(src)&&!g_oDocumentUrls.getImageLocal(src))aImagesToDownload.push(src)}if(aImagesToDownload.length>0)AscCommon.sendImgUrls(_api, aImagesToDownload,function(data){var image_map={};for(var i=0,length=Math.min(data.length,aImagesToDownload.length);i<length;++i){var elem=data[i];var sFrom=aImagesToDownload[i];if(null!=elem.url){var name=g_oDocumentUrls.imagePath2Local(elem.path);_images[sFrom]=name;image_map[i]=name}else image_map[i]=sFrom}_api.pre_Paste(aPrepeareFonts,image_map,_callback)},null,true);else _api.pre_Paste(aPrepeareFonts,_images,_callback)}function addTextIntoRun(oCurRun,value,bIsAddTabBefore,dNotAddLastSpace,bIsAddTabAfter){if(bIsAddTabBefore)oCurRun.AddToContent(-1, new ParaTab,false);for(var oIterator=value.getUnicodeIterator();oIterator.check();oIterator.next()){var nUnicode=oIterator.value();var bIsSpace=true;var Item;if(8201===nUnicode||9===nUnicode)Item=new ParaTab;else if(32!==nUnicode&&160!==nUnicode){Item=new ParaText(nUnicode);bIsSpace=false}else Item=new ParaSpace;if(!(dNotAddLastSpace&&oIterator.position()===value.length-1&&bIsSpace))oCurRun.AddToContent(-1,Item,false)}if(bIsAddTabAfter)oCurRun.AddToContent(-1,new ParaTab,false)}function searchBinaryClass(node){var res= null;if(node.children[0]){var child=node.children[0];var childClass=child?child.getAttribute("class"):null;if(childClass!=null&&(childClass.indexOf("xslData;")>-1||childClass.indexOf("docData;")>-1||childClass.indexOf("pptData;")>-1))return childClass;else return searchBinaryClass(node.children[0])}return res}function SpecialPasteShowOptions(){this.options=null;this.cellCoord=null;this.range=null;this.shapeId=null;this.fixPosition=null;this.position=null;this.showPasteSpecial=null;this.containTables= null}SpecialPasteShowOptions.prototype={constructor:SpecialPasteShowOptions,isClean:function(){var res=false;if(null===this.options&&null===this.cellCoord&&null===this.range&&null===this.shapeId&&null===this.fixPosition)res=true;return res},clean:function(){this.options=null;this.cellCoord=null;this.range=null;this.shapeId=null;this.fixPosition=null;this.position=null;this.showPasteSpecial=null;this.containTables=null},setRange:function(val){this.range=val},setShapeId:function(val){this.shapeId=val}, setFixPosition:function(val){this.fixPosition=val},setPosition:function(val){this.position=val},asc_setCellCoord:function(val){this.cellCoord=val},asc_setOptions:function(val){if(val===null)this.options=[];else this.options=val},asc_getCellCoord:function(){return this.cellCoord},asc_getOptions:function(){return this.options},asc_getShowPasteSpecial:function(){return this.showPasteSpecial},asc_setShowPasteSpecial:function(val){this.showPasteSpecial=val},asc_getContainTables:function(){return this.containTables}, asc_setContainTables:function(val){this.containTables=val}};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].Check_LoadingDataBeforePrepaste=Check_LoadingDataBeforePrepaste;window["AscCommon"].CDocumentReaderMode=CDocumentReaderMode;window["AscCommon"].GetObjectsForImageDownload=GetObjectsForImageDownload;window["AscCommon"].ResetNewUrls=ResetNewUrls;window["AscCommon"].CopyProcessor=CopyProcessor;window["AscCommon"].CopyPasteCorrectString=CopyPasteCorrectString;window["AscCommon"].Editor_Paste_Exec= Editor_Paste_Exec;window["AscCommon"].sendImgUrls=sendImgUrls;window["AscCommon"].PasteProcessor=PasteProcessor;window["AscCommon"].addTextIntoRun=addTextIntoRun;window["AscCommon"].searchBinaryClass=searchBinaryClass;window["AscCommon"].PasteElementsId=PasteElementsId;window["AscCommon"].CheckDefaultFontFamily=CheckDefaultFontFamily;window["Asc"]["SpecialPasteShowOptions"]=window["Asc"].SpecialPasteShowOptions=SpecialPasteShowOptions;prot=SpecialPasteShowOptions.prototype;prot["asc_getCellCoord"]= prot.asc_getCellCoord;prot["asc_getOptions"]=prot.asc_getOptions;prot["asc_getShowPasteSpecial"]=prot.asc_getShowPasteSpecial;prot["asc_getContainTables"]=prot.asc_getContainTables})(window);if(typeof exports==="object"&&this==exports)module.exports=EasySAXParser;function EasySAXParser(){if(!this)return null;function nullFunc(){}var onTextNode=nullFunc,onStartNode=nullFunc,onEndNode=nullFunc,onCDATA=nullFunc,onError=nullFunc,onComment,onQuestion,onAttention;var is_onComment,is_onQuestion,is_onAttention; var isNamespace=false,useNS,default_xmlns,xmlns,nsmatrix={xmlns:xmlns},hasSurmiseNS=false;this.on=function(name,cb){if(typeof cb!=="function")if(cb!==null)return;switch(name){case "error":onError=cb||nullFunc;break;case "startNode":onStartNode=cb||nullFunc;break;case "endNode":onEndNode=cb||nullFunc;break;case "textNode":onTextNode=cb||nullFunc;break;case "cdata":onCDATA=cb||nullFunc;break;case "comment":onComment=cb;is_onComment=!!cb;break;case "question":onQuestion=cb;is_onQuestion=!!cb;break;case "attention":onAttention= cb;is_onAttention=!!cb;break}};this.ns=function(root,ns){if(!root||typeof root!=="string"||!ns)return;var u,x={},ok,v,i;for(i in ns){v=ns[i];if(typeof v==="string"){if(root===v)ok=true;x[i]=v}}if(ok){isNamespace=true;default_xmlns=root;useNS=x}};this.parse=function(xml){if(typeof xml!=="string")return;if(isNamespace){nsmatrix={xmlns:default_xmlns};parse(xml);nsmatrix=false}else parse(xml);attr_res=true};var xharsQuot={"constructor":false,"hasOwnProperty":false,"isPrototypeOf":false,"propertyIsEnumerable":false, "toLocaleString":false,"toString":false,"valueOf":false,"quot":'"',"QUOT":'"',"amp":"&","AMP":"&","nbsp":"\u00a0","apos":"'","lt":"<","LT":"<","gt":">","GT":">","copy":"\u00a9","laquo":"\u00ab","raquo":"\u00bb","reg":"\u00ae","deg":"\u00b0","plusmn":"\u00b1","sup2":"\u00b2","sup3":"\u00b3","micro":"\u00b5","para":"\u00b6"};function rpEntities(s,d,x,z){if(z)return xharsQuot[z]||"\u0001";if(d)return String.fromCharCode(d);return String.fromCharCode(parseInt(x,16))}function unEntities(s,i){s=String(s); if(s.length>3&&s.indexOf("&")!==-1){if(s.indexOf(">")!==-1)s=s.replace(/>/g,">");if(s.indexOf("<")!==-1)s=s.replace(/</g,"<");if(s.indexOf(""")!==-1)s=s.replace(/"/g,'"');if(s.indexOf("&")!==-1)s=s.replace(/&#(\d+);|&#x([0123456789abcdef]+);|&(\w+);/ig,rpEntities)}return s}var attr_string="";var attr_posstart=0;var attr_res;var RGX_ATTR_NAME=/[^\w:-]+/g;function getAttrs(){if(attr_res!==null)return attr_res;var u,res={},s=attr_string,i=attr_posstart,l=s.length,attr_list=hasSurmiseNS? []:false,name,value="",ok=false,j,w,nn,n,hasNewMatrix,alias,newalias;aa:for(;i<l;i++){w=s.charCodeAt(i);if(w===32||w<14&&w>8)continue;if(w<65||w>122||w>90&&w<97)return attr_res=false;for(j=i+1;j<l;j++){w=s.charCodeAt(j);if(w>96&&w<123||w>64&&w<91||w>47&&w<59||w===45||w===95)continue;if(w!==61)return attr_res=false;break}name=s.substring(i,j);ok=true;if(name==="xmlns:xmlns")return attr_res=false;w=s.charCodeAt(j+1);if(w===34)j=s.indexOf('"',i=j+2);else if(w===39)j=s.indexOf("'",i=j+2);else return attr_res= false;if(j===-1)return attr_res=false;if(j+1<l){w=s.charCodeAt(j+1);if(w>32||w<9||w<32&&w>13)return attr_res=false}value=s.substring(i,j);i=j+1;if(isNamespace){if(hasSurmiseNS){if(newalias=name==="xmlns"?"xmlns":name.charCodeAt(0)===120&&name.substr(0,6)==="xmlns:"&&name.substr(6)){alias=useNS[unEntities(value)];if(alias){if(nsmatrix[newalias]!==alias){if(!hasNewMatrix){hasNewMatrix=true;nn={};for(n in nsmatrix)nn[n]=nsmatrix[n];nsmatrix=nn}nsmatrix[newalias]=alias}}else if(nsmatrix[newalias]){if(!hasNewMatrix){hasNewMatrix= true;nn={};for(n in nsmatrix)nn[n]=nsmatrix[n];nsmatrix=nn}nsmatrix[newalias]=false}res[name]=value;continue}attr_list.push(name,value);continue}w=name.length;while(--w)if(name.charCodeAt(w)===58){if(w=nsmatrix[name.substring(0,w)])res[w+name.substr(w)]=value;continue aa}}res[name]=value}if(!ok)return attr_res=true;if(hasSurmiseNS)bb:for(i=0,l=attr_list.length;i<l;i++){name=attr_list[i++];w=name.length;while(--w)if(name.charCodeAt(w)===58){if(w=nsmatrix[name.substring(0,w)])res[w+name.substr(w)]= attr_list[i];continue bb;break}res[name]=attr_list[i]}return attr_res=res}function parse(xml){var u,xml=String(xml),nodestack=[],stacknsmatrix=[],elem,tagend=false,tagstart=false,j=0,i=0,x,y,q,w,xmlns,stopIndex=0,stop,_nsmatrix,ok;function getStringNode(){return xml.substring(i,j+1)}while(j!==-1){stop=stopIndex>0;if(xml.charCodeAt(j)===60)i=j;else i=xml.indexOf("<",j);if(i===-1){if(nodestack.length){onError("end file");return}return}if(j!==i&&!stop){ok=onTextNode(xml.substring(j,i),unEntities);if(ok=== false)return}w=xml.charCodeAt(i+1);if(w===33){w=xml.charCodeAt(i+2);if(w===91&&xml.substr(i+3,6)==="CDATA["){j=xml.indexOf("]]\x3e",i);if(j===-1){onError("cdata");return}if(!stop){ok=onCDATA(xml.substring(i+9,j),false);if(ok===false)return}j+=3;continue}if(w===45&&xml.charCodeAt(i+3)===45){j=xml.indexOf("--\x3e",i);if(j===-1){onError("expected --\x3e");return}if(is_onComment&&!stop){ok=onComment(xml.substring(i+4,j),unEntities);if(ok===false)return}j+=3;continue}j=xml.indexOf(">",i+1);if(j===-1){onError('expected ">"'); return}if(is_onAttention&&!stop){ok=onAttention(xml.substring(i,j+1),unEntities);if(ok===false)return}j+=1;continue}else if(w===63){j=xml.indexOf("?>",i);if(j===-1){onError("...?>");return}if(is_onQuestion){ok=onQuestion(xml.substring(i,j+2));if(ok===false)return}j+=2;continue}j=xml.indexOf(">",i+1);if(j==-1){onError("...>");return}attr_res=true;if(w===47){tagstart=false;tagend=true;x=elem=nodestack.pop();q=i+2+x.length;if(xml.substring(i+2,q)!==x){onError("close tagname");return}for(;q<j;q++){w= xml.charCodeAt(q);if(w===32||w>8&&w<14)continue;onError("close tag");return}}else{if(xml.charCodeAt(j-1)===47){x=elem=xml.substring(i+1,j-1);tagstart=true;tagend=true}else{x=elem=xml.substring(i+1,j);tagstart=true;tagend=false}if(!(w>96&&w<123||w>64&&w<91)){onError("first char nodeName");return}for(q=1,y=x.length;q<y;q++){w=x.charCodeAt(q);if(w>96&&w<123||w>64&&w<91||w>47&&w<59||w===45||w===95)continue;if(w===32||w<14&&w>8){elem=x.substring(0,q);attr_res=null;break}onError("invalid nodeName");return}if(!tagend)nodestack.push(elem)}if(isNamespace){if(stop){if(tagend){if(!tagstart)if(--stopIndex=== 0)nsmatrix=stacknsmatrix.pop()}else stopIndex+=1;j+=1;continue}_nsmatrix=nsmatrix;if(!tagend){stacknsmatrix.push(nsmatrix);if(attr_res!==true)if(hasSurmiseNS=x.indexOf("xmlns",q)!==-1){attr_string=x;attr_posstart=q;getAttrs();hasSurmiseNS=false}}w=elem.indexOf(":");if(w!==-1){xmlns=nsmatrix[elem.substring(0,w)];elem=elem.substr(w+1)}else xmlns=nsmatrix.xmlns;if(!xmlns){if(tagend)if(tagstart)nsmatrix=_nsmatrix;else nsmatrix=stacknsmatrix.pop();else{stopIndex=1;attr_res=true}j+=1;continue}elem=xmlns+ ":"+elem}if(tagstart){attr_string=x;attr_posstart=q;ok=onStartNode(elem,getAttrs,unEntities,tagend,getStringNode);if(ok===false)return;attr_res=true}if(tagend){ok=onEndNode(elem,unEntities,tagstart,getStringNode);if(ok===false)return;if(isNamespace)if(tagstart)nsmatrix=_nsmatrix;else nsmatrix=stacknsmatrix.pop()}j+=1}}}"use strict";(function(window){var openXml={};function SaxParserBase(){this.depth=0;this.depthSkip=null;this.context=null;this.contextStack=[]}SaxParserBase.prototype.onError=function(msg){throw new Error(msg); };SaxParserBase.prototype.onStartNode=function(elem,attr,uq,tagend,getStrNode){this.depth++;if(!this.isSkip()){var newContext;if(this.context.onStartNode){newContext=this.context.onStartNode.apply(this.context,arguments);if(!newContext)this.skip()}if(!this.isSkip()&&!tagend){this.context=newContext?newContext:this.context;this.contextStack.push(this.context)}}};SaxParserBase.prototype.onTextNode=function(text,uq){if(this.context&&this.context.onTextNode)this.context.onTextNode.apply(this.context, arguments)};SaxParserBase.prototype.onEndNode=function(elem,uq,tagstart,getStrNode){this.depth--;var isSkip=this.isSkip();if(isSkip&&this.depth<=this.depthSkip)this.depthSkip=null;if(!isSkip){var prevContext=this.context;if(!tagstart){this.contextStack.pop();this.context=this.contextStack[this.contextStack.length-1]}if(this.context&&this.context.onEndNode)this.context.onEndNode(prevContext,elem,uq,tagstart,getStrNode)}};SaxParserBase.prototype.skip=function(){this.depthSkip=this.depth-1};SaxParserBase.prototype.isSkip= function(){return null!==this.depthSkip};SaxParserBase.prototype.parse=function(xml,context){var t=this;this.context=context;var parser=new EasySAXParser;parser.on("error",function(){t.onError.apply(t,arguments)});parser.on("startNode",function(){t.onStartNode.apply(t,arguments)});parser.on("textNode",function(){t.onTextNode.apply(t,arguments)});parser.on("endNode",function(){t.onEndNode.apply(t,arguments)});parser.parse(xml)};openXml.SaxParserBase=SaxParserBase;openXml.SaxParserDataTransfer={};function ContentTypes(){this.Defaults= {};this.Overrides={}}ContentTypes.prototype.onStartNode=function(elem,attr,uq,tagend,getStrNode){var attrVals;if("Default"===elem){if(attr()){attrVals=attr();this.Defaults[attrVals["Extension"]]=attrVals["ContentType"]}}else if("Override"===elem)if(attr()){attrVals=attr();this.Overrides[attrVals["PartName"]]=attrVals["ContentType"]}return this};function RelsReader(pkg,part){this.pkg=pkg;this.part=part;this.rels=[]}RelsReader.prototype.onStartNode=function(elem,attr,uq,tagend,getStrNode){var attrVals; if("Relationships"===elem);else if("Relationship"===elem)if(attr()){attrVals=attr();var targetMode=null;var tm=attrVals["TargetMode"];if(tm)targetMode=tm;var theRel=new openXml.OpenXmlRelationship(this.pkg,this.part,attrVals["Id"],attrVals["Type"],attrVals["Target"],targetMode);this.rels.push(theRel)}return this};function openFromZip(zip,pkg){var relsData=[];for(var f in zip.files){var zipFile=zip.files[f];if(!f.endsWith("/")){var f2=f;if(f!=="[Content_Types].xml")f2="/"+f;var newPart=new openXml.OpenXmlPart(pkg, f2,null,null,zipFile);pkg.parts[f2]=newPart;if(f.endsWith(".rels")){var uri=getPartUriOfRelsPart(newPart);relsData.push([uri,newPart])}}}var ctf=pkg.parts["[Content_Types].xml"];if(ctf===null)throw"Invalid Open XML document: no [Content_Types].xml";var promises=[];promises.push(ctf.data.async("string"));for(var i=0;i<relsData.length;++i)promises.push(relsData[i][1].data.async("string"));return Promise.all(promises).then(function(res){(new SaxParserBase).parse(res[0],pkg.cntTypes);for(var part in pkg.parts){if(part=== "[Content_Types].xml")continue;var ct=pkg.getContentType(part);var thisPart=pkg.parts[part];thisPart.contentType=ct;if(ct!==undefined&&ct.endsWith("xml"))thisPart.partType="xml";else thisPart.partType="binary"}for(var i=0;i<relsData.length;++i){var uri=relsData[i][0];var part=pkg.parts[uri];var relsReader;if(part)relsReader=new RelsReader(null,part);else if("/"===uri)relsReader=new RelsReader(pkg,null);(new SaxParserBase).parse(res[i+1],relsReader);relsData[i][1].rels=relsReader.rels}})}openXml.OpenXmlPackage= function(){this.rels=null;this.parts={};this.cntTypes=new ContentTypes};openXml.OpenXmlPackage.prototype.openFromZip=function(documentToOpen){return openFromZip(documentToOpen,this)};openXml.OpenXmlPackage.prototype.getRelationships=function(){var rootRelationshipsPart=this.getPartByUri("/_rels/.rels");rootRelationshipsPart.rels};openXml.OpenXmlPackage.prototype.getRelationship=function(rId){var rels=this.getRelationships();for(var i=0;i<rels.length;++i){var rel=rels[i];if(rel.relationshipId===rId)return rel}return rel}; openXml.OpenXmlPackage.prototype.getParts=function(){var parts=[];for(var part in this.parts)if(this.parts[part].contentType!==openXml.contentTypes.relationships&&part!=="[Content_Types].xml")parts.push(this.parts[part]);return parts};openXml.OpenXmlPackage.prototype.getRelationshipsByRelationshipType=function(relationshipType){var rootRelationshipsPart=this.getPartByUri("/_rels/.rels");var rels=[];for(var i=0;i<rootRelationshipsPart.rels.length;++i){var rel=rootRelationshipsPart.rels[i];if(rel.relationshipType=== relationshipType)rels.push(rel)}return rels};openXml.OpenXmlPackage.prototype.getPartsByRelationshipType=function(relationshipType){var rels=this.getRelationshipsByRelationshipType(relationshipType);var parts=[];for(var i=0;i<rels.length;++i){var part=this.getPartByUri(rels[i].targetFullName);parts.push(part)}return parts};openXml.OpenXmlPackage.prototype.getPartByRelationshipType=function(relationshipType){var parts=this.getPartsByRelationshipType(relationshipType);if(parts.length<1)return null; return parts[0]};openXml.OpenXmlPackage.prototype.getRelationshipsByContentType=function(contentType){var rootRelationshipsPart=this.getPartByUri("/_rels/.rels");if(rootRelationshipsPart){var allRels=rootRelationshipsPart.rels;var rels=[];for(var i=0;i<allRels.length;++i){if(allRels[i].targetMode==="External")continue;var ct=this.getContentType(allRels[i].targetFullName);if(ct!==contentType)continue;rels.push(allRels[i])}return rels}return[]};openXml.OpenXmlPackage.prototype.getPartsByContentType= function(contentType){var rels=this.getRelationshipsByContentType(contentType);var parts=[];for(var i=0;i<rels.length;++i){var part=this.getPartByUri(rels[i].targetFullName);parts.push(part)}return parts};openXml.OpenXmlPackage.prototype.getRelationshipById=function(rId){return this.getRelationship(rId)};openXml.OpenXmlPackage.prototype.getPartById=function(rId){var rel=this.getRelationship(rId);return rel?this.getPartByUri(rel.targetFullName):null};openXml.OpenXmlPackage.prototype.getPartByUri=function(uri){var part= this.parts[uri];return part};openXml.OpenXmlPackage.prototype.getContentType=function(uri){var ct=this.cntTypes.Overrides[uri];if(!ct){var exti=uri.lastIndexOf(".");var ext=uri.substring(exti+1);ct=this.cntTypes.Defaults[ext]}return ct};openXml.OpenXmlPart=function(pkg,uri,contentType,partType,data){this.pkg=pkg;this.uri=uri;this.contentType=contentType;this.partType=partType;if(uri==="[Content_Types].xml")partType="xml";this.data=data};openXml.OpenXmlPart.prototype.getDocumentContent=function(){if(this.partType=== "xml")return this.data.async("string");return""};function getRelsPartUriOfPart(part){var uri=part.uri;var lastSlash=uri.lastIndexOf("/");var partFileName=uri.substring(lastSlash+1);var relsFileName=uri.substring(0,lastSlash)+"/_rels/"+partFileName+".rels";return relsFileName}function getPartUriOfRelsPart(part){var uri=part.uri;var lastSlash=uri.lastIndexOf("/");var partFileName=uri.substring(lastSlash+1,uri.length-".rels".length);var relsFileName=uri.substring(0,uri.lastIndexOf("/",lastSlash-1)+1)+ partFileName;return relsFileName}function getRelsPartOfPart(part){var relsFileName=getRelsPartUriOfPart(part);var relsPart=part.pkg.getPartByUri(relsFileName);return relsPart}openXml.OpenXmlPart.prototype.getRelationships=function(){var relsPart=getRelsPartOfPart(this);if(relsPart)return relsPart.rels;return[]};openXml.OpenXmlPart.prototype.getRelationship=function(rId){var rels=this.getRelationships();for(var i=0;i<rels.length;++i){var rel=rels[i];if(rel.relationshipId==rId)return rel}return null}; openXml.OpenXmlPart.prototype.getParts=function(){var parts=[];var rels=this.getRelationships();for(var i=0;i<rels.length;++i)if(rels[i].targetMode==="Internal"){var part=this.pkg.getPartByUri(rels[i].targetFullName);parts.push(part)}return parts};openXml.OpenXmlPart.prototype.getRelationshipsByRelationshipType=function(relationshipType){var rels=[];var allRels=this.getRelationships();for(var i=0;i<allRels.length;++i)if(allRels[i].relationshipType===relationshipType)rels.push(allRels[i]);return rels}; openXml.OpenXmlPart.prototype.getPartsByRelationshipType=function(relationshipType){var parts=[];var rels=this.getRelationshipsByRelationshipType(relationshipType);for(var i=0;i<rels.length;++i){var part=this.pkg.getPartByUri(rels[i].targetFullName);parts.push(part)}return parts};openXml.OpenXmlPart.prototype.getPartByRelationshipType=function(relationshipType){var parts=this.getPartsByRelationshipType(relationshipType);if(parts.length<1)return null;return parts[0]};openXml.OpenXmlPart.prototype.getRelationshipsByContentType= function(contentType){var rels=[];var allRels=this.getRelationships();for(var i=0;i<allRels.length;++i)if(allRels[i].targetMode==="Internal"){var ct=this.pkg.getContentType(allRels[i].targetFullName);if(ct===contentType)rels.push(allRels[i])}return rels};openXml.OpenXmlPart.prototype.getPartsByContentType=function(contentType){var parts=[];var rels=this.getRelationshipsByContentType(contentType);for(var i=0;i<rels.length;++i){var part=this.pkg.getPartByUri(rels[i].targetFullName);parts.push(part)}return parts}; openXml.OpenXmlPart.prototype.getRelationshipById=function(relationshipId){return this.getRelationship(relationshipId)};openXml.OpenXmlPart.prototype.getPartById=function(relationshipId){var rel=this.getRelationshipById(relationshipId);if(rel){var part=this.pkg.getPartByUri(rel.targetFullName);return part}return null};openXml.OpenXmlRelationship=function(pkg,part,relationshipId,relationshipType,target,targetMode){this.fromPkg=pkg;this.fromPart=part;this.relationshipId=relationshipId;this.relationshipType= relationshipType;this.target=target;this.targetMode=targetMode;if(!targetMode)this.targetMode="Internal";var workingTarget=target;var workingCurrentPath;if(this.fromPkg)workingCurrentPath="/";if(this.fromPart){var slashIndex=this.fromPart.uri.lastIndexOf("/");if(slashIndex===-1)workingCurrentPath="/";else workingCurrentPath=this.fromPart.uri.substring(0,slashIndex)+"/"}if(targetMode==="External"){this.targetFullName=this.target;return}while(workingTarget.startsWith("../")){if(workingCurrentPath.endsWith("/"))workingCurrentPath= workingCurrentPath.substring(0,workingCurrentPath.length-1);var indexOfLastSlash=workingCurrentPath.lastIndexOf("/");if(indexOfLastSlash===-1)throw"internal error when processing relationships";workingCurrentPath=workingCurrentPath.substring(0,indexOfLastSlash+1);workingTarget=workingTarget.substring(3)}this.targetFullName=workingCurrentPath+workingTarget};openXml.contentTypes={calculationChain:"application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml",cellMetadata:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml", chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",chartColorStyle:"application/vnd.ms-office.chartcolorstyle+xml",chartDrawing:"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml",chartsheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",chartStyle:"application/vnd.ms-office.chartstyle+xml",commentAuthors:"application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml",connections:"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml", coreFileProperties:"application/vnd.openxmlformats-package.core-properties+xml",customFileProperties:"application/vnd.openxmlformats-officedocument.custom-properties+xml",customization:"application/vnd.ms-word.keyMapCustomizations+xml",customProperty:"application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty",customXmlProperties:"application/vnd.openxmlformats-officedocument.customXmlProperties+xml",diagramColors:"application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml", diagramData:"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml",diagramLayoutDefinition:"application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml",diagramPersistLayout:"application/vnd.ms-office.drawingml.diagramDrawing+xml",diagramStyle:"application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml",dialogsheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",digitalSignatureOrigin:"application/vnd.openxmlformats-package.digital-signature-origin", documentSettings:"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml",drawings:"application/vnd.openxmlformats-officedocument.drawing+xml",endnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",excelAttachedToolbars:"application/vnd.ms-excel.attachedToolbars",extendedFileProperties:"application/vnd.openxmlformats-officedocument.extended-properties+xml",externalWorkbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml", fontData:"application/x-fontdata",fontTable:"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml",footer:"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",footnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",gif:"image/gif",glossaryDocument:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml",handoutMaster:"application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml", header:"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",jpeg:"image/jpeg",mainDocument:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",numberingDefinitions:"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",pict:"image/pict",pivotTable:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", pivotTableCacheDefinition:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml",pivotTableCacheRecords:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml",png:"image/png",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",presentationProperties:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",presentationTemplate:"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml", queryTable:"application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml",relationships:"application/vnd.openxmlformats-package.relationships+xml",ribbonAndBackstageCustomizations:"http://schemas.microsoft.com/office/2009/07/customui",sharedStringTable:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",singleCellTable:"application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml",slicerCache:"application/vnd.openxmlformats-officedocument.spreadsheetml.slicerCache+xml", slicers:"application/vnd.openxmlformats-officedocument.spreadsheetml.slicer+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",slideComments:"application/vnd.openxmlformats-officedocument.presentationml.comments+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideShow:"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml", slideSyncData:"application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml",styles:"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",tableDefinition:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",themeOverride:"application/vnd.openxmlformats-officedocument.themeOverride+xml", tiff:"image/tiff",trueTypeFont:"application/x-font-ttf",userDefinedTags:"application/vnd.openxmlformats-officedocument.presentationml.tags+xml",viewProperties:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",vmlDrawing:"application/vnd.openxmlformats-officedocument.vmlDrawing",volatileDependencies:"application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml",webSettings:"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml", wordAttachedToolbars:"application/vnd.ms-word.attachedToolbars",wordprocessingComments:"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",wordprocessingTemplate:"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml",workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",workbookRevisionHeader:"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml",workbookRevisionLog:"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml", workbookStyles:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",workbookTemplate:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml",workbookUserData:"application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml",worksheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",worksheetComments:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",worksheetSortMap:"application/vnd.ms-excel.wsSortMap+xml", xmlSignature:"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml"};openXml.relationshipTypes={alternativeFormatImport:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",calculationChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",cellMetadata:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",chartColorStyle:"http://schemas.microsoft.com/office/2011/relationships/chartColorStyle", chartDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes",chartsheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",chartStyle:"http://schemas.microsoft.com/office/2011/relationships/chartStyle",commentAuthors:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors",connections:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections",coreFileProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", customFileProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",customization:"http://schemas.microsoft.com/office/2006/relationships/keyMapCustomizations",customProperty:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customProperty",customXml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",customXmlMappings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/xmlMaps",customXmlProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", diagramColors:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors",diagramData:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData",diagramLayoutDefinition:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout",diagramPersistLayout:"http://schemas.microsoft.com/office/2007/relationships/diagramDrawing",diagramStyle:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle",dialogsheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet", digitalSignatureOrigin:"http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin",documentSettings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",drawings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",endnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",excelAttachedToolbars:"http://schemas.microsoft.com/office/2006/relationships/attachedToolbars",extendedFileProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", externalWorkbook:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",fontTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",footer:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",footnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",glossaryDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument", handoutMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/handoutMaster",header:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",mainDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",numberingDefinitions:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering", pivotTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",pivotTableCacheDefinition:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",pivotTableCacheRecords:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords",presentation:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",presentationProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps", queryTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable",ribbonAndBackstageCustomizations:"http://schemas.microsoft.com/office/2007/relationships/ui/extensibility",sharedStringTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",singleCellTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableSingleCells",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",slideComments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments", slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideSyncData:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideUpdateInfo",styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",tableDefinition:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles", theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",themeOverride:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/themeOverride",thumbnail:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail",userDefinedTags:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tags",viewProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",vmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing", volatileDependencies:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/volatileDependencies",webSettings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",wordAttachedToolbars:"http://schemas.microsoft.com/office/2006/relationships/attachedToolbars",wordprocessingComments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",workbook:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",workbookRevisionHeader:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionHeaders", workbookRevisionLog:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionLog",workbookStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",workbookUserData:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/usernames",worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",worksheetComments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",worksheetSortMap:"http://schemas.microsoft.com/office/2006/relationships/wsSortMap", xmlSignature:"http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature"};window.openXml=openXml;window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].openXml=openXml})(window);"use strict";(function(window){var isSame=function shallowEqual(objA,objB,compare,compareContext){var ret=compare?compare.call(compareContext,objA,objB):void 0;if(ret!==void 0)return!!ret;if(objA===objB)return true;if(typeof objA!=="object"||!objA||typeof objB!=="object"||!objB)return false; var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length)return false;var bHasOwnProperty=Object.prototype.hasOwnProperty.bind(objB);for(var idx=0;idx<keysA.length;idx++){var key=keysA[idx];if(!bHasOwnProperty(key))return false;var valueA=objA[key];var valueB=objB[key];ret=compare?compare.call(compareContext,valueA,valueB,key):void 0;if(ret===false||ret===void 0&&valueA!==valueB)return false}return true};function height(node){if(node===undefined)return-1;else return node.height} var Node=function(){function Node(intervalTree,record){this.intervalTree=intervalTree;this.records=[];this.height=0;this.key=record.low;this.max=record.high;this.records.push(record)}Node.prototype.getNodeHigh=function(){var high=this.records[0].high;for(var i=1;i<this.records.length;i++)if(this.records[i].high>high)high=this.records[i].high;return high};Node.prototype.updateHeight=function(){this.height=Math.max(height(this.left),height(this.right))+1};Node.prototype.updateMaxOfParents=function(){if(this=== undefined)return;var thisHigh=this.getNodeHigh();if(this.left!==undefined&&this.right!==undefined)this.max=Math.max(Math.max(this.left.max,this.right.max),thisHigh);else if(this.left!==undefined&&this.right===undefined)this.max=Math.max(this.left.max,thisHigh);else if(this.left===undefined&&this.right!==undefined)this.max=Math.max(this.right.max,thisHigh);else this.max=thisHigh;if(this.parent)this.parent.updateMaxOfParents()};Node.prototype._updateMaxAfterRightRotate=function(){var parent=this.parent; var left=parent.left;var thisParentLeftHigh=left.getNodeHigh();if(left.left===undefined&&left.right!==undefined)left.max=Math.max(thisParentLeftHigh,left.right.max);else if(left.left!==undefined&&left.right===undefined)left.max=Math.max(thisParentLeftHigh,left.left.max);else if(left.left===undefined&&left.right===undefined)left.max=thisParentLeftHigh;else left.max=Math.max(Math.max(left.left.max,left.right.max),thisParentLeftHigh);var thisHigh=this.getNodeHigh();if(this.left===undefined&&this.right!== undefined)this.max=Math.max(thisHigh,this.right.max);else if(this.left!==undefined&&this.right===undefined)this.max=Math.max(thisHigh,this.left.max);else if(this.left===undefined&&this.right===undefined)this.max=thisHigh;else this.max=Math.max(Math.max(this.left.max,this.right.max),thisHigh);parent.max=Math.max(Math.max(parent.left.max,parent.right.max),parent.getNodeHigh())};Node.prototype._updateMaxAfterLeftRotate=function(){var parent=this.parent;var right=parent.right;var thisParentRightHigh= right.getNodeHigh();if(right.left===undefined&&right.right!==undefined)right.max=Math.max(thisParentRightHigh,right.right.max);else if(right.left!==undefined&&right.right===undefined)right.max=Math.max(thisParentRightHigh,right.left.max);else if(right.left===undefined&&right.right===undefined)right.max=thisParentRightHigh;else right.max=Math.max(Math.max(right.left.max,right.right.max),thisParentRightHigh);var thisHigh=this.getNodeHigh();if(this.left===undefined&&this.right!==undefined)this.max=Math.max(thisHigh, this.right.max);else if(this.left!==undefined&&this.right===undefined)this.max=Math.max(thisHigh,this.left.max);else if(this.left===undefined&&this.right===undefined)this.max=thisHigh;else this.max=Math.max(Math.max(this.left.max,this.right.max),thisHigh);parent.max=Math.max(Math.max(parent.left.max,right.max),parent.getNodeHigh())};Node.prototype._leftRotate=function(){var rightChild=this.right;rightChild.parent=this.parent;if(rightChild.parent===undefined)this.intervalTree.root=rightChild;else if(rightChild.parent.left=== this)rightChild.parent.left=rightChild;else if(rightChild.parent.right===this)rightChild.parent.right=rightChild;this.right=rightChild.left;if(this.right!==undefined)this.right.parent=this;rightChild.left=this;this.parent=rightChild;this.updateHeight();rightChild.updateHeight()};Node.prototype._rightRotate=function(){var leftChild=this.left;leftChild.parent=this.parent;if(leftChild.parent===undefined)this.intervalTree.root=leftChild;else if(leftChild.parent.left===this)leftChild.parent.left=leftChild; else if(leftChild.parent.right===this)leftChild.parent.right=leftChild;this.left=leftChild.right;if(this.left!==undefined)this.left.parent=this;leftChild.right=this;this.parent=leftChild;this.updateHeight();leftChild.updateHeight()};Node.prototype._rebalance=function(){if(height(this.left)>=2+height(this.right)){var left=this.left;if(height(left.left)>=height(left.right)){this._rightRotate();this._updateMaxAfterRightRotate()}else{left._leftRotate();this._rightRotate();this._updateMaxAfterRightRotate()}}else if(height(this.right)>= 2+height(this.left)){var right=this.right;if(height(right.right)>=height(right.left)){this._leftRotate();this._updateMaxAfterLeftRotate()}else{right._rightRotate();this._leftRotate();this._updateMaxAfterLeftRotate()}}};Node.prototype.insert=function(record){if(record.low<this.key)if(this.left===undefined){this.left=new Node(this.intervalTree,record);this.left.parent=this}else this.left.insert(record);else if(this.right===undefined){this.right=new Node(this.intervalTree,record);this.right.parent=this}else this.right.insert(record); if(this.max<record.high)this.max=record.high;this.updateHeight();this._rebalance()};Node.prototype._getOverlappingRecords=function(currentNode,low,high,output){if(currentNode.key<=high&&low<=currentNode.getNodeHigh())for(var i=0;i<currentNode.records.length;i++)if(currentNode.records[i].high>=low)output.push(currentNode.records[i])};Node.prototype.search=function(low,high,output){if(this===undefined)return;if(low>this.max)return;if(this.left!==undefined&&this.left.max>=low)this.left.search(low,high, output);this._getOverlappingRecords(this,low,high,output);if(high<this.key)return;if(this.right!==undefined)this.right.search(low,high,output)};Node.prototype.searchAny=function(low,high){if(this===undefined)return;if(low>this.max)return;if(this.key<=high)for(var i=0;i<this.records.length;i++)if(this.records[i].high>=low)return this.records[i];if(this.left!==undefined&&this.left.max>=low)return this.left.searchAny(low,high);else if(this.right!==undefined&&this.key<=high)return this.right.searchAny(low, high)};Node.prototype.searchExisting=function(low){if(this===undefined)return undefined;if(this.key===low)return this;else if(low<this.key){if(this.left!==undefined)return this.left.searchExisting(low)}else if(this.right!==undefined)return this.right.searchExisting(low);return undefined};Node.prototype._minValue=function(){if(this.left===undefined)return this;else return this.left._minValue()};Node.prototype.remove=function(node){var parent=this.parent;if(node.key<this.key)if(this.left!==undefined)return this.left.remove(node); else return undefined;else if(node.key>this.key)if(this.right!==undefined)return this.right.remove(node);else return undefined;else if(this.left!==undefined&&this.right!==undefined){var minValue=this.right._minValue();this.key=minValue.key;this.records=minValue.records;return this.right.remove(this)}else if(parent.left===this){if(this.right!==undefined){parent.left=this.right;this.right.parent=parent}else{parent.left=this.left;if(this.left!==undefined)this.left.parent=parent}parent.updateMaxOfParents(); parent.updateHeight();parent._rebalance();return this}else if(parent.right===this){if(this.right!==undefined){parent.right=this.right;this.right.parent=parent}else{parent.right=this.left;if(this.left!==undefined)this.left.parent=parent}parent.updateMaxOfParents();parent.updateHeight();parent._rebalance();return this}};return Node}();var IntervalTree=function(){function IntervalTree(){this.count=0}IntervalTree.prototype.insert=function(record){if(record.low>record.high)throw new Error("`low` value must be lower or equal to `high` value"); if(this.root===undefined){this.root=new Node(this,record);this.count++;return true}else{var node=this.root.searchExisting(record.low);if(node!==undefined){for(var i=0;i<node.records.length;i++)if(isSame(node.records[i],record))return false;node.records.push(record);if(record.high>node.max){node.max=record.high;if(node.parent)node.parent.updateMaxOfParents()}this.count++;return true}else{this.root.insert(record);this.count++;return true}}};IntervalTree.prototype.search=function(low,high,opt_output){if(!opt_output)opt_output= [];if(this.root!==undefined)this.root.search(low,high,opt_output);return opt_output};IntervalTree.prototype.searchExisting=function(low,high){if(this.root){var node=this.root.searchExisting(low);if(node)for(var i=0;i<node.records.length;i++)if(node.records[i].high===high)return node.records[i]}};IntervalTree.prototype.searchAny=function(low,high){if(this.root)return this.root.searchAny(low,high)};IntervalTree.prototype.remove=function(record){if(this.root===undefined)return false;else{var node=this.root.searchExisting(record.low); if(node===undefined)return false;else if(node.records.length>1){var removedRecord=void 0;for(var i=0;i<node.records.length;i++)if(isSame(node.records[i],record)){removedRecord=node.records[i];node.records.splice(i,1);break}if(removedRecord){removedRecord=undefined;if(record.high===node.max){var nodeHigh=node.getNodeHigh();if(node.left!==undefined&&node.right!==undefined)node.max=Math.max(Math.max(node.left.max,node.right.max),nodeHigh);else if(node.left!==undefined&&node.right===undefined)node.max= Math.max(node.left.max,nodeHigh);else if(node.left===undefined&&node.right!==undefined)node.max=Math.max(node.right.max,nodeHigh);else node.max=nodeHigh;if(node.parent)node.parent.updateMaxOfParents()}this.count--;return true}else return false}else if(node.records.length===1)if(isSame(node.records[0],record))if(this.root.key===node.key){var rootParent=new Node(this,{low:record.low,high:record.low});rootParent.left=this.root;this.root.parent=rootParent;var removedNode=this.root.remove(node);this.root= rootParent.left;if(this.root!==undefined)this.root.parent=undefined;if(removedNode){removedNode=undefined;this.count--;return true}else return false}else{var removedNode=this.root.remove(node);if(removedNode){removedNode=undefined;this.count--;return true}else return false}else return false;else return false}};IntervalTree.prototype.inOrder=function(){return new InOrder(this.root)};IntervalTree.prototype.preOrder=function(){return new PreOrder(this.root)};return IntervalTree}();var DataIntervalTree= function(){function DataIntervalTree(){this.tree=new IntervalTree}DataIntervalTree.prototype.insert=function(low,high,data){return this.tree.insert({low:low,high:high,data:data})};DataIntervalTree.prototype.remove=function(low,high,data){return this.tree.remove({low:low,high:high,data:data})};DataIntervalTree.prototype.searchNodes=function(low,high){return this.tree.search(low,high)};DataIntervalTree.prototype.search=function(low,high){return this.searchNodes(low,high).map(function(v){return v.data})}; DataIntervalTree.prototype.searchExisting=function(low,high){var record=this.tree.searchExisting(low,high);return record?record.data:undefined};DataIntervalTree.prototype.searchAny=function(low,high){var record=this.tree.searchAny(low,high);return record?record.data:undefined};DataIntervalTree.prototype.inOrder=function(){return this.tree.inOrder()};DataIntervalTree.prototype.preOrder=function(){return this.tree.preOrder()};Object.defineProperty(DataIntervalTree.prototype,"count",{get:function(){return this.tree.count}, enumerable:true,configurable:true});return DataIntervalTree}();var DataIntervalTree2D=function(){function DataIntervalTree2D(){this.tree=new IntervalTree}DataIntervalTree2D.prototype.insert=function(bbox,data){var record=this.tree.searchExisting(bbox.r1,bbox.r2);if(!record){record={low:bbox.r1,high:bbox.r2,data:new IntervalTree};this.tree.insert(record)}record.data.insert({low:bbox.c1,high:bbox.c2,data:data})};DataIntervalTree2D.prototype.remove=function(bbox,data){var record=this.tree.searchExisting(bbox.r1, bbox.r2);if(record)record.data.remove({low:bbox.c1,high:bbox.c2,data:data})};DataIntervalTree2D.prototype.searchNodes=function(bbox){var res=[];var records=this.tree.search(bbox.r1,bbox.r2);for(var i=0;i<records.length;i++)records[i].data.search(bbox.c1,bbox.c2,res);return res};DataIntervalTree2D.prototype.searchAny=function(bbox){var any;var records=this.tree.search(bbox.r1,bbox.r2);for(var i=0;i<records.length;i++){any=records[i].data.searchAny(bbox.c1,bbox.c2);if(any)return any.data}return null}; return DataIntervalTree2D}();var InOrder=function(){function InOrder(startNode){this.stack=[];if(startNode!==undefined)this.push(startNode)}InOrder.prototype.next=function(){if(this.currentNode===undefined)return{done:true,value:undefined};if(this.i<this.currentNode.records.length)return{done:false,value:this.currentNode.records[this.i++]};if(this.currentNode.right!==undefined)this.push(this.currentNode.right);else this.pop();return this.next()};InOrder.prototype.push=function(node){this.currentNode= node;this.i=0;while(this.currentNode.left!==undefined){this.stack.push(this.currentNode);this.currentNode=this.currentNode.left}};InOrder.prototype.pop=function(){this.currentNode=this.stack.pop();this.i=0};return InOrder}();if(typeof Symbol==="function")InOrder.prototype[Symbol.iterator]=function(){return this};var PreOrder=function(){function PreOrder(startNode){this.stack=[];this.i=0;this.currentNode=startNode}PreOrder.prototype.next=function(){if(this.currentNode===undefined)return{done:true, value:undefined};if(this.i<this.currentNode.records.length)return{done:false,value:this.currentNode.records[this.i++]};if(this.currentNode.right!==undefined)this.push(this.currentNode.right);if(this.currentNode.left!==undefined)this.push(this.currentNode.left);this.pop();return this.next()};PreOrder.prototype.push=function(node){this.stack.push(node)};PreOrder.prototype.pop=function(){this.currentNode=this.stack.pop();this.i=0};return PreOrder}();if(typeof Symbol==="function")PreOrder.prototype[Symbol.iterator]= function(){return this};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].DataIntervalTree=DataIntervalTree;window["AscCommon"].DataIntervalTree2D=DataIntervalTree2D})(window);(function(window,undefined){function getEmpty(){return"XLSY;v2;5958;BAKAAgAAA7kDAAAEzAMAAABaBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADUBAAAAHgAAAAEZAAAAAAAAAAABAAAAAAIAAAAABAAAAAAFAAAAAAQKAAAABQAAAAAFAAAAAAYvAAAAByoAAAABBgMAAAACAQEEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAOHQAAAAMYAAAABgQAAAAABwQAAAAACAQAAAAACQQAAAAAAiMAAAADHgAAAAYEAAAAAAcEAAAAAAgEAAAAAAkEAAAAAAwEAAAAAA8oAAAAECMAAAAABAAAAAAAAAAEDAAAAE4AbwByAG0AYQBsAAUEAAAAAAAAAAoAAAAADE4AAAAAIgAAAFQAYQBiAGwAZQBTAHQAeQBsAGUATQBlAGQAaQB1AG0AMgABIgAAAFAAaQB2AG8AdABTAHQAeQBsAGUATABpAGcAaAB0ADEANgAPAAAAAAAAAAABBQAAAAIAAAAAigAAAACFAAAAARgAAAAABgwAAABTAGgAZQBlAHQAMQABBAEAAAAEBAAAAEEAMQAWBQAAABcAAAAACwoAAAABBQAAAAAAAC5ADjwAAAAABUfhehSuxzFAAQXMzMzMzAwzQAIFR+F6FK7HMUADBczMzMzMDDNABAV7FK5H4XoeQAUFexSuR+F6HkAJAAAAAOgSAAAF4xIAABTeEgAA+gAMAAAATwBmAGYAaQBjAGUAIABUAGgAZQBtAGUA+wCxEgAAABUBAAD6AAYAAABPAGYAZgBpAGMAZQD7DB4AAAAEGQAAAPoABgAAAHcAaQBuAGQAbwB3AAH/Av8D//sNDQAAAAEIAAAA+gDuAewC4fsIJgAAAAQhAAAA+gAKAAAAdwBpAG4AZABvAHcAVABlAHgAdAABAAIAAwD7Cg0AAAABCAAAAPoAgAEAAoD7AA0AAAABCAAAAPoATwGBAr37CQ0AAAABCAAAAPoAHwFJAn37AQ0AAAABCAAAAPoAwAFQAk37Ag0AAAABCAAAAPoAmwG7Aln7Aw0AAAABCAAAAPoAgAFkAqL7Cw0AAAABCAAAAPoAAAEAAv/7BA0AAAABCAAAAPoASwGsAsb7BQ0AAAABCAAAAPoA9wGWAkb7AakKAAD6AAkAAABDAG8AbQBwAG8AcwBpAHQAZQD7AEMFAAAAFQAAAPoDBwAAAEMAYQBsAGkAYgByAGkA+wERAAAA+gMFAAAAQQByAGkAYQBsAPsCEQAAAPoDBQAAAEEAcgBpAGEAbAD7A/gEAAAeAAAAACQAAAD6AAQAAABKAHAAYQBuAAEIAAAALf8z/yAAMP+0MLcwwzCvMPsAHgAAAPoABAAAAEgAYQBuAGcAAQUAAADRuUDHIADgrBW1+wAYAAAA+gAEAAAASABhAG4AcwABAgAAAItbU0/7AB4AAAD6AAQAAABIAGEAbgB0AAEFAAAArl/fjmNr0Z7UmvsAHgAAAPoABAAAAEEAcgBhAGIAAQUAAABBAHIAaQBhAGwA+wAeAAAA+gAEAAAASABlAGIAcgABBQAAAEEAcgBpAGEAbAD7ACgAAAD6AAQAAABUAGgAYQBpAAEKAAAAQwBvAHIAZABpAGEAIABOAGUAdwD7AB4AAAD6AAQAAABFAHQAaABpAAEFAAAATgB5AGEAbABhAPsAIAAAAPoABAAAAEIAZQBuAGcAAQYAAABWAHIAaQBuAGQAYQD7ACAAAAD6AAQAAABHAHUAagByAAEGAAAAUwBoAHIAdQB0AGkA+wAkAAAA+gAEAAAASwBoAG0AcgABCAAAAEQAYQB1AG4AUABlAG4AaAD7AB4AAAD6AAQAAABLAG4AZABhAAEFAAAAVAB1AG4AZwBhAPsAHgAAAPoABAAAAEcAdQByAHUAAQUAAABSAGEAYQB2AGkA+wAkAAAA+gAEAAAAQwBhAG4AcwABCAAAAEUAdQBwAGgAZQBtAGkAYQD7ADwAAAD6AAQAAABDAGgAZQByAAEUAAAAUABsAGEAbgB0AGEAZwBlAG4AZQB0ACAAQwBoAGUAcgBvAGsAZQBlAPsAOAAAAPoABAAAAFkAaQBpAGkAARIAAABNAGkAYwByAG8AcwBvAGYAdAAgAFkAaQAgAEIAYQBpAHQAaQD7ADgAAAD6AAQAAABUAGkAYgB0AAESAAAATQBpAGMAcgBvAHMAbwBmAHQAIABIAGkAbQBhAGwAYQB5AGEA+wAiAAAA+gAEAAAAVABoAGEAYQABBwAAAE0AVgAgAEIAbwBsAGkA+wAgAAAA+gAEAAAARABlAHYAYQABBgAAAE0AYQBuAGcAYQBsAPsAIgAAAPoABAAAAFQAZQBsAHUAAQcAAABHAGEAdQB0AGEAbQBpAPsAHgAAAPoABAAAAFQAYQBtAGwAAQUAAABMAGEAdABoAGEA+wA2AAAA+gAEAAAAUwB5AHIAYwABEQAAAEUAcwB0AHIAYQBuAGcAZQBsAG8AIABFAGQAZQBzAHMAYQD7ACIAAAD6AAQAAABPAHIAeQBhAAEHAAAASwBhAGwAaQBuAGcAYQD7ACIAAAD6AAQAAABNAGwAeQBtAAEHAAAASwBhAHIAdABpAGsAYQD7ACYAAAD6AAQAAABMAGEAbwBvAAEJAAAARABvAGsAQwBoAGEAbQBwAGEA+wAsAAAA+gAEAAAAUwBpAG4AaAABDAAAAEkAcwBrAG8AbwBsAGEAIABQAG8AdABhAPsAMgAAAPoABAAAAE0AbwBuAGcAAQ8AAABNAG8AbgBnAG8AbABpAGEAbgAgAEIAYQBpAHQAaQD7AB4AAAD6AAQAAABWAGkAZQB0AAEFAAAAQQByAGkAYQBsAPsANAAAAPoABAAAAFUAaQBnAGgAARAAAABNAGkAYwByAG8AcwBvAGYAdAAgAFUAaQBnAGgAdQByAPsAIgAAAPoABAAAAEcAZQBvAHIAAQcAAABTAHkAbABmAGEAZQBuAPsBQwUAAAAVAAAA+gMHAAAAQwBhAGwAaQBiAHIAaQD7AREAAAD6AwUAAABBAHIAaQBhAGwA+wIRAAAA+gMFAAAAQQByAGkAYQBsAPsD+AQAAB4AAAAAJAAAAPoABAAAAEoAcABhAG4AAQgAAAAt/zP/IAAw/7QwtzDDMK8w+wAeAAAA+gAEAAAASABhAG4AZwABBQAAANG5QMcgAOCsFbX7ABgAAAD6AAQAAABIAGEAbgBzAAECAAAAi1tTT/sAHgAAAPoABAAAAEgAYQBuAHQAAQUAAACuX9+OY2vRntSa+wAeAAAA+gAEAAAAQQByAGEAYgABBQAAAEEAcgBpAGEAbAD7AB4AAAD6AAQAAABIAGUAYgByAAEFAAAAQQByAGkAYQBsAPsAKAAAAPoABAAAAFQAaABhAGkAAQoAAABDAG8AcgBkAGkAYQAgAE4AZQB3APsAHgAAAPoABAAAAEUAdABoAGkAAQUAAABOAHkAYQBsAGEA+wAgAAAA+gAEAAAAQgBlAG4AZwABBgAAAFYAcgBpAG4AZABhAPsAIAAAAPoABAAAAEcAdQBqAHIAAQYAAABTAGgAcgB1AHQAaQD7ACQAAAD6AAQAAABLAGgAbQByAAEIAAAARABhAHUAbgBQAGUAbgBoAPsAHgAAAPoABAAAAEsAbgBkAGEAAQUAAABUAHUAbgBnAGEA+wAeAAAA+gAEAAAARwB1AHIAdQABBQAAAFIAYQBhAHYAaQD7ACQAAAD6AAQAAABDAGEAbgBzAAEIAAAARQB1AHAAaABlAG0AaQBhAPsAPAAAAPoABAAAAEMAaABlAHIAARQAAABQAGwAYQBuAHQAYQBnAGUAbgBlAHQAIABDAGgAZQByAG8AawBlAGUA+wA4AAAA+gAEAAAAWQBpAGkAaQABEgAAAE0AaQBjAHIAbwBzAG8AZgB0ACAAWQBpACAAQgBhAGkAdABpAPsAOAAAAPoABAAAAFQAaQBiAHQAARIAAABNAGkAYwByAG8AcwBvAGYAdAAgAEgAaQBtAGEAbABhAHkAYQD7ACIAAAD6AAQAAABUAGgAYQBhAAEHAAAATQBWACAAQgBvAGwAaQD7ACAAAAD6AAQAAABEAGUAdgBhAAEGAAAATQBhAG4AZwBhAGwA+wAiAAAA+gAEAAAAVABlAGwAdQABBwAAAEcAYQB1AHQAYQBtAGkA+wAeAAAA+gAEAAAAVABhAG0AbAABBQAAAEwAYQB0AGgAYQD7ADYAAAD6AAQAAABTAHkAcgBjAAERAAAARQBzAHQAcgBhAG4AZwBlAGwAbwAgAEUAZABlAHMAcwBhAPsAIgAAAPoABAAAAE8AcgB5AGEAAQcAAABLAGEAbABpAG4AZwBhAPsAIgAAAPoABAAAAE0AbAB5AG0AAQcAAABLAGEAcgB0AGkAawBhAPsAJgAAAPoABAAAAEwAYQBvAG8AAQkAAABEAG8AawBDAGgAYQBtAHAAYQD7ACwAAAD6AAQAAABTAGkAbgBoAAEMAAAASQBzAGsAbwBvAGwAYQAgAFAAbwB0AGEA+wAyAAAA+gAEAAAATQBvAG4AZwABDwAAAE0AbwBuAGcAbwBsAGkAYQBuACAAQgBhAGkAdABpAPsAHgAAAPoABAAAAFYAaQBlAHQAAQUAAABBAHIAaQBhAGwA+wA0AAAA+gAEAAAAVQBpAGcAaAABEAAAAE0AaQBjAHIAbwBzAG8AZgB0ACAAVQBpAGcAaAB1AHIA+wAiAAAA+gAEAAAARwBlAG8AcgABBwAAAFMAeQBsAGYAYQBlAG4A+wLkBgAA+gAGAAAATwBmAGYAaQBjAGUA+wCyAgAAAwAAAAATAAAAAw4AAAAACQAAAAMEAAAA+gAO+wBDAQAABD4BAAD6AQH7ACcBAAADAAAAAFwAAAD6AAAAAAD7AFAAAAADSwAAAPoADvsAQgAAAAIAAAABGAAAAPoABgAAAGEAOgB0AGkAbgB0AAFQwwAA+wEcAAAA+gAIAAAAYQA6AHMAYQB0AE0AbwBkAAHgkwQA+wBcAAAA+gC4iAAA+wBQAAAAA0sAAAD6AA77AEIAAAACAAAAARgAAAD6AAYAAABhADoAdABpAG4AdAABiJAAAPsBHAAAAPoACAAAAGEAOgBzAGEAdABNAG8AZAAB4JMEAPsAXAAAAPoAoIYBAPsAUAAAAANLAAAA+gAO+wBCAAAAAgAAAAEYAAAA+gAGAAAAYQA6AHQAaQBuAHQAAZg6AAD7ARwAAAD6AAgAAABhADoAcwBhAHQATQBvAGQAATBXBQD7AQkAAAD6AEAx9wABAfsASQEAAAREAQAA+gEB+wAtAQAAAwAAAABeAAAA+gAAAAAA+wBSAAAAA00AAAD6AA77AEQAAAACAAAAARoAAAD6AAcAAABhADoAcwBoAGEAZABlAAE4xwAA+wEcAAAA+gAIAAAAYQA6AHMAYQB0AE0AbwBkAAHQ+wEA+wBeAAAA+gCAOAEA+wBSAAAAA00AAAD6AA77AEQAAAACAAAAARoAAAD6AAcAAABhADoAcwBoAGEAZABlAAFIawEA+wEcAAAA+gAIAAAAYQA6AHMAYQB0AE0AbwBkAAHQ+wEA+wBeAAAA+gCghgEA+wBSAAAAA00AAAD6AA77AEQAAAACAAAAARoAAAD6AAcAAABhADoAcwBoAGEAZABlAAEwbwEA+wEcAAAA+gAIAAAAYQA6AHMAYQB0AE0AbwBkAAFYDwIA+wEJAAAA+gBAMfcAAQD7AQoBAAADAAAAAIMAAAD6AAABAAIBAzUlAAD7AFwAAAADVwAAAABSAAAAA00AAAD6AA77AEQAAAACAAAAARoAAAD6AAcAAABhADoAcwBoAGEAZABlAAEYcwEA+wEcAAAA+gAIAAAAYQA6AHMAYQB0AE0AbwBkAAEomgEA+wEEAAAA+gAG+wIHAAAA+gAAAAAA+wA6AAAA+gAAAQACAQM4YwAA+wATAAAAAw4AAAAACQAAAAMEAAAA+gAO+wEEAAAA+gAG+wIHAAAA+gAAAAAA+wA6AAAA+gAAAQACAQPUlAAA+wATAAAAAw4AAAAACQAAAAMEAAAA+gAO+wEEAAAA+gAG+wIHAAAA+gAAAAAA+wITAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAPuAgAAAwAAAAATAAAAAw4AAAAACQAAAAMEAAAA+gAO+wCmAQAABKEBAAD6AQH7AEgBAAADAAAAAFwAAAD6AAAAAAD7AFAAAAADSwAAAPoADvsAQgAAAAIAAAABGAAAAPoABgAAAGEAOgB0AGkAbgB0AAFAnAAA+wEcAAAA+gAIAAAAYQA6AHMAYQB0AE0AbwBkAAEwVwUA+wB7AAAA+gBAnAAA+wBvAAAAA2oAAAD6AA77AGEAAAADAAAAARgAAAD6AAYAAABhADoAdABpAG4AdAAByK8AAPsBGgAAAPoABwAAAGEAOgBzAGgAYQBkAGUAAbiCAQD7ARwAAAD6AAgAAABhADoAcwBhAHQATQBvAGQAATBXBQD7AF4AAAD6AKCGAQD7AFIAAAADTQAAAPoADvsARAAAAAIAAAABGgAAAPoABwAAAGEAOgBzAGgAYQBkAGUAASBOAAD7ARwAAAD6AAgAAABhADoAcwBhAHQATQBvAGQAARjkAwD7AksAAAD6AAD7AEIAAAD6AAUAAAA1ADAAMAAwADAAAQYAAAAtADgAMAAwADAAMAACBQAAADUAMAAwADAAMAADBgAAADEAOAAwADAAMAAwAPsAIgEAAAQdAQAA+gEB+wDIAAAAAgAAAABcAAAA+gAAAAAA+wBQAAAAA0sAAAD6AA77AEIAAAACAAAAARgAAAD6AAYAAABhADoAdABpAG4AdAABgDgBAPsBHAAAAPoACAAAAGEAOgBzAGEAdABNAG8AZAAB4JMEAPsAXgAAAPoAoIYBAPsAUgAAAANNAAAA+gAO+wBEAAAAAgAAAAEaAAAA+gAHAAAAYQA6AHMAaABhAGQAZQABMHUAAPsBHAAAAPoACAAAAGEAOgBzAGEAdABNAG8AZAABQA0DAPsCRwAAAPoAAPsAPgAAAPoABQAAADUAMAAwADAAMAABBQAAADUAMAAwADAAMAACBQAAADUAMAAwADAAMAADBQAAADUAMAAwADAAMAD7BAQAAAAAAAAA"} window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].getEmpty=getEmpty})(window);"use strict";(function(window,undefined){var c_oAscLockTypeElem=AscCommonExcel.c_oAscLockTypeElem;var c_oAscInsertOptions=Asc.c_oAscInsertOptions;var c_oAscDeleteOptions=Asc.c_oAscDeleteOptions;var gc_nMaxRow0=AscCommon.gc_nMaxRow0;var gc_nMaxCol0=AscCommon.gc_nMaxCol0;var c_oUndoRedoSerializeType={Null:0,Undefined:1,SByte:2,Byte:3,Bool:4,Long:5,ULong:6,Double:7,String:8,Object:9,Array:10};function DrawingCollaborativeData(){this.oClass= null;this.oBinaryReader=null;this.nPos=null;this.sChangedObjectId=null;this.isDrawingCollaborativeData=true}function UndoRedoItemSerializable(oClass,nActionType,nSheetId,oRange,oData,LocalChange){this.oClass=oClass;this.nActionType=nActionType;this.nSheetId=nSheetId;this.oRange=oRange;this.oData=oData;this.LocalChange=LocalChange}UndoRedoItemSerializable.prototype.Serialize=function(oBinaryWriter,collaborativeEditing){if(this.oData&&this.oData.getType||this.oClass&&(this.oClass.Save_Changes||this.oClass.WriteToBinary)){var oThis= this;var oBinaryCommonWriter=new AscCommon.BinaryCommonWriter(oBinaryWriter);oBinaryCommonWriter.WriteItemWithLength(function(){oThis.SerializeInner(oBinaryWriter,collaborativeEditing)})}};UndoRedoItemSerializable.prototype.SerializeInner=function(oBinaryWriter,collaborativeEditing){if(!this.oClass.WriteToBinary){oBinaryWriter.WriteBool(true);var nClassType=this.oClass.getClassType();oBinaryWriter.WriteByte(nClassType);oBinaryWriter.WriteByte(this.nActionType);if(null!=this.nSheetId){oBinaryWriter.WriteBool(true); oBinaryWriter.WriteString2(this.nSheetId.toString())}else oBinaryWriter.WriteBool(false);if(null!=this.oRange){oBinaryWriter.WriteBool(true);var c1=this.oRange.c1;var c2=this.oRange.c2;var r1=this.oRange.r1;var r2=this.oRange.r2;if(null!=this.nSheetId&&(0!=c1||gc_nMaxCol0!=c2)){c1=collaborativeEditing.getLockMeColumn2(this.nSheetId,c1);c2=collaborativeEditing.getLockMeColumn2(this.nSheetId,c2)}if(null!=this.nSheetId&&(0!=r1||gc_nMaxRow0!=r2)){r1=collaborativeEditing.getLockMeRow2(this.nSheetId,r1); r2=collaborativeEditing.getLockMeRow2(this.nSheetId,r2)}oBinaryWriter.WriteLong(c1);oBinaryWriter.WriteLong(r1);oBinaryWriter.WriteLong(c2);oBinaryWriter.WriteLong(r2)}else oBinaryWriter.WriteBool(false);this.SerializeDataObject(oBinaryWriter,this.oData,this.nSheetId,collaborativeEditing)}else{oBinaryWriter.WriteBool(false);var Class;Class=this.oClass.GetClass();oBinaryWriter.WriteString2(Class.Get_Id());oBinaryWriter.WriteLong(this.oClass.Type);this.oClass.WriteToBinary(oBinaryWriter)}};UndoRedoItemSerializable.prototype.SerializeDataObject= function(oBinaryWriter,oData,nSheetId,collaborativeEditing){var oThis=this;if(oData.getType){var nDataType=oData.getType();if(null!=oData.applyCollaborative)oData.applyCollaborative(nSheetId,collaborativeEditing);oBinaryWriter.WriteByte(nDataType);var oBinaryCommonWriter=new AscCommon.BinaryCommonWriter(oBinaryWriter);if(oData.Write_ToBinary2)oBinaryCommonWriter.WriteItemWithLength(function(){oData.Write_ToBinary2(oBinaryWriter)});else oBinaryCommonWriter.WriteItemWithLength(function(){oThis.SerializeDataInnerObject(oBinaryWriter, oData,nSheetId,collaborativeEditing)})}else{oBinaryWriter.WriteByte(UndoRedoDataTypes.Unknown);oBinaryWriter.WriteLong(0)}};UndoRedoItemSerializable.prototype.SerializeDataInnerObject=function(oBinaryWriter,oData,nSheetId,collaborativeEditing){var oProperties=oData.getProperties();for(var i in oProperties){var nItemType=oProperties[i];var oItem=oData.getProperty(nItemType,nSheetId);this.SerializeDataInner(oBinaryWriter,nItemType,oItem,nSheetId,collaborativeEditing)}};UndoRedoItemSerializable.prototype.SerializeDataInnerArray= function(oBinaryWriter,oData,nSheetId,collaborativeEditing){for(var i=0;i<oData.length;++i)this.SerializeDataInner(oBinaryWriter,0,oData[i],nSheetId,collaborativeEditing)};UndoRedoItemSerializable.prototype.SerializeDataInner=function(oBinaryWriter,nItemType,oItem,nSheetId,collaborativeEditing){var oThis=this;var sTypeOf;if(null===oItem)sTypeOf="null";else if(oItem instanceof Array)sTypeOf="array";else sTypeOf=typeof oItem;switch(sTypeOf){case "object":oBinaryWriter.WriteByte(nItemType);oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Object); this.SerializeDataObject(oBinaryWriter,oItem,nSheetId,collaborativeEditing);break;case "array":oBinaryWriter.WriteByte(nItemType);oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Array);var oBinaryCommonWriter=new AscCommon.BinaryCommonWriter(oBinaryWriter);oBinaryCommonWriter.WriteItemWithLength(function(){oThis.SerializeDataInnerArray(oBinaryWriter,oItem,nSheetId,collaborativeEditing)});break;case "number":oBinaryWriter.WriteByte(nItemType);var nFlorItem=Math.floor(oItem);if(nFlorItem==oItem)if(-128<= oItem&&oItem<=127){oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.SByte);oBinaryWriter.WriteSByte(oItem)}else if(127<oItem&&oItem<=255){oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Byte);oBinaryWriter.WriteByte(oItem)}else if(-2147483648<=oItem&&oItem<=2147483647){oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Long);oBinaryWriter.WriteLong(oItem)}else if(2147483647<oItem&&oItem<=4294967295){oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.ULong);oBinaryWriter.WriteLong(oItem)}else{oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Double); oBinaryWriter.WriteDouble2(oItem)}else{oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Double);oBinaryWriter.WriteDouble2(oItem)}break;case "boolean":oBinaryWriter.WriteByte(nItemType);oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Bool);oBinaryWriter.WriteBool(oItem);break;case "string":oBinaryWriter.WriteByte(nItemType);oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.String);oBinaryWriter.WriteString2(oItem);break;case "null":oBinaryWriter.WriteByte(nItemType);oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Null); break;case "undefined":oBinaryWriter.WriteByte(nItemType);oBinaryWriter.WriteByte(c_oUndoRedoSerializeType.Undefined);break;default:break}};UndoRedoItemSerializable.prototype.Deserialize=function(oBinaryReader){var res=AscCommon.c_oSerConstants.ReadOk;res=oBinaryReader.EnterFrame(4);var nLength=oBinaryReader.GetULongLE();res=oBinaryReader.EnterFrame(nLength);if(AscCommon.c_oSerConstants.ReadOk!=res)return res;var bNoDrawing=oBinaryReader.GetBool();if(bNoDrawing){var nClassType=oBinaryReader.GetUChar(); this.oClass=UndoRedoClassTypes.Create(nClassType);this.nActionType=oBinaryReader.GetUChar();var bSheetId=oBinaryReader.GetBool();if(bSheetId)this.nSheetId=oBinaryReader.GetString2LE(oBinaryReader.GetULongLE());var bRange=oBinaryReader.GetBool();if(bRange){var nC1=oBinaryReader.GetULongLE();var nR1=oBinaryReader.GetULongLE();var nC2=oBinaryReader.GetULongLE();var nR2=oBinaryReader.GetULongLE();this.oRange=new Asc.Range(nC1,nR1,nC2,nR2)}else this.oRange=null;this.oData=this.DeserializeData(oBinaryReader)}else{var changedObjectId= oBinaryReader.GetString2();this.nActionType=1;this.oData=new DrawingCollaborativeData;this.oData.sChangedObjectId=changedObjectId;this.oData.oBinaryReader=oBinaryReader;this.oData.nPos=oBinaryReader.cur}};UndoRedoItemSerializable.prototype.DeserializeData=function(oBinaryReader){var nDataClassType=oBinaryReader.GetUChar();var nLength=oBinaryReader.GetULongLE();var oDataObject=UndoRedoDataTypes.Create(nDataClassType);if(null!=oDataObject)if(null!=oDataObject.Read_FromBinary2)oDataObject.Read_FromBinary2(oBinaryReader); else if(null!=oDataObject.Read_FromBinary2AndReplace)oDataObject=oDataObject.Read_FromBinary2AndReplace(oBinaryReader);else this.DeserializeDataInner(oBinaryReader,oDataObject,nLength,false);else oBinaryReader.Skip(nLength);return oDataObject};UndoRedoItemSerializable.prototype.DeserializeDataInner=function(oBinaryReader,oDataObject,nLength,bIsArray){var nStartPos=oBinaryReader.GetCurPos();var nCurPos=nStartPos;while(nCurPos-nStartPos<nLength&&nCurPos<oBinaryReader.GetSize()-1){var nMemeberType=oBinaryReader.GetUChar(); var nDataType=oBinaryReader.GetUChar();var nUnknownType=false;var oNewValue=null;switch(nDataType){case c_oUndoRedoSerializeType.Null:oNewValue=null;break;case c_oUndoRedoSerializeType.Undefined:oNewValue=undefined;break;case c_oUndoRedoSerializeType.Bool:oNewValue=oBinaryReader.GetBool();break;case c_oUndoRedoSerializeType.SByte:oNewValue=oBinaryReader.GetChar();break;case c_oUndoRedoSerializeType.Byte:oNewValue=oBinaryReader.GetUChar();break;case c_oUndoRedoSerializeType.Long:oNewValue=oBinaryReader.GetLongLE(); break;case c_oUndoRedoSerializeType.ULong:oNewValue=AscFonts.FT_Common.IntToUInt(oBinaryReader.GetULongLE());break;case c_oUndoRedoSerializeType.Double:oNewValue=oBinaryReader.GetDoubleLE();break;case c_oUndoRedoSerializeType.String:oNewValue=oBinaryReader.GetString2LE(oBinaryReader.GetULongLE());break;case c_oUndoRedoSerializeType.Object:oNewValue=this.DeserializeData(oBinaryReader);break;case c_oUndoRedoSerializeType.Array:var aNewArray=[];var nNewLength=oBinaryReader.GetULongLE();this.DeserializeDataInner(oBinaryReader, aNewArray,nNewLength,true);oNewValue=aNewArray;break;default:nUnknownType=true;break}if(false==nUnknownType)if(bIsArray)oDataObject.push(oNewValue);else oDataObject.setProperty(nMemeberType,oNewValue);nCurPos=oBinaryReader.GetCurPos()}};var UndoRedoDataTypes=new function(){this.Unknown=-1;this.CellSimpleData=0;this.CellValue=1;this.ValueMultiTextElem=2;this.CellValueData=3;this.CellData=4;this.FromTo=5;this.FromToRowCol=6;this.FromToHyperlink=7;this.IndexSimpleProp=8;this.ColProp=9;this.RowProp=10; this.BBox=11;this.StyleFont=12;this.StyleFill=13;this.StyleNum=14;this.StyleBorder=15;this.StyleBorderProp=16;this.StyleXfs=17;this.StyleAlign=18;this.Hyperlink=19;this.SortData=20;this.CommentData=21;this.CommentCoords=22;this.ChartSeriesData=24;this.SheetAdd=25;this.SheetRemove=26;this.ClrScheme=28;this.AutoFilter=29;this.AutoFiltersOptions=30;this.AutoFilterObj=31;this.AutoFiltersOptionsElements=32;this.SingleProperty=33;this.RgbColor=34;this.ThemeColor=35;this.CustomFilters=36;this.CustomFilter= 37;this.ColorFilter=38;this.DefinedName=39;this.AdvancedTableInfoSettings=40;this.AddFormatTableOptions=63;this.SheetPr=69;this.DynamicFilter=75;this.Top10=76;this.PivotTable=80;this.PivotField=81;this.PivotRowItems=82;this.PivotColItems=83;this.PivotLocation=84;this.PivotCacheDefinition=85;this.PivotCacheRecords=86;this.BinaryWrapper=87;this.BinaryWrapper2=88;this.PivotFieldElem=89;this.PivotFilter=90;this.Layout=91;this.ArrayFormula=95;this.StylePatternFill=100;this.StyleGradientFill=101;this.StyleGradientFillStop= 102;this.SortState=115;this.SortStateData=116;this.Slicer=117;this.SlicerData=118;this.NamedSheetView=130;this.NamedSheetViewChange=131;this.DataValidation=140;this.DataValidationInner=141;this.Create=function(nType){switch(nType){case this.ValueMultiTextElem:return new AscCommonExcel.CMultiTextElem;break;case this.CellValue:return new AscCommonExcel.CCellValue;break;case this.CellValueData:return new UndoRedoData_CellValueData;break;case this.CellData:return new UndoRedoData_CellData;break;case this.CellSimpleData:return new UndoRedoData_CellSimpleData; break;case this.FromTo:return new UndoRedoData_FromTo;break;case this.FromToRowCol:return new UndoRedoData_FromToRowCol;break;case this.FromToHyperlink:return new UndoRedoData_FromToHyperlink;break;case this.IndexSimpleProp:return new UndoRedoData_IndexSimpleProp;break;case this.ColProp:return new UndoRedoData_ColProp;break;case this.RowProp:return new UndoRedoData_RowProp;break;case this.BBox:return new UndoRedoData_BBox;break;case this.Hyperlink:return new AscCommonExcel.Hyperlink;break;case this.SortData:return new UndoRedoData_SortData; break;case this.StyleFont:return new AscCommonExcel.Font;break;case this.StyleFill:return new AscCommonExcel.Fill;break;case this.StylePatternFill:return new AscCommonExcel.PatternFill;break;case this.StyleGradientFill:return new AscCommonExcel.GradientFill;break;case this.StyleGradientFillStop:return new AscCommonExcel.GradientStop;break;case this.StyleNum:return new AscCommonExcel.Num;break;case this.StyleBorder:return new AscCommonExcel.Border;break;case this.StyleBorderProp:return new AscCommonExcel.BorderProp; break;case this.StyleXfs:return new AscCommonExcel.CellXfs;break;case this.StyleAlign:return new AscCommonExcel.Align;break;case this.CommentData:return new Asc.asc_CCommentData;break;case this.CommentCoords:return new AscCommonExcel.asc_CCommentCoords;break;case this.ChartSeriesData:return new AscFormat.asc_CChartSeria;break;case this.SheetAdd:return new UndoRedoData_SheetAdd;break;case this.SheetRemove:return new UndoRedoData_SheetRemove;break;case this.ClrScheme:return new UndoRedoData_ClrScheme; break;case this.AutoFilter:return new UndoRedoData_AutoFilter;break;case this.AutoFiltersOptions:return new Asc.AutoFiltersOptions;break;case this.AutoFilterObj:return new Asc.AutoFilterObj;break;case this.AdvancedTableInfoSettings:return new Asc.AdvancedTableInfoSettings;break;case this.CustomFilters:return new Asc.CustomFilters;break;case this.CustomFilter:return new Asc.CustomFilter;break;case this.ColorFilter:return new Asc.ColorFilter;break;case this.DynamicFilter:return new Asc.DynamicFilter; break;case this.Top10:return new Asc.Top10;break;case this.AutoFiltersOptionsElements:return new AscCommonExcel.AutoFiltersOptionsElements;break;case this.AddFormatTableOptions:return new AscCommonExcel.AddFormatTableOptions;break;case this.SingleProperty:return new UndoRedoData_SingleProperty;break;case this.RgbColor:return new AscCommonExcel.RgbColor;break;case this.ThemeColor:return new AscCommonExcel.ThemeColor;break;case this.DefinedName:return new UndoRedoData_DefinedNames;case this.PivotTable:return new UndoRedoData_PivotTable; case this.PivotField:return new UndoRedoData_PivotField;case this.PivotRowItems:return new CT_rowItems;case this.PivotColItems:return new CT_colItems;case this.PivotLocation:return new CT_Location;case this.PivotCacheDefinition:return new CT_PivotCacheDefinition;case this.PivotCacheRecords:return new CT_PivotCacheRecords;case this.PivotFieldElem:return new CT_PivotField(true);case this.PivotFilter:return new CT_PivotFilter;case this.BinaryWrapper:return new UndoRedoData_BinaryWrapper;case this.BinaryWrapper2:return new UndoRedoData_BinaryWrapper2; case this.Layout:return new UndoRedoData_Layout;case this.ArrayFormula:return new UndoRedoData_ArrayFormula;case this.SortState:return new AscCommonExcel.SortState;case this.SortStateData:return new AscCommonExcel.UndoRedoData_SortState;case this.SlicerData:return new AscCommonExcel.UndoRedoData_Slicer;case this.Slicer:return new window["Asc"].CT_slicer;case this.NamedSheetView:return new window["Asc"].CT_NamedSheetView;case this.NamedSheetViewChange:if(window["AscCommonExcel"].UndoRedoData_NamedSheetView)return new window["AscCommonExcel"].UndoRedoData_NamedSheetView; break;case this.DataValidationInner:return new window["AscCommonExcel"].CDataValidation;case this.DataValidation:return new window["AscCommonExcel"].UndoRedoData_DataValidation}return null}};function UndoRedoData_CellSimpleData(nRow,nCol,oOldVal,oNewVal,sFormula){this.nRow=nRow;this.nCol=nCol;this.oOldVal=oOldVal;this.oNewVal=oNewVal;this.sFormula=sFormula}UndoRedoData_CellSimpleData.prototype.Properties={Row:0,Col:1,NewVal:2};UndoRedoData_CellSimpleData.prototype.getType=function(){return UndoRedoDataTypes.CellSimpleData}; UndoRedoData_CellSimpleData.prototype.getProperties=function(){return this.Properties};UndoRedoData_CellSimpleData.prototype.getProperty=function(nType){switch(nType){case this.Properties.Row:return this.nRow;break;case this.Properties.Col:return this.nCol;break;case this.Properties.NewVal:return this.oNewVal;break}return null};UndoRedoData_CellSimpleData.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.Row:this.nRow=value;break;case this.Properties.Col:this.nCol=value; break;case this.Properties.NewVal:this.oNewVal=value;break}};UndoRedoData_CellSimpleData.prototype.applyCollaborative=function(nSheetId,collaborativeEditing){this.nRow=collaborativeEditing.getLockMeRow2(nSheetId,this.nRow);this.nCol=collaborativeEditing.getLockMeColumn2(nSheetId,this.nCol)};function UndoRedoData_CellData(value,style){this.value=value;this.style=style}UndoRedoData_CellData.prototype.Properties={value:0,style:1};UndoRedoData_CellData.prototype.getType=function(){return UndoRedoDataTypes.CellData}; UndoRedoData_CellData.prototype.getProperties=function(){return this.Properties};UndoRedoData_CellData.prototype.getProperty=function(nType){switch(nType){case this.Properties.value:return this.value;break;case this.Properties.style:return this.style;break}return null};UndoRedoData_CellData.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.value:this.value=value;break;case this.Properties.style:this.style=value;break}};function UndoRedoData_CellValueData(sFormula,oValue, formulaRef){this.formula=sFormula;this.formulaRef=formulaRef;this.value=oValue}UndoRedoData_CellValueData.prototype.Properties={formula:0,value:1,formulaRef:2};UndoRedoData_CellValueData.prototype.isEqual=function(val){if(null==val)return false;if(this.formula!=val.formula)return false;if(this.formulaRef&&!(this.formulaRef.r1===val.r1&&this.formulaRef.c1===val.c1&&this.formulaRef.r2===val.r2&&this.formulaRef.c2===val.c2)||this.formulaRef!==val)return false;if(this.value.isEqual(val.value))return true; return false};UndoRedoData_CellValueData.prototype.getType=function(){return UndoRedoDataTypes.CellValueData};UndoRedoData_CellValueData.prototype.getProperties=function(){return this.Properties};UndoRedoData_CellValueData.prototype.getProperty=function(nType){switch(nType){case this.Properties.formula:return this.formula;break;case this.Properties.value:return this.value;break;case this.Properties.formulaRef:return this.formulaRef?new UndoRedoData_BBox(this.formulaRef):null;break}return null};UndoRedoData_CellValueData.prototype.setProperty= function(nType,value){switch(nType){case this.Properties.formula:this.formula=value;break;case this.Properties.value:this.value=value;break;case this.Properties.formulaRef:this.formulaRef=value?new Asc.Range(value.c1,value.r1,value.c2,value.r2):null;break}};function UndoRedoData_FromToRowCol(bRow,from,to){this.bRow=bRow;this.from=from;this.to=to}UndoRedoData_FromToRowCol.prototype.Properties={from:0,to:1,bRow:2};UndoRedoData_FromToRowCol.prototype.getType=function(){return UndoRedoDataTypes.FromToRowCol}; UndoRedoData_FromToRowCol.prototype.getProperties=function(){return this.Properties};UndoRedoData_FromToRowCol.prototype.getProperty=function(nType){switch(nType){case this.Properties.from:return this.from;break;case this.Properties.to:return this.to;break;case this.Properties.bRow:return this.bRow;break}return null};UndoRedoData_FromToRowCol.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break;case this.Properties.bRow:this.bRow= value;break}};UndoRedoData_FromToRowCol.prototype.applyCollaborative=function(nSheetId,collaborativeEditing){if(this.bRow){this.from=collaborativeEditing.getLockMeRow2(nSheetId,this.from);this.to=collaborativeEditing.getLockMeRow2(nSheetId,this.to)}else{this.from=collaborativeEditing.getLockMeColumn2(nSheetId,this.from);this.to=collaborativeEditing.getLockMeColumn2(nSheetId,this.to)}};function UndoRedoData_FromTo(from,to,copyRange,sheetIdTo){this.from=from;this.to=to;this.copyRange=copyRange;this.sheetIdTo= sheetIdTo}UndoRedoData_FromTo.prototype.Properties={from:0,to:1,copyRange:2,sheetIdTo:3};UndoRedoData_FromTo.prototype.getType=function(){return UndoRedoDataTypes.FromTo};UndoRedoData_FromTo.prototype.getProperties=function(){return this.Properties};UndoRedoData_FromTo.prototype.getProperty=function(nType){switch(nType){case this.Properties.from:return this.from;break;case this.Properties.to:return this.to;break;case this.Properties.copyRange:return this.copyRange;break;case this.Properties.sheetIdTo:return this.sheetIdTo; break}return null};UndoRedoData_FromTo.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break;case this.Properties.copyRange:this.copyRange=value;break;case this.Properties.sheetIdTo:this.sheetIdTo=value;break}};function UndoRedoData_FromToHyperlink(oBBoxFrom,oBBoxTo,hyperlink){this.from=new UndoRedoData_BBox(oBBoxFrom);this.to=new UndoRedoData_BBox(oBBoxTo);this.hyperlink=hyperlink}UndoRedoData_FromToHyperlink.prototype.Properties= {from:0,to:1,hyperlink:2};UndoRedoData_FromToHyperlink.prototype.getType=function(){return UndoRedoDataTypes.FromToHyperlink};UndoRedoData_FromToHyperlink.prototype.getProperties=function(){return this.Properties};UndoRedoData_FromToHyperlink.prototype.getProperty=function(nType){switch(nType){case this.Properties.from:return this.from;break;case this.Properties.to:return this.to;break;case this.Properties.hyperlink:return this.hyperlink;break}return null};UndoRedoData_FromToHyperlink.prototype.setProperty= function(nType,value){switch(nType){case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break;case this.Properties.hyperlink:this.hyperlink=value;break}};function UndoRedoData_IndexSimpleProp(index,bRow,oOldVal,oNewVal){this.index=index;this.bRow=bRow;this.oOldVal=oOldVal;this.oNewVal=oNewVal}UndoRedoData_IndexSimpleProp.prototype.Properties={index:0,oNewVal:1};UndoRedoData_IndexSimpleProp.prototype.getType=function(){return UndoRedoDataTypes.IndexSimpleProp};UndoRedoData_IndexSimpleProp.prototype.getProperties= function(){return this.Properties};UndoRedoData_IndexSimpleProp.prototype.getProperty=function(nType){switch(nType){case this.Properties.index:return this.index;break;case this.Properties.oNewVal:return this.oNewVal;break}return null};UndoRedoData_IndexSimpleProp.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.index:this.index=value;break;case this.Properties.oNewVal:this.oNewVal=value;break}};UndoRedoData_IndexSimpleProp.prototype.applyCollaborative=function(nSheetId, collaborativeEditing){if(this.bRow)this.index=collaborativeEditing.getLockMeRow2(nSheetId,this.index);else this.index=collaborativeEditing.getLockMeColumn2(nSheetId,this.index)};function UndoRedoData_ColProp(col){if(null!=col){this.width=col.width;this.hd=col.hd;this.CustomWidth=col.CustomWidth;this.BestFit=col.BestFit;this.OutlineLevel=col.outlineLevel;this.Collapsed=col.collapsed}else{this.width=null;this.hd=null;this.CustomWidth=null;this.BestFit=null;this.OutlineLevel=null;this.Collapsed=null}} UndoRedoData_ColProp.prototype.Properties={width:0,hd:1,CustomWidth:2,BestFit:3,OutlineLevel:4,Collapsed:5};UndoRedoData_ColProp.prototype.isEqual=function(val){var defaultColWidth=AscCommonExcel.oDefaultMetrics.ColWidthChars;return this.hd==val.hd&&this.CustomWidth==val.CustomWidth&&(this.BestFit==val.BestFit&&this.width==val.width||(null==this.width||defaultColWidth==this.width)&&(null==this.BestFit||true==this.BestFit)&&(null==val.width||defaultColWidth==val.width)&&(null==val.BestFit||true==val.BestFit))&& this.OutlineLevel==val.OutlineLevel&&this.Collapsed==val.Collapsed};UndoRedoData_ColProp.prototype.getType=function(){return UndoRedoDataTypes.ColProp};UndoRedoData_ColProp.prototype.getProperties=function(){return this.Properties};UndoRedoData_ColProp.prototype.getProperty=function(nType){switch(nType){case this.Properties.width:return this.width;break;case this.Properties.hd:return this.hd;break;case this.Properties.CustomWidth:return this.CustomWidth;break;case this.Properties.BestFit:return this.BestFit; break;case this.Properties.OutlineLevel:return this.OutlineLevel;break;case this.Properties.Collapsed:return this.Collapsed;break}return null};UndoRedoData_ColProp.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.width:this.width=value;break;case this.Properties.hd:this.hd=value;break;case this.Properties.CustomWidth:this.CustomWidth=value;break;case this.Properties.BestFit:this.BestFit=value;break;case this.Properties.OutlineLevel:this.OutlineLevel=value;break;case this.Properties.Collapsed:this.Collapsed= value;break}};function UndoRedoData_RowProp(row){if(null!=row){this.h=row.getHeight();this.hd=row.getHidden();this.CustomHeight=row.getCustomHeight();this.OutlineLevel=row.getOutlineLevel();this.Collapsed=row.getCollapsed()}else{this.h=null;this.hd=null;this.CustomHeight=null;this.OutlineLevel=null;this.Collapsed=null}}UndoRedoData_RowProp.prototype.Properties={h:0,hd:1,CustomHeight:2,OutlineLevel:3,Collapsed:4};UndoRedoData_RowProp.prototype.isEqual=function(val){var defaultRowHeight=AscCommonExcel.oDefaultMetrics.RowHeight; return this.hd==val.hd&&(this.CustomHeight==val.CustomHeight&&this.h==val.h||(null==this.h||defaultRowHeight==this.h)&&(null==this.CustomHeight||false==this.CustomHeight)&&(null==val.h||defaultRowHeight==val.h)&&(null==val.CustomHeight||false==val.CustomHeight))&&this.OutlineLevel==val.OutlineLevel&&this.Collapsed==val.Collapsed};UndoRedoData_RowProp.prototype.getType=function(){return UndoRedoDataTypes.RowProp};UndoRedoData_RowProp.prototype.getProperties=function(){return this.Properties};UndoRedoData_RowProp.prototype.getProperty= function(nType){switch(nType){case this.Properties.h:return this.h;break;case this.Properties.hd:return this.hd;break;case this.Properties.CustomHeight:return this.CustomHeight;break;case this.Properties.OutlineLevel:return this.OutlineLevel;break;case this.Properties.Collapsed:return this.Collapsed;break}return null};UndoRedoData_RowProp.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.h:this.h=value;break;case this.Properties.hd:this.hd=value;break;case this.Properties.CustomHeight:this.CustomHeight= value;break;case this.Properties.OutlineLevel:this.OutlineLevel=value;break;case this.Properties.Collapsed:this.Collapsed=value;break}};function UndoRedoData_BBox(oBBox){if(null!=oBBox){this.c1=oBBox.c1;this.r1=oBBox.r1;this.c2=oBBox.c2;this.r2=oBBox.r2}else{this.c1=null;this.r1=null;this.c2=null;this.r2=null}}UndoRedoData_BBox.prototype.Properties={c1:0,r1:1,c2:2,r2:3};UndoRedoData_BBox.prototype.getType=function(){return UndoRedoDataTypes.BBox};UndoRedoData_BBox.prototype.getProperties=function(){return this.Properties}; UndoRedoData_BBox.prototype.getProperty=function(nType){switch(nType){case this.Properties.c1:return this.c1;break;case this.Properties.r1:return this.r1;break;case this.Properties.c2:return this.c2;break;case this.Properties.r2:return this.r2;break}return null};UndoRedoData_BBox.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.c1:this.c1=value;break;case this.Properties.r1:this.r1=value;break;case this.Properties.c2:this.c2=value;break;case this.Properties.r2:this.r2= value;break}};UndoRedoData_BBox.prototype.applyCollaborative=function(nSheetId,collaborativeEditing){this.r1=collaborativeEditing.getLockMeRow2(nSheetId,this.r1);this.r2=collaborativeEditing.getLockMeRow2(nSheetId,this.r2);this.c1=collaborativeEditing.getLockMeColumn2(nSheetId,this.c1);this.c2=collaborativeEditing.getLockMeColumn2(nSheetId,this.c2)};function UndoRedoData_SortData(bbox,places,sortByRow){this.bbox=bbox;this.places=places;this.sortByRow=sortByRow}UndoRedoData_SortData.prototype.Properties= {bbox:0,places:1,sortByRow:2};UndoRedoData_SortData.prototype.getType=function(){return UndoRedoDataTypes.SortData};UndoRedoData_SortData.prototype.getProperties=function(){return this.Properties};UndoRedoData_SortData.prototype.getProperty=function(nType){switch(nType){case this.Properties.bbox:return this.bbox;break;case this.Properties.places:return this.places;break;case this.Properties.sortByRow:return this.sortByRow;break}return null};UndoRedoData_SortData.prototype.setProperty=function(nType, value){switch(nType){case this.Properties.bbox:this.bbox=value;break;case this.Properties.places:this.places=value;break;case this.Properties.sortByRow:this.sortByRow=value;break}};UndoRedoData_SortData.prototype.applyCollaborative=function(nSheetId,collaborativeEditing){this.bbox.r1=collaborativeEditing.getLockMeRow2(nSheetId,this.bbox.r1);this.bbox.r2=collaborativeEditing.getLockMeRow2(nSheetId,this.bbox.r2);this.bbox.c1=collaborativeEditing.getLockMeColumn2(nSheetId,this.bbox.c1);this.bbox.c2= collaborativeEditing.getLockMeColumn2(nSheetId,this.bbox.c2);for(var i=0,length=this.places.length;i<length;++i){var place=this.places[i];if(this.sortByRow){place.from=collaborativeEditing.getLockMeColumn2(nSheetId,place.from);place.to=collaborativeEditing.getLockMeColumn2(nSheetId,place.to)}else{place.from=collaborativeEditing.getLockMeRow2(nSheetId,place.from);place.to=collaborativeEditing.getLockMeRow2(nSheetId,place.to)}}};function UndoRedoData_PivotTable(pivot,from,to){this.pivot=pivot;this.from= from;this.to=to}UndoRedoData_PivotTable.prototype.Properties={pivot:0,from:1,to:2};UndoRedoData_PivotTable.prototype.getType=function(){return UndoRedoDataTypes.PivotTable};UndoRedoData_PivotTable.prototype.getProperties=function(){return this.Properties};UndoRedoData_PivotTable.prototype.getProperty=function(nType){switch(nType){case this.Properties.pivot:return this.pivot;break;case this.Properties.from:return this.from;break;case this.Properties.to:return this.to;break}return null};UndoRedoData_PivotTable.prototype.setProperty= function(nType,value){switch(nType){case this.Properties.pivot:this.pivot=value;break;case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break}};function UndoRedoData_PivotTableRedo(pivot,from,to){this.pivot=pivot;this.from=from;this.to=to}UndoRedoData_PivotTableRedo.prototype=Object.create(UndoRedoData_PivotTable.prototype);UndoRedoData_PivotTableRedo.prototype.Properties={pivot:0,to:2};function UndoRedoData_PivotField(pivot,index,from,to){this.pivot=pivot;this.index= index;this.from=from;this.to=to}UndoRedoData_PivotField.prototype.Properties={pivot:0,index:1,from:2,to:3};UndoRedoData_PivotField.prototype.getType=function(){return UndoRedoDataTypes.PivotField};UndoRedoData_PivotField.prototype.getProperties=function(){return this.Properties};UndoRedoData_PivotField.prototype.getProperty=function(nType){switch(nType){case this.Properties.pivot:return this.pivot;break;case this.Properties.index:return this.index;break;case this.Properties.from:return this.from; break;case this.Properties.to:return this.to;break}return null};UndoRedoData_PivotField.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.pivot:this.pivot=value;break;case this.Properties.index:this.index=value;break;case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break}};function UndoRedoData_BinaryWrapper(data){this.binary=null;this.len=0;this.Id=null;if(data){var memory=new AscCommon.CMemory(true);memory.CheckSize(1E3);data.Write_ToBinary2(memory); this.Id=data.Get_Id();this.len=memory.GetCurPosition();this.binary=memory.GetData()}}UndoRedoData_BinaryWrapper.prototype.getType=function(){return UndoRedoDataTypes.BinaryWrapper};UndoRedoData_BinaryWrapper.prototype.Write_ToBinary2=function(writer){writer.WriteString2(this.Id);writer.WriteLong(this.len);writer.WriteBuffer(this.binary,0,this.len)};UndoRedoData_BinaryWrapper.prototype.Read_FromBinary2=function(reader){this.Id=reader.GetString2();this.len=reader.GetLong();this.binary=reader.GetBuffer(this.len)}; UndoRedoData_BinaryWrapper.prototype.getData=function(){var reader=new AscCommon.FT_Stream2(this.binary,this.len);var data=AscCommon.g_oTableId.GetClassFromFactory(reader.GetLong());data.Id=this.Id;data.Read_FromBinary2(reader);return data};UndoRedoData_BinaryWrapper.prototype.readData=function(data){var reader=new AscCommon.FT_Stream2(this.binary,this.len);data.Read_FromBinary2(reader)};function UndoRedoData_BinaryWrapper2(data){this.binary=null;this.len=0;if(data){var memory=new AscCommon.CMemory(true); memory.CheckSize(1E3);data.Write_ToBinary2(memory);this.len=memory.GetCurPosition();this.binary=memory.GetData()}}UndoRedoData_BinaryWrapper2.prototype.getType=function(){return UndoRedoDataTypes.BinaryWrapper2};UndoRedoData_BinaryWrapper2.prototype.Write_ToBinary2=function(writer){writer.WriteLong(this.len);writer.WriteBuffer(this.binary,0,this.len)};UndoRedoData_BinaryWrapper2.prototype.Read_FromBinary2=function(reader){this.len=reader.GetLong();this.binary=reader.GetBuffer(this.len)};UndoRedoData_BinaryWrapper2.prototype.initObject= function(data){var reader=new AscCommon.FT_Stream2(this.binary,this.len);data.Read_FromBinary2(reader)};function UndoRedoData_Layout(from,to){this.from=from;this.to=to}UndoRedoData_Layout.prototype.Properties={from:0,to:1};UndoRedoData_Layout.prototype.getType=function(){return UndoRedoDataTypes.Layout};UndoRedoData_Layout.prototype.getProperties=function(){return this.Properties};UndoRedoData_Layout.prototype.getProperty=function(nType){switch(nType){case this.Properties.from:return this.from;break; case this.Properties.to:return this.to;break}return null};UndoRedoData_Layout.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break}};function UndoRedoData_SheetAdd(insertBefore,name,sheetidfrom,sheetid,tableNames,opt_sheet){this.insertBefore=insertBefore;this.name=name;this.sheetidfrom=sheetidfrom;this.sheetid=sheetid;this.opt_sheet=opt_sheet;this.sheet=null;this.tableNames=tableNames}UndoRedoData_SheetAdd.prototype.Properties= {name:0,sheetidfrom:1,sheetid:2,tableNames:3,insertBefore:4,opt_sheet:5};UndoRedoData_SheetAdd.prototype.getType=function(){return UndoRedoDataTypes.SheetAdd};UndoRedoData_SheetAdd.prototype.getProperties=function(){return this.Properties};UndoRedoData_SheetAdd.prototype.getProperty=function(nType){switch(nType){case this.Properties.name:return this.name;break;case this.Properties.sheetidfrom:return this.sheetidfrom;break;case this.Properties.sheetid:return this.sheetid;break;case this.Properties.tableNames:return this.tableNames; break;case this.Properties.insertBefore:return this.insertBefore;break;case this.Properties.opt_sheet:return this.opt_sheet;break}return null};UndoRedoData_SheetAdd.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.name:this.name=value;break;case this.Properties.sheetidfrom:this.sheetidfrom=value;break;case this.Properties.sheetid:this.sheetid=value;break;case this.Properties.tableNames:this.tableNames=value;break;case this.Properties.insertBefore:this.insertBefore=value; break;case this.Properties.opt_sheet:this.opt_sheet=value;break}};function UndoRedoData_SheetRemove(index,sheetId,sheet){this.index=index;this.sheetId=sheetId;this.sheet=sheet}UndoRedoData_SheetRemove.prototype.Properties={sheetId:0,sheet:1};UndoRedoData_SheetRemove.prototype.getType=function(){return UndoRedoDataTypes.SheetRemove};UndoRedoData_SheetRemove.prototype.getProperties=function(){return this.Properties};UndoRedoData_SheetRemove.prototype.getProperty=function(nType){switch(nType){case this.Properties.sheetId:return this.sheetId; break;case this.Properties.sheet:return this.sheet;break}return null};UndoRedoData_SheetRemove.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.sheetId:this.sheetId=value;break;case this.Properties.sheet:this.sheet=value;break}};function UndoRedoData_DefinedNames(name,ref,sheetId,type,isXLNM){this.name=name;this.ref=ref;this.sheetId=sheetId;this.type=type;this.isXLNM=isXLNM}UndoRedoData_DefinedNames.prototype.Properties={name:0,ref:1,sheetId:2,type:4,isXLNM:5};UndoRedoData_DefinedNames.prototype.getType= function(){return UndoRedoDataTypes.DefinedName};UndoRedoData_DefinedNames.prototype.getProperties=function(){return this.Properties};UndoRedoData_DefinedNames.prototype.getProperty=function(nType){switch(nType){case this.Properties.name:return this.name;break;case this.Properties.ref:return this.ref;break;case this.Properties.sheetId:return this.sheetId;break;case this.Properties.type:return this.type;break;case this.Properties.isXLNM:return this.isXLNM;break}return null};UndoRedoData_DefinedNames.prototype.setProperty= function(nType,value){switch(nType){case this.Properties.name:this.name=value;break;case this.Properties.ref:this.ref=value;break;case this.Properties.sheetId:this.sheetId=value;break;case this.Properties.type:this.type=value;break;case this.Properties.isXLNM:this.isXLNM=value;break}};function UndoRedoData_ClrScheme(oldVal,newVal){this.oldVal=oldVal;this.newVal=newVal}UndoRedoData_ClrScheme.prototype.getType=function(){return UndoRedoDataTypes.ClrScheme};UndoRedoData_ClrScheme.prototype.Write_ToBinary2= function(writer){};UndoRedoData_ClrScheme.prototype.Read_FromBinary2=function(reader){};function UndoRedoData_AutoFilter(){this.undo=null;this.activeCells=null;this.styleName=null;this.type=null;this.cellId=null;this.autoFiltersObject=null;this.addFormatTableOptionsObj=null;this.moveFrom=null;this.moveTo=null;this.bWithoutFilter=null;this.displayName=null;this.val=null;this.ShowColumnStripes=null;this.ShowFirstColumn=null;this.ShowLastColumn=null;this.ShowRowStripes=null;this.HeaderRowCount=null; this.TotalsRowCount=null;this.color=null;this.tablePart=null;this.nCol=null;this.nRow=null;this.formula=null;this.totalFunction=null;this.viewId=null}UndoRedoData_AutoFilter.prototype.Properties={activeCells:0,styleName:1,type:2,cellId:3,autoFiltersObject:4,addFormatTableOptionsObj:5,moveFrom:6,moveTo:7,bWithoutFilter:8,displayName:9,val:10,ShowColumnStripes:11,ShowFirstColumn:12,ShowLastColumn:13,ShowRowStripes:14,HeaderRowCount:15,TotalsRowCount:16,color:17,tablePart:18,nCol:19,nRow:20,formula:21, totalFunction:22,viewId:23};UndoRedoData_AutoFilter.prototype.getType=function(){return UndoRedoDataTypes.AutoFilter};UndoRedoData_AutoFilter.prototype.getProperties=function(){return this.Properties};UndoRedoData_AutoFilter.prototype.getProperty=function(nType,nSheetId){switch(nType){case this.Properties.activeCells:return new UndoRedoData_BBox(this.activeCells);break;case this.Properties.styleName:return this.styleName;break;case this.Properties.type:return this.type;break;case this.Properties.cellId:return this.cellId; break;case this.Properties.autoFiltersObject:return this.autoFiltersObject;break;case this.Properties.addFormatTableOptionsObj:return this.addFormatTableOptionsObj;break;case this.Properties.moveFrom:return new UndoRedoData_BBox(this.moveFrom);break;case this.Properties.moveTo:return new UndoRedoData_BBox(this.moveTo);break;case this.Properties.bWithoutFilter:return this.bWithoutFilter;break;case this.Properties.displayName:return this.displayName;break;case this.Properties.val:return this.val;break; case this.Properties.ShowColumnStripes:return this.ShowColumnStripes;break;case this.Properties.ShowFirstColumn:return this.ShowFirstColumn;break;case this.Properties.ShowLastColumn:return this.ShowLastColumn;break;case this.Properties.ShowRowStripes:return this.ShowRowStripes;break;case this.Properties.HeaderRowCount:return this.HeaderRowCount;break;case this.Properties.TotalsRowCount:return this.TotalsRowCount;break;case this.Properties.color:return this.color;break;case this.Properties.tablePart:{var tablePart= this.tablePart;if(tablePart){var memory=new AscCommon.CMemory;var aDxfs=[];var oBinaryTableWriter=new AscCommonExcel.BinaryTableWriter(memory,aDxfs,false,{});var ws=window["Asc"]["editor"].wb?window["Asc"]["editor"].wb.getWorksheetById(nSheetId):null;oBinaryTableWriter.WriteTable(tablePart,ws?ws.model:null);tablePart=memory.GetBase64Memory()}return tablePart;break}case this.Properties.nCol:return this.nCol;break;case this.Properties.nRow:return this.nRow;break;case this.Properties.formula:return this.formula; break;case this.Properties.totalFunction:return this.totalFunction;break;case this.Properties.viewId:return this.viewId;break}return null};UndoRedoData_AutoFilter.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.activeCells:this.activeCells=new Asc.Range(value.c1,value.r1,value.c2,value.r2);break;case this.Properties.styleName:this.styleName=value;break;case this.Properties.type:this.type=value;break;case this.Properties.cellId:this.cellId=value;break;case this.Properties.autoFiltersObject:this.autoFiltersObject= value;break;case this.Properties.addFormatTableOptionsObj:return this.addFormatTableOptionsObj=value;break;case this.Properties.moveFrom:this.moveFrom=value;break;case this.Properties.moveTo:this.moveTo=value;break;case this.Properties.bWithoutFilter:this.bWithoutFilter=value;break;case this.Properties.displayName:this.displayName=value;break;case this.Properties.val:this.val=value;break;case this.Properties.ShowColumnStripes:this.ShowColumnStripes=value;break;case this.Properties.ShowFirstColumn:this.ShowFirstColumn= value;break;case this.Properties.ShowLastColumn:this.ShowLastColumn=value;break;case this.Properties.ShowRowStripes:this.ShowRowStripes=value;break;case this.Properties.HeaderRowCount:this.HeaderRowCount=value;break;case this.Properties.TotalsRowCount:this.TotalsRowCount=value;break;case this.Properties.color:this.color=value;break;case this.Properties.tablePart:{var table;if(value){var dstLen=0;dstLen+=value.length;var pointer=g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data, dstLen);stream.obj=pointer.obj;var nCurOffset=0;var oBinaryFileReader=new AscCommonExcel.BinaryFileReader;nCurOffset=oBinaryFileReader.getbase64DecodedData2(value,0,stream,nCurOffset);var dxfs=[];var oBinaryTableReader=new AscCommonExcel.Binary_TableReader(stream,null,null,dxfs);oBinaryTableReader.stream=stream;oBinaryTableReader.oReadResult={tableCustomFunc:[]};var table=new AscCommonExcel.TablePart;var res=oBinaryTableReader.bcr.Read1(dstLen,function(t,l){return oBinaryTableReader.ReadTable(t,l, table)})}if(table)this.tablePart=table;break}case this.Properties.nCol:this.nCol=value;break;case this.Properties.nRow:this.nRow=value;break;case this.Properties.formula:this.formula=value;break;case this.Properties.totalFunction:this.totalFunction=value;break;case this.Properties.viewId:this.viewId=value;break}return null};UndoRedoData_AutoFilter.prototype.applyCollaborative=function(nSheetId,collaborativeEditing){this.activeCells.c1=collaborativeEditing.getLockMeColumn2(nSheetId,this.activeCells.c1); this.activeCells.c2=collaborativeEditing.getLockMeColumn2(nSheetId,this.activeCells.c2);this.activeCells.r1=collaborativeEditing.getLockMeRow2(nSheetId,this.activeCells.r1);this.activeCells.r2=collaborativeEditing.getLockMeRow2(nSheetId,this.activeCells.r2);if(this.autoFiltersObject&&this.autoFiltersObject.cellId!==undefined){var curCellId=this.autoFiltersObject.cellId.split("af")[0];var range;AscCommonExcel.executeInR1C1Mode(false,function(){range=AscCommonExcel.g_oRangeCache.getAscRange(curCellId).clone()}); var nRow=collaborativeEditing.getLockMeRow2(nSheetId,range.r1);var nCol=collaborativeEditing.getLockMeColumn2(nSheetId,range.c1);this.autoFiltersObject.cellId=(new AscCommon.CellBase(nRow,nCol)).getName()}};function UndoRedoData_ArrayFormula(range,formula){this.range=range;this.formula=formula}UndoRedoData_ArrayFormula.prototype.Properties={range:0,formula:1};UndoRedoData_ArrayFormula.prototype.getType=function(){return UndoRedoDataTypes.ArrayFormula};UndoRedoData_ArrayFormula.prototype.getProperties= function(){return this.Properties};UndoRedoData_ArrayFormula.prototype.getProperty=function(nType){switch(nType){case this.Properties.range:return new UndoRedoData_BBox(this.range);break;case this.Properties.formula:return this.formula;break}return null};UndoRedoData_ArrayFormula.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.range:this.range=new Asc.Range(value.c1,value.r1,value.c2,value.r2);break;case this.Properties.formula:this.formula=value;break}return null}; function UndoRedoData_SingleProperty(elem){this.elem=elem}UndoRedoData_SingleProperty.prototype.Properties={elem:0};UndoRedoData_SingleProperty.prototype.getType=function(){return UndoRedoDataTypes.SingleProperty};UndoRedoData_SingleProperty.prototype.getProperties=function(){return this.Properties};UndoRedoData_SingleProperty.prototype.getProperty=function(nType){switch(nType){case this.Properties.elem:return this.elem;break}return null};UndoRedoData_SingleProperty.prototype.setProperty=function(nType, value){switch(nType){case this.Properties.elem:this.elem=value;break}};function UndoRedoData_SortState(from,to,bFilter,tableName){this.from=from;this.to=to;this.bFilter=bFilter;this.tableName=tableName}UndoRedoData_SortState.prototype.Properties={from:0,to:1,bFilter:2,tableName:3};UndoRedoData_SortState.prototype.getType=function(){return UndoRedoDataTypes.SortStateData};UndoRedoData_SortState.prototype.getProperties=function(){return this.Properties};UndoRedoData_SortState.prototype.getProperty= function(nType){switch(nType){case this.Properties.from:return this.from;break;case this.Properties.to:return this.to;break;case this.Properties.bFilter:return this.bFilter;break;case this.Properties.tableName:return this.tableName;break}return null};UndoRedoData_SortState.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break;case this.Properties.bFilter:this.bFilter=value;break;case this.Properties.tableName:this.tableName= value;break}};function UndoRedoData_Slicer(name,from,to){this.name=name;this.from=from;this.to=to}UndoRedoData_Slicer.prototype.Properties={name:0,from:1,to:2};UndoRedoData_Slicer.prototype.getType=function(){return UndoRedoDataTypes.SlicerData};UndoRedoData_Slicer.prototype.getProperties=function(){return this.Properties};UndoRedoData_Slicer.prototype.getProperty=function(nType){switch(nType){case this.Properties.name:return this.name;break;case this.Properties.from:return this.from;break;case this.Properties.to:return this.to; break}return null};UndoRedoData_Slicer.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.name:this.name=value;break;case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break}};function UndoRedoData_DataValidation(id,from,to){this.id=id;this.from=from;this.to=to}UndoRedoData_DataValidation.prototype.Properties={id:0,to:2};UndoRedoData_DataValidation.prototype.getType=function(){return UndoRedoDataTypes.DataValidation};UndoRedoData_DataValidation.prototype.getProperties= function(){return this.Properties};UndoRedoData_DataValidation.prototype.getProperty=function(nType){switch(nType){case this.Properties.id:return this.id;break;case this.Properties.from:return this.from;break;case this.Properties.to:return this.to;break}return null};UndoRedoData_DataValidation.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.from:this.from=value;break;case this.Properties.to:this.to=value;break;case this.Properties.id:this.id=value;break}};UndoRedoData_DataValidation.prototype.applyCollaborative= function(nSheetId,collaborativeEditing){if(this.to)for(var i=0;i<this.to.ranges.length;i++){var range=this.to.ranges[i];range.r1=collaborativeEditing.getLockMeRow2(nSheetId,range.r1);range.r2=collaborativeEditing.getLockMeRow2(nSheetId,range.r2);range.c1=collaborativeEditing.getLockMeColumn2(nSheetId,range.c1);range.c2=collaborativeEditing.getLockMeColumn2(nSheetId,range.c2)}};var UndoRedoClassTypes=new function(){this.aTypes=[];this.Add=function(fCreate){var nRes=this.aTypes.length;this.aTypes.push(fCreate); return nRes};this.Create=function(nType){if(nType<this.aTypes.length)return this.aTypes[nType]();return null}};function UndoRedoWorkbook(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoWorkbook})}UndoRedoWorkbook.prototype.getClassType=function(){return this.nType};UndoRedoWorkbook.prototype.Undo=function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,true,opt_wb)};UndoRedoWorkbook.prototype.Redo=function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type, Data,nSheetId,false,opt_wb)};UndoRedoWorkbook.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo,opt_wb){var wb=opt_wb?opt_wb:this.wb;var bNeedTrigger=true;if(AscCH.historyitem_Workbook_SheetAdd==Type){if(null==Data.insertBefore)Data.insertBefore=0;if(bUndo){var outputParams={sheet:null};wb.removeWorksheet(Data.insertBefore,outputParams);Data.sheet=outputParams.sheet}else if(Data.opt_sheet){var tempWorkbook=new AscCommonExcel.Workbook;tempWorkbook.DrawingDocument=Asc.editor.wbModel.DrawingDocument; tempWorkbook.setCommonIndexObjectsFrom(wb);AscCommonExcel.g_clipboardExcel.pasteProcessor._readExcelBinary(Data.opt_sheet.split("xslData;")[1],tempWorkbook,true);wb.copyWorksheet(0,Data.insertBefore,Data.name,Data.sheetid,true,Data.tableNames,tempWorkbook.aWorksheets[0])}else if(null!=Data.sheet)wb.insertWorksheet(Data.insertBefore,Data.sheet);else if(null==Data.sheetidfrom)wb.createWorksheet(Data.insertBefore,Data.name,Data.sheetid);else{var oCurWorksheet=wb.getWorksheetById(Data.sheetidfrom);var nIndex= oCurWorksheet.getIndex();wb.copyWorksheet(nIndex,Data.insertBefore,Data.name,Data.sheetid,true,Data.tableNames)}wb.handlers.trigger("updateWorksheetByModel")}else if(AscCH.historyitem_Workbook_SheetRemove==Type){if(bUndo)wb.insertWorksheet(Data.index,Data.sheet);else{var nIndex=Data.index;if(null==nIndex){var oCurWorksheet=wb.getWorksheetById(Data.sheetId);if(oCurWorksheet)nIndex=oCurWorksheet.getIndex()}if(null!=nIndex)wb.removeWorksheet(nIndex)}wb.handlers.trigger("updateWorksheetByModel")}else if(AscCH.historyitem_Workbook_SheetMove== Type){if(bUndo)wb.replaceWorksheet(Data.to,Data.from);else wb.replaceWorksheet(Data.from,Data.to);wb.handlers.trigger("updateWorksheetByModel")}else if(AscCH.historyitem_Workbook_DefinedNamesChange===Type||AscCH.historyitem_Workbook_DefinedNamesChangeUndo===Type){var oldName,newName;if(bUndo){oldName=Data.to;newName=Data.from}else{if(wb.bCollaborativeChanges)wb.handlers.trigger("asc_onLockDefNameManager",Asc.c_oAscDefinedNameReason.OK);oldName=Data.from;newName=Data.to}if(bUndo||AscCH.historyitem_Workbook_DefinedNamesChangeUndo!== Type)if(null==newName){wb.delDefinesNamesUndoRedo(oldName);wb.handlers.trigger("asc_onDelDefName")}else{wb.editDefinesNamesUndoRedo(oldName,newName);wb.handlers.trigger("asc_onEditDefName",oldName,newName)}}else if(AscCH.historyitem_Workbook_Calculate===Type){if(!bUndo)wb.calculate(Data.elem,nSheetId)}else if(bUndo&&AscCH.historyitem_Workbook_PivotWorksheetSource===Type){var wrapper=bUndo?Data.from:Data.to;var worksheetSource=AscCommon.g_oTableId.Get_ById(wrapper.Id);if(worksheetSource){wrapper.readData(worksheetSource); worksheetSource.fromWorksheetSource(worksheetSource,true)}}};UndoRedoWorkbook.prototype.forwardTransformationIsAffect=function(Type){return AscCH.historyitem_Workbook_SheetAdd===Type||AscCH.historyitem_Workbook_SheetRemove===Type||AscCH.historyitem_Workbook_SheetMove===Type||AscCH.historyitem_Workbook_DefinedNamesChange===Type};UndoRedoWorkbook.prototype.forwardTransformationGet=function(Type,Data,nSheetId){if(AscCH.historyitem_Workbook_DefinedNamesChange===Type)if(Data.newName&&Data.newName.Ref)return{formula:Data.newName.Ref}; else{if(Data.to&&Data.to.ref)return{formula:Data.to.ref}}else if(AscCH.historyitem_Workbook_SheetAdd===Type)return{name:Data.name};return null};UndoRedoWorkbook.prototype.forwardTransformationSet=function(Type,Data,nSheetId,getRes){if(AscCH.historyitem_Workbook_SheetAdd===Type)Data.name=getRes.name;else if(AscCH.historyitem_Cell_ChangeValue===Type){if(Data&&Data.newName)Data.newName.Ref=getRes.formula}else if(AscCH.historyitem_Workbook_DefinedNamesChange===Type)if(Data.to&&Data.to.ref)Data.to.ref= getRes.formula;return null};function UndoRedoCell(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoCell})}UndoRedoCell.prototype.getClassType=function(){return this.nType};UndoRedoCell.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoCell.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoCell.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo){var ws=this.wb.getWorksheetById(nSheetId); if(null==ws)return;var nRow=Data.nRow;var nCol=Data.nCol;if(this.wb.bCollaborativeChanges){var collaborativeEditing=this.wb.oApi.collaborativeEditing;nRow=collaborativeEditing.getLockOtherRow2(nSheetId,nRow);nCol=collaborativeEditing.getLockOtherColumn2(nSheetId,nCol);var oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=new Asc.Range(nCol,nRow,nCol,nRow);this.wb.aCollaborativeChangeElements.push(oLockInfo)}ws._getCell(nRow, nCol,function(cell){var Val=bUndo?Data.oOldVal:Data.oNewVal;if(AscCH.historyitem_Cell_Fontname==Type)cell.setFontname(Val);else if(AscCH.historyitem_Cell_Fontsize==Type)cell.setFontsize(Val);else if(AscCH.historyitem_Cell_Fontcolor==Type)cell.setFontcolor(Val);else if(AscCH.historyitem_Cell_Bold==Type)cell.setBold(Val);else if(AscCH.historyitem_Cell_Italic==Type)cell.setItalic(Val);else if(AscCH.historyitem_Cell_Underline==Type)cell.setUnderline(Val);else if(AscCH.historyitem_Cell_Strikeout==Type)cell.setStrikeout(Val); else if(AscCH.historyitem_Cell_FontAlign==Type)cell.setFontAlign(Val);else if(AscCH.historyitem_Cell_AlignVertical==Type)cell.setAlignVertical(Val);else if(AscCH.historyitem_Cell_AlignHorizontal==Type)cell.setAlignHorizontal(Val);else if(AscCH.historyitem_Cell_Fill==Type)cell.setFill(Val);else if(AscCH.historyitem_Cell_Border==Type)if(null!=Val)cell.setBorder(Val.clone());else cell.setBorder(null);else if(AscCH.historyitem_Cell_ShrinkToFit==Type)cell.setShrinkToFit(Val);else if(AscCH.historyitem_Cell_Wrap== Type)cell.setWrap(Val);else if(AscCH.historyitem_Cell_Num==Type)cell.setNum(Val);else if(AscCH.historyitem_Cell_Angle==Type)cell.setAngle(Val);else if(AscCH.historyitem_Cell_ChangeArrayValueFormat==Type){var multiText=[];for(var i=0,length=Val.length;i<length;++i)multiText.push(Val[i].clone());cell.setValueMultiTextInternal(multiText)}else if(AscCH.historyitem_Cell_ChangeValue===Type||AscCH.historyitem_Cell_ChangeValueUndo===Type){if(bUndo||AscCH.historyitem_Cell_ChangeValueUndo!==Type)cell.setValueData(Val)}else if(AscCH.historyitem_Cell_SetStyle== Type)if(null!=Val)cell.setStyle(Val);else cell.setStyle(null);else if(AscCH.historyitem_Cell_SetFont==Type)cell.setFont(Val);else if(AscCH.historyitem_Cell_SetQuotePrefix==Type)cell.setQuotePrefix(Val);else if(AscCH.historyitem_Cell_SetPivotButton==Type)cell.setPivotButton(Val);else if(AscCH.historyitem_Cell_Style==Type)cell.setCellStyle(Val);else if(AscCH.historyitem_Cell_RemoveSharedFormula==Type)if(null!==Val&&bUndo){var parsed=ws.workbook.workbookFormulas.get(Val);if(parsed)cell.setFormulaParsed(parsed)}})}; UndoRedoCell.prototype.forwardTransformationGet=function(Type,Data,nSheetId){if(AscCH.historyitem_Cell_ChangeValue===Type&&Data.oNewVal&&Data.oNewVal.formula)return{formula:Data.oNewVal.formula};return null};UndoRedoCell.prototype.forwardTransformationSet=function(Type,Data,nSheetId,getRes){if(AscCH.historyitem_Cell_ChangeValue===Type)if(Data&&Data.oNewVal)Data.oNewVal.formula=getRes.formula;return null};function UndoRedoWoorksheet(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoWorksheet})} UndoRedoWoorksheet.prototype.getClassType=function(){return this.nType};UndoRedoWoorksheet.prototype.Undo=function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,true,opt_wb)};UndoRedoWoorksheet.prototype.Redo=function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,false,opt_wb)};UndoRedoWoorksheet.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo,opt_wb){var wb=opt_wb?opt_wb:this.wb;var worksheetView,nRow,nCol,oLockInfo,index,from,to,range,r1,c1,r2,c2,temp,i,length,data; var bInsert,operType;var ws=wb.getWorksheetById(nSheetId);if(null==ws)return;var collaborativeEditing=wb.oApi.collaborativeEditing;var workSheetView;if(AscCH.historyitem_Worksheet_RemoveCell==Type){nRow=Data.nRow;nCol=Data.nCol;if(wb.bCollaborativeChanges){nRow=collaborativeEditing.getLockOtherRow2(nSheetId,nRow);nCol=collaborativeEditing.getLockOtherColumn2(nSheetId,nCol);oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]= new Asc.Range(nCol,nRow,nCol,nRow);wb.aCollaborativeChangeElements.push(oLockInfo)}if(bUndo){var oValue=Data.oOldVal.value;var oStyle=Data.oOldVal.style;ws._getCell(nRow,nCol,function(cell){cell.setValueData(oValue);if(null!=oStyle)cell.setStyle(oStyle);else cell.setStyle(null)})}else ws._removeCell(nRow,nCol)}else if(AscCH.historyitem_Worksheet_ColProp==Type){index=Data.index;if(wb.bCollaborativeChanges){if(AscCommonExcel.g_nAllColIndex==index)range=new Asc.Range(0,0,gc_nMaxCol0,gc_nMaxRow0);else{index= collaborativeEditing.getLockOtherColumn2(nSheetId,index);range=new Asc.Range(index,0,index,gc_nMaxRow0)}oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=range;wb.aCollaborativeChangeElements.push(oLockInfo)}var col=ws._getCol(index);col.setWidthProp(bUndo?Data.oOldVal:Data.oNewVal);ws.initColumn(col)}else if(AscCH.historyitem_Worksheet_RowProp==Type){index=Data.index;if(wb.bCollaborativeChanges){index= collaborativeEditing.getLockOtherRow2(nSheetId,index);oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=new Asc.Range(0,index,gc_nMaxCol0,index);wb.aCollaborativeChangeElements.push(oLockInfo)}ws._getRow(index,function(row){if(bUndo)row.setHeightProp(Data.oOldVal);else row.setHeightProp(Data.oNewVal)});workSheetView=wb.oApi.wb.getWorksheetById(nSheetId);workSheetView.model.autoFilters.reDrawFilter(null, index)}else if(AscCH.historyitem_Worksheet_RowHide==Type){from=Data.from;to=Data.to;nRow=Data.bRow;if(wb.bCollaborativeChanges){from=collaborativeEditing.getLockOtherRow2(nSheetId,from);to=collaborativeEditing.getLockOtherRow2(nSheetId,to);oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=new Asc.Range(0,from,gc_nMaxCol0,to);wb.aCollaborativeChangeElements.push(oLockInfo)}if(bUndo)nRow=!nRow;ws.setRowHidden(nRow, from,to);workSheetView=wb.oApi.wb.getWorksheetById(nSheetId);workSheetView.model.autoFilters.reDrawFilter(new Asc.Range(0,from,ws.nColsCount-1,to))}else if(AscCH.historyitem_Worksheet_AddRows==Type||AscCH.historyitem_Worksheet_RemoveRows==Type){from=Data.from;to=Data.to;if(wb.bCollaborativeChanges){from=collaborativeEditing.getLockOtherRow2(nSheetId,from);to=collaborativeEditing.getLockOtherRow2(nSheetId,to);if(false==(true==bUndo&&AscCH.historyitem_Worksheet_AddRows==Type||false==bUndo&&AscCH.historyitem_Worksheet_RemoveRows== Type)){oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=new Asc.Range(0,from,gc_nMaxCol0,to);wb.aCollaborativeChangeElements.push(oLockInfo)}}range=new Asc.Range(0,from,gc_nMaxCol0,to);if(true==bUndo&&AscCH.historyitem_Worksheet_AddRows==Type||false==bUndo&&AscCH.historyitem_Worksheet_RemoveRows==Type){ws.removeRows(from,to);bInsert=false;operType=c_oAscDeleteOptions.DeleteRows}else{ws.insertRowsBefore(from, to-from+1);bInsert=true;operType=c_oAscInsertOptions.InsertRows}if(!wb.bCollaborativeChanges)ws.workbook.handlers.trigger("undoRedoAddRemoveRowCols",nSheetId,Type,range,bUndo);worksheetView=wb.oApi.wb.getWorksheetById(nSheetId);worksheetView.cellCommentator.updateCommentsDependencies(bInsert,operType,range)}else if(AscCH.historyitem_Worksheet_AddCols==Type||AscCH.historyitem_Worksheet_RemoveCols==Type){from=Data.from;to=Data.to;if(wb.bCollaborativeChanges){from=collaborativeEditing.getLockOtherColumn2(nSheetId, from);to=collaborativeEditing.getLockOtherColumn2(nSheetId,to);if(false==(true==bUndo&&AscCH.historyitem_Worksheet_AddCols==Type||false==bUndo&&AscCH.historyitem_Worksheet_RemoveCols==Type)){oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=new Asc.Range(from,0,to,gc_nMaxRow0);wb.aCollaborativeChangeElements.push(oLockInfo)}}range=new Asc.Range(from,0,to,gc_nMaxRow0);if(true==bUndo&&AscCH.historyitem_Worksheet_AddCols== Type||false==bUndo&&AscCH.historyitem_Worksheet_RemoveCols==Type){ws.removeCols(from,to);bInsert=false;operType=c_oAscDeleteOptions.DeleteColumns}else{ws.insertColsBefore(from,to-from+1);bInsert=true;operType=c_oAscInsertOptions.InsertColumns}if(!wb.bCollaborativeChanges)ws.workbook.handlers.trigger("undoRedoAddRemoveRowCols",nSheetId,Type,range,bUndo);worksheetView=wb.oApi.wb.getWorksheetById(nSheetId);worksheetView.cellCommentator.updateCommentsDependencies(bInsert,operType,range)}else if(AscCH.historyitem_Worksheet_ShiftCellsLeft== Type||AscCH.historyitem_Worksheet_ShiftCellsRight==Type){r1=Data.r1;c1=Data.c1;r2=Data.r2;c2=Data.c2;if(wb.bCollaborativeChanges){r1=collaborativeEditing.getLockOtherRow2(nSheetId,r1);c1=collaborativeEditing.getLockOtherColumn2(nSheetId,c1);r2=collaborativeEditing.getLockOtherRow2(nSheetId,r2);c2=collaborativeEditing.getLockOtherColumn2(nSheetId,c2);if(false==(true==bUndo&&AscCH.historyitem_Worksheet_ShiftCellsLeft==Type||false==bUndo&&AscCH.historyitem_Worksheet_ShiftCellsRight==Type)){oLockInfo= new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=new Asc.Range(c1,r1,c2,r2);wb.aCollaborativeChangeElements.push(oLockInfo)}}range=ws.getRange3(r1,c1,r2,c2);if(true==bUndo&&AscCH.historyitem_Worksheet_ShiftCellsLeft==Type||false==bUndo&&AscCH.historyitem_Worksheet_ShiftCellsRight==Type){range.addCellsShiftRight();bInsert=true;operType=c_oAscInsertOptions.InsertCellsAndShiftRight}else{range.deleteCellsShiftLeft(); bInsert=false;operType=c_oAscDeleteOptions.DeleteCellsAndShiftLeft}worksheetView=wb.oApi.wb.getWorksheetById(nSheetId);worksheetView.cellCommentator.updateCommentsDependencies(bInsert,operType,range.bbox)}else if(AscCH.historyitem_Worksheet_ShiftCellsTop==Type||AscCH.historyitem_Worksheet_ShiftCellsBottom==Type){r1=Data.r1;c1=Data.c1;r2=Data.r2;c2=Data.c2;if(wb.bCollaborativeChanges){r1=collaborativeEditing.getLockOtherRow2(nSheetId,r1);c1=collaborativeEditing.getLockOtherColumn2(nSheetId,c1);r2= collaborativeEditing.getLockOtherRow2(nSheetId,r2);c2=collaborativeEditing.getLockOtherColumn2(nSheetId,c2);if(false==(true==bUndo&&AscCH.historyitem_Worksheet_ShiftCellsTop==Type||false==bUndo&&AscCH.historyitem_Worksheet_ShiftCellsBottom==Type)){oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=new Asc.Range(c1,r1,c2,r2);wb.aCollaborativeChangeElements.push(oLockInfo)}}range=ws.getRange3(r1,c1,r2,c2); if(true==bUndo&&AscCH.historyitem_Worksheet_ShiftCellsTop==Type||false==bUndo&&AscCH.historyitem_Worksheet_ShiftCellsBottom==Type){range.addCellsShiftBottom();bInsert=true;operType=c_oAscInsertOptions.InsertCellsAndShiftDown}else{range.deleteCellsShiftUp();bInsert=false;operType=c_oAscDeleteOptions.DeleteCellsAndShiftTop}worksheetView=wb.oApi.wb.getWorksheetById(nSheetId);worksheetView.cellCommentator.updateCommentsDependencies(bInsert,operType,range.bbox)}else if(AscCH.historyitem_Worksheet_Sort== Type){var bbox=Data.bbox;var places=Data.places;var sortByRow=Data.sortByRow;if(wb.bCollaborativeChanges){bbox.r1=collaborativeEditing.getLockOtherRow2(nSheetId,bbox.r1);bbox.c1=collaborativeEditing.getLockOtherColumn2(nSheetId,bbox.c1);bbox.r2=collaborativeEditing.getLockOtherRow2(nSheetId,bbox.r2);bbox.c2=collaborativeEditing.getLockOtherColumn2(nSheetId,bbox.c2);for(i=0,length=Data.places.length;i<length;++i){var place=Data.places[i];place.from=sortByRow?collaborativeEditing.getLockOtherColumn2(nSheetId, place.from):collaborativeEditing.getLockOtherRow2(nSheetId,place.from);place.to=sortByRow?collaborativeEditing.getLockOtherColumn2(nSheetId,place.to):collaborativeEditing.getLockOtherRow2(nSheetId,place.to);oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]=new Asc.Range(bbox.c1,place.from,bbox.c2,place.from);wb.aCollaborativeChangeElements.push(oLockInfo)}}range=ws.getRange3(bbox.r1,bbox.c1,bbox.r2,bbox.c2); range._sortByArray(bbox,places,null,sortByRow);worksheetView=wb.oApi.wb.getWorksheetById(nSheetId);worksheetView.model.autoFilters.resetTableStyles(bbox)}else if(AscCH.historyitem_Worksheet_MoveRange==Type){from=new Asc.Range(Data.from.c1,Data.from.r1,Data.from.c2,Data.from.r2);to=new Asc.Range(Data.to.c1,Data.to.r1,Data.to.c2,Data.to.r2);var copyRange=Data.copyRange;var wsTo=wb.getWorksheetById(Data.sheetIdTo);if(bUndo){temp=from;from=to;to=temp;if(wsTo){temp=wsTo;wsTo=ws;ws=temp}}if(wb.bCollaborativeChanges){var coBBoxTo= new Asc.Range(0,0,0,0),coBBoxFrom=new Asc.Range(0,0,0,0);coBBoxTo.r1=collaborativeEditing.getLockOtherRow2(nSheetId,to.r1);coBBoxTo.c1=collaborativeEditing.getLockOtherColumn2(nSheetId,to.c1);coBBoxTo.r2=collaborativeEditing.getLockOtherRow2(nSheetId,to.r2);coBBoxTo.c2=collaborativeEditing.getLockOtherColumn2(nSheetId,to.c2);coBBoxFrom.r1=collaborativeEditing.getLockOtherRow2(nSheetId,from.r1);coBBoxFrom.c1=collaborativeEditing.getLockOtherColumn2(nSheetId,from.c1);coBBoxFrom.r2=collaborativeEditing.getLockOtherRow2(nSheetId, from.r2);coBBoxFrom.c2=collaborativeEditing.getLockOtherColumn2(nSheetId,from.c2);ws._moveRange(coBBoxFrom,coBBoxTo,copyRange,wsTo)}else ws._moveRange(from,to,copyRange,wsTo);worksheetView=wb.oApi.wb.getWorksheetById(nSheetId);if(bUndo)worksheetView.model.autoFilters._cleanStyleTable(to);worksheetView.model.autoFilters.reDrawFilter(to);worksheetView.model.autoFilters.reDrawFilter(from)}else if(AscCH.historyitem_Worksheet_Rename==Type)if(bUndo)ws.setName(Data.from,true);else ws.setName(Data.to,true); else if(AscCH.historyitem_Worksheet_Hide==Type)if(bUndo)ws.setHidden(Data.from);else ws.setHidden(Data.to);else if(AscCH.historyitem_Worksheet_SetDisplayGridlines===Type)ws.setDisplayGridlines(bUndo?Data.from:Data.to);else if(AscCH.historyitem_Worksheet_SetDisplayHeadings===Type)ws.setDisplayHeadings(bUndo?Data.from:Data.to);else if(AscCH.historyitem_Worksheet_ChangeMerge===Type){from=null;if(null!=Data.from&&null!=Data.from.r1&&null!=Data.from.c1&&null!=Data.from.r2&&null!=Data.from.c2){from=new Asc.Range(Data.from.c1, Data.from.r1,Data.from.c2,Data.from.r2);if(wb.bCollaborativeChanges){from.r1=collaborativeEditing.getLockOtherRow2(nSheetId,from.r1);from.c1=collaborativeEditing.getLockOtherColumn2(nSheetId,from.c1);from.r2=collaborativeEditing.getLockOtherRow2(nSheetId,from.r2);from.c2=collaborativeEditing.getLockOtherColumn2(nSheetId,from.c2)}}to=null;if(null!=Data.to&&null!=Data.to.r1&&null!=Data.to.c1&&null!=Data.to.r2&&null!=Data.to.c2){to=new Asc.Range(Data.to.c1,Data.to.r1,Data.to.c2,Data.to.r2);if(wb.bCollaborativeChanges){to.r1= collaborativeEditing.getLockOtherRow2(nSheetId,to.r1);to.c1=collaborativeEditing.getLockOtherColumn2(nSheetId,to.c1);to.r2=collaborativeEditing.getLockOtherRow2(nSheetId,to.r2);to.c2=collaborativeEditing.getLockOtherColumn2(nSheetId,to.c2)}}if(bUndo){temp=from;from=to;to=temp}if(null!=from){var aMerged=ws.mergeManager.get(from);for(i in aMerged.inner){var merged=aMerged.inner[i];if(merged.bbox.isEqual(from)){ws.mergeManager.removeElement(merged);break}}}data=1;if(null!=to)ws.mergeManager.add(to,data)}else if(AscCH.historyitem_Worksheet_ChangeHyperlink=== Type){from=null;if(null!=Data.from&&null!=Data.from.r1&&null!=Data.from.c1&&null!=Data.from.r2&&null!=Data.from.c2){from=new Asc.Range(Data.from.c1,Data.from.r1,Data.from.c2,Data.from.r2);if(wb.bCollaborativeChanges){from.r1=collaborativeEditing.getLockOtherRow2(nSheetId,from.r1);from.c1=collaborativeEditing.getLockOtherColumn2(nSheetId,from.c1);from.r2=collaborativeEditing.getLockOtherRow2(nSheetId,from.r2);from.c2=collaborativeEditing.getLockOtherColumn2(nSheetId,from.c2)}}to=null;if(null!=Data.to&& null!=Data.to.r1&&null!=Data.to.c1&&null!=Data.to.r2&&null!=Data.to.c2){to=new Asc.Range(Data.to.c1,Data.to.r1,Data.to.c2,Data.to.r2);if(wb.bCollaborativeChanges){to.r1=collaborativeEditing.getLockOtherRow2(nSheetId,to.r1);to.c1=collaborativeEditing.getLockOtherColumn2(nSheetId,to.c1);to.r2=collaborativeEditing.getLockOtherRow2(nSheetId,to.r2);to.c2=collaborativeEditing.getLockOtherColumn2(nSheetId,to.c2)}}if(bUndo){temp=from;from=to;to=temp}data=null;if(null!=from){var aHyperlinks=ws.hyperlinkManager.get(from); for(i in aHyperlinks.inner){var hyp=aHyperlinks.inner[i];if(hyp.bbox.isEqual(from)){data=hyp.data;ws.hyperlinkManager.removeElement(hyp);break}}}if(null==data)data=Data.hyperlink;if(null!=data&&null!=to){data.Ref=ws.getRange3(to.r1,to.c1,to.r2,to.c2);ws.hyperlinkManager.add(to,data)}}else if(AscCH.historyitem_Worksheet_ChangeFrozenCell===Type){worksheetView=wb.oApi.wb.getWorksheetById(nSheetId);var updateData=bUndo?Data.from:Data.to;worksheetView._updateFreezePane(updateData.c1,updateData.r1,true)}else if(AscCH.historyitem_Worksheet_SetTabColor=== Type)ws.setTabColor(bUndo?Data.from:Data.to);else if(AscCH.historyitem_Worksheet_SetSummaryRight===Type)ws.setSummaryRight(bUndo?Data.from:Data.to);else if(AscCH.historyitem_Worksheet_SetSummaryBelow===Type)ws.setSummaryBelow(bUndo?Data.from:Data.to);else if(AscCH.historyitem_Worksheet_GroupRow==Type){index=Data.index;if(wb.bCollaborativeChanges){index=collaborativeEditing.getLockOtherRow2(nSheetId,index);oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range; oLockInfo["rangeOrObjectId"]=new Asc.Range(0,index,gc_nMaxCol0,index);wb.aCollaborativeChangeElements.push(oLockInfo)}ws._getRow(index,function(row){if(bUndo)row.setOutlineLevel(Data.oOldVal);else row.setOutlineLevel(Data.oNewVal)})}else if(AscCH.historyitem_Worksheet_GroupCol==Type){index=Data.index;if(wb.bCollaborativeChanges){index=collaborativeEditing.getLockOtherRow2(nSheetId,index);oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range; oLockInfo["rangeOrObjectId"]=new Asc.Range(0,index,gc_nMaxCol0,index);wb.aCollaborativeChangeElements.push(oLockInfo)}col=ws._getCol(index);if(col)if(bUndo)col.setOutlineLevel(Data.oOldVal);else col.setOutlineLevel(Data.oNewVal)}else if(AscCH.historyitem_Worksheet_CollapsedRow==Type){index=Data.index;if(wb.bCollaborativeChanges){index=collaborativeEditing.getLockOtherRow2(nSheetId,index);oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range; oLockInfo["rangeOrObjectId"]=new Asc.Range(0,index,gc_nMaxCol0,index);wb.aCollaborativeChangeElements.push(oLockInfo)}if(bUndo)ws.setCollapsedRow(Data.oOldVal,index);else ws.setCollapsedRow(Data.oNewVal,index)}else if(AscCH.historyitem_Worksheet_CollapsedCol==Type){index=Data.index;if(wb.bCollaborativeChanges){index=collaborativeEditing.getLockOtherRow2(nSheetId,index);oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;oLockInfo["rangeOrObjectId"]= new Asc.Range(0,index,gc_nMaxCol0,index);wb.aCollaborativeChangeElements.push(oLockInfo)}if(bUndo)ws.setCollapsedCol(Data.oOldVal,index);else ws.setCollapsedCol(Data.oNewVal,index)}else if(AscCH.historyitem_Worksheet_SetFitToPage===Type)ws.setFitToPage(bUndo?Data.from:Data.to);else if(AscCH.historyitem_Worksheet_PivotAdd===Type)if(bUndo)ws.deletePivotTable(Data.Id);else{var pivot=Data.getData();pivot.init();ws.insertPivotTable(pivot,false,true)}else if(AscCH.historyitem_Worksheet_PivotDelete===Type)if(bUndo)ws.insertPivotTable(Data.from, false,true);else ws.deletePivotTable(Data.pivot);else if(AscCH.historyitem_Worksheet_PivotReplace===Type){var data=bUndo?Data.from:Data.to;var pivot=data.getData();pivot.init();var oldPivot=ws.getPivotTableById(Data.pivot);if(oldPivot)pivot.replaceSlicersPivotCacheDefinition(oldPivot.cacheDefinition,pivot.cacheDefinition);ws.deletePivotTable(Data.pivot);ws.insertPivotTable(pivot,false,true)}else if(AscCH.historyitem_Worksheet_SlicerAdd===Type)if(bUndo)ws.deleteSlicer(Data.to.name);else{ws.aSlicers.push(Data.to); Data.to.init(null,null,null,ws);wb.onSlicerUpdate(Data.to.name)}else if(AscCH.historyitem_Worksheet_SlicerDelete===Type)if(bUndo){ws.aSlicers.push(Data.from);Data.from.init(null,null,null,ws);wb.onSlicerUpdate(Data.from.name)}else ws.deleteSlicer(Data.from.name);else if(AscCH.historyitem_Worksheet_SetActiveNamedSheetView===Type){if(ws.aNamedSheetViews){var activeId=bUndo?Data.from:Data.to;var namedSheetView=ws.getNamedSheetViewById(activeId);for(i=0;i<ws.aNamedSheetViews.length;i++)ws.aNamedSheetViews[i]._isActive= false;ws.setActiveNamedSheetView(activeId);if(namedSheetView)namedSheetView._isActive=true;ws.autoFilters.reapplyAllFilters(true,ws.getActiveNamedSheetViewId()!==null,true)}}else if(AscCH.historyitem_Worksheet_SheetViewAdd===Type)if(bUndo)ws.deleteNamedSheetViews([ws.getNamedSheetViewById(Data.Id)],true);else ws.addNamedSheetView(Data.getData(),true);else if(AscCH.historyitem_Worksheet_SheetViewDelete===Type)if(bUndo)ws.addNamedSheetView(Data.from);else ws.deleteNamedSheetViews([ws.getNamedSheetViewById(Data.sheetView)], true);else if(AscCH.historyitem_Worksheet_DataValidationAdd===Type)if(bUndo)ws.deleteDataValidationById(Data.id);else{var _dataValidation=Data.to;_dataValidation.Id=Data.id;if(wb.bCollaborativeChanges)if(_dataValidation.ranges)for(i=0;i<_dataValidation.ranges.length;i++){_dataValidation.ranges[i].r1=collaborativeEditing.getLockOtherRow2(nSheetId,_dataValidation.ranges[i].r1);_dataValidation.ranges[i].c1=collaborativeEditing.getLockOtherColumn2(nSheetId,_dataValidation.ranges[i].c1);_dataValidation.ranges[i].r2= collaborativeEditing.getLockOtherRow2(nSheetId,_dataValidation.ranges[i].r2);_dataValidation.ranges[i].c2=collaborativeEditing.getLockOtherColumn2(nSheetId,_dataValidation.ranges[i].c2)}ws.addDataValidation(_dataValidation);_dataValidation._init(ws)}else if(AscCH.historyitem_Worksheet_DataValidationChange===Type){var dataValidationTo=bUndo?Data.from:Data.to;var dataValidationFrom=ws.getDataValidationById(Data.id);if(dataValidationFrom){dataValidationTo.Id=Data.id;if(wb.bCollaborativeChanges)if(dataValidationTo.ranges)for(i= 0;i<dataValidationTo.ranges.length;i++){dataValidationTo.ranges[i].r1=collaborativeEditing.getLockOtherRow2(nSheetId,dataValidationTo.ranges[i].r1);dataValidationTo.ranges[i].c1=collaborativeEditing.getLockOtherColumn2(nSheetId,dataValidationTo.ranges[i].c1);dataValidationTo.ranges[i].r2=collaborativeEditing.getLockOtherRow2(nSheetId,dataValidationTo.ranges[i].r2);dataValidationTo.ranges[i].c2=collaborativeEditing.getLockOtherColumn2(nSheetId,dataValidationTo.ranges[i].c2)}ws.dataValidations.elems[dataValidationFrom.index]= dataValidationTo}}else if(AscCH.historyitem_Worksheet_DataValidationDelete===Type)if(bUndo)ws.addDataValidation(Data.from);else ws.deleteDataValidationById(Data.id)};UndoRedoWoorksheet.prototype.forwardTransformationIsAffect=function(Type){return AscCH.historyitem_Worksheet_AddRows===Type||AscCH.historyitem_Worksheet_RemoveRows===Type||AscCH.historyitem_Worksheet_AddCols===Type||AscCH.historyitem_Worksheet_RemoveCols===Type||AscCH.historyitem_Worksheet_ShiftCellsLeft===Type||AscCH.historyitem_Worksheet_ShiftCellsRight=== Type||AscCH.historyitem_Worksheet_ShiftCellsTop===Type||AscCH.historyitem_Worksheet_ShiftCellsBottom===Type||AscCH.historyitem_Worksheet_MoveRange===Type||AscCH.historyitem_Worksheet_Rename===Type};UndoRedoWoorksheet.prototype.forwardTransformationGet=function(Type,Data,nSheetId){if(AscCH.historyitem_Worksheet_Rename===Type)return{from:Data.from,name:Data.to};return null};UndoRedoWoorksheet.prototype.forwardTransformationSet=function(Type,Data,nSheetId,getRes){if(AscCH.historyitem_Worksheet_Rename=== Type){Data.from=getRes.from;Data.to=getRes.name}return null};function UndoRedoRowCol(wb,bRow){this.wb=wb;this.bRow=bRow;this.nTypeRow=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoRow});this.nTypeCol=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoCol})}UndoRedoRowCol.prototype.getClassType=function(){if(this.bRow)return this.nTypeRow;else return this.nTypeCol};UndoRedoRowCol.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)}; UndoRedoRowCol.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoRowCol.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo){var ws=this.wb.getWorksheetById(nSheetId);if(null==ws)return;var nIndex=Data.index;if(this.wb.bCollaborativeChanges){var collaborativeEditing=this.wb.oApi.collaborativeEditing;var oLockInfo=new AscCommonExcel.asc_CLockInfo;oLockInfo["sheetId"]=nSheetId;oLockInfo["type"]=c_oAscLockTypeElem.Range;if(this.bRow){nIndex=collaborativeEditing.getLockOtherRow2(nSheetId, nIndex);oLockInfo["rangeOrObjectId"]=new Asc.Range(0,nIndex,gc_nMaxCol0,nIndex)}else if(AscCommonExcel.g_nAllColIndex==nIndex)oLockInfo["rangeOrObjectId"]=new Asc.Range(0,0,gc_nMaxCol0,gc_nMaxRow0);else{nIndex=collaborativeEditing.getLockOtherColumn2(nSheetId,nIndex);oLockInfo["rangeOrObjectId"]=new Asc.Range(nIndex,0,nIndex,gc_nMaxRow0)}this.wb.aCollaborativeChangeElements.push(oLockInfo)}var Val;if(bUndo)Val=Data.oOldVal;else Val=Data.oNewVal;function fAction(row){if(AscCH.historyitem_RowCol_SetFont== Type)row.setFont(Val);else if(AscCH.historyitem_RowCol_Fontname==Type)row.setFontname(Val);else if(AscCH.historyitem_RowCol_Fontsize==Type)row.setFontsize(Val);else if(AscCH.historyitem_RowCol_Fontcolor==Type)row.setFontcolor(Val);else if(AscCH.historyitem_RowCol_Bold==Type)row.setBold(Val);else if(AscCH.historyitem_RowCol_Italic==Type)row.setItalic(Val);else if(AscCH.historyitem_RowCol_Underline==Type)row.setUnderline(Val);else if(AscCH.historyitem_RowCol_Strikeout==Type)row.setStrikeout(Val);else if(AscCH.historyitem_RowCol_FontAlign== Type)row.setFontAlign(Val);else if(AscCH.historyitem_RowCol_AlignVertical==Type)row.setAlignVertical(Val);else if(AscCH.historyitem_RowCol_AlignHorizontal==Type)row.setAlignHorizontal(Val);else if(AscCH.historyitem_RowCol_Fill==Type)row.setFill(Val);else if(AscCH.historyitem_RowCol_Border==Type)if(null!=Val)row.setBorder(Val.clone());else row.setBorder(null);else if(AscCH.historyitem_RowCol_ShrinkToFit==Type)row.setShrinkToFit(Val);else if(AscCH.historyitem_RowCol_Wrap==Type)row.setWrap(Val);else if(AscCH.historyitem_RowCol_Num== Type)row.setNum(Val);else if(AscCH.historyitem_RowCol_Angle==Type)row.setAngle(Val);else if(AscCH.historyitem_RowCol_SetStyle==Type)row.setStyle(Val);else if(AscCH.historyitem_RowCol_SetCellStyle==Type)row.setCellStyle(Val)}if(this.bRow)ws._getRow(nIndex,fAction);else{var row=ws._getCol(nIndex);fAction(row)}};function UndoRedoComment(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoComment})}UndoRedoComment.prototype.getClassType=function(){return this.nType}; UndoRedoComment.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoComment.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoComment.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo){var collaborativeEditing,to;var oModel=null==nSheetId?this.wb:this.wb.getWorksheetById(nSheetId);var api=window["Asc"]["editor"];if(!api.wb||!oModel)return;var ws=null==nSheetId?api.wb:api.wb.getWorksheetById(nSheetId);Data.worksheet= ws;var cellCommentator=ws.cellCommentator;if(bUndo)cellCommentator.Undo(Type,Data);else{to=Data.from||Data.to?Data.to:Data;if(to&&!to.bDocument&&this.wb.bCollaborativeChanges){collaborativeEditing=this.wb.oApi.collaborativeEditing;to.nRow=collaborativeEditing.getLockOtherRow2(nSheetId,to.nRow);to.nCol=collaborativeEditing.getLockOtherColumn2(nSheetId,to.nCol)}cellCommentator.Redo(Type,Data)}};function UndoRedoSortState(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoSortState})} UndoRedoSortState.prototype.getClassType=function(){return this.nType};UndoRedoSortState.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoSortState.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoSortState.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo){var collaborativeEditing,to;var oModel=null==nSheetId?this.wb:this.wb.getWorksheetById(nSheetId);var api=window["Asc"]["editor"];if(!api.wb||!oModel)return; var ws=null==nSheetId?api.wb:api.wb.getWorksheetById(nSheetId);Data.worksheet=ws;if(Data.bFilter)if(Data.tableName){var table=ws.model.autoFilters._getFilterByDisplayName(Data.tableName);table.SortState=bUndo?Data.from:Data.to}else ws.model.AutoFilter.SortState=bUndo?Data.from:Data.to;else ws.model.sortState=bUndo?Data.from:Data.to};function UndoRedoAutoFilters(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoAutoFilters})}UndoRedoAutoFilters.prototype.getClassType= function(){return this.nType};UndoRedoAutoFilters.prototype.Undo=function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,true,opt_wb)};UndoRedoAutoFilters.prototype.Redo=function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,false,opt_wb)};UndoRedoAutoFilters.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo,opt_wb){var wb=opt_wb?opt_wb:this.wb;var ws=wb.getWorksheetById(nSheetId);if(ws){var autoFilters=ws.autoFilters;if(bUndo===true)autoFilters.Undo(Type,Data);else{var collaborativeEditing= this.wb.oApi.collaborativeEditing;if(AscCH.historyitem_AutoFilter_ChangeColumnName===Type||AscCH.historyitem_AutoFilter_ChangeTotalRow===Type){if(this.wb.bCollaborativeChanges){Data.nRow=collaborativeEditing.getLockOtherRow2(nSheetId,Data.nRow);Data.nCol=collaborativeEditing.getLockOtherColumn2(nSheetId,Data.nCol)}}else if(AscCH.historyitem_AutoFilter_Apply===Type||AscCH.historyitem_AutoFilter_ClearFilterColumn===Type){var _obj=Data.autoFiltersObject?Data.autoFiltersObject:Data;if(_obj.cellId!==undefined){var curCellId= _obj.cellId.split("af")[0];var range;AscCommonExcel.executeInR1C1Mode(false,function(){range=AscCommonExcel.g_oRangeCache.getAscRange(curCellId).clone()});var nRow=collaborativeEditing.getLockOtherRow2(nSheetId,range.r1);var nCol=collaborativeEditing.getLockOtherColumn2(nSheetId,range.c1);if(nCol!==range.c1||nRow!==range.r1)_obj.cellId=(new AscCommon.CellBase(nRow,nCol)).getName()}}autoFilters.Redo(Type,Data)}}};UndoRedoAutoFilters.prototype.forwardTransformationIsAffect=function(Type){return AscCH.historyitem_AutoFilter_Add=== Type||AscCH.historyitem_AutoFilter_ChangeTableName===Type||AscCH.historyitem_AutoFilter_Empty===Type||AscCH.historyitem_AutoFilter_ChangeColumnName===Type};function UndoRedoSparklines(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoSparklines})}UndoRedoSparklines.prototype.getClassType=function(){return this.nType};UndoRedoSparklines.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoSparklines.prototype.Redo=function(Type, Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoSparklines.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo){};function UndoRedoSharedFormula(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoSharedFormula})}UndoRedoSharedFormula.prototype.getClassType=function(){return this.nType};UndoRedoSharedFormula.prototype.Undo=function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,true,opt_wb)};UndoRedoSharedFormula.prototype.Redo= function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,false,opt_wb)};UndoRedoSharedFormula.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo,opt_wb){var wb=opt_wb?opt_wb:this.wb;var parsed=wb.workbookFormulas.get(Data.index);if(parsed&&bUndo){var val=bUndo?Data.oOldVal:Data.oNewVal;if(AscCH.historyitem_SharedFormula_ChangeFormula==Type){parsed.removeDependencies();parsed.setFormula(val);wb.dependencyFormulas.addToBuildDependencyShared(parsed)}else if(AscCH.historyitem_SharedFormula_ChangeShared== Type)parsed.setSharedRef(val,Data.bRow)}};function UndoRedoRedoLayout(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoLayout})}UndoRedoRedoLayout.prototype.getClassType=function(){return this.nType};UndoRedoRedoLayout.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoRedoLayout.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoRedoLayout.prototype.UndoRedo=function(Type, Data,nSheetId,bUndo){var ws=this.wb.getWorksheetById(nSheetId);if(!ws)return;var pageOptions=ws.PagePrintOptions;var pageSetup=pageOptions.asc_getPageSetup();var pageMargins=pageOptions.asc_getPageMargins();var value=bUndo?Data.from:Data.to;switch(Type){case AscCH.historyitem_Layout_Left:pageMargins.asc_setLeft(value);break;case AscCH.historyitem_Layout_Right:pageMargins.asc_setRight(value);break;case AscCH.historyitem_Layout_Top:pageMargins.asc_setTop(value);break;case AscCH.historyitem_Layout_Bottom:pageMargins.asc_setBottom(value); break;case AscCH.historyitem_Layout_Width:pageSetup.asc_setWidth(value);break;case AscCH.historyitem_Layout_Height:pageSetup.asc_setHeight(value);break;case AscCH.historyitem_Layout_FitToWidth:pageSetup.asc_setFitToWidth(value);break;case AscCH.historyitem_Layout_FitToHeight:pageSetup.asc_setFitToHeight(value);break;case AscCH.historyitem_Layout_GridLines:pageOptions.asc_setGridLines(value);break;case AscCH.historyitem_Layout_Headings:pageOptions.asc_setHeadings(value);break;case AscCH.historyitem_Layout_Orientation:pageSetup.asc_setOrientation(value); break;case AscCH.historyitem_Layout_Scale:pageSetup.asc_setScale(value);break}this.wb.oApi._onUpdateLayoutMenu(nSheetId)};function UndoRedoArrayFormula(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoArrayFormula})}UndoRedoArrayFormula.prototype.getClassType=function(){return this.nType};UndoRedoArrayFormula.prototype.Undo=function(Type,Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,true,opt_wb)};UndoRedoArrayFormula.prototype.Redo=function(Type, Data,nSheetId,opt_wb){this.UndoRedo(Type,Data,nSheetId,false,opt_wb)};UndoRedoArrayFormula.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo,opt_wb){var ws=this.wb.getWorksheetById(nSheetId);if(null==ws)return;var bbox=Data.range;var formula=Data.formula;var range=ws.getRange3(bbox.r1,bbox.c1,bbox.r2,bbox.c2);switch(Type){case AscCH.historyitem_ArrayFromula_AddFormula:if(!bUndo)AscCommonExcel.executeInR1C1Mode(false,function(){range.setValue(formula,null,null,bbox)});break;case AscCH.historyitem_ArrayFromula_DeleteFormula:if(bUndo)range.setValue(formula, null,null,bbox);break}};function UndoRedoHeaderFooter(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoHeaderFooter})}UndoRedoHeaderFooter.prototype.getClassType=function(){return this.nType};UndoRedoHeaderFooter.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoHeaderFooter.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoHeaderFooter.prototype.UndoRedo=function(Type, Data,nSheetId,bUndo){var ws=this.wb.getWorksheetById(nSheetId);if(!ws)return;var headerFooter=ws.headerFooter;var value=bUndo?Data.from:Data.to;switch(Type){case AscCH.historyitem_Header_First:headerFooter.setFirstHeader(value);break;case AscCH.historyitem_Header_Even:headerFooter.setEvenHeader(value);break;case AscCH.historyitem_Header_Odd:headerFooter.setOddHeader(value);break;case AscCH.historyitem_Footer_First:headerFooter.setFirstFooter(value);break;case AscCH.historyitem_Footer_Even:headerFooter.setEvenFooter(value); break;case AscCH.historyitem_Footer_Odd:headerFooter.setOddFooter(value);break;case AscCH.historyitem_Align_With_Margins:headerFooter.setAlignWithMargins(value);break;case AscCH.historyitem_Scale_With_Doc:headerFooter.setScaleWithDoc(value);break;case AscCH.historyitem_Different_First:headerFooter.setDifferentFirst(value);break;case AscCH.historyitem_Different_Odd_Even:headerFooter.setDifferentOddEven(value);break}};function UndoRedoPivotTables(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoPivotTables})} UndoRedoPivotTables.prototype.getClassType=function(){return this.nType};UndoRedoPivotTables.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoPivotTables.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoPivotTables.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo){var ws=this.wb.getWorksheetById(nSheetId);if(!ws)return;var pivotTable=ws.getPivotTableById(Data.pivot);if(!pivotTable)return;pivotTable.stashCurReportRange(); var value=bUndo?Data.from:Data.to;var valueFrom=bUndo?Data.to:Data.from;switch(Type){case AscCH.historyitem_PivotTable_StyleName:pivotTable.asc_getStyleInfo()._setName(value,pivotTable,ws);break;case AscCH.historyitem_PivotTable_StyleShowRowHeaders:pivotTable.asc_getStyleInfo()._setShowRowHeaders(value,pivotTable,ws);break;case AscCH.historyitem_PivotTable_StyleShowColHeaders:pivotTable.asc_getStyleInfo()._setShowColHeaders(value,pivotTable,ws);break;case AscCH.historyitem_PivotTable_StyleShowRowStripes:pivotTable.asc_getStyleInfo()._setShowRowStripes(value, pivotTable,ws);break;case AscCH.historyitem_PivotTable_StyleShowColStripes:pivotTable.asc_getStyleInfo()._setShowColStripes(value,pivotTable,ws);break;case AscCH.historyitem_PivotTable_SetName:pivotTable.asc_setName(value);break;case AscCH.historyitem_PivotTable_SetRowGrandTotals:pivotTable.asc_setRowGrandTotals(value);break;case AscCH.historyitem_PivotTable_SetColGrandTotals:pivotTable.asc_setColGrandTotals(value);break;case AscCH.historyitem_PivotTable_SetPageOverThenDown:pivotTable.asc_setPageOverThenDown(value); break;case AscCH.historyitem_PivotTable_SetPageWrap:pivotTable.asc_setPageWrap(value);break;case AscCH.historyitem_PivotTable_SetShowHeaders:pivotTable.asc_setShowHeaders(value);break;case AscCH.historyitem_PivotTable_SetCompact:pivotTable.asc_setCompact(value);break;case AscCH.historyitem_PivotTable_SetOutline:pivotTable.asc_setOutline(value);break;case AscCH.historyitem_PivotTable_SetGridDropZones:pivotTable.asc_setGridDropZones(value);break;case AscCH.historyitem_PivotTable_SetFillDownLabelsDefault:pivotTable.setFillDownLabelsDefault(value, false);break;case AscCH.historyitem_PivotTable_SetDataOnRows:pivotTable.setDataOnRows(value);break;case AscCH.historyitem_PivotTable_SetDataPosition:pivotTable.setDataPosition(value);break;case AscCH.historyitem_PivotTable_SetAltText:pivotTable.setTitle(value);break;case AscCH.historyitem_PivotTable_SetAltTextSummary:pivotTable.setDescription(value);break;case AscCH.historyitem_PivotTable_AddPageField:if(bUndo)pivotTable.removeNoDataField(Data.from);else pivotTable.addPageField(Data.from,Data.to); break;case AscCH.historyitem_PivotTable_AddRowField:if(bUndo)pivotTable.removeNoDataField(Data.from);else pivotTable.addRowField(Data.from,Data.to);break;case AscCH.historyitem_PivotTable_AddColField:if(bUndo)pivotTable.removeNoDataField(Data.from);else pivotTable.addColField(Data.from,Data.to);break;case AscCH.historyitem_PivotTable_AddDataField:if(bUndo)pivotTable.removeDataField(Data.from,Data.to);else pivotTable.addDataField(Data.from,Data.to);break;case AscCH.historyitem_PivotTable_RemovePageField:if(bUndo)pivotTable.addPageField(Data.from, Data.to);else pivotTable.removeNoDataField(Data.from);break;case AscCH.historyitem_PivotTable_RemoveRowField:if(bUndo)pivotTable.addRowField(Data.from,Data.to);else pivotTable.removeNoDataField(Data.from);break;case AscCH.historyitem_PivotTable_RemoveColField:if(bUndo)pivotTable.addColField(Data.from,Data.to);else pivotTable.removeNoDataField(Data.from);break;case AscCH.historyitem_PivotTable_RemoveDataField:if(bUndo)for(var i=Data.to.length-1;i>=0;--i)pivotTable.addDataField(Data.from,Data.to[i]); else for(var i=0;i<Data.to.length;++i)pivotTable.removeDataField(Data.from,Data.to[i]);break;case AscCH.historyitem_PivotTable_MovePageField:pivotTable.moveField(pivotTable.asc_getPageFields(),valueFrom,value);break;case AscCH.historyitem_PivotTable_MoveRowField:pivotTable.moveField(pivotTable.asc_getRowFields(),valueFrom,value);break;case AscCH.historyitem_PivotTable_MoveColField:pivotTable.moveField(pivotTable.asc_getColumnFields(),valueFrom,value);break;case AscCH.historyitem_PivotTable_MoveDataField:pivotTable.moveField(pivotTable.asc_getDataFields(), valueFrom,value);break;case AscCH.historyitem_PivotTable_RowItems:pivotTable.setRowItems(value);break;case AscCH.historyitem_PivotTable_ColItems:pivotTable.setColItems(value);break;case AscCH.historyitem_PivotTable_Location:pivotTable.setLocation(value);break;case AscCH.historyitem_PivotTable_CacheField:var cacheFields=pivotTable.asc_getCacheFields();if(cacheFields&&cacheFields[Data.index])cacheFields[Data.index].checkSharedItems(pivotTable,Data.index,pivotTable.getRecords());break;case AscCH.historyitem_PivotTable_PivotField:var pivotFields= pivotTable.asc_getPivotFields();if(pivotFields[Data.index])pivotFields[Data.index]=value;break;case AscCH.historyitem_PivotTable_PivotFilter:if(value){if(!pivotTable.filters)pivotTable.filters=new CT_PivotFilters;pivotTable.filters.filter.splice(Data.index,0,value)}else if(pivotTable.filters){pivotTable.filters.filter.splice(Data.index,1);if(pivotTable.filters.filter.length==0)pivotTable.filters=null}break;case AscCH.historyitem_PivotTable_PivotFilterDataField:var pivotFilters=pivotTable.asc_getPivotFilters(); if(pivotFilters&&Data.index<pivotFilters.length)pivotFilters[Data.index].dataField=value;break;case AscCH.historyitem_PivotTable_PivotFilterMeasureFld:var pivotFilters=pivotTable.asc_getPivotFilters();if(pivotFilters&&Data.index<pivotFilters.length)pivotFilters[Data.index].setMeasureFld(value);break;case AscCH.historyitem_PivotTable_PageFilter:var pageField=pivotTable.getPageFieldByFieldIndex(Data.index);if(pageField)pageField.item=value;break;case AscCH.historyitem_PivotTable_PivotCacheId:pivotTable.setPivotCacheId(value); break}};function UndoRedoPivotFields(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoPivotFields})}UndoRedoPivotFields.prototype.getClassType=function(){return this.nType};UndoRedoPivotFields.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoPivotFields.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,false)};UndoRedoPivotFields.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo){var ws= this.wb.getWorksheetById(nSheetId);if(!ws)return;var pivotTable=ws.getPivotTableById(Data.pivot);if(!pivotTable)return;var fields;if(Type<AscCH.historyitem_PivotTable_DataFieldSetName)fields=pivotTable.asc_getPivotFields();else fields=pivotTable.asc_getDataFields();if(!fields||!fields[Data.index])return;var field=fields[Data.index];pivotTable.stashCurReportRange();var value=bUndo?Data.from:Data.to;switch(Type){case AscCH.historyitem_PivotTable_PivotFieldSetName:field.asc_setName(value,pivotTable, Data.index);break;case AscCH.historyitem_PivotTable_PivotFieldSetOutline:field.asc_setOutline(value,pivotTable,Data.index);break;case AscCH.historyitem_PivotTable_PivotFieldSetCompact:field.asc_setCompact(value,pivotTable,Data.index);break;case AscCH.historyitem_PivotTable_PivotFieldFillDownLabelsDefault:field.setFillDownLabelsDefault(value,pivotTable,Data.index);break;case AscCH.historyitem_PivotTable_PivotFieldSetInsertBlankRow:field.asc_setInsertBlankRow(value,pivotTable,Data.index);break;case AscCH.historyitem_PivotTable_PivotFieldSetDefaultSubtotal:field.asc_setDefaultSubtotal(value, pivotTable,Data.index);field.checkSubtotal();break;case AscCH.historyitem_PivotTable_PivotFieldSetSubtotalTop:field.asc_setSubtotalTop(value,pivotTable,Data.index);break;case AscCH.historyitem_PivotTable_PivotFieldSetShowAll:field.asc_setShowAll(value,pivotTable,Data.index);break;case AscCH.historyitem_PivotTable_PivotFieldSetSubtotals:field.setSubtotals(value,pivotTable,Data.index);field.checkSubtotal();break;case AscCH.historyitem_PivotTable_DataFieldSetName:field.asc_setName(value,pivotTable,Data.index); break;case AscCH.historyitem_PivotTable_DataFieldSetSubtotal:field.asc_setSubtotal(value,pivotTable,Data.index);break}};function UndoRedoSlicer(wb){this.wb=wb;this.nType=UndoRedoClassTypes.Add(function(){return AscCommonExcel.g_oUndoRedoSlicer})}UndoRedoSlicer.prototype.getClassType=function(){return this.nType};UndoRedoSlicer.prototype.Undo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId,true)};UndoRedoSlicer.prototype.Redo=function(Type,Data,nSheetId){this.UndoRedo(Type,Data,nSheetId, false)};UndoRedoSlicer.prototype.UndoRedo=function(Type,Data,nSheetId,bUndo){var oModel=null==nSheetId?this.wb:this.wb.getWorksheetById(nSheetId);var api=window["Asc"]["editor"];if(!api.wb||!oModel)return;var slicer,slicerCache,updateByCacheName=null;switch(Type){case AscCH.historyitem_Slicer_SetCaption:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.setCaption(bUndo?Data.from:Data.to);break}case AscCH.historyitem_Slicer_SetCacheSourceName:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.setSourceName(bUndo? Data.from:Data.to);break}case AscCH.historyitem_Slicer_SetTableColName:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.setTableCacheColName(bUndo?Data.from:Data.to);break}case AscCH.historyitem_Slicer_SetTableName:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.setTableName(bUndo?Data.from:Data.to);break}case AscCH.historyitem_Slicer_SetCacheName:{slicer=oModel.getSlicerByName(Data.name);if(slicer){slicer.setCacheName(bUndo?Data.from:Data.to);updateByCacheName=false}break}case AscCH.historyitem_Slicer_SetName:{slicer= oModel.getSlicerByName(bUndo?Data.to:Data.from);if(slicer){slicer.setName(bUndo?Data.from:Data.to);this.wb.onSlicerUpdate(bUndo?Data.from:Data.to);updateByCacheName=false}break}case AscCH.historyitem_Slicer_SetStartItem:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.startItem=bUndo?Data.from:Data.to;break}case AscCH.historyitem_Slicer_SetColumnCount:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.columnCount=bUndo?Data.from:Data.to;break}case AscCH.historyitem_Slicer_SetShowCaption:{slicer= oModel.getSlicerByName(Data.name);if(slicer)slicer.showCaption=bUndo?Data.from:Data.to;break}case AscCH.historyitem_Slicer_SetLevel:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.level=bUndo?Data.from:Data.to;break}case AscCH.historyitem_Slicer_SetStyle:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.style=bUndo?Data.from:Data.to;break}case AscCH.historyitem_Slicer_SetLockedPosition:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.lockedPosition=bUndo?Data.from:Data.to; break}case AscCH.historyitem_Slicer_SetRowHeight:{slicer=oModel.getSlicerByName(Data.name);if(slicer)slicer.rowHeight=bUndo?Data.from:Data.to;break}case AscCH.historyitem_Slicer_SetCacheSortOrder:{slicerCache=oModel.getSlicerCacheByName(Data.name);if(slicerCache){slicerCache.setSortOrder(bUndo?Data.from:Data.to);updateByCacheName=Data.name}break}case AscCH.historyitem_Slicer_SetCacheCustomListSort:{slicerCache=oModel.getSlicerCacheByName(Data.name);if(slicerCache){slicerCache.setCustomListSort(bUndo? Data.from:Data.to);updateByCacheName=Data.name}break}case AscCH.historyitem_Slicer_SetCacheCrossFilter:{slicerCache=oModel.getSlicerCacheByName(Data.name);if(slicerCache){slicerCache.setCrossFilter(bUndo?Data.from:Data.to);updateByCacheName=Data.name}break}case AscCH.historyitem_Slicer_SetCacheHideItemsWithNoData:{slicerCache=oModel.getSlicerCacheByName(Data.name);if(slicerCache){slicerCache.setHideItemsWithNoData(bUndo?Data.from:Data.to);updateByCacheName=Data.name}break}case AscCH.historyitem_Slicer_SetCacheData:{slicerCache= oModel.getSlicerCacheByName(Data.name);if(slicerCache){var wrapper=bUndo?Data.from:Data.to;var cache=new Asc.CT_slicerCacheDefinition;wrapper.initObject(cache);cache.initAfterSerialize(this.wb);slicerCache.copyFrom(cache);updateByCacheName=Data.name}break}case AscCH.historyitem_Slicer_SetCacheMovePivot:{slicerCache=oModel.getSlicerCacheByName(Data.name);if(slicerCache){var from=bUndo?Data.to:Data.from;var to=bUndo?Data.from:Data.to;slicerCache.movePivotTable(from.value,from.style,to.value,to.style); updateByCacheName=Data.name}break}case AscCH.historyitem_Slicer_SetCacheCopySheet:{slicerCache=oModel.getSlicerCacheByName(Data.name);if(slicerCache){var from=bUndo?Data.to:Data.from;var to=bUndo?Data.from:Data.to;slicerCache.forCopySheet(from,to);updateByCacheName=Data.name}break}}if(updateByCacheName===null&&slicer)this.wb.onSlicerUpdate(Data.name);else if(updateByCacheName){var slicers=oModel.getSlicersByCacheName(Data.name);if(slicers)for(var i=0;i<slicers.length;i++)this.wb.onSlicerUpdate(slicers[i].name)}}; window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].UndoRedoItemSerializable=UndoRedoItemSerializable;window["AscCommonExcel"].UndoRedoClassTypes=UndoRedoClassTypes;window["AscCommonExcel"].UndoRedoDataTypes=UndoRedoDataTypes;window["AscCommonExcel"].UndoRedoData_CellSimpleData=UndoRedoData_CellSimpleData;window["AscCommonExcel"].UndoRedoData_CellData=UndoRedoData_CellData;window["AscCommonExcel"].UndoRedoData_CellValueData=UndoRedoData_CellValueData;window["AscCommonExcel"].UndoRedoData_FromToRowCol= UndoRedoData_FromToRowCol;window["AscCommonExcel"].UndoRedoData_FromTo=UndoRedoData_FromTo;window["AscCommonExcel"].UndoRedoData_FromToHyperlink=UndoRedoData_FromToHyperlink;window["AscCommonExcel"].UndoRedoData_IndexSimpleProp=UndoRedoData_IndexSimpleProp;window["AscCommonExcel"].UndoRedoData_ColProp=UndoRedoData_ColProp;window["AscCommonExcel"].UndoRedoData_RowProp=UndoRedoData_RowProp;window["AscCommonExcel"].UndoRedoData_BBox=UndoRedoData_BBox;window["AscCommonExcel"].UndoRedoData_SortData=UndoRedoData_SortData; window["AscCommonExcel"].UndoRedoData_PivotTable=UndoRedoData_PivotTable;window["AscCommonExcel"].UndoRedoData_PivotTableRedo=UndoRedoData_PivotTableRedo;window["AscCommonExcel"].UndoRedoData_PivotField=UndoRedoData_PivotField;window["AscCommonExcel"].UndoRedoData_Layout=UndoRedoData_Layout;window["AscCommonExcel"].UndoRedoData_SheetAdd=UndoRedoData_SheetAdd;window["AscCommonExcel"].UndoRedoData_SheetRemove=UndoRedoData_SheetRemove;window["AscCommonExcel"].UndoRedoData_DefinedNames=UndoRedoData_DefinedNames; window["AscCommonExcel"].UndoRedoData_ClrScheme=UndoRedoData_ClrScheme;window["AscCommonExcel"].UndoRedoData_AutoFilter=UndoRedoData_AutoFilter;window["AscCommonExcel"].UndoRedoData_SingleProperty=UndoRedoData_SingleProperty;window["AscCommonExcel"].UndoRedoData_ArrayFormula=UndoRedoData_ArrayFormula;window["AscCommonExcel"].UndoRedoData_SortState=UndoRedoData_SortState;window["AscCommonExcel"].UndoRedoData_Slicer=UndoRedoData_Slicer;window["AscCommonExcel"].UndoRedoData_DataValidation=UndoRedoData_DataValidation; window["AscCommonExcel"].UndoRedoWorkbook=UndoRedoWorkbook;window["AscCommonExcel"].UndoRedoCell=UndoRedoCell;window["AscCommonExcel"].UndoRedoWoorksheet=UndoRedoWoorksheet;window["AscCommonExcel"].UndoRedoRowCol=UndoRedoRowCol;window["AscCommonExcel"].UndoRedoComment=UndoRedoComment;window["AscCommonExcel"].UndoRedoAutoFilters=UndoRedoAutoFilters;window["AscCommonExcel"].UndoRedoSparklines=UndoRedoSparklines;window["AscCommonExcel"].UndoRedoSharedFormula=UndoRedoSharedFormula;window["AscCommonExcel"].UndoRedoRedoLayout= UndoRedoRedoLayout;window["AscCommonExcel"].UndoRedoArrayFormula=UndoRedoArrayFormula;window["AscCommonExcel"].UndoRedoHeaderFooter=UndoRedoHeaderFooter;window["AscCommonExcel"].UndoRedoSortState=UndoRedoSortState;window["AscCommonExcel"].UndoRedoData_BinaryWrapper=UndoRedoData_BinaryWrapper;window["AscCommonExcel"].UndoRedoData_BinaryWrapper2=UndoRedoData_BinaryWrapper2;window["AscCommonExcel"].UndoRedoPivotTables=UndoRedoPivotTables;window["AscCommonExcel"].UndoRedoPivotFields=UndoRedoPivotFields; window["AscCommonExcel"].UndoRedoSlicer=UndoRedoSlicer;window["AscCommonExcel"].g_oUndoRedoWorkbook=null;window["AscCommonExcel"].g_oUndoRedoCell=null;window["AscCommonExcel"].g_oUndoRedoWorksheet=null;window["AscCommonExcel"].g_oUndoRedoRow=null;window["AscCommonExcel"].g_oUndoRedoCol=null;window["AscCommonExcel"].g_oUndoRedoComment=null;window["AscCommonExcel"].g_oUndoRedoAutoFilters=null;window["AscCommonExcel"].g_oUndoRedoSparklines=null;window["AscCommonExcel"].g_oUndoRedoPivotTables=null;window["AscCommonExcel"].g_oUndoRedoPivotFields= null;window["AscCommonExcel"].g_oUndoRedoSharedFormula=null;window["AscCommonExcel"].g_oUndoRedoLayout=null;window["AscCommonExcel"].g_UndoRedoArrayFormula=null;window["AscCommonExcel"].g_oUndoRedoHeaderFooter=null;window["AscCommonExcel"].g_oUndoRedoSlicer=null;window["AscCommonExcel"].g_oUndoRedoNamedSheetViews=null})(window);"use strict";(function($,window,undefined){var prot;var c_oAscBorderStyles=AscCommon.c_oAscBorderStyles;var c_oAscMaxCellOrCommentLength=Asc.c_oAscMaxCellOrCommentLength;var doc= window.document;var copyPasteUseBinary=true;var CopyPasteCorrectString=AscCommon.CopyPasteCorrectString;var c_oSpecialPasteProps=Asc.c_oSpecialPasteProps;function number2color(n){if(typeof n==="string"&&n.indexOf("rgb")>-1)return n;return"rgb("+(n>>16&255)+","+(n>>8&255)+","+(n&255)+")"}function CSpecialPasteProps(){this.cellStyle=null;this.val=null;this.numFormat=null;this.formula=null;this.font=null;this.alignVertical=null;this.alignHorizontal=null;this.fontSize=null;this.fontName=null;this.merge= null;this.borders=null;this.wrap=null;this.fill=null;this.angle=null;this.hyperlink=null;this.format=null;this.formatTable=null;this.images=null;this.width=null;this.transpose=null;this.comment=null;this.advancedOptions=null;this.operation=null;this.skipBlanks=null;this.init()}CSpecialPasteProps.prototype={constructor:CSpecialPasteProps,init:function(){this.setBaseOptions()},setBaseOptions:function(onlyMain){this.cellStyle=true;this.val=true;this.numFormat=true;this.formula=true;this.font=true;this.alignVertical= true;this.alignHorizontal=true;this.fontSize=true;this.fontName=true;this.merge=true;this.borders=true;this.wrap=true;this.fill=true;this.angle=true;this.hyperlink=true;this.format=true;this.formatTable=true;this.images=true;this.width=null;this.transpose=null;this.comment=true;this.property=null;this.advancedOptions=null;if(!onlyMain){this.operation=null;this.skipBlanks=null}},_clean:function(){this.cellStyle=null;this.val=null;this.numFormat=null;this.formula=null;this.font=null;this.alignVertical= null;this.alignHorizontal=null;this.fontSize=null;this.fontName=null;this.merge=null;this.borders=null;this.wrap=null;this.fill=null;this.angle=null;this.hyperlink=null;this.format=null;this.formatTable=null;this.images=null;this.width=null;this.transpose=null;this.comment=null;this.advancedOptions=null;this.skipBlanks=null},asc_setProps:function(props){this.setBaseOptions(true);this.property=props;switch(props){case c_oSpecialPasteProps.paste:{break}case c_oSpecialPasteProps.pasteOnlyFormula:{this._clean(); this.formula=true;this.val=true;break}case c_oSpecialPasteProps.formulaNumberFormat:{this._clean();this.formula=true;this.numFormat=true;this.val=true;break}case c_oSpecialPasteProps.formulaAllFormatting:{break}case c_oSpecialPasteProps.formulaWithoutBorders:{this.borders=null;break}case c_oSpecialPasteProps.formulaColumnWidth:{this.width=true;break}case c_oSpecialPasteProps.mergeConditionalFormating:{break}case c_oSpecialPasteProps.pasteOnlyValues:{this._clean();this.val=true;break}case c_oSpecialPasteProps.valueNumberFormat:{this._clean(); this.val=true;this.numFormat=true;break}case c_oSpecialPasteProps.valueAllFormating:{this.formula=null;this.formatTable=null;break}case c_oSpecialPasteProps.pasteOnlyFormating:{this.formula=null;this.val=null;this.formatTable=null;break}case c_oSpecialPasteProps.transpose:{this.transpose=true;break}case c_oSpecialPasteProps.link:{this._clean();break}case c_oSpecialPasteProps.picture:{break}case c_oSpecialPasteProps.linkedPicture:{break}case c_oSpecialPasteProps.sourceformatting:{break}case c_oSpecialPasteProps.destinationFormatting:{this._clean(); this.val=true;if(window["AscCommon"].g_specialPasteHelper.specialPasteData.pasteFromWord)this.images=true;break}case c_oSpecialPasteProps.comments:{this._clean();this.comment=true;break}case c_oSpecialPasteProps.columnWidth:{this._clean();this.width=true;break}}},asc_getProps:function(){return this.property},asc_setAdvancedOptions:function(props){this.advancedOptions=props},asc_getAdvancedOptions:function(){return this.advancedOptions},asc_setOperation:function(val){this.operation=val},asc_getOperation:function(){return this.operation}, asc_setTranspose:function(val){this.transpose=val},asc_setSkipBlanks:function(val){this.skipBlanks=val},asc_getTableAllowed:function(){return this.formatTable}};function Clipboard(){this.copyProcessor=new CopyProcessorExcel;this.pasteProcessor=new PasteProcessorExcel;return this}Clipboard.prototype.checkCopyToClipboard=function(ws,_clipboard,_formats){var _data=null;var wb=window["Asc"]["editor"].wb;window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();ws.handlers.trigger("cleanCutData", true);if(wb.getCellEditMode()){var fragments=wb.cellEditor.copySelection();if(null!==fragments)_data=AscCommonExcel.getFragmentsText(fragments);if(null!==_data)_clipboard.pushData(AscCommon.c_oAscClipboardDataFormat.Text,_data)}else{if(1!==ws.model.selectionRange.ranges.length){var selectedDrawings=ws.objectRender.getSelectedGraphicObjects();if(0===selectedDrawings.length){ws.handlers.trigger("onErrorEvent",Asc.c_oAscError.ID.CopyMultiselectAreaError,Asc.c_oAscError.Level.NoCritical);return}}var activeRange= ws.getSelectedRange();var selectionRange=ws.model.selectionRange.getLast();var activeCell=ws.model.selectionRange.activeCell.clone();if(ws.model.autoFilters.bIsExcludeHiddenRows(selectionRange,activeCell,true)){ws.model.excludeHiddenRows(true);ws.model.ignoreWriteFormulas(true)}if(AscCommon.c_oAscClipboardDataFormat.Text&_formats){_data=this.copyProcessor.getText(activeRange,ws);if(null!==_data)_clipboard.pushData(AscCommon.c_oAscClipboardDataFormat.Text,_data)}if(AscCommon.c_oAscClipboardDataFormat.Html& _formats){_data=this.copyProcessor.getHtml(activeRange,ws);if(null!==_data&&""!==_data.html)_clipboard.pushData(AscCommon.c_oAscClipboardDataFormat.Html,_data.html)}if(AscCommon.c_oAscClipboardDataFormat.Internal&_formats){if(window["NATIVE_EDITOR_ENJINE"])_data=this.copyProcessor.getBinaryForMobile();else if(_data&&_data.base64)_data=_data.base64;else _data=this.copyProcessor.getBinaryForCopy(ws.model,ws.objectRender);if(null!==_data)_clipboard.pushData(AscCommon.c_oAscClipboardDataFormat.Internal, _data)}ws.model.excludeHiddenRows(false);ws.model.ignoreWriteFormulas(false)}};Clipboard.prototype.pasteData=function(ws,_format,data1,data2,text_data,bIsSpecialPaste,doNotShowButton,isPasteAll){var t=this;var wb=window["Asc"]["editor"].wb;var cellEditor=wb.cellEditor;t.pasteProcessor.clean();if(!window["AscCommon"].g_specialPasteHelper.specialPasteStart)window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();window["AscCommon"].g_specialPasteHelper.Paste_Process_Start(doNotShowButton); if(!bIsSpecialPaste&&!wb.getCellEditMode()){window["AscCommon"].g_specialPasteHelper.specialPasteData.activeRange=ws.model.selectionRange.clone(ws.model);window["AscCommon"].g_specialPasteHelper.specialPasteData.pasteFromWord=false}switch(_format){case AscCommon.c_oAscClipboardDataFormat.HtmlElement:{if(wb.getCellEditMode()){var fragments;if(window["AscCommon"].g_clipboardBase.bSaveFormat)fragments=this.pasteProcessor._getFragmentsFromHtml(data1);if(fragments){var pasteFragments=fragments.fragments; var newFonts=fragments.fonts;ws._loadFonts(newFonts,function(){cellEditor.paste(pasteFragments);window["AscCommon"].g_specialPasteHelper.Paste_Process_End();if(cellEditor.getMenuEditorMode())window["Asc"]["editor"].asc_enableKeyEvents(true)})}else this._pasteTextInCellEditor(text_data||data1.innerText)}else t.pasteProcessor.editorPasteExec(ws,data1);break}case AscCommon.c_oAscClipboardDataFormat.Internal:{if(wb.getCellEditMode())if(null!==text_data&&undefined!==text_data)this._pasteTextInCellEditor(text_data); else this._pasteTextInCellEditor(this.pasteProcessor.pasteFromBinary(ws,data1,true));else t.pasteProcessor.pasteFromBinary(ws,data1,null,isPasteAll);break}case AscCommon.c_oAscClipboardDataFormat.Text:{if(wb.getCellEditMode())this._pasteTextInCellEditor(data1);else t.pasteProcessor.pasteTextOnSheet(ws,data1);break}}if(!bIsSpecialPaste){window["AscCommon"].g_specialPasteHelper.specialPasteData._format=_format;window["AscCommon"].g_specialPasteHelper.specialPasteData.data1=data1;window["AscCommon"].g_specialPasteHelper.specialPasteData.data2= data2;window["AscCommon"].g_specialPasteHelper.specialPasteData.text_data=text_data}};Clipboard.prototype._pasteTextInCellEditor=function(text){if(!text)return;var editor=window["Asc"]["editor"];AscFonts.FontPickerByCharacter.getFontsByString(text);editor._loadFonts([],function(){editor.wb.skipHelpSelector=true;editor.wb.cellEditor.pasteText(text);AscCommon.g_specialPasteHelper.Paste_Process_End();editor.wb.skipHelpSelector=false;if(editor.wb.cellEditor.getMenuEditorMode())editor.asc_enableKeyEvents(true)})}; function CopyProcessorExcel(){}CopyProcessorExcel.prototype={constructor:CopyProcessorExcel,getHtml:function(range,worksheet){var t=this;var sBase64=null;var objectRender=worksheet.objectRender;var isIntoShape=objectRender.controller.getTargetDocContent();History.TurnOff();if(copyPasteUseBinary)sBase64=this.getBinaryForCopy(worksheet.model,worksheet.objectRender);History.TurnOn();var innerHtml=t._generateHtml(range,worksheet,isIntoShape,sBase64);if(innerHtml===false)return null;return{base64:sBase64, html:innerHtml}},getBinaryForCopy:function(wsModel,objectRender,activeRange,selectAll,ignoreCopyPaste){var isIntoShape=objectRender&&objectRender.controller?objectRender.controller.getTargetDocContent():null;var sBase64=null;if(isIntoShape)sBase64=this._getBinaryShapeContent(isIntoShape);else{pptx_content_writer.Start_UseFullUrl();pptx_content_writer.BinaryFileWriter.ClearIdMap();var unselectedIndexes=[];if(selectAll){activeRange=new Asc.Range(0,0,AscCommon.gc_nMaxCol-1,AscCommon.gc_nMaxRow-1);for(var i= 0;i<wsModel.Drawings.length;i++)if(!wsModel.Drawings[i].graphicObject.selected){unselectedIndexes[i]=true;wsModel.Drawings[i].graphicObject.selected=true}}var selectionRange=activeRange?activeRange:wsModel.selectionRange.getLast();var maxRowCol=this._getRangeMaxRowCol(wsModel,selectionRange);if(null!==maxRowCol){if(maxRowCol.col<selectionRange.c1)maxRowCol.col=selectionRange.c1;if(maxRowCol.row<selectionRange.r1)maxRowCol.row=selectionRange.r1;selectionRange=new Asc.Range(selectionRange.c1,selectionRange.r1, maxRowCol.col,maxRowCol.row)}var wb=wsModel.workbook;var isNullCore=false;if(!wb.Core){isNullCore=true;wb.Core=new window["AscCommon"].CCore}var oldCreator=wb.Core.creator;var oldIdentifier=wb.Core.identifier;var oldLanguage=wb.Core.language;wb.Core.creator=wb.oApi&&wb.oApi.CoAuthoringApi?wb.oApi.CoAuthoringApi.getUserConnectionId():null;wb.Core.identifier=wb.oApi&&wb.oApi.DocInfo?wb.oApi.DocInfo.Id:null;var oldSubject=wb.Core.subject;var objectRender=Asc.editor.wb.getWorksheet().objectRender;var _imgProperty= objectRender&&objectRender.controller&&objectRender.controller.getSelectionImage();if(_imgProperty){var _base64=_imgProperty.asc_getImageUrl();var _width=_imgProperty.Width;var _height=_imgProperty.Height;wb.Core.subject=_width+";"+_height+";"+_base64}var locale=wb.oApi?wb.oApi.asc_getLocale():null;wb.Core.language=undefined!==locale&&null!==locale?locale.toString():null;var oBinaryFileWriter=new AscCommonExcel.BinaryFileWriter(wb,!ignoreCopyPaste?selectionRange:false);sBase64="xslData;"+oBinaryFileWriter.Write(); pptx_content_writer.BinaryFileWriter.ClearIdMap();pptx_content_writer.End_UseFullUrl();if(selectAll)for(i in unselectedIndexes)wsModel.Drawings[i].graphicObject.selected=false;if(isNullCore)wb.Core=null;else{wb.Core.creator=oldCreator;wb.Core.identifier=oldIdentifier;wb.Core.language=oldLanguage;wb.Core.subject=oldSubject}}return sBase64},_getRangeMaxRowCol:function(worksheet,selectionRange,range3){var res=null;var type=selectionRange.getType();var oType=Asc.c_oAscSelectionType;if(type===oType.RangeCol|| type===oType.RangeRow||type===oType.RangeMax){if(!range3)range3=worksheet.getRange3(selectionRange.r1,selectionRange.c1,selectionRange.r2,selectionRange.c2);var maxRow=0;var maxCol=0;range3._foreachNoEmpty(function(cell){if(cell.nCol>maxCol)maxCol=cell.nCol;if(cell.nRow>maxRow)maxRow=cell.nRow});res={col:maxCol,row:maxRow}}return res},_getBinaryShapeContent:function(isIntoShape){var sBase64;var selectedContent=new CSelectedContent;AscFormat.ExecuteNoHistory(function(){isIntoShape.GetSelectedContent(selectedContent)}, this,[]);if(!selectedContent||!selectedContent.Elements||!selectedContent.Elements.length)return null;var oPresentationWriter=new AscCommon.CBinaryFileWriter;oPresentationWriter.WriteString2("");oPresentationWriter.WriteString2("");oPresentationWriter.WriteDouble(1);oPresentationWriter.WriteDouble(1);oPresentationWriter.WriteBool(true);oPresentationWriter.WriteULong(1);if(selectedContent){var docContent=selectedContent;if(docContent.Elements){var elements=docContent.Elements;oPresentationWriter.WriteString2("SelectedContent"); oPresentationWriter.WriteULong(1);oPresentationWriter.WriteULong(1);oPresentationWriter.WriteULong(1);oPresentationWriter.WriteString2("DocContent");oPresentationWriter.WriteDouble(elements.length);for(var Index=0;Index<elements.length;Index++){var Item;if(elements[Index].Element)Item=elements[Index].Element;else Item=elements[Index];if(type_Paragraph===Item.GetType()){oPresentationWriter.StartRecord(0);oPresentationWriter.WriteParagraph(Item);oPresentationWriter.EndRecord()}}sBase64=oPresentationWriter.GetBase64Memory()}if(null!== sBase64)sBase64="pptData;"+oPresentationWriter.pos+";"+sBase64}return sBase64},getText:function(range,worksheet){var t=this;var res=null;var objectRender=worksheet.objectRender;var isIntoShape=objectRender.controller.getTargetDocContent();if(isIntoShape)res=t._getTextFromShape(isIntoShape);else res=t._getTextFromSheet(range,worksheet);return res},getBinaryForMobile:function(){var api=window["Asc"]["editor"];if(!api||!api.wb)return false;var worksheetView=api.wb.getWorksheet();var objectRender=worksheetView.objectRender; var isIntoShape=objectRender.controller.getTargetDocContent();History.TurnOff();var sBase64=null;if(!isIntoShape)sBase64=this.getBinaryForCopy(worksheetView.model,worksheetView.objectRender);History.TurnOn();var selectedImages=objectRender.getSelectedGraphicObjects();var drawingUrls=[];if(selectedImages&&selectedImages.length){var correctUrl,graphicObj;for(var i=0;i<selectedImages.length;i++){graphicObj=selectedImages[i];if(graphicObj.isImage())if(window["NativeCorrectImageUrlOnCopy"]){correctUrl= window["NativeCorrectImageUrlOnCopy"](graphicObj.getImageUrl());drawingUrls[i]=correctUrl}else drawingUrls[i]=graphicObj.getBase64Img()}}return{sBase64:sBase64,drawingUrls:drawingUrls}},_generateHtml:function(range,worksheet,isIntoShape,sBase64){var isSelectedImages=this._getSelectedDrawingIndex(worksheet);var htmlObj,container;if(isIntoShape){var selectedContent=new CSelectedContent;AscFormat.ExecuteNoHistory(function(){isIntoShape.GetSelectedContent(selectedContent)},this,[]);var oCopyProcessor= new AscCommon.CopyProcessor({WordControl:{m_oLogicDocument:isIntoShape}});oCopyProcessor.CopyDocument2(oCopyProcessor.oRoot,isIntoShape,selectedContent.Elements,true);if(sBase64)if(oCopyProcessor.oRoot&&oCopyProcessor.oRoot.aChildren&&oCopyProcessor.oRoot.aChildren.length>0)oCopyProcessor.oRoot.aChildren[0].oAttributes["class"]=sBase64;return oCopyProcessor.getInnerHtml()}else if(isSelectedImages&&isSelectedImages!==-1){container=doc.createElement("DIV");htmlObj=this._generateHtmlImg(isSelectedImages, worksheet);container.appendChild(htmlObj);if(sBase64&&container.children[0])container.children[0].setAttribute("class",sBase64);return container.innerHTML}else return this._generateHtmlDocStr(range,worksheet,sBase64)},_generateHtmlImg:function(isSelectedImages,worksheet){if(window["Asc"]["editor"]&&window["Asc"]["editor"].isChartEditor)return false;var isImage=false;var objectRender=worksheet.objectRender;objectRender.preCopy();var res=document.createElement("span");var drawings=worksheet.model.Drawings; for(var j=0;j<isSelectedImages.length;++j){var image=drawings[isSelectedImages[j]];var cloneImg=objectRender.cloneDrawingObject(image);var curImage=new Image;var url;if(cloneImg.graphicObject.isChart()&&cloneImg.graphicObject.brush.fill.RasterImageId)url=cloneImg.graphicObject.brush.fill.RasterImageId;else if(cloneImg.graphicObject&&(cloneImg.graphicObject.isShape()||cloneImg.graphicObject.isImage()||cloneImg.graphicObject.isGroup()||cloneImg.graphicObject.isChart())){var altAttr=null;isImage=cloneImg.graphicObject.isImage(); var imageUrl;if(isImage)imageUrl=cloneImg.graphicObject.getImageUrl();if(isImage&&imageUrl)if(window["AscDesktopEditor"]&&window["AscDesktopEditor"]["IsLocalFile"]&&window["AscDesktopEditor"]["IsLocalFile"]())url=cloneImg.graphicObject.getBase64Img();else url=AscCommon.getFullImageSrc2(imageUrl);else url=cloneImg.graphicObject.getBase64Img();curImage.alt=altAttr}else url=cloneImg.image.src;curImage.src=url;curImage.width=cloneImg.getWidthFromTo();curImage.height=cloneImg.getHeightFromTo();if(image.guid)curImage.name= image.guid;res.appendChild(curImage);isImage=true}return res},_generateHtmlDoc:function(range,worksheet){function skipMerged(){var m=merged.filter(function(e){return row>=e.r1&&row<=e.r2&&col>=e.c1&&col<=e.c2});if(m.length>0){col=m[0].c2;return true}return false}function makeBorder(border){if(!border||border.s===c_oAscBorderStyles.None)return"";var style="";switch(border.s){case c_oAscBorderStyles.Thin:style="solid";break;case c_oAscBorderStyles.Medium:style="solid";break;case c_oAscBorderStyles.Thick:style= "solid";break;case c_oAscBorderStyles.DashDot:case c_oAscBorderStyles.DashDotDot:case c_oAscBorderStyles.Dashed:style="dashed";break;case c_oAscBorderStyles.Double:style="double";break;case c_oAscBorderStyles.Hair:case c_oAscBorderStyles.Dotted:style="dotted";break;case c_oAscBorderStyles.MediumDashDot:case c_oAscBorderStyles.MediumDashDotDot:case c_oAscBorderStyles.MediumDashed:case c_oAscBorderStyles.SlantDashDot:style="dashed";break}return border.w+"px "+style+" "+number2color(border.getRgbOrNull())} var fn=worksheet.model.workbook.getDefaultFont();var fs=worksheet.model.workbook.getDefaultSize();var bbox=range.getBBox0();var merged=[];var t=this;var table,tr,td,cell,j,row,col,mbbox,h,w,b;table=document.createElement("TABLE");table.style.display="none";table.cellPadding="0";table.cellSpacing="0";table.style.borderCollapse="collapse";table.style.fontFamily=fn;table.style.fontSize=fs+"pt";table.style.color="#000";table.style.backgroundColor="transparent";var maxRow=bbox.r2;var maxCol=bbox.c2;var maxRowCol= this._getRangeMaxRowCol(worksheet,bbox,range);if(null!==maxRowCol){maxRow=maxRowCol.row;maxCol=maxRowCol.col}for(row=bbox.r1;row<=maxRow;++row){if(worksheet.model.bExcludeHiddenRows&&worksheet.model.getRowHidden(row))continue;tr=document.createElement("TR");h=worksheet.model.getRowHeight(row);if(h>0)tr.style.height=h+"pt";for(col=bbox.c1;col<=maxCol;++col){if(skipMerged())continue;cell=worksheet.model.getCell3(row,col);td=document.createElement("TD");var style="";mbbox=cell.hasMerged();if(mbbox){merged.push(mbbox); td.colSpan=mbbox.c2-mbbox.c1+1;td.rowSpan=mbbox.r2-mbbox.r1+1;for(w=0,j=mbbox.c1;j<=mbbox.c2;++j)w+=worksheet.getColumnWidth(j,1);style+="width:"+w+"pt"+";"}else style+="width:"+worksheet.getColumnWidth(col,1)+"pt"+";";if(cell.getType()!==null){var align=cell.getAlign();if(!align.getWrap())style+="white-space:"+"nowrap"+";";else style+="white-space:"+"normal"+";";switch(align.getAlignHorizontal()){case AscCommon.align_Left:style+="text-align:"+"left"+";";break;case AscCommon.align_Right:style+="text-align:"+ "right"+";";break;case AscCommon.align_Center:style+="text-align:"+"center"+";";break;case AscCommon.align_Justify:style+="text-align:"+"justify"+";";break}switch(align.getAlignVertical()){case Asc.c_oAscVAlign.Bottom:style+="vertical-align:"+"bottom"+";";break;case Asc.c_oAscVAlign.Center:case Asc.c_oAscVAlign.Dist:case Asc.c_oAscVAlign.Just:style+="vertical-align:"+"middle"+";";break;case Asc.c_oAscVAlign.Top:style+="vertical-align:"+"top"+";";break}b=cell.getBorderFull();var _border;if(mbbox){var cellMergeFinish= worksheet.model.getCell3(mbbox.r2,mbbox.c2);var borderMergeCell=cellMergeFinish.getBorderFull();_border=makeBorder(borderMergeCell.r);style+=_border?"border-right:"+_border+";":"";_border=makeBorder(borderMergeCell.b);style+=_border?"border-bottom:"+makeBorder(borderMergeCell.b)+";":""}else{_border=makeBorder(b.r);style+=_border?"border-right:"+makeBorder(b.r)+";":"";_border=makeBorder(b.b);style+=_border?"border-bottom:"+makeBorder(b.b)+";":""}_border=makeBorder(b.l);style+=_border?"border-left:"+ makeBorder(b.l)+";":"";_border=makeBorder(b.t);style+=_border?"border-top:"+makeBorder(b.t)+";":"";b=cell.getFillColor();if(b!=null)style+="background-color:"+number2color(b.getRgb())+";";td.setAttribute("style",style);this._makeNodesFromCellValue(cell.getValue2(),fn,fs,cell).forEach(function(node){td.appendChild(node)})}tr.appendChild(td)}table.appendChild(tr)}return table},_generateHtmlDocStr:function(range,worksheet,sBase64){function skipMerged(){var m=merged.filter(function(e){return row>=e.r1&& row<=e.r2&&col>=e.c1&&col<=e.c2});if(m.length>0){col=m[0].c2;return true}return false}function makeBorder(border){if(!border||border.s===c_oAscBorderStyles.None)return"";var _style="";switch(border.s){case c_oAscBorderStyles.Thin:_style="solid";break;case c_oAscBorderStyles.Medium:_style="solid";break;case c_oAscBorderStyles.Thick:_style="solid";break;case c_oAscBorderStyles.DashDot:case c_oAscBorderStyles.DashDotDot:case c_oAscBorderStyles.Dashed:_style="dashed";break;case c_oAscBorderStyles.Double:_style= "double";break;case c_oAscBorderStyles.Hair:case c_oAscBorderStyles.Dotted:_style="dotted";break;case c_oAscBorderStyles.MediumDashDot:case c_oAscBorderStyles.MediumDashDotDot:case c_oAscBorderStyles.MediumDashed:case c_oAscBorderStyles.SlantDashDot:_style="dashed";break}return border.w+"px "+_style+" "+number2color(border.getRgbOrNull())}var fn=worksheet.model.workbook.getDefaultFont();var fs=worksheet.model.workbook.getDefaultSize();var bbox=range.getBBox0();var merged=[];var t=this;var table,tr, td,cell,j,row,col,mbbox,h,w,b;var str="";str+='<table cellpadding="0" cellSpacing="0"';if(sBase64)str+=" class="+'"'+sBase64+'"';str+=' style="border-collapse: collapse;font-family:'+fn+";font-size:"+fs+"pt"+";color:#000;background-color:transparent;"+'">';var maxRow=bbox.r2;var maxCol=bbox.c2;var maxRowCol=this._getRangeMaxRowCol(worksheet,bbox,range);if(null!==maxRowCol){maxRow=maxRowCol.row;maxCol=maxRowCol.col}for(row=bbox.r1;row<=maxRow;++row){if(worksheet.model.bExcludeHiddenRows&&worksheet.model.getRowHidden(row))continue; str+='<tr style="height:';h=worksheet.model.getRowHeight(row);str+=h+"pt"+'"'+">";for(col=bbox.c1;col<=maxCol;++col){if(skipMerged())continue;str+="<td";var style="";cell=worksheet.model.getCell3(row,col);mbbox=cell.hasMerged();if(mbbox){merged.push(mbbox);str+=" colspan="+(mbbox.c2-mbbox.c1+1);str+=" rowSpan="+(mbbox.r2-mbbox.r1+1);for(w=0,j=mbbox.c1;j<=mbbox.c2;++j)w+=worksheet.getColumnWidth(j,1);style+="width:"+w+"pt"+";"}else style+="width:"+worksheet.getColumnWidth(col,1)+"pt"+";";if(cell.getType()!== null){var align=cell.getAlign();if(!align.getWrap())style+="white-space:"+"nowrap"+";";else style+="white-space:"+"normal"+";";switch(align.getAlignHorizontal()){case AscCommon.align_Left:style+="text-align:"+"left"+";";break;case AscCommon.align_Right:style+="text-align:"+"right"+";";break;case AscCommon.align_Center:style+="text-align:"+"center"+";";break;case AscCommon.align_Justify:style+="text-align:"+"justify"+";";break}switch(align.getAlignVertical()){case Asc.c_oAscVAlign.Bottom:style+="vertical-align:"+ "bottom"+";";break;case Asc.c_oAscVAlign.Center:case Asc.c_oAscVAlign.Dist:case Asc.c_oAscVAlign.Just:style+="vertical-align:"+"middle"+";";break;case Asc.c_oAscVAlign.Top:style+="vertical-align:"+"top"+";";break}b=cell.getBorderFull();var _border;if(mbbox){var cellMergeFinish=worksheet.model.getCell3(mbbox.r2,mbbox.c2);var borderMergeCell=cellMergeFinish.getBorderFull();_border=makeBorder(borderMergeCell.r);style+=_border?"border-right:"+_border+";":"";_border=makeBorder(borderMergeCell.b);style+= _border?"border-bottom:"+makeBorder(borderMergeCell.b)+";":""}else{_border=makeBorder(b.r);style+=_border?"border-right:"+makeBorder(b.r)+";":"";_border=makeBorder(b.b);style+=_border?"border-bottom:"+makeBorder(b.b)+";":""}_border=makeBorder(b.l);style+=_border?"border-left:"+makeBorder(b.l)+";":"";_border=makeBorder(b.t);style+=_border?"border-top:"+makeBorder(b.t)+";":"";b=cell.getFillColor();if(b!=null)style+="background-color:"+number2color(b.getRgb())+";";str+=" style="+'"'+style+'">';str+= this._makeNodesFromCellValueStr(cell.getValue2(),fn,fs,cell)}else str+=">";str+="</td>"}str+="</tr>"}str+="</table>";return str},_getSelectedDrawingIndex:function(worksheet){if(!worksheet)return false;var images=worksheet.model.Drawings;var n=0;var arrImages=[];if(images)for(var i=0;i<images.length;i++)if(images[i].graphicObject&&images[i].graphicObject.selected===true){arrImages[n]=i;n++}if(n===0)return-1;else return arrImages},_makeNodesFromCellValue:function(val,defFN,defFS,cell){var i,res,span, f;function getTextDecoration(format){var res=[];if(Asc.EUnderline.underlineNone!==format.getUnderline())res.push("underline");if(format.getStrikeout())res.push("line-through");return res.length>0?res.join(","):""}var hyperlink;if(cell)hyperlink=cell.getHyperlink();for(res=[],i=0;i<val.length;++i){if(val[i]&&val[i].format&&val[i].format.getSkip())continue;if(cell==undefined||cell!=undefined&&(hyperlink==null||hyperlink!=null&&hyperlink.getLocation()!=null))span=doc.createElement("SPAN");else{span= doc.createElement("A");if(hyperlink.Hyperlink!=null)span.href=hyperlink.Hyperlink;else if(hyperlink.getLocation()!=null)span.href="#"+hyperlink.getLocation();if(hyperlink.Tooltip!=null)span.title=hyperlink.Tooltip}var text=val[i].text;var isBr=val[i].text.indexOf("\n");span.textContent=text;f=val[i].format;var fn=f.getName();var fs=f.getSize();var fc=f.getColor();var va=f.getVerticalAlign();var style="";if(fc&&fc.rgb!==0)style+="color:"+number2color(fc.getRgb())+";";if(fn!==defFN)style+="font-family:"+ fn+";";if(fs!==defFS)style+="font-size:"+fs+"pt"+";";if(f.getBold())style+="font-weight:"+"bold"+";";if(f.getItalic())style+="font-style:"+"italic"+";";var textDecoration=getTextDecoration(f);if(textDecoration)style+="text-decoration:"+textDecoration+";";var verticalAlign=va===AscCommon.vertalign_SubScript?"sub":va===AscCommon.vertalign_SuperScript?"super":"baseline";style+="vertical-align:"+verticalAlign+";";span.setAttribute("style",style);if(isBr!==-1)span.innerHTML=span.innerHTML.replace(/\n/g, "<br>");res.push(span)}return res},_makeNodesFromCellValueStr:function(val,defFN,defFS,cell){var i,res,span,f;function getTextDecoration(format){var res=[];if(Asc.EUnderline.underlineNone!==format.getUnderline())res.push("underline");if(format.getStrikeout())res.push("line-through");return res.length>0?res.join(","):""}var str="";var hyperlink;if(cell)hyperlink=cell.getHyperlink();for(res=[],i=0;i<val.length;++i){if(val[i]&&val[i].format&&val[i].format.getSkip())continue;if(cell==undefined||cell!= undefined&&(hyperlink==null||hyperlink!=null&&hyperlink.getLocation()!=null))str+="<span ";else{str+="<a";if(hyperlink.Hyperlink!=null)str+=" href="+'"'+hyperlink.Hyperlink+'"';else if(hyperlink.getLocation()!=null)str+=" href="+'"'+"#"+hyperlink.getLocation()+'"';if(hyperlink.Tooltip)str+=" title="+'"'+hyperlink.Tooltip+'" '}var text=val[i].text.replace(/\n/g,"<br>");f=val[i].format;var fn=f.getName();var fs=f.getSize();var fc=f.getColor();var va=f.getVerticalAlign();var style="";if(fc&&fc.rgb!== 0)style+="color:"+number2color(fc.getRgb())+";";if(fn!==defFN)style+="font-family:"+fn+";";if(fs!==defFS)style+="font-size:"+fs+"pt"+";";if(f.getBold())style+="font-weight:"+"bold"+";";if(f.getItalic())style+="font-style:"+"italic"+";";var textDecoration=getTextDecoration(f);if(textDecoration)style+="text-decoration:"+textDecoration+";";var verticalAlign=va===AscCommon.vertalign_SubScript?"sub":va===AscCommon.vertalign_SuperScript?"super":"baseline";style+="vertical-align:"+verticalAlign+";";str+= ' style="'+style+'">';str+=text+"</span>"}return str},_getTextFromShape:function(documentContent){var res=null;if(documentContent&&documentContent.Content&&documentContent.Content.length)for(var i=0;i<documentContent.Content.length;i++)if(documentContent.Content[i]){var paraText=documentContent.Content[i].GetSelectedText();if(paraText){if(null===res)res="";if(i!==0)res+="\r\n";res+=paraText}}return res},_getTextFromSheet:function(range,worksheet){var res=null;var t=this;if(range){var bbox=range.bbox; var maxRow=bbox.r2;var maxCol=bbox.c2;var maxRowCol=this._getRangeMaxRowCol(worksheet.model,bbox,range);if(null!==maxRowCol){maxRow=maxRowCol.row;maxCol=maxRowCol.col}res="";for(var row=bbox.r1;row<=maxRow;++row){if(worksheet.model.bExcludeHiddenRows&&worksheet.model.getRowHidden(row))continue;if(row!==bbox.r1)res+="\r\n";for(var col=bbox.c1;col<=maxCol;++col){if(col!==bbox.c1)res+="\t";var currentRange=worksheet.model.getCell3(row,col);var textRange=currentRange.getValueWithFormat();if(textRange!== "")res+=textRange}}}return res}};function PasteProcessorExcel(){this.activeRange=null;this.alreadyLoadImagesOnServer=false;this.fontsNew={};this.oImages={};this.multipleSettings=null}PasteProcessorExcel.prototype={constructor:PasteProcessorExcel,clean:function(){this.activeRange=null;this.alreadyLoadImagesOnServer=false;this.fontsNew={};this.oImages={};this.multipleSettings=null},pasteFromBinary:function(worksheet,binary,isCellEditMode,isPasteAll){var base64=null,base64FromWord=null,base64FromPresentation= null,t=this;if(binary.indexOf("xslData;")>-1)base64=binary.split("xslData;")[1];else if(binary.indexOf("docData;")>-1)base64FromWord=binary.split("docData;")[1];else if(binary.indexOf("pptData;")>-1)base64FromPresentation=binary.split("pptData;")[1];var result=false;var objectRender=worksheet.objectRender;var isIntoShape=objectRender&&objectRender.controller&&objectRender.controller.getTargetDocContent();if(base64!=null)result=this._pasteFromBinaryExcel(worksheet,base64,isIntoShape,isCellEditMode, isPasteAll);else if(base64FromWord){this.activeRange=worksheet.model.selectionRange.getLast().clone(true);result=this._pasteFromBinaryWord(worksheet,base64FromWord,isIntoShape,isCellEditMode);window["AscCommon"].g_specialPasteHelper.specialPasteData.pasteFromWord=true}else if(base64FromPresentation)result=this._pasteFromBinaryPresentation(worksheet,base64FromPresentation,isIntoShape,isCellEditMode);return result},_pasteFromBinaryExcel:function(worksheet,base64,isIntoShape,isCellEditMode,isPasteAll){var t= this;var newFonts;var tempWorkbook=new AscCommonExcel.Workbook;tempWorkbook.DrawingDocument=Asc.editor.wbModel.DrawingDocument;var aPastedImages=this._readExcelBinary(base64,tempWorkbook);if(!isIntoShape&&this._checkCutBefore(worksheet,tempWorkbook))return;var pasteData=null;if(tempWorkbook)pasteData=tempWorkbook.aWorksheets[0];if(isPasteAll){History.Create_NewPoint();History.StartTransaction()}var doPasteData=function(){newFonts={};newFonts=tempWorkbook.generateFontMap2();newFonts=t._convertFonts(newFonts); if(isPasteAll)window["AscCommon"].g_specialPasteHelper.Special_Paste_Hide_Button();worksheet.setSelectionInfo("paste",{data:pasteData,fromBinary:true,fontsNew:newFonts,pasteAllSheet:isPasteAll})};var doPasteIntoShape=function(){History.TurnOff();var docContent=t._convertTableFromExcelToDocument(worksheet,pasteData,isIntoShape);History.TurnOn();var callback=function(isSuccess){if(isSuccess)t._insertBinaryIntoShapeContent(worksheet,[docContent]);window["AscCommon"].g_specialPasteHelper.Paste_Process_End()}; worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback)};var res=false;if(isCellEditMode)res=this._getTextFromWorksheet(pasteData);else if(pasteData){if(pasteData.Drawings&&pasteData.Drawings.length)if(window["IS_NATIVE_EDITOR"]){t._insertImagesFromBinary(worksheet,pasteData,isIntoShape,null,isPasteAll,tempWorkbook);if(isPasteAll)doPasteData()}else if(window["NativeCorrectImageUrlOnPaste"]){var url;for(var i=0,length=aPastedImages.length;i<length;++i){url=window["NativeCorrectImageUrlOnPaste"](aPastedImages[i].Url); aPastedImages[i].Url=url;var imageElem=aPastedImages[i];if(null!=imageElem)imageElem.SetUrl(url)}t._insertImagesFromBinary(worksheet,pasteData,isIntoShape,null,isPasteAll,tempWorkbook);if(isPasteAll)doPasteData()}else{if(!(window["Asc"]["editor"]&&window["Asc"]["editor"].isChartEditor)){newFonts={};for(var i=0;i<pasteData.Drawings.length;i++)pasteData.Drawings[i].graphicObject.getAllFonts(newFonts);worksheet._loadFonts(newFonts,function(){if(aPastedImages&&aPastedImages.length)t._loadImagesOnServer(aPastedImages, function(){t._insertImagesFromBinary(worksheet,pasteData,isIntoShape,null,isPasteAll,tempWorkbook);if(isPasteAll)doPasteData()});else{t._insertImagesFromBinary(worksheet,pasteData,isIntoShape,null,isPasteAll,tempWorkbook);if(isPasteAll)doPasteData()}})}}else if(isIntoShape)doPasteIntoShape();else if(this._checkPasteFromBinaryExcel(worksheet,true,pasteData))doPasteData();res=true}return res},_readExcelBinary:function(base64,tempWorkbook,selectAllSheet){var oBinaryFileReader=new AscCommonExcel.BinaryFileReader(true); oBinaryFileReader.copyPasteObj.selectAllSheet=selectAllSheet;var t=this;var aPastedImages;AscFormat.ExecuteNoHistory(function(){pptx_content_loader.Start_UseFullUrl();pptx_content_loader.Reader.ClearConnectorsMaps();oBinaryFileReader.Read(base64,tempWorkbook);t.activeRange=oBinaryFileReader.copyPasteObj.activeRange;aPastedImages=pptx_content_loader.End_UseFullUrl();pptx_content_loader.Reader.AssignConnectorsId()},this,[]);return aPastedImages},_checkCutBefore:function(ws,pastedWb){var res=false;if(this._checkPastedInOriginalDoc(pastedWb)&& null!==window["Asc"]["editor"].wb.cutIdSheet){var wsFrom=window["Asc"]["editor"].wb.getWorksheetById(window["Asc"]["editor"].wb.cutIdSheet);var fromRange=wsFrom?wsFrom.cutRange:null;if(fromRange){var aRange=ws.model.selectionRange.getLast();var toRange=new Asc.Range(aRange.c1,aRange.r1,aRange.c1+(fromRange.c2-fromRange.c1),aRange.r1+(fromRange.r2-fromRange.r1));var wsTo=ws.model.Id!==wsFrom.model.Id?ws:null;wsFrom.applyCutRange(fromRange,toRange,wsTo);ws.handlers.trigger("cleanCutData",true);res= true;AscCommon.g_clipboardBase.needClearBuffer=true}}return res},_checkPastedInOriginalDoc:function(pastedWb){var res=false;var api=window["Asc"]["editor"];var curDocId=api.DocInfo&&api.DocInfo.Id;var curUserId=api.CoAuthoringApi&&api.CoAuthoringApi.getUserConnectionId();if(pastedWb&&pastedWb.Core&&pastedWb.Core.identifier===curDocId&&pastedWb.Core.creator===curUserId)res=true;return res},_pasteFromBinaryWord:function(worksheet,base64,isIntoShape,isCellEditMode){var res=true;var t=this;var pasteData= this.ReadFromBinaryWord(base64,worksheet);if(isCellEditMode)res=this._getTextFromWord(pasteData.content);else if(isIntoShape){var callback=function(isSuccess){if(isSuccess)t._insertBinaryIntoShapeContent(worksheet,pasteData.content,true);window["AscCommon"].g_specialPasteHelper.Paste_Process_End()};worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback)}else{var oPasteFromBinaryWord=new pasteFromBinaryWord(this,worksheet);oPasteFromBinaryWord._paste(worksheet,pasteData)}return res}, _pasteFromBinaryPresentation:function(worksheet,base64,isIntoShape,isCellEditMode){pptx_content_loader.Clear();var _stream=AscFormat.CreateBinaryReader(base64,0,base64.length);var stream=new AscCommon.FileStream(_stream.data,_stream.size);var p_url=stream.GetString2();var p_theme=stream.GetString2();var p_width=stream.GetULong()/1E5;var p_height=stream.GetULong()/1E5;var t=this;var bIsMultipleContent=stream.GetBool();var selectedContent2=[],i;if(true===bIsMultipleContent){var multipleParamsCount= stream.GetULong();for(i=0;i<multipleParamsCount;i++)selectedContent2.push(this._readPresentationSelectedContent(stream,worksheet))}var specialOptionsArr=[];var specialProps=Asc.c_oSpecialPasteProps;if(2===multipleParamsCount)specialOptionsArr=[specialProps.sourceformatting];else if(3===multipleParamsCount)specialOptionsArr=[specialProps.sourceformatting,specialProps.picture];var defaultSelectedContent=selectedContent2[1]?selectedContent2[1]:selectedContent2[0];var bSlideObjects=defaultSelectedContent&& defaultSelectedContent.content.SlideObjects&&defaultSelectedContent.content.SlideObjects.length>0;var pasteObj=bSlideObjects?selectedContent2[2]:defaultSelectedContent;if(window["AscCommon"].g_specialPasteHelper.specialPasteStart){var props=window["AscCommon"].g_specialPasteHelper.specialPasteProps.property;switch(props){case Asc.c_oSpecialPasteProps.picture:{if(selectedContent2[2])pasteObj=selectedContent2[2];break}}}var arr_Images,fonts,content=null;if(pasteObj){arr_Images=pasteObj.images;fonts= pasteObj.fonts;content=pasteObj.content}if(null===content){window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return}if(content.DocContent){var docContent=content.DocContent.Elements;if(isCellEditMode){var text=this._getTextFromWord(docContent);window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return text}else if(isIntoShape){var callback=function(isSuccess){if(isSuccess)t._insertBinaryIntoShapeContent(worksheet,docContent); window["AscCommon"].g_specialPasteHelper.Paste_Process_End()};worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback);return true}else{History.TurnOff();var oPasteFromBinaryWord=new pasteFromBinaryWord(this,worksheet,true);var oTempDrawingDocument=window["Asc"]["editor"].wbModel.getDrawingDocument();var newCDocument=new CDocument(oTempDrawingDocument,false);newCDocument.bFromDocument=true;newCDocument.theme=window["Asc"]["editor"].wbModel.theme;var newContent=[];for(i=0;i<docContent.length;i++)if(type_Paragraph=== docContent[i].GetType()){docContent[i]=AscFormat.ConvertParagraphToWord(docContent[i],newCDocument);docContent[i].bFromDocument=true;newContent.push(docContent[i])}else if(type_Table===docContent[i].GetType());docContent=newContent;History.TurnOn();oPasteFromBinaryWord._paste(worksheet,{content:docContent})}}else if(content.Drawings){if(isCellEditMode)return"";if(!bSlideObjects){window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();specialProps=window["AscCommon"].g_specialPasteHelper.buttonInfo; if(specialOptionsArr.length>1)specialProps.asc_setOptions(specialOptionsArr)}var arr_shapes=content.Drawings;if(arr_shapes&&arr_shapes.length&&!(window["Asc"]["editor"]&&window["Asc"]["editor"].isChartEditor)){if(!bSlideObjects&&content.Drawings.length===selectedContent2[1].content.Drawings.length){var oEndContent={Drawings:[]};var oSourceContent={Drawings:[]};for(i=0;i<content.Drawings.length;++i){oEndContent.Drawings.push({Drawing:content.Drawings[i].graphicObject});oSourceContent.Drawings.push({Drawing:selectedContent2[1].content.Drawings[i].graphicObject})}AscFormat.checkDrawingsTransformBeforePaste(oEndContent, oSourceContent,null)}var newFonts={};for(i=0;i<arr_shapes.length;i++)arr_shapes[i].graphicObject.getAllFonts(newFonts);var aPastedImages=arr_Images;worksheet._loadFonts(newFonts,function(){if(aPastedImages&&aPastedImages.length)t._loadImagesOnServer(aPastedImages,function(){t._insertImagesFromBinary(worksheet,{Drawings:arr_shapes},isIntoShape,true)});else t._insertImagesFromBinary(worksheet,{Drawings:arr_shapes},isIntoShape,true)})}return true}},_readPresentationSelectedContent:function(stream,worksheet){var presentationSelectedContent= null;var fonts=[];var arr_Images={};var oThis=this;var loader=new AscCommon.BinaryPPTYLoader;loader.presentation=worksheet.model;loader.DrawingDocument=worksheet.getDrawingDocument();loader.stream=stream;var readContent=function(){var docContent=oThis.ReadPresentationText(stream,worksheet);if(docContent.length===0)return;presentationSelectedContent.DocContent=new CSelectedContent;presentationSelectedContent.DocContent.Elements=docContent;for(var i in oThis.oFonts)fonts.push(new AscFonts.CFont(i,0, "",0))};var readDrawings=function(){var objects=oThis.ReadPresentationShapes(stream,worksheet);presentationSelectedContent.Drawings=objects.arrShapes;var arr_shapes=objects.arrShapes;var font_map={},i;for(i=0;i<arr_shapes.length;++i)if(arr_shapes[i].graphicObject.getAllFonts)arr_shapes[i].graphicObject.getAllFonts(font_map);for(i in font_map)fonts.push(new AscFonts.CFont(i,0,"",0));arr_Images=objects.arrImages};var skipIndexes=function(){var count=stream.GetULong();var array=[];for(var i=0;i<count;++i)stream.GetULong()}; var skip1=function(){var selected_objs=loader.stream.GetULong();for(var i=0;i<selected_objs;++i){loader.stream.GetUChar();loader.stream.SkipRecord()}};var first_content=stream.GetString2();if(first_content==="SelectedContent"){var PresentationWidth=stream.GetULong()/1E5;var PresentationHeight=stream.GetULong()/1E5;var countContent=stream.GetULong();for(var i=0;i<countContent;i++){if(null===presentationSelectedContent)presentationSelectedContent=typeof PresentationSelectedContent!=="undefined"?new PresentationSelectedContent: {};var first_string=stream.GetString2();switch(first_string){case "DocContent":{readContent(stream,worksheet);break}case "Drawings":{readDrawings();break}case "SlideObjects":{presentationSelectedContent.SlideObjects=[null];skip1();break}case "LayoutsIndexes":{skipIndexes();break}case "MastersIndexes":{skipIndexes();break}case "NotesMastersIndexes":{skipIndexes();break}case "ThemeIndexes":{skipIndexes();break}default:{skip1()}}}}return{content:presentationSelectedContent,fonts:fonts,images:arr_Images}}, _insertBinaryIntoShapeContent:function(worksheet,content,isConvertToPPTX){if(!content||!content.length)return;History.Create_NewPoint();History.StartTransaction();var isIntoShape=worksheet.objectRender.controller.getTargetDocContent(true);isIntoShape.Remove(1,true,true);var insertContent=new CSelectedContent;var target_doc_content=isIntoShape;insertContent.Elements=this._convertBeforeInsertIntoShapeContent(worksheet,content,isConvertToPPTX,target_doc_content);var specialPasteProps=window["AscCommon"].g_specialPasteHelper.specialPasteProps; if(specialPasteProps&&!specialPasteProps.format)for(var i=0;i<insertContent.Elements.length;i++)insertContent.Elements[i].Element.Clear_TextFormatting();this._insertSelectedContentIntoShapeContent(worksheet,insertContent,target_doc_content);History.EndTransaction();worksheet.objectRender.controller.startRecalculate();this._setShapeSpecialPasteProperties(worksheet,isIntoShape)},_setShapeSpecialPasteProperties:function(worksheet,isIntoShape){var oInfo=new CSelectedElementsInfo;var mathObj=oInfo.GetMath(); if(null===mathObj){var sProps=Asc.c_oSpecialPasteProps;var curShape=isIntoShape.Parent.parent;var asc_getcvt=Asc.getCvtRatio;var mmToPx=asc_getcvt(3,0,worksheet._getPPIX());var cellsLeft=worksheet.cellsLeft;var cellsTop=worksheet.cellsTop;var cursorPos=isIntoShape.GetCursorPosXY();var offsetX=worksheet._getColLeft(worksheet.visibleRange.c1)-cellsLeft;var offsetY=worksheet._getRowTop(worksheet.visibleRange.r1)-cellsTop;var posX=curShape.transformText.TransformPointX(cursorPos.X,cursorPos.Y)*mmToPx- offsetX+cellsLeft;var posY=curShape.transformText.TransformPointY(cursorPos.X,cursorPos.Y)*mmToPx-offsetY+cellsTop;if(AscCommon.AscBrowser.isRetina){posX=AscCommon.AscBrowser.convertToRetinaValue(posX);posY=AscCommon.AscBrowser.convertToRetinaValue(posY)}var position={x:posX,y:posY};var allowedSpecialPasteProps=[sProps.sourceformatting,sProps.destinationFormatting];window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.buttonInfo.asc_setOptions(allowedSpecialPasteProps); window["AscCommon"].g_specialPasteHelper.buttonInfo.setPosition(position);window["AscCommon"].g_specialPasteHelper.buttonInfo.setRange(cursorPos);window["AscCommon"].g_specialPasteHelper.buttonInfo.setShapeId(isIntoShape.Id)}},_convertBeforeInsertIntoShapeContent:function(worksheet,content,isConvertToPPTX,target_doc_content){var elements=[],selectedElement,element;var bRemoveHyperlink=false;if(target_doc_content&&target_doc_content.Is_ChartTitleContent&&target_doc_content.Is_ChartTitleContent())bRemoveHyperlink= true;for(var i=0;i<content.length;i++){selectedElement=new CSelectedElement;element=content[i];if(type_Paragraph===element.GetType()){selectedElement.Element=AscFormat.ConvertParagraphToPPTX(element,worksheet.getDrawingDocument(),target_doc_content,true,bRemoveHyperlink);elements.push(selectedElement)}else if(type_Table===element.GetType()){var paragraphs=[];element.GetAllParagraphs({All:true},paragraphs);for(var j=0;j<paragraphs.length;j++){selectedElement=new CSelectedElement;selectedElement.Element= AscFormat.ConvertParagraphToPPTX(paragraphs[j],worksheet.getDrawingDocument(),target_doc_content,true,bRemoveHyperlink);elements.push(selectedElement)}}}return elements},_insertSelectedContentIntoShapeContent:function(worksheet,selectedContent,target_doc_content){var paragraph=target_doc_content.Content[target_doc_content.CurPos.ContentPos];if(null!=paragraph&&type_Paragraph===paragraph.GetType()&&selectedContent.Elements&&selectedContent.Elements.length){var NearPos,ParaNearPos,LastClass,Element; selectedContent.On_EndCollectElements(target_doc_content,false);NearPos={Paragraph:paragraph,ContentPos:paragraph.Get_ParaContentPos(false,false)};paragraph.Check_NearestPos(NearPos);ParaNearPos=NearPos.Paragraph.Get_ParaNearestPos(NearPos);if(null===ParaNearPos||ParaNearPos.Classes.length<2)return;LastClass=ParaNearPos.Classes[ParaNearPos.Classes.length-1];if(para_Math_Run===LastClass.Type){Element=selectedContent.Elements[0].Element;if(1!==selectedContent.Elements.length||type_Paragraph!==Element.Get_Type()|| null===LastClass.Parent)return;if(!selectedContent.CanConvertToMath){var Math=null;var Count=Element.Content.length;for(var Index=0;Index<Count;Index++){var Item=Element.Content[Index];if(para_Math===Item.Type&&null===Math)Math=Element.Content[Index];else if(true!==Item.Is_Empty({SkipEnd:true}))return}}}else if(para_Run!==LastClass.Type)return;if(null===paragraph.Parent||undefined===paragraph.Parent)return;var Para=NearPos.Paragraph;ParaNearPos=Para.Get_ParaNearestPos(NearPos);LastClass=ParaNearPos.Classes[ParaNearPos.Classes.length- 1];var bInsertMath=false;if(para_Math_Run===LastClass.Type){var NewMathRun=LastClass.Split(ParaNearPos.NearPos.ContentPos,ParaNearPos.Classes.length-1);var MathContent=ParaNearPos.Classes[ParaNearPos.Classes.length-2];var MathContentPos=ParaNearPos.NearPos.ContentPos.Data[ParaNearPos.Classes.length-2];Element=selectedContent.Elements[0].Element;var InsertMathContent=null;for(var nPos=0,nParaLen=Element.Content.length;nPos<nParaLen;nPos++)if(para_Math===Element.Content[nPos].Type){InsertMathContent= Element.Content[nPos];break}if(null===InsertMathContent)InsertMathContent=selectedContent.ConvertToMath();if(null!==InsertMathContent){MathContent.Add_ToContent(MathContentPos+1,NewMathRun);MathContent.Insert_MathContent(InsertMathContent.Root,MathContentPos+1,true);bInsertMath=true}}if(!bInsertMath){paragraph.Check_NearestPos(NearPos);target_doc_content.InsertContent(selectedContent,NearPos)}var oTargetTextObject=AscFormat.getTargetTextObject(worksheet.objectRender.controller);oTargetTextObject&& oTargetTextObject.checkExtentsByDocContent&&oTargetTextObject.checkExtentsByDocContent();worksheet.objectRender.controller.startRecalculate();worksheet.objectRender.controller.cursorMoveRight(false,false)}},_insertImagesFromBinary:function(ws,data,isIntoShape,needShowSpecialProps,savePosition,pastedWb){var activeCell=ws.model.selectionRange.activeCell;var curCol,drawingObject,curRow,startCol,startRow,xfrm,aImagesSync=[],activeRow,activeCol,tempArr,offX,offY,rot;drawingObject=data.Drawings[0];if(data.Drawings.length=== 1&&typeof AscFormat.CGraphicFrame!=="undefined"&&drawingObject.graphicObject instanceof AscFormat.CGraphicFrame){this._insertTableFromPresentation(ws,data.Drawings[0]);return}if(window["Asc"]["editor"].collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;History.Create_NewPoint();History.StartTransaction();var _abortPaste=function(_error){window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.Paste_Process_End();if(_error)ws.handlers.trigger("onErrorEvent", Asc.c_oAscError.ID.PasteSlicerError,Asc.c_oAscError.Level.NoCritical);History.EndTransaction()};var callback=function(success,slicersNames){if(!success){_abortPaste();return}var graphicObject,i;for(i=0;i<data.Drawings.length;i++){drawingObject=data.Drawings[i];graphicObject=drawingObject.graphicObject;xfrm=graphicObject.spPr.xfrm;if(xfrm){offX=0;offY=0;rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;rot=AscFormat.normalizeRotate(rot);if(AscFormat.checkNormalRotate(rot)){if(AscFormat.isRealNumber(xfrm.offX)&& AscFormat.isRealNumber(xfrm.offY)){offX=xfrm.offX;offY=xfrm.offY}}else if(AscFormat.isRealNumber(xfrm.offX)&&AscFormat.isRealNumber(xfrm.offY)&&AscFormat.isRealNumber(xfrm.extX)&&AscFormat.isRealNumber(xfrm.extY)){offX=xfrm.offX+xfrm.extX/2-xfrm.extY/2;offY=xfrm.offY+xfrm.extY/2-xfrm.extX/2}if(i===0){startCol=offX;startRow=offY}else{if(startCol>offX)startCol=offX;if(startRow>offY)startRow=offY}}else if(i===0){startCol=drawingObject.from.col;startRow=drawingObject.from.row}else{if(startCol>drawingObject.from.col)startCol= drawingObject.from.col;if(startRow>drawingObject.from.row)startRow=drawingObject.from.row}}var aCopies=[];var oIdMap={};var _slicerCounter=0;var oCopyPr=new AscFormat.CCopyObjectProperties;oCopyPr.idMap=oIdMap;ws.objectRender.controller.resetSelection();for(i=0;i<data.Drawings.length;i++){if(slicersNames&&data.Drawings[i].graphicObject.getObjectType()===AscDFH.historyitem_type_SlicerView){if(slicersNames[_slicerCounter])data.Drawings[i].graphicObject.setName(slicersNames[_slicerCounter]);else continue; _slicerCounter++}var _copy=data.Drawings[i].graphicObject.copy(oCopyPr);oIdMap[data.Drawings[i].graphicObject.Id]=_copy.Id;data.Drawings[i].graphicObject=_copy;aCopies.push(data.Drawings[i].graphicObject);drawingObject=data.Drawings[i];AscFormat.CheckSpPrXfrm2(drawingObject.graphicObject);xfrm=drawingObject.graphicObject.spPr.xfrm;activeRow=activeCell.row;activeCol=activeCell.col;if(isIntoShape&&isIntoShape.Parent&&isIntoShape.Parent.parent&&isIntoShape.Parent.parent.drawingBase&&isIntoShape.Parent.parent.drawingBase.from){activeRow= isIntoShape.Parent.parent.drawingBase.from.row;activeCol=isIntoShape.Parent.parent.drawingBase.from.col}if(savePosition){curCol=xfrm.offX;curRow=xfrm.offY}else{curCol=xfrm.offX-startCol+ws.objectRender.convertMetric(ws._getColLeft(activeCol)-ws._getColLeft(0),0,3);curRow=xfrm.offY-startRow+ws.objectRender.convertMetric(ws._getRowTop(activeRow)-ws._getRowTop(0),0,3)}drawingObject=ws.objectRender.cloneDrawingObject(drawingObject);drawingObject.graphicObject.setDrawingBase(drawingObject);drawingObject.graphicObject.setDrawingObjects(ws.objectRender); drawingObject.graphicObject.setWorksheet(ws.model);xfrm.setOffX(curCol);xfrm.setOffY(curRow);drawingObject.graphicObject.checkRemoveCache&&drawingObject.graphicObject.checkRemoveCache();drawingObject.graphicObject.addToDrawingObjects();if(drawingObject.graphicObject.checkDrawingBaseCoords)drawingObject.graphicObject.checkDrawingBaseCoords();drawingObject.graphicObject.recalculate();drawingObject.graphicObject.select(ws.objectRender.controller,0);tempArr=[];drawingObject.graphicObject.getAllRasterImages(tempArr); if(tempArr.length)for(var n=0;n<tempArr.length;n++)aImagesSync.push(tempArr[n])}AscFormat.fResetConnectorsIds(aCopies,oIdMap);if(aImagesSync.length>0)window["Asc"]["editor"].ImageLoader.LoadDocumentImages(aImagesSync);ws.objectRender.controller.updateSelectionState();ws.objectRender.showDrawingObjects();if(needShowSpecialProps)if(!window["AscCommon"].g_specialPasteHelper.buttonInfo.options)window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();else{var lastAddedImg=ws.model.Drawings[ws.model.Drawings.length- 1];if(drawingObject&&lastAddedImg)window["AscCommon"].g_specialPasteHelper.buttonInfo.setRange({r1:lastAddedImg.from.row,c1:lastAddedImg.from.col,r2:lastAddedImg.to.row,c2:lastAddedImg.to.col})}ws.objectRender.controller.updateOverlay();ws.setSelectionShape(true);History.EndTransaction();if(!needShowSpecialProps)window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.Paste_Process_End()};var pastedInOriginalDoc=this._checkPastedInOriginalDoc(pastedWb);var pastedSlicers= [];for(var i=0;i<data.Drawings.length;i++)if(data.Drawings[i].graphicObject.getObjectType()===AscDFH.historyitem_type_SlicerView)if(pastedInOriginalDoc){var pastedSlicer=data.getSlicerByName(data.Drawings[i].graphicObject.name);if(pastedSlicer)if(pastedSlicer.checkModelContent(ws.model))pastedSlicers.push(pastedSlicer);else{_abortPaste(true);return}}else{_abortPaste(true);return}if(pastedSlicers&&pastedSlicers.length)ws.tryPasteSlicers(pastedSlicers,callback);else callback(true)},_insertImagesFromBinaryWord:function(ws, data,aImagesSync){var activeRange=ws.model.selectionRange.getLast().clone();var curCol,drawingObject,curRow,startCol=0,startRow=0,xfrm,drawingBase,graphicObject,offX,offY,rot;History.Create_NewPoint();History.StartTransaction();var api=window["Asc"]["editor"];var addImagesFromWord=data.props.addImagesFromWord;for(var i=0;i<addImagesFromWord.length;i++){if(para_Math===addImagesFromWord[i].image.Type)graphicObject=ws.objectRender.createShapeAndInsertContent(addImagesFromWord[i].image);else{graphicObject= addImagesFromWord[i].image.GraphicObj;if(graphicObject.setBDeleted2)graphicObject.setBDeleted2(true);else graphicObject.bDeleted=true;graphicObject=graphicObject.convertToPPTX(ws.getDrawingDocument(),ws.model,true)}drawingObject=ws.objectRender.createDrawingObject();drawingObject.graphicObject=graphicObject;if(drawingObject.graphicObject.spPr&&drawingObject.graphicObject.spPr.xfrm){xfrm=drawingObject.graphicObject.spPr.xfrm;offX=0;offY=0;rot=AscFormat.isRealNumber(xfrm.rot)?xfrm.rot:0;rot=AscFormat.normalizeRotate(rot); if(AscFormat.checkNormalRotate(rot)){if(AscFormat.isRealNumber(xfrm.offX)&&AscFormat.isRealNumber(xfrm.offY)){offX=xfrm.offX;offY=xfrm.offY}}else if(AscFormat.isRealNumber(xfrm.offX)&&AscFormat.isRealNumber(xfrm.offY)&&AscFormat.isRealNumber(xfrm.extX)&&AscFormat.isRealNumber(xfrm.extY)){offX=xfrm.offX+xfrm.extX/2-xfrm.extY/2;offY=xfrm.offY+xfrm.extY/2-xfrm.extX/2}if(i===0){startCol=offX;startRow=offY}else{if(startCol>offX)startCol=offX;if(startRow>offY)startRow=offY}}else if(i===0){startCol=drawingObject.from.col; startRow=drawingObject.from.row}else{if(startCol>drawingObject.from.col)startCol=drawingObject.from.col;if(startRow>drawingObject.from.row)startRow=drawingObject.from.row}AscFormat.CheckSpPrXfrm2(drawingObject.graphicObject);xfrm=drawingObject.graphicObject.spPr.xfrm;curCol=xfrm.offX-startCol+ws.objectRender.convertMetric(ws._getColLeft(addImagesFromWord[i].col+activeRange.c1)-ws._getColLeft(0),0,3);curRow=xfrm.offY-startRow+ws.objectRender.convertMetric(ws._getRowTop(addImagesFromWord[i].row+activeRange.r1)- ws._getRowTop(0),0,3);xfrm.setOffX(curCol);xfrm.setOffY(curRow);drawingObject=ws.objectRender.cloneDrawingObject(drawingObject);drawingObject.graphicObject.setDrawingBase(drawingObject);drawingObject.graphicObject.setDrawingObjects(ws.objectRender);drawingObject.graphicObject.setWorksheet(ws.model);drawingObject.graphicObject.checkRemoveCache&&drawingObject.graphicObject.checkRemoveCache();if(drawingObject.graphicObject.checkExtentsByDocContent){if(drawingObject.graphicObject.checkDrawingBaseCoords)drawingObject.graphicObject.checkDrawingBaseCoords(); drawingObject.graphicObject.checkExtentsByDocContent()}drawingObject.graphicObject.addToDrawingObjects();if(drawingObject.graphicObject.checkDrawingBaseCoords)drawingObject.graphicObject.checkDrawingBaseCoords();drawingObject.graphicObject.recalculate();if(0===data.content.length)drawingObject.graphicObject.select(ws.objectRender.controller,0)}var old_val=api.ImageLoader.bIsAsyncLoadDocumentImages;api.ImageLoader.bIsAsyncLoadDocumentImages=true;api.ImageLoader.LoadDocumentImages(aImagesSync);api.ImageLoader.bIsAsyncLoadDocumentImages= old_val;ws.objectRender.showDrawingObjects();ws.setSelectionShape(true);ws.objectRender.controller.updateOverlay();History.EndTransaction()},_loadImagesOnServer:function(aPastedImages,callback){var api=Asc["editor"];var oObjectsForDownload=AscCommon.GetObjectsForImageDownload(aPastedImages);AscCommon.sendImgUrls(api,oObjectsForDownload.aUrls,function(data){var oImageMap={};History.TurnOff();AscCommon.ResetNewUrls(data,oObjectsForDownload.aUrls,oObjectsForDownload.aBuilderImagesByUrl,oImageMap);History.TurnOn(); callback()},true)},_insertTableFromPresentation:function(ws,graphicFrame){History.TurnOff();var drawingObject=graphicFrame;var oPasteFromBinaryWord=new pasteFromBinaryWord(this,ws,true);var oTempDrawingDocument=ws.getDrawingDocument();var newCDocument=new CDocument(oTempDrawingDocument,false);newCDocument.bFromDocument=true;newCDocument.theme=window["Asc"]["editor"].wbModel.theme;drawingObject.graphicObject.setBDeleted(true);drawingObject.graphicObject.setWordFlag(false,newCDocument);var oldLogicDocument= oTempDrawingDocument.m_oLogicDocument;oTempDrawingDocument.m_oLogicDocument=newCDocument;drawingObject.graphicObject.graphicObject.Set_Parent(newCDocument);oTempDrawingDocument.m_oLogicDocument=oldLogicDocument;History.TurnOn();oPasteFromBinaryWord._paste(ws,{content:[drawingObject.graphicObject.graphicObject]})},editorPasteExec:function(worksheet,node,isText){if(node===undefined)return;var binaryResult,t=this;t.alreadyLoadImagesOnServer=false;var isIntoShape=worksheet.objectRender.controller.getTargetDocContent(); if(isIntoShape){var callback=function(isSuccess){if(isSuccess)t._pasteInShape(worksheet,node,isIntoShape);else window["AscCommon"].g_specialPasteHelper.Paste_Process_End()};worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback);return}if(copyPasteUseBinary){this.activeRange=worksheet.model.selectionRange.getLast().clone();binaryResult=this._pasteFromBinaryClassHtml(worksheet,node,isIntoShape);if(binaryResult===true)return;else if(binaryResult!==false&&binaryResult!==undefined)node= binaryResult}this.activeRange=worksheet.model.selectionRange.getLast().clone();var callBackAfterLoadImages=function(){History.TurnOff();var oTempDrawingDocument=worksheet.getDrawingDocument();var newCDocument=new CDocument(oTempDrawingDocument,false);newCDocument.bFromDocument=true;newCDocument.Content[0].bFromDocument=true;newCDocument.theme=window["Asc"]["editor"].wbModel.theme;var oOldLogicDocument=oTempDrawingDocument.m_oLogicDocument;oTempDrawingDocument.m_oLogicDocument=newCDocument;var oOldEditor= undefined;if("undefined"!==typeof editor)oOldEditor=editor;editor={WordControl:oTempDrawingDocument,isDocumentEditor:true};var oPasteProcessor=new AscCommon.PasteProcessor({WordControl:{m_oLogicDocument:newCDocument},FontLoader:{}},false,false);oPasteProcessor._Prepeare_recursive(node,true,true);if(window["AscCommon"].g_specialPasteHelper.specialPasteStart&&window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent)oPasteProcessor.aContent=window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent; else{oPasteProcessor._Execute(node,{},true,true,false);window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent=oPasteProcessor.aContent}editor=oOldEditor;oTempDrawingDocument.m_oLogicDocument=oOldLogicDocument;History.TurnOn();var oPasteFromBinaryWord=new pasteFromBinaryWord(t,worksheet);oPasteFromBinaryWord._paste(worksheet,{content:oPasteProcessor.aContent})};var aImagesToDownload=this._getImageFromHtml(node,true);if(aImagesToDownload)return;var specialPasteProps=window["AscCommon"].g_specialPasteHelper.specialPasteProps; if(aImagesToDownload!==null&&(!specialPasteProps||specialPasteProps&&specialPasteProps.images)){var api=Asc["editor"];AscCommon.sendImgUrls(api,aImagesToDownload,function(data){for(var i=0,length=Math.min(data.length,aImagesToDownload.length);i<length;++i){var elem=data[i];var sFrom=aImagesToDownload[i];if(null!=elem.url)t.oImages[sFrom]=AscCommon.g_oDocumentUrls.imagePath2Local(elem.path);else t.oImages[sFrom]=sFrom}t.alreadyLoadImagesOnServer=true;callBackAfterLoadImages()},true)}else callBackAfterLoadImages()}, _pasteFromBinaryClassHtml:function(worksheet,node,isIntoShape){var returnBinary=this._getClassBinaryFromHtml(node);var base64=returnBinary.base64;var base64FromWord=returnBinary.base64FromWord;var base64FromPresentation=returnBinary.base64FromPresentation;var result=false;if(base64!=null)result=this._pasteFromBinaryExcel(worksheet,base64,isIntoShape);else if(base64FromWord)result=this._pasteFromBinaryWord(worksheet,base64FromWord,isIntoShape);else if(base64FromPresentation)result=this._pasteFromBinaryPresentation(worksheet, base64FromPresentation,isIntoShape);return result},_getClassBinaryFromHtml:function(node){var base64=null,base64FromWord=null,base64FromPresentation=null;var classNode=AscCommon.searchBinaryClass(node);if(classNode!=null){var cL=classNode.split(" ");for(var i=0;i<cL.length;i++)if(cL[i].indexOf("xslData;")>-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64, base64FromWord:base64FromWord,base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;i<allImages.length;i++)arrayImages[i]=allImages[i].src;res=arrayImages}else res=allImages}return res},_getBinaryColor:function(c){var bin,m,x,type,r,g,b,a,s;var reColor=/^\s*(?:#?([0-9a-f]{6})|#?([0-9a-f]{3})|rgba?\s*\(\s*((?:\d*\.?\d+)(?:\s*,\s*(?:\d*\.?\d+)){2,3})\s*\))\s*$/i; if(typeof c==="number")bin=c;else{m=reColor.exec(c);if(!m)return null;if(m[1]){x=[m[1].slice(0,2),m[1].slice(2,4),m[1].slice(4)];type=1}else if(m[2]){x=[m[2].slice(0,1),m[2].slice(1,2),m[2].slice(2)];type=0}else{x=m[3].split(/\s*,\s*/i);type=x.length===3?2:3}r=parseInt(type!==0?x[0]:x[0]+x[0],type<2?16:10);g=parseInt(type!==0?x[1]:x[1]+x[1],type<2?16:10);b=parseInt(type!==0?x[2]:x[2]+x[2],type<2?16:10);a=type===3?Math.round(parseFloat(x[3])*100)*.01:1;bin=r<<16|g<<8|b}return bin},_checkMaxTextLength:function(aResult, r,c){var result=false;var isChange=false;var currentCellData=aResult.content[r][c];if(currentCellData&¤tCellData.content){currentCellData=currentCellData.content;for(var i=0;i<currentCellData.length;i++)if(currentCellData[i]&¤tCellData[i].text&¤tCellData[i].text.length>c_oAscMaxCellOrCommentLength){isChange=true;var text=currentCellData[i].text;var format=currentCellData[i].format;var lengthOfText=text.length;var iterCount=Math.ceil(lengthOfText/c_oAscMaxCellOrCommentLength);var splitText; for(var j=0;j<iterCount;j++){splitText=text.substr(c_oAscMaxCellOrCommentLength*j,c_oAscMaxCellOrCommentLength*(j+1));if(!aResult.content[r])aResult.content[r]=[];if(!aResult.content[r][c])aResult.content[r][c]=[];if(!aResult.content[r][c].content)aResult.content[r][c].content=[];aResult.content[r][c].content[0]={format:format,text:splitText};if(iterCount!==j+1)r++}}if(isChange)result={aResult:aResult,r:r,c:c}}return result},_getBorderStyleName:function(borderStyle,borderWidth){var res=null;var nBorderWidth= parseFloat(borderWidth);if(isNaN(nBorderWidth))return res;if(typeof borderWidth==="string"&&-1!==borderWidth.indexOf("pt"))nBorderWidth=nBorderWidth*96/72;switch(borderStyle){case "solid":if(0<nBorderWidth&&nBorderWidth<=1)res=c_oAscBorderStyles.Thin;else if(1<nBorderWidth&&nBorderWidth<=2)res=c_oAscBorderStyles.Medium;else if(2<nBorderWidth&&nBorderWidth<=6)res=c_oAscBorderStyles.Thick;else res=c_oAscBorderStyles.None;break;case "dashed":if(0<nBorderWidth&&nBorderWidth<=1)res=c_oAscBorderStyles.DashDot; else res=c_oAscBorderStyles.MediumDashDot;break;case "double":res=c_oAscBorderStyles.Double;break;case "dotted":res=c_oAscBorderStyles.Hair;break}return res},ReadPresentationShapes:function(stream,worksheet){History.TurnOff();var loader=new AscCommon.BinaryPPTYLoader;loader.presentation=worksheet.model;loader.DrawingDocument=worksheet.getDrawingDocument();loader.Start_UseFullUrl();loader.ClearConnectorsMaps();loader.stream=stream;var count=stream.GetULong();var arr_shapes=[];var arr_transforms=[]; var arrBase64Img=[];var cStyle;for(var i=0;i<count;++i){var style_index=null;if(!loader.stream.GetBool())if(loader.stream.GetBool()){loader.stream.Skip2(1);cStyle=loader.ReadTableStyle();loader.stream.GetBool();style_index=stream.GetString2()}var drawing=loader.ReadGraphicObject();var isGraphicFrame=typeof AscFormat.CGraphicFrame!=="undefined"&&drawing instanceof AscFormat.CGraphicFrame;if(count===1&&isGraphicFrame)drawing=loader.ReadGraphicObject();var x=stream.GetULong()/1E5;var y=stream.GetULong()/ 1E5;var extX=stream.GetULong()/1E5;var extY=stream.GetULong()/1E5;var base64=stream.GetString2();if(count!==1&&isGraphicFrame){drawing=AscFormat.DrawingObjectsController.prototype.createImage(base64,x,y,extX,extY);arrBase64Img.push(new AscCommon.CBuilderImages(drawing.blipFill,base64,drawing,drawing.spPr,null))}arr_shapes[i]=worksheet.objectRender.createDrawingObject();arr_shapes[i].graphicObject=drawing}loader.AssignConnectorsId();History.TurnOn();var arrImages=arrBase64Img.concat(loader.End_UseFullUrl()); return{arrShapes:arr_shapes,arrImages:arrImages,arrTransforms:arr_transforms}},ReadPresentationText:function(stream,worksheet,cDocumentContent){History.TurnOff();var loader=new AscCommon.BinaryPPTYLoader;loader.Start_UseFullUrl();loader.DrawingDocument=worksheet.getDrawingDocument();loader.stream=stream;loader.presentation=worksheet.model;var count=stream.GetULong()/1E5;var elements=[],paragraph,selectedElement;if(!cDocumentContent)cDocumentContent=worksheet;for(var i=0;i<count;++i){loader.stream.Skip2(1); paragraph=loader.ReadParagraph(cDocumentContent);elements.push(paragraph)}History.TurnOn();return elements},ReadFromBinaryWord:function(sBase64,worksheet){History.TurnOff();AscCommon.g_oIdCounter.m_bRead=true;var oTempDrawingDocument=worksheet.getDrawingDocument();var newCDocument=new CDocument(oTempDrawingDocument,false);newCDocument.bFromDocument=true;newCDocument.theme=window["Asc"]["editor"].wbModel.theme;var old_m_oLogicDocument=oTempDrawingDocument.m_oLogicDocument;oTempDrawingDocument.m_oLogicDocument= newCDocument;var oOldEditor=undefined;if("undefined"!==typeof editor)oOldEditor=editor;editor={isDocumentEditor:true,WordControl:{m_oLogicDocument:newCDocument}};pptx_content_loader.Clear();pptx_content_loader.Start_UseFullUrl();var openParams={checkFileSize:false,charCount:0,parCount:0,bCopyPaste:true};var oBinaryFileReader=new AscCommonWord.BinaryFileReader(newCDocument,openParams);var oRes=oBinaryFileReader.ReadFromString(sBase64,{excelCopyPaste:true});var defrPr=oBinaryFileReader.oReadResult&& oBinaryFileReader.oReadResult.DefrPr;if(defrPr&&newCDocument.Styles&&newCDocument.Styles.Default&&newCDocument.Styles.Default.TextPr){newCDocument.Styles.Default.TextPr.FontSize=defrPr.FontSize;if(defrPr.RFonts)newCDocument.Styles.Default.TextPr.RFonts=defrPr.RFonts}pptx_content_loader.End_UseFullUrl();oTempDrawingDocument.m_oLogicDocument=old_m_oLogicDocument;History.TurnOn();AscCommon.g_oIdCounter.m_bRead=false;editor=oOldEditor;return oRes},_checkPasteFromBinaryExcel:function(worksheet,isWriteError, insertWorksheet){var t=this;var activeCellsPasteFragment=false;AscCommonExcel.executeInR1C1Mode(false,function(){activeCellsPasteFragment=AscCommonExcel.g_oRangeCache.getAscRange(t.activeRange)});var lastRange=worksheet.model.selectionRange.getLast();var rMax=activeCellsPasteFragment.r2-activeCellsPasteFragment.r1+lastRange.r1;var cMax=activeCellsPasteFragment.c2-activeCellsPasteFragment.c1+lastRange.c1;var res=true;if(cMax>AscCommon.gc_nMaxCol0||rMax>AscCommon.gc_nMaxRow0){if(isWriteError)worksheet.handlers.trigger("onErrorEvent", Asc.c_oAscError.ID.PasteMaxRangeError,Asc.c_oAscError.Level.NoCritical);res=false}else if(worksheet.handlers&&!worksheet.handlers.trigger("getLockDefNameManagerStatus")&&insertWorksheet&&insertWorksheet.TableParts&&insertWorksheet.TableParts.length){worksheet.handlers.trigger("onErrorEvent",c_oAscError.ID.LockCreateDefName,c_oAscError.Level.NoCritical);res=false}return res},_pasteInShape:function(worksheet,node,targetDocContent){var t=this;targetDocContent.DrawingDocument.m_oLogicDocument=null;var oPasteProcessor= new AscCommon.PasteProcessor({WordControl:{m_oLogicDocument:targetDocContent},FontLoader:{}},false,false,true,true);oPasteProcessor.map_font_index=window["Asc"]["editor"].FontLoader.map_font_index;oPasteProcessor.bIsDoublePx=false;var newFonts;if(targetDocContent&&targetDocContent.Parent&&targetDocContent.Parent.parent&&targetDocContent.Parent.parent.chart){var changeTag=$(node).find("a");this._changeHtmlTag(changeTag)}oPasteProcessor._Prepeare_recursive(node,true,true);oPasteProcessor.aContent=[]; newFonts=this._convertFonts(oPasteProcessor.oFonts);History.StartTransaction();oPasteProcessor._Execute(node,{},true,true,false);if(!oPasteProcessor.aContent||!oPasteProcessor.aContent.length){History.EndTransaction();window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return false}var targetContent=worksheet.objectRender.controller.getTargetDocContent(true);targetContent.Remove(1,true,true);worksheet._loadFonts(newFonts,function(){var specialPasteProps=window["AscCommon"].g_specialPasteHelper.specialPasteProps; if(specialPasteProps&&!specialPasteProps.format)for(var i=0;i<oPasteProcessor.aContent.length;i++)oPasteProcessor.aContent[i].Clear_TextFormatting();oPasteProcessor.InsertInPlace(targetContent,oPasteProcessor.aContent);var oTargetTextObject=AscFormat.getTargetTextObject(worksheet.objectRender.controller);oTargetTextObject&&oTargetTextObject.checkExtentsByDocContent&&oTargetTextObject.checkExtentsByDocContent();worksheet.objectRender.controller.startRecalculate();worksheet.objectRender.controller.cursorMoveRight(false, false);History.EndTransaction();t._setShapeSpecialPasteProperties(worksheet,targetContent);window["AscCommon"].g_specialPasteHelper.Paste_Process_End()});return true},_convertFonts:function(oFonts){var newFonts={};var fontName;for(var i in oFonts){fontName=oFonts[i]?oFonts[i].Name||oFonts[i].name:undefined;if(undefined!==fontName)newFonts[fontName]=1}return newFonts},_convertTableFromExcelToDocument:function(worksheet,aContentExcel,documentContent){var oCurPar=new Paragraph(worksheet.getDrawingDocument(), documentContent);var getElem=function(text,format,isAddSpace,isHyperLink){var result=null;var value=text;if(isAddSpace)value+=" ";if(""===value)return result;if(isHyperLink){var oCurHyperlink=new ParaHyperlink;oCurHyperlink.SetParagraph(oCurPar);var sHValue="";if(typeof isHyperLink.Hyperlink==="string")sHValue=isHyperLink.Hyperlink;oCurHyperlink.Set_Value(sHValue);if(isHyperLink.Tooltip)oCurHyperlink.SetToolTip(isHyperLink.Tooltip)}var oCurRun=new ParaRun(oCurPar);if(format){oCurRun.Pr.Bold=format.getBold(); oCurRun.Pr.Italic=format.getItalic();oCurRun.Pr.Strikeout=format.getStrikeout();oCurRun.Pr.Underline=format.getUnderline()!==2}for(var k=0,length=value.length;k<length;k++){var nUnicode=null;var nCharCode=value.charCodeAt(k);if(AscCommon.isLeadingSurrogateChar(nCharCode)){if(k+1<length){k++;var nTrailingChar=value.charCodeAt(k);nUnicode=AscCommon.decodeSurrogateChar(nCharCode,nTrailingChar)}}else nUnicode=nCharCode;if(null!=nUnicode){var Item;if(32!==nUnicode&&160!==nUnicode&&8201!==nUnicode)Item= new ParaText(nUnicode);else Item=new ParaSpace;oCurRun.Add_ToContent(k,Item,false)}}if(oCurHyperlink){oCurHyperlink.Add_ToContent(0,oCurRun,false);result=oCurHyperlink}else result=oCurRun;return result};var n=0;aContentExcel._forEachCell(function(cell){var isHyperlink=aContentExcel.getCell3(cell.nRow,cell.nCol).getHyperlink();var multiText=cell.getValueMultiText(),format,elem;if(multiText)for(var m=0;m<multiText.length;m++){var curMultiText=multiText[m];format=curMultiText.format;elem=getElem(curMultiText.text, format);if(null!==elem){oCurPar.Internal_Content_Add(n,elem,false);n++}}else{format=cell.xfs&&cell.xfs.font?cell.xfs.font:null;elem=getElem(cell.getValue(),format,null,isHyperlink);if(null!==elem){oCurPar.Internal_Content_Add(n,elem,false);n++}}elem=getElem("",null,true);oCurPar.Internal_Content_Add(n,elem,false);n++});return oCurPar},_changeHtmlTag:function(arr){var oldElem,value,style,bold,underline,italic;for(var i=0;i<arr.length;i++){oldElem=arr[i];value=oldElem.innerText;underline="none";if(oldElem.style.textDecoration&& oldElem.style.textDecoration!="")underline=oldElem.style.textDecoration;italic="normal";if(oldElem.style.textDecoration&&oldElem.style.textDecoration!="")italic=oldElem.style.fontStyle;bold="normal";if(oldElem.style.fontWeight&&oldElem.style.fontWeight!="")bold=oldElem.style.fontWeight;style=' style = "text-decoration:'+underline+";"+"font-style:"+italic+";"+"font-weight:"+bold+";"+'"';$(oldElem).replaceWith("<span"+style+">"+value+"</span>")}},pasteTextOnSheet:function(worksheet,text){var t=this; if(!text||text&&!text.length){window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return}var specialPasteHelper=window["AscCommon"].g_specialPasteHelper;var specialPasteProps=specialPasteHelper.specialPasteProps;var textImport;var props=specialPasteProps?specialPasteProps.property:null;textImport=props===c_oSpecialPasteProps.useTextImport;this.activeRange=worksheet.model.selectionRange.getLast().clone(true);var isIntoShape=worksheet.objectRender.controller.getTargetDocContent();if(isIntoShape){var callback= function(isSuccess){if(isSuccess===false)return false;isIntoShape=worksheet.objectRender.controller.getTargetDocContent(true);if(!isIntoShape)return false;isIntoShape.Remove(1,true,true);var Count=text.length;var newParagraph=new Paragraph(isIntoShape.DrawingDocument,isIntoShape);var selectedElements=new CSelectedContent;var insertText="";for(var Index=0;Index<Count;Index++){var _char=text.charAt(Index);var _charCode=text.charCodeAt(Index);if(_charCode!==10)insertText+=_char;if(_charCode===10||Index=== Count-1){var newParaRun=new ParaRun;window["AscCommon"].addTextIntoRun(newParaRun,insertText);newParagraph.Internal_Content_Add(newParagraph.Content.length-1,newParaRun,false);var selectedElement=new CSelectedElement;selectedElement.Element=newParagraph;selectedElements.Elements.push(selectedElement);insertText="";newParagraph=new Paragraph(isIntoShape.DrawingDocument,isIntoShape)}}t._insertSelectedContentIntoShapeContent(worksheet,selectedElements,isIntoShape);window["AscCommon"].g_specialPasteHelper.CleanButtonInfo(); window["AscCommon"].g_specialPasteHelper.Paste_Process_End();if(!window["AscCommon"].g_specialPasteHelper.specialPasteStart){var sProps=Asc.c_oSpecialPasteProps;var allowedSpecialPasteProps=[sProps.sourceformatting,sProps.destinationFormatting]}};AscFonts.FontPickerByCharacter.getFontsByString(text);worksheet._loadFonts([],function(){worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback)});return}if(textImport){var advancedOptions=specialPasteProps.asc_getAdvancedOptions();text= AscCommon.parseText(text,advancedOptions,true)}var aResult=this._getTableFromText(text,textImport);if(aResult&&!(aResult.onlyImages&&window["Asc"]["editor"]&&window["Asc"]["editor"].isChartEditor))if(textImport){var arn=worksheet.model.selectionRange.getLast().clone();var width=aResult.content&&aResult.content[0]?aResult.content[0].length-1:0;var height=aResult.content?aResult.content.length-1:0;var arnTo=new Asc.Range(arn.c1,arn.r1,arn.c1+width,arn.r1+height);var resmove=worksheet.model._prepareMoveRange(arn, arnTo);if(resmove===-2){window["AscCommon"].g_specialPasteHelper.Paste_Process_End();worksheet.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotMoveRange,c_oAscError.Level.NoCritical)}else if(resmove===-1)worksheet.model.workbook.handlers.trigger("asc_onConfirmAction",Asc.c_oAscConfirm.ConfirmReplaceRange,function(can){if(can)worksheet.setSelectionInfo("paste",{data:aResult,bText:true});else window["AscCommon"].g_specialPasteHelper.Paste_Process_End()});else worksheet.setSelectionInfo("paste", {data:aResult,bText:true})}else worksheet.setSelectionInfo("paste",{data:aResult,bText:true})},_getTextFromWorksheet:function(worksheet){var res="";var curRow=-1;worksheet._forEachCell(function(cell){if(curRow!==cell.nRow){if(-1!==curRow)res+="\r\n";curRow=cell.nRow}else res+=" ";res+=cell.getValue()});return res},_getTextFromWord:function(data){var res="";var getTextFromCell=function(cell){if(cell.Content&&cell.Content.Content)getTextFromDocumentContent(cell.Content.Content,true)};var getTextFromTable= function(table){for(var i=0;i<table.Content.length;i++){var row=table.Content[i];for(var j=0;j<row.Content.length;j++){res+=" ";var cell=row.Content[j];getTextFromCell(cell)}res+="\r\n"}};var getTextFromDocumentContent=function(documentContent,isNAddNewLine){for(var i=0;i<documentContent.length;i++){var item=documentContent[i];if(type_Paragraph===item.GetType()){if(!isNAddNewLine)res+="\r\n";getTextFromParagraph(item)}else if(type_Table===item.GetType()){res+="\r\n";getTextFromTable(item)}}};var getTextFromParagraph= function(paragraph){for(var j=0;j<paragraph.Content.length;j++)if(para_Math===paragraph.Content[j].GetType()&¶graph.Content[j].Root){var mathTextContent=paragraph.Content[j].Root.GetTextContent();if(mathTextContent)res+=mathTextContent.str}else res+=paragraph.Content[j].GetSelectedText(true)};getTextFromDocumentContent(data);return res},_getTableFromText:function(text,bPastedArray){var addTextIntoCell=function(row,col,sText){var cell=aResult.getCell(rowCounter,colCounter);AscFonts.FontPickerByCharacter.getFontsByString(sText); cell.content[0]={text:sText,format:new AscCommonExcel.Font};return cell};var aResult=new excelPasteContent;var width=0;var colCounter=0;var rowCounter=0;var sCurChar="";var _parseText=function(sText,ignoreTab){if(bPastedArray&&sText===""){if(colCounter>width)width=colCounter;addTextIntoCell(rowCounter,colCounter,sText);sCurChar=""}for(var i=0,length=sText.length;i<length;i++){var Char=sText.charAt(i);var Code=sText.charCodeAt(i);if(colCounter>width)width=colCounter;if(13===Code)continue;if("\n"=== Char||sCurChar.length>=Asc.c_oAscMaxCellOrCommentLength)if(""===sCurChar){addTextIntoCell(rowCounter,colCounter,sCurChar);colCounter=0;rowCounter++}else{addTextIntoCell(rowCounter,colCounter,sCurChar);colCounter=0;rowCounter++;sCurChar=""}else{if(32===Code||160===Code)sCurChar+=" ";else if(9===Code){if(!ignoreTab){addTextIntoCell(rowCounter,colCounter,sCurChar);colCounter++;sCurChar=""}}else sCurChar+=Char;if(i===length-1){addTextIntoCell(rowCounter,colCounter,sCurChar);sCurChar=""}}}};if(!bPastedArray)_parseText(text); else for(var i=0;i<text.length;i++){colCounter=0;for(var j=0;j<text[i].length;j++){_parseText(text[i][j],true);colCounter++}rowCounter++}aResult.props.cellCount=width+1;aResult.props.rowSpanSpCount=0;return aResult},_getFragmentsFromHtml:function(html){var res=null;if(html&&html.children)for(var i=0;i<html.children.length;i++){if(html.children[i]&&html.children[i].nodeName){var sChildNodeName=html.children[i].nodeName.toLowerCase();if(sChildNodeName==="style"||sChildNodeName==="#comment"||sChildNodeName=== "script")continue}if(!res)res={fragments:[],fonts:{}};var children=html.children[i];var computedStyle=this._getComputedStyle(children);var fragment=new AscCommonExcel.Fragment;var format=new AscCommonExcel.Font;if(computedStyle){var bold=computedStyle.getPropertyValue("font-weight");if("bold"===bold)format.setBold(true);var italic=computedStyle.getPropertyValue("font-style");if("italic"===italic)format.setItalic(true);var fontFamily=window["AscCommon"].CheckDefaultFontFamily(computedStyle.getPropertyValue("font-family"), window["Asc"]["editor"]);fontFamily=g_fontApplication.GetFontNameDictionary(fontFamily,true);if(fontFamily){format.setName(fontFamily);res.fonts[fontFamily]=1}var text_decoration=computedStyle.getPropertyValue("text-decoration");if(text_decoration){var underline,Strikeout;if(-1!==text_decoration.indexOf("underline"))underline=true;else if(-1!==text_decoration.indexOf("none"))underline=false;if(-1!==text_decoration.indexOf("line-through"))Strikeout=true;if(underline)format.setUnderline(true);if(Strikeout)format.setUnderline(true)}}fragment.text= children.innerText;AscFonts.FontPickerByCharacter.getFontsByString(fragment.text);fragment.format=format;res.fragments.push(fragment)}return res},_getComputedStyle:function(node){var computedStyle=null;if(null!=node&&Node.ELEMENT_NODE===node.nodeType){var defaultView=node.ownerDocument.defaultView;computedStyle=defaultView.getComputedStyle(node,null)}return computedStyle}};function excelPasteContent(){this.content=[];this.props={};return this}excelPasteContent.prototype={constructor:excelPasteContent, setCellContent:function(row,col,data){if(!this.content[row])this.content[row]=[];if(!this.content[row][col])this.content[row][col]=[];this.content[row][col]=data},getCell:function(row,col){if(!this.content[row])this.content[row]=[];if(!this.content[row][col])this.content[row][col]=new pasteCell;return this.content[row][col]},deleteCell:function(row,col){delete this.content[row][col]}};function pasteCell(){this.content=[];this.rowSpan=null;this.colSpan=null;this.bc=null;this.borders=null;this.toolTip= null;this.hyperLink=null;this.location=null;this.props=null;return this}pasteCell.prototype={constructor:pasteCell,addContentItem:function(item){this.content.push(item)},clone:function(){var result=new pasteCell;for(var item=0;item<this.content.length;item++)result.content[item]={text:this.content[item].text,format:this.content[item].format};result.borders=this.borders;result.rowSpan=this.rowSpan;result.colSpan=this.colSpan;result.toolTip=this.toolTip;result.bc=this.bc;result.hyperLink=this.hyperLink; result.location=this.location;result.alignVertical=this.alignVertical;result.alignHorizontal=this.alignHorizontal;return result}};function pasteFromBinaryWord(clipboard,ws,bFromPresentation){this.aResult=new excelPasteContent;this.fontsNew={};this.clipboard=clipboard;this.ws=ws;this.isUsuallyPutImages=null;this.maxLengthRowCount=0;this.paragraphText="";this.bFromPresentation=bFromPresentation;this.prevTextPr=null;this.maxCellCount=0;this.footnotesCount=0;return this}pasteFromBinaryWord.prototype= {constructor:pasteFromBinaryWord,_paste:function(worksheet,pasteData){var documentContent=pasteData.content;var t=this;var cDocument=documentContent&&documentContent[0]&&documentContent[0].Parent instanceof CDocument?documentContent[0].Parent:null;if(cDocument&&cDocument.Content&&1===cDocument.Content.length)cDocument.Content=documentContent;if(pasteData.images&&pasteData.images.length)this.isUsuallyPutImages=true;if(!documentContent||documentContent&&!documentContent.length){window["AscCommon"].g_specialPasteHelper.Paste_Process_End(); return}var documentContentBounds=new DocumentContentBounds;var coverDocument=documentContentBounds.getBounds(0,0,documentContent);this._parseChildren(coverDocument);if(window["Asc"]["editor"]&&window["Asc"]["editor"].isChartEditor)if(this.aResult.props&&this.aResult.props.addImagesFromWord&&this.aResult.props.addImagesFromWord.length===1&&this.aResult.content)if(1===this.aResult.content.length&&1===this.aResult.content[0].length&&this.aResult.content[0][0].content&&this.aResult.content[0][0].content.length=== 0){window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return}else{this.aResult.props.addImagesFromWord=[];this.clipboard.alreadyLoadImagesOnServer=true}var newFonts=this.fontsNew;if(pasteData.fonts&&pasteData.fonts.length){newFonts={};for(var i=0;i<pasteData.fonts.length;i++)newFonts[pasteData.fonts[i].name]=1}this.aResult.props.fontsNew=newFonts;this.aResult.props.rowSpanSpCount=0;this.aResult.props.cellCount=this.maxCellCount+1>coverDocument.width?this.maxCellCount+1:coverDocument.width; this.aResult.props._images=pasteData.images&&pasteData.images.length?pasteData.images:this.aResult.props._images;this.aResult.props._aPastedImages=pasteData.aPastedImages&&pasteData.aPastedImages.length?pasteData.aPastedImages:this.aResult.props._aPastedImages;var specialPasteProps=window["AscCommon"].g_specialPasteHelper.specialPasteProps;var aImagesToDownload=this.aResult.props._images;if(!this.clipboard.alreadyLoadImagesOnServer&&aImagesToDownload&&(!specialPasteProps||specialPasteProps&&specialPasteProps.images)){var oObjectsForDownload= AscCommon.GetObjectsForImageDownload(t.aResult.props._aPastedImages);var api=window["Asc"]["editor"];var oImageMap={};AscCommon.sendImgUrls(api,oObjectsForDownload.aUrls,function(data){History.TurnOff();AscCommon.ResetNewUrls(data,oObjectsForDownload.aUrls,oObjectsForDownload.aBuilderImagesByUrl,oImageMap);History.TurnOn();t.aResult.props.oImageMap=oImageMap;t.aResult.props.data=data;worksheet.setSelectionInfo("paste",{data:t.aResult})},true)}else worksheet.setSelectionInfo("paste",{data:t.aResult})}, _parseChildren:function(children){var childrens=children.children;var colSpan,rowSpan;for(var i=0;i<childrens.length;i++){if(childrens[i].type===c_oAscBoundsElementType.Cell)for(var row=childrens[i].top;row<childrens[i].top+childrens[i].height;row++)for(var col=childrens[i].left;col<childrens[i].left+childrens[i].width;col++){var isCtable=false;var tempChildren=childrens[i].children[0].children;colSpan=null;rowSpan=null;for(var temp=0;temp<tempChildren.length;temp++)if(tempChildren[temp].type===c_oAscBoundsElementType.Table)isCtable= true;if(childrens[i].width>1&&isCtable&&col===childrens[i].left){colSpan=childrens[i].width;rowSpan=1}else if(!isCtable&&tempChildren.length===1){rowSpan=childrens[i].height;colSpan=childrens[i].width}var newCell=this.aResult.getCell(row,col);newCell.rowSpan=rowSpan;newCell.colSpan=colSpan;var backgroundColor=this.getBackgroundColorTCell(childrens[i]);if(backgroundColor)newCell.bc=backgroundColor;newCell.borders=this._getBorders(childrens[i],row,col,newCell.borders);var alignVertical=childrens[i].elem.Get_VAlign(); switch(alignVertical){case vertalignjc_Bottom:newCell.alignVertical=Asc.c_oAscVAlign.Bottom;break;case vertalignjc_Center:newCell.alignVertical=Asc.c_oAscVAlign.Center;break;case vertalignjc_Top:newCell.alignVertical=Asc.c_oAscVAlign.Top;break}}if(childrens[i].children.length===0){colSpan=null;rowSpan=null;this._parseParagraph(childrens[i],childrens[i].top,childrens[i].left)}else this._parseChildren(childrens[i])}},_parseParagraph:function(paragraph,row,col){this.paragraphText="";var t=this;var content= paragraph.elem.Content;var fontFamily="Arial";var text=null;var oNewItem=new pasteCell;var aResult=this.aResult;if(row===undefined)if(aResult.content.length===0)row=0;else row=aResult.length;var cell=this.aResult.getCell(row+this.maxLengthRowCount,col);if(cell&&cell.content&&cell.content.length===0&&(cell.borders||cell.rowSpan!=null)){if(cell.borders)oNewItem.borders=cell.borders;if(undefined!==cell.alignVertical)oNewItem.alignVertical=cell.alignVertical;if(cell.rowSpan!=null){oNewItem.rowSpan=cell.rowSpan; oNewItem.colSpan=cell.colSpan}this.aResult.deleteCell(row+this.maxLengthRowCount,col)}var startRow=row;var innerCol=0;if(col===undefined)col=0;var backgroundColor=this.getBackgroundColorTCell(paragraph);if(backgroundColor)oNewItem.bc=backgroundColor;paragraph.elem.CompiledPr.NeedRecalc=true;var paraPr=paragraph.elem.Get_CompiledPr();var horisontalAlign=this._getAlignHorisontal(paraPr);if(horisontalAlign==null)oNewItem.wrap=true;oNewItem.alignHorizontal=horisontalAlign;var cellParent=this._getParentByTag(paragraph, c_oAscBoundsElementType.Cell);if(cellParent)oNewItem.wrap=!(cellParent.elem&&cellParent.elem.Pr&&true===cellParent.elem.Pr.NoWrap);var LvlPr=null;var Lvl=null;var oNumPr=paragraph.elem.GetNumPr?paragraph.elem.GetNumPr():null;var numberingText=null;var formatText;if(oNumPr!=null){var oNum=paragraph.elem.Parent.GetNumbering().GetNum(oNumPr.NumId);if(oNum){LvlPr=oNum.GetLvl(oNumPr.Lvl);Lvl=oNumPr.Lvl}numberingText=this._parseNumbering(paragraph.elem);if(text==null)text="";text+=this._getAllNumberingText(Lvl, numberingText);formatText=this._getPrParaRun(paraPr,LvlPr.GetTextPr());fontFamily=formatText.format.getName();this.fontsNew[fontFamily]=1;oNewItem.content.push(formatText);if(text!==null){oNewItem.content[oNewItem.content.length-1].text=text;this.paragraphText+=text}text=""}var parseMathArr=function(mathContent){if(!mathContent)return;for(var i=0;i<mathContent.length;i++){var elem=mathContent[i];var newParaRunObj;if(para_Math_Run===elem.Type){newParaRunObj=t._parseParaRun(elem,oNewItem,paraPr,innerCol, row,col,text);innerCol=newParaRunObj.col;row=newParaRunObj.row}else if(typeof elem==="string"){var newParaRun=new ParaRun;window["AscCommon"].addTextIntoRun(newParaRun,elem);newParaRunObj=t._parseParaRun(newParaRun,oNewItem,paraPr,innerCol,row,col,text,t.prevTextPr);innerCol=newParaRunObj.col;row=newParaRunObj.row}else if(elem.length)parseMathArr(elem)}};var paraRunObj;var allParaFont,textPr;for(var n=0;n<content.length;n++){this.aResult.getCell(row+this.maxLengthRowCount,innerCol+col);if(text==null)text= "";switch(content[n].Type){case para_Run:{paraRunObj=this._parseParaRun(content[n],oNewItem,paraPr,innerCol,row,col,text);if(null!==allParaFont){textPr=content[n].Get_CompiledPr();if(textPr&&textPr.FontFamily&&textPr.FontFamily.Name){if(undefined===allParaFont)allParaFont=textPr.FontFamily.Name}else if(textPr.FontFamily.Name!==allParaFont)allParaFont=null}innerCol=paraRunObj.col;row=paraRunObj.row;oNewItem=paraRunObj.oNewItem;break}case para_Hyperlink:{if(!oNewItem.doNotApplyHyperlink)if(!oNewItem.hyperLink){oNewItem.hyperLink= content[n].Value;oNewItem.toolTip=content[n].ToolTip;oNewItem.location=content[n].Anchor}else{oNewItem.hyperLink=null;oNewItem.toolTip=null;oNewItem.doNotApplyHyperlink=true}var lastTab;for(var h=0;h<content[n].Content.length;h++)switch(content[n].Content[h].Type){case para_Run:{paraRunObj=this._parseParaRun(content[n].Content[h],oNewItem,paraPr,innerCol,row,col,text);oNewItem=paraRunObj.oNewItem;innerCol=paraRunObj.col;row=paraRunObj.row;if(lastTab){oNewItem.hyperLink=content[n].Value;oNewItem.toolTip= content[n].ToolTip;oNewItem.location=content[n].Anchor}lastTab=paraRunObj.lastTab;break}}allParaFont=null;break}case para_Math:{if(this.bFromPresentation){var mathTextContent=content[n].Root.GetTextContent();if(mathTextContent)parseMathArr(mathTextContent.paraRunArr)}else{var tempFonts=[];content[n].Get_AllFontNames(tempFonts);for(var i in tempFonts)this.fontsNew[i]=1;if(!aResult.props.addImagesFromWord)aResult.props.addImagesFromWord=[];aResult.props.addImagesFromWord.push({image:content[n],col:innerCol+ col,row:row});if(null===this.isUsuallyPutImages)this._addImageToMap(content[n])}allParaFont=null;break}case para_InlineLevelSdt:{for(h=0;h<content[n].Content.length;h++)switch(content[n].Content[h].Type){case para_Run:{paraRunObj=this._parseParaRun(content[n].Content[h],oNewItem,paraPr,innerCol,row,col,text);oNewItem=paraRunObj.oNewItem;innerCol=paraRunObj.col;row=paraRunObj.row;break}}break}}}if(null!==numberingText&&allParaFont)oNewItem.props={fontName:allParaFont};oNewItem.textVal=this.paragraphText}, _parseParaRun:function(paraRun,oNewItem,paraPr,innerCol,row,col,text,prevTextPr){var t=this;var paraRunContent=paraRun.Content;var aResult=this.aResult;var paragraphFontFamily=paraPr.TextPr.FontFamily.Name;var cloneNewItem,formatText;var newLine="\n";var cTextPr=prevTextPr?prevTextPr:paraRun.Get_CompiledPr();if(cTextPr&&!(paraRunContent.length===1&¶RunContent[0]instanceof ParaEnd))formatText=this._getPrParaRun(paraPr,cTextPr);else if(!formatText)formatText=this._getPrParaRun(paraPr,cTextPr);this.prevTextPr= cTextPr;var pushData=function(){t.fontsNew[paragraphFontFamily]=1;oNewItem.content.push(formatText);if(text!==null)oNewItem.content[oNewItem.content.length-1].text=text;cloneNewItem=oNewItem.clone();cell=aResult.getCell(row+t.maxLengthRowCount,innerCol+col);aResult.setCellContent(row+t.maxLengthRowCount,innerCol+col,cloneNewItem);text="";oNewItem=new pasteCell};var cell;var lastTab;for(var pR=0;pR<paraRunContent.length;pR++){lastTab=false;switch(paraRunContent[pR].Type){case para_Math_BreakOperator:case para_Math_Text:{text+= AscCommon.encodeSurrogateChar(paraRunContent[pR].value);break}case para_Text:{text+=AscCommon.encodeSurrogateChar(paraRunContent[pR].Value);break}case para_NewLine:{if(AscCommon.g_clipboardBase.pastedFrom===AscCommon.c_oClipboardPastedFrom.Excel)text+=newLine;else{pushData();row++;innerCol=0}break}case para_Space:{text+=" ";break}case para_Tab:{pushData();lastTab=true;innerCol++;if(innerCol>this.maxCellCount)this.maxCellCount=innerCol;break}case para_Drawing:{if(!aResult.props.addImagesFromWord)aResult.props.addImagesFromWord= [];var drawing=this._checkDrawingList(paraRunContent[pR]);aResult.props.addImagesFromWord.push({image:drawing,col:innerCol+col,row:row});if(null===this.isUsuallyPutImages)this._addImageToMap(drawing);break}case para_FootnoteReference:{if(1===paraRunContent.length){var footnotesNumber=this.footnotesCount+1;text+="["+footnotesNumber+"]";this.footnotesCount++}break}case para_End:{cell=aResult.getCell(row,innerCol+col);aResult.setCellContent(row,innerCol+col,oNewItem);var checkMaxTextLength=this.clipboard._checkMaxTextLength(this.aResult, row+this.maxLengthRowCount,innerCol+col);if(checkMaxTextLength){aResult.content=checkMaxTextLength.aResult.content;this.maxLengthRowCount+=checkMaxTextLength.r-row}break}}}if(text!==""){this.fontsNew[paragraphFontFamily]=1;oNewItem.content.push(formatText);if(text!==null){oNewItem.content[oNewItem.content.length-1].text=text;this.paragraphText+=text}}return{col:innerCol,row:row,prevTextPr:cTextPr,oNewItem:oNewItem,lastTab:lastTab}},_addImageToMap:function(paraDrawing){var aResult=this.aResult;if(!aResult.props._aPastedImages)aResult.props._aPastedImages= [];if(!aResult.props._images)aResult.props._images=[];var oGraphicObj=paraDrawing.GraphicObj;if(!oGraphicObj||oGraphicObj&&!oGraphicObj.blipFill||oGraphicObj&&oGraphicObj.blipFill&&!oGraphicObj.blipFill.RasterImageId)return;var sImageUrl=oGraphicObj.blipFill.RasterImageId;aResult.props._aPastedImages.push(new AscCommon.CBuilderImages(oGraphicObj.blipFill,sImageUrl,oGraphicObj,oGraphicObj.spPr,null));aResult.props._images.push(sImageUrl)},_checkDrawingList:function(drawing){var t=this;var checkParagraph= function(paragraph){};if(drawing.GraphicObj&&drawing.GraphicObj.textBoxContent&&drawing.GraphicObj.textBoxContent.Content){var content=drawing.GraphicObj.textBoxContent.Content;for(var i=0;i<content.length;i++)checkParagraph(content[i])}return drawing},_getBorders:function(cellTable,top,left,oldBorders){var borders=cellTable.elem.Get_Borders();var widthCell=cellTable.width;var heightCell=cellTable.height;var defaultStyle="solid";var borderStyleName;var t=this;var getBorderColor=function(curBorder){var color= null;var backgroundColor=null;var unifill=curBorder.Unifill&&curBorder.Unifill.fill&&curBorder.Unifill.fill.color?curBorder.Unifill.fill.color:null;if(unifill&&unifill.color&&unifill.color.type!==Asc.c_oAscColor.COLOR_TYPE_SCHEME&&unifill.color.RGBA){color=unifill.color.RGBA;backgroundColor=new AscCommonExcel.RgbColor(t.clipboard._getBinaryColor("rgb("+color.R+","+color.G+","+color.B+")"))}else{color=curBorder.Color;backgroundColor=new AscCommonExcel.RgbColor(t.clipboard._getBinaryColor("rgb("+color.r+ ","+color.g+","+color.b+")"))}return backgroundColor};var formatBorders=oldBorders?oldBorders:new AscCommonExcel.Border;if(top===cellTable.top&&!formatBorders.t.s&&borders.Top.Value!==0){borderStyleName=this.clipboard._getBorderStyleName(defaultStyle,this.ws.objectRender.convertMetric(borders.Top.Size,3,1));if(null!==borderStyleName){formatBorders.t.setStyle(borderStyleName);formatBorders.t.c=getBorderColor(borders.Top)}}if(left===cellTable.left&&!formatBorders.l.s&&borders.Left.Value!==0){borderStyleName= this.clipboard._getBorderStyleName(defaultStyle,this.ws.objectRender.convertMetric(borders.Left.Size,3,1));if(null!==borderStyleName){formatBorders.l.setStyle(borderStyleName);formatBorders.l.c=getBorderColor(borders.Left)}}if(top===cellTable.top+heightCell-1&&!formatBorders.b.s&&borders.Bottom.Value!==0){borderStyleName=this.clipboard._getBorderStyleName(defaultStyle,this.ws.objectRender.convertMetric(borders.Bottom.Size,3,1));if(null!==borderStyleName){formatBorders.b.setStyle(borderStyleName); formatBorders.b.c=getBorderColor(borders.Bottom)}}if(left===cellTable.left+widthCell-1&&!formatBorders.r.s&&borders.Right.Value!==0){borderStyleName=this.clipboard._getBorderStyleName(defaultStyle,this.ws.objectRender.convertMetric(borders.Right.Size,3,1));if(null!==borderStyleName){formatBorders.r.setStyle(borderStyleName);formatBorders.r.c=getBorderColor(borders.Right)}}return formatBorders},_getAlignHorisontal:function(paraPr){var result;var settings=paraPr.ParaPr;if(!settings)return;switch(settings.Jc){case 0:{result= AscCommon.align_Right;break}case 1:{result=AscCommon.align_Left;break}case 2:{result=AscCommon.align_Center;break}case 3:{result=null;break}}return result},getBackgroundColorTCell:function(elem){var compiledPrCell,color;var backgroundColor=null;var tableCell=this._getParentByTag(elem,c_oAscBoundsElementType.Cell);if(tableCell){compiledPrCell=tableCell.elem.Get_CompiledPr();if(compiledPrCell&&compiledPrCell.Shd.Value!==1){var shd=compiledPrCell.Shd;if(shd.Unifill&&shd.Unifill.fill&&shd.Unifill.fill.color&& shd.Unifill.fill.color.color&&shd.Unifill.fill.color.color.RGBA){color=shd.Unifill.fill.color.color.RGBA;backgroundColor=new AscCommonExcel.RgbColor(this.clipboard._getBinaryColor("rgb("+color.R+","+color.G+","+color.B+")"))}else{color=shd.Color;backgroundColor=new AscCommonExcel.RgbColor(this.clipboard._getBinaryColor("rgb("+color.r+","+color.g+","+color.b+")"))}}}return backgroundColor},_getParentByTag:function(elem,tag){var result;if(!elem)return null;if(elem.type===tag)result=elem;else if(elem.parent)result= this._getParentByTag(elem.parent,tag);else if(!elem.parent)result=null;return result},_getAllNumberingText:function(Lvl,numberingText){var preSpace,result;if(Lvl===0)preSpace=" ";else if(Lvl===1)preSpace=" ";else if(Lvl>=2)preSpace=" ";var betweenSpace=" ";result=preSpace+numberingText+betweenSpace;return result},_parseNumbering:function(paragraph){var Pr=paragraph.Get_CompiledPr();if(paragraph.Numbering){var NumberingItem=paragraph.Numbering;if(para_Numbering===NumberingItem.Type){var NumPr= Pr.ParaPr.NumPr;if(undefined===NumPr||undefined===NumPr.NumId||0===NumPr.NumId||"0"===NumPr.NumId);else{var Numbering=paragraph.Parent.GetNumbering();var NumLvl=Numbering.GetNum(NumPr.NumId).GetLvl(NumPr.Lvl);var NumTextPr=paragraph.Get_CompiledPr2(false).TextPr.Copy();var TextPr_temp=paragraph.TextPr.Value.Copy();TextPr_temp.Underline=undefined;NumTextPr.Merge(TextPr_temp);NumTextPr.Merge(NumLvl.GetTextPr());var text=null;var oNumPr=paragraph.GetNumPr();var Lvl;if(oNumPr!=null){var oNum=paragraph.Parent.GetNumbering().GetNum(oNumPr.NumId); if(null!=oNum){Lvl=oNumPr.Lvl;text=oNum.GetText(Lvl,paragraph.Parent.CalculateNumberingValues(paragraph,NumPr))}}return text}}}},_getPrParaRun:function(paraPr,cTextPr){var formatText,fontFamily,colorText;var paragraphFontSize=paraPr.TextPr.FontSize;var paragraphFontFamily=paraPr.TextPr&¶Pr.TextPr.FontFamily?paraPr.TextPr.FontFamily.Name:"Arial";var paragraphBold=paraPr.TextPr.Bold;var paragraphItalic=paraPr.TextPr.Italic;var paragraphStrikeout=paraPr.TextPr.Strikeout;var paragraphUnderline=paraPr.TextPr.Underline? Asc.EUnderline.underlineSingle:Asc.EUnderline.underlineNone;var paragraphVertAlign=null;if(paraPr.TextPr.VertAlign===1)paragraphVertAlign=AscCommon.vertalign_SuperScript;else if(paraPr.TextPr.VertAlign===2)paragraphVertAlign=AscCommon.vertalign_SubScript;var colorParagraph=new AscCommonExcel.RgbColor(this.clipboard._getBinaryColor("rgb("+paraPr.TextPr.Color.r+","+paraPr.TextPr.Color.g+","+paraPr.TextPr.Color.b+")"));if(cTextPr.Color)colorText=new AscCommonExcel.RgbColor(this.clipboard._getBinaryColor("rgb("+ cTextPr.Color.r+","+cTextPr.Color.g+","+cTextPr.Color.b+")"));else colorText=null;fontFamily=cTextPr.FontFamily?cTextPr.FontFamily.Name:cTextPr.RFonts.CS?cTextPr.RFonts.CS.Name:paragraphFontFamily;this.fontsNew[fontFamily]=1;var verticalAlign;if(cTextPr.VertAlign===2)verticalAlign=AscCommon.vertalign_SubScript;else if(cTextPr.VertAlign===1)verticalAlign=AscCommon.vertalign_SuperScript;var font=new AscCommonExcel.Font;font.assignFromObject({fn:fontFamily,fs:cTextPr.FontSize?cTextPr.FontSize:paragraphFontSize, c:colorText?colorText:colorParagraph,b:cTextPr.Bold?cTextPr.Bold:paragraphBold,i:cTextPr.Italic?cTextPr.Italic:paragraphItalic,u:cTextPr.Underline?Asc.EUnderline.underlineSingle:paragraphUnderline,s:cTextPr.Strikeout?cTextPr.Strikeout:cTextPr.DStrikeout?cTextPr.DStrikeout:paragraphStrikeout,va:verticalAlign?verticalAlign:paragraphVertAlign});formatText={format:font};return formatText}};var c_oAscBoundsElementType={Content:0,Paragraph:1,Table:2,Row:3,Cell:4};function DocumentContentBoundsElement(elem, type,parent){this.elem=elem;this.type=type;this.parent=parent;this.children=[];this.left=0;this.top=0;this.width=0;this.height=0}function DocumentContentBounds(){}DocumentContentBounds.prototype={constructor:DocumentContentBounds,getBounds:function(nLeft,nTop,aDocumentContent){var oRes=this._getMeasure(aDocumentContent,null);this._getOffset(nLeft,nTop,oRes);return oRes},_getOffset:function(nLeft,nTop,elem){elem.left+=nLeft;elem.top+=nTop;var nCurLeft=elem.left;var nCurTop=elem.top;var bIsRow=elem.elem instanceof CTableRow;for(var i=0,length=elem.children.length;i<length;i++){var child=elem.children[i];this._getOffset(nCurLeft,nCurTop,child);if(bIsRow)nCurLeft+=child.width;else nCurTop+=child.height}},_getMeasure:function(aDocumentContent,oParent){var oRes=new DocumentContentBoundsElement(aDocumentContent,c_oAscBoundsElementType.Content,oParent);for(var i=0,length=aDocumentContent.length;i<length;i++){var elem=aDocumentContent[i];var oNewElem=null;if(type_Paragraph===elem.GetType())oNewElem=this._getParagraphMeasure(elem, oRes);else if(type_Table===elem.GetType()){elem.ReIndexing(0);oNewElem=this._getTableMeasure(elem,oRes)}else if(type_BlockLevelSdt===elem.GetType())oNewElem=this._getMeasure(elem.Content.Content,oRes);if(null!=oNewElem){oRes.children.push(oNewElem);if(oNewElem.width&&oNewElem.width>oRes.width)oRes.width=oNewElem.width;oRes.height+=oNewElem.height}}return oRes},_getParagraphMeasure:function(elem,oParent){var oNewElem=new DocumentContentBoundsElement(elem,c_oAscBoundsElementType.Paragraph,oParent); oNewElem.width=1;oNewElem.height=1;for(var i=0,length=elem.Content.length;i<length;i++)if(elem.Content[i]&&elem.Content[i].Content)for(var j=0;j<elem.Content[i].Content.length;j++)if(elem.Content[i].Content[j]&¶_NewLine===elem.Content[i].Content[j].GetType()&&AscCommon.g_clipboardBase.pastedFrom!==AscCommon.c_oClipboardPastedFrom.Excel)oNewElem.height++;return oNewElem},_getTableMeasure:function(table,oParent){var oRes=new DocumentContentBoundsElement(table,c_oAscBoundsElementType.Table,oParent); var aGridWidth=[],i,length;for(i=0,length=table.TableGrid.length;i<length;i++)aGridWidth.push(1);for(i=0,length=table.Content.length;i<length;i++){var row=table.Content[i];var oNewElem=this._setRowGridWidth(row,oRes,aGridWidth);if(null!=oNewElem)oRes.children.push(oNewElem)}var aSumGridWidth=[];var nTempSum=0;for(i=0,length=aGridWidth.length;i<length+1;i++){aSumGridWidth[i]=nTempSum;var nCurValue=aGridWidth[i];if(nCurValue)nTempSum+=nCurValue}for(i=0,length=oRes.children.length;i<length;i++){var rowWrapped= oRes.children[i];this._getRowMeasure(rowWrapped,aSumGridWidth,oRes.children,i);oRes.height+=rowWrapped.height;if(rowWrapped.width+rowWrapped.left>oRes.width)oRes.width=rowWrapped.width+rowWrapped.left}return oRes},_setRowGridWidth:function(row,oParent,aGridWidth){var oRes=new DocumentContentBoundsElement(row,c_oAscBoundsElementType.Row,oParent);var nSumGrid=0;var BeforeInfo=row.Get_Before();if(BeforeInfo&&BeforeInfo.GridBefore)nSumGrid+=BeforeInfo.GridBefore;for(var i=0,length=row.Content.length;i< length;i++){var cell=row.Content[i];var oNewCell=new DocumentContentBoundsElement(cell,c_oAscBoundsElementType.Cell,oRes);oRes.children.push(oNewCell);var oNewElem=this._getMeasure(cell.Content.Content,oNewCell);oNewCell.children.push(oNewElem);oNewCell.width=oNewElem.width;oNewCell.height=oNewElem.height;if(oNewCell.height>oRes.height)oRes.height=oNewCell.height;var nCellGrid=cell.Get_GridSpan();if(oNewElem.width>nCellGrid){var nFirstGridWidth=oNewElem.width-nCellGrid+1;var nCurValue=aGridWidth[nSumGrid]; if(null!=nCurValue&&nCurValue<nFirstGridWidth)aGridWidth[nSumGrid]=nFirstGridWidth}nSumGrid+=nCellGrid}return oRes},_getRowMeasure:function(rowWrapped,aSumGridWidth,rows,index){var getNotMergedPreviousCell=function(i){var res=null;if(rows&&index>0)for(var j=index;j>=0;j--)if(rows[j]&&rows[j].children&&rows[j].children[i]){var vMerge=rows[j].children[i].elem.GetVMerge();if(1===vMerge){res=rows[j].children[i];break}}return res};var nSumGrid=0;var BeforeInfo=rowWrapped.elem.Get_Before();if(BeforeInfo&& BeforeInfo.GridBefore){rowWrapped.left=aSumGridWidth[nSumGrid+BeforeInfo.GridBefore]-aSumGridWidth[nSumGrid];nSumGrid+=BeforeInfo.GridBefore}for(var i=0,length=rowWrapped.children.length;i<length;i++){var cellWrapped=rowWrapped.children[i];var nCellGrid=cellWrapped.elem.Get_GridSpan();cellWrapped.width=aSumGridWidth[nSumGrid+nCellGrid]-aSumGridWidth[nSumGrid];cellWrapped.height=rowWrapped.height;rowWrapped.width+=cellWrapped.width;nSumGrid+=nCellGrid;var previousCell=getNotMergedPreviousCell(i);if(previousCell){var vMerge= cellWrapped.elem.GetVMerge();if(vMerge>1)previousCell.height+=vMerge-1}}}};var g_clipboardExcel=new Clipboard;window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].g_clipboardExcel=g_clipboardExcel;window["Asc"]["SpecialPasteProps"]=window["Asc"].SpecialPasteProps=CSpecialPasteProps;prot=CSpecialPasteProps.prototype;prot["asc_setProps"]=prot.asc_setProps;prot["asc_getProps"]=prot.asc_getProps;prot["asc_setAdvancedOptions"]=prot.asc_setAdvancedOptions;prot["asc_setOperation"]= prot.asc_setOperation;prot["asc_getOperation"]=prot.asc_getOperation;prot["asc_setTranspose"]=prot.asc_setTranspose;prot["asc_setSkipBlanks"]=prot.asc_setSkipBlanks;prot["asc_getTableAllowed"]=prot.asc_getTableAllowed})(jQuery,window);"use strict";(function(window,undefined){var CellValueType=AscCommon.CellValueType;var CellAddress=AscCommon.CellAddress;var History=AscCommon.History;var UndoRedoDataTypes=AscCommonExcel.UndoRedoDataTypes;var c_oAscError=Asc.c_oAscError;var c_oAscInsertOptions=Asc.c_oAscInsertOptions; var c_oAscDeleteOptions=Asc.c_oAscDeleteOptions;var c_oAscChangeTableStyleInfo=Asc.c_oAscChangeTableStyleInfo;var c_oAscAutoFilterTypes=Asc.c_oAscAutoFilterTypes;var prot;var g_oAutoFiltersOptionsElementsProperties={val:0,visible:1,text:2,isDateFormat:3,year:4,month:5,day:6};function AutoFiltersOptionsElements(){if(!(this instanceof AutoFiltersOptionsElements))return new AutoFiltersOptionsElements;this.Properties=g_oAutoFiltersOptionsElementsProperties;this.val=null;this.text=null;this.visible=null; this.isDateFormat=null;this.year=null;this.month=null;this.day=null;this.repeats=1;this.hiddenByOtherColumns=undefined}AutoFiltersOptionsElements.prototype={constructor:AutoFiltersOptionsElements,getType:function(){return UndoRedoDataTypes.AutoFiltersOptionsElements},getProperties:function(){return this.Properties},getProperty:function(nType){switch(nType){case this.Properties.val:return this.val;break;case this.Properties.visible:return this.visible;break;case this.Properties.text:return this.text; break;case this.Properties.isDateFormat:return this.isDateFormat;break;case this.Properties.year:return this.year;break;case this.Properties.month:return this.month;break;case this.Properties.day:return this.day;break}return null},setProperty:function(nType,value){switch(nType){case this.Properties.val:this.val=value;break;case this.Properties.visible:this.visible=value;break;case this.Properties.text:this.text=value;break;case this.Properties.isDateFormat:this.isDateFormat=value;break;case this.Properties.year:this.year= value;break;case this.Properties.month:this.month=value;break;case this.Properties.day:this.day=value;break}},clone:function(){var res=new AutoFiltersOptionsElements;res.val=this.val;res.text=this.text;res.visible=this.visible;res.isDateFormat=this.isDateFormat;res.Properties=this.Properties;res.year=this.visible;res.month=this.isDateFormat;res.day=this.day;return res},asc_getVal:function(){return this.val},asc_getVisible:function(){return this.visible},asc_getText:function(){return this.text},asc_getIsDateFormat:function(){return this.isDateFormat}, asc_getYear:function(){return this.year},asc_getMonth:function(){return this.month},asc_getDay:function(){return this.day},asc_getRepeats:function(){return this.repeats},asc_setVal:function(val){this.val=val},asc_setVisible:function(val){this.visible=val},asc_setText:function(val){this.text=val},asc_setIsDateFormat:function(val){this.isDateFormat=val},asc_setYear:function(val){this.year=val},asc_setMonth:function(val){this.month=val},asc_setDay:function(val){this.day=val},asc_setRepeats:function(val){this.repeats= val}};var g_oAutoFiltersOptionsProperties={cellId:0,values:1,filter:2,automaticRowCount:3,displayName:4,isTextFilter:5,namedSheetView:6};function AutoFiltersOptions(){if(!(this instanceof AutoFiltersOptions))return new AutoFiltersOptions;this.Properties=g_oAutoFiltersOptionsProperties;this.cellId=null;this.cellCoord=null;this.values=null;this.filter=null;this.pivotObj=null;this.sortVal=null;this.automaticRowCount=null;this.displayName=null;this.isTextFilter=null;this.colorsFill=null;this.colorsFont= null;this.sortColor=null;this.columnName=null;this.sheetColumnName=null;this.namedSheetView=null;return this}AutoFiltersOptions.prototype={constructor:AutoFiltersOptions,getType:function(){return UndoRedoDataTypes.AutoFiltersOptions},getProperties:function(){return this.Properties},getProperty:function(nType){switch(nType){case this.Properties.cellId:return this.cellId;case this.Properties.values:return this.values;case this.Properties.filter:return this.filter;case this.Properties.automaticRowCount:return this.automaticRowCount; case this.Properties.displayName:return this.displayName;case this.Properties.isTextFilter:return this.isTextFilter;case this.Properties.colorsFill:return this.colorsFill;case this.Properties.colorsFont:return this.colorsFont;case this.Properties.sortColor:return this.sortColor;case this.Properties.namedSheetView:return this.namedSheetView}return null},setProperty:function(nType,value){switch(nType){case this.Properties.cellId:this.cellId=value;break;case this.Properties.values:this.values=value; break;case this.Properties.filter:this.filter=value;break;case this.Properties.automaticRowCount:this.automaticRowCount=value;break;case this.Properties.displayName:this.displayName=value;break;case this.Properties.isTextFilter:this.isTextFilter=value;break;case this.Properties.colorsFill:this.colorsFill=value;break;case this.Properties.colorsFont:this.colorsFont=value;break;case this.Properties.sortColor:this.sortColor=value;break;case this.Properties.namedSheetView:this.namedSheetView=value;break}}, asc_setCellId:function(cellId){this.cellId=cellId},asc_setCellCoord:function(val){this.cellCoord=val},asc_setValues:function(values){this.values=values},asc_setFilterObj:function(filter){this.filter=filter},asc_setPivotObj:function(obj){this.pivotObj=obj},asc_setSortState:function(sortVal){this.sortVal=sortVal},asc_setAutomaticRowCount:function(val){this.automaticRowCount=val},asc_setDiplayName:function(val){this.displayName=val},asc_setIsTextFilter:function(val){this.isTextFilter=val},asc_setColorsFill:function(val){this.colorsFill= val},asc_setColorsFont:function(val){this.colorsFont=val},asc_setSortColor:function(val){this.sortColor=val},asc_setColumnName:function(val){this.columnName=val},asc_setSheetColumnName:function(val){this.sheetColumnName=val},asc_getCellId:function(){return this.cellId},asc_getCellCoord:function(){return this.cellCoord},asc_getValues:function(){return this.values},asc_getFilterObj:function(){return this.filter},asc_getPivotObj:function(){return this.pivotObj},asc_getSortState:function(){return this.sortVal}, asc_getDisplayName:function(){return this.displayName},asc_getIsTextFilter:function(){return this.isTextFilter},asc_getColorsFill:function(){return this.colorsFill},asc_getColorsFont:function(){return this.colorsFont},asc_getSortColor:function(){return this.sortColor},asc_getColumnName:function(){return this.columnName},asc_getSheetColumnName:function(){return this.sheetColumnName},setVisibleFromValues:function(values){if(!this.values)return;for(var i=0;i<this.values.length&&i<values.length;++i)this.values[i].visible= values[i].visible}};var g_oAdvancedTableInfoSettings={title:0,description:1};function AdvancedTableInfoSettings(){if(!(this instanceof AdvancedTableInfoSettings))return new AdvancedTableInfoSettings;this.Properties=g_oAdvancedTableInfoSettings;this.title=undefined;this.description=undefined;return this}AdvancedTableInfoSettings.prototype={constructor:AdvancedTableInfoSettings,getType:function(){return UndoRedoDataTypes.AdvancedTableInfoSettings},getProperties:function(){return this.Properties},getProperty:function(nType){switch(nType){case this.Properties.title:return this.title; break;case this.Properties.description:return this.description;break}return null},setProperty:function(nType,value){switch(nType){case this.Properties.title:this.title=value;break;case this.Properties.description:this.description=value;break}},asc_setTitle:function(val){this.title=val},asc_setDescription:function(val){this.description=val},asc_getTitle:function(){return this.title},asc_getDescription:function(){return this.description}};var g_oAutoFilterObj={type:0,filter:1};function AutoFilterObj(){if(!(this instanceof AutoFilterObj))return new AutoFilterObj;this.Properties=g_oAutoFilterObj;this.type=null;this.filter=null;return this}AutoFilterObj.prototype={constructor:AutoFilterObj,getType:function(){return UndoRedoDataTypes.AutoFilterObj},getProperties:function(){return this.Properties},getProperty:function(nType){switch(nType){case this.Properties.type:return this.type;case this.Properties.filter:return this.filter}return null},setProperty:function(nType,value){switch(nType){case this.Properties.type:this.type= value;break;case this.Properties.filter:this.filter=value;break}},asc_setType:function(type){this.type=type},asc_setFilter:function(filter){this.filter=filter},asc_getType:function(){return this.type},asc_getFilter:function(){return this.filter},convertFromFilterColumn:function(filters,ignoreCustomFilter){this.type=c_oAscAutoFilterTypes.None;if(!filters)return;if(filters.ColorFilter){this.type=c_oAscAutoFilterTypes.ColorFilter;this.filter=filters.ColorFilter.clone()}else if(!ignoreCustomFilter&&filters.CustomFiltersObj&& filters.CustomFiltersObj.CustomFilters){this.type=c_oAscAutoFilterTypes.CustomFilters;this.filter=filters.CustomFiltersObj;this.filter=this.filter.changeForInterface()}else if(filters.DynamicFilter){this.type=c_oAscAutoFilterTypes.DynamicFilter;this.filter=filters.DynamicFilter.clone()}else if(filters.Top10){this.type=c_oAscAutoFilterTypes.Top10;this.filter=filters.Top10.clone()}else if(filters)this.type=c_oAscAutoFilterTypes.Filters}};function PivotFilterObj(){if(!(this instanceof PivotFilterObj))return new PivotFilterObj; this.dataFields=null;this.dataFieldIndexSorting=0;this.dataFieldIndexFilter=0;this.isPageFilter=false;this.isMultipleItemSelectionAllowed=false;this.isTop10Sum=false;return this}PivotFilterObj.prototype={constructor:PivotFilterObj,asc_setDataFields:function(val){this.dataFields=val||null},asc_setDataFieldIndexSorting:function(val){this.dataFieldIndexSorting=val},asc_setDataFieldIndexFilter:function(val){this.dataFieldIndexFilter=val},asc_setIsPageFilter:function(val){this.isPageFilter=val},asc_setIsMultipleItemSelectionAllowed:function(val){this.isMultipleItemSelectionAllowed= val},asc_setIsTop10Sum:function(val){this.isTop10Sum=val},asc_getDataFields:function(val){return this.dataFields},asc_getDataFieldIndexSorting:function(val){return this.dataFieldIndexSorting},asc_getDataFieldIndexFilter:function(val){return this.dataFieldIndexFilter},asc_getIsPageFilter:function(val){return this.isPageFilter},asc_getIsMultipleItemSelectionAllowed:function(val){return this.isMultipleItemSelectionAllowed},asc_getIsTop10Sum:function(val){return this.isTop10Sum}};var g_oAddFormatTableOptionsProperties= {range:0,isTitle:1};function AddFormatTableOptions(){if(!(this instanceof AddFormatTableOptions))return new AddFormatTableOptions;this.Properties=g_oAddFormatTableOptionsProperties;this.range=null;this.isTitle=null;return this}AddFormatTableOptions.prototype={constructor:AddFormatTableOptions,getType:function(){return UndoRedoDataTypes.AddFormatTableOptions},getProperties:function(){return this.Properties},getProperty:function(nType){switch(nType){case this.Properties.range:return this.range;break; case this.Properties.isTitle:return this.isTitle;break}return null},setProperty:function(nType,value){switch(nType){case this.Properties.range:this.range=value;break;case this.Properties.isTitle:this.isTitle=value;break}},asc_setRange:function(range){this.range=range},asc_setIsTitle:function(isTitle){this.isTitle=isTitle},asc_getRange:function(){return this.range},asc_getIsTitle:function(){return this.isTitle}};function AutoFilters(currentSheet){this.worksheet=currentSheet;this.useViewLocalChange= null;this.applyCollaborativeChangedColumnsArr=[];this.applyCollaborativeChangedRowsArr=[];this.m_oColor=new AscCommon.CColor(120,120,120);return this}AutoFilters.prototype={constructor:AutoFilters,addAutoFilter:function(styleName,activeRange,addFormatTableOptionsObj,offLock,props,filterInfo){var worksheet=this.worksheet,t=this,cloneFilter;var wsView=Asc["editor"].wb.getWorksheet(worksheet.getIndex());var isTurnOffHistory=worksheet.workbook.bUndoChanges||worksheet.workbook.bRedoChanges;if(!filterInfo)filterInfo= this._getFilterInfoByAddTableProps(activeRange,addFormatTableOptionsObj,!!styleName);var addNameColumn=filterInfo.addNameColumn;var filterRange=filterInfo.filterRange;var rangeWithoutDiff=filterInfo.rangeWithoutDiff;var tablePartsContainsRange=filterInfo.tablePartsContainsRange;var bWithoutFilter,displayName,tablePart,offset;if(props){bWithoutFilter=props.bWithoutFilter;displayName=props.displayName;tablePart=props.tablePart;offset=props.offset}var addFilterCallBack=function(){History.Create_NewPoint(); History.StartTransaction();if(tablePartsContainsRange){cloneFilter=tablePartsContainsRange.clone(null);tablePartsContainsRange.addAutoFilter();t._addHistoryObj(cloneFilter,AscCH.historyitem_AutoFilter_Add,{activeCells:activeRange,styleName:styleName},null,cloneFilter.Ref)}else{if(addNameColumn&&filterRange.r2>=AscCommon.gc_nMaxRow)filterRange.r2=AscCommon.gc_nMaxRow-1;if(styleName)worksheet.getRange3(filterRange.r1,filterRange.c1,filterRange.r2,filterRange.c2).unmerge();if(addNameColumn&&!isTurnOffHistory){var moveToRange; var shiftRange;if(t._isEmptyCellsUnderRange(rangeWithoutDiff))moveToRange=new Asc.Range(filterRange.c1,filterRange.r1+1,filterRange.c2,filterRange.r2);else{shiftRange=worksheet.getRange3(filterRange.r2,filterRange.c1,filterRange.r2,filterRange.c2);shiftRange.addCellsShiftBottom();wsView.cellCommentator.updateCommentsDependencies(true,c_oAscInsertOptions.InsertCellsAndShiftDown,shiftRange.bbox);worksheet.shiftDataValidation(true,c_oAscInsertOptions.InsertCellsAndShiftDown,shiftRange.bbox,true);moveToRange= new Asc.Range(filterRange.c1,filterRange.r1+1,filterRange.c2,filterRange.r2)}worksheet._moveRange(rangeWithoutDiff,moveToRange);wsView.cellCommentator.moveRangeComments(rangeWithoutDiff,moveToRange)}else if(!addNameColumn&&styleName)if(filterRange.r1===filterRange.r2)if(t._isEmptyCellsUnderRange(rangeWithoutDiff))filterRange.r2++;else{filterRange.r2++;if(!isTurnOffHistory){shiftRange=worksheet.getRange3(filterRange.r2,filterRange.c1,filterRange.r2,filterRange.c2);shiftRange.addCellsShiftBottom(); wsView.cellCommentator.updateCommentsDependencies(true,c_oAscInsertOptions.InsertCellsAndShiftDown,shiftRange.bbox);worksheet.shiftDataValidation(true,c_oAscInsertOptions.InsertCellsAndShiftDown,shiftRange.bbox,true)}}var newFilter=t._addNewFilter(filterRange,styleName,bWithoutFilter,displayName,tablePart,offset);var newDisplayName=newFilter&&newFilter.DisplayName?newFilter.DisplayName:null;if(addFormatTableOptionsObj&&addFormatTableOptionsObj.range&&rangeWithoutDiff)AscCommonExcel.executeInR1C1Mode(false, function(){addFormatTableOptionsObj.range=rangeWithoutDiff.getName()});t._addHistoryObj({Ref:filterRange},AscCH.historyitem_AutoFilter_Add,{activeCells:filterRange,styleName:styleName,addFormatTableOptionsObj:addFormatTableOptionsObj,displayName:newDisplayName,tablePart:tablePart},null,filterRange,bWithoutFilter);History.SetSelectionRedo(filterRange);if(styleName)t._setColorStyleTable(worksheet.TableParts[worksheet.TableParts.length-1].Ref,worksheet.TableParts[worksheet.TableParts.length-1],null, true)}t.updateNamedSheetViewAfterAddFilter(cloneFilter?cloneFilter:newFilter);History.EndTransaction()};addFilterCallBack()},deleteAutoFilter:function(activeRange){var worksheet=this.worksheet,filterRange,t=this,cloneFilter;activeRange=activeRange.clone();var tablePartsContainsRange=this._isTablePartsContainsRange(activeRange);if(tablePartsContainsRange&&tablePartsContainsRange.Ref)filterRange=tablePartsContainsRange.Ref.clone();else if(worksheet.AutoFilter)filterRange=worksheet.AutoFilter.Ref;if(!filterRange)return; var deleteFilterCallBack=function(){if(!tablePartsContainsRange&&!worksheet.AutoFilter)return;History.Create_NewPoint();History.StartTransaction();if(tablePartsContainsRange){cloneFilter=tablePartsContainsRange.clone(null);t._openHiddenRows(cloneFilter);tablePartsContainsRange.AutoFilter=null}else{cloneFilter=worksheet.AutoFilter.clone();worksheet.AutoFilter=null;t._openHiddenRows(cloneFilter)}t._addHistoryObj(cloneFilter,AscCH.historyitem_AutoFilter_Delete,{activeCells:activeRange},null,cloneFilter.Ref); t._setStyleTablePartsAfterOpenRows(filterRange);t.updateNamedSheetViewAfterDeleteFilter(cloneFilter);History.EndTransaction()};deleteFilterCallBack(true)},changeTableStyleInfo:function(styleName,activeRange){var filterRange,t=this,cloneFilter;activeRange=activeRange.clone();var isTablePartsContainsRange=this._isTablePartsContainsRange(activeRange);if(isTablePartsContainsRange!==null)filterRange=isTablePartsContainsRange.Ref.clone();var addFilterCallBack=function(){History.Create_NewPoint();History.StartTransaction(); cloneFilter=isTablePartsContainsRange.clone(null);if(!isTablePartsContainsRange.TableStyleInfo)isTablePartsContainsRange.TableStyleInfo=new AscCommonExcel.TableStyleInfo;isTablePartsContainsRange.TableStyleInfo.setName(styleName);t._cleanStyleTable(isTablePartsContainsRange.Ref);t._setColorStyleTable(isTablePartsContainsRange.Ref,isTablePartsContainsRange);var tableStyleInfoName=cloneFilter.TableStyleInfo?cloneFilter.TableStyleInfo.Name:null;t._addHistoryObj({ref:cloneFilter.Ref,name:tableStyleInfoName}, AscCH.historyitem_AutoFilter_ChangeTableStyle,{activeCells:activeRange,styleName:styleName},null,filterRange);History.EndTransaction()};addFilterCallBack(true)},changeAutoFilterToTablePart:function(styleName,ar,addFormatTableOptionsObj){var t=this;var addFilterCallBack=function(){History.Create_NewPoint();History.StartTransaction();t.deleteAutoFilter(ar,true);t.addAutoFilter(styleName,ar,addFormatTableOptionsObj,true);History.EndTransaction()};addFilterCallBack()},applyAutoFilter:function(autoFiltersObject, ar,tryConvertFilter){var worksheet=this.worksheet;var bUndoChanges=worksheet.workbook.bUndoChanges;var bRedoChanges=worksheet.workbook.bRedoChanges;var minChangeRow=null;var filterObj=this._getPressedFilter(ar,autoFiltersObject.cellId);var currentFilter=filterObj.filter;if(filterObj.filter===null)return;var activeNamedSheetViewId=worksheet.getActiveNamedSheetViewId();var bCollaborativeChanges=this.worksheet.workbook.bCollaborativeChanges;var redoNamedSheetViewId=autoFiltersObject.namedSheetView;var redoNamedSheetView= worksheet.getNamedSheetViewById(redoNamedSheetViewId);var redoNamedSheetViewName=redoNamedSheetView?redoNamedSheetView.name:null;var activeNamedSheetView=worksheet.getNamedSheetViewById(activeNamedSheetViewId);var activeNamedSheetViewName=activeNamedSheetView?activeNamedSheetView.name:null;var isEqualView=activeNamedSheetViewId!==null&&activeNamedSheetViewName===redoNamedSheetViewName;if(bCollaborativeChanges&&isEqualView)if(this._checkCollaborativeActiveOnFilterApply(autoFiltersObject))return;worksheet.workbook.dependencyFormulas.lockRecal(); var byCurCell=false;if(autoFiltersObject&&null===autoFiltersObject.automaticRowCount&¤tFilter.isAutoFilter()&¤tFilter.isApplyAutoFilter()===false){var automaticRange=this.expandRange(currentFilter.Ref,true);var automaticRowCount=automaticRange.r2;byCurCell=true;var maxFilterRow=currentFilter.Ref.r2;if(automaticRowCount>currentFilter.Ref.r2)maxFilterRow=automaticRowCount;autoFiltersObject.automaticRowCount=maxFilterRow}var oldFilter=filterObj.filter.clone(null);History.Create_NewPoint(); History.StartTransaction();var autoFilter=filterObj.filter.getAutoFilter();var rangeOldFilter=oldFilter.Ref;var newFilterColumn,filterRange;if(byCurCell&&filterObj.ColId>=0&&filterObj.startColId>=0&&filterObj.ColId!==filterObj.startColId){newFilterColumn=new window["AscCommonExcel"].FilterColumn;newFilterColumn.ColId=filterObj.startColId;filterRange=worksheet.getRange3(autoFilter.Ref.r1+1,filterObj.startColId+autoFilter.Ref.c1,autoFilter.Ref.r2,filterObj.startColId+autoFilter.Ref.c1);autoFiltersObject= tryConvertFilter?this._tryConvertCustomFilter(autoFiltersObject,filterRange):autoFiltersObject;newFilterColumn.createFilter(autoFiltersObject);newFilterColumn.init(filterRange);autoFilter.setRowHidden(worksheet,newFilterColumn);History.EndTransaction();return{minChangeRow:minChangeRow,rangeOldFilter:rangeOldFilter,nOpenRowsCount:null,nAllRowsCount:null}}if(!autoFilter)autoFilter=filterObj.filter.addAutoFilter();var nsvFilter,nsvFilterIndex;if(activeNamedSheetViewId!==null&&!bCollaborativeChanges|| redoNamedSheetViewName){if(redoNamedSheetViewName&&redoNamedSheetViewName!==activeNamedSheetViewName)nsvFilter=worksheet.getNvsFilterByTableName(filterObj.filter.DisplayName,redoNamedSheetViewName);else nsvFilter=worksheet.getNvsFilterByTableName(filterObj.filter.DisplayName);if(nsvFilter){oldFilter=nsvFilter.clone();newFilterColumn=nsvFilter.getColumnFilterByColId(filterObj.ColId,true);if(!newFilterColumn){newFilterColumn=new window["AscCommonExcel"].FilterColumn;newFilterColumn.ColId=filterObj.ColId; var _columnFilter=new window["Asc"].CT_ColumnFilter;_columnFilter.colId=newFilterColumn.ColId;_columnFilter.filter=newFilterColumn;nsvFilter.columnsFilter.push(_columnFilter)}else{nsvFilterIndex=newFilterColumn.index;newFilterColumn=newFilterColumn.filter;newFilterColumn.clean()}}}else if(filterObj.index!==null){newFilterColumn=autoFilter.FilterColumns[filterObj.index];newFilterColumn.clean()}else{newFilterColumn=autoFilter.addFilterColumn();newFilterColumn.ColId=filterObj.ColId}filterRange=worksheet.getRange3(autoFilter.Ref.r1+ 1,filterObj.ColId+autoFilter.Ref.c1,autoFilter.Ref.r2,filterObj.ColId+autoFilter.Ref.c1);autoFiltersObject=tryConvertFilter?this._tryConvertCustomFilter(autoFiltersObject,filterRange):autoFiltersObject;var allFilterOpenElements=newFilterColumn.createFilter(autoFiltersObject);newFilterColumn.init(filterRange);if(newFilterColumn.Top10&&newFilterColumn.Top10.FilterVal&&autoFiltersObject.filter&&autoFiltersObject.filter.filter)autoFiltersObject.filter.filter.FilterVal=newFilterColumn.Top10.FilterVal; if(allFilterOpenElements&&!nsvFilter&&autoFilter.FilterColumns&&autoFilter.FilterColumns[filterObj.index])if(autoFilter.FilterColumns[filterObj.index].ShowButton!==false)autoFilter.FilterColumns.splice(filterObj.index,1);else autoFilter.FilterColumns[filterObj.index].clean();else if(allFilterOpenElements&&nsvFilter&&nsvFilterIndex!==undefined&&nsvFilter.columnsFilter[nsvFilterIndex])if(nsvFilter.columnsFilter[nsvFilterIndex].filter.ShowButton!==false)nsvFilter.columnsFilter.splice(nsvFilterIndex, 1);else nsvFilter.columnsFilter[nsvFilterIndex].filter.clean();if(autoFiltersObject.automaticRowCount&&filterObj.filter&&filterObj.filter.Ref&&filterObj.filter.isAutoFilter()){var currentDiff=filterObj.filter.Ref.r2-filterObj.filter.Ref.r1;var newDiff=autoFiltersObject.automaticRowCount-filterObj.filter.Ref.r1;if(newDiff>currentDiff)filterObj.filter.changeRef(null,newDiff-currentDiff)}var nOpenRowsCount=null;var nAllRowsCount=null;if(!bUndoChanges&&!bRedoChanges||!window["AscCommonExcel"].filteringMode|| isEqualView){var oldLocalChange=History.LocalChange;if(nsvFilter)History.LocalChange=true;if(!(bCollaborativeChanges&&activeNamedSheetView!==null)||isEqualView){if(isEqualView&&bCollaborativeChanges)this.worksheet.workbook.bCollaborativeChanges=false;var hiddenProps=autoFilter.setRowHidden(worksheet,newFilterColumn,nsvFilter?nsvFilter.columnsFilter:null);nOpenRowsCount=hiddenProps.nOpenRowsCount;nAllRowsCount=hiddenProps.nAllRowsCount;minChangeRow=hiddenProps.minChangeRow;if(isEqualView)this.worksheet.workbook.bCollaborativeChanges= bCollaborativeChanges}if(nsvFilter)History.LocalChange=oldLocalChange}if(currentFilter&&!currentFilter.isAutoFilter())this.updateSlicer(currentFilter.DisplayName);if(activeNamedSheetView)autoFiltersObject.namedSheetView=activeNamedSheetView.Id;this._addHistoryObj(oldFilter,AscCH.historyitem_AutoFilter_Apply,{activeCells:ar,autoFiltersObject:autoFiltersObject},null,rangeOldFilter);History.EndTransaction();if(!bUndoChanges&&!bRedoChanges)this._resetTablePartStyle();worksheet.workbook.dependencyFormulas.unlockRecal(); return{minChangeRow:minChangeRow,rangeOldFilter:rangeOldFilter,nOpenRowsCount:nOpenRowsCount,nAllRowsCount:nAllRowsCount}},_tryConvertCustomFilter:function(autoFiltersObject,filterRange){var res=autoFiltersObject;if(autoFiltersObject.filter&&Asc.c_oAscAutoFilterTypes.CustomFilters===autoFiltersObject.filter.type&&autoFiltersObject.filter.filter){var allHideVal=true;var individualMap=[];var values=[];filterRange._foreach(function(cell){var text=window["Asc"].trim(cell.getValue());var val=window["Asc"].trim(cell.getValueWithoutFormat()); var textLowerCase=text.toLowerCase();var isDateTimeFormat=cell.getNumFormat().isDateTimeFormat()&&cell.getType()===window["AscCommon"].CellValueType.Number;var dataValue=isDateTimeFormat?AscCommon.NumFormat.prototype.parseDate(val):null;if(individualMap.hasOwnProperty(textLowerCase))return;var checkValue=isDateTimeFormat?val:text;var visible=!autoFiltersObject.filter.filter.isHideValue(checkValue,isDateTimeFormat);individualMap[textLowerCase]=1;if(visible)allHideVal=false;var res=new AutoFiltersOptionsElements; res.asc_setVisible(visible);res.asc_setVal(val);res.asc_setText(text);res.asc_setIsDateFormat(isDateTimeFormat);if(isDateTimeFormat){res.asc_setYear(dataValue.year);res.asc_setMonth(dataValue.month);res.asc_setDay(dataValue.d)}values.push(res)});if(values.length&&!allHideVal){autoFiltersObject.asc_setValues(values);autoFiltersObject.filter.asc_setType(Asc.c_oAscAutoFilterTypes.Filters);autoFiltersObject.filter.filter=null}}return res},updateNamedSheetViewAfterAddFilter:function(filter){var worksheet= this.worksheet;if(worksheet.aNamedSheetViews)for(var i=0;i<worksheet.aNamedSheetViews.length;i++){var activeNamedSheetView=worksheet.aNamedSheetViews[i];if(activeNamedSheetView&&activeNamedSheetView.addFilter)activeNamedSheetView.addFilter(filter)}},updateNamedSheetViewAfterDeleteFilter:function(filter){var worksheet=this.worksheet;worksheet.forEachView(function(view){if(view&&view.deleteFilter)view.deleteFilter(filter)});this._openHiddenRowsByView(filter.Ref)},_openHiddenRowsByView:function(range){var worksheet= this.worksheet;if(worksheet.aNamedSheetViews&&worksheet.aNamedSheetViews.length){this.useViewLocalChange=true;var sheetViewId=worksheet.getActiveNamedSheetViewId();worksheet.setActiveNamedSheetView(worksheet.aNamedSheetViews[0].Id);worksheet.setRowHidden(false,range.r1,range.r2);worksheet.setActiveNamedSheetView(sheetViewId);this.useViewLocalChange=null}},reapplyAllFilters:function(turnOffHistory,openPreviousHiddenRows,ignoreUndoRedo){if(turnOffHistory)History.TurnOff();var worksheet=this.worksheet; if(worksheet.AutoFilter){if(openPreviousHiddenRows&&worksheet.AutoFilter.isApplyAutoFilter())worksheet.setRowHidden(false,worksheet.AutoFilter.Ref.r1,worksheet.AutoFilter.Ref.r2);this.reapplyAutoFilter(null,ignoreUndoRedo)}if(worksheet.TableParts)for(var i=0;i<worksheet.TableParts.length;i++){if(openPreviousHiddenRows&&worksheet.TableParts[i].isApplyAutoFilter())worksheet.setRowHidden(false,worksheet.TableParts[i].Ref.r1,worksheet.TableParts[i].Ref.r2);this.reapplyAutoFilter(worksheet.TableParts[i].DisplayName, ignoreUndoRedo)}if(turnOffHistory)History.TurnOn()},reapplyAutoFilter:function(displayName,ignoreUndoRedo){var worksheet=this.worksheet;var bUndoChanges=worksheet.workbook.bUndoChanges;var bRedoChanges=worksheet.workbook.bRedoChanges;var minChangeRow;var filter=this._getFilterByDisplayName(displayName);if(filter===null)return false;var autoFilter=filter.getAutoFilter();if(autoFilter===null)return false;worksheet.workbook.dependencyFormulas.lockRecal();History.Create_NewPoint();History.StartTransaction(); if(!bUndoChanges&&!bRedoChanges||ignoreUndoRedo){var activeNamedSheetView=worksheet.getActiveNamedSheetViewId();var opt_columnsFilter;if(activeNamedSheetView!==null)opt_columnsFilter=worksheet.getNvsFilterByTableName(displayName);var hiddenProps=autoFilter.setRowHidden(worksheet,null,opt_columnsFilter?opt_columnsFilter.columnsFilter:null);minChangeRow=hiddenProps.minChangeRow}History.EndTransaction();worksheet.workbook.dependencyFormulas.unlockRecal();this.updateSlicer(displayName);return{minChangeRow:minChangeRow, updateRange:filter.Ref,filter:filter}},checkRemoveTableParts:function(delRange,tableRange){var result=true,firstRowRange;if(tableRange&&delRange.containsRange(tableRange)===false){firstRowRange=new Asc.Range(tableRange.c1,tableRange.r1,tableRange.c2,tableRange.r1);result=!firstRowRange.isIntersect(delRange)}return result},searchRangeInTableParts:function(range){var worksheet=this.worksheet;var containRangeId=-1,tableRange;var tableParts=worksheet.TableParts;if(tableParts)for(var i=0;i<tableParts.length;++i){if(!(tableRange= tableParts[i].Ref))continue;if(range.isIntersect(tableRange)){containRangeId=tableRange.containsRange(range)?i:-2;break}}return containRangeId},checkApplyFilterOrSort:function(tablePartId){var worksheet=this.worksheet;var workbook=worksheet.workbook;var result=false;var viewActive=worksheet.getActiveNamedSheetViewId();var _filterColumns,_nvsFilter;if(-1!==tablePartId){var tablePart=worksheet.TableParts[tablePartId];if(viewActive!==null){_nvsFilter=worksheet.getNvsFilterByTableName(tablePart.DisplayName); _filterColumns=_nvsFilter&&_nvsFilter.columnsFilter}else _filterColumns=tablePart.AutoFilter&&tablePart.AutoFilter.FilterColumns&&tablePart.AutoFilter.FilterColumns;if(tablePart.Ref&&(_filterColumns&&_filterColumns.length||tablePart&&tablePart.AutoFilter&&tablePart.isApplySortConditions()))result={isFilterColumns:true,isAutoFilter:true};else if(tablePart.Ref&&tablePart.AutoFilter)result={isFilterColumns:false,isAutoFilter:true};else result={isFilterColumns:false,isAutoFilter:false};if(result&&result.isAutoFilter&& workbook.getSlicersByTableName(tablePart.DisplayName))result.isSlicerAdded=true}else{if(viewActive!==null){_nvsFilter=worksheet.getNvsFilterByTableName(null);_filterColumns=_nvsFilter&&_nvsFilter.columnsFilter}else _filterColumns=worksheet.AutoFilter&&worksheet.AutoFilter.FilterColumns&&worksheet.AutoFilter.FilterColumns;if(worksheet.AutoFilter&&(_filterColumns&&_filterColumns.length&&this._isFilterColumnsContainFilter(_filterColumns)||worksheet.AutoFilter.isApplySortConditions()))result={isFilterColumns:true, isAutoFilter:true};else if(worksheet.AutoFilter)result={isFilterColumns:false,isAutoFilter:true};else result={isFilterColumns:false,isAutoFilter:false}}return result},getAddFormatTableOptions:function(activeCells,userRange,isPivot){var res;if(userRange)activeCells=AscCommonExcel.g_oRangeCache.getAscRange(userRange);var bIsInFilter=this._searchRangeInFilters(activeCells);var addRange;if(false===bIsInFilter)bIsInFilter=null;if(isPivot){res=new AddFormatTableOptions;res.asc_setIsTitle(false);if(bIsInFilter&& !bIsInFilter.isAutoFilter()&&bIsInFilter.Ref.containsRange(activeCells))res.asc_setRange(bIsInFilter.DisplayName);else{if(activeCells.r1===activeCells.r2&&activeCells.c1===activeCells.c2&&!userRange)addRange=this.expandRange(activeCells);else addRange=activeCells.clone();Asc.CT_pivotTableDefinition.prototype.prepareDataRange(this.worksheet,addRange);res.asc_setRange(AscCommon.parserHelp.get3DRef(this.worksheet.getName(),addRange.getAbsName()))}}else{if(null===bIsInFilter||isPivot)if(activeCells.r1=== activeCells.r2&&activeCells.c1===activeCells.c2&&!userRange)addRange=this.expandRange(activeCells);else addRange=activeCells;else if(bIsInFilter.isAutoFilter())addRange=bIsInFilter.Ref;else res=false;if(false!==res){res=new AddFormatTableOptions;var bIsTitle=this._isAddNameColumn(addRange);res.asc_setIsTitle(bIsTitle);res.asc_setRange(addRange.getAbsName())}}return res},Redo:function(type,data){History.TurnOff();switch(type){case AscCH.historyitem_AutoFilter_Add:this.addAutoFilter(data.styleName, data.activeCells,data.addFormatTableOptionsObj,null,data);break;case AscCH.historyitem_AutoFilter_Delete:this.deleteAutoFilter(data.activeCells);break;case AscCH.historyitem_AutoFilter_ChangeTableStyle:this.changeTableStyleInfo(data.styleName,data.activeCells);break;case AscCH.historyitem_AutoFilter_Sort:this.sortColFilter(data.type,data.cellId,data.activeCells,null,data.displayName,data.color);break;case AscCH.historyitem_AutoFilter_Empty:this.isEmptyAutoFilters(data.activeCells,null,null,data.val); break;case AscCH.historyitem_AutoFilter_Apply:this.applyAutoFilter(data.autoFiltersObject,data.activeCells);this.worksheet.handlers.trigger("onFilterInfo");break;case AscCH.historyitem_AutoFilter_Move:this._moveAutoFilters(data.moveTo,data.moveFrom);break;case AscCH.historyitem_AutoFilter_CleanAutoFilter:this.useViewLocalChange=true;this.isApplyAutoFilterInCell(data.activeCells,true,data.viewId?data.viewId:null);this.useViewLocalChange=false;break;case AscCH.historyitem_AutoFilter_Change:if(data!== null&&data.displayName){var redrawTablesArr;if(data.type===true)redrawTablesArr=this.insertLastTableColumn(data.displayName,data.activeCells);else if(data.type===false)redrawTablesArr=this.insertLastTableRow(data.displayName,data.activeCells);if(redrawTablesArr)this.redrawStylesTables(redrawTablesArr)}break;case AscCH.historyitem_AutoFilter_ChangeTableInfo:this.changeFormatTableInfo(data.displayName,data.type,data.val);break;case AscCH.historyitem_AutoFilter_ChangeTableRef:this.changeTableRange(data.displayName, data.moveTo);break;case AscCH.historyitem_AutoFilter_ChangeTableName:this.changeDisplayNameTable(data.displayName,data.val);break;case AscCH.historyitem_AutoFilter_ClearFilterColumn:this.clearFilterColumn(data.cellId,data.displayName,data.viewId?data.viewId:null);break;case AscCH.historyitem_AutoFilter_ChangeColumnName:this.renameTableColumn(null,null,data);break;case AscCH.historyitem_AutoFilter_ChangeTotalRow:this.renameTableColumn(null,null,data);break}History.TurnOn()},Undo:function(type,data){var worksheet= this.worksheet;var undoData=data.undo;var cloneData;var t=this;if(!undoData)return;if(undoData.clone)cloneData=undoData.clone(null);else cloneData=undoData;if(!cloneData)return;var undo_empty=function(){if(cloneData.TableStyleInfo){worksheet.addTablePart(cloneData,true);t._setColorStyleTable(cloneData.Ref,cloneData,null,true)}else worksheet.AutoFilter=cloneData};var undo_change=function(){if(worksheet.AutoFilter&&(cloneData.newFilterRef.isEqual(worksheet.AutoFilter.Ref)||cloneData.oldFilter&&cloneData.oldFilter.isAutoFilter()))worksheet.AutoFilter= cloneData.oldFilter.clone(null);else if(worksheet.TableParts)for(var l=0;l<worksheet.TableParts.length;l++)if(cloneData.newFilterRef&&cloneData.oldFilter&&cloneData.oldFilter.DisplayName===worksheet.TableParts[l].DisplayName){worksheet.changeTablePart(l,cloneData.oldFilter.clone(null),false);var clearRange=new AscCommonExcel.Range(worksheet,cloneData.newFilterRef.r1,cloneData.newFilterRef.c1,cloneData.newFilterRef.r2,cloneData.newFilterRef.c2);clearRange.clearTableStyle();t._setColorStyleTable(cloneData.oldFilter.Ref, cloneData.oldFilter,null,true);t._setStyleTables(cloneData.newFilterRef);worksheet.handlers.trigger("changeRefTablePart",cloneData.oldFilter);break}};var undo_apply=function(){if(cloneData.Ref){var _doAdd=false;if(worksheet.AutoFilter&&worksheet.AutoFilter.Ref.isEqual(cloneData.Ref)){t._reDrawCurrentFilter(cloneData.FilterColumns);worksheet.AutoFilter=cloneData;t._resetTablePartStyle(worksheet.AutoFilter.Ref);_doAdd=true}else if(worksheet.TableParts)for(var l=0;l<worksheet.TableParts.length;l++)if(cloneData.Ref.isEqual(worksheet.TableParts[l].Ref)){worksheet.changeTablePart(l, cloneData,false);if(cloneData.AutoFilter&&cloneData.AutoFilter.FilterColumns)t._reDrawCurrentFilter(cloneData.AutoFilter.FilterColumns,worksheet.TableParts[l]);else t._reDrawCurrentFilter(null,worksheet.TableParts[l]);_doAdd=true;t._resetTablePartStyle(worksheet.TableParts[l].Ref);t.updateSlicer(worksheet.TableParts[l].DisplayName);break}if(!_doAdd)if(cloneData.TableStyleInfo){worksheet.addTablePart.push(cloneData);t._setColorStyleTable(cloneData.Ref,cloneData,null,true);t.updateSlicer(cloneData.DisplayName)}else worksheet.AutoFilter= cloneData}t.worksheet.handlers.trigger("onFilterInfo")};var undo_do=function(){if(worksheet.AutoFilter&&cloneData.oldFilter.isAutoFilter())worksheet.AutoFilter=cloneData.oldFilter.clone(null);else if(worksheet.TableParts)for(var l=0;l<worksheet.TableParts.length;l++)if(cloneData.oldFilter.DisplayName===worksheet.TableParts[l].DisplayName){worksheet.changeTablePart(l,cloneData.oldFilter.clone(null),false);break}};switch(type){case AscCH.historyitem_AutoFilter_Add:if(cloneData.Ref&&(cloneData instanceof AscCommonExcel.AutoFilter||cloneData instanceof AscCommonExcel.TablePart))undo_apply();else this.isEmptyAutoFilters(cloneData.Ref);break;case AscCH.historyitem_AutoFilter_ChangeTableStyle:this.changeTableStyleInfo(cloneData.name,data.activeCells);break;case AscCH.historyitem_AutoFilter_Sort:undo_do();break;case AscCH.historyitem_AutoFilter_Empty:undo_empty();break;case AscCH.historyitem_AutoFilter_Move:this._moveAutoFilters(null,null,data);break;case AscCH.historyitem_AutoFilter_Change:undo_change(); break;case AscCH.historyitem_AutoFilter_ChangeTableInfo:this.changeFormatTableInfo(data.displayName,data.type,undoData.val);break;case AscCH.historyitem_AutoFilter_ChangeTableRef:this.changeTableRange(data.displayName,undoData.moveFrom);break;case AscCH.historyitem_AutoFilter_ChangeTableName:this.changeDisplayNameTable(data.val,data.displayName);break;case AscCH.historyitem_AutoFilter_ChangeColumnName:this.renameTableColumn(null,null,undoData);break;case AscCH.historyitem_AutoFilter_ChangeTotalRow:this.renameTableColumn(null, null,undoData);break;default:if(cloneData.FilterColumns||cloneData.AutoFilter||cloneData.TableColumns||cloneData.Ref&&(cloneData instanceof AscCommonExcel.AutoFilter||cloneData instanceof AscCommonExcel.TablePart))undo_apply();else if(cloneData.columnsFilter){var sheetView=t.worksheet.getNamedSheetViewById(t.worksheet.getActiveNamedSheetViewId());if(sheetView)if(sheetView.nsvFilters.length)for(var i=0;i<sheetView.nsvFilters.length;i++){if(sheetView.nsvFilters[i].tableId===cloneData.tableId){sheetView.nsvFilters[i]= cloneData;break}}else sheetView.nsvFilters.push(cloneData)}break}},reDrawFilter:function(range,row){if(!range&&row===undefined)return;var worksheet=this.worksheet;var tableParts=worksheet.TableParts;if(tableParts){if(range===null&&row!==undefined)range=new Asc.Range(0,row,worksheet.nColsCount-1,row);for(var i=0;i<tableParts.length;i++){var currentFilter=tableParts[i];if(currentFilter&¤tFilter.Ref){var tableRange=currentFilter.Ref;if(range.isIntersect(tableRange)){this._setColorStyleTable(tableRange, currentFilter);this.updateSlicer(currentFilter.DisplayName)}}}}},isEmptyAutoFilters:function(ar,insertType,exceptionArray,bConvertTableFormulaToRef,bNotDeleteAutoFilter){var worksheet=this.worksheet;var activeCells=ar.clone();var t=this;var DeleteColumns=!!(insertType&&(insertType===c_oAscDeleteOptions.DeleteColumns||insertType===c_oAscInsertOptions.InsertColumns));var DeleteRows=!!(insertType&&(insertType===c_oAscDeleteOptions.DeleteRows||insertType===c_oAscInsertOptions.InsertRows));if(DeleteColumns){activeCells.r1= 0;activeCells.r2=AscCommon.gc_nMaxRow-1}else if(DeleteRows){activeCells.c1=0;activeCells.c2=AscCommon.gc_nMaxCol-1}History.StartTransaction();var changeFilter=function(filter,isTablePart,index){var bRes=false;var oldFilter=filter.clone(null);var oRange=AscCommonExcel.Range.prototype.createFromBBox(worksheet,oldFilter.Ref);var bbox=oRange.getBBox0();if(activeCells.containsFirstLineRange(bbox)&&!isTablePart||isTablePart&&activeCells.containsRange(bbox)){t.updateNamedSheetViewAfterDeleteFilter(oldFilter); if(isTablePart){oRange.clearTableStyle();worksheet.deleteTablePart(index,bConvertTableFormulaToRef)}else worksheet.AutoFilter=null;if(oldFilter.isApplyAutoFilter()){var sheetViewId=worksheet.getActiveNamedSheetViewId();worksheet.setActiveNamedSheetView(null);worksheet.setRowHidden(false,bbox.r1,bbox.r2);worksheet.setActiveNamedSheetView(sheetViewId)}if(isTablePart){if(!worksheet.workbook.bUndoChanges&&!worksheet.workbook.bRedoChanges)worksheet.workbook.deleteSlicersByTable(oldFilter.DisplayName); t._addHistoryObj(oldFilter,AscCH.historyitem_AutoFilter_Empty,{activeCells:activeCells,val:bConvertTableFormulaToRef},null,bbox)}else t._addHistoryObj(oldFilter,AscCH.historyitem_AutoFilter_Empty,{activeCells:activeCells},null,oldFilter.Ref);bRes=true}return bRes};worksheet.workbook.dependencyFormulas.lockRecal();if(worksheet.AutoFilter&&!bNotDeleteAutoFilter)changeFilter(worksheet.AutoFilter);if(worksheet.TableParts)for(var i=worksheet.TableParts.length-1;i>=0;i--){var tablePart=worksheet.TableParts[i]; changeFilter(tablePart,true,i)}worksheet.workbook.dependencyFormulas.unlockRecal();t._setStyleTablePartsAfterOpenRows(activeCells);History.EndTransaction()},cleanFormat:function(range){var worksheet=this.worksheet;var t=this,selectedTableParts;if(worksheet.AutoFilter&&worksheet.AutoFilter.Ref&&range.containsFirstLineRange(worksheet.AutoFilter.Ref))this.isEmptyAutoFilters(worksheet.AutoFilter.Ref);else{var deleteFormatCallBack=function(){History.Create_NewPoint();History.StartTransaction();for(var i= 0;i<selectedTableParts.length;i++)t.changeTableStyleInfo(null,selectedTableParts[i].Ref);History.EndTransaction()};selectedTableParts=this._searchFiltersInRange(range,true);if(selectedTableParts&&selectedTableParts.length)deleteFormatCallBack()}},isTablePartContainActiveRange:function(activeRange){var worksheet=this.worksheet;var tableParts=worksheet.TableParts;var tablePart;for(var i=0;i<tableParts.length;i++){tablePart=tableParts[i];if(tablePart&&tablePart.Ref&&tablePart.Ref.containsRange(activeRange)&& !tablePart.Ref.isEqual(activeRange))return true}return false},getTableContainActiveCell:function(activeCell){var oRes=null;if(!activeCell)return oRes;this.forEachTables(function(table){if(table.Ref.contains(activeCell.col,activeCell.row)){oRes=table;return true}else return null});return oRes},isIntersectionTable:function(range){var oRes=null;if(!range)return oRes;this.forEachTables(function(table){if(table.Ref.intersection(range)){oRes=true;return true}});return oRes},forEachTables:function(callback){var worksheet= this.worksheet;var tableParts=worksheet.TableParts;if(tableParts)for(var i=0,l=tableParts.length;i<l;++i){var oRes=callback(tableParts[i],i);if(null!=oRes)return oRes}},_cleanStylesTables:function(redrawTablesArr){for(var i=0;i<redrawTablesArr.length;i++)this._cleanStyleTable(redrawTablesArr[i].oldfilterRef)},_setStylesTables:function(redrawTablesArr){for(var i=0;i<redrawTablesArr.length;i++)this._setColorStyleTable(redrawTablesArr[i].newFilter.Ref,redrawTablesArr[i].newFilter,null,true)},redrawStylesTables:function(redrawTablesArr){this._cleanStylesTables(redrawTablesArr); this._setStylesTables(redrawTablesArr)},insertColumn:function(activeRange,diff,displayNameFormatTable){var worksheet=this.worksheet;var t=this;var bUndoChanges=worksheet.workbook.bUndoChanges;var bRedoChanges=worksheet.workbook.bRedoChanges;activeRange=activeRange.clone();if(this.worksheet.workbook.bCollaborativeChanges&&Asc.CT_NamedSheetView.prototype.asc_getName)this.applyCollaborativeChangedColumnsArr.push({range:activeRange,offset:diff});var redrawTablesArr=[];var changeFilter=function(filter, bTablePart){var ref=filter.Ref;var oldFilter=null;var diffColId=null;if(activeRange.r1<=ref.r1&&activeRange.r2>=ref.r2){if(activeRange.c2<ref.c1){oldFilter=filter.clone(null);filter.moveRef(diff)}else if(activeRange.c1<=ref.c1&&activeRange.c2>=ref.c1){oldFilter=filter.clone(null);if(diff<0){diffColId=ref.c1-activeRange.c2-1;t._deleteCollaborativeActiveAfterDeleteColumn(filter,activeRange);filter.deleteTableColumns(activeRange);filter.changeRef(-diffColId,null,true)}filter.moveRef(diff)}else if(activeRange.c1> ref.c1&&activeRange.c2>=ref.c2&&activeRange.c1<=ref.c2&&diff<0){oldFilter=filter.clone(null);diffColId=activeRange.c1-ref.c2-1;if(diff<0){filter.deleteTableColumns(activeRange);t._deleteCollaborativeActiveAfterDeleteColumn(filter,activeRange)}else filter.addTableColumns(activeRange,t);filter.changeRef(diffColId)}else if(activeRange.c1>=ref.c1&&activeRange.c1<=ref.c2&&activeRange.c2<=ref.c2||activeRange.c1>ref.c1&&activeRange.c2>=ref.c2&&activeRange.c1<ref.c2&&diff>0||activeRange.c1>=ref.c1&&activeRange.c1<= ref.c2&&activeRange.c2>ref.c2&&diff>0){oldFilter=filter.clone(null);if(diff<0){filter.deleteTableColumns(activeRange);t._deleteCollaborativeActiveAfterDeleteColumn(filter,activeRange)}else filter.addTableColumns(activeRange,t);filter.changeRef(diff);diffColId=diff}if(diffColId!==null){var changeFilterColumns=function(_filterColumns,_view,_isActive){for(var j=0;j<_filterColumns.length;j++){var _colId=_view?_filterColumns[j].filter.ColId:_filterColumns[j].ColId;var col=_colId+ref.c1;if(col>=activeRange.c1){var newColId= _colId+diffColId;if(newColId<0||diff<0&&col>=activeRange.c1&&col<=activeRange.c2){_view?_filterColumns[j].filter.clean():_filterColumns[j].clean();if(_isActive)t._openHiddenRowsAfterDeleteColumn(filter,_colId);_filterColumns.splice(j,1);j--}else if(_view)_filterColumns[j].filter.ColId=newColId;else _filterColumns[j].ColId=newColId}}};var viewActive=worksheet.getActiveNamedSheetViewId();if(Asc.CT_NamedSheetView.prototype.getNsvFiltersByTableId)worksheet.forEachView(function(curView,isActive){var nsvFilter= curView.getNsvFiltersByTableId(bTablePart?filter.DisplayName:null);if(nsvFilter.columnsFilter&&nsvFilter.columnsFilter.length)changeFilterColumns(nsvFilter.columnsFilter,true,isActive)});var autoFilter=bTablePart?filter.AutoFilter:filter;if(autoFilter&&autoFilter.FilterColumns&&autoFilter.FilterColumns.length)changeFilterColumns(autoFilter.FilterColumns,null,null===viewActive)}if(!bUndoChanges&&!bRedoChanges&&oldFilter){var changeElement={oldFilter:oldFilter,newFilterRef:filter.Ref.clone()};t._addHistoryObj(changeElement, AscCH.historyitem_AutoFilter_Change,null,true,oldFilter.Ref,null,activeRange)}if(oldFilter&&bTablePart)redrawTablesArr.push({oldfilterRef:oldFilter.Ref,newFilter:filter})}};if(worksheet.AutoFilter)changeFilter(worksheet.AutoFilter);var tableParts=worksheet.TableParts;for(var i=0;i<tableParts.length;i++)changeFilter(tableParts[i],true);if(displayNameFormatTable&&diff>0)redrawTablesArr=redrawTablesArr.concat(this.insertLastTableColumn(displayNameFormatTable,activeRange));return redrawTablesArr},insertLastTableColumn:function(displayNameFormatTable, activeRange){var worksheet=this.worksheet;var t=this;var bUndoChanges=worksheet.workbook.bUndoChanges;var bRedoChanges=worksheet.workbook.bRedoChanges;var redrawTablesArr=[];var changeFilter=function(filter){var oldFilter=filter.clone(null);filter.addTableLastColumn(null,t);filter.changeRef(1);if(!bUndoChanges&&!bRedoChanges&&oldFilter){var changeElement={oldFilter:oldFilter,newFilterRef:filter.Ref.clone()};t.deferredHistoryAction=t._getHistoryObj(changeElement,AscCH.historyitem_AutoFilter_Change, {displayName:displayNameFormatTable,activeCells:activeRange,type:true},false,oldFilter.Ref,null,activeRange)}redrawTablesArr.push({oldfilterRef:oldFilter.Ref,newFilter:filter})};var tablePart=t._getFilterByDisplayName(displayNameFormatTable);if(tablePart)changeFilter(tablePart);return redrawTablesArr},insertRows:function(type,activeRange,insertType,displayNameFormatTable){var worksheet=this.worksheet;var t=this;var bUndoChanges=worksheet.workbook.bUndoChanges;var bRedoChanges=worksheet.workbook.bRedoChanges; var DeleteRows=insertType===c_oAscDeleteOptions.DeleteRows&&type==="delCell"||insertType===c_oAscInsertOptions.InsertRows;activeRange=activeRange.clone();var diff=activeRange.r2-activeRange.r1+1;var redrawTablesArr=[];if(type==="delCell")diff=-diff;if(this.worksheet.workbook.bCollaborativeChanges&&Asc.CT_NamedSheetView.prototype.asc_getName)this.applyCollaborativeChangedRowsArr.push({range:activeRange,offset:diff});if(DeleteRows){activeRange.c1=0;activeRange.c2=AscCommon.gc_nMaxCol-1}var changeFilter= function(filter,bTablePart){var ref=filter.Ref;var oldFilter=null;if(activeRange.c1<=ref.c1&&activeRange.c2>=ref.c2)if(activeRange.r1<=ref.r1){oldFilter=filter.clone(null);filter.moveRef(null,diff,t.worksheet)}else if(activeRange.r1>=ref.r1&&activeRange.r2<=ref.r2){oldFilter=filter.clone(null);if(diff<0&&bTablePart&&activeRange.r1<=ref.r2&&activeRange.r2>=ref.r2)filter.TotalsRowCount=null;filter.changeRef(null,diff)}else if(activeRange.r1>ref.r1&&activeRange.r2>ref.r2&&activeRange.r1<=ref.r2){oldFilter= filter.clone(null);if(diff<0)filter.changeRef(null,diff+(activeRange.r2-ref.r2));else filter.changeRef(null,diff)}if(!bUndoChanges&&!bRedoChanges&&oldFilter){var changeElement={oldFilter:oldFilter,newFilterRef:filter.Ref.clone()};t._addHistoryObj(changeElement,AscCH.historyitem_AutoFilter_Change,null,true,oldFilter.Ref,null,activeRange)}if(oldFilter&&bTablePart){redrawTablesArr.push({oldfilterRef:oldFilter.Ref,newFilter:filter});t.updateSlicer(oldFilter.DisplayName)}};if(worksheet.AutoFilter)changeFilter(worksheet.AutoFilter); var tableParts=worksheet.TableParts;for(var i=0;i<tableParts.length;i++)changeFilter(tableParts[i],true);if(displayNameFormatTable&&type==="insCell")redrawTablesArr=redrawTablesArr.concat(this.insertLastTableRow(displayNameFormatTable,activeRange));return redrawTablesArr},insertLastTableRow:function(displayNameFormatTable,activeRange){var worksheet=this.worksheet;var t=this;var bUndoChanges=worksheet.workbook.bUndoChanges;var bRedoChanges=worksheet.workbook.bRedoChanges;var redrawTablesArr=[];var changeFilter= function(filter){var oldFilter=filter.clone(null);filter.changeRef(null,1);if(!bUndoChanges&&!bRedoChanges&&oldFilter){var changeElement={oldFilter:oldFilter,newFilterRef:filter.Ref.clone()};t._addHistoryObj(changeElement,AscCH.historyitem_AutoFilter_Change,{displayName:displayNameFormatTable,activeCells:activeRange,type:false},false,oldFilter.Ref,null,activeRange)}redrawTablesArr.push({oldfilterRef:oldFilter.Ref,newFilter:filter})};var tablePart=t._getFilterByDisplayName(displayNameFormatTable); if(tablePart)changeFilter(tablePart);return redrawTablesArr},sortColFilter:function(type,cellId,activeRange,sortProps,displayName,color){var curFilter,filterRef,startCol,maxFilterRow;var t=this;if(!sortProps)sortProps=this.getPropForSort(cellId,activeRange,displayName);curFilter=sortProps.curFilter;filterRef=sortProps.filterRef;startCol=sortProps.startCol;maxFilterRow=sortProps.maxFilterRow;var bIsAutoFilter=curFilter.isAutoFilter();var onSortAutoFilterCallback=function(type){History.Create_NewPoint(); History.StartTransaction();var oldFilter=curFilter.clone(null);if(!curFilter.SortState){var sortStateRange=new Asc.Range(curFilter.Ref.c1,curFilter.Ref.r1,curFilter.Ref.c2,maxFilterRow);if(bIsAutoFilter||!bIsAutoFilter&&null===curFilter.HeaderRowCount)sortStateRange.r1++;curFilter.SortState=new AscCommonExcel.SortState;curFilter.SortState.Ref=sortStateRange;curFilter.SortState.SortConditions=[];curFilter.SortState.SortConditions[0]=new AscCommonExcel.SortCondition}else{curFilter.SortState.Ref=new Asc.Range(startCol, filterRef.r1,startCol,filterRef.r2);curFilter.SortState.SortConditions[0]=new AscCommonExcel.SortCondition}var cellIdRange=new Asc.Range(startCol,filterRef.r1,startCol,filterRef.r1);curFilter.SortState.SortConditions[0].Ref=new Asc.Range(startCol,filterRef.r1,startCol,filterRef.r2);curFilter.SortState.SortConditions[0].ConditionDescending=type!==Asc.c_oAscSortOptions.Ascending;if(curFilter.TableStyleInfo)t._setColorStyleTable(curFilter.Ref,curFilter);t._addHistoryObj({oldFilter:oldFilter},AscCH.historyitem_AutoFilter_Sort, {activeCells:cellIdRange,type:type,cellId:cellId,displayName:displayName},null,curFilter.Ref);History.EndTransaction()};var onSortColorAutoFilterCallback=function(type){History.Create_NewPoint();History.StartTransaction();var oldFilter=curFilter.clone(null);if(!curFilter.SortState){var sortStateRange=new Asc.Range(curFilter.Ref.c1,curFilter.Ref.r1,curFilter.Ref.c2,maxFilterRow);if(bIsAutoFilter||!bIsAutoFilter&&null===curFilter.HeaderRowCount)sortStateRange.r1++;curFilter.SortState=new AscCommonExcel.SortState; curFilter.SortState.Ref=sortStateRange;curFilter.SortState.SortConditions=[];curFilter.SortState.SortConditions[0]=new AscCommonExcel.SortCondition}else{curFilter.SortState.Ref=new Asc.Range(startCol,curFilter.Ref.r1,startCol,maxFilterRow);curFilter.SortState.SortConditions[0]=new AscCommonExcel.SortCondition}var cellIdRange=new Asc.Range(startCol,filterRef.r1,startCol,filterRef.r1);curFilter.SortState.SortConditions[0].Ref=new Asc.Range(startCol,filterRef.r1,startCol,filterRef.r2);var newDxf=new AscCommonExcel.CellXfs; if(type===Asc.c_oAscSortOptions.ByColorFill){newDxf.fill=new AscCommonExcel.Fill;newDxf.fill.fromColor(color);curFilter.SortState.SortConditions[0].ConditionSortBy=Asc.ESortBy.sortbyCellColor}else{newDxf.font=new AscCommonExcel.Font;newDxf.font.setColor(color);curFilter.SortState.SortConditions[0].ConditionSortBy=Asc.ESortBy.sortbyFontColor}curFilter.SortState.SortConditions[0].dxf=AscCommonExcel.g_StyleCache.addXf(newDxf);if(curFilter.TableStyleInfo)t._setColorStyleTable(curFilter.Ref,curFilter); t._addHistoryObj({oldFilter:oldFilter},AscCH.historyitem_AutoFilter_Sort,{activeCells:cellIdRange,type:type,cellId:cellId,color:color,displayName:displayName},null,curFilter.Ref);History.EndTransaction()};switch(type){case Asc.c_oAscSortOptions.Ascending:case Asc.c_oAscSortOptions.Descending:{onSortAutoFilterCallback(type);break}case Asc.c_oAscSortOptions.ByColorFill:case Asc.c_oAscSortOptions.ByColorFont:{onSortColorAutoFilterCallback(type);break}}},getPropForSort:function(cellId,activeRange,displayName){var worksheet= this.worksheet;var t=this;var curFilter,sortRange,filterRef,startCol,maxFilterRow;var isCellIdString=false;if(cellId!==undefined&&cellId!=""&&typeof cellId=="string"){activeRange=t._idToRange(cellId);displayName=undefined;isCellIdString=true}curFilter=this._getFilterByDisplayName(displayName);if(null!==curFilter){filterRef=curFilter.Ref;if(cellId!=="")startCol=filterRef.c1+cellId;else startCol=activeRange.startCol}else{var filter=t.searchRangeInTableParts(activeRange);if(filter===-2)return false; if(filter===-1){if(worksheet.AutoFilter&&worksheet.AutoFilter.Ref){curFilter=worksheet.AutoFilter;filterRef=curFilter.Ref}if(curFilter&&(filterRef.isEqual(activeRange)||cellId!==""||activeRange.isOneCell()&&filterRef.containsRange(activeRange))){if(cellId!==""&&!isCellIdString)startCol=filterRef.c1+cellId;else startCol=activeRange.startCol;if(startCol===undefined)startCol=activeRange.c1}else return null}else{curFilter=worksheet.TableParts[filter];filterRef=curFilter.Ref;startCol=activeRange.startCol; if(startCol===undefined)startCol=activeRange.c1}}var ascSortRange=curFilter.getRangeWithoutHeaderFooter();maxFilterRow=ascSortRange.r2;if(curFilter.isAutoFilter()&&curFilter.isApplyAutoFilter()===false){var automaticRange=this.expandRange(curFilter.Ref,true);var automaticRowCount=automaticRange.r2;if(automaticRowCount>maxFilterRow)maxFilterRow=automaticRowCount}sortRange=worksheet.getRange3(ascSortRange.r1,ascSortRange.c1,maxFilterRow,ascSortRange.c2);return{sortRange:sortRange,curFilter:curFilter, filterRef:filterRef,startCol:startCol,maxFilterRow:maxFilterRow}},isApplyAutoFilterInCell:function(activeCell,clean,viewId){var worksheet=this.worksheet;var autoFilter;if(worksheet.TableParts){var tablePart;for(var i=0;i<worksheet.TableParts.length;i++){tablePart=worksheet.TableParts[i];autoFilter=this.getAutoFilter(tablePart,viewId);if(autoFilter&&autoFilter.isApplyAutoFilter()||tablePart.isApplySortConditions()){if(tablePart.Ref.containsRange(activeCell))if(clean)return this._cleanFilterColumnsAndSortState(tablePart, tablePart.Ref,viewId)}else if(tablePart.Ref.containsRange(activeCell))return false}}autoFilter=this.getAutoFilter(worksheet.AutoFilter,viewId);if(autoFilter||worksheet.AutoFilter&&worksheet.AutoFilter.isApplySortConditions())if(clean)return this._cleanFilterColumnsAndSortState(worksheet.AutoFilter,worksheet.AutoFilter.Ref,viewId);return false},getAutoFilter:function(obj,viewId){if(!obj)return null;var ws=this.worksheet;var activeNamedSheetView=viewId!==undefined?viewId:ws.getActiveNamedSheetViewId(); var filter;if(activeNamedSheetView!==null)filter=ws.getNvsFilterByTableName(obj.isAutoFilter()?null:obj.DisplayName,null,activeNamedSheetView);else filter=obj.isAutoFilter()?obj:obj.AutoFilter;return filter},isRangeIntersectionSeveralTableParts:function(activeRange){var worksheet=this.worksheet;var tableParts=worksheet.TableParts;var numPartOfTablePart=0,isAllTablePart;for(var i=0;i<tableParts.length;i++)if(activeRange.intersection(tableParts[i].Ref)){if(activeRange.containsRange(tableParts[i].Ref))isAllTablePart= true;else numPartOfTablePart++;if(numPartOfTablePart>=2||numPartOfTablePart>=1&&isAllTablePart===true)return true}return false},isRangeIntersectionTableOrFilter:function(range){var worksheet=this.worksheet;var tableParts=worksheet.TableParts;for(var i=0;i<tableParts.length;i++)if(range.intersection(tableParts[i].Ref))return true;var filterRef=worksheet.AutoFilter&&worksheet.AutoFilter.Ref;var contains=filterRef&&range.containsRange(filterRef)&&range.r1===filterRef.r1;return filterRef&&range.intersection(filterRef)&& !contains},isStartRangeContainIntoTableOrFilter:function(activeCell){var res=null;var worksheet=this.worksheet;var tableParts=worksheet.TableParts;var startRange=new Asc.Range(activeCell.col,activeCell.row,activeCell.col,activeCell.row);for(var i=0;i<tableParts.length;i++)if(startRange.intersection(tableParts[i].Ref)){res=i;break}if(worksheet.AutoFilter&&worksheet.AutoFilter.Ref&&startRange.intersection(worksheet.AutoFilter.Ref))res=-1;return res},unmergeTablesAfterMove:function(arnTo){var worksheet= this.worksheet;var intersectionRangeWithTableParts=this._intersectionRangeWithTableParts(arnTo);if(intersectionRangeWithTableParts&&intersectionRangeWithTableParts.length)for(var i=0;i<intersectionRangeWithTableParts.length;i++){var tablePart=intersectionRangeWithTableParts[i];worksheet.mergeManager.remove(tablePart.Ref.clone())}},getMaxColRow:function(){var r=-1,c=-1;this.worksheet.TableParts.forEach(function(item){r=Math.max(r,item.Ref.r2);c=Math.max(c,item.Ref.c2)});return new AscCommon.CellBase(r, c)},_setStyleTablePartsAfterOpenRows:function(ref){var worksheet=this.worksheet;var tableParts=worksheet.TableParts;for(var i=0;i<tableParts.length;i++)if(this._intersectionRowRanges(tableParts[i].Ref,ref)===true)this._setColorStyleTable(tableParts[i].Ref,tableParts[i])},_intersectionRowRanges:function(range1,range2){var res=false;if(!range1||!range2)return false;if(range1.r1>=range2.r1&&range1.r1<=range2.r2||range1.r2>=range2.r1&&range1.r2<=range2.r2)res=true;else if(range2.r1>=range1.r1&&range2.r1<= range1.r2||range2.r2>=range1.r1&&range2.r2<=range1.r2)res=true;return res},_moveAutoFilters:function(arnTo,arnFrom,data,copyRange,offLock,activeRange,wsTo){var worksheet=this.worksheet;var isUpdate=null;var moveOneSheet=!wsTo||wsTo.Id===worksheet.Id;wsTo=!wsTo?worksheet:wsTo;var bUndoChanges=worksheet.workbook.bUndoChanges;var bRedoChanges=worksheet.workbook.bRedoChanges;if(arnTo==null&&arnFrom==null&&data){arnTo=data.moveFrom?data.moveFrom:null;arnFrom=data.moveTo?data.moveTo:null;data=data.undo; if(arnTo==null||arnFrom==null)return}wsTo.workbook.dependencyFormulas.lockRecal();var cloneFilterColumns=function(filterColumns){var cloneFilterColumns=[];if(filterColumns&&filterColumns.length)for(var i=0;i<filterColumns.length;i++)cloneFilterColumns[i]=filterColumns[i].clone();return cloneFilterColumns};var t=this;var diffCol=arnTo.c1-arnFrom.c1;var diffRow=arnTo.r1-arnFrom.r1;var ref;var range;var oCurFilter;var moveFilterOneSheet=function(moveFilter){if(!oCurFilter)oCurFilter=[];oCurFilter[i]= moveFilter.clone(null);ref=moveFilter.Ref;range=ref;moveFilter.moveRef(diffCol,diffRow);isUpdate=false;if(moveFilter.AutoFilter&&moveFilter.AutoFilter.FilterColumns&&moveFilter.AutoFilter.FilterColumns.length||moveFilter.FilterColumns&&moveFilter.FilterColumns.length){worksheet.setRowHidden(false,ref.r1,ref.r2);isUpdate=true}if(!data&&moveFilter.AutoFilter&&moveFilter.AutoFilter.FilterColumns)moveFilter.AutoFilter.cleanFilters();else if(!data&&moveFilter&&moveFilter.FilterColumns)moveFilter.cleanFilters(); else if(data&&data[i]&&data[i].AutoFilter&&data[i].AutoFilter.FilterColumns)moveFilter.AutoFilter.FilterColumns=cloneFilterColumns(data[i].AutoFilter.FilterColumns);else if(data&&data[i]&&data[i].FilterColumns)moveFilter.FilterColumns=cloneFilterColumns(data[i].FilterColumns);if(oCurFilter[i].TableStyleInfo&&oCurFilter[i]&&moveFilter){t._cleanStyleTable(oCurFilter[i].Ref);t._setColorStyleTable(moveFilter.Ref,moveFilter)}if(!bUndoChanges&&!bRedoChanges)if(!addRedo&&!data){t._addHistoryObj(oCurFilter, AscCH.historyitem_AutoFilter_Move,{arnTo:arnTo,arnFrom:arnFrom,activeCells:activeRange});addRedo=true}else if(!data&&addRedo)t._addHistoryObj(oCurFilter,AscCH.historyitem_AutoFilter_Move,null,null,null,null,activeRange)};var moveTableSheetToSheet=function(moveFilter){var range;var fromFilter;fromFilter=moveFilter.clone(null);t.isEmptyAutoFilters(fromFilter.Ref,null,null,true);if(moveFilter.isAutoFilter())return;var tablePartRange=fromFilter.Ref;var refInsertBinary=arnFrom;diffRow=tablePartRange.r1- refInsertBinary.r1+arnTo.r1;diffCol=tablePartRange.c1-refInsertBinary.c1+arnTo.c1;range=wsTo.getRange3(diffRow,diffCol,diffRow+(tablePartRange.r2-tablePartRange.r1),diffCol+(tablePartRange.c2-tablePartRange.c1));var bWithoutFilter=false;if(!fromFilter.AutoFilter)bWithoutFilter=true;var offset=new AscCommon.CellBase(range.bbox.r1-tablePartRange.r1,range.bbox.c1-tablePartRange.c1);var newDisplayName=fromFilter.DisplayName;var props={bWithoutFilter:bWithoutFilter,tablePart:fromFilter,offset:offset,displayName:newDisplayName}; var tableStyleInfoName=fromFilter.TableStyleInfo?fromFilter.TableStyleInfo.Name:null;wsTo.autoFilters.addAutoFilter(tableStyleInfoName,range.bbox,true,true,props)};var addRedo=false;if(copyRange)this._cloneCtrlAutoFilters(arnTo,arnFrom,offLock);else{var findFilters=this._searchFiltersInRange(arnFrom);if(findFilters)for(var i=0;i<findFilters.length;i++)if(moveOneSheet)moveFilterOneSheet(findFilters[i]);else moveTableSheetToSheet(findFilters[i])}var arnToRange=new Asc.Range(arnTo.c1,arnTo.r1,arnTo.c2, arnTo.r2);var intersectionRangeWithTableParts=wsTo.autoFilters._intersectionRangeWithTableParts(arnToRange);if(intersectionRangeWithTableParts&&intersectionRangeWithTableParts.length){var tablePart;for(var i=0;i<intersectionRangeWithTableParts.length;i++){tablePart=intersectionRangeWithTableParts[i];wsTo.autoFilters._setColorStyleTable(tablePart.Ref,tablePart);wsTo.getRange3(tablePart.Ref.r1,tablePart.Ref.c1,tablePart.Ref.r2,tablePart.Ref.c2).unmerge()}}wsTo.workbook.dependencyFormulas.unlockRecal(); return isUpdate?range:null},afterMoveAutoFilters:function(arnFrom,arnTo,opt_wsTo){var worksheet=this.worksheet;var wsTo=opt_wsTo&&opt_wsTo.model?opt_wsTo.model:worksheet;var afTo=opt_wsTo&&opt_wsTo.model?opt_wsTo.model.autoFilters:this;var intersectionFrom=this._intersectionRangeWithTableParts(arnFrom);var intersectionTo=afTo._intersectionRangeWithTableParts(arnTo);if(intersectionFrom&&intersectionFrom.length===1&&intersectionTo===false){var refTable=intersectionFrom[0]?intersectionFrom[0].Ref:null; if(refTable&&!arnFrom.containsRange(refTable)&&refTable.containsRange(arnFrom)){var intersection=refTable.intersection(arnFrom);var diffRow=arnTo.r1-arnFrom.r1;var diffCol=arnTo.c1-arnFrom.c1;var tempRange=worksheet.getRange3(intersection.r1,intersection.c1,intersection.r2,intersection.c2);tempRange._foreach(function(cellFrom){var xfsFrom=cellFrom.getCompiledStyle();wsTo._getCell(cellFrom.nRow+diffRow,cellFrom.nCol+diffCol,function(cellTo){cellTo.setStyle(xfsFrom)})})}}},isActiveCellsCrossHalfFTable:function(activeCells, val,prop){var InsertCellsAndShiftDown=val===c_oAscInsertOptions.InsertCellsAndShiftDown&&prop==="insCell";var InsertCellsAndShiftRight=val===c_oAscInsertOptions.InsertCellsAndShiftRight&&prop==="insCell";var DeleteCellsAndShiftLeft=val===c_oAscDeleteOptions.DeleteCellsAndShiftLeft&&prop==="delCell";var DeleteCellsAndShiftTop=val===c_oAscDeleteOptions.DeleteCellsAndShiftTop&&prop==="delCell";var DeleteColumns=val===c_oAscDeleteOptions.DeleteColumns&&prop==="delCell";var DeleteRows=val===c_oAscDeleteOptions.DeleteRows&& prop==="delCell";var worksheet=this.worksheet;var tableParts=worksheet.TableParts;var autoFilter=worksheet.AutoFilter;var result=null;var tableRange;var selectAllTable;if(DeleteColumns||DeleteRows){var newActiveRange;if(DeleteRows)newActiveRange=new Asc.Range(0,activeCells.r1,AscCommon.gc_nMaxCol-1,activeCells.r2);else newActiveRange=new Asc.Range(activeCells.c1,0,activeCells.c2,AscCommon.gc_nMaxRow-1);if(tableParts){var selectTablePart=false;selectAllTable=false;for(var i=0;i<tableParts.length;i++){var tablePart= tableParts[i];var dataRange=tablePart.getRangeWithoutHeaderFooter();tableRange=tablePart.Ref;if(newActiveRange.isIntersect(tableRange)){if(selectAllTable&&selectTablePart){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}else if((tablePart.isHeaderRow()||tablePart.isTotalsRow())&&dataRange.r1===dataRange.r2&&activeCells.r1===activeCells.r2&&dataRange.r1===activeCells.r1){worksheet.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}if(newActiveRange.c1<=tableRange.c1&&newActiveRange.c2>=tableRange.c2&&newActiveRange.r1<=tableRange.r1&&newActiveRange.r2>=tableRange.r2){selectAllTable=true;if(selectTablePart){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}}else if(selectAllTable){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError, c_oAscError.Level.NoCritical);return false}else if(selectTablePart){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}else if(DeleteRows)if(!this.checkRemoveTableParts(newActiveRange,tableRange)){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}else{if(activeCells.r1<tableRange.r1&&activeCells.r2>=tableRange.r1&&activeCells.r2< tableRange.r2){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}}else selectTablePart=true}}}return result}if(tableParts)for(var i=0;i<tableParts.length;i++){tableRange=tableParts[i].Ref;selectAllTable=false;if(activeCells.isIntersect(tableRange))if(activeCells.c1<=tableRange.c1&&activeCells.r1<=tableRange.r1&&activeCells.c2>=tableRange.c2&&activeCells.r2>=tableRange.r2)result=true;else{if(InsertCellsAndShiftDown){if(activeCells.c1<= tableRange.c1&&activeCells.c2>=tableRange.c2&&activeCells.r1<=tableRange.r1)selectAllTable=true}else if(InsertCellsAndShiftRight)if(activeCells.r1<=tableRange.r1&&activeCells.r2>=tableRange.r2&&activeCells.c1<=tableRange.c1)selectAllTable=true;if(!selectAllTable){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}}else if(DeleteCellsAndShiftLeft){if(tableRange.c1>activeCells.c1&&((tableRange.r1<=activeCells.r1&& tableRange.r2>=activeCells.r1||tableRange.r1<=activeCells.r2&&tableRange.r2>=activeCells.r2)&&!(tableRange.r1==activeCells.r1&&tableRange.r2==activeCells.r2))){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}}else if(DeleteCellsAndShiftTop){if(tableRange.r1>activeCells.r1&&((tableRange.c1<=activeCells.c1&&tableRange.c2>=activeCells.c1||tableRange.c1<=activeCells.c2&&tableRange.c2>=activeCells.c2)&&!(tableRange.c1== activeCells.c1&&tableRange.c2==activeCells.c2))){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}}else if(InsertCellsAndShiftRight){if(tableRange.c1>activeCells.c1&&((tableRange.r1<=activeCells.r1&&tableRange.r2>=activeCells.r1||tableRange.r1<=activeCells.r2&&tableRange.r2>=activeCells.r2)&&!(tableRange.r1==activeCells.r1&&tableRange.r2==activeCells.r2))){worksheet.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}}else if(tableRange.r1>activeCells.r1&&((tableRange.c1<=activeCells.c1&&tableRange.c2>=activeCells.c1||tableRange.c1<=activeCells.c2&&tableRange.c2>=activeCells.c2)&&!(tableRange.c1>=activeCells.c1&&tableRange.c2<=activeCells.c2))){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}if(DeleteCellsAndShiftLeft&&tableRange.c1> activeCells.c1&&tableRange.r1>=activeCells.r1&&tableRange.r2<=activeCells.r2)result=true;else if(DeleteCellsAndShiftTop&&tableRange.r1>activeCells.r1&&tableRange.c1>=activeCells.c1&&tableRange.c2<=activeCells.c2)result=true;else if(InsertCellsAndShiftRight&&tableRange.c1>=activeCells.c1&&tableRange.r1>=activeCells.r1&&tableRange.r2<=activeCells.r2)result=true;else if(InsertCellsAndShiftDown&&tableRange.r1>=activeCells.r1&&tableRange.c1>=activeCells.c1&&tableRange.c2<=activeCells.c2)result=true}if((DeleteCellsAndShiftLeft|| DeleteCellsAndShiftTop||InsertCellsAndShiftDown||InsertCellsAndShiftRight)&&autoFilter){tableRange=autoFilter.Ref;if(activeCells.isIntersect(tableRange))if(activeCells.c1<=tableRange.c1&&activeCells.r1<=tableRange.r1&&activeCells.c2>=tableRange.c2&&activeCells.r2>=tableRange.r2)result=true;else if((DeleteCellsAndShiftLeft||DeleteCellsAndShiftTop)&&activeCells.c1<=tableRange.c1&&activeCells.r1<=tableRange.r1&&activeCells.c2>=tableRange.c2&&activeCells.r2>=tableRange.r1)result=true;else if(InsertCellsAndShiftDown&& activeCells.c1<=tableRange.c1&&activeCells.r1<=tableRange.r1&&activeCells.c2>=tableRange.c2&&activeCells.r2>=tableRange.r1)result=true;if((InsertCellsAndShiftDown||DeleteCellsAndShiftTop)&&tableRange.r1>activeCells.r1&&((tableRange.c1<=activeCells.c1&&tableRange.c2>=activeCells.c1||tableRange.c1<=activeCells.c2&&tableRange.c2>=activeCells.c2)&&!(tableRange.c1>=activeCells.c1&&tableRange.c2<=activeCells.c2))){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError, c_oAscError.Level.NoCritical);return false}else if(InsertCellsAndShiftRight&&activeCells.c1<=tableRange.c1&&(activeCells.r1>=tableRange.r1&&activeCells.r1<=tableRange.r2||activeCells.r2>=tableRange.r1&&activeCells.r2<=tableRange.r2)&&!(activeCells.r1<=tableRange.r1&&activeCells.r2>=tableRange.r2)){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return false}if(activeCells.c2<tableRange.c1&&activeCells.r1<=tableRange.r1&& activeCells.r2>=tableRange.r2&&(DeleteCellsAndShiftLeft||InsertCellsAndShiftRight))result=true;else if(activeCells.r2<tableRange.r1&&activeCells.c1<=tableRange.c1&&activeCells.c2>=tableRange.c2&&(InsertCellsAndShiftDown||DeleteCellsAndShiftTop))result=true}return result},getTablesIntersectionRange:function(range){var worksheet=this.worksheet;var res=[];var tableParts=worksheet.TableParts;if(tableParts)for(var i=0;i<tableParts.length;i++)if(tableParts[i].Ref.intersection(range))res.push(worksheet.TableParts[i]); return res},changeFormatTableInfo:function(tableName,optionType,val){var worksheet=this.worksheet;var isSetValue=false;var isSetType=false;var tablePart=this._getFilterByDisplayName(tableName);if(!tablePart)return false;History.Create_NewPoint();History.StartTransaction();var bAddHistoryPoint=true,clearRange;var undoData=val!==undefined?!val:undefined;switch(optionType){case c_oAscChangeTableStyleInfo.columnBanded:{tablePart.TableStyleInfo.ShowColumnStripes=!tablePart.TableStyleInfo.ShowColumnStripes; break}case c_oAscChangeTableStyleInfo.columnFirst:{tablePart.TableStyleInfo.ShowFirstColumn=!tablePart.TableStyleInfo.ShowFirstColumn;break}case c_oAscChangeTableStyleInfo.columnLast:{tablePart.TableStyleInfo.ShowLastColumn=!tablePart.TableStyleInfo.ShowLastColumn;break}case c_oAscChangeTableStyleInfo.rowBanded:{tablePart.TableStyleInfo.ShowRowStripes=!tablePart.TableStyleInfo.ShowRowStripes;break}case c_oAscChangeTableStyleInfo.rowTotal:{if(val===false)if(!this._isPartTablePartsUnderRange(tablePart.Ref))AscFormat.ExecuteNoHistory(function(){worksheet.getRange3(tablePart.Ref.r2, tablePart.Ref.c1,tablePart.Ref.r2,tablePart.Ref.c2).deleteCellsShiftUp()},this,[]);else{clearRange=new AscCommonExcel.Range(worksheet,tablePart.Ref.r2,tablePart.Ref.c1,tablePart.Ref.r2,tablePart.Ref.c2);this._clearRange(clearRange,true);tablePart.TotalsRowCount=tablePart.TotalsRowCount===null?1:null;tablePart.changeRef(null,-1,null,true)}else{var rangeUnderTable=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r2+1,tablePart.Ref.c2,tablePart.Ref.r2+1);if(this._isPartTablePartsUnderRange(tablePart.Ref)){if(this._isEmptyRange(rangeUnderTable, 0)){isSetValue=true;isSetType=true;tablePart.TotalsRowCount=tablePart.TotalsRowCount===null?1:null;tablePart.changeRef(null,1,null,true)}}else{AscFormat.ExecuteNoHistory(function(){worksheet.getRange3(tablePart.Ref.r2+1,tablePart.Ref.c1,tablePart.Ref.r2+1,tablePart.Ref.c2).addCellsShiftBottom()},this,[]);isSetValue=true;isSetType=true;tablePart.TotalsRowCount=tablePart.TotalsRowCount===null?1:null;tablePart.changeRef(null,1,null,true)}if(val===true)tablePart.generateTotalsRowLabel(worksheet)}break}case c_oAscChangeTableStyleInfo.rowHeader:{if(val=== false){clearRange=new AscCommonExcel.Range(worksheet,tablePart.Ref.r1,tablePart.Ref.c1,tablePart.Ref.r1,tablePart.Ref.c2);this._clearRange(clearRange,true);tablePart.HeaderRowCount=tablePart.HeaderRowCount===null?0:null;tablePart.changeRef(null,1,true);if(tablePart.AutoFilter){this._openHiddenRows(tablePart);tablePart.AutoFilter=null}}else{var rangeUpTable=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r1-1,tablePart.Ref.c2,tablePart.Ref.r1-1);if(rangeUpTable.r1>=0&&this._isEmptyRange(rangeUpTable, 0)&&this.searchRangeInTableParts(rangeUpTable)===-1){isSetValue=true;tablePart.HeaderRowCount=tablePart.HeaderRowCount===null?0:null;tablePart.changeRef(null,-1,true)}else{worksheet.getRange3(tablePart.Ref.r2+1,tablePart.Ref.c1,tablePart.Ref.r2+1,tablePart.Ref.c2).addCellsShiftBottom();worksheet._moveRange(tablePart.Ref,new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r1+1,tablePart.Ref.c2,tablePart.Ref.r2+1));isSetValue=true;tablePart.HeaderRowCount=tablePart.HeaderRowCount===null?0:null;tablePart.changeRef(null, -1,true)}if(null===tablePart.AutoFilter)tablePart.addAutoFilter()}break}case c_oAscChangeTableStyleInfo.filterButton:{tablePart.showButton(val);break}case c_oAscChangeTableStyleInfo.advancedSettings:{var title=val.asc_getTitle();var description=val.asc_getDescription();undoData=new AdvancedTableInfoSettings;bAddHistoryPoint=false;if(undefined!==title){undoData.asc_setTitle(tablePart.altText);tablePart.changeAltText(title);bAddHistoryPoint=true}if(undefined!==description){undoData.asc_setDescription(tablePart.altTextSummary); tablePart.changeAltTextSummary(description);bAddHistoryPoint=true}break}}if(bAddHistoryPoint)this._addHistoryObj({val:undoData,newFilterRef:tablePart.Ref.clone()},AscCH.historyitem_AutoFilter_ChangeTableInfo,{activeCells:tablePart.Ref.clone(),type:optionType,val:val,displayName:tableName});this._cleanStyleTable(tablePart.Ref);this._setColorStyleTable(tablePart.Ref,tablePart,null,isSetValue,isSetType);History.EndTransaction();return tablePart.Ref.clone()},changeTableRange:function(tableName,range){var tablePart= this._getFilterByDisplayName(tableName);if(!tablePart)return false;var oldFilter=tablePart.clone(null);tablePart.changeRefOnRange(range,this,true);this._addHistoryObj({moveFrom:oldFilter.Ref},AscCH.historyitem_AutoFilter_ChangeTableRef,{activeCells:tablePart.Ref.clone(),arnTo:range,displayName:tableName});this._cleanStyleTable(oldFilter.Ref);this._setColorStyleTable(tablePart.Ref,tablePart,null,true);this.updateSlicer(tableName)},changeDisplayNameTable:function(tableName,newName){var tablePart=this._getFilterByDisplayName(tableName); var worksheet=this.worksheet;if(!tablePart)return false;var oldFilter=tablePart.clone(null);History.Create_NewPoint();History.StartTransaction();worksheet.workbook.dependencyFormulas.changeTableName(tableName,newName);tablePart.changeDisplayName(newName);worksheet.changeTableName(oldFilter.DisplayName,newName);this._addHistoryObj({oldFilter:oldFilter,newFilterRef:tablePart.Ref.clone(),newDisplayName:newName},AscCH.historyitem_AutoFilter_ChangeTableName,{activeCells:tablePart.Ref.clone(),val:newName, displayName:tableName});History.EndTransaction()},checkDeleteAllRowsFormatTable:function(range,emptyRange){var worksheet=this.worksheet;if(worksheet.TableParts&&worksheet.TableParts.length)for(var i=0;i<worksheet.TableParts.length;i++){var table=worksheet.TableParts[i];var intersection=range.intersection(table.Ref);if(null!==intersection&&intersection.r1===table.Ref.r1+1)if(intersection.r2>=table.Ref.r2||table.TotalsRowCount>0&&intersection.r2===table.Ref.r2-1){range.r1++;if(emptyRange){var deleteRange= this.worksheet.getRange3(table.Ref.r1+1,table.Ref.c1,table.Ref.r1+1,table.Ref.c2);deleteRange.cleanText()}break}}return range},convertTableToRange:function(tableName){History.Create_NewPoint();History.StartTransaction();var table=this._getFilterByDisplayName(tableName);this.worksheet.setRowHidden(false,table.Ref.r1,table.Ref.r2);this._convertTableStyleToStyle(table);this.isEmptyAutoFilters(table.Ref,null,null,true);History.EndTransaction()},checkTableAutoExpansion:function(range){var worksheet=this.worksheet; var res=false;if(worksheet.TableParts&&worksheet.TableParts.length)for(var i=0;i<worksheet.TableParts.length;i++){var table=worksheet.TableParts[i];var ref=table.Ref;if(ref.c2+1===range.c1&&range.r1>=ref.r1&&range.r1<=ref.r2){if(this._isEmptyCellsRightRange(ref,range,true))res={name:table.DisplayName,range:new Asc.Range(ref.c1,ref.r1,ref.c2+1,ref.r2)};break}else if(!table.isTotalsRow()&&ref.r2+1===range.r1&&range.c1>=ref.c1&&range.c1<=ref.c2){if(this._isEmptyCellsUnderRange(ref,range,true))res={name:table.DisplayName, range:new Asc.Range(ref.c1,ref.r1,ref.c2,ref.r2+1)};break}}return res},checkTableColumnName:function(tableColumns,name){var res=name;for(var i=0;i<tableColumns.length;i++)if(name.toLowerCase()===tableColumns[i].Name.toLowerCase()){res=this._generateColumnName2(tableColumns);break}return res},_convertTableStyleToStyle:function(table){if(!table)return;var tempRange=this.worksheet.getRange3(table.Ref.r1,table.Ref.c1,table.Ref.r2,table.Ref.c2);tempRange._foreach(function(cell){cell.setStyle(cell.getCompiledStyle())})}, _clearRange:function(range,isClearText){range.clearTableStyle();if(isClearText){History.TurnOff();range.cleanText();History.TurnOn()}},_getPressedFilter:function(activeRange,cellId){var worksheet=this.worksheet;if(cellId!==undefined){var curCellId=cellId.split("af")[0];AscCommonExcel.executeInR1C1Mode(false,function(){activeRange=AscCommonExcel.g_oRangeCache.getAscRange(curCellId).clone()})}var ColId=null;var filter=null;var index=null;var autoFilter;if(worksheet.AutoFilter)if(worksheet.AutoFilter.Ref.containsRange(activeRange)){filter= worksheet.AutoFilter;autoFilter=filter;ColId=activeRange.c1-worksheet.AutoFilter.Ref.c1}if(worksheet.TableParts&&worksheet.TableParts.length)for(var i=0;i<worksheet.TableParts.length;i++)if(worksheet.TableParts[i].Ref.containsRange(activeRange)){filter=worksheet.TableParts[i];autoFilter=filter.AutoFilter;ColId=activeRange.c1-worksheet.TableParts[i].Ref.c1}var startColId=ColId;ColId=this._getTrueColId(filter,ColId,true);if(autoFilter&&autoFilter.FilterColumns)for(var i=0;i<autoFilter.FilterColumns.length;i++)if(autoFilter.FilterColumns[i].ColId=== ColId){index=i;break}return{filter:filter,index:index,activeRange:activeRange,ColId:ColId,startColId:startColId}},_getFilterByDisplayName:function(displayName){var res=null;var worksheet=this.worksheet;if(displayName===null)res=worksheet.AutoFilter;else if(worksheet.TableParts&&worksheet.TableParts.length)for(var i=0;i<worksheet.TableParts.length;i++)if(worksheet.TableParts[i].DisplayName===displayName){res=worksheet.TableParts[i];break}return res},_getColIdColumn:function(filter,cellId,viewId){var res= null;var autoFilterObj=this.getAutoFilter(filter,viewId);var bFilterColumns=autoFilterObj&&autoFilterObj.FilterColumns&&autoFilterObj.FilterColumns.length;if(!bFilterColumns)bFilterColumns=autoFilterObj&&autoFilterObj.columnsFilter&&autoFilterObj.columnsFilter.length;if(bFilterColumns){var rangeCellId=this._idToRange(cellId);var colId=rangeCellId.c1-filter.Ref.c1;res=this._getTrueColId(filter,colId,true)}return res},_addHistoryObj:function(oldObj,type,redoObject,deleteFilterAfterDeleteColRow,activeHistoryRange, bWithoutFilter,activeRange){var ws=this.worksheet;var oHistoryObject=this._getHistoryObj(oldObj,type,redoObject,deleteFilterAfterDeleteColRow,activeHistoryRange,bWithoutFilter);if(!redoObject){oHistoryObject.activeCells=activeRange?activeRange.clone():null;if(type!==AscCH.historyitem_AutoFilter_Change)type=null}if(!activeHistoryRange)activeHistoryRange=null;History.Add(AscCommonExcel.g_oUndoRedoAutoFilters,type,ws.getId(),activeHistoryRange,oHistoryObject)},_getHistoryObj:function(oldObj,type,redoObject, deleteFilterAfterDeleteColRow,activeHistoryRange,bWithoutFilter){var ws=this.worksheet;var oHistoryObject=new AscCommonExcel.UndoRedoData_AutoFilter;oHistoryObject.undo=oldObj;if(redoObject){oHistoryObject.activeCells=redoObject.activeCells.clone();oHistoryObject.styleName=redoObject.styleName;oHistoryObject.type=redoObject.type;oHistoryObject.cellId=redoObject.cellId;oHistoryObject.autoFiltersObject=redoObject.autoFiltersObject;oHistoryObject.addFormatTableOptionsObj=redoObject.addFormatTableOptionsObj; oHistoryObject.moveFrom=redoObject.arnFrom;oHistoryObject.moveTo=redoObject.arnTo;oHistoryObject.bWithoutFilter=bWithoutFilter?bWithoutFilter:false;oHistoryObject.displayName=redoObject.displayName;oHistoryObject.val=redoObject.val;oHistoryObject.color=redoObject.color;oHistoryObject.tablePart=redoObject.tablePart;oHistoryObject.nCol=redoObject.nCol;oHistoryObject.nRow=redoObject.nRow;oHistoryObject.formula=redoObject.formula;oHistoryObject.totalFunction=redoObject.totalFunction;oHistoryObject.viewId= ws.getActiveNamedSheetViewId();oHistoryObject._type=type}return oHistoryObject},renameTableColumn:function(range,bUndo,props){var worksheet=this.worksheet;var val;var cell;var generateName;var checkRepeateColumnName=function(val,tableColumns,exeptionCol){var res=false;if(tableColumns&&tableColumns.length)for(var i=0;i<tableColumns.length;i++)if(tableColumns[i].Name.toLowerCase()===val.toLowerCase()&&i!==exeptionCol){res=true;break}return res};if(props)range=new Asc.Range(props.nCol,props.nRow,props.nCol, props.nRow);var isStartLockRecal=false;if(worksheet.TableParts){for(var i=0;i<worksheet.TableParts.length;i++){var filter=worksheet.TableParts[i];var ref=filter.Ref;var tableRange=new Asc.Range(ref.c1,ref.r1,ref.c2,ref.r1);var intersection=range.intersection(tableRange);if(null!==intersection&&0!==filter.HeaderRowCount){var toHistory=[];for(var j=tableRange.c1;j<=tableRange.c2;j++){if(j<range.c1||j>range.c2)continue;if(!isStartLockRecal){worksheet.workbook.dependencyFormulas.buildDependency();worksheet.workbook.dependencyFormulas.lockRecal(); isStartLockRecal=true}cell=worksheet.getCell3(ref.r1,j);val=props?props.val:cell.getValueWithFormat();if(val.length>=AscCommon.c_oAscMaxTableColumnTextLength){val=val.substring(0,AscCommon.c_oAscMaxTableColumnTextLength-1);cell.setValue(val)}var oldVal=filter.TableColumns[j-tableRange.c1].Name;var newVal=null;if(val!==""&&checkRepeateColumnName(val,filter.TableColumns,j-tableRange.c1)){filter.TableColumns[j-tableRange.c1].Name="";generateName=this._generateNextColumnName(filter.TableColumns,val); if(!bUndo){cell.setValue(generateName);cell.setType(CellValueType.String)}filter.TableColumns[j-tableRange.c1].Name=generateName;newVal=generateName}else if(val!==""&&intersection.c1<=j&&intersection.c2>=j){filter.TableColumns[j-tableRange.c1].Name=val;if(!bUndo){var valueData=new AscCommonExcel.UndoRedoData_CellValueData(null,new AscCommonExcel.CCellValue({text:cell.getValueWithFormat()}));cell.setValueData(valueData);cell.setType(CellValueType.String)}newVal=val}else if(val===""){filter.TableColumns[j- tableRange.c1].Name="";generateName=this._generateColumnName(filter.TableColumns);if(!bUndo){cell.setValue(generateName);cell.setType(CellValueType.String)}filter.TableColumns[j-tableRange.c1].Name=generateName;newVal=generateName}if(null!==newVal)toHistory.push([{nCol:cell.bbox.c1,nRow:cell.bbox.r1,val:oldVal},AscCH.historyitem_AutoFilter_ChangeColumnName,{activeCells:range,nCol:cell.bbox.c1,nRow:cell.bbox.r1,val:newVal}])}worksheet.handlers.trigger("changeColumnTablePart",filter.DisplayName);for(var k= 0;k<toHistory.length;++k){this._addHistoryObj.apply(this,toHistory[k]);worksheet.changeTableColName(filter.DisplayName,toHistory[k][0].val,toHistory[k][2].val)}}else this._changeTotalsRowData(filter,range,props)}if(isStartLockRecal)worksheet.workbook.dependencyFormulas.unlockRecal()}},_changeTotalsRowData:function(tablePart,range,props){if(!tablePart||!range||!tablePart.TotalsRowCount)return false;var worksheet=this.worksheet;var tableRange=tablePart.Ref;var totalRange=new Asc.Range(tableRange.c1, tableRange.r2,tableRange.c2,tableRange.r2);var isIntersection=totalRange.intersection(range);var newFormulas=[];if(isIntersection)for(var j=isIntersection.c1;j<=isIntersection.c2;j++){var cell=worksheet.getCell3(tableRange.r2,j);var tableColumn=tablePart.TableColumns[j-tableRange.c1];var formula=null;var label=null;var totalFunction;if(props)if(props.formula)formula=props.formula;else if(props.totalFunction)totalFunction=props.totalFunction;else label=props.val;else if(cell.isFormula())formula=cell.getFormula(); else label=cell.getValue();var oldLabel=tableColumn.getTotalsRowLabel();var oldFormula=tableColumn.getTotalsRowFormula();var oldTotalFunction=tableColumn.getTotalsRowFunction();if(null!==formula)tableColumn.setTotalsRowFormula(formula,worksheet);else if(totalFunction)tableColumn.setTotalsRowFunction(totalFunction);else{tableColumn.setTotalsRowLabel(label);cell.setType(CellValueType.String)}var _formula=tableColumn.getTotalRowFormula(tablePart,true);newFormulas.push(_formula?"="+_formula:"");this._addHistoryObj({nCol:cell.bbox.c1, nRow:cell.bbox.r1,formula:oldFormula,val:oldLabel,totalFunction:oldTotalFunction},AscCH.historyitem_AutoFilter_ChangeTotalRow,{activeCells:range,nCol:cell.bbox.c1,nRow:cell.bbox.r1,formula:formula,val:label,totalFunction:totalFunction})}return newFormulas.length?newFormulas:null},_isTablePartsContainsRange:function(range){var worksheet=this.worksheet;var result=null;if(worksheet.TableParts&&worksheet.TableParts.length)for(var i=0;i<worksheet.TableParts.length;i++)if(worksheet.TableParts[i].Ref.containsRange(range)){result= worksheet.TableParts[i];break}return result},_getAdjacentCellsAF2:function(ar){var ws=this.worksheet;var cloneActiveRange=ar.clone(true);var isEnd=false,cell,result;var prevActiveRange={r1:cloneActiveRange.r1,c1:cloneActiveRange.c1,r2:cloneActiveRange.r2,c2:cloneActiveRange.c2};while(isEnd===false){var isEndWhile=false;var n=cloneActiveRange.r1;var k=cloneActiveRange.c1-1;while(!isEndWhile){if(n<0)n++;if(k<0)k++;result=this._checkValueInCells(n,k,cloneActiveRange);cloneActiveRange=result.cloneActiveRange; if(n===0)isEndWhile=true;if(!result.isEmptyCell){k=cloneActiveRange.c1-1;n--}else if(k===cloneActiveRange.c2+1)isEndWhile=true;else k++}isEndWhile=false;n=cloneActiveRange.r2;k=cloneActiveRange.c1-1;while(!isEndWhile){if(n<0)n++;if(k<0)k++;result=this._checkValueInCells(n,k,cloneActiveRange);cloneActiveRange=result.cloneActiveRange;if(n===ws.nRowsCount)isEndWhile=true;if(!result.isEmptyCell){k=cloneActiveRange.c1-1;n++}else if(k===cloneActiveRange.c2+1)isEndWhile=true;else k++}isEndWhile=false;n= cloneActiveRange.r1-1;k=cloneActiveRange.c1;while(!isEndWhile){if(n<0)n++;if(k<0)k++;result=this._checkValueInCells(n++,k,cloneActiveRange);cloneActiveRange=result.cloneActiveRange;if(k===0)isEndWhile=true;if(!result.isEmptyCell){n=cloneActiveRange.r1-1;k--}else if(n===cloneActiveRange.r2+1)isEndWhile=true}isEndWhile=false;n=cloneActiveRange.r1-1;k=cloneActiveRange.c2+1;while(!isEndWhile){if(n<0)n++;if(k<0)k++;result=this._checkValueInCells(n++,k,cloneActiveRange);cloneActiveRange=result.cloneActiveRange; if(k===ws.nColsCount)isEndWhile=true;if(!result.isEmptyCell){n=cloneActiveRange.r1-1;k++}else if(n===cloneActiveRange.r2+1)isEndWhile=true}if(prevActiveRange.r1===cloneActiveRange.r1&&prevActiveRange.c1===cloneActiveRange.c1&&prevActiveRange.r2===cloneActiveRange.r2&&prevActiveRange.c2===cloneActiveRange.c2)isEnd=true;prevActiveRange={r1:cloneActiveRange.r1,c1:cloneActiveRange.c1,r2:cloneActiveRange.r2,c2:cloneActiveRange.c2}}if(ar.r1===cloneActiveRange.r1)for(var n=cloneActiveRange.c1;n<=cloneActiveRange.c2;n++){cell= ws.model.getRange3(cloneActiveRange.r1,n,cloneActiveRange.r1,n);if(cell.getValueWithoutFormat()!=="")break;if(n===cloneActiveRange.c2&&cloneActiveRange.c2>cloneActiveRange.c1)cloneActiveRange.r1++}else if(ar.r1===cloneActiveRange.r2)for(var n=cloneActiveRange.c1;n<=cloneActiveRange.c2;n++){cell=ws.model.getRange3(cloneActiveRange.r2,n,cloneActiveRange.r2,n);if(cell.getValueWithoutFormat()!=="")break;if(n===cloneActiveRange.c2&&cloneActiveRange.r2>cloneActiveRange.r1)cloneActiveRange.r2--}if(ar.c1=== cloneActiveRange.c1)for(var n=cloneActiveRange.r1;n<=cloneActiveRange.r2;n++){cell=ws.model.getRange3(n,cloneActiveRange.c1,n,cloneActiveRange.c1);if(cell.getValueWithoutFormat()!=="")break;if(n===cloneActiveRange.r2&&cloneActiveRange.r2>cloneActiveRange.r1)cloneActiveRange.c1++}else if(ar.c1===cloneActiveRange.c2)for(var n=cloneActiveRange.r1;n<=cloneActiveRange.r2;n++){cell=ws.model.getRange3(n,cloneActiveRange.c2,n,cloneActiveRange.c2);if(cell.getValueWithoutFormat()!=="")break;if(n===cloneActiveRange.r2&& cloneActiveRange.c2>cloneActiveRange.c1)cloneActiveRange.c2--}if(ws.AutoFilter||ws.TableParts){var oldFilters=[];if(ws.AutoFilter)oldFilters[0]=ws.AutoFilter;if(ws.TableParts){var s=1;if(!oldFilters[0])s=0;for(k=0;k<ws.TableParts.length;k++)if(ws.TableParts[k].AutoFilter){oldFilters[s]=ws.TableParts[k];s++}}var newRange={},oldRange;for(var i=0;i<oldFilters.length;i++){if(!oldFilters[i].Ref||oldFilters[i].Ref=="")continue;oldRange=oldFilters[i].Ref;if(cloneActiveRange.r1<=oldRange.r1&&cloneActiveRange.r2>= oldRange.r2&&cloneActiveRange.c1<=oldRange.c1&&cloneActiveRange.c2>=oldRange.c2)if(oldRange.r2>ar.r1&&ar.c2>=oldRange.c1&&ar.c2<=oldRange.c2)newRange.r2=oldRange.r1-1;else if(oldRange.r1<ar.r2&&ar.c2>=oldRange.c1&&ar.c2<=oldRange.c2)newRange.r1=oldRange.r2+1;else if(oldRange.c2<ar.c1)newRange.c1=oldRange.c2+1;else if(oldRange.c1>ar.c2)newRange.c2=oldRange.c1-1}if(!newRange.r1)newRange.r1=cloneActiveRange.r1;if(!newRange.c1)newRange.c1=cloneActiveRange.c1;if(!newRange.r2)newRange.r2=cloneActiveRange.r2; if(!newRange.c2)newRange.c2=cloneActiveRange.c2;newRange=new Asc.Range(newRange.c1,newRange.r1,newRange.c2,newRange.r2);cloneActiveRange=newRange}if(cloneActiveRange)return cloneActiveRange;else return ar},_getAdjacentCellsAF:function(ar,ignoreAutoFilter,doNotIncludeMergedCells,ignoreSpaceSymbols){var ws=this.worksheet;var cloneActiveRange=ar.clone(true);var isEnd=true,cell,merged,valueMerg,rowNum=cloneActiveRange.r1,isEmptyCell;var allRange=ws.getRange3(0,0,ws.nRowsCount,ws.nColsCount);var isMergedCells= allRange.hasMerged();for(var n=cloneActiveRange.r1-1;n<=cloneActiveRange.r2+1;n++){if(n<0)continue;if(!isEnd){rowNum=cloneActiveRange.r1;if(cloneActiveRange.r1>0)n=cloneActiveRange.r1-1;if(cloneActiveRange.c1>0)k=cloneActiveRange.c1-1}if(n>cloneActiveRange.r1&&n<cloneActiveRange.r2&&k>cloneActiveRange.c1&&k<cloneActiveRange.c2)continue;isEnd=true;for(var k=cloneActiveRange.c1-1;k<=cloneActiveRange.c2+1;k++){if(k<0)continue;if(k>=cloneActiveRange.c1&&k<=cloneActiveRange.c2&&n>=cloneActiveRange.r1&& n<=cloneActiveRange.r2)continue;cell=ws.getRange3(n,k,n,k);isEmptyCell=cell.isNullText();if(!isEmptyCell&&ignoreSpaceSymbols){var tempVal=cell.getValueWithoutFormat().replace(/\s/g,"");if(""===tempVal)isEmptyCell=true}merged=cell.hasMerged();if(merged&&doNotIncludeMergedCells)continue;if(!(n===ar.r1&&k===ar.c1)&&isMergedCells!=null&&isEmptyCell){valueMerg=null;if(merged){valueMerg=ws.getRange3(merged.r1,merged.c1,merged.r2,merged.c2).getValue();if(valueMerg!=null&&valueMerg!==""){if(merged.r1<cloneActiveRange.r1){cloneActiveRange.r1= merged.r1;n=cloneActiveRange.r1-1}if(merged.r2>cloneActiveRange.r2){cloneActiveRange.r2=merged.r2;n=cloneActiveRange.r2-1}if(merged.c1<cloneActiveRange.c1){cloneActiveRange.c1=merged.c1;k=cloneActiveRange.c1-1}if(merged.c2>cloneActiveRange.c2){cloneActiveRange.c2=merged.c2;k=cloneActiveRange.c2-1}if(n<0)n=0;if(k<0)k=0;cell=ws.getRange3(n,k,n,k)}}}if((!isEmptyCell||valueMerg!=null&&valueMerg!=="")&&cell.getTableStyle()==null){if(k<cloneActiveRange.c1){cloneActiveRange.c1=k;isEnd=false;k=k-2}else if(k> cloneActiveRange.c2){cloneActiveRange.c2=k;isEnd=false}if(n<cloneActiveRange.r1){cloneActiveRange.r1=n;isEnd=false}else if(n>cloneActiveRange.r2){cloneActiveRange.r2=n;isEnd=false}}}}var mergeCells,n;if(ar.r1===cloneActiveRange.r1)for(n=cloneActiveRange.c1;n<=cloneActiveRange.c2;n++){cell=ws.getRange3(cloneActiveRange.r1,n,cloneActiveRange.r1,n);if(cell.getValueWithoutFormat()!=="")break;if(n===cloneActiveRange.c2&&cloneActiveRange.r2>cloneActiveRange.r1)cloneActiveRange.r1++}else if(ar.r1===cloneActiveRange.r2)for(n= cloneActiveRange.c1;n<=cloneActiveRange.c2;n++){cell=ws.getRange3(cloneActiveRange.r2,n,cloneActiveRange.r2,n);if(cell.getValueWithoutFormat()!=="")break;if(n===cloneActiveRange.c2&&cloneActiveRange.r2>cloneActiveRange.r1)cloneActiveRange.r2--}if(ar.c1===cloneActiveRange.c1)for(n=cloneActiveRange.r1;n<=cloneActiveRange.r2;n++){cell=ws.getRange3(n,cloneActiveRange.c1,n,cloneActiveRange.c1);if(cell.getValueWithoutFormat()!=="")break;if(n===cloneActiveRange.r2&&cloneActiveRange.r2>cloneActiveRange.r1)cloneActiveRange.c1++}else if(ar.c1=== cloneActiveRange.c2)for(n=cloneActiveRange.r1;n<=cloneActiveRange.r2;n++){cell=ws.getRange3(n,cloneActiveRange.c2,n,cloneActiveRange.c2);if(cell.getValueWithoutFormat()!=="")break;if(n===cloneActiveRange.r2&&cloneActiveRange.c2>cloneActiveRange.c1){mergeCells=ws.getRange3(n,cloneActiveRange.c2,n,cloneActiveRange.c2).hasMerged();if(!mergeCells)cloneActiveRange.c2--;else if(ws.getRange3(mergeCells.r1,mergeCells.c1,mergeCells.r2,mergeCells.c2).getValue()==="")cloneActiveRange.c2--}}if(ws.AutoFilter|| ws.TableParts){var oldFilters=[];if(ws.AutoFilter&&!ignoreAutoFilter)oldFilters[0]=ws.AutoFilter;if(ws.TableParts){var s=1;if(!oldFilters[0])s=0;for(k=0;k<ws.TableParts.length;k++)if(ws.TableParts[k].AutoFilter){oldFilters[s]=ws.TableParts[k];s++}}var newRange={};for(var i=0;i<oldFilters.length;i++){if(!oldFilters[i].Ref||oldFilters[i].Ref==="")continue;var oldRange=oldFilters[i].Ref;var intersection=oldRange.intersection?oldRange.intersection(cloneActiveRange):null;if(cloneActiveRange.r1<=oldRange.r1&& cloneActiveRange.r2>=oldRange.r2&&cloneActiveRange.c1<=oldRange.c1&&cloneActiveRange.c2>=oldRange.c2)if(oldRange.r2>ar.r1&&ar.c2>=oldRange.c1&&ar.c2<=oldRange.c2)newRange.r2=oldRange.r1-1;else if(oldRange.r1<ar.r2&&ar.c2>=oldRange.c1&&ar.c2<=oldRange.c2)newRange.r1=oldRange.r2+1;else if(oldRange.c2<ar.c1)newRange.c1=oldRange.c2+1;else{if(oldRange.c1>ar.c2)newRange.c2=oldRange.c1-1}else if(intersection)if(intersection.r1>=cloneActiveRange.r1&&intersection.r1<=cloneActiveRange.r2){cloneActiveRange.r2= intersection.r1-1;if(cloneActiveRange.r2<cloneActiveRange.r1)cloneActiveRange.r1=cloneActiveRange.r2}}if(!newRange.r1)newRange.r1=cloneActiveRange.r1;if(!newRange.c1)newRange.c1=cloneActiveRange.c1;if(!newRange.r2)newRange.r2=cloneActiveRange.r2;if(!newRange.c2)newRange.c2=cloneActiveRange.c2;newRange=new Asc.Range(newRange.c1,newRange.r1,newRange.c2,newRange.r2);cloneActiveRange=newRange}if(cloneActiveRange)return cloneActiveRange;else return ar},getExpandRange:function(activeRange){var ws=this.worksheet; var t=this;var lockLeft,lockRight,lockUp,lockDown;var range=activeRange.clone();var checkEmptyCell=function(row,col){var cell=ws.getCell3(row,col);return cell.getValueWithoutFormat()===""};var checkLeft=function(){var col=range.c1-1;if(col<0||lockLeft)return null;if(t._intersectionRangeWithTableParts(new Asc.Range(col,range.r1,col,range.r2))){lockLeft=true;return null}for(var n=range.r1;n<=range.r2;n++)if(!checkEmptyCell(n,col))return true};var checkRight=function(){var col=range.c2+1;if(lockRight)return null; if(t._intersectionRangeWithTableParts(new Asc.Range(col,range.r1,col,range.r2))){lockRight=true;return null}for(var n=range.r1;n<=range.r2;n++)if(!checkEmptyCell(n,col))return true};var checkUp=function(){var row=range.r1-1;if(lockUp)return null;if(t._intersectionRangeWithTableParts(new Asc.Range(range.c1,row,range.c2,row))){lockUp=true;return null}for(var n=range.c1;n<=range.c2;n++)if(!checkEmptyCell(row,n))return true};var checkDown=function(){var row=range.r2+1;if(lockDown)return null;if(t._intersectionRangeWithTableParts(new Asc.Range(range.c1, row,range.c2,row))){lockDown=true;return null}for(var n=range.c1;n<=range.c2;n++)if(!checkEmptyCell(row,n))return true};var isInput;while(true){isInput=false;if(checkLeft()){range.c1--;isInput=true}if(checkRight()){range.c2++;isInput=true}if(checkUp()){range.r1--;isInput=true}if(checkDown()){range.r2++;isInput=true}if(false===isInput)break}return range},expandRange:function(activeRange,ignoreFilter,doNotCheckEmpty){var ws=this.worksheet;var mergeOffset=null;var rangeAfterTableCrop;var checkEmptyCell= function(row,col){if(rangeAfterTableCrop&&!rangeAfterTableCrop.contains(col,row))return true;var cell=ws.getCell3(row,col);mergeOffset=cell.hasMerged();if(mergeOffset)cell=ws.getCell3(mergeOffset.r1,mergeOffset.c1);return cell.isEmptyTextString()};var checkEmptyRange=function(r1,c1,r2,c2){var res=true;var range3=ws.getRange3(r1,c1,r2,c2);if(rangeAfterTableCrop&&!rangeAfterTableCrop.containsRange(range3.bbox))return true;mergeOffset=range3.hasMerged();if(mergeOffset){var union=mergeOffset.union(range3.bbox); range3=ws.getRange3(union.r1,union.c1,union.r2,union.c2)}range3._foreachNoEmpty(function(cell){if(!cell.isEmptyTextString()){res=false;return true}});return res};var changeMergeRange=function(){if(mergeOffset)if(!range.containsRange(mergeOffset)){if(mergeOffset.r1<range.r1)range.r1=mergeOffset.r1;if(mergeOffset.c1<range.c1)range.c1=mergeOffset.c1;if(mergeOffset.r2>range.r2)range.r2=mergeOffset.r2;if(mergeOffset.c2>range.c2)range.c2=mergeOffset.c2;return true}return false};var range=activeRange.clone(); var countI=0;var doExpand=function(){while(true){countI++;if(countI>1E7)break;if(range.c1>=1&&!checkEmptyCell(range.r2,range.c1-1)){if(!changeMergeRange())range.c1--;continue}if(!checkEmptyCell(range.r2+1,range.c1)){if(!changeMergeRange())range.r2++;continue}if(!checkEmptyCell(range.r1,range.c2+1)){if(!changeMergeRange())range.c2++;continue}if(range.r1>=1&&!checkEmptyCell(range.r1-1,range.c2)){if(!changeMergeRange())range.r1--;continue}if(range.c1>=1&&!checkEmptyCell(range.r2+1,range.c1-1)){if(!changeMergeRange()){range.c1--; range.r2++}continue}if(range.c1>=1&&range.r1>=1&&!checkEmptyCell(range.r1-1,range.c1-1)){if(!changeMergeRange()){range.c1--;range.r1--}continue}if(!checkEmptyCell(range.r2+1,range.c2+1)){if(!changeMergeRange()){range.c2++;range.r2++}continue}if(range.r1>=1&&!checkEmptyCell(range.r1-1,range.c2+1)){if(!changeMergeRange()){range.c2++;range.r1--}continue}if(range.r1>=1&&!checkEmptyRange(range.r1-1,range.c1,range.r1-1,range.c2)){if(!changeMergeRange())range.r1--;continue}if(!checkEmptyRange(range.r2+1, range.c1,range.r2+1,range.c2)){if(!changeMergeRange())range.r2++;continue}if(range.c1>=1&&!checkEmptyRange(range.r1,range.c1-1,range.r2,range.c1-1)){if(!changeMergeRange())range.c1--;continue}if(!checkEmptyRange(range.r1,range.c2+1,range.r2,range.c2+1)){if(!changeMergeRange())range.c2++;continue}break}};doExpand();var doCropRange=function(ref){var intersection=ref.intersection(range);if(intersection){var tempRange;if(range.c1<intersection.c1){tempRange=new Asc.Range(range.c1,range.r1,intersection.c1- 1,range.r2);if(tempRange.containsRange(activeRange)){range=tempRange;return true}}if(range.c2>intersection.c2){tempRange=new Asc.Range(intersection.c2+1,range.r1,range.c2,range.r2);if(tempRange.containsRange(activeRange)){range=tempRange;return true}}if(range.r1<intersection.r1){tempRange=new Asc.Range(range.c1,range.r1,range.c2,intersection.r1-1);if(tempRange.containsRange(activeRange)){range=tempRange;return true}}if(range.r2>intersection.r2){tempRange=new Asc.Range(range.c1,intersection.r2+1,range.c2, range.r2);if(tempRange.containsRange(activeRange)){range=tempRange;return true}}return false}};var bIsChangedRange;if(ws.TableParts)for(var k=0;k<ws.TableParts.length;k++)if(ws.TableParts[k])if(doCropRange(ws.TableParts[k].Ref))bIsChangedRange=true;if(!ignoreFilter&&ws.AutoFilter&&ws.AutoFilter.Ref)if(doCropRange(ws.AutoFilter.Ref))bIsChangedRange=true;if(bIsChangedRange){rangeAfterTableCrop=range.clone();range=activeRange.clone();doExpand()}return doNotCheckEmpty?range:this.checkEmptyAreas(range, rangeAfterTableCrop)},checkEmptyAreas:function(range,rangeAfterTableCrop){if(!range)return range;range=range.clone();var iter=0;var ws=this.worksheet;var checkEmptyRange=function(r1,c1,r2,c2){var res=true;var range3=ws.getRange3(r1,c1,r2,c2);if(rangeAfterTableCrop&&!rangeAfterTableCrop.containsRange(range3.bbox))return true;var mergeOffset=range3.hasMerged();if(mergeOffset){var union=mergeOffset.union(range3.bbox);range3=ws.getRange3(union.r1,union.c1,union.r2,union.c2)}range3._foreachNoEmpty(function(cell){if(!cell.isEmptyTextString()){res= false;return true}});return res};while(true){iter++;if(iter>1E7)break;if(range.r1<range.r2&&checkEmptyRange(range.r1,range.c1,range.r1,range.c2)){range.r1++;continue}if(range.r1<range.r2&&checkEmptyRange(range.r2,range.c1,range.r2,range.c2)){range.r2--;continue}if(range.c1<range.c2&&checkEmptyRange(range.r1,range.c1,range.r2,range.c1)){range.c1++;continue}if(range.c1<range.c2&&checkEmptyRange(range.r1,range.c2,range.r2,range.c2)){range.c2--;continue}break}return range},checkExpandRangeForSort:function(range){var ws= this.worksheet;var filterDefName=ws.workbook.getDefinesNames("_xlnm._filterdatabase",ws.getId());if(filterDefName){var filterDefNameRef=false;AscCommonExcel.executeInR1C1Mode(false,function(){filterDefNameRef=AscCommonExcel.getRangeByRef(filterDefName.ref,ws,true,true)});if(filterDefNameRef&&filterDefNameRef.length){filterDefNameRef=filterDefNameRef[0];if(filterDefNameRef&&filterDefNameRef.bbox){filterDefNameRef=filterDefNameRef.bbox;if(range.intersection(filterDefNameRef))if(range.containsRange(filterDefNameRef))range= new Asc.Range(range.c1,filterDefNameRef.r1,range.c2,range.r2);else{range=range.union(filterDefNameRef);range=new Asc.Range(range.c1,filterDefNameRef.r1,range.c2,range.r2)}}}}return range},cutRangeByDefinedCells:function(range){if(!range)return range;var res=range.clone();var minRow,maxRow,minCol,maxCol;this.worksheet.getRange3(0,0,AscCommon.gc_nMaxRow0,AscCommon.gc_nMaxCol0)._foreachNoEmptyByCol(function(cell,row,col){if(minRow===undefined){minRow=row;maxRow=row;minCol=col;maxCol=col}if(row<minRow)minRow= row;if(row>maxRow)maxRow=row;if(col<minCol)minCol=col;if(col>maxCol)maxCol=col});if(res.r1<minRow&&minRow<=res.r2)res.r1=minRow;if(res.r2>maxRow&&maxRow>=res.r1)res.r2=maxRow;if(res.c1<minCol&&minCol<=res.c2)res.c1=minCol;if(res.c2>maxCol&&maxCol>=res.c1)res.c2=maxCol;return res},_addNewFilter:function(ref,style,bWithoutFilter,tablePartDisplayName,tablePart,offset){var worksheet=this.worksheet;var newFilter;var newTableName=tablePartDisplayName?tablePartDisplayName:worksheet.workbook.dependencyFormulas.getNextTableName(); if(!style){if(!worksheet.AutoFilter){newFilter=new AscCommonExcel.AutoFilter;newFilter.Ref=ref;worksheet.AutoFilter=newFilter}var row=ref.r1;var cell,filterColumn;for(var col=ref.c1;col<=ref.c2;col++){cell=worksheet.getCell3(row,col);var isMerged=cell.hasMerged();var isMergedAllRow=isMerged&&isMerged.c2+1==AscCommon.gc_nMaxCol&&isMerged.c1===0;if(isMerged&&isMerged.c2!==col&&!isMergedAllRow&&ref.c2!==col||isMergedAllRow&&col!==ref.c1){filterColumn=worksheet.AutoFilter.addFilterColumn();filterColumn.ColId= col-ref.c1;filterColumn.ShowButton=false}}return worksheet.AutoFilter}else{newFilter=worksheet.createTablePart();newFilter.Ref=ref;newFilter.TableStyleInfo=new AscCommonExcel.TableStyleInfo;newFilter.TableStyleInfo.Name=style;if(tablePart&&tablePart.TableStyleInfo&&tablePart.TableStyleInfo.ShowColumnStripes!==null&&tablePart.TableStyleInfo.ShowColumnStripes!==undefined){newFilter.TableStyleInfo.ShowColumnStripes=tablePart.TableStyleInfo.ShowColumnStripes;newFilter.TableStyleInfo.ShowFirstColumn=tablePart.TableStyleInfo.ShowFirstColumn; newFilter.TableStyleInfo.ShowLastColumn=tablePart.TableStyleInfo.ShowLastColumn;newFilter.TableStyleInfo.ShowRowStripes=tablePart.TableStyleInfo.ShowRowStripes;newFilter.HeaderRowCount=tablePart.HeaderRowCount;newFilter.TotalsRowCount=tablePart.TotalsRowCount}else{newFilter.TableStyleInfo.ShowColumnStripes=false;newFilter.TableStyleInfo.ShowFirstColumn=false;newFilter.TableStyleInfo.ShowLastColumn=false;newFilter.TableStyleInfo.ShowRowStripes=true}if(!bWithoutFilter)newFilter.addAutoFilter();newFilter.DisplayName= newTableName;var tableColumns;if(tablePart&&tablePart.TableColumns){var cloneTableColumns=[];for(var i=0;i<tablePart.TableColumns.length;i++)cloneTableColumns.push(tablePart.TableColumns[i].clone());tableColumns=cloneTableColumns}else tableColumns=this._generateColumnNameWithoutTitle(ref);newFilter.TableColumns=tableColumns;worksheet.addTablePart(newFilter,true);if(tablePart){var renameParams={};renameParams.offset=offset;renameParams.tableNameMap={};renameParams.tableNameMap[tablePart.DisplayName]= newTableName;newFilter.renameSheetCopy(worksheet,renameParams)}return worksheet.TableParts[worksheet.TableParts.length-1]}},getOpenAndClosedValues:function(filter,colId,doOpenHide,sortObj){var isTablePart=!filter.isAutoFilter(),autoFilter=filter.getAutoFilter(),ref=filter.Ref;var worksheet=this.worksheet,textIndexMap={},isDateTimeFormat,dataValue,values=[];var _hideValues=[],textIndexMapHideValues={};var hideItemsWithNoData=sortObj?sortObj.hideItemsWithNoData:null;var fullValues=sortObj?sortObj.fullValues&& !hideItemsWithNoData:null;var isAscending=sortObj?sortObj.sortOrder:true;var indicateItemsWithNoData=sortObj?sortObj.indicateItemsWithNoData:null;var showItemsWithNoDataLast=sortObj?sortObj.showItemsWithNoDataLast:null;var addValueToMenuObj=function(val,text,visible,count,_arr,hiddenByOtherColumns){var res=new AutoFiltersOptionsElements;res.asc_setVisible(visible);res.asc_setVal(val);res.asc_setText(text);res.asc_setIsDateFormat(isDateTimeFormat);if(isDateTimeFormat){res.asc_setYear(dataValue.year); res.asc_setMonth(dataValue.month);res.asc_setDay(dataValue.d)}res.hiddenByOtherColumns=hiddenByOtherColumns;_arr[count]=res};var hideValue=function(val,num){if(doOpenHide)worksheet.setRowHidden(val,num,num)};if(doOpenHide)worksheet.workbook.dependencyFormulas.lockRecal();var maxFilterRow=ref.r2;var automaticRowCount=null;colId=this._getTrueColId(autoFilter,colId,true);var currentFilterColumn=null;var activeNamedSheetView=worksheet.getActiveNamedSheetViewId();var nsvFilter;if(activeNamedSheetView!== null){nsvFilter=worksheet.getNvsFilterByTableName(isTablePart?filter.DisplayName:null);if(nsvFilter)currentFilterColumn=nsvFilter.getColumnFilterByColId(colId)}else currentFilterColumn=autoFilter.getFilterColumn(colId);if(currentFilterColumn&&!currentFilterColumn.isApplyAutoFilter())currentFilterColumn=null;var ignoreCustomFilter=currentFilterColumn?currentFilterColumn.isOnlyNotEqualEmpty():null;var isCustomFilter=currentFilterColumn&&!ignoreCustomFilter&¤tFilterColumn.isApplyCustomFilter(); if(!isTablePart){var automaticRange=this.expandRange(filter.Ref,true,true);automaticRowCount=automaticRange.r2;if(automaticRowCount>maxFilterRow)maxFilterRow=automaticRowCount}if(isTablePart&&filter.TotalsRowCount)maxFilterRow--;var individualCount=0,count=0;for(var i=ref.r1+1;i<=maxFilterRow;i++){if(individualCount>=Asc.c_oAscMaxFilterListLength)break;if(!fullValues&&null===currentFilterColumn&&worksheet.getRowHidden(i)===true)continue;var cell=worksheet.getCell3(i,colId+ref.c1);var text=window["Asc"].trim(cell.getValueWithFormat()); var val=window["Asc"].trim(cell.getValueWithoutFormat());var textLowerCase=text.toLowerCase();isDateTimeFormat=cell.getNumFormat().isDateTimeFormat()&&cell.getType()===window["AscCommon"].CellValueType.Number;if(isDateTimeFormat)dataValue=AscCommon.NumFormat.prototype.parseDate(val);if(textIndexMap.hasOwnProperty(textLowerCase)){if(values[textIndexMap[textLowerCase]])values[textIndexMap[textLowerCase]].repeats++;continue}if(fullValues&&null===currentFilterColumn&&worksheet.getRowHidden(i)===true){if(textIndexMapHideValues.hasOwnProperty(textLowerCase))continue; var _hiddenByOtherFilter=autoFilter.hiddenByAnotherFilter(worksheet,colId,i,ref.c1,nsvFilter?nsvFilter.columnsFilter:null);if(_hiddenByOtherFilter){textIndexMapHideValues[textLowerCase]=_hideValues.length;addValueToMenuObj(val,text,_hiddenByOtherFilter,_hideValues.length,_hideValues,indicateItemsWithNoData)}else{addValueToMenuObj(val,text,true,count,values);textIndexMap[textLowerCase]=count;count++}continue}var visible;if(null!==currentFilterColumn)if(!autoFilter.hiddenByAnotherFilter(worksheet,colId, i,ref.c1,nsvFilter?nsvFilter.columnsFilter:null)){var checkValue=isDateTimeFormat?val:text;visible=false;if(!isCustomFilter&&!currentFilterColumn.isHideValue(checkValue,isDateTimeFormat))visible=true;hideValue(false,i);if(textIndexMapHideValues.hasOwnProperty(textLowerCase))delete _hideValues[textIndexMapHideValues[textLowerCase]];addValueToMenuObj(val,text,visible,count,values);textIndexMap[textLowerCase]=count;count++}else{if(fullValues){if(textIndexMapHideValues.hasOwnProperty(textLowerCase))continue; visible=false;if(!currentFilterColumn.isHideValue(isDateTimeFormat?val:text,isDateTimeFormat))visible=true;textIndexMapHideValues[textLowerCase]=_hideValues.length;addValueToMenuObj(val,text,visible,_hideValues.length,_hideValues,indicateItemsWithNoData)}}else{hideValue(false,i);addValueToMenuObj(val,text,true,count,values);if(textIndexMapHideValues.hasOwnProperty(textLowerCase))delete _hideValues[textIndexMapHideValues[textLowerCase]];textIndexMap[textLowerCase]=count;count++}individualCount++}if(doOpenHide)worksheet.workbook.dependencyFormulas.unlockRecal(); var cleanArr=function(_arr){var newArr=[];for(i=0;i<_arr.length;i++)if(_arr[i])newArr.push(_arr[i]);return newArr};var _values;if(fullValues&&!showItemsWithNoDataLast){_hideValues=cleanArr(_hideValues);_values=values.concat(_hideValues);_values=this._sortArrayMinMax(_values,isAscending)}else{_values=this._sortArrayMinMax(values,isAscending);if(fullValues){_hideValues=cleanArr(_hideValues);_values=_values.concat(this._sortArrayMinMax(_hideValues,isAscending))}}return{values:_values,automaticRowCount:automaticRowCount, ignoreCustomFilter:ignoreCustomFilter}},updateSlicer:function(tableName){var wb=this.worksheet.workbook;var _slicers=wb.getSlicersByTableName(tableName);if(_slicers)for(var i=0;i<_slicers.length;i++)wb.onSlicerUpdate(_slicers[i].name)},_getTrueColId:function(filter,colId,checkShowButton){if(filter===null)return null;var res=colId;if(!filter.isAutoFilter())return res;var worksheet=this.worksheet;var ref=filter.Ref;var cell=worksheet.getCell3(ref.r1,colId+ref.c1);var hasMerged=cell.hasMerged();if(checkShowButton){var i, length;if(colId>0&&filter.isHideButton(colId-1)&&hasMerged)for(i=colId+ref.c1-1,length=Math.max(ref.c1,hasMerged.c1);i>=length;i--)if(!filter.isHideButton(i-ref.c1)){res=i+1-ref.c1;break}else if(length===i){res=i-ref.c1;break}}else if(hasMerged)if(hasMerged.c1<ref.c1)res=0;else res=hasMerged.c1-ref.c1>=0?hasMerged.c1-ref.c1:res;return res},_sortArrayMinMax:function(elements,isAscending){function isNumeric(value){return!isNaN(parseFloat(value))&&isFinite(value)}elements.sort(function sortArr(a,b){var isNumericA= isNumeric(a.val);var isNumericB=isNumeric(b.val);if(a.val==="")return 1;else if(b.val==="")return-1;else if(isNumericA&&isNumericB)return isAscending||isAscending===undefined?a.val-b.val:b.val-a.val;else if(!isNumericA&&!isNumericB){var _cmp=0;if(a.val>b.val)_cmp=1;if(a.val<b.val)_cmp=-1;return isAscending||isAscending===undefined?_cmp:-_cmp}else if(!isNumericA&&isNumericB)return isAscending||isAscending===undefined?1:-1;else return isAscending||isAscending===undefined?-1:1});return elements},_rangeToId:function(range){var cell= new CellAddress(range.r1,range.c1,0);return cell.getID()},_idToRange:function(id){var cell=new CellAddress(id);return new Asc.Range(cell.col-1,cell.row-1,cell.col-1,cell.row-1)},_resetTablePartStyle:function(exceptionRange){var worksheet=this.worksheet;if(worksheet.TableParts&&worksheet.TableParts.length>0)for(var tP=0;tP<worksheet.TableParts.length;tP++){var ref=worksheet.TableParts[tP].Ref;if(exceptionRange&&!exceptionRange.isEqual(ref)&&(ref.r1>=exceptionRange.r1&&ref.r1<=exceptionRange.r2||ref.r2>= exceptionRange.r1&&ref.r2<=exceptionRange.r2))this._setColorStyleTable(ref,worksheet.TableParts[tP]);else if(!exceptionRange)this._setColorStyleTable(ref,worksheet.TableParts[tP])}},_isFilterColumnsContainFilter:function(filterColumns){if(!filterColumns||!filterColumns.length)return false;var filterColumn;for(var k=0;k<filterColumns.length;k++){filterColumn=filterColumns[k].filter?filterColumns[k].filter:filterColumns[k];if(filterColumn&&(filterColumn.ColorFilter||filterColumn.ColorFilter||filterColumn.CustomFiltersObj|| filterColumn.DynamicFilter||filterColumn.Filters||filterColumn.Top10))return true}},_openHiddenRows:function(filter){var worksheet=this.worksheet;var autoFilter=filter.isAutoFilter()?filter:filter.AutoFilter;var isApplyFilter=autoFilter&&autoFilter.FilterColumns&&autoFilter.FilterColumns.length;if(filter&&filter.Ref&&isApplyFilter)worksheet.setRowHidden(false,filter.Ref.r1,filter.Ref.r2)},_openHiddenRowsAfterDeleteColumn:function(filter,colId){var autoFilter=filter.getAutoFilter();var ref=autoFilter.Ref; var filterColumns=autoFilter.FilterColumns;var worksheet=this.worksheet;colId=this._getTrueColId(autoFilter,colId,true);if(colId===null)return;var isTablePart=!filter.isAutoFilter();var activeNamedSheetView=worksheet.getActiveNamedSheetViewId();var opt_columnsFilter;if(activeNamedSheetView!==null){var nsvFilter=worksheet.getNvsFilterByTableName(isTablePart?filter.DisplayName:null);opt_columnsFilter=nsvFilter?nsvFilter.columnsFilter:null}worksheet.workbook.dependencyFormulas.lockRecal();this.useViewLocalChange= true;for(var i=ref.r1+1;i<=ref.r2;i++){if(worksheet.getRowHidden(i)===false)continue;if(!autoFilter.hiddenByAnotherFilter(worksheet,colId,i,ref.c1,opt_columnsFilter))worksheet.setRowHidden(false,i,i)}this.useViewLocalChange=null;worksheet.workbook.dependencyFormulas.unlockRecal()},_isAddNameColumn:function(range){var result=false;var worksheet=this.worksheet;if(range.r1!==range.r2)for(var col=range.c1;col<=range.c2;col++){var valFirst=worksheet.getCell3(range.r1,col);if(valFirst!=="")for(var row= range.r1;row<=range.r1+2;row++){var cell=worksheet.getCell3(row,col);var type=cell.getType();if(type===CellValueType.String){result=true;break}}}return result},_generateColumnNameWithoutTitle:function(ref){var tableColumns=[],newTableColumn;var range=this.worksheet.getRange3(ref.r1,ref.c1,ref.r1,ref.c2);var defaultName="Column";var uniqueColumns={},val,valTemplate,valLower,index=1,isDuplicate=false,emptyCells=false;var valuesAndMap=range._getValuesAndMap(true);var values=valuesAndMap.values;var length= values.length;if(0===length){length=ref.c2-ref.c1+1;emptyCells=true}var map=valuesAndMap.map;for(var i=0;i<length;++i){if(emptyCells||""===(valTemplate=val=values[i].v)){valTemplate=defaultName;val=valTemplate+index;++index}while(true){if(isDuplicate)val=valTemplate+ ++index;valLower=val.toLowerCase();if(uniqueColumns[valLower])isDuplicate=true;else{if(isDuplicate&&map[valLower])continue;uniqueColumns[valLower]=true;newTableColumn=new AscCommonExcel.TableColumn;if(val.length>=AscCommon.c_oAscMaxTableColumnTextLength){val= val.substring(0,AscCommon.c_oAscMaxTableColumnTextLength-1);var cell=this.worksheet.getRange3(ref.r1,ref.c1+i,ref.r1,ref.c1+i);cell.setValue(val)}newTableColumn.Name=val;tableColumns.push(newTableColumn);isDuplicate=false;break}}}return tableColumns},_generateColumnName:function(tableColumns,indexInsertColumn){var index=1;var isSequence=false;if(indexInsertColumn!=undefined){if(indexInsertColumn<0)indexInsertColumn=0;var nameStart;var nameEnd;if(tableColumns[indexInsertColumn]&&tableColumns[indexInsertColumn].Name)nameStart= tableColumns[indexInsertColumn].Name.split("Column");if(tableColumns[indexInsertColumn+1]&&tableColumns[indexInsertColumn+1].Name)nameEnd=tableColumns[indexInsertColumn+1].Name.split("Column");if(nameStart&&nameStart[1]&&nameEnd&&nameEnd[1]&&!isNaN(parseInt(nameStart[1]))&&!isNaN(parseInt(nameEnd[1]))&&parseInt(nameStart[1])+1==parseInt(nameEnd[1]))isSequence=true}var name,i;if(indexInsertColumn==undefined||!isSequence){for(i=0;i<tableColumns.length;i++){if(tableColumns[i].Name)name=tableColumns[i].Name.split("Column"); if(name&&name[1]&&!isNaN(parseFloat(name[1]))&&index==parseFloat(name[1])){index++;i=-1}}return"Column"+index}else{if(tableColumns[indexInsertColumn]&&tableColumns[indexInsertColumn].Name)name=tableColumns[indexInsertColumn].Name.split("Column");if(name&&name[1]&&!isNaN(parseFloat(name[1])))index=parseFloat(name[1])+1;for(i=0;i<tableColumns.length;i++){if(tableColumns[i].Name)name=tableColumns[i].Name.split("Column");if(name&&name[1]&&!isNaN(parseFloat(name[1]))&&index==parseFloat(name[1])){index= parseInt(index-1+"2");i=-1}}return"Column"+index}},_generateNextColumnName:function(tableColumns,val){var tableColumnMap=[];for(var i=0;i<tableColumns.length;i++)tableColumnMap[tableColumns[i].Name]=1;var res=val;var index=2;while(true){if(tableColumnMap[res])res=val+index;else break;index++}return res},_setColorStyleTable:function(range,options,isOpenFilter,isSetVal,isSetTotalRowType){var worksheet=this.worksheet;var bRedoChanges=worksheet.workbook.bRedoChanges;var bbox=range;var style=options.TableStyleInfo? options.TableStyleInfo.clone():null;var styleForCurTable;var headerRowCount=1;var totalsRowCount=0;if(null!=options.HeaderRowCount)headerRowCount=options.HeaderRowCount;if(null!=options.TotalsRowCount)totalsRowCount=options.TotalsRowCount;if(style&&worksheet.workbook.TableStyles&&worksheet.workbook.TableStyles.AllStyles){if(true!==isOpenFilter&&isSetVal&&!bRedoChanges)if((headerRowCount>0||totalsRowCount>0)&&options.TableColumns)for(var ncol=bbox.c1;ncol<=bbox.c2;ncol++){range=worksheet.getCell3(bbox.r1, ncol);var num=ncol-bbox.c1;var tableColumn=options.TableColumns[num];if(null!=tableColumn&&null!=tableColumn.Name&&headerRowCount>0){range.setValue(tableColumn.Name);range.setType(CellValueType.String)}if(tableColumn!==null&&totalsRowCount>0){range=worksheet.getCell3(bbox.r2,ncol);if(null!==tableColumn.TotalsRowLabel){range.setValue(tableColumn.TotalsRowLabel);range.setType(CellValueType.String)}var formula=tableColumn.getTotalRowFormula(options);if(null!==formula){range.setValue("="+formula,null, true);if(isSetTotalRowType){var numFormatType=this._getFormatTableColumnRange(options,tableColumn.Name);if(null!==numFormatType)range.setNumFormat(numFormatType)}}}}styleForCurTable=worksheet.workbook.TableStyles.AllStyles[style.Name];if(!styleForCurTable)return;styleForCurTable.initStyle(worksheet.sheetMergedStyles,bbox,style,headerRowCount,totalsRowCount);if(bbox.r2>worksheet.nRowsCount)worksheet.setRowsCount(bbox.r2)}},_getFormatTableColumnRange:function(table,columnName){var worksheet=this.worksheet; var arrFormat=[];var res=null,i;var tableRange=table.getTableRangeForFormula({param:AscCommon.FormulaTablePartInfo.columns,startCol:columnName,endCol:columnName});if(null!==tableRange)for(i=tableRange.r1;i<=tableRange.r2;i++){var cell=worksheet.getCell3(i,tableRange.c1);var format=cell.getNumFormat();var sFromatString=format.sFormat;var type=format?format.getType:null;if(null!==type){res=true;if(!arrFormat[sFromatString])arrFormat[sFromatString]=0;arrFormat[sFromatString]++}}if(res){var maxCount= 0;for(i in arrFormat)if(arrFormat[i]>maxCount){maxCount=arrFormat[i];res=i}}return res},_cleanStyleTable:function(sRef){var oRange=new AscCommonExcel.Range(this.worksheet,sRef.r1,sRef.c1,sRef.r2,sRef.c2);oRange.clearTableStyle()},_reDrawCurrentFilter:function(fColumns,tableParts){if(tableParts){var ref=tableParts.Ref;this._cleanStyleTable(ref);this._setColorStyleTable(ref,tableParts)}},_preMoveAutoFilters:function(arnFrom,arnTo,copyRange,opt_wsTo){var worksheet=this.worksheet;var diffCol=arnTo.c1- arnFrom.c1;var diffRow=arnTo.r1-arnFrom.r1;var ref,moveRangeTo,i;if(!copyRange){var findFilters=this._searchFiltersInRange(arnFrom);if(findFilters){var ws=opt_wsTo?opt_wsTo.model:worksheet;for(i=0;i<findFilters.length;i++){ref=findFilters[i].Ref;moveRangeTo=new Asc.Range(ref.c1+diffCol,ref.r1+diffRow,ref.c2+diffCol,ref.r2+diffRow);if(ws.AutoFilter&&ws.AutoFilter.Ref&&moveRangeTo.intersection(ws.AutoFilter.Ref)&&ws.AutoFilter!==findFilters[i])ws.autoFilters.deleteAutoFilter(ws.AutoFilter.Ref);var findFiltersFromTo= ws.autoFilters._intersectionRangeWithTableParts(moveRangeTo,opt_wsTo?null:arnFrom);if(findFiltersFromTo&&findFiltersFromTo.length){this.isEmptyAutoFilters(ref);continue}this._openHiddenRows(findFilters[i])}}var afTo=opt_wsTo&&opt_wsTo.model?opt_wsTo.model.autoFilters:this;var findFiltersTo=afTo._searchFiltersInRange(arnTo);if(arnTo&&findFiltersTo)for(i=0;i<findFiltersTo.length;i++){ref=findFiltersTo[i].Ref;if(!(arnTo.r1===ref.r1&&arnTo.c1===ref.c1)&&!arnFrom.containsRange(ref))afTo.isEmptyAutoFilters(ref, null,findFilters)}}},_searchHiddenRowsByFilter:function(filter,range){var ref=filter.Ref;var worksheet=this.worksheet;var intersection=filter.Ref.intersection(range);if(intersection&&filter.isApplyAutoFilter())for(var i=intersection.r1;i<=intersection.r2;i++)if(worksheet.getRowHidden(i)===true)return true;return false},_searchFiltersInRange:function(range,bFindOnlyTableParts){var result=[];var worksheet=this.worksheet;range=new Asc.Range(range.c1,range.r1,range.c2,range.r2);if(worksheet.AutoFilter&& !bFindOnlyTableParts)if(range.containsRange(worksheet.AutoFilter.Ref))result[result.length]=worksheet.AutoFilter;if(worksheet.TableParts)for(var i=0;i<worksheet.TableParts.length;i++)if(worksheet.TableParts[i])if(range.containsRange(worksheet.TableParts[i].Ref))result[result.length]=worksheet.TableParts[i];if(!result.length)result=false;return result},_searchRangeInFilters:function(range){var result=null;var worksheet=this.worksheet;if(worksheet.AutoFilter)if(worksheet.AutoFilter.Ref.containsRange(range))result= worksheet.AutoFilter;else if(worksheet.AutoFilter.Ref.intersection(range))result=false;if(worksheet.TableParts&&null===result)for(var i=0;i<worksheet.TableParts.length;i++)if(worksheet.TableParts[i])if(worksheet.TableParts[i].Ref.containsRange(range)){result=worksheet.TableParts[i];break}return result},_intersectionRangeWithTableParts:function(range,exceptionRange){var result=[];var rangeFilter;var worksheet=this.worksheet;if(worksheet.TableParts)for(var k=0;k<worksheet.TableParts.length;k++)if(worksheet.TableParts[k]){rangeFilter= worksheet.TableParts[k].Ref;if(range.intersection(rangeFilter)&&!(range.containsRange(rangeFilter)&&!(range.r1===rangeFilter.r1&&range.c1===rangeFilter.c1)))if(!exceptionRange||!(exceptionRange&&exceptionRange.containsRange(rangeFilter)))result[result.length]=worksheet.TableParts[k]}return!result.length?false:result},getTableByActiveCell:function(){var activeCell=this.worksheet.selectionRange.activeCell;var res=null;if(this.worksheet.TableParts)for(var i=0;i<this.worksheet.TableParts.length;i++){var table= this.worksheet.TableParts[i];if(table&&table.Ref.contains(activeCell.col,activeCell.row)){res=table;break}}return res},_cloneCtrlAutoFilters:function(arnTo,arnFrom,offLock){var worksheet=this.worksheet;var findFilters=this._searchFiltersInRange(arnFrom);var bUndoRedoChanges=worksheet.workbook.bUndoChanges||worksheet.workbook.bRedoChanges;if(findFilters&&findFilters.length){var diffCol=arnTo.c1-arnFrom.c1;var diffRow=arnTo.r1-arnFrom.r1;var offset=new AscCommon.CellBase(diffRow,diffCol);var newRange, ref,bWithoutFilter;for(var i=0;i<findFilters.length;i++)if(findFilters[i].TableStyleInfo){ref=findFilters[i].Ref;newRange=new Asc.Range(ref.c1+diffCol,ref.r1+diffRow,ref.c2+diffCol,ref.r2+diffRow);bWithoutFilter=findFilters[i].AutoFilter===null;if(!ref.intersection(newRange)&&!this._intersectionRangeWithTableParts(newRange,arnFrom)){if(!bUndoRedoChanges){var cleanRange=new AscCommonExcel.Range(worksheet,newRange.r1,newRange.c1,newRange.r2,newRange.c2);cleanRange.cleanFormat()}this.addAutoFilter(findFilters[i].TableStyleInfo.Name, newRange,null,offLock,{tablePart:findFilters[i],offset:offset})}}}},_activeRangeContainsTablePart:function(activeRange,tablePartRef){var worksheet=this.worksheet;var res=false;if(activeRange.r1===tablePartRef.r1&&activeRange.c1===tablePartRef.c1&&activeRange.c2===tablePartRef.c2&&activeRange.r2<tablePartRef.r2){res=true;for(var i=activeRange.r2+1;i<=tablePartRef.r2;i++)if(!worksheet.getRowHidden(i)){res=false;break}}return res},_cleanFilterColumnsAndSortState:function(autoFilterElement,activeCells, viewId){var worksheet=this.worksheet;var oldFilter=autoFilterElement.clone(null);if(autoFilterElement.SortState)autoFilterElement.SortState=null;if(!viewId||viewId===worksheet.getActiveNamedSheetViewId())worksheet.setRowHidden(false,autoFilterElement.Ref.r1,autoFilterElement.Ref.r2);var doClean=function(af){var filterColumns=af.FilterColumns;if(af.columnsFilter){filterColumns=af.columnsFilter;oldFilter=af.clone()}if(filterColumns&&filterColumns.length){var isAllClean=true;for(var i=0;i<filterColumns.length;i++){var _filterColumn= filterColumns[i].filter?filterColumns[i].filter:filterColumns[i];_filterColumn.clean();if(!_filterColumn.isAllClean())isAllClean=false}if(isAllClean)if(af.columnsFilter)af.columnsFilter=[];else af.FilterColumns=null}};doClean(this.getAutoFilter(autoFilterElement,viewId));this._addHistoryObj(oldFilter,AscCH.historyitem_AutoFilter_CleanAutoFilter,{activeCells:activeCells},null,activeCells);this._resetTablePartStyle();return autoFilterElement.Ref},clearFilterColumn:function(cellId,displayName,viewId){var filter= this._getFilterByDisplayName(displayName);var autoFilterObj=this.getAutoFilter(filter,viewId);var oldFilter=autoFilterObj&&autoFilterObj.columnsFilter?autoFilterObj.clone():filter.clone(null);var colId=this._getColIdColumn(filter,cellId,viewId);History.Create_NewPoint();History.StartTransaction();if(colId!==null){var index=autoFilterObj.getIndexByColId(colId);if(!viewId||viewId===this.worksheet.getActiveNamedSheetViewId())this._openHiddenRowsAfterDeleteColumn(filter,colId);var filterColumn=autoFilterObj.getFilterColumnByIndex(index); if(filterColumn){filterColumn.clean();if(filterColumn.isAllClean())autoFilterObj.deleteFilterColumn(index)}this._resetTablePartStyle()}this._addHistoryObj(oldFilter,AscCH.historyitem_AutoFilter_ClearFilterColumn,{cellId:cellId,displayName:displayName,activeCells:filter.Ref},null,filter.Ref);History.EndTransaction();return filter.Ref},_checkValueInCells:function(n,k,cloneActiveRange){var worksheet=this.worksheet;var cell=worksheet.getRange3(n,k,n,k);var isEmptyCell=cell.isNullText();var isEnd=true, merged,valueMerg;if(isEmptyCell){merged=cell.hasMerged();valueMerg=null;if(merged){valueMerg=worksheet.getRange3(merged.r1,merged.c1,merged.r2,merged.c2).getValue();if(valueMerg!=null&&valueMerg!=""){if(merged.r1<cloneActiveRange.r1){cloneActiveRange.r1=merged.r1;n=cloneActiveRange.r1-1;isEnd=false}if(merged.r2>cloneActiveRange.r2){cloneActiveRange.r2=merged.r2;n=cloneActiveRange.r2-1;isEnd=false}if(merged.c1<cloneActiveRange.c1){cloneActiveRange.c1=merged.c1;k=cloneActiveRange.c1-1;isEnd=false}if(merged.c2> cloneActiveRange.c2){cloneActiveRange.c2=merged.c2;k=cloneActiveRange.c2-1;isEnd=false}if(n<0)n=0;if(k<0)k=0}}}if(!isEmptyCell||valueMerg!=null&&valueMerg!=""){if(k<cloneActiveRange.c1){cloneActiveRange.c1=k;isEnd=false}else if(k>cloneActiveRange.c2){cloneActiveRange.c2=k;isEnd=false}if(n<cloneActiveRange.r1){cloneActiveRange.r1=n;isEnd=false}else if(n>cloneActiveRange.r2){cloneActiveRange.r2=n;isEnd=false}}return{isEmptyCell:isEmptyCell,isEnd:isEnd,cloneActiveRange:cloneActiveRange}},_isEmptyCellsUnderRange:function(range, exception,checkFilter){var cell,isEmptyCell,result=true;var worksheet=this.worksheet;for(var i=range.c1;i<=range.c2;i++){if(exception&&exception.c1===i&&exception.r1===range.r2+1)continue;cell=worksheet.getRange3(range.r2+1,i,range.r2+1,i);isEmptyCell=cell.isNullText();if(!isEmptyCell){result=false;break}if(checkFilter){var autoFilter=worksheet.AutoFilter;if(autoFilter&&autoFilter.Ref.containsRange(cell.bbox)||this._isTablePartsContainsRange(cell.bbox)){result=false;break}}}return result},_isEmptyCellsRightRange:function(range, exception,checkFilter){var cell,isEmptyCell,result=true;var worksheet=this.worksheet;for(var i=range.r1;i<=range.r2;i++){if(exception&&exception.r1===i&&exception.c1===range.c2+1)continue;cell=worksheet.getRange3(i,range.c2+1,i,range.c2+1);isEmptyCell=cell.isNullText();if(!isEmptyCell){result=false;break}if(checkFilter){var autoFilter=worksheet.AutoFilter;if(autoFilter&&autoFilter.Ref.containsRange(cell.bbox)||this._isTablePartsContainsRange(cell.bbox)){result=false;break}}}return result},_isPartTablePartsUnderRange:function(range){var worksheet= this.worksheet;var result=false;if(worksheet.TableParts&&worksheet.TableParts.length)for(var i=0;i<worksheet.TableParts.length;i++){var tableRef=worksheet.TableParts[i].Ref;if(tableRef.r1>=range.r2)if(tableRef.c1<range.c1&&tableRef.c2>=range.c1&&tableRef.c2<=range.c2){result=true;break}else if(tableRef.c1>=range.c1&&tableRef.c1<=range.c2&&tableRef.c2>range.c2){result=true;break}else if(tableRef.c1<=range.c1&&tableRef.c2>range.c2||tableRef.c1<range.c1&&tableRef.c2>=range.c2){result=true;break}}return result}, isPartTablePartsRightRange:function(range){var worksheet=this.worksheet;var result=false;if(worksheet.TableParts&&worksheet.TableParts.length)for(var i=0;i<worksheet.TableParts.length;i++){var tableRef=worksheet.TableParts[i].Ref;if(tableRef.c1>=range.c2)if(tableRef.r1<range.r1&&tableRef.r2>range.r1&&tableRef.r2<=range.r2){result=true;break}else if(tableRef.r1>=range.r1&&tableRef.r1<range.r2&&tableRef.r2>range.r2){result=true;break}else if(tableRef.r1<=range.r1&&tableRef.r2>range.r2||tableRef.r1< range.r1&&tableRef.r2>=range.r2){result=true;break}}return result},isPartFilterUnderRange:function(range,checkFirstRow){var worksheet=this.worksheet;var result=false;if(worksheet.AutoFilter){var ref=worksheet.AutoFilter.Ref;var allColRef=new Asc.Range(range.c1,range.r1,range.c2,AscCommon.gc_nMaxRow0);if(allColRef.intersection(ref)&&!allColRef.containsRange(ref))if(!checkFirstRow||checkFirstRow&&allColRef.r1<=ref.r1)result=true}return result},isPartFilterRightRange:function(range,checkFirstCol){var worksheet= this.worksheet;var result=false;if(worksheet.AutoFilter){var ref=worksheet.AutoFilter.Ref;var allColRef=new Asc.Range(range.c1,range.r1,AscCommon.gc_nMaxCol0,range.r2);if(allColRef.intersection(ref)&&!allColRef.containsRange(ref))if(!checkFirstCol||checkFirstCol&&(allColRef.c1<=ref.c1||allColRef.r1<=ref.r1))result=true}return result},_isPartTablePartsByRowCol:function(range){var worksheet=this.worksheet;var partCols=false;var partRows=false;if(worksheet.TableParts&&worksheet.TableParts.length){var allRangeRows= new Asc.Range(range.c1,0,range.c2,AscCommon.gc_nMaxRow);var allRangeCols=new Asc.Range(0,range.r1,AscCommon.gc_nMaxCol,range.r2);for(var i=0;i<worksheet.TableParts.length;i++){var tableRef=worksheet.TableParts[i].Ref;if(range.intersection(tableRef)){if(!partCols&&!allRangeRows.containsRange(tableRef))partCols=true;if(!partRows&&!allRangeCols.containsRange(tableRef))partRows=true}if(partCols&&partRows)break}}return partCols||partRows?{cols:partCols,rows:partRows}:null},bIsExcludeHiddenRows:function(range, activeCell,checkHiddenRows){var worksheet=this.worksheet;var result=false;if(worksheet.AutoFilter&&worksheet.AutoFilter.isApplyAutoFilter())result=true;else if(this._getTableIntersectionWithActiveCell(activeCell,true))result=true;if(result&&checkHiddenRows){var range3=range&&range.bbox?range:worksheet.getRange3(range.r1,range.c1,range.r2,range.c2);result=false;range3._foreachRow(function(row){if(row.getHidden())result=true})}return result},_getTableIntersectionWithActiveCell:function(activeCell,checkApplyFiltering){var result= false;var worksheet=this.worksheet;if(worksheet.TableParts&&worksheet.TableParts.length>0)for(var i=0;i<worksheet.TableParts.length;i++){var ref=worksheet.TableParts[i].Ref;if(ref.contains(activeCell.col,activeCell.row))if(checkApplyFiltering&&worksheet.TableParts[i].isApplyAutoFilter()){result=worksheet.TableParts[i];break}}return result},_isEmptyRange:function(ar,addDelta){var range=this.worksheet.getRange3(Math.max(0,ar.r1-addDelta),Math.max(0,ar.c1-addDelta),ar.r2+addDelta,ar.c2+addDelta);var res= true;range._foreachNoEmpty(function(cell){if(!cell.isNullText()){res=false;return true}});return res},_setStyleTables:function(range){var worksheet=this.worksheet;if(worksheet.TableParts&&worksheet.TableParts.length>0)for(var i=0;i<worksheet.TableParts.length;i++){var ref=worksheet.TableParts[i].Ref;if(ref.r1>=range.r1&&ref.r2<=range.r2)this._setColorStyleTable(ref,worksheet.TableParts[i])}},resetTableStyles:function(range){var worksheet=this.worksheet;if(worksheet.TableParts&&worksheet.TableParts.length> 0)for(var i=0;i<worksheet.TableParts.length;i++){var ref=worksheet.TableParts[i].Ref;if(ref.isIntersect(range))this._setColorStyleTable(ref,worksheet.TableParts[i])}},_generateColumnName2:function(tableColumns){var columnName="Column";var indexColumn=undefined;var nextIndex;var checkNextName=function(){var nextName=columnName+nextIndex;for(var i=0;i<tableColumns.length;i++)if(tableColumns[i].Name===nextName)return false;return true};var checkChangeIndex=function(){if((nextIndex+1).toString().substr(0, 1)!==indexColumn.toString().substr(0,1))return true;else return false};if(indexColumn&&!isNaN(indexColumn)){indexColumn=parseFloat(indexColumn);nextIndex=indexColumn+1;var string="";var firstInput=true;while(checkNextName()===false){if(firstInput===true){string+="1";nextIndex=parseFloat(indexColumn+"2")}else if(checkChangeIndex()){string+="0";nextIndex=parseFloat(indexColumn+string)}else nextIndex++;firstInput=false}}else{nextIndex=1;while(checkNextName()===false)nextIndex++}return columnName+nextIndex}, _getFilterInfoByAddTableProps:function(ar,addFormatTableOptionsObj,bTable){var tempRange=new Asc.Range(ar.c1,ar.r1,ar.c2,ar.r2);var addNameColumn,filterRange,bIsManualOptions=false;var ws=this.worksheet;var _isOneCell=function(_range){var res=null;if(_range.isOneCell())res=true;else if(!bTable){var merged=ws.getMergedByCell(_range.r1,_range.c1);if(merged&&merged.isEqual(_range))res=true}return res};if(addFormatTableOptionsObj===false)addNameColumn=true;else if(addFormatTableOptionsObj&&typeof addFormatTableOptionsObj== "object"){tempRange=addFormatTableOptionsObj.asc_getRange();addNameColumn=!addFormatTableOptionsObj.asc_getIsTitle();tempRange=AscCommonExcel.g_oRangeCache.getAscRange(tempRange).clone();bIsManualOptions=true}else if(addFormatTableOptionsObj===true)addNameColumn=false;if(bTable)tempRange=this.worksheet.expandRangeByMerged(tempRange);var tablePartsContainsRange=this._isTablePartsContainsRange(tempRange);if(tablePartsContainsRange)filterRange=tablePartsContainsRange.Ref.clone();else if(_isOneCell(tempRange)&& !bIsManualOptions)filterRange=this.expandRange(tempRange);else if(!bTable){var definedRange=new Asc.Range(0,0,this.worksheet.nColsCount-1,this.worksheet.nRowsCount-1);filterRange=tempRange.intersection(definedRange);if(!filterRange)filterRange=tempRange}else filterRange=tempRange;var rangeWithoutDiff=filterRange.clone();if(addNameColumn)filterRange.r2=filterRange.r2+1;return{filterRange:filterRange,addNameColumn:addNameColumn,rangeWithoutDiff:rangeWithoutDiff,tablePartsContainsRange:tablePartsContainsRange}}, splitRangeByFilters:function(start,stop){var filterArr;var otherArr;var isFilter=null;for(var i=start;i<=stop;i++)if(this.containInFilter(i))if(isFilter)if(!filterArr){filterArr=[];filterArr[filterArr.length]={start:i,stop:i}}else filterArr[filterArr.length-1].stop++;else{isFilter=true;if(!filterArr)filterArr=[];filterArr[filterArr.length]={start:i,stop:i}}else if(isFilter){isFilter=false;if(!otherArr)otherArr=[];otherArr[otherArr.length]={start:i,stop:i}}else if(!otherArr){otherArr=[];otherArr[otherArr.length]= {start:i,stop:i}}else otherArr[otherArr.length-1].stop++;return[filterArr,otherArr]},containInFilter:function(row,checkApplyFilter){var ws=this.worksheet;var tables=ws.TableParts;var autoFilter=ws.AutoFilter;if(tables)for(var i=0;i<tables.length;i++){var tableFilter=tables[i].AutoFilter;if(tableFilter&&(!checkApplyFilter||checkApplyFilter&&tableFilter.isApplyAutoFilter()))if(row>=tables[i].Ref.r1&&row<=tables[i].Ref.r2)return true}if(autoFilter&&(!checkApplyFilter||checkApplyFilter&&autoFilter.isApplyAutoFilter()))if(row>= autoFilter.Ref.r1&&row<=autoFilter.Ref.r2)return true;return false},_checkCollaborativeActiveOnFilterApply:function(autoFiltersObject){var res=false;var _setOffset=function(_val,arr,byCol){if(arr&&arr.length)for(var i=0;i<arr.length;i++){var offset=arr[i].offset;var first=byCol?arr[i].range.c1:arr[i].range.r1;var last=byCol?arr[i].range.c2:arr[i].range.r2;if(_val>last)_val+=offset;else if(_val>=first&&_val<=last&&offset>0)_val+=offset}return _val};var wb=this.worksheet.workbook;if(wb.aCollaborativeActions)for(var i= 0;i<wb.aCollaborativeActions.length;i++)for(var j=0;j<wb.aCollaborativeActions[i].length;j++){var action=wb.aCollaborativeActions[i][j];if(action.oClass&&AscCommonExcel.g_oUndoRedoAutoFilters.nType===action.oClass.nType&&action.nActionType===AscCH.historyitem_AutoFilter_Apply){var autoFiltersObjectAction=action&&action.oData?action.oData.autoFiltersObject:null;if(autoFiltersObjectAction&&autoFiltersObject&&autoFiltersObject.displayName===autoFiltersObjectAction.displayName){var cellIdOther=autoFiltersObject.cellId.split("af")[0]; var rangeOther;AscCommonExcel.executeInR1C1Mode(false,function(){rangeOther=AscCommonExcel.g_oRangeCache.getAscRange(cellIdOther).clone()});var cellIdMe=autoFiltersObjectAction.cellId.split("af")[0];var rangeMe;AscCommonExcel.executeInR1C1Mode(false,function(){rangeMe=AscCommonExcel.g_oRangeCache.getAscRange(cellIdMe).clone()});var colMe=_setOffset(rangeMe.c1,this.applyCollaborativeChangedColumnsArr,true);var colOther=rangeOther.c1;var rowMe=_setOffset(rangeMe.r1,this.applyCollaborativeChangedRowsArr); var rowOther=rangeOther.r1;if(colMe===colOther&&rowMe===rowOther)return true}}}return res},_deleteCollaborativeActiveAfterDeleteColumn:function(filter,range){if(!this.worksheet.workbook.bCollaborativeChanges)return;var compareFilter=function(_name1,_name2){if(_name1===_name2||!_name1&&!_name2)return true;return false};var wb=this.worksheet.workbook;if(wb.aCollaborativeActions)for(var i=0;i<wb.aCollaborativeActions.length;i++)for(var j=0;j<wb.aCollaborativeActions[i].length;j++){var action=wb.aCollaborativeActions[i][j]; if(action.oClass&&AscCommonExcel.g_oUndoRedoAutoFilters.nType===action.oClass.nType&&action.nActionType===AscCH.historyitem_AutoFilter_Apply){var autoFiltersObjectAction=action&&action.oData?action.oData.autoFiltersObject:null;if(autoFiltersObjectAction&&null!==autoFiltersObjectAction.namedSheetView&&compareFilter(autoFiltersObjectAction.displayName,filter.DisplayName)){var applyFilterId=autoFiltersObjectAction.cellId.split("af")[0];var applyFilterIdRange;AscCommonExcel.executeInR1C1Mode(false,function(){applyFilterIdRange= AscCommonExcel.g_oRangeCache.getAscRange(applyFilterId).clone()});if(applyFilterIdRange&&applyFilterIdRange.c1>=range.c1&&applyFilterIdRange.c1<=range.c2){wb.aCollaborativeActions[i].splice(j,1);j--}}}}},cleanCollaborativeObj:function(){this.applyCollaborativeChangedColumnsArr=[];this.applyCollaborativeChangedRowsArr=[]}};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].AutoFilters=AutoFilters;window["Asc"]["AutoFiltersOptions"]=window["Asc"].AutoFiltersOptions=AutoFiltersOptions; prot=AutoFiltersOptions.prototype;prot["asc_setSortState"]=prot.asc_setSortState;prot["asc_getSortState"]=prot.asc_getSortState;prot["asc_getValues"]=prot.asc_getValues;prot["asc_getFilterObj"]=prot.asc_getFilterObj;prot["asc_getPivotObj"]=prot.asc_getPivotObj;prot["asc_getCellId"]=prot.asc_getCellId;prot["asc_getCellCoord"]=prot.asc_getCellCoord;prot["asc_getDisplayName"]=prot.asc_getDisplayName;prot["asc_getIsTextFilter"]=prot.asc_getIsTextFilter;prot["asc_getColorsFill"]=prot.asc_getColorsFill; prot["asc_getColorsFont"]=prot.asc_getColorsFont;prot["asc_getSortColor"]=prot.asc_getSortColor;prot["asc_getColumnName"]=prot.asc_getColumnName;prot["asc_setFilterObj"]=prot.asc_setFilterObj;prot["asc_setPivotObj"]=prot.asc_setPivotObj;prot["asc_getSheetColumnName"]=prot.asc_getSheetColumnName;window["Asc"]["AutoFilterObj"]=window["Asc"].AutoFilterObj=AutoFilterObj;prot=AutoFilterObj.prototype;prot["asc_getType"]=prot.asc_getType;prot["asc_setFilter"]=prot.asc_setFilter;prot["asc_setType"]=prot.asc_setType; prot["asc_getFilter"]=prot.asc_getFilter;window["Asc"]["PivotFilterObj"]=window["Asc"].PivotFilterObj=PivotFilterObj;prot=PivotFilterObj.prototype;prot["asc_setDataFields"]=prot.asc_setDataFields;prot["asc_setDataFieldIndexSorting"]=prot.asc_setDataFieldIndexSorting;prot["asc_setDataFieldIndexFilter"]=prot.asc_setDataFieldIndexFilter;prot["asc_setIsPageFilter"]=prot.asc_setIsPageFilter;prot["asc_setIsMultipleItemSelectionAllowed"]=prot.asc_setIsMultipleItemSelectionAllowed;prot["asc_setIsTop10Sum"]= prot.asc_setIsTop10Sum;prot["asc_getDataFields"]=prot.asc_getDataFields;prot["asc_getDataFieldIndexSorting"]=prot.asc_getDataFieldIndexSorting;prot["asc_getDataFieldIndexFilter"]=prot.asc_getDataFieldIndexFilter;prot["asc_getIsPageFilter"]=prot.asc_getIsPageFilter;prot["asc_getIsMultipleItemSelectionAllowed"]=prot.asc_getIsMultipleItemSelectionAllowed;prot["asc_getIsTop10Sum"]=prot.asc_getIsTop10Sum;window["Asc"]["AdvancedTableInfoSettings"]=window["Asc"].AdvancedTableInfoSettings=AdvancedTableInfoSettings; prot=AdvancedTableInfoSettings.prototype;prot["asc_getTitle"]=prot.asc_getTitle;prot["asc_getDescription"]=prot.asc_getDescription;prot["asc_setTitle"]=prot.asc_setTitle;prot["asc_setDescription"]=prot.asc_setDescription;window["AscCommonExcel"].AutoFiltersOptionsElements=AutoFiltersOptionsElements;prot=AutoFiltersOptionsElements.prototype;prot["asc_getText"]=prot.asc_getText;prot["asc_getVisible"]=prot.asc_getVisible;prot["asc_setVisible"]=prot.asc_setVisible;prot["asc_getIsDateFormat"]=prot.asc_getIsDateFormat; prot["asc_getYear"]=prot.asc_getYear;prot["asc_getMonth"]=prot.asc_getMonth;prot["asc_getDay"]=prot.asc_getDay;prot["asc_getRepeats"]=prot.asc_getRepeats;prot["asc_getVal"]=prot.asc_getVal;window["AscCommonExcel"].AddFormatTableOptions=AddFormatTableOptions;prot=AddFormatTableOptions.prototype;prot["asc_getRange"]=prot.asc_getRange;prot["asc_getIsTitle"]=prot.asc_getIsTitle;prot["asc_setRange"]=prot.asc_setRange;prot["asc_setIsTitle"]=prot.asc_setIsTitle})(window);"use strict";(function(window,undefined){var FontStyle= AscFonts.FontStyle;var asc=window["Asc"];var asc_round=asc.round;var asc_floor=asc.floor;function colorObjToAscColor(color){if(!color)return color;var oRes=null;var r=color.getR();var g=color.getG();var b=color.getB();var bTheme=false;if(color instanceof AscCommonExcel.ThemeColor&&null!=color.theme){var array_colors_types=[6,15,7,16,0,1,2,3,4,5];var themePresentation=array_colors_types[color.theme];var tintExcel=0;if(null!=color.tint)tintExcel=color.tint;var tintPresentation=0;var basecolor=AscCommonExcel.g_oColorManager.getThemeColor(color.theme); var oThemeColorTint=AscCommonExcel.g_oThemeColorsDefaultModsSpreadsheet[AscCommon.GetDefaultColorModsIndex(basecolor.getR(),basecolor.getG(),basecolor.getB())];if(null!=oThemeColorTint)for(var i=0,length=oThemeColorTint.length;i<length;++i){var cur=oThemeColorTint[i];if(Math.abs(cur-tintExcel)<.005){bTheme=true;tintPresentation=i;break}}if(bTheme){oRes=new Asc.asc_CColor;oRes.r=r;oRes.g=g;oRes.b=b;oRes.a=255;oRes.type=Asc.c_oAscColor.COLOR_TYPE_SCHEME;oRes.value=themePresentation}}if(!bTheme)oRes= AscCommon.CreateAscColorCustom(r,g,b);return oRes}var oldPpi=undefined,cvt=undefined;function getCvtRatio(fromUnits,toUnits,ppi){if(ppi!==oldPpi||oldPpi===undefined){var _ppi=1/ppi,_72=1/72,_25_4=1/25.4;cvt=[[1,72*_ppi,_ppi,25.4*_ppi],[ppi*_72,1,_72,25.4*_72],[ppi,72,1,25.4],[ppi*_25_4,72*_25_4,_25_4,1]];oldPpi=ppi}return cvt[fromUnits][toUnits]}var MATRIX_ORDER_PREPEND=AscCommon.MATRIX_ORDER_PREPEND;var MATRIX_ORDER_APPEND=AscCommon.MATRIX_ORDER_APPEND;function Matrix(){if(!(this instanceof Matrix))return new Matrix; this.sx=1;this.shx=0;this.shy=0;this.sy=1;this.tx=0;this.ty=0;return this}Matrix.prototype.reset=function(){this.sx=1;this.shx=0;this.shy=0;this.sy=1;this.tx=0;this.ty=0};Matrix.prototype.assign=function(sx,shx,shy,sy,tx,ty){this.sx=sx;this.shx=shx;this.shy=shy;this.sy=sy;this.tx=tx;this.ty=ty};Matrix.prototype.copyFrom=function(matrix){this.sx=matrix.sx;this.shx=matrix.shx;this.shy=matrix.shy;this.sy=matrix.sy;this.tx=matrix.tx;this.ty=matrix.ty};Matrix.prototype.clone=function(){var m=new Matrix; m.copyFrom(this);return m};Matrix.prototype.multiply=function(matrix,order){if(MATRIX_ORDER_PREPEND===order){var m=matrix.clone();m.multiply(this,MATRIX_ORDER_APPEND);this.copyFrom(m)}else{var t0=this.sx*matrix.sx+this.shy*matrix.shx;var t2=this.shx*matrix.sx+this.sy*matrix.shx;var t4=this.tx*matrix.sx+this.ty*matrix.shx+matrix.tx;this.shy=this.sx*matrix.shy+this.shy*matrix.sy;this.sy=this.shx*matrix.shy+this.sy*matrix.sy;this.ty=this.tx*matrix.shy+this.ty*matrix.sy+matrix.ty;this.sx=t0;this.shx= t2;this.tx=t4}};Matrix.prototype.translate=function(x,y,order){var m=new Matrix;m.tx=x;m.ty=y;this.multiply(m,order)};Matrix.prototype.scale=function(x,y,order){var m=new Matrix;m.sx=x;m.sy=y;this.multiply(m,order)};Matrix.prototype.rotate=function(a,order){var m=new Matrix;var rad=AscCommon.deg2rad(a);m.sx=Math.cos(rad);m.shx=Math.sin(rad);m.shy=-Math.sin(rad);m.sy=Math.cos(rad);this.multiply(m,order)};Matrix.prototype.rotateAt=function(a,x,y,order){this.translate(-x,-y,order);this.rotate(a,order); this.translate(x,y,order)};Matrix.prototype.determinant=function(){return this.sx*this.sy-this.shy*this.shx};Matrix.prototype.invert=function(){var det=this.determinant();if(1E-4>det)return;var d=1/det;var t0=this.sy*d;this.sy=this.sx*d;this.shy=-this.shy*d;this.shx=-this.shx*d;var t4=-this.tx*t0-this.ty*this.shx;this.ty=-this.tx*this.shy-this.ty*this.sy;this.sx=t0;this.tx=t4};Matrix.prototype.transformPointX=function(x,y){return x*this.sx+y*this.shx+this.tx};Matrix.prototype.transformPointY=function(x, y){return x*this.shy+y*this.sy+this.ty};Matrix.prototype.getRotation=function(){var x1=0;var y1=0;var x2=1;var y2=0;this.transformPoint(x1,y1);this.transformPoint(x2,y2);var a=Math.atan2(y2-y1,x2-x1);return AscCommon.rad2deg(a)};function TextMetrics(width,height,lineHeight,baseline,descender,fontSize,widthBB){this.width=width||0;this.height=height||0;this.lineHeight=lineHeight||0;this.baseline=baseline||0;this.descender=descender||0;this.fontSize=fontSize||0;this.widthBB=widthBB||0;return this}function FontMetrics(){this.ascender= 0;this.descender=0;this.lineGap=0;this.nat_scale=0;this.nat_y1=0;this.nat_y2=0}FontMetrics.prototype.clone=function(){var res=new FontMetrics;res.ascender=this.ascender;res.descender=this.descender;res.lineGap=this.lineGap;res.nat_scale=this.nat_scale;res.nat_y1=this.nat_y1;res.nat_y2=this.nat_y2;return res};function NativeContext(){this.ctx=window["native"]}NativeContext.prototype.save=function(){this.ctx["PD_Save"]()};NativeContext.prototype.restore=function(){this.ctx["PD_Restore"]()};NativeContext.prototype.rect= function(x,y,w,h){this.ctx["PD_rect"](x,y,w,h)};NativeContext.prototype.clip=function(){this.ctx["PD_clip"]()};NativeContext.prototype.fill=function(){this.ctx["PD_Fill"]()};NativeContext.prototype.stroke=function(){this.ctx["PD_Stroke"]()};NativeContext.prototype.fillRect=function(x,y,w,h){this.rect(x,y,w,h);this.fill()};NativeContext.prototype.strokeRect=function(x,y,w,h){this.rect(x,y,w,h);this.stroke()};NativeContext.prototype.beginPath=function(){this.ctx["PD_PathStart"]()};NativeContext.prototype.closePath= function(){this.ctx["PD_PathClose"]()};NativeContext.prototype.moveTo=function(x,y){this.ctx["PD_PathMoveTo"](x,y)};NativeContext.prototype.lineTo=function(x,y){this.ctx["PD_PathLineTo"](x,y)};NativeContext.prototype.lineHor=function(x1,y,x2){this.ctx["PD_PathMoveTo"](x1,y);this.ctx["PD_PathLineTo"](x2,y)};NativeContext.prototype.lineVer=function(x,y1,y2){this.ctx["PD_PathMoveTo"](x,y1);this.ctx["PD_PathLineTo"](x,y2)};NativeContext.prototype.bezierCurveTo=function(x1,y1,x2,y2,x3,y3){this.ctx["PD_PathCurveTo"](x1, y1,x2,y2,x3,y3)};NativeContext.prototype.setStrokeStyle=function(r,g,b,a){this.ctx["PD_p_color"](r,g,b,a*255)};NativeContext.prototype.setFillStyle=function(r,g,b,a){this.ctx["PD_b_color1"](r,g,b,a*255)};Object.defineProperty(NativeContext.prototype,"lineWidth",{set:function(value){this.ctx["PD_p_width"](value)}});NativeContext.prototype.clearRect=function(x,y,w,h){};NativeContext.prototype.getImageData=function(sx,sy,sw,sh){};NativeContext.prototype.putImageData=function(image_data,dx,dy,dirtyX, dirtyY,dirtyWidth,dirtyHeight){};function NativeFontManager(){this.m_lUnits_Per_Em=0;this.m_lAscender=0;this.m_lDescender=0;this.m_lLineHeight=0}NativeFontManager.prototype.init=function(fontInfo){this.m_lUnits_Per_Em=fontInfo[3];this.m_lAscender=fontInfo[0];this.m_lDescender=fontInfo[2];this.m_lLineHeight=fontInfo[2]};NativeFontManager.prototype.MeasureChar=function(lUnicode){var bounds=g_oTextMeasurer.Measurer["GetDrawingBox"](lUnicode);return{fAdvanceX:bounds[0],oBBox:{fMinX:bounds[1],fMaxX:bounds[2], fMinY:bounds[3],fMaxY:bounds[4]}}};NativeFontManager.prototype.SetTextMatrix=function(fA,fB,fC,fD,fE,fF){window["native"]["PD_transform"](fA,fB,fC,fD,fE,fF)};function DrawingContext(settings){this.canvas=null;this.ctx=null;this.setCanvas(settings.canvas);this.ppiX=96;this.ppiY=96;this.scaleFactor=1;this._ppiInit();this.LastFontOriginInfo=undefined;this._mct=new Matrix;this._mt=new Matrix;this._mbt=new Matrix;this._mft=new Matrix;this._mift=new Matrix;this._im=new Matrix;this.units=3;this.changeUnits(undefined!== settings.units?settings.units:this.units);this.fmgrGraphics=undefined!==settings.fmgrGraphics?settings.fmgrGraphics:null;if(window["IS_NATIVE_EDITOR"])this.fmgrGraphics=[new NativeFontManager,new NativeFontManager,new NativeFontManager,new NativeFontManager];if(null===this.fmgrGraphics)throw"Can not set graphics in DrawingContext";this.font=undefined!==settings.font?settings.font:null;if(null===this.font)throw"Can not set font in DrawingContext";this.fillColor=new AscCommon.CColor(255,255,255);return this} DrawingContext.prototype._ppiInit=function(){this.ppiX=96;this.ppiY=96;this.scaleFactor=1;if(window["IS_NATIVE_EDITOR"])this.ppiX=this.ppiY=window["native"]["GetDeviceDPI"]();else if(AscCommon.AscBrowser.isRetina){this.ppiX=AscCommon.AscBrowser.convertToRetinaValue(this.ppiX,true);this.ppiY=AscCommon.AscBrowser.convertToRetinaValue(this.ppiY,true)}};DrawingContext.prototype.getWidth=function(units){var i=units>=0&&units<=3?units:this.units;return this.canvas.width*getCvtRatio(0,i,this.ppiX)};DrawingContext.prototype.getHeight= function(units){var i=units>=0&&units<=3?units:this.units;return this.canvas.height*getCvtRatio(0,i,this.ppiY)};DrawingContext.prototype.getCanvas=function(){return this.canvas};DrawingContext.prototype.setCanvas=function(canvas){this.canvas=canvas||null;this.ctx=window["IS_NATIVE_EDITOR"]?new NativeContext:this.canvas&&this.canvas.getContext("2d")};DrawingContext.prototype.getPPIX=function(){return this.ppiX};DrawingContext.prototype.getPPIY=function(){return this.ppiY};DrawingContext.prototype.getUnits= function(){return this.units};DrawingContext.prototype.moveImageDataSafari=function(sx,sy,w,h,x,y){var sr=this._calcRect(sx,sy,w,h);var r=this._calcRect(x,y);var imgData=this.ctx.getImageData(sr.x,sr.y,sr.w,sr.h);var minX,maxX,minY,maxY;if(sx<x){minX=sr.x;maxX=r.x}else{minX=r.x;maxX=sr.x}if(sy<y){minY=sr.y;maxY=r.y}else{minY=r.y;maxY=sr.y}this.ctx.clearRect(minX,minY,maxX+sr.w,maxY+sr.h);this.ctx.putImageData(imgData,r.x,r.y);return this};DrawingContext.prototype.moveImageData=function(sx,sy,w,h, x,y){var sr=this._calcRect(sx,sy,w,h);var r=this._calcRect(x,y);this.ctx.save();this.ctx.globalCompositeOperation="copy";this.ctx.beginPath();this.ctx.rect(r.x,r.y,sr.w,sr.h);this.ctx.clip();this.ctx.drawImage(this.getCanvas(),sr.x,sr.y,sr.w,sr.h,r.x,r.y,sr.w,sr.h);this.ctx.restore();this.ctx.beginPath();return this};DrawingContext.prototype.changeUnits=function(units){var i=units>=0&&units<=3?units:0;this._mct.sx=getCvtRatio(i,0,this.ppiX);this._mct.sy=getCvtRatio(i,0,this.ppiY);this._calcMFT(); this.units=units;return this};DrawingContext.prototype.getZoom=function(){return this.scaleFactor};DrawingContext.prototype.changeZoom=function(factor){if(!factor){factor=this.scaleFactor;this._ppiInit()}factor=asc_round(factor*1E3)/1E3;this.ppiX=asc_round(this.ppiX/this.scaleFactor*factor*1E3)/1E3;this.ppiY=asc_round(this.ppiY/this.scaleFactor*factor*1E3)/1E3;this.scaleFactor=factor;this.changeUnits(this.units);this.setFont(this.font);return this};DrawingContext.prototype.resetSize=function(width, height){var w=asc_round(width*getCvtRatio(this.units,0,this.ppiX)),h=asc_round(height*getCvtRatio(this.units,0,this.ppiY));if(w!==this.canvas.width)this.canvas.width=w;if(h!==this.canvas.height)this.canvas.height=h;return this};DrawingContext.prototype.expand=function(width,height){var w=asc_round(width*getCvtRatio(this.units,0,this.ppiX)),h=asc_round(height*getCvtRatio(this.units,0,this.ppiY));if(w>this.canvas.width)this.canvas.width=w;if(h>this.canvas.height)this.canvas.height=h;return this};DrawingContext.prototype.clear= function(){this.clearRect(0,0,this.getWidth(),this.getHeight());return this};DrawingContext.prototype.AddClipRect=function(x,y,w,h){return this.save().beginPath().rect(x,y,w,h).clip()};DrawingContext.prototype.RemoveClipRect=function(){return this.restore()};DrawingContext.prototype.save=function(){this.ctx.save();return this};DrawingContext.prototype.restore=function(){this.ctx.restore();return this};DrawingContext.prototype.scale=function(kx,ky){return this};DrawingContext.prototype.rotate=function(a){return this}; DrawingContext.prototype.translate=function(dx,dy){return this};DrawingContext.prototype.transform=function(sx,shy,shx,sy,tx,ty){return this};DrawingContext.prototype.setTransform=function(sx,shy,shx,sy,tx,ty){this._mbt.assign(sx,shx,shy,sy,tx,ty);return this};DrawingContext.prototype.setTextTransform=function(sx,shy,shx,sy,tx,ty){this._mt.assign(sx,shx,shy,sy,tx,ty);return this};DrawingContext.prototype.updateTransforms=function(){this._calcMFT();this.fmgrGraphics[1].SetTextMatrix(this._mt.sx,this._mt.shy, this._mt.shx,this._mt.sy,this._mt.tx,this._mt.ty)};DrawingContext.prototype.resetTransforms=function(){this.setTransform(this._im.sx,this._im.shy,this._im.shx,this._im.sy,this._im.tx,this._im.ty);this.setTextTransform(this._im.sx,this._im.shy,this._im.shx,this._im.sy,this._im.tx,this._im.ty);this._calcMFT();if(window["IS_NATIVE_EDITOR"])window["native"]["PD_transform"](this._im.sx,this._im.shy,this._im.shx,this._im.sy,this._im.tx,this._im.ty)};DrawingContext.prototype.getFillStyle=function(){return this.ctx.fillStyle}; DrawingContext.prototype.getStrokeStyle=function(){return this.ctx.strokeStyle};DrawingContext.prototype.getLineWidth=function(){return this.ctx.lineWidth};DrawingContext.prototype.getLineCap=function(){return this.ctx.lineCap};DrawingContext.prototype.getLineJoin=function(){return this.ctx.lineJoin};DrawingContext.prototype.setFillStyle=function(val){var _r=val.getR();var _g=val.getG();var _b=val.getB();var _a=val.getA();this.fillColor=new AscCommon.CColor(_r,_g,_b,_a);if(this.ctx.fillStyle)this.ctx.fillStyle= "rgba("+_r+","+_g+","+_b+","+_a+")";else this.ctx.setFillStyle(_r,_g,_b,_a);return this};DrawingContext.prototype.setFillPattern=function(val){this.ctx.fillStyle=val;return this};DrawingContext.prototype.setStrokeStyle=function(val){var _r=val.getR();var _g=val.getG();var _b=val.getB();var _a=val.getA();if(this.ctx.strokeStyle)this.ctx.strokeStyle="rgba("+_r+","+_g+","+_b+","+_a+")";else this.ctx.setStrokeStyle(_r,_g,_b,_a);return this};DrawingContext.prototype.setLineWidth=function(width){this.ctx.lineWidth= width;return this};DrawingContext.prototype.setLineCap=function(cap){this.ctx.lineCap=cap;return this};DrawingContext.prototype.setLineJoin=function(join){this.ctx.lineJoin=join;return this};DrawingContext.prototype.setLineDash=function(segments){if(this.ctx.setLineDash)this.ctx.setLineDash(segments);return this};DrawingContext.prototype.fillRect=function(x,y,w,h){var r=this._calcRect(x,y,w,h);this.ctx.fillRect(r.x,r.y,r.w,r.h);return this};DrawingContext.prototype.strokeRect=function(x,y,w,h){var isEven= 0!==this.ctx.lineWidth%2?.5:0;var r=this._calcRect(x,y,w,h);this.ctx.strokeRect(r.x+isEven,r.y+isEven,r.w,r.h);return this};DrawingContext.prototype.clearRect=function(x,y,w,h){var r=this._calcRect(x,y,w,h);this.ctx.clearRect(r.x,r.y,r.w,r.h);return this};DrawingContext.prototype.clearRectByX=function(x,y,w,h){var r=this._calcRect(x,y,w,h);this.ctx.clearRect(r.x-1,r.y,r.w+1,r.h)};DrawingContext.prototype.clearRectByY=function(x,y,w,h){var r=this._calcRect(x,y,w,h);this.ctx.clearRect(r.x,r.y-1,r.w, r.h+1)};DrawingContext.prototype.getFont=function(){return this.font.clone()};DrawingContext.prototype.getFontSize=function(){return this.font.getSize()};DrawingContext.prototype.getFontMetrics=function(units){var fm=this.fmgrGraphics[3];var d=Math.abs(fm.m_lDescender);var ppiX=96;if(AscCommon.AscBrowser.isRetina)ppiX=AscCommon.AscBrowser.convertToRetinaValue(ppiX,true);var r=getCvtRatio(0,units>=0&&units<=3?units:this.units,ppiX);var r2=getCvtRatio(1,units>=0&&units<=3?units:this.units,ppiX);var factor= this.getFontSize()*r/fm.m_lUnits_Per_Em;var res=new FontMetrics;res.ascender=factor*fm.m_lAscender;res.descender=factor*d;res.lineGap=factor*(fm.m_lLineHeight-fm.m_lAscender-d);var face;if(window["IS_NATIVE_EDITOR"]){face=g_oTextMeasurer.Measurer["GetFace"]();res.nat_scale=face[0];res.nat_y1=face[1];res.nat_y2=face[2]}else{var faceMetrics=fm.m_pFont.cellGetMetrics();res.nat_scale=faceMetrics[0];res.nat_y1=faceMetrics[1];res.nat_y2=faceMetrics[2]}res.nat_y1*=r2;res.nat_y2*=r2;return res};DrawingContext.prototype.setFont= function(font,angle){var r;this.font.assign(font);if(window["IS_NATIVE_EDITOR"])this.font.fs=this.font.getSize()*this.scaleFactor*96/25.4;var italic=this.font.getItalic();var bold=this.font.getBold();var fontStyle;if(italic&&bold)fontStyle=FontStyle.FontStyleBoldItalic;else if(italic)fontStyle=FontStyle.FontStyleItalic;else if(bold)fontStyle=FontStyle.FontStyleBold;else fontStyle=FontStyle.FontStyleRegular;if(window["IS_NATIVE_EDITOR"]){var fontInfo=AscFonts.g_fontApplication.GetFontInfo(this.font.getName(), fontStyle,this.LastFontOriginInfo);fontInfo=GetLoadInfoForMeasurer(fontInfo,fontStyle);var flag=0;if(fontInfo.NeedBold)flag|=1;if(fontInfo.NeedItalic)flag|=2;if(fontInfo.SrcBold)flag|=4;if(fontInfo.SrcItalic)flag|=8;if(!angle)window["native"]["PD_LoadFont"](fontInfo.Path,fontInfo.FaceIndex,this.font.getSize(),flag);AscCommon.g_oTextMeasurer.Flush();fontInfo=g_oTextMeasurer.Measurer["LoadFont"](fontInfo.Path,fontInfo.FaceIndex,this.font.getSize(),flag);if(angle)this.fmgrGraphics[1].init(fontInfo); else{this.fmgrGraphics[0].init(fontInfo);this.fmgrGraphics[3].init(fontInfo)}r=true}else if(angle)r=AscFonts.g_fontApplication.LoadFont(this.font.getName(),AscCommon.g_font_loader,this.fmgrGraphics[1],this.font.getSize(),fontStyle,this.ppiX,this.ppiY);else{r=AscFonts.g_fontApplication.LoadFont(this.font.getName(),AscCommon.g_font_loader,this.fmgrGraphics[0],this.font.getSize(),fontStyle,this.ppiX,this.ppiY);AscFonts.g_fontApplication.LoadFont(this.font.getName(),AscCommon.g_font_loader,this.fmgrGraphics[3], this.font.getSize(),fontStyle,this.ppiX,this.ppiY)}if(angle)this.fmgrGraphics[1].SetTextMatrix(this._mt.sx,this._mt.shy,this._mt.shx,this._mt.sy,this._mt.tx,this._mt.ty);if(r===false)throw"Can not use "+this.font.getName()+" font. (Check whether font file is loaded)";return this};DrawingContext.prototype.measureChar=function(text,units){return this.measureText(text.charAt(0),units)};DrawingContext.prototype.measureText=function(text,units){var code;var fm=this.fmgrGraphics[3];var r=getCvtRatio(0, units>=0&&units<=3?units:this.units,this.ppiX);for(var tmp,w=0,w2=0,i=0;i<text.length;++i){code=text.charCodeAt(i);tmp=fm.MeasureChar(160===code?32:code);w+=asc_round(tmp.fAdvanceX)}w2=w-tmp.fAdvanceX+tmp.oBBox.fMaxX-tmp.oBBox.fMinX+1;return this._calcTextMetrics(w*r,w2*r,fm,r)};DrawingContext.prototype.fillGlyph=function(pGlyph,fmgr){var nW=pGlyph.oBitmap.nWidth;var nH=pGlyph.oBitmap.nHeight;if(!(nW>0&&nH>0))return;var nX=asc_floor(fmgr.m_oGlyphString.m_fX+pGlyph.fX+pGlyph.oBitmap.nX);var nY=asc_floor(fmgr.m_oGlyphString.m_fY+ pGlyph.fY-pGlyph.oBitmap.nY);var _r=this.fillColor.r;var _g=this.fillColor.g;var _b=this.fillColor.b;pGlyph.oBitmap.oGlyphData.checkColor(_r,_g,_b,nW,nH);pGlyph.oBitmap.draw(this.ctx,nX,nY)};DrawingContext.prototype.fillText=function(text,x,y,maxWidth,charWidths,angle){var code,pGlyph;var manager=angle?this.fmgrGraphics[1]:this.fmgrGraphics[0];var _x=this._mift.transformPointX(x,y);var _y=this._mift.transformPointY(x,y);var length=text.length;for(var i=0;i<length;++i){code=text.charCodeAt(i);code= 160===code?32:code;if(window["IS_NATIVE_EDITOR"]){window["native"]["PD_FillText"](_x,_y,code);_x+=Asc.round(g_oTextMeasurer.Measurer["MeasureChar"](code))}else{_x=asc_round(manager.LoadString4C(code,_x,_y));pGlyph=manager.m_oGlyphString.m_pGlyphsBuffer[0];if(null===pGlyph||null===pGlyph.oBitmap)continue;this.fillGlyph(pGlyph,manager)}}return this};DrawingContext.prototype.beginPath=function(){this.ctx.beginPath();return this};DrawingContext.prototype.closePath=function(){this.ctx.closePath();return this}; DrawingContext.prototype.moveTo=function(x,y){var r=this._calcRect(x,y);this.ctx.moveTo(r.x,r.y);return this};DrawingContext.prototype.lineTo=function(x,y){var r=this._calcRect(x,y);this.ctx.lineTo(r.x,r.y);return this};DrawingContext.prototype.lineDiag=function(x1,y1,x2,y2){var isEven=0!==this.ctx.lineWidth%2?.5:0;var r1=this._calcRect(x1,y1);var r2=this._calcRect(x2,y2);this.ctx.moveTo(r1.x+isEven,r1.y+isEven);this.ctx.lineTo(r2.x+isEven,r2.y+isEven);return this};DrawingContext.prototype.lineHor= function(x1,y,x2){var isEven=0!==this.ctx.lineWidth%2?.5:0;var r1=this._calcRect(x1,y);var r2=this._calcRect(x2,y);this.ctx.moveTo(r1.x,r1.y+isEven);this.ctx.lineTo(r2.x,r2.y+isEven);return this};DrawingContext.prototype.lineVer=function(x,y1,y2){var isEven=0!==this.ctx.lineWidth%2?.5:0;var r1=this._calcRect(x,y1);var r2=this._calcRect(x,y2);this.ctx.moveTo(r1.x+isEven,r1.y);this.ctx.lineTo(r2.x+isEven,r2.y);return this};DrawingContext.prototype.lineHorPrevPx=function(x1,y,x2){var isEven=(0!==this.ctx.lineWidth% 2?.5:0)-1;var r1=this._calcRect(x1,y);var r2=this._calcRect(x2,y);this.ctx.moveTo(r1.x,r1.y+isEven);this.ctx.lineTo(r2.x,r2.y+isEven);return this};DrawingContext.prototype.lineVerPrevPx=function(x,y1,y2){var isEven=(0!==this.ctx.lineWidth%2?.5:0)-1;var r1=this._calcRect(x,y1);var r2=this._calcRect(x,y2);this.ctx.moveTo(r1.x+isEven,r1.y);this.ctx.lineTo(r2.x+isEven,r2.y);return this};DrawingContext.prototype.dashLineCleverHor=function(x1,y,x2){var isEven=0!==this.ctx.lineWidth%2?.5:0;var w_dot=AscCommonExcel.c_oAscCoAuthoringDottedWidth, w_dist=AscCommonExcel.c_oAscCoAuthoringDottedDistance;var _x1=this._mct.transformPointX(x1,y);var _y=this._mct.transformPointY(x1,y)-1;var _x2=this._mct.transformPointX(x2,y);var ctx=this.ctx;_x1=_x1>>0;_y=(_y>>0)+isEven;_x2=_x2>>0;for(;_x1<_x2;_x1+=w_dist){ctx.moveTo(_x1,_y);_x1+=w_dot;if(_x1>_x2)_x1=_x2;ctx.lineTo(_x1,_y)}};DrawingContext.prototype.dashLineCleverVer=function(x,y1,y2){var isEven=0!==this.ctx.lineWidth%2?.5:0;var w_dot=AscCommonExcel.c_oAscCoAuthoringDottedWidth,w_dist=AscCommonExcel.c_oAscCoAuthoringDottedDistance; var _y1=this._mct.transformPointY(x,y1);var _x=this._mct.transformPointX(x,y1)-1;var _y2=this._mct.transformPointY(x,y2);var ctx=this.ctx;_y1=_y1>>0;_x=(_x>>0)+isEven;_y2=_y2>>0;for(;_y1<_y2;_y1+=w_dist){ctx.moveTo(_x,_y1);_y1+=w_dot;if(_y1>_y2)_y1=_y2;ctx.lineTo(_x,_y1)}};DrawingContext.prototype.dashLine=function(x1,y1,x2,y2,w_dot,w_dist){var len=Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));if(len<1)len=1;var len_x1=Math.abs(w_dot*(x2-x1)/len);var len_y1=Math.abs(w_dot*(y2-y1)/len);var len_x2=Math.abs(w_dist* (x2-x1)/len);var len_y2=Math.abs(w_dist*(y2-y1)/len);var i,j;if(x1<=x2&&y1<=y2)for(i=x1,j=y1;i<x2||j<y2;i+=len_x2,j+=len_y2){this.moveTo(i,j);i+=len_x1;j+=len_y1;if(i>x2)i=x2;if(j>y2)j=y2;this.lineTo(i,j)}else if(x1<=x2&&y1>y2)for(i=x1,j=y1;i<x2||j>y2;i+=len_x2,j-=len_y2){this.moveTo(i,j);i+=len_x1;j-=len_y1;if(i>x2)i=x2;if(j<y2)j=y2;this.lineTo(i,j)}else if(x1>x2&&y1<=y2)for(i=x1,j=y1;i>x2||j<y2;i-=len_x2,j+=len_y2){this.moveTo(i,j);i-=len_x1;j+=len_y1;if(i<x2)i=x2;if(j>y2)j=y2;this.lineTo(i,j)}else for(i= x1,j=y1;i>x2||j>y2;i-=len_x2,j-=len_y2){this.moveTo(i,j);i-=len_x1;j-=len_y1;if(i<x2)i=x2;if(j<y2)j=y2;this.lineTo(i,j)}};DrawingContext.prototype.dashRect=function(x1,y1,x2,y2,x3,y3,x4,y4,w_dot,w_dist){this.dashLine(x1,y1,x2,y2,w_dot,w_dist);this.dashLine(x2,y2,x4,y4,w_dot,w_dist);this.dashLine(x4,y4,x3,y3,w_dot,w_dist);this.dashLine(x3,y3,x1,y1,w_dot,w_dist)};DrawingContext.prototype.rect=function(x,y,w,h){var r=this._calcRect(x,y,w,h);this.ctx.rect(r.x,r.y,r.w,r.h);return this};DrawingContext.prototype.arc= function(x,y,radius,startAngle,endAngle,antiClockwise,dx,dy){var r=this._calcRect(x,y);dx=typeof dx!=="undefined"?dx:0;dy=typeof dy!=="undefined"?dy:0;this.ctx.arc(r.x+dx,r.y+dy,radius,startAngle,endAngle,antiClockwise);return this};DrawingContext.prototype.bezierCurveTo=function(x1,y1,x2,y2,x3,y3){var p1=this._calcRect(x1,y1),p2=this._calcRect(x2,y2),p3=this._calcRect(x3,y3);this.ctx.bezierCurveTo(p1.x,p1.y,p2.x,p2.y,p3.x,p3.y);return this};DrawingContext.prototype.fill=function(){this.ctx.fill(); return this};DrawingContext.prototype.stroke=function(){this.ctx.stroke();return this};DrawingContext.prototype.clip=function(){this.ctx.clip();return this};DrawingContext.prototype.drawImage=function(img,sx,sy,sw,sh,dx,dy,dw,dh){var sr=this._calcRect(sx,sy,sw,sh),dr=this._calcRect(dx,dy,dw,dh);this.ctx.drawImage(img,sr.x,sr.y,sr.w,sr.h,dr.x,dr.y,dr.w,dr.h);return this};DrawingContext.prototype._calcRect=function(x,y,w,h){var wh=w!==undefined&&h!==undefined,x2=x+w,y2=y+h,_x=this._mft.transformPointX(x, y),_y=this._mft.transformPointY(x,y);return{x:asc_round(_x),y:asc_round(_y),w:wh?asc_round(this._mft.transformPointX(x2,y2)-_x):undefined,h:wh?asc_round(this._mft.transformPointY(x2,y2)-_y):undefined}};DrawingContext.prototype._calcMFT=function(){this._mft=this._mct.clone();this._mft.multiply(this._mbt,MATRIX_ORDER_PREPEND);this._mft.multiply(this._mt,MATRIX_ORDER_PREPEND);this._mift=this._mt.clone();this._mift.invert();this._mift.multiply(this._mft,MATRIX_ORDER_PREPEND)};DrawingContext.prototype._calcTextMetrics= function(w,wBB,fm,r){var factor=this.getFontSize()*r/fm.m_lUnits_Per_Em,l=fm.m_lLineHeight*factor,b=fm.m_lAscender*factor,d=Math.abs(fm.m_lDescender*factor);return new TextMetrics(w,b+d,l,b,d,this.font.getSize(),wBB)};window["Asc"]=window["Asc"]||{};window["Asc"].getCvtRatio=getCvtRatio;window["Asc"].colorObjToAscColor=colorObjToAscColor;window["Asc"].TextMetrics=TextMetrics;window["Asc"].FontMetrics=FontMetrics;window["Asc"].DrawingContext=DrawingContext;window["Asc"].Matrix=Matrix})(window);"use strict"; (function(window,undefined){var vector_koef=25.4/96;var pxInPt=.75;function CPdfPrinter(fontManager,font){this._ppiX=96;this._ppiY=96;this._zoom=1;if(window.Asc&&window.Asc.editor){this._zoom=window.Asc.editor.asc_getZoom();this._ppiX=96;this._ppiY=96}vector_koef=25.4/(this._ppiX*this._zoom);if(AscCommon.AscBrowser.isRetina)vector_koef/=AscCommon.AscBrowser.retinaPixelRatio;this.DocumentRenderer=new AscCommon.CDocumentRenderer;if(!window["IS_NATIVE_EDITOR"])this.DocumentRenderer.InitPicker(fontManager); this.DocumentRenderer.VectorMemoryForPrint=new AscCommon.CMemory;this.font=font;this.Transform=new AscCommon.CMatrix;this.InvertTransform=new AscCommon.CMatrix;this.bIsSimpleCommands=false}CPdfPrinter.prototype={BeginPage:function(width,height){this.DocumentRenderer.BeginPage(width,height)},EndPage:function(){this.DocumentRenderer.EndPage()},getWidth:function(units){console.log("error");return 0},getHeight:function(units){console.log("error");return 0},getCanvas:function(){console.log("error");return null}, getPPIX:function(){return this._ppiX},getPPIY:function(){return this._ppiY},getUnits:function(){return 3},changeUnits:function(){return this},getZoom:function(){return this._zoom},changeZoom:function(){console.log("error");return this},resetSize:function(){console.log("error");return this},expand:function(width,heigth){console.log("error");return this},clear:function(){console.log("error");return this},scale:function(){console.log("error");return this},translate:function(){console.log("error");return this}, setTransform:function(sx,shy,shx,sy,tx,ty){this.Transform.sx=sx;this.Transform.shy=shy;this.Transform.shx=shx;this.Transform.sy=sy;this.Transform.tx=tx;this.Transform.ty=ty;this.InvertTransform=this.Transform.CreateDublicate();this.InvertTransform.Invert();this.DocumentRenderer.transform(sx,shy,shx,sy,tx,ty);return this},getFillStyle:function(){return"#000000"},getStrokeStyle:function(){return"#000000"},getLineWidth:function(){return 1},getLineCap:function(){return"butt"},getLineJoin:function(){return"miter"}, setFillStyle:function(val){var _r=val.getR();var _g=val.getG();var _b=val.getB();var _a=val.getA();this.DocumentRenderer.b_color1(_r,_g,_b,_a*255+.5>>0);return this},setFillPattern:function(val){return this},setStrokeStyle:function(val){var _r=val.getR();var _g=val.getG();var _b=val.getB();var _a=val.getA();this.DocumentRenderer.p_color(_r,_g,_b,_a*255+.5>>0);return this},setLineWidth:function(val){this.DocumentRenderer.p_width(val*1E3*vector_koef);return this},setLineDash:function(params){var tmp= [];for(var i=0;i<params.length;++i)tmp.push(params[i]*vector_koef);this.DocumentRenderer.p_dash(tmp);return this},setLineCap:function(cap){return this},setLineJoin:function(join){return this},fillRect:function(x,y,w,h){this.DocumentRenderer.rect(x*vector_koef,y*vector_koef,w*vector_koef,h*vector_koef);this.DocumentRenderer.df();return this},strokeRect:function(x,y,w,h){this.DocumentRenderer.rect(x*vector_koef,y*vector_koef,w*vector_koef,h*vector_koef);this.DocumentRenderer.ds();return this},clearRect:function(x, y,w,h){return this},getFont:function(){return this.font.clone()},getFontSize:function(){return this.font.FontSize},getFontMetrix:function(){console.log("error");return new Asc.FontMetrics},makeFontDoc:function(font){return{FontFamily:{Index:-1,Name:font.getName()},FontSize:font.getSize(),Bold:font.getBold(),Italic:font.getItalic()}},setFont:function(font){this.SetFont(font);return this},measureChar:function(text,units){console.log("error");return null},measureText:function(text,units){console.log("error"); return null},fillText:function(text,x,y,maxWidth,charWidths){var charPos=0;var _x=x*vector_koef;var _y=y*vector_koef;for(var iter=text.getUnicodeIterator();iter.check();iter.next()){this.DocumentRenderer.FillTextCode(_x,_y,iter.value());if(charPos<charWidths.length)_x+=charWidths[charPos]*vector_koef;charPos++}return this},beginPath:function(){this.DocumentRenderer._s();return this},closePath:function(){this.DocumentRenderer._z();return this},moveTo:function(x,y){this.DocumentRenderer._m(x*vector_koef, y*vector_koef);return this},lineTo:function(x,y){this.DocumentRenderer._l(x*vector_koef,y*vector_koef);return this},lineDiag:function(x1,y1,x2,y2){this.DocumentRenderer._m(x1*vector_koef,y1*vector_koef);this.DocumentRenderer._l(x2*vector_koef,y2*vector_koef);return this},lineHor:function(x1,y,x2){this.DocumentRenderer._m(x1*vector_koef,y*vector_koef);this.DocumentRenderer._l(x2*vector_koef,y*vector_koef);return this},lineVer:function(x,y1,y2){this.DocumentRenderer._m(x*vector_koef,y1*vector_koef); this.DocumentRenderer._l(x*vector_koef,y2*vector_koef);return this},lineHorPrevPx:function(x1,y,x2){y-=pxInPt;this.DocumentRenderer._m(x1*vector_koef,y*vector_koef);this.DocumentRenderer._l(x2*vector_koef,y*vector_koef);return this},lineVerPrevPx:function(x,y1,y2){x-=pxInPt;this.DocumentRenderer._m(x*vector_koef,y1*vector_koef);this.DocumentRenderer._l(x*vector_koef,y2*vector_koef);return this},rect:function(x,y,w,h){if(this.bIsSimpleCommands)return this.DocumentRenderer.rect(x,y,w,h);this.DocumentRenderer.rect(x* vector_koef,y*vector_koef,w*vector_koef,h*vector_koef);return this},arc:function(x,y,radius,startAngle,endAngle,antiClockwise){return this},bezierCurveTo:function(x1,y1,x2,y2,x3,y3){this.DocumentRenderer._c(x1*vector_koef,y1*vector_koef,x2*vector_koef,y2*vector_koef,x3*vector_koef,y3*vector_koef);return this},fill:function(){this.DocumentRenderer.df();return this},stroke:function(){this.DocumentRenderer.ds();return this},drawImage:function(_src,sx,sy,sw,sh,dx,dy,dw,dh,src_w,src_h){if(this.bIsSimpleCommands)return this.DocumentRenderer.drawImage(_src, sx,sy,sw,sh,dx,dy);var srcLocal=AscCommon.g_oDocumentUrls.getLocal(_src);if(srcLocal)_src=srcLocal;if(0==sx&&0==sy&&sw==src_w&&sh==src_h){this.DocumentRenderer.Memory.WriteByte(AscCommon.CommandType.ctDrawImageFromFile);this.DocumentRenderer.Memory.WriteString2(_src);this.DocumentRenderer.Memory.WriteDouble(dx*vector_koef);this.DocumentRenderer.Memory.WriteDouble(dy*vector_koef);this.DocumentRenderer.Memory.WriteDouble(dw*vector_koef);this.DocumentRenderer.Memory.WriteDouble(dh*vector_koef)}else{this.AddClipRect(dx, dy,dw,dh);var dKoefX=dw/sw;var dKoefY=dh/sh;var dstX=dx-dKoefX*sx;var dstY=dy-dKoefY*sy;var dstW=dKoefX*src_w;var dstH=dKoefY*src_h;this.DocumentRenderer.Memory.WriteByte(AscCommon.CommandType.ctDrawImageFromFile);this.DocumentRenderer.Memory.WriteString2(_src);this.DocumentRenderer.Memory.WriteDouble(dstX*vector_koef);this.DocumentRenderer.Memory.WriteDouble(dstY*vector_koef);this.DocumentRenderer.Memory.WriteDouble(dstW*vector_koef);this.DocumentRenderer.Memory.WriteDouble(dstH*vector_koef);this.RemoveClipRect()}return this}, AddClipRect:function(x,y,w,h){if(this.bIsSimpleCommands)return this.DocumentRenderer.AddClipRect(x,y,w,h);this.DocumentRenderer.SaveGrState();this.DocumentRenderer.AddClipRect(x*vector_koef,y*vector_koef,w*vector_koef,h*vector_koef)},RemoveClipRect:function(){if(this.bIsSimpleCommands)return this.DocumentRenderer.RemoveClipRect();this.DocumentRenderer.RestoreGrState()},SetClip:function(r){this.DocumentRenderer.SetClip(r)},RemoveClip:function(){this.DocumentRenderer.RemoveClip()},p_color:function(r, g,b,a){return this.DocumentRenderer.p_color(r,g,b,a)},p_width:function(w){return this.DocumentRenderer.p_width(w)},p_dash:function(params){return this.DocumentRenderer.p_dash(params)},b_color1:function(r,g,b,a){return this.DocumentRenderer.b_color1(r,g,b,a)},b_color2:function(r,g,b,a){return this.DocumentRenderer.b_color2(r,g,b,a)},transform:function(sx,shy,shx,sy,tx,ty){return this.DocumentRenderer.transform(sx,shy,shx,sy,tx,ty)},transform3:function(m){return this.DocumentRenderer.transform3(m)}, reset:function(){return this.DocumentRenderer.reset()},_s:function(){return this.DocumentRenderer._s()},_e:function(){return this.DocumentRenderer._e()},_z:function(){return this.DocumentRenderer._z()},_m:function(x,y){return this.DocumentRenderer._m(x,y)},_l:function(x,y){return this.DocumentRenderer._l(x,y)},_c:function(x1,y1,x2,y2,x3,y3){return this.DocumentRenderer._c(x1,y1,x2,y2,x3,y3)},_c2:function(x1,y1,x2,y2){return this.DocumentRenderer._c(x1,y1,x2,y2)},ds:function(){return this.DocumentRenderer.ds()}, df:function(){return this.DocumentRenderer.df()},drawpath:function(type){return this.DocumentRenderer.drawpath(type)},save:function(){return this.DocumentRenderer.save()},restore:function(){return this.DocumentRenderer.restore()},clip:function(){return this.DocumentRenderer.clip()},SetFont:function(font){this.font.assign(font);return this.DocumentRenderer.SetFont(this.makeFontDoc(font))},FillText:function(x,y,text,cropX,cropW){return this.DocumentRenderer.FillText(x,y,text,cropX,cropW)},FillText2:function(x, y,text){return this.DocumentRenderer.FillText2(x,y,text)},charspace:function(space){return this.DocumentRenderer.charspace(space)},SetIntegerGrid:function(param){return this.DocumentRenderer.SetIntegerGrid(param)},GetIntegerGrid:function(){return this.DocumentRenderer.GetIntegerGrid()},GetFont:function(){return this.DocumentRenderer.GetFont()},put_GlobalAlpha:function(enable,alpha){return this.DocumentRenderer.put_GlobalAlpha(enable,alpha)},Start_GlobalAlpha:function(){return this.DocumentRenderer.Start_GlobalAlpha()}, End_GlobalAlpha:function(){return this.DocumentRenderer.End_GlobalAlpha()},DrawHeaderEdit:function(yPos){return this.DocumentRenderer.DrawHeaderEdit(yPos)},DrawFooterEdit:function(yPos){return this.DocumentRenderer.DrawFooterEdit(yPos)},drawCollaborativeChanges:function(x,y,w,h){return this.DocumentRenderer.drawCollaborativeChanges(x,y,w,h)},DrawEmptyTableLine:function(x1,y1,x2,y2){return this.DocumentRenderer.DrawEmptyTableLine(x1,y1,x2,y2)},DrawLockParagraph:function(lock_type,x,y1,y2){return this.DocumentRenderer.DrawLockParagraph(lock_type, x,y1,y2)},DrawLockObjectRect:function(lock_type,x,y,w,h){return this.DocumentRenderer.DrawLockObjectRect(lock_type,x,y,w,h)},drawHorLine:function(align,y,x,r,penW){return this.DocumentRenderer.drawHorLine(align,y,x,r,penW)},drawHorLine2:function(align,y,x,r,penW){return this.DocumentRenderer.drawHorLine(align,y,x,r,penW)},drawVerLine:function(align,x,y,b,penW){return this.DocumentRenderer.drawVerLine(align,x,y,b,penW)},drawHorLineExt:function(align,y,x,r,penW,leftMW,rightMW){return this.DocumentRenderer.drawHorLineExt(align, y,x,r,penW,leftMW,rightMW)},TableRect:function(x,y,w,h){return this.DocumentRenderer.TableRect(x,y,w,h)},put_PenLineJoin:function(_join){return this.DocumentRenderer.put_PenLineJoin(_join)},put_TextureBounds:function(x,y,w,h){return this.DocumentRenderer.put_TextureBounds(x,y,w,h)},put_TextureBoundsEnabled:function(val){return this.DocumentRenderer.put_TextureBoundsEnabled(val)},put_brushTexture:function(src,mode){return this.DocumentRenderer.put_brushTexture(src,mode)},put_BrushTextureAlpha:function(alpha){return this.DocumentRenderer.put_BrushTextureAlpha(alpha)}, put_BrushGradient:function(gradFill,points){return this.DocumentRenderer.put_BrushGradient(gradFill,points)},GetTransform:function(){return this.DocumentRenderer.GetTransform()},GetLineWidth:function(){return this.DocumentRenderer.GetLineWidth()},GetPen:function(){return this.DocumentRenderer.GetPen()},GetBrush:function(){return this.DocumentRenderer.GetBrush()},drawFlowAnchor:function(x,y){return this.DocumentRenderer.drawFlowAnchor(x,y)},SavePen:function(){return this.DocumentRenderer.SavePen()}, RestorePen:function(){return this.DocumentRenderer.RestorePen()},SaveBrush:function(){return this.DocumentRenderer.SaveBrush()},RestoreBrush:function(){return this.DocumentRenderer.RestoreBrush()},SavePenBrush:function(){return this.DocumentRenderer.SavePenBrush()},RestorePenBrush:function(){return this.DocumentRenderer.RestorePenBrush()},SaveGrState:function(){return this.DocumentRenderer.SaveGrState()},RestoreGrState:function(){return this.DocumentRenderer.RestoreGrState()},StartClipPath:function(){return this.DocumentRenderer.StartClipPath()}, EndClipPath:function(){return this.DocumentRenderer.EndClipPath()},SetTextPr:function(textPr){return this.DocumentRenderer.SetTextPr(textPr)},SetFontSlot:function(slot,fontSizeKoef){return this.DocumentRenderer.SetFontSlot(slot,fontSizeKoef)},GetTextPr:function(){return this.DocumentRenderer.GetTextPr()}};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].vector_koef=vector_koef;window["AscCommonExcel"].CPdfPrinter=CPdfPrinter})(window);"use strict";(function(window,undefined){var CellValueType= AscCommon.CellValueType;var cBoolLocal=AscCommon.cBoolLocal;var cErrorOrigin=AscCommon.cErrorOrigin;var cErrorLocal=AscCommon.cErrorLocal;var FormulaSeparators=AscCommon.FormulaSeparators;var parserHelp=AscCommon.parserHelp;var g_oFormatParser=AscCommon.g_oFormatParser;var CellAddress=AscCommon.CellAddress;var cDate=Asc.cDate;var bIsSupportArrayFormula=true;var c_oAscError=Asc.c_oAscError;var TOK_TYPE_OPERAND=1;var TOK_TYPE_FUNCTION=2;var TOK_TYPE_SUBEXPR=3;var TOK_TYPE_ARGUMENT=4;var TOK_TYPE_OP_IN= 5;var TOK_TYPE_OP_POST=6;var TOK_TYPE_WSPACE=7;var TOK_TYPE_UNKNOWN=8;var TOK_SUBTYPE_START=9;var TOK_SUBTYPE_STOP=10;var TOK_SUBTYPE_TEXT=11;var TOK_SUBTYPE_LOGICAL=12;var TOK_SUBTYPE_ERROR=14;var TOK_SUBTYPE_UNION=15;function ParsedThing(value,type,subtype,pos,length){this.value=value;this.type=type;this.subtype=subtype;this.pos=pos;this.length=length}ParsedThing.prototype.getStop=function(){return new ParsedThing(this.value,this.type,TOK_SUBTYPE_STOP,this.pos,this.length)};var g_oCodeSpace=32; var g_oCodeNumberSign=35;var g_oCodeDQuote=34;var g_oCodePercent=37;var g_oCodeAmpersand=38;var g_oCodeQuote=39;var g_oCodeLeftParenthesis=40;var g_oCodeRightParenthesis=41;var g_oCodeMultiply=42;var g_oCodePlus=43;var g_oCodeComma=44;var g_oCodeMinus=45;var g_oCodeDivision=47;var g_oCodeSemicolon=59;var g_oCodeLessSign=60;var g_oCodeEqualSign=61;var g_oCodeGreaterSign=62;var g_oCodeLeftSquareBracked=91;var g_oCodeRightSquareBracked=93;var g_oCodeAccent=94;var g_oCodeLeftCurlyBracked=123;var g_oCodeRightCurlyBracked= 125;function getTokens(formula){var tokens=[];var tokenStack=[];var offset=0;var length=formula.length;var currentChar,currentCharCode,nextCharCode,tmp;var token="";var inString=false;var inPath=false;var inRange=false;var inError=false;var regexSN=/^[1-9]{1}(\.[0-9]+)?E{1}$/;nextCharCode=formula.charCodeAt(offset);while(offset<length){currentChar=formula[offset];currentCharCode=nextCharCode;nextCharCode=formula.charCodeAt(offset+1);if(inString){if(currentCharCode===g_oCodeDQuote)if(nextCharCode=== g_oCodeDQuote){token+=currentChar;offset+=1}else{inString=false;tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,TOK_SUBTYPE_TEXT,offset,token.length));token=""}else token+=currentChar;offset+=1;continue}else if(inPath){if(currentCharCode===g_oCodeQuote)if(nextCharCode===g_oCodeQuote){token+=currentChar;offset+=1}else inPath=false;else token+=currentChar;offset+=1;continue}else if(inRange){if(currentCharCode===g_oCodeRightSquareBracked)inRange=false;token+=currentChar;offset+=1;continue}else if(inError){token+= currentChar;offset+=1;if(",#NULL!,#DIV/0!,#VALUE!,#REF!,#NAME?,#NUM!,#N/A,".indexOf(","+token+",")!=-1){inError=false;tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,TOK_SUBTYPE_ERROR,offset,token.length));token=""}continue}if(currentCharCode===g_oCodeSpace){if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,null,offset,token.length));token=""}tokens.push(new ParsedThing("",TOK_TYPE_WSPACE,null,offset,token.length));offset+=1;while((currentCharCode=formula.charCodeAt(offset))=== g_oCodeSpace)offset+=1;if(offset>=length)break;currentChar=formula[offset];nextCharCode=formula.charCodeAt(offset+1)}if(currentCharCode===g_oCodeLessSign&&(nextCharCode===g_oCodeEqualSign||nextCharCode===g_oCodeGreaterSign)||currentCharCode===g_oCodeGreaterSign&&nextCharCode===g_oCodeEqualSign){if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,null,offset,token.length));token=""}tokens.push(new ParsedThing(formula.substr(offset,2),TOK_TYPE_OP_IN,TOK_SUBTYPE_LOGICAL,offset,token.length)); offset+=2;nextCharCode=formula.charCodeAt(offset);continue}if(currentCharCode===g_oCodePlus||currentCharCode===g_oCodeMinus)if(token.length>1)if(token.match(regexSN)){token+=currentChar;offset+=1;continue}switch(currentCharCode){case g_oCodeDQuote:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_UNKNOWN,null,offset,token.length));token=""}inString=true;break}case g_oCodeQuote:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_UNKNOWN,null,offset,token.length));token=""}inPath= true;break}case g_oCodeLeftSquareBracked:{inRange=true;token+=currentChar;break}case g_oCodeNumberSign:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_UNKNOWN,null,offset,token.length));token=""}inError=true;token+=currentChar;break}case g_oCodeLeftCurlyBracked:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_UNKNOWN,null,offset,token.length));token=""}tmp=new ParsedThing("ARRAY",TOK_TYPE_FUNCTION,TOK_SUBTYPE_START,offset,token.length);tokens.push(tmp);tokenStack.push(tmp.getStop()); tmp=new ParsedThing("ARRAYROW",TOK_TYPE_FUNCTION,TOK_SUBTYPE_START,offset,token.length);tokens.push(tmp);tokenStack.push(tmp.getStop());break}case g_oCodeSemicolon:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,null,offset,token.length));token=""}tmp=tokenStack.pop();if(tmp&&"ARRAYROW"!==tmp.value)return null;tokens.push(tmp);tokens.push(new ParsedThing(";",TOK_TYPE_ARGUMENT,null,offset,token.length));tmp=new ParsedThing("ARRAYROW",TOK_TYPE_FUNCTION,TOK_SUBTYPE_START,offset, token.length);tokens.push(tmp);tokenStack.push(tmp.getStop());break}case g_oCodeRightCurlyBracked:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,null,offset,token.length));token=""}tokens.push(tokenStack.pop());tokens.push(tokenStack.pop());break}case g_oCodePlus:case g_oCodeMinus:case g_oCodeMultiply:case g_oCodeDivision:case g_oCodeAccent:case g_oCodeAmpersand:case g_oCodeEqualSign:case g_oCodeGreaterSign:case g_oCodeLessSign:{if(token.length>0){tokens.push(new ParsedThing(token, TOK_TYPE_OPERAND,null,offset,token.length));token=""}tokens.push(new ParsedThing(currentChar,TOK_TYPE_OP_IN,null,offset,token.length));break}case g_oCodePercent:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,null,offset,token.length));token=""}tokens.push(new ParsedThing(currentChar,TOK_TYPE_OP_POST,null,offset,token.length));break}case g_oCodeLeftParenthesis:{if(token.length>0){tmp=new ParsedThing(token,TOK_TYPE_FUNCTION,TOK_SUBTYPE_START,offset,token.length);tokens.push(tmp); tokenStack.push(tmp.getStop());token=""}else{tmp=new ParsedThing("",TOK_TYPE_SUBEXPR,TOK_SUBTYPE_START,offset,token.length);tokens.push(tmp);tokenStack.push(tmp.getStop())}break}case g_oCodeComma:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,null,offset,token.length));token=""}tmp=0!==tokenStack.length?TOK_TYPE_FUNCTION===tokenStack[tokenStack.length-1].type:false;tokens.push(tmp?new ParsedThing(currentChar,TOK_TYPE_ARGUMENT,null,offset,token.length):new ParsedThing(currentChar, TOK_TYPE_OP_IN,TOK_SUBTYPE_UNION,offset,token.length));break}case g_oCodeRightParenthesis:{if(token.length>0){tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,null,offset,token.length));token=""}if(tokenStack.length)tokens.push(tokenStack.pop());break}default:{token+=currentChar;break}}++offset}if(token.length>0)tokens.push(new ParsedThing(token,TOK_TYPE_OPERAND,null,offset,token.length));return tokens}var cElementType={number:0,string:1,bool:2,error:3,empty:4,cellsRange:5,cell:6,date:7,func:8, operator:9,name:10,array:11,cell3D:12,cellsRange3D:13,table:14,name3D:15,specialFunctionStart:16,specialFunctionEnd:17};var cErrorType={unsupported_function:0,null_value:1,division_by_zero:2,wrong_value_type:3,bad_reference:4,wrong_name:5,not_numeric:6,not_available:7,getting_data:8};var cReturnFormulaType={value:0,value_replace_area:1,array:2,area_to_ref:3,replace_only_array:4,setArrayRefAsArg:5};var cExcelSignificantDigits=15;var cExcelMaxExponent=308;var cExcelMinExponent=-308;var c_Date1904Const= 24107;var c_Date1900Const=25568;var rx_sFuncPref=/_xlfn\./i;var rx_sDefNamePref=/_xlnm\./i;var cNumFormatFirstCell=-1;var cNumFormatNone=-2;var cNumFormatNull=-3;var g_nFormulaStringMaxLength=255;Math.sinh=function(arg){return(this.pow(this.E,arg)-this.pow(this.E,-arg))/2};Math.cosh=function(arg){return(this.pow(this.E,arg)+this.pow(this.E,-arg))/2};Math.tanh=Math.tanh||function(x){if(x===Infinity)return 1;else if(x===-Infinity)return-1;else{var y=Math.exp(2*x);if(y===Infinity)return 1;else if(y=== -Infinity)return-1;return(y-1)/(y+1)}};Math.asinh=function(arg){return this.log(arg+this.sqrt(arg*arg+1))};Math.acosh=function(arg){return this.log(arg+this.sqrt(arg+1)*this.sqrt(arg-1))};Math.atanh=function(arg){return.5*this.log((1+arg)/(1-arg))};Math.fact=function(n){var res=1;n=this.floor(n);if(n<0)return NaN;else if(n>170)return Infinity;while(n!==0)res*=n--;return res};Math.doubleFact=function(n){var res=1;n=this.floor(n);if(n<0)return NaN;else if(n>170)return Infinity;while(n>0){res*=n;n-= 2}return res};Math.factor=function(n){var res=1;n=this.floor(n);while(n!==0)res=res*n--;return res};Math.ln=Math.log;Math.log10=function(x){return this.log(x)/this.log(10)};Math.log1p=Math.log1p||function(x){return Math.log(1+x)};Math.expm1=Math.expm1||function(x){return Math.exp(x)-1};Math.fmod=function(a,b){return Number((a-this.floor(a/b)*b).toPrecision(cExcelSignificantDigits))};Math.binomCoeff=function(n,k){return this.fact(n)/(this.fact(k)*this.fact(n-k))};Math.permut=function(n,k){return this.floor(this.fact(n)/ this.fact(n-k)+.5)};Math.approxEqual=function(a,b){if(a===b)return true;return this.abs(a-b)<1E-15};if(typeof Math.sign!="function")Math["sign"]=Math.sign=function(n){return n==0?0:n<0?-1:1};Math.trunc=Math.trunc||function(v){v=+v;return v-v%1||(!isFinite(v)||v===0?v:v<0?-0:0)};RegExp.escape=function(text){return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSeparator);function cBaseType(val){this.numFormat=cNumFormatNull; this.value=val;this.hyperlink=null}cBaseType.prototype.cloneTo=function(oRes){oRes.numFormat=this.numFormat;oRes.value=this.value;oRes.hyperlink=this.hyperlink};cBaseType.prototype.getValue=function(){return this.value};cBaseType.prototype.getHyperlink=function(){return this.hyperlink};cBaseType.prototype.toString=function(){return this.value.toString()};cBaseType.prototype.toLocaleString=function(){return this.toString()};cBaseType.prototype.toLocaleStringObj=function(){var localStr=this.toLocaleString(); var localStrWithoutSheet;if(localStr){var result=parserHelp.parse3DRef(localStr);if(result)localStrWithoutSheet=result.range;else localStrWithoutSheet=localStr}else{localStr=this.value;localStrWithoutSheet=this.value}return[localStr,localStrWithoutSheet]};function cNumber(val){cBaseType.call(this,parseFloat(val));var res;if(!isNaN(this.value)&&Math.abs(this.value)!==Infinity)res=this;else if(val instanceof cError)res=val;else res=new cError(cErrorType.not_numeric);return res}cNumber.prototype=Object.create(cBaseType.prototype); cNumber.prototype.constructor=cNumber;cNumber.prototype.type=cElementType.number;cNumber.prototype.tocString=function(){return new cString((""+this.value).replace(FormulaSeparators.digitSeparatorDef,FormulaSeparators.digitSeparator))};cNumber.prototype.tocNumber=function(){return this};cNumber.prototype.toNumber=function(){return this.value};cNumber.prototype.tocBool=function(){return new cBool(this.value!==0)};cNumber.prototype.toLocaleString=function(digitDelim){var res=this.value.toString();if(digitDelim)return res.replace(FormulaSeparators.digitSeparatorDef, FormulaSeparators.digitSeparator);else return res};function cString(val){cBaseType.call(this,val)}cString.prototype=Object.create(cBaseType.prototype);cString.prototype.constructor=cString;cString.prototype.type=cElementType.string;cString.prototype.tocNumber=function(doNotParseNum){var res,m=this.value;if(this.value==="")res=new cNumber(0);if(g_oFormatParser.isLocaleNumber(this.value)){var numberValue=g_oFormatParser.parseLocaleNumber(this.value);if(!isNaN(numberValue))res=new cNumber(numberValue)}else{var parseRes= !doNotParseNum?AscCommon.g_oFormatParser.parse(this.value):null;if(null!=parseRes)res=new cNumber(parseRes.value);else res=new cError(cErrorType.wrong_value_type)}return res};cString.prototype.tocBool=function(){var res;if(parserHelp.isBoolean(this.value,0))res=new cBool(parserHelp.operand_str.toUpperCase()===cBoolLocal.t);else res=this;return res};cString.prototype.tocString=function(){return this};cString.prototype.getValue=function(){return this.value.replace(/""/g,'"')};function cBool(val){var v= false;switch(val.toString().toUpperCase()){case "TRUE":case cBoolLocal.t:v=true}cBaseType.call(this,v)}cBool.prototype=Object.create(cBaseType.prototype);cBool.prototype.constructor=cBool;cBool.prototype.type=cElementType.bool;cBool.prototype.toString=function(){return this.value.toString().toUpperCase()};cBool.prototype.getValue=function(){return this.toString()};cBool.prototype.tocNumber=function(){return new cNumber(this.value?1:0)};cBool.prototype.tocString=function(){return new cString(this.value? "TRUE":"FALSE")};cBool.prototype.toLocaleString=function(){return this.value?cBoolLocal.t:cBoolLocal.f};cBool.prototype.tocBool=function(){return this};cBool.prototype.toBool=function(){return this.value};function cError(val){cBaseType.call(this,val);this.errorType=-1;switch(val){case cErrorLocal["value"]:case cErrorOrigin["value"]:case cErrorType.wrong_value_type:{this.value="#VALUE!";this.errorType=cErrorType.wrong_value_type;break}case cErrorLocal["nil"]:case cErrorOrigin["nil"]:case cErrorType.null_value:{this.value= "#NULL!";this.errorType=cErrorType.null_value;break}case cErrorLocal["div"]:case cErrorOrigin["div"]:case cErrorType.division_by_zero:{this.value="#DIV/0!";this.errorType=cErrorType.division_by_zero;break}case cErrorLocal["ref"]:case cErrorOrigin["ref"]:case cErrorType.bad_reference:{this.value="#REF!";this.errorType=cErrorType.bad_reference;break}case cErrorLocal["name"]:case cErrorOrigin["name"]:case cErrorType.wrong_name:{this.value="#NAME?";this.errorType=cErrorType.wrong_name;break}case cErrorLocal["num"]:case cErrorOrigin["num"]:case cErrorType.not_numeric:{this.value= "#NUM!";this.errorType=cErrorType.not_numeric;break}case cErrorLocal["na"]:case cErrorOrigin["na"]:case cErrorType.not_available:{this.value="#N/A";this.errorType=cErrorType.not_available;break}case cErrorLocal["getdata"]:case cErrorOrigin["getdata"]:case cErrorType.getting_data:{this.value="#GETTING_DATA";this.errorType=cErrorType.getting_data;break}case cErrorLocal["uf"]:case cErrorOrigin["uf"]:case cErrorType.unsupported_function:{this.value="#UNSUPPORTED_FUNCTION!";this.errorType=cErrorType.unsupported_function; break}}return this}cError.prototype=Object.create(cBaseType.prototype);cError.prototype.constructor=cError;cError.prototype.type=cElementType.error;cError.prototype.tocNumber=cError.prototype.tocString=cError.prototype.tocBool=function(){return this};cError.prototype.toLocaleString=function(){var val=this.value?this.value.toUpperCase():this.value;switch(val){case cErrorOrigin["value"]:case cErrorType.wrong_value_type:{return cErrorLocal["value"]}case cErrorOrigin["nil"]:case cErrorType.null_value:{return cErrorLocal["nil"]}case cErrorOrigin["div"]:case cErrorType.division_by_zero:{return cErrorLocal["div"]}case cErrorOrigin["ref"]:case cErrorType.bad_reference:{return cErrorLocal["ref"]}case cErrorOrigin["name"]:case cErrorType.wrong_name:{return cErrorLocal["name"]}case cErrorOrigin["num"]:case cErrorType.not_numeric:{return cErrorLocal["num"]}case cErrorOrigin["na"]:case cErrorType.not_available:{return cErrorLocal["na"]}case cErrorOrigin["getdata"]:case cErrorType.getting_data:{return cErrorLocal["getdata"]}case cErrorOrigin["uf"]:case cErrorType.unsupported_function:{return cErrorLocal["uf"]}}return cErrorLocal["na"]}; cError.prototype.getErrorTypeFromString=function(val){var res;switch(val){case cErrorOrigin["value"]:{res=cErrorType.wrong_value_type;break}case cErrorOrigin["nil"]:{res=cErrorType.null_value;break}case cErrorOrigin["div"]:{res=cErrorType.division_by_zero;break}case cErrorOrigin["ref"]:{res=cErrorType.bad_reference;break}case cErrorOrigin["name"]:{res=cErrorType.wrong_name;break}case cErrorOrigin["num"]:{res=cErrorType.not_numeric;break}case cErrorOrigin["na"]:{res=cErrorType.not_available;break}case cErrorOrigin["getdata"]:{res= cErrorType.getting_data;break}case cErrorOrigin["uf"]:{res=cErrorType.unsupported_function;break}default:{res=cErrorType.not_available;break}}return res};cError.prototype.getStringFromErrorType=function(type){var res;switch(type){case cErrorType.wrong_value_type:{res=cErrorOrigin["value"];break}case cErrorType.null_value:{res=cErrorOrigin["nil"];break}case cErrorType.division_by_zero:{res=cErrorOrigin["div"];break}case cErrorType.bad_reference:{res=cErrorOrigin["ref"];break}case cErrorType.wrong_name:{res= cErrorOrigin["name"];break}case cErrorType.not_numeric:{res=cErrorOrigin["num"];break}case cErrorType.not_available:{res=cErrorOrigin["na"];break}case cErrorType.getting_data:{res=cErrorOrigin["getdata"];break}case cErrorType.unsupported_function:{res=cErrorOrigin["uf"];break}default:res=cErrorType.not_available;break}return res};function cArea(val,ws){cBaseType.call(this,val);this.ws=ws;this.range=null;if(val){AscCommonExcel.executeInR1C1Mode(false,function(){val=ws.getRange2(val)});this.range=val}} cArea.prototype=Object.create(cBaseType.prototype);cArea.prototype.constructor=cArea;cArea.prototype.type=cElementType.cellsRange;cArea.prototype.clone=function(opt_ws){var ws=opt_ws?opt_ws:this.ws;var oRes=new cArea(null,ws);this.cloneTo(oRes);if(this.range)oRes.range=this.range.clone(ws);return oRes};cArea.prototype.getWsId=function(){return this.ws.Id};cArea.prototype.getValue=function(checkExclude,excludeHiddenRows,excludeErrorsVal,excludeNestedStAg){var val=[],r=this.getRange();if(!r)val.push(new cError(cErrorType.bad_reference)); else{if(checkExclude&&!excludeHiddenRows)excludeHiddenRows=this.ws.isApplyFilterBySheet();r._foreachNoEmpty(function(cell){if(!(excludeNestedStAg&&cell.formulaParsed&&cell.formulaParsed.isFoundNestedStAg())){var checkTypeVal=checkTypeCell(cell);if(!(excludeErrorsVal&&CellValueType.Error===checkTypeVal.type))val.push(checkTypeVal)}},undefined,excludeHiddenRows)}return val};cArea.prototype.getValue2=function(i,j){var res=this.index(i+1,j+1),r;if(!res){r=this.getRange();r.worksheet._getCellNoEmpty(r.bbox.r1+ i,r.bbox.c1+j,function(cell){res=checkTypeCell(cell)})}return res};cArea.prototype.getValueByRowCol=function(i,j){var res,r;r=this.getRange();r.worksheet._getCellNoEmpty(r.bbox.r1+i,r.bbox.c1+j,function(cell){if(cell)res=checkTypeCell(cell)});return res};cArea.prototype.getRange=function(){if(!this.range)this.range=this.ws.getRange2(this.value);return this.range};cArea.prototype.tocNumber=function(){var v=this.getValue()[0];if(!v)v=new cNumber(0);else v=v.tocNumber();return v};cArea.prototype.tocString= function(){return this.getValue()[0].tocString()};cArea.prototype.tocBool=function(){return new cError(cErrorType.wrong_value_type)};cArea.prototype.to3D=function(opt_ws){opt_ws=opt_ws||this.ws;var res=new cArea3D(null,opt_ws,opt_ws);this.cloneTo(res);if(this.range)res.bbox=this.range.getBBox0().clone();return res};cArea.prototype.toString=function(){var _c;if(AscCommonExcel.g_ProcessShared&&this.range)_c=this.range.getName();else _c=this.value;if(_c.indexOf(":")<0)_c=_c+":"+_c;return _c};cArea.prototype.toLocaleString= function(){var _c;if(this.range)_c=this.range.getName();else _c=this.value;if(_c.indexOf(":")<0)_c=_c+":"+_c;return _c};cArea.prototype.getWS=function(){return this.ws};cArea.prototype.getBBox0=function(){return this.getRange().getBBox0()};cArea.prototype.cross=function(arg){var r=this.getRange(),cross;if(!r)return new cError(cErrorType.wrong_name);cross=r.cross(arg);if(cross)if(undefined!==cross.r)return this.getValue2(cross.r-this.getBBox0().r1,0);else if(undefined!==cross.c)return this.getValue2(0, cross.c-this.getBBox0().c1);return new cError(cErrorType.wrong_value_type)};cArea.prototype.isValid=function(){return!!this.getRange()};cArea.prototype.countCells=function(){var r=this.getRange(),bbox=r.bbox,count=(Math.abs(bbox.c1-bbox.c2)+1)*(Math.abs(bbox.r1-bbox.r2)+1);r._foreachNoEmpty(function(cell){if(!cell||!cell.isEmptyTextString())count--});return new cNumber(count)};cArea.prototype.foreach=function(action){var r=this.getRange();if(r)r._foreach2(action)};cArea.prototype.foreach2=function(action){var r= this.getRange();if(r)r._foreach2(function(cell){action(checkTypeCell(cell),cell)})};cArea.prototype.getMatrix=function(excludeHiddenRows,excludeErrorsVal,excludeNestedStAg){var arr=[],r=this.getRange();var ws=r.worksheet;var oldExcludeHiddenRows=ws.bExcludeHiddenRows;ws.bExcludeHiddenRows=false;r._foreach2(function(cell,i,j,r1,c1){if(!arr[i-r1])arr[i-r1]=[];var resValue=new cEmpty;if(!(excludeNestedStAg&&cell.formulaParsed&&cell.formulaParsed.isFoundNestedStAg())){var checkTypeVal=checkTypeCell(cell); if(!(excludeErrorsVal&&CellValueType.Error===checkTypeVal.type))resValue=checkTypeVal}arr[i-r1][j-c1]=resValue});ws.bExcludeHiddenRows=oldExcludeHiddenRows;return arr};cArea.prototype.getFullArray=function(emptyReplaceOn){var arr=new cArray;var elemsNoEmpty=this.getMatrixNoEmpty();var bbox=this.getBBox0();if(!emptyReplaceOn)emptyReplaceOn=new cEmpty;var elem;for(var i=bbox.r1;i<=bbox.r2;i++){if(!arr.array[i-bbox.r1])arr.addRow();for(var j=bbox.c1;j<=bbox.c2;j++){if(elemsNoEmpty&&elemsNoEmpty[i-bbox.r1]&& elemsNoEmpty[i-bbox.r1][j-bbox.c1])elem=elemsNoEmpty[i-bbox.r1][j-bbox.c1];if(!elem||elem.type===cElementType.empty)elem=emptyReplaceOn;arr.addElement(elem)}}return arr};cArea.prototype.getMatrixNoEmpty=function(){var arr=[],r=this.getRange(),res;r._foreachNoEmpty(function(cell,i,j,r1,c1){if(!arr[i-r1])arr[i-r1]=[];arr[i-r1][j-c1]=checkTypeCell(cell)});return arr};cArea.prototype.getValuesNoEmpty=function(checkExclude,excludeHiddenRows,excludeErrorsVal,excludeNestedStAg){var arr=[],r=this.getRange(); r._foreachNoEmpty(function(cell){if(!(excludeNestedStAg&&cell.formulaParsed&&cell.formulaParsed.isFoundNestedStAg())){var checkTypeVal=checkTypeCell(cell);if(!(excludeErrorsVal&&CellValueType.Error===checkTypeVal.type))arr.push(checkTypeVal)}},undefined,excludeHiddenRows);return[arr]};cArea.prototype.index=function(r,c){var bbox=this.getBBox0();bbox.normalize();var box={c1:1,c2:bbox.c2-bbox.c1+1,r1:1,r2:bbox.r2-bbox.r1+1};if(r<box.r1||r>box.r2||c<box.c1||c>box.c2)return new cError(cErrorType.bad_reference)}; cArea.prototype.changeSheet=function(wsLast,wsNew){if(this.ws===wsLast){this.ws=wsNew;if(this.range)this.range.worksheet=wsNew}};function cArea3D(val,wsFrom,wsTo){cBaseType.call(this,val);this.bbox=null;if(val){AscCommonExcel.executeInR1C1Mode(false,function(){val=AscCommonExcel.g_oRangeCache.getAscRange(val)});if(val)this.bbox=val.clone()}this.wsFrom=wsFrom;this.wsTo=wsTo||this.wsFrom}cArea3D.prototype=Object.create(cBaseType.prototype);cArea3D.prototype.constructor=cArea3D;cArea3D.prototype.type= cElementType.cellsRange3D;cArea3D.prototype.clone=function(opt_ws){var oRes=new cArea3D(null,opt_ws?opt_ws:this.wsFrom,opt_ws?opt_ws:this.wsTo);this.cloneTo(oRes);if(this.bbox)oRes.bbox=this.bbox.clone();return oRes};cArea3D.prototype.wsRange=function(){var wb=this.wsFrom.workbook;var wsF=this.wsFrom.getIndex(),wsL=this.wsTo.getIndex(),r=[];for(var i=wsF;i<=wsL;i++)r.push(wb.getWorksheet(i));return r};cArea3D.prototype.range=function(wsRange){if(!wsRange)return[null];var r=[];for(var i=0;i<wsRange.length;i++)if(!wsRange[i])r.push(null); else r.push(AscCommonExcel.Range.prototype.createFromBBox(wsRange[i],this.bbox));return r};cArea3D.prototype.getRange=function(){if(!this.isSingleSheet())return null;return this.range(this.wsRange())[0]};cArea3D.prototype.getRanges=function(){return this.range(this.wsRange())};cArea3D.prototype.getValue=function(checkExclude,excludeHiddenRows,excludeErrorsVal,excludeNestedStAg){var i,_wsA=this.wsRange();var _val=[];if(_wsA.length<1){_val.push(new cError(cErrorType.bad_reference));return _val}for(i= 0;i<_wsA.length;i++)if(!_wsA[i]){_val.push(new cError(cErrorType.bad_reference));return _val}var _exclude;var _r=this.range(_wsA);for(i=0;i<_r.length;i++){if(!_r[i]){_val.push(new cError(cErrorType.bad_reference));return _val}if(checkExclude&&!(_exclude=excludeHiddenRows))_exclude=_wsA[i].isApplyFilterBySheet();_r[i]._foreachNoEmpty(function(cell){if(!(excludeNestedStAg&&cell.formulaParsed&&cell.formulaParsed.isFoundNestedStAg())){var checkTypeVal=checkTypeCell(cell);if(!(excludeErrorsVal&&CellValueType.Error=== checkTypeVal.type))_val.push(checkTypeVal)}},undefined,_exclude)}return _val};cArea3D.prototype.getValue2=function(cell){var _wsA=this.wsRange(),_val=[],_r;if(_wsA.length<1){_val.push(new cError(cErrorType.bad_reference));return _val}for(var i=0;i<_wsA.length;i++)if(!_wsA[i]){_val.push(new cError(cErrorType.bad_reference));return _val}_r=this.range(_wsA);if(!_r[0]){_val.push(new cError(cErrorType.bad_reference));return _val}if(_r[0].worksheet)_r[0].worksheet._getCellNoEmpty(cell.row-1,cell.col-1, function(_cell){_val.push(checkTypeCell(_cell))});return null==_val[0]?new cEmpty:_val[0]};cArea3D.prototype.getValueByRowCol=function(i,j){var r=this.getRanges(),res;if(r[0])r[0].worksheet._getCellNoEmpty(r[0].bbox.r1+i,r[0].bbox.c1+j,function(cell){if(cell)res=checkTypeCell(cell)});return res};cArea3D.prototype.changeSheet=function(wsLast,wsNew){if(this.wsFrom===wsLast)this.wsFrom=wsNew;if(this.wsTo===wsLast)this.wsTo=wsNew};cArea3D.prototype.toString=function(){var wsFrom=this.wsFrom.getName(); var wsTo=this.wsTo.getName();var name=AscCommonExcel.g_ProcessShared&&this.bbox?this.bbox.getName():this.value;return parserHelp.get3DRef(wsFrom!==wsTo?wsFrom+":"+wsTo:wsFrom,name)};cArea3D.prototype.toLocaleString=function(){var wsFrom=this.wsFrom.getName();var wsTo=this.wsTo.getName();var name=this.bbox?this.bbox.getName():this.value;return parserHelp.get3DRef(wsFrom!==wsTo?wsFrom+":"+wsTo:wsFrom,name)};cArea3D.prototype.tocNumber=function(){return this.getValue()[0].tocNumber()};cArea3D.prototype.tocString= function(){return this.getValue()[0].tocString()};cArea3D.prototype.tocBool=function(){return new cError(cErrorType.wrong_value_type)};cArea3D.prototype.tocArea=function(){var wsR=this.wsRange();if(wsR.length==1)return new cArea(this.value,wsR[0]);return false};cArea3D.prototype.getWS=function(){return this.wsFrom};cArea3D.prototype.cross=function(arg,ws){if(!this.isSingleSheet())return new cError(cErrorType.wrong_value_type);var r=this.getRange();if(!r)return new cError(cErrorType.wrong_name);var cross= r.cross(arg);if(cross)if(undefined!==cross.r)return this.getValue2(new CellAddress(cross.r,this.getBBox0().c1,0));else if(undefined!==cross.c)return this.getValue2(new CellAddress(this.getBBox0().r1,cross.c,0));return new cError(cErrorType.wrong_value_type)};cArea3D.prototype.getBBox0=function(){var range=this.getRange();return range?range.getBBox0():range};cArea3D.prototype.getBBox0NoCheck=function(){return this.bbox};cArea3D.prototype.isValid=function(){var r=this.getRanges();for(var i=0;i<r.length;++i)if(!r)return false; return true};cArea3D.prototype.countCells=function(){var _wsA=this.wsRange();var _val=[];if(_wsA.length<1){_val.push(new cError(cErrorType.bad_reference));return _val}var i;for(i=0;i<_wsA.length;i++)if(!_wsA[i]){_val.push(new cError(cErrorType.bad_reference));return _val}var _r=this.range(_wsA),bbox=_r[0].bbox,count=(Math.abs(bbox.c1-bbox.c2)+1)*(Math.abs(bbox.r1-bbox.r2)+1);count=_r.length*count;for(i=0;i<_r.length;i++)_r[i]._foreachNoEmpty(function(cell){if(!cell||!cell.isEmptyTextString())count--}); return new cNumber(count)};cArea3D.prototype.getMatrix=function(excludeHiddenRows,excludeErrorsVal,excludeNestedStAg){var arr=[],r=this.getRanges(),res;var ws=r[0]?r[0].worksheet:null;if(ws){var oldExcludeHiddenRows=ws.bExcludeHiddenRows;ws.bExcludeHiddenRows=false}for(var k=0;k<r.length;k++){arr[k]=[];r[k]._foreach2(function(cell,i,j,r1,c1){if(!arr[k][i-r1])arr[k][i-r1]=[];var resValue=new cEmpty;if(!(excludeNestedStAg&&cell.formulaParsed&&cell.formulaParsed.isFoundNestedStAg())){var checkTypeVal= checkTypeCell(cell);if(!(excludeErrorsVal&&CellValueType.Error===checkTypeVal.type))resValue=checkTypeVal}arr[k][i-r1][j-c1]=resValue})}return arr};cArea3D.prototype.getMatrixAllRange=function(){var arr=[],r=this.getRanges(),res;for(var k=0;k<r.length;k++){arr[k]=[];r[k]._foreach(function(cell,i,j,r1,c1){if(!arr[k][i-r1])arr[k][i-r1]=[];res=checkTypeCell(cell);arr[k][i-r1][j-c1]=res})}return arr};cArea3D.prototype.getFullArray=function(emptyReplaceOn){var arr=new cArray;var elemsNoEmpty=this.getMatrixNoEmpty(); var bbox=this.getBBox0();if(!emptyReplaceOn)emptyReplaceOn=new cEmpty;var elem;for(var i=bbox.r1;i<=bbox.r2;i++){if(!arr.array[i-bbox.r1])arr.addRow();for(var j=bbox.c1;j<=bbox.c2;j++){if(elemsNoEmpty&&elemsNoEmpty[0]&&elemsNoEmpty[0][i-bbox.r1]&&elemsNoEmpty[0][i-bbox.r1][j-bbox.c1])elem=elemsNoEmpty[0][i-bbox.r1][j-bbox.c1];if(!elem||elem.type===cElementType.empty)elem=emptyReplaceOn;arr.addElement(elem)}}return arr};cArea3D.prototype.getMatrixNoEmpty=function(){var arr=[],r=this.getRanges(),res; var ws=r[0]?r[0].worksheet:null;var oldExcludeHiddenRows=ws?ws.bExcludeHiddenRows:null;for(var k=0;k<r.length;k++){arr[k]=[];r[k]._foreachNoEmpty(function(cell,i,j,r1,c1){if(!arr[k][i-r1])arr[k][i-r1]=[];res=checkTypeCell(cell);arr[k][i-r1][j-c1]=res})}if(ws)ws.bExcludeHiddenRows=oldExcludeHiddenRows;return arr};cArea3D.prototype.foreach2=function(action){var _wsA=this.wsRange();if(_wsA.length>=1){var _r=this.range(_wsA);for(var i=0;i<_r.length;i++)if(_r[i])_r[i]._foreach2(function(cell){action(checkTypeCell(cell))})}}; cArea3D.prototype.isSingleSheet=function(){return this.wsFrom===this.wsTo};cArea3D.prototype.isBetweenSheet=function(ws){return ws&&this.wsFrom.getIndex()<=ws.getIndex()&&ws.getIndex()<=this.wsTo.getIndex()};function cRef(val,ws){cBaseType.call(this,val);this.ws=ws;this.range=null;if(val){AscCommonExcel.executeInR1C1Mode(false,function(){val=ws.getRange2(val.replace(AscCommon.rx_space_g,""))});this.range=val}}cRef.prototype=Object.create(cBaseType.prototype);cRef.prototype.constructor=cRef;cRef.prototype.type= cElementType.cell;cRef.prototype.clone=function(opt_ws){var ws=opt_ws?opt_ws:this.ws;var oRes=new cRef(null,ws);this.cloneTo(oRes);if(this.range)oRes.range=this.range.clone(ws);return oRes};cRef.prototype.getWsId=function(){return this.ws.Id};cRef.prototype.getValue=function(){if(!this.isValid())return new cError(cErrorType.bad_reference);var res;this.range.getLeftTopCellNoEmpty(function(cell){res=checkTypeCell(cell)});return res};cRef.prototype.tocNumber=function(){return this.getValue().tocNumber()}; cRef.prototype.tocString=function(){return this.getValue().tocString()};cRef.prototype.tocBool=function(){return this.getValue().tocBool()};cRef.prototype.to3D=function(opt_ws){var ws=opt_ws?opt_ws:this.ws;var oRes=new cRef3D(null,null);this.cloneTo(oRes);oRes.ws=ws;if(this.range)oRes.range=this.range.clone(ws);return oRes};cRef.prototype.toString=function(){if(AscCommonExcel.g_ProcessShared)return this.range.getName();else return this.value};cRef.prototype.toLocaleString=function(){if(this.range)return this.range.getName(); else return this.value};cRef.prototype.getRange=function(){return this.range};cRef.prototype.getWS=function(){return this.ws};cRef.prototype.isValid=function(){return!!this.getRange()};cRef.prototype.getMatrix=function(){return[[this.getValue()]]};cRef.prototype.getBBox0=function(){return this.getRange().getBBox0()};cRef.prototype.isHidden=function(excludeHiddenRows){if(!excludeHiddenRows)excludeHiddenRows=this.ws.isApplyFilterBySheet();return excludeHiddenRows&&this.isValid()&&this.ws.getRowHidden(this.getRange().r1)}; cRef.prototype.changeSheet=function(wsLast,wsNew){if(this.ws===wsLast){this.ws=wsNew;if(this.range)this.range.worksheet=wsNew}};function cRef3D(val,ws){cBaseType.call(this,val);this.ws=ws;this.range=null;if(val&&this.ws){AscCommonExcel.executeInR1C1Mode(false,function(){val=ws.getRange2(val)});this.range=val}}cRef3D.prototype=Object.create(cBaseType.prototype);cRef3D.prototype.constructor=cRef3D;cRef3D.prototype.type=cElementType.cell3D;cRef3D.prototype.clone=function(opt_ws){var isAddingSheet=Asc["editor"]&& Asc["editor"].wb&&Asc["editor"].wb.model&&Asc["editor"].wb.model.addingWorksheet;var ws=opt_ws?opt_ws:this.ws;var oRes=new cRef3D(null,null);this.cloneTo(oRes);if(opt_ws&&(this.ws.getName()==opt_ws.getName()||isAddingSheet))oRes.ws=opt_ws;else oRes.ws=this.ws;if(this.range)oRes.range=this.range.clone(ws);return oRes};cRef3D.prototype.getWsId=function(){return this.ws.Id};cRef3D.prototype.getRange=function(){if(this.ws){if(this.range)return this.range;return this.range=this.ws.getRange2(this.value)}else return this.range= null};cRef3D.prototype.isValid=function(){return!!this.getRange()};cRef3D.prototype.getValue=function(){var _r=this.getRange();if(!_r)return new cError(cErrorType.bad_reference);var res;_r.getLeftTopCellNoEmpty(function(cell){res=checkTypeCell(cell)});return res};cRef3D.prototype.tocBool=function(){return this.getValue().tocBool()};cRef3D.prototype.tocNumber=function(){return this.getValue().tocNumber()};cRef3D.prototype.tocString=function(){return this.getValue().tocString()};cRef3D.prototype.changeSheet= function(wsLast,wsNew){if(this.ws===wsLast){this.ws=wsNew;if(this.range)this.range.worksheet=wsNew}};cRef3D.prototype.toString=function(){if(AscCommonExcel.g_ProcessShared)return parserHelp.get3DRef(this.ws.getName(),this.range.getName());else return parserHelp.get3DRef(this.ws.getName(),this.value)};cRef3D.prototype.toLocaleString=function(){return parserHelp.get3DRef(this.ws.getName(),this.range.getName())};cRef3D.prototype.getWS=function(){return this.ws};cRef3D.prototype.getMatrix=function(){return[[this.getValue()]]}; cRef3D.prototype.getBBox0=function(){var range=this.getRange();if(range)return range.getBBox0();return null};cRef3D.prototype.isHidden=function(excludeHiddenRows){if(!excludeHiddenRows)excludeHiddenRows=this.ws.isApplyFilterBySheet();var _r=this.getRange();return excludeHiddenRows&&_r&&this.ws.getRowHidden(_r.r1)};function cEmpty(){cBaseType.call(this,"")}cEmpty.prototype=Object.create(cBaseType.prototype);cEmpty.prototype.constructor=cEmpty;cEmpty.prototype.type=cElementType.empty;cEmpty.prototype.tocNumber= function(){return new cNumber(0)};cEmpty.prototype.tocBool=function(){return new cBool(false)};cEmpty.prototype.tocString=function(){return new cString("")};cEmpty.prototype.toString=function(){return""};function cName(val,ws){cBaseType.call(this,val);this.ws=ws}cName.prototype=Object.create(cBaseType.prototype);cName.prototype.constructor=cName;cName.prototype.type=cElementType.name;cName.prototype.clone=function(opt_ws){var ws=opt_ws?opt_ws:this.ws;var oRes=new cName(this.value,ws);this.cloneTo(oRes); return oRes};cName.prototype.toRef=function(opt_bbox,checkMultiSelect){var defName=this.getDefName();if(!defName||!defName.ref)return new cError(cErrorType.wrong_name);return this.Calculate(undefined,opt_bbox,checkMultiSelect)};cName.prototype.toString=function(){var defName=this.getDefName();if(defName){if(defName.isXLNM)return new cString("_xlnm."+defName.name);return defName.name}else return this.value};cName.prototype.toLocaleString=function(){var defName=this.getDefName();if(defName)return defName.sheetId? AscCommon.translateManager.getValue(defName.name):defName.name;else return AscCommon.translateManager.getValue(this.value)};cName.prototype.getValue=function(){return this.Calculate()};cName.prototype.getFormula=function(){var defName=this.getDefName();if(!defName||!defName.ref)return new cError(cErrorType.wrong_name);if(!defName.parsedRef)return new cError(cErrorType.wrong_name);return defName.parsedRef};cName.prototype.Calculate=function(){var defName=this.getDefName();if(!defName||!defName.ref)return new cError(cErrorType.wrong_name); if(!defName.parsedRef)return new cError(cErrorType.wrong_name);if(defName.type===Asc.c_oAscDefNameType.slicer)return new cString("");var offset;var bbox=arguments[1];if(bbox)offset=new AscCommon.CellBase(bbox.r1,bbox.c1);return defName.parsedRef.calculate(this,bbox,offset,arguments[2])};cName.prototype.getDefName=function(){return this.ws?this.ws.workbook.getDefinesNames(this.value,this.ws.getId()):null};cName.prototype.changeDefName=function(from,to){var sheetId=this.ws?this.ws.getId():null;if(AscCommonExcel.getDefNameIndex(this.value)== AscCommonExcel.getDefNameIndex(from.name))if(null==from.sheetId){var defName=this.getDefName();if(!(defName&&null!=defName.sheetId))this.value=to.name}else if(sheetId==from.sheetId)this.value=to.name};cName.prototype.getWS=function(){return this.ws};cName.prototype.changeSheet=function(wsLast,wsNew){if(this.ws===wsLast)this.ws=wsNew};function cStrucTable(val,wb,ws){cBaseType.call(this,val);this.wb=wb;this.ws=ws;this.tableName=null;this.oneColumnIndex=null;this.colStartIndex=null;this.colEndIndex= null;this.reservedColumnIndex=null;this.hdtIndexes=null;this.hdtcstartIndex=null;this.hdtcendIndex=null;this.isDynamic=false;this.area=null}cStrucTable.prototype=Object.create(cBaseType.prototype);cStrucTable.prototype.constructor=cStrucTable;cStrucTable.prototype.type=cElementType.table;cStrucTable.prototype.createFromVal=function(val,wb,ws,tablesMap){var res=new cStrucTable(val[0],wb,ws);if(tablesMap&&tablesMap[val["tableName"]])val["tableName"]=tablesMap[val["tableName"]];if(res._parseVal(val))res._updateArea(null, false);return res.area&&res.area.type!=cElementType.error?res:new cError(cErrorType.bad_reference)};cStrucTable.prototype.clone=function(opt_ws){var ws=opt_ws?opt_ws:this.ws;var wb=ws.workbook;var oRes=new cStrucTable(this.value,wb,ws);oRes.tableName=this.tableName;oRes.oneColumnIndex=this._cloneIndex(this.oneColumnIndex);oRes.colStartIndex=this._cloneIndex(this.colStartIndex);oRes.colEndIndex=this._cloneIndex(this.colEndIndex);oRes.reservedColumnIndex=this.reservedColumnIndex;if(this.hdtIndexes)oRes.hdtIndexes= this.hdtIndexes.slice(0);oRes.hdtcstartIndex=this._cloneIndex(this.hdtcstartIndex);oRes.hdtcendIndex=this._cloneIndex(this.hdtcendIndex);oRes.isDynamic=this.isDynamic;if(this.area)if(this.area.clone)oRes.area=this.area.clone(opt_ws);else oRes.area=this.area;this.cloneTo(oRes);return oRes};cStrucTable.prototype._cloneIndex=function(val){if(val)return{wsID:val.wsID,index:val.index,name:val.name};else return val};cStrucTable.prototype.toRef=function(opt_bbox,opt_bConvertTableFormulaToRef){var table= this.wb.getDefinesNames(this.tableName,this.ws?this.ws.getId():null);if(!table||!table.ref)return new cError(cErrorType.wrong_name);if(!this.area||this.isDynamic)this._updateArea(opt_bbox,true,opt_bConvertTableFormulaToRef);return this.area};cStrucTable.prototype.toString=function(){return this._toString(false)};cStrucTable.prototype.toLocaleString=function(){return this._toString(true)};cStrucTable.prototype._toString=function(isLocal){var tblStr,columns_1,columns_2;var table=this.wb.getDefinesNames(this.tableName, null);if(!table)tblStr=this.tableName;else tblStr=table.name;if(this.oneColumnIndex){columns_1=this.oneColumnIndex.name.replace(/([#[\]])/g,"'$1");tblStr+="["+columns_1+"]"}else if(this.colStartIndex&&this.colEndIndex){columns_1=this.colStartIndex.name.replace(/([#[\]])/g,"'$1");columns_2=this.colEndIndex.name.replace(/([#[\]])/g,"'$1");tblStr+="[["+columns_1+"]:["+columns_2+"]]"}else if(null!=this.reservedColumnIndex)tblStr+="["+this._buildLocalTableString(this.reservedColumnIndex,isLocal)+"]";else if(this.hdtIndexes|| this.hdtcstartIndex||this.hdtcendIndex){tblStr+="[";var i;for(i=0;i<this.hdtIndexes.length;++i){if(0!=i)if(isLocal)tblStr+=FormulaSeparators.functionArgumentSeparator;else tblStr+=FormulaSeparators.functionArgumentSeparatorDef;tblStr+="["+this._buildLocalTableString(this.hdtIndexes[i],isLocal)+"]"}if(this.hdtcstartIndex){if(this.hdtIndexes.length>0)if(isLocal)tblStr+=FormulaSeparators.functionArgumentSeparator;else tblStr+=FormulaSeparators.functionArgumentSeparatorDef;var hdtcstart=this.hdtcstartIndex.name.replace(/([#[\]])/g, "'$1");tblStr+="["+hdtcstart+"]";if(this.hdtcendIndex){var hdtcend=this.hdtcendIndex.name.replace(/([#[\]])/g,"'$1");tblStr+=":["+hdtcend+"]"}}tblStr+="]"}else if(!isLocal)tblStr+="[]";return tblStr};cStrucTable.prototype._parseVal=function(val){var bRes=true,startCol,endCol;this.tableName=val["tableName"];if(val["oneColumn"]){startCol=val["oneColumn"].replace(/'([#[\]])/g,"$1");this.oneColumnIndex=this.wb.getTableIndexColumnByName(this.tableName,startCol);bRes=!!this.oneColumnIndex}else if(val["columnRange"]){startCol= val["colStart"].replace(/'([#[\]])/g,"$1");endCol=val["colEnd"].replace(/'([#[\]])/g,"$1");if(!endCol)endCol=startCol;this.colStartIndex=this.wb.getTableIndexColumnByName(this.tableName,startCol);this.colEndIndex=this.wb.getTableIndexColumnByName(this.tableName,endCol);bRes=!!this.colStartIndex&&!!this.colEndIndex}else if(val["reservedColumn"]){this.reservedColumnIndex=parserHelp.getColumnTypeByName(val["reservedColumn"]);if(AscCommon.FormulaTablePartInfo.thisRow==this.reservedColumnIndex||AscCommon.FormulaTablePartInfo.headers== this.reservedColumnIndex||AscCommon.FormulaTablePartInfo.totals==this.reservedColumnIndex)this.isDynamic=true}else if(val["hdtcc"]){this.hdtIndexes=[];var hdtcstart=val["hdtcstart"];var hdtcend=val["hdtcend"];var re=/\[(.*?)\]/ig,m;while(null!==(m=re.exec(val["hdt"]))){var param=parserHelp.getColumnTypeByName(m[1]);if(AscCommon.FormulaTablePartInfo.thisRow==param||AscCommon.FormulaTablePartInfo.headers==param||AscCommon.FormulaTablePartInfo.totals==param)this.isDynamic=true;this.hdtIndexes.push(param)}if(hdtcstart){startCol= hdtcstart.replace(/'([#[\]])/g,"$1");this.hdtcstartIndex=this.wb.getTableIndexColumnByName(this.tableName,startCol);bRes=!!this.hdtcstartIndex;if(bRes&&hdtcend){endCol=hdtcend.replace(/'([#[\]])/g,"$1");this.hdtcendIndex=this.wb.getTableIndexColumnByName(this.tableName,endCol);bRes=!!this.hdtcendIndex}}}return bRes};cStrucTable.prototype._updateArea=function(bbox,toRef,bConvertTableFormulaToRef){var paramObj={param:null,startCol:null,endCol:null,cell:bbox,toRef:toRef,bConvertTableFormulaToRef:bConvertTableFormulaToRef}; var isThisRow=false;var tableData,refName;if(this.oneColumnIndex){paramObj.param=AscCommon.FormulaTablePartInfo.columns;paramObj.startCol=this.oneColumnIndex.name}else if(this.colStartIndex&&this.colEndIndex){paramObj.param=AscCommon.FormulaTablePartInfo.columns;paramObj.startCol=this.colStartIndex.name;paramObj.endCol=this.colEndIndex.name}else if(null!=this.reservedColumnIndex){paramObj.param=this.reservedColumnIndex;isThisRow=AscCommon.FormulaTablePartInfo.thisRow==paramObj.param}else if(this.hdtIndexes|| this.hdtcstartIndex){var data,range;if(this.hdtIndexes)for(var i=0;i<this.hdtIndexes.length;++i){paramObj.param=this.hdtIndexes[i];isThisRow=AscCommon.FormulaTablePartInfo.thisRow==paramObj.param;data=this.wb.getTableRangeForFormula(this.tableName,paramObj);if(!data)return this._createAreaError(isThisRow);if(range)range.union2(data.range);else range=data.range}if(this.hdtcstartIndex){paramObj.param=AscCommon.FormulaTablePartInfo.columns;paramObj.startCol=this.hdtcstartIndex.name;paramObj.endCol=null; if(this.hdtcendIndex)paramObj.endCol=this.hdtcendIndex.name;data=this.wb.getTableRangeForFormula(this.tableName,paramObj);if(!data)return this._createAreaError(isThisRow);if(range){var r1Abs=range.isAbsR1();var c1Abs=data.range.isAbsC1();var r2Abs=range.isAbsR2();var c2Abs=data.range.isAbsC2();range=new Asc.Range(data.range.c1,range.r1,data.range.c2,range.r2);range.setAbs(r1Abs,c1Abs,r2Abs,c2Abs)}else range=data.range}tableData=data;tableData.range=range}else paramObj.param=AscCommon.FormulaTablePartInfo.data; if(!tableData){tableData=this.wb.getTableRangeForFormula(this.tableName,paramObj);if(!tableData)return this._createAreaError(isThisRow)}if(tableData.range){AscCommonExcel.executeInR1C1Mode(false,function(){refName=tableData.range.getName()});var wsFrom=this.wb.getWorksheetById(tableData.wsID);if(tableData.range.isOneCell())this.area=new cRef3D(refName,wsFrom);else this.area=new cArea3D(refName,wsFrom,wsFrom)}else this.area=new cError(cErrorType.bad_reference);return this.area};cStrucTable.prototype._createAreaError= function(isThisRow){if(isThisRow)return this.area=new cError(cErrorType.wrong_value_type);else return this.area=new cError(cErrorType.bad_reference)};cStrucTable.prototype._buildLocalTableString=function(reservedColumn,local){return parserHelp.getColumnNameByType(reservedColumn,local)};cStrucTable.prototype.changeDefName=function(from,to){if(this.tableName==from.name)this.tableName=to.name};cStrucTable.prototype.removeTableColumn=function(deleted){if(this.oneColumnIndex)if(deleted[this.oneColumnIndex.name])return true; else{this.oneColumnIndex=this.wb.getTableIndexColumnByName(this.tableName,this.oneColumnIndex.name);if(!this.oneColumnIndex)return true}if(this.colStartIndex&&this.colEndIndex){if(deleted[this.colStartIndex.name])return true;else{this.colStartIndex=this.wb.getTableIndexColumnByName(this.tableName,this.colStartIndex.name);if(!this.colStartIndex)return true}if(deleted[this.colEndIndex.name])return true;else{this.colEndIndex=this.wb.getTableIndexColumnByName(this.tableName,this.colEndIndex.name);if(!this.colEndIndex)return true}}if(this.hdtcstartIndex)if(deleted[this.hdtcstartIndex.name])return true; else{this.hdtcstartIndex=this.wb.getTableIndexColumnByName(this.tableName,this.hdtcstartIndex.name);if(!this.hdtcstartIndex)return true}if(this.hdtcendIndex)if(deleted[this.hdtcendIndex.name])return true;else{this.hdtcendIndex=this.wb.getTableIndexColumnByName(this.tableName,this.hdtcendIndex.name);if(!this.hdtcendIndex)return true}return false};cStrucTable.prototype.changeTableRef=function(){if(!this.isDynamic)this._updateArea(null,false)};cStrucTable.prototype.renameTableColumn=function(){var bRes= true;var columns1,columns2;if(this.oneColumnIndex){columns1=this.wb.getTableNameColumnByIndex(this.tableName,this.oneColumnIndex.index);if(columns1)this.oneColumnIndex.name=columns1.columnName;else bRes=false}else if(this.colStartIndex&&this.colEndIndex){columns1=this.wb.getTableNameColumnByIndex(this.tableName,this.colStartIndex.index);columns2=this.wb.getTableNameColumnByIndex(this.tableName,this.colEndIndex.index);if(columns1&&columns2){this.colStartIndex.name=columns1.columnName;this.colEndIndex.name= columns2.columnName}else bRes=false}if(this.hdtcstartIndex){columns1=this.wb.getTableNameColumnByIndex(this.tableName,this.hdtcstartIndex.index);if(columns1)this.hdtcstartIndex.name=columns1.columnName;else bRes=false}if(this.hdtcendIndex){columns1=this.wb.getTableNameColumnByIndex(this.tableName,this.hdtcendIndex.index);if(columns1)this.hdtcendIndex.name=columns1.columnName;else bRes=false}return bRes};cStrucTable.prototype.geColumnHeadings=function(){var res=[];var table=this.wb.getTableByName(this.tableName); if(!table)return res;var from=0;var to=table.TableColumns.length-1;if(this.oneColumnIndex)from=to=this.oneColumnIndex.index;else if(this.colStartIndex&&this.colEndIndex){from=this.colStartIndex.index;to=this.colEndIndex.index}if(this.hdtcstartIndex&&this.hdtcendIndex){from=this.hdtcstartIndex.index;to=this.hdtcendIndex.index}for(var i=from;i<=to;++i)res.push(table.TableColumns[i].Name);return res};cStrucTable.prototype.getTable=function(){return this.wb.getTableByName(this.tableName)};cStrucTable.prototype.getWS= function(){return this.ws};cStrucTable.prototype.changeSheet=function(wsLast,wsNew){if(this.ws===wsLast){this.ws=wsNew;if(this.area&&this.area.changeSheet)this.area.changeSheet(wsLast,wsNew)}};cStrucTable.prototype.setOffset=function(offset){var t=this;var tryDiffHdtcIndex=function(oIndex){var table=t.wb.getTableByNameAndSheet(t.tableName,oIndex.wsID);if(table){var tableColumnsCount=table.TableColumns.length;var index=oIndex.index+offset.col;index=index-Math.floor(index/tableColumnsCount)*tableColumnsCount; var columnName=t.wb.getTableNameColumnByIndex(t.tableName,index);if(columnName){oIndex.index=index;oIndex.name=columnName.columnName}}};if(this.oneColumnIndex){if(offset&&offset.col)tryDiffHdtcIndex(this.oneColumnIndex)}else if(this.colStartIndex&&this.colEndIndex);else if(this.hdtIndexes||this.hdtcstartIndex||this.hdtcendIndex)if(offset&&offset.col){if(this.hdtcstartIndex)tryDiffHdtcIndex(this.hdtcstartIndex);if(this.hdtcendIndex)tryDiffHdtcIndex(this.hdtcendIndex)}};function cName3D(val,ws){cName.call(this, val,ws)}cName3D.prototype=Object.create(cName.prototype);cName3D.prototype.constructor=cName3D;cName3D.prototype.type=cElementType.name3D;cName3D.prototype.clone=function(opt_ws){var ws;if(opt_ws&&opt_ws.getName()===this.ws.getName())ws=opt_ws;else ws=this.ws;var oRes=new cName3D(this.value,ws);this.cloneTo(oRes);return oRes};cName3D.prototype.toString=function(){return parserHelp.getEscapeSheetName(this.ws.getName())+"!"+cName.prototype.toString.call(this)};cName3D.prototype.toLocaleString=function(){return parserHelp.getEscapeSheetName(this.ws.getName())+ "!"+cName.prototype.toLocaleString.call(this)};function cArray(){cBaseType.call(this,undefined);this.array=[];this.rowCount=0;this.countElementInRow=[];this.countElement=0}cArray.prototype=Object.create(cBaseType.prototype);cArray.prototype.constructor=cArray;cArray.prototype.type=cElementType.array;cArray.prototype.addRow=function(){this.array[this.array.length]=[];this.countElementInRow[this.rowCount++]=0};cArray.prototype.addElement=function(element){if(this.array.length===0)this.addRow();var arr= this.array,subArr=arr[this.rowCount-1];subArr[subArr.length]=element;this.countElementInRow[this.rowCount-1]++;this.countElement++};cArray.prototype.getRow=function(rowIndex){if(rowIndex<0||rowIndex>this.array.length-1)return null;return this.array[rowIndex]};cArray.prototype.getCol=function(colIndex){var col=[];for(var i=0;i<this.rowCount;i++)col.push(this.array[i][colIndex]);return col};cArray.prototype.getElementRowCol=function(row,col){if(row>this.rowCount||col>this.getCountElementInRow())return new cError(cErrorType.not_available); return this.array[row][col]};cArray.prototype.getElement=function(index){for(var i=0;i<this.rowCount;i++)if(index>this.countElementInRow[i].length)index-=this.countElementInRow[i].length;else return this.array[i][index];return null};cArray.prototype.foreach=function(action){if(typeof action!=="function")return true;for(var ir=0;ir<this.rowCount;ir++)for(var ic=0;ic<this.countElementInRow[ir];ic++)if(action.call(this,this.array[ir][ic],ir,ic))return true;return undefined};cArray.prototype.getCountElement= function(){return this.countElement};cArray.prototype.getCountElementInRow=function(){return this.countElementInRow[0]};cArray.prototype.getRowCount=function(){return this.rowCount};cArray.prototype.tocNumber=function(){var retArr=new cArray;for(var ir=0;ir<this.rowCount;ir++,retArr.addRow()){for(var ic=0;ic<this.countElementInRow[ir];ic++)retArr.addElement(this.array[ir][ic].tocNumber());if(ir===this.rowCount-1)break}return retArr};cArray.prototype.tocString=function(){var retArr=new cArray;for(var ir= 0;ir<this.rowCount;ir++,retArr.addRow()){for(var ic=0;ic<this.countElementInRow[ir];ic++)retArr.addElement(this.array[ir][ic].tocString());if(ir===this.rowCount-1)break}return retArr};cArray.prototype.tocBool=function(){var retArr=new cArray;for(var ir=0;ir<this.rowCount;ir++,retArr.addRow()){for(var ic=0;ic<this.countElementInRow[ir];ic++)retArr.addElement(this.array[ir][ic].tocBool());if(ir===this.rowCount-1)break}return retArr};cArray.prototype.toString=function(){var ret="";for(var ir=0;ir<this.rowCount;ir++, ret+=FormulaSeparators.arrayRowSeparatorDef){for(var ic=0;ic<this.countElementInRow[ir];ic++,ret+=FormulaSeparators.arrayColSeparatorDef)if(this.array[ir][ic]instanceof cString)ret+='"'+this.array[ir][ic].toString()+'"';else ret+=this.array[ir][ic].toString()+"";if(ret[ret.length-1]===FormulaSeparators.arrayColSeparatorDef)ret=ret.substring(0,ret.length-1)}if(ret[ret.length-1]===FormulaSeparators.arrayRowSeparatorDef)ret=ret.substring(0,ret.length-1);return"{"+ret+"}"};cArray.prototype.toLocaleString= function(digitDelim){var ret="";for(var ir=0;ir<this.rowCount;ir++,ret+=digitDelim?FormulaSeparators.arrayRowSeparator:FormulaSeparators.arrayRowSeparatorDef){for(var ic=0;ic<this.countElementInRow[ir];ic++,ret+=digitDelim?FormulaSeparators.arrayColSeparator:FormulaSeparators.arrayColSeparatorDef)if(this.array[ir][ic]instanceof cString)ret+='"'+this.array[ir][ic].toLocaleString(digitDelim)+'"';else ret+=this.array[ir][ic].toLocaleString(digitDelim)+"";if(ret[ret.length-1]===digitDelim?FormulaSeparators.arrayColSeparator: FormulaSeparators.arrayColSeparatorDef)ret=ret.substring(0,ret.length-1)}if(ret[ret.length-1]===digitDelim?FormulaSeparators.arrayRowSeparator:FormulaSeparators.arrayRowSeparatorDef)ret=ret.substring(0,ret.length-1);return"{"+ret+"}"};cArray.prototype.isValidArray=function(){if(this.countElement<1)return false;for(var i=0;i<this.rowCount-1;i++)if(this.countElementInRow[i]-this.countElementInRow[i+1]!==0)return false;return true};cArray.prototype.getValue2=function(i,j){var result=this.array[i];return result? result[j]:result};cArray.prototype.getMatrix=function(){if(arguments[1]){var retArr=new cArray;for(var ir=0;ir<this.rowCount;ir++,retArr.addRow()){for(var ic=0;ic<this.countElementInRow[ir];ic++){var elem=this.array[ir][ic];if(AscCommonExcel.cElementType.error===elem.type)elem=new cEmpty;retArr.addElement(elem)}if(ir===this.rowCount-1)break}return retArr.array}return this.array};cArray.prototype.fillFromArray=function(arr){this.array=arr;this.rowCount=arr.length;for(var i=0;i<arr.length;i++){this.countElementInRow[i]= arr[i].length;this.countElement+=arr[i].length}};cArray.prototype.fillEmptyFromRange=function(range){if(!range)return;for(var i=range.r1;i<=range.r2;i++){this.addRow();for(var j=range.c1;j<=range.c2;j++)this.addElement(null)}};function cUndefined(){this.value=undefined}cUndefined.prototype=Object.create(cBaseType.prototype);cUndefined.prototype.constructor=cUndefined;function checkTypeCell(cell){if(cell&&!cell.isNullText()){var type=cell.getType();if(CellValueType.Number===type)return new cNumber(cell.getNumberValue()); else{var val=cell.getValueWithoutFormat();if(CellValueType.Bool===type)return new cBool(val);else if(CellValueType.Error===type)return new cError(val);else return new cString(val)}}else return new cEmpty}function cBaseOperator(name,priority,argumentCount){this.name=name?name:"";this.priority=priority!==undefined?priority:10;this.argumentsCurrent=argumentCount!==undefined?argumentCount:2;this.value=null}cBaseOperator.prototype.type=cElementType.operator;cBaseOperator.prototype.numFormat=cNumFormatFirstCell; cBaseOperator.prototype.rightAssociative=false;cBaseOperator.prototype.toString=function(){return this.name};cBaseOperator.prototype.Calculate=function(){return null};cBaseOperator.prototype.Assemble2=function(arg,start,count){var str="";if(this.argumentsCurrent===2)str+=arg[start+count-2]+this.name+arg[start+count-1];else str+=this.name+arg[start];return new cString(str)};cBaseOperator.prototype.Assemble2Locale=function(arg,start,count,locale,digitDelim){var str="";if(this.argumentsCurrent===2&& arg[start+count-2]&&arg[start+count-1])str+=arg[start+count-2].toLocaleString(digitDelim)+this.name+arg[start+count-1].toLocaleString(digitDelim);else str+=this.name+arg[start];return new cString(str)};cBaseOperator.prototype._convertAreaToArray=function(areaArr){var res=[];for(var i=0;i<areaArr.length;i++){var elem=areaArr[i];if(elem instanceof cArea||elem instanceof cArea3D)elem=convertAreaToArray(elem);res.push(elem)}if(!res.length)res=areaArr;return res};function cBaseFunction(){}cBaseFunction.prototype.type= cElementType.func;cBaseFunction.prototype.argumentsMin=0;cBaseFunction.prototype.argumentsMax=255;cBaseFunction.prototype.numFormat=cNumFormatFirstCell;cBaseFunction.prototype.ca=false;cBaseFunction.prototype.excludeHiddenRows=false;cBaseFunction.prototype.excludeErrorsVal=false;cBaseFunction.prototype.excludeNestedStAg=false;cBaseFunction.prototype.bArrayFormula=null;cBaseFunction.prototype.arrayIndexes=null;cBaseFunction.prototype.returnValueType=null;cBaseFunction.prototype.inheritFormat=null; cBaseFunction.prototype.name=null;cBaseFunction.prototype.argumentsType=null;cBaseFunction.prototype.Calculate=function(){return new cError(cErrorType.wrong_name)};cBaseFunction.prototype.Assemble2=function(arg,start,count){var str="",c=start+count-1;for(var i=start;i<=c;i++){if(!arg[i])continue;str+=arg[i].toString();if(i!==c)str+=","}if(this.isXLFN)return new cString("_xlfn."+this.name+"("+str+")");return new cString(this.toString()+"("+str+")")};cBaseFunction.prototype.Assemble2Locale=function(arg, start,count,locale,digitDelim){var name=this.toString(),str="",c=start+count-1,localeName=locale?locale[name]:name;localeName=localeName||this.toString();for(var i=start;i<=c;i++){if(!arg[i])continue;str+=arg[i].toLocaleString(digitDelim);if(i!==c)str+=FormulaSeparators.functionArgumentSeparator}return new cString(localeName+"("+str+")")};cBaseFunction.prototype.toString=function(){return this.name.replace(rx_sFuncPref,"_xlfn.")};cBaseFunction.prototype.toLocaleString=function(){var name=this.toString(); if(AscCommonExcel.cFormulaFunctionToLocale&&undefined!==AscCommonExcel.cFormulaFunctionToLocale[name])return AscCommonExcel.cFormulaFunctionToLocale[name];else return name};cBaseFunction.prototype.setCalcValue=function(arg,numFormat){if(numFormat!==null&&numFormat!==undefined)arg.numFormat=numFormat;return arg};cBaseFunction.prototype.checkArguments=function(countArguments){return this.argumentsMin<=countArguments&&countArguments<=this.argumentsMax};cBaseFunction.prototype._findArrayInNumberArguments= function(oArguments,calculateFunc,dNotCheckNumberType){var argsArray=[];var inputArguments=oArguments.args;var findArgArrayIndex=oArguments.indexArr;var parseArray=function(array){array.foreach(function(elem,r,c){var arg;argsArray=[];for(var j=0;j<inputArguments.length;j++){if(i===j)arg=elem;else if(cElementType.array===inputArguments[j].type)arg=inputArguments[j].getElementRowCol(r,c);else arg=inputArguments[j];if(arg&&(dNotCheckNumberType||cElementType.number===arg.type&&!dNotCheckNumberType))argsArray[j]= arg.getValue();else{argsArray=null;break}}this.array[r][c]=null===argsArray?new cError(cErrorType.wrong_value_type):calculateFunc(argsArray)});return array};if(null!==findArgArrayIndex)return parseArray(inputArguments[findArgArrayIndex]);else for(var i=0;i<inputArguments.length;i++)if(cElementType.string===inputArguments[i].type&&!dNotCheckNumberType)return new cError(cErrorType.wrong_value_type);else if(inputArguments[i].getValue)argsArray[i]=inputArguments[i].getValue();else argsArray[i]=inputArguments[i]; return calculateFunc(argsArray)};cBaseFunction.prototype._prepareArguments=function(args,arg1,bAddFirstArrElem,typeArray){var newArgs=[];var indexArr=null;for(var i=0;i<args.length;i++){var arg=args[i];if(typeArray&&cElementType.array===typeArray[i])if(cElementType.cellsRange===arg.type||cElementType.array===arg.type)newArgs[i]=arg.getMatrix(this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);else if(cElementType.cellsRange3D===arg.type)newArgs[i]=arg.getMatrix(this.excludeHiddenRows, this.excludeErrorsVal,this.excludeNestedStAg)[0];else if(cElementType.error===arg.type)newArgs[i]=arg;else newArgs[i]=new cError(cErrorType.division_by_zero);else if(cElementType.cellsRange===arg.type||cElementType.cellsRange3D===arg.type)newArgs[i]=arg.cross(arg1);else if(cElementType.array===arg.type)if(bAddFirstArrElem)newArgs[i]=arg.getElementRowCol(0,0);else{indexArr=i;newArgs[i]=arg}else newArgs[i]=arg}return{args:newArgs,indexArr:indexArr}};cBaseFunction.prototype._checkErrorArg=function(argArray){for(var i= 0;i<argArray.length;i++)if(argArray[i]&&cElementType.error===argArray[i].type)return argArray[i];return null};cBaseFunction.prototype._checkArrayArguments=function(arg0,func){var matrix,res;if(arg0 instanceof cArea||arg0 instanceof cArray)matrix=arg0.getMatrix();else if(arg0 instanceof cArea3D)matrix=arg0.getMatrix()[0];if(matrix){res=new cArray;for(var i=0;i<matrix.length;++i)for(var j=0;j<matrix[i].length;++j)matrix[i][j]=func(matrix[i][j]);res.fillFromArray(matrix)}else res=func(arg0);return res}; cBaseFunction.prototype._getOneDimensionalArray=function(arg,type){var res=[];var getValue=function(curArg){if(undefined===type||cElementType.string===type)return curArg.tocString().getValue();else if(cElementType.number===type)return curArg.tocNumber().getValue();else if(cElementType.bool===type)return curArg.toLocaleString()};if(cElementType.cellsRange===arg.type||cElementType.cellsRange3D===arg.type||cElementType.array===arg.type){if(cElementType.cellsRange===arg.type||cElementType.array===arg.type)arg= arg.getMatrix();else if(cElementType.cellsRange3D===arg.type)arg=arg.getMatrix()[0];for(var i=0;i<arg.length;i++)for(var j=0;j<arg[i].length;j++)if(cElementType.error===arg[i][j].type)return arg[i][j];else res.push(getValue(arg[i][j]))}else if(cElementType.error===arg.type)return arg;else res.push(getValue(arg));return res};cBaseFunction.prototype.checkRef=function(arg){var res=false;if(cElementType.cell3D===arg.type||cElementType.cell===arg.type||cElementType.cellsRange===arg.type||cElementType.cellsRange3D=== arg.type)res=true;return res};cBaseFunction.prototype.prepareAreaArg=function(arg,arguments1){var res;if(this.bArrayFormula)res=window["AscCommonExcel"].convertAreaToArray(arg);else res=arg.cross(arguments1);return res};cBaseFunction.prototype.calculateOneArgument=function(arg0,arguments1,func,convertAreaToArray){if(arg0 instanceof cArea||arg0 instanceof cArea3D)if(convertAreaToArray)arg0=this.prepareAreaArg(arg0,arguments1);else arg0=arg0.cross(arguments1);if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray){var array=new cArray;arg0.foreach(function(elem,r,c){if(!array.array[r])array.addRow();array.addElement(func(elem))});return array}else return func(arg0)};cBaseFunction.prototype.calculateTwoArguments=function(arg0,arg1,arguments1,func,convertAreaToArray){if(arg0 instanceof cArea||arg0 instanceof cArea3D)if(convertAreaToArray)arg0=this.prepareAreaArg(arg0,arguments1);else arg0=arg0.cross(arguments1);if(arg1 instanceof cArea||arg1 instanceof cArea3D)if(convertAreaToArray)arg1=this.prepareAreaArg(arg1, arguments1);else arg1=arg1.cross(arguments1);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg0=arg0.tocNumber()}else arg0=arg0.tocNumber();if(arg1 instanceof cRef||arg1 instanceof cRef3D){arg1=arg1.getValue();if(arg1 instanceof cError)return arg1;else if(arg1 instanceof cString)return new cError(cErrorType.wrong_value_type); else arg1=arg1.tocNumber()}else arg1=arg1.tocNumber();var array;if(arg0 instanceof cArray&&arg1 instanceof cArray){array=new cArray;if(1===arg0.getRowCount()||1===arg0.getCountElementInRow()){arg1.foreach(function(elem,r,c){var b=elem,res;var rowArg1=r,colArg1=c;if(1===arg0.getRowCount())rowArg1=0;if(1===arg0.getCountElementInRow())colArg1=0;if(!array.array[r])array.addRow();var a=arg0.array[rowArg1]?arg0.getElementRowCol(rowArg1,colArg1):null;if(!a)res=new cError(cErrorType.not_available);else if(a instanceof cNumber&&b instanceof cNumber)res=func(a.getValue(),b.getValue());else res=new cError(cErrorType.wrong_value_type);array.addElement(res)});return array}else{arg0.foreach(function(elem,r,c){var a=elem,res;var rowArg1=r,colArg1=c;if(1===arg1.getRowCount())rowArg1=0;if(1===arg1.getCountElementInRow())colArg1=0;if(!array.array[r])array.addRow();var b=arg1.array[rowArg1]?arg1.getElementRowCol(rowArg1,colArg1):null;if(!b)res=new cError(cErrorType.not_available);else if(a instanceof cNumber&&b instanceof cNumber)res=func(a.getValue(),b.getValue());else res=new cError(cErrorType.wrong_value_type);array.addElement(res)});return array}}else if(arg0 instanceof cArray){array=new cArray;arg0.foreach(function(elem,r,c){var a=elem,res;var b=arg1;if(!array.array[r])array.addRow();if(a instanceof cNumber&&b instanceof cNumber)res=func(a.getValue(),b.getValue());else res=new cError(cErrorType.wrong_value_type);array.addElement(res)});return array}else if(arg1 instanceof cArray){array=new cArray;arg1.foreach(function(elem, r,c){var a=arg0,res;var b=elem;if(!array.array[r])array.addRow();if(a instanceof cNumber&&b instanceof cNumber)res=func(a.getValue(),b.getValue());else res=new cError(cErrorType.wrong_value_type);array.addElement(res)});return array}else return func(arg0.getValue(),arg1.getValue())};cBaseFunction.prototype.checkFormulaArray=function(arg,opt_bbox,opt_defName,parserFormula,bIsSpecialFunction,argumentsCount){var res=null;var t=this;var functionsCanReturnArray=["index"];var returnFormulaType=this.returnValueType; if(cReturnFormulaType.setArrayRefAsArg===returnFormulaType)if(arg.length===0&&parserFormula.ref)res=this.Calculate([new cArea(parserFormula.ref.getName(),parserFormula.ws)],opt_bbox,opt_defName,parserFormula.ws);else return null;var arrayIndexes=this.arrayIndexes;var replaceAreaByValue=cReturnFormulaType.value_replace_area===returnFormulaType;var replaceAreaByRefs=cReturnFormulaType.area_to_ref===returnFormulaType;var replaceOnlyArray=cReturnFormulaType.replace_only_array===returnFormulaType;var checkArrayIndex= function(index){var res=false;if(arrayIndexes)if(1===arrayIndexes[index])res=true;else if(typeof arrayIndexes[index]==="object"){var tempsArgIndex=arrayIndexes[index][0];if(undefined!==tempsArgIndex&&arg[tempsArgIndex])if(cElementType.cellsRange===arg[tempsArgIndex].type||cElementType.cellsRange3D===arg[tempsArgIndex].type||cElementType.array===arg[tempsArgIndex].type)res=true}return res};var checkOneRowCol=function(){var res=false;for(var j=0;j<argumentsCount;j++)if(cElementType.array===arg[j].type){if(1=== arg[j].getRowCount()||1===arg[j].getCountElementInRow())res=true}else{res=false;break}return res};if((true===this.bArrayFormula||bIsSpecialFunction)&&(!returnFormulaType||replaceAreaByValue||replaceAreaByRefs||arrayIndexes||replaceOnlyArray)){if(functionsCanReturnArray.indexOf(this.name.toLowerCase())!==-1){var _tmp=this.Calculate(arg,opt_bbox,opt_defName,this.ws,bIsSpecialFunction);if(_tmp&&_tmp.type===cElementType.array)return _tmp}var tempArgs=[],tempArg,firstArray,_checkArrayIndex;for(var j=0;j< argumentsCount;j++){tempArg=arg[j];_checkArrayIndex=checkArrayIndex(j);if(!_checkArrayIndex)if(cElementType.cellsRange===tempArg.type||cElementType.cellsRange3D===tempArg.type)if(replaceAreaByValue)tempArg=tempArg.cross(opt_bbox);else if(replaceAreaByRefs){var useOnlyFirstRow="column"===this.name.toLowerCase()?parserFormula.ref:null;var useOnlyFirstColumn="row"===this.name.toLowerCase()?parserFormula.ref:null;var _bbox=tempArg.getBBox0();if(useOnlyFirstRow)firstArray=new Asc.Range(_bbox.c1,_bbox.r1, _bbox.c2,_bbox.r1);else if(useOnlyFirstColumn)firstArray=new Asc.Range(_bbox.c1,_bbox.r1,_bbox.c1,_bbox.r2);else tempArg=window["AscCommonExcel"].convertAreaToArrayRefs(tempArg,useOnlyFirstRow,useOnlyFirstColumn)}else if(!replaceOnlyArray)tempArg=window["AscCommonExcel"].convertAreaToArray(tempArg);if(cElementType.array===tempArg.type&&!_checkArrayIndex)if(!firstArray)firstArray=tempArg;else if((1===firstArray.getRowCount()||1===firstArray.getCountElementInRow())&&1!==tempArg.getRowCount()&&1!==tempArg.getCountElementInRow())firstArray= tempArg;else if(1===firstArray.getRowCount()&&1===firstArray.getCountElementInRow()&&(1!==tempArg.getRowCount()||1!==tempArg.getCountElementInRow()))firstArray=tempArg;tempArgs.push(tempArg)}if(replaceAreaByRefs&&0===argumentsCount||!bIsSpecialFunction&&firstArray&&parserFormula.ref&&!parserFormula.ref.isOneCell()&&checkOneRowCol()){firstArray=new cArray;firstArray.fillEmptyFromRange(parserFormula.ref)}if(firstArray){var array=new cArray;var doCalc=function(elem,r,c,_row,_col){if(!array.array[r])array.addRow(); var newArgs=[],newArg;for(var j=0;j<argumentsCount;j++){newArg=tempArgs[j];if(cElementType.array===newArg.type&&!checkArrayIndex(j)){if(1===newArg.getRowCount()&&1===newArg.getCountElementInRow())newArg=newArg.array[0]?newArg.array[0][0]:null;else if(1===newArg.getRowCount())newArg=newArg.array[0]?newArg.array[0][c]:null;else if(1===newArg.getCountElementInRow())newArg=newArg.array[r]?newArg.array[r][0]:null;else newArg=newArg.array[r]?newArg.array[r][c]:null;if(!newArg)newArg=new cError(cErrorType.not_available)}newArgs.push(newArg)}var temp_opt_bbox= opt_bbox;if(0===argumentsCount&&parserFormula.ref)temp_opt_bbox=new Asc.Range(c+parserFormula.ref.c1,r+parserFormula.ref.r1,c+parserFormula.ref.c1,r+parserFormula.ref.r1);array.addElement(t.Calculate(newArgs,temp_opt_bbox,opt_defName,parserFormula.ws,null,_row,_col))};if(firstArray.foreach)firstArray.foreach(doCalc);else for(var i=firstArray.r1;i<=firstArray.r2;i++)for(var n=firstArray.c1;n<=firstArray.c2;n++)doCalc(null,i-firstArray.r1,n-firstArray.c1,i,n);res=array}else if(replaceOnlyArray&&tempArgs&& tempArgs.length)res=this.Calculate(tempArgs,opt_bbox,opt_defName,parserFormula.ws);else res=this.Calculate(arg,opt_bbox,opt_defName,parserFormula.ws)}return res};function cUnknownFunction(name){this.name=name;this.isXLFN=null}cUnknownFunction.prototype=Object.create(cBaseFunction.prototype);cUnknownFunction.prototype.constructor=cUnknownFunction;function parentLeft(){}parentLeft.prototype.type=cElementType.operator;parentLeft.prototype.name="(";parentLeft.prototype.argumentsCurrent=1;parentLeft.prototype.toString= function(){return this.name};parentLeft.prototype.Assemble2=function(arg,start,count){return new cString("("+arg[start+count-1]+")")};parentLeft.prototype.Assemble2Locale=function(arg,start,count,locale,digitDelim){return new cString("("+arg[start+count-1].toLocaleString(digitDelim)+")")};function parentRight(){}parentRight.prototype.type=cElementType.operator;parentRight.prototype.name=")";parentRight.prototype.toString=function(){return this.name};function cRangeUnionOperator(){}cRangeUnionOperator.prototype= Object.create(cBaseOperator.prototype);cRangeUnionOperator.prototype.constructor=cRangeUnionOperator;cRangeUnionOperator.prototype.name=":";cRangeUnionOperator.prototype.priority=50;cRangeUnionOperator.prototype.argumentsCurrent=2;cRangeUnionOperator.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],ws0,ws1,ws,res;if((cElementType.cell===arg0.type||cElementType.cellsRange===arg0.type||cElementType.cell3D===arg0.type||cElementType.cellsRange3D===arg0.type&&(ws0=arg0.wsFrom)===arg0.wsTo)&& (cElementType.cell===arg1.type||cElementType.cellsRange===arg1.type||cElementType.cell3D===arg1.type||cElementType.cellsRange3D===arg1.type&&(ws1=arg1.wsFrom)===arg1.wsTo)){if(cElementType.cellsRange3D===arg0.type)ws0=ws=arg0.wsFrom;else ws0=ws=arg0.getWS();if(cElementType.cellsRange3D===arg1.type)ws1=ws=arg1.wsFrom;else ws1=ws=arg1.getWS();if(ws0!==ws1)return new cError(cErrorType.wrong_value_type);arg0=arg0.getBBox0();arg1=arg1.getBBox0();if(!arg0||!arg1)return new cError(cErrorType.wrong_value_type); arg0=arg0.union(arg1);arg0.normalize(true);res=arg0.isOneCell()?new cRef(arg0.getName(),ws):new cArea(arg0.getName(),ws)}else res=new cError(cErrorType.wrong_value_type);return res};function cRangeIntersectionOperator(){}cRangeIntersectionOperator.prototype=Object.create(cBaseOperator.prototype);cRangeIntersectionOperator.prototype.constructor=cRangeIntersectionOperator;cRangeIntersectionOperator.prototype.name=" ";cRangeIntersectionOperator.prototype.priority=50;cRangeIntersectionOperator.prototype.argumentsCurrent= 2;cRangeIntersectionOperator.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],ws0,ws1,ws,res;if((cElementType.cell===arg0.type||cElementType.cellsRange===arg0.type||cElementType.cell3D===arg0.type||cElementType.cellsRange3D===arg0.type&&(ws0=arg0.wsFrom)==arg0.wsTo)&&(cElementType.cell===arg1.type||cElementType.cellsRange===arg1.type||cElementType.cell3D===arg1.type||cElementType.cellsRange3D===arg1.type&&(ws1=arg1.wsFrom)==arg1.wsTo)){if(cElementType.cellsRange3D===arg0.type)ws0=ws= arg0.wsFrom;else ws0=ws=arg0.getWS();if(cElementType.cellsRange3D===arg1.type)ws1=ws=arg1.wsFrom;else ws1=ws=arg1.getWS();if(ws0!==ws1)return new cError(cErrorType.wrong_value_type);arg0=arg0.getBBox0();arg1=arg1.getBBox0();if(!arg0||!arg1)return new cError(cErrorType.wrong_value_type);arg0=arg0.intersection(arg1);if(arg0){arg0.normalize(true);res=arg0.isOneCell()?new cRef(arg0.getName(),ws):new cArea(arg0.getName(),ws)}else res=new cError(cErrorType.null_value)}else res=new cError(cErrorType.wrong_value_type); return res};function cUnarMinusOperator(){}cUnarMinusOperator.prototype=Object.create(cBaseOperator.prototype);cUnarMinusOperator.prototype.constructor=cUnarMinusOperator;cUnarMinusOperator.prototype.name="un_minus";cUnarMinusOperator.prototype.priority=49;cUnarMinusOperator.prototype.argumentsCurrent=1;cUnarMinusOperator.prototype.rightAssociative=true;cUnarMinusOperator.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1],arguments[3]);else if(arg0 instanceof cArray){arg0.foreach(function(arrElem,r,c){arrElem=arrElem.tocNumber();arg0.array[r][c]=arrElem instanceof cError?arrElem:new cNumber(-arrElem.getValue())});return arg0}arg0=arg0.tocNumber();return arg0 instanceof cError?arg0:new cNumber(-arg0.getValue())};cUnarMinusOperator.prototype.toString=function(){return"-"};cUnarMinusOperator.prototype.Assemble2=function(arg,start,count){return new cString("-"+arg[start+count-1])}; cUnarMinusOperator.prototype.Assemble2Locale=function(arg,start,count,locale,digitDelim){return arg[start+count-1].toLocaleString?new cString("-"+arg[start+count-1].toLocaleString(digitDelim)):new cString("-"+arg[start+count-1])};function cUnarPlusOperator(){}cUnarPlusOperator.prototype=Object.create(cBaseOperator.prototype);cUnarPlusOperator.prototype.constructor=cUnarPlusOperator;cUnarPlusOperator.prototype.name="un_plus";cUnarPlusOperator.prototype.priority=49;cUnarPlusOperator.prototype.argumentsCurrent= 1;cUnarPlusOperator.prototype.rightAssociative=true;cUnarPlusOperator.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cellsRange===arg0.type)arg0=arg0.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)arg0=arg0.getValue();return arg0};cUnarPlusOperator.prototype.toString=function(){return"+"};cUnarPlusOperator.prototype.Assemble2=function(arg,start,count){return new cString("+"+ arg[start+count-1])};cUnarPlusOperator.prototype.Assemble2Locale=function(arg,start,count,locale,digitDelim){return arg[start+count-1].toLocaleString?new cString("+"+arg[start+count-1].toLocaleString(digitDelim)):new cString("+"+arg[start+count-1])};function cAddOperator(){}cAddOperator.prototype=Object.create(cBaseOperator.prototype);cAddOperator.prototype.constructor=cAddOperator;cAddOperator.prototype.name="+";cAddOperator.prototype.priority=20;cAddOperator.prototype.argumentsCurrent=2;cAddOperator.prototype.Calculate= function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(arg0 instanceof cArea)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1],arguments[3]);if(arg1 instanceof cArea)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1],arguments[3]);arg0=arg0.tocNumber();arg1=arg1.tocNumber(); return _func[arg0.type][arg1.type](arg0,arg1,"+",arguments[1],bIsSpecialFunction)};function cMinusOperator(){}cMinusOperator.prototype=Object.create(cBaseOperator.prototype);cMinusOperator.prototype.constructor=cMinusOperator;cMinusOperator.prototype.name="-";cMinusOperator.prototype.priority=20;cMinusOperator.prototype.argumentsCurrent=2;cMinusOperator.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0, arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(arg0 instanceof cArea)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1],arguments[3]);if(arg1 instanceof cArea)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1],arguments[3]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();return _func[arg0.type][arg1.type](arg0,arg1,"-",arguments[1],bIsSpecialFunction)};function cPercentOperator(){}cPercentOperator.prototype=Object.create(cBaseOperator.prototype); cPercentOperator.prototype.constructor=cPercentOperator;cPercentOperator.prototype.name="%";cPercentOperator.prototype.priority=45;cPercentOperator.prototype.argumentsCurrent=1;cPercentOperator.prototype.rightAssociative=true;cPercentOperator.prototype.Calculate=function(arg){var res,arg0=arg[0];if(arg0 instanceof cArea)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1],arguments[3]);else if(arg0 instanceof cArray){arg0.foreach(function(arrElem,r,c){arrElem= arrElem.tocNumber();arg0.array[r][c]=arrElem instanceof cError?arrElem:new cNumber(arrElem.getValue()/100)});return arg0}arg0=arg0.tocNumber();res=arg0 instanceof cError?arg0:new cNumber(arg0.getValue()/100);res.numFormat=9;return res};cPercentOperator.prototype.Assemble2=function(arg,start,count){return new cString(arg[start+count-1]+this.name)};cPercentOperator.prototype.Assemble2Locale=function(arg,start,count,locale,digitDelim){return new cString(arg[start+count-1].toLocaleString(digitDelim)+ this.name)};function cPowOperator(){}cPowOperator.prototype=Object.create(cBaseOperator.prototype);cPowOperator.prototype.numFormat=cNumFormatNone;cPowOperator.prototype.constructor=cPowOperator;cPowOperator.prototype.name="^";cPowOperator.prototype.priority=40;cPowOperator.prototype.argumentsCurrent=2;cPowOperator.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1],arguments[3]); arg0=arg0.tocNumber();if(arg1 instanceof cArea)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1],arguments[3]);arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var _v=Math.pow(arg0.getValue(),arg1.getValue());if(isNaN(_v))return new cError(cErrorType.not_numeric);else if(_v===Number.POSITIVE_INFINITY)return new cError(cErrorType.division_by_zero);return new cNumber(_v)};function cMultOperator(){}cMultOperator.prototype= Object.create(cBaseOperator.prototype);cMultOperator.prototype.numFormat=cNumFormatNone;cMultOperator.prototype.constructor=cMultOperator;cMultOperator.prototype.name="*";cMultOperator.prototype.priority=30;cMultOperator.prototype.argumentsCurrent=2;cMultOperator.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(arg0 instanceof cArea)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1],arguments[3]);if(arg1 instanceof cArea)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1],arguments[3]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();return _func[arg0.type][arg1.type](arg0,arg1,"*",arguments[1],bIsSpecialFunction)};function cDivOperator(){}cDivOperator.prototype=Object.create(cBaseOperator.prototype);cDivOperator.prototype.numFormat=cNumFormatNone; cDivOperator.prototype.constructor=cDivOperator;cDivOperator.prototype.name="/";cDivOperator.prototype.priority=30;cDivOperator.prototype.argumentsCurrent=2;cDivOperator.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(arg0 instanceof cArea)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1], arguments[3]);if(arg1 instanceof cArea)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1],arguments[3]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();return _func[arg0.type][arg1.type](arg0,arg1,"/",arguments[1],bIsSpecialFunction)};function cConcatSTROperator(){}cConcatSTROperator.prototype=Object.create(cBaseOperator.prototype);cConcatSTROperator.prototype.constructor=cConcatSTROperator;cConcatSTROperator.prototype.name="&";cConcatSTROperator.prototype.priority= 15;cConcatSTROperator.prototype.argumentsCurrent=2;cConcatSTROperator.prototype.numFormat=cNumFormatNone;cConcatSTROperator.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1],arguments[3]);arg0=arg0.tocString();if(arg1 instanceof cArea)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1],arguments[3]);arg1=arg1.tocString();return arg0 instanceof cError?arg0:arg1 instanceof cError?arg1:new cString(arg0.toString().concat(arg1.toString()))};function cEqualsOperator(){}cEqualsOperator.prototype=Object.create(cBaseOperator.prototype);cEqualsOperator.prototype.constructor=cEqualsOperator;cEqualsOperator.prototype.name="=";cEqualsOperator.prototype.priority=10;cEqualsOperator.prototype.argumentsCurrent=2;cEqualsOperator.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs= this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(cElementType.cellsRange===arg0.type)arg0=arg0.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)arg0=arg0.getValue();if(cElementType.cellsRange===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1],arguments[3]);else if(cElementType.cell=== arg1.type||cElementType.cell3D===arg1.type)arg1=arg1.getValue();return _func[arg0.type][arg1.type](arg0,arg1,"=",arguments[1],bIsSpecialFunction)};function cNotEqualsOperator(){}cNotEqualsOperator.prototype=Object.create(cBaseOperator.prototype);cNotEqualsOperator.prototype.constructor=cNotEqualsOperator;cNotEqualsOperator.prototype.name="<>";cNotEqualsOperator.prototype.priority=10;cNotEqualsOperator.prototype.argumentsCurrent=2;cNotEqualsOperator.prototype.Calculate=function(arg,opt_bbox,opt_defName, ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(cElementType.cellsRange===arg0.type)arg0=arg0.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)arg0=arg0.getValue();if(cElementType.cellsRange===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.cellsRange3D=== arg1.type)arg1=arg1.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type)arg1=arg1.getValue();return _func[arg0.type][arg1.type](arg0,arg1,"<>",arguments[1],bIsSpecialFunction)};function cLessOperator(){}cLessOperator.prototype=Object.create(cBaseOperator.prototype);cLessOperator.prototype.constructor=cLessOperator;cLessOperator.prototype.name="<";cLessOperator.prototype.priority=10;cLessOperator.prototype.argumentsCurrent=2;cLessOperator.prototype.Calculate= function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(cElementType.cellsRange===arg0.type)arg0=arg0.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)arg0=arg0.getValue();if(cElementType.cellsRange===arg1.type)arg1=arg1.cross(arguments[1]); else if(cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type)arg1=arg1.getValue();return _func[arg0.type][arg1.type](arg0,arg1,"<",arguments[1],bIsSpecialFunction)};function cLessOrEqualOperator(){}cLessOrEqualOperator.prototype=Object.create(cBaseOperator.prototype);cLessOrEqualOperator.prototype.constructor=cLessOrEqualOperator;cLessOrEqualOperator.prototype.name="<=";cLessOrEqualOperator.prototype.priority= 10;cLessOrEqualOperator.prototype.argumentsCurrent=2;cLessOrEqualOperator.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(cElementType.cellsRange===arg0.type)arg0=arg0.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg0.type||cElementType.cell3D=== arg0.type)arg0=arg0.getValue();if(cElementType.cellsRange===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type)arg1=arg1.getValue();return _func[arg0.type][arg1.type](arg0,arg1,"<=",arguments[1],bIsSpecialFunction)};function cGreaterOperator(){}cGreaterOperator.prototype=Object.create(cBaseOperator.prototype);cGreaterOperator.prototype.constructor=cGreaterOperator; cGreaterOperator.prototype.name=">";cGreaterOperator.prototype.priority=10;cGreaterOperator.prototype.argumentsCurrent=2;cGreaterOperator.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(cElementType.cellsRange===arg0.type)arg0=arg0.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1], arguments[3]);else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)arg0=arg0.getValue();if(cElementType.cellsRange===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type)arg1=arg1.getValue();return _func[arg0.type][arg1.type](arg0,arg1,">",arguments[1],bIsSpecialFunction)};function cGreaterOrEqualOperator(){}cGreaterOrEqualOperator.prototype= Object.create(cBaseOperator.prototype);cGreaterOrEqualOperator.prototype.constructor=cGreaterOrEqualOperator;cGreaterOrEqualOperator.prototype.name=">=";cGreaterOrEqualOperator.prototype.priority=10;cGreaterOrEqualOperator.prototype.argumentsCurrent=2;cGreaterOrEqualOperator.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws,bIsSpecialFunction){var arg0=arg[0],arg1=arg[1];if(bIsSpecialFunction){var convertArgs=this._convertAreaToArray([arg0,arg1]);arg0=convertArgs[0];arg1=convertArgs[1]}if(cElementType.cellsRange=== arg0.type)arg0=arg0.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)arg0=arg0.getValue();if(cElementType.cellsRange===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1],arguments[3]);else if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type)arg1=arg1.getValue();return _func[arg0.type][arg1.type](arg0, arg1,">=",arguments[1],bIsSpecialFunction)};function cSpecialOperandStart(){}cSpecialOperandStart.prototype.constructor=cSpecialOperandStart;cSpecialOperandStart.prototype.type=cElementType.specialFunctionStart;function cSpecialOperandEnd(){}cSpecialOperandEnd.prototype.constructor=cSpecialOperandEnd;cSpecialOperandEnd.prototype.type=cElementType.specialFunctionEnd;var cFormulaOperators={"(":parentLeft,")":parentRight,"{":function(){var r={};r.name="{";r.toString=function(){return this.name};return r}, "}":function(){var r={};r.name="}";r.toString=function(){return this.name};return r},":":cRangeUnionOperator," ":cRangeIntersectionOperator,"un_minus":cUnarMinusOperator,"un_plus":cUnarPlusOperator,"%":cPercentOperator,"^":cPowOperator,"*":cMultOperator,"/":cDivOperator,"+":cAddOperator,"-":cMinusOperator,"&":cConcatSTROperator,"=":cEqualsOperator,"<>":cNotEqualsOperator,"<":cLessOperator,"<=":cLessOrEqualOperator,">":cGreaterOperator,">=":cGreaterOrEqualOperator};var cFormulaFunctionGroup={};var cFormulaFunction= {};var cAllFormulaFunction={};function getFormulasInfo(){var list=[],a,b,f;for(var type in cFormulaFunctionGroup){b=new AscCommon.asc_CFormulaGroup(type);for(var i=0;i<cFormulaFunctionGroup[type].length;++i){a=new cFormulaFunctionGroup[type][i];if(-1===cFormulaFunctionGroup["NotRealised"].indexOf(cFormulaFunctionGroup[type][i])){f=new AscCommon.asc_CFormula(a);b.asc_addFormulaElement(f);cFormulaFunction[f.asc_getName()]=cFormulaFunctionGroup[type][i]}cAllFormulaFunction[a.name]=cFormulaFunctionGroup[type][i]}list.push(b)}return list} function getRangeByRef(ref,ws,onlyRanges,checkMultiSelection,checkFormula){var activeCell=ws.getSelection().activeCell;var bbox=new Asc.Range(activeCell.col,activeCell.row,activeCell.col,activeCell.row);var ranges=[];var pushRanges=function(item){var ref;switch(item.oper.type){case cElementType.table:case cElementType.name:case cElementType.name3D:ref=item.oper.toRef(bbox,checkMultiSelection&&(item.oper.type===cElementType.name||item.oper.type===cElementType.name3D));break;case cElementType.cell:case cElementType.cell3D:case cElementType.cellsRange:case cElementType.cellsRange3D:ref= item.oper;break}if(ref){var pushRange=function(curRef){switch(curRef.type){case cElementType.cell:case cElementType.cell3D:case cElementType.cellsRange:case cElementType.cellsRange3D:ranges.push(curRef.getRange());break;case cElementType.array:if(!onlyRanges)ranges=curRef.getMatrix();break}};if(ref.length)for(var i=0;i<ref.length;i++)pushRange(ref[i]);else pushRange(ref)}};var isFormula;if(checkFormula&&ref){var parseResult=new AscCommonExcel.ParseResult([]);var parsed=new AscCommonExcel.parserFormula(ref, null,ws);parsed.parse(undefined,undefined,parseResult);isFormula=parsed.calculate()}if(isFormula&&isFormula.type!==cElementType.error)pushRanges({oper:isFormula});else{if(ref[0]==="(")ref=ref.slice(1);if(ref[ref.length-1]===")")ref=ref.slice(0,-1);var arrRefs=ref.split(",");arrRefs.forEach(function(refItem){var currentWorkbook="[0]!";if(0===refItem.indexOf(currentWorkbook))refItem=refItem.slice(currentWorkbook.length);var _f=new AscCommonExcel.parserFormula(refItem,null,ws);var parseResult=new AscCommonExcel.ParseResult([]); if(_f.parse(null,null,parseResult))parseResult.refPos.forEach(pushRanges)})}return ranges}var _func=[];_func[cElementType.number]=[];_func[cElementType.string]=[];_func[cElementType.bool]=[];_func[cElementType.error]=[];_func[cElementType.cellsRange]=[];_func[cElementType.empty]=[];_func[cElementType.array]=[];_func[cElementType.cell]=[];_func[cElementType.number][cElementType.number]=function(arg0,arg1,what){var compareNumbers=function(){return AscCommon.compareNumbers(arg0.getValue(),arg1.getValue())}; if(what===">")return new cBool(compareNumbers()>0);else if(what===">=")return new cBool(!(compareNumbers()<0));else if(what==="<")return new cBool(compareNumbers()<0);else if(what==="<=")return new cBool(!(compareNumbers()>0));else if(what==="=")return new cBool(compareNumbers()===0);else if(what==="<>")return new cBool(compareNumbers()!==0);else if(what==="-")return new cNumber(arg0.getValue()-arg1.getValue());else if(what==="+")return new cNumber(arg0.getValue()+arg1.getValue());else if(what=== "/")if(arg1.getValue()!==0)return new cNumber(arg0.getValue()/arg1.getValue());else return new cError(cErrorType.division_by_zero);else if(what==="*")return new cNumber(arg0.getValue()*arg1.getValue());return new cError(cErrorType.wrong_value_type)};_func[cElementType.number][cElementType.string]=function(arg0,arg1,what){if(what===">"||what===">=")return new cBool(false);else if(what==="<"||what==="<=")return new cBool(true);else if(what==="=")return new cBool(false);else if(what==="<>")return new cBool(true); else if(what==="-"||what==="+"||what==="/"||what==="*")return new cError(cErrorType.wrong_value_type);return new cError(cErrorType.wrong_value_type)};_func[cElementType.number][cElementType.bool]=function(arg0,arg1,what){var _arg;if(what===">"||what===">=")return new cBool(false);else if(what==="<"||what==="<=")return new cBool(true);else if(what==="=")return new cBool(false);else if(what==="<>")return new cBool(true);else if(what==="-"){_arg=arg1.tocNumber();if(_arg instanceof cError)return _arg; return new cNumber(arg0.getValue()-_arg.getValue())}else if(what==="+"){_arg=arg1.tocNumber();if(_arg instanceof cError)return _arg;return new cNumber(arg0.getValue()+_arg.getValue())}else if(what==="/"){_arg=arg1.tocNumber();if(_arg instanceof cError)return _arg;if(_arg.getValue()!==0)return new cNumber(arg0.getValue()/_arg.getValue());else return new cError(cErrorType.division_by_zero)}else if(what==="*"){_arg=arg1.tocNumber();if(_arg instanceof cError)return _arg;return new cNumber(arg0.getValue()* _arg.getValue())}return new cError(cErrorType.wrong_value_type)};_func[cElementType.number][cElementType.error]=function(arg0,arg1){return arg1};_func[cElementType.number][cElementType.empty]=function(arg0,arg1,what){if(what===">")return new cBool(arg0.getValue()>0);else if(what===">=")return new cBool(arg0.getValue()>=0);else if(what==="<")return new cBool(arg0.getValue()<0);else if(what==="<=")return new cBool(arg0.getValue()<=0);else if(what==="=")return new cBool(arg0.getValue()===0);else if(what=== "<>")return new cBool(arg0.getValue()!==0);else if(what==="-")return new cNumber(arg0.getValue()-0);else if(what==="+")return new cNumber(arg0.getValue()+0);else if(what==="/")return new cError(cErrorType.division_by_zero);else if(what==="*")return new cNumber(0);return new cError(cErrorType.wrong_value_type)};_func[cElementType.string][cElementType.number]=function(arg0,arg1,what){if(what===">"||what===">=")return new cBool(true);else if(what==="<"||what==="<="||what==="=")return new cBool(false); else if(what==="<>")return new cBool(true);else if(what==="-"||what==="+"||what==="/"||what==="*")return new cError(cErrorType.wrong_value_type);return new cError(cErrorType.wrong_value_type)};_func[cElementType.string][cElementType.string]=function(arg0,arg1,what){var _arg0,_arg1;if(what===">")return new cBool(arg0.getValue()>arg1.getValue());else if(what===">=")return new cBool(arg0.getValue()>=arg1.getValue());else if(what==="<")return new cBool(arg0.getValue()<arg1.getValue());else if(what=== "<=")return new cBool(arg0.getValue()<=arg1.getValue());else if(what==="=")return new cBool(arg0.getValue().toLowerCase()===arg1.getValue().toLowerCase());else if(what==="<>")return new cBool(arg0.getValue().toLowerCase()!==arg1.getValue().toLowerCase());else if(what==="-"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg0 instanceof cError)return _arg0;if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()-_arg1.getValue())}else if(what==="+"){_arg0=arg0.tocNumber();_arg1= arg1.tocNumber();if(_arg0 instanceof cError)return _arg0;if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()+_arg1.getValue())}else if(what==="/"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg0 instanceof cError)return _arg0;if(_arg1 instanceof cError)return _arg1;if(_arg1.getValue()!==0)return new cNumber(_arg0.getValue()/_arg1.getValue());return new cError(cErrorType.division_by_zero)}else if(what==="*"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg0 instanceof cError)return _arg0;if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()*_arg1.getValue())}return new cError(cErrorType.wrong_value_type)};_func[cElementType.string][cElementType.bool]=function(arg0,arg1,what){var _arg0,_arg1;if(what===">"||what===">=")return new cBool(false);else if(what==="<"||what==="<=")return new cBool(true);else if(what==="=")return new cBool(false);else if(what==="<>")return new cBool(true);else if(what==="-"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber(); if(_arg0 instanceof cError)return _arg0;if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()-_arg1.getValue())}else if(what==="+"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg0 instanceof cError)return _arg0;if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()+_arg1.getValue())}else if(what==="/"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg0 instanceof cError)return _arg0;if(_arg1 instanceof cError)return _arg1;if(_arg1.getValue()!== 0)return new cNumber(_arg0.getValue()/_arg1.getValue());return new cError(cErrorType.division_by_zero)}else if(what==="*"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg0 instanceof cError)return _arg0;if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()*_arg1.getValue())}return new cError(cErrorType.wrong_value_type)};_func[cElementType.string][cElementType.error]=function(arg0,arg1){return arg1};_func[cElementType.string][cElementType.empty]=function(arg0,arg1,what){if(what=== ">")return new cBool(arg0.getValue().length!==0);else if(what===">=")return new cBool(arg0.getValue().length>=0);else if(what==="<")return new cBool(false);else if(what==="<=")return new cBool(arg0.getValue().length<=0);else if(what==="=")return new cBool(arg0.getValue().length===0);else if(what==="<>")return new cBool(arg0.getValue().length!==0);else if(what==="-"||what==="+"||what==="/"||what==="*")return new cError(cErrorType.wrong_value_type);return new cError(cErrorType.wrong_value_type)};_func[cElementType.bool][cElementType.number]= function(arg0,arg1,what){var _arg;if(what===">"||what===">=")return new cBool(true);else if(what==="<"||what==="<=")return new cBool(false);else if(what==="=")return new cBool(false);else if(what==="<>")return new cBool(true);else if(what==="-"){_arg=arg0.tocNumber();if(_arg instanceof cError)return _arg;return new cNumber(_arg.getValue()-arg1.getValue())}else if(what==="+"){_arg=arg1.tocNumber();if(_arg instanceof cError)return _arg;return new cNumber(_arg.getValue()+arg1.getValue())}else if(what=== "/"){_arg=arg1.tocNumber();if(_arg instanceof cError)return _arg;if(arg1.getValue()!==0)return new cNumber(_arg.getValue()/arg1.getValue());else return new cError(cErrorType.division_by_zero)}else if(what==="*"){_arg=arg1.tocNumber();if(_arg instanceof cError)return _arg;return new cNumber(_arg.getValue()*arg1.getValue())}return new cError(cErrorType.wrong_value_type)};_func[cElementType.bool][cElementType.string]=function(arg0,arg1,what){var _arg0,_arg1;if(what===">"||what===">=")return new cBool(true); else if(what==="<"||what==="<=")return new cBool(false);else if(what==="=")return new cBool(false);else if(what==="<>")return new cBool(true);else if(what==="-"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()-_arg1.getValue())}else if(what==="+"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()+_arg1.getValue())}else if(what==="/"){_arg0=arg0.tocNumber(); _arg1=arg1.tocNumber();if(_arg1 instanceof cError)return _arg1;if(_arg1.getValue()!==0)return new cNumber(_arg0.getValue()/_arg1.getValue());return new cError(cErrorType.division_by_zero)}else if(what==="*"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();if(_arg1 instanceof cError)return _arg1;return new cNumber(_arg0.getValue()*_arg1.getValue())}return new cError(cErrorType.wrong_value_type)};_func[cElementType.bool][cElementType.bool]=function(arg0,arg1,what){var _arg0,_arg1;if(what===">")return new cBool(arg0.value> arg1.value);else if(what===">=")return new cBool(arg0.value>=arg1.value);else if(what==="<")return new cBool(arg0.value<arg1.value);else if(what==="<=")return new cBool(arg0.value<=arg1.value);else if(what==="=")return new cBool(arg0.value===arg1.value);else if(what==="<>")return new cBool(arg0.value!==arg1.value);else if(what==="-"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();return new cNumber(_arg0.getValue()-_arg1.getValue())}else if(what==="+"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber(); return new cNumber(_arg0.getValue()+_arg1.getValue())}else if(what==="/"){if(!arg1.value)return new cError(cErrorType.division_by_zero);_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();return new cNumber(_arg0.getValue()/_arg1.getValue())}else if(what==="*"){_arg0=arg0.tocNumber();_arg1=arg1.tocNumber();return new cNumber(_arg0.getValue()*_arg1.getValue())}return new cError(cErrorType.wrong_value_type)};_func[cElementType.bool][cElementType.error]=function(arg0,arg1){return arg1};_func[cElementType.bool][cElementType.empty]= function(arg0,arg1,what){if(what===">")return new cBool(arg0.value>false);else if(what===">=")return new cBool(arg0.value>=false);else if(what==="<")return new cBool(arg0.value<false);else if(what==="<=")return new cBool(arg0.value<=false);else if(what==="=")return new cBool(arg0.value===false);else if(what==="<>")return new cBool(arg0.value!==false);else if(what==="-")return new cNumber(arg0.value?1:0);else if(what==="+")return new cNumber(arg0.value?1:0);else if(what==="/")return new cError(cErrorType.division_by_zero); else if(what==="*")return new cNumber(0);return new cError(cErrorType.wrong_value_type)};_func[cElementType.error][cElementType.number]=_func[cElementType.error][cElementType.string]=_func[cElementType.error][cElementType.bool]=_func[cElementType.error][cElementType.error]=_func[cElementType.error][cElementType.empty]=function(arg0){return arg0};_func[cElementType.empty][cElementType.number]=function(arg0,arg1,what){if(what===">")return new cBool(0>arg1.getValue());else if(what===">=")return new cBool(0>= arg1.getValue());else if(what==="<")return new cBool(0<arg1.getValue());else if(what==="<=")return new cBool(0<=arg1.getValue());else if(what==="=")return new cBool(0===arg1.getValue());else if(what==="<>")return new cBool(0!==arg1.getValue());else if(what==="-")return new cNumber(0-arg1.getValue());else if(what==="+")return new cNumber(0+arg1.getValue());else if(what==="/"){if(arg1.getValue()===0)return new cError(cErrorType.not_numeric);return new cNumber(0)}else if(what==="*")return new cNumber(0); return new cError(cErrorType.wrong_value_type)};_func[cElementType.empty][cElementType.string]=function(arg0,arg1,what){if(what===">")return new cBool(0>arg1.getValue().length);else if(what===">=")return new cBool(0>=arg1.getValue().length);else if(what==="<")return new cBool(0<arg1.getValue().length);else if(what==="<=")return new cBool(0<=arg1.getValue().length);else if(what==="=")return new cBool(0===arg1.getValue().length);else if(what==="<>")return new cBool(0!==arg1.getValue().length);else if(what=== "-"||what==="+"||what==="/"||what==="*")return new cError(cErrorType.wrong_value_type);return new cError(cErrorType.wrong_value_type)};_func[cElementType.empty][cElementType.bool]=function(arg0,arg1,what){if(what===">")return new cBool(false>arg1.value);else if(what===">=")return new cBool(false>=arg1.value);else if(what==="<")return new cBool(false<arg1.value);else if(what==="<=")return new cBool(false<=arg1.value);else if(what==="=")return new cBool(arg1.value===false);else if(what==="<>")return new cBool(arg1.value!== false);else if(what==="-")return new cNumber(0-arg1.value?1:0);else if(what==="+")return new cNumber(arg1.value?1:0);else if(what==="/"){if(arg1.value)return new cNumber(0);return new cError(cErrorType.not_numeric)}else if(what==="*")return new cNumber(0);return new cError(cErrorType.wrong_value_type)};_func[cElementType.empty][cElementType.error]=function(arg0,arg1){return arg1};_func[cElementType.empty][cElementType.empty]=function(arg0,arg1,what){if(what===">"||what==="<"||what==="<>")return new cBool(false); else if(what===">="||what==="<="||what==="=")return new cBool(true);else if(what==="-"||what==="+")return new cNumber(0);else if(what==="/")return new cError(cErrorType.not_numeric);else if(what==="*")return new cNumber(0);return new cError(cErrorType.wrong_value_type)};_func[cElementType.cellsRange][cElementType.number]=_func[cElementType.cellsRange][cElementType.string]=_func[cElementType.cellsRange][cElementType.bool]=_func[cElementType.cellsRange][cElementType.error]=_func[cElementType.cellsRange][cElementType.array]= _func[cElementType.cellsRange][cElementType.empty]=function(arg0,arg1,what,bbox){var cross=arg0.cross(bbox);return _func[cross.type][arg1.type](cross,arg1,what)};_func[cElementType.number][cElementType.cellsRange]=_func[cElementType.string][cElementType.cellsRange]=_func[cElementType.bool][cElementType.cellsRange]=_func[cElementType.error][cElementType.cellsRange]=_func[cElementType.array][cElementType.cellsRange]=_func[cElementType.empty][cElementType.cellsRange]=function(arg0,arg1,what,bbox){var cross= arg1.cross(bbox);return _func[arg0.type][cross.type](arg0,cross,what)};_func[cElementType.cellsRange][cElementType.cellsRange]=function(arg0,arg1,what,bbox){var cross1=arg0.cross(bbox),cross2=arg1.cross(bbox);return _func[cross1.type][cross2.type](cross1,cross2,what)};_func[cElementType.array][cElementType.array]=function(arg0,arg1,what,bbox,bIsSpecialFunction){if(bIsSpecialFunction){var specialArray=specialFuncArrayToArray(arg0,arg1,what);if(null!==specialArray)return specialArray}if(arg0.getRowCount()!== arg1.getRowCount()||arg0.getCountElementInRow()!==arg1.getCountElementInRow())return new cError(cErrorType.wrong_value_type);var retArr=new cArray,_arg0,_arg1;for(var iRow=0;iRow<arg0.getRowCount();iRow++,iRow<arg0.getRowCount()?retArr.addRow():true)for(var iCol=0;iCol<arg0.getCountElementInRow();iCol++){_arg0=arg0.getElementRowCol(iRow,iCol);_arg1=arg1.getElementRowCol(iRow,iCol);retArr.addElement(_func[_arg0.type][_arg1.type](_arg0,_arg1,what))}return retArr};_func[cElementType.array][cElementType.number]= _func[cElementType.array][cElementType.string]=_func[cElementType.array][cElementType.bool]=_func[cElementType.array][cElementType.error]=_func[cElementType.array][cElementType.empty]=function(arg0,arg1,what){var res=new cArray;arg0.foreach(function(elem,r){if(!res.array[r])res.addRow();res.addElement(_func[elem.type][arg1.type](elem,arg1,what))});return res};_func[cElementType.number][cElementType.array]=_func[cElementType.string][cElementType.array]=_func[cElementType.bool][cElementType.array]= _func[cElementType.error][cElementType.array]=_func[cElementType.empty][cElementType.array]=function(arg0,arg1,what){var res=new cArray;arg1.foreach(function(elem,r){if(!res.array[r])res.addRow();res.addElement(_func[arg0.type][elem.type](arg0,elem,what))});return res};_func.binarySearch=function(sElem,arrTagert,regExp){var first=0,last=arrTagert.length-1,mid;var arrTagertOneType=[],isString=false;for(var i=0;i<arrTagert.length;i++){if((arrTagert[i]instanceof cString||sElem instanceof cString)&&!isString){i= 0;isString=true;sElem=new cString(sElem.toString().toLowerCase())}if(isString)arrTagertOneType[i]=new cString(arrTagert[i].toString().toLowerCase());else arrTagertOneType[i]=arrTagert[i].tocNumber()}if(arrTagert.length===0)return-1;else if(arrTagert[0].value>sElem.value)return-2;else if(arrTagert[arrTagert.length-1].value<sElem.value)return arrTagert.length-1;while(first<last){mid=Math.floor(first+(last-first)/2);if(sElem.value<=arrTagert[mid].value||regExp&®Exp.test(arrTagert[mid].value))last= mid;else first=mid+1}if(arrTagert[last].value===sElem.value)return last;else return last-1};_func.binarySearchByRange=function(sElem,area,regExp){var bbox,ws;if(cElementType.cellsRange3D===area.type){bbox=area.bbox;ws=area.getWs()}else if(cElementType.cellsRange===area.type){bbox=area.range.bbox;ws=area.ws}var bVertical=bbox.r2-bbox.r1>=bbox.c2-bbox.c1;var first=0,last=bVertical?bbox.r2-bbox.r1:bbox.c2-bbox.c1,mid;var getValuesNoEmpty=function(){var _r1=bbox.r1;var _r2=bVertical?bbox.r2:bbox.r1;var _c1= bbox.c1;var _c2=bVertical?bbox.c1:bbox.c2;var _val=[];ws.getRange3(_r1,_c1,_r2,_c2)._foreachNoEmpty(function(cell){var checkTypeVal=checkTypeCell(cell);if(checkTypeVal.type!==cElementType.empty){_val.push(checkTypeVal);mapEmptyFullValues[_val.length-1]=bVertical?cell.nRow-bbox.r1:cell.nCol-bbox.c1}});return _val};var mapEmptyFullValues=[];var noEmptyValues=getValuesNoEmpty();last=noEmptyValues.length-1;if(noEmptyValues.length===0)return-1;else if(noEmptyValues[0].value>sElem.value)return-2;else if(noEmptyValues[last].value< sElem.value)return last;var tempValue;while(first<last){mid=Math.floor(first+(last-first)/2);tempValue=noEmptyValues[mid];if(sElem.value<=tempValue.value||regExp&®Exp.test(tempValue.value))last=mid;else first=mid+1}if(noEmptyValues[last].value===sElem.value)return mapEmptyFullValues[last];else return mapEmptyFullValues[last-1]};_func[cElementType.number][cElementType.cell]=function(arg0,arg1,what,bbox){var ar1=arg1.tocNumber();switch(what){case ">":{return new cBool(arg0.getValue()>ar1.getValue())}case ">=":{return new cBool(arg0.getValue()>= ar1.getValue())}case "<":{return new cBool(arg0.getValue()<ar1.getValue())}case "<=":{return new cBool(arg0.getValue()<=ar1.getValue())}case "=":{return new cBool(arg0.getValue()===ar1.getValue())}case "<>":{return new cBool(arg0.getValue()!==ar1.getValue())}case "-":{return new cNumber(arg0.getValue()-ar1.getValue())}case "+":{return new cNumber(arg0.getValue()+ar1.getValue())}case "/":{if(arg1.getValue()!==0)return new cNumber(arg0.getValue()/ar1.getValue());else return new cError(cErrorType.division_by_zero)}case "*":{return new cNumber(arg0.getValue()* ar1.getValue())}default:{return new cError(cErrorType.wrong_value_type)}}};_func[cElementType.cell][cElementType.number]=function(arg0,arg1,what,bbox){var ar0=arg0.tocNumber();switch(what){case ">":{return new cBool(ar0.getValue()>arg1.getValue())}case ">=":{return new cBool(ar0.getValue()>=arg1.getValue())}case "<":{return new cBool(ar0.getValue()<arg1.getValue())}case "<=":{return new cBool(ar0.getValue()<=arg1.getValue())}case "=":{return new cBool(ar0.getValue()===arg1.getValue())}case "<>":{return new cBool(ar0.getValue()!== arg1.getValue())}case "-":{return new cNumber(ar0.getValue()-arg1.getValue())}case "+":{return new cNumber(ar0.getValue()+arg1.getValue())}case "/":{if(arg1.getValue()!==0)return new cNumber(ar0.getValue()/arg1.getValue());else return new cError(cErrorType.division_by_zero)}case "*":{return new cNumber(ar0.getValue()*arg1.getValue())}default:{return new cError(cErrorType.wrong_value_type)}}};_func[cElementType.cell][cElementType.cell]=function(arg0,arg1,what,bbox){var ar0=arg0.tocNumber();switch(what){case ">":{return new cBool(ar0.getValue()> arg1.getValue())}case ">=":{return new cBool(ar0.getValue()>=arg1.getValue())}case "<":{return new cBool(ar0.getValue()<arg1.getValue())}case "<=":{return new cBool(ar0.getValue()<=arg1.getValue())}case "=":{return new cBool(ar0.getValue()===arg1.getValue())}case "<>":{return new cBool(ar0.getValue()!==arg1.getValue())}case "-":{return new cNumber(ar0.getValue()-arg1.getValue())}case "+":{return new cNumber(ar0.getValue()+arg1.getValue())}case "/":{if(arg1.getValue()!==0)return new cNumber(ar0.getValue()/ arg1.getValue());else return new cError(cErrorType.division_by_zero)}case "*":{return new cNumber(ar0.getValue()*arg1.getValue())}default:{return new cError(cErrorType.wrong_value_type)}}};_func[cElementType.cellsRange3D]=_func[cElementType.cellsRange];_func[cElementType.cell3D]=_func[cElementType.cell];function SharedProps(ref,base){this.ref=ref;this.base=base}SharedProps.prototype.isOneDimension=function(){return this.ref&&(this.ref.r1===this.ref.r2||this.ref.c1===this.ref.c2)};SharedProps.prototype.isHor= function(){return this.ref&&this.ref.r1===this.ref.r2};function ParseResult(refPos,elems){this.refPos=refPos;this.elems=elems;this.error=undefined;this.operand_expected=undefined;this.argPos=undefined;this.argPosArr=[];this.activeFunction=null;this.cursorPos=undefined}ParseResult.prototype.addRefPos=function(start,end,index,oper,isName){if(this.refPos)this.refPos.push({start:start,end:end,index:index,oper:oper,isName:isName})};ParseResult.prototype.addElem=function(elem){if(this.elems)this.elems.push(elem)}; ParseResult.prototype.setError=function(error){this.error=error};ParseResult.prototype.getElementByPos=function(pos){var curPos=0;var argCount=[],level=0;for(var i=0;i<this.elems.length;++i){curPos+=this.elems[i].toLocaleString().length;if("("===this.elems[i].name)level++;else if(")"===this.elems[i].name)level--;else if(level){if(!argCount[level])argCount[level]=1;else argCount[level]++;if(argCount[level]>1)curPos++}if(curPos>=pos)return this.elems[i]}return null};ParseResult.prototype.getElementByPos2= function(pos,start,end){var curPos=1;var curFunc=[],level=-1;for(var i=0;i<this.elems.length;++i){var curElem=this.elems[i];var curElemStr=this.elems[i].toLocaleString();var curElemLength=curElemStr.length;var isFunc=curElem.type===cElementType.func;var nextElem=this.elems[i+1];var needAddSeparator=true;if(isFunc&&nextElem&&nextElem.name==="("){level++;curFunc[level]={func:this.elems[i],start:curPos};curElemLength++;needAddSeparator=false;i++}if(pos!==undefined&&pos>=curPos&&pos<=curPos+curElemLength)return curFunc[level]? curFunc[level].func:null;else if(start!==undefined&&curFunc[level]&&start>=curFunc[level].start&&end<=curPos+curElemLength)return curFunc[level].func;if(curElem.name===")")level--;curPos+=curElemLength}return null};var g_defParseResult=new ParseResult(undefined,undefined);var lastListenerId=0;function parserFormula(formula,parent,_ws){this.is3D=false;this.ws=_ws;this.wb=this.ws.workbook;this.value=null;this.outStack=[];this.Formula=formula;this.isParsed=false;this.shared=null;this.listenerId=lastListenerId++; this.ca=false;this.isTable=false;this.isInDependencies=false;this.parent=parent;this._index=undefined;this.ref=null;if(AscFonts.IsCheckSymbols)AscFonts.FontPickerByCharacter.getFontsByString(this.Formula)}parserFormula.prototype.getWs=function(){return this.ws};parserFormula.prototype.getListenerId=function(){return this.listenerId};parserFormula.prototype.setIsTable=function(isTable){this.isTable=isTable};parserFormula.prototype.getShared=function(){return this.shared};parserFormula.prototype.setShared= function(ref,cellWithFormula){this.shared=new SharedProps(ref,cellWithFormula)};parserFormula.prototype.setSharedRef=function(newRef,opt_updateBase){var old=this.shared.ref;if(!(newRef&&newRef.r1===old.r1&&newRef.c1===old.c1&&newRef.r2===old.r2&&newRef.c2===old.c2)){this.removeDependencies();if(newRef){this.shared.ref=newRef;if(opt_updateBase){this.shared.base.nRow+=newRef.r1-old.r1;this.shared.base.nCol+=newRef.c1-old.c1}this.buildDependencies()}var index=this.ws.workbook.workbookFormulas.add(this).getIndexNumber(); History.Add(AscCommonExcel.g_oUndoRedoSharedFormula,AscCH.historyitem_SharedFormula_ChangeShared,null,null,new AscCommonExcel.UndoRedoData_IndexSimpleProp(index,opt_updateBase,old,newRef),true)}};parserFormula.prototype.removeShared=function(){this.shared=null};parserFormula.prototype.notify=function(data){var eventData={notifyData:data,assemble:null,formula:this};if(AscCommon.c_oNotifyType.Dirty===data.type){if(this.parent&&this.parent.onFormulaEvent)this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.Change, eventData)}else if(this.shared&&this.parent&&this.parent.onFormulaEvent&&this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.Shared,eventData));else if(AscCommon.c_oNotifyType.Prepare===data.type){this.removeDependencies();this.processNotifyPrepare(data)}else{this.removeDependencies();var needAssemble=true;if(this.parent&&this.parent.onFormulaEvent&&!this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.ProcessNotify,eventData))needAssemble=this.processNotify(data);if(needAssemble)eventData.assemble= this.assemble(true);else eventData.assemble=this.getFormula();if(this.parent&&this.parent.onFormulaEvent)this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.ChangeFormula,eventData);this.Formula=eventData.assemble;this.buildDependencies()}};parserFormula.prototype.processNotifyPrepare=function(data){var needAssemble=false;if(AscCommon.c_oNotifyType.ChangeSheet===data.actionType){var changeData=data.data;if(this.is3D||changeData.remove)if(changeData.replace||changeData.remove){if(changeData.remove)needAssemble= this.removeSheet(changeData.remove,changeData.tableNamesMap);else needAssemble=this.moveSheet(changeData.replace);data.preparedData[this.getListenerId()]=needAssemble}}return needAssemble};parserFormula.prototype.processNotify=function(data){var needAssemble=true;if(AscCommon.c_oNotifyType.Shift===data.type||AscCommon.c_oNotifyType.Move===data.type||AscCommon.c_oNotifyType.Delete===data.type)this.shiftCells(data.type,data.sheetId,data.bbox,data.offset,data.sheetIdTo);else if(AscCommon.c_oNotifyType.ChangeDefName=== data.type)if(!data.to)this.removeTableName(data.from,data.bConvertTableFormulaToRef);else if(data.from.name!==data.to.name)this.changeDefName(data.from,data.to);else{if(data.from.type===Asc.c_oAscDefNameType.table){needAssemble=false;this.changeTableRef(data.from.name)}}else if(AscCommon.c_oNotifyType.DelColumnTable===data.type)this.removeTableColumn(data.tableName,data.deleted);else if(AscCommon.c_oNotifyType.RenameTableColumn===data.type)this.renameTableColumn(data.tableName);else if(AscCommon.c_oNotifyType.ChangeSheet=== data.type){needAssemble=false;var changeData=data.data;if(this.is3D||changeData.remove)if(changeData.replace||changeData.remove)needAssemble=data.preparedData[this.getListenerId()];else if(changeData.rename)needAssemble=true}return needAssemble};parserFormula.prototype.clone=function(formula,parent,ws){var opt_ws=null;if(Asc["editor"]&&Asc["editor"].wb&&Asc["editor"].wb.model&&Asc["editor"].wb.model.addingWorksheet){opt_ws=Asc["editor"].wb.model.addingWorksheet;ws=opt_ws}if(null==formula)formula= this.Formula;if(null==parent)parent=this.parent;if(null==ws)ws=this.ws;var oRes=new parserFormula(formula,parent,ws);oRes.is3D=this.is3D;oRes.value=this.value;for(var i=0,length=this.outStack.length;i<length;i++){var oCurElem=this.outStack[i];if(oCurElem.clone)oRes.outStack.push(oCurElem.clone(opt_ws));else oRes.outStack.push(oCurElem)}oRes.isParsed=this.isParsed;oRes.ref=this.ref;return oRes};parserFormula.prototype.getParent=function(){return this.parent};parserFormula.prototype.getFormula=function(){if(AscCommonExcel.g_ProcessShared)return this.assemble(true); else return this.Formula};parserFormula.prototype.getFormulaRaw=function(){return this.Formula};parserFormula.prototype.setFormulaString=function(formula){this.Formula=formula};parserFormula.prototype.setFormula=function(formula){this.Formula=formula;this.is3D=false;this.value=null;this.outStack=[];this.isParsed=false;this.ca=false;this.isInDependencies=false};parserFormula.prototype.parse=function(local,digitDelim,parseResult,ignoreErrors,renameSheetMap,tablesMap){var elemArr=[];var ph={operand_str:null, pCurrPos:0};var needAssemble=false;var cFormulaList;var startSumproduct=false,counterSumproduct=0;if(this.isParsed)return this.isParsed;if(!parseResult)parseResult=g_defParseResult;if(this.Formula.length>=AscCommon.c_oAscMaxFormulaLength){parseResult.setError(c_oAscError.ID.FrmlMaxLength);this.outStack=[];return false}if(false){var getPrevElem=function(aTokens,pos){for(var n=pos-1;n>=0;n--)if(""!==aTokens[n].value)return aTokens[n];return aTokens[pos-1]};cFormulaList=local&&AscCommonExcel.cFormulaFunctionLocalized? AscCommonExcel.cFormulaFunctionLocalized:cFormulaFunction;var aTokens=getTokens(this.Formula);if(null===aTokens){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlWrongOperator);return false}var notEndedFuncCount=0;var stack=[],val,valUp,tmp,elem,len,indentCount=-1,args=[],prev,next,arr=null,bArrElemSign=false,wsF,wsT,arg_count;for(var i=0,nLength=aTokens.length;i<nLength;++i){if(TOK_SUBTYPE_START===aTokens[i].subtype)notEndedFuncCount++;else if(TOK_SUBTYPE_STOP===aTokens[i].subtype)notEndedFuncCount--; found_operand=null;val=aTokens[i].value;switch(aTokens[i].type){case TOK_TYPE_OPERAND:{if(TOK_SUBTYPE_TEXT===aTokens[i].subtype)elem=new cString(val);else{tmp=parseFloat(val);if(isNaN(tmp)){valUp=val.toUpperCase();if("TRUE"===valUp||"FALSE"===valUp)elem=new cBool(valUp);else if(-1!==val.indexOf("!")){tmp=AscCommonExcel.g_oRangeCache.getRange3D(val);if(tmp){this.is3D=true;wsF=this.wb.getWorksheetByName(tmp.sheet);wsT=null!==tmp.sheet2&&tmp.sheet!==tmp.sheet2?this.wb.getWorksheetByName(tmp.sheet2): wsF;var name=tmp.getName().split("!")[1];elem=tmp.isOneCell()?new cRef3D(name,wsF):new cArea3D(name,wsF,wsT);parseResult.addRefPos(aTokens[i].pos-aTokens[i].length,aTokens[i].pos,this.outStack.length,elem)}else if(TOK_SUBTYPE_ERROR===aTokens[i].subtype)elem=new cError(val);else{parseResult.setError(c_oAscError.ID.FrmlWrongOperator);this.outStack=[];return false}}else{tmp=AscCommonExcel.g_oRangeCache.getAscRange(valUp);if(tmp){var isOneCell=!valUp.split(":")[1];elem=isOneCell?new cRef(valUp,this.ws): new cArea(valUp,this.ws);parseResult.addRefPos(aTokens[i].pos-aTokens[i].length,aTokens[i].pos,this.outStack.length,elem)}else if(TOK_SUBTYPE_ERROR===aTokens[i].subtype)elem=new cError(val);else{elem=new cName(aTokens[i].value,this.ws);parseResult.addRefPos(aTokens[i].pos-aTokens[i].length,aTokens[i].pos,this.outStack.length,elem)}}}else elem=new cNumber(tmp)}if(arr)if(cElementType.number!==elem.type&&cElementType.bool!==elem.type&&cElementType.string!==elem.type){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError); return false}else{if(bArrElemSign){if(cElementType.number!==elem.type){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);return false}elem.value*=-1;bArrElemSign=false}arr.addElement(elem)}else{this.outStack.push(elem);parseResult.addElem(elem)}break}case TOK_TYPE_OP_POST:case TOK_TYPE_OP_IN:{if(TOK_SUBTYPE_UNION===aTokens[i].subtype){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlWrongOperator);return false}prev=getPrevElem(aTokens,i);if("-"===val&&(0===i||TOK_TYPE_OPERAND!== prev.type&&TOK_TYPE_OP_POST!==prev.type&&(TOK_SUBTYPE_STOP!==prev.subtype||TOK_TYPE_FUNCTION!==prev.type&&TOK_TYPE_SUBEXPR!==prev.type)))elem=cFormulaOperators["un_minus"].prototype;else elem=cFormulaOperators[val].prototype;if(arr)if(bArrElemSign||"un_minus"!==elem.name){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlWrongOperator);return false}else{bArrElemSign=true;break}parseResult.addElem(elem);len=stack.length;while(0!==len){tmp=stack[len-1];if(elem.rightAssociative?elem.priority< tmp.priority:elem.priority<=tmp.priority){this.outStack.push(tmp);--len}else break}stack.length=len;stack.push(elem);break}case TOK_TYPE_FUNCTION:{if(TOK_SUBTYPE_START===aTokens[i].subtype){val=val.toUpperCase();if("ARRAY"===val){if(arr){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlWrongOperator);return false}arr=new cArray;break}else if("ARRAYROW"===val){if(!arr){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlWrongOperator);return false}arr.addRow();break}else if(val in cFormulaList)elem= cFormulaList[val].prototype;else if(val in cAllFormulaFunction)elem=cAllFormulaFunction[val].prototype;else{elem=new cUnknownFunction(val);elem.isXLFN=0===val.indexOf("_xlfn.")}if("SUMPRODUCT"===val){startSumproduct=true;counterSumproduct++;if(1===counterSumproduct)this.outStack.push(cSpecialOperandStart.prototype)}if(elem&&elem.ca)this.ca=elem.ca;stack.push(elem);args[++indentCount]=1}else{if(arr){if("ARRAY"===val){if(!arr.isValidArray()){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError); return false}this.outStack.push(arr);arr=null}else if("ARRAYROW"!==val){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);return false}break}len=stack.length;while(0!==len){tmp=stack[len-1];--len;this.outStack.push(tmp);if(cElementType.func===tmp.type){prev=aTokens[i-1];arg_count=args[indentCount]-(prev&&TOK_TYPE_FUNCTION===prev.type&&TOK_SUBTYPE_START===prev.subtype?1:0);this.outStack.splice(this.outStack.length-1,0,arg_count);if(startSumproduct&&"SUMPRODUCT"===tmp.name){counterSumproduct--; if(counterSumproduct<1){startSumproduct=false;this.outStack.push(cSpecialOperandEnd.prototype)}}if(!tmp.checkArguments(arg_count)){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlWrongMaxArgument);return false}break}}stack.length=len;--indentCount}break}case TOK_TYPE_ARGUMENT:{if(arr)break;if(-1===indentCount)throw"error!!!!!!!!!!!";args[indentCount]+=1;len=stack.length;while(0!==len){tmp=stack[len-1];if(cElementType.func===tmp.type)break;this.outStack.push(tmp);--len}stack.length=len;next= aTokens[i+1];if(next&&(TOK_TYPE_ARGUMENT===next.type||TOK_TYPE_FUNCTION===next.type&&TOK_SUBTYPE_START!==next.subtype)){this.outStack.push(new cEmpty);break}break}case TOK_TYPE_SUBEXPR:{if(TOK_SUBTYPE_START===aTokens[i].subtype){elem=new parentLeft;stack.push(elem)}else{elem=new parentRight;len=stack.length;while(0!==len){tmp=stack[len-1];--len;this.outStack.push(tmp);if(tmp instanceof parentLeft)break}stack.length=len}parseResult.addElem(elem);break}case TOK_TYPE_WSPACE:{if(0!==i&&i!==nLength-1){prev= aTokens[i-1];next=aTokens[i+1];if((TOK_TYPE_OPERAND===prev.type||(TOK_TYPE_FUNCTION===prev.type||TOK_TYPE_SUBEXPR===prev.type)&&TOK_SUBTYPE_STOP===prev.subtype)&&(TOK_TYPE_OPERAND===next.type||(TOK_TYPE_FUNCTION===next.type||TOK_TYPE_SUBEXPR===next.type)&&TOK_SUBTYPE_START===next.subtype)){aTokens[i].type=TOK_TYPE_OP_IN;aTokens[i].value=" ";--i}}break}}}while(stack.length!==0)this.outStack.push(stack.pop());if(notEndedFuncCount){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlOperandExpected); return false}if(this.outStack.length!==0)return this.isParsed=true;else return this.isParsed=false}parseResult.operand_expected=true;var wasLeftParentheses=false,wasRigthParentheses=false,found_operand=null,_3DRefTmp=null,_tableTMP=null;cFormulaList=local&&AscCommonExcel.cFormulaFunctionLocalized?AscCommonExcel.cFormulaFunctionLocalized:cFormulaFunction;var leftParentArgumentsCurrentArr=[];var referenceCount=0;var needCalcArgPos=ignoreErrors;var activePos=parseResult.cursorPos;var needAddCursorPos= activePos===undefined;var needFuncLevel=0;var currentFuncLevel=-1;var levelFuncMap=[];var argFuncMap=[];var argPosArrMap=[];var startArrayArg=null;var t=this;var _checkReferenceCount=function(weight){referenceCount+=weight;if(referenceCount>AscCommon.c_oAscMaxFormulaReferenceLength){parseResult.setError(c_oAscError.ID.FrmlMaxReference);if(!ignoreErrors){t.outStack=[];return false}}return true};var parseOperators=function(){wasLeftParentheses=false;wasRigthParentheses=false;var found_operator=null; if(parseResult.operand_expected)if("-"===ph.operand_str){parseResult.operand_expected=true;found_operator=cFormulaOperators["un_minus"].prototype}else if("+"===ph.operand_str){parseResult.operand_expected=true;found_operator=cFormulaOperators["un_plus"].prototype}else if(" "===ph.operand_str)return true;else{parseResult.setError(c_oAscError.ID.FrmlWrongOperator);t.outStack=[];return false}else if(!parseResult.operand_expected)if("-"===ph.operand_str){parseResult.operand_expected=true;found_operator= cFormulaOperators["-"].prototype}else if("+"===ph.operand_str){parseResult.operand_expected=true;found_operator=cFormulaOperators["+"].prototype}else if(":"===ph.operand_str){parseResult.operand_expected=true;found_operator=cFormulaOperators[":"].prototype}else if("%"===ph.operand_str){parseResult.operand_expected=false;found_operator=cFormulaOperators["%"].prototype}else if(" "===ph.operand_str&&ph.pCurrPos===t.Formula.length)return true;else if(ph.operand_str in cFormulaOperators){found_operator= cFormulaOperators[ph.operand_str].prototype;parseResult.operand_expected=true}else if(ignoreErrors)return true;else{parseResult.setError(c_oAscError.ID.FrmlWrongOperator);t.outStack=[];return false}while(0!==elemArr.length&&(found_operator.rightAssociative?found_operator.priority<elemArr[elemArr.length-1].priority:found_operator.priority<=elemArr[elemArr.length-1].priority))t.outStack.push(elemArr.pop());elemArr.push(found_operator);parseResult.addElem(found_operator);found_operand=null;return true}; var parseLeftParentheses=function(){if(wasRigthParentheses||found_operand)elemArr.push(new cMultOperator);parseResult.operand_expected=true;wasLeftParentheses=true;wasRigthParentheses=false;found_operand=null;elemArr.push(cFormulaOperators[ph.operand_str].prototype);parseResult.addElem(cFormulaOperators[ph.operand_str].prototype);leftParentArgumentsCurrentArr[elemArr.length-1]=1;parseResult.argPos=1;if(startSumproduct){counterSumproduct++;if(1===counterSumproduct)t.outStack.push(cSpecialOperandStart.prototype)}argFuncMap[currentFuncLevel]= {count:0,startPos:ph.pCurrPos+1};argPosArrMap[currentFuncLevel]=[{start:ph.pCurrPos+1}]};var parseRightParentheses=function(){parseResult.addElem(cFormulaOperators[ph.operand_str].prototype);wasRigthParentheses=true;var top_elem=null;var top_elem_arg_count=0;if(0!==elemArr.length&&(top_elem=elemArr[elemArr.length-1]).name==="("&&parseResult.operand_expected){top_elem_arg_count=leftParentArgumentsCurrentArr[elemArr.length-1];if(top_elem_arg_count>1)t.outStack.push(new cEmpty);else{leftParentArgumentsCurrentArr[elemArr.length- 1]--;top_elem_arg_count=leftParentArgumentsCurrentArr[elemArr.length-1]}}else{while(0!==elemArr.length&&!((top_elem=elemArr[elemArr.length-1]).name==="(")){if(top_elem.name in cFormulaOperators&&parseResult.operand_expected){parseResult.setError(c_oAscError.ID.FrmlOperandExpected);t.outStack=[];return false}t.outStack.push(elemArr.pop())}top_elem_arg_count=leftParentArgumentsCurrentArr[elemArr.length-1]}if(0===elemArr.length||null===top_elem){parseResult.setError(c_oAscError.ID.FrmlWrongCountParentheses); if(!ignoreErrors){t.outStack=[];return false}}var p=top_elem,func,bError=false;elemArr.pop();if(0!==elemArr.length&&(func=elemArr[elemArr.length-1]).type===cElementType.func){p=elemArr.pop();if(top_elem_arg_count>func.argumentsMax){parseResult.setError(c_oAscError.ID.FrmlWrongMaxArgument);if(!ignoreErrors){t.outStack=[];return false}}else{if(top_elem_arg_count>=func.argumentsMin){t.outStack.push(null!==startArrayArg&&startArrayArg<currentFuncLevel?-top_elem_arg_count:top_elem_arg_count);if(!func.checkArguments(top_elem_arg_count))bError= true}else bError=true;if(bError){parseResult.setError(c_oAscError.ID.FrmlWrongCountArgument);if(!ignoreErrors){t.outStack=[];return false}}}parseResult.argPos=leftParentArgumentsCurrentArr[elemArr.length-1]}else if(wasLeftParentheses&&0===top_elem_arg_count&&elemArr[elemArr.length-1]){parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);if(!ignoreErrors){t.outStack=[];return false}}else if(wasLeftParentheses&&(!elemArr[elemArr.length-1]||"("===elemArr[elemArr.length-1].name)){parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError); if(!ignoreErrors){t.outStack=[];return false}}t.outStack.push(p);parseResult.operand_expected=false;wasLeftParentheses=false;if(startSumproduct){counterSumproduct--;if(counterSumproduct<1){startSumproduct=false;t.outStack.push(cSpecialOperandEnd.prototype)}}if(func&&func.type===cElementType.func){if(needCalcArgPos){if(needFuncLevel>0)needFuncLevel--;if(!parseResult.activeFunction&&levelFuncMap[currentFuncLevel]&&levelFuncMap[currentFuncLevel].startPos<=activePos&&activePos<=ph.pCurrPos){parseResult.activeFunction= {func:levelFuncMap[currentFuncLevel].func,start:levelFuncMap[currentFuncLevel].startPos,end:ph.pCurrPos};parseResult.argPosArr=argPosArrMap[currentFuncLevel]}}var _argPos=argPosArrMap[currentFuncLevel];if(_argPos&&_argPos[_argPos.length-1]&&undefined===_argPos[_argPos.length-1].end)_argPos[_argPos.length-1].end=ph.pCurrPos;currentFuncLevel--}return true};var parseCommaAndArgumentsUnion=function(){wasLeftParentheses=false;wasRigthParentheses=false;var stackLength=elemArr.length,top_elem=null,top_elem_arg_pos; if(elemArr.length!==0&&elemArr[stackLength-1].name==="("&&(!elemArr[stackLength-2]||elemArr[stackLength-2]&&elemArr[stackLength-2].type!==cElementType.func)){parseResult.setError(c_oAscError.ID.FrmlWrongOperator);if(!ignoreErrors){t.outStack=[];return false}}else if(elemArr.length!==0&&elemArr[stackLength-1].name==="("&&parseResult.operand_expected){t.outStack.push(new cEmpty);top_elem=elemArr[stackLength-1];top_elem_arg_pos=stackLength-1;wasLeftParentheses=true;parseResult.operand_expected=false}else while(stackLength!== 0){top_elem=elemArr[stackLength-1];top_elem_arg_pos=stackLength-1;if(top_elem.name==="("){wasLeftParentheses=true;break}else{t.outStack.push(elemArr.pop());stackLength=elemArr.length}}if(parseResult.operand_expected){parseResult.setError(c_oAscError.ID.FrmlWrongOperator);if(!ignoreErrors){t.outStack=[];return false}}if(!wasLeftParentheses&&!(t.parent&&t.parent instanceof window["AscCommonExcel"].DefName)){parseResult.setError(c_oAscError.ID.FrmlWrongCountParentheses);if(!ignoreErrors){t.outStack= [];return false}}leftParentArgumentsCurrentArr[top_elem_arg_pos]++;parseResult.argPos=leftParentArgumentsCurrentArr[top_elem_arg_pos];parseResult.operand_expected=true;if(needCalcArgPos){if(needFuncLevel===1);if(argFuncMap[currentFuncLevel]&&argFuncMap[currentFuncLevel].startPos<=activePos&&activePos<=ph.pCurrPos)parseResult.activeArgumentPos=argFuncMap[currentFuncLevel].count}if(argPosArrMap[currentFuncLevel]){var _curFunc=levelFuncMap[currentFuncLevel].func;var _curArg=argPosArrMap[currentFuncLevel].length; if(_curFunc.argumentsType&&Asc.c_oAscFormulaArgumentType.reference===_curFunc.argumentsType[_curArg]){if(null===startArrayArg||startArrayArg>currentFuncLevel)startArrayArg=currentFuncLevel}else if(currentFuncLevel<=startArrayArg)startArrayArg=null;argPosArrMap[currentFuncLevel][argPosArrMap[currentFuncLevel].length-1].end=ph.pCurrPos;argPosArrMap[currentFuncLevel][argPosArrMap[currentFuncLevel].length]={start:ph.pCurrPos+1};argFuncMap[currentFuncLevel].count++;argFuncMap[currentFuncLevel].startPos= ph.pCurrPos+1}return true};var parseArray=function(){if(!_checkReferenceCount(2))return false;wasLeftParentheses=false;wasRigthParentheses=false;var arr=new cArray,operator={isOperator:false,operatorName:""};while(ph.pCurrPos<t.Formula.length&&!parserHelp.isRightBrace.call(ph,t.Formula,ph.pCurrPos))if(parserHelp.isArraySeparator.call(ph,t.Formula,ph.pCurrPos,digitDelim)){if(ph.operand_str===(digitDelim?FormulaSeparators.arrayRowSeparator:FormulaSeparators.arrayRowSeparatorDef))arr.addRow()}else if(parserHelp.isBoolean.call(ph, t.Formula,ph.pCurrPos,local))arr.addElement(new cBool(ph.operand_str));else if(parserHelp.isString.call(ph,t.Formula,ph.pCurrPos))arr.addElement(new cString(ph.operand_str));else if(parserHelp.isError.call(ph,t.Formula,ph.pCurrPos))arr.addElement(new cError(ph.operand_str));else if(parserHelp.isNumber.call(ph,t.Formula,ph.pCurrPos,digitDelim)){if(operator.isOperator)if(operator.operatorName==="+"||operator.operatorName==="-")ph.operand_str=operator.operatorName+""+ph.operand_str;else{t.outStack=[]; parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);return false}arr.addElement(new cNumber(parseFloat(ph.operand_str)));operator={isOperator:false,operatorName:""}}else if(parserHelp.isOperator.call(ph,t.Formula,ph.pCurrPos)){operator.isOperator=true;operator.operatorName=ph.operand_str}else{t.outStack=[];parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);return false}if(!arr.isValidArray()){parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);if(!ignoreErrors){t.outStack= [];return false}}t.outStack.push(arr);parseResult.operand_expected=false;return true};var parseOperands=function(){found_operand=null;if(wasRigthParentheses)parseResult.operand_expected=true;if(!parseResult.operand_expected){parseResult.setError(c_oAscError.ID.FrmlWrongOperator);if(!ignoreErrors){t.outStack=[];return false}}var prevCurrPos=ph.pCurrPos;if(parserHelp.isBoolean.call(ph,t.Formula,ph.pCurrPos,local)){if(!_checkReferenceCount(.5))return false;found_operand=new cBool(ph.operand_str)}else if(parserHelp.isString.call(ph, t.Formula,ph.pCurrPos)){if(ph.operand_str.length>g_nFormulaStringMaxLength){parseResult.setError(c_oAscError.ID.FrmlMaxTextLength);if(!ignoreErrors){t.outStack=[];return false}}if(!_checkReferenceCount(ph.operand_str.length*.25+.5))return false;found_operand=new cString(ph.operand_str)}else if(parserHelp.isError.call(ph,t.Formula,ph.pCurrPos,local)){if(!_checkReferenceCount(1))return false;found_operand=new cError(ph.operand_str)}else if((_3DRefTmp=parserHelp.is3DRef.call(ph,t.Formula,ph.pCurrPos))[0]){t.is3D= true;if(renameSheetMap){if(renameSheetMap[_3DRefTmp[1]]){_3DRefTmp[1]=renameSheetMap[_3DRefTmp[1]];needAssemble=true}if(_3DRefTmp[2]&&renameSheetMap[_3DRefTmp[2]]){_3DRefTmp[2]=renameSheetMap[_3DRefTmp[2]];needAssemble=true}}var wsF=t.wb.getWorksheetByName(_3DRefTmp[1]);var wsT=null!==_3DRefTmp[2]?t.wb.getWorksheetByName(_3DRefTmp[2]):wsF;if(!(wsF&&wsT)){parseResult.setError(c_oAscError.ID.FrmlWrongReferences);if(!ignoreErrors){t.outStack=[];return false}}if(!_checkReferenceCount(null!==_3DRefTmp[2]? 3:2))return false;if(parserHelp.isArea.call(ph,t.Formula,ph.pCurrPos)){if(!(wsF&&wsT))found_operand=new cName(ph.real_str?ph.real_str.toUpperCase():ph.operand_str.toUpperCase(),t.ws);else found_operand=new cArea3D(ph.real_str?ph.real_str.toUpperCase():ph.operand_str.toUpperCase(),wsF,wsT);parseResult.addRefPos(prevCurrPos,ph.pCurrPos,t.outStack.length,found_operand)}else if(parserHelp.isRef.call(ph,t.Formula,ph.pCurrPos)){if(!(wsF&&wsT))found_operand=new cName(ph.real_str?ph.real_str.toUpperCase(): ph.operand_str.toUpperCase(),t.ws);else if(wsT!==wsF)found_operand=new cArea3D(ph.real_str?ph.real_str.toUpperCase():ph.operand_str.toUpperCase(),wsF,wsT);else found_operand=new cRef3D(ph.real_str?ph.real_str.toUpperCase():ph.operand_str.toUpperCase(),wsF);parseResult.addRefPos(prevCurrPos,ph.pCurrPos,t.outStack.length,found_operand)}else{parserHelp.isName.call(ph,t.Formula,ph.pCurrPos);found_operand=new cName3D(ph.operand_str,wsF);parseResult.addRefPos(prevCurrPos,ph.pCurrPos,t.outStack.length,found_operand)}}else if(parserHelp.isArea.call(ph, t.Formula,ph.pCurrPos)){if(!_checkReferenceCount(2))return false;found_operand=new cArea(ph.real_str?ph.real_str.toUpperCase():ph.operand_str.toUpperCase(),t.ws);parseResult.addRefPos(ph.pCurrPos-ph.operand_str.length,ph.pCurrPos,t.outStack.length,found_operand)}else if(parserHelp.isRef.call(ph,t.Formula,ph.pCurrPos)){if(!_checkReferenceCount(1))return false;found_operand=new cRef(ph.real_str?ph.real_str.toUpperCase():ph.operand_str.toUpperCase(),t.ws);parseResult.addRefPos(ph.pCurrPos-ph.operand_str.length, ph.pCurrPos,t.outStack.length,found_operand)}else if(_tableTMP=parserHelp.isTable.call(ph,t.Formula,ph.pCurrPos,local)){found_operand=cStrucTable.prototype.createFromVal(_tableTMP,t.wb,t.ws,tablesMap);if(found_operand.type===cElementType.error){parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);if(!ignoreErrors){t.outStack=[];return false}}if(!_checkReferenceCount(2))return false;if(found_operand.type!==cElementType.error)parseResult.addRefPos(ph.pCurrPos-ph.operand_str.length,ph.pCurrPos, t.outStack.length,found_operand,true)}else if(parserHelp.isName.call(ph,t.Formula,ph.pCurrPos)){if(ph.operand_str.length>g_nFormulaStringMaxLength){parseResult.setError(c_oAscError.ID.FrmlWrongOperator);if(!ignoreErrors){t.outStack=[];return false}}if(!_checkReferenceCount(.75))return false;var defName;var sDefNameOperand=ph.operand_str.replace(rx_sDefNamePref,"");var tryTranslate=AscCommonExcel.tryTranslateToPrintArea(sDefNameOperand);if(tryTranslate){found_operand=new cName(tryTranslate,t.ws);defName= found_operand.getDefName()}if(!defName){found_operand=new cName(sDefNameOperand,t.ws);defName=found_operand.getDefName()}if(defName&&defName.type===Asc.c_oAscDefNameType.table&&(_tableTMP=parserHelp.isTable(sDefNameOperand+"[]",0))){found_operand=cStrucTable.prototype.createFromVal(_tableTMP,t.wb,t.ws);needAssemble=true}parseResult.addRefPos(ph.pCurrPos-ph.operand_str.length,ph.pCurrPos,t.outStack.length,found_operand,true)}else if(parserHelp.isNumber.call(ph,t.Formula,ph.pCurrPos,digitDelim))if(ph.operand_str!== "."){var _number=parseFloat(ph.operand_str);if(!_checkReferenceCount(_number>=65536||!Number.isInteger(_number)?1.25:.5))return false;found_operand=new cNumber(_number)}else{parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);if(!ignoreErrors){t.outStack=[];return false}}else if(parserHelp.isFunc.call(ph,t.Formula,ph.pCurrPos)){if(wasRigthParentheses&&parseResult.operand_expected)elemArr.push(new cMultOperator);var found_operator=null,operandStr=ph.operand_str.replace(rx_sFuncPref,"").toUpperCase(); if(operandStr in cFormulaList)found_operator=cFormulaList[operandStr].prototype;else if(operandStr in cAllFormulaFunction)found_operator=cAllFormulaFunction[operandStr].prototype;else{found_operator=new cUnknownFunction(operandStr);found_operator.isXLFN=ph.operand_str.indexOf("_xlfn.")===0}if(found_operator!==null){var _nullArgCount=t.Formula[ph.pCurrPos+1]===")";if(!_checkReferenceCount(_nullArgCount?.6:.5))return false;if(found_operator.ca)t.ca=found_operator.ca;elemArr.push(found_operator);parseResult.addElem(found_operator); if("SUMPRODUCT"===found_operator.name)startSumproduct=true;if(needCalcArgPos)if(activePos===undefined){needFuncLevel++;activePos=ph.pCurrPos+1}else if(needFuncLevel>0)needFuncLevel++;currentFuncLevel++;levelFuncMap[currentFuncLevel]={func:found_operator,startPos:ph.pCurrPos-ph.operand_str.length};if(found_operator.argumentsType&&Asc.c_oAscFormulaArgumentType.reference===found_operator.argumentsType[0]){if(null===startArrayArg||startArrayArg>currentFuncLevel)startArrayArg=currentFuncLevel}else if(currentFuncLevel<= startArrayArg)startArrayArg=null}else{parseResult.setError(c_oAscError.ID.FrmlWrongFunctionName);if(!ignoreErrors){t.outStack=[];return false}}parseResult.operand_expected=false;wasRigthParentheses=false;return true}if(null!==found_operand){t.outStack.push(found_operand);parseResult.addElem(found_operand);parseResult.operand_expected=false;found_operand=null}else{t.outStack.push(new cError(cErrorType.wrong_name));parseResult.setError(c_oAscError.ID.FrmlAnotherParsingError);return t.isParsed=false}if(wasRigthParentheses)elemArr.push(new cMultOperator); wasLeftParentheses=false;wasRigthParentheses=false;return true};var setArgInfo=function(){if(needCalcArgPos){if(needAddCursorPos)parseResult.cursorPos=activePos;if(!parseResult.activeFunction&&levelFuncMap[currentFuncLevel]&&levelFuncMap[currentFuncLevel].startPos<=activePos&&activePos<=ph.pCurrPos+1){parseResult.activeFunction={func:levelFuncMap[currentFuncLevel].func,start:levelFuncMap[currentFuncLevel].startPos,end:ph.pCurrPos+1};parseResult.argPosArr=argPosArrMap[currentFuncLevel]}if(undefined=== parseResult.activeArgumentPos&&argFuncMap[currentFuncLevel]&&argFuncMap[currentFuncLevel].startPos<=activePos&&activePos<=ph.pCurrPos+1)parseResult.activeArgumentPos=argFuncMap[currentFuncLevel].count;var _argPos=argPosArrMap[currentFuncLevel];if(_argPos&&_argPos[_argPos.length-1]&&undefined===_argPos[_argPos.length-1].end)_argPos[_argPos.length-1].end=ph.pCurrPos}};while(ph.pCurrPos<this.Formula.length){ph.operand_str=this.Formula[ph.pCurrPos];if(ph.operand_str=="\n"){ph.pCurrPos++;continue}if(parserHelp.isOperator.call(ph, this.Formula,ph.pCurrPos)||parserHelp.isNextPtg.call(ph,this.Formula,ph.pCurrPos)){if(!parseOperators()){if(ignoreErrors)setArgInfo();return false}}else if(parserHelp.isLeftParentheses.call(ph,this.Formula,ph.pCurrPos)){parseLeftParentheses();if(ph.pCurrPos===this.Formula.length)if(elemArr[elemArr.length-2]&&0===elemArr[elemArr.length-2].argumentsMax)parseResult.operand_expected=false}else if(parserHelp.isRightParentheses.call(ph,this.Formula,ph.pCurrPos)){if(!parseRightParentheses()){if(ignoreErrors)setArgInfo(); return false}}else if(parserHelp.isComma.call(ph,this.Formula,ph.pCurrPos)){if(!parseCommaAndArgumentsUnion()){if(ignoreErrors)setArgInfo();return false}}else if(parserHelp.isLeftBrace.call(ph,this.Formula,ph.pCurrPos)){if(!parseArray()){if(ignoreErrors)setArgInfo();return false}}else if(!parseOperands()){if(ignoreErrors)setArgInfo();return false}}setArgInfo();if(parseResult.operand_expected){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlOperandExpected);return false}var operand,parenthesesNotEnough= false;while(0!==elemArr.length){operand=elemArr.pop();if("("===operand.name){this.Formula+=")";parenthesesNotEnough=true}else if("("===operand.name||")"===operand.name){this.outStack=[];parseResult.setError(c_oAscError.ID.FrmlWrongCountParentheses);return false}else this.outStack.push(operand)}if(parenthesesNotEnough){parseResult.setError(c_oAscError.ID.FrmlParenthesesCorrectCount);return this.isParsed=false}if(0!==this.outStack.length){if(needAssemble)this.Formula=this.assemble();return this.isParsed= true}else return this.isParsed=false};parserFormula.prototype.calculateCycleError=function(){this.value=new cError(cErrorType.bad_reference);this._endCalculate();return this.value};parserFormula.prototype.calculate=function(opt_defName,opt_bbox,opt_offset,checkMultiSelect){if(this.outStack.length<1){this.value=new cError(cErrorType.wrong_name);this._endCalculate();return this.value}if(!opt_bbox&&this.parent&&this.parent.onFormulaEvent)opt_bbox=this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.GetRangeCell); if(!opt_bbox)opt_bbox=new Asc.Range(0,0,0,0);var elemArr=[],_tmp,numFormat=cNumFormatFirstCell,currentElement=null,bIsSpecialFunction,argumentsCount,defNameCalcArr,defNameArgCount=0;for(var i=0;i<this.outStack.length;i++){currentElement=this.outStack[i];if(currentElement.name==="(")continue;if(currentElement.type===cElementType.specialFunctionStart){bIsSpecialFunction=true;continue}if(currentElement.type===cElementType.specialFunctionEnd){bIsSpecialFunction=false;continue}if("number"===typeof currentElement)continue; currentElement.bArrayFormula=null;if(this.ref)currentElement.bArrayFormula=true;if(currentElement.type===cElementType.operator||currentElement.type===cElementType.func){argumentsCount="number"===typeof this.outStack[i-1]?this.outStack[i-1]:currentElement.argumentsCurrent;if(argumentsCount<0){argumentsCount=-argumentsCount;currentElement.bArrayFormula=true}if(elemArr.length<argumentsCount){elemArr=[];this.value=new cError(cErrorType.unsupported_function);this._endCalculate();return this.value}else if(argumentsCount+ defNameArgCount>currentElement.argumentsMax){elemArr=[];this.value=new cError(cErrorType.wrong_value_type);this._endCalculate();return this.value}else{var arg=[];for(var ind=0;ind<argumentsCount+defNameArgCount;ind++){if("number"===typeof elemArr[elemArr.length-1])elemArr.pop();arg.unshift(elemArr.pop())}var formulaArray=null;if(currentElement.type===cElementType.func)formulaArray=cBaseFunction.prototype.checkFormulaArray.call(currentElement,arg,opt_bbox,opt_defName,this,bIsSpecialFunction,argumentsCount); else if(currentElement.type===cElementType.operator&¤tElement.bArrayFormula)bIsSpecialFunction=true;if(formulaArray)_tmp=formulaArray;else _tmp=currentElement.Calculate(arg,opt_bbox,opt_defName,this.ws,bIsSpecialFunction);if(cNumFormatNull!==_tmp.numFormat)numFormat=_tmp.numFormat;else if(0>numFormat||cNumFormatNone===currentElement.numFormat)numFormat=currentElement.numFormat;defNameArgCount=0;elemArr.push(_tmp)}}else if(currentElement.type===cElementType.name||currentElement.type===cElementType.name3D){var defName= currentElement.getDefName();if(defName&&defName.parsedRef&&this.ref)currentElement.getDefName().parsedRef.ref=this.ref;defNameCalcArr=currentElement.Calculate(null,opt_bbox,true);defNameArgCount=[];if(defNameCalcArr&&defNameCalcArr.length){defNameArgCount=defNameCalcArr.length-1;for(var j=0;j<defNameCalcArr.length;j++)elemArr.push(defNameCalcArr[j])}else elemArr.push(defNameCalcArr)}else if(currentElement.type===cElementType.table)elemArr.push(currentElement.toRef(opt_bbox));else if(opt_offset)elemArr.push(this.applyOffset(currentElement, opt_offset));else elemArr.push(currentElement)}if(checkMultiSelect&&elemArr.length>1&&this.parent&&this.parent instanceof window["AscCommonExcel"].DefName){this.value=elemArr;this._endCalculate()}else{this.value=elemArr.pop();this.value.numFormat=numFormat;var cell=arguments[3];if(this.ref&&cell&&undefined!==cell.nRow&&!(this.ref.r1===cell.nRow&&this.ref.c1===cell.nCol)){var oldParent=this.parent;this.parent=new AscCommonExcel.CCellWithFormula(cell.ws,cell.nRow,cell.nCol);this._endCalculate();this.parent= oldParent}else this._endCalculate()}return this.value};parserFormula.prototype._endCalculate=function(){if(this.parent&&this.parent.onFormulaEvent)this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.EndCalculate)};parserFormula.prototype.changeOffset=function(offset,canResize,nChangeTable,notOffset3d){var t=this;for(var i=0;i<t.outStack.length;i++){var doOffset=true;if(notOffset3d&&t.outStack[i]&&(t.outStack[i].type===cElementType.cell3D||t.outStack[i].type===cElementType.cellsRange3D))doOffset= false;if(doOffset)t._changeOffsetElem(t.outStack[i],t.outStack,i,offset,canResize,nChangeTable)}return this};parserFormula.prototype._changeOffsetElem=function(elem,container,index,offset,canResize,nChangeTable){var range,bbox=null,ws,isErr=false;if(cElementType.cell===elem.type||cElementType.cell3D===elem.type||cElementType.cellsRange===elem.type){isErr=true;range=elem.getRange();if(range){bbox=range.getBBox0();ws=range.getWorksheet()}}else if(cElementType.cellsRange3D===elem.type){isErr=true;bbox= elem.getBBox0NoCheck()}else if(cElementType.table===elem.type&&!nChangeTable){elem.setOffset(offset);elem._updateArea(null,false)}if(bbox){bbox=bbox.clone();if(bbox.setOffsetWithAbs(offset,canResize)){isErr=false;this.changeOffsetBBox(elem,bbox,ws)}}if(isErr)container[index]=new cError(cErrorType.bad_reference);return elem};parserFormula.prototype.applyOffset=function(currentElement,offset){var res=currentElement;var cloneElem=null;var bbox=null;var ws;if(cElementType.cell===currentElement.type|| cElementType.cell3D===currentElement.type||cElementType.cellsRange===currentElement.type){var range=currentElement.getRange();if(range){bbox=range.getBBox0();ws=range.getWorksheet();if(!bbox.isAbsAll()){cloneElem=currentElement.clone();bbox=cloneElem.getRange().getBBox0()}}}else if(cElementType.cellsRange3D===currentElement.type){bbox=currentElement.getBBox0NoCheck();if(bbox&&!bbox.isAbsAll()){cloneElem=currentElement.clone();bbox=cloneElem.getBBox0NoCheck()}}if(cloneElem){bbox.setOffsetWithAbs(offset, false,true);this.changeOffsetBBox(cloneElem,bbox,ws);res=cloneElem}return res};parserFormula.prototype.changeOffsetBBox=function(elem,bbox,ws){if(cElementType.cellsRange3D===elem.type)elem.bbox=bbox;else elem.range=AscCommonExcel.Range.prototype.createFromBBox(ws,bbox);elem.value=bbox.getName()};parserFormula.prototype.changeDefName=function(from,to){var i,elem;for(i=0;i<this.outStack.length;i++){elem=this.outStack[i];if(elem.type===cElementType.name||elem.type===cElementType.name3D||elem.type=== cElementType.table)elem.changeDefName(from,to)}};parserFormula.prototype.removeTableName=function(defName,bConvertTableFormulaToRef){var i,elem;var bbox;if(this.parent&&this.parent.onFormulaEvent)bbox=this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.GetRangeCell);for(i=0;i<this.outStack.length;i++){elem=this.outStack[i];if(elem.type===cElementType.table&&elem.tableName.toLowerCase()===defName.name.toLowerCase())if(bConvertTableFormulaToRef)this.outStack[i]=this.outStack[i].toRef(bbox,bConvertTableFormulaToRef); else this.outStack[i]=new cError(cErrorType.bad_reference)}};parserFormula.prototype.removeTableColumn=function(tableName,deleted){var i,elem;for(i=0;i<this.outStack.length;i++){elem=this.outStack[i];if(elem.type===cElementType.table&&tableName&&elem.tableName.toLowerCase()===tableName.toLowerCase())if(elem.removeTableColumn(deleted))this.outStack[i]=new cError(cErrorType.bad_reference)}};parserFormula.prototype.renameTableColumn=function(tableName){var i,elem;for(i=0;i<this.outStack.length;i++){elem= this.outStack[i];if(elem.type===cElementType.table&&tableName&&elem.tableName.toLowerCase()===tableName.toLowerCase())if(!elem.renameTableColumn())this.outStack[i]=new cError(cErrorType.bad_reference)}};parserFormula.prototype.changeTableRef=function(tableName){var i,elem;for(i=0;i<this.outStack.length;i++){elem=this.outStack[i];if(elem.type===cElementType.table&&tableName&&elem.tableName.toLowerCase()===tableName.toLowerCase())elem.changeTableRef()}};parserFormula.prototype.shiftCells=function(notifyType, sheetId,bbox,offset,opt_sheetIdTo,opt_isPivot){var res=false;var elem,bboxCell;var wb=this.ws.workbook;if(!opt_sheetIdTo)opt_sheetIdTo=sheetId;var ws=wb.getWorksheetById(sheetId);var wsTo=wb.getWorksheetById(opt_sheetIdTo);for(var i=0;i<this.outStack.length;i++){elem=this.outStack[i];var _cellsRange=null;var _cellsBbox=null;if(elem.type===cElementType.cell||elem.type===cElementType.cellsRange){if(sheetId===elem.getWsId()&&elem.isValid()){_cellsRange=elem.getRange();if(_cellsRange)_cellsBbox=_cellsRange.getBBox0()}}else if(elem.type=== cElementType.cell3D){if(sheetId===elem.getWsId()&&elem.isValid()){_cellsRange=elem.getRange();if(_cellsRange)_cellsBbox=_cellsRange.getBBox0()}}else if(elem.type===cElementType.cellsRange3D)if(elem.isSingleSheet()&&sheetId===elem.wsFrom.getId()&&elem.isValid())_cellsBbox=elem.getBBox0();if(_cellsRange||_cellsBbox){var isIntersect;if(AscCommon.c_oNotifyType.Shift===notifyType)isIntersect=bbox.isIntersectForShift(_cellsBbox,offset);else if(AscCommon.c_oNotifyType.Move===notifyType)isIntersect=bbox.containsRange(_cellsBbox); else if(AscCommon.c_oNotifyType.Delete===notifyType)isIntersect=bbox.isIntersect(_cellsBbox);if(isIntersect){var isNoDelete;if(AscCommon.c_oNotifyType.Shift===notifyType)isNoDelete=_cellsBbox.forShift(bbox,offset,this.wb.bUndoChanges);else if(AscCommon.c_oNotifyType.Move===notifyType){_cellsBbox.setOffset(offset);isNoDelete=true}else if(AscCommon.c_oNotifyType.Delete===notifyType)if(bbox.containsRange(_cellsBbox))isNoDelete=false;else{isNoDelete=true;if(!this.wb.bUndoChanges){var ltIn=bbox.contains(_cellsBbox.c1, _cellsBbox.r1);var rtIn=bbox.contains(_cellsBbox.c2,_cellsBbox.r1);var lbIn=bbox.contains(_cellsBbox.c1,_cellsBbox.r2);var rbIn=bbox.contains(_cellsBbox.c2,_cellsBbox.r2);if(ltIn&&rtIn&&bbox.r1!==_cellsBbox.r1)_cellsBbox.setOffsetFirst(new AscCommon.CellBase(bbox.r2-_cellsBbox.r1+1,0));else if(rtIn&&rbIn&&bbox.c2!==_cellsBbox.c2)_cellsBbox.setOffsetLast(new AscCommon.CellBase(0,bbox.c1-_cellsBbox.c2-1));else if(rbIn&&lbIn&&bbox.r2!==_cellsBbox.r2)_cellsBbox.setOffsetLast(new AscCommon.CellBase(bbox.r1- _cellsBbox.r2-1,0));else if(lbIn&<In&&bbox.c1!==_cellsBbox.c1)_cellsBbox.setOffsetFirst(new AscCommon.CellBase(0,bbox.c2-_cellsBbox.c1+1))}}if(isNoDelete){if(sheetId!==opt_sheetIdTo&&(elem.type===cElementType.cell||elem.type===cElementType.cellsRange)){bboxCell=null;if(this.parent&&this.parent.onFormulaEvent)bboxCell=this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.GetRangeCell);if(!bboxCell||!bbox.containsRange(bboxCell))if(this.wb.bUndoChanges)elem.changeSheet(ws,wsTo);else{elem=elem.to3D(wsTo); this.outStack[i]=elem}}if(elem.type===cElementType.cellsRange3D){elem.bbox=_cellsBbox;var isDefName;if(this.parent&&this.parent.onFormulaEvent)isDefName=this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.IsDefName);if(null===isDefName)elem.changeSheet(ws,wsTo)}else elem.range=_cellsRange.createFromBBox(wsTo,_cellsBbox);elem.value=_cellsBbox.getName()}else if(!opt_isPivot)this.outStack[i]=new cError(cErrorType.bad_reference);res=true}}}return res};parserFormula.prototype.getSharedIntersect=function(sheetId, bbox){var ref;var elem;var bboxElem;for(var i=0;i<this.outStack.length;i++){elem=this.outStack[i];bboxElem=undefined;if(elem.type===cElementType.cell||elem.type===cElementType.cellsRange||elem.type===cElementType.cell3D){if(sheetId===elem.getWsId()&&elem.isValid())bboxElem=elem.getRange().getBBox0()}else if(elem.type===cElementType.cellsRange3D)if(elem.isSingleSheet()&&sheetId===elem.wsFrom.getId()&&elem.isValid())bboxElem=elem.getBBox0();if(bboxElem){var sharedBBox=bboxElem.getSharedRangeBbox(this.shared.ref, this.shared.base);var intersection=bbox.intersection(sharedBBox);if(intersection){var bboxSharedRef=sharedBBox.getSharedIntersect(this.shared.ref,intersection);ref=ref?bboxSharedRef.union(ref):bboxSharedRef}}}return ref};parserFormula.prototype.canShiftShared=function(bHor){if(this.shared&&this.shared.isOneDimension()&&!(bHor^this.shared.isHor())){var elem;var bboxElem;for(var i=0;i<this.outStack.length;i++){elem=this.outStack[i];bboxElem=undefined;if(elem.type===cElementType.cell||elem.type===cElementType.cellsRange|| elem.type===cElementType.cell3D){if(elem.isValid())bboxElem=elem.getRange().getBBox0()}else if(elem.type===cElementType.cellsRange3D)if(elem.isValid())bboxElem=elem.getBBox0();if(bboxElem)if(bHor){if(bboxElem.isAbsC1()||bboxElem.isAbsC2())return false}else if(bboxElem.isAbsR1()||bboxElem.isAbsR2())return false}return true}return false};parserFormula.prototype.renameSheetCopy=function(params){var wsLast=params.lastName?this.wb.getWorksheetByName(params.lastName):null;var wsNew=params.newName?this.wb.getWorksheetByName(params.newName): null;var isInDependencies=this.isInDependencies;if(isInDependencies)this.removeDependencies();for(var i=0;i<this.outStack.length;i++){var elem=this.outStack[i];if(params.offset&&(cElementType.cell===elem.type||cElementType.cellsRange===elem.type||cElementType.cell3D===elem.type||cElementType.cellsRange3D===elem.type))elem=this._changeOffsetElem(elem,this.outStack,i,params.offset);if(params.tableNameMap&&cElementType.table===elem.type){var newTableName=params.tableNameMap[elem.tableName];if(newTableName)elem.tableName= newTableName}if(wsLast&&wsNew)if(cElementType.cell===elem.type||cElementType.cell3D===elem.type||cElementType.cellsRange===elem.type||cElementType.table===elem.type||cElementType.name===elem.type||cElementType.name3D===elem.type)elem.changeSheet(wsLast,wsNew);else if(cElementType.cellsRange3D===elem.type)if(elem.isSingleSheet())elem.changeSheet(wsLast,wsNew);else if(elem.wsFrom===wsLast||elem.wsTo===wsLast)this.outStack[i]=new cError(cErrorType.bad_reference)}if(isInDependencies)this.buildDependencies(); return this};parserFormula.prototype.moveToSheet=function(wsLast,wsNew,tableNameMap){var isInDependencies=this.isInDependencies;if(isInDependencies)this.removeDependencies();if(this.ws===wsLast)this.ws=wsNew;for(var i=0;i<this.outStack.length;i++){var elem=this.outStack[i];if(tableNameMap&&cElementType.table===elem.type){var newTableName=tableNameMap[elem.tableName];if(newTableName)elem.tableName=newTableName}if(wsLast&&wsNew)if(cElementType.cell===elem.type||cElementType.cellsRange===elem.type|| cElementType.table===elem.type||cElementType.name===elem.type)elem.changeSheet(wsLast,wsNew)}if(isInDependencies)this.buildDependencies();return this};parserFormula.prototype.removeSheet=function(sheetId,tableNamesMap){var bRes=false;var ws=this.wb.getWorksheetById(sheetId);if(ws){var wsIndex=ws.getIndex();var wsPrev=this.wb.getWorksheet(wsIndex-1);var wsNext=this.wb.getWorksheet(wsIndex+1);for(var i=0;i<this.outStack.length;i++){var elem=this.outStack[i];if(cElementType.cellsRange3D===elem.type)if(elem.wsFrom=== ws){if(!elem.isSingleSheet()&&null!==wsNext)elem.changeSheet(ws,wsNext);else this.outStack[i]=new cError(cErrorType.bad_reference);bRes=true}else{if(elem.wsTo===ws){if(null!==wsPrev)elem.changeSheet(ws,wsPrev);else this.outStack[i]=new cError(cErrorType.bad_reference);bRes=true}}else if(cElementType.cell3D===elem.type||cElementType.name3D===elem.type){if(elem.getWS()===ws){this.outStack[i]=new cError(cErrorType.bad_reference);bRes=true}}else if(cElementType.table===elem.type)if(tableNamesMap[elem.tableName]){this.outStack[i]= new cError(cErrorType.bad_reference);bRes=true}}}return bRes};parserFormula.prototype.moveSheet=function(tempW){var bRes=false;for(var i=0;i<this.outStack.length;i++){var elem=this.outStack[i];if(cElementType.cellsRange3D===elem.type){var wsToIndex=elem.wsTo.getIndex();var wsFromIndex=elem.wsFrom.getIndex();if(!elem.isSingleSheet())if(elem.wsFrom===tempW.wF){if(tempW.wTI>wsToIndex){bRes=true;var wsNext=this.wb.getWorksheet(wsFromIndex+1);if(wsNext)elem.changeSheet(tempW.wF,wsNext);else this.outStack[i]= new cError(cErrorType.bad_reference)}}else if(elem.wsTo===tempW.wF)if(tempW.wTI<=wsFromIndex){bRes=true;var wsPrev=this.wb.getWorksheet(wsToIndex-1);if(wsPrev)elem.changeSheet(tempW.wF,wsPrev);else this.outStack[i]=new cError(cErrorType.bad_reference)}}}return bRes};parserFormula.prototype.assemble=function(rFormula){if(!rFormula&&this.outStack.length===1&&this.outStack[this.outStack.length-1]instanceof cError)return this.Formula;return this._assembleExec()};parserFormula.prototype.assembleLocale= function(locale,digitDelim){if(this.outStack.length===1&&this.outStack[this.outStack.length-1]instanceof cError)return this.Formula;return this._assembleExec(locale,digitDelim,true)};parserFormula.prototype._assembleExec=function(locale,digitDelim,bLocale){var currentElement=null,_count=this.outStack.length,elemArr=new Array(_count),res=undefined,_count_arg,_numberPrevArg,_argDiff,onlyRangesElements=true,rangesStr;var formulaArray=this.getArrayFormulaRef();var oldActiveCell;if(AscCommonExcel.g_R1C1Mode&& bLocale&&formulaArray){AscCommonExcel.g_ActiveCell=new Asc.Range(formulaArray.c1,formulaArray.r1,formulaArray.c1,formulaArray.r1);oldActiveCell=AscCommonExcel.g_ActiveCell}for(var i=0,j=0;i<_count;i++){currentElement=this.outStack[i];if(currentElement.type!==cElementType.cellsRange3D&¤tElement.type!==cElementType.cell3D&¤tElement.type!==cElementType.name&¤tElement.type!==cElementType.name3D){onlyRangesElements=false;rangesStr=null}if(currentElement.type===cElementType.specialFunctionStart|| currentElement.type===cElementType.specialFunctionEnd)continue;else if("number"===typeof currentElement){j++;continue}j++;if(currentElement.type===cElementType.operator||currentElement.type===cElementType.func){_numberPrevArg="number"===typeof this.outStack[i-1]?Math.abs(this.outStack[i-1]):null;_count_arg=null!==_numberPrevArg?_numberPrevArg:currentElement.argumentsCurrent;_argDiff=0;if(null!==_numberPrevArg)_argDiff++;if(j-_count_arg-_argDiff<0)continue;if(bLocale)res=currentElement.Assemble2Locale(elemArr, j-_count_arg-_argDiff,_count_arg,locale,digitDelim);else res=currentElement.Assemble2(elemArr,j-_count_arg-_argDiff,_count_arg);j-=_count_arg+_argDiff;elemArr[j]=res}else{if(cElementType.string===currentElement.type)if(bLocale)currentElement=new cString('"'+currentElement.toLocaleString(digitDelim)+'"');else currentElement=new cString('"'+currentElement.toString()+'"');res=currentElement;elemArr[j]=res;if(onlyRangesElements){rangesStr=!rangesStr?"":rangesStr+",";rangesStr+=bLocale?res.toLocaleString(digitDelim): res.toString()}}}if(res!=undefined&&res!=null)if(rangesStr)res=rangesStr;else res=bLocale?res.toLocaleString(digitDelim):res.toString();else res=this.Formula;if(oldActiveCell)AscCommonExcel.g_ActiveCell=oldActiveCell;return res};parserFormula.prototype.buildDependencies=function(){if(this.isInDependencies)return;this.isInDependencies=true;var ref,wsR;if(this.ca)this.wb.dependencyFormulas.startListeningVolatile(this);var isDefName;if(this.parent&&this.parent.onFormulaEvent)isDefName=this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.IsDefName); for(var i=0;i<this.outStack.length;i++){ref=this.outStack[i];if(ref.type===cElementType.table)this.wb.dependencyFormulas.startListeningDefName(ref.tableName,this);else if(ref.type===cElementType.name)this.wb.dependencyFormulas.startListeningDefName(ref.value,this);else if(ref.type===cElementType.name3D)this.wb.dependencyFormulas.startListeningDefName(ref.value,this,ref.ws.getId());else if((cElementType.cell===ref.type||cElementType.cell3D===ref.type||cElementType.cellsRange===ref.type)&&ref.isValid())this._buildDependenciesRef(ref.getWsId(), ref.getRange().getBBox0(),isDefName,true);else if(cElementType.cellsRange3D===ref.type&&ref.isValid()){wsR=ref.range(ref.wsRange());for(var j=0;j<wsR.length;j++){var range=wsR[j];if(range)this._buildDependenciesRef(range.getWorksheet().getId(),range.getBBox0(),isDefName,true)}}}};parserFormula.prototype.removeDependencies=function(){if(!this.isInDependencies)return;this.isInDependencies=false;var ref;var wsR;if(this.ca)this.wb.dependencyFormulas.endListeningVolatile(this);var isDefName;if(this.parent&& this.parent.onFormulaEvent)isDefName=this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.IsDefName);for(var i=0;i<this.outStack.length;i++){ref=this.outStack[i];if(ref.type===cElementType.table)this.wb.dependencyFormulas.endListeningDefName(ref.tableName,this);else if(ref.type===cElementType.name)this.wb.dependencyFormulas.endListeningDefName(ref.value,this);else if(ref.type===cElementType.name3D)this.wb.dependencyFormulas.endListeningDefName(ref.value,this,ref.ws.getId());else if((cElementType.cell=== ref.type||cElementType.cell3D===ref.type||cElementType.cellsRange===ref.type)&&ref.isValid())this._buildDependenciesRef(ref.getWsId(),ref.getRange().getBBox0(),isDefName,false);else if(cElementType.cellsRange3D===ref.type&&ref.isValid()){wsR=ref.range(ref.wsRange());for(var j=0;j<wsR.length;j++){var range=wsR[j];if(range)this._buildDependenciesRef(range.getWorksheet().getId(),range.getBBox0(),isDefName,false)}}}};parserFormula.prototype._buildDependenciesRef=function(wsId,bbox,isDefName,isStart){if(this.isTable){bbox= bbox.clone();bbox.setOffsetFirst(new AscCommon.CellBase(-1,0));bbox.setOffsetLast(new AscCommon.CellBase(1,0))}if(isDefName){var bboxes=this.extendBBoxCF(isDefName,bbox);for(var k=0;k<bboxes.length;++k)if(isStart)this.wb.dependencyFormulas.startListeningRange(wsId,bboxes[k],this);else this.wb.dependencyFormulas.endListeningRange(wsId,bboxes[k],this)}else{bbox=this.extendBBoxDefName(isDefName,bbox);if(this.shared)bbox=bbox.getSharedRangeBbox(this.shared.ref,this.shared.base);if(isStart)this.wb.dependencyFormulas.startListeningRange(wsId, bbox,this);else this.wb.dependencyFormulas.endListeningRange(wsId,bbox,this)}};parserFormula.prototype.extendBBoxDefName=function(isDefName,bbox){if(null===isDefName&&!bbox.isAbsAll()){bbox=bbox.clone();if(!bbox.isAbsR1()||!bbox.isAbsR2()){bbox.r1=0;bbox.r2=AscCommon.gc_nMaxRow0}if(!bbox.isAbsC1()||!bbox.isAbsC2()){bbox.c1=0;bbox.c2=AscCommon.gc_nMaxCol0}}return bbox};parserFormula.prototype.extendBBoxCF=function(isDefName,bbox){var res=[];if(!bbox.isAbsAll()){var bboxCf=isDefName.bbox;var ranges= isDefName.ranges;var rowLT=bboxCf?bboxCf.r1:0;var colLT=bboxCf?bboxCf.c1:0;for(var i=0;i<ranges.length;++i){var range=ranges[i];var newBBoxLT=bbox.clone();newBBoxLT.setOffsetWithAbs(new AscCommon.CellBase(range.r1-rowLT,range.c1-colLT),false,true);var newBBoxRB=newBBoxLT.clone();newBBoxRB.setOffsetWithAbs(new AscCommon.CellBase(range.r2-range.r1,range.c2-range.c1),false,true);var newBBox=new Asc.Range(newBBoxLT.c1,newBBoxLT.r1,newBBoxRB.c2,newBBoxRB.r2);if(!(bbox.r1<=newBBoxLT.r1&&newBBoxLT.r1<=newBBoxLT.r2&& newBBoxLT.r1<=newBBoxRB.r1&&newBBoxRB.r1<=newBBoxRB.r2)){newBBox.r1=0;newBBox.r2=AscCommon.gc_nMaxRow0}if(!(bbox.c1<=newBBoxLT.c1&&newBBoxLT.c1<=newBBoxLT.c2&&newBBoxLT.c1<=newBBoxRB.c1&&newBBoxRB.c1<=newBBoxRB.c2)){newBBox.c1=0;newBBox.c2=AscCommon.gc_nMaxCol0}res.push(newBBox)}}else res.push(bbox);return res};parserFormula.prototype.getFirstRange=function(){var res;for(var i=0;i<this.outStack.length;i++){var elem=this.outStack[i];if(cElementType.cell===elem.type||cElementType.cell3D===elem.type|| cElementType.cellsRange===elem.type||cElementType.cellsRange3D===elem.type){res=elem.getRange();break}}return res};parserFormula.prototype.getOutStackSize=function(){return this.outStack.length};parserFormula.prototype.getOutStackElem=function(index){return this.outStack[index]};parserFormula.prototype.getIndexNumber=function(){return this._index};parserFormula.prototype.setIndexNumber=function(val){this._index=val};parserFormula.prototype.canSaveShared=function(){for(var i=0;i<this.outStack.length;i++){var elem= this.outStack[i];if(cElementType.cell3D===elem.type||cElementType.cellsRange3D===elem.type||cElementType.table===elem.type||cElementType.name3D===elem.type||cElementType.error===elem.type||cElementType.array===elem.type)return false}return true};parserFormula.prototype.getArrayFormulaRef=function(){return this.ref};parserFormula.prototype.setArrayFormulaRef=function(ref){this.ref=ref};parserFormula.prototype.checkFirstCellArray=function(cell){var res=null;if(this.ref)if(this.parent&&cell.nCol===this.ref.c1&& cell.nRow===this.ref.r1)res=true;return res};parserFormula.prototype.transpose=function(bounds){for(var i=0;i<this.outStack.length;i++){var elem=this.outStack[i];var range;if(cElementType.cellsRange===elem.type||cElementType.cell===elem.type||cElementType.cell3D===elem.type)range=elem.range&&elem.range.bbox?elem.range.bbox:null;else if(cElementType.cellsRange3D===elem.type)range=elem.bbox?elem.bbox:null;if(range){var diffCol1=range.c1-bounds.c1;var diffRow1=range.r1-bounds.r1;var diffCol2=range.c2- bounds.c1;var diffRow2=range.r2-bounds.r1;range.c1=bounds.c1+diffRow1;range.r1=bounds.r1+diffCol1;range.c2=bounds.c1+diffRow2;range.r2=bounds.r1+diffCol2}}};parserFormula.prototype.isFoundNestedStAg=function(){for(var i=0;i<this.outStack.length;i++)if(this.outStack[i]&&(this.outStack[i].name==="AGGREGATE"||this.outStack[i].name==="SUBTOTAL"))return true;return false};parserFormula.prototype.simplifyRefType=function(val,opt_ws,opt_row,opt_col){var ref=this.getArrayFormulaRef(),row,col;if(cElementType.cell=== val.type||cElementType.cell3D===val.type){val=val.getValue();if(cElementType.empty===val.type&&opt_ws)val=new cNumber(0)}else if(cElementType.array===val.type){if(ref&&opt_ws){row=1===val.array.length?0:opt_row-ref.r1;col=1===val.array[0].length?0:opt_col-ref.c1;if(val.array[row]&&val.array[row][col])val=val.getElementRowCol(row,col);else val=new window["AscCommonExcel"].cError(window["AscCommonExcel"].cErrorType.not_available)}else val=val.getElement(0);if(cElementType.cellsRange===val.type||cElementType.cellsRange3D=== val.type||cElementType.array===val.type||cElementType.cell===val.type||cElementType.cell3D===val.type)val=this.simplifyRefType(val,opt_ws,opt_row,opt_col)}else if(cElementType.cellsRange===val.type||cElementType.cellsRange3D===val.type)if(opt_ws){var range;if(ref){range=val.getRange();if(range){var bbox=range.bbox;var rowCount=bbox.r2-bbox.r1+1;var colCount=bbox.c2-bbox.c1+1;row=1===rowCount?0:opt_row-ref.r1;col=1===colCount?0:opt_col-ref.c1;val=val.getValueByRowCol(row,col);if(!val)val=new window["AscCommonExcel"].cError(window["AscCommonExcel"].cErrorType.not_available)}else val= new window["AscCommonExcel"].cError(window["AscCommonExcel"].cErrorType.not_available)}else{range=new Asc.Range(opt_col,opt_row,opt_col,opt_row);val=val.cross(range,opt_ws.getId())}}else if(cElementType.cellsRange===val.type)val=val.getValue2(0,0);else val=val.getValue2(new CellAddress(val.getBBox0().r1,val.getBBox0().c1,0));return val};parserFormula.prototype.convertTo3DRefs=function(bboxFrom){var elem,bbox;for(var i=0;i<this.outStack.length;i++){elem=this.outStack[i];if(elem.type===cElementType.cell|| elem.type===cElementType.cellsRange){bbox=elem.getBBox0();if(!bboxFrom.containsRange(bbox))this.outStack[i]=elem.to3D()}}};parserFormula.prototype.hasRelativeRefs=function(){var elem;for(var i=0;i<this.outStack.length;i++){elem=this.outStack[i];if((elem.type===cElementType.cell||elem.type===cElementType.cellsRange||elem.type===cElementType.cell3D||elem.type===cElementType.cellsRange3D)&&!elem.getBBox0().isAbsAll())return true}return false};parserFormula.prototype.getFormulaHyperlink=function(){for(var i= 0;i<this.outStack.length;i++)if(this.outStack[i]&&this.outStack[i].name==="HYPERLINK")return true;return false};parserFormula.prototype.getOutsideFunctions=function(){var res;var funcArr=[];var depth=0;for(var i=0;i<this.outStack.length;i++){var elem=this.outStack[i];if(cElementType.func===elem.type){if(depth===0)funcArr.push(elem);depth++}}return res};function CalcRecursion(){this.level=0;this.elemsPart=[];this.elems=[];this.isForceBacktracking=false;this.isProcessRecursion=false}CalcRecursion.prototype.MAXRECURSION= 300;CalcRecursion.prototype.incLevel=function(){if(this.getIsForceBacktracking())return false;var res=this.level<=CalcRecursion.prototype.MAXRECURSION;if(res)this.level++;else this.setIsForceBacktracking(true);return res};CalcRecursion.prototype.decLevel=function(){this.level--};CalcRecursion.prototype.getLevel=function(){return this.level};CalcRecursion.prototype.insert=function(val){this.elemsPart.push(val)};CalcRecursion.prototype.foreachInReverse=function(callback){for(var i=this.elems.length- 1;i>=0;--i){var elemsPart=this.elems[i];for(var j=0;j<elemsPart.length;++j){callback(elemsPart[j]);if(this.getIsForceBacktracking())return}}};CalcRecursion.prototype.setIsForceBacktracking=function(val){if(!this.isForceBacktracking){this.elemsPart=[];this.elems.push(this.elemsPart)}this.isForceBacktracking=val};CalcRecursion.prototype.getIsForceBacktracking=function(){return this.isForceBacktracking};CalcRecursion.prototype.setIsProcessRecursion=function(val){this.isProcessRecursion=val};CalcRecursion.prototype.getIsProcessRecursion= function(){return this.isProcessRecursion};var g_cCalcRecursion=new CalcRecursion;function parseNum(str){if(str.indexOf("x")>-1||str==""||str.match(/\s+/))return false;return!isNaN(str)}var matchingOperators=new RegExp("^(=|<>|<=|>=|<|>).*");function matchingValue(oVal){var res;if(cElementType.string===oVal.type){var search,op;var val=oVal.getValue();var match=val.match(matchingOperators);if(match){search=val.substr(match[1].length);op=match[1].replace(/\s/g,"")}else{search=val;op=null}var parseRes= AscCommon.g_oFormatParser.parse(search);res={val:parseRes?new cNumber(parseRes.value):new cString(search),op:op}}else res={val:oVal,op:null};return res}function matching(x,matchingInfo,doNotParseNum){var y=matchingInfo.val;var operator=matchingInfo.op;var res=false,rS;if(cElementType.string===y.type){if("<"===operator||">"===operator||"<="===operator||">="===operator){var _funcVal=_func[x.type][y.type](x,y,operator);if(cElementType.error===_funcVal.type)return false;return _funcVal.toBool()}y=y.toString(); if(cElementType.empty===x.type&&""===y)rS=true;else if(cElementType.bool===x.type){x=x.tocString();rS=x.value===y}else if(cElementType.error===x.type)rS=x.value===y;else rS=cElementType.string===x.type?searchRegExp2(x.value,y):false;switch(operator){case "<>":res=!rS;break;case "=":default:res=rS;break}}else if(cElementType.number===y.type){rS=x.type===y.type;switch(operator){case "<>":res=!rS||x.value!=y.value;break;case ">":res=rS&&x.value>y.value;break;case "<":res=rS&&x.value<y.value;break;case ">=":res= rS&&x.value>=y.value;break;case "<=":res=rS&&x.value<=y.value;break;case "=":default:if(cElementType.string===x.type)x=x.tocNumber(doNotParseNum);res=x.value===y.value;break}}else if(cElementType.bool===y.type||cElementType.error===y.type)if(y.type===x.type&&x.value===y.value)res=true;return res}function GetDiffDate360(nDay1,nMonth1,nYear1,nDay2,nMonth2,nYear2,bUSAMethod){var nDayDiff;var startTime=new Date(nYear1,nMonth1-1,nDay1),endTime=new Date(nYear2,nMonth2-1,nDay2),nY,nM,nD;if(startTime>endTime){nY= nYear1;nYear1=nYear2;nYear2=nY;nM=nMonth1;nMonth1=nMonth2;nMonth2=nM;nD=nDay1;nDay1=nDay2;nDay2=nD}if(bUSAMethod){if(nDay1==31)nDay1--;if(nDay1==30&&nDay2==31)nDay2--;else if(nMonth1==2&&nDay1==((new cDate(nYear1,0,1)).isLeapYear()?29:28)){nDay1=30;if(nMonth2==2&&nDay2==((new cDate(nYear2,0,1)).isLeapYear()?29:28))nDay2=30}}else{if(nDay1==31)nDay1--;if(nDay2==31)nDay2--}nDayDiff=(nYear2-nYear1)*360+(nMonth2-nMonth1)*30+(nDay2-nDay1);return nDayDiff}function searchRegExp2(s,mask){var bRes=true;s=s.toString().toLowerCase(); mask=mask.toString().toLowerCase();var cCurMask;var nSIndex=0;var nMaskIndex=0;var nSLastIndex=0;var nMaskLastIndex=0;var nSLength=s.length;var nMaskLength=mask.length;var t=false;for(;nSIndex<nSLength;nMaskIndex++,nSIndex++,t=false){cCurMask=mask[nMaskIndex];if("~"===cCurMask){nMaskIndex++;cCurMask=mask[nMaskIndex];t=true}else if("*"===cCurMask)break;if(cCurMask!==s[nSIndex]&&"?"!==cCurMask||cCurMask!==s[nSIndex]&&t){bRes=false;break}}if(bRes)while(1){cCurMask=mask[nMaskIndex];if(nSIndex>=nSLength){while("*"=== cCurMask&&nMaskIndex<nMaskLength){nMaskIndex++;cCurMask=mask[nMaskIndex]}bRes=nMaskIndex>=nMaskLength;break}else if("*"===cCurMask){nMaskIndex++;if(nMaskIndex>=nMaskLength){bRes=true;break}nSLastIndex=nSIndex+1;nMaskLastIndex=nMaskIndex}else if(cCurMask!==s[nSIndex]&&"?"!==cCurMask){nMaskIndex=nMaskLastIndex;nSIndex=nSLastIndex++}else{nSIndex++;nMaskIndex++}}return bRes}function lcl_Erf0065(x){var pn=[1.1283791670955126,.13589488762727792,.04032594885317953,.0012033938086307946,6.492545564819044E-5], qn=[1,.45376704178000254,.08699362226153859,.008497173711686934,3.649152806293511E-4];var pSum=0,qSum=0,xPow=1;for(var i=0;i<=4;++i){pSum+=pn[i]*xPow;qSum+=qn[i]*xPow;xPow*=x*x}return x*pSum/qSum}function lcl_Erfc0600(x){var pSum=0,qSum=0,xPow=1,pn,qn;if(x<2.2){pn=[.9999999920497991,1.3315416393676531,.8781158041558818,.3318995595782132,.0714193832506776,.007069408437632531];qn=[1,2.459920701442455,2.6538397286977573,1.6187665554387138,.5946513112864815,.12657941303017795,.01253049365494134]}else{pn= [.9999211400097144,1.6235658448936665,1.2673990145587322,.5815285741777412,.1572896207428387,.022571698291921755];qn=[1,2.751438706763762,3.3736733465728452,2.385741947853444,1.050740046148272,.278788439273629,.040007296452686136]}for(var i=0;i<6;++i){pSum+=pn[i]*xPow;qSum+=qn[i]*xPow;xPow*=x}qSum+=qn[6]*xPow;return Math.exp(-1*x*x)*pSum/qSum}function lcl_Erfc2654(x){var pn=[.5641895835477561,8.802537461055257,38.46831037161173,47.720996587443636,8.080407290523016],qn=[1,16.102091420586902,75.48435056659548, 112.12387080102602,37.39975701450408];var pSum=0,qSum=0,xPow=1;for(var i=0;i<=4;++i){pSum+=pn[i]*xPow;qSum+=qn[i]*xPow;xPow/=x*x}return Math.exp(-1*x*x)*pSum/(x*qSum)}function rtl_math_erf(x){if(x==0)return 0;var bNegative=false;if(x<0){x=Math.abs(x);bNegative=true}var res=1;if(x<1E-10)res=parseFloat(x*1.1283791670955126);else if(x<.65)res=lcl_Erf0065(x);else res=1-rtl_math_erfc(x);if(bNegative)res*=-1;return res}function rtl_math_erfc(x){if(x==0)return 1;var bNegative=false;if(x<0){x=Math.abs(x); bNegative=true}var fErfc=0;if(x>=.65)if(x<6)fErfc=lcl_Erfc0600(x);else fErfc=lcl_Erfc2654(x);else fErfc=1-rtl_math_erf(x);if(bNegative)fErfc=2-fErfc;return fErfc}function getArrayMax(array){return Math.max.apply(null,array)}function getArrayMin(array){return Math.min.apply(null,array)}function compareFormula(formula1,refPos1,formula2,offsetRow){if(formula1.length===formula2.length){var index=0;var i,j,bbox,bboxRef,bboxPrev,_3DRefTmp,wsF,wsT;for(i=0;i<refPos1.length;++i){var refPos=refPos1[i];if(!refPos.isName&& refPos.oper){for(j=index;j<refPos.start;++j)if(formula1[j]!==formula2[j])return false;switch(refPos.oper.type){case cElementType.cell:case cElementType.cellsRange:bboxRef=formula2.substring(refPos.start,refPos.end);bbox=AscCommonExcel.g_oRangeCache.getAscRange(bboxRef);bboxPrev=refPos.oper.getBBox0();break;case cElementType.cell3D:case cElementType.cellsRange3D:_3DRefTmp=parserHelp.is3DRef.call(parserHelp,formula2,refPos.start);if(_3DRefTmp[0]){if(cElementType.cell3D===refPos.oper.type){if(_3DRefTmp[1]!== refPos.oper.getWS().getName())return false;bboxPrev=refPos.oper.getBBox0()}else{wsF=_3DRefTmp[1];wsT=null!==_3DRefTmp[2]?_3DRefTmp[2]:wsF;if(!(wsF===refPos.oper.wsFrom.getName()&&wsT===refPos.oper.wsTo.getName()))return false;bboxPrev=refPos.oper.getBBox0NoCheck()}bboxRef=formula2.substring(parserHelp.pCurrPos+refPos.start,refPos.end);bbox=AscCommonExcel.g_oRangeCache.getAscRange(bboxRef)}else return false;break}if(bboxPrev){if(!(bbox&&bboxPrev.isEqualWithOffsetRow(bbox,offsetRow)))return false;index= refPos.end}}}for(j=index;j<formula2.length;++j)if(formula1[j]!==formula2[j])return false;return true}return false}function convertAreaToArray(area){var retArr=new cArray,_arg0;if(area instanceof cArea3D)area=area.getMatrixAllRange()[0];else area=area.getMatrix();for(var iRow=0;iRow<area.length;iRow++,iRow<area.length?retArr.addRow():true)for(var iCol=0;iCol<area[iRow].length;iCol++){_arg0=area[iRow][iCol];retArr.addElement(_arg0)}return retArr}function convertRefToRowCol(ref,curRef){var cellAddress= new AscCommon.CellAddress(ref);var res="R";res+=!cellAddress.bRowAbs&&curRef?"["+(cellAddress.row-curRef.nRow-1)+"]":cellAddress.row;res+="C";res+=!cellAddress.bColAbs&&curRef?"["+(cellAddress.col-curRef.nCol-1)+"]":cellAddress.col;return res}function convertAreaToArrayRefs(area,useOnlyFirstRow,useOnlyFirstColumn){var retArr=new cArray,ref,is3d;var range,ws;if(cElementType.cellsRange===area.type){range=area.range;ws=area.ws}else if(cElementType.cellsRange3D===area.type&&area.isSingleSheet()){range= area.getRanges()[0];ws=area.wsFrom;is3d=true}if(range){var bbox=range.bbox;var countRow=useOnlyFirstRow?0:bbox.r2-bbox.r1;var countCol=useOnlyFirstColumn?0:bbox.c2-bbox.c1;for(var iRow=bbox.r1;iRow<=countRow+bbox.r1;iRow++,iRow<=countRow+bbox.r1?retArr.addRow():true)for(var iCol=bbox.c1;iCol<=countCol+bbox.c1;iCol++){var curCol=useOnlyFirstColumn?bbox.c1:iCol;var curRow=useOnlyFirstRow?bbox.r1:iRow;ref=new Asc.Range(curCol,curRow,curCol,curRow);ref=is3d?new cRef3D(ref.getName(),ws):new cRef(ref.getName(), ws);retArr.addElement(ref)}}return retArr}function specialFuncArrayToArray(arg0,arg1,what){var retArr=null,_arg0,_arg1;if(arg0.getRowCount()===arg1.getRowCount()&&1===arg0.getCountElementInRow()){retArr=new cArray;for(var iRow=0;iRow<arg1.getRowCount();iRow++,iRow<arg1.getRowCount()?retArr.addRow():true)for(var iCol=0;iCol<arg1.getCountElementInRow();iCol++){_arg0=arg0.getElementRowCol(iRow,0);_arg1=arg1.getElementRowCol(iRow,iCol);retArr.addElement(_func[_arg0.type][_arg1.type](_arg0,_arg1,what))}}else if(arg0.getRowCount()=== arg1.getRowCount()&&1===arg1.getCountElementInRow()){retArr=new cArray;for(var iRow=0;iRow<arg0.getRowCount();iRow++,iRow<arg0.getRowCount()?retArr.addRow():true)for(var iCol=0;iCol<arg0.getCountElementInRow();iCol++){_arg0=arg0.getElementRowCol(iRow,iCol);_arg1=arg1.getElementRowCol(iRow,0);retArr.addElement(_func[_arg0.type][_arg1.type](_arg0,_arg1,what))}}else if(arg0.getCountElementInRow()===arg1.getCountElementInRow()&&1===arg0.getRowCount()){retArr=new cArray;for(var iRow=0;iRow<arg1.getRowCount();iRow++, iRow<arg1.getRowCount()?retArr.addRow():true)for(var iCol=0;iCol<arg1.getCountElementInRow();iCol++){_arg0=arg0.getElementRowCol(0,iCol);_arg1=arg1.getElementRowCol(iRow,iCol);retArr.addElement(_func[_arg0.type][_arg1.type](_arg0,_arg1,what))}}else if(arg0.getCountElementInRow()===arg1.getCountElementInRow()&&1===arg1.getRowCount()){retArr=new cArray;for(var iRow=0;iRow<arg0.getRowCount();iRow++,iRow<arg0.getRowCount()?retArr.addRow():true)for(var iCol=0;iCol<arg0.getCountElementInRow();iCol++){_arg0= arg0.getElementRowCol(iRow,iCol);_arg1=arg1.getElementRowCol(0,iCol);retArr.addElement(_func[_arg0.type][_arg1.type](_arg0,_arg1,what))}}else if(1===arg0.getCountElementInRow()&&1===arg1.getRowCount()){retArr=new cArray;for(var iRow=0;iRow<arg0.getRowCount();iRow++,iRow<arg0.getRowCount()?retArr.addRow():true)for(var iCol=0;iCol<arg1.getCountElementInRow();iCol++){_arg0=arg0.getElementRowCol(iRow,0);_arg1=arg1.getElementRowCol(0,iCol);retArr.addElement(_func[_arg0.type][_arg1.type](_arg0,_arg1,what))}}else if(1=== arg1.getCountElementInRow()&&1===arg0.getRowCount()){retArr=new cArray;for(var iRow=0;iRow<arg1.getRowCount();iRow++,iRow<arg1.getRowCount()?retArr.addRow():true)for(var iCol=0;iCol<arg0.getCountElementInRow();iCol++){_arg0=arg0.getElementRowCol(0,iCol);_arg1=arg1.getElementRowCol(iRow,0);retArr.addElement(_func[_arg0.type][_arg1.type](_arg0,_arg1,what))}}return retArr}window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].cElementType=cElementType;window["AscCommonExcel"].cErrorType= cErrorType;window["AscCommonExcel"].cExcelSignificantDigits=cExcelSignificantDigits;window["AscCommonExcel"].cExcelMaxExponent=cExcelMaxExponent;window["AscCommonExcel"].cExcelMinExponent=cExcelMinExponent;window["AscCommonExcel"].c_Date1904Const=c_Date1904Const;window["AscCommonExcel"].c_Date1900Const=c_Date1900Const;window["AscCommonExcel"].c_DateCorrectConst=c_Date1900Const;window["AscCommonExcel"].cNumFormatFirstCell=cNumFormatFirstCell;window["AscCommonExcel"].cNumFormatNone=cNumFormatNone;window["AscCommonExcel"].g_cCalcRecursion= g_cCalcRecursion;window["AscCommonExcel"].g_ProcessShared=false;window["AscCommonExcel"].cReturnFormulaType=cReturnFormulaType;window["AscCommonExcel"].bIsSupportArrayFormula=bIsSupportArrayFormula;window["AscCommonExcel"].cNumber=cNumber;window["AscCommonExcel"].cString=cString;window["AscCommonExcel"].cBool=cBool;window["AscCommonExcel"].cError=cError;window["AscCommonExcel"].cArea=cArea;window["AscCommonExcel"].cArea3D=cArea3D;window["AscCommonExcel"].cRef=cRef;window["AscCommonExcel"].cRef3D= cRef3D;window["AscCommonExcel"].cEmpty=cEmpty;window["AscCommonExcel"].cName=cName;window["AscCommonExcel"].cName3D=cName3D;window["AscCommonExcel"].cArray=cArray;window["AscCommonExcel"].cUndefined=cUndefined;window["AscCommonExcel"].cBaseFunction=cBaseFunction;window["AscCommonExcel"].cUnknownFunction=cUnknownFunction;window["AscCommonExcel"].checkTypeCell=checkTypeCell;window["AscCommonExcel"].cFormulaFunctionGroup=cFormulaFunctionGroup;window["AscCommonExcel"].cFormulaFunction=cFormulaFunction; window["AscCommonExcel"].cFormulaFunctionLocalized=null;window["AscCommonExcel"].cFormulaFunctionToLocale=null;window["AscCommonExcel"].getFormulasInfo=getFormulasInfo;window["AscCommonExcel"].getRangeByRef=getRangeByRef;window["AscCommonExcel"]._func=_func;window["AscCommonExcel"].parserFormula=parserFormula;window["AscCommonExcel"].ParseResult=ParseResult;window["AscCommonExcel"].parseNum=parseNum;window["AscCommonExcel"].matching=matching;window["AscCommonExcel"].matchingValue=matchingValue;window["AscCommonExcel"].GetDiffDate360= GetDiffDate360;window["AscCommonExcel"].searchRegExp2=searchRegExp2;window["AscCommonExcel"].rtl_math_erf=rtl_math_erf;window["AscCommonExcel"].rtl_math_erfc=rtl_math_erfc;window["AscCommonExcel"].getArrayMax=getArrayMax;window["AscCommonExcel"].getArrayMin=getArrayMin;window["AscCommonExcel"].compareFormula=compareFormula;window["AscCommonExcel"].convertRefToRowCol=convertRefToRowCol;window["AscCommonExcel"].convertAreaToArray=convertAreaToArray;window["AscCommonExcel"].convertAreaToArrayRefs=convertAreaToArrayRefs})(window); (function(window,undefined){var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var argType=Asc.c_oAscFormulaArgumentType;cFormulaFunctionGroup["TextAndData"]=cFormulaFunctionGroup["TextAndData"]||[];cFormulaFunctionGroup["TextAndData"].push(cDBCS);cFormulaFunctionGroup["Statistical"]=cFormulaFunctionGroup["Statistical"]||[];cFormulaFunctionGroup["Statistical"].push(cFORECAST_ETS,cFORECAST_ETS_CONFINT,cFORECAST_ETS_SEASONALITY,cFORECAST_ETS_STAT); cFormulaFunctionGroup["NotRealised"]=cFormulaFunctionGroup["NotRealised"]||[];cFormulaFunctionGroup["NotRealised"].push(cDBCS,cFORECAST_ETS,cFORECAST_ETS_CONFINT,cFORECAST_ETS_SEASONALITY,cFORECAST_ETS_STAT);function cDBCS(){}cDBCS.prototype=Object.create(cBaseFunction.prototype);cDBCS.prototype.constructor=cDBCS;cDBCS.prototype.name="DBCS";cDBCS.prototype.isXLFN=true;function cFILTERXML(){}cFILTERXML.prototype=Object.create(cBaseFunction.prototype);cFILTERXML.prototype.constructor=cFILTERXML;cFILTERXML.prototype.name= "FILTERXML";cFILTERXML.prototype.isXLFN=true;cFILTERXML.prototype.argumentsType=[argType.text,argType.text];function cFORECAST_ETS(){}cFORECAST_ETS.prototype=Object.create(cBaseFunction.prototype);cFORECAST_ETS.prototype.constructor=cFORECAST_ETS;cFORECAST_ETS.prototype.name="FORECAST.ETS";cFORECAST_ETS.prototype.isXLFN=true;cFORECAST_ETS.prototype.argumentsType=[argType.number,argType.reference,argType.reference,argType.number,argType.number,argType.number];function cFORECAST_ETS_CONFINT(){}cFORECAST_ETS_CONFINT.prototype= Object.create(cBaseFunction.prototype);cFORECAST_ETS_CONFINT.prototype.constructor=cFORECAST_ETS_CONFINT;cFORECAST_ETS_CONFINT.prototype.name="FORECAST.ETS.CONFINT";cFORECAST_ETS_CONFINT.prototype.isXLFN=true;cFORECAST_ETS_CONFINT.prototype.argumentsType=[argType.number,argType.reference,argType.reference,argType.number,argType.number,argType.number,argType.number];function cFORECAST_ETS_SEASONALITY(){}cFORECAST_ETS_SEASONALITY.prototype=Object.create(cBaseFunction.prototype);cFORECAST_ETS_SEASONALITY.prototype.constructor= cFORECAST_ETS_SEASONALITY;cFORECAST_ETS_SEASONALITY.prototype.name="FORECAST.ETS.SEASONALITY";cFORECAST_ETS_SEASONALITY.prototype.isXLFN=true;cFORECAST_ETS_SEASONALITY.prototype.argumentsType=[argType.reference,argType.reference,argType.number,argType.number];function cFORECAST_ETS_STAT(){}cFORECAST_ETS_STAT.prototype=Object.create(cBaseFunction.prototype);cFORECAST_ETS_STAT.prototype.constructor=cFORECAST_ETS_STAT;cFORECAST_ETS_STAT.prototype.name="FORECAST.ETS.STAT";cFORECAST_ETS_STAT.prototype.isXLFN= true;cFORECAST_ETS_STAT.prototype.argumentsType=[argType.reference,argType.reference,argType.number,argType.number,argType.number,argType.number];function cQUERYSTRING(){}cQUERYSTRING.prototype=Object.create(cBaseFunction.prototype);cQUERYSTRING.prototype.constructor=cQUERYSTRING;cQUERYSTRING.prototype.name="QUERYSTRING";cQUERYSTRING.prototype.isXLFN=true;function cWEBSERVICE(){}cWEBSERVICE.prototype=Object.create(cBaseFunction.prototype);cWEBSERVICE.prototype.constructor=cWEBSERVICE;cWEBSERVICE.prototype.name= "WEBSERVICE";cWEBSERVICE.prototype.isXLFN=true;cWEBSERVICE.prototype.argumentsType=[argType.text]})(window);"use strict";(function(window,undefined){var cDate=Asc.cDate;var g_oFormatParser=AscCommon.g_oFormatParser;var cErrorType=AscCommonExcel.cErrorType;var c_sPerDay=AscCommonExcel.c_sPerDay;var c_msPerDay=AscCommonExcel.c_msPerDay;var cNumber=AscCommonExcel.cNumber;var cString=AscCommonExcel.cString;var cBool=AscCommonExcel.cBool;var cError=AscCommonExcel.cError;var cArea=AscCommonExcel.cArea; var cArea3D=AscCommonExcel.cArea3D;var cRef=AscCommonExcel.cRef;var cRef3D=AscCommonExcel.cRef3D;var cEmpty=AscCommonExcel.cEmpty;var cArray=AscCommonExcel.cArray;var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var cElementType=AscCommonExcel.cElementType;var argType=Asc.c_oAscFormulaArgumentType;var GetDiffDate360=AscCommonExcel.GetDiffDate360;var cExcelDateTimeDigits=8;var DayCountBasis={UsPsa30_360:0,ActualActual:1,Actual360:2,Actual365:3, Europ30_360:4};function yearFrac(d1,d2,mode){d1.truncate();d2.truncate();var date1=d1.getUTCDate(),month1=d1.getUTCMonth()+1,year1=d1.getUTCFullYear(),date2=d2.getUTCDate(),month2=d2.getUTCMonth()+1,year2=d2.getUTCFullYear();switch(mode){case DayCountBasis.UsPsa30_360:return new cNumber(Math.abs(GetDiffDate360(date1,month1,year1,date2,month2,year2,true))/360);case DayCountBasis.ActualActual:var yc=Math.abs(year2-year1),sd=year1>year2?new cDate(d2):new cDate(d1),yearAverage=sd.isLeapYear()?366:365, dayDiff=d2-d1;for(var i=0;i<yc;i++){sd.addYears(1);yearAverage+=sd.isLeapYear()?366:365}yearAverage/=yc+1;dayDiff/=yearAverage*c_msPerDay;return new cNumber(Math.abs(dayDiff));case DayCountBasis.Actual360:var dayDiff=Math.abs(d2-d1);dayDiff/=360*c_msPerDay;return new cNumber(dayDiff);case DayCountBasis.Actual365:var dayDiff=Math.abs(d2-d1);dayDiff/=365*c_msPerDay;return new cNumber(dayDiff);case DayCountBasis.Europ30_360:return new cNumber(Math.abs(GetDiffDate360(date1,month1,year1,date2,month2,year2, false))/360);default:return new cError(cErrorType.not_numeric)}}function diffDate(d1,d2,mode){var date1=d1.getUTCDate(),month1=d1.getUTCMonth()+1,year1=d1.getUTCFullYear(),date2=d2.getUTCDate(),month2=d2.getUTCMonth()+1,year2=d2.getUTCFullYear();switch(mode){case DayCountBasis.UsPsa30_360:return new cNumber(GetDiffDate360(date1,month1,year1,date2,month2,year2,true));case DayCountBasis.ActualActual:return new cNumber((d2-d1)/c_msPerDay);case DayCountBasis.Actual360:var dayDiff=d2-d1;dayDiff/=c_msPerDay; return new cNumber((d2-d1)/c_msPerDay);case DayCountBasis.Actual365:var dayDiff=d2-d1;dayDiff/=c_msPerDay;return new cNumber((d2-d1)/c_msPerDay);case DayCountBasis.Europ30_360:return new cNumber(GetDiffDate360(date1,month1,year1,date2,month2,year2,false));default:return new cError(cErrorType.not_numeric)}}function diffDate2(d1,d2,mode){var date1=d1.getUTCDate(),month1=d1.getUTCMonth(),year1=d1.getUTCFullYear(),date2=d2.getUTCDate(),month2=d2.getUTCMonth(),year2=d2.getUTCFullYear();var nDaysInYear, nYears,nDayDiff;switch(mode){case DayCountBasis.UsPsa30_360:nDaysInYear=360;nYears=year1-year2;nDayDiff=Math.abs(GetDiffDate360(date1,month1+1,year1,date2,month2+1,year2,true))-nYears*nDaysInYear;return new cNumber(nYears+nDayDiff/nDaysInYear);case DayCountBasis.ActualActual:nYears=year2-year1;nDaysInYear=d1.isLeapYear()?366:365;var dayDiff;if(nYears&&(month1>month2||month1==month2&&date1>date2))nYears--;if(nYears)dayDiff=parseInt((d2-new cDate(Date.UTC(year2,month1,date1)))/c_msPerDay);else dayDiff= parseInt((d2-d1)/c_msPerDay);if(dayDiff<0)dayDiff+=nDaysInYear;return new cNumber(nYears+dayDiff/nDaysInYear);case DayCountBasis.Actual360:nDaysInYear=360;nYears=parseInt((d2-d1)/c_msPerDay/nDaysInYear);nDayDiff=(d2-d1)/c_msPerDay;nDayDiff%=nDaysInYear;return new cNumber(nYears+nDayDiff/nDaysInYear);case DayCountBasis.Actual365:nDaysInYear=365;nYears=parseInt((d2-d1)/c_msPerDay/nDaysInYear);nDayDiff=(d2-d1)/c_msPerDay;nDayDiff%=nDaysInYear;return new cNumber(nYears+nDayDiff/nDaysInYear);case DayCountBasis.Europ30_360:nDaysInYear= 360;nYears=year1-year2;nDayDiff=Math.abs(GetDiffDate360(date1,month1+1,year1,date2,month2+1,year2,false))-nYears*nDaysInYear;return new cNumber(nYears+nDayDiff/nDaysInYear);default:return new cError(cErrorType.not_numeric)}}function GetDiffDate(d1,d2,nMode,av){var bNeg=d1>d2,nRet,pOptDaysIn1stYear;if(bNeg){var n=d2;d2=d1;d1=n}var nD1=d1.getUTCDate(),nM1=d1.getUTCMonth(),nY1=d1.getUTCFullYear(),nD2=d2.getUTCDate(),nM2=d2.getUTCMonth(),nY2=d2.getUTCFullYear();switch(nMode){case DayCountBasis.UsPsa30_360:case DayCountBasis.Europ30_360:{var bLeap= d1.isLeapYear(),nDays,nMonths;nMonths=nM2-nM1;nDays=nD2-nD1;nMonths+=(nY2-nY1)*12;nRet=nMonths*30+nDays;if(nMode==0&&nM1==2&&nM2!=2&&nY1==nY2)nRet-=bLeap?1:2;pOptDaysIn1stYear=360;break}case DayCountBasis.ActualActual:pOptDaysIn1stYear=d1.isLeapYear()?366:365;nRet=d2-d1;break;case DayCountBasis.Actual360:nRet=d2-d1;pOptDaysIn1stYear=360;break;case DayCountBasis.Actual365:nRet=d2-d1;pOptDaysIn1stYear=365;break}return(bNeg?-nRet:nRet)/c_msPerDay/(av?1:pOptDaysIn1stYear)}function days360(date1,date2, flag){var sign;var nY1=date1.getUTCFullYear(),nM1=date1.getUTCMonth()+1,nD1=date1.getUTCDate(),nY2=date2.getUTCFullYear(),nM2=date2.getUTCMonth()+1,nD2=date2.getUTCDate();if(flag&&date2<date1){sign=date1;date1=date2;date2=sign;sign=-1}else sign=1;if(nD1==31)nD1-=1;else if(!flag)if(nM1==2)switch(nD1){case 28:if(!date1.isLeapYear())nD1=30;break;case 29:nD1=30;break}if(nD2==31)if(!flag){if(nD1==30)nD2--}else nD2=30;return sign*(nD2-nD1+(nM2-nM1)*30+(nY2-nY1)*360)}function daysInYear(date,basis){switch(basis){case DayCountBasis.UsPsa30_360:case DayCountBasis.Actual360:case DayCountBasis.Europ30_360:return new cNumber(360); case DayCountBasis.ActualActual:{var d=cDate.prototype.getDateFromExcel(date);return new cNumber(d.isLeapYear()?366:365)}case DayCountBasis.Actual365:return new cNumber(365);default:return new cError(cErrorType.not_numeric)}}function getCorrectDate(val){if(!AscCommon.bDate1904)if(val<60)val=new cDate((val-AscCommonExcel.c_DateCorrectConst)*c_msPerDay);else if(val==60)val=new cDate((val-AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay);else val=new cDate((val-AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay); else val=new cDate((val-AscCommonExcel.c_DateCorrectConst)*c_msPerDay);return val}function getWeekends(val){var res=[];if(val)if(cElementType.number===val.type){var numberVal=val.getValue();switch(numberVal){case 1:res[6]=true;res[0]=true;break;case 2:res[0]=true;res[1]=true;break;case 3:res[1]=true;res[2]=true;break;case 4:res[2]=true;res[3]=true;break;case 5:res[3]=true;res[4]=true;break;case 6:res[4]=true;res[5]=true;break;case 7:res[5]=true;res[6]=true;break;case 11:res[0]=true;break;case 12:res[1]= true;break;case 13:res[2]=true;break;case 14:res[3]=true;break;case 15:res[4]=true;break;case 16:res[5]=true;break;case 17:res[6]=true;break;default:return new cError(cErrorType.not_numeric)}}else if(cElementType.string===val.type){var stringVal=val.getValue();if(stringVal.length!==7)return new cError(cErrorType.wrong_value_type);for(var i=0;i<7;i++){var num=6===i?0:i+1;switch(stringVal[i]){case "0":res[num]=false;break;case "1":res[num]=true;break;default:return new cError(cErrorType.wrong_value_type)}}}else return new cError(cErrorType.not_numeric); else{res[6]=true;res[0]=true}return res}function getHolidays(val){var holidays=[];if(val)if(val instanceof cRef){var a=val.getValue();if(a instanceof cNumber&&a.getValue()>=0)holidays.push(a)}else if(val instanceof cArea||val instanceof cArea3D){var arr=val.getValue();for(var i=0;i<arr.length;i++)if(arr[i]instanceof cNumber&&arr[i].getValue()>=0)holidays.push(arr[i])}else if(val instanceof cArray){var bIsError=false;val.foreach(function(elem){if(elem instanceof cNumber)holidays.push(elem);else if(elem instanceof cString){var res=elem.tocNumber();if(res instanceof cError||res instanceof cEmpty){var d=new cDate(elem.getValue());if(isNaN(d)){d=g_oFormatParser.parseDate(elem.getValue());if(d===null)return new cError(cErrorType.wrong_value_type);res=d.value}else res=(d.getTime()/1E3-d.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+(AscCommon.bDate1904?0:1))}else res=elem.tocNumber().getValue();if(res&&res>0)holidays.push(new cNumber(parseInt(res)));else return bIsError=new cError(cErrorType.wrong_value_type)}}); if(bIsError)return bIsError}else{val=val.tocNumber();if(val instanceof cError)return bIsError=new cError(val);else if(val instanceof cNumber)holidays.push(val)}for(var i=0;i<holidays.length;i++)holidays[i]=cDate.prototype.getDateFromExcel(holidays[i].getValue());return holidays}function _includeInHolidays(date,holidays){for(var i=0;i<holidays.length;i++)if(date.getTime()==holidays[i].getTime())return true;return false}function weekNumber(dt,iso,type){if(undefined===iso)iso=[0,1,2,3,4,5,6];if(undefined=== type)type=0;dt.setUTCHours(0,0,0);var startOfYear=new cDate(Date.UTC(dt.getUTCFullYear(),0,1));var endOfYear=new cDate(dt);endOfYear.setUTCMonth(11);endOfYear.setUTCDate(31);var wk=parseInt(((dt-startOfYear)/c_msPerDay+iso[startOfYear.getUTCDay()])/7);if(type)switch(wk){case 0:startOfYear.setUTCDate(0);return weekNumber(startOfYear,iso,type);case 53:if(endOfYear.getUTCDay()<4)return new cNumber(1);else return new cNumber(wk);default:return new cNumber(wk)}else{wk=parseInt(((dt-startOfYear)/c_msPerDay+ iso[startOfYear.getUTCDay()]+7)/7);return new cNumber(wk)}}cFormulaFunctionGroup["DateAndTime"]=cFormulaFunctionGroup["DateAndTime"]||[];cFormulaFunctionGroup["DateAndTime"].push(cDATE,cDATEDIF,cDATEVALUE,cDAY,cDAYS,cDAYS360,cEDATE,cEOMONTH,cHOUR,cISOWEEKNUM,cMINUTE,cMONTH,cNETWORKDAYS,cNETWORKDAYS_INTL,cNOW,cSECOND,cTIME,cTIMEVALUE,cTODAY,cWEEKDAY,cWEEKNUM,cWORKDAY,cWORKDAY_INTL,cYEAR,cYEARFRAC);function cDATE(){}cDATE.prototype=Object.create(cBaseFunction.prototype);cDATE.prototype.constructor= cDATE;cDATE.prototype.name="DATE";cDATE.prototype.argumentsMin=3;cDATE.prototype.argumentsMax=3;cDATE.prototype.argumentsType=[argType.number,argType.number,argType.number];cDATE.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2],year,month,day;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2=arg2.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;year=arg0.getValue();month=arg1.getValue();day=arg2.getValue();if(year>=0&&year<=1899)year+=1900;var res;if(year===1900&&month===2&&day===29)res=new cNumber(60); else{var _num=Math.round((new cDate(Date.UTC(year,month-1,day))).getExcelDate());if(_num<0)return new cError(cErrorType.not_numeric);res=new cNumber(_num)}res.numFormat=14;return res};function cDATEDIF(){}cDATEDIF.prototype=Object.create(cBaseFunction.prototype);cDATEDIF.prototype.constructor=cDATEDIF;cDATEDIF.prototype.name="DATEDIF";cDATEDIF.prototype.argumentsMin=3;cDATEDIF.prototype.argumentsMax=3;cDATEDIF.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDATEDIF.prototype.Calculate=function(arg){var arg0= arg[0],arg1=arg[1],arg2=arg[2];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElementRowCol(0,0);arg0=arg0.tocNumber();arg1=arg1.tocNumber(); arg2=arg2.tocString();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;var val0=arg0.getValue(),val1=arg1.getValue();if(val0<0||val1<0||val0>=val1)return new cError(cErrorType.not_numeric);val0=cDate.prototype.getDateFromExcel(val0);val1=cDate.prototype.getDateFromExcel(val1);function dateDiff(date1,date2){var years=date2.getUTCFullYear()-date1.getUTCFullYear();var months=years*12+date2.getUTCMonth()-date1.getUTCMonth();var days=date2.getUTCDate()- date1.getUTCDate();years-=date2.getUTCMonth()<date1.getUTCMonth();months-=date2.getUTCDate()<date1.getUTCDate();days+=days<0?(new cDate(Date.UTC(date2.getUTCFullYear(),date2.getUTCMonth()-1,0))).getUTCDate()+1:0;return[years,months,days]}switch(arg2.getValue().toUpperCase()){case "Y":return new cNumber(dateDiff(val0,val1)[0]);break;case "M":return new cNumber(dateDiff(val0,val1)[1]);break;case "D":return new cNumber(parseInt((val1-val0)/c_msPerDay));break;case "MD":if(val0.getUTCDate()>val1.getUTCDate())return new cNumber(Math.abs(new cDate(Date.UTC(val0.getUTCFullYear(), val0.getUTCMonth(),val0.getUTCDate()))-new cDate(Date.UTC(val0.getUTCFullYear(),val0.getUTCMonth()+1,val1.getUTCDate())))/c_msPerDay);else return new cNumber(val1.getUTCDate()-val0.getUTCDate());break;case "YM":var d=dateDiff(val0,val1);return new cNumber(d[1]-d[0]*12);break;case "YD":if(val0.getUTCMonth()>val1.getUTCMonth())return new cNumber(Math.abs(new cDate(Date.UTC(val0.getUTCFullYear(),val0.getUTCMonth(),val0.getUTCDate()))-new cDate(Date.UTC(val0.getUTCFullYear()+1,val1.getUTCMonth(),val1.getUTCDate())))/ c_msPerDay);else return new cNumber(Math.abs(new cDate(Date.UTC(val0.getUTCFullYear(),val0.getUTCMonth(),val0.getUTCDate()))-new cDate(Date.UTC(val0.getUTCFullYear(),val1.getUTCMonth(),val1.getUTCDate())))/c_msPerDay);break;default:return new cError(cErrorType.not_numeric)}};function cDATEVALUE(){}cDATEVALUE.prototype=Object.create(cBaseFunction.prototype);cDATEVALUE.prototype.constructor=cDATEVALUE;cDATEVALUE.prototype.name="DATEVALUE";cDATEVALUE.prototype.argumentsMin=1;cDATEVALUE.prototype.argumentsMax= 1;cDATEVALUE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDATEVALUE.prototype.argumentsType=[argType.number];cDATEVALUE.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var res=g_oFormatParser.parse(arg0.getValue());if(res&&res.bDateTime)return new cNumber(parseInt(res.value));else return new cError(cErrorType.wrong_value_type)}; function cDAY(){}cDAY.prototype=Object.create(cBaseFunction.prototype);cDAY.prototype.constructor=cDAY;cDAY.prototype.name="DAY";cDAY.prototype.argumentsMin=1;cDAY.prototype.argumentsMax=1;cDAY.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDAY.prototype.argumentsType=[argType.number];cDAY.prototype.Calculate=function(arg){var t=this;var bIsSpecialFunction=arguments[4];var calculateFunc=function(curArg){var val;if(curArg instanceof cArray)curArg=curArg.getElement(0);else if(curArg instanceof cArea|| curArg instanceof cArea3D){curArg=curArg.cross(arguments[1]).tocNumber();val=curArg.tocNumber().getValue()}if(curArg instanceof cError)return curArg;else if(curArg instanceof cNumber||curArg instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else if(curArg instanceof cRef||curArg instanceof cRef3D){val=curArg.getValue().tocNumber();if(val instanceof cNumber||val instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else return new cError(cErrorType.wrong_value_type)}else if(curArg instanceof cString){val=curArg.tocNumber();if(val instanceof cError||val instanceof cEmpty){var d=new cDate(curArg.getValue());if(isNaN(d))return new cError(cErrorType.wrong_value_type);else val=Math.floor((d.getTime()/1E3-d.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+(AscCommon.bDate1904?0:1)))}else val=curArg.tocNumber().getValue()}if(val<0)return new cError(cErrorType.not_numeric);else if(!AscCommon.bDate1904)if(val<60)return t.setCalcValue(new cNumber((new cDate((val-AscCommonExcel.c_DateCorrectConst)* c_msPerDay)).getUTCDate()),0);else if(val==60)return t.setCalcValue(new cNumber((new cDate((val-AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay)).getUTCDate()+1),0);else return t.setCalcValue(new cNumber((new cDate((val-AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay)).getUTCDate()),0);else return t.setCalcValue(new cNumber((new cDate((val-AscCommonExcel.c_DateCorrectConst)*c_msPerDay)).getUTCDate()),0)};var arg0=arg[0],res;if(!bIsSpecialFunction){if(arg0 instanceof cArray)arg0=arg0.getElement(0); else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocNumber();res=calculateFunc(arg0)}else res=this._checkArrayArguments(arg0,calculateFunc);return res};function cDAYS(){}cDAYS.prototype=Object.create(cBaseFunction.prototype);cDAYS.prototype.constructor=cDAYS;cDAYS.prototype.name="DAYS";cDAYS.prototype.argumentsMin=2;cDAYS.prototype.argumentsMax=2;cDAYS.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDAYS.prototype.isXLFN=true;cDAYS.prototype.argumentsType=[argType.number, argType.number];cDAYS.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;var calulateDay=function(curArg){var val;if(curArg instanceof cArray)curArg=curArg.getElement(0);else if(curArg instanceof cArea||curArg instanceof cArea3D){curArg=curArg.cross(arguments[1]).tocNumber();val=curArg.tocNumber().getValue()}if(curArg instanceof cError)return curArg;else if(curArg instanceof cNumber||curArg instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else if(curArg instanceof cRef||curArg instanceof cRef3D){val=curArg.getValue().tocNumber();if(val instanceof cNumber||val instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else return new cError(cErrorType.wrong_value_type)}else if(curArg instanceof cString){val=curArg.tocNumber();if(val instanceof cError||val instanceof cEmpty){var d=new cDate(curArg.getValue());if(isNaN(d))return new cError(cErrorType.wrong_value_type);else val= Math.floor((d.getTime()/1E3-d.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+(AscCommon.bDate1904?0:1)))}else val=curArg.tocNumber().getValue()}return val};var calulateDays=function(argArray){var val=calulateDay(argArray[0]);var val1=calulateDay(argArray[1]);if(val instanceof cError)return val;else if(val1 instanceof cError)return val1;else if(val<0||val1<0)return new cError(cErrorType.not_numeric);else return new cNumber(val-val1)};return calulateDays(argClone)};function cDAYS360(){} cDAYS360.prototype=Object.create(cBaseFunction.prototype);cDAYS360.prototype.constructor=cDAYS360;cDAYS360.prototype.name="DAYS360";cDAYS360.prototype.argumentsMin=2;cDAYS360.prototype.argumentsMax=3;cDAYS360.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDAYS360.prototype.argumentsType=[argType.number,argType.number,argType.logical];cDAYS360.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2]?arg[2]:new cBool(false);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0= arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElementRowCol(0,0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2=arg2.tocBool();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1; if(arg2 instanceof cError)return arg2;if(arg0.getValue()<0)return new cError(cErrorType.not_numeric);if(arg1.getValue()<0)return new cError(cErrorType.not_numeric);var date1=cDate.prototype.getDateFromExcel(arg0.getValue()),date2=cDate.prototype.getDateFromExcel(arg1.getValue());return new cNumber(days360(date1,date2,arg2.toBool()))};function cEDATE(){}cEDATE.prototype=Object.create(cBaseFunction.prototype);cEDATE.prototype.constructor=cEDATE;cEDATE.prototype.name="EDATE";cEDATE.prototype.argumentsMin= 2;cEDATE.prototype.argumentsMax=2;cEDATE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cEDATE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cEDATE.prototype.argumentsType=[argType.any,argType.any];cEDATE.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1= arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var val=arg0.getValue(),date,_date;if(val<0)return new cError(cErrorType.not_numeric);else if(!AscCommon.bDate1904)if(val<60)val=new cDate((val-AscCommonExcel.c_DateCorrectConst)*c_msPerDay);else if(val==60)val=new cDate((val-AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay);else val=new cDate((val- AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay);else val=new cDate((val-AscCommonExcel.c_DateCorrectConst)*c_msPerDay);date=new cDate(val);if(0<=date.getUTCDate()&&28>=date.getUTCDate())val=new cDate(val.setUTCMonth(val.getUTCMonth()+arg1.getValue()));else if(29<=date.getUTCDate()&&31>=date.getUTCDate()){date.setUTCDate(1);date.setUTCMonth(date.getUTCMonth()+arg1.getValue());if(val.getUTCDate()>(_date=date.getDaysInMonth()))val.setUTCDate(_date);val=new cDate(val.setUTCMonth(val.getUTCMonth()+arg1.getValue()))}return new cNumber(Math.floor((val.getTime()/ 1E3-val.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+1)))};function cEOMONTH(){}cEOMONTH.prototype=Object.create(cBaseFunction.prototype);cEOMONTH.prototype.constructor=cEOMONTH;cEOMONTH.prototype.name="EOMONTH";cEOMONTH.prototype.argumentsMin=2;cEOMONTH.prototype.argumentsMax=2;cEOMONTH.prototype.numFormat=AscCommonExcel.cNumFormatNone;cEOMONTH.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cEOMONTH.prototype.argumentsType=[argType.any,argType.any]; cEOMONTH.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var val=arg0.getValue(); if(val<0)return new cError(cErrorType.not_numeric);else if(!AscCommon.bDate1904)if(val<60)val=new cDate((val-AscCommonExcel.c_DateCorrectConst)*c_msPerDay);else if(val==60)val=new cDate((val-AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay);else val=new cDate((val-AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay);else val=new cDate((val-AscCommonExcel.c_DateCorrectConst)*c_msPerDay);val.setUTCDate(1);val.setUTCMonth(val.getUTCMonth()+arg1.getValue());val.setUTCDate(val.getDaysInMonth());return new cNumber(Math.floor((val.getTime()/ 1E3-val.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+1)))};function cHOUR(){}cHOUR.prototype=Object.create(cBaseFunction.prototype);cHOUR.prototype.constructor=cHOUR;cHOUR.prototype.name="HOUR";cHOUR.prototype.argumentsMin=1;cHOUR.prototype.argumentsMax=1;cHOUR.prototype.numFormat=AscCommonExcel.cNumFormatNone;cHOUR.prototype.argumentsType=[argType.number];cHOUR.prototype.Calculate=function(arg){var t=this;var bIsSpecialFunction=arguments[4];var calculateFunc=function(curArg){var val; if(curArg instanceof cArray)curArg=curArg.getElement(0);else if(curArg instanceof cArea||curArg instanceof cArea3D)curArg=curArg.cross(arguments[1]).tocNumber();if(curArg instanceof cError)return curArg;else if(curArg instanceof cNumber||curArg instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else if(curArg instanceof cRef||curArg instanceof cRef3D){val=curArg.getValue();if(val instanceof cError)return val;else if(val instanceof cNumber||val instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else return new cError(cErrorType.wrong_value_type)}else if(curArg instanceof cString){val=curArg.tocNumber();if(val instanceof cError||val instanceof cEmpty){var d=new cDate(curArg.getValue());if(isNaN(d)){d=g_oFormatParser.parseDate(curArg.getValue());if(d==null)return new cError(cErrorType.wrong_value_type);val=d.value}else val=(d.getTime()/1E3-d.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+(AscCommon.bDate1904?0:1))}else val=curArg.tocNumber().getValue()}if(val< 0)return new cError(cErrorType.not_numeric);else return t.setCalcValue(new cNumber(parseInt(((val-Math.floor(val))*24).toFixed(cExcelDateTimeDigits))),0)};var arg0=arg[0],res;if(!bIsSpecialFunction){if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocNumber();res=calculateFunc(arg0)}else res=this._checkArrayArguments(arg0,calculateFunc);return res};function cISOWEEKNUM(){}cISOWEEKNUM.prototype=Object.create(cBaseFunction.prototype); cISOWEEKNUM.prototype.constructor=cISOWEEKNUM;cISOWEEKNUM.prototype.name="ISOWEEKNUM";cISOWEEKNUM.prototype.argumentsMin=1;cISOWEEKNUM.prototype.argumentsMax=1;cISOWEEKNUM.prototype.numFormat=AscCommonExcel.cNumFormatNone;cISOWEEKNUM.prototype.isXLFN=true;cISOWEEKNUM.prototype.argumentsType=[argType.number];cISOWEEKNUM.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();var argError;if(argError= this._checkErrorArg(argClone))return argError;var arg0=argClone[0];if(arg0.getValue()<0)return new cError(cErrorType.not_numeric);return new cNumber(weekNumber(cDate.prototype.getDateFromExcel(arg0.getValue())))};function cMINUTE(){}cMINUTE.prototype=Object.create(cBaseFunction.prototype);cMINUTE.prototype.constructor=cMINUTE;cMINUTE.prototype.name="MINUTE";cMINUTE.prototype.argumentsMin=1;cMINUTE.prototype.argumentsMax=1;cMINUTE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cMINUTE.prototype.argumentsType= [argType.number];cMINUTE.prototype.Calculate=function(arg){var t=this;var bIsSpecialFunction=arguments[4];var calculateFunc=function(curArg){var val;if(curArg instanceof cArray)curArg=curArg.getElement(0);else if(curArg instanceof cArea||curArg instanceof cArea3D)curArg=curArg.cross(arguments[1]).tocNumber();if(curArg instanceof cError)return curArg;else if(curArg instanceof cNumber||curArg instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else if(curArg instanceof cRef|| curArg instanceof cRef3D){val=curArg.getValue();if(val instanceof cError)return val;else if(val instanceof cNumber||val instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else return new cError(cErrorType.wrong_value_type)}else if(curArg instanceof cString){val=curArg.tocNumber();if(val instanceof cError||val instanceof cEmpty){var d=new cDate(curArg.getValue());if(isNaN(d)){d=g_oFormatParser.parseDate(curArg.getValue());if(d==null)return new cError(cErrorType.wrong_value_type); val=d.value}else val=(d.getTime()/1E3-d.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+(AscCommon.bDate1904?0:1))}else val=curArg.tocNumber().getValue()}if(val<0)return new cError(cErrorType.not_numeric);else{d=AscCommon.NumFormat.prototype.parseDate(val);val=d.min;return t.setCalcValue(new cNumber(val),0)}};var arg0=arg[0],res;if(!bIsSpecialFunction){if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocNumber(); res=calculateFunc(arg0)}else res=this._checkArrayArguments(arg0,calculateFunc);return res};function cMONTH(){}cMONTH.prototype=Object.create(cBaseFunction.prototype);cMONTH.prototype.constructor=cMONTH;cMONTH.prototype.name="MONTH";cMONTH.prototype.argumentsMin=1;cMONTH.prototype.argumentsMax=1;cMONTH.prototype.numFormat=AscCommonExcel.cNumFormatNone;cMONTH.prototype.argumentsType=[argType.number];cMONTH.prototype.Calculate=function(arg){var t=this;var bIsSpecialFunction=arguments[4];var calculateFunc= function(curArg){var val;if(curArg instanceof cError)return curArg;else if(curArg instanceof cNumber||curArg instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else if(curArg instanceof cRef||curArg instanceof cRef3D){val=curArg.getValue();if(val instanceof cError)return val;else if(val instanceof cNumber||val instanceof cBool||val instanceof cEmpty)val=curArg.tocNumber().getValue();else return new cError(cErrorType.wrong_value_type)}else if(curArg instanceof cString){val= curArg.tocNumber();if(val instanceof cError||val instanceof cEmpty){var d=new cDate(curArg.getValue());if(isNaN(d))return new cError(cErrorType.wrong_value_type);else val=Math.floor((d.getTime()/1E3-d.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+(AscCommon.bDate1904?0:1)))}else val=curArg.tocNumber().getValue()}if(val<0)return new cError(cErrorType.not_numeric);if(!AscCommon.bDate1904)if(val==60)return t.setCalcValue(new cNumber(2),0);else return t.setCalcValue(new cNumber((new cDate(((val== 0?1:val)-AscCommonExcel.c_DateCorrectConst-1)*c_msPerDay)).getUTCMonth()+1),0);else return t.setCalcValue(new cNumber((new cDate(((val==0?1:val)-AscCommonExcel.c_DateCorrectConst)*c_msPerDay)).getUTCMonth()+1),0)};var arg0=arg[0],res;if(!bIsSpecialFunction){if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocNumber();res=calculateFunc(arg0)}else res=this._checkArrayArguments(arg0,calculateFunc);return res};function cNETWORKDAYS(){} cNETWORKDAYS.prototype=Object.create(cBaseFunction.prototype);cNETWORKDAYS.prototype.constructor=cNETWORKDAYS;cNETWORKDAYS.prototype.name="NETWORKDAYS";cNETWORKDAYS.prototype.argumentsMin=2;cNETWORKDAYS.prototype.argumentsMax=3;cNETWORKDAYS.prototype.numFormat=AscCommonExcel.cNumFormatNone;cNETWORKDAYS.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cNETWORKDAYS.prototype.arrayIndexes={2:1};cNETWORKDAYS.prototype.argumentsType=[argType.any,argType.any,argType.any];cNETWORKDAYS.prototype.Calculate= function(arg){var oArguments=this._prepareArguments([arg[0],arg[1]],arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var arg0=argClone[0],arg1=argClone[1],arg2=arg[2];var val0=arg0.getValue(),val1=arg1.getValue();if(val0<0)return new cError(cErrorType.not_numeric);if(val1<0)return new cError(cErrorType.not_numeric);val0=getCorrectDate(val0);val1=getCorrectDate(val1); var holidays=getHolidays(arg2);if(holidays instanceof cError)return holidays;var calcDate=function(){var count=0;var start=val0;var end=val1;var dif=val1-val0;if(dif<0){start=val1;end=val0}var difAbs=end-start;difAbs=(difAbs+c_msPerDay)/c_msPerDay;for(var i=0;i<difAbs;i++){var date=new cDate(start);date.setUTCDate(start.getUTCDate()+i);if(date.getUTCDay()!==6&&date.getUTCDay()!==0&&!_includeInHolidays(date,holidays))count++}return new cNumber((dif<0?-1:1)*count)};return calcDate()};function cNETWORKDAYS_INTL(){} cNETWORKDAYS_INTL.prototype=Object.create(cBaseFunction.prototype);cNETWORKDAYS_INTL.prototype.constructor=cNETWORKDAYS_INTL;cNETWORKDAYS_INTL.prototype.name="NETWORKDAYS.INTL";cNETWORKDAYS_INTL.prototype.argumentsMin=2;cNETWORKDAYS_INTL.prototype.argumentsMax=4;cNETWORKDAYS_INTL.prototype.numFormat=AscCommonExcel.cNumFormatNone;cNETWORKDAYS_INTL.prototype.arrayIndexes={2:1,3:1};cNETWORKDAYS_INTL.prototype.argumentsType=[argType.any,argType.any,argType.number,argType.any];cNETWORKDAYS_INTL.prototype.returnValueType= AscCommonExcel.cReturnFormulaType.value_replace_area;cNETWORKDAYS_INTL.prototype.Calculate=function(arg){var tempArgs=arg[2]?[arg[0],arg[1],arg[2]]:[arg[0],arg[1]];var oArguments=this._prepareArguments(tempArgs,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var arg0=argClone[0],arg1=argClone[1],arg2=argClone[2],arg3=arg[3];var val0=arg0.getValue(),val1=arg1.getValue(); if(val0<0)return new cError(cErrorType.not_numeric);if(val1<0)return new cError(cErrorType.not_numeric);val0=getCorrectDate(val0);val1=getCorrectDate(val1);var weekends=getWeekends(arg2);if(weekends instanceof cError)return weekends;var holidays=getHolidays(arg3);if(holidays instanceof cError)return holidays;var calcDate=function(){var count=0;var start=val0;var end=val1;var dif=val1-val0;if(dif<0){start=val1;end=val0}var difAbs=end-start;difAbs=(difAbs+c_msPerDay)/c_msPerDay;var date=new cDate(start); var startTime=date.getTime();for(var i=0;i<difAbs;i++){date.setTime(startTime);date.setUTCDate(start.getUTCDate()+i);if(!_includeInHolidays(date,holidays)&&!weekends[date.getUTCDay()])count++}return new cNumber((dif<0?-1:1)*count)};return calcDate()};function cNOW(){}cNOW.prototype=Object.create(cBaseFunction.prototype);cNOW.prototype.constructor=cNOW;cNOW.prototype.name="NOW";cNOW.prototype.argumentsMax=0;cNOW.prototype.ca=true;cNOW.prototype.argumentsType=null;cNOW.prototype.Calculate=function(){var d= new cDate;var res=new cNumber(d.getExcelDate()+(d.getHours()*60*60+d.getMinutes()*60+d.getSeconds())/c_sPerDay);res.numFormat=22;return res};function cSECOND(){}cSECOND.prototype=Object.create(cBaseFunction.prototype);cSECOND.prototype.constructor=cSECOND;cSECOND.prototype.name="SECOND";cSECOND.prototype.argumentsMin=1;cSECOND.prototype.argumentsMax=1;cSECOND.prototype.numFormat=AscCommonExcel.cNumFormatNone;cSECOND.prototype.argumentsType=[argType.number];cSECOND.prototype.Calculate=function(arg){var t= this;var bIsSpecialFunction=arguments[4];var calculateFunc=function(curArg){var val;if(curArg instanceof cArray)curArg=curArg.getElement(0);else if(curArg instanceof cArea||curArg instanceof cArea3D)curArg=curArg.cross(arguments[1]).tocNumber();if(curArg instanceof cError)return curArg;else if(curArg instanceof cNumber||curArg instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else if(curArg instanceof cRef||curArg instanceof cRef3D){val=curArg.getValue();if(val instanceof cError)return val;else if(val instanceof cNumber||val instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else return new cError(cErrorType.wrong_value_type)}else if(curArg instanceof cString){val=curArg.tocNumber();if(val instanceof cError||val instanceof cEmpty){var d=new cDate(curArg.getValue());if(isNaN(d)){d=g_oFormatParser.parseDate(curArg.getValue());if(d==null)return new cError(cErrorType.wrong_value_type);val=d.value}else val=(d.getTime()/1E3-d.getTimezoneOffset()* 60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+(AscCommon.bDate1904?0:1))}else val=curArg.tocNumber().getValue()}if(val<0)return new cError(cErrorType.not_numeric);else{val=Math.floor((val*c_sPerDay+.5).toFixed(cExcelDateTimeDigits))%60;return t.setCalcValue(new cNumber(val),0)}};var arg0=arg[0],res;if(!bIsSpecialFunction){if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocNumber();res=calculateFunc(arg0)}else res= this._checkArrayArguments(arg0,calculateFunc);return res};function cTIME(){}cTIME.prototype=Object.create(cBaseFunction.prototype);cTIME.prototype.constructor=cTIME;cTIME.prototype.name="TIME";cTIME.prototype.argumentsMin=3;cTIME.prototype.argumentsMax=3;cTIME.prototype.argumentsType=[argType.number,argType.number,argType.number];cTIME.prototype.Calculate=function(arg){var hour=arg[0],minute=arg[1],second=arg[2];if(hour instanceof cArea||hour instanceof cArea3D)hour=hour.cross(arguments[1]);else if(hour instanceof cArray)hour=hour.getElement(0);if(minute instanceof cArea||minute instanceof cArea3D)minute=minute.cross(arguments[1]);else if(minute instanceof cArray)minute=minute.getElement(0);if(second instanceof cArea||second instanceof cArea3D)second=second.cross(arguments[1]);else if(second instanceof cArray)second=second.getElement(0);hour=hour.tocNumber();minute=minute.tocNumber();second=second.tocNumber();if(hour instanceof cError)return hour;if(minute instanceof cError)return minute;if(second instanceof cError)return second;hour=parseInt(hour.getValue());minute=parseInt(minute.getValue());second=parseInt(second.getValue());var v=(hour*60*60+minute*60+second)/c_sPerDay;if(v<0)return new cError(cErrorType.not_numeric);var res=new cNumber(v-Math.floor(v));res.numFormat=18;return res};function cTIMEVALUE(){}cTIMEVALUE.prototype=Object.create(cBaseFunction.prototype);cTIMEVALUE.prototype.constructor=cTIMEVALUE;cTIMEVALUE.prototype.name="TIMEVALUE";cTIMEVALUE.prototype.argumentsMin=1;cTIMEVALUE.prototype.argumentsMax= 1;cTIMEVALUE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cTIMEVALUE.prototype.argumentsType=[argType.number];cTIMEVALUE.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var res=g_oFormatParser.parse(arg0.getValue());if(res&&res.bDateTime)return new cNumber(res.value-parseInt(res.value));else return new cError(cErrorType.wrong_value_type)}; function cTODAY(){}cTODAY.prototype=Object.create(cBaseFunction.prototype);cTODAY.prototype.constructor=cTODAY;cTODAY.prototype.name="TODAY";cTODAY.prototype.argumentsMax=0;cTODAY.prototype.ca=true;cTODAY.prototype.argumentsType=null;cTODAY.prototype.Calculate=function(){var res=new cNumber((new cDate).getExcelDate());res.numFormat=14;return res};function cWEEKDAY(){}cWEEKDAY.prototype=Object.create(cBaseFunction.prototype);cWEEKDAY.prototype.constructor=cWEEKDAY;cWEEKDAY.prototype.name="WEEKDAY"; cWEEKDAY.prototype.argumentsMin=1;cWEEKDAY.prototype.argumentsMax=2;cWEEKDAY.prototype.numFormat=AscCommonExcel.cNumFormatNone;cWEEKDAY.prototype.argumentsType=[argType.number,argType.number];cWEEKDAY.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cNumber(1);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]); else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var weekday;switch(arg1.getValue()){case 1:case 17:weekday=[1,2,3,4,5,6,7];break;case 2:case 11:weekday=[7,1,2,3,4,5,6];break;case 3:weekday=[6,0,1,2,3,4,5];break;case 12:weekday=[6,7,1,2,3,4,5];break;case 13:weekday=[5,6,7,1,2,3,4];break;case 14:weekday=[4,5,6,7,1,2,3];break;case 15:weekday=[3,4,5,6,7,1,2];break;case 16:weekday= [2,3,4,5,6,7,1];break;default:return new cError(cErrorType.not_numeric)}if(arg0.getValue()<0)return new cError(cErrorType.wrong_value_type);return new cNumber(weekday[(new cDate((arg0.getValue()-(AscCommonExcel.c_DateCorrectConst+1))*c_msPerDay)).getUTCDay()])};function cWEEKNUM(){}cWEEKNUM.prototype=Object.create(cBaseFunction.prototype);cWEEKNUM.prototype.constructor=cWEEKNUM;cWEEKNUM.prototype.name="WEEKNUM";cWEEKNUM.prototype.argumentsMin=1;cWEEKNUM.prototype.argumentsMax=2;cWEEKNUM.prototype.numFormat= AscCommonExcel.cNumFormatNone;cWEEKNUM.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cWEEKNUM.prototype.argumentsType=[argType.any,argType.any];cWEEKNUM.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cNumber(1),type=0;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0.getValue()<0)return new cError(cErrorType.not_numeric);var weekdayStartDay;switch(arg1.getValue()){case 1:case 17:weekdayStartDay=[0,1,2,3,4,5,6];break;case 2:case 11:weekdayStartDay=[6,0,1,2,3,4,5];break;case 12:weekdayStartDay=[5,6,0,1,2,3,4];break;case 13:weekdayStartDay=[4,5,6,0,1,2,3];break;case 14:weekdayStartDay=[3,4,5,6,0,1, 2];break;case 15:weekdayStartDay=[2,3,4,5,6,0,1];break;case 16:weekdayStartDay=[1,2,3,4,5,6,0];break;case 21:weekdayStartDay=[6,7,8,9,10,4,5];type=1;break;default:return new cError(cErrorType.not_numeric)}return new cNumber(weekNumber(cDate.prototype.getDateFromExcel(arg0.getValue()),weekdayStartDay,type))};function cWORKDAY(){}cWORKDAY.prototype=Object.create(cBaseFunction.prototype);cWORKDAY.prototype.constructor=cWORKDAY;cWORKDAY.prototype.name="WORKDAY";cWORKDAY.prototype.argumentsMin=2;cWORKDAY.prototype.argumentsMax= 3;cWORKDAY.prototype.numFormat=AscCommonExcel.cNumFormatNone;cWORKDAY.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cWORKDAY.prototype.arrayIndexes={2:1};cWORKDAY.prototype.argumentsType=[argType.any,argType.any,argType.any];cWORKDAY.prototype.Calculate=function(arg){var t=this;var oArguments=this._prepareArguments([arg[0],arg[1]],arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError= this._checkErrorArg(argClone))return argError;var arg0=argClone[0],arg1=argClone[1],arg2=arg[2];var val0=arg0.getValue();if(val0<0)return new cError(cErrorType.not_numeric);val0=getCorrectDate(val0);var holidays=getHolidays(arg2);if(holidays instanceof cError)return holidays;var calcDate=function(startdate,workdaysCount,holidays){workdaysCount=Math.floor(workdaysCount);var diff=Math.sign(workdaysCount);var daysCounter=0;var currentDate=new cDate(startdate);while(daysCounter!==workdaysCount){currentDate= new cDate(currentDate.getTime()+diff*c_msPerDay);var dayOfWeek;var argVal0=argClone&&argClone[0]?argClone[0].getValue():null;if(argVal0!==null&&argVal0<60)dayOfWeek=currentDate.getUTCDay()>0?currentDate.getUTCDay()-1:6;else dayOfWeek=currentDate.getUTCDay();if(dayOfWeek!==0&&dayOfWeek!==6&&!_includeInHolidays(currentDate,holidays))daysCounter+=diff}return currentDate};if(undefined===arg1.getValue())return new cError(cErrorType.not_numeric);var date=calcDate(val0,arg1.getValue(),holidays);var val= date.getExcelDate();if(val<0)return new cError(cErrorType.not_numeric);return t.setCalcValue(new cNumber(val),14)};function cWORKDAY_INTL(){}cWORKDAY_INTL.prototype=Object.create(cBaseFunction.prototype);cWORKDAY_INTL.prototype.constructor=cWORKDAY_INTL;cWORKDAY_INTL.prototype.name="WORKDAY.INTL";cWORKDAY_INTL.prototype.argumentsMin=2;cWORKDAY_INTL.prototype.argumentsMax=4;cWORKDAY_INTL.prototype.numFormat=AscCommonExcel.cNumFormatNone;cWORKDAY_INTL.prototype.arrayIndexes={2:1,3:1};cWORKDAY_INTL.prototype.argumentsType= [argType.any,argType.any,argType.number,argType.any];cWORKDAY_INTL.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cWORKDAY_INTL.prototype.Calculate=function(arg){var t=this;var tempArgs=arg[2]?[arg[0],arg[1],arg[2]]:[arg[0],arg[1]];var oArguments=this._prepareArguments(tempArgs,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var arg0= argClone[0],arg1=argClone[1],arg2=argClone[2],arg3=arg[3];var val0=arg0.getValue();if(val0<0)return new cError(cErrorType.not_numeric);val0=getCorrectDate(val0);if(arg2&&"1111111"===arg2.getValue())return new cError(cErrorType.wrong_value_type);var weekends=getWeekends(arg2);if(weekends instanceof cError)return weekends;var holidays=getHolidays(arg3);if(holidays instanceof cError)return holidays;var calcDate=function(){var dif=arg1.getValue(),count=1,dif1=dif>0?1:dif<0?-1:0,val,date=val0;while(Math.abs(dif)> count){date=new cDate(val0.getTime()+dif1*c_msPerDay);if(!_includeInHolidays(date,holidays)&&!weekends[date.getUTCDay()])count++;dif>=0?dif1++:dif1--;if(!(Math.abs(dif)>count)){date=new cDate(val0.getTime()+dif1*c_msPerDay);for(var i=0;i<7;i++)if(weekends[date.getUTCDay()]){dif>=0?dif1++:dif1--;date=new cDate(val0.getTime()+dif1*c_msPerDay)}else break}}date=new cDate(val0.getTime()+dif1*c_msPerDay);val=date.getExcelDate();if(val<0)return new cError(cErrorType.not_numeric);return t.setCalcValue(new cNumber(val), 14)};return calcDate()};function cYEAR(){}cYEAR.prototype=Object.create(cBaseFunction.prototype);cYEAR.prototype.constructor=cYEAR;cYEAR.prototype.name="YEAR";cYEAR.prototype.argumentsMin=1;cYEAR.prototype.argumentsMax=1;cYEAR.prototype.numFormat=AscCommonExcel.cNumFormatNone;cYEAR.prototype.argumentsType=[argType.number];cYEAR.prototype.Calculate=function(arg){var t=this;var bIsSpecialFunction=arguments[4];var calculateFunc=function(curArg){var val;if(curArg instanceof cError)return curArg;else if(curArg instanceof cNumber||curArg instanceof cBool||curArg instanceof cEmpty)val=curArg.tocNumber().getValue();else if(curArg instanceof cArea||curArg instanceof cArea3D)return new cError(cErrorType.wrong_value_type);else if(curArg instanceof cRef||curArg instanceof cRef3D){val=curArg.getValue();if(val instanceof cError)return val;else if(val instanceof cNumber||val instanceof cBool||val instanceof cEmpty)val=curArg.tocNumber().getValue();else return new cError(cErrorType.wrong_value_type)}else if(curArg instanceof cString){val=curArg.tocNumber();if(val instanceof cError||val instanceof cEmpty){var d=new cDate(curArg.getValue());if(isNaN(d))return new cError(cErrorType.wrong_value_type);else val=Math.floor((d.getTime()/1E3-d.getTimezoneOffset()*60)/c_sPerDay+(AscCommonExcel.c_DateCorrectConst+(AscCommon.bDate1904?0:1)))}else val=curArg.tocNumber().getValue()}if(val<0)return t.setCalcValue(new cError(cErrorType.not_numeric),0);else return t.setCalcValue(new cNumber((new cDate((val-(AscCommonExcel.c_DateCorrectConst+ 1))*c_msPerDay)).getUTCFullYear()),0)};var arg0=arg[0],res;if(!bIsSpecialFunction){if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocNumber();res=calculateFunc(arg0)}else res=this._checkArrayArguments(arg0,calculateFunc);return res};function cYEARFRAC(){}cYEARFRAC.prototype=Object.create(cBaseFunction.prototype);cYEARFRAC.prototype.constructor=cYEARFRAC;cYEARFRAC.prototype.name="YEARFRAC";cYEARFRAC.prototype.argumentsMin= 2;cYEARFRAC.prototype.argumentsMax=3;cYEARFRAC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cYEARFRAC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cYEARFRAC.prototype.argumentsType=[argType.any,argType.any,argType.any];cYEARFRAC.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2]?arg[2]:new cNumber(0);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0, 0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElementRowCol(0,0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2=arg2.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;var val0=arg0.getValue(),val1=arg1.getValue(); if(val0<0||val1<0)return new cError(cErrorType.not_numeric);val0=cDate.prototype.getDateFromExcel(val0);val1=cDate.prototype.getDateFromExcel(val1);return yearFrac(val0,val1,arg2.getValue())};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].DayCountBasis=DayCountBasis;window["AscCommonExcel"].yearFrac=yearFrac;window["AscCommonExcel"].diffDate=diffDate;window["AscCommonExcel"].days360=days360;window["AscCommonExcel"].daysInYear=daysInYear})(window);"use strict";(function(window, undefined){var cErrorType=AscCommonExcel.cErrorType;var cNumber=AscCommonExcel.cNumber;var cString=AscCommonExcel.cString;var cError=AscCommonExcel.cError;var cArea=AscCommonExcel.cArea;var cArea3D=AscCommonExcel.cArea3D;var cArray=AscCommonExcel.cArray;var cUndefined=AscCommonExcel.cUndefined;var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var argType=Asc.c_oAscFormulaArgumentType;var rtl_math_erf=AscCommonExcel.rtl_math_erf;var rg_validBINNumber= /^[01]{1,10}$/,rg_validDEC2BINNumber=/^-?[0-9]{1,3}$/,rg_validDEC2OCTNumber=/^-?[0-9]{1,9}$/,rg_validDEC2HEXNumber=/^-?[0-9]{1,12}$/,rg_validHEXNumber=/^[0-9A-F]{1,10}$/i,rg_validOCTNumber=/^[0-7]{1,10}$/,rg_complex_number=new XRegExp("^(?<real>[-+]?(?:\\d*(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?))?(?<img>([-+]?(\\d*(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?)?[ij])?)","g");var NumberBase={BIN:2,OCT:8,DEC:10,HEX:16};var f_PI_DIV_2=Math.PI/2;var f_PI_DIV_4=Math.PI/4;var f_2_DIV_PI=2/Math.PI;function BesselJ(x,N){if(N<0)return new cError(cErrorType.not_numeric); if(x===0)return new cNumber(N==0?1:0);var fSign=N%2==1&&x<0?-1:1;var fX=Math.abs(x);var fMaxIteration=9E6;var fEstimateIteration=fX*1.5+N;var bAsymptoticPossible=Math.pow(fX,.4)>N;if(fEstimateIteration>fMaxIteration)if(bAsymptoticPossible)return new cNumber(fSign*Math.sqrt(f_2_DIV_PI/fX)*Math.cos(fX-N*f_PI_DIV_2-f_PI_DIV_4));else return new cError(cErrorType.not_numeric);var epsilon=1E-15;var bHasfound=false,k=0,u;var m_bar,g_bar,g_bar_delta_u,g=0,delta_u=0,f_bar=-1;if(N==0){u=1;g_bar_delta_u=0;g_bar= -2/fX;delta_u=g_bar_delta_u/g_bar;u=u+delta_u;g=-1/g_bar;f_bar=f_bar*g;k=2}else{u=0;for(k=1;k<=N-1;k=k+1){m_bar=2*Math.fmod(k-1,2)*f_bar;g_bar_delta_u=-g*delta_u-m_bar*u;g_bar=m_bar-2*k/fX+g;delta_u=g_bar_delta_u/g_bar;u=u+delta_u;g=-1/g_bar;f_bar=f_bar*g}m_bar=2*Math.fmod(k-1,2)*f_bar;g_bar_delta_u=f_bar-g*delta_u-m_bar*u;g_bar=m_bar-2*k/fX+g;delta_u=g_bar_delta_u/g_bar;u=u+delta_u;g=-1/g_bar;f_bar=f_bar*g;k=k+1}do{m_bar=2*Math.fmod(k-1,2)*f_bar;g_bar_delta_u=-g*delta_u-m_bar*u;g_bar=m_bar-2*k/fX+ g;delta_u=g_bar_delta_u/g_bar;u=u+delta_u;g=-1/g_bar;f_bar=f_bar*g;bHasfound=Math.abs(delta_u)<=Math.abs(u)*epsilon;k=k+1}while(!bHasfound&&k<=fMaxIteration);if(bHasfound)return new cNumber(u*fSign);else return new cError(cErrorType.not_numeric)}function BesselI(x,n){var nMaxIteration=2E3,fXHalf=x/2,fResult=0,fEpsilon=1E-30;if(n<0)return new cError(cErrorType.not_numeric);var nK=0,fTerm=1;for(nK=1;nK<=n;++nK)fTerm=fTerm/nK*fXHalf;fTerm=Math.pow(fXHalf,n)/Math.fact(n);fResult=fTerm;if(fTerm!==0){nK= 1;do{fTerm=Math.pow(fXHalf,n+2*nK)/(Math.fact(nK)*Math.fact(n+nK));fResult=fResult+fTerm;nK++}while(Math.abs(fTerm)>Math.abs(fResult)*fEpsilon&&nK<nMaxIteration)}return new cNumber(fResult)}function Besselk0(fNum){var fRet,y;if(fNum<=2){y=fNum*fNum/4;fRet=-Math.log(fNum/2)*BesselI(fNum,0)+(-.57721566+y*(.4227842+y*(.23069756+y*(.0348859+y*(.00262698+y*(1.075E-4+y*7.4E-6))))))}else{y=2/fNum;fRet=Math.exp(-fNum)/Math.sqrt(fNum)*(1.25331414+y*(-.07832358+y*(.02189568+y*(-.01062446+y*(.00587872+y*(-.0025154+ y*5.3208E-4))))))}return new cNumber(fRet)}function Besselk1(fNum){var fRet,y;if(fNum<=2){y=fNum*fNum/4;fRet=Math.log(fNum/2)*BesselI(fNum,1)+1/fNum*(1+y*(.15443144+y*(-.67278579+y*(-.18156897+y*(-.01919402+y*(-.00110404+y*-4.686E-5))))))}else{y=2/fNum;fRet=Math.exp(-fNum)/Math.sqrt(fNum)*(1.25331414+y*(.23498619+y*(-.0365562+y*(.01504268+y*(-.00780353+y*(.00325614+y*-6.8245E-4))))))}return new cNumber(fRet)}function bessi0(x){var ax=Math.abs(x),fRet,y;if(ax<3.75){y=x/3.75;y*=y;fRet=1+y*(3.5156229+ y*(3.0899424+y*(1.2067492+y*(.2659732+y*(.0360768+y*.0045813)))))}else{y=3.75/ax;fRet=Math.exp(ax)/Math.sqrt(ax)*(.39894228+y*(.01328592+y*(.00225319+y*(-.00157565+y*(.00916281+y*(-.02057706+y*(.02635537+y*(-.01647633+y*.00392377))))))))}return fRet}function bessi(x,n){var max=1E10;var min=1E-10;var ACC=40;var bi,bim,bip,tox,res;if(x===0)return new cNumber(0);else{tox=2/Math.abs(x);bip=res=0;bi=1;for(var j=2*(n+parseInt(Math.sqrt(ACC*n)));j>0;j--){bim=bip+j*tox*bi;bip=bi;bi=bim;if(Math.abs(bi)>max){res*= min;bi*=min;bip*=min}if(j===n)res=bip}res*=bessi0(x)/bi;return x<0&&n&1?new cNumber(-res):new cNumber(res)}}function BesselK(fNum,nOrder){switch(nOrder){case 0:return Besselk0(fNum);case 1:return Besselk1(fNum);default:{var fBkp;var fTox=2/fNum,fBkm=Besselk0(fNum),fBk=Besselk1(fNum);if(fBkm instanceof cError)return fBkm;if(fBk instanceof cError)return fBk;fBkm=fBkm.getValue();fBk=fBk.getValue();for(var n=1;n<nOrder;n++){fBkp=fBkm+n*fTox*fBk;fBkm=fBk;fBk=fBkp}return new cNumber(fBk)}}}function Bessely0(fX){if(fX<= 0)return new cError(cErrorType.not_numeric);var fMaxIteration=9E6;if(fX>5E6)return new cNumber(Math.sqrt(1/Math.PI/fX)*(Math.sin(fX)-Math.cos(fX)));var epsilon=1E-15,EulerGamma=.5772156649015329;var alpha=Math.log10(fX/2)+EulerGamma;var u=alpha;var k=1,m_bar=0,g_bar_delta_u=0,g_bar=-2/fX;var delta_u=g_bar_delta_u/g_bar,g=-1/g_bar,f_bar=-1*g,sign_alpha=1,km1mod2,bHasFound=false;k=k+1;do{km1mod2=Math.fmod(k-1,2);m_bar=2*km1mod2*f_bar;if(km1mod2==0)alpha=0;else{alpha=sign_alpha*(4/k);sign_alpha=-sign_alpha}g_bar_delta_u= f_bar*alpha-g*delta_u-m_bar*u;g_bar=m_bar-2*k/fX+g;delta_u=g_bar_delta_u/g_bar;u=u+delta_u;g=-1/g_bar;f_bar=f_bar*g;bHasFound=Math.abs(delta_u)<=Math.abs(u)*epsilon;k=k+1}while(!bHasFound&&k<fMaxIteration);if(bHasFound)return new cNumber(u*f_2_DIV_PI);else return new cError(cErrorType.not_numeric)}function Bessely1(fX){if(fX<=0)return new cError(cErrorType.not_numeric);var fMaxIteration=9E6;if(fX>5E6)return new cNumber(-Math.sqrt(1/Math.PI/fX)*(Math.sin(fX)+Math.cos(fX)));var epsilon=1E-15,EulerGamma= .5772156649015329,alpha=1/fX,f_bar=-1,u=alpha,k=1,m_bar=0;alpha=1-EulerGamma-Math.log10(fX/2);var g_bar_delta_u=-alpha,g_bar=-2/fX,delta_u=g_bar_delta_u/g_bar;u=u+delta_u;var g=-1/g_bar;f_bar=f_bar*g;var sign_alpha=-1,km1mod2,q,bHasFound=false;k=k+1;do{km1mod2=Math.fmod(k-1,2);m_bar=2*km1mod2*f_bar;q=(k-1)/2;if(km1mod2==0){alpha=sign_alpha*(1/q+1/(q+1));sign_alpha=-sign_alpha}else alpha=0;g_bar_delta_u=f_bar*alpha-g*delta_u-m_bar*u;g_bar=m_bar-2*k/fX+g;delta_u=g_bar_delta_u/g_bar;u=u+delta_u;g=-1/ g_bar;f_bar=f_bar*g;bHasFound=Math.abs(delta_u)<=Math.abs(u)*epsilon;k=k+1}while(!bHasFound&&k<fMaxIteration);if(bHasFound)return new cNumber(-u*2/Math.PI);else return new cError(cErrorType.not_numeric)}function _Bessely0(fNum){if(fNum<8){var y=fNum*fNum;var f1=-2957821389+y*(7062834065+y*(-5.123598036E8+y*(1.087988129E7+y*(-86327.92757+y*228.4622733))));var f2=40076544269+y*(7.452499648E8+y*(7189466.438+y*(47447.2647+y*(226.1030244+y))));var fRet=f1/f2+.636619772*BesselJ(fNum,0)*Math.log(fNum)}else{var z= 8/fNum;var y=z*z;var xx=fNum-.785398164;var f1=1+y*(-.001098628627+y*(2.734510407E-5+y*(-2.073370639E-6+y*2.093887211E-7)));var f2=-.01562499995+y*(1.430488765E-4+y*(-6.911147651E-6+y*(7.621095161E-7+y*-9.34945152E-8)));var fRet=Math.sqrt(.636619772/fNum)*(Math.sin(xx)*f1+z*Math.cos(xx)*f2)}return new cNumber(fRet)}function _Bessely1(fNum){var z,xx,y,fRet,ans1,ans2;if(fNum<8){y=fNum*fNum;ans1=fNum*(-4900604943E3+y*(127527439E4+y*(-51534381390+y*(7.349264551E8+y*(-4237922.726+y*8511.937935)))));ans2= 249958057E5+y*(424441966400+y*(3733650367+y*(2.245904002E7+y*(102042.605+y*(354.9632885+y)))));fRet=ans1/ans2+.636619772*(BesselJ(fNum)*Math.log(fNum)-1/fNum)}else{z=8/fNum;y=z*z;xx=fNum-2.356194491;ans1=1+y*(.00183105+y*(-3.516396496E-5+y*(2.457520174E-6+y*-2.40337019E-7)));ans2=.04687499995+y*(-2.002690873E-4+y*(8.449199096E-6+y*(-8.8228987E-7+y*1.05787412E-7)));fRet=Math.sqrt(.636619772/fNum)*(Math.sin(xx)*ans1+z*Math.cos(xx)*ans2)}return new cNumber(fRet)}function BesselY(fNum,nOrder){switch(nOrder){case 0:return _Bessely0(fNum); case 1:return _Bessely1(fNum);default:{var fByp,fTox=2/fNum,fBym=_Bessely0(fNum),fBy=_Bessely1(fNum);if(fBym instanceof cError)return fBym;if(fBy instanceof cError)return fBy;fBym=fBym.getValue();fBy=fBy.getValue();for(var n=1;n<nOrder;n++){fByp=n*fTox*fBy-fBym;fBym=fBy;fBy=fByp}return new cNumber(fBy)}}}function validBINNumber(n){return rg_validBINNumber.test(n)}function validDEC2BINNumber(n){return rg_validDEC2BINNumber.test(n)}function validDEC2OCTNumber(n){return rg_validDEC2OCTNumber.test(n)} function validDEC2HEXNumber(n){return rg_validDEC2HEXNumber.test(n)}function validHEXNumber(n){return rg_validHEXNumber.test(n)}function validOCTNumber(n){return rg_validOCTNumber.test(n)}function convertFromTo(src,from,to,charLim){var res=parseInt(src,from).toString(to);if(charLim==undefined)return new cString(res.toUpperCase());else{charLim=parseInt(charLim);if(charLim>=res.length)return new cString(("0".repeat(charLim-res.length)+res).toUpperCase());else return new cError(cErrorType.not_numeric)}} function Complex(r,i,suffix){if(arguments.length==1)return this.ParseString(arguments[0]);else{this.real=r;this.img=i;this.suffix=suffix?suffix:"i";return this}}Complex.prototype={constructor:Complex,toString:function(){var res=[];var hasImag=this.img!=0,hasReal=!hasImag||this.real!=0;if(hasReal)res.push(this.real);if(hasImag){if(this.img==1){if(hasReal)res.push("+")}else if(this.img==-1)res.push("-");else this.img>0&&hasReal?res.push("+"+this.img):res.push(this.img);res.push(this.suffix?this.suffix: "i")}return res.join("")},Real:function(){return this.real},Imag:function(){return this.img},Abs:function(){return Math.sqrt(this.real*this.real+this.img*this.img)},Arg:function(){if(this.real==0&&this.img==0)return new cError(cErrorType.division_by_zero);var phi=Math.acos(this.real/this.Abs());if(this.img<0)phi=-phi;return phi},Conj:function(){var c=new Complex(this.real,-this.img,this.suffix);return c.toString()},Cos:function(){if(this.img){var a=Math.cos(this.real)*Math.cosh(this.img);this.img= -(Math.sin(this.real)*Math.sinh(this.img));this.real=a}else this.real=Math.cos(this.real)},Tan:function(){if(this.img){var a=Math.sin(2*this.real)/(Math.cos(2*this.real)+Math.cosh(2*this.img));this.img=Math.sinh(2*this.img)/(Math.cos(2*this.real)+Math.cosh(2*this.img));this.real=a}else this.real=Math.tan(this.real)},Cot:function(){if(this.img){var a=Math.sin(2*this.real)/(Math.cosh(2*this.img)-Math.cos(2*this.real));this.img=-(Math.sinh(2*this.img)/(Math.cosh(2*this.img)-Math.cos(2*this.real)));this.real= a}else this.real=1/Math.tan(this.real)},Cosh:function(){if(this.img){var a=Math.cosh(this.real)*Math.cos(this.img);this.img=Math.sinh(this.real)*Math.sin(this.img);this.real=a}else this.real=Math.cosh(this.real)},Csc:function(){if(this.img){var a=2*Math.sin(this.real)*Math.cosh(this.img)/(Math.cosh(2*this.img)-Math.cos(2*this.real));this.img=-2*Math.cos(this.real)*Math.sinh(this.img)/(Math.cosh(2*this.img)-Math.cos(2*this.real));this.real=a}else this.real=1/Math.sin(this.real)},Csch:function(){if(this.img){var a= 2*Math.sinh(this.real)*Math.cos(this.img)/(Math.cosh(2*this.real)-Math.cos(2*this.img));this.img=-2*Math.cosh(this.real)*Math.sin(this.img)/(Math.cosh(2*this.real)-Math.cos(2*this.img));this.real=a}else this.real=1/Math.sinh(this.real)},Sec:function(){if(this.img){var a=2*Math.cos(this.real)*Math.cosh(this.img)/(Math.cosh(2*this.img)+Math.cos(2*this.real));this.img=2*Math.sin(this.real)*Math.sinh(this.img)/(Math.cosh(2*this.img)+Math.cos(2*this.real));this.real=a}else this.real=1/Math.cos(this.real)}, Sech:function(){if(this.img){var a=2*Math.cosh(this.real)*Math.cos(this.img)/(Math.cosh(2*this.real)+Math.cos(2*this.img));this.img=-2*Math.sinh(this.real)*Math.sin(this.img)/(Math.cosh(2*this.real)+Math.cos(2*this.img));this.real=a}else this.real=1/Math.cosh(this.real)},Sin:function(){if(this.img){var a=Math.sin(this.real)*Math.cosh(this.img);this.img=Math.cos(this.real)*Math.sinh(this.img);this.real=a}else this.real=Math.sin(this.real)},Sinh:function(){if(this.img){var a=Math.sinh(this.real)*Math.cos(this.img); this.img=Math.cosh(this.real)*Math.sin(this.img);this.real=a}else this.real=Math.sinh(this.real)},Div:function(comp){var a=this.real,b=this.img,c=comp.real,d=comp.img,f=1/(c*c+d*d);if(Math.abs(f)==Infinity)return new cError(cErrorType.not_numeric);return new Complex((a*c+b*d)*f,(b*c-a*d)*f,this.suffix)},Exp:function(){var e=Math.exp(this.real),c=Math.cos(this.img),s=Math.sin(this.img);this.real=e*c;this.img=e*s},Ln:function(){var abs=this.Abs(),arg=this.Arg();if(abs==0||arg instanceof cError)return new cError(cErrorType.not_numeric); this.real=Math.ln(abs);this.img=arg},Log10:function(){var c=new Complex(Math.ln(10),0);var r=this.Ln();if(r instanceof cError)return r;c=this.Div(c);if(c instanceof cError)return c;this.real=c.real;this.img=c.img},Log2:function(){var c=new Complex(Math.ln(2),0);var r=this.Ln();if(r instanceof cError)return r;c=this.Div(c);if(c instanceof cError)return c;this.real=c.real;this.img=c.img},Power:function(power){if(this.real==0&&this.img==0)if(power>0){this.real=this.img=0;return true}else return false; else{var p=this.Abs(),phi;phi=Math.acos(this.real/p);if(this.img<0)phi=-phi;p=Math.pow(p,power);phi*=power;this.real=Math.cos(phi)*p;this.img=Math.sin(phi)*p;return true}},Product:function(comp){var a=this.real,b=this.img,c=comp.real,d=comp.img;this.real=a*c-b*d;this.img=a*d+b*c},SQRT:function(){if(this.real||this.img){var abs=this.Abs(),arg=this.Arg();this.real=Math.sqrt(abs)*Math.cos(arg/2);this.img=Math.sqrt(abs)*Math.sin(arg/2)}},Sub:function(comp){this.real-=comp.real;this.img-=comp.img},Sum:function(comp){this.real+= comp.real;this.img+=comp.img},isImagUnit:function(c){return c=="i"||c=="j"},parseComplexStr:function(s){var match=XRegExp.exec(s,rg_complex_number),r,i,suf;if(match){r=match["real"];i=match["img"];if(!(r||i))return new cError(cErrorType.not_numeric);if(i){suf=i[i.length-1];i=i.substr(0,i.length-1);if(i.length==1&&(i[0]=="-"||i[0]=="+"))i=parseFloat(i+"1");else i=parseFloat(i)}else i=0;if(r)r=parseFloat(r);else r=0;return new Complex(r,i,suf?suf:"i")}else return new cError(cErrorType.not_numeric)}, ParseString:function(rStr){var pStr={pStr:rStr},f={f:undefined};if(rStr.length==0){this.real=0;this.img=0;this.suffix="i";return this}if(this.isImagUnit(pStr.pStr[0])&&rStr.length==1){this.real=0;this.img=1;this.suffix=pStr;return this}if(!this.ParseDouble(pStr,f))return new cError(cErrorType.not_numeric);switch(pStr.pStr[0]+""){case "-":case "+":{var r=f.f;if(this.isImagUnit(pStr.pStr[1])){this.c=pStr.pStr[1];if(pStr.pStr[2]===undefined){this.real=f.f;this.img=pStr.pStr[0]=="+"?1:-1;return this}}else if(this.ParseDouble(pStr, f)&&this.isImagUnit(pStr.pStr[0])){this.c=pStr.pStr;if(pStr.pStr[2]===undefined){this.real=r;this.img=f.f;return this}}break}case "j":case "i":this.c=pStr;if(pStr.pStr[1]===undefined){this.img=f.f;this.real=0;return this}break;case "undefined":this.real=f.f;this.img=0;return this}return new cError(cErrorType.not_numeric)},ParseDouble:function(rp,rRet){function isnum(c){return c>="0"&&c<="9"}function iscomma(c){return c=="."||c==","}function isexpstart(c){return c=="e"||c=="E"}function isimagunit(c){return c== "i"||c=="j"}var fInt=0,fFrac=0,fMult=.1,nExp=0,nMaxExp=307,nDigCnt=18,State={end:0,sign:1,intstart:2,int:3,ignoreintdigs:4,frac:5,ignorefracdigs:6,expsign:7,exp:8},eS=State.sign,bNegNum=false,bNegExp=false,p=rp.pStr,c,i=0;while(eS){c=p[i];switch(eS){case State.sign:if(isnum(c)){fInt=parseFloat(c);nDigCnt--;eS=State.int}else if(c=="-"){bNegNum=true;eS=State.intstart}else if(c=="+")eS=State.intstart;else if(iscomma(c))eS=State.frac;else return false;break;case State.intstart:if(isnum(c)){fInt=parseFloat(c); nDigCnt--;eS=State.int}else if(iscomma(c))eS=State.frac;else if(isimagunit(c)){rRet.f=0;return true}else return false;break;case State.int:if(isnum(c)){fInt*=10;fInt+=parseFloat(c);nDigCnt--;if(!nDigCnt)eS=State.ignoreintdigs}else if(iscomma(c))eS=State.frac;else if(isexpstart(c))eS=State.expsign;else eS=State.end;break;case State.ignoreintdigs:if(isnum(c))nExp++;else if(iscomma(c))eS=State.frac;else if(isexpstart(c))eS=State.expsign;else eS=State.end;break;case State.frac:if(isnum(c)){fFrac+=parseFloat(c)* fMult;nDigCnt--;if(nDigCnt)fMult*=.1;else eS=State.ignorefracdigs}else if(isexpstart(c))eS=State.expsign;else eS=State.end;break;case State.ignorefracdigs:if(isexpstart(c))eS=State.expsign;else if(!isnum(c))eS=State.end;break;case State.expsign:if(isnum(c)){nExp=parseFloat(c);eS=State.exp}else if(c=="-"){bNegExp=true;eS=State.exp}else if(c!="+")eS=State.end;break;case State.exp:if(isnum(c)){nExp*=10;nExp+=parseFloat(c);if(nExp>nMaxExp)return false}else eS=State.end;break;case State.end:break}i++}i--; rp.pStr=p.substr(i);fInt+=fFrac;var nLog10=Math.log10(fInt);if(bNegExp)nExp=-nExp;if(nLog10+nExp>nMaxExp)return false;fInt=fInt*Math.pow(10,nExp);if(bNegNum)fInt=-fInt;rRet.f=fInt;return true}};var unitConverterArr=null;var availablePrefixMap=null;var prefixValueMap=null;function getUnitConverter(){if(null===unitConverterArr){unitConverterArr={};var generateWeightAndMass=function(){unitConverterArr["g"]={};unitConverterArr["g"]["sg"]=6.85220500053478E-5;unitConverterArr["g"]["lbm"]=.0022046226218487763; unitConverterArr["g"]["u"]=6.022137E23;unitConverterArr["g"]["ozm"]=.0352739718003627;unitConverterArr["g"]["grain"]=15.43236;unitConverterArr["g"]["cwt"]=2.20462262184878E-5;unitConverterArr["g"]["shweight"]=2.204623E-5;unitConverterArr["g"]["uk_cwt"]=1.96841305522212E-5;unitConverterArr["g"]["lcwt"]=1.96841305522212E-5;unitConverterArr["g"]["hweight"]=1.968413E-5;unitConverterArr["g"]["stone"]=1.57473E-4;unitConverterArr["g"]["ton"]=1.102311E-6;unitConverterArr["g"]["uk_ton"]=9.84206527611061E-7; unitConverterArr["g"]["LTON"]=9.84206527611061E-7;unitConverterArr["g"]["brton"]=9.842065E-7;unitConverterArr["sg"]={};unitConverterArr["sg"]["lbm"]=32.1739194101648;unitConverterArr["sg"]["u"]=8.78861184032002E27;unitConverterArr["sg"]["ozm"]=514.782785944229;unitConverterArr["sg"]["grain"]=225217.429992179;unitConverterArr["sg"]["cwt"]=.321739151364665;unitConverterArr["sg"]["shweight"]=.321739206551459;unitConverterArr["sg"]["uk_cwt"]=.287267099432737;unitConverterArr["sg"]["lcwt"]=.287267099432737; unitConverterArr["sg"]["hweight"]=.287267091373707;unitConverterArr["sg"]["stone"]=2.29813614723596;unitConverterArr["sg"]["ton"]=.0160869530306517;unitConverterArr["sg"]["uk_ton"]=.0143633549716368;unitConverterArr["sg"]["LTON"]=.0143633549716368;unitConverterArr["sg"]["brton"]=.0143633545686854;unitConverterArr["lbm"]={};unitConverterArr["lbm"]["u"]=2.73159503145377E26;unitConverterArr["lbm"]["ozm"]=16.0000023429409;unitConverterArr["lbm"]["grain"]=6999.99981727516;unitConverterArr["lbm"]["cwt"]= .00999999867168865;unitConverterArr["lbm"]["shweight"]=.0100000003869535;unitConverterArr["lbm"]["uk_cwt"]=.00892857024257915;unitConverterArr["lbm"]["lcwt"]=.00892857024257915;unitConverterArr["lbm"]["hweight"]=.00892856999209586;unitConverterArr["lbm"]["stone"]=.0714285417930745;unitConverterArr["lbm"]["ton"]=4.99999792551521E-4;unitConverterArr["lbm"]["uk_ton"]=4.46428512128958E-4;unitConverterArr["lbm"]["LTON"]=4.46428512128958E-4;unitConverterArr["lbm"]["brton"]=4.46428499604793E-4;unitConverterArr["u"]= {};unitConverterArr["u"]["ozm"]=5.85738448002141E-26;unitConverterArr["u"]["grain"]=2.56260526786422E-23;unitConverterArr["u"]["cwt"]=3.66086427766219E-29;unitConverterArr["u"]["shweight"]=3.66086490559747E-29;unitConverterArr["u"]["uk_cwt"]=3.26862881934124E-29;unitConverterArr["u"]["lcwt"]=3.26862881934124E-29;unitConverterArr["u"]["hweight"]=3.2686287276427E-29;unitConverterArr["u"]["stone"]=2.61490231789811E-28;unitConverterArr["u"]["ton"]=1.83043162252868E-30;unitConverterArr["u"]["uk_ton"]= 1.63431440967062E-30;unitConverterArr["u"]["LTON"]=1.63431440967062E-30;unitConverterArr["u"]["brton"]=1.63431436382135E-30;unitConverterArr["ozm"]={};unitConverterArr["ozm"]["grain"]=437.499924514917;unitConverterArr["ozm"]["cwt"]=6.24999825459436E-4;unitConverterArr["ozm"]["shweight"]=6.24999932663475E-4;unitConverterArr["ozm"]["uk_cwt"]=5.58035558445925E-4;unitConverterArr["ozm"]["lcwt"]=5.58035558445925E-4;unitConverterArr["ozm"]["hweight"]=5.58035542790721E-4;unitConverterArr["ozm"]["stone"]= .00446428320834516;unitConverterArr["ozm"]["ton"]=3.12499824584161E-5;unitConverterArr["ozm"]["uk_ton"]=2.79017779222963E-5;unitConverterArr["ozm"]["LTON"]=2.79017779222963E-5;unitConverterArr["ozm"]["brton"]=2.79017771395361E-5;unitConverterArr["grain"]={};unitConverterArr["grain"]["cwt"]=1.42857127610345E-6;unitConverterArr["grain"]["shweight"]=1.42857152114129E-6;unitConverterArr["grain"]["uk_cwt"]=1.2755100679495E-6;unitConverterArr["grain"]["lcwt"]=1.2755100679495E-6;unitConverterArr["grain"]["hweight"]= 1.27551003216618E-6;unitConverterArr["grain"]["stone"]=1.02040776653733E-5;unitConverterArr["grain"]["ton"]=7.1428543657613E-8;unitConverterArr["grain"]["uk_ton"]=6.37755033974752E-8;unitConverterArr["grain"]["LTON"]=6.37755033974752E-8;unitConverterArr["grain"]["brton"]=6.37755016083088E-8;unitConverterArr["cwt"]={};unitConverterArr["cwt"]["shweight"]=1.00000017152651;unitConverterArr["cwt"]["uk_cwt"]=.892857142857143;unitConverterArr["cwt"]["lcwt"]=.892857142857143;unitConverterArr["cwt"]["hweight"]= .89285711780881;unitConverterArr["cwt"]["stone"]=7.142855128101;unitConverterArr["cwt"]["ton"]=.049999985896707;unitConverterArr["cwt"]["uk_ton"]=.0446428571428571;unitConverterArr["cwt"]["LTON"]=.0446428571428571;unitConverterArr["cwt"]["brton"]=.0446428558904405;unitConverterArr["shweight"]={};unitConverterArr["shweight"]["uk_cwt"]=.892856989708499;unitConverterArr["shweight"]["lcwt"]=.892856989708499;unitConverterArr["shweight"]["hweight"]=.892856964660171;unitConverterArr["shweight"]["stone"]= 7.1428539029122;unitConverterArr["shweight"]["ton"]=.0499999773203854;unitConverterArr["shweight"]["uk_ton"]=.044642849485425;unitConverterArr["shweight"]["LTON"]=.044642849485425;unitConverterArr["shweight"]["brton"]=.0446428482330085;unitConverterArr["uk_cwt"]={};unitConverterArr["uk_cwt"]["lcwt"]=1;unitConverterArr["uk_cwt"]["hweight"]=.999999971945867;unitConverterArr["uk_cwt"]["stone"]=7.99999774347312;unitConverterArr["uk_cwt"]["ton"]=.0559999842043118;unitConverterArr["uk_cwt"]["uk_ton"]=.05; unitConverterArr["uk_cwt"]["LTON"]=.05;unitConverterArr["uk_cwt"]["brton"]=.0499999985972934;unitConverterArr["lcwt"]={};unitConverterArr["lcwt"]["hweight"]=.999999971945867;unitConverterArr["lcwt"]["stone"]=7.99999774347312;unitConverterArr["lcwt"]["ton"]=.0559999842043118;unitConverterArr["lcwt"]["uk_ton"]=.05;unitConverterArr["lcwt"]["LTON"]=.05;unitConverterArr["lcwt"]["brton"]=.0499999985972934;unitConverterArr["lcwt"]={};unitConverterArr["lcwt"]["hweight"]=.999999971945867;unitConverterArr["lcwt"]["stone"]= 7.99999774347312;unitConverterArr["lcwt"]["ton"]=.0559999842043118;unitConverterArr["lcwt"]["uk_ton"]=.05;unitConverterArr["lcwt"]["LTON"]=.05;unitConverterArr["lcwt"]["brton"]=.0499999985972934;unitConverterArr["hweight"]={};unitConverterArr["hweight"]["stone"]=7.99999796790613;unitConverterArr["hweight"]["ton"]=.0559999857753429;unitConverterArr["hweight"]["uk_ton"]=.0500000014027067;unitConverterArr["hweight"]["LTON"]=.0500000014027067;unitConverterArr["hweight"]["brton"]=.05;unitConverterArr["stone"]= {};unitConverterArr["stone"]["ton"]=.007;unitConverterArr["stone"]["uk_ton"]=.00625000176291212;unitConverterArr["stone"]["LTON"]=.00625000176291212;unitConverterArr["stone"]["brton"]=.00625000158757374;unitConverterArr["ton"]={};unitConverterArr["ton"]["uk_ton"]=.892857394701732;unitConverterArr["ton"]["LTON"]=.892857394701732;unitConverterArr["ton"]["brton"]=.892857369653392;unitConverterArr["uk_ton"]={};unitConverterArr["uk_ton"]["LTON"]=1;unitConverterArr["uk_ton"]["brton"]=.999999971945867;unitConverterArr["LTON"]= {};unitConverterArr["LTON"]["brton"]=.999999971945867};var generateDistance=function(){unitConverterArr["m"]={};unitConverterArr["m"]["mi"]=6.21371192237334E-4;unitConverterArr["m"]["Nmi"]=5.39956803455724E-4;unitConverterArr["m"]["in"]=39.3700787401575;unitConverterArr["m"]["ft"]=3.28083989501312;unitConverterArr["m"]["yd"]=1.09361329833771;unitConverterArr["m"]["ang"]=1E10;unitConverterArr["m"]["ell"]=.8748906;unitConverterArr["m"]["ly"]=1.05702345577329E-16;unitConverterArr["m"]["parsec"]=3.240779E-17; unitConverterArr["m"]["pc"]=3.240779E-17;unitConverterArr["m"]["Pica"]=2834.64566929134;unitConverterArr["m"]["pica"]=236.220472441;unitConverterArr["m"]["survey_mi"]=6.21369949494949E-4;unitConverterArr["mi"]={};unitConverterArr["mi"]["Nmi"]=.868976241900648;unitConverterArr["mi"]["in"]=63360;unitConverterArr["mi"]["ft"]=5280;unitConverterArr["mi"]["yd"]=1760;unitConverterArr["mi"]["ang"]=1609344E7;unitConverterArr["mi"]["ell"]=1407.9999377664;unitConverterArr["mi"]["ly"]=1.70111435640801E-13;unitConverterArr["mi"]["parsec"]= 5.215528238976E-14;unitConverterArr["mi"]["pc"]=5.215528238976E-14;unitConverterArr["mi"]["Pica"]=4561920;unitConverterArr["mi"]["pica"]=380160.000000089;unitConverterArr["mi"]["survey_mi"]=.999998;unitConverterArr["Nmi"]={};unitConverterArr["Nmi"]["in"]=72913.3858267717;unitConverterArr["Nmi"]["ft"]=6076.1154855643;unitConverterArr["Nmi"]["yd"]=2025.37182852143;unitConverterArr["Nmi"]["ang"]=1852E10;unitConverterArr["Nmi"]["ell"]=1620.2973912;unitConverterArr["Nmi"]["ly"]=1.95760744009214E-13;unitConverterArr["Nmi"]["parsec"]= 6.001922708E-14;unitConverterArr["Nmi"]["pc"]=6.001922708E-14;unitConverterArr["Nmi"]["Pica"]=5249763.77952756;unitConverterArr["Nmi"]["pica"]=437480.314960732;unitConverterArr["Nmi"]["survey_mi"]=1.15077714646465;unitConverterArr["in"]={};unitConverterArr["in"]["ft"]=.0833333333333333;unitConverterArr["in"]["yd"]=.0277777777777778;unitConverterArr["in"]["ang"]=254E6;unitConverterArr["in"]["ell"]=.02222222124;unitConverterArr["in"]["ly"]=2.68483957766416E-18;unitConverterArr["in"]["parsec"]=8.23157866E-19; unitConverterArr["in"]["pc"]=8.23157866E-19;unitConverterArr["in"]["Pica"]=72;unitConverterArr["in"]["pica"]=6.0000000000014;unitConverterArr["in"]["survey_mi"]=1.57827967171717E-5;unitConverterArr["ft"]={};unitConverterArr["ft"]["yd"]=.333333333333333;unitConverterArr["ft"]["ang"]=3048E6;unitConverterArr["ft"]["ell"]=.26666665488;unitConverterArr["ft"]["ly"]=3.221807493197E-17;unitConverterArr["ft"]["parsec"]=9.877894392E-18;unitConverterArr["ft"]["pc"]=9.877894392E-18;unitConverterArr["ft"]["Pica"]= 864;unitConverterArr["ft"]["pica"]=72.0000000000168;unitConverterArr["ft"]["survey_mi"]=1.89393560606061E-4;unitConverterArr["yd"]={};unitConverterArr["yd"]["ang"]=9144E6;unitConverterArr["yd"]["ell"]=.79999996464;unitConverterArr["yd"]["ly"]=9.66542247959099E-17;unitConverterArr["yd"]["parsec"]=2.9633683176E-17;unitConverterArr["yd"]["pc"]=2.9633683176E-17;unitConverterArr["yd"]["Pica"]=2592;unitConverterArr["yd"]["pica"]=216.00000000005;unitConverterArr["yd"]["survey_mi"]=5.68180681818182E-4;unitConverterArr["ang"]= {};unitConverterArr["ang"]["ell"]=8.748906E-11;unitConverterArr["ang"]["ly"]=1.05702345577329E-26;unitConverterArr["ang"]["parsec"]=3.240779E-27;unitConverterArr["ang"]["pc"]=3.240779E-27;unitConverterArr["ang"]["Pica"]=2.83464566929134E-7;unitConverterArr["ang"]["pica"]=2.36220472441E-8;unitConverterArr["ang"]["survey_mi"]=6.2136994949495E-14;unitConverterArr["ell"]={};unitConverterArr["ell"]["ly"]=1.20817786335034E-16;unitConverterArr["ell"]["parsec"]=3.70421056072611E-17;unitConverterArr["ell"]["pc"]= 3.70421056072611E-17;unitConverterArr["ell"]["Pica"]=3240.00014320801;unitConverterArr["ell"]["pica"]=270.000011934064;unitConverterArr["ell"]["survey_mi"]=7.10225883664711E-4;unitConverterArr["ly"]={};unitConverterArr["ly"]["parsec"]=.30659480471312;unitConverterArr["ly"]["pc"]=.30659480471312;unitConverterArr["ly"]["Pica"]=2.68172447244094E19;unitConverterArr["ly"]["pica"]=0x1f037fd52f205e00;unitConverterArr["ly"]["survey_mi"]=5.87848780555555E12;unitConverterArr["parsec"]={};unitConverterArr["parsec"]["pc"]= 1;unitConverterArr["parsec"]["Pica"]=8.74680337440886E19;unitConverterArr["parsec"]["pica"]=0x6527bd7050a00c00;unitConverterArr["parsec"]["survey_mi"]=1.91734749421343E13;unitConverterArr["pc"]={};unitConverterArr["pc"]["Pica"]=8.74680337440886E19;unitConverterArr["pc"]["pica"]=0x6527bd7050a00c00;unitConverterArr["pc"]["survey_mi"]=1.91734749421343E13;unitConverterArr["Pica"]={};unitConverterArr["Pica"]["pica"]=.0833333333333528;unitConverterArr["Pica"]["survey_mi"]=2.19205509960718E-7;unitConverterArr["pica"]= {};unitConverterArr["pica"]["survey_mi"]=2.63046611952801E-6};var generateTime=function(){unitConverterArr["yr"]={};unitConverterArr["yr"]["day"]=365.25;unitConverterArr["yr"]["d"]=365.25;unitConverterArr["yr"]["hr"]=8766;unitConverterArr["yr"]["mn"]=525960;unitConverterArr["yr"]["min"]=525960;unitConverterArr["yr"]["sec"]=31557600;unitConverterArr["yr"]["s"]=31557600;unitConverterArr["day"]={};unitConverterArr["day"]["d"]=1;unitConverterArr["day"]["hr"]=24;unitConverterArr["day"]["mn"]=1440;unitConverterArr["day"]["min"]= 1440;unitConverterArr["day"]["sec"]=86400;unitConverterArr["day"]["s"]=86400;unitConverterArr["d"]={};unitConverterArr["d"]["hr"]=24;unitConverterArr["d"]["mn"]=1440;unitConverterArr["d"]["min"]=1440;unitConverterArr["d"]["sec"]=86400;unitConverterArr["d"]["s"]=86400;unitConverterArr["hr"]={};unitConverterArr["hr"]["mn"]=60;unitConverterArr["hr"]["min"]=60;unitConverterArr["hr"]["sec"]=3600;unitConverterArr["hr"]["s"]=3600;unitConverterArr["mn"]={};unitConverterArr["mn"]["min"]=1;unitConverterArr["mn"]["sec"]= 60;unitConverterArr["mn"]["s"]=60;unitConverterArr["min"]={};unitConverterArr["min"]["sec"]=60;unitConverterArr["min"]["s"]=60;unitConverterArr["sec"]={};unitConverterArr["sec"]["s"]=1};var generatePressure=function(){unitConverterArr["Pa"]={};unitConverterArr["Pa"]["atm"]=9.86923299998193E-6;unitConverterArr["Pa"]["at"]=9.86923299998193E-6;unitConverterArr["Pa"]["mmHg"]=.00750061707998627;unitConverterArr["Pa"]["psi"]=1.450377E-4;unitConverterArr["Pa"]["Torr"]=.007500638;unitConverterArr["atm"]= {};unitConverterArr["atm"]["at"]=1;unitConverterArr["atm"]["mmHg"]=760;unitConverterArr["atm"]["psi"]=14.6959444569062;unitConverterArr["atm"]["Torr"]=760.00211972032;unitConverterArr["at"]={};unitConverterArr["at"]["mmHg"]=760;unitConverterArr["at"]["psi"]=14.6959444569062;unitConverterArr["at"]["Torr"]=760.00211972032;unitConverterArr["mmHg"]={};unitConverterArr["mmHg"]["psi"]=.019336769022245;unitConverterArr["mmHg"]["Torr"]=1.00000278910568;unitConverterArr["psi"]={};unitConverterArr["psi"]["Torr"]= 51.7150920071126};var generateForceAndEnergy=function(){unitConverterArr["N"]={};unitConverterArr["N"]["dyn"]=1E5;unitConverterArr["N"]["dy"]=1E5;unitConverterArr["N"]["lbf"]=.224808923655339;unitConverterArr["N"]["pond"]=101.9716;unitConverterArr["dyn"]={};unitConverterArr["dyn"]["dy"]=1;unitConverterArr["dyn"]["lbf"]=2.24808923655339E-6;unitConverterArr["dyn"]["pond"]=.001019716;unitConverterArr["dy"]={};unitConverterArr["dy"]["lbf"]=2.24808923655339E-6;unitConverterArr["dy"]["pond"]=.001019716; unitConverterArr["lbf"]={};unitConverterArr["lbf"]["pond"]=453.5923144952;unitConverterArr["J"]={};unitConverterArr["J"]["e"]=1E7;unitConverterArr["J"]["c"]=.239006249473467;unitConverterArr["J"]["cal"]=.238846190642017;unitConverterArr["J"]["eV"]=6241457E12;unitConverterArr["J"]["ev"]=6241457E12;unitConverterArr["J"]["HPh"]=3.72506111111111E-7;unitConverterArr["J"]["hh"]=3.72506111111111E-7;unitConverterArr["J"]["Wh"]=2.77777777777778E-4;unitConverterArr["J"]["wh"]=2.77777777777778E-4;unitConverterArr["J"]["flb"]= 23.7304222192651;unitConverterArr["J"]["BTU"]=9.47815067349015E-4;unitConverterArr["J"]["btu"]=9.47815067349015E-4;unitConverterArr["e"]={};unitConverterArr["e"]["c"]=2.39006249473467E-8;unitConverterArr["e"]["cal"]=2.38846190642017E-8;unitConverterArr["e"]["eV"]=6241457E5;unitConverterArr["e"]["ev"]=6241457E5;unitConverterArr["e"]["HPh"]=3.72506111111111E-14;unitConverterArr["e"]["hh"]=3.72506111111111E-14;unitConverterArr["e"]["Wh"]=2.77777777777778E-11;unitConverterArr["e"]["wh"]=2.77777777777778E-11; unitConverterArr["e"]["flb"]=2.37304222192651E-6;unitConverterArr["e"]["BTU"]=9.47815067349015E-11;unitConverterArr["e"]["btu"]=9.47815067349015E-11;unitConverterArr["c"]={};unitConverterArr["c"]["cal"]=.99933031528756;unitConverterArr["c"]["eV"]=2.61141999999999E19;unitConverterArr["c"]["ev"]=2.61141999999999E19;unitConverterArr["c"]["HPh"]=1.55856222141365E-6;unitConverterArr["c"]["hh"]=1.55856222141365E-6;unitConverterArr["c"]["Wh"]=.0011622197260102;unitConverterArr["c"]["wh"]=.0011622197260102; unitConverterArr["c"]["flb"]=99.2878733152101;unitConverterArr["c"]["BTU"]=.00396564972437775;unitConverterArr["c"]["btu"]=.00396564972437775;unitConverterArr["cal"]={};unitConverterArr["cal"]["eV"]=2.61317E19;unitConverterArr["cal"]["ev"]=2.61317E19;unitConverterArr["cal"]["HPh"]=1.55960666615539E-6;unitConverterArr["cal"]["hh"]=1.55960666615539E-6;unitConverterArr["cal"]["Wh"]=.00116299856837203;unitConverterArr["cal"]["wh"]=.00116299856837203;unitConverterArr["cal"]["flb"]=99.3544094443285;unitConverterArr["cal"]["BTU"]= .00396830723907002;unitConverterArr["cal"]["btu"]=.00396830723907002;unitConverterArr["eV"]={};unitConverterArr["eV"]["ev"]=1;unitConverterArr["eV"]["HPh"]=5.968255667084E-26;unitConverterArr["eV"]["hh"]=5.968255667084E-26;unitConverterArr["eV"]["Wh"]=4.45052778185891E-23;unitConverterArr["eV"]["wh"]=4.45052778185891E-23;unitConverterArr["eV"]["flb"]=3.80206452103493E-18;unitConverterArr["eV"]["BTU"]=1.51857982414846E-22;unitConverterArr["eV"]["btu"]=1.51857982414846E-22;unitConverterArr["ev"]={}; unitConverterArr["ev"]["HPh"]=5.968255667084E-26;unitConverterArr["ev"]["hh"]=5.968255667084E-26;unitConverterArr["ev"]["Wh"]=4.45052778185891E-23;unitConverterArr["ev"]["wh"]=4.45052778185891E-23;unitConverterArr["ev"]["flb"]=3.80206452103493E-18;unitConverterArr["ev"]["BTU"]=1.51857982414846E-22;unitConverterArr["ev"]["btu"]=1.51857982414846E-22;unitConverterArr["HPh"]={};unitConverterArr["HPh"]["hh"]=1;unitConverterArr["HPh"]["Wh"]=745.699921403228;unitConverterArr["HPh"]["wh"]=745.699921403228; unitConverterArr["HPh"]["flb"]=6.37047863415771E7;unitConverterArr["HPh"]["BTU"]=2544.42823641704;unitConverterArr["HPh"]["btu"]=2544.42823641704;unitConverterArr["hh"]={};unitConverterArr["hh"]["Wh"]=745.699921403228;unitConverterArr["hh"]["wh"]=745.699921403228;unitConverterArr["hh"]["flb"]=6.37047863415771E7;unitConverterArr["hh"]["BTU"]=2544.42823641704;unitConverterArr["hh"]["btu"]=2544.42823641704;unitConverterArr["Wh"]={};unitConverterArr["Wh"]["wh"]=1;unitConverterArr["Wh"]["flb"]=85429.5199893544; unitConverterArr["Wh"]["BTU"]=3.41213424245645;unitConverterArr["Wh"]["btu"]=3.41213424245645;unitConverterArr["wh"]={};unitConverterArr["wh"]["flb"]=85429.5199893544;unitConverterArr["wh"]["BTU"]=3.41213424245645;unitConverterArr["wh"]["btu"]=3.41213424245645;unitConverterArr["flb"]={};unitConverterArr["flb"]["BTU"]=3.99409272448405E-5;unitConverterArr["flb"]["btu"]=3.99409272448405E-5;unitConverterArr["BTU"]={};unitConverterArr["BTU"]["btu"]=1};var generatePowerMagnetismTemperature=function(){unitConverterArr["HP"]= {};unitConverterArr["HP"]["h"]=1;unitConverterArr["HP"]["PS"]=1.0138700185381;unitConverterArr["HP"]["W"]=745.699921403228;unitConverterArr["HP"]["w"]=745.699921403228;unitConverterArr["h"]={};unitConverterArr["h"]["PS"]=1.0138700185381;unitConverterArr["h"]["W"]=745.699921403228;unitConverterArr["h"]["w"]=745.699921403228;unitConverterArr["PS"]={};unitConverterArr["PS"]["W"]=735.498542977386;unitConverterArr["PS"]["w"]=735.498542977386;unitConverterArr["W"]={};unitConverterArr["W"]["w"]=1;unitConverterArr["T"]= {};unitConverterArr["T"]["ga"]=1E4;unitConverterArr["C"]={};unitConverterArr["C"]["cel"]=1;unitConverterArr["C"]["F"]=[{type:0,val:1.8},{type:1,val:32}];unitConverterArr["C"]["fah"]=[{type:0,val:1.8},{type:1,val:32}];unitConverterArr["C"]["K"]=[{type:1,val:273.15}];unitConverterArr["C"]["kel"]=[{type:1,val:273.15}];unitConverterArr["C"]["Rank"]=[{type:1,val:273.15},{type:0,val:1.8}];unitConverterArr["C"]["Reau"]=.8;unitConverterArr["cel"]={};unitConverterArr["cel"]["F"]=[{type:0,val:1.8},{type:1, val:32}];unitConverterArr["cel"]["fah"]=[{type:0,val:1.8},{type:1,val:32}];unitConverterArr["cel"]["K"]=[{type:1,val:273.15}];unitConverterArr["cel"]["kel"]=[{type:1,val:273.15}];unitConverterArr["cel"]["Rank"]=[{type:1,val:273.15},{type:0,val:1.8}];unitConverterArr["cel"]["Reau"]=.8;unitConverterArr["F"]={};unitConverterArr["F"]["fah"]=1;unitConverterArr["F"]["K"]=[{type:1,val:-32},{type:0,val:5/9},{type:1,val:273.15}];unitConverterArr["F"]["kel"]=[{type:1,val:-32},{type:0,val:5/9},{type:1,val:273.15}]; unitConverterArr["F"]["Rank"]=[{type:1,val:459.67}];unitConverterArr["F"]["Reau"]=[{type:1,val:-32},{type:0,val:.444444}];unitConverterArr["fah"]={};unitConverterArr["fah"]["K"]=[{type:1,val:-32},{type:0,val:5/9},{type:1,val:273.15}];unitConverterArr["fah"]["kel"]=[{type:1,val:-32},{type:0,val:5/9},{type:1,val:273.15}];unitConverterArr["fah"]["Rank"]=[{type:1,val:459.67}];unitConverterArr["fah"]["Reau"]=[{type:1,val:-32},{type:0,val:.444444}];unitConverterArr["K"]={};unitConverterArr["K"]["kel"]= 1;unitConverterArr["K"]["Rank"]=1.8;unitConverterArr["K"]["Reau"]=[{type:1,val:-273.15},{type:0,val:.8}];unitConverterArr["kel"]={};unitConverterArr["kel"]["Rank"]=1.8;unitConverterArr["kel"]["Reau"]=[{type:1,val:-273.15},{type:0,val:.8}];unitConverterArr["Rank"]={};unitConverterArr["Rank"]["Reau"]=[{type:0,val:.4444444},{type:1,val:-218.52}]};var generateVolume=function(){unitConverterArr["tsp"]={};unitConverterArr["tsp"]["tspm"]=.98578431875;unitConverterArr["tsp"]["tbs"]=.333333333333333;unitConverterArr["tsp"]["oz"]= .166666666666667;unitConverterArr["tsp"]["cup"]=.0208333333333333;unitConverterArr["tsp"]["pt"]=.0104166666666667;unitConverterArr["tsp"]["us_pt"]=.0104166666666667;unitConverterArr["tsp"]["uk_pt"]=.00867368942321863;unitConverterArr["tsp"]["qt"]=.00520833333333333;unitConverterArr["tsp"]["uk_qt"]=.00433684471160932;unitConverterArr["tsp"]["gal"]=.00130208333333333;unitConverterArr["tsp"]["uk_gal"]=.00108421117790233;unitConverterArr["tsp"]["l"]=.00492892159375;unitConverterArr["tsp"]["L"]=.00492892159375; unitConverterArr["tsp"]["lt"]=.00492892159375;unitConverterArr["tsp"]["ang3"]=4.92892159375E24;unitConverterArr["tsp"]["ang^3"]=4.92892159375E24;unitConverterArr["tsp"]["barrel"]=3.10019841269841E-5;unitConverterArr["tsp"]["bushel"]=1.39870916129584E-4;unitConverterArr["tsp"]["ft3"]=1.7406322337963E-4;unitConverterArr["tsp"]["ft^3"]=1.7406322337963E-4;unitConverterArr["tsp"]["in3"]=.30078125;unitConverterArr["tsp"]["in^3"]=.30078125;unitConverterArr["tsp"]["ly3"]=5.82110969649095E-54;unitConverterArr["tsp"]["ly^3"]= 5.82110969649095E-54;unitConverterArr["tsp"]["ang^3"]=4.92892159375E24;unitConverterArr["tsp"]["m3"]=4.92892159375E-6;unitConverterArr["tsp"]["m^3"]=4.92892159375E-6;unitConverterArr["tsp"]["mi3"]=1.18251117637581E-15;unitConverterArr["tsp"]["mi^3"]=1.18251117637581E-15;unitConverterArr["tsp"]["yd3"]=6.4467860510974E-6;unitConverterArr["tsp"]["yd^3"]=6.4467860510974E-6;unitConverterArr["tsp"]["Nmi3"]=7.7594146898722E-16;unitConverterArr["tsp"]["Nmi^3"]=7.7594146898722E-16;unitConverterArr["tsp"]["Pica3"]= 112266;unitConverterArr["tsp"]["Pica^3"]=112266;unitConverterArr["tsp"]["GRT"]=1.74063239539155E-6;unitConverterArr["tsp"]["regton"]=1.74063239539155E-6;unitConverterArr["tsp"]["MTON"]=.00696252893518519;unitConverterArr["tspm"]={};unitConverterArr["tspm"]["tbs"]=.33814022701843;unitConverterArr["tspm"]["oz"]=.169070113509215;unitConverterArr["tspm"]["cup"]=.0211337641886519;unitConverterArr["tspm"]["pt"]=.0105668820943259;unitConverterArr["tspm"]["us_pt"]=.0105668820943259;unitConverterArr["tspm"]["uk_pt"]= .00879876993196351;unitConverterArr["tspm"]["qt"]=.00528344104716297;unitConverterArr["tspm"]["uk_qt"]=.00439938496598176;unitConverterArr["tspm"]["gal"]=.00132086026179074;unitConverterArr["tspm"]["uk_gal"]=.00109984624149544;unitConverterArr["tspm"]["l"]=.005;unitConverterArr["tspm"]["L"]=.005;unitConverterArr["tspm"]["lt"]=.005;unitConverterArr["tspm"]["ang3"]=5E24;unitConverterArr["tspm"]["ang^3"]=5E24;unitConverterArr["tspm"]["barrel"]=3.14490538521605E-5;unitConverterArr["tspm"]["bushel"]=1.4188795E-4; unitConverterArr["tspm"]["ft3"]=1.76573333607443E-4;unitConverterArr["tspm"]["ft^3"]=1.76573333607443E-4;unitConverterArr["tspm"]["in3"]=.305118720473661;unitConverterArr["tspm"]["in^3"]=.305118720473661;unitConverterArr["tspm"]["ly3"]=5.9050540628119E-54;unitConverterArr["tspm"]["ly^3"]=5.9050540628119E-54;unitConverterArr["tspm"]["ang^3"]=5E24;unitConverterArr["tspm"]["m3"]=5E-6;unitConverterArr["tspm"]["m^3"]=5E-6;unitConverterArr["tspm"]["mi3"]=1.19956379289464E-15;unitConverterArr["tspm"]["mi^3"]= 1.19956379289464E-15;unitConverterArr["tspm"]["yd3"]=6.53975309657196E-6;unitConverterArr["tspm"]["yd^3"]=6.53975309657196E-6;unitConverterArr["tspm"]["Nmi3"]=7.87131073429058E-16;unitConverterArr["tspm"]["Nmi^3"]=7.87131073429058E-16;unitConverterArr["tspm"]["Pica3"]=113884.952179353;unitConverterArr["tspm"]["Pica^3"]=113884.952179353;unitConverterArr["tspm"]["GRT"]=1.7657335E-6;unitConverterArr["tspm"]["regton"]=1.7657335E-6;unitConverterArr["tspm"]["MTON"]=.00706293334429772;unitConverterArr["tbs"]= {};unitConverterArr["tbs"]["oz"]=.5;unitConverterArr["tbs"]["cup"]=.0625;unitConverterArr["tbs"]["pt"]=.03125;unitConverterArr["tbs"]["us_pt"]=.03125;unitConverterArr["tbs"]["uk_pt"]=.0260210682696559;unitConverterArr["tbs"]["qt"]=.015625;unitConverterArr["tbs"]["uk_qt"]=.013010534134828;unitConverterArr["tbs"]["gal"]=.00390625;unitConverterArr["tbs"]["uk_gal"]=.00325263353370699;unitConverterArr["tbs"]["l"]=.01478676478125;unitConverterArr["tbs"]["L"]=.01478676478125;unitConverterArr["tbs"]["lt"]= .01478676478125;unitConverterArr["tbs"]["ang3"]=1.478676478125E25;unitConverterArr["tbs"]["ang^3"]=1.478676478125E25;unitConverterArr["tbs"]["barrel"]=9.30059523809524E-5;unitConverterArr["tbs"]["bushel"]=4.19612748388752E-4;unitConverterArr["tbs"]["ft3"]=5.22189670138889E-4;unitConverterArr["tbs"]["ft^3"]=5.22189670138889E-4;unitConverterArr["tbs"]["in3"]=.90234375;unitConverterArr["tbs"]["in^3"]=.90234375;unitConverterArr["tbs"]["ly3"]=1.74633290894728E-53;unitConverterArr["tbs"]["ly^3"]=1.74633290894728E-53; unitConverterArr["tbs"]["ang^3"]=1.478676478125E25;unitConverterArr["tbs"]["m3"]=1.478676478125E-5;unitConverterArr["tbs"]["m^3"]=1.478676478125E-5;unitConverterArr["tbs"]["mi3"]=3.54753352912742E-15;unitConverterArr["tbs"]["mi^3"]=3.54753352912742E-15;unitConverterArr["tbs"]["yd3"]=1.93403581532922E-5;unitConverterArr["tbs"]["yd^3"]=1.93403581532922E-5;unitConverterArr["tbs"]["Nmi3"]=2.32782440696166E-15;unitConverterArr["tbs"]["Nmi^3"]=2.32782440696166E-15;unitConverterArr["tbs"]["Pica3"]=336798; unitConverterArr["tbs"]["Pica^3"]=336798;unitConverterArr["tbs"]["GRT"]=5.22189718617466E-6;unitConverterArr["tbs"]["regton"]=5.22189718617466E-6;unitConverterArr["tbs"]["MTON"]=.0208875868055556;unitConverterArr["oz"]={};unitConverterArr["oz"]["cup"]=.125;unitConverterArr["oz"]["pt"]=.0625;unitConverterArr["oz"]["us_pt"]=.0625;unitConverterArr["oz"]["uk_pt"]=.0520421365393118;unitConverterArr["oz"]["qt"]=.03125;unitConverterArr["oz"]["uk_qt"]=.0260210682696559;unitConverterArr["oz"]["gal"]=.0078125; unitConverterArr["oz"]["uk_gal"]=.00650526706741398;unitConverterArr["oz"]["l"]=.0295735295625;unitConverterArr["oz"]["L"]=.0295735295625;unitConverterArr["oz"]["lt"]=.0295735295625;unitConverterArr["oz"]["ang3"]=2.95735295625E25;unitConverterArr["oz"]["ang^3"]=2.95735295625E25;unitConverterArr["oz"]["barrel"]=1.86011904761905E-4;unitConverterArr["oz"]["bushel"]=8.39225496777505E-4;unitConverterArr["oz"]["ft3"]=.00104437934027778;unitConverterArr["oz"]["ft^3"]=.00104437934027778;unitConverterArr["oz"]["in3"]= 1.8046875;unitConverterArr["oz"]["in^3"]=1.8046875;unitConverterArr["oz"]["ly3"]=3.49266581789457E-53;unitConverterArr["oz"]["ly^3"]=3.49266581789457E-53;unitConverterArr["oz"]["ang^3"]=2.95735295625E25;unitConverterArr["oz"]["m3"]=2.95735295625E-5;unitConverterArr["oz"]["m^3"]=2.95735295625E-5;unitConverterArr["oz"]["mi3"]=7.09506705825485E-15;unitConverterArr["oz"]["mi^3"]=7.09506705825485E-15;unitConverterArr["oz"]["yd3"]=3.86807163065844E-5;unitConverterArr["oz"]["yd^3"]=3.86807163065844E-5;unitConverterArr["oz"]["Nmi3"]= 4.65564881392332E-15;unitConverterArr["oz"]["Nmi^3"]=4.65564881392332E-15;unitConverterArr["oz"]["Pica3"]=673596;unitConverterArr["oz"]["Pica^3"]=673596;unitConverterArr["oz"]["GRT"]=1.04437943723493E-5;unitConverterArr["oz"]["regton"]=1.04437943723493E-5;unitConverterArr["oz"]["MTON"]=.0417751736111111;unitConverterArr["cup"]={};unitConverterArr["cup"]["pt"]=.5;unitConverterArr["cup"]["us_pt"]=.5;unitConverterArr["cup"]["uk_pt"]=.416337092314494;unitConverterArr["cup"]["qt"]=.25;unitConverterArr["cup"]["uk_qt"]= .208168546157247;unitConverterArr["cup"]["gal"]=.0625;unitConverterArr["cup"]["uk_gal"]=.0520421365393118;unitConverterArr["cup"]["l"]=.2365882365;unitConverterArr["cup"]["L"]=.2365882365;unitConverterArr["cup"]["lt"]=.2365882365;unitConverterArr["cup"]["ang3"]=2.365882365E26;unitConverterArr["cup"]["ang^3"]=2.365882365E26;unitConverterArr["cup"]["barrel"]=.00148809523809524;unitConverterArr["cup"]["bushel"]=.00671380397422004;unitConverterArr["cup"]["ft3"]=.00835503472222222;unitConverterArr["cup"]["ft^3"]= .00835503472222222;unitConverterArr["cup"]["in3"]=14.4375;unitConverterArr["cup"]["in^3"]=14.4375;unitConverterArr["cup"]["ly3"]=2.79413265431566E-52;unitConverterArr["cup"]["ly^3"]=2.79413265431566E-52;unitConverterArr["cup"]["ang^3"]=2.365882365E26;unitConverterArr["cup"]["m3"]=2.365882365E-4;unitConverterArr["cup"]["m^3"]=2.365882365E-4;unitConverterArr["cup"]["mi3"]=5.67605364660388E-14;unitConverterArr["cup"]["mi^3"]=5.67605364660388E-14;unitConverterArr["cup"]["yd3"]=3.09445730452675E-4;unitConverterArr["cup"]["yd^3"]= 3.09445730452675E-4;unitConverterArr["cup"]["Nmi3"]=3.72451905113865E-14;unitConverterArr["cup"]["Nmi^3"]=3.72451905113865E-14;unitConverterArr["cup"]["Pica3"]=5388768;unitConverterArr["cup"]["Pica^3"]=5388768;unitConverterArr["cup"]["GRT"]=8.35503549787945E-5;unitConverterArr["cup"]["regton"]=8.35503549787945E-5;unitConverterArr["cup"]["MTON"]=.334201388888889;unitConverterArr["pt"]={};unitConverterArr["pt"]["us_pt"]=1;unitConverterArr["pt"]["uk_pt"]=.832674184628989;unitConverterArr["pt"]["qt"]= .5;unitConverterArr["pt"]["uk_qt"]=.416337092314494;unitConverterArr["pt"]["gal"]=.125;unitConverterArr["pt"]["uk_gal"]=.104084273078624;unitConverterArr["pt"]["l"]=.473176473;unitConverterArr["pt"]["L"]=.473176473;unitConverterArr["pt"]["lt"]=.473176473;unitConverterArr["pt"]["ang3"]=4.73176473E26;unitConverterArr["pt"]["ang^3"]=4.73176473E26;unitConverterArr["pt"]["barrel"]=.00297619047619048;unitConverterArr["pt"]["bushel"]=.0134276079484401;unitConverterArr["pt"]["ft3"]=.0167100694444444;unitConverterArr["pt"]["ft^3"]= .0167100694444444;unitConverterArr["pt"]["in3"]=28.875;unitConverterArr["pt"]["in^3"]=28.875;unitConverterArr["pt"]["ly3"]=5.58826530863131E-52;unitConverterArr["pt"]["ly^3"]=5.58826530863131E-52;unitConverterArr["pt"]["ang^3"]=4.73176473E26;unitConverterArr["pt"]["m3"]=4.73176473E-4;unitConverterArr["pt"]["m^3"]=4.73176473E-4;unitConverterArr["pt"]["mi3"]=1.13521072932078E-13;unitConverterArr["pt"]["mi^3"]=1.13521072932078E-13;unitConverterArr["pt"]["yd3"]=6.1889146090535E-4;unitConverterArr["pt"]["yd^3"]= 6.1889146090535E-4;unitConverterArr["pt"]["Nmi3"]=7.44903810227731E-14;unitConverterArr["pt"]["Nmi^3"]=7.44903810227731E-14;unitConverterArr["pt"]["Pica3"]=10777536;unitConverterArr["pt"]["Pica^3"]=10777536;unitConverterArr["pt"]["GRT"]=1.67100709957589E-4;unitConverterArr["pt"]["regton"]=1.67100709957589E-4;unitConverterArr["pt"]["MTON"]=.668402777777778;unitConverterArr["us_pt"]={};unitConverterArr["us_pt"]["uk_pt"]=.832674184628989;unitConverterArr["us_pt"]["qt"]=.5;unitConverterArr["us_pt"]["uk_qt"]= .416337092314494;unitConverterArr["us_pt"]["gal"]=.125;unitConverterArr["us_pt"]["uk_gal"]=.104084273078624;unitConverterArr["us_pt"]["l"]=.473176473;unitConverterArr["us_pt"]["L"]=.473176473;unitConverterArr["us_pt"]["lt"]=.473176473;unitConverterArr["us_pt"]["ang3"]=4.73176473E26;unitConverterArr["us_pt"]["ang^3"]=4.73176473E26;unitConverterArr["us_pt"]["barrel"]=.00297619047619048;unitConverterArr["us_pt"]["bushel"]=.0134276079484401;unitConverterArr["us_pt"]["ft3"]=.0167100694444444;unitConverterArr["us_pt"]["ft^3"]= .0167100694444444;unitConverterArr["us_pt"]["in3"]=28.875;unitConverterArr["us_pt"]["in^3"]=28.875;unitConverterArr["us_pt"]["ly3"]=5.58826530863131E-52;unitConverterArr["us_pt"]["ly^3"]=5.58826530863131E-52;unitConverterArr["us_pt"]["ang^3"]=4.73176473E26;unitConverterArr["us_pt"]["m3"]=4.73176473E-4;unitConverterArr["us_pt"]["m^3"]=4.73176473E-4;unitConverterArr["us_pt"]["mi3"]=1.13521072932078E-13;unitConverterArr["us_pt"]["mi^3"]=1.13521072932078E-13;unitConverterArr["us_pt"]["yd3"]=6.1889146090535E-4; unitConverterArr["us_pt"]["yd^3"]=6.1889146090535E-4;unitConverterArr["us_pt"]["Nmi3"]=7.44903810227731E-14;unitConverterArr["us_pt"]["Nmi^3"]=7.44903810227731E-14;unitConverterArr["us_pt"]["Pica3"]=10777536;unitConverterArr["us_pt"]["Pica^3"]=10777536;unitConverterArr["us_pt"]["GRT"]=1.67100709957589E-4;unitConverterArr["us_pt"]["regton"]=1.67100709957589E-4;unitConverterArr["us_pt"]["MTON"]=.668402777777778;unitConverterArr["uk_pt"]={};unitConverterArr["uk_pt"]["qt"]=.600474962752427;unitConverterArr["uk_pt"]["uk_qt"]= .5;unitConverterArr["uk_pt"]["gal"]=.150118740688107;unitConverterArr["uk_pt"]["uk_gal"]=.125;unitConverterArr["uk_pt"]["l"]=.56826125;unitConverterArr["uk_pt"]["L"]=.56826125;unitConverterArr["uk_pt"]["lt"]=.56826125;unitConverterArr["uk_pt"]["ang3"]=5.6826125E26;unitConverterArr["uk_pt"]["ang^3"]=5.6826125E26;unitConverterArr["uk_pt"]["barrel"]=.00357425573066921;unitConverterArr["uk_pt"]["bushel"]=.0161258847653875;unitConverterArr["uk_pt"]["ft3"]=.0200679566544865;unitConverterArr["uk_pt"]["ft^3"]= .0200679566544865;unitConverterArr["uk_pt"]["in3"]=34.6774290989527;unitConverterArr["uk_pt"]["in^3"]=34.6774290989527;unitConverterArr["uk_pt"]["ly3"]=6.71122680610214E-52;unitConverterArr["uk_pt"]["ly^3"]=6.71122680610214E-52;unitConverterArr["uk_pt"]["ang^3"]=5.6826125E26;unitConverterArr["uk_pt"]["m3"]=5.6826125E-4;unitConverterArr["uk_pt"]["m^3"]=5.6826125E-4;unitConverterArr["uk_pt"]["mi3"]=1.3633312408101E-13;unitConverterArr["uk_pt"]["mi^3"]=1.3633312408101E-13;unitConverterArr["uk_pt"]["yd3"]= 7.43257653869871E-4;unitConverterArr["uk_pt"]["yd^3"]=7.43257653869871E-4;unitConverterArr["uk_pt"]["Nmi3"]=8.94592175401276E-14;unitConverterArr["uk_pt"]["Nmi^3"]=8.94592175401276E-14;unitConverterArr["uk_pt"]["Pica3"]=1.29432810563259E7;unitConverterArr["uk_pt"]["Pica^3"]=1.29432810563259E7;unitConverterArr["uk_pt"]["GRT"]=2.00679585175375E-4;unitConverterArr["uk_pt"]["regton"]=2.00679585175375E-4;unitConverterArr["uk_pt"]["MTON"]=.80271826617946;unitConverterArr["qt"]={};unitConverterArr["qt"]["uk_qt"]= .832674184628989;unitConverterArr["qt"]["gal"]=.25;unitConverterArr["qt"]["uk_gal"]=.208168546157247;unitConverterArr["qt"]["l"]=.946352946;unitConverterArr["qt"]["L"]=.946352946;unitConverterArr["qt"]["lt"]=.946352946;unitConverterArr["qt"]["ang3"]=9.46352946E26;unitConverterArr["qt"]["ang^3"]=9.46352946E26;unitConverterArr["qt"]["barrel"]=.00595238095238095;unitConverterArr["qt"]["bushel"]=.0268552158968801;unitConverterArr["qt"]["ft3"]=.0334201388888889;unitConverterArr["qt"]["ft^3"]=.0334201388888889; unitConverterArr["qt"]["in3"]=57.75;unitConverterArr["qt"]["in^3"]=57.75;unitConverterArr["qt"]["ly3"]=1.11765306172626E-51;unitConverterArr["qt"]["ly^3"]=1.11765306172626E-51;unitConverterArr["qt"]["ang^3"]=9.46352946E26;unitConverterArr["qt"]["m3"]=9.46352946E-4;unitConverterArr["qt"]["m^3"]=9.46352946E-4;unitConverterArr["qt"]["mi3"]=2.27042145864155E-13;unitConverterArr["qt"]["mi^3"]=2.27042145864155E-13;unitConverterArr["qt"]["yd3"]=.0012377829218107;unitConverterArr["qt"]["yd^3"]=.0012377829218107; unitConverterArr["qt"]["Nmi3"]=1.48980762045546E-13;unitConverterArr["qt"]["Nmi^3"]=1.48980762045546E-13;unitConverterArr["qt"]["Pica3"]=21555072;unitConverterArr["qt"]["Pica^3"]=21555072;unitConverterArr["qt"]["GRT"]=3.34201419915178E-4;unitConverterArr["qt"]["regton"]=3.34201419915178E-4;unitConverterArr["qt"]["MTON"]=1.33680555555556;unitConverterArr["uk_qt"]={};unitConverterArr["uk_qt"]["gal"]=.300237481376214;unitConverterArr["uk_qt"]["uk_gal"]=.25;unitConverterArr["uk_qt"]["l"]=1.1365225;unitConverterArr["uk_qt"]["L"]= 1.1365225;unitConverterArr["uk_qt"]["lt"]=1.1365225;unitConverterArr["uk_qt"]["ang3"]=1.1365225E27;unitConverterArr["uk_qt"]["ang^3"]=1.1365225E27;unitConverterArr["uk_qt"]["barrel"]=.00714851146133842;unitConverterArr["uk_qt"]["bushel"]=.032251769530775;unitConverterArr["uk_qt"]["ft3"]=.040135913308973;unitConverterArr["uk_qt"]["ft^3"]=.040135913308973;unitConverterArr["uk_qt"]["in3"]=69.3548581979054;unitConverterArr["uk_qt"]["in^3"]=69.3548581979054;unitConverterArr["uk_qt"]["ly3"]=1.34224536122043E-51; unitConverterArr["uk_qt"]["ly^3"]=1.34224536122043E-51;unitConverterArr["uk_qt"]["ang^3"]=1.1365225E27;unitConverterArr["uk_qt"]["m3"]=.0011365225;unitConverterArr["uk_qt"]["m^3"]=.0011365225;unitConverterArr["uk_qt"]["mi3"]=2.72666248162019E-13;unitConverterArr["uk_qt"]["mi^3"]=2.72666248162019E-13;unitConverterArr["uk_qt"]["yd3"]=.00148651530773974;unitConverterArr["uk_qt"]["yd^3"]=.00148651530773974;unitConverterArr["uk_qt"]["Nmi3"]=1.78918435080255E-13;unitConverterArr["uk_qt"]["Nmi^3"]=1.78918435080255E-13; unitConverterArr["uk_qt"]["Pica3"]=2.58865621126518E7;unitConverterArr["uk_qt"]["Pica^3"]=2.58865621126518E7;unitConverterArr["uk_qt"]["GRT"]=4.0135917035075E-4;unitConverterArr["uk_qt"]["regton"]=4.0135917035075E-4;unitConverterArr["uk_qt"]["MTON"]=1.60543653235892;unitConverterArr["gal"]={};unitConverterArr["gal"]["uk_gal"]=.832674184628989;unitConverterArr["gal"]["l"]=3.785411784;unitConverterArr["gal"]["L"]=3.785411784;unitConverterArr["gal"]["lt"]=3.785411784;unitConverterArr["gal"]["ang3"]= 3.785411784E27;unitConverterArr["gal"]["ang^3"]=3.785411784E27;unitConverterArr["gal"]["barrel"]=.0238095238095238;unitConverterArr["gal"]["bushel"]=.107420863587521;unitConverterArr["gal"]["ft3"]=.133680555555556;unitConverterArr["gal"]["ft^3"]=.133680555555556;unitConverterArr["gal"]["in3"]=231;unitConverterArr["gal"]["in^3"]=231;unitConverterArr["gal"]["ly3"]=4.47061224690505E-51;unitConverterArr["gal"]["ly^3"]=4.47061224690505E-51;unitConverterArr["gal"]["ang^3"]=3.785411784E27;unitConverterArr["gal"]["m3"]= .003785411784;unitConverterArr["gal"]["m^3"]=.003785411784;unitConverterArr["gal"]["mi3"]=9.0816858345662E-13;unitConverterArr["gal"]["mi^3"]=9.0816858345662E-13;unitConverterArr["gal"]["yd3"]=.0049511316872428;unitConverterArr["gal"]["yd^3"]=.0049511316872428;unitConverterArr["gal"]["Nmi3"]=5.95923048182185E-13;unitConverterArr["gal"]["Nmi^3"]=5.95923048182185E-13;unitConverterArr["gal"]["Pica3"]=86220288;unitConverterArr["gal"]["Pica^3"]=86220288;unitConverterArr["gal"]["GRT"]=.00133680567966071; unitConverterArr["gal"]["regton"]=.00133680567966071;unitConverterArr["gal"]["MTON"]=5.34722222222222;unitConverterArr["uk_gal"]={};unitConverterArr["uk_gal"]["l"]=4.54609;unitConverterArr["uk_gal"]["L"]=4.54609;unitConverterArr["uk_gal"]["lt"]=4.54609;unitConverterArr["uk_gal"]["ang3"]=4.54609E27;unitConverterArr["uk_gal"]["ang^3"]=4.54609E27;unitConverterArr["uk_gal"]["barrel"]=.0285940458453537;unitConverterArr["uk_gal"]["bushel"]=.1290070781231;unitConverterArr["uk_gal"]["ft3"]=.160543653235892; unitConverterArr["uk_gal"]["ft^3"]=.160543653235892;unitConverterArr["uk_gal"]["in3"]=277.419432791621;unitConverterArr["uk_gal"]["in^3"]=277.419432791621;unitConverterArr["uk_gal"]["ly3"]=5.36898144488171E-51;unitConverterArr["uk_gal"]["ly^3"]=5.36898144488171E-51;unitConverterArr["uk_gal"]["ang^3"]=4.54609E27;unitConverterArr["uk_gal"]["m3"]=.00454609;unitConverterArr["uk_gal"]["m^3"]=.00454609;unitConverterArr["uk_gal"]["mi3"]=1.09066499264808E-12;unitConverterArr["uk_gal"]["mi^3"]=1.09066499264808E-12; unitConverterArr["uk_gal"]["yd3"]=.00594606123095897;unitConverterArr["uk_gal"]["yd^3"]=.00594606123095897;unitConverterArr["uk_gal"]["Nmi3"]=7.15673740321021E-13;unitConverterArr["uk_gal"]["Nmi^3"]=7.15673740321021E-13;unitConverterArr["uk_gal"]["Pica3"]=1.03546248450607E8;unitConverterArr["uk_gal"]["Pica^3"]=1.03546248450607E8;unitConverterArr["uk_gal"]["GRT"]=.001605436681403;unitConverterArr["uk_gal"]["regton"]=.001605436681403;unitConverterArr["uk_gal"]["MTON"]=6.42174612943568;unitConverterArr["l"]= {};unitConverterArr["l"]["L"]=1;unitConverterArr["l"]["lt"]=1;unitConverterArr["l"]["ang3"]=1E27;unitConverterArr["l"]["ang^3"]=1E27;unitConverterArr["l"]["barrel"]=.00628981077043211;unitConverterArr["l"]["bushel"]=.02837759;unitConverterArr["l"]["ft3"]=.0353146667214886;unitConverterArr["l"]["ft^3"]=.0353146667214886;unitConverterArr["l"]["in3"]=61.0237440947323;unitConverterArr["l"]["in^3"]=61.0237440947323;unitConverterArr["l"]["ly3"]=1.18101081256238E-51;unitConverterArr["l"]["ly^3"]=1.18101081256238E-51; unitConverterArr["l"]["ang^3"]=1E27;unitConverterArr["l"]["m3"]=.001;unitConverterArr["l"]["m^3"]=.001;unitConverterArr["l"]["mi3"]=2.39912758578928E-13;unitConverterArr["l"]["mi^3"]=2.39912758578928E-13;unitConverterArr["l"]["yd3"]=.00130795061931439;unitConverterArr["l"]["yd^3"]=.00130795061931439;unitConverterArr["l"]["Nmi3"]=1.57426214685811E-13;unitConverterArr["l"]["Nmi^3"]=1.57426214685811E-13;unitConverterArr["l"]["Pica3"]=2.27769904358706E7;unitConverterArr["l"]["Pica^3"]=2.27769904358706E7; unitConverterArr["l"]["GRT"]=3.531467E-4;unitConverterArr["l"]["regton"]=3.531467E-4;unitConverterArr["l"]["MTON"]=1.41258666885954;unitConverterArr["L"]={};unitConverterArr["L"]["lt"]=1;unitConverterArr["L"]["ang3"]=1E27;unitConverterArr["L"]["ang^3"]=1E27;unitConverterArr["L"]["barrel"]=.00628981077043211;unitConverterArr["L"]["bushel"]=.02837759;unitConverterArr["L"]["ft3"]=.0353146667214886;unitConverterArr["L"]["ft^3"]=.0353146667214886;unitConverterArr["L"]["in3"]=61.0237440947323;unitConverterArr["L"]["in^3"]= 61.0237440947323;unitConverterArr["L"]["ly3"]=1.18101081256238E-51;unitConverterArr["L"]["ly^3"]=1.18101081256238E-51;unitConverterArr["L"]["ang^3"]=1E27;unitConverterArr["L"]["m3"]=.001;unitConverterArr["L"]["m^3"]=.001;unitConverterArr["L"]["mi3"]=2.39912758578928E-13;unitConverterArr["L"]["mi^3"]=2.39912758578928E-13;unitConverterArr["L"]["yd3"]=.00130795061931439;unitConverterArr["L"]["yd^3"]=.00130795061931439;unitConverterArr["L"]["Nmi3"]=1.57426214685811E-13;unitConverterArr["L"]["Nmi^3"]= 1.57426214685811E-13;unitConverterArr["L"]["Pica3"]=2.27769904358706E7;unitConverterArr["L"]["Pica^3"]=2.27769904358706E7;unitConverterArr["L"]["GRT"]=3.531467E-4;unitConverterArr["L"]["regton"]=3.531467E-4;unitConverterArr["L"]["MTON"]=1.41258666885954;unitConverterArr["lt"]={};unitConverterArr["lt"]["ang3"]=1E27;unitConverterArr["lt"]["ang^3"]=1E27;unitConverterArr["lt"]["barrel"]=.00628981077043211;unitConverterArr["lt"]["bushel"]=.02837759;unitConverterArr["lt"]["ft3"]=.0353146667214886;unitConverterArr["lt"]["ft^3"]= .0353146667214886;unitConverterArr["lt"]["in3"]=61.0237440947323;unitConverterArr["lt"]["in^3"]=61.0237440947323;unitConverterArr["lt"]["ly3"]=1.18101081256238E-51;unitConverterArr["lt"]["ly^3"]=1.18101081256238E-51;unitConverterArr["lt"]["ang^3"]=1E27;unitConverterArr["lt"]["m3"]=.001;unitConverterArr["lt"]["m^3"]=.001;unitConverterArr["lt"]["mi3"]=2.39912758578928E-13;unitConverterArr["lt"]["mi^3"]=2.39912758578928E-13;unitConverterArr["lt"]["yd3"]=.00130795061931439;unitConverterArr["lt"]["yd^3"]= .00130795061931439;unitConverterArr["lt"]["Nmi3"]=1.57426214685811E-13;unitConverterArr["lt"]["Nmi^3"]=1.57426214685811E-13;unitConverterArr["lt"]["Pica3"]=2.27769904358706E7;unitConverterArr["lt"]["Pica^3"]=2.27769904358706E7;unitConverterArr["lt"]["GRT"]=3.531467E-4;unitConverterArr["lt"]["regton"]=3.531467E-4;unitConverterArr["lt"]["MTON"]=1.41258666885954;unitConverterArr["ang3"]={};unitConverterArr["ang3"]["ang^3"]=1;unitConverterArr["ang3"]["barrel"]=6.28981077043211E-30;unitConverterArr["ang3"]["bushel"]= 2.837759E-29;unitConverterArr["ang3"]["ft3"]=3.53146667214886E-29;unitConverterArr["ang3"]["ft^3"]=3.53146667214886E-29;unitConverterArr["ang3"]["in3"]=6.10237440947323E-26;unitConverterArr["ang3"]["in^3"]=6.10237440947323E-26;unitConverterArr["ang3"]["ly3"]=1.18101081256238E-78;unitConverterArr["ang3"]["ly^3"]=1.18101081256238E-78;unitConverterArr["ang3"]["ang^3"]=1;unitConverterArr["ang3"]["m3"]=1E-30;unitConverterArr["ang3"]["m^3"]=1E-30;unitConverterArr["ang3"]["mi3"]=2.39912758578928E-40;unitConverterArr["ang3"]["mi^3"]= 2.39912758578928E-40;unitConverterArr["ang3"]["yd3"]=1.30795061931439E-30;unitConverterArr["ang3"]["yd^3"]=1.30795061931439E-30;unitConverterArr["ang3"]["Nmi3"]=1.57426214685812E-40;unitConverterArr["ang3"]["Nmi^3"]=1.57426214685812E-40;unitConverterArr["ang3"]["Pica3"]=2.27769904358706E-20;unitConverterArr["ang3"]["Pica^3"]=2.27769904358706E-20;unitConverterArr["ang3"]["GRT"]=3.531467E-31;unitConverterArr["ang3"]["regton"]=3.531467E-31;unitConverterArr["ang3"]["MTON"]=1.41258666885954E-27;unitConverterArr["ang^3"]= {};unitConverterArr["ang^3"]["barrel"]=6.28981077043211E-30;unitConverterArr["ang^3"]["bushel"]=2.837759E-29;unitConverterArr["ang^3"]["ft3"]=3.53146667214886E-29;unitConverterArr["ang^3"]["ft^3"]=3.53146667214886E-29;unitConverterArr["ang^3"]["in3"]=6.10237440947323E-26;unitConverterArr["ang^3"]["in^3"]=6.10237440947323E-26;unitConverterArr["ang^3"]["ly3"]=1.18101081256238E-78;unitConverterArr["ang^3"]["ly^3"]=1.18101081256238E-78;unitConverterArr["ang^3"]["ang^3"]=1;unitConverterArr["ang^3"]["m3"]= 1E-30;unitConverterArr["ang^3"]["m^3"]=1E-30;unitConverterArr["ang^3"]["mi3"]=2.39912758578928E-40;unitConverterArr["ang^3"]["mi^3"]=2.39912758578928E-40;unitConverterArr["ang^3"]["yd3"]=1.30795061931439E-30;unitConverterArr["ang^3"]["yd^3"]=1.30795061931439E-30;unitConverterArr["ang^3"]["Nmi3"]=1.57426214685812E-40;unitConverterArr["ang^3"]["Nmi^3"]=1.57426214685812E-40;unitConverterArr["ang^3"]["Pica3"]=2.27769904358706E-20;unitConverterArr["ang^3"]["Pica^3"]=2.27769904358706E-20;unitConverterArr["ang^3"]["GRT"]= 3.531467E-31;unitConverterArr["ang^3"]["regton"]=3.531467E-31;unitConverterArr["ang^3"]["MTON"]=1.41258666885954E-27;unitConverterArr["ang^3"]={};unitConverterArr["ang^3"]["barrel"]=6.28981077043211E-30;unitConverterArr["ang^3"]["bushel"]=2.837759E-29;unitConverterArr["ang^3"]["ft3"]=3.53146667214886E-29;unitConverterArr["ang^3"]["ft^3"]=3.53146667214886E-29;unitConverterArr["ang^3"]["in3"]=6.10237440947323E-26;unitConverterArr["ang^3"]["in^3"]=6.10237440947323E-26;unitConverterArr["ang^3"]["ly3"]= 1.18101081256238E-78;unitConverterArr["ang^3"]["ly^3"]=1.18101081256238E-78;unitConverterArr["ang^3"]["ang^3"]=1;unitConverterArr["ang^3"]["m3"]=1E-30;unitConverterArr["ang^3"]["m^3"]=1E-30;unitConverterArr["ang^3"]["mi3"]=2.39912758578928E-40;unitConverterArr["ang^3"]["mi^3"]=2.39912758578928E-40;unitConverterArr["ang^3"]["yd3"]=1.30795061931439E-30;unitConverterArr["ang^3"]["yd^3"]=1.30795061931439E-30;unitConverterArr["ang^3"]["Nmi3"]=1.57426214685812E-40;unitConverterArr["ang^3"]["Nmi^3"]=1.57426214685812E-40; unitConverterArr["ang^3"]["Pica3"]=2.27769904358706E-20;unitConverterArr["ang^3"]["Pica^3"]=2.27769904358706E-20;unitConverterArr["ang^3"]["GRT"]=3.531467E-31;unitConverterArr["ang^3"]["regton"]=3.531467E-31;unitConverterArr["ang^3"]["MTON"]=1.41258666885954E-27;unitConverterArr["barrel"]={};unitConverterArr["barrel"]["bushel"]=4.51167627067586;unitConverterArr["barrel"]["ft3"]=5.61458333333333;unitConverterArr["barrel"]["ft^3"]=5.61458333333333;unitConverterArr["barrel"]["in3"]=9702;unitConverterArr["barrel"]["in^3"]= 9702;unitConverterArr["barrel"]["ly3"]=1.87765714370012E-49;unitConverterArr["barrel"]["ly^3"]=1.87765714370012E-49;unitConverterArr["barrel"]["barrel"]=1;unitConverterArr["barrel"]["m3"]=.158987294928;unitConverterArr["barrel"]["m^3"]=.158987294928;unitConverterArr["barrel"]["mi3"]=3.8143080505178E-11;unitConverterArr["barrel"]["mi^3"]=3.8143080505178E-11;unitConverterArr["barrel"]["yd3"]=.207947530864197;unitConverterArr["barrel"]["yd^3"]=.207947530864197;unitConverterArr["barrel"]["Nmi3"]=2.50287680236518E-11; unitConverterArr["barrel"]["Nmi^3"]=2.50287680236518E-11;unitConverterArr["barrel"]["Pica3"]=3621252096;unitConverterArr["barrel"]["Pica^3"]=3621252096;unitConverterArr["barrel"]["GRT"]=.0561458385457499;unitConverterArr["barrel"]["regton"]=.0561458385457499;unitConverterArr["barrel"]["MTON"]=224.583333333333;unitConverterArr["bushel"]={};unitConverterArr["bushel"]["ft3"]=1.24445616141077;unitConverterArr["bushel"]["ft^3"]=1.24445616141077;unitConverterArr["bushel"]["in3"]=2150.42024691781;unitConverterArr["bushel"]["in^3"]= 2150.42024691781;unitConverterArr["bushel"]["ly3"]=4.1617727670404E-50;unitConverterArr["bushel"]["ly^3"]=4.1617727670404E-50;unitConverterArr["bushel"]["bushel"]=1;unitConverterArr["bushel"]["m3"]=.0352390742131379;unitConverterArr["bushel"]["m^3"]=.0352390742131379;unitConverterArr["bushel"]["mi3"]=8.45430350424147E-12;unitConverterArr["bushel"]["mi^3"]=8.45430350424147E-12;unitConverterArr["bushel"]["yd3"]=.0460909689411396;unitConverterArr["bushel"]["yd^3"]=.0460909689411396;unitConverterArr["bushel"]["Nmi3"]= 5.54755406240669E-12;unitConverterArr["bushel"]["Nmi^3"]=5.54755406240669E-12;unitConverterArr["bushel"]["Pica3"]=8.02640056321578E8;unitConverterArr["bushel"]["Pica^3"]=8.02640056321578E8;unitConverterArr["bushel"]["GRT"]=.0124445627694247;unitConverterArr["bushel"]["regton"]=.0124445627694247;unitConverterArr["bushel"]["MTON"]=49.7782464564307;unitConverterArr["ft3"]={};unitConverterArr["ft3"]["ft^3"]=1;unitConverterArr["ft3"]["in3"]=1728;unitConverterArr["ft3"]["in^3"]=1728;unitConverterArr["ft3"]["ly3"]= 3.34425020028222E-50;unitConverterArr["ft3"]["ly^3"]=3.34425020028222E-50;unitConverterArr["ft3"]["ft3"]=1;unitConverterArr["ft3"]["m3"]=.028316846592;unitConverterArr["ft3"]["m^3"]=.028316846592;unitConverterArr["ft3"]["mi3"]=6.79357278014303E-12;unitConverterArr["ft3"]["mi^3"]=6.79357278014303E-12;unitConverterArr["ft3"]["yd3"]=.037037037037037;unitConverterArr["ft3"]["yd^3"]=.037037037037037;unitConverterArr["ft3"]["Nmi3"]=4.45781397081738E-12;unitConverterArr["ft3"]["Nmi^3"]=4.45781397081738E-12; unitConverterArr["ft3"]["Pica3"]=644972544;unitConverterArr["ft3"]["Pica^3"]=644972544;unitConverterArr["ft3"]["GRT"]=.010000000928371;unitConverterArr["ft3"]["regton"]=.010000000928371;unitConverterArr["ft3"]["MTON"]=40;unitConverterArr["ft^3"]={};unitConverterArr["ft^3"]["in3"]=1728;unitConverterArr["ft^3"]["in^3"]=1728;unitConverterArr["ft^3"]["ly3"]=3.34425020028222E-50;unitConverterArr["ft^3"]["ly^3"]=3.34425020028222E-50;unitConverterArr["ft^3"]["ft^3"]=1;unitConverterArr["ft^3"]["m3"]=.028316846592; unitConverterArr["ft^3"]["m^3"]=.028316846592;unitConverterArr["ft^3"]["mi3"]=6.79357278014303E-12;unitConverterArr["ft^3"]["mi^3"]=6.79357278014303E-12;unitConverterArr["ft^3"]["yd3"]=.037037037037037;unitConverterArr["ft^3"]["yd^3"]=.037037037037037;unitConverterArr["ft^3"]["Nmi3"]=4.45781397081738E-12;unitConverterArr["ft^3"]["Nmi^3"]=4.45781397081738E-12;unitConverterArr["ft^3"]["Pica3"]=644972544;unitConverterArr["ft^3"]["Pica^3"]=644972544;unitConverterArr["ft^3"]["GRT"]=.010000000928371;unitConverterArr["ft^3"]["regton"]= .010000000928371;unitConverterArr["ft^3"]["MTON"]=40;unitConverterArr["in3"]={};unitConverterArr["in3"]["in^3"]=1;unitConverterArr["in3"]["ly3"]=1.93532997701517E-53;unitConverterArr["in3"]["ly^3"]=1.93532997701517E-53;unitConverterArr["in3"]["in3"]=1;unitConverterArr["in3"]["m3"]=1.6387064E-5;unitConverterArr["in3"]["m^3"]=1.6387064E-5;unitConverterArr["in3"]["mi3"]=3.93146572924944E-15;unitConverterArr["in3"]["mi^3"]=3.93146572924944E-15;unitConverterArr["in3"]["yd3"]=2.14334705075446E-5;unitConverterArr["in3"]["yd^3"]= 2.14334705075446E-5;unitConverterArr["in3"]["Nmi3"]=2.57975345533413E-15;unitConverterArr["in3"]["Nmi^3"]=2.57975345533413E-15;unitConverterArr["in3"]["Pica3"]=373248;unitConverterArr["in3"]["Pica^3"]=373248;unitConverterArr["in3"]["GRT"]=5.7870375742888E-6;unitConverterArr["in3"]["regton"]=5.7870375742888E-6;unitConverterArr["in3"]["MTON"]=.0231481481481481;unitConverterArr["in^3"]={};unitConverterArr["in^3"]["ly3"]=1.93532997701517E-53;unitConverterArr["in^3"]["ly^3"]=1.93532997701517E-53;unitConverterArr["in^3"]["in^3"]= 1;unitConverterArr["in^3"]["m3"]=1.6387064E-5;unitConverterArr["in^3"]["m^3"]=1.6387064E-5;unitConverterArr["in^3"]["mi3"]=3.93146572924944E-15;unitConverterArr["in^3"]["mi^3"]=3.93146572924944E-15;unitConverterArr["in^3"]["yd3"]=2.14334705075446E-5;unitConverterArr["in^3"]["yd^3"]=2.14334705075446E-5;unitConverterArr["in^3"]["Nmi3"]=2.57975345533413E-15;unitConverterArr["in^3"]["Nmi^3"]=2.57975345533413E-15;unitConverterArr["in^3"]["Pica3"]=373248;unitConverterArr["in^3"]["Pica^3"]=373248;unitConverterArr["in^3"]["GRT"]= 5.7870375742888E-6;unitConverterArr["in^3"]["regton"]=5.7870375742888E-6;unitConverterArr["in^3"]["MTON"]=.0231481481481481;unitConverterArr["ly3"]={};unitConverterArr["ly3"]["ly^3"]=1;unitConverterArr["ly3"]["ly3"]=1;unitConverterArr["ly3"]["m3"]=8.46732298606437E47;unitConverterArr["ly3"]["m^3"]=8.46732298606437E47;unitConverterArr["ly3"]["mi3"]=2.03141881536547E38;unitConverterArr["ly3"]["mi^3"]=2.03141881536547E38;unitConverterArr["ly3"]["yd3"]=1.10748403435579E48;unitConverterArr["ly3"]["yd^3"]= 1.10748403435579E48;unitConverterArr["ly3"]["Nmi3"]=1.33297860621828E38;unitConverterArr["ly3"]["Nmi^3"]=1.33297860621828E38;unitConverterArr["ly3"]["Pica3"]=1.92860134671016E58;unitConverterArr["ly3"]["Pica^3"]=1.92860134671016E58;unitConverterArr["ly3"]["GRT"]=2.99020717036278E47;unitConverterArr["ly3"]["regton"]=2.99020717036278E47;unitConverterArr["ly3"]["MTON"]=1.19608275710425E51;unitConverterArr["ly^3"]={};unitConverterArr["ly^3"]["m3"]=8.46732298606437E47;unitConverterArr["ly^3"]["m^3"]=8.46732298606437E47; unitConverterArr["ly^3"]["mi3"]=2.03141881536547E38;unitConverterArr["ly^3"]["mi^3"]=2.03141881536547E38;unitConverterArr["ly^3"]["yd3"]=1.10748403435579E48;unitConverterArr["ly^3"]["yd^3"]=1.10748403435579E48;unitConverterArr["ly^3"]["Nmi3"]=1.33297860621828E38;unitConverterArr["ly^3"]["Nmi^3"]=1.33297860621828E38;unitConverterArr["ly^3"]["Pica3"]=1.92860134671016E58;unitConverterArr["ly^3"]["Pica^3"]=1.92860134671016E58;unitConverterArr["ly^3"]["GRT"]=2.99020717036278E47;unitConverterArr["ly^3"]["regton"]= 2.99020717036278E47;unitConverterArr["ly^3"]["MTON"]=1.19608275710425E51;unitConverterArr["m3"]={};unitConverterArr["m3"]["m^3"]=1;unitConverterArr["m3"]["mi3"]=2.39912758578928E-10;unitConverterArr["m3"]["mi^3"]=2.39912758578928E-10;unitConverterArr["m3"]["yd3"]=1.30795061931439;unitConverterArr["m3"]["yd^3"]=1.30795061931439;unitConverterArr["m3"]["Nmi3"]=1.57426214685811E-10;unitConverterArr["m3"]["Nmi^3"]=1.57426214685811E-10;unitConverterArr["m3"]["Pica3"]=2.27769904358706E10;unitConverterArr["m3"]["Pica^3"]= 2.27769904358706E10;unitConverterArr["m3"]["GRT"]=.3531467;unitConverterArr["m3"]["regton"]=.3531467;unitConverterArr["m3"]["MTON"]=1412.58666885954;unitConverterArr["m^3"]={};unitConverterArr["m^3"]["mi3"]=2.39912758578928E-10;unitConverterArr["m^3"]["mi^3"]=2.39912758578928E-10;unitConverterArr["m^3"]["yd3"]=1.30795061931439;unitConverterArr["m^3"]["yd^3"]=1.30795061931439;unitConverterArr["m^3"]["Nmi3"]=1.57426214685811E-10;unitConverterArr["m^3"]["Nmi^3"]=1.57426214685811E-10;unitConverterArr["m^3"]["Pica3"]= 2.27769904358706E10;unitConverterArr["m^3"]["Pica^3"]=2.27769904358706E10;unitConverterArr["m^3"]["GRT"]=.3531467;unitConverterArr["m^3"]["regton"]=.3531467;unitConverterArr["m^3"]["MTON"]=1412.58666885954;unitConverterArr["mi3"]={};unitConverterArr["mi3"]["mi^3"]=1;unitConverterArr["mi3"]["yd3"]=5451776E3;unitConverterArr["mi3"]["yd^3"]=5451776E3;unitConverterArr["mi3"]["Nmi3"]=.656181086901306;unitConverterArr["mi3"]["Nmi^3"]=.656181086901306;unitConverterArr["mi3"]["Pica3"]=9.49386375730299E19; unitConverterArr["mi3"]["Pica^3"]=9.49386375730299E19;unitConverterArr["mi3"]["GRT"]=1.47197965665432E9;unitConverterArr["mi3"]["regton"]=1.47197965665432E9;unitConverterArr["mi3"]["MTON"]=588791808E4;unitConverterArr["mi^3"]={};unitConverterArr["mi3"]["yd3"]=5451776E3;unitConverterArr["mi3"]["yd^3"]=5451776E3;unitConverterArr["mi3"]["Nmi3"]=.656181086901306;unitConverterArr["mi3"]["Nmi^3"]=.656181086901306;unitConverterArr["mi3"]["Pica3"]=9.49386375730299E19;unitConverterArr["mi3"]["Pica^3"]=9.49386375730299E19; unitConverterArr["mi3"]["GRT"]=1.47197965665432E9;unitConverterArr["mi3"]["regton"]=1.47197965665432E9;unitConverterArr["mi3"]["MTON"]=588791808E4;unitConverterArr["yd3"]={};unitConverterArr["yd3"]["yd^3"]=1;unitConverterArr["yd3"]["Nmi3"]=1.20360977212069E-10;unitConverterArr["yd3"]["Nmi^3"]=1.20360977212069E-10;unitConverterArr["yd3"]["Pica3"]=17414258688;unitConverterArr["yd3"]["Pica^3"]=17414258688;unitConverterArr["yd3"]["GRT"]=.270000025066018;unitConverterArr["yd3"]["regton"]=.270000025066018; unitConverterArr["yd3"]["MTON"]=1080;unitConverterArr["yd^3"]={};unitConverterArr["yd^3"]["Nmi3"]=1.20360977212069E-10;unitConverterArr["yd^3"]["Nmi^3"]=1.20360977212069E-10;unitConverterArr["yd^3"]["Pica3"]=17414258688;unitConverterArr["yd^3"]["Pica^3"]=17414258688;unitConverterArr["yd^3"]["GRT"]=.270000025066018;unitConverterArr["yd^3"]["regton"]=.270000025066018;unitConverterArr["yd^3"]["MTON"]=1080;unitConverterArr["Nmi3"]={};unitConverterArr["Nmi3"]["Nmi^3"]=1;unitConverterArr["Nmi3"]["Pica3"]= 1.44683593398524E20;unitConverterArr["Nmi3"]["Pica^3"]=1.44683593398524E20;unitConverterArr["Nmi3"]["GRT"]=2.24325218455391E9;unitConverterArr["Nmi3"]["regton"]=2.24325218455391E9;unitConverterArr["Nmi3"]["MTON"]=8.97300790518758E12;unitConverterArr["Nmi^3"]={};unitConverterArr["Nmi^3"]["Pica3"]=1.44683593398524E20;unitConverterArr["Nmi^3"]["Pica^3"]=1.44683593398524E20;unitConverterArr["Nmi^3"]["GRT"]=2.24325218455391E9;unitConverterArr["Nmi^3"]["regton"]=2.24325218455391E9;unitConverterArr["Nmi^3"]["MTON"]= 8.97300790518758E12;unitConverterArr["Pica3"]={};unitConverterArr["Pica3"]["Pica^3"]=1;unitConverterArr["Pica3"]["GRT"]=1.55045373968214E-11;unitConverterArr["Pica3"]["regton"]=1.55045373968214E-11;unitConverterArr["Pica3"]["MTON"]=6.20181438297008E-8;unitConverterArr["Pica^3"]={};unitConverterArr["Pica^3"]["GRT"]=1.55045373968214E-11;unitConverterArr["Pica^3"]["regton"]=1.55045373968214E-11;unitConverterArr["Pica^3"]["MTON"]=6.20181438297008E-8;unitConverterArr["GRT"]={};unitConverterArr["GRT"]["regton"]= 1;unitConverterArr["GRT"]["MTON"]=3999.99962865162;unitConverterArr["regton"]={};unitConverterArr["regton"]["MTON"]=3999.99962865162};var generateArea=function(){unitConverterArr["uk_acre"]={};unitConverterArr["uk_acre"]["us_acre"]=.999996000004;unitConverterArr["uk_acre"]["ang2"]=4.0468564224E23;unitConverterArr["uk_acre"]["ang^2"]=4.0468564224E23;unitConverterArr["uk_acre"]["ar"]=40.468564224;unitConverterArr["uk_acre"]["ft2"]=43560;unitConverterArr["uk_acre"]["ft^2"]=43560;unitConverterArr["uk_acre"]["ha"]= .40468564224;unitConverterArr["uk_acre"]["in2"]=6272640;unitConverterArr["uk_acre"]["in^2"]=6272640;unitConverterArr["uk_acre"]["ly2"]=4.52154695871477E-29;unitConverterArr["uk_acre"]["ly^2"]=4.52154695871477E-29;unitConverterArr["uk_acre"]["m2"]=4046.8564224;unitConverterArr["uk_acre"]["m^2"]=4046.8564224;unitConverterArr["uk_acre"]["Morgen"]=1.61874256896;unitConverterArr["uk_acre"]["mi2"]=.0015625;unitConverterArr["uk_acre"]["mi^2"]=.0015625;unitConverterArr["uk_acre"]["Nmi2"]=.0011798745452934; unitConverterArr["uk_acre"]["Nmi^2"]=.0011798745452934;unitConverterArr["uk_acre"]["Pica2"]=32517365760;unitConverterArr["uk_acre"]["Pica^2"]=32517365760;unitConverterArr["uk_acre"]["yd2"]=4840;unitConverterArr["uk_acre"]["yd^2"]=4840;unitConverterArr["us_acre"]={};unitConverterArr["us_acre"]["ang2"]=4.04687260987425E23;unitConverterArr["us_acre"]["ang^2"]=4.04687260987425E23;unitConverterArr["us_acre"]["ar"]=40.4687260987425;unitConverterArr["us_acre"]["ft2"]=43560.1742405227;unitConverterArr["us_acre"]["ft^2"]= 43560.1742405227;unitConverterArr["us_acre"]["ha"]=.404687260987425;unitConverterArr["us_acre"]["in2"]=6272665.09063527;unitConverterArr["us_acre"]["in^2"]=6272665.09063527;unitConverterArr["us_acre"]["ly2"]=4.52156504495687E-29;unitConverterArr["us_acre"]["ly^2"]=4.52156504495687E-29;unitConverterArr["us_acre"]["m2"]=4046.87260987425;unitConverterArr["us_acre"]["m^2"]=4046.87260987425;unitConverterArr["us_acre"]["Morgen"]=1.6187490439497;unitConverterArr["us_acre"]["mi2"]=.00156250625001875;unitConverterArr["us_acre"]["mi^2"]= .00156250625001875;unitConverterArr["us_acre"]["Nmi2"]=.00117987926480574;unitConverterArr["us_acre"]["Nmi^2"]=.00117987926480574;unitConverterArr["us_acre"]["Pica2"]=3.25174958298532E10;unitConverterArr["us_acre"]["Pica^2"]=3.25174958298532E10;unitConverterArr["us_acre"]["yd2"]=4840.01936005808;unitConverterArr["us_acre"]["yd^2"]=4840.01936005808;unitConverterArr["ang2"]={};unitConverterArr["ang2"]["ang^2"]=1;unitConverterArr["ang2"]["ar"]=1E-22;unitConverterArr["ang2"]["ft2"]=1.07639104167097E-19; unitConverterArr["ang2"]["ft^2"]=1.07639104167097E-19;unitConverterArr["ang2"]["ha"]=1E-24;unitConverterArr["ang2"]["in2"]=1.5500031000062E-17;unitConverterArr["ang2"]["in^2"]=1.5500031000062E-17;unitConverterArr["ang2"]["ly2"]=1.11729858605491E-52;unitConverterArr["ang2"]["ly^2"]=1.11729858605491E-52;unitConverterArr["ang2"]["m2"]=1E-20;unitConverterArr["ang2"]["m^2"]=1E-20;unitConverterArr["ang2"]["Morgen"]=4E-24;unitConverterArr["ang2"]["mi2"]=3.86102158542446E-27;unitConverterArr["ang2"]["mi^2"]= 3.86102158542446E-27;unitConverterArr["ang2"]["Nmi2"]=2.91553349598123E-27;unitConverterArr["ang2"]["Nmi^2"]=2.91553349598123E-27;unitConverterArr["ang2"]["Pica2"]=8.03521607043214E-14;unitConverterArr["ang2"]["Pica^2"]=8.03521607043214E-14;unitConverterArr["ang2"]["yd2"]=1.19599004630108E-20;unitConverterArr["ang2"]["yd^2"]=1.19599004630108E-20;unitConverterArr["ang^2"]={};unitConverterArr["ang^2"]["ar"]=1E-22;unitConverterArr["ang^2"]["ft2"]=1.07639104167097E-19;unitConverterArr["ang^2"]["ft^2"]= 1.07639104167097E-19;unitConverterArr["ang^2"]["ha"]=1E-24;unitConverterArr["ang^2"]["in2"]=1.5500031000062E-17;unitConverterArr["ang^2"]["in^2"]=1.5500031000062E-17;unitConverterArr["ang^2"]["ly2"]=1.11729858605491E-52;unitConverterArr["ang^2"]["ly^2"]=1.11729858605491E-52;unitConverterArr["ang^2"]["m2"]=1E-20;unitConverterArr["ang^2"]["m^2"]=1E-20;unitConverterArr["ang^2"]["Morgen"]=4E-24;unitConverterArr["ang^2"]["mi2"]=3.86102158542446E-27;unitConverterArr["ang^2"]["mi^2"]=3.86102158542446E-27; unitConverterArr["ang^2"]["Nmi2"]=2.91553349598123E-27;unitConverterArr["ang^2"]["Nmi^2"]=2.91553349598123E-27;unitConverterArr["ang^2"]["Pica2"]=8.03521607043214E-14;unitConverterArr["ang^2"]["Pica^2"]=8.03521607043214E-14;unitConverterArr["ang^2"]["yd2"]=1.19599004630108E-20;unitConverterArr["ang^2"]["yd^2"]=1.19599004630108E-20;unitConverterArr["ar"]={};unitConverterArr["ar"]["ft2"]=1076.39104167097;unitConverterArr["ar"]["ft^2"]=1076.39104167097;unitConverterArr["ar"]["ha"]=.01;unitConverterArr["ar"]["in2"]= 155000.31000062;unitConverterArr["ar"]["in^2"]=155000.31000062;unitConverterArr["ar"]["ly2"]=1.11729858605491E-30;unitConverterArr["ar"]["ly^2"]=1.11729858605491E-30;unitConverterArr["ar"]["m2"]=100;unitConverterArr["ar"]["m^2"]=100;unitConverterArr["ar"]["Morgen"]=.04;unitConverterArr["ar"]["mi2"]=3.86102158542446E-5;unitConverterArr["ar"]["mi^2"]=3.86102158542446E-5;unitConverterArr["ar"]["Nmi2"]=2.91553349598123E-5;unitConverterArr["ar"]["Nmi^2"]=2.91553349598123E-5;unitConverterArr["ar"]["Pica2"]= 8.03521607043214E8;unitConverterArr["ar"]["Pica^2"]=8.03521607043214E8;unitConverterArr["ar"]["yd2"]=119.599004630108;unitConverterArr["ar"]["yd^2"]=119.599004630108;unitConverterArr["ft2"]={};unitConverterArr["ft2"]["ft^2"]=1;unitConverterArr["ft2"]["ha"]=9.290304E-6;unitConverterArr["ft2"]["in2"]=144;unitConverterArr["ft2"]["in^2"]=144;unitConverterArr["ft2"]["ly2"]=1.03800435232203E-33;unitConverterArr["ft2"]["ly^2"]=1.03800435232203E-33;unitConverterArr["ft2"]["m2"]=.09290304;unitConverterArr["ft2"]["m^2"]= .09290304;unitConverterArr["ft2"]["Morgen"]=3.7161216E-5;unitConverterArr["ft2"]["mi2"]=3.58700642791552E-8;unitConverterArr["ft2"]["mi^2"]=3.58700642791552E-8;unitConverterArr["ft2"]["Nmi2"]=2.70861924998484E-8;unitConverterArr["ft2"]["Nmi^2"]=2.70861924998484E-8;unitConverterArr["ft2"]["Pica2"]=746496;unitConverterArr["ft2"]["Pica^2"]=746496;unitConverterArr["ft2"]["yd2"]=.111111111111111;unitConverterArr["ft2"]["yd^2"]=.111111111111111;unitConverterArr["ft^2"]={};unitConverterArr["ft^2"]["ha"]= 9.290304E-6;unitConverterArr["ft^2"]["in2"]=144;unitConverterArr["ft^2"]["in^2"]=144;unitConverterArr["ft^2"]["ly2"]=1.03800435232203E-33;unitConverterArr["ft^2"]["ly^2"]=1.03800435232203E-33;unitConverterArr["ft^2"]["m2"]=.09290304;unitConverterArr["ft^2"]["m^2"]=.09290304;unitConverterArr["ft^2"]["Morgen"]=3.7161216E-5;unitConverterArr["ft^2"]["mi2"]=3.58700642791552E-8;unitConverterArr["ft^2"]["mi^2"]=3.58700642791552E-8;unitConverterArr["ft^2"]["Nmi2"]=2.70861924998484E-8;unitConverterArr["ft^2"]["Nmi^2"]= 2.70861924998484E-8;unitConverterArr["ft^2"]["Pica2"]=746496;unitConverterArr["ft^2"]["Pica^2"]=746496;unitConverterArr["ft^2"]["yd2"]=.111111111111111;unitConverterArr["ft^2"]["yd^2"]=.111111111111111;unitConverterArr["ha"]={};unitConverterArr["ha"]["in2"]=1.5500031000062E7;unitConverterArr["ha"]["in^2"]=1.5500031000062E7;unitConverterArr["ha"]["ly2"]=1.11729858605491E-28;unitConverterArr["ha"]["ly^2"]=1.11729858605491E-28;unitConverterArr["ha"]["m2"]=1E4;unitConverterArr["ha"]["m^2"]=1E4;unitConverterArr["ha"]["Morgen"]= 4;unitConverterArr["ha"]["mi2"]=.00386102158542446;unitConverterArr["ha"]["mi^2"]=.00386102158542446;unitConverterArr["ha"]["Nmi2"]=.00291553349598123;unitConverterArr["ha"]["Nmi^2"]=.00291553349598123;unitConverterArr["ha"]["Pica2"]=8.03521607043214E10;unitConverterArr["ha"]["Pica^2"]=8.03521607043214E10;unitConverterArr["ha"]["yd2"]=11959.9004630108;unitConverterArr["ha"]["yd^2"]=11959.9004630108;unitConverterArr["in2"]={};unitConverterArr["in2"]["in^2"]=1;unitConverterArr["in2"]["ly2"]=7.20836355779189E-36; unitConverterArr["in2"]["ly^2"]=7.20836355779189E-36;unitConverterArr["in2"]["m2"]=6.4516E-4;unitConverterArr["in2"]["m^2"]=6.4516E-4;unitConverterArr["in2"]["Morgen"]=2.58064E-7;unitConverterArr["in2"]["mi2"]=2.49097668605244E-10;unitConverterArr["in2"]["mi^2"]=2.49097668605244E-10;unitConverterArr["in2"]["Nmi2"]=1.88098559026725E-10;unitConverterArr["in2"]["Nmi^2"]=1.88098559026725E-10;unitConverterArr["in2"]["Pica2"]=5184;unitConverterArr["in2"]["Pica^2"]=5184;unitConverterArr["in2"]["yd2"]=7.71604938271605E-4; unitConverterArr["in2"]["yd^2"]=7.71604938271605E-4;unitConverterArr["in^2"]={};unitConverterArr["in^2"]["ly2"]=7.20836355779189E-36;unitConverterArr["in^2"]["ly^2"]=7.20836355779189E-36;unitConverterArr["in^2"]["m2"]=6.4516E-4;unitConverterArr["in^2"]["m^2"]=6.4516E-4;unitConverterArr["in^2"]["Morgen"]=2.58064E-7;unitConverterArr["in^2"]["mi2"]=2.49097668605244E-10;unitConverterArr["in^2"]["mi^2"]=2.49097668605244E-10;unitConverterArr["in^2"]["Nmi2"]=1.88098559026725E-10;unitConverterArr["in^2"]["Nmi^2"]= 1.88098559026725E-10;unitConverterArr["in^2"]["Pica2"]=5184;unitConverterArr["in^2"]["Pica^2"]=5184;unitConverterArr["in^2"]["yd2"]=7.71604938271605E-4;unitConverterArr["in^2"]["yd^2"]=7.71604938271605E-4;unitConverterArr["ly2"]={};unitConverterArr["ly2"]["ly^2"]=1;unitConverterArr["ly2"]["m2"]=8.9501590038784E31;unitConverterArr["ly2"]["m^2"]=8.9501590038784E31;unitConverterArr["ly2"]["Morgen"]=3.58006360155136E28;unitConverterArr["ly2"]["mi2"]=3.45567571069556E25;unitConverterArr["ly2"]["mi^2"]= 3.45567571069556E25;unitConverterArr["ly2"]["Nmi2"]=2.60944883701655E25;unitConverterArr["ly2"]["Nmi^2"]=2.60944883701655E25;unitConverterArr["ly2"]["Pica2"]=7.19164614608866E38;unitConverterArr["ly2"]["Pica^2"]=7.19164614608866E38;unitConverterArr["ly2"]["yd2"]=1.07043010814506E32;unitConverterArr["ly2"]["yd^2"]=1.07043010814506E32;unitConverterArr["ly^2"]={};unitConverterArr["ly^2"]["m2"]=8.9501590038784E31;unitConverterArr["ly^2"]["m^2"]=8.9501590038784E31;unitConverterArr["ly^2"]["Morgen"]=3.58006360155136E28; unitConverterArr["ly^2"]["mi2"]=3.45567571069556E25;unitConverterArr["ly^2"]["mi^2"]=3.45567571069556E25;unitConverterArr["ly^2"]["Nmi2"]=2.60944883701655E25;unitConverterArr["ly^2"]["Nmi^2"]=2.60944883701655E25;unitConverterArr["ly^2"]["Pica2"]=7.19164614608866E38;unitConverterArr["ly^2"]["Pica^2"]=7.19164614608866E38;unitConverterArr["ly^2"]["yd2"]=1.07043010814506E32;unitConverterArr["ly^2"]["yd^2"]=1.07043010814506E32;unitConverterArr["m2"]={};unitConverterArr["m2"]["m^2"]=1;unitConverterArr["m2"]["Morgen"]= 4E-4;unitConverterArr["m2"]["mi2"]=3.86102158542446E-7;unitConverterArr["m2"]["mi^2"]=3.86102158542446E-7;unitConverterArr["m2"]["Nmi2"]=2.91553349598123E-7;unitConverterArr["m2"]["Nmi^2"]=2.91553349598123E-7;unitConverterArr["m2"]["Pica2"]=8035216.07043214;unitConverterArr["m2"]["Pica^2"]=8035216.07043214;unitConverterArr["m2"]["yd2"]=1.19599004630108;unitConverterArr["m2"]["yd^2"]=1.19599004630108;unitConverterArr["m^2"]={};unitConverterArr["m^2"]["Morgen"]=4E-4;unitConverterArr["m^2"]["mi2"]=3.86102158542446E-7; unitConverterArr["m^2"]["mi^2"]=3.86102158542446E-7;unitConverterArr["m^2"]["Nmi2"]=2.91553349598123E-7;unitConverterArr["m^2"]["Nmi^2"]=2.91553349598123E-7;unitConverterArr["m^2"]["Pica2"]=8035216.07043214;unitConverterArr["m^2"]["Pica^2"]=8035216.07043214;unitConverterArr["m^2"]["yd2"]=1.19599004630108;unitConverterArr["m^2"]["yd^2"]=1.19599004630108;unitConverterArr["Morgen"]={};unitConverterArr["Morgen"]["mi2"]=9.65255396356115E-4;unitConverterArr["Morgen"]["mi^2"]=9.65255396356115E-4;unitConverterArr["Morgen"]["Nmi2"]= 7.28883373995307E-4;unitConverterArr["Morgen"]["Nmi^2"]=7.28883373995307E-4;unitConverterArr["Morgen"]["Pica2"]=2.00880401760803E10;unitConverterArr["Morgen"]["Pica^2"]=2.00880401760803E10;unitConverterArr["Morgen"]["yd2"]=2989.9751157527;unitConverterArr["Morgen"]["yd^2"]=2989.9751157527;unitConverterArr["mi2"]={};unitConverterArr["mi2"]["mi^2"]=1;unitConverterArr["mi2"]["Nmi2"]=.755119708987773;unitConverterArr["mi2"]["Nmi^2"]=.755119708987773;unitConverterArr["mi2"]["Pica2"]=20811114086400;unitConverterArr["mi2"]["Pica^2"]= 20811114086400;unitConverterArr["mi2"]["yd2"]=3097600;unitConverterArr["mi2"]["yd^2"]=3097600;unitConverterArr["mi^2"]={};unitConverterArr["mi^2"]["Nmi2"]=.755119708987773;unitConverterArr["mi^2"]["Nmi^2"]=.755119708987773;unitConverterArr["mi^2"]["Pica2"]=20811114086400;unitConverterArr["mi^2"]["Pica^2"]=20811114086400;unitConverterArr["mi^2"]["yd2"]=3097600;unitConverterArr["mi^2"]["yd^2"]=3097600;unitConverterArr["Nmi2"]={};unitConverterArr["Nmi2"]["Nmi^2"]=1;unitConverterArr["Nmi2"]["Pica2"]= 2.75600197408395E13;unitConverterArr["Nmi2"]["Pica^2"]=2.75600197408395E13;unitConverterArr["Nmi2"]["yd2"]=4102131.04376826;unitConverterArr["Nmi2"]["yd^2"]=4102131.04376826;unitConverterArr["Nmi^2"]={};unitConverterArr["Nmi^2"]["Pica2"]=2.75600197408395E13;unitConverterArr["Nmi^2"]["Pica^2"]=2.75600197408395E13;unitConverterArr["Nmi^2"]["yd2"]=4102131.04376826;unitConverterArr["Nmi^2"]["yd^2"]=4102131.04376826;unitConverterArr["Pica2"]={};unitConverterArr["Pica2"]["Pica^2"]=1;unitConverterArr["Pica2"]["yd2"]= 1.48843545191282E-7;unitConverterArr["Pica2"]["yd^2"]=1.48843545191282E-7;unitConverterArr["Pica^2"]={};unitConverterArr["Pica^2"]["yd2"]=1.48843545191282E-7;unitConverterArr["Pica^2"]["yd^2"]=1.48843545191282E-7;unitConverterArr["yd2"]={};unitConverterArr["yd2"]["yd^2"]=1};var generateInformationAndSpeed=function(){unitConverterArr["bit"]={};unitConverterArr["bit"]["byte"]=.125;unitConverterArr["admkn"]={};unitConverterArr["admkn"]["kn"]=.999999913606911;unitConverterArr["admkn"]["m/h"]=1851.99984; unitConverterArr["admkn"]["m/hr"]=1851.99984;unitConverterArr["admkn"]["m/s"]=.5144444;unitConverterArr["admkn"]["m/sec"]=.5144444;unitConverterArr["admkn"]["mph"]=1.15077934860415;unitConverterArr["kn"]={};unitConverterArr["kn"]["m/h"]=1852;unitConverterArr["kn"]["m/hr"]=1852;unitConverterArr["kn"]["m/s"]=.514444444444444;unitConverterArr["kn"]["m/sec"]=.514444444444444;unitConverterArr["kn"]["mph"]=1.15077944802354;unitConverterArr["m/h"]={};unitConverterArr["m/h"]["m/hr"]=1;unitConverterArr["m/h"]["m/s"]= 2.77777777777778E-4;unitConverterArr["m/h"]["m/sec"]=2.77777777777778E-4;unitConverterArr["m/h"]["mph"]=6.21371192237334E-4;unitConverterArr["m/hr"]={};unitConverterArr["m/hr"]["m/s"]=2.77777777777778E-4;unitConverterArr["m/hr"]["m/sec"]=2.77777777777778E-4;unitConverterArr["m/hr"]["mph"]=6.21371192237334E-4;unitConverterArr["m/s"]={};unitConverterArr["m/s"]["m/sec"]=1;unitConverterArr["m/s"]["mph"]=2.2369362920544;unitConverterArr["m/sec"]={};unitConverterArr["m/sec"]["mph"]=2.2369362920544};generateWeightAndMass(); generateDistance();generateTime();generatePressure();generateForceAndEnergy();generatePowerMagnetismTemperature();generateVolume();generateArea();generateInformationAndSpeed()}return unitConverterArr}function generatePrefixAvailableMap(){if(!availablePrefixMap){availablePrefixMap={};availablePrefixMap["Y"]={};availablePrefixMap["Z"]={};availablePrefixMap["E"]={};availablePrefixMap["P"]={};availablePrefixMap["T"]={};availablePrefixMap["G"]={};availablePrefixMap["M"]={};availablePrefixMap["k"]={};availablePrefixMap["h"]= {};availablePrefixMap["da"]={};availablePrefixMap["e"]={};availablePrefixMap["d"]={};availablePrefixMap["c"]={};availablePrefixMap["m"]={};availablePrefixMap["u"]={};availablePrefixMap["n"]={};availablePrefixMap["p"]={};availablePrefixMap["f"]={};availablePrefixMap["a"]={};availablePrefixMap["z"]={};availablePrefixMap["y"]={};availablePrefixMap["Yi"]={};availablePrefixMap["Zi"]={};availablePrefixMap["Ei"]={};availablePrefixMap["Pi"]={};availablePrefixMap["Ti"]={};availablePrefixMap["Gi"]={};availablePrefixMap["Mi"]= {};availablePrefixMap["ki"]={};availablePrefixMap["Y"]["g"]=1;availablePrefixMap["Z"]["g"]=1;availablePrefixMap["E"]["g"]=1;availablePrefixMap["P"]["g"]=1;availablePrefixMap["T"]["g"]=1;availablePrefixMap["G"]["g"]=1;availablePrefixMap["M"]["g"]=1;availablePrefixMap["k"]["g"]=1;availablePrefixMap["h"]["g"]=1;availablePrefixMap["da"]["g"]=1;availablePrefixMap["e"]["g"]=1;availablePrefixMap["d"]["g"]=1;availablePrefixMap["c"]["g"]=1;availablePrefixMap["m"]["g"]=1;availablePrefixMap["u"]["g"]=1;availablePrefixMap["n"]["g"]= 1;availablePrefixMap["p"]["g"]=1;availablePrefixMap["f"]["g"]=1;availablePrefixMap["a"]["g"]=1;availablePrefixMap["z"]["g"]=1;availablePrefixMap["y"]["g"]=1;availablePrefixMap["Y"]["u"]=1;availablePrefixMap["Z"]["u"]=1;availablePrefixMap["E"]["u"]=1;availablePrefixMap["P"]["u"]=1;availablePrefixMap["T"]["u"]=1;availablePrefixMap["G"]["u"]=1;availablePrefixMap["M"]["u"]=1;availablePrefixMap["k"]["u"]=1;availablePrefixMap["h"]["u"]=1;availablePrefixMap["da"]["u"]=1;availablePrefixMap["e"]["u"]=1;availablePrefixMap["d"]["u"]= 1;availablePrefixMap["c"]["u"]=1;availablePrefixMap["m"]["u"]=1;availablePrefixMap["u"]["u"]=1;availablePrefixMap["n"]["u"]=1;availablePrefixMap["p"]["u"]=1;availablePrefixMap["f"]["u"]=1;availablePrefixMap["a"]["u"]=1;availablePrefixMap["z"]["u"]=1;availablePrefixMap["y"]["u"]=1;availablePrefixMap["Y"]["m"]=1;availablePrefixMap["Z"]["m"]=1;availablePrefixMap["E"]["m"]=1;availablePrefixMap["P"]["m"]=1;availablePrefixMap["T"]["m"]=1;availablePrefixMap["G"]["m"]=1;availablePrefixMap["M"]["m"]=1;availablePrefixMap["k"]["m"]= 1;availablePrefixMap["h"]["m"]=1;availablePrefixMap["da"]["m"]=1;availablePrefixMap["e"]["m"]=1;availablePrefixMap["d"]["m"]=1;availablePrefixMap["c"]["m"]=1;availablePrefixMap["m"]["m"]=1;availablePrefixMap["u"]["m"]=1;availablePrefixMap["n"]["m"]=1;availablePrefixMap["p"]["m"]=1;availablePrefixMap["f"]["m"]=1;availablePrefixMap["a"]["m"]=1;availablePrefixMap["z"]["m"]=1;availablePrefixMap["y"]["m"]=1;availablePrefixMap["Y"]["ang"]=1;availablePrefixMap["Z"]["ang"]=1;availablePrefixMap["E"]["ang"]= 1;availablePrefixMap["P"]["ang"]=1;availablePrefixMap["T"]["ang"]=1;availablePrefixMap["G"]["ang"]=1;availablePrefixMap["M"]["ang"]=1;availablePrefixMap["k"]["ang"]=1;availablePrefixMap["h"]["ang"]=1;availablePrefixMap["da"]["ang"]=1;availablePrefixMap["e"]["ang"]=1;availablePrefixMap["d"]["ang"]=1;availablePrefixMap["c"]["ang"]=1;availablePrefixMap["m"]["ang"]=1;availablePrefixMap["u"]["ang"]=1;availablePrefixMap["n"]["ang"]=1;availablePrefixMap["p"]["ang"]=1;availablePrefixMap["f"]["ang"]=1;availablePrefixMap["a"]["ang"]= 1;availablePrefixMap["z"]["ang"]=1;availablePrefixMap["y"]["ang"]=1;availablePrefixMap["Y"]["ly"]=1;availablePrefixMap["Z"]["ly"]=1;availablePrefixMap["E"]["ly"]=1;availablePrefixMap["P"]["ly"]=1;availablePrefixMap["T"]["ly"]=1;availablePrefixMap["G"]["ly"]=1;availablePrefixMap["M"]["ly"]=1;availablePrefixMap["k"]["ly"]=1;availablePrefixMap["h"]["ly"]=1;availablePrefixMap["da"]["ly"]=1;availablePrefixMap["e"]["ly"]=1;availablePrefixMap["d"]["ly"]=1;availablePrefixMap["c"]["ly"]=1;availablePrefixMap["m"]["ly"]= 1;availablePrefixMap["u"]["ly"]=1;availablePrefixMap["n"]["ly"]=1;availablePrefixMap["p"]["ly"]=1;availablePrefixMap["f"]["ly"]=1;availablePrefixMap["a"]["ly"]=1;availablePrefixMap["z"]["ly"]=1;availablePrefixMap["y"]["ly"]=1;availablePrefixMap["Y"]["parsec"]=1;availablePrefixMap["Z"]["parsec"]=1;availablePrefixMap["E"]["parsec"]=1;availablePrefixMap["P"]["parsec"]=1;availablePrefixMap["T"]["parsec"]=1;availablePrefixMap["G"]["parsec"]=1;availablePrefixMap["M"]["parsec"]=1;availablePrefixMap["k"]["parsec"]= 1;availablePrefixMap["h"]["parsec"]=1;availablePrefixMap["da"]["parsec"]=1;availablePrefixMap["e"]["parsec"]=1;availablePrefixMap["d"]["parsec"]=1;availablePrefixMap["c"]["parsec"]=1;availablePrefixMap["m"]["parsec"]=1;availablePrefixMap["u"]["parsec"]=1;availablePrefixMap["n"]["parsec"]=1;availablePrefixMap["p"]["parsec"]=1;availablePrefixMap["f"]["parsec"]=1;availablePrefixMap["a"]["parsec"]=1;availablePrefixMap["z"]["parsec"]=1;availablePrefixMap["y"]["parsec"]=1;availablePrefixMap["Y"]["pc"]= 1;availablePrefixMap["Z"]["pc"]=1;availablePrefixMap["E"]["pc"]=1;availablePrefixMap["P"]["pc"]=1;availablePrefixMap["T"]["pc"]=1;availablePrefixMap["G"]["pc"]=1;availablePrefixMap["M"]["pc"]=1;availablePrefixMap["k"]["pc"]=1;availablePrefixMap["h"]["pc"]=1;availablePrefixMap["da"]["pc"]=1;availablePrefixMap["e"]["pc"]=1;availablePrefixMap["d"]["pc"]=1;availablePrefixMap["c"]["pc"]=1;availablePrefixMap["m"]["pc"]=1;availablePrefixMap["u"]["pc"]=1;availablePrefixMap["n"]["pc"]=1;availablePrefixMap["p"]["pc"]= 1;availablePrefixMap["f"]["pc"]=1;availablePrefixMap["a"]["pc"]=1;availablePrefixMap["z"]["pc"]=1;availablePrefixMap["y"]["pc"]=1;availablePrefixMap["Y"]["sec"]=1;availablePrefixMap["Z"]["sec"]=1;availablePrefixMap["E"]["sec"]=1;availablePrefixMap["P"]["sec"]=1;availablePrefixMap["T"]["sec"]=1;availablePrefixMap["G"]["sec"]=1;availablePrefixMap["M"]["sec"]=1;availablePrefixMap["k"]["sec"]=1;availablePrefixMap["h"]["sec"]=1;availablePrefixMap["da"]["sec"]=1;availablePrefixMap["e"]["sec"]=1;availablePrefixMap["d"]["sec"]= 1;availablePrefixMap["c"]["sec"]=1;availablePrefixMap["m"]["sec"]=1;availablePrefixMap["u"]["sec"]=1;availablePrefixMap["n"]["sec"]=1;availablePrefixMap["p"]["sec"]=1;availablePrefixMap["f"]["sec"]=1;availablePrefixMap["a"]["sec"]=1;availablePrefixMap["z"]["sec"]=1;availablePrefixMap["y"]["sec"]=1;availablePrefixMap["Y"]["s"]=1;availablePrefixMap["Z"]["s"]=1;availablePrefixMap["E"]["s"]=1;availablePrefixMap["P"]["s"]=1;availablePrefixMap["T"]["s"]=1;availablePrefixMap["G"]["s"]=1;availablePrefixMap["M"]["s"]= 1;availablePrefixMap["k"]["s"]=1;availablePrefixMap["h"]["s"]=1;availablePrefixMap["da"]["s"]=1;availablePrefixMap["e"]["s"]=1;availablePrefixMap["d"]["s"]=1;availablePrefixMap["c"]["s"]=1;availablePrefixMap["m"]["s"]=1;availablePrefixMap["u"]["s"]=1;availablePrefixMap["n"]["s"]=1;availablePrefixMap["p"]["s"]=1;availablePrefixMap["f"]["s"]=1;availablePrefixMap["a"]["s"]=1;availablePrefixMap["z"]["s"]=1;availablePrefixMap["y"]["s"]=1;availablePrefixMap["Y"]["Pa"]=1;availablePrefixMap["Z"]["Pa"]=1; availablePrefixMap["E"]["Pa"]=1;availablePrefixMap["P"]["Pa"]=1;availablePrefixMap["T"]["Pa"]=1;availablePrefixMap["G"]["Pa"]=1;availablePrefixMap["M"]["Pa"]=1;availablePrefixMap["k"]["Pa"]=1;availablePrefixMap["h"]["Pa"]=1;availablePrefixMap["da"]["Pa"]=1;availablePrefixMap["e"]["Pa"]=1;availablePrefixMap["d"]["Pa"]=1;availablePrefixMap["c"]["Pa"]=1;availablePrefixMap["m"]["Pa"]=1;availablePrefixMap["u"]["Pa"]=1;availablePrefixMap["n"]["Pa"]=1;availablePrefixMap["p"]["Pa"]=1;availablePrefixMap["f"]["Pa"]= 1;availablePrefixMap["a"]["Pa"]=1;availablePrefixMap["z"]["Pa"]=1;availablePrefixMap["y"]["Pa"]=1;availablePrefixMap["Y"]["atm"]=1;availablePrefixMap["Z"]["atm"]=1;availablePrefixMap["E"]["atm"]=1;availablePrefixMap["P"]["atm"]=1;availablePrefixMap["T"]["atm"]=1;availablePrefixMap["G"]["atm"]=1;availablePrefixMap["M"]["atm"]=1;availablePrefixMap["k"]["atm"]=1;availablePrefixMap["h"]["atm"]=1;availablePrefixMap["da"]["atm"]=1;availablePrefixMap["e"]["atm"]=1;availablePrefixMap["d"]["atm"]=1;availablePrefixMap["c"]["atm"]= 1;availablePrefixMap["m"]["atm"]=1;availablePrefixMap["u"]["atm"]=1;availablePrefixMap["n"]["atm"]=1;availablePrefixMap["p"]["atm"]=1;availablePrefixMap["f"]["atm"]=1;availablePrefixMap["a"]["atm"]=1;availablePrefixMap["z"]["atm"]=1;availablePrefixMap["y"]["atm"]=1;availablePrefixMap["Y"]["at"]=1;availablePrefixMap["Z"]["at"]=1;availablePrefixMap["E"]["at"]=1;availablePrefixMap["P"]["at"]=1;availablePrefixMap["T"]["at"]=1;availablePrefixMap["G"]["at"]=1;availablePrefixMap["M"]["at"]=1;availablePrefixMap["k"]["at"]= 1;availablePrefixMap["h"]["at"]=1;availablePrefixMap["da"]["at"]=1;availablePrefixMap["e"]["at"]=1;availablePrefixMap["d"]["at"]=1;availablePrefixMap["c"]["at"]=1;availablePrefixMap["m"]["at"]=1;availablePrefixMap["u"]["at"]=1;availablePrefixMap["n"]["at"]=1;availablePrefixMap["p"]["at"]=1;availablePrefixMap["f"]["at"]=1;availablePrefixMap["a"]["at"]=1;availablePrefixMap["z"]["at"]=1;availablePrefixMap["y"]["at"]=1;availablePrefixMap["Y"]["mmHg"]=1;availablePrefixMap["Z"]["mmHg"]=1;availablePrefixMap["E"]["mmHg"]= 1;availablePrefixMap["P"]["mmHg"]=1;availablePrefixMap["T"]["mmHg"]=1;availablePrefixMap["G"]["mmHg"]=1;availablePrefixMap["M"]["mmHg"]=1;availablePrefixMap["k"]["mmHg"]=1;availablePrefixMap["h"]["mmHg"]=1;availablePrefixMap["da"]["mmHg"]=1;availablePrefixMap["e"]["mmHg"]=1;availablePrefixMap["d"]["mmHg"]=1;availablePrefixMap["c"]["mmHg"]=1;availablePrefixMap["m"]["mmHg"]=1;availablePrefixMap["u"]["mmHg"]=1;availablePrefixMap["n"]["mmHg"]=1;availablePrefixMap["p"]["mmHg"]=1;availablePrefixMap["f"]["mmHg"]= 1;availablePrefixMap["a"]["mmHg"]=1;availablePrefixMap["z"]["mmHg"]=1;availablePrefixMap["y"]["mmHg"]=1;availablePrefixMap["Y"]["N"]=1;availablePrefixMap["Z"]["N"]=1;availablePrefixMap["E"]["N"]=1;availablePrefixMap["P"]["N"]=1;availablePrefixMap["T"]["N"]=1;availablePrefixMap["G"]["N"]=1;availablePrefixMap["M"]["N"]=1;availablePrefixMap["k"]["N"]=1;availablePrefixMap["h"]["N"]=1;availablePrefixMap["da"]["N"]=1;availablePrefixMap["e"]["N"]=1;availablePrefixMap["d"]["N"]=1;availablePrefixMap["c"]["N"]= 1;availablePrefixMap["m"]["N"]=1;availablePrefixMap["u"]["N"]=1;availablePrefixMap["n"]["N"]=1;availablePrefixMap["p"]["N"]=1;availablePrefixMap["f"]["N"]=1;availablePrefixMap["a"]["N"]=1;availablePrefixMap["z"]["N"]=1;availablePrefixMap["y"]["N"]=1;availablePrefixMap["Y"]["dyn"]=1;availablePrefixMap["Z"]["dyn"]=1;availablePrefixMap["E"]["dyn"]=1;availablePrefixMap["P"]["dyn"]=1;availablePrefixMap["T"]["dyn"]=1;availablePrefixMap["G"]["dyn"]=1;availablePrefixMap["M"]["dyn"]=1;availablePrefixMap["k"]["dyn"]= 1;availablePrefixMap["h"]["dyn"]=1;availablePrefixMap["da"]["dyn"]=1;availablePrefixMap["e"]["dyn"]=1;availablePrefixMap["d"]["dyn"]=1;availablePrefixMap["c"]["dyn"]=1;availablePrefixMap["m"]["dyn"]=1;availablePrefixMap["u"]["dyn"]=1;availablePrefixMap["n"]["dyn"]=1;availablePrefixMap["p"]["dyn"]=1;availablePrefixMap["f"]["dyn"]=1;availablePrefixMap["a"]["dyn"]=1;availablePrefixMap["z"]["dyn"]=1;availablePrefixMap["y"]["dyn"]=1;availablePrefixMap["Y"]["dy"]=1;availablePrefixMap["Z"]["dy"]=1;availablePrefixMap["E"]["dy"]= 1;availablePrefixMap["P"]["dy"]=1;availablePrefixMap["T"]["dy"]=1;availablePrefixMap["G"]["dy"]=1;availablePrefixMap["M"]["dy"]=1;availablePrefixMap["k"]["dy"]=1;availablePrefixMap["h"]["dy"]=1;availablePrefixMap["da"]["dy"]=1;availablePrefixMap["e"]["dy"]=1;availablePrefixMap["d"]["dy"]=1;availablePrefixMap["c"]["dy"]=1;availablePrefixMap["m"]["dy"]=1;availablePrefixMap["u"]["dy"]=1;availablePrefixMap["n"]["dy"]=1;availablePrefixMap["p"]["dy"]=1;availablePrefixMap["f"]["dy"]=1;availablePrefixMap["a"]["dy"]= 1;availablePrefixMap["z"]["dy"]=1;availablePrefixMap["y"]["dy"]=1;availablePrefixMap["Y"]["pond"]=1;availablePrefixMap["Z"]["pond"]=1;availablePrefixMap["E"]["pond"]=1;availablePrefixMap["P"]["pond"]=1;availablePrefixMap["T"]["pond"]=1;availablePrefixMap["G"]["pond"]=1;availablePrefixMap["M"]["pond"]=1;availablePrefixMap["k"]["pond"]=1;availablePrefixMap["h"]["pond"]=1;availablePrefixMap["da"]["pond"]=1;availablePrefixMap["e"]["pond"]=1;availablePrefixMap["d"]["pond"]=1;availablePrefixMap["c"]["pond"]= 1;availablePrefixMap["m"]["pond"]=1;availablePrefixMap["u"]["pond"]=1;availablePrefixMap["n"]["pond"]=1;availablePrefixMap["p"]["pond"]=1;availablePrefixMap["f"]["pond"]=1;availablePrefixMap["a"]["pond"]=1;availablePrefixMap["z"]["pond"]=1;availablePrefixMap["y"]["pond"]=1;availablePrefixMap["Y"]["J"]=1;availablePrefixMap["Z"]["J"]=1;availablePrefixMap["E"]["J"]=1;availablePrefixMap["P"]["J"]=1;availablePrefixMap["T"]["J"]=1;availablePrefixMap["G"]["J"]=1;availablePrefixMap["M"]["J"]=1;availablePrefixMap["k"]["J"]= 1;availablePrefixMap["h"]["J"]=1;availablePrefixMap["da"]["J"]=1;availablePrefixMap["e"]["J"]=1;availablePrefixMap["d"]["J"]=1;availablePrefixMap["c"]["J"]=1;availablePrefixMap["m"]["J"]=1;availablePrefixMap["u"]["J"]=1;availablePrefixMap["n"]["J"]=1;availablePrefixMap["p"]["J"]=1;availablePrefixMap["f"]["J"]=1;availablePrefixMap["a"]["J"]=1;availablePrefixMap["z"]["J"]=1;availablePrefixMap["y"]["J"]=1;availablePrefixMap["Y"]["e"]=1;availablePrefixMap["Z"]["e"]=1;availablePrefixMap["E"]["e"]=1;availablePrefixMap["P"]["e"]= 1;availablePrefixMap["T"]["e"]=1;availablePrefixMap["G"]["e"]=1;availablePrefixMap["M"]["e"]=1;availablePrefixMap["k"]["e"]=1;availablePrefixMap["h"]["e"]=1;availablePrefixMap["da"]["e"]=1;availablePrefixMap["e"]["e"]=1;availablePrefixMap["d"]["e"]=1;availablePrefixMap["c"]["e"]=1;availablePrefixMap["m"]["e"]=1;availablePrefixMap["u"]["e"]=1;availablePrefixMap["n"]["e"]=1;availablePrefixMap["p"]["e"]=1;availablePrefixMap["f"]["e"]=1;availablePrefixMap["a"]["e"]=1;availablePrefixMap["z"]["e"]=1;availablePrefixMap["y"]["e"]= 1;availablePrefixMap["Y"]["c"]=1;availablePrefixMap["Z"]["c"]=1;availablePrefixMap["E"]["c"]=1;availablePrefixMap["P"]["c"]=1;availablePrefixMap["T"]["c"]=1;availablePrefixMap["G"]["c"]=1;availablePrefixMap["M"]["c"]=1;availablePrefixMap["k"]["c"]=1;availablePrefixMap["h"]["c"]=1;availablePrefixMap["da"]["c"]=1;availablePrefixMap["e"]["c"]=1;availablePrefixMap["d"]["c"]=1;availablePrefixMap["c"]["c"]=1;availablePrefixMap["m"]["c"]=1;availablePrefixMap["u"]["c"]=1;availablePrefixMap["n"]["c"]=1;availablePrefixMap["f"]["c"]= 1;availablePrefixMap["a"]["c"]=1;availablePrefixMap["z"]["c"]=1;availablePrefixMap["y"]["c"]=1;availablePrefixMap["Y"]["cal"]=1;availablePrefixMap["Z"]["cal"]=1;availablePrefixMap["E"]["cal"]=1;availablePrefixMap["P"]["cal"]=1;availablePrefixMap["T"]["cal"]=1;availablePrefixMap["G"]["cal"]=1;availablePrefixMap["M"]["cal"]=1;availablePrefixMap["k"]["cal"]=1;availablePrefixMap["h"]["cal"]=1;availablePrefixMap["da"]["cal"]=1;availablePrefixMap["e"]["cal"]=1;availablePrefixMap["d"]["cal"]=1;availablePrefixMap["c"]["cal"]= 1;availablePrefixMap["m"]["cal"]=1;availablePrefixMap["u"]["cal"]=1;availablePrefixMap["n"]["cal"]=1;availablePrefixMap["p"]["cal"]=1;availablePrefixMap["f"]["cal"]=1;availablePrefixMap["a"]["cal"]=1;availablePrefixMap["z"]["cal"]=1;availablePrefixMap["y"]["cal"]=1;availablePrefixMap["Y"]["eV"]=1;availablePrefixMap["Z"]["eV"]=1;availablePrefixMap["E"]["eV"]=1;availablePrefixMap["P"]["eV"]=1;availablePrefixMap["T"]["eV"]=1;availablePrefixMap["G"]["eV"]=1;availablePrefixMap["M"]["eV"]=1;availablePrefixMap["k"]["eV"]= 1;availablePrefixMap["h"]["eV"]=1;availablePrefixMap["da"]["eV"]=1;availablePrefixMap["e"]["eV"]=1;availablePrefixMap["d"]["eV"]=1;availablePrefixMap["c"]["eV"]=1;availablePrefixMap["m"]["eV"]=1;availablePrefixMap["u"]["eV"]=1;availablePrefixMap["n"]["eV"]=1;availablePrefixMap["p"]["eV"]=1;availablePrefixMap["f"]["eV"]=1;availablePrefixMap["a"]["eV"]=1;availablePrefixMap["z"]["eV"]=1;availablePrefixMap["y"]["eV"]=1;availablePrefixMap["Y"]["ev"]=1;availablePrefixMap["Z"]["ev"]=1;availablePrefixMap["E"]["ev"]= 1;availablePrefixMap["P"]["ev"]=1;availablePrefixMap["T"]["ev"]=1;availablePrefixMap["G"]["ev"]=1;availablePrefixMap["M"]["ev"]=1;availablePrefixMap["k"]["ev"]=1;availablePrefixMap["h"]["ev"]=1;availablePrefixMap["da"]["ev"]=1;availablePrefixMap["e"]["ev"]=1;availablePrefixMap["d"]["ev"]=1;availablePrefixMap["c"]["ev"]=1;availablePrefixMap["m"]["ev"]=1;availablePrefixMap["u"]["ev"]=1;availablePrefixMap["n"]["ev"]=1;availablePrefixMap["p"]["ev"]=1;availablePrefixMap["f"]["ev"]=1;availablePrefixMap["a"]["ev"]= 1;availablePrefixMap["z"]["ev"]=1;availablePrefixMap["y"]["ev"]=1;availablePrefixMap["y"]["cal"]=1;availablePrefixMap["Y"]["Wh"]=1;availablePrefixMap["Z"]["Wh"]=1;availablePrefixMap["E"]["Wh"]=1;availablePrefixMap["P"]["Wh"]=1;availablePrefixMap["T"]["Wh"]=1;availablePrefixMap["G"]["Wh"]=1;availablePrefixMap["M"]["Wh"]=1;availablePrefixMap["k"]["Wh"]=1;availablePrefixMap["h"]["Wh"]=1;availablePrefixMap["da"]["Wh"]=1;availablePrefixMap["e"]["Wh"]=1;availablePrefixMap["d"]["Wh"]=1;availablePrefixMap["c"]["Wh"]= 1;availablePrefixMap["m"]["Wh"]=1;availablePrefixMap["u"]["Wh"]=1;availablePrefixMap["n"]["Wh"]=1;availablePrefixMap["p"]["Wh"]=1;availablePrefixMap["f"]["Wh"]=1;availablePrefixMap["a"]["Wh"]=1;availablePrefixMap["z"]["Wh"]=1;availablePrefixMap["y"]["Wh"]=1;availablePrefixMap["Y"]["W"]=1;availablePrefixMap["Z"]["W"]=1;availablePrefixMap["E"]["W"]=1;availablePrefixMap["P"]["W"]=1;availablePrefixMap["T"]["W"]=1;availablePrefixMap["G"]["W"]=1;availablePrefixMap["M"]["W"]=1;availablePrefixMap["k"]["W"]= 1;availablePrefixMap["h"]["W"]=1;availablePrefixMap["da"]["W"]=1;availablePrefixMap["e"]["W"]=1;availablePrefixMap["d"]["W"]=1;availablePrefixMap["c"]["W"]=1;availablePrefixMap["m"]["W"]=1;availablePrefixMap["u"]["W"]=1;availablePrefixMap["n"]["W"]=1;availablePrefixMap["p"]["W"]=1;availablePrefixMap["f"]["W"]=1;availablePrefixMap["a"]["W"]=1;availablePrefixMap["z"]["W"]=1;availablePrefixMap["y"]["W"]=1;availablePrefixMap["Y"]["w"]=1;availablePrefixMap["Z"]["w"]=1;availablePrefixMap["E"]["w"]=1;availablePrefixMap["P"]["w"]= 1;availablePrefixMap["T"]["w"]=1;availablePrefixMap["G"]["w"]=1;availablePrefixMap["M"]["w"]=1;availablePrefixMap["k"]["w"]=1;availablePrefixMap["h"]["w"]=1;availablePrefixMap["da"]["w"]=1;availablePrefixMap["e"]["w"]=1;availablePrefixMap["d"]["w"]=1;availablePrefixMap["c"]["w"]=1;availablePrefixMap["m"]["w"]=1;availablePrefixMap["u"]["w"]=1;availablePrefixMap["n"]["w"]=1;availablePrefixMap["p"]["w"]=1;availablePrefixMap["f"]["w"]=1;availablePrefixMap["a"]["w"]=1;availablePrefixMap["z"]["w"]=1;availablePrefixMap["y"]["w"]= 1;availablePrefixMap["Y"]["T"]=1;availablePrefixMap["Z"]["T"]=1;availablePrefixMap["E"]["T"]=1;availablePrefixMap["P"]["T"]=1;availablePrefixMap["T"]["T"]=1;availablePrefixMap["G"]["T"]=1;availablePrefixMap["M"]["T"]=1;availablePrefixMap["k"]["T"]=1;availablePrefixMap["h"]["T"]=1;availablePrefixMap["da"]["T"]=1;availablePrefixMap["e"]["T"]=1;availablePrefixMap["d"]["T"]=1;availablePrefixMap["c"]["T"]=1;availablePrefixMap["m"]["T"]=1;availablePrefixMap["u"]["T"]=1;availablePrefixMap["n"]["T"]=1;availablePrefixMap["p"]["T"]= 1;availablePrefixMap["f"]["T"]=1;availablePrefixMap["a"]["T"]=1;availablePrefixMap["z"]["T"]=1;availablePrefixMap["y"]["T"]=1;availablePrefixMap["Y"]["ga"]=1;availablePrefixMap["Z"]["ga"]=1;availablePrefixMap["E"]["ga"]=1;availablePrefixMap["P"]["ga"]=1;availablePrefixMap["T"]["ga"]=1;availablePrefixMap["G"]["ga"]=1;availablePrefixMap["M"]["ga"]=1;availablePrefixMap["k"]["ga"]=1;availablePrefixMap["h"]["ga"]=1;availablePrefixMap["da"]["ga"]=1;availablePrefixMap["e"]["ga"]=1;availablePrefixMap["d"]["ga"]= 1;availablePrefixMap["c"]["ga"]=1;availablePrefixMap["m"]["ga"]=1;availablePrefixMap["u"]["ga"]=1;availablePrefixMap["n"]["ga"]=1;availablePrefixMap["p"]["ga"]=1;availablePrefixMap["f"]["ga"]=1;availablePrefixMap["a"]["ga"]=1;availablePrefixMap["z"]["ga"]=1;availablePrefixMap["y"]["ga"]=1;availablePrefixMap["Y"]["K"]=1;availablePrefixMap["Z"]["K"]=1;availablePrefixMap["E"]["K"]=1;availablePrefixMap["P"]["K"]=1;availablePrefixMap["T"]["K"]=1;availablePrefixMap["G"]["K"]=1;availablePrefixMap["M"]["K"]= 1;availablePrefixMap["k"]["K"]=1;availablePrefixMap["h"]["K"]=1;availablePrefixMap["da"]["K"]=1;availablePrefixMap["e"]["K"]=1;availablePrefixMap["d"]["K"]=1;availablePrefixMap["c"]["K"]=1;availablePrefixMap["m"]["K"]=1;availablePrefixMap["u"]["K"]=1;availablePrefixMap["n"]["K"]=1;availablePrefixMap["p"]["K"]=1;availablePrefixMap["f"]["K"]=1;availablePrefixMap["a"]["K"]=1;availablePrefixMap["z"]["K"]=1;availablePrefixMap["y"]["K"]=1;availablePrefixMap["Y"]["kel"]=1;availablePrefixMap["Z"]["kel"]= 1;availablePrefixMap["E"]["kel"]=1;availablePrefixMap["P"]["kel"]=1;availablePrefixMap["T"]["kel"]=1;availablePrefixMap["G"]["kel"]=1;availablePrefixMap["M"]["kel"]=1;availablePrefixMap["k"]["kel"]=1;availablePrefixMap["h"]["kel"]=1;availablePrefixMap["da"]["kel"]=1;availablePrefixMap["e"]["kel"]=1;availablePrefixMap["d"]["kel"]=1;availablePrefixMap["c"]["kel"]=1;availablePrefixMap["m"]["kel"]=1;availablePrefixMap["u"]["kel"]=1;availablePrefixMap["n"]["kel"]=1;availablePrefixMap["p"]["kel"]=1;availablePrefixMap["f"]["kel"]= 1;availablePrefixMap["a"]["kel"]=1;availablePrefixMap["z"]["kel"]=1;availablePrefixMap["y"]["kel"]=1;availablePrefixMap["Y"]["l"]=1;availablePrefixMap["Z"]["l"]=1;availablePrefixMap["E"]["l"]=1;availablePrefixMap["P"]["l"]=1;availablePrefixMap["T"]["l"]=1;availablePrefixMap["G"]["l"]=1;availablePrefixMap["M"]["l"]=1;availablePrefixMap["k"]["l"]=1;availablePrefixMap["h"]["l"]=1;availablePrefixMap["da"]["l"]=1;availablePrefixMap["e"]["l"]=1;availablePrefixMap["d"]["l"]=1;availablePrefixMap["c"]["l"]= 1;availablePrefixMap["m"]["l"]=1;availablePrefixMap["u"]["l"]=1;availablePrefixMap["n"]["l"]=1;availablePrefixMap["p"]["l"]=1;availablePrefixMap["f"]["l"]=1;availablePrefixMap["a"]["l"]=1;availablePrefixMap["z"]["l"]=1;availablePrefixMap["y"]["l"]=1;availablePrefixMap["Y"]["L"]=1;availablePrefixMap["Z"]["L"]=1;availablePrefixMap["E"]["L"]=1;availablePrefixMap["P"]["L"]=1;availablePrefixMap["T"]["L"]=1;availablePrefixMap["G"]["L"]=1;availablePrefixMap["M"]["L"]=1;availablePrefixMap["k"]["L"]=1;availablePrefixMap["h"]["L"]= 1;availablePrefixMap["da"]["L"]=1;availablePrefixMap["e"]["L"]=1;availablePrefixMap["d"]["L"]=1;availablePrefixMap["c"]["L"]=1;availablePrefixMap["m"]["L"]=1;availablePrefixMap["u"]["L"]=1;availablePrefixMap["n"]["L"]=1;availablePrefixMap["p"]["L"]=1;availablePrefixMap["f"]["L"]=1;availablePrefixMap["a"]["L"]=1;availablePrefixMap["z"]["L"]=1;availablePrefixMap["y"]["L"]=1;availablePrefixMap["Y"]["lt"]=1;availablePrefixMap["Z"]["lt"]=1;availablePrefixMap["E"]["lt"]=1;availablePrefixMap["P"]["lt"]= 1;availablePrefixMap["T"]["lt"]=1;availablePrefixMap["G"]["lt"]=1;availablePrefixMap["M"]["lt"]=1;availablePrefixMap["k"]["lt"]=1;availablePrefixMap["h"]["lt"]=1;availablePrefixMap["da"]["lt"]=1;availablePrefixMap["e"]["lt"]=1;availablePrefixMap["d"]["lt"]=1;availablePrefixMap["c"]["lt"]=1;availablePrefixMap["m"]["lt"]=1;availablePrefixMap["u"]["lt"]=1;availablePrefixMap["n"]["lt"]=1;availablePrefixMap["p"]["lt"]=1;availablePrefixMap["f"]["lt"]=1;availablePrefixMap["a"]["lt"]=1;availablePrefixMap["z"]["lt"]= 1;availablePrefixMap["y"]["lt"]=1;availablePrefixMap["Y"]["ang3"]=1;availablePrefixMap["Z"]["ang3"]=1;availablePrefixMap["E"]["ang3"]=1;availablePrefixMap["P"]["ang3"]=1;availablePrefixMap["T"]["ang3"]=1;availablePrefixMap["G"]["ang3"]=1;availablePrefixMap["M"]["ang3"]=1;availablePrefixMap["k"]["ang3"]=1;availablePrefixMap["h"]["ang3"]=1;availablePrefixMap["da"]["ang3"]=1;availablePrefixMap["e"]["ang3"]=1;availablePrefixMap["d"]["ang3"]=1;availablePrefixMap["c"]["ang3"]=1;availablePrefixMap["m"]["ang3"]= 1;availablePrefixMap["u"]["ang3"]=1;availablePrefixMap["n"]["ang3"]=1;availablePrefixMap["p"]["ang3"]=1;availablePrefixMap["f"]["ang3"]=1;availablePrefixMap["a"]["ang3"]=1;availablePrefixMap["z"]["ang3"]=1;availablePrefixMap["y"]["ang3"]=1;availablePrefixMap["Y"]["ang^3"]=1;availablePrefixMap["Z"]["ang^3"]=1;availablePrefixMap["E"]["ang^3"]=1;availablePrefixMap["P"]["ang^3"]=1;availablePrefixMap["T"]["ang^3"]=1;availablePrefixMap["G"]["ang^3"]=1;availablePrefixMap["M"]["ang^3"]=1;availablePrefixMap["k"]["ang^3"]= 1;availablePrefixMap["h"]["ang^3"]=1;availablePrefixMap["da"]["ang^3"]=1;availablePrefixMap["e"]["ang^3"]=1;availablePrefixMap["d"]["ang^3"]=1;availablePrefixMap["c"]["ang^3"]=1;availablePrefixMap["m"]["ang^3"]=1;availablePrefixMap["u"]["ang^3"]=1;availablePrefixMap["n"]["ang^3"]=1;availablePrefixMap["p"]["ang^3"]=1;availablePrefixMap["f"]["ang^3"]=1;availablePrefixMap["a"]["ang^3"]=1;availablePrefixMap["z"]["ang^3"]=1;availablePrefixMap["y"]["ang^3"]=1;availablePrefixMap["Y"]["m3"]=1;availablePrefixMap["Z"]["m3"]= 1;availablePrefixMap["E"]["m3"]=1;availablePrefixMap["P"]["m3"]=1;availablePrefixMap["T"]["m3"]=1;availablePrefixMap["G"]["m3"]=1;availablePrefixMap["M"]["m3"]=1;availablePrefixMap["k"]["m3"]=1;availablePrefixMap["h"]["m3"]=1;availablePrefixMap["da"]["m3"]=1;availablePrefixMap["e"]["m3"]=1;availablePrefixMap["d"]["m3"]=1;availablePrefixMap["c"]["m3"]=1;availablePrefixMap["m"]["m3"]=1;availablePrefixMap["u"]["m3"]=1;availablePrefixMap["n"]["m3"]=1;availablePrefixMap["p"]["m3"]=1;availablePrefixMap["f"]["m3"]= 1;availablePrefixMap["a"]["m3"]=1;availablePrefixMap["z"]["m3"]=1;availablePrefixMap["y"]["m3"]=1;availablePrefixMap["Y"]["m^3"]=1;availablePrefixMap["Z"]["m^3"]=1;availablePrefixMap["E"]["m^3"]=1;availablePrefixMap["P"]["m^3"]=1;availablePrefixMap["T"]["m^3"]=1;availablePrefixMap["G"]["m^3"]=1;availablePrefixMap["M"]["m^3"]=1;availablePrefixMap["k"]["m^3"]=1;availablePrefixMap["h"]["m^3"]=1;availablePrefixMap["da"]["m^3"]=1;availablePrefixMap["e"]["m^3"]=1;availablePrefixMap["d"]["m^3"]=1;availablePrefixMap["c"]["m^3"]= 1;availablePrefixMap["m"]["m^3"]=1;availablePrefixMap["u"]["m^3"]=1;availablePrefixMap["n"]["m^3"]=1;availablePrefixMap["p"]["m^3"]=1;availablePrefixMap["f"]["m^3"]=1;availablePrefixMap["a"]["m^3"]=1;availablePrefixMap["z"]["m^3"]=1;availablePrefixMap["y"]["m^3"]=1;availablePrefixMap["Y"]["ang2"]=1;availablePrefixMap["Z"]["ang2"]=1;availablePrefixMap["E"]["ang2"]=1;availablePrefixMap["P"]["ang2"]=1;availablePrefixMap["T"]["ang2"]=1;availablePrefixMap["G"]["ang2"]=1;availablePrefixMap["M"]["ang2"]= 1;availablePrefixMap["k"]["ang2"]=1;availablePrefixMap["h"]["ang2"]=1;availablePrefixMap["da"]["ang2"]=1;availablePrefixMap["e"]["ang2"]=1;availablePrefixMap["d"]["ang2"]=1;availablePrefixMap["c"]["ang2"]=1;availablePrefixMap["m"]["ang2"]=1;availablePrefixMap["u"]["ang2"]=1;availablePrefixMap["n"]["ang2"]=1;availablePrefixMap["p"]["ang2"]=1;availablePrefixMap["f"]["ang2"]=1;availablePrefixMap["a"]["ang2"]=1;availablePrefixMap["z"]["ang2"]=1;availablePrefixMap["y"]["ang2"]=1;availablePrefixMap["Y"]["ar"]= 1;availablePrefixMap["Z"]["ar"]=1;availablePrefixMap["E"]["ar"]=1;availablePrefixMap["P"]["ar"]=1;availablePrefixMap["T"]["ar"]=1;availablePrefixMap["G"]["ar"]=1;availablePrefixMap["M"]["ar"]=1;availablePrefixMap["k"]["ar"]=1;availablePrefixMap["h"]["ar"]=1;availablePrefixMap["da"]["ar"]=1;availablePrefixMap["e"]["ar"]=1;availablePrefixMap["d"]["ar"]=1;availablePrefixMap["c"]["ar"]=1;availablePrefixMap["m"]["ar"]=1;availablePrefixMap["u"]["ar"]=1;availablePrefixMap["n"]["ar"]=1;availablePrefixMap["p"]["ar"]= 1;availablePrefixMap["f"]["ar"]=1;availablePrefixMap["a"]["ar"]=1;availablePrefixMap["z"]["ar"]=1;availablePrefixMap["y"]["ar"]=1;availablePrefixMap["Y"]["m2"]=1;availablePrefixMap["Z"]["m2"]=1;availablePrefixMap["E"]["m2"]=1;availablePrefixMap["P"]["m2"]=1;availablePrefixMap["T"]["m2"]=1;availablePrefixMap["G"]["m2"]=1;availablePrefixMap["M"]["m2"]=1;availablePrefixMap["k"]["m2"]=1;availablePrefixMap["h"]["m2"]=1;availablePrefixMap["da"]["m2"]=1;availablePrefixMap["e"]["m2"]=1;availablePrefixMap["d"]["m2"]= 1;availablePrefixMap["c"]["m2"]=1;availablePrefixMap["m"]["m2"]=1;availablePrefixMap["u"]["m2"]=1;availablePrefixMap["n"]["m2"]=1;availablePrefixMap["p"]["m2"]=1;availablePrefixMap["f"]["m2"]=1;availablePrefixMap["a"]["m2"]=1;availablePrefixMap["z"]["m2"]=1;availablePrefixMap["y"]["m2"]=1;availablePrefixMap["Y"]["m^2"]=1;availablePrefixMap["Z"]["m^2"]=1;availablePrefixMap["E"]["m^2"]=1;availablePrefixMap["P"]["m^2"]=1;availablePrefixMap["T"]["m^2"]=1;availablePrefixMap["G"]["m^2"]=1;availablePrefixMap["M"]["m^2"]= 1;availablePrefixMap["k"]["m^2"]=1;availablePrefixMap["h"]["m^2"]=1;availablePrefixMap["da"]["m^2"]=1;availablePrefixMap["e"]["m^2"]=1;availablePrefixMap["d"]["m^2"]=1;availablePrefixMap["c"]["m^2"]=1;availablePrefixMap["m"]["m^2"]=1;availablePrefixMap["u"]["m^2"]=1;availablePrefixMap["n"]["m^2"]=1;availablePrefixMap["p"]["m^2"]=1;availablePrefixMap["f"]["m^2"]=1;availablePrefixMap["a"]["m^2"]=1;availablePrefixMap["z"]["m^2"]=1;availablePrefixMap["y"]["m^2"]=1;availablePrefixMap["Y"]["bit"]=1;availablePrefixMap["Z"]["bit"]= 1;availablePrefixMap["E"]["bit"]=1;availablePrefixMap["P"]["bit"]=1;availablePrefixMap["T"]["bit"]=1;availablePrefixMap["G"]["bit"]=1;availablePrefixMap["M"]["bit"]=1;availablePrefixMap["k"]["bit"]=1;availablePrefixMap["h"]["bit"]=1;availablePrefixMap["da"]["bit"]=1;availablePrefixMap["e"]["bit"]=1;availablePrefixMap["d"]["bit"]=1;availablePrefixMap["c"]["bit"]=1;availablePrefixMap["m"]["bit"]=1;availablePrefixMap["u"]["bit"]=1;availablePrefixMap["n"]["bit"]=1;availablePrefixMap["p"]["bit"]=1;availablePrefixMap["f"]["bit"]= 1;availablePrefixMap["a"]["bit"]=1;availablePrefixMap["z"]["bit"]=1;availablePrefixMap["y"]["bit"]=1;availablePrefixMap["Y"]["byte"]=1;availablePrefixMap["Z"]["byte"]=1;availablePrefixMap["E"]["byte"]=1;availablePrefixMap["P"]["byte"]=1;availablePrefixMap["T"]["byte"]=1;availablePrefixMap["G"]["byte"]=1;availablePrefixMap["M"]["byte"]=1;availablePrefixMap["k"]["byte"]=1;availablePrefixMap["h"]["byte"]=1;availablePrefixMap["da"]["byte"]=1;availablePrefixMap["e"]["byte"]=1;availablePrefixMap["d"]["byte"]= 1;availablePrefixMap["c"]["byte"]=1;availablePrefixMap["m"]["byte"]=1;availablePrefixMap["u"]["byte"]=1;availablePrefixMap["n"]["byte"]=1;availablePrefixMap["p"]["byte"]=1;availablePrefixMap["f"]["byte"]=1;availablePrefixMap["a"]["byte"]=1;availablePrefixMap["z"]["byte"]=1;availablePrefixMap["y"]["byte"]=1;availablePrefixMap["Y"]["m/h"]=1;availablePrefixMap["Z"]["m/h"]=1;availablePrefixMap["E"]["m/h"]=1;availablePrefixMap["P"]["m/h"]=1;availablePrefixMap["T"]["m/h"]=1;availablePrefixMap["G"]["m/h"]= 1;availablePrefixMap["M"]["m/h"]=1;availablePrefixMap["k"]["m/h"]=1;availablePrefixMap["h"]["m/h"]=1;availablePrefixMap["da"]["m/h"]=1;availablePrefixMap["e"]["m/h"]=1;availablePrefixMap["d"]["m/h"]=1;availablePrefixMap["c"]["m/h"]=1;availablePrefixMap["m"]["m/h"]=1;availablePrefixMap["u"]["m/h"]=1;availablePrefixMap["n"]["m/h"]=1;availablePrefixMap["p"]["m/h"]=1;availablePrefixMap["f"]["m/h"]=1;availablePrefixMap["a"]["m/h"]=1;availablePrefixMap["z"]["m/h"]=1;availablePrefixMap["y"]["m/h"]=1;availablePrefixMap["Y"]["m/hr"]= 1;availablePrefixMap["Z"]["m/hr"]=1;availablePrefixMap["E"]["m/hr"]=1;availablePrefixMap["P"]["m/hr"]=1;availablePrefixMap["T"]["m/hr"]=1;availablePrefixMap["G"]["m/hr"]=1;availablePrefixMap["M"]["m/hr"]=1;availablePrefixMap["k"]["m/hr"]=1;availablePrefixMap["h"]["m/hr"]=1;availablePrefixMap["da"]["m/hr"]=1;availablePrefixMap["e"]["m/hr"]=1;availablePrefixMap["d"]["m/hr"]=1;availablePrefixMap["c"]["m/hr"]=1;availablePrefixMap["m"]["m/hr"]=1;availablePrefixMap["u"]["m/hr"]=1;availablePrefixMap["n"]["m/hr"]= 1;availablePrefixMap["p"]["m/hr"]=1;availablePrefixMap["f"]["m/hr"]=1;availablePrefixMap["a"]["m/hr"]=1;availablePrefixMap["z"]["m/hr"]=1;availablePrefixMap["y"]["m/hr"]=1;availablePrefixMap["Y"]["m/s"]=1;availablePrefixMap["Z"]["m/s"]=1;availablePrefixMap["E"]["m/s"]=1;availablePrefixMap["P"]["m/s"]=1;availablePrefixMap["T"]["m/s"]=1;availablePrefixMap["G"]["m/s"]=1;availablePrefixMap["M"]["m/s"]=1;availablePrefixMap["k"]["m/s"]=1;availablePrefixMap["h"]["m/s"]=1;availablePrefixMap["da"]["m/s"]= 1;availablePrefixMap["e"]["m/s"]=1;availablePrefixMap["d"]["m/s"]=1;availablePrefixMap["c"]["m/s"]=1;availablePrefixMap["m"]["m/s"]=1;availablePrefixMap["u"]["m/s"]=1;availablePrefixMap["n"]["m/s"]=1;availablePrefixMap["p"]["m/s"]=1;availablePrefixMap["f"]["m/s"]=1;availablePrefixMap["a"]["m/s"]=1;availablePrefixMap["z"]["m/s"]=1;availablePrefixMap["y"]["m/s"]=1;availablePrefixMap["Y"]["m/sec"]=1;availablePrefixMap["Z"]["m/sec"]=1;availablePrefixMap["E"]["m/sec"]=1;availablePrefixMap["P"]["m/sec"]= 1;availablePrefixMap["T"]["m/sec"]=1;availablePrefixMap["G"]["m/sec"]=1;availablePrefixMap["M"]["m/sec"]=1;availablePrefixMap["k"]["m/sec"]=1;availablePrefixMap["h"]["m/sec"]=1;availablePrefixMap["da"]["m/sec"]=1;availablePrefixMap["e"]["m/sec"]=1;availablePrefixMap["d"]["m/sec"]=1;availablePrefixMap["c"]["m/sec"]=1;availablePrefixMap["m"]["m/sec"]=1;availablePrefixMap["u"]["m/sec"]=1;availablePrefixMap["n"]["m/sec"]=1;availablePrefixMap["p"]["m/sec"]=1;availablePrefixMap["f"]["m/sec"]=1;availablePrefixMap["a"]["m/sec"]= 1;availablePrefixMap["z"]["m/sec"]=1;availablePrefixMap["y"]["m/sec"]=1;availablePrefixMap["Yi"]["bit"]=1;availablePrefixMap["Zi"]["bit"]=1;availablePrefixMap["Ei"]["bit"]=1;availablePrefixMap["Pi"]["bit"]=1;availablePrefixMap["Ti"]["bit"]=1;availablePrefixMap["Gi"]["bit"]=1;availablePrefixMap["Mi"]["bit"]=1;availablePrefixMap["ki"]["bit"]=1;availablePrefixMap["Yi"]["byte"]=1;availablePrefixMap["Zi"]["byte"]=1;availablePrefixMap["Ei"]["byte"]=1;availablePrefixMap["Pi"]["byte"]=1;availablePrefixMap["Ti"]["byte"]= 1;availablePrefixMap["Gi"]["byte"]=1;availablePrefixMap["Mi"]["byte"]=1;availablePrefixMap["ki"]["byte"]=1;prefixValueMap={};prefixValueMap["Y"]=1E24;prefixValueMap["Z"]=1E21;prefixValueMap["E"]=1E18;prefixValueMap["P"]=1E15;prefixValueMap["T"]=1E12;prefixValueMap["G"]=1E9;prefixValueMap["M"]=1E6;prefixValueMap["k"]=1E3;prefixValueMap["h"]=100;prefixValueMap["da"]=10;prefixValueMap["e"]=10;prefixValueMap["d"]=.1;prefixValueMap["c"]=.01;prefixValueMap["m"]=.001;prefixValueMap["u"]=1E-6;prefixValueMap["n"]= 1E-9;prefixValueMap["p"]=1E-12;prefixValueMap["f"]=1E-15;prefixValueMap["a"]=1E-18;prefixValueMap["z"]=1E-21;prefixValueMap["y"]=1E-24;prefixValueMap["Yi"]=1.20892581961463E24;prefixValueMap["Zi"]=1.18059162071741E21;prefixValueMap["Ei"]=0x1000000000000c00;prefixValueMap["Pi"]=0x4000000000000;prefixValueMap["Ti"]=1099511627776;prefixValueMap["Gi"]=1073741824;prefixValueMap["Mi"]=1048576;prefixValueMap["ki"]=1024}return availablePrefixMap}function getUnitConverterCoeff(from,to){var uniteArr=getUnitConverter(); var res=null;if(uniteArr[from]&&undefined!==uniteArr[from][to])res=uniteArr[from][to];return res}cFormulaFunctionGroup["Engineering"]=cFormulaFunctionGroup["Engineering"]||[];cFormulaFunctionGroup["Engineering"].push(cBESSELI,cBESSELJ,cBESSELK,cBESSELY,cBIN2DEC,cBIN2HEX,cBIN2OCT,cBITAND,cBITLSHIFT,cBITOR,cBITRSHIFT,cBITXOR,cCOMPLEX,cCONVERT,cDEC2BIN,cDEC2HEX,cDEC2OCT,cDELTA,cERF,cERF_PRECISE,cERFC,cERFC_PRECISE,cGESTEP,cHEX2BIN,cHEX2DEC,cHEX2OCT,cIMABS,cIMAGINARY,cIMARGUMENT,cIMCONJUGATE,cIMCOS,cIMCOSH, cIMCOT,cIMCSC,cIMCSCH,cIMDIV,cIMEXP,cIMLN,cIMLOG10,cIMLOG2,cIMPOWER,cIMPRODUCT,cIMREAL,cIMSEC,cIMSECH,cIMSIN,cIMSINH,cIMSQRT,cIMSUB,cIMSUM,cIMTAN,cOCT2BIN,cOCT2DEC,cOCT2HEX);function cBESSELI(){}cBESSELI.prototype=Object.create(cBaseFunction.prototype);cBESSELI.prototype.constructor=cBESSELI;cBESSELI.prototype.name="BESSELI";cBESSELI.prototype.argumentsMin=2;cBESSELI.prototype.argumentsMax=2;cBESSELI.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cBESSELI.prototype.argumentsType= [argType.any,argType.any];cBESSELI.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var x=argArray[0];var n=argArray[1];if(n<0)return new cError(cErrorType.not_numeric);if(x<0)x=Math.abs(x);n=Math.floor(n);return BesselI(x,n)};return this._findArrayInNumberArguments(oArguments, calcFunc)};function cBESSELJ(){}cBESSELJ.prototype=Object.create(cBaseFunction.prototype);cBESSELJ.prototype.constructor=cBESSELJ;cBESSELJ.prototype.name="BESSELJ";cBESSELJ.prototype.argumentsMin=2;cBESSELJ.prototype.argumentsMax=2;cBESSELJ.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cBESSELJ.prototype.argumentsType=[argType.any,argType.any];cBESSELJ.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args; argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var x=argArray[0];var n=argArray[1];if(n<0)return new cError(cErrorType.not_numeric);if(x<0)x=Math.abs(x);n=Math.floor(n);return BesselJ(x,n)};return this._findArrayInNumberArguments(oArguments,calcFunc)};function cBESSELK(){}cBESSELK.prototype=Object.create(cBaseFunction.prototype);cBESSELK.prototype.constructor=cBESSELK;cBESSELK.prototype.name= "BESSELK";cBESSELK.prototype.argumentsMin=2;cBESSELK.prototype.argumentsMax=2;cBESSELK.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cBESSELK.prototype.argumentsType=[argType.any,argType.any];cBESSELK.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError; var calcFunc=function(argArray){var x=argArray[0];var n=argArray[1];if(n<0||x<0)return new cError(cErrorType.not_numeric);n=Math.floor(n);return BesselK(x,n)};return this._findArrayInNumberArguments(oArguments,calcFunc)};function cBESSELY(){}cBESSELY.prototype=Object.create(cBaseFunction.prototype);cBESSELY.prototype.constructor=cBESSELY;cBESSELY.prototype.name="BESSELY";cBESSELY.prototype.argumentsMin=2;cBESSELY.prototype.argumentsMax=2;cBESSELY.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cBESSELY.prototype.argumentsType=[argType.any,argType.any];cBESSELY.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var x=argArray[0];var n=argArray[1];if(n<0||x<0)return new cError(cErrorType.not_numeric);n=Math.floor(n);return BesselY(x,n)};return this._findArrayInNumberArguments(oArguments, calcFunc)};function cBIN2DEC(){}cBIN2DEC.prototype=Object.create(cBaseFunction.prototype);cBIN2DEC.prototype.constructor=cBIN2DEC;cBIN2DEC.prototype.name="BIN2DEC";cBIN2DEC.prototype.argumentsMin=1;cBIN2DEC.prototype.argumentsMax=1;cBIN2DEC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cBIN2DEC.prototype.argumentsType=[argType.any];cBIN2DEC.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type);arg0=arg0.getValue();if(arg0.length==0)arg0=0;var res;if(validBINNumber(arg0)){var substr=arg0.toString();if(substr.length==10&&substr.substring(0,1)=="1")res=new cNumber(parseInt(substr.substring(1),NumberBase.BIN)-512);else res=new cNumber(parseInt(arg0,NumberBase.BIN))}else res=new cError(cErrorType.not_numeric);return res};function cBIN2HEX(){} cBIN2HEX.prototype=Object.create(cBaseFunction.prototype);cBIN2HEX.prototype.constructor=cBIN2HEX;cBIN2HEX.prototype.name="BIN2HEX";cBIN2HEX.prototype.argumentsMin=1;cBIN2HEX.prototype.argumentsMax=2;cBIN2HEX.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cBIN2HEX.prototype.argumentsType=[argType.any,argType.any];cBIN2HEX.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return new cError(cErrorType.not_numeric);arg0=arg0.getValue();if(arg0.length==0)arg0=0;if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1=arg1.getValue();var res;if(validBINNumber(arg0)&& (arg1>0&&arg1<=10||arg1==undefined)){var substr=arg0.toString();if(substr.length===10&&substr.substring(0,1)==="1")res=new cString((0xfffffffe00+parseInt(substr.substring(1),NumberBase.BIN)).toString(NumberBase.HEX).toUpperCase());else res=convertFromTo(arg0,NumberBase.BIN,NumberBase.HEX,arg1)}else res=new cError(cErrorType.not_numeric);return res};function cBIN2OCT(){}cBIN2OCT.prototype=Object.create(cBaseFunction.prototype);cBIN2OCT.prototype.constructor=cBIN2OCT;cBIN2OCT.prototype.name="BIN2OCT"; cBIN2OCT.prototype.argumentsMin=1;cBIN2OCT.prototype.argumentsMax=2;cBIN2OCT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cBIN2OCT.prototype.argumentsType=[argType.any,argType.any];cBIN2OCT.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1= arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return new cError(cErrorType.not_numeric);arg0=arg0.getValue();if(arg0.length==0)arg0=0;if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1=arg1.getValue();var res;if(validBINNumber(arg0)&&(arg1>0&&arg1<=10||arg1==undefined)){var substr=arg0.toString();if(substr.length===10&&substr.substring(0, 1)==="1")res=new cString((1073741312+parseInt(substr.substring(1),NumberBase.BIN)).toString(NumberBase.OCT).toUpperCase());else res=convertFromTo(arg0,NumberBase.BIN,NumberBase.OCT,arg1)}else res=new cError(cErrorType.not_numeric);return res};function cBITAND(){}cBITAND.prototype=Object.create(cBaseFunction.prototype);cBITAND.prototype.constructor=cBITAND;cBITAND.prototype.name="BITAND";cBITAND.prototype.argumentsMin=2;cBITAND.prototype.argumentsMax=2;cBITAND.prototype.isXLFN=true;cBITAND.prototype.argumentsType= [argType.number,argType.number];cBITAND.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var arg0=Math.floor(argArray[0]);var arg1=Math.floor(argArray[1]);if(arg0<0||arg1<0)return new cError(cErrorType.not_numeric);var res=arg0&arg1;return null!==res&& !isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcFunc)};function cBITLSHIFT(){}cBITLSHIFT.prototype=Object.create(cBaseFunction.prototype);cBITLSHIFT.prototype.constructor=cBITLSHIFT;cBITLSHIFT.prototype.name="BITLSHIFT";cBITLSHIFT.prototype.argumentsMin=2;cBITLSHIFT.prototype.argumentsMax=2;cBITLSHIFT.prototype.isXLFN=true;cBITLSHIFT.prototype.argumentsType=[argType.number,argType.number];cBITLSHIFT.prototype.Calculate=function(arg){var oArguments= this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var arg0=Math.floor(argArray[0]);var arg1=Math.floor(argArray[1]);if(arg0<0)return new cError(cErrorType.not_numeric);var res;if(arg1<0)res=Math.floor(arg0/Math.pow(2,-arg1));else if(arg1===0)res=arg0;else res=arg0*Math.pow(2,arg1);return null!==res&& !isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcFunc)};function cBITOR(){}cBITOR.prototype=Object.create(cBaseFunction.prototype);cBITOR.prototype.constructor=cBITOR;cBITOR.prototype.name="BITOR";cBITOR.prototype.argumentsMin=2;cBITOR.prototype.argumentsMax=2;cBITOR.prototype.isXLFN=true;cBITOR.prototype.argumentsType=[argType.number,argType.number];cBITOR.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg, arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var arg0=Math.floor(argArray[0]);var arg1=Math.floor(argArray[1]);if(arg0<0||arg1<0)return new cError(cErrorType.not_numeric);var res=arg0|arg1;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments, calcFunc)};function cBITRSHIFT(){}cBITRSHIFT.prototype=Object.create(cBaseFunction.prototype);cBITRSHIFT.prototype.constructor=cBITRSHIFT;cBITRSHIFT.prototype.name="BITRSHIFT";cBITRSHIFT.prototype.argumentsMin=2;cBITRSHIFT.prototype.argumentsMax=2;cBITRSHIFT.prototype.isXLFN=true;cBITRSHIFT.prototype.argumentsType=[argType.number,argType.number];cBITRSHIFT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber(); argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var arg0=Math.floor(argArray[0]);var arg1=Math.floor(argArray[1]);if(arg0<0)return new cError(cErrorType.not_numeric);var res;if(arg1<0)res=Math.floor(arg0*Math.pow(2,-arg1));else if(arg1===0)res=arg0;else res=Math.floor(arg0/Math.pow(2,arg1));return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments, calcFunc)};function cBITXOR(){}cBITXOR.prototype=Object.create(cBaseFunction.prototype);cBITXOR.prototype.constructor=cBITXOR;cBITXOR.prototype.name="BITXOR";cBITXOR.prototype.argumentsMin=2;cBITXOR.prototype.argumentsMax=2;cBITXOR.prototype.isXLFN=true;cBITXOR.prototype.argumentsType=[argType.number,argType.number];cBITXOR.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber(); var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var arg0=Math.floor(argArray[0]);var arg1=Math.floor(argArray[1]);if(arg0<0||arg1<0)return new cError(cErrorType.not_numeric);var res=arg0^arg1;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcFunc)};function cCOMPLEX(){}cCOMPLEX.prototype=Object.create(cBaseFunction.prototype);cCOMPLEX.prototype.constructor= cCOMPLEX;cCOMPLEX.prototype.name="COMPLEX";cCOMPLEX.prototype.argumentsMin=2;cCOMPLEX.prototype.argumentsMax=3;cCOMPLEX.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCOMPLEX.prototype.argumentsType=[argType.any,argType.any,argType.any];cCOMPLEX.prototype.Calculate=function(arg){var real=arg[0],img=arg[1],suf=!arg[2]||arg[2]instanceof AscCommonExcel.cEmpty?new cString("i"):arg[2];if(real instanceof cArea||img instanceof cArea3D)real=real.cross(arguments[1]);else if(real instanceof cArray)real=real.getElement(0);if(img instanceof cArea||img instanceof cArea3D)img=img.cross(arguments[1]);else if(img instanceof cArray)img=img.getElement(0);if(suf instanceof cArea||suf instanceof cArea3D)suf=suf.cross(arguments[1]);else if(suf instanceof cArray)suf=suf.getElement(0);real=real.tocNumber();img=img.tocNumber();suf=suf.tocString();if(real instanceof cError)return real;if(img instanceof cError)return img;if(suf instanceof cError)return suf;real=real.getValue();img=img.getValue();suf= suf.getValue();if(suf!="i"&&suf!="j")return new cError(cErrorType.wrong_value_type);var c=new Complex(real,img,suf);return new cString(c.toString())};function cCONVERT(){}cCONVERT.prototype=Object.create(cBaseFunction.prototype);cCONVERT.prototype.constructor=cCONVERT;cCONVERT.prototype.name="CONVERT";cCONVERT.prototype.argumentsMin=3;cCONVERT.prototype.argumentsMax=3;cCONVERT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCONVERT.prototype.argumentsType=[argType.any, argType.any,argType.any];cCONVERT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocString();argClone[2]=argClone[2].tocString();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFunc=function(argArray){var num=argArray[0];var from=argArray[1];var to=argArray[2];var prefixFrom=null;var prefixTo=null;var parseFrefix=function(val){var isPrefix= val.substr(0,1);var isOperator;if(availablePrefixMap[isPrefix]){isOperator=val.substring(1,val.length);if(availablePrefixMap[isPrefix][isOperator])return{prefix:isPrefix,operator:isOperator}}isPrefix=val.substr(0,2);if(availablePrefixMap[isPrefix]){isOperator=val.substring(2,val.length);if(availablePrefixMap[isPrefix][isOperator])return{prefix:isPrefix,operator:isOperator}}};generatePrefixAvailableMap();var getPrefixFrom=parseFrefix(from);var prefixValueFrom=null;if(getPrefixFrom){prefixFrom=getPrefixFrom.prefix; from=getPrefixFrom.operator;prefixValueFrom=prefixValueMap[prefixFrom]}var getPrefixTo=parseFrefix(to);var prefixValueTo=null;if(getPrefixTo){prefixTo=getPrefixTo.prefix;to=getPrefixTo.operator;prefixValueTo=prefixValueMap[prefixTo]}var coeff;var res;if(from===to)res=num;else if(null!==(coeff=getUnitConverterCoeff(from,to)))if(coeff.length){res=num;for(var i=0;i<coeff.length;i++)if(0===coeff[i].type)res*=coeff[i].val;else res+=coeff[i].val}else res=num*coeff;else if(null!==(coeff=getUnitConverterCoeff(to, from)))if(coeff.length){res=num;for(var i=coeff.length-1;i>=0;i--)if(0===coeff[i].type)res/=coeff[i].val;else res-=coeff[i].val}else res=num/coeff;else return new cError(cErrorType.not_available);if(null!==prefixValueFrom)res=res*prefixValueFrom;if(null!==prefixValueTo)res=res/prefixValueTo;return new cNumber(res)};return this._findArrayInNumberArguments(oArguments,calcFunc,true)};function cDEC2BIN(){}cDEC2BIN.prototype=Object.create(cBaseFunction.prototype);cDEC2BIN.prototype.constructor=cDEC2BIN; cDEC2BIN.prototype.name="DEC2BIN";cDEC2BIN.prototype.argumentsMin=1;cDEC2BIN.prototype.argumentsMax=2;cDEC2BIN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDEC2BIN.prototype.argumentsType=[argType.any,argType.any];cDEC2BIN.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocNumber();if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type);arg0=Math.floor(arg0.getValue());if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1=arg1.getValue();var res;if(validDEC2BINNumber(arg0)&&arg0>=-512&&arg0<=511&&(arg1>0&&arg1<=10||arg1==undefined))if(arg0< 0)res=new cString("1"+"0".repeat(9-(512+arg0).toString(NumberBase.BIN).length)+(512+arg0).toString(NumberBase.BIN).toUpperCase());else res=convertFromTo(arg0,NumberBase.DEC,NumberBase.BIN,arg1);else res=new cError(cErrorType.not_numeric);return res};function cDEC2HEX(){}cDEC2HEX.prototype=Object.create(cBaseFunction.prototype);cDEC2HEX.prototype.constructor=cDEC2HEX;cDEC2HEX.prototype.name="DEC2HEX";cDEC2HEX.prototype.argumentsMin=1;cDEC2HEX.prototype.argumentsMax=2;cDEC2HEX.prototype.returnValueType= AscCommonExcel.cReturnFormulaType.value_replace_area;cDEC2HEX.prototype.argumentsType=[argType.any,argType.any];cDEC2HEX.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocNumber(); if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type);arg0=Math.floor(arg0.getValue());if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1=arg1.getValue();var res;if(validDEC2HEXNumber(arg0)&&arg0>=-549755813888&&arg0<=549755813887&&(arg1>0&&arg1<=10||arg1==undefined))if(arg0<0)res=new cString((1099511627776+arg0).toString(NumberBase.HEX).toUpperCase());else res=convertFromTo(arg0,NumberBase.DEC,NumberBase.HEX, arg1);else res=new cError(cErrorType.not_numeric);return res};function cDEC2OCT(){}cDEC2OCT.prototype=Object.create(cBaseFunction.prototype);cDEC2OCT.prototype.constructor=cDEC2OCT;cDEC2OCT.prototype.name="DEC2OCT";cDEC2OCT.prototype.argumentsMin=1;cDEC2OCT.prototype.argumentsMax=2;cDEC2OCT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDEC2OCT.prototype.argumentsType=[argType.any,argType.any];cDEC2OCT.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]? arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocNumber();if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type);arg0=Math.floor(arg0.getValue());if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1=arg1.getValue();var res;if(validDEC2OCTNumber(arg0)&&arg0>=-536870912&&arg0<=536870911&&(arg1>0&&arg1<=10||arg1==undefined))if(arg0<0)res=new cString((1073741824+arg0).toString(NumberBase.OCT).toUpperCase());else res=convertFromTo(arg0,NumberBase.DEC,NumberBase.OCT,arg1);else res=new cError(cErrorType.not_numeric);return res};function cDELTA(){}cDELTA.prototype=Object.create(cBaseFunction.prototype);cDELTA.prototype.constructor=cDELTA;cDELTA.prototype.name= "DELTA";cDELTA.prototype.argumentsMin=1;cDELTA.prototype.argumentsMax=2;cDELTA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDELTA.prototype.argumentsType=[argType.any,argType.any];cDELTA.prototype.Calculate=function(arg){var number1=arg[0],number2=!arg[1]?new cNumber(0):arg[1];if(number1 instanceof cArea||number2 instanceof cArea3D)number1=number1.cross(arguments[1]);else if(number1 instanceof cArray)number1=number1.getElement(0);if(number2 instanceof cArea||number2 instanceof cArea3D)number2=number2.cross(arguments[1]);else if(number2 instanceof cArray)number2=number2.getElement(0);number1=number1.tocNumber();number2=number2.tocNumber();if(number1 instanceof cError)return number1;if(number2 instanceof cError)return number2;number1=number1.getValue();number2=number2.getValue();return new cNumber(number1==number2?1:0)};function cERF(){}cERF.prototype=Object.create(cBaseFunction.prototype);cERF.prototype.constructor=cERF;cERF.prototype.name="ERF";cERF.prototype.argumentsMin= 1;cERF.prototype.argumentsMax=2;cERF.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cERF.prototype.argumentsType=[argType.any,argType.any];cERF.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1]?argClone[1].tocNumber():new cUndefined;var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcErf=function(argArray){var a= argArray[0];var b=argArray[1];var res;if(undefined!==b)res=new cNumber(rtl_math_erf(b)-rtl_math_erf(a));else res=new cNumber(rtl_math_erf(a));return res};return this._findArrayInNumberArguments(oArguments,calcErf)};function cERF_PRECISE(){}cERF_PRECISE.prototype=Object.create(cBaseFunction.prototype);cERF_PRECISE.prototype.constructor=cERF_PRECISE;cERF_PRECISE.prototype.name="ERF.PRECISE";cERF_PRECISE.prototype.argumentsMin=1;cERF_PRECISE.prototype.argumentsMax=1;cERF_PRECISE.prototype.isXLFN=true; cERF_PRECISE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cERF_PRECISE.prototype.argumentsType=[argType.any];cERF_PRECISE.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcErf=function(argArray){var a=argArray[0];return new cNumber(rtl_math_erf(a))};return this._findArrayInNumberArguments(oArguments, calcErf)};function cERFC(){}cERFC.prototype=Object.create(cBaseFunction.prototype);cERFC.prototype.constructor=cERFC;cERFC.prototype.name="ERFC";cERFC.prototype.argumentsMin=1;cERFC.prototype.argumentsMax=1;cERFC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cERFC.prototype.argumentsType=[argType.any];cERFC.prototype.Calculate=function(arg){var a=arg[0];if(a instanceof cArea||a instanceof cArea3D)a=a.cross(arguments[1]);else if(a instanceof cArray)a=a.getElement(0); a=a.tocNumber();if(a instanceof cError)return a;a=a.getValue();return new cNumber(AscCommonExcel.rtl_math_erfc(a))};function cERFC_PRECISE(){}cERFC_PRECISE.prototype=Object.create(cERFC.prototype);cERFC_PRECISE.prototype.constructor=cERFC_PRECISE;cERFC_PRECISE.prototype.name="ERFC.PRECISE";cERFC_PRECISE.prototype.isXLFN=true;cERFC_PRECISE.prototype.argumentsType=[argType.any];function cGESTEP(){}cGESTEP.prototype=Object.create(cBaseFunction.prototype);cGESTEP.prototype.constructor=cGESTEP;cGESTEP.prototype.name= "GESTEP";cGESTEP.prototype.argumentsMin=1;cGESTEP.prototype.argumentsMax=2;cGESTEP.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cGESTEP.prototype.argumentsType=[argType.any,argType.any];cGESTEP.prototype.Calculate=function(arg){var number1=arg[0],number2=!arg[1]?new cNumber(0):arg[1];if(number1 instanceof cArea||number2 instanceof cArea3D)number1=number1.cross(arguments[1]);else if(number1 instanceof cArray)number1=number1.getElement(0);if(number2 instanceof cArea|| number2 instanceof cArea3D)number2=number2.cross(arguments[1]);else if(number2 instanceof cArray)number2=number2.getElement(0);number1=number1.tocNumber();number2=number2.tocNumber();if(number1 instanceof cError)return number1;if(number2 instanceof cError)return number2;number1=number1.getValue();number2=number2.getValue();return new cNumber(number1>=number2?1:0)};function cHEX2BIN(){}cHEX2BIN.prototype=Object.create(cBaseFunction.prototype);cHEX2BIN.prototype.constructor=cHEX2BIN;cHEX2BIN.prototype.name= "HEX2BIN";cHEX2BIN.prototype.argumentsMin=1;cHEX2BIN.prototype.argumentsMax=2;cHEX2BIN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cHEX2BIN.prototype.argumentsType=[argType.any,argType.any];cHEX2BIN.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type);arg0=arg0.getValue();if(arg0.length==0)arg0=0;if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1=arg1.getValue();var res;if(validHEXNumber(arg0)&&(arg1>0&&arg1<=10||arg1==undefined)){var negative=arg0.length===10&&arg0.substring(0, 1).toUpperCase()==="F",arg0DEC=negative?parseInt(arg0,NumberBase.HEX)-1099511627776:parseInt(arg0,NumberBase.HEX);if(arg0DEC<-512||arg0DEC>511)res=new cError(cErrorType.not_numeric);else if(negative){var str=(512+arg0DEC).toString(NumberBase.BIN);res=new cString("1"+"0".repeat(9-str.length)+str)}else res=convertFromTo(arg0DEC,NumberBase.DEC,NumberBase.BIN,arg1)}else res=new cError(cErrorType.not_numeric);return res};function cHEX2DEC(){}cHEX2DEC.prototype=Object.create(cBaseFunction.prototype);cHEX2DEC.prototype.constructor= cHEX2DEC;cHEX2DEC.prototype.name="HEX2DEC";cHEX2DEC.prototype.argumentsMin=1;cHEX2DEC.prototype.argumentsMax=1;cHEX2DEC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cHEX2DEC.prototype.argumentsType=[argType.any];cHEX2DEC.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0; arg0=arg0.getValue();if(arg0.length==0)arg0=0;var res;if(validHEXNumber(arg0)){arg0=parseInt(arg0,NumberBase.HEX);res=new cNumber(arg0>=549755813888?arg0-1099511627776:arg0)}else res=new cError(cErrorType.not_numeric);return res};function cHEX2OCT(){}cHEX2OCT.prototype=Object.create(cBaseFunction.prototype);cHEX2OCT.prototype.constructor=cHEX2OCT;cHEX2OCT.prototype.name="HEX2OCT";cHEX2OCT.prototype.argumentsMin=1;cHEX2OCT.prototype.argumentsMax=2;cHEX2OCT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cHEX2OCT.prototype.argumentsType=[argType.any,argType.any];cHEX2OCT.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type); arg0=arg0.getValue();if(arg0.length==0)arg0=0;if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1=arg1.getValue();var res;if(validHEXNumber(arg0)&&(arg1>0&&arg1<=10||arg1==undefined)){arg0=parseInt(arg0,NumberBase.HEX);if(arg0>536870911&&arg0<0xffe0000000)res=new cError(cErrorType.not_numeric);else if(arg0>=0xffe0000000)res=new cString((arg0-0xffc0000000).toString(NumberBase.OCT).toUpperCase());else res=convertFromTo(arg0, NumberBase.DEC,NumberBase.OCT,arg1)}else res=new cError(cErrorType.not_numeric);return res};function cIMABS(){}cIMABS.prototype=Object.create(cBaseFunction.prototype);cIMABS.prototype.constructor=cIMABS;cIMABS.prototype.name="IMABS";cIMABS.prototype.argumentsMin=1;cIMABS.prototype.argumentsMax=1;cIMABS.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMABS.prototype.argumentsType=[argType.any];cIMABS.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type);var c=new Complex(arg0.toString());if(c instanceof cError)return c;var res=new cNumber(c.Abs());res.numFormat=0;return res};function cIMAGINARY(){}cIMAGINARY.prototype=Object.create(cBaseFunction.prototype);cIMAGINARY.prototype.constructor=cIMAGINARY;cIMAGINARY.prototype.name="IMAGINARY"; cIMAGINARY.prototype.argumentsMin=1;cIMAGINARY.prototype.argumentsMax=1;cIMAGINARY.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMAGINARY.prototype.argumentsType=[argType.any];cIMAGINARY.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString()); if(c instanceof cError)return c;var res=new cNumber(c.Imag());res.numFormat=0;return res};function cIMARGUMENT(){}cIMARGUMENT.prototype=Object.create(cBaseFunction.prototype);cIMARGUMENT.prototype.constructor=cIMARGUMENT;cIMARGUMENT.prototype.name="IMARGUMENT";cIMARGUMENT.prototype.argumentsMin=1;cIMARGUMENT.prototype.argumentsMax=1;cIMARGUMENT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMARGUMENT.prototype.argumentsType=[argType.any];cIMARGUMENT.prototype.Calculate= function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;var res=new cNumber(c.Arg());res.numFormat=0;return res};function cIMCONJUGATE(){}cIMCONJUGATE.prototype=Object.create(cBaseFunction.prototype);cIMCONJUGATE.prototype.constructor=cIMCONJUGATE;cIMCONJUGATE.prototype.name= "IMCONJUGATE";cIMCONJUGATE.prototype.argumentsMin=1;cIMCONJUGATE.prototype.argumentsMax=1;cIMCONJUGATE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMCONJUGATE.prototype.argumentsType=[argType.any];cIMCONJUGATE.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c= new Complex(arg0.toString());if(c instanceof cError)return c;var res=new cString(c.Conj());res.numFormat=0;return res};function cIMCOS(){}cIMCOS.prototype=Object.create(cBaseFunction.prototype);cIMCOS.prototype.constructor=cIMCOS;cIMCOS.prototype.name="IMCOS";cIMCOS.prototype.argumentsMin=1;cIMCOS.prototype.argumentsMax=1;cIMCOS.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMCOS.prototype.argumentsType=[argType.any];cIMCOS.prototype.Calculate=function(arg){var arg0= arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Cos();var res=new cString(c.toString());res.numFormat=0;return res};function cIMCOSH(){}cIMCOSH.prototype=Object.create(cBaseFunction.prototype);cIMCOSH.prototype.constructor=cIMCOSH;cIMCOSH.prototype.name="IMCOSH";cIMCOSH.prototype.argumentsMin= 1;cIMCOSH.prototype.argumentsMax=1;cIMCOSH.prototype.isXLFN=true;cIMCOSH.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMCOSH.prototype.argumentsType=[argType.any];cIMCOSH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0.value===true||arg0.value===false)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString(); if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Cosh();var res=new cString(c.toString());res.numFormat=0;return res};function cIMCOT(){}cIMCOT.prototype=Object.create(cBaseFunction.prototype);cIMCOT.prototype.constructor=cIMCOT;cIMCOT.prototype.name="IMCOT";cIMCOT.prototype.argumentsMin=1;cIMCOT.prototype.argumentsMax=1;cIMCOT.prototype.isXLFN=true;cIMCOT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMCOT.prototype.argumentsType= [argType.any];cIMCOT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0.value===true||arg0.value===false)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;if(0==arg0.value)return new cError(cErrorType.not_numeric);var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Cot();var res= new cString(c.toString());res.numFormat=0;return res};function cIMCSC(){}cIMCSC.prototype=Object.create(cBaseFunction.prototype);cIMCSC.prototype.constructor=cIMCSC;cIMCSC.prototype.name="IMCSC";cIMCSC.prototype.argumentsMin=1;cIMCSC.prototype.argumentsMax=1;cIMCSC.prototype.isXLFN=true;cIMCSC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMCSC.prototype.argumentsType=[argType.any];cIMCSC.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea|| arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0.value===true||arg0.value===false)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;if(0==arg0.value)return new cError(cErrorType.not_numeric);var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Csc();var res=new cString(c.toString());res.numFormat=0;return res};function cIMCSCH(){}cIMCSCH.prototype=Object.create(cBaseFunction.prototype); cIMCSCH.prototype.constructor=cIMCSCH;cIMCSCH.prototype.name="IMCSCH";cIMCSCH.prototype.argumentsMin=1;cIMCSCH.prototype.argumentsMax=1;cIMCSCH.prototype.isXLFN=true;cIMCSCH.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMCSCH.prototype.argumentsType=[argType.any];cIMCSCH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0.value=== true||arg0.value===false)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;if(0==arg0.value)return new cError(cErrorType.not_numeric);var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Csch();var res=new cString(c.toString());res.numFormat=0;return res};function cIMDIV(){}cIMDIV.prototype=Object.create(cBaseFunction.prototype);cIMDIV.prototype.constructor=cIMDIV;cIMDIV.prototype.name="IMDIV";cIMDIV.prototype.argumentsMin=2; cIMDIV.prototype.argumentsMax=2;cIMDIV.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMDIV.prototype.argumentsType=[argType.any,argType.any];cIMDIV.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1= arg1.getElementRowCol(0,0);arg0=arg0.tocString();arg1=arg1.tocString();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var c1=new Complex(arg0.toString()),c2=new Complex(arg1.toString()),c3;if(c1 instanceof cError||c2 instanceof cError)return new cError(cErrorType.not_numeric);c3=c1.Div(c2);var res=new cString(c3.toString());res.numFormat=0;return res};function cIMEXP(){}cIMEXP.prototype=Object.create(cBaseFunction.prototype);cIMEXP.prototype.constructor=cIMEXP;cIMEXP.prototype.name= "IMEXP";cIMEXP.prototype.argumentsMin=1;cIMEXP.prototype.argumentsMax=1;cIMEXP.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMEXP.prototype.argumentsType=[argType.any];cIMEXP.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Exp();var res=new cString(c.toString());res.numFormat=0;return res};function cIMLN(){}cIMLN.prototype=Object.create(cBaseFunction.prototype);cIMLN.prototype.constructor=cIMLN;cIMLN.prototype.name="IMLN";cIMLN.prototype.argumentsMin=1;cIMLN.prototype.argumentsMax=1;cIMLN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMLN.prototype.argumentsType=[argType.any];cIMLN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;var r=c.Ln();if(r instanceof cError)return r;var res=new cString(c.toString());res.numFormat=0;return res};function cIMLOG10(){}cIMLOG10.prototype=Object.create(cBaseFunction.prototype);cIMLOG10.prototype.constructor=cIMLOG10;cIMLOG10.prototype.name="IMLOG10";cIMLOG10.prototype.argumentsMin= 1;cIMLOG10.prototype.argumentsMax=1;cIMLOG10.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMLOG10.prototype.argumentsType=[argType.any];cIMLOG10.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;var r= c.Log10();if(r instanceof cError)return r;var res=new cString(c.toString());res.numFormat=0;return res};function cIMLOG2(){}cIMLOG2.prototype=Object.create(cBaseFunction.prototype);cIMLOG2.prototype.constructor=cIMLOG2;cIMLOG2.prototype.name="IMLOG2";cIMLOG2.prototype.argumentsMin=1;cIMLOG2.prototype.argumentsMax=1;cIMLOG2.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMLOG2.prototype.argumentsType=[argType.any];cIMLOG2.prototype.Calculate=function(arg){var arg0= arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;var r=c.Log2();if(r instanceof cError)return r;var res=new cString(c.toString());res.numFormat=0;return res};function cIMPOWER(){}cIMPOWER.prototype=Object.create(cBaseFunction.prototype);cIMPOWER.prototype.constructor=cIMPOWER; cIMPOWER.prototype.name="IMPOWER";cIMPOWER.prototype.argumentsMin=2;cIMPOWER.prototype.argumentsMax=2;cIMPOWER.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMPOWER.prototype.argumentsType=[argType.any,argType.any];cIMPOWER.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocString();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var c=new Complex(arg0.toString());if(c instanceof cError)return c;var res;if(c.Power(arg1.getValue()))res=new cString(c.toString());else res=new cError(cErrorType.not_numeric);res.numFormat=0;return res};function cIMPRODUCT(){}cIMPRODUCT.prototype=Object.create(cBaseFunction.prototype); cIMPRODUCT.prototype.constructor=cIMPRODUCT;cIMPRODUCT.prototype.name="IMPRODUCT";cIMPRODUCT.prototype.argumentsMin=1;cIMPRODUCT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cIMPRODUCT.prototype.argumentsType=[[argType.any]];cIMPRODUCT.prototype.Calculate=function(arg){var arg0=arg[0],t=this;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0; var c=new Complex(arg0.toString()),c1;if(c instanceof cError)return c;for(var i=1;i<arg.length;i++){var argI=arg[i];if(argI instanceof cArea||argI instanceof cArea3D){var argIArr=argI.getValue(),_arg;for(var j=0;j<argIArr.length;j++){_arg=argIArr[i].tocString();if(_arg instanceof cError)return _arg;c1=new Complex(_arg.toString());if(c1 instanceof cError)return c1;c.Product(c1)}continue}else if(argI instanceof cArray){argI.foreach(function(elem){var e=elem.tocString();if(e instanceof cError)return e; c1=new Complex(e.toString());if(c1 instanceof cError)return c1;c.Product(c1)});continue}argI=argI.tocString();if(argI instanceof cError)return argI;c1=new Complex(argI.toString());c.Product(c1)}var res;if(c instanceof cError)res=c;else res=new cString(c.toString());res.numFormat=0;return res};function cIMREAL(){}cIMREAL.prototype=Object.create(cBaseFunction.prototype);cIMREAL.prototype.constructor=cIMREAL;cIMREAL.prototype.name="IMREAL";cIMREAL.prototype.argumentsMin=1;cIMREAL.prototype.argumentsMax= 1;cIMREAL.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMREAL.prototype.argumentsType=[argType.any];cIMREAL.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;var res=new cNumber(c.real);res.numFormat= 0;return res};function cIMSEC(){}cIMSEC.prototype=Object.create(cBaseFunction.prototype);cIMSEC.prototype.constructor=cIMSEC;cIMSEC.prototype.name="IMSEC";cIMSEC.prototype.argumentsMin=1;cIMSEC.prototype.argumentsMax=1;cIMSEC.prototype.isXLFN=true;cIMSEC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMSEC.prototype.argumentsType=[argType.any];cIMSEC.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0.value===true||arg0.value===false)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Sec();var res=new cString(c.toString());res.numFormat=0;return res};function cIMSECH(){}cIMSECH.prototype=Object.create(cBaseFunction.prototype);cIMSECH.prototype.constructor=cIMSECH;cIMSECH.prototype.name="IMSECH";cIMSECH.prototype.argumentsMin= 1;cIMSECH.prototype.argumentsMax=1;cIMSECH.prototype.isXLFN=true;cIMSECH.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMSECH.prototype.argumentsType=[argType.any];cIMSECH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0.value===true||arg0.value===false)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString(); if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Sech();var res=new cString(c.toString());res.numFormat=0;return res};function cIMSIN(){}cIMSIN.prototype=Object.create(cBaseFunction.prototype);cIMSIN.prototype.constructor=cIMSIN;cIMSIN.prototype.name="IMSIN";cIMSIN.prototype.argumentsMin=1;cIMSIN.prototype.argumentsMax=1;cIMSIN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMSIN.prototype.argumentsType=[argType.any]; cIMSIN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0.value===true||arg0.value===false)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Sin();var res=new cString(c.toString());res.numFormat=0;return res};function cIMSINH(){} cIMSINH.prototype=Object.create(cBaseFunction.prototype);cIMSINH.prototype.constructor=cIMSINH;cIMSINH.prototype.name="IMSINH";cIMSINH.prototype.argumentsMin=1;cIMSINH.prototype.argumentsMax=1;cIMSINH.prototype.isXLFN=true;cIMSINH.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMSINH.prototype.argumentsType=[argType.any];cIMSINH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0.value===true||arg0.value===false)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Sinh();var res=new cString(c.toString());res.numFormat=0;return res};function cIMSQRT(){}cIMSQRT.prototype=Object.create(cBaseFunction.prototype);cIMSQRT.prototype.constructor=cIMSQRT;cIMSQRT.prototype.name="IMSQRT";cIMSQRT.prototype.argumentsMin= 1;cIMSQRT.prototype.argumentsMax=1;cIMSQRT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMSQRT.prototype.argumentsType=[argType.any];cIMSQRT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.SQRT(); var res=new cString(c.toString());res.numFormat=0;return res};function cIMSUB(){}cIMSUB.prototype=Object.create(cBaseFunction.prototype);cIMSUB.prototype.constructor=cIMSUB;cIMSUB.prototype.name="IMSUB";cIMSUB.prototype.argumentsMin=2;cIMSUB.prototype.argumentsMax=2;cIMSUB.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMSUB.prototype.argumentsType=[argType.any,argType.any];cIMSUB.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea|| arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocString();arg1=arg1.tocString();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var c1=new Complex(arg0.toString()),c2=new Complex(arg1.toString());if(c1 instanceof cError||c2 instanceof cError)return new cError(cErrorType.not_numeric); c1.Sub(c2);var res=new cString(c1.toString());res.numFormat=0;return res};function cIMSUM(){}cIMSUM.prototype=Object.create(cBaseFunction.prototype);cIMSUM.prototype.constructor=cIMSUM;cIMSUM.prototype.name="IMSUM";cIMSUM.prototype.argumentsMin=1;cIMSUM.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cIMSUM.prototype.argumentsType=[[argType.any]];cIMSUM.prototype.Calculate=function(arg){var arg0=arg[0],t=this;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var c=new Complex(arg0.toString()),c1;if(c instanceof cError)return c;for(var i=1;i<arg.length;i++){var argI=arg[i];if(argI instanceof cArea||argI instanceof cArea3D){var argIArr=argI.getValue(),_arg;for(var j=0;j<argIArr.length;j++){_arg=argIArr[i].tocString();if(_arg instanceof cError)return _arg;c1=new Complex(_arg.toString());if(c1 instanceof cError)return c1;c.Sum(c1)}continue}else if(argI instanceof cArray){argI.foreach(function(elem){var e=elem.tocString();if(e instanceof cError)return e;c1=new Complex(e.toString());if(c1 instanceof cError)return c1;c.Sum(c1)});continue}argI=argI.tocString();if(argI instanceof cError)return argI;c1=new Complex(argI.toString());c.Sum(c1)}var res;if(c instanceof cError)res=c;else res=new cString(c.toString());res.numFormat=0;return res};function cIMTAN(){}cIMTAN.prototype=Object.create(cBaseFunction.prototype);cIMTAN.prototype.constructor=cIMTAN;cIMTAN.prototype.name= "IMTAN";cIMTAN.prototype.argumentsMin=1;cIMTAN.prototype.argumentsMax=1;cIMTAN.prototype.isXLFN=true;cIMTAN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cIMTAN.prototype.argumentsType=[argType.any];cIMTAN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;if(arg0.value=== true||arg0.value===false)return new cError(cErrorType.wrong_value_type);var c=new Complex(arg0.toString());if(c instanceof cError)return c;c.Tan();var res=new cString(c.toString());res.numFormat=0;return res};function cOCT2BIN(){}cOCT2BIN.prototype=Object.create(cBaseFunction.prototype);cOCT2BIN.prototype.constructor=cOCT2BIN;cOCT2BIN.prototype.name="OCT2BIN";cOCT2BIN.prototype.argumentsMin=1;cOCT2BIN.prototype.argumentsMax=2;cOCT2BIN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cOCT2BIN.prototype.argumentsType=[argType.any,argType.any];cOCT2BIN.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type); arg0=arg0.getValue();if(arg0.length==0)arg0=0;if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1=arg1.getValue();var res;if(validOCTNumber(arg0)&&(arg1>0&&arg1<=10||arg1==undefined)){var negative=arg0.length===10&&arg0.substring(0,1).toUpperCase()==="7",arg0DEC=negative?parseInt(arg0,NumberBase.OCT)-1073741824:parseInt(arg0,NumberBase.OCT);if(arg0DEC<-512||arg0DEC>511)res=new cError(cErrorType.not_numeric);else if(negative){var str= (512+arg0DEC).toString(NumberBase.BIN);res=new cString(("1"+"0".repeat(9-str.length)+str).toUpperCase())}else res=convertFromTo(arg0DEC,NumberBase.DEC,NumberBase.BIN,arg1)}else res=new cError(cErrorType.not_numeric);return res};function cOCT2DEC(){}cOCT2DEC.prototype=Object.create(cBaseFunction.prototype);cOCT2DEC.prototype.constructor=cOCT2DEC;cOCT2DEC.prototype.name="OCT2DEC";cOCT2DEC.prototype.argumentsMin=1;cOCT2DEC.prototype.argumentsMax=1;cOCT2DEC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cOCT2DEC.prototype.argumentsType=[argType.any];cOCT2DEC.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;arg0=arg0.getValue();if(arg0.length==0)arg0=0;var res;if(validOCTNumber(arg0)){arg0=parseInt(arg0,NumberBase.OCT);res=new cNumber(arg0>=536870912?arg0-1073741824:arg0)}else res=new cError(cErrorType.not_numeric); return res};function cOCT2HEX(){}cOCT2HEX.prototype=Object.create(cBaseFunction.prototype);cOCT2HEX.prototype.constructor=cOCT2HEX;cOCT2HEX.prototype.name="OCT2HEX";cOCT2HEX.prototype.argumentsMin=1;cOCT2HEX.prototype.argumentsMax=2;cOCT2HEX.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cOCT2HEX.prototype.argumentsType=[argType.any,argType.any];cOCT2HEX.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cUndefined;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type);arg0=arg0.getValue();if(arg0.length==0)arg0=0;if(!(arg1 instanceof cUndefined)){arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.wrong_value_type)}arg1= arg1.getValue();var res;if(validHEXNumber(arg0)&&(arg1>0&&arg1<=10||arg1==undefined)){arg0=parseInt(arg0,NumberBase.OCT);if(arg0>=536870912)res=new cString(("ff"+(arg0+3221225472).toString(NumberBase.HEX)).toUpperCase());else res=convertFromTo(arg0,NumberBase.DEC,NumberBase.HEX,arg1)}else res=new cError(cErrorType.not_numeric);return res}})(window);"use strict";(function(window,undefined){var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup; var argType=Asc.c_oAscFormulaArgumentType;cFormulaFunctionGroup["Cube"]=cFormulaFunctionGroup["Cube"]||[];cFormulaFunctionGroup["Cube"].push(cCUBEKPIMEMBER,cCUBEMEMBER,cCUBEMEMBERPROPERTY,cCUBERANKEDMEMBER,cCUBESET,cCUBESETCOUNT,cCUBEVALUE);cFormulaFunctionGroup["NotRealised"]=cFormulaFunctionGroup["NotRealised"]||[];cFormulaFunctionGroup["NotRealised"].push(cCUBEKPIMEMBER,cCUBEMEMBER,cCUBEMEMBERPROPERTY,cCUBERANKEDMEMBER,cCUBESET,cCUBESETCOUNT,cCUBEVALUE);function cCUBEKPIMEMBER(){}cCUBEKPIMEMBER.prototype= Object.create(cBaseFunction.prototype);cCUBEKPIMEMBER.prototype.constructor=cCUBEKPIMEMBER;cCUBEKPIMEMBER.prototype.name="CUBEKPIMEMBER";cCUBEKPIMEMBER.prototype.argumentsType=[argType.text,argType.text,argType.number,argType.text];function cCUBEMEMBER(){}cCUBEMEMBER.prototype=Object.create(cBaseFunction.prototype);cCUBEMEMBER.prototype.constructor=cCUBEMEMBER;cCUBEMEMBER.prototype.name="CUBEMEMBER";cCUBEMEMBER.prototype.argumentsType=[argType.text,argType.text,argType.text];function cCUBEMEMBERPROPERTY(){} cCUBEMEMBERPROPERTY.prototype=Object.create(cBaseFunction.prototype);cCUBEMEMBERPROPERTY.prototype.constructor=cCUBEMEMBERPROPERTY;cCUBEMEMBERPROPERTY.prototype.name="CUBEMEMBERPROPERTY";cCUBEMEMBERPROPERTY.prototype.argumentsType=[argType.text,argType.text,argType.text];function cCUBERANKEDMEMBER(){}cCUBERANKEDMEMBER.prototype=Object.create(cBaseFunction.prototype);cCUBERANKEDMEMBER.prototype.constructor=cCUBERANKEDMEMBER;cCUBERANKEDMEMBER.prototype.name="CUBERANKEDMEMBER";cCUBERANKEDMEMBER.prototype.argumentsType= [argType.text,argType.text,argType.number,argType.text];function cCUBESET(){}cCUBESET.prototype=Object.create(cBaseFunction.prototype);cCUBESET.prototype.constructor=cCUBESET;cCUBESET.prototype.name="CUBESET";cCUBESET.prototype.argumentsType=[argType.text,argType.text,argType.text,argType.number,argType.text];function cCUBESETCOUNT(){}cCUBESETCOUNT.prototype=Object.create(cBaseFunction.prototype);cCUBESETCOUNT.prototype.constructor=cCUBESETCOUNT;cCUBESETCOUNT.prototype.name="CUBESETCOUNT";cCUBESETCOUNT.prototype.argumentsType= [argType.text];function cCUBEVALUE(){}cCUBEVALUE.prototype=Object.create(cBaseFunction.prototype);cCUBEVALUE.prototype.constructor=cCUBEVALUE;cCUBEVALUE.prototype.name="CUBEVALUE";cCUBEVALUE.prototype.argumentsType=[argType.text,[argType.text]]})(window);"use strict";(function(window,undefined){var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var cElementType=AscCommonExcel.cElementType;var cErrorType=AscCommonExcel.cErrorType;var cNumber= AscCommonExcel.cNumber;var cError=AscCommonExcel.cError;var argType=Asc.c_oAscFormulaArgumentType;function StatisticOnlineAlgorithm(){this.reset()}StatisticOnlineAlgorithm.prototype.reset=function(){this.count=0;this.countNums=0;this.min=Number.POSITIVE_INFINITY;this.max=Number.NEGATIVE_INFINITY;this.sum=0;this.product=1;this.mean=0;this.M2=0;this.errorType=null};StatisticOnlineAlgorithm.prototype.union=function(val){this.min=Math.min(this.min,val.min);this.max=Math.max(this.max,val.max);this.sum= this.sum+val.sum;this.product=this.product*val.product;var delta=val.mean-this.mean;if(this.countNums+val.countNums>0){this.mean=this.mean+delta*val.countNums/(this.countNums+val.countNums);this.M2=this.M2+val.M2+delta*delta*this.countNums*val.countNums/(this.countNums+val.countNums)}this.count=this.count+val.count;this.countNums=this.countNums+val.countNums;this.errorType=this.errorType||val.errorType};StatisticOnlineAlgorithm.prototype.add=function(val){this.count++;this.countNums++;this.min=Math.min(this.min, val);this.max=Math.max(this.max,val);this.sum+=val;this.product*=val;var delta=val-this.mean;this.mean+=delta/this.countNums;this.M2+=delta*(val-this.mean)};StatisticOnlineAlgorithm.prototype.addCount=function(){this.count++};StatisticOnlineAlgorithm.prototype.addError=function(errorType){this.errorType=errorType};StatisticOnlineAlgorithm.prototype.getCount=function(){return this.count};StatisticOnlineAlgorithm.prototype.getCountNums=function(){return this.countNums};StatisticOnlineAlgorithm.prototype.getMin= function(){return this.min};StatisticOnlineAlgorithm.prototype.getMax=function(){return this.max};StatisticOnlineAlgorithm.prototype.getSum=function(){return this.sum};StatisticOnlineAlgorithm.prototype.getMean=function(){return this.mean};StatisticOnlineAlgorithm.prototype.getProduct=function(){return this.countNums>0?this.product:0};StatisticOnlineAlgorithm.prototype.getVar=function(){return this.countNums>1?this.M2/(this.countNums-1):0};StatisticOnlineAlgorithm.prototype.getVarP=function(){return this.countNums> 0?this.M2/this.countNums:0};StatisticOnlineAlgorithm.prototype.getStdDev=function(){return Math.sqrt(this.getVar())};StatisticOnlineAlgorithm.prototype.getStdDevP=function(){return Math.sqrt(this.getVarP())};StatisticOnlineAlgorithm.prototype.isEmpty=function(){return 0===this.count&&0===this.countNums};StatisticOnlineAlgorithm.prototype.getCellValue=function(dataType,fieldType,rowType,colType){var oCellValue;if(this.isEmpty())return oCellValue;oCellValue=new AscCommonExcel.CCellValue;oCellValue.type= AscCommon.CellValueType.Number;if(null!==this.errorType){oCellValue.type=AscCommon.CellValueType.Error;oCellValue.text=AscCommonExcel.cError.prototype.getStringFromErrorType(this.errorType);return oCellValue}var type=dataType;if(Asc.c_oAscItemType.Default!==fieldType&&Asc.c_oAscItemType.Data!==fieldType&&Asc.c_oAscItemType.Blank!==fieldType&&Asc.c_oAscItemType.Grand!==fieldType)type=fieldType;if(Asc.c_oAscItemType.Default!==rowType&&Asc.c_oAscItemType.Data!==rowType&&Asc.c_oAscItemType.Blank!==rowType&& Asc.c_oAscItemType.Grand!==rowType){type=rowType;if(Asc.c_oAscItemType.Default!==colType&&Asc.c_oAscItemType.Data!==colType&&Asc.c_oAscItemType.Blank!==colType&&Asc.c_oAscItemType.Grand!==colType)if(rowType!==colType)type=Asc.c_oAscItemType.Blank}switch(type){case Asc.c_oAscItemType.Count:oCellValue.number=this.getCountNums();break;case Asc.c_oAscItemType.CountA:oCellValue.number=this.getCount();break;case Asc.c_oAscItemType.Max:oCellValue.number=this.countNums>0?this.getMax():0;break;case Asc.c_oAscItemType.Min:oCellValue.number= this.countNums>0?this.getMin():0;break;case Asc.c_oAscItemType.Product:oCellValue.number=this.getProduct();break;case Asc.c_oAscItemType.Avg:if(this.countNums>0)oCellValue.number=this.getMean();else{oCellValue.type=AscCommon.CellValueType.Error;oCellValue.text=AscCommonExcel.cError.prototype.getStringFromErrorType(cErrorType.division_by_zero)}break;case Asc.c_oAscItemType.StdDev:if(this.countNums>1)oCellValue.number=this.getStdDev();else{oCellValue.type=AscCommon.CellValueType.Error;oCellValue.text= AscCommonExcel.cError.prototype.getStringFromErrorType(cErrorType.division_by_zero)}break;case Asc.c_oAscItemType.StdDevP:if(this.countNums>0)oCellValue.number=this.getStdDevP();else{oCellValue.type=AscCommon.CellValueType.Error;oCellValue.text=AscCommonExcel.cError.prototype.getStringFromErrorType(cErrorType.division_by_zero)}break;case Asc.c_oAscItemType.Var:if(this.countNums>1)oCellValue.number=this.getVar();else{oCellValue.type=AscCommon.CellValueType.Error;oCellValue.text=AscCommonExcel.cError.prototype.getStringFromErrorType(cErrorType.division_by_zero)}break; case Asc.c_oAscItemType.VarP:if(this.countNums>0)oCellValue.number=this.getVarP();else{oCellValue.type=AscCommon.CellValueType.Error;oCellValue.text=AscCommonExcel.cError.prototype.getStringFromErrorType(cErrorType.division_by_zero)}break;case Asc.c_oAscItemType.Blank:oCellValue=undefined;break;default:oCellValue.number=this.getSum()}return oCellValue};function checkValueByCondition(condition,val){var res=false;condition=condition.tocString();if(cElementType.error===condition.type)return false;if(""=== condition.value)res=true;else{var conditionObj=AscCommonExcel.matchingValue(condition);if(null===conditionObj.op&&cElementType.string===conditionObj.val.type)conditionObj.val.value+="*";res=AscCommonExcel.matching(val,conditionObj)}return res}function convertDatabase(dataBase,bIsCondition){var arr=[];var map={};for(var i=0;i<dataBase.length;i++)for(var j=0;j<dataBase[0].length;j++){var header=dataBase[0][j].getValue();if(bIsCondition)if(0===i){arr[j]=header;if(map.hasOwnProperty(header))continue; else map[header]=[]}else map[header].push(dataBase[i][j]);else if(0===i)if(map.hasOwnProperty(header))continue;else{map[header]=[];arr[j]=header}else if(!map[header][i-1])map[header][i-1]=dataBase[i][j]}return{arr:arr,map:map}}function getNeedValuesFromDataBase(dataBase,field,conditionData,bIsGetObjArray,doNotCheckEmptyField){var databaseObj=convertDatabase(dataBase);var headersArr=databaseObj.arr,headersDataMap=databaseObj.map;databaseObj=convertDatabase(conditionData,true);var headersConditionArr= databaseObj.arr,headersConditionMap=databaseObj.map;if(cElementType.cell===field.type||cElementType.cell3D===field.type)field=field.getValue();if(!doNotCheckEmptyField&&cElementType.empty===field.type)return new cError(cErrorType.wrong_value_type);var isNumberField=field.tocNumber();var isEmptyField=cElementType.empty===field.type;if(cElementType.error===isNumberField.type)field=field.getValue();else{var number=isNumberField.getValue();if(headersArr[number-1])field=headersArr[number-1];else field= null}if(!isEmptyField&&null===field)return new cError(cErrorType.wrong_value_type);var previousWinArray;var winElems=[];for(var i=1;i<conditionData.length;i++){previousWinArray=null;for(var j=0;j<conditionData[0].length;j++){var condition=conditionData[i][j];var header=headersConditionArr[j];var databaseData=headersDataMap[header];if(!databaseData)continue;var winColumnArray=[];for(var n=0;n<databaseData.length;n++)if(previousWinArray&&previousWinArray[n]){if(checkValueByCondition(condition,databaseData[n]))winColumnArray[n]= true}else if(!previousWinArray&&checkValueByCondition(condition,databaseData[n]))winColumnArray[n]=true;previousWinArray=winColumnArray}winElems[i-1]=previousWinArray}var resArr=[];var usuallyAddElems=[];var needDataColumn;if(isEmptyField&&headersConditionArr&&headersConditionArr[0])needDataColumn=headersDataMap[headersConditionArr[0]];else needDataColumn=headersDataMap[field];if(!needDataColumn)return new cError(cErrorType.wrong_value_type);for(var i=0;i<winElems.length;i++)for(var j in winElems[i])if(winElems[i].hasOwnProperty(j)){if(true=== usuallyAddElems[j]||cElementType.empty===needDataColumn[j].type)continue;if(bIsGetObjArray)resArr.push(needDataColumn[j]);else resArr.push(needDataColumn[j].getValue());usuallyAddElems[j]=true}return resArr.length?resArr:new cError(cErrorType.division_by_zero)}cFormulaFunctionGroup["Database"]=cFormulaFunctionGroup["Database"]||[];cFormulaFunctionGroup["Database"].push(cDAVERAGE,cDCOUNT,cDCOUNTA,cDGET,cDMAX,cDMIN,cDPRODUCT,cDSTDEV,cDSTDEVP,cDSUM,cDVAR,cDVARP);function cDAVERAGE(){}cDAVERAGE.prototype= Object.create(cBaseFunction.prototype);cDAVERAGE.prototype.constructor=cDAVERAGE;cDAVERAGE.prototype.name="DAVERAGE";cDAVERAGE.prototype.argumentsMin=3;cDAVERAGE.prototype.argumentsMax=3;cDAVERAGE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDAVERAGE.prototype.arrayIndexes={0:1,2:1};cDAVERAGE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDAVERAGE.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDAVERAGE.prototype.Calculate=function(arg){var oArguments= this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2]);if(cElementType.error===resArr.type)return resArr;var summ=0;var count=0;for(var i=0;i<resArr.length;i++){var val=parseFloat(resArr[i]);if(!isNaN(val)){summ+=val;count++}}if(0===count)return new cError(cErrorType.division_by_zero);var res= new cNumber(summ/count);return cElementType.error===res.type?new cNumber(0):res};function cDCOUNT(){}cDCOUNT.prototype=Object.create(cBaseFunction.prototype);cDCOUNT.prototype.constructor=cDCOUNT;cDCOUNT.prototype.name="DCOUNT";cDCOUNT.prototype.argumentsMin=3;cDCOUNT.prototype.argumentsMax=3;cDCOUNT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDCOUNT.prototype.arrayIndexes={0:1,2:1};cDCOUNT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDCOUNT.prototype.argumentsType= [argType.reference,argType.number,argType.text];cDCOUNT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2],null,true);if(cElementType.error===resArr.type)return resArr;var isEmptyField=cElementType.empty===argClone[1].type;var count=0;for(var i= 0;i<resArr.length;i++)if(isEmptyField)count++;else{var val=parseFloat(resArr[i]);if(!isNaN(val))count++}return new cNumber(count)};function cDCOUNTA(){}cDCOUNTA.prototype=Object.create(cBaseFunction.prototype);cDCOUNTA.prototype.constructor=cDCOUNTA;cDCOUNTA.prototype.name="DCOUNTA";cDCOUNTA.prototype.argumentsMin=3;cDCOUNTA.prototype.argumentsMax=3;cDCOUNTA.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDCOUNTA.prototype.arrayIndexes={0:1,2:1};cDCOUNTA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cDCOUNTA.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDCOUNTA.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2],true,true);if(cElementType.error===resArr.type)return resArr;var count=0;for(var i=0;i<resArr.length;i++)if(cElementType.empty!== resArr[i].type)count++;return new cNumber(count)};function cDGET(){}cDGET.prototype=Object.create(cBaseFunction.prototype);cDGET.prototype.constructor=cDGET;cDGET.prototype.name="DGET";cDGET.prototype.argumentsMin=3;cDGET.prototype.argumentsMax=3;cDGET.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDGET.prototype.arrayIndexes={0:1,2:1};cDGET.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDGET.prototype.argumentsType=[argType.reference,argType.number,argType.text]; cDGET.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2]);if(cElementType.error===resArr.type)return resArr;if(1!==resArr.length)return new cError(cErrorType.not_numeric);var res=new cNumber(resArr[0]);return cElementType.error===res.type? new cNumber(0):res};function cDMAX(){}cDMAX.prototype=Object.create(cBaseFunction.prototype);cDMAX.prototype.constructor=cDMAX;cDMAX.prototype.name="DMAX";cDMAX.prototype.argumentsMin=3;cDMAX.prototype.argumentsMax=3;cDMAX.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDMAX.prototype.arrayIndexes={0:1,2:1};cDMAX.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDMAX.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDMAX.prototype.Calculate= function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2]);if(cElementType.error===resArr.type)return resArr;resArr.sort(function(a,b){return b-a});var res=new cNumber(resArr[0]);return cElementType.error===res.type?new cNumber(0):res};function cDMIN(){}cDMIN.prototype= Object.create(cBaseFunction.prototype);cDMIN.prototype.constructor=cDMIN;cDMIN.prototype.name="DMIN";cDMIN.prototype.argumentsMin=3;cDMIN.prototype.argumentsMax=3;cDMIN.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDMIN.prototype.arrayIndexes={0:1,2:1};cDMIN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDMIN.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDMIN.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg, arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2]);if(cElementType.error===resArr.type)return resArr;resArr.sort(function(a,b){return a-b});var res=new cNumber(resArr[0]);return cElementType.error===res.type?new cNumber(0):res};function cDPRODUCT(){}cDPRODUCT.prototype=Object.create(cBaseFunction.prototype);cDPRODUCT.prototype.constructor= cDPRODUCT;cDPRODUCT.prototype.name="DPRODUCT";cDPRODUCT.prototype.argumentsMin=3;cDPRODUCT.prototype.argumentsMax=3;cDPRODUCT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDPRODUCT.prototype.arrayIndexes={0:1,2:1};cDPRODUCT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDPRODUCT.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDPRODUCT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array, null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2]);if(cElementType.error===resArr.type)return resArr;var res=0;for(var i=0;i<resArr.length;i++){var val=parseFloat(resArr[i]);if(!isNaN(val))if(0===res)res=val;else res*=val}res=new cNumber(res);return cElementType.error===res.type?new cNumber(0):res};function cDSTDEV(){}cDSTDEV.prototype=Object.create(cBaseFunction.prototype); cDSTDEV.prototype.constructor=cDSTDEV;cDSTDEV.prototype.name="DSTDEV";cDSTDEV.prototype.argumentsMin=3;cDSTDEV.prototype.argumentsMax=3;cDSTDEV.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDSTDEV.prototype.arrayIndexes={0:1,2:1};cDSTDEV.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDSTDEV.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDSTDEV.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true, [cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2]);if(cElementType.error===resArr.type)return resArr;var sum=0;var count=0;var member=[];for(var i=0;i<resArr.length;i++){var val=parseFloat(resArr[i]);if(!isNaN(val)){member[count]=val;sum+=val;count++}}if(0===count)return new cError(cErrorType.division_by_zero);var average=sum/count, res=0,av;for(i=0;i<member.length;i++){av=member[i]-average;res+=av*av}return new cNumber(Math.sqrt(res/(count-1)))};function cDSTDEVP(){}cDSTDEVP.prototype=Object.create(cBaseFunction.prototype);cDSTDEVP.prototype.constructor=cDSTDEVP;cDSTDEVP.prototype.name="DSTDEVP";cDSTDEVP.prototype.argumentsMin=3;cDSTDEVP.prototype.argumentsMax=3;cDSTDEVP.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDSTDEVP.prototype.arrayIndexes={0:1,2:1};cDSTDEVP.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cDSTDEVP.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDSTDEVP.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2],true);if(cElementType.error===resArr.type)return resArr;function _var(x){var i,tA=[],sumSQRDeltaX= 0,_x=0,xLength=0;for(i=0;i<x.length;i++)if(cElementType.number===x[i].type){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(cElementType.error===x[i].type)return x[i];_x/=xLength;for(i=0;i<tA.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(isNaN(_x)?new cError(cErrorType.division_by_zero):Math.sqrt(sumSQRDeltaX/xLength))}return _var(resArr)};function cDSUM(){}cDSUM.prototype=Object.create(cBaseFunction.prototype);cDSUM.prototype.constructor=cDSUM;cDSUM.prototype.name= "DSUM";cDSUM.prototype.argumentsMin=3;cDSUM.prototype.argumentsMax=3;cDSUM.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDSUM.prototype.arrayIndexes={0:1,2:1};cDSUM.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDSUM.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDSUM.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args; var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2]);if(cElementType.error===resArr.type)return resArr;var summ=0;for(var i=0;i<resArr.length;i++){var val=parseFloat(resArr[i]);if(!isNaN(val))summ+=val}var res=new cNumber(summ);return cElementType.error===res.type?new cNumber(0):res};function cDVAR(){}cDVAR.prototype=Object.create(cBaseFunction.prototype);cDVAR.prototype.constructor=cDVAR;cDVAR.prototype.name= "DVAR";cDVAR.prototype.argumentsMin=3;cDVAR.prototype.argumentsMax=3;cDVAR.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDVAR.prototype.arrayIndexes={0:1,2:1};cDVAR.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDVAR.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDVAR.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args; var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2],true);if(cElementType.error===resArr.type)return resArr;function _var(x){if(x.length<1)return new cError(cErrorType.division_by_zero);var i,tA=[],sumSQRDeltaX=0,_x=0,xLength=0;for(i=0;i<x.length;i++)if(cElementType.number===x[i].type){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(cElementType.error===x[i].type)return x[i];_x/=xLength;for(i= 0;i<x.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(sumSQRDeltaX/(xLength-1))}var res=_var(resArr);return res};function cDVARP(){}cDVARP.prototype=Object.create(cBaseFunction.prototype);cDVARP.prototype.constructor=cDVARP;cDVARP.prototype.name="DVARP";cDVARP.prototype.argumentsMin=3;cDVARP.prototype.argumentsMax=3;cDVARP.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDVARP.prototype.arrayIndexes={0:1,2:1};cDVARP.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cDVARP.prototype.argumentsType=[argType.reference,argType.number,argType.text];cDVARP.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,null,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var resArr=getNeedValuesFromDataBase(argClone[0],argClone[1],argClone[2],true);if(cElementType.error===resArr.type)return resArr;function _var(x){if(x.length<1)return new cError(cErrorType.division_by_zero); var tA=[],sumSQRDeltaX=0,_x=0,xLength=0,i;for(i=0;i<x.length;i++)if(cElementType.number===x[i].type){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(cElementType.error===x[i].type)return x[i];_x/=xLength;for(i=0;i<x.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(sumSQRDeltaX/xLength)}var res=_var(resArr);return res};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].StatisticOnlineAlgorithm=StatisticOnlineAlgorithm})(window);"use strict"; (function(window,undefined){var cElementType=AscCommonExcel.cElementType;var CellValueType=AscCommon.CellValueType;var g_oFormatParser=AscCommon.g_oFormatParser;var oNumFormatCache=AscCommon.oNumFormatCache;var CellFormat=AscCommon.CellFormat;var cErrorType=AscCommonExcel.cErrorType;var cNumber=AscCommonExcel.cNumber;var cString=AscCommonExcel.cString;var cBool=AscCommonExcel.cBool;var cError=AscCommonExcel.cError;var cArea=AscCommonExcel.cArea;var cArea3D=AscCommonExcel.cArea3D;var cRef=AscCommonExcel.cRef; var cRef3D=AscCommonExcel.cRef3D;var cArray=AscCommonExcel.cArray;var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var argType=Asc.c_oAscFormulaArgumentType;cFormulaFunctionGroup["TextAndData"]=cFormulaFunctionGroup["TextAndData"]||[];cFormulaFunctionGroup["TextAndData"].push(cASC,cBAHTTEXT,cCHAR,cCLEAN,cCODE,cCONCATENATE,cCONCAT,cDOLLAR,cEXACT,cFIND,cFINDB,cFIXED,cJIS,cLEFT,cLEFTB,cLEN,cLENB,cLOWER,cMID,cMIDB,cNUMBERVALUE,cPHONETIC,cPROPER, cREPLACE,cREPLACEB,cREPT,cRIGHT,cRIGHTB,cSEARCH,cSEARCHB,cSUBSTITUTE,cT,cTEXT,cTEXTJOIN,cTRIM,cUNICHAR,cUNICODE,cUPPER,cVALUE);cFormulaFunctionGroup["NotRealised"]=cFormulaFunctionGroup["NotRealised"]||[];cFormulaFunctionGroup["NotRealised"].push(cBAHTTEXT,cJIS,cPHONETIC);function cASC(){}cASC.prototype=Object.create(cBaseFunction.prototype);cASC.prototype.constructor=cASC;cASC.prototype.name="ASC";cASC.prototype.argumentsMin=1;cASC.prototype.argumentsMax=1;cASC.prototype.Calculate=function(arg){var arg0= arg[0];var calcAsc=function(str){var res="";var fullWidthFrom=65280;var fullWidthTo=65519;for(var i=0;i<str.length;i++){var nCh=str[i].charCodeAt(0);if(nCh>=fullWidthFrom&&nCh<=fullWidthTo)nCh=255&nCh+32;res+=String.fromCharCode(nCh)}return new cString(res)};if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();else if(arg0 instanceof cArray){var ret=new cArray;arg0.foreach(function(elem,r,c){if(!ret.array[r])ret.addRow(); if(elem instanceof cError)ret.addElement(elem);else ret.addElement(calcAsc(elem.toLocaleString()))});return ret}if(arg0 instanceof cError)return arg0;return calcAsc(arg0.toLocaleString())};function cBAHTTEXT(){}cBAHTTEXT.prototype=Object.create(cBaseFunction.prototype);cBAHTTEXT.prototype.constructor=cBAHTTEXT;cBAHTTEXT.prototype.name="BAHTTEXT";cBAHTTEXT.prototype.argumentsType=[argType.number];function cCHAR(){}cCHAR.prototype=Object.create(cBaseFunction.prototype);cCHAR.prototype.constructor=cCHAR; cCHAR.prototype.name="CHAR";cCHAR.prototype.argumentsMin=1;cCHAR.prototype.argumentsMax=1;cCHAR.prototype.argumentsType=[argType.number];cCHAR.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocNumber();else if(arg0 instanceof cArray){var ret=new cArray;arg0.foreach(function(elem,r,c){var _elem=elem.tocNumber();if(!ret.array[r])ret.addRow();if(_elem instanceof cError)ret.addElement(_elem);else ret.addElement(new cString(String.fromCharCode(_elem.getValue())))}); return ret}arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;return new cString(String.fromCharCode(arg0.getValue()))};function cCLEAN(){}cCLEAN.prototype=Object.create(cBaseFunction.prototype);cCLEAN.prototype.constructor=cCLEAN;cCLEAN.prototype.name="CLEAN";cCLEAN.prototype.argumentsMin=1;cCLEAN.prototype.argumentsMax=1;cCLEAN.prototype.argumentsType=[argType.text];cCLEAN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;var v=arg0.toLocaleString(),l=v.length,res="";for(var i=0;i<l;i++)if(v.charCodeAt(i)>31)res+=v[i];return new cString(res)};function cCODE(){}cCODE.prototype=Object.create(cBaseFunction.prototype);cCODE.prototype.constructor=cCODE;cCODE.prototype.name="CODE";cCODE.prototype.argumentsMin=1;cCODE.prototype.argumentsMax=1;cCODE.prototype.argumentsType= [argType.text];cCODE.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();else if(arg0 instanceof cArray){var ret=new cArray;arg0.foreach(function(elem,r,c){if(!ret.array[r])ret.addRow();if(elem instanceof cError)ret.addElement(elem);else ret.addElement(new cNumber(elem.toLocaleString().charCodeAt()))});return ret}if(arg0 instanceof cError)return arg0; return new cNumber(arg0.toLocaleString().charCodeAt())};function cCONCATENATE(){}cCONCATENATE.prototype=Object.create(cBaseFunction.prototype);cCONCATENATE.prototype.constructor=cCONCATENATE;cCONCATENATE.prototype.name="CONCATENATE";cCONCATENATE.prototype.argumentsMin=1;cCONCATENATE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCONCATENATE.prototype.argumentsType=[[argType.text]];cCONCATENATE.prototype.Calculate=function(arg){var arg0=new cString(""),argI;for(var i=0;i<arg.length;i++){argI=arg[i]; if(argI instanceof cArea||argI instanceof cArea3D)argI=argI.cross(arguments[1]);else if(argI instanceof cRef||argI instanceof cRef3D)argI=argI.getValue();if(argI instanceof cError)return argI;else if(argI instanceof cArray){argI.foreach(function(elem){if(elem instanceof cError){arg0=elem;return true}arg0=new cString(arg0.toString().concat(elem.toLocaleString()))});if(arg0 instanceof cError)return arg0}else arg0=new cString(arg0.toString().concat(argI.toLocaleString()))}return arg0};function cCONCAT(){} cCONCAT.prototype=Object.create(cBaseFunction.prototype);cCONCAT.prototype.constructor=cCONCAT;cCONCAT.prototype.name="CONCAT";cCONCAT.prototype.argumentsMin=1;cCONCAT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCONCAT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cCONCAT.prototype.argumentsType=[[argType.text]];cCONCAT.prototype.Calculate=function(arg){var arg0=new cString(""),argI;for(var i=0;i<arg.length;i++){argI=arg[i];if(cElementType.cellsRange===argI.type||cElementType.cellsRange3D=== argI.type){var _arrVal=argI.getValue(this.checkExclude,this.excludeHiddenRows);for(var j=0;j<_arrVal.length;j++){var _arrElem=_arrVal[j].toLocaleString();if(cElementType.error===_arrElem.type)return _arrVal[j];else arg0=new cString(arg0.toString().concat(_arrElem))}}else if(cElementType.cell===argI.type||cElementType.cell3D===argI.type){argI=argI.getValue();if(cElementType.error===argI.type)return argI;arg0=new cString(arg0.toString().concat(argI.toLocaleString()))}else if(cElementType.error===argI.type)return argI; else if(cElementType.array===argI.type){argI.foreach(function(elem){if(cElementType.error===elem.type){arg0=elem;return true}arg0=new cString(arg0.toString().concat(elem.toLocaleString()))});if(cElementType.error===arg0.type)return arg0}else arg0=new cString(arg0.toString().concat(argI.toLocaleString()))}return arg0};function cDOLLAR(){}cDOLLAR.prototype=Object.create(cBaseFunction.prototype);cDOLLAR.prototype.constructor=cDOLLAR;cDOLLAR.prototype.name="DOLLAR";cDOLLAR.prototype.argumentsMin=1;cDOLLAR.prototype.argumentsMax= 2;cDOLLAR.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDOLLAR.prototype.argumentsType=[argType.number,argType.number];cDOLLAR.prototype.Calculate=function(arg){function SignZeroPositive(number){return number<0?-1:1}function truncate(n){return Math[n>0?"floor":"ceil"](n)}function Floor(number,significance){var quotient=number/significance;if(quotient==0)return 0;var nolpiat=5*Math.sign(quotient)*Math.pow(10,Math.floor(Math.log10(Math.abs(quotient)))-AscCommonExcel.cExcelSignificantDigits);return truncate(quotient+ nolpiat)*significance}function roundHelper(number,num_digits){if(num_digits>AscCommonExcel.cExcelMaxExponent){if(Math.abs(number)<1||num_digits<1E10)return new cNumber(number);return new cNumber(0)}else if(num_digits<AscCommonExcel.cExcelMinExponent){if(Math.abs(number)<.01)return new cNumber(number);return new cNumber(0)}var significance=SignZeroPositive(number)*Math.pow(10,-truncate(num_digits));number+=significance/2;if(number/significance==Infinity)return new cNumber(number);return new cNumber(Floor(number, significance))}function toFix(str,skip){var res,_int,_dec,_tmp="";if(skip)return str;res=str.split(".");_int=res[0];if(res.length==2)_dec=res[1];_int=_int.split("").reverse().join("").match(/([^]{1,3})/ig);for(var i=_int.length-1;i>=0;i--){_tmp+=_int[i].split("").reverse().join("");if(i!=0)_tmp+=","}if(undefined!=_dec)while(_dec.length<arg1.getValue())_dec+="0";return""+_tmp+(res.length==2?"."+_dec+"":"")}var arg0=arg[0],arg1=arg[1]?arg[1]:new cNumber(2),arg2=arg[2]?arg[2]:new cBool(false);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type); else arg0=arg0.tocNumber()}else arg0=arg0.tocNumber();if(arg1 instanceof cRef||arg1 instanceof cRef3D){arg1=arg1.getValue();if(arg1 instanceof cError)return arg1;else if(arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg1=arg1.tocNumber()}else arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem, r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber){var res=roundHelper(a.getValue(),b.getValue());this.array[r][c]=toFix(res.toString(),arg2.toBool())}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem;var b=arg1;if(a instanceof cNumber&&b instanceof cNumber){var res=roundHelper(a.getValue(),b.getValue());this.array[r][c]=toFix(res.toString(),arg2.toBool())}else this.array[r][c]= new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0;var b=elem;if(a instanceof cNumber&&b instanceof cNumber){var res=roundHelper(a.getValue(),b.getValue());this.array[r][c]=toFix(res.toString(),arg2.toBool())}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}var number=arg0.getValue(),num_digits=arg1.getValue();var res=roundHelper(number,num_digits).getValue();var cNull="";if(num_digits>0){cNull= ".";for(var i=0;i<num_digits;i++,cNull+="0");}res=new cString(oNumFormatCache.get("$#,##0"+cNull+";($#,##0"+cNull+")").format(roundHelper(number,num_digits).getValue(),CellValueType.Number,AscCommon.gc_nMaxDigCount)[0].text);return res};function cEXACT(){}cEXACT.prototype=Object.create(cBaseFunction.prototype);cEXACT.prototype.constructor=cEXACT;cEXACT.prototype.name="EXACT";cEXACT.prototype.argumentsMin=2;cEXACT.prototype.argumentsMax=2;cEXACT.prototype.argumentsType=[argType.text,argType.text]; cEXACT.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cRef||arg1 instanceof cRef3D)arg1=arg1.getValue();if(arg0 instanceof cArray&&arg1 instanceof cArray){arg0=arg0.getElementRowCol(0,0);arg1=arg1.getElementRowCol(0,0)}else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var arg0val=arg0.toLocaleString(),arg1val=arg1.toLocaleString();return new cBool(arg0val===arg1val)};function cFIND(){}cFIND.prototype=Object.create(cBaseFunction.prototype);cFIND.prototype.constructor=cFIND;cFIND.prototype.name="FIND";cFIND.prototype.argumentsMin=2;cFIND.prototype.argumentsMax=3;cFIND.prototype.argumentsType= [argType.text,argType.text,argType.number];cFIND.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg.length==3?arg[2]:null,res,str,searchStr,pos=-1;if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cRef||arg1 instanceof cRef3D)arg1=arg1.getValue();if(arg2!==null){if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);arg2=arg2.tocNumber();if(arg2 instanceof cArray)arg2=arg2.getElementRowCol(0,0);if(arg2 instanceof cError)return arg2;pos=arg2.getValue();pos=pos>0?pos-1:pos}if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;str=arg1.toLocaleString();searchStr=RegExp.escape(arg0.toLocaleString());if(arg2){if(pos>str.length|| pos<0)return new cError(cErrorType.wrong_value_type);str=str.substring(pos);res=str.search(searchStr);if(res>=0)res+=pos}else res=str.search(searchStr);if(res<0)return new cError(cErrorType.wrong_value_type);return new cNumber(res+1)};function cFINDB(){}cFINDB.prototype=Object.create(cFIND.prototype);cFINDB.prototype.constructor=cFINDB;cFINDB.prototype.name="FINDB";cFINDB.prototype.argumentsType=[argType.text,argType.text,argType.number];function cFIXED(){}cFIXED.prototype=Object.create(cBaseFunction.prototype); cFIXED.prototype.constructor=cFIXED;cFIXED.prototype.name="FIXED";cFIXED.prototype.argumentsMin=1;cFIXED.prototype.argumentsMax=3;cFIXED.prototype.argumentsType=[argType.number,argType.number,argType.logical];cFIXED.prototype.Calculate=function(arg){function SignZeroPositive(number){return number<0?-1:1}function truncate(n){return Math[n>0?"floor":"ceil"](n)}function Floor(number,significance){var quotient=number/significance;if(quotient==0)return 0;var nolpiat=5*Math.sign(quotient)*Math.pow(10,Math.floor(Math.log10(Math.abs(quotient)))- AscCommonExcel.cExcelSignificantDigits);return truncate(quotient+nolpiat)*significance}function roundHelper(number,num_digits){if(num_digits>AscCommonExcel.cExcelMaxExponent){if(Math.abs(number)<1||num_digits<1E10)return new cNumber(number);return new cNumber(0)}else if(num_digits<AscCommonExcel.cExcelMinExponent){if(Math.abs(number)<.01)return new cNumber(number);return new cNumber(0)}var significance=SignZeroPositive(number)*Math.pow(10,-truncate(num_digits));number+=significance/2;if(number/significance== Infinity)return new cNumber(number);return new cNumber(Floor(number,significance))}function toFix(str,skip){var res,_int,_dec,_tmp="";if(skip)return str;res=str.split(".");_int=res[0];if(res.length==2)_dec=res[1];_int=_int.split("").reverse().join("").match(/([^]{1,3})/ig);for(var i=_int.length-1;i>=0;i--){_tmp+=_int[i].split("").reverse().join("");if(i!=0)_tmp+=","}if(undefined!=_dec)while(_dec.length<arg1.getValue())_dec+="0";return""+_tmp+(res.length==2?"."+_dec+"":"")}var arg0=arg[0],arg1=arg[1]? arg[1]:new cNumber(2),arg2=arg[2]?arg[2]:new cBool(false);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);arg2=arg2.tocBool();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue(); if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg0=arg0.tocNumber()}else arg0=arg0.tocNumber();if(arg1 instanceof cRef||arg1 instanceof cRef3D){arg1=arg1.getValue();if(arg1 instanceof cError)return arg1;else if(arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg1=arg1.tocNumber()}else arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()|| arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber&&arg2.toBool){var res=roundHelper(a.getValue(),b.getValue());this.array[r][c]=toFix(res.toString(),arg2.toBool())}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem;var b=arg1;if(a instanceof cNumber&&b instanceof cNumber&&arg2.toBool){var res=roundHelper(a.getValue(),b.getValue());this.array[r][c]=toFix(res.toString(),arg2.toBool())}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0;var b=elem;if(a instanceof cNumber&&b instanceof cNumber&&arg2.toBool){var res=roundHelper(a.getValue(),b.getValue());this.array[r][c]=toFix(res.toString(),arg2.toBool())}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); return arg1}var number=arg0.getValue(),num_digits=arg1.getValue();var cNull="";if(num_digits>0){cNull=".";for(var i=0;i<num_digits;i++,cNull+="0");}if(!arg2.toBool)return new cError(cErrorType.wrong_value_type);return new cString(oNumFormatCache.get("#"+(arg2.toBool()?"":",")+"##0"+cNull).format(roundHelper(number,num_digits).getValue(),CellValueType.Number,AscCommon.gc_nMaxDigCount)[0].text)};function cJIS(){}cJIS.prototype=Object.create(cBaseFunction.prototype);cJIS.prototype.constructor=cJIS;cJIS.prototype.name= "JIS";cJIS.prototype.argumentsMin=1;cJIS.prototype.argumentsMax=1;cJIS.prototype.Calculate=function(arg){var arg0=arg[0];var calc=function(str){var res="";var fullWidthFrom=65280;var fullWidthTo=65519;for(var i=0;i<str.length;i++){var nCh=str[i].charCodeAt(0);if(!(nCh>=fullWidthFrom&&nCh<=fullWidthTo))nCh=nCh-32+65280;res+=String.fromCharCode(nCh)}return new cString(res)};if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0= arg0.getValue();else if(arg0 instanceof cArray){var ret=new cArray;arg0.foreach(function(elem,r,c){if(!ret.array[r])ret.addRow();if(elem instanceof cError)ret.addElement(elem.toLocaleString());else ret.addElement(calc(elem))});return ret}if(arg0 instanceof cError)return arg0;return calc(arg0.toLocaleString())};function cLEFT(){}cLEFT.prototype=Object.create(cBaseFunction.prototype);cLEFT.prototype.constructor=cLEFT;cLEFT.prototype.name="LEFT";cLEFT.prototype.argumentsMin=1;cLEFT.prototype.argumentsMax= 2;cLEFT.prototype.argumentsType=[argType.text,argType.number];cLEFT.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg.length==1?new cNumber(1):arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg0.tocString();arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray){arg0=arg0.getElementRowCol(0,0);arg1=arg1.getElementRowCol(0,0)}else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg1.getValue()<0)return new cError(cErrorType.wrong_value_type);return new cString(arg0.getValue().substring(0,arg1.getValue()))};function cLEFTB(){}cLEFTB.prototype=Object.create(cLEFT.prototype);cLEFTB.prototype.constructor=cLEFTB;cLEFTB.prototype.name="LEFTB";cLEFTB.prototype.argumentsType=[argType.text,argType.number]; function cLEN(){}cLEN.prototype=Object.create(cBaseFunction.prototype);cLEN.prototype.constructor=cLEN;cLEN.prototype.name="LEN";cLEN.prototype.argumentsMin=1;cLEN.prototype.argumentsMax=1;cLEN.prototype.argumentsType=[argType.text];cLEN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;return new cNumber(arg0.toLocaleString().length)};function cLENB(){}cLENB.prototype=Object.create(cLEN.prototype);cLENB.prototype.constructor=cLENB;cLENB.prototype.name="LENB";cLENB.prototype.argumentsType=[argType.text];function cLOWER(){}cLOWER.prototype=Object.create(cBaseFunction.prototype);cLOWER.prototype.constructor=cLOWER;cLOWER.prototype.name="LOWER";cLOWER.prototype.argumentsMin=1;cLOWER.prototype.argumentsMax=1;cLOWER.prototype.argumentsType=[argType.text];cLOWER.prototype.Calculate= function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;else arg0=arg0.toLocaleString()}else arg0=arg0.toLocaleString();return new cString(arg0.toLowerCase())};function cMID(){}cMID.prototype=Object.create(cBaseFunction.prototype);cMID.prototype.constructor= cMID;cMID.prototype.name="MID";cMID.prototype.argumentsMin=3;cMID.prototype.argumentsMax=3;cMID.prototype.argumentsType=[argType.text,argType.number,argType.number];cMID.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);if(arg2 instanceof cArea|| arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);arg0=arg0.toLocaleString();arg1=arg1.tocNumber();arg2=arg2.tocNumber();if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg2 instanceof cArray)arg2=arg2.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg1.getValue()<0)return new cError(cErrorType.wrong_value_type);if(arg2.getValue()<0)return new cError(cErrorType.wrong_value_type); var l=arg0.length;if(arg1.getValue()>l)return new cString("");return new cString(arg0.substr(arg1.getValue()==0?0:arg1.getValue()-1,arg2.getValue()))};function cMIDB(){}cMIDB.prototype=Object.create(cMID.prototype);cMIDB.prototype.constructor=cMIDB;cMIDB.prototype.name="MIDB";function cNUMBERVALUE(){}cNUMBERVALUE.prototype=Object.create(cBaseFunction.prototype);cNUMBERVALUE.prototype.constructor=cNUMBERVALUE;cNUMBERVALUE.prototype.name="NUMBERVALUE";cNUMBERVALUE.prototype.argumentsMin=1;cNUMBERVALUE.prototype.argumentsMax= 3;cNUMBERVALUE.prototype.isXLFN=true;cNUMBERVALUE.prototype.argumentsType=[argType.text,argType.text,argType.text];cNUMBERVALUE.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocString();argClone[1]=argClone[1]?argClone[1].tocString():new cString(AscCommon.g_oDefaultCultureInfo.NumberDecimalSeparator);argClone[2]=argClone[2]?argClone[2].tocString():new cString(AscCommon.g_oDefaultCultureInfo.NumberGroupSeparator); var argError;if(argError=this._checkErrorArg(argClone))return argError;var replaceAt=function(str,index,chr){if(index>str.length-1)return str;else return str.substr(0,index)+chr+str.substr(index+1)};var calcText=function(argArray){var aInputString=argArray[0];var aDecimalSeparator=argArray[1],aGroupSeparator=argArray[2];var cDecimalSeparator=0;if(aDecimalSeparator)if(aDecimalSeparator.length===1)cDecimalSeparator=aDecimalSeparator[0];else return new cError(cErrorType.wrong_value_type);if(cDecimalSeparator&& aGroupSeparator&&aGroupSeparator.indexOf(cDecimalSeparator)!==-1)return new cError(cErrorType.wrong_value_type);if(aInputString.length===0)return new cError(cErrorType.wrong_value_type);var count=0;for(var i=0;i<aInputString.length;i++){if(cDecimalSeparator===aInputString[i])count++;if(count>1)return new cError(cErrorType.wrong_value_type)}var nDecSep=cDecimalSeparator?aInputString.indexOf(cDecimalSeparator):0;if(nDecSep!==0){var aTemporary=nDecSep>=0?aInputString.substr(0,nDecSep):aInputString;var nIndex= 0;while(nIndex<aGroupSeparator.length){var nChar=aGroupSeparator[nIndex];aTemporary=aTemporary.replace(new RegExp(RegExp.escape(nChar),"g"),"");nIndex++}if(nDecSep>=0)aInputString=aTemporary+aInputString.substr(nDecSep);else aInputString=aTemporary}aInputString=aInputString.replace(cDecimalSeparator,AscCommon.g_oDefaultCultureInfo.NumberDecimalSeparator);aInputString=aInputString.replace(/(\s|\r|\t|\n)/g,"");var nPercentCount=0;for(var i=aInputString.length-1;i>=0&&aInputString.charCodeAt(i)===37;i--){aInputString= replaceAt(aInputString,i,"");nPercentCount++}var fVal=AscCommon.g_oFormatParser.parse(aInputString,AscCommon.g_oDefaultCultureInfo);if(fVal){fVal=fVal.value;if(nPercentCount)fVal*=Math.pow(10,-(nPercentCount*2));return new cNumber(fVal)}return new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcText,true)};function cPHONETIC(){}cPHONETIC.prototype=Object.create(cBaseFunction.prototype);cPHONETIC.prototype.constructor=cPHONETIC;cPHONETIC.prototype.name="PHONETIC"; function cPROPER(){}cPROPER.prototype=Object.create(cBaseFunction.prototype);cPROPER.prototype.constructor=cPROPER;cPROPER.prototype.name="PROPER";cPROPER.prototype.argumentsMin=1;cPROPER.prototype.argumentsMax=1;cPROPER.prototype.argumentsType=[argType.text];cPROPER.prototype.Calculate=function(arg){var reg_PROPER=new RegExp("[-#$+*/^&%<\\[\\]='?_\\@!~`\">: ;.\\)\\(,]|\\d|\\s"),arg0=arg[0];function proper(str){var canUpper=true,retStr="",regTest;for(var i=0;i<str.length;i++){regTest=reg_PROPER.test(str[i]); if(regTest)canUpper=true;else if(canUpper){retStr+=str[i].toUpperCase();canUpper=false;continue}retStr+=str[i].toLowerCase()}return retStr}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();else if(arg0 instanceof cArray){var ret=new cArray;arg0.foreach(function(elem,r,c){if(!ret.array[r])ret.addRow();if(elem instanceof cError)ret.addElement(elem);else ret.addElement(new cString(proper(elem.toLocaleString())))}); return ret}if(arg0 instanceof cError)return arg0;return new cString(proper(arg0.toLocaleString()))};function cREPLACE(){}cREPLACE.prototype=Object.create(cBaseFunction.prototype);cREPLACE.prototype.constructor=cREPLACE;cREPLACE.prototype.name="REPLACE";cREPLACE.prototype.argumentsMin=4;cREPLACE.prototype.argumentsMax=4;cREPLACE.prototype.argumentsType=[argType.text,argType.number,argType.number,argType.text];cREPLACE.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2],arg3=arg[3]; if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocString();else if(arg0 instanceof cArray)arg0=arg0.getElement(0).tocString();arg0=arg0.tocString();if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]).tocNumber();else if(arg1 instanceof cArray)arg1=arg1.getElement(0).tocNumber();arg1=arg1.tocNumber();if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]).tocNumber();else if(arg2 instanceof cArray)arg2=arg2.getElement(0).tocNumber(); arg2=arg2.tocNumber();if(arg3 instanceof cArea||arg3 instanceof cArea3D)arg3=arg3.cross(arguments[1]).tocString();else if(arg3 instanceof cArray)arg3=arg3.getElement(0).tocString();arg3=arg3.tocString();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg3 instanceof cError)return arg3;if(arg1.getValue()<1||arg2.getValue()<0)return new cError(cErrorType.wrong_value_type);var string1=arg0.getValue(),string2=arg3.getValue(),res=""; string1=string1.split("");string1.splice(arg1.getValue()-1,arg2.getValue(),string2);for(var i=0;i<string1.length;i++)res+=string1[i];return new cString(res)};function cREPLACEB(){}cREPLACEB.prototype=Object.create(cREPLACE.prototype);cREPLACEB.prototype.constructor=cREPLACEB;cREPLACEB.prototype.name="REPLACEB";cREPLACEB.prototype.argumentsType=[argType.text,argType.number,argType.number,argType.text];function cREPT(){}cREPT.prototype=Object.create(cBaseFunction.prototype);cREPT.prototype.constructor= cREPT;cREPT.prototype.name="REPT";cREPT.prototype.argumentsMin=2;cREPT.prototype.argumentsMax=2;cREPT.prototype.argumentsType=[argType.text,argType.number];cREPT.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],res="";if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cArray&&arg1 instanceof cArray){arg0=arg0.getElementRowCol(0,0);arg1=arg1.getElementRowCol(0,0)}else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]).tocNumber();else if(arg1 instanceof cRef||arg1 instanceof cRef3D)arg1=arg1.getValue();if(arg1 instanceof cError)return arg1;else if(arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg1=arg1.tocNumber();if(arg1.getValue()< 0)return new cError(cErrorType.wrong_value_type);return new cString(arg0.getValue().repeat(arg1.getValue()))};function cRIGHT(){}cRIGHT.prototype=Object.create(cBaseFunction.prototype);cRIGHT.prototype.constructor=cRIGHT;cRIGHT.prototype.name="RIGHT";cRIGHT.prototype.argumentsMin=1;cRIGHT.prototype.argumentsMax=2;cRIGHT.prototype.argumentsType=[argType.text,argType.number];cRIGHT.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg.length===1?new cNumber(1):arg[1];if(arg0 instanceof cArea|| arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg0.tocString();arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray){arg0=arg0.getElementRowCol(0,0);arg1=arg1.getElementRowCol(0,0)}else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg1.getValue()< 0)return new cError(cErrorType.wrong_value_type);var l=arg0.getValue().length,_number=l-arg1.getValue();return new cString(arg0.getValue().substring(_number<0?0:_number,l))};function cRIGHTB(){}cRIGHTB.prototype=Object.create(cRIGHT.prototype);cRIGHTB.prototype.constructor=cRIGHTB;cRIGHTB.prototype.name="RIGHTB";cRIGHTB.prototype.argumentsType=[argType.text,argType.number];function cSEARCH(){}cSEARCH.prototype=Object.create(cBaseFunction.prototype);cSEARCH.prototype.constructor=cSEARCH;cSEARCH.prototype.name= "SEARCH";cSEARCH.prototype.argumentsMin=2;cSEARCH.prototype.argumentsMax=3;cSEARCH.prototype.argumentsType=[argType.text,argType.text,argType.number];cSEARCH.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2]?arg[2]:new cNumber(1);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocString();else if(arg0 instanceof cArray)arg0=arg0.getElement(0).tocString();arg0=arg0.tocString();if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]).tocString(); else if(arg1 instanceof cArray)arg1=arg1.getElement(0).tocString();arg1=arg1.tocString();if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]).tocNumber();else if(arg2 instanceof cArray)arg2=arg2.getElement(0).tocNumber();arg2=arg2.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg2.getValue()<1||arg2.getValue()>arg1.getValue().length)return new cError(cErrorType.wrong_value_type);var string1= arg0.getValue(),string2=arg1.getValue(),valueForSearching=string1.replace(/(\\)/g,"\\\\").replace(/(\^)/g,"\\^").replace(/(\()/g,"\\(").replace(/(\))/g,"\\)").replace(/(\+)/g,"\\+").replace(/(\[)/g,"\\[").replace(/(\])/g,"\\]").replace(/(\{)/g,"\\{").replace(/(\})/g,"\\}").replace(/(\$)/g,"\\$").replace(/(\.)/g,"\\.").replace(/(~)?\*/g,function($0,$1){return $1?$0:"(.*)"}).replace(/(~)?\?/g,function($0,$1){return $1?$0:"."}).replace(/(~\*)/g,"\\*").replace(/(~\?)/g,"\\?");valueForSearching=new RegExp(valueForSearching, "ig");if(""===string1)return arg2;var res=string2.substring(arg2.getValue()-1).search(valueForSearching)+arg2.getValue()-1;if(res<0)return new cError(cErrorType.wrong_value_type);return new cNumber(res+1)};function cSEARCHB(){}cSEARCHB.prototype=Object.create(cSEARCH.prototype);cSEARCHB.prototype.constructor=cSEARCHB;cSEARCHB.prototype.name="SEARCHB";cSEARCHB.prototype.argumentsType=[argType.text,argType.text,argType.number];function cSUBSTITUTE(){}cSUBSTITUTE.prototype=Object.create(cBaseFunction.prototype); cSUBSTITUTE.prototype.constructor=cSUBSTITUTE;cSUBSTITUTE.prototype.name="SUBSTITUTE";cSUBSTITUTE.prototype.argumentsMin=3;cSUBSTITUTE.prototype.argumentsMax=4;cSUBSTITUTE.prototype.argumentsType=[argType.text,argType.text,argType.text,argType.text];cSUBSTITUTE.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2],arg3=arg[3]?arg[3]:new cNumber(0);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocString();else if(arg0 instanceof cArray)arg0=arg0.getElement(0).tocString(); arg0=arg0.tocString();if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]).tocString();else if(arg1 instanceof cArray)arg1=arg1.getElement(0).tocString();arg1=arg1.tocString();if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]).tocString();else if(arg2 instanceof cArray)arg2=arg2.getElement(0).tocString();arg2=arg2.tocString();if(arg3 instanceof cArea||arg3 instanceof cArea3D)arg3=arg3.cross(arguments[1]).tocNumber();else if(arg3 instanceof cArray)arg3= arg3.getElement(0).tocNumber();arg3=arg3.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg3 instanceof cError)return arg3;if(arg3.getValue()<0)return new cError(cErrorType.wrong_value_type);var string=arg0.getValue(),old_string=arg1.getValue(),new_string=arg2.getValue(),occurence=arg3.getValue(),index=0,res;res=string.replace(new RegExp(RegExp.escape(old_string),"g"),function(equal,p1,source){index++;if(occurence== 0||occurence>source.length)return new_string;else if(occurence==index)return new_string;return equal});return new cString(res)};function cT(){}cT.prototype=Object.create(cBaseFunction.prototype);cT.prototype.constructor=cT;cT.prototype.name="T";cT.prototype.argumentsMin=1;cT.prototype.argumentsMax=1;cT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.replace_only_array;cT.prototype.argumentsType=[argType.any];cT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cRef|| arg0 instanceof cRef3D)arg0=arg0.getValue();else if(arg0 instanceof cString||arg0 instanceof cError)return arg0;else if(arg0 instanceof cArea||arg0 instanceof cArea3D)return arg0.getValue2(0,0);else if(arg[0]instanceof cArray)arg0=arg[0].getElementRowCol(0,0);if(arg0 instanceof cString||arg0 instanceof cError)return arg[0];else return new cString("")};function cTEXT(){}cTEXT.prototype=Object.create(cBaseFunction.prototype);cTEXT.prototype.constructor=cTEXT;cTEXT.prototype.name="TEXT";cTEXT.prototype.argumentsMin= 2;cTEXT.prototype.argumentsMax=2;cTEXT.prototype.argumentsType=[argType.any,argType.text];cTEXT.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg1 instanceof cRef||arg1 instanceof cRef3D)arg1=arg1.getValue();else if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1= arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg1=arg1.tocString();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(!(arg0 instanceof cBool)){var _tmp=arg0.tocNumber();if(_tmp instanceof cNumber)arg0=_tmp}var oFormat=new CellFormat(arg1.toString(),undefined,true);var a=g_oFormatParser.parse(arg0.toLocaleString(true)+""),aText;aText=oFormat.format(a?a.value:arg0.toLocaleString(),arg0 instanceof cNumber||a?CellValueType.Number: CellValueType.String,AscCommon.gc_nMaxDigCountView);var text="";for(var i=0,length=aText.length;i<length;++i){if(aText[i].format&&aText[i].format.getSkip()){text+=" ";continue}if(aText[i].format&&aText[i].format.getRepeat())continue;text+=aText[i].text}var res=new cString(text);res.numFormat=AscCommonExcel.cNumFormatNone;return res};function cTEXTJOIN(){}cTEXTJOIN.prototype=Object.create(cBaseFunction.prototype);cTEXTJOIN.prototype.constructor=cTEXTJOIN;cTEXTJOIN.prototype.name="TEXTJOIN";cTEXTJOIN.prototype.argumentsMin= 3;cTEXTJOIN.prototype.argumentsMax=255;cTEXTJOIN.prototype.numFormat=AscCommonExcel.cNumFormatNone;cTEXTJOIN.prototype.isXLFN=true;cTEXTJOIN.prototype.arrayIndexes={0:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1};cTEXTJOIN.prototype.Calculate=function(arg){var argClone=[arg[0],arg[1]];argClone[1]=arg[1].tocBool();var argError;if(argError=this._checkErrorArg(argClone))return argError;var ignore_empty=argClone[1].toBool();var delimiter=argClone[0];var delimiterIter=0;var delimiterArr=this._getOneDimensionalArray(delimiter); if(delimiterArr instanceof cError)return delimiterArr;var concatString=function(string1,string2){var res=string1;if(""===string2&&ignore_empty)return res;var isStartStr=string1==="";var delimiterStr=isStartStr?"":delimiterArr[delimiterIter];if(undefined===delimiterStr){delimiterIter=0;delimiterStr=delimiterArr[delimiterIter]}if(!isStartStr)delimiterIter++;res+=delimiterStr+string2;return res};var arg0=new cString(""),argI;for(var i=2;i<arg.length;i++){argI=arg[i];var type=argI.type;if(cElementType.cellsRange=== type||cElementType.cellsRange3D===type||cElementType.array===type){argI=this._getOneDimensionalArray(argI);if(argI instanceof cError)return argI;for(var n=0;n<argI.length;n++)arg0=new cString(concatString(arg0.toString(),argI[n].toLocaleString()))}else if(cElementType.cell===type||cElementType.cell3D===type){argI=argI.getValue();if(argI instanceof cError)return argI;arg0=new cString(concatString(arg0.toString(),argI.toLocaleString()))}else{if(argI instanceof cError)return argI;arg0=new cString(concatString(arg0.toString(), argI.toLocaleString()))}}return arg0};function cTRIM(){}cTRIM.prototype=Object.create(cBaseFunction.prototype);cTRIM.prototype.constructor=cTRIM;cTRIM.prototype.name="TRIM";cTRIM.prototype.argumentsMin=1;cTRIM.prototype.argumentsMax=1;cTRIM.prototype.argumentsType=[argType.text];cTRIM.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]).tocString();else if(arg0 instanceof cArray)arg0=arg0.getElement(0).tocString();arg0=arg0.tocString(); if(arg0 instanceof cError)return arg0;return new cString(arg0.getValue().replace(AscCommon.rx_space_g,function($0,$1,$2){var res=" "===$2[$1+1]?"":$2[$1];return res}).replace(/^ | $/g,""))};function cUNICHAR(){}cUNICHAR.prototype=Object.create(cBaseFunction.prototype);cUNICHAR.prototype.constructor=cUNICHAR;cUNICHAR.prototype.name="UNICHAR";cUNICHAR.prototype.argumentsMin=1;cUNICHAR.prototype.argumentsMax=1;cUNICHAR.prototype.isXLFN=true;cUNICHAR.prototype.argumentsType=[argType.number];cUNICHAR.prototype.Calculate= function(arg){var oArguments=this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function _func(argArray){var num=parseInt(argArray[0]);if(isNaN(num)||num<=0||num>1114111)return new cError(cErrorType.wrong_value_type);var res=String.fromCharCode(num);if(""===res)return new cError(cErrorType.wrong_value_type);return new cString(res)}return this._findArrayInNumberArguments(oArguments, _func,true)};function cUNICODE(){}cUNICODE.prototype=Object.create(cBaseFunction.prototype);cUNICODE.prototype.constructor=cUNICODE;cUNICODE.prototype.name="UNICODE";cUNICODE.prototype.argumentsMin=1;cUNICODE.prototype.argumentsMax=1;cUNICODE.prototype.isXLFN=true;cUNICODE.prototype.argumentsType=[argType.text];cUNICODE.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocString();var argError;if(argError= this._checkErrorArg(argClone))return argError;function _func(argArray){var str=argArray[0].toLocaleString();var res=str.charCodeAt(0);return new cNumber(res)}return this._findArrayInNumberArguments(oArguments,_func,true)};function cUPPER(){}cUPPER.prototype=Object.create(cBaseFunction.prototype);cUPPER.prototype.constructor=cUPPER;cUPPER.prototype.name="UPPER";cUPPER.prototype.argumentsMin=1;cUPPER.prototype.argumentsMax=1;cUPPER.prototype.argumentsType=[argType.text];cUPPER.prototype.Calculate=function(arg){var arg0= arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);if(arg0 instanceof cError)return arg0;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;else arg0=arg0.toLocaleString()}else arg0=arg0.toLocaleString();return new cString(arg0.toUpperCase())};function cVALUE(){}cVALUE.prototype=Object.create(cBaseFunction.prototype);cVALUE.prototype.constructor=cVALUE; cVALUE.prototype.name="VALUE";cVALUE.prototype.argumentsMin=1;cVALUE.prototype.argumentsMax=1;cVALUE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cVALUE.prototype.argumentsType=[argType.any];cVALUE.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg0 instanceof cError)return arg0;var res=g_oFormatParser.parse(arg0.getValue()); if(res)return new cNumber(res.value);else return new cError(cErrorType.wrong_value_type)};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].cTEXT=cTEXT})(window);"use strict";(function(window,undefined){var cDate=Asc.cDate;var fSortAscending=AscCommon.fSortAscending;var cElementType=AscCommonExcel.cElementType;var cErrorType=AscCommonExcel.cErrorType;var cNumber=AscCommonExcel.cNumber;var cString=AscCommonExcel.cString;var cBool=AscCommonExcel.cBool;var cError=AscCommonExcel.cError; var cArea=AscCommonExcel.cArea;var cArea3D=AscCommonExcel.cArea3D;var cRef=AscCommonExcel.cRef;var cRef3D=AscCommonExcel.cRef3D;var cEmpty=AscCommonExcel.cEmpty;var cArray=AscCommonExcel.cArray;var cBaseFunction=AscCommonExcel.cBaseFunction;var checkTypeCell=AscCommonExcel.checkTypeCell;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var argType=Asc.c_oAscFormulaArgumentType;var _func=AscCommonExcel._func;var matching=AscCommonExcel.matching;var maxGammaArgument=171.624376956302;cFormulaFunctionGroup["Statistical"]= cFormulaFunctionGroup["Statistical"]||[];cFormulaFunctionGroup["Statistical"].push(cAVEDEV,cAVERAGE,cAVERAGEA,cAVERAGEIF,cAVERAGEIFS,cBETADIST,cBETA_DIST,cBETA_INV,cBETAINV,cBINOMDIST,cBINOM_DIST,cBINOM_DIST_RANGE,cBINOM_INV,cCHIDIST,cCHIINV,cCHISQ_DIST,cCHISQ_DIST_RT,cCHISQ_INV,cCHISQ_INV_RT,cCHITEST,cCHISQ_TEST,cCONFIDENCE,cCONFIDENCE_NORM,cCONFIDENCE_T,cCORREL,cCOUNT,cCOUNTA,cCOUNTBLANK,cCOUNTIF,cCOUNTIFS,cCOVAR,cCOVARIANCE_P,cCOVARIANCE_S,cCRITBINOM,cDEVSQ,cEXPON_DIST,cEXPONDIST,cF_DIST,cFDIST, cF_DIST_RT,cF_INV,cFINV,cF_INV_RT,cFISHER,cFISHERINV,cFORECAST,cFORECAST_ETS,cFORECAST_ETS_CONFINT,cFORECAST_ETS_SEASONALITY,cFORECAST_ETS_STAT,cFORECAST_LINEAR,cFREQUENCY,cFTEST,cF_TEST,cGAMMA,cGAMMA_DIST,cGAMMADIST,cGAMMA_INV,cGAMMAINV,cGAMMALN,cGAMMALN_PRECISE,cGAUSS,cGEOMEAN,cGROWTH,cHARMEAN,cHYPGEOMDIST,cHYPGEOM_DIST,cINTERCEPT,cKURT,cLARGE,cLINEST,cLOGEST,cLOGINV,cLOGNORM_DIST,cLOGNORM_INV,cLOGNORMDIST,cMAX,cMAXA,cMAXIFS,cMEDIAN,cMIN,cMINA,cMINIFS,cMODE,cMODE_MULT,cMODE_SNGL,cNEGBINOMDIST,cNEGBINOM_DIST, cNORMDIST,cNORM_DIST,cNORMINV,cNORM_INV,cNORMSDIST,cNORM_S_DIST,cNORMSINV,cNORM_S_INV,cPEARSON,cPERCENTILE,cPERCENTILE_EXC,cPERCENTILE_INC,cPERCENTRANK,cPERCENTRANK_EXC,cPERCENTRANK_INC,cPERMUT,cPERMUTATIONA,cPHI,cPOISSON,cPOISSON_DIST,cPROB,cQUARTILE,cQUARTILE_EXC,cQUARTILE_INC,cRANK,cRANK_AVG,cRANK_EQ,cRSQ,cSKEW,cSKEW_P,cSLOPE,cSMALL,cSTANDARDIZE,cSTDEV,cSTDEV_S,cSTDEVA,cSTDEVP,cSTDEV_P,cSTDEVPA,cSTEYX,cTDIST,cT_DIST,cT_DIST_2T,cT_DIST_RT,cT_INV,cT_INV_2T,cTINV,cTREND,cTRIMMEAN,cTTEST,cT_TEST,cVAR, cVARA,cVARP,cVAR_P,cVAR_S,cVARPA,cWEIBULL,cWEIBULL_DIST,cZTEST,cZ_TEST);function integralPhi(x){return.5*AscCommonExcel.rtl_math_erfc(-x*.7071067811865475)}function phi(x){return.3989422804014327*Math.exp(-(x*x)/2)}function gauss(x){var t0=[.3989422804014327,-.06649038006690546,.00997355701003582,-.00118732821548045,1.1543468761616E-4,-9.4446562595E-6,6.6596935163E-7,-4.122667415E-8,2.27352982E-9,1.1301172E-10,5.11243E-12,-2.1218E-13],t2=[.4772498680518208,.05399096651318805,-.05399096651318805,.02699548325659403, -.00449924720943234,-.00224962360471617,.0013497741628297,-1.178374269137E-4,-1.1515930357476E-4,3.704737285544E-5,2.82690796889E-6,-3.54513195524E-6,3.7669563126E-7,1.9202407921E-7,-5.22690859E-8,-4.91799345E-9,3.66377919E-9,-1.5981997E-10,-1.7381238E-10,2.624031E-11,5.60919E-12,-1.72127E-12,-8.634E-14,7.894E-14],t4=[.4999683287581669,1.3383022576489E-4,-2.6766045152977E-4,3.3457556441221E-4,-2.8996548915725E-4,1.8178605666397E-4,-8.252863922168E-5,2.551802519049E-5,-3.91665839292E-6,-7.4018205222E-7, 6.4422023359E-7,-1.737015534E-7,9.09595465E-9,9.44943118E-9,-3.29957075E-9,2.9492075E-10,1.1874477E-10,-4.420396E-11,3.61422E-12,1.43638E-12,-4.5848E-13];var asympt=[-1,1,-3,15,-105],xabs=Math.abs(x),xshort=Math.floor(xabs),nval=0;if(xshort==0)nval=taylor(t0,11,xabs*xabs)*xabs;else if(xshort>=1&&xshort<=2)nval=taylor(t2,23,xabs-2);else if(xshort>=3&&xshort<=4)nval=taylor(t4,20,xabs-4);else nval=.5+phi(xabs)*taylor(asympt,4,1/(xabs*xabs))/xabs;if(x<0)return-nval;else return nval}function taylor(pPolynom, nMax,x){var nVal=pPolynom[nMax];for(var i=nMax-1;i>=0;i--)nVal=pPolynom[i]+nVal*x;return nVal}function gaussinv(x){var q,t,z;q=x-.5;if(Math.abs(q)<=.425){t=.180625-q*q;z=q*(((((((t*2509.0809287301227+33430.57558358813)*t+67265.7709270087)*t+45921.95393154987)*t+13731.69376550946)*t+1971.5909503065513)*t+133.14166789178438)*t+3.3871328727963665)/(((((((t*5226.495278852854+28729.085735721943)*t+39307.89580009271)*t+21213.794301586597)*t+5394.196021424751)*t+687.1870074920579)*t+42.31333070160091)*t+ 1)}else{if(q>0)t=1-x;else t=x;t=Math.sqrt(-Math.log(t));if(t<=5){t+=-1.6;z=(((((((t*7.745450142783414E-4+.022723844989269184)*t+.2417807251774506)*t+1.2704582524523684)*t+3.6478483247632045)*t+5.769497221460691)*t+4.630337846156546)*t+1.4234371107496835)/(((((((t*1.0507500716444169E-9+5.475938084995345E-4)*t+.015198666563616457)*t+.14810397642748008)*t+.6897673349851)*t+1.6763848301838038)*t+2.053191626637759)*t+1)}else{t+=-5;z=(((((((t*2.0103343992922881E-7+2.7115555687434876E-5)*t+.0012426609473880784)* t+.026532189526576124)*t+.29656057182850487)*t+1.7848265399172913)*t+5.463784911164114)*t+6.657904643501103)/(((((((t*2.0442631033899397E-15+1.421511758316446E-7)*t+1.8463183175100548E-5)*t+7.868691311456133E-4)*t+.014875361290850615)*t+.1369298809227358)*t+.599832206555888)*t+1)}if(q<0)z=-z}return z}function getLanczosSum(fZ){var num=[2.353137688041076E10,4.29198036426491E10,3.571195923735567E10,1.792103442603721E10,6.039542586352028E9,1.4397204073117216E9,2.4887455786205417E8,3.1426415585400194E7, 2876370.6289353725,186056.26539522348,8071.672002365816,210.82427775157936,2.5066282746310002],denom=[0,39916800,120543840,150917976,105258076,45995730,13339535,2637558,357423,32670,1925,66,1];var sumNum,sumDenom,i,zInv;if(fZ<=1){sumNum=num[12];sumDenom=denom[12];for(i=11;i>=0;--i){sumNum*=fZ;sumNum+=num[i];sumDenom*=fZ;sumDenom+=denom[i]}}else{zInv=1/fZ;sumNum=num[0];sumDenom=denom[0];for(i=1;i<=12;++i){sumNum*=zInv;sumNum+=num[i];sumDenom*=zInv;sumDenom+=denom[i]}}return sumNum/sumDenom}function getGammaHelper(fZ){var gamma= getLanczosSum(fZ),fg=6.02468004077673,zgHelp=fZ+fg-.5;var halfpower=Math.pow(zgHelp,fZ/2-.25);gamma*=halfpower;gamma/=Math.exp(zgHelp);gamma*=halfpower;if(fZ<=20&&fZ==Math.floor(fZ))gamma=Math.round(gamma);return gamma}function getLogGammaHelper(fZ){var _fg=6.02468004077673,zgHelp=fZ+_fg-.5;return Math.log(getLanczosSum(fZ))+(fZ-.5)*Math.log(zgHelp)-zgHelp}function getLogGamma(fZ){if(fZ>=maxGammaArgument)return getLogGammaHelper(fZ);if(fZ>=0)return Math.log(getGammaHelper(fZ));if(fZ>=.5)return Math.log(getGammaHelper(fZ+ 1)/fZ);return getLogGammaHelper(fZ+2)-Math.log(fZ+1)-Math.log(fZ)}function getPercentile(values,alpha){values.sort(fSortAscending);var nSize=values.length;if(nSize===0)return new cError(cErrorType.not_available);else if(nSize===1)return new cNumber(values[0]);else{var nIndex=Math.floor(alpha*(nSize-1));var fDiff=alpha*(nSize-1)-Math.floor(alpha*(nSize-1));if(fDiff===0)return new cNumber(values[nIndex]);else return new cNumber(values[nIndex]+fDiff*(values[nIndex+1]-values[nIndex]))}}function getPercentileExclusive(values, alpha){values.sort(fSortAscending);var nSize1=values.length+1;if(nSize1==1)return new cError(cErrorType.wrong_value_type);if(alpha*nSize1<1||alpha*nSize1>nSize1-1)return new cError(cErrorType.not_numeric);var nIndex=Math.floor(alpha*nSize1-1);var fDiff=alpha*nSize1-1-Math.floor(alpha*nSize1-1);if(fDiff===0)return new cNumber(values[nIndex]);else return new cNumber(values[nIndex]+fDiff*(values[nIndex+1]-values[nIndex]))}function percentrank(tA,fNum,k,bInclusive){tA.sort(fSortAscending);var nSize=tA.length; if(k<1)return new cError(cErrorType.not_numeric);else if(tA.length<1||nSize===0)return new cError(cErrorType.not_available);else if(fNum<tA[0]||fNum>tA[nSize-1])return new cError(cErrorType.not_available);else if(nSize===1)return new cNumber(1);else{if(fNum===tA[0])if(bInclusive)fRes=0;else fRes=1/(nSize+1);else{var fRes,nOldCount=0,fOldVal=tA[0],i;for(i=1;i<nSize&&tA[i]<fNum;i++)if(tA[i]!==fOldVal){nOldCount=i;fOldVal=tA[i]}if(tA[i]!==fOldVal)nOldCount=i;if(fNum===tA[i])if(bInclusive)fRes=nOldCount/ (nSize-1);else fRes=(i+1)/(nSize+1);else if(nOldCount===0)fRes=0;else{var fFract=(fNum-tA[nOldCount-1])/(tA[nOldCount]-tA[nOldCount-1]);if(bInclusive)fRes=(nOldCount-1+fFract)/(nSize-1);else fRes=(nOldCount+fFract)/(nSize+1)}}return new cNumber(fRes.toString().substr(0,fRes.toString().indexOf(".")+1+k)-0)}}function getMedian(rArray){rArray.sort(fSortAscending);var nSize=rArray.length;if(nSize==0)return new cError(cErrorType.wrong_value_type);if(nSize%2===0)return new cNumber((rArray[nSize/2-1]+rArray[nSize/ 2])/2);else return new cNumber(rArray[(nSize-1)/2])}function getGamma(fZ){var fLogPi=Math.log(Math.PI);var fLogDblMax=Math.log(Infinity);if(fZ>maxGammaArgument)return;if(fZ>=1)return getGammaHelper(fZ);if(fZ>=.5)return getGammaHelper(fZ+1)/fZ;if(fZ>=-.5){var fLogTest=getLogGammaHelper(fZ+2)-Math.log1p(fZ)-Math.log(Math.abs(fZ));if(fLogTest>=fLogDblMax)return;return getGammaHelper(fZ+2)/(fZ+1)/fZ}var fLogDivisor=getLogGammaHelper(1-fZ)+Math.log(Math.abs(Math.sin(Math.PI*fZ)));if(fLogDivisor-fLogPi>= fLogDblMax)return 0;if(fLogDivisor<0)if(fLogPi-fLogDivisor>fLogDblMax)return;return Math.exp(fLogPi-fLogDivisor)*(Math.sin(Math.PI*fZ)<0?-1:1)}function getGammaDist(fX,fAlpha,fLambda){if(fX<=0)return 0;else return GetLowRegIGamma(fAlpha,fX/fLambda)}function GetLowRegIGamma(fA,fX){var fLnFactor=fA*Math.log(fX)-fX-getLogGamma(fA);var fFactor=Math.exp(fLnFactor);if(fX>fA+1)return 1-fFactor*getGammaContFraction(fA,fX);else return fFactor*getGammaSeries(fA,fX)}function getGammaContFraction(fA,fX){var fBigInv= 2.22045E-16;var fHalfMachEps=fBigInv/2;var fBig=1/fBigInv;var fCount=0;var fY=1-fA;var fDenom=fX+2-fA;var fPkm1=fX+1;var fPkm2=1;var fQkm1=fDenom*fX;var fQkm2=fX;var fApprox=fPkm1/fQkm1;var bFinished=false;do{fCount=fCount+1;fY=fY+1;var fNum=fY*fCount;fDenom=fDenom+2;var fPk=fPkm1*fDenom-fPkm2*fNum;var fQk=fQkm1*fDenom-fQkm2*fNum;if(fQk!==0){var fR=fPk/fQk;bFinished=Math.abs((fApprox-fR)/fR)<=fHalfMachEps;fApprox=fR}fPkm2=fPkm1;fPkm1=fPk;fQkm2=fQkm1;fQkm1=fQk;if(Math.abs(fPk)>fBig){fPkm2=fPkm2*fBigInv; fPkm1=fPkm1*fBigInv;fQkm2=fQkm2*fBigInv;fQkm1=fQkm1*fBigInv}}while(!bFinished&&fCount<1E4);if(!bFinished)return;return fApprox}function getGammaSeries(fA,fX){var fHalfMachEps=2.22045E-16/2;var fDenomfactor=fA;var fSummand=1/fA;var fSum=fSummand;var nCount=1;do{fDenomfactor=fDenomfactor+1;fSummand=fSummand*fX/fDenomfactor;fSum=fSum+fSummand;nCount=nCount+1}while(fSummand/fSum>fHalfMachEps&&nCount<=1E4);if(nCount>1E4)return;return fSum}function getGammaDistPDF(fX,fAlpha,fLambda){if(fX<0)return 0;else if(fX=== 0)if(fAlpha<1)return;else if(fAlpha===1)return 1/fLambda;else return 0;else{var fXr=fX/fLambda;if(fXr>1){var fLogDblMax=Math.log(Infinity);if(Math.log(fXr)*(fAlpha-1)<fLogDblMax&&fAlpha<maxGammaArgument)return Math.pow(fXr,fAlpha-1)*Math.exp(-fXr)/fLambda/getGamma(fAlpha);else return Math.exp((fAlpha-1)*Math.log(fXr)-fXr-Math.log(fLambda)-getLogGamma(fAlpha))}else if(fAlpha<maxGammaArgument)return Math.pow(fXr,fAlpha-1)*Math.exp(-fXr)/fLambda/getGamma(fAlpha);else return Math.pow(fXr,fAlpha-1)*Math.exp(-fXr)/ fLambda/Math.exp(getLogGamma(fAlpha))}}function getChiDist(fX,fDF){if(fX<=0)return 1;else return getUpRegIGamma(fDF/2,fX/2)}function getUpRegIGamma(fA,fX){var fLnFactor=fA*Math.log(fX)-fX-getLogGamma(fA);var fFactor=Math.exp(fLnFactor);if(fX>fA+1)return fFactor*getGammaContFraction(fA,fX);else return 1-fFactor*getGammaSeries(fA,fX)}function getChiSqDistCDF(fX,fDF){if(fX<=0)return 0;else return GetLowRegIGamma(fDF/2,fX/2)}function getChiSqDistPDF(fX,fDF){var fValue;if(fX<=0)return 0;if(fDF*fX>1391E3)fValue= Math.exp((.5*fDF-1)*Math.log(fX*.5)-.5*fX-Math.log(2)-getLogGamma(.5*fDF));else{var fCount;if(Math.fmod(fDF,2)<.5){fValue=.5;fCount=2}else{fValue=1/Math.sqrt(fX*2*Math.PI);fCount=1}while(fCount<fDF){fValue*=fX/fCount;fCount+=2}if(fX>=1425)fValue=Math.exp(Math.log(fValue)-fX/2);else fValue*=Math.exp(-fX/2)}return fValue}function chiTest(pMat1,pMat2){if(!pMat1||!pMat2)return new cError(cErrorType.not_available);var nC1=pMat1.length;var nC2=pMat2.length;var nR1=pMat1[0].length;var nR2=pMat2[0].length; if(nR1!==nR2||nC1!==nC2)return new cError(cErrorType.not_available);var fChi=0;var bEmpty=true;for(var i=0;i<nC1;i++)for(var j=0;j<nR1;j++)if(pMat1[i][j]&&pMat2[i][j]){bEmpty=false;if(i===0&&j===0&&cElementType.string===pMat1[i][j].type)return new cError(cErrorType.division_by_zero);if(cElementType.number!==pMat1[i][j].type||cElementType.number!==pMat2[i][j].type)continue;var fValX=pMat1[i][j].getValue();var fValE=pMat2[i][j].getValue();if(fValE===0)return new cError(cErrorType.division_by_zero); var fTemp1=(fValX-fValE)*(fValX-fValE);var fTemp2=fTemp1;fChi+=fTemp2/fValE}if(bEmpty)return new cError(cErrorType.wrong_value_type);var fDF;if(nC1===1||nR1===1){fDF=nC1*nR1-1;if(fDF===0)return new cError(cErrorType.not_available)}else fDF=(nC1-1)*(nR1-1);if(fDF<1||fChi<0||fDF>Math.pow(10,10))return new cError(cErrorType.not_numeric);var res=getChiDist(fChi,fDF);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)}function tTest(pMat1,pMat2,fTails,fTyp){var fT,fF; var nC1=pMat1.length;var nC2=pMat2.length;var nR1=pMat1[0].length;var nR2=pMat2[0].length;var calcTest=null;if(fTyp===1){if(nC1!==nC2||nR1!==nR2)return new cError(cErrorType.not_available);var fCount=0;var fSum1=0;var fSum2=0;var fSumSqrD=0;var fVal1,fVal2;for(var i=0;i<nC1;i++)for(var j=0;j<nR1;j++){if(cElementType.number!==pMat1[i][j].type||cElementType.number!==pMat2[i][j].type)continue;fVal1=pMat1[i][j].getValue();fVal2=pMat2[i][j].getValue();fSum1+=fVal1;fSum2+=fVal2;fSumSqrD+=(fVal1-fVal2)* (fVal1-fVal2);fCount++}if(fCount<1)return new cError(cErrorType.wrong_value_type);var fSumD=fSum1-fSum2;var fDivider=fCount*fSumSqrD-fSumD*fSumD;if(fDivider===0)return new cError(cErrorType.division_by_zero);fT=Math.abs(fSumD)*Math.sqrt((fCount-1)/fDivider);fF=fCount-1}else if(fTyp===2)calcTest=CalculateTest(false,nC1,nC2,nR1,nR2,pMat1,pMat2,fT,fF);else if(fTyp===3)calcTest=CalculateTest(true,nC1,nC2,nR1,nR2,pMat1,pMat2,fT,fF);else return new cError(cErrorType.not_numeric);if(null!==calcTest)if(false=== calcTest)return new cError(cErrorType.division_by_zero);else{fT=calcTest.fT;fF=calcTest.fF}var res=getTDist(fT,fF,fTails);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)}function fTest(pMat1,pMat2){var getMatrixValues=function(matrix){var mfFirst=1;var mfFirstSqr=1;var mfRest=0;var mfRestSqr=0;var mnCount=0;var bFirst=false;for(var i=0;i<matrix.length;i++)for(var j=0;j<matrix[i].length;j++){if(cElementType.number!==matrix[i][j].type)continue;mnCount++;if(!bFirst){bFirst= true;mfFirst=matrix[i][j].getValue();mfFirstSqr=matrix[i][j].getValue()*matrix[i][j].getValue();continue}mfRest+=matrix[i][j].getValue();mfRestSqr+=matrix[i][j].getValue()*matrix[i][j].getValue()}return{mfFirst:mfFirst,mfRest:mfRest,mfRestSqr:mfRestSqr,mnCount:mnCount,mfFirstSqr:mfFirstSqr}};var matVals1=getMatrixValues(pMat1);var fSum1=matVals1.mfFirst+matVals1.mfRest;var fSumSqr1=matVals1.mfFirstSqr+matVals1.mfRestSqr;var fCount1=matVals1.mnCount;var matVals2=getMatrixValues(pMat2);var fSum2=matVals2.mfFirst+ matVals2.mfRest;var fSumSqr2=matVals2.mfFirstSqr+matVals2.mfRestSqr;var fCount2=matVals2.mnCount;if(fCount1<2||fCount2<2)return new cError(cErrorType.division_by_zero);var fS1=(fSumSqr1-fSum1*fSum1/fCount1)/(fCount1-1);var fS2=(fSumSqr2-fSum2*fSum2/fCount2)/(fCount2-1);if(fS1===0||fS2===0)return new cError(cErrorType.division_by_zero);var fF,fF1,fF2;if(fS1>fS2){fF=fS1/fS2;fF1=fCount1-1;fF2=fCount2-1}else{fF=fS2/fS1;fF1=fCount2-1;fF2=fCount1-1}var fFcdf=getFDist(fF,fF1,fF2);var res=2*Math.min(fFcdf, 1-fFcdf);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)}function CalculateTest(bTemplin,nC1,nC2,nR1,nR2,pMat1,pMat2,fT,fF){var fCount1=0;var fCount2=0;var fSum1=0;var fSumSqr1=0;var fSum2=0;var fSumSqr2=0;var fVal;for(var i=0;i<nC1;i++)for(var j=0;j<nR1;j++)if(cElementType.string!==pMat1[i][j].type){fVal=pMat1[i][j].getValue();fSum1+=fVal;fSumSqr1+=fVal*fVal;fCount1++}for(var i=0;i<nC2;i++)for(var j=0;j<nR2;j++)if(cElementType.string!==pMat2[i][j].type){fVal= pMat2[i][j].getValue();fSum2+=fVal;fSumSqr2+=fVal*fVal;fCount2++}if(fCount1<2||fCount2<2)return false;if(bTemplin){var fS1=(fSumSqr1-fSum1*fSum1/fCount1)/(fCount1-1)/fCount1;var fS2=(fSumSqr2-fSum2*fSum2/fCount2)/(fCount2-1)/fCount2;if(fS1+fS2===0)return false;var c=fS1/(fS1+fS2);fT=Math.abs(fSum1/fCount1-fSum2/fCount2)/Math.sqrt(fS1+fS2);fF=1/(c*c/(fCount1-1)+(1-c)*(1-c)/(fCount2-1))}else{var fS1=(fSumSqr1-fSum1*fSum1/fCount1)/(fCount1-1);var fS2=(fSumSqr2-fSum2*fSum2/fCount2)/(fCount2-1);fT=Math.abs(fSum1/ fCount1-fSum2/fCount2)/Math.sqrt((fCount1-1)*fS1+(fCount2-1)*fS2)*Math.sqrt(fCount1*fCount2*(fCount1+fCount2-2)/(fCount1+fCount2));fF=fCount1+fCount2-2}return{fT:fT,fF:fF}}function getBetaDist(fXin,fAlpha,fBeta){if(fXin<=0)return 0;if(fXin>=1)return 1;if(fBeta===1)return Math.pow(fXin,fAlpha);if(fAlpha===1)return-Math.expm1(fBeta*Math.log1p(-fXin));var fResult;var fY=.5-fXin+.5;var flnY=Math.log1p(-fXin);var fX=fXin;var flnX=Math.log(fXin);var fA=fAlpha;var fB=fBeta;var bReflect=fXin>fAlpha/(fAlpha+ fBeta);if(bReflect){fA=fBeta;fB=fAlpha;fX=fY;fY=fXin;flnX=flnY;flnY=Math.log(fXin)}fResult=getBetaHelperContFrac(fX,fA,fB);fResult=fResult/fA;var fP=fA/(fA+fB);var fQ=fB/(fA+fB);var fTemp;if(fA>1&&fB>1&&fP<.97&&fQ<.97)fTemp=getBetaDistPDF(fX,fA,fB)*fX*fY;else fTemp=Math.exp(fA*flnX+fB*flnY-getLogBeta(fA,fB));fResult*=fTemp;if(bReflect)fResult=.5-fResult+.5;if(fResult>1)fResult=1;if(fResult<0)fResult=0;return fResult}function getTDist(T,fDF,nType){var res=null;switch(nType){case 1:{res=.5*getBetaDist(fDF/ (fDF+T*T),fDF/2,.5);break}case 2:{res=getBetaDist(fDF/(fDF+T*T),fDF/2,.5);break}case 3:{res=Math.pow(1+T*T/fDF,-(fDF+1)/2)/(Math.sqrt(fDF)*getBeta(.5,fDF/2));break}case 4:{var X=fDF/(T*T+fDF);var R=.5*getBetaDist(X,.5*fDF,.5);res=T<0?R:1-R;break}}return res}function getBetaDistPDF(fX,fA,fB){if(fA===1){if(fB===1)return 1;if(fB===2)return-2*fX+2;if(fX===1&&fB<1)return;if(fX<=.01)return fB+fB*Math.expm1((fB-1)*Math.log1p(-fX));else return fB*Math.pow(.5-fX+.5,fB-1)}if(fB===1){if(fA===2)return fA*fX; if(fX===0&&fA<1)return;return fA*Math.pow(fX,fA-1)}if(fX<=0)if(fA<1&&fX===0)return;else return 0;if(fX>=1)if(fB<1&&fX===1)return;else return 0;var fLogDblMax=Math.log(Infinity);var fLogDblMin=Math.log(2.22507E-308);var fLogY=fX<.1?Math.log1p(-fX):Math.log(.5-fX+.5);var fLogX=Math.log(fX);var fAm1LogX=(fA-1)*fLogX;var fBm1LogY=(fB-1)*fLogY;var fLogBeta=getLogBeta(fA,fB);if(fAm1LogX<fLogDblMax&&fAm1LogX>fLogDblMin&&fBm1LogY<fLogDblMax&&fBm1LogY>fLogDblMin&&fLogBeta<fLogDblMax&&fLogBeta>fLogDblMin&& fAm1LogX+fBm1LogY<fLogDblMax&&fAm1LogX+fBm1LogY>fLogDblMin)return Math.pow(fX,fA-1)*Math.pow(.5-fX+.5,fB-1)/getBeta(fA,fB);else return Math.exp(fAm1LogX+fBm1LogY-fLogBeta)}function getBeta(fAlpha,fBeta){var fA;var fB;if(fAlpha>fBeta){fA=fAlpha;fB=fBeta}else{fA=fBeta;fB=fAlpha}if(fA+fB<maxGammaArgument)return getGamma(fA)/getGamma(fA+fB)*getGamma(fB);var fg=6.02468004077673;var fgm=fg-.5;var fLanczos=getLanczosSum(fA);fLanczos/=getLanczosSum(fA+fB);fLanczos*=getLanczosSum(fB);var fABgm=fA+fB+fgm;fLanczos*= Math.sqrt(fABgm/(fA+fgm)/(fB+fgm));var fTempA=fB/(fA+fgm);var fTempB=fA/(fB+fgm);var fResult=Math.exp(-fA*Math.log1p(fTempA)-fB*Math.log1p(fTempB)-fgm);fResult*=fLanczos;return fResult}function getBetaHelperContFrac(fX,fA,fB){var a1,b1,a2,b2,fnorm,cfnew,cf;a1=1;b1=1;b2=1-(fA+fB)/(fA+1)*fX;if(b2===0){a2=0;fnorm=1;cf=1}else{a2=1;fnorm=1/b2;cf=a2*fnorm}cfnew=1;var rm=1;var fMaxIter=5E4;var fMachEps=2.22045E-16;var bfinished=false;do{var apl2m=fA+2*rm;var d2m=rm*(fB-rm)*fX/((apl2m-1)*apl2m);var d2m1= -(fA+rm)*(fA+fB+rm)*fX/(apl2m*(apl2m+1));a1=(a2+d2m*a1)*fnorm;b1=(b2+d2m*b1)*fnorm;a2=a1+d2m1*a2*fnorm;b2=b1+d2m1*b2*fnorm;if(b2!==0){fnorm=1/b2;cfnew=a2*fnorm;bfinished=Math.abs(cf-cfnew)<Math.abs(cf)*fMachEps}cf=cfnew;rm+=1}while(rm<fMaxIter&&!bfinished);return cf}function getLogBeta(fAlpha,fBeta){var fA;var fB;if(fAlpha>fBeta){fA=fAlpha;fB=fBeta}else{fA=fBeta;fB=fAlpha}var fg=6.02468004077673;var fgm=fg-.5;var fLanczos=getLanczosSum(fA);fLanczos/=getLanczosSum(fA+fB);fLanczos*=getLanczosSum(fB); var fLogLanczos=Math.log(fLanczos);var fABgm=fA+fB+fgm;fLogLanczos+=.5*(Math.log(fABgm)-Math.log(fA+fgm)-Math.log(fB+fgm));var fTempA=fB/(fA+fgm);var fTempB=fA/(fB+fgm);var fResult=-fA*Math.log1p(fTempA)-fB*Math.log1p(fTempB)-fgm;fResult+=fLogLanczos;return fResult}function getFDist(x,fF1,fF2){var arg=fF2/(fF2+fF1*x);var alpha=fF2/2;var beta=fF1/2;return getBetaDist(arg,alpha,beta)}function iterateInverse(rFunction,fAx,fBx){var rConvError=false;var fYEps=1E-307;var fXEps=2.22045E-16;var fAy=rFunction.GetValue(fAx); var fBy=rFunction.GetValue(fBx);var fTemp;var nCount;for(nCount=0;nCount<1E3&&!hasChangeOfSign(fAy,fBy);nCount++)if(Math.abs(fAy)<=Math.abs(fBy)){fTemp=fAx;fAx+=2*(fAx-fBx);if(fAx<0)fAx=0;fBx=fTemp;fBy=fAy;fAy=rFunction.GetValue(fAx)}else{fTemp=fBx;fBx+=2*(fBx-fAx);fAx=fTemp;fAy=fBy;fBy=rFunction.GetValue(fBx)}if(fAy===0)return{val:fAx,bError:rConvError};if(fBy===0)return{val:fBx,bError:rConvError};if(!hasChangeOfSign(fAy,fBy)){rConvError=true;return{val:0,bError:rConvError}}var fPx=fAx;var fPy=fAy; var fQx=fBx;var fQy=fBy;var fRx=fAx;var fRy=fAy;var fSx=.5*(fAx+fBx);var bHasToInterpolate=true;nCount=0;while(nCount<500&&Math.abs(fRy)>fYEps&&fBx-fAx>Math.max(Math.abs(fAx),Math.abs(fBx))*fXEps){if(bHasToInterpolate)if(fPy!==fQy&&fQy!==fRy&&fRy!==fPy){fSx=fPx*fRy*fQy/(fRy-fPy)/(fQy-fPy)+fRx*fQy*fPy/(fQy-fRy)/(fPy-fRy)+fQx*fPy*fRy/(fPy-fQy)/(fRy-fQy);bHasToInterpolate=fAx<fSx&&fSx<fBx}else bHasToInterpolate=false;if(!bHasToInterpolate){fSx=.5*(fAx+fBx);fQx=fBx;fQy=fBy;bHasToInterpolate=true}fPx= fQx;fQx=fRx;fRx=fSx;fPy=fQy;fQy=fRy;fRy=rFunction.GetValue(fSx);if(hasChangeOfSign(fAy,fRy)){fBx=fRx;fBy=fRy}else{fAx=fRx;fAy=fRy}bHasToInterpolate=bHasToInterpolate&&Math.abs(fRy)*2<=Math.abs(fQy);++nCount}return{val:fRx,bError:rConvError}}function hasChangeOfSign(u,w){return u<0&&w>0||u>0&&w<0}function rank(fVal,aSortArray,bAscending,bAverage){aSortArray.sort(function sortArr(a,b){return a-b});var nSize=aSortArray.length;var res;if(nSize==0)res=null;else if(fVal<aSortArray[0]||fVal>aSortArray[nSize- 1])res=null;else{var fLastPos=0;var fFirstPos=-1;var bFinished=false;var i;for(i=0;i<nSize&&!bFinished;i++)if(aSortArray[i]===fVal){if(fFirstPos<0)fFirstPos=i+1}else if(aSortArray[i]>fVal){fLastPos=i;bFinished=true}if(!bFinished)fLastPos=i;if(!bAverage)if(bAscending)res=fFirstPos;else res=nSize+1-fLastPos;else if(bAscending)res=(fFirstPos+fLastPos)/2;else res=nSize+1-(fFirstPos+fLastPos)/2}return res}function skew(x,bSkewp){var sumSQRDeltaX=0,_x=0,xLength=0,sumSQRDeltaXDivstandDev=0,i;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber){_x+=x[i].getValue();xLength++}if(xLength<=2)return new cError(cErrorType.not_available);_x/=xLength;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber)sumSQRDeltaX+=Math.pow(x[i].getValue()-_x,2);var standDev;if(bSkewp)standDev=Math.sqrt(sumSQRDeltaX/xLength);else standDev=Math.sqrt(sumSQRDeltaX/(xLength-1));for(i=0;i<x.length;i++)if(x[i]instanceof cNumber)sumSQRDeltaXDivstandDev+=Math.pow((x[i].getValue()-_x)/standDev,3);var res;if(bSkewp)res=sumSQRDeltaXDivstandDev/xLength;else res=xLength/ (xLength-1)/(xLength-2)*sumSQRDeltaXDivstandDev;return new cNumber(res)}function convertToMatrix(val){var matrix;if(undefined!==val.getMatrix)matrix=val.getMatrix();else{val=val.tocNumber();if(cElementType.error===val.type)return val;matrix=[[val]]}return matrix}function GetNewMat(c,r){var matrix=[];for(var i=0;i<c;i++)for(var j=0;j<r;j++){if(!matrix[i])matrix[i]=[];matrix[i][j]=0}return matrix}function matrixClone(matrix){var cloneMatrix=[];for(var i=0;i<matrix.length;i++)for(var j=0;j<matrix[i].length;j++){if(!cloneMatrix[i])cloneMatrix[i]= [];cloneMatrix[i][j]=matrix[i][j]}return cloneMatrix}function CheckMatrix(_bLOG,pMatX,pMatY){var nCX=0;var nCY=0;var nRX=0;var nRY=0;var M=0;var N=0;var nCase;var i,j;if(!pMatY||!pMatY[0])return false;nRY=pMatY.length;nCY=pMatY[0].length;var nCountY=nCY*nRY;var _pMatY=[];for(i=0;i<pMatY.length;i++)for(j=0;j<pMatY[i].length;j++)if(!pMatY[i][j])return false;else{if(!_pMatY[j])_pMatY[j]=[];_pMatY[j][i]=pMatY[i][j].getValue()}if(_bLOG){var pNewY=[];for(i=0;i<pMatY.length;i++)for(j=0;j<pMatY[i].length;j++){var fVal= pMatY[i][j];if(fVal<=0)return false;else{if(!pNewY[j])pNewY[j]=[];pNewY[j][i]=Math.log(fVal)}}_pMatY=pNewY}var _pMatX;if(pMatX){_pMatX=[];nRX=pMatX.length;nCX=pMatX[0].length;var nCountX=nCX*nRX;for(i=0;i<pMatX.length;i++)for(j=0;j<pMatX[i].length;j++)if(!pMatX[i][j])return false;else{if(!_pMatX[j])_pMatX[j]=[];_pMatX[j][i]=pMatX[i][j].getValue()}if(nCX===nCY&&nRX===nRY){nCase=1;M=1;N=nCountY}else if(nCY!==1&&nRY!==1)return false;else if(nCY===1)if(nRX!==nRY)return false;else{nCase=2;N=nRY;M=nCX}else if(nCX!== nCY)return false;else{nCase=3;N=nCY;M=nRX}}else{_pMatX=GetNewMat(nCY,nRY);nCX=nCY;nRX=nRY;var num=1;for(i=0;i<nRY;i++)for(j=0;j<nCY;j++){if(!_pMatX[j])_pMatX[j]=[];_pMatX[j][i]=num;num++}nCase=1;N=nCountY;M=1}return{nCase:nCase,nCX:nCX,nCY:nCY,nRX:nRX,nRY:nRY,M:M,N:N,pMatX:_pMatX,pMatY:_pMatY}}function lcl_GetMeanOverAll(pMat,nN){var fSum=0;for(var i=0;i<pMat.length;i++)for(var j=0;j<pMat[i].length;j++)fSum+=pMat[i][j];return fSum/nN}function lcl_GetSumProduct(pMatA,pMatB,nM){var fSum=0;for(var i= 0;i<nM;i++)fSum+=getDouble(pMatA,i)*getDouble(pMatB,i);return fSum}function approxSub(a,b){if((a<0&&b<0||a>0&&b>0)&&Math.abs(a-b)<2.22045E-16)return 0;return a-b}function lcl_CalculateColumnMeans(pX,pResMat,nC,nR){for(var i=0;i<nC;i++){var fSum=0;for(var k=0;k<nR;k++)fSum+=pX[i][k];putDouble(pResMat,i,fSum/nR,i)}}function lcl_CalculateColumnsDelta(pMat,pColumnMeans,nC,nR){for(var i=0;i<nC;i++)for(var k=0;k<nR;k++)pMat[i][k]=approxSub(pMat[i][k],getDouble(pColumnMeans,i))}function lcl_TGetColumnMaximumNorm(pMatA, nR,nC,nN){var fNorm=0;for(var col=nC;col<nN;col++)if(fNorm<Math.abs(pMatA[nR][col]))fNorm=Math.abs(pMatA[nR][col]);return fNorm}function lcl_TGetColumnEuclideanNorm(pMatA,nR,nC,nN){var fNorm=0;for(var col=nC;col<nN;col++)fNorm+=pMatA[col][nR]*pMatA[col][nR];return Math.sqrt(fNorm)}function lcl_GetSign(fValue){return fValue>=0?1:-1}function lcl_TGetColumnSumProduct(pMatA,nRa,pMatB,nRb,nC,nN){var fResult=0;for(var col=nC;col<nN;col++)fResult+=pMatA[col][nRa]*pMatB[col][nRb];return fResult}function lcl_TCalculateQRdecomposition(pMatA, pVecR,nK,nN){var fSum;for(var row=0;row<nK;row++){var fScale=lcl_TGetColumnMaximumNorm(pMatA,row,row,nN);if(fScale===0)return false;for(var col=row;col<nN;col++)pMatA[col][row]=pMatA[col][row]/fScale;var fEuclid=lcl_TGetColumnEuclideanNorm(pMatA,row,row,nN);var fFactor=1/fEuclid/(fEuclid+Math.abs(pMatA[row][row]));var fSignum=lcl_GetSign(pMatA[row][row]);pMatA[row][row]=pMatA[row][row]+fSignum*fEuclid;pVecR[row]=-fSignum*fScale*fEuclid;for(var r=row+1;r<nK;r++){fSum=lcl_TGetColumnSumProduct(pMatA, row,pMatA,r,row,nN);for(var col=row;col<nN;col++)pMatA[col][r]=pMatA[col][r]-fSum*fFactor*pMatA[col][row]}}return true}function lcl_ApplyHouseholderTransformation(pMatA,nC,pMatY,nN){var fDenominator=lcl_GetColumnSumProduct(pMatA,nC,pMatA,nC,nC,nN);var fNumerator=lcl_GetColumnSumProduct(pMatA,nC,pMatY,0,nC,nN);var fFactor=2*(fNumerator/fDenominator);for(var row=nC;row<nN;row++)putDouble(pMatY,row,getDouble(pMatY,row)-fFactor*pMatA[nC][row])}function lcl_GetColumnSumProduct(pMatA,nCa,pMatB,nCb,nR,nN){var fResult= 0;for(var row=nR;row<nN;row++)fResult+=pMatA[nCa][row]*pMatB[nCb][row];return fResult}function lcl_SolveWithUpperRightTriangle(pMatA,pVecR,pMatS,nK,bIsTransposed){var row;for(var rowp1=nK;rowp1>0;rowp1--){row=rowp1-1;var fSum=getDouble(pMatS,row);for(var col=rowp1;col<nK;col++)if(bIsTransposed)fSum-=pMatA[row][col]*getDouble(pMatS,col);else fSum-=pMatA[col][row]*getDouble(pMatS,col);putDouble(pMatS,row,fSum/pVecR[row])}}function lcl_MFastMult(pA,pB,pR,n,m,l){var sum;for(var row=0;row<n;row++)for(var col= 0;col<l;col++){sum=0;for(var k=0;k<m;k++)sum+=pA[k][row]*pB[col][k];pR[col][row]=sum}}function lcl_CalculateRowMeans(pX,pResMat,nC,nR){for(var k=0;k<nR;k++){var fSum=0;for(var i=0;i<nC;i++)fSum+=pX[i][k];pResMat[k][0]=fSum/nC}}function lcl_CalculateRowsDelta(pMat,pRowMeans,nC,nR){for(var k=0;k<nR;k++)for(var i=0;i<nC;i++)pMat[i][k]=approxSub(pMat[i][k],pRowMeans[k][0])}function lcl_TApplyHouseholderTransformation(pMatA,nR,pMatY,nN){var fDenominator=lcl_TGetColumnSumProduct(pMatA,nR,pMatA,nR,nR,nN); var fNumerator=lcl_TGetColumnSumProduct(pMatA,nR,pMatY,0,nR,nN);var fFactor=2*(fNumerator/fDenominator);for(var col=nR;col<nN;col++)putDouble(pMatY,col,getDouble(pMatY,col)-fFactor*pMatA[col][nR])}function lcl_GetColumnMaximumNorm(pMatA,nC,nR,nN){var fNorm=0;for(var row=nR;row<nN;row++)if(fNorm<Math.abs(pMatA[nC][row]))fNorm=Math.abs(pMatA[nC][row]);return fNorm}function lcl_GetColumnEuclideanNorm(pMatA,nC,nR,nN){var fNorm=0;for(var row=nR;row<nN;row++)fNorm+=pMatA[nC][row]*pMatA[nC][row];return Math.sqrt(fNorm)} function lcl_CalculateQRdecomposition(pMatA,pVecR,nK,nN){for(var col=0;col<nK;col++){var fScale=lcl_GetColumnMaximumNorm(pMatA,col,col,nN);if(fScale===0)return false;for(var row=col;row<nN;row++)pMatA[col][row]=pMatA[col][row]/fScale;var fEuclid=lcl_GetColumnEuclideanNorm(pMatA,col,col,nN);var fFactor=1/fEuclid/(fEuclid+Math.abs(pMatA[col][col]));var fSignum=lcl_GetSign(pMatA[col][col]);pMatA[col][col]=pMatA[col][col]+fSignum*fEuclid;pVecR[col]=-fSignum*fScale*fEuclid;for(var c=col+1;c<nK;c++){var fSum= lcl_GetColumnSumProduct(pMatA,col,pMatA,c,col,nN);for(var row=col;row<nN;row++)pMatA[c][row]=pMatA[c][row]-fSum*fFactor*pMatA[col][row]}}return true}function prepeareGrowthTrendCalculation(t,arg){arg[0]=tryNumberToArray(arg[0]);if(arg[1])arg[1]=tryNumberToArray(arg[1]);if(arg[2])arg[2]=tryNumberToArray(arg[2]);var types=[cElementType.array];if(arg[1]&&arg[1].type!==cElementType.empty)types.push(cElementType.array);if(arg[2]&&arg[2].type!==cElementType.empty)types.push(cElementType.array);var oArguments= t._prepareArguments(arg,arguments[1],true,types);var argClone=oArguments.args;var argError;if(argError=t._checkErrorArg(argClone))return argError;var pMatY=argClone[0];var pMatX=argClone[1];if(pMatX&&!pMatX.length&&pMatX.type===cElementType.empty)pMatX=undefined;var pMatNewX=argClone[2];if(pMatNewX&&pMatNewX.length){var _pMatNewX=[];for(var i=0;i<pMatNewX.length;i++)for(var j=0;j<pMatNewX[i].length;j++){if(!_pMatNewX[j])_pMatNewX[j]=[];_pMatNewX[j][i]=pMatNewX[i][j]}pMatNewX=_pMatNewX}else if(pMatNewX&& pMatNewX.type===cElementType.empty)pMatNewX=undefined;var bConstant=undefined!==argClone[3]?argClone[3].tocBool().toBool():true;return{pMatY:pMatY,pMatX:pMatX,pMatNewX:pMatNewX,bConstant:bConstant}}function CalculateTrendGrowth(pMatY,pMatX,pMatNewX,bConstant,_bGrowth){var getMatrixParams=CheckMatrix(_bGrowth,pMatX,pMatY);if(!getMatrixParams)return;var nCase=getMatrixParams.nCase;var nCX=getMatrixParams.nCX,nCY=getMatrixParams.nCY;var nRX=getMatrixParams.nRX,nRY=getMatrixParams.nRY;var K=getMatrixParams.M, N=getMatrixParams.N;pMatX=getMatrixParams.pMatX;pMatY=getMatrixParams.pMatY;if(bConstant&&N<K+1||!bConstant&&N<K||N<1||K<1)return;var i,j;var nCXN,nRXN;var nCountXN;if(!pMatNewX){nCXN=nCX;nRXN=nRX;nCountXN=nCXN*nRXN;pMatNewX=matrixClone(pMatX)}else{nRXN=pMatNewX[0].length;nCXN=pMatNewX.length;if(nCase===2&&K!==nCXN||nCase===3&&K!==nRXN)return;nCountXN=nCXN*nRXN;for(i=0;i<pMatNewX.length;i++)for(j=0;j<pMatNewX[i].length;j++)if(!pMatNewX[i][j])return false;else pMatNewX[i][j]=pMatNewX[i][j].getValue()}var pResMat; if(nCase===1)pResMat=GetNewMat(nCXN,nRXN);else if(nCase===2)pResMat=GetNewMat(1,nRXN);else pResMat=GetNewMat(nCXN,1);if(!pResMat)return;var fMeanY=0;if(bConstant){var pCopyX=matrixClone(pMatX);var pCopyY=matrixClone(pMatY);if(!pCopyX||!pCopyY)return;pMatX=pCopyX;pMatY=pCopyY;fMeanY=lcl_GetMeanOverAll(pMatY,N);for(i=0;i<pMatY.length;i++)for(j=0;j<pMatY[i].length;j++)pMatY[i][j]=approxSub(pMatY[i][j],fMeanY)}var aVecR,pMeans,pSlopes,bIsSingular,col,fIntercept,row;if(nCase===1){var fMeanX=0;if(bConstant){fMeanX= lcl_GetMeanOverAll(pMatX,N);for(i=0;i<pMatX.length;i++)for(j=0;j<pMatX[i].length;j++)pMatX[i][j]=approxSub(pMatX[i][j],fMeanX)}var fSumXY=lcl_GetSumProduct(pMatX,pMatY,N);var fSumX2=lcl_GetSumProduct(pMatX,pMatX,N);if(fSumX2===0)return;var fSlope=fSumXY/fSumX2;var fHelp;if(bConstant){fIntercept=fMeanY-fSlope*fMeanX;for(i=0;i<pResMat.length;i++)for(j=0;j<pResMat[i].length;j++){fHelp=pMatNewX[i][j]*fSlope+fIntercept;pResMat[i][j]=_bGrowth?Math.exp(fHelp):fHelp}}else for(i=0;i<pResMat.length;i++)for(j= 0;j<pResMat[i].length;j++){fHelp=pMatNewX[i][j]*fSlope;pResMat[i][j]=_bGrowth?Math.exp(fHelp):fHelp}}else if(nCase===2){aVecR=[];pMeans=GetNewMat(K,1);pSlopes=GetNewMat(1,K);if(!pMeans||!pSlopes)return;if(bConstant){lcl_CalculateColumnMeans(pMatX,pMeans,K,N);lcl_CalculateColumnsDelta(pMatX,pMeans,K,N)}if(!lcl_CalculateQRdecomposition(pMatX,aVecR,K,N))return;bIsSingular=false;for(row=0;row<K&&!bIsSingular;row++)bIsSingular=bIsSingular||aVecR[row]===0;if(bIsSingular)return;for(col=0;col<K;col++)lcl_ApplyHouseholderTransformation(pMatX, col,pMatY,N);for(col=0;col<K;col++)putDouble(pSlopes,col,getDouble(pMatY,col));lcl_SolveWithUpperRightTriangle(pMatX,aVecR,pSlopes,K,false);lcl_MFastMult(pMatNewX,pSlopes,pResMat,nRXN,K,1);if(bConstant){fIntercept=fMeanY-lcl_GetSumProduct(pMeans,pSlopes,K);for(row=0;row<nRXN;row++)pResMat[0][row]=pResMat[0][row]+fIntercept}if(_bGrowth)for(i=0;i<nRXN;i++)putDouble(pResMat,i,Math.exp(getDouble(pResMat,i)))}else{aVecR=[];pMeans=GetNewMat(K,1);pSlopes=GetNewMat(K,1);if(!pMeans||!pSlopes)return;if(bConstant){lcl_CalculateRowMeans(pMatX, pMeans,N,K);lcl_CalculateRowsDelta(pMatX,pMeans,N,K)}if(!lcl_TCalculateQRdecomposition(pMatX,aVecR,K,N))return;bIsSingular=false;for(row=0;row<K&&!bIsSingular;row++)bIsSingular=bIsSingular||aVecR[row]===0;if(bIsSingular)return;for(row=0;row<K;row++)lcl_TApplyHouseholderTransformation(pMatX,row,pMatY,N);for(col=0;col<K;col++)putDouble(pSlopes,col,getDouble(pMatY,col));lcl_SolveWithUpperRightTriangle(pMatX,aVecR,pSlopes,K,true);lcl_MFastMult(pSlopes,pMatNewX,pResMat,1,K,nCXN);if(bConstant){fIntercept= fMeanY-lcl_GetSumProduct(pMeans,pSlopes,K);for(col=0;col<nCXN;col++)pResMat[col][0]=pResMat[col][0]+fIntercept}if(_bGrowth)for(i=0;i<nCXN;i++)putDouble(pResMat,i,Math.exp(getDouble(pResMat,i)))}return pResMat}function lcl_ApplyUpperRightTriangle(pMatA,pVecR,pMatB,pMatZ,nK,bIsTransposed){for(var row=0;row<nK;row++){var fSum=pVecR[row]*getDouble(pMatB,row);for(var col=row+1;col<nK;col++)if(bIsTransposed)fSum+=pMatA[row][col]*getDouble(pMatB,col);else fSum+=pMatA[col][row]*getDouble(pMatB,col);putDouble(pMatZ, row,fSum)}}function lcl_SolveWithLowerLeftTriangle(pMatA,pVecR,pMatT,nK,bIsTransposed){for(var row=0;row<nK;row++){var fSum=getDouble(pMatT,row);for(var col=0;col<row;col++)if(bIsTransposed)fSum-=pMatA[col][row]*getDouble(pMatT,col);else fSum-=pMatA[row][col]*getDouble(pMatT,col);putDouble(pMatT,row,fSum/pVecR[row])}}function lcl_GetSSresid(pMatX,pMatY,fSlope,nN){var fSum=0;for(var i=0;i<nN;i++){var fTemp=getDouble(pMatY,i)-fSlope*getDouble(pMatX,i);fSum+=fTemp*fTemp}return fSum}function CalculateRGPRKP(pMatY, pMatX,bConstant,bStats,_bRKP){var getMatrixParams=CheckMatrix(_bRKP,pMatX,pMatY);if(!getMatrixParams)return;var nCase=getMatrixParams.nCase;var nCX=getMatrixParams.nCX,nCY=getMatrixParams.nCY;var nRX=getMatrixParams.nRX,nRY=getMatrixParams.nRY;var K=getMatrixParams.M,N=getMatrixParams.N;pMatX=getMatrixParams.pMatX;pMatY=getMatrixParams.pMatY;var i,j;if(bConstant&&N<K+1||!bConstant&&N<K||N<1||K<1)return;var pResMat;if(bStats)pResMat=GetNewMat(K+1,5);else pResMat=GetNewMat(K+1,1);if(!pResMat)return; if(bStats)for(i=2;i<K+1;i++){pResMat[i][2]=null;pResMat[i][3]=null;pResMat[i][4]=null}var fMeanY=0;if(bConstant){var pNewX=matrixClone(pMatX);var pNewY=matrixClone(pMatY);if(!pNewX||!pNewY)return;pMatX=pNewX;pMatY=pNewY;fMeanY=lcl_GetMeanOverAll(pMatY,N);for(i=0;i<pMatY.length;i++)for(j=0;j<pMatY[i].length;j++)pMatY[i][j]=approxSub(pMatY[i][j],fMeanY)}var fIntercept,fSSreg,fDegreesFreedom,fSSresid,fFstatistic,fRMSE,fSigmaSlope,fSigmaIntercept,fR2;var aVecR,pMeans,pMatZ,pSlopes,bIsSingular,row,col, fPart;if(nCase===1){var fMeanX=0;if(bConstant){fMeanX=lcl_GetMeanOverAll(pMatX,N);for(i=0;i<pMatX.length;i++)for(j=0;j<pMatX[i].length;j++)pMatX[i][j]=approxSub(pMatX[i][j],fMeanX)}var fSumXY=lcl_GetSumProduct(pMatX,pMatY,N);var fSumX2=lcl_GetSumProduct(pMatX,pMatX,N);if(fSumX2===0)return;var fSlope=fSumXY/fSumX2;fIntercept=0;if(bConstant)fIntercept=fMeanY-fSlope*fMeanX;pResMat[1][0]=_bRKP?Math.exp(fIntercept):fIntercept;pResMat[0][0]=_bRKP?Math.exp(fSlope):fSlope;if(bStats){fSSreg=fSlope*fSlope* fSumX2;pResMat[0][4]=fSSreg;fDegreesFreedom=bConstant?N-2:N-1;pResMat[1][3]=fDegreesFreedom;fSSresid=lcl_GetSSresid(pMatX,pMatY,fSlope,N);pResMat[1][4]=fSSresid;if(fDegreesFreedom===0||fSSresid===0||fSSreg===0){pResMat[1][4]=0;pResMat[0][3]=null;pResMat[1][2]=0;pResMat[0][1]=0;if(bConstant)pResMat[1][1]=0;else pResMat[1][1]=null;pResMat[0][2]=1}else{fFstatistic=fSSreg/K/(fSSresid/fDegreesFreedom);pResMat[0][3]=fFstatistic;fRMSE=Math.sqrt(fSSresid/fDegreesFreedom);pResMat[1][2]=fRMSE;fSigmaSlope=fRMSE/ Math.sqrt(fSumX2);pResMat[0][1]=fSigmaSlope;if(bConstant){fSigmaIntercept=fRMSE*Math.sqrt(fMeanX*fMeanX/fSumX2+1/N);pResMat[1][1]=fSigmaIntercept}else pResMat[1][1]=null;fR2=fSSreg/(fSSreg+fSSresid);pResMat[0][2]=fR2}}}else if(nCase===2){aVecR=[];pMeans=GetNewMat(K,1);if(bStats)pMatZ=matrixClone(pMatY);else pMatZ=pMatY;pSlopes=GetNewMat(1,K);if(!pMeans||!pMatZ||!pSlopes)return;if(bConstant){lcl_CalculateColumnMeans(pMatX,pMeans,K,N);lcl_CalculateColumnsDelta(pMatX,pMeans,K,N)}if(!lcl_CalculateQRdecomposition(pMatX, aVecR,K,N))return;bIsSingular=false;for(row=0;row<K&&!bIsSingular;row++)bIsSingular=bIsSingular||aVecR[row]===0;if(bIsSingular)return;for(col=0;col<K;col++)lcl_ApplyHouseholderTransformation(pMatX,col,pMatZ,N);for(col=0;col<K;col++)putDouble(pSlopes,col,getDouble(pMatZ,col));lcl_SolveWithUpperRightTriangle(pMatX,aVecR,pSlopes,K,false);fIntercept=0;if(bConstant)fIntercept=fMeanY-lcl_GetSumProduct(pMeans,pSlopes,K);pResMat[K][0]=_bRKP?Math.exp(fIntercept):fIntercept;for(i=0;i<K;i++)pResMat[K-1-i][0]= _bRKP?Math.exp(getDouble(pSlopes,i)):getDouble(pSlopes,i);if(bStats){fSSreg=0;fSSresid=0;fillDouble(pMatZ,0,0,0,0,N-1);lcl_ApplyUpperRightTriangle(pMatX,aVecR,pSlopes,pMatZ,K,false);for(var colp1=K;colp1>0;colp1--)lcl_ApplyHouseholderTransformation(pMatX,colp1-1,pMatZ,N);fSSreg=lcl_GetSumProduct(pMatZ,pMatZ,N);for(row=0;row<N;row++)putDouble(pMatY,row,getDouble(pMatY,row)-getDouble(pMatZ,row));fSSresid=lcl_GetSumProduct(pMatY,pMatY,N);pResMat[0][4]=fSSreg;pResMat[1][4]=fSSresid;fDegreesFreedom=bConstant? N-K-1:N-K;pResMat[1][3]=fDegreesFreedom;if(fDegreesFreedom===0||fSSresid===0||fSSreg===0){pResMat[1][4]=0;pResMat[0][3]=null;pResMat[1][2]=0;for(i=0;i<K;i++)pResMat[K-1-i][1]=0;if(bConstant)pResMat[K][1]=0;else pResMat[K][1]=null;pResMat[0][2]=1}else{fFstatistic=fSSreg/K/(fSSresid/fDegreesFreedom);pResMat[0][3]=fFstatistic;fRMSE=Math.sqrt(fSSresid/fDegreesFreedom);pResMat[1][2]=fRMSE;fSigmaIntercept=0;for(col=0;col<K;col++){fillDouble(pMatZ,0,0,0,0,K-1);putDouble(pMatZ,col,1);lcl_SolveWithLowerLeftTriangle(pMatX, aVecR,pMatZ,K,false);lcl_SolveWithUpperRightTriangle(pMatX,aVecR,pMatZ,K,false);fSigmaSlope=fRMSE*Math.sqrt(getDouble(pMatZ,col));pResMat[K-1-col][1]=fSigmaSlope;if(bConstant){fPart=lcl_GetSumProduct(pMeans,pMatZ,K);fSigmaIntercept+=fPart*getDouble(pMeans,col)}}if(bConstant){fSigmaIntercept=fRMSE*Math.sqrt(fSigmaIntercept+1/N);pResMat[K][1]=fSigmaIntercept}else pResMat[K][1]=null;fR2=fSSreg/(fSSreg+fSSresid);pResMat[0][2]=fR2}}}else{aVecR=[];pMeans=GetNewMat(1,K);if(bStats)pMatZ=matrixClone(pMatY); else pMatZ=pMatY;pSlopes=GetNewMat(K,1);if(!pMeans||!pMatZ||!pSlopes)return;if(bConstant){lcl_CalculateRowMeans(pMatX,pMeans,N,K);lcl_CalculateRowsDelta(pMatX,pMeans,N,K)}if(!lcl_TCalculateQRdecomposition(pMatX,aVecR,K,N))return;bIsSingular=false;for(row=0;row<K&&!bIsSingular;row++)bIsSingular=bIsSingular||aVecR[row]===0;if(bIsSingular)return;for(row=0;row<K;row++)lcl_TApplyHouseholderTransformation(pMatX,row,pMatZ,N);for(col=0;col<K;col++)pSlopes[col][0]=pMatZ[col][0];lcl_SolveWithUpperRightTriangle(pMatX, aVecR,pSlopes,K,true);fIntercept=0;if(bConstant)fIntercept=fMeanY-lcl_GetSumProduct(pMeans,pSlopes,K);pResMat[K][0]=_bRKP?Math.exp(fIntercept):fIntercept;for(i=0;i<K;i++)pResMat[K-1-i][0]=_bRKP?Math.exp(pSlopes[i][0]):pSlopes[i][0];if(bStats){fSSreg=0;fSSresid=0;lcl_ApplyUpperRightTriangle(pMatX,aVecR,pSlopes,pMatZ,K,true);for(var rowp1=K;rowp1>0;rowp1--)lcl_TApplyHouseholderTransformation(pMatX,rowp1-1,pMatZ,N);fSSreg=lcl_GetSumProduct(pMatZ,pMatZ,N);for(col=0;col<N;col++)pMatY[0][col]=pMatY[0][col]- pMatZ[0][col];fSSresid=lcl_GetSumProduct(pMatY,pMatY,N);pResMat[0][4]=fSSreg;pResMat[1][4]=fSSresid;fDegreesFreedom=bConstant?N-K-1:N-K;pResMat[1][3]=fDegreesFreedom;if(fDegreesFreedom===0||fSSresid===0||fSSreg===0){pResMat[1][4]=0;pResMat[0][3]=null;pResMat[1][2]=0;for(i=0;i<K;i++)pResMat[K-1-i][1]=0;if(bConstant)pResMat[K][1]=0;else pResMat[K][1]=null;pResMat[0][2]=1}else{fFstatistic=fSSreg/K/(fSSresid/fDegreesFreedom);pResMat[0][3]=fFstatistic;fRMSE=Math.sqrt(fSSresid/fDegreesFreedom);pResMat[1][2]= fRMSE;fSigmaIntercept=0;for(row=0;row<K;row++){pMatZ[0][row]=1;lcl_SolveWithLowerLeftTriangle(pMatX,aVecR,pMatZ,K,true);lcl_SolveWithUpperRightTriangle(pMatX,aVecR,pMatZ,K,true);fSigmaSlope=fRMSE*Math.sqrt(pMatZ[0][row]);pResMat[K-1-row][1]=fSigmaSlope;if(bConstant){fPart=lcl_GetSumProduct(pMeans,pMatZ,K);fSigmaIntercept+=fPart*pMeans[0][row]}}if(bConstant){fSigmaIntercept=fRMSE*Math.sqrt(fSigmaIntercept+1/N);pResMat[K][1]=fSigmaIntercept}else pResMat[K][1]=null;fR2=fSSreg/(fSSreg+fSSresid);pResMat[0][2]= fR2}}}return pResMat}function getDouble(matrix,nIndex){var position=calcPosition(matrix,nIndex);return matrix[position.col][position.row]}function putDouble(matrix,nIndex,val){var position=calcPosition(matrix,nIndex);matrix[position.col][position.row]=val}function calcPosition(matrix,nIndex){var rowSize=matrix[0].length;var col=parseInt(rowSize>1?nIndex/rowSize:nIndex);var row=nIndex-col*rowSize;return{row:row,col:col}}function fillDouble(matrix,val,nC1,nR1,nC2,nR2){for(var i=nC1;i<=nC2;i++)for(var j= nR1;j<=nR2;j++)matrix[i][j]=val}function getBoolValue(val,defaultValue){var res=undefined!==defaultValue?defaultValue:null;if(!val)return res;if(cElementType.number===val.type)res=val.tocBool().value;else if(cElementType.bool===val.type)res=val.value;return res}function GAMMADISTFUNCTION(fp,fAlpha,fBeta){this.fp=fp;this.fAlpha=fAlpha;this.fBeta=fBeta}GAMMADISTFUNCTION.prototype.GetValue=function(x){var res;var gammaDistVal=getGammaDist(x,this.fAlpha,this.fBeta);res=this.fp-gammaDistVal;return res}; function BETADISTFUNCTION(fp,fAlpha,fBeta){this.fp=fp;this.fAlpha=fAlpha;this.fBeta=fBeta}BETADISTFUNCTION.prototype.GetValue=function(x){var res;var betaDistVal=getBetaDist(x,this.fAlpha,this.fBeta);res=this.fp-betaDistVal;return res};function CHIDISTFUNCTION(fp,fDF){this.fp=fp;this.fDF=fDF}CHIDISTFUNCTION.prototype.GetValue=function(x){var res;var betaDistVal=getChiDist(x,this.fDF);res=this.fp-betaDistVal;return res};function CHISQDISTFUNCTION(fp,fDF){this.fp=fp;this.fDF=fDF}CHISQDISTFUNCTION.prototype.GetValue= function(x){var res;var betaDistVal=getChiSqDistCDF(x,this.fDF);res=this.fp-betaDistVal;return res};function FDISTFUNCTION(fp,fF1,fF2){this.fp=fp;this.fF1=fF1;this.fF2=fF2}FDISTFUNCTION.prototype.GetValue=function(x){var res;var betaDistVal=getFDist(x,this.fF1,this.fF2);res=this.fp-betaDistVal;return res};function TDISTFUNCTION(fp,fDF,nT){this.fp=fp;this.fDF=fDF;this.nT=nT}TDISTFUNCTION.prototype.GetValue=function(x){var res;var betaDistVal=getTDist(x,this.fDF,this.nT);res=this.fp-betaDistVal;return res}; function ScETSForecastCalculation(nSize){this.maRange=[];this.mpBase=[];this.mpTrend=[];this.mpPerIdx=[];this.mpForecast=[];this.mnSmplInPrd=0;this.mfStepSize=0;this.mfAlpha,this.mfBeta,this.mfGamma;this.mnCount=nSize;this.mbInitialised;this.mnMonthDay;this.mfMAE;this.mfMASE;this.mfMSE;this.mfRMSE;this.mfSMAPE;this.bAdditive;this.bEDS;this.cfMinABCResolution=.001;this.cnScenarios=1E3}ScETSForecastCalculation.prototype=Object.create(ScETSForecastCalculation.prototype);ScETSForecastCalculation.prototype.constructor= ScETSForecastCalculation;ScETSForecastCalculation.prototype.PreprocessDataRange=function(rMatX,rMatY,rSmplInPrd,bDataCompletion,nAggregation,rTMat,eETSType){var nColMatX=rMatX.length;var nRowMatX=rMatX[0].length;var nColMatY=rMatY.length;var nRowMatY=rMatY[0].length;if(nColMatX!==nColMatY||nRowMatX!==nRowMatY&&!checkNumericMatrix(rMatX)||!checkNumericMatrix(rMatY))return new cError(cErrorType.not_available);this.bEDS=rSmplInPrd===0;this.bAdditive=true;this.mnCount=rMatX.length;var maRange=this.maRange; for(var i=0;i<this.mnCount;i++)maRange.push({X:rMatX[i][0].value,Y:rMatY[i][0].value});maRange.sort(function(a,b){return a.X-b.X});if(rTMat)if(true){if(rTMat[0][0].getValue()<maRange[0].X)return new cError(cErrorType.not_numeric)}else if(rTMat[0]<maRange[this.mnCount-1].X)return new cError(cErrorType.wrong_value_type);var aDate=cDate.prototype.getDateFromExcel(maRange[0].X);this.mnMonthDay=aDate.getDate();for(var i=1;i<this.mnCount&&this.mnMonthDay;i++){var aDate1=cDate.prototype.getDateFromExcel(maRange[i].X); if(aDate!==aDate1)if(aDate1.getDate()!==this.mnMonthDay)this.mnMonthDay=0}this.mfStepSize=Number.MAX_VALUE;if(this.mnMonthDay)for(var i=0;i<this.mnCount;i++){var aDate=cDate.prototype.getDateFromExcel(maRange[i].X);maRange[i].X=aDate.getUTCFullYear()*12+aDate.getMonth()}for(var i=1;i<this.mnCount;i++){var fStep=maRange[i].X-maRange[i-1].X;if(fStep===0){if(nAggregation===0)return new cError(cErrorType.wrong_value_type);var fTmp=maRange[i-1].Y;var nCounter=1;switch(nAggregation){case 1:while(i<this.mnCount&& maRange[i].X===maRange[i-1].X){maRange.splice(i,1);--this.mnCount}break;case 7:while(i<this.mnCount&&maRange[i].X===maRange[i-1].X){fTmp+=maRange[i].Y;maRange.splice(i,1);--this.mnCount}maRange[i-1].Y=fTmp;break;case 2:case 3:while(i<this.mnCount&&maRange[i].X===maRange[i-1].X){nCounter++;maRange.splice(i,1);--this.mnCount}maRange[i-1].Y=nCounter;break;case 4:while(i<this.mnCount&&maRange[i].X===maRange[i-1].X){if(maRange[i].Y>fTmp)fTmp=maRange[i].Y;maRange.splice(i,1);--this.mnCount}maRange[i-1].Y= fTmp;break;case 5:var aTmp=[];aTmp.push(maRange[i-1].Y);while(i<this.mnCount&&maRange[i].X===maRange[i-1].X){aTmp.push(maRange[i].Y);nCounter++;maRange.splice(i,1);--this.mnCount}if(nCounter%2)maRange[i-1].Y=aTmp[nCounter/2];else maRange[i-1].Y=(aTmp[nCounter/2]+aTmp[nCounter/2-1])/2;break;case 6:while(i<this.mnCount&&maRange[i].X===maRange[i-1].X){if(maRange[i].Y<fTmp)fTmp=maRange[i].Y;maRange.splice(i,1);--this.mnCount}maRange[i-1].Y=fTmp;break}if(i<this.mnCount-1)fStep=maRange[i].X-maRange[i-1].X; else fStep=this.mfStepSize}if(fStep>0&&fStep<this.mfStepSize)this.mfStepSize=fStep}var bHasGap=false;for(var i=1;i<this.mnCount&&!bHasGap;i++){var fStep=maRange[i].X-maRange[i-1].X;if(fStep!=this.mfStepSize){if(Math.fmod(fStep,this.mfStepSize)!==0)return new cError(cErrorType.wrong_value_type);bHasGap=true}}if(bHasGap){var nMissingXCount=0;var fOriginalCount=this.mnCount;if(this.mnMonthDay)aDate=cDate.prototype.getDateFromExcel(maRange[0].X);for(var i=1;i<this.mnCount;i++){var fDist;if(this.mnMonthDay){var aDate1= cDate.prototype.getDateFromExcel(maRange[i].X);fDist=12*(aDate1.getUTCFullYear()-aDate.getUTCFullYear())+(aDate1.getMonth()-aDate.getMonth());aDate=aDate1}else fDist=maRange[i].X-maRange[i-1].X;if(fDist>this.mfStepSize){var fYGap=(maRange[i].Y+maRange[i-1].Y)/2;for(var fXGap=maRange[i-1].X+this.mfStepSize;fXGap<maRange[i].X;fXGap+=this.mfStepSize){var newAddElem={X:fXGap,Y:bDataCompletion?fYGap:0};maRange.splice(i,1,newAddElem);i++;this.mnCount++;nMissingXCount++;if(nMissingXCount/fOriginalCount> .3)return new cError(cErrorType.wrong_value_type)}}}}if(rSmplInPrd!==1)this.mnSmplInPrd=rSmplInPrd;else{this.mnSmplInPrd=this.CalcPeriodLen();if(this.mnSmplInPrd===1)this.bEDS=true}if(!this.initData())return false;return true};ScETSForecastCalculation.prototype.initData=function(){this.mpBase=[];fillArray(this.mpBase,0,this.mnCount);this.mpTrend=[];fillArray(this.mpTrend,0,this.mnCount);if(!this.bEDS){this.mpPerIdx=[];fillArray(this.mpPerIdx,0,this.mnCount)}this.mpForecast=[];fillArray(this.mpForecast, 0,this.mnCount);this.mpForecast[0]=this.maRange[0].Y;if(this.prefillTrendData())if(this.prefillPerIdx())if(this.prefillBaseData())return true;return false};ScETSForecastCalculation.prototype.prefillTrendData=function(){if(this.bEDS)this.mpTrend[0]=(this.maRange[this.mnCount-1].Y-this.maRange[0].Y)/(this.mnCount-1);else{if(this.mnCount<2*this.mnSmplInPrd)return new cError(cErrorType.wrong_value_type);var fSum=0;for(var i=0;i<this.mnSmplInPrd;i++)fSum+=this.maRange[i+this.mnSmplInPrd].Y-this.maRange[i].Y; var fTrend=fSum/(this.mnSmplInPrd*this.mnSmplInPrd);this.mpTrend[0]=fTrend}return true};ScETSForecastCalculation.prototype.prefillPerIdx=function(){if(!this.bEDS){if(this.mnSmplInPrd==0)return false;var nPeriods=parseInt(this.mnCount/this.mnSmplInPrd);var aPeriodAverage=[];for(var i=0;i<nPeriods;i++){aPeriodAverage[i]=0;for(var j=0;j<this.mnSmplInPrd;j++)aPeriodAverage[i]+=this.maRange[i*this.mnSmplInPrd+j].Y;aPeriodAverage[i]/=this.mnSmplInPrd;if(aPeriodAverage[i]===0)return false}for(var j=0;j< this.mnSmplInPrd;j++){var fI=0;for(var i=0;i<nPeriods;i++)if(this.bAdditive)fI+=this.maRange[i*this.mnSmplInPrd+j].Y-(aPeriodAverage[i]+(j-.5*(this.mnSmplInPrd-1))*this.mpTrend[0]);else fI+=this.maRange[i*this.mnSmplInPrd+j].Y/(aPeriodAverage[i]+(j-.5*(this.mnSmplInPrd-1))*this.mpTrend[0]);this.mpPerIdx[j]=fI/nPeriods}}return true};ScETSForecastCalculation.prototype.randDev=function(){return this.mfRMSE*gaussinv(.5742633193606865)};ScETSForecastCalculation.prototype.prefillBaseData=function(){if(this.bEDS)this.mpBase[0]= this.maRange[0].Y;else this.mpBase[0]=this.maRange[0].Y/this.mpPerIdx[0];return true};ScETSForecastCalculation.prototype.initCalc=function(){if(!this.mbInitialised){this.CalcAlphaBetaGamma();this.mbInitialised=true;this.calcAccuracyIndicators()}return true};ScETSForecastCalculation.prototype.calcAccuracyIndicators=function(){var fSumAbsErr=0;var fSumDivisor=0;var fSumErrSq=0;var fSumAbsPercErr=0;for(var i=1;i<this.mnCount;i++){var fError=this.mpForecast[i]-this.maRange[i].Y;fSumAbsErr+=Math.abs(fError); fSumErrSq+=fError*fError;fSumAbsPercErr+=Math.abs(fError)/(Math.abs(this.mpForecast[i])+Math.abs(this.maRange[i].Y))}for(var i=2;i<this.mnCount;i++)fSumDivisor+=Math.abs(this.maRange[i].Y-this.maRange[i-1].Y);var nCalcCount=this.mnCount-1;this.mfMAE=fSumAbsErr/nCalcCount;this.mfMASE=fSumAbsErr/(nCalcCount*fSumDivisor/(nCalcCount-1));this.mfMSE=fSumErrSq/nCalcCount;this.mfRMSE=Math.sqrt(this.mfMSE);this.mfSMAPE=fSumAbsPercErr*2/nCalcCount};ScETSForecastCalculation.prototype.CalcPeriodLen=function(){var nBestVal= this.mnCount;var fBestME=Number.MAX_VALUE;var maRange=this.maRange;for(var nPeriodLen=parseInt(this.mnCount/2);nPeriodLen>=1;nPeriodLen--){var fMeanError=0;var nPeriods=parseInt(this.mnCount/nPeriodLen);var nStart=parseInt(this.mnCount-nPeriods*nPeriodLen+1);for(var i=nStart;i<this.mnCount-nPeriodLen;i++)fMeanError+=Math.abs(maRange[i].Y-maRange[i-1].Y-(maRange[nPeriodLen+i].Y-maRange[nPeriodLen+i-1].Y));fMeanError/=(nPeriods-1)*nPeriodLen-1;if(fMeanError<=fBestME||fMeanError===0){nBestVal=nPeriodLen; fBestME=fMeanError}}return nBestVal};ScETSForecastCalculation.prototype.CalcAlphaBetaGamma=function(){var f0=0;this.mfAlpha=f0;if(this.bEDS){this.mfBeta=0;this.CalcGamma()}else this.CalcBetaGamma();this.refill();var fE0=this.mfMSE;var f2=1;this.mfAlpha=f2;if(this.bEDS)this.CalcGamma();else this.CalcBetaGamma();this.refill();var fE2=this.mfMSE;var f1=.5;this.mfAlpha=f1;if(this.bEDS)this.CalcGamma();else this.CalcBetaGamma();this.refill();if(fE0===this.mfMSE&&this.mfMSE===fE2){this.mfAlpha=0;if(this.bEDS)this.CalcGamma(); else this.CalcBetaGamma();this.refill();return}while(f2-f1>this.cfMinABCResolution){if(fE2>fE0){f2=f1;fE2=this.mfMSE;f1=(f0+f1)/2}else{f0=f1;fE0=this.mfMSE;f1=(f1+f2)/2}this.mfAlpha=f1;if(this.bEDS)this.CalcGamma();else this.CalcBetaGamma();this.refill()}if(fE2>fE0){if(fE0<this.mfMSE){this.mfAlpha=f0;if(this.bEDS)this.CalcGamma();else this.CalcBetaGamma();this.refill()}}else if(fE2<this.mfMSE){this.mfAlpha=f2;if(this.bEDS)this.CalcGamma();else this.CalcBetaGamma();this.refill()}this.calcAccuracyIndicators()}; ScETSForecastCalculation.prototype.CalcBetaGamma=function(){var f0=0;this.mfBeta=f0;this.CalcGamma();this.refill();var fE0=this.mfMSE;var f2=1;this.mfBeta=f2;this.CalcGamma();this.refill();var fE2=this.mfMSE;var f1=.5;this.mfBeta=f1;this.CalcGamma();this.refill();if(fE0===this.mfMSE&&this.mfMSE===fE2){this.mfBeta=0;this.CalcGamma();this.refill();return}while(f2-f1>this.cfMinABCResolution){if(fE2>fE0){f2=f1;fE2=this.mfMSE;f1=(f0+f1)/2}else{f0=f1;fE0=this.mfMSE;f1=(f1+f2)/2}this.mfBeta=f1;this.CalcGamma(); this.refill()}if(fE2>fE0){if(fE0<this.mfMSE){this.mfBeta=f0;this.CalcGamma();this.refill()}}else if(fE2<this.mfMSE){this.mfBeta=f2;this.CalcGamma();this.refill()}};ScETSForecastCalculation.prototype.CalcGamma=function(){var f0=0;this.mfGamma=f0;this.refill();var fE0=this.mfMSE;var f2=1;this.mfGamma=f2;this.refill();var fE2=this.mfMSE;var f1=.5;this.mfGamma=f1;this.refill();if(fE0===this.mfMSE&&this.mfMSE===fE2){this.mfGamma=0;this.refill();return}while(f2-f1>this.cfMinABCResolution){if(fE2>fE0){f2= f1;fE2=this.mfMSE;f1=(f0+f1)/2}else{f0=f1;fE0=this.mfMSE;f1=(f1+f2)/2}this.mfGamma=f1;this.refill()}if(fE2>fE0){if(fE0<this.mfMSE){this.mfGamma=f0;this.refill()}}else if(fE2<this.mfMSE){this.mfGamma=f2;this.refill()}};ScETSForecastCalculation.prototype.refill=function(){for(var i=1;i<this.mnCount;i++)if(this.bEDS){this.mpBase[i]=this.mfAlpha*this.maRange[i].Y+(1-this.mfAlpha)*(this.mpBase[i-1]+this.mpTrend[i-1]);this.mpTrend[i]=this.mfGamma*(this.mpBase[i]-this.mpBase[i-1])+(1-this.mfGamma)*this.mpTrend[i- 1];this.mpForecast[i]=this.mpBase[i-1]+this.mpTrend[i-1]}else{var nIdx;if(this.bAdditive){nIdx=i>this.mnSmplInPrd?i-this.mnSmplInPrd:i;this.mpBase[i]=this.mfAlpha*(this.maRange[i].Y-this.mpPerIdx[nIdx])+(1-this.mfAlpha)*(this.mpBase[i-1]+this.mpTrend[i-1]);this.mpPerIdx[i]=this.mfBeta*(this.maRange[i].Y-this.mpBase[i])+(1-this.mfBeta)*this.mpPerIdx[nIdx]}else{nIdx=i>=this.mnSmplInPrd?i-this.mnSmplInPrd:i;this.mpBase[i]=this.mfAlpha*(this.maRange[i].Y/this.mpPerIdx[nIdx])+(1-this.mfAlpha)*(this.mpBase[i- 1]+this.mpTrend[i-1]);this.mpPerIdx[i]=this.mfBeta*(this.maRange[i].Y/this.mpBase[i])+(1-this.mfBeta)*this.mpPerIdx[this.nIdx]}this.mpTrend[i]=this.mfGamma*(this.mpBase[i]-this.mpBase[i-1])+(1-this.mfGamma)*this.mpTrend[i-1];if(this.bAdditive)this.mpForecast[i]=this.mpBase[i-1]+this.mpTrend[i-1]+this.mpPerIdx[nIdx];else this.mpForecast[i]=(this.mpBase[i-1]+this.mpTrend[i-1])*this.mpPerIdx[nIdx]}this.calcAccuracyIndicators()};ScETSForecastCalculation.prototype.convertXtoMonths=function(x){var aDate= cDate.prototype.getDateFromExcel(x);var nYear=aDate.getUTCFullYear();var nMonth=aDate.getMonth();var fMonthLength;switch(nMonth){case 1:case 3:case 5:case 7:case 8:case 10:case 12:fMonthLength=31;break;case 2:fMonthLength=aDate.isLeapYear()?29:28;break;default:fMonthLength=30}return 12*nYear+nMonth+(aDate.getDate()-this.mnMonthDay)/fMonthLength};ScETSForecastCalculation.prototype.GetForecast=function(fTarget,rForecast){if(!this.initCalc())return false;if(fTarget<=this.maRange[this.mnCount-1].X){var n= (fTarget-this.maRange[0].X)/this.mfStepSize;var fInterpolate=Math.fmod(fTarget-this.maRange[0].X,this.mfStepSize);rForecast=this.maRange[n].Y;if(fInterpolate>=this.cfMinABCResolution){var fInterpolateFactor=fInterpolate/this.mfStepSize;var fFc_1=this.mpForecast[n+1];rForecast=rForecast+fInterpolateFactor*(fFc_1-rForecast)}}else{var n=Math.round((fTarget-this.maRange[this.mnCount-1].X)/this.mfStepSize);var fInterpolate=parseInt(Math.fmod(fTarget-this.maRange[this.mnCount-1].X,this.mfStepSize));if(this.bEDS)rForecast= this.mpBase[this.mnCount-1]+n*this.mpTrend[this.mnCount-1];else if(this.bAdditive)rForecast=this.mpBase[this.mnCount-1]+n*this.mpTrend[this.mnCount-1]+this.mpPerIdx[this.mnCount-1-this.mnSmplInPrd+n%this.mnSmplInPrd];else rForecast=(this.mpBase[this.mnCount-1]+n*this.mpTrend[this.mnCount-1])*this.mpPerIdx[this.mnCount-1-this.mnSmplInPrd+n%this.mnSmplInPrd];if(fInterpolate>=this.cfMinABCResolution){var fInterpolateFactor=fInterpolate/this.mfStepSize;var fFc_1;if(this.bEDS)fFc_1=this.mpBase[this.mnCount- 1]+(n+1)*this.mpTrend[this.mnCount-1];else if(this.bAdditive)fFc_1=this.mpBase[this.mnCount-1]+(n+1)*this.mpTrend[this.mnCount-1]+this.mpPerIdx[this.mnCount-1-this.mnSmplInPrd+(n+1)%this.mnSmplInPrd];else fFc_1=(this.mpBase[this.mnCount-1]+(n+1)*this.mpTrend[this.mnCount-1])*this.mpPerIdx[this.mnCount-1-this.mnSmplInPrd+(n+1)%this.mnSmplInPrd];rForecast=rForecast+fInterpolateFactor*(fFc_1-rForecast)}}return rForecast};ScETSForecastCalculation.prototype.GetForecastRange=function(rTMat){var nC=rTMat.length, nR=rTMat[0].length;var rFcMat=[];for(var i=0;i<nR;i++)for(var j=0;j<nC;j++){var fTarget;if(this.mnMonthDay)fTarget=this.convertXtoMonths(rTMat[j][i].getValue());else fTarget=rTMat[j][i].getValue();var fForecast;if(fForecast=this.GetForecast(fTarget)){if(!rFcMat[j])rFcMat[j]=[];rFcMat[j][i]=fForecast}else return false}return rFcMat};ScETSForecastCalculation.prototype.GetStatisticValue=function(rTypeMat){if(!this.initCalc())return false;var nC=rTypeMat.length,nR=rTypeMat[0].length;var rStatMat=[];for(var i= 0;i<nR;i++)for(var j=0;j<nC;j++){if(!rStatMat[j])rStatMat[j]=[];switch(rTypeMat[j][i].getValue()){case 1:rStatMat[j][i]=this.mfAlpha;break;case 2:rStatMat[j][i]=this.mfGamma;break;case 3:rStatMat[j][i]=this.mfBeta;break;case 4:rStatMat[j][i]=this.mfMASE;break;case 5:rStatMat[j][i]=this.mfSMAPE;break;case 6:rStatMat[j][i]=this.mfMAE;break;case 7:rStatMat[j][i]=this.mfRMSE;break;case 8:rStatMat[j][i]=this.mfStepSize;break;case 9:rStatMat[j][i]=this.mnSmplInPrd;break}}return rStatMat};ScETSForecastCalculation.prototype.GetETSPredictionIntervals= function(rTMat,fPILevel){if(!this.initCalc())return false;var rPIMat=null;var nC=rTMat.length,nR=rTMat[0].length;var fMaxTarget=rTMat[0][0].value;for(var i=0;i<nR;i++)for(var j=0;j<nC;j++)if(fMaxTarget<rTMat[j][i].value)fMaxTarget=rTMat[j][i].value;if(this.mnMonthDay)fMaxTarget=this.convertXtoMonths(fMaxTarget)-this.maRange[this.mnCount-1].X;else fMaxTarget-=this.maRange[this.mnCount-1].X;var nSize=fMaxTarget/this.mfStepSize;if(Math.fmod(fMaxTarget,this.mfStepSize)!==0)nSize++;var xScenRange=[];var xScenBase= [];var xScenTrend=[];var xScenPerIdx=[];var aPredictions=[];for(var k=0;k<this.cnScenarios;k++)if(this.bAdditive){xScenRange[0]=this.mpBase[this.mnCount-1]+this.mpTrend[this.mnCount-1]+this.mpPerIdx[this.mnCount-this.mnSmplInPrd]+this.randDev();if(!aPredictions[0])aPredictions[0]=[];aPredictions[0][k]=xScenRange[0];xScenBase[0]=this.mfAlpha*(xScenRange[0]-this.mpPerIdx[this.mnCount-this.mnSmplInPrd])+(1-this.mfAlpha)*(this.mpBase[this.mnCount-1]+this.mpTrend[this.mnCount-1]);xScenTrend[0]=this.mfGamma* (xScenBase[0]-this.mpBase[this.mnCount-1])+(1-this.mfGamma)*this.mpTrend[this.mnCount-1];xScenPerIdx[0]=this.mfBeta*(xScenRange[0]-xScenBase[0])+(1-this.mfBeta)*this.mpPerIdx[this.mnCount-this.mnSmplInPrd];for(var i=1;i<nSize;i++){var fPerIdx;if(i<this.mnSmplInPrd)fPerIdx=this.mpPerIdx[this.mnCount+i-this.mnSmplInPrd];else fPerIdx=xScenPerIdx[i-this.mnSmplInPrd];xScenRange[i]=xScenBase[i-1]+xScenTrend[i-1]+fPerIdx+this.randDev();if(!aPredictions[i])aPredictions[i]=[];aPredictions[i][k]=xScenRange[i]; xScenBase[i]=this.mfAlpha*(xScenRange[i]-fPerIdx)+(1-this.mfAlpha)*(xScenBase[i-1]+xScenTrend[i-1]);xScenTrend[i]=this.mfGamma*(xScenBase[i]-xScenBase[i-1])+(1-this.mfGamma)*xScenTrend[i-1];xScenPerIdx[i]=this.mfBeta*(xScenRange[i]-xScenBase[i])+(1-this.mfBeta)*fPerIdx}}else{xScenRange[0]=(this.mpBase[this.mnCount-1]+this.mpTrend[this.mnCount-1])*this.mpPerIdx[this.mnCount-this.mnSmplInPrd]+this.randDev();if(!aPredictions[0])aPredictions[0]=[];aPredictions[0][k]=xScenRange[0];xScenBase[0]=this.mfAlpha* (xScenRange[0]/this.mpPerIdx[this.mnCount-this.mnSmplInPrd])+(1-this.mfAlpha)*(this.mpBase[this.mnCount-1]+this.mpTrend[this.mnCount-1]);xScenTrend[0]=this.mfGamma*(xScenBase[0]-this.mpBase[this.mnCount-1])+(1-this.mfGamma)*this.mpTrend[this.mnCount-1];xScenPerIdx[0]=this.mfBeta*(xScenRange[0]/xScenBase[0])+(1-this.mfBeta)*this.mpPerIdx[this.mnCount-this.mnSmplInPrd];for(var i=1;i<nSize;i++){var fPerIdx;if(i<this.mnSmplInPrd)fPerIdx=this.mpPerIdx[this.mnCount+i-this.mnSmplInPrd];else fPerIdx=xScenPerIdx[i- this.mnSmplInPrd];xScenRange[i]=(xScenBase[i-1]+xScenTrend[i-1])*fPerIdx+this.randDev();if(!aPredictions[i])aPredictions[i]=[];aPredictions[i][k]=xScenRange[i];xScenBase[i]=this.mfAlpha*(xScenRange[i]/fPerIdx)+(1-this.mfAlpha)*(xScenBase[i-1]+xScenTrend[i-1]);xScenTrend[i]=this.mfGamma*(xScenBase[i]-xScenBase[i-1])+(1-this.mfGamma)*xScenTrend[i-1];xScenPerIdx[i]=this.mfBeta*(xScenRange[i]/xScenBase[i])+(1-this.mfBeta)*fPerIdx}}var xPercentile=[];for(var i=0;i<nSize;i++)xPercentile[i]=getPercentile(aPredictions[i], (1+fPILevel)/2)-getPercentile(aPredictions[i],.5);for(var i=0;i<nR;i++)for(var j=0;j<nC;j++){var fTarget;if(this.mnMonthDay)fTarget=this.convertXtoMonths(rTMat[j][i].value)-this.maRange[this.mnCount-1].X;else fTarget=rTMat[j][i].value-this.maRange[this.mnCount-1].X;var nSteps=fTarget/this.mfStepSize-1;var fFactor=Math.fmod(fTarget,this.mfStepSize);var fPI=xPercentile[nSteps];if(fFactor!=0){var fPI1=xPercentile[nSteps+1];fPI=fPI+fFactor*(fPI1-fPI)}if(!rPIMat)rPIMat=[];if(!rPIMat[j])rPIMat[j]=[];rPIMat[j][i]= fPI}return rPIMat};ScETSForecastCalculation.prototype.GetEDSPredictionIntervals=function(rTMat,fPILevel){if(!this.initCalc())return false;var rPIMat=null;var nC=rTMat.length,nR=rTMat[0].length;var fMaxTarget=rTMat[0][0];for(var i=0;i<nR;i++)for(var j=0;j<nC;j++)if(fMaxTarget<rTMat[j][i])fMaxTarget=rTMat[j][i];if(this.mnMonthDay)fMaxTarget=this.convertXtoMonths(fMaxTarget)-this.maRange[this.mnCount-1].X;else fMaxTarget-=this.maRange[this.mnCount-1].X;var nSize=fMaxTarget/this.mfStepSize;if(Math.fmod(fMaxTarget, this.mfStepSize)!==0)nSize++;var z=gaussinv((1+fPILevel)/2);var o=1-fPILevel;var c=[];for(var i=0;i<nSize;i++)c[i]=Math.sqrt(1+fPILevel/Math.pow(1+o,3)*(1+4*o+5*o*o+2*i*fPILevel*(1+3*o)+2*(i*i)*fPILevel*fPILevel));for(var i=0;i<nR;i++)for(var j=0;j<nC;j++){var fTarget;if(this.mnMonthDay)fTarget=this.convertXtoMonths(rTMat[j][i])-this.maRange[this.mnCount-1].X;else fTarget=rTMat[j][i]-this.maRange[this.mnCount-1].X;var nSteps=fTarget/this.mfStepSize-1;var fFactor=Math.fmod(fTarget,this.mfStepSize); var fPI=z*this.mfRMSE*c[nSteps]/c[0];if(fFactor!==0){var fPI1=z*this.mfRMSE*c[nSteps+1]/c[0];fPI=fPI+fFactor*(fPI1-fPI)}if(!rPIMat)rPIMat=[];if(!rPIMat[j])rPIMat[j]=[];rPIMat[j][i]=fPI}return rPIMat};function checkNumericMatrix(matrix){if(!matrix)return false;for(var i=0;i<matrix.length;i++)for(var j=0;j<matrix[i].length;j++){var type=matrix[i][j].type;if(!(cElementType.number===type||cElementType.bool===type))return false}return true}function fillArray(array,val,length){for(var i=0;i<length-1;i++)array[i]= val}function tryNumberToArray(arg){if(arg){var tempNumber;if(cElementType.number===arg.type){tempNumber=arg;arg=new cArray;arg.addElement(tempNumber)}else if(cElementType.cell===arg.type||cElementType.cell3D===arg.type){tempNumber=arg.getValue();arg=new cArray;arg.addElement(tempNumber)}}return arg}function cAVEDEV(){}cAVEDEV.prototype=Object.create(cBaseFunction.prototype);cAVEDEV.prototype.constructor=cAVEDEV;cAVEDEV.prototype.name="AVEDEV";cAVEDEV.prototype.argumentsMin=1;cAVEDEV.prototype.returnValueType= AscCommonExcel.cReturnFormulaType.array;cAVEDEV.prototype.argumentsType=[[argType.number]];cAVEDEV.prototype.Calculate=function(arg){var count=0,sum=new cNumber(0),arrX=[],i;for(i=0;i<arg.length;i++){var _arg=arg[i];if(_arg instanceof cRef||_arg instanceof cRef3D){var _argV=_arg.getValue();if(_argV instanceof cNumber){arrX.push(_argV);count++}}else if(_arg instanceof cArea||_arg instanceof cArea3D){var _argAreaValue=_arg.getValue();for(var j=0;j<_argAreaValue.length;j++){var __arg=_argAreaValue[j]; if(__arg instanceof cNumber){arrX.push(__arg);count++}}}else if(_arg instanceof cArray)_arg.foreach(function(elem){var e=elem.tocNumber();if(e instanceof cNumber){arrX.push(e);count++}});else{if(_arg instanceof cError)continue;arrX.push(_arg);count++}}for(i=0;i<arrX.length;i++)sum=_func[sum.type][arrX[i].type](sum,arrX[i],"+");sum=new cNumber(sum.getValue()/count);var a=0;for(i=0;i<arrX.length;i++)a+=Math.abs(_func[sum.type][arrX[i].type](sum,arrX[i],"-").getValue());return new cNumber(a/count)}; function cAVERAGE(){}cAVERAGE.prototype=Object.create(cBaseFunction.prototype);cAVERAGE.prototype.constructor=cAVERAGE;cAVERAGE.prototype.name="AVERAGE";cAVERAGE.prototype.argumentsMin=1;cAVERAGE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cAVERAGE.prototype.inheritFormat=true;cAVERAGE.prototype.argumentsType=[[argType.number]];cAVERAGE.prototype.Calculate=function(arg){var count=0,sum=new cNumber(0);for(var i=0;i<arg.length;i++){var _arg=arg[i];if(cElementType.cell===_arg.type|| cElementType.cell3D===_arg.type){if(!this.checkExclude||!_arg.isHidden(this.excludeHiddenRows)){var _argV=_arg.getValue();if(cElementType.string===_argV.type||cElementType.empty===_argV.type||cElementType.bool===_argV.type)continue;else if(cElementType.number===_argV.type){sum=_func[sum.type][_argV.type](sum,_argV,"+");count++}else if(cElementType.error===_argV.type)return _argV}}else if(cElementType.cellsRange===_arg.type||cElementType.cellsRange3D===_arg.type){var _argAreaValue=_arg.getValue(this.checkExclude, this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);for(var j=0;j<_argAreaValue.length;j++){var __arg=_argAreaValue[j];if(cElementType.string===__arg.type||cElementType.empty===__arg.type||cElementType.bool===__arg.type)continue;else if(cElementType.number===__arg.type){sum=_func[sum.type][__arg.type](sum,__arg,"+");count++}else if(cElementType.error===__arg.type)return __arg}}else if(cElementType.array===_arg.type)_arg.foreach(function(elem){if(cElementType.string===elem.type||cElementType.empty=== elem.type||cElementType.bool===elem.type)return false;var e=elem.tocNumber();if(cElementType.number===e.type){sum=_func[sum.type][e.type](sum,e,"+");count++}});else{_arg=_arg.tocNumber();if(cElementType.error===_arg.type)return _arg;sum=_func[sum.type][_arg.type](sum,_arg,"+");count++}}return new cNumber(sum.getValue()/count)};function cAVERAGEA(){}cAVERAGEA.prototype=Object.create(cBaseFunction.prototype);cAVERAGEA.prototype.constructor=cAVERAGEA;cAVERAGEA.prototype.name="AVERAGEA";cAVERAGEA.prototype.argumentsMin= 1;cAVERAGEA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cAVERAGEA.prototype.argumentsType=[[argType.number]];cAVERAGEA.prototype.Calculate=function(arg){var count=0,sum=new cNumber(0);for(var i=0;i<arg.length;i++){var _arg=arg[i];if(cElementType.cell===_arg.type||cElementType.cell3D===_arg.type){var _argV=_arg.getValue();if(cElementType.number===_argV.type||cElementType.bool===_argV.type){sum=_func[sum.type][_argV.type](sum,_argV,"+");count++}else if(cElementType.string===_argV.type)count++}else if(cElementType.cellsRange=== _arg.type||cElementType.cellsRange3D===_arg.type){var _argAreaValue=_arg.getValue();for(var j=0;j<_argAreaValue.length;j++){var __arg=_argAreaValue[j];if(cElementType.number===__arg.type||cElementType.bool===__arg.type){sum=_func[sum.type][__arg.type](sum,__arg,"+");count++}else if(cElementType.string===__arg.type)count++}}else if(cElementType.array===_arg.type)_arg.foreach(function(elem){if(cElementType.string===elem.type||cElementType.empty===elem.type)return false;var e=elem.tocNumber();if(cElementType.number=== e.type){sum=_func[sum.type][e.type](sum,e,"+");count++}});else{_arg=_arg.tocNumber();if(cElementType.error===_arg.type)return _arg;sum=_func[sum.type][_arg.type](sum,_arg,"+");count++}}return new cNumber(sum.getValue()/count)};function cAVERAGEIF(){}cAVERAGEIF.prototype=Object.create(cBaseFunction.prototype);cAVERAGEIF.prototype.constructor=cAVERAGEIF;cAVERAGEIF.prototype.name="AVERAGEIF";cAVERAGEIF.prototype.argumentsMin=2;cAVERAGEIF.prototype.argumentsMax=3;cAVERAGEIF.prototype.arrayIndexes={0:1, 2:1};cAVERAGEIF.prototype.argumentsType=[argType.reference,argType.any,argType.reference];cAVERAGEIF.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2]?arg[2]:arg[0],_sum=0,_count=0,matchingInfo,ws;if(cElementType.cell!==arg0.type&&cElementType.cell3D!==arg0.type&&cElementType.cellsRange!==arg0.type||cElementType.cell!==arg2.type&&cElementType.cell3D!==arg2.type&&cElementType.cellsRange!==arg2.type)return new cError(cErrorType.wrong_value_type);if(cElementType.cellsRange=== arg1.type||cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.array===arg1.type)arg1=arg1.getElementRowCol(0,0);arg1=arg1.tocString();if(cElementType.string!==arg1.type)return new cError(cErrorType.wrong_value_type);var r=arg0.getRange();var r2=arg2.getRange();ws=arg0.getWS();matchingInfo=AscCommonExcel.matchingValue(arg1);if(cElementType.cellsRange===arg0.type)arg0.foreach2(function(v,cell){if(matching(v,matchingInfo)){var offset=cell.getOffset3(r.bbox.c1+1, r.bbox.r1+1);r2.setOffset(offset);var val;ws._getCellNoEmpty(r2.bbox.r1,r2.bbox.c1,function(cell){val=checkTypeCell(cell)});offset.col*=-1;offset.row*=-1;r2.setOffset(offset);if(cElementType.number===val.type){_sum+=val.getValue();_count++}}});else if(matching(arg0.getValue(),matchingInfo)){var val;ws._getCellNoEmpty(r.bbox.r1,r2.bbox.c1,function(cell){val=checkTypeCell(cell)});if(cElementType.number===val.type){_sum+=val.getValue();_count++}}if(0===_count)return new cError(cErrorType.division_by_zero); else return new cNumber(_sum/_count)};function cAVERAGEIFS(){}cAVERAGEIFS.prototype=Object.create(cBaseFunction.prototype);cAVERAGEIFS.prototype.constructor=cAVERAGEIFS;cAVERAGEIFS.prototype.name="AVERAGEIFS";cAVERAGEIFS.prototype.argumentsMin=3;cAVERAGEIFS.prototype.arrayIndexes={0:1,1:1,3:1,5:1,7:1,9:1};cAVERAGEIFS.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.area_to_ref;cAVERAGEIFS.prototype.argumentsType=[argType.reference,[argType.reference,argType.any]];cAVERAGEIFS.prototype.Calculate= function(arg){var arg0=arg[0];if(cElementType.cell!==arg0.type&&cElementType.cell3D!==arg0.type&&cElementType.cellsRange!==arg0.type&&cElementType.cellsRange3D!==arg0.type)return new cError(cErrorType.wrong_value_type);var arg0Matrix=arg0.getMatrix();var i,j,arg1,arg2,matchingInfo;for(var k=1;k<arg.length;k+=2){arg1=arg[k];arg2=arg[k+1];if(cElementType.cell!==arg1.type&&cElementType.cell3D!==arg1.type&&cElementType.cellsRange!==arg1.type&&cElementType.cellsRange3D!==arg1.type)return new cError(cErrorType.wrong_value_type); if(cElementType.cellsRange===arg2.type||cElementType.cellsRange3D===arg2.type)arg2=arg2.cross(arguments[1]);else if(cElementType.array===arg2.type)arg2=arg2.getElementRowCol(0,0);arg2=arg2.tocString();if(cElementType.string!==arg2.type)return new cError(cErrorType.wrong_value_type);matchingInfo=AscCommonExcel.matchingValue(arg2);var arg1Matrix=arg1.getMatrix();if(arg0Matrix.length!==arg1Matrix.length)return new cError(cErrorType.wrong_value_type);for(i=0;i<arg1Matrix.length;++i){if(arg0Matrix[i].length!== arg1Matrix[i].length)return new cError(cErrorType.wrong_value_type);for(j=0;j<arg1Matrix[i].length;++j){var arg1Val=arg1Matrix[i][j]&&arg1Matrix[i][j][0]?arg1Matrix[i][j][0]:arg1Matrix[i][j];if(arg0Matrix[i][j]&&!AscCommonExcel.matching(arg1Val,matchingInfo))arg0Matrix[i][j]=null}}}var _sum=0,_count=0;var valMatrix0;for(i=0;i<arg0Matrix.length;++i)for(j=0;j<arg0Matrix[i].length;++j){valMatrix0=arg0Matrix[i][j]&&arg0Matrix[i][j][0]?arg0Matrix[i][j][0]:arg0Matrix[i][j];if(valMatrix0&&cElementType.number=== valMatrix0.type){_sum+=valMatrix0.getValue();++_count}}if(0===_count)return new cError(cErrorType.division_by_zero);else return new cNumber(_sum/_count)};cAVERAGEIFS.prototype.checkArguments=function(countArguments){return 1===countArguments%2&&cBaseFunction.prototype.checkArguments.apply(this,arguments)};function cBETADIST(){}cBETADIST.prototype=Object.create(cBaseFunction.prototype);cBETADIST.prototype.constructor=cBETADIST;cBETADIST.prototype.name="BETADIST";cBETADIST.prototype.argumentsMin=3; cBETADIST.prototype.argumentsMax=5;cBETADIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number];cBETADIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3]?argClone[3].tocNumber():new cNumber(0);argClone[4]=argClone[4]?argClone[4].tocNumber():new cNumber(1); var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcBeta=function(argArray){var x=argArray[0];var alpha=argArray[1];var beta=argArray[2];var fLowerBound=argArray[3];var fUpperBound=argArray[4];var fScale=fUpperBound-fLowerBound;if(fScale<=0||alpha<=0||beta<=0)return new cError(cErrorType.not_numeric);var res=null;if(x<fLowerBound)res=0;else if(x>fUpperBound)res=1;else{x=(x-fLowerBound)/fScale;res=getBetaDist(x,alpha,beta)}return null!==res&&!isNaN(res)?new cNumber(res): new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcBeta)};function cBETA_DIST(){}cBETA_DIST.prototype=Object.create(cBaseFunction.prototype);cBETA_DIST.prototype.constructor=cBETA_DIST;cBETA_DIST.prototype.name="BETA.DIST";cBETA_DIST.prototype.argumentsMin=4;cBETA_DIST.prototype.argumentsMax=6;cBETA_DIST.prototype.isXLFN=true;cBETA_DIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical,argType.number,argType.number]; cBETA_DIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3].tocNumber();argClone[4]=argClone[4]?argClone[4].tocNumber():new cNumber(0);argClone[5]=argClone[5]?argClone[5].tocNumber():new cNumber(1);var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcBeta=function(argArray){var x= argArray[0];var alpha=argArray[1];var beta=argArray[2];var bIsCumulative=argArray[3];var fLowerBound=argArray[4];var fUpperBound=argArray[5];var res=null;if(alpha<=0||beta<=0||x<fLowerBound||x>fUpperBound)return new cError(cErrorType.not_numeric);var fScale=fUpperBound-fLowerBound;x=(x-fLowerBound)/fScale;if(bIsCumulative)res=getBetaDist(x,alpha,beta);else res=getBetaDistPDF(x,alpha,beta)/fScale;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments, calcBeta)};function cBETA_INV(){}cBETA_INV.prototype=Object.create(cBaseFunction.prototype);cBETA_INV.prototype.constructor=cBETA_INV;cBETA_INV.prototype.name="BETA.INV";cBETA_INV.prototype.argumentsMin=3;cBETA_INV.prototype.argumentsMax=5;cBETA_INV.prototype.isXLFN=true;cBETA_INV.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number];cBETA_INV.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone= oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3]?argClone[3].tocNumber():new cNumber(0);argClone[4]=argClone[4]?argClone[4].tocNumber():new cNumber(1);var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcGamma=function(argArray){var fP=argArray[0];var fAlpha=argArray[1];var fBeta=argArray[2];var fA=argArray[3];var fB=argArray[4];if(fP<0||fP>1||fA>=fB||fAlpha<=0||fBeta<=0)return new cError(cErrorType.not_numeric); var aFunc=new BETADISTFUNCTION(fP,fAlpha,fBeta);var oVal=iterateInverse(aFunc,0,1);var bConvError=oVal.bError;if(bConvError)return new cError(cErrorType.not_numeric);var res=fA+oVal.val*(fB-fA);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcGamma)};function cBETAINV(){}cBETAINV.prototype=Object.create(cBETA_INV.prototype);cBETAINV.prototype.constructor=cBETAINV;cBETAINV.prototype.name="BETAINV";cBETAINV.prototype.argumentsType= [argType.number,argType.number,argType.number,argType.number,argType.number];function cBINOMDIST(){}cBINOMDIST.prototype=Object.create(cBaseFunction.prototype);cBINOMDIST.prototype.constructor=cBINOMDIST;cBINOMDIST.prototype.name="BINOMDIST";cBINOMDIST.prototype.argumentsMin=4;cBINOMDIST.prototype.argumentsMax=4;cBINOMDIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical];cBINOMDIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1], true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function binomdist(x,n,p){x=parseInt(x);n=parseInt(n);return Math.binomCoeff(n,x)*Math.pow(p,x)*Math.pow(1-p,n-x)}var calcBinom=function(argArray){var arg0=argArray[0];var arg1=argArray[1];var arg2=argArray[2];var arg3=argArray[3];if(arg0<0||arg0>arg1|| arg2<0||arg2>1)return new cError(cErrorType.not_numeric);if(arg3){var x=parseInt(arg0),n=parseInt(arg1),p=arg2,bm=0;for(var y=0;y<=x;y++)bm+=binomdist(y,n,p);return new cNumber(bm)}else return new cNumber(binomdist(arg0,arg1,arg2))};return this._findArrayInNumberArguments(oArguments,calcBinom)};function cBINOM_DIST(){}cBINOM_DIST.prototype=Object.create(cBINOMDIST.prototype);cBINOM_DIST.prototype.constructor=cBINOM_DIST;cBINOM_DIST.prototype.name="BINOM.DIST";cBINOM_DIST.prototype.isXLFN=true;cBINOM_DIST.prototype.argumentsType= [argType.number,argType.number,argType.number,argType.logical];function cBINOM_DIST_RANGE(){}cBINOM_DIST_RANGE.prototype=Object.create(cBaseFunction.prototype);cBINOM_DIST_RANGE.prototype.constructor=cBINOM_DIST_RANGE;cBINOM_DIST_RANGE.prototype.name="BINOM.DIST.RANGE";cBINOM_DIST_RANGE.prototype.argumentsMin=3;cBINOM_DIST_RANGE.prototype.argumentsMax=4;cBINOM_DIST_RANGE.prototype.isXLFN=true;cBINOM_DIST_RANGE.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number];cBINOM_DIST_RANGE.prototype.Calculate= function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3]?argClone[3].tocNumber():argClone[2];var argError;if(argError=this._checkErrorArg(argClone))return argError;function binomdist(x,n,p){x=parseInt(x);n=parseInt(n);return Math.binomCoeff(n,x)*Math.pow(p,x)*Math.pow(1-p,n-x)}var calcBinom=function(argArray){var arg0=argArray[0]; var arg1=argArray[1];var arg2=argArray[2];var arg3=argArray[3];if(arg0<0||arg1<0||arg1>1||arg2<0||arg2>arg0||arg3<arg2||arg3>arg0)return new cError(cErrorType.not_numeric);var summ=0;for(var i=arg2;i<=arg3;i++)summ+=binomdist(i,arg0,arg1);return new cNumber(summ)};return this._findArrayInNumberArguments(oArguments,calcBinom)};function cCHIDIST(){}cCHIDIST.prototype=Object.create(cBaseFunction.prototype);cCHIDIST.prototype.constructor=cCHIDIST;cCHIDIST.prototype.name="CHIDIST";cCHIDIST.prototype.argumentsMin= 2;cCHIDIST.prototype.argumentsMax=2;cCHIDIST.prototype.argumentsType=[argType.number,argType.number];cCHIDIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var fChi=argArray[0];var fDF=parseInt(argArray[1]);if(fDF<1||fChi<0||fDF>Math.pow(10,10))return new cError(cErrorType.not_numeric); var res=getChiDist(fChi,fDF);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcTDist)};function cCHIINV(){}cCHIINV.prototype=Object.create(cBaseFunction.prototype);cCHIINV.prototype.constructor=cCHIINV;cCHIINV.prototype.name="CHIINV";cCHIINV.prototype.argumentsMin=2;cCHIINV.prototype.argumentsMax=2;cCHIINV.prototype.argumentsType=[argType.number,argType.number];cCHIINV.prototype.Calculate=function(arg){var oArguments= this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var fP=argArray[0];var fDF=parseInt(argArray[1]);if(fDF<1||fP<=0||fP>1)return new cError(cErrorType.not_numeric);var aFunc=new CHIDISTFUNCTION(fP,fDF);var oVal=iterateInverse(aFunc,fDF*.5,fDF);var bConvError=oVal.bError;if(bConvError)return new cError(cErrorType.not_numeric); var res=oVal.val;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcTDist)};function cCHISQ_DIST(){}cCHISQ_DIST.prototype=Object.create(cBaseFunction.prototype);cCHISQ_DIST.prototype.constructor=cCHISQ_DIST;cCHISQ_DIST.prototype.name="CHISQ.DIST";cCHISQ_DIST.prototype.argumentsMin=3;cCHISQ_DIST.prototype.argumentsMax=3;cCHISQ_DIST.prototype.isXLFN=true;cCHISQ_DIST.prototype.argumentsType=[argType.number,argType.number, argType.logical];cCHISQ_DIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var fX=argArray[0];var fDF=parseInt(argArray[1]);var bCumulative=argArray[2];var res=null;if(fDF<1||fDF>1E10||fX<0)return new cError(cErrorType.not_numeric); else if(bCumulative)res=getChiSqDistCDF(fX,fDF);else res=getChiSqDistPDF(fX,fDF);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};if(argClone[1].getValue()<1)return new cError(cErrorType.not_numeric);return this._findArrayInNumberArguments(oArguments,calcTDist)};function cCHISQ_DIST_RT(){}cCHISQ_DIST_RT.prototype=Object.create(cCHIDIST.prototype);cCHISQ_DIST_RT.prototype.constructor=cCHISQ_DIST_RT;cCHISQ_DIST_RT.prototype.name="CHISQ.DIST.RT";cCHISQ_DIST_RT.prototype.isXLFN= true;cCHISQ_DIST_RT.prototype.argumentsType=[argType.number,argType.number];function cCHISQ_INV(){}cCHISQ_INV.prototype=Object.create(cBaseFunction.prototype);cCHISQ_INV.prototype.constructor=cCHISQ_INV;cCHISQ_INV.prototype.name="CHISQ.INV";cCHISQ_INV.prototype.argumentsMin=2;cCHISQ_INV.prototype.argumentsMax=2;cCHISQ_INV.prototype.isXLFN=true;cCHISQ_INV.prototype.argumentsType=[argType.number,argType.number];cCHISQ_INV.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1], true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var fP=argArray[0];var fDF=parseInt(argArray[1]);if(fDF<1||fP<0||fP>=1||fDF>1E10)return new cError(cErrorType.not_numeric);var aFunc=new CHISQDISTFUNCTION(fP,fDF);var oVal=iterateInverse(aFunc,fDF*.5,fDF);var bConvError=oVal.bError;if(bConvError)return new cError(cErrorType.not_numeric);var res= oVal.val;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcTDist)};function cCHISQ_INV_RT(){}cCHISQ_INV_RT.prototype=Object.create(cBaseFunction.prototype);cCHISQ_INV_RT.prototype.constructor=cCHISQ_INV_RT;cCHISQ_INV_RT.prototype.name="CHISQ.INV.RT";cCHISQ_INV_RT.prototype.argumentsMin=2;cCHISQ_INV_RT.prototype.argumentsMax=2;cCHISQ_INV_RT.prototype.isXLFN=true;cCHISQ_INV_RT.prototype.argumentsType=[argType.number, argType.number];cCHISQ_INV_RT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var fP=argArray[0];var fDF=parseInt(argArray[1]);if(fDF<1||fP<=0||fP>1)return new cError(cErrorType.not_numeric);var aFunc=new CHIDISTFUNCTION(fP,fDF);var oVal=iterateInverse(aFunc, fDF*.5,fDF);var bConvError=oVal.bError;if(bConvError)return new cError(cErrorType.not_numeric);var res=oVal.val;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcTDist)};function cCHITEST(){}cCHITEST.prototype=Object.create(cBaseFunction.prototype);cCHITEST.prototype.constructor=cCHITEST;cCHITEST.prototype.name="CHITEST";cCHITEST.prototype.argumentsMin=2;cCHITEST.prototype.argumentsMax=2;cCHITEST.prototype.arrayIndexes= {0:1,1:1};cCHITEST.prototype.argumentsType=[argType.array,argType.array];cCHITEST.prototype.Calculate=function(arg){var arg2=[arg[0],arg[1]];if(cElementType.string===arg[0].type||cElementType.bool===arg[0].type)return new cError(cErrorType.wrong_value_type);if(cElementType.string===arg[1].type||cElementType.bool===arg[1].type)return new cError(cErrorType.wrong_value_type);if(cElementType.number===arg[0].type){arg2[0]=new cArray;arg2[0].addElement(arg[0])}if(cElementType.number===arg[1].type){arg2[1]= new cArray;arg2[1].addElement(arg[1])}var oArguments=this._prepareArguments(arg2,arguments[1],true,[cElementType.array,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;function calcChitest(argArray){var arg1=argArray[0];var arg2=argArray[1];return chiTest(arg1,arg2)}return this._findArrayInNumberArguments(oArguments,calcChitest)};function cCHISQ_TEST(){}cCHISQ_TEST.prototype=Object.create(cCHITEST.prototype);cCHISQ_TEST.prototype.constructor= cCHISQ_TEST;cCHISQ_TEST.prototype.name="CHISQ.TEST";cCHISQ_TEST.prototype.isXLFN=true;cCHISQ_TEST.prototype.argumentsType=[argType.array,argType.array];function cCONFIDENCE(){}cCONFIDENCE.prototype=Object.create(cBaseFunction.prototype);cCONFIDENCE.prototype.constructor=cCONFIDENCE;cCONFIDENCE.prototype.name="CONFIDENCE";cCONFIDENCE.prototype.argumentsMin=3;cCONFIDENCE.prototype.argumentsMax=3;cCONFIDENCE.prototype.argumentsType=[argType.number,argType.number,argType.number];cCONFIDENCE.prototype.Calculate= function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcConfidence=function(argArray){var alpha=argArray[0];var stdev_sigma=argArray[1];var size=parseInt(argArray[2]);if(alpha<=0||alpha>=1||stdev_sigma<=0||size<1)return new cError(cErrorType.not_numeric);return new cNumber(gaussinv(1- alpha/2)*stdev_sigma/Math.sqrt(size))};return this._findArrayInNumberArguments(oArguments,calcConfidence)};function cCONFIDENCE_NORM(){}cCONFIDENCE_NORM.prototype=Object.create(cCONFIDENCE.prototype);cCONFIDENCE_NORM.prototype.constructor=cCONFIDENCE_NORM;cCONFIDENCE_NORM.prototype.name="CONFIDENCE.NORM";cCONFIDENCE_NORM.prototype.isXLFN=true;cCONFIDENCE_NORM.prototype.argumentsType=[argType.number,argType.number,argType.number];function cCONFIDENCE_T(){}cCONFIDENCE_T.prototype=Object.create(cBaseFunction.prototype); cCONFIDENCE_T.prototype.constructor=cCONFIDENCE_T;cCONFIDENCE_T.prototype.name="CONFIDENCE.T";cCONFIDENCE_T.prototype.argumentsMin=3;cCONFIDENCE_T.prototype.argumentsMax=3;cCONFIDENCE_T.prototype.isXLFN=true;cCONFIDENCE_T.prototype.argumentsType=[argType.number,argType.number,argType.number];cCONFIDENCE_T.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber(); argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcConfidence=function(argArray){var alpha=argArray[0];var stdev_sigma=argArray[1];var size=parseInt(argArray[2]);if(alpha<=0||alpha>=1||stdev_sigma<=0||size<1)return new cError(cErrorType.not_numeric);var aFunc=new TDISTFUNCTION(alpha,size-1,2);var oVal=iterateInverse(aFunc,size*.5,size);var bConvError=oVal.bError;if(bConvError)return new cError(cErrorType.not_numeric);var res=stdev_sigma* oVal.val/Math.sqrt(size);return new cNumber(res)};return this._findArrayInNumberArguments(oArguments,calcConfidence)};function cCORREL(){}cCORREL.prototype=Object.create(cBaseFunction.prototype);cCORREL.prototype.constructor=cCORREL;cCORREL.prototype.name="CORREL";cCORREL.prototype.argumentsMin=2;cCORREL.prototype.argumentsMax=2;cCORREL.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cCORREL.prototype.argumentsType=[argType.array,argType.array];cCORREL.prototype.Calculate=function(arg){function correl(x, y){var s1=0,s2=0,s3=0,_x=0,_y=0,xLength=0,i;if(x.length!=y.length)return new cError(cErrorType.not_available);for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;s1+=(x[i].getValue()-_x)*(y[i].getValue()-_y);s2+=(x[i].getValue()-_x)*(x[i].getValue()-_x);s3+=(y[i].getValue()-_y)*(y[i].getValue()-_y)}if(s2== 0||s3==0)return new cError(cErrorType.division_by_zero);else return new cNumber(s1/Math.sqrt(s2*s3))}var arg0=arg[0],arg1=arg[1],arr0=[],arr1=[];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arr0=arg0.getValue();else if(arg0 instanceof cArray)arg0.foreach(function(elem){arr0.push(elem)});else return new cError(cErrorType.wrong_value_type);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arr1=arg1.getValue();else if(arg1 instanceof cArray)arg1.foreach(function(elem){arr1.push(elem)});else return new cError(cErrorType.wrong_value_type); return correl(arr0,arr1)};function cCOUNT(){}cCOUNT.prototype=Object.create(cBaseFunction.prototype);cCOUNT.prototype.constructor=cCOUNT;cCOUNT.prototype.name="COUNT";cCOUNT.prototype.argumentsMin=1;cCOUNT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUNT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cCOUNT.prototype.argumentsType=[[argType.number]];cCOUNT.prototype.Calculate=function(arg){var count=0;for(var i=0;i<arg.length;i++){var _arg=arg[i];if(cElementType.cell=== _arg.type||cElementType.cell3D===_arg.type){if(!this.checkExclude||!_arg.isHidden(this.excludeHiddenRows)){var _argV=_arg.getValue();if(cElementType.number===_argV.type)count++}}else if(cElementType.cellsRange===_arg.type||cElementType.cellsRange3D===_arg.type){var _argAreaValue=_arg.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);for(var j=0;j<_argAreaValue.length;j++)if(cElementType.number===_argAreaValue[j].type)count++}else if(cElementType.number=== _arg.type||cElementType.bool===_arg.type||cElementType.empty===_arg.type)count++;else if(cElementType.string===_arg.type){if(cElementType.number===_arg.tocNumber().type)count++}else if(cElementType.array===_arg.type)_arg.foreach(function(elem){if(cElementType.number===elem.tocNumber().type)count++})}return new cNumber(count)};function cCOUNTA(){}cCOUNTA.prototype=Object.create(cBaseFunction.prototype);cCOUNTA.prototype.constructor=cCOUNTA;cCOUNTA.prototype.name="COUNTA";cCOUNTA.prototype.argumentsMin= 1;cCOUNTA.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUNTA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cCOUNTA.prototype.argumentsType=[[argType.number]];cCOUNTA.prototype.Calculate=function(arg){var element,count=0;for(var i=0;i<arg.length;i++){element=arg[i];if(cElementType.cell===element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){var _argV=element.getValue();if(cElementType.empty!==_argV.type)count++}}else if(cElementType.cellsRange=== element.type||cElementType.cellsRange3D===element.type){var _argAreaValue=element.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);for(var j=0;j<_argAreaValue.length;j++)if(cElementType.empty!==_argAreaValue[j].type)count++}else if(cElementType.array===element.type)element.foreach(function(elem){if(cElementType.empty!==elem.type)count++});else if(cElementType.empty!==element.type)count++}return new cNumber(count)};function cCOUNTBLANK(){}cCOUNTBLANK.prototype= Object.create(cBaseFunction.prototype);cCOUNTBLANK.prototype.constructor=cCOUNTBLANK;cCOUNTBLANK.prototype.name="COUNTBLANK";cCOUNTBLANK.prototype.argumentsMin=1;cCOUNTBLANK.prototype.argumentsMax=1;cCOUNTBLANK.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUNTBLANK.prototype.arrayIndexes={0:1};cCOUNTBLANK.prototype.argumentsType=[argType.reference];cCOUNTBLANK.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)return arg0.countCells();else if(arg0 instanceof cRef||arg0 instanceof cRef3D)return cElementType.empty===arg0.getValue().type?new cNumber(1):new cNumber(0);else return new cError(cErrorType.bad_reference)};function cCOUNTIF(){}cCOUNTIF.prototype=Object.create(cBaseFunction.prototype);cCOUNTIF.prototype.constructor=cCOUNTIF;cCOUNTIF.prototype.name="COUNTIF";cCOUNTIF.prototype.argumentsMin=2;cCOUNTIF.prototype.argumentsMax=2;cCOUNTIF.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUNTIF.prototype.arrayIndexes={0:1};cCOUNTIF.prototype.argumentsType= [argType.reference,argType.any];cCOUNTIF.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],_count=0,matchingInfo;if(cElementType.error===arg0.type)return arg0;if(cElementType.cell!==arg0.type&&cElementType.cell3D!==arg0.type&&cElementType.cellsRange!==arg0.type&&cElementType.cellsRange3D!==arg0.type)return new cError(cErrorType.wrong_value_type);if(cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.array===arg1.type)arg1= arg1.getElementRowCol(0,0);else if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type)arg1=arg1.getValue();var checkEmptyValue=function(res,tempVal,tempMatchingInfo){tempVal=undefined!==tempVal.value?tempVal.value:tempVal;var matchingValue=tempMatchingInfo.val&&tempMatchingInfo.val.value.toString?tempMatchingInfo.val.value.toString():null;if(tempVal===""&&matchingValue&&""!==matchingValue.replace(/\*|\?/g,""))return false;return res};var val;matchingInfo=AscCommonExcel.matchingValue(arg1); if(cElementType.cellsRange===arg0.type)arg0.foreach2(function(_val){_count+=checkEmptyValue(matching(_val,matchingInfo,true),_val,matchingInfo)});else if(cElementType.cellsRange3D===arg0.type){val=arg0.getValue();for(var i=0;i<val.length;i++)_count+=checkEmptyValue(matching(val[i],matchingInfo,true),val[i],matchingInfo)}else{val=arg0.getValue();_count+=checkEmptyValue(matching(val,matchingInfo,true),val,matchingInfo)}return new cNumber(_count)};function cCOUNTIFS(){}cCOUNTIFS.prototype=Object.create(cBaseFunction.prototype); cCOUNTIFS.prototype.constructor=cCOUNTIFS;cCOUNTIFS.prototype.name="COUNTIFS";cCOUNTIFS.prototype.argumentsMin=2;cCOUNTIFS.prototype.argumentsMax=254;cCOUNTIFS.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUNTIFS.prototype.arrayIndexes={0:1,2:1,4:1,6:1,8:1};cCOUNTIFS.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.area_to_ref;cCOUNTIFS.prototype.argumentsType=[[argType.reference,argType.any]];cCOUNTIFS.prototype.Calculate=function(arg){var i,j,arg0,arg1,matchingInfo,arg0Matrix, arg1Matrix,_count=0;for(var k=0;k<arg.length;k+=2){arg0=arg[k];arg1=arg[k+1];if(cElementType.cell!==arg0.type&&cElementType.cell3D!==arg0.type&&cElementType.cellsRange!==arg0.type&&!(cElementType.cellsRange3D===arg0.type&&arg0.isSingleSheet()))return new cError(cErrorType.wrong_value_type);if(cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.array===arg1.type)arg1=arg1.getElementRowCol(0,0);arg1=arg1.tocString();if(cElementType.string!== arg1.type)return new cError(cErrorType.wrong_value_type);matchingInfo=AscCommonExcel.matchingValue(arg1);arg1Matrix=arg0.getMatrix();if(cElementType.cellsRange3D===arg0.type)arg1Matrix=arg1Matrix[0];if(!arg0Matrix)arg0Matrix=arg1Matrix;if(arg0Matrix.length!==arg1Matrix.length)return new cError(cErrorType.wrong_value_type);for(i=0;i<arg1Matrix.length;++i){if(arg0Matrix[i].length!==arg1Matrix[i].length)return new cError(cErrorType.wrong_value_type);for(j=0;j<arg1Matrix[i].length;++j)if(arg0Matrix[i][j]&& !matching(arg1Matrix[i][j],matchingInfo))arg0Matrix[i][j]=null}}for(i=0;i<arg0Matrix.length;++i)for(j=0;j<arg0Matrix[i].length;++j)if(arg0Matrix[i][j])++_count;return new cNumber(_count)};cCOUNTIFS.prototype.checkArguments=function(countArguments){return 0===countArguments%2&&cBaseFunction.prototype.checkArguments.apply(this,arguments)};function cCOVAR(){}cCOVAR.prototype=Object.create(cBaseFunction.prototype);cCOVAR.prototype.constructor=cCOVAR;cCOVAR.prototype.name="COVAR";cCOVAR.prototype.argumentsMin= 2;cCOVAR.prototype.argumentsMax=2;cCOVAR.prototype.arrayIndexes={0:1,1:1};cCOVAR.prototype.argumentsType=[argType.array,argType.array];cCOVAR.prototype.Calculate=function(arg){function covar(x,y){var s1=0,_x=0,_y=0,xLength=0,i;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}if(xLength==0)return new cError(cErrorType.division_by_zero);_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&& y[i]instanceof cNumber))continue;s1+=(x[i].getValue()-_x)*(y[i].getValue()-_y)}return new cNumber(s1/xLength)}var arg0=arg[0],arg1=arg[1],arr0=[],arr1=[];if(arg0 instanceof cArea)arr0=arg0.getValue();else if(arg0 instanceof cArray)arg0.foreach(function(elem){arr0.push(elem)});else return new cError(cErrorType.wrong_value_type);if(arg1 instanceof cArea)arr1=arg1.getValue();else if(arg1 instanceof cArray)arg1.foreach(function(elem){arr1.push(elem)});else return new cError(cErrorType.wrong_value_type); return covar(arr0,arr1)};function cCOVARIANCE_P(){}cCOVARIANCE_P.prototype=Object.create(cBaseFunction.prototype);cCOVARIANCE_P.prototype.constructor=cCOVARIANCE_P;cCOVARIANCE_P.prototype.name="COVARIANCE.P";cCOVARIANCE_P.prototype.argumentsMin=2;cCOVARIANCE_P.prototype.argumentsMax=2;cCOVARIANCE_P.prototype.isXLFN=true;cCOVARIANCE_P.prototype.arrayIndexes={0:1,1:1};cCOVARIANCE_P.prototype.argumentsType=[argType.array,argType.array];cCOVARIANCE_P.prototype.Calculate=function(arg){var arg2=[arg[0], arg[1]];if(cElementType.string===arg[0].type||cElementType.bool===arg[0].type)return new cError(cErrorType.wrong_value_type);if(cElementType.string===arg[1].type||cElementType.bool===arg[1].type)return new cError(cErrorType.wrong_value_type);if(cElementType.number===arg[0].type){arg2[0]=new cArray;arg2[0].addElement(arg[0])}if(cElementType.number===arg[1].type){arg2[1]=new cArray;arg2[1].addElement(arg[1])}var oArguments=this._prepareArguments(arg2,arguments[1],true,[cElementType.array,cElementType.array]); var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;function pearson(argArray){var arg1=argArray[0];var arg2=argArray[1];var x=[];var y=[];for(var i=0;i<arg1.length;i++)for(var j=0;j<arg1[i].length;j++)x.push(arg1[i][j]);for(var i=0;i<arg2.length;i++)for(var j=0;j<arg2[i].length;j++)y.push(arg2[i][j]);var sumXDeltaYDelta=0,sqrXDelta=0,sqrYDelta=0,_x=0,_y=0,xLength=0,i;if(x.length!==y.length)return new cError(cErrorType.not_available);for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;sumXDeltaYDelta+=(x[i].getValue()-_x)*(y[i].getValue()-_y)}return new cNumber(sumXDeltaYDelta/xLength)}return this._findArrayInNumberArguments(oArguments,pearson)};function cCOVARIANCE_S(){}cCOVARIANCE_S.prototype=Object.create(cBaseFunction.prototype);cCOVARIANCE_S.prototype.constructor=cCOVARIANCE_S; cCOVARIANCE_S.prototype.name="COVARIANCE.S";cCOVARIANCE_S.prototype.argumentsMin=2;cCOVARIANCE_S.prototype.argumentsMax=2;cCOVARIANCE_S.prototype.isXLFN=true;cCOVARIANCE_S.prototype.arrayIndexes={0:1,1:1};cCOVARIANCE_S.prototype.argumentsType=[argType.array,argType.array];cCOVARIANCE_S.prototype.Calculate=function(arg){var arg2=[arg[0],arg[1]];if(cElementType.string===arg[0].type||cElementType.bool===arg[0].type)return new cError(cErrorType.wrong_value_type);if(cElementType.string===arg[1].type|| cElementType.bool===arg[1].type)return new cError(cErrorType.wrong_value_type);if(cElementType.number===arg[0].type){arg2[0]=new cArray;arg2[0].addElement(arg[0])}if(cElementType.number===arg[1].type){arg2[1]=new cArray;arg2[1].addElement(arg[1])}var oArguments=this._prepareArguments(arg2,arguments[1],true,[cElementType.array,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;function pearson(argArray){var arg1=argArray[0];var arg2= argArray[1];var x=[];var y=[];for(var i=0;i<arg1.length;i++)for(var j=0;j<arg1[i].length;j++)x.push(arg1[i][j]);for(var i=0;i<arg2.length;i++)for(var j=0;j<arg2[i].length;j++)y.push(arg2[i][j]);var sumXDeltaYDelta=0,sqrXDelta=0,sqrYDelta=0,_x=0,_y=0,xLength=0,i;if(x.length!==y.length)return new cError(cErrorType.not_available);for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}if(xLength<2)return new cError(cErrorType.division_by_zero); _x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;sumXDeltaYDelta+=(x[i].getValue()-_x)*(y[i].getValue()-_y)}return new cNumber(sumXDeltaYDelta/(xLength-1))}return this._findArrayInNumberArguments(oArguments,pearson)};function cCRITBINOM(){}cCRITBINOM.prototype=Object.create(cBaseFunction.prototype);cCRITBINOM.prototype.constructor=cCRITBINOM;cCRITBINOM.prototype.name="CRITBINOM";cCRITBINOM.prototype.argumentsMin=3;cCRITBINOM.prototype.argumentsMax= 3;cCRITBINOM.prototype.argumentsType=[argType.number,argType.number,argType.number];cCRITBINOM.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function critbinom(argArray){var n=argArray[0];var p=argArray[1];var alpha=argArray[2];if(n<0||alpha<=0|| alpha>=1||p<0||p>1)return new cError(cErrorType.not_numeric);else{var q=1-p,factor=Math.pow(q,n),i,sum,max;if(factor==0){factor=Math.pow(p,n);if(factor==0)return new cError(cErrorType.wrong_value_type);else{sum=1-factor;max=n;for(i=0;i<max&&sum>=alpha;i++){factor*=(n-i)/(i+1)*q/p;sum-=factor}return new cNumber(n-i)}}else{sum=factor;max=n;for(i=0;i<max&&sum<alpha;i++){factor*=(n-i)/(i+1)*p/q;sum+=factor}return new cNumber(i)}}}return this._findArrayInNumberArguments(oArguments,critbinom)};function cBINOM_INV(){} cBINOM_INV.prototype=Object.create(cCRITBINOM.prototype);cBINOM_INV.prototype.constructor=cBINOM_INV;cBINOM_INV.prototype.name="BINOM.INV";cBINOM_INV.prototype.isXLFN=true;cBINOM_INV.prototype.argumentsType=[argType.number,argType.number,argType.number];function cDEVSQ(){}cDEVSQ.prototype=Object.create(cBaseFunction.prototype);cDEVSQ.prototype.constructor=cDEVSQ;cDEVSQ.prototype.name="DEVSQ";cDEVSQ.prototype.argumentsMin=1;cDEVSQ.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cDEVSQ.prototype.argumentsType= [[argType.number]];cDEVSQ.prototype.Calculate=function(arg){function devsq(x){var s1=0,_x=0,xLength=0,i;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber){_x+=x[i].getValue();xLength++}_x/=xLength;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber)s1+=Math.pow(x[i].getValue()-_x,2);return new cNumber(s1)}var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cRef|| arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber)arr0.push(a)}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)continue;else return new cError(cErrorType.wrong_value_type);return devsq(arr0)};function cEXPON_DIST(){}cEXPON_DIST.prototype=Object.create(cBaseFunction.prototype);cEXPON_DIST.prototype.constructor= cEXPON_DIST;cEXPON_DIST.prototype.name="EXPON.DIST";cEXPON_DIST.prototype.argumentsMin=3;cEXPON_DIST.prototype.argumentsMax=3;cEXPON_DIST.prototype.isXLFN=true;cEXPON_DIST.prototype.argumentsType=[argType.number,argType.number,argType.logical];cEXPON_DIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError; if(argError=this._checkErrorArg(argClone))return argError;var calcFDist=function(argArray){var arg0=argArray[0];var arg1=argArray[1];var arg2=argArray[2];if(arg0<0||arg1<=0)return new cError(cErrorType.not_numeric);var res=null;if(arg2)res=1-Math.exp(-arg1*arg0);else res=arg1*Math.exp(-arg1*arg0);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcFDist)};function cEXPONDIST(){}cEXPONDIST.prototype=Object.create(cBaseFunction.prototype); cEXPONDIST.prototype.constructor=cEXPONDIST;cEXPONDIST.prototype.name="EXPONDIST";cEXPONDIST.prototype.argumentsMin=3;cEXPONDIST.prototype.argumentsMax=3;cEXPONDIST.prototype.argumentsType=[argType.number,argType.number,argType.logical];cEXPONDIST.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2],arg3=arg[3];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2=arg2.tocBool();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg0.getValue()<0||arg2.getValue()<=0)return new cError(cErrorType.not_numeric);if(arg2.toBool())return new cNumber(1- Math.exp(-arg1.getValue()*arg0.getValue()));else return new cNumber(arg1.getValue()*Math.exp(-arg1.getValue()*arg0.getValue()))};function cF_DIST(){}cF_DIST.prototype=Object.create(cBaseFunction.prototype);cF_DIST.prototype.constructor=cF_DIST;cF_DIST.prototype.name="F.DIST";cF_DIST.prototype.argumentsMin=4;cF_DIST.prototype.argumentsMax=4;cF_DIST.prototype.isXLFN=true;cF_DIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical];cF_DIST.prototype.Calculate=function(arg){var oArguments= this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3]?argClone[3].tocNumber():new cBool(true);var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFDist=function(argArray){var fF=argArray[0];var fF1=argArray[1];var fF2=argArray[2];var bCum=argArray[3];if(fF<0||fF1<1||fF2<1||fF1>=1E10||fF2>=1E10)return new cError(cErrorType.not_numeric); var res;if(bCum)res=1-getFDist(fF,fF1,fF2);else res=Math.pow(fF1/fF2,fF1/2)*Math.pow(fF,fF1/2-1)/(Math.pow(1+fF*fF1/fF2,(fF1+fF2)/2)*getBeta(fF1/2,fF2/2));return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcFDist)};function cF_DIST_RT(){}cF_DIST_RT.prototype=Object.create(cBaseFunction.prototype);cF_DIST_RT.prototype.constructor=cF_DIST_RT;cF_DIST_RT.prototype.name="F.DIST.RT";cF_DIST_RT.prototype.argumentsMin= 3;cF_DIST_RT.prototype.argumentsMax=3;cF_DIST_RT.prototype.isXLFN=true;cF_DIST_RT.prototype.argumentsType=[argType.number,argType.number,argType.number];cF_DIST_RT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFDist=function(argArray){var fF= argArray[0];var fF1=argArray[1];var fF2=argArray[2];if(fF<0||fF1<1||fF2<1||fF1>=1E10||fF2>=1E10)return new cError(cErrorType.not_numeric);var res=getFDist(fF,fF1,fF2);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};if(argClone[1].getValue()<1)return new cError(cErrorType.not_numeric);return this._findArrayInNumberArguments(oArguments,calcFDist)};function cFDIST(){}cFDIST.prototype=Object.create(cF_DIST_RT.prototype);cFDIST.prototype.constructor=cFDIST;cFDIST.prototype.name= "FDIST";cFDIST.prototype.isXLFN=true;cFDIST.prototype.argumentsType=[argType.number,argType.number,argType.number];function cF_INV(){}cF_INV.prototype=Object.create(cBaseFunction.prototype);cF_INV.prototype.constructor=cF_INV;cF_INV.prototype.name="F.INV";cF_INV.prototype.argumentsMin=3;cF_INV.prototype.argumentsMax=3;cF_INV.prototype.isXLFN=true;cF_INV.prototype.argumentsType=[argType.number,argType.number,argType.number];cF_INV.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg, arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFDist=function(argArray){var fP=argArray[0];var fF1=parseInt(argArray[1]);var fF2=parseInt(argArray[2]);if(fP<=0||fF1<1||fF2<1||fF1>=1E10||fF2>=1E10||fP>1)return new cError(cErrorType.not_numeric);var aFunc=new FDISTFUNCTION(1-fP,fF1,fF2);var oVal=iterateInverse(aFunc, fF1*.5,fF1);var bConvError=oVal.bError;if(bConvError)return new cError(cErrorType.not_numeric);var res=oVal.val;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};if(argClone[1].getValue()<1)return new cError(cErrorType.not_numeric);return this._findArrayInNumberArguments(oArguments,calcFDist)};function cFINV(){}cFINV.prototype=Object.create(cBaseFunction.prototype);cFINV.prototype.constructor=cFINV;cFINV.prototype.name="FINV";cFINV.prototype.argumentsMin=3;cFINV.prototype.argumentsMax= 3;cFINV.prototype.argumentsType=[argType.number,argType.number,argType.number];cFINV.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcFDist=function(argArray){var fP=argArray[0];var fF1=parseInt(argArray[1]);var fF2=parseInt(argArray[2]);if(fP<= 0||fF1<1||fF2<1||fF1>=1E10||fF2>=1E10||fP>1)return new cError(cErrorType.not_numeric);var aFunc=new FDISTFUNCTION(fP,fF1,fF2);var oVal=iterateInverse(aFunc,fF1*.5,fF1);var bConvError=oVal.bError;if(bConvError)return new cError(cErrorType.not_numeric);var res=oVal.val;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};if(argClone[1].getValue()<1)return new cError(cErrorType.not_numeric);return this._findArrayInNumberArguments(oArguments,calcFDist)};function cF_INV_RT(){} cF_INV_RT.prototype=Object.create(cFINV.prototype);cF_INV_RT.prototype.constructor=cF_INV_RT;cF_INV_RT.prototype.name="F.INV.RT";cF_INV_RT.prototype.isXLFN=true;cF_INV_RT.prototype.argumentsType=[argType.number,argType.number,argType.number];function cFISHER(){}cFISHER.prototype=Object.create(cBaseFunction.prototype);cFISHER.prototype.constructor=cFISHER;cFISHER.prototype.name="FISHER";cFISHER.prototype.argumentsMin=1;cFISHER.prototype.argumentsMax=1;cFISHER.prototype.argumentsType=[argType.number]; cFISHER.prototype.Calculate=function(arg){var arg0=arg[0];function fisher(x){return.5*Math.ln((1+x)/(1-x))}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=fisher(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); else{var a=fisher(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cFISHERINV(){}cFISHERINV.prototype=Object.create(cBaseFunction.prototype);cFISHERINV.prototype.constructor=cFISHERINV;cFISHERINV.prototype.name="FISHERINV";cFISHERINV.prototype.argumentsMin=1;cFISHERINV.prototype.argumentsMax=1;cFISHERINV.prototype.argumentsType=[argType.number];cFISHERINV.prototype.Calculate=function(arg){var arg0=arg[0];function fisherInv(x){return(Math.exp(2* x)-1)/(Math.exp(2*x)+1)}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=fisherInv(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=fisherInv(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric): new cNumber(a)}return arg0};function cFORECAST(){}cFORECAST.prototype=Object.create(cBaseFunction.prototype);cFORECAST.prototype.constructor=cFORECAST;cFORECAST.prototype.name="FORECAST";cFORECAST.prototype.argumentsMin=3;cFORECAST.prototype.argumentsMax=3;cFORECAST.prototype.arrayIndexes={1:1,2:1};cFORECAST.prototype.argumentsType=[argType.number,argType.array,argType.array];cFORECAST.prototype.Calculate=function(arg){function forecast(fx,y,x){var fSumDeltaXDeltaY=0,fSumSqrDeltaX=0,_x=0,_y=0,xLength= 0,i;if(x.length!==y.length)return new cError(cErrorType.not_available);for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;var fValX=x[i].getValue();var fValY=y[i].getValue();fSumDeltaXDeltaY+=(fValX-_x)*(fValY-_y);fSumSqrDeltaX+=(fValX-_x)*(fValX-_x)}if(fSumDeltaXDeltaY==0)return new cError(cErrorType.division_by_zero); else return new cNumber(_y+fSumDeltaXDeltaY/fSumSqrDeltaX*(fx.getValue()-_x))}var arg0=arg[0],arg1=arg[1],arg2=arg[2],arr0=[],arr1=[];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cArea)arr0=arg1.getValue();else if(arg1 instanceof cArray)arg1.foreach(function(elem){arr0.push(elem)});else return new cError(cErrorType.wrong_value_type); if(arg2 instanceof cArea)arr1=arg2.getValue();else if(arg2 instanceof cArray)arg2.foreach(function(elem){arr1.push(elem)});else return new cError(cErrorType.wrong_value_type);return forecast(arg0,arr0,arr1)};function cFORECAST_ETS(){}cFORECAST_ETS.prototype=Object.create(cBaseFunction.prototype);cFORECAST_ETS.prototype.constructor=cFORECAST_ETS;cFORECAST_ETS.prototype.name="FORECAST.ETS";cFORECAST_ETS.prototype.argumentsMin=3;cFORECAST_ETS.prototype.argumentsMax=6;cFORECAST_ETS.prototype.argumentsType= [argType.number,argType.reference,argType.reference,argType.number,argType.number,argType.number];cFORECAST_ETS.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[null,cElementType.array,cElementType.array]);var argClone=oArguments.args;argClone[3]=argClone[3]?argClone[3].tocNumber():new cNumber(1);argClone[4]=argClone[4]?argClone[4].tocNumber():new cNumber(1);argClone[5]=argClone[5]?argClone[5].tocNumber():new cNumber(1);argClone[0]=argClone[0].getMatrix(); var argError;if(argError=this._checkErrorArg(argClone))return argError;var pTMat=argClone[0];var pMatY=argClone[1];var pMatX=argClone[2];var nSmplInPrd=argClone[3].getValue();var bDataCompletion=argClone[4].getValue();var nAggregation=argClone[5].getValue();if(nAggregation<1||nAggregation>7)return new cError(cErrorType.not_numeric);if(bDataCompletion!==1&&bDataCompletion!==0)return new cError(cErrorType.not_numeric);var aETSCalc=new ScETSForecastCalculation(pMatX.length);var isError=aETSCalc.PreprocessDataRange(pMatX, pMatY,nSmplInPrd,bDataCompletion,nAggregation,pTMat);if(!isError)return new cError(cErrorType.wrong_value_type);else if(isError&&cElementType.error===isError.type)return isError;var pFcMat=aETSCalc.GetForecastRange(pTMat);return pFcMat&&pFcMat[0]?new cNumber(pFcMat[0][0]):new cError(cErrorType.wrong_value_type)};function cFORECAST_ETS_CONFINT(){}cFORECAST_ETS_CONFINT.prototype=Object.create(cBaseFunction.prototype);cFORECAST_ETS_CONFINT.prototype.constructor=cFORECAST_ETS_CONFINT;cFORECAST_ETS_CONFINT.prototype.name= "FORECAST.ETS.CONFINT";cFORECAST_ETS_CONFINT.prototype.argumentsMin=3;cFORECAST_ETS_CONFINT.prototype.argumentsMax=7;cFORECAST_ETS_CONFINT.prototype.argumentsType=[argType.number,argType.reference,argType.reference,argType.number,argType.number,argType.number,argType.number];cFORECAST_ETS_CONFINT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[null,cElementType.array,cElementType.array]);var argClone=oArguments.args;argClone[3]=argClone[3]?argClone[3].tocNumber(): new cNumber(.95);argClone[4]=argClone[4]?argClone[4].tocNumber():new cNumber(1);argClone[5]=argClone[5]?argClone[5].tocNumber():new cNumber(1);argClone[6]=argClone[6]?argClone[6].tocNumber():new cNumber(1);argClone[0]=argClone[0].getMatrix();var argError;if(argError=this._checkErrorArg(argClone))return argError;var pTMat=argClone[0];var pMatY=argClone[1];var pMatX=argClone[2];var fPILevel=argClone[3].getValue();var nSmplInPrd=argClone[4].getValue();var bDataCompletion=argClone[5].getValue();var nAggregation= argClone[6].getValue();if(fPILevel<0||fPILevel>1)return new cError(cErrorType.not_numeric);if(nAggregation<1||nAggregation>7)return new cError(cErrorType.not_numeric);if(bDataCompletion!==1&&bDataCompletion!==0)return new cError(cErrorType.not_numeric);var aETSCalc=new ScETSForecastCalculation(pMatX.length);var isError=aETSCalc.PreprocessDataRange(pMatX,pMatY,nSmplInPrd,bDataCompletion,nAggregation,pTMat);if(!isError)return new cError(cErrorType.wrong_value_type);else if(isError&&cElementType.error=== isError.type)return isError;var pPIMat=null;if(nSmplInPrd===0)pPIMat=aETSCalc.GetEDSPredictionIntervals(pTMat,fPILevel);else pPIMat=aETSCalc.GetETSPredictionIntervals(pTMat,fPILevel);if(null===pPIMat)return new cError(cErrorType.wrong_value_type);return new cNumber(pPIMat[0][0])};function cFORECAST_ETS_SEASONALITY(){}cFORECAST_ETS_SEASONALITY.prototype=Object.create(cBaseFunction.prototype);cFORECAST_ETS_SEASONALITY.prototype.constructor=cFORECAST_ETS_SEASONALITY;cFORECAST_ETS_SEASONALITY.prototype.name= "FORECAST.ETS.SEASONALITY";cFORECAST_ETS_SEASONALITY.prototype.argumentsMin=2;cFORECAST_ETS_SEASONALITY.prototype.argumentsMax=4;cFORECAST_ETS_SEASONALITY.prototype.arrayIndexes={0:1,1:1};cFORECAST_ETS_SEASONALITY.prototype.argumentsType=[argType.reference,argType.reference,argType.number,argType.number];cFORECAST_ETS_SEASONALITY.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,cElementType.array]);var argClone=oArguments.args;argClone[2]= argClone[2]?argClone[2].tocNumber():new cNumber(1);argClone[3]=argClone[3]?argClone[3].tocNumber():new cNumber(1);var argError;if(argError=this._checkErrorArg(argClone))return argError;var pMatY=argClone[0];var pMatX=argClone[1];var bDataCompletion=argClone[2].getValue();var nAggregation=argClone[3].getValue();if(nAggregation<1||nAggregation>7)return new cError(cErrorType.not_numeric);if(bDataCompletion!==1&&bDataCompletion!==0)return new cError(cErrorType.not_numeric);var aETSCalc=new ScETSForecastCalculation(pMatX.length); var isError=aETSCalc.PreprocessDataRange(pMatX,pMatY,1,bDataCompletion,nAggregation);if(!isError)return new cError(cErrorType.wrong_value_type);else if(isError&&cElementType.error===isError.type)return isError;var res=aETSCalc.mnSmplInPrd;return new cNumber(res)};function cFORECAST_ETS_STAT(){}cFORECAST_ETS_STAT.prototype=Object.create(cBaseFunction.prototype);cFORECAST_ETS_STAT.prototype.constructor=cFORECAST_ETS_STAT;cFORECAST_ETS_STAT.prototype.name="FORECAST.ETS.STAT";cFORECAST_ETS_STAT.prototype.argumentsMin= 3;cFORECAST_ETS_STAT.prototype.argumentsMax=6;cFORECAST_ETS_STAT.prototype.argumentsType=[argType.reference,argType.reference,argType.number,argType.number,argType.number,argType.number];cFORECAST_ETS_STAT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,cElementType.array]);var argClone=oArguments.args;argClone[3]=argClone[3]?argClone[3].tocNumber():new cNumber(1);argClone[4]=argClone[4]?argClone[4].tocNumber():new cNumber(1);argClone[5]= argClone[5]?argClone[5].tocNumber():new cNumber(1);argClone[2]=convertToMatrix(argClone[2]);var argError;if(argError=this._checkErrorArg(argClone))return argError;var pMatY=argClone[0];var pMatX=argClone[1];var pTypeMat=argClone[2];var nSmplInPrd=argClone[3].getValue();var bDataCompletion=argClone[4].getValue();var nAggregation=argClone[5].getValue();if(nAggregation<1||nAggregation>7)return new cError(cErrorType.not_numeric);if(bDataCompletion!==1&&bDataCompletion!==0)return new cError(cErrorType.not_numeric); var aETSCalc=new ScETSForecastCalculation(pMatX.length);var isError=aETSCalc.PreprocessDataRange(pMatX,pMatY,nSmplInPrd,bDataCompletion,nAggregation);if(!isError)return new cError(cErrorType.wrong_value_type);else if(isError&&cElementType.error===isError.type)return isError;var pFcMat=aETSCalc.GetStatisticValue(pTypeMat);var res=null;if(!pFcMat)return new cError(cErrorType.wrong_value_type);else res=pFcMat[0][0];return null!==res?new cNumber(res):new cError(cErrorType.wrong_value_type)};function cFORECAST_LINEAR(){} cFORECAST_LINEAR.prototype=Object.create(cFORECAST.prototype);cFORECAST_LINEAR.prototype.constructor=cFORECAST_LINEAR;cFORECAST_LINEAR.prototype.name="FORECAST.LINEAR";cFORECAST_LINEAR.prototype.isXLFN=true;cFORECAST_LINEAR.prototype.argumentsType=[argType.number,argType.array,argType.array];function cFREQUENCY(){}cFREQUENCY.prototype=Object.create(cBaseFunction.prototype);cFREQUENCY.prototype.constructor=cFREQUENCY;cFREQUENCY.prototype.name="FREQUENCY";cFREQUENCY.prototype.argumentsMin=2;cFREQUENCY.prototype.argumentsMax= 2;cFREQUENCY.prototype.numFormat=AscCommonExcel.cNumFormatNone;cFREQUENCY.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cFREQUENCY.prototype.argumentsType=[argType.reference,argType.reference];cFREQUENCY.prototype.Calculate=function(arg){function frequency(A,B){var tA=[],tB=[Number.NEGATIVE_INFINITY],i,j;for(i=0;i<A.length;i++)for(j=0;j<A[i].length;j++)if(A[i][j]instanceof cError)return A[i][j];else if(A[i][j]instanceof cNumber)tA.push(A[i][j].getValue());else if(A[i][j]instanceof cBool)tA.push(A[i][j].tocNumber().getValue());for(i=0;i<B.length;i++)for(j=0;j<B[i].length;j++)if(B[i][j]instanceof cError)return B[i][j];else if(B[i][j]instanceof cNumber)tB.push(B[i][j].getValue());else if(B[i][j]instanceof cBool)tB.push(B[i][j].tocNumber().getValue());tA.sort(fSortAscending);tB.push(Number.POSITIVE_INFINITY);tB.sort(fSortAscending);var C=[[]],k=0;for(i=1;i<tB.length;i++,k++){C[0][k]=new cNumber(0);for(j=0;j<tA.length;j++)if(tA[j]>tB[i-1]&&tA[j]<=tB[i]){var a=C[0][k].getValue(); C[0][k]=new cNumber(++a)}}var res=new cArray;res.fillFromArray(C);return res}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArray)arg0=arg0.getMatrix();else if(arg0 instanceof cArea3D)arg0=arg0.getMatrix()[0];else return new cError(cErrorType.not_available);if(arg1 instanceof cArea||arg1 instanceof cArray)arg1=arg1.getMatrix();else if(arg1 instanceof cArea3D)arg1=arg1.getMatrix()[0];else return new cError(cErrorType.not_available);return frequency(arg0,arg1)};function cFTEST(){} cFTEST.prototype=Object.create(cBaseFunction.prototype);cFTEST.prototype.constructor=cFTEST;cFTEST.prototype.name="FTEST";cFTEST.prototype.argumentsMin=2;cFTEST.prototype.argumentsMax=2;cFTEST.prototype.arrayIndexes={0:1,1:1};cFTEST.prototype.argumentsType=[argType.array,argType.array];cFTEST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError; var calcFTest=function(argArray){var arg0=argArray[0];var arg1=argArray[1];return fTest(arg0,arg1)};return this._findArrayInNumberArguments(oArguments,calcFTest)};function cF_TEST(){}cF_TEST.prototype=Object.create(cFTEST.prototype);cF_TEST.prototype.constructor=cF_TEST;cF_TEST.prototype.name="F.TEST";function cGAMMA(){}cGAMMA.prototype=Object.create(cBaseFunction.prototype);cGAMMA.prototype.constructor=cGAMMA;cGAMMA.prototype.name="GAMMA";cGAMMA.prototype.argumentsMin=1;cGAMMA.prototype.argumentsMax= 1;cGAMMA.prototype.isXLFN=true;cGAMMA.prototype.argumentsType=[argType.number];cGAMMA.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcGamma=function(argArray){if(argArray[0]<=0&&Number.isInteger(argArray[0]))return new cError(cErrorType.not_numeric);var res=getGamma(argArray[0]);return null!==res&&!isNaN(res)? new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcGamma)};function cGAMMA_DIST(){}cGAMMA_DIST.prototype=Object.create(cBaseFunction.prototype);cGAMMA_DIST.prototype.constructor=cGAMMA_DIST;cGAMMA_DIST.prototype.name="GAMMA.DIST";cGAMMA_DIST.prototype.argumentsMin=4;cGAMMA_DIST.prototype.argumentsMax=4;cGAMMA_DIST.prototype.isXLFN=true;cGAMMA_DIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical];cGAMMA_DIST.prototype.Calculate= function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcGamma=function(argArray){var fX=argArray[0];var fAlpha=argArray[1];var fBeta=argArray[2];var bCumulative=argArray[3];var res=null;if(fX<0||fAlpha<=0||fBeta<=0)return new cError(cErrorType.not_numeric); else if(bCumulative)res=getGammaDist(fX,fAlpha,fBeta);else res=getGammaDistPDF(fX,fAlpha,fBeta);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcGamma)};function cGAMMADIST(){}cGAMMADIST.prototype=Object.create(cGAMMA_DIST.prototype);cGAMMADIST.prototype.constructor=cGAMMADIST;cGAMMADIST.prototype.name="GAMMADIST";cGAMMADIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical]; function cGAMMA_INV(){}cGAMMA_INV.prototype=Object.create(cBaseFunction.prototype);cGAMMA_INV.prototype.constructor=cGAMMA_INV;cGAMMA_INV.prototype.name="GAMMA.INV";cGAMMA_INV.prototype.argumentsMin=3;cGAMMA_INV.prototype.argumentsMax=3;cGAMMA_INV.prototype.isXLFN=true;cGAMMA_INV.prototype.argumentsType=[argType.number,argType.number,argType.number];cGAMMA_INV.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber(); argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcGamma=function(argArray){var fP=argArray[0];var fAlpha=argArray[1];var fBeta=argArray[2];if(fAlpha<=0||fBeta<=0||fP<0||fP>=1)return new cError(cErrorType.not_numeric);var res=null;if(fP===0)res=0;else{var aFunc=new GAMMADISTFUNCTION(fP,fAlpha,fBeta);var fStart=fAlpha*fBeta;var oVal=iterateInverse(aFunc,fStart*.5,fStart);var bConvError=oVal.bError;if(bConvError)return new cError(cErrorType.not_numeric); res=oVal.val}return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcGamma)};function cGAMMAINV(){}cGAMMAINV.prototype=Object.create(cGAMMA_INV.prototype);cGAMMAINV.prototype.constructor=cGAMMAINV;cGAMMAINV.prototype.name="GAMMAINV";cGAMMAINV.prototype.argumentsType=[argType.number,argType.number,argType.number];function cGAMMALN(){}cGAMMALN.prototype=Object.create(cBaseFunction.prototype);cGAMMALN.prototype.constructor= cGAMMALN;cGAMMALN.prototype.name="GAMMALN";cGAMMALN.prototype.argumentsMin=1;cGAMMALN.prototype.argumentsMax=1;cGAMMALN.prototype.argumentsType=[argType.number];cGAMMALN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=getLogGamma(elem.getValue());this.array[r][c]= isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=getLogGamma(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cGAMMALN_PRECISE(){}cGAMMALN_PRECISE.prototype=Object.create(cBaseFunction.prototype);cGAMMALN_PRECISE.prototype.constructor=cGAMMALN_PRECISE;cGAMMALN_PRECISE.prototype.name="GAMMALN.PRECISE";cGAMMALN_PRECISE.prototype.argumentsMin=1;cGAMMALN_PRECISE.prototype.argumentsMax= 1;cGAMMALN_PRECISE.prototype.isXLFN=true;cGAMMALN_PRECISE.prototype.argumentsType=[argType.number];cGAMMALN_PRECISE.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcGamma=function(argArray){var a=getLogGamma(argArray[0]);return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)};return this._findArrayInNumberArguments(oArguments, calcGamma)};function cGAUSS(){}cGAUSS.prototype=Object.create(cBaseFunction.prototype);cGAUSS.prototype.constructor=cGAUSS;cGAUSS.prototype.name="GAUSS";cGAUSS.prototype.argumentsMin=1;cGAUSS.prototype.argumentsMax=1;cGAUSS.prototype.isXLFN=true;cGAUSS.prototype.argumentsType=[argType.number];cGAUSS.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError; var calcGauss=function(argArray){var res=gauss(argArray[0]);return isNaN(res)?new cError(cErrorType.not_numeric):new cNumber(res)};return this._findArrayInNumberArguments(oArguments,calcGauss)};function cGEOMEAN(){}cGEOMEAN.prototype=Object.create(cBaseFunction.prototype);cGEOMEAN.prototype.constructor=cGEOMEAN;cGEOMEAN.prototype.name="GEOMEAN";cGEOMEAN.prototype.argumentsMin=1;cGEOMEAN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cGEOMEAN.prototype.argumentsType=[[argType.number]]; cGEOMEAN.prototype.Calculate=function(arg){function geommean(x){var _x=1,xLength=0,_tx;for(var i=0;i<x.length;i++)if(x[i]instanceof cNumber){_x*=x[i].getValue();xLength++}else if((x[i]instanceof cString||x[i]instanceof cBool)&&(_tx=x[i].tocNumber())instanceof cNumber){_x*=_tx.getValue();xLength++}if(_x<=0)return new cError(cErrorType.not_numeric);else return new cNumber(Math.pow(_x,1/xLength))}var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber)arr0.push(a)}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString&&arg[j].tocNumber()instanceof cNumber)arr0.push(arg[j].tocNumber());else return new cError(cErrorType.wrong_value_type);return geommean(arr0)}; function cGROWTH(){}cGROWTH.prototype=Object.create(cBaseFunction.prototype);cGROWTH.prototype.constructor=cGROWTH;cGROWTH.prototype.name="GROWTH";cGROWTH.prototype.argumentsMin=1;cGROWTH.prototype.argumentsMax=4;cGROWTH.prototype.arrayIndexes={0:1,1:1,2:1};cGROWTH.prototype.argumentsType=[argType.reference,argType.reference,argType.reference,argType.logical];cGROWTH.prototype.numFormat=AscCommonExcel.cNumFormatNone;cGROWTH.prototype.Calculate=function(arg){var prepeareArgs=prepeareGrowthTrendCalculation(this, arg);if(cElementType.error===prepeareArgs.type)return prepeareArgs;var pMatY=prepeareArgs.pMatY;var pMatX=prepeareArgs.pMatX;var pMatNewX=prepeareArgs.pMatNewX;var bConstant=prepeareArgs.bConstant;var mat=CalculateTrendGrowth(pMatY,pMatX,pMatNewX,bConstant,true);if(mat&&mat[0]&&mat[0][0]!==undefined){var tMatrix=[],res=new cArray;for(var i=0;i<mat.length;i++)for(var j=0;j<mat[i].length;j++){if(!tMatrix[j])tMatrix[j]=[];tMatrix[j][i]=new cNumber(mat[i][j])}res.fillFromArray(tMatrix);return res}else return new cError(cErrorType.wrong_value_type)}; function cHARMEAN(){}cHARMEAN.prototype=Object.create(cBaseFunction.prototype);cHARMEAN.prototype.constructor=cHARMEAN;cHARMEAN.prototype.name="HARMEAN";cHARMEAN.prototype.argumentsMin=1;cHARMEAN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cHARMEAN.prototype.argumentsType=[[argType.number]];cHARMEAN.prototype.Calculate=function(arg){function harmmean(x){var _x=0,xLength=0,_tx;for(var i=0;i<x.length;i++)if(x[i]instanceof cNumber){if(x[i].getValue()==0)return new cError(cErrorType.not_numeric); _x+=1/x[i].getValue();xLength++}else if((x[i]instanceof cString||x[i]instanceof cBool)&&(_tx=x[i].tocNumber())instanceof cNumber){if(_tx.getValue()==0)return new cError(cErrorType.not_numeric);_x+=1/_tx.getValue();xLength++}if(_x<=0)return new cError(cErrorType.not_numeric);else return new cNumber(xLength/_x)}var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber)arr0.push(a)}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString&&arg[j].tocNumber()instanceof cNumber)arr0.push(arg[j].tocNumber());else return new cError(cErrorType.wrong_value_type);return harmmean(arr0)};function cHYPGEOMDIST(){}cHYPGEOMDIST.prototype= Object.create(cBaseFunction.prototype);cHYPGEOMDIST.prototype.constructor=cHYPGEOMDIST;cHYPGEOMDIST.prototype.name="HYPGEOMDIST";cHYPGEOMDIST.prototype.argumentsMin=4;cHYPGEOMDIST.prototype.argumentsMax=4;cHYPGEOMDIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number];cHYPGEOMDIST.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2],arg3=arg[3];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);if(arg3 instanceof cArea||arg3 instanceof cArea3D)arg3=arg3.cross(arguments[1]);else if(arg3 instanceof cArray)arg3=arg3.getElement(0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2=arg2.tocNumber(); arg3=arg3.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg3 instanceof cError)return arg3;if(arg0.getValue()<0||arg0.getValue()>Math.min(arg1.getValue(),arg2.getValue())||arg0.getValue()<Math.max(0,arg1.getValue()-arg3.getValue()+arg2.getValue())||arg1.getValue()<=0||arg1.getValue()>arg3.getValue()||arg2.getValue()<=0||arg2.getValue()>arg3.getValue()||arg3.getValue()<=0)return new cError(cErrorType.not_numeric);return new cNumber(Math.binomCoeff(arg2.getValue(), arg0.getValue())*Math.binomCoeff(arg3.getValue()-arg2.getValue(),arg1.getValue()-arg0.getValue())/Math.binomCoeff(arg3.getValue(),arg1.getValue()))};function cHYPGEOM_DIST(){}cHYPGEOM_DIST.prototype=Object.create(cBaseFunction.prototype);cHYPGEOM_DIST.prototype.constructor=cHYPGEOM_DIST;cHYPGEOM_DIST.prototype.name="HYPGEOM.DIST";cHYPGEOM_DIST.prototype.argumentsMin=5;cHYPGEOM_DIST.prototype.argumentsMax=5;cHYPGEOM_DIST.prototype.isXLFN=true;cHYPGEOM_DIST.prototype.argumentsType=[argType.number,argType.number, argType.number,argType.number,argType.logical];cHYPGEOM_DIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3].tocNumber();argClone[4]=argClone[4].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function hypgeomdist(argArray){var arg0=Math.floor(argArray[0]);var arg1= Math.floor(argArray[1]);var arg2=Math.floor(argArray[2]);var arg3=Math.floor(argArray[3]);var bCumulative=argArray[4];if(arg0<0||arg0>Math.min(arg1,arg2)||arg0<Math.max(0,arg1-arg3+arg2)||arg1<=0||arg1>arg3||arg2<=0||arg2>arg3||arg3<=0)return new cError(cErrorType.not_numeric);var res;if(bCumulative){var fVal=0;for(var i=0;i<=arg0;i++){var temp=Math.binomCoeff(arg2,i)*Math.binomCoeff(arg3-arg2,arg1-i)/Math.binomCoeff(arg3,arg1);if(!isNaN(temp))fVal+=temp}res=fVal}else res=Math.binomCoeff(arg2,arg0)* Math.binomCoeff(arg3-arg2,arg1-arg0)/Math.binomCoeff(arg3,arg1);return isNaN(res)?new cError(cErrorType.not_numeric):new cNumber(res)}return this._findArrayInNumberArguments(oArguments,hypgeomdist)};function cINTERCEPT(){}cINTERCEPT.prototype=Object.create(cBaseFunction.prototype);cINTERCEPT.prototype.constructor=cINTERCEPT;cINTERCEPT.prototype.name="INTERCEPT";cINTERCEPT.prototype.argumentsMin=2;cINTERCEPT.prototype.argumentsMax=2;cINTERCEPT.prototype.arrayIndexes={0:1,1:1};cINTERCEPT.prototype.argumentsType= [argType.array,argType.array];cINTERCEPT.prototype.Calculate=function(arg){function intercept(y,x){var fSumDeltaXDeltaY=0,fSumSqrDeltaX=0,_x=0,_y=0,xLength=0,i;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;var fValX=x[i].getValue();var fValY=y[i].getValue();fSumDeltaXDeltaY+=(fValX-_x)*(fValY-_y);fSumSqrDeltaX+= (fValX-_x)*(fValX-_x)}if(fSumDeltaXDeltaY==0)return new cError(cErrorType.division_by_zero);else return new cNumber(_y-fSumDeltaXDeltaY/fSumSqrDeltaX*_x)}var arg0=arg[0],arg1=arg[1],arr0=[],arr1=[];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arr0=arg0.getValue();else if(arg0 instanceof cArray)arg0.foreach(function(elem){arr0.push(elem)});else return new cError(cErrorType.wrong_value_type);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arr1=arg1.getValue();else if(arg1 instanceof cArray)arg1.foreach(function(elem){arr1.push(elem)}); else return new cError(cErrorType.wrong_value_type);return intercept(arr0,arr1)};function cKURT(){}cKURT.prototype=Object.create(cBaseFunction.prototype);cKURT.prototype.constructor=cKURT;cKURT.prototype.name="KURT";cKURT.prototype.argumentsMin=1;cKURT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cKURT.prototype.argumentsType=[[argType.number]];cKURT.prototype.Calculate=function(arg){function kurt(x){var sumSQRDeltaX=0,_x=0,xLength=0,sumSQRDeltaXDivstandDev=0,i;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber){_x+=x[i].getValue();xLength++}_x/=xLength;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber)sumSQRDeltaX+=Math.pow(x[i].getValue()-_x,2);var standDev=Math.sqrt(sumSQRDeltaX/(xLength-1));for(i=0;i<x.length;i++)if(x[i]instanceof cNumber)sumSQRDeltaXDivstandDev+=Math.pow((x[i].getValue()-_x)/standDev,4);return new cNumber(xLength*(xLength+1)/(xLength-1)/(xLength-2)/(xLength-3)*sumSQRDeltaXDivstandDev-3*(xLength-1)*(xLength-1)/(xLength-2)/(xLength-3))}var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber)arr0.push(a)}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)continue;else return new cError(cErrorType.wrong_value_type); return kurt(arr0)};function cLARGE(){}cLARGE.prototype=Object.create(cBaseFunction.prototype);cLARGE.prototype.constructor=cLARGE;cLARGE.prototype.name="LARGE";cLARGE.prototype.argumentsMin=2;cLARGE.prototype.argumentsMax=2;cLARGE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cLARGE.prototype.arrayIndexes={0:1};cLARGE.prototype.argumentsType=[argType.number,argType.number];cLARGE.prototype._getValue=function(arg0,arg1){if(cElementType.error===arg1.type)return arg1;arg1=arg1.getValue();if(arg1<= 0)return new cError(cErrorType.not_available);var v,tA=[];for(var i=0;i<arg0.length;i++)for(var j=0;j<arg0[i].length;j++){v=arg0[i][j];if(cElementType.error===v.type)return v;else if(cElementType.number===v.type)tA.push(v.getValue());else if(cElementType.bool===v.type)tA.push(v.tocNumber().getValue())}tA.sort(AscCommon.fSortDescending);if(arg1>tA.length)return new cError(cErrorType.not_available);else return new cNumber(tA[arg1-1])};cLARGE.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]; if(cElementType.cellsRange===arg0.type)arg0=arg0.getValuesNoEmpty(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);else if(cElementType.array===arg0.type)arg0=arg0.getMatrix();else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.getMatrix()[0];else return new cError(cErrorType.not_numeric);if(cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1]);else if(cElementType.array===arg1.type)arg1=arg1.getElement(0); arg1=arg1.tocNumber();return this._getValue(arg0,arg1)};function cLINEST(){}cLINEST.prototype=Object.create(cBaseFunction.prototype);cLINEST.prototype.constructor=cLINEST;cLINEST.prototype.name="LINEST";cLINEST.prototype.argumentsMin=1;cLINEST.prototype.argumentsMax=4;cLINEST.prototype.arrayIndexes={0:1,1:1};cLINEST.prototype.argumentsType=[argType.reference,argType.reference,argType.logical,argType.logical];cLINEST.prototype.Calculate=function(arg){arg[0]=tryNumberToArray(arg[0]);if(arg[1])arg[1]= tryNumberToArray(arg[1]);var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var pMatY=argClone[0];var pMatX=argClone[1];var bConstant=getBoolValue(argClone[2],true);var bStats=getBoolValue(argClone[3],false);var mat=CalculateRGPRKP(pMatY,pMatX,bConstant,bStats);if(mat&&mat[0]&&mat[0][0]!==undefined){var tMatrix=[],res=new cArray;for(var i=0;i<mat.length;i++)for(var j= 0;j<mat[i].length;j++){if(!tMatrix[j])tMatrix[j]=[];if(null===mat[i][j])tMatrix[j][i]=new cError(cErrorType.not_available);else tMatrix[j][i]=new cNumber(mat[i][j])}res.fillFromArray(tMatrix);return res}else return new cError(cErrorType.wrong_value_type)};function cLOGEST(){}cLOGEST.prototype=Object.create(cBaseFunction.prototype);cLOGEST.prototype.constructor=cLOGEST;cLOGEST.prototype.name="LOGEST";cLOGEST.prototype.argumentsMin=1;cLOGEST.prototype.argumentsMax=4;cLOGEST.prototype.arrayIndexes={0:1, 1:1};cLOGEST.prototype.argumentsType=[argType.reference,argType.reference,argType.logical,argType.logical];cLOGEST.prototype.numFormat=AscCommonExcel.cNumFormatNone;cLOGEST.prototype.Calculate=function(arg){arg[0]=tryNumberToArray(arg[0]);if(arg[1])arg[1]=tryNumberToArray(arg[1]);var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array,cElementType.array]);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var pMatY=argClone[0]; var pMatX=argClone[1];var bConstant=getBoolValue(argClone[2],true);var bStats=getBoolValue(argClone[3],false);var mat=CalculateRGPRKP(pMatY,pMatX,bConstant,bStats,true);if(mat&&mat[0]&&mat[0][0]!==undefined){var tMatrix=[],res=new cArray;for(var i=0;i<mat.length;i++)for(var j=0;j<mat[i].length;j++){if(!tMatrix[j])tMatrix[j]=[];if(null===mat[i][j])tMatrix[j][i]=new cError(cErrorType.not_available);else tMatrix[j][i]=new cNumber(mat[i][j])}res.fillFromArray(tMatrix);return res}else return new cError(cErrorType.wrong_value_type)}; function cLOGINV(){}cLOGINV.prototype=Object.create(cBaseFunction.prototype);cLOGINV.prototype.constructor=cLOGINV;cLOGINV.prototype.name="LOGINV";cLOGINV.prototype.argumentsMin=3;cLOGINV.prototype.argumentsMax=3;cLOGINV.prototype.argumentsType=[argType.number,argType.number,argType.number];cLOGINV.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2];function loginv(x,mue,sigma){if(sigma<=0||x<=0||x>=1)return new cError(cErrorType.not_numeric);else return new cNumber(Math.exp(mue+ sigma*gaussinv(x)))}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2=arg2.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;return loginv(arg0.getValue(),arg1.getValue(),arg2.getValue())};function cLOGNORM_DIST(){}cLOGNORM_DIST.prototype=Object.create(cBaseFunction.prototype);cLOGNORM_DIST.prototype.constructor=cLOGNORM_DIST;cLOGNORM_DIST.prototype.name="LOGNORM.DIST";cLOGNORM_DIST.prototype.argumentsMin=4;cLOGNORM_DIST.prototype.argumentsMax=4;cLOGNORM_DIST.prototype.isXLFN=true;cLOGNORM_DIST.prototype.argumentsType=[argType.number, argType.number,argType.number,argType.logical];cLOGNORM_DIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var normdist=function(argArray){var x=argArray[0];var mue=argArray[1];var sigma=argArray[2];var bCumulative= argArray[3];var res=null;if(sigma<=0)return new cError(cErrorType.not_numeric);if(bCumulative)if(x<=0)res=0;else res=.5+gauss((Math.ln(x)-mue)/sigma);else if(x<=0)return new cError(cErrorType.not_numeric);else res=phi((Math.log(x)-mue)/sigma)/sigma/x;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,normdist)};function cLOGNORM_INV(){}cLOGNORM_INV.prototype=Object.create(cBaseFunction.prototype);cLOGNORM_INV.prototype.constructor= cLOGNORM_INV;cLOGNORM_INV.prototype.name="LOGNORM.INV";cLOGNORM_INV.prototype.argumentsMin=3;cLOGNORM_INV.prototype.argumentsMax=3;cLOGNORM_INV.prototype.isXLFN=true;cLOGNORM_INV.prototype.argumentsType=[argType.number,argType.number,argType.number];cLOGNORM_INV.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError; if(argError=this._checkErrorArg(argClone))return argError;var normdist=function(argArray){var fP=argArray[0];var fMue=argArray[1];var fSigma=argArray[2];var res=null;if(fSigma<=0||fP<=0||fP>=1)return new cError(cErrorType.not_numeric);else res=Math.exp(fMue+fSigma*gaussinv(fP));return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,normdist)};function cLOGNORMDIST(){}cLOGNORMDIST.prototype=Object.create(cBaseFunction.prototype); cLOGNORMDIST.prototype.constructor=cLOGNORMDIST;cLOGNORMDIST.prototype.name="LOGNORMDIST";cLOGNORMDIST.prototype.argumentsMin=3;cLOGNORMDIST.prototype.argumentsMax=3;cLOGNORMDIST.prototype.argumentsType=[argType.number,argType.number,argType.number];cLOGNORMDIST.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2];function normdist(x,mue,sigma){if(sigma<=0||x<=0)return new cError(cErrorType.not_numeric);else return new cNumber(.5+gauss((Math.ln(x)-mue)/sigma))}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2=arg2.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;return normdist(arg0.getValue(),arg1.getValue(),arg2.getValue())};function cMAX(){}cMAX.prototype=Object.create(cBaseFunction.prototype);cMAX.prototype.constructor=cMAX;cMAX.prototype.name="MAX";cMAX.prototype.argumentsMin=1;cMAX.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cMAX.prototype.inheritFormat=true;cMAX.prototype.argumentsType=[[argType.number]];cMAX.prototype.Calculate=function(arg){var v,element,argIVal,max=Number.NEGATIVE_INFINITY; for(var i=0;i<arg.length;i++){element=arg[i];argIVal=element.getValue();if(cElementType.cell===element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){if(cElementType.error===argIVal.type)return argIVal;if(cElementType.number===argIVal.type){v=argIVal.tocNumber();if(v.getValue()>max)max=v.getValue()}}}else if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var argArr=element.getValue(this.checkExclude,this.excludeHiddenRows, this.excludeErrorsVal,this.excludeNestedStAg);for(var j=0;j<argArr.length;j++)if(cElementType.number===argArr[j].type){v=argArr[j].tocNumber();if(v.getValue()>max)max=v.getValue()}else if(cElementType.error===argArr[j].type)return argArr[j]}else if(cElementType.error===element.type)return element;else if(cElementType.string===element.type){v=element.tocNumber();if(cElementType.number===v.type)if(v.getValue()>max)max=v.getValue()}else if(cElementType.bool===element.type||cElementType.empty===element.type){v= element.tocNumber();if(v.getValue()>max)max=v.getValue()}else if(cElementType.array===element.type){element.foreach(function(elem){if(cElementType.number===elem.type){if(elem.getValue()>max)max=elem.getValue()}else if(cElementType.error===elem.type){max=elem;return true}});if(cElementType.error===max.type)return max}else if(element.getValue()>max)max=element.getValue()}return max===Number.NEGATIVE_INFINITY?new cNumber(0):new cNumber(max)};function cMAXA(){}cMAXA.prototype=Object.create(cBaseFunction.prototype); cMAXA.prototype.constructor=cMAXA;cMAXA.prototype.name="MAXA";cMAXA.prototype.argumentsMin=1;cMAXA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cMAXA.prototype.argumentsType=[[argType.number]];cMAXA.prototype.Calculate=function(arg){var argI,argIVal,max=Number.NEGATIVE_INFINITY,v;for(var i=0;i<arg.length;i++){argI=arg[i];argIVal=argI.getValue();if(argI instanceof cRef||argI instanceof cRef3D){if(argIVal instanceof cError)return argIVal;v=argIVal.tocNumber();if(v instanceof cNumber&& v.getValue()>max)max=v.getValue()}else if(argI instanceof cArea||argI instanceof cArea3D){var argArr=argI.getValue();for(var j=0;j<argArr.length;j++){if(argArr[j]instanceof cError)return argArr[j];v=argArr[j].tocNumber();if(v instanceof cNumber&&v.getValue()>max)max=v.getValue()}}else if(argI instanceof cError)return argI;else if(argI instanceof cString){v=argI.tocNumber();if(v instanceof cNumber)if(v.getValue()>max)max=v.getValue()}else if(argI instanceof cBool||argI instanceof cEmpty){v=argI.tocNumber(); if(v.getValue()>max)max=v.getValue()}else if(argI instanceof cArray){argI.foreach(function(elem){if(elem instanceof cError){max=elem;return true}elem=elem.tocNumber();if(elem instanceof cNumber&&elem.getValue()>max)max=elem.getValue()});if(max instanceof cError)return max}else if(argI.getValue()>max)max=argI.getValue()}return max===Number.NEGATIVE_INFINITY?new cNumber(0):new cNumber(max)};function cMAXIFS(){}cMAXIFS.prototype=Object.create(cBaseFunction.prototype);cMAXIFS.prototype.constructor=cMAXIFS; cMAXIFS.prototype.name="MAXIFS";cMAXIFS.prototype.argumentsMin=3;cMAXIFS.prototype.isXLFN=true;cMAXIFS.prototype.arrayIndexes={0:1,1:1,3:1,5:1,7:1,9:1};cMAXIFS.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cell!==arg0.type&&cElementType.cell3D!==arg0.type&&cElementType.cellsRange!==arg0.type)if(cElementType.cellsRange3D===arg0.type){arg0=arg0.tocArea();if(!arg0)return new cError(cErrorType.wrong_value_type)}else return new cError(cErrorType.wrong_value_type);var arg0Matrix=arg0.getMatrix(); var i,j,arg1,arg2,matchingInfo;for(var k=1;k<arg.length;k+=2){arg1=arg[k];arg2=arg[k+1];if(cElementType.cell!==arg1.type&&cElementType.cell3D!==arg1.type&&cElementType.cellsRange!==arg1.type)if(cElementType.cellsRange3D===arg1.type){arg1=arg1.tocArea();if(!arg1)return new cError(cErrorType.wrong_value_type)}else return new cError(cErrorType.wrong_value_type);if(cElementType.cellsRange===arg2.type||cElementType.cellsRange3D===arg2.type)arg2=arg2.cross(arguments[1]);else if(cElementType.array===arg2.type)arg2= arg2.getElementRowCol(0,0);arg2=arg2.tocString();if(cElementType.string!==arg2.type)return new cError(cErrorType.wrong_value_type);matchingInfo=AscCommonExcel.matchingValue(arg2);var arg1Matrix=arg1.getMatrix();if(arg0Matrix.length!==arg1Matrix.length)return new cError(cErrorType.wrong_value_type);for(i=0;i<arg1Matrix.length;++i){if(arg0Matrix[i].length!==arg1Matrix[i].length)return new cError(cErrorType.wrong_value_type);for(j=0;j<arg1Matrix[i].length;++j)if(arg0Matrix[i][j]&&!AscCommonExcel.matching(arg1Matrix[i][j], matchingInfo))if(!(null===matchingInfo.op&&""===matchingInfo.val.value&&0===arg1Matrix[i][j].value))arg0Matrix[i][j]=null}}var resArr=[];var valMatrix0;for(i=0;i<arg0Matrix.length;++i)for(j=0;j<arg0Matrix[i].length;++j)if((valMatrix0=arg0Matrix[i][j])&&cElementType.number===valMatrix0.type)resArr.push(valMatrix0.getValue());if(0===resArr.length)return new cNumber(0);resArr.sort(function(a,b){return b-a});return new cNumber(resArr[0])};cMAXIFS.prototype.checkArguments=function(countArguments){return 1=== countArguments%2&&cBaseFunction.prototype.checkArguments.apply(this,arguments)};function cMINIFS(){}cMINIFS.prototype=Object.create(cBaseFunction.prototype);cMINIFS.prototype.constructor=cMINIFS;cMINIFS.prototype.name="MINIFS";cMINIFS.prototype.argumentsMin=3;cMINIFS.prototype.isXLFN=true;cMINIFS.prototype.arrayIndexes={0:1,1:1,3:1,5:1,7:1,9:1};cMINIFS.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cell!==arg0.type&&cElementType.cell3D!==arg0.type&&cElementType.cellsRange!==arg0.type)if(cElementType.cellsRange3D=== arg0.type){arg0=arg0.tocArea();if(!arg0)return new cError(cErrorType.wrong_value_type)}else return new cError(cErrorType.wrong_value_type);var arg0Matrix=arg0.getMatrix();var i,j,arg1,arg2,matchingInfo;for(var k=1;k<arg.length;k+=2){arg1=arg[k];arg2=arg[k+1];if(cElementType.cell!==arg1.type&&cElementType.cell3D!==arg1.type&&cElementType.cellsRange!==arg1.type)if(cElementType.cellsRange3D===arg1.type){arg1=arg1.tocArea();if(!arg1)return new cError(cErrorType.wrong_value_type)}else return new cError(cErrorType.wrong_value_type); if(cElementType.cellsRange===arg2.type||cElementType.cellsRange3D===arg2.type)arg2=arg2.cross(arguments[1]);else if(cElementType.array===arg2.type)arg2=arg2.getElementRowCol(0,0);arg2=arg2.tocString();if(cElementType.string!==arg2.type)return new cError(cErrorType.wrong_value_type);matchingInfo=AscCommonExcel.matchingValue(arg2);var arg1Matrix=arg1.getMatrix();if(arg0Matrix.length!==arg1Matrix.length)return new cError(cErrorType.wrong_value_type);for(i=0;i<arg1Matrix.length;++i){if(arg0Matrix[i].length!== arg1Matrix[i].length)return new cError(cErrorType.wrong_value_type);for(j=0;j<arg1Matrix[i].length;++j)if(arg0Matrix[i][j]&&!AscCommonExcel.matching(arg1Matrix[i][j],matchingInfo))if(!(null===matchingInfo.op&&""===matchingInfo.val.value&&0===arg1Matrix[i][j].value))arg0Matrix[i][j]=null}}var resArr=[];var valMatrix0;for(i=0;i<arg0Matrix.length;++i)for(j=0;j<arg0Matrix[i].length;++j)if((valMatrix0=arg0Matrix[i][j])&&cElementType.number===valMatrix0.type)resArr.push(valMatrix0.getValue());if(0===resArr.length)return new cNumber(0); resArr.sort(function(a,b){return a-b});return new cNumber(resArr[0])};cMINIFS.prototype.checkArguments=function(countArguments){return 1===countArguments%2&&cBaseFunction.prototype.checkArguments.apply(this,arguments)};function cMEDIAN(){}cMEDIAN.prototype=Object.create(cBaseFunction.prototype);cMEDIAN.prototype.constructor=cMEDIAN;cMEDIAN.prototype.name="MEDIAN";cMEDIAN.prototype.argumentsMin=1;cMEDIAN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cMEDIAN.prototype.inheritFormat= true;cMEDIAN.prototype.argumentsType=[[argType.number]];cMEDIAN.prototype.Calculate=function(arg){function median(x){var medArr=[],t;for(var i=0;i<x.length;i++){t=x[i].tocNumber();if(t instanceof cNumber)medArr.push(t.getValue())}medArr.sort(fSortAscending);if(medArr.length<1)return new cError(cErrorType.wrong_value_type);else if(medArr.length%2)return new cNumber(medArr[(medArr.length-1)/2]);else return new cNumber((medArr[medArr.length/2-1]+medArr[medArr.length/2])/2)}var arr0=[];for(var j=0;j< arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber)arr0.push(a)}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)continue;else return new cError(cErrorType.wrong_value_type); return median(arr0)};function cMIN(){}cMIN.prototype=Object.create(cBaseFunction.prototype);cMIN.prototype.constructor=cMIN;cMIN.prototype.name="MIN";cMIN.prototype.argumentsMin=1;cMIN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cMIN.prototype.inheritFormat=true;cMIN.prototype.argumentsType=[[argType.number]];cMIN.prototype.Calculate=function(arg){var v,element,argIVal,min=Number.POSITIVE_INFINITY;for(var i=0;i<arg.length;i++){element=arg[i];argIVal=element.getValue();if(cElementType.cell=== element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){if(cElementType.error===argIVal.type)return argIVal;if(cElementType.number===argIVal.type){v=argIVal.tocNumber();if(v.getValue()<min)min=v.getValue()}}}else if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var argArr=element.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);for(var j=0;j<argArr.length;j++)if(cElementType.number=== argArr[j].type){v=argArr[j].tocNumber();if(v.getValue()<min)min=v.getValue();continue}else if(cElementType.error===argArr[j].type)return argArr[j]}else if(cElementType.error===element.type)return element;else if(cElementType.string===element.type){v=element.tocNumber();if(cElementType.number===v.type)if(v.getValue()<min)min=v.getValue()}else if(cElementType.bool===element.type||cElementType.empty===element.type){v=element.tocNumber();if(v.getValue()<min)min=v.getValue()}else if(cElementType.array=== element.type){element.foreach(function(elem){if(cElementType.number===elem.type){if(elem.getValue()<min)min=elem.getValue()}else if(cElementType.error===elem.type){min=elem;return true}});if(cElementType.error===min.type)return min}else if(element.getValue()<min)min=element.getValue()}return min===Number.POSITIVE_INFINITY?new cNumber(0):new cNumber(min)};function cMINA(){}cMINA.prototype=Object.create(cBaseFunction.prototype);cMINA.prototype.constructor=cMINA;cMINA.prototype.name="MINA";cMINA.prototype.argumentsMin= 1;cMINA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cMINA.prototype.argumentsType=[[argType.number]];cMINA.prototype.Calculate=function(arg){var argI,argIVal,min=Number.POSITIVE_INFINITY,v;for(var i=0;i<arg.length;i++){argI=arg[i];argIVal=argI.getValue();if(argI instanceof cRef||argI instanceof cRef3D){if(argIVal instanceof cError)return argIVal;v=argIVal.tocNumber();if(v instanceof cNumber&&v.getValue()<min)min=v.getValue()}else if(argI instanceof cArea||argI instanceof cArea3D){var argArr= argI.getValue();for(var j=0;j<argArr.length;j++){if(argArr[j]instanceof cError)return argArr[j];v=argArr[j].tocNumber();if(v instanceof cNumber&&v.getValue()<min)min=v.getValue()}}else if(argI instanceof cError)return argI;else if(argI instanceof cString){v=argI.tocNumber();if(v instanceof cNumber)if(v.getValue()<min)min=v.getValue()}else if(argI instanceof cBool||argI instanceof cEmpty){v=argI.tocNumber();if(v.getValue()<min)min=v.getValue()}else if(argI instanceof cArray){argI.foreach(function(elem){if(elem instanceof cError){min=elem;return true}elem=elem.tocNumber();if(elem instanceof cNumber&&elem.getValue()<min)min=elem.getValue()});if(min instanceof cError)return min}else if(argI.getValue()<min)min=argI.getValue()}return min===Number.POSITIVE_INFINITY?new cNumber(0):new cNumber(min)};function cMODE(){}cMODE.prototype=Object.create(cBaseFunction.prototype);cMODE.prototype.constructor=cMODE;cMODE.prototype.name="MODE";cMODE.prototype.argumentsMin=1;cMODE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array; cMODE.prototype.inheritFormat=true;cMODE.prototype.argumentsType=[[argType.array]];cMODE.prototype.Calculate=function(arg){function mode(x){var medArr=[],t,i;for(i=0;i<x.length;i++){t=x[i].tocNumber();if(t instanceof cNumber)medArr.push(t.getValue())}medArr.sort(fSortAscending);if(medArr.length<1)return new cError(cErrorType.wrong_value_type);else{var nMaxIndex=0,nMax=1,nCount=1,nOldVal=medArr[0];for(i=1;i<medArr.length;i++)if(medArr[i]==nOldVal)nCount++;else{nOldVal=medArr[i];if(nCount>nMax){nMax= nCount;nMaxIndex=i-1}nCount=1}if(nCount>nMax){nMax=nCount;nMaxIndex=i-1}if(nMax==1&&nCount==1)return new cError(cErrorType.wrong_value_type);else if(nMax==1)return new cNumber(nOldVal);else return new cNumber(medArr[nMaxIndex])}}var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber)arr0.push(a)}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)continue;else return new cError(cErrorType.wrong_value_type);return mode(arr0)};function cMODE_MULT(){}cMODE_MULT.prototype=Object.create(cMODE.prototype);cMODE_MULT.prototype.constructor=cMODE_MULT;cMODE_MULT.prototype.name="MODE.MULT";cMODE_MULT.prototype.isXLFN=true;cMODE_MULT.prototype.argumentsType= [[argType.array]];function cMODE_SNGL(){}cMODE_SNGL.prototype=Object.create(cMODE.prototype);cMODE_SNGL.prototype.constructor=cMODE_SNGL;cMODE_SNGL.prototype.name="MODE.SNGL";cMODE_SNGL.prototype.isXLFN=true;cMODE_SNGL.prototype.argumentsType=[[argType.array]];function cNEGBINOMDIST(){}cNEGBINOMDIST.prototype=Object.create(cBaseFunction.prototype);cNEGBINOMDIST.prototype.constructor=cNEGBINOMDIST;cNEGBINOMDIST.prototype.name="NEGBINOMDIST";cNEGBINOMDIST.prototype.argumentsMin=3;cNEGBINOMDIST.prototype.argumentsMax= 3;cNEGBINOMDIST.prototype.argumentsType=[argType.number,argType.number,argType.number];cNEGBINOMDIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function negbinomdist(argArray){var x=argArray[0];var r=argArray[1];var p=argArray[2];if(x<0||r<1|| p<0||p>1)return new cError(cErrorType.not_numeric);else return new cNumber(Math.binomCoeff(x+r-1,r-1)*Math.pow(p,r)*Math.pow(1-p,x))}return this._findArrayInNumberArguments(oArguments,negbinomdist)};function cNEGBINOM_DIST(){}cNEGBINOM_DIST.prototype=Object.create(cBaseFunction.prototype);cNEGBINOM_DIST.prototype.constructor=cNEGBINOM_DIST;cNEGBINOM_DIST.prototype.name="NEGBINOM.DIST";cNEGBINOM_DIST.prototype.argumentsMin=4;cNEGBINOM_DIST.prototype.argumentsMax=4;cNEGBINOM_DIST.prototype.isXLFN=true; cNEGBINOM_DIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical];cNEGBINOM_DIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function negbinomdist(argArray){var x=parseInt(argArray[0]); var r=parseInt(argArray[1]);var p=argArray[2];var bCumulative=argArray[3];if(x<0||r<1||p<0||p>1)return new cError(cErrorType.not_numeric);var res;if(bCumulative)res=1-getBetaDist(1-p,x+1,r);else res=Math.binomCoeff(x+r-1,r-1)*Math.pow(p,r)*Math.pow(1-p,x);return isNaN(res)?new cError(cErrorType.not_numeric):new cNumber(res)}return this._findArrayInNumberArguments(oArguments,negbinomdist)};function cNORMDIST(){}cNORMDIST.prototype=Object.create(cBaseFunction.prototype);cNORMDIST.prototype.constructor= cNORMDIST;cNORMDIST.prototype.name="NORMDIST";cNORMDIST.prototype.argumentsMin=4;cNORMDIST.prototype.argumentsMax=4;cNORMDIST.prototype.argumentsType=[argType.number];cNORMDIST.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2],arg3=arg[3];function normdist(x,mue,sigma,kum){if(sigma<=0)return new cError(cErrorType.not_numeric);if(kum)return new cNumber(integralPhi((x-mue)/sigma));else return new cNumber(phi((x-mue)/sigma)/sigma)}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0= arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);if(arg3 instanceof cArea||arg3 instanceof cArea3D)arg3=arg3.cross(arguments[1]);else if(arg3 instanceof cArray)arg3=arg3.getElement(0);arg0=arg0.tocNumber(); arg1=arg1.tocNumber();arg2=arg2.tocNumber();arg3=arg3.tocBool();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;if(arg3 instanceof cError)return arg3;return normdist(arg0.getValue(),arg1.getValue(),arg2.getValue(),arg3.toBool())};function cNORM_DIST(){}cNORM_DIST.prototype=Object.create(cNORMDIST.prototype);cNORM_DIST.prototype.constructor=cNORM_DIST;cNORM_DIST.prototype.name="NORM.DIST";cNORM_DIST.prototype.isXLFN=true;cNORM_DIST.prototype.argumentsType= [argType.number,argType.number,argType.number,argType.logical];function cNORMINV(){}cNORMINV.prototype=Object.create(cBaseFunction.prototype);cNORMINV.prototype.constructor=cNORMINV;cNORMINV.prototype.name="NORMINV";cNORMINV.prototype.argumentsMin=3;cNORMINV.prototype.argumentsMax=3;cNORMINV.prototype.argumentsType=[argType.number,argType.number,argType.number];cNORMINV.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2];function norminv(x,mue,sigma){if(sigma<=0||x<=0||x>=1)return new cError(cErrorType.not_numeric); else return new cNumber(gaussinv(x)*sigma+mue)}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2= arg2.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;return norminv(arg0.getValue(),arg1.getValue(),arg2.getValue())};function cNORM_INV(){}cNORM_INV.prototype=Object.create(cNORMINV.prototype);cNORM_INV.prototype.constructor=cNORM_INV;cNORM_INV.prototype.name="NORM.INV";cNORM_INV.prototype.isXLFN=true;cNORM_INV.prototype.argumentsType=[argType.number,argType.number,argType.number];function cNORMSDIST(){}cNORMSDIST.prototype= Object.create(cBaseFunction.prototype);cNORMSDIST.prototype.constructor=cNORMSDIST;cNORMSDIST.prototype.name="NORMSDIST";cNORMSDIST.prototype.argumentsMin=1;cNORMSDIST.prototype.argumentsMax=1;cNORMSDIST.prototype.argumentsType=[argType.number];cNORMSDIST.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem, r,c){if(elem instanceof cNumber){var a=.5+gauss(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=.5+gauss(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cNORM_S_DIST(){}cNORM_S_DIST.prototype=Object.create(cBaseFunction.prototype);cNORM_S_DIST.prototype.constructor=cNORM_S_DIST;cNORM_S_DIST.prototype.name="NORM.S.DIST";cNORM_S_DIST.prototype.argumentsMin= 2;cNORM_S_DIST.prototype.argumentsMax=2;cNORM_S_DIST.prototype.isXLFN=true;cNORM_S_DIST.prototype.numFormat=AscCommonExcel.cNumFormatNone;cNORM_S_DIST.prototype.argumentsType=[argType.number,argType.logical];cNORM_S_DIST.prototype.Calculate=function(arg){function normDistCalc(argArray){var arg0=argArray[0],arg1=argArray[1];var res;if(arg1)res=.5+gauss(arg0);else res=Math.exp(-Math.pow(arg0,2)/2)/Math.sqrt(2*Math.PI);return isNaN(res)?new cError(cErrorType.not_numeric):new cNumber(res)}var oArguments= this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;return this._findArrayInNumberArguments(oArguments,normDistCalc)};function cNORMSINV(){}cNORMSINV.prototype=Object.create(cBaseFunction.prototype);cNORMSINV.prototype.constructor=cNORMSINV;cNORMSINV.prototype.name="NORMSINV";cNORMSINV.prototype.argumentsMin=1;cNORMSINV.prototype.argumentsMax= 1;cNORMSINV.prototype.argumentsType=[argType.number];cNORMSINV.prototype.Calculate=function(arg){function normsinv(x){if(x<=0||x>=1)return new cError(cErrorType.not_numeric);else return new cNumber(gaussinv(x))}var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=normsinv(elem.getValue());this.array[r][c]= isNaN(a)?new cError(cErrorType.not_available):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=normsinv(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_available):new cNumber(a)}return arg0};function cNORM_S_INV(){}cNORM_S_INV.prototype=Object.create(cNORMSINV.prototype);cNORM_S_INV.prototype.constructor=cNORM_S_INV;cNORM_S_INV.prototype.name="NORM.S.INV";cNORM_S_INV.prototype.isXLFN=true;cNORM_S_INV.prototype.argumentsType=[argType.number];function cPEARSON(){} cPEARSON.prototype=Object.create(cBaseFunction.prototype);cPEARSON.prototype.constructor=cPEARSON;cPEARSON.prototype.name="PEARSON";cPEARSON.prototype.argumentsMin=2;cPEARSON.prototype.argumentsMax=2;cPEARSON.prototype.arrayIndexes={0:1,1:1};cPEARSON.prototype.argumentsType=[argType.array,argType.array];cPEARSON.prototype.Calculate=function(arg){function pearson(x,y){var sumXDeltaYDelta=0,sqrXDelta=0,sqrYDelta=0,_x=0,_y=0,xLength=0,i;if(x.length!=y.length)return new cError(cErrorType.not_available); for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;sumXDeltaYDelta+=(x[i].getValue()-_x)*(y[i].getValue()-_y);sqrXDelta+=(x[i].getValue()-_x)*(x[i].getValue()-_x);sqrYDelta+=(y[i].getValue()-_y)*(y[i].getValue()-_y)}if(sqrXDelta==0||sqrYDelta==0)return new cError(cErrorType.division_by_zero);else return new cNumber(sumXDeltaYDelta/ Math.sqrt(sqrXDelta*sqrYDelta))}var arg0=arg[0],arg1=arg[1],arr0=[],arr1=[];if(arg0 instanceof cArea)arr0=arg0.getValue();else if(arg0 instanceof cArray)arg0.foreach(function(elem){arr0.push(elem)});else return new cError(cErrorType.wrong_value_type);if(arg1 instanceof cArea)arr1=arg1.getValue();else if(arg1 instanceof cArray)arg1.foreach(function(elem){arr1.push(elem)});else return new cError(cErrorType.wrong_value_type);return pearson(arr0,arr1)};function cPERCENTILE(){}cPERCENTILE.prototype=Object.create(cBaseFunction.prototype); cPERCENTILE.prototype.constructor=cPERCENTILE;cPERCENTILE.prototype.name="PERCENTILE";cPERCENTILE.prototype.argumentsMin=2;cPERCENTILE.prototype.argumentsMax=2;cPERCENTILE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPERCENTILE.prototype.arrayIndexes={0:1};cPERCENTILE.prototype.argumentsType=[argType.number,argType.number];cPERCENTILE.prototype.Calculate=function(arg){function percentile(argArray){var tA=[],A=argArray[0],alpha=argArray[1];for(var i=0;i<A.length;i++)for(var j=0;j<A[i].length;j++)if(A[i][j]instanceof cError)return A[i][j];else if(A[i][j]instanceof cNumber)tA.push(A[i][j].getValue());else if(A[i][j]instanceof cBool)tA.push(A[i][j].tocNumber().getValue());return getPercentile(tA,alpha)}var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array]);var argClone=oArguments.args;argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;return this._findArrayInNumberArguments(oArguments,percentile)};function cPERCENTILE_EXC(){}cPERCENTILE_EXC.prototype= Object.create(cBaseFunction.prototype);cPERCENTILE_EXC.prototype.constructor=cPERCENTILE_EXC;cPERCENTILE_EXC.prototype.name="PERCENTILE.EXC";cPERCENTILE_EXC.prototype.argumentsMin=2;cPERCENTILE_EXC.prototype.argumentsMax=2;cPERCENTILE_EXC.prototype.isXLFN=true;cPERCENTILE_EXC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPERCENTILE_EXC.prototype.arrayIndexes={0:1};cPERCENTILE_EXC.prototype.argumentsType=[argType.number,argType.number];cPERCENTILE_EXC.prototype.Calculate=function(arg){function percentile(argArray){var tA= [],A=argArray[0],alpha=argArray[1];for(var i=0;i<A.length;i++)for(var j=0;j<A[i].length;j++)if(A[i][j]instanceof cError)return A[i][j];else if(A[i][j]instanceof cNumber)tA.push(A[i][j].getValue());else if(A[i][j]instanceof cBool)tA.push(A[i][j].tocNumber().getValue());return getPercentileExclusive(tA,alpha)}var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array]);var argClone=oArguments.args;argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError; return this._findArrayInNumberArguments(oArguments,percentile)};function cPERCENTILE_INC(){}cPERCENTILE_INC.prototype=Object.create(cPERCENTILE.prototype);cPERCENTILE_INC.prototype.constructor=cPERCENTILE_INC;cPERCENTILE_INC.prototype.name="PERCENTILE.INC";cPERCENTILE_INC.prototype.isXLFN=true;cPERCENTILE_INC.prototype.argumentsType=[argType.number,argType.number];function cPERCENTRANK(){}cPERCENTRANK.prototype=Object.create(cBaseFunction.prototype);cPERCENTRANK.prototype.constructor=cPERCENTRANK; cPERCENTRANK.prototype.name="PERCENTRANK";cPERCENTRANK.prototype.argumentsMin=2;cPERCENTRANK.prototype.argumentsMax=3;cPERCENTRANK.prototype.arrayIndexes={0:1};cPERCENTRANK.prototype.argumentsType=[argType.number,argType.number,argType.number];cPERCENTRANK.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array]);var argClone=oArguments.args;argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2]?argClone[2].tocNumber():new cNumber(3); var argError;if(argError=this._checkErrorArg(argClone))return argError;function calcPercenTrank(argArray){var tA=[],A=argArray[0],fNum=argArray[1],k=argArray[2];for(var i=0;i<A.length;i++)for(var j=0;j<A[i].length;j++)if(A[i][j]instanceof cError)return A[i][j];else if(A[i][j]instanceof cNumber)tA.push(A[i][j].getValue());else if(A[i][j]instanceof cBool)tA.push(A[i][j].tocNumber().getValue());return percentrank(tA,fNum,k,true)}return this._findArrayInNumberArguments(oArguments,calcPercenTrank)};function cPERCENTRANK_EXC(){} cPERCENTRANK_EXC.prototype=Object.create(cBaseFunction.prototype);cPERCENTRANK_EXC.prototype.constructor=cPERCENTRANK_EXC;cPERCENTRANK_EXC.prototype.name="PERCENTRANK.EXC";cPERCENTRANK_EXC.prototype.argumentsMin=2;cPERCENTRANK_EXC.prototype.argumentsMax=3;cPERCENTRANK_EXC.prototype.isXLFN=true;cPERCENTRANK_EXC.prototype.arrayIndexes={0:1};cPERCENTRANK_EXC.prototype.argumentsType=[argType.number,argType.number,argType.number];cPERCENTRANK_EXC.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg, arguments[1],true,[cElementType.array]);var argClone=oArguments.args;argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2]?argClone[2].tocNumber():new cNumber(3);var argError;if(argError=this._checkErrorArg(argClone))return argError;function calcPercenTrank(argArray){var tA=[],A=argArray[0],fNum=argArray[1],k=argArray[2];for(var i=0;i<A.length;i++)for(var j=0;j<A[i].length;j++)if(A[i][j]instanceof cError)return A[i][j];else if(A[i][j]instanceof cNumber)tA.push(A[i][j].getValue());else if(A[i][j]instanceof cBool)tA.push(A[i][j].tocNumber().getValue());return percentrank(tA,fNum,k)}return this._findArrayInNumberArguments(oArguments,calcPercenTrank)};function cPERCENTRANK_INC(){}cPERCENTRANK_INC.prototype=Object.create(cPERCENTRANK.prototype);cPERCENTRANK_INC.prototype.constructor=cPERCENTRANK_INC;cPERCENTRANK_INC.prototype.name="PERCENTRANK.INC";cPERCENTRANK_INC.prototype.isXLFN=true;cPERCENTRANK_INC.prototype.argumentsType=[argType.number,argType.number,argType.number];function cPERMUT(){}cPERMUT.prototype= Object.create(cBaseFunction.prototype);cPERMUT.prototype.constructor=cPERMUT;cPERMUT.prototype.name="PERMUT";cPERMUT.prototype.argumentsMin=2;cPERMUT.prototype.argumentsMax=2;cPERMUT.prototype.argumentsType=[argType.number,argType.number];cPERMUT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError; function permut(argArray){var n=Math.floor(argArray[0]);var k=Math.floor(argArray[1]);if(n<=0||k<=0||n<k)return new cError(cErrorType.not_numeric);return new cNumber(Math.permut(n,k))}return this._findArrayInNumberArguments(oArguments,permut)};function cPERMUTATIONA(){}cPERMUTATIONA.prototype=Object.create(cBaseFunction.prototype);cPERMUTATIONA.prototype.constructor=cPERMUTATIONA;cPERMUTATIONA.prototype.name="PERMUTATIONA";cPERMUTATIONA.prototype.argumentsMin=2;cPERMUTATIONA.prototype.argumentsMax= 2;cPERMUTATIONA.prototype.isXLFN=true;cPERMUTATIONA.prototype.argumentsType=[argType.number,argType.number];cPERMUTATIONA.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function permutationa(argArray){var n=Math.floor(argArray[0]);var k=Math.floor(argArray[1]);if(n<0||k<0)return new cError(cErrorType.not_numeric); return new cNumber(Math.pow(n,k))}return this._findArrayInNumberArguments(oArguments,permutationa)};function cPHI(){}cPHI.prototype=Object.create(cBaseFunction.prototype);cPHI.prototype.constructor=cPHI;cPHI.prototype.name="PHI";cPHI.prototype.argumentsMin=1;cPHI.prototype.argumentsMax=1;cPHI.prototype.isXLFN=true;cPHI.prototype.argumentsType=[argType.number];cPHI.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]= argClone[0].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function calcPhi(argArray){var res=phi(argArray[0]);return isNaN(res)?new cError(cErrorType.not_available):new cNumber(res)}return this._findArrayInNumberArguments(oArguments,calcPhi)};function cPOISSON(){}cPOISSON.prototype=Object.create(cBaseFunction.prototype);cPOISSON.prototype.constructor=cPOISSON;cPOISSON.prototype.name="POISSON";cPOISSON.prototype.argumentsMin=3;cPOISSON.prototype.argumentsMax=3; cPOISSON.prototype.argumentsType=[argType.number,argType.number,argType.logical];cPOISSON.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function poisson(argArray){var _x=parseInt(argArray[0]);var _l=argArray[1];var f=argArray[2];if(_x<0||_l<0)return new cError(cErrorType.not_numeric); if(f){var sum=0;for(var k=0;k<=_x;k++)sum+=Math.pow(_l,k)/Math.fact(k);sum*=Math.exp(-_l);return new cNumber(sum)}else return new cNumber(Math.exp(-_l)*Math.pow(_l,_x)/Math.fact(_x))}return this._findArrayInNumberArguments(oArguments,poisson)};function cPOISSON_DIST(){}cPOISSON_DIST.prototype=Object.create(cPOISSON.prototype);cPOISSON_DIST.prototype.constructor=cPOISSON_DIST;cPOISSON_DIST.prototype.name="POISSON.DIST";cPOISSON_DIST.prototype.isXLFN=true;cPOISSON_DIST.prototype.argumentsType=[argType.number, argType.number,argType.logical];function cPROB(){}cPROB.prototype=Object.create(cBaseFunction.prototype);cPROB.prototype.constructor=cPROB;cPROB.prototype.name="PROB";cPROB.prototype.argumentsMin=3;cPROB.prototype.argumentsMax=4;cPROB.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPROB.prototype.arrayIndexes={0:1,1:1};cPROB.prototype.argumentsType=[argType.array,argType.array,argType.number,argType.number];cPROB.prototype.Calculate=function(arg){function prob(x,p,l,u){var fUp,fLo;fLo=l.getValue(); if(u instanceof cEmpty)fUp=fLo;else fUp=u.getValue();if(fLo>fUp){var fTemp=fLo;fLo=fUp;fUp=fTemp}var nC1=x[0].length,nC2=p[0].length,nR1=x.length,nR2=p.length;if(nC1!=nC2||nR1!=nR2||nC1==0||nR1==0||nC2==0||nR2==0)return new cError(cErrorType.not_available);else{var fSum=0,fRes=0,bStop=false,fP,fW;for(var i=0;i<nR1&&!bStop;i++)for(var j=0;j<nC1&&!bStop;j++)if(x[i][j]instanceof cNumber&&p[i][j]instanceof cNumber){fP=p[i][j].getValue();fW=x[i][j].getValue();if(fP<0||fP>1)bStop=true;else{fSum+=fP;if(fW>= fLo&&fW<=fUp)fRes+=fP}}else return new cError(cErrorType.not_available);if(bStop||Math.abs(fSum-1)>1E-7)return new cError(cErrorType.not_available);else return new cNumber(fRes)}}var arg0=arg[0],arg1=arg[1],arg2=arg[2],arg3=arg[3]?arg[3]:new cEmpty;if(arg0 instanceof cArea||arg0 instanceof cArray)arg0=arg0.getMatrix();else if(arg0 instanceof cArea3D)arg0=arg0.getMatrix()[0];else return new cError(cErrorType.not_available);if(arg1 instanceof cArea||arg1 instanceof cArray)arg1=arg1.getMatrix();else if(arg1 instanceof cArea3D)arg1=arg1.getMatrix()[0];else return new cError(cErrorType.not_available);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);if(arg3 instanceof cArea||arg3 instanceof cArea3D)arg3=arg3.cross(arguments[1]);else if(arg3 instanceof cArray)arg3=arg3.getElement(0);arg2=arg2.tocNumber();if(!arg3 instanceof cEmpty)arg3=arg3.tocNumber();if(arg2 instanceof cError)return arg2;if(arg3 instanceof cError)return arg3;return prob(arg0, arg1,arg2,arg3)};function cQUARTILE(){}cQUARTILE.prototype=Object.create(cBaseFunction.prototype);cQUARTILE.prototype.constructor=cQUARTILE;cQUARTILE.prototype.name="QUARTILE";cQUARTILE.prototype.argumentsMin=2;cQUARTILE.prototype.argumentsMax=2;cQUARTILE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cQUARTILE.prototype.arrayIndexes={0:1};cQUARTILE.prototype.argumentsType=[argType.number,argType.number];cQUARTILE.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1], true,[cElementType.array]);var argClone=oArguments.args;argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function quartile(argArray){var A=argArray[0];var fFlag=Math.floor(argArray[1]);var tA=[];for(var i=0;i<A.length;i++)for(var j=0;j<A[i].length;j++)if(A[i][j]instanceof cError)return A[i][j];else if(A[i][j]instanceof cNumber||A[i][j]instanceof cEmpty)tA.push(A[i][j].getValue());else if(A[i][j]instanceof cBool)tA.push(A[i][j].tocNumber().getValue()); var nSize=tA.length;if(tA.length<1||nSize===0)return new cError(cErrorType.not_available);else if(fFlag<0||fFlag>4)return new cError(cErrorType.not_numeric);else if(nSize===1)return new cNumber(tA[0]);return fFlag===2?getMedian(tA):getPercentile(tA,.25*fFlag)}return this._findArrayInNumberArguments(oArguments,quartile)};function cQUARTILE_EXC(){}cQUARTILE_EXC.prototype=Object.create(cBaseFunction.prototype);cQUARTILE_EXC.prototype.constructor=cQUARTILE_EXC;cQUARTILE_EXC.prototype.name="QUARTILE.EXC"; cQUARTILE_EXC.prototype.argumentsMin=2;cQUARTILE_EXC.prototype.argumentsMax=2;cQUARTILE_EXC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cQUARTILE_EXC.prototype.isXLFN=true;cQUARTILE_EXC.prototype.arrayIndexes={0:1};cQUARTILE_EXC.prototype.argumentsType=[argType.number,argType.number];cQUARTILE_EXC.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[cElementType.array]);var argClone=oArguments.args;argClone[1]=argClone[1].tocNumber();var argError;if(argError= this._checkErrorArg(argClone))return argError;function quartile(argArray){var A=argArray[0];var fFlag=Math.floor(argArray[1]);var tA=[];for(var i=0;i<A.length;i++)for(var j=0;j<A[i].length;j++)if(A[i][j]instanceof cError)return A[i][j];else if(A[i][j]instanceof cNumber)tA.push(A[i][j].getValue());else if(A[i][j]instanceof cBool)tA.push(A[i][j].tocNumber().getValue());var nSize=tA.length;if(tA.length<1||nSize===0)return new cError(cErrorType.not_available);else if(fFlag<=0||fFlag>=4)return new cError(cErrorType.not_numeric); else if(nSize===1)return new cNumber(tA[0]);return fFlag===2?getMedian(tA):getPercentileExclusive(tA,.25*fFlag)}return this._findArrayInNumberArguments(oArguments,quartile)};function cQUARTILE_INC(){}cQUARTILE_INC.prototype=Object.create(cQUARTILE.prototype);cQUARTILE_INC.prototype.constructor=cQUARTILE_INC;cQUARTILE_INC.prototype.name="QUARTILE.INC";cQUARTILE_INC.prototype.isXLFN=true;cQUARTILE_INC.prototype.argumentsType=[argType.number,argType.number];function cRANK(){}cRANK.prototype=Object.create(cBaseFunction.prototype); cRANK.prototype.constructor=cRANK;cRANK.prototype.name="RANK";cRANK.prototype.argumentsMin=2;cRANK.prototype.argumentsMax=3;cRANK.prototype.arrayIndexes={1:1};cRANK.prototype.argumentsType=[argType.number,argType.reference,argType.logical];cRANK.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[null,cElementType.array]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[2]=undefined!==argClone[2]?argClone[2].tocNumber():new cNumber(0); var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcRank=function(argArray){var number=argArray[0];var ref=argArray[1];var order=argArray[2];var changedRef=[];for(var i=0;i<ref.length;i++)for(var j=0;j<ref[i].length;j++)if(ref[i][j]instanceof cError)return ref[i][j];else if(ref[i][j]instanceof cNumber)changedRef.push(ref[i][j].getValue());else if(ref[i][j]instanceof cBool)changedRef.push(ref[i][j].tocNumber().getValue());if(!changedRef.length)return new cError(cErrorType.wrong_value_type); var res=rank(number,changedRef,order);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcRank)};function cRANK_AVG(){}cRANK_AVG.prototype=Object.create(cBaseFunction.prototype);cRANK_AVG.prototype.constructor=cRANK_AVG;cRANK_AVG.prototype.name="RANK.AVG";cRANK_AVG.prototype.argumentsMin=2;cRANK_AVG.prototype.argumentsMax=3;cRANK_AVG.prototype.isXLFN=true;cRANK_AVG.prototype.arrayIndexes={1:1};cRANK_AVG.prototype.argumentsType= [argType.number,argType.reference,argType.logical];cRANK_AVG.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true,[null,cElementType.array]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[2]=undefined!==argClone[2]?argClone[2].tocNumber():new cNumber(0);var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcRank=function(argArray){var number=argArray[0];var ref=argArray[1];var order=argArray[2];var changedRef= [];for(var i=0;i<ref.length;i++)for(var j=0;j<ref[i].length;j++)if(ref[i][j]instanceof cError)return ref[i][j];else if(ref[i][j]instanceof cNumber)changedRef.push(ref[i][j].getValue());else if(ref[i][j]instanceof cBool)changedRef.push(ref[i][j].tocNumber().getValue());if(!changedRef.length)return new cError(cErrorType.wrong_value_type);var res=rank(number,changedRef,order,true);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments, calcRank)};function cRANK_EQ(){}cRANK_EQ.prototype=Object.create(cRANK.prototype);cRANK_EQ.prototype.constructor=cRANK_EQ;cRANK_EQ.prototype.name="RANK.EQ";cRANK_EQ.prototype.isXLFN=true;cRANK_EQ.prototype.argumentsType=[argType.number,argType.reference,argType.logical];function cRSQ(){}cRSQ.prototype=Object.create(cBaseFunction.prototype);cRSQ.prototype.constructor=cRSQ;cRSQ.prototype.name="RSQ";cRSQ.prototype.argumentsMin=2;cRSQ.prototype.argumentsMax=2;cRSQ.prototype.arrayIndexes={0:1,1:1};cRSQ.prototype.argumentsType= [argType.array,argType.array];cRSQ.prototype.Calculate=function(arg){function rsq(x,y){var sumXDeltaYDelta=0,sqrXDelta=0,sqrYDelta=0,_x=0,_y=0,xLength=0,i;if(x.length!=y.length)return new cError(cErrorType.not_available);for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;sumXDeltaYDelta+=(x[i].getValue()- _x)*(y[i].getValue()-_y);sqrXDelta+=(x[i].getValue()-_x)*(x[i].getValue()-_x);sqrYDelta+=(y[i].getValue()-_y)*(y[i].getValue()-_y)}if(sqrXDelta==0||sqrYDelta==0)return new cError(cErrorType.division_by_zero);else return new cNumber(Math.pow(sumXDeltaYDelta/Math.sqrt(sqrXDelta*sqrYDelta),2))}var arg0=arg[0],arg1=arg[1],arr0=[],arr1=[];if(arg0 instanceof cArea)arr0=arg0.getValue();else if(arg0 instanceof cArray)arg0.foreach(function(elem){arr0.push(elem)});else return new cError(cErrorType.wrong_value_type); if(arg1 instanceof cArea)arr1=arg1.getValue();else if(arg1 instanceof cArray)arg1.foreach(function(elem){arr1.push(elem)});else return new cError(cErrorType.wrong_value_type);return rsq(arr0,arr1)};function cSKEW(){}cSKEW.prototype=Object.create(cBaseFunction.prototype);cSKEW.prototype.constructor=cSKEW;cSKEW.prototype.name="SKEW";cSKEW.prototype.argumentsMin=1;cSKEW.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSKEW.prototype.argumentsType=[[argType.number]];cSKEW.prototype.Calculate= function(arg){var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber)arr0.push(a)}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)continue;else return new cError(cErrorType.wrong_value_type);return skew(arr0)};function cSKEW_P(){}cSKEW_P.prototype=Object.create(cBaseFunction.prototype);cSKEW_P.prototype.constructor=cSKEW_P;cSKEW_P.prototype.name="SKEW.P";cSKEW_P.prototype.argumentsMin=1;cSKEW_P.prototype.isXLFN=true;cSKEW_P.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSKEW_P.prototype.argumentsType=[[argType.number]];cSKEW_P.prototype.Calculate=function(arg){var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber)arr0.push(a)}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber)arr0.push(elem)});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)continue;else return new cError(cErrorType.wrong_value_type); return skew(arr0,true)};function cSLOPE(){}cSLOPE.prototype=Object.create(cBaseFunction.prototype);cSLOPE.prototype.constructor=cSLOPE;cSLOPE.prototype.name="SLOPE";cSLOPE.prototype.argumentsMin=2;cSLOPE.prototype.argumentsMax=2;cSLOPE.prototype.arrayIndexes={0:1,1:1};cSLOPE.prototype.argumentsType=[argType.array,argType.array];cSLOPE.prototype.Calculate=function(arg){function slope(y,x){var sumXDeltaYDelta=0,sqrXDelta=0,_x=0,_y=0,xLength=0,i;if(x.length!=y.length)return new cError(cErrorType.not_available); for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;sumXDeltaYDelta+=(x[i].getValue()-_x)*(y[i].getValue()-_y);sqrXDelta+=(x[i].getValue()-_x)*(x[i].getValue()-_x)}if(sqrXDelta==0)return new cError(cErrorType.division_by_zero);else return new cNumber(sumXDeltaYDelta/sqrXDelta)}var arg0=arg[0],arg1=arg[1],arr0= [],arr1=[];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arr0=arg0.getValue();else if(arg0 instanceof cArray)arg0.foreach(function(elem){arr0.push(elem)});else return new cError(cErrorType.wrong_value_type);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arr1=arg1.getValue();else if(arg1 instanceof cArray)arg1.foreach(function(elem){arr1.push(elem)});else return new cError(cErrorType.wrong_value_type);return slope(arr0,arr1)};function cSMALL(){}cSMALL.prototype=Object.create(cBaseFunction.prototype); cSMALL.prototype.constructor=cSMALL;cSMALL.prototype.name="SMALL";cSMALL.prototype.argumentsMin=2;cSMALL.prototype.argumentsMax=2;cSMALL.prototype.numFormat=AscCommonExcel.cNumFormatNone;cSMALL.prototype.arrayIndexes={0:1};cSMALL.prototype.argumentsType=[argType.number,argType.number];cSMALL.prototype.Calculate=function(arg){var retArr=new cArray;function frequency(A,k){var tA=[];for(var i=0;i<A.length;i++)for(var j=0;j<A[i].length;j++)if(A[i][j]instanceof cError)return A[i][j];else if(A[i][j]instanceof cNumber)tA.push(A[i][j].getValue());tA.sort(fSortAscending);if(k.getValue()>tA.length||k.getValue()<=0)return new cError(cErrorType.not_numeric);else return new cNumber(tA[k.getValue()-1])}function actionArray(elem,r,c){var e=elem.tocNumber();if(e instanceof cError)retArr.addElement(e);retArr.addElement(frequency(arg0,e))}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArray)arg0=arg0.getMatrix(this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);else if(arg0 instanceof cArea3D)arg0=arg0.getMatrix(this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg)[0];else return new cError(cErrorType.not_numeric);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray){arg1.foreach(actionArray);return retArr}return frequency(arg0,arg1)};function cSTANDARDIZE(){}cSTANDARDIZE.prototype=Object.create(cBaseFunction.prototype);cSTANDARDIZE.prototype.constructor=cSTANDARDIZE;cSTANDARDIZE.prototype.name="STANDARDIZE"; cSTANDARDIZE.prototype.argumentsMin=3;cSTANDARDIZE.prototype.argumentsMax=3;cSTANDARDIZE.prototype.argumentsType=[argType.number,argType.number,argType.number];cSTANDARDIZE.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2];function standardize(x,mue,sigma){if(sigma<=0)return new cError(cErrorType.not_numeric);else return new cNumber((x-mue)/sigma)}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElement(0); if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArea||arg2 instanceof cArea3D)arg2=arg2.cross(arguments[1]);else if(arg2 instanceof cArray)arg2=arg2.getElement(0);arg0=arg0.tocNumber();arg1=arg1.tocNumber();arg2=arg2.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg2 instanceof cError)return arg2;return standardize(arg0.getValue(),arg1.getValue(), arg2.getValue())};function cSTDEV(){}cSTDEV.prototype=Object.create(cBaseFunction.prototype);cSTDEV.prototype.constructor=cSTDEV;cSTDEV.prototype.name="STDEV";cSTDEV.prototype.argumentsMin=1;cSTDEV.prototype.numFormat=AscCommonExcel.cNumFormatNone;cSTDEV.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSTDEV.prototype.argumentsType=[[argType.number]];cSTDEV.prototype.Calculate=function(arg){var i,element,count=0,sum=new cNumber(0),member=[];for(i=0;i<arg.length;i++){element=arg[i]; if(cElementType.cell===element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){var _argV=element.getValue();if(cElementType.number===_argV.type){member.push(_argV);sum=_func[sum.type][_argV.type](sum,_argV,"+");count++}}}else if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var _argAreaValue=element.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);for(var j= 0;j<_argAreaValue.length;j++){var __arg=_argAreaValue[j];if(cElementType.number===__arg.type){member.push(__arg);sum=_func[sum.type][__arg.type](sum,__arg,"+");count++}}}else if(cElementType.array===element.type)element.foreach(function(elem){var e=elem.tocNumber();if(cElementType.number===e.type){member.push(e);sum=_func[sum.type][e.type](sum,e,"+");count++}});else{element=element.tocNumber();if(cElementType.number===element.type){member.push(element);sum=_func[sum.type][element.type](sum,element, "+");count++}}}var average=sum.getValue()/count,res=0,av;for(i=0;i<member.length;i++){av=member[i]-average;res+=av*av}if(1===count)return new cError(cErrorType.division_by_zero);return new cNumber(Math.sqrt(res/(count-1)))};function cSTDEV_S(){}cSTDEV_S.prototype=Object.create(cSTDEV.prototype);cSTDEV_S.prototype.constructor=cSTDEV_S;cSTDEV_S.prototype.name="STDEV.S";cSTDEV_S.prototype.isXLFN=true;cSTDEV_S.prototype.argumentsType=[[argType.number]];function cSTDEVA(){}cSTDEVA.prototype=Object.create(cBaseFunction.prototype); cSTDEVA.prototype.constructor=cSTDEVA;cSTDEVA.prototype.name="STDEVA";cSTDEVA.prototype.argumentsMin=1;cSTDEVA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSTDEVA.prototype.argumentsType=[[argType.number]];cSTDEVA.prototype.Calculate=function(arg){var count=0,sum=new cNumber(0),member=[],i;for(i=0;i<arg.length;i++){var _arg=arg[i];if(_arg instanceof cRef||_arg instanceof cRef3D){var _argV=_arg.getValue().tocNumber();if(_argV instanceof cNumber){member.push(_argV);sum=_func[sum.type][_argV.type](sum, _argV,"+");count++}}else if(_arg instanceof cArea||_arg instanceof cArea3D){var _argAreaValue=_arg.getValue();for(var j=0;j<_argAreaValue.length;j++){var __arg=_argAreaValue[j].tocNumber();if(__arg instanceof cNumber){member.push(__arg);sum=_func[sum.type][__arg.type](sum,__arg,"+");count++}}}else if(_arg instanceof cArray)_arg.foreach(function(elem){var e=elem.tocNumber();if(e instanceof cNumber){member.push(e);sum=_func[sum.type][e.type](sum,e,"+");count++}});else{_arg=_arg.tocNumber();if(_arg instanceof cNumber){member.push(_arg);sum=_func[sum.type][_arg.type](sum,_arg,"+");count++}}}var average=sum.getValue()/count,res=0,av;for(i=0;i<member.length;i++){av=member[i]-average;res+=av*av}return new cNumber(Math.sqrt(res/(count-1)))};function cSTDEVP(){}cSTDEVP.prototype=Object.create(cBaseFunction.prototype);cSTDEVP.prototype.constructor=cSTDEVP;cSTDEVP.prototype.name="STDEVP";cSTDEVP.prototype.argumentsMin=1;cSTDEVP.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSTDEVP.prototype.argumentsType= [[argType.number]];cSTDEVP.prototype.Calculate=function(arg){function _var(x){var i,tA=[],sumSQRDeltaX=0,_x=0,xLength=0;for(i=0;i<x.length;i++)if(cElementType.number===x[i].type){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(cElementType.error===x[i].type)return x[i];_x/=xLength;for(i=0;i<x.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(isNaN(_x)?new cError(cErrorType.division_by_zero):Math.sqrt(sumSQRDeltaX/xLength))}var element,arr0=[];var error;for(var j=0;j< arg.length;j++){element=arg[j];if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var _arrVal=element.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);_arrVal.forEach(function(elem){if(cElementType.number===elem.type)arr0.push(elem);else if(cElementType.error===elem.type&&!error)error=elem});if(error)return error}else if(cElementType.cell===element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){var a= element.getValue();if(cElementType.number===a.type)arr0.push(a);else if(cElementType.error===a.type)return a}}else if(cElementType.array===element.type){element.foreach(function(elem){if(cElementType.number===elem.type)arr0.push(elem);else if(cElementType.error===elem.type&&!error)error=elem});if(error)return error}else if(cElementType.number===element.type||cElementType.bool===element.type)arr0.push(element.tocNumber());else if(cElementType.string===element.type||cElementType.empty===element.type)arr0.push(new cNumber(0)); else if(cElementType.error===element.type)return element;else return new cError(cErrorType.wrong_value_type)}return _var(arr0)};function cSTDEV_P(){}cSTDEV_P.prototype=Object.create(cSTDEVP.prototype);cSTDEV_P.prototype.constructor=cSTDEV_P;cSTDEV_P.prototype.name="STDEV.P";cSTDEV_P.prototype.isXLFN=true;cSTDEV_P.prototype.argumentsType=[[argType.number]];function cSTDEVPA(){}cSTDEVPA.prototype=Object.create(cBaseFunction.prototype);cSTDEVPA.prototype.constructor=cSTDEVPA;cSTDEVPA.prototype.name= "STDEVPA";cSTDEVPA.prototype.argumentsMin=1;cSTDEVPA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSTDEVPA.prototype.argumentsType=[[argType.number]];cSTDEVPA.prototype.Calculate=function(arg){function _var(x){var tA=[],sumSQRDeltaX=0,_x=0,xLength=0,i;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(x[i]instanceof cError)return x[i];_x/=xLength;for(i=0;i<x.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(Math.sqrt(sumSQRDeltaX/ xLength))}var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber||elem instanceof cError)arr0.push(elem);else if(elem instanceof cBool)arr0.push(elem.tocNumber());else if(elem instanceof cString)arr0.push(new cNumber(0))});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber||a instanceof cError)arr0.push(a);else if(a instanceof cBool)arr0.push(a.tocNumber()); else if(a instanceof cString)arr0.push(new cNumber(0))}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber||elem instanceof cError)arr0.push(elem);else if(elem instanceof cBool)arr0.push(elem.tocNumber());else if(elem instanceof cString)arr0.push(new cNumber(0))});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)arr0.push(new cNumber(0));else return new cError(cErrorType.wrong_value_type);return _var(arr0)}; function cSTEYX(){}cSTEYX.prototype=Object.create(cBaseFunction.prototype);cSTEYX.prototype.constructor=cSTEYX;cSTEYX.prototype.name="STEYX";cSTEYX.prototype.argumentsMin=2;cSTEYX.prototype.argumentsMax=2;cSTEYX.prototype.arrayIndexes={0:1,1:1};cSTEYX.prototype.argumentsType=[argType.array,argType.array];cSTEYX.prototype.Calculate=function(arg){function steyx(y,x){var sumXDeltaYDelta=0,sqrXDelta=0,sqrYDelta=0,_x=0,_y=0,xLength=0,i;if(x.length!=y.length)return new cError(cErrorType.not_available); for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;_x+=x[i].getValue();_y+=y[i].getValue();xLength++}_x/=xLength;_y/=xLength;for(i=0;i<x.length;i++){if(!(x[i]instanceof cNumber&&y[i]instanceof cNumber))continue;sumXDeltaYDelta+=(x[i].getValue()-_x)*(y[i].getValue()-_y);sqrXDelta+=(x[i].getValue()-_x)*(x[i].getValue()-_x);sqrYDelta+=(y[i].getValue()-_y)*(y[i].getValue()-_y)}if(sqrXDelta==0||sqrYDelta==0||xLength<3)return new cError(cErrorType.division_by_zero);else return new cNumber(Math.sqrt(1/ (xLength-2)*(sqrYDelta-sumXDeltaYDelta*sumXDeltaYDelta/sqrXDelta)))}var arg0=arg[0],arg1=arg[1],arr0=[],arr1=[];if(arg0 instanceof cArea)arr0=arg0.getValue();else if(arg0 instanceof cArray)arg0.foreach(function(elem){arr0.push(elem)});else return new cError(cErrorType.wrong_value_type);if(arg1 instanceof cArea)arr1=arg1.getValue();else if(arg1 instanceof cArray)arg1.foreach(function(elem){arr1.push(elem)});else return new cError(cErrorType.wrong_value_type);return steyx(arr0,arr1)};function cTDIST(){} cTDIST.prototype=Object.create(cBaseFunction.prototype);cTDIST.prototype.constructor=cTDIST;cTDIST.prototype.name="TDIST";cTDIST.prototype.argumentsMin=3;cTDIST.prototype.argumentsMax=3;cTDIST.prototype.argumentsType=[argType.number,argType.number,argType.number];cTDIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber(); var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var T=argArray[0];var fDF=argArray[1];var nType=argArray[2];var res=getTDist(T,fDF,nType);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};if(argClone[1].getValue()<1||argClone[0].getValue()<0||argClone[2].getValue()!==1&&argClone[2].getValue()!==2)return new cError(cErrorType.not_numeric);return this._findArrayInNumberArguments(oArguments,calcTDist)};function cT_DIST(){} cT_DIST.prototype=Object.create(cBaseFunction.prototype);cT_DIST.prototype.constructor=cT_DIST;cT_DIST.prototype.name="T.DIST";cT_DIST.prototype.argumentsMin=3;cT_DIST.prototype.argumentsMax=3;cT_DIST.prototype.isXLFN=true;cT_DIST.prototype.argumentsType=[argType.number,argType.number,argType.logical];cT_DIST.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber(); argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var T=argArray[0];var fDF=argArray[1];var bCumulative=argArray[2];var res=getTDist(T,fDF,bCumulative?4:3);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};if(argClone[1].getValue()<1)return new cError(cErrorType.not_numeric);return this._findArrayInNumberArguments(oArguments,calcTDist)};function cT_DIST_2T(){}cT_DIST_2T.prototype= Object.create(cBaseFunction.prototype);cT_DIST_2T.prototype.constructor=cT_DIST_2T;cT_DIST_2T.prototype.name="T.DIST.2T";cT_DIST_2T.prototype.argumentsMin=2;cT_DIST_2T.prototype.argumentsMax=2;cT_DIST_2T.prototype.isXLFN=true;cT_DIST_2T.prototype.argumentsType=[argType.number,argType.number];cT_DIST_2T.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError; if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var T=argArray[0];var fDF=argArray[1];if(fDF<1||T<0)return new cError(cErrorType.not_numeric);var res=getTDist(T,fDF,2);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcTDist)};function cT_DIST_RT(){}cT_DIST_RT.prototype=Object.create(cBaseFunction.prototype);cT_DIST_RT.prototype.constructor=cT_DIST_RT;cT_DIST_RT.prototype.name= "T.DIST.RT";cT_DIST_RT.prototype.argumentsMin=2;cT_DIST_RT.prototype.argumentsMax=2;cT_DIST_RT.prototype.isXLFN=true;cT_DIST_RT.prototype.argumentsType=[argType.number,argType.number];cT_DIST_RT.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var T= argArray[0];var fDF=argArray[1];if(fDF<1)return new cError(cErrorType.not_numeric);var res=getTDist(T,fDF,1);if(T<0)res=1-res;return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments,calcTDist)};function cT_INV(){}cT_INV.prototype=Object.create(cBaseFunction.prototype);cT_INV.prototype.constructor=cT_INV;cT_INV.prototype.name="T.INV";cT_INV.prototype.argumentsMin=2;cT_INV.prototype.argumentsMax=2;cT_INV.prototype.isXLFN= true;cT_INV.prototype.argumentsType=[argType.number,argType.number];cT_INV.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var fP=argArray[0];var fDF=parseInt(argArray[1]);if(fDF<1||fP<=0||fP>1)return new cError(cErrorType.not_numeric);var aFunc,oVal, bConvError,res=null;if(fP===1)return new cError(cErrorType.not_numeric);else if(fP<.5){aFunc=new TDISTFUNCTION(1-fP,fDF,4);oVal=iterateInverse(aFunc,fDF*.5,fDF);bConvError=oVal.bError;res=-oVal.val}else{aFunc=new TDISTFUNCTION(fP,fDF,4);oVal=iterateInverse(aFunc,fDF*.5,fDF);bConvError=oVal.bError;res=oVal.val}if(bConvError)return new cError(cErrorType.not_numeric);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)};return this._findArrayInNumberArguments(oArguments, calcTDist)};function cT_INV_2T(){}cT_INV_2T.prototype=Object.create(cBaseFunction.prototype);cT_INV_2T.prototype.constructor=cT_INV_2T;cT_INV_2T.prototype.name="T.INV.2T";cT_INV_2T.prototype.argumentsMin=2;cT_INV_2T.prototype.argumentsMax=2;cT_INV_2T.prototype.isXLFN=true;cT_INV_2T.prototype.argumentsType=[argType.number,argType.number];cT_INV_2T.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber(); argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTDist=function(argArray){var fP=argArray[0];var fDF=parseInt(argArray[1]);if(fDF<1||fP<=0||fP>1)return new cError(cErrorType.not_numeric);var aFunc=new TDISTFUNCTION(fP,fDF,2);var oVal=iterateInverse(aFunc,fDF*.5,fDF);var bConvError=oVal.bError;var res=oVal.val;if(bConvError)return new cError(cErrorType.not_numeric);return null!==res&&!isNaN(res)?new cNumber(res):new cError(cErrorType.wrong_value_type)}; return this._findArrayInNumberArguments(oArguments,calcTDist)};function cTINV(){}cTINV.prototype=Object.create(cT_INV_2T.prototype);cTINV.prototype.constructor=cTINV;cTINV.prototype.name="TINV";cTINV.prototype.argumentsType=[argType.number,argType.number];function cTREND(){}cTREND.prototype=Object.create(cBaseFunction.prototype);cTREND.prototype.constructor=cTREND;cTREND.prototype.name="TREND";cTREND.prototype.argumentsMin=1;cTREND.prototype.argumentsMax=4;cTREND.prototype.arrayIndexes={0:1,1:1,2:1}; cTREND.prototype.argumentsType=[argType.reference,argType.reference,argType.reference,argType.logical];cTREND.prototype.numFormat=AscCommonExcel.cNumFormatNone;cTREND.prototype.Calculate=function(arg){var prepeareArgs=prepeareGrowthTrendCalculation(this,arg);if(cElementType.error===prepeareArgs.type)return prepeareArgs;var pMatY=prepeareArgs.pMatY;var pMatX=prepeareArgs.pMatX;var pMatNewX=prepeareArgs.pMatNewX;var bConstant=prepeareArgs.bConstant;var mat=CalculateTrendGrowth(pMatY,pMatX,pMatNewX, bConstant);if(mat&&mat[0]&&mat[0][0]!==undefined){var tMatrix=[],res=new cArray;for(var i=0;i<mat.length;i++)for(var j=0;j<mat[i].length;j++){if(!tMatrix[j])tMatrix[j]=[];tMatrix[j][i]=new cNumber(mat[i][j])}res.fillFromArray(tMatrix);return res}else return new cError(cErrorType.wrong_value_type)};function cTRIMMEAN(){}cTRIMMEAN.prototype=Object.create(cBaseFunction.prototype);cTRIMMEAN.prototype.constructor=cTRIMMEAN;cTRIMMEAN.prototype.name="TRIMMEAN";cTRIMMEAN.prototype.argumentsMin=2;cTRIMMEAN.prototype.argumentsMax= 2;cTRIMMEAN.prototype.arrayIndexes={0:1};cTRIMMEAN.prototype.argumentsType=[argType.number,argType.number];cTRIMMEAN.prototype.Calculate=function(arg){var arg2=[arg[0],arg[1]];if(cElementType.string===arg[0].type||cElementType.bool===arg[0].type)return new cError(cErrorType.wrong_value_type);if(cElementType.number===arg[0].type){arg2[0]=new cArray;arg2[0].addElement(arg[0])}var oArguments=this._prepareArguments(arg2,arguments[1],true,[cElementType.array]);var argClone=oArguments.args;argClone[1]= argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTrimMean=function(argArray){var arg0=argArray[0];var arg1=argArray[1];if(arg1<0||arg1>=1)return new cError(cErrorType.not_numeric);var arr=[];for(var i=0;i<arg0.length;i++)for(var j=0;j<arg0[i].length;j++)if(cElementType.number===arg0[i][j].type)arr.push(arg0[i][j].getValue());var aSortArray=arr.sort(fSortAscending);var nSize=aSortArray.length;if(nSize==0)return new cError(cErrorType.not_numeric); else{var nIndex=Math.floor(arg1*nSize);if(nIndex%2!==0)nIndex--;nIndex/=2;var fSum=0;for(var i=nIndex;i<nSize-nIndex;i++)fSum+=aSortArray[i];return new cNumber(fSum/(nSize-2*nIndex))}};return this._findArrayInNumberArguments(oArguments,calcTrimMean)};function cTTEST(){}cTTEST.prototype=Object.create(cBaseFunction.prototype);cTTEST.prototype.constructor=cTTEST;cTTEST.prototype.name="TTEST";cTTEST.prototype.argumentsMin=4;cTTEST.prototype.argumentsMax=4;cTTEST.prototype.arrayIndexes={0:1,1:1};cTTEST.prototype.argumentsType= [argType.array,argType.array,argType.number,argType.number];cTTEST.prototype.Calculate=function(arg){var arg2=[arg[0],arg[1],arg[2],arg[3]];if(cElementType.string===arg[0].type||cElementType.bool===arg[0].type)return new cError(cErrorType.wrong_value_type);if(cElementType.string===arg[1].type||cElementType.bool===arg[1].type)return new cError(cErrorType.wrong_value_type);if(cElementType.number===arg[0].type){arg2[0]=new cArray;arg2[0].addElement(arg[0])}if(cElementType.number===arg[1].type){arg2[1]= new cArray;arg2[1].addElement(arg[1])}var oArguments=this._prepareArguments(arg2,arguments[1],true,[cElementType.array,cElementType.array]);var argClone=oArguments.args;argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcTTest=function(argArray){var arg0=argArray[0];var arg1=argArray[1];var arg2=parseInt(argArray[2]);var arg3=parseInt(argArray[3]);if(!(arg2===1||arg2===2))return new cError(cErrorType.not_numeric); return tTest(arg0,arg1,arg2,arg3)};return this._findArrayInNumberArguments(oArguments,calcTTest)};function cT_TEST(){}cT_TEST.prototype=Object.create(cTTEST.prototype);cT_TEST.prototype.constructor=cT_TEST;cT_TEST.prototype.name="T.TEST";cT_TEST.prototype.isXLFN=true;cT_TEST.prototype.argumentsType=[argType.array,argType.array,argType.number,argType.number];function cVAR(){}cVAR.prototype=Object.create(cBaseFunction.prototype);cVAR.prototype.constructor=cVAR;cVAR.prototype.name="VAR";cVAR.prototype.argumentsMin= 1;cVAR.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cVAR.prototype.argumentsType=[[argType.number]];cVAR.prototype.Calculate=function(arg){function _var(x){if(x.length<=1)return new cError(cErrorType.division_by_zero);var i,tA=[],sumSQRDeltaX=0,_x=0,xLength=0;for(i=0;i<x.length;i++)if(cElementType.number===x[i].type){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(cElementType.error===x[i].type)return x[i];_x/=xLength;for(i=0;i<x.length;i++)sumSQRDeltaX+=(tA[i]- _x)*(tA[i]-_x);return new cNumber(sumSQRDeltaX/(xLength-1))}var element,arr0=[];var error;for(var j=0;j<arg.length;j++){element=arg[j];if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var _arrVal=element.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);_arrVal.forEach(function(elem){if(cElementType.number===elem.type)arr0.push(elem);else if(cElementType.error===elem.type&&!error)error=elem});if(error)return error}else if(cElementType.cell=== element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){var a=element.getValue();if(cElementType.number===a.type)arr0.push(a);else if(cElementType.error===a.type)return a}}else if(cElementType.array===element.type){element.foreach(function(elem){if(cElementType.number===elem.type)arr0.push(elem);else if(cElementType.error===elem.type&&!error)error=elem});if(error)return error}else if(cElementType.number===element.type||cElementType.bool=== element.type)arr0.push(element.tocNumber());else if(cElementType.string===element.type||cElementType.empty===element.type)continue;else if(cElementType.error===element.type)return element;else return new cError(cErrorType.wrong_value_type)}return _var(arr0)};function cVARA(){}cVARA.prototype=Object.create(cBaseFunction.prototype);cVARA.prototype.constructor=cVARA;cVARA.prototype.name="VARA";cVARA.prototype.argumentsMin=1;cVARA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cVARA.prototype.argumentsType= [[argType.number]];cVARA.prototype.Calculate=function(arg){function _var(x){if(x.length<1)return new cError(cErrorType.division_by_zero);var tA=[],sumSQRDeltaX=0,_x=0,xLength=0,i;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(x[i]instanceof cError)return x[i];_x/=xLength;for(i=0;i<x.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(sumSQRDeltaX/(xLength-1))}var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber||elem instanceof cError)arr0.push(elem);else if(elem instanceof cBool)arr0.push(elem.tocNumber());else if(elem instanceof cString)arr0.push(new cNumber(0))});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber||a instanceof cError)arr0.push(a);else if(a instanceof cBool)arr0.push(a.tocNumber());else if(a instanceof cString)arr0.push(new cNumber(0))}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber||elem instanceof cError)arr0.push(elem);else if(elem instanceof cBool)arr0.push(elem.tocNumber());else if(a instanceof cString)arr0.push(new cNumber(0))});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)arr0.push(new cNumber(0));else if(arg[j]instanceof cError)return new cError(cErrorType.wrong_value_type);return _var(arr0)};function cVARP(){}cVARP.prototype=Object.create(cBaseFunction.prototype); cVARP.prototype.constructor=cVARP;cVARP.prototype.name="VARP";cVARP.prototype.argumentsMin=1;cVARP.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cVARP.prototype.argumentsType=[[argType.number]];cVARP.prototype.Calculate=function(arg){function _var(x){if(x.length<1)return new cError(cErrorType.division_by_zero);var tA=[],sumSQRDeltaX=0,_x=0,xLength=0,i;for(i=0;i<x.length;i++)if(cElementType.number===x[i].type){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(cElementType.error=== x[i].type)return x[i];_x/=xLength;for(i=0;i<x.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(sumSQRDeltaX/xLength)}var element,arr0=[];var error;for(var j=0;j<arg.length;j++){element=arg[j];if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var _arrVal=element.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);_arrVal.forEach(function(elem){if(cElementType.number===elem.type)arr0.push(elem);else if(cElementType.error=== elem.type&&!error)error=elem});if(error)return error}else if(cElementType.cell===element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){var a=element.getValue();if(cElementType.number===a.type)arr0.push(a);else if(cElementType.error===a.type)return a}}else if(cElementType.array===element.type){element.foreach(function(elem){if(cElementType.number===elem.type)arr0.push(elem);else if(cElementType.error===elem.type&&!error)error=elem});if(error)return error}else if(cElementType.number=== element.type||cElementType.bool===element.type)arr0.push(element.tocNumber());else if(cElementType.string===element.type||cElementType.empty===element.type)arr0.push(new cNumber(0));else if(cElementType.error===element.type)return element;else return new cError(cErrorType.wrong_value_type)}return _var(arr0)};function cVAR_P(){}cVAR_P.prototype=Object.create(cVARP.prototype);cVAR_P.prototype.constructor=cVAR_P;cVAR_P.prototype.name="VAR.P";cVAR_P.prototype.isXLFN=true;cVAR_P.prototype.argumentsType= [[argType.number]];function cVAR_S(){}cVAR_S.prototype=Object.create(cBaseFunction.prototype);cVAR_S.prototype.constructor=cVAR_S;cVAR_S.prototype.name="VAR.S";cVAR_S.prototype.argumentsMin=1;cVAR_S.prototype.isXLFN=true;cVAR_S.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cVAR_S.prototype.argumentsType=[[argType.number]];cVAR_S.prototype.Calculate=function(arg){function _var(x){if(x.length<=1)return new cError(cErrorType.division_by_zero);var tA=[],sumSQRDeltaX=0,_x=0,xLength= 0,i;for(i=0;i<x.length;i++)if(cElementType.number===x[i].type){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(cElementType.error===x[i].type)return x[i];_x/=xLength;for(i=0;i<x.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(sumSQRDeltaX/(xLength-1))}var element,arr0=[];var error;for(var j=0;j<arg.length;j++){element=arg[j];if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var _arrVal=element.getValue(this.checkExclude,this.excludeHiddenRows, this.excludeErrorsVal,this.excludeNestedStAg);_arrVal.forEach(function(elem){if(cElementType.number===elem.type)arr0.push(elem);else if(cElementType.error===elem.type&&!error)error=elem});if(error)return error}else if(cElementType.cell===element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){var a=element.getValue();if(cElementType.number===a.type)arr0.push(a);else if(cElementType.error===a.type)return a}}else if(cElementType.array===element.type){element.foreach(function(elem){if(cElementType.number=== elem.type)arr0.push(elem);else if(cElementType.error===elem.type&&!error)error=elem});if(error)return error}else if(cElementType.number===element.type||cElementType.bool===element.type)arr0.push(element.tocNumber());else if(cElementType.string===element.type||cElementType.empty===element.type)arr0.push(new cNumber(0));else if(cElementType.error===element.type)return element;else return new cError(cErrorType.wrong_value_type)}return _var(arr0)};function cVARdotP(){}cVARdotP.prototype=Object.create(cBaseFunction.prototype); cVARdotP.prototype.constructor=cVARdotP;cVARdotP.prototype.name="VAR.P";cVARdotP.prototype.argumentsMin=1;cVARdotP.prototype.Calculate=cVARP.prototype.Calculate;cVARdotP.prototype.argumentsType=[[argType.number]];function cVARPA(){}cVARPA.prototype=Object.create(cBaseFunction.prototype);cVARPA.prototype.constructor=cVARPA;cVARPA.prototype.name="VARPA";cVARPA.prototype.argumentsMin=1;cVARPA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cVARPA.prototype.argumentsType=[[argType.number]]; cVARPA.prototype.Calculate=function(arg){function _var(x){if(x.length<1)return new cError(cErrorType.division_by_zero);var tA=[],sumSQRDeltaX=0,_x=0,xLength=0,i;for(i=0;i<x.length;i++)if(x[i]instanceof cNumber){_x+=x[i].getValue();tA.push(x[i].getValue());xLength++}else if(x[i]instanceof cError)return x[i];_x/=xLength;for(i=0;i<x.length;i++)sumSQRDeltaX+=(tA[i]-_x)*(tA[i]-_x);return new cNumber(sumSQRDeltaX/xLength)}var arr0=[];for(var j=0;j<arg.length;j++)if(arg[j]instanceof cArea||arg[j]instanceof cArea3D)arg[j].foreach2(function(elem){if(elem instanceof cNumber||elem instanceof cError)arr0.push(elem);else if(elem instanceof cBool)arr0.push(elem.tocNumber());else if(elem instanceof cString)arr0.push(new cNumber(0))});else if(arg[j]instanceof cRef||arg[j]instanceof cRef3D){var a=arg[j].getValue();if(a instanceof cNumber||a instanceof cError)arr0.push(a);else if(a instanceof cBool)arr0.push(a.tocNumber());else if(a instanceof cString)arr0.push(new cNumber(0))}else if(arg[j]instanceof cArray)arg[j].foreach(function(elem){if(elem instanceof cNumber||elem instanceof cError)arr0.push(elem);else if(elem instanceof cBool)arr0.push(elem.tocNumber());else if(elem instanceof cString)arr0.push(new cNumber(0))});else if(arg[j]instanceof cNumber||arg[j]instanceof cBool)arr0.push(arg[j].tocNumber());else if(arg[j]instanceof cString)arr0.push(new cNumber(0));else if(arg[j]instanceof cError)return arg[j];return _var(arr0)};function cWEIBULL(){}cWEIBULL.prototype=Object.create(cBaseFunction.prototype);cWEIBULL.prototype.constructor=cWEIBULL;cWEIBULL.prototype.name= "WEIBULL";cWEIBULL.prototype.argumentsMin=4;cWEIBULL.prototype.argumentsMax=4;cWEIBULL.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical];cWEIBULL.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();argClone[3]=argClone[3].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError; var calcWeibull=function(argArray){var x=argArray[0];var alpha=argArray[1];var beta=argArray[2];var kum=argArray[3];var res;if(alpha<=0||beta<=0||x<0)return new cError(cErrorType.not_numeric);else if(kum===0)res=alpha/Math.pow(beta,alpha)*Math.pow(x,alpha-1)*Math.exp(-Math.pow(x/beta,alpha));else res=1-Math.exp(-Math.pow(x/beta,alpha));return new cNumber(res)};return this._findArrayInNumberArguments(oArguments,calcWeibull)};function cWEIBULL_DIST(){}cWEIBULL_DIST.prototype=Object.create(cWEIBULL.prototype); cWEIBULL_DIST.prototype.constructor=cWEIBULL_DIST;cWEIBULL_DIST.prototype.name="WEIBULL.DIST";cWEIBULL_DIST.prototype.isXLFN=true;cWEIBULL_DIST.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical];function cZTEST(){}cZTEST.prototype=Object.create(cBaseFunction.prototype);cZTEST.prototype.constructor=cZTEST;cZTEST.prototype.name="ZTEST";cZTEST.prototype.argumentsMin=2;cZTEST.prototype.argumentsMax=3;cZTEST.prototype.arrayIndexes={0:1};cZTEST.prototype.argumentsType= [argType.number,argType.number,argType.number];cZTEST.prototype.Calculate=function(arg){var arg2=arg[2]?[arg[0],arg[1],arg[2]]:[arg[0],arg[1]];if(cElementType.string===arg[0].type||cElementType.bool===arg[0].type)return new cError(cErrorType.wrong_value_type);if(cElementType.number===arg[0].type){arg2[0]=new cArray;arg2[0].addElement(arg[0])}var oArguments=this._prepareArguments(arg2,arguments[1],true,[cElementType.array]);var argClone=oArguments.args;argClone[1]=argClone[1].tocNumber();argClone[2]= argClone[2]?argClone[2].tocNumber():new AscCommonExcel.cUndefined;var argError;if(argError=this._checkErrorArg(argClone))return argError;function calcZTest(argArray){var arg0=argArray[0];var x=argArray[1];var sigma=argArray[2];if(sigma!==undefined&&sigma<=0)return new cError(cErrorType.not_numeric);var nC1=arg0.length;var nR1=arg0[0].length;var fSum=0;var fSumSqr=0;var fVal;var rValCount=0;for(var i=0;i<nC1;i++)for(var j=0;j<nR1;j++){if(cElementType.number!==arg0[i][j].type||cElementType.number!== arg0[i][j].type)continue;fVal=arg0[i][j].getValue();fSum+=fVal;fSumSqr+=fVal*fVal;rValCount++}var res;if(rValCount<=1)return new cError(cErrorType.division_by_zero);else{var mue=fSum/rValCount;if(undefined===sigma){sigma=(fSumSqr-fSum*fSum/rValCount)/(rValCount-1);res=.5-gauss((mue-x)/Math.sqrt(sigma/rValCount))}else res=.5-gauss((mue-x)*Math.sqrt(rValCount)/sigma)}return new cNumber(res)}return this._findArrayInNumberArguments(oArguments,calcZTest)};function cZ_TEST(){}cZ_TEST.prototype=Object.create(cZTEST.prototype); cZ_TEST.prototype.constructor=cZ_TEST;cZ_TEST.prototype.name="Z.TEST";cZ_TEST.prototype.isXLFN=true;cZ_TEST.prototype.argumentsType=[argType.number,argType.number,argType.number];window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].phi=phi;window["AscCommonExcel"].gauss=gauss;window["AscCommonExcel"].gaussinv=gaussinv;window["AscCommonExcel"].getPercentile=getPercentile;window["AscCommonExcel"].cAVERAGE=cAVERAGE;window["AscCommonExcel"].cCOUNT=cCOUNT;window["AscCommonExcel"].cCOUNTA= cCOUNTA;window["AscCommonExcel"].cMAX=cMAX;window["AscCommonExcel"].cMIN=cMIN;window["AscCommonExcel"].cSTDEV=cSTDEV;window["AscCommonExcel"].cSTDEVP=cSTDEVP;window["AscCommonExcel"].cVAR=cVAR;window["AscCommonExcel"].cVARP=cVARP;window["AscCommonExcel"].cLARGE=cLARGE;window["AscCommonExcel"].cSMALL=cSMALL;window["AscCommonExcel"].cMEDIAN=cMEDIAN;window["AscCommonExcel"].cSTDEV_S=cSTDEV_S;window["AscCommonExcel"].cSTDEV_P=cSTDEV_P;window["AscCommonExcel"].cVAR_S=cVAR_S;window["AscCommonExcel"].cVAR_P= cVAR_P;window["AscCommonExcel"].cMODE_SNGL=cMODE_SNGL;window["AscCommonExcel"].cPERCENTILE_INC=cPERCENTILE_INC;window["AscCommonExcel"].cQUARTILE_INC=cQUARTILE_INC;window["AscCommonExcel"].cPERCENTILE_EXC=cPERCENTILE_EXC;window["AscCommonExcel"].cQUARTILE_EXC=cQUARTILE_EXC})(window);"use strict";(function(window,undefined){var cDate=Asc.cDate;var cErrorType=AscCommonExcel.cErrorType;var cNumber=AscCommonExcel.cNumber;var cBool=AscCommonExcel.cBool;var cError=AscCommonExcel.cError;var cArea=AscCommonExcel.cArea; var cArea3D=AscCommonExcel.cArea3D;var cEmpty=AscCommonExcel.cEmpty;var cArray=AscCommonExcel.cArray;var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var argType=Asc.c_oAscFormulaArgumentType;var startRangeCurrentDateSystem=1;function getPMT(rate,nper,pv,fv,flag){var res,part;if(rate===0)res=(pv+fv)/nper;else{part=Math.pow(1+rate,nper);if(flag>0)res=(fv*rate/(part-1)+pv*rate/(1-1/part))/(1+rate);else res=fv*rate/(part-1)+pv*rate/(1-1/part)}return-res} function getFV(rate,nper,pmt,pv,type){var res,part;if(rate===0)res=pv+pmt*nper;else{part=Math.pow(1+rate,nper);if(type>0)res=pv*part+pmt*(1+rate)*(part-1)/rate;else res=pv*part+pmt*(part-1)/rate}return-res}function getDDB(cost,salvage,life,period,factor){var ddb,ipmt,oldCost,newCost;ipmt=factor/life;if(ipmt>=1){ipmt=1;if(period===1)oldCost=cost;else oldCost=0}else oldCost=cost*Math.pow(1-ipmt,period-1);newCost=cost*Math.pow(1-ipmt,period);if(newCost<salvage)ddb=oldCost-salvage;else ddb=oldCost-newCost; if(ddb<0)ddb=0;return ddb}function getIPMT(rate,per,pv,type,pmt){var ipmt;if(per===1)if(type>0)ipmt=0;else ipmt=-pv;else if(type>0)ipmt=getFV(rate,per-2,pmt,pv,1)-pmt;else ipmt=getFV(rate,per-1,pmt,pv,0);return ipmt*rate}function RateIteration(nper,payment,pv,fv,payType,guess){var valid=true,found=false,x,xnew,term,termDerivation,geoSeries,geoSeriesDerivation,iterationMax=150,nCount=0,minEps=1E-14,eps=1E-7,powN,powNminus1;fv=fv-payment*payType;pv=pv+payment*payType;if(nper===Math.round(nper)){x=guess; while(!found&&nCount<iterationMax){powNminus1=Math.pow(1+x,nper-1);powN=powNminus1*(1+x);if(Math.approxEqual(Math.abs(x),0)){geoSeries=nper;geoSeriesDerivation=nper*(nper-1)/2}else{geoSeries=(powN-1)/x;geoSeriesDerivation=(nper*powNminus1-geoSeries)/x}term=fv+pv*powN+payment*geoSeries;termDerivation=pv*nper*powNminus1+payment*geoSeriesDerivation;if(Math.abs(term)<minEps)found=true;else{if(Math.approxEqual(Math.abs(termDerivation),0))xnew=x+1.1*eps;else xnew=x-term/termDerivation;nCount++;found=Math.abs(xnew- x)<eps;x=xnew}}valid=x>=-1}else{x=guess<-1?-1:guess;while(valid&&!found&&nCount<iterationMax){if(Math.approxEqual(Math.abs(x),0)){geoSeries=nper;geoSeriesDerivation=nper*(nper-1)/2}else{geoSeries=(Math.pow(1+x,nper)-1)/x;geoSeriesDerivation=nper*Math.pow(1+x,nper-1)/x-geoSeries/x}term=fv+pv*Math.pow(1+x,nper)+payment*geoSeries;termDerivation=pv*nper*Math.pow(1+x,nper-1)+payment*geoSeriesDerivation;if(Math.abs(term)<minEps)found=true;else{if(Math.approxEqual(Math.abs(termDerivation),0))xnew=x+1.1* eps;else xnew=x-term/termDerivation;nCount++;found=Math.abs(xnew-x)<eps;x=xnew;valid=x>=-1}}}if(valid&&found)return new cNumber(x);else return new cError(cErrorType.not_numeric)}function lcl_GetCouppcd(settl,matur,freq){var n=new cDate(matur);n.setUTCFullYear(settl.getUTCFullYear());if(n<settl)n.addYears(1);while(n>settl)n.addMonths(-12/freq);return n}function lcl_GetCoupncd(settl,matur,freq){matur.setUTCFullYear(settl.getUTCFullYear());if(matur>settl)matur.addYears(-1);while(matur<settl)matur.addMonths(12/ freq)}function getcoupdaybs(settl,matur,frequency,basis){var n=lcl_GetCouppcd(settl,matur,frequency);return AscCommonExcel.diffDate(n,settl,basis)}function getcoupdays(settl,matur,frequency,basis){if(basis==AscCommonExcel.DayCountBasis.ActualActual){var m=lcl_GetCouppcd(settl,matur,frequency),n=new cDate(m);n.addMonths(12/frequency);return AscCommonExcel.diffDate(m,n,basis)}return new cNumber(AscCommonExcel.daysInYear(0,basis)/frequency)}function getcoupnum(settl,matur,frequency){var n=lcl_GetCouppcd(settl, matur,frequency),months=(matur.getUTCFullYear()-n.getUTCFullYear())*12+matur.getUTCMonth()-n.getUTCMonth();return Math.ceil(months*frequency/12)}function getcoupdaysnc(settl,matur,frequency,basis){if(basis!==0&&basis!==4){lcl_GetCoupncd(settl,matur,frequency);return AscCommonExcel.diffDate(settl,matur,basis)}return getcoupdays(new cDate(settl),new cDate(matur),frequency,basis)-getcoupdaybs(new cDate(settl),new cDate(matur),frequency,basis)}function getcoupncd(settl,matur,frequency){var s=new cDate(settl), m=new cDate(matur);lcl_GetCoupncd(s,m,frequency);return m}function getprice(settle,mat,rate,yld,redemp,freq,base){var cdays=getcoupdays(new cDate(settle),new cDate(mat),freq,base),cnum=getcoupnum(new cDate(settle),new cDate(mat),freq),cdaybs=getcoupdaybs(new cDate(settle),new cDate(mat),freq,base),cdaysnc=(cdays-cdaybs)/cdays,fT1=100*rate/freq,fT2=1+yld/freq,res=redemp/Math.pow(1+yld/freq,cnum-1+cdaysnc);if(cnum==1)return(redemp+fT1)/(1+cdaysnc*yld/freq)-100*rate/freq*cdaybs/cdays;res-=100*rate/freq* cdaybs/cdays;for(var i=0;i<cnum;i++)res+=fT1/Math.pow(fT2,i+cdaysnc);return res}function getYield(settle,mat,coup,price,redemp,freq,base){var priceN=0,yield1=0,yield2=1,price1=getprice(settle,mat,coup,yield1,redemp,freq,base),price2=getprice(settle,mat,coup,yield2,redemp,freq,base),yieldN=(yield2-yield1)*.5;for(var i=0;i<100&&priceN!=price;i++){priceN=getprice(settle,mat,coup,yieldN,redemp,freq,base);if(price==price1)return yield1;else if(price==price2)return yield2;else if(price==priceN)return yieldN; else if(price<price2){yield2*=2;price2=getprice(settle,mat,coup,yield2,redemp,freq,base);yieldN=(yield2-yield1)*.5}else{if(price<priceN){yield1=yieldN;price1=priceN}else{yield2=yieldN;price2=priceN}yieldN=yield2-(yield2-yield1)*((price-price2)/(price1-price2))}}if(Math.abs(price-priceN)>price/100)return new cError(cErrorType.not_numeric);return new cNumber(yieldN)}function getyieldmat(settle,mat,issue,rate,price,base){var issMat=AscCommonExcel.yearFrac(issue,mat,base);var issSet=AscCommonExcel.yearFrac(issue, settle,base);var setMat=AscCommonExcel.yearFrac(settle,mat,base);var y=(1+issMat*rate)/(price/100+issSet*rate)-1;y/=setMat;return y}function getduration(settlement,maturity,coupon,yld,frequency,basis){var dbc=getcoupdaybs(new cDate(settlement),new cDate(maturity),frequency,basis),coupD=getcoupdays(new cDate(settlement),new cDate(maturity),frequency,basis),numCoup=getcoupnum(new cDate(settlement),new cDate(maturity),frequency);var duration=0,p=0;var dsc=coupD-dbc;var diff=dsc/coupD-1;yld=yld/frequency+ 1;coupon*=100/frequency;for(var index=1;index<=numCoup;index++){var di=index+diff;var yldPOW=Math.pow(yld,di);duration+=di*coupon/yldPOW;p+=coupon/yldPOW}duration+=(diff+numCoup)*100/Math.pow(yld,diff+numCoup);p+=100/Math.pow(yld,diff+numCoup);return duration/p/frequency}function oddFPrice(settl,matur,iss,firstCoup,rate,yld,redemption,frequency,basis){function positiveDaysBetween(d1,d2,b){var res=AscCommonExcel.diffDate(d1,d2,b).getValue();return res>0?res:0}function addMonth(orgDate,numMonths,returnLastDay){var newDate= new cDate(orgDate);newDate.addMonths(numMonths);if(returnLastDay)newDate.setUTCDate(newDate.getDaysInMonth());return newDate}function coupNumber(startDate,endDate,countMonths,isWholeNumber){var my=startDate.getUTCFullYear(),mm=startDate.getUTCMonth(),md=startDate.getUTCDate(),endOfMonthTemp=startDate.lastDayOfMonth(),endOfMonth=!endOfMonthTemp&&mm!=1&&md>28&&md<(new cDate(my,mm)).getDaysInMonth()?endDate.lastDayOfMonth():endOfMonthTemp,startDate=addMonth(endDate,0,endOfMonth),coupons=isWholeNumber- 0+(endDate<startDate),frontDate=addMonth(startDate,countMonths,endOfMonth);while(!(countMonths>0?frontDate>=endDate:frontDate<=endDate)){frontDate=addMonth(frontDate,countMonths,endOfMonth);coupons++}return coupons}var res=0,DSC,numMonths=12/frequency,numMonthsNeg=-numMonths,E=getcoupdays(settl,new cDate(firstCoup),frequency,basis).getValue(),coupNums=getcoupnum(settl,new cDate(matur),frequency),dfc=positiveDaysBetween(new cDate(iss),new cDate(firstCoup),basis);if(dfc<E){DSC=positiveDaysBetween(settl, firstCoup,basis);rate*=100/frequency;yld/=frequency;yld++;DSC/=E;res=redemption/Math.pow(yld,coupNums-1+DSC);res+=rate*dfc/E/Math.pow(yld,DSC);res-=rate*positiveDaysBetween(iss,settl,basis)/E;for(var i=1;i<coupNums;i++)res+=rate/Math.pow(yld,i+DSC)}else{var nc=getcoupnum(iss,firstCoup,frequency),lateCoupon=new cDate(firstCoup),DCdivNL=0,AdivNL=0,startDate,endDate,earlyCoupon,NLi,DCi;for(var index=nc;index>=1;index--){earlyCoupon=addMonth(lateCoupon,numMonthsNeg,false);NLi=basis==AscCommonExcel.DayCountBasis.ActualActual? positiveDaysBetween(earlyCoupon,lateCoupon,basis):E;DCi=index>1?NLi:positiveDaysBetween(iss,lateCoupon,basis);startDate=iss>earlyCoupon?iss:earlyCoupon;endDate=settl<lateCoupon?settl:lateCoupon;lateCoupon=new cDate(earlyCoupon);DCdivNL+=DCi/NLi;AdivNL+=positiveDaysBetween(startDate,endDate,basis)/NLi}if(basis==AscCommonExcel.DayCountBasis.Actual360||basis==AscCommonExcel.DayCountBasis.Actual365)DSC=positiveDaysBetween(settl,getcoupncd(settl,firstCoup,frequency),basis);else DSC=E-AscCommonExcel.diffDate(lcl_GetCouppcd(settl, firstCoup,frequency),settl,basis);var Nq=coupNumber(firstCoup,settl,numMonths,true);coupNums=getcoupnum(firstCoup,matur,frequency);yld/=frequency;yld++;DSC/=E;rate*=100/frequency;for(var i=1;i<=coupNums;i++)res+=1/Math.pow(yld,i+Nq+DSC);res*=rate;res+=redemption/Math.pow(yld,DSC+Nq+coupNums);res+=rate*DCdivNL/Math.pow(yld,Nq+DSC);res-=rate*AdivNL}return res}cFormulaFunctionGroup["Financial"]=cFormulaFunctionGroup["Financial"]||[];cFormulaFunctionGroup["Financial"].push(cACCRINT,cACCRINTM,cAMORDEGRC, cAMORLINC,cCOUPDAYBS,cCOUPDAYS,cCOUPDAYSNC,cCOUPNCD,cCOUPNUM,cCOUPPCD,cCUMIPMT,cCUMPRINC,cDB,cDDB,cDISC,cDOLLARDE,cDOLLARFR,cDURATION,cEFFECT,cFV,cFVSCHEDULE,cINTRATE,cIPMT,cIRR,cISPMT,cMDURATION,cMIRR,cNOMINAL,cNPER,cNPV,cODDFPRICE,cODDFYIELD,cODDLPRICE,cODDLYIELD,cPDURATION,cPMT,cPPMT,cPRICE,cPRICEDISC,cPRICEMAT,cPV,cRATE,cRECEIVED,cRRI,cSLN,cSYD,cTBILLEQ,cTBILLPRICE,cTBILLYIELD,cVDB,cXIRR,cXNPV,cYIELD,cYIELDDISC,cYIELDMAT);function cACCRINT(){}cACCRINT.prototype=Object.create(cBaseFunction.prototype); cACCRINT.prototype.constructor=cACCRINT;cACCRINT.prototype.name="ACCRINT";cACCRINT.prototype.argumentsMin=6;cACCRINT.prototype.argumentsMax=8;cACCRINT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cACCRINT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cACCRINT.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cACCRINT.prototype.Calculate=function(arg){var issue=arg[0],firstInterest=arg[1], settlement=arg[2],rate=arg[3],par=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(1E3),frequency=arg[5],basis=arg[6]&&!(arg[6]instanceof cEmpty)?arg[6]:new cNumber(0),calcMethod=arg[7]&&!(arg[7]instanceof cEmpty)?arg[7]:new cBool(true);if(issue instanceof cArea||issue instanceof cArea3D)issue=issue.cross(arguments[1]);else if(issue instanceof cArray)issue=issue.getElementRowCol(0,0);if(firstInterest instanceof cArea||firstInterest instanceof cArea3D)firstInterest=firstInterest.cross(arguments[1]); else if(firstInterest instanceof cArray)firstInterest=firstInterest.getElementRowCol(0,0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(par instanceof cArea||par instanceof cArea3D)par=par.cross(arguments[1]);else if(par instanceof cArray)par=par.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);if(calcMethod instanceof cArea||calcMethod instanceof cArea3D)calcMethod=calcMethod.cross(arguments[1]);else if(calcMethod instanceof cArray)calcMethod= calcMethod.getElementRowCol(0,0);issue=issue.tocNumber();firstInterest=firstInterest.tocNumber();settlement=settlement.tocNumber();rate=rate.tocNumber();par=par.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();calcMethod=calcMethod.tocBool();if(issue instanceof cError)return issue;if(firstInterest instanceof cError)return firstInterest;if(settlement instanceof cError)return settlement;if(rate instanceof cError)return rate;if(par instanceof cError)return par;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;if(calcMethod instanceof cError)return calcMethod;issue=Math.floor(issue.getValue());firstInterest=Math.floor(firstInterest.getValue());settlement=Math.floor(settlement.getValue());rate=rate.getValue();par=par.getValue();frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());calcMethod=calcMethod.toBool();if(issue<startRangeCurrentDateSystem||firstInterest<startRangeCurrentDateSystem||settlement<startRangeCurrentDateSystem|| issue>=settlement||rate<=0||par<=0||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric);function addMonth(orgDate,numMonths,returnLastDay){var newDate=new cDate(orgDate);newDate.addMonths(numMonths);if(returnLastDay)newDate.setUTCDate(newDate.getDaysInMonth());return newDate}var iss=cDate.prototype.getDateFromExcel(issue),fInter=cDate.prototype.getDateFromExcel(firstInterest),settl=cDate.prototype.getDateFromExcel(settlement),numMonths=12/frequency, numMonthsNeg=-numMonths,endMonth=fInter.lastDayOfMonth(),coupPCD,firstDate,startDate,endDate,res,days,coupDays;if(settl>fInter&&calcMethod){coupPCD=new cDate(fInter);startDate=endDate=new cDate(settl);while(!(numMonths>0?coupPCD>=startDate:coupPCD<=startDate)){endDate=coupPCD;coupPCD=addMonth(coupPCD,numMonths,endMonth)}}else coupPCD=addMonth(fInter,numMonthsNeg,endMonth);firstDate=new cDate(iss>coupPCD?iss:coupPCD);days=AscCommonExcel.days360(firstDate,settl,basis);coupDays=getcoupdays(coupPCD,fInter, frequency,basis).getValue();res=days/coupDays;startDate=new cDate(coupPCD);endDate=iss;while(!(numMonthsNeg>0?startDate>=iss:startDate<=iss)){endDate=startDate;startDate=addMonth(startDate,numMonthsNeg,endMonth);firstDate=iss>startDate?iss:startDate;if(basis==AscCommonExcel.DayCountBasis.UsPsa30_360){days=AscCommonExcel.days360(firstDate,endDate,!(iss>startDate));coupDays=getcoupdays(startDate,endDate,frequency,basis).getValue()}else{days=AscCommonExcel.diffDate(firstDate,endDate,basis).getValue(); coupDays=basis==AscCommonExcel.DayCountBasis.Actual365?365/frequency:AscCommonExcel.diffDate(startDate,endDate,basis).getValue()}res+=iss<=startDate?calcMethod:days/coupDays}res*=par*rate/frequency;return new cNumber(res)};function cACCRINTM(){}cACCRINTM.prototype=Object.create(cBaseFunction.prototype);cACCRINTM.prototype.constructor=cACCRINTM;cACCRINTM.prototype.name="ACCRINTM";cACCRINTM.prototype.argumentsMin=4;cACCRINTM.prototype.argumentsMax=5;cACCRINTM.prototype.numFormat=AscCommonExcel.cNumFormatNone; cACCRINTM.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cACCRINTM.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any];cACCRINTM.prototype.Calculate=function(arg){var issue=arg[0],settlement=arg[1],rate=arg[2],par=arg[3]&&!(arg[3]instanceof cEmpty)?arg[3]:new cNumber(1E3),basis=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(0);if(issue instanceof cArea||issue instanceof cArea3D)issue=issue.cross(arguments[1]);else if(issue instanceof cArray)issue=issue.getElementRowCol(0,0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(par instanceof cArea||par instanceof cArea3D)par=par.cross(arguments[1]);else if(par instanceof cArray)par=par.getElementRowCol(0, 0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);issue=issue.tocNumber();settlement=settlement.tocNumber();rate=rate.tocNumber();par=par.tocNumber();basis=basis.tocNumber();if(issue instanceof cError)return issue;if(settlement instanceof cError)return settlement;if(rate instanceof cError)return rate;if(par instanceof cError)return par;if(basis instanceof cError)return basis;issue=Math.floor(issue.getValue()); settlement=Math.floor(settlement.getValue());rate=rate.getValue();par=par.getValue();basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||issue<startRangeCurrentDateSystem||issue>=settlement||rate<=0||par<=0||basis<0||basis>4)return new cError(cErrorType.not_numeric);var res=AscCommonExcel.yearFrac(cDate.prototype.getDateFromExcel(issue),cDate.prototype.getDateFromExcel(settlement),basis);res*=rate*par;return new cNumber(res)};function cAMORDEGRC(){}cAMORDEGRC.prototype=Object.create(cBaseFunction.prototype); cAMORDEGRC.prototype.constructor=cAMORDEGRC;cAMORDEGRC.prototype.name="AMORDEGRC";cAMORDEGRC.prototype.argumentsMin=6;cAMORDEGRC.prototype.argumentsMax=7;cAMORDEGRC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cAMORDEGRC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cAMORDEGRC.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cAMORDEGRC.prototype.Calculate=function(arg){var cost=arg[0],datePurch=arg[1], firstPer=arg[2],salvage=arg[3],period=arg[4],rate=arg[5],basis=arg[6]&&!(arg[6]instanceof cEmpty)?arg[6]:new cNumber(0);if(cost instanceof cArea||cost instanceof cArea3D)cost=cost.cross(arguments[1]);else if(cost instanceof cArray)cost=cost.getElementRowCol(0,0);if(datePurch instanceof cArea||datePurch instanceof cArea3D)datePurch=datePurch.cross(arguments[1]);else if(datePurch instanceof cArray)datePurch=datePurch.getElementRowCol(0,0);if(firstPer instanceof cArea||firstPer instanceof cArea3D)firstPer= firstPer.cross(arguments[1]);else if(firstPer instanceof cArray)firstPer=firstPer.getElementRowCol(0,0);if(salvage instanceof cArea||salvage instanceof cArea3D)salvage=salvage.cross(arguments[1]);else if(salvage instanceof cArray)salvage=salvage.getElementRowCol(0,0);if(period instanceof cArea||period instanceof cArea3D)period=period.cross(arguments[1]);else if(period instanceof cArray)period=period.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]); else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);cost=cost.tocNumber();datePurch=datePurch.tocNumber();firstPer=firstPer.tocNumber();salvage=salvage.tocNumber();period=period.tocNumber();rate=rate.tocNumber();basis=basis.tocNumber();if(cost instanceof cError)return cost;if(datePurch instanceof cError)return datePurch;if(firstPer instanceof cError)return firstPer;if(salvage instanceof cError)return salvage;if(period instanceof cError)return period;if(rate instanceof cError)return rate;if(basis instanceof cError)return basis;rate=rate.getValue();cost=cost.getValue();salvage=salvage.getValue();period=period.getValue();basis=Math.floor(basis.getValue());datePurch=datePurch.getValue();firstPer=firstPer.getValue();if(cost<0||salvage<0||period<0||rate<=0||basis==2||basis<0||basis>4||firstPer<0||datePurch<0||datePurch>firstPer||cost<salvage)return new cError(cErrorType.not_numeric); if(cost==salvage)return new cNumber(0);datePurch=cDate.prototype.getDateFromExcel(datePurch);firstPer=cDate.prototype.getDateFromExcel(firstPer);function findDepr(countedPeriod,depr,rate,cost){if(countedPeriod>period)return new cNumber(Math.round(depr));else countedPeriod++;var calcT=assetLife-countedPeriod,deprTemp=calcT==2?cost*.5:rate*cost;rate=calcT==2?1:rate;if(cost<salvage)if(cost-salvage<0)depr=0;else depr=cost-salvage;else depr=deprTemp;cost-=depr;return findDepr(countedPeriod,depr,rate,cost)} function firstDeprLinc(cost,datePurch,firstP,salvage,rate,per,basis){function fix29February(d){if((basis==AscCommonExcel.DayCountBasis.ActualActual||basis==AscCommonExcel.DayCountBasis.Actual365)&&d.isLeapYear()&&d.getUTCMonth()==2&&d.getUTCDate()>=28)return new cDate(d.getUTCFullYear(),d.getUTCMonth(),28);else return d}var firstLen=AscCommonExcel.diffDate(fix29February(datePurch),fix29February(firstP),basis),firstDeprTemp=firstLen/AscCommonExcel.daysInYear(datePurch,basis)*rate*cost,firstDepr=firstDeprTemp== 0?cost*rate:firstDeprTemp,period=firstDeprTemp==0?per:per+1,availDepr=cost-salvage;if(firstDepr>availDepr)return[availDepr,period];else return[firstDepr,period]}var per=1/rate,coeff,res;if(cost==salvage||period>per)res=new cNumber(0);else{if(per>=3&&per<=4)coeff=1.5;else if(per>=5&&per<=6)coeff=2;else if(per>6)coeff=2.5;else res=new cError(cErrorType.not_numeric);var deprR=rate*coeff,o=firstDeprLinc(cost,datePurch,firstPer,salvage,deprR,per,basis);var firstDeprLinc=o[0],assetLife=o[1],firstDepr=Math.round(firstDeprLinc); if(period==0)res=new cNumber(firstDepr);else res=findDepr(1,0,deprR,cost-firstDepr)}return res};function cAMORLINC(){}cAMORLINC.prototype=Object.create(cBaseFunction.prototype);cAMORLINC.prototype.constructor=cAMORLINC;cAMORLINC.prototype.name="AMORLINC";cAMORLINC.prototype.argumentsMin=6;cAMORLINC.prototype.argumentsMax=7;cAMORLINC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cAMORLINC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cAMORLINC.prototype.argumentsType= [argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cAMORLINC.prototype.Calculate=function(arg){var cost=arg[0],datePurch=arg[1],firstPer=arg[2],salvage=arg[3],period=arg[4],rate=arg[5],basis=arg[6]&&!(arg[6]instanceof cEmpty)?arg[6]:new cNumber(0);if(cost instanceof cArea||cost instanceof cArea3D)cost=cost.cross(arguments[1]);else if(cost instanceof cArray)cost=cost.getElementRowCol(0,0);if(datePurch instanceof cArea||datePurch instanceof cArea3D)datePurch=datePurch.cross(arguments[1]); else if(datePurch instanceof cArray)datePurch=datePurch.getElementRowCol(0,0);if(firstPer instanceof cArea||firstPer instanceof cArea3D)firstPer=firstPer.cross(arguments[1]);else if(firstPer instanceof cArray)firstPer=firstPer.getElementRowCol(0,0);if(salvage instanceof cArea||salvage instanceof cArea3D)salvage=salvage.cross(arguments[1]);else if(salvage instanceof cArray)salvage=salvage.getElementRowCol(0,0);if(period instanceof cArea||period instanceof cArea3D)period=period.cross(arguments[1]); else if(period instanceof cArray)period=period.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);cost=cost.tocNumber();datePurch=datePurch.tocNumber();firstPer=firstPer.tocNumber();salvage=salvage.tocNumber();period=period.tocNumber();rate= rate.tocNumber();basis=basis.tocNumber();if(cost instanceof cError)return cost;if(datePurch instanceof cError)return datePurch;if(firstPer instanceof cError)return firstPer;if(salvage instanceof cError)return salvage;if(period instanceof cError)return period;if(rate instanceof cError)return rate;if(basis instanceof cError)return basis;cost=cost.getValue();datePurch=datePurch.getValue();firstPer=firstPer.getValue();salvage=salvage.getValue();period=period.getValue();rate=rate.getValue();basis=Math.floor(basis.getValue()); var val0=cDate.prototype.getDateFromExcel(datePurch),val1=cDate.prototype.getDateFromExcel(firstPer);if(cost<0||salvage<0||period<0||rate<=0||basis==2||basis<0||basis>4||datePurch<0||firstPer<0||datePurch>firstPer||cost<salvage)return new cError(cErrorType.not_numeric);var fDepTime=AscCommonExcel.yearFrac(val0,val1,basis).getValue()*rate*cost,fDep,depr=rate*cost,availDepr,availDeprTemp,countedPeriod=1,c=0,maxIter=1E4;fDep=fDepTime==0?cost*rate:fDepTime;availDepr=cost-salvage-fDep;rate=Math.ceil(1/ rate);if(cost==salvage||period>rate)return new cNumber(0);else if(period==0)return new cNumber(fDep);else{while(countedPeriod<=period&&c<maxIter){depr=depr>availDepr?availDepr:depr;availDeprTemp=availDepr-depr;availDepr=availDeprTemp<0?0:availDeprTemp;countedPeriod++;c++}return new cNumber(Math.floor(depr))}};function cCOUPDAYBS(){}cCOUPDAYBS.prototype=Object.create(cBaseFunction.prototype);cCOUPDAYBS.prototype.constructor=cCOUPDAYBS;cCOUPDAYBS.prototype.name="COUPDAYBS";cCOUPDAYBS.prototype.argumentsMin= 3;cCOUPDAYBS.prototype.argumentsMax=4;cCOUPDAYBS.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUPDAYBS.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCOUPDAYBS.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any];cCOUPDAYBS.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],frequency=arg[2],basis=arg[3]&&!(arg[3]instanceof cEmpty)?arg[3]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement= settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());basis= Math.floor(basis.getValue());frequency=Math.floor(frequency.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);return new cNumber(getcoupdaybs(settl,matur,frequency,basis))};function cCOUPDAYS(){}cCOUPDAYS.prototype=Object.create(cBaseFunction.prototype); cCOUPDAYS.prototype.constructor=cCOUPDAYS;cCOUPDAYS.prototype.name="COUPDAYS";cCOUPDAYS.prototype.argumentsMin=3;cCOUPDAYS.prototype.argumentsMax=4;cCOUPDAYS.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUPDAYS.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCOUPDAYS.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any];cCOUPDAYS.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],frequency=arg[2],basis=arg[3]&&!(arg[3]instanceof cEmpty)?arg[3]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis; settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);return new cNumber(getcoupdays(settl, matur,frequency,basis))};function cCOUPDAYSNC(){}cCOUPDAYSNC.prototype=Object.create(cBaseFunction.prototype);cCOUPDAYSNC.prototype.constructor=cCOUPDAYSNC;cCOUPDAYSNC.prototype.name="COUPDAYSNC";cCOUPDAYSNC.prototype.argumentsMin=3;cCOUPDAYSNC.prototype.argumentsMax=4;cCOUPDAYSNC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUPDAYSNC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCOUPDAYSNC.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any]; cCOUPDAYSNC.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],frequency=arg[2],basis=arg[3]&&!(arg[3]instanceof cEmpty)?arg[3]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0, 0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement; if(maturity instanceof cError)return maturity;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric); var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);return new cNumber(getcoupdaysnc(new cDate(settl),new cDate(matur),frequency,basis))};function cCOUPNCD(){}cCOUPNCD.prototype=Object.create(cBaseFunction.prototype);cCOUPNCD.prototype.constructor=cCOUPNCD;cCOUPNCD.prototype.name="COUPNCD";cCOUPNCD.prototype.argumentsMin=3;cCOUPNCD.prototype.argumentsMax=4;cCOUPNCD.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUPNCD.prototype.returnValueType= AscCommonExcel.cReturnFormulaType.value_replace_area;cCOUPNCD.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any];cCOUPNCD.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],frequency=arg[2],basis=arg[3]&&!(arg[3]instanceof cEmpty)?arg[3]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber(); maturity=maturity.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem|| settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);var res=new cNumber(getcoupncd(settl,matur,frequency).getExcelDate());res.numFormat=14;return res};function cCOUPNUM(){}cCOUPNUM.prototype=Object.create(cBaseFunction.prototype);cCOUPNUM.prototype.constructor=cCOUPNUM;cCOUPNUM.prototype.name="COUPNUM";cCOUPNUM.prototype.argumentsMin= 3;cCOUPNUM.prototype.argumentsMax=4;cCOUPNUM.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUPNUM.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCOUPNUM.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any];cCOUPNUM.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],frequency=arg[2],basis=arg[3]&&!(arg[3]instanceof cEmpty)?arg[3]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]); else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]); else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());frequency=Math.floor(frequency.getValue());basis= Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);var res=getcoupnum(settl,matur,frequency);return new cNumber(res)};function cCOUPPCD(){}cCOUPPCD.prototype=Object.create(cBaseFunction.prototype);cCOUPPCD.prototype.constructor= cCOUPPCD;cCOUPPCD.prototype.name="COUPPCD";cCOUPPCD.prototype.argumentsMin=3;cCOUPPCD.prototype.argumentsMax=4;cCOUPPCD.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOUPPCD.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCOUPPCD.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any];cCOUPPCD.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],frequency=arg[2],basis=arg[3]&&!(arg[3]instanceof cEmpty)?arg[3]:new cNumber(0); if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency= frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue()); maturity=Math.floor(maturity.getValue());frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);var n=lcl_GetCouppcd(settl,matur,frequency);var res=new cNumber(n.getExcelDate()); res.numFormat=14;return res};function cCUMIPMT(){}cCUMIPMT.prototype=Object.create(cBaseFunction.prototype);cCUMIPMT.prototype.constructor=cCUMIPMT;cCUMIPMT.prototype.name="CUMIPMT";cCUMIPMT.prototype.argumentsMin=6;cCUMIPMT.prototype.argumentsMax=6;cCUMIPMT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCUMIPMT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCUMIPMT.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any]; cCUMIPMT.prototype.Calculate=function(arg){var rate=arg[0],nper=arg[1],pv=arg[2],startPeriod=arg[3],endPeriod=arg[4],type=arg[5];if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(nper instanceof cArea||nper instanceof cArea3D)nper=nper.cross(arguments[1]);else if(nper instanceof cArray)nper=nper.getElementRowCol(0,0);if(pv instanceof cArea||pv instanceof cArea3D)pv=pv.cross(arguments[1]);else if(pv instanceof cArray)pv=pv.getElementRowCol(0,0);if(startPeriod instanceof cArea||startPeriod instanceof cArea3D)startPeriod=startPeriod.cross(arguments[1]);else if(startPeriod instanceof cArray)startPeriod=startPeriod.getElementRowCol(0,0);if(endPeriod instanceof cArea||endPeriod instanceof cArea3D)endPeriod=endPeriod.cross(arguments[1]);else if(endPeriod instanceof cArray)endPeriod=endPeriod.getElementRowCol(0,0);if(type instanceof cArea||type instanceof cArea3D)type=type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);rate=rate.tocNumber();nper=nper.tocNumber();pv=pv.tocNumber();startPeriod=startPeriod.tocNumber();endPeriod=endPeriod.tocNumber();type=type.tocNumber();if(rate instanceof cError)return rate;if(nper instanceof cError)return nper;if(pv instanceof cError)return pv;if(startPeriod instanceof cError)return startPeriod;if(endPeriod instanceof cError)return endPeriod;if(type instanceof cError)return type;rate=rate.getValue();nper=nper.getValue();pv=pv.getValue();startPeriod= startPeriod.getValue();endPeriod=endPeriod.getValue();type=type.getValue();var fv,ipmt=0;if(startPeriod<1||endPeriod<startPeriod||rate<=0||endPeriod>nper||nper<=0||pv<=0||type!=0&&type!=1)return new cError(cErrorType.not_numeric);fv=getPMT(rate,nper,pv,0,type);if(startPeriod==1){if(type<=0)ipmt=-pv;startPeriod++}for(var i=startPeriod;i<=endPeriod;i++)if(type>0)ipmt+=getFV(rate,i-2,fv,pv,1)-fv;else ipmt+=getFV(rate,i-1,fv,pv,0);ipmt*=rate;return new cNumber(ipmt)};function cCUMPRINC(){}cCUMPRINC.prototype= Object.create(cBaseFunction.prototype);cCUMPRINC.prototype.constructor=cCUMPRINC;cCUMPRINC.prototype.name="CUMPRINC";cCUMPRINC.prototype.argumentsMin=6;cCUMPRINC.prototype.argumentsMax=6;cCUMPRINC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCUMPRINC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cCUMPRINC.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cCUMPRINC.prototype.Calculate=function(arg){var rate=arg[0], nper=arg[1],pv=arg[2],startPeriod=arg[3],endPeriod=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(0),type=arg[5]&&!(arg[5]instanceof cEmpty)?arg[5]:new cNumber(0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(nper instanceof cArea||nper instanceof cArea3D)nper=nper.cross(arguments[1]);else if(nper instanceof cArray)nper=nper.getElementRowCol(0,0);if(pv instanceof cArea||pv instanceof cArea3D)pv= pv.cross(arguments[1]);else if(pv instanceof cArray)pv=pv.getElementRowCol(0,0);if(startPeriod instanceof cArea||startPeriod instanceof cArea3D)startPeriod=startPeriod.cross(arguments[1]);else if(startPeriod instanceof cArray)startPeriod=startPeriod.getElementRowCol(0,0);if(endPeriod instanceof cArea||endPeriod instanceof cArea3D)endPeriod=endPeriod.cross(arguments[1]);else if(endPeriod instanceof cArray)endPeriod=endPeriod.getElementRowCol(0,0);if(type instanceof cArea||type instanceof cArea3D)type= type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);rate=rate.tocNumber();nper=nper.tocNumber();pv=pv.tocNumber();startPeriod=startPeriod.tocNumber();endPeriod=endPeriod.tocNumber();type=type.tocNumber();if(rate instanceof cError)return rate;if(nper instanceof cError)return nper;if(pv instanceof cError)return pv;if(startPeriod instanceof cError)return startPeriod;if(endPeriod instanceof cError)return endPeriod;if(type instanceof cError)return type;rate=rate.getValue(); nper=nper.getValue();pv=pv.getValue();startPeriod=startPeriod.getValue();endPeriod=endPeriod.getValue();type=type.getValue();var fv,res=0,nStart=startPeriod;if(startPeriod<1||endPeriod<startPeriod||endPeriod<1||rate<=0||nper<=0||pv<=0||type!=0&&type!=1)return new cError(cErrorType.not_numeric);fv=getPMT(rate,nper,pv,0,type);if(nStart==1){if(type<=0)res=fv+pv*rate;else res=fv;nStart++}for(var i=nStart;i<=endPeriod;i++)if(type>0)res+=fv-(getFV(rate,i-2,fv,pv,1)-fv)*rate;else res+=fv-getFV(rate,i-1, fv,pv,0)*rate;return new cNumber(res)};function cDB(){}cDB.prototype=Object.create(cBaseFunction.prototype);cDB.prototype.constructor=cDB;cDB.prototype.name="DB";cDB.prototype.argumentsMin=4;cDB.prototype.argumentsMax=5;cDB.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDB.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number];cDB.prototype.Calculate=function(arg){var cost=arg[0],salvage=arg[1],life=arg[2],period=arg[3],month=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(12);if(cost instanceof cArea||cost instanceof cArea3D)cost=cost.cross(arguments[1]);else if(cost instanceof cArray)cost=cost.getElementRowCol(0,0);if(salvage instanceof cArea||salvage instanceof cArea3D)salvage=salvage.cross(arguments[1]);else if(salvage instanceof cArray)salvage=salvage.getElementRowCol(0,0);if(life instanceof cArea||life instanceof cArea3D)life=life.cross(arguments[1]);else if(life instanceof cArray)life=life.getElementRowCol(0,0);if(period instanceof cArea||period instanceof cArea3D)period=period.cross(arguments[1]);else if(period instanceof cArray)period=period.getElementRowCol(0,0);if(month instanceof cArea||month instanceof cArea3D)month=month.cross(arguments[1]);else if(month instanceof cArray)month=month.getElementRowCol(0,0);cost=cost.tocNumber();salvage=salvage.tocNumber();life=life.tocNumber();period=period.tocNumber();month=month.tocNumber();if(cost instanceof cError)return cost;if(salvage instanceof cError)return salvage;if(life instanceof cError)return life;if(period instanceof cError)return period;if(month instanceof cError)return month;cost=cost.getValue();salvage=salvage.getValue();life=life.getValue();period=period.getValue();month=Math.floor(month.getValue());if(salvage>=cost)return new cNumber(0);if(month<1||month>12||salvage<0||life<0||period<0||life+1<period||cost<0)return new cError(cErrorType.not_numeric);var rate=1-Math.pow(salvage/cost,1/life);rate=Math.floor(rate*1E3+.5)/1E3;var firstRate=cost*rate*month/12;var res=0; if(Math.floor(period)==1)res=firstRate;else{var sum=firstRate,min=life;if(min>period)min=period;var max=Math.floor(min);for(var i=2;i<=max;i++){res=(cost-sum)*rate;sum+=res}if(period>life)res=(cost-sum)*rate*(12-month)/12}return new cNumber(res)};function cDDB(){}cDDB.prototype=Object.create(cBaseFunction.prototype);cDDB.prototype.constructor=cDDB;cDDB.prototype.name="DDB";cDDB.prototype.argumentsMin=4;cDDB.prototype.argumentsMax=5;cDDB.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDDB.prototype.argumentsType= [argType.number,argType.number,argType.number,argType.number,argType.number];cDDB.prototype.Calculate=function(arg){var cost=arg[0],salvage=arg[1],life=arg[2],period=arg[3],factor=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(2);if(cost instanceof cArea||cost instanceof cArea3D)cost=cost.cross(arguments[1]);else if(cost instanceof cArray)cost=cost.getElementRowCol(0,0);if(salvage instanceof cArea||salvage instanceof cArea3D)salvage=salvage.cross(arguments[1]);else if(salvage instanceof cArray)salvage= salvage.getElementRowCol(0,0);if(life instanceof cArea||life instanceof cArea3D)life=life.cross(arguments[1]);else if(life instanceof cArray)life=life.getElementRowCol(0,0);if(period instanceof cArea||period instanceof cArea3D)period=period.cross(arguments[1]);else if(period instanceof cArray)period=period.getElementRowCol(0,0);if(factor instanceof cArea||factor instanceof cArea3D)factor=factor.cross(arguments[1]);else if(factor instanceof cArray)factor=factor.getElementRowCol(0,0);cost=cost.tocNumber(); salvage=salvage.tocNumber();life=life.tocNumber();period=period.tocNumber();factor=factor.tocNumber();if(cost instanceof cError)return cost;if(salvage instanceof cError)return salvage;if(life instanceof cError)return life;if(period instanceof cError)return period;if(factor instanceof cError)return factor;cost=cost.getValue();salvage=salvage.getValue();life=life.getValue();period=period.getValue();factor=factor.getValue();if(cost<=0||salvage<0||factor<=0||life<=0||period<=0||life<period)return new cError(cErrorType.not_numeric); if(cost==0||salvage==0)return new cNumber(0);var res=new cNumber(getDDB(cost,salvage,life,period,factor));res.numFormat=7;return res};function cDISC(){}cDISC.prototype=Object.create(cBaseFunction.prototype);cDISC.prototype.constructor=cDISC;cDISC.prototype.name="DISC";cDISC.prototype.argumentsMin=4;cDISC.prototype.argumentsMax=5;cDISC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDISC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDISC.prototype.argumentsType= [argType.any,argType.any,argType.any,argType.any,argType.any];cDISC.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],pr=arg[2],redemption=arg[3],basis=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]); else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(pr instanceof cArea||pr instanceof cArea3D)pr=pr.cross(arguments[1]);else if(pr instanceof cArray)pr=pr.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis= basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();pr=pr.tocNumber();redemption=redemption.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(pr instanceof cError)return pr;if(redemption instanceof cError)return redemption;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());pr=pr.getValue();redemption= redemption.getValue();basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||pr<=0||redemption<=0||basis<0||basis>4)return new cError(cErrorType.not_numeric);var res=(1-pr/redemption)/AscCommonExcel.yearFrac(cDate.prototype.getDateFromExcel(settlement),cDate.prototype.getDateFromExcel(maturity),basis);return new cNumber(res)};function cDOLLARDE(){}cDOLLARDE.prototype=Object.create(cBaseFunction.prototype);cDOLLARDE.prototype.constructor= cDOLLARDE;cDOLLARDE.prototype.name="DOLLARDE";cDOLLARDE.prototype.argumentsMin=2;cDOLLARDE.prototype.argumentsMax=2;cDOLLARDE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDOLLARDE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDOLLARDE.prototype.argumentsType=[argType.any,argType.any];cDOLLARDE.prototype.Calculate=function(arg){var fractionalDollar=arg[0],fraction=arg[1];if(fractionalDollar instanceof cArea||fractionalDollar instanceof cArea3D)fractionalDollar= fractionalDollar.cross(arguments[1]);else if(fractionalDollar instanceof cArray)fractionalDollar=fractionalDollar.getElementRowCol(0,0);if(fraction instanceof cArea||fraction instanceof cArea3D)fraction=fraction.cross(arguments[1]);else if(fraction instanceof cArray)fraction=fraction.getElementRowCol(0,0);fractionalDollar=fractionalDollar.tocNumber();fraction=fraction.tocNumber();if(fractionalDollar instanceof cError)return fractionalDollar;if(fraction instanceof cError)return fraction;fractionalDollar= fractionalDollar.getValue();fraction=fraction.getValue();if(fraction<0)return new cError(cErrorType.not_numeric);else if(fraction==0)return new cError(cErrorType.division_by_zero);fraction=Math.floor(fraction);var fInt=Math.floor(fractionalDollar),res=fractionalDollar-fInt;res/=fraction;res*=Math.pow(10,Math.ceil(Math.log10(fraction)));res+=fInt;return new cNumber(res)};function cDOLLARFR(){}cDOLLARFR.prototype=Object.create(cBaseFunction.prototype);cDOLLARFR.prototype.constructor=cDOLLARFR;cDOLLARFR.prototype.name= "DOLLARFR";cDOLLARFR.prototype.argumentsMin=2;cDOLLARFR.prototype.argumentsMax=2;cDOLLARFR.prototype.numFormat=AscCommonExcel.cNumFormatNone;cDOLLARFR.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDOLLARFR.prototype.argumentsType=[argType.any,argType.any];cDOLLARFR.prototype.Calculate=function(arg){var decimalDollar=arg[0],fraction=arg[1];if(decimalDollar instanceof cArea||decimalDollar instanceof cArea3D)decimalDollar=decimalDollar.cross(arguments[1]);else if(decimalDollar instanceof cArray)decimalDollar=decimalDollar.getElementRowCol(0,0);if(fraction instanceof cArea||fraction instanceof cArea3D)fraction=fraction.cross(arguments[1]);else if(fraction instanceof cArray)fraction=fraction.getElementRowCol(0,0);decimalDollar=decimalDollar.tocNumber();fraction=fraction.tocNumber();if(decimalDollar instanceof cError)return decimalDollar;if(fraction instanceof cError)return fraction;decimalDollar=decimalDollar.getValue();fraction=fraction.getValue();if(fraction<0)return new cError(cErrorType.not_numeric); else if(fraction==0)return new cError(cErrorType.division_by_zero);fraction=Math.floor(fraction);var fInt=Math.floor(decimalDollar),res=decimalDollar-fInt;res*=fraction;res*=Math.pow(10,-Math.ceil(Math.log10(fraction)));res+=fInt;return new cNumber(res)};function cDURATION(){}cDURATION.prototype=Object.create(cBaseFunction.prototype);cDURATION.prototype.constructor=cDURATION;cDURATION.prototype.name="DURATION";cDURATION.prototype.argumentsMin=5;cDURATION.prototype.argumentsMax=6;cDURATION.prototype.numFormat= AscCommonExcel.cNumFormatNone;cDURATION.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cDURATION.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cDURATION.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],coupon=arg[2],yld=arg[3],frequency=arg[4],basis=arg[5]&&!(arg[5]instanceof cEmpty)?arg[5]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]); else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(coupon instanceof cArea||coupon instanceof cArea3D)coupon=coupon.cross(arguments[1]);else if(coupon instanceof cArray)coupon=coupon.getElementRowCol(0,0);if(yld instanceof cArea||yld instanceof cArea3D)yld=yld.cross(arguments[1]);else if(yld instanceof cArray)yld=yld.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();coupon=coupon.tocNumber();yld=yld.tocNumber();frequency=frequency.tocNumber(); basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(coupon instanceof cError)return coupon;if(yld instanceof cError)return yld;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());coupon=coupon.getValue();yld=yld.getValue();frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement< startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4||yld<0||coupon<0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);return new cNumber(getduration(settl,matur,coupon,yld,frequency,basis))};function cEFFECT(){}cEFFECT.prototype=Object.create(cBaseFunction.prototype);cEFFECT.prototype.constructor=cEFFECT;cEFFECT.prototype.name= "EFFECT";cEFFECT.prototype.argumentsMin=2;cEFFECT.prototype.argumentsMax=2;cEFFECT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cEFFECT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cEFFECT.prototype.argumentsType=[argType.any,argType.any];cEFFECT.prototype.Calculate=function(arg){var nominalRate=arg[0],npery=arg[1];if(nominalRate instanceof cArea||nominalRate instanceof cArea3D)nominalRate=nominalRate.cross(arguments[1]);else if(nominalRate instanceof cArray)nominalRate= nominalRate.getElementRowCol(0,0);if(npery instanceof cArea||npery instanceof cArea3D)npery=npery.cross(arguments[1]);else if(npery instanceof cArray)npery=npery.getElementRowCol(0,0);nominalRate=nominalRate.tocNumber();npery=npery.tocNumber();if(nominalRate instanceof cError)return nominalRate;if(npery instanceof cError)return npery;nominalRate=nominalRate.getValue();npery=Math.floor(npery.getValue());if(nominalRate<=0||npery<1)return new cError(cErrorType.not_numeric);return new cNumber(Math.pow(1+ nominalRate/npery,npery)-1)};function cFV(){}cFV.prototype=Object.create(cBaseFunction.prototype);cFV.prototype.constructor=cFV;cFV.prototype.name="FV";cFV.prototype.argumentsMin=3;cFV.prototype.argumentsMax=5;cFV.prototype.numFormat=AscCommonExcel.cNumFormatNone;cFV.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number];cFV.prototype.Calculate=function(arg){var rate=arg[0],nper=arg[1],pmt=arg[2],pv=arg[3]?arg[3]:new cNumber(0),type=arg[4]?arg[4]:new cNumber(0); if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(nper instanceof cArea||nper instanceof cArea3D)nper=nper.cross(arguments[1]);else if(nper instanceof cArray)nper=nper.getElementRowCol(0,0);if(pmt instanceof cArea||pmt instanceof cArea3D)pmt=pmt.cross(arguments[1]);else if(pmt instanceof cArray)pmt=pmt.getElementRowCol(0,0);if(pv instanceof cArea||pv instanceof cArea3D)pv=pv.cross(arguments[1]);else if(pv instanceof cArray)pv=pv.getElementRowCol(0,0);if(type instanceof cArea||type instanceof cArea3D)type=type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);rate=rate.tocNumber();nper=nper.tocNumber();pmt=pmt.tocNumber();pv=pv.tocNumber();type=type.tocNumber();if(rate instanceof cError)return rate;if(nper instanceof cError)return nper;if(pmt instanceof cError)return pmt;if(pv instanceof cError)return pv;if(type instanceof cError)return type;if(type.getValue()!=1&&type.getValue()!= 0)return new cError(cErrorType.not_numeric);var res;if(rate.getValue()!=0)res=-1*(pv.getValue()*Math.pow(1+rate.getValue(),nper.getValue())+pmt.getValue()*(1+rate.getValue()*type.getValue())*(Math.pow(1+rate.getValue(),nper.getValue())-1)/rate.getValue());else res=-1*(pv.getValue()+pmt.getValue()*nper.getValue());return new cNumber(res)};function cFVSCHEDULE(){}cFVSCHEDULE.prototype=Object.create(cBaseFunction.prototype);cFVSCHEDULE.prototype.constructor=cFVSCHEDULE;cFVSCHEDULE.prototype.name="FVSCHEDULE"; cFVSCHEDULE.prototype.argumentsMin=2;cFVSCHEDULE.prototype.argumentsMax=2;cFVSCHEDULE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cFVSCHEDULE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cFVSCHEDULE.prototype.arrayIndexes={1:1};cFVSCHEDULE.prototype.argumentsType=[argType.any,argType.any];cFVSCHEDULE.prototype.Calculate=function(arg){var principal=arg[0],schedule=arg[1],shedList=[];if(principal instanceof cArea||principal instanceof cArea3D)principal=principal.cross(arguments[1]); else if(principal instanceof cArray)principal=principal.getElementRowCol(0,0);if(schedule instanceof cArea||schedule instanceof cArea3D)schedule.foreach2(function(v){shedList.push(v.tocNumber())});else if(schedule instanceof cArray)schedule.foreach(function(v){shedList.push(v.tocNumber())});else shedList.push(schedule.tocNumber());principal=principal.tocNumber();if(principal instanceof cError)return principal;var princ=principal.getValue();for(var i=0;i<shedList.length;i++)if(shedList[i]instanceof cError)return new cError(cErrorType.wrong_value_type);else princ*=1+shedList[i].getValue();return new cNumber(princ)};function cINTRATE(){}cINTRATE.prototype=Object.create(cBaseFunction.prototype);cINTRATE.prototype.constructor=cINTRATE;cINTRATE.prototype.name="INTRATE";cINTRATE.prototype.argumentsMin=4;cINTRATE.prototype.argumentsMax=5;cINTRATE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cINTRATE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cINTRATE.prototype.argumentsType= [argType.any,argType.any,argType.any,argType.any,argType.any];cINTRATE.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],investment=arg[2],redemption=arg[3],basis=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]); else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(investment instanceof cArea||investment instanceof cArea3D)investment=investment.cross(arguments[1]);else if(investment instanceof cArray)investment=investment.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis= basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();investment=investment.tocNumber();redemption=redemption.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(investment instanceof cError)return investment;if(redemption instanceof cError)return redemption;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue()); maturity=Math.floor(maturity.getValue());investment=investment.getValue();redemption=redemption.getValue();basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||investment<=0||redemption<=0||basis<0||basis>4)return new cError(cErrorType.not_numeric);var res=(redemption/investment-1)/AscCommonExcel.yearFrac(cDate.prototype.getDateFromExcel(settlement),cDate.prototype.getDateFromExcel(maturity),basis);var res=new cNumber(res); res.numFormat=10;return res};function cIPMT(){}cIPMT.prototype=Object.create(cBaseFunction.prototype);cIPMT.prototype.constructor=cIPMT;cIPMT.prototype.name="IPMT";cIPMT.prototype.argumentsMin=4;cIPMT.prototype.argumentsMax=6;cIPMT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cIPMT.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number,argType.number];cIPMT.prototype.Calculate=function(arg){var rate=arg[0],per=arg[1],nper=arg[2],pv=arg[3],fv=arg[4]? arg[4]:new cNumber(0),type=arg[5]?arg[5]:new cNumber(0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(per instanceof cArea||per instanceof cArea3D)per=per.cross(arguments[1]);else if(per instanceof cArray)per=per.getElementRowCol(0,0);if(nper instanceof cArea||nper instanceof cArea3D)nper=nper.cross(arguments[1]);else if(nper instanceof cArray)nper=nper.getElementRowCol(0,0);if(pv instanceof cArea|| pv instanceof cArea3D)pv=pv.cross(arguments[1]);else if(pv instanceof cArray)pv=pv.getElementRowCol(0,0);if(fv instanceof cArea||fv instanceof cArea3D)fv=fv.cross(arguments[1]);else if(fv instanceof cArray)fv=fv.getElementRowCol(0,0);if(type instanceof cArea||type instanceof cArea3D)type=type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);rate=rate.tocNumber();per=per.tocNumber();nper=nper.tocNumber();pv=pv.tocNumber();fv=fv.tocNumber();type=type.tocNumber();if(rate instanceof cError)return rate;if(per instanceof cError)return per;if(nper instanceof cError)return nper;if(pv instanceof cError)return pv;if(fv instanceof cError)return fv;if(type instanceof cError)return type;rate=rate.getValue();per=per.getValue();nper=nper.getValue();pv=pv.getValue();fv=fv.getValue();type=type.getValue();var res;if(per<1||per>nper||type!=0&&type!=1)return new cError(cErrorType.not_numeric);res=getPMT(rate,nper,pv,fv,type);return new cNumber(getIPMT(rate,per,pv,type,res))};function cIRR(){} cIRR.prototype=Object.create(cBaseFunction.prototype);cIRR.prototype.constructor=cIRR;cIRR.prototype.name="IRR";cIRR.prototype.argumentsMin=1;cIRR.prototype.argumentsMax=2;cIRR.prototype.numFormat=AscCommonExcel.cNumFormatNone;cIRR.prototype.arrayIndexes={0:1};cIRR.prototype.argumentsType=[argType.reference,argType.number];cIRR.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cNumber(.1);function npv(r,cf){var res=0;for(var i=1;i<=cf.length;i++)res+=cf[i-1].getValue()/Math.pow(1+ r,i);return res}function irr2(x,arr){var g_Eps=1E-7,nIM=500,eps=1,nMC=0,xN,guess=x;while(eps>g_Eps&&nMC<nIM){xN=x-npv(x,arr)/((npv(x+g_Eps,arr)-npv(x-g_Eps,arr))/(2*g_Eps));nMC++;eps=Math.abs(xN-x);x=xN}if(isNaN(x)||Infinity==Math.abs(x)){var max=Number.MAX_VALUE,min=-Number.MAX_VALUE,step=1.6,low=guess-.01<=min?min+g_Eps:guess-.01,high=guess+.01>=max?max-g_Eps:guess+.01,i,xBegin,xEnd,x,y,currentIter=0;if(guess<=min||guess>=max)return new cError(cErrorType.not_numeric);for(i=0;i<nIM;i++){xBegin=low<= min?min+g_Eps:low;xEnd=high>=max?max-g_Eps:high;x=npv(xBegin,arr);y=npv(xEnd,arr);if(x*y<=0)break;else if(x*y>0){low=xBegin+step*(xBegin-xEnd);high=xEnd+step*(xEnd-xBegin)}else return new cError(cErrorType.not_numeric)}if(i==nIM)return new cError(cErrorType.not_numeric);var fXbegin=npv(xBegin,arr),fXend=npv(xEnd,arr),fXi,xI;if(Math.abs(fXbegin)<g_Eps)return new cNumber(fXbegin);if(Math.abs(fXend)<g_Eps)return new cNumber(fXend);do{xI=xBegin+(xEnd-xBegin)/2;fXi=npv(xI,arr);if(fXbegin*fXi<0)xEnd=xI; else xBegin=xI;fXbegin=npv(xBegin,arr);currentIter++}while(Math.abs(fXi)>g_Eps&¤tIter<nIM);return new cNumber(xI)}else return new cNumber(x)}var arr=[];if(arg0 instanceof cArray)arg0.foreach(function(v){if(v instanceof cNumber)arr.push(v)});else if(arg0 instanceof cArea)arg0.foreach2(function(v){if(v instanceof cNumber)arr.push(v)});arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.not_numeric);var wasNeg=false,wasPos=false;for(var i=0;i<arr.length;i++){if(arr[i].getValue()> 0)wasNeg=true;if(arr[i].getValue()<0)wasPos=true}if(!(wasNeg&&wasPos))return new cError(cErrorType.not_numeric);var res=irr2(arg1.getValue(),arr);res.numFormat=9;return res};function cISPMT(){}cISPMT.prototype=Object.create(cBaseFunction.prototype);cISPMT.prototype.constructor=cISPMT;cISPMT.prototype.name="ISPMT";cISPMT.prototype.argumentsMin=4;cISPMT.prototype.argumentsMax=4;cISPMT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cISPMT.prototype.argumentsType=[argType.number,argType.number,argType.number, argType.number];cISPMT.prototype.Calculate=function(arg){var rate=arg[0],per=arg[1],nper=arg[2],pv=arg[3];if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(per instanceof cArea||per instanceof cArea3D)per=per.cross(arguments[1]);else if(per instanceof cArray)per=per.getElementRowCol(0,0);if(nper instanceof cArea||nper instanceof cArea3D)nper=nper.cross(arguments[1]);else if(nper instanceof cArray)nper= nper.getElementRowCol(0,0);if(pv instanceof cArea||pv instanceof cArea3D)pv=pv.cross(arguments[1]);else if(pv instanceof cArray)pv=pv.getElementRowCol(0,0);rate=rate.tocNumber();per=per.tocNumber();nper=nper.tocNumber();pv=pv.tocNumber();if(rate instanceof cError)return rate;if(per instanceof cError)return per;if(nper instanceof cError)return nper;if(pv instanceof cError)return pv;if(nper.getValue()==0)return new cError(cErrorType.division_by_zero);return new cNumber(pv.getValue()*rate.getValue()* (per.getValue()/nper.getValue()-1))};function cMDURATION(){}cMDURATION.prototype=Object.create(cBaseFunction.prototype);cMDURATION.prototype.constructor=cMDURATION;cMDURATION.prototype.name="MDURATION";cMDURATION.prototype.argumentsMin=5;cMDURATION.prototype.argumentsMax=6;cMDURATION.prototype.numFormat=AscCommonExcel.cNumFormatNone;cMDURATION.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cMDURATION.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any, argType.any,argType.any];cMDURATION.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],coupon=arg[2],yld=arg[3],frequency=arg[4],basis=arg[5]&&!(arg[5]instanceof cEmpty)?arg[5]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(coupon instanceof cArea||coupon instanceof cArea3D)coupon=coupon.cross(arguments[1]);else if(coupon instanceof cArray)coupon=coupon.getElementRowCol(0,0);if(yld instanceof cArea||yld instanceof cArea3D)yld=yld.cross(arguments[1]);else if(yld instanceof cArray)yld=yld.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0, 0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();coupon=coupon.tocNumber();yld=yld.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(coupon instanceof cError)return coupon;if(yld instanceof cError)return yld;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());coupon=coupon.getValue();yld=yld.getValue();frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4||yld<0||coupon<0)return new cError(cErrorType.not_numeric);var settl= cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);var duration=getduration(settl,matur,coupon,yld,frequency,basis);duration/=1+yld/frequency;return new cNumber(duration)};function cMIRR(){}cMIRR.prototype=Object.create(cBaseFunction.prototype);cMIRR.prototype.constructor=cMIRR;cMIRR.prototype.name="MIRR";cMIRR.prototype.argumentsMin=3;cMIRR.prototype.argumentsMax=3;cMIRR.prototype.numFormat=AscCommonExcel.cNumFormatNone;cMIRR.prototype.arrayIndexes={0:1}; cMIRR.prototype.argumentsType=[argType.reference,argType.number,argType.number];cMIRR.prototype.Calculate=function(arg){var arg0=arg[0],invest=arg[1],reinvest=arg[2];var valueArray=[];if(arg0 instanceof cArea)arg0.foreach2(function(c){if(c instanceof cNumber||c instanceof cError)valueArray.push(c)});else if(arg0 instanceof cArray)arg0.foreach(function(c){if(c instanceof cNumber||c instanceof cError)valueArray.push(c)});else if(arg0 instanceof cArea3D)if(arg0.isSingleSheet())valueArray=arg0.getMatrix()[0]; else return new cError(cErrorType.wrong_value_type);else if(arg0 instanceof cError)return new cError(cErrorType.not_numeric);else if(arg0 instanceof cNumber)valueArray.push(arg0);if(invest instanceof cArea||invest instanceof cArea3D)invest=invest.cross(arguments[1]);else if(invest instanceof cArray)invest=invest.getElementRowCol(0,0);if(reinvest instanceof cArea||reinvest instanceof cArea3D)reinvest=reinvest.cross(arguments[1]);else if(reinvest instanceof cArray)reinvest=reinvest.getElementRowCol(0, 0);invest=invest.tocNumber();reinvest=reinvest.tocNumber();if(invest instanceof cError)return invest;if(reinvest instanceof cError)return reinvest;invest=invest.getValue()+1;reinvest=reinvest.getValue()+1;var NPVreinvest=0,POWreinvest=1,NPVinvest=0,POWinvest=1,cellValue,wasNegative=false,wasPositive=false;for(var i=0;i<valueArray.length;i++){cellValue=valueArray[i];if(cellValue instanceof cError)return cellValue;cellValue=valueArray[i].getValue();if(cellValue>0){wasPositive=true;NPVreinvest+=cellValue* POWreinvest}else if(cellValue<0){wasNegative=true;NPVinvest+=cellValue*POWinvest}POWreinvest/=reinvest;POWinvest/=invest}if(!(wasNegative&&wasPositive))return new cError(cErrorType.division_by_zero);var res=-NPVreinvest/NPVinvest;res*=Math.pow(reinvest,valueArray.length-1);res=Math.pow(res,1/(valueArray.length-1));var res=new cNumber(res-1);res.numFormat=9;return res};function cNOMINAL(){}cNOMINAL.prototype=Object.create(cBaseFunction.prototype);cNOMINAL.prototype.constructor=cNOMINAL;cNOMINAL.prototype.name= "NOMINAL";cNOMINAL.prototype.argumentsMin=2;cNOMINAL.prototype.argumentsMax=2;cNOMINAL.prototype.numFormat=AscCommonExcel.cNumFormatNone;cNOMINAL.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cNOMINAL.prototype.argumentsType=[argType.any,argType.any];cNOMINAL.prototype.Calculate=function(arg){var effectRate=arg[0],npery=arg[1];if(effectRate instanceof cArea||effectRate instanceof cArea3D)effectRate=effectRate.cross(arguments[1]);else if(effectRate instanceof cArray)effectRate= effectRate.getElementRowCol(0,0);if(npery instanceof cArea||npery instanceof cArea3D)npery=npery.cross(arguments[1]);else if(npery instanceof cArray)npery=npery.getElementRowCol(0,0);effectRate=effectRate.tocNumber();npery=npery.tocNumber();if(effectRate instanceof cError)return effectRate;if(npery instanceof cError)return npery;effectRate=effectRate.getValue();npery=npery.getValue();npery=Math.floor(npery);if(effectRate<=0||npery<1)return new cError(cErrorType.not_numeric);return new cNumber((Math.pow(effectRate+ 1,1/npery)-1)*npery)};function cNPER(){}cNPER.prototype=Object.create(cBaseFunction.prototype);cNPER.prototype.constructor=cNPER;cNPER.prototype.name="NPER";cNPER.prototype.argumentsMin=3;cNPER.prototype.argumentsMax=5;cNPER.prototype.numFormat=AscCommonExcel.cNumFormatNone;cNPER.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number];cNPER.prototype.Calculate=function(arg){var rate=arg[0],pmt=arg[1],pv=arg[2],fv=arg[3]?arg[3]:new cNumber(0),type=arg[4]? arg[4]:new cNumber(0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(pmt instanceof cArea||pmt instanceof cArea3D)pmt=pmt.cross(arguments[1]);else if(pmt instanceof cArray)pmt=pmt.getElementRowCol(0,0);if(pv instanceof cArea||pv instanceof cArea3D)pv=pv.cross(arguments[1]);else if(pv instanceof cArray)pv=pv.getElementRowCol(0,0);if(fv instanceof cArea||fv instanceof cArea3D)fv=fv.cross(arguments[1]); else if(fv instanceof cArray)fv=fv.getElementRowCol(0,0);if(type instanceof cArea||type instanceof cArea3D)type=type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);rate=rate.tocNumber();pmt=pmt.tocNumber();pv=pv.tocNumber();fv=fv.tocNumber();type=type.tocNumber();if(rate instanceof cError)return rate;if(pmt instanceof cError)return pmt;if(pmt instanceof cError)return pv;if(fv instanceof cError)return fv;if(type instanceof cError)return type;if(type.getValue()!= 1&&type.getValue()!=0)return new cError(cErrorType.not_numeric);var res;if(rate.getValue()!=0){rate=rate.getValue();pmt=pmt.getValue();pv=pv.getValue();fv=fv.getValue();type=type.getValue();res=(-fv*rate+pmt*(1+rate*type))/(rate*pv+pmt*(1+rate*type));res=Math.log(res)/Math.log(1+rate)}else res=-pv.getValue()-fv.getValue()/pmt.getValue();return new cNumber(res)};function cNPV(){}cNPV.prototype=Object.create(cBaseFunction.prototype);cNPV.prototype.constructor=cNPV;cNPV.prototype.name="NPV";cNPV.prototype.argumentsMin= 2;cNPV.prototype.numFormat=AscCommonExcel.cNumFormatNone;cNPV.prototype.argumentsType=[argType.number,[argType.number]];cNPV.prototype.arrayIndexes={1:1,2:1,3:1,4:1,5:1,6:1,7:1};cNPV.prototype.Calculate=function(arg){var arg0=arg[0],iStart=1,res=0,rate;function elemCalc(rate,value,step){return value/Math.pow(1+rate,step)}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;rate=arg0.getValue();if(rate==-1)return new cError(cErrorType.division_by_zero);for(var i=1;i<arg.length;i++){var argI=arg[i];if(argI instanceof cArea||argI instanceof cArea3D){var argIArr=argI.getValue();for(var j=0;j<argIArr.length;j++)if(argIArr[j]instanceof cNumber)res+=elemCalc(rate,argIArr[j].getValue(),iStart++);continue}else if(argI instanceof cArray){argI.foreach(function(elem){if(elem instanceof cNumber)res+=elemCalc(rate,elem.getValue(),iStart++)});continue}argI=argI.tocNumber(); if(argI instanceof cError)continue;res+=elemCalc(rate,argI.getValue(),iStart++)}return new cNumber(res)};function cODDFPRICE(){}cODDFPRICE.prototype=Object.create(cBaseFunction.prototype);cODDFPRICE.prototype.constructor=cODDFPRICE;cODDFPRICE.prototype.name="ODDFPRICE";cODDFPRICE.prototype.argumentsMin=8;cODDFPRICE.prototype.argumentsMax=9;cODDFPRICE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cODDFPRICE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cODDFPRICE.prototype.argumentsType= [argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cODDFPRICE.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],issue=arg[2],first_coupon=arg[3],rate=arg[4],yld=arg[5],redemption=arg[6],frequency=arg[7],basis=arg[8]&&!(arg[8]instanceof cEmpty)?arg[8]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0, 0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(issue instanceof cArea||issue instanceof cArea3D)issue=issue.cross(arguments[1]);else if(issue instanceof cArray)issue=issue.getElementRowCol(0,0);if(first_coupon instanceof cArea||first_coupon instanceof cArea3D)first_coupon=first_coupon.cross(arguments[1]);else if(first_coupon instanceof cArray)first_coupon=first_coupon.getElementRowCol(0, 0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(yld instanceof cArea||yld instanceof cArea3D)yld=yld.cross(arguments[1]);else if(yld instanceof cArray)yld=yld.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();issue=issue.tocNumber();first_coupon=first_coupon.tocNumber();rate=rate.tocNumber();yld=yld.tocNumber();redemption=redemption.tocNumber();frequency=frequency.tocNumber(); basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(issue instanceof cError)return issue;if(first_coupon instanceof cError)return first_coupon;if(rate instanceof cError)return rate;if(yld instanceof cError)return yld;if(redemption instanceof cError)return redemption;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue()); issue=Math.floor(issue.getValue());first_coupon=Math.floor(first_coupon.getValue());rate=rate.getValue();yld=yld.getValue();redemption=redemption.getValue();frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(maturity<startRangeCurrentDateSystem||settlement<startRangeCurrentDateSystem||first_coupon<startRangeCurrentDateSystem||issue<startRangeCurrentDateSystem||maturity<=first_coupon||first_coupon<=settlement||settlement<=issue||basis<0||basis>4||yld<0||rate<0||redemption< 0||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity),iss=cDate.prototype.getDateFromExcel(issue),firstCoup=cDate.prototype.getDateFromExcel(first_coupon);return new cNumber(oddFPrice(settl,matur,iss,firstCoup,rate,yld,redemption,frequency,basis))};function cODDFYIELD(){}cODDFYIELD.prototype=Object.create(cBaseFunction.prototype);cODDFYIELD.prototype.constructor= cODDFYIELD;cODDFYIELD.prototype.name="ODDFYIELD";cODDFYIELD.prototype.argumentsMin=8;cODDFYIELD.prototype.argumentsMax=9;cODDFYIELD.prototype.numFormat=AscCommonExcel.cNumFormatNone;cODDFYIELD.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cODDFYIELD.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cODDFYIELD.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],issue= arg[2],first_coupon=arg[3],rate=arg[4],pr=arg[5],redemption=arg[6],frequency=arg[7],basis=arg[8]&&!(arg[8]instanceof cEmpty)?arg[8]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0); if(issue instanceof cArea||issue instanceof cArea3D)issue=issue.cross(arguments[1]);else if(issue instanceof cArray)issue=issue.getElementRowCol(0,0);if(first_coupon instanceof cArea||first_coupon instanceof cArea3D)first_coupon=first_coupon.cross(arguments[1]);else if(first_coupon instanceof cArray)first_coupon=first_coupon.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(pr instanceof cArea||pr instanceof cArea3D)pr=pr.cross(arguments[1]);else if(pr instanceof cArray)pr=pr.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea|| basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();issue=issue.tocNumber();first_coupon=first_coupon.tocNumber();rate=rate.tocNumber();pr=pr.tocNumber();redemption=redemption.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(issue instanceof cError)return issue; if(first_coupon instanceof cError)return first_coupon;if(rate instanceof cError)return rate;if(pr instanceof cError)return pr;if(redemption instanceof cError)return redemption;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());issue=Math.floor(issue.getValue());first_coupon=Math.floor(first_coupon.getValue());rate=rate.getValue();pr=pr.getValue();redemption=redemption.getValue(); frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||issue<startRangeCurrentDateSystem||first_coupon<startRangeCurrentDateSystem||maturity<=first_coupon||first_coupon<=settlement||settlement<=issue||basis<0||basis>4||pr<0||rate<0||redemption<0||frequency!=1&&frequency!=2&&frequency!=4)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity), iss=cDate.prototype.getDateFromExcel(issue),firstCoup=cDate.prototype.getDateFromExcel(first_coupon);var years=AscCommonExcel.diffDate(settl,matur,basis),px=pr-100,num=rate*years*100-px,denum=px*.25*(1+2*years)+years*100,guess=num/denum,x=guess,g_Eps=1E-7,nIM=500,eps=1,nMC=0,xN;function iterF(yld){return pr-oddFPrice(settl,matur,iss,firstCoup,rate,yld,redemption,frequency,basis)}while(eps>g_Eps&&nMC<nIM){xN=x-iterF(x)/((iterF(x+g_Eps)-iterF(x-g_Eps))/(2*g_Eps));nMC++;eps=Math.abs(xN-x);x=xN}if(isNaN(x)|| Infinity==Math.abs(x)){var max=Number.MAX_VALUE,min=-Number.MAX_VALUE,step=1.6,low=guess-.01<=min?min+g_Eps:guess-.01,high=guess+.01>=max?max-g_Eps:guess+.01,i,xBegin,xEnd,x,y,currentIter=0;if(guess<=min||guess>=max)return new cError(cErrorType.not_numeric);for(i=0;i<nIM;i++){xBegin=low<=min?min+g_Eps:low;xEnd=high>=max?max-g_Eps:high;x=iterF(xBegin);y=iterF(xEnd);if(x*y<=0)break;else if(x*y>0){low=xBegin+step*(xBegin-xEnd);high=xEnd+step*(xEnd-xBegin)}else return new cError(cErrorType.not_numeric)}if(i== nIM)return new cError(cErrorType.not_numeric);var fXbegin=iterF(xBegin),fXend=iterF(xEnd),fXi,xI;if(Math.abs(fXbegin)<g_Eps)return new cNumber(fXbegin);if(Math.abs(fXend)<g_Eps)return new cNumber(fXend);do{xI=xBegin+(xEnd-xBegin)/2;fXi=iterF(xI);if(fXbegin*fXi<0)xEnd=xI;else xBegin=xI;fXbegin=iterF(xBegin);currentIter++}while(Math.abs(fXi)>g_Eps&¤tIter<nIM);return new cNumber(xI)}else return new cNumber(x)};function cODDLPRICE(){}cODDLPRICE.prototype=Object.create(cBaseFunction.prototype);cODDLPRICE.prototype.constructor= cODDLPRICE;cODDLPRICE.prototype.name="ODDLPRICE";cODDLPRICE.prototype.argumentsMin=7;cODDLPRICE.prototype.argumentsMax=8;cODDLPRICE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cODDLPRICE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cODDLPRICE.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cODDLPRICE.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],last_interest= arg[2],rate=arg[3],yld=arg[4],redemption=arg[5],frequency=arg[6],basis=arg[7]&&!(arg[7]instanceof cEmpty)?arg[7]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(last_interest instanceof cArea||last_interest instanceof cArea3D)last_interest=last_interest.cross(arguments[1]);else if(last_interest instanceof cArray)last_interest=last_interest.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(yld instanceof cArea||yld instanceof cArea3D)yld=yld.cross(arguments[1]);else if(yld instanceof cArray)yld=yld.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity= maturity.tocNumber();last_interest=last_interest.tocNumber();rate=rate.tocNumber();yld=yld.tocNumber();redemption=redemption.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(last_interest instanceof cError)return last_interest;if(rate instanceof cError)return rate;if(yld instanceof cError)return yld;if(redemption instanceof cError)return redemption;if(frequency instanceof cError)return frequency; if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());last_interest=Math.floor(last_interest.getValue());rate=rate.getValue();yld=yld.getValue();redemption=redemption.getValue();frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||last_interest<startRangeCurrentDateSystem||maturity<=settlement||settlement<=last_interest|| basis<0||basis>4||yld<0||rate<0||frequency!=1&&frequency!=2&&frequency!=4||redemption<=0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity),lastInt=cDate.prototype.getDateFromExcel(last_interest);var fDCi=AscCommonExcel.yearFrac(lastInt,matur,basis)*frequency;var fDSCi=AscCommonExcel.yearFrac(settl,matur,basis)*frequency;var fAi=AscCommonExcel.yearFrac(lastInt,settl,basis)*frequency;var res=redemption+fDCi* 100*rate/frequency;res/=fDSCi*yld/frequency+1;res-=fAi*100*rate/frequency;return new cNumber(res)};function cODDLYIELD(){}cODDLYIELD.prototype=Object.create(cBaseFunction.prototype);cODDLYIELD.prototype.constructor=cODDLYIELD;cODDLYIELD.prototype.name="ODDLYIELD";cODDLYIELD.prototype.argumentsMin=7;cODDLYIELD.prototype.argumentsMax=8;cODDLYIELD.prototype.numFormat=AscCommonExcel.cNumFormatNone;cODDLYIELD.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cODDLYIELD.prototype.argumentsType= [argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cODDLYIELD.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],last_interest=arg[2],rate=arg[3],pr=arg[4],redemption=arg[5],frequency=arg[6],basis=arg[7]&&!(arg[7]instanceof cEmpty)?arg[7]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0, 0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(last_interest instanceof cArea||last_interest instanceof cArea3D)last_interest=last_interest.cross(arguments[1]);else if(last_interest instanceof cArray)last_interest=last_interest.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0, 0);if(pr instanceof cArea||pr instanceof cArea3D)pr=pr.cross(arguments[1]);else if(pr instanceof cArray)pr=pr.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();last_interest=last_interest.tocNumber();rate=rate.tocNumber();pr=pr.tocNumber();redemption=redemption.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(last_interest instanceof cError)return last_interest; if(rate instanceof cError)return rate;if(pr instanceof cError)return pr;if(redemption instanceof cError)return redemption;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());last_interest=Math.floor(last_interest.getValue());rate=rate.getValue();pr=pr.getValue();redemption=redemption.getValue();frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement< startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||last_interest<startRangeCurrentDateSystem||maturity<=settlement||settlement<=last_interest||basis<0||basis>4||pr<0||rate<0||frequency!=1&&frequency!=2&&frequency!=4||redemption<=0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity),lastInt=cDate.prototype.getDateFromExcel(last_interest);var fDCi=AscCommonExcel.yearFrac(lastInt,matur,basis)* frequency;var fDSCi=AscCommonExcel.yearFrac(settl,matur,basis)*frequency;var fAi=AscCommonExcel.yearFrac(lastInt,settl,basis)*frequency;var res=redemption+fDCi*100*rate/frequency;res/=pr+fAi*100*rate/frequency;res--;res*=frequency/fDSCi;return new cNumber(res)};function cPDURATION(){}cPDURATION.prototype=Object.create(cBaseFunction.prototype);cPDURATION.prototype.constructor=cPDURATION;cPDURATION.prototype.name="PDURATION";cPDURATION.prototype.argumentsMin=3;cPDURATION.prototype.argumentsMax=3;cPDURATION.prototype.isXLFN= true;cPDURATION.prototype.argumentsType=[argType.number,argType.number,argType.number];cPDURATION.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcfunc=function(argArray){var arg0=argArray[0];var arg1=argArray[1];var arg2=argArray[2];if(arg0<= 0||arg1<=0||arg2<=0)return new cError(cErrorType.not_numeric);return new cNumber(Math.log(arg2/arg1)/Math.log1p(arg0))};return this._findArrayInNumberArguments(oArguments,calcfunc)};function cPMT(){}cPMT.prototype=Object.create(cBaseFunction.prototype);cPMT.prototype.constructor=cPMT;cPMT.prototype.name="PMT";cPMT.prototype.argumentsMin=3;cPMT.prototype.argumentsMax=5;cPMT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPMT.prototype.argumentsType=[argType.number,argType.number,argType.number, argType.number,argType.number];cPMT.prototype.Calculate=function(arg){var rate=arg[0],nper=arg[1],pv=arg[2],fv=arg[3]?arg[3]:new cNumber(0),type=arg[4]?arg[4]:new cNumber(0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(nper instanceof cArea||nper instanceof cArea3D)nper=nper.cross(arguments[1]);else if(nper instanceof cArray)nper=nper.getElementRowCol(0,0);if(pv instanceof cArea||pv instanceof cArea3D)pv= pv.cross(arguments[1]);else if(pv instanceof cArray)pv=pv.getElementRowCol(0,0);if(fv instanceof cArea||fv instanceof cArea3D)fv=fv.cross(arguments[1]);else if(fv instanceof cArray)fv=fv.getElementRowCol(0,0);if(type instanceof cArea||type instanceof cArea3D)type=type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);rate=rate.tocNumber();nper=nper.tocNumber();pv=pv.tocNumber();fv=fv.tocNumber();type=type.tocNumber();if(rate instanceof cError)return rate;if(nper instanceof cError)return nper;if(pv instanceof cError)return pv;if(fv instanceof cError)return fv;if(type instanceof cError)return type;rate=rate.getValue();nper=nper.getValue();fv=fv.getValue();type=type.getValue();pv=pv.getValue();if(type!=1&&type!=0||nper==0)return new cError(cErrorType.not_numeric);var res;if(rate!=0)res=-1*(pv*Math.pow(1+rate,nper)+fv)/((1+rate*type)*(Math.pow(1+rate,nper)-1)/rate);else res=-1*(pv+fv)/nper;res=new cNumber(res);res.numFormat=8;return res};function cPPMT(){}cPPMT.prototype= Object.create(cBaseFunction.prototype);cPPMT.prototype.constructor=cPPMT;cPPMT.prototype.name="PPMT";cPPMT.prototype.argumentsMin=4;cPPMT.prototype.argumentsMax=6;cPPMT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPPMT.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number,argType.number];cPPMT.prototype.Calculate=function(arg){var rate=arg[0],per=arg[1],nper=arg[2],pv=arg[3],fv=arg[4]?arg[4]:new cNumber(0),type=arg[5]?arg[5]:new cNumber(0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(per instanceof cArea||per instanceof cArea3D)per=per.cross(arguments[1]);else if(per instanceof cArray)per=per.getElementRowCol(0,0);if(nper instanceof cArea||nper instanceof cArea3D)nper=nper.cross(arguments[1]);else if(nper instanceof cArray)nper=nper.getElementRowCol(0,0);if(pv instanceof cArea||pv instanceof cArea3D)pv=pv.cross(arguments[1]);else if(pv instanceof cArray)pv= pv.getElementRowCol(0,0);if(fv instanceof cArea||fv instanceof cArea3D)fv=fv.cross(arguments[1]);else if(fv instanceof cArray)fv=fv.getElementRowCol(0,0);if(type instanceof cArea||type instanceof cArea3D)type=type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);rate=rate.tocNumber();per=per.tocNumber();nper=nper.tocNumber();pv=pv.tocNumber();fv=fv.tocNumber();type=type.tocNumber();if(rate instanceof cError)return rate;if(per instanceof cError)return per;if(nper instanceof cError)return nper;if(pv instanceof cError)return pv;if(fv instanceof cError)return fv;if(type instanceof cError)return type;rate=rate.getValue();per=per.getValue();nper=nper.getValue();pv=pv.getValue();fv=fv.getValue();type=type.getValue();var res;if(per<1||per>nper||type!=0&&type!=1)return new cError(cErrorType.not_numeric);var fRmz=getPMT(rate,nper,pv,fv,type);res=fRmz-getIPMT(rate,per,pv,type,fRmz);return new cNumber(res)};function cPRICE(){}cPRICE.prototype=Object.create(cBaseFunction.prototype); cPRICE.prototype.constructor=cPRICE;cPRICE.prototype.name="PRICE";cPRICE.prototype.argumentsMin=6;cPRICE.prototype.argumentsMax=7;cPRICE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPRICE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cPRICE.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cPRICE.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],rate=arg[2],yld=arg[3],redemption= arg[4],frequency=arg[5],basis=arg[6]&&!(arg[6]instanceof cEmpty)?arg[6]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]); else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(yld instanceof cArea||yld instanceof cArea3D)yld=yld.cross(arguments[1]);else if(yld instanceof cArray)yld=yld.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();rate=rate.tocNumber();yld=yld.tocNumber();redemption=redemption.tocNumber();frequency=frequency.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(rate instanceof cError)return rate;if(yld instanceof cError)return yld;if(redemption instanceof cError)return redemption;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());rate=rate.getValue();yld=yld.getValue();redemption=redemption.getValue();frequency=Math.floor(frequency.getValue());basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem|| settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4||rate<0||yld<0||redemption<=0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);return new cNumber(getprice(settl,matur,rate,yld,redemption,frequency,basis))};function cPRICEDISC(){}cPRICEDISC.prototype=Object.create(cBaseFunction.prototype);cPRICEDISC.prototype.constructor=cPRICEDISC;cPRICEDISC.prototype.name="PRICEDISC"; cPRICEDISC.prototype.argumentsMin=4;cPRICEDISC.prototype.argumentsMax=5;cPRICEDISC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPRICEDISC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cPRICEDISC.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any];cPRICEDISC.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],discount=arg[2],redemption=arg[3],basis=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(discount instanceof cArea||discount instanceof cArea3D)discount=discount.cross(arguments[1]);else if(discount instanceof cArray)discount=discount.getElementRowCol(0,0); if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();discount=discount.tocNumber();redemption=redemption.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(discount instanceof cError)return discount;if(redemption instanceof cError)return redemption;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());discount=discount.getValue();redemption=redemption.getValue();basis=Math.floor(basis.getValue());if(settlement>=maturity||settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||basis<0|| basis>4||discount<=0||redemption<=0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);var res=redemption*(1-discount*AscCommonExcel.yearFrac(settl,matur,basis));return new cNumber(res)};function cPRICEMAT(){}cPRICEMAT.prototype=Object.create(cBaseFunction.prototype);cPRICEMAT.prototype.constructor=cPRICEMAT;cPRICEMAT.prototype.name="PRICEMAT";cPRICEMAT.prototype.argumentsMin=5;cPRICEMAT.prototype.argumentsMax= 6;cPRICEMAT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPRICEMAT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cPRICEMAT.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cPRICEMAT.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],issue=arg[2],rate=arg[3],yld=arg[4],basis=arg[5]&&!(arg[5]instanceof cEmpty)?arg[5]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement= settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(issue instanceof cArea||issue instanceof cArea3D)issue=issue.cross(arguments[1]);else if(issue instanceof cArray)issue=issue.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]); else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(yld instanceof cArea||yld instanceof cArea3D)yld=yld.cross(arguments[1]);else if(yld instanceof cArray)yld=yld.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();issue=issue.tocNumber();rate=rate.tocNumber();yld=yld.tocNumber();basis=basis.tocNumber(); if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(issue instanceof cError)return issue;if(rate instanceof cError)return rate;if(yld instanceof cError)return yld;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());issue=Math.floor(issue.getValue());rate=rate.getValue();yld=yld.getValue();basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem|| issue<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||rate<0||yld<0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity),iss=cDate.prototype.getDateFromExcel(issue);var fIssMat=AscCommonExcel.yearFrac(new cDate(iss),new cDate(matur),basis);var fIssSet=AscCommonExcel.yearFrac(new cDate(iss),new cDate(settl),basis);var fSetMat=AscCommonExcel.yearFrac(new cDate(settl),new cDate(matur),basis); var res=1+fIssMat*rate;res/=1+fSetMat*yld;res-=fIssSet*rate;res*=100;return new cNumber(res)};function cPV(){}cPV.prototype=Object.create(cBaseFunction.prototype);cPV.prototype.constructor=cPV;cPV.prototype.name="PV";cPV.prototype.argumentsMin=3;cPV.prototype.argumentsMax=5;cPV.prototype.numFormat=AscCommonExcel.cNumFormatNone;cPV.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number];cPV.prototype.Calculate=function(arg){var rate=arg[0],nper=arg[1],pmt= arg[2],fv=arg[3]?arg[3]:new cNumber(0),type=arg[4]?arg[4]:new cNumber(0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(nper instanceof cArea||nper instanceof cArea3D)nper=nper.cross(arguments[1]);else if(nper instanceof cArray)nper=nper.getElementRowCol(0,0);if(pmt instanceof cArea||pmt instanceof cArea3D)pmt=pmt.cross(arguments[1]);else if(pmt instanceof cArray)pmt=pmt.getElementRowCol(0,0);if(fv instanceof cArea||fv instanceof cArea3D)fv=fv.cross(arguments[1]);else if(fv instanceof cArray)fv=fv.getElementRowCol(0,0);if(type instanceof cArea||type instanceof cArea3D)type=type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);rate=rate.tocNumber();nper=nper.tocNumber();pmt=pmt.tocNumber();fv=fv.tocNumber();type=type.tocNumber();if(rate instanceof cError)return rate;if(nper instanceof cError)return nper;if(pmt instanceof cError)return pmt;if(fv instanceof cError)return fv; if(type instanceof cError)return type;if(type.getValue()!=1&&type.getValue()!=0)return new cError(cErrorType.not_numeric);var res;if(rate.getValue()!=0)res=-1*(fv.getValue()+pmt.getValue()*(1+rate.getValue()*type.getValue())*((Math.pow(1+rate.getValue(),nper.getValue())-1)/rate.getValue()))/Math.pow(1+rate.getValue(),nper.getValue());else res=-1*(fv.getValue()+pmt.getValue()*nper.getValue());return new cNumber(res)};function cRATE(){}cRATE.prototype=Object.create(cBaseFunction.prototype);cRATE.prototype.constructor= cRATE;cRATE.prototype.name="RATE";cRATE.prototype.argumentsMin=3;cRATE.prototype.argumentsMax=6;cRATE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cRATE.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number,argType.number];cRATE.prototype.Calculate=function(arg){var nper=arg[0],pmt=arg[1],pv=arg[2],fv=arg[3]?arg[3]:new cNumber(0),type=arg[4]?arg[4]:new cNumber(0),quess=arg[5]?arg[5]:new cNumber(.1);if(nper instanceof cArea||nper instanceof cArea3D)nper= nper.cross(arguments[1]);else if(nper instanceof cArray)nper=nper.getElementRowCol(0,0);if(pmt instanceof cArea||pmt instanceof cArea3D)pmt=pmt.cross(arguments[1]);else if(pmt instanceof cArray)pmt=pmt.getElementRowCol(0,0);if(pv instanceof cArea||pv instanceof cArea3D)pv=pv.cross(arguments[1]);else if(pv instanceof cArray)pv=pv.getElementRowCol(0,0);if(fv instanceof cArea||fv instanceof cArea3D)fv=fv.cross(arguments[1]);else if(fv instanceof cArray)fv=fv.getElementRowCol(0,0);if(type instanceof cArea|| type instanceof cArea3D)type=type.cross(arguments[1]);else if(type instanceof cArray)type=type.getElementRowCol(0,0);if(quess instanceof cArea||quess instanceof cArea3D)quess=quess.cross(arguments[1]);else if(quess instanceof cArray)quess=quess.getElementRowCol(0,0);nper=nper.tocNumber();pmt=pmt.tocNumber();pv=pv.tocNumber();fv=fv.tocNumber();type=type.tocNumber();quess=quess.tocNumber();if(nper instanceof cError)return nper;if(pmt instanceof cError)return pmt;if(pv instanceof cError)return pv;if(fv instanceof cError)return fv;if(type instanceof cError)return type;if(quess instanceof cError)return quess;nper=nper.getValue();pmt=pmt.getValue();pv=pv.getValue();fv=fv.getValue();type=type.getValue();quess=quess.getValue();if(type!=1&&type!=0||nper<=0)return new cError(cErrorType.not_numeric);var res=new cNumber(RateIteration(nper,pmt,pv,fv,type,quess));res.numFormat=9;return res};function cRECEIVED(){}cRECEIVED.prototype=Object.create(cBaseFunction.prototype);cRECEIVED.prototype.constructor=cRECEIVED;cRECEIVED.prototype.name= "RECEIVED";cRECEIVED.prototype.argumentsMin=4;cRECEIVED.prototype.argumentsMax=5;cRECEIVED.prototype.numFormat=AscCommonExcel.cNumFormatNone;cRECEIVED.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cRECEIVED.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any];cRECEIVED.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],investment=arg[2],discount=arg[3],basis=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(0); if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(investment instanceof cArea||investment instanceof cArea3D)investment=investment.cross(arguments[1]);else if(investment instanceof cArray)investment= investment.getElementRowCol(0,0);if(discount instanceof cArea||discount instanceof cArea3D)discount=discount.cross(arguments[1]);else if(discount instanceof cArray)discount=discount.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();investment=investment.tocNumber();discount=discount.tocNumber();basis=basis.tocNumber(); if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(investment instanceof cError)return investment;if(discount instanceof cError)return discount;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());investment=investment.getValue();discount=discount.getValue();basis=Math.floor(basis.getValue());if(settlement>=maturity||investment<=0||discount<=0||settlement<startRangeCurrentDateSystem|| maturity<startRangeCurrentDateSystem||basis<0||basis>4)return new cError(cErrorType.not_numeric);var res=investment/(1-discount*AscCommonExcel.yearFrac(cDate.prototype.getDateFromExcel(settlement),cDate.prototype.getDateFromExcel(maturity),basis));return res>=0?new cNumber(res):new cError(cErrorType.not_numeric)};function cRRI(){}cRRI.prototype=Object.create(cBaseFunction.prototype);cRRI.prototype.constructor=cRRI;cRRI.prototype.name="RRI";cRRI.prototype.argumentsMin=3;cRRI.prototype.argumentsMax= 3;cRRI.prototype.isXLFN=true;cRRI.prototype.argumentsType=[argType.number,argType.number,argType.number];cRRI.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var calcrpi=function(argArray){var arg0=argArray[0];var arg1=argArray[1];var arg2=argArray[2]; if(arg0<=0||arg1===0)return new cError(cErrorType.not_numeric);return new cNumber(Math.pow(arg2/arg1,1/arg0)-1)};return this._findArrayInNumberArguments(oArguments,calcrpi)};function cSLN(){}cSLN.prototype=Object.create(cBaseFunction.prototype);cSLN.prototype.constructor=cSLN;cSLN.prototype.name="SLN";cSLN.prototype.argumentsMin=3;cSLN.prototype.argumentsMax=3;cSLN.prototype.numFormat=AscCommonExcel.cNumFormatNone;cSLN.prototype.argumentsType=[argType.number,argType.number,argType.number];cSLN.prototype.Calculate= function(arg){var cost=arg[0],salvage=arg[1],life=arg[2];if(cost instanceof cArea||cost instanceof cArea3D)cost=cost.cross(arguments[1]);else if(cost instanceof cArray)cost=cost.getElementRowCol(0,0);if(salvage instanceof cArea||salvage instanceof cArea3D)salvage=salvage.cross(arguments[1]);else if(salvage instanceof cArray)salvage=salvage.getElementRowCol(0,0);if(life instanceof cArea||life instanceof cArea3D)life=life.cross(arguments[1]);else if(life instanceof cArray)life=life.getElementRowCol(0, 0);cost=cost.tocNumber();salvage=salvage.tocNumber();life=life.tocNumber();if(cost instanceof cError)return cost;if(salvage instanceof cError)return salvage;if(life instanceof cError)return life;cost=cost.getValue();salvage=salvage.getValue();life=life.getValue();if(life==0)return new cError(cErrorType.division_by_zero);return new cNumber((cost-salvage)/life)};function cSYD(){}cSYD.prototype=Object.create(cBaseFunction.prototype);cSYD.prototype.constructor=cSYD;cSYD.prototype.name="SYD";cSYD.prototype.argumentsMin= 4;cSYD.prototype.argumentsMax=4;cSYD.prototype.numFormat=AscCommonExcel.cNumFormatNone;cSYD.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number];cSYD.prototype.Calculate=function(arg){var cost=arg[0],salvage=arg[1],life=arg[2],per=arg[3];if(cost instanceof cArea||cost instanceof cArea3D)cost=cost.cross(arguments[1]);else if(cost instanceof cArray)cost=cost.getElementRowCol(0,0);if(salvage instanceof cArea||salvage instanceof cArea3D)salvage=salvage.cross(arguments[1]); else if(salvage instanceof cArray)salvage=salvage.getElementRowCol(0,0);if(life instanceof cArea||life instanceof cArea3D)life=life.cross(arguments[1]);else if(life instanceof cArray)life=life.getElementRowCol(0,0);if(per instanceof cArea||per instanceof cArea3D)per=per.cross(arguments[1]);else if(per instanceof cArray)per=per.getElementRowCol(0,0);cost=cost.tocNumber();salvage=salvage.tocNumber();life=life.tocNumber();per=per.tocNumber();if(cost instanceof cError)return cost;if(salvage instanceof cError)return salvage;if(life instanceof cError)return life;if(per instanceof cError)return per;cost=cost.getValue();salvage=salvage.getValue();life=life.getValue();per=per.getValue();if(life==1||life<=0||salvage<0||per<0)return new cError(cErrorType.not_numeric);var res=2;res*=cost-salvage;res*=life+1-per;res/=(life+1)*life;return new cNumber(res)};function cTBILLEQ(){}cTBILLEQ.prototype=Object.create(cBaseFunction.prototype);cTBILLEQ.prototype.constructor=cTBILLEQ;cTBILLEQ.prototype.name="TBILLEQ"; cTBILLEQ.prototype.argumentsMin=3;cTBILLEQ.prototype.argumentsMax=3;cTBILLEQ.prototype.numFormat=AscCommonExcel.cNumFormatNone;cTBILLEQ.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cTBILLEQ.prototype.argumentsType=[argType.any,argType.any,argType.any];cTBILLEQ.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],discount=arg[2];if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(discount instanceof cArea||discount instanceof cArea3D)discount=discount.cross(arguments[1]);else if(discount instanceof cArray)discount=discount.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();discount=discount.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(discount instanceof cError)return discount;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());discount=discount.getValue();if(settlement>=maturity||settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||discount<=0||nDiff>360)return new cError(cErrorType.not_numeric);var nMat=maturity+1;var d1=cDate.prototype.getDateFromExcel(settlement);var d2=cDate.prototype.getDateFromExcel(nMat); var date1=d1.getUTCDate(),month1=d1.getUTCMonth(),year1=d1.getUTCFullYear(),date2=d2.getUTCDate(),month2=d2.getUTCMonth(),year2=d2.getUTCFullYear();var nDiff=AscCommonExcel.GetDiffDate360(date1,month1,year1,date2,month2,year2,true);if(nDiff>360)return new cError(cErrorType.not_numeric);var res=new cNumber(365*discount/(360-discount*nDiff));res.numFormat=9;return res};function cTBILLPRICE(){}cTBILLPRICE.prototype=Object.create(cBaseFunction.prototype);cTBILLPRICE.prototype.constructor=cTBILLPRICE; cTBILLPRICE.prototype.name="TBILLPRICE";cTBILLPRICE.prototype.argumentsMin=3;cTBILLPRICE.prototype.argumentsMax=3;cTBILLPRICE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cTBILLPRICE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cTBILLPRICE.prototype.argumentsType=[argType.any,argType.any,argType.any];cTBILLPRICE.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],discount=arg[2];if(settlement instanceof cArea||settlement instanceof cArea3D)settlement= settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(discount instanceof cArea||discount instanceof cArea3D)discount=discount.cross(arguments[1]);else if(discount instanceof cArray)discount=discount.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber(); discount=discount.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(discount instanceof cError)return discount;settlement=Math.floor(Math.floor(settlement.getValue()));maturity=Math.floor(Math.floor(maturity.getValue()));discount=discount.getValue();if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||discount<=0)return new cError(cErrorType.not_numeric);var d1=cDate.prototype.getDateFromExcel(settlement), d2=cDate.prototype.getDateFromExcel(maturity),d3=new cDate(d1);d3.addYears(1);if(d2>d3)return new cError(cErrorType.not_numeric);discount*=AscCommonExcel.diffDate(d1,d2,AscCommonExcel.DayCountBasis.ActualActual);return new cNumber(100*(1-discount/360))};function cTBILLYIELD(){}cTBILLYIELD.prototype=Object.create(cBaseFunction.prototype);cTBILLYIELD.prototype.constructor=cTBILLYIELD;cTBILLYIELD.prototype.name="TBILLYIELD";cTBILLYIELD.prototype.argumentsMin=3;cTBILLYIELD.prototype.argumentsMax=3;cTBILLYIELD.prototype.numFormat= AscCommonExcel.cNumFormatNone;cTBILLYIELD.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cTBILLYIELD.prototype.argumentsType=[argType.any,argType.any,argType.any];cTBILLYIELD.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],pr=arg[2];if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea|| maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(pr instanceof cArea||pr instanceof cArea3D)pr=pr.cross(arguments[1]);else if(pr instanceof cArray)pr=pr.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();pr=pr.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(pr instanceof cError)return pr;settlement=Math.floor(settlement.getValue()); maturity=Math.floor(maturity.getValue());pr=pr.getValue();if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||pr<=0)return new cError(cErrorType.not_numeric);var d1=cDate.prototype.getDateFromExcel(settlement),d2=cDate.prototype.getDateFromExcel(maturity),date1=d1.getUTCDate(),month1=d1.getUTCMonth(),year1=d1.getUTCFullYear(),date2=d2.getUTCDate(),month2=d2.getUTCMonth(),year2=d2.getUTCFullYear();var nDiff=AscCommonExcel.GetDiffDate360(date1,month1, year1,date2,month2,year2,true);nDiff++;if(nDiff>360)return new cError(cErrorType.not_numeric);var res=new cNumber((100-pr)/pr*(360/nDiff));res.numFormat=9;return res};function cVDB(){}cVDB.prototype=Object.create(cBaseFunction.prototype);cVDB.prototype.constructor=cVDB;cVDB.prototype.name="VDB";cVDB.prototype.argumentsMin=5;cVDB.prototype.argumentsMax=7;cVDB.prototype.numFormat=AscCommonExcel.cNumFormatNone;cVDB.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number, argType.number,argType.number,argType.logical];cVDB.prototype.Calculate=function(arg){var cost=arg[0],salvage=arg[1],life=arg[2],startPeriod=arg[3],endPeriod=arg[4],factor=arg[5]&&!(arg[5]instanceof cEmpty)?arg[5]:new cNumber(2),flag=arg[6]&&!(arg[6]instanceof cEmpty)?arg[6]:new cBool(false);function getVDB(cost,fRest,life,life1,startPeriod,factor){var res=0,loopEnd=end=Math.ceil(startPeriod),temp,sln=0,rest=cost-fRest,sln1=false,ddb;for(var i=1;i<=loopEnd;i++){if(!sln1){ddb=getDDB(cost,fRest,life, i,factor);sln=rest/(life1-(i-1));if(sln>ddb){temp=sln;sln1=true}else{temp=ddb;rest-=ddb}}else temp=sln;if(i==loopEnd)temp*=startPeriod+1-end;res+=temp}return res}if(cost instanceof cArea||cost instanceof cArea3D)cost=cost.cross(arguments[1]);else if(cost instanceof cArray)cost=cost.getElementRowCol(0,0);if(salvage instanceof cArea||salvage instanceof cArea3D)salvage=salvage.cross(arguments[1]);else if(salvage instanceof cArray)salvage=salvage.getElementRowCol(0,0);if(life instanceof cArea||life instanceof cArea3D)life=life.cross(arguments[1]);else if(life instanceof cArray)life=life.getElementRowCol(0,0);if(startPeriod instanceof cArea||startPeriod instanceof cArea3D)startPeriod=startPeriod.cross(arguments[1]);else if(startPeriod instanceof cArray)startPeriod=startPeriod.getElementRowCol(0,0);if(endPeriod instanceof cArea||endPeriod instanceof cArea3D)endPeriod=endPeriod.cross(arguments[1]);else if(endPeriod instanceof cArray)endPeriod=endPeriod.getElementRowCol(0,0);if(factor instanceof cArea||factor instanceof cArea3D)factor=factor.cross(arguments[1]);else if(factor instanceof cArray)factor=factor.getElementRowCol(0,0);if(flag instanceof cArea||flag instanceof cArea3D)flag=flag.cross(arguments[1]);else if(flag instanceof cArray)flag=flag.getElementRowCol(0,0);cost=cost.tocNumber();salvage=salvage.tocNumber();life=life.tocNumber();startPeriod=startPeriod.tocNumber();endPeriod=endPeriod.tocNumber();factor=factor.tocNumber();flag=flag.tocBool();if(cost instanceof cError)return cost;if(salvage instanceof cError)return salvage; if(life instanceof cError)return life;if(startPeriod instanceof cError)return startPeriod;if(endPeriod instanceof cError)return endPeriod;if(factor instanceof cError)return factor;if(flag instanceof cError)return flag;cost=cost.getValue();salvage=salvage.getValue();life=life.getValue();startPeriod=startPeriod.getValue();endPeriod=endPeriod.getValue();factor=factor.getValue();flag=flag.getValue();if(life===0&&startPeriod===0&&endPeriod===0)return new cError(cErrorType.division_by_zero);if(cost<salvage|| life<0||startPeriod<0||life<startPeriod||startPeriod>endPeriod||life<endPeriod||factor<0)return new cError(cErrorType.not_numeric);var start=Math.floor(startPeriod),end=Math.ceil(endPeriod);var res=0;if(flag)for(var i=start+1;i<=end;i++){var ddb=getDDB(cost,salvage,life,i,factor);if(i==start+1)ddb*=Math.min(endPeriod,start+1)-startPeriod;else if(i==end)ddb*=endPeriod+1-end;res+=ddb}else{var life1=life;if(!Math.approxEqual(startPeriod,Math.floor(startPeriod)))if(factor>1)if(startPeriod>life/2||Math.approxEqual(startPeriod, life/2)){var fPart=startPeriod-life/2;startPeriod=life/2;endPeriod-=fPart;life1+=1}cost-=getVDB(cost,salvage,life,life1,startPeriod,factor);res=getVDB(cost,salvage,life,life-startPeriod,endPeriod-startPeriod,factor)}return new cNumber(res)};function cXIRR(){}cXIRR.prototype=Object.create(cBaseFunction.prototype);cXIRR.prototype.constructor=cXIRR;cXIRR.prototype.name="XIRR";cXIRR.prototype.argumentsMin=2;cXIRR.prototype.argumentsMax=3;cXIRR.prototype.numFormat=AscCommonExcel.cNumFormatNone;cXIRR.prototype.arrayIndexes= {0:1,1:1};cXIRR.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cXIRR.prototype.argumentsType=[argType.any,argType.any,argType.any];cXIRR.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2]?arg[2]:new cNumber(.1);function xirrFunction(values,dates,rate){var D_0=dates[0],r=rate+1,res=values[0];for(var i=1;i<values.length;i++)res+=values[i]/Math.pow(r,(dates[i]-D_0)/365);return res}function xirrDeriv(values,dates,rate){var D_0=dates[0],r=rate+1,res= 0,sumDerivI;for(var i=1,count=values.length;i<count;i++){sumDerivI=(dates[i]-D_0)/365;res-=sumDerivI*values[i]/Math.pow(r,sumDerivI+1)}return res}function xirr2(_values,_dates,_rate){var arr0=_values[0],arr1=_dates[0];if(arr0 instanceof cError)return arr0;if(arr1 instanceof cError)return arr1;if(arr0.getValue()==0)return new cError(cErrorType.not_numeric);if(_values.length<2||_dates.length!=_values.length)return new cError(cErrorType.not_numeric);var res=_rate.getValue();if(res<=-1)return new cError(cErrorType.not_numeric); var wasNeg=false,wasPos=false;for(var i=0;i<_dates.length;i++){_dates[i]=_dates[i].tocNumber();_values[i]=_values[i].tocNumber();if(_dates[i]instanceof cError||_values[i]instanceof cError)return new cError(cErrorType.wrong_value_type);_dates[i]=Math.floor(_dates[i].getValue());_values[i]=_values[i].getValue();if(_dates[0]>_dates[i])return new cError(cErrorType.not_numeric);if(_values[i]<0)wasNeg=true;else wasPos=true}if(!(wasNeg&&wasPos))return new cError(cErrorType.not_numeric);var g_Eps=1E-7,nIM= 500,eps=1,nMC=0,xN,guess=res,g_Eps2=g_Eps*2;while(eps>g_Eps&&nMC<nIM){xN=res-xirrFunction(_values,_dates,res)/((xirrFunction(_values,_dates,res+g_Eps)-xirrFunction(_values,_dates,res-g_Eps))/g_Eps2);nMC++;eps=Math.abs(xN-res);res=xN}if(isNaN(res)||Infinity==Math.abs(res)){var max=Number.MAX_VALUE,min=-Number.MAX_VALUE,step=1.6,low=guess-.01<=min?min+g_Eps:guess-.01,high=guess+.01>=max?max-g_Eps:guess+.01,i,xBegin,xEnd,x,y,currentIter=0;if(guess<=min||guess>=max)return new cError(cErrorType.not_numeric); for(i=0;i<nIM;i++){xBegin=low<=min?min+g_Eps:low;xEnd=high>=max?max-g_Eps:high;x=xirrFunction(_values,_dates,xBegin);y=xirrFunction(_values,_dates,xEnd);if(x*y<=0)break;else if(x*y>0){low=xBegin+step*(xBegin-xEnd);high=xEnd+step*(xEnd-xBegin)}else return new cError(cErrorType.not_numeric)}if(i==nIM)return new cError(cErrorType.not_numeric);var fXbegin=xirrFunction(_values,_dates,xBegin),fXend=xirrFunction(_values,_dates,xEnd),fXi,xI;if(Math.abs(fXbegin)<g_Eps)return new cNumber(fXbegin);if(Math.abs(fXend)< g_Eps)return new cNumber(fXend);do{xI=xBegin+(xEnd-xBegin)/2;fXi=xirrFunction(_values,_dates,xI);if(fXbegin*fXi<0)xEnd=xI;else xBegin=xI;fXbegin=xirrFunction(_values,_dates,xBegin);currentIter++}while(Math.abs(fXi)>g_Eps&¤tIter<nIM);return new cNumber(xI)}else return new cNumber(res)}var _dates=[],_values=[];if(arg0 instanceof cArea)arg0.foreach2(function(c){if(c instanceof cNumber)_values.push(c);else if(c instanceof cEmpty)_values.push(c.tocNumber());else _values.push(new cError(cErrorType.wrong_value_type))}); else if(arg0 instanceof cArray)arg0.foreach(function(c){if(c instanceof cNumber)_values.push(c);else if(c instanceof cEmpty)_values.push(c.tocNumber());else _values.push(new cError(cErrorType.wrong_value_type))});else if(arg0 instanceof cArea3D)if(arg0.isSingleSheet())_values=arg0.getMatrix()[0];else return new cError(cErrorType.wrong_value_type);else if(!(arg0 instanceof cNumber))return new cError(cErrorType.wrong_value_type);else _values[0]=arg0;if(arg1 instanceof cArea)arg1.foreach2(function(c){if(c instanceof cNumber)_dates.push(c);else if(c instanceof cEmpty)_dates.push(c.tocNumber());else _dates.push(new cError(cErrorType.wrong_value_type))});else if(arg1 instanceof cArray)arg1.foreach(function(c){if(c instanceof cNumber)_dates.push(c);else if(c instanceof cEmpty)_dates.push(c.tocNumber());else _dates.push(new cError(cErrorType.wrong_value_type))});else if(arg1 instanceof cArea3D)if(arg1.isSingleSheet())_dates=arg1.getMatrix()[0];else return new cError(cErrorType.wrong_value_type);else if(!(arg1 instanceof cNumber))return new cError(cErrorType.wrong_value_type);else _dates[0]=arg1;if(arg2 instanceof AscCommonExcel.cRef||arg2 instanceof AscCommonExcel.cRef3D){arg2=arg2.getValue();if(!(arg2 instanceof cNumber))return new cError(cErrorType.wrong_value_type)}else if(arg2 instanceof cArea||arg2 instanceof cArea3D){arg2=arg2.cross(arguments[1]);if(!(arg2 instanceof cNumber))return new cError(cErrorType.wrong_value_type)}else if(arg2 instanceof cArray){arg2=arg2.getElement(0);if(!(arg2 instanceof cNumber))return new cError(cErrorType.wrong_value_type)}arg2= arg2.tocNumber();if(arg2 instanceof cError)return arg2;var res=xirr2(_values,_dates,arg2);res.numFormat=9;return res};function cXNPV(){}cXNPV.prototype=Object.create(cBaseFunction.prototype);cXNPV.prototype.constructor=cXNPV;cXNPV.prototype.name="XNPV";cXNPV.prototype.argumentsMin=3;cXNPV.prototype.argumentsMax=3;cXNPV.prototype.numFormat=AscCommonExcel.cNumFormatNone;cXNPV.prototype.arrayIndexes={1:1,2:1};cXNPV.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cXNPV.prototype.argumentsType= [argType.any,argType.any,argType.any];cXNPV.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2];function xnpv(rate,valueArray,dateArray){var res=0,vaTmp,daTmp,r=1+rate.getValue();if(dateArray.length!=valueArray.length)return new cError(cErrorType.not_numeric);if(!(dateArray[0]instanceof cNumber)||!(valueArray[0]instanceof cNumber))return new cError(cErrorType.wrong_value_type);var d1=Math.floor(dateArray[0].getValue()),wasNeg=false,wasPos=false;for(var i=0;i<dateArray.length;i++){vaTmp= valueArray[i].tocNumber();daTmp=dateArray[i].tocNumber();if(vaTmp instanceof cError||daTmp instanceof cError)return new cError(cErrorType.not_numeric);res+=vaTmp.getValue()/Math.pow(r,(Math.floor(daTmp.getValue())-d1)/365)}return new cNumber(res)}if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg0 instanceof cArray)arg0=arg0.getElement(0);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;var dateArray=[],valueArray=[];if(arg1 instanceof cArea)arg1.foreach2(function(c){if(c instanceof cNumber)valueArray.push(c);else valueArray.push(new cError(cErrorType.not_numeric))});else if(arg1 instanceof cArray)arg1.foreach(function(c){if(c instanceof cNumber)valueArray.push(c);else valueArray.push(new cError(cErrorType.not_numeric))});else if(arg1 instanceof cArea3D)if(arg1.isSingleSheet())valueArray=arg1.getMatrix()[0];else return new cError(cErrorType.wrong_value_type);else{arg1=arg1.tocNumber();if(arg1 instanceof cError)return new cError(cErrorType.not_numeric);else valueArray[0]=arg1}if(arg2 instanceof cArea)arg2.foreach2(function(c){if(c instanceof cNumber)dateArray.push(c);else dateArray.push(new cError(cErrorType.not_numeric))});else if(arg2 instanceof cArray)arg2.foreach(function(c){if(c instanceof cNumber)dateArray.push(c);else dateArray.push(new cError(cErrorType.not_numeric))});else if(arg2 instanceof cArea3D)if(arg2.isSingleSheet())dateArray=arg2.getMatrix()[0];else return new cError(cErrorType.wrong_value_type);else{arg2=arg2.tocNumber();if(arg2 instanceof cError)return new cError(cErrorType.not_numeric); else dateArray[0]=arg2}return xnpv(arg0,valueArray,dateArray)};function cYIELD(){}cYIELD.prototype=Object.create(cBaseFunction.prototype);cYIELD.prototype.constructor=cYIELD;cYIELD.prototype.name="YIELD";cYIELD.prototype.argumentsMin=6;cYIELD.prototype.argumentsMax=7;cYIELD.prototype.numFormat=AscCommonExcel.cNumFormatNone;cYIELD.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cYIELD.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any, argType.any,argType.any];cYIELD.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],rate=arg[2],pr=arg[3],redemption=arg[4],frequency=arg[5],basis=arg[6]&&!(arg[6]instanceof cEmpty)?arg[6]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]); else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]);else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(pr instanceof cArea||pr instanceof cArea3D)pr=pr.cross(arguments[1]);else if(pr instanceof cArray)pr=pr.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0, 0);if(frequency instanceof cArea||frequency instanceof cArea3D)frequency=frequency.cross(arguments[1]);else if(frequency instanceof cArray)frequency=frequency.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();rate=rate.tocNumber();pr=pr.tocNumber();redemption=redemption.tocNumber();frequency=frequency.tocNumber(); basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(rate instanceof cError)return rate;if(pr instanceof cError)return pr;if(redemption instanceof cError)return redemption;if(frequency instanceof cError)return frequency;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());rate=rate.getValue();pr=pr.getValue();redemption=redemption.getValue();frequency=Math.floor(frequency.getValue()); basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||frequency!=1&&frequency!=2&&frequency!=4||rate<0||pr<=0||redemption<=0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);return new cNumber(getYield(settl,matur,rate,pr,redemption,frequency,basis))};function cYIELDDISC(){}cYIELDDISC.prototype=Object.create(cBaseFunction.prototype); cYIELDDISC.prototype.constructor=cYIELDDISC;cYIELDDISC.prototype.name="YIELDDISC";cYIELDDISC.prototype.argumentsMin=4;cYIELDDISC.prototype.argumentsMax=5;cYIELDDISC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cYIELDDISC.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cYIELDDISC.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any];cYIELDDISC.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],pr=arg[2],redemption= arg[3],basis=arg[4]&&!(arg[4]instanceof cEmpty)?arg[4]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement=settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(pr instanceof cArea||pr instanceof cArea3D)pr=pr.cross(arguments[1]);else if(pr instanceof cArray)pr=pr.getElementRowCol(0,0);if(redemption instanceof cArea||redemption instanceof cArea3D)redemption=redemption.cross(arguments[1]);else if(redemption instanceof cArray)redemption=redemption.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();pr=pr.tocNumber();redemption=redemption.tocNumber();basis=basis.tocNumber(); if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(pr instanceof cError)return pr;if(redemption instanceof cError)return redemption;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());pr=pr.getValue();redemption=redemption.getValue();basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||settlement>=maturity||basis<0|| basis>4||pr<=0||redemption<=0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity);var fRet=redemption/pr-1;fRet/=AscCommonExcel.yearFrac(settl,matur,basis);var res=new cNumber(fRet);res.numFormat=10;return res};function cYIELDMAT(){}cYIELDMAT.prototype=Object.create(cBaseFunction.prototype);cYIELDMAT.prototype.constructor=cYIELDMAT;cYIELDMAT.prototype.name="YIELDMAT";cYIELDMAT.prototype.argumentsMin=5;cYIELDMAT.prototype.argumentsMax= 6;cYIELDMAT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cYIELDMAT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cYIELDMAT.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any,argType.any,argType.any];cYIELDMAT.prototype.Calculate=function(arg){var settlement=arg[0],maturity=arg[1],issue=arg[2],rate=arg[3],pr=arg[4],basis=arg[5]&&!(arg[5]instanceof cEmpty)?arg[5]:new cNumber(0);if(settlement instanceof cArea||settlement instanceof cArea3D)settlement= settlement.cross(arguments[1]);else if(settlement instanceof cArray)settlement=settlement.getElementRowCol(0,0);if(maturity instanceof cArea||maturity instanceof cArea3D)maturity=maturity.cross(arguments[1]);else if(maturity instanceof cArray)maturity=maturity.getElementRowCol(0,0);if(issue instanceof cArea||issue instanceof cArea3D)issue=issue.cross(arguments[1]);else if(issue instanceof cArray)issue=issue.getElementRowCol(0,0);if(rate instanceof cArea||rate instanceof cArea3D)rate=rate.cross(arguments[1]); else if(rate instanceof cArray)rate=rate.getElementRowCol(0,0);if(pr instanceof cArea||pr instanceof cArea3D)pr=pr.cross(arguments[1]);else if(pr instanceof cArray)pr=pr.getElementRowCol(0,0);if(basis instanceof cArea||basis instanceof cArea3D)basis=basis.cross(arguments[1]);else if(basis instanceof cArray)basis=basis.getElementRowCol(0,0);settlement=settlement.tocNumber();maturity=maturity.tocNumber();issue=issue.tocNumber();rate=rate.tocNumber();pr=pr.tocNumber();basis=basis.tocNumber();if(settlement instanceof cError)return settlement;if(maturity instanceof cError)return maturity;if(issue instanceof cError)return issue;if(rate instanceof cError)return rate;if(pr instanceof cError)return pr;if(basis instanceof cError)return basis;settlement=Math.floor(settlement.getValue());maturity=Math.floor(maturity.getValue());issue=Math.floor(issue.getValue());rate=rate.getValue();pr=pr.getValue();basis=Math.floor(basis.getValue());if(settlement<startRangeCurrentDateSystem||maturity<startRangeCurrentDateSystem||issue< startRangeCurrentDateSystem||settlement>=maturity||basis<0||basis>4||pr<=0||rate<=0)return new cError(cErrorType.not_numeric);var settl=cDate.prototype.getDateFromExcel(settlement),matur=cDate.prototype.getDateFromExcel(maturity),iss=cDate.prototype.getDateFromExcel(issue),res=getyieldmat(settl,matur,iss,rate,pr,basis);var res=new cNumber(res);res.numFormat=10;return res};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].getPMT=getPMT;window["AscCommonExcel"].getIPMT= getIPMT;window["AscCommonExcel"].getcoupdaybs=getcoupdaybs;window["AscCommonExcel"].getcoupdays=getcoupdays;window["AscCommonExcel"].getcoupnum=getcoupnum})(window);"use strict";(function(window,undefined){var cElementType=AscCommonExcel.cElementType;var cErrorType=AscCommonExcel.cErrorType;var cExcelSignificantDigits=AscCommonExcel.cExcelSignificantDigits;var cNumber=AscCommonExcel.cNumber;var cString=AscCommonExcel.cString;var cBool=AscCommonExcel.cBool;var cError=AscCommonExcel.cError;var cArea= AscCommonExcel.cArea;var cArea3D=AscCommonExcel.cArea3D;var cRef=AscCommonExcel.cRef;var cRef3D=AscCommonExcel.cRef3D;var cEmpty=AscCommonExcel.cEmpty;var cArray=AscCommonExcel.cArray;var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var argType=Asc.c_oAscFormulaArgumentType;var _func=AscCommonExcel._func;var AGGREGATE_FUNC_AVE=1;var AGGREGATE_FUNC_CNT=2;var AGGREGATE_FUNC_CNTA=3;var AGGREGATE_FUNC_MAX=4;var AGGREGATE_FUNC_MIN=5;var AGGREGATE_FUNC_PROD= 6;var AGGREGATE_FUNC_STD=7;var AGGREGATE_FUNC_STDP=8;var AGGREGATE_FUNC_SUM=9;var AGGREGATE_FUNC_VAR=10;var AGGREGATE_FUNC_VARP=11;var AGGREGATE_FUNC_MEDIAN=12;var AGGREGATE_FUNC_MODSNGL=13;var AGGREGATE_FUNC_LARGE=14;var AGGREGATE_FUNC_SMALL=15;var AGGREGATE_FUNC_PERCINC=16;var AGGREGATE_FUNC_QRTINC=17;var AGGREGATE_FUNC_PERCEXC=18;var AGGREGATE_FUNC_QRTEXC=19;cFormulaFunctionGroup["Mathematic"]=cFormulaFunctionGroup["Mathematic"]||[];cFormulaFunctionGroup["Mathematic"].push(cABS,cACOS,cACOSH,cACOT, cACOTH,cAGGREGATE,cARABIC,cASIN,cASINH,cATAN,cATAN2,cATANH,cBASE,cCEILING,cCEILING_MATH,cCEILING_PRECISE,cCOMBIN,cCOMBINA,cCOS,cCOSH,cCOT,cCOTH,cCSC,cCSCH,cDECIMAL,cDEGREES,cECMA_CEILING,cEVEN,cEXP,cFACT,cFACTDOUBLE,cFLOOR,cFLOOR_PRECISE,cFLOOR_MATH,cGCD,cINT,cISO_CEILING,cLCM,cLN,cLOG,cLOG10,cMDETERM,cMINVERSE,cMMULT,cMOD,cMROUND,cMULTINOMIAL,cMUNIT,cODD,cPI,cPOWER,cPRODUCT,cQUOTIENT,cRADIANS,cRAND,cRANDARRAY,cRANDBETWEEN,cROMAN,cROUND,cROUNDDOWN,cROUNDUP,cSEC,cSECH,cSERIESSUM,cSIGN,cSIN,cSINH,cSQRT, cSQRTPI,cSUBTOTAL,cSUM,cSUMIF,cSUMIFS,cSUMPRODUCT,cSUMSQ,cSUMX2MY2,cSUMX2PY2,cSUMXMY2,cTAN,cTANH,cTRUNC);var cSubTotalFunctionType={includes:{AVERAGE:1,COUNT:2,COUNTA:3,MAX:4,MIN:5,PRODUCT:6,STDEV:7,STDEVP:8,SUM:9,VAR:10,VARP:11},excludes:{AVERAGE:101,COUNT:102,COUNTA:103,MAX:104,MIN:105,PRODUCT:106,STDEV:107,STDEVP:108,SUM:109,VAR:110,VARP:111}};function sumxCalc(arg,func){function sumX(a,b,_3d){var sum=0,i,j;if(!_3d)if(a.length==b.length&&a[0]&&b[0]&&a[0].length==b[0].length){for(i=0;i<a.length;i++)for(j= 0;j<a[0].length;j++)if(a[i][j]instanceof cNumber&&b[i][j]instanceof cNumber)sum+=func(a[i][j].getValue(),b[i][j].getValue());else return new cError(cErrorType.wrong_value_type);return new cNumber(sum)}else return new cError(cErrorType.wrong_value_type);else if(a.length==b.length&&a[0]&&b[0]&&a[0].length==b[0].length&&a[0][0]&&b[0][0]&&a[0][0].length==b[0][0].length){for(i=0;i<a.length;i++)for(j=0;j<a[0].length;j++)for(var k=0;k<a[0][0].length;k++)if(a[i][j][k]instanceof cNumber&&b[i][j][k]instanceof cNumber)sum+=func(a[i][j][k].getValue(),b[i][j][k].getValue());else return new cError(cErrorType.wrong_value_type);return new cNumber(sum)}else return new cError(cErrorType.wrong_value_type)}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea3D&&arg1 instanceof cArea3D)return sumX(arg0.getMatrix(),arg1.getMatrix(),true);if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cArea||arg0 instanceof cArray)arg0=arg0.getMatrix();else if(arg0 instanceof cError)return arg0; else if(arg0 instanceof cNumber)arg0=[[arg0]];else return new cError(cErrorType.wrong_value_type);if(arg1 instanceof cRef||arg1 instanceof cRef3D)arg1=arg1.getValue();if(arg1 instanceof cArea||arg1 instanceof cArray||arg1 instanceof cArea3D)arg1=arg1.getMatrix();else if(arg1 instanceof cError)return arg1;else if(arg1 instanceof cNumber)arg1=[[arg1]];else return new cError(cErrorType.wrong_value_type);return sumX(arg0,arg1,false)}function cABS(){}cABS.prototype=Object.create(cBaseFunction.prototype); cABS.prototype.constructor=cABS;cABS.prototype.name="ABS";cABS.prototype.argumentsMin=1;cABS.prototype.argumentsMax=1;cABS.prototype.argumentsType=[argType.number];cABS.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)this.array[r][c]=new cNumber(Math.abs(elem.getValue())); else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else return new cNumber(Math.abs(arg0.getValue()));return arg0};function cACOS(){}cACOS.prototype=Object.create(cBaseFunction.prototype);cACOS.prototype.constructor=cACOS;cACOS.prototype.name="ACOS";cACOS.prototype.argumentsMin=1;cACOS.prototype.argumentsMax=1;cACOS.prototype.argumentsType=[argType.number];cACOS.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.acos(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.acos(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cACOSH(){}cACOSH.prototype=Object.create(cBaseFunction.prototype); cACOSH.prototype.constructor=cACOSH;cACOSH.prototype.name="ACOSH";cACOSH.prototype.argumentsMin=1;cACOSH.prototype.argumentsMax=1;cACOSH.prototype.argumentsType=[argType.number];cACOSH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.acosh(elem.getValue());this.array[r][c]= isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.acosh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cACOT(){}cACOT.prototype=Object.create(cBaseFunction.prototype);cACOT.prototype.constructor=cACOT;cACOT.prototype.name="ACOT";cACOT.prototype.argumentsMin=1;cACOT.prototype.argumentsMax=1;cACOT.prototype.isXLFN=true;cACOT.prototype.numFormat=AscCommonExcel.cNumFormatNone; cACOT.prototype.argumentsType=[argType.number];cACOT.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(cElementType.error===arg0.type)return arg0;else if(cElementType.array===arg0.type){arg0.foreach(function(elem,r,c){if(cElementType.number===elem.type){var a=Math.PI/2-Math.atan(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]= new cError(cErrorType.wrong_value_type)});return arg0}else{var a=Math.PI/2-Math.atan(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cACOTH(){}cACOTH.prototype=Object.create(cBaseFunction.prototype);cACOTH.prototype.constructor=cACOTH;cACOTH.prototype.name="ACOTH";cACOTH.prototype.argumentsMin=1;cACOTH.prototype.argumentsMax=1;cACOTH.prototype.isXLFN=true;cACOTH.prototype.numFormat=AscCommonExcel.cNumFormatNone;cACOTH.prototype.argumentsType=[argType.number]; cACOTH.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(cElementType.error===arg0.type)return arg0;else if(cElementType.array===arg0.type){arg0.foreach(function(elem,r,c){if(cElementType.number===elem.type){var a=Math.atanh(1/elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); return arg0}else{var a=Math.atanh(1/arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cAGGREGATE(){}cAGGREGATE.prototype=Object.create(cBaseFunction.prototype);cAGGREGATE.prototype.constructor=cAGGREGATE;cAGGREGATE.prototype.name="AGGREGATE";cAGGREGATE.prototype.argumentsMin=3;cAGGREGATE.prototype.argumentsMax=253;cAGGREGATE.prototype.isXLFN=true;cAGGREGATE.prototype.argumentsType=[argType.number,argType.number,[argType.reference]];cAGGREGATE.prototype.arrayIndexes= {2:1,3:1,4:1,5:1,6:1};cAGGREGATE.prototype.Calculate=function(arg){var oArguments=this._prepareArguments([arg[0],arg[1]],arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;var nFunc=argClone[0].getValue();var f=null;switch(nFunc){case AGGREGATE_FUNC_AVE:f=AscCommonExcel.cAVERAGE.prototype;break;case AGGREGATE_FUNC_CNT:f=AscCommonExcel.cCOUNT.prototype;break;case AGGREGATE_FUNC_CNTA:f= AscCommonExcel.cCOUNTA.prototype;break;case AGGREGATE_FUNC_MAX:f=AscCommonExcel.cMAX.prototype;break;case AGGREGATE_FUNC_MIN:f=AscCommonExcel.cMIN.prototype;break;case AGGREGATE_FUNC_PROD:f=AscCommonExcel.cPRODUCT.prototype;break;case AGGREGATE_FUNC_STD:f=AscCommonExcel.cSTDEV_S.prototype;break;case AGGREGATE_FUNC_STDP:f=AscCommonExcel.cSTDEV_P.prototype;break;case AGGREGATE_FUNC_SUM:f=AscCommonExcel.cSUM.prototype;break;case AGGREGATE_FUNC_VAR:f=AscCommonExcel.cVAR_S.prototype;break;case AGGREGATE_FUNC_VARP:f= AscCommonExcel.cVAR_P.prototype;break;case AGGREGATE_FUNC_MEDIAN:f=AscCommonExcel.cMEDIAN.prototype;break;case AGGREGATE_FUNC_MODSNGL:f=AscCommonExcel.cMODE_SNGL.prototype;break;case AGGREGATE_FUNC_LARGE:if(arg[3])f=AscCommonExcel.cLARGE.prototype;break;case AGGREGATE_FUNC_SMALL:if(arg[3])f=AscCommonExcel.cSMALL.prototype;break;case AGGREGATE_FUNC_PERCINC:if(arg[3])f=AscCommonExcel.cPERCENTILE_INC.prototype;break;case AGGREGATE_FUNC_QRTINC:if(arg[3])f=AscCommonExcel.cQUARTILE_INC.prototype;break; case AGGREGATE_FUNC_PERCEXC:if(arg[3])f=AscCommonExcel.cPERCENTILE_EXC.prototype;break;case AGGREGATE_FUNC_QRTEXC:if(arg[3])f=AscCommonExcel.cQUARTILE_EXC.prototype;break;default:return new cError(cErrorType.not_numeric)}if(null===f)return new cError(cErrorType.wrong_value_type);var nOption=argClone[1].getValue();var ignoreHiddenRows=false;var ignoreErrorsVal=false;var ignoreNestedStAg=false;switch(nOption){case 0:ignoreNestedStAg=true;break;case 1:ignoreNestedStAg=true;ignoreHiddenRows=true;break; case 2:ignoreNestedStAg=true;ignoreErrorsVal=true;break;case 3:ignoreNestedStAg=true;ignoreErrorsVal=true;ignoreHiddenRows=true;break;case 4:break;case 5:ignoreHiddenRows=true;break;case 6:ignoreErrorsVal=true;break;case 7:ignoreHiddenRows=true;ignoreErrorsVal=true;break;default:return new cError(cErrorType.not_numeric)}var res;if(f){var oldExcludeHiddenRows=f.excludeHiddenRows;var oldExcludeErrorsVal=f.excludeErrorsVal;var oldIgnoreNestedStAg=f.excludeNestedStAg;f.excludeHiddenRows=ignoreHiddenRows; f.excludeErrorsVal=ignoreErrorsVal;f.excludeNestedStAg=ignoreNestedStAg;var newArgs=[];var doNotCheckRef=nFunc>=14&&nFunc<=19;for(var i=2;i<arg.length;i++)if(doNotCheckRef||this.checkRef(arg[i]))newArgs.push(arg[i]);else return new cError(cErrorType.wrong_value_type);if(f.argumentsMax&&newArgs.length>f.argumentsMax)return new cError(cErrorType.wrong_value_type);res=f.Calculate(newArgs);f.excludeHiddenRows=oldExcludeHiddenRows;f.excludeErrorsVal=oldExcludeErrorsVal;f.excludeNestedStAg=oldIgnoreNestedStAg}return res}; function cARABIC(){}cARABIC.prototype=Object.create(cBaseFunction.prototype);cARABIC.prototype.constructor=cARABIC;cARABIC.prototype.name="ARABIC";cARABIC.prototype.argumentsMin=1;cARABIC.prototype.argumentsMax=1;cARABIC.prototype.isXLFN=true;cARABIC.prototype.argumentsType=[argType.text];cARABIC.prototype.Calculate=function(arg){var to_arabic=function(roman){roman=roman.toUpperCase();if(roman<1)return 0;else if(!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/i.test(roman))return NaN; var chars={"M":1E3,"CM":900,"D":500,"CD":400,"C":100,"XC":90,"L":50,"XL":40,"X":10,"IX":9,"V":5,"IV":4,"I":1};var arabic=0;roman.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,function(i){arabic+=chars[i]});return arabic};var arg0=arg[0];if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocString();if(cElementType.error===arg0.type)return arg0;if(cElementType.array===arg0.type){arg0.foreach(function(elem,r,c){var a=elem; if(cElementType.string===a.type){var res=to_arabic(a.getValue());this.array[r][c]=isNaN(res)?new cError(cErrorType.wrong_value_type):new cNumber(res)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}var res=to_arabic(arg0.getValue());return isNaN(res)?new cError(cErrorType.wrong_value_type):new cNumber(res)};function cASIN(){}cASIN.prototype=Object.create(cBaseFunction.prototype);cASIN.prototype.constructor=cASIN;cASIN.prototype.name="ASIN";cASIN.prototype.argumentsMin= 1;cASIN.prototype.argumentsMax=1;cASIN.prototype.argumentsType=[argType.number];cASIN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.asin(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); else{var a=Math.asin(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cASINH(){}cASINH.prototype=Object.create(cBaseFunction.prototype);cASINH.prototype.constructor=cASINH;cASINH.prototype.name="ASINH";cASINH.prototype.argumentsMin=1;cASINH.prototype.argumentsMax=1;cASINH.prototype.argumentsType=[argType.number];cASINH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.asinh(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.asinh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cATAN(){}cATAN.prototype=Object.create(cBaseFunction.prototype); cATAN.prototype.constructor=cATAN;cATAN.prototype.name="ATAN";cATAN.prototype.argumentsMin=1;cATAN.prototype.argumentsMax=1;cATAN.prototype.argumentsType=[argType.number];cATAN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.atan(elem.getValue());this.array[r][c]= isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else{var a=Math.atan(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cATAN2(){}cATAN2.prototype=Object.create(cBaseFunction.prototype);cATAN2.prototype.constructor=cATAN2;cATAN2.prototype.name="ATAN2";cATAN2.prototype.argumentsMin=2;cATAN2.prototype.argumentsMax=2;cATAN2.prototype.argumentsType=[argType.number,argType.number]; cATAN2.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem, b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=a.getValue()==0&&b.getValue()==0?new cError(cErrorType.division_by_zero):new cNumber(Math.atan2(b.getValue(),a.getValue()));else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem,b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=a.getValue()==0&&b.getValue()==0?new cError(cErrorType.division_by_zero): new cNumber(Math.atan2(b.getValue(),a.getValue()));else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0,b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=a.getValue()==0&&b.getValue()==0?new cError(cErrorType.division_by_zero):new cNumber(Math.atan2(b.getValue(),a.getValue()));else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}return arg0 instanceof cError? arg0:arg1 instanceof cError?arg1:arg1.getValue()==0&&arg0.getValue()==0?new cError(cErrorType.division_by_zero):new cNumber(Math.atan2(arg1.getValue(),arg0.getValue()))};function cATANH(){}cATANH.prototype=Object.create(cBaseFunction.prototype);cATANH.prototype.constructor=cATANH;cATANH.prototype.name="ATANH";cATANH.prototype.argumentsMin=1;cATANH.prototype.argumentsMax=1;cATANH.prototype.argumentsType=[argType.number];cATANH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea|| arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.atanh(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.atanh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cBASE(){} cBASE.prototype=Object.create(cBaseFunction.prototype);cBASE.prototype.constructor=cBASE;cBASE.prototype.name="BASE";cBASE.prototype.argumentsMin=2;cBASE.prototype.argumentsMax=3;cBASE.prototype.isXLFN=true;cBASE.prototype.argumentsType=[argType.number,argType.number,argType.number];cBASE.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();argClone[2]=argClone[2]? argClone[2].tocNumber():new cNumber(0);var argError;if(argError=this._checkErrorArg(argClone))return argError;function base_math(argArray){var number=parseInt(argArray[0]);var radix=parseInt(argArray[1]);var min_length=parseInt(argArray[2]);if(radix<2||radix>36||number<0||number>Math.pow(2,53)||min_length<0)return new cError(cErrorType.not_numeric);var str=number.toString(radix);str=str.toUpperCase();if(str.length<min_length){var prefix="";for(var i=0;i<min_length-str.length;i++)prefix+="0";str=prefix+ str}return new cString(str)}return this._findArrayInNumberArguments(oArguments,base_math)};function cCEILING(){}cCEILING.prototype=Object.create(cBaseFunction.prototype);cCEILING.prototype.constructor=cCEILING;cCEILING.prototype.name="CEILING";cCEILING.prototype.argumentsMin=2;cCEILING.prototype.argumentsMax=2;cCEILING.prototype.argumentsType=[argType.number,argType.number];cCEILING.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0= arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg[0].tocNumber();arg1=arg[1].tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;function ceilingHelper(number,significance){if(significance==0)return new cNumber(0);if(number>0&&significance<0)return new cError(cErrorType.not_numeric);else if(number/significance===Infinity)return new cError(cErrorType.not_numeric);else{var quotient=number/significance; if(quotient==0)return new cNumber(0);var quotientTr=Math.floor(quotient);var nolpiat=5*Math.sign(quotient)*Math.pow(10,Math.floor(Math.log10(Math.abs(quotient)))-cExcelSignificantDigits);if(Math.abs(quotient-quotientTr)>nolpiat)++quotientTr;return new cNumber(quotientTr*significance)}}if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem, r,c){var a=elem,b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=ceilingHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem,b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=ceilingHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0,b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=ceilingHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}return ceilingHelper(arg0.getValue(),arg1.getValue())};function cCEILING_MATH(){}cCEILING_MATH.prototype=Object.create(cBaseFunction.prototype);cCEILING_MATH.prototype.constructor=cCEILING_MATH;cCEILING_MATH.prototype.name="CEILING.MATH";cCEILING_MATH.prototype.argumentsMin= 1;cCEILING_MATH.prototype.argumentsMax=3;cCEILING_MATH.prototype.isXLFN=true;cCEILING_MATH.prototype.argumentsType=[argType.number,argType.number,argType.number];cCEILING_MATH.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();if(!argClone[1])argClone[1]=argClone[0]>0?new cNumber(1):new cNumber(-1);argClone[2]=argClone[2]?argClone[2].tocNumber():new cNumber(0);var argError;if(argError=this._checkErrorArg(argClone))return argError; function floor_math(argArray){var number=argArray[0];var significance=argArray[1];var mod=argArray[2];if(significance===0||number===0)return new cNumber(0);if(number*significance<0)significance=-significance;if(mod===0&&number<0)return new cNumber(Math.floor(number/significance)*significance);else return new cNumber(Math.ceil(number/significance)*significance)}return this._findArrayInNumberArguments(oArguments,floor_math)};function cCEILING_PRECISE(){}cCEILING_PRECISE.prototype=Object.create(cBaseFunction.prototype); cCEILING_PRECISE.prototype.constructor=cCEILING_PRECISE;cCEILING_PRECISE.prototype.name="CEILING.PRECISE";cCEILING_PRECISE.prototype.argumentsMin=1;cCEILING_PRECISE.prototype.argumentsMax=2;cCEILING_PRECISE.prototype.isXLFN=true;cCEILING_PRECISE.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1]?argClone[1].tocNumber():new cNumber(1);var argError;if(argError=this._checkErrorArg(argClone))return argError; function floorHelper(argArray){var number=argArray[0];var significance=argArray[1];if(significance===0||number===0)return new cNumber(0);var absSignificance=Math.abs(significance);var quotient=number/absSignificance;return new cNumber(Math.ceil(quotient)*absSignificance)}return this._findArrayInNumberArguments(oArguments,floorHelper)};function cCOMBIN(){}cCOMBIN.prototype=Object.create(cBaseFunction.prototype);cCOMBIN.prototype.constructor=cCOMBIN;cCOMBIN.prototype.name="COMBIN";cCOMBIN.prototype.argumentsMin= 2;cCOMBIN.prototype.argumentsMax=2;cCOMBIN.prototype.argumentsType=[argType.number,argType.number];cCOMBIN.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!= arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem,b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=new cNumber(Math.binomCoeff(a.getValue(),b.getValue()));else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem,b=arg1;if(a instanceof cNumber&&b instanceof cNumber){if(a.getValue()<= 0||b.getValue()<=0)this.array[r][c]=new cError(cErrorType.not_numeric);this.array[r][c]=new cNumber(Math.binomCoeff(a.getValue(),b.getValue()))}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0,b=elem;if(a instanceof cNumber&&b instanceof cNumber){if(a.getValue()<=0||b.getValue()<=0||a.getValue()<b.getValue())this.array[r][c]=new cError(cErrorType.not_numeric);this.array[r][c]=new cNumber(Math.binomCoeff(a.getValue(), b.getValue()))}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}if(arg0.getValue()<=0||arg1.getValue()<=0||arg0.getValue()<arg1.getValue())return new cError(cErrorType.not_numeric);return new cNumber(Math.binomCoeff(arg0.getValue(),arg1.getValue()))};function cCOMBINA(){}cCOMBINA.prototype=Object.create(cBaseFunction.prototype);cCOMBINA.prototype.constructor=cCOMBINA;cCOMBINA.prototype.name="COMBINA";cCOMBINA.prototype.argumentsMin=2;cCOMBINA.prototype.argumentsMax=2;cCOMBINA.prototype.isXLFN= true;cCOMBINA.prototype.argumentsType=[argType.number,argType.number];cCOMBINA.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function combinaCalculate(argArray){var a=argArray[0];var b=argArray[1];if(a<0||b<0||a<b)return new cError(cErrorType.not_numeric);a=parseInt(a);b=parseInt(b);return new cNumber(Math.binomCoeff(a+ b-1,b))}return this._findArrayInNumberArguments(oArguments,combinaCalculate)};function cCOS(){}cCOS.prototype=Object.create(cBaseFunction.prototype);cCOS.prototype.constructor=cCOS;cCOS.prototype.name="COS";cCOS.prototype.argumentsMin=1;cCOS.prototype.argumentsMax=1;cCOS.prototype.argumentsType=[argType.number];cCOS.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0; else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.cos(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.cos(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cCOSH(){}cCOSH.prototype=Object.create(cBaseFunction.prototype);cCOSH.prototype.constructor=cCOSH;cCOSH.prototype.name= "COSH";cCOSH.prototype.argumentsMin=1;cCOSH.prototype.argumentsMax=1;cCOSH.prototype.argumentsType=[argType.number];cCOSH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.cosh(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]= new cError(cErrorType.wrong_value_type)});else{var a=Math.cosh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cCOT(){}cCOT.prototype=Object.create(cBaseFunction.prototype);cCOT.prototype.constructor=cCOT;cCOT.prototype.name="COT";cCOT.prototype.argumentsMin=1;cCOT.prototype.argumentsMax=1;cCOT.prototype.isXLFN=true;cCOT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOT.prototype.argumentsType=[argType.number];cCOT.prototype.Calculate= function(arg){var arg0=arg[0];var maxVal=Math.pow(2,27);if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(cElementType.error===arg0.type)return arg0;else if(cElementType.array===arg0.type){arg0.foreach(function(elem,r,c){if(cElementType.number===elem.type)if(0===elem.getValue())this.array[r][c]=new cError(cErrorType.division_by_zero);else if(Math.abs(elem.getValue())>=maxVal)this.array[r][c]=new cError(cErrorType.not_numeric); else{var a=1/Math.tan(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else{if(0===arg0.getValue())return new cError(cErrorType.division_by_zero);else if(Math.abs(arg0.getValue())>=maxVal)return new cError(cErrorType.not_numeric);var a=1/Math.tan(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cCOTH(){}cCOTH.prototype=Object.create(cBaseFunction.prototype); cCOTH.prototype.constructor=cCOTH;cCOTH.prototype.name="COTH";cCOTH.prototype.argumentsMin=1;cCOTH.prototype.argumentsMax=1;cCOTH.prototype.isXLFN=true;cCOTH.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCOTH.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(cElementType.error===arg0.type)return arg0;else if(cElementType.array===arg0.type){arg0.foreach(function(elem, r,c){if(cElementType.number===elem.type)if(0===elem.getValue())this.array[r][c]=new cError(cErrorType.division_by_zero);else{var a=1/Math.tanh(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else{if(0===arg0.getValue())return new cError(cErrorType.division_by_zero);var a=1/Math.tanh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cCSC(){} cCSC.prototype=Object.create(cBaseFunction.prototype);cCSC.prototype.constructor=cCSC;cCSC.prototype.name="CSC";cCSC.prototype.argumentsMin=1;cCSC.prototype.argumentsMax=1;cCSC.prototype.isXLFN=true;cCSC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cCSC.prototype.argumentsType=[argType.number];cCSC.prototype.Calculate=function(arg){var arg0=arg[0];var maxVal=Math.pow(2,27);if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber(); if(cElementType.error===arg0.type)return arg0;else if(cElementType.array===arg0.type){arg0.foreach(function(elem,r,c){if(cElementType.number===elem.type)if(0===elem.getValue())this.array[r][c]=new cError(cErrorType.division_by_zero);else if(Math.abs(elem.getValue())>=maxVal)this.array[r][c]=new cError(cErrorType.not_numeric);else{var a=1/Math.sin(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); return arg0}else{if(0===arg0.getValue())return new cError(cErrorType.division_by_zero);else if(Math.abs(arg0.getValue())>=maxVal)return new cError(cErrorType.not_numeric);var a=1/Math.sin(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cCSCH(){}cCSCH.prototype=Object.create(cBaseFunction.prototype);cCSCH.prototype.constructor=cCSCH;cCSCH.prototype.name="CSCH";cCSCH.prototype.argumentsMin=1;cCSCH.prototype.argumentsMax=1;cCSCH.prototype.isXLFN=true;cCSCH.prototype.numFormat= AscCommonExcel.cNumFormatNone;cCSCH.prototype.argumentsType=[argType.number];cCSCH.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(cElementType.error===arg0.type)return arg0;else if(cElementType.array===arg0.type){arg0.foreach(function(elem,r,c){if(cElementType.number===elem.type)if(0===elem.getValue())this.array[r][c]=new cError(cErrorType.division_by_zero);else{var a= 1/Math.sinh(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else{if(0===arg0.getValue())return new cError(cErrorType.division_by_zero);var a=1/Math.sinh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cDECIMAL(){}cDECIMAL.prototype=Object.create(cBaseFunction.prototype);cDECIMAL.prototype.constructor=cDECIMAL;cDECIMAL.prototype.name= "DECIMAL";cDECIMAL.prototype.argumentsMin=2;cDECIMAL.prototype.argumentsMax=2;cDECIMAL.prototype.isXLFN=true;cDECIMAL.prototype.argumentsType=[argType.text,argType.number];cDECIMAL.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocString();argClone[1]=argClone[1].tocNumber();var argError;if(argError=this._checkErrorArg(argClone))return argError;function decimal_calculate(argArray){var a=argArray[0];var b= argArray[1];b=parseInt(b);if(b<2||b>36)return new cError(cErrorType.not_numeric);var fVal=0;var startIndex=0;while(a[startIndex]===" ")startIndex++;if(b===16)if(a[startIndex]==="x"||a[startIndex]==="X")startIndex++;else if(a[startIndex]==="0"&&(a[startIndex+1]==="x"||a[startIndex+1]==="X"))startIndex+=2;a=a.toLowerCase();var startPos="a".charCodeAt(0);for(var i=startIndex;i<a.length;i++){var n;if("0"<=a[i]&&a[i]<="9")n=a[i]-"0";else if("a"<=a[i]&&a[i]<="z"){var currentPos=a[i].charCodeAt(0);n=10+ parseInt(currentPos-startPos)}else n=b;if(b<=n)if(i+1===a.length&&(b==2&&(a[i]=="b"||a[i]=="B")||b==16&&(a[i]=="h"||a[i]=="H")));else return new cError(cErrorType.not_numeric);else fVal=fVal*b+n}return isNaN(fVal)?new cError(cErrorType.not_numeric):new cNumber(fVal)}return this._findArrayInNumberArguments(oArguments,decimal_calculate,true)};function cDEGREES(){}cDEGREES.prototype=Object.create(cBaseFunction.prototype);cDEGREES.prototype.constructor=cDEGREES;cDEGREES.prototype.name="DEGREES";cDEGREES.prototype.argumentsMin= 1;cDEGREES.prototype.argumentsMax=1;cDEGREES.prototype.argumentsType=[argType.number];cDEGREES.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=elem.getValue();this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a*180/Math.PI)}else this.array[r][c]= new cError(cErrorType.wrong_value_type)});else{var a=arg0.getValue();return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a*180/Math.PI)}return arg0};function cECMA_CEILING(){}cECMA_CEILING.prototype=Object.create(cCEILING.prototype);cECMA_CEILING.prototype.constructor=cECMA_CEILING;cECMA_CEILING.prototype.name="ECMA.CEILING";function cEVEN(){}cEVEN.prototype=Object.create(cBaseFunction.prototype);cEVEN.prototype.constructor=cEVEN;cEVEN.prototype.name="EVEN";cEVEN.prototype.argumentsMin= 1;cEVEN.prototype.argumentsMax=1;cEVEN.prototype.argumentsType=[argType.number];cEVEN.prototype.Calculate=function(arg){function evenHelper(arg){var arg0=arg.getValue();if(arg0>=0){arg0=Math.ceil(arg0);if((arg0&1)==0)return new cNumber(arg0);else return new cNumber(arg0+1)}else{arg0=Math.floor(arg0);if((arg0&1)==0)return new cNumber(arg0);else return new cNumber(arg0-1)}}var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)this.array[r][c]=evenHelper(elem);else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cNumber)return evenHelper(arg0);return new cError(cErrorType.wrong_value_type)};function cEXP(){}cEXP.prototype=Object.create(cBaseFunction.prototype);cEXP.prototype.constructor=cEXP;cEXP.prototype.name="EXP";cEXP.prototype.argumentsMin=1;cEXP.prototype.argumentsMax= 1;cEXP.prototype.argumentsType=[argType.number];cEXP.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.exp(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); if(!(arg0 instanceof cNumber))return new cError(cErrorType.not_numeric);else{var a=Math.exp(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cFACT(){}cFACT.prototype=Object.create(cBaseFunction.prototype);cFACT.prototype.constructor=cFACT;cFACT.prototype.name="FACT";cFACT.prototype.argumentsMin=1;cFACT.prototype.argumentsMax=1;cFACT.prototype.argumentsType=[argType.number];cFACT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea|| arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)if(elem.getValue()<0)this.array[r][c]=new cError(cErrorType.not_numeric);else{var a=Math.fact(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{if(arg0.getValue()<0)return new cError(cErrorType.not_numeric); var a=Math.fact(arg0.getValue());return isNaN(a)||a==Infinity?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cFACTDOUBLE(){}cFACTDOUBLE.prototype=Object.create(cBaseFunction.prototype);cFACTDOUBLE.prototype.constructor=cFACTDOUBLE;cFACTDOUBLE.prototype.name="FACTDOUBLE";cFACTDOUBLE.prototype.argumentsMin=1;cFACTDOUBLE.prototype.argumentsMax=1;cFACTDOUBLE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cFACTDOUBLE.prototype.argumentsType=[argType.any]; cFACTDOUBLE.prototype.Calculate=function(arg){function factDouble(n){if(n==0)return 0;else if(n<0)return Number.NaN;else if(n>300)return Number.Infinity;n=Math.floor(n);var res=n,_n=n,ost=-(_n&1);n-=2;while(n!=ost){res*=n;n-=2}return res}var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)if(elem.getValue()< 0)this.array[r][c]=new cError(cErrorType.not_numeric);else{var a=factDouble(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{if(arg0.getValue()<0)return new cError(cErrorType.not_numeric);var a=factDouble(arg0.getValue());return isNaN(a)||a==Infinity?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cFLOOR(){}cFLOOR.prototype=Object.create(cBaseFunction.prototype); cFLOOR.prototype.constructor=cFLOOR;cFLOOR.prototype.name="FLOOR";cFLOOR.prototype.argumentsMin=2;cFLOOR.prototype.argumentsMax=2;cFLOOR.prototype.argumentsType=[argType.number,argType.number,argType.number];cFLOOR.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg[0].tocNumber();arg1=arg[1].tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;function floorHelper(number,significance){if(significance==0)return new cNumber(0);if(number>0&&significance<0||number<0&&significance>0)return new cError(cErrorType.not_numeric);else if(number/significance===Infinity)return new cError(cErrorType.not_numeric);else{var quotient=number/significance;if(quotient==0)return new cNumber(0);var nolpiat=5*(quotient<0?-1:quotient>0?1:0)*Math.pow(10,Math.floor(Math.log10(Math.abs(quotient)))-cExcelSignificantDigits); return new cNumber(Math.floor(quotient+nolpiat)*significance)}}if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=floorHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem;var b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=floorHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0;var b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=floorHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}if(arg0 instanceof cString||arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);return floorHelper(arg0.getValue(),arg1.getValue())};function cFLOOR_PRECISE(){}cFLOOR_PRECISE.prototype=Object.create(cBaseFunction.prototype);cFLOOR_PRECISE.prototype.constructor=cFLOOR_PRECISE;cFLOOR_PRECISE.prototype.name="FLOOR.PRECISE";cFLOOR_PRECISE.prototype.argumentsMin=1;cFLOOR_PRECISE.prototype.argumentsMax=2;cFLOOR_PRECISE.prototype.isXLFN=true;cFLOOR_PRECISE.prototype.Calculate=function(arg){var oArguments= this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1]?argClone[1].tocNumber():new cNumber(1);var argError;if(argError=this._checkErrorArg(argClone))return argError;function floorHelper(argArray){var number=argArray[0];var significance=argArray[1];if(significance===0||number===0)return new cNumber(0);var absSignificance=Math.abs(significance);var quotient=number/absSignificance;return new cNumber(Math.floor(quotient)*absSignificance)} return this._findArrayInNumberArguments(oArguments,floorHelper)};function cFLOOR_MATH(){}cFLOOR_MATH.prototype=Object.create(cBaseFunction.prototype);cFLOOR_MATH.prototype.constructor=cFLOOR_MATH;cFLOOR_MATH.prototype.name="FLOOR.MATH";cFLOOR_MATH.prototype.argumentsMin=1;cFLOOR_MATH.prototype.argumentsMax=3;cFLOOR_MATH.prototype.isXLFN=true;cFLOOR_MATH.prototype.argumentsType=[argType.number,argType.number,argType.number];cFLOOR_MATH.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg, arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();if(!argClone[1])argClone[1]=argClone[0]>0?new cNumber(1):new cNumber(-1);argClone[2]=argClone[2]?argClone[2].tocNumber():new cNumber(0);var argError;if(argError=this._checkErrorArg(argClone))return argError;function floor_math(argArray){var number=argArray[0];var significance=argArray[1];var mod=argArray[2];if(significance===0||number===0)return new cNumber(0);if(number*significance<0)significance=-significance;if(mod=== 0&&number<0)return new cNumber(Math.ceil(number/significance)*significance);else return new cNumber(Math.floor(number/significance)*significance)}return this._findArrayInNumberArguments(oArguments,floor_math)};function cGCD(){}cGCD.prototype=Object.create(cBaseFunction.prototype);cGCD.prototype.constructor=cGCD;cGCD.prototype.name="GCD";cGCD.prototype.argumentsMin=1;cGCD.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cGCD.prototype.argumentsType=[[argType.any]];cGCD.prototype.Calculate= function(arg){var _gcd=0,argArr;function gcd(a,b){var _a=parseInt(a),_b=parseInt(b);while(_b!=0)_b=_a%(_a=_b);return _a}for(var i=0;i<arg.length;i++){var argI=arg[i];if(argI instanceof cArea||argI instanceof cArea3D){argArr=argI.getValue();for(var j=0;j<argArr.length;j++){if(argArr[j]instanceof cError)return argArr[j];if(argArr[j]instanceof cString)continue;if(argArr[j]instanceof cBool)argArr[j]=argArr[j].tocNumber();if(argArr[j].getValue()<0)return new cError(cErrorType.not_numeric);_gcd=gcd(_gcd, argArr[j].getValue())}}else if(argI instanceof cArray){argArr=argI.tocNumber();if(argArr.foreach(function(arrElem){if(arrElem instanceof cError){_gcd=arrElem;return true}if(arrElem instanceof cBool)arrElem=arrElem.tocNumber();if(arrElem instanceof cString)return;if(arrElem.getValue()<0){_gcd=new cError(cErrorType.not_numeric);return true}_gcd=gcd(_gcd,arrElem.getValue())}))return _gcd}else{argI=argI.tocNumber();if(argI.getValue()<0)return new cError(cErrorType.not_numeric);if(argI instanceof cError)return argI; _gcd=gcd(_gcd,argI.getValue())}}return new cNumber(_gcd)};function cINT(){}cINT.prototype=Object.create(cBaseFunction.prototype);cINT.prototype.constructor=cINT;cINT.prototype.name="INT";cINT.prototype.argumentsMin=1;cINT.prototype.argumentsMax=1;cINT.prototype.inheritFormat=true;cINT.prototype.argumentsType=[argType.number];cINT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)this.array[r][c]=new cNumber(Math.floor(elem.getValue()));else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else return new cNumber(Math.floor(arg0.getValue()));return new cNumber(Math.floor(arg0.getValue()))};function cISO_CEILING(){}cISO_CEILING.prototype=Object.create(cBaseFunction.prototype);cISO_CEILING.prototype.constructor= cISO_CEILING;cISO_CEILING.prototype.name="ISO.CEILING";cISO_CEILING.prototype.argumentsMin=1;cISO_CEILING.prototype.argumentsMax=2;cISO_CEILING.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1]);var argClone=oArguments.args;argClone[0]=argClone[0].tocNumber();argClone[1]=argClone[1]?argClone[1].tocNumber():new cNumber(1);var argError;if(argError=this._checkErrorArg(argClone))return argError;function floorHelper(argArray){var number=argArray[0];var significance= argArray[1];if(significance===0||number===0)return new cNumber(0);var absSignificance=Math.abs(significance);var quotient=number/absSignificance;return new cNumber(Math.ceil(quotient)*absSignificance)}return this._findArrayInNumberArguments(oArguments,floorHelper)};function cLCM(){}cLCM.prototype=Object.create(cBaseFunction.prototype);cLCM.prototype.constructor=cLCM;cLCM.prototype.name="LCM";cLCM.prototype.argumentsMin=1;cLCM.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cLCM.prototype.argumentsType= [[argType.any]];cLCM.prototype.Calculate=function(arg){var _lcm=1,argArr;function gcd(a,b){var _a=parseInt(a),_b=parseInt(b);while(_b!=0)_b=_a%(_a=_b);return _a}function lcm(a,b){return Math.abs(parseInt(a)*parseInt(b))/gcd(a,b)}for(var i=0;i<arg.length;i++){var argI=arg[i];if(argI instanceof cArea||argI instanceof cArea3D){argArr=argI.getValue();for(var j=0;j<argArr.length;j++){if(argArr[j]instanceof cError)return argArr[j];if(argArr[j]instanceof cString)continue;if(argArr[j]instanceof cBool)argArr[j]= argArr[j].tocNumber();if(argArr[j].getValue()<=0)return new cError(cErrorType.not_numeric);_lcm=lcm(_lcm,argArr[j].getValue())}}else if(argI instanceof cArray){argArr=argI.tocNumber();if(argArr.foreach(function(arrElem){if(arrElem instanceof cError){_lcm=arrElem;return true}if(arrElem instanceof cBool)arrElem=arrElem.tocNumber();if(arrElem instanceof cString)return;if(arrElem.getValue()<=0){_lcm=new cError(cErrorType.not_numeric);return true}_lcm=lcm(_lcm,arrElem.getValue())}))return _lcm}else{argI= argI.tocNumber();if(argI.getValue()<=0)return new cError(cErrorType.not_numeric);if(argI instanceof cError)return argI;_lcm=lcm(_lcm,argI.getValue())}}return new cNumber(_lcm)};function cLN(){}cLN.prototype=Object.create(cBaseFunction.prototype);cLN.prototype.constructor=cLN;cLN.prototype.name="LN";cLN.prototype.argumentsMin=1;cLN.prototype.argumentsMax=1;cLN.prototype.argumentsType=[argType.number];cLN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0= arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)if(elem.getValue()<=0)this.array[r][c]=new cError(cErrorType.not_numeric);else this.array[r][c]=new cNumber(Math.log(elem.getValue()));else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else if(arg0.getValue()<=0)return new cError(cErrorType.not_numeric); else return new cNumber(Math.log(arg0.getValue()))};function cLOG(){}cLOG.prototype=Object.create(cBaseFunction.prototype);cLOG.prototype.constructor=cLOG;cLOG.prototype.name="LOG";cLOG.prototype.argumentsMin=1;cLOG.prototype.argumentsMax=2;cLOG.prototype.argumentsType=[argType.number,argType.number];cLOG.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]?arg[1]:new cNumber(10);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber){if(1===b.getValue())return new cError(cErrorType.division_by_zero); this.array[r][c]=new cNumber(Math.log(a.getValue())/Math.log(b.getValue()))}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem,b=arg1?arg1:new cNumber(10);if(a instanceof cNumber&&b instanceof cNumber){if(a.getValue()<=0||a.getValue()<=0)this.array[r][c]=new cError(cErrorType.not_numeric);if(1===b.getValue())return new cError(cErrorType.division_by_zero);this.array[r][c]=new cNumber(Math.log(a.getValue())/ Math.log(b.getValue()))}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0,b=elem;if(a instanceof cNumber&&b instanceof cNumber){if(a.getValue()<=0||a.getValue()<=0)this.array[r][c]=new cError(cErrorType.not_numeric);if(1===b.getValue())return new cError(cErrorType.division_by_zero);this.array[r][c]=new cNumber(Math.log(a.getValue())/Math.log(b.getValue()))}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); return arg1}if(!(arg0 instanceof cNumber)||arg1&&!(arg0 instanceof cNumber))return new cError(cErrorType.wrong_value_type);if(arg0.getValue()<=0||arg1&&arg1.getValue()<=0)return new cError(cErrorType.not_numeric);if(1===arg1.getValue())return new cError(cErrorType.division_by_zero);return new cNumber(Math.log(arg0.getValue())/Math.log(arg1.getValue()))};function cLOG10(){}cLOG10.prototype=Object.create(cBaseFunction.prototype);cLOG10.prototype.constructor=cLOG10;cLOG10.prototype.name="LOG10";cLOG10.prototype.argumentsMin= 1;cLOG10.prototype.argumentsMax=1;cLOG10.prototype.argumentsType=[argType.number];cLOG10.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)if(elem.getValue()<=0)this.array[r][c]=new cError(cErrorType.not_numeric); else this.array[r][c]=new cNumber(Math.log10(elem.getValue()));else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else if(arg0.getValue()<=0)return new cError(cErrorType.not_numeric);else return new cNumber(Math.log10(arg0.getValue()))};function cMDETERM(){}cMDETERM.prototype=Object.create(cBaseFunction.prototype);cMDETERM.prototype.constructor=cMDETERM;cMDETERM.prototype.name="MDETERM";cMDETERM.prototype.argumentsMin=1;cMDETERM.prototype.argumentsMax=1;cMDETERM.prototype.numFormat=AscCommonExcel.cNumFormatNone; cMDETERM.prototype.arrayIndexes={0:1};cMDETERM.prototype.argumentsType=[argType.array];cMDETERM.prototype.Calculate=function(arg){function determ(A){var N=A.length,denom=1,exchanges=0,i,j;for(i=0;i<N;i++)for(j=0;j<A[i].length;j++)if(A[i][j]instanceof cEmpty||A[i][j]instanceof cString)return NaN;for(i=0;i<N-1;i++){var maxN=i,maxValue=Math.abs(A[i][i]instanceof cEmpty?NaN:A[i][i]);for(j=i+1;j<N;j++){var value=Math.abs(A[j][i]instanceof cEmpty?NaN:A[j][i]);if(value>maxValue){maxN=j;maxValue=value}}if(maxN> i){var temp=A[i];A[i]=A[maxN];A[maxN]=temp;exchanges++}else if(maxValue==0)return maxValue;var value1=A[i][i]instanceof cEmpty?NaN:A[i][i];for(j=i+1;j<N;j++){var value2=A[j][i]instanceof cEmpty?NaN:A[j][i];A[j][i]=0;for(var k=i+1;k<N;k++)A[j][k]=(A[j][k]*value1-A[i][k]*value2)/denom}denom=value1}if(exchanges%2)return-A[N-1][N-1];else return A[N-1][N-1]}var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArray)arg0=arg0.getMatrix();else return new cError(cErrorType.not_available);if(arg0[0].length!= arg0.length)return new cError(cErrorType.wrong_value_type);arg0=determ(arg0);if(!isNaN(arg0))return new cNumber(arg0);else return new cError(cErrorType.not_available)};function cMINVERSE(){}cMINVERSE.prototype=Object.create(cBaseFunction.prototype);cMINVERSE.prototype.constructor=cMINVERSE;cMINVERSE.prototype.name="MINVERSE";cMINVERSE.prototype.argumentsMin=1;cMINVERSE.prototype.argumentsMax=1;cMINVERSE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cMINVERSE.prototype.arrayIndexes={0:1};cMINVERSE.prototype.argumentsType= [argType.array];cMINVERSE.prototype.Calculate=function(arg){function Determinant(A){var N=A.length,B=[],denom=1,exchanges=0,i,j;for(i=0;i<N;++i){B[i]=[];for(j=0;j<N;++j)B[i][j]=A[i][j]}for(i=0;i<N-1;++i){var maxN=i,maxValue=Math.abs(B[i][i]);for(j=i+1;j<N;++j){var value=Math.abs(B[j][i]);if(value>maxValue){maxN=j;maxValue=value}}if(maxN>i){var temp=B[i];B[i]=B[maxN];B[maxN]=temp;++exchanges}else if(maxValue==0)return maxValue;var value1=B[i][i];for(j=i+1;j<N;++j){var value2=B[j][i];B[j][i]=0;for(var k= i+1;k<N;++k)B[j][k]=(B[j][k]*value1-B[i][k]*value2)/denom}denom=value1}if(exchanges%2)return-B[N-1][N-1];else return B[N-1][N-1]}function MatrixCofactor(i,j,__A){var N=__A.length,sign=(i+j)%2==0?1:-1;for(var m=0;m<N;m++){for(var n=j+1;n<N;n++)__A[m][n-1]=__A[m][n];__A[m].length--}for(var k=i+1;k<N;k++)__A[k-1]=__A[k];__A.length--;return sign*Determinant(__A)}function AdjugateMatrix(_A){var N=_A.length,B=[],adjA=[];for(var i=0;i<N;i++){adjA[i]=[];for(var j=0;j<N;j++){for(var m=0;m<N;m++){B[m]=[];for(var n= 0;n<N;n++)B[m][n]=_A[m][n]}adjA[i][j]=MatrixCofactor(j,i,B)}}return adjA}function InverseMatrix(A){var i,j;for(i=0;i<A.length;i++)for(j=0;j<A[i].length;j++)if(A[i][j]instanceof cEmpty||A[i][j]instanceof cString)return new cError(cErrorType.not_available);else A[i][j]=A[i][j].getValue();var detA=Determinant(A),invertA,res;if(detA!=0){invertA=AdjugateMatrix(A);var datA=1/detA;for(i=0;i<invertA.length;i++)for(j=0;j<invertA[i].length;j++)invertA[i][j]=new cNumber(datA*invertA[i][j]);res=new cArray;res.fillFromArray(invertA)}else res= new cError(cErrorType.not_available);return res}var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArray)arg0=arg0.getMatrix();else return new cError(cErrorType.not_available);if(arg0[0].length!=arg0.length)return new cError(cErrorType.wrong_value_type);return InverseMatrix(arg0)};function cMMULT(){}cMMULT.prototype=Object.create(cBaseFunction.prototype);cMMULT.prototype.constructor=cMMULT;cMMULT.prototype.name="MMULT";cMMULT.prototype.argumentsMin=2;cMMULT.prototype.argumentsMax=2;cMMULT.prototype.numFormat= AscCommonExcel.cNumFormatNone;cMMULT.prototype.arrayIndexes={0:1,1:1};cMMULT.prototype.argumentsType=[argType.array,argType.array];cMMULT.prototype.Calculate=function(arg){function mult(A,B){var i,j;for(i=0;i<A.length;i++)for(j=0;j<A[i].length;j++)if(A[i][j]instanceof cEmpty||A[i][j]instanceof cString)return new cError(cErrorType.not_available);for(i=0;i<B.length;i++)for(j=0;j<B[i].length;j++)if(B[i][j]instanceof cEmpty||B[i][j]instanceof cString)return new cError(cErrorType.not_available);if(!(B[0]&& A.length===B[0].length||A[0]&&B.length===A[0].length))return new cError(cErrorType.wrong_value_type);var C=new Array(A.length);for(i=0;i<A.length;i++){C[i]=new Array(B[0].length);for(j=0;j<B[0].length;j++){C[i][j]=0;for(var k=0;k<B.length;k++)C[i][j]+=A[i][k].getValue()*B[k][j].getValue();C[i][j]=new cNumber(C[i][j])}}var res=new cArray;res.fillFromArray(C);return res}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArray||arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getMatrix(); else if(arg1 instanceof cArea3D)arg0=arg0.getMatrix()[0];else return new cError(cErrorType.not_available);if(arg1 instanceof cArea||arg1 instanceof cArray||arg1 instanceof cRef||arg1 instanceof cRef3D)arg1=arg1.getMatrix();else if(arg1 instanceof cArea3D)arg1=arg1.getMatrix()[0];else return new cError(cErrorType.not_available);return mult(arg0,arg1)};function cMOD(){}cMOD.prototype=Object.create(cBaseFunction.prototype);cMOD.prototype.constructor=cMOD;cMOD.prototype.name="MOD";cMOD.prototype.argumentsMin= 2;cMOD.prototype.argumentsMax=2;cMOD.prototype.argumentsType=[argType.number,argType.number];cMOD.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;var calc=function(n,d){if(d===0)return new cError(cErrorType.division_by_zero); return new cNumber(n-d*Math.floor(n/d))};if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=calc(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem, r,c){var a=elem,b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=calc(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0,b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=calc(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}if(!(arg0 instanceof cNumber)||arg1&&!(arg0 instanceof cNumber))return new cError(cErrorType.wrong_value_type);if(arg1.getValue()==0)return new cError(cErrorType.division_by_zero);return calc(arg0.getValue(),arg1.getValue())};function cMROUND(){}cMROUND.prototype=Object.create(cBaseFunction.prototype);cMROUND.prototype.constructor=cMROUND;cMROUND.prototype.name="MROUND";cMROUND.prototype.argumentsMin=2;cMROUND.prototype.argumentsMax=2;cMROUND.prototype.argumentsType=[argType.any,argType.any];cMROUND.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cMROUND.prototype.Calculate=function(arg){var multiple;function mroundHelper(num){var multiplier=Math.pow(10,Math.floor(Math.log10(Math.abs(num)))-cExcelSignificantDigits+1);var nolpiat=.5*(num>0?1:num<0?-1:0)*multiplier;var y=(num+nolpiat)/multiplier;y=y/Math.abs(y)*Math.floor(Math.abs(y));var x=y*multiplier/multiple;nolpiat=5*(x/Math.abs(x))*Math.pow(10,Math.floor(Math.log10(Math.abs(x)))-cExcelSignificantDigits);x=x+nolpiat;x=x|x;return x*multiple}function f(a,b,r,c){if(a instanceof cNumber&&b instanceof cNumber)if(a.getValue()==0)this.array[r][c]=new cNumber(0);else if(a.getValue()<0&&b.getValue()>0||arg0.getValue()>0&&b.getValue()<0)this.array[r][c]=new cError(cErrorType.not_numeric);else{multiple=b.getValue();this.array[r][c]=new cNumber(mroundHelper(a.getValue()+b.getValue()/2))}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1= arg1.cross(arguments[1]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cString||arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){f.call(this,elem,arg1.getElementRowCol(r, c),r,c)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){f.call(this,elem,arg1,r,c)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){f.call(this,arg0,elem,r,c)});return arg1}if(arg1.getValue()==0)return new cNumber(0);if(arg0.getValue()<0&&arg1.getValue()>0||arg0.getValue()>0&&arg1.getValue()<0)return new cError(cErrorType.not_numeric);multiple=arg1.getValue();return new cNumber(mroundHelper(arg0.getValue()+arg1.getValue()/2))};function cMULTINOMIAL(){} cMULTINOMIAL.prototype=Object.create(cBaseFunction.prototype);cMULTINOMIAL.prototype.constructor=cMULTINOMIAL;cMULTINOMIAL.prototype.name="MULTINOMIAL";cMULTINOMIAL.prototype.argumentsMin=1;cMULTINOMIAL.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cMULTINOMIAL.prototype.argumentsType=[[argType.any]];cMULTINOMIAL.prototype.Calculate=function(arg){var arg0=new cNumber(0),fact=1;for(var i=0;i<arg.length;i++){if(arg[i]instanceof cArea||arg[i]instanceof cArea3D){var _arrVal=arg[i].getValue(); for(var j=0;j<_arrVal.length;j++)if(_arrVal[j]instanceof cNumber){if(_arrVal[j].getValue()<0)return new cError(cErrorType.not_numeric);arg0=_func[arg0.type][_arrVal[j].type](arg0,_arrVal[j],"+");fact*=Math.fact(_arrVal[j].getValue())}else if(_arrVal[j]instanceof cError)return _arrVal[j];else return new cError(cErrorType.wrong_value_type)}else if(arg[i]instanceof cArray){if(arg[i].foreach(function(arrElem){if(arrElem instanceof cNumber){if(arrElem.getValue()<0)return true;arg0=_func[arg0.type][arrElem.type](arg0, arrElem,"+");fact*=Math.fact(arrElem.getValue())}else return true}))return new cError(cErrorType.wrong_value_type)}else if(arg[i]instanceof cRef||arg[i]instanceof cRef3D){var _arg=arg[i].getValue();if(_arg.getValue()<0)return new cError(cErrorType.not_numeric);if(_arg instanceof cNumber){if(_arg.getValue()<0)return new cError(cError.not_numeric);arg0=_func[arg0.type][_arg.type](arg0,_arg,"+");fact*=Math.fact(_arg.getValue())}else if(_arg instanceof cError)return _arg;else return new cError(cErrorType.wrong_value_type)}else if(arg[i]instanceof cNumber){if(arg[i].getValue()<0)return new cError(cErrorType.not_numeric);arg0=_func[arg0.type][arg[i].type](arg0,arg[i],"+");fact*=Math.fact(arg[i].getValue())}else if(arg[i]instanceof cError)return arg[i];else return new cError(cErrorType.wrong_value_type);if(arg0 instanceof cError)return new cError(cErrorType.wrong_value_type)}if(arg0.getValue()>170)return new cError(cErrorType.wrong_value_type);return new cNumber(Math.fact(arg0.getValue())/fact)};function cMUNIT(){}cMUNIT.prototype=Object.create(cBaseFunction.prototype); cMUNIT.prototype.constructor=cMUNIT;cMUNIT.prototype.name="MUNIT";cMUNIT.prototype.argumentsMin=1;cMUNIT.prototype.argumentsMax=1;cMUNIT.prototype.isXLFN=true;cMUNIT.prototype.argumentsType=[argType.number];cMUNIT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cMUNIT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cMUNIT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)this.array[r][c]=parseInt(elem.getValue())>0?new cNumber(1):new cError(cErrorType.wrong_value_type);else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else{var num=parseInt(arg0);if(num<=0)return new cError(cErrorType.wrong_value_type);var _arr=[];for(var i=0;i<num;i++)for(var j=0;j<num;j++){if(!_arr[i])_arr[i]=[];_arr[i][j]=i===j?new cNumber(1):new cNumber(0)}var res= new cArray;res.fillFromArray(_arr);return res}};function cODD(){}cODD.prototype=Object.create(cBaseFunction.prototype);cODD.prototype.constructor=cODD;cODD.prototype.name="ODD";cODD.prototype.argumentsMin=1;cODD.prototype.argumentsMax=1;cODD.prototype.argumentsType=[argType.number];cODD.prototype.Calculate=function(arg){function oddHelper(arg){var arg0=arg.getValue();if(arg0>=0){arg0=Math.ceil(arg0);if((arg0&1)==1)return new cNumber(arg0);else return new cNumber(arg0+1)}else{arg0=Math.floor(arg0); if((arg0&1)==1)return new cNumber(arg0);else return new cNumber(arg0-1)}}var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)this.array[r][c]=oddHelper(elem);else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cNumber)return oddHelper(arg0);return new cError(cErrorType.wrong_value_type)}; function cPI(){}cPI.prototype=Object.create(cBaseFunction.prototype);cPI.prototype.constructor=cPI;cPI.prototype.name="PI";cPI.prototype.argumentsMax=0;cPI.prototype.argumentsType=null;cPI.prototype.Calculate=function(){return new cNumber(Math.PI)};function cPOWER(){}cPOWER.prototype=Object.create(cBaseFunction.prototype);cPOWER.prototype.constructor=cPOWER;cPOWER.prototype.name="POWER";cPOWER.prototype.argumentsMin=2;cPOWER.prototype.argumentsMax=2;cPOWER.prototype.argumentsType=[argType.number, argType.number];cPOWER.prototype.Calculate=function(arg){function powerHelper(a,b){if(a==0&&b<0)return new cError(cErrorType.division_by_zero);if(a==0&&b==0)return new cError(cErrorType.not_numeric);return new cNumber(Math.pow(a,b))}function f(a,b,r,c){if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=powerHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg1 instanceof cArea3D)arg0=arg0.cross(arguments[1]); if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){f.call(this,elem,arg1.getElementRowCol(r,c),r,c)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){f.call(this,elem,arg1,r,c)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){f.call(this,arg0,elem,r,c)});return arg1}if(!(arg0 instanceof cNumber)||arg1&&!(arg0 instanceof cNumber))return new cError(cErrorType.wrong_value_type);return powerHelper(arg0.getValue(),arg1.getValue())};function cPRODUCT(){}cPRODUCT.prototype=Object.create(cBaseFunction.prototype);cPRODUCT.prototype.constructor=cPRODUCT;cPRODUCT.prototype.name="PRODUCT"; cPRODUCT.prototype.argumentsMin=1;cPRODUCT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cPRODUCT.prototype.argumentsType=[[argType.number]];cPRODUCT.prototype.Calculate=function(arg){var element,arg0=new cNumber(1);for(var i=0;i<arg.length;i++){element=arg[i];if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var _arrVal=element.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);for(var j=0;j<_arrVal.length;j++)if(_arrVal[j].type!== cElementType.string){arg0=_func[arg0.type][_arrVal[j].type](arg0,_arrVal[j],"*");if(cElementType.error===arg0.type)return arg0}}else if(cElementType.cell===element.type||cElementType.cell3D===element.type){if(!this.checkExclude||!element.isHidden(this.excludeHiddenRows)){var _arg=element.getValue();if(_arg.type!==cElementType.string)arg0=_func[arg0.type][_arg.type](arg0,_arg,"*")}}else if(cElementType.array===element.type)element.foreach(function(elem){if(cElementType.string===elem.type||cElementType.bool=== elem.type||cElementType.empty===elem.type)return;arg0=_func[arg0.type][elem.type](arg0,elem,"*")});else arg0=_func[arg0.type][element.type](arg0,element,"*");if(cElementType.error===arg0.type)return arg0}return arg0};function cQUOTIENT(){}cQUOTIENT.prototype=Object.create(cBaseFunction.prototype);cQUOTIENT.prototype.constructor=cQUOTIENT;cQUOTIENT.prototype.name="QUOTIENT";cQUOTIENT.prototype.argumentsMin=2;cQUOTIENT.prototype.argumentsMax=2;cQUOTIENT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cQUOTIENT.prototype.argumentsType=[argType.any,argType.any];cQUOTIENT.prototype.Calculate=function(arg){function quotient(a,b){if(b.getValue()!=0)return new cNumber(parseInt(a.getValue()/b.getValue()));else return new cError(cErrorType.division_by_zero)}function f(a,b,r,c){if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=quotient(a,b);else this.array[r][c]=new cError(cErrorType.wrong_value_type)}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg1 instanceof cArea3D)arg0=arg0.cross(arguments[1]); if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){f.call(this,elem,arg1.getElementRowCol(r,c),r,c)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){f.call(this,elem,arg1,r,c)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){f.call(this,arg0,elem,r,c)});return arg1}if(!(arg0 instanceof cNumber)||arg1&&!(arg0 instanceof cNumber))return new cError(cErrorType.wrong_value_type);return quotient(arg0,arg1)};function cRADIANS(){}cRADIANS.prototype=Object.create(cBaseFunction.prototype);cRADIANS.prototype.constructor=cRADIANS;cRADIANS.prototype.name="RADIANS";cRADIANS.prototype.argumentsMin= 1;cRADIANS.prototype.argumentsMax=1;cRADIANS.prototype.argumentsType=[argType.number];cRADIANS.prototype.Calculate=function(arg){function radiansHelper(ang){return ang*Math.PI/180}var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber)this.array[r][c]=new cNumber(radiansHelper(elem.getValue()));else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); else return arg0 instanceof cError?arg0:new cNumber(radiansHelper(arg0.getValue()));return arg0};function cRAND(){}cRAND.prototype=Object.create(cBaseFunction.prototype);cRAND.prototype.constructor=cRAND;cRAND.prototype.name="RAND";cRAND.prototype.argumentsMax=0;cRAND.prototype.ca=true;cRAND.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.area_to_ref;cRAND.prototype.argumentsType=null;cRAND.prototype.Calculate=function(){return new cNumber(Math.random())};function cRANDARRAY(){}cRANDARRAY.prototype= Object.create(cBaseFunction.prototype);cRANDARRAY.prototype.constructor=cRANDARRAY;cRANDARRAY.prototype.name="RANDARRAY";cRANDARRAY.prototype.argumentsMin=0;cRANDARRAY.prototype.argumentsMax=5;cRANDARRAY.prototype.ca=true;cRANDARRAY.prototype.isXLFN=true;cRANDARRAY.prototype.numFormat=AscCommonExcel.cNumFormatNone;cRANDARRAY.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.number,argType.number];cRANDARRAY.prototype.Calculate=function(arg){var argClone=arg;var i,j;var matrixRowCount; var matrixColCount;for(i=0;i<argClone.length;i++)if(argClone[i].type===cElementType.empty&&i!==4)if(i!==2)argClone[i]=new cNumber(1);else argClone[i]=new cNumber(0);else if(argClone[i].type===cElementType.array||cElementType.cellsRange===argClone[i].type||cElementType.cellsRange3D===argClone[i].type){argClone[i]=argClone[i].getMatrix();if(cElementType.cellsRange3D===argClone[i].type)argClone[i]=argClone[i][0];if(matrixRowCount===undefined||matrixRowCount>argClone[i].length)matrixRowCount=argClone[i].length; if(matrixColCount===undefined||matrixColCount>argClone[i][0].length)matrixColCount=argClone[i][0].length}else if(i!==4)argClone[i]=argClone[i].tocNumber();if(argClone[4])if(matrixRowCount===undefined){if(argClone[4].type===cElementType.cell||argClone[4].type===cElementType.cell3D)argClone[4]=argClone[4].getValue();if(argClone[4].type===cElementType.string)return new cError(cErrorType.wrong_value_type);else if(argClone[4].type===cElementType.error)return argClone[4];argClone[4]=argClone[4].tocBool()}var argError; if(argError=this._checkErrorArg(argClone))return argError;function randBetween(a,b,_wholeNumber){if(_wholeNumber)return new cNumber(Math.floor(Math.random()*(b-a+1))+a);else return new cNumber(Math.random()*(max-min)+min)}var rowCount;var colCount;var min;var max;var wholeNumber;var _array;if(matrixRowCount!==undefined){_array=new cArray;for(i=0;i<matrixRowCount;i++){_array.addRow();for(j=0;j<matrixColCount;j++){if(argClone[0]&&argClone[0][i]&&argClone[0][i][j]&&argClone[0][i][j].type===cElementType.error){_array.addElement(argClone[0][i][j]); continue}else if(argClone[1]&&argClone[1][i]&&argClone[1][i][j]&&argClone[1][i][j].type===cElementType.error){_array.addElement(argClone[1][i][j]);continue}min=0;if(argClone[2]&&argClone[2][i]){if(argClone[2][i][j]&&argClone[2][i][j].type===cElementType.error){_array.addElement(argClone[2][i][j]);continue}min=argClone[2][i][j].getValue()}else if(argClone[2])min=argClone[2].getValue();max=1;if(argClone[3]&&argClone[3][i]){if(argClone[3][i][j]&&argClone[3][i][j].type===cElementType.error){_array.addElement(argClone[3][i][j]); continue}max=argClone[3][i][j].getValue()}else if(argClone[3])max=argClone[3].getValue();wholeNumber=false;if(argClone[4]&&argClone[4][i]){if(argClone[4][i][j]&&(argClone[4][i][j].type===cElementType.error||argClone[4][i][j].type===cElementType.string)){if(argClone[4][i][j].type===cElementType.string)_array.addElement(new cError(cErrorType.wrong_value_type));else _array.addElement(argClone[4][i][j]);continue}wholeNumber=argClone[4][i][j].getValue()}else if(argClone[4]){if(argClone[4][i][j].type=== cElementType.string){_array.addElement(new cError(cErrorType.wrong_value_type));continue}wholeNumber=argClone[4].toBool()}_array.addElement(randBetween(min,max,wholeNumber))}}}else{rowCount=argClone[0]?parseInt(argClone[0].getValue()):1;colCount=argClone[1]?parseInt(argClone[1].getValue()):1;min=argClone[2]?argClone[2].getValue():0;max=argClone[3]?argClone[3].getValue():1;wholeNumber=argClone[4]?argClone[4].toBool():false;if(min>max)return new cError(cErrorType.wrong_value_type);if(wholeNumber&&(!Number.isInteger(min)|| !Number.isInteger(max)))return new cError(cErrorType.wrong_value_type);if(rowCount<=0||colCount<=0)return new cError(cErrorType.wrong_value_type);_array=new cArray;for(i=0;i<rowCount;i++){_array.addRow();for(j=0;j<colCount;j++)_array.addElement(randBetween(min,max,wholeNumber))}}return _array};function cRANDBETWEEN(){}cRANDBETWEEN.prototype=Object.create(cBaseFunction.prototype);cRANDBETWEEN.prototype.constructor=cRANDBETWEEN;cRANDBETWEEN.prototype.name="RANDBETWEEN";cRANDBETWEEN.prototype.argumentsMin= 2;cRANDBETWEEN.prototype.argumentsMax=2;cRANDBETWEEN.prototype.ca=true;cRANDBETWEEN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cRANDBETWEEN.prototype.argumentsType=[argType.any,argType.any];cRANDBETWEEN.prototype.Calculate=function(arg){function randBetween(a,b){return new cNumber(Math.round(Math.random()*Math.abs(a-b))+a)}function f(a,b,r,c){if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=randBetween(a.getValue(),b.getValue());else this.array[r][c]= new cError(cErrorType.wrong_value_type)}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg1 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available); else{arg0.foreach(function(elem,r,c){f.call(this,elem,arg1.getElementRowCol(r,c),r,c)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){f.call(this,elem,arg1,r,c)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){f.call(this,arg0,elem,r,c)});return arg1}if(!(arg0 instanceof cNumber)||arg1&&!(arg0 instanceof cNumber))return new cError(cErrorType.wrong_value_type);return new cNumber(randBetween(arg0.getValue(),arg1.getValue()))};function cROMAN(){} cROMAN.prototype=Object.create(cBaseFunction.prototype);cROMAN.prototype.constructor=cROMAN;cROMAN.prototype.name="ROMAN";cROMAN.prototype.argumentsMin=1;cROMAN.prototype.argumentsMax=2;cROMAN.prototype.argumentsType=[argType.number,argType.number];cROMAN.prototype.Calculate=function(arg){function roman(num,mode){if(mode>=0&&mode<5&&num>=0&&num<4E3){var chars=["M","D","C","L","X","V","I"],values=[1E3,500,100,50,10,5,1],maxIndex=values.length-1,aRoman="",index,digit,index2,steps;for(var i=0;i<=maxIndex/ 2;i++){index=2*i;digit=parseInt(num/values[index]);if(digit%5==4){index2=digit==4?index-1:index-2;steps=0;while(steps<mode&&index<maxIndex){steps++;if(values[index2]-values[index+1]<=num)index++;else steps=mode}aRoman+=chars[index];aRoman+=chars[index2];num=num+values[index];num=num-values[index2]}else{if(digit>4)aRoman+=chars[index-1];for(var j=digit%5;j>0;j--)aRoman+=chars[index];num%=values[index]}}return new cString(aRoman)}else return new cError(cErrorType.wrong_value_type)}var arg0=arg[0],arg1= arg[1]?arg[1]:new cNumber(0);if(arg0 instanceof cArea||arg0 instanceof cArea3D||arg1 instanceof cArea||arg1 instanceof cArea3D)return new cError(cErrorType.wrong_value_type);arg0=arg0.tocNumber();arg1=arg1.tocNumber();if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem, r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roman(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem,b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roman(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem, r,c){var a=arg0,b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roman(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}return roman(arg0.getValue(),arg1.getValue())};function cROUND(){}cROUND.prototype=Object.create(cBaseFunction.prototype);cROUND.prototype.constructor=cROUND;cROUND.prototype.name="ROUND";cROUND.prototype.argumentsMin=2;cROUND.prototype.argumentsMax=2;cROUND.prototype.inheritFormat=true;cROUND.prototype.argumentsType= [argType.number,argType.number];cROUND.prototype.Calculate=function(arg){function SignZeroPositive(number){return number<0?-1:1}function truncate(n){return Math[n>0?"floor":"ceil"](n)}function Floor(number,significance){var quotient=number/significance;if(quotient==0)return 0;var nolpiat=5*Math.sign(quotient)*Math.pow(10,Math.floor(Math.log10(Math.abs(quotient)))-cExcelSignificantDigits);return truncate(quotient+nolpiat)*significance}function roundHelper(number,num_digits){if(num_digits>AscCommonExcel.cExcelMaxExponent){if(Math.abs(number)< 1||num_digits<1E10)return new cNumber(number);return new cNumber(0)}else if(num_digits<AscCommonExcel.cExcelMinExponent){if(Math.abs(number)<.01)return new cNumber(number);return new cNumber(0)}var significance=SignZeroPositive(number)*Math.pow(10,-truncate(num_digits));number+=significance/2;if(number/significance==Infinity)return new cNumber(number);return new cNumber(Floor(number,significance))}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg0=arg0.tocNumber()}else arg0=arg0.tocNumber();if(arg1 instanceof cRef||arg1 instanceof cRef3D){arg1=arg1.getValue();if(arg1 instanceof cError)return arg1; else if(arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg1=arg1.tocNumber()}else arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roundHelper(a.getValue(),b.getValue());else this.array[r][c]= new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem;var b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roundHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0;var b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roundHelper(a.getValue(),b.getValue()); else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}var number=arg0.getValue(),num_digits=arg1.getValue();return roundHelper(number,num_digits)};function cROUNDDOWN(){}cROUNDDOWN.prototype=Object.create(cBaseFunction.prototype);cROUNDDOWN.prototype.constructor=cROUNDDOWN;cROUNDDOWN.prototype.name="ROUNDDOWN";cROUNDDOWN.prototype.argumentsMin=2;cROUNDDOWN.prototype.argumentsMax=2;cROUNDDOWN.prototype.inheritFormat=true;cROUNDDOWN.prototype.argumentsType=[argType.number,argType.number]; cROUNDDOWN.prototype.Calculate=function(arg){function rounddownHelper(number,num_digits){if(num_digits>AscCommonExcel.cExcelMaxExponent){if(Math.abs(number)>=1E-100||num_digits<=98303)return new cNumber(number);return new cNumber(0)}else if(num_digits<AscCommonExcel.cExcelMinExponent){if(Math.abs(number)>=1E100)return new cNumber(number);return new cNumber(0)}var significance=Math.pow(10,-(num_digits|num_digits));if(Number.POSITIVE_INFINITY==Math.abs(number/significance))return new cNumber(number); var x=number*Math.pow(10,num_digits);x=x|x;return new cNumber(x*significance)}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type); else arg0=arg0.tocNumber()}else arg0=arg0.tocNumber();if(arg1 instanceof cRef||arg1 instanceof cRef3D){arg1=arg1.getValue();if(arg1 instanceof cError)return arg1;else if(arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg1=arg1.tocNumber()}else arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem, r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=rounddownHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem;var b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=rounddownHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0;var b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=rounddownHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}var number=arg0.getValue(),num_digits=arg1.getValue();return rounddownHelper(number,num_digits)};function cROUNDUP(){}cROUNDUP.prototype=Object.create(cBaseFunction.prototype);cROUNDUP.prototype.constructor=cROUNDUP;cROUNDUP.prototype.name="ROUNDUP";cROUNDUP.prototype.argumentsMin= 2;cROUNDUP.prototype.argumentsMax=2;cROUNDUP.prototype.inheritFormat=true;cROUNDUP.prototype.argumentsType=[argType.number,argType.number];cROUNDUP.prototype.Calculate=function(arg){function roundupHelper(number,num_digits){if(num_digits>AscCommonExcel.cExcelMaxExponent){if(Math.abs(number)>=1E-100||num_digits<=98303)return new cNumber(number);return new cNumber(0)}else if(num_digits<AscCommonExcel.cExcelMinExponent){if(Math.abs(number)>=1E100)return new cNumber(number);return new cNumber(0)}var significance= Math.pow(10,-(num_digits|num_digits));if(Number.POSITIVE_INFINITY==Math.abs(number/significance))return new cNumber(number);var x=number*Math.pow(10,num_digits);x=(x|x)+((x^0)===x?0:x>0?1:x<0?-1:0)*1;return new cNumber(x*significance)}var arg0=arg[0],arg1=arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg0=arg0.tocNumber()}else arg0=arg0.tocNumber();if(arg1 instanceof cRef||arg1 instanceof cRef3D){arg1=arg1.getValue();if(arg1 instanceof cError)return arg1;else if(arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg1=arg1.tocNumber()}else arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roundupHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem;var b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roundupHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0;var b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=roundupHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}var number=arg0.getValue(),num_digits=arg1.getValue();return roundupHelper(number, num_digits)};function cSEC(){}cSEC.prototype=Object.create(cBaseFunction.prototype);cSEC.prototype.constructor=cSEC;cSEC.prototype.name="SEC";cSEC.prototype.argumentsMin=1;cSEC.prototype.argumentsMax=1;cSEC.prototype.isXLFN=true;cSEC.prototype.numFormat=AscCommonExcel.cNumFormatNone;cSEC.prototype.argumentsType=[argType.number];cSEC.prototype.Calculate=function(arg){var arg0=arg[0];var maxVal=Math.pow(2,27);if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]); arg0=arg0.tocNumber();if(cElementType.error===arg0.type)return arg0;else if(cElementType.array===arg0.type){arg0.foreach(function(elem,r,c){if(cElementType.number===elem.type)if(Math.abs(elem.getValue())>=maxVal)this.array[r][c]=new cError(cErrorType.not_numeric);else{var a=1/Math.cos(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else{if(Math.abs(arg0.getValue())>=maxVal)return new cError(cErrorType.not_numeric); var a=1/Math.cos(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}};function cSECH(){}cSECH.prototype=Object.create(cBaseFunction.prototype);cSECH.prototype.constructor=cSECH;cSECH.prototype.name="SECH";cSECH.prototype.argumentsMin=1;cSECH.prototype.argumentsMax=1;cSECH.prototype.isXLFN=true;cSECH.prototype.numFormat=AscCommonExcel.cNumFormatNone;cSECH.prototype.argumentsType=[argType.number];cSECH.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cellsRange=== arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(cElementType.error===arg0.type)return arg0;else if(cElementType.array===arg0.type){arg0.foreach(function(elem,r,c){if(cElementType.number===elem.type){var a=1/Math.cosh(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else{var a=1/Math.cosh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric): new cNumber(a)}};function cSERIESSUM(){}cSERIESSUM.prototype=Object.create(cBaseFunction.prototype);cSERIESSUM.prototype.constructor=cSERIESSUM;cSERIESSUM.prototype.name="SERIESSUM";cSERIESSUM.prototype.argumentsMin=4;cSERIESSUM.prototype.argumentsMax=4;cSERIESSUM.prototype.arrayIndexes={3:1};cSERIESSUM.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cSERIESSUM.prototype.argumentsType=[argType.any,argType.any,argType.any,argType.any];cSERIESSUM.prototype.Calculate=function(arg){function SERIESSUM(x, n,m,a){x=x.getValue();n=n.getValue();m=m.getValue();for(var i=0;i<a.length;i++){if(!(a[i]instanceof cNumber))return new cError(cErrorType.wrong_value_type);a[i]=a[i].getValue()}function sumSeries(x,n,m,a){var sum=0;for(var i=0;i<a.length;i++)sum+=a[i]*Math.pow(x,n+i*m);return sum}return new cNumber(sumSeries(x,n,m,a))}var arg0=arg[0],arg1=arg[1],arg2=arg[2],arg3=arg[3];if(arg0 instanceof cNumber||arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.tocNumber();else return new cError(cErrorType.wrong_value_type); if(arg1 instanceof cNumber||arg1 instanceof cRef||arg1 instanceof cRef3D)arg1=arg1.tocNumber();else return new cError(cErrorType.wrong_value_type);if(arg2 instanceof cNumber||arg2 instanceof cRef||arg2 instanceof cRef3D)arg2=arg2.tocNumber();else return new cError(cErrorType.wrong_value_type);if(arg3 instanceof cNumber||arg3 instanceof cRef||arg3 instanceof cRef3D)arg3=[arg3.tocNumber()];else if(arg3 instanceof cArea||arg3 instanceof cArea3D)arg3=arg3.getValue();else return new cError(cErrorType.wrong_value_type); return SERIESSUM(arg0,arg1,arg2,arg3)};function cSIGN(){}cSIGN.prototype=Object.create(cBaseFunction.prototype);cSIGN.prototype.constructor=cSIGN;cSIGN.prototype.name="SIGN";cSIGN.prototype.argumentsMin=1;cSIGN.prototype.argumentsMax=1;cSIGN.prototype.argumentsType=[argType.number];cSIGN.prototype.Calculate=function(arg){function signHelper(arg){if(arg<0)return new cNumber(-1);else if(arg==0)return new cNumber(0);else return new cNumber(1)}var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=elem.getValue();this.array[r][c]=signHelper(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=arg0.getValue();return signHelper(a)}return arg0};function cSIN(){}cSIN.prototype=Object.create(cBaseFunction.prototype);cSIN.prototype.constructor=cSIN;cSIN.prototype.name="SIN";cSIN.prototype.argumentsMin= 1;cSIN.prototype.argumentsMax=1;cSIN.prototype.argumentsType=[argType.number];cSIN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.sin(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); else{var a=Math.sin(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cSINH(){}cSINH.prototype=Object.create(cBaseFunction.prototype);cSINH.prototype.constructor=cSINH;cSINH.prototype.name="SINH";cSINH.prototype.argumentsMin=1;cSINH.prototype.argumentsMax=1;cSINH.prototype.argumentsType=[argType.number];cSINH.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0= arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.sinh(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.sinh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cSQRT(){}cSQRT.prototype=Object.create(cBaseFunction.prototype); cSQRT.prototype.constructor=cSQRT;cSQRT.prototype.name="SQRT";cSQRT.prototype.argumentsMin=1;cSQRT.prototype.argumentsMax=1;cSQRT.prototype.argumentsType=[argType.number];cSQRT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.sqrt(elem.getValue());this.array[r][c]= isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.sqrt(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cSQRTPI(){}cSQRTPI.prototype=Object.create(cBaseFunction.prototype);cSQRTPI.prototype.constructor=cSQRTPI;cSQRTPI.prototype.name="SQRTPI";cSQRTPI.prototype.argumentsMin=1;cSQRTPI.prototype.argumentsMax=1;cSQRTPI.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area; cSQRTPI.prototype.argumentsType=[argType.any];cSQRTPI.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.sqrt(elem.getValue()*Math.PI);this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)}); else{var a=Math.sqrt(arg0.getValue()*Math.PI);return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cSUBTOTAL(){}cSUBTOTAL.prototype=Object.create(cBaseFunction.prototype);cSUBTOTAL.prototype.constructor=cSUBTOTAL;cSUBTOTAL.prototype.name="SUBTOTAL";cSUBTOTAL.prototype.argumentsMin=2;cSUBTOTAL.prototype.argumentsType=[argType.number,argType.reference,[argType.reference]];cSUBTOTAL.prototype.arrayIndexes={1:1,2:1,3:1,4:1,5:1,6:1,7:1};cSUBTOTAL.prototype.Calculate= function(arg){var f,exclude=false,arg0=arg[0];if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(cElementType.number!==arg0.type)return arg0;arg0=arg0.getValue();switch(arg0){case cSubTotalFunctionType.excludes.AVERAGE:exclude=true;case cSubTotalFunctionType.includes.AVERAGE:f=AscCommonExcel.cAVERAGE.prototype;break;case cSubTotalFunctionType.excludes.COUNT:exclude=true;case cSubTotalFunctionType.includes.COUNT:f=AscCommonExcel.cCOUNT.prototype; break;case cSubTotalFunctionType.excludes.COUNTA:exclude=true;case cSubTotalFunctionType.includes.COUNTA:f=AscCommonExcel.cCOUNTA.prototype;break;case cSubTotalFunctionType.excludes.MAX:exclude=true;case cSubTotalFunctionType.includes.MAX:f=AscCommonExcel.cMAX.prototype;break;case cSubTotalFunctionType.excludes.MIN:exclude=true;case cSubTotalFunctionType.includes.MIN:f=AscCommonExcel.cMIN.prototype;break;case cSubTotalFunctionType.excludes.PRODUCT:exclude=true;case cSubTotalFunctionType.includes.PRODUCT:f= cPRODUCT.prototype;break;case cSubTotalFunctionType.excludes.STDEV:exclude=true;case cSubTotalFunctionType.includes.STDEV:f=AscCommonExcel.cSTDEV.prototype;break;case cSubTotalFunctionType.excludes.STDEVP:exclude=true;case cSubTotalFunctionType.includes.STDEVP:f=AscCommonExcel.cSTDEVP.prototype;break;case cSubTotalFunctionType.excludes.SUM:exclude=true;case cSubTotalFunctionType.includes.SUM:f=cSUM.prototype;break;case cSubTotalFunctionType.excludes.VAR:exclude=true;case cSubTotalFunctionType.includes.VAR:f= AscCommonExcel.cVAR.prototype;break;case cSubTotalFunctionType.excludes.VARP:exclude=true;case cSubTotalFunctionType.includes.VARP:f=AscCommonExcel.cVARP.prototype;break}var res;if(f){var oldExcludeHiddenRows=f.excludeHiddenRows;var oldIgnoreNestedStAg=f.excludeNestedStAg;var oldCheckExclude=f.checkExclude;f.excludeHiddenRows=exclude;f.excludeNestedStAg=true;f.checkExclude=true;res=f.Calculate(arg.slice(1));f.excludeHiddenRows=oldExcludeHiddenRows;f.excludeNestedStAg=oldIgnoreNestedStAg;f.checkExclude= oldCheckExclude}else res=new cError(cErrorType.wrong_value_type);return res};function cSUM(){}cSUM.prototype=Object.create(cBaseFunction.prototype);cSUM.prototype.constructor=cSUM;cSUM.prototype.name="SUM";cSUM.prototype.argumentsMin=1;cSUM.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSUM.prototype.inheritFormat=true;cSUM.prototype.argumentsType=[[argType.number]];cSUM.prototype.Calculate=function(arg){var element,_arg,arg0=new cNumber(0);for(var i=0;i<arg.length;i++){element= arg[i];if(cElementType.cellsRange===element.type||cElementType.cellsRange3D===element.type){var _arrVal=element.getValue(this.checkExclude,this.excludeHiddenRows,this.excludeErrorsVal,this.excludeNestedStAg);for(var j=0;j<_arrVal.length;j++){if(cElementType.bool!==_arrVal[j].type&&cElementType.string!==_arrVal[j].type)arg0=_func[arg0.type][_arrVal[j].type](arg0,_arrVal[j],"+");if(cElementType.error===arg0.type)return arg0}}else if(cElementType.cell===element.type||cElementType.cell3D===element.type){if(!this.checkExclude|| !element.isHidden(this.excludeHiddenRows)){_arg=element.getValue();if(cElementType.bool!==_arg.type&&cElementType.string!==_arg.type)arg0=_func[arg0.type][_arg.type](arg0,_arg,"+")}}else if(cElementType.array===element.type)element.foreach(function(arrElem){if(cElementType.bool!==arrElem.type&&cElementType.string!==arrElem.type&&cElementType.empty!==arrElem.type)arg0=_func[arg0.type][arrElem.type](arg0,arrElem,"+")});else{_arg=element.tocNumber();arg0=_func[arg0.type][_arg.type](arg0,_arg,"+")}if(cElementType.error=== arg0.type)return arg0}return arg0};function cSUMIF(){}cSUMIF.prototype=Object.create(cBaseFunction.prototype);cSUMIF.prototype.constructor=cSUMIF;cSUMIF.prototype.name="SUMIF";cSUMIF.prototype.argumentsMin=2;cSUMIF.prototype.argumentsMax=3;cSUMIF.prototype.arrayIndexes={0:1,2:1};cSUMIF.prototype.argumentsType=[argType.reference,argType.any,argType.reference];cSUMIF.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2]?arg[2]:arg[0],_sum=0,matchingInfo;if(cElementType.cell!==arg0.type&& cElementType.cell3D!==arg0.type&&cElementType.cellsRange!==arg0.type)if(cElementType.cellsRange3D===arg0.type){arg0=arg0.tocArea();if(!arg0)return new cError(cErrorType.wrong_value_type)}else return new cError(cErrorType.wrong_value_type);if(cElementType.cell!==arg2.type&&cElementType.cell3D!==arg2.type&&cElementType.cellsRange!==arg2.type)if(cElementType.cellsRange3D===arg2.type){arg2=arg2.tocArea();if(!arg2)return new cError(cErrorType.wrong_value_type)}else return new cError(cErrorType.wrong_value_type); if(cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);arg1=arg1.tocString();if(cElementType.string!==arg1.type)return new cError(cErrorType.wrong_value_type);matchingInfo=AscCommonExcel.matchingValue(arg1);if(cElementType.cellsRange===arg0.type||cElementType.cell===arg0.type){var arg0Matrix=arg0.getMatrix(),arg2Matrix=arg2.getMatrix(),valMatrix2;for(var i=0;i<arg0Matrix.length;i++)for(var j= 0;j<arg0Matrix[i].length;j++)if(arg2Matrix[i]&&(valMatrix2=arg2Matrix[i][j])&&cElementType.number===valMatrix2.type&&AscCommonExcel.matching(arg0Matrix[i][j],matchingInfo))_sum+=valMatrix2.getValue()}else return new cError(cErrorType.wrong_value_type);return new cNumber(_sum)};function SUMIFSCache(){this.cacheRanges={};this.cacheId={}}SUMIFSCache.prototype._get=function(range,arg,valueForSearching,parent){var res,_this=this,wsId=range.getWorksheet().getId();var sRangeName;AscCommonExcel.executeInR1C1Mode(false, function(){sRangeName=wsId+AscCommon.g_cCharDelimiter+range.getName()});var sInputKey=valueForSearching.getValue()+AscCommon.g_cCharDelimiter+sRangeName;var cacheElem;if(parent){if(!parent.cacheId)parent.cacheId=[];cacheElem=parent.cacheId[sInputKey]}else cacheElem=this.cacheId[sInputKey];if(!cacheElem){cacheElem={elems:null,cacheId:null};if(parent&&parent.cacheId)parent.cacheId[sInputKey]=cacheElem;else this.cacheId[sInputKey]=cacheElem;var cacheRange=this.cacheRanges[wsId];if(!cacheRange){cacheRange= new AscCommonExcel.RangeDataManager(null);this.cacheRanges[wsId]=cacheRange}cacheRange.add(range.getBBox0(),cacheElem)}return cacheElem};SUMIFSCache.prototype.clean=function(){this.cacheRanges={};this.cacheId={}};SUMIFSCache.prototype.remove=function(cell){var wsId=cell.ws.getId();var cacheRange=this.cacheRanges[wsId];if(cacheRange){var oGetRes=cacheRange.get(new Asc.Range(cell.nCol,cell.nRow,cell.nCol,cell.nRow));for(var i=0,length=oGetRes.all.length;i<length;++i){var elem=oGetRes.all[i];elem.data.cacheId= null;elem.data.elems=null}}};function cSUMIFS(){}cSUMIFS.prototype=Object.create(cBaseFunction.prototype);cSUMIFS.prototype.constructor=cSUMIFS;cSUMIFS.prototype.name="SUMIFS";cSUMIFS.prototype.argumentsMin=3;cSUMIFS.prototype.arrayIndexes={0:1,1:1,3:1,5:1,7:1};cSUMIFS.prototype.argumentsType=[argType.reference,[argType.reference,argType.any]];cSUMIFS.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cell!==arg0.type&&cElementType.cell3D!==arg0.type&&cElementType.cellsRange!==arg0.type)if(cElementType.cellsRange3D=== arg0.type){arg0=arg0.tocArea();if(!arg0)return new cError(cErrorType.wrong_value_type)}else return new cError(cErrorType.wrong_value_type);var getRange=function(curArg){var res=null;if(cElementType.cellsRange===curArg.type||cElementType.cell===curArg.type)res=curArg.range&&curArg.range.bbox?curArg.range.bbox:null;else if(cElementType.cellsRange3D===curArg.type||cElementType.cell3D===curArg.type)res=curArg.bbox?curArg.bbox:null;return res};var getMatrixFromCache=function(area,searchVal,parent){var range= area.getRange();var ws=area.getWS();var bb=range.getBBox0();var oSearchRange=ws.getRange3(bb.r1,bb.c1,bb.r2,bb.c2);return g_oSUMIFSCache._get(oSearchRange,range,searchVal,parent)};var getElems=function(a1,a2,p,calcSum){var matchingInfo=AscCommonExcel.matchingValue(a2);var arg1Matrix=a1.getMatrix(),enterMatrix;if(p&&p.length)enterMatrix=p;else enterMatrix=arg1Matrix;var res=undefined;for(var i=0;i<enterMatrix.length;++i){if(!arg1Matrix[i])continue;if(!enterMatrix[i])continue;for(var j=0;j<enterMatrix[i].length;++j){if(!enterMatrix[i][j]|| !arg1Matrix[i][j])continue;if(AscCommonExcel.matching(arg1Matrix[i][j],matchingInfo)){if(!res)res=[];if(!res[i])res[i]=[];res[i][j]=arg1Matrix[i][j];if(calcSum)_calcSum(i,j)}}}return res};var _calcSum=function(i,j){var arg0Val=arg0.getValueByRowCol?arg0.getValueByRowCol(i,j):arg0.tocNumber();if(arg0Val&&cElementType.number===arg0Val.type)_sum+=arg0Val.getValue()};var _sum=0;var arg0Range=getRange(arg0);var arg0C=arg0Range.c2-arg0Range.c1+1;var arg0R=arg0Range.r2-arg0Range.r1+1;var cacheElem,parent; var arg1,arg2,arg1Range;for(var k=1;k<arg.length;k+=2){arg1=arg[k];arg2=arg[k+1];arg1Range=getRange(arg1);var arg1C=arg1Range.c2-arg1Range.c1+1;var arg1R=arg1Range.r2-arg1Range.r1+1;if(arg0R!==arg1R||arg0C!==arg1C)return new cError(cErrorType.wrong_value_type);parent=cacheElem;cacheElem=getMatrixFromCache(arg1,arg2,cacheElem);if(null===cacheElem.elems){if(cElementType.cell!==arg1.type&&cElementType.cell3D!==arg1.type&&cElementType.cellsRange!==arg1.type)if(cElementType.cellsRange3D===arg1.type){arg1= arg1.tocArea();if(!arg1)return new cError(cErrorType.wrong_value_type)}else return new cError(cErrorType.wrong_value_type);if(cElementType.cellsRange===arg2.type||cElementType.cellsRange3D===arg2.type)arg2=arg2.cross(arguments[1]);else if(cElementType.array===arg2.type)arg2=arg2.getElementRowCol(0,0);arg2=arg2.tocString();if(cElementType.string!==arg2.type)return new cError(cErrorType.wrong_value_type);cacheElem.elems=getElems(arg1,arg2,parent?parent.elems:null,k+1===arg.length-1)}else if(k+1===arg.length- 1&&cacheElem.elems)for(var i=0;i<cacheElem.elems.length;i++)if(cacheElem.elems[i])for(var j=0;j<cacheElem.elems[i].length;j++)if(cacheElem.elems[i][j])_calcSum(i,j);if(undefined===cacheElem.elems)return new cNumber(0);if(cElementType.error===cacheElem.elems.type)return cacheElem.elems}return new cNumber(_sum)};cSUMIFS.prototype.checkArguments=function(countArguments){return 1===countArguments%2&&cBaseFunction.prototype.checkArguments.apply(this,arguments)};function cSUMPRODUCT(){}cSUMPRODUCT.prototype= Object.create(cBaseFunction.prototype);cSUMPRODUCT.prototype.constructor=cSUMPRODUCT;cSUMPRODUCT.prototype.name="SUMPRODUCT";cSUMPRODUCT.prototype.argumentsMin=1;cSUMPRODUCT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSUMPRODUCT.prototype.argumentsType=[[argType.array]];cSUMPRODUCT.prototype.numFormat=AscCommonExcel.cNumFormatNone;cSUMPRODUCT.prototype.Calculate=function(arg){var arg0=new cNumber(0),resArr=[],col=0,row=0,res=1,_res=[],i;for(i=0;i<arg.length;i++){if(arg[i]instanceof cArea||arg[i]instanceof cArray)resArr[i]=arg[i].getMatrix();else if(arg[i]instanceof cArea3D)if(arg[i].isSingleSheet())resArr[i]=arg[i].getMatrix()[0];else return new cError(cErrorType.bad_reference);else if(arg[i]instanceof cRef||arg[i]instanceof cRef3D){var val=arg[i].getValue();if(val instanceof cEmpty)return new cError(cErrorType.wrong_value_type);else resArr[i]=[[val]]}else resArr[i]=[[arg[i]]];row=Math.max(resArr[0].length,row);col=resArr[0][0]?Math.max(resArr[0][0].length,col):0;if(row!=resArr[i].length|| resArr[i][0]&&col!=resArr[i][0].length)return new cError(cErrorType.not_numeric);if(arg[i]instanceof cError)return arg[i]}for(var iRow=0;iRow<row;iRow++)for(var iCol=0;iCol<col;iCol++){res=1;for(var iRes=0;iRes<resArr.length;iRes++){arg0=resArr[iRes][iRow][iCol];if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)if(arg0.tocNumber()instanceof cError)res*=0;else res*=arg0.tocNumber().getValue();else if(arg0 instanceof cBool)res*=0;else res*=arg0.tocNumber().getValue()}_res.push(res)}res= 0;for(i=0;i<_res.length;i++)res+=_res[i];return new cNumber(res)};function cSUMSQ(){}cSUMSQ.prototype=Object.create(cBaseFunction.prototype);cSUMSQ.prototype.constructor=cSUMSQ;cSUMSQ.prototype.name="SUMSQ";cSUMSQ.prototype.argumentsMin=1;cSUMSQ.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cSUMSQ.prototype.argumentsType=[[argType.number]];cSUMSQ.prototype.Calculate=function(arg){var arg0=new cNumber(0),_arg;function sumsqHelper(a,b){var c=_func[b.type][b.type](b,b,"*");return _func[a.type][c.type](a, c,"+")}for(var i=0;i<arg.length;i++){if(arg[i]instanceof cArea||arg[i]instanceof cArea3D){var _arrVal=arg[i].getValue();for(var j=0;j<_arrVal.length;j++)if(_arrVal[j]instanceof cNumber)arg0=sumsqHelper(arg0,_arrVal[j]);else if(_arrVal[j]instanceof cError)return _arrVal[j]}else if(arg[i]instanceof cRef||arg[i]instanceof cRef3D){_arg=arg[i].getValue();if(_arg instanceof cNumber)arg0=sumsqHelper(arg0,_arg)}else if(arg[i]instanceof cArray)arg[i].foreach(function(arrElem){if(arrElem instanceof cNumber)arg0= sumsqHelper(arg0,arrElem)});else{_arg=arg[i].tocNumber();arg0=sumsqHelper(arg0,_arg)}if(arg0 instanceof cError)return arg0}return arg0};function cSUMX2MY2(){}cSUMX2MY2.prototype=Object.create(cBaseFunction.prototype);cSUMX2MY2.prototype.constructor=cSUMX2MY2;cSUMX2MY2.prototype.name="SUMX2MY2";cSUMX2MY2.prototype.argumentsMin=2;cSUMX2MY2.prototype.argumentsMax=2;cSUMX2MY2.prototype.arrayIndexes={0:1,1:1};cSUMX2MY2.prototype.argumentsType=[argType.array,argType.array];cSUMX2MY2.prototype.Calculate= function(arg){var func=function(a,b){return a*a-b*b};return sumxCalc(arg,func)};function cSUMX2PY2(){}cSUMX2PY2.prototype=Object.create(cBaseFunction.prototype);cSUMX2PY2.prototype.constructor=cSUMX2PY2;cSUMX2PY2.prototype.name="SUMX2PY2";cSUMX2PY2.prototype.argumentsMin=2;cSUMX2PY2.prototype.argumentsMax=2;cSUMX2PY2.prototype.arrayIndexes={0:1,1:1};cSUMX2MY2.prototype.argumentsType=[argType.array,argType.array];cSUMX2PY2.prototype.Calculate=function(arg){var func=function(a,b){return a*a+b*b};return sumxCalc(arg, func)};function cSUMXMY2(){}cSUMXMY2.prototype=Object.create(cBaseFunction.prototype);cSUMXMY2.prototype.constructor=cSUMXMY2;cSUMXMY2.prototype.name="SUMXMY2";cSUMXMY2.prototype.argumentsMin=2;cSUMXMY2.prototype.argumentsMax=2;cSUMXMY2.prototype.arrayIndexes={0:1,1:1};cSUMXMY2.prototype.argumentsType=[argType.array,argType.array];cSUMXMY2.prototype.Calculate=function(arg){var func=function(a,b){return(a-b)*(a-b)};return sumxCalc(arg,func)};function cTAN(){}cTAN.prototype=Object.create(cBaseFunction.prototype); cTAN.prototype.constructor=cTAN;cTAN.prototype.name="TAN";cTAN.prototype.argumentsMin=1;cTAN.prototype.argumentsMax=1;cTAN.prototype.argumentsType=[argType.number];cTAN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.tan(elem.getValue());this.array[r][c]=isNaN(a)? new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.tan(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0};function cTANH(){}cTANH.prototype=Object.create(cBaseFunction.prototype);cTANH.prototype.constructor=cTANH;cTANH.prototype.name="TANH";cTANH.prototype.argumentsMin=1;cTANH.prototype.argumentsMax=1;cTANH.prototype.argumentsType=[argType.number];cTANH.prototype.Calculate=function(arg){var arg0= arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cArray)arg0.foreach(function(elem,r,c){if(elem instanceof cNumber){var a=Math.tanh(elem.getValue());this.array[r][c]=isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}else this.array[r][c]=new cError(cErrorType.wrong_value_type)});else{var a=Math.tanh(arg0.getValue());return isNaN(a)?new cError(cErrorType.not_numeric):new cNumber(a)}return arg0}; function cTRUNC(){}cTRUNC.prototype=Object.create(cBaseFunction.prototype);cTRUNC.prototype.constructor=cTRUNC;cTRUNC.prototype.name="TRUNC";cTRUNC.prototype.argumentsMin=1;cTRUNC.prototype.argumentsMax=2;cTRUNC.prototype.inheritFormat=true;cTRUNC.prototype.argumentsType=[argType.number,argType.number];cTRUNC.prototype.Calculate=function(arg){function truncHelper(a,b){if(b>20)b=20;var numDegree=Math.pow(10,b);return new cNumber(Math.trunc(a*numDegree)/numDegree)}var arg0=arg[0],arg1=arg[1]?arg[1]: new cNumber(0);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);if(arg0 instanceof cError)return arg0;if(arg1 instanceof cError)return arg1;if(arg0 instanceof cRef||arg0 instanceof cRef3D){arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg0=arg0.tocNumber()}else arg0=arg0.tocNumber();if(arg1 instanceof cRef||arg1 instanceof cRef3D){arg1=arg1.getValue();if(arg1 instanceof cError)return arg1;else if(arg1 instanceof cString)return new cError(cErrorType.wrong_value_type);else arg1=arg1.tocNumber()}else arg1=arg1.tocNumber();if(arg0 instanceof cArray&&arg1 instanceof cArray)if(arg0.getCountElement()!=arg1.getCountElement()||arg0.getRowCount()!=arg1.getRowCount())return new cError(cErrorType.not_available);else{arg0.foreach(function(elem,r,c){var a=elem;var b=arg1.getElementRowCol(r,c);if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=truncHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg0 instanceof cArray){arg0.foreach(function(elem,r,c){var a=elem;var b=arg1;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=truncHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg0}else if(arg1 instanceof cArray){arg1.foreach(function(elem,r,c){var a=arg0; var b=elem;if(a instanceof cNumber&&b instanceof cNumber)this.array[r][c]=truncHelper(a.getValue(),b.getValue());else this.array[r][c]=new cError(cErrorType.wrong_value_type)});return arg1}return truncHelper(arg0.getValue(),arg1.getValue())};var g_oSUMIFSCache=new SUMIFSCache;window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].cAGGREGATE=cAGGREGATE;window["AscCommonExcel"].cPRODUCT=cPRODUCT;window["AscCommonExcel"].cSUBTOTAL=cSUBTOTAL;window["AscCommonExcel"].cSUM=cSUM; window["AscCommonExcel"].g_oSUMIFSCache=g_oSUMIFSCache})(window);"use strict";(function(window,undefined){var g_cCharDelimiter=AscCommon.g_cCharDelimiter;var parserHelp=AscCommon.parserHelp;var gc_nMaxRow0=AscCommon.gc_nMaxRow0;var gc_nMaxCol0=AscCommon.gc_nMaxCol0;var g_oCellAddressUtils=AscCommon.g_oCellAddressUtils;var CellAddress=AscCommon.CellAddress;var cElementType=AscCommonExcel.cElementType;var cErrorType=AscCommonExcel.cErrorType;var cNumber=AscCommonExcel.cNumber;var cString=AscCommonExcel.cString; var cBool=AscCommonExcel.cBool;var cError=AscCommonExcel.cError;var cArea=AscCommonExcel.cArea;var cArea3D=AscCommonExcel.cArea3D;var cRef=AscCommonExcel.cRef;var cRef3D=AscCommonExcel.cRef3D;var cName=AscCommonExcel.cName;var cName3D=AscCommonExcel.cName3D;var cEmpty=AscCommonExcel.cEmpty;var cArray=AscCommonExcel.cArray;var cBaseFunction=AscCommonExcel.cBaseFunction;var checkTypeCell=AscCommonExcel.checkTypeCell;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var argType=Asc.c_oAscFormulaArgumentType; var _func=AscCommonExcel._func;cFormulaFunctionGroup["LookupAndReference"]=cFormulaFunctionGroup["LookupAndReference"]||[];cFormulaFunctionGroup["LookupAndReference"].push(cADDRESS,cAREAS,cCHOOSE,cCOLUMN,cCOLUMNS,cFORMULATEXT,cGETPIVOTDATA,cHLOOKUP,cHYPERLINK,cINDEX,cINDIRECT,cLOOKUP,cMATCH,cOFFSET,cROW,cROWS,cRTD,cTRANSPOSE,cUNIQUE,cVLOOKUP);cFormulaFunctionGroup["NotRealised"]=cFormulaFunctionGroup["NotRealised"]||[];cFormulaFunctionGroup["NotRealised"].push(cAREAS,cGETPIVOTDATA,cRTD);function searchRegExp(str, flags){var vFS=str.replace(/(\\)/g,"\\").replace(/(\^)/g,"\\^").replace(/(\()/g,"\\(").replace(/(\))/g,"\\)").replace(/(\+)/g,"\\+").replace(/(\[)/g,"\\[").replace(/(\])/g,"\\]").replace(/(\{)/g,"\\{").replace(/(\})/g,"\\}").replace(/(\$)/g,"\\$").replace(/(~)?\*/g,function($0,$1){return $1?$0:"(.*)"}).replace(/(~)?\?/g,function($0,$1){return $1?$0:".{1}"}).replace(/(~\*)/g,"\\*").replace(/(~\?)/g,"\\?");return new RegExp(vFS+"$",flags?flags:"i")}function cADDRESS(){}cADDRESS.prototype=Object.create(cBaseFunction.prototype); cADDRESS.prototype.constructor=cADDRESS;cADDRESS.prototype.name="ADDRESS";cADDRESS.prototype.argumentsMin=2;cADDRESS.prototype.argumentsMax=5;cADDRESS.prototype.argumentsType=[argType.number,argType.number,argType.number,argType.logical,argType.text];cADDRESS.prototype.Calculate=function(arg){var rowNumber=arg[0],colNumber=arg[1],refType=arg[2]?arg[2]:new cNumber(1),A1RefType=arg[3]?arg[3]:new cBool(true),sheetName=arg[4]?arg[4]:null;if(cElementType.cellsRange===rowNumber.type||cElementType.cellsRange3D=== rowNumber.type)rowNumber=rowNumber.cross(arguments[1]);else if(cElementType.array===rowNumber.type)rowNumber=rowNumber.getElementRowCol(0,0);if(cElementType.cellsRange===colNumber.type||cElementType.cellsRange3D===colNumber.type)colNumber=colNumber.cross(arguments[1]);else if(cElementType.array===colNumber.type)colNumber=colNumber.getElementRowCol(0,0);if(cElementType.cellsRange===refType.type||cElementType.cellsRange3D===refType.type)refType=refType.cross(arguments[1]);else if(cElementType.array=== refType.type)refType=refType.getElementRowCol(0,0);else if(cElementType.empty===refType.type)refType=new cNumber(1);if(cElementType.cellsRange===A1RefType.type||cElementType.cellsRange3D===A1RefType.type)A1RefType=A1RefType.cross(arguments[1]);else if(cElementType.array===A1RefType.type)A1RefType=A1RefType.getElementRowCol(0,0);else if(cElementType.empty===A1RefType.type)A1RefType=new cNumber(1);if(sheetName)if(cElementType.cellsRange===sheetName.type||cElementType.cellsRange3D===sheetName.type)sheetName= sheetName.cross(arguments[1]);else if(cElementType.array===sheetName.type)sheetName=sheetName.getElementRowCol(0,0);else if(cElementType.cell===sheetName.type||cElementType.cell3D===sheetName.type)sheetName=sheetName.getValue();else if(cElementType.empty===sheetName.type)sheetName=null;rowNumber=rowNumber.tocNumber();colNumber=colNumber.tocNumber();refType=refType.tocNumber();A1RefType=A1RefType.tocBool();if(cElementType.error===rowNumber.type)return rowNumber;if(cElementType.error===colNumber.type)return colNumber; if(cElementType.error===refType.type)return refType;if(cElementType.error===A1RefType.type)return A1RefType;if(sheetName&&cElementType.error===sheetName.type)return sheetName;rowNumber=rowNumber.getValue();colNumber=colNumber.getValue();refType=refType.getValue();A1RefType=A1RefType.toBool();rowNumber=parseInt(rowNumber);colNumber=parseInt(colNumber);if(refType>4||refType<1||rowNumber<1||rowNumber>AscCommon.gc_nMaxRow||colNumber<1||colNumber>AscCommon.gc_nMaxCol)return new cError(cErrorType.wrong_value_type); var strRef;var absR,absC;switch(refType-1){case AscCommonExcel.referenceType.A:absR=true;absC=true;break;case AscCommonExcel.referenceType.ARRC:absR=true;absC=false;break;case AscCommonExcel.referenceType.RRAC:absR=false;absC=true;break;case AscCommonExcel.referenceType.R:absR=false;absC=false;break}strRef=this._getRef(this._absolute(absR,rowNumber,A1RefType),this._absolute(absC,A1RefType?g_oCellAddressUtils.colnumToColstrFromWsView(colNumber):colNumber,A1RefType),A1RefType);var res=strRef;if(sheetName)if(""=== sheetName.getValue())res="!"+strRef;else res=parserHelp.get3DRef(sheetName.toString(),strRef);return new cString(res)};cADDRESS.prototype._getRef=function(row,col,A1RefType){return A1RefType?col+row:"R"+row+"C"+col};cADDRESS.prototype._absolute=function(abs,val,A1RefType){return abs?A1RefType?"$"+val:val:A1RefType?val:"["+val+"]"};function cAREAS(){}cAREAS.prototype=Object.create(cBaseFunction.prototype);cAREAS.prototype.constructor=cAREAS;cAREAS.prototype.name="AREAS";cAREAS.prototype.argumentsType= [argType.reference];function cCHOOSE(){}cCHOOSE.prototype=Object.create(cBaseFunction.prototype);cCHOOSE.prototype.constructor=cCHOOSE;cCHOOSE.prototype.name="CHOOSE";cCHOOSE.prototype.argumentsMin=2;cCHOOSE.prototype.argumentsMax=30;cCHOOSE.prototype.argumentsType=[argType.number,[argType.any]];cCHOOSE.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type)arg0=arg0.cross(arguments[1]);arg0=arg0.tocNumber();if(cElementType.error=== arg0.type)return arg0;if(cElementType.number===arg0.type){if(arg0.getValue()<1||arg0.getValue()>arg.length-1)return new cError(cErrorType.wrong_value_type);return arg[Math.floor(arg0.getValue())]}return new cError(cErrorType.wrong_value_type)};function cCOLUMN(){}cCOLUMN.prototype=Object.create(cBaseFunction.prototype);cCOLUMN.prototype.constructor=cCOLUMN;cCOLUMN.prototype.name="COLUMN";cCOLUMN.prototype.argumentsMax=1;cCOLUMN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.setArrayRefAsArg; cCOLUMN.prototype.argumentsType=[argType.reference];cCOLUMN.prototype.Calculate=function(arg){var bbox;var res;var opt_col=arguments[6];if(opt_col!==undefined)return new cNumber(opt_col+1);else if(0===arg.length){bbox=arguments[1];res=bbox?new cNumber(bbox.c1+1):null}else{var arg0=arg[0];if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type){bbox=arg0.getRange();bbox=bbox&&bbox.bbox;res=bbox?new cNumber(bbox.c1+1):null}else if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D=== arg0.type){bbox=arg0.getRange();bbox=bbox&&bbox.bbox;if(bbox&&bbox.c2>bbox.c1){res=new cArray;for(var i=bbox.c1;i<=bbox.c2;i++)res.addElement(new cNumber(i+1))}else res=bbox?new cNumber(bbox.c1+1):null}}return res?res:new cError(cErrorType.bad_reference)};function cCOLUMNS(){}cCOLUMNS.prototype=Object.create(cBaseFunction.prototype);cCOLUMNS.prototype.constructor=cCOLUMNS;cCOLUMNS.prototype.name="COLUMNS";cCOLUMNS.prototype.argumentsMin=1;cCOLUMNS.prototype.argumentsMax=1;cCOLUMNS.prototype.arrayIndexes= {0:1};cCOLUMNS.prototype.argumentsType=[argType.reference];cCOLUMNS.prototype.Calculate=function(arg){var arg0=arg[0];var range;if(cElementType.array===arg0.type)return new cNumber(arg0.getCountElementInRow());else if(cElementType.cellsRange===arg0.type||cElementType.cell===arg0.type||cElementType.cell3D===arg0.type||cElementType.cellsRange3D===arg0.type)range=arg0.getRange();return range?new cNumber(Math.abs(range.getBBox0().c1-range.getBBox0().c2)+1):new cError(cErrorType.wrong_value_type)};function cFORMULATEXT(){} cFORMULATEXT.prototype=Object.create(cBaseFunction.prototype);cFORMULATEXT.prototype.constructor=cFORMULATEXT;cFORMULATEXT.prototype.name="FORMULATEXT";cFORMULATEXT.prototype.argumentsMin=1;cFORMULATEXT.prototype.argumentsMax=1;cFORMULATEXT.prototype.isXLFN=true;cFORMULATEXT.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.area_to_ref;cFORMULATEXT.prototype.argumentsType=[argType.reference];cFORMULATEXT.prototype.Calculate=function(arg){var arg0=arg[0];if(cElementType.error===arg0.type)return arg0; var res=null;if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type||cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type){var bbox=arg0.getRange();var formula=bbox.isFormula();if(!formula)return new cError(cErrorType.not_available);else res=new cString(bbox.getValueForEdit(true))}return null!==res?res:new cError(cErrorType.wrong_value_type)};function cGETPIVOTDATA(){}cGETPIVOTDATA.prototype=Object.create(cBaseFunction.prototype);cGETPIVOTDATA.prototype.constructor= cGETPIVOTDATA;cGETPIVOTDATA.prototype.name="GETPIVOTDATA";cGETPIVOTDATA.prototype.argumentsType=[argType.text,argType.text,[argType.text,argType.any]];function cHLOOKUP(){}cHLOOKUP.prototype=Object.create(cBaseFunction.prototype);cHLOOKUP.prototype.constructor=cHLOOKUP;cHLOOKUP.prototype.name="HLOOKUP";cHLOOKUP.prototype.argumentsMin=3;cHLOOKUP.prototype.argumentsMax=4;cHLOOKUP.prototype.arrayIndexes={1:1,2:1};cHLOOKUP.prototype.argumentsType=[argType.any,argType.number,argType.number,argType.logical]; cHLOOKUP.prototype.Calculate=function(arg){if(this.bArrayFormula)if(cElementType.cellsRange3D===arg[2].type||cElementType.cellsRange===arg[2].type)arg[2]=arg[2].getValue2(0,0);else if(cElementType.array===arg[2].type)arg[2]=arg[2].getValue2(0,0);return g_oHLOOKUPCache.calculate(arg,arguments[1])};function cHYPERLINK(){}cHYPERLINK.prototype=Object.create(cBaseFunction.prototype);cHYPERLINK.prototype.constructor=cHYPERLINK;cHYPERLINK.prototype.name="HYPERLINK";cHYPERLINK.prototype.argumentsMin=1;cHYPERLINK.prototype.argumentsMax= 2;cHYPERLINK.prototype.argumentsType=[argType.text,argType.any];cHYPERLINK.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg.length===1?null:arg[1];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray)arg0=arg0.getElementRowCol(0,0);arg0=arg0.tocString();if(arg1){if(arg1 instanceof cArea||arg1 instanceof cArea3D)arg1=arg1.cross(arguments[1]);else if(arg1 instanceof cArray)arg1=arg1.getElementRowCol(0,0);if(arg1 instanceof cRef||arg1 instanceof cRef3D)arg1=arg1.getValue();if(arg1 instanceof cEmpty)arg1=new cNumber(0)}else arg1=arg0.tocString();if(arg0 instanceof cError){arg0.hyperlink="";return arg0}if(arg1 instanceof cError){arg1.hyperlink="";return arg1}var res=arg1;res.hyperlink=arg0.getValue();return res};function cINDEX(){}cINDEX.prototype=Object.create(cBaseFunction.prototype);cINDEX.prototype.constructor=cINDEX;cINDEX.prototype.name="INDEX";cINDEX.prototype.argumentsMin=2;cINDEX.prototype.argumentsMax=4;cINDEX.prototype.numFormat= AscCommonExcel.cNumFormatNone;cINDEX.prototype.arrayIndexes={0:1};cINDEX.prototype.argumentsType=[argType.reference,argType.number,argType.number];cINDEX.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1]&&cElementType.empty!==arg[1].type?arg[1]:new cNumber(1),arg2=arg[2]&&cElementType.empty!==arg[2].type?arg[2]:new cNumber(1),arg3=arg[3]&&cElementType.empty!==arg[3].type?arg[3]:new cNumber(1),res;if(cElementType.cellsRange3D===arg0.type){arg0=arg0.tocArea();if(!arg0)return new cError(cErrorType.not_available)}else if(cElementType.error=== arg0.type)return arg0;arg1=arg1.tocNumber();arg2=arg2.tocNumber();arg3=arg3.tocNumber();if(cElementType.error===arg1.type||cElementType.error===arg2.type||cElementType.error===arg3.type)return new cError(cErrorType.wrong_value_type);if(cElementType.array===arg1.type){arg1=arg1.getElementRowCol(0,0);if(cElementType.error===arg1.type)return new cError(cErrorType.wrong_value_type)}if(cElementType.array===arg2.type){arg2=arg2.getElementRowCol(0,0);if(cElementType.error===arg2.type)return new cError(cErrorType.wrong_value_type)}if(arg[3]&& cElementType.empty!==arg[3].type&&arg3>1)return new cError(cErrorType.bad_reference);arg1=arg1.getValue();arg2=arg2.getValue();if(arg1<0||arg2<0)return new cError(cErrorType.wrong_value_type);var generateArray=function(_from,row,col){var ret=null;var _colCount=_from.getCountElementInRow();var _rowCount=_from.rowCount;var i;row=row!==undefined?Math.ceil(row):row;col=col!==undefined?Math.ceil(col):col;if(undefined!==row){if(_rowCount<row)if(col===undefined&&_rowCount===1&&_from.array[0]&&_from.array[0][row- 1]){ret=new cArray;ret.addElement(_from.array[0][row-1]);return ret}else return null;ret=new cArray;for(i=0;i<_colCount;i++)ret.addElement(_from.array[row-1][i])}else if(undefined!==col){if(_colCount<col)if(row===undefined&&_colCount===1&&_from.array[col-1]&&_from.array[col-1][0]){ret=new cArray;ret.addElement(_from.array[col-1][0]);return ret}else return null;ret=new cArray;for(i=0;i<_rowCount;i++){ret.addRow();ret.addElement(_from.array[i][col-1])}}return ret};AscCommonExcel.executeInR1C1Mode(false, function(){if(cElementType.array===arg0.type)if((!arg[1]||arg1===0)&&(!arg[2]||arg2===0))res=arg0;else if(!arg[2]||arg2===0)res=generateArray(arg0,arg1);else if(!arg[1]||arg1===0)res=generateArray(arg0,undefined,arg2);else if(undefined===arg[2]&&1===arg0.rowCount)res=arg0.getValue2(0,0===arg1?0:arg1-1);else if(undefined===arg[2]&&1===arg0.getCountElementInRow())res=arg0.getValue2(0===arg1?0:arg1-1,0);else res=arg0.getValue2(1===arg0.rowCount||0===arg1?0:arg1-1,0===arg2?0:arg2-1);else if(cElementType.cellsRange=== arg0.type){var ws=arg0.getWS(),bbox=arg0.getBBox0();if(cElementType.empty===arg[1].type)arg1=0;var diffArg1=arg1===0?0:1;var diffArg2=arg2===0?0:1;if(undefined===arg[2]&&bbox.r1===bbox.r2)if(arg1>Math.abs(bbox.c1-bbox.c2)+1)res=new cError(cErrorType.bad_reference);else{res=new Asc.Range(bbox.c1+arg1-diffArg1,bbox.r1,bbox.c1+arg1-diffArg1,bbox.r1);res=new cRef(res.getName(),ws)}else if(undefined===arg[2]&&bbox.c1===bbox.c2&&arg1>0)if(arg1>Math.abs(bbox.r1-bbox.r2)+1)res=new cError(cErrorType.bad_reference); else{res=new Asc.Range(bbox.c1,bbox.r1+arg1-diffArg1,bbox.c1,bbox.r1+arg1-diffArg1);res=new cRef(res.getName(),ws)}else if(undefined===arg[2]&&Math.abs(bbox.r1-bbox.r2)+1>1&&Math.abs(bbox.c1-bbox.c2)+1>1)res=new cError(cErrorType.bad_reference);else if(bbox.r1===bbox.r2){res=new Asc.Range(bbox.c1+arg2-1,bbox.r1,bbox.c1+arg2-1,bbox.r1);res=new cRef(res.getName(),ws)}else if(0===arg1&&arg2>0)if(arg2>Math.abs(bbox.c1-bbox.c2)+1)res=new cError(cErrorType.bad_reference);else{if(0===arg2||undefined===arg[2]|| cElementType.empty===arg[2].type)res=new Asc.Range(bbox.c1+arg2-1,bbox.r1,bbox.c2+arg2-1,bbox.r2);else res=new Asc.Range(bbox.c1+arg2-1,bbox.r1,bbox.c1+arg2-1,bbox.r2);res=res.isOneCell()?new cRef(res.getName(),ws):new cArea(res.getName(),ws)}else if((0===arg2||undefined===arg[2]||cElementType.empty===arg[2].type)&&arg1>0)if(arg1>Math.abs(bbox.r1-bbox.r2)+1)res=new cError(cErrorType.bad_reference);else{res=new Asc.Range(bbox.c1+arg2-diffArg2,bbox.r1+arg1-diffArg1,bbox.c2+arg2-diffArg2,bbox.r1+arg1- diffArg1);res=res.isOneCell()?new cRef(res.getName(),ws):new cArea(res.getName(),ws)}else if((0===arg1||undefined===arg[1]||cElementType.empty===arg[1].type)&&(0===arg2||undefined===arg[2]||cElementType.empty===arg[2].type)){res=new Asc.Range(bbox.c1+arg2-diffArg2,bbox.r1+arg1-diffArg1,bbox.c2+arg2-diffArg2,bbox.r2+arg1-diffArg1);res=res.isOneCell()?new cRef(res.getName(),ws):new cArea(res.getName(),ws)}else if(arg1>Math.abs(bbox.r1-bbox.r2)+1||arg2>Math.abs(bbox.c1-bbox.c2)+1)res=new cError(cErrorType.bad_reference); else{res=new Asc.Range(bbox.c1+arg2-diffArg2,bbox.r1+arg1-diffArg1,bbox.c1+arg2-diffArg2,bbox.r1+arg1-diffArg1);res=new cRef(res.getName(),ws)}}else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type){if((0===arg1||1===arg1)&&(0===arg2||1===arg2))res=arg0.getValue()}else res=new cError(cErrorType.wrong_value_type)});return res?res:new cError(cErrorType.bad_reference)};function cINDIRECT(){}cINDIRECT.prototype=Object.create(cBaseFunction.prototype);cINDIRECT.prototype.constructor=cINDIRECT; cINDIRECT.prototype.name="INDIRECT";cINDIRECT.prototype.argumentsMin=1;cINDIRECT.prototype.argumentsMax=2;cINDIRECT.prototype.ca=true;cINDIRECT.prototype.argumentsType=[argType.text,argType.logical];cINDIRECT.prototype.Calculate=function(arg){var t=this,arg0=arg[0].tocString(),arg1=arg[1]?arg[1]:new cBool(true),ws=arguments[3],wb=ws.workbook,o={Formula:"",pCurrPos:0},ref,found_operand,ret;var _getWorksheetByName=function(name){if(!name)return null;for(var i=0;i<wb.aWorksheets.length;i++)if(wb.aWorksheets[i].getName().toLowerCase()== name.toLowerCase())return wb.aWorksheets[i];return null};function parseReference(){if((ref=parserHelp.is3DRef.call(o,o.Formula,o.pCurrPos,true))[0]){var wsFrom=_getWorksheetByName(ref[1]);var wsTo=null!==ref[2]?_getWorksheetByName(ref[2]):wsFrom;if(!(wsFrom&&wsTo))return new cError(cErrorType.bad_reference);if(parserHelp.isArea.call(o,o.Formula,o.pCurrPos))found_operand=new cArea3D(o.real_str?o.real_str.toUpperCase():o.operand_str.toUpperCase(),wsFrom,wsTo);else if(parserHelp.isRef.call(o,o.Formula, o.pCurrPos))if(wsTo!==wsFrom)found_operand=new cArea3D(o.real_str?o.real_str.toUpperCase():o.operand_str.toUpperCase(),wsFrom,wsTo);else found_operand=new cRef3D(o.real_str?o.real_str.toUpperCase():o.operand_str.toUpperCase(),wsFrom);else if(parserHelp.isName.call(o,o.Formula,o.pCurrPos))found_operand=new cName3D(o.operand_str,wsFrom)}else if(parserHelp.isArea.call(o,o.Formula,o.pCurrPos))found_operand=new cArea(o.real_str?o.real_str.toUpperCase():o.operand_str.toUpperCase(),ws);else if(parserHelp.isRef.call(o, o.Formula,o.pCurrPos,true))found_operand=new cRef(o.real_str?o.real_str.toUpperCase():o.operand_str.toUpperCase(),ws);else if(parserHelp.isName.call(o,o.Formula,o.pCurrPos))found_operand=new cName(o.operand_str,ws)}if(cElementType.array===arg0.type){ret=new cArray;arg0.foreach(function(elem,r){o={Formula:elem.toString(),pCurrPos:0};AscCommonExcel.executeInR1C1Mode(!!(arg1&&arg1.value===false),parseReference);if(!ret.array[r])ret.addRow();ret.addElement(found_operand)});return ret}else{o.Formula=arg0.toString(); AscCommonExcel.executeInR1C1Mode(!!(arg1&&arg1.value===false),parseReference);if(found_operand)if(cElementType.name===found_operand.type||cElementType.name3D===found_operand.type){found_operand=found_operand.toRef(arguments[1]);if(found_operand&&cElementType.error===found_operand.type)ret=new cError(cErrorType.bad_reference);else ret=found_operand}else ret=found_operand;else ret=new cError(cErrorType.bad_reference)}return ret};function cLOOKUP(){}cLOOKUP.prototype=Object.create(cBaseFunction.prototype); cLOOKUP.prototype.constructor=cLOOKUP;cLOOKUP.prototype.name="LOOKUP";cLOOKUP.prototype.argumentsMin=2;cLOOKUP.prototype.argumentsMax=3;cLOOKUP.prototype.arrayIndexes={1:1,2:1};cLOOKUP.prototype.argumentsType=[argType.any,argType.reference,argType.reference];cLOOKUP.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=2===arg.length?arg1:arg[2],resC=-1,resR=-1,t=this,res;if(cElementType.error===arg0.type)return arg0;if(cElementType.cell===arg0.type)arg0=arg0.getValue();function arrFinder(arr){if(arr.getRowCount()> arr.getCountElementInRow()){resC=arr.getCountElementInRow()>1?1:0;var arrCol=arr.getCol(0);resR=_func.binarySearch(arg0,arrCol)}else{resR=arr.getRowCount()>1?1:0;var arrRow=arr.getRow(0);resC=_func.binarySearch(arg0,arrRow)}}if(!((cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type||cElementType.array===arg1.type)&&(cElementType.cellsRange===arg2.type||cElementType.cellsRange3D===arg2.type||cElementType.array===arg2.type)))return new cError(cErrorType.not_available);if(cElementType.array=== arg1.type&&cElementType.array===arg2.type){if(arg1.getRowCount()!==arg2.getRowCount()&&arg1.getCountElementInRow()!==arg2.getCountElementInRow())return new cError(cErrorType.not_available);arrFinder(arg1);if(resR<=-1&&resC<=-1||resR<=-2||resC<=-2)return new cError(cErrorType.not_available);return arg2.getElementRowCol(resR,resC)}else if(cElementType.array===arg1.type||cElementType.array===arg2.type){var _arg1,_arg2;_arg1=cElementType.array===arg1.type?arg1:arg2;_arg2=cElementType.array===arg2.type? arg1:arg2;var BBox=_arg2.getBBox0();if(_arg1.getRowCount()!==BBox.r2-BBox.r1&&_arg1.getCountElementInRow()!==BBox.c2-BBox.c1)return new cError(cErrorType.not_available);arrFinder(_arg1);if(resR<=-1&&resC<=-1||resR<=-2||resC<=-2)return new cError(cErrorType.not_available);var c=new CellAddress(BBox.r1+resR,BBox.c1+resC,0);_arg2.getWS()._getCellNoEmpty(c.getRow0(),c.getCol0(),function(cell){res=checkTypeCell(cell)});return res}else{if(cElementType.cellsRange3D===arg1.type&&!arg1.isSingleSheet()||cElementType.cellsRange3D=== arg2.type&&!arg2.isSingleSheet())return new cError(cErrorType.not_available);if(false);else{var arg2RowsLength;var bbox;if(cElementType.cellsRange3D===arg1.type)bbox=arg1.bbox;else if(cElementType.cellsRange===arg1.type)bbox=arg1.range.bbox;if(cElementType.cellsRange3D===arg2.type)arg2RowsLength=arg2.bbox.r2-arg2.bbox.r1+1;else if(cElementType.cellsRange===arg2.type)arg2RowsLength=arg2.range.bbox.r2-arg2.range.bbox.r1+1;var bVertical=bbox.r2-bbox.r1>=bbox.c2-bbox.c1;var index;var _getValue=function(n){var r, c;if(bVertical){r=n;c=0}else{r=0;c=n}var res=arg1.getValueByRowCol(r,c);return res?res:new cEmpty};var length=bVertical?bbox.r2-bbox.r1:bbox.c2-bbox.c1;var lastValue=_getValue(length);if(lastValue&&lastValue.value<arg0.value){var diff=null;var endNumber;for(var i=0;i<=length;i++){var tempValue=_getValue(i);if(cElementType.number===tempValue.type){if(tempValue.value<=arg0.value&&(null===diff||diff>arg0.value-tempValue.value)){index=i;diff=arg0.value-tempValue.value}endNumber=i}}if(undefined===index)if(undefined!== endNumber)index=endNumber}if(index===undefined){index=_func.binarySearchByRange(arg0,arg1);if(index<0)return new cError(cErrorType.not_available)}}var ws=cElementType.cellsRange3D===arg1.type&&arg1.isSingleSheet()?arg1.getWS():arg1.ws;if(cElementType.cellsRange3D===arg1.type)if(arg1.isSingleSheet())ws=arg1.getWS();else return new cError(cErrorType.bad_reference);else if(cElementType.cellsRange===arg1.type)ws=arg1.getWS();else return new cError(cErrorType.bad_reference);AscCommonExcel.executeInR1C1Mode(false, function(){var b=arg2.getBBox0();if(2===arg.length)if(bVertical)res=new cRef(ws.getCell3(b.r1+0,b.c1+index).getName(),ws);else res=new cRef(ws.getCell3(b.r1+index,b.c1+0).getName(),ws);else if(1===arg2RowsLength)res=new cRef(ws.getCell3(b.r1+0,b.c1+index).getName(),ws);else res=new cRef(ws.getCell3(b.r1+index,b.c1+0).getName(),ws)});return res}};function cMATCH(){}cMATCH.prototype=Object.create(cBaseFunction.prototype);cMATCH.prototype.constructor=cMATCH;cMATCH.prototype.name="MATCH";cMATCH.prototype.argumentsMin= 2;cMATCH.prototype.argumentsMax=3;cMATCH.prototype.arrayIndexes={1:1};cMATCH.prototype.argumentsType=[argType.any,argType.number,argType.number];cMATCH.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2]?arg[2]:new cNumber(1);return g_oMatchCache.calculate(arg,arguments[1])};function cOFFSET(){}cOFFSET.prototype=Object.create(cBaseFunction.prototype);cOFFSET.prototype.constructor=cOFFSET;cOFFSET.prototype.name="OFFSET";cOFFSET.prototype.argumentsMin=3;cOFFSET.prototype.argumentsMax= 5;cOFFSET.prototype.ca=true;cOFFSET.prototype.arrayIndexes={0:1};cOFFSET.prototype.argumentsType=[argType.reference,argType.number,argType.number,argType.number,argType.number];cOFFSET.prototype.Calculate=function(arg){function validBBOX(bbox){return 0<=bbox.r1&&bbox.r1<=gc_nMaxRow0&&0<=bbox.c1&&bbox.c1<=gc_nMaxCol0&&0<=bbox.r2&&bbox.r2<=gc_nMaxRow0&&0<=bbox.c2&&bbox.c2<=gc_nMaxCol0}var arg0=arg[0],arg1=arg[1].tocNumber(),arg2=arg[2].tocNumber();var arg3=3<arg.length?cElementType.empty===arg[3].type? new cNumber(1):arg[3].tocNumber():new cNumber(-1);var arg4=4<arg.length?cElementType.empty===arg[4].type?new cNumber(1):arg[4].tocNumber():new cNumber(-1);var argError;if(argError=this._checkErrorArg([arg0,arg1,arg2,arg3,arg4]))return argError;arg1=arg1.getValue();arg2=arg2.getValue();arg3=arg3.getValue();arg4=arg4.getValue();if(arg3==0||arg4==0)return new cError(cErrorType.bad_reference);var res;if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type||cElementType.cellsRange===arg0.type|| cElementType.cellsRange3D===arg0.type){var box=arg0.getBBox0();if(box){box=box.clone(true);box.c1=box.c1+arg2;box.r1=box.r1+arg1;box.c2=box.c2+arg2;box.r2=box.r2+arg1;if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type){if(arg.length>3){if(arg4<0)box.c1=box.c1+arg4+1;else box.c2=box.c1+arg4-1;if(arg3<0)box.r1=box.r1+arg3+1;else box.r2=box.r1+arg3-1}}else if(arg.length>3){if(arg4<0){box.c1=box.c1+arg4+1;box.c2=box.c1-arg4-1}else box.c2=box.c1+arg4-1;if(arg3<0){box.r1=box.r1+arg3+1;box.r2= box.r1-arg3-1}else box.r2=box.r1+arg3-1}if(!validBBOX(box))return new cError(cErrorType.bad_reference);var name;AscCommonExcel.executeInR1C1Mode(false,function(){name=box.getName()});var ws=arg0.getWS();var wsCell=arguments[3];if(box.isOneCell())res=wsCell===ws?new cRef(name,ws):new cRef3D(name,ws);else res=wsCell===ws?new cArea(name,ws):new cArea3D(name,ws,ws)}}if(!res)res=new cError(cErrorType.wrong_value_type);return res};function cROW(){}cROW.prototype=Object.create(cBaseFunction.prototype);cROW.prototype.constructor= cROW;cROW.prototype.name="ROW";cROW.prototype.argumentsMax=1;cROW.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.setArrayRefAsArg;cROW.prototype.argumentsType=[argType.reference];cROW.prototype.Calculate=function(arg){var bbox;var res;var opt_row=arguments[5];if(opt_row!==undefined)return new cNumber(opt_row+1);else if(0===arg.length){bbox=arguments[1];res=bbox?new cNumber(bbox.r1+1):null}else{var arg0=arg[0];if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type){bbox=arg0.getRange(); bbox=bbox&&bbox.bbox;res=bbox?new cNumber(bbox.r1+1):null}else if(cElementType.cellsRange===arg0.type||cElementType.cellsRange3D===arg0.type){bbox=arg0.getRange();bbox=bbox&&bbox.bbox;if(bbox&&bbox.r2>bbox.r1){res=new cArray;for(var i=bbox.r1;i<=bbox.r2;i++){res.addRow();res.addElement(new cNumber(i+1))}}else res=bbox?new cNumber(bbox.r1+1):null}}return res?res:new cError(cErrorType.bad_reference)};function cROWS(){}cROWS.prototype=Object.create(cBaseFunction.prototype);cROWS.prototype.constructor= cROWS;cROWS.prototype.name="ROWS";cROWS.prototype.argumentsMin=1;cROWS.prototype.argumentsMax=1;cROWS.prototype.arrayIndexes={0:1};cROWS.prototype.argumentsType=[argType.reference];cROWS.prototype.Calculate=function(arg){var arg0=arg[0];var range;if(cElementType.array===arg0.type)return new cNumber(arg0.getRowCount());else if(cElementType.cellsRange===arg0.type||cElementType.cell===arg0.type||cElementType.cell3D===arg0.type||cElementType.cellsRange3D===arg0.type)range=arg0.getRange();return range? new cNumber(Math.abs(range.getBBox0().r1-range.getBBox0().r2)+1):new cError(cErrorType.wrong_value_type)};function cRTD(){}cRTD.prototype=Object.create(cBaseFunction.prototype);cRTD.prototype.constructor=cRTD;cRTD.prototype.name="RTD";cRTD.prototype.argumentsType=[argType.text,argType.text,[argType.text]];function cTRANSPOSE(){}cTRANSPOSE.prototype=Object.create(cBaseFunction.prototype);cTRANSPOSE.prototype.constructor=cTRANSPOSE;cTRANSPOSE.prototype.name="TRANSPOSE";cTRANSPOSE.prototype.argumentsMin= 1;cTRANSPOSE.prototype.argumentsMax=1;cTRANSPOSE.prototype.numFormat=AscCommonExcel.cNumFormatNone;cTRANSPOSE.prototype.arrayIndexes={0:1};cTRANSPOSE.prototype.argumentsType=[argType.any];cTRANSPOSE.prototype.Calculate=function(arg){function TransposeMatrix(A){var tMatrix=[],res=new cArray;for(var i=0;i<A.length;i++)for(var j=0;j<A[i].length;j++){if(!tMatrix[j])tMatrix[j]=[];tMatrix[j][i]=A[i][j]}res.fillFromArray(tMatrix);return res}var arg0=arg[0];if(cElementType.cellsRange===arg0.type)if(!this.bArrayFormula)arg0= arg0.cross(arguments[1]);else arg0=arg0.getMatrix();else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.getMatrix()[0];else if(cElementType.array===arg0.type)arg0=arg0.getMatrix();else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)return arg0.getValue();else if(cElementType.number===arg0.type||cElementType.string===arg0.type||cElementType.bool===arg0.type||cElementType.error===arg0.type)return arg0;else return new cError(cErrorType.not_available);if(cElementType.error===arg0.type)return arg0; if(0===arg0.length)return new cError(cErrorType.wrong_value_type);return TransposeMatrix(arg0)};function cUNIQUE(){}cUNIQUE.prototype=Object.create(cBaseFunction.prototype);cUNIQUE.prototype.constructor=cUNIQUE;cUNIQUE.prototype.name="UNIQUE";cUNIQUE.prototype.argumentsMin=1;cUNIQUE.prototype.argumentsMax=3;cUNIQUE.prototype.arrayIndexes={0:1};cUNIQUE.prototype.argumentsType=[argType.reference,argType.logical,argType.logical];cUNIQUE.prototype.isXLFN=true;cUNIQUE.prototype.numFormat=AscCommonExcel.cNumFormatNone; cUNIQUE.prototype.Calculate=function(arg){var _getUniqueArr=function(_arr,_byCol,_exactlyOnce){var rowCount=_arr&&_arr.length;var colCount=_arr&&_arr[0]&&_arr[0].length;if(!rowCount||!colCount)return cError(cErrorType.wrong_value_type);var res=new cArray;var repeateArr=[];var i,j,n,_value;var resArr=[];var _key;if(!_byCol){var _rowCount=0;for(i=0;i<rowCount;i++){_key="";for(j=0;j<colCount;j++){_value=_arr[i][j].getValue();_key+=_value+";";if(j===colCount-1)if(!repeateArr[_key]){repeateArr[_key]={index:_rowCount, count:1};for(n=0;n<colCount;n++){if(!resArr[_rowCount])resArr[_rowCount]=[];resArr[_rowCount].push(_arr[i][n])}_rowCount++}else repeateArr[_key].count++}}}else{var _colCount=0;for(i=0;i<colCount;i++){_key="";for(j=0;j<rowCount;j++){_value=_arr[j][i].getValue();_key+=_value+";";if(j===rowCount-1)if(!repeateArr[_key]){repeateArr[_key]={index:_colCount,count:1};for(n=0;n<rowCount;n++){if(!resArr[n])resArr[n]=[];resArr[n][_colCount]=_arr[n][i]}_colCount++}else repeateArr[_key].count++}}}if(_exactlyOnce){var tempArr= [];var _counter=0;for(i in repeateArr){var _elem=repeateArr[i];if(_elem.count>1)continue;if(!_byCol)tempArr[_counter]=resArr[_elem.index];else for(j=0;j<rowCount;j++){if(!tempArr[j])tempArr[j]=[];tempArr[j][_counter]=resArr[j][_elem.index]}_counter++}resArr=tempArr}if(!resArr.length)return new cError(cErrorType.wrong_value_type);res.fillFromArray(resArr);return res};var arg0=arg[0];if(cElementType.cellsRange===arg0.type)arg0=arg0.getMatrix();else if(cElementType.cellsRange3D===arg0.type)arg0=arg0.getMatrix()[0]; else if(cElementType.array===arg0.type)arg0=arg0.getMatrix();else if(cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)return arg0.getValue();else if(cElementType.number===arg0.type||cElementType.string===arg0.type||cElementType.bool===arg0.type||cElementType.error===arg0.type)return arg0;else return new cError(cErrorType.not_available);if(cElementType.error===arg0.type)return arg0;if(0===arg0.length)return new cError(cErrorType.wrong_value_type);var arg1=!arg[1]?false:arg[1].tocBool(); if(arg1&&cElementType.error===arg1.type)return arg1;else if(arg1)arg1=arg1.toBool();var arg2=!arg[2]?false:arg[2].tocBool();if(arg2&&cElementType.error===arg2.type)return arg2;else if(arg2)arg2=arg2.toBool();return _getUniqueArr(arg0,arg1,arg2)};function VHLOOKUPCache(bHor){this.cacheId={};this.cacheRanges={};this.bHor=bHor}VHLOOKUPCache.prototype.calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2];var arg3=arg[3]?arg[3].tocBool().value:true;var t=this,number=arg2.getValue()-1,valueForSearching, r,c,res=-1,min,regexp,count;if(cElementType.array===arg2.type){var arg2Val=arg2.getElementRowCol(0,0);number=arg2Val?arg2Val.getValue()-1:number}if(isNaN(number))return new cError(cErrorType.bad_reference);if(number<0)return new cError(cErrorType.wrong_value_type);if(cElementType.cell3D===arg0.type||cElementType.cell===arg0.type)arg0=arg0.getValue();if(cElementType.error===arg0.type)return arg0;var arg0Val;if(cElementType.array===arg0.type){arg0Val=arg0.getElementRowCol(0,0);valueForSearching=(""+ arg0Val.getValue()).toLowerCase()}else{arg0Val=arg0;valueForSearching=(""+arg0.getValue()).toLowerCase()}var found=false;if(cElementType.array===arg1.type){if(cElementType.string===arg0.type)regexp=searchRegExp(valueForSearching);arg1.foreach(function(elem,r,c){var v=(""+elem.getValue()).toLowerCase();var i=t.bHor?c:r;if(0===i)min=v;if(arg3)if(valueForSearching===v){res=i;found=true}else{if(valueForSearching>v&&!found)res=i}else if(cElementType.string===arg0.type){if(regexp.test(v))res=i}else if(valueForSearching=== v)res=i;min=Math.min(min,v)});if(-1===res)return new cError(cErrorType.not_available);count=this.bHor?arg1.getRowCount():arg1.getCountElementInRow();if(number>count-1)return new cError(cErrorType.bad_reference);r=this.bHor?number:res;c=this.bHor?res:number;return arg1.getElementRowCol(r,c)}var range;if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type||cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type)range=arg1.getRange();if(!range)return new cError(cErrorType.bad_reference); var bb=range.getBBox0();count=this.bHor?bb.r2-bb.r1:bb.c2-bb.c1;if(number>count)return new cError(cErrorType.bad_reference);var ws=arg1.getWS();r=this.bHor?bb.r1:bb.r2;c=this.bHor?bb.c2:bb.c1;var oSearchRange=ws.getRange3(bb.r1,bb.c1,r,c);if(cElementType.cellsRange===arg0Val.type)arg0Val=arg0Val.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0Val.type)arg0Val=arg0Val.cross(arguments[1]);if(cElementType.error===arg0Val.type)return arg0;res=this._get(oSearchRange,arg0Val,arg3);if(-1===res)return new cError(cErrorType.not_available); r=this.bHor?bb.r1+number:res;c=this.bHor?res:bb.c1+number;var resVal;arg1.getWS()._getCellNoEmpty(r,c,function(cell){resVal=checkTypeCell(cell)});if(cElementType.empty===resVal.type)resVal=new cNumber(0);return resVal};VHLOOKUPCache.prototype._get=function(range,valueForSearching,arg3Value){var res,_this=this,wsId=range.getWorksheet().getId();var sRangeName;AscCommonExcel.executeInR1C1Mode(false,function(){sRangeName=wsId+g_cCharDelimiter+range.getName()});var cacheElem=this.cacheId[sRangeName];if(!cacheElem){cacheElem= {elements:[],results:{}};range._foreachNoEmpty(function(cell,r,c){cacheElem.elements.push({v:checkTypeCell(cell),i:_this.bHor?c:r})});this.cacheId[sRangeName]=cacheElem;var cacheRange=this.cacheRanges[wsId];if(!cacheRange){cacheRange=new AscCommonExcel.RangeDataManager(null);this.cacheRanges[wsId]=cacheRange}cacheRange.add(range.getBBox0(),cacheElem)}var sInputKey=valueForSearching.getValue()+g_cCharDelimiter+arg3Value+g_cCharDelimiter+valueForSearching.type;res=cacheElem.results[sInputKey];if(!res)cacheElem.results[sInputKey]= res=this._calculate(cacheElem.elements,valueForSearching,arg3Value);return res};VHLOOKUPCache.prototype._calculate=function(cacheArray,valueForSearching,lookup){var res=-1,i=0,j,length=cacheArray.length,k,elem,val;var _compareValues=function(val1,val2,op){var res=_func[val1.type][val2.type](val1,val2,op);return res?res.value:false};var simpleSearch=function(){for(;i<length;i++){elem=cacheArray[i];val=elem.v;if(_compareValues(valueForSearching,val,"="))return elem.i}return-1};if(lookup){j=length-1; while(i<=j){k=Math.floor((i+j)/2);elem=cacheArray[k];val=elem.v;if(_compareValues(valueForSearching,val,"="))return elem.i;else if(_compareValues(valueForSearching,val,"<"))j=k-1;else i=k+1}res=Math.min(i,j);res=-1===res?res:cacheArray[res].i;if(res===-1&&cElementType.string===valueForSearching.type)res=simpleSearch()}else res=simpleSearch();return res};VHLOOKUPCache.prototype.remove=function(cell){var wsId=cell.ws.getId();var cacheRange=this.cacheRanges[wsId];if(cacheRange){var oGetRes=cacheRange.get(new Asc.Range(cell.nCol, cell.nRow,cell.nCol,cell.nRow));for(var i=0,length=oGetRes.all.length;i<length;++i){var elem=oGetRes.all[i];elem.data.results={}}}};VHLOOKUPCache.prototype.clean=function(){this.cacheId={};this.cacheRanges={}};function MatchCache(){this.cacheId={};this.cacheRanges={}}MatchCache.prototype=Object.create(VHLOOKUPCache.prototype);MatchCache.prototype.constructor=MatchCache;MatchCache.prototype.calculate=function(arg,_arg1){var arg0=arg[0],arg1=arg[1],arg2=arg[2]?arg[2]:new cNumber(1);if(cElementType.cellsRange3D=== arg0.type||cElementType.cellsRange===arg0.type)arg0=arg0.cross(_arg1);else if(cElementType.array===arg0.type)arg0=arg0.getElementRowCol(0,0);else if(cElementType.error===arg0.type)return arg0;if(cElementType.number===arg2.type||cElementType.bool===arg2.type);else if(cElementType.error===arg2.type)return arg2;else return new cError(cErrorType.not_available);var a2Value=arg2.getValue();if(!(-1===a2Value||0===a2Value||1===a2Value))return new cError(cErrorType.not_numeric);if(cElementType.error===arg1.type)return new cError(cErrorType.not_available); else if(cElementType.array===arg1.type){arg1=arg1.getMatrix();var i,a1RowCount=arg1.length,a1ColumnCount=arg1[0].length,arr;if(a1RowCount>1&&a1ColumnCount>1)return new cError(cErrorType.not_available);else if(a1RowCount===1&&a1ColumnCount>=1)arr=arg1[0];else{arr=[];for(i=0;i<a1RowCount;i++)arr[i]=arg1[i][0]}return this._calculate(arr,arg0,arg2)}if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type||cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type){var oSearchRange= arg1.getRange();if(!oSearchRange)return new cError(cErrorType.bad_reference);var a1RowCount=oSearchRange.bbox.r2-oSearchRange.bbox.r1+1,a1ColumnCount=oSearchRange.bbox.c2-oSearchRange.bbox.c1+1;var bHor=false;if(a1RowCount>1&&a1ColumnCount>1)return new cError(cErrorType.not_available);else if(a1RowCount===1&&a1ColumnCount>=1)bHor=true;return this._get(oSearchRange,arg0,arg2,bHor)}else return new cError(cErrorType.not_available)};MatchCache.prototype._get=function(range,arg0,arg2,bHor){var res,_this= this,wsId=range.getWorksheet().getId(),sRangeName=wsId+g_cCharDelimiter+range.getName(),cacheElem=this.cacheId[sRangeName];var arg2Value=arg2.getValue();var valueForSearching=arg0.getValue();if(!cacheElem){cacheElem={elements:[],results:{}};range._foreachNoEmpty(function(cell,r,c){cacheElem.elements.push({v:checkTypeCell(cell),i:bHor?c-range.bbox.c1:r-range.bbox.r1})});this.cacheId[sRangeName]=cacheElem;var cacheRange=this.cacheRanges[wsId];if(!cacheRange){cacheRange=new AscCommonExcel.RangeDataManager(null); this.cacheRanges[wsId]=cacheRange}cacheRange.add(range.getBBox0(),cacheElem)}var sInputKey=valueForSearching+g_cCharDelimiter+arg2Value;res=cacheElem.results[sInputKey];if(!res)cacheElem.results[sInputKey]=res=this._calculate(cacheElem.elements,arg0,arg2);return res};MatchCache.prototype._calculate=function(arr,a0,a2){var a2Value=a2.getValue();var a0Type=a0.type;var a0Value=a0.getValue();if(!(cElementType.number===a0Type||cElementType.string===a0Type||cElementType.bool===a0Type||cElementType.error=== a0Type||cElementType.empty===a0Type)){if(cElementType.empty===a0Value.type)a0Value=a0Value.tocNumber();a0Type=a0Value.type;a0Value=a0Value.getValue()}var item,index=-1,curIndex;for(var i=0;i<arr.length;++i){item=undefined!==arr[i].v?arr[i].v:arr[i];curIndex=undefined!==arr[i].i?arr[i].i:i;if(item.type===a0Type)if(0===a2Value)if(cElementType.string===a0Type){if(AscCommonExcel.searchRegExp2(item.toString(),a0Value)){index=curIndex;break}}else{if(item==a0Value){index=curIndex;break}}else if(1===a2Value)if(item<= a0Value)index=curIndex;else break;else if(-1===a2Value)if(item>=a0Value)index=curIndex;else break}return-1<index?new cNumber(index+1):new cError(cErrorType.not_available)};function LOOKUPCache(){this.cacheId={};this.cacheRanges={}}LOOKUPCache.prototype=Object.create(VHLOOKUPCache.prototype);LOOKUPCache.prototype.constructor=LOOKUPCache;LOOKUPCache.prototype.calculate=function(arg){var arg0=arg[0],arg1=arg[1];var t=this,r,c,count;if(cElementType.cell3D===arg0.type||cElementType.cell===arg0.type)arg0= arg0.getValue();if(cElementType.error===arg0.type)return arg0;var arg0Val;if(cElementType.array===arg0.type)arg0Val=arg0.getElementRowCol(0,0);else arg0Val=arg0;var range;if(cElementType.cell===arg1.type||cElementType.cell3D===arg1.type||cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type)range=arg1.getRange();if(!range)return new cError(cErrorType.bad_reference);var bb=range.getBBox0();var bHor=bb.r2-bb.r1<bb.c2-bb.c1;var ws=arg1.getWS();r=bHor?bb.r1:bb.r2;c=bHor?bb.c2:bb.c1; var oSearchRange=ws.getRange3(bb.r1,bb.c1,r,c);if(cElementType.cellsRange===arg0Val.type)arg0Val=arg0Val.cross(arguments[1]);else if(cElementType.cellsRange3D===arg0Val.type)arg0Val=arg0Val.cross(arguments[1]);if(cElementType.error===arg0Val.type)return arg0;var res=this._get(oSearchRange,arg0Val,true);if(-1===res)return new cError(cErrorType.not_available);return res};LOOKUPCache.prototype._calculate=function(cacheArray,valueForSearching,lookup){var res=-1,i=0,j,length=cacheArray.length,k,elem,val; var _compareValues=function(val1,val2,op){var res=_func[val1.type][val2.type](val1,val2,op);return res?res.value:false};if(lookup){j=length-1;while(i<=j){k=Math.floor((i+j)/2);elem=cacheArray[k];val=elem.v;if(_compareValues(valueForSearching,val,"="))return k;else if(_compareValues(valueForSearching,val,"<"))j=k-1;else i=k+1}res=Math.min(i,j)}else for(;i<length;i++){elem=cacheArray[i];val=elem.v;if(_compareValues(valueForSearching,val,"="))return i}return res};function cVLOOKUP(){}cVLOOKUP.prototype= Object.create(cBaseFunction.prototype);cVLOOKUP.prototype.constructor=cVLOOKUP;cVLOOKUP.prototype.name="VLOOKUP";cVLOOKUP.prototype.argumentsMin=3;cVLOOKUP.prototype.argumentsMax=4;cVLOOKUP.prototype.arrayIndexes={1:1,2:{0:0}};cVLOOKUP.prototype.numFormat=AscCommonExcel.cNumFormatNone;cVLOOKUP.prototype.argumentsType=[argType.any,argType.number,argType.number,argType.logical];cVLOOKUP.prototype.Calculate=function(arg){if(this.bArrayFormula)if(cElementType.cellsRange3D===arg[2].type||cElementType.cellsRange=== arg[2].type)arg[2]=arg[2].getValue2(0,0);else if(cElementType.array===arg[2].type)arg[2]=arg[2].getValue2(0,0);return g_oVLOOKUPCache.calculate(arg,arguments[1])};var g_oVLOOKUPCache=new VHLOOKUPCache(false);var g_oHLOOKUPCache=new VHLOOKUPCache(true);var g_oMatchCache=new MatchCache;var g_oLOOKUPCache=new LOOKUPCache;window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].g_oVLOOKUPCache=g_oVLOOKUPCache;window["AscCommonExcel"].g_oHLOOKUPCache=g_oHLOOKUPCache;window["AscCommonExcel"].g_oMatchCache= g_oMatchCache})(window);"use strict";(function(window,undefined){var cErrorType=AscCommonExcel.cErrorType;var cNumber=AscCommonExcel.cNumber;var cString=AscCommonExcel.cString;var cBool=AscCommonExcel.cBool;var cEmpty=AscCommonExcel.cEmpty;var cError=AscCommonExcel.cError;var cArea=AscCommonExcel.cArea;var cArea3D=AscCommonExcel.cArea3D;var cRef=AscCommonExcel.cRef;var cRef3D=AscCommonExcel.cRef3D;var cArray=AscCommonExcel.cArray;var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup= AscCommonExcel.cFormulaFunctionGroup;var cElementType=AscCommonExcel.cElementType;var argType=Asc.c_oAscFormulaArgumentType;function getCellFormat(ws,row,col){var res=new cString("G");var formatInfo,sFormat,numFormat;ws.getCell3(row,col)._foreachNoEmpty(function(cell){numFormat=cell?cell.getNumFormat():null;formatInfo=numFormat?numFormat.getTypeInfo():null;sFormat=numFormat?numFormat.sFormat:null});if(formatInfo){var postfix="";if(numFormat&&(numFormat.oNegativeFormat&&numFormat.oNegativeFormat.Color!== -1))postfix+="-";if(numFormat&&numFormat.oPositiveFormat&&numFormat.oPositiveFormat.formatString.indexOf("(")!=-1)postfix+="()";var formatPart;if(formatInfo.type===Asc.c_oAscNumFormatType.Number)formatPart="F";else if(formatInfo.type===Asc.c_oAscNumFormatType.Currency||formatInfo.type===Asc.c_oAscNumFormatType.Accounting)formatPart="\u0421";else if(formatInfo.type===Asc.c_oAscNumFormatType.Percent)formatPart="P";else if(formatInfo.type===Asc.c_oAscNumFormatType.Scientific)formatPart="S";if(formatPart)res= new cString(formatPart+formatInfo.decimalPlaces+postfix)}return res}function getNumFormat(ws,row,col){var numFormat=null;ws.getCell3(row,col)._foreachNoEmpty(function(cell){numFormat=cell?cell.getNumFormat():null});return numFormat}cFormulaFunctionGroup["Information"]=cFormulaFunctionGroup["Information"]||[];cFormulaFunctionGroup["Information"].push(cCell,cERROR_TYPE,cISBLANK,cISERR,cISERROR,cISEVEN,cISFORMULA,cISLOGICAL,cISNA,cISNONTEXT,cISNUMBER,cISODD,cISREF,cISTEXT,cN,cNA,cSHEET,cSHEETS,cTYPE); function cCell(){}cCell.prototype=Object.create(cBaseFunction.prototype);cCell.prototype.constructor=cCell;cCell.prototype.name="CELL";cCell.prototype.argumentsMin=2;cCell.prototype.argumentsMax=2;cCell.prototype.ca=true;cCell.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.area_to_ref;cCell.prototype.argumentsType=[argType.text,argType.reference];cCell.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws){var arg0=arg[0];var arg1=arg[1];arg0=arg0.tocString();if(arg0 instanceof cError)return arg0; else{var str=arg0.toString().toUpperCase();var cell,bbox;if(arg1){if(cElementType.array===arg1.type)arg1=arg1.getElementRowCol(0,0);var isRangeArg1=cElementType.cellsRange===arg1.type||cElementType.cellsRange3D===arg1.type;if(isRangeArg1||cElementType.cell===arg1.type||cElementType.cell3D===arg1.type){var _tempValue=isRangeArg1?arg1.getValueByRowCol(0,0):arg1.getValue();if(_tempValue instanceof cError)return _tempValue;bbox=arg1.getRange();bbox=bbox&&bbox.bbox}else return new cError(cErrorType.wrong_name)}var res, numFormat;switch(str){case "COL":{res=new cNumber(bbox.c1+1);break}case "ROW":{res=new cNumber(bbox.r1+1);break}case "SHEET":{res=new cNumber(1);break}case "ADDRESS":{res=new Asc.Range(bbox.c1,bbox.r1,bbox.c1,bbox.r1);res=new cString(res.getAbsName());break}case "FILENAME":{var docInfo=window["Asc"]["editor"].DocInfo;var fileName=docInfo?docInfo.get_Title():"";var _ws=arg1.getWS();var sheetName=_ws?_ws.getName():null;if(sheetName)res=new cString("["+fileName+"]"+sheetName);else res=new cEmpty;break}case "COORD":{break}case "CONTENTS":{if(cElementType.cell=== arg1.type||cElementType.cell3D===arg1.type)res=arg1.getValue();else{res=arg1.getValue()[0];if(!res)res=new cNumber(0)}break}case "TYPE":{res=arg1.getValue();if(res.type===cElementType.empty)res=new cString("b");else if(res.type===cElementType.string)res=new cString("l");else res=new cString("v");break}case "WIDTH":{var col=ws._getCol(bbox.c1);var props=col?col.getWidthProp():null;var isDefault=!props.CustomWidth;var width,colWidthPx;if(isDefault){var defaultColWidthChars=ws.charCountToModelColWidth(ws.getBaseColWidth()); colWidthPx=ws.modelColWidthToColWidth(defaultColWidthChars);colWidthPx=Asc.ceil(colWidthPx/8)*8;width=ws.colWidthToCharCount(colWidthPx)}else{colWidthPx=ws.modelColWidthToColWidth(props.width);width=ws.colWidthToCharCount(colWidthPx)}if(props){res=new cArray;res.addElement(new cNumber(Math.round(width)));res.addElement(new cBool(isDefault))}break}case "PREFIX":{cell=ws.getCell3(bbox.r1,bbox.c1);var align=cell.getAlign();var alignHorizontal=align.getAlignHorizontal();if(cell.isNullTextString())res= new cString("");else if(alignHorizontal===null||alignHorizontal===AscCommon.align_Left)res=new cString("'");else if(alignHorizontal===AscCommon.align_Right)res=new cString('"');else if(alignHorizontal===AscCommon.align_Center)res=new cString("^");else res=new cString("");break}case "PROTECT":{res=new cNumber(1);break}case "FORMAT":{res=getCellFormat(ws,bbox.r1,bbox.c1);break}case "COLOR":{numFormat=getNumFormat(ws,bbox.r1,bbox.c1);if(numFormat&&(numFormat.oNegativeFormat&&numFormat.oNegativeFormat.Color!== -1))res=new cNumber(1);else res=new cNumber(0);break}case "PARENTHESES":{numFormat=getNumFormat(ws,bbox.r1,bbox.c1);if(numFormat&&numFormat.oPositiveFormat&&numFormat.oPositiveFormat.formatString.indexOf("(")!=-1)res=new cNumber(1);else res=new cNumber(0);break}default:{return new cError(cErrorType.wrong_value_type)}}return res?res:new cError(cErrorType.wrong_value_type)}};function cERROR_TYPE(){}cERROR_TYPE.prototype=Object.create(cBaseFunction.prototype);cERROR_TYPE.prototype.constructor=cERROR_TYPE; cERROR_TYPE.prototype.name="ERROR.TYPE";cERROR_TYPE.prototype.argumentsMin=1;cERROR_TYPE.prototype.argumentsMax=1;cERROR_TYPE.prototype.argumentsType=[argType.any];cERROR_TYPE.prototype.Calculate=function(arg){function typeError(elem){if(elem instanceof cError)switch(elem.errorType){case cErrorType.null_value:return new cNumber(1);case cErrorType.division_by_zero:return new cNumber(2);case cErrorType.wrong_value_type:return new cNumber(3);case cErrorType.bad_reference:return new cNumber(4);case cErrorType.wrong_name:return new cNumber(5); case cErrorType.not_numeric:return new cNumber(6);case cErrorType.not_available:return new cNumber(7);case cErrorType.getting_data:return new cNumber(8);default:return new cError(cErrorType.not_available)}else return new cError(cErrorType.not_available)}var arg0=arg[0];if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cArray){var ret=new cArray;arg0.foreach(function(elem, r,c){if(!ret.array[r])ret.addRow();ret.addElement(typeError(elem))});return ret}return typeError(arg0)};function cISBLANK(){}cISBLANK.prototype=Object.create(cBaseFunction.prototype);cISBLANK.prototype.constructor=cISBLANK;cISBLANK.prototype.name="ISBLANK";cISBLANK.prototype.argumentsMin=1;cISBLANK.prototype.argumentsMax=1;cISBLANK.prototype.argumentsType=[argType.any];cISBLANK.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]); else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof AscCommonExcel.cEmpty)return new cBool(true);else return new cBool(false)};function cISERR(){}cISERR.prototype=Object.create(cBaseFunction.prototype);cISERR.prototype.constructor=cISERR;cISERR.prototype.name="ISERR";cISERR.prototype.argumentsMin=1;cISERR.prototype.argumentsMax=1;cISERR.prototype.argumentsType=[argType.any];cISERR.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0= arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cError&&arg0.errorType!=cErrorType.not_available)return new cBool(true);else return new cBool(false)};function cISERROR(){}cISERROR.prototype=Object.create(cBaseFunction.prototype);cISERROR.prototype.constructor=cISERROR;cISERROR.prototype.name="ISERROR";cISERROR.prototype.argumentsMin=1;cISERROR.prototype.argumentsMax= 1;cISERROR.prototype.argumentsType=[argType.any];cISERROR.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cError)return new cBool(true);else return new cBool(false)};function cISEVEN(){}cISEVEN.prototype=Object.create(cBaseFunction.prototype);cISEVEN.prototype.constructor= cISEVEN;cISEVEN.prototype.name="ISEVEN";cISEVEN.prototype.argumentsMin=1;cISEVEN.prototype.argumentsMax=1;cISEVEN.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cISEVEN.prototype.argumentsType=[argType.any];cISEVEN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue(); if(arg0 instanceof cError)return arg0;arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else return new cBool((arg0.getValue()&1)==0)};function cISFORMULA(){}cISFORMULA.prototype=Object.create(cBaseFunction.prototype);cISFORMULA.prototype.constructor=cISFORMULA;cISFORMULA.prototype.name="ISFORMULA";cISFORMULA.prototype.argumentsMin=1;cISFORMULA.prototype.argumentsMax=1;cISFORMULA.prototype.isXLFN=true;cISFORMULA.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.area_to_ref;cISFORMULA.prototype.argumentsType= [argType.reference];cISFORMULA.prototype.Calculate=function(arg){var arg0=arg[0];var res=false;if((arg0 instanceof cArea||arg0 instanceof cArea3D)&&arg0.range)res=arg0.range.isFormula();else if((arg0 instanceof cRef||arg0 instanceof cRef3D)&&arg0.range)res=arg0.range.isFormula();if(arg0 instanceof cError)return arg0;return new cBool(res)};function cISLOGICAL(){}cISLOGICAL.prototype=Object.create(cBaseFunction.prototype);cISLOGICAL.prototype.constructor=cISLOGICAL;cISLOGICAL.prototype.name="ISLOGICAL"; cISLOGICAL.prototype.argumentsMin=1;cISLOGICAL.prototype.argumentsMax=1;cISLOGICAL.prototype.argumentsType=[argType.any];cISLOGICAL.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cBool)return new cBool(true);else return new cBool(false)};function cISNA(){}cISNA.prototype= Object.create(cBaseFunction.prototype);cISNA.prototype.constructor=cISNA;cISNA.prototype.name="ISNA";cISNA.prototype.argumentsMin=1;cISNA.prototype.argumentsMax=1;cISNA.prototype.argumentsType=[argType.any];cISNA.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cError&&arg0.errorType== cErrorType.not_available)return new cBool(true);else return new cBool(false)};function cISNONTEXT(){}cISNONTEXT.prototype=Object.create(cBaseFunction.prototype);cISNONTEXT.prototype.constructor=cISNONTEXT;cISNONTEXT.prototype.name="ISNONTEXT";cISNONTEXT.prototype.argumentsMin=1;cISNONTEXT.prototype.argumentsMax=1;cISNONTEXT.prototype.argumentsType=[argType.any];cISNONTEXT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea|| arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(!(arg0 instanceof cString))return new cBool(true);else return new cBool(false)};function cISNUMBER(){}cISNUMBER.prototype=Object.create(cBaseFunction.prototype);cISNUMBER.prototype.constructor=cISNUMBER;cISNUMBER.prototype.name="ISNUMBER";cISNUMBER.prototype.argumentsMin=1;cISNUMBER.prototype.argumentsMax=1;cISNUMBER.prototype.argumentsType=[argType.any];cISNUMBER.prototype.Calculate= function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cNumber)return new cBool(true);else return new cBool(false)};function cISODD(){}cISODD.prototype=Object.create(cBaseFunction.prototype);cISODD.prototype.constructor=cISODD;cISODD.prototype.name="ISODD";cISODD.prototype.argumentsMin=1;cISODD.prototype.argumentsMax= 1;cISODD.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cISODD.prototype.argumentsType=[argType.any];cISODD.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cError)return arg0;arg0=arg0.tocNumber();if(arg0 instanceof cError)return arg0;else return new cBool((arg0.getValue()& 1)==1)};function cISREF(){}cISREF.prototype=Object.create(cBaseFunction.prototype);cISREF.prototype.constructor=cISREF;cISREF.prototype.name="ISREF";cISREF.prototype.argumentsMin=1;cISREF.prototype.argumentsMax=1;cISREF.prototype.arrayIndexes={0:1};cISREF.prototype.argumentsType=[argType.any];cISREF.prototype.Calculate=function(arg){if((arg[0]instanceof cRef||arg[0]instanceof cArea||arg[0]instanceof cArea3D||arg[0]instanceof cRef3D)&&arg[0].isValid&&arg[0].isValid())return new cBool(true);else return new cBool(false)}; function cISTEXT(){}cISTEXT.prototype=Object.create(cBaseFunction.prototype);cISTEXT.prototype.constructor=cISTEXT;cISTEXT.prototype.name="ISTEXT";cISTEXT.prototype.argumentsMin=1;cISTEXT.prototype.argumentsMax=1;cISTEXT.prototype.argumentsType=[argType.any];cISTEXT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0= arg0.getValue();if(arg0 instanceof cString)return new cBool(true);else return new cBool(false)};function cN(){}cN.prototype=Object.create(cBaseFunction.prototype);cN.prototype.constructor=cN;cN.prototype.name="N";cN.prototype.argumentsMin=1;cN.prototype.argumentsMax=1;cN.prototype.numFormat=AscCommonExcel.cNumFormatNone;cN.prototype.arrayIndexes={0:1};cN.prototype.argumentsType=[argType.any];cN.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray){arg0.foreach(function(elem, r,c){if(elem instanceof cNumber||elem instanceof cError)this.array[r][c]=elem;else if(elem instanceof cBool)this.array[r][c]=elem.tocNumber();else this.array[r][c]=new cNumber(0)});return arg0}else if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cNumber||arg0 instanceof cError)return arg0;else if(arg0 instanceof cBool)return arg0.tocNumber();else return new cNumber(0)};function cNA(){} cNA.prototype=Object.create(cBaseFunction.prototype);cNA.prototype.constructor=cNA;cNA.prototype.name="NA";cNA.prototype.argumentsMax=0;cNA.prototype.argumentsType=null;cNA.prototype.Calculate=function(){return new cError(cErrorType.not_available)};function cSHEET(){}cSHEET.prototype=Object.create(cBaseFunction.prototype);cSHEET.prototype.constructor=cSHEET;cSHEET.prototype.name="SHEET";cSHEET.prototype.argumentsMin=0;cSHEET.prototype.argumentsMax=1;cSHEET.prototype.isXLFN=true;cSHEET.prototype.returnValueType= AscCommonExcel.cReturnFormulaType.array;cSHEET.prototype.argumentsType=[argType.text];cSHEET.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws){var res=null;if(0===arg.length)res=new cNumber(ws.index+1);else{var arg0=arg[0];if(cElementType.error===arg0.type)res=arg0;else if(arg0.ws)res=new cNumber(arg0.ws.index+1);else if(arg0.wsFrom){var sheet1=arg0.wsFrom.index+1;var sheet2=arg0.wsTo.index+1;res=new cNumber(Math.min(sheet1,sheet2))}else if(cElementType.string===arg0.type){var arg0Val=arg0.getValue(); var curWorksheet=ws.workbook.getWorksheetByName(arg0Val);if(curWorksheet&&undefined!==curWorksheet.index)res=new cNumber(curWorksheet.index+1)}}if(null===res)res=new cError(cErrorType.wrong_value_type);return res};function cSHEETS(){}cSHEETS.prototype=Object.create(cBaseFunction.prototype);cSHEETS.prototype.constructor=cSHEETS;cSHEETS.prototype.name="SHEETS";cSHEETS.prototype.argumentsMin=0;cSHEETS.prototype.argumentsMax=1;cSHEETS.prototype.isXLFN=true;cSHEETS.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array; cSHEETS.prototype.argumentsType=[argType.reference];cSHEETS.prototype.Calculate=function(arg,opt_bbox,opt_defName,ws){var res;if(0===arg.length)res=new cNumber(ws.workbook.aWorksheets.length);else{var arg0=arg[0];if(cElementType.error===arg0.type)res=arg0;else if(cElementType.cellsRange===arg0.type||cElementType.cell===arg0.type||cElementType.cell3D===arg0.type)res=new cNumber(1);else if(cElementType.cellsRange3D===arg0.type){var sheet1=arg0.wsFrom.index;var sheet2=arg0.wsTo.index;if(sheet1===sheet2)res= new cNumber(1);else res=new cNumber(Math.abs(sheet2-sheet1)+1)}else res=new cError(cErrorType.not_available)}return res};function cTYPE(){}cTYPE.prototype=Object.create(cBaseFunction.prototype);cTYPE.prototype.constructor=cTYPE;cTYPE.prototype.name="TYPE";cTYPE.prototype.argumentsMin=1;cTYPE.prototype.argumentsMax=1;cTYPE.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.value_replace_area;cTYPE.prototype.arrayIndexes={0:1};cTYPE.prototype.argumentsType=[argType.any];cTYPE.prototype.Calculate= function(arg){var arg0=arg[0];if(arg0 instanceof cArea||arg0 instanceof cArea3D)if(this.bArrayFormula)arg0=arg[0].getValue();else arg0=arg0.cross(arguments[1]);else if(arg0 instanceof cRef||arg0 instanceof cRef3D)arg0=arg0.getValue();if(arg0 instanceof cNumber)return new cNumber(1);else if(arg0 instanceof cString)return new cNumber(2);else if(arg0 instanceof cBool)return new cNumber(4);else if(arg0 instanceof cError)return new cNumber(16);else return new cNumber(64)}})(window);"use strict";(function(window, undefined){var cErrorType=AscCommonExcel.cErrorType;var cNumber=AscCommonExcel.cNumber;var cString=AscCommonExcel.cString;var cBool=AscCommonExcel.cBool;var cError=AscCommonExcel.cError;var cArea=AscCommonExcel.cArea;var cArea3D=AscCommonExcel.cArea3D;var cEmpty=AscCommonExcel.cEmpty;var cArray=AscCommonExcel.cArray;var cBaseFunction=AscCommonExcel.cBaseFunction;var cFormulaFunctionGroup=AscCommonExcel.cFormulaFunctionGroup;var cElementType=AscCommonExcel.cElementType;var argType=Asc.c_oAscFormulaArgumentType; cFormulaFunctionGroup["Logical"]=cFormulaFunctionGroup["Logical"]||[];cFormulaFunctionGroup["Logical"].push(cAND,cFALSE,cIF,cIFERROR,cIFNA,cIFS,cNOT,cOR,cSWITCH,cTRUE,cXOR);function cAND(){}cAND.prototype=Object.create(cBaseFunction.prototype);cAND.prototype.constructor=cAND;cAND.prototype.name="AND";cAND.prototype.argumentsMin=1;cAND.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cAND.prototype.argumentsType=[[argType.logical]];cAND.prototype.Calculate=function(arg){var argResult= null;for(var i=0;i<arg.length;i++)if(arg[i]instanceof cArea||arg[i]instanceof cArea3D){var argArr=arg[i].getValue();for(var j=0;j<argArr.length;j++)if(argArr[j]instanceof cError)return argArr[j];else if(!(argArr[j]instanceof cString||argArr[j]instanceof cEmpty)){if(argResult===null)argResult=argArr[j].tocBool();else argResult=new cBool(argResult.value&&argArr[j].tocBool().value);if(argResult.value===false)return new cBool(false)}}else if(arg[i]instanceof cString)return new cError(cErrorType.wrong_value_type); else if(arg[i]instanceof cError)return arg[i];else if(arg[i]instanceof cArray)arg[i].foreach(function(elem){if(elem instanceof cError){argResult=elem;return true}else if(elem instanceof cString||elem instanceof cEmpty)return false;else{if(argResult===null)argResult=elem.tocBool();else argResult=new cBool(argResult.value&&elem.tocBool().value);if(argResult.value===false)return true}});else{if(argResult===null)argResult=arg[i].tocBool();else argResult=new cBool(argResult.value&&arg[i].tocBool().value); if(argResult.value===false)return new cBool(false)}if(argResult===null)return new cError(cErrorType.wrong_value_type);return argResult};function cFALSE(){}cFALSE.prototype=Object.create(cBaseFunction.prototype);cFALSE.prototype.constructor=cFALSE;cFALSE.prototype.name="FALSE";cFALSE.prototype.argumentsMax=0;cFALSE.prototype.argumentsType=null;cFALSE.prototype.Calculate=function(){return new cBool(false)};function cIF(){}cIF.prototype=Object.create(cBaseFunction.prototype);cIF.prototype.constructor= cIF;cIF.prototype.name="IF";cIF.prototype.argumentsMin=2;cIF.prototype.argumentsMax=3;cIF.prototype.numFormat=AscCommonExcel.cNumFormatNone;cIF.prototype.argumentsType=[argType.logical,argType.any,argType.any];cIF.prototype.Calculate=function(arg){var arg0=arg[0],arg1=arg[1],arg2=arg[2];if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg1 instanceof cArray)arg1=arg1.getElement(0);if(arg2 instanceof cArray)arg2=arg2.getElement(0);arg0=arg0.tocBool();if(arg0 instanceof cError)return arg0;else if(arg0 instanceof cString)return new cError(cErrorType.wrong_value_type);else if(arg0.value)return arg1?arg1 instanceof cEmpty?new cNumber(0):arg1:new cBool(true);else return arg2?arg2 instanceof cEmpty?new cNumber(0):arg2:new cBool(false)};function cIFERROR(){}cIFERROR.prototype=Object.create(cBaseFunction.prototype);cIFERROR.prototype.constructor=cIFERROR;cIFERROR.prototype.name="IFERROR";cIFERROR.prototype.argumentsMin=2;cIFERROR.prototype.argumentsMax=2;cIFERROR.prototype.argumentsType=[argType.any,argType.any]; cIFERROR.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg0 instanceof AscCommonExcel.cRef||arg0 instanceof AscCommonExcel.cRef3D)arg0=arg0.getValue();if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg0 instanceof cError)return arg[1]instanceof cArray?arg[1].getElement(0):arg[1];else return arg[0]};function cIFNA(){}cIFNA.prototype=Object.create(cBaseFunction.prototype);cIFNA.prototype.constructor=cIFNA;cIFNA.prototype.name= "IFNA";cIFNA.prototype.argumentsMin=2;cIFNA.prototype.argumentsMax=2;cIFNA.prototype.isXLFN=true;cIFNA.prototype.argumentsType=[argType.any,argType.any];cIFNA.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg0 instanceof AscCommonExcel.cRef||arg0 instanceof AscCommonExcel.cRef3D)arg0=arg0.getValue();if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg0 instanceof cError&&cErrorType.not_available===arg0.errorType)return arg[1]instanceof cArray?arg[1].getElement(0):arg[1];else return arg[0]};function cIFS(){}cIFS.prototype=Object.create(cBaseFunction.prototype);cIFS.prototype.constructor=cIFS;cIFS.prototype.name="IFS";cIFS.prototype.argumentsMin=2;cIFS.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var res=null;for(var i=0;i<arg.length;i++){var argN=argClone[i];if(cElementType.string=== argN.type){res=new cError(cErrorType.wrong_value_type);break}else if(cElementType.number===argN.type||cElementType.bool===argN.type){if(!argClone[i+1]){res=new cError(cErrorType.not_available);break}argN=argN.tocBool();if(true===argN.value){res=argClone[i+1];break}}if(i===arg.length-1){res=new cError(cErrorType.not_available);break}i++}if(null===res)return new cError(cErrorType.not_available);return res};function cNOT(){}cNOT.prototype=Object.create(cBaseFunction.prototype);cNOT.prototype.constructor= cNOT;cNOT.prototype.name="NOT";cNOT.prototype.argumentsMin=1;cNOT.prototype.argumentsMax=1;cNOT.prototype.argumentsType=[argType.logical];cNOT.prototype.Calculate=function(arg){var arg0=arg[0];if(arg0 instanceof cArray)arg0=arg0.getElement(0);if(arg0 instanceof cArea||arg0 instanceof cArea3D)arg0=arg0.cross(arguments[1]);if(arg0 instanceof cString){var res=arg0.tocBool();if(res instanceof cString)return new cError(cErrorType.wrong_value_type);else return new cBool(!res.value)}else if(arg0 instanceof cError)return arg0;else return new cBool(!arg0.tocBool().value)};function cOR(){}cOR.prototype=Object.create(cBaseFunction.prototype);cOR.prototype.constructor=cOR;cOR.prototype.name="OR";cOR.prototype.argumentsMin=1;cOR.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cOR.prototype.argumentsType=[[argType.logical]];cOR.prototype.Calculate=function(arg){var argResult=null;for(var i=0;i<arg.length;i++)if(arg[i]instanceof cArea||arg[i]instanceof cArea3D){var argArr=arg[i].getValue(); for(var j=0;j<argArr.length;j++)if(argArr[j]instanceof cError)return argArr[j];else if(argArr[j]instanceof cString||argArr[j]instanceof cEmpty){if(argResult===null)argResult=argArr[j].tocBool();else argResult=new cBool(argResult.value||argArr[j].tocBool().value);if(argResult.value===true)return new cBool(true)}}else if(arg[i]instanceof cString)return new cError(cErrorType.wrong_value_type);else if(arg[i]instanceof cError)return arg[i];else if(arg[i]instanceof cArray)arg[i].foreach(function(elem){if(elem instanceof cError){argResult=elem;return true}else if(elem instanceof cString||elem instanceof cEmpty)return false;else if(argResult===null)argResult=elem.tocBool();else argResult=new cBool(argResult.value||elem.tocBool().value)});else{if(argResult==null)argResult=arg[i].tocBool();else argResult=new cBool(argResult.value||arg[i].tocBool().value);if(argResult.value===true)return new cBool(true)}if(argResult==null)return new cError(cErrorType.wrong_value_type);return argResult};function cSWITCH(){}cSWITCH.prototype= Object.create(cBaseFunction.prototype);cSWITCH.prototype.constructor=cSWITCH;cSWITCH.prototype.name="SWITCH";cSWITCH.prototype.argumentsMin=3;cSWITCH.prototype.argumentsMax=126;cSWITCH.prototype.isXLFN=true;cSWITCH.prototype.Calculate=function(arg){var oArguments=this._prepareArguments(arg,arguments[1],true);var argClone=oArguments.args;var argError;if(argError=this._checkErrorArg(argClone))return argError;var arg0=argClone[0].getValue();if(cElementType.cell===argClone[0].type||cElementType.cell3D=== argClone[0].type)arg0=arg0.getValue();var res=null;for(var i=1;i<argClone.length;i++){var argN=argClone[i].getValue();if(arg0===argN)if(!argClone[i+1])return new cError(cErrorType.not_available);else{res=argClone[i+1];break}if(i===argClone.length-1)res=argClone[i];i++}if(null===res)return new cError(cErrorType.not_available);return res};function cTRUE(){}cTRUE.prototype=Object.create(cBaseFunction.prototype);cTRUE.prototype.constructor=cTRUE;cTRUE.prototype.name="TRUE";cTRUE.prototype.argumentsMax= 0;cTRUE.prototype.argumentsType=null;cTRUE.prototype.Calculate=function(){return new cBool(true)};function cXOR(){}cXOR.prototype=Object.create(cBaseFunction.prototype);cXOR.prototype.constructor=cXOR;cXOR.prototype.name="XOR";cXOR.prototype.argumentsMin=1;cXOR.prototype.argumentsMax=254;cXOR.prototype.isXLFN=true;cXOR.prototype.returnValueType=AscCommonExcel.cReturnFormulaType.array;cXOR.prototype.argumentsType=[[argType.logical]];cXOR.prototype.Calculate=function(arg){var argResult=null;var nTrueValues= 0;for(var i=0;i<arg.length;i++)if(arg[i]instanceof cArea||arg[i]instanceof cArea3D){var allCellsEmpty=true;var argArr=arg[i].getValue();for(var j=0;j<argArr.length;j++){var emptyArg=argArr[j]instanceof cEmpty;if(argArr[j]instanceof cError)return argArr[j];else if(argArr[j]instanceof cString||emptyArg||argArr[j]instanceof cBool){argResult=new cBool(true);nTrueValues++}else if(argArr.length===1&&argArr[j]instanceof cNumber){if(argResult==null)argResult=argArr[j].tocBool();else argResult=new cBool(argArr[j].tocBool().value); if(argResult.value===true)nTrueValues++}if(!emptyArg)allCellsEmpty=false}if(argResult==null&&!allCellsEmpty)argResult=new cBool(false);else if(allCellsEmpty)argResult=null}else if(arg[i]instanceof cString)return new cError(cErrorType.wrong_value_type);else if(arg[i]instanceof cError)return arg[i];else if(arg[i]instanceof cArray)arg[i].foreach(function(elem){if(elem instanceof cError){argResult=elem;return true}else if(elem instanceof cString||elem instanceof cEmpty)return false;else if(argResult=== null)argResult=elem.tocBool();else argResult=new cBool(elem.tocBool().value);if(argResult.value===true)nTrueValues++});else{if(argResult==null)argResult=arg[i].tocBool();else argResult=new cBool(arg[i].tocBool().value);if(argResult.value===true)nTrueValues++}if(argResult==null)return new cError(cErrorType.wrong_value_type);else if(nTrueValues%2)argResult=new cBool(true);else argResult=new cBool(false);return argResult}})(window);"use strict";(function(window,undefined){var History=AscCommon.History; var c_oAscInsertOptions=Asc.c_oAscInsertOptions;var c_oAscDeleteOptions=Asc.c_oAscDeleteOptions;function commentTooltipPosition(){this.dLeftPX=null;this.dReverseLeftPX=null;this.dTopPX=null}function asc_CCommentCoords(){this.nRow=null;this.nCol=null;this.nLeft=null;this.nLeftOffset=null;this.nTop=null;this.nTopOffset=null;this.nRight=null;this.nRightOffset=null;this.nBottom=null;this.nBottomOffset=null;this.dLeftMM=null;this.dTopMM=null;this.dWidthMM=null;this.dHeightMM=null;this.bMoveWithCells=false; this.bSizeWithCells=false}asc_CCommentCoords.prototype.clone=function(){var res=new asc_CCommentCoords;res.nRow=this.nRow;res.nCol=this.nCol;res.nLeft=this.nLeft;res.nLeftOffset=this.nLeftOffset;res.nTop=this.nTop;res.nTopOffset=this.nTopOffset;res.nRight=this.nRight;res.nRightOffset=this.nRightOffset;res.nBottom=this.nBottom;res.nBottomOffset=this.nBottomOffset;res.dLeftMM=this.dLeftMM;res.dTopMM=this.dTopMM;res.dWidthMM=this.dWidthMM;res.dHeightMM=this.dHeightMM;res.bMoveWithCells=this.bMoveWithCells; res.bSizeWithCells=this.bSizeWithCells;return res};asc_CCommentCoords.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.CommentCoords};asc_CCommentCoords.prototype.isValid=function(){return null!==this.nRow&&null!==this.nCol};asc_CCommentCoords.prototype.Read_FromBinary2=function(r){this.nRow=r.GetLong();this.nCol=r.GetLong();this.nLeft=r.GetLong();this.nLeftOffset=r.GetLong();this.nTop=r.GetLong();this.nTopOffset=r.GetLong();this.nRight=r.GetLong();this.nRightOffset=r.GetLong(); this.nBottom=r.GetLong();this.nBottomOffset=r.GetLong();if(r.GetBool())this.dLeftMM=r.GetDouble();if(r.GetBool())this.dTopMM=r.GetDouble();this.dWidthMM=r.GetDouble();this.dHeightMM=r.GetDouble();this.bMoveWithCells=r.GetBool();this.bSizeWithCells=r.GetBool()};asc_CCommentCoords.prototype.Write_ToBinary2=function(w){w.WriteLong(this.nRow);w.WriteLong(this.nCol);w.WriteLong(this.nLeft);w.WriteLong(this.nLeftOffset);w.WriteLong(this.nTop);w.WriteLong(this.nTopOffset);w.WriteLong(this.nRight);w.WriteLong(this.nRightOffset); w.WriteLong(this.nBottom);w.WriteLong(this.nBottomOffset);if(null!=this.dLeftMM){w.WriteBool(true);w.WriteDouble(this.dLeftMM)}else w.WriteBool(false);if(null!=this.dTopMM){w.WriteBool(true);w.WriteDouble(this.dTopMM)}else w.WriteBool(false);w.WriteDouble(this.dWidthMM);w.WriteDouble(this.dHeightMM);w.WriteBool(this.bMoveWithCells);w.WriteBool(this.bSizeWithCells)};asc_CCommentCoords.prototype.applyCollaborative=function(nSheetId,collaborativeEditing){this.nCol=collaborativeEditing.getLockMeColumn2(nSheetId, this.nCol);this.nRow=collaborativeEditing.getLockMeRow2(nSheetId,this.nRow)};function asc_CCommentData(){this.bHidden=false;this.wsId=null;this.nCol=0;this.nRow=0;this.nId=null;this.oParent=null;this.nLevel=0;this.sGuid=AscCommon.CreateGUID();this.sProviderId="";this.sText="";this.sTime="";this.sOOTime="";this.sUserId="";this.sUserName="";this.bDocument=true;this.bSolved=false;this.m_sUserData="";this.aReplies=[];this.coords=null}asc_CCommentData.prototype.clone=function(uniqueGuid){var res=new asc_CCommentData; res.updateData(this,uniqueGuid);res.coords=this.coords?this.coords.clone():null;return res};asc_CCommentData.prototype.updateData=function(comment,uniqueGuid){this.bHidden=comment.bHidden;this.wsId=comment.wsId;this.nCol=comment.nCol;this.nRow=comment.nRow;this.nId=comment.nId;this.oParent=comment.oParent;this.nLevel=null===this.oParent?0:this.oParent.asc_getLevel()+1;if(!uniqueGuid)this.sGuid=comment.sGuid;this.sProviderId=comment.sProviderId;this.sText=comment.sText;this.sTime=comment.sTime;this.sOOTime= comment.sOOTime;this.sUserId=comment.sUserId;this.sUserName=comment.sUserName;this.bDocument=comment.bDocument;this.bSolved=comment.bSolved;this.m_sUserData=comment.m_sUserData;this.aReplies=[];for(var i=0;i<comment.aReplies.length;i++)this.aReplies.push(comment.aReplies[i].clone(uniqueGuid))};asc_CCommentData.prototype.guid=function(){function S4(){return((1+Math.random())*65536|0).toString(16).substring(1)}return S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()};asc_CCommentData.prototype.setId= function(){if(this.bDocument)this.nId="doc_"+this.guid();else this.nId="sheet"+this.wsId+"_"+this.guid()};asc_CCommentData.prototype.asc_putQuoteText=function(val){};asc_CCommentData.prototype.asc_getQuoteText=function(){return this.bDocument?null:(new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow)).getName(AscCommonExcel.g_R1C1Mode?AscCommonExcel.referenceType.A:AscCommonExcel.referenceType.R)};asc_CCommentData.prototype.asc_putRow=function(val){this.nRow=val};asc_CCommentData.prototype.asc_getRow= function(){return this.nRow};asc_CCommentData.prototype.asc_putCol=function(val){this.nCol=val};asc_CCommentData.prototype.asc_getCol=function(){return this.nCol};asc_CCommentData.prototype.asc_putId=function(val){this.nId=val};asc_CCommentData.prototype.asc_getId=function(){return this.nId};asc_CCommentData.prototype.asc_putGuid=function(val){this.sGuid=val};asc_CCommentData.prototype.asc_getGuid=function(){return this.sGuid};asc_CCommentData.prototype.asc_putLevel=function(val){this.nLevel=val}; asc_CCommentData.prototype.asc_getLevel=function(){return this.nLevel};asc_CCommentData.prototype.asc_putParent=function(obj){this.oParent=obj};asc_CCommentData.prototype.asc_getParent=function(){return this.oParent};asc_CCommentData.prototype.asc_putText=function(val){this.sText=val?val.slice(0,Asc.c_oAscMaxCellOrCommentLength):val};asc_CCommentData.prototype.asc_getText=function(){return this.sText};asc_CCommentData.prototype.asc_putTime=function(val){this.sTime=val};asc_CCommentData.prototype.asc_getTime= function(){return this.sTime};asc_CCommentData.prototype.asc_putOnlyOfficeTime=function(val){this.sOOTime=val};asc_CCommentData.prototype.asc_getOnlyOfficeTime=function(){return this.sOOTime};asc_CCommentData.prototype.asc_putUserId=function(val){this.sUserId=val;this.sProviderId="Teamlab"};asc_CCommentData.prototype.asc_getUserId=function(){return this.sUserId};asc_CCommentData.prototype.asc_putProviderId=function(val){this.sProviderId=val};asc_CCommentData.prototype.asc_getProviderId=function(){return this.sProviderId}; asc_CCommentData.prototype.asc_putUserName=function(val){this.sUserName=val};asc_CCommentData.prototype.asc_getUserName=function(){return this.sUserName};asc_CCommentData.prototype.asc_putDocumentFlag=function(val){this.bDocument=val};asc_CCommentData.prototype.asc_getDocumentFlag=function(){return this.bDocument};asc_CCommentData.prototype.asc_putHiddenFlag=function(val){this.bHidden=val};asc_CCommentData.prototype.asc_getHiddenFlag=function(){return this.bHidden};asc_CCommentData.prototype.asc_putSolved= function(val){this.bSolved=val};asc_CCommentData.prototype.asc_getSolved=function(){return this.bSolved};asc_CCommentData.prototype.asc_putUserData=function(val){this.m_sUserData=val};asc_CCommentData.prototype.asc_getUserData=function(){return this.m_sUserData};asc_CCommentData.prototype.asc_getRepliesCount=function(){return this.aReplies.length};asc_CCommentData.prototype.asc_getReply=function(index){return this.aReplies[index]};asc_CCommentData.prototype.asc_addReply=function(oReply){oReply.asc_putParent(this); oReply.asc_putDocumentFlag(this.asc_getDocumentFlag());oReply.asc_putLevel(oReply.oParent==null?0:oReply.oParent.asc_getLevel()+1);oReply.wsId=oReply.oParent==null?-1:oReply.oParent.wsId;oReply.setId();oReply.asc_putCol(this.nCol);oReply.asc_putRow(this.nRow);this.aReplies.push(oReply);return oReply};asc_CCommentData.prototype.asc_getMasterCommentId=function(){return this.wsId};asc_CCommentData.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.CommentData};asc_CCommentData.prototype.Read_FromBinary2= function(r){this.wsId=r.GetString2();this.nCol=r.GetLong();this.nRow=r.GetLong();this.nId=r.GetString2();this.nLevel=r.GetLong();this.sText=r.GetString2();this.sTime=r.GetString2();this.sOOTime=r.GetString2();this.sUserId=r.GetString2();this.sUserName=r.GetString2();this.bDocument=r.GetBool();this.bSolved=r.GetBool();this.bHidden=r.GetBool();this.sGuid=r.GetString2();this.sProviderId=r.GetString2();var length=r.GetLong();for(var i=0;i<length;++i){var reply=new asc_CCommentData;reply.Read_FromBinary2(r); this.aReplies.push(reply)}};asc_CCommentData.prototype.Write_ToBinary2=function(w){w.WriteString2(this.wsId);w.WriteLong(this.nCol);w.WriteLong(this.nRow);w.WriteString2(this.nId);w.WriteLong(this.nLevel);w.WriteString2(this.sText);w.WriteString2(this.sTime);w.WriteString2(this.sOOTime);w.WriteString2(this.sUserId);w.WriteString2(this.sUserName);w.WriteBool(this.bDocument);w.WriteBool(this.bSolved);w.WriteBool(this.bHidden);w.WriteString2(this.sGuid);w.WriteString2(this.sProviderId);w.WriteLong(this.aReplies.length); for(var i=0;i<this.aReplies.length;++i)this.aReplies[i].Write_ToBinary2(w)};asc_CCommentData.prototype.applyCollaborative=function(nSheetId,collaborativeEditing){if(!this.bDocument){this.nCol=collaborativeEditing.getLockMeColumn2(nSheetId,this.nCol);this.nRow=collaborativeEditing.getLockMeRow2(nSheetId,this.nRow)}};function CCellCommentator(currentSheet){this.worksheet=currentSheet;this.model=this.worksheet.model;this.overlayCtx=currentSheet.overlayCtx;this.drawingCtx=currentSheet.drawingCtx;this.commentIconColor= new AscCommon.CColor(255,144,0);this.commentFillColor=new AscCommon.CColor(255,255,0);this.lastSelectedId=null;this.bSaveHistory=true}CCellCommentator.sStartCommentId="comment_";CCellCommentator.prototype.isLockedComment=function(oComment,callbackFunc){var objectGuid=oComment.asc_getId();if(objectGuid){var sheetId=CCellCommentator.sStartCommentId;if(!oComment.bDocument)sheetId+=this.model.getId();var lockInfo=this.worksheet.collaborativeEditing.getLockInfo(AscCommonExcel.c_oAscLockTypeElem.Object, null,sheetId,objectGuid);this.worksheet.collaborativeEditing.lock([lockInfo],callbackFunc)}};CCellCommentator.prototype.getCommentsRange=function(range,sUserId,copy){var res=[];var aComments=this.model.aComments;for(var i=0;i<aComments.length;++i){var comment=aComments[i];if(range.contains(comment.nCol,comment.nRow)&&(!sUserId||sUserId===comment.sUserId))res.push(comment.clone(copy))}return res};CCellCommentator.prototype.moveRangeComments=function(from,to,copy,opt_wsTo){if(from&&to){var colOffset= to.c1-from.c1;var rowOffset=to.r1-from.r1;var modelTo=opt_wsTo?opt_wsTo.model:this.model;var cellCommentatorTo=opt_wsTo?opt_wsTo.cellCommentator:this;modelTo.workbook.handlers.trigger("asc_onHideComment");var comments=this.getCommentsRange(from,undefined,copy);if(!copy)this._deleteCommentsRange(comments);cellCommentatorTo.deleteCommentsRange(to);for(var i=0;i<comments.length;++i){var newComment=comments[i];newComment.nCol+=colOffset;newComment.nRow+=rowOffset;if(copy)newComment.setId();cellCommentatorTo.addComment(newComment, true)}}};CCellCommentator.prototype.deleteCommentsRange=function(range,sUserId){this._deleteCommentsRange(this.getCommentsRange(range,sUserId));if(sUserId){var replies,change,newComment,comments=this.getCommentsRange(range);for(var i=0;i<comments.length;++i){change=false;newComment=comments[i].clone();replies=newComment.aReplies;newComment.aReplies=[];for(var j=0;j<replies.length;++j)if(replies[j].sUserId===sUserId)change=true;else newComment.aReplies.push(replies[j]);if(change)this.changeComment(newComment.nId, newComment)}}};CCellCommentator.prototype._deleteCommentsRange=function(comments){History.StartTransaction();for(var i=0;i<comments.length;++i)this.removeComment(comments[i].asc_getId());History.EndTransaction()};CCellCommentator.prototype.getCommentByXY=function(x,y,excludeHidden){var findCol=this.worksheet._findColUnderCursor(x,true);var findRow=this.worksheet._findRowUnderCursor(y,true);return findCol&&findRow?this.getComment(findCol.col,findRow.row,excludeHidden):null};CCellCommentator.prototype.drawCommentCells= function(){if(this.hiddenComments()||window["NATIVE_EDITOR_ENJINE"]||null===this.model.getId())return;this.drawingCtx.setFillStyle(this.commentIconColor);var commentCell,mergedRange,nCol,nRow,x,y,metrics;var aComments=this.model.aComments;for(var i=0;i<aComments.length;++i){commentCell=aComments[i];if(this._checkHidden(commentCell))continue;mergedRange=this.model.getMergedByCell(commentCell.nRow,commentCell.nCol);nCol=mergedRange?mergedRange.c2:commentCell.nCol;nRow=mergedRange?mergedRange.r1:commentCell.nRow; if(metrics=this.worksheet.getCellMetrics(nCol,nRow)){if(0===metrics.width||0===metrics.height)continue;x=metrics.left+metrics.width;y=metrics.top;this.drawingCtx.beginPath();this.drawingCtx.moveTo(x-7,y);this.drawingCtx.lineTo(x-1,y);this.drawingCtx.lineTo(x-1,y+6);this.drawingCtx.fill()}}};CCellCommentator.prototype.updateActiveComment=function(){if(this.lastSelectedId){var comment=this.findComment(this.lastSelectedId);if(comment){this.drawCommentCells();var coords=this.getCommentTooltipPosition(comment); var isVisible=null!==this.worksheet.getCellVisibleRange(comment.asc_getCol(),comment.asc_getRow());this.model.workbook.handlers.trigger("asc_onUpdateCommentPosition",[comment.asc_getId()],isVisible?coords.dLeftPX:-1,isVisible?coords.dTopPX:-1,isVisible?coords.dReverseLeftPX:-1)}}};CCellCommentator.prototype.updateCommentsDependencies=function(bInsert,operType,updateRange){var t=this;var UpdatePair=function(comment,bChange){this.comment=comment;this.bChange=bChange};var aChangedComments=[];function updateCommentsList(aComments){if(aComments.length){var changeArray= [];var removeArray=[];for(var i=0;i<aComments.length;i++)if(aComments[i].bChange){t.bSaveHistory=false;t.changeComment(aComments[i].comment.asc_getId(),aComments[i].comment,true,true,true,false);changeArray.push({"Id":aComments[i].comment.asc_getId(),"Comment":aComments[i].comment});t.bSaveHistory=true}else{t.removeComment(aComments[i].comment.asc_getId(),true,true,false);removeArray.push(aComments[i].comment.asc_getId())}if(changeArray.length)t.model.workbook.handlers.trigger("asc_onChangeComments", changeArray);if(removeArray.length)t.model.workbook.handlers.trigger("asc_onRemoveComments",removeArray)}}var i,comment;var aComments=this.model.aComments;if(bInsert)switch(operType){case c_oAscInsertOptions.InsertCellsAndShiftDown:for(i=0;i<aComments.length;i++){comment=aComments[i].clone();if(comment.nRow>=updateRange.r1&&comment.nCol>=updateRange.c1&&comment.nCol<=updateRange.c2){comment.nRow+=updateRange.r2-updateRange.r1+1;aChangedComments.push(new UpdatePair(comment,true))}}break;case c_oAscInsertOptions.InsertCellsAndShiftRight:for(i= 0;i<aComments.length;i++){comment=aComments[i].clone();if(comment.nCol>=updateRange.c1&&comment.nRow>=updateRange.r1&&comment.nRow<=updateRange.r2){comment.nCol+=updateRange.c2-updateRange.c1+1;aChangedComments.push(new UpdatePair(comment,true))}}break;case c_oAscInsertOptions.InsertColumns:for(i=0;i<aComments.length;i++){comment=aComments[i].clone();if(comment.nCol>=updateRange.c1){comment.nCol+=updateRange.c2-updateRange.c1+1;aChangedComments.push(new UpdatePair(comment,true))}}break;case c_oAscInsertOptions.InsertRows:for(i= 0;i<aComments.length;i++){comment=aComments[i].clone();if(comment.nRow>=updateRange.r1){comment.nRow+=updateRange.r2-updateRange.r1+1;aChangedComments.push(new UpdatePair(comment,true))}}break}else switch(operType){case c_oAscDeleteOptions.DeleteCellsAndShiftTop:for(i=0;i<aComments.length;i++){comment=aComments[i].clone();if(comment.nRow>updateRange.r2&&comment.nCol>=updateRange.c1&&comment.nCol<=updateRange.c2){comment.nRow-=updateRange.r2-updateRange.r1+1;aChangedComments.push(new UpdatePair(comment, true))}else if(updateRange.contains(comment.nCol,comment.nRow))aChangedComments.push(new UpdatePair(comment,false))}break;case c_oAscDeleteOptions.DeleteCellsAndShiftLeft:for(i=0;i<aComments.length;i++){comment=aComments[i].clone();if(comment.nCol>updateRange.c2&&comment.nRow>=updateRange.r1&&comment.nRow<=updateRange.r2){comment.nCol-=updateRange.c2-updateRange.c1+1;aChangedComments.push(new UpdatePair(comment,true))}else if(updateRange.contains(comment.nCol,comment.nRow))aChangedComments.push(new UpdatePair(comment, false))}break;case c_oAscDeleteOptions.DeleteColumns:for(i=0;i<aComments.length;i++){comment=aComments[i].clone();if(comment.nCol>updateRange.c2){comment.nCol-=updateRange.c2-updateRange.c1+1;aChangedComments.push(new UpdatePair(comment,true))}else if(updateRange.c1<=comment.nCol&&updateRange.c2>=comment.nCol)aChangedComments.push(new UpdatePair(comment,false))}break;case c_oAscDeleteOptions.DeleteRows:for(i=0;i<aComments.length;i++){comment=aComments[i].clone();if(comment.nRow>updateRange.r2){comment.nRow-= updateRange.r2-updateRange.r1+1;aChangedComments.push(new UpdatePair(comment,true))}else if(updateRange.r1<=comment.nRow&&updateRange.r2>=comment.nRow)aChangedComments.push(new UpdatePair(comment,false))}break}updateCommentsList(aChangedComments)};CCellCommentator.prototype.sortComments=function(sortData){if(null===sortData)return;var comment,places=sortData.places,i=0,l=places.length,j,row,line;var range=sortData.bbox,oComments=this.getRangeComments(new Asc.Range(range.c1,range.r1,range.c2,range.r2)); if(null===oComments)return;History.StartTransaction();for(;i<l;++i)if(oComments.hasOwnProperty(row=places[i].from))for(j=0,line=oComments[row];j<line.length;++j){comment=line[j].clone();comment.nRow=places[i].to;this.changeComment(comment.asc_getId(),comment,true,false,true,true)}History.EndTransaction()};CCellCommentator.prototype.resetLastSelectedId=function(){this.model.workbook.handlers.trigger("asc_onHideComment");this.cleanLastSelection();this.lastSelectedId=null};CCellCommentator.prototype.cleanLastSelection= function(){var metrics;if(this.lastSelectedId){var lastComment=this.findComment(this.lastSelectedId);if(lastComment&&(metrics=this.worksheet.getCellMetrics(lastComment.nCol,lastComment.nRow))){var extraOffset=1;this.overlayCtx.clearRect(metrics.left,metrics.top,metrics.width-extraOffset,metrics.height-extraOffset)}}};CCellCommentator.prototype.updateAreaComments=function(){var aComments=this.model.aComments;for(var i=0;i<aComments.length;++i)this.updateAreaComment(aComments[i])};CCellCommentator.prototype.updateAreaComment= function(comment){var lastCoords=comment.coords&&comment.coords.clone();if(!comment.coords)comment.coords=new asc_CCommentCoords;var zoom=this.worksheet.getZoom();var coords=comment.coords;var dWidthPX=144;var dHeightPX=79;coords.dWidthMM=this.pxToMm(dWidthPX);coords.dHeightMM=this.pxToMm(dHeightPX);coords.nCol=comment.nCol;coords.nRow=comment.nRow;var mergedRange=this.model.getMergedByCell(comment.nRow,comment.nCol);var pos;var left=mergedRange?mergedRange.c2:comment.nCol;var x=this.worksheet._getColLeft(left+ 1)+Asc.round(14*zoom);pos=this.worksheet._findColUnderCursor(x,true);coords.nLeft=pos?pos.col:0;coords.dLeftMM=this.pxToMm(Asc.round(x/zoom));coords.nLeftOffset=Asc.round((x-this.worksheet._getColLeft(coords.nLeft))/zoom);var top=mergedRange?mergedRange.r1:comment.nRow;var y=this.worksheet._getRowTop(top)-Asc.round(11*zoom);pos=this.worksheet._findRowUnderCursor(y,true);coords.nTop=pos?pos.row:0;coords.dTopMM=this.pxToMm(Asc.round(y/zoom));coords.nTopOffset=Asc.round((y-this.worksheet._getRowTop(coords.nTop))/ zoom);x+=Asc.round(dWidthPX*zoom);pos=this.worksheet._findColUnderCursor(x,true);coords.nRight=pos?pos.col:0;coords.nRightOffset=Asc.round((x-this.worksheet._getColLeft(coords.nRight))/zoom);y+=Asc.round(dHeightPX*zoom);pos=this.worksheet._findRowUnderCursor(y,true);coords.nBottom=pos?pos.row:0;coords.nBottomOffset=Asc.round((y-this.worksheet._getRowTop(coords.nBottom))/zoom);History.Add(AscCommonExcel.g_oUndoRedoComment,AscCH.historyitem_Comment_Coords,this.model.getId(),null,new AscCommonExcel.UndoRedoData_FromTo(lastCoords, coords.clone()))};CCellCommentator.prototype.getCommentTooltipPosition=function(comment){var pos=new commentTooltipPosition;var fvr=this.worksheet.getFirstVisibleRow(false);var fvc=this.worksheet.getFirstVisibleCol(false);var headerCellsOffset=this.worksheet.getCellsOffset(0);var mergedRange=this.model.getMergedByCell(comment.nRow,comment.nCol);var left=mergedRange?mergedRange.c2:comment.nCol;var top=mergedRange?mergedRange.r1:comment.nRow;var frozenOffset=this.worksheet.getFrozenPaneOffset();if(this.worksheet.topLeftFrozenCell){if(comment.nCol< fvc){frozenOffset.offsetX=0;fvc=0}if(comment.nRow<fvr){frozenOffset.offsetY=0;fvr=0}}pos.dReverseLeftPX=this.worksheet._getColLeft(left)-this.worksheet._getColLeft(fvc)+headerCellsOffset.left+frozenOffset.offsetX;pos.dLeftPX=pos.dReverseLeftPX+this.worksheet.getColumnWidth(left,0);pos.dTopPX=this.worksheet._getRowTop(top)+(this.worksheet._getRowHeight(top)/2|0)-this.worksheet._getRowTop(fvr)+headerCellsOffset.top+frozenOffset.offsetY;if(AscCommon.AscBrowser.isRetina){pos.dLeftPX=AscCommon.AscBrowser.convertToRetinaValue(pos.dLeftPX); pos.dTopPX=AscCommon.AscBrowser.convertToRetinaValue(pos.dTopPX);pos.dReverseLeftPX=AscCommon.AscBrowser.convertToRetinaValue(pos.dReverseLeftPX)}return pos};CCellCommentator.prototype.cleanSelectedComment=function(){var metrics;if(this.lastSelectedId){var comment=this.findComment(this.lastSelectedId);if(comment&&!this._checkHidden(comment)&&(metrics=this.worksheet.getCellMetrics(comment.asc_getCol(),comment.asc_getRow())))this.overlayCtx.clearRect(metrics.left,metrics.top,metrics.width,metrics.height)}}; CCellCommentator.prototype.pxToMm=function(val){return val*this.ascCvtRatio(0,3)};CCellCommentator.prototype.ascCvtRatio=function(fromUnits,toUnits){return Asc.getCvtRatio(fromUnits,toUnits,this.overlayCtx.getPPIX())};CCellCommentator.prototype.showCommentById=function(id,bNew){this._showComment(this.findComment(id),bNew)};CCellCommentator.prototype.showCommentByXY=function(x,y){this._showComment(this.getCommentByXY(x,y,true),false)};CCellCommentator.prototype._showComment=function(comment,bNew){if(comment&& !this._checkHidden(comment)){var coords=this.getCommentTooltipPosition(comment);this.model.workbook.handlers.trigger("asc_onShowComment",[comment.asc_getId()],coords.dLeftPX,coords.dTopPX,coords.dReverseLeftPX,bNew);this.drawCommentCells();this.lastSelectedId=comment.asc_getId()}else this.lastSelectedId=null};CCellCommentator.prototype.selectComment=function(id){var comment=this.findComment(id);var metrics;this.cleanLastSelection();this.lastSelectedId=null;if(comment&&!this._checkHidden(comment)){this.lastSelectedId= id;var col=comment.asc_getCol();var row=comment.asc_getRow();this.worksheet._scrollToRange(new Asc.Range(col,row,col,row));metrics=this.worksheet.getCellMetrics(col,row);if(metrics){var extraOffset=1;this.overlayCtx.ctx.globalAlpha=.2;this.overlayCtx.beginPath();this.overlayCtx.clearRect(metrics.left,metrics.top,metrics.width-extraOffset,metrics.height-extraOffset);this.overlayCtx.setFillStyle(this.commentFillColor);this.overlayCtx.fillRect(metrics.left,metrics.top,metrics.width-extraOffset,metrics.height- extraOffset);this.overlayCtx.ctx.globalAlpha=1}}};CCellCommentator.prototype.findComment=function(id){function checkCommentId(id,commentObject){if(commentObject.asc_getId()==id)return commentObject;for(var i=0;i<commentObject.aReplies.length;i++){var comment=checkCommentId(id,commentObject.aReplies[i]);if(comment)return comment}return null}var aComments=this.model.aComments;for(var i=0;i<aComments.length;i++){var commentCell=aComments[i];var obj=checkCommentId(id,commentCell);if(obj)return obj}return null}; CCellCommentator.prototype.addComment=function(comment,bIsNotUpdate){var t=this;var oComment=comment;var bChange=false;oComment.wsId=this.model.getId();oComment.setId();if(!oComment.bDocument){if(!bIsNotUpdate){var activeCell=this.model.selectionRange.activeCell;oComment.asc_putCol(activeCell.col);oComment.asc_putRow(activeCell.row)}var existComment=this.getComment(oComment.nCol,oComment.nRow,false);if(existComment){oComment=existComment;bChange=true}}var onAddCommentCallback=function(isSuccess){if(false=== isSuccess)return;t._addComment(oComment,bChange,bIsNotUpdate)};if(bIsNotUpdate)onAddCommentCallback(true);else this.isLockedComment(oComment,onAddCommentCallback)};CCellCommentator.prototype.changeComment=function(id,oComment,bChangeCoords,bNoEvent,bNoAscLock,bNoDraw){var t=this;var comment=this.findComment(id);if(null===comment)return;var onChangeCommentCallback=function(isSuccess){if(false===isSuccess)return;var updateSolved=false;var from=comment.clone();if(comment){if(bChangeCoords){comment.asc_putCol(oComment.asc_getCol()); comment.asc_putRow(oComment.asc_getRow())}comment.asc_putText(oComment.asc_getText());comment.asc_putQuoteText(oComment.asc_getQuoteText());comment.asc_putUserId(oComment.asc_getUserId());comment.asc_putUserName(oComment.asc_getUserName());comment.asc_putTime(oComment.asc_getTime());updateSolved=comment.bSolved!==oComment.bSolved;comment.asc_putSolved(oComment.asc_getSolved());comment.asc_putHiddenFlag(oComment.asc_getHiddenFlag());comment.aReplies=[];var count=oComment.asc_getRepliesCount();for(var i= 0;i<count;i++)comment.asc_addReply(oComment.asc_getReply(i));if(!bNoEvent)t.model.workbook.handlers.trigger("asc_onChangeCommentData",comment.asc_getId(),comment)}if(t.bSaveHistory){History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoComment,AscCH.historyitem_Comment_Change,t.model.getId(),null,new AscCommonExcel.UndoRedoData_FromTo(from,comment.clone()));if(bChangeCoords)t.updateAreaComment(comment)}if(!bNoDraw)if(updateSolved&&!t.showSolved()){t.worksheet.draw();if(comment.bSolved)t.model.workbook.handlers.trigger("asc_onHideComment")}else t.drawCommentCells()}; if(bNoAscLock)onChangeCommentCallback(true);else this.isLockedComment(comment,onChangeCommentCallback)};CCellCommentator.prototype.removeComment=function(id,bNoEvent,bNoAscLock,bNoDraw){var t=this;var comment=this.findComment(id);if(null===comment)return;var onRemoveCommentCallback=function(isSuccess){if(false===isSuccess)return;t._removeComment(comment,bNoEvent,!bNoDraw)};if(bNoAscLock)onRemoveCommentCallback(true);else this.isLockedComment(comment,onRemoveCommentCallback)};CCellCommentator.prototype.getComment= function(col,row,excludeHidden){var comment=null;var _col=col,_row=row,mergedRange=null;var aComments=this.model.aComments;var length=aComments.length;if(excludeHidden&&this.hiddenComments())return comment;if(0<length){if(null==_col||null==_row){var activeCell=this.model.selectionRange.activeCell;_col=activeCell.col;_row=activeCell.row}else mergedRange=this.model.getMergedByCell(row,col);for(var i=0;i<length;i++){var commentCell=aComments[i];if(!mergedRange){if(_col===commentCell.nCol&&_row===commentCell.nRow)comment= commentCell}else if(mergedRange.contains(commentCell.nCol,commentCell.nRow))comment=commentCell;if(comment)return excludeHidden&&this._checkHidden(comment)?null:comment}}return comment};CCellCommentator.prototype.getRangeComments=function(range){var oComments={};if(this.hiddenComments())return null;var aComments=this.model.aComments;var i,length,comment,bEmpty=true;for(i=0,length=aComments.length;i<length;++i){comment=aComments[i];if(range.contains(comment.nCol,comment.nRow)){bEmpty=false;if(!oComments.hasOwnProperty(comment.nRow))oComments[comment.nRow]= [];oComments[comment.nRow].push(comment)}}return bEmpty?null:oComments};CCellCommentator.prototype._checkHidden=function(comment){return this.hiddenComments()||comment.asc_getDocumentFlag()||comment.asc_getHiddenFlag()||comment.asc_getSolved()&&!this.showSolved()||0!==comment.nLevel};CCellCommentator.prototype._addComment=function(oComment,bChange,bIsNotUpdate){if(!bChange){History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoComment,AscCH.historyitem_Comment_Add,this.model.getId(),null, oComment.clone());if(!oComment.bDocument)this.updateAreaComment(oComment);this.model.aComments.push(oComment);if(!bIsNotUpdate)this.drawCommentCells()}this.model.workbook.handlers.trigger("addComment",oComment.asc_getId(),oComment)};CCellCommentator.prototype._removeComment=function(comment,bNoEvent,isDraw){if(!comment)return;var aComments=this.model.aComments;var i,id=comment.asc_getId();if(comment.oParent)for(i=0;i<comment.oParent.aReplies.length;++i){if(comment.asc_getId()==comment.oParent.aReplies[i].asc_getId()){if(this.bSaveHistory){History.Create_NewPoint(); History.Add(AscCommonExcel.g_oUndoRedoComment,AscCH.historyitem_Comment_Remove,this.model.getId(),null,comment.oParent.aReplies[i].clone())}comment.oParent.aReplies.splice(i,1);break}}else{for(i=0;i<aComments.length;i++)if(comment.asc_getId()==aComments[i].asc_getId()){if(this.bSaveHistory){History.Create_NewPoint();if(!aComments[i].bDocument)History.Add(AscCommonExcel.g_oUndoRedoComment,AscCH.historyitem_Comment_Coords,this.model.getId(),null,new AscCommonExcel.UndoRedoData_FromTo(aComments[i].coords.clone(), null));History.Add(AscCommonExcel.g_oUndoRedoComment,AscCH.historyitem_Comment_Remove,this.model.getId(),null,aComments[i].clone())}aComments.splice(i,1);break}if(isDraw)this.worksheet.draw()}if(isDraw)this.drawCommentCells();if(!bNoEvent)this.model.workbook.handlers.trigger("removeComment",id)};CCellCommentator.prototype.isMissComments=function(range){var aComments=this.model.aComments;var oComment,bMiss=false;for(var i=0,length=aComments.length;i<length;++i){oComment=aComments[i];if(!oComment.bHidden&& range.contains(oComment.nCol,oComment.nRow)){if(bMiss)return true;bMiss=true}}return false};CCellCommentator.prototype.mergeComments=function(range){var aComments=this.model.aComments;var i,length,deleteComments=[],oComment,r1=range.r1,c1=range.c1,mergeComment=null;for(i=0,length=aComments.length;i<length;++i){oComment=aComments[i];if(range.contains(oComment.nCol,oComment.nRow))if(null===mergeComment)mergeComment=oComment;else if(oComment.nRow<=mergeComment.nRow&&oComment.nCol<mergeComment.nCol){deleteComments.push(mergeComment); mergeComment=oComment}else deleteComments.push(oComment)}if(mergeComment&&(mergeComment.nCol!==c1||mergeComment.nRow!==r1)){this._removeComment(mergeComment,false,false);mergeComment.nCol=c1;mergeComment.nRow=r1;this._addComment(mergeComment,false,true)}for(i=0,length=deleteComments.length;i<length;++i)this._removeComment(deleteComments[i],false,false)};CCellCommentator.prototype.Undo=function(type,data){var aComments=this.model.aComments;var i,comment;switch(type){case AscCH.historyitem_Comment_Add:if(data.oParent){comment= this.findComment(data.oParent.asc_getId());if(comment)for(i=0;i<comment.aReplies.length;i++)if(comment.aReplies[i].asc_getId()==data.asc_getId()){comment.aReplies.splice(i,1);break}}else for(i=0;i<aComments.length;i++)if(aComments[i].asc_getId()==data.asc_getId()){aComments.splice(i,1);this.model.workbook.handlers.trigger("removeComment",data.asc_getId());break}break;case AscCH.historyitem_Comment_Remove:if(data.oParent){comment=this.findComment(data.oParent.asc_getId());if(comment)comment.aReplies.push(data)}else{aComments.push(data); this.model.workbook.handlers.trigger("addComment",data.asc_getId(),data)}break;case AscCH.historyitem_Comment_Change:if(data.to.oParent){comment=this.findComment(data.to.oParent.asc_getId());if(comment)for(i=0;i<comment.aReplies.length;i++)if(comment.aReplies[i].asc_getId()==data.asc_getId()){comment.aReplies.splice(i,1);comment.aReplies.push(data.from);break}}else{comment=this.findComment(data.to.asc_getId());if(comment){comment.updateData(data.from);this.model.workbook.handlers.trigger("asc_onChangeCommentData", comment.asc_getId(),comment)}}break;case AscCH.historyitem_Comment_Coords:if(data.from){comment=this.getComment(data.from.nCol,data.from.nRow,false);if(comment)comment.coords=data.from.clone()}break}};CCellCommentator.prototype.Redo=function(type,data){var aComments=this.model.aComments;var comment,i;switch(type){case AscCH.historyitem_Comment_Add:if(data.oParent){comment=this.findComment(data.oParent.asc_getId());if(comment)comment.aReplies.push(data)}else{aComments.push(data);this.model.workbook.handlers.trigger("addComment", data.asc_getId(),data)}break;case AscCH.historyitem_Comment_Remove:if(data.oParent){comment=this.findComment(data.oParent.asc_getId());if(comment)for(i=0;i<comment.aReplies.length;i++)if(comment.aReplies[i].asc_getId()==data.asc_getId()){comment.aReplies.splice(i,1);break}}else for(i=0;i<aComments.length;i++)if(aComments[i].asc_getId()==data.asc_getId()){aComments.splice(i,1);this.model.workbook.handlers.trigger("removeComment",data.asc_getId());break}break;case AscCH.historyitem_Comment_Change:if(data.from.oParent){comment= this.findComment(data.from.oParent.asc_getId());if(comment)for(i=0;i<comment.aReplies.length;i++)if(comment.aReplies[i].asc_getId()==data.asc_getId()){comment.aReplies.splice(i,1);comment.aReplies.push(data.to);break}}else{comment=this.findComment(data.from.asc_getId());if(comment){comment.updateData(data.to);this.model.workbook.handlers.trigger("asc_onChangeCommentData",comment.asc_getId(),comment)}}break;case AscCH.historyitem_Comment_Coords:if(data.to){comment=this.getComment(data.to.nCol,data.to.nRow, false);if(comment)comment.coords=data.to.clone()}break}};CCellCommentator.prototype.hiddenComments=function(){return this.model.workbook.handlers.trigger("hiddenComments")};CCellCommentator.prototype.showSolved=function(){return this.model.workbook.handlers.trigger("showSolved")};var prot;window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].asc_CCommentCoords=asc_CCommentCoords;window["AscCommonExcel"].CCellCommentator=CCellCommentator;window["Asc"]=window["Asc"]||{};window["Asc"]["asc_CCommentData"]= window["Asc"].asc_CCommentData=asc_CCommentData;prot=asc_CCommentData.prototype;prot["asc_putRow"]=prot.asc_putRow;prot["asc_getRow"]=prot.asc_getRow;prot["asc_putCol"]=prot.asc_putCol;prot["asc_getCol"]=prot.asc_getCol;prot["asc_putId"]=prot.asc_putId;prot["asc_getId"]=prot.asc_getId;prot["asc_putLevel"]=prot.asc_putLevel;prot["asc_getLevel"]=prot.asc_getLevel;prot["asc_putParent"]=prot.asc_putParent;prot["asc_getParent"]=prot.asc_getParent;prot["asc_putText"]=prot.asc_putText;prot["asc_getText"]= prot.asc_getText;prot["asc_putQuoteText"]=prot.asc_putQuoteText;prot["asc_getQuoteText"]=prot.asc_getQuoteText;prot["asc_putTime"]=prot.asc_putTime;prot["asc_getTime"]=prot.asc_getTime;prot["asc_putOnlyOfficeTime"]=prot.asc_putOnlyOfficeTime;prot["asc_getOnlyOfficeTime"]=prot.asc_getOnlyOfficeTime;prot["asc_putUserId"]=prot.asc_putUserId;prot["asc_getUserId"]=prot.asc_getUserId;prot["asc_putUserName"]=prot.asc_putUserName;prot["asc_getUserName"]=prot.asc_getUserName;prot["asc_putProviderId"]=prot.asc_putProviderId; prot["asc_getProviderId"]=prot.asc_getProviderId;prot["asc_putDocumentFlag"]=prot.asc_putDocumentFlag;prot["asc_getDocumentFlag"]=prot.asc_getDocumentFlag;prot["asc_putHiddenFlag"]=prot.asc_putHiddenFlag;prot["asc_getHiddenFlag"]=prot.asc_getHiddenFlag;prot["asc_putSolved"]=prot.asc_putSolved;prot["asc_getSolved"]=prot.asc_getSolved;prot["asc_putUserData"]=prot.asc_putUserData;prot["asc_getUserData"]=prot.asc_getUserData;prot["asc_getRepliesCount"]=prot.asc_getRepliesCount;prot["asc_getReply"]=prot.asc_getReply; prot["asc_addReply"]=prot.asc_addReply;prot["asc_getMasterCommentId"]=prot.asc_getMasterCommentId;prot["asc_putGuid"]=prot.asc_putGuid;prot["asc_getGuid"]=prot.asc_getGuid})(window);"use strict";(function(window,undefined){var CellValueType=AscCommon.CellValueType;var c_oAscBorderWidth=AscCommon.c_oAscBorderWidth;var c_oAscBorderStyles=AscCommon.c_oAscBorderStyles;var FormulaTablePartInfo=AscCommon.FormulaTablePartInfo;var parserHelp=AscCommon.parserHelp;var gc_nMaxRow0=AscCommon.gc_nMaxRow0;var gc_nMaxCol0= AscCommon.gc_nMaxCol0;var History=AscCommon.History;var c_oAscPrintDefaultSettings=AscCommon.c_oAscPrintDefaultSettings;var UndoRedoDataTypes=AscCommonExcel.UndoRedoDataTypes;var UndoRedoData_IndexSimpleProp=AscCommonExcel.UndoRedoData_IndexSimpleProp;var UndoRedoData_Layout=AscCommonExcel.UndoRedoData_Layout;var c_oAscCustomAutoFilter=Asc.c_oAscCustomAutoFilter;var c_oAscAutoFilterTypes=Asc.c_oAscAutoFilterTypes;var c_maxOutlineLevel=7;var g_oColorManager=null;var g_nHSLMaxValue=255;var g_nColorTextDefault= 1;var g_nColorHyperlink=10;var g_nColorHyperlinkVisited=11;var g_oThemeColorsDefaultModsSpreadsheet=[[0,-.0499893185216834,-.1499984740745262,-.249977111117893,-.3499862666707358,-.499984740745262],[0,-.0999786370433668,-.249977111117893,-.499984740745262,-.749992370372631,-.8999908444471572],[0,.7999816888943144,.5999938962981048,.3999755851924192,-.249977111117893,-.499984740745262],[0,.8999908444471572,.749992370372631,.499984740745262,.249977111117893,.0999786370433668],[0,.499984740745262,.3499862666707358, .249977111117893,.1499984740745262,.0499893185216834]];var map_themeExcel_to_themePresentation={0:12,1:8,2:13,3:9,4:0,5:1,6:2,7:3,8:4,9:5,10:11,11:10};function shiftGetBBox(bbox,bHor){var bboxGet=null;if(bHor)bboxGet=new Asc.Range(bbox.c1,bbox.r1,gc_nMaxCol0,bbox.r2);else bboxGet=new Asc.Range(bbox.c1,bbox.r1,bbox.c2,gc_nMaxRow0);return bboxGet}function shiftSort(a,b,offset){var nRes=0;if(null==a.to||null==b.to)if(null==a.to&&null==b.to)nRes=0;else if(null==a.to)nRes=-1;else{if(null==b.to)nRes=1}else{if(0!= offset.row)if(offset.row>0)nRes=b.to.r1-a.to.r1;else nRes=a.to.r1-b.to.r1;if(0==nRes&&0!=offset.col)if(offset.col>0)nRes=b.to.c1-a.to.c1;else nRes=a.to.c1-b.to.c1}return nRes}function createRgbColor(r,g,b){return new RgbColor((r<<16)+(g<<8)+b)}function FromXml_ST_DynamicFilterType(val){var res=-1;if("null"===val)res=Asc.c_oAscDynamicAutoFilter.nullType;else if("aboveAverage"===val)res=Asc.c_oAscDynamicAutoFilter.aboveAverage;else if("belowAverage"===val)res=Asc.c_oAscDynamicAutoFilter.belowAverage; else if("tomorrow"===val)res=Asc.c_oAscDynamicAutoFilter.tomorrow;else if("today"===val)res=Asc.c_oAscDynamicAutoFilter.today;else if("yesterday"===val)res=Asc.c_oAscDynamicAutoFilter.yesterday;else if("nextWeek"===val)res=Asc.c_oAscDynamicAutoFilter.nextWeek;else if("thisWeek"===val)res=Asc.c_oAscDynamicAutoFilter.thisWeek;else if("lastWeek"===val)res=Asc.c_oAscDynamicAutoFilter.lastWeek;else if("nextMonth"===val)res=Asc.c_oAscDynamicAutoFilter.nextMonth;else if("thisMonth"===val)res=Asc.c_oAscDynamicAutoFilter.thisMonth; else if("lastMonth"===val)res=Asc.c_oAscDynamicAutoFilter.lastMonth;else if("nextQuarter"===val)res=Asc.c_oAscDynamicAutoFilter.nextQuarter;else if("thisQuarter"===val)res=Asc.c_oAscDynamicAutoFilter.thisQuarter;else if("lastQuarter"===val)res=Asc.c_oAscDynamicAutoFilter.lastQuarter;else if("nextYear"===val)res=Asc.c_oAscDynamicAutoFilter.nextYear;else if("thisYear"===val)res=Asc.c_oAscDynamicAutoFilter.thisYear;else if("lastYear"===val)res=Asc.c_oAscDynamicAutoFilter.lastYear;else if("yearToDate"=== val)res=Asc.c_oAscDynamicAutoFilter.yearToDate;else if("Q1"===val)res=Asc.c_oAscDynamicAutoFilter.q1;else if("Q2"===val)res=Asc.c_oAscDynamicAutoFilter.q2;else if("Q3"===val)res=Asc.c_oAscDynamicAutoFilter.q3;else if("Q4"===val)res=Asc.c_oAscDynamicAutoFilter.q4;else if("M1"===val)res=Asc.c_oAscDynamicAutoFilter.m1;else if("M2"===val)res=Asc.c_oAscDynamicAutoFilter.m2;else if("M3"===val)res=Asc.c_oAscDynamicAutoFilter.m3;else if("M4"===val)res=Asc.c_oAscDynamicAutoFilter.m4;else if("M5"===val)res= Asc.c_oAscDynamicAutoFilter.m5;else if("M6"===val)res=Asc.c_oAscDynamicAutoFilter.m6;else if("M7"===val)res=Asc.c_oAscDynamicAutoFilter.m7;else if("M8"===val)res=Asc.c_oAscDynamicAutoFilter.m8;else if("M9"===val)res=Asc.c_oAscDynamicAutoFilter.m9;else if("M10"===val)res=Asc.c_oAscDynamicAutoFilter.m10;else if("M11"===val)res=Asc.c_oAscDynamicAutoFilter.m11;else if("M12"===val)res=Asc.c_oAscDynamicAutoFilter.m12;return res}function ToXml_ST_DynamicFilterType(val){var res="";if(Asc.c_oAscDynamicAutoFilter.nullType=== val)res="null";else if(Asc.c_oAscDynamicAutoFilter.aboveAverage===val)res="aboveAverage";else if(Asc.c_oAscDynamicAutoFilter.belowAverage===val)res="belowAverage";else if(Asc.c_oAscDynamicAutoFilter.tomorrow===val)res="tomorrow";else if(Asc.c_oAscDynamicAutoFilter.today===val)res="today";else if(Asc.c_oAscDynamicAutoFilter.yesterday===val)res="yesterday";else if(Asc.c_oAscDynamicAutoFilter.nextWeek===val)res="nextWeek";else if(Asc.c_oAscDynamicAutoFilter.thisWeek===val)res="thisWeek";else if(Asc.c_oAscDynamicAutoFilter.lastWeek=== val)res="lastWeek";else if(Asc.c_oAscDynamicAutoFilter.nextMonth===val)res="nextMonth";else if(Asc.c_oAscDynamicAutoFilter.thisMonth===val)res="thisMonth";else if(Asc.c_oAscDynamicAutoFilter.lastMonth===val)res="lastMonth";else if(Asc.c_oAscDynamicAutoFilter.nextQuarter===val)res="nextQuarter";else if(Asc.c_oAscDynamicAutoFilter.thisQuarter===val)res="thisQuarter";else if(Asc.c_oAscDynamicAutoFilter.lastQuarter===val)res="lastQuarter";else if(Asc.c_oAscDynamicAutoFilter.nextYear===val)res="nextYear"; else if(Asc.c_oAscDynamicAutoFilter.thisYear===val)res="thisYear";else if(Asc.c_oAscDynamicAutoFilter.lastYear===val)res="lastYear";else if(Asc.c_oAscDynamicAutoFilter.yearToDate===val)res="yearToDate";else if(Asc.c_oAscDynamicAutoFilter.q1===val)res="Q1";else if(Asc.c_oAscDynamicAutoFilter.q2===val)res="Q2";else if(Asc.c_oAscDynamicAutoFilter.q3===val)res="Q3";else if(Asc.c_oAscDynamicAutoFilter.q4===val)res="Q4";else if(Asc.c_oAscDynamicAutoFilter.m1===val)res="M1";else if(Asc.c_oAscDynamicAutoFilter.m2=== val)res="M2";else if(Asc.c_oAscDynamicAutoFilter.m3===val)res="M3";else if(Asc.c_oAscDynamicAutoFilter.m4===val)res="M4";else if(Asc.c_oAscDynamicAutoFilter.m5===val)res="M5";else if(Asc.c_oAscDynamicAutoFilter.m6===val)res="M6";else if(Asc.c_oAscDynamicAutoFilter.m7===val)res="M7";else if(Asc.c_oAscDynamicAutoFilter.m8===val)res="M8";else if(Asc.c_oAscDynamicAutoFilter.m9===val)res="M9";else if(Asc.c_oAscDynamicAutoFilter.m10===val)res="M10";else if(Asc.c_oAscDynamicAutoFilter.m11===val)res="M11"; else if(Asc.c_oAscDynamicAutoFilter.m12===val)res="M12";return res}function FromXml_ST_FilterOperator(val){var res=-1;if("equal"===val)res=Asc.c_oAscCustomAutoFilter.equals;else if("lessThan"===val)res=Asc.c_oAscCustomAutoFilter.isLessThan;else if("lessThanOrEqual"===val)res=Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo;else if("notEqual"===val)res=Asc.c_oAscCustomAutoFilter.doesNotEqual;else if("greaterThanOrEqual"===val)res=Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo;else if("greaterThan"=== val)res=Asc.c_oAscCustomAutoFilter.isGreaterThan;return res}function ToXml_ST_FilterOperator(val){var res="";if(Asc.c_oAscCustomAutoFilter.equals===val)res="equal";else if(Asc.c_oAscCustomAutoFilter.isLessThan===val)res="lessThan";else if(Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo===val)res="lessThanOrEqual";else if(Asc.c_oAscCustomAutoFilter.doesNotEqual===val)res="notEqual";else if(Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo===val)res="greaterThanOrEqual";else if(Asc.c_oAscCustomAutoFilter.isGreaterThan=== val)res="greaterThan";return res}function FromXml_ST_DateTimeGrouping(val){var res=-1;if("year"===val)res=Asc.EDateTimeGroup.datetimegroupYear;else if("month"===val)res=Asc.EDateTimeGroup.datetimegroupMonth;else if("day"===val)res=Asc.EDateTimeGroup.datetimegroupDay;else if("hour"===val)res=Asc.EDateTimeGroup.datetimegroupHour;else if("minute"===val)res=Asc.EDateTimeGroup.datetimegroupMinute;else if("second"===val)res=Asc.EDateTimeGroup.datetimegroupSecond;return res}function ToXml_ST_DateTimeGrouping(val){var res= "";if(Asc.EDateTimeGroup.datetimegroupYear===val)res="year";else if(Asc.EDateTimeGroup.datetimegroupMonth===val)res="month";else if(Asc.EDateTimeGroup.datetimegroupDay===val)res="day";else if(Asc.EDateTimeGroup.datetimegroupHour===val)res="hour";else if(Asc.EDateTimeGroup.datetimegroupMinute===val)res="minute";else if(Asc.EDateTimeGroup.datetimegroupSecond===val)res="second";return res}var g_oRgbColorProperties={rgb:0};function RgbColor(rgb){this.rgb=rgb;this._hash}RgbColor.prototype={Properties:g_oRgbColorProperties, getHash:function(){if(!this._hash)this._hash=this.rgb;return this._hash},clone:function(){return new RgbColor(this.rgb)},getType:function(){return UndoRedoDataTypes.RgbColor},getProperties:function(){return this.Properties},isEqual:function(oColor){if(!oColor||!(oColor instanceof RgbColor))return false;if(this.rgb!==oColor.rgb)return false;return true},getProperty:function(nType){switch(nType){case this.Properties.rgb:return this.rgb;break}},setProperty:function(nType,value){switch(nType){case this.Properties.rgb:this.rgb= value;break}},Write_ToBinary2:function(oBinaryWriter){oBinaryWriter.WriteLong(this.rgb)},Read_FromBinary2:function(oBinaryReader){this.rgb=oBinaryReader.GetULongLE()},getRgb:function(){return this.rgb},getR:function(){return this.rgb>>16&255},getG:function(){return this.rgb>>8&255},getB:function(){return this.rgb&255},getA:function(){return 1}};var g_oThemeColorProperties={rgb:0,theme:1,tint:2};function ThemeColor(){this.rgb=null;this.theme=null;this.tint=null;this._hash}ThemeColor.prototype={Properties:g_oThemeColorProperties, getHash:function(){if(!this._hash)this._hash=this.theme+";"+this.tint;return this._hash},clone:function(){return this},getType:function(){return UndoRedoDataTypes.ThemeColor},getProperties:function(){return this.Properties},getProperty:function(nType){switch(nType){case this.Properties.rgb:return this.rgb;break;case this.Properties.theme:return this.theme;break;case this.Properties.tint:return this.tint;break}},setProperty:function(nType,value){switch(nType){case this.Properties.rgb:this.rgb=value; break;case this.Properties.theme:this.theme=value;break;case this.Properties.tint:this.tint=value;break}},isEqual:function(oColor){if(!oColor)return false;if(this.theme!==oColor.theme)return false;if(!AscFormat.fApproxEqual(this.tint,oColor.tint))return false;return true},Write_ToBinary2:function(oBinaryWriter){oBinaryWriter.WriteByte(this.theme);if(null!=this.tint){oBinaryWriter.WriteByte(true);oBinaryWriter.WriteDouble2(this.tint)}else oBinaryWriter.WriteBool(false)},Read_FromBinary2AndReplace:function(oBinaryReader){this.theme= oBinaryReader.GetUChar();var bTint=oBinaryReader.GetBool();if(bTint)this.tint=oBinaryReader.GetDoubleLE();return g_oColorManager.getThemeColor(this.theme,this.tint)},getRgb:function(){return this.rgb},getR:function(){return this.rgb>>16&255},getG:function(){return this.rgb>>8&255},getB:function(){return this.rgb&255},getA:function(){return 1},rebuild:function(theme){var nRes=0;var r=0;var g=0;var b=0;if(null!=this.theme&&null!=theme){var oUniColor=theme.themeElements.clrScheme.colors[map_themeExcel_to_themePresentation[this.theme]]; if(null!=oUniColor){var rgba=oUniColor.color.RGBA;if(null!=rgba){r=rgba.R;g=rgba.G;b=rgba.B}}if(null!=this.tint&&0!=this.tint){var oCColorModifiers=new AscFormat.CColorModifiers;var HSL={H:0,S:0,L:0};oCColorModifiers.RGB2HSL(r,g,b,HSL);if(this.tint<0)HSL.L=HSL.L*(1+this.tint);else HSL.L=HSL.L*(1-this.tint)+(g_nHSLMaxValue-g_nHSLMaxValue*(1-this.tint));HSL.L>>=0;var RGB={R:0,G:0,B:0};oCColorModifiers.HSL2RGB(HSL,RGB);r=RGB.R;g=RGB.G;b=RGB.B}nRes|=b;nRes|=g<<8;nRes|=r<<16}this.rgb=nRes}};function CorrectAscColor(asc_color){if(null== asc_color)return null;var ret=null;var _type=asc_color.asc_getType();switch(_type){case Asc.c_oAscColor.COLOR_TYPE_SCHEME:{var _index=asc_color.asc_getValue()>>0;var _id=_index/6>>0;var _pos=_index-_id*6;var basecolor=g_oColorManager.getThemeColor(_id);var aTints=g_oThemeColorsDefaultModsSpreadsheet[AscCommon.GetDefaultColorModsIndex(basecolor.getR(),basecolor.getG(),basecolor.getB())];var tint=aTints[_pos];ret=g_oColorManager.getThemeColor(_id,tint);break}default:{ret=createRgbColor(asc_color.asc_getR(), asc_color.asc_getG(),asc_color.asc_getB())}}return ret}function ColorManager(){this.theme=null;this.aColors=new Array(12)}ColorManager.prototype={isEqual:function(color1,color2,byRgb){var bRes=false;if(null==color1&&null==color2)bRes=true;else if(null!=color1&&null!=color2)if(color1 instanceof ThemeColor&&color2 instanceof ThemeColor||color1 instanceof RgbColor&&color2 instanceof RgbColor||byRgb)bRes=color1.getRgb()==color2.getRgb();return bRes},setTheme:function(theme){this.theme=theme;this.rebuildColors()}, getThemeColor:function(theme,tint){if(null==tint)tint=null;var oColorObj=this.aColors[theme];if(null==oColorObj){oColorObj={};this.aColors[theme]=oColorObj}var oThemeColor=oColorObj[tint];if(null==oThemeColor){oThemeColor=new ThemeColor;oThemeColor.theme=theme;oThemeColor.tint=tint;if(null!=this.theme)oThemeColor.rebuild(this.theme);oColorObj[tint]=oThemeColor}return oThemeColor},rebuildColors:function(){if(null!=this.theme)for(var i=0,length=this.aColors.length;i<length;++i){var oColorObj=this.aColors[i]; for(var j in oColorObj){var oThemeColor=oColorObj[j];oThemeColor.rebuild(this.theme)}}}};g_oColorManager=new ColorManager;var g_oDefaultFormat={XfId:null,Font:null,Fill:null,Num:null,Border:null,Align:null,FillAbs:null,NumAbs:null,BorderAbs:null,AlignAbs:null,ColorAuto:new RgbColor(0),xfs:new CellXfs};function Fragment(val){this.text=null;this.format=null;if(null!=val)this.set(val)}Fragment.prototype.clone=function(){return new Fragment(this)};Fragment.prototype.set=function(oVal){if(null!=oVal.text)this.text= oVal.text;if(null!=oVal.format)this.format=oVal.format};Fragment.prototype.checkVisitedHyperlink=function(row,col,hyperlinkManager){var color=this.format.getColor();if(color instanceof AscCommonExcel.ThemeColor&&g_nColorHyperlink===color.theme&&null===color.tint){var hyperlink=hyperlinkManager.getByCell(row,col);if(hyperlink&&hyperlink.data.getVisited())this.format.setColor(g_oColorManager.getThemeColor(g_nColorHyperlinkVisited,null))}};var g_oFontProperties={fn:0,scheme:1,fs:2,b:3,i:4,u:5,s:6,c:7, va:8};function Font(){this.fn=null;this.scheme=null;this.fs=null;this.b=null;this.i=null;this.u=null;this.s=null;this.c=null;this.va=null;this.skip=null;this.repeat=null;this._hash;this._index}Font.prototype.Properties=g_oFontProperties;Font.prototype.getHash=function(){if(!this._hash){var color=this.c?this.c.getHash():"";this._hash=this.fn+"|"+this.scheme+"|"+this.fs+"|"+this.b+"|"+this.i+"|"+this.u+"|"+this.s+"|"+color+"|"+this.va+"|"+this.skip+"|"+this.repeat}return this._hash};Font.prototype.getIndexNumber= function(){return this._index};Font.prototype.setIndexNumber=function(val){return this._index=val};Font.prototype.initDefault=function(wb){if(!this.fn){var sThemeFont=null;if(null!=wb.theme.themeElements&&null!=wb.theme.themeElements.fontScheme)if(Asc.EFontScheme.fontschemeMinor==this.scheme&&wb.theme.themeElements.fontScheme.minorFont)sThemeFont=wb.theme.themeElements.fontScheme.minorFont.latin;else if(Asc.EFontScheme.fontschemeMajor==this.scheme&&wb.theme.themeElements.fontScheme.majorFont)sThemeFont= wb.theme.themeElements.fontScheme.majorFont.latin;this.fn=sThemeFont?sThemeFont:"Calibri"}if(!this.fs)this.fs=11;if(!this.c)this.c=AscCommonExcel.g_oColorManager.getThemeColor(AscCommonExcel.g_nColorTextDefault)};Font.prototype.assign=function(font){this.fn=font.fn;this.scheme=font.scheme;this.fs=font.fs;this.b=font.b;this.i=font.i;this.u=font.u;this.s=font.s;this.c=font.c;this.va=font.va;this.skip=font.skip;this.repeat=font.repeat};Font.prototype.assignFromObject=function(font){if(null!=font.fn)this.setName(font.fn); if(null!=font.scheme)this.setScheme(font.scheme);if(null!=font.fs)this.setSize(font.fs);if(null!=font.b)this.setBold(font.b);if(null!=font.i)this.setItalic(font.i);if(null!=font.u)this.setUnderline(font.u);if(null!=font.s)this.setStrikeout(font.s);if(null!=font.c)this.setColor(font.c);if(null!=font.va)this.setVerticalAlign(font.va);if(null!=font.skip)this.setSkip(font.skip);if(null!=font.repeat)this.setRepeat(font.repeat)};Font.prototype.assignFromTextPr=function(textPr){if(textPr.FontFamily)this.setName(textPr.FontFamily.Name); this.setSize(textPr.FontSize);this.setBold(textPr.Bold);this.setItalic(textPr.Italic);this.setUnderline(textPr.Underline===true?Asc.EUnderline.underlineSingle:Asc.EUnderline.underlineNone);this.setStrikeout(textPr.Strikeout);this.setVerticalAlign(textPr.VertAlign);if(textPr.Unifill){var color=textPr.Unifill.getRGBAColor();this.setColor(createRgbColor(color.R,color.G,color.B))}else if(textPr.Color)this.setColor(createRgbColor(textPr.Color.r,textPr.Color.g,textPr.Color.b))};Font.prototype.merge=function(font, isTable,isTableColor){var oRes=new Font;oRes.fn=this.fn||font.fn;oRes.scheme=this.scheme||font.scheme;oRes.fs=this.fs||font.fs;oRes.b=null!==this.b?this.b:font.b;if(isTable){oRes.i=null!==font.i?font.i:this.i;oRes.s=null!==font.s?font.s:this.s;oRes.u=font.u||this.u;oRes.va=font.va||this.va}else{oRes.i=null!==this.i?this.i:font.i;oRes.s=null!==this.s?this.s:font.s;oRes.u=this.u||font.u;oRes.va=this.va||font.va}if(isTable&&isTableColor)oRes.c=font.c||this.c;else oRes.c=this.c||font.c;oRes.skip=this.skip|| font.skip;oRes.repeat=this.repeat||font.repeat;return oRes};Font.prototype.isEqual=function(font){var bRes=this.fs==font.fs&&this.b==font.b&&this.i==font.i&&this.u==font.u&&this.s==font.s&&g_oColorManager.isEqual(this.c,font.c)&&this.va==font.va&&this.skip==font.skip&&this.repeat==font.repeat;if(bRes){var schemeThis=this.getScheme();var schemeOther=font.getScheme();if(Asc.EFontScheme.fontschemeNone==schemeThis&&Asc.EFontScheme.fontschemeNone==schemeOther)bRes=this.fn==font.fn;else if(Asc.EFontScheme.fontschemeNone!= schemeThis&&Asc.EFontScheme.fontschemeNone!=schemeOther)bRes=schemeThis==schemeOther;else bRes=false}return bRes};Font.prototype.isEqual2=function(font){return font&&this.getName()===font.getName()&&this.getSize()===font.getSize()&&this.getBold()===font.getBold()&&this.getItalic()===font.getItalic()};Font.prototype.clone=function(){var font=new Font;font.assign(this);return font};Font.prototype.intersect=function(oFont,oDefVal){if(this.fn!=oFont.fn)this.fn=oDefVal.fn;if(this.scheme!=oFont.scheme)this.scheme= oDefVal.scheme;if(this.fs!=oFont.fs)this.fs=oDefVal.fs;if(this.b!=oFont.b)this.b=oDefVal.b;if(this.i!=oFont.i)this.i=oDefVal.i;if(this.u!=oFont.u)this.u=oDefVal.u;if(this.s!=oFont.s)this.s=oDefVal.s;if(false==g_oColorManager.isEqual(this.c,oFont.c))this.c=oDefVal.c;if(this.va!=oFont.va)this.va=oDefVal.va;if(this.skip!=oFont.skip)this.skip=oDefVal.skip;if(this.repeat!=oFont.repeat)this.repeat=oDefVal.repeat};Font.prototype.getName=function(){return this.fn||g_oDefaultFormat.Font.fn};Font.prototype.setName= function(val){return this.fn=val};Font.prototype.getScheme=function(){return this.scheme||Asc.EFontScheme.fontschemeNone};Font.prototype.setScheme=function(val){return null!=val&&Asc.EFontScheme.fontschemeNone!=val?this.scheme=val:this.scheme=null};Font.prototype.getSize=function(){return this.fs||g_oDefaultFormat.Font.fs};Font.prototype.setSize=function(val){return this.fs=val};Font.prototype.getBold=function(){return!!this.b};Font.prototype.setBold=function(val){return val?this.b=true:this.b=null}; Font.prototype.getItalic=function(){return!!this.i};Font.prototype.setItalic=function(val){return val?this.i=true:this.i=null};Font.prototype.getUnderline=function(){return null!=this.u?this.u:Asc.EUnderline.underlineNone};Font.prototype.setUnderline=function(val){return null!=val&&Asc.EUnderline.underlineNone!=val?this.u=val:this.u=null};Font.prototype.getStrikeout=function(){return!!this.s};Font.prototype.setStrikeout=function(val){return val?this.s=true:this.s=null};Font.prototype.getColor=function(){return this.c|| g_oDefaultFormat.ColorAuto};Font.prototype.setColor=function(val){return this.c=val};Font.prototype.getVerticalAlign=function(){return null!=this.va?this.va:AscCommon.vertalign_Baseline};Font.prototype.setVerticalAlign=function(val){return null!=val&&AscCommon.vertalign_Baseline!=val?this.va=val:this.va=null};Font.prototype.getSkip=function(){return!!this.skip};Font.prototype.setSkip=function(val){return val?this.skip=true:this.skip=null};Font.prototype.getRepeat=function(){return!!this.repeat};Font.prototype.setRepeat= function(val){return val?this.repeat=true:this.repeat=null};Font.prototype.getType=function(){return UndoRedoDataTypes.StyleFont};Font.prototype.getProperties=function(){return this.Properties};Font.prototype.getProperty=function(nType){switch(nType){case this.Properties.fn:return this.fn;case this.Properties.scheme:return this.scheme;case this.Properties.fs:return this.fs;case this.Properties.b:return this.b;case this.Properties.i:return this.i;case this.Properties.u:return this.u;case this.Properties.s:return this.s; case this.Properties.c:return this.c;case this.Properties.va:return this.va}};Font.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.fn:this.fn=value;break;case this.Properties.scheme:this.scheme=value;break;case this.Properties.fs:this.fs=value;break;case this.Properties.b:this.b=value;break;case this.Properties.i:this.i=value;break;case this.Properties.u:this.u=value;break;case this.Properties.s:this.s=value;break;case this.Properties.c:this.c=value;break;case this.Properties.va:this.va= value;break}};Font.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("b"===elem)this.b=AscCommon.getBoolFromXml(AscCommon.readValAttr(attr));else if("color"===elem)this.c=AscCommon.getColorFromXml(attr);else if("i"===elem)this.i=AscCommon.getBoolFromXml(AscCommon.readValAttr(attr));else if("name"===elem)this.fn=AscCommon.readValAttr(attr);else if("scheme"===elem)this.scheme=AscCommon.readValAttr(attr);else if("strike"===elem)this.s=AscCommon.getBoolFromXml(AscCommon.readValAttr(attr)); else if("sz"===elem)this.fs=AscCommon.getNumFromXml(AscCommon.readValAttr(attr));else if("u"===elem)switch(AscCommon.readValAttr(attr)){case "single":this.u=Asc.EUnderline.underlineSingle;break;case "double":this.u=Asc.EUnderline.underlineDouble;break;case "singleAccounting":this.u=Asc.EUnderline.underlineSingleAccounting;break;case "doubleAccounting":this.u=Asc.EUnderline.underlineDoubleAccounting;break;case "none":this.u=Asc.EUnderline.underlineNone;break}else if("vertAlign"===elem)switch(AscCommon.readValAttr(attr)){case "baseline":this.va= AscCommon.vertalign_Baseline;break;case "superscript":this.va=AscCommon.vertalign_SuperScript;break;case "subscript":this.va=AscCommon.vertalign_SubScript;break}else newContext=null;return newContext};Font.prototype.checkSchemeFont=function(theme){if(null!=this.scheme&&theme){var fontScheme=theme.themeElements.fontScheme;var sFontName=null;switch(this.scheme){case Asc.EFontScheme.fontschemeMinor:sFontName=fontScheme.minorFont.latin;break;case Asc.EFontScheme.fontschemeMajor:sFontName=fontScheme.majorFont.latin; break}if(null!=sFontName&&""!=sFontName)this.fn=sFontName}};Font.prototype.fromXLSB=function(stream){var dyHeight=stream.GetUShortLE();if(dyHeight>=20)this.fs=dyHeight/20;var grbit=stream.GetUShortLE();if(0!==(grbit&2))this.i=true;if(0!==(grbit&8))this.s=true;var bls=stream.GetUShortLE();if(700==bls)this.b=true;var sss=stream.GetUShortLE();if(sss>0)switch(sss){case 1:this.va=AscCommon.vertalign_SuperScript;break;case 2:this.va=AscCommon.vertalign_SubScript;break}var uls=stream.GetUChar();if(uls>0)switch(uls){case 1:this.u= Asc.EUnderline.underlineSingle;break;case 2:this.u=Asc.EUnderline.underlineDouble;break;case 33:this.u=Asc.EUnderline.underlineSingleAccounting;break;case 34:this.u=Asc.EUnderline.underlineDoubleAccounting;break}stream.Skip2(3);var xColorType=stream.GetUChar();var index=stream.GetUChar();var nTintAndShade=stream.GetShortLE();var rgba=stream.GetULongLE();var isActualRgb=0!==(xColorType&1);xColorType&=254;var tint=null;if(0!=nTintAndShade)tint=nTintAndShade/32767;var theme=null;if(6==xColorType){theme= 1;switch(index){case 1:theme=0;break;case 0:theme=1;break;case 3:theme=2;break;case 2:theme=3;break;default:theme=index;break}this.c=AscCommonExcel.g_oColorManager.getThemeColor(theme,tint)}else if(isActualRgb)this.c=AscCommonExcel.createRgbColor(rgba&255,(rgba&65280)>>8,(rgba&16711680)>>16);var bFontScheme=stream.GetUChar();if(bFontScheme>0)switch(bFontScheme){case 1:this.scheme=Asc.EFontScheme.fontschemeMajor;break;case 2:this.scheme=Asc.EFontScheme.fontschemeMinor;break}this.fn=stream.GetString()}; var c_oAscPatternType={DarkDown:0,DarkGray:1,DarkGrid:2,DarkHorizontal:3,DarkTrellis:4,DarkUp:5,DarkVertical:6,Gray0625:7,Gray125:8,LightDown:9,LightGray:10,LightGrid:11,LightHorizontal:12,LightTrellis:13,LightUp:14,LightVertical:15,MediumGray:16,None:17,Solid:18};function hatchFromExcelToWord(val){switch(val){case c_oAscPatternType.DarkDown:return"dkDnDiag";case c_oAscPatternType.DarkGray:return"pct70";case c_oAscPatternType.DarkGrid:return"smCheck";case c_oAscPatternType.DarkHorizontal:return"dkHorz"; case c_oAscPatternType.DarkTrellis:return"trellis";case c_oAscPatternType.DarkUp:return"dkUpDiag";case c_oAscPatternType.DarkVertical:return"dkVert";case c_oAscPatternType.Gray0625:return"pct10";case c_oAscPatternType.Gray125:return"pct20";case c_oAscPatternType.LightDown:return"ltDnDiag";case c_oAscPatternType.LightGray:return"pct25";case c_oAscPatternType.LightGrid:return"smGrid";case c_oAscPatternType.LightHorizontal:return"ltHorz";case c_oAscPatternType.LightTrellis:return"pct30";case c_oAscPatternType.LightUp:return"ltUpDiag"; case c_oAscPatternType.LightVertical:return"ltVert";case c_oAscPatternType.MediumGray:default:return"pct50"}}function FromXml_ST_GradientType(val){var res=-1;if("linear"===val)res=Asc.c_oAscFillGradType.GRAD_LINEAR;else if("path"===val)res=Asc.c_oAscFillGradType.GRAD_PATH;return res}function FromXml_ST_PatternType(val){var res=-1;if("none"===val)res=c_oAscPatternType.None;else if("solid"===val)res=c_oAscPatternType.Solid;else if("mediumGray"===val)res=c_oAscPatternType.MediumGray;else if("darkGray"=== val)res=c_oAscPatternType.DarkGray;else if("lightGray"===val)res=c_oAscPatternType.LightGray;else if("darkHorizontal"===val)res=c_oAscPatternType.DarkHorizontal;else if("darkVertical"===val)res=c_oAscPatternType.DarkVertical;else if("darkDown"===val)res=c_oAscPatternType.DarkDown;else if("darkUp"===val)res=c_oAscPatternType.DarkUp;else if("darkGrid"===val)res=c_oAscPatternType.DarkGrid;else if("darkTrellis"===val)res=c_oAscPatternType.DarkTrellis;else if("lightHorizontal"===val)res=c_oAscPatternType.LightHorizontal; else if("lightVertical"===val)res=c_oAscPatternType.LightVertical;else if("lightDown"===val)res=c_oAscPatternType.LightDown;else if("lightUp"===val)res=c_oAscPatternType.LightUp;else if("lightGrid"===val)res=c_oAscPatternType.LightGrid;else if("lightTrellis"===val)res=c_oAscPatternType.LightTrellis;else if("gray125"===val)res=c_oAscPatternType.Gray125;else if("gray0625"===val)res=c_oAscPatternType.Gray0625;return res}function GradientFill(){this.type=Asc.c_oAscFillGradType.GRAD_LINEAR;this.degree= 0;this.left=0;this.right=0;this.top=0;this.bottom=0;this.stop=[];this._hash=null}GradientFill.prototype.Properties={type:0,degree:1,left:2,right:3,top:4,bottom:5,stop:6};GradientFill.prototype.getType=function(){return UndoRedoDataTypes.StyleGradientFill};GradientFill.prototype.getProperties=function(){return this.Properties};GradientFill.prototype.getProperty=function(nType){switch(nType){case this.Properties.type:return this.type;break;case this.Properties.degree:return this.degree;break;case this.Properties.left:return this.left; break;case this.Properties.right:return this.right;break;case this.Properties.top:return this.top;break;case this.Properties.bottom:return this.bottom;break;case this.Properties.stop:return this.stop;break}};GradientFill.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.type:this.type=value;break;case this.Properties.degree:this.degree=value;break;case this.Properties.left:this.left=value;break;case this.Properties.right:this.right=value;break;case this.Properties.top:this.top= value;break;case this.Properties.bottom:this.bottom=value;break;case this.Properties.stop:this.stop=value;break}};GradientFill.prototype.getHash=function(){if(!this._hash){this._hash=this.type+";"+this.degree+";"+this.left+";"+this.right+";"+this.top+";"+this.bottom+";"+this.stop.length;for(var i=0;i<this.stop.length;++i)this._hash+=";"+this.stop[i].getHash()}return this._hash};GradientFill.prototype.isEqual=function(gradientFill){var res=this.type===gradientFill.type&&this.degree===gradientFill.degree&& this.left===gradientFill.left&&this.right===gradientFill.right&&this.top===gradientFill.top&&this.bottom===gradientFill.bottom&&this.stop.length==gradientFill.stop.length;if(res)for(var i=0;i<this.stop.length;++i)res=res&&this.stop[i].isEqual(gradientFill.stop[i]);return res};GradientFill.prototype.clone=function(){var res=new GradientFill;res.type=this.type;res.degree=this.degree;res.left=this.left;res.right=this.right;res.top=this.top;res.bottom=this.bottom;for(var i=0;i<this.stop.length;++i)res.stop[i]= this.stop[i].clone();return res};GradientFill.prototype.notEmpty=function(){return true};GradientFill.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["type"];if(undefined!==val){val=FromXml_ST_GradientType(val);if(-1!==val)this.type=val}val=vals["degree"];if(undefined!==val)this.degree=val-0;val=vals["left"];if(undefined!==val)this.left=val-0;val=vals["right"];if(undefined!==val)this.right=val-0;val=vals["top"];if(undefined!==val)this.top=val-0;val=vals["bottom"]; if(undefined!==val)this.bottom=val-0}};GradientFill.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("stop"===elem){newContext=new GradientStop;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.stop.push(newContext)}else newContext=null;return newContext};GradientFill.prototype.asc_getType=function(){return this.type};GradientFill.prototype.asc_setType=function(value){this.type=value};GradientFill.prototype.asc_getDegree=function(){return this.degree};GradientFill.prototype.asc_setDegree= function(value){this.degree=value};GradientFill.prototype.asc_getLeft=function(){return this.left};GradientFill.prototype.asc_setLeft=function(value){this.left=value};GradientFill.prototype.asc_getRight=function(){return this.right};GradientFill.prototype.asc_setRight=function(value){this.right=value};GradientFill.prototype.asc_getTop=function(){return this.top};GradientFill.prototype.asc_setTop=function(value){this.top=value};GradientFill.prototype.asc_getBottom=function(){return this.bottom};GradientFill.prototype.asc_setBottom= function(value){this.bottom=value};GradientFill.prototype.asc_getGradientStops=function(){var res=[];for(var i=0;i<this.stop.length;++i)res[i]=this.stop[i].clone();return res};GradientFill.prototype.asc_putGradientStops=function(value){this.stop=value};function GradientStop(){this.position=null;this.color=null;this._hash=null}GradientStop.prototype.Properties={position:0,color:1};GradientStop.prototype.getType=function(){return UndoRedoDataTypes.StyleGradientFillStop};GradientStop.prototype.getProperties= function(){return this.Properties};GradientStop.prototype.getProperty=function(nType){switch(nType){case this.Properties.position:return this.position;break;case this.Properties.color:return this.color;break}};GradientStop.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.position:this.position=value;break;case this.Properties.color:this.color=value;break}};GradientStop.prototype.getHash=function(){if(!this._hash){var color=this.color?this.color.getHash():"";this._hash= this.position+";"+color}return this._hash};GradientStop.prototype.isEqual=function(gradientStop){return this.position===gradientStop.position&&g_oColorManager.isEqual(this.color,gradientStop.color)};GradientStop.prototype.clone=function(){var res=new GradientStop;res.position=this.position;res.color=this.color;return res};GradientStop.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["position"];if(undefined!==val)this.position=val-0}};GradientStop.prototype.onStartNode= function(elem,attr,uq){var newContext=this;if("color"===elem)this.color=AscCommon.getColorFromXml(attr);else newContext=null;return newContext};GradientStop.prototype.asc_getPosition=function(){return this.position};GradientStop.prototype.asc_setPosition=function(value){this.position=value};GradientStop.prototype.asc_getColor=function(){return Asc.colorObjToAscColor(this.color)};GradientStop.prototype.asc_setColor=function(value){this.color=CorrectAscColor(value)};function PatternFill(){this.patternType= c_oAscPatternType.None;this.fgColor=null;this.bgColor=null;this._hash=null}PatternFill.prototype.Properties={patternType:0,fgColor:1,bgColor:2};PatternFill.prototype.getType=function(){return UndoRedoDataTypes.StylePatternFill};PatternFill.prototype.getProperties=function(){return this.Properties};PatternFill.prototype.getProperty=function(nType){switch(nType){case this.Properties.patternType:return this.patternType;case this.Properties.fgColor:return this.fgColor;case this.Properties.bgColor:return this.bgColor}}; PatternFill.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.patternType:this.patternType=value;break;case this.Properties.fgColor:this.fgColor=value;break;case this.Properties.bgColor:this.bgColor=value;break}};PatternFill.prototype.getHatchOffset=function(){return AscCommon.global_hatch_offsets[hatchFromExcelToWord(this.patternType)]};PatternFill.prototype.fromParams=function(type,color){this.patternType=type;this.fgColor=color;this.bgColor=color};PatternFill.prototype.fromColor= function(color){this.fromParams(c_oAscPatternType.Solid,color)};PatternFill.prototype.getHash=function(){if(!this._hash){this._hash=this.patternType+";";if(this.fgColor)this._hash+=this.fgColor.getHash();this._hash+=";";if(this.bgColor)this._hash+=this.bgColor.getHash()}return this._hash};PatternFill.prototype.isEqual=function(patternFill){return this.patternType===patternFill.patternType&&g_oColorManager.isEqual(this.fgColor,patternFill.fgColor)&&g_oColorManager.isEqual(this.bgColor,patternFill.bgColor)}; PatternFill.prototype.clone=function(){var res=new PatternFill;res.patternType=this.patternType;res.fgColor=this.fgColor;res.bgColor=this.bgColor;return res};PatternFill.prototype.notEmpty=function(){return c_oAscPatternType.None!==this.patternType};PatternFill.prototype.fixForDxf=function(){if((c_oAscPatternType.None===this.patternType||c_oAscPatternType.Solid===this.patternType)&&null!==this.bgColor){this.patternType=c_oAscPatternType.Solid;var tmp=this.fgColor;this.fgColor=this.bgColor;this.bgColor= tmp||this.bgColor}};PatternFill.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["patternType"];if(undefined!==val){val=FromXml_ST_PatternType(val);if(-1!==val)this.patternType=val}}};PatternFill.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("fgColor"===elem)this.fgColor=AscCommon.getColorFromXml(attr);else if("bgColor"===elem)this.bgColor=AscCommon.getColorFromXml(attr);else newContext=null;return newContext};PatternFill.prototype.asc_getType= function(){return c_oAscPatternType.Solid===this.patternType?-1:this.getHatchOffset()};PatternFill.prototype.asc_setType=function(value){switch(value){case -1:this.patternType=c_oAscPatternType.Solid;break;case 8:this.patternType=c_oAscPatternType.DarkDown;break;case 9:this.patternType=c_oAscPatternType.DarkHorizontal;break;case 10:this.patternType=c_oAscPatternType.DarkUp;break;case 11:this.patternType=c_oAscPatternType.DarkVertical;break;case 20:this.patternType=c_oAscPatternType.LightDown;break; case 21:this.patternType=c_oAscPatternType.LightHorizontal;break;case 22:this.patternType=c_oAscPatternType.LightUp;break;case 23:this.patternType=c_oAscPatternType.LightVertical;break;case 27:this.patternType=c_oAscPatternType.Gray0625;break;case 28:this.patternType=c_oAscPatternType.Gray125;break;case 29:this.patternType=c_oAscPatternType.LightGray;break;case 30:this.patternType=c_oAscPatternType.LightTrellis;break;case 33:this.patternType=c_oAscPatternType.MediumGray;break;case 35:this.patternType= c_oAscPatternType.DarkGray;break;case 41:this.patternType=c_oAscPatternType.DarkGrid;break;case 43:this.patternType=c_oAscPatternType.LightGrid;break;case 46:default:this.patternType=c_oAscPatternType.DarkTrellis;break}};PatternFill.prototype.asc_getFgColor=function(){return Asc.colorObjToAscColor(this.fgColor)};PatternFill.prototype.asc_setFgColor=function(value){this.fgColor=CorrectAscColor(value)};PatternFill.prototype.asc_getBgColor=function(){return Asc.colorObjToAscColor(this.bgColor)};PatternFill.prototype.asc_setBgColor= function(value){this.bgColor=CorrectAscColor(value)};function Fill(){this.patternFill=null;this.gradientFill=null;this._hash=null;this._index}Fill.prototype.Properties={patternFill:0,gradientFill:1};Fill.prototype.hasFill=function(){return this.patternFill&&c_oAscPatternType.None!==this.patternFill.patternType||this.gradientFill};Fill.prototype.getSolidFill=function(){return this.patternFill&&c_oAscPatternType.Solid===this.patternFill.patternType?this.patternFill.fgColor||createRgbColor(255,255,255): null};Fill.prototype.bg=function(){var res=null;if(this.patternFill&&c_oAscPatternType.None!==this.patternFill.patternType)res=this.patternFill.fgColor||AscCommonExcel.g_oColorManager.getThemeColor(g_nColorTextDefault,0);return res};Fill.prototype.fixForDxf=function(){if(this.patternFill)this.patternFill.fixForDxf()};Fill.prototype.fromColor=function(color){this.patternFill=null;this.gradientFill=null;if(color){this.patternFill=new PatternFill;this.patternFill.fromColor(color)}};Fill.prototype.fromPatternParams= function(type,color){this.patternFill=null;this.gradientFill=null;if(null!==type){this.patternFill=new PatternFill;this.patternFill.fromParams(type,color)}};Fill.prototype.getHash=function(){if(!this._hash){this._hash=(this.patternFill?this.patternFill.getHash():"")+"|";this._hash+=this.gradientFill?this.gradientFill.getHash():""}return this._hash};Fill.prototype.getIndexNumber=function(){return this._index};Fill.prototype.setIndexNumber=function(val){return this._index=val};Fill.prototype.isEqual= function(fill){if(this.patternFill&&fill.patternFill)return this.patternFill.isEqual(fill.patternFill);else if(this.gradientFill&&fill.gradientFill)return this.gradientFill.isEqual(fill.gradientFill);return false};Fill.prototype.clone=function(){var res=new Fill;res.patternFill=this.patternFill?this.patternFill.clone():null;res.gradientFill=this.gradientFill?this.gradientFill.clone():null;return res};Fill.prototype.getType=function(){return UndoRedoDataTypes.StyleFill};Fill.prototype.getProperties= function(){return this.Properties};Fill.prototype.getProperty=function(nType){switch(nType){case this.Properties.patternFill:return this.patternFill;case this.Properties.gradientFill:return this.gradientFill}};Fill.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.patternFill:this.patternFill=value;break;case this.Properties.gradientFill:this.gradientFill=value;break}};Fill.prototype.notEmpty=function(){return this.patternFill&&this.patternFill.notEmpty()||this.gradientFill&& this.gradientFill.notEmpty()};Fill.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("gradientFill"===elem){newContext=new GradientFill;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.gradientFill=newContext}else if("patternFill"===elem){newContext=new PatternFill;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.patternFill=newContext}else newContext=null;return newContext};Fill.prototype.onEndNode=function(prevContext,elem){if("patternFill"=== elem&&AscCommon.openXml.SaxParserDataTransfer.priorityBg)prevContext.fixForDxf()};Fill.prototype.asc_getPatternFill=function(){return this.patternFill&&this.patternFill.notEmpty()?this.patternFill:null};Fill.prototype.asc_setPatternFill=function(value){this.patternFill=value;this.gradientFill=null};Fill.prototype.asc_getGradientFill=function(){return this.gradientFill};Fill.prototype.asc_setGradientFill=function(value){this.patternFill=null;this.gradientFill=value};function FromXml_ST_BorderStyle(val){var res= -1;if("none"===val)res=c_oAscBorderStyles.None;else if("thin"===val)res=c_oAscBorderStyles.Thin;else if("medium"===val)res=c_oAscBorderStyles.Medium;else if("dashed"===val)res=c_oAscBorderStyles.Dashed;else if("dotted"===val)res=c_oAscBorderStyles.Dotted;else if("thick"===val)res=c_oAscBorderStyles.Thick;else if("double"===val)res=c_oAscBorderStyles.Double;else if("hair"===val)res=c_oAscBorderStyles.Hair;else if("mediumDashed"===val)res=c_oAscBorderStyles.MediumDashed;else if("dashDot"===val)res= c_oAscBorderStyles.DashDot;else if("mediumDashDot"===val)res=c_oAscBorderStyles.MediumDashDot;else if("dashDotDot"===val)res=c_oAscBorderStyles.DashDotDot;else if("mediumDashDotDot"===val)res=c_oAscBorderStyles.MediumDashDotDot;else if("slantDashDot"===val)res=c_oAscBorderStyles.SlantDashDot;return res}var g_oBorderPropProperties={s:0,c:1};function BorderProp(){this.s=c_oAscBorderStyles.None;this.w=c_oAscBorderWidth.None;this.c=g_oColorManager.getThemeColor(1)}BorderProp.prototype.Properties=g_oBorderPropProperties; BorderProp.prototype.getHash=function(){if(!this._hash){var color=this.c?this.c.getHash():"";this._hash=this.s+";"+this.w+";"+color}return this._hash};BorderProp.prototype.setStyle=function(style){this.s=style;switch(this.s){case c_oAscBorderStyles.Thin:case c_oAscBorderStyles.DashDot:case c_oAscBorderStyles.DashDotDot:case c_oAscBorderStyles.Dashed:case c_oAscBorderStyles.Dotted:case c_oAscBorderStyles.Hair:this.w=c_oAscBorderWidth.Thin;break;case c_oAscBorderStyles.Medium:case c_oAscBorderStyles.MediumDashDot:case c_oAscBorderStyles.MediumDashDotDot:case c_oAscBorderStyles.MediumDashed:case c_oAscBorderStyles.SlantDashDot:this.w= c_oAscBorderWidth.Medium;break;case c_oAscBorderStyles.Thick:case c_oAscBorderStyles.Double:this.w=c_oAscBorderWidth.Thick;break;default:this.w=c_oAscBorderWidth.None;break}};BorderProp.prototype.getDashSegments=function(){var res;switch(this.s){case c_oAscBorderStyles.Hair:res=[1,1];break;case c_oAscBorderStyles.Dotted:res=[2,2];break;case c_oAscBorderStyles.DashDotDot:case c_oAscBorderStyles.MediumDashDotDot:res=[3,3,3,3,9,3];break;case c_oAscBorderStyles.DashDot:case c_oAscBorderStyles.MediumDashDot:case c_oAscBorderStyles.SlantDashDot:res= [3,3,9,3];break;case c_oAscBorderStyles.Dashed:res=[3,1];break;case c_oAscBorderStyles.MediumDashed:res=[9,3];break;case c_oAscBorderStyles.Thin:case c_oAscBorderStyles.Medium:case c_oAscBorderStyles.Thick:case c_oAscBorderStyles.Double:default:res=[];break}return res};BorderProp.prototype.getRgbOrNull=function(){var nRes=null;if(null!=this.c)nRes=this.c.getRgb();return nRes};BorderProp.prototype.isEmpty=function(){return c_oAscBorderStyles.None===this.s};BorderProp.prototype.isEqual=function(val, byRgb){return this.s===val.s&&g_oColorManager.isEqual(this.c,val.c,byRgb)};BorderProp.prototype.clone=function(){var res=new BorderProp;res.merge(this);return res};BorderProp.prototype.merge=function(oBorderProp){if(null!=oBorderProp.s&&c_oAscBorderStyles.None!==oBorderProp.s){this.s=oBorderProp.s;this.w=oBorderProp.w;if(null!=oBorderProp.c)this.c=oBorderProp.c}};BorderProp.prototype.getType=function(){return UndoRedoDataTypes.StyleBorderProp};BorderProp.prototype.getProperties=function(){return this.Properties}; BorderProp.prototype.getProperty=function(nType){switch(nType){case this.Properties.s:return this.s;break;case this.Properties.c:return this.c;break}};BorderProp.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.s:this.setStyle(value);break;case this.Properties.c:this.c=value;break}};BorderProp.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["style"];if(undefined!==val){val=FromXml_ST_BorderStyle(val);if(-1!==val)this.setStyle(val)}}}; BorderProp.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("color"===elem)this.c=AscCommon.getColorFromXml(attr);else newContext=null;return newContext};var g_oBorderProperties={l:0,t:1,r:2,b:3,d:4,ih:5,iv:6,dd:7,du:8};function Border(val){if(null==val)val=g_oDefaultFormat.BorderAbs;this.l=val.l.clone();this.t=val.t.clone();this.r=val.r.clone();this.b=val.b.clone();this.d=val.d.clone();this.ih=val.ih.clone();this.iv=val.iv.clone();this.dd=val.dd;this.du=val.du;this._hash;this._index} Border.prototype.Properties=g_oBorderProperties;Border.prototype.getHash=function(){if(!this._hash){this._hash=(this.l?this.l.getHash():"")+"|";this._hash+=(this.t?this.t.getHash():"")+"|";this._hash+=(this.r?this.r.getHash():"")+"|";this._hash+=(this.b?this.b.getHash():"")+"|";this._hash+=(this.d?this.d.getHash():"")+"|";this._hash+=(this.ih?this.ih.getHash():"")+"|";this._hash+=(this.iv?this.iv.getHash():"")+"|";this._hash+=this.dd+"|";this._hash+=this.du}return this._hash};Border.prototype.getIndexNumber= function(){return this._index};Border.prototype.setIndexNumber=function(val){return this._index=val};Border.prototype._mergeProperty=function(first,second,def){if(first.s!==c_oAscBorderStyles.None)return first;else return second};Border.prototype.merge=function(border,isTable){var defaultBorder=g_oDefaultFormat.Border;var oRes=new Border;if(isTable){oRes.l=this._mergeProperty(this.l,border.l,defaultBorder.l).clone();oRes.t=this._mergeProperty(this.t,border.t,defaultBorder.t).clone();oRes.r=this._mergeProperty(this.r, border.r,defaultBorder.r).clone();oRes.b=this._mergeProperty(this.b,border.b,defaultBorder.b).clone();oRes.ih=this._mergeProperty(this.ih,border.ih,defaultBorder.ih).clone();oRes.iv=this._mergeProperty(this.iv,border.iv,defaultBorder.iv).clone();oRes.d=this._mergeProperty(this.d,border.d,defaultBorder.d).clone();oRes.dd=this.dd||border.dd;oRes.du=this.du||border.du}else{oRes.l=this.l.clone();oRes.t=this.t.clone();oRes.r=this.r.clone();oRes.b=this.b.clone();oRes.ih=this.ih.clone();oRes.iv=this.iv.clone(); oRes.d=this._mergeProperty(this.d,border.d,defaultBorder.d).clone();oRes.dd=this.dd||border.dd;oRes.du=this.du||border.du}return oRes};Border.prototype.getDif=function(val){var oRes=new Border(this);var bEmpty=true;if(true==this.l.isEqual(val.l))oRes.l=null;else bEmpty=false;if(true==this.t.isEqual(val.t))oRes.t=null;else bEmpty=false;if(true==this.r.isEqual(val.r))oRes.r=null;else bEmpty=false;if(true==this.b.isEqual(val.b))oRes.b=null;else bEmpty=false;if(true==this.d.isEqual(val.d))oRes.d=null; if(true==this.ih.isEqual(val.ih))oRes.ih=null;else bEmpty=false;if(true==this.iv.isEqual(val.iv))oRes.iv=null;else bEmpty=false;if(this.dd==val.dd)oRes.dd=null;else bEmpty=false;if(this.du==val.du)oRes.du=null;else bEmpty=false;if(bEmpty)oRes=null;return oRes};Border.prototype.intersect=function(border,def,byRgb){if(!this.l.isEqual(border.l,byRgb))this.l=def.l;if(!this.t.isEqual(border.t,byRgb))this.t=def.t;if(!this.r.isEqual(border.r,byRgb))this.r=def.r;if(!this.b.isEqual(border.b,byRgb))this.b= def.b;if(!this.d.isEqual(border.d,byRgb)){this.d=def.d;this.dd=false;this.du=false}if(!this.ih.isEqual(border.ih,byRgb))this.ih=def.ih;if(!this.iv.isEqual(border.iv,byRgb))this.iv=def.iv;if(this.dd!==border.dd)this.dd=def.dd};Border.prototype.isEqual=function(val){return this.l.isEqual(val.l)&&this.t.isEqual(val.t)&&this.r.isEqual(val.r)&&this.b.isEqual(val.b)&&this.d.isEqual(val.d)&&this.ih.isEqual(val.ih)&&this.iv.isEqual(val.iv)&&this.dd==val.dd&&this.du==val.du};Border.prototype.clone=function(){return new Border(this)}; Border.prototype.clean=function(){var defaultBorder=g_oDefaultFormat.Border;this.l=defaultBorder.l.clone();this.t=defaultBorder.t.clone();this.r=defaultBorder.r.clone();this.b=defaultBorder.b.clone();this.d=defaultBorder.d.clone();this.ih=defaultBorder.ih.clone();this.iv=defaultBorder.iv.clone();this.dd=defaultBorder.dd;this.du=defaultBorder.du};Border.prototype.mergeInner=function(border){if(border){if(border.l)this.l.merge(border.l);if(border.t)this.t.merge(border.t);if(border.r)this.r.merge(border.r); if(border.b)this.b.merge(border.b);if(border.d)this.d.merge(border.d);if(border.ih)this.ih.merge(border.ih);if(border.iv)this.iv.merge(border.iv);if(null!=border.dd)this.dd=this.dd||border.dd;if(null!=border.du)this.du=this.du||border.du}};Border.prototype.getType=function(){return UndoRedoDataTypes.StyleBorder};Border.prototype.getProperties=function(){return this.Properties};Border.prototype.getProperty=function(nType){switch(nType){case this.Properties.l:return this.l;break;case this.Properties.t:return this.t; break;case this.Properties.r:return this.r;break;case this.Properties.b:return this.b;break;case this.Properties.d:return this.d;break;case this.Properties.ih:return this.ih;break;case this.Properties.iv:return this.iv;break;case this.Properties.dd:return this.dd;break;case this.Properties.du:return this.du;break}};Border.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.l:this.l=value;break;case this.Properties.t:this.t=value;break;case this.Properties.r:this.r=value; break;case this.Properties.b:this.b=value;break;case this.Properties.d:this.d=value;break;case this.Properties.ih:this.ih=value;break;case this.Properties.iv:this.iv=value;break;case this.Properties.dd:this.dd=value;break;case this.Properties.du:this.du=value;break}};Border.prototype.notEmpty=function(){return this.l&&c_oAscBorderStyles.None!==this.l.s||this.r&&c_oAscBorderStyles.None!==this.r.s||this.t&&c_oAscBorderStyles.None!==this.t.s||this.b&&c_oAscBorderStyles.None!==this.b.s||this.dd&&c_oAscBorderStyles.None!== this.dd.s||this.du&&c_oAscBorderStyles.None!==this.du.s};Border.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["diagonalUp"];if(undefined!==val)this.du=AscCommon.getBoolFromXml(val);val=vals["diagonalDown"];if(undefined!==val)this.dd=AscCommon.getBoolFromXml(val)}};Border.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("start"===elem||"left"===elem){newContext=new BorderProp;if(newContext.readAttributes)newContext.readAttributes(attr,uq); this.l=newContext}else if("end"===elem||"right"===elem){newContext=new BorderProp;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.r=newContext}else if("top"===elem){newContext=new BorderProp;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.t=newContext}else if("bottom"===elem){newContext=new BorderProp;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.b=newContext}else if("diagonal"===elem){newContext=new BorderProp;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.d=newContext}else if("vertical"===elem){newContext=new BorderProp;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.iv=newContext}else if("horizontal"===elem){newContext=new BorderProp;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.ih=newContext}else newContext=null;return newContext};var g_oNumProperties={f:0,id:1};function Num(val){if(null==val)val=g_oDefaultFormat.NumAbs;this.f=val.f;this.id=val.id;this._hash;this._index}Num.prototype.Properties= g_oNumProperties;Num.prototype.getHash=function(){if(!this._hash)this._hash=this.f+"|"+this.id;return this._hash};Num.prototype.getIndexNumber=function(){return this._index};Num.prototype.setIndexNumber=function(val){this._index=val};Num.prototype.initFromParams=function(id,format,oNumFmts){var res=oNumFmts&&oNumFmts[id];if(res)return res;res=new Num;if(format)res.f=format;else res.f=AscCommonExcel.aStandartNumFormats[id];if(!res.f)res.f="General";if(5<=id&&id<=8||14<=id&&id<=17||22==id||27<=id&& id<=31||36<=id&&id<=44)res.id=id;var numFormat=AscCommon.oNumFormatCache.get(res.f);numFormat.checkCultureInfoFontPicker();res=g_StyleCache.addNum(res);if(oNumFmts)oNumFmts[res.id]=res;return res};Num.prototype.setFormat=function(f,opt_id){this.f=f;this.id=opt_id};Num.prototype.getFormat=function(){return null!=this.id?AscCommon.getFormatByStandardId(this.id)||this.f:this.f};Num.prototype.getNumFormat=function(){return AscCommon.oNumFormatCache.get(this.getFormat())};Num.prototype._mergeProperty= function(first,second,def){if(def!=first)return first;else return second};Num.prototype.merge=function(num){var oRes=new Num;oRes.f=this._mergeProperty(this.f,num.f,g_oDefaultFormat.Num.f);oRes.id=this._mergeProperty(this.id,num.id,g_oDefaultFormat.Num.id);return oRes};Num.prototype.isEqual=function(val){if(null!=this.id&&null!=val.id)return this.id==val.id;else if(null!=this.id||null!=val.id)return false;else return this.f==val.f};Num.prototype.clone=function(){return new Num(this)};Num.prototype.getType= function(){return UndoRedoDataTypes.StyleNum};Num.prototype.getProperties=function(){return this.Properties};Num.prototype.getProperty=function(nType){switch(nType){case this.Properties.f:return this.f;break;case this.Properties.id:return this.id;break}};Num.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.f:this.f=value;break;case this.Properties.id:this.id=value;break}};Num.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["numFmtId"]; var sFormat=null;var id;if(undefined!==val)id=val-0;val=vals["formatCode"];if(undefined!==val)sFormat=AscCommon.unleakString(uq(val));this.f=null!=sFormat?sFormat:AscCommonExcel.aStandartNumFormats[id]||"General";if(5<=id&&id<=8||14<=id&&id<=17||22==id||27<=id&&id<=31||36<=id&&id<=44)this.id=id}};var g_oCellXfsProperties={border:0,fill:1,font:2,num:3,align:4,QuotePrefix:5,XfId:6,PivotButton:7};function CellXfs(){this.border=null;this.fill=null;this.font=null;this.num=null;this.align=null;this.QuotePrefix= null;this.PivotButton=null;this.XfId=null;this._hash;this._index;this.operationCache={}}CellXfs.prototype.Properties=g_oCellXfsProperties;CellXfs.prototype.getHash=function(){if(!this._hash){this._hash=(this.border?this.border.getIndexNumber():"")+"|";this._hash+=(this.fill?this.fill.getIndexNumber():"")+"|";this._hash+=(this.font?this.font.getIndexNumber():"")+"|";this._hash+=(this.num?this.num.getIndexNumber():"")+"|";this._hash+=(this.align?this.align.getIndexNumber():"")+"|";this._hash+=this.QuotePrefix+ "|";this._hash+=this.PivotButton+"|";this._hash+=this.XfId+"|"}return this._hash};CellXfs.prototype.getIndexNumber=function(){return this._index};CellXfs.prototype.setIndexNumber=function(val){this._index=val};CellXfs.prototype._mergeProperty=function(addFunc,first,second,isTable,isTableColor){var res=null;if(null!=first||null!=second)if(null==first)res=second;else if(null==second)res=first;else if(null!=first.merge)res=addFunc.call(g_StyleCache,first.merge(second,isTable,isTableColor));else res= first;return res};CellXfs.prototype.merge=function(xfs,isTable){var xfIndexNumber=xfs.getIndexNumber();if(undefined===xfIndexNumber){xfs=g_StyleCache.addXf(xfs);xfIndexNumber=xfs.getIndexNumber()}var cache=this.getOperationCache("merge",xfIndexNumber);if(!cache){cache=new CellXfs;cache.border=this._mergeProperty(g_StyleCache.addBorder,xfs.border,this.border,isTable);if(isTable&&(g_StyleCache.firstXf===xfs||g_StyleCache.normalXf.fill===xfs.fill))if(g_StyleCache.normalXf.fill===xfs.fill)cache.fill= this._mergeProperty(g_StyleCache.addFill,this.fill,g_oDefaultFormat.Fill);else cache.fill=this._mergeProperty(g_StyleCache.addFill,this.fill,xfs.fill);else cache.fill=this._mergeProperty(g_StyleCache.addFill,xfs.fill,this.fill);var isTableColor=true;if(isTable&&(g_StyleCache.firstXf===xfs||g_StyleCache.normalXf.font===xfs.font))if(g_StyleCache.normalXf.font===xfs.font)cache.font=this._mergeProperty(g_StyleCache.addFont,g_oDefaultFormat.Font,this.font,isTable,isTableColor);else cache.font=this._mergeProperty(g_StyleCache.addFont, xfs.font,this.font,isTable,isTableColor);else{isTableColor=isTable&&xfs.font&&xfs.font.c&&xfs.font.c.isEqual(g_StyleCache.normalXf.font.c);cache.font=this._mergeProperty(g_StyleCache.addFont,xfs.font,this.font,isTable,isTableColor)}cache.num=this._mergeProperty(g_StyleCache.addNum,xfs.num,this.num);cache.align=this._mergeProperty(g_StyleCache.addAlign,xfs.align,this.align);cache.QuotePrefix=this._mergeProperty(null,xfs.QuotePrefix,this.QuotePrefix);cache.PivotButton=this._mergeProperty(null,xfs.PivotButton, this.PivotButton);cache.XfId=this._mergeProperty(null,xfs.XfId,this.XfId);cache=g_StyleCache.addXf(cache);this.setOperationCache("merge",xfIndexNumber,cache)}return cache};CellXfs.prototype.clone=function(){var res=new CellXfs;res.border=this.border;res.fill=this.fill;res.font=this.font;res.num=this.num;res.align=this.align;res.QuotePrefix=this.QuotePrefix;res.PivotButton=this.PivotButton;res.XfId=this.XfId;return res};CellXfs.prototype.isEqual=function(xfs){return this.font===xfs.font&&this.fill=== xfs.fill&&this.border===xfs.border&&this.num===xfs.num&&this.align===xfs.align&&this.QuotePrefix===xfs.QuotePrefix&&this.PivotButton===xfs.PivotButton&&this.XfId===xfs.XfId};CellXfs.prototype.getType=function(){return UndoRedoDataTypes.StyleXfs};CellXfs.prototype.getProperties=function(){return this.Properties};CellXfs.prototype.getProperty=function(nType){switch(nType){case this.Properties.border:return this.border;case this.Properties.fill:return this.fill;case this.Properties.font:return this.font; case this.Properties.num:return this.num;case this.Properties.align:return this.align;case this.Properties.QuotePrefix:return this.QuotePrefix;case this.Properties.PivotButton:return this.PivotButton;case this.Properties.XfId:return this.XfId}};CellXfs.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.border:this.border=value;break;case this.Properties.fill:this.fill=value;break;case this.Properties.font:this.font=value;break;case this.Properties.num:this.num=value;break; case this.Properties.align:this.align=value;break;case this.Properties.QuotePrefix:this.QuotePrefix=value;break;case this.Properties.PivotButton:this.PivotButton=value;break;case this.Properties.XfId:this.XfId=value;break}};CellXfs.prototype.getBorder=function(){return this.border};CellXfs.prototype.setBorder=function(val){this.border=val};CellXfs.prototype.getFill=function(){return this.fill};CellXfs.prototype.getFill2=function(){return this.fill||g_oDefaultFormat.Fill};CellXfs.prototype.setFill= function(val){this.fill=val};CellXfs.prototype.getFont=function(){return this.font};CellXfs.prototype.getFont2=function(){return this.font||g_oDefaultFormat.Font};CellXfs.prototype.setFont=function(val){this.font=val};CellXfs.prototype.getNum=function(){return this.num};CellXfs.prototype.getNum2=function(){return this.num||g_oDefaultFormat.Num};CellXfs.prototype.setNum=function(val){this.num=val};CellXfs.prototype.getAlign=function(){return this.align};CellXfs.prototype.getAlign2=function(){return this.align|| g_oDefaultFormat.Align};CellXfs.prototype.setAlign=function(val){this.align=val};CellXfs.prototype.getQuotePrefix=function(){return this.QuotePrefix};CellXfs.prototype.setQuotePrefix=function(val){this.QuotePrefix=val};CellXfs.prototype.getPivotButton=function(){return this.PivotButton};CellXfs.prototype.setPivotButton=function(val){this.PivotButton=val};CellXfs.prototype.getXfId=function(){return this.XfId};CellXfs.prototype.setXfId=function(val){this.XfId=val};CellXfs.prototype.getOperationCache= function(operation,val){var res=undefined;operation=this.operationCache[operation];if(operation)res=operation[val];return res};CellXfs.prototype.setOperationCache=function(operation,val,xfs){var valCache=this.operationCache[operation];if(!valCache){valCache={};this.operationCache[operation]=valCache}valCache[val]=xfs};CellXfs.prototype.asc_getFillColor=function(){return Asc.colorObjToAscColor(this.getFill2().bg())};CellXfs.prototype.asc_getFill=function(){return this.getFill2().clone()};CellXfs.prototype.asc_getFontName= function(){return this.getFont2().getName()};CellXfs.prototype.asc_getFontSize=function(){return this.getFont2().getSize()};CellXfs.prototype.asc_getFontColor=function(){return Asc.colorObjToAscColor(this.getFont2().getColor())};CellXfs.prototype.asc_getFontBold=function(){return this.getFont2().getBold()};CellXfs.prototype.asc_getFontItalic=function(){return this.getFont2().getItalic()};CellXfs.prototype.asc_getFontUnderline=function(){return Asc.EUnderline.underlineNone!==this.getFont2().getUnderline()}; CellXfs.prototype.asc_getFontStrikeout=function(){return this.getFont2().getStrikeout()};CellXfs.prototype.asc_getFontSubscript=function(){return AscCommon.vertalign_SubScript===this.getFont2().getVerticalAlign()};CellXfs.prototype.asc_getFontSuperscript=function(){return AscCommon.vertalign_SuperScript===this.getFont2().getVerticalAlign()};CellXfs.prototype.asc_getNumFormat=function(){return this.getNum2().getFormat()};CellXfs.prototype.asc_getNumFormatInfo=function(){return this.getNum2().getNumFormat().getTypeInfo()}; CellXfs.prototype.asc_getHorAlign=function(){return this.getAlign2().getAlignHorizontal()};CellXfs.prototype.asc_getVertAlign=function(){return this.getAlign2().getAlignVertical()};CellXfs.prototype.asc_getAngle=function(){return this.getAlign2().getAngle()};CellXfs.prototype.asc_getWrapText=function(){return this.getAlign2().getWrap()};CellXfs.prototype.asc_getShrinkToFit=function(){return this.getAlign2().getShrinkToFit()};CellXfs.prototype.asc_getPreview=function(api,text,width,height){return AscCommonExcel.generateXfsStyle(width, height,api.wb,this,text)};function FromXml_ST_HorizontalAlignment(val){var res=-1;if("general"===val)res=-1;else if("left"===val)res=AscCommon.align_Left;else if("center"===val)res=AscCommon.align_Center;else if("right"===val)res=AscCommon.align_Right;else if("fill"===val)res=AscCommon.align_Justify;else if("justify"===val)res=AscCommon.align_Justify;else if("centerContinuous"===val)res=AscCommon.align_Center;else if("distributed"===val)res=AscCommon.align_Justify;return res}function FromXml_ST_VerticalAlignment(val){var res= -1;if("top"===val)res=Asc.c_oAscVAlign.Top;else if("center"===val)res=Asc.c_oAscVAlign.Center;else if("bottom"===val)res=Asc.c_oAscVAlign.Bottom;else if("justify"===val)res=Asc.c_oAscVAlign.Just;else if("distributed"===val)res=Asc.c_oAscVAlign.Dist;return res}var g_oAlignProperties={hor:0,indent:1,RelativeIndent:2,shrink:3,angle:4,ver:5,wrap:6};function Align(val){if(null==val)val=g_oDefaultFormat.AlignAbs;this.hor=val.hor;this.indent=val.indent;this.RelativeIndent=val.RelativeIndent;this.shrink= val.shrink;this.angle=val.angle;this.ver=val.ver;this.wrap=val.wrap;this._hash;this._index}Align.prototype.Properties=g_oAlignProperties;Align.prototype.getHash=function(){if(!this._hash)this._hash=this.hor+"|"+this.indent+"|"+this.RelativeIndent+"|"+this.shrink+"|"+this.angle+"|"+this.ver+"|"+this.wrap;return this._hash};Align.prototype.getIndexNumber=function(){return this._index};Align.prototype.setIndexNumber=function(val){this._index=val};Align.prototype._mergeProperty=function(first,second, def){if(def!=first)return first;else return second};Align.prototype.merge=function(align){var defaultAlign=g_oDefaultFormat.Align;var oRes=new Align;oRes.hor=this._mergeProperty(this.hor,align.hor,defaultAlign.hor);oRes.indent=this._mergeProperty(this.indent,align.indent,defaultAlign.indent);oRes.RelativeIndent=this._mergeProperty(this.RelativeIndent,align.RelativeIndent,defaultAlign.RelativeIndent);oRes.shrink=this._mergeProperty(this.shrink,align.shrink,defaultAlign.shrink);oRes.angle=this._mergeProperty(this.angle, align.angle,defaultAlign.angle);oRes.ver=this._mergeProperty(this.ver,align.ver,defaultAlign.ver);oRes.wrap=this._mergeProperty(this.wrap,align.wrap,defaultAlign.wrap);return oRes};Align.prototype.getDif=function(val){var oRes=new Align(this);var bEmpty=true;if(this.hor==val.hor)oRes.hor=null;else bEmpty=false;if(this.indent==val.indent)oRes.indent=null;else bEmpty=false;if(this.RelativeIndent==val.RelativeIndent)oRes.RelativeIndent=null;else bEmpty=false;if(this.shrink==val.shrink)oRes.shrink=null; else bEmpty=false;if(this.angle==val.angle)oRes.angle=null;else bEmpty=false;if(this.ver==val.ver)oRes.ver=null;else bEmpty=false;if(this.wrap==val.wrap)oRes.wrap=null;else bEmpty=false;if(bEmpty)oRes=null;return oRes};Align.prototype.isEqual=function(val){return this.hor==val.hor&&this.indent==val.indent&&this.RelativeIndent==val.RelativeIndent&&this.shrink==val.shrink&&this.angle==val.angle&&this.ver==val.ver&&this.wrap==val.wrap};Align.prototype.clone=function(){return new Align(this)};Align.prototype.getType= function(){return UndoRedoDataTypes.StyleAlign};Align.prototype.getProperties=function(){return this.Properties};Align.prototype.getProperty=function(nType){switch(nType){case this.Properties.hor:return this.hor;break;case this.Properties.indent:return this.indent;break;case this.Properties.RelativeIndent:return this.RelativeIndent;break;case this.Properties.shrink:return this.shrink;break;case this.Properties.angle:return this.angle;break;case this.Properties.ver:return this.ver;break;case this.Properties.wrap:return this.wrap; break}};Align.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.hor:this.hor=value;break;case this.Properties.indent:this.indent=value;break;case this.Properties.RelativeIndent:this.RelativeIndent=value;break;case this.Properties.shrink:this.shrink=value;break;case this.Properties.angle:this.angle=value;break;case this.Properties.ver:this.ver=value;break;case this.Properties.wrap:this.wrap=value;break}};Align.prototype.getAngle=function(){var nRes=0;if(0<=this.angle&& this.angle<=180)nRes=this.angle<=90?this.angle:90-this.angle;else if(this.angle===AscCommonExcel.g_nVerticalTextAngle)nRes=this.angle;return nRes};Align.prototype.setAngle=function(val){this.angle=null!==val?AscCommonExcel.angleInterfaceToFormat(val):val};Align.prototype.getWrap=function(){return AscCommon.align_Justify===this.hor||Asc.c_oAscVAlign.Just===this.ver||Asc.c_oAscVAlign.Dist===this.ver?true:this.wrap};Align.prototype.setWrap=function(val){this.wrap=val};Align.prototype.getShrinkToFit= function(){return this.shrink};Align.prototype.setShrinkToFit=function(val){this.shrink=val};Align.prototype.getAlignHorizontal=function(){return this.hor};Align.prototype.setAlignHorizontal=function(val){this.hor=val};Align.prototype.getAlignVertical=function(){return this.ver};Align.prototype.setAlignVertical=function(val){this.ver=val};Align.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["horizontal"];if(undefined!==val){val=FromXml_ST_HorizontalAlignment(val); if(-1!==val)this.hor=val}val=vals["vertical"];if(undefined!==val){val=FromXml_ST_VerticalAlignment(val);if(-1!==val)this.ver=val}val=vals["textRotation"];if(undefined!==val)this.angle=val-0;val=vals["wrapText"];if(undefined!==val)this.wrap=AscCommon.getBoolFromXml(val);val=vals["indent"];if(undefined!==val)this.indent=val-0;val=vals["relativeIndent"];if(undefined!==val)this.RelativeIndent=val-0;val=vals["shrinkToFit"];if(undefined!==val)this.shrink=AscCommon.getBoolFromXml(val)}};function CCellStyles(){this.CustomStyles= [];this.DefaultStyles=[];this.AllStyles={}}CCellStyles.prototype.generateFontMap=function(oFontMap){this._generateFontMap(oFontMap,this.DefaultStyles);this._generateFontMap(oFontMap,this.CustomStyles)};CCellStyles.prototype._generateFontMap=function(oFontMap,aStyles){var i,length,oStyle;for(i=0,length=aStyles.length;i<length;++i){oStyle=aStyles[i];if(null!=oStyle.xfs&&null!=oStyle.xfs.font)oFontMap[oStyle.xfs.font.getName()]=1}};CCellStyles.prototype.getDefaultStylesCount=function(){var nCount=this.DefaultStyles.length; for(var i=0,length=nCount;i<length;++i)if(this.DefaultStyles[i].Hidden)--nCount;return nCount};CCellStyles.prototype.getCustomStylesCount=function(){var nCount=this.CustomStyles.length;for(var i=0,length=nCount;i<length;++i)if(this.CustomStyles[i].Hidden||null!=this.CustomStyles[i].BuiltinId)--nCount;return nCount};CCellStyles.prototype.getStyleByXfId=function(oXfId){for(var i=0,length=this.CustomStyles.length;i<length;++i)if(oXfId===this.CustomStyles[i].XfId)return this.CustomStyles[i];return null}; CCellStyles.prototype.getStyleNameByXfId=function(oXfId){var styleName=null;if(null===oXfId)return styleName;var style=null;for(var i=0,length=this.CustomStyles.length;i<length;++i){style=this.CustomStyles[i];if(oXfId===style.XfId)if(null!==style.BuiltinId){styleName=this.getDefaultStyleNameByBuiltinId(style.BuiltinId);if(null===styleName)styleName=style.Name;break}else{styleName=style.Name;break}}return styleName};CCellStyles.prototype.getDefaultStyleNameByBuiltinId=function(oBuiltinId){var style= null;for(var i=0,length=this.DefaultStyles.length;i<length;++i){style=this.DefaultStyles[i];if(style.BuiltinId===oBuiltinId)return style.Name}return null};CCellStyles.prototype.getCustomStyleByBuiltinId=function(oBuiltinId){var style=null;for(var i=0,length=this.CustomStyles.length;i<length;++i){style=this.CustomStyles[i];if(style.BuiltinId===oBuiltinId)return style}return null};CCellStyles.prototype._prepareCellStyle=function(name){var defaultStyle=null;var style=null;var i,length;var maxXfId=-1; for(i=0,length=this.DefaultStyles.length;i<length;++i)if(name===this.DefaultStyles[i].Name){defaultStyle=this.DefaultStyles[i];break}if(defaultStyle)for(i=0,length=this.CustomStyles.length;i<length;++i){if(defaultStyle.BuiltinId===this.CustomStyles[i].BuiltinId){style=this.CustomStyles[i];break}maxXfId=Math.max(maxXfId,this.CustomStyles[i].XfId)}else for(i=0,length=this.CustomStyles.length;i<length;++i){if(name===this.CustomStyles[i].Name){style=this.CustomStyles[i];break}maxXfId=Math.max(maxXfId, this.CustomStyles[i].XfId)}if(style)return style.XfId;if(defaultStyle){this.CustomStyles[i]=defaultStyle.clone();this.CustomStyles[i].XfId=++maxXfId;return this.CustomStyles[i].XfId}return g_oDefaultFormat.XfId};function CCellStyle(){this.BuiltinId=null;this.CustomBuiltin=null;this.Hidden=null;this.ILevel=null;this.Name=null;this.XfId=null;this.xfs=null;this.ApplyBorder=true;this.ApplyFill=true;this.ApplyFont=true;this.ApplyNumberFormat=true}CCellStyle.prototype.clone=function(){var oNewStyle=new CCellStyle; oNewStyle.BuiltinId=this.BuiltinId;oNewStyle.CustomBuiltin=this.CustomBuiltin;oNewStyle.Hidden=this.Hidden;oNewStyle.ILevel=this.ILevel;oNewStyle.Name=this.Name;oNewStyle.ApplyBorder=this.ApplyBorder;oNewStyle.ApplyFill=this.ApplyFill;oNewStyle.ApplyFont=this.ApplyFont;oNewStyle.ApplyNumberFormat=this.ApplyNumberFormat;oNewStyle.xfs=this.xfs.clone();return oNewStyle};CCellStyle.prototype.getFill=function(){if(null!=this.xfs&&null!=this.xfs.fill)return this.xfs.fill;return g_oDefaultFormat.Fill};CCellStyle.prototype.getFontColor= function(){if(null!=this.xfs&&null!=this.xfs.font)return this.xfs.font.getColor();return g_oDefaultFormat.Font.c};CCellStyle.prototype.getFont=function(){if(null!=this.xfs&&null!=this.xfs.font)return this.xfs.font;return g_oDefaultFormat.Font};CCellStyle.prototype.getBorder=function(){if(null!=this.xfs&&null!=this.xfs.border)return this.xfs.border;return g_oDefaultFormat.Border};CCellStyle.prototype.getNumFormatStr=function(){if(null!=this.xfs&&null!=this.xfs.num)return this.xfs.num.getFormat();return g_oDefaultFormat.Num.getFormat()}; function StyleManager(){}StyleManager.prototype={init:function(firstXf,firstFont,firstFill,secondFill,firstBorder,normalXf){g_StyleCache.firstXf=firstXf;g_StyleCache.firstFont=firstFont;g_StyleCache.firstFill=firstFill;g_StyleCache.secondFill=secondFill;g_StyleCache.firstBorder=firstBorder;g_StyleCache.normalXf=normalXf;if(null!=firstXf.font)g_oDefaultFormat.xfs.font=g_oDefaultFormat.Font=firstXf.font;if(null!=firstXf.fill)g_oDefaultFormat.xfs.fill=g_oDefaultFormat.Fill=firstXf.fill.clone();if(null!= firstXf.border)g_oDefaultFormat.xfs.border=g_oDefaultFormat.Border=firstXf.border.clone();if(null!=firstXf.num)g_oDefaultFormat.xfs.num=g_oDefaultFormat.Num=firstXf.num.clone();if(null!=firstXf.align)g_oDefaultFormat.xfs.align=g_oDefaultFormat.Align=firstXf.align.clone();if(null!==firstXf.XfId)g_oDefaultFormat.XfId=firstXf.XfId},setCellStyle:function(oItemWithXfs,val){return this._setProperty(oItemWithXfs,val,"XfId",CellXfs.prototype.getXfId,CellXfs.prototype.setXfId)},setNum:function(oItemWithXfs, val){if(val&&val.f){var numFormat=AscCommon.oNumFormatCache.get(val.f);numFormat.checkCultureInfoFontPicker()}return this._setProperty(oItemWithXfs,val,"num",CellXfs.prototype.getNum,CellXfs.prototype.setNum,g_StyleCache.addNum)},setFont:function(oItemWithXfs,val){return this._setProperty(oItemWithXfs,val,"font",CellXfs.prototype.getFont,CellXfs.prototype.setFont,g_StyleCache.addFont)},setFill:function(oItemWithXfs,val){return this._setProperty(oItemWithXfs,val,"fill",CellXfs.prototype.getFill,CellXfs.prototype.setFill, g_StyleCache.addFill)},setBorder:function(oItemWithXfs,val){return this._setProperty(oItemWithXfs,val,"border",CellXfs.prototype.getBorder,CellXfs.prototype.setBorder,g_StyleCache.addBorder)},setQuotePrefix:function(oItemWithXfs,val){return this._setProperty(oItemWithXfs,val,"quotePrefix",CellXfs.prototype.getQuotePrefix,CellXfs.prototype.setQuotePrefix)},setPivotButton:function(oItemWithXfs,val){return this._setProperty(oItemWithXfs,val,"pivotButton",CellXfs.prototype.getPivotButton,CellXfs.prototype.setPivotButton)}, setFontname:function(oItemWithXfs,val){return this._setFontProperty(oItemWithXfs,val,"name",Font.prototype.getName,function(val){this.setName(val);this.setScheme(null)},"name")},setFontsize:function(oItemWithXfs,val){return this._setFontProperty(oItemWithXfs,val,"size",Font.prototype.getSize,Font.prototype.setSize)},setFontcolor:function(oItemWithXfs,val){return this._setFontProperty(oItemWithXfs,val,"color",Font.prototype.getColor,Font.prototype.setColor)},setBold:function(oItemWithXfs,val){return this._setFontProperty(oItemWithXfs, val,"bold",Font.prototype.getBold,Font.prototype.setBold)},setItalic:function(oItemWithXfs,val){return this._setFontProperty(oItemWithXfs,val,"italic",Font.prototype.getItalic,Font.prototype.setItalic)},setUnderline:function(oItemWithXfs,val){return this._setFontProperty(oItemWithXfs,val,"underline",Font.prototype.getUnderline,Font.prototype.setUnderline)},setStrikeout:function(oItemWithXfs,val){return this._setFontProperty(oItemWithXfs,val,"strikeout",Font.prototype.getStrikeout,Font.prototype.setStrikeout)}, setFontAlign:function(oItemWithXfs,val){return this._setFontProperty(oItemWithXfs,val,"fontAlign",Font.prototype.getVerticalAlign,Font.prototype.setVerticalAlign)},setAlignVertical:function(oItemWithXfs,val){return this._setAlignProperty(oItemWithXfs,val,"alignVertical",Align.prototype.getAlignVertical,Align.prototype.setAlignVertical)},setAlignHorizontal:function(oItemWithXfs,val){return this._setAlignProperty(oItemWithXfs,val,"alignHorizontal",Align.prototype.getAlignHorizontal,Align.prototype.setAlignHorizontal)}, setShrinkToFit:function(oItemWithXfs,val){return this._setAlignProperty(oItemWithXfs,val,"shrinkToFit",Align.prototype.getShrinkToFit,Align.prototype.setShrinkToFit)},setWrap:function(oItemWithXfs,val){return this._setAlignProperty(oItemWithXfs,val,"wrap",Align.prototype.getWrap,Align.prototype.setWrap)},setAngle:function(oItemWithXfs,val){return this._setAlignProperty(oItemWithXfs,val,"angle",function(){return AscCommonExcel.angleFormatToInterface2(this.angle)},Align.prototype.setAngle)},_initXf:function(oItemWithXfs){var xfs= oItemWithXfs.xfs;if(!xfs){if(oItemWithXfs.getDefaultXfs)xfs=oItemWithXfs.getDefaultXfs();if(!xfs)xfs=g_StyleCache.firstXf}return xfs},_initXfFont:function(xfs){xfs=xfs.clone();if(null==xfs.font)xfs.font=g_oDefaultFormat.Font;xfs.font=xfs.font.clone();return xfs},_initXfAlign:function(xfs){xfs=xfs.clone();if(null==xfs.align)xfs.align=g_oDefaultFormat.Align;xfs.align=xfs.align.clone();return xfs},_setProperty:function(oItemWithXfs,val,prop,getFunc,setFunc,addFunc){var xfs=oItemWithXfs.xfs;var oRes= {newVal:null,oldVal:xfs?getFunc.call(xfs):null};xfs=this._initXf(oItemWithXfs);var hash=val&&val.getHash?val.getHash():val;var xfsOperationCache=xfs;var newXf=xfs.getOperationCache(prop,hash);if(newXf){oItemWithXfs.setStyleInternal(newXf);xfs=newXf}else{xfs=xfs.clone();if(null!=val)if(addFunc)setFunc.call(xfs,addFunc.call(g_StyleCache,val));else setFunc.call(xfs,val);else if(null!=xfs)setFunc.call(xfs,null);xfs=g_StyleCache.addXf(xfs);xfsOperationCache.setOperationCache(prop,hash,xfs);oItemWithXfs.setStyleInternal(xfs)}oRes.newVal= xfs?getFunc.call(xfs):null;return oRes},_setFontProperty:function(oItemWithXfs,val,prop,getFunc,setFunc){var xfs=oItemWithXfs.xfs;var oRes={newVal:val,oldVal:xfs&&xfs.font?getFunc.call(xfs.font):null};xfs=this._initXf(oItemWithXfs);var hash=val&&val.getHash?val.getHash():val;var xfsOperationCache=xfs;var newXf=xfs.getOperationCache(prop,hash);if(newXf)oItemWithXfs.setStyleInternal(newXf);else{xfs=this._initXfFont(xfs);setFunc.call(xfs.font,val);xfs.font=g_StyleCache.addFont(xfs.font);xfs=g_StyleCache.addXf(xfs); xfsOperationCache.setOperationCache(prop,val,xfs);oItemWithXfs.setStyleInternal(xfs)}return oRes},_setAlignProperty:function(oItemWithXfs,val,prop,getFunc,setFunc){var xfs=oItemWithXfs.xfs;var oRes={newVal:val,oldVal:xfs&&xfs.align?getFunc.call(xfs.align):getFunc.call(g_oDefaultFormat.Align)};xfs=this._initXf(oItemWithXfs);var xfsOperationCache=xfs;var newXf=xfs.getOperationCache(prop,val);if(newXf)oItemWithXfs.setStyleInternal(newXf);else{xfs=this._initXfAlign(xfs);setFunc.call(xfs.align,val);xfs.align= g_StyleCache.addAlign(xfs.align);xfs=g_StyleCache.addXf(xfs);xfsOperationCache.setOperationCache(prop,val,xfs);oItemWithXfs.setStyleInternal(xfs)}return oRes}};function StyleCache(){this.fonts={count:0,vals:{}};this.fills={count:0,vals:{}};this.borders={count:0,vals:{}};this.nums={count:0,vals:{}};this.aligns={count:0,vals:{}};this.xfs={list:[],vals:{}};this.firstXf=new CellXfs;this.firstFont=null;this.firstFill=null;this.secondFill=null;this.firstBorder=null;this.normalXf=new CellXfs}StyleCache.prototype.addFont= function(newFont){return this._add(this.fonts,newFont)};StyleCache.prototype.addFill=function(newFill,forceAdd){return this._add(this.fills,newFill,forceAdd)};StyleCache.prototype.addBorder=function(newBorder,forceAdd){return this._add(this.borders,newBorder,forceAdd)};StyleCache.prototype.addNum=function(newNum){return this._add(this.nums,newNum)};StyleCache.prototype.addAlign=function(newAlign){return this._add(this.aligns,newAlign)};StyleCache.prototype.addXf=function(newXf,forceAdd){if(newXf){if(newXf.font)newXf.font= this.addFont(newXf.font);if(newXf.fill)newXf.fill=this.addFill(newXf.fill);if(newXf.border)newXf.border=this.addBorder(newXf.border);if(newXf.num)newXf.num=this.addNum(newXf.num);if(newXf.align)newXf.align=this.addAlign(newXf.align)}return this._add(this.xfs,newXf,forceAdd)};StyleCache.prototype.getXf=function(index){return 1<=index&&index<=this.xfs.list.length?this.xfs.list[index-1]:null};StyleCache.prototype.getXfCount=function(){return this.xfs.list.length};StyleCache.prototype.getNumFormatStrings= function(){var res=[];for(var fmt in this.nums.vals)res.push(this.nums.vals[fmt].getFormat());return res};StyleCache.prototype._add=function(container,newVal,forceAdd){if(newVal&&newVal.getIndexNumber&&undefined===newVal.getIndexNumber()){var hash=newVal.getHash();var res=container.vals[hash];if(!res||forceAdd){if(container.list)newVal.setIndexNumber(container.list.push(newVal));else newVal.setIndexNumber(container.count++);if(!res)container.vals[hash]=newVal;res=newVal}return res}else return newVal}; var g_StyleCache=new StyleCache;function SheetMergedStyles(){this.stylesTablePivot=[];this.stylesConditional=[]}SheetMergedStyles.prototype.setTablePivotStyle=function(range,xf,stripe){this.stylesTablePivot.push({xf:xf,range:range,stripe:stripe,borders:undefined})};SheetMergedStyles.prototype.clearTablePivotStyle=function(range){for(var i=this.stylesTablePivot.length-1;i>=0;--i){var style=this.stylesTablePivot[i];if(style.range.isIntersect(range))this.stylesTablePivot.splice(i,1)}};SheetMergedStyles.prototype.setConditionalStyle= function(multiplyRange,formula){this.stylesConditional.push({multiplyRange:multiplyRange,formula:formula})};SheetMergedStyles.prototype.clearConditionalStyle=function(multiplyRange){for(var i=this.stylesConditional.length-1;i>=0;--i){var style=this.stylesConditional[i];if(style.multiplyRange.isIntersect(multiplyRange))this.stylesConditional.splice(i,1)}};SheetMergedStyles.prototype.getStyle=function(hiddenManager,row,col,opt_ws){var res={table:[],conditional:[]};if(opt_ws)opt_ws._updateConditionalFormatting(); for(var i=0;i<this.stylesConditional.length;++i){var style=this.stylesConditional[i];if(style.multiplyRange.contains(col,row)){var xf=style.formula(row,col);if(xf)res.conditional.push(xf)}}for(var i=0;i<this.stylesTablePivot.length;++i){var style=this.stylesTablePivot[i];var borderIndex;var xf=style.xf;if(style.range.contains(col,row)&&(borderIndex=this._getBorderIndex(hiddenManager,style.range,style.stripe,row,col,xf))>=0){if(borderIndex>0){if(!style.borders)style.borders={};var xfModified=style.borders[borderIndex]; if(!xfModified){xfModified=xf.clone();var borderModified=xfModified.border.clone();if(0!==(1&borderIndex))borderModified.l=borderModified.iv;if(0!==(2&borderIndex))borderModified.t=borderModified.ih;if(0!==(4&borderIndex))borderModified.r=borderModified.iv;if(0!==(8&borderIndex))borderModified.b=borderModified.ih;if(0!==(16&borderIndex)){borderModified.du=false;borderModified.dd=false}xfModified.border=g_StyleCache.addBorder(borderModified);xfModified=g_StyleCache.addXf(xfModified);style.borders[borderIndex]= xfModified}xf=xfModified}res.table.push(xf)}}return res};SheetMergedStyles.prototype._getBorderIndex=function(hiddenManager,bbox,stripe,row,col,xf){var borderIndex=0;var hidden;if(stripe)if(stripe.row){hidden=hiddenManager.getHiddenRowsCount(bbox.r1,row);var rowIndex=(row-bbox.r1-hidden)%(stripe.size+stripe.offset);if(rowIndex<stripe.size){if(xf.border){if(bbox.c1!==col&&xf.border.l)borderIndex+=1;if(0!=rowIndex&&xf.border.t)borderIndex+=2;if(bbox.c2!==col&&xf.border.r)borderIndex+=4;if(stripe.size- 1!=rowIndex&&xf.border.b)borderIndex+=8}}else borderIndex=-1}else{hidden=hiddenManager.getHiddenColsCount(bbox.c1,col);var colIndex=(col-bbox.c1-hidden)%(stripe.size+stripe.offset);if(colIndex<stripe.size){if(xf.border){if(0!=colIndex&&xf.border.l)borderIndex+=1;if(bbox.r1!==row&&xf.border.t)borderIndex+=2;if(stripe.size-1!=colIndex&&xf.border.r)borderIndex+=4;if(bbox.r2!==row&&xf.border.b)borderIndex+=8}}else borderIndex=-1}else if(xf.border){if(bbox.c1!==col&&xf.border.l)borderIndex+=1;if(bbox.r1!== row&&xf.border.t)borderIndex+=2;if(bbox.c2!==col&&xf.border.r)borderIndex+=4;if(bbox.r2!==row&&xf.border.b)borderIndex+=8}if(xf.border&&(xf.border.du||xf.border.dd))borderIndex+=16;return borderIndex};var g_oHyperlinkProperties={Ref:0,Location:1,Hyperlink:2,Tooltip:3};function Hyperlink(){this.Properties=g_oHyperlinkProperties;this.Ref=null;this.Hyperlink=null;this.Tooltip=null;this.Location=null;this.LocationSheet=null;this.LocationRange=null;this.LocationRangeBbox=null;this.bUpdateLocation=false; this.bVisited=false}Hyperlink.prototype.clone=function(oNewWs){var oNewHyp=new Hyperlink;if(null!==this.Ref)oNewHyp.Ref=this.Ref.clone(oNewWs);if(null!==this.getLocation())oNewHyp.setLocation(this.getLocation());if(null!==this.LocationSheet)oNewHyp.LocationSheet=this.LocationSheet;if(null!==this.LocationRange)oNewHyp.LocationRange=this.LocationRange;if(null!==this.LocationRangeBbox)oNewHyp.LocationRangeBbox=this.LocationRangeBbox.clone();if(null!==this.Hyperlink)oNewHyp.Hyperlink=this.Hyperlink;if(null!== this.Tooltip)oNewHyp.Tooltip=this.Tooltip;if(null!==this.bVisited)oNewHyp.bVisited=this.bVisited;return oNewHyp};Hyperlink.prototype.isEqual=function(obj){var bRes=this.getLocation()==obj.getLocation()&&this.Hyperlink==obj.Hyperlink&&this.Tooltip==obj.Tooltip;if(bRes){var oBBoxRef=this.Ref.getBBox0();var oBBoxObj=obj.Ref.getBBox0();bRes=oBBoxRef.r1==oBBoxObj.r1&&oBBoxRef.c1==oBBoxObj.c1&&oBBoxRef.r2==oBBoxObj.r2&&oBBoxRef.c2==oBBoxObj.c2}return bRes};Hyperlink.prototype.isValid=function(){return null!= this.Ref&&(null!=this.getLocation()||null!=this.Hyperlink)};Hyperlink.prototype.setLocationSheet=function(LocationSheet){this.LocationSheet=LocationSheet;this.bUpdateLocation=true};Hyperlink.prototype.setLocationRange=function(LocationRange){this.LocationRange=LocationRange;this.LocationRangeBbox=null;this.bUpdateLocation=true};Hyperlink.prototype.setLocation=function(Location){this.bUpdateLocation=true;this.LocationSheet=this.LocationRange=this.LocationRangeBbox=null;if(null!==Location)if(parserHelp.isName3D(Location, 0)||parserHelp.isName(Location,0))this.LocationRange=Location;else{var result=parserHelp.parse3DRef(Location);if(!result)AscCommonExcel.executeInR1C1Mode(!AscCommonExcel.g_R1C1Mode,function(){result=parserHelp.parse3DRef(Location)});if(null!==result){this.LocationSheet=result.sheet;this.LocationRange=result.range}}this._updateLocation()};Hyperlink.prototype.getLocation=function(){if(this.bUpdateLocation)this._updateLocation();return this.Location};Hyperlink.prototype.getLocationRange=function(){return this.LocationRangeBbox&& this.LocationRangeBbox.getName(AscCommonExcel.g_R1C1Mode?AscCommonExcel.referenceType.A:AscCommonExcel.referenceType.R)};Hyperlink.prototype._updateLocation=function(){var t=this;this.Location=null;this.bUpdateLocation=false;if(null!==this.LocationSheet&&null!==this.LocationRange){this.LocationRangeBbox=AscCommonExcel.g_oRangeCache.getAscRange(this.LocationRange);if(!this.LocationRangeBbox)AscCommonExcel.executeInR1C1Mode(!AscCommonExcel.g_R1C1Mode,function(){t.LocationRangeBbox=AscCommonExcel.g_oRangeCache.getAscRange(t.LocationRange)}); if(this.LocationRangeBbox){AscCommonExcel.executeInR1C1Mode(false,function(){t.LocationRange=t.LocationRangeBbox.getName(AscCommonExcel.referenceType.R)});this.Location=parserHelp.get3DRef(this.LocationSheet,this.LocationRange)}}else if(null!==this.LocationRange)this.Location=this.LocationRange};Hyperlink.prototype.setVisited=function(bVisited){this.bVisited=bVisited};Hyperlink.prototype.getVisited=function(){return this.bVisited};Hyperlink.prototype.getHyperlinkType=function(){return null!==this.Hyperlink? Asc.c_oAscHyperlinkType.WebLink:Asc.c_oAscHyperlinkType.RangeLink};Hyperlink.prototype.getType=function(){return UndoRedoDataTypes.Hyperlink};Hyperlink.prototype.getProperties=function(){return this.Properties};Hyperlink.prototype.getProperty=function(nType){switch(nType){case this.Properties.Ref:return parserHelp.get3DRef(this.Ref.worksheet.getName(),this.Ref.getName());case this.Properties.Location:return this.getLocation();case this.Properties.Hyperlink:return this.Hyperlink;case this.Properties.Tooltip:return this.Tooltip}}; Hyperlink.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.Ref:var oRefParsed=parserHelp.parse3DRef(value);if(null!==oRefParsed){var ws=window["Asc"]["editor"].wbModel.getWorksheetByName(oRefParsed.sheet);if(ws)this.Ref=ws.getRange2(oRefParsed.range)}break;case this.Properties.Location:this.setLocation(value);break;case this.Properties.Hyperlink:this.Hyperlink=value;break;case this.Properties.Tooltip:this.Tooltip=value;break}};Hyperlink.prototype.applyCollaborative=function(nSheetId, collaborativeEditing){var bbox=this.Ref.getBBox0();var OffsetFirst=new AscCommon.CellBase(0,0);var OffsetLast=new AscCommon.CellBase(0,0);OffsetFirst.row=collaborativeEditing.getLockMeRow2(nSheetId,bbox.r1)-bbox.r1;OffsetFirst.col=collaborativeEditing.getLockMeColumn2(nSheetId,bbox.c1)-bbox.c1;OffsetLast.row=collaborativeEditing.getLockMeRow2(nSheetId,bbox.r2)-bbox.r2;OffsetLast.col=collaborativeEditing.getLockMeColumn2(nSheetId,bbox.c2)-bbox.c2;this.Ref.setOffsetFirst(OffsetFirst);this.Ref.setOffsetLast(OffsetLast)}; function SheetFormatPr(){this.nBaseColWidth=null;this.dDefaultColWidth=null;this.nOutlineLevelCol=0;this.nOutlineLevelRow=0;this.oAllRow=null}SheetFormatPr.prototype.clone=function(){var oRes=new SheetFormatPr;oRes.nBaseColWidth=this.nBaseColWidth;oRes.dDefaultColWidth=this.dDefaultColWidth;oRes.nOutlineLevelCol=this.nOutlineLevelCol;oRes.nOutlineLevelRow=this.nOutlineLevelRow;if(null!=this.oAllRow)oRes.oAllRow=this.oAllRow.clone();return oRes};SheetFormatPr.prototype.correction=function(){if(null!== this.dDefaultColWidth&&0>this.dDefaultColWidth)this.dDefaultColWidth=null};function Col(worksheet,index){this.ws=worksheet;this.index=index;this.BestFit=null;this.hd=null;this.CustomWidth=null;this.width=null;this.xfs=null;this.outlineLevel=0;this.collapsed=false;this.widthPx=null;this.charCount=null}Col.prototype.fixOnOpening=function(){if(null==this.width){this.width=0;this.hd=true}else if(this.width<0)this.width=0;else if(this.width>Asc.c_oAscMaxColumnWidth)this.width=Asc.c_oAscMaxColumnWidth; if(AscCommon.CurFileVersion<2)this.CustomWidth=1};Col.prototype.moveHor=function(nDif){this.index+=nDif};Col.prototype.isEqual=function(obj){var bRes=this.BestFit==obj.BestFit&&this.hd==obj.hd&&this.width==obj.width&&this.CustomWidth==obj.CustomWidth&&this.outlineLevel==obj.outlineLevel&&this.collapsed==obj.collapsed;if(bRes)if(null!=this.xfs&&null!=obj.xfs)bRes=this.xfs.isEqual(obj.xfs);else if(null!=this.xfs||null!=obj.xfs)bRes=false;return bRes};Col.prototype.isEmpty=function(){return null==this.BestFit&& null==this.hd&&null==this.width&&null==this.xfs&&null==this.CustomWidth&&0===this.outlineLevel&&false==this.collapsed};Col.prototype.clone=function(oNewWs){if(!oNewWs)oNewWs=this.ws;var oNewCol=new Col(oNewWs,this.index);this.cloneTo(oNewCol);return oNewCol};Col.prototype.cloneTo=function(oNewCol){if(null!=this.BestFit)oNewCol.BestFit=this.BestFit;if(null!=this.hd)oNewCol.hd=this.hd;if(null!=this.width)oNewCol.width=this.width;if(null!=this.CustomWidth)oNewCol.CustomWidth=this.CustomWidth;if(null!= this.xfs)oNewCol.xfs=this.xfs;oNewCol.outlineLevel=this.outlineLevel;oNewCol.collapsed=this.collapsed;if(null!=this.widthPx)oNewCol.widthPx=this.widthPx;if(null!=this.charCount)oNewCol.charCount=this.charCount};Col.prototype.getWidthProp=function(){return new AscCommonExcel.UndoRedoData_ColProp(this)};Col.prototype.setWidthProp=function(prop){if(null!=prop){if(null!=prop.width)this.width=prop.width;else this.width=null;this.setHidden(prop.hd);if(null!=prop.CustomWidth)this.CustomWidth=prop.CustomWidth; else this.CustomWidth=null;if(null!=prop.BestFit)this.BestFit=prop.BestFit;else this.BestFit=null;if(null!=prop.OutlineLevel)this.outlineLevel=prop.OutlineLevel}};Col.prototype.getStyle=function(){return this.xfs};Col.prototype._getUpdateRange=function(){if(AscCommonExcel.g_nAllColIndex==this.index)return new Asc.Range(0,0,gc_nMaxCol0,gc_nMaxRow0);else return new Asc.Range(this.index,0,this.index,gc_nMaxRow0)};Col.prototype.setStyle=function(xfs){var oldVal=this.xfs;this.setStyleInternal(xfs);if(History.Is_On()&& oldVal!==this.xfs)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_SetStyle,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oldVal,this.xfs))};Col.prototype.setStyleInternal=function(xfs){this.xfs=g_StyleCache.addXf(xfs)};Col.prototype.setCellStyle=function(val){var newVal=this.ws.workbook.CellStyles._prepareCellStyle(val);var oRes=this.ws.workbook.oStyleManager.setCellStyle(this,newVal);if(History.Is_On()&&oRes.oldVal!=oRes.newVal){var oldStyleName= this.ws.workbook.CellStyles.getStyleNameByXfId(oRes.oldVal);History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_SetCellStyle,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oldStyleName,val));var oStyle=this.ws.workbook.CellStyles.getStyleByXfId(oRes.newVal);if(oStyle.ApplyFont)this.setFont(oStyle.getFont());if(oStyle.ApplyFill)this.setFill(oStyle.getFill());if(oStyle.ApplyBorder)this.setBorder(oStyle.getBorder());if(oStyle.ApplyNumberFormat)this.setNumFormat(oStyle.getNumFormatStr())}}; Col.prototype.setNumFormat=function(val){var oRes=this.ws.workbook.oStyleManager.setNum(this,new Num({f:val}));if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Num,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setNum=function(val){var oRes=this.ws.workbook.oStyleManager.setNum(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol, AscCH.historyitem_RowCol_Num,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setFont=function(val){var oRes=this.ws.workbook.oStyleManager.setFont(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal){var oldVal=null;if(null!=oRes.oldVal)oldVal=oRes.oldVal.clone();var newVal=null;if(null!=oRes.newVal)newVal=oRes.newVal.clone();History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_SetFont,this.ws.getId(), this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oldVal,newVal))}};Col.prototype.setFontname=function(val){var oRes=this.ws.workbook.oStyleManager.setFontname(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Fontname,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setFontsize=function(val){var oRes=this.ws.workbook.oStyleManager.setFontsize(this, val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Fontsize,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setFontcolor=function(val){var oRes=this.ws.workbook.oStyleManager.setFontcolor(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Fontcolor,this.ws.getId(),this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setBold=function(val){var oRes=this.ws.workbook.oStyleManager.setBold(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Bold,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setItalic=function(val){var oRes=this.ws.workbook.oStyleManager.setItalic(this,val); if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Italic,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setUnderline=function(val){var oRes=this.ws.workbook.oStyleManager.setUnderline(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Underline,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index, false,oRes.oldVal,oRes.newVal))};Col.prototype.setStrikeout=function(val){var oRes=this.ws.workbook.oStyleManager.setStrikeout(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Strikeout,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setFontAlign=function(val){var oRes=this.ws.workbook.oStyleManager.setFontAlign(this,val);if(History.Is_On()&&oRes.oldVal!= oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_FontAlign,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setAlignVertical=function(val){var oRes=this.ws.workbook.oStyleManager.setAlignVertical(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_AlignVertical,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index, false,oRes.oldVal,oRes.newVal))};Col.prototype.setAlignHorizontal=function(val){var oRes=this.ws.workbook.oStyleManager.setAlignHorizontal(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_AlignHorizontal,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setFill=function(val){var oRes=this.ws.workbook.oStyleManager.setFill(this,val);if(History.Is_On()&& oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Fill,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setBorder=function(val){var oRes=this.ws.workbook.oStyleManager.setBorder(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal){var oldVal=null;if(null!=oRes.oldVal)oldVal=oRes.oldVal.clone();var newVal=null;if(null!=oRes.newVal)newVal=oRes.newVal.clone();History.Add(AscCommonExcel.g_oUndoRedoCol, AscCH.historyitem_RowCol_Border,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oldVal,newVal))}};Col.prototype.setShrinkToFit=function(val){var oRes=this.ws.workbook.oStyleManager.setShrinkToFit(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_ShrinkToFit,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setWrap= function(val){var oRes=this.ws.workbook.oStyleManager.setWrap(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Wrap,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setAngle=function(val){var oRes=this.ws.workbook.oStyleManager.setAngle(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCol,AscCH.historyitem_RowCol_Angle, this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,false,oRes.oldVal,oRes.newVal))};Col.prototype.setHidden=function(val){if(this.index>=0&&!this.hd!==!val)this.ws.hiddenManager.addHidden(false,this.index);this.hd=val};Col.prototype.getHidden=function(){return true===this.hd};Col.prototype.setIndex=function(val){this.index=val};Col.prototype.getIndex=function(){return this.index};Col.prototype.setOutlineLevel=function(val,bDel,notAddHistory){var oldVal=this.outlineLevel; if(null!==val)this.outlineLevel=val;else{if(!this.outlineLevel)this.outlineLevel=0;this.outlineLevel=bDel?this.outlineLevel-1:this.outlineLevel+1}if(this.outlineLevel<0)this.outlineLevel=0;else if(this.outlineLevel>c_maxOutlineLevel)this.outlineLevel=c_maxOutlineLevel;else;if(!notAddHistory&&History.Is_On()&&oldVal!=this.outlineLevel)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_GroupCol,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index, false,oldVal,this.outlineLevel))};Col.prototype.getOutlineLevel=function(){return this.outlineLevel};Col.prototype.setCollapsed=function(val){this.collapsed=val};Col.prototype.getCollapsed=function(){return this.collapsed};var g_nRowOffsetFlag=0;var g_nRowOffsetXf=g_nRowOffsetFlag+1;var g_nRowOutlineLevel=g_nRowOffsetXf+4;var g_nRowOffsetHeight=g_nRowOutlineLevel+1;var g_nRowStructSize=g_nRowOffsetHeight+8;var g_nRowFlag_empty=0;var g_nRowFlag_init=1;var g_nRowFlag_hd=2;var g_nRowFlag_CustomHeight= 4;var g_nRowFlag_CalcHeight=8;var g_nRowFlag_NullHeight=16;var g_nRowFlag_Collapsed=32;var g_nRowFlag_hdView=64;function Row(worksheet){this.ws=worksheet;this.index=null;this.xfs=null;this.h=null;this.outlineLevel=0;this.flags=g_nRowFlag_init;this._hasChanged=false}Row.prototype.clear=function(){this.index=null;this.xfs=null;this.h=null;this.outlineLevel=0;this.flags=g_nRowFlag_init;this._hasChanged=false};Row.prototype.saveContent=function(opt_inCaseOfChange){if(this.index>=0&&(!opt_inCaseOfChange|| this._hasChanged)){this._hasChanged=false;var sheetMemory=this.ws.rowsData;sheetMemory.checkSize(this.index);var xfSave=this.xfs?this.xfs.getIndexNumber():0;var flagToSave=this.flags;var heightToSave=this.h;if(null===heightToSave){flagToSave|=g_nRowFlag_NullHeight;heightToSave=0}sheetMemory.setUint8(this.index,g_nRowOffsetFlag,flagToSave);sheetMemory.setUint32(this.index,g_nRowOffsetXf,xfSave);sheetMemory.setUint8(this.index,g_nRowOutlineLevel,this.outlineLevel);sheetMemory.setFloat64(this.index, g_nRowOffsetHeight,heightToSave)}};Row.prototype.loadContent=function(index){var res=false;this.clear();this.index=index;var sheetMemory=this.ws.rowsData;if(sheetMemory.hasSize(this.index)){this.flags=sheetMemory.getUint8(this.index,g_nRowOffsetFlag);if(0!=(g_nRowFlag_init&this.flags)){this.xfs=g_StyleCache.getXf(sheetMemory.getUint32(this.index,g_nRowOffsetXf));this.outlineLevel=sheetMemory.getUint8(this.index,g_nRowOutlineLevel);if(0!==(g_nRowFlag_NullHeight&this.flags)){this.flags&=~g_nRowFlag_NullHeight; this.h=null}else this.h=sheetMemory.getFloat64(this.index,g_nRowOffsetHeight);res=true}}return res};Row.prototype.setChanged=function(val){this._hasChanged=val};Row.prototype.isEmpty=function(){return this.isEmptyProp()};Row.prototype.isEmptyProp=function(){return null==this.xfs&&null==this.h&&g_nRowFlag_init==this.flags&&0===this.outlineLevel};Row.prototype.clone=function(oNewWs,renameParams){if(!oNewWs)oNewWs=this.ws;var oNewRow=new Row(oNewWs);oNewRow.index=this.index;oNewRow.flags=this.flags; if(null!=this.xfs)oNewRow.xfs=this.xfs;if(null!=this.h)oNewRow.h=this.h;if(0!==this.outlineLevel)oNewRow.outlineLevel=this.outlineLevel;return oNewRow};Row.prototype.copyFrom=function(row){this.flags=row.flags;if(null!=row.xfs)this.xfs=row.xfs;if(null!=row.h)this.h=row.h;if(0!==this.outlineLevel)this.outlineLevel=row.outlineLevel;this._hasChanged=true};Row.prototype.getDefaultXfs=function(){var oRes=null;if(null!=this.ws.oAllCol&&null!=this.ws.oAllCol.xfs)oRes=this.ws.oAllCol.xfs.clone();return oRes}; Row.prototype.getHeightProp=function(){return new AscCommonExcel.UndoRedoData_RowProp(this)};Row.prototype.setHeightProp=function(prop){if(null!=prop){if(null!=prop.h)this.h=prop.h;else this.h=null;this.setHidden(prop.hd);this.setCustomHeight(prop.CustomHeight);this.setOutlineLevel(prop.OutlineLevel,null,true)}};Row.prototype.getStyle=function(){return this.xfs};Row.prototype._getUpdateRange=function(){if(AscCommonExcel.g_nAllRowIndex==this.index)return new Asc.Range(0,0,gc_nMaxCol0,gc_nMaxRow0); else return new Asc.Range(0,this.index,gc_nMaxCol0,this.index)};Row.prototype.setStyle=function(xfs){var oldVal=this.xfs;this.setStyleInternal(xfs);if(History.Is_On()&&oldVal!==this.xfs)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_SetStyle,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oldVal,this.xfs))};Row.prototype.setStyleInternal=function(xfs){this.xfs=g_StyleCache.addXf(xfs);this._hasChanged=true};Row.prototype.setCellStyle=function(val){var newVal= this.ws.workbook.CellStyles._prepareCellStyle(val);var oRes=this.ws.workbook.oStyleManager.setCellStyle(this,newVal);if(History.Is_On()&&oRes.oldVal!=oRes.newVal){var oldStyleName=this.ws.workbook.CellStyles.getStyleNameByXfId(oRes.oldVal);History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_SetCellStyle,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oldStyleName,val));var oStyle=this.ws.workbook.CellStyles.getStyleByXfId(oRes.newVal);if(oStyle.ApplyFont)this.setFont(oStyle.getFont()); if(oStyle.ApplyFill)this.setFill(oStyle.getFill());if(oStyle.ApplyBorder)this.setBorder(oStyle.getBorder());if(oStyle.ApplyNumberFormat)this.setNumFormat(oStyle.getNumFormatStr())}};Row.prototype.setNumFormat=function(val){var oRes=this.ws.workbook.oStyleManager.setNum(this,new Num({f:val}));if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Num,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal, oRes.newVal))};Row.prototype.setNum=function(val){var oRes=this.ws.workbook.oStyleManager.setNum(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Num,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setFont=function(val){var oRes=this.ws.workbook.oStyleManager.setFont(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal){var oldVal=null;if(null!= oRes.oldVal)oldVal=oRes.oldVal.clone();var newVal=null;if(null!=oRes.newVal)newVal=oRes.newVal.clone();History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_SetFont,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oldVal,newVal))}};Row.prototype.setFontname=function(val){var oRes=this.ws.workbook.oStyleManager.setFontname(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Fontname, this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setFontsize=function(val){var oRes=this.ws.workbook.oStyleManager.setFontsize(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Fontsize,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setFontcolor=function(val){var oRes= this.ws.workbook.oStyleManager.setFontcolor(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Fontcolor,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setBold=function(val){var oRes=this.ws.workbook.oStyleManager.setBold(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Bold, this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setItalic=function(val){var oRes=this.ws.workbook.oStyleManager.setItalic(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Italic,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setUnderline=function(val){var oRes=this.ws.workbook.oStyleManager.setUnderline(this, val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Underline,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setStrikeout=function(val){var oRes=this.ws.workbook.oStyleManager.setStrikeout(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Strikeout,this.ws.getId(),this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setFontAlign=function(val){var oRes=this.ws.workbook.oStyleManager.setFontAlign(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_FontAlign,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setAlignVertical=function(val){var oRes=this.ws.workbook.oStyleManager.setAlignVertical(this, val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_AlignVertical,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setAlignHorizontal=function(val){var oRes=this.ws.workbook.oStyleManager.setAlignHorizontal(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_AlignHorizontal,this.ws.getId(), this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setFill=function(val){var oRes=this.ws.workbook.oStyleManager.setFill(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Fill,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setBorder=function(val){var oRes=this.ws.workbook.oStyleManager.setBorder(this, val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal){var oldVal=null;if(null!=oRes.oldVal)oldVal=oRes.oldVal.clone();var newVal=null;if(null!=oRes.newVal)newVal=oRes.newVal.clone();History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Border,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oldVal,newVal))}};Row.prototype.setShrinkToFit=function(val){var oRes=this.ws.workbook.oStyleManager.setShrinkToFit(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow, AscCH.historyitem_RowCol_ShrinkToFit,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setWrap=function(val){var oRes=this.ws.workbook.oStyleManager.setWrap(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Wrap,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setAngle= function(val){var oRes=this.ws.workbook.oStyleManager.setAngle(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoRow,AscCH.historyitem_RowCol_Angle,this.ws.getId(),this._getUpdateRange(),new UndoRedoData_IndexSimpleProp(this.index,true,oRes.oldVal,oRes.newVal))};Row.prototype.setHidden=function(val,bViewLocalChange){var inViewAndFilter=this.ws.getActiveNamedSheetViewId()!==null&&this.ws.autoFilters.containInFilter(this.index);if(!bViewLocalChange){var bCollaborativeChanges= !this.ws.autoFilters.useViewLocalChange&&this.ws.workbook.bCollaborativeChanges;bViewLocalChange=!bCollaborativeChanges&&inViewAndFilter}if(this.index>=0&&!this.getHidden()!==!val&&!(inViewAndFilter&&!bViewLocalChange))this.ws.hiddenManager.addHidden(true,this.index);var _rowFlag_hd=!bViewLocalChange?g_nRowFlag_hd:g_nRowFlag_hdView;if(true===val)this.flags|=_rowFlag_hd;else this.flags&=~_rowFlag_hd;this._hasChanged=true};Row.prototype.setOutlineLevel=function(val,bDel,notAddHistory){var oldProps= this.outlineLevel;if(null!==val)this.outlineLevel=val;else{if(!this.outlineLevel)this.outlineLevel=0;this.outlineLevel=bDel?this.outlineLevel-1:this.outlineLevel+1}if(this.outlineLevel<0)this.outlineLevel=0;else if(this.outlineLevel>c_maxOutlineLevel)this.outlineLevel=c_maxOutlineLevel;else this._hasChanged=true;if(!notAddHistory&&History.Is_On()&&oldProps!=this.outlineLevel)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_GroupRow,this.ws.getId(),this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index,true,oldProps,this.outlineLevel))};Row.prototype.getOutlineLevel=function(){return this.outlineLevel};Row.prototype.getHidden=function(bViewLocalChange){if(undefined===bViewLocalChange){var bCollaborativeChanges=!this.ws.autoFilters.useViewLocalChange&&this.ws.workbook.bCollaborativeChanges;bViewLocalChange=!bCollaborativeChanges&&this.ws.getActiveNamedSheetViewId()!==null&&this.ws.autoFilters.containInFilter(this.index)}var _rowFlag_hd=bViewLocalChange? g_nRowFlag_hdView:g_nRowFlag_hd;return 0!==(_rowFlag_hd&this.flags)};Row.prototype.setCustomHeight=function(val){if(true===val)this.flags|=g_nRowFlag_CustomHeight;else this.flags&=~g_nRowFlag_CustomHeight;this._hasChanged=true};Row.prototype.getCustomHeight=function(){return 0!=(g_nRowFlag_CustomHeight&this.flags)};Row.prototype.setCalcHeight=function(val){if(true===val)this.flags|=g_nRowFlag_CalcHeight;else this.flags&=~g_nRowFlag_CalcHeight;this._hasChanged=true};Row.prototype.getCalcHeight=function(){return 0!= (g_nRowFlag_CalcHeight&this.flags)};Row.prototype.setCollapsed=function(val){if(true===val)this.flags|=g_nRowFlag_Collapsed;else this.flags&=~g_nRowFlag_Collapsed;this._hasChanged=true};Row.prototype.getCollapsed=function(){return 0!=(g_nRowFlag_Collapsed&this.flags)};Row.prototype.setIndex=function(val){this.index=val};Row.prototype.getIndex=function(){return this.index};Row.prototype.setHeight=function(val){if(val<0)val=0;else if(val>Asc.c_oAscMaxRowHeight)val=Asc.c_oAscMaxRowHeight;this.h=val; this._hasChanged=true};Row.prototype.getHeight=function(){return this.h};Row.prototype.fromXLSB=function(stream,aCellXfs){var end=stream.XlsbReadRecordLength()+stream.GetCurPos();this.setIndex(stream.GetULongLE()&1048575);var style=stream.GetULongLE();var ht=stream.GetUShortLE();stream.Skip2(1);var byteExtra2=stream.GetUChar();this.setOutlineLevel(byteExtra2&7,null,true);if(0!==(byteExtra2&8))this.setCollapsed(true);if(0!==(byteExtra2&16))this.setHidden(true);if(0!==(byteExtra2&32))this.setCustomHeight(true); if(ht>0||this.getCustomHeight())this.setHeight(ht/20);if(0!==(byteExtra2&64)){var xf=aCellXfs[style];if(xf)this.setStyle(xf)}stream.Seek2(end)};Row.prototype.toXLSB=function(stream,offsetIndex,stylesForWrite){stream.XlsbStartRecord(AscCommonExcel.XLSB.rt_ROW_HDR,17);stream.WriteULong(this.index+offsetIndex&1048575);var nS=0;if(this.xfs)nS=stylesForWrite.add(this.xfs);stream.WriteULong(nS);var nHt=0;if(null!=this.h)nHt=this.h*20&8191;stream.WriteUShort(nHt);stream.WriteByte(0);var byteExtra2=0;if(this.outlineLevel> 0)byteExtra2|=this.outlineLevel&7;if(this.getCollapsed())byteExtra2|=8;if(this.getHidden())byteExtra2|=16;if(this.getCustomHeight())byteExtra2|=32;if(this.xfs)byteExtra2|=64;stream.WriteByte(byteExtra2);stream.WriteByte(0);stream.WriteULong(0);stream.XlsbEndRecord()};function getStringFromMultiText(multiText){var sRes="";if(multiText)for(var i=0,length=multiText.length;i<length;++i){var elem=multiText[i];if(null!=elem.text&&!(elem.format&&elem.format.getSkip()))sRes+=elem.text}return sRes}function getStringFromMultiTextSkipToSpace(multiText){var sRes= "";if(multiText)for(var i=0,length=multiText.length;i<length;++i){var elem=multiText[i];if(null!=elem.text)if(elem.format&&elem.format.getSkip())sRes+=" ";else if(!(elem.format&&elem.format.getRepeat()))sRes+=elem.text;else var j=0}return sRes}function isEqualMultiText(multiText1,multiText2){var sRes="";if(multiText1&&multiText2)if(multiText1.length===multiText2.length){for(var i=0,length=multiText1.length;i<length;++i){var elem1=multiText1[i];var elem2=multiText2[i];if(!elem1.isEqual(elem2))return false}return true}else return false; else return multiText1===multiText2}var g_oCMultiTextElemProperties={text:0,format:1};function CMultiTextElem(){this.text=null;this.format=null}CMultiTextElem.prototype={Properties:g_oCMultiTextElemProperties,isEqual:function(val){if(null==val)return false;return this.text==val.text&&(null==this.format&&null==val.format||null!=this.format&&null!=val.format&&this.format.isEqual(val.format))},clone:function(){var oRes=new CMultiTextElem;if(null!=this.text)oRes.text=this.text;if(null!=this.format)oRes.format= this.format.clone();return oRes},getType:function(){return UndoRedoDataTypes.ValueMultiTextElem},getProperties:function(){return this.Properties},getProperty:function(nType){switch(nType){case this.Properties.text:return this.text;break;case this.Properties.format:return this.format;break}},setProperty:function(nType,value){switch(nType){case this.Properties.text:this.text=value;break;case this.Properties.format:this.format=value;break}}};var g_oCCellValueProperties={text:0,multiText:1,number:2,type:3}; function CCellValue(opt_cell){if(opt_cell){this.text=opt_cell.text;this.multiText=opt_cell.multiText;this.number=opt_cell.number;this.type=opt_cell.type}else{this.text=null;this.multiText=null;this.number=null;this.type=CellValueType.Number}}CCellValue.prototype={Properties:g_oCCellValueProperties,isEqual:function(val){if(null==val)return false;if(this.text!=val.text)return false;if(this.number!=val.number)return false;if(this.type!=val.type)return false;if(null!=this.multiText&&null!=val.multiText){if(this.multiText.length== val.multiText.length){for(var i=0,length=this.multiText.length;i<length;++i)if(false==this.multiText[i].isEqual(val.multiText[i]))return false;return true}return false}else if(null==this.multiText&&null==val.multiText)return true;return false},isEqualCell:function(cell){return this.isEqual(cell)},getType:function(){return UndoRedoDataTypes.CellValue},getProperties:function(){return this.Properties},getProperty:function(nType){switch(nType){case this.Properties.text:return this.text;break;case this.Properties.multiText:return this.multiText; break;case this.Properties.number:return this.number;break;case this.Properties.type:return this.type;break}},setProperty:function(nType,value){switch(nType){case this.Properties.text:this.text=value;break;case this.Properties.multiText:this.multiText=value;break;case this.Properties.number:this.number=value;break;case this.Properties.type:this.type=value;break}},getTextValue:function(num){var multiText=this.multiText;var numFormat=AscCommon.oNumFormatCache.get(num&&num.getFormat()||"General");if(null!== this.text)multiText=numFormat.format(this.text,this.type,AscCommon.gc_nMaxDigCount,false);else if(null!==this.number)if(CellValueType.Bool===this.type)multiText=[{text:this.number==1?AscCommon.cBoolLocal.t:AscCommon.cBoolLocal.f}];else multiText=numFormat.format(this.number,this.type,AscCommon.gc_nMaxDigCount,false);if(null!==multiText)return AscCommonExcel.getStringFromMultiTextSkipToSpace(multiText);return""}};function RangeDataManagerElem(bbox,data){this.bbox=bbox;this.data=data}function RangeDataManager(fChange){this.tree= new AscCommon.DataIntervalTree2D;this.oDependenceManager=null;this.fChange=fChange;this.initData=null;this.worksheet=null}RangeDataManager.prototype._delayedInit=function(){if(this.initData){var initData=this.initData;this.initData=null;var t=this;AscCommonExcel.executeInR1C1Mode(false,function(){History.TurnOff();for(var i=0;i<initData.length;++i){var range=t.worksheet.getRange2(initData[i]);if(null!=range)range.mergeOpen()}History.TurnOn()})}};RangeDataManager.prototype.add=function(bbox,data,oChangeParam){this._delayedInit(); var oNewElem=new RangeDataManagerElem(new Asc.Range(bbox.c1,bbox.r1,bbox.c2,bbox.r2),data);this.tree.insert(bbox,oNewElem);if(null!=this.fChange)this.fChange.call(this,oNewElem.data,null,oNewElem.bbox,oChangeParam)};RangeDataManager.prototype.get=function(bbox){this._delayedInit();var oRes={all:[],inner:[],outer:[]};var intervals=this.tree.searchNodes(bbox);for(var i=0;i<intervals.length;i++){var interval=intervals[i];var elem=interval.data;if(elem.bbox.isIntersect(bbox)){oRes.all.push(elem);if(bbox.containsRange(elem.bbox))oRes.inner.push(elem); else oRes.outer.push(elem)}}return oRes};RangeDataManager.prototype.getAny=function(bbox){this._delayedInit();return this.tree.searchAny(bbox)};RangeDataManager.prototype.getByCell=function(nRow,nCol){this._delayedInit();var bbox=new Asc.Range(nCol,nRow,nCol,nRow);var res=this.getAny(bbox);if(!res&&null!=this.oDependenceManager){var oDependence=this.oDependenceManager.getAny(bbox);if(oDependence)res=this.getAny(oDependence.bbox)}return res};RangeDataManager.prototype.remove=function(bbox,bInnerOnly, oChangeParam){this._delayedInit();var aElems=this.get(bbox);var aTargetArray;if(bInnerOnly)aTargetArray=aElems.inner;else aTargetArray=aElems.all;for(var i=0,length=aTargetArray.length;i<length;++i){var elem=aTargetArray[i];this.removeElement(elem,oChangeParam)}};RangeDataManager.prototype.removeElement=function(elemToDelete,oChangeParam){this._delayedInit();if(null!=elemToDelete){this.tree.remove(elemToDelete.bbox,elemToDelete);if(null!=this.fChange)this.fChange.call(this,elemToDelete.data,elemToDelete.bbox, null,oChangeParam)}};RangeDataManager.prototype.shiftGet=function(bbox,bHor){this._delayedInit();var bboxGet=shiftGetBBox(bbox,bHor);return{bbox:bboxGet,elems:this.get(bboxGet)}};RangeDataManager.prototype.shift=function(bbox,bAdd,bHor,oGetRes,oChangeParam){this._delayedInit();var _this=this;if(null==oGetRes)oGetRes=this.shiftGet(bbox,bHor);var offset;if(bHor)offset=new AscCommon.CellBase(0,bbox.c2-bbox.c1+1);else offset=new AscCommon.CellBase(bbox.r2-bbox.r1+1,0);if(!bAdd){offset.row*=-1;offset.col*= -1}this._shiftmove(true,bbox,offset,oGetRes.elems,oChangeParam)};RangeDataManager.prototype.move=function(from,to,oChangeParam){this._delayedInit();var offset=new AscCommon.CellBase(to.r1-from.r1,to.c1-from.c1);var oGetRes=this.get(from);this._shiftmove(false,from,offset,oGetRes,oChangeParam)};RangeDataManager.prototype._shiftmove=function(bShift,bbox,offset,elems,oChangeParam){var aToChange=[];var bAdd=offset.row>0||offset.col>0;var bHor=0!=offset.col?true:false;if(elems.inner.length>0){var bboxAsc= new Asc.Range(bbox.c1,bbox.r1,bbox.c2,bbox.r2);for(var i=0,length=elems.inner.length;i<length;i++){var elem=elems.inner[i];var from=elem.bbox;var to=null;if(bShift)if(bAdd){to=from.clone();to.setOffset(offset)}else{if(!bboxAsc.containsRange(from)){to=from.clone();if(bHor){if(to.c1<=bbox.c2)to.setOffsetFirst(new AscCommon.CellBase(0,bbox.c2-to.c1+1))}else if(to.r1<=bbox.r2)to.setOffsetFirst(new AscCommon.CellBase(bbox.r2-to.r1+1,0));to.setOffset(offset)}}else{to=from.clone();to.setOffset(offset)}aToChange.push({elem:elem, to:to})}}if(bShift)if(elems.outer.length>0)for(var i=0,length=elems.outer.length;i<length;i++){var elem=elems.outer[i];var from=elem.bbox;var to=null;if(bHor){if(from.c1<bbox.c1&&bbox.r1<=from.r1&&from.r2<=bbox.r2)if(bAdd){to=from.clone();to.setOffsetLast(new AscCommon.CellBase(0,bbox.c2-bbox.c1+1))}else{to=from.clone();var nTemp1=from.c2-bbox.c1+1;var nTemp2=bbox.c2-bbox.c1+1;to.setOffsetLast(new AscCommon.CellBase(0,-Math.min(nTemp1,nTemp2)))}}else if(from.r1<bbox.r1&&bbox.c1<=from.c1&&from.c2<= bbox.c2)if(bAdd){to=from.clone();to.setOffsetLast(new AscCommon.CellBase(bbox.r2-bbox.r1+1,0))}else{to=from.clone();var nTemp1=from.r2-bbox.r1+1;var nTemp2=bbox.r2-bbox.r1+1;to.setOffsetLast(new AscCommon.CellBase(-Math.min(nTemp1,nTemp2),0))}if(null!=to)aToChange.push({elem:elem,to:to})}aToChange.sort(function(a,b){return shiftSort(a,b,offset)});if(null!=this.fChange)for(var i=0,length=aToChange.length;i<length;++i){var item=aToChange[i];this.fChange.call(this,item.elem.data,item.elem.bbox,item.to, oChangeParam)}var fOldChange=this.fChange;this.fChange=null;for(var i=0,length=aToChange.length;i<length;++i){var item=aToChange[i];var elem=item.elem;this.removeElement(elem,oChangeParam)}for(var i=0,length=aToChange.length;i<length;++i){var item=aToChange[i];if(null!=item.to)this.add(item.to,item.elem.data,oChangeParam)}this.fChange=fOldChange};RangeDataManager.prototype.getAll=function(){this._delayedInit();var res=[];var intervals=this.tree.searchNodes(new Asc.Range(0,0,gc_nMaxCol0,gc_nMaxRow0)); for(var i=0;i<intervals.length;i++){var interval=intervals[i];res.push(interval.data)}return res};RangeDataManager.prototype.setDependenceManager=function(oDependenceManager){this.oDependenceManager=oDependenceManager};function sparklineGroup(addId){this.type=null;this.lineWeight=null;this.displayEmptyCellsAs=null;this.markers=null;this.high=null;this.low=null;this.first=null;this.last=null;this.negative=null;this.displayXAxis=null;this.displayHidden=null;this.minAxisType=null;this.maxAxisType=null; this.rightToLeft=null;this.manualMax=null;this.manualMin=null;this.dateAxis=null;this.colorSeries=null;this.colorNegative=null;this.colorAxis=null;this.colorMarkers=null;this.colorFirst=null;this.colorLast=null;this.colorHigh=null;this.colorLow=null;this.f=null;this.arrSparklines=[];this.canvas=null;this.worksheet=null;this.Id=null;if(addId){this.Id=AscCommon.g_oIdCounter.Get_NewId();AscCommon.g_oTableId.Add(this,this.Id)}}sparklineGroup.prototype.getObjectType=function(){return AscDFH.historyitem_type_Sparkline}; sparklineGroup.prototype.Get_Id=function(){return this.Id};sparklineGroup.prototype.Write_ToBinary2=function(w){w.WriteLong(this.getObjectType());w.WriteString2(this.Id);w.WriteString2(this.worksheet?this.worksheet.getId():"-1")};sparklineGroup.prototype.Read_FromBinary2=function(r){this.Id=r.GetString2();var api_sheet=Asc["editor"];this.worksheet=api_sheet.wbModel.getWorksheetById(r.GetString2());if(this.worksheet)this.worksheet.insertSparklineGroup(this)};sparklineGroup.prototype.default=function(){this.type= Asc.c_oAscSparklineType.Line;this.lineWeight=.75;this.displayEmptyCellsAs=Asc.c_oAscEDispBlanksAs.Zero;this.markers=false;this.high=false;this.low=false;this.first=false;this.last=false;this.negative=false;this.displayXAxis=false;this.displayHidden=false;this.minAxisType=Asc.c_oAscSparklineAxisMinMax.Individual;this.maxAxisType=Asc.c_oAscSparklineAxisMinMax.Individual;this.rightToLeft=false;this.manualMax=null;this.manualMin=null;this.dateAxis=false;var defaultSeriesColor=3629202;var defaultOtherColor= 13631488;this.colorSeries=new RgbColor(defaultSeriesColor);this.colorNegative=new RgbColor(defaultOtherColor);this.colorAxis=new RgbColor(defaultOtherColor);this.colorMarkers=new RgbColor(defaultOtherColor);this.colorFirst=new RgbColor(defaultOtherColor);this.colorLast=new RgbColor(defaultOtherColor);this.colorHigh=new RgbColor(defaultOtherColor);this.colorLow=new RgbColor(defaultOtherColor)};sparklineGroup.prototype.setWorksheet=function(worksheet,oldWorksheet){this.worksheet=worksheet;if(oldWorksheet){var oldSparklines= [];var newSparklines=[];for(var i=0;i<this.arrSparklines.length;++i){oldSparklines.push(this.arrSparklines[i].clone());this.arrSparklines[i].updateWorksheet(worksheet.sName,oldWorksheet.sName);newSparklines.push(this.arrSparklines[i].clone())}History.Add(new AscDFH.CChangesSparklinesChangeData(this,oldSparklines,newSparklines))}};sparklineGroup.prototype.checkProperty=function(propOld,propNew,type,fChangeConstructor){if(null!==propNew&&propOld!==propNew){History.Add(new fChangeConstructor(this,type, propOld,propNew));return propNew}return propOld};sparklineGroup.prototype.set=function(val){var getColor=function(color){return color instanceof Asc.asc_CColor?CorrectAscColor(color):color?color.clone():color};this.type=this.checkProperty(this.type,val.type,AscDFH.historyitem_Sparkline_Type,AscDFH.CChangesDrawingsLong);this.lineWeight=this.checkProperty(this.lineWeight,val.lineWeight,AscDFH.historyitem_Sparkline_LineWeight,AscDFH.CChangesDrawingsDouble);this.displayEmptyCellsAs=this.checkProperty(this.displayEmptyCellsAs, val.displayEmptyCellsAs,AscDFH.historyitem_Sparkline_DisplayEmptyCellsAs,AscDFH.CChangesDrawingsLong);this.markers=this.checkProperty(this.markers,val.markers,AscDFH.historyitem_Sparkline_Markers,AscDFH.CChangesDrawingsBool);this.high=this.checkProperty(this.high,val.high,AscDFH.historyitem_Sparkline_High,AscDFH.CChangesDrawingsBool);this.low=this.checkProperty(this.low,val.low,AscDFH.historyitem_Sparkline_Low,AscDFH.CChangesDrawingsBool);this.first=this.checkProperty(this.first,val.first,AscDFH.historyitem_Sparkline_First, AscDFH.CChangesDrawingsBool);this.last=this.checkProperty(this.last,val.last,AscDFH.historyitem_Sparkline_Last,AscDFH.CChangesDrawingsBool);this.negative=this.checkProperty(this.negative,val.negative,AscDFH.historyitem_Sparkline_Negative,AscDFH.CChangesDrawingsBool);this.displayXAxis=this.checkProperty(this.displayXAxis,val.displayXAxis,AscDFH.historyitem_Sparkline_DisplayXAxis,AscDFH.CChangesDrawingsBool);this.displayHidden=this.checkProperty(this.displayHidden,val.displayHidden,AscDFH.historyitem_Sparkline_DisplayHidden, AscDFH.CChangesDrawingsBool);this.minAxisType=this.checkProperty(this.minAxisType,val.minAxisType,AscDFH.historyitem_Sparkline_MinAxisType,AscDFH.CChangesDrawingsLong);this.maxAxisType=this.checkProperty(this.maxAxisType,val.maxAxisType,AscDFH.historyitem_Sparkline_MaxAxisType,AscDFH.CChangesDrawingsLong);this.rightToLeft=this.checkProperty(this.rightToLeft,val.rightToLeft,AscDFH.historyitem_Sparkline_RightToLeft,AscDFH.CChangesDrawingsBool);this.manualMax=this.checkProperty(this.manualMax,val.manualMax, AscDFH.historyitem_Sparkline_ManualMax,AscDFH.CChangesDrawingsDouble);this.manualMin=this.checkProperty(this.manualMin,val.manualMin,AscDFH.historyitem_Sparkline_ManualMin,AscDFH.CChangesDrawingsDouble);this.dateAxis=this.checkProperty(this.dateAxis,val.dateAxis,AscDFH.historyitem_Sparkline_DateAxis,AscDFH.CChangesDrawingsBool);this.colorSeries=this.checkProperty(this.colorSeries,getColor(val.colorSeries),AscDFH.historyitem_Sparkline_ColorSeries,AscDFH.CChangesDrawingsExcelColor);this.colorNegative= this.checkProperty(this.colorNegative,getColor(val.colorNegative),AscDFH.historyitem_Sparkline_ColorNegative,AscDFH.CChangesDrawingsExcelColor);this.colorAxis=this.checkProperty(this.colorAxis,getColor(val.colorAxis),AscDFH.historyitem_Sparkline_ColorAxis,AscDFH.CChangesDrawingsExcelColor);this.colorMarkers=this.checkProperty(this.colorMarkers,getColor(val.colorMarkers),AscDFH.historyitem_Sparkline_ColorMarkers,AscDFH.CChangesDrawingsExcelColor);this.colorFirst=this.checkProperty(this.colorFirst, getColor(val.colorFirst),AscDFH.historyitem_Sparkline_ColorFirst,AscDFH.CChangesDrawingsExcelColor);this.colorLast=this.checkProperty(this.colorLast,getColor(val.colorLast),AscDFH.historyitem_Sparkline_colorLast,AscDFH.CChangesDrawingsExcelColor);this.colorHigh=this.checkProperty(this.colorHigh,getColor(val.colorHigh),AscDFH.historyitem_Sparkline_ColorHigh,AscDFH.CChangesDrawingsExcelColor);this.colorLow=this.checkProperty(this.colorLow,getColor(val.colorLow),AscDFH.historyitem_Sparkline_ColorLow, AscDFH.CChangesDrawingsExcelColor);this.f=this.checkProperty(this.f,val.f,AscDFH.historyitem_Sparkline_F,AscDFH.CChangesDrawingsString);this.cleanCache()};sparklineGroup.prototype.clone=function(onlyProps){var res=new sparklineGroup(!onlyProps);res.set(this);res.f=this.f;if(!onlyProps){var newSparklines=[];for(var i=0;i<this.arrSparklines.length;++i){res.arrSparklines.push(this.arrSparklines[i].clone());newSparklines.push(this.arrSparklines[i].clone())}History.Add(new AscDFH.CChangesSparklinesChangeData(res, null,newSparklines))}return res};sparklineGroup.prototype.draw=function(oDrawingContext){var oCacheView;var graphics=new AscCommon.CGraphics;graphics.init(oDrawingContext.ctx,oDrawingContext.getWidth(0),oDrawingContext.getHeight(0),oDrawingContext.getWidth(3),oDrawingContext.getHeight(3));graphics.m_oFontManager=AscCommon.g_fontManager;for(var i=0;i<this.arrSparklines.length;++i)if(oCacheView=this.arrSparklines[i].oCacheView)oCacheView.draw(graphics)};sparklineGroup.prototype.cleanCache=function(){for(var i= 0;i<this.arrSparklines.length;++i)this.arrSparklines[i].oCacheView=null};sparklineGroup.prototype.updateCache=function(sheet,ranges){var sparklineRange;for(var i=0;i<this.arrSparklines.length;++i){sparklineRange=this.arrSparklines[i]._f;if(sparklineRange)for(var j=0;j<ranges.length;++j)if(sparklineRange.isIntersect(ranges[j],sheet)){this.arrSparklines[i].oCacheView=null;break}}};sparklineGroup.prototype.contains=function(c,r){for(var j=0;j<this.arrSparklines.length;++j)if(this.arrSparklines[j].contains(c, r))return j;return-1};sparklineGroup.prototype.intersectionSimple=function(range){for(var j=0;j<this.arrSparklines.length;++j)if(this.arrSparklines[j].intersectionSimple(range))return j;return-1};sparklineGroup.prototype.remove=function(range){for(var i=0;i<this.arrSparklines.length;++i)if(this.arrSparklines[i].checkInRange(range)){History.Add(new AscDFH.CChangesSparklinesRemoveData(this,this.arrSparklines[i]));this.arrSparklines.splice(i,1);--i}return 0===this.arrSparklines.length};sparklineGroup.prototype.getLocationRanges= function(onlySingle){var result=new AscCommonExcel.SelectionRange;this.arrSparklines.forEach(function(item,i){if(0===i)result.assign2(item.sqRef);else{result.addRange();result.getLast().assign2(item.sqRef)}});var unionRange=result.getUnion();return!onlySingle||unionRange.isSingleRange()?unionRange:result};sparklineGroup.prototype.getDataRanges=function(){var isUnion=true;var sheet=this.worksheet.getName();var result=new AscCommonExcel.SelectionRange;this.arrSparklines.forEach(function(item,i){if(item._f){isUnion= isUnion&&sheet===item._f.sheet;if(0===i)result.assign2(item._f);else{result.addRange();result.getLast().assign2(item._f)}}else isUnion=false});var unionRange=isUnion?result.getUnion():result;return unionRange.isSingleRange()?unionRange:result};sparklineGroup.prototype.asc_getId=function(){return this.Id};sparklineGroup.prototype.asc_getType=function(){return null!==this.type?this.type:Asc.c_oAscSparklineType.Line};sparklineGroup.prototype.asc_getLineWeight=function(){return null!==this.lineWeight? this.lineWeight:.75};sparklineGroup.prototype.asc_getDisplayEmpty=function(){return null!==this.displayEmptyCellsAs?this.displayEmptyCellsAs:Asc.c_oAscEDispBlanksAs.Zero};sparklineGroup.prototype.asc_getMarkersPoint=function(){return!!this.markers};sparklineGroup.prototype.asc_getHighPoint=function(){return!!this.high};sparklineGroup.prototype.asc_getLowPoint=function(){return!!this.low};sparklineGroup.prototype.asc_getFirstPoint=function(){return!!this.first};sparklineGroup.prototype.asc_getLastPoint= function(){return!!this.last};sparklineGroup.prototype.asc_getNegativePoint=function(){return!!this.negative};sparklineGroup.prototype.asc_getDisplayXAxis=function(){return this.displayXAxis};sparklineGroup.prototype.asc_getDisplayHidden=function(){return this.displayHidden};sparklineGroup.prototype.asc_getMinAxisType=function(){return null!==this.minAxisType?this.minAxisType:Asc.c_oAscSparklineAxisMinMax.Individual};sparklineGroup.prototype.asc_getMaxAxisType=function(){return null!==this.maxAxisType? this.maxAxisType:Asc.c_oAscSparklineAxisMinMax.Individual};sparklineGroup.prototype.asc_getRightToLeft=function(){return this.rightToLeft};sparklineGroup.prototype.asc_getManualMax=function(){return this.manualMax};sparklineGroup.prototype.asc_getManualMin=function(){return this.manualMin};sparklineGroup.prototype.asc_getColorSeries=function(){return Asc.colorObjToAscColor(this.colorSeries)};sparklineGroup.prototype.asc_getColorNegative=function(){return Asc.colorObjToAscColor(this.colorNegative)}; sparklineGroup.prototype.asc_getColorAxis=function(){return Asc.colorObjToAscColor(this.colorAxis)};sparklineGroup.prototype.asc_getColorMarkers=function(){return Asc.colorObjToAscColor(this.colorMarkers)};sparklineGroup.prototype.asc_getColorFirst=function(){return Asc.colorObjToAscColor(this.colorFirst)};sparklineGroup.prototype.asc_getColorLast=function(){return Asc.colorObjToAscColor(this.colorLast)};sparklineGroup.prototype.asc_getColorHigh=function(){return Asc.colorObjToAscColor(this.colorHigh)}; sparklineGroup.prototype.asc_getColorLow=function(){return Asc.colorObjToAscColor(this.colorLow)};sparklineGroup.prototype.asc_getDataRanges=function(){var arrResultData=[];var arrResultLocation=[];var oLocationRanges=this.getLocationRanges(true);var oDataRanges=oLocationRanges.isSingleRange()&&this.getDataRanges();if(oLocationRanges.isSingleRange()&&oDataRanges.isSingleRange())for(var i=0;i<oLocationRanges.ranges.length;++i){arrResultData.push(oDataRanges.ranges[i].getName());arrResultLocation.push(oLocationRanges.ranges[i].getAbsName())}else this.arrSparklines.forEach(function(item){arrResultData.push(item.f|| AscCommon.cErrorOrigin["ref"]);arrResultLocation.push(item.sqRef.getAbsName())});return[arrResultData.join(AscCommon.FormulaSeparators.functionArgumentSeparator),arrResultLocation.join(AscCommon.FormulaSeparators.functionArgumentSeparator)]};sparklineGroup.prototype.asc_setType=function(val){this.type=val};sparklineGroup.prototype.asc_setLineWeight=function(val){this.lineWeight=val};sparklineGroup.prototype.asc_setDisplayEmpty=function(val){this.displayEmptyCellsAs=val};sparklineGroup.prototype.asc_setMarkersPoint= function(val){this.markers=val};sparklineGroup.prototype.asc_setHighPoint=function(val){this.high=val};sparklineGroup.prototype.asc_setLowPoint=function(val){this.low=val};sparklineGroup.prototype.asc_setFirstPoint=function(val){this.first=val};sparklineGroup.prototype.asc_setLastPoint=function(val){this.last=val};sparklineGroup.prototype.asc_setNegativePoint=function(val){this.negative=val};sparklineGroup.prototype.asc_setDisplayXAxis=function(val){this.displayXAxis=val};sparklineGroup.prototype.asc_setDisplayHidden= function(val){this.displayHidden=val};sparklineGroup.prototype.asc_setMinAxisType=function(val){this.minAxisType=val};sparklineGroup.prototype.asc_setMaxAxisType=function(val){this.maxAxisType=val};sparklineGroup.prototype.asc_setRightToLeft=function(val){this.rightToLeft=val};sparklineGroup.prototype.asc_setManualMax=function(val){this.manualMax=val};sparklineGroup.prototype.asc_setManualMin=function(val){this.manualMin=val};sparklineGroup.prototype.asc_setColorSeries=function(val){this.colorSeries= val};sparklineGroup.prototype.asc_setColorNegative=function(val){this.colorNegative=val};sparklineGroup.prototype.asc_setColorAxis=function(val){this.colorAxis=val};sparklineGroup.prototype.asc_setColorMarkers=function(val){this.colorMarkers=val};sparklineGroup.prototype.asc_setColorFirst=function(val){this.colorFirst=val};sparklineGroup.prototype.asc_setColorLast=function(val){this.colorLast=val};sparklineGroup.prototype.asc_setColorHigh=function(val){this.colorHigh=val};sparklineGroup.prototype.asc_setColorLow= function(val){this.colorLow=val};sparklineGroup.prototype.createExcellColor=function(aColor){var oExcellColor=null;if(Array.isArray(aColor))if(2===aColor.length)oExcellColor=AscCommonExcel.g_oColorManager.getThemeColor(aColor[0],aColor[1]);else if(1===aColor.length)oExcellColor=new AscCommonExcel.RgbColor(16777215&aColor[0]);return oExcellColor};sparklineGroup.prototype._generateThumbCache=function(){function createItem(value){return{numFormatStr:"General",isDateTimeFormat:false,val:value,isHidden:false}} switch(this.asc_getType()){case Asc.c_oAscSparklineType.Line:{return[createItem(4),createItem(-58),createItem(51),createItem(-124),createItem(124),createItem(60)]}case Asc.c_oAscSparklineType.Column:{return[createItem(88),createItem(56),createItem(144),createItem(64),createItem(-56),createItem(-104),createItem(-40),createItem(-24),createItem(-56),createItem(104),createItem(56),createItem(80),createItem(-56),createItem(88)]}case Asc.c_oAscSparklineType.Stacked:{return[createItem(1),createItem(-1), createItem(-1),createItem(-2),createItem(1),createItem(1),createItem(-1),createItem(1),createItem(1),createItem(1),createItem(1),createItem(2),createItem(-1),createItem(1)]}}return[]};sparklineGroup.prototype._drawThumbBySparklineGroup=function(oSparkline,oSparklineGroup,oSparklineView,oGraphics){oSparklineView.initFromSparkline(oSparkline,oSparklineGroup,null,true);var t=this;AscFormat.ExecuteNoHistory(function(){oSparklineView.chartSpace.setWorksheet(t.worksheet)},this,[]);oSparklineView.chartSpace.extX= 100;oSparklineView.chartSpace.extY=100;oSparklineView.chartSpace.x=0;oSparklineView.chartSpace.y=0;var type=oSparklineGroup.asc_getType();if(type===Asc.c_oAscSparklineType.Stacked)AscFormat.ExecuteNoHistory(function(){var oPlotArea=oSparklineView.chartSpace.chart.plotArea;if(!oPlotArea.layout)oPlotArea.setLayout(new AscFormat.CLayout);var fPos=.32;oPlotArea.layout.setWMode(AscFormat.LAYOUT_MODE_FACTOR);oPlotArea.layout.setW(1);oPlotArea.layout.setHMode(AscFormat.LAYOUT_MODE_FACTOR);oPlotArea.layout.setH(1- 2*fPos);oPlotArea.layout.setYMode(AscFormat.LAYOUT_MODE_EDGE);oPlotArea.layout.setY(fPos)},this,[]);if(type===Asc.c_oAscSparklineType.Line)AscFormat.ExecuteNoHistory(function(){var oPlotArea=oSparklineView.chartSpace.chart.plotArea;if(!oPlotArea.layout)oPlotArea.setLayout(new AscFormat.CLayout);var fPos=.16;oPlotArea.layout.setWMode(AscFormat.LAYOUT_MODE_FACTOR);oPlotArea.layout.setW(1-fPos);oPlotArea.layout.setHMode(AscFormat.LAYOUT_MODE_FACTOR);oPlotArea.layout.setH(1-fPos)},this,[]);AscFormat.ExecuteNoHistory(function(){AscFormat.CheckSpPrXfrm(oSparklineView.chartSpace)}, this,[]);oSparklineView.chartSpace.recalculate();oSparklineView.chartSpace.brush=AscFormat.CreateSolidFillRGBA(255,255,255,255);oSparklineView.chartSpace.draw(oGraphics)};sparklineGroup.prototype._isEqualStyle=function(oSparklineGroup){var equalColors=function(color1,color2){return color1?color1.isEqual(color2):color1===color2};return equalColors(this.colorSeries,oSparklineGroup.colorSeries)&&equalColors(this.colorNegative,oSparklineGroup.colorNegative)&&equalColors(this.colorMarkers,oSparklineGroup.colorMarkers)&& equalColors(this.colorFirst,oSparklineGroup.colorFirst)&&equalColors(this.colorLast,oSparklineGroup.colorLast)&&equalColors(this.colorHigh,oSparklineGroup.colorHigh)&&equalColors(this.colorLow,oSparklineGroup.colorLow)};sparklineGroup.prototype.asc_getStyles=function(type){History.TurnOff();var aRet=[];var nStyleIndex=-1;var oSparklineGroup=this.clone(true);if("undefined"!==typeof type)oSparklineGroup.asc_setType(type);var canvas=document.createElement("canvas");canvas.width=50;canvas.height=50;if(AscCommon.AscBrowser.isRetina){canvas.width= AscCommon.AscBrowser.convertToRetinaValue(canvas.width,true);canvas.height=AscCommon.AscBrowser.convertToRetinaValue(canvas.height,true)}var oSparklineView=new AscFormat.CSparklineView;var oSparkline=new sparkline;oSparkline.oCache=this._generateThumbCache();var oGraphics=new AscCommon.CGraphics;oGraphics.init(canvas.getContext("2d"),canvas.width,canvas.height,100,100);oGraphics.m_oFontManager=AscCommon.g_fontManager;oGraphics.transform(1,0,0,1,0,0);for(var i=0;i<36;++i){oSparklineGroup.asc_setStyle(i); if(nStyleIndex===-1&&this._isEqualStyle(oSparklineGroup))nStyleIndex=i;this._drawThumbBySparklineGroup(oSparkline,oSparklineGroup,oSparklineView,oGraphics);aRet.push(canvas.toDataURL("image/png"))}aRet.push(nStyleIndex);History.TurnOn();return aRet};sparklineGroup.prototype.asc_setStyle=function(nStyleIndex){var oStyle=AscFormat.aSparklinesStyles[nStyleIndex];if(oStyle){this.colorSeries=this.createExcellColor(oStyle[0]);this.colorNegative=this.createExcellColor(oStyle[1]);this.colorAxis=this.createExcellColor(4278190080); this.colorMarkers=this.createExcellColor(oStyle[2]);this.colorFirst=this.createExcellColor(oStyle[3]);this.colorLast=this.createExcellColor(oStyle[4]);this.colorHigh=this.createExcellColor(oStyle[5]);this.colorLow=this.createExcellColor(oStyle[6])}};function sparkline(){this.sqRef=null;this.f=null;this._f=null;this.oCache=null;this.oCacheView=null}sparkline.prototype.clone=function(){var res=new sparkline;res.sqRef=this.sqRef?this.sqRef.clone():null;res.f=this.f;res._f=this._f?this._f.clone():null; return res};sparkline.prototype.setSqRef=function(sqRef){this.sqRef=AscCommonExcel.g_oRangeCache.getAscRange(sqRef).clone();this.sqRef.setAbs(true,true,true,true)};sparkline.prototype.setF=function(f){this.f=f;this._f=AscCommonExcel.g_oRangeCache.getRange3D(this.f)};sparkline.prototype.updateWorksheet=function(sheet,oldSheet){var t=this;if(this._f&&oldSheet===this._f.sheet&&(null===this._f.sheet2||oldSheet===this._f.sheet2)){this._f.setSheet(sheet);AscCommonExcel.executeInR1C1Mode(false,function(){t.f= t._f.getName()})}};sparkline.prototype.checkInRange=function(range){return this.sqRef?range.isIntersect(this.sqRef):false};sparkline.prototype.contains=function(c,r){return this.sqRef?this.sqRef.contains(c,r):false};sparkline.prototype.intersectionSimple=function(range){return this.sqRef?this.sqRef.intersectionSimple(range):false};function TablePart(handlers){this.Ref=null;this.HeaderRowCount=null;this.TotalsRowCount=null;this.DisplayName=null;this.AutoFilter=null;this.SortState=null;this.TableColumns= null;this.TableStyleInfo=null;this.altText=null;this.altTextSummary=null;this.result=null;this.handlers=handlers}TablePart.prototype.clone=function(){var i,res=new TablePart(this.handlers);res.Ref=this.Ref?this.Ref.clone():null;res.HeaderRowCount=this.HeaderRowCount;res.TotalsRowCount=this.TotalsRowCount;if(this.AutoFilter)res.AutoFilter=this.AutoFilter.clone();if(this.SortState)res.SortState=this.SortState.clone();if(this.TableColumns){res.TableColumns=[];for(i=0;i<this.TableColumns.length;++i)res.TableColumns.push(this.TableColumns[i].clone())}if(this.TableStyleInfo)res.TableStyleInfo= this.TableStyleInfo.clone();if(this.result){res.result=[];for(i=0;i<this.result.length;++i)res.result.push(this.result[i].clone())}res.DisplayName=this.DisplayName;res.altText=this.altText;res.altTextSummary=this.altTextSummary;return res};TablePart.prototype.renameSheetCopy=function(ws,renameParams){for(var i=0;i<this.TableColumns.length;++i)this.TableColumns[i].renameSheetCopy(ws,renameParams)};TablePart.prototype.removeDependencies=function(opt_cols){if(!opt_cols)opt_cols=this.TableColumns;for(var i= 0;i<opt_cols.length;++i)opt_cols[i].removeDependencies()};TablePart.prototype.buildDependencies=function(){for(var i=0;i<this.TableColumns.length;++i)this.TableColumns[i].buildDependencies()};TablePart.prototype.getAllFormulas=function(formulas){for(var i=0;i<this.TableColumns.length;++i)this.TableColumns[i].getAllFormulas(formulas)};TablePart.prototype.moveRef=function(col,row){var ref=this.Ref.clone();ref.setOffset(new AscCommon.CellBase(row||0,col||0));this.Ref=ref;this.handlers.trigger("changeRefTablePart", this);if(this.AutoFilter)this.AutoFilter.moveRef(col,row);if(this.SortState)this.SortState.moveRef(col,row)};TablePart.prototype.changeRef=function(col,row,bIsFirst,bIsNotChangeAutoFilter){var ref=this.Ref.clone();var offset=new AscCommon.CellBase(row||0,col||0);if(bIsFirst)ref.setOffsetFirst(offset);else ref.setOffsetLast(offset);this.Ref=ref;this.handlers.trigger("changeRefTablePart",this);if(this.AutoFilter&&!bIsNotChangeAutoFilter)this.AutoFilter.changeRef(col,row,bIsFirst);if(this.SortState)this.SortState.changeRef(col, row,bIsFirst)};TablePart.prototype.changeRefOnRange=function(range,autoFilters,generateNewTableColumns){if(!range)return;if(generateNewTableColumns){var newTableColumns=[];var intersectionRanges=this.Ref.intersection(range);if(null!==intersectionRanges){this.removeDependencies();var tableColumn;var headerRow=this.isHeaderRow()?this.Ref.r1:this.Ref.r1-1;for(var i=range.c1;i<=range.c2;i++){if(i>=intersectionRanges.c1&&i<=intersectionRanges.c2){var tableIndex=i-this.Ref.c1;tableColumn=this.TableColumns[tableIndex]}else{tableColumn= new TableColumn;var cell=autoFilters.worksheet.getCell3(headerRow,i);if(!cell.isNullText())tableColumn.Name=autoFilters.checkTableColumnName(newTableColumns.concat(this.TableColumns),cell.getValueWithoutFormat())}newTableColumns.push(tableColumn)}for(var j=0;j<newTableColumns.length;j++){tableColumn=newTableColumns[j];if(tableColumn.Name===null)tableColumn.Name=autoFilters._generateColumnName2(newTableColumns)}this.TableColumns=newTableColumns;this.buildDependencies()}}var wb=autoFilters.worksheet.workbook; if(this.isTotalsRow()&&this.Ref.r2!==range.r2&&!wb.bUndoChanges&&!wb.bRedoChanges){var rangeTotal=autoFilters.worksheet.getRange3(this.Ref.r2,this.Ref.c1,this.Ref.r2,this.Ref.c2);rangeTotal.cleanText()}this.Ref=new Asc.Range(range.c1,range.r1,range.c2,range.r2);this.handlers.trigger("changeRefTablePart",this);if(this.AutoFilter){var filterRange=new Asc.Range(range.c1,range.r1,range.c2,this.isTotalsRow()?range.r2-1:range.r2);this.AutoFilter.changeRefOnRange(filterRange)}};TablePart.prototype.isApplyAutoFilter= function(){var res=false;if(this.AutoFilter)res=this.AutoFilter.isApplyAutoFilter();return res};TablePart.prototype.isApplySortConditions=function(){var res=false;if(this.SortState&&this.SortState.SortConditions&&this.SortState.SortConditions[0])res=true;return res};TablePart.prototype.setHandlers=function(handlers){if(this.handlers===null)this.handlers=handlers};TablePart.prototype.deleteTableColumns=function(activeRange){if(!activeRange)return;var diff=null,startCol;if(activeRange.c1<this.Ref.c1&& activeRange.c2>=this.Ref.c1&&activeRange.c2<this.Ref.c2){diff=activeRange.c2-this.Ref.c1+1;startCol=0}else if(activeRange.c1<=this.Ref.c2&&activeRange.c2>this.Ref.c2&&activeRange.c1>this.Ref.c1){diff=this.Ref.c2-activeRange.c1+1;startCol=activeRange.c1-this.Ref.c1}else if(activeRange.c1>=this.Ref.c1&&activeRange.c2<=this.Ref.c2){diff=activeRange.c2-activeRange.c1+1;startCol=activeRange.c1-this.Ref.c1}if(diff!==null){var deleted=this.TableColumns.splice(startCol,diff);this.removeDependencies(deleted); var deletedMap={};for(var i=0;i<deleted.length;++i)deletedMap[deleted[i].Name]=1;this.handlers.trigger("deleteColumnTablePart",this.DisplayName,deletedMap);if(this.SortState){var bIsDeleteSortState=this.SortState.changeColumns(activeRange,true);if(bIsDeleteSortState)this.SortState=null}}};TablePart.prototype.addTableColumns=function(activeRange,autoFilters){var newTableColumns=[],num=0;this.removeDependencies();for(var j=0;j<this.TableColumns.length;){var curCol=num+this.Ref.c1;if(activeRange.c1<= curCol&&activeRange.c2>=curCol)newTableColumns[newTableColumns.length]=new TableColumn;else{newTableColumns[newTableColumns.length]=this.TableColumns[j];j++}num++}for(var j=0;j<newTableColumns.length;j++){var tableColumn=newTableColumns[j];if(tableColumn.Name===null)tableColumn.Name=autoFilters._generateColumnName2(newTableColumns)}this.TableColumns=newTableColumns;if(this.SortState)this.SortState.changeColumns(activeRange);this.buildDependencies()};TablePart.prototype.addTableLastColumn=function(activeRange, autoFilters,isAddLastColumn){this.removeDependencies();var newTableColumns=this.TableColumns;newTableColumns.push(new TableColumn);newTableColumns[newTableColumns.length-1].Name=autoFilters._generateColumnName2(newTableColumns);this.TableColumns=newTableColumns;this.buildDependencies()};TablePart.prototype.isAutoFilter=function(){return false};TablePart.prototype.getAutoFilter=function(){return this.AutoFilter};TablePart.prototype.getTableRangeForFormula=function(objectParam){var res=null;var startRow= this.HeaderRowCount===null?this.Ref.r1+1:this.Ref.r1;var endRow=this.TotalsRowCount?this.Ref.r2-1:this.Ref.r2;switch(objectParam.param){case FormulaTablePartInfo.all:{res=new Asc.Range(this.Ref.c1,this.Ref.r1,this.Ref.c2,this.Ref.r2);break}case FormulaTablePartInfo.data:{res=new Asc.Range(this.Ref.c1,startRow,this.Ref.c2,endRow);break}case FormulaTablePartInfo.headers:{if(this.HeaderRowCount===null)res=new Asc.Range(this.Ref.c1,this.Ref.r1,this.Ref.c2,this.Ref.r1);else if(!objectParam.toRef||objectParam.bConvertTableFormulaToRef)res= new Asc.Range(this.Ref.c1,startRow,this.Ref.c2,endRow);break}case FormulaTablePartInfo.totals:{if(this.TotalsRowCount)res=new Asc.Range(this.Ref.c1,this.Ref.r2,this.Ref.c2,this.Ref.r2);else if(!objectParam.toRef||objectParam.bConvertTableFormulaToRef)res=new Asc.Range(this.Ref.c1,startRow,this.Ref.c2,endRow);break}case FormulaTablePartInfo.thisRow:{if(objectParam.cell)if(startRow<=objectParam.cell.r1&&objectParam.cell.r1<=endRow)res=new Asc.Range(this.Ref.c1,objectParam.cell.r1,this.Ref.c2,objectParam.cell.r1); else{if(objectParam.bConvertTableFormulaToRef)res=new Asc.Range(this.Ref.c1,startRow,this.Ref.c2,endRow)}else if(objectParam.bConvertTableFormulaToRef)res=new Asc.Range(this.Ref.c1,0,this.Ref.c2,0);else res=new Asc.Range(this.Ref.c1,startRow,this.Ref.c2,endRow);break}case FormulaTablePartInfo.columns:{var startCol=this.getTableIndexColumnByName(objectParam.startCol);var endCol=this.getTableIndexColumnByName(objectParam.endCol);if(startCol===null)break;if(endCol===null)endCol=startCol;res=new Asc.Range(this.Ref.c1+ startCol,startRow,this.Ref.c1+endCol,endRow);break}}if(res)if(objectParam.param===FormulaTablePartInfo.thisRow)res.setAbs(false,true,false,true);else res.setAbs(true,true,true,true);return res};TablePart.prototype.getTableIndexColumnByName=function(name){var res=null;if(name===null||name===undefined||!this.TableColumns)return res;for(var i=0;i<this.TableColumns.length;i++)if(name.toLowerCase()===this.TableColumns[i].Name.toLowerCase()){res=i;break}return res};TablePart.prototype.getTableRangeColumnByName= function(name){var res=null;if(name===null||name===undefined||!this.TableColumns)return res;for(var i=0;i<this.TableColumns.length;i++)if(name.toLowerCase()===this.TableColumns[i].Name.toLowerCase()){res=new Asc.Range(this.Ref.c1+i,this.Ref.r1,this.Ref.c1+i,this.Ref.r2);break}return res};TablePart.prototype.getTableNameColumnByIndex=function(index){var res=null;if(index===null||index===undefined||!this.TableColumns)return res;if(this.TableColumns[index])res=this.TableColumns[index].Name;return res}; TablePart.prototype.getIndexByColumnName=function(name){var res=null;if(name===null||name===undefined||!this.TableColumns)return res;for(var i=0;i<this.TableColumns.length;i++)if(name.toLowerCase()===this.TableColumns[i].Name.toLowerCase()){res=i;break}return res};TablePart.prototype.showButton=function(val){if(val===false){if(!this.AutoFilter){this.AutoFilter=new AutoFilter;this.AutoFilter.Ref=this.Ref}this.AutoFilter.showButton(val)}else if(this.AutoFilter&&this.AutoFilter.FilterColumns&&this.AutoFilter.FilterColumns.length)this.AutoFilter.showButton(val)}; TablePart.prototype.isShowButton=function(){var res=false;if(this.AutoFilter)res=this.AutoFilter.isShowButton();else res=null;return res};TablePart.prototype.generateTotalsRowLabel=function(ws){if(!this.TableColumns)return;if(this.TableColumns.length>1)this.TableColumns[0].generateTotalsRowLabel();this.TableColumns[this.TableColumns.length-1].generateTotalsRowFunction(ws,this)};TablePart.prototype.changeDisplayName=function(newName){this.DisplayName=newName};TablePart.prototype.getRangeWithoutHeaderFooter= function(){var startRow=this.HeaderRowCount===null?this.Ref.r1+1:this.Ref.r1;var endRow=this.TotalsRowCount?this.Ref.r2-1:this.Ref.r2;return Asc.Range(this.Ref.c1,startRow,this.Ref.c2,endRow)};TablePart.prototype.checkTotalRowFormula=function(ws){for(var i=0;i<this.TableColumns.length;i++)this.TableColumns[i].checkTotalRowFormula(ws,this)};TablePart.prototype.changeAltText=function(val){this.altText=val};TablePart.prototype.changeAltTextSummary=function(val){this.altTextSummary=val};TablePart.prototype.addAutoFilter= function(){var autoFilter=new AscCommonExcel.AutoFilter;var cloneRef=this.Ref.clone();if(this.TotalsRowCount)cloneRef.r2--;autoFilter.Ref=cloneRef;this.AutoFilter=autoFilter;return autoFilter};TablePart.prototype.isHeaderRow=function(){return null===this.HeaderRowCount||this.HeaderRowCount>0};TablePart.prototype.isTotalsRow=function(){return this.TotalsRowCount>0};TablePart.prototype.getTotalsRowRange=function(){var res=null;if(this.TotalsRowCount>0)res=new Asc.Range(this.Ref.c1,this.Ref.r2,this.Ref.c2, this.Ref.r2);return res};TablePart.prototype.generateSortState=function(){this.SortState=new AscCommonExcel.SortState;this.SortState.SortConditions=[];this.SortState.SortConditions[0]=new AscCommonExcel.SortCondition};TablePart.prototype.generateAutoFilterRef=function(){var res=null;if(this.Ref)if(this.isTotalsRow())res=new Asc.Range(this.Ref.c1,this.Ref.r1,this.Ref.c2,this.Ref.r2-1);else res=new Asc.Range(this.Ref.c1,this.Ref.r1,this.Ref.c2,this.Ref.r2);return res};TablePart.prototype.syncTotalLabels= function(ws){if(this.Ref)if(this.isTotalsRow())for(var i=0;i<this.TableColumns.length;i++)if(null!==this.TableColumns[i].TotalsRowLabel){var cell=ws.getCell3(this.Ref.r2,this.Ref.c1+i);if(cell.isFormula()){this.TableColumns[i].TotalsRowLabel=null;if(null===this.TableColumns[i].TotalsRowFunction)this.TableColumns[i].TotalsRowFunction=Asc.ETotalsRowFunction.totalrowfunctionCustom}else{var val=cell.getValue();if(val!==this.TableColumns[i].TotalsRowLabel)this.TableColumns[i].TotalsRowLabel=val}}};TablePart.prototype.getColIdByName= function(name){for(var i=0;i<this.TableColumns.length;i++)if(name===this.TableColumns[i].Name)return i;return null};function AutoFilter(){this.Ref=null;this.FilterColumns=null;this.SortState=null;this.result=null}AutoFilter.prototype.clone=function(){var i,res=new AutoFilter;res.Ref=this.Ref?this.Ref.clone():null;res.refTable=this.refTable?this.refTable.clone():null;if(this.FilterColumns){res.FilterColumns=[];for(i=0;i<this.FilterColumns.length;++i)res.FilterColumns.push(this.FilterColumns[i].clone())}if(this.SortState)res.SortState= this.SortState.clone();if(this.result){res.result=[];for(i=0;i<this.result.length;++i)res.result.push(this.result[i].clone())}return res};AutoFilter.prototype.addFilterColumn=function(){if(this.FilterColumns===null)this.FilterColumns=[];var oNewElem=new FilterColumn;this.FilterColumns.push(oNewElem);return oNewElem};AutoFilter.prototype.getFilterColumnByIndex=function(index){return this.FilterColumns&&this.FilterColumns[index]};AutoFilter.prototype.setStringRef=function(ref){if(-1!==ref.indexOf("!")){var is3DRef= AscCommon.parserHelp.parse3DRef(ref);if(is3DRef)ref=is3DRef.range}this.Ref=AscCommonExcel.g_oRangeCache.getAscRange(ref)};AutoFilter.prototype.moveRef=function(col,row){var ref=this.Ref.clone();ref.setOffset(new AscCommon.CellBase(row||0,col||0));if(this.SortState)this.SortState.moveRef(col,row);this.Ref=ref};AutoFilter.prototype.changeRef=function(col,row,bIsFirst){var ref=this.Ref.clone();var offset=new AscCommon.CellBase(row||0,col||0);if(bIsFirst)ref.setOffsetFirst(offset);else ref.setOffsetLast(offset); this.Ref=ref};AutoFilter.prototype.changeRefOnRange=function(range){if(!range)return;this.Ref=new Asc.Range(range.c1,range.r1,range.c2,range.r2)};AutoFilter.prototype.isApplyAutoFilter=function(){var res=false;if(this.FilterColumns&&this.FilterColumns.length)for(var i=0;i<this.FilterColumns.length;i++)if(this.FilterColumns[i].isApplyAutoFilter()){res=true;break}return res};AutoFilter.prototype.isApplySortConditions=function(){var res=false;if(this.SortState&&this.SortState.SortConditions&&this.SortState.SortConditions[0])res= true;return res};AutoFilter.prototype.isAutoFilter=function(){return true};AutoFilter.prototype.cleanFilters=function(){if(!this.FilterColumns)return;for(var i=0;i<this.FilterColumns.length;i++)if(this.FilterColumns[i].ShowButton===false)this.FilterColumns[i].clean();else{this.FilterColumns.splice(i,1);i--}};AutoFilter.prototype.showButton=function(val){if(val===false){if(this.FilterColumns===null)this.FilterColumns=[];var columnsLength=this.Ref.c2-this.Ref.c1+1;for(var i=0;i<columnsLength;i++){var filterColumn= this._getFilterColumnByColId(i);if(filterColumn)filterColumn.ShowButton=false;else{filterColumn=new FilterColumn;filterColumn.ColId=i;filterColumn.ShowButton=false;this.FilterColumns.push(filterColumn)}}}else if(this.FilterColumns&&this.FilterColumns.length)for(var i=0;i<this.FilterColumns.length;i++)this.FilterColumns[i].ShowButton=true};AutoFilter.prototype.isShowButton=function(){var res=true;if(this.FilterColumns&&this.FilterColumns.length)for(var i=0;i<this.FilterColumns.length;i++)if(this.FilterColumns[i].ShowButton=== false){res=false;break}return res};AutoFilter.prototype.getRangeWithoutHeaderFooter=function(){return Asc.Range(this.Ref.c1,this.Ref.r1+1,this.Ref.c2,this.Ref.r2)};AutoFilter.prototype._getFilterColumnByColId=function(colId){var res=false;if(this.FilterColumns&&this.FilterColumns.length)for(var i=0;i<this.FilterColumns.length;i++)if(this.FilterColumns[i].ColId===colId){res=this.FilterColumns[i];break}return res};AutoFilter.prototype.deleteTableColumns=function(activeRange){if(this.SortState){var bIsDeleteSortState= this.SortState.changeColumns(activeRange,true);if(bIsDeleteSortState)this.SortState=null}};AutoFilter.prototype.addTableColumns=function(activeRange){if(this.SortState)this.SortState.changeColumns(activeRange)};AutoFilter.prototype.getIndexByColId=function(colId){var res=null;if(!this.FilterColumns)return res;for(var i=0;i<this.FilterColumns.length;i++)if(this.FilterColumns[i].ColId===colId){res=i;break}return res};AutoFilter.prototype.getFilterColumn=function(colId){var res=null;if(!this.FilterColumns)return res; for(var i=0;i<this.FilterColumns.length;i++)if(this.FilterColumns[i].ColId===colId){res=this.FilterColumns[i];break}return res};AutoFilter.prototype.isHideButton=function(colId){var filterColumn=this.getFilterColumn(colId);return filterColumn&&false===filterColumn.ShowButton};AutoFilter.prototype.getAutoFilter=function(){return this};AutoFilter.prototype.hiddenByAnotherFilter=function(worksheet,cellId,row,col,opt_columnsFilter){var result=false;var filterColumns=opt_columnsFilter?opt_columnsFilter: this.FilterColumns;if(filterColumns)for(var j=0;j<filterColumns.length;j++){var filterColumn=opt_columnsFilter?filterColumns[j].filter:filterColumns[j];var colId=filterColumn.ColId;if(colId!==cellId){var cell=worksheet.getCell3(row,colId+col);var isDateTimeFormat=cell.getType()===window["AscCommon"].CellValueType.Number&&cell.getNumFormat().isDateTimeFormat();var isNumberFilter=filterColumn.isApplyCustomFilter();var val=isDateTimeFormat||isNumberFilter?cell.getValueWithoutFormat():cell.getValueWithFormat(); if(filterColumn.isHideValue(val,isDateTimeFormat,null,cell)){result=true;break}}}return result};AutoFilter.prototype.setRowHidden=function(worksheet,newFilterColumn,opt_columnsFilter){var startRow=this.Ref.r1+1;var endRow=this.Ref.r2;var colId=newFilterColumn?newFilterColumn.ColId:null;var minChangeRow=null;var hiddenObj={start:this.Ref.r1+1,h:null};var nHiddenRowCount=0;var nRowsCount=0;for(var i=startRow;i<=endRow;i++){var isHidden=this.hiddenByAnotherFilter(worksheet,colId,i,this.Ref.c1,opt_columnsFilter); if(!newFilterColumn){if(isHidden!==worksheet.getRowHidden(i))if(minChangeRow===null)minChangeRow=i;if(true===isHidden)worksheet.setRowHidden(isHidden,i,i)}else if(!isHidden){var cell=worksheet.getCell3(i,colId+this.Ref.c1);var isDateTimeFormat=cell.getType()===window["AscCommon"].CellValueType.Number&&cell.getNumFormat().isDateTimeFormat();var isNumberFilter=false;if(newFilterColumn.CustomFiltersObj||newFilterColumn.Top10||newFilterColumn.DynamicFilter)isNumberFilter=true;var currentValue=isDateTimeFormat|| isNumberFilter?cell.getValueWithoutFormat():cell.getValueWithFormat();var isSetHidden=newFilterColumn.isHideValue(currentValue,isDateTimeFormat,null,cell);if(isSetHidden!==worksheet.getRowHidden(i)&&minChangeRow===null)minChangeRow=i;if(hiddenObj.h===null){hiddenObj.h=isSetHidden;hiddenObj.start=i}else if(hiddenObj.h!==isSetHidden){worksheet.setRowHidden(hiddenObj.h,hiddenObj.start,i-1);if(true===hiddenObj.h)nHiddenRowCount+=i-hiddenObj.start;hiddenObj.h=isSetHidden;hiddenObj.start=i}if(i===endRow){worksheet.setRowHidden(hiddenObj.h, hiddenObj.start,i);if(true===hiddenObj.h)nHiddenRowCount+=i+1-hiddenObj.start}nRowsCount++}else if(hiddenObj.h!==null){worksheet.setRowHidden(hiddenObj.h,hiddenObj.start,i-1);if(true===hiddenObj.h)nHiddenRowCount+=i-hiddenObj.start;hiddenObj.h=null}}return{nOpenRowsCount:nRowsCount-nHiddenRowCount,nAllRowsCount:endRow-startRow+1,minChangeRow:minChangeRow}};AutoFilter.prototype.generateSortState=function(){this.SortState=new AscCommonExcel.SortState;this.SortState.SortConditions=[];this.SortState.SortConditions[0]= new AscCommonExcel.SortCondition};AutoFilter.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["ref"];if(undefined!==val)this.setStringRef(AscCommon.unleakString(uq(val)))}};AutoFilter.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("filterColumn"===elem){if(!this.FilterColumns)this.FilterColumns=[];newContext=new FilterColumn;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.FilterColumns.push(newContext)}else if("sortState"=== elem)newContext=null;else newContext=null;return newContext};AutoFilter.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.Ref)writer.WriteXmlAttributeStringEncode("ref",this.Ref.getName());writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.FilterColumns.length;++i){var elem=this.FilterColumns[i];elem.toXml(writer,"filterColumn")}writer.WriteXmlNodeEnd(name)};AutoFilter.prototype.deleteFilterColumn=function(index){if(this.FilterColumns&&this.FilterColumns[index])this.FilterColumns.splice(index, 1)};function FilterColumns(){this.ColId=null;this.CustomFiltersObj=null}FilterColumns.prototype.clone=function(){var res=new FilterColumns;res.ColId=this.ColId;if(this.CustomFiltersObj)res.CustomFiltersObj=this.CustomFiltersObj.clone();return res};function SortState(){this.Ref=null;this.CaseSensitive=null;this.ColumnSort=null;this.SortMethod=null;this.SortConditions=null}SortState.prototype.clone=function(){var i,res=new SortState;res.Ref=this.Ref?this.Ref.clone():null;res.CaseSensitive=this.CaseSensitive; res.ColumnSort=this.ColumnSort;res.SortMethod=this.SortMethod;if(this.SortConditions){res.SortConditions=[];for(i=0;i<this.SortConditions.length;++i)res.SortConditions.push(this.SortConditions[i].clone())}return res};SortState.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.SortState};SortState.prototype.Read_FromBinary2=function(r){if(r.GetBool()){var r1=r.GetLong();var c1=r.GetLong();var r2=r.GetLong();var c2=r.GetLong();this.Ref=new Asc.Range(c1,r1,c2,r2)}if(r.GetBool())this.CaseSensitive= r.GetBool();if(r.GetBool())this.ColumnSort=r.GetBool();if(r.GetBool())this.SortMethod=r.GetBool();var length=r.GetLong();for(var i=0;i<length;++i){var reply=new SortCondition;reply.Read_FromBinary2(r);if(!this.SortConditions)this.SortConditions=[];this.SortConditions.push(reply)}};SortState.prototype.Write_ToBinary2=function(w){if(null!=this.Ref){w.WriteBool(true);w.WriteLong(this.Ref.r1);w.WriteLong(this.Ref.c1);w.WriteLong(this.Ref.r2);w.WriteLong(this.Ref.c2)}else w.WriteBool(false);if(null!=this.CaseSensitive){w.WriteBool(true); w.WriteBool(this.CaseSensitive)}else w.WriteBool(false);if(null!=this.ColumnSort){w.WriteBool(true);w.WriteBool(this.ColumnSort)}else w.WriteBool(false);if(null!=this.SortMethod){w.WriteBool(true);w.WriteBool(this.SortMethod)}else w.WriteBool(false);w.WriteLong(this.SortConditions?this.SortConditions.length:0);for(var i=0;i<this.SortConditions.length;++i)this.SortConditions[i].Write_ToBinary2(w)};SortState.prototype.moveRef=function(col,row){var ref=this.Ref.clone();ref.setOffset(new AscCommon.CellBase(row|| 0,col||0));this.Ref=ref;if(this.SortConditions)for(var i=0;i<this.SortConditions.length;++i)this.SortConditions[i].moveRef(col,row)};SortState.prototype.changeRef=function(col,row,bIsFirst){var ref=this.Ref.clone();var offset=new AscCommon.CellBase(row||0,col||0);if(bIsFirst)ref.setOffsetFirst(offset);else ref.setOffsetLast(offset);this.Ref=ref};SortState.prototype.changeColumns=function(activeRange,isDelete){var bIsSortStateDelete=true;if(this.SortConditions)for(var i=0;i<this.SortConditions.length;++i){var bIsSortConditionsDelete= this.SortConditions[i].changeColumns(activeRange,isDelete);if(bIsSortConditionsDelete)this.SortConditions[i]=null;else bIsSortStateDelete=false}return bIsSortStateDelete};SortState.prototype.setOffset=function(offset,ws,addToHistory){var oldSortState=this.clone();var ref=this.Ref.clone();ref.setOffset(offset);this.Ref=ref;if(this.SortConditions)for(var i=0;i<this.SortConditions.length;++i)this.SortConditions[i].setOffset(offset);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoSortState,AscCH.historyitem_SortState_Add, ws.getId(),null,new AscCommonExcel.UndoRedoData_SortState(oldSortState,this.clone()))};SortState.prototype.shift=function(range,offset,ws,addToHistory){var oldSortState=this.clone();var from=this.Ref;var to=null;var bAdd=offset.row>0||offset.col>0;var bHor=0!=offset.col;var nTemp1,nTemp2;if(bHor)if(from.c1<range.c1&&range.r1<=from.r1&&from.r2<=range.r2)if(bAdd){to=from.clone();to.setOffsetLast(new AscCommon.CellBase(0,range.c2-range.c1+1))}else{to=from.clone();nTemp1=from.c2-range.c1+1;nTemp2=range.c2- range.c1+1;to.setOffsetLast(new AscCommon.CellBase(0,-Math.min(nTemp1,nTemp2)))}else{if(range.c1<=from.c1&&range.c2>=from.c1&&range.c2<=from.c2&&range.r1<=from.r1&&from.r2<=range.r2&&!bAdd){to=from.clone();nTemp1=range.c2-from.c1+1;nTemp2=range.c2-range.c1+1;to.setOffsetFirst(new AscCommon.CellBase(0,Math.min(nTemp1,nTemp2)))}}else if(from.r1<range.r1&&range.c1<=from.c1&&from.c2<=range.c2)if(bAdd){to=from.clone();to.setOffsetLast(new AscCommon.CellBase(range.r2-range.r1+1,0))}else{to=from.clone(); nTemp1=from.r2-range.r1+1;nTemp2=range.r2-range.r1+1;to.setOffsetLast(new AscCommon.CellBase(-Math.min(nTemp1,nTemp2),0))}else if(range.r1<=from.r1&&range.r2>=from.r1&&range.r2<=from.r2&&range.c1<=from.c1&&from.c2<=range.c2&&!bAdd){to=from.clone();nTemp1=range.r2-from.r1+1;nTemp2=range.r2-range.r1+1;to.setOffsetFirst(new AscCommon.CellBase(Math.min(nTemp1,nTemp2),0))}if(null!=to){this.Ref=to;if(this.SortConditions){var deleteIndexes=[];for(var i=0;i<this.SortConditions.length;++i){var sortCondition= this.SortConditions[i];var ref=sortCondition.Ref;if(offset.row<0||offset.col<0)if(range.containsRange(ref))deleteIndexes[i]=true;if(!deleteIndexes[i]){var bboxShift=AscCommonExcel.shiftGetBBox(range,0!==offset.col);if(bboxShift.containsRange(ref))sortCondition.setOffset(offset);else sortCondition.shift(range,offset,this.ColumnSort)}}for(var j in deleteIndexes)this.SortConditions.splice(j,1)}}if(addToHistory&&null!=to)History.Add(AscCommonExcel.g_oUndoRedoSortState,AscCH.historyitem_SortState_Add, ws.getId(),null,new AscCommonExcel.UndoRedoData_SortState(oldSortState,this.clone()))};function TableColumn(){this.Name=null;this.TotalsRowLabel=null;this.TotalsRowFunction=null;this.TotalsRowFormula=null;this.dxf=null;this.CalculatedColumnFormula=null;this.uniqueName=null;this.clipped=null;this.dataBound=null;this.fillFormulas=null;this.queryName=null;this.rowNumbers=null}TableColumn.prototype.onFormulaEvent=function(type,eventData){};TableColumn.prototype.renameSheetCopy=function(ws,renameParams){if(this.TotalsRowFormula){this.buildDependencies(); this.TotalsRowFormula.renameSheetCopy(renameParams);this.applyTotalRowFormula(this.TotalsRowFormula.assemble(true),ws,true)}};TableColumn.prototype.buildDependencies=function(){if(this.TotalsRowFormula){this.TotalsRowFormula.parse();this.TotalsRowFormula.buildDependencies()}};TableColumn.prototype.removeDependencies=function(){if(this.TotalsRowFormula)this.TotalsRowFormula.removeDependencies()};TableColumn.prototype.getAllFormulas=function(formulas){if(this.TotalsRowFormula)formulas.push(this.TotalsRowFormula)}; TableColumn.prototype.clone=function(){var res=new TableColumn;res.Name=this.Name;res.TotalsRowLabel=this.TotalsRowLabel;res.TotalsRowFunction=this.TotalsRowFunction;if(this.TotalsRowFormula)res.applyTotalRowFormula(this.TotalsRowFormula.getFormula(),this.TotalsRowFormula.ws,false);if(this.dxf)res.dxf=this.dxf.clone;res.CalculatedColumnFormula=this.CalculatedColumnFormula;res.uniqueName=this.uniqueName;res.clipped=this.clipped;res.dataBound=this.dataBound;res.fillFormulas=this.fillFormulas;res.queryName= this.queryName;res.rowNumbers=this.rowNumbers;return res};TableColumn.prototype.generateTotalsRowLabel=function(){if(this.TotalsRowLabel===null)this.TotalsRowLabel="Summary"};TableColumn.prototype.generateTotalsRowFunction=function(ws,tablePart){if(null===this.TotalsRowFunction&&null===this.TotalsRowLabel){var columnRange=this.getRange(tablePart);var totalFunction=Asc.ETotalsRowFunction.totalrowfunctionSum;if(null!==columnRange)for(var i=columnRange.r1;i<=columnRange.r2;i++){var type=ws.getCell3(i, columnRange.c1).getType();if(null!==type&&CellValueType.Number!==type){totalFunction=Asc.ETotalsRowFunction.totalrowfunctionCount;break}}this.TotalsRowFunction=totalFunction}};TableColumn.prototype.getTotalRowFormula=function(tablePart,bLocale){var t=this;var res=null;var funcNum;if(null!==this.TotalsRowFunction){var generateFunction=function(val){var _name="SUBTOTAL";var _f=bLocale&&AscCommonExcel.cFormulaFunctionToLocale?AscCommonExcel.cFormulaFunctionToLocale[_name]:_name;var _separator=AscCommon.FormulaSeparators.functionArgumentSeparator; return _f+"("+val+_separator+tablePart.DisplayName+"["+t.Name+"])"};switch(this.TotalsRowFunction){case Asc.ETotalsRowFunction.totalrowfunctionAverage:{res=generateFunction(101);break}case Asc.ETotalsRowFunction.totalrowfunctionCount:{res=generateFunction(103);break}case Asc.ETotalsRowFunction.totalrowfunctionCountNums:{break}case Asc.ETotalsRowFunction.totalrowfunctionCustom:{res=this.getTotalsRowFormula();break}case Asc.ETotalsRowFunction.totalrowfunctionMax:{res=generateFunction(104);break}case Asc.ETotalsRowFunction.totalrowfunctionMin:{res= generateFunction(105);break}case Asc.ETotalsRowFunction.totalrowfunctionNone:{break}case Asc.ETotalsRowFunction.totalrowfunctionStdDev:{res=generateFunction(107);break}case Asc.ETotalsRowFunction.totalrowfunctionSum:{res=generateFunction(109);break}case Asc.ETotalsRowFunction.totalrowfunctionVar:{res=generateFunction(110);break}}}return res};TableColumn.prototype.cleanTotalsData=function(){this.CalculatedColumnFormula=null;this.applyTotalRowFormula(null,null,false);this.TotalsRowFunction=null;this.TotalsRowLabel= null};TableColumn.prototype.getTotalsRowFormula=function(){return this.TotalsRowFormula?this.TotalsRowFormula.getFormula():null};TableColumn.prototype.getTotalsRowFunction=function(){return this.TotalsRowFunction};TableColumn.prototype.getTotalsRowLabel=function(){return this.TotalsRowLabel?this.TotalsRowLabel:null};TableColumn.prototype.setTotalsRowFormula=function(val,ws){this.cleanTotalsData();if("="===val[0])val=val.substring(1);this.applyTotalRowFormula(val,ws,true);this.TotalsRowFunction=Asc.ETotalsRowFunction.totalrowfunctionCustom}; TableColumn.prototype.setTotalsRowFunction=function(val){this.cleanTotalsData();this.TotalsRowFunction=val};TableColumn.prototype.setTotalsRowLabel=function(val){this.cleanTotalsData();this.TotalsRowLabel=val};TableColumn.prototype.checkTotalRowFormula=function(ws,tablePart){if(null!==this.TotalsRowFunction&&Asc.ETotalsRowFunction.totalrowfunctionCustom!==this.TotalsRowFunction){var totalRowFormula=this.getTotalRowFormula(tablePart,true);if(null!==totalRowFormula){this.applyTotalRowFormula(totalRowFormula, ws,true);this.TotalsRowFunction=Asc.ETotalsRowFunction.totalrowfunctionCustom}}};TableColumn.prototype.applyTotalRowFormula=function(val,opt_ws,opt_buildDep){this.removeDependencies();if(val){this.TotalsRowFormula=new AscCommonExcel.parserFormula(val,this,opt_ws);if(opt_buildDep)this.buildDependencies()}else this.TotalsRowFormula=null};TableColumn.prototype.getRange=function(tablePart,includeHeader,includeTotal){var res=null;var ref=tablePart.Ref;var startRow=includeHeader&&tablePart.isHeaderRow()|| !tablePart.isHeaderRow()?ref.r1:ref.r1+1;var endRow=includeTotal&&tablePart.isTotalsRow()||!tablePart.isTotalsRow()?ref.r2:ref.r2-1;var col=null;for(var i=0;i<tablePart.TableColumns.length;i++)if(this.Name===tablePart.TableColumns[i].Name){col=ref.c1+i;break}if(null!==col)res=new Asc.Range(col,startRow,col,endRow);return res};function TableStyleInfo(){this.Name=null;this.ShowColumnStripes=null;this.ShowRowStripes=null;this.ShowFirstColumn=null;this.ShowLastColumn=null}TableStyleInfo.prototype.clone= function(){var res=new TableStyleInfo;res.Name=this.Name;res.ShowColumnStripes=this.ShowColumnStripes;res.ShowRowStripes=this.ShowRowStripes;res.ShowFirstColumn=this.ShowFirstColumn;res.ShowLastColumn=this.ShowLastColumn;return res};TableStyleInfo.prototype.setName=function(val){this.Name=val};function FilterColumn(){this.ColId=null;this.Filters=null;this.CustomFiltersObj=null;this.DynamicFilter=null;this.ColorFilter=null;this.Top10=null;this.ShowButton=true}FilterColumn.prototype.Write_ToBinary2= function(writer){writer.WriteLong(this.ColId);if(null!==this.Filters){writer.WriteBool(true);this.Filters.Write_ToBinary2(writer)}else writer.WriteBool(false);if(null!==this.CustomFiltersObj){writer.WriteBool(true);this.CustomFiltersObj.Write_ToBinary2(writer)}else writer.WriteBool(false);if(null!==this.DynamicFilter){writer.WriteBool(true);this.DynamicFilter.Write_ToBinary2(writer)}else writer.WriteBool(false);if(null!==this.ColorFilter){writer.WriteBool(true);this.ColorFilter.Write_ToBinary2(writer)}else writer.WriteBool(false); if(null!==this.Top10){writer.WriteBool(true);this.Top10.Write_ToBinary2(writer)}else writer.WriteBool(false);writer.WriteBool(this.ShowButton)};FilterColumn.prototype.Read_FromBinary2=function(reader){this.ColId=reader.GetLong();var newObj;if(reader.GetBool()){newObj=new Filters;newObj.Read_FromBinary2(reader);this.Filters=newObj}if(reader.GetBool()){newObj=new CustomFilters;newObj.Read_FromBinary2(reader);this.CustomFiltersObj=newObj}if(reader.GetBool()){newObj=new DynamicFilter;newObj.Read_FromBinary2(reader); this.DynamicFilter=newObj}if(reader.GetBool()){newObj=new ColorFilter;newObj.Read_FromBinary2(reader);this.ColorFilter=newObj}if(reader.GetBool()){newObj=new Top10;newObj.Read_FromBinary2(reader);this.Top10=newObj}this.ShowButton=reader.GetBool()};FilterColumn.prototype.clone=function(){var res=new FilterColumn;res.ColId=this.ColId;if(this.Filters)res.Filters=this.Filters.clone();if(this.CustomFiltersObj)res.CustomFiltersObj=this.CustomFiltersObj.clone();if(this.DynamicFilter)res.DynamicFilter=this.DynamicFilter.clone(); if(this.ColorFilter)res.ColorFilter=this.ColorFilter.clone();if(this.Top10)res.Top10=this.Top10.clone();res.ShowButton=this.ShowButton;return res};FilterColumn.prototype.isHideValue=function(val,isDateTimeFormat,top10Length,cell,isLabelFilter){var res=false;if(this.Filters){this.Filters._initLowerCaseValues();res=this.Filters.isHideValue(val.toLowerCase(),isDateTimeFormat)}else if(this.CustomFiltersObj)res=this.CustomFiltersObj.isHideValue(val,isLabelFilter);else if(this.Top10)res=this.Top10.isHideValue(val, top10Length);else if(this.ColorFilter)res=this.ColorFilter.isHideValue(cell);else if(this.DynamicFilter)res=this.DynamicFilter.isHideValue(val);return res};FilterColumn.prototype.clean=function(){this.Filters=null;this.CustomFiltersObj=null;this.DynamicFilter=null;this.ColorFilter=null;this.Top10=null};FilterColumn.prototype.createFilter=function(obj){var allFilterOpenElements=false;var newFilter;switch(obj.filter.type){case c_oAscAutoFilterTypes.ColorFilter:{this.ColorFilter=obj.filter.filter.clone(); break}case c_oAscAutoFilterTypes.CustomFilters:{obj.filter.filter.check();this.CustomFiltersObj=obj.filter.filter.clone();break}case c_oAscAutoFilterTypes.DynamicFilter:{this.DynamicFilter=obj.filter.filter.clone();break}case c_oAscAutoFilterTypes.Top10:{this.Top10=obj.filter.filter.clone();break}case c_oAscAutoFilterTypes.Filters:{var addCustomFilter=false;for(var i=0;i<obj.values.length;i++)if(""===obj.values[i].text&&false===obj.values[i].visible)addCustomFilter=true;else if(""!==obj.values[i].text&& false===obj.values[i].visible){addCustomFilter=false;break}if(addCustomFilter){this.CustomFiltersObj=new CustomFilters;this.CustomFiltersObj._generateEmptyValueFilter()}else{newFilter=new Filters;allFilterOpenElements=newFilter.init(obj);if(!allFilterOpenElements)this.Filters=newFilter}break}}return allFilterOpenElements};FilterColumn.prototype.isApplyAutoFilter=function(){var res=false;if(this.Filters!==null||this.CustomFiltersObj!==null||this.DynamicFilter!==null||this.ColorFilter!==null||this.Top10!== null)res=true;return res};FilterColumn.prototype.init=function(range){if(null!==this.DynamicFilter)this.DynamicFilter.init(range);else if(null!==this.Top10)this.Top10.init(range)};FilterColumn.prototype.hasInitByArray=function(){return null!==this.Top10};FilterColumn.prototype.initByArray=function(arr,isSum){if(null!==this.Top10)this.Top10.initByArray(arr,isSum)};FilterColumn.prototype.isApplyCustomFilter=function(){var res=false;if(this.Top10||this.CustomFiltersObj||this.ColorFilter||this.DynamicFilter)res= true;return res};FilterColumn.prototype.isOnlyNotEqualEmpty=function(){var res=false;if(this.CustomFiltersObj){var customFilters=this.CustomFiltersObj.CustomFilters;var customFilter=customFilters&&1===customFilters.length?customFilters[0]:null;if(customFilter&&c_oAscCustomAutoFilter.doesNotEqual===customFilter.Operator&&" "===customFilter.Val)res=true}return res};FilterColumn.prototype.isAllClean=function(){if(this.Filters===null&&this.CustomFiltersObj===null&&this.DynamicFilter===null&&this.ColorFilter=== null&&this.Top10===null&&(this.ShowButton===true||this.ShowButton===null))return true;return false};FilterColumn.prototype.isColorFilter=function(){return this.ColorFilter!==null};FilterColumn.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["colId"];if(undefined!==val)this.ColId=val-0;val=vals["hiddenButton"];if(undefined!==val)this.ShowButton=!AscCommon.getBoolFromXml(val);val=vals["showButton"];if(undefined!==val)this.ShowButton=AscCommon.getBoolFromXml(val)}}; FilterColumn.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("colorFilter"===elem){newContext=new ColorFilter;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.ColorFilter=newContext}else if("customFilters"===elem){newContext=new CustomFilters;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.CustomFiltersObj=newContext}else if("dynamicFilter"===elem){newContext=new DynamicFilter;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.DynamicFilter=newContext}else if("filters"===elem){newContext=new Filters;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.Filters=newContext}else if("iconFilter"===elem)newContext=null;else if("top10"===elem){newContext=new Top10;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.Top10=newContext}else newContext=null;return newContext};FilterColumn.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.colId)writer.WriteXmlAttributeNumber("colId", this.ColId);if(true!==this.ShowButton)writer.WriteXmlAttributeBool("showButton",this.ShowButton);writer.WriteXmlNodeEnd(name,true);if(null!==this.ColorFilter)this.ColorFilter.toXml(writer,"colorFilter");if(null!==this.CustomFiltersObj)this.CustomFiltersObj.toXml(writer,"customFilters");if(null!==this.DynamicFilter)this.DynamicFilter.toXml(writer,"dynamicFilter");if(null!==this.Filters)this.Filters.toXml(writer,"filters");if(null!==this.Top10)this.Top10.toXml(writer,"top10");writer.WriteXmlNodeEnd(name)}; function CT_Filter(){this.Val=null}CT_Filter.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["val"];if(undefined!==val)this.Val=AscCommon.unleakString(uq(val))}};CT_Filter.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.Val)writer.WriteXmlAttributeStringEncode("val",this.Val);writer.WriteXmlNodeEnd(name,true,true)};function Filters(){this.Values={};this.Dates=[];this.Blank=null;this.lowerCaseValues=null}Filters.prototype.Write_ToBinary2= function(writer){var i,length;if(null!=this.Values){writer.WriteBool(true);length=0;for(i in this.Values)length++;writer.WriteLong(length);for(i in this.Values)writer.WriteLong(i)}else writer.WriteBool(false);if(null!=this.Dates){writer.WriteBool(true);writer.WriteLong(this.Dates.length);for(i=0,length=this.Dates.length;i<length;++i)this.Dates[i].Write_ToBinary2(writer)}else writer.WriteBool(false);if(null!=this.Blank){writer.WriteBool(true);writer.WriteBool(this.Blank)}else writer.WriteBool(false)}; Filters.prototype.Read_FromBinary2=function(reader){var i,length;if(reader.GetBool()){length=reader.GetLong();for(i=0;i<length;++i)this.Values[reader.GetLong()]=true}if(reader.GetBool()){length=reader.GetLong();for(i=0;i<length;++i){var _date=new AutoFilterDateElem;this.Dates.push(_date.Read_FromBinary2(reader))}}if(reader.GetBool())this.Blank=reader.GetBool()};Filters.prototype.clone=function(){var i,res=new Filters;for(i in this.Values)res.Values[i]=this.Values[i];if(this.Dates)for(i=0;i<this.Dates.length;++i)res.Dates.push(this.Dates[i].clone()); res.Blank=this.Blank;return res};Filters.prototype.init=function(obj){var allFilterOpenElements=true;for(var i=0;i<obj.values.length;i++)if(obj.values[i].visible)if(obj.values[i].isDateFormat)if(obj.values[i].text==="")this.Blank=true;else{var dateGroupItem=new DateGroupItem;var autoFilterDateElem=new AutoFilterDateElem(obj.values[i].val,obj.values[i].val,1);dateGroupItem.convertRangeToDateGroupItem(autoFilterDateElem);autoFilterDateElem.convertDateGroupItemToRange(dateGroupItem);this.Dates.push(autoFilterDateElem)}else if(obj.values[i].text=== "")this.Blank=true;else this.Values[obj.values[i].text]=true;else allFilterOpenElements=false;this.sortDate();this._initLowerCaseValues();return allFilterOpenElements};Filters.prototype.isHideValue=function(val,isDateTimeFormat){var res=false;val=window["Asc"].trim(val);if(isDateTimeFormat&&this.Dates)if(val==="")res=!this.Blank?true:false;else res=this.binarySearch(val,this.Dates)!==-1?false:true;else if(this.Values)if(val==="")res=!this.Blank?true:false;else res=!this.lowerCaseValues[val]?true: false;return res};Filters.prototype.binarySearch=function(val,array){var i=0,j=array.length-1,k;val=parseFloat(val);while(i<=j){k=Math.floor((i+j)/2);if(val>=array[k].start&&val<array[k].end)return k;else if(val<array[k].start)j=k-1;else i=k+1}return-1};Filters.prototype.linearSearch=function(val,array){var n=array.length,i=0;val=parseFloat(val);while(i<=n&&!(array[i]&&val>=array[i].start&&val<array[i].end))i++;if(i<n)return i;else return-1};Filters.prototype._initLowerCaseValues=function(){if(this.lowerCaseValues=== null){this.lowerCaseValues={};for(var i in this.Values)this.lowerCaseValues[i.toLowerCase()]=true}};Filters.prototype.sortDate=function(){if(this.Dates&&this.Dates.length)this.Dates.sort(function sortArr(a,b){return a.start-b.start})};Filters.prototype.clean=function(){this.Values={};this.Dates=[];this.Blank=null};Filters.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["blank"];if(undefined!==val)this.Blank=AscCommon.getBoolFromXml(val)}};Filters.prototype.onStartNode= function(elem,attr,uq){var newContext=this;if("filter"===elem){newContext=new CT_Filter;if(newContext.readAttributes)newContext.readAttributes(attr,uq);if(null!=newContext.Val)this.Values[newContext.Val]=1}else if("dateGroupItem"===elem){newContext=new DateGroupItem;if(newContext.readAttributes)newContext.readAttributes(attr,uq);var autoFilterDateElem=new AscCommonExcel.AutoFilterDateElem;autoFilterDateElem.convertDateGroupItemToRange(newContext);this.Dates.push(autoFilterDateElem)}else newContext= null;return newContext};Filters.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.Blank)writer.WriteXmlAttributeBool("blank",this.Blank);writer.WriteXmlNodeEnd(name,true);for(var val in this.Values){var filter=new CT_Filter;filter.Val=val;filter.toXml(writer,"filter")}for(var i=0;i<this.Dates.length;++i){var elem=this.Dates[i];var dateGroupItem=new AscCommonExcel.DateGroupItem;dateGroupItem.convertRangeToDateGroupItem(elem);dateGroupItem.toXml(writer,"dateGroupItem")}writer.WriteXmlNodeEnd(name)}; function Filter(){this.Val=null}function DateGroupItem(){this.DateTimeGrouping=null;this.Day=null;this.Hour=null;this.Minute=null;this.Month=null;this.Second=null;this.Year=null}DateGroupItem.prototype.clone=function(){var res=new DateGroupItem;res.DateTimeGrouping=this.DateTimeGrouping;res.Day=this.Day;res.Hour=this.Hour;res.Minute=this.Minute;res.Month=this.Month;res.Second=this.Second;res.Year=this.Year;return res};DateGroupItem.prototype.convertRangeToDateGroupItem=function(range){var startUtcDate= AscCommon.NumFormat.prototype.parseDate(range.start);var year=startUtcDate.year;var month=startUtcDate.month+1;var day=startUtcDate.d;var hour=startUtcDate.hour;var minute=startUtcDate.minute;var second=startUtcDate.second;this.DateTimeGrouping=range.dateTimeGrouping;switch(this.DateTimeGrouping){case 1:{this.Year=year;this.Month=month;this.Day=day;break}case 2:{this.Year=year;this.Month=month;this.Day=day;this.Hour=hour;break}case 3:{this.Year=year;this.Month=month;this.Day=day;this.Hour=hour;this.Minute= minute;break}case 4:{this.Year=year;this.Month=month;break}case 5:{this.Year=year;this.Month=month;this.Day=day;this.Hour=hour;this.Minute=minute;this.Second=second;break}case 6:{this.Year=year;break}}};DateGroupItem.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["year"];if(undefined!==val)this.Year=val-0;val=vals["month"];if(undefined!==val)this.Month=val-0;val=vals["day"];if(undefined!==val)this.Day=val-0;val=vals["hour"];if(undefined!==val)this.Hour=val- 0;val=vals["minute"];if(undefined!==val)this.Minute=val-0;val=vals["second"];if(undefined!==val)this.Second=val-0;val=vals["dateTimeGrouping"];if(undefined!==val){val=FromXml_ST_DateTimeGrouping(val);if(-1!==val)this.DateTimeGrouping=val}}};DateGroupItem.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.Year)writer.WriteXmlAttributeNumber("year",this.Year);if(null!==this.Month)writer.WriteXmlAttributeNumber("month",this.Month);if(null!==this.Day)writer.WriteXmlAttributeNumber("day", this.Day);if(null!==this.Hour)writer.WriteXmlAttributeNumber("hour",this.Hour);if(null!==this.Minute)writer.WriteXmlAttributeNumber("minute",this.Minute);if(null!==this.Second)writer.WriteXmlAttributeNumber("second",this.Second);if(null!==this.DateTimeGrouping)writer.WriteXmlAttributeStringEncode("dateTimeGrouping",ToXml_ST_DateTimeGrouping(this.DateTimeGrouping));writer.WriteXmlNodeEnd(name,true,true)};var g_oCustomFilters={And:0,CustomFilters:1};function CustomFilters(){this.Properties=g_oCustomFilters; this.And=false;this.CustomFilters=null}CustomFilters.prototype.getType=function(){return UndoRedoDataTypes.CustomFilters};CustomFilters.prototype.getProperties=function(){return this.Properties};CustomFilters.prototype.getProperty=function(nType){switch(nType){case this.Properties.And:return this.And;break;case this.Properties.CustomFilters:return this.CustomFilters;break}return null};CustomFilters.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.And:this.And=value;break; case this.Properties.CustomFilters:this.CustomFilters=value;break}};CustomFilters.prototype.Write_ToBinary2=function(writer){writer.WriteBool(this.And);writer.WriteLong(this.CustomFilters?this.CustomFilters.length:0);for(var i=0;i<this.CustomFilters.length;++i)this.CustomFilters[i].Write_ToBinary2(writer)};CustomFilters.prototype.Read_FromBinary2=function(reader){this.And=reader.GetBool();var length=reader.GetLong();for(var i=0;i<length;++i){var reply=new CustomFilter;reply.Read_FromBinary2(reader); if(!this.CustomFilters)this.CustomFilters=[];this.CustomFilters.push(reply)}};CustomFilters.prototype.clone=function(){var i,res=new CustomFilters;res.And=this.And;if(this.CustomFilters){res.CustomFilters=[];for(i=0;i<this.CustomFilters.length;++i)res.CustomFilters.push(this.CustomFilters[i].clone())}return res};CustomFilters.prototype.init=function(obj){this.And=!obj.isChecked;this.CustomFilters=[];if(obj.filter1!=undefined)this.CustomFilters[0]=new CustomFilter(obj.filter1,obj.valFilter1);if(obj.filter2!= undefined)this.CustomFilters[1]=new CustomFilter(obj.filter2,obj.valFilter2)};CustomFilters.prototype.isHideValue=function(val,isLabelFilter){var res=false;var filterRes1=this.CustomFilters[0]?this.CustomFilters[0].isHideValue(val,isLabelFilter):null;var filterRes2=this.CustomFilters[1]?this.CustomFilters[1].isHideValue(val,isLabelFilter):null;if(!this.And&&(filterRes1===null&&filterRes2===true||filterRes1===true&&filterRes2===null||filterRes1===true&&filterRes2===true))res=true;if(this.And&&(filterRes1=== true||filterRes2===true))res=true;return res};CustomFilters.prototype.asc_getAnd=function(){return this.And};CustomFilters.prototype.asc_getCustomFilters=function(){return this.CustomFilters};CustomFilters.prototype.asc_setAnd=function(val){this.And=val};CustomFilters.prototype.asc_setCustomFilters=function(val){this.CustomFilters=val};CustomFilters.prototype.check=function(){if(this.CustomFilters)for(var i=0;i<this.CustomFilters.length;i++)this.CustomFilters[i].check()};CustomFilters.prototype._generateEmptyValueFilter= function(){this.And=true;this.CustomFilters=[];var customFilter=new CustomFilter;customFilter._generateEmptyValueFilter();this.CustomFilters.push(customFilter)};CustomFilters.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["and"];if(undefined!==val)this.And=AscCommon.getBoolFromXml(val)}};CustomFilters.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("customFilter"===elem){if(!this.CustomFilters)this.CustomFilters=[];newContext=new CustomFilter; if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.CustomFilters.push(newContext)}else newContext=null;return newContext};CustomFilters.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(false!==this.And)writer.WriteXmlAttributeBool("and",this.And);writer.WriteXmlNodeEnd(name,true);if(this.CustomFilters)for(var i=0;i<this.CustomFilters.length;++i){var elem=this.CustomFilters[i];elem.toXml(writer,"customFilter")}writer.WriteXmlNodeEnd(name)};CustomFilters.prototype.changeForInterface= function(){var res=this.clone();if(res.CustomFilters)for(var i=0;i<res.CustomFilters.length;i++)res.CustomFilters[i].changeForInterface();return res};var g_oCustomFilter={Operator:0,Val:1};function CustomFilter(operator,val){this.Properties=g_oCustomFilter;this.Operator=operator!=undefined?operator:c_oAscCustomAutoFilter.equals;this.Val=val!=undefined?val:null}CustomFilter.prototype.getType=function(){return UndoRedoDataTypes.CustomFilter};CustomFilter.prototype.getProperties=function(){return this.Properties}; CustomFilter.prototype.getProperty=function(nType){switch(nType){case this.Properties.Operator:return this.Operator;break;case this.Properties.Val:return this.Val;break}return null};CustomFilter.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.Operator:this.Operator=value;break;case this.Properties.Val:this.Val=value;break}};CustomFilter.prototype.clone=function(){var res=new CustomFilter;res.Operator=this.Operator;res.Val=this.Val;return res};CustomFilter.prototype.init= function(operator,val){this.Operator=operator;this.Val=val};CustomFilter.prototype.isHideValue=function(val,isLabelFilter){var result=false;var isDigitValue=!isNaN(val);if(!isDigitValue)val=val.toLowerCase();var checkComplexSymbols=null,filterVal;if(checkComplexSymbols!=null)result=checkComplexSymbols;else{var isNumberFilter=this.Operator===c_oAscCustomAutoFilter.isGreaterThan||this.Operator===c_oAscCustomAutoFilter.isGreaterThanOrEqualTo||this.Operator===c_oAscCustomAutoFilter.isLessThan||this.Operator=== c_oAscCustomAutoFilter.isLessThanOrEqualTo;if(c_oAscCustomAutoFilter.equals===this.Operator||c_oAscCustomAutoFilter.doesNotEqual===this.Operator)filterVal=isNaN(this.Val)?this.Val.toLowerCase():this.Val;else if(isNumberFilter){filterVal=this.Val;if(isLabelFilter){filterVal=this.Val.replace(/'/g,"");if(isNaN(filterVal))filterVal=this.Val}if(isLabelFilter&&isNaN(filterVal)){filterVal=filterVal.toLowerCase();isDigitValue=false;val=val.toLowerCase()}else if(isNaN(filterVal)&&isNaN(val))filterVal=filterVal.toLowerCase(); else{filterVal=parseFloat(filterVal);val=parseFloat(val)}}else filterVal=isNaN(this.Val)?this.Val.toLowerCase():this.Val;var trimVal="string"===typeof val?window["Asc"].trim(val):val;var trimFilterVal="string"===typeof filterVal?window["Asc"].trim(filterVal):filterVal;var matchingValues=function(_val1,_val2,op){_val1=_val1+"";_val2=_val2+"";var matchingInfo=AscCommonExcel.matchingValue(new AscCommonExcel.cString(_val1));if(op)matchingInfo.op=op;return AscCommonExcel.matching(new AscCommonExcel.cString(_val2), matchingInfo)};switch(this.Operator){case c_oAscCustomAutoFilter.equals:{if(!isDigitValue)result=matchingValues(trimFilterVal,trimVal);else if(trimVal===trimFilterVal)result=true;break}case c_oAscCustomAutoFilter.doesNotEqual:{if(!isDigitValue)result=matchingValues(trimFilterVal,trimVal,"<>");else if(trimVal!==trimFilterVal)result=true;break}case c_oAscCustomAutoFilter.isGreaterThan:{if(!isDigitValue)result=matchingValues(trimFilterVal,trimVal,">");else if(val>filterVal)result=true;break}case c_oAscCustomAutoFilter.isGreaterThanOrEqualTo:{if(!isDigitValue)result= matchingValues(trimFilterVal,trimVal,">=");else if(val>=filterVal)result=true;break}case c_oAscCustomAutoFilter.isLessThan:{if(!isDigitValue)result=matchingValues(trimFilterVal,trimVal,"<");else if(val<filterVal)result=true;break}case c_oAscCustomAutoFilter.isLessThanOrEqualTo:{if(!isDigitValue)result=matchingValues(trimFilterVal,trimVal,"<=");else if(val<=filterVal)result=true;break}case c_oAscCustomAutoFilter.beginsWith:{if(!isDigitValue)result=matchingValues(trimFilterVal+"*",trimVal);break}case c_oAscCustomAutoFilter.doesNotBeginWith:{if(!isDigitValue)result= matchingValues(trimFilterVal+"*",trimVal,"<>");else result=true;break}case c_oAscCustomAutoFilter.endsWith:{if(!isDigitValue)result=matchingValues("*"+trimFilterVal,trimVal);break}case c_oAscCustomAutoFilter.doesNotEndWith:{if(!isDigitValue)result=matchingValues("*"+trimFilterVal,trimVal,"<>");else result=true;break}case c_oAscCustomAutoFilter.contains:{if(!isDigitValue)result=matchingValues("*"+trimFilterVal+"*",trimVal);break}case c_oAscCustomAutoFilter.doesNotContain:{if(!isDigitValue)result=matchingValues("*"+ trimFilterVal+"*",trimVal,"<>");else result=true;break}}}return!result};CustomFilter.prototype.asc_getOperator=function(){return this.Operator};CustomFilter.prototype.asc_getVal=function(){return this.Val};CustomFilter.prototype.asc_setOperator=function(val){this.Operator=val};CustomFilter.prototype.asc_setVal=function(val){this.Val=val};CustomFilter.prototype.check=function(){if(c_oAscCustomAutoFilter.doesNotEqual===this.Operator)if(""===this.Val.replace(/ /g,""))this.Val=" ";if(c_oAscCustomAutoFilter.beginsWith=== this.Operator){this.Operator=c_oAscCustomAutoFilter.equals;this.Val=this.Val+"*"}else if(c_oAscCustomAutoFilter.doesNotBeginWith===this.Operator){this.Operator=c_oAscCustomAutoFilter.doesNotEqual;this.Val=this.Val+"*"}else if(c_oAscCustomAutoFilter.endsWith===this.Operator){this.Operator=c_oAscCustomAutoFilter.equals;this.Val="*"+this.Val}else if(c_oAscCustomAutoFilter.doesNotEndWith===this.Operator){this.Operator=c_oAscCustomAutoFilter.doesNotEqual;this.Val="*"+this.Val}else if(c_oAscCustomAutoFilter.contains=== this.Operator){this.Operator=c_oAscCustomAutoFilter.equals;this.Val="*"+this.Val+"*"}else if(c_oAscCustomAutoFilter.doesNotContain===this.Operator){this.Operator=c_oAscCustomAutoFilter.doesNotEqual;this.Val="*"+this.Val+"*"}};CustomFilter.prototype._generateEmptyValueFilter=function(){this.Operator=c_oAscCustomAutoFilter.doesNotEqual;this.Val=" "};CustomFilter.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["operator"];if(undefined!==val){val=FromXml_ST_FilterOperator(val); if(-1!==val)this.Operator=val}val=vals["val"];if(undefined!==val)this.Val=AscCommon.unleakString(uq(val))}};CustomFilter.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.Operator)writer.WriteXmlAttributeStringEncode("operator",ToXml_ST_FilterOperator(this.Operator));if(null!==this.Val)writer.WriteXmlAttributeStringEncode("val",this.Val);writer.WriteXmlNodeEnd(name,true,true)};CustomFilter.prototype.Write_ToBinary2=function(writer){if(null!=this.Operator){writer.WriteBool(true); writer.WriteLong(this.Operator)}else writer.WriteBool(false);if(null!=this.Val){writer.WriteBool(true);writer.WriteString2(this.Val)}else writer.WriteBool(false)};CustomFilter.prototype.Read_FromBinary2=function(reader){if(reader.GetBool())this.Operator=reader.GetLong();if(reader.GetBool())this.Val=reader.GetString2()};CustomFilter.prototype.changeForInterface=function(){if(!this.Val||this.Val.length<=1)return;var isStartSpecSymbol=this.Val&&this.Val.length>1&&this.Val[0]==="*";var isEndSpecSymbol; if(!isStartSpecSymbol||isStartSpecSymbol&&this.Val.length>=2)isEndSpecSymbol=this.Val&&this.Val[this.Val.length-1]==="*";if(isStartSpecSymbol&&isEndSpecSymbol&&this.Val.length<=2)return;if(isStartSpecSymbol||isEndSpecSymbol){this.Val=this.Val.substring(isStartSpecSymbol?1:0,isEndSpecSymbol?this.Val.length-1:this.Val.length);if(c_oAscCustomAutoFilter.doesNotEqual===this.Operator)if(isStartSpecSymbol&&isEndSpecSymbol)this.Operator=c_oAscCustomAutoFilter.doesNotContain;else if(isStartSpecSymbol)this.Operator= c_oAscCustomAutoFilter.doesNotEndWith;else this.Operator=c_oAscCustomAutoFilter.doesNotBeginWith;else if(isStartSpecSymbol&&isEndSpecSymbol)this.Operator=c_oAscCustomAutoFilter.contains;else if(isStartSpecSymbol)this.Operator=c_oAscCustomAutoFilter.endsWith;else this.Operator=c_oAscCustomAutoFilter.beginsWith}};var g_oDynamicFilter={Type:0,Val:1,MaxVal:2};function DynamicFilter(){this.Properties=g_oDynamicFilter;this.Type=null;this.Val=null;this.MaxVal=null}DynamicFilter.prototype.getType=function(){return UndoRedoDataTypes.DynamicFilter}; DynamicFilter.prototype.getProperties=function(){return this.Properties};DynamicFilter.prototype.getProperty=function(nType){switch(nType){case this.Properties.Type:return this.Type;break;case this.Properties.Val:return this.Val;break;case this.Properties.MaxVal:return this.MaxVal;break}return null};DynamicFilter.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.Type:this.Type=value;break;case this.Properties.Val:this.Val=value;break;case this.Properties.MaxVal:this.MaxVal= value;break}};DynamicFilter.prototype.clone=function(){var res=new DynamicFilter;res.Type=this.Type;res.Val=this.Val;res.MaxVal=this.MaxVal;return res};DynamicFilter.prototype.init=function(range){var res=null;switch(this.Type){case Asc.c_oAscDynamicAutoFilter.aboveAverage:case Asc.c_oAscDynamicAutoFilter.belowAverage:{var summ=0;var counter=0;range._foreachNoEmpty(function(cell){var val=parseFloat(cell.getValueWithoutFormat());if(!isNaN(val)){summ+=parseFloat(val);counter++}});res=summ/counter;break}}this.Val= res};DynamicFilter.prototype.isHideValue=function(val){var res=false;switch(this.Type){case Asc.c_oAscDynamicAutoFilter.aboveAverage:{res=val>this.Val?false:true;break}case Asc.c_oAscDynamicAutoFilter.belowAverage:{res=val<this.Val?false:true;break}}return res};DynamicFilter.prototype.asc_getType=function(){return this.Type};DynamicFilter.prototype.asc_getVal=function(){return this.Val};DynamicFilter.prototype.asc_getMaxVal=function(){return this.MaxVal};DynamicFilter.prototype.asc_setType=function(val){this.Type= val};DynamicFilter.prototype.asc_setVal=function(val){this.Val=val};DynamicFilter.prototype.asc_setMaxVal=function(val){this.MaxVal=val};DynamicFilter.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["type"];if(undefined!==val){val=FromXml_ST_DynamicFilterType(val);if(-1!==val)this.Type=val}val=vals["val"];if(undefined!==val)this.Val=val-0;val=vals["maxVal"];if(undefined!==val)this.MaxVal=val-0}};DynamicFilter.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(null!==this.Type)writer.WriteXmlAttributeStringEncode("type",ToXml_ST_DynamicFilterType(this.Type));if(null!==this.Val)writer.WriteXmlAttributeNumber("val",this.Val);if(null!==this.MaxVal)writer.WriteXmlAttributeNumber("maxVal",this.MaxVal);writer.WriteXmlNodeEnd(name,true,true)};DynamicFilter.prototype.Write_ToBinary2=function(writer){if(null!==this.Type){writer.WriteBool(true);writer.WriteLong(this.Type)}else writer.WriteBool(false);if(null!==this.Val){writer.WriteBool(true);writer.WriteLong(this.Val)}else writer.WriteBool(false); if(null!==this.MaxVal){writer.WriteBool(true);writer.WriteLong(this.MaxVal)}else writer.WriteBool(false)};DynamicFilter.prototype.Read_FromBinary2=function(reader){if(reader.GetBool())this.Type=reader.GetLong();if(reader.GetBool())this.Val=reader.GetLong();if(reader.GetBool())this.MaxVal=reader.GetLong()};var g_oColorFilter={CellColor:0,dxf:1};function ColorFilter(){this.Properties=g_oColorFilter;this.CellColor=null;this.dxf=null}ColorFilter.prototype.getType=function(){return UndoRedoDataTypes.ColorFilter}; ColorFilter.prototype.getProperties=function(){return this.Properties};ColorFilter.prototype.getProperty=function(nType){switch(nType){case this.Properties.CellColor:return this.CellColor;break;case this.Properties.dxf:return this.dxf;break}return null};ColorFilter.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.CellColor:this.CellColor=value;break;case this.Properties.dxf:this.dxf=value;break}};ColorFilter.prototype.clone=function(){var res=new ColorFilter;res.CellColor= this.CellColor;if(this.dxf)res.dxf=this.dxf.clone();return res};ColorFilter.prototype.isHideValue=function(cell){var res=true;var t=this;var isEqualColors=function(filterColor,cellColor){var res=false;if(filterColor===cellColor)res=true;else if(!filterColor&&(!cellColor||null===cellColor.rgb||0===cellColor.rgb))res=true;else if(!cellColor&&(!filterColor||null===filterColor.rgb||0===filterColor.rgb))res=true;else if(cellColor&&filterColor&&cellColor.rgb===filterColor.rgb)res=true;return res};if(this.dxf&& this.dxf.fill&&cell){var filterColor=this.dxf.fill.bg();cell.getLeftTopCellNoEmpty(function(cell){var fontColor;var xfs=cell?cell.getCompiledStyleCustom(false,true,true):null;if(false===t.CellColor){var multiText;if(cell&&(multiText=cell.getValueMultiText())!==null)for(var j=0;j<multiText.length;j++){fontColor=multiText[j].format?multiText[j].format.getColor():null;if(null===fontColor)fontColor=xfs&&xfs.font?xfs.font.getColor():null;if(isEqualColors(filterColor,fontColor)){res=false;break}}else{fontColor= xfs&&xfs.font?xfs.font.getColor():null;if(isEqualColors(filterColor,fontColor))res=false}}else{var cellColor=xfs!==null&&xfs.fill&&xfs.fill.bg?xfs.fill.bg():null;if(isEqualColors(filterColor,cellColor))res=false}})}return res};ColorFilter.prototype.asc_getCellColor=function(){return this.CellColor};ColorFilter.prototype.asc_getDxf=function(){return this.dxf};ColorFilter.prototype.asc_setCellColor=function(val){this.CellColor=val};ColorFilter.prototype.asc_setDxf=function(val){this.dxf=val};ColorFilter.prototype.asc_getCColor= function(){var res=null;if(this.dxf&&this.dxf.fill&&null!==this.dxf.fill.bg()&&null!==this.dxf.fill.bg().rgb){var color=this.dxf.fill.bg();var res=new Asc.asc_CColor;res.asc_putR(color.getR());res.asc_putG(color.getG());res.asc_putB(color.getB());res.asc_putA(color.getA())}return res};ColorFilter.prototype.asc_setCColor=function(asc_CColor){if(!this.dxf)this.dxf=new CellXfs;if(!this.dxf.fill)this.dxf.fill=new Fill;if(null===asc_CColor)this.dxf.fill.fromColor(null);else this.dxf.fill.fromColor(new RgbColor((asc_CColor.asc_getR()<< 16)+(asc_CColor.asc_getG()<<8)+asc_CColor.asc_getB()))};ColorFilter.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["cellColor"];if(undefined!==val)this.CellColor=AscCommon.getBoolFromXml(val)}};ColorFilter.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.CellColor)writer.WriteXmlAttributeBool("cellColor",this.CellColor);writer.WriteXmlNodeEnd(name,true,true)};ColorFilter.prototype.Write_ToBinary2=function(writer){if(null!== this.CellColor){writer.WriteBool(true);writer.WriteBool(this.CellColor)}else writer.WriteBool(false);if(null!=this.dxf){var dxf=this.dxf;writer.WriteBool(true);var oBinaryStylesTableWriter=new AscCommonExcel.BinaryStylesTableWriter(writer);oBinaryStylesTableWriter.bs.WriteItem(0,function(){oBinaryStylesTableWriter.WriteDxf(dxf)})}else writer.WriteBool(false)};ColorFilter.prototype.Read_FromBinary2=function(reader){if(reader.GetBool())this.CellColor=reader.GetBool();if(reader.GetBool()){var api_sheet= Asc["editor"];var wb=api_sheet.wbModel;var bsr=new AscCommonExcel.Binary_StylesTableReader(reader,wb);var bcr=new AscCommon.Binary_CommonReader(reader);var oDxf=new AscCommonExcel.CellXfs;reader.GetUChar();var length=reader.GetULongLE();bcr.Read1(length,function(t,l){return bsr.ReadDxf(t,l,oDxf)});this.dxf=oDxf}};var g_oTop10={FilterVal:0,Percent:1,Top:2,Val:3};function Top10(){this.Properties=g_oTop10;this.FilterVal=null;this.Percent=false;this.Top=true;this.Val=null}Top10.prototype.getType=function(){return UndoRedoDataTypes.Top10}; Top10.prototype.getProperties=function(){return this.Properties};Top10.prototype.getProperty=function(nType){switch(nType){case this.Properties.FilterVal:return this.FilterVal;break;case this.Properties.Percent:return this.Percent;break;case this.Properties.Top:return this.Top;break;case this.Properties.Val:return this.Val;break}return null};Top10.prototype.setProperty=function(nType,value){switch(nType){case this.Properties.FilterVal:this.FilterVal=value;break;case this.Properties.Percent:this.Percent= value;break;case this.Properties.Top:this.Top=value;break;case this.Properties.Val:this.Val=value;break}};Top10.prototype.clone=function(){var res=new Top10;res.FilterVal=this.FilterVal;res.Percent=this.Percent;res.Top=this.Top;res.Val=this.Val;return res};Top10.prototype.isHideValue=function(val){var res=false;if(null!==this.FilterVal)if(this.Top){if(val<this.FilterVal)res=true}else if(val>this.FilterVal)res=true;return res};Top10.prototype.init=function(range,reWrite){var t=this;if(null===this.FilterVal|| true===reWrite)if(range){var arr=[];var alreadyAddValues={};var count=0;range._setPropertyNoEmpty(null,null,function(cell){var val=parseFloat(cell.getValueWithoutFormat());if(!isNaN(val)&&!alreadyAddValues[val]){arr.push(val);alreadyAddValues[val]=1;count++}});this.initByArray(arr)}};Top10.prototype.initByArray=function(arr,isSum){var res=null;var t=this;if(arr&&arr.length){arr.sort(function(a,b){var res;if(t.Top)res=b-a;else res=a-b;return res});if(this.Percent){var num=parseInt(arr.length*(this.Val/ 100));if(0===num)num=1;res=arr[num-1]}else if(isSum){var index=0;var sum=res=arr[index++];while(index<arr.length&&sum<this.Val){res=arr[index++];sum+=res}}else res=arr[this.Val-1]}if(null!=res)this.FilterVal=res};Top10.prototype.asc_getFilterVal=function(){return this.FilterVal};Top10.prototype.asc_getPercent=function(){return this.Percent};Top10.prototype.asc_getTop=function(){return this.Top};Top10.prototype.asc_getVal=function(){return this.Val};Top10.prototype.asc_setFilterVal=function(val){this.FilterVal= val};Top10.prototype.asc_setPercent=function(val){this.Percent=val};Top10.prototype.asc_setTop=function(val){this.Top=val};Top10.prototype.asc_setVal=function(val){this.Val=val};Top10.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["top"];if(undefined!==val)this.Top=AscCommon.getBoolFromXml(val);val=vals["percent"];if(undefined!==val)this.Percent=AscCommon.getBoolFromXml(val);val=vals["val"];if(undefined!==val)this.Val=val-0;val=vals["filterVal"];if(undefined!== val)this.FilterVal=val-0}};Top10.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(true!==this.Top)writer.WriteXmlAttributeBool("top",this.Top);if(false!==this.Percent)writer.WriteXmlAttributeBool("percent",this.Percent);if(null!==this.Val)writer.WriteXmlAttributeNumber("val",this.Val);if(null!==this.FilterVal)writer.WriteXmlAttributeNumber("filterVal",this.FilterVal);writer.WriteXmlNodeEnd(name,true,true)};Top10.prototype.Write_ToBinary2=function(w){if(null!==this.FilterVal){w.WriteBool(true); w.WriteLong(this.FilterVal)}else w.WriteBool(false);if(null!==this.Percent){w.WriteBool(true);w.WriteLong(this.Percent)}else w.WriteBool(false);w.WriteBool(this.Top);if(null!=this.Val){w.WriteBool(true);w.WriteLong(this.Val)}else w.WriteBool(false)};Top10.prototype.Read_FromBinary2=function(reader){if(reader.GetBool())this.FilterVal=reader.GetLong();if(reader.GetBool())this.Percent=reader.GetLong();this.Top=reader.GetBool();if(reader.GetBool())this.Val=reader.GetLong()};function SortCondition(){this.Ref= null;this.ConditionSortBy=null;this.ConditionDescending=null;this.dxf=null;this._hasHeaders=null}SortCondition.prototype.clone=function(){var res=new SortCondition;res.Ref=this.Ref?this.Ref.clone():null;res.ConditionSortBy=this.ConditionSortBy;res.ConditionDescending=this.ConditionDescending;if(this.dxf)res.dxf=this.dxf.clone();return res};SortCondition.prototype.Read_FromBinary2=function(r){if(r.GetBool()){var r1=r.GetLong();var c1=r.GetLong();var r2=r.GetLong();var c2=r.GetLong();this.Ref=new Asc.Range(c1, r1,c2,r2)}if(r.GetBool())this.ConditionSortBy=r.GetLong();if(r.GetBool())this.ConditionDescending=r.GetBool();if(r.GetBool()){var api_sheet=Asc["editor"];var wb=api_sheet.wbModel;var bsr=new AscCommonExcel.Binary_StylesTableReader(r,wb);var bcr=new AscCommon.Binary_CommonReader(r);var oDxf=new AscCommonExcel.CellXfs;r.GetUChar();var length=r.GetULongLE();bcr.Read1(length,function(t,l){return bsr.ReadDxf(t,l,oDxf)});this.dxf=oDxf}};SortCondition.prototype.Write_ToBinary2=function(w){if(null!=this.Ref){w.WriteBool(true); w.WriteLong(this.Ref.r1);w.WriteLong(this.Ref.c1);w.WriteLong(this.Ref.r2);w.WriteLong(this.Ref.c2)}else w.WriteBool(false);if(null!=this.ConditionSortBy){w.WriteBool(true);w.WriteLong(this.ConditionSortBy)}else w.WriteBool(false);if(null!=this.ConditionDescending){w.WriteBool(true);w.WriteBool(this.ConditionDescending)}else w.WriteBool(false);if(null!=this.dxf){var dxf=this.dxf;w.WriteBool(true);var oBinaryStylesTableWriter=new AscCommonExcel.BinaryStylesTableWriter(w);oBinaryStylesTableWriter.bs.WriteItem(0, function(){oBinaryStylesTableWriter.WriteDxf(dxf)})}else w.WriteBool(false)};SortCondition.prototype.moveRef=function(col,row){var ref=this.Ref.clone();ref.setOffset(new AscCommon.CellBase(row||0,col||0));this.Ref=ref};SortCondition.prototype.changeColumns=function(activeRange,isDelete){var bIsDeleteCurSortCondition=false;var ref=this.Ref.clone();var offsetCol=null;if(isDelete)if(activeRange.c1<=ref.c1&&activeRange.c2>=ref.c1)bIsDeleteCurSortCondition=true;else{if(activeRange.c1<ref.c1)offsetCol= -(activeRange.c2-activeRange.c1+1)}else if(activeRange.c1<=ref.c1)offsetCol=activeRange.c2-activeRange.c1+1;if(null!==offsetCol){ref.setOffset(new AscCommon.CellBase(0,offsetCol));this.Ref=ref}return bIsDeleteCurSortCondition};SortCondition.prototype.setOffset=function(offset){var ref=this.Ref.clone();ref.setOffset(offset);this.Ref=ref};SortCondition.prototype.getSortType=function(){var res=null;if(true===this.ConditionDescending)res=Asc.c_oAscSortOptions.Ascending;else if(false===this.ConditionDescending)res= Asc.c_oAscSortOptions.Descending;else if(Asc.ESortBy.sortbyCellColor===this.ConditionSortBy)res=Asc.c_oAscSortOptions.ByColorFill;else if(Asc.ESortBy.sortbyCellColor===this.sortbyFontColor)res=Asc.c_oAscSortOptions.ByColorFont;return res};SortCondition.prototype.getSortColor=function(){var res=null;if(this.dxf)if(this.dxf.fill&&this.dxf.fill.notEmpty())res=this.dxf.fill.bg();else if(this.dxf.font&&this.dxf.font.c)res=this.dxf.font.c;return res};SortCondition.prototype.applySort=function(type,ref, color){this.Ref=ref;if(type===Asc.c_oAscSortOptions.ByColorFill||type===Asc.c_oAscSortOptions.ByColorFont){var newDxf;if(type===Asc.c_oAscSortOptions.ByColorFill){newDxf=new AscCommonExcel.CellXfs;newDxf.fill=new AscCommonExcel.Fill;newDxf.fill.fromColor(color);this.ConditionSortBy=Asc.ESortBy.sortbyCellColor}else{newDxf.font=new AscCommonExcel.Font;newDxf.font.setColor(color);this.ConditionSortBy=Asc.ESortBy.sortbyFontColor}this.dxf=AscCommonExcel.g_StyleCache.addXf(newDxf)}else if(type===Asc.c_oAscSortOptions.Ascending|| type===Asc.c_oAscSortOptions.Descending)this.ConditionDescending=type!==Asc.c_oAscSortOptions.Ascending};SortCondition.prototype.shift=function(range,offset,bColumnSort){var from=this.Ref;var to=null;var bAdd=offset.row>0||offset.col>0;var bHor=0!=offset.col;var nTemp1,nTemp2;var diff=bHor?range.c1+offset.col-1:range.r1+offset.row;if(bHor&&bColumnSort){if(from.c1<range.c1&&range.r1<=from.r1&&from.r2<=range.r2)if(bAdd){to=from.clone();to.setOffsetLast(new AscCommon.CellBase(0,range.c2-range.c1+1))}else{to= from.clone();nTemp1=from.c2-range.c1+1;nTemp2=range.c2-range.c1+1;to.setOffsetLast(new AscCommon.CellBase(0,-Math.min(nTemp1,nTemp2)))}}else if(!bColumnSort)if(from.r1<range.r1&&range.c1<=from.c1&&from.c2<=range.c2)if(bAdd){to=from.clone();to.setOffsetLast(new AscCommon.CellBase(range.r2-range.r1+1,0))}else{to=from.clone();nTemp1=from.r2-range.r1+1;nTemp2=range.r2-range.r1+1;to.setOffsetLast(new AscCommon.CellBase(-Math.min(nTemp1,nTemp2),0))}if(null!=to)this.Ref=to};function AutoFilterDateElem(start, end,dateTimeGrouping){this.start=start;this.end=end;this.dateTimeGrouping=dateTimeGrouping}AutoFilterDateElem.prototype.Write_ToBinary2=function(w){w.WriteLong(this.start);w.WriteLong(this.end);w.WriteLong(this.dateTimeGrouping)};AutoFilterDateElem.prototype.Read_FromBinary2=function(r){this.start=r.GetLong();this.end=r.GetLong();this.dateTimeGrouping=r.GetLong()};AutoFilterDateElem.prototype.clone=function(){var res=new AutoFilterDateElem;res.start=this.start;this.end=this.end;this.dateTimeGrouping= this.dateTimeGrouping;return res};AutoFilterDateElem.prototype.convertDateGroupItemToRange=function(oDateGroupItem){var startDate,endDate,date;switch(oDateGroupItem.DateTimeGrouping){case 1:{date=new Asc.cDate(Date.UTC(oDateGroupItem.Year,oDateGroupItem.Month-1,oDateGroupItem.Day));startDate=date.getExcelDateWithTime();date.addDays(1);endDate=date.getExcelDateWithTime();break}case 2:{startDate=(new Asc.cDate(Date.UTC(oDateGroupItem.Year,oDateGroupItem.Month-1,oDateGroupItem.Day,oDateGroupItem.Hour, 1))).getExcelDateWithTime();endDate=(new Asc.cDate(Date.UTC(oDateGroupItem.Year,oDateGroupItem.Month-1,oDateGroupItem.Day,oDateGroupItem.Hour,59))).getExcelDateWithTime();break}case 3:{startDate=(new Asc.cDate(Date.UTC(oDateGroupItem.Year,oDateGroupItem.Month-1,oDateGroupItem.Day,oDateGroupItem.Hour,oDateGroupItem.Minute,1))).getExcelDateWithTime();endDate=(new Asc.cDate(Date.UTC(oDateGroupItem.Year,oDateGroupItem.Month-1,oDateGroupItem.Day,oDateGroupItem.Hour,oDateGroupItem.Minute,59))).getExcelDateWithTime(); break}case 4:{date=new Asc.cDate(Date.UTC(oDateGroupItem.Year,oDateGroupItem.Month-1,1));startDate=date.getExcelDateWithTime();date.addMonths(1);endDate=date.getExcelDateWithTime();break}case 5:{startDate=(new Asc.cDate(Date.UTC(oDateGroupItem.Year,oDateGroupItem.Month-1,oDateGroupItem.Day,oDateGroupItem.Hour,oDateGroupItem.Second))).getExcelDateWithTime();endDate=(new Asc.cDate(Date.UTC(oDateGroupItem.Year,oDateGroupItem.Month-1,oDateGroupItem.Day,oDateGroupItem.Hour,oDateGroupItem.Second))).getExcelDateWithTime(); break}case 6:{date=new Asc.cDate(Date.UTC(oDateGroupItem.Year,0));startDate=date.getExcelDateWithTime();date.addYears(1);endDate=date.getExcelDateWithTime();break}}this.start=startDate;this.end=endDate;this.dateTimeGrouping=oDateGroupItem.DateTimeGrouping};if(typeof Map==="undefined")(function(){var Map=function(){this.storage={}};Map.prototype={set:function(key,value){this.storage[key]=value},get:function(key){return this.storage[key]},delete:function(key){delete this.storage[key]},has:function(key){return!!this.storage[key]}}; window.Map=Map})();function CSharedStrings(){this.all=[];this.text=new Map;this.multiText=[];this.multiTextIndex=[]}CSharedStrings.prototype.addText=function(text){var index=this.text.get(text);if(undefined===index){this.all.push(text);index=this.all.length;this.text.set(text,index);if(AscFonts.IsCheckSymbols)AscFonts.FontPickerByCharacter.getFontsByString(text)}return index};CSharedStrings.prototype.addMultiText=function(multiText){var index,i;for(i=0;i<this.multiText.length;++i)if(AscCommonExcel.isEqualMultiText(multiText, this.multiText[i])){index=this.multiTextIndex[i];break}if(undefined===index){this.all.push(multiText);index=this.all.length;this.multiText.push(multiText);this.multiTextIndex.push(index);if(AscFonts.IsCheckSymbols)for(i=0;i<multiText.length;++i)AscFonts.FontPickerByCharacter.getFontsByString(multiText[i].text)}return index};CSharedStrings.prototype.get=function(index){return 1<=index&&index<=this.all.length?this.all[index-1]:null};CSharedStrings.prototype.getCount=function(){return this.all.length}; CSharedStrings.prototype.generateFontMap=function(oFontMap){for(var i=0;i<this.multiText.length;++i){var multiText=this.multiText[i];for(var j=0;j<multiText.length;++j){var part=multiText[j];if(null!=part.format)oFontMap[part.format.getName()]=1}}};function CWorkbookFormulas(){this.all=[]}CWorkbookFormulas.prototype.add=function(formula){var index=formula.getIndexNumber();if(undefined===index){this.all.push(formula);index=this.all.length;formula.setIndexNumber(index)}return formula};CWorkbookFormulas.prototype.get= function(index){return 1<=index&&index<=this.all.length?this.all[index-1]:null};CWorkbookFormulas.prototype.getCount=function(){return this.all.length};function asc_CPageMargins(ws){this.left=null;this.right=null;this.top=null;this.bottom=null;this.header=null;this.footer=null;this.ws=ws;return this}asc_CPageMargins.prototype.init=function(){if(null==this.left)this.left=c_oAscPrintDefaultSettings.PageLeftField;if(null==this.top)this.top=c_oAscPrintDefaultSettings.PageTopField;if(null==this.right)this.right= c_oAscPrintDefaultSettings.PageRightField;if(null==this.bottom)this.bottom=c_oAscPrintDefaultSettings.PageBottomField;if(null==this.header)this.header=c_oAscPrintDefaultSettings.PageHeaderField;if(null==this.footer)this.footer=c_oAscPrintDefaultSettings.PageFooterField};asc_CPageMargins.prototype.clone=function(ws){var res=new asc_CPageMargins(ws);res.left=this.left;res.right=this.right;res.top=this.top;res.bottom=this.bottom;res.header=this.header;res.footer=this.footer;return res};asc_CPageMargins.prototype.asc_getLeft= function(){return this.left};asc_CPageMargins.prototype.asc_getRight=function(){return this.right};asc_CPageMargins.prototype.asc_getTop=function(){return this.top};asc_CPageMargins.prototype.asc_getBottom=function(){return this.bottom};asc_CPageMargins.prototype.asc_getHeader=function(){return this.header};asc_CPageMargins.prototype.asc_getFooter=function(){return this.footer};asc_CPageMargins.prototype.asc_setLeft=function(newVal){var oldVal=this.left;this.left=newVal;if(this.ws&&History.Is_On()&& oldVal!==this.left)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Left,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageMargins.prototype.asc_setRight=function(newVal){var oldVal=this.right;this.right=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.right)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Right,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageMargins.prototype.asc_setTop=function(newVal){var oldVal= this.top;this.top=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.top)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Top,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageMargins.prototype.asc_setBottom=function(newVal){var oldVal=this.bottom;this.bottom=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.bottom)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Bottom,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageMargins.prototype.asc_setHeader= function(newVal){var oldVal=this.header;this.header=newVal};asc_CPageMargins.prototype.asc_setFooter=function(newVal){var oldVal=this.footer;this.footer=newVal};asc_CPageMargins.prototype.asc_setOptions=function(obj){var prop;prop=obj.asc_getLeft();if(prop!==this.asc_getLeft())this.asc_setLeft(prop);prop=obj.asc_getRight();if(prop!==this.asc_getRight())this.asc_setRight(prop);prop=obj.asc_getBottom();if(prop!==this.asc_getBottom())this.asc_setBottom(prop);prop=obj.asc_getTop();if(prop!==this.asc_getTop())this.asc_setTop(prop)}; function asc_CPageSetup(ws){this.orientation=c_oAscPrintDefaultSettings.PageOrientation;this.width=c_oAscPrintDefaultSettings.PageWidth;this.height=c_oAscPrintDefaultSettings.PageHeight;this.fitToWidth=1;this.fitToHeight=1;this.blackAndWhite=false;this.cellComments=0;this.copies=1;this.draft=false;this.errors=0;this.firstPageNumber=-1;this.pageOrder=0;this.scale=100;this.useFirstPageNumber=false;this.usePrinterDefaults=true;this.horizontalDpi=600;this.verticalDpi=600;this.paperUnits=0;this.ws=ws; return this}asc_CPageSetup.prototype.clone=function(ws){var res=new asc_CPageSetup(ws);res.orientation=this.orientation;res.width=this.width;res.height=this.height;res.fitToWidth=this.fitToWidth;res.fitToHeight=this.fitToHeight;res.blackAndWhite=this.blackAndWhite;res.cellComments=this.cellComments;res.copies=this.copies;res.draft=this.draft;res.errors=this.errors;res.firstPageNumber=this.firstPageNumber;res.pageOrder=this.pageOrder;res.scale=this.scale;res.useFirstPageNumber=this.useFirstPageNumber; res.usePrinterDefaults=this.usePrinterDefaults;res.horizontalDpi=this.horizontalDpi;res.verticalDpi=this.verticalDpi;res.paperUnits=this.paperUnits;return res};asc_CPageSetup.prototype.asc_getOrientation=function(){return this.orientation};asc_CPageSetup.prototype.asc_getWidth=function(){return this.width};asc_CPageSetup.prototype.asc_getHeight=function(){return this.height};asc_CPageSetup.prototype.asc_setOrientation=function(newVal){var oldVal=this.orientation;this.orientation=newVal;if(this.ws&& History.Is_On()&&oldVal!==this.orientation)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Orientation,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageSetup.prototype.asc_setWidth=function(newVal){var oldVal=this.width;this.width=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.width)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Width,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageSetup.prototype.asc_setHeight= function(newVal){var oldVal=this.height;this.height=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.height)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Height,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageSetup.prototype.asc_getFitToWidth=function(){if(!this.ws)return this.fitToWidth;var fitToPage=this.ws&&this.ws.sheetPr&&this.ws.sheetPr.FitToPage;return fitToPage?this.fitToWidth:0};asc_CPageSetup.prototype.asc_getFitToHeight=function(){if(!this.ws)return this.fitToHeight; var fitToPage=this.ws&&this.ws.sheetPr&&this.ws.sheetPr.FitToPage;return fitToPage?this.fitToHeight:0};asc_CPageSetup.prototype.asc_getScale=function(){return this.scale};asc_CPageSetup.prototype.asc_setFitToWidth=function(newVal){if(newVal===true)newVal=1;else if(newVal===false)newVal=0;var oldVal=this.fitToWidth;this.fitToWidth=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.fitToWidth)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_FitToWidth,this.ws.getId(),null,new UndoRedoData_Layout(oldVal, newVal))};asc_CPageSetup.prototype.asc_setFitToHeight=function(newVal){if(newVal===true)newVal=1;else if(newVal===false)newVal=0;var oldVal=this.fitToHeight;this.fitToHeight=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.fitToHeight)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_FitToHeight,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageSetup.prototype.asc_setOptions=function(obj){var prop;prop=obj.asc_getOrientation();if(prop!==this.asc_getOrientation())this.asc_setOrientation(prop); prop=obj.asc_getWidth();if(prop!==this.asc_getWidth())this.asc_setWidth(prop);prop=obj.asc_getHeight();if(prop!==this.asc_getHeight())this.asc_setHeight(prop);prop=obj.asc_getHeight();if(prop!==this.asc_getHeight())this.asc_setHeight(prop);prop=obj.asc_getFitToWidth();if(prop!==this.asc_getFitToWidth())this.asc_setFitToWidth(prop);prop=obj.asc_getFitToHeight();if(prop!==this.asc_getFitToHeight())this.asc_setFitToHeight(prop)};asc_CPageSetup.prototype.asc_setScale=function(newVal){var oldVal=this.scale; this.scale=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.scale)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Scale,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};function asc_CPageOptions(ws){this.pageMargins=new asc_CPageMargins(ws);this.pageSetup=new asc_CPageSetup(ws);this.gridLines=null;this.headings=null;this.ws=ws;this.printTitlesWidth=null;this.printTitlesHeight=null;return this}asc_CPageOptions.prototype.init=function(){this.pageMargins.init();if(null== this.gridLines)this.gridLines=c_oAscPrintDefaultSettings.PageGridLines;if(null==this.headings)this.headings=c_oAscPrintDefaultSettings.PageHeadings};asc_CPageOptions.prototype.initPrintTitles=function(){this.printTitlesWidth=null;this.printTitlesHeight=null;var printTitles=this.ws.workbook.getDefinesNames("Print_Titles",this.ws.getId());var c1,c2,r1,r2;var t=this;if(printTitles){var printTitleRefs;AscCommonExcel.executeInR1C1Mode(false,function(){printTitleRefs=AscCommonExcel.getRangeByRef(printTitles.ref, t.ws,true,true)});if(printTitleRefs&&printTitleRefs.length)for(var i=0;i<printTitleRefs.length;i++){var bbox=printTitleRefs[i].bbox;if(bbox)if(Asc.c_oAscSelectionType.RangeCol===bbox.getType()){c1=bbox.c1;c2=bbox.c2}else if(Asc.c_oAscSelectionType.RangeRow===bbox.getType()){r1=bbox.r1;r2=bbox.r2}}}if(c1!==undefined)this.printTitlesWidth=(new Asc.Range(c1,0,c2,gc_nMaxRow0)).getAbsName();if(r1!==undefined)this.printTitlesHeight=(new Asc.Range(0,r1,gc_nMaxCol0,r2)).getAbsName()};asc_CPageOptions.prototype.clone= function(ws){var res=new asc_CPageOptions(ws);res.pageMargins=this.pageMargins.clone(ws);res.pageSetup=this.pageSetup.clone(ws);res.gridLines=this.gridLines;res.headings=this.headings;return res};asc_CPageOptions.prototype.asc_getPageMargins=function(){return this.pageMargins};asc_CPageOptions.prototype.asc_getPageSetup=function(){return this.pageSetup};asc_CPageOptions.prototype.asc_getGridLines=function(){return this.gridLines};asc_CPageOptions.prototype.asc_getHeadings=function(){return this.headings}; asc_CPageOptions.prototype.asc_setPageMargins=function(val){this.pageMargins=val};asc_CPageOptions.prototype.asc_setPageSetup=function(val){this.pageSetup=val};asc_CPageOptions.prototype.asc_setGridLines=function(newVal){var oldVal=this.gridLines;this.gridLines=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.gridLines)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_GridLines,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageOptions.prototype.asc_setHeadings= function(newVal){var oldVal=this.headings;this.headings=newVal;if(this.ws&&History.Is_On()&&oldVal!==this.headings)History.Add(AscCommonExcel.g_oUndoRedoLayout,AscCH.historyitem_Layout_Headings,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))};asc_CPageOptions.prototype.asc_setOptions=function(obj){var gridLines=obj.asc_getGridLines();if(gridLines!==this.asc_getGridLines())this.asc_setGridLines(gridLines);var heading=obj.asc_getHeadings();if(heading!==this.asc_getHeadings())this.asc_setHeadings(heading); this.asc_getPageMargins().asc_setOptions(obj.asc_getPageMargins());this.asc_getPageSetup().asc_setOptions(obj.asc_getPageSetup())};asc_CPageOptions.prototype.asc_setPrintTitlesWidth=function(newVal){this.printTitlesWidth=newVal};asc_CPageOptions.prototype.asc_setPrintTitlesHeight=function(newVal){this.printTitlesHeight=newVal};asc_CPageOptions.prototype.asc_getPrintTitlesWidth=function(){return this.printTitlesWidth};asc_CPageOptions.prototype.asc_getPrintTitlesHeight=function(){return this.printTitlesHeight}; function CHeaderFooter(ws){this.ws=ws;this.alignWithMargins=null;this.differentFirst=null;this.differentOddEven=null;this.scaleWithDoc=null;this.evenFooter=null;this.evenHeader=null;this.firstFooter=null;this.firstHeader=null;this.oddFooter=null;this.oddHeader=null;return this}CHeaderFooter.prototype.clone=function(ws){var oRes=new CHeaderFooter(ws);oRes.alignWithMargins=this.alignWithMargins;oRes.differentFirst=this.differentFirst;oRes.differentOddEven=this.differentOddEven;oRes.scaleWithDoc=this.scaleWithDoc; oRes.evenFooter=this.evenFooter?this.evenFooter.clone():null;oRes.evenHeader=this.evenHeader?this.evenHeader.clone():null;oRes.firstFooter=this.firstFooter?this.firstFooter.clone():null;oRes.firstHeader=this.firstHeader?this.firstHeader.clone():null;oRes.oddFooter=this.oddFooter?this.oddFooter.clone():null;oRes.oddHeader=this.oddHeader?this.oddHeader.clone():null;return oRes};CHeaderFooter.prototype.getAlignWithMargins=function(){return this.alignWithMargins};CHeaderFooter.prototype.getDifferentFirst= function(){return this.differentFirst};CHeaderFooter.prototype.getDifferentOddEven=function(){return this.differentOddEven};CHeaderFooter.prototype.getScaleWithDoc=function(){return this.scaleWithDoc};CHeaderFooter.prototype.getEvenFooter=function(){return this.evenFooter};CHeaderFooter.prototype.getEvenHeader=function(){return this.evenHeader};CHeaderFooter.prototype.getFirstFooter=function(){return this.firstFooter};CHeaderFooter.prototype.getFirstHeader=function(){return this.firstHeader};CHeaderFooter.prototype.getOddFooter= function(){return this.oddFooter};CHeaderFooter.prototype.getOddHeader=function(){return this.oddHeader};CHeaderFooter.prototype.setAlignWithMargins=function(val){this.alignWithMargins=val};CHeaderFooter.prototype.setDifferentFirst=function(val){this.differentFirst=val};CHeaderFooter.prototype.setDifferentOddEven=function(val){this.differentOddEven=val};CHeaderFooter.prototype.setScaleWithDoc=function(val){this.scaleWithDoc=val};CHeaderFooter.prototype.setEvenFooter=function(newVal){var oldVal=this.evenFooter? this.evenFooter.str:null;if(oldVal!==newVal){if(null===newVal)this.evenFooter=null;else{this.evenFooter=new Asc.CHeaderFooterData;this.evenFooter.setStr(newVal)}if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Footer_Even,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setEvenHeader=function(newVal){var oldVal=this.evenHeader?this.evenHeader.str:null;if(oldVal!==newVal){if(null===newVal)this.evenHeader=null;else{this.evenHeader= new Asc.CHeaderFooterData;this.evenHeader.setStr(newVal)}if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Header_Even,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setFirstFooter=function(newVal){var oldVal=this.firstFooter?this.firstFooter.str:null;if(oldVal!==newVal){if(null===newVal)this.firstFooter=null;else{this.firstFooter=new Asc.CHeaderFooterData;this.firstFooter.setStr(newVal)}if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter, AscCH.historyitem_Footer_First,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setFirstHeader=function(newVal){var oldVal=this.firstHeader?this.firstHeader.str:null;if(oldVal!==newVal){if(null===newVal)this.firstHeader=null;else{this.firstHeader=new Asc.CHeaderFooterData;this.firstHeader.setStr(newVal)}if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Header_First,this.ws.getId(),null,new UndoRedoData_Layout(oldVal, newVal))}};CHeaderFooter.prototype.setOddFooter=function(newVal){var oldVal=this.oddFooter?this.oddFooter.str:null;if(oldVal!==newVal){if(null===newVal)this.oddFooter=null;else{this.oddFooter=new Asc.CHeaderFooterData;this.oddFooter.setStr(newVal)}if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Footer_Odd,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setOddHeader=function(newVal){var oldVal=this.oddHeader?this.oddHeader.str: null;if(oldVal!==newVal){if(null===newVal)this.oddHeader=null;else{this.oddHeader=new Asc.CHeaderFooterData;this.oddHeader.setStr(newVal)}if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Header_Odd,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setAlignWithMargins=function(newVal){var oldVal=this.alignWithMargins;var defaultVal=null===oldVal&&(newVal===1||newVal===true);if(oldVal!==newVal&&!defaultVal){this.alignWithMargins= newVal;if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Align_With_Margins,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setScaleWithDoc=function(newVal){var oldVal=this.scaleWithDoc;var defaultVal=null===oldVal&&(newVal===1||newVal===true);if(oldVal!==newVal&&!defaultVal){this.scaleWithDoc=newVal;if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Scale_With_Doc,this.ws.getId(), null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setDifferentFirst=function(newVal){var oldVal=this.differentFirst;var defaultVal=null===oldVal&&(newVal===0||newVal===false);if(oldVal!==newVal&&!defaultVal){this.differentFirst=newVal;if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Different_First,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setDifferentOddEven=function(newVal){var oldVal= this.differentOddEven;var defaultVal=null===oldVal&&(newVal===0||newVal===false);if(oldVal!==newVal&&!defaultVal){this.differentOddEven=newVal;if(this.ws&&History.Is_On())History.Add(AscCommonExcel.g_oUndoRedoHeaderFooter,AscCH.historyitem_Different_Odd_Even,this.ws.getId(),null,new UndoRedoData_Layout(oldVal,newVal))}};CHeaderFooter.prototype.setHeaderFooterData=function(str,type){switch(type){case Asc.c_oAscPageHFType.firstHeader:{this.setFirstHeader(str);break}case Asc.c_oAscPageHFType.oddHeader:{this.setOddHeader(str); break}case Asc.c_oAscPageHFType.evenHeader:{this.setEvenHeader(str);break}case Asc.c_oAscPageHFType.firstFooter:{this.setFirstFooter(str);break}case Asc.c_oAscPageHFType.oddFooter:{this.setOddFooter(str);break}case Asc.c_oAscPageHFType.evenFooter:{this.setEvenFooter(str);break}}};CHeaderFooter.prototype.init=function(){if(this.evenFooter)this.evenFooter.parse();if(this.evenHeader)this.evenHeader.parse();if(this.firstFooter)this.firstFooter.parse();if(this.firstHeader)this.firstHeader.parse();if(this.oddFooter)this.oddFooter.parse(); if(this.oddHeader)this.oddHeader.parse()};CHeaderFooter.prototype.getAllFonts=function(oFontMap){if(this.evenFooter)this.evenFooter.getAllFonts(oFontMap);if(this.evenHeader)this.evenHeader.getAllFonts(oFontMap);if(this.firstFooter)this.firstFooter.getAllFonts(oFontMap);if(this.firstHeader)this.firstHeader.getAllFonts(oFontMap);if(this.oddFooter)this.oddFooter.getAllFonts(oFontMap);if(this.oddHeader)this.oddHeader.getAllFonts(oFontMap)};function CHeaderFooterData(str){this.str=str;this.parser=null; return this}CHeaderFooterData.prototype.clone=function(){var oRes=new CHeaderFooterData;oRes.str=this.str;return oRes};CHeaderFooterData.prototype.getStr=function(){return this.str};CHeaderFooterData.prototype.setStr=function(val){this.str=val};CHeaderFooterData.prototype.parse=function(){var parser=new window["AscCommonExcel"].HeaderFooterParser;parser.parse(this.str);this.parser=parser;return parser};CHeaderFooterData.prototype.getAllFonts=function(oFontMap){if(this.parser)this.parser.getAllFonts(oFontMap)}; function CSortProperties(ws){this.selection=null;this._newSelection=null;this.hasHeaders=null;this.columnSort=null;this.caseSensitive=null;this.levels=null;this.sortList=null;this.lockChangeHeaders=null;this.lockChangeOrientation=null;this._ws=ws;return this}CSortProperties.prototype.asc_getHasHeaders=function(){return this.hasHeaders};CSortProperties.prototype.asc_getColumnSort=function(){return this.columnSort};CSortProperties.prototype.asc_getCaseSensitive=function(){return this.caseSensitive}; CSortProperties.prototype.asc_getLevels=function(){return this.levels};CSortProperties.prototype.asc_getSortList=function(){return this.sortList};CSortProperties.prototype.asc_getLockChangeHeaders=function(){return this.lockChangeHeaders};CSortProperties.prototype.asc_getLockChangeOrientation=function(){return this.lockChangeOrientation};CSortProperties.prototype.asc_setHasHeaders=function(val){var oldVal=!!this.hasHeaders;if(this._newSelection&&oldVal!==val){if(val)this._newSelection.r1++;else this._newSelection.r1--; this._ws.setSelection(this._newSelection)}this.hasHeaders=val};CSortProperties.prototype.asc_setColumnSort=function(val){this.columnSort=val};CSortProperties.prototype.asc_setCaseSensitive=function(val){this.caseSensitive=val};CSortProperties.prototype.asc_setLevels=function(val){this.levels=val};CSortProperties.prototype.asc_updateSortList=function(saveIndexes){this.generateSortList(saveIndexes)};CSortProperties.prototype.asc_getFilterInside=function(){};CSortProperties.prototype.generateSortList= function(saveIndexes){var maxCount=500;var selection=this._newSelection;var j;if(saveIndexes&&this.sortList&&this.sortList.length){var newSortList=[];for(j in this.sortList)newSortList[j]=this.getNameColumnByIndex(parseInt(j),selection);this.sortList=newSortList}else{this.sortList=[];if(this.columnSort)for(j=selection.c1;j<=selection.c2;j++){if(j-selection.c1>=maxCount)break;this.sortList.push(this.getNameColumnByIndex(j-selection.c1,selection))}else for(j=selection.r1;j<=selection.r2;j++){if(j-selection.r1>= maxCount)break;this.sortList.push(this.getNameColumnByIndex(j-selection.r1,selection))}}if(this.levels)for(var i=0;i<this.levels.length;i++)if(!this.sortList[this.levels[i].index])this.sortList[this.levels[i].index]=this.getNameColumnByIndex(this.levels[i].index,selection)};CSortProperties.prototype.asc_addBySortList=function(sRange){var selection=this._newSelection;var range=AscCommonExcel.g_oRangeCache.getAscRange(sRange);var index=this.columnSort?range.c1-selection.c1:range.r1-selection.r1;this.sortList[index]= this.getNameColumnByIndex(index,selection);return index};CSortProperties.prototype.getNameColumnByIndex=function(index,parentRef){var t=this;var _generateName=function(index){var base=t.columnSort?AscCommon.translateManager.getValue("Column"):AscCommon.translateManager.getValue("Row");var text=t.columnSort?t._ws._getColumnTitle(index):t._ws._getRowTitle(index);text=base+" "+text;if(t.hasHeaders)text="("+text+")";return text};var row=this.columnSort?parentRef.r1:index+parentRef.r1;var col=!this.columnSort? parentRef.c1:index+parentRef.c1;if(this.hasHeaders)if(this.columnSort)row--;else col--;if(!this.hasHeaders)return _generateName(this.columnSort?col:row);else{var cell=t._ws.model.getCell3(row,col);var value=cell.getValueWithFormat();return value!==""?value:_generateName(this.columnSort?col:row)}};CSortProperties.prototype.asc_getLevelProps=function(index){var t=this;var selection=t._newSelection;var r1=this.columnSort?selection.r1:selection.r1+index;var r2=this.columnSort?selection.r2:selection.r1+ index;var c1=this.columnSort?selection.c1+index:selection.c1;var c2=this.columnSort?selection.c1+index:selection.c2;var range=new Asc.Range(c1,r1,c2,r2);var levelInfo;var rangeInfo=t._ws.model.getRowColColors(range,!this.columnSort,true);if(rangeInfo){levelInfo=new CSortLevelInfo;levelInfo.colorsFill=rangeInfo.colors;levelInfo.colorsFont=rangeInfo.fontColors;levelInfo.isText=rangeInfo.text}return levelInfo};CSortProperties.prototype.asc_getRangeStr=function(){return this._newSelection.getAbsName()}; CSortProperties.prototype.asc_getSelection=function(){return this.selection};CSortProperties.prototype.asc_setSelection=function(val){this.selection=val};function CSortPropertiesLevel(){this.index=null;this.name=null;this.sortBy=null;this.descending=null;this.color=null;return this}CSortPropertiesLevel.prototype.asc_getIndex=function(){return this.index};CSortPropertiesLevel.prototype.asc_getName=function(){return this.name};CSortPropertiesLevel.prototype.asc_getSortBy=function(){return this.sortBy}; CSortPropertiesLevel.prototype.asc_getDescending=function(){return this.descending};CSortPropertiesLevel.prototype.asc_getColor=function(){return this.color};CSortPropertiesLevel.prototype.asc_setIndex=function(val){this.index=val};CSortPropertiesLevel.prototype.asc_setName=function(val){this.name=val};CSortPropertiesLevel.prototype.asc_setSortBy=function(val){this.sortBy=val};CSortPropertiesLevel.prototype.asc_setDescending=function(val){this.descending=val};CSortPropertiesLevel.prototype.asc_setColor= function(val){this.color=val};function CSortLevelInfo(){this.colorsFill=null;this.colorsFont=null;this.isText=null;return this}CSortLevelInfo.prototype.asc_getColorsFill=function(){return this.colorsFill};CSortLevelInfo.prototype.asc_getColorsFont=function(){return this.colorsFont};CSortLevelInfo.prototype.asc_getIsTextData=function(){return this.isText};function CRemoveDuplicatesProps(ws){this.selection=null;this._newSelection=null;this.hasHeaders=null;this.columnList=null;this._ws=ws;this.duplicateValues= null;this.uniqueValues=null;return this}CRemoveDuplicatesProps.prototype.asc_getHasHeaders=function(){return this.hasHeaders};CRemoveDuplicatesProps.prototype.asc_getColumnList=function(){return this.columnList};CRemoveDuplicatesProps.prototype.asc_setHasHeaders=function(val){var oldVal=!!this.hasHeaders;if(this._newSelection&&oldVal!==val){if(val)this._newSelection.r1++;else this._newSelection.r1--;this._ws.setSelection(this._newSelection)}this.hasHeaders=val};CRemoveDuplicatesProps.prototype.asc_updateColumnList= function(){this.generateColumnList()};CRemoveDuplicatesProps.prototype.generateColumnList=function(){var maxCount=500;var selection=this._newSelection;var j,elem;if(this.columnList&&this.columnList.length)for(j in this.columnList)this.columnList[j].asc_setVal(this.getNameColumnByIndex(parseInt(j)));else{this.columnList=[];for(j=selection.c1;j<=selection.c2;j++){if(j-selection.c1>=maxCount)break;elem=new window["AscCommonExcel"].AutoFiltersOptionsElements;elem.asc_setVisible(true);elem.asc_setVal(this.getNameColumnByIndex(j- selection.c1));this.columnList.push(elem)}}};CRemoveDuplicatesProps.prototype.getNameColumnByIndex=function(index){var t=this;var _generateName=function(index){var base=AscCommon.translateManager.getValue("Column");var text=t._ws._getColumnTitle(index);text=base+" "+text;return text};var row=this._newSelection.r1;var col=index+this._newSelection.c1;if(!this.hasHeaders)return _generateName(col);else{var cell=t._ws.model.getCell3(row-1,col);var value=cell.getValueWithFormat();return value!==""?value: _generateName(col)}};CRemoveDuplicatesProps.prototype.setDuplicateValues=function(val){this.duplicateValues=val};CRemoveDuplicatesProps.prototype.setUniqueValues=function(val){this.uniqueValues=val};CRemoveDuplicatesProps.prototype.asc_getDuplicateValues=function(val){return this.duplicateValues};CRemoveDuplicatesProps.prototype.asc_getUniqueValues=function(val){return this.uniqueValues};function CFunctionInfo(name){this.name=null;this.argumentsMin=null;this.argumentsMax=null;this.argumentsValue= null;this.argumentsType=null;this.argumentsResult=null;this.formulaResult=null;this.functionResult=null;this._init(name);return this}CFunctionInfo.prototype._init=function(name){var f=AscCommonExcel.cFormulaFunctionLocalized?AscCommonExcel.cFormulaFunctionLocalized[name]:AscCommonExcel.cFormulaFunction[name];if(f){this.name=name;this.argumentsMin=f.prototype.argumentsMin;this.argumentsMax=f.prototype.argumentsMax;this.argumentsType=f.prototype.argumentsType}};CFunctionInfo.prototype.asc_getArgumentMin= function(){return this.argumentsMin};CFunctionInfo.prototype.asc_getArgumentMax=function(){return this.argumentsMax};CFunctionInfo.prototype.asc_getArgumentsValue=function(){return this.argumentsValue};CFunctionInfo.prototype.asc_getArgumentsType=function(){return this.argumentsType};CFunctionInfo.prototype.asc_getArgumentsResult=function(){return this.argumentsResult};CFunctionInfo.prototype.asc_getFormulaResult=function(){return this.formulaResult};CFunctionInfo.prototype.asc_getFunctionResult= function(){return this.functionResult};CFunctionInfo.prototype.asc_getName=function(){return this.name};var prot;window["Asc"]=window["Asc"]||{};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].g_oColorManager=g_oColorManager;window["AscCommonExcel"].g_oDefaultFormat=g_oDefaultFormat;window["AscCommonExcel"].g_nColorTextDefault=g_nColorTextDefault;window["AscCommonExcel"].g_nColorHyperlink=g_nColorHyperlink;window["AscCommonExcel"].c_maxOutlineLevel=c_maxOutlineLevel; window["AscCommonExcel"].g_oThemeColorsDefaultModsSpreadsheet=g_oThemeColorsDefaultModsSpreadsheet;window["AscCommonExcel"].g_StyleCache=g_StyleCache;window["AscCommonExcel"].map_themeExcel_to_themePresentation=map_themeExcel_to_themePresentation;window["AscCommonExcel"].g_nRowStructSize=g_nRowStructSize;window["AscCommonExcel"].shiftGetBBox=shiftGetBBox;window["AscCommonExcel"].getStringFromMultiText=getStringFromMultiText;window["AscCommonExcel"].getStringFromMultiTextSkipToSpace=getStringFromMultiTextSkipToSpace; window["AscCommonExcel"].isEqualMultiText=isEqualMultiText;window["AscCommonExcel"].RgbColor=RgbColor;window["AscCommonExcel"].createRgbColor=createRgbColor;window["AscCommonExcel"].ThemeColor=ThemeColor;window["AscCommonExcel"].CorrectAscColor=CorrectAscColor;window["AscCommonExcel"].Fragment=Fragment;window["AscCommonExcel"].Font=Font;window["Asc"]["c_oAscPatternType"]=c_oAscPatternType;prot=c_oAscPatternType;prot["DarkDown"]=prot.DarkDown;prot["DarkGray"]=prot.DarkGray;prot["DarkGrid"]=prot.DarkGrid; prot["DarkHorizontal"]=prot.DarkHorizontal;prot["DarkTrellis"]=prot.DarkTrellis;prot["DarkUp"]=prot.DarkUp;prot["DarkVertical"]=prot.DarkVertical;prot["Gray0625"]=prot.Gray0625;prot["Gray125"]=prot.Gray125;prot["LightDown"]=prot.LightDown;prot["LightGray"]=prot.LightGray;prot["LightGrid"]=prot.LightGrid;prot["LightHorizontal"]=prot.LightHorizontal;prot["LightTrellis"]=prot.LightTrellis;prot["LightUp"]=prot.LightUp;prot["LightVertical"]=prot.LightVertical;prot["MediumGray"]=prot.MediumGray;prot["None"]= prot.None;prot["Solid"]=prot.Solid;window["Asc"]["asc_CGradientFill"]=window["AscCommonExcel"].GradientFill=GradientFill;prot=GradientFill.prototype;prot["asc_getType"]=prot.asc_getType;prot["asc_setType"]=prot.asc_setType;prot["asc_getDegree"]=prot.asc_getDegree;prot["asc_setDegree"]=prot.asc_setDegree;prot["asc_getLeft"]=prot.asc_getLeft;prot["asc_setLeft"]=prot.asc_setLeft;prot["asc_getRight"]=prot.asc_getRight;prot["asc_setRight"]=prot.asc_setRight;prot["asc_getTop"]=prot.asc_getTop;prot["asc_setTop"]= prot.asc_setTop;prot["asc_getBottom"]=prot.asc_getBottom;prot["asc_setBottom"]=prot.asc_setBottom;prot["asc_getGradientStops"]=prot.asc_getGradientStops;prot["asc_putGradientStops"]=prot.asc_putGradientStops;window["Asc"]["asc_CGradientStop"]=window["AscCommonExcel"].GradientStop=GradientStop;prot=GradientStop.prototype;prot["asc_getPosition"]=prot.asc_getPosition;prot["asc_setPosition"]=prot.asc_setPosition;prot["asc_getColor"]=prot.asc_getColor;prot["asc_setColor"]=prot.asc_setColor;window["Asc"]["asc_CPatternFill"]= window["AscCommonExcel"].PatternFill=PatternFill;prot=PatternFill.prototype;prot["asc_getType"]=prot.asc_getType;prot["asc_setType"]=prot.asc_setType;prot["asc_getFgColor"]=prot.asc_getFgColor;prot["asc_setFgColor"]=prot.asc_setFgColor;prot["asc_getBgColor"]=prot.asc_getBgColor;prot["asc_setBgColor"]=prot.asc_setBgColor;window["Asc"]["asc_CFill2"]=window["AscCommonExcel"].Fill=Fill;prot=Fill.prototype;prot["asc_getPatternFill"]=prot.asc_getPatternFill;prot["asc_setPatternFill"]=prot.asc_setPatternFill; prot["asc_getGradientFill"]=prot.asc_getGradientFill;prot["asc_setGradientFill"]=prot.asc_setGradientFill;window["AscCommonExcel"].BorderProp=BorderProp;window["AscCommonExcel"].Border=Border;window["AscCommonExcel"].Num=Num;window["AscCommonExcel"].CellXfs=CellXfs;prot=CellXfs.prototype;prot["asc_getFillColor"]=prot.asc_getFillColor;prot["asc_getFill"]=prot.asc_getFill;prot["asc_getFontName"]=prot.asc_getFontName;prot["asc_getFontSize"]=prot.asc_getFontSize;prot["asc_getFontColor"]=prot.asc_getFontColor; prot["asc_getFontBold"]=prot.asc_getFontBold;prot["asc_getFontItalic"]=prot.asc_getFontItalic;prot["asc_getFontUnderline"]=prot.asc_getFontUnderline;prot["asc_getFontStrikeout"]=prot.asc_getFontStrikeout;prot["asc_getFontSubscript"]=prot.asc_getFontSubscript;prot["asc_getFontSuperscript"]=prot.asc_getFontSuperscript;prot["asc_getNumFormat"]=prot.asc_getNumFormat;prot["asc_getNumFormatInfo"]=prot.asc_getNumFormatInfo;prot["asc_getHorAlign"]=prot.asc_getHorAlign;prot["asc_getVertAlign"]=prot.asc_getVertAlign; prot["asc_getAngle"]=prot.asc_getAngle;prot["asc_getWrapText"]=prot.asc_getWrapText;prot["asc_getShrinkToFit"]=prot.asc_getShrinkToFit;prot["asc_getPreview"]=prot.asc_getPreview;window["AscCommonExcel"].Align=Align;window["AscCommonExcel"].CCellStyles=CCellStyles;window["AscCommonExcel"].CCellStyle=CCellStyle;window["AscCommonExcel"].StyleManager=StyleManager;window["AscCommonExcel"].SheetMergedStyles=SheetMergedStyles;window["AscCommonExcel"].Hyperlink=Hyperlink;window["AscCommonExcel"].SheetFormatPr= SheetFormatPr;window["AscCommonExcel"].Col=Col;window["AscCommonExcel"].Row=Row;window["AscCommonExcel"].CMultiTextElem=CMultiTextElem;window["AscCommonExcel"].CCellValue=CCellValue;window["AscCommonExcel"].RangeDataManager=RangeDataManager;window["AscCommonExcel"].CSharedStrings=CSharedStrings;window["AscCommonExcel"].CWorkbookFormulas=CWorkbookFormulas;window["Asc"]["sparklineGroup"]=window["AscCommonExcel"].sparklineGroup=sparklineGroup;prot=sparklineGroup.prototype;prot["asc_getId"]=prot.asc_getId; prot["asc_getType"]=prot.asc_getType;prot["asc_getLineWeight"]=prot.asc_getLineWeight;prot["asc_getDisplayEmpty"]=prot.asc_getDisplayEmpty;prot["asc_getMarkersPoint"]=prot.asc_getMarkersPoint;prot["asc_getHighPoint"]=prot.asc_getHighPoint;prot["asc_getLowPoint"]=prot.asc_getLowPoint;prot["asc_getFirstPoint"]=prot.asc_getFirstPoint;prot["asc_getLastPoint"]=prot.asc_getLastPoint;prot["asc_getNegativePoint"]=prot.asc_getNegativePoint;prot["asc_getDisplayXAxis"]=prot.asc_getDisplayXAxis;prot["asc_getDisplayHidden"]= prot.asc_getDisplayHidden;prot["asc_getMinAxisType"]=prot.asc_getMinAxisType;prot["asc_getMaxAxisType"]=prot.asc_getMaxAxisType;prot["asc_getRightToLeft"]=prot.asc_getRightToLeft;prot["asc_getManualMax"]=prot.asc_getManualMax;prot["asc_getManualMin"]=prot.asc_getManualMin;prot["asc_getColorSeries"]=prot.asc_getColorSeries;prot["asc_getColorNegative"]=prot.asc_getColorNegative;prot["asc_getColorAxis"]=prot.asc_getColorAxis;prot["asc_getColorMarkers"]=prot.asc_getColorMarkers;prot["asc_getColorFirst"]= prot.asc_getColorFirst;prot["asc_getColorLast"]=prot.asc_getColorLast;prot["asc_getColorHigh"]=prot.asc_getColorHigh;prot["asc_getColorLow"]=prot.asc_getColorLow;prot["asc_getDataRanges"]=prot.asc_getDataRanges;prot["asc_setType"]=prot.asc_setType;prot["asc_setLineWeight"]=prot.asc_setLineWeight;prot["asc_setDisplayEmpty"]=prot.asc_setDisplayEmpty;prot["asc_setMarkersPoint"]=prot.asc_setMarkersPoint;prot["asc_setHighPoint"]=prot.asc_setHighPoint;prot["asc_setLowPoint"]=prot.asc_setLowPoint;prot["asc_setFirstPoint"]= prot.asc_setFirstPoint;prot["asc_setLastPoint"]=prot.asc_setLastPoint;prot["asc_setNegativePoint"]=prot.asc_setNegativePoint;prot["asc_setDisplayXAxis"]=prot.asc_setDisplayXAxis;prot["asc_setDisplayHidden"]=prot.asc_setDisplayHidden;prot["asc_setMinAxisType"]=prot.asc_setMinAxisType;prot["asc_setMaxAxisType"]=prot.asc_setMaxAxisType;prot["asc_setRightToLeft"]=prot.asc_setRightToLeft;prot["asc_setManualMax"]=prot.asc_setManualMax;prot["asc_setManualMin"]=prot.asc_setManualMin;prot["asc_setColorSeries"]= prot.asc_setColorSeries;prot["asc_setColorNegative"]=prot.asc_setColorNegative;prot["asc_setColorAxis"]=prot.asc_setColorAxis;prot["asc_setColorMarkers"]=prot.asc_setColorMarkers;prot["asc_setColorFirst"]=prot.asc_setColorFirst;prot["asc_setColorLast"]=prot.asc_setColorLast;prot["asc_setColorHigh"]=prot.asc_setColorHigh;prot["asc_setColorLow"]=prot.asc_setColorLow;prot["asc_getStyles"]=prot.asc_getStyles;prot["asc_setStyle"]=prot.asc_setStyle;window["AscCommonExcel"].sparkline=sparkline;window["AscCommonExcel"].TablePart= TablePart;window["AscCommonExcel"].AutoFilter=AutoFilter;window["AscCommonExcel"].SortState=SortState;window["AscCommonExcel"].TableColumn=TableColumn;window["AscCommonExcel"].TableStyleInfo=TableStyleInfo;window["AscCommonExcel"].FilterColumn=FilterColumn;window["AscCommonExcel"].Filters=Filters;window["AscCommonExcel"].Filter=Filter;window["AscCommonExcel"].DateGroupItem=DateGroupItem;window["AscCommonExcel"].SortCondition=SortCondition;window["AscCommonExcel"].AutoFilterDateElem=AutoFilterDateElem; window["AscCommonExcel"].c_oAscPatternType=c_oAscPatternType;window["Asc"]["CustomFilters"]=window["Asc"].CustomFilters=CustomFilters;prot=CustomFilters.prototype;prot["asc_getAnd"]=prot.asc_getAnd;prot["asc_getCustomFilters"]=prot.asc_getCustomFilters;prot["asc_setAnd"]=prot.asc_setAnd;prot["asc_setCustomFilters"]=prot.asc_setCustomFilters;window["Asc"]["CustomFilter"]=window["Asc"].CustomFilter=CustomFilter;prot=CustomFilter.prototype;prot["asc_getOperator"]=prot.asc_getOperator;prot["asc_getVal"]= prot.asc_getVal;prot["asc_setOperator"]=prot.asc_setOperator;prot["asc_setVal"]=prot.asc_setVal;window["Asc"]["DynamicFilter"]=window["Asc"].DynamicFilter=DynamicFilter;prot=DynamicFilter.prototype;prot["asc_getType"]=prot.asc_getType;prot["asc_getVal"]=prot.asc_getVal;prot["asc_getMaxVal"]=prot.asc_getMaxVal;prot["asc_setType"]=prot.asc_setType;prot["asc_setVal"]=prot.asc_setVal;prot["asc_setMaxVal"]=prot.asc_setMaxVal;window["Asc"]["ColorFilter"]=window["Asc"].ColorFilter=ColorFilter;prot=ColorFilter.prototype; prot["asc_getCellColor"]=prot.asc_getCellColor;prot["asc_getCColor"]=prot.asc_getCColor;prot["asc_getDxf"]=prot.asc_getDxf;prot["asc_setCellColor"]=prot.asc_setCellColor;prot["asc_setDxf"]=prot.asc_setDxf;prot["asc_setCColor"]=prot.asc_setCColor;window["Asc"]["Top10"]=window["Asc"].Top10=Top10;prot=Top10.prototype;prot["asc_getFilterVal"]=prot.asc_getFilterVal;prot["asc_getPercent"]=prot.asc_getPercent;prot["asc_getTop"]=prot.asc_getTop;prot["asc_getVal"]=prot.asc_getVal;prot["asc_setFilterVal"]= prot.asc_setFilterVal;prot["asc_setPercent"]=prot.asc_setPercent;prot["asc_setTop"]=prot.asc_setTop;prot["asc_setVal"]=prot.asc_setVal;window["Asc"]["asc_CPageMargins"]=window["Asc"].asc_CPageMargins=asc_CPageMargins;prot=asc_CPageMargins.prototype;prot["asc_getLeft"]=prot.asc_getLeft;prot["asc_getRight"]=prot.asc_getRight;prot["asc_getTop"]=prot.asc_getTop;prot["asc_getBottom"]=prot.asc_getBottom;prot["asc_setLeft"]=prot.asc_setLeft;prot["asc_setRight"]=prot.asc_setRight;prot["asc_setTop"]=prot.asc_setTop; prot["asc_setBottom"]=prot.asc_setBottom;prot["asc_setHeader"]=prot.asc_setHeader;prot["asc_setFooter"]=prot.asc_setFooter;window["Asc"]["asc_CPageSetup"]=window["Asc"].asc_CPageSetup=asc_CPageSetup;prot=asc_CPageSetup.prototype;prot["asc_getOrientation"]=prot.asc_getOrientation;prot["asc_getWidth"]=prot.asc_getWidth;prot["asc_getHeight"]=prot.asc_getHeight;prot["asc_setOrientation"]=prot.asc_setOrientation;prot["asc_setWidth"]=prot.asc_setWidth;prot["asc_setHeight"]=prot.asc_setHeight;prot["asc_getFitToWidth"]= prot.asc_getFitToWidth;prot["asc_getFitToHeight"]=prot.asc_getFitToHeight;prot["asc_setFitToWidth"]=prot.asc_setFitToWidth;prot["asc_setFitToHeight"]=prot.asc_setFitToHeight;prot["asc_getScale"]=prot.asc_getScale;prot["asc_setScale"]=prot.asc_setScale;window["Asc"]["asc_CPageOptions"]=window["Asc"].asc_CPageOptions=asc_CPageOptions;prot=asc_CPageOptions.prototype;prot["asc_getPageMargins"]=prot.asc_getPageMargins;prot["asc_getPageSetup"]=prot.asc_getPageSetup;prot["asc_getGridLines"]=prot.asc_getGridLines; prot["asc_getHeadings"]=prot.asc_getHeadings;prot["asc_setPageMargins"]=prot.asc_setPageMargins;prot["asc_setPageSetup"]=prot.asc_setPageSetup;prot["asc_setGridLines"]=prot.asc_setGridLines;prot["asc_setHeadings"]=prot.asc_setHeadings;prot["asc_setPrintTitlesWidth"]=prot.asc_setPrintTitlesWidth;prot["asc_setPrintTitlesHeight"]=prot.asc_setPrintTitlesHeight;prot["asc_getPrintTitlesWidth"]=prot.asc_getPrintTitlesWidth;prot["asc_getPrintTitlesHeight"]=prot.asc_getPrintTitlesHeight;window["Asc"]["CHeaderFooter"]= window["Asc"].CHeaderFooter=CHeaderFooter;window["Asc"]["CHeaderFooterData"]=window["Asc"].CHeaderFooterData=CHeaderFooterData;window["Asc"]["CSortProperties"]=window["Asc"].CSortProperties=CSortProperties;prot=CSortProperties.prototype;prot["asc_getHasHeaders"]=prot.asc_getHasHeaders;prot["asc_getColumnSort"]=prot.asc_getColumnSort;prot["asc_getLevels"]=prot.asc_getLevels;prot["asc_getSortList"]=prot.asc_getSortList;prot["asc_updateSortList"]=prot.asc_updateSortList;prot["asc_setHasHeaders"]=prot.asc_setHasHeaders; prot["asc_setColumnSort"]=prot.asc_setColumnSort;prot["asc_getLevelProps"]=prot.asc_getLevelProps;prot["asc_setLevels"]=prot.asc_setLevels;prot["asc_getLockChangeHeaders"]=prot.asc_getLockChangeHeaders;prot["asc_getLockChangeOrientation"]=prot.asc_getLockChangeOrientation;prot["asc_getCaseSensitive"]=prot.asc_getCaseSensitive;prot["asc_setCaseSensitive"]=prot.asc_setCaseSensitive;prot["asc_addBySortList"]=prot.asc_addBySortList;prot["asc_getRangeStr"]=prot.asc_getRangeStr;prot["asc_getSelection"]= prot.asc_getSelection;prot["asc_setSelection"]=prot.asc_setSelection;window["Asc"]["CSortPropertiesLevel"]=window["Asc"].CSortPropertiesLevel=CSortPropertiesLevel;prot=CSortPropertiesLevel.prototype;prot["asc_getIndex"]=prot.asc_getIndex;prot["asc_getName"]=prot.asc_getName;prot["asc_getSortBy"]=prot.asc_getSortBy;prot["asc_getDescending"]=prot.asc_getDescending;prot["asc_getColor"]=prot.asc_getColor;prot["asc_setIndex"]=prot.asc_setIndex;prot["asc_setName"]=prot.asc_setName;prot["asc_setSortBy"]= prot.asc_setSortBy;prot["asc_setDescending"]=prot.asc_setDescending;prot["asc_setColor"]=prot.asc_setColor;window["Asc"]["CSortLevelInfo"]=window["Asc"].CSortLevelInfo=CSortLevelInfo;prot=CSortLevelInfo.prototype;prot["asc_getColorsFill"]=prot.asc_getColorsFill;prot["asc_getColorsFont"]=prot.asc_getColorsFont;prot["asc_getIsTextData"]=prot.asc_getIsTextData;window["Asc"]["CRemoveDuplicatesProps"]=window["Asc"].CRemoveDuplicatesProps=CRemoveDuplicatesProps;prot=CRemoveDuplicatesProps.prototype;prot["asc_getHasHeaders"]= prot.asc_getHasHeaders;prot["asc_getColumnList"]=prot.asc_getColumnList;prot["asc_updateColumnList"]=prot.asc_updateColumnList;prot["asc_setHasHeaders"]=prot.asc_setHasHeaders;prot["asc_getDuplicateValues"]=prot.asc_getDuplicateValues;prot["asc_getUniqueValues"]=prot.asc_getUniqueValues;window["AscCommonExcel"].CFunctionInfo=CFunctionInfo;prot=CFunctionInfo.prototype;prot["asc_getArgumentMin"]=prot.asc_getArgumentMin;prot["asc_getArgumentMax"]=prot.asc_getArgumentMax;prot["asc_getArgumentsValue"]= prot.asc_getArgumentsValue;prot["asc_getArgumentsType"]=prot.asc_getArgumentsType;prot["asc_getArgumentsResult"]=prot.asc_getArgumentsResult;prot["asc_getFormulaResult"]=prot.asc_getFormulaResult;prot["asc_getFunctionResult"]=prot.asc_getFunctionResult;prot["asc_getName"]=prot.asc_getName})(window);"use strict";(function(window,undefined){var g_memory=AscFonts.g_memory;var CellValueType=AscCommon.CellValueType;var c_oAscBorderStyles=AscCommon.c_oAscBorderStyles;var fSortAscending=AscCommon.fSortAscending; var parserHelp=AscCommon.parserHelp;var oNumFormatCache=AscCommon.oNumFormatCache;var gc_nMaxRow0=AscCommon.gc_nMaxRow0;var gc_nMaxCol0=AscCommon.gc_nMaxCol0;var g_oCellAddressUtils=AscCommon.g_oCellAddressUtils;var CellAddress=AscCommon.CellAddress;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var cBoolLocal=AscCommon.cBoolLocal;var cErrorLocal=AscCommon.cErrorLocal;var cErrorOrigin=AscCommon.cErrorOrigin;var c_oAscNumFormatType=Asc.c_oAscNumFormatType;var UndoRedoItemSerializable= AscCommonExcel.UndoRedoItemSerializable;var UndoRedoData_CellSimpleData=AscCommonExcel.UndoRedoData_CellSimpleData;var UndoRedoData_CellValueData=AscCommonExcel.UndoRedoData_CellValueData;var UndoRedoData_FromToRowCol=AscCommonExcel.UndoRedoData_FromToRowCol;var UndoRedoData_FromTo=AscCommonExcel.UndoRedoData_FromTo;var UndoRedoData_IndexSimpleProp=AscCommonExcel.UndoRedoData_IndexSimpleProp;var UndoRedoData_BBox=AscCommonExcel.UndoRedoData_BBox;var UndoRedoData_SheetAdd=AscCommonExcel.UndoRedoData_SheetAdd; var UndoRedoData_DefinedNames=AscCommonExcel.UndoRedoData_DefinedNames;var g_oDefaultFormat=AscCommonExcel.g_oDefaultFormat;var g_StyleCache=AscCommonExcel.g_StyleCache;var Border=AscCommonExcel.Border;var RangeDataManager=AscCommonExcel.RangeDataManager;var cElementType=AscCommonExcel.cElementType;var parserFormula=AscCommonExcel.parserFormula;var c_oAscError=Asc.c_oAscError;var c_oAscInsertOptions=Asc.c_oAscInsertOptions;var c_oAscDeleteOptions=Asc.c_oAscDeleteOptions;var c_oAscGetDefinedNamesList= Asc.c_oAscGetDefinedNamesList;var c_oAscDefinedNameReason=Asc.c_oAscDefinedNameReason;var c_oNotifyType=AscCommon.c_oNotifyType;var g_cCalcRecursion=AscCommonExcel.g_cCalcRecursion;var g_nVerticalTextAngle=255;var oDefaultMetrics={ColWidthChars:0,RowHeight:0};var g_sNewSheetNamePattern="Sheet";var g_nSheetNameMaxLength=31;var g_nDefNameMaxLength=255;var g_nAllColIndex=-1;var g_nAllRowIndex=-1;var aStandartNumFormats=[];var aStandartNumFormatsId={};var oFormulaLocaleInfo={Parse:true,DigitSep:true}; (function(){aStandartNumFormats[0]="General";aStandartNumFormats[1]="0";aStandartNumFormats[2]="0.00";aStandartNumFormats[3]="#,##0";aStandartNumFormats[4]="#,##0.00";aStandartNumFormats[9]="0%";aStandartNumFormats[10]="0.00%";aStandartNumFormats[11]="0.00E+00";aStandartNumFormats[12]="# ?/?";aStandartNumFormats[13]="# ??/??";aStandartNumFormats[14]="m/d/yyyy";aStandartNumFormats[15]="d-mmm-yy";aStandartNumFormats[16]="d-mmm";aStandartNumFormats[17]="mmm-yy";aStandartNumFormats[18]="h:mm AM/PM";aStandartNumFormats[19]= "h:mm:ss AM/PM";aStandartNumFormats[20]="h:mm";aStandartNumFormats[21]="h:mm:ss";aStandartNumFormats[22]="m/d/yyyy h:mm";aStandartNumFormats[37]="#,##0_);(#,##0)";aStandartNumFormats[38]="#,##0_);[Red](#,##0)";aStandartNumFormats[39]="#,##0.00_);(#,##0.00)";aStandartNumFormats[40]="#,##0.00_);[Red](#,##0.00)";aStandartNumFormats[45]="mm:ss";aStandartNumFormats[46]="[h]:mm:ss";aStandartNumFormats[47]="mm:ss.0";aStandartNumFormats[48]="##0.0E+0";aStandartNumFormats[49]="@";for(var i in aStandartNumFormats)aStandartNumFormatsId[aStandartNumFormats[i]]= i-0})();var c_oRangeType={Range:0,Col:1,Row:2,All:3};var c_oSharedShiftType={Processed:1,NeedTransform:2,PreProcessed:3};var emptyStyleComponents={table:[],conditional:[]};function getRangeType(oBBox){if(null==oBBox)oBBox=this.bbox;if(oBBox.c1==0&&gc_nMaxCol0==oBBox.c2&&oBBox.r1==0&&gc_nMaxRow0==oBBox.r2)return c_oRangeType.All;if(oBBox.c1==0&&gc_nMaxCol0==oBBox.c2)return c_oRangeType.Row;else if(oBBox.r1==0&&gc_nMaxRow0==oBBox.r2)return c_oRangeType.Col;else return c_oRangeType.Range}function getCompiledStyleFromArray(xf, xfs){for(var i=0;i<xfs.length;++i)if(null==xf)xf=xfs[i];else xf=xf.merge(xfs[i]);return xf}function getCompiledStyle(sheetMergedStyles,hiddenManager,nRow,nCol,opt_cell,opt_ws,opt_styleComponents){var styleComponents=opt_styleComponents?opt_styleComponents:sheetMergedStyles.getStyle(hiddenManager,nRow,nCol,opt_ws);var xf=getCompiledStyleFromArray(null,styleComponents.table);if(opt_cell)if(null===xf)xf=opt_cell.xfs;else{if(opt_cell.xfs)xf=xf.merge(opt_cell.xfs,true)}else if(opt_ws)opt_ws._getRowNoEmpty(nRow, function(row){if(row&&null!=row.xfs)xf=null===xf?row.xfs:xf.merge(row.xfs,true);else{var col=opt_ws._getColNoEmptyWithAll(nCol);if(null!=col&&null!=col.xfs)xf=null===xf?col.xfs:xf.merge(col.xfs,true)}});xf=getCompiledStyleFromArray(xf,styleComponents.conditional);return xf}function getDefNameIndex(name){return name?name.toLowerCase():name}function getDefNameId(sheetId,name){if(sheetId)return sheetId+AscCommon.g_cCharDelimiter+getDefNameIndex(name);else return getDefNameIndex(name)}var g_FDNI={sheetId:null, name:null};function getFromDefNameId(nodeId){var index=nodeId?nodeId.indexOf(AscCommon.g_cCharDelimiter):-1;if(-1!=index){g_FDNI.sheetId=nodeId.substring(0,index);g_FDNI.name=nodeId.substring(index+1)}else{g_FDNI.sheetId=null;g_FDNI.name=nodeId}}function DefName(wb,name,ref,sheetId,hidden,type,isXLNM){this.wb=wb;this.name=name;this.ref=ref;this.sheetId=sheetId;this.hidden=hidden;this.type=type;this.isXLNM=isXLNM;this.isLock=null;this.parsedRef=null}DefName.prototype={clone:function(wb){return new DefName(wb, this.name,this.ref,this.sheetId,this.hidden,this.type,this.isXLNM)},removeDependencies:function(){if(this.parsedRef){this.parsedRef.removeDependencies();this.parsedRef=null}},setRef:function(ref,opt_noRemoveDependencies,opt_forceBuild,opt_open){if(!opt_noRemoveDependencies)this.removeDependencies();opt_open=opt_open||this.wb.bRedoChanges||this.wb.bUndoChanges;this.ref=ref;this.parsedRef=new parserFormula(ref,this,AscCommonExcel.g_DefNameWorksheet);this.parsedRef.setIsTable(this.type);var t=this;if(opt_forceBuild){if(opt_open)AscCommonExcel.executeInR1C1Mode(false, function(){t.parsedRef.parse()});else this.parsedRef.parse();this.parsedRef.buildDependencies()}else{if(!opt_open){this.parsedRef.parse();this.ref=this.parsedRef.assemble()}this.wb.dependencyFormulas.addToBuildDependencyDefName(this)}},getRef:function(bLocale){var res,t=this;if(!this.parsedRef.isParsed)AscCommonExcel.executeInR1C1Mode(false,function(){t.parsedRef.parse()});if(bLocale)res=this.parsedRef.assembleLocale(AscCommonExcel.cFormulaFunctionToLocale,true);else res=this.parsedRef.assemble(); return res},getNodeId:function(){return getDefNameId(this.sheetId,this.name)},getAscCDefName:function(bLocale){var index=null;if(this.sheetId){var sheet=this.wb.getWorksheetById(this.sheetId);index=sheet.getIndex()}if(!this.type&&this.wb&&this.wb.getSlicerCacheByName(this.name))this.type=Asc.c_oAscDefNameType.slicer;return new Asc.asc_CDefName(this.name,this.getRef(bLocale),index,this.type,this.hidden,this.isLock,this.isXLNM)},getUndoDefName:function(){return new UndoRedoData_DefinedNames(this.name, this.ref,this.sheetId,this.type,this.isXLNM)},setUndoDefName:function(newUndoName,doNotChangeRef){this.name=newUndoName.name;this.sheetId=newUndoName.sheetId;this.hidden=false;this.type=newUndoName.type;if(!doNotChangeRef&&this.ref!=newUndoName.ref)this.setRef(newUndoName.ref);this.isXLNM=newUndoName.isXLNM},onFormulaEvent:function(type,eventData){if(AscCommon.c_oNotifyParentType.IsDefName===type)return null;else if(AscCommon.c_oNotifyParentType.Change===type)this.wb.dependencyFormulas.addToChangedDefName(this); else if(AscCommon.c_oNotifyParentType.ChangeFormula===type){var notifyType=eventData.notifyData.type;if(!(this.type===Asc.c_oAscDefNameType.table&&(c_oNotifyType.Shift===notifyType||c_oNotifyType.Move===notifyType||c_oNotifyType.Delete===notifyType))){var oldUndoName=this.getUndoDefName();this.parsedRef.setFormulaString(this.ref=eventData.assemble);this.wb.dependencyFormulas.addToChangedDefName(this);var newUndoName=this.getUndoDefName();History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_DefinedNamesChangeUndo, null,null,new UndoRedoData_FromTo(oldUndoName,newUndoName),true)}}}};function getCellIndex(row,col){return row*AscCommon.gc_nMaxCol+col}var g_FCI={row:null,col:null};function getFromCellIndex(cellIndex){g_FCI.row=Math.floor(cellIndex/AscCommon.gc_nMaxCol);g_FCI.col=cellIndex%AscCommon.gc_nMaxCol}function getVertexIndex(bbox){var res;AscCommonExcel.executeInR1C1Mode(false,function(){res=bbox.getName(AscCommonExcel.referenceType.R)});return res}function DependencyGraph(wb){this.wb=wb;this.sheetListeners= {};this.volatileListeners={};this.defNameListeners={};this.tempGetByCells=[];this.isInCalc=false;this.changedCell=null;this.changedCellRepeated=null;this.changedRange=null;this.changedRangeRepeated=null;this.changedDefName=null;this.changedDefNameRepeated=null;this.changedShared={};this.buildCell={};this.buildDefName={};this.buildShared={};this.buildArrayFormula=[];this.buildPivot=[];this.cleanCellCache={};this.lockCounter=0;this.defNames={wb:{},sheet:{}};this.tableNamePattern="Table";this.tableNameIndex= 0;this.pivotNamePattern="PivotTable";this.pivotNameIndex=0}DependencyGraph.prototype={maxSharedRecursion:100,startListeningRange:function(sheetId,bbox,listener){var listenerId=listener.getListenerId();var sheetContainer=this.sheetListeners[sheetId];if(!sheetContainer){sheetContainer={cellMap:{},areaMap:{},defName3d:{},rangesTop:null,rangesBottom:null,cells:null};this.sheetListeners[sheetId]=sheetContainer}if(bbox.isOneCell()){var cellIndex=getCellIndex(bbox.r1,bbox.c1);var cellMapElem=sheetContainer.cellMap[cellIndex]; if(!cellMapElem){cellMapElem={cellIndex:cellIndex,count:0,listeners:{}};sheetContainer.cellMap[cellIndex]=cellMapElem;sheetContainer.cells=null}if(!cellMapElem.listeners[listenerId]){cellMapElem.listeners[listenerId]=listener;cellMapElem.count++}}else{var vertexIndex=getVertexIndex(bbox);var areaSheetElem=sheetContainer.areaMap[vertexIndex];if(!areaSheetElem){bbox=bbox.clone();areaSheetElem={bbox:bbox,count:0,listeners:{},isActive:true};if(true)areaSheetElem.sharedBroadcast={changedBBox:null,prevChangedBBox:null, recursion:0};sheetContainer.areaMap[vertexIndex]=areaSheetElem;sheetContainer.rangesTop=null;sheetContainer.rangesBottom=null}if(!areaSheetElem.listeners[listenerId]){areaSheetElem.listeners[listenerId]=listener;areaSheetElem.count++}}},endListeningRange:function(sheetId,bbox,listener){var listenerId=listener.getListenerId();if(null!=listenerId){var sheetContainer=this.sheetListeners[sheetId];if(sheetContainer)if(bbox.isOneCell()){var cellIndex=getCellIndex(bbox.r1,bbox.c1);var cellMapElem=sheetContainer.cellMap[cellIndex]; if(cellMapElem&&cellMapElem.listeners[listenerId]){delete cellMapElem.listeners[listenerId];cellMapElem.count--;if(cellMapElem.count<=0){delete sheetContainer.cellMap[cellIndex];sheetContainer.cells=null}}}else{var vertexIndex=getVertexIndex(bbox);var areaSheetElem=sheetContainer.areaMap[vertexIndex];if(areaSheetElem&&areaSheetElem.listeners[listenerId]){delete areaSheetElem.listeners[listenerId];areaSheetElem.count--;if(areaSheetElem.count<=0){delete sheetContainer.areaMap[vertexIndex];sheetContainer.rangesTop= null;sheetContainer.rangesBottom=null}}}}},startListeningVolatile:function(listener){var listenerId=listener.getListenerId();this.volatileListeners[listenerId]=listener},endListeningVolatile:function(listener){var listenerId=listener.getListenerId();if(null!=listenerId)delete this.volatileListeners[listenerId]},startListeningDefName:function(name,listener,opt_sheetId){var listenerId=listener.getListenerId();var nameIndex=getDefNameIndex(name);var container=this.defNameListeners[nameIndex];if(!container){container= {count:0,listeners:{}};this.defNameListeners[nameIndex]=container}if(!container.listeners[listenerId]){container.listeners[listenerId]=listener;container.count++}if(opt_sheetId){var sheetContainer=this.sheetListeners[opt_sheetId];if(!sheetContainer){sheetContainer={cellMap:{},areaMap:{},defName3d:{},rangesTop:null,rangesBottom:null,cells:null};this.sheetListeners[opt_sheetId]=sheetContainer}sheetContainer.defName3d[listenerId]=listener}},isListeningDefName:function(name){return null!=this.defNameListeners[getDefNameIndex(name)]}, endListeningDefName:function(name,listener,opt_sheetId){var listenerId=listener.getListenerId();if(null!=listenerId){var nameIndex=getDefNameIndex(name);var container=this.defNameListeners[nameIndex];if(container&&container.listeners[listenerId]){delete container.listeners[listenerId];container.count--;if(container.count<=0)delete this.defNameListeners[nameIndex]}if(opt_sheetId){var sheetContainer=this.sheetListeners[opt_sheetId];if(sheetContainer)delete sheetContainer.defName3d[listenerId]}}},deleteNodes:function(sheetId, bbox){this.buildDependency();this._shiftMoveDelete(c_oNotifyType.Delete,sheetId,bbox,null);this.addToChangedRange(sheetId,bbox)},shift:function(sheetId,bbox,offset){this.buildDependency();return this._shiftMoveDelete(c_oNotifyType.Shift,sheetId,bbox,offset)},move:function(sheetId,bboxFrom,offset,sheetIdTo){this.buildDependency();this._shiftMoveDelete(c_oNotifyType.Move,sheetId,bboxFrom,offset,sheetIdTo);this.addToChangedRange(sheetId,bboxFrom)},prepareChangeSheet:function(sheetId,data,tableNamesMap){this.buildDependency(); var listeners={};var sheetContainer=this.sheetListeners[sheetId];if(sheetContainer){for(var cellIndex in sheetContainer.cellMap){var cellMapElem=sheetContainer.cellMap[cellIndex];for(var listenerId in cellMapElem.listeners)listeners[listenerId]=cellMapElem.listeners[listenerId]}for(var vertexIndex in sheetContainer.areaMap){var areaSheetElem=sheetContainer.areaMap[vertexIndex];for(var listenerId in areaSheetElem.listeners)listeners[listenerId]=areaSheetElem.listeners[listenerId]}for(var listenerId in sheetContainer.defName3d)listeners[listenerId]= sheetContainer.defName3d[listenerId]}if(tableNamesMap)for(var tableName in tableNamesMap){var nameIndex=getDefNameIndex(tableName);var container=this.defNameListeners[nameIndex];if(container)for(var listenerId in container.listeners)listeners[listenerId]=container.listeners[listenerId]}var notifyData={type:c_oNotifyType.Prepare,actionType:c_oNotifyType.ChangeSheet,data:data,transformed:{},preparedData:{}};for(var listenerId in listeners)listeners[listenerId].notify(notifyData);for(var listenerId in notifyData.transformed)if(notifyData.transformed.hasOwnProperty(listenerId)){delete listeners[listenerId]; var elems=notifyData.transformed[listenerId];for(var i=0;i<elems.length;++i){var elem=elems[i];listeners[elem.getListenerId()]=elem;elem.notify(notifyData)}}return{listeners:listeners,data:data,preparedData:notifyData.preparedData}},changeSheet:function(prepared){var notifyData={type:c_oNotifyType.ChangeSheet,data:prepared.data,preparedData:prepared.preparedData};for(var listenerId in prepared.listeners)prepared.listeners[listenerId].notify(notifyData)},prepareRemoveSheet:function(sheetId,tableNames){var t= this;var ws=this.wb.getWorksheetById(sheetId);var formulas=[];ws.getAllFormulas(formulas);for(var i=0;i<formulas.length;++i)formulas[i].removeDependencies();this._foreachDefNameSheet(sheetId,function(defName){if(!defName.type!==Asc.c_oAscDefNameType.table)t._removeDefName(sheetId,defName.name,AscCH.historyitem_Workbook_DefinedNamesChangeUndo)});var tableNamesMap={};var i;for(i=0;i<tableNames.length;++i){var tableName=tableNames[i];this._removeDefName(null,tableName,null);tableNamesMap[tableName]= 1;this.wb.deleteSlicersByTable(tableName,true)}if(ws.aSlicers)for(i=0;i<ws.aSlicers.length;i++)ws.deleteSlicer(ws.aSlicers[i].name,true);return this.prepareChangeSheet(sheetId,{remove:sheetId,tableNamesMap:tableNamesMap},tableNamesMap)},removeSheet:function(prepared){this.changeSheet(prepared)},lockRecal:function(){++this.lockCounter},isLockRecal:function(){return this.lockCounter>0},unlockRecal:function(){if(0<this.lockCounter)--this.lockCounter;if(0>=this.lockCounter)this.calcTree()},lockRecalExecute:function(callback){this.lockRecal(); callback();this.unlockRecal()},getDefNameByName:function(name,sheetId,opt_exact){var res=null;var nameIndex=getDefNameIndex(name);if(sheetId){var sheetContainer=this.defNames.sheet[sheetId];if(sheetContainer)res=sheetContainer[nameIndex]}if(!res&&!(opt_exact&&sheetId))res=this.defNames.wb[nameIndex];return res},getDefNameByNodeId:function(nodeId){getFromDefNameId(nodeId);return this.getDefNameByName(g_FDNI.name,g_FDNI.sheetId,true)},getDefNameByRef:function(ref,sheetId,bLocale){var getByRef=function(defName){if(!defName.hidden&& defName.ref==ref)return defName.name};var res=this._foreachDefNameSheet(sheetId,getByRef);if(res&&bLocale)res=AscCommon.translateManager.getValue(res);if(!res)res=this._foreachDefNameBook(getByRef);return res},getDefinedNamesWB:function(type,bLocale,excludeErrorRefNames){var names=[],activeWS;function getNames(defName){if(defName.ref&&!defName.hidden&&defName.name.indexOf("_xlnm")<0){if(excludeErrorRefNames&&defName.parsedRef&&defName.parsedRef.outStack){var _stack=defName.parsedRef.outStack;for(var i= 0;i<_stack.length;i++)if(_stack[i]&&cElementType.error===_stack[i].type)return}names.push(defName.getAscCDefName(bLocale))}}function sort(a,b){if(a.name>b.name)return 1;else if(a.name<b.name)return-1;else return 0}switch(type){case c_oAscGetDefinedNamesList.Worksheet:case c_oAscGetDefinedNamesList.WorksheetWorkbook:activeWS=this.wb.getActiveWs();this._foreachDefNameSheet(activeWS.getId(),getNames);if(c_oAscGetDefinedNamesList.WorksheetWorkbook)this._foreachDefNameBook(getNames);break;case c_oAscGetDefinedNamesList.All:default:this._foreachDefName(getNames); break}return names.sort(sort)},getDefinedNamesWS:function(sheetId){var names=[];function getNames(defName){if(defName.ref)names.push(defName)}this._foreachDefNameSheet(sheetId,getNames);return names},addDefNameOpen:function(name,ref,sheetIndex,hidden,type){var sheetId=this.wb.getSheetIdByIndex(sheetIndex);var isXLNM=null;var XLNMName=this._checkXlnmName(name);if(null!==XLNMName){name=XLNMName;isXLNM=true}var defName=new DefName(this.wb,name,ref,sheetId,hidden,type,isXLNM);this._addDefName(defName); return defName},_checkXlnmName:function(name){var supportName={"Print_Area":1,"Print_Titles":1};var prefix="_xlnm.";var parseName=name.split(prefix)[1];if(supportName[parseName])return parseName;return null},addDefName:function(name,ref,sheetId,hidden,type,isXLNM){var defName=new DefName(this.wb,name,ref,sheetId,hidden,type,isXLNM);defName.setRef(defName.ref,true);this._addDefName(defName);return defName},removeDefName:function(sheetId,name){this._removeDefName(sheetId,name,AscCH.historyitem_Workbook_DefinedNamesChange)}, editDefinesNames:function(oldUndoName,newUndoName){var res=null;var isSlicer=oldUndoName&&this.wb.getSlicerCacheByCacheName(oldUndoName.name);if(!AscCommon.rx_defName.test(getDefNameIndex(newUndoName.name))||!newUndoName.ref&&!isSlicer||newUndoName.ref.length===0&&!isSlicer||newUndoName.name.length>g_nDefNameMaxLength)return res;if(oldUndoName)res=this.getDefNameByName(oldUndoName.name,oldUndoName.sheetId);else res=this.addDefName(newUndoName.name,newUndoName.ref,newUndoName.sheetId,false,newUndoName.type, newUndoName.isXLNM);History.Create_NewPoint();if(res&&oldUndoName)if(oldUndoName.name!=newUndoName.name){this.buildDependency();res=this._delDefName(res.name,res.sheetId);res.setUndoDefName(newUndoName,isSlicer);this._addDefName(res);var notifyData={type:c_oNotifyType.ChangeDefName,from:oldUndoName,to:newUndoName};this._broadcastDefName(oldUndoName.name,notifyData);this.addToChangedDefName(res)}else res.setUndoDefName(newUndoName);History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_DefinedNamesChange, null,null,new UndoRedoData_FromTo(oldUndoName,newUndoName));return res},checkDefName:function(name,sheetIndex){var res=new Asc.asc_CCheckDefName;var range=AscCommonExcel.g_oRangeCache.getRange3D(name)||AscCommonExcel.g_oRangeCache.getAscRange(name);if(!range)AscCommonExcel.executeInR1C1Mode(!AscCommonExcel.g_R1C1Mode,function(){range=AscCommonExcel.g_oRangeCache.getRange3D(name)||AscCommonExcel.g_oRangeCache.getAscRange(name)});if(range||!AscCommon.rx_defName.test(name.toLowerCase())||name.length> g_nDefNameMaxLength){res.status=false;res.reason=c_oAscDefinedNameReason.WrongName;return res}var sheetId=this.wb.getSheetIdByIndex(sheetIndex);var defName=this.getDefNameByName(name,sheetId,true);if(defName){res.status=false;if(defName.isLock)res.reason=c_oAscDefinedNameReason.IsLocked;else res.reason=c_oAscDefinedNameReason.Existed}else if(this.isListeningDefName(name)){res.status=false;res.reason=c_oAscDefinedNameReason.NameReserved}else{res.status=true;res.reason=c_oAscDefinedNameReason.OK}return res}, copyDefNameByWorksheet:function(wsFrom,wsTo,renameParams,opt_sheet){var sheetContainerFrom;var opt_df=opt_sheet&&opt_sheet.workbook&&opt_sheet.workbook.dependencyFormulas?opt_sheet.workbook.dependencyFormulas:null;if(opt_df&&opt_df.defNames&&opt_df.defNames.sheet&&opt_df.defNames.sheet[wsFrom.getId()])sheetContainerFrom=opt_df.defNames.sheet[wsFrom.getId()];else sheetContainerFrom=this.defNames.sheet[wsFrom.getId()];if(sheetContainerFrom)for(var name in sheetContainerFrom){var defNameOld=sheetContainerFrom[name]; if(defNameOld.type!==Asc.c_oAscDefNameType.table&&defNameOld.parsedRef){var parsedRefNew=defNameOld.parsedRef.clone();parsedRefNew.renameSheetCopy(renameParams);var refNew=parsedRefNew.assemble(true);this.addDefName(defNameOld.name,refNew,wsTo.getId(),defNameOld.hidden,defNameOld.type)}}},copyDefNameByWorkbook:function(wsFrom,wsTo,renameParams,opt_sheet){var t=this;var opt_wb=opt_sheet&&opt_sheet.workbook;var opt_df=opt_wb&&opt_wb.dependencyFormulas;var doCopy=function(_sheetContainerFrom){if(_sheetContainerFrom)for(var name in _sheetContainerFrom){var defNameOld= _sheetContainerFrom[name];if(defNameOld.type!==Asc.c_oAscDefNameType.table&&defNameOld.parsedRef){var parsedRefNew=defNameOld.parsedRef.clone();parsedRefNew.renameSheetCopy(renameParams);var refNew=parsedRefNew.assemble(true);var _newDefName=new Asc.asc_CDefName(defNameOld.name,refNew,null,defNameOld.type,defNameOld.hidden);t.wb.editDefinesNames(null,_newDefName)}}};if(opt_df)doCopy(opt_df.defNames.wb)},saveDefName:function(isCopySheet){var list=[];var t=this;this._foreachDefName(function(defName){if(defName.type!== Asc.c_oAscDefNameType.table&&defName.ref)if(!isCopySheet||t._checkDefNamesCopySheet(defName))list.push(defName.getAscCDefName())});return list},_checkDefNamesCopySheet:function(defName){var res=true;var ws=this.wb.getActiveWs();if(defName.sheetId&&defName.sheetId!==ws.Id)return false;if(defName.type===Asc.c_oAscDefNameType.slicer)return false;var parsedRef=defName.parsedRef;if(parsedRef)for(var i=0;i<parsedRef.outStack.length;i++){var elem=parsedRef.outStack[i];if(cElementType.cell===elem.type||cElementType.cellsRange=== elem.type||cElementType.cell3D===elem.type||cElementType.cellsRange3D===elem.type)if(elem.getWS().getName()!==ws.getName())return false}return res},unlockDefName:function(){this._foreachDefName(function(defName){defName.isLock=null})},unlockCurrentDefName:function(name,sheetId){var defName=this.getDefNameByName(name,sheetId);if(defName)defName.isLock=null},checkDefNameLock:function(){return this._foreachDefName(function(defName){return defName.isLock})},getNextTableName:function(){var sNewName;var collaborativeIndexUser= "";if(this.wb.oApi.collaborativeEditing.getCollaborativeEditing())collaborativeIndexUser="_"+this.wb.oApi.CoAuthoringApi.get_indexUser();do{this.tableNameIndex++;var tableName=AscCommon.translateManager.getValue(this.tableNamePattern);sNewName=tableName+this.tableNameIndex+collaborativeIndexUser}while(this.getDefNameByName(sNewName,null)||this.isListeningDefName(sNewName));return sNewName},getNextPivotName:function(){var sNewName;do{this.pivotNameIndex++;var tableName=AscCommon.translateManager.getValue(this.pivotNamePattern); sNewName=tableName+this.pivotNameIndex}while(this.wb.getPivotTableByName(sNewName));return sNewName},addTableName:function(ws,table,opt_isOpen){var ref=table.getRangeWithoutHeaderFooter();var defNameRef=parserHelp.get3DRef(ws.getName(),ref.getAbsName());var defName=this.getDefNameByName(table.DisplayName,null);if(!defName)if(opt_isOpen)this.addDefNameOpen(table.DisplayName,defNameRef,null,null,Asc.c_oAscDefNameType.table);else this.addDefName(table.DisplayName,defNameRef,null,null,Asc.c_oAscDefNameType.table); else defName.setRef(defNameRef)},changeTableRef:function(table){var defName=this.getDefNameByName(table.DisplayName,null);if(defName){this.buildDependency();var oldUndoName=defName.getUndoDefName();var newUndoName=defName.getUndoDefName();var ref=table.getRangeWithoutHeaderFooter();newUndoName.ref=defName.ref.split("!")[0]+"!"+ref.getAbsName();History.TurnOff();this.editDefinesNames(oldUndoName,newUndoName);var notifyData={type:c_oNotifyType.ChangeDefName,from:oldUndoName,to:newUndoName};this._broadcastDefName(defName.name, notifyData);History.TurnOn();this.addToChangedDefName(defName);this.calcTree()}},changeTableName:function(tableName,newName){var defName=this.getDefNameByName(tableName,null);if(defName){var oldUndoName=defName.getUndoDefName();var newUndoName=defName.getUndoDefName();newUndoName.name=newName;History.TurnOff();this.editDefinesNames(oldUndoName,newUndoName);History.TurnOn()}},delTableName:function(tableName,bConvertTableFormulaToRef){this.buildDependency();var defName=this.getDefNameByName(tableName); this.addToChangedDefName(defName);var notifyData={type:c_oNotifyType.ChangeDefName,from:defName.getUndoDefName(),to:null,bConvertTableFormulaToRef:bConvertTableFormulaToRef};this._broadcastDefName(tableName,notifyData);this._delDefName(tableName,null);if(defName)defName.removeDependencies()},delColumnTable:function(tableName,deleted){this.buildDependency();var notifyData={type:c_oNotifyType.DelColumnTable,tableName:tableName,deleted:deleted};this._broadcastDefName(tableName,notifyData)},renameTableColumn:function(tableName){var defName= this.getDefNameByName(tableName,null);if(defName){this.buildDependency();var notifyData={type:c_oNotifyType.RenameTableColumn,tableName:tableName};this._broadcastDefName(defName.name,notifyData)}this.calcTree()},addToChangedRange2:function(sheetId,bbox){if(!this.changedRange)this.changedRange={};var changedSheet=this.changedRange[sheetId];if(!changedSheet){changedSheet={};this.changedRange[sheetId]=changedSheet}var name=getVertexIndex(bbox);if(this.isInCalc&&!changedSheet[name]){if(!this.changedRangeRepeated)this.changedRangeRepeated= {};var changedSheetRepeated=this.changedRangeRepeated[sheetId];if(!changedSheetRepeated){changedSheetRepeated={};this.changedRangeRepeated[sheetId]=changedSheetRepeated}changedSheetRepeated[name]=bbox}changedSheet[name]=bbox},addToChangedCell:function(cell){var t=this;var sheetId=cell.ws.getId();if(!this.changedCell)this.changedCell={};var changedSheet=this.changedCell[sheetId];if(!changedSheet){changedSheet={};this.changedCell[sheetId]=changedSheet}var addChangedSheet=function(row,col){var cellIndex= getCellIndex(row,col);if(t.isInCalc&&undefined===changedSheet[cellIndex]){if(!t.changedCellRepeated)t.changedCellRepeated={};var changedSheetRepeated=t.changedCellRepeated[sheetId];if(!changedSheetRepeated){changedSheetRepeated={};t.changedCellRepeated[sheetId]=changedSheetRepeated}changedSheetRepeated[cellIndex]=cellIndex}changedSheet[cellIndex]=cellIndex};addChangedSheet(cell.nRow,cell.nCol)},addToChangedDefName:function(defName){if(!this.changedDefName)this.changedDefName={};var nodeId=defName.getNodeId(); if(this.isInCalc&&!this.changedDefName[nodeId]){if(!this.changedDefNameRepeated)this.changedDefNameRepeated={};this.changedDefNameRepeated[nodeId]=1}this.changedDefName[nodeId]=1},addToChangedRange:function(sheetId,bbox){var notifyData={type:c_oNotifyType.Dirty};var sheetContainer=this.sheetListeners[sheetId];if(sheetContainer){for(var cellIndex in sheetContainer.cellMap){getFromCellIndex(cellIndex);if(bbox.contains(g_FCI.col,g_FCI.row)){var cellMapElem=sheetContainer.cellMap[cellIndex];for(var listenerId in cellMapElem.listeners)cellMapElem.listeners[listenerId].notify(notifyData)}}for(var areaIndex in sheetContainer.areaMap){var areaMapElem= sheetContainer.areaMap[areaIndex];var isIntersect=bbox.isIntersect(areaMapElem.bbox);if(isIntersect)for(var listenerId in areaMapElem.listeners)areaMapElem.listeners[listenerId].notify(notifyData)}}},addToChangedHiddenRows:function(){var tmpRange=new Asc.Range(0,0,gc_nMaxCol0,0);for(var i=0;i<this.wb.aWorksheets.length;++i){var ws=this.wb.aWorksheets[i];var hiddenRange=ws.hiddenManager.getHiddenRowsRange();if(hiddenRange){tmpRange.r1=hiddenRange.r1;tmpRange.r2=hiddenRange.r2;this.addToChangedRange(ws.getId(), tmpRange)}}},addToBuildDependencyCell:function(cell){var sheetId=cell.ws.getId();var unparsedSheet=this.buildCell[sheetId];if(!unparsedSheet){unparsedSheet={};this.buildCell[sheetId]=unparsedSheet}unparsedSheet[getCellIndex(cell.nRow,cell.nCol)]=1},addToBuildDependencyDefName:function(defName){this.buildDefName[defName.getNodeId()]=1},addToBuildDependencyShared:function(shared){this.buildShared[shared.getIndexNumber()]=shared},addToBuildDependencyArray:function(f){this.buildArrayFormula.push(f)}, addToBuildDependencyPivot:function(f){this.buildPivot.push(f)},addToCleanCellCache:function(sheetId,row,col){var sheetArea=this.cleanCellCache[sheetId];if(sheetArea)sheetArea.union3(col,row);else this.cleanCellCache[sheetId]=new Asc.Range(col,row,col,row)},addToChangedShared:function(parsed){this.changedShared[parsed.getIndexNumber()]=parsed},notifyChanged:function(changedFormulas){var notifyData={type:c_oNotifyType.Dirty};for(var listenerId in changedFormulas)changedFormulas[listenerId].notify(notifyData)}, buildDependency:function(){for(var sheetId in this.buildCell){var ws=this.wb.getWorksheetById(sheetId);if(ws){var unparsedSheet=this.buildCell[sheetId];for(var cellIndex in unparsedSheet){getFromCellIndex(cellIndex);ws._getCellNoEmpty(g_FCI.row,g_FCI.col,function(cell){if(cell)cell._BuildDependencies(true,true)})}}}for(var defNameId in this.buildDefName){var defName=this.getDefNameByNodeId(defNameId);if(defName&&defName.parsedRef){defName.parsedRef.parse();defName.parsedRef.buildDependencies();this.addToChangedDefName(defName)}}for(var index in this.buildShared)if(this.buildShared.hasOwnProperty(index)){var parsed= this.wb.workbookFormulas.get(index-0);if(parsed){parsed.parse();parsed.buildDependencies();var shared=parsed.getShared();this.wb.dependencyFormulas.addToChangedRange2(parsed.getWs().getId(),shared.ref)}}for(var index=0;index<this.buildArrayFormula.length;++index){var parsed=this.buildArrayFormula[index];if(parsed){parsed.parse();parsed.buildDependencies();var array=parsed.getArrayFormulaRef();this.wb.dependencyFormulas.addToChangedRange2(parsed.getWs().getId(),array)}}for(var index=0;index<this.buildPivot.length;++index){var parsed= this.buildPivot[index];if(parsed){parsed.parse();parsed.buildDependencies()}}this.buildCell={};this.buildDefName={};this.buildShared={};this.buildArrayFormula=[];this.buildPivot=[]},calcTree:function(){if(this.lockCounter>0)return;this.buildDependency();this.addToChangedHiddenRows();if(!(this.changedCell||this.changedRange||this.changedDefName))return;var notifyData={type:c_oNotifyType.Dirty,areaData:undefined};this._broadscastVolatile(notifyData);this._broadcastCellsStart();while(this.changedCellRepeated|| this.changedRangeRepeated||this.changedDefNameRepeated){this._broadcastDefNames(notifyData);this._broadcastCells(notifyData);this._broadcastRanges(notifyData)}this._broadcastCellsEnd();this._calculateDirty();this.updateSharedFormulas();var tmpCellCache=this.cleanCellCache;this.cleanCellCache={};for(var i in tmpCellCache)this.wb.handlers.trigger("cleanCellCache",i,[tmpCellCache[i]],true);AscCommonExcel.g_oVLOOKUPCache.clean();AscCommonExcel.g_oHLOOKUPCache.clean();AscCommonExcel.g_oMatchCache.clean(); AscCommonExcel.g_oSUMIFSCache.clean()},initOpen:function(){this._foreachDefName(function(defName){defName.setRef(defName.ref,true,true,true)})},getSnapshot:function(wb){var res=new DependencyGraph(wb);this._foreachDefName(function(defName){res._addDefName(defName.clone(wb))});res.tableNameIndex=this.tableNameIndex;return res},getAllFormulas:function(formulas){this._foreachDefName(function(defName){if(defName.parsedRef)formulas.push(defName.parsedRef)})},updateSharedFormulas:function(){var newRef; for(var indexNumber in this.changedShared){var parsed=this.changedShared[indexNumber];var shared=parsed.getShared();if(shared){var ws=parsed.getWs();var ref=shared.ref;var r1=gc_nMaxRow0;var c1=gc_nMaxCol0;var r2=0;var c2=0;ws.getRange3(ref.r1,ref.c1,ref.r2,ref.c2)._foreachNoEmpty(function(cell){if(parsed===cell.getFormulaParsed()){r1=Math.min(r1,cell.nRow);c1=Math.min(c1,cell.nCol);r2=Math.max(r2,cell.nRow);c2=Math.max(c2,cell.nCol)}});newRef=undefined;if(r1<=r2&&c1<=c2)newRef=new Asc.Range(c1,r1, c2,r2);parsed.setSharedRef(newRef)}}this.changedShared={}},_addDefName:function(defName){var nameIndex=getDefNameIndex(defName.name);var container;var sheetId=defName.sheetId;if(sheetId){container=this.defNames.sheet[sheetId];if(!container){container={};this.defNames.sheet[sheetId]=container}}else container=this.defNames.wb;var cur=container[nameIndex];if(cur)cur.removeDependencies();container[nameIndex]=defName},_removeDefName:function(sheetId,name,historyType){var defName=this._delDefName(name, sheetId);if(defName){if(null!=historyType){History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorkbook,historyType,null,null,new UndoRedoData_FromTo(defName.getUndoDefName(),null))}defName.removeDependencies();this.addToChangedDefName(defName)}},_delDefName:function(name,sheetId){var res=null;var nameIndex=getDefNameIndex(name);var sheetContainer;if(sheetId)sheetContainer=this.defNames.sheet[sheetId];else sheetContainer=this.defNames.wb;if(sheetContainer){res=sheetContainer[nameIndex]; delete sheetContainer[nameIndex]}return res},_foreachDefName:function(action){var containerSheet;var sheetId;var name;var res;for(sheetId in this.defNames.sheet){containerSheet=this.defNames.sheet[sheetId];for(name in containerSheet){res=action(containerSheet[name],containerSheet);if(res)break}}if(!res)res=this._foreachDefNameBook(action);return res},_foreachDefNameSheet:function(sheetId,action){var name;var res;var containerSheet=this.defNames.sheet[sheetId];if(containerSheet)for(name in containerSheet){res= action(containerSheet[name],containerSheet);if(res)break}return res},_foreachDefNameBook:function(action){var containerSheet;var name;var res;for(name in this.defNames.wb){res=action(this.defNames.wb[name],this.defNames.wb);if(res)break}return res},_broadscastVolatile:function(notifyData){for(var i in this.volatileListeners)this.volatileListeners[i].notify(notifyData)},_broadcastDefName:function(name,notifyData){var nameIndex=getDefNameIndex(name);var container=this.defNameListeners[nameIndex];if(container)for(var listenerId in container.listeners)container.listeners[listenerId].notify(notifyData)}, _broadcastDefNames:function(notifyData){if(this.changedDefNameRepeated){var changedDefName=this.changedDefNameRepeated;this.changedDefNameRepeated=null;for(var nodeId in changedDefName){getFromDefNameId(nodeId);this._broadcastDefName(g_FDNI.name,notifyData)}}},_broadcastCells:function(notifyData){if(this.changedCellRepeated){var changedCell=this.changedCellRepeated;this.changedCellRepeated=null;for(var sheetId in changedCell){var changedSheet=changedCell[sheetId];var sheetContainer=this.sheetListeners[sheetId]; if(sheetContainer){var cells=[];for(var cellIndex in changedSheet)cells.push(changedSheet[cellIndex]);cells.sort(AscCommon.fSortAscending);this._broadcastCellsByCells(sheetContainer,cells,notifyData);this._broadcastRangesByCells(sheetContainer,cells,notifyData)}}}},_broadcastRanges:function(notifyData){if(this.changedRangeRepeated){var changedRange=this.changedRangeRepeated;this.changedRangeRepeated=null;for(var sheetId in changedRange){var changedSheet=changedRange[sheetId];var sheetContainer=this.sheetListeners[sheetId]; if(sheetContainer)if(sheetContainer){var rangesTop=[];var rangesBottom=[];for(var name in changedSheet){var range=changedSheet[name];rangesTop.push(range);rangesBottom.push(range)}rangesTop.sort(Asc.Range.prototype.compareByLeftTop);rangesBottom.sort(Asc.Range.prototype.compareByRightBottom);this._broadcastCellsByRanges(sheetContainer,rangesTop,rangesBottom,notifyData);this._broadcastRangesByRanges(sheetContainer,rangesTop,rangesBottom,notifyData)}}}},_broadcastCellsStart:function(){this.isInCalc= true;this.changedCellRepeated=this.changedCell;this.changedRangeRepeated=this.changedRange;this.changedDefNameRepeated=this.changedDefName;for(var sheetId in this.sheetListeners){var sheetContainer=this.sheetListeners[sheetId];if(!sheetContainer.cells){sheetContainer.cells=[];for(var cellIndex in sheetContainer.cellMap)sheetContainer.cells.push(sheetContainer.cellMap[cellIndex]);sheetContainer.cells.sort(function(a,b){return a.cellIndex-b.cellIndex})}if(!sheetContainer.rangesTop||!sheetContainer.rangesBottom){sheetContainer.rangesTop= [];sheetContainer.rangesBottom=[];for(var name in sheetContainer.areaMap){var elem=sheetContainer.areaMap[name];sheetContainer.rangesTop.push(elem);sheetContainer.rangesBottom.push(elem)}sheetContainer.rangesTop.sort(function(a,b){return Asc.Range.prototype.compareByLeftTop(a.bbox,b.bbox)});sheetContainer.rangesBottom.sort(function(a,b){return Asc.Range.prototype.compareByRightBottom(a.bbox,b.bbox)})}}},_broadcastCellsEnd:function(){this.isInCalc=false;this.changedDefName=null;for(var i=0;i<this.tempGetByCells.length;++i)for(var j= 0;j<this.tempGetByCells[i].length;++j){var temp=this.tempGetByCells[i][j];temp.isActive=true;if(temp.sharedBroadcast){temp.sharedBroadcast.changedBBox=null;temp.sharedBroadcast.prevChangedBBox=null;temp.sharedBroadcast.recursion=0}}this.tempGetByCells=[]},_calculateDirty:function(){var t=this;this._foreachChanged(function(cell){if(cell&&cell.isFormula())cell.setIsDirty(true)});this._foreachChanged(function(cell){cell&&cell._checkDirty()});this.changedCell=null;this.changedRange=null},_foreachChanged:function(callback){var sheetId, changedSheet,ws,bbox;for(sheetId in this.changedCell)if(this.changedCell.hasOwnProperty(sheetId)){changedSheet=this.changedCell[sheetId];ws=this.wb.getWorksheetById(sheetId);if(changedSheet&&ws)for(var cellIndex in changedSheet)if(changedSheet.hasOwnProperty(cellIndex)){getFromCellIndex(cellIndex);ws._getCell(g_FCI.row,g_FCI.col,callback)}}for(sheetId in this.changedRange)if(this.changedRange.hasOwnProperty(sheetId)){changedSheet=this.changedRange[sheetId];ws=this.wb.getWorksheetById(sheetId);if(changedSheet&& ws)for(var name in changedSheet)if(changedSheet.hasOwnProperty(name)){bbox=changedSheet[name];ws.getRange3(bbox.r1,bbox.c1,bbox.r2,bbox.c2)._foreachNoEmpty(callback)}}},_shiftMoveDelete:function(notifyType,sheetId,bbox,offset,sheetIdTo){var listeners={};var res={changed:listeners,shiftedShared:{}};var sheetContainer=this.sheetListeners[sheetId];if(sheetContainer){var bboxShift;if(c_oNotifyType.Shift===notifyType){var bHor=0!==offset.col;bboxShift=AscCommonExcel.shiftGetBBox(bbox,bHor)}var isIntersect; for(var cellIndex in sheetContainer.cellMap){getFromCellIndex(cellIndex);if(c_oNotifyType.Shift===notifyType)isIntersect=bboxShift.contains(g_FCI.col,g_FCI.row);else isIntersect=bbox.contains(g_FCI.col,g_FCI.row);if(isIntersect){var cellMapElem=sheetContainer.cellMap[cellIndex];for(var listenerId in cellMapElem.listeners)listeners[listenerId]=cellMapElem.listeners[listenerId]}}for(var areaIndex in sheetContainer.areaMap){var areaMapElem=sheetContainer.areaMap[areaIndex];if(c_oNotifyType.Shift===notifyType)isIntersect= bboxShift.isIntersect(areaMapElem.bbox);else if(c_oNotifyType.Move===notifyType||c_oNotifyType.Delete===notifyType)isIntersect=bbox.isIntersect(areaMapElem.bbox);if(isIntersect)for(var listenerId in areaMapElem.listeners)listeners[listenerId]=areaMapElem.listeners[listenerId]}var notifyData={type:notifyType,sheetId:sheetId,sheetIdTo:sheetIdTo,bbox:bbox,offset:offset,shiftedShared:res.shiftedShared};for(var listenerId in listeners)listeners[listenerId].notify(notifyData)}return res},_broadcastCellsByCells:function(sheetContainer, cellsChanged,notifyData){var cells=sheetContainer.cells;var indexCell=0;var indexCellChanged=0;var row,col,rowChanged,colChanged;if(indexCell<cells.length){getFromCellIndex(cells[indexCell].cellIndex);row=g_FCI.row;col=g_FCI.col}if(indexCellChanged<cellsChanged.length){getFromCellIndex(cellsChanged[indexCellChanged]);rowChanged=g_FCI.row;colChanged=g_FCI.col}while(indexCell<cells.length&&indexCellChanged<cellsChanged.length){var cmp=Asc.Range.prototype.compareCell(col,row,colChanged,rowChanged);if(cmp> 0){indexCellChanged++;if(indexCellChanged<cellsChanged.length){getFromCellIndex(cellsChanged[indexCellChanged]);rowChanged=g_FCI.row;colChanged=g_FCI.col}}else{if(0===cmp)this._broadcastNotifyListeners(cells[indexCell].listeners,notifyData);indexCell++;if(indexCell<cells.length){getFromCellIndex(cells[indexCell].cellIndex);row=g_FCI.row;col=g_FCI.col}}}},_broadcastRangesByCells:function(sheetContainer,cells,notifyData){if(0===sheetContainer.rangesTop.length||0===cells.length)return;var rangesTop= sheetContainer.rangesTop;var rangesBottom=sheetContainer.rangesBottom;var indexTop=0;var indexBottom=0;var indexCell=0;var tree=new AscCommon.DataIntervalTree;var affected=[];var curY,elem;if(indexCell<cells.length)getFromCellIndex(cells[indexCell]);while(indexBottom<rangesBottom.length&&indexCell<cells.length){if(indexTop<rangesTop.length)curY=Math.min(rangesTop[indexTop].bbox.r1,rangesBottom[indexBottom].bbox.r2);else curY=rangesBottom[indexBottom].bbox.r2;while(indexCell<cells.length&&g_FCI.row< curY){this._broadcastRangesByCellsIntersect(tree,g_FCI.row,g_FCI.col,affected);indexCell++;if(indexCell<cells.length)getFromCellIndex(cells[indexCell])}while(indexTop<rangesTop.length&&curY===rangesTop[indexTop].bbox.r1){elem=rangesTop[indexTop];if(elem.isActive)tree.insert(elem.bbox.c1,elem.bbox.c2,elem);indexTop++}while(indexCell<cells.length&&g_FCI.row<=curY){this._broadcastRangesByCellsIntersect(tree,g_FCI.row,g_FCI.col,affected);indexCell++;if(indexCell<cells.length)getFromCellIndex(cells[indexCell])}while(indexBottom< rangesBottom.length&&curY===rangesBottom[indexBottom].bbox.r2){elem=rangesBottom[indexBottom];if(elem.isActive)tree.remove(elem.bbox.c1,elem.bbox.c2,elem);indexBottom++}}this._broadcastNotifyRanges(affected,notifyData)},_broadcastCellsByRanges:function(sheetContainer,rangesTop,rangesBottom,notifyData){if(0===sheetContainer.cells.length||0===rangesTop.length)return;var cells=sheetContainer.cells;var indexTop=0;var indexBottom=0;var indexCell=0;var tree=new AscCommon.DataIntervalTree;var curY,bbox; if(indexCell<cells.length)getFromCellIndex(cells[indexCell].cellIndex);while(indexBottom<rangesBottom.length&&indexCell<cells.length){if(indexTop<rangesTop.length)curY=Math.min(rangesTop[indexTop].r1,rangesBottom[indexBottom].r2);else curY=rangesBottom[indexBottom].r2;while(indexCell<cells.length&&g_FCI.row<curY){if(tree.searchAny(g_FCI.col,g_FCI.col))this._broadcastNotifyListeners(cells[indexCell].listeners,notifyData);indexCell++;if(indexCell<cells.length)getFromCellIndex(cells[indexCell].cellIndex)}while(indexTop< rangesTop.length&&curY===rangesTop[indexTop].r1){bbox=rangesTop[indexTop];tree.insert(bbox.c1,bbox.c2,bbox);indexTop++}while(indexCell<cells.length&&g_FCI.row<=curY){if(tree.searchAny(g_FCI.col,g_FCI.col))this._broadcastNotifyListeners(cells[indexCell].listeners,notifyData);indexCell++;if(indexCell<cells.length)getFromCellIndex(cells[indexCell].cellIndex)}while(indexBottom<rangesBottom.length&&curY===rangesBottom[indexBottom].r2){bbox=rangesBottom[indexBottom];tree.remove(bbox.c1,bbox.c2,bbox);indexBottom++}}}, _broadcastRangesByRanges:function(sheetContainer,rangesTopChanged,rangesBottomChanged,notifyData){if(0===sheetContainer.rangesTop.length||0===rangesTopChanged.length)return;var rangesTop=sheetContainer.rangesTop;var rangesBottom=sheetContainer.rangesBottom;var indexTop=0;var indexBottom=0;var indexTopChanged=0;var indexBottomChanged=0;var tree=new AscCommon.DataIntervalTree;var treeChanged=new AscCommon.DataIntervalTree;var affected=[];var curY,elem,bbox;while(indexBottom<rangesBottom.length&&indexBottomChanged< rangesBottomChanged.length){curY=Math.min(rangesBottomChanged[indexBottomChanged].r2,rangesBottom[indexBottom].bbox.r2);if(indexTop<rangesTop.length)curY=Math.min(curY,rangesTop[indexTop].bbox.r1);if(indexTopChanged<rangesTopChanged.length)curY=Math.min(curY,rangesTopChanged[indexTopChanged].r1);while(indexTopChanged<rangesTopChanged.length&&curY===rangesTopChanged[indexTopChanged].r1){bbox=rangesTopChanged[indexTopChanged];treeChanged.insert(bbox.c1,bbox.c2,bbox);this._broadcastRangesByRangesIntersect(bbox, tree,affected);indexTopChanged++}while(indexTop<rangesTop.length&&curY===rangesTop[indexTop].bbox.r1){elem=rangesTop[indexTop];if(elem.isActive){tree.insert(elem.bbox.c1,elem.bbox.c2,elem);if(treeChanged.searchAny(elem.bbox.c1,elem.bbox.c2))this._broadcastNotifyListeners(elem.listeners,notifyData)}indexTop++}while(indexBottomChanged<rangesBottomChanged.length&&curY===rangesBottomChanged[indexBottomChanged].r2){bbox=rangesBottomChanged[indexBottomChanged];treeChanged.remove(bbox.c1,bbox.c2,bbox);indexBottomChanged++}while(indexBottom< rangesBottom.length&&curY===rangesBottom[indexBottom].bbox.r2){elem=rangesBottom[indexBottom];if(elem.isActive)tree.remove(elem.bbox.c1,elem.bbox.c2,elem);indexBottom++}}this._broadcastNotifyRanges(affected,notifyData)},_broadcastRangesByCellsIntersect:function(tree,row,col,output){var intervals=tree.searchNodes(col,col);for(var i=0;i<intervals.length;++i){var interval=intervals[i];var elem=interval.data;var sharedBroadcast=elem.sharedBroadcast;if(!sharedBroadcast){output.push(elem);elem.isActive= false;tree.remove(elem.bbox.c1,elem.bbox.c2,elem)}else if(!(sharedBroadcast.changedBBox&&sharedBroadcast.changedBBox.contains(col,row))){if(!sharedBroadcast.changedBBox||sharedBroadcast.changedBBox.isEqual(sharedBroadcast.prevChangedBBox)){sharedBroadcast.recursion++;if(sharedBroadcast.recursion>=this.maxSharedRecursion)sharedBroadcast.changedBBox=elem.bbox.clone();output.push(elem)}if(sharedBroadcast.changedBBox)sharedBroadcast.changedBBox.union3(col,row);else sharedBroadcast.changedBBox=new Asc.Range(col, row,col,row);if(sharedBroadcast.changedBBox.isEqual(elem.bbox)){elem.isActive=false;tree.remove(elem.bbox.c1,elem.bbox.c2,elem)}}}},_broadcastRangesByRangesIntersect:function(bbox,tree,output){var intervals=tree.searchNodes(bbox.c1,bbox.c2);for(var i=0;i<intervals.length;++i){var interval=intervals[i];var elem=interval.data;if(elem){var intersect=elem.bbox.intersectionSimple(bbox);var sharedBroadcast=elem.sharedBroadcast;if(!sharedBroadcast){output.push(elem);elem.isActive=false;tree.remove(elem.bbox.c1, elem.bbox.c2,elem)}else if(!(sharedBroadcast.changedBBox&&sharedBroadcast.changedBBox.containsRange(intersect))){if(!sharedBroadcast.changedBBox||sharedBroadcast.changedBBox.isEqual(sharedBroadcast.prevChangedBBox)){sharedBroadcast.recursion++;if(sharedBroadcast.recursion>=this.maxSharedRecursion)sharedBroadcast.changedBBox=elem.bbox.clone();output.push(elem)}if(sharedBroadcast.changedBBox)sharedBroadcast.changedBBox.union2(intersect);else sharedBroadcast.changedBBox=intersect;if(sharedBroadcast.changedBBox.isEqual(elem.bbox)){elem.isActive= false;tree.remove(elem.bbox.c1,elem.bbox.c2,elem)}}}}},_broadcastNotifyRanges:function(affected,notifyData){var areaData={bbox:null,changedBBox:null};for(var i=0;i<affected.length;++i){var elem=affected[i];var shared=elem.sharedBroadcast;if(shared&&shared.changedBBox){areaData.bbox=elem.bbox;notifyData.areaData=areaData;if(!shared.prevChangedBBox){areaData.changedBBox=shared.changedBBox;this._broadcastNotifyListeners(elem.listeners,notifyData)}else{var ranges=shared.prevChangedBBox.difference(shared.changedBBox); for(var j=0;j<ranges.length;++j){areaData.changedBBox=ranges[j];this._broadcastNotifyListeners(elem.listeners,notifyData)}}notifyData.areaData=undefined;shared.prevChangedBBox=shared.changedBBox.clone()}else this._broadcastNotifyListeners(elem.listeners,notifyData)}this.tempGetByCells.push(affected)},_broadcastNotifyListeners:function(listeners,notifyData){for(var listenerId in listeners)listeners[listenerId].notify(notifyData)}};function ForwardTransformationFormula(elem,formula,parsed){this.elem= elem;this.formula=formula;this.parsed=parsed}ForwardTransformationFormula.prototype={onFormulaEvent:function(type,eventData){if(AscCommon.c_oNotifyParentType.ChangeFormula===type)this.formula=eventData.assemble}};function angleFormatToInterface(val){var nRes=0;if(0<=val&&val<=180)nRes=val<=90?val:90-val;return nRes}function angleFormatToInterface2(val){if(g_nVerticalTextAngle==val)return val;else return angleFormatToInterface(val)}function angleInterfaceToFormat(val){var nRes=val;if(-90<=val&&val<= 90){if(val<0)nRes=90-val}else if(g_nVerticalTextAngle!=val)nRes=0;return nRes}function getUniqueKeys(array){var i,o={};for(i=0;i<array.length;++i)o[array[i].v]=o.hasOwnProperty(array[i].v);return o}function CT_Workbook(){this.sheets=null;this.pivotCaches=null}CT_Workbook.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("workbook"===elem){if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("sheets"===elem)this.sheets=[];else if("sheet"===elem){newContext=new CT_Sheet; if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.sheets.push(newContext)}else if("pivotCaches"===elem)this.pivotCaches=[];else if("pivotCache"===elem){newContext=new CT_PivotCache;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotCaches.push(newContext)}else newContext=null;return newContext};function CT_Sheet(){this.id=null}CT_Sheet.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["r:id"];if(undefined!==val)this.id= AscCommon.unleakString(uq(val))}};function CT_PivotCache(){this.cacheId=null;this.id=null}CT_PivotCache.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["cacheId"];if(undefined!==val)this.cacheId=val-0;val=vals["r:id"];if(undefined!==val)this.id=AscCommon.unleakString(uq(val))}};function Workbook(eventsHandlers,oApi){this.oApi=oApi;this.handlers=eventsHandlers;this.dependencyFormulas=new DependencyGraph(this);this.nActive=0;this.App=null;this.Core=null;this.CustomProperties= null;this.theme=null;this.clrSchemeMap=null;this.CellStyles=new AscCommonExcel.CCellStyles;this.TableStyles=new Asc.CTableStyles;this.SlicerStyles=new Asc.CSlicerStyles;this.oStyleManager=new AscCommonExcel.StyleManager;this.sharedStrings=new AscCommonExcel.CSharedStrings;this.workbookFormulas=new AscCommonExcel.CWorkbookFormulas;this.loadCells=[];this.DrawingDocument=new AscCommon.CDrawingDocument;this.aComments=[];this.aWorksheets=[];this.aWorksheetsById={};this.aCollaborativeActions=[];this.bCollaborativeChanges= false;this.bUndoChanges=false;this.bRedoChanges=false;this.aCollaborativeChangeElements=[];this.externalReferences=[];this.calcPr={calcId:null,calcMode:null,fullCalcOnLoad:null,refMode:null,iterate:null,iterateCount:null,iterateDelta:null,fullPrecision:null,calcCompleted:null,calcOnSave:null,concurrentCalc:null,concurrentManualCount:null,forceFullCalc:null};this.connections=null;this.wsHandlers=null;this.openErrors=[];this.maxDigitWidth=0;this.paddingPlusBorder=0;this.lastFindOptions=null;this.lastFindCells= {};this.addingWorksheet=null}Workbook.prototype.init=function(tableCustomFunc,tableIds,sheetIds,bNoBuildDep,bSnapshot){if(this.nActive<0)this.nActive=0;if(this.nActive>=this.aWorksheets.length)this.nActive=this.aWorksheets.length-1;var self=this;this.wsHandlers=new AscCommonExcel.asc_CHandlersList({"changeRefTablePart":function(table){self.dependencyFormulas.changeTableRef(table)},"changeColumnTablePart":function(tableName){self.dependencyFormulas.renameTableColumn(tableName)},"deleteColumnTablePart":function(tableName, deleted){self.dependencyFormulas.delColumnTable(tableName,deleted);var wsActive=self.getActiveWs();if(wsActive)wsActive.deleteSlicersByTableCol(tableName,deleted)},"onFilterInfo":function(){self.handlers.trigger("asc_onFilterInfo")}});for(var i=0,length=tableCustomFunc.length;i<length;++i){var elem=tableCustomFunc[i];elem.column.applyTotalRowFormula(elem.formula,elem.ws,!bNoBuildDep)}this.forEach(function(ws){ws.initPostOpen(self.wsHandlers,tableIds,sheetIds)});var wsActive=this.getActiveWs();if(wsActive&& wsActive.getHidden())wsActive.setHidden(false);if(!bNoBuildDep)this.dependencyFormulas.initOpen();if(bSnapshot)this.snapshot=this._getSnapshot()};Workbook.prototype.initPostOpenZip=function(pivotCaches){var t=this;this.forEach(function(ws){ws.initPostOpenZip(pivotCaches,t.oNumFmtsOpen)})};Workbook.prototype.setCommonIndexObjectsFrom=function(wb){this.oStyleManager=wb.oStyleManager;this.sharedStrings=wb.sharedStrings;this.workbookFormulas=wb.workbookFormulas};Workbook.prototype.forEach=function(callback, isCopyPaste){if(isCopyPaste||isCopyPaste===false)callback(this.getActiveWs(),this.getActive());else for(var i=0,l=this.aWorksheets.length;i<l;++i)callback(this.aWorksheets[i],i)};Workbook.prototype.rebuildColors=function(){AscCommonExcel.g_oColorManager.rebuildColors();this.forEach(function(ws){ws.rebuildColors()})};Workbook.prototype.getDefaultFont=function(){return g_oDefaultFormat.Font.getName()};Workbook.prototype.getDefaultSize=function(){return g_oDefaultFormat.Font.getSize()};Workbook.prototype.getActive= function(){return this.nActive};Workbook.prototype.getActiveWs=function(){return this.getWorksheet(this.nActive)};Workbook.prototype.setActive=function(index){if(index>=0&&index<this.aWorksheets.length){this.nActive=index;this.cleanFindResults();return true}return false};Workbook.prototype.setActiveById=function(sheetId){var ws=this.getWorksheetById(sheetId);if(!ws&&Array.isArray(this.aWorksheets))ws=this.aWorksheets[this.aWorksheets.length-1];return this.setActive(ws.getIndex())};Workbook.prototype.getSheetIdByIndex= function(index){var ws=this.getWorksheet(index);return ws?ws.getId():null};Workbook.prototype.getWorksheet=function(index){if(index>=0&&index<this.aWorksheets.length)return this.aWorksheets[index];return null};Workbook.prototype.getWorksheetById=function(id){if(this.aWorksheetsById[id])return this.aWorksheetsById[id];var s;this.aWorksheets.some(function(_s){if(_s.Id===id){s=_s;return true}});return s};Workbook.prototype.getWorksheetByName=function(name){for(var i=0;i<this.aWorksheets.length;i++)if(this.aWorksheets[i].getName()== name)return this.aWorksheets[i];return null};Workbook.prototype.getWorksheetIndexByName=function(name){for(var i=0;i<this.aWorksheets.length;i++)if(this.aWorksheets[i].getName()==name)return i;return null};Workbook.prototype.getWorksheetCount=function(){return this.aWorksheets.length};Workbook.prototype.createWorksheet=function(indexBefore,sName,sId){this.dependencyFormulas.lockRecal();History.Create_NewPoint();History.TurnOff();var wsActive=this.getActiveWs();var oNewWorksheet=new Worksheet(this, this.aWorksheets.length,sId);if(this.checkValidSheetName(sName))oNewWorksheet.sName=sName;oNewWorksheet.initPostOpen(this.wsHandlers,{});if(null!=indexBefore&&indexBefore>=0&&indexBefore<this.aWorksheets.length)this.aWorksheets.splice(indexBefore,0,oNewWorksheet);else{indexBefore=this.aWorksheets.length;this.aWorksheets.push(oNewWorksheet)}this.aWorksheetsById[oNewWorksheet.getId()]=oNewWorksheet;this._updateWorksheetIndexes(wsActive);History.TurnOn();this._insertWorksheetFormula(oNewWorksheet.index); History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_SheetAdd,null,null,new UndoRedoData_SheetAdd(indexBefore,oNewWorksheet.getName(),null,oNewWorksheet.getId()));History.SetSheetUndo(wsActive.getId());History.SetSheetRedo(oNewWorksheet.getId());this.dependencyFormulas.unlockRecal();return oNewWorksheet};Workbook.prototype.copyWorksheet=function(index,insertBefore,sName,sId,bFromRedo,tableNames,opt_sheet,opt_base64){var renameParams;if(index>=0&&index<this.aWorksheets.length){this.dependencyFormulas.buildDependency(); History.TurnOff();var wsActive=this.getActiveWs();var wsFrom=opt_sheet?opt_sheet:this.aWorksheets[index];var newSheet=new Worksheet(this,-1,sId);if(null!=insertBefore&&insertBefore>=0&&insertBefore<this.aWorksheets.length)this.aWorksheets.splice(insertBefore,0,newSheet);else this.aWorksheets.push(newSheet);if(opt_sheet)this.addingWorksheet=newSheet;this.aWorksheetsById[newSheet.getId()]=newSheet;this._updateWorksheetIndexes(wsActive);renameParams=newSheet.copyFrom(wsFrom,sName,tableNames);newSheet.copyFromFormulas(renameParams); newSheet.initPostOpen(this.wsHandlers,{},{});History.TurnOn();this.dependencyFormulas.copyDefNameByWorksheet(wsFrom,newSheet,renameParams,opt_sheet);if(opt_sheet)this.dependencyFormulas.copyDefNameByWorkbook(wsFrom,newSheet,renameParams,opt_sheet);this._insertWorksheetFormula(insertBefore);if(!tableNames)tableNames=newSheet.getTableNames();History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_SheetAdd,null,null,new UndoRedoData_SheetAdd(insertBefore,newSheet.getName(),wsFrom.getId(), newSheet.getId(),tableNames,opt_base64));History.SetSheetUndo(wsActive.getId());History.SetSheetRedo(newSheet.getId());newSheet.copyFromAfterInsert(wsFrom);if(!(bFromRedo===true)){wsFrom.copyObjects(newSheet,renameParams);var i;if(wsFrom.aNamedSheetViews)for(i=0;i<wsFrom.aNamedSheetViews.length;++i)newSheet.addNamedSheetView(wsFrom.aNamedSheetViews[i].clone(renameParams.tableNameMap));if(wsFrom.dataValidations&&wsFrom.dataValidations.elems)for(i=0;i<wsFrom.dataValidations.elems.length;++i)newSheet.addDataValidation(wsFrom.dataValidations.elems[i].clone(), true)}this.sortDependency();if(opt_sheet)this.addingWorksheet=null}return renameParams};Workbook.prototype.insertWorksheet=function(index,sheet){var wsActive=this.getActiveWs();if(null!=index&&index>=0&&index<this.aWorksheets.length)this.aWorksheets.splice(index,0,sheet);else this.aWorksheets.push(sheet);this.aWorksheetsById[sheet.getId()]=sheet;this._updateWorksheetIndexes(wsActive);this._insertWorksheetFormula(index);this._insertTablePartsName(sheet);sheet._BuildDependencies(sheet.getCwf());this.sortDependency()}; Workbook.prototype._insertTablePartsName=function(sheet){if(sheet&&sheet.TableParts&&sheet.TableParts.length)for(var i=0;i<sheet.TableParts.length;i++){var tablePart=sheet.TableParts[i];this.dependencyFormulas.addTableName(sheet,tablePart);tablePart.buildDependencies()}};Workbook.prototype._insertWorksheetFormula=function(index){if(index>0&&index<this.aWorksheets.length){var oWsBefore=this.aWorksheets[index-1];this.dependencyFormulas.changeSheet(this.dependencyFormulas.prepareChangeSheet(oWsBefore.getId(), {insert:index}))}};Workbook.prototype.replaceWorksheet=function(indexFrom,indexTo){if(indexFrom>=0&&indexFrom<this.aWorksheets.length&&indexTo>=0&&indexTo<this.aWorksheets.length){var wsActive=this.getActiveWs();var oWsFrom=this.aWorksheets[indexFrom];var tempW={wF:oWsFrom,wFI:indexFrom,wTI:indexTo};if(tempW.wFI<tempW.wTI)tempW.wTI++;this.dependencyFormulas.lockRecal();var prepared=this.dependencyFormulas.prepareChangeSheet(oWsFrom.getId(),{replace:tempW},null);var movedSheet=this.aWorksheets.splice(indexFrom, 1);this.aWorksheets.splice(indexTo,0,movedSheet[0]);this._updateWorksheetIndexes(wsActive);this.dependencyFormulas.changeSheet(prepared);this._insertWorksheetFormula(indexTo);History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_SheetMove,null,null,new UndoRedoData_FromTo(indexFrom,indexTo));this.dependencyFormulas.unlockRecal()}};Workbook.prototype.findSheetNoHidden=function(nIndex){var i,ws,oRes=null,bFound=false,countWorksheets=this.getWorksheetCount();for(i=nIndex;i<countWorksheets;++i){ws= this.getWorksheet(i);if(false===ws.getHidden()){oRes=ws;bFound=true;break}}if(!bFound)for(i=nIndex-1;i>=0;--i){ws=this.getWorksheet(i);if(false===ws.getHidden()){oRes=ws;break}}return oRes};Workbook.prototype.removeWorksheet=function(nIndex,outputParams){var bEmpty=true;for(var i=0,length=this.aWorksheets.length;i<length;++i){var worksheet=this.aWorksheets[i];if(false==worksheet.getHidden()&&i!=nIndex){bEmpty=false;break}}if(bEmpty)return-1;var removedSheet=this.getWorksheet(nIndex);if(removedSheet){var removedSheetId= removedSheet.getId();this.dependencyFormulas.lockRecal();var prepared=this.dependencyFormulas.prepareRemoveSheet(removedSheetId,removedSheet.getTableNames());var wsActive=this.getActiveWs();var oVisibleWs=null;this.aWorksheets.splice(nIndex,1);delete this.aWorksheetsById[removedSheetId];if(nIndex==this.getActive()){oVisibleWs=this.findSheetNoHidden(nIndex);if(null!=oVisibleWs)wsActive=oVisibleWs}History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_SheetRemove,null,null,new AscCommonExcel.UndoRedoData_SheetRemove(nIndex, removedSheetId,removedSheet));if(null!=oVisibleWs){History.SetSheetUndo(removedSheetId);History.SetSheetRedo(wsActive.getId())}if(null!=outputParams)outputParams.sheet=removedSheet;this._updateWorksheetIndexes(wsActive);this.dependencyFormulas.removeSheet(prepared);this.dependencyFormulas.unlockRecal();return wsActive.getIndex()}return-1};Workbook.prototype._updateWorksheetIndexes=function(wsActive){this.forEach(function(ws,index){ws._setIndex(index)});if(null!=wsActive)this.setActive(wsActive.getIndex())}; Workbook.prototype.checkUniqueSheetName=function(name){var workbookSheetCount=this.getWorksheetCount();for(var i=0;i<workbookSheetCount;i++)if(this.getWorksheet(i).getName()==name)return i;return-1};Workbook.prototype.checkValidSheetName=function(name){return name&&name.length<g_nSheetNameMaxLength};Workbook.prototype.getUniqueSheetNameFrom=function(name,bCopy){var nIndex=1;var sNewName="";var fGetPostfix=null;if(bCopy){var result=/^(.*)\((\d)\)$/.exec(name);if(result){fGetPostfix=function(nIndex){return"("+ nIndex+")"};name=result[1]}else{fGetPostfix=function(nIndex){return" ("+nIndex+")"};name=name}}else fGetPostfix=function(nIndex){return nIndex.toString()};var workbookSheetCount=this.getWorksheetCount();while(nIndex<1E4){var sPosfix=fGetPostfix(nIndex);sNewName=name+sPosfix;if(sNewName.length>g_nSheetNameMaxLength){name=name.substring(0,g_nSheetNameMaxLength-sPosfix.length);sNewName=name+sPosfix}var bUniqueName=true;for(var i=0;i<workbookSheetCount;i++)if(this.getWorksheet(i).getName()==sNewName){bUniqueName= false;break}if(bUniqueName)break;nIndex++}return sNewName};Workbook.prototype._generateFontMap=function(){var oFontMap={"Arial":1};var i;oFontMap[g_oDefaultFormat.Font.getName()]=1;if(null!=this.theme)AscFormat.checkThemeFonts(oFontMap,this.theme.themeElements.fontScheme);for(i=1;i<=g_StyleCache.getXfCount();++i){var xf=g_StyleCache.getXf(i);if(xf.font)oFontMap[xf.font.getName()]=1}this.sharedStrings.generateFontMap(oFontMap);this.forEach(function(ws){ws.generateFontMap(oFontMap)});this.CellStyles.generateFontMap(oFontMap); return oFontMap};Workbook.prototype.generateFontMap=function(){var oFontMap=this._generateFontMap();var aRes=[];for(var i in oFontMap)aRes.push(i);return aRes};Workbook.prototype.generateFontMap2=function(){var oFontMap=this._generateFontMap();var aRes=[];for(var i in oFontMap)aRes.push(new AscFonts.CFont(i,0,"",0));AscFonts.FontPickerByCharacter.extendFonts(aRes);return aRes};Workbook.prototype.getAllImageUrls=function(){var aImageUrls=[];this.forEach(function(ws){ws.getAllImageUrls(aImageUrls)}); return aImageUrls};Workbook.prototype.reassignImageUrls=function(oImages){this.forEach(function(ws){ws.reassignImageUrls(oImages)})};Workbook.prototype.calculate=function(type,sheetId){var formulas;if(type===Asc.c_oAscCalculateType.All){formulas=this.getAllFormulas();for(var i=0;i<formulas.length;++i){var formula=formulas[i];formula.removeDependencies();formula.setFormula(formula.getFormula());formula.parse();formula.buildDependencies()}}else if(type===Asc.c_oAscCalculateType.ActiveSheet){formulas= [];var ws=sheetId!==undefined?this.getWorksheetById(sheetId):this.getActiveWs();ws.getAllFormulas(formulas);sheetId=ws.getId()}else formulas=this.getAllFormulas();this.dependencyFormulas.notifyChanged(formulas);this.dependencyFormulas.calcTree();History.Create_NewPoint();History.StartTransaction();History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_Calculate,sheetId,null,new AscCommonExcel.UndoRedoData_SingleProperty(type));History.EndTransaction()};Workbook.prototype.checkDefName= function(checkName,scope){return this.dependencyFormulas.checkDefName(checkName,scope)};Workbook.prototype.getDefinedNamesWB=function(defNameListId,bLocale,excludeErrorRefNames){return this.dependencyFormulas.getDefinedNamesWB(defNameListId,bLocale,excludeErrorRefNames)};Workbook.prototype.getDefinedNamesWS=function(sheetId){return this.dependencyFormulas.getDefinedNamesWS(sheetId)};Workbook.prototype.addDefName=function(name,ref,sheetId,hidden,isTable){return this.dependencyFormulas.addDefName(name, ref,sheetId,hidden,isTable)};Workbook.prototype.getDefinesNames=function(name,sheetId){return this.dependencyFormulas.getDefNameByName(name,sheetId)};Workbook.prototype.getDefinedName=function(name){var sheetId=this.getSheetIdByIndex(name.LocalSheetId);return this.dependencyFormulas.getDefNameByName(name.Name,sheetId)};Workbook.prototype.delDefinesNames=function(defName){this.delDefinesNamesUndoRedo(this.getUndoDefName(defName))};Workbook.prototype.delDefinesNamesUndoRedo=function(defName){this.dependencyFormulas.removeDefName(defName.sheetId, defName.name);this.dependencyFormulas.calcTree()};Workbook.prototype.editDefinesNames=function(oldName,newName){return this.editDefinesNamesUndoRedo(this.getUndoDefName(oldName),this.getUndoDefName(newName))};Workbook.prototype.editDefinesNamesUndoRedo=function(oldName,newName){var res=this.dependencyFormulas.editDefinesNames(oldName,newName);this.dependencyFormulas.calcTree();return res};Workbook.prototype.findDefinesNames=function(ref,sheetId,bLocale){return this.dependencyFormulas.getDefNameByRef(ref, sheetId,bLocale)};Workbook.prototype.unlockDefName=function(){this.dependencyFormulas.unlockDefName()};Workbook.prototype.unlockCurrentDefName=function(name,sheetId){this.dependencyFormulas.unlockCurrentDefName(name,sheetId)};Workbook.prototype.checkDefNameLock=function(){return this.dependencyFormulas.checkDefNameLock()};Workbook.prototype._SerializeHistoryBase64=function(oMemory,item,aPointChangesBase64){if(!item.LocalChange){var nPosStart=oMemory.GetCurPosition();item.Serialize(oMemory,this.oApi.collaborativeEditing); var nPosEnd=oMemory.GetCurPosition();var nLen=nPosEnd-nPosStart;if(nLen>0)aPointChangesBase64.push(nLen+";"+oMemory.GetBase64Memory2(nPosStart,nLen))}};Workbook.prototype.SerializeHistory=function(){var aRes=[];var t,j,length2;AscCommon.CollaborativeEditing.Refresh_DCChanges();var aActions=this.aCollaborativeActions.concat(History.GetSerializeArray());if(aActions.length>0){var oMemory=new AscCommon.CMemory;for(var i=0,length=aActions.length;i<length;++i){var aPointChanges=aActions[i];for(j=0,length2= aPointChanges.length;j<length2;++j){var item=aPointChanges[j];this._SerializeHistoryBase64(oMemory,item,aRes)}}this.aCollaborativeActions=[];this.snapshot=this._getSnapshot()}return aRes};Workbook.prototype._getSnapshot=function(){var wb=new Workbook(new AscCommonExcel.asc_CHandlersList,this.oApi);wb.dependencyFormulas=this.dependencyFormulas.getSnapshot(wb);this.forEach(function(ws){ws=ws.getSnapshot(wb);wb.aWorksheets.push(ws);wb.aWorksheetsById[ws.getId()]=ws});wb.init({},{},{},true,false);return wb}; Workbook.prototype.getAllFormulas=function(needReturnCellProps){var res=[];this.dependencyFormulas.getAllFormulas(res);this.forEach(function(ws){ws.getAllFormulas(res,needReturnCellProps)});return res};Workbook.prototype._forwardTransformation=function(wbSnapshot,changesMine,changesTheir){History.TurnOff();var res1=this._forwardTransformationGetTransform(wbSnapshot,changesTheir,changesMine);var res2=this._forwardTransformationGetTransform(wbSnapshot,changesMine,changesTheir);var i,elem,elemWrap;for(i= 0;i<res1.modify.length;++i){elemWrap=res1.modify[i];elem=elemWrap.elem;elem.oClass.forwardTransformationSet(elem.nActionType,elem.oData,elem.nSheetId,elemWrap)}for(i=0;i<res2.modify.length;++i){elemWrap=res2.modify[i];elem=elemWrap.elem;elem.oClass.forwardTransformationSet(elem.nActionType,elem.oData,elem.nSheetId,elemWrap)}for(var oldName in res1.renameSheet){var ws=this.getWorksheetByName(oldName);if(ws)ws.setName(res1.renameSheet[oldName])}History.TurnOn()};Workbook.prototype._forwardTransformationGetTransform= function(wbSnapshot,changesMaster,changesModify){var res={modify:[],renameSheet:{}};var changesMasterSelected=[];var i,elem;if(changesModify.length>0)for(i=0;i<changesMaster.length;++i){elem=changesMaster[i];if(elem.oClass&&elem.oClass.forwardTransformationIsAffect&&elem.oClass.forwardTransformationIsAffect(elem.nActionType))changesMasterSelected.push(elem)}if(changesMasterSelected.length>0&&changesModify.length>0){var wbSnapshotCur=wbSnapshot._getSnapshot();var formulas=[];for(i=0;i<changesModify.length;++i){elem= changesModify[i];var renameRes=null;if(elem.oClass&&elem.oClass.forwardTransformationGet){var getRes=elem.oClass.forwardTransformationGet(elem.nActionType,elem.oData,elem.nSheetId);if(getRes&&getRes.formula)formulas.push(new ForwardTransformationFormula(elem,getRes.formula,null));if(getRes&&getRes.name)renameRes=this._forwardTransformationRenameStart(wbSnapshotCur._getSnapshot(),changesMasterSelected,getRes)}if(elem.oClass&&elem.oClass.forwardTransformationIsAffect&&elem.oClass.forwardTransformationIsAffect(elem.nActionType)){if(formulas.length> 0){this._forwardTransformationFormula(wbSnapshotCur._getSnapshot(),formulas,changesMasterSelected,res);formulas=[]}elem.oClass.Redo(elem.nActionType,elem.oData,elem.nSheetId,wbSnapshotCur)}if(renameRes)this._forwardTransformationRenameEnd(renameRes,res.renameSheet,getRes,elem)}this._forwardTransformationFormula(wbSnapshotCur,formulas,changesMasterSelected,res)}return res};Workbook.prototype._forwardTransformationRenameStart=function(wbSnapshot,changes,getRes){var res={newName:null};for(var i=0;i< changes.length;++i){var elem=changes[i];elem.oClass.Redo(elem.nActionType,elem.oData,elem.nSheetId,wbSnapshot)}if(-1!=wbSnapshot.checkUniqueSheetName(getRes.name))res.newName=wbSnapshot.getUniqueSheetNameFrom(getRes.name,true);return res};Workbook.prototype._forwardTransformationRenameEnd=function(renameRes,renameSheet,getRes,elemCur){var isChange=false;if(getRes.from){var renameCur=renameSheet[getRes.from];if(renameCur){delete renameSheet[getRes.from];getRes.from=renameCur;isChange=true}}if(renameRes&& renameRes.newName){renameSheet[getRes.name]=renameRes.newName;getRes.name=renameRes.newName;isChange=true}if(isChange&&elemCur.oClass.forwardTransformationSet)elemCur.oClass.forwardTransformationSet(elemCur.nActionType,elemCur.oData,elemCur.nSheetId,getRes)};Workbook.prototype._forwardTransformationFormula=function(wbSnapshot,formulas,changes,res){if(formulas.length>0){var i,elem,ftFormula,ws;for(i=0;i<formulas.length;++i){ftFormula=formulas[i];ws=wbSnapshot.getWorksheetById(ftFormula.elem.nSheetId); if(!ws)ws=new AscCommonExcel.Worksheet(wbSnapshot,-1);if(ws){ftFormula.parsed=new parserFormula(ftFormula.formula,ftFormula,ws);ftFormula.parsed.parse();ftFormula.parsed.buildDependencies()}}for(var oldName in res.renameSheet){ws=wbSnapshot.getWorksheetByName(oldName);if(ws)ws.setName(res.renameSheet[oldName])}for(i=0;i<changes.length;++i){elem=changes[i];elem.oClass.Redo(elem.nActionType,elem.oData,elem.nSheetId,wbSnapshot)}for(i=0;i<formulas.length;++i){ftFormula=formulas[i];if(ftFormula.parsed){ftFormula.parsed.removeDependencies(); res.modify.push(ftFormula)}}}};Workbook.prototype.DeserializeHistory=function(aChanges,fCallback){var oThis=this;this.aCollaborativeActions=this.aCollaborativeActions.concat(History.GetSerializeArray());if(aChanges.length>0){this.bCollaborativeChanges=true;var dstLen=0;var aIndexes=[],i,length=aChanges.length,sChange;for(i=0;i<length;++i){sChange=aChanges[i];var nIndex=sChange.indexOf(";");if(-1!=nIndex){dstLen+=parseInt(sChange.substring(0,nIndex));nIndex++}aIndexes.push(nIndex)}var pointer=g_memory.Alloc(dstLen); var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var nCurOffset=0;var aUndoRedoElems=[];for(i=0;i<length;++i){sChange=aChanges[i];var oBinaryFileReader=new AscCommonExcel.BinaryFileReader;nCurOffset=oBinaryFileReader.getbase64DecodedData2(sChange,aIndexes[i],stream,nCurOffset);var item=new UndoRedoItemSerializable;item.Deserialize(stream);aUndoRedoElems.push(item)}var wsViews=window["Asc"]["editor"].wb.wsViews;if(oThis.oApi.collaborativeEditing.getFast())AscCommon.CollaborativeEditing.Clear_DocumentPositions(); for(var i in wsViews)if(isRealObject(wsViews[i])&&isRealObject(wsViews[i].objectRender)&&isRealObject(wsViews[i].objectRender.controller)){wsViews[i].endEditChart();if(oThis.oApi.collaborativeEditing.getFast()){var oState=wsViews[i].objectRender.saveStateBeforeLoadChanges();if(oState){if(oState.Pos)AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.Pos);if(oState.StartPos)AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.StartPos);if(oState.EndPos)AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.EndPos)}}wsViews[i].objectRender.controller.resetSelection()}oFormulaLocaleInfo.Parse= false;oFormulaLocaleInfo.DigitSep=false;AscFonts.IsCheckSymbols=true;History.Clear();History.TurnOff();var history=new AscCommon.CHistory;history.init(this);history.Create_NewPoint();history.SetSelection(null);history.SetSelectionRedo(null);var oRedoObjectParam=new AscCommonExcel.RedoObjectParam;history.UndoRedoPrepare(oRedoObjectParam,false);var changesMine=[].concat.apply([],oThis.aCollaborativeActions);oThis._forwardTransformation(oThis.snapshot,changesMine,aUndoRedoElems);oThis.cleanCollaborativeFilterObj(); for(var i=0,length=aUndoRedoElems.length;i<length;++i){var item=aUndoRedoElems[i];if((null!=item.oClass||item.oData&&typeof item.oData.sChangedObjectId==="string")&&null!=item.nActionType){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;AscCommonExcel.executeInR1C1Mode(false,function(){history.RedoAdd(oRedoObjectParam,item.oClass,item.nActionType,item.nSheetId,item.oRange,item.oData)})}}AscFonts.IsCheckSymbols=false;var oFontMap= this._generateFontMap();window["Asc"]["editor"]._loadFonts(oFontMap,function(){if(oThis.oApi.collaborativeEditing.getFast())for(var i in wsViews)if(isRealObject(wsViews[i])&&isRealObject(wsViews[i].objectRender)&&isRealObject(wsViews[i].objectRender.controller)){var oState=wsViews[i].objectRender.getStateBeforeLoadChanges();if(oState){if(oState.Pos)AscCommon.CollaborativeEditing.Update_DocumentPosition(oState.Pos);if(oState.StartPos)AscCommon.CollaborativeEditing.Update_DocumentPosition(oState.StartPos); if(oState.EndPos)AscCommon.CollaborativeEditing.Update_DocumentPosition(oState.EndPos)}wsViews[i].objectRender.loadStateAfterLoadChanges()}oFormulaLocaleInfo.Parse=true;oFormulaLocaleInfo.DigitSep=true;history.UndoRedoEnd(null,oRedoObjectParam,false);History.TurnOn();oThis.bCollaborativeChanges=false;oThis.snapshot=oThis._getSnapshot();if(null!=fCallback)fCallback()})}else if(null!=fCallback)fCallback()};Workbook.prototype.DeserializeHistoryNative=function(oRedoObjectParam,data,isFull){if(null!=data){this.bCollaborativeChanges= true;if(null==oRedoObjectParam){var wsViews=window["Asc"]["editor"].wb.wsViews;for(var i in wsViews)if(isRealObject(wsViews[i])&&isRealObject(wsViews[i].objectRender)&&isRealObject(wsViews[i].objectRender.controller)){wsViews[i].endEditChart();wsViews[i].objectRender.controller.resetSelection()}History.Clear();History.Create_NewPoint();History.SetSelection(null);History.SetSelectionRedo(null);oRedoObjectParam=new AscCommonExcel.RedoObjectParam;History.UndoRedoPrepare(oRedoObjectParam,false)}var stream= new AscCommon.FT_Stream2(data,data.length);stream.obj=null;var _count=stream.GetLong();var _pos=4;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var _len=stream.GetLong();_pos+=4;stream.size=_pos+_len;stream.Seek(_pos);stream.Seek2(_pos);var item=new UndoRedoItemSerializable;item.Deserialize(stream);if((null!=item.oClass||item.oData&&typeof item.oData.sChangedObjectId==="string")&&null!=item.nActionType)AscCommonExcel.executeInR1C1Mode(false, function(){History.RedoAdd(oRedoObjectParam,item.oClass,item.nActionType,item.nSheetId,item.oRange,item.oData)});_pos+=_len;stream.Seek2(_pos);stream.size=data.length}if(isFull){History.UndoRedoEnd(null,oRedoObjectParam,false);History.Clear();oRedoObjectParam=null}this.bCollaborativeChanges=false}return oRedoObjectParam};Workbook.prototype.getTableRangeForFormula=function(name,objectParam){var res=null;for(var i=0,length=this.aWorksheets.length;i<length;++i){var ws=this.aWorksheets[i];res=ws.getTableRangeForFormula(name, objectParam);if(res!==null){res={wsID:ws.getId(),range:res};break}}return res};Workbook.prototype.getTableIndexColumnByName=function(tableName,columnName){var res=null;for(var i=0,length=this.aWorksheets.length;i<length;++i){var ws=this.aWorksheets[i];res=ws.getTableIndexColumnByName(tableName,columnName);if(res!==null){res={wsID:ws.getId(),index:res,name:ws.getTableNameColumnByIndex(tableName,res)};break}}return res};Workbook.prototype.getTableNameColumnByIndex=function(tableName,columnIndex){var res= null;for(var i=0,length=this.aWorksheets.length;i<length;++i){var ws=this.aWorksheets[i];res=ws.getTableNameColumnByIndex(tableName,columnIndex);if(res!==null){res={wsID:ws.getId(),columnName:res};break}}return res};Workbook.prototype.getTableByName=function(tableName,getSheetIndex){var res=null;for(var i=0,length=this.aWorksheets.length;i<length;++i){var ws=this.aWorksheets[i];res=ws.getTableByName(tableName);if(res!==null)return getSheetIndex?{index:i,table:res}:res}return res};Workbook.prototype.getTableByNameAndSheet= function(tableName,wsID){var res=null;var ws=this.getWorksheetById(wsID);return ws.getTableByName(tableName)};Workbook.prototype.updateSparklineCache=function(sheet,ranges){this.forEach(function(ws){ws.updateSparklineCache(sheet,ranges)})};Workbook.prototype.sortDependency=function(){this.dependencyFormulas.calcTree()};Workbook.prototype.charCountToModelColWidth=function(count){if(count<=0)return 0;return Asc.floor((count*this.maxDigitWidth+this.paddingPlusBorder)/this.maxDigitWidth*256)/256};Workbook.prototype.modelColWidthToColWidth= function(mcw){return Asc.floor((256*mcw+Asc.floor(128/this.maxDigitWidth))/256*this.maxDigitWidth)};Workbook.prototype.colWidthToCharCount=function(w){var pxInOneCharacter=this.maxDigitWidth+this.paddingPlusBorder;return w<pxInOneCharacter?1-Asc.floor(100*(pxInOneCharacter-w)/pxInOneCharacter+.49999)/100:Asc.floor((w-this.paddingPlusBorder)/this.maxDigitWidth*100+.5)/100};Workbook.prototype.getUndoDefName=function(ascName){if(!ascName)return ascName;var sheetId=this.getSheetIdByIndex(ascName.LocalSheetId); return new UndoRedoData_DefinedNames(ascName.Name,ascName.Ref,sheetId,ascName.type,ascName.isXLNM)};Workbook.prototype.changeColorScheme=function(sSchemeName){var scheme=AscCommon.getColorSchemeByName(sSchemeName);if(!scheme)scheme=this.theme.getExtraClrScheme(sSchemeName);if(!scheme)return;History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_ChangeColorScheme,null,null,new AscCommonExcel.UndoRedoData_ClrScheme(this.theme.themeElements.clrScheme,scheme)); this.theme.changeColorScheme(scheme);this.rebuildColors();return true};Workbook.prototype.changeColorSchemeByIdx=function(nIdx){var scheme=this.oApi.getColorSchemeByIdx(nIdx);if(!scheme)return;History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_ChangeColorScheme,null,null,new AscCommonExcel.UndoRedoData_ClrScheme(this.theme.themeElements.clrScheme,scheme));this.theme.changeColorScheme(scheme);this.rebuildColors();return true};Workbook.prototype.cleanFindResults= function(){this.lastFindOptions=null;this.lastFindCells={}};Workbook.prototype.findCellText=function(options){var ws=this.getActiveWs();var result=ws.findCellText(options),result2=null;if(!options.scanOnOnlySheet){var key=result&&result.col+"-"+result.row;if(!key||options.isEqual(this.lastFindOptions)&&this.lastFindCells[key]){var i,active=this.getActive(),start=0,end=this.getWorksheetCount();var inc=options.scanForward?+1:-1;for(i=active+inc;i<end&&i>=start;i+=inc){ws=this.getWorksheet(i);if(ws.getHidden())continue; result2=ws.findCellText(options);if(result2)break}if(!result2){if(options.scanForward){i=0;end=active}else{i=end-1;start=active+1}inc*=-1;for(;i<end&&i>=start;i+=inc){ws=this.getWorksheet(i);if(ws.getHidden())continue;result2=ws.findCellText(options);if(result2)break}}if(result2){this.handlers.trigger("undoRedoHideSheet",i);key=result2.col+"-"+result2.row}}if(key){this.lastFindOptions=options.clone();this.lastFindCells[key]=true}}if(!result2&&!result)this.cleanFindResults();return result2||result}; Workbook.prototype.getComment=function(id){if(id){var sheet;for(var i=0;i<this.aWorksheets.length;++i){sheet=this.aWorksheets[i];for(var j=0;j<sheet.aComments.length;++j)if(id===sheet.aComments[j].asc_getGuid())return sheet.aComments[j]}}return null};Workbook.prototype.getPivotTableByName=function(name){for(var i=0,l=this.aWorksheets.length;i<l;++i){var pivot=this.aWorksheets[i].getPivotTableByName(name);if(pivot)return pivot}return null};Workbook.prototype.getPivotTableById=function(id){for(var i= 0,l=this.aWorksheets.length;i<l;++i){var pivot=this.aWorksheets[i].getPivotTableById(id);if(pivot)return pivot}return null};Workbook.prototype.getPivotTablesByCacheId=function(pivotCacheId){var res=[];for(var i=0,l=this.aWorksheets.length;i<l;++i){var pivotTables=this.aWorksheets[i].getPivotTablesByCacheId(pivotCacheId);res=res.concat(pivotTables)}return res};Workbook.prototype.getPivotCacheByDataRef=function(dataRef){for(var i=0,l=this.aWorksheets.length;i<l;++i){var cache=this.aWorksheets[i].getPivotCacheByDataRef(dataRef); if(cache)return cache}return null};Workbook.prototype.getPivotCacheById=function(pivotCacheId,pivotCachesOpen){for(var i=0,l=this.aWorksheets.length;i<l;++i){var cache=this.aWorksheets[i].getPivotCacheById(pivotCacheId,pivotCachesOpen);if(cache)return cache}return null};Workbook.prototype.getSlicerCacheByName=function(name){for(var i=0,l=this.aWorksheets.length;i<l;++i){var cache=this.aWorksheets[i].getSlicerCacheByName(name);if(cache)return cache}return null};Workbook.prototype.getSlicerCacheByCacheName= function(name){for(var i=0,l=this.aWorksheets.length;i<l;++i){var cache=this.aWorksheets[i].getSlicerCacheByCacheName(name);if(cache)return cache}return null};Workbook.prototype.getSlicerCacheByPivotTableFld=function(sheetId,pivotName,fld){var slicerCaches=this.getSlicerCachesByPivotTable(sheetId,pivotName);for(var i=0;i<slicerCaches.length;++i)if(slicerCaches[i].getPivotFieldIndex()===fld)return slicerCaches[i];return null};Workbook.prototype.getSlicerCachesByPivotTable=function(sheetId,pivotName){var res= [];for(var i=0,l=this.aWorksheets.length;i<l;++i){var caches=this.aWorksheets[i].getSlicerCachesByPivotTable(sheetId,pivotName);res=res.concat(caches)}return res};Workbook.prototype.getSlicerCachesByPivotCacheId=function(pivotCacheId){var res=[];for(var i=0,l=this.aWorksheets.length;i<l;++i){var caches=this.aWorksheets[i].getSlicerCachesByPivotCacheId(pivotCacheId);res=res.concat(caches)}return res};Workbook.prototype.getSlicerStyle=function(name){var slicer=this.getSlicerByName(name);if(slicer)return slicer.style; return null};Workbook.prototype.getSlicerByName=function(name){for(var i=0,l=this.aWorksheets.length;i<l;++i){var slicer=this.aWorksheets[i].getSlicerByName(name);if(slicer)return slicer}return null};Workbook.prototype.getSlicerViewByName=function(name){for(var i=0,l=this.aWorksheets.length;i<l;++i){var slicer=this.aWorksheets[i].getSlicerViewByName(name);if(slicer)return slicer}return null};Workbook.prototype.getSlicersByCacheName=function(name){var res=[];for(var i=0,l=this.aWorksheets.length;i< l;++i){var slicers=this.aWorksheets[i].getSlicersByCacheName(name);if(slicers)res=res.concat(slicers)}return res.length?res:null};Workbook.prototype.getDrawingDocument=function(){return this.DrawingDocument};Workbook.prototype.onSlicerUpdate=function(sName){if(AscCommon.isFileBuild())return false;var bRet=false;for(var i=0;i<this.aWorksheets.length;++i)bRet=bRet||this.aWorksheets[i].onSlicerUpdate(sName);return bRet};Workbook.prototype.onSlicerDelete=function(sName){if(AscCommon.isFileBuild())return false; var bRet=false;for(var i=0;i<this.aWorksheets.length;++i)bRet=bRet||this.aWorksheets[i].onSlicerDelete(sName);return bRet};Workbook.prototype.onSlicerLock=function(sName,bLock){if(AscCommon.isFileBuild())return;for(var i=0;i<this.aWorksheets.length;++i)this.aWorksheets[i].onSlicerLock(sName,bLock)};Workbook.prototype.onSlicerChangeName=function(sName,sNewName){if(AscCommon.isFileBuild())return;for(var i=0;i<this.aWorksheets.length;++i)this.aWorksheets[i].onSlicerChangeName(sName,sNewName)};Workbook.prototype.deleteSlicer= function(sName){var bRet=false;for(var i=0;i<this.aWorksheets.length;++i)bRet=bRet||this.aWorksheets[i].deleteSlicer(sName);return bRet};Workbook.prototype.getSlicersByTableName=function(val){var res=null;for(var i=0;i<this.aWorksheets.length;++i){var wsSlicers=this.aWorksheets[i].getSlicersByTableName(val);if(wsSlicers){if(!res)res=[];res=res.concat(wsSlicers)}}return res};Workbook.prototype.slicersUpdateAfterChangeTable=function(name){var slicers=this.getSlicersByTableName(name);if(slicers)for(var j= 0;j<slicers.length;j++)this.onSlicerUpdate(slicers[j].name)};Workbook.prototype.getSlicersByPivotTable=function(sheetId,pivotName){var res=[];for(var i=0;i<this.aWorksheets.length;++i){var slicers=this.aWorksheets[i].getSlicersByPivotTable(sheetId,pivotName);res=res.concat(slicers)}return res};Workbook.prototype.slicersUpdateAfterChangePivotTable=function(sheetId,pivotName){var slicers=this.getSlicersByPivotTable(sheetId,pivotName);for(var j=0;j<slicers.length;j++)this.onSlicerUpdate(slicers[j].name)}; Workbook.prototype.deleteSlicersByPivotTable=function(sheetId,pivotName){var wb=this;var slicerCaches=wb.getSlicerCachesByPivotTable(sheetId,pivotName);slicerCaches.forEach(function(slicerCache){slicerCache.deletePivotTable(sheetId,pivotName);if(0===slicerCache.getPivotTablesCount()){var slicers=wb.getSlicersByCacheName(slicerCache.name);if(slicers)slicers.forEach(function(slicer){wb.deleteSlicer(slicer.name)})}})};Workbook.prototype.deleteSlicersByPivotTableAndFields=function(sheetId,pivotName,cacheFieldsToDelete){var wb= this;var slicerCaches=wb.getSlicerCachesByPivotTable(sheetId,pivotName);slicerCaches.forEach(function(slicerCache){if(cacheFieldsToDelete[slicerCache.getSourceName()]){slicerCache.deletePivotTable(sheetId,pivotName);var slicers=wb.getSlicersByCacheName(slicerCache.name);if(slicers)slicers.forEach(function(slicer){wb.deleteSlicer(slicer.name)})}})};Workbook.prototype.deleteSlicersByTable=function(tableName,doDelDefName){History.Create_NewPoint();History.StartTransaction();for(var i=0;i<this.aWorksheets.length;++i){var wsSlicers= this.aWorksheets[i].getSlicersByTableName(tableName);if(wsSlicers)for(var j=0;j<wsSlicers.length;j++)this.aWorksheets[i].deleteSlicer(wsSlicers[j].name,doDelDefName)}History.EndTransaction()};Workbook.prototype.cleanCollaborativeFilterObj=function(){if(!Asc.CT_NamedSheetView.prototype.asc_getName)return;for(var i=0;i<this.aWorksheets.length;++i)this.aWorksheets[i].autoFilters.cleanCollaborativeObj()};Workbook.prototype.checkCorrectTables=function(){for(var i=0;i<this.aWorksheets.length;++i)this.aWorksheets[i].checkCorrectTables()}; var tempHelp=new ArrayBuffer(8);var tempHelpUnit=new Uint8Array(tempHelp);var tempHelpFloat=new Float64Array(tempHelp);function SheetMemory(structSize,maxIndex){this.data=null;this.count=0;this.structSize=structSize;this.maxIndex=maxIndex}SheetMemory.prototype.checkSize=function(index){var allocatedCount=this.data?this.data.length/this.structSize:0;if(allocatedCount<index+1){var newAllocatedCount=Math.min(Math.max(1.5*this.count>>0,index+1),this.maxIndex+1);if(newAllocatedCount>allocatedCount){var oldData= this.data;this.data=new Uint8Array(newAllocatedCount*this.structSize);if(oldData)this.data.set(oldData)}}this.count=Math.min(Math.max(this.count,index+1),this.maxIndex+1)};SheetMemory.prototype.hasSize=function(index){return index+1<=this.count};SheetMemory.prototype.getSize=function(){return this.count};SheetMemory.prototype.clone=function(){var sheetMemory=new SheetMemory(this.structSize,this.maxIndex);sheetMemory.data=this.data?new Uint8Array(this.data):null;sheetMemory.count=this.count;return sheetMemory}; SheetMemory.prototype.deleteRange=function(start,deleteCount){if(start<this.count){var startOffset=start*this.structSize;if(start+deleteCount<this.count){var endOffset=(start+deleteCount)*this.structSize;this.data.set(this.data.subarray(endOffset),startOffset);this.data.fill(0,(this.count-deleteCount)*this.structSize);this.count-=deleteCount}else{this.data.fill(0,startOffset);this.count=start}}};SheetMemory.prototype.insertRange=function(start,insertCount){if(start<this.count){this.checkSize(this.count- 1+insertCount);var startOffset=start*this.structSize;if(start+insertCount<this.count){var endOffset=(start+insertCount)*this.structSize;var endData=(this.count-insertCount)*this.structSize;this.data.set(this.data.subarray(startOffset,endData),endOffset);this.data.fill(0,startOffset,endOffset)}else this.data.fill(0,startOffset)}};SheetMemory.prototype.copyRange=function(sheetMemory,startFrom,startTo,count){var countCopied=0;if(startFrom<sheetMemory.count){countCopied=Math.min(count,sheetMemory.count- startFrom);this.checkSize(startTo+countCopied);countCopied=Math.min(countCopied,this.count-startTo);if(countCopied>0){var startOffsetFrom=startFrom*this.structSize;var endOffsetFrom=(startFrom+countCopied)*this.structSize;var startOffsetTo=startTo*this.structSize;this.data.set(sheetMemory.data.subarray(startOffsetFrom,endOffsetFrom),startOffsetTo)}}var countErase=Math.min(count-countCopied,this.count-(startTo+countCopied));if(countErase>0){var startOffsetErase=(startTo+countCopied)*this.structSize; var endOffsetErase=(startTo+countCopied+countErase)*this.structSize;this.data.fill(0,startOffsetErase,endOffsetErase)}};SheetMemory.prototype.copyRangeByChunk=function(from,fromCount,to,toCount){if(from<this.count){this.checkSize(to+toCount-1);var fromStartOffset=from*this.structSize;var fromEndOffset=Math.min(from+fromCount,this.count)*this.structSize;var fromSubArray=this.data.subarray(fromStartOffset,fromEndOffset);for(var i=to;i<to+toCount&&i<this.count;i+=fromCount)this.data.set(fromSubArray, i*this.structSize)}};SheetMemory.prototype.clear=function(start,end){end=Math.min(end,this.count);if(start<end)this.data.fill(0,start*this.structSize,end*this.structSize)};SheetMemory.prototype.getUint8=function(index,offset){offset+=index*this.structSize;return this.data[offset]};SheetMemory.prototype.setUint8=function(index,offset,val){offset+=index*this.structSize;this.data[offset]=val};SheetMemory.prototype.getUint16=function(index,offset){offset+=index*this.structSize;return AscFonts.FT_Common.IntToUInt(this.data[offset]| this.data[offset+1]<<8)};SheetMemory.prototype.setUint16=function(index,offset,val){offset+=index*this.structSize;this.data[offset]=val&255;this.data[offset+1]=val>>>8&255};SheetMemory.prototype.getUint32=function(index,offset){offset+=index*this.structSize;return AscFonts.FT_Common.IntToUInt(this.data[offset]|this.data[offset+1]<<8|this.data[offset+2]<<16|this.data[offset+3]<<24)};SheetMemory.prototype.setUint32=function(index,offset,val){offset+=index*this.structSize;this.data[offset]=val&255;this.data[offset+ 1]=val>>>8&255;this.data[offset+2]=val>>>16&255;this.data[offset+3]=val>>>24&255};SheetMemory.prototype.getFloat64=function(index,offset){offset+=index*this.structSize;tempHelpUnit[0]=this.data[offset];tempHelpUnit[1]=this.data[offset+1];tempHelpUnit[2]=this.data[offset+2];tempHelpUnit[3]=this.data[offset+3];tempHelpUnit[4]=this.data[offset+4];tempHelpUnit[5]=this.data[offset+5];tempHelpUnit[6]=this.data[offset+6];tempHelpUnit[7]=this.data[offset+7];return tempHelpFloat[0]};SheetMemory.prototype.setFloat64= function(index,offset,val){offset+=index*this.structSize;tempHelpFloat[0]=val;this.data[offset]=tempHelpUnit[0];this.data[offset+1]=tempHelpUnit[1];this.data[offset+2]=tempHelpUnit[2];this.data[offset+3]=tempHelpUnit[3];this.data[offset+4]=tempHelpUnit[4];this.data[offset+5]=tempHelpUnit[5];this.data[offset+6]=tempHelpUnit[6];this.data[offset+7]=tempHelpUnit[7]};function Worksheet(wb,_index,sId){this.workbook=wb;this.sName=this.workbook.getUniqueSheetNameFrom(g_sNewSheetNamePattern,false);this.bHidden= false;this.oSheetFormatPr=new AscCommonExcel.SheetFormatPr;this.index=_index;this.Id=null!=sId?sId:AscCommon.g_oIdCounter.Get_NewId();this.nRowsCount=0;this.nColsCount=0;this.rowsData=new SheetMemory(AscCommonExcel.g_nRowStructSize,gc_nMaxRow0);this.cellsByCol=[];this.cellsByColRowsCount=0;this.aCols=[];this.hiddenManager=new HiddenManager(this);this.Drawings=[];this.TableParts=[];this.AutoFilter=null;this.oAllCol=null;this.aComments=[];var oThis=this;this.bExcludeHiddenRows=false;this.bIgnoreWriteFormulas= false;this.mergeManager=new RangeDataManager(function(data,from,to){if(History.Is_On()&&(null!=from||null!=to)){if(null!=from)from=from.clone();if(null!=to)to=to.clone();var oHistoryRange=from;if(null==oHistoryRange)oHistoryRange=to;History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_ChangeMerge,oThis.getId(),oHistoryRange,new UndoRedoData_FromTo(new UndoRedoData_BBox(from),new UndoRedoData_BBox(to)))}if(null!=to){var maxRow=gc_nMaxRow0!==to.r2?to.r2:to.r1;var maxCol=gc_nMaxCol0!== to.c2?to.c2:to.c1;if(maxRow>=oThis.nRowsCount)oThis.nRowsCount=maxRow+1;if(maxCol>=oThis.nColsCount)oThis.nColsCount=maxCol+1}});this.mergeManager.worksheet=this;this.hyperlinkManager=new RangeDataManager(function(data,from,to,oChangeParam){if(History.Is_On()&&(null!=from||null!=to)){if(null!=from)from=from.clone();if(null!=to)to=to.clone();var oHistoryRange=from;if(null==oHistoryRange)oHistoryRange=to;var oHistoryData=null;if(null==from||null==to)oHistoryData=data.clone();History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_ChangeHyperlink,oThis.getId(),oHistoryRange,new AscCommonExcel.UndoRedoData_FromToHyperlink(from,to,oHistoryData))}if(null!=to)data.Ref=oThis.getRange3(to.r1,to.c1,to.r2,to.c2);else if(oChangeParam&&oChangeParam.removeStyle&&null!=data.Ref)data.Ref.cleanFormat();if(null!=to){var maxRow=gc_nMaxRow0!==to.r2?to.r2:to.r1;var maxCol=gc_nMaxCol0!==to.c2?to.c2:to.c1;if(maxRow>=oThis.nRowsCount)oThis.nRowsCount=maxRow+1;if(maxCol>=oThis.nColsCount)oThis.nColsCount=maxCol+1}}); this.hyperlinkManager.setDependenceManager(this.mergeManager);this.sheetViews=[];this.aConditionalFormattingRules=[];this.updateConditionalFormattingRange=null;this.dataValidations=null;this.sheetPr=null;this.aFormulaExt=null;this.autoFilters=AscCommonExcel.AutoFilters!==undefined?new AscCommonExcel.AutoFilters(this):null;this.sortState=null;this.oDrawingOjectsManager=new DrawingObjectsManager(this);this.contentChanges=new AscCommon.CContentChanges;this.aSparklineGroups=[];this.selectionRange=new AscCommonExcel.SelectionRange(this); this.copySelection=null;this.sheetMergedStyles=new AscCommonExcel.SheetMergedStyles;this.pivotTables=[];this.headerFooter=new Asc.CHeaderFooter(this);this.rowBreaks=null;this.colBreaks=null;this.legacyDrawingHF=null;this.picture=null;this.PagePrintOptions=new Asc.asc_CPageOptions(this);this.formulaArrayLink=null;this.lastFindOptions=null;this.bExcludeCollapsed=false;this.oNumFmtsOpen={};this.handlers=null;this.aSlicers=[];this.aNamedSheetViews=[];this.activeNamedSheetViewId=null;this.defaultViewHiddenRows= null}Worksheet.prototype.getCompiledStyle=function(row,col,opt_cell,opt_styleComponents){return getCompiledStyle(this.sheetMergedStyles,this.hiddenManager,row,col,opt_cell,this,opt_styleComponents)};Worksheet.prototype.getCompiledStyleCustom=function(row,col,needTable,needCell,needConditional,opt_cell){var res;var styleComponents=this.sheetMergedStyles.getStyle(this.hiddenManager,row,col,this);var ws=this;if(!needTable)styleComponents.table=[];if(!needConditional)styleComponents.conditional=[];if(!needCell)res= getCompiledStyle(undefined,undefined,row,col,undefined,undefined,styleComponents);else if(opt_cell)res=getCompiledStyle(undefined,undefined,row,col,opt_cell,ws,styleComponents);else this._getCellNoEmpty(row,col,function(cell){res=getCompiledStyle(undefined,undefined,row,col,cell,ws,styleComponents)});return res};Worksheet.prototype.getColData=function(index){var sheetMemory=this.cellsByCol[index];if(!sheetMemory){sheetMemory=new SheetMemory(g_nCellStructSize,gc_nMaxRow0);this.cellsByCol[index]=sheetMemory}return sheetMemory}; Worksheet.prototype.getColDataNoEmpty=function(index){return this.cellsByCol[index]};Worksheet.prototype.getColDataLength=function(){return this.cellsByCol.length};Worksheet.prototype.getMinimalRange=function(){var oRange=null;this._forEachCell(function(oCell){if(!oCell.isEmpty())if(oRange===null)oRange=new Asc.Range(oCell.nCol,oCell.nRow,oCell.nCol,oCell.nRow);else oRange.union3(oCell.nCol,oCell.nRow)});return oRange};Worksheet.prototype.getSnapshot=function(wb){var ws=new Worksheet(wb,this.index, this.Id);ws.sName=this.sName;for(var i=0;i<this.TableParts.length;++i){var table=this.TableParts[i];ws.addTablePart(table.clone(null),false)}for(i=0;i<this.sheetViews.length;++i)ws.sheetViews.push(this.sheetViews[i].clone());return ws};Worksheet.prototype.addContentChanges=function(changes){this.contentChanges.Add(changes)};Worksheet.prototype.refreshContentChanges=function(){this.contentChanges.Refresh();this.contentChanges.Clear()};Worksheet.prototype.rebuildColors=function(){this.rebuildTabColor(); for(var i=0;i<this.aSparklineGroups.length;++i)this.aSparklineGroups[i].cleanCache()};Worksheet.prototype.generateFontMap=function(oFontMap){for(var i=0,length=this.Drawings.length;i<length;++i){var drawing=this.Drawings[i];if(drawing)drawing.getAllFonts(oFontMap)}if(this.headerFooter)this.headerFooter.getAllFonts(oFontMap)};Worksheet.prototype.getAllImageUrls=function(aImages){for(var i=0;i<this.Drawings.length;++i)this.Drawings[i].graphicObject.getAllRasterImages(aImages)};Worksheet.prototype.reassignImageUrls= function(oImages){for(var i=0;i<this.Drawings.length;++i)this.Drawings[i].graphicObject.Reassign_ImageUrls(oImages)};Worksheet.prototype.copyFrom=function(wsFrom,sName,tableNames){var i,elem,range,_newSlicer;var t=this;this.sName=this.workbook.checkValidSheetName(sName)?sName:this.workbook.getUniqueSheetNameFrom(wsFrom.sName,true);this.bHidden=wsFrom.bHidden;this.oSheetFormatPr=wsFrom.oSheetFormatPr.clone();this.nRowsCount=wsFrom.nRowsCount;this.nColsCount=wsFrom.nColsCount;var renameParams={lastName:wsFrom.getName(), newName:this.getName(),tableNameMap:{},slicerNameMap:{},copySlicerError:false};for(i=0;i<wsFrom.TableParts.length;++i){var tableFrom=wsFrom.TableParts[i];var tableTo=tableFrom.clone(null);if(tableNames&&tableNames.length)tableTo.changeDisplayName(tableNames[i]);else tableTo.changeDisplayName(this.workbook.dependencyFormulas.getNextTableName());this.addTablePart(tableTo,true);renameParams.tableNameMap[tableFrom.DisplayName]=tableTo.DisplayName}for(i=0;i<this.TableParts.length;++i)this.TableParts[i].renameSheetCopy(this, renameParams);if(wsFrom.AutoFilter)this.AutoFilter=wsFrom.AutoFilter.clone();for(i in wsFrom.aCols){var col=wsFrom.aCols[i];if(null!=col)this.aCols[i]=col.clone(this)}if(null!=wsFrom.oAllCol)this.oAllCol=wsFrom.oAllCol.clone(this);this.rowsData=wsFrom.rowsData.clone();wsFrom._forEachColData(function(sheetMemory,index){t.cellsByCol[index]=sheetMemory.clone()});this.cellsByColRowsCount=wsFrom.cellsByColRowsCount;var aMerged=wsFrom.mergeManager.getAll();for(i in aMerged){elem=aMerged[i];range=this.getRange3(elem.bbox.r1, elem.bbox.c1,elem.bbox.r2,elem.bbox.c2);range.mergeOpen()}var aHyperlinks=wsFrom.hyperlinkManager.getAll();for(i in aHyperlinks){elem=aHyperlinks[i];range=this.getRange3(elem.bbox.r1,elem.bbox.c1,elem.bbox.r2,elem.bbox.c2);range.setHyperlinkOpen(elem.data)}if(null!=wsFrom.aComments)for(i=0;i<wsFrom.aComments.length;i++){var comment=wsFrom.aComments[i].clone(true);comment.wsId=this.getId();comment.nId="sheet"+comment.wsId+"_"+(i+1);this.aComments.push(comment)}for(i=0;i<wsFrom.sheetViews.length;++i)this.sheetViews.push(wsFrom.sheetViews[i].clone()); for(i=0;i<wsFrom.aConditionalFormattingRules.length;++i)this.aConditionalFormattingRules.push(wsFrom.aConditionalFormattingRules[i].clone());if(wsFrom.sheetPr)this.sheetPr=wsFrom.sheetPr.clone();this.selectionRange=wsFrom.selectionRange.clone(this);if(wsFrom.PagePrintOptions)this.PagePrintOptions=wsFrom.PagePrintOptions.clone(this);if(wsFrom.headerFooter)this.headerFooter=wsFrom.headerFooter.clone(this);for(i=0;i<wsFrom.aSlicers.length;++i){var _slicer=wsFrom.aSlicers[i];var _table=_slicer.getTableSlicerCache(); var pivotCache=_slicer.getPivotCache();if(_table){var tableIdNew=renameParams.tableNameMap[_table.tableId];if(tableIdNew){_newSlicer=this.insertSlicer(_table.column,tableIdNew,window["AscCommonExcel"].insertSlicerType.table);_newSlicer.set(_slicer.clone(),true)}if(_newSlicer)renameParams.slicerNameMap[_slicer.name]=_newSlicer.name}else if(pivotCache){var _newCacheDefinition=_slicer.getCacheDefinition().clone(this.workbook);_newCacheDefinition.name=_newCacheDefinition.generateSlicerCacheName(_newCacheDefinition.name); _newSlicer=this.insertSlicer(_slicer.name,undefined,window["AscCommonExcel"].insertSlicerType.pivotTable,undefined,_newCacheDefinition);_newCacheDefinition.forCopySheet(wsFrom.getId(),this.getId());_newSlicer.set(_slicer.clone(),true);renameParams.slicerNameMap[_slicer.name]=_newSlicer.name}}if(wsFrom.headerFooter)this.headerFooter=wsFrom.headerFooter.clone(this);return renameParams};Worksheet.prototype.copyFromAfterInsert=function(wsFrom){if(!this.workbook.bUndoChanges&&!this.workbook.bRedoChanges)for(var i= 0;i<wsFrom.pivotTables.length;++i)this.insertPivotTable(wsFrom.pivotTables[i].cloneShallow(),true)};Worksheet.prototype.copyFromFormulas=function(renameParams,renameSheetMap){var t=this;var oldNewArrayFormulaMap=[];this._forEachCell(function(cell){if(cell.isFormula()){var parsed,notMainArrayCell;if(cell.transformSharedFormula())parsed=cell.getFormulaParsed();else{parsed=cell.getFormulaParsed();if(parsed.getArrayFormulaRef()){var listenerId=parsed.getListenerId();if(oldNewArrayFormulaMap[listenerId]){parsed= oldNewArrayFormulaMap[listenerId];notMainArrayCell=true}else{parsed=parsed.clone(null,new CCellWithFormula(t,cell.nRow,cell.nCol),t);oldNewArrayFormulaMap[listenerId]=parsed}}else parsed=parsed.clone(null,new CCellWithFormula(t,cell.nRow,cell.nCol),t)}if(renameSheetMap&&History.Is_On()){var _oldF=parsed.Formula;parsed.parse(null,null,null,null,renameSheetMap);var _newF=parsed.Formula;if(_oldF!==_newF){var DataOld=cell.getValueData();var DataNew=cell.getValueData();DataNew.formula=_newF;if(false== DataOld.isEqual(DataNew))History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_ChangeValue,cell.ws.getId(),new Asc.Range(cell.nCol,cell.nRow,cell.nCol,cell.nRow),new UndoRedoData_CellSimpleData(cell.nRow,cell.nCol,DataOld,DataNew))}}if(!notMainArrayCell){parsed.renameSheetCopy(renameParams);parsed.setFormulaString(parsed.assemble(true))}cell.setFormulaInternal(parsed,true);t.workbook.dependencyFormulas.addToBuildDependencyCell(cell)}})};Worksheet.prototype.cloneSelection=function(start, selectRange){if(start){this.copySelection=this.selectionRange.clone();if(selectRange)this.selectionRange.assign2(selectRange);else this.selectionRange=null}else{if(this.copySelection)this.selectionRange=this.copySelection;this.copySelection=null}};Worksheet.prototype.getSelection=function(){return this.copySelection||this.selectionRange};Worksheet.prototype.copyObjects=function(oNewWs,renameParams){var i;if(null!=this.Drawings&&this.Drawings.length>0){var drawingObjects=new AscFormat.DrawingObjects; oNewWs.Drawings=[];for(i=0;i<this.Drawings.length;++i){var _isSlicer=this.Drawings[i].graphicObject.getObjectType()===AscDFH.historyitem_type_SlicerView;if(_isSlicer&&renameParams&&!renameParams.slicerNameMap[this.Drawings[i].graphicObject.name]){renameParams.copySlicerError=true;continue}var drawingObject=drawingObjects.cloneDrawingObject(this.Drawings[i]);drawingObject.graphicObject=this.Drawings[i].graphicObject.copy(undefined);if(_isSlicer&&renameParams)drawingObject.graphicObject.setName(renameParams.slicerNameMap[drawingObject.graphicObject.name]); drawingObject.graphicObject.setWorksheet(oNewWs);drawingObject.graphicObject.addToDrawingObjects();var drawingBase=this.Drawings[i];drawingObject.graphicObject.setDrawingBaseCoords(drawingBase.from.col,drawingBase.from.colOff,drawingBase.from.row,drawingBase.from.rowOff,drawingBase.to.col,drawingBase.to.colOff,drawingBase.to.row,drawingBase.to.rowOff,drawingBase.Pos.X,drawingBase.Pos.Y,drawingBase.ext.cx,drawingBase.ext.cy);if(drawingObject.graphicObject.setDrawingBaseType){drawingObject.graphicObject.setDrawingBaseType(drawingBase.Type); if(drawingBase.Type===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)drawingObject.graphicObject.setDrawingBaseEditAs(drawingObject.editAs)}oNewWs.Drawings[oNewWs.Drawings.length-1]=drawingObject}drawingObjects.pushToAObjects(oNewWs.Drawings);drawingObjects.updateChartReferences2(parserHelp.getEscapeSheetName(this.sName),parserHelp.getEscapeSheetName(oNewWs.sName))}var newSparkline;for(i=0;i<this.aSparklineGroups.length;++i){newSparkline=this.aSparklineGroups[i].clone();newSparkline.setWorksheet(oNewWs, this);oNewWs.aSparklineGroups.push(newSparkline)}};Worksheet.prototype.initColumn=function(column){if(column)if(null!==column.width&&0!==column.width){column.widthPx=this.modelColWidthToColWidth(column.width);column.charCount=this.colWidthToCharCount(column.widthPx)}else column.widthPx=column.charCount=null};Worksheet.prototype.initColumns=function(){this.initColumn(this.oAllCol);this.aCols.forEach(this.initColumn,this)};Worksheet.prototype.initPostOpen=function(handlers,tableIds,sheetIds){var t= this;this.PagePrintOptions.init();this.headerFooter.init();if(this.dataValidations)this.dataValidations.init(this);if(0===this.sheetViews.length)this.sheetViews.push(new AscCommonExcel.asc_CSheetViewSettings);this.hiddenManager.initPostOpen();this.oSheetFormatPr.correction();this.handlers=handlers;this._setHandlersTablePart();this.aSlicers.forEach(function(elem){elem.initPostOpen(tableIds,sheetIds)});this.aNamedSheetViews.forEach(function(elem){elem.initPostOpen(tableIds,t)})};Worksheet.prototype.initPostOpenZip= function(pivotCaches,oNumFmts){this.pivotTables.forEach(function(pivotTable){pivotTable.initPostOpenZip(oNumFmts)});this.aSlicers.forEach(function(slicer){slicer.initPostOpenZip(pivotCaches)})};Worksheet.prototype._getValuesForConditionalFormatting=function(ranges,numbers){var res=[];for(var i=0;i<ranges.length;++i){var elem=ranges[i];var range=this.getRange3(elem.r1,elem.c1,elem.r2,elem.c2);res=res.concat(range._getValues(numbers))}return res};Worksheet.prototype._isConditionalFormattingIntersect= function(range,ranges){for(var i=0;i<ranges.length;++i)if(range.isIntersect(ranges[i]))return true;return false};Worksheet.prototype.setDirtyConditionalFormatting=function(range){if(!range)range=new AscCommonExcel.MultiplyRange([new Asc.Range(0,0,gc_nMaxCol0,gc_nMaxRow0)]);if(this.updateConditionalFormattingRange)this.updateConditionalFormattingRange.union2(range);else this.updateConditionalFormattingRange=range.clone()};Worksheet.prototype._updateConditionalFormatting=function(){if(!this.updateConditionalFormattingRange)return; var range=this.updateConditionalFormattingRange;this.updateConditionalFormattingRange=null;var t=this;var aRules=this.aConditionalFormattingRules.sort(function(v1,v2){return v2.priority-v1.priority});var oGradient1,oGradient2,aWeights,oRule,multiplyRange,oRuleElement,bboxCf,formulaParent,parsed1,parsed2;var o,l,cell,ranges,values,value,tmp,dxf,compareFunction,nc,sum;this.sheetMergedStyles.clearConditionalStyle(range);var getCacheFunction=function(rule,setFunc){var cache={cache:{},get:function(row, col){var cacheVal;var cacheRow=this.cache[row];if(!cacheRow){cacheRow={};this.cache[row]=cacheRow}else cacheVal=cacheRow[col];if(undefined===cacheVal){cacheVal=this.set(row,col);cacheRow[col]=cacheVal}return cacheVal},set:function(row,col){if(rule)return setFunc(row,col)?rule.dxf:null;else return setFunc(row,col)}};return function(row,col){return cache.get(row,col)}};for(var i=0;i<aRules.length;++i){oRule=aRules[i];ranges=oRule.ranges;if(this._isConditionalFormattingIntersect(range,ranges)){multiplyRange= new AscCommonExcel.MultiplyRange(ranges);oRuleElement=oRule.asc_getColorScaleOrDataBarOrIconSetRule();if(oRuleElement){if(Asc.ECfType.colorScale!==oRuleElement.type)continue;values=this._getValuesForConditionalFormatting(ranges,true);l=oRuleElement.aColors.length;if(0<values.length&&2<=l){aWeights=[];oGradient1=new AscCommonExcel.CGradient(oRuleElement.aColors[0],oRuleElement.aColors[1]);aWeights.push(oRule.getMin(values,t),oRule.getMax(values,t));if(2<l){oGradient2=new AscCommonExcel.CGradient(oRuleElement.aColors[1], oRuleElement.aColors[2]);aWeights.push(oRule.getMid(values,t));aWeights.sort(AscCommon.fSortAscending);oGradient1.init(aWeights[0],aWeights[1]);oGradient2.init(aWeights[1],aWeights[2])}else{oGradient2=null;aWeights.sort(AscCommon.fSortAscending);oGradient1.init(aWeights[0],aWeights[1])}compareFunction=function(oGradient1,oGradient2){return function(row,col){var val,color,gradient;t._getCellNoEmpty(row,col,function(cell){val=cell&&cell.getNumberValue()});dxf=null;if(null!==val){dxf=new AscCommonExcel.CellXfs; gradient=oGradient2?oGradient2:oGradient1;if(val>=gradient.max)color=gradient.getMaxColor();else if(val<=oGradient1.min)color=oGradient1.getMinColor();else{gradient=oGradient2&&val>oGradient1.max?oGradient2:oGradient1;color=gradient.calculateColor(val)}dxf.fill=new AscCommonExcel.Fill;dxf.fill.fromColor(color);dxf=g_StyleCache.addXf(dxf,true)}return dxf}}(oGradient1,oGradient2)}}else if(Asc.ECfType.dataBar===oRule.type)continue;else if(Asc.ECfType.top10===oRule.type){if(oRule.rank>0&&oRule.dxf){nc= 0;values=this._getValuesForConditionalFormatting(ranges,false);o=oRule.bottom?Number.MAX_VALUE:-Number.MAX_VALUE;for(cell=0;cell<values.length;++cell){value=values[cell];if(CellValueType.Number===value.type&&!isNaN(tmp=parseFloat(value.v))){++nc;value.v=tmp}else value.v=o}values.sort(function(condition){return function(v1,v2){return condition*(v2.v-v1.v)}}(oRule.bottom?-1:1));nc=Math.max(1,oRule.percent?Math.floor(nc*oRule.rank/100):oRule.rank);var threshold=values.length>=nc?values[nc-1].v:o;compareFunction= function(rule,threshold){return function(row,col){var val;t._getCellNoEmpty(row,col,function(cell){val=cell?cell.getNumberValue():null});return null!==val&&(rule.bottom?val<=threshold:val>=threshold)?rule.dxf:null}}(oRule,threshold)}}else if(Asc.ECfType.aboveAverage===oRule.type){if(!oRule.dxf)continue;values=this._getValuesForConditionalFormatting(ranges,false);sum=0;nc=0;for(cell=0;cell<values.length;++cell){value=values[cell];if(CellValueType.Number===value.type&&!isNaN(tmp=parseFloat(value.v))){++nc; value.v=tmp;sum+=tmp}else value.v=null}tmp=sum/nc;compareFunction=function(rule,average,stdDev){return function(row,col){var val;t._getCellNoEmpty(row,col,function(cell){val=cell?cell.getNumberValue():null});return null!==val&&rule.getAverage(val,average,stdDev)?rule.dxf:null}}(oRule,tmp,sum)}else{if(!oRule.dxf)continue;switch(oRule.type){case Asc.ECfType.duplicateValues:case Asc.ECfType.uniqueValues:o=getUniqueKeys(this._getValuesForConditionalFormatting(ranges,false));compareFunction=function(rule, obj,condition){return function(row,col){var val;t._getCellNoEmpty(row,col,function(cell){val=cell?cell.getValueWithoutFormat():""});return(val.length>0?condition===obj[val]:false)?rule.dxf:null}}(oRule,o,oRule.type===Asc.ECfType.duplicateValues);break;case Asc.ECfType.containsText:case Asc.ECfType.notContainsText:case Asc.ECfType.beginsWith:case Asc.ECfType.endsWith:var operator;switch(oRule.type){case Asc.ECfType.containsText:operator=AscCommonExcel.ECfOperator.Operator_containsText;break;case Asc.ECfType.notContainsText:operator= AscCommonExcel.ECfOperator.Operator_notContains;break;case Asc.ECfType.beginsWith:operator=AscCommonExcel.ECfOperator.Operator_beginsWith;break;case Asc.ECfType.endsWith:operator=AscCommonExcel.ECfOperator.Operator_endsWith;break}formulaParent=new AscCommonExcel.CConditionalFormattingFormulaParent(this,oRule,true);oRuleElement=oRule.getFormulaCellIs();parsed1=oRuleElement&&oRuleElement.getFormula&&oRuleElement.getFormula(this,formulaParent);if(parsed1&&parsed1.hasRelativeRefs()){bboxCf=oRule.getBBox(); compareFunction=getCacheFunction(oRule,function(rule,operator,formulaParent,rowLT,colLT){return function(row,col){var offset=new AscCommon.CellBase(row-rowLT,col-colLT);var bboxCell=new Asc.Range(col,row,col,row);var v1=rule.getValueCellIs(t,formulaParent,bboxCell,offset,false);var res;t._getCellNoEmpty(row,col,function(cell){res=rule.cellIs(operator,cell,v1)?rule.dxf:null});return res}}(oRule,operator,new AscCommonExcel.CConditionalFormattingFormulaParent(this,oRule,true),bboxCf?bboxCf.r1:0,bboxCf? bboxCf.c1:0))}else compareFunction=function(rule,operator,v1){return function(row,col){var res;t._getCellNoEmpty(row,col,function(cell){res=rule.cellIs(operator,cell,v1)?rule.dxf:null});return res}}(oRule,operator,oRule.getValueCellIs(this));break;case Asc.ECfType.containsErrors:compareFunction=function(rule){return function(row,col){var val;t._getCellNoEmpty(row,col,function(cell){val=cell?CellValueType.Error===cell.getType():false});return val?rule.dxf:null}}(oRule);break;case Asc.ECfType.notContainsErrors:compareFunction= function(rule){return function(row,col){var val;t._getCellNoEmpty(row,col,function(cell){val=cell?CellValueType.Error!==cell.getType():true});return val?rule.dxf:null}}(oRule);break;case Asc.ECfType.containsBlanks:compareFunction=function(rule){return function(row,col){var val;t._getCellNoEmpty(row,col,function(cell){if(cell)val=""===cell.getValueWithoutFormat().replace(/^ +| +$/g,"");else val=true});return val?rule.dxf:null}}(oRule);break;case Asc.ECfType.notContainsBlanks:compareFunction=function(rule){return function(row, col){var val;t._getCellNoEmpty(row,col,function(cell){if(cell)val=""!==cell.getValueWithoutFormat().replace(/^ +| +$/g,"");else val=false});return val?rule.dxf:null}}(oRule);break;case Asc.ECfType.timePeriod:if(oRule.timePeriod)compareFunction=function(rule,period){return function(row,col){var val;t._getCellNoEmpty(row,col,function(cell){val=cell?cell.getValueWithoutFormat():""});var n=parseFloat(val);return period.start<=n&&n<period.end?rule.dxf:null}}(oRule,oRule.getTimePeriod());else continue; break;case Asc.ECfType.cellIs:formulaParent=new AscCommonExcel.CConditionalFormattingFormulaParent(this,oRule,true);oRuleElement=oRule.aRuleElements[0];parsed1=oRuleElement&&oRuleElement.getFormula&&oRuleElement.getFormula(this,formulaParent);oRuleElement=oRule.aRuleElements[1];parsed2=oRuleElement&&oRuleElement.getFormula&&oRuleElement.getFormula(this,formulaParent);if(parsed1&&parsed1.hasRelativeRefs()||parsed2&&parsed2.hasRelativeRefs()){bboxCf=oRule.getBBox();compareFunction=getCacheFunction(oRule, function(rule,ruleElem1,ruleElem2,formulaParent,rowLT,colLT){return function(row,col){var offset=new AscCommon.CellBase(row-rowLT,col-colLT);var bboxCell=new Asc.Range(col,row,col,row);var v1=ruleElem1&&ruleElem1.getValue(t,formulaParent,bboxCell,offset,false);var v2=ruleElem2&&ruleElem2.getValue(t,formulaParent,bboxCell,offset,false);var res;t._getCellNoEmpty(row,col,function(cell){res=rule.cellIs(rule.operator,cell,v1,v2)?rule.dxf:null});return res}}(oRule,oRule.aRuleElements[0],oRule.aRuleElements[1], new AscCommonExcel.CConditionalFormattingFormulaParent(this,oRule,true),bboxCf?bboxCf.r1:0,bboxCf?bboxCf.c1:0))}else compareFunction=function(rule,v1,v2){return function(row,col){var res;t._getCellNoEmpty(row,col,function(cell){res=rule.cellIs(rule.operator,cell,v1,v2)?rule.dxf:null});return res}}(oRule,oRule.aRuleElements[0]&&oRule.aRuleElements[0].getValue(this),oRule.aRuleElements[1]&&oRule.aRuleElements[1].getValue(this));break;case Asc.ECfType.expression:bboxCf=oRule.getBBox();compareFunction= getCacheFunction(oRule,function(rule,formulaCF,formulaParent,rowLT,colLT){return function(row,col){var offset=new AscCommon.CellBase(row-rowLT,col-colLT);var bboxCell=new Asc.Range(col,row,col,row);var res=formulaCF&&formulaCF.getValue(t,formulaParent,bboxCell,offset,true);if(res&&res.tocBool){res=res.tocBool();if(res&&res.toBool)return res.toBool()}return false}}(oRule,oRule.aRuleElements[0],new AscCommonExcel.CConditionalFormattingFormulaParent(this,oRule,true),bboxCf?bboxCf.r1:0,bboxCf?bboxCf.c1: 0));break;default:break}}if(compareFunction)this.sheetMergedStyles.setConditionalStyle(multiplyRange,compareFunction)}}};Worksheet.prototype._forEachRow=function(fAction){this.getRange3(0,0,gc_nMaxRow0,0)._foreachRowNoEmpty(fAction)};Worksheet.prototype._forEachCol=function(fAction){this.getRange3(0,0,0,gc_nMaxCol0)._foreachColNoEmpty(fAction)};Worksheet.prototype._forEachColData=function(fAction){for(var i=0;i<this.cellsByCol.length;++i){var sheetMemory=this.cellsByCol[i];if(sheetMemory)fAction(sheetMemory, i)}};Worksheet.prototype._forEachCell=function(fAction){this.getRange3(0,0,gc_nMaxRow0,gc_nMaxCol0)._foreachNoEmpty(fAction)};Worksheet.prototype.getId=function(){return this.Id};Worksheet.prototype.getIndex=function(){return this.index};Worksheet.prototype.getName=function(){return this.sName!==undefined&&this.sName.length>0?this.sName:""};Worksheet.prototype.setName=function(name,bFromUndoRedo){if(name.length<=g_nSheetNameMaxLength){var lastName=this.sName;History.Create_NewPoint();var prepared= this.workbook.dependencyFormulas.prepareChangeSheet(this.getId(),{rename:{from:lastName,to:name}});this.sName=name;this.workbook.dependencyFormulas.changeSheet(prepared);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_Rename,this.getId(),null,new UndoRedoData_FromTo(lastName,name));if(!bFromUndoRedo){var _lastName=parserHelp.getEscapeSheetName(lastName);var _newName=parserHelp.getEscapeSheetName(this.sName);for(var key in this.workbook.aWorksheets)if(this.workbook.aWorksheets.hasOwnProperty(key)){var wsModel= this.workbook.aWorksheets[key];if(wsModel)wsModel.oDrawingOjectsManager.updateChartReferencesWidthHistory(_lastName,_newName,true)}}this.workbook.dependencyFormulas.calcTree()}else console.log(new Error("The sheet name must be less than 31 characters."))};Worksheet.prototype.getTabColor=function(){return this.sheetPr&&this.sheetPr.TabColor?Asc.colorObjToAscColor(this.sheetPr.TabColor):null};Worksheet.prototype.setTabColor=function(color){if(!this.sheetPr)this.sheetPr=new AscCommonExcel.asc_CSheetPr; History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SetTabColor,this.getId(),null,new UndoRedoData_FromTo(this.sheetPr.TabColor?this.sheetPr.TabColor.clone():null,color?color.clone():null));this.sheetPr.TabColor=color;if(!this.workbook.bUndoChanges&&!this.workbook.bRedoChanges)this.workbook.handlers.trigger("asc_onUpdateTabColor",this.getIndex())};Worksheet.prototype.rebuildTabColor=function(){if(this.sheetPr&&this.sheetPr.TabColor)this.workbook.handlers.trigger("asc_onUpdateTabColor", this.getIndex())};Worksheet.prototype.getHidden=function(){return true===this.bHidden};Worksheet.prototype.setHidden=function(hidden){var bOldHidden=this.bHidden,wb=this.workbook,wsActive=wb.getActiveWs(),oVisibleWs=null;this.bHidden=hidden;if(bOldHidden!=hidden){if(true==this.bHidden&&this.getIndex()==wsActive.getIndex())oVisibleWs=wb.findSheetNoHidden(this.getIndex());else if(false==this.bHidden&&this.getIndex()!==wsActive.getIndex())oVisibleWs=this;if(null!=oVisibleWs){var nNewIndex=oVisibleWs.getIndex(); wb.setActive(nNewIndex);if(!wb.bUndoChanges&&!wb.bRedoChanges)wb.handlers.trigger("undoRedoHideSheet",nNewIndex)}History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_Hide,this.getId(),null,new UndoRedoData_FromTo(bOldHidden,hidden));if(null!=oVisibleWs){History.SetSheetUndo(wsActive.getId());History.SetSheetRedo(oVisibleWs.getId())}}};Worksheet.prototype.getSheetView=function(){return this.sheetViews[0]};Worksheet.prototype.getSheetViewSettings=function(){return this.sheetViews[0].clone()}; Worksheet.prototype.setDisplayGridlines=function(value){var view=this.sheetViews[0];if(value!==view.showGridLines){History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SetDisplayGridlines,this.getId(),null,new UndoRedoData_FromTo(view.showGridLines,value));view.showGridLines=value;this.workbook.handlers.trigger("changeSheetViewSettings",this.getId(),AscCH.historyitem_Worksheet_SetDisplayGridlines);if(!this.workbook.bUndoChanges&&!this.workbook.bRedoChanges)this.workbook.handlers.trigger("asc_onUpdateSheetViewSettings")}}; Worksheet.prototype.setDisplayHeadings=function(value){var view=this.sheetViews[0];if(value!==view.showRowColHeaders){History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SetDisplayHeadings,this.getId(),null,new UndoRedoData_FromTo(view.showRowColHeaders,value));view.showRowColHeaders=value;this.workbook.handlers.trigger("changeSheetViewSettings",this.getId(),AscCH.historyitem_Worksheet_SetDisplayHeadings);if(!this.workbook.bUndoChanges&&!this.workbook.bRedoChanges)this.workbook.handlers.trigger("asc_onUpdateSheetViewSettings")}}; Worksheet.prototype.getRowsCount=function(){var result=this.nRowsCount;var pane=this.sheetViews.length&&this.sheetViews[0].pane;if(pane&&pane.topLeftFrozenCell)result=Math.max(result,pane.topLeftFrozenCell.getRow0());return result};Worksheet.prototype.removeRows=function(start,stop,bExcludeHiddenRows){var removeRowsArr=bExcludeHiddenRows?this._getNoHiddenRowsArr(start,stop):[{start:start,stop:stop}];for(var i=removeRowsArr.length-1;i>=0;i--){var oRange=this.getRange(new CellAddress(removeRowsArr[i].start, 0,0),new CellAddress(removeRowsArr[i].stop,gc_nMaxCol0,0));oRange.deleteCellsShiftUp()}};Worksheet.prototype._getNoHiddenRowsArr=function(start,stop){var res=[];var elem=null;for(var i=start;i<=stop;i++)if(this.getRowHidden(i)){if(elem){res.push(elem);elem=null}}else{if(!elem){elem={};elem.start=i;elem.stop=i}else elem.stop++;if(i===stop)res.push(elem)}return res};Worksheet.prototype._updateFormulasParents=function(r1,c1,r2,c2,bbox,offset,shiftedShared){var t=this;var cellWithFormula;var shiftedArrayFormula= {};this.getRange3(r1,c1,r2,c2)._foreachNoEmpty(function(cell){var newNRow=cell.nRow+offset.row;var newNCol=cell.nCol+offset.col;var bHor=0!==offset.col;var toDelete=offset.col<0||offset.row<0;if(cell.isFormula()){var processed=c_oSharedShiftType.NeedTransform;var parsed=cell.getFormulaParsed();var shared=parsed.getShared();var arrayFormula=parsed.getArrayFormulaRef();var formulaRefObj=null;if(shared){processed=shiftedShared[parsed.getListenerId()];var isPreProcessed=c_oSharedShiftType.PreProcessed=== processed;if(!processed||isPreProcessed){if(!processed){var bboxShift=AscCommonExcel.shiftGetBBox(bbox,bHor);if(bboxShift.containsRange(shared.ref)&&(!toDelete||!bbox.isIntersect(shared.ref)))processed=c_oSharedShiftType.Processed;else processed=c_oSharedShiftType.NeedTransform}else if(isPreProcessed)processed=c_oSharedShiftType.Processed;if(c_oSharedShiftType.Processed===processed){var newRef=shared.ref.clone();newRef.forShift(bbox,offset,t.workbook.bUndoChanges);parsed.setSharedRef(newRef,!isPreProcessed); t.workbook.dependencyFormulas.addToChangedRange2(t.getId(),newRef)}shiftedShared[parsed.getListenerId()]=processed}}else if(arrayFormula)if(!shiftedArrayFormula[parsed.getListenerId()]&&parsed.checkFirstCellArray(cell)){shiftedArrayFormula[parsed.getListenerId()]=1;var newArrayRef=arrayFormula.clone();newArrayRef.setOffset(offset);parsed.setArrayFormulaRef(newArrayRef)}else processed=c_oSharedShiftType.Processed;if(c_oSharedShiftType.NeedTransform===processed){var isTransform=cell.transformSharedFormula(); parsed=cell.getFormulaParsed();if(isTransform)parsed.buildDependencies();cellWithFormula=parsed.getParent();cellWithFormula.nRow=newNRow;cellWithFormula.nCol=newNCol;t.workbook.dependencyFormulas.addToChangedCell(cellWithFormula)}}t.cellsByColRowsCount=Math.max(t.cellsByColRowsCount,newNRow+1);t.nRowsCount=Math.max(t.nRowsCount,t.cellsByColRowsCount);t.nColsCount=Math.max(t.nColsCount,newNCol+1)})};Worksheet.prototype._removeRows=function(start,stop){var t=this;this.workbook.dependencyFormulas.lockRecal(); History.Create_NewPoint();var nDif=-(stop-start+1);var oActualRange=new Asc.Range(0,start,gc_nMaxCol0,stop);var offset=new AscCommon.CellBase(nDif,0);var renameRes=this.renameDependencyNodes(offset,oActualRange);var redrawTablesArr=this.autoFilters.insertRows("delCell",oActualRange,c_oAscDeleteOptions.DeleteRows);if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)this.updatePivotOffset(oActualRange,offset);if(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges|| this.workbook.bCollaborativeChanges)){History.LocalChange=true;this.updateSortStateOffset(oActualRange,offset);History.LocalChange=false}var collapsedInfo=null,lastRowIndex;var oDefRowPr=new AscCommonExcel.UndoRedoData_RowProp;this.getRange3(start,0,stop,gc_nMaxCol0)._foreachRowNoEmpty(function(row){var oOldProps=row.getHeightProp();lastRowIndex=row.index;if(false===oOldProps.isEqual(oDefRowPr))History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RowProp,t.getId(),row._getUpdateRange(), new UndoRedoData_IndexSimpleProp(row.getIndex(),true,oOldProps,oDefRowPr));row.setStyle(null);if(!t.workbook.bRedoChanges){if(collapsedInfo!==null&&collapsedInfo<row.getOutlineLevel())collapsedInfo=null;if(row.getCollapsed()){collapsedInfo=row.getOutlineLevel();t.setCollapsedRow(false,null,row)}}},function(cell){t._removeCell(null,null,cell)});if(collapsedInfo!==null&&lastRowIndex===stop)this._getRow(stop+1,function(row){t.setCollapsedRow(true,null,row)});this._updateFormulasParents(start,0,gc_nMaxRow0, gc_nMaxCol0,oActualRange,offset,renameRes.shiftedShared);this.rowsData.deleteRange(start,-nDif);this._forEachColData(function(sheetMemory){sheetMemory.deleteRange(start,-nDif)});this.workbook.dependencyFormulas.notifyChanged(renameRes.changed);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RemoveRows,this.getId(),new Asc.Range(0,start,gc_nMaxCol0,gc_nMaxRow0),new UndoRedoData_FromToRowCol(true,start,stop));this.autoFilters.redrawStylesTables(redrawTablesArr);this.workbook.dependencyFormulas.unlockRecal(); return true};Worksheet.prototype.insertRowsBefore=function(index,count){var oRange=this.getRange(new CellAddress(index,0,0),new CellAddress(index+count-1,gc_nMaxCol0,0));oRange.addCellsShiftBottom()};Worksheet.prototype._getBordersForInsert=function(bbox,bRow){var t=this;var borders={};var offsetRow=bRow&&bbox.r1>0?-1:0;var offsetCol=!bRow&&bbox.c1>0?-1:0;var r2=bRow?bbox.r1:bbox.r2;var c2=!bRow?bbox.c1:bbox.c2;if(0!==offsetRow||0!==offsetCol)this.getRange3(bbox.r1,bbox.c1,r2,c2)._foreachNoEmpty(function(cell){if(cell.xfs&& cell.xfs.border)t._getCellNoEmpty(cell.nRow+offsetRow,cell.nCol+offsetCol,function(neighbor){if(neighbor&&neighbor.xfs&&neighbor.xfs.border){var newBorder=neighbor.xfs.border.clone();newBorder.intersect(cell.xfs.border,g_oDefaultFormat.BorderAbs,true);borders[bRow?cell.nCol:cell.nRow]=newBorder}})});return borders};Worksheet.prototype._insertRowsBefore=function(index,count){var t=this;this.workbook.dependencyFormulas.lockRecal();var oActualRange=new Asc.Range(0,index,gc_nMaxCol0,index+count-1);History.Create_NewPoint(); var offset=new AscCommon.CellBase(count,0);var renameRes=this.renameDependencyNodes(offset,oActualRange);var redrawTablesArr=this.autoFilters.insertRows("insCell",oActualRange,c_oAscInsertOptions.InsertColumns);if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)this.updatePivotOffset(oActualRange,offset);if(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges||this.workbook.bCollaborativeChanges)){History.LocalChange=true;this.updateSortStateOffset(oActualRange, offset);History.LocalChange=false}this._updateFormulasParents(index,0,gc_nMaxRow0,gc_nMaxCol0,oActualRange,offset,renameRes.shiftedShared);var borders;if(index>0&&!this.workbook.bUndoChanges)borders=this._getBordersForInsert(oActualRange,true);this.rowsData.insertRange(index,count);this.nRowsCount=Math.max(this.nRowsCount,this.rowsData.getSize());this._forEachColData(function(sheetMemory){sheetMemory.insertRange(index,count);t.cellsByColRowsCount=Math.max(t.cellsByColRowsCount,sheetMemory.getSize())}); this.nRowsCount=Math.max(this.nRowsCount,this.cellsByColRowsCount);if(index>0&&!this.workbook.bUndoChanges){this.rowsData.copyRangeByChunk(index-1,1,index,count);this.nRowsCount=Math.max(this.nRowsCount,this.rowsData.getSize());this._forEachColData(function(sheetMemory){sheetMemory.copyRangeByChunk(index-1,1,index,count);t.cellsByColRowsCount=Math.max(t.cellsByColRowsCount,sheetMemory.getSize())});this.nRowsCount=Math.max(this.nRowsCount,this.cellsByColRowsCount);this.getRange3(index,0,index+count- 1,gc_nMaxCol0)._foreachRowNoEmpty(function(row){row.setHidden(false)},function(cell){cell.clearDataKeepXf(borders[cell.nCol])})}this.workbook.dependencyFormulas.notifyChanged(renameRes.changed);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_AddRows,this.getId(),new Asc.Range(0,index,gc_nMaxCol0,gc_nMaxRow0),new UndoRedoData_FromToRowCol(true,index,index+count-1));this.autoFilters.redrawStylesTables(redrawTablesArr);this.workbook.dependencyFormulas.unlockRecal();return true}; Worksheet.prototype.insertRowsAfter=function(index,count){return this.insertRowsBefore(index+1,count)};Worksheet.prototype.getColsCount=function(){var result=this.nColsCount;var pane=this.sheetViews.length&&this.sheetViews[0].pane;if(pane&&pane.topLeftFrozenCell)result=Math.max(result,pane.topLeftFrozenCell.getCol0());return result};Worksheet.prototype.removeCols=function(start,stop){var oRange=this.getRange(new CellAddress(0,start,0),new CellAddress(gc_nMaxRow0,stop,0));oRange.deleteCellsShiftLeft()}; Worksheet.prototype._removeCols=function(start,stop){var t=this;this.workbook.dependencyFormulas.lockRecal();History.Create_NewPoint();var nDif=-(stop-start+1),i,j,length;var oActualRange=new Asc.Range(start,0,stop,gc_nMaxRow0);var offset=new AscCommon.CellBase(0,nDif);var renameRes=this.renameDependencyNodes(offset,oActualRange);var redrawTablesArr=this.autoFilters.insertColumn(oActualRange,nDif);if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)this.updatePivotOffset(oActualRange, offset);if(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges||this.workbook.bCollaborativeChanges)){History.LocalChange=true;this.updateSortStateOffset(oActualRange,offset);History.LocalChange=false}var collapsedInfo=null,lastRowIndex;var oDefColPr=new AscCommonExcel.UndoRedoData_ColProp;this.getRange3(0,start,gc_nMaxRow0,stop)._foreachColNoEmpty(function(col){var nIndex=col.getIndex();var oOldProps=col.getWidthProp();if(false===oOldProps.isEqual(oDefColPr))History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_ColProp,t.getId(),new Asc.Range(nIndex,0,nIndex,gc_nMaxRow0),new UndoRedoData_IndexSimpleProp(nIndex,false,oOldProps,oDefColPr));col.setStyle(null);lastRowIndex=col.index;if(!t.workbook.bRedoChanges){if(collapsedInfo!==null&&collapsedInfo<col.getOutlineLevel())collapsedInfo=null;if(col.getCollapsed()){collapsedInfo=col.getOutlineLevel();t.setCollapsedCol(false,null,col)}}},function(cell){t._removeCell(null,null,cell)});if(collapsedInfo!==null&&lastRowIndex===stop){var curCol= this._getCol(stop+1);if(curCol)t.setCollapsedCol(true,null,curCol)}this._updateFormulasParents(0,start,gc_nMaxRow0,gc_nMaxCol0,oActualRange,offset,renameRes.shiftedShared);this.cellsByCol.splice(start,stop-start+1);this.aCols.splice(start,stop-start+1);for(i=start,length=this.aCols.length;i<length;++i){var elem=this.aCols[i];if(null!=elem)elem.moveHor(nDif)}this.workbook.dependencyFormulas.notifyChanged(renameRes.changed);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RemoveCols, this.getId(),new Asc.Range(start,0,gc_nMaxCol0,gc_nMaxRow0),new UndoRedoData_FromToRowCol(false,start,stop));this.autoFilters.redrawStylesTables(redrawTablesArr);this.workbook.dependencyFormulas.unlockRecal();return true};Worksheet.prototype.insertColsBefore=function(index,count){var oRange=this.getRange3(0,index,gc_nMaxRow0,index+count-1);oRange.addCellsShiftRight()};Worksheet.prototype._insertColsBefore=function(index,count){this.workbook.dependencyFormulas.lockRecal();var oActualRange=new Asc.Range(index, 0,index+count-1,gc_nMaxRow0);History.Create_NewPoint();var offset=new AscCommon.CellBase(0,count);var renameRes=this.renameDependencyNodes(offset,oActualRange);var redrawTablesArr=this.autoFilters.insertColumn(oActualRange,count);if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)this.updatePivotOffset(oActualRange,offset);if(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges||this.workbook.bCollaborativeChanges)){History.LocalChange=true;this.updateSortStateOffset(oActualRange, offset);History.LocalChange=false}this._updateFormulasParents(0,index,gc_nMaxRow0,gc_nMaxCol0,oActualRange,offset,renameRes.shiftedShared);var borders;if(index>0&&!this.workbook.bUndoChanges)borders=this._getBordersForInsert(oActualRange,false);this.cellsByCol.splice(gc_nMaxCol0-count+1,count);for(var i=this.cellsByCol.length-1;i>=index;--i){this.cellsByCol[i+count]=this.cellsByCol[i];this.cellsByCol[i]=undefined}this.nColsCount=Math.max(this.nColsCount,this.getColDataLength());this.aCols.splice(gc_nMaxCol0- count+1,count);for(var i=this.aCols.length-1;i>=index;--i){this.aCols[i+count]=this.aCols[i];this.aCols[i]=undefined;if(this.aCols[i+count])this.aCols[i+count].moveHor(count)}this.nColsCount=Math.max(this.nColsCount,this.aCols.length);if(!this.workbook.bUndoChanges){var oPrevCol=null;if(index>0)oPrevCol=this.aCols[index-1];if(null==oPrevCol&&null!=this.oAllCol)oPrevCol=this.oAllCol;if(null!=oPrevCol){History.LocalChange=true;for(var i=index;i<index+count;++i){var oNewCol=oPrevCol.clone();oNewCol.setHidden(null); oNewCol.BestFit=null;oNewCol.index=i;this.aCols[i]=oNewCol}History.LocalChange=false}var prevCellsByCol=index>0?this.cellsByCol[index-1]:null;if(prevCellsByCol){for(var i=index;i<index+count;++i)this.cellsByCol[i]=prevCellsByCol.clone();this.nColsCount=Math.max(this.nColsCount,this.getColDataLength());this.getRange3(0,index,gc_nMaxRow0,index+count-1)._foreachNoEmpty(function(cell){cell.clearDataKeepXf(borders[cell.nRow])})}}this.workbook.dependencyFormulas.notifyChanged(renameRes.changed);History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_AddCols,this.getId(),new Asc.Range(index,0,gc_nMaxCol0,gc_nMaxRow0),new UndoRedoData_FromToRowCol(false,index,index+count-1));this.autoFilters.redrawStylesTables(redrawTablesArr);this.workbook.dependencyFormulas.unlockRecal();return true};Worksheet.prototype.insertColsAfter=function(index,count){return this.insertColsBefore(index+1,count)};Worksheet.prototype.getDefaultWidth=function(){return this.oSheetFormatPr.dDefaultColWidth};Worksheet.prototype.getDefaultFontName= function(){return this.workbook.getDefaultFont()};Worksheet.prototype.getDefaultFontSize=function(){return this.workbook.getDefaultSize()};Worksheet.prototype.getBaseColWidth=function(){return this.oSheetFormatPr.nBaseColWidth||8};Worksheet.prototype.charCountToModelColWidth=function(count){return this.workbook.charCountToModelColWidth(count)};Worksheet.prototype.modelColWidthToColWidth=function(mcw){return this.workbook.modelColWidthToColWidth(mcw)};Worksheet.prototype.colWidthToCharCount=function(w){return this.workbook.colWidthToCharCount(w)}; Worksheet.prototype.getColWidth=function(index){var col=this._getColNoEmptyWithAll(index);if(null!=col&&null!=col.width)return col.width;var dResult=this.oSheetFormatPr.dDefaultColWidth;if(dResult===undefined||dResult===null||dResult==0)dResult=-1;return dResult};Worksheet.prototype.setColWidth=function(width,start,stop){width=this.charCountToModelColWidth(width);if(0==width)return this.setColHidden(true,start,stop);if(null==start)return;if(null==stop)stop=start;History.Create_NewPoint();var oSelection= History.GetSelection();if(null!=oSelection){oSelection=oSelection.clone();oSelection.assign(start,0,stop,gc_nMaxRow0);History.SetSelection(oSelection);History.SetSelectionRedo(oSelection)}var bNotAddCollapsed=true==this.workbook.bUndoChanges||true==this.workbook.bRedoChanges||this.bExcludeCollapsed;var _summaryRight=this.sheetPr?this.sheetPr.SummaryRight:true;var oThis=this,prevCol;var fProcessCol=function(col){if(col.width!=width){if(_summaryRight&&!bNotAddCollapsed&&col.getCollapsed())oThis.setCollapsedCol(false, null,col);else if(!_summaryRight&&!bNotAddCollapsed&&prevCol&&prevCol.getCollapsed())oThis.setCollapsedCol(false,null,prevCol);prevCol=col;var oOldProps=col.getWidthProp();col.width=width;col.CustomWidth=true;col.BestFit=null;col.setHidden(null);oThis.initColumn(col);var oNewProps=col.getWidthProp();if(false==oOldProps.isEqual(oNewProps))History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_ColProp,oThis.getId(),col._getUpdateRange(),new UndoRedoData_IndexSimpleProp(col.index, false,oOldProps,oNewProps))}};if(0===start&&gc_nMaxCol0===stop){var col=this.getAllCol();fProcessCol(col);for(var i in this.aCols){var col=this.aCols[i];if(null!=col)fProcessCol(col)}}else{if(!_summaryRight)if(!bNotAddCollapsed&&start>0)prevCol=this._getCol(start-1);for(var i=start;i<=stop;i++){var col=this._getCol(i);fProcessCol(col)}if(_summaryRight&&!bNotAddCollapsed&&prevCol){col=this._getCol(stop+1);if(col.getCollapsed())this.setCollapsedCol(false,null,col)}}};Worksheet.prototype.getColHidden= function(index){var col=this._getColNoEmptyWithAll(index);return col?col.getHidden():false};Worksheet.prototype.setColHidden=function(bHidden,start,stop){if(null==start)return;if(null==stop)stop=start;History.Create_NewPoint();var oThis=this,outlineLevel;var bNotAddCollapsed=true==this.workbook.bUndoChanges||true==this.workbook.bRedoChanges||this.bExcludeCollapsed;var _summaryRight=this.sheetPr?this.sheetPr.SummaryRight:true;var fProcessCol=function(col){if(col&&!bNotAddCollapsed&&outlineLevel!== undefined&&outlineLevel!==col.getOutlineLevel())if(!_summaryRight)oThis.setCollapsedCol(bHidden,col.index-1);else oThis.setCollapsedCol(bHidden,null,col);outlineLevel=col?col.getOutlineLevel():null;if(col.getHidden()!=bHidden){var oOldProps=col.getWidthProp();if(bHidden){col.setHidden(bHidden);if(null==col.width||true!=col.CustomWidth)col.width=0;col.CustomWidth=true;col.BestFit=null}else{col.setHidden(null);if(0>=col.width)col.width=null}var oNewProps=col.getWidthProp();if(false==oOldProps.isEqual(oNewProps))History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_ColProp,oThis.getId(),col._getUpdateRange(),new UndoRedoData_IndexSimpleProp(col.index,false,oOldProps,oNewProps))}};if(!bNotAddCollapsed&&!_summaryRight&&start>0){col=this._getCol(start-1);outlineLevel=col.getOutlineLevel()}if(0===start&&gc_nMaxCol0===stop){var col=null;if(false==bHidden)col=this.oAllCol;else col=this.getAllCol();if(null!=col)fProcessCol(col);for(var i in this.aCols){var col=this.aCols[i];if(null!=col)fProcessCol(col)}}else for(var i=start;i<=stop;i++){var col= null;if(false==bHidden)col=this._getColNoEmpty(i);else col=this._getCol(i);if(null!=col)fProcessCol(col)}if(!bNotAddCollapsed&&outlineLevel&&_summaryRight){col=this._getCol(stop+1);if(col&&outlineLevel!==col.getOutlineLevel())oThis.setCollapsedCol(bHidden,null,col)}};Worksheet.prototype.setCollapsedCol=function(bCollapse,colIndex,curCol){var oThis=this;var fProcessCol=function(col){var oOldProps=col.getCollapsed();col.setCollapsed(bCollapse);var oNewProps=col.getCollapsed();if(oOldProps!==oNewProps)History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_CollapsedCol,oThis.getId(),col._getUpdateRange(),new UndoRedoData_IndexSimpleProp(col.index,true,oOldProps,oNewProps))};if(curCol)fProcessCol(curCol);else this.getRange3(0,colIndex,0,colIndex)._foreachCol(fProcessCol)};Worksheet.prototype.setSummaryRight=function(val){if(!this.sheetPr)this.sheetPr=new AscCommonExcel.asc_CSheetPr;History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SetSummaryRight,this.getId(),null,new UndoRedoData_FromTo(this.sheetPr.SummaryRight, val));this.sheetPr.SummaryRight=val};Worksheet.prototype.setSummaryBelow=function(val){if(!this.sheetPr)this.sheetPr=new AscCommonExcel.asc_CSheetPr;History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SetSummaryBelow,this.getId(),null,new UndoRedoData_FromTo(this.sheetPr.SummaryBelow,val));this.sheetPr.SummaryBelow=val};Worksheet.prototype.setFitToPage=function(val){if(this.sheetPr&&val!==this.sheetPr.FitToPage||!this.sheetPr&&val){if(!this.sheetPr)this.sheetPr= new AscCommonExcel.asc_CSheetPr;History.Create_NewPoint();History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SetFitToPage,this.getId(),null,new UndoRedoData_FromTo(this.sheetPr.FitToPage,val));this.sheetPr.FitToPage=val}};Worksheet.prototype.setGroupCol=function(bDel,start,stop){var oThis=this;var fProcessCol=function(col){col.setOutlineLevel(null,bDel)};this.getRange3(0,start,0,stop)._foreachCol(fProcessCol)};Worksheet.prototype.setOutlineCol=function(val,start,stop){var oThis= this;var fProcessCol=function(col){col.setOutlineLevel(val)};this.getRange3(0,start,0,stop)._foreachCol(fProcessCol)};Worksheet.prototype.getColCustomWidth=function(index){var isBestFit;var column=this._getColNoEmptyWithAll(index);if(!column)isBestFit=true;else if(column.getHidden())isBestFit=false;else isBestFit=!!(column.BestFit||null===column.BestFit&&null===column.CustomWidth);return!isBestFit};Worksheet.prototype.setColBestFit=function(bBestFit,width,start,stop){if(null==start)return;if(null== stop)stop=start;History.Create_NewPoint();var oThis=this;var fProcessCol=function(col){var oOldProps=col.getWidthProp();if(bBestFit){col.BestFit=bBestFit;col.setHidden(null)}else col.BestFit=null;col.width=width;oThis.initColumn(col);var oNewProps=col.getWidthProp();if(false==oOldProps.isEqual(oNewProps))History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_ColProp,oThis.getId(),col._getUpdateRange(),new UndoRedoData_IndexSimpleProp(col.index,false,oOldProps,oNewProps))};if(0=== start&&gc_nMaxCol0===stop){var col=null;if(bBestFit&&oDefaultMetrics.ColWidthChars==width)col=this.oAllCol;else col=this.getAllCol();if(null!=col)fProcessCol(col);for(var i in this.aCols){var col=this.aCols[i];if(null!=col)fProcessCol(col)}}else for(var i=start;i<=stop;i++){var col=null;if(bBestFit&&oDefaultMetrics.ColWidthChars==width)col=this._getColNoEmpty(i);else col=this._getCol(i);if(null!=col)fProcessCol(col)}};Worksheet.prototype.isDefaultHeightHidden=function(){return null!=this.oSheetFormatPr.oAllRow&& this.oSheetFormatPr.oAllRow.getHidden()};Worksheet.prototype.isDefaultWidthHidden=function(){return null!=this.oAllCol&&this.oAllCol.getHidden()};Worksheet.prototype.setDefaultHeight=function(h){if(this.oSheetFormatPr.oAllRow&&!this.oSheetFormatPr.oAllRow.getCustomHeight())this.oSheetFormatPr.oAllRow.h=h};Worksheet.prototype.getDefaultHeight=function(){var dRes=null;if(null!=this.oSheetFormatPr.oAllRow&&this.oSheetFormatPr.oAllRow.getCustomHeight())dRes=this.oSheetFormatPr.oAllRow.h;return dRes}; Worksheet.prototype.getRowHeight=function(index){var res;this._getRowNoEmptyWithAll(index,function(row){res=row?row.getHeight():-1});return res};Worksheet.prototype.setRowHeight=function(height,start,stop,isCustom){if(0==height)return this.setRowHidden(true,start,stop);if(null==start)return;if(null==stop)stop=start;History.Create_NewPoint();var oThis=this,i;var oSelection=History.GetSelection();if(null!=oSelection){oSelection=oSelection.clone();oSelection.assign(0,start,gc_nMaxCol0,stop);History.SetSelection(oSelection); History.SetSelectionRedo(oSelection)}var prevRow;var bNotAddCollapsed=true==this.workbook.bUndoChanges||true==this.workbook.bRedoChanges||this.bExcludeCollapsed;var _summaryBelow=this.sheetPr?this.sheetPr.SummaryBelow:true;var fProcessRow=function(row){if(row){if(_summaryBelow&&!bNotAddCollapsed&&row.getCollapsed())oThis.setCollapsedRow(false,null,row);else if(!_summaryBelow&&!bNotAddCollapsed&&prevRow&&prevRow.getCollapsed())oThis.setCollapsedRow(false,null,prevRow);prevRow=row;var oOldProps=row.getHeightProp(); row.setHeight(height);if(isCustom)row.setCustomHeight(true);row.setCalcHeight(true);row.setHidden(false);var oNewProps=row.getHeightProp();if(false===oOldProps.isEqual(oNewProps))History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RowProp,oThis.getId(),row._getUpdateRange(),new UndoRedoData_IndexSimpleProp(row.index,true,oOldProps,oNewProps))}};if(0==start&&gc_nMaxRow0==stop){fProcessRow(this.getAllRow());this._forEachRow(fProcessRow)}else{if(!_summaryBelow)if(!bNotAddCollapsed&& start>0)this._getRow(start-1,function(row){prevRow=row});this.getRange3(start,0,stop,0)._foreachRow(fProcessRow);if(_summaryBelow)if(!bNotAddCollapsed&&prevRow)this._getRow(stop+1,function(row){if(row.getCollapsed())oThis.setCollapsedRow(false,null,row)})}if(this.needRecalFormulas(start,stop))this.workbook.dependencyFormulas.calcTree()};Worksheet.prototype.getRowHidden=function(index){var res;this._getRowNoEmptyWithAll(index,function(row){res=row?row.getHidden():false});return res};Worksheet.prototype.setRowHidden= function(bHidden,start,stop){if(null==start)return;if(null==stop)stop=start;var oThis=this;var doHide=function(_start,_stop,localChange){var i;var startIndex=null,endIndex=null,updateRange,outlineLevel;var bNotAddCollapsed=true==oThis.workbook.bUndoChanges||true==oThis.workbook.bRedoChanges||oThis.bExcludeCollapsed;var _summaryBelow=oThis.sheetPr?oThis.sheetPr.SummaryBelow:true;var fProcessRow=function(row){if(row&&!bNotAddCollapsed&&outlineLevel!==undefined&&outlineLevel!==row.getOutlineLevel())if(!_summaryBelow)oThis.setCollapsedRow(bHidden, row.index-1);else oThis.setCollapsedRow(bHidden,null,row);outlineLevel=row?row.getOutlineLevel():null;if(row&&bHidden!=row.getHidden()){row.setHidden(bHidden,localChange);if(row.index===endIndex+1&&startIndex!==null)endIndex++;else{if(startIndex!==null){updateRange=new Asc.Range(0,startIndex,gc_nMaxCol0,endIndex);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RowHide,oThis.getId(),updateRange,new UndoRedoData_FromToRowCol(bHidden,startIndex,endIndex))}startIndex=row.index; endIndex=row.index}}};if(0==_start&&gc_nMaxRow0==_stop);else{if(!_summaryBelow&&_start>0&&!bNotAddCollapsed)oThis._getRow(_start-1,function(row){if(row)outlineLevel=row.getOutlineLevel()});for(i=_start;i<=_stop;++i)false==bHidden?oThis._getRowNoEmpty(i,fProcessRow):oThis._getRow(i,fProcessRow);if(_summaryBelow&&outlineLevel&&!bNotAddCollapsed)oThis._getRow(_stop+1,function(row){if(row&&outlineLevel!==row.getOutlineLevel())oThis.setCollapsedRow(bHidden,null,row)});if(startIndex!==null){updateRange= new Asc.Range(0,startIndex,gc_nMaxCol0,endIndex);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RowHide,oThis.getId(),updateRange,new UndoRedoData_FromToRowCol(bHidden,startIndex,endIndex))}}};var bCollaborativeChanges=!this.autoFilters.useViewLocalChange&&this.workbook.bCollaborativeChanges;if(!bCollaborativeChanges&&null!==this.getActiveNamedSheetViewId()){var rowsArr=this.autoFilters.splitRangeByFilters(start,stop);if(rowsArr){var j;History.Create_NewPoint();if(rowsArr[0]&& rowsArr[0].length){var oldLocalChange=History.LocalChange;History.LocalChange=true;for(j=0;j<rowsArr[0].length;j++)doHide(rowsArr[0][j].start,rowsArr[0][j].stop,true);History.LocalChange=oldLocalChange}if(rowsArr[1]&&rowsArr[1].length)for(j=0;j<rowsArr[1].length;j++)doHide(rowsArr[1][j].start,rowsArr[1][j].stop)}}else{History.Create_NewPoint();doHide(start,stop)}if(this.needRecalFormulas(start,stop))this.workbook.dependencyFormulas.calcTree()};Worksheet.prototype.setCollapsedRow=function(bCollapse, rowIndex,curRow){var oThis=this;var fProcessRow=function(row,bSave){var oOldProps=row.getCollapsed();row.setCollapsed(bCollapse);var oNewProps=row.getCollapsed();if(oOldProps!==oNewProps)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_CollapsedRow,oThis.getId(),row._getUpdateRange(),new UndoRedoData_IndexSimpleProp(row.index,true,oOldProps,oNewProps));if(bSave)row.saveContent(true)};if(curRow)fProcessRow(curRow,true);else this.getRange3(rowIndex,0,rowIndex,0)._foreachRow(fProcessRow)}; Worksheet.prototype.setGroupRow=function(bDel,start,stop){var oThis=this;var fProcessRow=function(row){row.setOutlineLevel(null,bDel)};this.getRange3(start,0,stop,0)._foreachRow(fProcessRow)};Worksheet.prototype.setOutlineRow=function(val,start,stop){var oThis=this;var fProcessRow=function(row){row.setOutlineLevel(val)};this.getRange3(start,0,stop,0)._foreachRow(fProcessRow)};Worksheet.prototype.getRowCustomHeight=function(index){var isCustomHeight=false;this._getRowNoEmptyWithAll(index,function(row){if(!row)isCustomHeight= false;else if(row.getHidden())isCustomHeight=true;else isCustomHeight=row.getCustomHeight()});return isCustomHeight};Worksheet.prototype.setRowBestFit=function(bBestFit,height,start,stop){if(null==start)return;if(null==stop)stop=start;History.Create_NewPoint();var oThis=this,i;var isDefaultProp=true==bBestFit&&oDefaultMetrics.RowHeight==height;var fProcessRow=function(row){if(row){var oOldProps=row.getHeightProp();row.setCustomHeight(!bBestFit);row.setCalcHeight(true);row.setHeight(height);var oNewProps= row.getHeightProp();if(false==oOldProps.isEqual(oNewProps))History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RowProp,oThis.getId(),row._getUpdateRange(),new UndoRedoData_IndexSimpleProp(row.index,true,oOldProps,oNewProps))}};if(0==start&&gc_nMaxRow0==stop){fProcessRow(isDefaultProp?this.oSheetFormatPr.oAllRow:this.getAllRow());this._forEachRow(fProcessRow)}else{var range=this.getRange3(start,0,stop,0);if(isDefaultProp)range._foreachRowNoEmpty(fProcessRow);else range._foreachRow(fProcessRow)}this.workbook.dependencyFormulas.calcTree()}; Worksheet.prototype.getCell=function(oCellAdd){return this.getRange(oCellAdd,oCellAdd)};Worksheet.prototype.getCell2=function(sCellAdd){if(sCellAdd.indexOf("$")>-1)sCellAdd=sCellAdd.replace(/\$/g,"");return this.getRange2(sCellAdd)};Worksheet.prototype.getCell3=function(r1,c1){return this.getRange3(r1,c1,r1,c1)};Worksheet.prototype.getRange=function(cellAdd1,cellAdd2){var nRow1=cellAdd1.getRow0();var nCol1=cellAdd1.getCol0();var nRow2=cellAdd2.getRow0();var nCol2=cellAdd2.getCol0();return this.getRange3(nRow1, nCol1,nRow2,nCol2)};Worksheet.prototype.getRange2=function(sRange){var bbox=AscCommonExcel.g_oRangeCache.getAscRange(sRange);if(null!=bbox)return Range.prototype.createFromBBox(this,bbox);return null};Worksheet.prototype.getRange3=function(r1,c1,r2,c2){var nRowMin=r1;var nRowMax=r2;var nColMin=c1;var nColMax=c2;if(r1>r2){nRowMax=r1;nRowMin=r2}if(c1>c2){nColMax=c1;nColMin=c2}return new Range(this,nRowMin,nColMin,nRowMax,nColMax)};Worksheet.prototype.getRange4=function(r,c){return new Range(this,r, c,r,c)};Worksheet.prototype.getRowIterator=function(r1,c1,c2,callback){var it=new RowIterator;it.init(this,r1,c1,c2);callback(it);it.release()};Worksheet.prototype.getCellForValidation=function(row,col,array,formula,callback,isCopyPaste,byRef){var cell=new Cell(this);cell.setRowCol(row,col);cell.setValueForValidation(array,formula,callback,isCopyPaste,byRef);return cell};Worksheet.prototype._removeCell=function(nRow,nCol,cell){var t=this;var processCell=function(cell){if(null!=cell){var sheetId=t.getId(); if(false==cell.isEmpty()){var oUndoRedoData_CellData=new AscCommonExcel.UndoRedoData_CellData(cell.getValueData(),null);if(null!=cell.xfs)oUndoRedoData_CellData.style=cell.xfs.clone();cell.setFormulaInternal(null);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RemoveCell,sheetId,new Asc.Range(nCol,nRow,nCol,nRow),new UndoRedoData_CellSimpleData(nRow,nCol,oUndoRedoData_CellData,null))}t.workbook.dependencyFormulas.addToChangedCell(cell);cell.clearData();cell.saveContent(true)}}; if(null!=cell){nRow=cell.nRow;nCol=cell.nCol;processCell(cell)}else this._getCellNoEmpty(nRow,nCol,processCell)};Worksheet.prototype._getCell=function(row,col,fAction){var wb=this.workbook;var targetCell=null;for(var k=0;k<wb.loadCells.length;++k){var elem=wb.loadCells[k];if(elem.nRow==row&&elem.nCol==col&&this===elem.ws){targetCell=elem;break}}if(null===targetCell){var cell=new Cell(this);wb.loadCells.push(cell);if(!cell.loadContent(row,col))this._initCell(cell,row,col);fAction(cell);cell.saveContent(true); wb.loadCells.pop()}else fAction(targetCell)};Worksheet.prototype._initRow=function(row,index){var t=this;row.setChanged(true);if(null!=this.oSheetFormatPr.oAllRow){row.copyFrom(this.oSheetFormatPr.oAllRow);row.setIndex(index)}this.nRowsCount=index>=this.nRowsCount?index+1:this.nRowsCount};Worksheet.prototype._initCell=function(cell,nRow,nCol){var t=this;cell.setChanged(true);this._getRowNoEmpty(nRow,function(row){var oCol=t._getColNoEmptyWithAll(nCol);var xfs=null;if(row&&null!=row.xfs)xfs=row.xfs.clone(); else if(null!=oCol&&null!=oCol.xfs)xfs=oCol.xfs.clone();cell.setStyleInternal(xfs);t.cellsByColRowsCount=Math.max(t.cellsByColRowsCount,nRow+1);t.nRowsCount=Math.max(t.nRowsCount,t.cellsByColRowsCount);if(nCol>=t.nColsCount)t.nColsCount=nCol+1});var sheetMemory=this.getColData(nCol);sheetMemory.checkSize(nRow)};Worksheet.prototype._getCellNoEmpty=function(row,col,fAction){var wb=this.workbook;var targetCell=null;for(var k=0;k<wb.loadCells.length;++k){var elem=wb.loadCells[k];if(elem.nRow==row&&elem.nCol== col&&this===elem.ws){targetCell=elem;break}}if(null===targetCell){var cell=new Cell(this);var res=cell.loadContent(row,col)?cell:null;if(res&&fAction)wb.loadCells.push(cell);fAction(res);cell.saveContent(true);if(res)wb.loadCells.pop()}else fAction(targetCell)};Worksheet.prototype._getRowNoEmpty=function(nRow,fAction){var row=new AscCommonExcel.Row(this);if(row.loadContent(nRow)){fAction(row);row.saveContent(true)}else fAction(null)};Worksheet.prototype._getRowNoEmptyWithAll=function(nRow,fAction){var t= this;this._getRowNoEmpty(nRow,function(row){if(!row)row=t.oSheetFormatPr.oAllRow;fAction(row)})};Worksheet.prototype._getColNoEmpty=function(col){return this.aCols[col]||null};Worksheet.prototype._getColNoEmptyWithAll=function(col){return this._getColNoEmpty(col)||this.oAllCol};Worksheet.prototype._getRow=function(index,fAction){var row=null;if(g_nAllRowIndex==index)row=this.getAllRow();else{row=new AscCommonExcel.Row(this);if(!row.loadContent(index))this._initRow(row,index)}fAction(row);row.saveContent(true)}; Worksheet.prototype._getCol=function(index){var oCurCol;if(g_nAllColIndex==index)oCurCol=this.getAllCol();else{oCurCol=this.aCols[index];if(null==oCurCol){if(null!=this.oAllCol){oCurCol=this.oAllCol.clone();oCurCol.index=index}else oCurCol=new AscCommonExcel.Col(this,index);this.aCols[index]=oCurCol;this.nColsCount=index>=this.nColsCount?index+1:this.nColsCount}}return oCurCol};Worksheet.prototype._prepareMoveRangeGetCleanRanges=function(oBBoxFrom,oBBoxTo,wsTo){var intersection=oBBoxFrom.intersectionSimple(oBBoxTo); var aRangesToCheck=[];if(null!=intersection&&this===wsTo){var oThis=this;var fAddToRangesToCheck=function(aRangesToCheck,r1,c1,r2,c2){if(r1<=r2&&c1<=c2)aRangesToCheck.push(oThis.getRange3(r1,c1,r2,c2))};if(intersection.r1==oBBoxTo.r1&&intersection.c1==oBBoxTo.c1){fAddToRangesToCheck(aRangesToCheck,oBBoxTo.r1,intersection.c2+1,intersection.r2,oBBoxTo.c2);fAddToRangesToCheck(aRangesToCheck,intersection.r2+1,oBBoxTo.c1,oBBoxTo.r2,oBBoxTo.c2)}else if(intersection.r2==oBBoxTo.r2&&intersection.c1==oBBoxTo.c1){fAddToRangesToCheck(aRangesToCheck, oBBoxTo.r1,oBBoxTo.c1,intersection.r1-1,oBBoxTo.c2);fAddToRangesToCheck(aRangesToCheck,intersection.r1,intersection.c2+1,oBBoxTo.r2,oBBoxTo.c2)}else if(intersection.r1==oBBoxTo.r1&&intersection.c2==oBBoxTo.c2){fAddToRangesToCheck(aRangesToCheck,oBBoxTo.r1,oBBoxTo.c1,intersection.r2,intersection.c1-1);fAddToRangesToCheck(aRangesToCheck,intersection.r2+1,oBBoxTo.c1,oBBoxTo.r2,oBBoxTo.c2)}else if(intersection.r2==oBBoxTo.r2&&intersection.c2==oBBoxTo.c2){fAddToRangesToCheck(aRangesToCheck,oBBoxTo.r1, oBBoxTo.c1,intersection.r1-1,oBBoxTo.c2);fAddToRangesToCheck(aRangesToCheck,intersection.r1,oBBoxTo.c1,oBBoxTo.r2,intersection.c1-1)}}else aRangesToCheck.push(wsTo.getRange3(oBBoxTo.r1,oBBoxTo.c1,oBBoxTo.r2,oBBoxTo.c2));return aRangesToCheck};Worksheet.prototype._prepareMoveRange=function(oBBoxFrom,oBBoxTo,wsTo){var res=0;if(!wsTo)wsTo=this;if(oBBoxFrom.isEqual(oBBoxTo)&&this===wsTo)return res;var range=wsTo.getRange3(oBBoxTo.r1,oBBoxTo.c1,oBBoxTo.r2,oBBoxTo.c2);var aMerged=wsTo.mergeManager.get(range.getBBox0()); if(aMerged.outer.length>0)return-2;var aRangesToCheck=this._prepareMoveRangeGetCleanRanges(oBBoxFrom,oBBoxTo,wsTo);for(var i=0,length=aRangesToCheck.length;i<length;i++){range=aRangesToCheck[i];range._foreachNoEmpty(function(cell){if(!cell.isNullTextString()){res=-1;return res}});if(0!=res)return res}return res};Worksheet.prototype._movePivots=function(oBBoxFrom,oBBoxTo,copyRange,offset,wsTo){if(!wsTo)wsTo=this;if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)if(copyRange){wsTo.deletePivotTables(oBBoxTo); this.copyPivotTable(oBBoxFrom,offset,wsTo)}else if(this===wsTo){this.deletePivotTablesOnMove(oBBoxFrom,oBBoxTo);this.movePivotOffset(oBBoxFrom,offset)}else{this.copyPivotTable(oBBoxFrom,offset,wsTo);this._movePivotSlicerWsRefs(oBBoxTo,this,wsTo);this.deletePivotTables(oBBoxFrom,true)}};Worksheet.prototype._movePivotSlicerWsRefs=function(range,wsFrom,wsTo){var wb=this.workbook;var pivotTable;for(var i=0;i<wsTo.pivotTables.length;++i){pivotTable=wsTo.pivotTables[i];if(pivotTable.isInRange(range)){var slicerCaches= wb.getSlicerCachesByPivotTable(wsFrom.getId(),pivotTable.asc_getName());slicerCaches.forEach(function(slicerCache){slicerCache.movePivotTable(wsFrom.getId(),pivotTable.asc_getName(),wsTo.getId(),pivotTable.asc_getName())})}}};Worksheet.prototype._moveMergedAndHyperlinksPrepare=function(oBBoxFrom,oBBoxTo,copyRange,wsTo,offset){var res={merged:[],hyperlinks:[]};if(!(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges||this.workbook.bCollaborativeChanges)))return res;var i,elem,bbox, data,wsFrom=this;var intersection=oBBoxFrom.intersectionSimple(oBBoxTo);History.LocalChange=true;var merged=wsFrom.mergeManager.get(oBBoxFrom).inner;var mergedToRemove;if(!copyRange)mergedToRemove=merged;else if(null!==intersection)mergedToRemove=wsFrom.mergeManager.get(intersection).all;if(mergedToRemove)for(i=0;i<mergedToRemove.length;i++)wsFrom.mergeManager.removeElement(mergedToRemove[i]);var hyperlinks=wsFrom.hyperlinkManager.get(oBBoxFrom).inner;if(!copyRange)for(i=0;i<hyperlinks.length;i++)wsFrom.hyperlinkManager.removeElement(hyperlinks[i]); History.LocalChange=false;res.merged=merged;res.hyperlinks=hyperlinks;return res};Worksheet.prototype._moveMergedAndHyperlinks=function(prepared,oBBoxFrom,oBBoxTo,copyRange,wsTo,offset){var i,elem,bbox,data;var intersection=oBBoxFrom.intersectionSimple(oBBoxTo);History.LocalChange=true;for(i=0;i<prepared.merged.length;i++){elem=prepared.merged[i];bbox=copyRange?elem.bbox.clone():elem.bbox;bbox.setOffset(offset);wsTo.mergeManager.add(bbox,elem.data)}if(!copyRange||null===intersection)for(i=0;i<prepared.hyperlinks.length;i++){elem= prepared.hyperlinks[i];if(copyRange){bbox=elem.bbox.clone();data=elem.data.clone()}else{bbox=elem.bbox;data=elem.data}bbox.setOffset(offset);wsTo.hyperlinkManager.add(bbox,data)}History.LocalChange=false};Worksheet.prototype._moveCleanRanges=function(oBBoxFrom,oBBoxTo,copyRange,wsTo){var cleanRanges=this._prepareMoveRangeGetCleanRanges(oBBoxFrom,oBBoxTo,wsTo);for(var i=0;i<cleanRanges.length;i++){var range=cleanRanges[i];range.cleanAll();if(!copyRange)this.workbook.dependencyFormulas.deleteNodes(wsTo.getId(), range.getBBox0())}};Worksheet.prototype._moveFormulas=function(oBBoxFrom,oBBoxTo,copyRange,wsTo,offset){if(!copyRange)this.workbook.dependencyFormulas.move(this.Id,oBBoxFrom,offset,wsTo.getId());this.getRange3(oBBoxFrom.r1,oBBoxFrom.c1,oBBoxFrom.r2,oBBoxFrom.c2)._foreachNoEmpty(function(cell){if(cell.transformSharedFormula()){var parsed=cell.getFormulaParsed();parsed.buildDependencies()}})};Worksheet.prototype._moveCells=function(oBBoxFrom,oBBoxTo,copyRange,wsTo,offset){var oThis=this;var nRowsCountNew= 0;var nColsCountNew=0;var dependencyFormulas=oThis.workbook.dependencyFormulas;var moveToOtherSheet=this!==wsTo;var isClearFromArea=!copyRange||copyRange&&oThis.workbook.bUndoChanges;var moveCells=function(copyRange,from,to,r1From,r1To,count){var fromData=oThis.getColDataNoEmpty(from);var toData;if(fromData){toData=wsTo.getColData(to);toData.copyRange(fromData,r1From,r1To,count);if(isClearFromArea)if(from!==to||moveToOtherSheet)fromData.clear(r1From,r1From+count);else if(r1From<r1To)fromData.clear(r1From, Math.min(r1From+count,r1To));else fromData.clear(Math.max(r1From,r1To+count),r1From+count)}else{toData=wsTo.getColDataNoEmpty(to);if(toData)toData.clear(r1To,r1To+count)}if(toData){nRowsCountNew=Math.max(nRowsCountNew,toData.getSize());nColsCountNew=Math.max(nColsCountNew,to+1)}};if(oBBoxFrom.c1<oBBoxTo.c1)for(var i=0;i<oBBoxFrom.c2-oBBoxFrom.c1+1;++i)moveCells(copyRange,oBBoxFrom.c2-i,oBBoxTo.c2-i,oBBoxFrom.r1,oBBoxTo.r1,oBBoxFrom.r2-oBBoxFrom.r1+1);else for(var i=0;i<oBBoxFrom.c2-oBBoxFrom.c1+1;++i)moveCells(copyRange, oBBoxFrom.c1+i,oBBoxTo.c1+i,oBBoxFrom.r1,oBBoxTo.r1,oBBoxFrom.r2-oBBoxFrom.r1+1);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_MoveRange,this.getId(),new Asc.Range(0,0,gc_nMaxCol0,gc_nMaxRow0),new UndoRedoData_FromTo(new UndoRedoData_BBox(oBBoxFrom),new UndoRedoData_BBox(oBBoxTo),copyRange,wsTo.getId()));if(moveToOtherSheet)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_Null,wsTo.getId(),oBBoxTo,new UndoRedoData_FromTo(null,null));var shiftedArrayFormula= {};var oldNewArrayFormulaMap={};wsTo.cellsByColRowsCount=Math.max(wsTo.cellsByColRowsCount,nRowsCountNew);wsTo.nRowsCount=Math.max(wsTo.nRowsCount,wsTo.cellsByColRowsCount);wsTo.nColsCount=Math.max(wsTo.nColsCount,nColsCountNew);wsTo.getRange3(oBBoxTo.r1,oBBoxTo.c1,oBBoxTo.r2,oBBoxTo.c2)._foreachNoEmpty(function(cell){var formula=cell.getFormulaParsed();if(formula){var cellWithFormula=formula.getParent();var arrayFormula=formula.getArrayFormulaRef();var newArrayRef,newFormula;var preMoveCell={nRow:cell.nRow- offset.row,nCol:cell.nCol-offset.col};var isFirstCellArray=formula.checkFirstCellArray(preMoveCell)&&!shiftedArrayFormula[formula.getListenerId()];if(copyRange){History.TurnOff();if(!arrayFormula||arrayFormula&&isFirstCellArray){newFormula=oThis._moveCellsFormula(cell,formula,cellWithFormula,copyRange,oBBoxFrom,wsTo);cellWithFormula=newFormula.getParent();cellWithFormula=new CCellWithFormula(wsTo,cell.nRow,cell.nCol);newFormula=newFormula.clone(null,cellWithFormula,wsTo);newFormula.changeOffset(offset, false,true);newFormula.setFormulaString(newFormula.assemble(true));cell.setFormulaInternal(newFormula,!isClearFromArea);if(isFirstCellArray){newArrayRef=arrayFormula.clone();newArrayRef.setOffset(offset);newFormula.setArrayFormulaRef(newArrayRef);shiftedArrayFormula[newFormula.getListenerId()]=1;oldNewArrayFormulaMap[formula.getListenerId()]=newFormula}}else if(arrayFormula&&oldNewArrayFormulaMap[formula.getListenerId()])cell.setFormulaInternal(oldNewArrayFormulaMap[formula.getListenerId()],!isClearFromArea); History.TurnOn()}else if(arrayFormula){if(isFirstCellArray){newFormula=oThis._moveCellsFormula(cell,formula,cellWithFormula,copyRange,oBBoxFrom,wsTo);cellWithFormula=newFormula.getParent();shiftedArrayFormula[formula.getListenerId()]=1;newArrayRef=arrayFormula.clone();newArrayRef.setOffset(offset);newFormula.setArrayFormulaRef(newArrayRef);cellWithFormula.ws=wsTo;cellWithFormula.nRow=cell.nRow;cellWithFormula.nCol=cell.nCol}}else{newFormula=oThis._moveCellsFormula(cell,formula,cellWithFormula,copyRange, oBBoxFrom,wsTo);cellWithFormula=newFormula.getParent();cellWithFormula.ws=wsTo;cellWithFormula.nRow=cell.nRow;cellWithFormula.nCol=cell.nCol}if(arrayFormula){if(isFirstCellArray){dependencyFormulas.addToBuildDependencyArray(formula);if(newFormula)dependencyFormulas.addToBuildDependencyArray(newFormula)}}else dependencyFormulas.addToBuildDependencyCell(cell)}})};Worksheet.prototype._moveCellsFormula=function(cell,formula,cellWithFormula,copyRange,oBBoxFrom,wsTo){if(this!==wsTo)if(copyRange||!this.workbook.bUndoChanges){cellWithFormula= new CCellWithFormula(wsTo,cell.nRow,cell.nCol);formula=formula.clone(null,cellWithFormula,wsTo);if(!copyRange)formula.convertTo3DRefs(oBBoxFrom);formula.moveToSheet(this,wsTo);formula.setFormulaString(formula.assemble(true));cell.setFormulaParsed(formula)}else{formula.moveToSheet(this,wsTo);formula.setFormulaString(formula.assemble(true))}return formula};Worksheet.prototype._moveRange=function(oBBoxFrom,oBBoxTo,copyRange,wsTo){if(!wsTo)wsTo=this;if(oBBoxFrom.isEqual(oBBoxTo)&&this===wsTo)return;History.Create_NewPoint(); History.StartTransaction();this.workbook.dependencyFormulas.lockRecal();var offset=new AscCommon.CellBase(oBBoxTo.r1-oBBoxFrom.r1,oBBoxTo.c1-oBBoxFrom.c1);var prepared=this._moveMergedAndHyperlinksPrepare(oBBoxFrom,oBBoxTo,copyRange,wsTo,offset);this._movePivots(oBBoxFrom,oBBoxTo,copyRange,offset,wsTo);this._moveCleanRanges(oBBoxFrom,oBBoxTo,copyRange,wsTo);this._moveFormulas(oBBoxFrom,oBBoxTo,copyRange,wsTo,offset);this._moveCells(oBBoxFrom,oBBoxTo,copyRange,wsTo,offset);this._moveMergedAndHyperlinks(prepared, oBBoxFrom,oBBoxTo,copyRange,wsTo,offset);this._moveDataValidation(oBBoxFrom,oBBoxTo,copyRange,offset,wsTo);if(true==this.workbook.bUndoChanges||true==this.workbook.bRedoChanges)wsTo.autoFilters.unmergeTablesAfterMove(oBBoxTo);if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)this.autoFilters._moveAutoFilters(oBBoxTo,oBBoxFrom,null,copyRange,true,oBBoxFrom,wsTo);this.workbook.dependencyFormulas.unlockRecal();History.EndTransaction();return true};Worksheet.prototype._shiftCellsLeft= function(oBBox){var t=this;var nLeft=oBBox.c1;var nRight=oBBox.c2;var dif=nLeft-nRight-1;var oActualRange=new Asc.Range(nLeft,oBBox.r1,gc_nMaxCol0,oBBox.r2);var offset=new AscCommon.CellBase(0,dif);var renameRes=this.renameDependencyNodes(offset,oBBox);var redrawTablesArr=this.autoFilters.insertColumn(oBBox,dif);if(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges||this.workbook.bCollaborativeChanges)){History.LocalChange=true;this.updateSortStateOffset(oBBox,offset);History.LocalChange= false}if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)this.updatePivotOffset(oBBox,offset);this.getRange3(oBBox.r1,oBBox.c1,oBBox.r2,oBBox.c2)._foreachNoEmpty(function(cell){t._removeCell(null,null,cell)});this._updateFormulasParents(oActualRange.r1,oActualRange.c1,oActualRange.r2,oActualRange.c2,oBBox,offset,renameRes.shiftedShared);var cellsByColLength=this.getColDataLength();for(var i=nRight+1;i<cellsByColLength;++i){var sheetMemoryFrom=this.getColDataNoEmpty(i);if(sheetMemoryFrom){this.getColData(i+ dif).copyRange(sheetMemoryFrom,oBBox.r1,oBBox.r1,oBBox.r2-oBBox.r1+1);sheetMemoryFrom.clear(oBBox.r1,oBBox.r2+1)}}this.workbook.dependencyFormulas.notifyChanged(renameRes.changed);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_ShiftCellsLeft,this.getId(),oActualRange,new UndoRedoData_BBox(oBBox));this.autoFilters.redrawStylesTables(redrawTablesArr)};Worksheet.prototype._shiftCellsUp=function(oBBox){var t=this;var nTop=oBBox.r1;var nBottom=oBBox.r2;var dif=nTop-nBottom- 1;var oActualRange=new Asc.Range(oBBox.c1,oBBox.r1,oBBox.c2,gc_nMaxRow0);var offset=new AscCommon.CellBase(dif,0);var renameRes=this.renameDependencyNodes(offset,oBBox);var redrawTablesArr=this.autoFilters.insertRows("delCell",oBBox,c_oAscDeleteOptions.DeleteCellsAndShiftTop);if(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges||this.workbook.bCollaborativeChanges)){History.LocalChange=true;this.updateSortStateOffset(oBBox,offset);History.LocalChange=false}if(false==this.workbook.bUndoChanges&& false==this.workbook.bRedoChanges)this.updatePivotOffset(oBBox,offset);this.getRange3(oBBox.r1,oBBox.c1,oBBox.r2,oBBox.c2)._foreachNoEmpty(function(cell){t._removeCell(null,null,cell)});this._updateFormulasParents(oActualRange.r1,oActualRange.c1,oActualRange.r2,oActualRange.c2,oBBox,offset,renameRes.shiftedShared);for(var i=oBBox.c1;i<=oBBox.c2;++i){var sheetMemory=this.getColDataNoEmpty(i);if(sheetMemory)sheetMemory.deleteRange(nTop,-dif)}this.workbook.dependencyFormulas.notifyChanged(renameRes.changed); History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_ShiftCellsTop,this.getId(),oActualRange,new UndoRedoData_BBox(oBBox));this.autoFilters.redrawStylesTables(redrawTablesArr)};Worksheet.prototype._shiftCellsRight=function(oBBox,displayNameFormatTable){var nLeft=oBBox.c1;var nRight=oBBox.c2;var dif=nRight-nLeft+1;var oActualRange=new Asc.Range(oBBox.c1,oBBox.r1,gc_nMaxCol0,oBBox.r2);var offset=new AscCommon.CellBase(0,dif);var renameRes=this.renameDependencyNodes(offset,oBBox); var redrawTablesArr=this.autoFilters.insertColumn(oBBox,dif,displayNameFormatTable);if(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges||this.workbook.bCollaborativeChanges)){History.LocalChange=true;this.updateSortStateOffset(oBBox,offset);History.LocalChange=false}if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)this.updatePivotOffset(oBBox,offset);this._updateFormulasParents(oActualRange.r1,oActualRange.c1,oActualRange.r2,oActualRange.c2,oBBox,offset, renameRes.shiftedShared);var borders;if(nLeft>0&&!this.workbook.bUndoChanges)borders=this._getBordersForInsert(oBBox,false);var cellsByColLength=this.getColDataLength();for(var i=cellsByColLength-1;i>=nLeft;--i){var sheetMemoryFrom=this.getColDataNoEmpty(i);if(sheetMemoryFrom){if(i+dif<=gc_nMaxCol0)this.getColData(i+dif).copyRange(sheetMemoryFrom,oBBox.r1,oBBox.r1,oBBox.r2-oBBox.r1+1);sheetMemoryFrom.clear(oBBox.r1,oBBox.r2+1)}}this.nColsCount=Math.max(this.nColsCount,this.getColDataLength());if(nLeft> 0&&!this.workbook.bUndoChanges){var prevSheetMemory=this.getColDataNoEmpty(nLeft-1);if(prevSheetMemory){for(var i=nLeft;i<=nRight;++i)this.getColData(i).copyRange(prevSheetMemory,oBBox.r1,oBBox.r1,oBBox.r2-oBBox.r1+1);this.nColsCount=Math.max(this.nColsCount,this.getColDataLength());this.getRange3(oBBox.r1,oBBox.c1,oBBox.r2,oBBox.c2)._foreachNoEmpty(function(cell){cell.clearDataKeepXf(borders[cell.nRow])})}}this.workbook.dependencyFormulas.notifyChanged(renameRes.changed);History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_ShiftCellsRight,this.getId(),oActualRange,new UndoRedoData_BBox(oBBox));this.autoFilters.redrawStylesTables(redrawTablesArr)};Worksheet.prototype._shiftCellsBottom=function(oBBox,displayNameFormatTable){var t=this;var nTop=oBBox.r1;var nBottom=oBBox.r2;var dif=nBottom-nTop+1;var oActualRange=new Asc.Range(oBBox.c1,oBBox.r1,oBBox.c2,gc_nMaxRow0);var offset=new AscCommon.CellBase(dif,0);var renameRes=this.renameDependencyNodes(offset,oBBox);var redrawTablesArr;if(!this.workbook.bUndoChanges&& undefined===displayNameFormatTable)redrawTablesArr=this.autoFilters.insertRows("insCell",oBBox,c_oAscInsertOptions.InsertCellsAndShiftDown,displayNameFormatTable);if(false==this.workbook.bUndoChanges&&false==this.workbook.bRedoChanges)this.updatePivotOffset(oBBox,offset);this._updateFormulasParents(oActualRange.r1,oActualRange.c1,oActualRange.r2,oActualRange.c2,oBBox,offset,renameRes.shiftedShared);if(false==this.workbook.bUndoChanges&&(false==this.workbook.bRedoChanges||this.workbook.bCollaborativeChanges)){History.LocalChange= true;this.updateSortStateOffset(oBBox,offset);History.LocalChange=false}var borders;if(nTop>0&&!this.workbook.bUndoChanges)borders=this._getBordersForInsert(oBBox,true);for(var i=oBBox.c1;i<=oBBox.c2;++i){var sheetMemory=this.getColDataNoEmpty(i);if(sheetMemory){sheetMemory.insertRange(nTop,dif);t.cellsByColRowsCount=Math.max(t.cellsByColRowsCount,sheetMemory.getSize())}}this.nRowsCount=Math.max(this.nRowsCount,this.cellsByColRowsCount);if(nTop>0&&!this.workbook.bUndoChanges){for(var i=oBBox.c1;i<= oBBox.c2;++i){var sheetMemory=this.getColDataNoEmpty(i);if(sheetMemory){sheetMemory.copyRangeByChunk(nTop-1,1,nTop,dif);t.cellsByColRowsCount=Math.max(t.cellsByColRowsCount,sheetMemory.getSize())}}this.nRowsCount=Math.max(this.nRowsCount,this.cellsByColRowsCount);this.getRange3(oBBox.r1,oBBox.c1,oBBox.r2,oBBox.c2)._foreachNoEmpty(function(cell){cell.clearDataKeepXf(borders[cell.nCol])})}this.workbook.dependencyFormulas.notifyChanged(renameRes.changed);History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_ShiftCellsBottom,this.getId(),oActualRange,new UndoRedoData_BBox(oBBox));if(!this.workbook.bUndoChanges&&undefined!==displayNameFormatTable)redrawTablesArr=this.autoFilters.insertRows("insCell",oBBox,c_oAscInsertOptions.InsertCellsAndShiftDown,displayNameFormatTable);if(!this.workbook.bUndoChanges)this.autoFilters.redrawStylesTables(redrawTablesArr)};Worksheet.prototype._setIndex=function(ind){this.index=ind};Worksheet.prototype._BuildDependencies=function(cellRange){var ca; for(var i in cellRange){if(null===cellRange[i]){cellRange[i]=i;continue}ca=g_oCellAddressUtils.getCellAddress(i);this._getCellNoEmpty(ca.getRow0(),ca.getCol0(),function(c){if(c)c._BuildDependencies(true)})}};Worksheet.prototype._setHandlersTablePart=function(){if(!this.TableParts)return;for(var i=0;i<this.TableParts.length;i++)this.TableParts[i].setHandlers(this.handlers)};Worksheet.prototype.getTableRangeForFormula=function(name,objectParam){var res=null;if(!this.TableParts||!name)return res;for(var i= 0;i<this.TableParts.length;i++)if(this.TableParts[i].DisplayName.toLowerCase()===name.toLowerCase()){res=this.TableParts[i].getTableRangeForFormula(objectParam);break}return res};Worksheet.prototype.getTableIndexColumnByName=function(tableName,columnName){var res=null;if(!this.TableParts||!tableName)return res;for(var i=0;i<this.TableParts.length;i++)if(this.TableParts[i].DisplayName.toLowerCase()===tableName.toLowerCase()){res=this.TableParts[i].getTableIndexColumnByName(columnName);break}return res}; Worksheet.prototype.getTableNameColumnByIndex=function(tableName,columnIndex){var res=null;if(!this.TableParts||!tableName)return res;for(var i=0;i<this.TableParts.length;i++)if(this.TableParts[i].DisplayName.toLowerCase()===tableName.toLowerCase()){res=this.TableParts[i].getTableNameColumnByIndex(columnIndex);break}return res};Worksheet.prototype.getTableByName=function(tableName){var res=null;if(!this.TableParts||!tableName)return res;for(var i=0;i<this.TableParts.length;i++)if(this.TableParts[i].DisplayName.toLowerCase()=== tableName.toLowerCase()){res=this.TableParts[i];break}return res};Worksheet.prototype.getTableRangeColumnByName=function(tableName,columnName){var res=null;if(!this.TableParts||!tableName)return res;for(var i=0;i<this.TableParts.length;i++)if(this.TableParts[i].DisplayName.toLowerCase()===tableName.toLowerCase()){res=this.TableParts[i].getTableRangeColumnByName(columnName);break}return res};Worksheet.prototype.isTableTotal=function(col,row){if(this.TableParts&&this.TableParts.length>0)for(var i=0;i< this.TableParts.length;i++)if(this.TableParts[i].isTotalsRow()){var ref=this.TableParts[i].Ref;if(ref.r2===row&&col>=ref.c1&&col<=ref.c2)return{index:i,colIndex:col-ref.c1}}return null};Worksheet.prototype.isApplyFilterBySheet=function(){var res=false;if(this.AutoFilter&&this.AutoFilter.isApplyAutoFilter())res=true;if(false===res&&this.TableParts)for(var i=0;i<this.TableParts.length;i++)if(true===this.TableParts[i].isApplyAutoFilter()){res=true;break}return res};Worksheet.prototype.getTableNames= function(){var res=[];if(this.TableParts)for(var i=0;i<this.TableParts.length;i++)res.push(this.TableParts[i].DisplayName);return res};Worksheet.prototype.renameDependencyNodes=function(offset,oBBox){return this.workbook.dependencyFormulas.shift(this.Id,oBBox,offset)};Worksheet.prototype.getAllCol=function(){if(null==this.oAllCol)this.oAllCol=new AscCommonExcel.Col(this,g_nAllColIndex);return this.oAllCol};Worksheet.prototype.getAllRow=function(){if(null==this.oSheetFormatPr.oAllRow){this.oSheetFormatPr.oAllRow= new AscCommonExcel.Row(this);this.oSheetFormatPr.oAllRow.setIndex(g_nAllRowIndex)}return this.oSheetFormatPr.oAllRow};Worksheet.prototype.getAllRowNoEmpty=function(){return this.oSheetFormatPr.oAllRow};Worksheet.prototype.getHyperlinkByCell=function(row,col){var oHyperlink=this.hyperlinkManager.getByCell(row,col);return oHyperlink?oHyperlink.data:null};Worksheet.prototype.getMergedByCell=function(row,col){var oMergeInfo=this.mergeManager.getByCell(row,col);return oMergeInfo?oMergeInfo.bbox:null}; Worksheet.prototype.getMergedByRange=function(bbox){return this.mergeManager.get(bbox)};Worksheet.prototype._expandRangeByMergedAddToOuter=function(aOuter,range,aMerged){for(var i=0,length=aMerged.all.length;i<length;i++){var elem=aMerged.all[i];if(!range.containsRange(elem.bbox))aOuter.push(elem)}};Worksheet.prototype._expandRangeByMergedGetOuter=function(range){var aOuter=[];this._expandRangeByMergedAddToOuter(aOuter,range,this.mergeManager.get(new Asc.Range(range.c1,range.r1,range.c1,range.r2))); if(range.c1!=range.c2){this._expandRangeByMergedAddToOuter(aOuter,range,this.mergeManager.get(new Asc.Range(range.c2,range.r1,range.c2,range.r2)));if(range.c2-range.c1>1){this._expandRangeByMergedAddToOuter(aOuter,range,this.mergeManager.get(new Asc.Range(range.c1+1,range.r1,range.c2-1,range.r1)));if(range.r1!=range.r2)this._expandRangeByMergedAddToOuter(aOuter,range,this.mergeManager.get(new Asc.Range(range.c1+1,range.r2,range.c2-1,range.r2)))}}return aOuter};Worksheet.prototype.expandRangeByMerged= function(range){if(null!=range){var aOuter=this._expandRangeByMergedGetOuter(range);if(aOuter.length>0){range=range.clone();while(aOuter.length>0){for(var i=0,length=aOuter.length;i<length;i++)range.union2(aOuter[i].bbox);aOuter=this._expandRangeByMergedGetOuter(range)}}}return range};Worksheet.prototype.createTablePart=function(){return new AscCommonExcel.TablePart(this.handlers)};Worksheet.prototype.onUpdateRanges=function(ranges){this.workbook.updateSparklineCache(this.sName,ranges);this.setDirtyConditionalFormatting(new AscCommonExcel.MultiplyRange(ranges)); this.clearFindResults()};Worksheet.prototype.updateSparklineCache=function(sheet,ranges){for(var i=0;i<this.aSparklineGroups.length;++i)this.aSparklineGroups[i].updateCache(sheet,ranges)};Worksheet.prototype.getSparklineGroup=function(c,r){for(var i=0;i<this.aSparklineGroups.length;++i)if(-1!==this.aSparklineGroups[i].contains(c,r))return this.aSparklineGroups[i];return null};Worksheet.prototype.removeSparklines=function(range){for(var i=this.aSparklineGroups.length-1;i>-1;--i)if(this.aSparklineGroups[i].remove(range)){History.Add(new AscDFH.CChangesDrawingsSparklinesRemove(this.aSparklineGroups[i])); this.aSparklineGroups.splice(i,1)}};Worksheet.prototype.removeSparklineGroups=function(range){for(var i=this.aSparklineGroups.length-1;i>-1;--i)if(-1!==this.aSparklineGroups[i].intersectionSimple(range)){History.Add(new AscDFH.CChangesDrawingsSparklinesRemove(this.aSparklineGroups[i]));this.aSparklineGroups.splice(i,1)}};Worksheet.prototype.insertSparklineGroup=function(sparklineGroup){this.aSparklineGroups.push(sparklineGroup)};Worksheet.prototype.removeSparklineGroup=function(id){for(var i=0;i< this.aSparklineGroups.length;++i)if(id===this.aSparklineGroups[i].Get_Id()){this.aSparklineGroups.splice(i,1);break}};Worksheet.prototype.getCwf=function(){var cwf={};var range=this.getRange3(0,0,gc_nMaxRow0,gc_nMaxCol0);range._setPropertyNoEmpty(null,null,function(cell){if(cell.isFormula()){var name=cell.getName();cwf[name]=name}});return cwf};Worksheet.prototype.getAllFormulas=function(formulas,needReturnCellProps){var range=this.getRange3(0,0,gc_nMaxRow0,gc_nMaxCol0);range._setPropertyNoEmpty(null, null,function(cell){if(cell.isFormula())formulas.push(needReturnCellProps?{f:cell.getFormulaParsed(),c:cell.nCol,r:cell.nRow}:cell.getFormulaParsed())});for(var i=0;i<this.TableParts.length;++i){var table=this.TableParts[i];table.getAllFormulas(formulas)}};Worksheet.prototype.setTableStyleAfterOpen=function(){if(this.TableParts&&this.TableParts.length)for(var i=0;i<this.TableParts.length;i++){var table=this.TableParts[i];this.autoFilters._setColorStyleTable(table.Ref,table)}};Worksheet.prototype.setTableFormulaAfterOpen= function(){if(this.TableParts&&this.TableParts.length)for(var i=0;i<this.TableParts.length;i++){var table=this.TableParts[i];table.checkTotalRowFormula(this)}};Worksheet.prototype.isTableTotalRow=function(range){var res=false;if(this.TableParts&&this.TableParts.length)for(var i=0;i<this.TableParts.length;i++){var table=this.TableParts[i];var totalRowRange=table.getTotalsRowRange();if(totalRowRange&&totalRowRange.containsRange(range))res=true}return res};Worksheet.prototype.addTablePart=function(tablePart, bAddToDependencies){this.TableParts.push(tablePart);if(bAddToDependencies){this.workbook.dependencyFormulas.addTableName(this,tablePart);tablePart.buildDependencies()}};Worksheet.prototype.changeTablePart=function(index,tablePart,bChangeName){var oldTablePart=this.TableParts[index];if(oldTablePart)oldTablePart.removeDependencies();this.TableParts[index]=tablePart;tablePart.buildDependencies();if(bChangeName&&oldTablePart)this.workbook.dependencyFormulas.changeTableName(oldTablePart.DisplayName,tablePart.DisplayName)}; Worksheet.prototype.deleteTablePart=function(index,bConvertTableFormulaToRef){if(bConvertTableFormulaToRef){var tablePart=this.TableParts[index];this.workbook.dependencyFormulas.delTableName(tablePart.DisplayName,bConvertTableFormulaToRef);tablePart.removeDependencies();this.TableParts.splice(index,1)}else{var deleted=this.TableParts.splice(index,1);for(var delIndex=0;delIndex<deleted.length;++delIndex){var tablePart=deleted[delIndex];this.workbook.dependencyFormulas.delTableName(tablePart.DisplayName); tablePart.removeDependencies()}}};Worksheet.prototype.checkPivotReportLocationForError=function(ranges,exceptPivot){for(var i=0;i<ranges.length;++i){var range=ranges[i];if(this.autoFilters.isIntersectionTable(range))return c_oAscError.ID.PivotOverlap;if(this.inPivotTable(range,exceptPivot))return c_oAscError.ID.PivotOverlap;var merged=this.mergeManager.get(range);if(merged.outer.length>0)return c_oAscError.ID.PastInMergeAreaError}return c_oAscError.ID.No};Worksheet.prototype.checkPivotReportLocationForConfirm= function(ranges,changed){var t=this;if(changed&&changed.oldRanges&&changed.data)changed.oldRanges.forEach(function(range){t.getRange3(range.r1,range.c1,range.r2,range.c2).cleanAll()});for(var i=0;i<ranges.length;++i){var range=ranges[i];var merged=this.mergeManager.get(range);if(merged.inner.length>0)return c_oAscError.ID.PivotOverlap;var warning=c_oAscError.ID.No;this.getRange3(range.r1,range.c1,range.r2,range.c2)._foreachNoEmptyByCol(function(cell){if(!cell.isNullTextString())warning=c_oAscError.ID.PivotOverlap}); if(c_oAscError.ID.No!==warning)return warning}return c_oAscError.ID.No};Worksheet.prototype.getSlicerCachesByPivotTable=function(sheetId,pivotName){var res=[];for(var i=0;i<this.aSlicers.length;i++){var cache=this.aSlicers[i].getSlicerCache();if(cache&&cache.indexOfPivotTable(sheetId,pivotName)>=0)res.push(cache)}return res};Worksheet.prototype.getSlicerCachesByPivotCacheId=function(pivotCacheId){var res=[];for(var i=0;i<this.aSlicers.length;i++){var cache=this.aSlicers[i].getSlicerCache();if(cache&& pivotCacheId===cache.getPivotCacheId())res.push(cache)}return res};Worksheet.prototype.getSlicersByPivotTable=function(sheetId,pivotName){var res=[];for(var i=0;i<this.aSlicers.length;i++){var cache=this.aSlicers[i].getSlicerCache();if(cache&&cache.indexOfPivotTable(sheetId,pivotName)>=0)res.push(this.aSlicers[i])}return res};Worksheet.prototype.initPivotTables=function(){for(var i=0;i<this.pivotTables.length;++i)this.pivotTables[i].init()};Worksheet.prototype.updatePivotTable=function(pivotTable, changed,dataRow,canModifyDocument){if(!changed.data&&!changed.style)return;var t=this;var multiplyRange=new AscCommonExcel.MultiplyRange([]);if(changed.oldRanges)multiplyRange.union2(new AscCommonExcel.MultiplyRange(changed.oldRanges));pivotTable.init();if(changed.data&&dataRow){var newRanges=pivotTable.getReportRanges();newRanges.forEach(function(range){t.getRange3(range.r1,range.c1,range.r2,range.c2).cleanAll()});this._updatePivotTableCells(pivotTable,dataRow)}var res=pivotTable.getReportRanges(); multiplyRange.union2(new AscCommonExcel.MultiplyRange(res));this.updatePivotTablesStyle(multiplyRange.getUnionRange(),canModifyDocument);return res};Worksheet.prototype.clearPivotTableCell=function(pivotTable){var ranges=pivotTable.getReportRanges();ranges.forEach(function(range){pivotTable.GetWS().getRange3(range.r1,range.c1,range.r2,range.c2).cleanAll()})};Worksheet.prototype.clearPivotTableStyle=function(pivotTable){var ranges=pivotTable.getReportRanges();ranges.forEach(function(range){pivotTable.GetWS().getRange3(range.r1, range.c1,range.r2,range.c2).clearTableStyle()})};Worksheet.prototype._updatePivotTableSetCellValue=function(cell,text){var oCellValue=new AscCommonExcel.CCellValue;oCellValue.type=AscCommon.CellValueType.String;oCellValue.text=text.toString();cell.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,oCellValue))};Worksheet.prototype._updatePivotTableCellsPage=function(pivotTable){if(pivotTable.pageFieldsPositions)for(var i=0;i<pivotTable.pageFieldsPositions.length;++i){var pos=pivotTable.pageFieldsPositions[i]; var cells=this.getRange4(pos.row,pos.col);this._updatePivotTableSetCellValue(cells,pivotTable.getPageFieldName(i));cells=this.getRange4(pos.row,pos.col+1);var num=pivotTable.getPivotFieldNum(pos.pageField.fld);if(num)cells.setNum(num);var oCellValue=pivotTable.getPageFieldCellValue(i);if(oCellValue.type!==AscCommon.CellValueType.String)cells.setAlignHorizontal(AscCommon.align_Left);cells.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,oCellValue))}};Worksheet.prototype._updatePivotTableCellsHeader= function(pivotTable){var location=pivotTable.location;if(0===location.firstHeaderRow)return;var cells;var pivotRange=pivotTable.getRange();var rowFields=pivotTable.asc_getRowFields();var colFields=pivotTable.asc_getColumnFields();var dataFields=pivotTable.asc_getDataFields();var cacheFields=pivotTable.asc_getCacheFields();var pivotFields=pivotTable.asc_getPivotFields();if(dataFields&&1===dataFields.length){if(pivotTable.gridDropZones)cells=this.getRange4(pivotRange.r1,pivotRange.c1);else if(rowFields&& !colFields)cells=this.getRange4(pivotRange.r1,pivotRange.c1+location.firstDataCol);else if(!rowFields&&colFields)cells=this.getRange4(pivotRange.r1+location.firstDataRow,pivotRange.c1);else cells=this.getRange4(pivotRange.r1,pivotRange.c1);this._updatePivotTableSetCellValue(cells,pivotTable.getDataFieldName(0))}if(pivotTable.showHeaders&&colFields){cells=this.getRange4(pivotRange.r1,pivotRange.c1+location.firstDataCol);if(pivotTable.compact)this._updatePivotTableSetCellValue(cells,pivotTable.colHeaderCaption|| AscCommon.translateManager.getValue(AscCommonExcel.COL_HEADER_CAPTION));else{var offset=new AscCommon.CellBase(0,1);for(var i=0;i<colFields.length;++i){var index=colFields[i].asc_getIndex();if(AscCommonExcel.st_VALUES!==index)this._updatePivotTableSetCellValue(cells,pivotFields[index].asc_getName()||cacheFields[index].asc_getName());else this._updatePivotTableSetCellValue(cells,pivotTable.dataCaption||AscCommon.translateManager.getValue(AscCommonExcel.DATA_CAPTION));cells.setOffset(offset)}}}};Worksheet.prototype._updatePivotTableCellsRowColLables= function(pivotTable,rowFieldsOffset){var items,fields,field,oCellValue,fieldIndex,cells,r1,c1,i,j,valuesIndex;var pivotRange=pivotTable.getRange();var location=pivotTable.location;var hasLeftAlignInRowLables=false;if(rowFieldsOffset){items=pivotTable.getRowItems();fields=pivotTable.asc_getRowFields();r1=pivotRange.r1+location.firstDataRow;c1=pivotRange.c1;valuesIndex=pivotTable.getRowFieldsValuesIndex();hasLeftAlignInRowLables=pivotTable.hasLeftAlignInRowLables()}else{items=pivotTable.getColItems(); fields=pivotTable.asc_getColumnFields();r1=pivotRange.r1+location.firstHeaderRow;c1=pivotRange.c1+location.firstDataCol;valuesIndex=pivotTable.getColumnFieldsValuesIndex()}if(!items||!fields){if(pivotTable.gridDropZones&&!fields&&pivotTable.getDataFieldsCount()>0){if(rowFieldsOffset)cells=this.getRange4(pivotRange.r1+location.firstDataRow,pivotRange.c1+location.firstDataCol-1);else cells=this.getRange4(pivotRange.r1+location.firstDataRow-1,pivotRange.c1+location.firstDataCol);oCellValue=new AscCommonExcel.CCellValue; oCellValue.type=AscCommon.CellValueType.String;oCellValue.text=AscCommonExcel.ToName_ST_ItemType(Asc.c_oAscItemType.Default);cells.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,oCellValue))}if(rowFieldsOffset&&false===pivotTable.showHeaders&&false===pivotTable.gridDropZones&&pivotTable.getDataFieldsCount()>0){cells=this.getRange4(pivotRange.r1+location.firstDataRow,pivotRange.c1+location.firstDataCol-1);this._updatePivotTableSetCellValue(cells,pivotTable.getDataFieldName(0))}return}var pivotFields= pivotTable.asc_getPivotFields();var totalTitleRange=[];for(i=0;i<items.length;++i){var item=items[i];var r=item.getR();for(j=0;j<r;++j){fieldIndex=fields[j].asc_getIndex();field=pivotFields[fieldIndex];if(AscCommonExcel.st_VALUES!==fieldIndex&&field.asc_getFillDownLabelsDefault()&&totalTitleRange[j]){if(rowFieldsOffset)cells=this.getRange4(r1+i,c1+rowFieldsOffset[j]);else cells=this.getRange4(r1+j,c1+i);cells.setStyle(totalTitleRange[j].getStyle());cells.setValueData(totalTitleRange[j].getValueData())}}for(j= 0;j<item.x.length;++j){fieldIndex=null;if(rowFieldsOffset)cells=this.getRange4(r1+i,c1+rowFieldsOffset[r+j]);else cells=this.getRange4(r1+r+j,c1+i);if(Asc.c_oAscItemType.Data===item.t){fieldIndex=fields[r+j].asc_getIndex();if(AscCommonExcel.st_VALUES!==fieldIndex)oCellValue=pivotTable.getPivotFieldCellValue(fieldIndex,item.x[j].getV());else{oCellValue=new AscCommonExcel.CCellValue;oCellValue.type=AscCommon.CellValueType.String;oCellValue.text=pivotTable.getDataFieldName(item.i)}totalTitleRange[r+ j]=cells}else if(Asc.c_oAscItemType.Grand===item.t){oCellValue=new AscCommonExcel.CCellValue;oCellValue.type=AscCommon.CellValueType.String;if(-1===valuesIndex)oCellValue.text=pivotTable.grandTotalCaption||AscCommon.translateManager.getValue(AscCommonExcel.GRAND_TOTAL_CAPTION);else{oCellValue.text=AscCommonExcel.ToName_ST_ItemType(item.t);oCellValue.text+=" "+pivotTable.getDataFieldName(item.i)}}else if(Asc.c_oAscItemType.Blank===item.t)break;else{oCellValue=new AscCommonExcel.CCellValue;oCellValue.type= AscCommon.CellValueType.String;if(r+j>valuesIndex){fieldIndex=fields[r+j].asc_getIndex();field=pivotFields[fieldIndex];if(AscCommonExcel.st_VALUES!==fieldIndex)if(field.subtotalCaption)oCellValue.text=field.subtotalCaption;else{oCellValue.text=totalTitleRange[r+j].getValueWithFormatSkipToSpace();oCellValue.text+=" "+AscCommonExcel.ToName_ST_ItemType(item.t)}}else{oCellValue.text=totalTitleRange[r+j].getValueWithFormatSkipToSpace();oCellValue.text+=" "+pivotTable.getDataFieldName(item.i)}}if(null!== fieldIndex){var num=pivotTable.getPivotFieldNum(fieldIndex);if(num)cells.setNum(num)}if(hasLeftAlignInRowLables)cells.setAlignHorizontal(AscCommon.align_Left);cells.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,oCellValue))}}};Worksheet.prototype._updatePivotTableCellsRowHeaderLabels=function(pivotTable){var rowFieldsOffset=[0];var rowFields=pivotTable.asc_getRowFields();if(!rowFields)return rowFieldsOffset;var cells,index,field;var pivotFields=pivotTable.asc_getPivotFields();var pivotRange= pivotTable.getRange();var location=pivotTable.location;var c1=pivotRange.c1;var r1=pivotRange.r1+location.firstDataRow-1;if(pivotTable.showHeaders)if(pivotTable.compact||location.firstDataCol!==rowFields.length)if(1===rowFields.length&&AscCommonExcel.st_VALUES===rowFields[0].asc_getIndex())this._updatePivotTableSetCellValue(this.getRange4(r1,c1),pivotTable.dataCaption||AscCommon.translateManager.getValue(AscCommonExcel.DATA_CAPTION));else this._updatePivotTableSetCellValue(this.getRange4(r1,c1),pivotTable.rowHeaderCaption|| AscCommon.translateManager.getValue(AscCommonExcel.ROW_HEADER_CAPTION));else{cells=this.getRange4(r1,c1);index=rowFields[0].asc_getIndex();if(AscCommonExcel.st_VALUES!==index)this._updatePivotTableSetCellValue(cells,pivotTable.getPivotFieldName(index));else this._updatePivotTableSetCellValue(cells,pivotTable.dataCaption||AscCommon.translateManager.getValue(AscCommonExcel.DATA_CAPTION))}for(var i=1;i<rowFields.length;++i){index=rowFields[i-1].asc_getIndex();var isTabular;if(AscCommonExcel.st_VALUES!== index){field=pivotFields[index];isTabular=field&&!(field.compact&&field.outline)}else isTabular=!(pivotTable.compact&&pivotTable.outline);if(isTabular){index=rowFields[i].asc_getIndex();++c1;if(pivotTable.showHeaders){cells=this.getRange4(r1,c1);if(AscCommonExcel.st_VALUES!==index)this._updatePivotTableSetCellValue(cells,pivotTable.getPivotFieldName(index));else this._updatePivotTableSetCellValue(cells,pivotTable.dataCaption||AscCommon.translateManager.getValue(AscCommonExcel.DATA_CAPTION))}}rowFieldsOffset[i]= c1-pivotRange.c1}return rowFieldsOffset};Worksheet.prototype._updatePivotTableCellsData=function(pivotTable,dataRow){var rowFields=pivotTable.asc_getRowFields();var rowItems=pivotTable.getRowItems();var colFields=pivotTable.asc_getColumnFields();var colItems=pivotTable.getColItems();var pivotFields=pivotTable.asc_getPivotFields();var dataFields=pivotTable.asc_getDataFields();if(!rowItems||!colItems||!dataFields)return;var valuesIndex=pivotTable.getRowFieldsValuesIndex();var pivotRange=pivotTable.getRange(); var location=pivotTable.location;var r1=pivotRange.r1+location.firstDataRow;var c1=pivotRange.c1+location.firstDataCol;var curDataRow=dataRow;var dataByRowIndex=[curDataRow];var fieldIndex,field,fieldItem,dataByColIndex,dataField,rowFieldSubtotal;for(var rowItemsIndex=0;rowItemsIndex<rowItems.length;++rowItemsIndex){var rowItem=rowItems[rowItemsIndex];if(Asc.c_oAscItemType.Blank===rowItem.t)continue;var rowR=rowItem.getR();curDataRow=dataByRowIndex[rowR];rowFieldSubtotal=Asc.c_oAscItemType.Default; if(Asc.c_oAscItemType.Grand!==rowItem.t&&rowFields)for(var rowItemsXIndex=0;rowItemsXIndex<rowItem.x.length;++rowItemsXIndex){fieldIndex=rowFields[rowR+rowItemsXIndex].asc_getIndex();if(curDataRow&&AscCommonExcel.st_VALUES!==fieldIndex){field=pivotFields[fieldIndex];rowFieldSubtotal=field.getSubtotalType();fieldItem=field.getItem(rowItem.x[rowItemsXIndex].getV());curDataRow=curDataRow.vals[fieldItem.x]}dataByRowIndex.length=rowR+rowItemsXIndex+1;dataByRowIndex[dataByRowIndex.length]=curDataRow;if(!curDataRow)break}if(Asc.c_oAscItemType.Data!== rowItem.t||!rowFields||rowR+rowItem.x.length===rowFields.length||AscCommonExcel.st_VALUES!==fieldIndex&&pivotFields[fieldIndex]&&pivotFields[fieldIndex].checkSubtotalTop()&&rowR>valuesIndex){dataByColIndex=[curDataRow];for(var colItemsIndex=0;colItemsIndex<colItems.length;++colItemsIndex){var colItem=colItems[colItemsIndex];var colR=colItem.getR();curDataRow=dataByColIndex[colR];if(curDataRow&&Asc.c_oAscItemType.Grand!==colItem.t&&colFields)for(var colItemsXIndex=0;colItemsXIndex<colItem.x.length;++colItemsXIndex){fieldIndex= colFields[colR+colItemsXIndex].asc_getIndex();if(AscCommonExcel.st_VALUES!==fieldIndex){field=pivotFields[fieldIndex];fieldItem=field.getItem(colItem.x[colItemsXIndex].getV());curDataRow=curDataRow.subtotal[fieldItem.x]}dataByColIndex.length=colR+colItemsXIndex+1;dataByColIndex[dataByColIndex.length]=curDataRow;if(!curDataRow)break}if(curDataRow){var dataIndex=Math.max(rowItem.i,colItem.i);dataField=dataFields[dataIndex];var total=curDataRow.total[dataIndex];var oCellValue=total.getCellValue(dataField.subtotal, rowFieldSubtotal,rowItem.t,colItem.t);if(oCellValue){var cells=this.getRange4(r1+rowItemsIndex,c1+colItemsIndex);if(dataField&&dataField.num)cells.setNum(dataField.num);cells.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,oCellValue))}}}}}};Worksheet.prototype._updatePivotTableCells=function(pivotTable,dataRow){this._updatePivotTableCellsPage(pivotTable);this._updatePivotTableCellsHeader(pivotTable);this._updatePivotTableCellsRowColLables(pivotTable);var rowFieldsOffset=this._updatePivotTableCellsRowHeaderLabels(pivotTable); this._updatePivotTableCellsRowColLables(pivotTable,rowFieldsOffset);this._updatePivotTableCellsData(pivotTable,dataRow)};Worksheet.prototype.updatePivotTablesStyle=function(range,canModifyDocument){var t=this;var pivotTable,pivotRange,pivotFields,rowFields,styleInfo,style,wholeStyle,cells,j,r,x,pos,firstHeaderRow0,firstDataCol0,countC,countCWValues,countR,countD,stripe1,stripe2,items,l,item,start,end,isOutline,arrSubheading,emptyStripe=new Asc.CTableStyleElement;var dxf,dxfLabels,dxfValues,grandColumn, index;var checkRowSubheading=function(_i,_r,_v,_dxf){var sub,bSet=true;if(sub=arrSubheading[_i])if(sub.v===_v)bSet=false;else{cells=t.getRange3(sub.r,pivotRange.c1+_i,_r-1,pivotRange.c1+_i);cells.setTableStyle(sub.dxf)}if(bSet)arrSubheading[_i]=null===_v?null:{r:_r,dxf:_dxf,v:_v}};var endRowSubheadings=function(_i,_r){for(;_i<arrSubheading.length;++_i)checkRowSubheading(_i,_r,null,null)};for(var i=0;i<this.pivotTables.length;++i){grandColumn=0;pivotTable=this.pivotTables[i];pivotRange=pivotTable.getRange(); pivotFields=pivotTable.asc_getPivotFields();rowFields=pivotTable.asc_getRowFields();styleInfo=pivotTable.asc_getStyleInfo();if(!pivotTable.isInit||!styleInfo||range&&!pivotTable.intersection(range))continue;style=this.workbook.TableStyles.AllStyles[styleInfo.asc_getName()];wholeStyle=style&&style.wholeTable&&style.wholeTable.dxf;dxfLabels=style&&style.pageFieldLabels&&style.pageFieldLabels.dxf;dxfValues=style&&style.pageFieldValues&&style.pageFieldValues.dxf;for(j=0;j<pivotTable.pageFieldsPositions.length;++j){pos= pivotTable.pageFieldsPositions[j];cells=this.getRange4(pos.row,pos.col);cells.clearTableStyle();cells.setTableStyle(wholeStyle);cells.setTableStyle(dxfLabels);cells=this.getRange4(pos.row,pos.col+1);cells.clearTableStyle();cells.setTableStyle(wholeStyle);cells.setTableStyle(dxfValues)}cells=this.getRange3(pivotRange.r1,pivotRange.c1,pivotRange.r2,pivotRange.c2);cells.clearTableStyle();if(!style)continue;countC=pivotTable.getColumnFieldsCount();countR=pivotTable.getRowFieldsCount(true);if(pivotTable.isEmptyReport()){if(canModifyDocument&& 0===pivotTable.pageFieldsPositions.length){var border;border=new AscCommonExcel.Border;border.l=new AscCommonExcel.BorderProp;border.l.setStyle(c_oAscBorderStyles.Thin);border.l.c=AscCommonExcel.createRgbColor(0,0,0);border.t=new AscCommonExcel.BorderProp;border.t.setStyle(c_oAscBorderStyles.Thin);border.t.c=AscCommonExcel.createRgbColor(0,0,0);border.r=new AscCommonExcel.BorderProp;border.r.setStyle(c_oAscBorderStyles.Thin);border.r.c=AscCommonExcel.createRgbColor(0,0,0);border.b=new AscCommonExcel.BorderProp; border.b.setStyle(c_oAscBorderStyles.Thin);border.b.c=AscCommonExcel.createRgbColor(0,0,0);border.ih=new AscCommonExcel.BorderProp;border.ih.setStyle(c_oAscBorderStyles.Thin);border.ih.c=AscCommonExcel.createRgbColor(255,255,255);border.iv=new AscCommonExcel.BorderProp;border.iv.setStyle(c_oAscBorderStyles.Thin);border.iv.c=AscCommonExcel.createRgbColor(255,255,255);cells.setBorder(border)}continue}firstHeaderRow0=pivotTable.getFirstHeaderRow0();firstDataCol0=pivotTable.getFirstDataCol();countD=pivotTable.getDataFieldsCount(); countCWValues=pivotTable.getColumnFieldsCount(true);cells.setTableStyle(wholeStyle);if(styleInfo.showColStripes){stripe1=style.firstColumnStripe||emptyStripe;stripe2=style.secondColumnStripe||emptyStripe;start=pivotRange.c1+firstDataCol0;if(stripe1.dxf){cells=this.getRange3(pivotRange.r1+firstHeaderRow0+1,start,pivotRange.r2,pivotRange.c2);cells.setTableStyle(stripe1.dxf,new Asc.CTableStyleStripe(stripe1.size,stripe2.size))}if(stripe2.dxf&&start+stripe1.size<=pivotRange.c2){cells=this.getRange3(pivotRange.r1+ firstHeaderRow0+1,start+stripe1.size,pivotRange.r2,pivotRange.c2);cells.setTableStyle(stripe2.dxf,new Asc.CTableStyleStripe(stripe2.size,stripe1.size))}}if(styleInfo.showRowStripes&&countR&&pivotRange.c1+countR-1!==pivotRange.c2){stripe1=style.firstRowStripe||emptyStripe;stripe2=style.secondRowStripe||emptyStripe;start=pivotRange.r1+firstHeaderRow0+1;if(stripe1.dxf){cells=this.getRange3(start,pivotRange.c1,pivotRange.r2,pivotRange.c2);cells.setTableStyle(stripe1.dxf,new Asc.CTableStyleStripe(stripe1.size, stripe2.size,true))}if(stripe2.dxf&&start+stripe1.size<=pivotRange.r2){cells=this.getRange3(start+stripe1.size,pivotRange.c1,pivotRange.r2,pivotRange.c2);cells.setTableStyle(stripe1.dxf,new Asc.CTableStyleStripe(stripe2.size,stripe1.size,true))}}dxf=style.firstColumn&&style.firstColumn.dxf;if(styleInfo.showRowHeaders&&countR&&dxf){cells=this.getRange3(pivotRange.r1,pivotRange.c1,pivotRange.r2,pivotRange.c1+Math.max(0,firstDataCol0-1));cells.setTableStyle(dxf)}dxf=style.headerRow&&style.headerRow.dxf; if(styleInfo.showColHeaders&&dxf){cells=this.getRange3(pivotRange.r1,pivotRange.c1,pivotRange.r1+firstHeaderRow0,pivotRange.c2);cells.setTableStyle(dxf)}dxf=style.firstHeaderCell&&style.firstHeaderCell.dxf;if(styleInfo.showColHeaders&&styleInfo.showRowHeaders&&countCWValues&&countR+countD&&dxf){cells=this.getRange3(pivotRange.r1,pivotRange.c1,pivotRange.r1+firstHeaderRow0-(countR?1:0),pivotRange.c1+Math.max(0,firstDataCol0-1));cells.setTableStyle(dxf)}items=pivotTable.getColItems();if(items){start= pivotRange.c1+firstDataCol0;for(j=0;j<items.length;++j){dxf=null;item=items[j];r=item.getR();if(Asc.c_oAscItemType.Grand===item.t||0===countCWValues){dxf=style.lastColumn;grandColumn=1}else if(r+1!==countC)if(countD&&Asc.c_oAscItemType.Data!==item.t)if(0===r)dxf=style.firstSubtotalColumn;else if(1===r%2)dxf=style.secondSubtotalColumn;else dxf=style.thirdSubtotalColumn;dxf=dxf&&dxf.dxf;if(dxf){cells=this.getRange3(pivotRange.r1+1,start+j,pivotRange.r2,start+j);cells.setTableStyle(dxf)}}}items=pivotTable.getRowItems(); if(items&&countR){arrSubheading=[];countR=pivotTable.getRowFieldsCount();start=pivotRange.r1+firstHeaderRow0+1;for(j=0;j<items.length;++j){dxf=null;item=items[j];if(Asc.c_oAscItemType.Data!==item.t){if(Asc.c_oAscItemType.Grand===item.t){dxf=style.totalRow;pos=0}else if(Asc.c_oAscItemType.Blank===item.t){dxf=style.blankRow;pos=0}else if(styleInfo.showRowHeaders){r=item.getR();if(r+1!==countR){if(0===r)dxf=style.firstSubtotalRow;else if(1===r%2)dxf=style.secondSubtotalRow;else dxf=style.thirdSubtotalRow; pos=pivotTable.getRowFieldPos(r)}}dxf=dxf&&dxf.dxf;if(dxf){cells=this.getRange3(start+j,pivotRange.c1+pos,start+j,pivotRange.c2);cells.setTableStyle(dxf)}endRowSubheadings(pos,start+j)}else if(styleInfo.showRowHeaders){r=item.getR();index=rowFields[r].asc_getIndex();isOutline=AscCommonExcel.st_VALUES!==index&&false!==pivotFields[index].outline;for(x=0,l=item.x.length;x<l;++x,++r){dxf=null;if(r+1!==countR){if(0===r)dxf=style.firstRowSubheading;else if(1===r%2)dxf=style.secondRowSubheading;else dxf= style.thirdRowSubheading;dxf=dxf&&dxf.dxf;if(dxf){pos=pivotTable.getRowFieldPos(r);if(1===l&&isOutline){endRowSubheadings(pos,start+j);cells=this.getRange3(start+j,pivotRange.c1+pos,start+j,pivotRange.c2);cells.setTableStyle(dxf)}else checkRowSubheading(pos,start+j,item.x[x].getV(),dxf)}}}}}endRowSubheadings(0,pivotRange.r2+1)}items=pivotTable.getColItems();if(items&&styleInfo.showColHeaders){start=pivotRange.c1+firstDataCol0;end=pivotRange.c2-grandColumn;for(j=0;j<countCWValues;++j){if(0===j)dxf= style.firstColumnSubheading;else if(1===j%2)dxf=style.secondColumnSubheading;else dxf=style.thirdColumnSubheading;dxf=dxf&&dxf.dxf;if(dxf){cells=this.getRange3(pivotRange.r1+1+j,start,pivotRange.r1+1+j,end);cells.setTableStyle(dxf)}}pos=pivotRange.r1+1+firstHeaderRow0-(countR?1:0);for(j=0;j<items.length;++j){item=items[j];if(Asc.c_oAscItemType.Data!==item.t&&Asc.c_oAscItemType.Grand!==item.t){r=item.getR();if(0===r)dxf=style.firstColumnSubheading;else if(1===r%2)dxf=style.secondColumnSubheading;else dxf= style.thirdColumnSubheading;dxf=dxf&&dxf.dxf;if(dxf){cells=this.getRange3(pivotRange.r1+1+r,start+j,pos,start+j);cells.setTableStyle(dxf)}}}}}};Worksheet.prototype.updatePivotOffset=function(range,offset){if(offset.row<0||offset.col<0)this.deletePivotTables(range);var bboxShift=AscCommonExcel.shiftGetBBox(range,0!==offset.col);this.movePivotOffset(bboxShift,offset)};Worksheet.prototype.movePivotOffset=function(range,offset){var pivotTable;for(var i=0;i<this.pivotTables.length;++i){pivotTable=this.pivotTables[i]; if(pivotTable.isInRange(range))this.workbook.oApi._changePivotSimple(pivotTable,false,false,function(){pivotTable.setOffset(offset,true)})}};Worksheet.prototype.copyPivotTable=function(range,offset,wsTo){var t=this;var pivotTable;for(var i=0;i<this.pivotTables.length;++i){pivotTable=this.pivotTables[i];if(pivotTable.isInRange(range)){var newPivot=pivotTable.cloneShallow();newPivot.prepareToPaste(wsTo,offset,wsTo===pivotTable.GetWS());this.workbook.oApi._changePivotSimple(newPivot,true,false,function(){wsTo.insertPivotTable(newPivot, true,false)})}}};Worksheet.prototype.inPivotTable=function(range,exceptPivot){return this.pivotTables.find(function(element){return exceptPivot!==element&&element.intersection(range)})};Worksheet.prototype.checkShiftPivotTable=function(range,offset){if((offset.row<0||offset.col<0)&&this._isPivotsIntersectRangeButNotInIt(range))return true;return this._isPivotsIntersectRangeButNotInIt(AscCommonExcel.shiftGetBBox(range,0!==offset.col))};Worksheet.prototype.checkMovePivotTable=function(arnFrom,arnTo, ctrlKey,opt_wsTo){var t=this;if(!opt_wsTo)opt_wsTo=this;if(this.inPivotTable(arnFrom)){var intersectionTableParts=opt_wsTo.autoFilters.getTablesIntersectionRange(arnTo);for(var i=0;i<intersectionTableParts.length;i++)if(intersectionTableParts[i]&&intersectionTableParts[i].Ref&&!arnTo.containsRange(intersectionTableParts[i].Ref))return c_oAscError.ID.PivotOverlap}var res=false;if(ctrlKey)res=this._isPivotsIntersectRangeButNotInIt(arnFrom)||opt_wsTo._isPivotsIntersectRangeButNotInIt(arnTo);else res= this._isPivotsIntersectRangeButNotInIt(arnFrom)||opt_wsTo.pivotTables.some(function(element){return element.intersection(arnTo)&&!element.isInRange(arnTo)&&(opt_wsTo!==t||!element.isInRange(arnFrom))});return res?c_oAscError.ID.LockedCellPivot:c_oAscError.ID.No};Worksheet.prototype._isPivotsIntersectRangeButNotInIt=function(bbox){return this.pivotTables.some(function(element){return element.intersection(bbox)&&!element.isInRange(bbox)})};Worksheet.prototype.checkDeletePivotTables=function(range){for(var i= 0;i<this.pivotTables.length;++i)if(this.pivotTables[i].intersection(range)&&!this.pivotTables[i].getAllRange(this).inContains(range))return false;return true};Worksheet.prototype.deletePivotTable=function(id){for(var i=0;i<this.pivotTables.length;++i){var pivotTable=this.pivotTables[i];if(id===pivotTable.Get_Id()){this.clearPivotTableStyle(pivotTable);this.pivotTables.splice(i,1);break}}};Worksheet.prototype._deletePivotTable=function(pivotTables,pivotTable,index,withoutCells){this.workbook.deleteSlicersByPivotTable(this.getId(), pivotTable.asc_getName());if(!withoutCells)this.clearPivotTableCell(pivotTable);this.clearPivotTableStyle(pivotTable);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_PivotDelete,this.getId(),null,new AscCommonExcel.UndoRedoData_PivotTableRedo(pivotTable.Get_Id(),pivotTable,null));this.pivotTables.splice(index,1)};Worksheet.prototype.deletePivotTables=function(range,withoutCells){for(var i=this.pivotTables.length-1;i>=0;--i){var pivotTable=this.pivotTables[i];if(pivotTable.intersection(range))this._deletePivotTable(this.pivotTables, pivotTable,i,withoutCells)}return true};Worksheet.prototype.deletePivotTablesOnMove=function(from,to){for(var i=this.pivotTables.length-1;i>=0;--i){var pivotTable=this.pivotTables[i];if(pivotTable.isInRange(to)&&!pivotTable.isInRange(from))this._deletePivotTable(this.pivotTables,pivotTable,i)}return true};Worksheet.prototype.getPivotTable=function(col,row){var res=null;for(var i=0;i<this.pivotTables.length;++i)if(this.pivotTables[i].contains(col,row)){res=this.pivotTables[i];break}return res};Worksheet.prototype.getPivotTableByName= function(name){var res=null;for(var i=0;i<this.pivotTables.length;++i)if(this.pivotTables[i].asc_getName()===name){res=this.pivotTables[i];break}return res};Worksheet.prototype.getPivotTableById=function(id){var res=null;for(var i=0;i<this.pivotTables.length;++i)if(this.pivotTables[i].Get_Id()===id){res=this.pivotTables[i];break}return res};Worksheet.prototype.getPivotTablesByCacheId=function(pivotCacheId){var res=[];for(var i=0;i<this.pivotTables.length;++i)if(this.pivotTables[i].getPivotCacheId()=== pivotCacheId){res.push(this.pivotTables[i]);break}return res};Worksheet.prototype.getPivotCacheByDataRef=function(dataRef){return this.forEachPivotCache(undefined,function(cacheDefinition){if(dataRef===cacheDefinition.getDataRef())return cacheDefinition})};Worksheet.prototype.getPivotCacheById=function(pivotCacheId,pivotCachesOpen){return this.forEachPivotCache(pivotCachesOpen,function(cacheDefinition){if(pivotCacheId===cacheDefinition.getPivotCacheId())return cacheDefinition})};Worksheet.prototype.forEachPivotCache= function(pivotCachesOpen,callback){var res,i;for(i=0;i<this.pivotTables.length;++i){res=callback(this.pivotTables[i].cacheDefinition);if(res)return res}for(i=0;i<this.aSlicers.length;++i){var cacheDefinition=this.aSlicers[i].getPivotCache();if(cacheDefinition){res=callback(cacheDefinition);if(res)return res}}if(pivotCachesOpen)for(var cacheId in pivotCachesOpen){var cacheDefinition=pivotCachesOpen[cacheId];if(cacheDefinition){res=callback(cacheDefinition);if(res)return res}}return null};Worksheet.prototype.insertPivotTable= function(pivotTable,addToHistory,checkCacheDefinition){pivotTable.worksheet=this;pivotTable.setChanged(false,true);if(checkCacheDefinition){var cacheDefinition=this.workbook.getPivotCacheByDataRef(pivotTable.asc_getDataRef());if(cacheDefinition)pivotTable.setCacheDefinition(cacheDefinition)}this.pivotTables.push(pivotTable);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_PivotAdd,this.getId(),null,new AscCommonExcel.UndoRedoData_BinaryWrapper(pivotTable))}; Worksheet.prototype.getPivotTableButtons=function(range){var res=[];for(var i=0;i<this.pivotTables.length;++i)this.pivotTables[i].getPivotTableButtons(range,res);return res};Worksheet.prototype.getPivotTablesClearRanges=function(range){var pivotTable,pivotRange,intersection,res=[];for(var i=0;i<this.pivotTables.length;++i){pivotTable=this.pivotTables[i];if(pivotTable.clearGrid){pivotRange=pivotTable.getRange();if(intersection=pivotRange.intersectionSimple(range)){res.push(intersection);res.push(pivotRange)}}}return res}; Worksheet.prototype.getDisablePrompts=function(){return this.dataValidations&&this.dataValidations.disablePrompts};Worksheet.prototype.getDataValidation=function(c,r){if(!this.dataValidations)return null;for(var i=0;i<this.dataValidations.elems.length;++i)if(this.dataValidations.elems[i].contains(c,r))return this.dataValidations.elems[i];return null};Worksheet.prototype.clearFindResults=function(){this.lastFindOptions=null};Worksheet.prototype._findAllCells=function(options){if(true!==options.isMatchCase)options.findWhat= options.findWhat.toLowerCase();if(options.isWholeWord){var length=options.findWhat.length;options.findWhat="\\b"+options.findWhat+"\\b";options.findWhat=new RegExp(options.findWhat,"g");options.findWhat.length=length}var selectionRange=options.selectionRange||this.selectionRange;var lastRange=selectionRange.getLast();var activeCell=selectionRange.activeCell;var merge=this.getMergedByCell(activeCell.row,activeCell.col);options.findInSelection=options.scanOnOnlySheet&&!(selectionRange.isSingleRange()&& (lastRange.isOneCell()||lastRange.isEqual(merge)));var findRange=options.findInSelection?this.getRange3(lastRange.r1,lastRange.c1,lastRange.r2,lastRange.c2):this.getRange3(0,0,this.getRowsCount(),this.getColsCount());if(this.lastFindOptions&&this.lastFindOptions.findResults&&options.isEqual2(this.lastFindOptions)&&findRange.getBBox0().isEqual(this.lastFindOptions.findRange))return;var oldResults=this.lastFindOptions&&this.lastFindOptions.findResults.isNotEmpty();var result=new AscCommonExcel.findResults, tmp;findRange._foreachNoEmpty(function(cell,r,c){if(!cell.isNullText()&&cell.isEqual(options)){if(!options.scanByRows){tmp=r;r=c;c=tmp}result.add(r,c,cell)}});this.lastFindOptions=options.clone();this.lastFindOptions.findRange=findRange.getBBox0().clone();this.lastFindOptions.findResults=result;if(!options.isReplaceAll&&this.workbook.oApi.selectSearchingResults&&(oldResults||result.isNotEmpty())&&this===this.workbook.getActiveWs())this.workbook.handlers.trigger("drawWS")};Worksheet.prototype.findCellText= function(options){this._findAllCells(options);var selectionRange=options.selectionRange||this.selectionRange;var activeCell=selectionRange.activeCell;var tmp,key1=activeCell.row,key2=activeCell.col;if(!options.scanByRows){tmp=key1;key1=key2;key2=tmp}var result=null;var findResults=this.lastFindOptions.findResults;if(findResults.find(key1,key2,options.scanForward)){key1=findResults.currentKey1;key2=findResults.currentKey2;if(!options.scanByRows){tmp=key1;key1=key2;key2=tmp}result=new AscCommon.CellBase(key1, key2)}return result};Worksheet.prototype.inFindResults=function(row,col){var tmp,res=false;var findResults=this.lastFindOptions&&this.lastFindOptions.findResults;if(findResults){if(!this.lastFindOptions.scanByRows){tmp=col;col=row;row=tmp}res=findResults.contains(row,col)}return res};Worksheet.prototype.excludeHiddenRows=function(bExclude){this.bExcludeHiddenRows=bExclude};Worksheet.prototype.ignoreWriteFormulas=function(val){this.bIgnoreWriteFormulas=val};Worksheet.prototype.checkShiftArrayFormulas= function(range,offset){var res=true;var isHor=offset&&offset.col;var isDelete=offset&&(offset.col<0||offset.row<0);var checkRange=function(formulaRange){if(isDelete&&formulaRange.intersection(range)&&!range.containsRange(formulaRange))return false;if(isHor){if(range.r1>formulaRange.r1&&range.r1<=formulaRange.r2)return false;if(range.r2>=formulaRange.r1&&range.r2<formulaRange.r2)return false;if(range.c1>formulaRange.c1&&range.c1<=formulaRange.c2)return false}else{if(range.c1>formulaRange.c1&&range.c1<= formulaRange.c2)return false;if(range.c2>=formulaRange.c1&&range.c2<formulaRange.c2)return false;if(range.r1>formulaRange.r1&&range.r1<=formulaRange.r2)return false}return true};var alreadyCheckFormulas=[];var r2=range.r2,c2=range.c2;if(isHor)c2=gc_nMaxCol0;else r2=gc_nMaxRow0;this.getRange3(range.r1,range.c1,r2,c2)._foreachNoEmpty(function(cell){if(res&&cell.isFormula()){var formulaParsed=cell.getFormulaParsed();var arrayFormulaRef=formulaParsed.getArrayFormulaRef();if(arrayFormulaRef&&!alreadyCheckFormulas[formulaParsed._index]){if(!checkRange(arrayFormulaRef))res= false;alreadyCheckFormulas[formulaParsed._index]=1}}});return res};Worksheet.prototype.setRowsCount=function(val){if(val>gc_nMaxRow0||val<0)return;this.nRowsCount=val};Worksheet.prototype.fromXLSB=function(stream,type,tmp,aCellXfs,aSharedStrings,fInitCellAfterRead){stream.XlsbSkipRecord();var oldPos=-1;while(oldPos!==stream.GetCurPos()){oldPos=stream.GetCurPos();type=stream.XlsbReadRecordType();if(AscCommonExcel.XLSB.rt_CELL_BLANK<=type&&type<=AscCommonExcel.XLSB.rt_FMLA_ERROR){tmp.cell.clear();tmp.formula.clean(); tmp.cell.fromXLSB(stream,type,tmp.row.index,aCellXfs,aSharedStrings,tmp);fInitCellAfterRead(tmp)}else if(AscCommonExcel.XLSB.rt_ROW_HDR===type){tmp.row.clear();tmp.row.fromXLSB(stream,aCellXfs);tmp.row.saveContent();tmp.ws.cellsByColRowsCount=Math.max(tmp.ws.cellsByColRowsCount,tmp.row.index+1);tmp.ws.nRowsCount=Math.max(tmp.ws.nRowsCount,tmp.ws.cellsByColRowsCount)}else if(AscCommonExcel.XLSB.rt_END_SHEET_DATA===type){stream.XlsbSkipRecord();break}else stream.XlsbSkipRecord()}};Worksheet.prototype.needRecalFormulas= function(start,stop){var res=false;if(this.AutoFilter&&this.AutoFilter.isApplyAutoFilter())return true;var tableParts=this.TableParts;var tablePart;for(var i=0;i<tableParts.length;i++){tablePart=tableParts[i];if(tablePart&&tablePart.Ref&&start>=tablePart.Ref.r1&&stop<=tablePart.Ref.r2){res=true;break}}return res};Worksheet.prototype.getRowColColors=function(columnRange,byRow,notCheckOneColor){var ws=this;var res={text:true,colors:[],fontColors:[]};var alreadyAddColors={},alreadyAddFontColors={};var getAscColor= function(color){var ascColor=new Asc.asc_CColor;ascColor.asc_putR(color.getR());ascColor.asc_putG(color.getG());ascColor.asc_putB(color.getB());ascColor.asc_putA(color.getA());return ascColor};var addFontColorsToArray=function(fontColor){var rgb=fontColor&&null!==fontColor?fontColor.getRgb():null;if(rgb===0)rgb=null;var isDefaultFontColor=null===rgb;if(true!==alreadyAddFontColors[rgb])if(isDefaultFontColor){res.fontColors.push(null);alreadyAddFontColors[null]=true}else{var ascFontColor=getAscColor(fontColor); res.fontColors.push(ascFontColor);alreadyAddFontColors[rgb]=true}};var addCellColorsToArray=function(color){var rgb=null!==color&&color.fill&&color.fill.bg()?color.fill.bg().getRgb():null;var isDefaultCellColor=null===rgb;if(true!==alreadyAddColors[rgb])if(isDefaultCellColor){res.colors.push(null);alreadyAddColors[null]=true}else{var ascColor=getAscColor(color.fill.bg());res.colors.push(ascColor);alreadyAddColors[rgb]=true}};var tempText=0,tempDigit=0;var r1=byRow?columnRange.r1:columnRange.r1;var r2= byRow?columnRange.r1:columnRange.r2;var c1=byRow?columnRange.c1:columnRange.c1;var c2=byRow?columnRange.c2:columnRange.c1;ws.getRange3(r1,c1,r2,c2)._foreachNoEmpty(function(cell){if(!cell){if(true!==alreadyAddColors[null]){alreadyAddColors[null]=true;res.colors.push(null)}return}if(false===cell.isNullText()){var type=cell.getType();if(type===0)tempDigit++;else tempText++}var multiText=cell.getValueMultiText();var fontColor=null;var xfs=cell.getCompiledStyleCustom(false,true,true);if(null!==multiText)for(var j= 0;j<multiText.length;j++){fontColor=multiText[j].format?multiText[j].format.getColor():null;if(null!==fontColor)addFontColorsToArray(fontColor);else{fontColor=xfs&&xfs.font?xfs.font.getColor():null;addFontColorsToArray(fontColor)}}else{fontColor=xfs&&xfs.font?xfs.font.getColor():null;addFontColorsToArray(fontColor)}addCellColorsToArray(xfs)});if(res.colors.length===1&&!notCheckOneColor)res.colors=[];if(res.fontColors.length===1&&!notCheckOneColor)res.fontColors=[];res.text=tempDigit<=tempText;return res}; Worksheet.prototype.updateSortStateOffset=function(range,offset){if(!this.sortState)return;var bAlreadyDel=false;if(offset.row<0||offset.col<0)bAlreadyDel=this.deleteSortState(range);if(!bAlreadyDel){var bboxShift=AscCommonExcel.shiftGetBBox(range,0!==offset.col);this.sortState.shift(range,offset,this,true);this.moveSortState(bboxShift,offset)}};Worksheet.prototype.deleteSortState=function(range){if(this.sortState&&range.containsRange(this.sortState.Ref)){this._deleteSortState();return true}return false}; Worksheet.prototype._deleteSortState=function(){var oldSortState=this.sortState.clone();this.sortState=null;History.Add(AscCommonExcel.g_oUndoRedoSortState,AscCH.historyitem_SortState_Add,this.getId(),null,new AscCommonExcel.UndoRedoData_SortState(oldSortState,null));return true};Worksheet.prototype.moveSortState=function(range,offset){if(this.sortState&&range.containsRange(this.sortState.Ref)){this.sortState.setOffset(offset,this,true);return true}return false};Worksheet.prototype.getDrawingDocument= function(){if(this.workbook)return this.workbook.getDrawingDocument();return null};Worksheet.prototype.getActiveFunctionInfo=function(parser,parserResult,argNum,type,doNotCalcArgs){var t=this;var calculateFormula=function(str){var _res=null;if(str!==""){var _formulaParsedArg=new AscCommonExcel.parserFormula(str,null,t);var _parseResultArg=new AscCommonExcel.ParseResult([],[]);_formulaParsedArg.parse(true,true,_parseResultArg,true);if(!_parseResultArg.error)_res=_formulaParsedArg.calculate()}return _res}; var convertFormulaResultByType=function(_res){if(type===undefined||type===null)return _res.toLocaleString();var result="";if(type===Asc.c_oAscFormulaArgumentType.number){_res=_res.tocNumber();if(_res)result=_res.toLocaleString()}return result};var _formulaParsed,_parseResult,valueForEdit;if(!parser){var activeCell=this.selectionRange.activeCell;var formulaParsed;this.getCell3(activeCell.row,activeCell.col)._foreachNoEmpty(function(cell){if(cell.isFormula()){formulaParsed=cell.getFormulaParsed();if(formulaParsed)valueForEdit= cell.getValueForEdit()}});_formulaParsed=new AscCommonExcel.parserFormula(valueForEdit.substr(1),null,this);_parseResult=new AscCommonExcel.ParseResult([],[]);_formulaParsed.parse(true,true,_parseResult,true)}else{_formulaParsed=parser;_parseResult=parserResult;valueForEdit="="+parser.Formula}var res,str,calcRes;if(_formulaParsed&&_parseResult.activeFunction&&_parseResult.activeFunction.func){res=new AscCommonExcel.CFunctionInfo(_parseResult.activeFunction.func.name);if(!_parseResult.error){var _parent= _formulaParsed.parent;_formulaParsed.parent=null;res.formulaResult=_formulaParsed.calculate().toLocaleString();_formulaParsed.parent=_parent}str=valueForEdit.substring(_parseResult.activeFunction.start+1,_parseResult.activeFunction.end+1);calcRes=calculateFormula(str);if(calcRes)res.functionResult=calcRes.toLocaleString();res._cursorPos=_parseResult.cursorPos+1;var argPosArr=_parseResult.argPosArr;if(argPosArr&&argPosArr.length&&true!==doNotCalcArgs)for(var i=0;i<argPosArr.length;i++){if(!res.argumentsValue)res.argumentsValue= [];str=valueForEdit.substring(argPosArr[i].start,argPosArr[i].end);res.argumentsValue.push(str);if(str!==""){if(!res.argumentsResult)res.argumentsResult=[];calcRes=calculateFormula(str);if(calcRes)res.argumentsResult[i]=i===argNum?convertFormulaResultByType(calcRes):calcRes.toLocaleString()}}}return res};Worksheet.prototype.isActiveCellFormula=function(){var activeCell=this.selectionRange.activeCell;var res;this.getCell3(activeCell.row,activeCell.col)._foreachNoEmpty(function(cell){if(cell.isFormula())res= true});return res};Worksheet.prototype.calculateWizardFormula=function(formula,type){var res=null,resultStr="";if(formula){var parser=new AscCommonExcel.parserFormula(formula,null,this);var parseResultArg=new AscCommonExcel.ParseResult([],[]);parser.parse(true,true,parseResultArg,true);if(!parseResultArg.error)res=parser.calculate();if(res){if(res.type===AscCommonExcel.cElementType.cell||res.type===AscCommonExcel.cElementType.cell3D)res=res.getValue();if(type===undefined||type===null||res.type=== AscCommonExcel.cElementType.error)return{str:res.toLocaleString(),obj:res};if(type===Asc.c_oAscFormulaArgumentType.number)if(res.type===AscCommonExcel.cElementType.array){res=res.getElementRowCol(0,0);res=res.tocNumber();if(res)resultStr='"'+res.toLocaleString()+'"'}else if(res.type===AscCommonExcel.cElementType.cellsRange)resultStr=res.toLocaleString();else{if(res.type!==AscCommonExcel.cElementType.cellsRange3D){res=res.tocNumber();if(res)resultStr=res.toLocaleString()}}else if(type===Asc.c_oAscFormulaArgumentType.text)if(res.type=== AscCommonExcel.cElementType.array){res=res.getElementRowCol(0,0);res=res.tocString();if(res)resultStr='"'+res.toLocaleString()+'"'}else if(res.type===AscCommonExcel.cElementType.cellsRange)resultStr=res.toLocaleString();else{if(res.type!==AscCommonExcel.cElementType.cellsRange3D){res=res.tocString();if(res)resultStr='"'+res.toLocaleString()+'"'}}else if(type===Asc.c_oAscFormulaArgumentType.logical){if(res.type===AscCommonExcel.cElementType.cellsRange||res.type===AscCommonExcel.cElementType.cellsRange3D)res= res.getFullArray(new AscCommonExcel.cNumber(0));else if(res.type!==AscCommonExcel.cElementType.array)res=res.tocBool();if(res)resultStr=res.toLocaleString()}else if(type===Asc.c_oAscFormulaArgumentType.any)if(res.type===AscCommonExcel.cElementType.array){res=res.getElementRowCol(0,0);res=res.tocString();if(res)resultStr=res.toLocaleString()}else if(res.type===AscCommonExcel.cElementType.cellsRange)resultStr=res.toLocaleString();else if(res.type===AscCommonExcel.cElementType.cellsRange3D)resultStr= res.toLocaleString();else{res=res.tocString();if(res)resultStr='"'+res.toLocaleString()+'"'}else if(type===Asc.c_oAscFormulaArgumentType.reference)if(res.type===AscCommonExcel.cElementType.array)resultStr=res.toLocaleString();else if(res.type===AscCommonExcel.cElementType.cellsRange||res.type===AscCommonExcel.cElementType.cellsRange3D){res=res.getFullArray(new AscCommonExcel.cNumber(0));if(res)resultStr=res.toLocaleString()}else resultStr=res.toLocaleString()}}return{str:resultStr,obj:res}};Worksheet.prototype.insertSlicer= function(name,obj_name,type,pivotTable,slicerCacheDefinition){History.Create_NewPoint();History.StartTransaction();var slicer=new window["Asc"].CT_slicer(this);slicer.cacheDefinition=slicerCacheDefinition||null;var isNewCache=slicer.init(name,obj_name,type,undefined,pivotTable);this.aSlicers.push(slicer);var oCache=slicer.getCacheDefinition();History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SlicerAdd,this.getId(),null,new AscCommonExcel.UndoRedoData_FromTo(null,slicer)); if(isNewCache)slicer.updateItemsWithNoData();if(oCache){var _name=oCache.name;var newDefName=new Asc.asc_CDefName(_name,"#N/A",null,Asc.c_oAscDefNameType.slicer);this.workbook.editDefinesNames(null,newDefName)}History.EndTransaction();return slicer};Worksheet.prototype.deleteSlicer=function(name,doDelDefName){var res=false;History.Create_NewPoint();History.StartTransaction();var slicerObj=this.getSlicerIndexByName(name);if(null!==slicerObj){this.aSlicers.splice(slicerObj.index,1);History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_SlicerDelete,this.getId(),null,new AscCommonExcel.UndoRedoData_FromTo(slicerObj.obj,null));this.workbook.onSlicerDelete(name);res=true;if(!this.workbook.bUndoChanges&&!this.workbook.bRedoChanges||doDelDefName){var cache=slicerObj.obj.getCacheDefinition();if(cache&&null===this.workbook.getSlicersByCacheName(cache.name)){var defName=this.workbook.getDefinesNames(cache.name);if(defName)this.workbook.delDefinesNames(defName.getAscCDefName())}}}History.EndTransaction();return res}; Worksheet.prototype.getSlicerCachesBySourceName=function(name){var res=null;for(var i=0;i<this.aSlicers.length;i++){var cache=this.aSlicers[i].getSlicerCache();if(cache&&name===cache.sourceName){if(!res)res=[];res.push(cache)}}return res};Worksheet.prototype.getSlicersByCaption=function(name){var res=[];for(var i=0;i<this.aSlicers.length;i++)if(name===this.aSlicers[i].caption)res.push({obj:this.aSlicers[i],index:i});return res.length?res:null};Worksheet.prototype.getSlicersByCacheName=function(name){var res= [];for(var i=0;i<this.aSlicers.length;i++){var cache=this.aSlicers[i].getSlicerCache();if(cache&&name===cache.name)res.push(this.aSlicers[i])}return res.length?res:null};Worksheet.prototype.getSlicerCacheByCacheName=function(name){for(var i=0;i<this.aSlicers.length;i++){var cache=this.aSlicers[i].getSlicerCache();if(cache&&name===cache.name)return cache}return null};Worksheet.prototype.getSlicerByName=function(name){var res=null;for(var i=0;i<this.aSlicers.length;i++)if(name===this.aSlicers[i].name){res= this.aSlicers[i];break}return res};Worksheet.prototype.getSlicerViewByName=function(name){var res=null;for(var i=0;i<this.Drawings.length;i++){res=this.Drawings[i].getSlicerViewByName(name);if(res)break}return res};Worksheet.prototype.getSlicerIndexByName=function(name){var res=null;for(var i=0;i<this.aSlicers.length;i++)if(name===this.aSlicers[i].name){res={obj:this.aSlicers[i],index:i};break}return res};Worksheet.prototype.getSlicerCacheByName=function(name){for(var i=0;i<this.aSlicers.length;i++){var cache= this.aSlicers[i].getSlicerCache();if(cache&&name===cache.name)return cache}return null};Worksheet.prototype.getSlicersByTableName=function(val){var res=[];for(var i=0;i<this.aSlicers.length;i++){var tableSlicerCache=this.aSlicers[i].getTableSlicerCache();if(tableSlicerCache&&tableSlicerCache.tableId===val)res.push(this.aSlicers[i])}return res.length?res:null};Worksheet.prototype.getSlicersByTableColName=function(tableName,colName){var res=[];for(var i=0;i<this.aSlicers.length;i++){var tableSlicerCache= this.aSlicers[i].getTableSlicerCache();if(tableSlicerCache&&tableSlicerCache.tableId===tableName&&tableSlicerCache.column===colName)res.push(this.aSlicers[i])}return res.length?res:null};Worksheet.prototype.changeTableColName=function(tableName,oldVal,newVal){if(this.workbook.bUndoChanges||this.workbook.bRedoChanges)return;var slicers=this.getSlicersByTableColName(tableName,oldVal);if(slicers){History.Create_NewPoint();History.StartTransaction();for(var i=0;i<slicers.length;i++)slicers[i].setTableColName(oldVal, newVal);History.EndTransaction()}};Worksheet.prototype.changeTableName=function(oldVal,newVal){if(this.workbook.bUndoChanges||this.workbook.bRedoChanges)return;var slicers=this.workbook.getSlicersByTableName(oldVal);if(slicers){History.Create_NewPoint();History.StartTransaction();for(var i=0;i<slicers.length;i++)slicers[i].setTableName(newVal);History.EndTransaction()}};Worksheet.prototype.setSlicerTableName=function(tableName,newTableName){for(var i=0;i<this.aSlicers.length;i++){var tableSlicerCache= this.aSlicers[i].getTableSlicerCache();if(tableSlicerCache&&tableSlicerCache.tableId===tableName)tableSlicerCache.setTableName(newTableName)}};Worksheet.prototype.onSlicerUpdate=function(sName){var bRet=false;for(var i=0;i<this.Drawings.length;++i)bRet=bRet||this.Drawings[i].onSlicerUpdate(sName);return bRet};Worksheet.prototype.onSlicerDelete=function(sName){var bRet=false;for(var i=0;i<this.Drawings.length;++i)bRet=bRet||this.Drawings[i].onSlicerDelete(sName);return bRet};Worksheet.prototype.onSlicerLock= function(sName,bLock){for(var i=0;i<this.Drawings.length;++i)this.Drawings[i].onSlicerLock(sName,bLock)};Worksheet.prototype.onSlicerChangeName=function(sName,sNewName){for(var i=0;i<this.Drawings.length;++i)this.Drawings[i].onSlicerChangeName(sName,sNewName)};Worksheet.prototype.deleteSlicersByTable=function(tableName){History.Create_NewPoint();History.StartTransaction();var slicers=this.workbook.getSlicersByTableName(tableName);if(slicers)for(var i=0;i<slicers.length;i++)this.deleteSlicer(slicers[i].name); History.EndTransaction()};Worksheet.prototype.deleteSlicersByTableCol=function(tableName,colMap){History.Create_NewPoint();History.StartTransaction();for(var j in colMap){var slicers=this.getSlicersByTableColName(tableName,j);if(slicers)for(var i=0;i<slicers.length;i++)this.deleteSlicer(slicers[i].name)}History.EndTransaction()};Worksheet.prototype.changeSlicerCacheName=function(oldVal,newVal){if(this.workbook.bUndoChanges||this.workbook.bRedoChanges)return;var slicers=this.getSlicersByCacheName(oldVal); if(slicers){History.Create_NewPoint();History.StartTransaction();for(var i=0;i<slicers.length;i++)slicers[i].setCacheName(newVal);History.EndTransaction()}};Worksheet.prototype.checkChangeTablesContent=function(arn){this.autoFilters.renameTableColumn(arn);var tables=this.autoFilters.getTablesIntersectionRange(arn);if(tables)for(var i=0;i<tables.length;i++)this.workbook.slicersUpdateAfterChangeTable(tables[i].DisplayName)};Worksheet.prototype.updateSlicersByRange=function(range){var tables=this.autoFilters.getTablesIntersectionRange(range); if(tables)for(var i=0;i<tables.length;i++)this.workbook.slicersUpdateAfterChangeTable(tables[i].DisplayName);var pivot=false;if(pivot);};Worksheet.prototype.getActiveNamedSheetViewId=function(){return this.activeNamedSheetViewId};Worksheet.prototype.setActiveNamedSheetView=function(id){this.activeNamedSheetViewId=id};Worksheet.prototype.getNvsFilterByTableName=function(val,opt_name,viewId){var activeNamedSheetViewId;if(viewId)activeNamedSheetViewId=viewId;else activeNamedSheetViewId=opt_name?this.getIdNamedSheetViewByName(opt_name): this.getActiveNamedSheetViewId();if(activeNamedSheetViewId===null)return;if(Asc.CT_NamedSheetView.prototype.getNsvFiltersByTableId){var sheetView=this.getNamedSheetViewById(activeNamedSheetViewId);return sheetView?sheetView.getNsvFiltersByTableId(val):null}return null};Worksheet.prototype.getNamedSheetViewFilterColumns=function(val){var nsvFilter=this.getNvsFilterByTableName(val);if(nsvFilter&&nsvFilter.columnsFilter)return nsvFilter.columnsFilter;return null};Worksheet.prototype.addNamedSheetView= function(sheetView,isDuplicate){if(!sheetView){sheetView=new Asc.CT_NamedSheetView;sheetView.name=sheetView.generateName()}var _filter;if(!isDuplicate){for(var i=0;i<this.TableParts.length;i++){_filter=new Asc.CT_NsvFilter;_filter.init(this.TableParts[i]);sheetView.nsvFilters.push(_filter)}if(this.AutoFilter){_filter=new Asc.CT_NsvFilter;_filter.init(this.AutoFilter);sheetView.nsvFilters.push(_filter)}}this.insertNamedSheetView(sheetView,true)};Worksheet.prototype.deleteNamedSheetViews=function(arr, doNotAddHistory){var namedSheetViews=this.aNamedSheetViews;if(namedSheetViews&&arr){var diff=0;for(var i=0;i<arr.length;i++){if(!arr[i])continue;var index=this.getIndexNamedSheetViewByName(arr[i].name);var namedSheetView=this.getNamedSheetViewByName(arr[i].name);if(namedSheetView.Id===this.getActiveNamedSheetViewId())if(this.workbook.oApi.asc_setActiveNamedSheetView)this.workbook.oApi.asc_setActiveNamedSheetView(null);if(!doNotAddHistory)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SheetViewDelete, this.getId(),null,new AscCommonExcel.UndoRedoData_NamedSheetViewRedo(namedSheetView.Get_Id(),namedSheetView,null));namedSheetViews.splice(index-diff,1);diff++}}};Worksheet.prototype.insertNamedSheetView=function(sheetView,addToHistory){sheetView.ws=this;this.aNamedSheetViews.push(sheetView);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SheetViewAdd,this.getId(),null,new AscCommonExcel.UndoRedoData_BinaryWrapper(sheetView))};Worksheet.prototype.getNamedSheetViews= function(){var namedSheetViews=this.aNamedSheetViews;if(namedSheetViews){var res=[],ascSheetView;for(var i=0;i<namedSheetViews.length;i++){ascSheetView=namedSheetViews[i];ascSheetView._isActive=ascSheetView.Id===this.getActiveNamedSheetViewId();res.push(ascSheetView)}return res}return null};Worksheet.prototype.getNamedSheetViewByName=function(name){var namedSheetViews=this.aNamedSheetViews;if(namedSheetViews)for(var i=0;i<namedSheetViews.length;i++)if(name===namedSheetViews[i].name)return namedSheetViews[i]; return null};Worksheet.prototype.getNamedSheetViewById=function(id){var namedSheetViews=this.aNamedSheetViews;if(namedSheetViews)for(var i=0;i<namedSheetViews.length;i++)if(id===namedSheetViews[i].Get_Id())return namedSheetViews[i];return null};Worksheet.prototype.getIndexNamedSheetViewByName=function(name){var namedSheetViews=this.aNamedSheetViews;if(namedSheetViews)for(var i=0;i<namedSheetViews.length;i++)if(name===namedSheetViews[i].name)return i;return null};Worksheet.prototype.getIdNamedSheetViewByName= function(name){var namedSheetViews=this.aNamedSheetViews;if(namedSheetViews)for(var i=0;i<namedSheetViews.length;i++)if(name===namedSheetViews[i].name)return namedSheetViews[i].Id;return null};Worksheet.prototype.forEachView=function(actionView){var namedSheetViews=this.aNamedSheetViews;if(namedSheetViews){var activeId=this.getActiveNamedSheetViewId();for(var i=0;i<namedSheetViews.length;i++)actionView(namedSheetViews[i],activeId===namedSheetViews[i].Id)}};Worksheet.prototype.checkCorrectTables=function(){for(var i= 0;i<this.TableParts.length;++i){var table=this.TableParts[i];if(table.isHeaderRow())for(var j=0;j<table.TableColumns.length;j++)this._getCell(table.Ref.r1,table.Ref.c1+j,function(cell){var tableColName=table.TableColumns[j].Name;var valueData=cell.getValueData();var val=valueData&&valueData.value&&valueData.value.text;if(val!==tableColName)cell.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,new AscCommonExcel.CCellValue({text:tableColName,type:CellValueType.String})))})}};Worksheet.prototype.getDataValidationProps= function(doExtend){var _selection=this.getSelection();if(!this.dataValidations){var newDataValidation=new window["AscCommonExcel"].CDataValidation;newDataValidation.showErrorMessage=true;newDataValidation.showInputMessage=true;newDataValidation.allowBlank=true;return newDataValidation}else return this.dataValidations.getProps(_selection.ranges,doExtend,this)};Worksheet.prototype.setDataValidationProps=function(props){var _selection=this.getSelection();if(!this.dataValidations)this.dataValidations= new window["AscCommonExcel"].CDataValidations;this.dataValidations.setProps(this,_selection.ranges,props)};Worksheet.prototype.addDataValidation=function(dataValidation,addToHistory){if(!this.dataValidations)this.dataValidations=new window["AscCommonExcel"].CDataValidations;this.dataValidations.add(this,dataValidation,addToHistory)};Worksheet.prototype.deleteDataValidationById=function(id){if(this.dataValidations)this.dataValidations.delete(this,id)};Worksheet.prototype.getDataValidationById=function(id){if(this.dataValidations)return this.dataValidations.getById(id)}; Worksheet.prototype.shiftDataValidation=function(bInsert,operType,updateRange,addToHistory){if(this.dataValidations)this.dataValidations.shift(this,bInsert,operType,updateRange,addToHistory)};Worksheet.prototype.clearDataValidation=function(ranges,addToHistory){if(this.dataValidations)this.dataValidations.clear(this,ranges,addToHistory)};Worksheet.prototype._moveDataValidation=function(oBBoxFrom,oBBoxTo,copyRange,offset,wsTo){if(!wsTo)wsTo=this;if(false===this.workbook.bUndoChanges&&false===this.workbook.bRedoChanges){wsTo.clearDataValidation([oBBoxTo], true);if(this===wsTo){if(this.dataValidations)this.dataValidations.move(this,oBBoxFrom,oBBoxTo,copyRange,offset)}else{var aDataValidations=this._getCopyDataValidationByRange(oBBoxFrom,offset);if(aDataValidations){if(!copyRange)this.clearDataValidation([oBBoxFrom],true);for(var i=0;i<aDataValidations.length;i++)wsTo.addDataValidation(aDataValidations[i],true)}}}};Worksheet.prototype._getCopyDataValidationByRange=function(range,offset){if(this.dataValidations)return this.dataValidations.getCopyByRange(range, offset);return null};var g_nCellOffsetFlag=0;var g_nCellOffsetXf=g_nCellOffsetFlag+1;var g_nCellOffsetFormula=g_nCellOffsetXf+4;var g_nCellOffsetValue=g_nCellOffsetFormula+4;var g_nCellStructSize=g_nCellOffsetValue+8;var g_nCellFlag_empty=0;var g_nCellFlag_init=1;var g_nCellFlag_typeMask=6;var g_nCellFlag_valueMask=24;var g_nCellFlag_isDirtyMask=32;var g_nCellFlag_isCalcMask=64;function Cell(worksheet){this.ws=worksheet;this.nRow=-1;this.nCol=-1;this.xfs=null;this.formulaParsed=null;this.type=CellValueType.Number; this.number=null;this.text=null;this.multiText=null;this.textIndex=null;this.isDirty=false;this.isCalc=false;this._hasChanged=false}Cell.prototype.clear=function(keepIndex){this.nRow=-1;this.nCol=-1;this.clearData();this._hasChanged=false};Cell.prototype.clearData=function(){this.xfs=null;this.formulaParsed=null;this.type=CellValueType.Number;this.number=null;this.text=null;this.multiText=null;this.textIndex=null;this.isDirty=false;this.isCalc=false;this._hasChanged=true};Cell.prototype.clearDataKeepXf= function(border){var xfs=this.xfs;this.clearData();this.xfs=xfs;History.TurnOff();this.setBorder(border);History.TurnOn()};Cell.prototype.saveContent=function(opt_inCaseOfChange){if(this.hasRowCol()&&(!opt_inCaseOfChange||this._hasChanged)){this._hasChanged=false;var wb=this.ws.workbook;var sheetMemory=this.ws.getColData(this.nCol);sheetMemory.checkSize(this.nRow);var xfSave=this.xfs?this.xfs.getIndexNumber():0;var numberSave=0;var formulaSave=this.formulaParsed?wb.workbookFormulas.add(this.formulaParsed).getIndexNumber(): 0;var flagValue=0;if(null!=this.number){flagValue=1;sheetMemory.setFloat64(this.nRow,g_nCellOffsetValue,this.number)}else if(null!=this.text){flagValue=2;numberSave=this.getTextIndex();sheetMemory.setUint32(this.nRow,g_nCellOffsetValue,numberSave)}else if(null!=this.multiText){flagValue=3;numberSave=this.getTextIndex();sheetMemory.setUint32(this.nRow,g_nCellOffsetValue,numberSave)}sheetMemory.setUint8(this.nRow,g_nCellOffsetFlag,this._toFlags(flagValue));sheetMemory.setUint32(this.nRow,g_nCellOffsetXf, xfSave);sheetMemory.setUint32(this.nRow,g_nCellOffsetFormula,formulaSave)}};Cell.prototype.loadContent=function(row,col,opt_sheetMemory){var res=false;this.clear();this.nRow=row;this.nCol=col;var sheetMemory=opt_sheetMemory?opt_sheetMemory:this.ws.getColDataNoEmpty(this.nCol);if(sheetMemory)if(sheetMemory.hasSize(this.nRow)){var flags=sheetMemory.getUint8(this.nRow,g_nCellOffsetFlag);if(0!=(g_nCellFlag_init&flags)){var wb=this.ws.workbook;var flagValue=this._fromFlags(flags);this.xfs=g_StyleCache.getXf(sheetMemory.getUint32(this.nRow, g_nCellOffsetXf));this.formulaParsed=wb.workbookFormulas.get(sheetMemory.getUint32(this.nRow,g_nCellOffsetFormula));if(1===flagValue)this.number=sheetMemory.getFloat64(this.nRow,g_nCellOffsetValue);else if(2===flagValue){this.textIndex=sheetMemory.getUint32(this.nRow,g_nCellOffsetValue);this.text=wb.sharedStrings.get(this.textIndex)}else if(3===flagValue){this.textIndex=sheetMemory.getUint32(this.nRow,g_nCellOffsetValue);this.multiText=wb.sharedStrings.get(this.textIndex)}res=true}}return res};Cell.prototype._toFlags= function(flagValue){var flags=g_nCellFlag_init|this.type<<1|flagValue<<3;if(this.isDirty)flags|=g_nCellFlag_isDirtyMask;if(this.isCalc)flags|=g_nCellFlag_isCalcMask;return flags};Cell.prototype._fromFlags=function(flags){this.type=(flags&g_nCellFlag_typeMask)>>>1;this.isDirty=0!=(flags&g_nCellFlag_isDirtyMask);this.isCalc=0!=(flags&g_nCellFlag_isCalcMask);return(flags&g_nCellFlag_valueMask)>>>3};Cell.prototype.processFormula=function(callback){if(this.formulaParsed){var shared=this.formulaParsed.getShared(); var offsetRow,offsetCol;if(shared){offsetRow=this.nRow-shared.base.nRow;offsetCol=this.nCol-shared.base.nCol;if(0!==offsetRow||0!==offsetCol){var oldRow=this.formulaParsed.parent.nRow;var oldCol=this.formulaParsed.parent.nCol;var old=AscCommonExcel.g_ProcessShared;AscCommonExcel.g_ProcessShared=true;var offsetShared=new AscCommon.CellBase(offsetRow,offsetCol);this.formulaParsed.changeOffset(offsetShared,false);this.formulaParsed.parent.nRow=this.nRow;this.formulaParsed.parent.nCol=this.nCol;callback(this.formulaParsed); offsetShared.row=-offsetRow;offsetShared.col=-offsetCol;this.formulaParsed.changeOffset(offsetShared,false);this.formulaParsed.parent.nRow=oldRow;this.formulaParsed.parent.nCol=oldCol;AscCommonExcel.g_ProcessShared=old}else callback(this.formulaParsed)}else callback(this.formulaParsed)}};Cell.prototype.setChanged=function(val){this._hasChanged=val};Cell.prototype.getStyle=function(){return this.xfs};Cell.prototype.getCompiledStyle=function(opt_styleComponents){return this.ws.getCompiledStyle(this.nRow, this.nCol,this,opt_styleComponents)};Cell.prototype.getCompiledStyleCustom=function(needTable,needCell,needConditional){return this.ws.getCompiledStyleCustom(this.nRow,this.nCol,needTable,needCell,needConditional,this)};Cell.prototype.getTableStyle=function(){var hiddenManager=this.ws.hiddenManager;var sheetMergedStyles=this.ws.sheetMergedStyles;var styleComponents=sheetMergedStyles.getStyle(hiddenManager,this.nRow,this.nCol,this.ws);return getCompiledStyleFromArray(null,styleComponents.table)};Cell.prototype.duplicate= function(){var t=this;var oNewCell=new Cell(this.ws);oNewCell.nRow=this.nRow;oNewCell.nCol=this.nCol;oNewCell.xfs=this.xfs;oNewCell.type=this.type;oNewCell.number=this.number;oNewCell.text=this.text;oNewCell.multiText=this.multiText;this.processFormula(function(parsed){var newFormula=new parserFormula(parsed.getFormula(),oNewCell,t.ws);AscCommonExcel.executeInR1C1Mode(false,function(){newFormula.parse()});var arrayFormulaRef=parsed.getArrayFormulaRef();if(arrayFormulaRef)newFormula.setArrayFormulaRef(arrayFormulaRef); oNewCell.setFormulaInternal(newFormula)});return oNewCell};Cell.prototype.clone=function(oNewWs,renameParams){if(!oNewWs)oNewWs=this.ws;var oNewCell=new Cell(oNewWs);oNewCell.nRow=this.nRow;oNewCell.nCol=this.nCol;if(null!=this.xfs)oNewCell.xfs=this.xfs;oNewCell.type=this.type;oNewCell.number=this.number;oNewCell.text=this.text;oNewCell.multiText=this.multiText;this.processFormula(function(parsed){var newFormula;if(oNewWs!=this.ws&&renameParams){var formula=parsed.clone(null,null,this.ws);formula.renameSheetCopy(renameParams); newFormula=formula.assemble(true)}else newFormula=parsed.getFormula();oNewCell.setFormulaInternal(new parserFormula(newFormula,oNewCell,oNewWs));oNewWs.workbook.dependencyFormulas.addToBuildDependencyCell(oNewCell)});return oNewCell};Cell.prototype.setRowCol=function(nRow,nCol){this.nRow=nRow;this.nCol=nCol};Cell.prototype.hasRowCol=function(){return this.nRow>=0&&this.nCol>=0};Cell.prototype.isEqual=function(options){var cellText;cellText=options.lookIn===Asc.c_oAscFindLookIn.Formulas?this.getValueForEdit(): this.getValue();if(true!==options.isMatchCase)cellText=cellText.toLowerCase();var isWordEnter=cellText.indexOf(options.findWhat);if(options.findWhat instanceof RegExp&&options.isWholeWord)isWordEnter=cellText.search(options.findWhat);return 0<=isWordEnter&&(true!==options.isWholeCell||options.findWhat.length===cellText.length)};Cell.prototype.isNullText=function(){return this.isNullTextString()&&!this.formulaParsed};Cell.prototype.isEmptyTextString=function(){this._checkDirty();if(null!=this.number|| null!=this.text&&""!=this.text)return false;if(null!=this.multiText&&""!=AscCommonExcel.getStringFromMultiText(this.multiText))return false;return true};Cell.prototype.isNullTextString=function(){this._checkDirty();return null===this.number&&null===this.text&&null===this.multiText};Cell.prototype.isEmpty=function(){if(false==this.isNullText())return false;if(null!=this.xfs)return false;return true};Cell.prototype.isFormula=function(){return this.formulaParsed?true:false};Cell.prototype.getName=function(){return g_oCellAddressUtils.getCellId(this.nRow, this.nCol)};Cell.prototype.setTypeInternal=function(val){this.type=val;this._hasChanged=true};Cell.prototype.correctValueByType=function(){switch(this.type){case CellValueType.Number:if(null!==this.text)this.setValueNumberInternal(parseInt(this.text)||0);else if(null!==this.multiText)this.setValueNumberInternal(0);break;case CellValueType.Bool:if(null!==this.text||null!==this.multiText)this.setValueNumberInternal(0);break;case CellValueType.String:if(null!==this.number)this.setValueTextInternal(this.number.toString()); break;case CellValueType.Error:if(null!==this.number)this.setValueTextInternal(cErrorOrigin["nil"]);break}};Cell.prototype.setValueNumberInternal=function(val){this.number=val;this.text=null;this.multiText=null;this.textIndex=null;this._hasChanged=true};Cell.prototype.setValueTextInternal=function(val){this.number=null;this.text=val;this.multiText=null;this.textIndex=null;this._hasChanged=true};Cell.prototype.setValueMultiTextInternal=function(val){this.number=null;this.text=null;this.multiText=val; this.textIndex=null;this._hasChanged=true};Cell.prototype.setValue=function(val,callback,isCopyPaste,byRef,ignoreHyperlink){var ws=this.ws;var wb=ws.workbook;var DataOld=null;if(History.Is_On())DataOld=this.getValueData();var isFirstArrayFormulaCell=byRef&&this.nCol===byRef.c1&&this.nRow===byRef.r1;var newFP=this.setValueGetParsed(val,callback,isCopyPaste,byRef);if(undefined===newFP)return;this.cleanText();this.setFormulaInternal(null);if(newFP){this.setFormulaInternal(newFP);if(byRef){if(isFirstArrayFormulaCell)wb.dependencyFormulas.addToBuildDependencyArray(newFP)}else wb.dependencyFormulas.addToBuildDependencyCell(this)}else if(val){this._setValue(val, ignoreHyperlink);if(!ignoreHyperlink)this._autoformatHyperlink(val);wb.dependencyFormulas.addToChangedCell(this)}else wb.dependencyFormulas.addToChangedCell(this);var DataNew=null;if(History.Is_On())DataNew=this.getValueData();if(History.Is_On()&&false==DataOld.isEqual(DataNew))History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_ChangeValue,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,DataOld,DataNew));this.ws.workbook.sortDependency(); if(!this.ws.workbook.dependencyFormulas.isLockRecal())this._adjustCellFormat();if(this.isNullTextString()){var cell=this.ws.getCell3(this.nRow,this.nCol);cell.removeHyperlink()}};Cell.prototype.setValueGetParsed=function(val,callback,isCopyPaste,byRef){var ws=this.ws;var wb=ws.workbook;var bIsTextFormat=false;if(!isCopyPaste){var sNumFormat;if(null!=this.xfs&&null!=this.xfs.num)sNumFormat=this.xfs.num.getFormat();else sNumFormat=g_oDefaultFormat.Num.getFormat();var numFormat=oNumFormatCache.get(sNumFormat); bIsTextFormat=numFormat.isTextFormat()}var isFirstArrayFormulaCell=byRef&&this.nCol===byRef.c1&&this.nRow===byRef.r1;var newFP=null;if(false==bIsTextFormat)if(null!=val&&val[0]=="="&&val.length>1)if(byRef&&!isFirstArrayFormulaCell){newFP=this.ws.formulaArrayLink;if(newFP===null)return;if(this.nCol===byRef.c2&&this.nRow===byRef.r2)this.ws.formulaArrayLink=null}else{var cellWithFormula=new CCellWithFormula(this.ws,this.nRow,this.nCol);newFP=new parserFormula(val.substring(1),cellWithFormula,this.ws); var formulaLocaleParse=isCopyPaste===true?false:oFormulaLocaleInfo.Parse;var formulaLocaleDigetSep=isCopyPaste===true?false:oFormulaLocaleInfo.DigitSep;var parseResult=new AscCommonExcel.ParseResult;if(!newFP.parse(formulaLocaleParse,formulaLocaleDigetSep,parseResult))switch(parseResult.error){case c_oAscError.ID.FrmlWrongFunctionName:break;case c_oAscError.ID.FrmlParenthesesCorrectCount:return this.setValueGetParsed("="+newFP.getFormula(),callback,isCopyPaste,byRef);default:{wb.handlers.trigger("asc_onError", parseResult.error,c_oAscError.Level.NoCritical);if(callback)callback(false);return}}else{newFP.setFormulaString(newFP.assemble());if(byRef){newFP.ref=byRef;this.ws.formulaArrayLink=newFP}}}return newFP};Cell.prototype.setValue2=function(array){var DataOld=null;if(History.Is_On())DataOld=this.getValueData();this.setFormulaInternal(null);this.cleanText();this._setValue2(array);this.ws.workbook.dependencyFormulas.addToChangedCell(this);this.ws.workbook.sortDependency();var DataNew=null;if(History.Is_On())DataNew= this.getValueData();if(History.Is_On()&&false==DataOld.isEqual(DataNew))History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_ChangeValue,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,DataOld,DataNew));if(this.isNullTextString()){var cell=this.ws.getCell3(this.nRow,this.nCol);cell.removeHyperlink()}};Cell.prototype.setValueForValidation=function(array,formula,callback,isCopyPaste,byRef){this.setFormulaInternal(null, true);this.cleanText();if(formula){var newFP=this.setValueGetParsed(formula,callback,isCopyPaste,byRef);this.ws.formulaArrayLink=null;if(newFP){this.setFormulaInternal(newFP,true);newFP.calculate();this._updateCellValue()}else if(undefined!==newFP)this._setValue(formula)}else this._setValue2(array,true)};Cell.prototype.setFormulaTemplate=function(bHistoryUndo,action){var DataOld=null;var DataNew=null;if(History.Is_On())DataOld=this.getValueData();this.cleanText();action(this);if(History.Is_On()){DataNew= this.getValueData();if(false==DataOld.isEqual(DataNew)){var typeHistory=bHistoryUndo?AscCH.historyitem_Cell_ChangeValueUndo:AscCH.historyitem_Cell_ChangeValue;History.Add(AscCommonExcel.g_oUndoRedoCell,typeHistory,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,DataOld,DataNew),bHistoryUndo)}}};Cell.prototype.setFormula=function(formula,bHistoryUndo,formulaRef){var cellWithFormula=new CCellWithFormula(this.ws,this.nRow,this.nCol); var parser=new parserFormula(formula,cellWithFormula,this.ws);if(formulaRef){parser.setArrayFormulaRef(formulaRef);this.ws.getRange3(formulaRef.r1,formulaRef.c1,formulaRef.r2,formulaRef.c2)._foreachNoEmpty(function(cell){cell.setFormulaParsed(parser,bHistoryUndo)})}else this.setFormulaParsed(parser,bHistoryUndo)};Cell.prototype.setFormulaParsed=function(parsed,bHistoryUndo){this.setFormulaTemplate(bHistoryUndo,function(cell){cell.setFormulaInternal(parsed);cell.ws.workbook.dependencyFormulas.addToBuildDependencyCell(cell)})}; Cell.prototype.setFormulaInternal=function(formula,dontTouchPrev){if(!dontTouchPrev&&this.formulaParsed){var shared=this.formulaParsed.getShared();var arrayFormula=this.formulaParsed.getArrayFormulaRef();if(shared){if(shared.ref.isOnTheEdge(this.nCol,this.nRow))this.ws.workbook.dependencyFormulas.addToChangedShared(this.formulaParsed);var index=this.ws.workbook.workbookFormulas.add(this.formulaParsed).getIndexNumber();History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_RemoveSharedFormula, this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,index,null),true)}else if(arrayFormula&&this.formulaParsed.checkFirstCellArray(this)){var fText="="+this.formulaParsed.getFormula();History.Add(AscCommonExcel.g_oUndoRedoArrayFormula,AscCH.historyitem_ArrayFromula_DeleteFormula,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new AscCommonExcel.UndoRedoData_ArrayFormula(arrayFormula,fText),true)}else this.formulaParsed.removeDependencies()}this.formulaParsed= formula;this._hasChanged=true};Cell.prototype.transformSharedFormula=function(){var res=false;var parsed=this.formulaParsed;if(parsed){var shared=parsed.getShared();if(shared){var offsetShared=new AscCommon.CellBase(this.nRow-shared.base.nRow,this.nCol-shared.base.nCol);var cellWithFormula=new AscCommonExcel.CCellWithFormula(this.ws,this.nRow,this.nCol);var newFormula=parsed.clone(undefined,cellWithFormula);newFormula.removeShared();newFormula.changeOffset(offsetShared,false);newFormula.setFormulaString(newFormula.assemble(true)); this.setFormulaInternal(newFormula);res=true}}return res};Cell.prototype.changeOffset=function(offset,canResize,bHistoryUndo,notOffset3d){this.setFormulaTemplate(bHistoryUndo,function(cell){cell.transformSharedFormula();var parsed=cell.getFormulaParsed();parsed.removeDependencies();parsed.changeOffset(offset,canResize,null,notOffset3d);parsed.setFormulaString(parsed.assemble(true));parsed.buildDependencies()})};Cell.prototype.setType=function(type){if(type!=this.type){var DataOld=this.getValueData(); this.setTypeInternal(type);this.correctValueByType();this._hasChanged=true;var DataNew=this.getValueData();History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_ChangeValue,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,DataOld,DataNew))}return type};Cell.prototype.getType=function(){this._checkDirty();return this.type};Cell.prototype.setCellStyle=function(val){var newVal=this.ws.workbook.CellStyles._prepareCellStyle(val); var oRes=this.ws.workbook.oStyleManager.setCellStyle(this,newVal);if(History.Is_On()){var oldStyleName=this.ws.workbook.CellStyles.getStyleNameByXfId(oRes.oldVal);History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Style,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oldStyleName,val));var oStyle=this.ws.workbook.CellStyles.getStyleByXfId(oRes.newVal);if(oStyle.ApplyFont)this.setFont(oStyle.getFont());if(oStyle.ApplyFill)this.setFill(oStyle.getFill()); if(oStyle.ApplyBorder)this.setBorder(oStyle.getBorder());if(oStyle.ApplyNumberFormat)this.setNumFormat(oStyle.getNumFormatStr())}};Cell.prototype.setNumFormat=function(val){this.setNum(new AscCommonExcel.Num({f:val}))};Cell.prototype.setNum=function(val){var oRes=this.ws.workbook.oStyleManager.setNum(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Num,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow, this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.shiftNumFormat=function(nShift,dDigitsCount){var bRes=false;var sNumFormat;if(null!=this.xfs&&null!=this.xfs.num)sNumFormat=this.xfs.num.getFormat();else sNumFormat=g_oDefaultFormat.Num.getFormat();var type=this.getType();var oCurNumFormat=oNumFormatCache.get(sNumFormat);if(null!=oCurNumFormat&&false==oCurNumFormat.isGeneralFormat()){var output={};bRes=oCurNumFormat.shiftFormat(output,nShift);if(true==bRes)this.setNumFormat(output.format)}else if(CellValueType.Number== type){var sGeneral=AscCommon.DecodeGeneralFormat(this.number,type,dDigitsCount);var oGeneral=oNumFormatCache.get(sGeneral);if(null!=oGeneral&&false==oGeneral.isGeneralFormat()){var output={};bRes=oGeneral.shiftFormat(output,nShift);if(true==bRes)this.setNumFormat(output.format)}}return bRes};Cell.prototype.setFont=function(val,bModifyValue){if(false!=bModifyValue)if(null!=this.multiText&&false==this.ws.workbook.bUndoChanges&&false==this.ws.workbook.bRedoChanges){var oldVal=null;if(History.Is_On())oldVal= this.getValueData();this.setValueTextInternal(AscCommonExcel.getStringFromMultiText(this.multiText));if(History.Is_On()){var newVal=this.getValueData();History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_ChangeValue,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oldVal,newVal))}}var oRes=this.ws.workbook.oStyleManager.setFont(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal){var oldVal=null;if(null!=oRes.oldVal)oldVal= oRes.oldVal.clone();var newVal=null;if(null!=oRes.newVal)newVal=oRes.newVal.clone();History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_SetFont,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oldVal,newVal))}};Cell.prototype.setFontname=function(val){var oRes=this.ws.workbook.oStyleManager.setFontname(this,val);this._setFontProp(function(format){return val!=format.getName()},function(format){format.setName(val)}); if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Fontname,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setFontsize=function(val){var oRes=this.ws.workbook.oStyleManager.setFontsize(this,val);this._setFontProp(function(format){return val!=format.getSize()},function(format){format.setSize(val)});if(History.Is_On()&&oRes.oldVal!= oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Fontsize,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setFontcolor=function(val){var oRes=this.ws.workbook.oStyleManager.setFontcolor(this,val);this._setFontProp(function(format){return val!=format.getColor()},function(format){format.setColor(val)});if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell, AscCH.historyitem_Cell_Fontcolor,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setBold=function(val){var oRes=this.ws.workbook.oStyleManager.setBold(this,val);this._setFontProp(function(format){return val!=format.getBold()},function(format){format.setBold(val)});if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Bold,this.ws.getId(), new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setItalic=function(val){var oRes=this.ws.workbook.oStyleManager.setItalic(this,val);this._setFontProp(function(format){return val!=format.getItalic()},function(format){format.setItalic(val)});if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Italic,this.ws.getId(),new Asc.Range(this.nCol,this.nRow, this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setUnderline=function(val){var oRes=this.ws.workbook.oStyleManager.setUnderline(this,val);this._setFontProp(function(format){return val!=format.getUnderline()},function(format){format.setUnderline(val)});if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Underline,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow), new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setStrikeout=function(val){var oRes=this.ws.workbook.oStyleManager.setStrikeout(this,val);this._setFontProp(function(format){return val!=format.getStrikeout()},function(format){format.setStrikeout(val)});if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Strikeout,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow, this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setFontAlign=function(val){var oRes=this.ws.workbook.oStyleManager.setFontAlign(this,val);this._setFontProp(function(format){return val!=format.getVerticalAlign()},function(format){format.setVerticalAlign(val)});if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_FontAlign,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol, oRes.oldVal,oRes.newVal))};Cell.prototype.setAlignVertical=function(val){var oRes=this.ws.workbook.oStyleManager.setAlignVertical(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_AlignVertical,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setAlignHorizontal=function(val){var oRes=this.ws.workbook.oStyleManager.setAlignHorizontal(this, val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_AlignHorizontal,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setFill=function(val){var oRes=this.ws.workbook.oStyleManager.setFill(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Fill,this.ws.getId(), new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setFillColor=function(val){var fill=new AscCommonExcel.Fill;fill.fromColor(val);return this.setFill(fill)};Cell.prototype.setBorder=function(val){var oRes=this.ws.workbook.oStyleManager.setBorder(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal){var oldVal=null;if(null!=oRes.oldVal)oldVal=oRes.oldVal.clone();var newVal=null;if(null!=oRes.newVal)newVal= oRes.newVal.clone();History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Border,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oldVal,newVal))}};Cell.prototype.setShrinkToFit=function(val){var oRes=this.ws.workbook.oStyleManager.setShrinkToFit(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_ShrinkToFit,this.ws.getId(),new Asc.Range(this.nCol, this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setWrap=function(val){var oRes=this.ws.workbook.oStyleManager.setWrap(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Wrap,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setAngle=function(val){var oRes= this.ws.workbook.oStyleManager.setAngle(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_Angle,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setQuotePrefix=function(val){var oRes=this.ws.workbook.oStyleManager.setQuotePrefix(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell, AscCH.historyitem_Cell_SetQuotePrefix,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setPivotButton=function(val){var oRes=this.ws.workbook.oStyleManager.setPivotButton(this,val);if(History.Is_On()&&oRes.oldVal!=oRes.newVal)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_SetPivotButton,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow, this.nCol,oRes.oldVal,oRes.newVal))};Cell.prototype.setStyle=function(xfs){var oldVal=this.xfs;this.setStyleInternal(xfs);if(History.Is_On()&&oldVal!=this.xfs)History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_SetStyle,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,oldVal,this.xfs))};Cell.prototype.setStyleInternal=function(xfs){this.xfs=g_StyleCache.addXf(xfs);this._hasChanged=true};Cell.prototype.getFormula= function(){var res="";this.processFormula(function(parsed){res=parsed.getFormula()});return res};Cell.prototype.getFormulaParsed=function(){return this.formulaParsed};Cell.prototype.getValueForEdit=function(checkFormulaArray){this._checkDirty();var res=AscCommonExcel.getStringFromMultiText(this.getValueForEdit2());return this.formulaParsed&&this.formulaParsed.ref&&checkFormulaArray?"{"+res+"}":res};Cell.prototype.getValueForEdit2=function(){this._checkDirty();var cultureInfo=AscCommon.g_oDefaultCultureInfo; var oValueText=null;var oValueArray=null;var xfs=this.getCompiledStyle();if(this.isFormula())this.processFormula(function(parsed){oValueText="="+parsed.assembleLocale(AscCommonExcel.cFormulaFunctionToLocale,true)});else if(null!=this.text||null!=this.number)if(CellValueType.Bool===this.type&&null!=this.number)oValueText=this.number==1?cBoolLocal.t:cBoolLocal.f;else{if(null!=this.text)oValueText=this.text;if(CellValueType.Number===this.type||CellValueType.String===this.type){var oNumFormat;if(null!= xfs&&null!=xfs.num)oNumFormat=oNumFormatCache.get(xfs.num.getFormat());else oNumFormat=oNumFormatCache.get(g_oDefaultFormat.Num.getFormat());if(CellValueType.String!=this.type&&null!=oNumFormat&&null!=this.number){var nValue=this.number;var oTargetFormat=oNumFormat.getFormatByValue(nValue);if(oTargetFormat)if(1==oTargetFormat.nPercent)oValueText=AscCommon.oGeneralEditFormatCache.format(nValue*100)+"%";else if(oTargetFormat.bDateTime)if(false==oTargetFormat.isInvalidDateValue(nValue)){var bDate=oTargetFormat.bDate; var bTime=oTargetFormat.bTime;if(false==bDate&&nValue>=1)bDate=true;if(false==bTime&&Math.floor(nValue)!=nValue)bTime=true;var sDateFormat="";if(bDate)sDateFormat=AscCommon.getShortDateFormat(cultureInfo);var sTimeFormat="h:mm:ss";if(cultureInfo.AMDesignator.length>0&&cultureInfo.PMDesignator.length>0)sTimeFormat+=" AM/PM";if(bDate&&bTime)oNumFormat=oNumFormatCache.get(sDateFormat+" "+sTimeFormat);else if(bTime)oNumFormat=oNumFormatCache.get(sTimeFormat);else oNumFormat=oNumFormatCache.get(sDateFormat); var aFormatedValue=oNumFormat.format(nValue,CellValueType.Number,AscCommon.gc_nMaxDigCount);oValueText="";for(var i=0,length=aFormatedValue.length;i<length;++i)oValueText+=aFormatedValue[i].text}else oValueText=AscCommon.oGeneralEditFormatCache.format(nValue);else oValueText=AscCommon.oGeneralEditFormatCache.format(nValue)}}}else if(this.multiText)oValueArray=this.multiText;if(null!=xfs&&true==xfs.QuotePrefix&&CellValueType.String==this.type&&false==this.isFormula())if(null!=oValueText)oValueText= "'"+oValueText;else if(null!=oValueArray)oValueArray=[{text:"'"}].concat(oValueArray);return this._getValue2Result(oValueText,oValueArray,true)};Cell.prototype.getValueForExample=function(numFormat,cultureInfo){var aText=this._getValue2(AscCommon.gc_nMaxDigCountView,function(){return true},numFormat,cultureInfo);return AscCommonExcel.getStringFromMultiText(aText)};Cell.prototype.getValueWithoutFormat=function(){this._checkDirty();var sResult="";if(null!=this.number)if(CellValueType.Bool===this.type)sResult= this.number==1?cBoolLocal.t:cBoolLocal.f;else sResult=this.number.toString();else if(null!=this.text)sResult=this.text;else if(null!=this.multiText)sResult=AscCommonExcel.getStringFromMultiText(this.multiText);return sResult};Cell.prototype.getValue=function(){this._checkDirty();var aTextValue2=this.getValue2(AscCommon.gc_nMaxDigCountView,function(){return true});return AscCommonExcel.getStringFromMultiText(aTextValue2)};Cell.prototype.getValueSkipToSpace=function(){this._checkDirty();var aTextValue2= this.getValue2(AscCommon.gc_nMaxDigCountView,function(){return true});return AscCommonExcel.getStringFromMultiTextSkipToSpace(aTextValue2)};Cell.prototype.getValue2=function(dDigitsCount,fIsFitMeasurer){this._checkDirty();if(null==fIsFitMeasurer)fIsFitMeasurer=function(aText){return true};if(null==dDigitsCount)dDigitsCount=AscCommon.gc_nMaxDigCountView;return this._getValue2(dDigitsCount,fIsFitMeasurer)};Cell.prototype.getNumberValue=function(){this._checkDirty();return this.number};Cell.prototype.getBoolValue= function(){this._checkDirty();return this.number==1};Cell.prototype.getErrorValue=function(){this._checkDirty();return AscCommonExcel.cError.prototype.getErrorTypeFromString(this.text)};Cell.prototype.getValueText=function(){this._checkDirty();return this.text};Cell.prototype.getTextIndex=function(){if(null===this.textIndex){var wb=this.ws.workbook;if(null!=this.text)this.textIndex=wb.sharedStrings.addText(this.text);else if(null!=this.multiText)this.textIndex=wb.sharedStrings.addMultiText(this.multiText)}return this.textIndex}; Cell.prototype.getValueMultiText=function(){this._checkDirty();return this.multiText};Cell.prototype.getNumFormatStr=function(){if(null!=this.xfs&&null!=this.xfs.num)return this.xfs.num.getFormat();return g_oDefaultFormat.Num.getFormat()};Cell.prototype.getNumFormat=function(){return oNumFormatCache.get(this.getNumFormatStr())};Cell.prototype.getNumFormatType=function(){return this.getNumFormat().getType()};Cell.prototype.getOffset=function(cell){return this.getOffset3(cell.nCol+1,cell.nRow+1)};Cell.prototype.getOffset2= function(cellId){var cAddr2=new CellAddress(cellId);return this.getOffset3(cAddr2.col,cAddr2.row)};Cell.prototype.getOffset3=function(col,row){return new AscCommon.CellBase(this.nRow-row+1,this.nCol-col+1)};Cell.prototype.getValueData=function(){this._checkDirty();var formula=this.isFormula()?this.getFormula():null;var formulaRef;if(formula){var parser=this.getFormulaParsed();if(parser)formulaRef=this.getFormulaParsed().getArrayFormulaRef()}return new UndoRedoData_CellValueData(formula,new AscCommonExcel.CCellValue(this), formulaRef)};Cell.prototype.setValueData=function(Val){if(null!=Val.formula)this.setFormula(Val.formula,null,Val.formulaRef);else if(null!=Val.value){var DataOld=null;var DataNew=null;if(History.Is_On())DataOld=this.getValueData();this.setFormulaInternal(null);this._setValueData(Val.value);this.ws.workbook.dependencyFormulas.addToChangedCell(this);this.ws.workbook.sortDependency();if(History.Is_On()){DataNew=this.getValueData();if(false==DataOld.isEqual(DataNew))History.Add(AscCommonExcel.g_oUndoRedoCell, AscCH.historyitem_Cell_ChangeValue,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,DataOld,DataNew))}}else this.setValue("")};Cell.prototype._checkDirty=function(){var t=this;if(this.getIsDirty())if(g_cCalcRecursion.incLevel()){var isCalc=this.getIsCalc();this.setIsCalc(true);var calculatedArrayFormulas=[];this.processFormula(function(parsed){if(!isCalc)if(parsed.getArrayFormulaRef()){var listenerId=parsed.getListenerId(); if(parsed.checkFirstCellArray(t)&&!calculatedArrayFormulas[listenerId]){parsed.calculate();calculatedArrayFormulas[listenerId]=1}else{if(null===parsed.value&&!calculatedArrayFormulas[listenerId]){parsed.calculate();calculatedArrayFormulas[listenerId]=1}var oldParent=parsed.parent;parsed.parent=new AscCommonExcel.CCellWithFormula(t.ws,t.nRow,t.nCol);parsed._endCalculate();parsed.parent=oldParent}}else parsed.calculate();else parsed.calculateCycleError()});g_cCalcRecursion.decLevel();if(g_cCalcRecursion.getIsForceBacktracking()){g_cCalcRecursion.insert({ws:this.ws, nRow:this.nRow,nCol:this.nCol});if(0===g_cCalcRecursion.getLevel()&&!g_cCalcRecursion.getIsProcessRecursion()){g_cCalcRecursion.setIsProcessRecursion(true);do{g_cCalcRecursion.setIsForceBacktracking(false);g_cCalcRecursion.foreachInReverse(function(elem){elem.ws._getCellNoEmpty(elem.nRow,elem.nCol,function(cell){if(cell&&cell.getIsDirty()){cell.setIsCalc(false);cell._checkDirty()}})})}while(g_cCalcRecursion.getIsForceBacktracking());g_cCalcRecursion.setIsProcessRecursion(false)}}else{this.setIsCalc(false); this.setIsDirty(false)}}};Cell.prototype.getFont=function(){var xfs=this.getCompiledStyle();if(null!=xfs&&null!=xfs.font)return xfs.font;return g_oDefaultFormat.Font};Cell.prototype.getFillColor=function(){return this.getFill().bg()};Cell.prototype.getFill=function(){var xfs=this.getCompiledStyle();if(null!=xfs&&null!=xfs.fill)return xfs.fill;return g_oDefaultFormat.Fill};Cell.prototype.getBorderSrc=function(){var xfs=this.getCompiledStyle();if(null!=xfs&&null!=xfs.border)return xfs.border;return g_oDefaultFormat.Border}; Cell.prototype.getBorder=function(){return this.getBorderSrc()};Cell.prototype.getAlign=function(){var xfs=this.getCompiledStyle();if(null!=xfs&&null!=xfs.align)return xfs.align;return g_oDefaultFormat.Align};Cell.prototype._adjustCellFormat=function(){var t=this;this.processFormula(function(parsed){var valueCalc=parsed.value;if(valueCalc)if(0<=valueCalc.numFormat){if(aStandartNumFormatsId[t.getNumFormatStr()]==0)t.setNum(new AscCommonExcel.Num({id:valueCalc.numFormat}))}else if(AscCommonExcel.cNumFormatFirstCell=== valueCalc.numFormat){var r=parsed.getFirstRange();if(r&&r.getNumFormatStr){var sCurFormat=t.getNumFormatStr();if(g_oDefaultFormat.Num.getFormat()==sCurFormat){var sNewFormat=r.getNumFormatStr();if(sCurFormat!=sNewFormat)t.setNumFormat(sNewFormat)}}}})};Cell.prototype._updateCellValue=function(){if(!this.isFormula())return;var parsed=this.getFormulaParsed();var res=parsed.simplifyRefType(parsed.value,this.ws,this.nRow,this.nCol);if(res){this.cleanText();switch(res.type){case cElementType.number:this.setTypeInternal(CellValueType.Number); this.setValueNumberInternal(res.getValue());break;case cElementType.bool:this.setTypeInternal(CellValueType.Bool);this.setValueNumberInternal(res.value?1:0);break;case cElementType.error:this.setTypeInternal(CellValueType.Error);this.setValueTextInternal(res.getValue().toString());break;case cElementType.name:this.setTypeInternal(CellValueType.Error);this.setValueTextInternal(res.getValue().toString());break;case cElementType.empty:this.setTypeInternal(CellValueType.Number);this.setValueNumberInternal(res.getValue()); break;default:this.setTypeInternal(CellValueType.String);this.setValueTextInternal(res.getValue().toString())}var isArray=parsed.getArrayFormulaRef();var firstArrayRef=parsed.checkFirstCellArray(this);if(res.getHyperlink&&null!==res.getHyperlink()&&(!isArray||isArray&&firstArrayRef)){var oHyperlinkFont=new AscCommonExcel.Font;oHyperlinkFont.setName(this.ws.workbook.getDefaultFont());oHyperlinkFont.setSize(this.ws.workbook.getDefaultSize());oHyperlinkFont.setUnderline(Asc.EUnderline.underlineSingle); oHyperlinkFont.setColor(AscCommonExcel.g_oColorManager.getThemeColor(AscCommonExcel.g_nColorHyperlink));AscFormat.ExecuteNoHistory(function(){this.setFont(oHyperlinkFont)},this,[])}this.ws.workbook.dependencyFormulas.addToCleanCellCache(this.ws.getId(),this.nRow,this.nCol);AscCommonExcel.g_oVLOOKUPCache.remove(this);AscCommonExcel.g_oHLOOKUPCache.remove(this);AscCommonExcel.g_oMatchCache.remove(this);AscCommonExcel.g_oSUMIFSCache.remove(this)}};Cell.prototype.cleanText=function(){this.number=null; this.text=null;this.multiText=null;this.textIndex=null;this.type=CellValueType.Number;this._hasChanged=true};Cell.prototype._BuildDependencies=function(parse,opt_dirty){var parsed=this.getFormulaParsed();if(parsed){if(parse)parsed.parse();parsed.buildDependencies();if(opt_dirty||parsed.ca||this.isNullTextString())this.ws.workbook.dependencyFormulas.addToChangedCell(this)}};Cell.prototype._setValueData=function(val){this.number=val.number;this.text=val.text;this.multiText=val.multiText;this.textIndex= null;this.type=val.type;this._hasChanged=true};Cell.prototype._getValue2=function(dDigitsCount,fIsFitMeasurer,opt_numFormat,opt_cultureInfo){var aRes=null;var bNeedMeasure=true;var sText=null;var aText=null;var isMultyText=false;if(CellValueType.Number==this.type||CellValueType.String==this.type){if(null!=this.text)sText=this.text;else if(null!=this.multiText){aText=this.multiText;isMultyText=true}if(CellValueType.String==this.type)bNeedMeasure=false;var oNumFormat;if(opt_numFormat)oNumFormat=opt_numFormat; else{var xfs=this.getCompiledStyle();if(null!=xfs&&null!=xfs.num)oNumFormat=oNumFormatCache.get(xfs.num.getFormat());else oNumFormat=oNumFormatCache.get(g_oDefaultFormat.Num.getFormat())}if(false==oNumFormat.isGeneralFormat())if(null!=this.number){aText=oNumFormat.format(this.number,this.type,dDigitsCount,false,opt_cultureInfo);isMultyText=false;sText=null}else{if(CellValueType.String==this.type){var oTextFormat=oNumFormat.getTextFormat();if(null!=oTextFormat&&"@"!=oTextFormat.formatString)if(null!= this.text){aText=oNumFormat.format(this.text,this.type,dDigitsCount,false,opt_cultureInfo);isMultyText=false;sText=null}else if(null!=this.multiText){var sSimpleString=AscCommonExcel.getStringFromMultiText(this.multiText);aText=oNumFormat.format(sSimpleString,this.type,dDigitsCount,false,opt_cultureInfo);isMultyText=false;sText=null}}}else if(CellValueType.Number==this.type&&null!=this.number){bNeedMeasure=false;var bFindResult=false;var nTempDigCount=Math.ceil(dDigitsCount);var sOriginText=this.number; while(nTempDigCount>=1){var sGeneral=AscCommon.DecodeGeneralFormat(sOriginText,this.type,nTempDigCount);if(null!=sGeneral)oNumFormat=oNumFormatCache.get(sGeneral);if(null!=oNumFormat){sText=null;isMultyText=false;aText=oNumFormat.format(sOriginText,this.type,dDigitsCount,false,opt_cultureInfo);if(true==oNumFormat.isTextFormat())break;else{aRes=this._getValue2Result(sText,aText,isMultyText);if(true==fIsFitMeasurer(aRes)){bFindResult=true;break}aRes=null}}nTempDigCount--}if(false==bFindResult){aRes= null;sText=null;isMultyText=false;var font=new AscCommonExcel.Font;if(dDigitsCount>1){font.setRepeat(true);aText=[{text:"#",format:font}]}else aText=[{text:"",format:font}]}}}else if(CellValueType.Bool===this.type){if(null!=this.number)sText=0!=this.number?cBoolLocal.t:cBoolLocal.f}else if(CellValueType.Error===this.type)if(null!=this.text)sText=this._getValueTypeError(this.text);if(bNeedMeasure){aRes=this._getValue2Result(sText,aText,isMultyText);if(false==fIsFitMeasurer(aRes)){aRes=null;sText=null; isMultyText=false;var font=new AscCommonExcel.Font;font.setRepeat(true);aText=[{text:"#",format:font}]}}if(null==aRes)aRes=this._getValue2Result(sText,aText,isMultyText);return aRes};Cell.prototype._setValue=function(val){this.cleanText();function checkCellValueTypeError(sUpText){switch(sUpText){case cErrorLocal["nil"]:return cErrorOrigin["nil"];break;case cErrorLocal["div"]:return cErrorOrigin["div"];break;case cErrorLocal["value"]:return cErrorOrigin["value"];break;case cErrorLocal["ref"]:return cErrorOrigin["ref"]; break;case cErrorLocal["name"]:case cErrorLocal["name"].replace("\\",""):return cErrorOrigin["name"];break;case cErrorLocal["num"]:return cErrorOrigin["num"];break;case cErrorLocal["na"]:return cErrorOrigin["na"];break;case cErrorLocal["getdata"]:return cErrorOrigin["getdata"];break;case cErrorLocal["uf"]:return cErrorOrigin["uf"];break}return false}if(""==val)return;var oNumFormat;var xfs=this.getCompiledStyle();if(null!=xfs&&null!=xfs.num)oNumFormat=oNumFormatCache.get(xfs.num.getFormat());else oNumFormat= oNumFormatCache.get(g_oDefaultFormat.Num.getFormat());if(oNumFormat.isTextFormat()){this.setTypeInternal(CellValueType.String);this.setValueTextInternal(val)}else if(AscCommon.g_oFormatParser.isLocaleNumber(val)){this.setTypeInternal(CellValueType.Number);this.setValueNumberInternal(AscCommon.g_oFormatParser.parseLocaleNumber(val))}else{var sUpText=val.toUpperCase();if(cBoolLocal.t===sUpText||cBoolLocal.f===sUpText){this.setTypeInternal(CellValueType.Bool);this.setValueNumberInternal(cBoolLocal.t=== sUpText?1:0)}else if(checkCellValueTypeError(sUpText)){this.setTypeInternal(CellValueType.Error);this.setValueTextInternal(checkCellValueTypeError(sUpText))}else{var res=AscCommon.g_oFormatParser.parse(val);if(null!=res){var nFormatType=oNumFormat.getType();if(!(c_oAscNumFormatType.Percent==nFormatType&&res.bPercent||c_oAscNumFormatType.Currency==nFormatType&&res.bCurrency||c_oAscNumFormatType.Date==nFormatType&&res.bDate||c_oAscNumFormatType.Time==nFormatType&&res.bTime)&&res.format!=oNumFormat.sFormat)this.setNumFormat(res.format); this.setTypeInternal(CellValueType.Number);this.setValueNumberInternal(res.value)}else{this.setTypeInternal(CellValueType.String);if(val.length>0&&"'"==val[0]){this.setQuotePrefix(true);val=val.substring(1)}this.setValueTextInternal(val)}}}};Cell.prototype._autoformatHyperlink=function(val){if(/(^(((http|https|ftp):\/\/)|(mailto:)|(www.)))|@/i.test(val)){val=val.replace(/\s+$/,"");var typeHyp=AscCommon.getUrlType(val);if(AscCommon.c_oAscUrlType.Invalid!=typeHyp){val=AscCommon.prepareUrl(val,typeHyp); var oNewHyperlink=new AscCommonExcel.Hyperlink;oNewHyperlink.Ref=this.ws.getCell3(this.nRow,this.nCol);oNewHyperlink.Hyperlink=val;oNewHyperlink.Ref.setHyperlink(oNewHyperlink)}}};Cell.prototype._setValue2=function(aVal,ignoreHyperlink){var sSimpleText="";for(var i=0,length=aVal.length;i<length;++i)sSimpleText+=aVal[i].text;this._setValue(sSimpleText);if(!ignoreHyperlink)this._autoformatHyperlink(sSimpleText);var nRow=this.nRow;var nCol=this.nCol;if(CellValueType.String==this.type&&null==this.ws.hyperlinkManager.getByCell(nRow, nCol)){this.cleanText();this.setTypeInternal(CellValueType.String);if(aVal.length>0){this.multiText=[];for(var i=0,length=aVal.length;i<length;i++){var item=aVal[i];var oNewElem=new AscCommonExcel.CMultiTextElem;oNewElem.text=item.text;if(null!=item.format){oNewElem.format=new AscCommonExcel.Font;oNewElem.format.assign(item.format)}this.multiText.push(oNewElem)}this._minimizeMultiText(true)}if(null!=this.text){if(this.text.length>0&&"'"==this.text[0]){this.setQuotePrefix(true);this.setValueTextInternal(this.text.substring(1))}}else if(null!= this.multiText)if(this.multiText.length>0){var oFirstItem=this.multiText[0];if(null!=oFirstItem.text&&oFirstItem.text.length>0&&"'"==oFirstItem.text[0]){this.setQuotePrefix(true);if(1!=oFirstItem.text.length)oFirstItem.text=oFirstItem.text.substring(1);else{this.multiText.shift();if(0==this.multiText.length)this.setValueTextInternal("")}}}}};Cell.prototype._setFontProp=function(fCheck,fAction){var bRes=false;if(null!=this.multiText){var bChange=false;for(var i=0,length=this.multiText.length;i<length;++i){var elem= this.multiText[i];if(null!=elem.format&&true==fCheck(elem.format)){bChange=true;break}}if(bChange){var backupObj=this.getValueData();for(var i=0,length=this.multiText.length;i<length;++i){var elem=this.multiText[i];if(null!=elem.format)fAction(elem.format)}if(this._minimizeMultiText(false)){var DataNew=this.getValueData();History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_ChangeValue,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow, this.nCol,backupObj,DataNew))}else{var DataNew=this._cloneMultiText();History.Add(AscCommonExcel.g_oUndoRedoCell,AscCH.historyitem_Cell_ChangeArrayValueFormat,this.ws.getId(),new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow),new UndoRedoData_CellSimpleData(this.nRow,this.nCol,backupObj.value.multiText,DataNew))}}bRes=true}return bRes};Cell.prototype._getValue2Result=function(sText,aText,isMultyText){var aResult=[];if(null==sText&&null==aText)sText="";var oNewItem,cellfont;var xfs=this.getCompiledStyle(); if(null!=xfs&&null!=xfs.font)cellfont=xfs.font;else cellfont=g_oDefaultFormat.Font;if(null!=sText){oNewItem=new AscCommonExcel.Fragment;oNewItem.text=sText;oNewItem.format=cellfont.clone();oNewItem.checkVisitedHyperlink(this.nRow,this.nCol,this.ws.hyperlinkManager);oNewItem.format.setSkip(false);oNewItem.format.setRepeat(false);aResult.push(oNewItem)}else if(null!=aText)for(var i=0;i<aText.length;i++){oNewItem=new AscCommonExcel.Fragment;var oCurtext=aText[i];if(null!=oCurtext.text){oNewItem.text= oCurtext.text;var oCurFormat=new AscCommonExcel.Font;if(isMultyText)if(null!=oCurtext.format)oCurFormat.assign(oCurtext.format);else{oCurFormat.assign(cellfont);oCurFormat.setSkip(false);oCurFormat.setRepeat(false)}else{oCurFormat.assign(cellfont);oCurFormat.setSkip(false);oCurFormat.setRepeat(false);if(null!=oCurtext.format)oCurFormat.assignFromObject(oCurtext.format)}oNewItem.format=oCurFormat;oNewItem.checkVisitedHyperlink(this.nRow,this.nCol,this.ws.hyperlinkManager);aResult.push(oNewItem)}}return aResult}; Cell.prototype._getValueTypeError=function(text){switch(text){case cErrorOrigin["nil"]:return cErrorLocal["nil"];break;case cErrorOrigin["div"]:return cErrorLocal["div"];break;case cErrorOrigin["value"]:return cErrorLocal["value"];break;case cErrorOrigin["ref"]:return cErrorLocal["ref"];break;case cErrorOrigin["name"]:return cErrorLocal["name"].replace("\\","");break;case cErrorOrigin["num"]:return cErrorLocal["num"];break;case cErrorOrigin["na"]:return cErrorLocal["na"];break;case cErrorOrigin["getdata"]:return cErrorLocal["getdata"]; break;case cErrorOrigin["uf"]:return cErrorLocal["uf"];break}return cErrorLocal["nil"]};Cell.prototype._minimizeMultiText=function(bSetCellFont){var bRes=false;if(null!=this.multiText&&this.multiText.length>0){var cellFont=this.getFont();var oIntersectFont=null;for(var i=0,length=this.multiText.length;i<length;i++){var elem=this.multiText[i];if(null!=elem.format){if(null==oIntersectFont)oIntersectFont=elem.format.clone();oIntersectFont.intersect(elem.format,cellFont)}else{oIntersectFont=cellFont; break}}if(bSetCellFont)if(oIntersectFont.isEqual(g_oDefaultFormat.Font))this.setFont(null,false);else this.setFont(oIntersectFont,false);var bIsEqual=true;for(var i=0,length=this.multiText.length;i<length;i++){var elem=this.multiText[i];if(null!=elem.format&&false==oIntersectFont.isEqual(elem.format)){bIsEqual=false;break}}if(bIsEqual){this.setValueTextInternal(AscCommonExcel.getStringFromMultiText(this.multiText));bRes=true}}return bRes};Cell.prototype._cloneMultiText=function(){var oRes=[];for(var i= 0,length=this.multiText.length;i<length;++i)oRes.push(this.multiText[i].clone());return oRes};Cell.prototype.getIsDirty=function(){return this.isDirty};Cell.prototype.setIsDirty=function(val){this.isDirty=val;this._hasChanged=true};Cell.prototype.getIsCalc=function(){return this.isCalc};Cell.prototype.setIsCalc=function(val){this.isCalc=val;this._hasChanged=true};Cell.prototype.fromXLSB=function(stream,type,row,aCellXfs,aSharedStrings,tmp,formula){var end=stream.XlsbReadRecordLength()+stream.GetCurPos(); this.setRowCol(row,stream.GetULongLE()&16383);var nStyleRef=stream.GetULongLE();if(0!==(nStyleRef&16777215)){var xf=aCellXfs[nStyleRef&1048575];if(xf)this.setStyle(xf)}if(AscCommonExcel.XLSB.rt_CELL_REAL===type||AscCommonExcel.XLSB.rt_FMLA_NUM===type){this.setTypeInternal(CellValueType.Number);this.setValueNumberInternal(stream.GetDoubleLE())}else if(AscCommonExcel.XLSB.rt_CELL_ISST===type){this.setTypeInternal(CellValueType.String);var ss=aSharedStrings[stream.GetULongLE()];if(undefined!==ss)if(typeof ss=== "string")this.setValueTextInternal(ss);else this.setValueMultiTextInternal(ss)}else if(AscCommonExcel.XLSB.rt_CELL_ST===type||AscCommonExcel.XLSB.rt_FMLA_STRING===type){this.setTypeInternal(CellValueType.String);this.setValueTextInternal(stream.GetString())}else if(AscCommonExcel.XLSB.rt_CELL_ERROR===type||AscCommonExcel.XLSB.rt_FMLA_ERROR===type){this.setTypeInternal(CellValueType.Error);switch(stream.GetByte()){case 0:this.setValueTextInternal("#NULL!");break;case 7:this.setValueTextInternal("#DIV/0!"); break;case 15:this.setValueTextInternal("#VALUE!");break;case 23:this.setValueTextInternal("#REF!");break;case 29:this.setValueTextInternal("#NAME?");break;case 36:this.setValueTextInternal("#NUM!");break;case 42:this.setValueTextInternal("#N/A");break;case 43:this.setValueTextInternal("#GETTING_DATA");break}}else if(AscCommonExcel.XLSB.rt_CELL_BOOL===type||AscCommonExcel.XLSB.rt_FMLA_BOOL===type){this.setTypeInternal(CellValueType.Bool);this.setValueNumberInternal(stream.GetByte())}else this.setTypeInternal(CellValueType.Number); if(AscCommonExcel.XLSB.rt_FMLA_STRING<=type&&type<=AscCommonExcel.XLSB.rt_FMLA_ERROR)this.fromXLSBFormula(stream,tmp.formula);var flags=stream.GetUShortLE();if(0!==(flags&4)){this.fromXLSBFormulaExt(stream,tmp.formula,flags);if(0!==(flags&16384)){this.setTypeInternal(CellValueType.Number);this.setValueNumberInternal(null)}}if(0!==(flags&8192)){this.setTypeInternal(CellValueType.String);this.setValueMultiTextInternal(this.fromXLSBRichText(stream))}stream.Seek2(end)};Cell.prototype.fromXLSBFormula= function(stream,formula){var flags=stream.GetUChar();stream.Skip2(9);if(0!==(flags&2))formula.ca=true};Cell.prototype.fromXLSBFormulaExt=function(stream,formula,flags){formula.t=flags&3;formula.v=stream.GetString();if(0!==(flags&8))formula.aca=true;if(0!==(flags&16))formula.bx=true;if(0!==(flags&32))formula.del1=true;if(0!==(flags&64))formula.del2=true;if(0!==(flags&128))formula.dt2d=true;if(0!==(flags&256))formula.dtr=true;if(0!==(flags&512))formula.r1=stream.GetString();if(0!==(flags&1024))formula.r2= stream.GetString();if(0!==(flags&2048))formula.ref=stream.GetString();if(0!==(flags&4096))formula.si=stream.GetULongLE()};Cell.prototype.fromXLSBRichText=function(stream){var res=[];var count=stream.GetULongLE();while(count-- >0){var typeRun=stream.GetUChar();var run;if(1===typeRun){run=new AscCommonExcel.CMultiTextElem;run.text="";if(stream.GetBool()){run.format=new AscCommonExcel.Font;run.format.fromXLSB(stream);run.format.checkSchemeFont(this.ws.workbook.theme)}var textCount=stream.GetULongLE(); while(textCount-- >0)run.text+=stream.GetString();res.push(run)}else if(2===typeRun){run=new AscCommonExcel.CMultiTextElem;run.text=stream.GetString();res.push(run)}}return res};Cell.prototype.toXLSB=function(stream,nXfsId,formulaToWrite,oSharedStrings){var len=4+4+2;var type=AscCommonExcel.XLSB.rt_CELL_BLANK;if(formulaToWrite)len+=this.getXLSBSizeFormula(formulaToWrite);var textToWrite;var isBlankFormula=false;if(formulaToWrite)if(!this.isNullTextString())switch(this.type){case CellValueType.Number:type= AscCommonExcel.XLSB.rt_FMLA_NUM;len+=8;break;case CellValueType.String:type=AscCommonExcel.XLSB.rt_FMLA_STRING;textToWrite=this.text?this.text:AscCommonExcel.getStringFromMultiText(this.multiText);len+=4+2*textToWrite.length;break;case CellValueType.Error:type=AscCommonExcel.XLSB.rt_FMLA_ERROR;len+=1;break;case CellValueType.Bool:type=AscCommonExcel.XLSB.rt_FMLA_BOOL;len+=1;break}else{type=AscCommonExcel.XLSB.rt_FMLA_STRING;textToWrite="";len+=4+2*textToWrite.length;isBlankFormula=true}else if(!this.isNullTextString())switch(this.type){case CellValueType.Number:type= AscCommonExcel.XLSB.rt_CELL_REAL;len+=8;break;case CellValueType.String:type=AscCommonExcel.XLSB.rt_CELL_ISST;len+=4;break;case CellValueType.Error:type=AscCommonExcel.XLSB.rt_CELL_ERROR;len+=1;break;case CellValueType.Bool:type=AscCommonExcel.XLSB.rt_CELL_BOOL;len+=1;break}stream.XlsbStartRecord(type,len);stream.WriteULong(this.nCol&16383);var nStyle=0;if(null!==nXfsId)nStyle=nXfsId;stream.WriteULong(nStyle);switch(type){case AscCommonExcel.XLSB.rt_CELL_REAL:case AscCommonExcel.XLSB.rt_FMLA_NUM:stream.WriteDouble2(this.number); break;case AscCommonExcel.XLSB.rt_CELL_ISST:var index;var textIndex=this.getTextIndex();if(null!==textIndex){index=oSharedStrings.strings[textIndex];if(undefined===index){index=oSharedStrings.index++;oSharedStrings.strings[textIndex]=index}}stream.WriteULong(index);break;case AscCommonExcel.XLSB.rt_CELL_ST:case AscCommonExcel.XLSB.rt_FMLA_STRING:stream.WriteString4(textToWrite);break;case AscCommonExcel.XLSB.rt_CELL_ERROR:case AscCommonExcel.XLSB.rt_FMLA_ERROR:if("#NULL!"==this.text)stream.WriteByte(0); else if("#DIV/0!"==this.text)stream.WriteByte(7);else if("#VALUE!"==this.text)stream.WriteByte(15);else if("#REF!"==this.text)stream.WriteByte(23);else if("#NAME?"==this.text)stream.WriteByte(29);else if("#NUM!"==this.text)stream.WriteByte(36);else if("#N/A"==this.text)stream.WriteByte(42);else stream.WriteByte(43);break;case AscCommonExcel.XLSB.rt_CELL_BOOL:case AscCommonExcel.XLSB.rt_FMLA_BOOL:stream.WriteByte(this.number);break}var flags=0;if(formulaToWrite)flags=this.toXLSBFormula(stream,formulaToWrite, isBlankFormula);stream.WriteUShort(flags);if(formulaToWrite)flags=this.toXLSBFormulaExt(stream,formulaToWrite);stream.XlsbEndRecord()};Cell.prototype.getXLSBSizeFormula=function(formulaToWrite){var len=2+4+4;if(formulaToWrite.formula)len+=4+2*formulaToWrite.formula.length;else len+=4;if(undefined!==formulaToWrite.ref)len+=4+2*formulaToWrite.ref.getName().length;if(undefined!==formulaToWrite.si)len+=4;return len};Cell.prototype.toXLSBFormula=function(stream,formulaToWrite,isBlankFormula){var flags= 0;if(formulaToWrite.ca)flags|=2;stream.WriteUShort(flags);stream.WriteULong(0);stream.WriteULong(0);var flagsExt=0;if(undefined!==formulaToWrite.type)flagsExt|=formulaToWrite.type;else flagsExt|=Asc.ECellFormulaType.cellformulatypeNormal;flagsExt|=4;if(undefined!==formulaToWrite.ref)flagsExt|=2048;if(undefined!==formulaToWrite.si)flagsExt|=4096;if(isBlankFormula)flagsExt|=16384;return flagsExt};Cell.prototype.toXLSBFormulaExt=function(stream,formulaToWrite){if(undefined!==formulaToWrite.formula)stream.WriteString4(formulaToWrite.formula); else stream.WriteString4("");if(undefined!==formulaToWrite.ref)stream.WriteString4(formulaToWrite.ref.getName());if(undefined!==formulaToWrite.si)stream.WriteULong(formulaToWrite.si)};function CCellWithFormula(ws,row,col){this.ws=ws;this.nRow=row;this.nCol=col}CCellWithFormula.prototype.onFormulaEvent=function(type,eventData){if(AscCommon.c_oNotifyParentType.GetRangeCell===type)return new Asc.Range(this.nCol,this.nRow,this.nCol,this.nRow);else if(AscCommon.c_oNotifyParentType.Change===type)this._onChange(eventData); else if(AscCommon.c_oNotifyParentType.ChangeFormula===type)this._onChangeFormula(eventData);else if(AscCommon.c_oNotifyParentType.EndCalculate===type)this.ws._getCell(this.nRow,this.nCol,function(cell){cell._updateCellValue()});else if(AscCommon.c_oNotifyParentType.Shared===type)return this._onShared(eventData)};CCellWithFormula.prototype._onChange=function(eventData){var areaData=eventData.notifyData.areaData;var shared=eventData.formula.getShared();var arrayF=eventData.formula.getArrayFormulaRef(); var dependencyFormulas=this.ws.workbook.dependencyFormulas;if(shared)if(areaData){var bbox=areaData.bbox;var changedRange=bbox.getSharedIntersect(shared.ref,areaData.changedBBox);dependencyFormulas.addToChangedRange2(this.ws.getId(),changedRange)}else dependencyFormulas.addToChangedRange2(this.ws.getId(),shared.ref);else if(arrayF)dependencyFormulas.addToChangedRange2(this.ws.getId(),arrayF);else this.ws.workbook.dependencyFormulas.addToChangedCell(this)};CCellWithFormula.prototype._onChangeFormula= function(eventData){var t=this;var wb=this.ws.workbook;var parsed=eventData.formula;var shared=parsed.getShared();if(shared){var index=wb.workbookFormulas.add(parsed).getIndexNumber();History.Add(AscCommonExcel.g_oUndoRedoSharedFormula,AscCH.historyitem_SharedFormula_ChangeFormula,null,null,new UndoRedoData_IndexSimpleProp(index,false,parsed.getFormulaRaw(),eventData.assemble),true);wb.dependencyFormulas.addToChangedRange2(this.ws.getId(),shared.ref)}else this.ws._getCell(this.nRow,this.nCol,function(cell){if(parsed=== cell.formulaParsed)cell.setFormulaTemplate(true,function(cell){cell.formulaParsed.setFormulaString(eventData.assemble);wb.dependencyFormulas.addToChangedCell(cell)})})};CCellWithFormula.prototype._onShared=function(eventData){var res=false;var data=eventData.notifyData;var parsed=eventData.formula;var forceTransform=false;var sharedShift;var ranges;var i;var shared=parsed.getShared();if(shared){if(c_oNotifyType.Shift===data.type){var bHor=0!==data.offset.col;var toDelete=data.offset.col<0||data.offset.row< 0;var bboxShift=AscCommonExcel.shiftGetBBox(data.bbox,bHor);sharedShift=parsed.getSharedIntersect(data.sheetId,bboxShift);if(sharedShift){var sharedIntersect;if(parsed.canShiftShared(bHor)&&(sharedIntersect=bboxShift.intersectionSimple(shared.ref))){ranges=sharedIntersect.difference(sharedShift);ranges=ranges.concat(sharedShift.difference(sharedIntersect));var cantBeShared;var diff=bboxShift.difference(new Asc.Range(0,0,gc_nMaxCol0,gc_nMaxRow0));if(toDelete)diff.push(data.bbox);for(i=0;i<diff.length;++i){var elem= parsed.getSharedIntersect(data.sheetId,diff[i]);if(elem)if(cantBeShared)cantBeShared.union2(elem);else cantBeShared=elem}if(cantBeShared){var intersection=sharedIntersect.intersectionSimple(cantBeShared);if(intersection)ranges.push(intersection)}forceTransform=true;data.shiftedShared[parsed.getListenerId()]=c_oSharedShiftType.PreProcessed}else ranges=[sharedShift]}res=true}else if(c_oNotifyType.Move===data.type||c_oNotifyType.Delete===data.type){sharedShift=parsed.getSharedIntersect(data.sheetId, data.bbox);if(sharedShift)ranges=[sharedShift];res=true}else if(AscCommon.c_oNotifyType.ChangeDefName===data.type&&data.bConvertTableFormulaToRef){this._processShared(shared,shared.ref,data,parsed,true,function(newFormula){return newFormula.processNotify(data)});res=true}if(ranges)for(i=0;i<ranges.length;++i)this._processShared(shared,ranges[i],data,parsed,forceTransform,function(newFormula){return newFormula.shiftCells(data.type,data.sheetId,data.bbox,data.offset,data.sheetIdTo)})}return res};CCellWithFormula.prototype._processShared= function(shared,ref,data,parsed,forceTransform,action){var t=this;var cellWithFormula;var cellOffset=new AscCommon.CellBase;var newFormula;this.ws.getRange3(ref.r1,ref.c1,ref.r2,ref.c2)._foreachNoEmpty(function(cell){if(parsed===cell.getFormulaParsed()){if(!cellWithFormula){cellWithFormula=new AscCommonExcel.CCellWithFormula(cell.ws,cell.nRow,cell.nCol);newFormula=parsed.clone(undefined,cellWithFormula);newFormula.removeShared();cellOffset.row=cell.nRow-shared.base.nRow;cellOffset.col=cell.nCol-shared.base.nCol}else{cellOffset.row= cell.nRow-cellWithFormula.nRow;cellOffset.col=cell.nCol-cellWithFormula.nCol;cellWithFormula.nRow=cell.nRow;cellWithFormula.nCol=cell.nCol}newFormula.changeOffset(cellOffset,false);if(action(newFormula)||forceTransform){cellWithFormula=undefined;newFormula.setFormulaString(newFormula.assemble(true));cell.setFormulaTemplate(true,function(cell){cell.setFormulaInternal(newFormula);newFormula.buildDependencies()})}t.ws.workbook.dependencyFormulas.addToChangedCell(cell)}})};function CellTypeAndValue(type, v){this.type=type;this.v=v}CellTypeAndValue.prototype.valueOf=function(){return this.v};function ignoreFirstRowSort(worksheet,bbox){var res=false;var oldExcludeVal=worksheet.bExcludeHiddenRows;worksheet.bExcludeHiddenRows=false;if(bbox.r1<bbox.r2){var rowFirst=worksheet.getRange3(bbox.r1,bbox.c1,bbox.r1,bbox.c2);var rowSecond=worksheet.getRange3(bbox.r1+1,bbox.c1,bbox.r1+1,bbox.c2);var typesFirst=[];var typesSecond=[];rowFirst._setPropertyNoEmpty(null,null,function(cell,row,col){if(cell&&!cell.isNullTextString())typesFirst.push({col:col, type:cell.getType()})});rowSecond._setPropertyNoEmpty(null,null,function(cell,row,col){if(cell&&!cell.isNullTextString())typesSecond.push({col:col,type:cell.getType()})});var indexFirst=0;var indexSecond=0;while(indexFirst<typesFirst.length&&indexSecond<typesSecond.length){var curFirst=typesFirst[indexFirst];var curSecond=typesSecond[indexSecond];if(curFirst.col<curSecond.col)indexFirst++;else if(curFirst.col>curSecond.col)indexSecond++;else{if(curFirst.type!=curSecond.type){res=true;break}indexFirst++; indexSecond++}}}worksheet.bExcludeHiddenRows=oldExcludeVal;return res}function Range(worksheet,r1,c1,r2,c2){this.worksheet=worksheet;this.bbox=new Asc.Range(c1,r1,c2,r2)}Range.prototype.createFromBBox=function(worksheet,bbox){var oRes=new Range(worksheet,bbox.r1,bbox.c1,bbox.r2,bbox.c2);oRes.bbox=bbox.clone();return oRes};Range.prototype.clone=function(oNewWs){if(!oNewWs)oNewWs=this.worksheet;return this.createFromBBox(oNewWs,this.bbox)};Range.prototype._foreach=function(action){if(null!=action){var wb= this.worksheet.workbook;var tempCell=new Cell(this.worksheet);wb.loadCells.push(tempCell);var oBBox=this.bbox;for(var i=oBBox.r1;i<=oBBox.r2;i++){if(this.worksheet.bExcludeHiddenRows&&this.worksheet.getRowHidden(i))continue;for(var j=oBBox.c1;j<=oBBox.c2;j++){var targetCell=null;for(var k=0;k<wb.loadCells.length-1;++k){var elem=wb.loadCells[k];if(elem.nRow==i&&elem.nCol==j&&this.worksheet===elem.ws){targetCell=elem;break}}if(null===targetCell){if(!tempCell.loadContent(i,j))this.worksheet._initCell(tempCell, i,j);action(tempCell,i,j,oBBox.r1,oBBox.c1);tempCell.saveContent(true)}else action(targetCell,i,j,oBBox.r1,oBBox.c1)}}wb.loadCells.pop()}};Range.prototype._foreach2=function(action){if(null!=action){var wb=this.worksheet.workbook;var oRes;var tempCell=new Cell(this.worksheet);wb.loadCells.push(tempCell);var oBBox=this.bbox,minC=Math.min(this.worksheet.getColDataLength(),oBBox.c2),minR=Math.min(this.worksheet.cellsByColRowsCount-1,oBBox.r2);for(var i=oBBox.r1;i<=minR;i++){if(this.worksheet.bExcludeHiddenRows&& this.worksheet.getRowHidden(i))continue;for(var j=oBBox.c1;j<=minC;j++){var targetCell=null;for(var k=0;k<wb.loadCells.length-1;++k){var elem=wb.loadCells[k];if(elem.nRow==i&&elem.nCol==j&&this.worksheet===elem.ws){targetCell=elem;break}}if(null===targetCell)if(tempCell.loadContent(i,j)){oRes=action(tempCell,i,j,oBBox.r1,oBBox.c1);tempCell.saveContent(true)}else oRes=action(null,i,j,oBBox.r1,oBBox.c1);else oRes=action(targetCell,i,j,oBBox.r1,oBBox.c1);if(null!=oRes){wb.loadCells.pop();return oRes}}}wb.loadCells.pop()}}; Range.prototype._foreachNoEmpty=function(actionCell,actionRow,excludeHiddenRows){var oRes,i,oBBox=this.bbox,minR=Math.max(this.worksheet.cellsByColRowsCount-1,this.worksheet.rowsData.getSize()-1);minR=Math.min(minR,oBBox.r2);if(actionCell||actionRow){var itRow=new RowIterator;if(actionCell)itRow.init(this.worksheet,this.bbox.r1,this.bbox.c1,this.bbox.c2);var bExcludeHiddenRows=this.worksheet.bExcludeHiddenRows||excludeHiddenRows;var excludedCount=0;var tempCell;var tempRow=new AscCommonExcel.Row(this.worksheet); var allRow=this.worksheet.getAllRow();var allRowHidden=allRow&&allRow.getHidden();for(i=oBBox.r1;i<=minR;i++){if(actionRow)if(tempRow.loadContent(i)){if(bExcludeHiddenRows&&tempRow.getHidden()){excludedCount++;continue}oRes=actionRow(tempRow,excludedCount);tempRow.saveContent(true);if(null!=oRes){if(actionCell)itRow.release();return oRes}}else{if(bExcludeHiddenRows&&allRowHidden){excludedCount++;continue}}else if(bExcludeHiddenRows&&this.worksheet.getRowHidden(i)){excludedCount++;continue}if(actionCell){itRow.setRow(i); while(tempCell=itRow.next()){oRes=actionCell(tempCell,i,tempCell.nCol,oBBox.r1,oBBox.c1,excludedCount);if(null!=oRes){if(actionCell)itRow.release();return oRes}}}}if(actionCell)itRow.release()}};Range.prototype._foreachNoEmptyByCol=function(actionCell,excludeHiddenRows){var oRes,i,j,colData;var wb=this.worksheet.workbook;var oBBox=this.bbox,minR=Math.min(this.worksheet.cellsByColRowsCount-1,oBBox.r2);var minC=Math.min(this.worksheet.getColDataLength()-1,oBBox.c2);if(actionCell&&oBBox.c1<=minC&&oBBox.r1<= minR){var bExcludeHiddenRows=this.worksheet.bExcludeHiddenRows||excludeHiddenRows;var excludedCount=0;var tempCell=new Cell(this.worksheet);wb.loadCells.push(tempCell);for(j=oBBox.c1;j<=minC;++j){colData=this.worksheet.getColDataNoEmpty(j);if(colData)for(i=oBBox.r1;i<=Math.min(minR,colData.getSize()-1);i++){if(bExcludeHiddenRows&&this.worksheet.getRowHidden(i)){excludedCount++;continue}var targetCell=null;for(var k=0;k<wb.loadCells.length-1;++k){var elem=wb.loadCells[k];if(elem.nRow==i&&elem.nCol== j&&this.worksheet===elem.ws){targetCell=elem;break}}if(null===targetCell){if(tempCell.loadContent(i,j,colData)){oRes=actionCell(tempCell,i,j,oBBox.r1,oBBox.c1,excludedCount);tempCell.saveContent(true)}}else oRes=actionCell(targetCell,i,j,oBBox.r1,oBBox.c1,excludedCount);if(null!=oRes){wb.loadCells.pop();return oRes}}}wb.loadCells.pop()}};Range.prototype._foreachRow=function(actionRow,actionCell){var oBBox=this.bbox;if(null!=actionRow){var tempRow=new AscCommonExcel.Row(this.worksheet);for(var i=oBBox.r1;i<= oBBox.r2;i++){if(!tempRow.loadContent(i))this.worksheet._initRow(tempRow,i);if(this.worksheet.bExcludeHiddenRows&&tempRow.getHidden())continue;actionRow(tempRow);tempRow.saveContent(true)}}if(null!=actionCell)return this._foreachNoEmpty(actionCell)};Range.prototype._foreachRowNoEmpty=function(actionRow,actionCell,excludeHiddenRows){return this._foreachNoEmpty(actionCell,actionRow,excludeHiddenRows)};Range.prototype._foreachCol=function(actionCol,actionCell){var oBBox=this.bbox;if(null!=actionCol)for(var i= oBBox.c1;i<=oBBox.c2;++i){var col=this.worksheet._getCol(i);if(null!=col)actionCol(col)}if(null!=actionCell)this._foreachNoEmpty(actionCell)};Range.prototype._foreachColNoEmpty=function(actionCol,actionCell){var oBBox=this.bbox;var minC=Math.min(oBBox.c2,this.worksheet.aCols.length);if(null!=actionCol)for(var i=oBBox.c1;i<=minC;++i){var col=this.worksheet._getColNoEmpty(i);if(null!=col){var oRes=actionCol(col);if(null!=oRes)return oRes}}if(null!=actionCell)return this._foreachNoEmpty(actionCell)}; Range.prototype._getRangeType=function(oBBox){if(null==oBBox)oBBox=this.bbox;return getRangeType(oBBox)};Range.prototype._getValues=function(numbers){var res=[];var fAction=numbers?function(c){var v=c.getNumberValue();if(null!==v)res.push(v)}:function(c){res.push(new CellTypeAndValue(c.getType(),c.getValueWithoutFormat()))};this._setPropertyNoEmpty(null,null,fAction);return res};Range.prototype._getValuesAndMap=function(withEmpty){var v,arrRes=[],mapRes={};var fAction=function(c){v=c.getValueWithoutFormat(); arrRes.push(new CellTypeAndValue(c.getType(),v));mapRes[v.toLowerCase()]=true};if(withEmpty)this._setProperty(null,null,fAction);else this._setPropertyNoEmpty(null,null,fAction);return{values:arrRes,map:mapRes}};Range.prototype._setProperty=function(actionRow,actionCol,actionCell){var nRangeType=this._getRangeType();if(c_oRangeType.Range==nRangeType)this._foreach(actionCell);else if(c_oRangeType.Row==nRangeType)this._foreachRow(actionRow,actionCell);else if(c_oRangeType.Col==nRangeType)this._foreachCol(actionCol, actionCell);else;};Range.prototype._setPropertyNoEmpty=function(actionRow,actionCol,actionCell){var nRangeType=this._getRangeType();if(c_oRangeType.Range==nRangeType)return this._foreachNoEmpty(actionCell);else if(c_oRangeType.Row==nRangeType)return this._foreachRowNoEmpty(actionRow,actionCell);else if(c_oRangeType.Col==nRangeType)return this._foreachColNoEmpty(actionCol,actionCell);else{var oRes=this._foreachRowNoEmpty(actionRow,actionCell);if(null!=oRes)return oRes;if(null!=actionCol)oRes=this._foreachColNoEmpty(actionCol, null);return oRes}};Range.prototype.containCell=function(cellId){var cellAddress=cellId;return cellAddress.getRow0()>=this.bbox.r1&&cellAddress.getCol0()>=this.bbox.c1&&cellAddress.getRow0()<=this.bbox.r2&&cellAddress.getCol0()<=this.bbox.c2};Range.prototype.containCell2=function(cell){return cell.nRow>=this.bbox.r1&&cell.nCol>=this.bbox.c1&&cell.nRow<=this.bbox.r2&&cell.nCol<=this.bbox.c2};Range.prototype.cross=function(bbox){if(bbox.r1>=this.bbox.r1&&bbox.r1<=this.bbox.r2&&this.bbox.c1==this.bbox.c2)return{r:bbox.r1}; if(bbox.c1>=this.bbox.c1&&bbox.c1<=this.bbox.c2&&this.bbox.r1==this.bbox.r2)return{c:bbox.c1};return undefined};Range.prototype.getWorksheet=function(){return this.worksheet};Range.prototype.isFormula=function(){var nRow=this.bbox.r1;var nCol=this.bbox.c1;var isFormula;this.worksheet._getCellNoEmpty(nRow,nCol,function(cell){isFormula=cell.isFormula()});return isFormula};Range.prototype.isOneCell=function(){var oBBox=this.bbox;return oBBox.r1==oBBox.r2&&oBBox.c1==oBBox.c2};Range.prototype.getBBox0= function(){return this.bbox};Range.prototype.getName=function(){return this.bbox.getName()};Range.prototype.getMinimalCellsRange=function(){var nType=this._getRangeType();var oMinRange;if(nType===c_oRangeType.Range)return this;else{oMinRange=this.worksheet.getMinimalRange();if(!oMinRange)return null;var oBB=this.bbox;var r1=oBB.r1,c1=oBB.c1,r2=oBB.r2,c2=oBB.c2;if(nType===c_oRangeType.Col){r1=oMinRange.r1;r2=oMinRange.r2}else if(nType===c_oRangeType.Row){c1=oMinRange.c1;c2=oMinRange.c2}else{r1=oMinRange.r1; r2=oMinRange.r2;c1=oMinRange.c1;c2=oMinRange.c2}return new Range(this.worksheet,r1,c1,r2,c2)}};Range.prototype.setValue=function(val,callback,isCopyPaste,byRef,ignoreHyperlink){History.Create_NewPoint();History.StartTransaction();var _formula,t=this,activeCell;if(byRef===null){_formula=new AscCommonExcel.parserFormula(val.substr(1),null,this.worksheet);if(!_formula.parse(true))_formula=null;else{var _selection=this.worksheet.getSelection();activeCell=_selection.activeCell}}this._foreach(function(cell){var _val= val;if(_formula){_formula.isParsed=false;_formula.outStack=[];_formula.parse(true);var offset=new AscCommon.CellBase(cell.nRow-activeCell.row,cell.nCol-activeCell.col);_val="="+_formula.changeOffset(offset,null,true).assemble(true)}cell.setValue(_val,callback,isCopyPaste,byRef,ignoreHyperlink)});History.EndTransaction()};Range.prototype.setValue2=function(array){History.Create_NewPoint();History.StartTransaction();this._foreach(function(cell){cell.setValue2(array)});History.EndTransaction()};Range.prototype.setValueData= function(val){History.Create_NewPoint();History.StartTransaction();this._foreach(function(cell){cell.setValueData(val)});History.EndTransaction()};Range.prototype.setCellStyle=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setCellStyle(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&& null==row.xfs)return;row.setCellStyle(val)},function(col){col.setCellStyle(val)},function(cell){cell.setCellStyle(val)})};Range.prototype.setStyle=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setStyle(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setStyle(val)}, function(col){col.setStyle(val)},function(cell){cell.setStyle(val)})};Range.prototype.clearTableStyle=function(){this.worksheet.sheetMergedStyles.clearTablePivotStyle(this.bbox)};Range.prototype.setTableStyle=function(xf,stripe){if(xf)this.worksheet.sheetMergedStyles.setTablePivotStyle(this.bbox,xf,stripe)};Range.prototype.setNumFormat=function(val){this.setNum(new AscCommonExcel.Num({f:val}))};Range.prototype.setNum=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty= this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setNum(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setNum(val)},function(col){col.setNum(val)},function(cell){cell.setNum(val)})};Range.prototype.shiftNumFormat=function(nShift,aDigitsCount){History.Create_NewPoint();var bRes=false;this._setPropertyNoEmpty(null,null,function(cell,nRow0,nCol0, nRowStart,nColStart){bRes|=cell.shiftNumFormat(nShift,aDigitsCount[nCol0-nColStart])});return bRes};Range.prototype.setFont=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setFont(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setFont(val)},function(col){col.setFont(val)}, function(cell){cell.setFont(val)})};Range.prototype.setFontname=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setFontname(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setFontname(val)},function(col){col.setFontname(val)},function(cell){cell.setFontname(val)})}; Range.prototype.setFontsize=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setFontsize(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setFontsize(val)},function(col){col.setFontsize(val)},function(cell){cell.setFontsize(val)})};Range.prototype.setFontcolor= function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setFontcolor(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setFontcolor(val)},function(col){col.setFontcolor(val)},function(cell){cell.setFontcolor(val)})};Range.prototype.setBold=function(val){History.Create_NewPoint(); this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setBold(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setBold(val)},function(col){col.setBold(val)},function(cell){cell.setBold(val)})};Range.prototype.setItalic=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty= this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setItalic(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setItalic(val)},function(col){col.setItalic(val)},function(cell){cell.setItalic(val)})};Range.prototype.setUnderline=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType(); if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setUnderline(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setUnderline(val)},function(col){col.setUnderline(val)},function(cell){cell.setUnderline(val)})};Range.prototype.setStrikeout=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setStrikeout(val); fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setStrikeout(val)},function(col){col.setStrikeout(val)},function(cell){cell.setStrikeout(val)})};Range.prototype.setFontAlign=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setFontAlign(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this, function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setFontAlign(val)},function(col){col.setFontAlign(val)},function(cell){cell.setFontAlign(val)})};Range.prototype.setAlignVertical=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setAlignVertical(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All== nRangeType&&null==row.xfs)return;row.setAlignVertical(val)},function(col){col.setAlignVertical(val)},function(cell){cell.setAlignVertical(val)})};Range.prototype.setAlignHorizontal=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setAlignHorizontal(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All== nRangeType&&null==row.xfs)return;row.setAlignHorizontal(val)},function(col){col.setAlignHorizontal(val)},function(cell){cell.setAlignHorizontal(val)})};Range.prototype.setFill=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setFill(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null== row.xfs)return;row.setFill(val)},function(col){col.setFill(val)},function(cell){cell.setFill(val)})};Range.prototype.setFillColor=function(val){var fill=new AscCommonExcel.Fill;fill.fromColor(val);return this.setFill(fill)};Range.prototype.setBorderSrc=function(border){History.Create_NewPoint();History.StartTransaction();if(null==border)border=new Border;this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setBorder(border.clone()); fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setBorder(border.clone())},function(col){col.setBorder(border.clone())},function(cell){cell.setBorder(border.clone())});History.EndTransaction()};Range.prototype._setBorderMerge=function(bLeft,bTop,bRight,bBottom,oNewBorder,oCurBorder){var oTargetBorder=new Border;if(bLeft)oTargetBorder.l=oNewBorder.l;else oTargetBorder.l=oNewBorder.iv;if(bTop)oTargetBorder.t=oNewBorder.t; else oTargetBorder.t=oNewBorder.ih;if(bRight)oTargetBorder.r=oNewBorder.r;else oTargetBorder.r=oNewBorder.iv;if(bBottom)oTargetBorder.b=oNewBorder.b;else oTargetBorder.b=oNewBorder.ih;oTargetBorder.d=oNewBorder.d;oTargetBorder.dd=oNewBorder.dd;oTargetBorder.du=oNewBorder.du;var oRes=null;if(null!=oCurBorder){oCurBorder.mergeInner(oTargetBorder);oRes=oCurBorder}else oRes=oTargetBorder;return oRes};Range.prototype._setCellBorder=function(bbox,cell,oNewBorder){if(null==oNewBorder)cell.setBorder(oNewBorder); else{var oCurBorder=null;if(null!=cell.xfs&&null!=cell.xfs.border)oCurBorder=cell.xfs.border.clone();else oCurBorder=g_oDefaultFormat.Border.clone();var nRow=cell.nRow;var nCol=cell.nCol;cell.setBorder(this._setBorderMerge(nCol==bbox.c1,nRow==bbox.r1,nCol==bbox.c2,nRow==bbox.r2,oNewBorder,oCurBorder))}};Range.prototype._setRowColBorder=function(bbox,rowcol,bRow,oNewBorder){if(null==oNewBorder)rowcol.setBorder(oNewBorder);else{var oCurBorder=null;if(null!=rowcol.xfs&&null!=rowcol.xfs.border)oCurBorder= rowcol.xfs.border.clone();var bLeft,bTop,bRight,bBottom=false;if(bRow){bTop=rowcol.index==bbox.r1;bBottom=rowcol.index==bbox.r2}else{bLeft=rowcol.index==bbox.c1;bRight=rowcol.index==bbox.c2}rowcol.setBorder(this._setBorderMerge(bLeft,bTop,bRight,bBottom,oNewBorder,oCurBorder))}};Range.prototype._setBorderEdge=function(bbox,oItemWithXfs,nRow,nCol,oNewBorder){var oCurBorder=null;if(null!=oItemWithXfs.xfs&&null!=oItemWithXfs.xfs.border)oCurBorder=oItemWithXfs.xfs.border;if(null!=oCurBorder){var oCurBorderProp= null;if(nCol==bbox.c1-1)oCurBorderProp=oCurBorder.r;else if(nRow==bbox.r1-1)oCurBorderProp=oCurBorder.b;else if(nCol==bbox.c2+1)oCurBorderProp=oCurBorder.l;else if(nRow==bbox.r2+1)oCurBorderProp=oCurBorder.t;var oNewBorderProp=null;if(null==oNewBorder)oNewBorderProp=new AscCommonExcel.BorderProp;else if(nCol==bbox.c1-1)oNewBorderProp=oNewBorder.l;else if(nRow==bbox.r1-1)oNewBorderProp=oNewBorder.t;else if(nCol==bbox.c2+1)oNewBorderProp=oNewBorder.r;else if(nRow==bbox.r2+1)oNewBorderProp=oNewBorder.b; if(null!=oNewBorderProp&&null!=oCurBorderProp&&c_oAscBorderStyles.None!=oCurBorderProp.s&&(null==oNewBorder||c_oAscBorderStyles.None!=oNewBorderProp.s)&&(oNewBorderProp.s!=oCurBorderProp.s||oNewBorderProp.getRgbOrNull()!=oCurBorderProp.getRgbOrNull())){var oTargetBorder=oCurBorder.clone();if(nCol==bbox.c1-1)oTargetBorder.r=new AscCommonExcel.BorderProp;else if(nRow==bbox.r1-1)oTargetBorder.b=new AscCommonExcel.BorderProp;else if(nCol==bbox.c2+1)oTargetBorder.l=new AscCommonExcel.BorderProp;else if(nRow== bbox.r2+1)oTargetBorder.t=new AscCommonExcel.BorderProp;oItemWithXfs.setBorder(oTargetBorder)}}};Range.prototype.setBorder=function(border){History.Create_NewPoint();var _this=this;var oBBox=this.bbox;this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){var oAllCol=this.worksheet.getAllCol();_this._setRowColBorder(oBBox,oAllCol,false,border);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All== nRangeType&&null==row.xfs)return;_this._setRowColBorder(oBBox,row,true,border)},function(col){_this._setRowColBorder(oBBox,col,false,border)},function(cell){_this._setCellBorder(oBBox,cell,border)});var aEdgeBorders=[];if(oBBox.c1>0&&(null==border||!border.l.isEmpty()))aEdgeBorders.push(this.worksheet.getRange3(oBBox.r1,oBBox.c1-1,oBBox.r2,oBBox.c1-1));if(oBBox.r1>0&&(null==border||!border.t.isEmpty()))aEdgeBorders.push(this.worksheet.getRange3(oBBox.r1-1,oBBox.c1,oBBox.r1-1,oBBox.c2));if(oBBox.c2< gc_nMaxCol0&&(null==border||!border.r.isEmpty()))aEdgeBorders.push(this.worksheet.getRange3(oBBox.r1,oBBox.c2+1,oBBox.r2,oBBox.c2+1));if(oBBox.r2<gc_nMaxRow0&&(null==border||!border.b.isEmpty()))aEdgeBorders.push(this.worksheet.getRange3(oBBox.r2+1,oBBox.c1,oBBox.r2+1,oBBox.c2));for(var i=0,length=aEdgeBorders.length;i<length;i++){var range=aEdgeBorders[i];range._setPropertyNoEmpty(function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;_this._setBorderEdge(oBBox,row,row.index,0,border)}, function(col){_this._setBorderEdge(oBBox,col,0,col.index,border)},function(cell){_this._setBorderEdge(oBBox,cell,cell.nRow,cell.nCol,border)})}};Range.prototype.setShrinkToFit=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setShrinkToFit(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&& null==row.xfs)return;row.setShrinkToFit(val)},function(col){col.setShrinkToFit(val)},function(cell){cell.setShrinkToFit(val)})};Range.prototype.setWrap=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setWrap(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setWrap(val)}, function(col){col.setWrap(val)},function(cell){cell.setWrap(val)})};Range.prototype.setAngle=function(val){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){this.worksheet.getAllCol().setAngle(val);fSetProperty=this._setPropertyNoEmpty}fSetProperty.call(this,function(row){if(c_oRangeType.All==nRangeType&&null==row.xfs)return;row.setAngle(val)},function(col){col.setAngle(val)},function(cell){cell.setAngle(val)})}; Range.prototype.setType=function(type){History.Create_NewPoint();this.createCellOnRowColCross();var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType)fSetProperty=this._setPropertyNoEmpty;fSetProperty.call(this,null,null,function(cell){cell.setType(type)})};Range.prototype.getType=function(){var type;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)type=cell.getType();else type=null});return type};Range.prototype.isNullText= function(){var isNullText;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){isNullText=null!=cell?cell.isNullText():true});return isNullText};Range.prototype.isEmptyTextString=function(){var isEmptyTextString;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){isEmptyTextString=null!=cell?cell.isEmptyTextString():true});return isEmptyTextString};Range.prototype.isNullTextString=function(){var isNullTextString;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1, function(cell){isNullTextString=null!=cell?cell.isNullTextString():true});return isNullTextString};Range.prototype.isFormula=function(){var isFormula;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){isFormula=null!=cell?cell.isFormula():false});return isFormula};Range.prototype.getFormula=function(){var formula;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)formula=cell.getFormula();else formula=""});return formula};Range.prototype.getValueForEdit= function(checkFormulaArray){var t=this;var valueForEdit;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)valueForEdit=cell.getValueForEdit(checkFormulaArray);else valueForEdit=""});return valueForEdit};Range.prototype.getValueForEdit2=function(){var t=this;var valueForEdit2;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)valueForEdit2=cell.getValueForEdit2();else{var xfs=null;t.worksheet._getRowNoEmpty(t.bbox.r1,function(row){var oCol= t.worksheet._getColNoEmptyWithAll(t.bbox.c1);if(row&&null!=row.xfs)xfs=row.xfs.clone();else if(null!=oCol&&null!=oCol.xfs)xfs=oCol.xfs.clone()});var oTempCell=new Cell(t.worksheet);oTempCell.setRowCol(t.bbox.r1,t.bbox.c1);oTempCell.setStyleInternal(xfs);valueForEdit2=oTempCell.getValueForEdit2()}});return valueForEdit2};Range.prototype.getValueWithoutFormat=function(){var valueWithoutFormat;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)valueWithoutFormat=cell.getValueWithoutFormat(); else valueWithoutFormat=""});return valueWithoutFormat};Range.prototype.getValue=function(){return this.getValueWithoutFormat()};Range.prototype.getValueWithFormat=function(){var value;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)value=cell.getValue();else value=""});return value};Range.prototype.getValueWithFormatSkipToSpace=function(){var value;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)value=cell.getValueSkipToSpace(); else value=""});return value};Range.prototype.getValue2=function(dDigitsCount,fIsFitMeasurer){var t=this;var value2;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)value2=cell.getValue2(dDigitsCount,fIsFitMeasurer);else{var xfs=null;t.worksheet._getRowNoEmpty(t.bbox.r1,function(row){var oCol=t.worksheet._getColNoEmptyWithAll(t.bbox.c1);if(row&&null!=row.xfs)xfs=row.xfs.clone();else if(null!=oCol&&null!=oCol.xfs)xfs=oCol.xfs.clone()});var oTempCell=new Cell(t.worksheet); oTempCell.setRowCol(t.bbox.r1,t.bbox.c1);oTempCell.setStyleInternal(xfs);value2=oTempCell.getValue2(dDigitsCount,fIsFitMeasurer)}});return value2};Range.prototype.getNumberValue=function(){var numberValue;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){numberValue=null!=cell?cell.getNumberValue():null});return numberValue};Range.prototype.getValueData=function(){var res=null;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){if(null!=cell)res=cell.getValueData()}); return res};Range.prototype.getXfs=function(compiled){var ws=this.worksheet;var nRow=this.bbox.r1;var nCol=this.bbox.c1;var xfs;this.worksheet._getCellNoEmpty(nRow,nCol,function(cell){xfs=ws.getCompiledStyle(nRow,nCol,cell,compiled?null:emptyStyleComponents)});return xfs||g_oDefaultFormat.xfs};Range.prototype.getStyle=Range.prototype.getXfs;Range.prototype.getXfId=function(){var t=this;var nRow=this.bbox.r1;var nCol=this.bbox.c1;var XfId=g_oDefaultFormat.XfId;this.worksheet._getCellNoEmpty(nRow,nCol, function(cell){var xfs=cell?cell.getCompiledStyle():t.worksheet.getCompiledStyle(nRow,nCol);if(xfs&&null!==xfs.XfId)XfId=xfs.XfId});return XfId};Range.prototype.getStyleName=function(){var res=this.worksheet.workbook.CellStyles.getStyleNameByXfId(this.getXfId());return res||this.worksheet.workbook.CellStyles.getStyleNameByXfId(g_oDefaultFormat.XfId)};Range.prototype.getTableStyle=function(){var tableStyle;this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,function(cell){tableStyle=cell?cell.getTableStyle(): null});return tableStyle};Range.prototype.getCompiledStyleCustom=function(needTable,needCell,needConditional){return this.worksheet.getCompiledStyleCustom(this.bbox.r1,this.bbox.c1,needTable,needCell,needConditional)};Range.prototype.getNumFormat=function(){return oNumFormatCache.get(this.getNumFormatStr())};Range.prototype.getNumFormatStr=function(){var t=this;var nRow=this.bbox.r1;var nCol=this.bbox.c1;var numFormatStr=g_oDefaultFormat.Num.getFormat();this.worksheet._getCellNoEmpty(nRow,nCol,function(cell){var xfs= cell?cell.getCompiledStyle():t.worksheet.getCompiledStyle(nRow,nCol);if(xfs&&xfs.num)numFormatStr=xfs.num.getFormat()});return numFormatStr};Range.prototype.getNumFormatType=function(){return this.getNumFormat().getType()};Range.prototype.isNotDefaultFont=function(){var t=this;var cellFont=this.getFont();var rowFont=g_oDefaultFormat.Font;this.worksheet._getRowNoEmpty(this.bbox.r1,function(row){if(row&&null!=row.xfs&&null!=row.xfs.font)rowFont=row.xfs.font;else if(null!=t.worksheet.oAllCol&&t.worksheet.oAllCol.xfs&& t.worksheet.oAllCol.xfs.font)rowFont=t.worksheet.oAllCol.xfs.font});return cellFont.getName()!==rowFont.getName()||cellFont.getSize()!==rowFont.getSize()};Range.prototype.getFont=function(original){var t=this;var nRow=this.bbox.r1;var nCol=this.bbox.c1;var font=g_oDefaultFormat.Font;this.worksheet._getCellNoEmpty(nRow,nCol,function(cell){var xfs;if(cell)xfs=original?cell.getStyle():cell.getCompiledStyle();else xfs=t.worksheet.getCompiledStyle(nRow,nCol,null,original?emptyStyleComponents:null);if(xfs&& xfs.font)font=xfs.font});return font};Range.prototype.getAlignHorizontalByValue=function(align){var t=this;if(null==align){var nRow=this.bbox.r1;var nCol=this.bbox.c1;this.worksheet._getCellNoEmpty(nRow,nCol,function(cell){if(cell)switch(cell.getType()){case CellValueType.String:align=AscCommon.align_Left;break;case CellValueType.Bool:case CellValueType.Error:align=AscCommon.align_Center;break;default:if(t.getValueWithoutFormat()){var oNumFmt=t.getNumFormat();if(true==oNumFmt.isTextFormat())align= AscCommon.align_Left;else align=AscCommon.align_Right}else align=AscCommon.align_Left;break}});if(null==align)align=AscCommon.align_Left}return align};Range.prototype.getFillColor=function(){return this.getFill().bg()};Range.prototype.getFill=function(){var t=this;var nRow=this.bbox.r1;var nCol=this.bbox.c1;var fill=g_oDefaultFormat.Fill;this.worksheet._getCellNoEmpty(nRow,nCol,function(cell){var xfs=cell?cell.getCompiledStyle():t.worksheet.getCompiledStyle(nRow,nCol);if(xfs&&xfs.fill)fill=xfs.fill}); return fill};Range.prototype.getBorderSrc=function(opt_row,opt_col){var t=this;var nRow=null!=opt_row?opt_row:this.bbox.r1;var nCol=null!=opt_col?opt_col:this.bbox.c1;var border=g_oDefaultFormat.Border;this.worksheet._getCellNoEmpty(nRow,nCol,function(cell){var xfs=cell?cell.getCompiledStyle():t.worksheet.getCompiledStyle(nRow,nCol);if(xfs&&xfs.border)border=xfs.border});return border};Range.prototype.getBorder=function(opt_row,opt_col){return this.getBorderSrc(opt_row,opt_col)||g_oDefaultFormat.Border}; Range.prototype.getBorderFull=function(){var borders=this.getBorder(this.bbox.r1,this.bbox.c1).clone();var nRow=this.bbox.r1;var nCol=this.bbox.c1;if(c_oAscBorderStyles.None===borders.l.s)if(nCol>1){var left=this.getBorder(nRow,nCol-1);if(c_oAscBorderStyles.None!==left.r.s)borders.l=left.r}if(c_oAscBorderStyles.None===borders.t.s)if(nRow>1){var top=this.getBorder(nRow-1,nCol);if(c_oAscBorderStyles.None!==top.b.s)borders.t=top.b}if(c_oAscBorderStyles.None===borders.r.s){var right=this.getBorder(nRow, nCol+1);if(c_oAscBorderStyles.None!==right.l.s)borders.r=right.l}if(c_oAscBorderStyles.None===borders.b.s){var bottom=this.getBorder(nRow+1,nCol);if(c_oAscBorderStyles.None!==bottom.t.s)borders.b=bottom.t}return borders};Range.prototype.getAlign=function(){var t=this;var nRow=this.bbox.r1;var nCol=this.bbox.c1;var align=g_oDefaultFormat.Align;this.worksheet._getCellNoEmpty(nRow,nCol,function(cell){var xfs=cell?cell.getCompiledStyle():t.worksheet.getCompiledStyle(nRow,nCol);if(null!=xfs&&null!=xfs.align)align= xfs.align});return align};Range.prototype.hasMerged=function(){var res=this.worksheet.mergeManager.getAny(this.bbox);return res?res.bbox:null};Range.prototype.mergeOpen=function(){this.worksheet.mergeManager.add(this.bbox,1)};Range.prototype.merge=function(type){if(null==type)type=Asc.c_oAscMergeOptions.Merge;var oBBox=this.bbox;History.Create_NewPoint();History.StartTransaction();if(oBBox.r1==oBBox.r2&&oBBox.c1==oBBox.c2){if(type==Asc.c_oAscMergeOptions.MergeCenter)this.setAlignHorizontal(AscCommon.align_Center); History.EndTransaction();return}if(this.hasMerged()){this.unmerge();if(type==Asc.c_oAscMergeOptions.MergeCenter){this.setAlignHorizontal(null);History.EndTransaction();return}}var oLeftBorder=null;var oTopBorder=null;var oRightBorder=null;var oBottomBorder=null;var nRangeType=this._getRangeType(oBBox);if(c_oRangeType.Range==nRangeType){var oThis=this;var fGetBorder=function(bRow,v1,v2,v3,type){var oRes=null;for(var i=v1;i<=v2;++i){var bNeedDelete=true;oThis.worksheet._getCellNoEmpty(bRow?v3:i,bRow? i:v3,function(cell){if(null!=cell&&null!=cell.xfs&&null!=cell.xfs.border){var border=cell.xfs.border;var oBorderProp;switch(type){case 1:oBorderProp=border.l;break;case 2:oBorderProp=border.t;break;case 3:oBorderProp=border.r;break;case 4:oBorderProp=border.b;break}if(false==oBorderProp.isEmpty())if(null==oRes){oRes=oBorderProp;bNeedDelete=false}else if(true==oRes.isEqual(oBorderProp))bNeedDelete=false}});if(bNeedDelete){oRes=null;break}}return oRes};oLeftBorder=fGetBorder(false,oBBox.r1,oBBox.r2, oBBox.c1,1);oTopBorder=fGetBorder(true,oBBox.c1,oBBox.c2,oBBox.r1,2);oRightBorder=fGetBorder(false,oBBox.r1,oBBox.r2,oBBox.c2,3);oBottomBorder=fGetBorder(true,oBBox.c1,oBBox.c2,oBBox.r2,4)}else if(c_oRangeType.Row==nRangeType){this.worksheet._getRowNoEmpty(oBBox.r1,function(row){if(row&&null!=row.xfs&&null!=row.xfs.border&&false==row.xfs.border.t.isEmpty())oTopBorder=row.xfs.border.t});if(oBBox.r1!=oBBox.r2)this.worksheet._getRowNoEmpty(oBBox.r2,function(row){if(row&&null!=row.xfs&&null!=row.xfs.border&& false==row.xfs.border.b.isEmpty())oBottomBorder=row.xfs.border.b})}else{var oLeftCol=this.worksheet._getColNoEmptyWithAll(oBBox.c1);if(null!=oLeftCol&&null!=oLeftCol.xfs&&null!=oLeftCol.xfs.border&&false==oLeftCol.xfs.border.l.isEmpty())oLeftBorder=oLeftCol.xfs.border.l;if(oBBox.c1!=oBBox.c2){var oRightCol=this.worksheet._getColNoEmptyWithAll(oBBox.c2);if(null!=oRightCol&&null!=oRightCol.xfs&&null!=oRightCol.xfs.border&&false==oRightCol.xfs.border.r.isEmpty())oRightBorder=oRightCol.xfs.border.r}}var bFirst= true;var oLeftTopCellStyle=null;var oFirstCellStyle=null;var oFirstCellValue=null;var oFirstCellRow=null;var oFirstCellCol=null;var oFirstCellHyperlink=null;this._setPropertyNoEmpty(null,null,function(cell,nRow0,nCol0,nRowStart,nColStart){if(bFirst&&false==cell.isNullText()){bFirst=false;oFirstCellStyle=cell.getStyle();oFirstCellValue=cell.getValueData();oFirstCellRow=cell.nRow;oFirstCellCol=cell.nCol}if(nRow0==nRowStart&&nCol0==nColStart)oLeftTopCellStyle=cell.getStyle()});var aHyperlinks=this.worksheet.hyperlinkManager.get(oBBox); var aHyperlinksToRestore=[];for(var i=0,length=aHyperlinks.inner.length;i<length;i++){var elem=aHyperlinks.inner[i];if(oFirstCellRow==elem.bbox.r1&&oFirstCellCol==elem.bbox.c1&&elem.bbox.r1==elem.bbox.r2&&elem.bbox.c1==elem.bbox.c2){var oNewHyperlink=elem.data.clone();oNewHyperlink.Ref.setOffset(new AscCommon.CellBase(oBBox.r1-oFirstCellRow,oBBox.c1-oFirstCellCol));aHyperlinksToRestore.push(oNewHyperlink)}else if(oBBox.r1==elem.bbox.r1&&(elem.bbox.r1!=elem.bbox.r2||elem.bbox.c1!=elem.bbox.c2&&oBBox.r1== oBBox.r2))aHyperlinksToRestore.push(elem.data)}this.cleanAll();for(var i=0,length=aHyperlinksToRestore.length;i<length;i++){var elem=aHyperlinksToRestore[i];this.worksheet.hyperlinkManager.add(elem.Ref.getBBox0(),elem)}var oTargetStyle=null;if(null!=oFirstCellValue&&null!=oFirstCellRow&&null!=oFirstCellCol){if(null!=oFirstCellStyle)oTargetStyle=oFirstCellStyle.clone();this.worksheet._getCell(oBBox.r1,oBBox.c1,function(cell){cell.setValueData(oFirstCellValue)});if(null!=oFirstCellHyperlink){var oLeftTopRange= this.worksheet.getCell3(oBBox.r1,oBBox.c1);oLeftTopRange.setHyperlink(oFirstCellHyperlink,true)}}else if(null!=oLeftTopCellStyle)oTargetStyle=oLeftTopCellStyle.clone();if(null!=oTargetStyle){if(null!=oTargetStyle.border)oTargetStyle.border=null}else if(null!=oLeftBorder||null!=oTopBorder||null!=oRightBorder||null!=oBottomBorder)oTargetStyle=new AscCommonExcel.CellXfs;var fSetProperty=this._setProperty;var nRangeType=this._getRangeType();if(c_oRangeType.All==nRangeType){fSetProperty=this._setPropertyNoEmpty; oTargetStyle=null}fSetProperty.call(this,function(row){if(null==oTargetStyle)row.setStyle(null);else{var oNewStyle=oTargetStyle.clone();if(row.index==oBBox.r1&&null!=oTopBorder){oNewStyle.border=new Border;oNewStyle.border.t=oTopBorder.clone()}else if(row.index==oBBox.r2&&null!=oBottomBorder){oNewStyle.border=new Border;oNewStyle.border.b=oBottomBorder.clone()}row.setStyle(oNewStyle)}},function(col){if(null==oTargetStyle)col.setStyle(null);else{var oNewStyle=oTargetStyle.clone();if(col.index==oBBox.c1&& null!=oLeftBorder){oNewStyle.border=new Border;oNewStyle.border.l=oLeftBorder.clone()}else if(col.index==oBBox.c2&&null!=oRightBorder){oNewStyle.border=new Border;oNewStyle.border.r=oRightBorder.clone()}col.setStyle(oNewStyle)}},function(cell,nRow,nCol,nRowStart,nColStart){if(null==oTargetStyle)cell.setStyle(null);else{var oNewStyle=oTargetStyle.clone();if(oBBox.r1==nRow&&oBBox.c1==nCol){if(null!=oLeftBorder||null!=oTopBorder||oBBox.r1==oBBox.r2&&null!=oBottomBorder||oBBox.c1==oBBox.c2&&null!=oRightBorder){oNewStyle.border= new Border;if(null!=oLeftBorder)oNewStyle.border.l=oLeftBorder.clone();if(null!=oTopBorder)oNewStyle.border.t=oTopBorder.clone();if(oBBox.r1==oBBox.r2&&null!=oBottomBorder)oNewStyle.border.b=oBottomBorder.clone();if(oBBox.c1==oBBox.c2&&null!=oRightBorder)oNewStyle.border.r=oRightBorder.clone()}}else if(oBBox.r1==nRow&&oBBox.c2==nCol){if(null!=oRightBorder||null!=oTopBorder||oBBox.r1==oBBox.r2&&null!=oBottomBorder){oNewStyle.border=new Border;if(null!=oRightBorder)oNewStyle.border.r=oRightBorder.clone(); if(null!=oTopBorder)oNewStyle.border.t=oTopBorder.clone();if(oBBox.r1==oBBox.r2&&null!=oBottomBorder)oNewStyle.border.b=oBottomBorder.clone()}}else if(oBBox.r2==nRow&&oBBox.c1==nCol){if(null!=oLeftBorder||null!=oBottomBorder||oBBox.c1==oBBox.c2&&null!=oRightBorder){oNewStyle.border=new Border;if(null!=oLeftBorder)oNewStyle.border.l=oLeftBorder.clone();if(null!=oBottomBorder)oNewStyle.border.b=oBottomBorder.clone();if(oBBox.c1==oBBox.c2&&null!=oRightBorder)oNewStyle.border.r=oRightBorder.clone()}}else if(oBBox.r2== nRow&&oBBox.c2==nCol){if(null!=oRightBorder||null!=oBottomBorder){oNewStyle.border=new Border;if(null!=oRightBorder)oNewStyle.border.r=oRightBorder.clone();if(null!=oBottomBorder)oNewStyle.border.b=oBottomBorder.clone()}}else if(oBBox.r1==nRow){if(null!=oTopBorder||oBBox.r1==oBBox.r2&&null!=oBottomBorder){oNewStyle.border=new Border;if(null!=oTopBorder)oNewStyle.border.t=oTopBorder.clone();if(oBBox.r1==oBBox.r2&&null!=oBottomBorder)oNewStyle.border.b=oBottomBorder.clone()}}else if(oBBox.r2==nRow){if(null!= oBottomBorder){oNewStyle.border=new Border;oNewStyle.border.b=oBottomBorder.clone()}}else if(oBBox.c1==nCol){if(null!=oLeftBorder||oBBox.c1==oBBox.c2&&null!=oRightBorder){oNewStyle.border=new Border;if(null!=oLeftBorder)oNewStyle.border.l=oLeftBorder.clone();if(oBBox.c1==oBBox.c2&&null!=oRightBorder)oNewStyle.border.r=oRightBorder.clone()}}else if(oBBox.c2==nCol)if(null!=oRightBorder){oNewStyle.border=new Border;oNewStyle.border.r=oRightBorder.clone()}cell.setStyle(oNewStyle)}});if(type==Asc.c_oAscMergeOptions.MergeCenter)this.setAlignHorizontal(AscCommon.align_Center); if(false==this.worksheet.workbook.bUndoChanges&&false==this.worksheet.workbook.bRedoChanges)this.worksheet.mergeManager.add(this.bbox,1);History.EndTransaction()};Range.prototype.unmerge=function(bOnlyInRange){History.Create_NewPoint();History.StartTransaction();if(false==this.worksheet.workbook.bUndoChanges&&false==this.worksheet.workbook.bRedoChanges)this.worksheet.mergeManager.remove(this.bbox);History.EndTransaction()};Range.prototype._getHyperlinks=function(){var nRangeType=this._getRangeType(); var result=[];var oThis=this;if(c_oRangeType.Range==nRangeType){var oTempRows={};var fAddToTempRows=function(oTempRows,bbox,data){if(null!=bbox)for(var i=bbox.r1;i<=bbox.r2;i++){var row=oTempRows[i];if(null==row){row={};oTempRows[i]=row}for(var j=bbox.c1;j<=bbox.c2;j++){var cell=row[j];if(null==cell)row[j]=data}}};var aHyperlinks=this.worksheet.hyperlinkManager.get(this.bbox);for(var i=0,length=aHyperlinks.all.length;i<length;i++){var hyp=aHyperlinks.all[i];var hypBBox=hyp.bbox.intersectionSimple(this.bbox); fAddToTempRows(oTempRows,hypBBox,hyp.data);var aMerged=this.worksheet.mergeManager.get(hyp.bbox);for(var j=0,length2=aMerged.all.length;j<length2;j++){var merge=aMerged.all[j];var mergeBBox=merge.bbox.intersectionSimple(this.bbox);fAddToTempRows(oTempRows,mergeBBox,hyp.data)}}for(var i in oTempRows){var nRowIndex=i-0;var row=oTempRows[i];for(var j in row){var nColIndex=j-0;var oCurHyp=row[j];result.push({hyperlink:oCurHyp,col:nColIndex,row:nRowIndex})}}}return result};Range.prototype.getHyperlink= function(){var aHyperlinks=this._getHyperlinks();if(null!=aHyperlinks&&aHyperlinks.length>0)return aHyperlinks[0].hyperlink;return null};Range.prototype.getHyperlinks=function(){return this._getHyperlinks()};Range.prototype.setHyperlinkOpen=function(val){if(null!=val&&false==val.isValid())return;this.worksheet.hyperlinkManager.add(val.Ref.getBBox0(),val)};Range.prototype.setHyperlink=function(val,bWithoutStyle){if(null!=val&&false==val.isValid())return;var i,length,hyp;var bExist=false;var aHyperlinks= this.worksheet.hyperlinkManager.get(this.bbox);for(i=0,length=aHyperlinks.all.length;i<length;i++){hyp=aHyperlinks.all[i];if(hyp.data.isEqual(val)){bExist=true;break}}if(false==bExist){History.Create_NewPoint();History.StartTransaction();if(false==this.worksheet.workbook.bUndoChanges&&false==this.worksheet.workbook.bRedoChanges)for(i=0,length=aHyperlinks.all.length;i<length;i++){hyp=aHyperlinks.all[i];if(hyp.bbox.isEqual(this.bbox))this.worksheet.hyperlinkManager.removeElement(hyp)}if(true!=bWithoutStyle){var oHyperlinkFont= new AscCommonExcel.Font;oHyperlinkFont.setName(this.worksheet.workbook.getDefaultFont());oHyperlinkFont.setSize(this.worksheet.workbook.getDefaultSize());oHyperlinkFont.setUnderline(Asc.EUnderline.underlineSingle);oHyperlinkFont.setColor(AscCommonExcel.g_oColorManager.getThemeColor(AscCommonExcel.g_nColorHyperlink));this.setFont(oHyperlinkFont)}if(false==this.worksheet.workbook.bUndoChanges&&false==this.worksheet.workbook.bRedoChanges)this.worksheet.hyperlinkManager.add(val.Ref.getBBox0(),val);History.EndTransaction()}}; Range.prototype.removeHyperlink=function(elem,removeStyle){var bbox=this.bbox;if(false==this.worksheet.workbook.bUndoChanges&&false==this.worksheet.workbook.bRedoChanges){History.Create_NewPoint();History.StartTransaction();var oChangeParam={removeStyle:removeStyle};if(elem)this.worksheet.hyperlinkManager.removeElement(elem,oChangeParam);else this.worksheet.hyperlinkManager.remove(bbox,!bbox.isOneCell(),oChangeParam);History.EndTransaction()}};Range.prototype.deleteCellsShiftUp=function(preDeleteAction){return this._shiftUpDown(true, preDeleteAction)};Range.prototype.addCellsShiftBottom=function(displayNameFormatTable){return this._shiftUpDown(false,null,displayNameFormatTable)};Range.prototype.addCellsShiftRight=function(displayNameFormatTable){return this._shiftLeftRight(false,null,displayNameFormatTable)};Range.prototype.deleteCellsShiftLeft=function(preDeleteAction){return this._shiftLeftRight(true,preDeleteAction)};Range.prototype._canShiftLeftRight=function(bLeft){var aColsToDelete=[],aCellsToDelete=[];var oBBox=this.bbox; var nRangeType=this._getRangeType(oBBox);if(c_oRangeType.Range!=nRangeType&&c_oRangeType.Col!=nRangeType)return null;var nWidth=oBBox.c2-oBBox.c1+1;if(!bLeft&&!this.worksheet.workbook.bUndoChanges&&!this.worksheet.workbook.bRedoChanges){var rangeEdge=this.worksheet.getRange3(oBBox.r1,gc_nMaxCol0-nWidth+1,oBBox.r2,gc_nMaxCol0);var aMerged=this.worksheet.mergeManager.get(rangeEdge.bbox);if(aMerged.all.length>0)return null;var aHyperlink=this.worksheet.hyperlinkManager.get(rangeEdge.bbox);if(aHyperlink.all.length> 0)return null;var bError=rangeEdge._setPropertyNoEmpty(null,function(col){if(null!=col){if(null!=col&&null!=col.xfs&&null!=col.xfs.fill&&col.xfs.fill.notEmpty())return true;aColsToDelete.push(col)}},function(cell){if(null!=cell){if(null!=cell.xfs&&null!=cell.xfs.fill&&cell.xfs.fill.notEmpty())return true;if(!cell.isNullText())return true;aCellsToDelete.push(cell.nRow,cell.nCol)}});if(bError)return null}return{aColsToDelete:aColsToDelete,aCellsToDelete:aCellsToDelete}};Range.prototype._shiftLeftRight= function(bLeft,preDeleteAction,displayNameFormatTable){var canShiftRes=this._canShiftLeftRight(bLeft);if(null===canShiftRes)return false;if(preDeleteAction)preDeleteAction();var i,length,colIndex;for(i=0,length=canShiftRes.aColsToDelete.length;i<length;++i){colIndex=canShiftRes.aColsToDelete[i].index;this.worksheet._removeCols(colIndex,colIndex)}for(i=0;i<canShiftRes.aCellsToDelete.length;i+=2)this.worksheet._removeCell(canShiftRes.aCellsToDelete[i],canShiftRes.aCellsToDelete[i+1]);var oBBox=this.bbox; var nWidth=oBBox.c2-oBBox.c1+1;var nRangeType=this._getRangeType(oBBox);var mergeManager=this.worksheet.mergeManager;this.worksheet.workbook.dependencyFormulas.lockRecal();History.Create_NewPoint();History.StartTransaction();var oShiftGet=null;if(false==this.worksheet.workbook.bUndoChanges&&(false==this.worksheet.workbook.bRedoChanges||this.worksheet.workbook.bCollaborativeChanges)){History.LocalChange=true;oShiftGet=mergeManager.shiftGet(this.bbox,true);var aMerged=oShiftGet.elems;if(null!=aMerged.outer&& aMerged.outer.length>0){var bChanged=false;for(i=0,length=aMerged.outer.length;i<length;i++){var elem=aMerged.outer[i];if(!(elem.bbox.c1<oShiftGet.bbox.c1&&oShiftGet.bbox.r1<=elem.bbox.r1&&elem.bbox.r2<=oShiftGet.bbox.r2)){mergeManager.removeElement(elem);bChanged=true}}if(bChanged)oShiftGet=null}History.LocalChange=false}if(bLeft)if(c_oRangeType.Range==nRangeType)this.worksheet._shiftCellsLeft(oBBox);else this.worksheet._removeCols(oBBox.c1,oBBox.c2);else if(c_oRangeType.Range==nRangeType)this.worksheet._shiftCellsRight(oBBox, displayNameFormatTable);else this.worksheet._insertColsBefore(oBBox.c1,nWidth);if(false==this.worksheet.workbook.bUndoChanges&&(false==this.worksheet.workbook.bRedoChanges||this.worksheet.workbook.bCollaborativeChanges)){History.LocalChange=true;mergeManager.shift(this.bbox,!bLeft,true,oShiftGet);this.worksheet.hyperlinkManager.shift(this.bbox,!bLeft,true);History.LocalChange=false}History.EndTransaction();this.worksheet.workbook.dependencyFormulas.unlockRecal();return true};Range.prototype._canShiftUpDown= function(bUp){var aRowsToDelete=[],aCellsToDelete=[];var oBBox=this.bbox;var nRangeType=this._getRangeType(oBBox);if(c_oRangeType.Range!=nRangeType&&c_oRangeType.Row!=nRangeType)return null;var nHeight=oBBox.r2-oBBox.r1+1;if(!bUp&&!this.worksheet.workbook.bUndoChanges&&!this.worksheet.workbook.bRedoChanges){var rangeEdge=this.worksheet.getRange3(gc_nMaxRow0-nHeight+1,oBBox.c1,gc_nMaxRow0,oBBox.c2);var aMerged=this.worksheet.mergeManager.get(rangeEdge.bbox);if(aMerged.all.length>0)return null;var aHyperlink= this.worksheet.hyperlinkManager.get(rangeEdge.bbox);if(aHyperlink.all.length>0)return null;var bError=rangeEdge._setPropertyNoEmpty(function(row){if(null!=row){if(null!=row.xfs&&null!=row.xfs.fill&&row.xfs.fill.notEmpty())return true;aRowsToDelete.push(row.index)}},null,function(cell){if(null!=cell){if(null!=cell.xfs&&null!=cell.xfs.fill&&cell.xfs.fill.notEmpty())return true;if(!cell.isNullText())return true;aCellsToDelete.push(cell.nRow,cell.nCol)}});if(bError)return null}return{aRowsToDelete:aRowsToDelete, aCellsToDelete:aCellsToDelete}};Range.prototype._shiftUpDown=function(bUp,preDeleteAction,displayNameFormatTable){var canShiftRes=this._canShiftUpDown(bUp);if(null===canShiftRes)return false;if(preDeleteAction)preDeleteAction();var i,length,rowIndex;for(i=0,length=canShiftRes.aRowsToDelete.length;i<length;++i){rowIndex=canShiftRes.aRowsToDelete[i];this.worksheet._removeRows(rowIndex,rowIndex)}for(i=0;i<canShiftRes.aCellsToDelete.length;i+=2)this.worksheet._removeCell(canShiftRes.aCellsToDelete[i], canShiftRes.aCellsToDelete[i+1]);var oBBox=this.bbox;var nHeight=oBBox.r2-oBBox.r1+1;var nRangeType=this._getRangeType(oBBox);var mergeManager=this.worksheet.mergeManager;this.worksheet.workbook.dependencyFormulas.lockRecal();History.Create_NewPoint();History.StartTransaction();var oShiftGet=null;if(false==this.worksheet.workbook.bUndoChanges&&(false==this.worksheet.workbook.bRedoChanges||this.worksheet.workbook.bCollaborativeChanges)){History.LocalChange=true;oShiftGet=mergeManager.shiftGet(this.bbox, false);var aMerged=oShiftGet.elems;if(null!=aMerged.outer&&aMerged.outer.length>0){var bChanged=false;for(i=0,length=aMerged.outer.length;i<length;i++){var elem=aMerged.outer[i];if(!(elem.bbox.r1<oShiftGet.bbox.r1&&oShiftGet.bbox.c1<=elem.bbox.c1&&elem.bbox.c2<=oShiftGet.bbox.c2)){mergeManager.removeElement(elem);bChanged=true}}if(bChanged)oShiftGet=null}History.LocalChange=false}if(bUp)if(c_oRangeType.Range==nRangeType)this.worksheet._shiftCellsUp(oBBox);else this.worksheet._removeRows(oBBox.r1, oBBox.r2);else if(c_oRangeType.Range==nRangeType)this.worksheet._shiftCellsBottom(oBBox,displayNameFormatTable);else this.worksheet._insertRowsBefore(oBBox.r1,nHeight);if(false==this.worksheet.workbook.bUndoChanges&&(false==this.worksheet.workbook.bRedoChanges||this.worksheet.workbook.bCollaborativeChanges)){History.LocalChange=true;mergeManager.shift(this.bbox,!bUp,false,oShiftGet);this.worksheet.hyperlinkManager.shift(this.bbox,!bUp,false);History.LocalChange=false}History.EndTransaction();this.worksheet.workbook.dependencyFormulas.unlockRecal(); return true};Range.prototype.setOffset=function(offset){this.bbox.setOffset(offset)};Range.prototype.setOffsetFirst=function(offset){this.bbox.setOffsetFirst(offset)};Range.prototype.setOffsetLast=function(offset){this.bbox.setOffsetLast(offset)};Range.prototype.setOffsetWithAbs=function(){this.bbox.setOffsetWithAbs.apply(this.bbox,arguments)};Range.prototype.intersect=function(range){var oBBox1=this.bbox;var oBBox2=range.bbox;var r1=Math.max(oBBox1.r1,oBBox2.r1);var c1=Math.max(oBBox1.c1,oBBox2.c1); var r2=Math.min(oBBox1.r2,oBBox2.r2);var c2=Math.min(oBBox1.c2,oBBox2.c2);if(r1<=r2&&c1<=c2)return this.worksheet.getRange3(r1,c1,r2,c2);return null};Range.prototype.cleanFormat=function(){History.Create_NewPoint();History.StartTransaction();this.unmerge();this._setPropertyNoEmpty(function(row){row.setStyle(null)},function(col){col.setStyle(null)},function(cell,nRow0,nCol0,nRowStart,nColStart){cell.setStyle(null)});History.EndTransaction()};Range.prototype.cleanText=function(){History.Create_NewPoint(); History.StartTransaction();this._setPropertyNoEmpty(null,null,function(cell,nRow0,nCol0,nRowStart,nColStart){cell.setValue("")});History.EndTransaction()};Range.prototype.cleanAll=function(){History.Create_NewPoint();History.StartTransaction();this.unmerge();var aHyperlinks=this.worksheet.hyperlinkManager.get(this.bbox);for(var i=0,length=aHyperlinks.inner.length;i<length;++i)this.removeHyperlink(aHyperlinks.inner[i]);var oThis=this;this._setPropertyNoEmpty(function(row){row.setStyle(null)},function(col){col.setStyle(null)}, function(cell,nRow0,nCol0,nRowStart,nColStart){oThis.worksheet._removeCell(nRow0,nCol0,cell)});this.worksheet.workbook.dependencyFormulas.calcTree();History.EndTransaction()};Range.prototype.cleanHyperlinks=function(){History.Create_NewPoint();History.StartTransaction();var aHyperlinks=this.worksheet.hyperlinkManager.get(this.bbox);for(var i=0,length=aHyperlinks.inner.length;i<length;++i)this.removeHyperlink(aHyperlinks.inner[i]);History.EndTransaction()};Range.prototype.sort=function(nOption,nStartRowCol, sortColor,opt_guessHeader,opt_by_row,opt_custom_sort){var bbox=this.bbox;if(opt_guessHeader){var bIgnoreFirstRow=ignoreFirstRowSort(this.worksheet,bbox);if(bIgnoreFirstRow){bbox=bbox.clone();bbox.r1++}}var aMerged=this.worksheet.mergeManager.get(bbox);if(aMerged.outer.length>0||aMerged.inner.length>0&&null==_isSameSizeMerged(bbox,aMerged.inner,true))return null;var nMergedWidth=1;var nMergedHeight=1;if(aMerged.inner.length>0){var merged=aMerged.inner[0];if(opt_by_row){nMergedWidth=merged.bbox.c2- merged.bbox.c1+1;nStartRowCol=merged.bbox.r1}else{nMergedHeight=merged.bbox.r2-merged.bbox.r1+1;nStartRowCol=merged.bbox.c1}}this.worksheet.workbook.dependencyFormulas.lockRecal();var oRes=null;var oThis=this;var bAscent=false;if(nOption==Asc.c_oAscSortOptions.Ascending)bAscent=true;var elemObj=this._getSortElems(bbox,nStartRowCol,nOption,sortColor,opt_by_row,opt_custom_sort);var aSortElems=elemObj.aSortElems;var nColFirst0=elemObj.nColFirst0;var nRowFirst0=elemObj.nRowFirst0;var nLastRow0=elemObj.nLastRow0; var nLastCol0=elemObj.nLastCol0;var aSortData=[];var nHiddenCount=0;var oFromArray={};var nNewIndex,oNewElem,i,length;var nColMax=0,nRowMax=0;var nColMin=gc_nMaxCol0,nRowMin=gc_nMaxRow0;var nToMax=0;for(i=0,length=aSortElems.length;i<length;++i){var item=aSortElems[i];if(opt_by_row){nNewIndex=i*nMergedWidth+nColFirst0+nHiddenCount;while(false!=oThis.worksheet.getColHidden(nNewIndex)){nHiddenCount++;nNewIndex=i*nMergedWidth+nColFirst0+nHiddenCount}oNewElem=new UndoRedoData_FromToRowCol(false,item.col, nNewIndex);oFromArray[item.col]=1;if(nColMax<item.col)nColMax=item.col;if(nColMax<nNewIndex)nColMax=nNewIndex;if(nColMin>item.col)nColMin=item.col;if(nColMin>nNewIndex)nColMin=nNewIndex}else{nNewIndex=i*nMergedHeight+nRowFirst0+nHiddenCount;while(false!=oThis.worksheet.getRowHidden(nNewIndex)){nHiddenCount++;nNewIndex=i*nMergedHeight+nRowFirst0+nHiddenCount}oNewElem=new UndoRedoData_FromToRowCol(true,item.row,nNewIndex);oFromArray[item.row]=1;if(nRowMax<item.row)nRowMax=item.row;if(nRowMax<nNewIndex)nRowMax= nNewIndex;if(nRowMin>item.row)nRowMin=item.row;if(nRowMin>nNewIndex)nRowMin=nNewIndex}if(nToMax<nNewIndex)nToMax=nNewIndex;if(oNewElem.from!=oNewElem.to)aSortData.push(oNewElem)}if(aSortData.length>0){var nRowColMin=opt_by_row?nColMin:nRowMin;var nRowColMax=opt_by_row?nColMax:nRowMax;var hiddenFunc=opt_by_row?oThis.worksheet.getColHidden:oThis.worksheet.getRowHidden;for(i=nRowColMin;i<=nRowColMax;++i)if(null==oFromArray[i]&&false==hiddenFunc.apply(oThis.worksheet,[i])){var nFrom=i;var nTo=++nToMax; while(false!=hiddenFunc.apply(oThis.worksheet,[nTo]))nTo=++nToMax;if(nFrom!=nTo){oNewElem=new UndoRedoData_FromToRowCol(false,nFrom,nTo);aSortData.push(oNewElem)}}History.Create_NewPoint();var oSelection=History.GetSelection();if(null!=oSelection){oSelection=oSelection.clone();oSelection.assign(nColFirst0,nRowFirst0,nLastCol0,nLastRow0);History.SetSelection(oSelection);History.SetSelectionRedo(oSelection)}var oUndoRedoBBox=new UndoRedoData_BBox({r1:nRowFirst0,c1:nColFirst0,r2:nLastRow0,c2:nLastCol0}); oRes=new AscCommonExcel.UndoRedoData_SortData(oUndoRedoBBox,aSortData,opt_by_row);this._sortByArray(oUndoRedoBBox,aSortData,null,opt_by_row);var range=opt_by_row?new Asc.Range(nColFirst0,0,nLastCol0,gc_nMaxRow0):new Asc.Range(0,nRowFirst0,gc_nMaxCol0,nLastRow0);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_Sort,this.worksheet.getId(),range,oRes)}this.worksheet.workbook.dependencyFormulas.unlockRecal();return oRes};Range.prototype._getSortElems=function(bbox,nStartRowCol, nOption,sortColor,opt_by_row,opt_custom_sort){var oThis=this;var bAscent=false;if(nOption==Asc.c_oAscSortOptions.Ascending)bAscent=true;var colorFill=nOption===Asc.c_oAscSortOptions.ByColorFill;var colorText=nOption===Asc.c_oAscSortOptions.ByColorFont;var isSortColor=colorFill||colorText;var nRowFirst0=bbox.r1;var nRowLast0=bbox.r2;var nColFirst0=bbox.c1;var nColLast0=bbox.c2;var bWholeCol=false;var bWholeRow=false;if(0==nRowFirst0&&gc_nMaxRow0==nRowLast0)bWholeCol=true;if(0==nColFirst0&&gc_nMaxCol0== nColLast0)bWholeRow=true;var sortConditions,caseSensitive;if(opt_custom_sort&&opt_custom_sort.SortConditions){sortConditions=opt_custom_sort.SortConditions;nStartRowCol=opt_by_row?sortConditions[0].Ref.r1:sortConditions[0].Ref.c1;bAscent=!sortConditions[0].ConditionDescending}if(opt_custom_sort);var nLastRow0,nLastCol0;if(opt_by_row){var oRangeRow=this.worksheet.getRange(new CellAddress(nStartRowCol,nColFirst0,0),new CellAddress(nStartRowCol,nColLast0,0));nLastRow0=nRowLast0;nLastCol0=0;if(true== bWholeCol){nLastRow0=0;this._foreachColNoEmpty(null,function(cell){var nCurRow0=cell.nRow;if(nCurRow0>nLastRow0)nLastRow0=nCurRow0})}}else{var oRangeCol=this.worksheet.getRange(new CellAddress(nRowFirst0,nStartRowCol,0),new CellAddress(nRowLast0,nStartRowCol,0));nLastRow0=0;nLastCol0=nColLast0;if(true==bWholeRow){nLastCol0=0;this._foreachRowNoEmpty(null,function(cell){var nCurCol0=cell.nCol;if(nCurCol0>nLastCol0)nLastCol0=nCurCol0})}}var aMerged=this.worksheet.mergeManager.get(this.bbox);var checkMerged= function(_cell){var res=null;if(aMerged&&aMerged.inner&&aMerged.inner.length>0)for(var i=0;i<aMerged.inner.length;i++)if(aMerged.inner[i].bbox.contains(_cell.nCol,_cell.nRow))if(aMerged.inner[i].bbox.r1===_cell.nRow&&aMerged.inner[i].bbox.c1===_cell.nCol)return true;else return false;return res};var aSortElems=[];var putElem=false;var fAddSortElems=function(oCell,nRow0,nCol0){if(opt_by_row&&!oThis.worksheet.getColHidden(nCol0)||!opt_by_row&&!oThis.worksheet.getRowHidden(nRow0)){if(!opt_by_row&&nLastRow0< nRow0)nLastRow0=nRow0;if(opt_by_row&&nLastCol0<nCol0)nLastCol0=nCol0;var val=oCell.getValueWithoutFormat();if(opt_custom_sort&&false===checkMerged(oCell))return;var colorFillCell,colorsTextCell=null;if(colorFill||opt_custom_sort){var styleCell=oCell.getCompiledStyleCustom(false,true,true);colorFillCell=styleCell!==null&&styleCell.fill?styleCell.fill.bg():null}if(colorText||opt_custom_sort){var value2=oCell.getValue2();for(var n=0;n<value2.length;n++){if(null===colorsTextCell)colorsTextCell=[];colorsTextCell.push(value2[n].format.getColor())}}var nNumber= null;var sText=null;var res;if(""!=val){var nVal=val-0;if(nVal==val)nNumber=nVal;else sText=val;if(opt_by_row)res={col:nCol0,num:nNumber,text:sText,colorFill:colorFillCell,colorsText:colorsTextCell};else res={row:nRow0,num:nNumber,text:sText,colorFill:colorFillCell,colorsText:colorsTextCell}}else if(isSortColor||opt_custom_sort&&(colorFillCell||colorsTextCell))if(opt_by_row)res={col:nCol0,num:nNumber,text:sText,colorFill:colorFillCell,colorsText:colorsTextCell};else res={row:nRow0,num:nNumber,text:sText, colorFill:colorFillCell,colorsText:colorsTextCell};if(!putElem)return res;else if(res)aSortElems.push(res)}};putElem=true;if(opt_by_row)if(nRowFirst0==nStartRowCol)while(0==aSortElems.length&&nStartRowCol<=nLastRow0){if(false==bWholeRow)oRangeRow._foreachNoEmptyByCol(fAddSortElems);else oRangeRow._foreachRowNoEmpty(null,fAddSortElems);if(0==aSortElems.length){nStartRowCol++;oRangeRow=this.worksheet.getRange(new CellAddress(nStartRowCol,nColFirst0,0),new CellAddress(nStartRowCol,nColLast0,0))}}else if(false== bWholeRow)oRangeRow._foreachNoEmptyByCol(fAddSortElems);else oRangeRow._foreachRowNoEmpty(null,fAddSortElems);else if(nColFirst0==nStartRowCol)while(0==aSortElems.length&&nStartRowCol<=nLastCol0){if(false==bWholeCol)oRangeCol._foreachNoEmpty(fAddSortElems);else oRangeCol._foreachColNoEmpty(null,fAddSortElems);if(0==aSortElems.length){nStartRowCol++;oRangeCol=this.worksheet.getRange(new CellAddress(nRowFirst0,nStartRowCol,0),new CellAddress(nRowLast0,nStartRowCol,0))}}else if(false==bWholeCol)oRangeCol._foreachNoEmpty(fAddSortElems); else oRangeCol._foreachColNoEmpty(null,fAddSortElems);function strcmp(str1,str2){return str1==str2?0:str1>str2?1:-1}var colorFillCmp=function(color1,color2,_customCellColor){var res=false;if(colorFill||_customCellColor===true)res=color1!==null&&color2!==null&&color1.rgb===color2.rgb||color1===color2;else if((colorText||_customCellColor===false)&&color1&&color1.length)for(var n=0;n<color1.length;n++)if(color1[n]&&color2!==null&&color1[n].rgb===color2.rgb){res=true;break}return res};var getSortElem= function(row,col){var oCell;oThis.worksheet._getCellNoEmpty(row,col,function(cell){oCell=cell});return oCell?fAddSortElems(oCell,row,col):null};putElem=false;if(isSortColor){var newArrayNeedColor=[];var newArrayAnotherColor=[];for(var i=0;i<aSortElems.length;i++){var color=colorFill?aSortElems[i].colorFill:aSortElems[i].colorsText;if(colorFillCmp(color,sortColor))newArrayNeedColor.push(aSortElems[i]);else newArrayAnotherColor.push(aSortElems[i])}aSortElems=newArrayNeedColor.concat(newArrayAnotherColor)}else aSortElems.sort(function(a, b){var res=0;var nullVal=false;var compare=function(_a,_b,_sortCondition){if(_sortCondition&&(_sortCondition.ConditionSortBy===Asc.ESortBy.sortbyCellColor||_sortCondition.ConditionSortBy===Asc.ESortBy.sortbyFontColor)){if(!_a||!_b)return res;var _isCellColor=_sortCondition.ConditionSortBy===Asc.ESortBy.sortbyCellColor;var _color1=_isCellColor?_a.colorFill:_a.colorsText;var _color2=_isCellColor?_b.colorFill:_b.colorsText;var _sortColor=_isCellColor?_sortCondition.dxf.fill.bg():_sortCondition.dxf.font.getColor(); var cmp1=colorFillCmp(_color1,_sortColor,_isCellColor);var cmp2=colorFillCmp(_color2,_sortColor,_isCellColor);if(cmp1===cmp2)res=0;else if(cmp1&&!cmp2)res=-1;else if(!cmp1&&cmp2)res=1}else if(_a&&null!=_a.text)if(_b&&null!=_b.text){var val1=caseSensitive?_a.text:_a.text.toUpperCase();var val2=caseSensitive?_b.text:_b.text.toUpperCase();res=strcmp(val1,val2)}else if(_b&&null!=_b.num)res=1;else{res=-1;nullVal=true}else if(_a&&null!=_a.num)if(_b&&null!=_b.num)res=_a.num-_b.num;else if(_b&&null!=_b.text)res= -1;else{res=-1;nullVal=true}else if(_b&&(null!=_b.num||null!=_b.text)){res=1;nullVal=true}};compare(a,b,sortConditions?sortConditions[0]:null);if(0==res)if(sortConditions)for(var i=1;i<sortConditions.length;i++){var row=sortConditions[i].Ref.r1;var col=sortConditions[i].Ref.c1;var row1=opt_by_row?row:a.row;var col1=!opt_by_row?col:a.col;var row2=opt_by_row?row:b.row;var col2=!opt_by_row?col:b.col;var tempA=getSortElem(row1,col1);var tempB=getSortElem(row2,col2);compare(tempA,tempB,sortConditions[i]); var tempAscent=!sortConditions[i].ConditionDescending;if(res!=0){if(!tempAscent)res=-res;break}else if(i===sortConditions.length-1&&tempA&&tempB)res=opt_by_row?tempA.col-tempB.col:tempA.row-tempB.row}else res=opt_by_row?a.col-b.col:a.row-b.row;else if(!bAscent&&!nullVal)res=-res;return res});return{aSortElems:aSortElems,nRowFirst0:nRowFirst0,nColFirst0:nColFirst0,nLastRow0:nLastRow0,nLastCol0:nLastCol0}};Range.prototype._sortByArray=function(oBBox,aSortData,bUndo,opt_by_row){var t=this;var height= oBBox.r2-oBBox.r1+1;var oSortedIndexes={};var nFrom,nTo,length,i;for(i=0,length=aSortData.length;i<length;++i){var item=aSortData[i];nFrom=item.from;nTo=item.to;if(true==this.worksheet.workbook.bUndoChanges){nFrom=item.to;nTo=item.from}oSortedIndexes[nFrom]=nTo}var aSortedHyperlinks=[],hyp;if(false==this.worksheet.workbook.bUndoChanges&&(false==this.worksheet.workbook.bRedoChanges||this.worksheet.workbook.bCollaborativeChanges)){History.LocalChange=true;var aHyperlinks=this.worksheet.hyperlinkManager.get(this.bbox); for(i=0,length=aHyperlinks.inner.length;i<length;i++){var elem=aHyperlinks.inner[i];hyp=elem.data;if(hyp.Ref.isOneCell()){nFrom=opt_by_row?elem.bbox.c1:elem.bbox.r1;nTo=oSortedIndexes[nFrom];if(null!=nTo){this.worksheet.hyperlinkManager.removeElement(elem);var oNewHyp=hyp.clone();if(opt_by_row)oNewHyp.Ref.setOffset(new AscCommon.CellBase(0,nTo-nFrom));else oNewHyp.Ref.setOffset(new AscCommon.CellBase(nTo-nFrom,0));aSortedHyperlinks.push(oNewHyp)}}}History.LocalChange=false}var tempRange=this.worksheet.getRange3(oBBox.r1, oBBox.c1,oBBox.r2,oBBox.c2);var func=opt_by_row?tempRange._foreachNoEmptyByCol:tempRange._foreachNoEmpty;func.apply(tempRange,[function(cell){var ws=t.worksheet;var formula=cell.getFormulaParsed();if(formula){var cellWithFormula=formula.getParent();var nFrom=opt_by_row?cell.nCol:cell.nRow;var nTo=oSortedIndexes[nFrom];if(null!=nTo){if(opt_by_row)cell.changeOffset(new AscCommon.CellBase(0,nTo-nFrom),true,true,true);else cell.changeOffset(new AscCommon.CellBase(nTo-nFrom,0),true,true,true);formula= cell.getFormulaParsed();cellWithFormula=formula.getParent();if(opt_by_row)cellWithFormula.nCol=nTo;else cellWithFormula.nRow=nTo}ws.workbook.dependencyFormulas.addToChangedCell(cellWithFormula)}}]);var tempSheetMemory,nIndexFrom,nIndexTo,j;if(opt_by_row){tempSheetMemory=[];for(j in oSortedIndexes){nIndexFrom=j-0;nIndexTo=oSortedIndexes[j];var sheetMemoryFrom=this.worksheet.getColData(nIndexFrom);var sheetMemoryTo=this.worksheet.getColData(nIndexTo);tempSheetMemory[nIndexTo]=new SheetMemory(g_nCellStructSize, height);tempSheetMemory[nIndexTo].copyRange(sheetMemoryTo,oBBox.r1,0,height);if(tempSheetMemory[nIndexFrom])sheetMemoryTo.copyRange(tempSheetMemory[nIndexFrom],0,oBBox.r1,height);else sheetMemoryTo.copyRange(sheetMemoryFrom,oBBox.r1,oBBox.r1,height)}}else{tempSheetMemory=new SheetMemory(g_nCellStructSize,height);for(i=oBBox.c1;i<=oBBox.c2;++i){var sheetMemory=this.worksheet.getColDataNoEmpty(i);if(sheetMemory){tempSheetMemory.copyRange(sheetMemory,oBBox.r1,0,height);for(j in oSortedIndexes){nIndexFrom= j-0;nIndexTo=oSortedIndexes[j];tempSheetMemory.copyRange(sheetMemory,nIndexFrom,nIndexTo-oBBox.r1,1)}sheetMemory.copyRange(tempSheetMemory,0,oBBox.r1,height)}}}this.worksheet.workbook.dependencyFormulas.addToChangedRange(this.worksheet.getId(),new Asc.Range(oBBox.c1,oBBox.r1,oBBox.c2,oBBox.r2));this.worksheet.workbook.dependencyFormulas.calcTree();if(false==this.worksheet.workbook.bUndoChanges&&(false==this.worksheet.workbook.bRedoChanges||this.worksheet.workbook.bCollaborativeChanges)){History.LocalChange= true;if(aSortedHyperlinks.length>0)for(i=0,length=aSortedHyperlinks.length;i<length;i++){hyp=aSortedHyperlinks[i];this.worksheet.hyperlinkManager.add(hyp.Ref.getBBox0(),hyp)}History.LocalChange=false}};function _isSameSizeMerged(bbox,aMerged,checkProportion){var oRes=null;var nWidth=null;var nHeight=null;for(var i=0,length=aMerged.length;i<length;i++){var mergedBBox=aMerged[i].bbox;var nCurWidth=mergedBBox.c2-mergedBBox.c1+1;var nCurHeight=mergedBBox.r2-mergedBBox.r1+1;if(null==nWidth||null==nHeight){nWidth= nCurWidth;nHeight=nCurHeight}else if(nCurWidth!=nWidth||nCurHeight!=nHeight){nWidth=null;nHeight=null;break}}if(null!=nWidth&&null!=nHeight){var getRowColArr=function(byCol){var _aRowColTest=byCol?new Array(nBBoxWidth):new Array(nBBoxHeight);for(var i=0,length=aMerged.length;i<length;i++){var merged=aMerged[i];var j;if(byCol)for(j=merged.bbox.c1;j<=merged.bbox.c2;j++)_aRowColTest[j-bbox.c1]=1;else for(j=merged.bbox.r1;j<=merged.bbox.r2;j++)_aRowColTest[j-bbox.r1]=1}return _aRowColTest};var checkArr= function(_aRowColTest){var _res=null;var bExistNull=false;for(var i=0,length=_aRowColTest.length;i<length;i++)if(null==_aRowColTest[i]){bExistNull=true;break}if(!bExistNull)_res=true;return _res};var nBBoxWidth=bbox.c2-bbox.c1+1;var nBBoxHeight=bbox.r2-bbox.r1+1;if(checkProportion&&nBBoxWidth%nWidth===0&&nBBoxHeight%nHeight===0){aRowColTest=getRowColArr();bRes=checkArr(aRowColTest);if(bRes){aRowColTest=getRowColArr(true);bRes=checkArr(aRowColTest)}if(bRes)oRes={width:nWidth,height:nHeight}}else if(nBBoxWidth== nWidth||nBBoxHeight==nHeight){var bRes=false;var aRowColTest=null;if(nBBoxWidth==nWidth&&nBBoxHeight==nHeight)bRes=true;else if(nBBoxWidth==nWidth)aRowColTest=getRowColArr();else if(nBBoxHeight==nHeight)aRowColTest=getRowColArr(true);if(null!=aRowColTest)bRes=checkArr(aRowColTest);if(bRes)oRes={width:nWidth,height:nHeight}}}return oRes}function _canPromote(from,wsFrom,to,wsTo,bIsPromote,nWidth,nHeight,bVertical,nIndex){var oRes={oMergedFrom:null,oMergedTo:null,to:to};if(!bIsPromote||!(true==bVertical&& nIndex>=0&&nIndex<nHeight||false==bVertical&&nIndex>=0&&nIndex<nWidth))if(null!=to){var oMergedTo=wsTo.mergeManager.get(to);if(oMergedTo.outer.length>0)oRes=null;else{var oMergedFrom=wsFrom.mergeManager.get(from);oRes.oMergedFrom=oMergedFrom;if(oMergedTo.inner.length>0){oRes.oMergedTo=oMergedTo;if(bIsPromote)if(oMergedFrom.inner.length>0){var oSizeFrom=_isSameSizeMerged(from,oMergedFrom.inner);var oSizeTo=_isSameSizeMerged(to,oMergedTo.inner);if(!(null!=oSizeFrom&&null!=oSizeTo&&oSizeTo.width==oSizeFrom.width&& oSizeTo.height==oSizeFrom.height))oRes=null}else oRes=null}}}return oRes}function preparePromoteFromTo(from,to){var bSuccess=true;if(to.isOneCell())to.setOffsetLast(new AscCommon.CellBase(from.r2-from.r1-(to.r2-to.r1),from.c2-from.c1-(to.c2-to.c1)));if(!from.isIntersect(to)){var bFromWholeCol=0==from.c1&&gc_nMaxCol0==from.c2;var bFromWholeRow=0==from.r1&&gc_nMaxRow0==from.r2;var bToWholeCol=0==to.c1&&gc_nMaxCol0==to.c2;var bToWholeRow=0==to.r1&&gc_nMaxRow0==to.r2;bSuccess=bFromWholeCol===bToWholeCol&& bFromWholeRow===bToWholeRow}else bSuccess=false;return bSuccess}function promoteFromTo(from,wsFrom,to,wsTo){var bVertical=true;var nIndex=1;var oCanPromote=_canPromote(from,wsFrom,to,wsTo,false,1,1,bVertical,nIndex);if(null!=oCanPromote){History.Create_NewPoint();var oSelection=History.GetSelection();if(null!=oSelection){oSelection=oSelection.clone();oSelection.assign(from.c1,from.r1,from.c2,from.r2);History.SetSelection(oSelection)}var oSelectionRedo=History.GetSelectionRedo();if(null!=oSelectionRedo){oSelectionRedo= oSelectionRedo.clone();oSelectionRedo.assign(to.c1,to.r1,to.c2,to.r2);History.SetSelectionRedo(oSelectionRedo)}wsTo.mergeManager.remove(to,true);_promoteFromTo(from,wsFrom,to,wsTo,false,oCanPromote,false,bVertical,nIndex)}}Range.prototype.canPromote=function(bCtrl,bVertical,nIndex){var oBBox=this.bbox;var nWidth=oBBox.c2-oBBox.c1+1;var nHeight=oBBox.r2-oBBox.r1+1;var bWholeCol=false;var bWholeRow=false;if(0==oBBox.r1&&gc_nMaxRow0==oBBox.r2)bWholeCol=true;if(0==oBBox.c1&&gc_nMaxCol0==oBBox.c2)bWholeRow= true;if(bWholeCol&&bWholeRow||true==bVertical&&bWholeCol||false==bVertical&&bWholeRow)return null;var oPromoteAscRange=null;if(0==nIndex)oPromoteAscRange=new Asc.Range(oBBox.c1,oBBox.r1,oBBox.c2,oBBox.r2);else if(bVertical)if(nIndex>0)if(nIndex>=nHeight)oPromoteAscRange=new Asc.Range(oBBox.c1,oBBox.r2+1,oBBox.c2,oBBox.r1+nIndex);else oPromoteAscRange=new Asc.Range(oBBox.c1,oBBox.r1+nIndex,oBBox.c2,oBBox.r2);else oPromoteAscRange=new Asc.Range(oBBox.c1,oBBox.r1+nIndex,oBBox.c2,oBBox.r1-1);else if(nIndex> 0)if(nIndex>=nWidth)oPromoteAscRange=new Asc.Range(oBBox.c2+1,oBBox.r1,oBBox.c1+nIndex,oBBox.r2);else oPromoteAscRange=new Asc.Range(oBBox.c1+nIndex,oBBox.r1,oBBox.c2,oBBox.r2);else oPromoteAscRange=new Asc.Range(oBBox.c1+nIndex,oBBox.r1,oBBox.c1-1,oBBox.r2);return _canPromote(oBBox,this.worksheet,oPromoteAscRange,this.worksheet,true,nWidth,nHeight,bVertical,nIndex)};Range.prototype.promote=function(bCtrl,bVertical,nIndex,oCanPromote){if(!oCanPromote)oCanPromote=this.canPromote(bCtrl,bVertical,nIndex); var oBBox=this.bbox;var nWidth=oBBox.c2-oBBox.c1+1;var nHeight=oBBox.r2-oBBox.r1+1;History.Create_NewPoint();var oSelection=History.GetSelection();if(null!=oSelection){oSelection=oSelection.clone();oSelection.assign(oBBox.c1,oBBox.r1,oBBox.c2,oBBox.r2);History.SetSelection(oSelection)}var oSelectionRedo=History.GetSelectionRedo();if(null!=oSelectionRedo){oSelectionRedo=oSelectionRedo.clone();if(0==nIndex)oSelectionRedo.assign(oBBox.c1,oBBox.r1,oBBox.c2,oBBox.r2);else if(bVertical)if(nIndex>0)if(nIndex>= nHeight)oSelectionRedo.assign(oBBox.c1,oBBox.r1,oBBox.c2,oBBox.r1+nIndex);else oSelectionRedo.assign(oBBox.c1,oBBox.r1,oBBox.c2,oBBox.r1+nIndex-1);else oSelectionRedo.assign(oBBox.c1,oBBox.r1+nIndex,oBBox.c2,oBBox.r2);else if(nIndex>0)if(nIndex>=nWidth)oSelectionRedo.assign(oBBox.c1,oBBox.r1,oBBox.c1+nIndex,oBBox.r2);else oSelectionRedo.assign(oBBox.c1,oBBox.r1,oBBox.c1+nIndex-1,oBBox.r2);else oSelectionRedo.assign(oBBox.c1+nIndex,oBBox.r1,oBBox.c2,oBBox.r2);History.SetSelectionRedo(oSelectionRedo)}_promoteFromTo(oBBox, this.worksheet,oCanPromote.to,this.worksheet,true,oCanPromote,bCtrl,bVertical,nIndex)};function _promoteFromTo(from,wsFrom,to,wsTo,bIsPromote,oCanPromote,bCtrl,bVertical,nIndex){var wb=wsFrom.workbook;wb.dependencyFormulas.lockRecal();History.StartTransaction();var oldExcludeHiddenRows=wsFrom.bExcludeHiddenRows;if(wsFrom.autoFilters.bIsExcludeHiddenRows(from,wsFrom.selectionRange.activeCell))wsFrom.excludeHiddenRows(true);var toRange=wsTo.getRange3(to.r1,to.c1,to.r2,to.c2);var fromRange=wsFrom.getRange3(from.r1, from.c1,from.r2,from.c2);var bChangeRowColProp=false;var nLastCol=from.c2;if(0==from.c1&&gc_nMaxCol0==from.c2){var aRowProperties=[];nLastCol=0;fromRange._foreachRowNoEmpty(function(row){if(!row.isEmptyProp())aRowProperties.push({index:row.index-from.r1,prop:row.getHeightProp(),style:row.getStyle()})},function(cell){var nCurCol0=cell.nCol;if(nCurCol0>nLastCol)nLastCol=nCurCol0});if(aRowProperties.length>0){bChangeRowColProp=true;var nCurCount=0;var nCurIndex=0;while(true){for(var i=0,length=aRowProperties.length;i< length;++i){var propElem=aRowProperties[i];nCurIndex=to.r1+nCurCount*(from.r2-from.r1+1)+propElem.index;if(nCurIndex>to.r2)break;else wsTo._getRow(nCurIndex,function(row){if(null!=propElem.style)row.setStyle(propElem.style);if(null!=propElem.prop){var oNewProps=propElem.prop;var oOldProps=row.getHeightProp();if(false===oOldProps.isEqual(oNewProps)){row.setHeightProp(oNewProps);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_RowProp,wsTo.getId(),row._getUpdateRange(),new UndoRedoData_IndexSimpleProp(nCurIndex, true,oOldProps,oNewProps))}}})}nCurCount++;if(nCurIndex>to.r2)break}}}var nLastRow=from.r2;if(0==from.r1&&gc_nMaxRow0==from.r2){var aColProperties=[];nLastRow=0;fromRange._foreachColNoEmpty(function(col){if(!col.isEmpty())aColProperties.push({index:col.index-from.c1,prop:col.getWidthProp(),style:col.getStyle()})},function(cell){var nCurRow0=cell.nRow;if(nCurRow0>nLastRow)nLastRow=nCurRow0});if(aColProperties.length>0){bChangeRowColProp=true;var nCurCount=0;var nCurIndex=0;while(true){for(var i=0, length=aColProperties.length;i<length;++i){var propElem=aColProperties[i];nCurIndex=to.c1+nCurCount*(from.c2-from.c1+1)+propElem.index;if(nCurIndex>to.c2)break;else{var col=wsTo._getCol(nCurIndex);if(null!=propElem.style)col.setStyle(propElem.style);if(null!=propElem.prop){var oNewProps=propElem.prop;var oOldProps=col.getWidthProp();if(false==oOldProps.isEqual(oNewProps)){col.setWidthProp(oNewProps);wsTo.initColumn(col);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_ColProp, wsTo.getId(),new Asc.Range(nCurIndex,0,nCurIndex,gc_nMaxRow0),new UndoRedoData_IndexSimpleProp(nCurIndex,false,oOldProps,oNewProps))}}}}nCurCount++;if(nCurIndex>to.c2)break}}}if(bChangeRowColProp)wb.handlers.trigger("changeWorksheetUpdate",wsTo.getId());if(nLastCol!=from.c2||nLastRow!=from.r2){var offset=new AscCommon.CellBase(nLastRow-from.r2,nLastCol-from.c2);toRange.setOffsetLast(offset);to=toRange.getBBox0();fromRange.setOffsetLast(offset);from=fromRange.getBBox0()}var nWidth=from.c2-from.c1+ 1;var nHeight=from.r2-from.r1+1;if(bIsPromote&&nIndex>=0&&(true==bVertical&&nHeight>nIndex||false==bVertical&&nWidth>nIndex))toRange.cleanText();else{if(bIsPromote)toRange.cleanAll();else toRange.cleanFormat();var bReverse=false;if(nIndex<0)bReverse=true;var oPromoteHelper=new PromoteHelper(bVertical,bReverse,from);fromRange._foreachNoEmpty(function(oCell,nRow0,nCol0,nRowStart0,nColStart0){if(null!=oCell){var nVal=null;var bDelimiter=false;var sPrefix=null;var padding=0;var bDate=false;if(bIsPromote)if(!oCell.isFormula()){var sValue= oCell.getValueWithoutFormat();if(""!=sValue){bDelimiter=true;var nType=oCell.getType();if(CellValueType.Number==nType||CellValueType.String==nType)if(CellValueType.Number==nType)nVal=sValue-0;else{var nEndIndex=sValue.length;for(var k=sValue.length-1;k>=0;--k){var sCurChart=sValue[k];if("0"<=sCurChart&&sCurChart<="9")nEndIndex--;else break}if(sValue.length!=nEndIndex){sPrefix=sValue.substring(0,nEndIndex);var sNumber=sValue.substring(nEndIndex);nVal=sNumber-0;padding=sNumber[0]==="0"?sNumber.length: 0}}if(null!=oCell.xfs&&null!=oCell.xfs.num&&null!=oCell.xfs.num.getFormat()){var numFormat=oNumFormatCache.get(oCell.xfs.num.getFormat());if(numFormat.isDateTimeFormat())bDate=true}if(null!=nVal)bDelimiter=false}}else bDelimiter=true;oPromoteHelper.add(nRow0-nRowStart0,nCol0-nColStart0,nVal,bDelimiter,sPrefix,padding,bDate,oCell.duplicate())}});var bCopy=false;if(bCtrl)bCopy=true;if(1==nWidth&&1==nHeight&&oPromoteHelper.isOnlyIntegerSequence())bCopy=!bCopy;oPromoteHelper.finishAdd(bCopy);var nStartRow, nEndRow,nStartCol,nEndCol,nColDx,bRowFirst;if(bVertical){nStartRow=to.c1;nEndRow=to.c2;bRowFirst=false;if(bReverse){nStartCol=to.r2;nEndCol=to.r1;nColDx=-1}else{nStartCol=to.r1;nEndCol=to.r2;nColDx=1}}else{nStartRow=to.r1;nEndRow=to.r2;bRowFirst=true;if(bReverse){nStartCol=to.c2;nEndCol=to.c1;nColDx=-1}else{nStartCol=to.c1;nEndCol=to.c2;nColDx=1}}var addedFormulasArray=[];var isAddFormulaArray=function(arrayRef){var res=false;for(var n=0;n<addedFormulasArray.length;n++)if(addedFormulasArray[n].isEqual(arrayRef)){res= true;break}return res};for(var i=nStartRow;i<=nEndRow;i++){oPromoteHelper.setIndex(i-nStartRow);for(var j=nStartCol;(nStartCol-j)*(nEndCol-j)<=0;j+=nColDx){if(bVertical&&wsTo.bExcludeHiddenRows&&wsTo.getRowHidden(j))continue;var data=oPromoteHelper.getNext();if(null!=data&&(data.oAdditional||false==bCopy&&null!=data.nCurValue)){var oFromCell=data.oAdditional;var nRow=bRowFirst?i:j;var nCol=bRowFirst?j:i;wsTo._getCell(nRow,nCol,function(oCopyCell){if(bIsPromote)if(false==bCopy&&null!=data.nCurValue){var oCellValue= new AscCommonExcel.CCellValue;if(null!=data.sPrefix){var sVal=data.sPrefix;var sNumber=data.nCurValue.toString();if(sNumber.length<data.padding)sNumber="0".repeat(data.padding-sNumber.length)+sNumber;sVal+=sNumber;oCellValue.text=sVal;oCellValue.type=CellValueType.String}else{oCellValue.number=data.nCurValue;oCellValue.type=CellValueType.Number}oCopyCell.setValueData(new UndoRedoData_CellValueData(null,oCellValue))}else if(null!=oFromCell)if(!oFromCell.isFormula())oCopyCell.setValueData(oFromCell.getValueData()); else{var fromFormulaParsed=oFromCell.getFormulaParsed();var formulaArrayRef=fromFormulaParsed.getArrayFormulaRef();var _p_,offset,offsetArray,assemb;if(formulaArrayRef){var intersectionFrom=from.intersection(formulaArrayRef);if(intersectionFrom)if(intersectionFrom.c1===oFromCell.nCol&&intersectionFrom.r1===oFromCell.nRow||intersectionFrom.c2===oFromCell.nCol&&intersectionFrom.r2===oFromCell.nRow){offsetArray=oCopyCell.getOffset2(oFromCell.getName());intersectionFrom.setOffset(offsetArray);var intersectionTo= intersectionFrom.intersection(to);if(intersectionTo&&!isAddFormulaArray(intersectionTo)){addedFormulasArray.push(intersectionTo);offset=new AscCommon.CellBase(intersectionTo.r1-formulaArrayRef.r1,intersectionTo.c1-formulaArrayRef.c1);_p_=oFromCell.getFormulaParsed().clone(null,oFromCell,this);_p_.changeOffset(offset);var rangeFormulaArray=oCopyCell.ws.getRange3(intersectionTo.r1,intersectionTo.c1,intersectionTo.r2,intersectionTo.c2);rangeFormulaArray.setValue("="+_p_.assemble(true),function(r){}, null,intersectionTo);History.Add(AscCommonExcel.g_oUndoRedoArrayFormula,AscCH.historyitem_ArrayFromula_AddFormula,oCopyCell.ws.getId(),new Asc.Range(intersectionTo.c1,intersectionTo.r1,intersectionTo.c2,intersectionTo.r2),new AscCommonExcel.UndoRedoData_ArrayFormula(intersectionTo,"="+oCopyCell.getFormulaParsed().assemble(true)))}}}else{_p_=oFromCell.getFormulaParsed().clone(null,oFromCell,this);offset=oCopyCell.getOffset2(oFromCell.getName());assemb=_p_.changeOffset(offset).assemble(true);oCopyCell.setFormula(assemb)}}if(null!= oFromCell){oCopyCell.setStyle(oFromCell.getStyle());if(bIsPromote)oCopyCell.setType(oFromCell.getType())}})}}}if(bIsPromote)wb.dependencyFormulas.addToChangedRange(wsTo.Id,to);var nDx=from.c2-from.c1+1;var nDy=from.r2-from.r1+1;var oMergedFrom=oCanPromote.oMergedFrom;if(null!=oMergedFrom&&oMergedFrom.all.length>0)for(var i=to.c1;i<=to.c2;i+=nDx)for(var j=to.r1;j<=to.r2;j+=nDy)for(var k=0,length3=oMergedFrom.all.length;k<length3;k++){var oMergedBBox=oMergedFrom.all[k].bbox;var oNewMerged=new Asc.Range(i+ oMergedBBox.c1-from.c1,j+oMergedBBox.r1-from.r1,i+oMergedBBox.c2-from.c1,j+oMergedBBox.r2-from.r1);if(to.contains(oNewMerged.c1,oNewMerged.r1)){if(to.c2<oNewMerged.c2)oNewMerged.c2=to.c2;if(to.r2<oNewMerged.r2)oNewMerged.r2=to.r2;if(!oNewMerged.isOneCell())wsTo.mergeManager.add(oNewMerged,1)}}if(bIsPromote){var oHyperlinks=wsFrom.hyperlinkManager.get(from);if(oHyperlinks.inner.length>0)for(var i=to.c1;i<=to.c2;i+=nDx)for(var j=to.r1;j<=to.r2;j+=nDy)for(var k=0,length3=oHyperlinks.inner.length;k<length3;k++){var oHyperlink= oHyperlinks.inner[k];var oHyperlinkBBox=oHyperlink.bbox;var oNewHyperlink=new Asc.Range(i+oHyperlinkBBox.c1-from.c1,j+oHyperlinkBBox.r1-from.r1,i+oHyperlinkBBox.c2-from.c1,j+oHyperlinkBBox.r2-from.r1);if(to.containsRange(oNewHyperlink))wsTo.hyperlinkManager.add(oNewHyperlink,oHyperlink.data.clone())}var aDataValidations;if(wsFrom.dataValidations&&wsTo.dataValidations){wsTo.clearDataValidation([to],true);aDataValidations=wsFrom.dataValidations.getIntersectionByRange(from)}if(aDataValidations&&aDataValidations.length> 0){var newDataValidations=[];for(var i=to.c1;i<=to.c2;i+=nDx)for(var j=to.r1;j<=to.r2;j+=nDy)for(var k=0,length3=aDataValidations.length;k<length3;k++){var oDataValidation=aDataValidations[k];var ranges=oDataValidation.ranges;for(var n=0;n<ranges.length;n++){var _newRange=new Asc.Range(i+ranges[n].c1-from.c1,j+ranges[n].r1-from.r1,i+ranges[n].c2-from.c1,j+ranges[n].r2-from.r1);if(to.containsRange(_newRange)){if(!newDataValidations[k])newDataValidations[k]=[];newDataValidations[k].push(_newRange)}}}if(newDataValidations&& newDataValidations.length)for(var i=0;i<newDataValidations.length;i++)if(newDataValidations[i]&&newDataValidations[i].length){var fromDataValidation=wsFrom.getDataValidationById(aDataValidations[i].id);if(fromDataValidation){fromDataValidation=fromDataValidation.data;var toDataValidation=fromDataValidation.clone();toDataValidation.ranges=fromDataValidation.ranges.concat(newDataValidations[i]);wsTo.dataValidations.change(wsTo,fromDataValidation,toDataValidation,true)}}}}}wsFrom.excludeHiddenRows(oldExcludeHiddenRows); History.EndTransaction();wb.dependencyFormulas.unlockRecal()}Range.prototype.createCellOnRowColCross=function(){var oThis=this;var bbox=this.bbox;var nRangeType=this._getRangeType(bbox);if(c_oRangeType.Row==nRangeType)this._foreachColNoEmpty(function(col){if(null!=col.xfs)for(var i=bbox.r1;i<=bbox.r2;++i)oThis.worksheet._getCell(i,col.index,function(){})},null);else if(c_oRangeType.Col==nRangeType)this._foreachRowNoEmpty(function(row){if(null!=row.xfs)for(var i=bbox.c1;i<=bbox.c2;++i)oThis.worksheet._getCell(row.index, i,function(){})},null)};Range.prototype.getLeftTopCell=function(fAction){return this.worksheet._getCell(this.bbox.r1,this.bbox.c1,fAction)};Range.prototype.getLeftTopCellNoEmpty=function(fAction){return this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1,fAction)};function RowIterator(){}RowIterator.prototype.init=function(ws,r1,c1,c2){this.ws=ws;this.cell=new Cell(ws);this.c1=c1;this.c2=Math.min(c2,ws.getColDataLength()-1);this.indexRow=r1;this.indexCol=0;this.colDatas=[];this.colDatasIndex= [];for(var i=this.c1;i<=this.c2;i++){var colData=this.ws.getColDataNoEmpty(i);if(colData){this.colDatas.push(colData);this.colDatasIndex.push(i)}}this.ws.workbook.loadCells.push(this.cell)};RowIterator.prototype.release=function(){this.cell.saveContent(true);this.ws.workbook.loadCells.pop()};RowIterator.prototype.setRow=function(index){this.indexRow=index;this.indexCol=0};RowIterator.prototype.next=function(){var wb=this.ws.workbook;this.cell.saveContent(true);for(;this.indexCol<this.colDatasIndex.length;this.indexCol++){var colData= this.colDatas[this.indexCol];var nCol=this.colDatasIndex[this.indexCol];if(colData.hasSize(this.indexRow)){var targetCell=null;for(var k=0;k<wb.loadCells.length-1;++k){var elem=wb.loadCells[k];if(elem.nRow==this.indexRow&&elem.nCol==nCol&&this.ws===elem.ws){targetCell=elem;break}}if(null===targetCell){if(this.cell.loadContent(this.indexRow,nCol,colData)){this.indexCol++;return this.cell}}else{this.indexCol++;return targetCell}}else{var endIndex=this.indexCol+1;while(endIndex<this.colDatasIndex.length&& !this.colDatas[endIndex].hasSize(this.indexRow))endIndex++;this.colDatas.splice(this.indexCol,endIndex-this.indexCol);this.colDatasIndex.splice(this.indexCol,endIndex-this.indexCol);this.indexCol--}}};function PromoteHelper(bVerical,bReverse,bbox){this.bVerical=bVerical;this.bReverse=bReverse;this.bbox=bbox;this.oDataRow={};this.oCurRow=null;this.nCurColIndex=null;this.nRowLength=0;this.nColLength=0;if(this.bVerical){this.nRowLength=this.bbox.c2-this.bbox.c1+1;this.nColLength=this.bbox.r2-this.bbox.r1+ 1}else{this.nRowLength=this.bbox.r2-this.bbox.r1+1;this.nColLength=this.bbox.c2-this.bbox.c1+1}}PromoteHelper.prototype={add:function(nRow,nCol,nVal,bDelimiter,sPrefix,padding,bDate,oAdditional){if(this.bVerical){var temp=nRow;nRow=nCol;nCol=temp}if(this.bReverse)nCol=this.nColLength-nCol-1;var row=this.oDataRow[nRow];if(null==row){row={};this.oDataRow[nRow]=row}row[nCol]={nCol:nCol,nVal:nVal,bDelimiter:bDelimiter,sPrefix:sPrefix,padding:padding,bDate:bDate,oAdditional:oAdditional,oSequence:null, nCurValue:null}},isOnlyIntegerSequence:function(){var bRes=true;var bEmpty=true;for(var i in this.oDataRow){var row=this.oDataRow[i];for(var j in row){var data=row[j];bEmpty=false;if(!(null!=data.nVal&&true!=data.bDate&&null==data.sPrefix)){bRes=false;break}}if(!bRes)break}if(bEmpty)bRes=false;return bRes},_promoteSequence:function(aDigits){var a0=0;var a1=0;var nX=0;if(1==aDigits.length){nX=1;a1=1;a0=aDigits[0].y}else{var nN=aDigits.length;var nXi=0;var nXiXi=0;var dYi=0;var dYiXi=0;for(var i=0, length=aDigits.length;i<length;++i){var data=aDigits[i];nX=data.x;var dValue=data.y;nXi+=nX;nXiXi+=nX*nX;dYi+=dValue;dYiXi+=dValue*nX}nX++;var dD=nN*nXiXi-nXi*nXi;var dD1=dYi*nXiXi-nXi*dYiXi;var dD2=nN*dYiXi-dYi*nXi;a0=dD1/dD;a1=dD2/dD}return{a0:a0,a1:a1,nX:nX}},_addSequenceToRow:function(nRowIndex,aSortRowIndex,row,aCurSequence){if(aCurSequence.length>0){var oFirstData=aCurSequence[0];var bCanPromote=true;if(1==aCurSequence.length){var bVisitRowIndex=false;var oVisitData=null;for(var i=0,length= aSortRowIndex.length;i<length;i++){var nCurRowIndex=aSortRowIndex[i];if(nRowIndex==nCurRowIndex){bVisitRowIndex=true;if(oVisitData&&oFirstData.sPrefix==oVisitData.sPrefix&&oFirstData.bDate==oVisitData.bDate){bCanPromote=false;break}}else{var oCurRow=this.oDataRow[nCurRowIndex];if(oCurRow){var data=oCurRow[oFirstData.nCol];if(null!=data)if(null!=data.nVal){oVisitData=data;if(bVisitRowIndex){if(oFirstData.sPrefix==oVisitData.sPrefix&&oFirstData.bDate==oVisitData.bDate)bCanPromote=false;break}}else if(data.bDelimiter){oVisitData= null;if(bVisitRowIndex)break}}}}}if(bCanPromote){var nMinIndex=null;var nMaxIndex=null;var bValidIndexDif=true;var nPrevX=null;var nPrevVal=null;var nIndexDif=null;var nValueDif=null;var nMaxPadding=0;for(var i=0,length=aCurSequence.length;i<length;i++){var data=aCurSequence[i];var nCurX=data.nCol;if(null==nMinIndex||null==nMaxIndex)nMinIndex=nMaxIndex=nCurX;else{if(nCurX<nMinIndex)nMinIndex=nCurX;if(nCurX>nMaxIndex)nMaxIndex=nCurX}if(bValidIndexDif)if(null!=nPrevX&&null!=nPrevVal){var nCurDif=nCurX- nPrevX;var nCurValDif=data.nVal-nPrevVal;if(null==nIndexDif||null==nCurValDif){nIndexDif=nCurDif;nValueDif=nCurValDif}else if(nIndexDif!=nCurDif||nValueDif!=nCurValDif){nIndexDif=null;bValidIndexDif=false}}nMaxPadding=Math.max(nMaxPadding,data.padding);nPrevX=nCurX;nPrevVal=data.nVal}var bWithSpace=false;if(null!=nIndexDif){nIndexDif=Math.abs(nIndexDif);if(nIndexDif>1)bWithSpace=true}var bExistSpace=false;nPrevX=null;var aDigits=[];for(var i=0,length=aCurSequence.length;i<length;i++){var data=aCurSequence[i]; data.padding=nMaxPadding;var nCurX=data.nCol;var x=nCurX-nMinIndex;if(null!=nIndexDif&&nIndexDif>0)x/=nIndexDif;if(null!=nPrevX&&nCurX-nPrevX>1)bExistSpace=true;var y=data.nVal;if(data.bDate)y=parseInt(y);aDigits.push({x:x,y:y});nPrevX=nCurX}if(aDigits.length>0){var oSequence=this._promoteSequence(aDigits);if(1==aDigits.length&&this.bReverse)oSequence.a1*=-1;var bIsIntegerSequence=oSequence.a1!=parseInt(oSequence.a1);if(!((null!=oFirstData.sPrefix||true==oFirstData.bDate)&&bIsIntegerSequence))if(false== bWithSpace&&bExistSpace)for(var i=nMinIndex;i<=nMaxIndex;i++){var data=row[i];if(null==data){data={nCol:i,nVal:null,bDelimiter:oFirstData.bDelimiter,sPrefix:oFirstData.sPrefix,bDate:oFirstData.bDate,oAdditional:null,oSequence:null,nCurValue:null};row[i]=data}data.oSequence=oSequence}else for(var i=0,length=aCurSequence.length;i<length;i++){var nCurX=aCurSequence[i].nCol;if(null!=nCurX)row[nCurX].oSequence=oSequence}}}}},finishAdd:function(bCopy){if(true!=bCopy){var aSortRowIndex=[];for(var i in this.oDataRow)aSortRowIndex.push(i- 0);aSortRowIndex.sort(fSortAscending);for(var i=0,length=aSortRowIndex.length;i<length;i++){var nRowIndex=aSortRowIndex[i];var row=this.oDataRow[nRowIndex];var aSortIndex=[];for(var j in row)aSortIndex.push(j-0);aSortIndex.sort(fSortAscending);var aCurSequence=[];var oPrevData=null;for(var j=0,length2=aSortIndex.length;j<length2;j++){var nColIndex=aSortIndex[j];var data=row[nColIndex];var bAddToSequence=false;if(null!=data.nVal){bAddToSequence=true;if(null!=oPrevData&&(oPrevData.bDelimiter!=data.bDelimiter|| oPrevData.sPrefix!=data.sPrefix||oPrevData.bDate!=data.bDate)){this._addSequenceToRow(nRowIndex,aSortRowIndex,row,aCurSequence);aCurSequence=[];oPrevData=null}oPrevData=data}else if(data.bDelimiter){this._addSequenceToRow(nRowIndex,aSortRowIndex,row,aCurSequence);aCurSequence=[];oPrevData=null}if(bAddToSequence)aCurSequence.push(data)}this._addSequenceToRow(nRowIndex,aSortRowIndex,row,aCurSequence)}}},setIndex:function(index){if(0!=this.nRowLength&&index>=this.nRowLength)index=index%this.nRowLength; this.oCurRow=this.oDataRow[index];this.nCurColIndex=0},getNext:function(){var oRes=null;if(this.oCurRow){var oRes=this.oCurRow[this.nCurColIndex];if(null!=oRes){oRes.nCurValue=null;if(null!=oRes.oSequence){var sequence=oRes.oSequence;if(oRes.bDate||null!=oRes.sPrefix)oRes.nCurValue=Math.abs(sequence.a1*sequence.nX+sequence.a0);else oRes.nCurValue=sequence.a1*sequence.nX+sequence.a0;sequence.nX++}}this.nCurColIndex++;if(this.nCurColIndex>=this.nColLength)this.nCurColIndex=0}return oRes}};function HiddenManager(ws){this.ws= ws;this.hiddenRowsSum=[];this.hiddenColsSum=[];this.dirty=true;this.recalcHiddenRows={};this.recalcHiddenCols={};this.hiddenRowMin=gc_nMaxRow0;this.hiddenRowMax=0}HiddenManager.prototype.initPostOpen=function(){this.hiddenRowMin=gc_nMaxRow0;this.hiddenRowMax=0};HiddenManager.prototype.addHidden=function(isRow,index){(isRow?this.recalcHiddenRows:this.recalcHiddenCols)[index]=true;if(isRow){this.hiddenRowMin=Math.min(this.hiddenRowMin,index);this.hiddenRowMax=Math.max(this.hiddenRowMax,index)}this.setDirty(true)}; HiddenManager.prototype.getRecalcHidden=function(){var res=[];var i;for(i in this.recalcHiddenRows){i=+i;res.push(new Asc.Range(0,i,gc_nMaxCol0,i))}for(i in this.recalcHiddenCols){i=+i;res.push(new Asc.Range(i,0,i,gc_nMaxRow0))}this.recalcHiddenRows={};this.recalcHiddenCols={};return res};HiddenManager.prototype.getHiddenRowsRange=function(){var res;if(this.hiddenRowMin<=this.hiddenRowMax){res={r1:this.hiddenRowMin,r2:this.hiddenRowMax};this.hiddenRowMin=gc_nMaxRow0;this.hiddenRowMax=0}return res}; HiddenManager.prototype.setDirty=function(val){this.dirty=val};HiddenManager.prototype.getHiddenRowsCount=function(from,to){return this._getHiddenCount(true,from,to)};HiddenManager.prototype.getHiddenColsCount=function(from,to){return this._getHiddenCount(false,from,to)};HiddenManager.prototype._getHiddenCount=function(isRow,from,to){if(this.dirty){this.dirty=false;this._init()}var hiddenSum=isRow?this.hiddenRowsSum:this.hiddenColsSum;var toCount=to<hiddenSum.length?hiddenSum[to]:0;var fromCount= from<hiddenSum.length?hiddenSum[from]:0;return fromCount-toCount};HiddenManager.prototype._init=function(){if(this.ws){this.hiddenColsSum=this._initHiddenSumCol(this.ws.aCols);this.hiddenRowsSum=this._initHiddenSumRow()}};HiddenManager.prototype._initHiddenSumCol=function(elems){var hiddenSum=[];if(this.ws){var i;var hiddenFlags=[];for(i in elems)if(elems.hasOwnProperty(i)){var elem=elems[i];if(null!=elem&&elem.getHidden())hiddenFlags[i]=1}var sum=0;for(i=hiddenFlags.length-1;i>=0;--i){if(hiddenFlags[i]> 0)sum++;hiddenSum[i]=sum}}return hiddenSum};HiddenManager.prototype._initHiddenSumRow=function(){var hiddenSum=[];if(this.ws){var i;var hiddenFlags=[];this.ws._forEachRow(function(row){if(row.getHidden())hiddenFlags[row.getIndex()]=1});var sum=0;for(i=hiddenFlags.length-1;i>=0;--i){if(hiddenFlags[i]>0)sum++;hiddenSum[i]=sum}}return hiddenSum};function DrawingObjectsManager(worksheet){this.worksheet=worksheet}DrawingObjectsManager.prototype.updateChartReferences=function(oldWorksheet,newWorksheet){AscFormat.ExecuteNoHistory(function(){this.updateChartReferencesWidthHistory(oldWorksheet, newWorksheet)},this,[])};DrawingObjectsManager.prototype.updateChartReferencesWidthHistory=function(oldWorksheet,newWorksheet,bNoRebuildCache){var aObjects=this.worksheet.Drawings;for(var i=0;i<aObjects.length;i++){var graphicObject=aObjects[i].graphicObject;if(graphicObject.updateChartReferences)graphicObject.updateChartReferences(oldWorksheet,newWorksheet,bNoRebuildCache)}};DrawingObjectsManager.prototype.rebuildCharts=function(data){var aObjects=this.worksheet.Drawings;for(var i=0;i<aObjects.length;++i)if(aObjects[i].graphicObject.rebuildSeries)aObjects[i].graphicObject.rebuildSeries(data)}; function tryTranslateToPrintArea(val){var printAreaStr="Print_Area";var printAreaStrLocale=AscCommon.translateManager.getValue(printAreaStr);if(printAreaStrLocale.toLowerCase()===val.toLowerCase())return printAreaStr;return null}window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].g_nVerticalTextAngle=g_nVerticalTextAngle;window["AscCommonExcel"].oDefaultMetrics=oDefaultMetrics;window["AscCommonExcel"].g_nAllColIndex=g_nAllColIndex;window["AscCommonExcel"].g_nAllRowIndex= g_nAllRowIndex;window["AscCommonExcel"].g_DefNameWorksheet=null;window["AscCommonExcel"].aStandartNumFormats=aStandartNumFormats;window["AscCommonExcel"].aStandartNumFormatsId=aStandartNumFormatsId;window["AscCommonExcel"].oFormulaLocaleInfo=oFormulaLocaleInfo;window["AscCommonExcel"].getDefNameIndex=getDefNameIndex;window["AscCommonExcel"].getCellIndex=getCellIndex;window["AscCommonExcel"].angleFormatToInterface2=angleFormatToInterface2;window["AscCommonExcel"].angleInterfaceToFormat=angleInterfaceToFormat; window["AscCommonExcel"].Workbook=Workbook;window["AscCommonExcel"].CT_Workbook=CT_Workbook;window["AscCommonExcel"].Worksheet=Worksheet;window["AscCommonExcel"].Cell=Cell;window["AscCommonExcel"].Range=Range;window["AscCommonExcel"].DefName=DefName;window["AscCommonExcel"].DependencyGraph=DependencyGraph;window["AscCommonExcel"].HiddenManager=HiddenManager;window["AscCommonExcel"].CCellWithFormula=CCellWithFormula;window["AscCommonExcel"].preparePromoteFromTo=preparePromoteFromTo;window["AscCommonExcel"].promoteFromTo= promoteFromTo;window["AscCommonExcel"].getCompiledStyle=getCompiledStyle;window["AscCommonExcel"].getCompiledStyleFromArray=getCompiledStyleFromArray;window["AscCommonExcel"].ignoreFirstRowSort=ignoreFirstRowSort;window["AscCommonExcel"].tryTranslateToPrintArea=tryTranslateToPrintArea;window["AscCommonExcel"]._isSameSizeMerged=_isSameSizeMerged;window["AscCommonExcel"].g_nDefNameMaxLength=g_nDefNameMaxLength})(window);"use strict";(function(window,undefined){var openXml=AscCommon.openXml;var g_memory= AscFonts.g_memory;var DecodeBase64Char=AscFonts.DecodeBase64Char;var b64_decode=AscFonts.b64_decode;var CellValueType=AscCommon.CellValueType;var c_oAscCellAnchorType=AscCommon.c_oAscCellAnchorType;var c_oAscBorderStyles=AscCommon.c_oAscBorderStyles;var gc_nMaxRow0=AscCommon.gc_nMaxRow0;var gc_nMaxCol0=AscCommon.gc_nMaxCol0;var Binary_CommonReader=AscCommon.Binary_CommonReader;var BinaryCommonWriter=AscCommon.BinaryCommonWriter;var c_oSerPropLenType=AscCommon.c_oSerPropLenType;var c_oSerConstants= AscCommon.c_oSerConstants;var History=AscCommon.History;var pptx_content_loader=AscCommon.pptx_content_loader;var pptx_content_writer=AscCommon.pptx_content_writer;var c_oAscPageOrientation=Asc.c_oAscPageOrientation;var g_oDefaultFormat=AscCommonExcel.g_oDefaultFormat;var g_StyleCache=AscCommonExcel.g_StyleCache;var g_cSharedWriteStreak=64;var XLSB={rt_ROW_HDR:0,rt_CELL_BLANK:1,rt_CELL_RK:2,rt_CELL_ERROR:3,rt_CELL_BOOL:4,rt_CELL_REAL:5,rt_CELL_ST:6,rt_CELL_ISST:7,rt_FMLA_STRING:8,rt_FMLA_NUM:9,rt_FMLA_BOOL:10, rt_FMLA_ERROR:11,rt_BEGIN_SHEET_DATA:145,rt_END_SHEET_DATA:146};var c_oSerTableTypes={Other:0,SharedStrings:1,Styles:2,Workbook:3,Worksheets:4,CalcChain:5,App:6,Core:7,PersonList:8,CustomProperties:9};var c_oSerStylesTypes={Borders:0,Border:1,CellXfs:2,Xfs:3,Fills:4,Fill:5,Fonts:6,Font:7,NumFmts:8,NumFmt:9,Dxfs:10,Dxf:11,TableStyles:12,CellStyleXfs:14,CellStyles:15,CellStyle:16,SlicerStyles:17,ExtDxfs:18};var c_oSerBorderTypes={Bottom:0,Diagonal:1,End:2,Horizontal:3,Start:4,Top:5,Vertical:6,DiagonalDown:7, DiagonalUp:8,Outline:9};var c_oSerBorderPropTypes={Color:0,Style:1};var c_oSerXfsTypes={ApplyAlignment:0,ApplyBorder:1,ApplyFill:2,ApplyFont:3,ApplyNumberFormat:4,ApplyProtection:5,BorderId:6,FillId:7,FontId:8,NumFmtId:9,PivotButton:10,QuotePrefix:11,XfId:12,Aligment:13,Protection:14};var c_oSerAligmentTypes={Horizontal:0,Indent:1,JustifyLastLine:2,ReadingOrder:3,RelativeIndent:4,ShrinkToFit:5,TextRotation:6,Vertical:7,WrapText:8};var c_oSerFillTypes={Pattern:0,PatternBgColor_deprecated:1,PatternType:2, PatternFgColor:3,PatternBgColor:4,Gradient:5,GradientType:6,GradientLeft:7,GradientTop:8,GradientRight:9,GradientBottom:10,GradientDegree:11,GradientStop:12,GradientStopPosition:13,GradientStopColor:14};var c_oSerFontTypes={Bold:0,Color:1,Italic:3,RFont:4,Strike:5,Sz:6,Underline:7,VertAlign:8,Scheme:9};var c_oSerNumFmtTypes={FormatCode:0,NumFmtId:1};var c_oSerSharedStringTypes={Si:0,Run:1,RPr:2,Text:3};var c_oSerWorkbookTypes={WorkbookPr:0,BookViews:1,WorkbookView:2,DefinedNames:3,DefinedName:4,ExternalReferences:5, ExternalReference:6,PivotCaches:7,PivotCache:8,ExternalBook:9,OleLink:10,DdeLink:11,VbaProject:12,JsaProject:13,Comments:14,CalcPr:15,Connections:16,SlicerCaches:18,SlicerCachesExt:19,SlicerCache:20};var c_oSerWorkbookPrTypes={Date1904:0,DateCompatibility:1,HidePivotFieldList:2,ShowPivotChartFilter:3};var c_oSerWorkbookViewTypes={ActiveTab:0};var c_oSerDefinedNameTypes={Name:0,Ref:1,LocalSheetId:2,Hidden:3};var c_oSerCalcPrTypes={CalcId:0,CalcMode:1,FullCalcOnLoad:2,RefMode:3,Iterate:4,IterateCount:5, IterateDelta:6,FullPrecision:7,CalcCompleted:8,CalcOnSave:9,ConcurrentCalc:10,ConcurrentManualCount:11,ForceFullCalc:12};var c_oSerWorksheetsTypes={Worksheet:0,WorksheetProp:1,Cols:2,Col:3,Dimension:4,Hyperlinks:5,Hyperlink:6,MergeCells:7,MergeCell:8,SheetData:9,Row:10,SheetFormatPr:11,Drawings:12,Drawing:13,PageMargins:14,PageSetup:15,PrintOptions:16,Autofilter:17,TableParts:18,Comments:19,Comment:20,ConditionalFormatting:21,SheetViews:22,SheetView:23,SheetPr:24,SparklineGroups:25,PivotTable:26, HeaderFooter:27,LegacyDrawingHF:28,Picture:29,RowBreaks:30,ColBreaks:31,DataValidations:32,QueryTable:33,Controls:34,XlsbPos:35,SortState:36,Slicers:37,SlicersExt:38,Slicer:39,NamedSheetView:40};var c_oSerWorksheetPropTypes={Name:0,SheetId:1,State:2,Ref:3};var c_oSerWorksheetColTypes={BestFit:0,Hidden:1,Max:2,Min:3,Style:4,Width:5,CustomWidth:6,OutLevel:7,Collapsed:8};var c_oSerHyperlinkTypes={Ref:0,Hyperlink:1,Location:2,Tooltip:3};var c_oSerSheetFormatPrTypes={DefaultColWidth:0,DefaultRowHeight:1, BaseColWidth:2,CustomHeight:3,ZeroHeight:4,OutlineLevelCol:5,OutlineLevelRow:6};var c_oSerRowTypes={Row:0,Style:1,Height:2,Hidden:3,Cells:4,Cell:5,CustomHeight:6,OutLevel:7,Collapsed:8};var c_oSerCellTypes={Ref:0,Style:1,Type:2,Value:3,Formula:4,RefRowCol:5,ValueText:6};var c_oSerFormulaTypes={Aca:0,Bx:1,Ca:2,Del1:3,Del2:4,Dt2D:5,Dtr:6,R1:7,R2:8,Ref:9,Si:10,T:11,Text:12};var c_oSer_DrawingFromToType={Col:0,ColOff:1,Row:2,RowOff:3};var c_oSer_DrawingPosType={X:0,Y:1};var c_oSer_DrawingExtType={Cx:0, Cy:1};var c_oSer_OtherType={Media:0,MediaItem:1,MediaId:2,MediaSrc:3,Theme:5};var c_oSer_CalcChainType={CalcChainItem:0,Array:1,SheetId:2,DependencyLevel:3,Ref:4,ChildChain:5,NewThread:6};var c_oSer_PageMargins={Left:0,Top:1,Right:2,Bottom:3,Header:4,Footer:5};var c_oSer_PageSetup={Orientation:0,PaperSize:1,BlackAndWhite:2,CellComments:3,Copies:4,Draft:5,Errors:6,FirstPageNumber:7,FitToHeight:8,FitToWidth:9,HorizontalDpi:10,PageOrder:11,PaperHeight:12,PaperWidth:13,PaperUnits:14,Scale:15,UseFirstPageNumber:16, UsePrinterDefaults:17,VerticalDpi:18};var c_oSer_PrintOptions={GridLines:0,Headings:1};var c_oSer_TablePart={Table:0,Ref:1,TotalsRowCount:2,DisplayName:3,AutoFilter:4,SortState:5,TableColumns:6,TableStyleInfo:7,HeaderRowCount:8,AltTextTable:9,Name:10,Comment:11,ConnectionId:12,Id:13,DataCellStyle:14,DataDxfId:15,HeaderRowBorderDxfId:16,HeaderRowCellStyle:17,HeaderRowDxfId:18,InsertRow:19,InsertRowShift:20,Published:21,TableBorderDxfId:22,TableType:23,TotalsRowBorderDxfId:24,TotalsRowCellStyle:25, TotalsRowDxfId:26,TotalsRowShown:27,QueryTable:28};var c_oSer_TableStyleInfo={Name:0,ShowColumnStripes:1,ShowRowStripes:2,ShowFirstColumn:3,ShowLastColumn:4};var c_oSer_TableColumns={TableColumn:0,Name:1,DataDxfId:2,TotalsRowLabel:3,TotalsRowFunction:4,TotalsRowFormula:5,CalculatedColumnFormula:6};var c_oSer_SortState={Ref:0,CaseSensitive:1,SortConditions:2,SortCondition:3,ConditionRef:4,ConditionSortBy:5,ConditionDescending:6,ConditionDxfId:7,ColumnSort:8,SortMethod:9};var c_oSer_AutoFilter={Ref:0, FilterColumns:1,FilterColumn:2,SortState:3};var c_oSer_FilterColumn={ColId:0,Filters:1,Filter:2,DateGroupItem:3,CustomFilters:4,ColorFilter:5,Top10:6,DynamicFilter:7,HiddenButton:8,ShowButton:9,FiltersBlank:10};var c_oSer_Filter={Val:0};var c_oSer_DateGroupItem={DateTimeGrouping:0,Day:1,Hour:2,Minute:3,Month:4,Second:5,Year:6};var c_oSer_CustomFilters={And:0,CustomFilters:1,CustomFilter:2,Operator:3,Val:4};var c_oSer_DynamicFilter={Type:0,Val:1,MaxVal:2};var c_oSer_ColorFilter={CellColor:0,DxfId:1}; var c_oSer_Top10={FilterVal:0,Percent:1,Top:2,Val:3};var c_oSer_Dxf={Alignment:0,Border:1,Fill:2,Font:3,NumFmt:4};var c_oSer_TableStyles={DefaultTableStyle:0,DefaultPivotStyle:1,TableStyles:2,TableStyle:3};var c_oSer_TableStyle={Name:0,Pivot:1,Table:2,Elements:3,Element:4,DisplayName:5};var c_oSer_TableStyleElement={DxfId:0,Size:1,Type:2};var c_oSer_Comments={Row:0,Col:1,CommentDatas:2,CommentData:3,Left:4,LeftOffset:5,Top:6,TopOffset:7,Right:8,RightOffset:9,Bottom:10,BottomOffset:11,LeftMM:12,TopMM:13, WidthMM:14,HeightMM:15,MoveWithCells:16,SizeWithCells:17,ThreadedComment:18};var c_oSer_CommentData={Text:0,Time:1,UserId:2,UserName:3,QuoteText:4,Solved:5,Document:6,Replies:7,Reply:8,OOTime:9,Guid:10,UserData:11};var c_oSer_ThreadedComment={dT:0,personId:1,id:2,done:3,text:4,mention:5,reply:6,mentionpersonId:7,mentionId:8,startIndex:9,length:10};var c_oSer_Person={person:0,id:1,providerId:2,userId:3,displayName:4};var c_oSer_ConditionalFormatting={Pivot:0,SqRef:1,ConditionalFormattingRule:2};var c_oSer_ConditionalFormattingRule= {AboveAverage:0,Bottom:1,DxfId:2,EqualAverage:3,Operator:4,Percent:5,Priority:6,Rank:7,StdDev:8,StopIfTrue:9,Text:10,TimePeriod:11,Type:12,ColorScale:14,DataBar:15,FormulaCF:16,IconSet:17,Dxf:18};var c_oSer_ConditionalFormattingRuleColorScale={CFVO:0,Color:1};var c_oSer_ConditionalFormattingDataBar={CFVO:0,Color:1,MaxLength:2,MinLength:3,ShowValue:4,NegativeColor:5,BorderColor:6,AxisColor:7,NegativeBorderColor:8,AxisPosition:9,Direction:10,GradientEnabled:11,NegativeBarColorSameAsPositive:12,NegativeBarBorderColorSameAsPositive:13}; var c_oSer_ConditionalFormattingIconSet={CFVO:0,IconSet:1,Percent:2,Reverse:3,ShowValue:4,CFIcon:5};var c_oSer_ConditionalFormattingValueObject={Gte:0,Type:1,Val:2,Formula:3};var c_oSer_ConditionalFormattingIcon={iconSet:0,iconId:1};var c_oSer_DataValidation={DataValidations:0,DataValidation:1,DisablePrompts:2,XWindow:3,YWindow:4,Type:5,AllowBlank:6,Error:7,ErrorTitle:8,ErrorStyle:9,ImeMode:10,Operator:11,Prompt:12,PromptTitle:13,ShowDropDown:14,ShowErrorMessage:15,ShowInputMessage:16,SqRef:17,Formula1:18, Formula2:19};var c_oSer_SheetView={ColorId:0,DefaultGridColor:1,RightToLeft:2,ShowFormulas:3,ShowGridLines:4,ShowOutlineSymbols:5,ShowRowColHeaders:6,ShowRuler:7,ShowWhiteSpace:8,ShowZeros:9,TabSelected:10,TopLeftCell:11,View:12,WindowProtection:13,WorkbookViewId:14,ZoomScale:15,ZoomScaleNormal:16,ZoomScalePageLayoutView:17,ZoomScaleSheetLayoutView:18,Pane:19,Selection:20};var c_oSer_DrawingType={Type:0,From:1,To:2,Pos:3,Pic:4,PicSrc:5,GraphicFrame:6,Chart:7,Ext:8,pptxDrawing:9,Chart2:10,ObjectName:11, EditAs:12};var c_oSer_Pane={ActivePane:0,State:1,TopLeftCell:2,XSplit:3,YSplit:4};var c_oSer_Selection={ActiveCell:0,ActiveCellId:1,Sqref:2,Pane:3};var c_oSer_CellStyle={BuiltinId:0,CustomBuiltin:1,Hidden:2,ILevel:3,Name:4,XfId:5};var c_oSer_SheetPr={CodeName:0,EnableFormatConditionsCalculation:1,FilterMode:2,Published:3,SyncHorizontal:4,SyncRef:5,SyncVertical:6,TransitionEntry:7,TransitionEvaluation:8,TabColor:9,PageSetUpPr:10,AutoPageBreaks:11,FitToPage:12,OutlinePr:13,ApplyStyles:14,ShowOutlineSymbols:15, SummaryBelow:16,SummaryRight:17};var c_oSer_Sparkline={SparklineGroup:0,ManualMax:1,ManualMin:2,LineWeight:3,Type:4,DateAxis:5,DisplayEmptyCellsAs:6,Markers:7,High:8,Low:9,First:10,Last:11,Negative:12,DisplayXAxis:13,DisplayHidden:14,MinAxisType:15,MaxAxisType:16,RightToLeft:17,ColorSeries:18,ColorNegative:19,ColorAxis:20,ColorMarkers:21,ColorFirst:22,ColorLast:23,ColorHigh:24,ColorLow:25,Ref:26,Sparklines:27,Sparkline:28,SparklineRef:29,SparklineSqRef:30};var c_oSer_AltTextTable={AltText:0,AltTextSummary:1}; var c_oSer_PivotTypes={id:0,cache:1,record:2,cacheId:3,table:4};var c_oSer_ExternalLinkTypes={Id:0,SheetNames:1,SheetName:2,DefinedNames:3,DefinedName:4,DefinedNameName:5,DefinedNameRefersTo:6,DefinedNameSheetId:7,SheetDataSet:8,SheetData:9,SheetDataSheetId:10,SheetDataRefreshError:11,SheetDataRow:12,SheetDataRowR:13,SheetDataRowCell:14,SheetDataRowCellRef:15,SheetDataRowCellType:16,SheetDataRowCellValue:17};var c_oSer_HeaderFooter={AlignWithMargins:0,DifferentFirst:1,DifferentOddEven:2,ScaleWithDoc:3, EvenFooter:4,EvenHeader:5,FirstFooter:6,FirstHeader:7,OddFooter:8,OddHeader:9};var c_oSer_RowColBreaks={Count:0,ManualBreakCount:1,Break:2,Id:3,Man:4,Max:5,Min:6,Pt:7};var c_oSer_LegacyDrawingHF={Drawings:0,Drawing:1,DrawingId:2,DrawingShape:3,Cfe:4,Cff:5,Cfo:6,Che:7,Chf:8,Cho:9,Lfe:10,Lff:11,Lfo:12,Lhe:13,Lhf:14,Lho:15,Rfe:16,Rff:17,Rfo:18,Rhe:19,Rhf:20,Rho:21};var EBorderStyle={borderstyleDashDot:0,borderstyleDashDotDot:1,borderstyleDashed:2,borderstyleDotted:3,borderstyleDouble:4,borderstyleHair:5, borderstyleMedium:6,borderstyleMediumDashDot:7,borderstyleMediumDashDotDot:8,borderstyleMediumDashed:9,borderstyleNone:10,borderstyleSlantDashDot:11,borderstyleThick:12,borderstyleThin:13};var EUnderline={underlineDouble:0,underlineDoubleAccounting:1,underlineNone:2,underlineSingle:3,underlineSingleAccounting:4};var ECellAnchorType={cellanchorAbsolute:0,cellanchorOneCell:1,cellanchorTwoCell:2};var EVisibleType={visibleHidden:0,visibleVeryHidden:1,visibleVisible:2};var ECellTypeType={celltypeBool:0, celltypeDate:1,celltypeError:2,celltypeInlineStr:3,celltypeNumber:4,celltypeSharedString:5,celltypeStr:6};var ECellFormulaType={cellformulatypeArray:0,cellformulatypeDataTable:1,cellformulatypeNormal:2,cellformulatypeShared:3};var EPageOrientation={pageorientLandscape:0,pageorientPortrait:1};var EPageSize={pagesizeLetterPaper:1,pagesizeLetterSmall:2,pagesizeTabloidPaper:3,pagesizeLedgerPaper:4,pagesizeLegalPaper:5,pagesizeStatementPaper:6,pagesizeExecutivePaper:7,pagesizeA3Paper:8,pagesizeA4Paper:9, pagesizeA4SmallPaper:10,pagesizeA5Paper:11,pagesizeB4Paper:12,pagesizeB5Paper:13,pagesizeFolioPaper:14,pagesizeQuartoPaper:15,pagesizeStandardPaper1:16,pagesizeStandardPaper2:17,pagesizeNotePaper:18,pagesize9Envelope:19,pagesize10Envelope:20,pagesize11Envelope:21,pagesize12Envelope:22,pagesize14Envelope:23,pagesizeCPaper:24,pagesizeDPaper:25,pagesizeEPaper:26,pagesizeDLEnvelope:27,pagesizeC5Envelope:28,pagesizeC3Envelope:29,pagesizeC4Envelope:30,pagesizeC6Envelope:31,pagesizeC65Envelope:32,pagesizeB4Envelope:33, pagesizeB5Envelope:34,pagesizeB6Envelope:35,pagesizeItalyEnvelope:36,pagesizeMonarchEnvelope:37,pagesize6_3_4Envelope:38,pagesizeUSStandardFanfold:39,pagesizeGermanStandardFanfold:40,pagesizeGermanLegalFanfold:41,pagesizeISOB4:42,pagesizeJapaneseDoublePostcard:43,pagesizeStandardPaper3:44,pagesizeStandardPaper4:45,pagesizeStandardPaper5:46,pagesizeInviteEnvelope:47,pagesizeLetterExtraPaper:50,pagesizeLegalExtraPaper:51,pagesizeTabloidExtraPaper:52,pagesizeA4ExtraPaper:53,pagesizeLetterTransversePaper:54, pagesizeA4TransversePaper:55,pagesizeLetterExtraTransversePaper:56,pagesizeSuperA_SuperA_A4Paper:57,pagesizeSuperB_SuperB_A3Paper:58,pagesizeLetterPlusPaper:59,pagesizeA4PlusPaper:60,pagesizeA5TransversePaper:61,pagesizeJISB5TransversePaper:62,pagesizeA3ExtraPaper:63,pagesizeA5ExtraPaper:64,pagesizeISOB5ExtraPaper:65,pagesizeA2Paper:66,pagesizeA3TransversePaper:67,pagesizeA3ExtraTransversePaper:68};var ETotalsRowFunction={totalrowfunctionAverage:1,totalrowfunctionCount:2,totalrowfunctionCountNums:3, totalrowfunctionCustom:4,totalrowfunctionMax:5,totalrowfunctionMin:6,totalrowfunctionNone:7,totalrowfunctionStdDev:8,totalrowfunctionSum:9,totalrowfunctionVar:10};var ESortBy={sortbyCellColor:1,sortbyFontColor:2,sortbyIcon:3,sortbyValue:4};var ECustomFilter={customfilterEqual:1,customfilterGreaterThan:2,customfilterGreaterThanOrEqual:3,customfilterLessThan:4,customfilterLessThanOrEqual:5,customfilterNotEqual:6};var EDateTimeGroup={datetimegroupDay:1,datetimegroupHour:2,datetimegroupMinute:3,datetimegroupMonth:4, datetimegroupSecond:5,datetimegroupYear:6};var ETableStyleType={tablestyletypeBlankRow:0,tablestyletypeFirstColumn:1,tablestyletypeFirstColumnStripe:2,tablestyletypeFirstColumnSubheading:3,tablestyletypeFirstHeaderCell:4,tablestyletypeFirstRowStripe:5,tablestyletypeFirstRowSubheading:6,tablestyletypeFirstSubtotalColumn:7,tablestyletypeFirstSubtotalRow:8,tablestyletypeFirstTotalCell:9,tablestyletypeHeaderRow:10,tablestyletypeLastColumn:11,tablestyletypeLastHeaderCell:12,tablestyletypeLastTotalCell:13, tablestyletypePageFieldLabels:14,tablestyletypePageFieldValues:15,tablestyletypeSecondColumnStripe:16,tablestyletypeSecondColumnSubheading:17,tablestyletypeSecondRowStripe:18,tablestyletypeSecondRowSubheading:19,tablestyletypeSecondSubtotalColumn:20,tablestyletypeSecondSubtotalRow:21,tablestyletypeThirdColumnSubheading:22,tablestyletypeThirdRowSubheading:23,tablestyletypeThirdSubtotalColumn:24,tablestyletypeThirdSubtotalRow:25,tablestyletypeTotalRow:26,tablestyletypeWholeTable:27};var EFontScheme= {fontschemeMajor:0,fontschemeMinor:1,fontschemeNone:2};var ECfOperator={Operator_beginsWith:0,Operator_between:1,Operator_containsText:2,Operator_endsWith:3,Operator_equal:4,Operator_greaterThan:5,Operator_greaterThanOrEqual:6,Operator_lessThan:7,Operator_lessThanOrEqual:8,Operator_notBetween:9,Operator_notContains:10,Operator_notEqual:11};var ECfType={aboveAverage:0,beginsWith:1,cellIs:2,colorScale:3,containsBlanks:4,containsErrors:5,containsText:6,dataBar:7,duplicateValues:8,expression:9,iconSet:10, notContainsBlanks:11,notContainsErrors:12,notContainsText:13,timePeriod:14,top10:15,uniqueValues:16,endsWith:17};var EIconSetType={Arrows3:0,Arrows3Gray:1,Flags3:2,Signs3:3,Symbols3:4,Symbols3_2:5,Traffic3Lights1:6,Traffic3Lights2:7,Arrows4:8,Arrows4Gray:9,Rating4:10,RedToBlack4:11,Traffic4Lights:12,Arrows5:13,Arrows5Gray:14,Quarters5:15,Rating5:16,Triangles3:17,Stars3:18,Boxes5:19,NoIcons:20};var ECfvoType={Formula:0,Maximum:1,Minimum:2,Number:3,Percent:4,Percentile:5,AutoMin:6,AutoMax:7};var ST_TimePeriod= {last7Days:"last7Days",lastMonth:"lastMonth",lastWeek:"lastWeek",nextMonth:"nextMonth",nextWeek:"nextWeek",thisMonth:"thisMonth",thisWeek:"thisWeek",today:"today",tomorrow:"tomorrow",yesterday:"yesterday"};var EDataBarAxisPosition={automatic:0,middle:1,none:2};var EDataBarDirection={context:0,leftToRight:1,rightToLeft:2};var g_nNumsMaxId=160;var DocumentPageSize=new function(){this.oSizes=[{id:EPageSize.pagesizeLetterPaper,w_mm:215.9,h_mm:279.4},{id:EPageSize.pagesizeLetterSmall,w_mm:215.9,h_mm:279.4}, {id:EPageSize.pagesizeTabloidPaper,w_mm:279.4,h_mm:431.8},{id:EPageSize.pagesizeLedgerPaper,w_mm:431.8,h_mm:279.4},{id:EPageSize.pagesizeLegalPaper,w_mm:215.9,h_mm:355.6},{id:EPageSize.pagesizeStatementPaper,w_mm:495.3,h_mm:215.9},{id:EPageSize.pagesizeExecutivePaper,w_mm:184.2,h_mm:266.7},{id:EPageSize.pagesizeA3Paper,w_mm:297,h_mm:420},{id:EPageSize.pagesizeA4Paper,w_mm:210,h_mm:297},{id:EPageSize.pagesizeA4SmallPaper,w_mm:210,h_mm:297},{id:EPageSize.pagesizeA5Paper,w_mm:148,h_mm:210},{id:EPageSize.pagesizeB4Paper, w_mm:250,h_mm:353},{id:EPageSize.pagesizeB5Paper,w_mm:176,h_mm:250},{id:EPageSize.pagesizeFolioPaper,w_mm:215.9,h_mm:330.2},{id:EPageSize.pagesizeQuartoPaper,w_mm:215,h_mm:275},{id:EPageSize.pagesizeStandardPaper1,w_mm:254,h_mm:355.6},{id:EPageSize.pagesizeStandardPaper2,w_mm:279.4,h_mm:431.8},{id:EPageSize.pagesizeNotePaper,w_mm:215.9,h_mm:279.4},{id:EPageSize.pagesize9Envelope,w_mm:98.4,h_mm:225.4},{id:EPageSize.pagesize10Envelope,w_mm:104.8,h_mm:241.3},{id:EPageSize.pagesize11Envelope,w_mm:114.3, h_mm:263.5},{id:EPageSize.pagesize12Envelope,w_mm:120.7,h_mm:279.4},{id:EPageSize.pagesize14Envelope,w_mm:127,h_mm:292.1},{id:EPageSize.pagesizeCPaper,w_mm:431.8,h_mm:558.8},{id:EPageSize.pagesizeDPaper,w_mm:558.8,h_mm:863.6},{id:EPageSize.pagesizeEPaper,w_mm:863.6,h_mm:1117.6},{id:EPageSize.pagesizeDLEnvelope,w_mm:110,h_mm:220},{id:EPageSize.pagesizeC5Envelope,w_mm:162,h_mm:229},{id:EPageSize.pagesizeC3Envelope,w_mm:324,h_mm:458},{id:EPageSize.pagesizeC4Envelope,w_mm:229,h_mm:324},{id:EPageSize.pagesizeC6Envelope, w_mm:114,h_mm:162},{id:EPageSize.pagesizeC65Envelope,w_mm:114,h_mm:229},{id:EPageSize.pagesizeB4Envelope,w_mm:250,h_mm:353},{id:EPageSize.pagesizeB5Envelope,w_mm:176,h_mm:250},{id:EPageSize.pagesizeB6Envelope,w_mm:176,h_mm:125},{id:EPageSize.pagesizeItalyEnvelope,w_mm:110,h_mm:230},{id:EPageSize.pagesizeMonarchEnvelope,w_mm:98.4,h_mm:190.5},{id:EPageSize.pagesize6_3_4Envelope,w_mm:92.1,h_mm:165.1},{id:EPageSize.pagesizeUSStandardFanfold,w_mm:377.8,h_mm:279.4},{id:EPageSize.pagesizeGermanStandardFanfold, w_mm:215.9,h_mm:304.8},{id:EPageSize.pagesizeGermanLegalFanfold,w_mm:215.9,h_mm:330.2},{id:EPageSize.pagesizeISOB4,w_mm:250,h_mm:353},{id:EPageSize.pagesizeJapaneseDoublePostcard,w_mm:200,h_mm:148},{id:EPageSize.pagesizeStandardPaper3,w_mm:228.6,h_mm:279.4},{id:EPageSize.pagesizeStandardPaper4,w_mm:254,h_mm:279.4},{id:EPageSize.pagesizeStandardPaper5,w_mm:381,h_mm:279.4},{id:EPageSize.pagesizeInviteEnvelope,w_mm:220,h_mm:220},{id:EPageSize.pagesizeLetterExtraPaper,w_mm:235.6,h_mm:304.8},{id:EPageSize.pagesizeLegalExtraPaper, w_mm:235.6,h_mm:381},{id:EPageSize.pagesizeTabloidExtraPaper,w_mm:296.9,h_mm:457.2},{id:EPageSize.pagesizeA4ExtraPaper,w_mm:236,h_mm:322},{id:EPageSize.pagesizeLetterTransversePaper,w_mm:210.2,h_mm:279.4},{id:EPageSize.pagesizeA4TransversePaper,w_mm:210,h_mm:297},{id:EPageSize.pagesizeLetterExtraTransversePaper,w_mm:235.6,h_mm:304.8},{id:EPageSize.pagesizeSuperA_SuperA_A4Paper,w_mm:227,h_mm:356},{id:EPageSize.pagesizeSuperB_SuperB_A3Paper,w_mm:305,h_mm:487},{id:EPageSize.pagesizeLetterPlusPaper,w_mm:215.9, h_mm:12.69},{id:EPageSize.pagesizeA4PlusPaper,w_mm:210,h_mm:330},{id:EPageSize.pagesizeA5TransversePaper,w_mm:148,h_mm:210},{id:EPageSize.pagesizeJISB5TransversePaper,w_mm:182,h_mm:257},{id:EPageSize.pagesizeA3ExtraPaper,w_mm:322,h_mm:445},{id:EPageSize.pagesizeA5ExtraPaper,w_mm:174,h_mm:235},{id:EPageSize.pagesizeISOB5ExtraPaper,w_mm:201,h_mm:276},{id:EPageSize.pagesizeA2Paper,w_mm:420,h_mm:594},{id:EPageSize.pagesizeA3TransversePaper,w_mm:297,h_mm:420},{id:EPageSize.pagesizeA3ExtraTransversePaper, w_mm:322,h_mm:445}];this.getSizeByWH=function(widthMm,heightMm){for(var index in this.oSizes){var item=this.oSizes[index];if(widthMm==item.w_mm&&heightMm==item.h_mm)return item}return this.oSizes[8]};this.getSizeById=function(id){for(var index in this.oSizes){var item=this.oSizes[index];if(id==item.id)return item}return this.oSizes[8]}};function OpenColor(){this.rgb=null;this.auto=null;this.theme=null;this.tint=null}function OpenFormula(){this.aca=null;this.bx=null;this.ca=null;this.del1=null;this.del2= null;this.dt2d=null;this.dtr=null;this.r1=null;this.r2=null;this.ref=null;this.si=null;this.t=null;this.v=null}OpenFormula.prototype.clean=function(){this.aca=null;this.bx=null;this.ca=null;this.del1=null;this.del2=null;this.dt2d=null;this.dtr=null;this.r1=null;this.r2=null;this.ref=null;this.si=null;this.t=null;this.v=null};function OpenColumnFormula(nRow,formula,parsed,refPos,base){this.nRow=nRow;this.formula=formula;this.parsed=parsed;this.refPos=refPos;this.base=base}function OpenXf(){this.ApplyAlignment= null;this.ApplyBorder=null;this.ApplyFill=null;this.ApplyFont=null;this.ApplyNumberFormat=null;this.borderid=null;this.fillid=null;this.fontid=null;this.numid=null;this.QuotePrefix=null;this.align=null;this.PivotButton=null;this.XfId=null}function ReadColorSpreadsheet2(bcr,length){var output=null;var color=new OpenColor;var res=bcr.Read2Spreadsheet(length,function(t,l){return bcr.ReadColorSpreadsheet(t,l,color)});if(null!=color.theme)output=AscCommonExcel.g_oColorManager.getThemeColor(color.theme, color.tint);else if(null!=color.rgb)output=new AscCommonExcel.RgbColor(16777215&color.rgb);return output}function getSqRefString(ranges){var refs=[];for(var i=0;i<ranges.length;++i)refs.push(ranges[i].getName());return refs.join(" ")}function getDisjointMerged(wb,bboxes){var res=[];var curY,elem;var error=false;var indexTop=0;var indexBottom=0;var rangesTop=bboxes;var rangesBottom=bboxes.concat();rangesTop.sort(Asc.Range.prototype.compareByLeftTop);rangesBottom.sort(Asc.Range.prototype.compareByRightBottom); var tree=new AscCommon.DataIntervalTree;while(indexBottom<rangesBottom.length){if(indexTop<rangesTop.length)curY=Math.min(rangesTop[indexTop].r1,rangesBottom[indexBottom].r2);else curY=rangesBottom[indexBottom].r2;while(indexTop<rangesTop.length&&curY===rangesTop[indexTop].r1){elem=rangesTop[indexTop];if(!tree.searchAny(elem.c1,elem.c2)){tree.insert(elem.c1,elem.c2,elem);res.push(elem)}else error=true;indexTop++}while(indexBottom<rangesBottom.length&&curY===rangesBottom[indexBottom].r2){elem=rangesBottom[indexBottom]; tree.remove(elem.c1,elem.c2,elem);indexBottom++}}if(error&&wb.oApi&&wb.oApi.CoAuthoringApi){var msg="Error: intersection of merged areas";wb.oApi.CoAuthoringApi.sendChangesError(msg)}return res}function BinaryTableWriter(memory,aDxfs,isCopyPaste,tableIds){this.memory=memory;this.aDxfs=aDxfs;this.bs=new BinaryCommonWriter(this.memory);this.isCopyPaste=isCopyPaste;this.tableIds=tableIds;this.Write=function(aTables,ws){var oThis=this;for(var i=0,length=aTables.length;i<length;++i){var rangeTable=null; if(this.isCopyPaste)rangeTable=aTables[i].Ref;if(!this.isCopyPaste||this.isCopyPaste&&rangeTable&&this.isCopyPaste.isIntersect(rangeTable)&&!ws.bExcludeHiddenRows)this.bs.WriteItem(c_oSer_TablePart.Table,function(){oThis.WriteTable(aTables[i],ws)})}};this.WriteTable=function(table,ws){var oThis=this;if(null!=table.Ref){this.memory.WriteByte(c_oSer_TablePart.Ref);this.memory.WriteString2(table.Ref.getName())}if(null!=table.HeaderRowCount)this.bs.WriteItem(c_oSer_TablePart.HeaderRowCount,function(){oThis.memory.WriteLong(table.HeaderRowCount)}); if(null!=table.TotalsRowCount)this.bs.WriteItem(c_oSer_TablePart.TotalsRowCount,function(){oThis.memory.WriteLong(table.TotalsRowCount)});if(null!=table.DisplayName){this.memory.WriteByte(c_oSer_TablePart.DisplayName);this.memory.WriteString2(table.DisplayName);if(this.tableIds){var elem=this.tableIds[table.DisplayName];if(elem)this.bs.WriteItem(c_oSer_TablePart.Id,function(){oThis.memory.WriteULong(elem.id)})}}if(null!=table.AutoFilter)this.bs.WriteItem(c_oSer_TablePart.AutoFilter,function(){oThis.WriteAutoFilter(table.AutoFilter)}); if(null!=table.SortState)this.bs.WriteItem(c_oSer_TablePart.SortState,function(){oThis.WriteSortState(table.SortState)});if(null!=table.TableColumns){if(ws)table.syncTotalLabels(ws);this.bs.WriteItem(c_oSer_TablePart.TableColumns,function(){oThis.WriteTableColumns(table.TableColumns)})}if(null!=table.TableStyleInfo)this.bs.WriteItem(c_oSer_TablePart.TableStyleInfo,function(){oThis.WriteTableStyleInfo(table.TableStyleInfo)});if(null!=table.altText||null!=table.altTextSummary)this.bs.WriteItem(c_oSer_TablePart.AltTextTable, function(){oThis.WriteAltTextTable(table)})};this.WriteAltTextTable=function(table){var oThis=this;if(null!=table.altText){this.memory.WriteByte(c_oSer_AltTextTable.AltText);this.memory.WriteString2(table.altText)}if(null!=table.altTextSummary){this.memory.WriteByte(c_oSer_AltTextTable.AltTextSummary);this.memory.WriteString2(table.altTextSummary)}};this.WriteAutoFilter=function(autofilter){var oThis=this;if(null!=autofilter.Ref){this.memory.WriteByte(c_oSer_AutoFilter.Ref);this.memory.WriteString2(autofilter.Ref.getName())}if(null!= autofilter.FilterColumns)this.bs.WriteItem(c_oSer_AutoFilter.FilterColumns,function(){oThis.WriteFilterColumns(autofilter.FilterColumns)});if(null!=autofilter.SortState)this.bs.WriteItem(c_oSer_AutoFilter.SortState,function(){oThis.WriteSortState(autofilter.SortState)})};this.WriteFilterColumns=function(filterColumns){var oThis=this;for(var i=0,length=filterColumns.length;i<length;++i)this.bs.WriteItem(c_oSer_AutoFilter.FilterColumn,function(){oThis.WriteFilterColumn(filterColumns[i])})};this.WriteFilterColumn= function(filterColumn){var oThis=this;if(null!=filterColumn.ColId)this.bs.WriteItem(c_oSer_FilterColumn.ColId,function(){oThis.memory.WriteLong(filterColumn.ColId)});if(null!=filterColumn.Filters)this.bs.WriteItem(c_oSer_FilterColumn.Filters,function(){oThis.WriteFilters(filterColumn.Filters)});if(null!=filterColumn.CustomFiltersObj)this.bs.WriteItem(c_oSer_FilterColumn.CustomFilters,function(){oThis.WriteCustomFilters(filterColumn.CustomFiltersObj)});if(null!=filterColumn.DynamicFilter)this.bs.WriteItem(c_oSer_FilterColumn.DynamicFilter, function(){oThis.WriteDynamicFilter(filterColumn.DynamicFilter)});if(null!=filterColumn.ColorFilter)this.bs.WriteItem(c_oSer_FilterColumn.ColorFilter,function(){oThis.WriteColorFilter(filterColumn.ColorFilter)});if(null!=filterColumn.Top10)this.bs.WriteItem(c_oSer_FilterColumn.Top10,function(){oThis.WriteTop10(filterColumn.Top10)});if(null!=filterColumn.ShowButton)this.bs.WriteItem(c_oSer_FilterColumn.ShowButton,function(){oThis.memory.WriteBool(filterColumn.ShowButton)})};this.WriteFilters=function(filters){var oThis= this;if(null!=filters.Values)for(var i in filters.Values)this.bs.WriteItem(c_oSer_FilterColumn.Filter,function(){oThis.WriteFilter(i)});if(null!=filters.Dates)for(var i=0,length=filters.Dates.length;i<length;++i)this.bs.WriteItem(c_oSer_FilterColumn.DateGroupItem,function(){oThis.WriteDateGroupItem(filters.Dates[i])});if(null!=filters.Blank)this.bs.WriteItem(c_oSer_FilterColumn.FiltersBlank,function(){oThis.memory.WriteBool(filters.Blank)})};this.WriteFilter=function(val){if(null!=val){this.memory.WriteByte(c_oSer_Filter.Val); this.memory.WriteString2(val)}};this.WriteDateGroupItem=function(dateGroupItem){var oDateGroupItem=new AscCommonExcel.DateGroupItem;oDateGroupItem.convertRangeToDateGroupItem(dateGroupItem);dateGroupItem=oDateGroupItem;if(null!=dateGroupItem.DateTimeGrouping){this.memory.WriteByte(c_oSer_DateGroupItem.DateTimeGrouping);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(dateGroupItem.DateTimeGrouping)}if(null!=dateGroupItem.Day){this.memory.WriteByte(c_oSer_DateGroupItem.Day);this.memory.WriteByte(c_oSerPropLenType.Long); this.memory.WriteLong(dateGroupItem.Day)}if(null!=dateGroupItem.Hour){this.memory.WriteByte(c_oSer_DateGroupItem.Hour);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(dateGroupItem.Hour)}if(null!=dateGroupItem.Minute){this.memory.WriteByte(c_oSer_DateGroupItem.Minute);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(dateGroupItem.Minute)}if(null!=dateGroupItem.Month){this.memory.WriteByte(c_oSer_DateGroupItem.Month);this.memory.WriteByte(c_oSerPropLenType.Long); this.memory.WriteLong(dateGroupItem.Month)}if(null!=dateGroupItem.Second){this.memory.WriteByte(c_oSer_DateGroupItem.Second);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(dateGroupItem.Second)}if(null!=dateGroupItem.Year){this.memory.WriteByte(c_oSer_DateGroupItem.Year);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(dateGroupItem.Year)}};this.WriteCustomFilters=function(customFilters){var oThis=this;if(null!=customFilters.And)this.bs.WriteItem(c_oSer_CustomFilters.And, function(){oThis.memory.WriteBool(customFilters.And)});if(null!=customFilters.CustomFilters&&customFilters.CustomFilters.length>0)this.bs.WriteItem(c_oSer_CustomFilters.CustomFilters,function(){oThis.WriteCustomFiltersItems(customFilters.CustomFilters)})};this.WriteCustomFiltersItems=function(aCustomFilters){var oThis=this;for(var i=0,length=aCustomFilters.length;i<length;++i)this.bs.WriteItem(c_oSer_CustomFilters.CustomFilter,function(){oThis.WriteCustomFiltersItem(aCustomFilters[i])})};this.WriteCustomFiltersItem= function(customFilter){if(null!=customFilter.Operator){this.memory.WriteByte(c_oSer_CustomFilters.Operator);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(customFilter.Operator)}if(null!=customFilter.Val){this.memory.WriteByte(c_oSer_CustomFilters.Val);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(customFilter.Val)}};this.WriteDynamicFilter=function(dynamicFilter){if(null!=dynamicFilter.Type){this.memory.WriteByte(c_oSer_DynamicFilter.Type);this.memory.WriteByte(c_oSerPropLenType.Byte); this.memory.WriteByte(dynamicFilter.Type)}if(null!=dynamicFilter.Val){this.memory.WriteByte(c_oSer_DynamicFilter.Val);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(dynamicFilter.Val)}if(null!=dynamicFilter.MaxVal){this.memory.WriteByte(c_oSer_DynamicFilter.MaxVal);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(dynamicFilter.MaxVal)}};this.WriteColorFilter=function(colorFilter){if(null!=colorFilter.CellColor){this.memory.WriteByte(c_oSer_ColorFilter.CellColor); this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(colorFilter.CellColor)}if(null!=colorFilter.dxf){this.memory.WriteByte(c_oSer_ColorFilter.DxfId);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(this.aDxfs.length);this.aDxfs.push(colorFilter.dxf)}};this.WriteTop10=function(top10){if(null!=top10.FilterVal){this.memory.WriteByte(c_oSer_Top10.FilterVal);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(top10.FilterVal)}if(null!=top10.Percent){this.memory.WriteByte(c_oSer_Top10.Percent); this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(top10.Percent)}if(null!=top10.Top){this.memory.WriteByte(c_oSer_Top10.Top);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(top10.Top)}if(null!=top10.Val){this.memory.WriteByte(c_oSer_Top10.Val);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(top10.Val)}};this.WriteSortState=function(sortState){var oThis=this;if(null!=sortState.Ref){this.memory.WriteByte(c_oSer_SortState.Ref);this.memory.WriteString2(sortState.Ref.getName())}if(null!= sortState.CaseSensitive)this.bs.WriteItem(c_oSer_SortState.CaseSensitive,function(){oThis.memory.WriteBool(sortState.CaseSensitive)});if(null!=sortState.ColumnSort)this.bs.WriteItem(c_oSer_SortState.ColumnSort,function(){oThis.memory.WriteBool(sortState.ColumnSort)});if(null!=sortState.SortMethod)this.bs.WriteItem(c_oSer_SortState.SortMethod,function(){oThis.memory.WriteByte(sortState.SortMethod)});if(null!=sortState.SortConditions)this.bs.WriteItem(c_oSer_SortState.SortConditions,function(){oThis.WriteSortConditions(sortState.SortConditions)})}; this.WriteSortConditions=function(sortConditions){var oThis=this;for(var i=0,length=sortConditions.length;i<length;++i)this.bs.WriteItem(c_oSer_SortState.SortCondition,function(){oThis.WriteSortCondition(sortConditions[i])})};this.WriteSortCondition=function(sortCondition){if(null!=sortCondition.Ref){this.memory.WriteByte(c_oSer_SortState.ConditionRef);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(sortCondition.Ref.getName())}if(null!=sortCondition.ConditionSortBy){this.memory.WriteByte(c_oSer_SortState.ConditionSortBy); this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(sortCondition.ConditionSortBy)}if(null!=sortCondition.ConditionDescending){this.memory.WriteByte(c_oSer_SortState.ConditionDescending);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(sortCondition.ConditionDescending)}if(null!=sortCondition.dxf){this.memory.WriteByte(c_oSer_SortState.ConditionDxfId);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(this.aDxfs.length);this.aDxfs.push(sortCondition.dxf)}}; this.WriteTableColumns=function(tableColumns){var oThis=this;for(var i=0,length=tableColumns.length;i<length;++i)this.bs.WriteItem(c_oSer_TableColumns.TableColumn,function(){oThis.WriteTableColumn(tableColumns[i])})};this.WriteTableColumn=function(tableColumn){var oThis=this;if(null!=tableColumn.Name){this.memory.WriteByte(c_oSer_TableColumns.Name);this.memory.WriteString2(tableColumn.Name)}if(null!=tableColumn.TotalsRowLabel){this.memory.WriteByte(c_oSer_TableColumns.TotalsRowLabel);this.memory.WriteString2(tableColumn.TotalsRowLabel)}if(null!= tableColumn.TotalsRowFunction)this.bs.WriteItem(c_oSer_TableColumns.TotalsRowFunction,function(){oThis.memory.WriteByte(tableColumn.TotalsRowFunction)});if(null!=tableColumn.TotalsRowFormula){this.memory.WriteByte(c_oSer_TableColumns.TotalsRowFormula);this.memory.WriteString2(tableColumn.TotalsRowFormula.getFormula())}if(null!=tableColumn.dxf){this.bs.WriteItem(c_oSer_TableColumns.DataDxfId,function(){oThis.memory.WriteLong(oThis.aDxfs.length)});this.aDxfs.push(tableColumn.dxf)}if(null!=tableColumn.CalculatedColumnFormula){this.memory.WriteByte(c_oSer_TableColumns.CalculatedColumnFormula); this.memory.WriteString2(tableColumn.CalculatedColumnFormula)}};this.WriteTableStyleInfo=function(tableStyleInfo){if(null!=tableStyleInfo.Name){this.memory.WriteByte(c_oSer_TableStyleInfo.Name);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(tableStyleInfo.Name)}if(null!=tableStyleInfo.ShowColumnStripes){this.memory.WriteByte(c_oSer_TableStyleInfo.ShowColumnStripes);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(tableStyleInfo.ShowColumnStripes)}if(null!= tableStyleInfo.ShowRowStripes){this.memory.WriteByte(c_oSer_TableStyleInfo.ShowRowStripes);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(tableStyleInfo.ShowRowStripes)}if(null!=tableStyleInfo.ShowFirstColumn){this.memory.WriteByte(c_oSer_TableStyleInfo.ShowFirstColumn);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(tableStyleInfo.ShowFirstColumn)}if(null!=tableStyleInfo.ShowLastColumn){this.memory.WriteByte(c_oSer_TableStyleInfo.ShowLastColumn);this.memory.WriteByte(c_oSerPropLenType.Byte); this.memory.WriteBool(tableStyleInfo.ShowLastColumn)}}}function BinarySharedStringsTableWriter(memory,wb,oSharedStrings,bsw){this.memory=memory;this.wb=wb;this.bs=new BinaryCommonWriter(this.memory);this.bsw=bsw;this.oSharedStrings=oSharedStrings;this.Write=function(){var oThis=this;this.bs.WriteItemWithLength(function(){oThis.WriteSharedStringsContent()})};this.WriteSharedStringsContent=function(){var oThis=this;var aSharedStrings=[];for(var i in this.oSharedStrings.strings)if(this.oSharedStrings.strings.hasOwnProperty(i)){var from= i-0;var to=oSharedStrings.strings[i];aSharedStrings[to]=this.wb.sharedStrings.get(from)}for(var i=0;i<aSharedStrings.length;++i)this.bs.WriteItem(c_oSerSharedStringTypes.Si,function(){oThis.WriteSi(aSharedStrings[i])})};this.WriteSi=function(si){var oThis=this;if(typeof si==="string"){this.memory.WriteByte(c_oSerSharedStringTypes.Text);this.memory.WriteString2(si)}else for(var i=0,length=si.length;i<length;++i)this.bs.WriteItem(c_oSerSharedStringTypes.Run,function(){oThis.WriteRun(si[i])})};this.WriteRun= function(run){var oThis=this;if(null!=run.format)this.bs.WriteItem(c_oSerSharedStringTypes.RPr,function(){oThis.bsw.WriteFont(run.format)});if(null!=run.text){this.memory.WriteByte(c_oSerSharedStringTypes.Text);this.memory.WriteString2(run.text)}}}function StyleWriteMap(action,prepare){this.action=action;this.prepare=prepare;this.ids={};this.elems=[]}StyleWriteMap.prototype.add=function(elem){var index=0;if(elem){elem=this.action.call(g_StyleCache,elem);index=this.ids[elem.getIndexNumber()];if(undefined=== index){index=this.elems.length;this.ids[elem.getIndexNumber()]=index;this.elems.push(this.prepare?this.prepare(elem):elem)}}return index};function XfForWrite(xf){this.xf=xf;this.fontid=0;this.fillid=0;this.borderid=0;this.numid=0;this.XfId=null;this.ApplyAlignment=null;this.ApplyBorder=null;this.ApplyFill=null;this.ApplyFont=null;this.ApplyNumberFormat=null}function StylesForWrite(){var t=this;this.oXfsMap=new StyleWriteMap(g_StyleCache.addXf,function(xf){return t._getElem(xf,null)});this.oFontMap= new StyleWriteMap(g_StyleCache.addFont);this.oFillMap=new StyleWriteMap(g_StyleCache.addFill);this.oBorderMap=new StyleWriteMap(g_StyleCache.addBorder);this.oNumMap=new StyleWriteMap(g_StyleCache.addNum);this.oXfsStylesMap=[]}StylesForWrite.prototype.init=function(){this.oFontMap.add(g_StyleCache.firstFont);this.oFillMap.add(g_StyleCache.firstFill);this.oFillMap.add(g_StyleCache.secondFill);this.oBorderMap.add(g_StyleCache.firstBorder);this.oXfsMap.add(g_StyleCache.firstXf)};StylesForWrite.prototype.add= function(xf){return this.oXfsMap.add(xf)};StylesForWrite.prototype.addCellStyle=function(style){this.oXfsStylesMap.push(this._getElem(style.xfs,style))};StylesForWrite.prototype.finalizeCellStyles=function(){this.oXfsStylesMap.sort(function(a,b){return a.XfId-b.XfId})};StylesForWrite.prototype.getNumIdByFormat=function(num){var numid=null;if(null!=num.id)numid=num.id;else numid=AscCommonExcel.aStandartNumFormatsId[num.getFormat()];if(null==numid)numid=g_nNumsMaxId+this.oNumMap.add(num);return numid}; StylesForWrite.prototype._getElem=function(xf,style){var elem=new XfForWrite(xf);elem.fontid=this.oFontMap.add(xf.font);elem.fillid=this.oFillMap.add(xf.fill);elem.borderid=this.oBorderMap.add(xf.border);elem.numid=xf.num?this.getNumIdByFormat(xf.num):0;if(null!=xf.align)elem.alignMinimized=xf.align.getDif(g_oDefaultFormat.AlignAbs);if(!style){elem.ApplyAlignment=null!=elem.alignMinimized||null;elem.ApplyBorder=0!=elem.borderid||null;elem.ApplyFill=0!=elem.fillid||null;elem.ApplyFont=0!=elem.fontid|| null;elem.ApplyNumberFormat=0!=elem.numid||null}else{elem.ApplyAlignment=style.ApplyAlignment;elem.ApplyBorder=style.ApplyBorder;elem.ApplyFill=style.ApplyFill;elem.ApplyFont=style.ApplyFont;elem.ApplyNumberFormat=style.ApplyNumberFormat;elem.XfId=style.XfId}return elem};function BinaryStylesTableWriter(memory,wb,aDxfs){this.memory=memory;this.bs=new BinaryCommonWriter(this.memory);this.wb=wb;this.aDxfs=aDxfs;this.stylesForWrite=new StylesForWrite;this.Write=function(){var oThis=this;this.bs.WriteItemWithLength(function(){oThis.WriteStylesContent()})}; this.WriteStylesContent=function(){var oThis=this;var wb=this.wb;this.bs.WriteItem(c_oSerStylesTypes.Borders,function(){oThis.WriteBorders()});this.bs.WriteItem(c_oSerStylesTypes.Fills,function(){oThis.WriteFills()});this.bs.WriteItem(c_oSerStylesTypes.Fonts,function(){oThis.WriteFonts()});this.bs.WriteItem(c_oSerStylesTypes.CellStyleXfs,function(){oThis.WriteCellStyleXfs()});this.bs.WriteItem(c_oSerStylesTypes.CellXfs,function(){oThis.WriteCellXfs()});this.bs.WriteItem(c_oSerStylesTypes.CellStyles, function(){oThis.WriteCellStyles(wb.CellStyles.CustomStyles)});if(null!=wb.TableStyles)this.bs.WriteItem(c_oSerStylesTypes.TableStyles,function(){oThis.WriteTableStyles(wb.TableStyles)});if(null!=this.aDxfs&&this.aDxfs.length>0)this.bs.WriteItem(c_oSerStylesTypes.Dxfs,function(){oThis.WriteDxfs(oThis.aDxfs)});var aExtDxfs=[];var slicerStyles=this.PrepareSlicerStyles(wb.SlicerStyles,aExtDxfs);if(aExtDxfs.length>0)this.bs.WriteItem(c_oSerStylesTypes.ExtDxfs,function(){oThis.WriteDxfs(aExtDxfs)});this.bs.WriteItem(c_oSerStylesTypes.SlicerStyles, function(){oThis.WriteSlicerStyles(slicerStyles)});this.bs.WriteItem(c_oSerStylesTypes.NumFmts,function(){oThis.WriteNumFmts()})};this.WriteBorders=function(){var oThis=this;var elems=this.stylesForWrite.oBorderMap.elems;for(var i=0;i<elems.length;++i){var border=elems[i].getDif(g_oDefaultFormat.BorderAbs);this.bs.WriteItem(c_oSerStylesTypes.Border,function(){oThis.WriteBorder(border)})}};this.WriteBorder=function(border){if(null==border)return;var oThis=this;if(null!=border.b)this.bs.WriteItem(c_oSerBorderTypes.Bottom, function(){oThis.WriteBorderProp(border.b)});if(null!=border.d)this.bs.WriteItem(c_oSerBorderTypes.Diagonal,function(){oThis.WriteBorderProp(border.d)});if(null!=border.r)this.bs.WriteItem(c_oSerBorderTypes.End,function(){oThis.WriteBorderProp(border.r)});if(null!=border.ih)this.bs.WriteItem(c_oSerBorderTypes.Horizontal,function(){oThis.WriteBorderProp(border.ih)});if(null!=border.l)this.bs.WriteItem(c_oSerBorderTypes.Start,function(){oThis.WriteBorderProp(border.l)});if(null!=border.t)this.bs.WriteItem(c_oSerBorderTypes.Top, function(){oThis.WriteBorderProp(border.t)});if(null!=border.iv)this.bs.WriteItem(c_oSerBorderTypes.Vertical,function(){oThis.WriteBorderProp(border.iv)});if(null!=border.dd)this.bs.WriteItem(c_oSerBorderTypes.DiagonalDown,function(){oThis.memory.WriteBool(border.dd)});if(null!=border.du)this.bs.WriteItem(c_oSerBorderTypes.DiagonalUp,function(){oThis.memory.WriteBool(border.du)})};this.WriteBorderProp=function(borderProp){var oThis=this;if(null!=borderProp.c){this.memory.WriteByte(c_oSerBorderPropTypes.Color); this.memory.WriteByte(c_oSerPropLenType.Variable);this.bs.WriteItemWithLength(function(){oThis.bs.WriteColorSpreadsheet(borderProp.c)})}if(null!=borderProp.s){var nStyle=EBorderStyle.borderstyleNone;switch(borderProp.s){case c_oAscBorderStyles.DashDot:nStyle=EBorderStyle.borderstyleDashDot;break;case c_oAscBorderStyles.DashDotDot:nStyle=EBorderStyle.borderstyleDashDotDot;break;case c_oAscBorderStyles.Dashed:nStyle=EBorderStyle.borderstyleDashed;break;case c_oAscBorderStyles.Dotted:nStyle=EBorderStyle.borderstyleDotted; break;case c_oAscBorderStyles.Double:nStyle=EBorderStyle.borderstyleDouble;break;case c_oAscBorderStyles.Hair:nStyle=EBorderStyle.borderstyleHair;break;case c_oAscBorderStyles.Medium:nStyle=EBorderStyle.borderstyleMedium;break;case c_oAscBorderStyles.MediumDashDot:nStyle=EBorderStyle.borderstyleMediumDashDot;break;case c_oAscBorderStyles.MediumDashDotDot:nStyle=EBorderStyle.borderstyleMediumDashDotDot;break;case c_oAscBorderStyles.MediumDashed:nStyle=EBorderStyle.borderstyleMediumDashed;break;case c_oAscBorderStyles.None:nStyle= EBorderStyle.borderstyleNone;break;case c_oAscBorderStyles.SlantDashDot:nStyle=EBorderStyle.borderstyleSlantDashDot;break;case c_oAscBorderStyles.Thick:nStyle=EBorderStyle.borderstyleThick;break;case c_oAscBorderStyles.Thin:nStyle=EBorderStyle.borderstyleThin;break}this.memory.WriteByte(c_oSerBorderPropTypes.Style);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(nStyle)}};this.WriteFills=function(){var oThis=this;var elems=this.stylesForWrite.oFillMap.elems;for(var i=0;i<elems.length;++i)this.bs.WriteItem(c_oSerStylesTypes.Fill, function(){oThis.WriteFill(elems[i])})};this.WriteFill=function(fill,fixDxf){var oThis=this;if(fill.patternFill)this.bs.WriteItem(c_oSerFillTypes.Pattern,function(){oThis.WritePatternFill(fill.patternFill,fixDxf)});if(fill.gradientFill)this.bs.WriteItem(c_oSerFillTypes.Gradient,function(){oThis.WriteGradientFill(fill.gradientFill)})};this.WritePatternFill=function(patternFill,fixDxf){var oThis=this;fixDxf=fixDxf&&(AscCommonExcel.c_oAscPatternType.None===patternFill.patternType||AscCommonExcel.c_oAscPatternType.Solid=== patternFill.patternType);var fgColor=fixDxf?patternFill.bgColor:patternFill.fgColor;var bgColor=fixDxf?patternFill.fgColor:patternFill.bgColor;if(null!=patternFill.patternType)this.bs.WriteItem(c_oSerFillTypes.PatternType,function(){oThis.memory.WriteByte(patternFill.patternType)});if(null!=fgColor)this.bs.WriteItem(c_oSerFillTypes.PatternFgColor,function(){oThis.bs.WriteColorSpreadsheet(fgColor)});if(null!=bgColor)this.bs.WriteItem(c_oSerFillTypes.PatternBgColor,function(){oThis.bs.WriteColorSpreadsheet(bgColor)})}; this.WriteGradientFill=function(gradientFill){var oThis=this;if(null!=gradientFill.type)this.bs.WriteItem(c_oSerFillTypes.GradientType,function(){oThis.memory.WriteByte(gradientFill.type)});if(null!=gradientFill.left)this.bs.WriteItem(c_oSerFillTypes.GradientLeft,function(){oThis.memory.WriteDouble2(gradientFill.left)});if(null!=gradientFill.top)this.bs.WriteItem(c_oSerFillTypes.GradientTop,function(){oThis.memory.WriteDouble2(gradientFill.top)});if(null!=gradientFill.right)this.bs.WriteItem(c_oSerFillTypes.GradientRight, function(){oThis.memory.WriteDouble2(gradientFill.right)});if(null!=gradientFill.bottom)this.bs.WriteItem(c_oSerFillTypes.GradientBottom,function(){oThis.memory.WriteDouble2(gradientFill.bottom)});if(null!=gradientFill.degree)this.bs.WriteItem(c_oSerFillTypes.GradientDegree,function(){oThis.memory.WriteDouble2(gradientFill.degree)});for(var i=0;i<gradientFill.stop.length;++i)this.bs.WriteItem(c_oSerFillTypes.GradientStop,function(){oThis.WriteGradientFillStop(gradientFill.stop[i])})};this.WriteGradientFillStop= function(gradientStop){var oThis=this;if(null!=gradientStop.position)this.bs.WriteItem(c_oSerFillTypes.GradientStopPosition,function(){oThis.memory.WriteDouble2(gradientStop.position)});if(null!=gradientStop.color)this.bs.WriteItem(c_oSerFillTypes.GradientStopColor,function(){oThis.bs.WriteColorSpreadsheet(gradientStop.color)})};this.WriteFonts=function(){var oThis=this;var elems=this.stylesForWrite.oFontMap.elems;for(var i=0;i<elems.length;++i)this.bs.WriteItem(c_oSerStylesTypes.Font,function(){oThis.WriteFont(elems[i])})}; this.WriteFont=function(font){var oThis=this;if(null!=font.b){this.memory.WriteByte(c_oSerFontTypes.Bold);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(font.b)}if(null!=font.c){this.memory.WriteByte(c_oSerFontTypes.Color);this.memory.WriteByte(c_oSerPropLenType.Variable);this.bs.WriteItemWithLength(function(){oThis.bs.WriteColorSpreadsheet(font.c)})}if(null!=font.i){this.memory.WriteByte(c_oSerFontTypes.Italic);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(font.i)}if(null!= font.fn){this.memory.WriteByte(c_oSerFontTypes.RFont);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(font.fn)}if(null!=font.scheme){this.memory.WriteByte(c_oSerFontTypes.Scheme);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(font.scheme)}if(null!=font.s){this.memory.WriteByte(c_oSerFontTypes.Strike);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(font.s)}if(null!=font.fs){this.memory.WriteByte(c_oSerFontTypes.Sz);this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteDouble2(font.fs)}if(null!=font.u){this.memory.WriteByte(c_oSerFontTypes.Underline);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(font.u)}if(null!=font.va){var va=font.va;if(va===AscCommon.vertalign_SubScript)va=AscCommon.vertalign_SuperScript;else if(va===AscCommon.vertalign_SuperScript)va=AscCommon.vertalign_SubScript;this.memory.WriteByte(c_oSerFontTypes.VertAlign);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(va)}};this.WriteNumFmts= function(){var oThis=this;var elems=this.stylesForWrite.oNumMap.elems;for(var i=0;i<elems.length;++i)this.bs.WriteItem(c_oSerStylesTypes.NumFmt,function(){oThis.WriteNum(g_nNumsMaxId+i,elems[i].getFormat())})};this.WriteNum=function(id,format){if(null!=format){this.memory.WriteByte(c_oSerNumFmtTypes.FormatCode);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(format)}if(null!=id){this.memory.WriteByte(c_oSerNumFmtTypes.NumFmtId);this.memory.WriteByte(c_oSerPropLenType.Long); this.memory.WriteLong(id)}};this.WriteCellStyleXfs=function(){var oThis=this;var elems=this.stylesForWrite.oXfsStylesMap;for(var i=0;i<elems.length;++i)this.bs.WriteItem(c_oSerStylesTypes.Xfs,function(){oThis.WriteXfs(elems[i],true)})};this.WriteCellXfs=function(){var oThis=this;var elems=this.stylesForWrite.oXfsMap.elems;for(var i=0;i<elems.length;++i)this.bs.WriteItem(c_oSerStylesTypes.Xfs,function(){oThis.WriteXfs(elems[i])})};this.WriteXfs=function(xfForWrite,isCellStyle){var oThis=this;var xf= xfForWrite.xf;if(null!=xfForWrite.ApplyBorder){this.memory.WriteByte(c_oSerXfsTypes.ApplyBorder);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(xfForWrite.ApplyBorder)}if(null!=xfForWrite.borderid){this.memory.WriteByte(c_oSerXfsTypes.BorderId);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(xfForWrite.borderid)}if(null!=xfForWrite.ApplyFill){this.memory.WriteByte(c_oSerXfsTypes.ApplyFill);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(xfForWrite.ApplyFill)}if(null!= xfForWrite.fillid){this.memory.WriteByte(c_oSerXfsTypes.FillId);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(xfForWrite.fillid)}if(null!=xfForWrite.ApplyFont){this.memory.WriteByte(c_oSerXfsTypes.ApplyFont);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(xfForWrite.ApplyFont)}if(null!=xfForWrite.fontid){this.memory.WriteByte(c_oSerXfsTypes.FontId);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(xfForWrite.fontid)}if(null!=xfForWrite.ApplyNumberFormat){this.memory.WriteByte(c_oSerXfsTypes.ApplyNumberFormat); this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(xfForWrite.ApplyNumberFormat)}if(null!=xfForWrite.numid){this.memory.WriteByte(c_oSerXfsTypes.NumFmtId);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(xfForWrite.numid)}if(null!=xfForWrite.ApplyAlignment){this.memory.WriteByte(c_oSerXfsTypes.ApplyAlignment);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(xfForWrite.ApplyAlignment)}if(null!=xfForWrite.alignMinimized){this.memory.WriteByte(c_oSerXfsTypes.Aligment); this.memory.WriteByte(c_oSerPropLenType.Variable);this.bs.WriteItemWithLength(function(){oThis.WriteAlign(xfForWrite.alignMinimized)})}if(xf){if(null!=xf.QuotePrefix){this.memory.WriteByte(c_oSerXfsTypes.QuotePrefix);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(xf.QuotePrefix)}if(null!=xf.PivotButton){this.memory.WriteByte(c_oSerXfsTypes.PivotButton);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(xf.PivotButton)}if(!isCellStyle&&null!=xf.XfId){this.memory.WriteByte(c_oSerXfsTypes.XfId); this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(xf.XfId)}}};this.WriteAlign=function(align){if(null!=align.hor){var ha=4;switch(align.hor){case AscCommon.align_Center:ha=0;break;case AscCommon.align_Justify:ha=5;break;case AscCommon.align_Left:ha=6;break;case AscCommon.align_Right:ha=7;break}this.memory.WriteByte(c_oSerAligmentTypes.Horizontal);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(ha)}if(null!=align.indent){this.memory.WriteByte(c_oSerAligmentTypes.Indent); this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(align.indent)}if(null!=align.RelativeIndent){this.memory.WriteByte(c_oSerAligmentTypes.RelativeIndent);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(align.RelativeIndent)}if(null!=align.shrink){this.memory.WriteByte(c_oSerAligmentTypes.ShrinkToFit);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(align.shrink)}if(null!=align.angle){this.memory.WriteByte(c_oSerAligmentTypes.TextRotation);this.memory.WriteByte(c_oSerPropLenType.Long); this.memory.WriteLong(align.angle)}if(null!=align.ver){this.memory.WriteByte(c_oSerAligmentTypes.Vertical);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(align.ver)}if(null!=align.wrap){this.memory.WriteByte(c_oSerAligmentTypes.WrapText);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(align.wrap)}};this.WriteDxfs=function(Dxfs){var oThis=this;for(var i=0,length=Dxfs.length;i<length;++i)this.bs.WriteItem(c_oSerStylesTypes.Dxf,function(){oThis.WriteDxf(Dxfs[i])})}; this.WriteDxf=function(Dxf){var oThis=this;if(null!=Dxf.align)this.bs.WriteItem(c_oSer_Dxf.Alignment,function(){oThis.WriteAlign(Dxf.align)});if(null!=Dxf.border)this.bs.WriteItem(c_oSer_Dxf.Border,function(){oThis.WriteBorder(Dxf.border)});if(null!=Dxf.fill)this.bs.WriteItem(c_oSer_Dxf.Fill,function(){oThis.WriteFill(Dxf.fill,true)});if(null!=Dxf.font)this.bs.WriteItem(c_oSer_Dxf.Font,function(){oThis.WriteFont(Dxf.font)});if(null!=Dxf.num){var numId=this.stylesForWrite.getNumIdByFormat(Dxf.num); if(null!=numId)this.bs.WriteItem(c_oSer_Dxf.NumFmt,function(){oThis.WriteNum(numId,Dxf.num.getFormat())})}};this.WriteCellStyles=function(cellStyles){var oThis=this;for(var i=0,length=cellStyles.length;i<length;++i){var style=cellStyles[i];this.bs.WriteItem(c_oSerStylesTypes.CellStyle,function(){oThis.WriteCellStyle(style)})}};this.WriteCellStyle=function(oCellStyle){var oThis=this;if(null!=oCellStyle.BuiltinId)this.bs.WriteItem(c_oSer_CellStyle.BuiltinId,function(){oThis.memory.WriteLong(oCellStyle.BuiltinId)}); if(null!=oCellStyle.CustomBuiltin)this.bs.WriteItem(c_oSer_CellStyle.CustomBuiltin,function(){oThis.memory.WriteBool(oCellStyle.CustomBuiltin)});if(null!=oCellStyle.Hidden)this.bs.WriteItem(c_oSer_CellStyle.Hidden,function(){oThis.memory.WriteBool(oCellStyle.Hidden)});if(null!=oCellStyle.ILevel)this.bs.WriteItem(c_oSer_CellStyle.ILevel,function(){oThis.memory.WriteLong(oCellStyle.ILevel)});if(null!=oCellStyle.Name){this.memory.WriteByte(c_oSer_CellStyle.Name);this.memory.WriteString2(oCellStyle.Name)}if(null!= oCellStyle.XfId)this.bs.WriteItem(c_oSer_CellStyle.XfId,function(){oThis.memory.WriteLong(oCellStyle.XfId)})};this.PrepareSlicerStyles=function(slicerStyles,aDxfs){var styles=new Asc.CT_slicerStyles;styles.defaultSlicerStyle=slicerStyles.DefaultStyle;for(var name in slicerStyles.CustomStyles)if(slicerStyles.CustomStyles.hasOwnProperty(name)){var slicerStyle=new Asc.CT_slicerStyle;slicerStyle.name=name;var elems=slicerStyles.CustomStyles[name];for(var type in elems)if(elems.hasOwnProperty(type)){var styleElement= new Asc.CT_slicerStyleElement;styleElement.type=parseInt(type);styleElement.dxfId=aDxfs.length;aDxfs.push(elems[type]);slicerStyle.slicerStyleElements.push(styleElement)}styles.slicerStyle.push(slicerStyle)}return styles};this.WriteSlicerStyles=function(slicerStyles){var old=new AscCommon.CMemory(true);pptx_content_writer.BinaryFileWriter.ExportToMemory(old);pptx_content_writer.BinaryFileWriter.ImportFromMemory(this.memory);pptx_content_writer.BinaryFileWriter.WriteRecord4(0,slicerStyles);pptx_content_writer.BinaryFileWriter.ExportToMemory(this.memory); pptx_content_writer.BinaryFileWriter.ImportFromMemory(old)};this.WriteTableStyles=function(tableStyles){var oThis=this;if(null!=tableStyles.DefaultTableStyle){this.memory.WriteByte(c_oSer_TableStyles.DefaultTableStyle);this.memory.WriteString2(tableStyles.DefaultTableStyle)}if(null!=tableStyles.DefaultPivotStyle){this.memory.WriteByte(c_oSer_TableStyles.DefaultPivotStyle);this.memory.WriteString2(tableStyles.DefaultPivotStyle)}var bEmptyCustom=true;for(var i in tableStyles.CustomStyles){bEmptyCustom= false;break}if(false==bEmptyCustom)this.bs.WriteItem(c_oSer_TableStyles.TableStyles,function(){oThis.WriteTableCustomStyles(tableStyles.CustomStyles)})};this.WriteTableCustomStyles=function(customStyles){var oThis=this;for(var i in customStyles){var style=customStyles[i];this.bs.WriteItem(c_oSer_TableStyles.TableStyle,function(){oThis.WriteTableCustomStyle(style)})}};this.WriteTableCustomStyle=function(customStyle){var oThis=this;if(null!=customStyle.name){this.memory.WriteByte(c_oSer_TableStyle.Name); this.memory.WriteString2(customStyle.name)}if(false===customStyle.pivot)this.bs.WriteItem(c_oSer_TableStyle.Pivot,function(){oThis.memory.WriteBool(customStyle.pivot)});if(false===customStyle.table)this.bs.WriteItem(c_oSer_TableStyle.Table,function(){oThis.memory.WriteBool(customStyle.table)});this.bs.WriteItem(c_oSer_TableStyle.Elements,function(){oThis.WriteTableCustomStyleElements(customStyle)})};this.WriteTableCustomStyleElements=function(customStyle){var oThis=this;if(null!=customStyle.blankRow)this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeBlankRow,customStyle.blankRow)});if(null!=customStyle.firstColumn)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstColumn,customStyle.firstColumn)});if(null!=customStyle.firstColumnStripe)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstColumnStripe,customStyle.firstColumnStripe)}); if(null!=customStyle.firstColumnSubheading)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstColumnSubheading,customStyle.firstColumnSubheading)});if(null!=customStyle.firstHeaderCell)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstHeaderCell,customStyle.firstHeaderCell)});if(null!=customStyle.firstRowStripe)this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstRowStripe,customStyle.firstRowStripe)});if(null!=customStyle.firstRowSubheading)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstRowSubheading,customStyle.firstRowSubheading)});if(null!=customStyle.firstSubtotalColumn)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstSubtotalColumn, customStyle.firstSubtotalColumn)});if(null!=customStyle.firstSubtotalRow)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstSubtotalRow,customStyle.firstSubtotalRow)});if(null!=customStyle.firstTotalCell)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeFirstTotalCell,customStyle.firstTotalCell)});if(null!=customStyle.headerRow)this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeHeaderRow,customStyle.headerRow)});if(null!=customStyle.lastColumn)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeLastColumn,customStyle.lastColumn)});if(null!=customStyle.lastHeaderCell)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeLastHeaderCell,customStyle.lastHeaderCell)}); if(null!=customStyle.lastTotalCell)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeLastTotalCell,customStyle.lastTotalCell)});if(null!=customStyle.pageFieldLabels)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypePageFieldLabels,customStyle.pageFieldLabels)});if(null!=customStyle.pageFieldValues)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypePageFieldValues, customStyle.pageFieldValues)});if(null!=customStyle.secondColumnStripe)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeSecondColumnStripe,customStyle.secondColumnStripe)});if(null!=customStyle.secondColumnSubheading)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeSecondColumnSubheading,customStyle.secondColumnSubheading)});if(null!=customStyle.secondRowStripe)this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeSecondRowStripe,customStyle.secondRowStripe)});if(null!=customStyle.secondRowSubheading)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeSecondRowSubheading,customStyle.secondRowSubheading)});if(null!=customStyle.secondSubtotalColumn)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeSecondSubtotalColumn, customStyle.secondSubtotalColumn)});if(null!=customStyle.secondSubtotalRow)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeSecondSubtotalRow,customStyle.secondSubtotalRow)});if(null!=customStyle.thirdColumnSubheading)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeThirdColumnSubheading,customStyle.thirdColumnSubheading)});if(null!=customStyle.thirdRowSubheading)this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeThirdRowSubheading,customStyle.thirdRowSubheading)});if(null!=customStyle.thirdSubtotalColumn)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeThirdSubtotalColumn,customStyle.thirdSubtotalColumn)});if(null!=customStyle.thirdSubtotalRow)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeThirdSubtotalRow, customStyle.thirdSubtotalRow)});if(null!=customStyle.totalRow)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeTotalRow,customStyle.totalRow)});if(null!=customStyle.wholeTable)this.bs.WriteItem(c_oSer_TableStyle.Element,function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeWholeTable,customStyle.wholeTable)})};this.WriteTableCustomStyleElement=function(type,customElement){if(null!=type){this.memory.WriteByte(c_oSer_TableStyleElement.Type); this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(type)}if(null!=customElement.size){this.memory.WriteByte(c_oSer_TableStyleElement.Size);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(customElement.size)}if(null!=customElement.dxf&&null!=this.aDxfs){this.memory.WriteByte(c_oSer_TableStyleElement.DxfId);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(this.aDxfs.length);this.aDxfs.push(customElement.dxf)}}}function BinaryWorkbookTableWriter(memory, wb,oBinaryWorksheetsTableWriter,isCopyPaste,tableIds,sheetIds){this.memory=memory;this.bs=new BinaryCommonWriter(this.memory);this.wb=wb;this.oBinaryWorksheetsTableWriter=oBinaryWorksheetsTableWriter;this.isCopyPaste=isCopyPaste;this.tableIds=tableIds;this.sheetIds=sheetIds;this.Write=function(){var oThis=this;this.bs.WriteItemWithLength(function(){oThis.WriteWorkbookContent()})};this.PrepareTableIds=function(){var oThis=this;var index=1;this.oBinaryWorksheetsTableWriter.wb.forEach(function(ws){for(var i= 0;i<ws.TableParts.length;++i)oThis.tableIds[ws.TableParts[i].DisplayName]={id:index++,table:ws.TableParts[i]}},this.oBinaryWorksheetsTableWriter.isCopyPaste)};this.PrepareSheetIds=function(){var oThis=this;var index=1;this.oBinaryWorksheetsTableWriter.wb.forEach(function(ws){oThis.sheetIds[ws.getId()]=index++},this.oBinaryWorksheetsTableWriter.isCopyPaste)};this.WriteWorkbookContent=function(){var oThis=this;this.bs.WriteItem(c_oSerWorkbookTypes.WorkbookPr,function(){oThis.WriteWorkbookPr()});this.bs.WriteItem(c_oSerWorkbookTypes.BookViews, function(){oThis.WriteBookViews()});this.bs.WriteItem(c_oSerWorkbookTypes.DefinedNames,function(){oThis.WriteDefinedNames()});this.bs.WriteItem(c_oSerWorkbookTypes.CalcPr,function(){oThis.WriteCalcPr(oThis.wb.calcPr)});var pivotCacheIndex=0;var pivotCaches={};this.oBinaryWorksheetsTableWriter.wb.forEach(function(ws){for(var i=0;i<ws.pivotTables.length;++i){var pivotTable=ws.pivotTables[i];if(oThis.isCopyPaste&&!pivotTable.isInRange(oThis.isCopyPaste))continue;if(pivotTable.cacheDefinition){var pivotCache= pivotCaches[pivotTable.cacheDefinition.Get_Id()];if(!pivotCache){pivotCache={id:pivotCacheIndex++,cache:pivotTable.cacheDefinition};pivotCaches[pivotTable.cacheDefinition.Get_Id()]=pivotCache}pivotTable.cacheId=pivotCache.id}}for(var i=0;i<ws.aSlicers.length;++i){var slicer=ws.aSlicers[i];if(oThis.isCopyPaste)continue;var cacheDefinition=slicer.getPivotCache();if(cacheDefinition){var pivotCache=pivotCaches[cacheDefinition.Get_Id()];if(!pivotCache){pivotCache={id:pivotCacheIndex++,cache:cacheDefinition}; pivotCaches[cacheDefinition.Get_Id()]=pivotCache}}}},this.oBinaryWorksheetsTableWriter.isCopyPaste);if(pivotCacheIndex>0)this.bs.WriteItem(c_oSerWorkbookTypes.PivotCaches,function(){oThis.WritePivotCaches(pivotCaches)});if(!this.oBinaryWorksheetsTableWriter.isCopyPaste)this.PrepareTableIds();this.PrepareSheetIds();var slicerCacheIndex=0;var slicerCaches={};var slicerCacheExtIndex=0;var slicerCachesExt={};this.oBinaryWorksheetsTableWriter.wb.forEach(function(ws){for(var i=0;i<ws.aSlicers.length;++i){var slicerCache= ws.aSlicers[i].getSlicerCache();if(slicerCache)if(ws.aSlicers[i].isExt()){slicerCachesExt[slicerCache.name]=slicerCache;slicerCacheExtIndex++}else{slicerCaches[slicerCache.name]=slicerCache;slicerCacheIndex++}}},this.oBinaryWorksheetsTableWriter.isCopyPaste);if(slicerCacheIndex>0)this.bs.WriteItem(c_oSerWorkbookTypes.SlicerCaches,function(){oThis.WriteSlicerCaches(slicerCaches,oThis.tableIds,oThis.sheetIds)});if(slicerCacheExtIndex>0)this.bs.WriteItem(c_oSerWorkbookTypes.SlicerCachesExt,function(){oThis.WriteSlicerCaches(slicerCachesExt, oThis.tableIds,oThis.sheetIds)});if(!this.isCopyPaste&&this.wb.externalReferences.length>0)this.bs.WriteItem(c_oSerWorkbookTypes.ExternalReferences,function(){oThis.WriteExternalReferences()});if(!this.isCopyPaste){var macros=this.wb.oApi.macros.GetData();if(macros)this.bs.WriteItem(c_oSerWorkbookTypes.JsaProject,function(){oThis.memory.WriteXmlString(macros)});if(this.wb.aComments.length>0)this.bs.WriteItem(c_oSerWorkbookTypes.Comments,function(){oThis.WriteComments(oThis.wb.aComments)});if(this.wb.connections)this.bs.WriteItem(c_oSerWorkbookTypes.Connections, function(){oThis.memory.WriteBuffer(oThis.wb.connections,0,oThis.wb.connections.length)})}};this.WriteWorkbookPr=function(){var oWorkbookPr=this.wb.WorkbookPr;if(null!=oWorkbookPr)if(null!=oWorkbookPr.Date1904){this.memory.WriteByte(c_oSerWorkbookPrTypes.Date1904);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oWorkbookPr.Date1904)}else if(null!=oWorkbookPr.DateCompatibility){this.memory.WriteByte(c_oSerWorkbookPrTypes.DateCompatibility);this.memory.WriteByte(c_oSerPropLenType.Byte); this.memory.WriteBool(oWorkbookPr.DateCompatibility)}else if(null!=oWorkbookPr.HidePivotFieldList){this.memory.WriteByte(c_oSerWorkbookPrTypes.HidePivotFieldList);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oWorkbookPr.HidePivotFieldList)}else if(null!=oWorkbookPr.ShowPivotChartFilter){this.memory.WriteByte(c_oSerWorkbookPrTypes.ShowPivotChartFilter);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oWorkbookPr.ShowPivotChartFilter)}};this.WriteBookViews= function(){var oThis=this;this.bs.WriteItem(c_oSerWorkbookTypes.WorkbookView,function(){oThis.WriteWorkbookView()})};this.WriteWorkbookView=function(){if(null!=this.wb.nActive){this.memory.WriteByte(c_oSerWorkbookViewTypes.ActiveTab);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(this.wb.nActive)}};this.WriteDefinedNames=function(){var oThis=this;var defNameList=this.wb.dependencyFormulas.saveDefName(this.isCopyPaste===false);var filterDefName="_xlnm._FilterDatabase";var tempMap= {};var printAreaDefName="Print_Area";var prefix="_xlnm.";if(null!=defNameList)for(var i=0;i<defNameList.length;i++)if(defNameList[i].Name!==filterDefName){if(defNameList[i].Name==="_FilterDatabase")tempMap[defNameList[i].LocalSheetId]=1;var oldName=null;if(printAreaDefName===defNameList[i].Name&&null!=defNameList[i].LocalSheetId&&true===defNameList[i].isXLNM){oldName=defNameList[i].Name;defNameList[i].Name=prefix+defNameList[i].Name}this.bs.WriteItem(c_oSerWorkbookTypes.DefinedName,function(){oThis.WriteDefinedName(defNameList[i])}); if(null!==oldName)defNameList[i].Name=oldName}var ws,ref,defNameRef,defName;for(var i=0;i<wb.aWorksheets.length;i++){ws=wb.aWorksheets[i];if(ws&&ws.AutoFilter&&ws.AutoFilter.Ref&&!tempMap[ws.index]){ref=ws.AutoFilter.Ref;defNameRef=AscCommon.parserHelp.get3DRef(ws.getName(),ref.getAbsName());defName=new Asc.asc_CDefName(filterDefName,defNameRef,ws.index,null,true);this.bs.WriteItem(c_oSerWorkbookTypes.DefinedName,function(){oThis.WriteDefinedName(defName)})}}};this.WriteDefinedName=function(oDefinedName, LocalSheetId){var oThis=this;if(null!=oDefinedName.Name){this.memory.WriteByte(c_oSerDefinedNameTypes.Name);this.memory.WriteString2(oDefinedName.Name)}if(null!=oDefinedName.Ref){this.memory.WriteByte(c_oSerDefinedNameTypes.Ref);this.memory.WriteString2(oDefinedName.Ref)}if(null!==oDefinedName.LocalSheetId){var _localSheetId=oDefinedName.LocalSheetId;if(this.isCopyPaste===false)_localSheetId=0;this.bs.WriteItem(c_oSerDefinedNameTypes.LocalSheetId,function(){oThis.memory.WriteLong(_localSheetId)})}if(null!= oDefinedName.Hidden)this.bs.WriteItem(c_oSerDefinedNameTypes.Hidden,function(){oThis.memory.WriteBool(oDefinedName.Hidden)})};this.WriteCalcPr=function(calcPr){var t=this;if(null!=calcPr.calcMode)this.bs.WriteItem(c_oSerCalcPrTypes.CalcMode,function(){t.memory.WriteByte(calcPr.calcMode)});if(null!=calcPr.fullCalcOnLoad)this.bs.WriteItem(c_oSerCalcPrTypes.FullCalcOnLoad,function(){t.memory.WriteBool(calcPr.fullCalcOnLoad)});if(null!=calcPr.refMode)this.bs.WriteItem(c_oSerCalcPrTypes.RefMode,function(){t.memory.WriteByte(calcPr.refMode)}); if(null!=calcPr.iterate)this.bs.WriteItem(c_oSerCalcPrTypes.Iterate,function(){t.memory.WriteBool(calcPr.iterate)});if(null!=calcPr.iterateCount)this.bs.WriteItem(c_oSerCalcPrTypes.IterateCount,function(){t.memory.WriteLong(calcPr.iterateCount)});if(null!=calcPr.iterateDelta)this.bs.WriteItem(c_oSerCalcPrTypes.IterateDelta,function(){t.memory.WriteDouble2(calcPr.iterateDelta)});if(null!=calcPr.fullPrecision)this.bs.WriteItem(c_oSerCalcPrTypes.FullPrecision,function(){t.memory.WriteBool(calcPr.fullPrecision)}); if(null!=calcPr.calcCompleted)this.bs.WriteItem(c_oSerCalcPrTypes.CalcCompleted,function(){t.memory.WriteBool(calcPr.calcCompleted)});if(null!=calcPr.calcOnSave)this.bs.WriteItem(c_oSerCalcPrTypes.CalcOnSave,function(){t.memory.WriteBool(calcPr.calcOnSave)});if(null!=calcPr.concurrentCalc)this.bs.WriteItem(c_oSerCalcPrTypes.ConcurrentCalc,function(){t.memory.WriteBool(calcPr.concurrentCalc)});if(null!=calcPr.concurrentManualCount)this.bs.WriteItem(c_oSerCalcPrTypes.ConcurrentManualCount,function(){t.memory.WriteLong(calcPr.concurrentManualCount)}); if(null!=calcPr.forceFullCalc)this.bs.WriteItem(c_oSerCalcPrTypes.ForceFullCalc,function(){t.memory.WriteBool(calcPr.forceFullCalc)})};this.WritePivotCaches=function(pivotCaches){var oThis=this;for(var id in pivotCaches)if(pivotCaches.hasOwnProperty(id)){var elem=pivotCaches[id];this.bs.WriteItem(c_oSerWorkbookTypes.PivotCache,function(){oThis.WritePivotCache(elem.id,elem.cache)})}};this.WritePivotCache=function(id,pivotCache){var oThis=this;var oldId=pivotCache.id;pivotCache.id=null;this.bs.WriteItem(c_oSer_PivotTypes.id, function(){oThis.memory.WriteLong(id-0)});var stylesForWrite=oThis.isCopyPaste?undefined:oThis.oBinaryWorksheetsTableWriter.stylesForWrite;this.bs.WriteItem(c_oSer_PivotTypes.cache,function(){pivotCache.toXml(oThis.memory,stylesForWrite)});if(pivotCache.cacheRecords)this.bs.WriteItem(c_oSer_PivotTypes.record,function(){pivotCache.cacheRecords.toXml(oThis.memory)});pivotCache.id=oldId};this.WriteSlicerCaches=function(slicerCaches,tableIds,sheetIds){var oThis=this;var stream=pptx_content_writer.BinaryFileWriter; for(var name in slicerCaches)if(slicerCaches.hasOwnProperty(name))this.bs.WriteItem(c_oSerWorkbookTypes.SlicerCache,function(){var old=new AscCommon.CMemory(true);stream.ExportToMemory(old);stream.ImportFromMemory(oThis.memory);stream.StartRecord(0);slicerCaches[name].toStream(stream,tableIds,sheetIds,oThis.isCopyPaste||oThis.isCopyPaste===false);stream.EndRecord();stream.ExportToMemory(oThis.memory);stream.ImportFromMemory(old)})};this.WriteExternalReferences=function(){var oThis=this;for(var i= 0;i<this.wb.externalReferences.length;i++){var externalReference=this.wb.externalReferences[i];switch(externalReference.Type){case 0:this.bs.WriteItem(c_oSerWorkbookTypes.ExternalBook,function(){oThis.WriteExternalReference(externalReference)});break;case 1:this.bs.WriteItem(c_oSerWorkbookTypes.OleLink,function(){oThis.memory.WriteBuffer(externalReference.Buffer,0,externalReference.Buffer.length)});break;case 2:this.bs.WriteItem(c_oSerWorkbookTypes.DdeLink,function(){oThis.memory.WriteBuffer(externalReference.Buffer, 0,externalReference.Buffer.length)});break}}};this.WriteExternalReference=function(externalReference){var oThis=this;if(null!=externalReference.Id){oThis.memory.WriteByte(c_oSer_ExternalLinkTypes.Id);oThis.memory.WriteString2(externalReference.Id)}if(externalReference.SheetNames.length>0)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetNames,function(){oThis.WriteExternalSheetNames(externalReference.SheetNames)});if(externalReference.DefinedNames.length>0)this.bs.WriteItem(c_oSer_ExternalLinkTypes.DefinedNames, function(){oThis.WriteExternalDefinedNames(externalReference.DefinedNames)});if(externalReference.SheetDataSet.length>0)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetDataSet,function(){oThis.WriteExternalSheetDataSet(externalReference.SheetDataSet)})};this.WriteExternalSheetNames=function(sheetNames){for(var i=0;i<sheetNames.length;i++){this.memory.WriteByte(c_oSer_ExternalLinkTypes.SheetName);this.memory.WriteString2(sheetNames[i])}};this.WriteExternalDefinedNames=function(definedNames){var oThis= this;for(var i=0;i<definedNames.length;i++)this.bs.WriteItem(c_oSer_ExternalLinkTypes.DefinedName,function(){oThis.WriteExternalDefinedName(definedNames[i])})};this.WriteExternalDefinedName=function(definedName){var oThis=this;if(null!=definedName.Name){oThis.memory.WriteByte(c_oSer_ExternalLinkTypes.DefinedNameName);oThis.memory.WriteString2(definedName.Name)}if(null!=definedName.RefersTo){oThis.memory.WriteByte(c_oSer_ExternalLinkTypes.DefinedNameRefersTo);oThis.memory.WriteString2(definedName.RefersTo)}if(null!= definedName.SheetId)this.bs.WriteItem(c_oSer_ExternalLinkTypes.DefinedNameSheetId,function(){oThis.memory.WriteLong(definedName.SheetId)})};this.WriteExternalSheetDataSet=function(sheetDataSet){var oThis=this;for(var i=0;i<sheetDataSet.length;i++)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetData,function(){oThis.WriteExternalSheetData(sheetDataSet[i])})};this.WriteExternalSheetData=function(sheetData){var oThis=this;if(null!=sheetData.SheetId)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetDataSheetId, function(){oThis.memory.WriteLong(sheetData.SheetId)});if(null!=sheetData.RefreshError)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetDataRefreshError,function(){oThis.memory.WriteBool(sheetData.RefreshError)});if(sheetData.Row.length>0)for(var i=0;i<sheetData.Row.length;i++)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetDataRow,function(){oThis.WriteExternalRow(sheetData.Row[i])})};this.WriteExternalRow=function(row){var oThis=this;if(null!=row.R)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetDataRowR, function(){oThis.memory.WriteLong(row.R)});if(row.Cell.length>0)for(var i=0;i<row.Cell.length;i++)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetDataRowCell,function(){oThis.WriteExternalCell(row.Cell[i])})};this.WriteExternalCell=function(cell){var oThis=this;if(null!=cell.Ref){oThis.memory.WriteByte(c_oSer_ExternalLinkTypes.SheetDataRowCellRef);oThis.memory.WriteString2(cell.Ref)}if(null!=cell.CellType)this.bs.WriteItem(c_oSer_ExternalLinkTypes.SheetDataRowCellType,function(){oThis.memory.WriteByte(cell.CellType)}); if(null!=cell.CellValue){oThis.memory.WriteByte(c_oSer_ExternalLinkTypes.SheetDataRowCellValue);oThis.memory.WriteString2(cell.CellValue)}};this.WriteComments=function(aComments){var t=this;for(var i=0;i<aComments.length;++i)this.bs.WriteItem(c_oSer_Comments.CommentData,function(){t.oBinaryWorksheetsTableWriter.WriteCommentData(aComments[i])})}}function BinaryWorksheetsTableWriter(memory,wb,oSharedStrings,aDxfs,personList,isCopyPaste,bsw,saveThreadedComments,commentUniqueGuids,tableIds,sheetIds){this.memory= memory;this.bs=new BinaryCommonWriter(this.memory);this.bsw=bsw;this.wb=wb;this.oSharedStrings=oSharedStrings;this.aDxfs=aDxfs;this.personList=personList;this.stylesForWrite=bsw.stylesForWrite;this.isCopyPaste=isCopyPaste;this.saveThreadedComments=saveThreadedComments;this.sharedFormulas={};this.sharedFormulasIndex=0;this.commentUniqueGuids=commentUniqueGuids;this.tableIds=tableIds;this.sheetIds=sheetIds;this._getCrc32FromObjWithProperty=function(val){return Asc.crc32(this._getStringFromObjWithProperty(val))}; this._getStringFromObjWithProperty=function(val){var sRes="";if(val.getProperties){var properties=val.getProperties();for(var i in properties){var oCurProp=val.getProperty(properties[i]);if(null!=oCurProp&&oCurProp.getProperties)sRes+=this._getStringFromObjWithProperty(oCurProp);else sRes+=oCurProp}}return sRes};this._prepeareStyles=function(){this.stylesForWrite.init();var styles=this.wb.CellStyles.CustomStyles;var style=null;for(var i=0;i<styles.length;++i){style=styles[i];if(style.xfs)this.stylesForWrite.addCellStyle(style)}this.stylesForWrite.finalizeCellStyles()}; this.Write=function(){var oThis=this;this._prepeareStyles();this.bs.WriteItemWithLength(function(){oThis.WriteWorksheetsContent()})};this.WriteWorksheetsContent=function(){var oThis=this;var hasColorFilter=false;this.wb.forEach(function(ws,index){oThis.bs.WriteItem(c_oSerWorksheetsTypes.Worksheet,function(){oThis.WriteWorksheet(ws)});hasColorFilter=ws.aNamedSheetViews.some(function(namedSheetView){return namedSheetView.hasColorFilter()})},this.isCopyPaste);if(hasColorFilter&&0===this.aDxfs.length)this.aDxfs.push(new AscCommonExcel.CellXfs)}; this.WriteWorksheet=function(ws){var i;var oThis=this;this.bs.WriteItem(c_oSerWorksheetsTypes.WorksheetProp,function(){oThis.WriteWorksheetProp(ws)});if(ws.aCols.length>0||null!=ws.oAllCol)this.bs.WriteItem(c_oSerWorksheetsTypes.Cols,function(){oThis.WriteWorksheetCols(ws)});this.bs.WriteItem(c_oSerWorksheetsTypes.SheetViews,function(){oThis.WriteSheetViews(ws)});if(null!==ws.sheetPr)this.bs.WriteItem(c_oSerWorksheetsTypes.SheetPr,function(){oThis.WriteSheetPr(ws.sheetPr)});this.bs.WriteItem(c_oSerWorksheetsTypes.SheetFormatPr, function(){oThis.WriteSheetFormatPr(ws)});if(null!=ws.PagePrintOptions){this.bs.WriteItem(c_oSerWorksheetsTypes.PageMargins,function(){oThis.WritePageMargins(ws.PagePrintOptions.asc_getPageMargins())});this.bs.WriteItem(c_oSerWorksheetsTypes.PageSetup,function(){oThis.WritePageSetup(ws.PagePrintOptions.asc_getPageSetup())});this.bs.WriteItem(c_oSerWorksheetsTypes.PrintOptions,function(){oThis.WritePrintOptions(ws.PagePrintOptions)})}this.bs.WriteItem(c_oSerWorksheetsTypes.SheetData,function(){oThis.bs.WriteItem(c_oSerWorksheetsTypes.XlsbPos, function(){oThis.memory.WriteULong(oThis.memory.GetCurPosition()+4);oThis.WriteSheetDataXLSB(ws)})});this.bs.WriteItem(c_oSerWorksheetsTypes.Hyperlinks,function(){oThis.WriteHyperlinks(ws)});this.bs.WriteItem(c_oSerWorksheetsTypes.MergeCells,function(){oThis.WriteMergeCells(ws)});if(ws.Drawings&&ws.Drawings.length)this.bs.WriteItem(c_oSerWorksheetsTypes.Drawings,function(){oThis.WriteDrawings(ws.Drawings)});if(ws.aComments.length>0)this.bs.WriteItem(c_oSerWorksheetsTypes.Comments,function(){oThis.WriteComments(ws.aComments, ws)});var oBinaryTableWriter;if(null!=ws.AutoFilter&&!this.isCopyPaste){oBinaryTableWriter=new BinaryTableWriter(this.memory,this.aDxfs,false,{});this.bs.WriteItem(c_oSerWorksheetsTypes.Autofilter,function(){oBinaryTableWriter.WriteAutoFilter(ws.AutoFilter)})}if(null!=ws.sortState&&!this.isCopyPaste){oBinaryTableWriter=new BinaryTableWriter(this.memory,this.aDxfs,false,{});this.bs.WriteItem(c_oSerWorksheetsTypes.SortState,function(){oBinaryTableWriter.WriteSortState(ws.sortState)})}if(null!=ws.TableParts&& ws.TableParts.length>0){oBinaryTableWriter=new BinaryTableWriter(this.memory,this.aDxfs,this.isCopyPaste,this.tableIds);this.bs.WriteItem(c_oSerWorksheetsTypes.TableParts,function(){oBinaryTableWriter.Write(ws.TableParts,ws)})}if(ws.aSparklineGroups.length>0)this.bs.WriteItem(c_oSerWorksheetsTypes.SparklineGroups,function(){oThis.WriteSparklineGroups(ws.aSparklineGroups)});for(i=0;i<ws.aConditionalFormattingRules.length;++i)this.bs.WriteItem(c_oSerWorksheetsTypes.ConditionalFormatting,function(){oThis.WriteConditionalFormatting(ws.aConditionalFormattingRules[i])}); for(i=0;i<ws.pivotTables.length;++i)this.bs.WriteItem(c_oSerWorksheetsTypes.PivotTable,function(){oThis.WritePivotTable(ws.pivotTables[i],oThis.isCopyPaste)});var slicers=new Asc.CT_slicers;var slicerExt=new Asc.CT_slicers;for(var i=0;i<ws.aSlicers.length;++i){if(this.isCopyPaste){var _graphicObject=ws.workbook.getSlicerViewByName(ws.aSlicers[i].name);if(!_graphicObject||!_graphicObject.selected)continue}if(ws.aSlicers[i].isExt())slicerExt.slicer.push(ws.aSlicers[i]);else slicers.slicer.push(ws.aSlicers[i])}if(slicers.slicer.length> 0)this.bs.WriteItem(c_oSerWorksheetsTypes.Slicers,function(){oThis.WriteSlicers(slicers)});if(slicerExt.slicer.length>0)this.bs.WriteItem(c_oSerWorksheetsTypes.SlicersExt,function(){oThis.WriteSlicers(slicerExt)});if(null!==ws.headerFooter)this.bs.WriteItem(c_oSerWorksheetsTypes.HeaderFooter,function(){oThis.WriteHeaderFooter(ws.headerFooter)});if(null!==ws.rowBreaks)this.bs.WriteItem(c_oSerWorksheetsTypes.RowBreaks,function(){oThis.WriteRowColBreaks(ws.rowBreaks)});if(null!==ws.colBreaks)this.bs.WriteItem(c_oSerWorksheetsTypes.ColBreaks, function(){oThis.WriteRowColBreaks(ws.colBreaks)});if(null!==ws.legacyDrawingHF)this.bs.WriteItem(c_oSerWorksheetsTypes.LegacyDrawingHF,function(){oThis.WriteLegacyDrawingHF(ws.legacyDrawingHF)});if(null!==ws.picture){this.memory.WriteByte(c_oSerWorksheetsTypes.Picture);this.memory.WriteString2(ws.picture)}if(null!==ws.dataValidations)this.bs.WriteItem(c_oSerWorksheetsTypes.DataValidations,function(){oThis.WriteDataValidations(ws.dataValidations)});if(ws.aNamedSheetViews.length>0)this.bs.WriteItem(c_oSerWorksheetsTypes.NamedSheetView, function(){var namedSheetViews=new Asc.CT_NamedSheetViews;namedSheetViews.namedSheetView=ws.aNamedSheetViews;var old=new AscCommon.CMemory(true);pptx_content_writer.BinaryFileWriter.ExportToMemory(old);pptx_content_writer.BinaryFileWriter.ImportFromMemory(oThis.memory);pptx_content_writer.BinaryFileWriter.StartRecord(0);namedSheetViews.toStream(pptx_content_writer.BinaryFileWriter,oThis.tableIds);pptx_content_writer.BinaryFileWriter.EndRecord();pptx_content_writer.BinaryFileWriter.ExportToMemory(oThis.memory); pptx_content_writer.BinaryFileWriter.ImportFromMemory(old)})};this.WriteDataValidations=function(dataValidations){var oThis=this;if(null!=dataValidations.disablePrompts)this.bs.WriteItem(c_oSer_DataValidation.DisablePrompts,function(){oThis.memory.WriteBool(dataValidations.disablePrompts)});if(null!=dataValidations.xWindow)this.bs.WriteItem(c_oSer_DataValidation.XWindow,function(){oThis.memory.WriteLong(dataValidations.xWindow)});if(null!=dataValidations.yWindow)this.bs.WriteItem(c_oSer_DataValidation.YWindow, function(){oThis.memory.WriteLong(dataValidations.yWindow)});if(dataValidations.elems.length>0)this.bs.WriteItem(c_oSer_DataValidation.DataValidations,function(){for(var i=0;i<dataValidations.elems.length;++i)oThis.bs.WriteItem(c_oSer_DataValidation.DataValidation,function(){oThis.WriteDataValidation(dataValidations.elems[i])})})};this.WriteDataValidation=function(dataValidation){if(null!=dataValidation.allowBlank){this.memory.WriteByte(c_oSer_DataValidation.AllowBlank);this.memory.WriteByte(c_oSerPropLenType.Byte); this.memory.WriteBool(dataValidation.allowBlank)}if(null!=dataValidation.type){this.memory.WriteByte(c_oSer_DataValidation.Type);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(dataValidation.type)}if(null!=dataValidation.error){this.memory.WriteByte(c_oSer_DataValidation.Error);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(dataValidation.error)}if(null!=dataValidation.errorTitle){this.memory.WriteByte(c_oSer_DataValidation.ErrorTitle);this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteString2(dataValidation.errorTitle)}if(null!=dataValidation.errorStyle){this.memory.WriteByte(c_oSer_DataValidation.ErrorStyle);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(dataValidation.errorStyle)}if(null!=dataValidation.imeMode){this.memory.WriteByte(c_oSer_DataValidation.ImeMode);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(dataValidation.imeMode)}if(null!=dataValidation.operator){this.memory.WriteByte(c_oSer_DataValidation.Operator); this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(dataValidation.operator)}if(null!=dataValidation.prompt){this.memory.WriteByte(c_oSer_DataValidation.Prompt);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(dataValidation.prompt)}if(null!=dataValidation.promptTitle){this.memory.WriteByte(c_oSer_DataValidation.PromptTitle);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(dataValidation.promptTitle)}if(null!=dataValidation.showDropDown){this.memory.WriteByte(c_oSer_DataValidation.ShowDropDown); this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(dataValidation.showDropDown)}if(null!=dataValidation.showErrorMessage){this.memory.WriteByte(c_oSer_DataValidation.ShowErrorMessage);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(dataValidation.showErrorMessage)}if(null!=dataValidation.showInputMessage){this.memory.WriteByte(c_oSer_DataValidation.ShowInputMessage);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(dataValidation.showInputMessage)}if(null!= dataValidation.ranges){this.memory.WriteByte(c_oSer_DataValidation.SqRef);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(getSqRefString(dataValidation.ranges))}if(null!=dataValidation.formula1){this.memory.WriteByte(c_oSer_DataValidation.Formula1);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(dataValidation.formula1.text)}if(null!=dataValidation.formula2){this.memory.WriteByte(c_oSer_DataValidation.Formula2);this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteString2(dataValidation.formula2.text)}};this.WriteWorksheetProp=function(ws){var oThis=this;this.memory.WriteByte(c_oSerWorksheetPropTypes.Name);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(ws.sName);this.memory.WriteByte(c_oSerWorksheetPropTypes.SheetId);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(this.sheetIds[ws.getId()]||1);if(null!=ws.bHidden){this.memory.WriteByte(c_oSerWorksheetPropTypes.State);this.memory.WriteByte(c_oSerPropLenType.Byte); if(true==ws.bHidden)this.memory.WriteByte(EVisibleType.visibleHidden);else this.memory.WriteByte(EVisibleType.visibleVisible)}if(oThis.isCopyPaste){var activeRange=oThis.isCopyPaste;var newRange=null;if(ws.bExcludeHiddenRows){for(var i=activeRange.r1;i<activeRange.r2;i++)if(ws.getRowHidden(i)){if(!newRange)newRange=activeRange.clone();newRange.r2--}if(newRange)activeRange=newRange}this.memory.WriteByte(c_oSerWorksheetPropTypes.Ref);this.memory.WriteByte(c_oSerPropLenType.Variable);this.memory.WriteString2(activeRange.getName())}}; this.WriteWorksheetCols=function(ws){var oThis=this;var aCols=ws.aCols;var oPrevCol=null;var nPrevIndexStart=null;var nPrevIndex=null;var aIndexes=[];for(var i in aCols)aIndexes.push(i-0);aIndexes.sort(AscCommon.fSortAscending);var fInitCol=function(col,nMin,nMax){var oRes={col:col,Max:nMax,Min:nMin,xfsid:null,width:col.width};if(null==oRes.width)if(null!=ws.oSheetFormatPr.dDefaultColWidth)oRes.width=ws.oSheetFormatPr.dDefaultColWidth;else oRes.width=AscCommonExcel.oDefaultMetrics.ColWidthChars;if(null!= col.xfs)oRes.xfsid=oThis.stylesForWrite.add(col.xfs);return oRes};var oAllCol=null;if(null!=ws.oAllCol)oAllCol=fInitCol(ws.oAllCol,0,gc_nMaxCol0);for(var i=0,length=aIndexes.length;i<length;++i){var nIndex=aIndexes[i];var col=aCols[nIndex];if(null!=col)if(false==col.isEmpty()){if(null!=oAllCol&&null==nPrevIndex&&nIndex>0){oAllCol.Min=1;oAllCol.Max=nIndex;this.bs.WriteItem(c_oSerWorksheetsTypes.Col,function(){oThis.WriteWorksheetCol(oAllCol)})}if(null!=nPrevIndex&&(nPrevIndex+1!=nIndex||false==oPrevCol.isEqual(col))){var oColToWrite= fInitCol(oPrevCol,nPrevIndexStart+1,nPrevIndex+1);this.bs.WriteItem(c_oSerWorksheetsTypes.Col,function(){oThis.WriteWorksheetCol(oColToWrite)});nPrevIndexStart=null;if(null!=oAllCol&&nPrevIndex+1!=nIndex){oAllCol.Min=nPrevIndex+2;oAllCol.Max=nIndex;this.bs.WriteItem(c_oSerWorksheetsTypes.Col,function(){oThis.WriteWorksheetCol(oAllCol)})}}oPrevCol=col;nPrevIndex=nIndex;if(null==nPrevIndexStart)nPrevIndexStart=nPrevIndex}}if(null!=nPrevIndexStart&&null!=nPrevIndex&&null!=oPrevCol){var oColToWrite=fInitCol(oPrevCol, nPrevIndexStart+1,nPrevIndex+1);this.bs.WriteItem(c_oSerWorksheetsTypes.Col,function(){oThis.WriteWorksheetCol(oColToWrite)})}if(null!=oAllCol)if(null==nPrevIndex){oAllCol.Min=1;oAllCol.Max=gc_nMaxCol0+1;this.bs.WriteItem(c_oSerWorksheetsTypes.Col,function(){oThis.WriteWorksheetCol(oAllCol)})}else if(gc_nMaxCol0!=nPrevIndex){oAllCol.Min=nPrevIndex+2;oAllCol.Max=gc_nMaxCol0+1;this.bs.WriteItem(c_oSerWorksheetsTypes.Col,function(){oThis.WriteWorksheetCol(oAllCol)})}};this.WriteWorksheetCol=function(oTmpCol){var oCol= oTmpCol.col;if(null!=oCol.BestFit){this.memory.WriteByte(c_oSerWorksheetColTypes.BestFit);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oCol.BestFit)}if(oCol.hd){this.memory.WriteByte(c_oSerWorksheetColTypes.Hidden);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oCol.hd)}if(null!=oTmpCol.Max){this.memory.WriteByte(c_oSerWorksheetColTypes.Max);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oTmpCol.Max)}if(null!=oTmpCol.Min){this.memory.WriteByte(c_oSerWorksheetColTypes.Min); this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oTmpCol.Min)}if(null!=oTmpCol.xfsid){this.memory.WriteByte(c_oSerWorksheetColTypes.Style);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oTmpCol.xfsid)}if(null!=oTmpCol.width){this.memory.WriteByte(c_oSerWorksheetColTypes.Width);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(oTmpCol.width)}if(null!=oCol.CustomWidth){this.memory.WriteByte(c_oSerWorksheetColTypes.CustomWidth);this.memory.WriteByte(c_oSerPropLenType.Byte); this.memory.WriteBool(oCol.CustomWidth)}if(oCol.outlineLevel>0){this.memory.WriteByte(c_oSerWorksheetColTypes.OutLevel);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oCol.outlineLevel)}if(oCol.collapsed){this.memory.WriteByte(c_oSerWorksheetColTypes.Collapsed);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(true)}};this.WriteSheetViews=function(ws){var oThis=this;for(var i=0,length=ws.sheetViews.length;i<length;++i)this.bs.WriteItem(c_oSerWorksheetsTypes.SheetView, function(){oThis.WriteSheetView(ws,ws.sheetViews[i])})};this.WriteSheetView=function(ws,oSheetView){var oThis=this;if(null!==oSheetView.showGridLines&&!oThis.isCopyPaste)this.bs.WriteItem(c_oSer_SheetView.ShowGridLines,function(){oThis.memory.WriteBool(oSheetView.showGridLines)});if(null!==oSheetView.showRowColHeaders&&!oThis.isCopyPaste)this.bs.WriteItem(c_oSer_SheetView.ShowRowColHeaders,function(){oThis.memory.WriteBool(oSheetView.showRowColHeaders)});if(null!==oSheetView.zoomScale&&!oThis.isCopyPaste)this.bs.WriteItem(c_oSer_SheetView.ZoomScale, function(){oThis.memory.WriteLong(oSheetView.zoomScale)});if(null!==oSheetView.pane&&oSheetView.pane.isInit()&&!oThis.isCopyPaste)this.bs.WriteItem(c_oSer_SheetView.Pane,function(){oThis.WriteSheetViewPane(oSheetView.pane)});if(null!==ws.selectionRange)this.bs.WriteItem(c_oSer_SheetView.Selection,function(){oThis.WriteSheetViewSelection(ws.selectionRange)})};this.WriteSheetViewPane=function(oPane){var oThis=this;this.bs.WriteItem(c_oSer_Pane.State,function(){oThis.memory.WriteString3(AscCommonExcel.c_oAscPaneState.Frozen)}); this.bs.WriteItem(c_oSer_Pane.TopLeftCell,function(){oThis.memory.WriteString3(oPane.topLeftFrozenCell.getID())});var col=oPane.topLeftFrozenCell.getCol0();var row=oPane.topLeftFrozenCell.getRow0();if(0<col)this.bs.WriteItem(c_oSer_Pane.XSplit,function(){oThis.memory.WriteDouble2(col)});if(0<row)this.bs.WriteItem(c_oSer_Pane.YSplit,function(){oThis.memory.WriteDouble2(row)})};this.WriteSheetViewSelection=function(selectionRange){var oThis=this;if(null!=selectionRange.activeCell)this.bs.WriteItem(c_oSer_Selection.ActiveCell, function(){oThis.memory.WriteString3(selectionRange.activeCell.getName())});if(null!=selectionRange.activeCellId)this.bs.WriteItem(c_oSer_Selection.ActiveCellId,function(){oThis.memory.WriteLong(selectionRange.activeCellId)});if(null!=selectionRange.ranges){var sqRef=getSqRefString(selectionRange.ranges);this.bs.WriteItem(c_oSer_Selection.Sqref,function(){oThis.memory.WriteString3(sqRef)})}};this.WriteSheetPr=function(sheetPr){var oThis=this;if(null!==sheetPr.CodeName)this.bs.WriteItem(c_oSer_SheetPr.CodeName, function(){oThis.memory.WriteString3(sheetPr.CodeName)});if(null!==sheetPr.EnableFormatConditionsCalculation)this.bs.WriteItem(c_oSer_SheetPr.EnableFormatConditionsCalculation,function(){oThis.memory.WriteBool(sheetPr.EnableFormatConditionsCalculation)});if(null!==sheetPr.FilterMode)this.bs.WriteItem(c_oSer_SheetPr.FilterMode,function(){oThis.memory.WriteBool(sheetPr.FilterMode)});if(null!==sheetPr.Published)this.bs.WriteItem(c_oSer_SheetPr.Published,function(){oThis.memory.WriteBool(sheetPr.Published)}); if(null!==sheetPr.SyncHorizontal)this.bs.WriteItem(c_oSer_SheetPr.SyncHorizontal,function(){oThis.memory.WriteBool(sheetPr.SyncHorizontal)});if(null!==sheetPr.SyncRef)this.bs.WriteItem(c_oSer_SheetPr.SyncRef,function(){oThis.memory.WriteString3(sheetPr.SyncRef)});if(null!==sheetPr.SyncVertical)this.bs.WriteItem(c_oSer_SheetPr.SyncVertical,function(){oThis.memory.WriteBool(sheetPr.SyncVertical)});if(null!==sheetPr.TransitionEntry)this.bs.WriteItem(c_oSer_SheetPr.TransitionEntry,function(){oThis.memory.WriteBool(sheetPr.TransitionEntry)}); if(null!==sheetPr.TransitionEvaluation)this.bs.WriteItem(c_oSer_SheetPr.TransitionEvaluation,function(){oThis.memory.WriteBool(sheetPr.TransitionEvaluation)});if(null!==sheetPr.TabColor)this.bs.WriteItem(c_oSer_SheetPr.TabColor,function(){oThis.bs.WriteColorSpreadsheet(sheetPr.TabColor)});if(null!==sheetPr.AutoPageBreaks||null!==sheetPr.FitToPage)this.bs.WriteItem(c_oSer_SheetPr.PageSetUpPr,function(){oThis.WritePageSetUpPr(sheetPr)});if(null!==sheetPr.ApplyStyles||null!==sheetPr.ShowOutlineSymbols|| null!==sheetPr.SummaryBelow||null!==sheetPr.SummaryRight)this.bs.WriteItem(c_oSer_SheetPr.OutlinePr,function(){oThis.WriteOutlinePr(sheetPr)})};this.WriteOutlinePr=function(sheetPr){var oThis=this;if(null!==sheetPr.ApplyStyles)this.bs.WriteItem(c_oSer_SheetPr.ApplyStyles,function(){oThis.memory.WriteBool(sheetPr.ApplyStyles)});if(null!==sheetPr.ShowOutlineSymbols)this.bs.WriteItem(c_oSer_SheetPr.ShowOutlineSymbols,function(){oThis.memory.WriteBool(sheetPr.ShowOutlineSymbols)});if(null!==sheetPr.SummaryBelow)this.bs.WriteItem(c_oSer_SheetPr.SummaryBelow, function(){oThis.memory.WriteBool(sheetPr.SummaryBelow)});if(null!==sheetPr.SummaryRight)this.bs.WriteItem(c_oSer_SheetPr.SummaryRight,function(){oThis.memory.WriteBool(sheetPr.SummaryRight)})};this.WritePageSetUpPr=function(sheetPr){var oThis=this;if(null!==sheetPr.AutoPageBreaks)this.bs.WriteItem(c_oSer_SheetPr.AutoPageBreaks,function(){oThis.memory.WriteBool(sheetPr.AutoPageBreaks)});if(null!==sheetPr.FitToPage)this.bs.WriteItem(c_oSer_SheetPr.FitToPage,function(){oThis.memory.WriteBool(sheetPr.FitToPage)})}; this.WriteSheetFormatPr=function(ws){if(null!==ws.oSheetFormatPr.nBaseColWidth){this.memory.WriteByte(c_oSerSheetFormatPrTypes.BaseColWidth);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(ws.oSheetFormatPr.nBaseColWidth)}if(null!==ws.oSheetFormatPr.dDefaultColWidth){this.memory.WriteByte(c_oSerSheetFormatPrTypes.DefaultColWidth);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(ws.oSheetFormatPr.dDefaultColWidth)}if(ws.oSheetFormatPr.nOutlineLevelCol>0){this.memory.WriteByte(c_oSerSheetFormatPrTypes.OutlineLevelCol); this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(ws.oSheetFormatPr.nOutlineLevelCol)}if(null!==ws.oSheetFormatPr.oAllRow){var oAllRow=ws.oSheetFormatPr.oAllRow;if(oAllRow.h){this.memory.WriteByte(c_oSerSheetFormatPrTypes.DefaultRowHeight);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(oAllRow.h)}if(oAllRow.getCustomHeight()){this.memory.WriteByte(c_oSerSheetFormatPrTypes.CustomHeight);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(true)}if(oAllRow.getHidden()){this.memory.WriteByte(c_oSerSheetFormatPrTypes.ZeroHeight); this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(true)}if(oAllRow.getOutlineLevel()>0){this.memory.WriteByte(c_oSerSheetFormatPrTypes.OutlineLevelRow);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oAllRow.getOutlineLevel())}}};this.WritePageMargins=function(oMargins){var dLeft=oMargins.asc_getLeft();if(null!=dLeft){this.memory.WriteByte(c_oSer_PageMargins.Left);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(dLeft)}var dTop=oMargins.asc_getTop(); if(null!=dTop){this.memory.WriteByte(c_oSer_PageMargins.Top);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(dTop)}var dRight=oMargins.asc_getRight();if(null!=dRight){this.memory.WriteByte(c_oSer_PageMargins.Right);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(dRight)}var dBottom=oMargins.asc_getBottom();if(null!=dBottom){this.memory.WriteByte(c_oSer_PageMargins.Bottom);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(dBottom)}var dHeader= oMargins.asc_getHeader();if(null!=dHeader){this.memory.WriteByte(c_oSer_PageMargins.Header);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(dHeader)}var dFooter=oMargins.asc_getFooter();if(null!=dFooter){this.memory.WriteByte(c_oSer_PageMargins.Footer);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(dFooter)}};this.WritePageSetup=function(oPageSetup){var dWidth=oPageSetup.asc_getWidth();var dHeight=oPageSetup.asc_getHeight();if(null!=dWidth&&null!= dHeight){var item=DocumentPageSize.getSizeByWH(dWidth,dHeight);this.memory.WriteByte(c_oSer_PageSetup.PaperSize);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(item.id)}if(null!=oPageSetup.blackAndWhite){this.memory.WriteByte(c_oSer_PageSetup.BlackAndWhite);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oPageSetup.blackAndWhite)}if(null!=oPageSetup.cellComments){this.memory.WriteByte(c_oSer_PageSetup.CellComments);this.memory.WriteByte(c_oSerPropLenType.Byte); this.memory.WriteByte(oPageSetup.cellComments)}if(null!=oPageSetup.copies){this.memory.WriteByte(c_oSer_PageSetup.Copies);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oPageSetup.copies)}if(null!=oPageSetup.draft){this.memory.WriteByte(c_oSer_PageSetup.Draft);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oPageSetup.draft)}if(null!=oPageSetup.errors){this.memory.WriteByte(c_oSer_PageSetup.Errors);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(oPageSetup.errors)}if(null!= oPageSetup.firstPageNumber){this.memory.WriteByte(c_oSer_PageSetup.FirstPageNumber);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oPageSetup.firstPageNumber)}if(null!=oPageSetup.fitToHeight){this.memory.WriteByte(c_oSer_PageSetup.FitToHeight);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oPageSetup.fitToHeight)}if(null!=oPageSetup.fitToWidth){this.memory.WriteByte(c_oSer_PageSetup.FitToWidth);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oPageSetup.fitToWidth)}if(null!= oPageSetup.horizontalDpi){this.memory.WriteByte(c_oSer_PageSetup.HorizontalDpi);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oPageSetup.horizontalDpi)}var byteOrientation=oPageSetup.asc_getOrientation();if(null!=byteOrientation){var byteFormatOrientation=null;switch(byteOrientation){case c_oAscPageOrientation.PagePortrait:byteFormatOrientation=EPageOrientation.pageorientPortrait;break;case c_oAscPageOrientation.PageLandscape:byteFormatOrientation=EPageOrientation.pageorientLandscape; break}if(null!=byteFormatOrientation){this.memory.WriteByte(c_oSer_PageSetup.Orientation);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(byteFormatOrientation)}}if(null!=oPageSetup.pageOrder){this.memory.WriteByte(c_oSer_PageSetup.PageOrder);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteByte(oPageSetup.pageOrder)}if(null!=oPageSetup.scale){this.memory.WriteByte(c_oSer_PageSetup.Scale);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oPageSetup.scale)}if(null!= oPageSetup.useFirstPageNumber){this.memory.WriteByte(c_oSer_PageSetup.UseFirstPageNumber);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oPageSetup.useFirstPageNumber)}if(null!=oPageSetup.usePrinterDefaults){this.memory.WriteByte(c_oSer_PageSetup.UsePrinterDefaults);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(oPageSetup.usePrinterDefaults)}if(null!=oPageSetup.verticalDpi){this.memory.WriteByte(c_oSer_PageSetup.VerticalDpi);this.memory.WriteByte(c_oSerPropLenType.Long); this.memory.WriteLong(oPageSetup.verticalDpi)}};this.WritePrintOptions=function(oPrintOptions){var bGridLines=oPrintOptions.asc_getGridLines();if(null!=bGridLines){this.memory.WriteByte(c_oSer_PrintOptions.GridLines);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(bGridLines)}var bHeadings=oPrintOptions.asc_getHeadings();if(null!=bHeadings){this.memory.WriteByte(c_oSer_PrintOptions.Headings);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(bHeadings)}};this.WriteHyperlinks= function(ws){var oThis=this;var oHyperlinks=ws.hyperlinkManager.getAll();for(var i in oHyperlinks){var elem=oHyperlinks[i];if(!this.isCopyPaste||this.isCopyPaste&&elem&&elem.bbox&&this.isCopyPaste.containsRange(elem.bbox))this.bs.WriteItem(c_oSerWorksheetsTypes.Hyperlink,function(){oThis.WriteHyperlink(elem.data)})}};this.WriteHyperlink=function(oHyperlink){if(null!=oHyperlink.Ref){this.memory.WriteByte(c_oSerHyperlinkTypes.Ref);this.memory.WriteString2(oHyperlink.Ref.getName())}if(null!=oHyperlink.Hyperlink){this.memory.WriteByte(c_oSerHyperlinkTypes.Hyperlink); this.memory.WriteString2(oHyperlink.Hyperlink)}if(null!==oHyperlink.getLocation()){this.memory.WriteByte(c_oSerHyperlinkTypes.Location);this.memory.WriteString2(oHyperlink.getLocation())}if(null!=oHyperlink.Tooltip){this.memory.WriteByte(c_oSerHyperlinkTypes.Tooltip);this.memory.WriteString2(oHyperlink.Tooltip)}};this.WriteMergeCells=function(ws){var i,names,bboxes;if(!this.isCopyPaste&&ws.mergeManager.initData){names=ws.mergeManager.initData;for(i=0;i<names.length;++i){this.memory.WriteByte(c_oSerWorksheetsTypes.MergeCell); this.memory.WriteString2(names[i])}}else{if(this.isCopyPaste)bboxes=ws.mergeManager.get(this.isCopyPaste).inner.map(function(elem){return elem.bbox});else bboxes=ws.mergeManager.getAll().map(function(elem){return elem.bbox});bboxes=getDisjointMerged(this.wb,bboxes);for(i=0;i<bboxes.length;++i)if(!bboxes[i].isOneCell()){this.memory.WriteByte(c_oSerWorksheetsTypes.MergeCell);this.memory.WriteString2(bboxes[i].getName())}}};this.WriteDrawings=function(aDrawings){var oThis=this;var oPPTXWriter=pptx_content_writer.BinaryFileWriter; oPPTXWriter.ClearIdMap();for(var i=0,length=aDrawings.length;i<length;++i){var oDrawing=aDrawings[i];if(!this.isCopyPaste)this.bs.WriteItem(c_oSerWorksheetsTypes.Drawing,function(){oThis.WriteDrawing(oDrawing)});else if(this.isCopyPaste&&oDrawing.graphicObject.selected)if(oDrawing.isGroup()&&oDrawing.graphicObject.selectedObjects&&oDrawing.graphicObject.selectedObjects.length){var oDrawingSelected=oDrawing.graphicObject.selectedObjects;var curDrawing,graphicObject;for(var selDr=0;selDr<oDrawingSelected.length;selDr++){curDrawing= oDrawingSelected[selDr];graphicObject=oDrawing.graphicObject;oDrawing.graphicObject=curDrawing;this.bs.WriteItem(c_oSerWorksheetsTypes.Drawing,function(){oThis.WriteDrawing(oDrawing,curDrawing)});oDrawing.graphicObject=graphicObject}}else{var oCurDrawingToWrite=AscFormat.ExecuteNoHistory(function(){var oRet=oDrawing.graphicObject.copy(undefined);var oMetrics=oDrawing.getGraphicObjectMetrics();AscFormat.SetXfrmFromMetrics(oRet,oMetrics);return oRet},this,[]);var oOldGrObject=oDrawing.graphicObject; oDrawing.graphicObject=oCurDrawingToWrite;this.bs.WriteItem(c_oSerWorksheetsTypes.Drawing,function(){oThis.WriteDrawing(oDrawing)});oDrawing.graphicObject=oOldGrObject}}oPPTXWriter.ClearIdMap()};this.WriteDrawing=function(oDrawing,curDrawing){var oThis=this;if(null!=oDrawing.Type)this.bs.WriteItem(c_oSer_DrawingType.Type,function(){oThis.memory.WriteByte(ECellAnchorType.cellanchorOneCell)});switch(oDrawing.Type){case c_oAscCellAnchorType.cellanchorTwoCell:{this.bs.WriteItem(c_oSer_DrawingType.EditAs, function(){oThis.memory.WriteByte(oDrawing.editAs)});this.bs.WriteItem(c_oSer_DrawingType.From,function(){oThis.WriteFromTo(oDrawing.from)});this.bs.WriteItem(c_oSer_DrawingType.To,function(){oThis.WriteFromTo(oDrawing.to)});break}case c_oAscCellAnchorType.cellanchorOneCell:{this.bs.WriteItem(c_oSer_DrawingType.From,function(){oThis.WriteFromTo(oDrawing.from)});this.bs.WriteItem(c_oSer_DrawingType.Ext,function(){oThis.WriteExt(oDrawing.ext)});break}case c_oAscCellAnchorType.cellanchorAbsolute:{this.bs.WriteItem(c_oSer_DrawingType.Pos, function(){oThis.WritePos(oDrawing.Pos)});this.bs.WriteItem(c_oSer_DrawingType.Ext,function(){oThis.WriteExt(oDrawing.ext)});break}}if(curDrawing)this.bs.WriteItem(c_oSer_DrawingType.pptxDrawing,function(){pptx_content_writer.WriteDrawing(oThis.memory,curDrawing,null,null,null)});else this.bs.WriteItem(c_oSer_DrawingType.pptxDrawing,function(){pptx_content_writer.WriteDrawing(oThis.memory,oDrawing.graphicObject,null,null,null)})};this.WriteFromTo=function(oFromTo){if(null!=oFromTo.col){this.memory.WriteByte(c_oSer_DrawingFromToType.Col); this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oFromTo.col)}if(null!=oFromTo.colOff){this.memory.WriteByte(c_oSer_DrawingFromToType.ColOff);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(oFromTo.colOff)}if(null!=oFromTo.row){this.memory.WriteByte(c_oSer_DrawingFromToType.Row);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(oFromTo.row)}if(null!=oFromTo.rowOff){this.memory.WriteByte(c_oSer_DrawingFromToType.RowOff);this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteDouble2(oFromTo.rowOff)}};this.WritePos=function(oPos){if(null!=oPos.X){this.memory.WriteByte(c_oSer_DrawingPosType.X);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(oPos.X)}if(null!=oPos.Y){this.memory.WriteByte(c_oSer_DrawingPosType.Y);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(oPos.Y)}};this.WriteExt=function(oExt){if(null!=oExt.cx){this.memory.WriteByte(c_oSer_DrawingExtType.Cx);this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteDouble2(oExt.cx)}if(null!=oExt.cy){this.memory.WriteByte(c_oSer_DrawingExtType.Cy);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(oExt.cy)}};this.WriteSheetDataXLSB=function(ws){var oThis=this;var range;if(oThis.isCopyPaste)range=ws.getRange3(oThis.isCopyPaste.r1,oThis.isCopyPaste.c1,oThis.isCopyPaste.r2,oThis.isCopyPaste.c2);else range=ws.getRange3(0,0,gc_nMaxRow0,gc_nMaxCol0);var curRow=-1;var allRow=ws.getAllRowNoEmpty();var tempRow=new AscCommonExcel.Row(ws); if(allRow)tempRow.copyFrom(allRow);this.memory.XlsbStartRecord(AscCommonExcel.XLSB.rt_BEGIN_SHEET_DATA,0);this.memory.XlsbEndRecord();range._foreachRowNoEmpty(function(row,excludedCount){row.toXLSB(oThis.memory,-excludedCount,oThis.stylesForWrite);curRow=row.getIndex()},function(cell,nRow0,nCol0,nRowStart0,nColStart0,excludedCount){if(curRow!=nRow0){tempRow.setIndex(nRow0);tempRow.toXLSB(oThis.memory,-excludedCount,oThis.stylesForWrite);curRow=tempRow.getIndex()}var nXfsId;var cellXfs=cell.xfs;nXfsId= oThis.stylesForWrite.add(cell.xfs);if(null!=cellXfs||false==cell.isNullText()){var formulaToWrite;if(cell.isFormula()&&!(oThis.isCopyPaste&&cell.ws&&cell.ws.bIgnoreWriteFormulas))formulaToWrite=oThis.PrepareFormulaToWrite(cell);cell.toXLSB(oThis.memory,nXfsId,formulaToWrite,oThis.oSharedStrings)}},ws.bExcludeHiddenRows&&oThis.isCopyPaste);this.memory.XlsbStartRecord(AscCommonExcel.XLSB.rt_END_SHEET_DATA,0);this.memory.XlsbEndRecord()};this.PrepareFormulaToWrite=function(cell){var parsed=cell.getFormulaParsed(); var formula;var si;var ref;var type;var shared=parsed.getShared();var arrayFormula=parsed.getArrayFormulaRef();if(shared){var sharedToWrite=this.sharedFormulas[parsed.getIndexNumber()];if(!sharedToWrite){sharedToWrite={saveShared:!shared.ref.isOneCell()&&parsed.canSaveShared(),si:{}};this.sharedFormulas[parsed.getIndexNumber()]=sharedToWrite}if(sharedToWrite.saveShared&&shared.ref.contains(cell.nCol,cell.nRow)){type=ECellFormulaType.cellformulatypeShared;var rowIndex=Math.floor((cell.nRow-shared.ref.r1)/ g_cSharedWriteStreak);var row=sharedToWrite.si[rowIndex];if(!row){row={};sharedToWrite.si[rowIndex]=row}var colIndex=Math.floor((cell.nCol-shared.ref.c1)/g_cSharedWriteStreak);si=row[colIndex];if(undefined===si){row[colIndex]=si=this.sharedFormulasIndex++;if(!(cell.nRow===shared.base.nRow&&cell.nCol===shared.base.nCol))cell.processFormula(function(parsed){formula=parsed.getFormula()});else formula=parsed.getFormula();var r1=shared.ref.r1+rowIndex*g_cSharedWriteStreak;var c1=shared.ref.c1+colIndex* g_cSharedWriteStreak;ref=new Asc.Range(c1,r1,Math.min(c1+g_cSharedWriteStreak-1,shared.ref.c2),Math.min(r1+g_cSharedWriteStreak-1,shared.ref.r2))}}else cell.processFormula(function(parsed){formula=parsed.getFormula()})}else if(null!==arrayFormula){var bIsFirstCellArray=parsed.checkFirstCellArray(cell);if(bIsFirstCellArray){ref=arrayFormula;type=ECellFormulaType.cellformulatypeArray;formula=parsed.getFormula()}else if(this.isCopyPaste){var intersection=arrayFormula.intersection(this.isCopyPaste);if(intersection&& intersection.r1===cell.nRow&&intersection.c1===cell.nCol){ref=arrayFormula;type=ECellFormulaType.cellformulatypeArray;formula=parsed.getFormula()}}}else formula=parsed.getFormula();return{formula:formula,si:si,ref:ref,type:type,ca:parsed.ca}};this.WriteComments=function(aComments,ws){var oThis=this;var i,elem;for(i=0;i<aComments.length;++i){elem=aComments[i];if(this.isCopyPaste)if(!this.isCopyPaste.contains(elem.nCol,elem.nRow)||ws.bExcludeHiddenRows&&ws.getRowHidden(elem.nRow))continue;if(elem.coords&& elem.coords.isValid())this.bs.WriteItem(c_oSerWorksheetsTypes.Comment,function(){oThis.WriteComment(elem)})}};this.checkCommentGuid=function(comment){var sGuid=comment.asc_getGuid();while(!sGuid||this.commentUniqueGuids[sGuid]){sGuid=AscCommon.CreateGUID();comment.asc_putGuid(sGuid)}this.commentUniqueGuids[sGuid]=1;if(comment.aReplies)for(var i=0;i<comment.aReplies.length;++i)this.checkCommentGuid(comment.aReplies[i])};this.WriteComment=function(comment){var oThis=this;this.checkCommentGuid(comment); var coords=comment.coords;if(null!=coords.nRow){this.memory.WriteByte(c_oSer_Comments.Row);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nRow)}if(null!=coords.nCol){this.memory.WriteByte(c_oSer_Comments.Col);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nCol)}this.memory.WriteByte(c_oSer_Comments.CommentDatas);this.memory.WriteByte(c_oSerPropLenType.Variable);this.bs.WriteItemWithLength(function(){oThis.WriteCommentDatas(comment)});if(null!= coords.nLeft){this.memory.WriteByte(c_oSer_Comments.Left);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nLeft)}if(null!=coords.nTop){this.memory.WriteByte(c_oSer_Comments.Top);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nTop)}if(null!=coords.nRight){this.memory.WriteByte(c_oSer_Comments.Right);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nRight)}if(null!=coords.nBottom){this.memory.WriteByte(c_oSer_Comments.Bottom); this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nBottom)}if(null!=coords.nLeftOffset){this.memory.WriteByte(c_oSer_Comments.LeftOffset);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nLeftOffset)}if(null!=coords.nTopOffset){this.memory.WriteByte(c_oSer_Comments.TopOffset);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nTopOffset)}if(null!=coords.nRightOffset){this.memory.WriteByte(c_oSer_Comments.RightOffset);this.memory.WriteByte(c_oSerPropLenType.Long); this.memory.WriteLong(coords.nRightOffset)}if(null!=coords.nBottomOffset){this.memory.WriteByte(c_oSer_Comments.BottomOffset);this.memory.WriteByte(c_oSerPropLenType.Long);this.memory.WriteLong(coords.nBottomOffset)}if(null!=coords.dLeftMM){this.memory.WriteByte(c_oSer_Comments.LeftMM);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(coords.dLeftMM)}if(null!=coords.dTopMM){this.memory.WriteByte(c_oSer_Comments.TopMM);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(coords.dTopMM)}if(null!= coords.dWidthMM){this.memory.WriteByte(c_oSer_Comments.WidthMM);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(coords.dWidthMM)}if(null!=coords.dHeightMM){this.memory.WriteByte(c_oSer_Comments.HeightMM);this.memory.WriteByte(c_oSerPropLenType.Double);this.memory.WriteDouble2(coords.dHeightMM)}if(null!=coords.bMoveWithCells){this.memory.WriteByte(c_oSer_Comments.MoveWithCells);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(coords.bMoveWithCells)}if(null!= coords.bSizeWithCells){this.memory.WriteByte(c_oSer_Comments.SizeWithCells);this.memory.WriteByte(c_oSerPropLenType.Byte);this.memory.WriteBool(coords.bSizeWithCells)}if(this.saveThreadedComments){this.memory.WriteByte(c_oSer_Comments.ThreadedComment);this.memory.WriteByte(c_oSerPropLenType.Variable);this.bs.WriteItemWithLength(function(){oThis.WriteThreadedComment(comment)})}};this.WriteCommentDatas=function(data){var oThis=this;this.bs.WriteItem(c_oSer_Comments.CommentData,function(){oThis.WriteCommentData(data)})}; this.WriteCommentData=function(oCommentData){var oThis=this;var sText=oCommentData.asc_getText();if(null!=sText){this.memory.WriteByte(c_oSer_CommentData.Text);this.memory.WriteString2(sText)}var sTime=oCommentData.asc_getTime();if(null!=sTime&&""!==sTime){this.memory.WriteByte(c_oSer_CommentData.Time);this.memory.WriteString2((new Date(sTime-0)).toISOString().slice(0,19)+"Z")}var sOOTime=oCommentData.asc_getOnlyOfficeTime();if(null!=sOOTime&&""!==sOOTime){this.memory.WriteByte(c_oSer_CommentData.OOTime); this.memory.WriteString2((new Date(sOOTime-0)).toISOString().slice(0,19)+"Z")}var sUserId=oCommentData.asc_getUserId();if(null!=sUserId){this.memory.WriteByte(c_oSer_CommentData.UserId);this.memory.WriteString2(sUserId)}var sUserName=oCommentData.asc_getUserName();if(null!=sUserName){this.memory.WriteByte(c_oSer_CommentData.UserName);this.memory.WriteString2(sUserName)}var userData=oCommentData.asc_getUserData();if(userData)this.bs.WriteItem(c_oSer_CommentData.UserData,function(){oThis.memory.WriteString3(userData)}); var sQuoteText=oCommentData.asc_getQuoteText();if(null!=sQuoteText){this.memory.WriteByte(c_oSer_CommentData.QuoteText);this.memory.WriteString2(sQuoteText)}var bSolved=oCommentData.asc_getSolved();if(null!=bSolved)this.bs.WriteItem(c_oSer_CommentData.Solved,function(){oThis.memory.WriteBool(bSolved)});var bDocumentFlag=oCommentData.asc_getDocumentFlag();if(null!=bDocumentFlag)this.bs.WriteItem(c_oSer_CommentData.Document,function(){oThis.memory.WriteBool(bDocumentFlag)});var sGuid=oCommentData.asc_getGuid(); if(null!=sGuid)this.bs.WriteItem(c_oSer_CommentData.Guid,function(){oThis.memory.WriteString3(sGuid)});var aReplies=oCommentData.aReplies;if(null!=aReplies&&aReplies.length>0)this.bs.WriteItem(c_oSer_CommentData.Replies,function(){oThis.WriteReplies(aReplies)})};this.WriteReplies=function(aReplies){var oThis=this;for(var i=0,length=aReplies.length;i<length;++i)this.bs.WriteItem(c_oSer_CommentData.Reply,function(){oThis.WriteCommentData(aReplies[i])})};this.WriteThreadedComment=function(oCommentData){var oThis= this;var i;var sOOTime=oCommentData.asc_getOnlyOfficeTime();if(sOOTime)this.bs.WriteItem(c_oSer_ThreadedComment.dT,function(){oThis.memory.WriteString3((new Date(sOOTime-0)).toISOString().slice(0,22)+"Z")});var userId=oCommentData.asc_getUserId();var displayName=oCommentData.asc_getUserName();var providerId=oCommentData.asc_getProviderId();var person=this.personList.find(function isPrime(element){return userId===element.userId&&displayName===element.displayName&&providerId===element.providerId}); if(!person){person={id:AscCommon.CreateGUID(),userId:userId,displayName:displayName,providerId:providerId};this.personList.push(person)}this.bs.WriteItem(c_oSer_ThreadedComment.personId,function(){oThis.memory.WriteString3(person.id)});var guid=oCommentData.asc_getGuid();if(guid)this.bs.WriteItem(c_oSer_ThreadedComment.id,function(){oThis.memory.WriteString3(guid)});var solved=oCommentData.asc_getSolved();if(null!=solved)this.bs.WriteItem(c_oSer_ThreadedComment.done,function(){oThis.memory.WriteBool(solved)}); var text=oCommentData.asc_getText();if(text)this.bs.WriteItem(c_oSer_ThreadedComment.text,function(){oThis.memory.WriteString3(text)});if(oCommentData.aReplies&&oCommentData.aReplies.length>0)for(i=0;i<oCommentData.aReplies.length;++i)this.bs.WriteItem(c_oSer_ThreadedComment.reply,function(){oThis.WriteThreadedComment(oCommentData.aReplies[i])})};this.WriteThreadedCommentMention=function(mention){var oThis=this;if(mention.mentionpersonId)this.bs.WriteItem(c_oSer_ThreadedComment.mentionpersonId,function(){oThis.memory.WriteString3(mention.mentionpersonId)}); if(mention.mentionId)this.bs.WriteItem(c_oSer_ThreadedComment.mentionId,function(){oThis.memory.WriteString3(mention.mentionId)});if(mention.startIndex)this.bs.WriteItem(c_oSer_ThreadedComment.startIndex,function(){oThis.memory.WriteULong(mention.startIndex)});if(mention.length)this.bs.WriteItem(c_oSer_ThreadedComment.length,function(){oThis.memory.WriteULong(mention.length)})};this.WriteConditionalFormatting=function(oRule){var oThis=this;if(null!=oRule.pivot)this.bs.WriteItem(c_oSer_ConditionalFormatting.Pivot, function(){oThis.memory.WriteBool(oRule.pivot)});if(null!=oRule.ranges){var sqRef=getSqRefString(oRule.ranges);this.bs.WriteItem(c_oSer_ConditionalFormatting.SqRef,function(){oThis.memory.WriteString3(sqRef)})}this.bs.WriteItem(c_oSer_ConditionalFormatting.ConditionalFormattingRule,function(){oThis.WriteConditionalFormattingRule(oRule)})};this.WriteConditionalFormattingRule=function(rule){var oThis=this;if(null!=rule.aboveAverage)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.AboveAverage,function(){oThis.memory.WriteBool(rule.aboveAverage)}); if(null!=rule.bottom)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.Bottom,function(){oThis.memory.WriteBool(rule.bottom)});if(null!=rule.dxf)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.Dxf,function(){oThis.bsw.WriteDxf(rule.dxf)});if(null!=rule.equalAverage)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.EqualAverage,function(){oThis.memory.WriteBool(rule.equalAverage)});if(null!=rule.operator)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.Operator,function(){oThis.memory.WriteByte(rule.operator)}); if(null!=rule.percent)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.Percent,function(){oThis.memory.WriteBool(rule.percent)});if(null!=rule.priority)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.Priority,function(){oThis.memory.WriteLong(rule.priority)});if(null!=rule.rank)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.Rank,function(){oThis.memory.WriteLong(rule.rank)});if(null!=rule.stdDev)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.StdDev,function(){oThis.memory.WriteLong(rule.stdDev)}); if(null!=rule.stopIfTrue)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.StopIfTrue,function(){oThis.memory.WriteBool(rule.stopIfTrue)});if(null!=rule.text)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.Text,function(){oThis.memory.WriteString3(rule.text)});if(null!=rule.timePeriod)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.TimePeriod,function(){oThis.memory.WriteString3(rule.timePeriod)});if(null!=rule.type)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.Type,function(){oThis.memory.WriteByte(rule.type)}); for(var i=0;i<rule.aRuleElements.length;++i){var elem=rule.aRuleElements[i];if(elem instanceof AscCommonExcel.CColorScale)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.ColorScale,function(){oThis.WriteColorScale(elem)});else if(elem instanceof AscCommonExcel.CDataBar)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.DataBar,function(){oThis.WriteDataBar(elem)});else if(elem instanceof AscCommonExcel.CFormulaCF)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.FormulaCF,function(){oThis.memory.WriteString3(elem.Text)}); else if(elem instanceof AscCommonExcel.CIconSet)this.bs.WriteItem(c_oSer_ConditionalFormattingRule.IconSet,function(){oThis.WriteIconSet(elem)})}};this.WriteColorScale=function(colorScale){var oThis=this;var i,elem;for(i=0;i<colorScale.aCFVOs.length;++i){elem=colorScale.aCFVOs[i];this.bs.WriteItem(c_oSer_ConditionalFormattingRuleColorScale.CFVO,function(){oThis.WriteCFVO(elem)})}for(i=0;i<colorScale.aColors.length;++i){elem=colorScale.aColors[i];this.bs.WriteItem(c_oSer_ConditionalFormattingRuleColorScale.Color, function(){oThis.bs.WriteColorSpreadsheet(elem)})}};this.WriteDataBar=function(dataBar){var oThis=this;var i,elem;if(null!=dataBar.MaxLength)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.MaxLength,function(){oThis.memory.WriteLong(dataBar.MaxLength)});if(null!=dataBar.MinLength)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.MinLength,function(){oThis.memory.WriteLong(dataBar.MinLength)});if(null!=dataBar.ShowValue)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.ShowValue,function(){oThis.memory.WriteBool(dataBar.ShowValue)}); if(null!=dataBar.AxisPosition)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.AxisPosition,function(){oThis.memory.WriteLong(dataBar.AxisPosition)});if(null!=dataBar.Gradient)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.GradientEnabled,function(){oThis.memory.WriteBool(dataBar.Gradient)});if(null!=dataBar.Direction)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.Direction,function(){oThis.memory.WriteLong(dataBar.Direction)});if(null!=dataBar.NegativeBarColorSameAsPositive)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.NegativeBarColorSameAsPositive, function(){oThis.memory.WriteBool(dataBar.NegativeBarColorSameAsPositive)});if(null!=dataBar.NegativeBarBorderColorSameAsPositive)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.NegativeBarBorderColorSameAsPositive,function(){oThis.memory.WriteBool(dataBar.NegativeBarBorderColorSameAsPositive)});if(null!=dataBar.Color)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.Color,function(){oThis.bs.WriteColorSpreadsheet(dataBar.Color)});if(null!=dataBar.NegativeColor)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.NegativeColor, function(){oThis.bs.WriteColorSpreadsheet(dataBar.NegativeColor)});if(null!=dataBar.BorderColor)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.BorderColor,function(){oThis.bs.WriteColorSpreadsheet(dataBar.BorderColor)});if(null!=dataBar.NegativeBorderColor)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.NegativeBorderColor,function(){oThis.bs.WriteColorSpreadsheet(dataBar.NegativeBorderColor)});if(null!=dataBar.AxisColor)this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.AxisColor, function(){oThis.bs.WriteColorSpreadsheet(dataBar.AxisColor)});for(i=0;i<dataBar.aCFVOs.length;++i){elem=dataBar.aCFVOs[i];this.bs.WriteItem(c_oSer_ConditionalFormattingDataBar.CFVO,function(){oThis.WriteCFVO(elem)})}};this.WriteIconSet=function(iconSet){var oThis=this;var i,elem;if(null!=iconSet.IconSet)this.bs.WriteItem(c_oSer_ConditionalFormattingIconSet.IconSet,function(){oThis.memory.WriteByte(iconSet.IconSet)});if(null!=iconSet.Percent)this.bs.WriteItem(c_oSer_ConditionalFormattingIconSet.Percent, function(){oThis.memory.WriteBool(iconSet.Percent)});if(null!=iconSet.Reverse)this.bs.WriteItem(c_oSer_ConditionalFormattingIconSet.Reverse,function(){oThis.memory.WriteBool(iconSet.Reverse)});if(null!=iconSet.ShowValue)this.bs.WriteItem(c_oSer_ConditionalFormattingIconSet.ShowValue,function(){oThis.memory.WriteBool(iconSet.ShowValue)});for(i=0;i<iconSet.aCFVOs.length;++i){elem=iconSet.aCFVOs[i];this.bs.WriteItem(c_oSer_ConditionalFormattingIconSet.CFVO,function(){oThis.WriteCFVO(elem)})}for(i=0;i< iconSet.aIconSets.length;++i){elem=iconSet.aIconSets[i];this.bs.WriteItem(c_oSer_ConditionalFormattingIconSet.CFIcon,function(){oThis.WriteCFIS(elem)})}};this.WriteCFVO=function(cfvo){var oThis=this;if(null!=cfvo.Gte)this.bs.WriteItem(c_oSer_ConditionalFormattingValueObject.Gte,function(){oThis.memory.WriteBool(cfvo.Gte)});if(null!=cfvo.Type)this.bs.WriteItem(c_oSer_ConditionalFormattingValueObject.Type,function(){oThis.memory.WriteByte(cfvo.Type)});if(null!=cfvo.Val)this.bs.WriteItem(c_oSer_ConditionalFormattingValueObject.Formula, function(){oThis.memory.WriteString3(cfvo.Val)})};this.WriteCFIS=function(cfis){var oThis=this;if(null!=cfis.IconSet)this.bs.WriteItem(c_oSer_ConditionalFormattingIcon.iconSet,function(){oThis.memory.WriteLong(cfis.IconSet)});if(null!=cfis.IconId)this.bs.WriteItem(c_oSer_ConditionalFormattingIcon.iconId,function(){oThis.memory.WriteLong(cfis.IconId)})};this.WriteSparklineGroups=function(aSparklineGroups){var oThis=this;for(var i=0,length=aSparklineGroups.length;i<length;++i)this.bs.WriteItem(c_oSer_Sparkline.SparklineGroup, function(){oThis.WriteSparklineGroup(aSparklineGroups[i])})};this.WriteSparklineGroup=function(oSparklineGroup){var oThis=this;if(null!=oSparklineGroup.manualMax)this.bs.WriteItem(c_oSer_Sparkline.ManualMax,function(){oThis.memory.WriteDouble2(oSparklineGroup.manualMax)});if(null!=oSparklineGroup.manualMin)this.bs.WriteItem(c_oSer_Sparkline.ManualMin,function(){oThis.memory.WriteDouble2(oSparklineGroup.manualMin)});if(null!=oSparklineGroup.lineWeight)this.bs.WriteItem(c_oSer_Sparkline.LineWeight, function(){oThis.memory.WriteDouble2(oSparklineGroup.lineWeight)});if(null!=oSparklineGroup.type)this.bs.WriteItem(c_oSer_Sparkline.Type,function(){oThis.memory.WriteByte(oSparklineGroup.type)});if(null!=oSparklineGroup.dateAxis)this.bs.WriteItem(c_oSer_Sparkline.DateAxis,function(){oThis.memory.WriteBool(oSparklineGroup.dateAxis)});if(null!=oSparklineGroup.displayEmptyCellsAs)this.bs.WriteItem(c_oSer_Sparkline.DisplayEmptyCellsAs,function(){oThis.memory.WriteByte(oSparklineGroup.displayEmptyCellsAs)}); if(null!=oSparklineGroup.markers)this.bs.WriteItem(c_oSer_Sparkline.Markers,function(){oThis.memory.WriteBool(oSparklineGroup.markers)});if(null!=oSparklineGroup.high)this.bs.WriteItem(c_oSer_Sparkline.High,function(){oThis.memory.WriteBool(oSparklineGroup.high)});if(null!=oSparklineGroup.low)this.bs.WriteItem(c_oSer_Sparkline.Low,function(){oThis.memory.WriteBool(oSparklineGroup.low)});if(null!=oSparklineGroup.first)this.bs.WriteItem(c_oSer_Sparkline.First,function(){oThis.memory.WriteBool(oSparklineGroup.first)}); if(null!=oSparklineGroup.last)this.bs.WriteItem(c_oSer_Sparkline.Last,function(){oThis.memory.WriteBool(oSparklineGroup.last)});if(null!=oSparklineGroup.negative)this.bs.WriteItem(c_oSer_Sparkline.Negative,function(){oThis.memory.WriteBool(oSparklineGroup.negative)});if(null!=oSparklineGroup.displayXAxis)this.bs.WriteItem(c_oSer_Sparkline.DisplayXAxis,function(){oThis.memory.WriteBool(oSparklineGroup.displayXAxis)});if(null!=oSparklineGroup.displayHidden)this.bs.WriteItem(c_oSer_Sparkline.DisplayHidden, function(){oThis.memory.WriteBool(oSparklineGroup.displayHidden)});if(null!=oSparklineGroup.minAxisType)this.bs.WriteItem(c_oSer_Sparkline.MinAxisType,function(){oThis.memory.WriteByte(oSparklineGroup.minAxisType)});if(null!=oSparklineGroup.maxAxisType)this.bs.WriteItem(c_oSer_Sparkline.MaxAxisType,function(){oThis.memory.WriteByte(oSparklineGroup.maxAxisType)});if(null!=oSparklineGroup.rightToLeft)this.bs.WriteItem(c_oSer_Sparkline.RightToLeft,function(){oThis.memory.WriteBool(oSparklineGroup.rightToLeft)}); if(null!=oSparklineGroup.colorSeries)this.bs.WriteItem(c_oSer_Sparkline.ColorSeries,function(){oThis.bs.WriteColorSpreadsheet(oSparklineGroup.colorSeries)});if(null!=oSparklineGroup.colorNegative)this.bs.WriteItem(c_oSer_Sparkline.ColorNegative,function(){oThis.bs.WriteColorSpreadsheet(oSparklineGroup.colorNegative)});if(null!=oSparklineGroup.colorAxis)this.bs.WriteItem(c_oSer_Sparkline.ColorAxis,function(){oThis.bs.WriteColorSpreadsheet(oSparklineGroup.colorAxis)});if(null!=oSparklineGroup.colorMarkers)this.bs.WriteItem(c_oSer_Sparkline.ColorMarkers, function(){oThis.bs.WriteColorSpreadsheet(oSparklineGroup.colorMarkers)});if(null!=oSparklineGroup.colorFirst)this.bs.WriteItem(c_oSer_Sparkline.ColorFirst,function(){oThis.bs.WriteColorSpreadsheet(oSparklineGroup.colorFirst)});if(null!=oSparklineGroup.colorLast)this.bs.WriteItem(c_oSer_Sparkline.ColorLast,function(){oThis.bs.WriteColorSpreadsheet(oSparklineGroup.colorLast)});if(null!=oSparklineGroup.colorHigh)this.bs.WriteItem(c_oSer_Sparkline.ColorHigh,function(){oThis.bs.WriteColorSpreadsheet(oSparklineGroup.colorHigh)}); if(null!=oSparklineGroup.colorLow)this.bs.WriteItem(c_oSer_Sparkline.ColorLow,function(){oThis.bs.WriteColorSpreadsheet(oSparklineGroup.colorLow)});if(null!=oSparklineGroup.f){this.memory.WriteByte(c_oSer_Sparkline.Ref);this.memory.WriteString2(oSparklineGroup.f)}if(null!=oSparklineGroup.arrSparklines)this.bs.WriteItem(c_oSer_Sparkline.Sparklines,function(){oThis.WriteSparklines(oSparklineGroup)})};this.WriteSparklines=function(oSparklineGroup){var oThis=this;for(var i=0,length=oSparklineGroup.arrSparklines.length;i< length;++i)this.bs.WriteItem(c_oSer_Sparkline.Sparkline,function(){oThis.WriteSparkline(oSparklineGroup.arrSparklines[i])})};this.WriteSparkline=function(oSparkline){if(null!=oSparkline.f){this.memory.WriteByte(c_oSer_Sparkline.SparklineRef);this.memory.WriteString2(oSparkline.f)}if(null!=oSparkline.sqRef){this.memory.WriteByte(c_oSer_Sparkline.SparklineSqRef);this.memory.WriteString2(oSparkline.sqRef.getName())}};this.WriteSlicers=function(slicers){var oThis=this;this.bs.WriteItem(c_oSerWorksheetsTypes.Slicer, function(){var old=new AscCommon.CMemory(true);pptx_content_writer.BinaryFileWriter.ExportToMemory(old);pptx_content_writer.BinaryFileWriter.ImportFromMemory(oThis.memory);pptx_content_writer.BinaryFileWriter.WriteRecord4(0,slicers);pptx_content_writer.BinaryFileWriter.ExportToMemory(oThis.memory);pptx_content_writer.BinaryFileWriter.ImportFromMemory(old)})};this.WritePivotTable=function(pivotTable,isCopyPaste){if(isCopyPaste&&!pivotTable.isInRange(this.isCopyPaste))return;var oThis=this;if(null!= pivotTable.cacheId)this.bs.WriteItem(c_oSer_PivotTypes.cacheId,function(){oThis.memory.WriteLong(pivotTable.cacheId)});var stylesForWrite=oThis.isCopyPaste?undefined:oThis.stylesForWrite;this.bs.WriteItem(c_oSer_PivotTypes.table,function(){pivotTable.toXml(oThis.memory,stylesForWrite)})};this.WriteHeaderFooter=function(headerFooter){var oThis=this;if(null!==headerFooter.alignWithMargins)this.bs.WriteItem(c_oSer_HeaderFooter.AlignWithMargins,function(){oThis.memory.WriteBool(headerFooter.alignWithMargins)}); if(null!==headerFooter.differentFirst)this.bs.WriteItem(c_oSer_HeaderFooter.DifferentFirst,function(){oThis.memory.WriteBool(headerFooter.differentFirst)});if(null!==headerFooter.differentOddEven)this.bs.WriteItem(c_oSer_HeaderFooter.DifferentOddEven,function(){oThis.memory.WriteBool(headerFooter.differentOddEven)});if(null!==headerFooter.scaleWithDoc)this.bs.WriteItem(c_oSer_HeaderFooter.ScaleWithDoc,function(){oThis.memory.WriteBool(headerFooter.scaleWithDoc)});if(null!==headerFooter.evenFooter){this.memory.WriteByte(c_oSer_HeaderFooter.EvenFooter); this.memory.WriteString2(headerFooter.evenFooter.getStr())}if(null!==headerFooter.evenHeader){this.memory.WriteByte(c_oSer_HeaderFooter.EvenHeader);this.memory.WriteString2(headerFooter.evenHeader.getStr())}if(null!==headerFooter.firstFooter){this.memory.WriteByte(c_oSer_HeaderFooter.FirstFooter);this.memory.WriteString2(headerFooter.firstFooter.getStr())}if(null!==headerFooter.firstHeader){this.memory.WriteByte(c_oSer_HeaderFooter.FirstHeader);this.memory.WriteString2(headerFooter.firstHeader.getStr())}if(null!== headerFooter.oddFooter){this.memory.WriteByte(c_oSer_HeaderFooter.OddFooter);this.memory.WriteString2(headerFooter.oddFooter.getStr())}if(null!==headerFooter.oddHeader){this.memory.WriteByte(c_oSer_HeaderFooter.OddHeader);this.memory.WriteString2(headerFooter.oddHeader.getStr())}};this.WriteRowColBreaks=function(breaks){var oThis=this;if(null!==breaks.count)this.bs.WriteItem(c_oSer_RowColBreaks.Count,function(){oThis.memory.WriteLong(breaks.count)});if(null!==breaks.manualBreakCount)this.bs.WriteItem(c_oSer_RowColBreaks.ManualBreakCount, function(){oThis.memory.WriteLong(breaks.manualBreakCount)});for(var i=0;i<breaks.breaks.length;++i)this.bs.WriteItem(c_oSer_RowColBreaks.Break,function(){oThis.WriteRowColBreak(breaks.breaks[i])})};this.WriteRowColBreak=function(brk){var oThis=this;if(null!==brk.id)this.bs.WriteItem(c_oSer_RowColBreaks.Id,function(){oThis.memory.WriteLong(brk.id)});if(null!==brk.man)this.bs.WriteItem(c_oSer_RowColBreaks.Man,function(){oThis.memory.WriteBool(brk.man)});if(null!==brk.max)this.bs.WriteItem(c_oSer_RowColBreaks.Max, function(){oThis.memory.WriteLong(brk.max)});if(null!==brk.min)this.bs.WriteItem(c_oSer_RowColBreaks.Min,function(){oThis.memory.WriteLong(brk.min)});if(null!==brk.pt)this.bs.WriteItem(c_oSer_RowColBreaks.Pt,function(){oThis.memory.WriteBool(brk.pt)})};this.WriteLegacyDrawingHF=function(legacyDrawingHF){var oThis=this;if(null!==legacyDrawingHF.cfe)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Cfe,function(){oThis.memory.WriteLong(legacyDrawingHF.cfe)});if(null!==legacyDrawingHF.cff)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Cff, function(){oThis.memory.WriteLong(legacyDrawingHF.cff)});if(null!==legacyDrawingHF.cfo)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Cfo,function(){oThis.memory.WriteLong(legacyDrawingHF.cfo)});if(null!==legacyDrawingHF.che)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Che,function(){oThis.memory.WriteLong(legacyDrawingHF.che)});if(null!==legacyDrawingHF.chf)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Chf,function(){oThis.memory.WriteLong(legacyDrawingHF.chf)});if(null!==legacyDrawingHF.cho)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Cho, function(){oThis.memory.WriteLong(legacyDrawingHF.cho)});if(null!==legacyDrawingHF.lfe)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Lfe,function(){oThis.memory.WriteLong(legacyDrawingHF.lfe)});if(null!==legacyDrawingHF.lff)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Lff,function(){oThis.memory.WriteLong(legacyDrawingHF.lff)});if(null!==legacyDrawingHF.lfo)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Lfo,function(){oThis.memory.WriteLong(legacyDrawingHF.lfo)});if(null!==legacyDrawingHF.lhe)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Lhe, function(){oThis.memory.WriteLong(legacyDrawingHF.lhe)});if(null!==legacyDrawingHF.lhf)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Lhf,function(){oThis.memory.WriteLong(legacyDrawingHF.lhf)});if(null!==legacyDrawingHF.lho)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Lho,function(){oThis.memory.WriteLong(legacyDrawingHF.lho)});if(null!==legacyDrawingHF.rfe)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Rfe,function(){oThis.memory.WriteLong(legacyDrawingHF.rfe)});if(null!==legacyDrawingHF.rff)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Rff, function(){oThis.memory.WriteLong(legacyDrawingHF.rff)});if(null!==legacyDrawingHF.rfo)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Rfo,function(){oThis.memory.WriteLong(legacyDrawingHF.rfo)});if(null!==legacyDrawingHF.rhe)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Rhe,function(){oThis.memory.WriteLong(legacyDrawingHF.rhe)});if(null!==legacyDrawingHF.rhf)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Rhf,function(){oThis.memory.WriteLong(legacyDrawingHF.rhf)});if(null!==legacyDrawingHF.rho)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Rho, function(){oThis.memory.WriteLong(legacyDrawingHF.rho)});this.bs.WriteItem(c_oSer_LegacyDrawingHF.Drawings,function(){oThis.WriteLegacyDrawingHFDrawings(legacyDrawingHF.drawings)})};this.WriteLegacyDrawingHFDrawings=function(drawings){var oThis=this;for(var i=0;i<drawings.length;++i)this.bs.WriteItem(c_oSer_LegacyDrawingHF.Drawing,function(){oThis.WriteLegacyDrawingHFDrawing(drawings[i])})};this.WriteLegacyDrawingHFDrawing=function(drawing){var oThis=this;if(null!==drawing.id){this.memory.WriteByte(c_oSer_LegacyDrawingHF.DrawingId); this.memory.WriteString2(drawing.id)}if(null!==drawing.graphicObject)this.bs.WriteItem(c_oSer_LegacyDrawingHF.DrawingShape,function(){pptx_content_writer.WriteDrawing(oThis.memory,drawing.graphicObject,null,null,null)})}}function BinaryOtherTableWriter(memory,wb){this.memory=memory;this.wb=wb;this.bs=new BinaryCommonWriter(this.memory);this.Write=function(){var oThis=this;this.bs.WriteItemWithLength(function(){oThis.WriteOtherContent()})};this.WriteOtherContent=function(){var oThis=this;this.bs.WriteItem(c_oSer_OtherType.Theme, function(){pptx_content_writer.WriteTheme(oThis.memory,oThis.wb.theme)})}}function BinaryPersonTableWriter(memory,personList){this.memory=memory;this.personList=personList;this.bs=new BinaryCommonWriter(this.memory);this.Write=function(){var oThis=this;this.bs.WriteItemWithLength(function(){oThis.WritePersonList()})};this.WritePersonList=function(){var oThis=this;for(var i=0;i<this.personList.length;++i)this.bs.WriteItem(c_oSer_Person.person,function(){oThis.WritePerson(oThis.personList[i])})};this.WritePerson= function(person){var oThis=this;if(person.id)this.bs.WriteItem(c_oSer_Person.id,function(){oThis.memory.WriteString3(person.id)});if(person.userId&&person.providerId){this.bs.WriteItem(c_oSer_Person.userId,function(){oThis.memory.WriteString3(person.userId)});this.bs.WriteItem(c_oSer_Person.providerId,function(){oThis.memory.WriteString3(person.providerId)})}if(person.displayName)this.bs.WriteItem(c_oSer_Person.displayName,function(){oThis.memory.WriteString3(person.displayName)})}}function BinaryFileWriter(wb, isCopyPaste,saveThreadedComments){this.Memory=new AscCommon.CMemory;this.wb=wb;this.isCopyPaste=isCopyPaste;this.saveThreadedComments=saveThreadedComments;this.nLastFilePos=0;this.nRealTableCount=0;this.bs=new BinaryCommonWriter(this.Memory);this.Write=function(noBase64,onlySaveBase64){var t=this;pptx_content_writer._Start();if(noBase64)this.Memory.WriteXmlString(this.WriteFileHeader(0,Asc.c_nVersionNoBase64));AscCommonExcel.executeInR1C1Mode(false,function(){t.WriteMainTable()});pptx_content_writer._End(); if(noBase64)if(onlySaveBase64)return this.Memory.GetBase64Memory();else return this.Memory.GetData();else return this.WriteFileHeader(this.Memory.GetCurPosition(),AscCommon.c_oSerFormat.Version)+this.Memory.GetBase64Memory()};this.WriteFileHeader=function(nDataSize,version){return AscCommon.c_oSerFormat.Signature+";v"+version+";"+nDataSize+";"};this.WriteMainTable=function(){var t=this;var nTableCount=128;this.nRealTableCount=0;var nStart=this.Memory.GetCurPosition();var nmtItemSize=5;this.nLastFilePos= nStart+nTableCount*nmtItemSize;this.Memory.WriteByte(0);if(this.wb.App)this.WriteTable(c_oSerTableTypes.App,{Write:function(){var old=new AscCommon.CMemory(true);pptx_content_writer.BinaryFileWriter.ExportToMemory(old);pptx_content_writer.BinaryFileWriter.ImportFromMemory(t.Memory);t.wb.App.toStream(pptx_content_writer.BinaryFileWriter);pptx_content_writer.BinaryFileWriter.ExportToMemory(t.Memory);pptx_content_writer.BinaryFileWriter.ImportFromMemory(old)}});if(this.wb.Core)this.WriteTable(c_oSerTableTypes.Core, {Write:function(){var old=new AscCommon.CMemory(true);pptx_content_writer.BinaryFileWriter.ExportToMemory(old);pptx_content_writer.BinaryFileWriter.ImportFromMemory(t.Memory);t.wb.Core.toStream(pptx_content_writer.BinaryFileWriter,t.wb.oApi);pptx_content_writer.BinaryFileWriter.ExportToMemory(t.Memory);pptx_content_writer.BinaryFileWriter.ImportFromMemory(old)}});if(this.wb.CustomProperties)this.WriteTable(c_oSerTableTypes.CustomProperties,{Write:function(){var old=new AscCommon.CMemory(true);pptx_content_writer.BinaryFileWriter.ExportToMemory(old); pptx_content_writer.BinaryFileWriter.ImportFromMemory(t.Memory);t.wb.CustomProperties.toStream(pptx_content_writer.BinaryFileWriter);pptx_content_writer.BinaryFileWriter.ExportToMemory(t.Memory);pptx_content_writer.BinaryFileWriter.ImportFromMemory(old)}});var oSharedStrings={index:0,strings:{}};var nSharedStringsPos=this.ReserveTable(c_oSerTableTypes.SharedStrings);var nStylesTablePos=this.ReserveTable(c_oSerTableTypes.Styles);var aDxfs=[];var personList=[];var commentUniqueGuids={};var tableIds= {};var sheetIds={};var oBinaryStylesTableWriter=new BinaryStylesTableWriter(this.Memory,this.wb,aDxfs);var oBinaryWorksheetsTableWriter=new BinaryWorksheetsTableWriter(this.Memory,this.wb,oSharedStrings,aDxfs,personList,this.isCopyPaste,oBinaryStylesTableWriter,this.saveThreadedComments,commentUniqueGuids,tableIds,sheetIds);this.WriteTable(c_oSerTableTypes.Workbook,new BinaryWorkbookTableWriter(this.Memory,this.wb,oBinaryWorksheetsTableWriter,this.isCopyPaste,tableIds,sheetIds));this.WriteTable(c_oSerTableTypes.Worksheets, oBinaryWorksheetsTableWriter);if(personList.length>0)this.WriteTable(c_oSerTableTypes.PersonList,new BinaryPersonTableWriter(this.Memory,personList));if(!this.isCopyPaste)this.WriteTable(c_oSerTableTypes.Other,new BinaryOtherTableWriter(this.Memory,this.wb));this.WriteReserved(new BinarySharedStringsTableWriter(this.Memory,this.wb,oSharedStrings,oBinaryStylesTableWriter),nSharedStringsPos);this.WriteReserved(oBinaryStylesTableWriter,nStylesTablePos);this.Memory.Seek(nStart);this.Memory.WriteByte(this.nRealTableCount); this.Memory.Seek(this.nLastFilePos)};this.WriteTable=function(type,oTableSer){this.Memory.WriteByte(type);this.Memory.WriteLong(this.nLastFilePos);var nCurPos=this.Memory.GetCurPosition();this.Memory.Seek(this.nLastFilePos);oTableSer.Write();this.nLastFilePos=this.Memory.GetCurPosition();this.Memory.Seek(nCurPos);this.nRealTableCount++};this.ReserveTable=function(type){var res=0;this.Memory.WriteByte(type);res=this.Memory.GetCurPosition();this.Memory.WriteLong(this.nLastFilePos);return res};this.WriteReserved= function(oTableSer,nPos){this.Memory.Seek(nPos);this.Memory.WriteLong(this.nLastFilePos);var nCurPos=this.Memory.GetCurPosition();this.Memory.Seek(this.nLastFilePos);oTableSer.Write();this.nLastFilePos=this.Memory.GetCurPosition();this.Memory.Seek(nCurPos);this.nRealTableCount++}}function Binary_TableReader(stream,oReadResult,ws,Dxfs){this.stream=stream;this.ws=ws;this.Dxfs=Dxfs;this.bcr=new Binary_CommonReader(this.stream);this.oReadResult=oReadResult;this.Read=function(length,aTables){var res=c_oSerConstants.ReadOk; var oThis=this;res=this.bcr.Read1(length,function(t,l){return oThis.ReadTables(t,l,aTables)});return res};this.ReadTables=function(type,length,aTables){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_TablePart.Table==type){var oNewTable=this.ws.createTablePart();res=this.bcr.Read1(length,function(t,l){return oThis.ReadTable(t,l,oNewTable)});if(null!=oNewTable.Ref&&null!=oNewTable.DisplayName)this.ws.workbook.dependencyFormulas.addTableName(this.ws,oNewTable,true);aTables.push(oNewTable)}else res= c_oSerConstants.ReadUnknown;return res};this.ReadTable=function(type,length,oTable){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_TablePart.Ref==type)oTable.Ref=AscCommonExcel.g_oRangeCache.getAscRange(this.stream.GetString2LE(length));else if(c_oSer_TablePart.HeaderRowCount==type)oTable.HeaderRowCount=this.stream.GetULongLE();else if(c_oSer_TablePart.TotalsRowCount==type)oTable.TotalsRowCount=this.stream.GetULongLE();else if(c_oSer_TablePart.DisplayName==type)oTable.DisplayName=this.stream.GetString2LE(length); else if(c_oSer_TablePart.AutoFilter==type){oTable.AutoFilter=new AscCommonExcel.AutoFilter;res=this.bcr.Read1(length,function(t,l){return oThis.ReadAutoFilter(t,l,oTable.AutoFilter)});if(!oTable.AutoFilter.Ref)oTable.AutoFilter.Ref=oTable.generateAutoFilterRef()}else if(c_oSer_TablePart.SortState==type){oTable.SortState=new AscCommonExcel.SortState;res=this.bcr.Read1(length,function(t,l){return oThis.ReadSortState(t,l,oTable.SortState)})}else if(c_oSer_TablePart.TableColumns==type){oTable.TableColumns= [];res=this.bcr.Read1(length,function(t,l){return oThis.ReadTableColumns(t,l,oTable.TableColumns)})}else if(c_oSer_TablePart.TableStyleInfo==type){oTable.TableStyleInfo=new AscCommonExcel.TableStyleInfo;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadTableStyleInfo(t,l,oTable.TableStyleInfo)})}else if(c_oSer_TablePart.AltTextTable==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadAltTextTable(t,l,oTable)});else if(c_oSer_TablePart.Id==type)this.oReadResult.tableIds[this.stream.GetULongLE()]= oTable;else res=c_oSerConstants.ReadUnknown;return res};this.ReadAltTextTable=function(type,length,oTable){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_AltTextTable.AltText==type)oTable.altText=this.stream.GetString2LE(length);else if(c_oSer_AltTextTable.AltTextSummary==type)oTable.altTextSummary=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadAutoFilter=function(type,length,oAutoFilter){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_AutoFilter.Ref== type)oAutoFilter.setStringRef(this.stream.GetString2LE(length));else if(c_oSer_AutoFilter.FilterColumns==type){oAutoFilter.FilterColumns=[];res=this.bcr.Read1(length,function(t,l){return oThis.ReadFilterColumns(t,l,oAutoFilter.FilterColumns)})}else if(c_oSer_AutoFilter.SortState==type){oAutoFilter.SortState=new AscCommonExcel.SortState;res=this.bcr.Read1(length,function(t,l){return oThis.ReadSortState(t,l,oAutoFilter.SortState)})}else res=c_oSerConstants.ReadUnknown;return res};this.ReadFilterColumns= function(type,length,aFilterColumns){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_AutoFilter.FilterColumn==type){var oFilterColumn=new AscCommonExcel.FilterColumn;res=this.bcr.Read1(length,function(t,l){return oThis.ReadFilterColumn(t,l,oFilterColumn)});aFilterColumns.push(oFilterColumn)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadFilterColumn=function(type,length,oFilterColumn){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_FilterColumn.ColId==type)oFilterColumn.ColId= this.stream.GetULongLE();else if(c_oSer_FilterColumn.Filters==type){oFilterColumn.Filters=new AscCommonExcel.Filters;res=this.bcr.Read1(length,function(t,l){return oThis.ReadFilters(t,l,oFilterColumn.Filters)});oFilterColumn.Filters.sortDate()}else if(c_oSer_FilterColumn.CustomFilters==type){oFilterColumn.CustomFiltersObj=new Asc.CustomFilters;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCustomFilters(t,l,oFilterColumn.CustomFiltersObj)})}else if(c_oSer_FilterColumn.DynamicFilter==type){oFilterColumn.DynamicFilter= new Asc.DynamicFilter;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadDynamicFilter(t,l,oFilterColumn.DynamicFilter)})}else if(c_oSer_FilterColumn.ColorFilter==type){oFilterColumn.ColorFilter=new Asc.ColorFilter;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadColorFilter(t,l,oFilterColumn.ColorFilter)})}else if(c_oSer_FilterColumn.Top10==type){oFilterColumn.Top10=new Asc.Top10;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadTop10(t,l,oFilterColumn.Top10)})}else if(c_oSer_FilterColumn.HiddenButton== type)oFilterColumn.ShowButton=!this.stream.GetBool();else if(c_oSer_FilterColumn.ShowButton==type)oFilterColumn.ShowButton=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadFilterColumnExternal=function(){var oThis=this;var oFilterColumn=new AscCommonExcel.FilterColumn;var length=this.stream.GetULongLE();var res=this.bcr.Read1(length,function(t,l){return oThis.ReadFilterColumn(t,l,oFilterColumn)});return oFilterColumn};this.ReadFilters=function(type,length,oFilters){var res= c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_FilterColumn.Filter==type){var oFilterVal=new AscCommonExcel.Filter;res=this.bcr.Read1(length,function(t,l){return oThis.ReadFilter(t,l,oFilterVal)});if(null!=oFilterVal.Val)oFilters.Values[oFilterVal.Val]=1}else if(c_oSer_FilterColumn.DateGroupItem==type){var oDateGroupItem=new AscCommonExcel.DateGroupItem;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadDateGroupItem(t,l,oDateGroupItem)});var autoFilterDateElem=new AscCommonExcel.AutoFilterDateElem; autoFilterDateElem.convertDateGroupItemToRange(oDateGroupItem);oFilters.Dates.push(autoFilterDateElem)}else if(c_oSer_FilterColumn.FiltersBlank==type)oFilters.Blank=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadFilter=function(type,length,oFilter){var res=c_oSerConstants.ReadOk;if(c_oSer_Filter.Val==type)oFilter.Val=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadDateGroupItem=function(type,length,oDateGroupItem){var res= c_oSerConstants.ReadOk;if(c_oSer_DateGroupItem.DateTimeGrouping==type)oDateGroupItem.DateTimeGrouping=this.stream.GetUChar();else if(c_oSer_DateGroupItem.Day==type)oDateGroupItem.Day=this.stream.GetULongLE();else if(c_oSer_DateGroupItem.Hour==type)oDateGroupItem.Hour=this.stream.GetULongLE();else if(c_oSer_DateGroupItem.Minute==type)oDateGroupItem.Minute=this.stream.GetULongLE();else if(c_oSer_DateGroupItem.Month==type)oDateGroupItem.Month=this.stream.GetULongLE();else if(c_oSer_DateGroupItem.Second== type)oDateGroupItem.Second=this.stream.GetULongLE();else if(c_oSer_DateGroupItem.Year==type)oDateGroupItem.Year=this.stream.GetULongLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadCustomFilters=function(type,length,oCustomFilters){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_CustomFilters.And==type)oCustomFilters.And=this.stream.GetBool();else if(c_oSer_CustomFilters.CustomFilters==type){oCustomFilters.CustomFilters=[];res=this.bcr.Read1(length,function(t,l){return oThis.ReadCustomFiltersItems(t, l,oCustomFilters.CustomFilters)})}else res=c_oSerConstants.ReadUnknown;return res};this.ReadCustomFiltersItems=function(type,length,aCustomFilters){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_CustomFilters.CustomFilter==type){var oCustomFiltersItem=new Asc.CustomFilter;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadCustomFiltersItem(t,l,oCustomFiltersItem)});aCustomFilters.push(oCustomFiltersItem)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadCustomFiltersItem= function(type,length,oCustomFiltersItem){var res=c_oSerConstants.ReadOk;if(c_oSer_CustomFilters.Operator==type)oCustomFiltersItem.Operator=this.stream.GetUChar();else if(c_oSer_CustomFilters.Val==type)oCustomFiltersItem.Val=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadDynamicFilter=function(type,length,oDynamicFilter){var res=c_oSerConstants.ReadOk;if(c_oSer_DynamicFilter.Type==type)oDynamicFilter.Type=this.stream.GetUChar();else if(c_oSer_DynamicFilter.Val== type)oDynamicFilter.Val=this.stream.GetDoubleLE();else if(c_oSer_DynamicFilter.MaxVal==type)oDynamicFilter.MaxVal=this.stream.GetDoubleLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadColorFilter=function(type,length,oColorFilter){var res=c_oSerConstants.ReadOk;if(c_oSer_ColorFilter.CellColor==type)oColorFilter.CellColor=this.stream.GetBool();else if(c_oSer_ColorFilter.DxfId==type){var DxfId=this.stream.GetULongLE();oColorFilter.dxf=this.Dxfs[DxfId]}else res=c_oSerConstants.ReadUnknown; return res};this.ReadTop10=function(type,length,oTop10){var res=c_oSerConstants.ReadOk;if(c_oSer_Top10.FilterVal==type)oTop10.FilterVal=this.stream.GetDoubleLE();else if(c_oSer_Top10.Percent==type)oTop10.Percent=this.stream.GetBool();else if(c_oSer_Top10.Top==type)oTop10.Top=this.stream.GetBool();else if(c_oSer_Top10.Val==type)oTop10.Val=this.stream.GetDoubleLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadSortConditionContent=function(type,length,oSortCondition){var res=c_oSerConstants.ReadOk; if(c_oSer_SortState.ConditionRef==type)oSortCondition.Ref=AscCommonExcel.g_oRangeCache.getAscRange(this.stream.GetString2LE(length));else if(c_oSer_SortState.ConditionSortBy==type)oSortCondition.ConditionSortBy=this.stream.GetUChar();else if(c_oSer_SortState.ConditionDescending==type)oSortCondition.ConditionDescending=this.stream.GetBool();else if(c_oSer_SortState.ConditionDxfId==type){var DxfId=this.stream.GetULongLE();oSortCondition.dxf=this.Dxfs[DxfId]}else res=c_oSerConstants.ReadUnknown;return res}; this.ReadSortCondition=function(type,length,aSortConditions){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_SortState.SortCondition==type){var oSortCondition=new AscCommonExcel.SortCondition;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadSortConditionContent(t,l,oSortCondition)});aSortConditions.push(oSortCondition)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadSortConditionExternal=function(){var oThis=this;var oSortCondition=new AscCommonExcel.SortCondition; var length=this.stream.GetULongLE();var res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadSortConditionContent(t,l,oSortCondition)});return oSortCondition};this.ReadSortState=function(type,length,oSortState){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_SortState.Ref==type)oSortState.Ref=AscCommonExcel.g_oRangeCache.getAscRange(this.stream.GetString2LE(length));else if(c_oSer_SortState.CaseSensitive==type)oSortState.CaseSensitive=this.stream.GetBool();else if(c_oSer_SortState.ColumnSort== type)oSortState.ColumnSort=this.stream.GetBool();else if(c_oSer_SortState.SortMethod==type)oSortState.SortMethod=this.stream.GetUChar();else if(c_oSer_SortState.SortConditions==type){oSortState.SortConditions=[];res=this.bcr.Read1(length,function(t,l){return oThis.ReadSortCondition(t,l,oSortState.SortConditions)})}else res=c_oSerConstants.ReadUnknown;return res};this.ReadTableColumn=function(type,length,oTableColumn){var res=c_oSerConstants.ReadOk;if(c_oSer_TableColumns.Name==type)oTableColumn.Name= this.stream.GetString2LE(length);else if(c_oSer_TableColumns.TotalsRowLabel==type)oTableColumn.TotalsRowLabel=this.stream.GetString2LE(length);else if(c_oSer_TableColumns.TotalsRowFunction==type)oTableColumn.TotalsRowFunction=this.stream.GetUChar();else if(c_oSer_TableColumns.TotalsRowFormula==type){var formula=this.stream.GetString2LE(length);this.oReadResult.tableCustomFunc.push({formula:formula,column:oTableColumn,ws:this.ws})}else if(c_oSer_TableColumns.DataDxfId==type){var DxfId=this.stream.GetULongLE(); oTableColumn.dxf=this.Dxfs[DxfId]}else res=c_oSerConstants.ReadUnknown;return res};this.ReadTableColumns=function(type,length,aTableColumns){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_TableColumns.TableColumn==type){var oTableColumn=new AscCommonExcel.TableColumn;res=this.bcr.Read1(length,function(t,l){return oThis.ReadTableColumn(t,l,oTableColumn)});aTableColumns.push(oTableColumn)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadTableStyleInfo=function(type,length,oTableStyleInfo){var res= c_oSerConstants.ReadOk;if(c_oSer_TableStyleInfo.Name==type)oTableStyleInfo.Name=this.stream.GetString2LE(length);else if(c_oSer_TableStyleInfo.ShowColumnStripes==type)oTableStyleInfo.ShowColumnStripes=this.stream.GetBool();else if(c_oSer_TableStyleInfo.ShowRowStripes==type)oTableStyleInfo.ShowRowStripes=this.stream.GetBool();else if(c_oSer_TableStyleInfo.ShowFirstColumn==type)oTableStyleInfo.ShowFirstColumn=this.stream.GetBool();else if(c_oSer_TableStyleInfo.ShowLastColumn==type)oTableStyleInfo.ShowLastColumn= this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res}}function Binary_SharedStringTableReader(stream,wb,aSharedStrings){this.stream=stream;this.wb=wb;this.aSharedStrings=aSharedStrings;this.bcr=new Binary_CommonReader(this.stream);this.Read=function(){var oThis=this;var tempValue={text:null,multiText:null};return this.bcr.ReadTable(function(t,l){return oThis.ReadSharedStringContent(t,l,tempValue)})};this.ReadSharedStringContent=function(type,length,tempValue){var res=c_oSerConstants.ReadOk; if(c_oSerSharedStringTypes.Si===type){var oThis=this;tempValue.text=null;tempValue.multiText=null;res=this.bcr.Read1(length,function(t,l){return oThis.ReadSharedString(t,l,tempValue)});if(null!=this.aSharedStrings)if(null!=tempValue.text)this.aSharedStrings.push(tempValue.text);else if(null!=tempValue.multiText)this.aSharedStrings.push(tempValue.multiText);else this.aSharedStrings.push("")}else res=c_oSerConstants.ReadUnknown;return res};this.ReadSharedString=function(type,length,tempValue){var res= c_oSerConstants.ReadOk;if(c_oSerSharedStringTypes.Run==type){var oThis=this;var oRun=new AscCommonExcel.CMultiTextElem;res=this.bcr.Read1(length,function(t,l){return oThis.ReadRun(t,l,oRun)});if(null==tempValue.multiText)tempValue.multiText=[];tempValue.multiText.push(oRun)}else if(c_oSerSharedStringTypes.Text==type){if(null==tempValue.text)tempValue.text="";tempValue.text+=this.stream.GetString2LE(length)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadRun=function(type,length,oRun){var oThis= this;var res=c_oSerConstants.ReadOk;if(c_oSerSharedStringTypes.RPr==type){if(null==oRun.format)oRun.format=new AscCommonExcel.Font;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadRPr(t,l,oRun.format)});oRun.format.checkSchemeFont(this.wb.theme)}else if(c_oSerSharedStringTypes.Text==type){if(null==oRun.text)oRun.text="";oRun.text+=this.stream.GetString2LE(length)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadRPr=function(type,length,rPr){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oSerFontTypes.Bold==type)rPr.b=this.stream.GetBool();else if(c_oSerFontTypes.Color==type){var color=ReadColorSpreadsheet2(this.bcr,length);if(color)rPr.c=color}else if(c_oSerFontTypes.Italic==type)rPr.i=this.stream.GetBool();else if(c_oSerFontTypes.RFont==type)rPr.fn=this.stream.GetString2LE(length);else if(c_oSerFontTypes.Strike==type)rPr.s=this.stream.GetBool();else if(c_oSerFontTypes.Sz==type)rPr.fs=this.stream.GetDoubleLE();else if(c_oSerFontTypes.Underline==type)rPr.u=this.stream.GetUChar(); else if(c_oSerFontTypes.VertAlign==type){rPr.va=this.stream.GetUChar();if(rPr.va===AscCommon.vertalign_SubScript)rPr.va=AscCommon.vertalign_SuperScript;else if(rPr.va===AscCommon.vertalign_SuperScript)rPr.va=AscCommon.vertalign_SubScript}else if(c_oSerFontTypes.Scheme==type)rPr.scheme=this.stream.GetUChar();else res=c_oSerConstants.ReadUnknown;return res}}function Binary_StylesTableReader(stream,wb,aCellXfs,isCopyPaste,useNumId){this.stream=stream;this.wb=wb;this.aCellXfs=aCellXfs;this.bcr=new Binary_CommonReader(this.stream); this.bssr=new Binary_SharedStringTableReader(this.stream,wb);this.isCopyPaste=isCopyPaste;this.useNumId=useNumId;this.Read=function(){var oThis=this;var oStyleObject={aBorders:[],aFills:[],aFonts:[],oNumFmts:{},aCellStyleXfs:[],aCellXfs:[],aDxfs:[],aExtDxfs:[],aCellStyles:[],oCustomTableStyles:{},oCustomSlicerStyles:null};var res=this.bcr.ReadTable(function(t,l){return oThis.ReadStylesContent(t,l,oStyleObject)});return oStyleObject};this.InitStyleManager=function(oStyleObject){var i,xf,firstFont, firstFill,secondFill,firstBorder,firstXf,newXf,oCellStyle;if(0===oStyleObject.aFonts.length){oStyleObject.aFonts[0]=new AscCommonExcel.Font;oStyleObject.aFonts[0].initDefault(this.wb)}if(0===oStyleObject.aCellXfs.length){xf=new OpenXf;xf.fontid=xf.fillid=xf.borderid=xf.numid=xf.XfId=0;oStyleObject.aCellXfs[0]=xf}if(0===oStyleObject.aCellStyleXfs.length){xf=new OpenXf;xf.fontid=xf.fillid=xf.borderid=xf.numid=0;oStyleObject.aCellStyleXfs[0]=xf}var hasNormalStyle=false;for(i=0;i<oStyleObject.aCellStyles.length;++i){oCellStyle= oStyleObject.aCellStyles[i];if(0===oCellStyle.BuiltinId){hasNormalStyle=true;break}}if(!hasNormalStyle){oCellStyle=new AscCommonExcel.CCellStyle;oCellStyle.Name="Normal";oCellStyle.BuiltinId=0;oCellStyle.XfId=0;oStyleObject.aCellStyles.push(oCellStyle)}var defFont=oStyleObject.aFonts[oStyleObject.aCellXfs[0].fontid];if(defFont)defFont.initDefault(this.wb);for(i=0;i<oStyleObject.aFonts.length;++i)oStyleObject.aFonts[i]=g_StyleCache.addFont(oStyleObject.aFonts[i]);firstFont=oStyleObject.aFonts[0];for(i= 2;i<oStyleObject.aFills.length;++i)oStyleObject.aFills[i]=g_StyleCache.addFill(oStyleObject.aFills[i]);firstFill=new AscCommonExcel.Fill;firstFill.fromPatternParams(AscCommonExcel.c_oAscPatternType.None,null);secondFill=new AscCommonExcel.Fill;secondFill.fromPatternParams(AscCommonExcel.c_oAscPatternType.Gray125,null);if(!this.isCopyPaste){firstFill=g_StyleCache.addFill(firstFill,true);secondFill=g_StyleCache.addFill(secondFill,true)}else{firstFill=g_StyleCache.addFill(firstFill);secondFill=g_StyleCache.addFill(secondFill)}oStyleObject.aFills[0]= firstFill;oStyleObject.aFills[1]=secondFill;oStyleObject.aBorders[0]=new AscCommonExcel.Border;for(i=0;i<oStyleObject.aBorders.length;++i)oStyleObject.aBorders[i]=g_StyleCache.addBorder(oStyleObject.aBorders[i]);firstBorder=oStyleObject.aBorders[0];for(i=0;i<oStyleObject.aCellStyleXfs.length;++i){xf=oStyleObject.aCellStyleXfs[i];if(xf.align)xf.align=g_StyleCache.addAlign(xf.align)}for(i=0;i<oStyleObject.aCellXfs.length;++i){xf=oStyleObject.aCellXfs[i];if(xf.align)xf.align=g_StyleCache.addAlign(xf.align)}this.InitDxfs(oStyleObject.aDxfs); this.InitDxfs(oStyleObject.aExtDxfs);var arrStyleMap={};var nIndexStyleMap=1;var XfIdTmp;var oCellStyleNames={};var normalXf=null;for(i=0;i<oStyleObject.aCellStyles.length;++i){oCellStyle=oStyleObject.aCellStyles[i];newXf=new AscCommonExcel.CellXfs;XfIdTmp=oCellStyle.XfId;if(null!==XfIdTmp)if(0===oCellStyle.BuiltinId){arrStyleMap[XfIdTmp]=0;if(!normalXf){XfIdTmp=oCellStyle.XfId=0;normalXf=newXf;if(oStyleObject.aCellStyleXfs[XfIdTmp])oStyleObject.aCellStyleXfs[XfIdTmp].fontid=0}else continue}else{arrStyleMap[XfIdTmp]= nIndexStyleMap;oCellStyle.XfId=nIndexStyleMap++}else continue;var oCellStyleXfs=oStyleObject.aCellStyleXfs[XfIdTmp];if(null==oCellStyleXfs)continue;if(null!=oCellStyleXfs.borderid){var borderCellStyle=oStyleObject.aBorders[oCellStyleXfs.borderid];if(null!=borderCellStyle)newXf.border=borderCellStyle}if(null!=oCellStyleXfs.fillid){var fillCellStyle=oStyleObject.aFills[oCellStyleXfs.fillid];if(null!=fillCellStyle)newXf.fill=fillCellStyle}if(null!=oCellStyleXfs.fontid){var fontCellStyle=oStyleObject.aFonts[oCellStyleXfs.fontid]; if(null!=fontCellStyle)newXf.font=fontCellStyle}if(null!=oCellStyleXfs.numid){var oCurNumCellStyle=oStyleObject.oNumFmts[oCellStyleXfs.numid];if(null!=oCurNumCellStyle)newXf.num=g_StyleCache.addNum(oCurNumCellStyle);else newXf.num=g_StyleCache.addNum(this.ParseNum({id:oCellStyleXfs.numid,f:null},oStyleObject.oNumFmts))}if(null!=oCellStyleXfs.QuotePrefix)newXf.QuotePrefix=oCellStyleXfs.QuotePrefix;if(null!=oCellStyleXfs.PivotButton)newXf.PivotButton=oCellStyleXfs.PivotButton;if(null!=oCellStyleXfs.align)newXf.align= oCellStyleXfs.align;if(null!==oCellStyleXfs.ApplyBorder)oCellStyle.ApplyBorder=oCellStyleXfs.ApplyBorder;if(null!==oCellStyleXfs.ApplyFill)oCellStyle.ApplyFill=oCellStyleXfs.ApplyFill;if(null!==oCellStyleXfs.ApplyFont)oCellStyle.ApplyFont=oCellStyleXfs.ApplyFont;if(null!==oCellStyleXfs.ApplyNumberFormat)oCellStyle.ApplyNumberFormat=oCellStyleXfs.ApplyNumberFormat;oCellStyle.xfs=g_StyleCache.addXf(newXf);this.wb.CellStyles.CustomStyles.push(oCellStyle);if(null!==oCellStyle.Name)oCellStyleNames[oCellStyle.Name]= true}var nNewStyleIndex=1,newStyleName;for(var i=0,length=this.wb.CellStyles.CustomStyles.length;i<length;++i)if(null===this.wb.CellStyles.CustomStyles[i].Name){do newStyleName="Style"+nNewStyleIndex++;while(oCellStyleNames[newStyleName]);this.wb.CellStyles.CustomStyles[i].Name=newStyleName}for(var i=0,length=oStyleObject.aCellXfs.length;i<length;++i){var xfs=oStyleObject.aCellXfs[i];newXf=new AscCommonExcel.CellXfs;if(null!=xfs.borderid){var border=oStyleObject.aBorders[xfs.borderid];if(null!=border)newXf.border= border}if(null!=xfs.fillid){var fill=oStyleObject.aFills[xfs.fillid];if(null!=fill)newXf.fill=fill}if(null!=xfs.fontid){var font=oStyleObject.aFonts[xfs.fontid];if(null!=font)newXf.font=font}if(null!=xfs.numid){var oCurNum=oStyleObject.oNumFmts[xfs.numid];if(null!=oCurNum)newXf.num=g_StyleCache.addNum(oCurNum);else newXf.num=g_StyleCache.addNum(this.ParseNum({id:xfs.numid,f:null},oStyleObject.oNumFmts))}if(null!=xfs.QuotePrefix)newXf.QuotePrefix=xfs.QuotePrefix;if(null!=xfs.PivotButton)newXf.PivotButton= xfs.PivotButton;if(null!=xfs.align)newXf.align=xfs.align;if(null!==xfs.XfId){XfIdTmp=arrStyleMap[xfs.XfId];if(null==XfIdTmp)XfIdTmp=0;newXf.XfId=XfIdTmp}if(0==this.aCellXfs.length&&!this.isCopyPaste)firstXf=newXf;else newXf=g_StyleCache.addXf(newXf);this.aCellXfs.push(newXf)}if(firstXf&&!this.isCopyPaste){firstXf=g_StyleCache.addXf(firstXf,true);this.wb.oStyleManager.init(firstXf,firstFont,firstFill,secondFill,firstBorder,normalXf)}this.InitTableStyles(this.wb.TableStyles.CustomStyles,oStyleObject.oCustomTableStyles, oStyleObject.aDxfs);wb.SlicerStyles.addCustomStylesAtOpening(oStyleObject.oCustomSlicerStyles,oStyleObject.aExtDxfs)};this.InitDefSlicerStyles=function(wb,oStyleObject){this.InitDxfs(oStyleObject.aDxfs);this.InitDxfs(oStyleObject.aExtDxfs);this.InitTableStyles(wb.TableStyles.DefaultStyles,oStyleObject.oCustomTableStyles,oStyleObject.aDxfs);wb.SlicerStyles.addDefaultStylesAtOpening(oStyleObject.oCustomSlicerStyles,oStyleObject.aExtDxfs)};this.InitDxfs=function(Dxfs){for(var i=0;i<Dxfs.length;++i)Dxfs[i]= g_StyleCache.addXf(Dxfs[i])};this.InitTableStyles=function(tableStyles,oCustomTableStyles,aDxfs){for(var i in oCustomTableStyles){var item=oCustomTableStyles[i];if(null!=item){var style=item.style;var elems=item.elements;this.initTableStyle(style,elems,aDxfs);tableStyles[i]=style}}};this.initTableStyle=function(style,elems,Dxfs){for(var j=0,length2=elems.length;j<length2;++j){var elem=elems[j];if(null!=elem.DxfId){var Dxf=Dxfs[elem.DxfId];if(null!=Dxf){var oTableStyleElement=new CTableStyleElement; oTableStyleElement.dxf=Dxf;if(null!=elem.Size)oTableStyleElement.size=elem.Size;switch(elem.Type){case ETableStyleType.tablestyletypeBlankRow:style.blankRow=oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstColumn:style.firstColumn=oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstColumnStripe:style.firstColumnStripe=oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstColumnSubheading:style.firstColumnSubheading=oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstHeaderCell:style.firstHeaderCell= oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstRowStripe:style.firstRowStripe=oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstRowSubheading:style.firstRowSubheading=oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstSubtotalColumn:style.firstSubtotalColumn=oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstSubtotalRow:style.firstSubtotalRow=oTableStyleElement;break;case ETableStyleType.tablestyletypeFirstTotalCell:style.firstTotalCell= oTableStyleElement;break;case ETableStyleType.tablestyletypeHeaderRow:style.headerRow=oTableStyleElement;break;case ETableStyleType.tablestyletypeLastColumn:style.lastColumn=oTableStyleElement;break;case ETableStyleType.tablestyletypeLastHeaderCell:style.lastHeaderCell=oTableStyleElement;break;case ETableStyleType.tablestyletypeLastTotalCell:style.lastTotalCell=oTableStyleElement;break;case ETableStyleType.tablestyletypePageFieldLabels:style.pageFieldLabels=oTableStyleElement;break;case ETableStyleType.tablestyletypePageFieldValues:style.pageFieldValues= oTableStyleElement;break;case ETableStyleType.tablestyletypeSecondColumnStripe:style.secondColumnStripe=oTableStyleElement;break;case ETableStyleType.tablestyletypeSecondColumnSubheading:style.secondColumnSubheading=oTableStyleElement;break;case ETableStyleType.tablestyletypeSecondRowStripe:style.secondRowStripe=oTableStyleElement;break;case ETableStyleType.tablestyletypeSecondRowSubheading:style.secondRowSubheading=oTableStyleElement;break;case ETableStyleType.tablestyletypeSecondSubtotalColumn:style.secondSubtotalColumn= oTableStyleElement;break;case ETableStyleType.tablestyletypeSecondSubtotalRow:style.secondSubtotalRow=oTableStyleElement;break;case ETableStyleType.tablestyletypeThirdColumnSubheading:style.thirdColumnSubheading=oTableStyleElement;break;case ETableStyleType.tablestyletypeThirdRowSubheading:style.thirdRowSubheading=oTableStyleElement;break;case ETableStyleType.tablestyletypeThirdSubtotalColumn:style.thirdSubtotalColumn=oTableStyleElement;break;case ETableStyleType.tablestyletypeThirdSubtotalRow:style.thirdSubtotalRow= oTableStyleElement;break;case ETableStyleType.tablestyletypeTotalRow:style.totalRow=oTableStyleElement;break;case ETableStyleType.tablestyletypeWholeTable:style.wholeTable=oTableStyleElement;break}}}}};this.ParseNum=function(oNum,oNumFmts){var oRes=new AscCommonExcel.Num;var useNumId=false;if(null!=oNum&&null!=oNum.f)oRes.f=oNum.f;else{var sStandartNumFormat=AscCommonExcel.aStandartNumFormats[oNum.id];if(null!=sStandartNumFormat)oRes.f=sStandartNumFormat;if(null==oRes.f)oRes.f="General";useNumId= true}if((useNumId||this.useNumId)&&(5<=oNum.id&&oNum.id<=8||14<=oNum.id&&oNum.id<=17||22==oNum.id||27<=oNum.id&&oNum.id<=31||36<=oNum.id&&oNum.id<=44))oRes.id=oNum.id;var numFormat=AscCommon.oNumFormatCache.get(oRes.f);numFormat.checkCultureInfoFontPicker();if(null!=oNumFmts)oNumFmts[oNum.id]=oRes;return oRes};this.ReadStylesContent=function(type,length,oStyleObject){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerStylesTypes.Borders===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadBorders(t, l,oStyleObject.aBorders)});else if(c_oSerStylesTypes.Fills===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadFills(t,l,oStyleObject.aFills)});else if(c_oSerStylesTypes.Fonts===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadFonts(t,l,oStyleObject.aFonts)});else if(c_oSerStylesTypes.NumFmts===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadNumFmts(t,l,oStyleObject.oNumFmts)});else if(c_oSerStylesTypes.CellStyleXfs===type)res=this.bcr.Read1(length,function(t, l){return oThis.ReadCellStyleXfs(t,l,oStyleObject.aCellStyleXfs)});else if(c_oSerStylesTypes.CellXfs===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCellXfs(t,l,oStyleObject.aCellXfs)});else if(c_oSerStylesTypes.CellStyles===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCellStyles(t,l,oStyleObject.aCellStyles)});else if(c_oSerStylesTypes.Dxfs===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadDxfs(t,l,oStyleObject.aDxfs)});else if(c_oSerStylesTypes.TableStyles=== type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadTableStyles(t,l,oThis.wb.TableStyles,oStyleObject.oCustomTableStyles)});else if(c_oSerStylesTypes.ExtDxfs===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadDxfs(t,l,oStyleObject.aExtDxfs)});else if(c_oSerStylesTypes.SlicerStyles===type&&typeof Asc.CT_slicerStyles!="undefined"){var fileStream=this.stream.ToFileStream();fileStream.GetUChar();oStyleObject.oCustomSlicerStyles=new Asc.CT_slicerStyles;oStyleObject.oCustomSlicerStyles.fromStream(fileStream); this.stream.FromFileStream(fileStream)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadBorders=function(type,length,aBorders){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerStylesTypes.Border==type){var oNewBorder=new AscCommonExcel.Border;res=this.bcr.Read1(length,function(t,l){return oThis.ReadBorder(t,l,oNewBorder)});aBorders.push(oNewBorder)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadBorder=function(type,length,oNewBorder){var res=c_oSerConstants.ReadOk;var oThis= this;if(c_oSerBorderTypes.Bottom==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadBorderProp(t,l,oNewBorder.b)});else if(c_oSerBorderTypes.Diagonal==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadBorderProp(t,l,oNewBorder.d)});else if(c_oSerBorderTypes.End==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadBorderProp(t,l,oNewBorder.r)});else if(c_oSerBorderTypes.Horizontal==type)res=this.bcr.Read2Spreadsheet(length,function(t, l){return oThis.ReadBorderProp(t,l,oNewBorder.ih)});else if(c_oSerBorderTypes.Start==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadBorderProp(t,l,oNewBorder.l)});else if(c_oSerBorderTypes.Top==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadBorderProp(t,l,oNewBorder.t)});else if(c_oSerBorderTypes.Vertical==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadBorderProp(t,l,oNewBorder.iv)});else if(c_oSerBorderTypes.DiagonalDown== type)oNewBorder.dd=this.stream.GetBool();else if(c_oSerBorderTypes.DiagonalUp==type)oNewBorder.du=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadBorderProp=function(type,length,oBorderProp){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerBorderPropTypes.Style==type)switch(this.stream.GetUChar()){case EBorderStyle.borderstyleDashDot:oBorderProp.setStyle(c_oAscBorderStyles.DashDot);break;case EBorderStyle.borderstyleDashDotDot:oBorderProp.setStyle(c_oAscBorderStyles.DashDotDot); break;case EBorderStyle.borderstyleDashed:oBorderProp.setStyle(c_oAscBorderStyles.Dashed);break;case EBorderStyle.borderstyleDotted:oBorderProp.setStyle(c_oAscBorderStyles.Dotted);break;case EBorderStyle.borderstyleDouble:oBorderProp.setStyle(c_oAscBorderStyles.Double);break;case EBorderStyle.borderstyleHair:oBorderProp.setStyle(c_oAscBorderStyles.Hair);break;case EBorderStyle.borderstyleMedium:oBorderProp.setStyle(c_oAscBorderStyles.Medium);break;case EBorderStyle.borderstyleMediumDashDot:oBorderProp.setStyle(c_oAscBorderStyles.MediumDashDot); break;case EBorderStyle.borderstyleMediumDashDotDot:oBorderProp.setStyle(c_oAscBorderStyles.MediumDashDotDot);break;case EBorderStyle.borderstyleMediumDashed:oBorderProp.setStyle(c_oAscBorderStyles.MediumDashed);break;case EBorderStyle.borderstyleNone:oBorderProp.setStyle(c_oAscBorderStyles.None);break;case EBorderStyle.borderstyleSlantDashDot:oBorderProp.setStyle(c_oAscBorderStyles.SlantDashDot);break;case EBorderStyle.borderstyleThick:oBorderProp.setStyle(c_oAscBorderStyles.Thick);break;case EBorderStyle.borderstyleThin:oBorderProp.setStyle(c_oAscBorderStyles.Thin); break;default:oBorderProp.setStyle(c_oAscBorderStyles.None);break}else if(c_oSerBorderPropTypes.Color==type){var color=ReadColorSpreadsheet2(this.bcr,length);if(null!=color)oBorderProp.c=color}else res=c_oSerConstants.ReadUnknown;return res};this.ReadCellStyleXfs=function(type,length,aCellStyleXfs){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerStylesTypes.Xfs===type){var oNewXfs=new OpenXf;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadXfs(t,l,oNewXfs)});aCellStyleXfs.push(oNewXfs)}else res= c_oSerConstants.ReadUnknown;return res};this.ReadCellXfs=function(type,length,aCellXfs){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerStylesTypes.Xfs==type){var oNewXfs=new OpenXf;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadXfs(t,l,oNewXfs)});aCellXfs.push(oNewXfs)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadXfs=function(type,length,oXfs){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerXfsTypes.ApplyAlignment==type)oXfs.ApplyAlignment=this.stream.GetBool(); else if(c_oSerXfsTypes.ApplyBorder==type)oXfs.ApplyBorder=this.stream.GetBool();else if(c_oSerXfsTypes.ApplyFill==type)oXfs.ApplyFill=this.stream.GetBool();else if(c_oSerXfsTypes.ApplyFont==type)oXfs.ApplyFont=this.stream.GetBool();else if(c_oSerXfsTypes.ApplyNumberFormat==type)oXfs.ApplyNumberFormat=this.stream.GetBool();else if(c_oSerXfsTypes.BorderId==type)oXfs.borderid=this.stream.GetULongLE();else if(c_oSerXfsTypes.FillId==type)oXfs.fillid=this.stream.GetULongLE();else if(c_oSerXfsTypes.FontId== type)oXfs.fontid=this.stream.GetULongLE();else if(c_oSerXfsTypes.NumFmtId==type)oXfs.numid=this.stream.GetULongLE();else if(c_oSerXfsTypes.QuotePrefix==type)oXfs.QuotePrefix=this.stream.GetBool();else if(c_oSerXfsTypes.PivotButton==type)oXfs.PivotButton=this.stream.GetBool();else if(c_oSerXfsTypes.XfId===type)oXfs.XfId=this.stream.GetULongLE();else if(c_oSerXfsTypes.Aligment==type){if(null==oXfs.align)oXfs.align=new AscCommonExcel.Align;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadAligment(t, l,oXfs.align)})}else res=c_oSerConstants.ReadUnknown;return res};this.ReadAligment=function(type,length,oAligment){var res=c_oSerConstants.ReadOk;if(c_oSerAligmentTypes.Horizontal==type)switch(this.stream.GetUChar()){case 0:case 1:oAligment.hor=AscCommon.align_Center;break;case 2:case 3:case 5:oAligment.hor=AscCommon.align_Justify;break;case 4:oAligment.hor=null;break;case 6:oAligment.hor=AscCommon.align_Left;break;case 7:oAligment.hor=AscCommon.align_Right;break}else if(c_oSerAligmentTypes.Indent== type)oAligment.indent=this.stream.GetULongLE();else if(c_oSerAligmentTypes.RelativeIndent==type)oAligment.RelativeIndent=this.stream.GetULongLE();else if(c_oSerAligmentTypes.ShrinkToFit==type)oAligment.shrink=this.stream.GetBool();else if(c_oSerAligmentTypes.TextRotation==type)oAligment.angle=this.stream.GetULongLE();else if(c_oSerAligmentTypes.Vertical==type)oAligment.ver=this.stream.GetUChar();else if(c_oSerAligmentTypes.WrapText==type)oAligment.wrap=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown; return res};this.ReadFills=function(type,length,aFills){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerStylesTypes.Fill==type){var oNewFill=new AscCommonExcel.Fill;res=this.bcr.Read1(length,function(t,l){return oThis.ReadFill(t,l,oNewFill)});aFills.push(oNewFill)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadFill=function(type,length,oFill){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerFillTypes.Pattern==type){var patternFill=new AscCommonExcel.PatternFill;res=this.bcr.Read1(length, function(t,l){return oThis.ReadPatternFill(t,l,patternFill)});oFill.patternFill=patternFill}else if(c_oSerFillTypes.Gradient==type){var gradientFill=new AscCommonExcel.GradientFill;res=this.bcr.Read1(length,function(t,l){return oThis.ReadGradientFill(t,l,gradientFill)});oFill.gradientFill=gradientFill}else res=c_oSerConstants.ReadUnknown;return res};this.ReadPatternFill=function(type,length,patternFill){var res=c_oSerConstants.ReadOk;if(c_oSerFillTypes.PatternBgColor_deprecated==type)patternFill.fromColor(ReadColorSpreadsheet2(this.bcr, length));else if(c_oSerFillTypes.PatternType==type)patternFill.patternType=this.stream.GetUChar();else if(c_oSerFillTypes.PatternFgColor==type)patternFill.fgColor=ReadColorSpreadsheet2(this.bcr,length);else if(c_oSerFillTypes.PatternBgColor==type)patternFill.bgColor=ReadColorSpreadsheet2(this.bcr,length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadGradientFill=function(type,length,gradientFill){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerFillTypes.GradientType==type)gradientFill.type= this.stream.GetUChar();else if(c_oSerFillTypes.GradientLeft==type)gradientFill.left=this.stream.GetDoubleLE();else if(c_oSerFillTypes.GradientTop==type)gradientFill.top=this.stream.GetDoubleLE();else if(c_oSerFillTypes.GradientRight==type)gradientFill.right=this.stream.GetDoubleLE();else if(c_oSerFillTypes.GradientBottom==type)gradientFill.bottom=this.stream.GetDoubleLE();else if(c_oSerFillTypes.GradientDegree==type)gradientFill.degree=this.stream.GetDoubleLE();else if(c_oSerFillTypes.GradientStop== type){var gradientStop=new AscCommonExcel.GradientStop;res=this.bcr.Read1(length,function(t,l){return oThis.ReadGradientFillStop(t,l,gradientStop)});gradientFill.stop.push(gradientStop)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadGradientFillStop=function(type,length,gradientStop){var res=c_oSerConstants.ReadOk;if(c_oSerFillTypes.GradientStopPosition==type)gradientStop.position=this.stream.GetDoubleLE();else if(c_oSerFillTypes.GradientStopColor==type)gradientStop.color=ReadColorSpreadsheet2(this.bcr, length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadFonts=function(type,length,aFonts){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerStylesTypes.Font==type){var oNewFont=new AscCommonExcel.Font;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.bssr.ReadRPr(t,l,oNewFont)});oNewFont.checkSchemeFont(this.wb.theme);aFonts.push(oNewFont)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadNumFmts=function(type,length,oNumFmts){var res=c_oSerConstants.ReadOk;var oThis= this;if(c_oSerStylesTypes.NumFmt==type){var oNewNumFmt={f:null,id:null};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadNumFmt(t,l,oNewNumFmt)});if(null!=oNewNumFmt.id)this.ParseNum(oNewNumFmt,oNumFmts)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadNumFmt=function(type,length,oNumFmt){var res=c_oSerConstants.ReadOk;if(c_oSerNumFmtTypes.FormatCode==type)oNumFmt.f=this.stream.GetString2LE(length);else if(c_oSerNumFmtTypes.NumFmtId==type)oNumFmt.id=this.stream.GetULongLE(); else res=c_oSerConstants.ReadUnknown;return res};this.ReadCellStyles=function(type,length,aCellStyles){var res=c_oSerConstants.ReadOk;var oThis=this;var oCellStyle=null;if(c_oSerStylesTypes.CellStyle===type){oCellStyle=new AscCommonExcel.CCellStyle;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCellStyle(t,l,oCellStyle)});aCellStyles.push(oCellStyle)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadCellStyle=function(type,length,oCellStyle){var res=c_oSerConstants.ReadOk;if(c_oSer_CellStyle.BuiltinId=== type)oCellStyle.BuiltinId=this.stream.GetULongLE();else if(c_oSer_CellStyle.CustomBuiltin===type)oCellStyle.CustomBuiltin=this.stream.GetBool();else if(c_oSer_CellStyle.Hidden===type)oCellStyle.Hidden=this.stream.GetBool();else if(c_oSer_CellStyle.ILevel===type)oCellStyle.ILevel=this.stream.GetULongLE();else if(c_oSer_CellStyle.Name===type)oCellStyle.Name=this.stream.GetString2LE(length);else if(c_oSer_CellStyle.XfId===type)oCellStyle.XfId=this.stream.GetULongLE();else res=c_oSerConstants.ReadUnknown; return res};this.ReadDxfs=function(type,length,aDxfs){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerStylesTypes.Dxf==type){var oDxf=new AscCommonExcel.CellXfs;res=this.bcr.Read1(length,function(t,l){return oThis.ReadDxf(t,l,oDxf)});aDxfs.push(oDxf)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadDxf=function(type,length,oDxf){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_Dxf.Alignment==type){oDxf.align=new AscCommonExcel.Align;res=this.bcr.Read2Spreadsheet(length,function(t, l){return oThis.ReadAligment(t,l,oDxf.align)})}else if(c_oSer_Dxf.Border==type){var oNewBorder=new AscCommonExcel.Border;res=this.bcr.Read1(length,function(t,l){return oThis.ReadBorder(t,l,oNewBorder)});oDxf.border=oNewBorder}else if(c_oSer_Dxf.Fill==type){var oNewFill=new AscCommonExcel.Fill;res=this.bcr.Read1(length,function(t,l){return oThis.ReadFill(t,l,oNewFill)});oNewFill.fixForDxf();oDxf.fill=oNewFill}else if(c_oSer_Dxf.Font==type){var oNewFont=new AscCommonExcel.Font;res=this.bcr.Read2Spreadsheet(length, function(t,l){return oThis.bssr.ReadRPr(t,l,oNewFont)});oNewFont.checkSchemeFont(this.wb.theme);oDxf.font=oNewFont}else if(c_oSer_Dxf.NumFmt==type){var oNewNumFmt={f:null,id:null};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadNumFmt(t,l,oNewNumFmt)});if(null!=oNewNumFmt.id)oDxf.num=this.ParseNum(oNewNumFmt,null)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadDxfExternal=function(){var oThis=this;var dxf=new AscCommonExcel.CellXfs;var length=this.stream.GetULongLE(); this.bcr.Read1(length,function(t,l){return oThis.ReadDxf(t,l,dxf)});return dxf};this.ReadTableStyles=function(type,length,oTableStyles,oCustomStyles){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_TableStyles.DefaultTableStyle==type)oTableStyles.DefaultTableStyle=this.stream.GetString2LE(length);else if(c_oSer_TableStyles.DefaultPivotStyle==type)oTableStyles.DefaultPivotStyle=this.stream.GetString2LE(length);else if(c_oSer_TableStyles.TableStyles==type)res=this.bcr.Read1(length,function(t, l){return oThis.ReadTableCustomStyles(t,l,oCustomStyles)});else res=c_oSerConstants.ReadUnknown;return res};this.ReadTableCustomStyles=function(type,length,oCustomStyles){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_TableStyles.TableStyle===type){var oNewStyle=new CTableStyle;var aElements=[];res=this.bcr.Read1(length,function(t,l){return oThis.ReadTableCustomStyle(t,l,oNewStyle,aElements)});if(null!=oNewStyle.name){if(null===oNewStyle.displayName)oNewStyle.displayName=oNewStyle.name;oCustomStyles[oNewStyle.name]= {style:oNewStyle,elements:aElements}}}else res=c_oSerConstants.ReadUnknown;return res};this.ReadTableCustomStyle=function(type,length,oNewStyle,aElements){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_TableStyle.Name===type)oNewStyle.name=this.stream.GetString2LE(length);else if(c_oSer_TableStyle.Pivot===type)oNewStyle.pivot=this.stream.GetBool();else if(c_oSer_TableStyle.Table===type)oNewStyle.table=this.stream.GetBool();else if(c_oSer_TableStyle.Elements===type)res=this.bcr.Read1(length, function(t,l){return oThis.ReadTableCustomStyleElements(t,l,aElements)});else if(c_oSer_TableStyle.DisplayName===type)oNewStyle.displayName=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadTableCustomStyleElements=function(type,length,aElements){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_TableStyle.Element===type){var oNewStyleElement={Type:null,Size:null,DxfId:null};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadTableCustomStyleElement(t, l,oNewStyleElement)});if(null!=oNewStyleElement.Type&&null!=oNewStyleElement.DxfId)aElements.push(oNewStyleElement)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadTableCustomStyleElement=function(type,length,oNewStyleElement){var res=c_oSerConstants.ReadOk;if(c_oSer_TableStyleElement.Type===type)oNewStyleElement.Type=this.stream.GetUChar();else if(c_oSer_TableStyleElement.Size===type)oNewStyleElement.Size=this.stream.GetULongLE();else if(c_oSer_TableStyleElement.DxfId===type)oNewStyleElement.DxfId= this.stream.GetULongLE();else res=c_oSerConstants.ReadUnknown;return res}}function Binary_WorkbookTableReader(stream,oReadResult,oWorkbook,bwtr){this.stream=stream;this.oReadResult=oReadResult;this.oWorkbook=oWorkbook;this.bcr=new Binary_CommonReader(this.stream);this.bwtr=bwtr;this.Read=function(){var oThis=this;return this.bcr.ReadTable(function(t,l){return oThis.ReadWorkbookContent(t,l)})};this.ReadWorkbookContent=function(type,length){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorkbookTypes.WorkbookPr=== type){if(null==this.oWorkbook.WorkbookPr)this.oWorkbook.WorkbookPr={};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadWorkbookPr(t,l,oThis.oWorkbook.WorkbookPr)})}else if(c_oSerWorkbookTypes.BookViews===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadBookViews(t,l)});else if(c_oSerWorkbookTypes.DefinedNames===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadDefinedNames(t,l)});else if(c_oSerWorkbookTypes.CalcPr===type)res=this.bcr.Read1(length,function(t, l){return oThis.ReadCalcPr(t,l,oThis.oWorkbook.calcPr)});else if(c_oSerWorkbookTypes.ExternalReferences===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalReferences(t,l)});else if(c_oSerWorkbookTypes.JsaProject==type)this.oReadResult.macros=AscCommon.GetStringUtf8(this.stream,length);else if(c_oSerWorkbookTypes.Comments==type)res=this.bcr.Read1(length,function(t,l){return oThis.bwtr.ReadCommentDatas(t,l,oThis.oWorkbook.aComments)});else if(c_oSerWorkbookTypes.Connections==type)this.oWorkbook.connections= this.stream.GetBuffer(length);else if(c_oSerWorkbookTypes.PivotCaches==type&&typeof Asc.CT_PivotCacheDefinition!="undefined")res=this.bcr.Read1(length,function(t,l){return oThis.ReadPivotCaches(t,l)});else if((c_oSerWorkbookTypes.SlicerCaches==type||c_oSerWorkbookTypes.SlicerCachesExt==type)&&typeof Asc.CT_slicerCacheDefinition!="undefined")res=this.bcr.Read1(length,function(t,l){return oThis.ReadSlicerCaches(t,l)});else res=c_oSerConstants.ReadUnknown;return res};this.ReadSlicerCaches=function(type, length){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorkbookTypes.SlicerCache==type){var slicerCacheDefinition=new Asc.CT_slicerCacheDefinition;var fileStream=this.stream.ToFileStream();fileStream.GetUChar();slicerCacheDefinition.fromStream(fileStream,oThis.bwtr.copyPasteObj&&oThis.bwtr.copyPasteObj.isCopyPaste);this.stream.FromFileStream(fileStream);this.oReadResult.slicerCaches[slicerCacheDefinition.name]=slicerCacheDefinition}else res=c_oSerConstants.ReadUnknown;return res};this.ReadPivotCaches= function(type,length){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorkbookTypes.PivotCache==type){var pivotCache=new Asc.CT_PivotCacheDefinition;res=this.bcr.Read1(length,function(t,l){return oThis.ReadPivotCache(t,l,pivotCache)});this.oReadResult.pivotCacheDefinitions[pivotCache.id]=pivotCache}else res=c_oSerConstants.ReadUnknown;return res};this.ReadPivotCache=function(type,length,pivotCache){var res=c_oSerConstants.ReadOk;if(c_oSer_PivotTypes.id==type)pivotCache.id=this.stream.GetLong(); else if(c_oSer_PivotTypes.cache==type)(new openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(this.stream,length),pivotCache);else if(c_oSer_PivotTypes.record==type){var cacheRecords=new Asc.CT_PivotCacheRecords;(new openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(this.stream,length),cacheRecords);pivotCache.cacheRecords=cacheRecords}else res=c_oSerConstants.ReadUnknown;return res};this.ReadWorkbookPr=function(type,length,WorkbookPr){var res=c_oSerConstants.ReadOk;if(c_oSerWorkbookPrTypes.Date1904== type)WorkbookPr.Date1904=this.stream.GetBool();else if(c_oSerWorkbookPrTypes.DateCompatibility==type)WorkbookPr.DateCompatibility=this.stream.GetBool();else if(c_oSerWorkbookPrTypes.HidePivotFieldList==type)WorkbookPr.HidePivotFieldList=this.stream.GetBool();else if(c_oSerWorkbookPrTypes.ShowPivotChartFilter==type)WorkbookPr.ShowPivotChartFilter=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadBookViews=function(type,length){var res=c_oSerConstants.ReadOk;var oThis= this;if(c_oSerWorkbookTypes.WorkbookView==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadWorkbookView(t,l)});else res=c_oSerConstants.ReadUnknown;return res};this.ReadWorkbookView=function(type,length){var res=c_oSerConstants.ReadOk;if(c_oSerWorkbookViewTypes.ActiveTab==type)this.oWorkbook.nActive=this.stream.GetULongLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadDefinedNames=function(type,length){var res=c_oSerConstants.ReadOk,LocalSheetId;var oThis=this; if(c_oSerWorkbookTypes.DefinedName==type){var oNewDefinedName=new Asc.asc_CDefName;res=this.bcr.Read1(length,function(t,l){return oThis.ReadDefinedName(t,l,oNewDefinedName)});this.oReadResult.defNames.push(oNewDefinedName)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadDefinedName=function(type,length,oDefinedName){var res=c_oSerConstants.ReadOk;if(c_oSerDefinedNameTypes.Name==type)oDefinedName.Name=this.stream.GetString2LE(length);else if(c_oSerDefinedNameTypes.Ref==type)oDefinedName.Ref= this.stream.GetString2LE(length);else if(c_oSerDefinedNameTypes.LocalSheetId==type)oDefinedName.LocalSheetId=this.stream.GetULongLE();else if(c_oSerDefinedNameTypes.Hidden==type)oDefinedName.Hidden=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadCalcPr=function(type,length,oCalcPr){var res=c_oSerConstants.ReadOk;if(c_oSerCalcPrTypes.CalcId==type)oCalcPr.calcId=this.stream.GetULongLE();else if(c_oSerCalcPrTypes.CalcMode==type)oCalcPr.calcMode=this.stream.GetUChar(); else if(c_oSerCalcPrTypes.FullCalcOnLoad==type)oCalcPr.fullCalcOnLoad=this.stream.GetBool();else if(c_oSerCalcPrTypes.RefMode==type)oCalcPr.refMode=this.stream.GetUChar();else if(c_oSerCalcPrTypes.Iterate==type)oCalcPr.iterate=this.stream.GetBool();else if(c_oSerCalcPrTypes.IterateCount==type)oCalcPr.iterateCount=this.stream.GetULongLE();else if(c_oSerCalcPrTypes.IterateDelta==type)oCalcPr.iterateDelta=this.stream.GetDoubleLE();else if(c_oSerCalcPrTypes.FullPrecision==type)oCalcPr.fullPrecision=this.stream.GetBool(); else if(c_oSerCalcPrTypes.CalcCompleted==type)oCalcPr.calcCompleted=this.stream.GetBool();else if(c_oSerCalcPrTypes.CalcOnSave==type)oCalcPr.calcOnSave=this.stream.GetBool();else if(c_oSerCalcPrTypes.ConcurrentCalc==type)oCalcPr.concurrentCalc=this.stream.GetBool();else if(c_oSerCalcPrTypes.ConcurrentManualCount==type)oCalcPr.concurrentManualCount=this.stream.GetULongLE();else if(c_oSerCalcPrTypes.ForceFullCalc==type)oCalcPr.forceFullCalc=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown; return res};this.ReadExternalReferences=function(type,length){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorkbookTypes.ExternalBook==type){var externalBook={Type:0,Id:null,SheetNames:[],DefinedNames:[],SheetDataSet:[]};res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalBook(t,l,externalBook)});this.oWorkbook.externalReferences.push(externalBook)}else if(c_oSerWorkbookTypes.OleLink==type)this.oWorkbook.externalReferences.push({Type:1,Buffer:this.stream.GetBuffer(length)}); else if(c_oSerWorkbookTypes.DdeLink==type)this.oWorkbook.externalReferences.push({Type:2,Buffer:this.stream.GetBuffer(length)});else res=c_oSerConstants.ReadUnknown;return res};this.ReadExternalBook=function(type,length,externalBook){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_ExternalLinkTypes.Id==type)externalBook.Id=this.stream.GetString2LE(length);else if(c_oSer_ExternalLinkTypes.SheetNames==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalSheetNames(t,l,externalBook.SheetNames)}); else if(c_oSer_ExternalLinkTypes.DefinedNames==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalDefinedNames(t,l,externalBook.DefinedNames)});else if(c_oSer_ExternalLinkTypes.SheetDataSet==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalSheetDataSet(t,l,externalBook.SheetDataSet)});else res=c_oSerConstants.ReadUnknown;return res};this.ReadExternalSheetNames=function(type,length,sheetNames){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_ExternalLinkTypes.SheetName== type)sheetNames.push(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};this.ReadExternalDefinedNames=function(type,length,definedNames){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_ExternalLinkTypes.DefinedName==type){var definedName={Name:null,RefersTo:null,SheetId:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalDefinedName(t,l,definedName)});definedNames.push(definedName)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadExternalDefinedName= function(type,length,definedName){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_ExternalLinkTypes.DefinedNameName==type)definedName.Name=this.stream.GetString2LE(length);else if(c_oSer_ExternalLinkTypes.DefinedNameRefersTo==type)definedName.RefersTo=this.stream.GetString2LE(length);else if(c_oSer_ExternalLinkTypes.DefinedNameSheetId==type)definedName.SheetId=this.stream.GetULongLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadExternalSheetDataSet=function(type,length,sheetDataSet){var res= c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_ExternalLinkTypes.SheetData==type){var sheetData={SheetId:null,RefreshError:null,Row:[]};res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalSheetData(t,l,sheetData)});sheetDataSet.push(sheetData)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadExternalSheetData=function(type,length,sheetData){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_ExternalLinkTypes.SheetDataSheetId==type)sheetData.SheetId=this.stream.GetULongLE(); else if(c_oSer_ExternalLinkTypes.SheetDataRefreshError==type)sheetData.RefreshError=this.stream.GetBool();else if(c_oSer_ExternalLinkTypes.SheetDataRow==type){var row={R:null,Cell:[]};res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalRow(t,l,row)});sheetData.Row.push(row)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadExternalRow=function(type,length,row){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_ExternalLinkTypes.SheetDataRowR==type)row.R=this.stream.GetULongLE(); else if(c_oSer_ExternalLinkTypes.SheetDataRowCell==type){var cell={Ref:null,CellType:null,CellValue:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadExternalCell(t,l,cell)});row.Cell.push(cell)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadExternalCell=function(type,length,cell){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_ExternalLinkTypes.SheetDataRowCellRef==type)cell.Ref=this.stream.GetString2LE(length);else if(c_oSer_ExternalLinkTypes.SheetDataRowCellType== type)cell.CellType=this.stream.GetUChar();else if(c_oSer_ExternalLinkTypes.SheetDataRowCellValue==type)cell.CellValue=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res}}function Binary_WorksheetTableReader(stream,oReadResult,wb,aSharedStrings,aCellXfs,Dxfs,oMediaArray,personList,copyPasteObj){this.stream=stream;this.wb=wb;this.aSharedStrings=aSharedStrings;this.oMediaArray=oMediaArray;this.aCellXfs=aCellXfs;this.Dxfs=Dxfs;this.bcr=new Binary_CommonReader(this.stream); this.aMerged=[];this.aHyperlinks=[];this.personList=personList;this.copyPasteObj=copyPasteObj;this.curWorksheet=null;this.oReadResult=oReadResult;this.Read=function(){var oThis=this;return this.bcr.ReadTable(function(t,l){return oThis.ReadWorksheetsContent(t,l)})};this.ReadSheetDataExternal=function(bNoBuildDep){var oThis=this;var res=c_oSerConstants.ReadOk;var oldPos=this.stream.GetCurPos();for(var i=0;i<this.oReadResult.sheetData.length;++i){var sheetDataElem=this.oReadResult.sheetData[i];var ws= sheetDataElem.ws;this.stream.Seek2(sheetDataElem.pos);var tmp={pos:null,len:null,bNoBuildDep:bNoBuildDep,ws:ws,row:new AscCommonExcel.Row(ws),cell:new AscCommonExcel.Cell(ws),formula:new OpenFormula,sharedFormulas:{},prevFormulas:{},siFormulas:{},prevRow:-1,prevCol:-1,formulaArray:[]};res=this.bcr.Read1(sheetDataElem.len,function(t,l){return oThis.ReadSheetData(t,l,tmp)});if(!bNoBuildDep){for(var j=0;j<tmp.formulaArray.length;j++){var curFormula=tmp.formulaArray[j];var ref=curFormula.ref;if(ref){var rangeFormulaArray= tmp.ws.getRange3(ref.r1,ref.c1,ref.r2,ref.c2);rangeFormulaArray._foreach(function(cell){cell.setFormulaInternal(curFormula);if(curFormula.ca||cell.isNullTextString())tmp.ws.workbook.dependencyFormulas.addToChangedCell(cell)})}}for(var nCol in tmp.prevFormulas)if(tmp.prevFormulas.hasOwnProperty(nCol)){var prevFormula=tmp.prevFormulas[nCol];if(!tmp.siFormulas[prevFormula.parsed.getListenerId()])prevFormula.parsed.buildDependencies()}for(var listenerId in tmp.siFormulas)if(tmp.siFormulas.hasOwnProperty(listenerId))tmp.siFormulas[listenerId].buildDependencies()}if(c_oSerConstants.ReadOk!== res)break}this.stream.Seek2(oldPos);return res};this.ReadWorksheetsContent=function(type,length){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorksheetsTypes.Worksheet===type){this.aMerged=[];this.aHyperlinks=[];var oNewWorksheet=new AscCommonExcel.Worksheet(this.wb,wb.aWorksheets.length);oNewWorksheet.aFormulaExt=[];var DrawingDocument=oNewWorksheet.getDrawingDocument();if(typeof editor!="undefined"&&editor&&editor.WordControl&&editor.WordControl.m_oLogicDocument&&editor.WordControl.m_oLogicDocument.DrawingDocument)this.wb.DrawingDocument= editor.WordControl.m_oLogicDocument.DrawingDocument;this.curWorksheet=oNewWorksheet;res=this.bcr.Read1(length,function(t,l){return oThis.ReadWorksheet(t,l,oNewWorksheet)});this.curWorksheet=null;oNewWorksheet.mergeManager.initData=this.aMerged.slice();var i;for(i=0,length=this.aHyperlinks.length;i<length;++i){var hyperlink=this.aHyperlinks[i];if(null!==hyperlink.Ref)hyperlink.Ref.setHyperlinkOpen(hyperlink)}this.wb.aWorksheets.push(oNewWorksheet);this.wb.aWorksheetsById[oNewWorksheet.getId()]=oNewWorksheet; this.wb.DrawingDocument=DrawingDocument}else res=c_oSerConstants.ReadUnknown;return res};this.ReadWorksheet=function(type,length,oWorksheet){var res=c_oSerConstants.ReadOk;var oThis=this;var oBinary_TableReader,oConditionalFormatting;if(c_oSerWorksheetsTypes.WorksheetProp==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadWorksheetProp(t,l,oWorksheet)});else if(c_oSerWorksheetsTypes.Cols==type){var aTempCols=[];res=this.bcr.Read1(length,function(t,l){return oThis.ReadWorksheetCols(t, l,aTempCols,oWorksheet,oThis.aCellXfs)});var oAllCol=null;if(aTempCols.length>0){var oLast=aTempCols[aTempCols.length-1];if(AscCommon.gc_nMaxCol==oLast.Max){oAllCol=oWorksheet.getAllCol();oLast.col.cloneTo(oAllCol)}}for(var i=0;i<aTempCols.length;++i){var elem=aTempCols[i];if(elem.Max>=oWorksheet.nColsCount)oWorksheet.nColsCount=elem.Max;if(null!=oAllCol&&oAllCol.isEqual(elem.col))continue;for(var j=elem.Min;j<=elem.Max;j++){var oNewCol=new AscCommonExcel.Col(oWorksheet,j-1);elem.col.cloneTo(oNewCol); oWorksheet.aCols[oNewCol.index]=oNewCol}}}else if(c_oSerWorksheetsTypes.SheetFormatPr==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadSheetFormatPr(t,l,oWorksheet)});else if(c_oSerWorksheetsTypes.PageMargins==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadPageMargins(t,l,oWorksheet.PagePrintOptions.pageMargins)});else if(c_oSerWorksheetsTypes.PageSetup==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadPageSetup(t,l,oWorksheet.PagePrintOptions.pageSetup)}); else if(c_oSerWorksheetsTypes.PrintOptions==type)res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadPrintOptions(t,l,oWorksheet.PagePrintOptions)});else if(c_oSerWorksheetsTypes.Hyperlinks==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadHyperlinks(t,l,oWorksheet)});else if(c_oSerWorksheetsTypes.MergeCells==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadMergeCells(t,l,oWorksheet)});else if(c_oSerWorksheetsTypes.SheetData==type){this.oReadResult.sheetData.push({ws:oWorksheet, pos:this.stream.GetCurPos(),len:length});res=c_oSerConstants.ReadUnknown}else if(c_oSerWorksheetsTypes.Drawings==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadDrawings(t,l,oWorksheet.Drawings,oWorksheet)});else if(c_oSerWorksheetsTypes.Autofilter==type){oBinary_TableReader=new Binary_TableReader(this.stream,this.oReadResult,oWorksheet,this.Dxfs);oWorksheet.AutoFilter=new AscCommonExcel.AutoFilter;res=this.bcr.Read1(length,function(t,l){return oBinary_TableReader.ReadAutoFilter(t,l, oWorksheet.AutoFilter)})}else if(c_oSerWorksheetsTypes.SortState===type){oBinary_TableReader=new Binary_TableReader(this.stream,this.oReadResult,oWorksheet,this.Dxfs);oWorksheet.sortState=new AscCommonExcel.SortState;res=this.bcr.Read1(length,function(t,l){return oBinary_TableReader.ReadSortState(t,l,oWorksheet.sortState)})}else if(c_oSerWorksheetsTypes.TableParts==type){oBinary_TableReader=new Binary_TableReader(this.stream,this.oReadResult,oWorksheet,this.Dxfs);oBinary_TableReader.Read(length,oWorksheet.TableParts)}else if(c_oSerWorksheetsTypes.Comments== type&&!(typeof editor!=="undefined"&&editor.WordControl&&editor.WordControl.m_oLogicDocument&&Array.isArray(editor.WordControl.m_oLogicDocument.Slides)))res=this.bcr.Read1(length,function(t,l){return oThis.ReadComments(t,l,oWorksheet)});else if(c_oSerWorksheetsTypes.ConditionalFormatting===type&&typeof AscCommonExcel.CConditionalFormatting!="undefined"){oConditionalFormatting=new AscCommonExcel.CConditionalFormatting;res=this.bcr.Read1(length,function(t,l){return oThis.ReadConditionalFormatting(t, l,oConditionalFormatting)});if(oConditionalFormatting.isValid()){oConditionalFormatting.initRules();oWorksheet.aConditionalFormattingRules=oWorksheet.aConditionalFormattingRules.concat(oConditionalFormatting.aRules)}}else if(c_oSerWorksheetsTypes.SheetViews===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadSheetViews(t,l,oWorksheet.sheetViews)});else if(c_oSerWorksheetsTypes.SheetPr===type){oWorksheet.sheetPr=new AscCommonExcel.asc_CSheetPr;res=this.bcr.Read1(length,function(t,l){return oThis.ReadSheetPr(t, l,oWorksheet.sheetPr)})}else if(c_oSerWorksheetsTypes.SparklineGroups===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadSparklineGroups(t,l,oWorksheet)});else if(c_oSerWorksheetsTypes.HeaderFooter===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadHeaderFooter(t,l,oWorksheet.headerFooter)});else if(c_oSerWorksheetsTypes.DataValidations===type&&typeof AscCommonExcel.CDataValidations!="undefined"){oWorksheet.dataValidations=new AscCommonExcel.CDataValidations;res=this.bcr.Read1(length, function(t,l){return oThis.ReadDataValidations(t,l,oWorksheet.dataValidations)})}else if(c_oSerWorksheetsTypes.PivotTable===type&&typeof Asc.CT_pivotTableDefinition!="undefined"){var data={table:null,cacheId:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadPivotCopyPaste(t,l,data)});var cacheDefinition=this.oReadResult.pivotCacheDefinitions[data.cacheId];if(data.table&&cacheDefinition){data.table.cacheDefinition=cacheDefinition;oWorksheet.insertPivotTable(data.table)}}else if(c_oSerWorksheetsTypes.Slicers=== type||c_oSerWorksheetsTypes.SlicersExt===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadSlicers(t,l,oWorksheet)});else if(c_oSerWorksheetsTypes.NamedSheetView===type){var fileStream=this.stream.ToFileStream();fileStream.GetUChar();var namedSheetViews=new Asc.CT_NamedSheetViews;namedSheetViews.fromStream(fileStream,this.wb);oWorksheet.aNamedSheetViews=namedSheetViews.namedSheetView;this.stream.FromFileStream(fileStream)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadPivotCopyPaste= function(type,length,data){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_PivotTypes.cacheId==type)data.cacheId=this.stream.GetLong();else if(c_oSer_PivotTypes.table==type){data.table=new Asc.CT_pivotTableDefinition(true);(new openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(this.stream,length),data.table)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadSlicers=function(type,length,oWorksheet){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorksheetsTypes.Slicer===type){if(typeof Asc.CT_slicers== "undefined"){if(this.copyPasteObj.isCopyPaste)oWorksheet.aSlicers.push(null);return c_oSerConstants.ReadUnknown}var slicers=new Asc.CT_slicers;slicers.slicer=oWorksheet.aSlicers;var fileStream=this.stream.ToFileStream();fileStream.GetUChar();slicers.fromStream(fileStream,oWorksheet,oThis.oReadResult.slicerCaches);this.stream.FromFileStream(fileStream)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadDataValidations=function(type,length,dataValidations){var res=c_oSerConstants.ReadOk;var oThis= this;if(c_oSer_DataValidation.DataValidations==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadDataValidationsContent(t,l,dataValidations)});else if(c_oSer_DataValidation.DisablePrompts==type)dataValidations.disablePrompts=this.stream.GetBool();else if(c_oSer_DataValidation.XWindow==type)dataValidations.xWindow=this.stream.GetLong();else if(c_oSer_DataValidation.YWindow==type)dataValidations.yWindow=this.stream.GetLong();else res=c_oSerConstants.ReadUnknown;return res};this.ReadDataValidationsContent= function(type,length,dataValidations){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_DataValidation.DataValidation==type){var dataValidation=new AscCommonExcel.CDataValidation;res=this.bcr.Read2(length,function(t,l){return oThis.ReadDataValidation(t,l,dataValidation)});dataValidations.elems.push(dataValidation)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadDataValidation=function(type,length,dataValidation){var res=c_oSerConstants.ReadOk;if(c_oSer_DataValidation.AllowBlank==type)dataValidation.allowBlank= this.stream.GetBool();else if(c_oSer_DataValidation.Type==type)dataValidation.type=this.stream.GetUChar();else if(c_oSer_DataValidation.Error==type)dataValidation.error=this.stream.GetString2LE(length);else if(c_oSer_DataValidation.ErrorTitle==type)dataValidation.errorTitle=this.stream.GetString2LE(length);else if(c_oSer_DataValidation.ErrorStyle==type)dataValidation.errorStyle=this.stream.GetUChar();else if(c_oSer_DataValidation.ImeMode==type)dataValidation.imeMode=this.stream.GetUChar();else if(c_oSer_DataValidation.Operator== type)dataValidation.operator=this.stream.GetUChar();else if(c_oSer_DataValidation.Prompt==type)dataValidation.prompt=this.stream.GetString2LE(length);else if(c_oSer_DataValidation.PromptTitle==type)dataValidation.promptTitle=this.stream.GetString2LE(length);else if(c_oSer_DataValidation.ShowDropDown==type)dataValidation.showDropDown=this.stream.GetBool();else if(c_oSer_DataValidation.ShowErrorMessage==type)dataValidation.showErrorMessage=this.stream.GetBool();else if(c_oSer_DataValidation.ShowInputMessage== type)dataValidation.showInputMessage=this.stream.GetBool();else if(c_oSer_DataValidation.SqRef==type)dataValidation.setSqRef(this.stream.GetString2LE(length));else if(c_oSer_DataValidation.Formula1==type)dataValidation.formula1=new Asc.CDataFormula(this.stream.GetString2LE(length));else if(c_oSer_DataValidation.Formula2==type)dataValidation.formula2=new Asc.CDataFormula(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};this.ReadWorksheetProp=function(type,length,oWorksheet){var res= c_oSerConstants.ReadOk;if(c_oSerWorksheetPropTypes.Name==type){oWorksheet.sName=this.stream.GetString2LE(length);AscFonts.FontPickerByCharacter.getFontsByString(oWorksheet.sName)}else if(c_oSerWorksheetPropTypes.SheetId==type)this.oReadResult.sheetIds[this.stream.GetULongLE()]=oWorksheet;else if(c_oSerWorksheetPropTypes.State==type)switch(this.stream.GetUChar()){case EVisibleType.visibleHidden:oWorksheet.bHidden=true;break;case EVisibleType.visibleVeryHidden:oWorksheet.bHidden=true;break;case EVisibleType.visibleVisible:oWorksheet.bHidden= false;break}else if(this.copyPasteObj.isCopyPaste&&c_oSerWorksheetPropTypes.Ref==type)this.copyPasteObj.activeRange=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadWorksheetCols=function(type,length,aTempCols,oWorksheet,aCellXfs){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorksheetsTypes.Col==type){var oTempCol={Max:null,Min:null,col:new AscCommonExcel.Col(oWorksheet,0)};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadWorksheetCol(t, l,oTempCol,aCellXfs)});oTempCol.col.fixOnOpening();aTempCols.push(oTempCol)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadWorksheetCol=function(type,length,oTempCol,aCellXfs){var res=c_oSerConstants.ReadOk;if(c_oSerWorksheetColTypes.BestFit==type)oTempCol.col.BestFit=this.stream.GetBool();else if(c_oSerWorksheetColTypes.Hidden==type)oTempCol.col.setHidden(this.stream.GetBool());else if(c_oSerWorksheetColTypes.Max==type)oTempCol.Max=this.stream.GetULongLE();else if(c_oSerWorksheetColTypes.Min== type)oTempCol.Min=this.stream.GetULongLE();else if(c_oSerWorksheetColTypes.Style==type){var xfs=aCellXfs[this.stream.GetULongLE()];if(xfs)oTempCol.col.setStyle(xfs)}else if(c_oSerWorksheetColTypes.Width==type)oTempCol.col.width=this.stream.GetDoubleLE();else if(c_oSerWorksheetColTypes.CustomWidth==type)oTempCol.col.CustomWidth=this.stream.GetBool();else if(c_oSerWorksheetColTypes.OutLevel==type)oTempCol.col.outlineLevel=this.stream.GetULongLE();else if(c_oSerWorksheetColTypes.Collapsed==type)oTempCol.col.collapsed= this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadSheetFormatPr=function(type,length,oWorksheet){var res=c_oSerConstants.ReadOk;if(c_oSerSheetFormatPrTypes.DefaultColWidth==type)oWorksheet.oSheetFormatPr.dDefaultColWidth=this.stream.GetDoubleLE();else if(c_oSerSheetFormatPrTypes.BaseColWidth===type)oWorksheet.oSheetFormatPr.nBaseColWidth=this.stream.GetULongLE();else if(c_oSerSheetFormatPrTypes.DefaultRowHeight==type){var oAllRow=oWorksheet.getAllRow();oAllRow.setHeight(this.stream.GetDoubleLE())}else if(c_oSerSheetFormatPrTypes.CustomHeight== type){var oAllRow=oWorksheet.getAllRow();var CustomHeight=this.stream.GetBool();if(CustomHeight)oAllRow.setCustomHeight(true)}else if(c_oSerSheetFormatPrTypes.ZeroHeight==type){var oAllRow=oWorksheet.getAllRow();var hd=this.stream.GetBool();if(hd)oAllRow.setHidden(true)}else if(c_oSerSheetFormatPrTypes.OutlineLevelCol==type)oWorksheet.oSheetFormatPr.nOutlineLevelCol=this.stream.GetULongLE();else if(c_oSerSheetFormatPrTypes.OutlineLevelRow==type){var oAllRow=oWorksheet.getAllRow();oAllRow.setOutlineLevel(this.stream.GetULongLE())}else res= c_oSerConstants.ReadUnknown;return res};this.ReadPageMargins=function(type,length,oPageMargins){var res=c_oSerConstants.ReadOk;if(c_oSer_PageMargins.Left==type)oPageMargins.asc_setLeft(this.stream.GetDoubleLE());else if(c_oSer_PageMargins.Top==type)oPageMargins.asc_setTop(this.stream.GetDoubleLE());else if(c_oSer_PageMargins.Right==type)oPageMargins.asc_setRight(this.stream.GetDoubleLE());else if(c_oSer_PageMargins.Bottom==type)oPageMargins.asc_setBottom(this.stream.GetDoubleLE());else if(c_oSer_PageMargins.Header== type)oPageMargins.asc_setHeader(this.stream.GetDoubleLE());else if(c_oSer_PageMargins.Footer==type)oPageMargins.asc_setFooter(this.stream.GetDoubleLE());else res=c_oSerConstants.ReadUnknown;return res};this.ReadPageSetup=function(type,length,oPageSetup){var res=c_oSerConstants.ReadOk;if(c_oSer_PageSetup.BlackAndWhite===type)oPageSetup.blackAndWhite=this.stream.GetBool();else if(c_oSer_PageSetup.CellComments==type)oPageSetup.cellComments=this.stream.GetUChar();else if(c_oSer_PageSetup.Copies==type)oPageSetup.copies= this.stream.GetULongLE();else if(c_oSer_PageSetup.Draft==type)oPageSetup.draft=this.stream.GetBool();else if(c_oSer_PageSetup.Errors==type)oPageSetup.errors=this.stream.GetUChar();else if(c_oSer_PageSetup.FirstPageNumber==type)oPageSetup.firstPageNumber=this.stream.GetULongLE();else if(c_oSer_PageSetup.FitToHeight==type)oPageSetup.fitToHeight=this.stream.GetULongLE();else if(c_oSer_PageSetup.FitToWidth==type)oPageSetup.fitToWidth=this.stream.GetULongLE();else if(c_oSer_PageSetup.HorizontalDpi==type)oPageSetup.horizontalDpi= this.stream.GetULongLE();else if(c_oSer_PageSetup.Orientation==type){var byteFormatOrientation=this.stream.GetUChar();var byteOrientation=null;switch(byteFormatOrientation){case EPageOrientation.pageorientPortrait:byteOrientation=c_oAscPageOrientation.PagePortrait;break;case EPageOrientation.pageorientLandscape:byteOrientation=c_oAscPageOrientation.PageLandscape;break}if(null!=byteOrientation)oPageSetup.asc_setOrientation(byteOrientation)}else if(c_oSer_PageSetup.PageOrder==type)oPageSetup.pageOrder= this.stream.GetUChar();else if(c_oSer_PageSetup.PaperSize==type){var bytePaperSize=this.stream.GetUChar();var item=DocumentPageSize.getSizeById(bytePaperSize);oPageSetup.asc_setWidth(item.w_mm);oPageSetup.asc_setHeight(item.h_mm)}else if(c_oSer_PageSetup.Scale==type)oPageSetup.scale=this.stream.GetULongLE();else if(c_oSer_PageSetup.UseFirstPageNumber==type)oPageSetup.useFirstPageNumber=this.stream.GetBool();else if(c_oSer_PageSetup.UsePrinterDefaults==type)oPageSetup.usePrinterDefaults=this.stream.GetBool(); else if(c_oSer_PageSetup.VerticalDpi==type)oPageSetup.verticalDpi=this.stream.GetULongLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadPrintOptions=function(type,length,oPrintOptions){var res=c_oSerConstants.ReadOk;if(c_oSer_PrintOptions.GridLines==type)oPrintOptions.asc_setGridLines(this.stream.GetBool());else if(c_oSer_PrintOptions.Headings==type)oPrintOptions.asc_setHeadings(this.stream.GetBool());else res=c_oSerConstants.ReadUnknown;return res};this.ReadHyperlinks=function(type, length,ws){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorksheetsTypes.Hyperlink==type){var oNewHyperlink=new AscCommonExcel.Hyperlink;res=this.bcr.Read1(length,function(t,l){return oThis.ReadHyperlink(t,l,ws,oNewHyperlink)});this.aHyperlinks.push(oNewHyperlink)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadHyperlink=function(type,length,ws,oHyperlink){var res=c_oSerConstants.ReadOk;if(c_oSerHyperlinkTypes.Ref==type)oHyperlink.Ref=ws.getRange2(this.stream.GetString2LE(length)); else if(c_oSerHyperlinkTypes.Hyperlink==type)oHyperlink.Hyperlink=this.stream.GetString2LE(length);else if(c_oSerHyperlinkTypes.Location==type)oHyperlink.setLocation(this.stream.GetString2LE(length));else if(c_oSerHyperlinkTypes.Tooltip==type)oHyperlink.Tooltip=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadMergeCells=function(type,length){var res=c_oSerConstants.ReadOk;if(c_oSerWorksheetsTypes.MergeCell==type)this.aMerged.push(this.stream.GetString2LE(length)); else res=c_oSerConstants.ReadUnknown;return res};this.ReadSheetData=function(type,length,tmp){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorksheetsTypes.XlsbPos===type){var oldPos=this.stream.GetCurPos();this.stream.Seek2(this.stream.GetULongLE());tmp.ws.fromXLSB(this.stream,this.stream.XlsbReadRecordType(),tmp,this.aCellXfs,this.aSharedStrings,function(tmp){oThis.initCellAfterRead(tmp)});this.stream.Seek2(oldPos);res=c_oSerConstants.ReadUnknown}else if(c_oSerWorksheetsTypes.Row===type){tmp.pos= null;tmp.len=null;tmp.row.clear();res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadRow(t,l,tmp)});if(null===tmp.row.index)tmp.row.index=tmp.prevRow+1;tmp.row.saveContent();tmp.ws.cellsByColRowsCount=Math.max(tmp.ws.cellsByColRowsCount,tmp.row.index+1);tmp.ws.nRowsCount=Math.max(tmp.ws.nRowsCount,tmp.ws.cellsByColRowsCount);tmp.prevRow=tmp.row.index;tmp.prevCol=-1;if(null!==tmp.pos&&null!==tmp.len){var nOldPos=this.stream.GetCurPos();this.stream.Seek2(tmp.pos);res=this.bcr.Read1(tmp.len, function(t,l){return oThis.ReadCells(t,l,tmp)});this.stream.Seek2(nOldPos)}}else res=c_oSerConstants.ReadUnknown;return res};this.ReadRow=function(type,length,tmp){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerRowTypes.Row==type){var index=this.stream.GetULongLE()-1;tmp.row.setIndex(index)}else if(c_oSerRowTypes.Style==type){var xfs=this.aCellXfs[this.stream.GetULongLE()];if(xfs)tmp.row.setStyle(xfs)}else if(c_oSerRowTypes.Height==type){var h=this.stream.GetDoubleLE();tmp.row.setHeight(h); if(AscCommon.CurFileVersion<2)tmp.row.setCustomHeight(true)}else if(c_oSerRowTypes.CustomHeight==type){var CustomHeight=this.stream.GetBool();if(CustomHeight)tmp.row.setCustomHeight(true)}else if(c_oSerRowTypes.Hidden==type){var hd=this.stream.GetBool();if(hd)tmp.row.setHidden(true)}else if(c_oSerRowTypes.OutLevel==type)tmp.row.setOutlineLevel(this.stream.GetULongLE());else if(c_oSerRowTypes.Collapsed==type)tmp.row.setCollapsed(this.stream.GetBool());else if(c_oSerRowTypes.Cells==type){tmp.pos=this.stream.GetCurPos(); tmp.len=length;res=c_oSerConstants.ReadUnknown}else res=c_oSerConstants.ReadUnknown;return res};this.ReadCells=function(type,length,tmp){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerRowTypes.Cell===type){tmp.cell.clear();tmp.formula.clean();res=this.bcr.Read1(length,function(t,l){return oThis.ReadCell(t,l,tmp,tmp.cell,tmp.prevRow)});if(tmp.cell.isNullTextString())tmp.cell.setTypeInternal(CellValueType.Number);if(tmp.cell.hasRowCol())tmp.prevCol=tmp.cell.nCol;else{tmp.prevCol++;tmp.cell.setRowCol(tmp.prevRow, tmp.prevCol)}this.initCellAfterRead(tmp)}else res=c_oSerConstants.ReadUnknown;return res};this.initCellAfterRead=function(tmp){if(!(this.copyPasteObj&&this.copyPasteObj.isCopyPaste&&typeof editor!="undefined"&&editor))this.setFormulaOpen(tmp);tmp.cell.saveContent();if(tmp.cell.nCol>=tmp.ws.nColsCount)tmp.ws.nColsCount=tmp.cell.nCol+1};this.setFormulaOpen=function(tmp){var cell=tmp.cell;var formula=tmp.formula;var curFormula;var prevFormula=tmp.prevFormulas[cell.nCol];if(null!==formula.si&&(curFormula= tmp.sharedFormulas[formula.si])){curFormula.parsed.getShared().ref.union3(cell.nCol,cell.nRow);if(prevFormula!==curFormula){if(prevFormula&&!tmp.bNoBuildDep&&!tmp.siFormulas[prevFormula.parsed.getListenerId()])prevFormula.parsed.buildDependencies();tmp.prevFormulas[cell.nCol]=curFormula}}else if(formula.v&&formula.v.length<=AscCommon.c_oAscMaxFormulaLength){if(formula.v.startsWith("_xludf."))formula.v=formula.v.replace("_xludf.","");var offsetRow;var shared;var sharedRef;if(prevFormula&&(shared=prevFormula.parsed.getShared()))offsetRow= cell.nRow-shared.ref.r1;else offsetRow=1;if(prevFormula&&formula.t!==ECellFormulaType.cellformulatypeArray&&prevFormula.t!==ECellFormulaType.cellformulatypeArray&&prevFormula.nRow+offsetRow===cell.nRow&&AscCommonExcel.compareFormula(prevFormula.formula,prevFormula.refPos,formula.v,offsetRow)){if(!(shared&&shared.ref)){sharedRef=new Asc.Range(cell.nCol,prevFormula.nRow,cell.nCol,cell.nRow);prevFormula.parsed.setShared(sharedRef,prevFormula.base)}else shared.ref.union3(cell.nCol,cell.nRow);curFormula= prevFormula}else{if(prevFormula&&!tmp.bNoBuildDep&&!tmp.siFormulas[prevFormula.parsed.getListenerId()])prevFormula.parsed.buildDependencies();var parseResult=new AscCommonExcel.ParseResult([]);var newFormulaParent=new AscCommonExcel.CCellWithFormula(cell.ws,cell.nRow,cell.nCol);var parsed=new AscCommonExcel.parserFormula(formula.v,newFormulaParent,cell.ws);parsed.ca=formula.ca;parsed.parse(undefined,undefined,parseResult);if(parseResult.error===Asc.c_oAscError.ID.FrmlMaxReference){tmp.ws.workbook.openErrors.push(cell.getName()); return}if(null!==formula.ref)if(formula.t===ECellFormulaType.cellformulatypeShared){sharedRef=AscCommonExcel.g_oRangeCache.getAscRange(formula.ref).clone();parsed.setShared(sharedRef,newFormulaParent)}else if(formula.t===ECellFormulaType.cellformulatypeArray)if(AscCommonExcel.bIsSupportArrayFormula){parsed.setArrayFormulaRef(AscCommonExcel.g_oRangeCache.getAscRange(formula.ref).clone());tmp.formulaArray.push(parsed)}curFormula=new OpenColumnFormula(cell.nRow,formula.v,parsed,parseResult.refPos,newFormulaParent); tmp.prevFormulas[cell.nCol]=curFormula}if(null!==formula.si&&curFormula.parsed.getShared()){tmp.sharedFormulas[formula.si]=curFormula;tmp.siFormulas[curFormula.parsed.getListenerId()]=curFormula.parsed}}else if(formula.v&&!(this.copyPasteObj&&this.copyPasteObj.isCopyPaste))tmp.ws.workbook.openErrors.push(cell.getName());if(curFormula){cell.setFormulaInternal(curFormula.parsed);if(curFormula.parsed.ca||cell.isNullTextString())tmp.ws.workbook.dependencyFormulas.addToChangedCell(cell)}};this.ReadCell= function(type,length,tmp,oCell,nRowIndex){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerCellTypes.Ref===type){var oCellAddress=AscCommon.g_oCellAddressUtils.getCellAddress(this.stream.GetString2LE(length));oCell.setRowCol(nRowIndex,oCellAddress.getCol0())}else if(c_oSerCellTypes.RefRowCol===type){var nRow=this.stream.GetULongLE();oCell.setRowCol(nRowIndex,this.stream.GetULongLE())}else if(c_oSerCellTypes.Style===type){var nStyleIndex=this.stream.GetULongLE();if(0!=nStyleIndex){var xfs=this.aCellXfs[nStyleIndex]; if(null!=xfs)oCell.setStyle(xfs)}}else if(c_oSerCellTypes.Type===type)switch(this.stream.GetUChar()){case ECellTypeType.celltypeBool:oCell.setTypeInternal(CellValueType.Bool);break;case ECellTypeType.celltypeError:oCell.setTypeInternal(CellValueType.Error);break;case ECellTypeType.celltypeNumber:oCell.setTypeInternal(CellValueType.Number);break;case ECellTypeType.celltypeSharedString:oCell.setTypeInternal(CellValueType.String);break}else if(c_oSerCellTypes.Formula===type)res=this.bcr.Read2Spreadsheet(length, function(t,l){return oThis.ReadFormula(t,l,tmp.formula)});else if(c_oSerCellTypes.Value===type){var val=this.stream.GetDoubleLE();if(CellValueType.String===oCell.getType()||CellValueType.Error===oCell.getType()){var ss=this.aSharedStrings[val];if(undefined!==ss)if(typeof ss==="string")oCell.setValueTextInternal(ss);else oCell.setValueMultiTextInternal(ss)}else oCell.setValueNumberInternal(val)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadFormula=function(type,length,oFormula){var res= c_oSerConstants.ReadOk;if(c_oSerFormulaTypes.Aca===type)oFormula.aca=this.stream.GetBool();else if(c_oSerFormulaTypes.Bx===type)oFormula.bx=this.stream.GetBool();else if(c_oSerFormulaTypes.Ca===type)oFormula.ca=this.stream.GetBool();else if(c_oSerFormulaTypes.Del1===type)oFormula.del1=this.stream.GetBool();else if(c_oSerFormulaTypes.Del2===type)oFormula.del2=this.stream.GetBool();else if(c_oSerFormulaTypes.Dt2D===type)oFormula.dt2d=this.stream.GetBool();else if(c_oSerFormulaTypes.Dtr===type)oFormula.dtr= this.stream.GetBool();else if(c_oSerFormulaTypes.R1===type)oFormula.r1=this.stream.GetString2LE(length);else if(c_oSerFormulaTypes.R2===type)oFormula.r2=this.stream.GetString2LE(length);else if(c_oSerFormulaTypes.Ref===type)oFormula.ref=this.stream.GetString2LE(length);else if(c_oSerFormulaTypes.Si===type)oFormula.si=this.stream.GetULongLE();else if(c_oSerFormulaTypes.T===type)oFormula.t=this.stream.GetUChar();else if(c_oSerFormulaTypes.Text===type)oFormula.v=this.stream.GetString2LE(length);else res= c_oSerConstants.ReadUnknown;return res};this.ReadDrawings=function(type,length,aDrawings,ws){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorksheetsTypes.Drawing==type){var objectRender=new AscFormat.DrawingObjects;var oFlags={from:false,to:false,pos:false,ext:false,editAs:c_oAscCellAnchorType.cellanchorTwoCell};var oNewDrawing=objectRender.createDrawingObject();res=this.bcr.Read1(length,function(t,l){return oThis.ReadDrawing(t,l,oNewDrawing,oFlags)});if(null!=oNewDrawing.graphicObject){if(false!= oFlags.from&&false!=oFlags.to){oNewDrawing.Type=c_oAscCellAnchorType.cellanchorTwoCell;oNewDrawing.editAs=oFlags.editAs}else if(false!=oFlags.from&&false!=oFlags.ext)oNewDrawing.Type=c_oAscCellAnchorType.cellanchorOneCell;else if(false!=oFlags.pos&&false!=oFlags.ext)oNewDrawing.Type=c_oAscCellAnchorType.cellanchorAbsolute;if(oNewDrawing.graphicObject)if(typeof oNewDrawing.graphicObject.setWorksheet!="undefined")oNewDrawing.graphicObject.setWorksheet(ws);if(!oNewDrawing.graphicObject.spPr){oNewDrawing.graphicObject.setSpPr(new AscFormat.CSpPr); oNewDrawing.graphicObject.spPr.setParent(oNewDrawing.graphicObject)}if(!oNewDrawing.graphicObject.spPr.xfrm){oNewDrawing.graphicObject.spPr.setXfrm(new AscFormat.CXfrm);oNewDrawing.graphicObject.spPr.xfrm.setParent(oNewDrawing.graphicObject.spPr);oNewDrawing.graphicObject.spPr.xfrm.setOffX(0);oNewDrawing.graphicObject.spPr.xfrm.setOffY(0);oNewDrawing.graphicObject.spPr.xfrm.setExtX(0);oNewDrawing.graphicObject.spPr.xfrm.setExtY(0)}aDrawings.push(oNewDrawing)}}else res=c_oSerConstants.ReadUnknown; return res};this.ReadDrawing=function(type,length,oDrawing,oFlags){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_DrawingType.Type==type)oDrawing.Type=this.stream.GetUChar();else if(c_oSer_DrawingType.EditAs==type)oFlags.editAs=this.stream.GetUChar();else if(c_oSer_DrawingType.From==type){oFlags.from=true;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadFromTo(t,l,oDrawing.from)})}else if(c_oSer_DrawingType.To==type){oFlags.to=true;res=this.bcr.Read2Spreadsheet(length, function(t,l){return oThis.ReadFromTo(t,l,oDrawing.to)})}else if(c_oSer_DrawingType.Pos==type){oFlags.pos=true;if(null==oDrawing.Pos)oDrawing.Pos={};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadPos(t,l,oDrawing.Pos)})}else if(c_oSer_DrawingType.Ext==type){oFlags.ext=true;res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadExt(t,l,oDrawing.ext)})}else if(c_oSer_DrawingType.Pic==type){oDrawing.image=new Image;res=this.bcr.Read1(length,function(t,l){return oThis.ReadPic(t, l,oDrawing)})}else if(c_oSer_DrawingType.GraphicFrame==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadGraphicFrame(t,l,oDrawing)});else if(c_oSer_DrawingType.pptxDrawing==type){var graphicObject=this.ReadPptxDrawing();if(graphicObject){oDrawing.graphicObject=graphicObject;if(typeof graphicObject.setDrawingBase!="undefined")graphicObject.setDrawingBase(oDrawing)}}else res=c_oSerConstants.ReadUnknown;return res};this.ReadPptxDrawing=function(){var graphicObject;var oGraphicObject=pptx_content_loader.ReadGraphicObject(this.stream, this.curWorksheet,this.curWorksheet.getDrawingDocument());if(null!=oGraphicObject&&!((oGraphicObject.getObjectType()===AscDFH.historyitem_type_Shape||oGraphicObject.getObjectType()===AscDFH.historyitem_type_ImageShape)&&!oGraphicObject.spPr)&&!AscCommon.IsHiddenObj(oGraphicObject))graphicObject=oGraphicObject;return graphicObject};this.ReadGraphicFrame=function(type,length,oDrawing){var res=c_oSerConstants.ReadOk;if(c_oSer_DrawingType.Chart2==type){var oNewChartSpace=new AscFormat.CChartSpace;var oBinaryChartReader= new AscCommon.BinaryChartReader(this.stream);res=oBinaryChartReader.ExternalReadCT_ChartSpace(length,oNewChartSpace,this.curWorksheet);oDrawing.graphicObject=oNewChartSpace;oNewChartSpace.setBDeleted(false);if(oNewChartSpace.setDrawingBase)oNewChartSpace.setDrawingBase(oDrawing)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadFromTo=function(type,length,oFromTo){var res=c_oSerConstants.ReadOk;if(c_oSer_DrawingFromToType.Col===type){oFromTo.col=this.stream.GetULongLE();if(oFromTo.col<0)oFromTo.col= 0}else if(c_oSer_DrawingFromToType.ColOff===type)oFromTo.colOff=this.stream.GetDoubleLE();else if(c_oSer_DrawingFromToType.Row===type){oFromTo.row=this.stream.GetULongLE();if(oFromTo.row<0)oFromTo.row=0}else if(c_oSer_DrawingFromToType.RowOff===type)oFromTo.rowOff=this.stream.GetDoubleLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadPos=function(type,length,oPos){var res=c_oSerConstants.ReadOk;if(c_oSer_DrawingPosType.X==type)oPos.X=this.stream.GetDoubleLE();else if(c_oSer_DrawingPosType.Y== type)oPos.Y=this.stream.GetDoubleLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadExt=function(type,length,oExt){var res=c_oSerConstants.ReadOk;if(c_oSer_DrawingExtType.Cx==type)oExt.cx=this.stream.GetDoubleLE();else if(c_oSer_DrawingExtType.Cy==type)oExt.cy=this.stream.GetDoubleLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadPic=function(type,length,oDrawing){var res=c_oSerConstants.ReadOk;if(c_oSer_DrawingType.PicSrc==type){var nIndex=this.stream.GetULongLE();var src= this.oMediaArray[nIndex];if(null!=src)oDrawing.image.src=src}else res=c_oSerConstants.ReadUnknown;return res};this.ReadComments=function(type,length,oWorksheet){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSerWorksheetsTypes.Comment==type&&AscCommonExcel.asc_CCommentCoords){var oCommentCoords=new AscCommonExcel.asc_CCommentCoords;var aCommentData=[];res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadComment(t,l,oCommentCoords,aCommentData)});if(oCommentCoords.isValid()){var i; for(i=0,length=aCommentData.length;i<length;++i){aCommentData[i].coords=oCommentCoords;var elem=aCommentData[i];elem.asc_putRow(oCommentCoords.nRow);elem.asc_putCol(oCommentCoords.nCol);if(elem.asc_getDocumentFlag())this.wb.aComments.push(elem);else oWorksheet.aComments.push(elem)}}}else res=c_oSerConstants.ReadUnknown;return res};this.ReadComment=function(type,length,oCommentCoords,aCommentData){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_Comments.Row==type)oCommentCoords.nRow=this.stream.GetULongLE(); else if(c_oSer_Comments.Col==type)oCommentCoords.nCol=this.stream.GetULongLE();else if(c_oSer_Comments.CommentDatas==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadCommentDatas(t,l,aCommentData)});else if(c_oSer_Comments.Left==type)oCommentCoords.nLeft=this.stream.GetULongLE();else if(c_oSer_Comments.LeftOffset==type)oCommentCoords.nLeftOffset=this.stream.GetULongLE();else if(c_oSer_Comments.Top==type)oCommentCoords.nTop=this.stream.GetULongLE();else if(c_oSer_Comments.TopOffset==type)oCommentCoords.nTopOffset= this.stream.GetULongLE();else if(c_oSer_Comments.Right==type)oCommentCoords.nRight=this.stream.GetULongLE();else if(c_oSer_Comments.RightOffset==type)oCommentCoords.nRightOffset=this.stream.GetULongLE();else if(c_oSer_Comments.Bottom==type)oCommentCoords.nBottom=this.stream.GetULongLE();else if(c_oSer_Comments.BottomOffset==type)oCommentCoords.nBottomOffset=this.stream.GetULongLE();else if(c_oSer_Comments.LeftMM==type)oCommentCoords.dLeftMM=this.stream.GetDoubleLE();else if(c_oSer_Comments.TopMM== type)oCommentCoords.dTopMM=this.stream.GetDoubleLE();else if(c_oSer_Comments.WidthMM==type)oCommentCoords.dWidthMM=this.stream.GetDoubleLE();else if(c_oSer_Comments.HeightMM==type)oCommentCoords.dHeightMM=this.stream.GetDoubleLE();else if(c_oSer_Comments.MoveWithCells==type)oCommentCoords.bMoveWithCells=this.stream.GetBool();else if(c_oSer_Comments.SizeWithCells==type)oCommentCoords.bSizeWithCells=this.stream.GetBool();else if(c_oSer_Comments.ThreadedComment==type)if(aCommentData.length>0){var commentData= aCommentData[0];commentData.aReplies=[];res=this.bcr.Read1(length,function(t,l){return oThis.ReadThreadedComment(t,l,commentData)})}else res=c_oSerConstants.ReadUnknown;else res=c_oSerConstants.ReadUnknown;return res};this.ReadCommentDatas=function(type,length,aCommentData){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_Comments.CommentData===type){var oCommentData=new Asc.asc_CCommentData;oCommentData.asc_putDocumentFlag(false);res=this.bcr.Read1(length,function(t,l){return oThis.ReadCommentData(t, l,oCommentData)});if(oCommentData.asc_getDocumentFlag())oCommentData.nId="doc_"+(this.wb.aComments.length+1);else{oCommentData.wsId=this.curWorksheet.Id;oCommentData.nId="sheet"+oCommentData.wsId+"_"+(this.curWorksheet.aComments.length+1)}aCommentData.push(oCommentData)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadCommentData=function(type,length,oCommentData){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_CommentData.Text==type)oCommentData.asc_putText(this.stream.GetString2LE(length)); else if(c_oSer_CommentData.Time==type){var dateMs=AscCommon.getTimeISO8601(this.stream.GetString2LE(length));if(!isNaN(dateMs))oCommentData.asc_putTime(dateMs+"")}else if(c_oSer_CommentData.OOTime==type){var dateMs=AscCommon.getTimeISO8601(this.stream.GetString2LE(length));if(!isNaN(dateMs))oCommentData.asc_putOnlyOfficeTime(dateMs+"")}else if(c_oSer_CommentData.UserId==type)oCommentData.asc_putUserId(this.stream.GetString2LE(length));else if(c_oSer_CommentData.UserName==type)oCommentData.asc_putUserName(this.stream.GetString2LE(length)); else if(c_oSer_CommentData.UserData==type)oCommentData.asc_putUserData(this.stream.GetString2LE(length));else if(c_oSer_CommentData.QuoteText==type)oCommentData.asc_putQuoteText(this.stream.GetString2LE(length));else if(c_oSer_CommentData.Replies==type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadReplies(t,l,oCommentData)});else if(c_oSer_CommentData.Solved==type)oCommentData.asc_putSolved(this.stream.GetBool());else if(c_oSer_CommentData.Document==type)oCommentData.asc_putDocumentFlag(this.stream.GetBool()); else if(c_oSer_CommentData.Guid==type)oCommentData.asc_putGuid(this.stream.GetString2LE(length));else res=c_oSerConstants.ReadUnknown;return res};this.ReadConditionalFormatting=function(type,length,oConditionalFormatting){var res=c_oSerConstants.ReadOk;var oThis=this;var oConditionalFormattingRule=null;if(c_oSer_ConditionalFormatting.Pivot===type)oConditionalFormatting.pivot=this.stream.GetBool();else if(c_oSer_ConditionalFormatting.SqRef===type)oConditionalFormatting.setSqRef(this.stream.GetString2LE(length)); else if(c_oSer_ConditionalFormatting.ConditionalFormattingRule===type){oConditionalFormattingRule=new AscCommonExcel.CConditionalFormattingRule;res=this.bcr.Read1(length,function(t,l){return oThis.ReadConditionalFormattingRule(t,l,oConditionalFormattingRule)});oConditionalFormatting.aRules.push(oConditionalFormattingRule)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadConditionalFormattingRule=function(type,length,oConditionalFormattingRule){var res=c_oSerConstants.ReadOk;var oThis=this; var oConditionalFormattingRuleElement=null;if(c_oSer_ConditionalFormattingRule.AboveAverage===type)oConditionalFormattingRule.aboveAverage=this.stream.GetBool();else if(c_oSer_ConditionalFormattingRule.Bottom===type)oConditionalFormattingRule.bottom=this.stream.GetBool();else if(c_oSer_ConditionalFormattingRule.DxfId===type){var DxfId=this.stream.GetULongLE();oConditionalFormattingRule.dxf=this.Dxfs[DxfId]}else if(c_oSer_ConditionalFormattingRule.Dxf===type){var oDxf=new AscCommonExcel.CellXfs;res= this.bcr.Read1(length,function(t,l){return oThis.oReadResult.stylesTableReader.ReadDxf(t,l,oDxf)});oConditionalFormattingRule.dxf=oDxf}else if(c_oSer_ConditionalFormattingRule.EqualAverage===type)oConditionalFormattingRule.equalAverage=this.stream.GetBool();else if(c_oSer_ConditionalFormattingRule.Operator===type)oConditionalFormattingRule.operator=this.stream.GetUChar();else if(c_oSer_ConditionalFormattingRule.Percent===type)oConditionalFormattingRule.percent=this.stream.GetBool();else if(c_oSer_ConditionalFormattingRule.Priority=== type)oConditionalFormattingRule.priority=this.stream.GetULongLE();else if(c_oSer_ConditionalFormattingRule.Rank===type)oConditionalFormattingRule.rank=this.stream.GetULongLE();else if(c_oSer_ConditionalFormattingRule.StdDev===type)oConditionalFormattingRule.stdDev=this.stream.GetULongLE();else if(c_oSer_ConditionalFormattingRule.StopIfTrue===type)oConditionalFormattingRule.stopIfTrue=this.stream.GetBool();else if(c_oSer_ConditionalFormattingRule.Text===type)oConditionalFormattingRule.text=this.stream.GetString2LE(length); else if(c_oSer_ConditionalFormattingRule.TimePeriod===type)oConditionalFormattingRule.timePeriod=this.stream.GetString2LE(length);else if(c_oSer_ConditionalFormattingRule.Type===type)oConditionalFormattingRule.type=this.stream.GetUChar();else if(c_oSer_ConditionalFormattingRule.ColorScale===type){oConditionalFormattingRuleElement=new AscCommonExcel.CColorScale;res=this.bcr.Read1(length,function(t,l){return oThis.ReadColorScale(t,l,oConditionalFormattingRuleElement)});oConditionalFormattingRule.aRuleElements.push(oConditionalFormattingRuleElement)}else if(c_oSer_ConditionalFormattingRule.DataBar=== type){oConditionalFormattingRuleElement=new AscCommonExcel.CDataBar;res=this.bcr.Read1(length,function(t,l){return oThis.ReadDataBar(t,l,oConditionalFormattingRuleElement)});oConditionalFormattingRule.aRuleElements.push(oConditionalFormattingRuleElement)}else if(c_oSer_ConditionalFormattingRule.FormulaCF===type){oConditionalFormattingRuleElement=new AscCommonExcel.CFormulaCF;oConditionalFormattingRuleElement.Text=this.stream.GetString2LE(length);oConditionalFormattingRule.aRuleElements.push(oConditionalFormattingRuleElement)}else if(c_oSer_ConditionalFormattingRule.IconSet=== type){oConditionalFormattingRuleElement=new AscCommonExcel.CIconSet;res=this.bcr.Read1(length,function(t,l){return oThis.ReadIconSet(t,l,oConditionalFormattingRuleElement)});oConditionalFormattingRule.aRuleElements.push(oConditionalFormattingRuleElement)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadColorScale=function(type,length,oColorScale){var res=c_oSerConstants.ReadOk;var oThis=this;var oObject=null;if(c_oSer_ConditionalFormattingRuleColorScale.CFVO===type){oObject=new AscCommonExcel.CConditionalFormatValueObject; res=this.bcr.Read1(length,function(t,l){return oThis.ReadCFVO(t,l,oObject)});oColorScale.aCFVOs.push(oObject)}else if(c_oSer_ConditionalFormattingRuleColorScale.Color===type){var color=ReadColorSpreadsheet2(this.bcr,length);if(null!=color)oColorScale.aColors.push(color)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadDataBar=function(type,length,oDataBar){var res=c_oSerConstants.ReadOk;var oThis=this;var oObject=null;if(c_oSer_ConditionalFormattingDataBar.MaxLength===type)oDataBar.MaxLength= this.stream.GetULongLE();else if(c_oSer_ConditionalFormattingDataBar.MinLength===type)oDataBar.MinLength=this.stream.GetULongLE();else if(c_oSer_ConditionalFormattingDataBar.ShowValue===type)oDataBar.ShowValue=this.stream.GetBool();else if(c_oSer_ConditionalFormattingDataBar.Color===type){var color=ReadColorSpreadsheet2(this.bcr,length);if(color)oDataBar.Color=color}else if(c_oSer_ConditionalFormattingDataBar.NegativeColor===type){var color=ReadColorSpreadsheet2(this.bcr,length);if(color)oDataBar.NegativeColor= color}else if(c_oSer_ConditionalFormattingDataBar.BorderColor===type){var color=ReadColorSpreadsheet2(this.bcr,length);if(color)oDataBar.BorderColor=color}else if(c_oSer_ConditionalFormattingDataBar.AxisColor===type){var color=ReadColorSpreadsheet2(this.bcr,length);if(color)oDataBar.AxisColor=color}else if(c_oSer_ConditionalFormattingDataBar.NegativeBorderColor===type){var color=ReadColorSpreadsheet2(this.bcr,length);if(color)oDataBar.NegativeBorderColor=color}else if(c_oSer_ConditionalFormattingDataBar.AxisPosition=== type)oDataBar.AxisPosition=this.stream.GetULongLE();else if(c_oSer_ConditionalFormattingDataBar.Direction===type)oDataBar.Direction=this.stream.GetULongLE();else if(c_oSer_ConditionalFormattingDataBar.GradientEnabled===type)oDataBar.Gradient=this.stream.GetBool();else if(c_oSer_ConditionalFormattingDataBar.NegativeBarColorSameAsPositive===type)oDataBar.NegativeBarColorSameAsPositive=this.stream.GetBool();else if(c_oSer_ConditionalFormattingDataBar.NegativeBarBorderColorSameAsPositive===type)oDataBar.NegativeBarBorderColorSameAsPositive= this.stream.GetBool();else if(c_oSer_ConditionalFormattingDataBar.CFVO===type){oObject=new AscCommonExcel.CConditionalFormatValueObject;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCFVO(t,l,oObject)});oDataBar.aCFVOs.push(oObject)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadIconSet=function(type,length,oIconSet){var res=c_oSerConstants.ReadOk;var oThis=this;var oObject=null;if(c_oSer_ConditionalFormattingIconSet.IconSet===type)oIconSet.IconSet=this.stream.GetUChar();else if(c_oSer_ConditionalFormattingIconSet.Percent=== type)oIconSet.Percent=this.stream.GetBool();else if(c_oSer_ConditionalFormattingIconSet.Reverse===type)oIconSet.Reverse=this.stream.GetBool();else if(c_oSer_ConditionalFormattingIconSet.ShowValue===type)oIconSet.ShowValue=this.stream.GetBool();else if(c_oSer_ConditionalFormattingIconSet.CFVO===type){oObject=new AscCommonExcel.CConditionalFormatValueObject;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCFVO(t,l,oObject)});oIconSet.aCFVOs.push(oObject)}else if(c_oSer_ConditionalFormattingIconSet.CFIcon=== type){oObject=new AscCommonExcel.CConditionalFormatIconSet;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCFIS(t,l,oObject)});oIconSet.aIconSets.push(oObject)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadCFVO=function(type,length,oCFVO){var res=c_oSerConstants.ReadOk;if(c_oSer_ConditionalFormattingValueObject.Gte===type)oCFVO.Gte=this.stream.GetBool();else if(c_oSer_ConditionalFormattingValueObject.Type===type)oCFVO.Type=this.stream.GetUChar();else if(c_oSer_ConditionalFormattingValueObject.Val=== type||c_oSer_ConditionalFormattingValueObject.Formula===type)oCFVO.Val=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res};this.ReadCFIS=function(type,length,oCFVO){var res=c_oSerConstants.ReadOk;if(c_oSer_ConditionalFormattingIcon.iconSet===type)oCFVO.IconSet=this.stream.GetLong();else if(c_oSer_ConditionalFormattingIcon.iconId===type)oCFVO.IconId=this.stream.GetLong();else res=c_oSerConstants.ReadUnknown;return res};this.ReadSheetViews=function(type,length,aSheetViews){var res= c_oSerConstants.ReadOk;var oThis=this;var oSheetView=null;if(c_oSerWorksheetsTypes.SheetView===type&&0==aSheetViews.length){oSheetView=new AscCommonExcel.asc_CSheetViewSettings;res=this.bcr.Read1(length,function(t,l){return oThis.ReadSheetView(t,l,oSheetView)});aSheetViews.push(oSheetView)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadSheetView=function(type,length,oSheetView){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_SheetView.ColorId===type)this.stream.GetLong();else if(c_oSer_SheetView.DefaultGridColor=== type)this.stream.GetBool();else if(c_oSer_SheetView.RightToLeft===type)this.stream.GetBool();else if(c_oSer_SheetView.ShowFormulas===type)this.stream.GetBool();else if(c_oSer_SheetView.ShowGridLines===type)oSheetView.showGridLines=this.stream.GetBool();else if(c_oSer_SheetView.ShowOutlineSymbols===type)this.stream.GetBool();else if(c_oSer_SheetView.ShowRowColHeaders===type)oSheetView.showRowColHeaders=this.stream.GetBool();else if(c_oSer_SheetView.ShowRuler===type)this.stream.GetBool();else if(c_oSer_SheetView.ShowWhiteSpace=== type)this.stream.GetBool();else if(c_oSer_SheetView.ShowZeros===type)this.stream.GetBool();else if(c_oSer_SheetView.TabSelected===type)this.stream.GetBool();else if(c_oSer_SheetView.TopLeftCell===type)this.stream.GetString2LE(length);else if(c_oSer_SheetView.View===type)this.stream.GetUChar();else if(c_oSer_SheetView.WindowProtection===type)this.stream.GetBool();else if(c_oSer_SheetView.WorkbookViewId===type)this.stream.GetLong();else if(c_oSer_SheetView.ZoomScale===type)oSheetView.asc_setZoomScale(this.stream.GetLong()); else if(c_oSer_SheetView.ZoomScaleNormal===type)this.stream.GetLong();else if(c_oSer_SheetView.ZoomScalePageLayoutView===type)this.stream.GetLong();else if(c_oSer_SheetView.ZoomScaleSheetLayoutView===type)this.stream.GetLong();else if(c_oSer_SheetView.Pane===type){oSheetView.pane=new AscCommonExcel.asc_CPane;res=this.bcr.Read1(length,function(t,l){return oThis.ReadPane(t,l,oSheetView.pane)});oSheetView.pane.init()}else if(c_oSer_SheetView.Selection===type){this.curWorksheet.selectionRange.clean(); res=this.bcr.Read1(length,function(t,l){return oThis.ReadSelection(t,l,oThis.curWorksheet.selectionRange)});this.curWorksheet.selectionRange.update()}else res=c_oSerConstants.ReadUnknown;return res};this.ReadPane=function(type,length,oPane){var res=c_oSerConstants.ReadOk;if(c_oSer_Pane.ActivePane===type)this.stream.GetUChar();else if(c_oSer_Pane.State===type)oPane.state=this.stream.GetString2LE(length);else if(c_oSer_Pane.TopLeftCell===type)oPane.topLeftCell=this.stream.GetString2LE(length);else if(c_oSer_Pane.XSplit=== type)oPane.xSplit=this.stream.GetDoubleLE();else if(c_oSer_Pane.YSplit===type)oPane.ySplit=this.stream.GetDoubleLE();else res=c_oSerConstants.ReadUnknown;return res};this.ReadSelection=function(type,length,selectionRange){var res=c_oSerConstants.ReadOk;if(c_oSer_Selection.ActiveCell===type){var activeCell=AscCommonExcel.g_oRangeCache.getAscRange(this.stream.GetString2LE(length));if(activeCell)selectionRange.activeCell=new AscCommon.CellBase(activeCell.r1,activeCell.c1)}else if(c_oSer_Selection.ActiveCellId=== type)selectionRange.activeCellId=this.stream.GetLong();else if(c_oSer_Selection.Sqref===type){var sqRef=this.stream.GetString2LE(length);var selectionNew=AscCommonExcel.g_oRangeCache.getRangesFromSqRef(sqRef);if(selectionNew.length>0)selectionRange.ranges=selectionNew}else if(c_oSer_Selection.Pane===type)this.stream.GetUChar();else res=c_oSerConstants.ReadUnknown;return res};this.ReadSheetPr=function(type,length,oSheetPr){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_SheetPr.CodeName=== type)oSheetPr.CodeName=this.stream.GetString2LE(length);else if(c_oSer_SheetPr.EnableFormatConditionsCalculation===type)oSheetPr.EnableFormatConditionsCalculation=this.stream.GetBool();else if(c_oSer_SheetPr.FilterMode===type)oSheetPr.FilterMode=this.stream.GetBool();else if(c_oSer_SheetPr.Published===type)oSheetPr.Published=this.stream.GetBool();else if(c_oSer_SheetPr.SyncHorizontal===type)oSheetPr.SyncHorizontal=this.stream.GetBool();else if(c_oSer_SheetPr.SyncRef===type)oSheetPr.SyncRef=this.stream.GetString2LE(length); else if(c_oSer_SheetPr.SyncVertical===type)oSheetPr.SyncVertical=this.stream.GetBool();else if(c_oSer_SheetPr.TransitionEntry===type)oSheetPr.TransitionEntry=this.stream.GetBool();else if(c_oSer_SheetPr.TransitionEvaluation===type)oSheetPr.TransitionEvaluation=this.stream.GetBool();else if(c_oSer_SheetPr.TabColor===type){var color=ReadColorSpreadsheet2(this.bcr,length);if(color)oSheetPr.TabColor=color}else if(c_oSer_SheetPr.PageSetUpPr===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadPageSetUpPr(t, l,oSheetPr)});else if(c_oSer_SheetPr.OutlinePr===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadOutlinePr(t,l,oSheetPr)});else res=c_oSerConstants.ReadUnknown;return res};this.ReadOutlinePr=function(type,length,oSheetPr){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_SheetPr.ApplyStyles===type)oSheetPr.ApplyStyles=this.stream.GetBool();else if(c_oSer_SheetPr.ShowOutlineSymbols===type)oSheetPr.ShowOutlineSymbols=this.stream.GetBool();else if(c_oSer_SheetPr.SummaryBelow===type)oSheetPr.SummaryBelow= this.stream.GetBool();else if(c_oSer_SheetPr.SummaryRight===type)oSheetPr.SummaryRight=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadPageSetUpPr=function(type,length,oSheetPr){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_SheetPr.AutoPageBreaks===type)oSheetPr.AutoPageBreaks=this.stream.GetBool();else if(c_oSer_SheetPr.FitToPage===type)oSheetPr.FitToPage=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadSparklineGroups=function(type, length,oWorksheet){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_Sparkline.SparklineGroup===type){var newSparklineGroup=new AscCommonExcel.sparklineGroup(true);newSparklineGroup.setWorksheet(oWorksheet);res=this.bcr.Read1(length,function(t,l){return oThis.ReadSparklineGroup(t,l,newSparklineGroup)});oWorksheet.aSparklineGroups.push(newSparklineGroup)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadHeaderFooter=function(type,length,headerFooter){var res=c_oSerConstants.ReadOk;var sVal; if(c_oSer_HeaderFooter.AlignWithMargins===type)headerFooter.setAlignWithMargins(this.stream.GetBool());else if(c_oSer_HeaderFooter.DifferentFirst===type)headerFooter.setDifferentFirst(this.stream.GetBool());else if(c_oSer_HeaderFooter.DifferentOddEven===type)headerFooter.setDifferentOddEven(this.stream.GetBool());else if(c_oSer_HeaderFooter.ScaleWithDoc===type)headerFooter.setScaleWithDoc(this.stream.GetBool());else if(c_oSer_HeaderFooter.EvenFooter===type){sVal=this.stream.GetString2LE(length);if(sVal)headerFooter.setEvenFooter(sVal)}else if(c_oSer_HeaderFooter.EvenHeader=== type){sVal=this.stream.GetString2LE(length);if(sVal)headerFooter.setEvenHeader(sVal)}else if(c_oSer_HeaderFooter.FirstFooter===type){sVal=this.stream.GetString2LE(length);if(sVal)headerFooter.setFirstFooter(sVal)}else if(c_oSer_HeaderFooter.FirstHeader===type){sVal=this.stream.GetString2LE(length);if(sVal)headerFooter.setFirstHeader(sVal)}else if(c_oSer_HeaderFooter.OddFooter===type){sVal=this.stream.GetString2LE(length);if(sVal)headerFooter.setOddFooter(sVal)}else if(c_oSer_HeaderFooter.OddHeader=== type){sVal=this.stream.GetString2LE(length);if(sVal)headerFooter.setOddHeader(sVal)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadRowColBreaks=function(type,length,breaks){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_RowColBreaks.Count===type)breaks.count=this.stream.GetLong();else if(c_oSer_RowColBreaks.ManualBreakCount===type)breaks.manualBreakCount=this.stream.GetLong();else if(c_oSer_RowColBreaks.Break===type){var brk={id:null,man:null,max:null,min:null,pt:null};res=this.bcr.Read1(length, function(t,l){return oThis.ReadRowColBreak(t,l,brk)});breaks.breaks.push(brk)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadRowColBreak=function(type,length,brk){var res=c_oSerConstants.ReadOk;if(c_oSer_RowColBreaks.Id===type)brk.id=this.stream.GetLong();else if(c_oSer_RowColBreaks.Man===type)brk.man=this.stream.GetBool();else if(c_oSer_RowColBreaks.Max===type)brk.max=this.stream.GetLong();else if(c_oSer_RowColBreaks.Min===type)brk.min=this.stream.GetLong();else if(c_oSer_RowColBreaks.Pt=== type)brk.pt=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadLegacyDrawingHF=function(type,length,legacyDrawingHF){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_LegacyDrawingHF.Drawings===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadLegacyDrawingHFDrawings(t,l,legacyDrawingHF.drawings)});else if(c_oSer_LegacyDrawingHF.Cfe===type)legacyDrawingHF.cfe=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Cff===type)legacyDrawingHF.cff=this.stream.GetBool(); else if(c_oSer_LegacyDrawingHF.Cfo===type)legacyDrawingHF.cfo=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Che===type)legacyDrawingHF.che=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Chf===type)legacyDrawingHF.chf=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Cho===type)legacyDrawingHF.cho=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Lfe===type)legacyDrawingHF.lfe=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Lff===type)legacyDrawingHF.lff=this.stream.GetBool(); else if(c_oSer_LegacyDrawingHF.Lfo===type)legacyDrawingHF.lfo=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Lhe===type)legacyDrawingHF.lhe=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Lhf===type)legacyDrawingHF.lhf=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Lho===type)legacyDrawingHF.lho=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Rfe===type)legacyDrawingHF.rfe=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Rff===type)legacyDrawingHF.rff=this.stream.GetBool(); else if(c_oSer_LegacyDrawingHF.Rfo===type)legacyDrawingHF.rfo=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Rhe===type)legacyDrawingHF.rhe=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Rhf===type)legacyDrawingHF.rhf=this.stream.GetBool();else if(c_oSer_LegacyDrawingHF.Rho===type)legacyDrawingHF.rho=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res};this.ReadLegacyDrawingHFDrawings=function(type,length,drawings){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_LegacyDrawingHF.Drawing=== type){var drawing={id:null,graphicObject:null};res=this.bcr.Read1(length,function(t,l){return oThis.ReadLegacyDrawingHFDrawing(t,l,drawing)});if(null!==drawing.id&&null!==drawing.graphicObject)drawings.push(drawing)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadLegacyDrawingHFDrawing=function(type,length,drawing){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_LegacyDrawingHF.DrawingId===type)drawing.id=this.stream.GetString2LE(length);else if(c_oSer_LegacyDrawingHF.DrawingShape=== type){var graphicObject=this.ReadPptxDrawing();if(graphicObject)drawing.graphicObject=graphicObject}else res=c_oSerConstants.ReadUnknown;return res};this.ReadSparklineGroup=function(type,length,oSparklineGroup){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_Sparkline.ManualMax===type)oSparklineGroup.manualMax=this.stream.GetDoubleLE();else if(c_oSer_Sparkline.ManualMin===type)oSparklineGroup.manualMin=this.stream.GetDoubleLE();else if(c_oSer_Sparkline.LineWeight===type)oSparklineGroup.lineWeight= this.stream.GetDoubleLE();else if(c_oSer_Sparkline.Type===type)oSparklineGroup.type=this.stream.GetUChar();else if(c_oSer_Sparkline.DateAxis===type)oSparklineGroup.dateAxis=this.stream.GetBool();else if(c_oSer_Sparkline.DisplayEmptyCellsAs===type)oSparklineGroup.displayEmptyCellsAs=this.stream.GetUChar();else if(c_oSer_Sparkline.Markers===type)oSparklineGroup.markers=this.stream.GetBool();else if(c_oSer_Sparkline.High===type)oSparklineGroup.high=this.stream.GetBool();else if(c_oSer_Sparkline.Low=== type)oSparklineGroup.low=this.stream.GetBool();else if(c_oSer_Sparkline.First===type)oSparklineGroup.first=this.stream.GetBool();else if(c_oSer_Sparkline.Last===type)oSparklineGroup.last=this.stream.GetBool();else if(c_oSer_Sparkline.Negative===type)oSparklineGroup.negative=this.stream.GetBool();else if(c_oSer_Sparkline.DisplayXAxis===type)oSparklineGroup.displayXAxis=this.stream.GetBool();else if(c_oSer_Sparkline.DisplayHidden===type)oSparklineGroup.displayHidden=this.stream.GetBool();else if(c_oSer_Sparkline.MinAxisType=== type)oSparklineGroup.minAxisType=this.stream.GetUChar();else if(c_oSer_Sparkline.MaxAxisType===type)oSparklineGroup.maxAxisType=this.stream.GetUChar();else if(c_oSer_Sparkline.RightToLeft===type)oSparklineGroup.rightToLeft=this.stream.GetBool();else if(c_oSer_Sparkline.ColorSeries===type)oSparklineGroup.colorSeries=ReadColorSpreadsheet2(this.bcr,length);else if(c_oSer_Sparkline.ColorNegative===type)oSparklineGroup.colorNegative=ReadColorSpreadsheet2(this.bcr,length);else if(c_oSer_Sparkline.ColorAxis=== type)oSparklineGroup.colorAxis=ReadColorSpreadsheet2(this.bcr,length);else if(c_oSer_Sparkline.ColorMarkers===type)oSparklineGroup.colorMarkers=ReadColorSpreadsheet2(this.bcr,length);else if(c_oSer_Sparkline.ColorFirst===type)oSparklineGroup.colorFirst=ReadColorSpreadsheet2(this.bcr,length);else if(c_oSer_Sparkline.ColorLast===type)oSparklineGroup.colorLast=ReadColorSpreadsheet2(this.bcr,length);else if(c_oSer_Sparkline.ColorHigh===type)oSparklineGroup.colorHigh=ReadColorSpreadsheet2(this.bcr,length); else if(c_oSer_Sparkline.ColorLow===type)oSparklineGroup.colorLow=ReadColorSpreadsheet2(this.bcr,length);else if(c_oSer_Sparkline.Ref===type)oSparklineGroup.f=this.stream.GetString2LE(length);else if(c_oSer_Sparkline.Sparklines===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadSparklines(t,l,oSparklineGroup)});else res=c_oSerConstants.ReadUnknown;return res};this.ReadSparklines=function(type,length,oSparklineGroup){var oThis=this;var res=c_oSerConstants.ReadOk;if(c_oSer_Sparkline.Sparkline=== type){var newSparkline=new AscCommonExcel.sparkline;res=this.bcr.Read1(length,function(t,l){return oThis.ReadSparkline(t,l,newSparkline)});oSparklineGroup.arrSparklines.push(newSparkline)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadSparkline=function(type,length,oSparkline){var res=c_oSerConstants.ReadOk;if(c_oSer_Sparkline.SparklineRef===type)oSparkline.setF(this.stream.GetString2LE(length));else if(c_oSer_Sparkline.SparklineSqRef===type)oSparkline.setSqRef(this.stream.GetString2LE(length)); else res=c_oSerConstants.ReadUnknown;return res};this.ReadReplies=function(type,length,oCommentData){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_CommentData.Reply===type){var oReplyData=new Asc.asc_CCommentData;res=this.bcr.Read1(length,function(t,l){return oThis.ReadCommentData(t,l,oReplyData)});oCommentData.asc_addReply(oReplyData)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadThreadedComment=function(type,length,oCommentData){var res=c_oSerConstants.ReadOk;var oThis=this; if(c_oSer_ThreadedComment.dT===type){oCommentData.asc_putTime("");var dateMs=AscCommon.getTimeISO8601(this.stream.GetString2LE(length));if(!isNaN(dateMs))oCommentData.asc_putOnlyOfficeTime(dateMs+"")}else if(c_oSer_ThreadedComment.personId===type){var person=this.personList[this.stream.GetString2LE(length)];if(person){oCommentData.asc_putUserName(person.displayName);oCommentData.asc_putUserId(person.userId);oCommentData.asc_putProviderId(person.providerId)}}else if(c_oSer_ThreadedComment.id===type)oCommentData.asc_putGuid(this.stream.GetString2LE(length)); else if(c_oSer_ThreadedComment.done===type)oCommentData.asc_putSolved(this.stream.GetBool());else if(c_oSer_ThreadedComment.text===type)oCommentData.asc_putText(this.stream.GetString2LE(length));else if(c_oSer_ThreadedComment.reply===type){var reply=new Asc.asc_CCommentData;res=this.bcr.Read1(length,function(t,l){return oThis.ReadThreadedComment(t,l,reply)});oCommentData.asc_addReply(reply)}else res=c_oSerConstants.ReadUnknown;return res};this.ReadThreadedCommentMention=function(type,length,mention){var res= c_oSerConstants.ReadOk;if(c_oSer_ThreadedComment.mentionpersonId===type)mention.mentionpersonId=this.stream.GetString2LE(length);else if(c_oSer_ThreadedComment.mentionId===type)mention.mentionId=this.stream.GetString2LE(length);else if(c_oSer_ThreadedComment.startIndex===type)mention.startIndex=this.stream.GetULong();else if(c_oSer_ThreadedComment.length===type)mention.length=this.stream.GetULong();else res=c_oSerConstants.ReadUnknown;return res}}function Binary_CalcChainTableReader(stream,aCalcChain){this.stream= stream;this.aCalcChain=aCalcChain;this.bcr=new Binary_CommonReader(this.stream);this.Read=function(){var oThis=this;return this.bcr.ReadTable(function(t,l){return oThis.ReadCalcChainContent(t,l)})};this.ReadCalcChainContent=function(type,length){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_CalcChainType.CalcChainItem===type){var oNewCalcChain={};res=this.bcr.Read2Spreadsheet(length,function(t,l){return oThis.ReadCalcChain(t,l,oNewCalcChain)});this.aCalcChain.push(oNewCalcChain)}else res= c_oSerConstants.ReadUnknown;return res};this.ReadCalcChain=function(type,length,oCalcChain){var res=c_oSerConstants.ReadOk;if(c_oSer_CalcChainType.Array==type)oCalcChain.Array=this.stream.GetBool();else if(c_oSer_CalcChainType.SheetId==type)oCalcChain.SheetId=this.stream.GetULongLE();else if(c_oSer_CalcChainType.DependencyLevel==type)oCalcChain.DependencyLevel=this.stream.GetBool();else if(c_oSer_CalcChainType.Ref==type)oCalcChain.Ref=this.stream.GetString2LE(length);else if(c_oSer_CalcChainType.ChildChain== type)oCalcChain.ChildChain=this.stream.GetBool();else if(c_oSer_CalcChainType.NewThread==type)oCalcChain.NewThread=this.stream.GetBool();else res=c_oSerConstants.ReadUnknown;return res}}function Binary_OtherTableReader(stream,oMedia,wb){this.stream=stream;this.oMedia=oMedia;this.wb=wb;this.bcr=new Binary_CommonReader(this.stream);this.Read=function(){var oThis=this;var oRes=this.bcr.ReadTable(function(t,l){return oThis.ReadOtherContent(t,l)});return oRes};this.ReadOtherContent=function(type,length){var res= c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_OtherType.Media===type)res=this.bcr.Read1(length,function(t,l){return oThis.ReadMediaContent(t,l)});else if(c_oSer_OtherType.Theme===type){this.wb.theme=pptx_content_loader.ReadTheme(this,this.stream);res=c_oSerConstants.ReadUnknown}else res=c_oSerConstants.ReadUnknown;return res};this.ReadMediaContent=function(type,length){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_OtherType.MediaItem===type){var oNewMedia={};res=this.bcr.Read1(length, function(t,l){return oThis.ReadMediaItem(t,l,oNewMedia)});if(null!=oNewMedia.id&&null!=oNewMedia.src)this.oMedia[oNewMedia.id]=oNewMedia.src}else res=c_oSerConstants.ReadUnknown;return res};this.ReadMediaItem=function(type,length,oNewMedia){var res=c_oSerConstants.ReadOk;if(c_oSer_OtherType.MediaSrc===type){var src=this.stream.GetString2LE(length);if(0!=src.indexOf("http:")&&0!=src.indexOf("data:")&&0!=src.indexOf("https:")&&0!=src.indexOf("ftp:")&&0!=src.indexOf("file:"))oNewMedia.src=AscCommon.g_oDocumentUrls.getImageUrl(src); else oNewMedia.src=src}else if(c_oSer_OtherType.MediaId===type)oNewMedia.id=this.stream.GetULongLE();else res=c_oSerConstants.ReadUnknown;return res}}function getBinaryOtherTableGVar(wb){AscCommonExcel.g_oColorManager.setTheme(wb.theme);var sMinorFont=null;if(null!=wb.theme.themeElements&&null!=wb.theme.themeElements.fontScheme&&null!=wb.theme.themeElements.fontScheme.minorFont)sMinorFont=wb.theme.themeElements.fontScheme.minorFont.latin;var sDefFont="Calibri";if(null!=sMinorFont&&""!=sMinorFont)sDefFont= sMinorFont;g_oDefaultFormat.Font=new AscCommonExcel.Font;g_oDefaultFormat.Font.assignFromObject({fn:sDefFont,scheme:EFontScheme.fontschemeMinor,fs:11,c:AscCommonExcel.g_oColorManager.getThemeColor(AscCommonExcel.g_nColorTextDefault)});g_oDefaultFormat.Fill=g_oDefaultFormat.FillAbs=new AscCommonExcel.Fill;g_oDefaultFormat.Border=g_oDefaultFormat.BorderAbs=new AscCommonExcel.Border({l:new AscCommonExcel.BorderProp,t:new AscCommonExcel.BorderProp,r:new AscCommonExcel.BorderProp,b:new AscCommonExcel.BorderProp, d:new AscCommonExcel.BorderProp,ih:new AscCommonExcel.BorderProp,iv:new AscCommonExcel.BorderProp,dd:false,du:false});g_oDefaultFormat.Num=g_oDefaultFormat.NumAbs=new AscCommonExcel.Num({f:"General"});g_oDefaultFormat.Align=g_oDefaultFormat.AlignAbs=new AscCommonExcel.Align({hor:null,indent:0,RelativeIndent:0,shrink:false,angle:0,ver:Asc.c_oAscVAlign.Bottom,wrap:false})}function BinaryPersonReader(stream,personList){this.stream=stream;this.personList=personList;this.bcr=new Binary_CommonReader(this.stream); this.Read=function(){var oThis=this;var oRes=this.bcr.ReadTable(function(t,l){return oThis.ReadPersonList(t,l)});return oRes};this.ReadPersonList=function(type,length,persons){var res=c_oSerConstants.ReadOk;var oThis=this;if(c_oSer_Person.person===type){var person={providerId:"",userId:"",displayName:""};res=this.bcr.Read1(length,function(t,l){return oThis.ReadPerson(t,l,person)})}else res=c_oSerConstants.ReadUnknown;return res};this.ReadPerson=function(type,length,person){var res=c_oSerConstants.ReadOk; var oThis=this;if(c_oSer_Person.id===type)this.personList[this.stream.GetString2LE(length)]=person;else if(c_oSer_Person.providerId===type)person.providerId=this.stream.GetString2LE(length);else if(c_oSer_Person.userId===type)person.userId=this.stream.GetString2LE(length);else if(c_oSer_Person.displayName===type)person.displayName=this.stream.GetString2LE(length);else res=c_oSerConstants.ReadUnknown;return res}}function BinaryFileReader(isCopyPaste){this.stream=null;this.copyPasteObj={isCopyPaste:isCopyPaste, activeRange:null,selectAllSheet:null};this.oReadResult={tableCustomFunc:[],sheetData:[],stylesTableReader:null,pivotCacheDefinitions:{},macros:null,slicerCaches:{},tableIds:{},defNames:[],sheetIds:{}};this.getbase64DecodedData=function(szSrc){var isBase64=typeof szSrc==="string";var srcLen=szSrc.length;var nWritten=0;var nType=0;var index=AscCommon.c_oSerFormat.Signature.length;var version="";var dst_len="";while(true){index++;var _c=isBase64?szSrc.charCodeAt(index):szSrc[index];if(_c==";".charCodeAt(0))if(0== nType){nType=1;continue}else{index++;break}if(0==nType)version+=String.fromCharCode(_c);else dst_len+=String.fromCharCode(_c)}var nVersion=0;if(version.length>1){var nTempVersion=version.substring(1)-0;if(nTempVersion)AscCommon.CurFileVersion=nVersion=nTempVersion}var stream;if(Asc.c_nVersionNoBase64!==nVersion){var dstLen=parseInt(dst_len);var pointer=g_memory.Alloc(dstLen);stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index< srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=DecodeBase64Char(isBase64?szSrc.charCodeAt(index++):szSrc[index++]);if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[isBase64?szSrc.charCodeAt(index++):szSrc[index++]];if(nCh==undefined){i--; continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}}else{stream=new AscCommon.FT_Stream2(szSrc,szSrc.length);stream.EnterFrame(index);stream.Seek(index)}return stream};this.getbase64DecodedData2=function(szSrc,szSrcOffset,stream,streamOffset){var srcLen=szSrc.length;var nWritten=streamOffset;var dstPx=stream.data;var index=szSrcOffset;if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>= srcLen)break;var nCh=DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;var nLen=nBits/8|0;for(i=0;i<nLen;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;var nLen=nBits/8|0;for(i=0;i<nLen;i++){dstPx[nWritten++]= (dwCurr&16711680)>>>16;dwCurr<<=8}}}return nWritten};this.Read=function(data,wb){var t=this;pptx_content_loader.Clear();var pasteBinaryFromExcel=false;if(this.copyPasteObj&&this.copyPasteObj.isCopyPaste&&typeof editor!="undefined"&&editor)pasteBinaryFromExcel=true;this.stream=this.getbase64DecodedData(data);if(!pasteBinaryFromExcel)History.TurnOff();AscCommonExcel.executeInR1C1Mode(false,function(){t.ReadMainTable(wb)});if(!this.copyPasteObj.isCopyPaste){ReadDefCellStyles(wb,wb.CellStyles.DefaultStyles); ReadDefSlicerStyles(wb,wb.CellStyles.DefaultStyles);wb.SlicerStyles.concatStyles()}if(pptx_content_loader.Reader)pptx_content_loader.Reader.AssignConnectorsId();if(!pasteBinaryFromExcel)History.TurnOn();pptx_content_loader.Clear(true)};this.ReadMainTable=function(wb){var res=c_oSerConstants.ReadOk;res=this.stream.EnterFrame(1);if(c_oSerConstants.ReadOk!=res)return res;var mtLen=this.stream.GetUChar();var aSeekTable=[];var nOtherTableOffset=null;var nSharedStringTableOffset=null;var nStyleTableOffset= null;var nWorkbookTableOffset=null;var nPersonListTableOffset=null;var fileStream;for(var i=0;i<mtLen;++i){res=this.stream.EnterFrame(5);if(c_oSerConstants.ReadOk!=res)return res;var mtiType=this.stream.GetUChar();var mtiOffBits=this.stream.GetULongLE();if(c_oSerTableTypes.Other==mtiType)nOtherTableOffset=mtiOffBits;else if(c_oSerTableTypes.SharedStrings==mtiType)nSharedStringTableOffset=mtiOffBits;else if(c_oSerTableTypes.Styles==mtiType)nStyleTableOffset=mtiOffBits;else if(c_oSerTableTypes.Workbook== mtiType)nWorkbookTableOffset=mtiOffBits;else if(c_oSerTableTypes.PersonList==mtiType)nPersonListTableOffset=mtiOffBits;else aSeekTable.push({type:mtiType,offset:mtiOffBits})}var aSharedStrings=[];var aCellXfs=[];var aDxfs=[];var oMediaArray={};wb.aWorksheets=[];if(null!=nOtherTableOffset){res=this.stream.Seek(nOtherTableOffset);if(c_oSerConstants.ReadOk==res)res=(new Binary_OtherTableReader(this.stream,oMediaArray,wb)).Read()}if(!this.copyPasteObj||!this.copyPasteObj.isCopyPaste){wb.clrSchemeMap= AscFormat.GenerateDefaultColorMap();if(null==wb.theme)wb.theme=AscFormat.GenerateDefaultTheme(wb,"Calibri");Asc.getBinaryOtherTableGVar(wb)}if(null!=nSharedStringTableOffset){res=this.stream.Seek(nSharedStringTableOffset);if(c_oSerConstants.ReadOk==res)res=(new Binary_SharedStringTableReader(this.stream,wb,aSharedStrings)).Read()}this.oReadResult.stylesTableReader=new Binary_StylesTableReader(this.stream,wb,aCellXfs,this.copyPasteObj.isCopyPaste);if(null!=nStyleTableOffset){res=this.stream.Seek(nStyleTableOffset); if(c_oSerConstants.ReadOk==res){var oStyleObject=this.oReadResult.stylesTableReader.Read();this.oReadResult.stylesTableReader.InitStyleManager(oStyleObject);aDxfs=oStyleObject.aDxfs;wb.oNumFmtsOpen=oStyleObject.oNumFmts}}var personList={};if(null!=nPersonListTableOffset){res=this.stream.Seek(nPersonListTableOffset);if(c_oSerConstants.ReadOk==res)res=(new BinaryPersonReader(this.stream,personList)).Read()}var bwtr=new Binary_WorksheetTableReader(this.stream,this.oReadResult,wb,aSharedStrings,aCellXfs, aDxfs,oMediaArray,personList,this.copyPasteObj);if(null!=nWorkbookTableOffset){res=this.stream.Seek(nWorkbookTableOffset);if(c_oSerConstants.ReadOk==res)res=(new Binary_WorkbookTableReader(this.stream,this.oReadResult,wb,bwtr)).Read()}if(c_oSerConstants.ReadOk==res)for(var i=0;i<aSeekTable.length;++i){var seek=aSeekTable[i];var mtiType=seek.type;var mtiOffBits=seek.offset;res=this.stream.Seek(mtiOffBits);if(c_oSerConstants.ReadOk!=res)break;switch(mtiType){case c_oSerTableTypes.Worksheets:res=bwtr.Read(); break;case c_oSerTableTypes.App:this.stream.Seek2(mtiOffBits);fileStream=this.stream.ToFileStream();wb.App=new AscCommon.CApp;wb.App.fromStream(fileStream);this.stream.FromFileStream(fileStream);break;case c_oSerTableTypes.Core:this.stream.Seek2(mtiOffBits);fileStream=this.stream.ToFileStream();wb.Core=new AscCommon.CCore;wb.Core.fromStream(fileStream);this.stream.FromFileStream(fileStream);break;case c_oSerTableTypes.CustomProperties:this.stream.Seek2(mtiOffBits);fileStream=this.stream.ToFileStream(); wb.CustomProperties=new AscCommon.CCustomProperties;wb.CustomProperties.fromStream(fileStream);this.stream.FromFileStream(fileStream);break}if(c_oSerConstants.ReadOk!=res)break}this.PostLoadPrepareDefNames(wb);if(!this.copyPasteObj.isCopyPaste||this.copyPasteObj.selectAllSheet){bwtr.ReadSheetDataExternal(false);if(!this.copyPasteObj.isCopyPaste)this.PostLoadPrepare(wb);wb.init(this.oReadResult.tableCustomFunc,this.oReadResult.tableIds,this.oReadResult.sheetIds,false,true)}else{bwtr.ReadSheetDataExternal(true); if(window["Asc"]&&window["Asc"]["editor"]!==undefined)wb.init(this.oReadResult.tableCustomFunc,this.oReadResult.tableIds,this.oReadResult.sheetIds,true)}return res};this.PostLoadPrepare=function(wb){if(wb.WorkbookPr&&null!=wb.WorkbookPr.Date1904){AscCommon.bDate1904=wb.WorkbookPr.Date1904;AscCommonExcel.c_DateCorrectConst=AscCommon.bDate1904?AscCommonExcel.c_Date1904Const:AscCommonExcel.c_Date1900Const}if(this.oReadResult.macros)wb.oApi.macros.SetData(this.oReadResult.macros);wb.checkCorrectTables()}; this.PostLoadPrepareDefNames=function(wb){this.oReadResult.defNames.forEach(function(defName){if(null!=defName.Name&&null!=defName.Ref){var _type=Asc.c_oAscDefNameType.none;if(wb.getSlicerCacheByName(defName.Name))_type=Asc.c_oAscDefNameType.slicer;wb.dependencyFormulas.addDefNameOpen(defName.Name,defName.Ref,defName.LocalSheetId,defName.Hidden,_type)}})}}function CSlicerStyles(){this.DefaultStyle="SlicerStyleLight1";this.CustomStyles={};this.DefaultStyles={};this.AllStyles={}}CSlicerStyles.prototype= {concatStyles:function(){for(var i in this.DefaultStyles)this.AllStyles[i]=this.DefaultStyles[i];for(var i in this.CustomStyles)this.AllStyles[i]=this.CustomStyles[i]},addCustomStylesAtOpening:function(styles,Dxfs){if(!styles)return;this.DefaultStyle=styles.defaultSlicerStyle||this.DefaultStyle;for(var i=0;i<styles.slicerStyle.length;++i)this.addStyleAtOpening(this.CustomStyles,Dxfs,styles.slicerStyle[i])},addDefaultStylesAtOpening:function(styles,Dxfs){for(var i=0;i<styles.slicerStyle.length;++i)this.addStyleAtOpening(this.DefaultStyles, Dxfs,styles.slicerStyle[i])},addStyleAtOpening:function(styles,Dxfs,style){if(null===style.name)return;var elems={};for(var i=0;i<style.slicerStyleElements.length;++i){var elem=style.slicerStyleElements[i];if(null!==elem.type&&null!==elem.dxfId)elems[elem.type]=Dxfs[elem.dxfId]}styles[style.name]=elems}};function CTableStyles(){this.DefaultTableStyle="TableStyleMedium2";this.DefaultPivotStyle="PivotStyleLight16";this.CustomStyles={};this.DefaultStyles={};this.DefaultStylesPivot={};this.AllStyles= {}}CTableStyles.prototype={concatStyles:function(){for(var i in this.DefaultStyles)this.AllStyles[i]=this.DefaultStyles[i];for(var i in this.DefaultStylesPivot)this.AllStyles[i]=this.DefaultStylesPivot[i];for(var i in this.CustomStyles)this.AllStyles[i]=this.CustomStyles[i]},readAttributes:function(attr,uq){if(attr()){var vals=attr();var val;val=vals["defaultTableStyle"];if(undefined!==val)this.DefaultTableStyle=AscCommon.unleakString(uq(val));val=vals["defaultPivotStyle"];if(undefined!==val)this.DefaultPivotStyle= AscCommon.unleakString(uq(val))}},onStartNode:function(elem,attr,uq){var newContext=this;if("tableStyle"===elem){newContext=new CTableStyle;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.CustomStyles[newContext.name]=newContext;openXml.SaxParserDataTransfer.curTableStyle=newContext}else newContext=null;return newContext}};function CTableStyleStripe(size,offset,opt_row){this.size=size;this.offset=offset;this.row=opt_row}function CTableStyle(){this.name=null;this.pivot=true;this.table= true;this.displayName=null;this.blankRow=null;this.firstColumn=null;this.firstColumnStripe=null;this.firstColumnSubheading=null;this.firstHeaderCell=null;this.firstRowStripe=null;this.firstRowSubheading=null;this.firstSubtotalColumn=null;this.firstSubtotalRow=null;this.firstTotalCell=null;this.headerRow=null;this.lastColumn=null;this.lastHeaderCell=null;this.lastTotalCell=null;this.pageFieldLabels=null;this.pageFieldValues=null;this.secondColumnStripe=null;this.secondColumnSubheading=null;this.secondRowStripe= null;this.secondRowSubheading=null;this.secondSubtotalColumn=null;this.secondSubtotalRow=null;this.thirdColumnSubheading=null;this.thirdRowSubheading=null;this.thirdSubtotalColumn=null;this.thirdSubtotalRow=null;this.totalRow=null;this.wholeTable=null}CTableStyle.prototype.initStyle=function(sheetMergedStyles,bbox,options,headerRowCount,totalsRowCount){var r1Data=bbox.r1+headerRowCount;var r2Data=bbox.r2-totalsRowCount;var bboxTmp;var offsetStripe;var stripe;if(this.wholeTable)sheetMergedStyles.setTablePivotStyle(bbox, this.wholeTable.dxf);if(r1Data<=r2Data){if(options.ShowColumnStripes){if(this.firstColumnStripe){offsetStripe=this.secondColumnStripe?this.secondColumnStripe.size:1;stripe=new CTableStyleStripe(this.firstColumnStripe.size,offsetStripe);bboxTmp=new Asc.Range(bbox.c1,r1Data,bbox.c2,r2Data);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.firstColumnStripe.dxf,stripe)}if(this.secondColumnStripe){offsetStripe=this.firstColumnStripe?this.firstColumnStripe.size:1;stripe=new CTableStyleStripe(this.secondColumnStripe.size, offsetStripe);if(bbox.c1+offsetStripe<=bbox.c2){bboxTmp=new Asc.Range(bbox.c1+offsetStripe,r1Data,bbox.c2,r2Data);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.secondColumnStripe.dxf,stripe)}}}if(options.ShowRowStripes){if(this.firstRowStripe){offsetStripe=this.secondRowStripe?this.secondRowStripe.size:1;stripe=new CTableStyleStripe(this.firstRowStripe.size,offsetStripe,true);bboxTmp=new Asc.Range(bbox.c1,r1Data,bbox.c2,r2Data);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.firstRowStripe.dxf, stripe)}if(this.secondRowStripe){offsetStripe=this.firstRowStripe?this.firstRowStripe.size:1;stripe=new CTableStyleStripe(this.secondRowStripe.size,offsetStripe,true);if(r1Data+offsetStripe<=r2Data){bboxTmp=new Asc.Range(bbox.c1,r1Data+offsetStripe,bbox.c2,r2Data);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.secondRowStripe.dxf,stripe)}}}}if(options.ShowLastColumn&&this.lastColumn){bboxTmp=new Asc.Range(bbox.c2,bbox.r1,bbox.c2,bbox.r2);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.lastColumn.dxf)}if(options.ShowFirstColumn&& this.firstColumn){bboxTmp=new Asc.Range(bbox.c1,bbox.r1,bbox.c1,bbox.r2);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.firstColumn.dxf)}if(this.headerRow&&headerRowCount>0){bboxTmp=new Asc.Range(bbox.c1,bbox.r1,bbox.c2,bbox.r1);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.headerRow.dxf)}if(this.totalRow&&totalsRowCount>0){bboxTmp=new Asc.Range(bbox.c1,bbox.r2,bbox.c2,bbox.r2);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.totalRow.dxf)}if(this.firstHeaderCell&&headerRowCount>0){bboxTmp= new Asc.Range(bbox.c1,bbox.r1,bbox.c1,bbox.r1);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.firstHeaderCell.dxf)}if(this.lastHeaderCell&&headerRowCount>0){bboxTmp=new Asc.Range(bbox.c2,bbox.r1,bbox.c2,bbox.r1);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.lastHeaderCell.dxf)}if(this.firstTotalCell&&totalsRowCount>0){bboxTmp=new Asc.Range(bbox.c1,bbox.r2,bbox.c1,bbox.r2);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.firstTotalCell.dxf)}if(this.lastTotalCell&&totalsRowCount>0){bboxTmp= new Asc.Range(bbox.c2,bbox.r2,bbox.c2,bbox.r2);sheetMergedStyles.setTablePivotStyle(bboxTmp,this.lastTotalCell.dxf)}};CTableStyle.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val){this.name=AscCommon.unleakString(uq(val));this.displayName=this.name}val=vals["displayName"];if(undefined!==val)this.displayName=AscCommon.unleakString(uq(val));val=vals["pivot"];if(undefined!==val)this.pivot=AscCommon.getBoolFromXml(val);val=vals["table"]; if(undefined!==val)this.table=AscCommon.getBoolFromXml(val)}};CTableStyle.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("tableStyleElement"===elem){newContext=new CTableStyleElement;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else newContext=null;return newContext};function CTableStyleElement(){this.size=1;this.dxf=null}CTableStyleElement.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["type"];if(undefined!==val){var tableStyle= openXml.SaxParserDataTransfer.curTableStyle;if("wholeTable"===val)tableStyle.wholeTable=this;else if("headerRow"===val)tableStyle.headerRow=this;else if("totalRow"===val)tableStyle.totalRow=this;else if("firstColumn"===val)tableStyle.firstColumn=this;else if("lastColumn"===val)tableStyle.lastColumn=this;else if("firstRowStripe"===val)tableStyle.firstRowStripe=this;else if("secondRowStripe"===val)tableStyle.secondRowStripe=this;else if("firstColumnStripe"===val)tableStyle.firstColumnStripe=this;else if("secondColumnStripe"=== val)tableStyle.secondColumnStripe=this;else if("firstHeaderCell"===val)tableStyle.firstHeaderCell=this;else if("lastHeaderCell"===val)tableStyle.lastHeaderCell=this;else if("firstTotalCell"===val)tableStyle.firstTotalCell=this;else if("lastTotalCell"===val)tableStyle.lastTotalCell=this;else if("firstSubtotalColumn"===val)tableStyle.firstSubtotalColumn=this;else if("secondSubtotalColumn"===val)tableStyle.secondSubtotalColumn=this;else if("thirdSubtotalColumn"===val)tableStyle.thirdSubtotalColumn=this; else if("firstSubtotalRow"===val)tableStyle.firstSubtotalRow=this;else if("secondSubtotalRow"===val)tableStyle.secondSubtotalRow=this;else if("thirdSubtotalRow"===val)tableStyle.thirdSubtotalRow=this;else if("blankRow"===val)tableStyle.blankRow=this;else if("firstColumnSubheading"===val)tableStyle.firstColumnSubheading=this;else if("secondColumnSubheading"===val)tableStyle.secondColumnSubheading=this;else if("thirdColumnSubheading"===val)tableStyle.thirdColumnSubheading=this;else if("firstRowSubheading"=== val)tableStyle.firstRowSubheading=this;else if("secondRowSubheading"===val)tableStyle.secondRowSubheading=this;else if("thirdRowSubheading"===val)tableStyle.thirdRowSubheading=this;else if("pageFieldLabels"===val)tableStyle.pageFieldLabels=this;else if("pageFieldValues"===val)tableStyle.pageFieldValues=this}val=vals["size"];if(undefined!==val)this.size=val-0;val=vals["dxfId"];if(undefined!==val)this.dxf=openXml.SaxParserDataTransfer.dxfs[tableStyle.pivot?val-0:val-1]||null}};function ReadDefTableStyles(wb){var stylesZip= "UEsDBBQAAAAIALZ9okpdRKh71y8AAPdGCAAVAAAAcHJlc2V0VGFibGVTdHlsZXMueG1s7FZRjpswEP2v1DtY/u8SCCRGCt2PVStVaququxcgwQRLxkZmyG56tX70SL1CDVliDK3CtkIVq40UyR783psxM+j9/P5jc/2Qc3SgqmRSRNi9WmBExU4mTOwjXEH6huDrt69fbQpFSwp38ZbTWzhyWuogQhsT+EQTVuUeaeL6SfKQlmgnKwERXuMm2sbbTb1NGedmX0eKGIAq8V4/QI/ru2NBI1xKzpKWyRDsbySXCkFGc30oxAhYrbm4CkL9W5Jw5YXEXfgkwE4fvP1r8Mbp5NktyDEVNVtd70vxvy1eCrBZtz2VXTc9Fzu2koY/a6UaLFVClU0AskAlHLmG583IWU0xkAgHr04TWKInkRlc5Tjm6UdrrYeDuCtCSOgvXd/3LozWRfD40brUHJym0HYHZExc6A2T1lKntQ4CErih5+u/O0irprZDiu2zqdQa7kHjTyNmJsJcLYDMJ1I7kdvBA1XAdjGfSLKlt8OZVOybFDCZrBEY9cFp12W7AeM2WifhYpTQNK54x4pEuO9CwvOpL+wg4fGUWX+su8tdtaVaUkjEdaFDY4NRoQnq0rHxNShhZcHj42cDQieaEwx5xKhYOu84zakABM036D6TnDZwjPQVfEhqcmcMMqNxQtVXeX8GrsYBQULMu7hgHC5lqoQbyatcnKH+OCiPB8jlE0R1sregWGHuyHtyyj2CbtNuHIM/9yP0Ha8z7Iw/WOH1f7bC5F/cIJm5FZ5X8bM0qHOzwuTFCv9it45tAABhIAZuhX//yZiAhqAPgYzgwtKdWStCYd1JYVkpLCeFZaWw/BRWDoX1LYXZpDBN4ccpzILCI5nCRDRIcQrXii8J1GoUpil8Zq0IhbmTwlgpjJPCWCmMn8LkUJhvKTzZrYMaAGIYBoKgLjZ/aIegn6Zy6jQQ9rHScJPCHAo3pzAXFEYxhZnRIM0p7BVvCVQ3CnMofGatDIV5J4UppTCVFKaUwtRTmDUU5rMUxiaFMRRuTmEsKBzFFEZGgzCnsFe8JVDdKIyh8Jm1MhTGnRSGlMJQUhhSCkNPYdRQGM9SODYpHEPh5hSOBYW/YgpHRoNhTmGveEugulE4hsI/e/eOw0AIAwH0RJEwOHzukz5V7p9NpCgNyBIyLHjnABSMNfCo0KpWP4V5TQrzVArzTArzVArzfArzORTmy1I4dFI4gMLGKRwaFPYnU9j9uno7ysql5OhjjMmlcE9FuLOE1TtgeLftb4nU3ThM4LB6uYg/puXELvHdR09CuYTVJ4J4gHr1aTvAr6OQOlKixrnpO7npwU3j3PQNbtJC3FziSvi2G9tXkYub7AsZ6Csg/CKpCO5+PF/HUbSyu83M6T+Mhvfkd5Asvv6RrP22Uw3KADGpk5gEYhonJjWI6UBMENMKprKYWEYqtVRATMtzAjFBTDViuk5iOhDTODFdnZhUQEwQ0wqmkphYQiq1VEBMy3MCMUFMLWJS6SMmFRDTNjGpNIiZQUwQ0wqmophYRCq1VEBMy3MCMUFMNWLmTmLixyzrxMwNYiYQ883euVs3DANBsCWKxIeox6H7z+0cgqCHo3QfTgEIsJfMJLsgZhSYytPELPQD3CQVENPKnUBMEPMyxKyLiMkSVXTErAPELCAmiBkFptI0sUQqz1IBMSPfCcQEMS9DzLKImCw8RUfMMkDMDGKCmFFgap4YqTxNBcSMfKd7Iaa7OijLIEwl1HcBPi8CPLtU0QE+DwBee5eqSfrom/Myfl+ft40/1EGRinoqc2/5R5Sf39eMst1KW7SKsN4/hzVrufwCkt2K9rndCqlHbB/0iC22R6RFj2DUK7pHpIFHaI96nRKUPp17hK/P2+YROr9IRT0VPML8LfCI7gISjzjxiIAecSx6BIto0T3iGHiE9iJalaB0de4Rvj5vm0codiMV9VTwCPO3wCO6C0g8ouIRAT1iX/QIpu6ie8Q+8AjtqbsiQeni3CN8fd42j9DeRyrqqeAR5m+BR3QXkHhEwSMCesRj0SPYM4zuEY+BR2jvGWYJSmfnHuHr87Z5hIpGUlFPBY8wfws8oruAxCMyHhHQI7ZFj2C0MrpHDEYrtTcrk4Skk3ON8PV52zhCDSepqKeCRpi/BRrRXUCiEQmNiKcRi7ukzJIGl4jBKqmlUdIjtXaWvZRSt3rkOmnxmL32YBHevm+bR+haJRX1VPAI87fAI8x3fmMS6iaxOD/L+mxwkxiMz1Y7pa8WGuf+2Lub3LZhIAzDV+kRTIm/52m7bLvo/YGiCoomyKSqx57h8NOXdQyKkGk+q3eOc83NqzRyfhdCr/ScQQXjUoQM06T1mBUgn919jNFK6SWNLaex6ccI6Fc7nzBgsNjJ6IFnrCbr/xyQ+kWxhwo0nS05dhbclk22ZY0TAo1QITvONTePI77VbNkvZcswnVJnW3ZXW3ZPW3ZXW/YZtuxXtWXV2ZLzZsFtWWVbljhxyAhlquNcc/M44lvNlu1StgzTrnS2ZXO1ZfO0ZXO1ZZthy3ZVWxadLTkKFdyWRbZljhMMjFArOs41N48jvtVsWS9lyzA9Q2dbVldbVk9bVldb1hm2rFe1ZdbZkuMxwW2ZZVvucSJyEQo2x7nm5nHEt5oty6VsGaZx52zL4mrL4mnL4mrLMsOW5aq2VM5M5MhEcFvusi23OGWxCFmT41xz8zjiW82W+VK2DBM+c7ZldrVl9rRldrVlnmHLfFVbKufocYweuC0/mqIXqDgVInVxnGxuH0l9q/kyXcqXYYJYzr40QOTzpWjAQTvzYcMu6WDHuWbgsHs31uz4bm2JASAGgICptRrq/jcAFGeDby/2b8ePzckeo4UZn1D0Mcj2GLR5VErTv0p9AHIYBiAHqP9eLvR7/Xd86tNG/8H67w/0RP/dGOlhpAdYZdN5tFSkx8d/Hc9/3SCtY9DPMYjk2PivG/qvQ/vvpvMf55GC++8m+i8NhnQY0gFW2XQeLRXS8fFfw/NfM8jfGDRuDEI2Nv5rhv5ryP5LQ+W/xFGS2P5LQ/ZfZ+yGsRtglU3n0VKxGx//VTz/VYNEjUGHxiA2Y+O/aui/Cu2/rvMfBwCC+6/L/msM0jBIA6yy6TxaKkjj47+C579ikJExaMUYBGFs/FcM/Veg/dd0/uOQPnD/Ndl/ldEYRmOAVTadR0tFY3z8l/H8lw1SLwY9F4Noi43/sqH/MrT/qs5/HKQH7r8q+68w7MKwCw0YyoDpAgZMeAZkqeW5BkwfGpANmH8bsOgMyIF34AYssgGzZMB0ExDo10uQT97iT/R4rQHnedYE3nRpLZWT8W4EjvNoEmQjkPWZt/JcX3BZENw4F1zWCm5oBdeVgmt6wVW14IpGcPfK8efXzz++f3n/8f1RAG73rG9FyCwTUpxrNywF2cMJskcTZA8myMBtE8SVEII03oLs59klSEGyX4MmyF0nyJ2CpCBNBbnLgtzcBdnCCbJFE2QLJsjAdRTElRCSNt6CbOfhJkhBsoCDJshNJ8iNgqQgTQW5yYJM7oKs4QRZowmyBhNk4L4K4koIURxvQdbz9BOkINnQQRNk0gkyUZAUpKkgkyzIm7sgSzhBlmiCLMEEGbjQgrgSQlbHW5DlPB4FKUhWeNAEedMJ8kZBUpCmgpTHqQx3QOZwgMzRAJmDATJw4gVxJYQujzcg83l9ChKQzPiAAXKo/DjIR/LRko9D1GN312MKp8cUTY8pmB4Dx2EQV0Io+njr8TxclSD1yAAQmB67So+deqQeLfXYRT3OnuQyHolZj8VL3mtt/j4+jFeVyS2P0Vr6/df62IUrlc/w8gxA7aVnbtw/8iJvf833zEbO33/WDTrhnBPsxmETbVQn26g/woO+uI3W2vx9V2MP4JKFn2H9qlCfaqNuYqM13zPrL6/uO5WNOAME20ZVtFGZbKP2CA/a4jZaa/P3XY0tgEsWfob1ezltqo2aiY3WfM/smry671Q2+sXeueRWEQNRdCsRK+iPv3PEiBkrSOAJIkJAkLB+yEuCWjw/HFfTct3qm3Hccbn8OSfqdrE2hm02KpfGcJ3ZKKzBgwDORljBtx2NQQGXAPcB/yaY0JWNwiZshJln3tixOO9EbOTIRqbZqFzzYe7MRn4NHnhwNsIKvu1o9Aq4BLgP+Hec+K5s5DdhI8w88y6KxXknYqOZbGSajcrVDKbObOTW4IEDZyOs4NuORqeAS4D7gH99h+vKRm4TNsLMM69ZWJx3IjaayEam2ejMPf2d2WhYbCmjyzknF90QnZ/CVPlyudYagY7Qwoe8NUDT/QTQV0r8J24ZN+EWzTnjZ/yLXxbRyUg6MU0nJ3fAv778/nkc9Xwp5nPOeU45TDmNg0uVW50rjRHYBCt4SF7ofnRruzmp601JuX43BNi61faFp0YoOR40rVDy0OhiJJSYhZLjrChDyaDnNeT2czmAQwlW8JCoQCjRBCUvqGANtm61fT6gFkoGEZQMhBLTUDKUoCTrecWl/Vh24EyCFTwkKZBJNDFJfVajrVttr6ZpZZIsQZJMIrFMJLkEJEnReyWzyzmFKYQQhzj7WPk/b6U1xP+A0cKHRAVCiSYoqb8uxTfCrGJJkmBJIpZYxpJUwhI1ZRnKb9CX13a9LcLGhhS67opOqkbyBbWavhw3/X+zyVCs1mS2KBdCChfFsaQ5fHjEPpL4F2sVkihqW09iXRGaUsjSeCuUoeFFeXE+Hp9hxtpyfaXY1ZYo0BbWTLGtLbGkLWoqpghwJWFrC1Louk9bVSNJbbGaQmpLNYlybUnUlv4JpLZ0T0GqrxS72hIE2sJyRra1JZS0RU0xIwGuRGxtQQpd92mraiSpLVZTSG2pJlGuLZHa0j+B1JbuKYj1lWJXW7xAW1hpzLa2+JK2qKkzJsCVgK0tSKHrPm1VjSS1xWoKqS3VJMq1JVBb+ieQ2tI9BaG+UuxqixNoC4sA2tYWV9IWNSUABbjisbUFKXTdp62qkaS2WE0htaWaRLm2eGpL/wRSW7qnwNdXil1tmQXawvqctrVlLmmLmuqcAlxx2NqCFLru01bVSFJbrKaQ2lJNolxbHLWlfwKpLd1T4Oorxa62TAJtYelc29oylbSld2m68fm0aqSVZVNIacEJXPtJq2YcKSw2E0hdeWkK2+56rTemsFBYdiMsi4XgXM7Zu+n3z+xj8ul8duqNDX/CL6l3yRrctjXnqdrlcVYt5t5ULOUwDq9W79j1+0w7XOgpLuSUWcgJ6S/teursOnjuTmZGWUMfXsTpd5+ub5VRusqJ3VCHra3xevH6efh+d/3+8mZNSp+fUUiqcn04pcJXF8dfWhrEOCwV4rnVk0I8truYxGVXstQiktAiosAi2sTlx+H919sPpzLgW5oXbcA19P3d/dVJ7HNLD0oPmBpt6P7qIXHXtx9PhKbyhG+XHw9vrg83H95eXh1ufvxpPrT7UEF9ykoUN1aipGZvTmugI+mGDgxRgVUirKmz6+C5O5kZZQ19QFUilRO7XYkSlaiLEkWpEkUqEZUIRIniGSUKGytRVLM3xzXQEXVDB4aowCoR1tTZdfDcncyMsoY+oCqRyondrkSRStRFiYJUiQKViEoEokThjBL5jZUoqNmbwxroCLqhA0NUYJUIa+rsOnjuTmZGWUMfUJVI5cRuV6JAJeqiRF6qRJ5KRCUCUSJ/Roncxkrk1ezNfg10eN3QgSEqsEqENXV2HTx3JzOjrKEPqEqkcmK3K5GnEnVRIidVIkclohKBKJE7o0Tzxkrk1OzNbg10ON3QgSEqsEqENXV2HTx3JzOjrKEPqEqkcmK3K5GjEnVRolmqRDOV6Bd7d7MbRQzDAfxduEMnmSR2HoBX4M4BCSQQEhIXnp62EmVVMqRxpp44+SNxqbSbzafj367GSImMpET7QUrkXyElKj7zsVDoQfVo3jpqjmxDF+CxkaWYzYcsLZyFu45jaYohHuAjWE2DhlzTTc9ar78aedDr5UFemgd55EHIg4zkQf4gD3LFPGg/yIPq1RvqZ4mr1G4QhBwnDTmL93LgNGiAOxQ6230vFDweWufKuPZztSvFsJrnc885U4wcXfbh/r8rVskqFG56pdYe37t+eMsbq1ceuv4x+QM/51qy0MrrX7LQ5K2VFxpmX1Trq386Sltxnhg1e5Wxh516V9iqd2WsuMNAWx9oh6IPKwXDgjT2tTgzQroSQu4vQEhxxTznpQrpnJAh3dZVvy731q9jASU+41Dq1MjUq5GxWyNDk+jevkWbqT5u9x8H7+BFJCoW1Q8fv/78dK6oHtUy3CCq6/YSyIjOqokqD5SturXLcpxyt2dVUWVNUWWzomqjTIZgoaklkWxYVG3MfttWbBTVeWIUoA+iOtdAO9SMWikYikSVFxXVTSqqG0QVogpR1RfVrSyqLkNU1+0lkBGdVRNVGihbdWtX9Trlbk+qokqaokpmRdVGlS3BQlNLIsmwqNqY/bat2Ciq88QoQB9Eda6Bdig5uVIwFIkqrSmqLgtF1WWIKkQVoqouqi4fiCpDVNftJZARnVUT1TRQturWLgp6yt0+qYpq0hTVZFZUbRTpFCw0tSQyGRZVG7PfthUbRXWeGAXog6jONdAOFatXCoYiUU2LiipLRZUhqhBViKq+qPKBqBJEdd1eAhnRWTVRjQNlq27tmuKn3O2jqqhGTVGNZkXVRo1vwUJTSyKjYVG1MfttW7FRVOeJUYA+iOpcA126deE4nDYYikQ1LiqqJBVVgqhCVCGq+qJKB6KaIKrr9hLIiM6qiWoYKFvVvtuHHlENY4pqUBXVoCmqwayohp4kMoyZRAbVJDIYFlUbs9+2FRtFdZ4YBeiDqM410KVbF47DaYOhSFTDoqKapKKaIKoQVYiqvqimA1GNENV1ewlkRGfVRHX708232zsfciZyD/+I8z47qNa7fjuu0tf2X+xlk7mHnDn5lBJttEfKopu9vDkJqMpbG1tUbz+6e3aaVDL52qsHWW21PVBfa/LGRhdVK7Nf2I2i+SjtxWmCFKAPojrXQF937Qrvcua8O47eJd7Dtr9/W0HV+usHCYiFo1oQEuXNiWVV3uTMtBqltBpBq6BV0Ko+rcYDWg1FWvVv1NKB3PONYj7vG8XbAxidN2aT/7aEWcOsFQZe8IPR6otHn7UXXOa/PQaD/192c//PJE5rr0lT+5trI5z+9k5XnP5kLiv8NFnQmtA3BfYn+7BC/JO3Vl43t3/8/P3Hl1/350Ml0ZU3+reBMb70PWWOpb4rPxzkwts/1ANBZK7H5k7jEoQN8cJQZUtrqhRKquRfoEpBrEpOrEqbUJVyFypxLypRPyqlTlSKvagUulFpb/gI05JQOCCh/WoS4p78mo2TkK3OAxcwa1PMWjsJMUiIlUmIdUmIlUmIbZEQq5IQWyIhViUhvoKEeHUSYl0SYpDQ01DUY/OVJMQgodNIaJeS0A4SAgmBhBpJaD8gIX81CVFPfk3GSchW54ELmLUpZq2dhAgkRMokRLokRMokRLZIiFRJiCyREKmSEF1BQrQ6CZEuCRFI6Gko6rH5ShIikNBpJOSlJORBQiAhkFAjCfkDEnIvIaGFyqU/npjoPHABszbvrLWTUAIJJWUSSroklJRJKNkioaRKQskSCSVVEkpXkFBanYSSLgklkNDTUNRj85UklEBCp5GQk5KQAwmBhEBCjSTkDkhoOyChVcvfL137/zd795IjRQyDAfgqiBN0VdlxsmbDNRCwQEJCQsD5QTwahAKhHeNH4gPUeCpOp/N/M5ITF7JrO3TtcRLCJCFUJiHUJSFUJiGMRUKoSkIYiYRQlYTQgoRwdxJCXRLCJKH7Uoy/my1JCJOExEjoxiWhW5JQklCS0IMkdOuTUPuDCO06vnvr2eVpC9m1Hbr2uAhBihAoixDoihAoixDEEiFQFSGIJEKgKkJgIUKwuwiBrghBitB9KcbfzZYiBClCUiLUmCDU0oPSg9KDHvOg1ueg+gcO2nf28OajlxMXsm+b9K1zfet3bfys954xSUh+oL5YOXkQuklHPj8j43m9l58dLVXQIQoJ7B6RYnwS4tfcQoSO/3EIHD+d7bcdvhv7DFai9708flQBihitTSd6zIkq04lqOlE6UTrRY05U+05EXSe6nspeqBhTufk3Kn61bz/cx3zb1dZm8cnwne6zWvJfroeOroPD8cb9to0fNmrbeD+tMyn631bK0Sz2QGa5njVvfrIorKXSf4y1aRyWKeaOBpsmDTYDGmxL0+Crdx+/hKYYM+fVD1P2n9PGz/IvaSvsaMYOZrw28346fu9gxEg9YrzGxEhsYjzZxHgwifG4TRljYxgjGymff33tZ6/fvu0QJc8Xy6wv4uMLcPfBREpRpKQ+UhZ1pKyqEFdDIeXCayM+PncGKatXpKyrI2WdoYTqFSn/tp/WmV0uslKJlImUO5ws6yBl1UTKGggpqyZSVgOkrOakY42UdVOkrBNIWR0jpf2ONkHKuitSFiZSlkTKRMpESm2kLH2kRHWkJFWIo1BIufDaiA90nkFK8oqUtDpS0gwlkFek/Nt+WmeavshKJVImUu5wsqyDlKSJlBQIKUkTKckAKcmcdKyRkjZFSppASnKMlPY72gQpaVekRCZSYiJlImUipTZSYh8pQR0piyrElVBIufDaiI8Yn0HK4hUpy+pIWWYooXhFymKBlCUiUpZEykTKHU6WdZCyaCJlCYSURRMpiwFSFnPSsUbKsilSlgmkLI6R0n5HmyBl2RUpgYmUkEiZSJlIqY2U0EfKSx0pURXiMBRSLrw24kPvZ5ASvSIlro6UOEMJ6BUp0QIpMSJSYiJlIuUOJ8s6SImaSImBkBI1kRINkBLNSccaKXFTpMQJpETHSGm/o02QEndFyouJlFciZSJlIqU2Ul59pDzVkRJUIQ5CIeXCayN9jYIZpASvSAmrIyXMUAJ4RUqwQEqIiJSQSJlIucPJsg5SgiZSQiCkBE2kBAOkBHPSsUZK2BQpYQIpwTFS2u9oE6SEXZHyZCLlmUiZSJlIqY2UZx8pD02kHIcr1uWOX84fUy69Osun/PsOCNUVX/fjX1/+gtZqOUspdKMLqQ2aOng6clMH11NGVceU+dffOi0zLXOh42UdzTx+RuHfNhoDM9m13Fnm4Fdl3Oc4tdjfMPySm0DmnxdgacccvHbvFB0/aq6Y5ruZsXv93xL9KubBVMwjFTMVMxVTWzGPu2L++pE/a1cxb0+5527789+yhhfsrClZ00gW28y/QDapf4HMl98tg/24RXn+qEnWFG1y6/XS2+IKCWkLspdEYKnJ+1EbMJHw7uM3eYw2n16///Dm5Yu3Mz/328+IHei+XwV7ge72l0D39bEnZ+UGusbNc5UZ5+jhONKJQpwgiLNBEBhJ7rc3uCbD4DkbBg9mhOJnoE7Y6WUgEs5AdeLykDUHNSNkoDoTA2rwDOTs5TMD+fqoSdYUbXLt9dLb4gploBpkL4lkoCqfgap4BqryJ0n9TxmoLpyBiJmBKDNQZqAQGYj6GagIZyCauDxkzUHNCBmIZmIABc9Azl4+M5Cvj5pkTdEmU6+X3hZXKANRkL0kNB1ffga+eAYi+ZOE/lMGooUzUGFmoJIZKDNQiAxU+hkIhTNQmbg8ZM1BzQgZ6DN7Z5MaSQxD4bv0Capc/qvjzGIgAxkC2QzM6RO6Fw1BhbtkuVuyXpZZlCM//+h9AT9lwcqui4cH0rXVJMcUFTlTWmqbXKsZ6fmFHigPiNgV90B5QNztIA+UJ/ZAiemBEjwQPJAJD5RoDxSFPVDqaB4wZmNMCx5IWW6j6+LhgXRtNckxRUVOlJbaJtdqBGt6oQdKAxL8xD1QGpCmN8gDpYk9UGR6oAgPBA9kwgNF2gNtwh4odjQPGLMxpgUPpCwWynXx8EC6tprkmKIiR0pLbZNrNeEtvtADxQEBQeIeKA4I6xnkgeLEHmhjeqANHggeyIQH2mgPFBgeiPu6LN0yYCTeSPxLkvVcN/8C5Q93/TjCNJQYPHXlw+L5ONF+CKr1rXGBug2vr2a1LpMUZj2OSAPJH3BiZxmYzjLAWcJZmnCWgXaWdG7iesEjzX0vnh6GxRuII4Qk6Owx0+o9FPlQs7rXuGfHG87LF8ab7ch92ifKDAa0+Zj6c+SR2mhziCuBd/OqBms+tVXUWOlFM2Sy3dpGM+uFGU+3MAnL3oVJai8mKf2YJHdiksTEJAiXE0U9B+FyywHqwVv0fQ87W0Y9kAQAAjOtHvWQ79GrCx1w7nZnLx+ox7P6pnGAjTbn3JUA1GNJW0WNlV7UszBRzwLUA9TjEvUsJOpZ9wPUg8iNvvfrLaMeSAIAgZlWj3rI2A112SrO3e7s5QP1eFbfNA6w0eacuxKAeixpq6ixUot61p2HetYdqAeoxyPqWXca9dQD1INkob6YDsuoB5IAQGCm1aMeMl1IXYSUc7c7e/lAPZ7VN40DbLQ5564EoB5L2ipqrPSinspEPRWoB6jHJeqpNOopB6gHAWp9aUSWUQ8kAYDATKtHPWSImrqkPOdud/bygXo8q28aB9hoc85dCUA9lrRV1FjpRT2FiXoKUA9Qj0vUU2jUkw9QD3Ii+0LXLKMeSAIAgZlWj3rIrEh1gaDO3e7s5QP1eFbfNA6w0eacuxKAeixpq6ix0ot6MhP1ZKAeoB6XqCfTqCcdoB6/7UvjWJZIMUbQjRNVZsIQmGqdxMdKHCxONDAiMCKob58jqJvNxjXSf127wkRW5NXUkOklRYlJihJIEUiRS1KUaFIUSVIULvNZMsRBPnSdiFs+fg/TnivSDLv4U7ENTW1D7ipK+/fPVvcc9rousSYO/eGPJnIYyMKBXR4B7LTRnz1Gn6UFf+nQMgmNRiuIPdjQXXjH6LjOHljaf6++VPCg4X+UXqiMb7bX45mP6v5fDiQeLPH9l28fn3/+f8/9r/ceE3H/isQCostpgPzWUmKVze/+7wPYp3GRonGhTePiQzTu39vH++9rFXec8n06KAZ5Pwha7WKAhckAzQG82wduJTAh3m2bfh5/JHSzxJXNEiVpXqRp3gaah8RP3TSv2qF5FTQP27B/FT2VJNSLKZpX5TFRFWdBdYBMKrV4Js2rp2ke9uAgmlcd0Lw6AvXUAainjkA91QPNg8QT0bz6cppXvdK8jUnzNtA80DzQPAbN22iaF0DzEOqqm+YVOzSvgOZhG/avoqeShHIxRfOKPCYq4iyoDJBJpRbPpHnlNM3DHhxE84oDmldGoJ4yAPWUEaineKB5kHgimldeTvOKV5oXmDQvgOaB5oHmMWheoGneCpqH3N4v9u5lx4kYiALoryC+IO72cw1CLFizHyBCiCAhXt+PAEEgsmL6uu12ue7sMx677LTvmZZqbM3zcjTPU/N4DOt3UVdJ8I9FaZ7fn4n87hbkG5RpyFr01Dy/WfN4Bhtpnlegeb4F9fgG1ONbUI/XoHks8USa5w/XPK9V8wyoeYaaR82j5gGaZ/Kad6LmsTXz2Jrn5Gieo+bxGNbvoq6S4B6L0rwGTLS/BTUo05i16Kl5brPm8Qw20jynQPNcC+pxDajHtaAep0HzWOKJNM8drnlOq+adQM07UfOoedQ8QPNOWc1LxDw23x4b86wczLPEPB7D+l3UFRLsY1GYZ/dXIrs7BdkGZRqyFj0xz27GPJ7BRphnFWCebSE9toH02BbSYzVgHks8EebZwzHPKsW8hFleIuWR8kh52ykvZSUvZiXPUPIU90cfzvKENuXn9t5hew+zkbJHCR9uxPakf/+99kfVnF2WZVldiA5rPIEPh9gMPhpSe3y4EZtZFPYqUHt8uHztee6byZy5ZtCbL2sFZFeYPAA92GiAAOGDITSEj6aBBbmNBthGkujRtAfG8l18ZmGMOWE0RWGMsDCeUGFMIDBGHBhDFTD6WmB0lcBoa4Fx3fALprfBmLXBULDB/aGnwV08jcdZIma58YaVxoAwhXPa2f1SzZtxqeWbcbhtpK5vHKWebxylBm8cwaOVL+ffzp++vHv9cGk05O9fD1yawWHLd2ae43/OsZK9/rv6s/wzqPgPn03bgtcpoMBctIMAJSl9QytgfhLm9BPFb1nd4YsV4AvMUD4+vD0/e3e+vHnx8Op8+bwRUK4ff/lw+Xr+vCOehCye+O54Ehs05h8PT0TMcuPTPoqAhhnntPM9OdaErjgmnsSueBJ74knsGihjfzyJx+BJlI4nMs7xtHudeHJvW/A6BRSYi3YQnkSleOIxPPHEE+KJIjzxWTxxGJ5obHI/3yw3Pu2DCGiYcU4735NDTegKY+JJ6IonoSeehK6BMvTHk3AMngTpeCLjHE+714kn97YFr1NAgbloB+FJUIonDsMTRzwhnijCE5fFE4vhicae4vPNcuPT3ouAhhnntPM92deELj8mnrCH/xA9/CE88cfgiZeOJzLO8bR7nXhyb1vwOgUUmIt2EJ54pXhiMTyxxBPiiSI8sVk8WTE80djCeb5ZbnzaOxHQMOOcVLb2Z8t0gS3TITxxx+CJk44nMs7xtHudeHJvW/A6BRSYi3a7SGwx3xRPVgxPVuIJ8UQRnqxZPFkwPNHYMne+WZYaLYqAhRnmoLJVOltQC2xBDeGIPQZHrHQckXGOp93rxJF724LXJaDAXLTbRWLL7qY4smA4shBHiCOKcGTJ4ohpgCPt27Zdxxqm9x/XBbhRbPnLRCiHqskq7e3NDsZCOxgXYAccE5cdfFwRtCPlPE+848k79zYGr2/yQEjNMrMpc09DMpghGRoSDUmRIZlbQ3r68On9ErOGtDzu2FXy+rW12JRCMD9+Qkxr5sqAfLZ8mWjzPD1lvvg5EtIST8T02nVbXVNKwbnoTFqsSdkABn24fDI4+T+T5zdi/fGqSxgffl4gC7fgXJQYx1WGqu11xTNRC1h0IFP1eVg0rWi5bpXVqVfQvHTKjn6/bq+56LfciX4/PvVoiXD0M2j0Mycw+6XN6S0XG8uhB8qN149XB8fnP5fsyflyyeRGLHfa2ty5VufOpT53GjB34sHx9pBlg2M4OjjGikdplHtN4ki37cAYHDN7G8xOUXh24uT1fSOqCI5D1VZucIzjBMdYrhuDY6vgGLDgGBgcGRwZHP8zOIZscPRHB8dQ8SgNcq9JHOm2FRKDY2Zvg9kpCM9OnLy+b0QVwXGo2soNjmGc4BjKdWNwbBUcPRYcPYPjd/bOJTduGAiid8kJJP55keyzyC6rALl/FjYwwKANikWT6hbrADJn2KS634MxRXAkOF4ExySCY7wbHNNAK012xySu9B4DQ3AUzjbITsk4O/HL7/dG3AIcVdXWLjgmPeCY2nUjOM4Cx4iBYyQ4EhwJjhfBMYrgGO4GxzjQSqPdMYkrvUdgEByFsw2yUzTOTvzy+70RtwBHVbW1C45RDzjGdt0IjrPAMWDgGAiOBEeC40VwDCI4+rvBMQy00mB3TOJK7/EABEfhbIPsFIyzE7/8fm/ELcBRVW3tgmPQA46hXTeC4yxw9Bg4eoIjwZHgeBEcvQiO7kZwbP/8tfxGbj+qfUgyutKEzBrkJ8JN7OzEmIsQaq0xOOecj7nEItyUjqctwNTmX3/Ll+QWJKmosnY5EugWC95UHRVtP0v4nAWfDoNPR/gkfBI+L8KnE+Hzq1hYDfO7yZWe/jvwHeG4HWlcQCRDY6zRd8iefCqABFWg8ECAKrYakJ+KLybRkaEbtFXdob3huTHYdM82/BuwN4/dle0SXkyAvJyu2QR5pmvOTNd86YTpOC5/hxcNE8nf4FtC8oNIrr4PqvqF/flIXqwOhsxdGEOzshTNykokL51oZegGbVV3aG94bgw2XTXwyV1hdo4VJD8wJD+I5ETyDZH8kJD8rERy9X1QVXbBfCTPVgdDJlqMoVleimZ5JZLnTrQydIO2qju0Nzw3BpuuGvjkrjCVyAiSnxVC8rMSyYnk+yH5WUUkL0Ry9X1QVSrEfCRPVgdDZoWMoVlaimZpJZKnTrQydIO2qju0Nzw3BpuuGvjkrjDvyQqSFwzJC5GcSL4hkhcRyTORXH0fVJW3MR/Jo9XBkCksY2gWl6JZXInksROtDN2greoO7Q3PjcGmqwY+uStM0rKC5BlD8kwkJ5JviORZRPJEJFffB1UlmcxH8mB1MGS+zRiahaVoFlYieehEK0M3aKu6Q3vDc2Ow6aqBT+4KM8qsIHnCkDwRyYnkGyJ5EpE8EskN9EFbkTDC7If1UHz2wz9wO1DGh1pLcimlfGQfc1U9rTK9CKBFoO4ALgLLAZ4AXE0CPkt36JtqL3sroPL4Yuo8waPPjfpZQAkTc1fsptBpy8tUqxgiphgiFQMVw4aKIYqKIYiKwf9oDCjCONXKHAVxQp6jJyzWGIfGV1s6RY9/XGmMZiFsBbMvGWTkdJ1Ya62+1ORqOY9QojDHgA+vz0iugBKbgoDjn1e8a5t8WN6eC7eHWX6fQwdzDlX+I0zjoAN+C15tO731uRcd/2bYfHRLIWZ2H7X0R2FQEHYOeLi9d6oIjOT9vcBny4AGyYD6pgENsAF1qAE9T1CBnkefenuXoHVUgpae9cW/kAcdaAI+wcs/9pjYj4no79d/JAybVD9uUh1kUmER+/PXn3+/v1PEBlHEeopYI+2AIlZtIShiX5lquEoqekVsMSZiiyURWyhiVd4eJrgy3VahiC1LRWyhiH2CQOQ+PkDElhERWyhiSd4PE7EeE7GeIpYiliL2LhHrRRHrKGKNtAOKWLWFoIh9JWniKinrFbHZmIjNlkRspohVeXuY281Mc4UiNi8VsZki9gkCkfv4ABGbR0RspogleT9MxDpMxDqKWIpYiti7RKwTRexJEWukHVDEqi0ERez/9u5gNW4YCAPwu/ReWK9nRtLj9BBooVBIb336JiUkpchrPKrlf6R/z3GkzMia0RcvfhvPWijJcCHWgkGsRYJYI8RC3j1nY6N1xUYLBbFzxeYQxFpXiDVC7AiAyDgOALHWArFGiOXJezCIXXwQuxBiCbGE2KsgdqlC7I0QG6QcEGJhE0GIfRtPWyhJcSFWg0GsRoJYJcRC3j1nY6N2xUYNBbFzxeYQxGpXiFVC7AiAyDgOALHaArFKiOXJezCIvfkg9kaIJcQSYq+C2FsNYgsdNkg1oMPCJoIO+zaetEiS4Drs5a+vP3inSSSHFTos5N1ztjVKV2uUUA47V2wOOax0dVihw47gh4zjAA4rLQ4rdFievMdy2OJi2EKFpcJSYS9S2FJD2EyEDVIKiLCwiSDCvh9n3mL++dj5Yv/a/gRbn9nyz1paEA32QSjhCPbBXKcSWKhb5xxjrE9YpJSicn/5rJqyZhcy+ofDE9jZolMxWNd+4SFY/2AU2ChyyDgOILAPm7BK6A5cTYPlwTugwWaXwWYaLA2WBnuRweaawaaqwd4+PSzNQC1N+Siula23Upgd17aW5a8/nr/9eonDl+873b9zbh+/f9gTANP8d5oxICo0eZWWhyrKiQ9V+HWi7DzO5uAJ72jI/+SohNr19zueje7get7p+lnPP5pf9TrtDPWFXd8Z9i+eEJygyjYjeVID5N9C6/vkCG0VSnNz5BsV+xfj9MuVwvIgs9G5LdW47bbHbcnLbcWrbdmJbanN2qyZytRHZfSp/+hTqeZTFtynckPdzsBwkS+vsFDtGdNMnzphQTl9KkP6VO7qU3lyn8qxfCp39akc2Kdyi09l+hRs2WYkwXwqb+yTI7RVKM3NcZ/KyD6V5/Qpc/mU0afoU3F8ymo+pcF9KjXU7QQMF+nyCgvVnjHN9KkTFpTTpxKkT6WuPpUm96kUy6dSV59KgX0qtfhUok/Blm1GEsyn0sY+OUJbhdLcHPephOxTaU6fUpdPKX2KPhXHp7TmUxLcp6yhbhswXNjlFRaqPWOa6VMnLCinTxmkT1lXn7LJfcpi+ZR19SkL7FPW4lNGn4It24wkmE/Zxj45QluF0twc9ylD9imb06fE5VNCn6JPxfEpqfnUGtyntKFuKzBc6OUVFqo9Y5rpUycsKKdPKaRPaVef0sl9SmP5lHb1KQ3sU9riU0qfgi3bjCSYT+nGPjlCW4XS3Bz3KUX2KZ3Tp1aXT630KfpUHJ9aaz51D+5T0lC3BRgu5PIKC9WeMc30qQlfOn/Ip6SrT8nkPiWxfEq6+pQE9ilp8SmhT8GWbUYSzKdkY58coa1CaW6O+5Qg+5TM6VN3l0/d6VP0qTg+da/51BLcp/bfnLr/SmI8tnifGqRaMMfj53hcmYryMu5dm9qa1iqlZLubWbqlVVNx4ZR/uBl06mEAAHlqZ9k6fMo/HDpQHcnta3IOXD0hrAAVb8YRiqduG/vkAK0VTINzl1JSWl4/KZd1e6nsX3t5w/ywqAyMU4sLpxbiFHEqDk69OtTLlvL89PPpz9318bO/AVBLAQI/ABQAAAAIALZ9okpdRKh71y8AAPdGCAAVACQAAAAAAAAAIAAAAAAAAABwcmVzZXRUYWJsZVN0eWxlcy54bWwKACAAAAAAAAEAGADPPQEDQsPSAR0n5PQhw9IBLa7JYPup0gFQSwUGAAAAAAEAAQBnAAAACjAAAAAA"; var jsZipWrapper=new AscCommon.JSZipWrapper;return jsZipWrapper.loadAsync(stylesZip,{"base64":true}).then(function(zip){return zip.files["presetTableStyles.xml"].async("string")}).then(function(content){jsZipWrapper.close();var stylesXml=new CT_PresetTableStyles(wb.TableStyles.DefaultStyles,wb.TableStyles.DefaultStylesPivot);(new openXml.SaxParserBase).parse(content,stylesXml);wb.TableStyles.concatStyles()})}function ReadDefCellStyles(wb,oOutput){var Types={Style:0,BuiltinId:1,Hidden:2,CellStyle:3, Xfs:4,Font:5,Fill:6,Border:7,NumFmts:8};var sStyles="XLSY;;11499;5ywAAACHAAAAAQQAAAAAAAAAAyMAAAAABAAAAAAAAAAEDAAAAE4AbwByAG0AYQBsAAUEAAAAAAAAAAQYAAAABgQAAAAABwQAAAAACAQAAAAACQQAAAAABSoAAAABBgMAAAACAQEEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGAAAAAAcAAAAAAJwAAAABBAAAABwAAAADHAAAAAQOAAAATgBlAHUAdAByAGEAbAAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUtAAAAAQYGAAAAAAQAZZz/BAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhAAAAAACwAAAAEGAAAAAASc6///BwAAAAAAlAAAAAEEAAAAGwAAAAMUAAAABAYAAABCAGEAZAAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUtAAAAAQYGAAAAAAQGAJz/BAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhAAAAAACwAAAAEGAAAAAATOx///BwAAAAAAlgAAAAEEAAAAGgAAAAMWAAAABAgAAABHAG8AbwBkAAUEAAAAAQAAAAQhAAAAAAEAAQEABAEABgQAAAAABwQCAAAACAQBAAAACQQAAAAABS0AAAABBgYAAAAABABhAP8EBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGEAAAAAALAAAAAQYAAAAABM7vxv8HAAAAAADlAAAAAQQAAAAUAAAAAxgAAAAECgAAAEkAbgBwAHUAdAAFBAAAAAEAAAAEHgAAAAABAAQBAAYEAQAAAAcEAgAAAAgEAQAAAAkEAAAAAAUtAAAAAQYGAAAAAAR2Pz//BAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhAAAAAACwAAAAEGAAAAAASZzP//B1AAAAAADwAAAAAGBgAAAAAEf39//wEBDQIPAAAAAAYGAAAAAAR/f3//AQENBA8AAAAABgYAAAAABH9/f/8BAQ0FDwAAAAAGBgAAAAAEf39//wEBDQDqAAAAAQQAAAAVAAAAAxoAAAAEDAAAAE8AdQB0AHAAdQB0AAUEAAAAAQAAAAQeAAAAAAEABAEABgQBAAAABwQCAAAACAQBAAAACQQAAAAABTAAAAAAAQEBBgYAAAAABD8/P/8EBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGEAAAAAALAAAAAQYAAAAABPLy8v8HUAAAAAAPAAAAAAYGAAAAAAQ/Pz//AQENAg8AAAAABgYAAAAABD8/P/8BAQ0EDwAAAAAGBgAAAAAEPz8//wEBDQUPAAAAAAYGAAAAAAQ/Pz//AQENAPQAAAABBAAAABYAAAADJAAAAAQWAAAAQwBhAGwAYwB1AGwAYQB0AGkAbwBuAAUEAAAAAQAAAAQeAAAAAAEABAEABgQBAAAABwQCAAAACAQBAAAACQQAAAAABTAAAAAAAQEBBgYAAAAABAB9+v8EBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGEAAAAAALAAAAAQYAAAAABPLy8v8HUAAAAAAPAAAAAAYGAAAAAAR/f3//AQENAg8AAAAABgYAAAAABH9/f/8BAQ0EDwAAAAAGBgAAAAAEf39//wEBDQUPAAAAAAYGAAAAAAR/f3//AQENAO8AAAABBAAAABcAAAADIgAAAAQUAAAAQwBoAGUAYwBrACAAQwBlAGwAbAAFBAAAAAEAAAAEHgAAAAABAAQBAAYEAQAAAAcEAgAAAAgEAQAAAAkEAAAAAAUtAAAAAAEBAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhAAAAAACwAAAAEGAAAAAASlpaX/B1AAAAAADwAAAAAGBgAAAAAEPz8//wEBBAIPAAAAAAYGAAAAAAQ/Pz//AQEEBA8AAAAABgYAAAAABD8/P/8BAQQFDwAAAAAGBgAAAAAEPz8//wEBBACkAAAAAQQAAAA1AAAAAy4AAAAEIAAAAEUAeABwAGwAYQBuAGEAdABvAHIAeQAgAFQAZQB4AHQABQQAAAABAAAABCQAAAAAAQABAQACAQAEAQAGBAAAAAAHBAAAAAAIBAEAAAAJBAAAAAAFMAAAAAEGBgAAAAAEf39//wMBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAA4wAAAAEEAAAACgAAAAMWAAAABAgAAABOAG8AdABlAAUEAAAAAQAAAAQhAAAAAAEAAwEABAEABgQBAAAABwQCAAAACAQBAAAACQQAAAAABSoAAAABBgMAAAACAQEEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGEAAAAAALAAAAAQYAAAAABMz///8HUAAAAAAPAAAAAAYGAAAAAASysrL/AQENAg8AAAAABgYAAAAABLKysv8BAQ0EDwAAAAAGBgAAAAAEsrKy/wEBDQUPAAAAAAYGAAAAAASysrL/AQENAKgAAAABBAAAABgAAAADJAAAAAQWAAAATABpAG4AawBlAGQAIABDAGUAbABsAAUEAAAAAQAAAAQhAAAAAAEAAgEABAEABgQBAAAABwQAAAAACAQBAAAACQQAAAAABS0AAAABBgYAAAAABAB9+v8EBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGAAAAAAcUAAAAAA8AAAAABgYAAAAABAGA//8BAQQAmQAAAAEEAAAACwAAAAMmAAAABBgAAABXAGEAcgBuAGkAbgBnACAAVABlAHgAdAAFBAAAAAEAAAAEJAAAAAABAAEBAAIBAAQBAAYEAAAAAAcEAAAAAAgEAQAAAAkEAAAAAAUtAAAAAQYGAAAAAAQAAP//BAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABgAAAAAHAAAAAAChAAAAAQQAAAAQAAAAAyAAAAAEEgAAAEgAZQBhAGQAaQBuAGcAIAAxAAUEAAAAAQAAAAQhAAAAAAEAAgEABAEABgQBAAAABwQAAAAACAQBAAAACQQAAAAABS0AAAAAAQEBBgMAAAACAQMEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAALkAGAAAAAAcRAAAAAAwAAAAABgMAAAACAQQBAQwAqwAAAAEEAAAAEQAAAAMgAAAABBIAAABIAGUAYQBkAGkAbgBnACAAMgAFBAAAAAEAAAAEIQAAAAABAAIBAAQBAAYEAQAAAAcEAAAAAAgEAQAAAAkEAAAAAAUtAAAAAAEBAQYDAAAAAgEDBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACpABgAAAAAHGwAAAAAWAAAAAAYNAAAAAgEEAwUA/3//v//fPwEBDACrAAAAAQQAAAASAAAAAyAAAAAEEgAAAEgAZQBhAGQAaQBuAGcAIAAzAAUEAAAAAQAAAAQhAAAAAAEAAgEABAEABgQBAAAABwQAAAAACAQBAAAACQQAAAAABS0AAAAAAQEBBgMAAAACAQMEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGAAAAAAcbAAAAABYAAAAABg0AAAACAQQDBc1kZjIzmdk/AQEGAJMAAAABBAAAABMAAAADIAAAAAQSAAAASABlAGEAZABpAG4AZwAgADQABQQAAAABAAAABCQAAAAAAQABAQACAQAEAQAGBAAAAAAHBAAAAAAIBAEAAAAJBAAAAAAFLQAAAAABAQEGAwAAAAIBAwQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAAqgAAAAEEAAAAGQAAAAMYAAAABAoAAABUAG8AdABhAGwABQQAAAABAAAABCEAAAAAAQACAQAEAQAGBAEAAAAHBAAAAAAIBAEAAAAJBAAAAAAFLQAAAAABAQEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAAByIAAAAADAAAAAAGAwAAAAIBBAEBBAUMAAAAAAYDAAAAAgEEAQENAIsAAAABBAAAAA8AAAADGAAAAAQKAAAAVABpAHQAbABlAAUEAAAAAQAAAAQkAAAAAAEAAQEAAgEABAEABgQAAAAABwQAAAAACAQBAAAACQQAAAAABS0AAAAAAQEBBgMAAAACAQMEBg4AAABDAGEAbABpAGIAcgBpAAkBAAYFAAAAAAAAMkAGAAAAAAcAAAAAAKwAAAABBAAAAB4AAAADKAAAAAQaAAAAMgAwACUAIAAtACAAQQBjAGMAZQBuAHQAMQAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEEAwXNZeYyc5npPwcAAAAAAKwAAAABBAAAACIAAAADKAAAAAQaAAAAMgAwACUAIAAtACAAQQBjAGMAZQBuAHQAMgAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEFAwXNZeYyc5npPwcAAAAAAKwAAAABBAAAACYAAAADKAAAAAQaAAAAMgAwACUAIAAtACAAQQBjAGMAZQBuAHQAMwAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEGAwXNZeYyc5npPwcAAAAAAKwAAAABBAAAACoAAAADKAAAAAQaAAAAMgAwACUAIAAtACAAQQBjAGMAZQBuAHQANAAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEHAwXNZeYyc5npPwcAAAAAAKwAAAABBAAAAC4AAAADKAAAAAQaAAAAMgAwACUAIAAtACAAQQBjAGMAZQBuAHQANQAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEIAwXNZeYyc5npPwcAAAAAAKwAAAABBAAAADIAAAADKAAAAAQaAAAAMgAwACUAIAAtACAAQQBjAGMAZQBuAHQANgAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEJAwXNZeYyc5npPwcAAAAAAKwAAAABBAAAAB8AAAADKAAAAAQaAAAANAAwACUAIAAtACAAQQBjAGMAZQBuAHQAMQAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEEAwWazExmJjPjPwcAAAAAAKwAAAABBAAAACMAAAADKAAAAAQaAAAANAAwACUAIAAtACAAQQBjAGMAZQBuAHQAMgAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEFAwWazExmJjPjPwcAAAAAAKwAAAABBAAAACcAAAADKAAAAAQaAAAANAAwACUAIAAtACAAQQBjAGMAZQBuAHQAMwAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEGAwWazExmJjPjPwcAAAAAAKwAAAABBAAAACsAAAADKAAAAAQaAAAANAAwACUAIAAtACAAQQBjAGMAZQBuAHQANAAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEHAwWazExmJjPjPwcAAAAAAKwAAAABBAAAAC8AAAADKAAAAAQaAAAANAAwACUAIAAtACAAQQBjAGMAZQBuAHQANQAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEIAwWazExmJjPjPwcAAAAAAKwAAAABBAAAADMAAAADKAAAAAQaAAAANAAwACUAIAAtACAAQQBjAGMAZQBuAHQANgAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEJAwWazExmJjPjPwcAAAAAAKwAAAABBAAAACAAAAADKAAAAAQaAAAANgAwACUAIAAtACAAQQBjAGMAZQBuAHQAMQAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEEAwXNZGYyM5nZPwcAAAAAAKwAAAABBAAAACQAAAADKAAAAAQaAAAANgAwACUAIAAtACAAQQBjAGMAZQBuAHQAMgAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEFAwXNZGYyM5nZPwcAAAAAAKwAAAABBAAAACgAAAADKAAAAAQaAAAANgAwACUAIAAtACAAQQBjAGMAZQBuAHQAMwAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEGAwXNZGYyM5nZPwcAAAAAAKwAAAABBAAAACwAAAADKAAAAAQaAAAANgAwACUAIAAtACAAQQBjAGMAZQBuAHQANAAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEHAwXNZGYyM5nZPwcAAAAAAKwAAAABBAAAADAAAAADKAAAAAQaAAAANgAwACUAIAAtACAAQQBjAGMAZQBuAHQANQAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEIAwXNZGYyM5nZPwcAAAAAAKwAAAABBAAAADQAAAADKAAAAAQaAAAANgAwACUAIAAtACAAQQBjAGMAZQBuAHQANgAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABhcAAAAAEgAAAAENAAAAAgEJAwXNZGYyM5nZPwcAAAAAAJYAAAABBAAAAB0AAAADHAAAAAQOAAAAQQBjAGMAZQBuAHQAMQAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABg0AAAAACAAAAAEDAAAAAgEEBwAAAAAAlgAAAAEEAAAAIQAAAAMcAAAABA4AAABBAGMAYwBlAG4AdAAyAAUEAAAAAQAAAAQhAAAAAAEAAQEABAEABgQAAAAABwQCAAAACAQBAAAACQQAAAAABSoAAAABBgMAAAACAQAEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGDQAAAAAIAAAAAQMAAAACAQUHAAAAAACNAAAAAxwAAAAEDgAAAEEAYwBjAGUAbgB0ADMABQQAAAABAAAABCEAAAAAAQABAQAEAQAGBAAAAAAHBAIAAAAIBAEAAAAJBAAAAAAFKgAAAAEGAwAAAAIBAAQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYNAAAAAAgAAAABAwAAAAIBBgcAAAAAAJYAAAABBAAAACkAAAADHAAAAAQOAAAAQQBjAGMAZQBuAHQANAAFBAAAAAEAAAAEIQAAAAABAAEBAAQBAAYEAAAAAAcEAgAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEABAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABg0AAAAACAAAAAEDAAAAAgEHBwAAAAAAlgAAAAEEAAAALQAAAAMcAAAABA4AAABBAGMAYwBlAG4AdAA1AAUEAAAAAQAAAAQhAAAAAAEAAQEABAEABgQAAAAABwQCAAAACAQBAAAACQQAAAAABSoAAAABBgMAAAACAQAEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGDQAAAAAIAAAAAQMAAAACAQgHAAAAAACWAAAAAQQAAAAxAAAAAxwAAAAEDgAAAEEAYwBjAGUAbgB0ADYABQQAAAABAAAABCEAAAAAAQABAQAEAQAGBAAAAAAHBAIAAAAIBAEAAAAJBAAAAAAFKgAAAAEGAwAAAAIBAAQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYNAAAAAAgAAAABAwAAAAIBCQcAAAAAACEBAAABBAAAAAQAAAADJwAAAAAEAAAABAAAAAQQAAAAQwB1AHIAcgBlAG4AYwB5AAUEAAAAAQAAAAQkAAAAAAEAAQEAAgEAAwEABgQAAAAABwQAAAAACAQBAAAACQQsAAAABSoAAAABBgMAAAACAQEEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGAAAAAAcAAAAACIUAAAAJgAAAAAAGdAAAAF8AKAAiACQAIgAqACAAIwAsACMAIwAwAC4AMAAwAF8AKQA7AF8AKAAiACQAIgAqACAAXAAoACMALAAjACMAMAAuADAAMABcACkAOwBfACgAIgAkACIAKgAgACIALQAiAD8APwBfACkAOwBfACgAQABfACkAAQQsAAAAABkBAAABBAAAAAcAAAADLwAAAAAEAAAABwAAAAQYAAAAQwB1AHIAcgBlAG4AYwB5ACAAWwAwAF0ABQQAAAABAAAABCQAAAAAAQABAQACAQADAQAGBAAAAAAHBAAAAAAIBAEAAAAJBCoAAAAFKgAAAAEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAIdQAAAAlwAAAAAAZkAAAAXwAoACIAJAAiACoAIAAjACwAIwAjADAAXwApADsAXwAoACIAJAAiACoAIABcACgAIwAsACMAIwAwAFwAKQA7AF8AKAAiACQAIgAqACAAIgAtACIAXwApADsAXwAoAEAAXwApAAEEKgAAAACVAAAAAQQAAAAFAAAAAyUAAAAABAAAAAUAAAAEDgAAAFAAZQByAGMAZQBuAHQABQQAAAABAAAABCQAAAAAAQABAQACAQADAQAGBAAAAAAHBAAAAAAIBAEAAAAJBAkAAAAFKgAAAAEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAACQEAAAEEAAAAAwAAAAMhAAAAAAQAAAADAAAABAoAAABDAG8AbQBtAGEABQQAAAABAAAABCQAAAAAAQABAQACAQADAQAGBAAAAAAHBAAAAAAIBAEAAAAJBCsAAAAFKgAAAAEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAIcwAAAAluAAAAAAZiAAAAXwAoACoAIAAjACwAIwAjADAALgAwADAAXwApADsAXwAoACoAIABcACgAIwAsACMAIwAwAC4AMAAwAFwAKQA7AF8AKAAqACAAIgAtACIAPwA/AF8AKQA7AF8AKABAAF8AKQABBCsAAAAAAQEAAAEEAAAABgAAAAMpAAAAAAQAAAAGAAAABBIAAABDAG8AbQBtAGEAIABbADAAXQAFBAAAAAEAAAAEJAAAAAABAAEBAAIBAAMBAAYEAAAAAAcEAAAAAAgEAQAAAAkEKQAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABgAAAAAHAAAAAAhjAAAACV4AAAAABlIAAABfACgAKgAgACMALAAjACMAMABfACkAOwBfACgAKgAgAFwAKAAjACwAIwAjADAAXAApADsAXwAoACoAIAAiAC0AIgBfACkAOwBfACgAQABfACkAAQQpAAAAAK0AAAABBAAAAAEAAAACAQAAAAEDNAAAAAAEAAAAAQAAAAMEAAAAAAAAAAQUAAAAUgBvAHcATABlAHYAZQBsAF8AMQAFBAAAAAEAAAAEJAAAAAABAAEBAAIBAAQBAAYEAAAAAAcEAAAAAAgEAQAAAAkEAAAAAAUtAAAAAAEBAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABgAAAAAHAAAAAACtAAAAAQQAAAABAAAAAgEAAAABAzQAAAAABAAAAAEAAAADBAAAAAEAAAAEFAAAAFIAbwB3AEwAZQB2AGUAbABfADIABQQAAAABAAAABCQAAAAAAQABAQACAQAEAQAGBAAAAAAHBAAAAAAIBAEAAAAJBAAAAAAFLQAAAAEGAwAAAAIBAQMBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAAqgAAAAEEAAAAAQAAAAIBAAAAAQM0AAAAAAQAAAABAAAAAwQAAAACAAAABBQAAABSAG8AdwBMAGUAdgBlAGwAXwAzAAUEAAAAAQAAAAQkAAAAAAEAAQEAAgEABAEABgQAAAAABwQAAAAACAQBAAAACQQAAAAABSoAAAABBgMAAAACAQEEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGAAAAAAcAAAAAAKoAAAABBAAAAAEAAAACAQAAAAEDNAAAAAAEAAAAAQAAAAMEAAAAAwAAAAQUAAAAUgBvAHcATABlAHYAZQBsAF8ANAAFBAAAAAEAAAAEJAAAAAABAAEBAAIBAAQBAAYEAAAAAAcEAAAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABgAAAAAHAAAAAACqAAAAAQQAAAABAAAAAgEAAAABAzQAAAAABAAAAAEAAAADBAAAAAQAAAAEFAAAAFIAbwB3AEwAZQB2AGUAbABfADUABQQAAAABAAAABCQAAAAAAQABAQACAQAEAQAGBAAAAAAHBAAAAAAIBAEAAAAJBAAAAAAFKgAAAAEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAAqgAAAAEEAAAAAQAAAAIBAAAAAQM0AAAAAAQAAAABAAAAAwQAAAAFAAAABBQAAABSAG8AdwBMAGUAdgBlAGwAXwA2AAUEAAAAAQAAAAQkAAAAAAEAAQEAAgEABAEABgQAAAAABwQAAAAACAQBAAAACQQAAAAABSoAAAABBgMAAAACAQEEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGAAAAAAcAAAAAAKoAAAABBAAAAAEAAAACAQAAAAEDNAAAAAAEAAAAAQAAAAMEAAAABgAAAAQUAAAAUgBvAHcATABlAHYAZQBsAF8ANwAFBAAAAAEAAAAEJAAAAAABAAEBAAIBAAQBAAYEAAAAAAcEAAAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABgAAAAAHAAAAAACtAAAAAQQAAAACAAAAAgEAAAABAzQAAAAABAAAAAIAAAADBAAAAAAAAAAEFAAAAEMAbwBsAEwAZQB2AGUAbABfADEABQQAAAABAAAABCQAAAAAAQABAQACAQAEAQAGBAAAAAAHBAAAAAAIBAEAAAAJBAAAAAAFLQAAAAABAQEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAArQAAAAEEAAAAAgAAAAIBAAAAAQM0AAAAAAQAAAACAAAAAwQAAAABAAAABBQAAABDAG8AbABMAGUAdgBlAGwAXwAyAAUEAAAAAQAAAAQkAAAAAAEAAQEAAgEABAEABgQAAAAABwQAAAAACAQBAAAACQQAAAAABS0AAAABBgMAAAACAQEDAQEEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGAAAAAAcAAAAAAKoAAAABBAAAAAIAAAACAQAAAAEDNAAAAAAEAAAAAgAAAAMEAAAAAgAAAAQUAAAAQwBvAGwATABlAHYAZQBsAF8AMwAFBAAAAAEAAAAEJAAAAAABAAEBAAIBAAQBAAYEAAAAAAcEAAAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABgAAAAAHAAAAAACqAAAAAQQAAAACAAAAAgEAAAABAzQAAAAABAAAAAIAAAADBAAAAAMAAAAEFAAAAEMAbwBsAEwAZQB2AGUAbABfADQABQQAAAABAAAABCQAAAAAAQABAQACAQAEAQAGBAAAAAAHBAAAAAAIBAEAAAAJBAAAAAAFKgAAAAEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAAqgAAAAEEAAAAAgAAAAIBAAAAAQM0AAAAAAQAAAACAAAAAwQAAAAEAAAABBQAAABDAG8AbABMAGUAdgBlAGwAXwA1AAUEAAAAAQAAAAQkAAAAAAEAAQEAAgEABAEABgQAAAAABwQAAAAACAQBAAAACQQAAAAABSoAAAABBgMAAAACAQEEBg4AAABDAGEAbABpAGIAcgBpAAkBAQYFAAAAAAAAJkAGAAAAAAcAAAAAAKoAAAABBAAAAAIAAAACAQAAAAEDNAAAAAAEAAAAAgAAAAMEAAAABQAAAAQUAAAAQwBvAGwATABlAHYAZQBsAF8ANgAFBAAAAAEAAAAEJAAAAAABAAEBAAIBAAQBAAYEAAAAAAcEAAAAAAgEAQAAAAkEAAAAAAUqAAAAAQYDAAAAAgEBBAYOAAAAQwBhAGwAaQBiAHIAaQAJAQEGBQAAAAAAACZABgAAAAAHAAAAAACqAAAAAQQAAAACAAAAAgEAAAABAzQAAAAABAAAAAIAAAADBAAAAAYAAAAEFAAAAEMAbwBsAEwAZQB2AGUAbABfADcABQQAAAABAAAABCQAAAAAAQABAQACAQAEAQAGBAAAAAAHBAAAAAAIBAEAAAAJBAAAAAAFKgAAAAEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQAYAAAAABwAAAAAAqAAAAAEEAAAACAAAAAIBAAAAAQMpAAAAAAQAAAAIAAAABBIAAABIAHkAcABlAHIAbABpAG4AawAFBAAAAAEAAAAELQAAAAABAAEBAAIBAAQBAAYEAAAAAAcEAAAAAAgEAQAAAAkEAAAAAA0GAwAAAAcBBAUqAAAAAQYDAAAAAgEKBAYOAAAAQwBhAGwAaQBiAHIAaQAGBQAAAAAAACZABwEDBgAAAAAHAAAAAAC6AAAAAQQAAAAJAAAAAgEAAAABAzsAAAAABAAAAAkAAAAEJAAAAEYAbwBsAGwAbwB3AGUAZAAgAEgAeQBwAGUAcgBsAGkAbgBrAAUEAAAAAQAAAAQtAAAAAAEAAQEAAgEABAEABgQAAAAABwQAAAAACAQBAAAACQQAAAAADQYDAAAABwEEBSoAAAABBgMAAAACAQsEBg4AAABDAGEAbABpAGIAcgBpAAYFAAAAAAAAJkAHAQMGAAAAAAcAAAAA"; var oBinaryFileReader=new BinaryFileReader;var stream=oBinaryFileReader.getbase64DecodedData(sStyles);var bcr=new Binary_CommonReader(stream);var oBinary_StylesTableReader=new Binary_StylesTableReader(stream,wb,[],undefined,true);var length=stream.GetULongLE();var fReadStyle=function(type,length,oCellStyle,oStyleObject){var res=c_oSerConstants.ReadOk;if(Types.BuiltinId===type)oCellStyle.BuiltinId=stream.GetULongLE();else if(Types.Hidden===type)oCellStyle.Hidden=stream.GetBool();else if(Types.CellStyle=== type)res=bcr.Read1(length,function(t,l){return oBinary_StylesTableReader.ReadCellStyle(t,l,oCellStyle)});else if(Types.Xfs===type){oStyleObject.xfs=new OpenXf;res=bcr.Read2Spreadsheet(length,function(t,l){return oBinary_StylesTableReader.ReadXfs(t,l,oStyleObject.xfs)})}else if(Types.Font===type){oStyleObject.font=new AscCommonExcel.Font;res=bcr.Read2Spreadsheet(length,function(t,l){return oBinary_StylesTableReader.bssr.ReadRPr(t,l,oStyleObject.font)});oStyleObject.font.checkSchemeFont(wb.theme)}else if(Types.Fill=== type){oStyleObject.fill=new AscCommonExcel.Fill;res=bcr.Read1(length,function(t,l){return oBinary_StylesTableReader.ReadFill(t,l,oStyleObject.fill)})}else if(Types.Border===type){oStyleObject.border=new AscCommonExcel.Border;res=bcr.Read1(length,function(t,l){return oBinary_StylesTableReader.ReadBorder(t,l,oStyleObject.border)})}else if(Types.NumFmts===type)res=bcr.Read1(length,function(t,l){return oBinary_StylesTableReader.ReadNumFmts(t,l,oStyleObject.oNumFmts)});else res=c_oSerConstants.ReadUnknown; return res};var fReadStyles=function(type,length,oOutput){var res=c_oSerConstants.ReadOk;var oStyleObject={font:null,fill:null,border:null,oNumFmts:{},xfs:null};if(Types.Style===type){var oCellStyle=new AscCommonExcel.CCellStyle;res=bcr.Read1(length,function(t,l){return fReadStyle(t,l,oCellStyle,oStyleObject)});var newXf=new AscCommonExcel.CellXfs;if(null!==oStyleObject.border)newXf.border=g_StyleCache.addBorder(oStyleObject.border);if(null!==oStyleObject.fill)newXf.fill=g_StyleCache.addFill(oStyleObject.fill); if(null!==oStyleObject.font)newXf.font=g_StyleCache.addFont(oStyleObject.font);if(null!==oStyleObject.xfs.numid){var oCurNum=oStyleObject.oNumFmts[oStyleObject.xfs.numid];if(null!=oCurNum)newXf.num=g_StyleCache.addNum(oCurNum);else newXf.num=g_StyleCache.addNum(oBinary_StylesTableReader.ParseNum({id:oStyleObject.xfs.numid,f:null},oStyleObject.oNumFmts))}if(null!=oStyleObject.xfs.QuotePrefix)newXf.QuotePrefix=oStyleObject.xfs.QuotePrefix;if(null!=oStyleObject.xfs.PivotButton)newXf.PivotButton=oStyleObject.xfs.PivotButton; if(null!=oStyleObject.xfs.align)newXf.align=g_StyleCache.addAlign(oStyleObject.xfs.align);if(null!==oStyleObject.xfs.XfId)newXf.XfId=oStyleObject.xfs.XfId;if(null!==oStyleObject.xfs.ApplyBorder)oCellStyle.ApplyBorder=oStyleObject.xfs.ApplyBorder;if(null!==oStyleObject.xfs.ApplyFill)oCellStyle.ApplyFill=oStyleObject.xfs.ApplyFill;if(null!==oStyleObject.xfs.ApplyFont)oCellStyle.ApplyFont=oStyleObject.xfs.ApplyFont;if(null!==oStyleObject.xfs.ApplyNumberFormat)oCellStyle.ApplyNumberFormat=oStyleObject.xfs.ApplyNumberFormat; oCellStyle.xfs=g_StyleCache.addXf(newXf);oOutput.push(oCellStyle)}else res=c_oSerConstants.ReadUnknown;return res};var res=bcr.Read1(length,function(t,l){return fReadStyles(t,l,oOutput)});if(0===wb.CellStyles.CustomStyles.length&&0<oOutput.length){wb.CellStyles.CustomStyles.push(oOutput[0].clone());wb.CellStyles.CustomStyles[0].XfId=0}if(null==g_oDefaultFormat.XfId)g_oDefaultFormat.XfId=0}function RenameDefSlicerStyle(oStyleObject){var tableStyles=oStyleObject.oCustomTableStyles;var tableStylesRenamed= {},i;for(i in tableStyles){var item=tableStyles[i];if(null!=item){item.style.name=item.style.name.slice(0,-2);item.style.displayName=item.style.displayName.slice(0,-2);tableStylesRenamed[item.style.name]=item}}oStyleObject.oCustomTableStyles=tableStylesRenamed;if(oStyleObject.oCustomSlicerStyles){var slicerStyles=oStyleObject.oCustomSlicerStyles.slicerStyle;for(i=0;i<slicerStyles.length;++i)slicerStyles[i].name=slicerStyles[i].name.slice(0,-2)}}function ReadDefSlicerStyles(wb,oOutput){var sStyles= "XLSY;;25178;VmIAAAAFAAAAAQAAAAAEIAAAAAULAAAAAAYAAAACAQAAABEFCwAAAAAGAAAAAgEAAAAIBi8AAAAHKgAAAAEGAwAAAAIBAQQGDgAAAEMAYQBsAGkAYgByAGkACQEBBgUAAAAAAAAmQA4dAAAAAxgAAAAGBAAAAAAHBAAAAAAIBAAAAAAJBAAAAAACIwAAAAMeAAAABgQAAAAABwQAAAAACAQAAAAACQQAAAAADAQAAAAADygAAAAQIwAAAAAEAAAAAAAAAAQMAAAATgBvAHIAbQBhAGwABQQAAAAAAAAACrEHAAALKgAAAAEUAAAAAA8AAAAABgYAAAAABL2BT/8BAQ0DDAAAAAABAQEGAwAAAAIBAQtjAAAAAVAAAAAADwAAAAAGBgAAAAAEvYFP/wEBDQIPAAAAAAYGAAAAAAS9gU//AQENBA8AAAAABgYAAAAABL2BT/8BAQ0FDwAAAAAGBgAAAAAEvYFP/wEBDQMJAAAAAQYDAAAAAgEBCzEAAAABGwAAAAAWAAAAAAYNAAAAAgEAAwWzmFnMLGbWvwEBDQMMAAAAAAEBAQYDAAAAAgEBC38AAAABbAAAAAAWAAAAAAYNAAAAAgEAAwUA/3//v//fvwEBDQIWAAAAAAYNAAAAAgEAAwUA/3//v//fvwEBDQQWAAAAAAYNAAAAAgEAAwUA/3//v//fvwEBDQUWAAAAAAYNAAAAAgEAAwUA/3//v//fvwEBDQMJAAAAAQYDAAAAAgEBCycAAAABEQAAAAAMAAAAAAYDAAAAAgEJAQENAwwAAAAAAQEBBgMAAAACAQELVwAAAAFEAAAAAAwAAAAABgMAAAACAQkBAQ0CDAAAAAAGAwAAAAIBCQEBDQQMAAAAAAYDAAAAAgEJAQENBQwAAAAABgMAAAACAQkBAQ0DCQAAAAEGAwAAAAIBAQsnAAAAAREAAAAADAAAAAAGAwAAAAIBCAEBDQMMAAAAAAEBAQYDAAAAAgEBC1cAAAABRAAAAAAMAAAAAAYDAAAAAgEIAQENAgwAAAAABgMAAAACAQgBAQ0EDAAAAAAGAwAAAAIBCAEBDQUMAAAAAAYDAAAAAgEIAQENAwkAAAABBgMAAAACAQELJwAAAAERAAAAAAwAAAAABgMAAAACAQcBAQ0DDAAAAAABAQEGAwAAAAIBAQtXAAAAAUQAAAAADAAAAAAGAwAAAAIBBwEBDQIMAAAAAAYDAAAAAgEHAQENBAwAAAAABgMAAAACAQcBAQ0FDAAAAAAGAwAAAAIBBwEBDQMJAAAAAQYDAAAAAgEBCycAAAABEQAAAAAMAAAAAAYDAAAAAgEGAQENAwwAAAAAAQEBBgMAAAACAQELVwAAAAFEAAAAAAwAAAAABgMAAAACAQYBAQ0CDAAAAAAGAwAAAAIBBgEBDQQMAAAAAAYDAAAAAgEGAQENBQwAAAAABgMAAAACAQYBAQ0DCQAAAAEGAwAAAAIBAQsnAAAAAREAAAAADAAAAAAGAwAAAAIBBQEBDQMMAAAAAAEBAQYDAAAAAgEBC1cAAAABRAAAAAAMAAAAAAYDAAAAAgEFAQENAgwAAAAABgMAAAACAQUBAQ0EDAAAAAAGAwAAAAIBBQEBDQUMAAAAAAYDAAAAAgEFAQENAwkAAAABBgMAAAACAQELJwAAAAERAAAAAAwAAAAABgMAAAACAQQBAQ0DDAAAAAABAQEGAwAAAAIBAQtXAAAAAUQAAAAADAAAAAAGAwAAAAIBBAEBDQIMAAAAAAYDAAAAAgEEAQENBAwAAAAABgMAAAACAQQBAQ0FDAAAAAAGAwAAAAIBBAEBDQMJAAAAAQYDAAAAAgEBCycAAAABEQAAAAAMAAAAAAYDAAAAAgEJAQENAwwAAAAAAQEBBgMAAAACAQELVwAAAAFEAAAAAAwAAAAABgMAAAACAQkBAQ0CDAAAAAAGAwAAAAIBCQEBDQQMAAAAAAYDAAAAAgEJAQENBQwAAAAABgMAAAACAQkBAQ0DCQAAAAEGAwAAAAIBAQsnAAAAAREAAAAADAAAAAAGAwAAAAIBCAEBDQMMAAAAAAEBAQYDAAAAAgEBC1cAAAABRAAAAAAMAAAAAAYDAAAAAgEIAQENAgwAAAAABgMAAAACAQgBAQ0EDAAAAAAGAwAAAAIBCAEBDQUMAAAAAAYDAAAAAgEIAQENAwkAAAABBgMAAAACAQELJwAAAAERAAAAAAwAAAAABgMAAAACAQcBAQ0DDAAAAAABAQEGAwAAAAIBAQtXAAAAAUQAAAAADAAAAAAGAwAAAAIBBwEBDQIMAAAAAAYDAAAAAgEHAQENBAwAAAAABgMAAAACAQcBAQ0FDAAAAAAGAwAAAAIBBwEBDQMJAAAAAQYDAAAAAgEBCycAAAABEQAAAAAMAAAAAAYDAAAAAgEGAQENAwwAAAAAAQEBBgMAAAACAQELVwAAAAFEAAAAAAwAAAAABgMAAAACAQYBAQ0CDAAAAAAGAwAAAAIBBgEBDQQMAAAAAAYDAAAAAgEGAQENBQwAAAAABgMAAAACAQYBAQ0DCQAAAAEGAwAAAAIBAQsnAAAAAREAAAAADAAAAAAGAwAAAAIBBQEBDQMMAAAAAAEBAQYDAAAAAgEBC1cAAAABRAAAAAAMAAAAAAYDAAAAAgEFAQENAgwAAAAABgMAAAACAQUBAQ0EDAAAAAAGAwAAAAIBBQEBDQUMAAAAAAYDAAAAAgEFAQENAwkAAAABBgMAAAACAQELJwAAAAERAAAAAAwAAAAABgMAAAACAQQBAQ0DDAAAAAABAQEGAwAAAAIBAQtXAAAAAUQAAAAADAAAAAAGAwAAAAIBBAEBDQIMAAAAAAYDAAAAAgEEAQENBAwAAAAABgMAAAACAQQBAQ0FDAAAAAAGAwAAAAIBBAEBDQMJAAAAAQYDAAAAAgEBDF0FAAAAIgAAAFQAYQBiAGwAZQBTAHQAeQBsAGUATQBlAGQAaQB1AG0AMgABIgAAAFAAaQB2AG8AdABTAHQAeQBsAGUATABpAGcAaAB0ADEANgACCgUAAANWAAAAACQAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUARABhAHIAawAxACAAMgABAQAAAAACAQAAAAADHAAAAAQJAAAAAgEbAAQbAAAABAkAAAACAQoABBoAAAADVgAAAAAkAAAAUwBsAGkAYwBlAHIAUwB0AHkAbABlAEQAYQByAGsAMgAgADIAAQEAAAAAAgEAAAAAAxwAAAAECQAAAAIBGwAEGQAAAAQJAAAAAgEKAAQYAAAAA1YAAAAAJAAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBEAGEAcgBrADMAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABBcAAAAECQAAAAIBCgAEFgAAAANWAAAAACQAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUARABhAHIAawA0ACAAMgABAQAAAAACAQAAAAADHAAAAAQJAAAAAgEbAAQVAAAABAkAAAACAQoABBQAAAADVgAAAAAkAAAAUwBsAGkAYwBlAHIAUwB0AHkAbABlAEQAYQByAGsANQAgADIAAQEAAAAAAgEAAAAAAxwAAAAECQAAAAIBGwAEEwAAAAQJAAAAAgEKAAQSAAAAA1YAAAAAJAAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBEAGEAcgBrADYAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABBEAAAAECQAAAAIBCgAEEAAAAANYAAAAACYAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATABpAGcAaAB0ADEAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABA8AAAAECQAAAAIBCgAEDgAAAANYAAAAACYAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATABpAGcAaAB0ADIAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABA0AAAAECQAAAAIBCgAEDAAAAANYAAAAACYAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATABpAGcAaAB0ADMAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABAsAAAAECQAAAAIBCgAECgAAAANYAAAAACYAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATABpAGcAaAB0ADQAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABAkAAAAECQAAAAIBCgAECAAAAANYAAAAACYAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATABpAGcAaAB0ADUAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABAcAAAAECQAAAAIBCgAEBgAAAANYAAAAACYAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATABpAGcAaAB0ADYAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABAUAAAAECQAAAAIBCgAEBAAAAANYAAAAACYAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATwB0AGgAZQByADEAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABAMAAAAECQAAAAIBCgAEAgAAAANYAAAAACYAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATwB0AGgAZQByADIAIAAyAAEBAAAAAAIBAAAAAAMcAAAABAkAAAACARsABAEAAAAECQAAAAIBCgAEAAAAABLVSgAAC7QAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAAT09/z/AwkAAAABBgMAAAACAQELtAAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABPT3/P8DCQAAAAEGAwAAAAIBAQu0AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE9Pf8/wMJAAAAAQYDAAAAAgEBC7QAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAAT09/z/AwkAAAABBgMAAAACAQELtwAAAAFQAAAAAA8AAAAABgYAAAAABMzMzP8BAQ0CDwAAAAAGBgAAAAAEzMzM/wEBDQQPAAAAAAYGAAAAAATMzMz/AQENBQ8AAAAABgYAAAAABMzMzP8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAAT14NH/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABPvy6f8DDAAAAAEGBgAAAAAEgoKC/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABN+7o/8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE9t7K/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAATg4OD/AQENAg8AAAAABgYAAAAABODg4P8BAQ0EDwAAAAAGBgAAAAAE4ODg/wEBDQUPAAAAAAYGAAAAAATg4OD/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAE9vTy/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAAT+/v7/AwwAAAABBgYAAAAABIKCgv8LtwAAAAFQAAAAAA8AAAAABgYAAAAABMzMzP8BAQ0CDwAAAAAGBgAAAAAEzMzM/wEBDQQPAAAAAAYGAAAAAATMzMz/AQENBQ8AAAAABgYAAAAABMzMzP8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAATu6+j/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABPr4+P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C5cAAAABUAAAAAAPAAAAAAYGAAAAAATMzMz/AQENAg8AAAAABgYAAAAABMzMzP8BAQ0EDwAAAAAGBgAAAAAEzMzM/wEBDQUPAAAAAAYGAAAAAATMzMz/AQENAi8AAAAAKgAAAAIBAAAAEgMNAAAAAgEAAwWazExmJjPDvwQNAAAAAgEAAwWazExmJjPDvwMJAAAAAQYDAAAAAgEBC5oAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAi8AAAAAKgAAAAIBAAAAEgMNAAAAAgEAAwUA/X/+P//PvwQNAAAAAgEAAwUA/X/+P//PvwMMAAAAAQYGAAAAAAQAAAD/C4YAAAABUAAAAAAPAAAAAAYGAAAAAATg4OD/AQENAg8AAAAABgYAAAAABODg4P8BAQ0EDwAAAAAGBgAAAAAE4ODg/wEBDQUPAAAAAAYGAAAAAATg4OD/AQENAhsAAAAAFgAAAAIBAAAAEgMDAAAAAgEABAMAAAACAQADDAAAAAEGBgAAAAAElZWV/wuGAAAAAVAAAAAADwAAAAAGBgAAAAAEzMzM/wEBDQIPAAAAAAYGAAAAAATMzMz/AQENBA8AAAAABgYAAAAABMzMzP8BAQ0FDwAAAAAGBgAAAAAEzMzM/wEBDQIbAAAAABYAAAACAQAAABIDAwAAAAIBAAQDAAAAAgEAAwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wuaAAAAAVAAAAAADwAAAAAGBgAAAAAEzMzM/wEBDQIPAAAAAAYGAAAAAATMzMz/AQENBA8AAAAABgYAAAAABMzMzP8BAQ0FDwAAAAAGBgAAAAAEzMzM/wEBDQIvAAAAACoAAAACAQAAABIDDQAAAAIBCQMFzWXmMnOZ6T8EDQAAAAIBCQMFzWXmMnOZ6T8DDAAAAAEGBgAAAAAEgoKC/wuaAAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQIvAAAAACoAAAACAQAAABIDDQAAAAIBCQMFmsxMZiYz4z8EDQAAAAIBCQMFmsxMZiYz4z8DDAAAAAEGBgAAAAAEAAAA/wuMAAAAAVAAAAAADwAAAAAGBgAAAAAE4ODg/wEBDQIPAAAAAAYGAAAAAATg4OD/AQENBA8AAAAABgYAAAAABODg4P8BAQ0FDwAAAAAGBgAAAAAE4ODg/wEBDQIhAAAAABwAAAACAQAAABIDBgAAAAAE/////wQGAAAAAAT/////AwwAAAABBgYAAAAABIKCgv8LjAAAAAFQAAAAAA8AAAAABgYAAAAABMzMzP8BAQ0CDwAAAAAGBgAAAAAEzMzM/wEBDQQPAAAAAAYGAAAAAATMzMz/AQENBQ8AAAAABgYAAAAABMzMzP8BAQ0CIQAAAAAcAAAAAgEAAAASAwYAAAAABP////8EBgAAAAAE/////wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LmgAAAAFQAAAAAA8AAAAABgYAAAAABMzMzP8BAQ0CDwAAAAAGBgAAAAAEzMzM/wEBDQQPAAAAAAYGAAAAAATMzMz/AQENBQ8AAAAABgYAAAAABMzMzP8BAQ0CLwAAAAAqAAAAAgEAAAASAw0AAAACAQgDBc1l5jJzmek/BA0AAAACAQgDBc1l5jJzmek/AwwAAAABBgYAAAAABIKCgv8LmgAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CLwAAAAAqAAAAAgEAAAASAw0AAAACAQgDBZrMTGYmM+M/BA0AAAACAQgDBZrMTGYmM+M/AwwAAAABBgYAAAAABAAAAP8LjAAAAAFQAAAAAA8AAAAABgYAAAAABODg4P8BAQ0CDwAAAAAGBgAAAAAE4ODg/wEBDQQPAAAAAAYGAAAAAATg4OD/AQENBQ8AAAAABgYAAAAABODg4P8BAQ0CIQAAAAAcAAAAAgEAAAASAwYAAAAABP////8EBgAAAAAE/////wMMAAAAAQYGAAAAAASCgoL/C4wAAAABUAAAAAAPAAAAAAYGAAAAAATMzMz/AQENAg8AAAAABgYAAAAABMzMzP8BAQ0EDwAAAAAGBgAAAAAEzMzM/wEBDQUPAAAAAAYGAAAAAATMzMz/AQENAiEAAAAAHAAAAAIBAAAAEgMGAAAAAAT/////BAYAAAAABP////8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C5oAAAABUAAAAAAPAAAAAAYGAAAAAATMzMz/AQENAg8AAAAABgYAAAAABMzMzP8BAQ0EDwAAAAAGBgAAAAAEzMzM/wEBDQUPAAAAAAYGAAAAAATMzMz/AQENAi8AAAAAKgAAAAIBAAAAEgMNAAAAAgEHAwXNZeYyc5npPwQNAAAAAgEHAwXNZeYyc5npPwMMAAAAAQYGAAAAAASCgoL/C5oAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAi8AAAAAKgAAAAIBAAAAEgMNAAAAAgEHAwWazExmJjPjPwQNAAAAAgEHAwWazExmJjPjPwMMAAAAAQYGAAAAAAQAAAD/C4wAAAABUAAAAAAPAAAAAAYGAAAAAATg4OD/AQENAg8AAAAABgYAAAAABODg4P8BAQ0EDwAAAAAGBgAAAAAE4ODg/wEBDQUPAAAAAAYGAAAAAATg4OD/AQENAiEAAAAAHAAAAAIBAAAAEgMGAAAAAAT/////BAYAAAAABP////8DDAAAAAEGBgAAAAAEgoKC/wuMAAAAAVAAAAAADwAAAAAGBgAAAAAEzMzM/wEBDQIPAAAAAAYGAAAAAATMzMz/AQENBA8AAAAABgYAAAAABMzMzP8BAQ0FDwAAAAAGBgAAAAAEzMzM/wEBDQIhAAAAABwAAAACAQAAABIDBgAAAAAE/////wQGAAAAAAT/////AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wuaAAAAAVAAAAAADwAAAAAGBgAAAAAEzMzM/wEBDQIPAAAAAAYGAAAAAATMzMz/AQENBA8AAAAABgYAAAAABMzMzP8BAQ0FDwAAAAAGBgAAAAAEzMzM/wEBDQIvAAAAACoAAAACAQAAABIDDQAAAAIBBgMFzWXmMnOZ6T8EDQAAAAIBBgMFzWXmMnOZ6T8DDAAAAAEGBgAAAAAEgoKC/wuaAAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQIvAAAAACoAAAACAQAAABIDDQAAAAIBBgMFmsxMZiYz4z8EDQAAAAIBBgMFmsxMZiYz4z8DDAAAAAEGBgAAAAAEAAAA/wuMAAAAAVAAAAAADwAAAAAGBgAAAAAE4ODg/wEBDQIPAAAAAAYGAAAAAATg4OD/AQENBA8AAAAABgYAAAAABODg4P8BAQ0FDwAAAAAGBgAAAAAE4ODg/wEBDQIhAAAAABwAAAACAQAAABIDBgAAAAAE/////wQGAAAAAAT/////AwwAAAABBgYAAAAABIKCgv8LjAAAAAFQAAAAAA8AAAAABgYAAAAABMzMzP8BAQ0CDwAAAAAGBgAAAAAEzMzM/wEBDQQPAAAAAAYGAAAAAATMzMz/AQENBQ8AAAAABgYAAAAABMzMzP8BAQ0CIQAAAAAcAAAAAgEAAAASAwYAAAAABP////8EBgAAAAAE/////wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LmgAAAAFQAAAAAA8AAAAABgYAAAAABMzMzP8BAQ0CDwAAAAAGBgAAAAAEzMzM/wEBDQQPAAAAAAYGAAAAAATMzMz/AQENBQ8AAAAABgYAAAAABMzMzP8BAQ0CLwAAAAAqAAAAAgEAAAASAw0AAAACAQUDBc1l5jJzmek/BA0AAAACAQUDBc1l5jJzmek/AwwAAAABBgYAAAAABIKCgv8LmgAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CLwAAAAAqAAAAAgEAAAASAw0AAAACAQUDBZrMTGYmM+M/BA0AAAACAQUDBZrMTGYmM+M/AwwAAAABBgYAAAAABAAAAP8LjAAAAAFQAAAAAA8AAAAABgYAAAAABODg4P8BAQ0CDwAAAAAGBgAAAAAE4ODg/wEBDQQPAAAAAAYGAAAAAATg4OD/AQENBQ8AAAAABgYAAAAABODg4P8BAQ0CIQAAAAAcAAAAAgEAAAASAwYAAAAABP////8EBgAAAAAE/////wMMAAAAAQYGAAAAAASCgoL/C4wAAAABUAAAAAAPAAAAAAYGAAAAAATMzMz/AQENAg8AAAAABgYAAAAABMzMzP8BAQ0EDwAAAAAGBgAAAAAEzMzM/wEBDQUPAAAAAAYGAAAAAATMzMz/AQENAiEAAAAAHAAAAAIBAAAAEgMGAAAAAAT/////BAYAAAAABP////8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C5oAAAABUAAAAAAPAAAAAAYGAAAAAATMzMz/AQENAg8AAAAABgYAAAAABMzMzP8BAQ0EDwAAAAAGBgAAAAAEzMzM/wEBDQUPAAAAAAYGAAAAAATMzMz/AQENAi8AAAAAKgAAAAIBAAAAEgMNAAAAAgEEAwXNZeYyc5npPwQNAAAAAgEEAwXNZeYyc5npPwMMAAAAAQYGAAAAAASCgoL/C5oAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAi8AAAAAKgAAAAIBAAAAEgMNAAAAAgEEAwWazExmJjPjPwQNAAAAAgEEAwWazExmJjPjPwMMAAAAAQYGAAAAAAQAAAD/C4wAAAABUAAAAAAPAAAAAAYGAAAAAATg4OD/AQENAg8AAAAABgYAAAAABODg4P8BAQ0EDwAAAAAGBgAAAAAE4ODg/wEBDQUPAAAAAAYGAAAAAATg4OD/AQENAiEAAAAAHAAAAAIBAAAAEgMGAAAAAAT/////BAYAAAAABP////8DDAAAAAEGBgAAAAAEgoKC/wuMAAAAAVAAAAAADwAAAAAGBgAAAAAEzMzM/wEBDQIPAAAAAAYGAAAAAATMzMz/AQENBA8AAAAABgYAAAAABMzMzP8BAQ0FDwAAAAAGBgAAAAAEzMzM/wEBDQIhAAAAABwAAAACAQAAABIDBgAAAAAE/////wQGAAAAAAT/////AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu9AAAAAWwAAAAAFgAAAAAGDQAAAAIBCQMFmsxMZiYz4z8BAQ0CFgAAAAAGDQAAAAIBCQMFmsxMZiYz4z8BAQ0EFgAAAAAGDQAAAAIBCQMFmsxMZiYz4z8BAQ0FFgAAAAAGDQAAAAIBCQMFmsxMZiYz4z8BAQ0CLwAAAAAqAAAAAgEAAAASAw0AAAACAQkDBZrMTGYmM+M/BA0AAAACAQkDBZrMTGYmM+M/AxMAAAABBg0AAAACAQkDBQD9f/4//8+/C3cAAAABRAAAAAAMAAAAAAYDAAAAAgEJAQENAgwAAAAABgMAAAACAQkBAQ0EDAAAAAAGAwAAAAIBCQEBDQUMAAAAAAYDAAAAAgEJAQENAhsAAAAAFgAAAAIBAAAAEgMDAAAAAgEJBAMAAAACAQkDCQAAAAEGAwAAAAIBAAuMAAAAAVAAAAAADwAAAAAGBgAAAAAE39/f/wEBDQIPAAAAAAYGAAAAAATf39//AQENBA8AAAAABgYAAAAABN/f3/8BAQ0FDwAAAAAGBgAAAAAE39/f/wEBDQIhAAAAABwAAAACAQAAABIDBgAAAAAE39/f/wQGAAAAAATf39//AwwAAAABBgYAAAAABJWVlf8LjAAAAAFQAAAAAA8AAAAABgYAAAAABMDAwP8BAQ0CDwAAAAAGBgAAAAAEwMDA/wEBDQQPAAAAAAYGAAAAAATAwMD/AQENBQ8AAAAABgYAAAAABMDAwP8BAQ0CIQAAAAAcAAAAAgEAAAASAwYAAAAABMDAwP8EBgAAAAAEwMDA/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LvQAAAAFsAAAAABYAAAAABg0AAAACAQgDBZrMTGYmM+M/AQENAhYAAAAABg0AAAACAQgDBZrMTGYmM+M/AQENBBYAAAAABg0AAAACAQgDBZrMTGYmM+M/AQENBRYAAAAABg0AAAACAQgDBZrMTGYmM+M/AQENAi8AAAAAKgAAAAIBAAAAEgMNAAAAAgEIAwWazExmJjPjPwQNAAAAAgEIAwWazExmJjPjPwMTAAAAAQYNAAAAAgEIAwUA/X/+P//Pvwt3AAAAAUQAAAAADAAAAAAGAwAAAAIBCAEBDQIMAAAAAAYDAAAAAgEIAQENBAwAAAAABgMAAAACAQgBAQ0FDAAAAAAGAwAAAAIBCAEBDQIbAAAAABYAAAACAQAAABIDAwAAAAIBCAQDAAAAAgEIAwkAAAABBgMAAAACAQALjAAAAAFQAAAAAA8AAAAABgYAAAAABN/f3/8BAQ0CDwAAAAAGBgAAAAAE39/f/wEBDQQPAAAAAAYGAAAAAATf39//AQENBQ8AAAAABgYAAAAABN/f3/8BAQ0CIQAAAAAcAAAAAgEAAAASAwYAAAAABN/f3/8EBgAAAAAE39/f/wMMAAAAAQYGAAAAAASVlZX/C4wAAAABUAAAAAAPAAAAAAYGAAAAAATAwMD/AQENAg8AAAAABgYAAAAABMDAwP8BAQ0EDwAAAAAGBgAAAAAEwMDA/wEBDQUPAAAAAAYGAAAAAATAwMD/AQENAiEAAAAAHAAAAAIBAAAAEgMGAAAAAATAwMD/BAYAAAAABMDAwP8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C70AAAABbAAAAAAWAAAAAAYNAAAAAgEHAwWazExmJjPjPwEBDQIWAAAAAAYNAAAAAgEHAwWazExmJjPjPwEBDQQWAAAAAAYNAAAAAgEHAwWazExmJjPjPwEBDQUWAAAAAAYNAAAAAgEHAwWazExmJjPjPwEBDQIvAAAAACoAAAACAQAAABIDDQAAAAIBBwMFmsxMZiYz4z8EDQAAAAIBBwMFmsxMZiYz4z8DEwAAAAEGDQAAAAIBBwMFAP1//j//z78LdwAAAAFEAAAAAAwAAAAABgMAAAACAQcBAQ0CDAAAAAAGAwAAAAIBBwEBDQQMAAAAAAYDAAAAAgEHAQENBQwAAAAABgMAAAACAQcBAQ0CGwAAAAAWAAAAAgEAAAASAwMAAAACAQcEAwAAAAIBBwMJAAAAAQYDAAAAAgEAC4wAAAABUAAAAAAPAAAAAAYGAAAAAATf39//AQENAg8AAAAABgYAAAAABN/f3/8BAQ0EDwAAAAAGBgAAAAAE39/f/wEBDQUPAAAAAAYGAAAAAATf39//AQENAiEAAAAAHAAAAAIBAAAAEgMGAAAAAATf39//BAYAAAAABN/f3/8DDAAAAAEGBgAAAAAElZWV/wuMAAAAAVAAAAAADwAAAAAGBgAAAAAEwMDA/wEBDQIPAAAAAAYGAAAAAATAwMD/AQENBA8AAAAABgYAAAAABMDAwP8BAQ0FDwAAAAAGBgAAAAAEwMDA/wEBDQIhAAAAABwAAAACAQAAABIDBgAAAAAEwMDA/wQGAAAAAATAwMD/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu9AAAAAWwAAAAAFgAAAAAGDQAAAAIBBgMFmsxMZiYz4z8BAQ0CFgAAAAAGDQAAAAIBBgMFmsxMZiYz4z8BAQ0EFgAAAAAGDQAAAAIBBgMFmsxMZiYz4z8BAQ0FFgAAAAAGDQAAAAIBBgMFmsxMZiYz4z8BAQ0CLwAAAAAqAAAAAgEAAAASAw0AAAACAQYDBZrMTGYmM+M/BA0AAAACAQYDBZrMTGYmM+M/AxMAAAABBg0AAAACAQYDBQD9f/4//8+/C3cAAAABRAAAAAAMAAAAAAYDAAAAAgEGAQENAgwAAAAABgMAAAACAQYBAQ0EDAAAAAAGAwAAAAIBBgEBDQUMAAAAAAYDAAAAAgEGAQENAhsAAAAAFgAAAAIBAAAAEgMDAAAAAgEGBAMAAAACAQYDCQAAAAEGAwAAAAIBAAuMAAAAAVAAAAAADwAAAAAGBgAAAAAE39/f/wEBDQIPAAAAAAYGAAAAAATf39//AQENBA8AAAAABgYAAAAABN/f3/8BAQ0FDwAAAAAGBgAAAAAE39/f/wEBDQIhAAAAABwAAAACAQAAABIDBgAAAAAE39/f/wQGAAAAAATf39//AwwAAAABBgYAAAAABJWVlf8LjAAAAAFQAAAAAA8AAAAABgYAAAAABMDAwP8BAQ0CDwAAAAAGBgAAAAAEwMDA/wEBDQQPAAAAAAYGAAAAAATAwMD/AQENBQ8AAAAABgYAAAAABMDAwP8BAQ0CIQAAAAAcAAAAAgEAAAASAwYAAAAABMDAwP8EBgAAAAAEwMDA/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LvQAAAAFsAAAAABYAAAAABg0AAAACAQUDBZrMTGYmM+M/AQENAhYAAAAABg0AAAACAQUDBZrMTGYmM+M/AQENBBYAAAAABg0AAAACAQUDBZrMTGYmM+M/AQENBRYAAAAABg0AAAACAQUDBZrMTGYmM+M/AQENAi8AAAAAKgAAAAIBAAAAEgMNAAAAAgEFAwWazExmJjPjPwQNAAAAAgEFAwWazExmJjPjPwMTAAAAAQYNAAAAAgEFAwUA/X/+P//Pvwt3AAAAAUQAAAAADAAAAAAGAwAAAAIBBQEBDQIMAAAAAAYDAAAAAgEFAQENBAwAAAAABgMAAAACAQUBAQ0FDAAAAAAGAwAAAAIBBQEBDQIbAAAAABYAAAACAQAAABIDAwAAAAIBBQQDAAAAAgEFAwkAAAABBgMAAAACAQALjAAAAAFQAAAAAA8AAAAABgYAAAAABN/f3/8BAQ0CDwAAAAAGBgAAAAAE39/f/wEBDQQPAAAAAAYGAAAAAATf39//AQENBQ8AAAAABgYAAAAABN/f3/8BAQ0CIQAAAAAcAAAAAgEAAAASAwYAAAAABN/f3/8EBgAAAAAE39/f/wMMAAAAAQYGAAAAAASVlZX/C4wAAAABUAAAAAAPAAAAAAYGAAAAAATAwMD/AQENAg8AAAAABgYAAAAABMDAwP8BAQ0EDwAAAAAGBgAAAAAEwMDA/wEBDQUPAAAAAAYGAAAAAATAwMD/AQENAiEAAAAAHAAAAAIBAAAAEgMGAAAAAATAwMD/BAYAAAAABMDAwP8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C7cAAAABUAAAAAAPAAAAAAYGAAAAAASZmZn/AQENAg8AAAAABgYAAAAABJmZmf8BAQ0EDwAAAAAGBgAAAAAEmZmZ/wEBDQUPAAAAAAYGAAAAAASZmZn/AQENAkwAAAAFRwAAAAsIAAAAAAAAAACAVkAMGAAAAA0IAAAAAAAAAAAAAAAOBgAAAAAEYuH4/wwYAAAADQgAAAAAAAAAAADwPw4GAAAAAATg9/z/AwwAAAABBgYAAAAABAAAAP8LtwAAAAFQAAAAAA8AAAAABgYAAAAABJmZmf8BAQ0CDwAAAAAGBgAAAAAEmZmZ/wEBDQQPAAAAAAYGAAAAAASZmZn/AQENBQ8AAAAABgYAAAAABJmZmf8BAQ0CTAAAAAVHAAAACwgAAAAAAAAAAIBWQAwYAAAADQgAAAAAAAAAAAAAAA4GAAAAAARi4fj/DBgAAAANCAAAAAAAAAAAAPA/DgYAAAAABOD3/P8DDAAAAAEGBgAAAAAEAAAA/wu3AAAAAVAAAAAADwAAAAAGBgAAAAAEmZmZ/wEBDQIPAAAAAAYGAAAAAASZmZn/AQENBA8AAAAABgYAAAAABJmZmf8BAQ0FDwAAAAAGBgAAAAAEmZmZ/wEBDQJMAAAABUcAAAALCAAAAAAAAAAAgFZADBgAAAANCAAAAAAAAAAAAAAADgYAAAAABGLh+P8MGAAAAA0IAAAAAAAAAAAA8D8OBgAAAAAE4Pf8/wMMAAAAAQYGAAAAAAQAAAD/C70AAAABbAAAAAAWAAAAAAYNAAAAAgEEAwWazExmJjPjPwEBDQIWAAAAAAYNAAAAAgEEAwWazExmJjPjPwEBDQQWAAAAAAYNAAAAAgEEAwWazExmJjPjPwEBDQUWAAAAAAYNAAAAAgEEAwWazExmJjPjPwEBDQIvAAAAACoAAAACAQAAABIDDQAAAAIBBAMFmsxMZiYz4z8EDQAAAAIBBAMFmsxMZiYz4z8DEwAAAAEGDQAAAAIBBAMFAP1//j//z78LdwAAAAFEAAAAAAwAAAAABgMAAAACAQQBAQ0CDAAAAAAGAwAAAAIBBAEBDQQMAAAAAAYDAAAAAgEEAQENBQwAAAAABgMAAAACAQQBAQ0CGwAAAAAWAAAAAgEAAAASAwMAAAACAQQEAwAAAAIBBAMJAAAAAQYDAAAAAgEAC4wAAAABUAAAAAAPAAAAAAYGAAAAAATf39//AQENAg8AAAAABgYAAAAABN/f3/8BAQ0EDwAAAAAGBgAAAAAE39/f/wEBDQUPAAAAAAYGAAAAAATf39//AQENAiEAAAAAHAAAAAIBAAAAEgMGAAAAAATf39//BAYAAAAABN/f3/8DDAAAAAEGBgAAAAAElZWV/wuMAAAAAVAAAAAADwAAAAAGBgAAAAAEwMDA/wEBDQIPAAAAAAYGAAAAAATAwMD/AQENBA8AAAAABgYAAAAABMDAwP8BAQ0FDwAAAAAGBgAAAAAEwMDA/wEBDQIhAAAAABwAAAACAQAAABIDBgAAAAAEwMDA/wQGAAAAAATAwMD/AwwAAAABBgYAAAAABAAAAP8RhQkAAACACQAA+gARAAAAUwBsAGkAYwBlAHIAUwB0AHkAbABlAEwAaQBnAGgAdAAxAPsAUgkAAA4AAAAApAAAAPoAEgAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBEAGEAcgBrADEAIAAyAPsAdAAAAAgAAAAACQAAAPoAAAFvAAAA+wAJAAAA+gACAW4AAAD7AAkAAAD6AAEBbQAAAPsACQAAAPoAAwFsAAAA+wAJAAAA+gAEAWsAAAD7AAkAAAD6AAUBagAAAPsACQAAAPoABgFpAAAA+wAJAAAA+gAHAWgAAAD7AKQAAAD6ABIAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUARABhAHIAawAyACAAMgD7AHQAAAAIAAAAAAkAAAD6AAABZwAAAPsACQAAAPoAAgFmAAAA+wAJAAAA+gABAWUAAAD7AAkAAAD6AAMBZAAAAPsACQAAAPoABAFjAAAA+wAJAAAA+gAFAWIAAAD7AAkAAAD6AAYBYQAAAPsACQAAAPoABwFgAAAA+wCkAAAA+gASAAAAUwBsAGkAYwBlAHIAUwB0AHkAbABlAEQAYQByAGsAMwAgADIA+wB0AAAACAAAAAAJAAAA+gAAAV8AAAD7AAkAAAD6AAIBXgAAAPsACQAAAPoAAQFdAAAA+wAJAAAA+gADAVwAAAD7AAkAAAD6AAQBWwAAAPsACQAAAPoABQFaAAAA+wAJAAAA+gAGAVkAAAD7AAkAAAD6AAcBWAAAAPsApAAAAPoAEgAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBEAGEAcgBrADQAIAAyAPsAdAAAAAgAAAAACQAAAPoAAAFXAAAA+wAJAAAA+gACAVYAAAD7AAkAAAD6AAEBVQAAAPsACQAAAPoAAwFUAAAA+wAJAAAA+gAEAVMAAAD7AAkAAAD6AAUBUgAAAPsACQAAAPoABgFRAAAA+wAJAAAA+gAHAVAAAAD7AKQAAAD6ABIAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUARABhAHIAawA1ACAAMgD7AHQAAAAIAAAAAAkAAAD6AAABTwAAAPsACQAAAPoAAgFOAAAA+wAJAAAA+gABAU0AAAD7AAkAAAD6AAMBTAAAAPsACQAAAPoABAFLAAAA+wAJAAAA+gAFAUoAAAD7AAkAAAD6AAYBSQAAAPsACQAAAPoABwFIAAAA+wCkAAAA+gASAAAAUwBsAGkAYwBlAHIAUwB0AHkAbABlAEQAYQByAGsANgAgADIA+wB0AAAACAAAAAAJAAAA+gAAAUcAAAD7AAkAAAD6AAIBRgAAAPsACQAAAPoAAQFFAAAA+wAJAAAA+gADAUQAAAD7AAkAAAD6AAQBQwAAAPsACQAAAPoABQFCAAAA+wAJAAAA+gAGAUEAAAD7AAkAAAD6AAcBQAAAAPsApgAAAPoAEwAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBMAGkAZwBoAHQAMQAgADIA+wB0AAAACAAAAAAJAAAA+gAAAT8AAAD7AAkAAAD6AAIBPgAAAPsACQAAAPoAAQE9AAAA+wAJAAAA+gADATwAAAD7AAkAAAD6AAQBOwAAAPsACQAAAPoABQE6AAAA+wAJAAAA+gAGATkAAAD7AAkAAAD6AAcBOAAAAPsApgAAAPoAEwAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBMAGkAZwBoAHQAMgAgADIA+wB0AAAACAAAAAAJAAAA+gAAATcAAAD7AAkAAAD6AAIBNgAAAPsACQAAAPoAAQE1AAAA+wAJAAAA+gADATQAAAD7AAkAAAD6AAQBMwAAAPsACQAAAPoABQEyAAAA+wAJAAAA+gAGATEAAAD7AAkAAAD6AAcBMAAAAPsApgAAAPoAEwAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBMAGkAZwBoAHQAMwAgADIA+wB0AAAACAAAAAAJAAAA+gAAAS8AAAD7AAkAAAD6AAIBLgAAAPsACQAAAPoAAQEtAAAA+wAJAAAA+gADASwAAAD7AAkAAAD6AAQBKwAAAPsACQAAAPoABQEqAAAA+wAJAAAA+gAGASkAAAD7AAkAAAD6AAcBKAAAAPsApgAAAPoAEwAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBMAGkAZwBoAHQANAAgADIA+wB0AAAACAAAAAAJAAAA+gAAAScAAAD7AAkAAAD6AAIBJgAAAPsACQAAAPoAAQElAAAA+wAJAAAA+gADASQAAAD7AAkAAAD6AAQBIwAAAPsACQAAAPoABQEiAAAA+wAJAAAA+gAGASEAAAD7AAkAAAD6AAcBIAAAAPsApgAAAPoAEwAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBMAGkAZwBoAHQANQAgADIA+wB0AAAACAAAAAAJAAAA+gAAAR8AAAD7AAkAAAD6AAIBHgAAAPsACQAAAPoAAQEdAAAA+wAJAAAA+gADARwAAAD7AAkAAAD6AAQBGwAAAPsACQAAAPoABQEaAAAA+wAJAAAA+gAGARkAAAD7AAkAAAD6AAcBGAAAAPsApgAAAPoAEwAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBMAGkAZwBoAHQANgAgADIA+wB0AAAACAAAAAAJAAAA+gAAARcAAAD7AAkAAAD6AAIBFgAAAPsACQAAAPoAAQEVAAAA+wAJAAAA+gADARQAAAD7AAkAAAD6AAQBEwAAAPsACQAAAPoABQESAAAA+wAJAAAA+gAGAREAAAD7AAkAAAD6AAcBEAAAAPsApgAAAPoAEwAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBPAHQAaABlAHIAMQAgADIA+wB0AAAACAAAAAAJAAAA+gAAAQ8AAAD7AAkAAAD6AAIBDgAAAPsACQAAAPoAAQENAAAA+wAJAAAA+gADAQwAAAD7AAkAAAD6AAQBCwAAAPsACQAAAPoABQEKAAAA+wAJAAAA+gAGAQkAAAD7AAkAAAD6AAcBCAAAAPsApgAAAPoAEwAAAFMAbABpAGMAZQByAFMAdAB5AGwAZQBPAHQAaABlAHIAMgAgADIA+wB0AAAACAAAAAAJAAAA+gAAAQcAAAD7AAkAAAD6AAIBBgAAAPsACQAAAPoAAQEFAAAA+wAJAAAA+gADAQQAAAD7AAkAAAD6AAQBAwAAAPsACQAAAPoABQECAAAA+wAJAAAA+gAGAQEAAAD7AAkAAAD6AAcBAAAAAPs="; var oBinaryFileReader=new BinaryFileReader;var stream=oBinaryFileReader.getbase64DecodedData(sStyles);new Binary_CommonReader(stream);var oBinary_StylesTableReader=new Binary_StylesTableReader(stream,wb,[],undefined,true);var oStyleObject=oBinary_StylesTableReader.Read();RenameDefSlicerStyle(oStyleObject);oBinary_StylesTableReader.InitDefSlicerStyles(wb,oStyleObject)}function CT_PresetTableStyles(tableStyles,pivotStyles){this.tableStyles=tableStyles;this.pivotStyles=pivotStyles}CT_PresetTableStyles.prototype.onStartNode= function(elem,attr,uq){var newContext=this;if("presetTableStyles"===elem);else if(0===elem.indexOf("TableStyle")||0===elem.indexOf("PivotStyle"))newContext=new CT_Stylesheet(new Asc.CTableStyles);else newContext=null;return newContext};CT_PresetTableStyles.prototype.onEndNode=function(prevContext,elem){if(0===elem.indexOf("TableStyle"))for(var i in prevContext.tableStyles.CustomStyles)this.tableStyles[i]=prevContext.tableStyles.CustomStyles[i];else if(0===elem.indexOf("PivotStyle"))for(var i in prevContext.tableStyles.CustomStyles)this.pivotStyles[i]= prevContext.tableStyles.CustomStyles[i]};function CT_Stylesheet(tableStyles){this.numFmts=[];this.fonts=[];this.fills=[];this.borders=[];this.cellStyleXfs=[];this.cellXfs=[];this.cellStyles=[];this.dxfs=[];this.tableStyles=tableStyles}CT_Stylesheet.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("styleSheet"===elem){if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("numFmts"===elem);else if("numFmt"===elem){newContext=new AscCommonExcel.Num;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.numFmts.push(newContext)}else if("fonts"===elem);else if("font"===elem){newContext=new AscCommonExcel.Font;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.fonts.push(newContext)}else if("fills"===elem)openXml.SaxParserDataTransfer.priorityBg=false;else if("fill"===elem){newContext=new AscCommonExcel.Fill;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.fills.push(newContext)}else if("borders"===elem);else if("border"===elem){newContext=new AscCommonExcel.Border; if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.borders.push(newContext)}else if("dxfs"===elem){openXml.SaxParserDataTransfer.dxfs=this.dxfs;openXml.SaxParserDataTransfer.priorityBg=true}else if("dxf"===elem){newContext=new CT_Dxf;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("tableStyles"===elem)newContext=this.tableStyles;else newContext=null;return newContext};CT_Stylesheet.prototype.onEndNode=function(prevContext,elem){if("dxf"===elem)this.dxfs.push(g_StyleCache.addXf(prevContext.xf))}; function CT_Dxf(){this.xf=new AscCommonExcel.CellXfs}CT_Dxf.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("font"===elem){newContext=new AscCommonExcel.Font;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.xf.font=newContext}else if("numFmt"===elem){newContext=new AscCommonExcel.Num;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.xf.num=newContext}else if("fill"===elem){newContext=new AscCommonExcel.Fill;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.xf.fill=newContext}else if("alignment"===elem){newContext=new AscCommonExcel.Align;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.xf.align=newContext}else if("border"===elem){newContext=new AscCommonExcel.Border;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.xf.border=newContext}else newContext=null;return newContext};var prot;window["Asc"]=window["Asc"]||{};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["Asc"].EBorderStyle=EBorderStyle; window["Asc"].EUnderline=EUnderline;window["Asc"].ECellAnchorType=ECellAnchorType;window["Asc"].EVisibleType=EVisibleType;window["Asc"].ECellTypeType=ECellTypeType;window["Asc"].ECellFormulaType=ECellFormulaType;window["Asc"].EPageOrientation=EPageOrientation;window["Asc"].EPageSize=EPageSize;window["Asc"].ETotalsRowFunction=ETotalsRowFunction;window["Asc"].ESortBy=ESortBy;window["Asc"].ECustomFilter=ECustomFilter;window["Asc"].EDateTimeGroup=EDateTimeGroup;window["Asc"].ETableStyleType=ETableStyleType; window["Asc"].EFontScheme=EFontScheme;window["Asc"].EIconSetType=EIconSetType;window["Asc"].c_oSer_DrawingType=c_oSer_DrawingType;window["Asc"].c_oSer_DrawingPosType=c_oSer_DrawingPosType;window["Asc"]["c_oAscCFOperator"]=window["AscCommonExcel"].ECfOperator=ECfOperator;prot=ECfOperator;prot["beginsWith"]=prot.Operator_beginsWith;prot["between"]=prot.Operator_between;prot["containsText"]=prot.Operator_containsText;prot["endsWith"]=prot.Operator_endsWith;prot["equal"]=prot.Operator_equal;prot["greaterThan"]= prot.Operator_greaterThan;prot["greaterThanOrEqual"]=prot.Operator_greaterThanOrEqual;prot["lessThan"]=prot.Operator_lessThan;prot["lessThanOrEqual"]=prot.Operator_lessThanOrEqual;prot["notBetween"]=prot.Operator_notBetween;prot["notContains"]=prot.Operator_notContains;prot["notEqual"]=prot.Operator_notEqual;window["Asc"]["c_oAscCFType"]=window["Asc"].ECfType=ECfType;prot=ECfType;prot["aboveAverage"]=prot.aboveAverage;prot["beginsWith"]=prot.beginsWith;prot["cellIs"]=prot.cellIs;prot["colorScale"]= prot.colorScale;prot["containsBlanks"]=prot.containsBlanks;prot["containsErrors"]=prot.containsErrors;prot["containsText"]=prot.containsText;prot["dataBar"]=prot.dataBar;prot["duplicateValues"]=prot.duplicateValues;prot["expression"]=prot.expression;prot["notContainsBlanks"]=prot.notContainsBlanks;prot["notContainsErrors"]=prot.notContainsErrors;prot["notContainsText"]=prot.notContainsText;prot["timePeriod"]=prot.timePeriod;prot["top10"]=prot.top10;prot["uniqueValues"]=prot.uniqueValues;prot["endsWith"]= prot.endsWith;window["Asc"]["c_oAscCfvoType"]=window["AscCommonExcel"].ECfvoType=ECfvoType;prot=ECfvoType;prot["Formula"]=prot.Formula;prot["Maximum"]=prot.Maximum;prot["Minimum"]=prot.Minimum;prot["Number"]=prot.Number;prot["Percent"]=prot.Percent;prot["Percentile"]=prot.Percentile;prot["AutoMin"]=prot.AutoMin;prot["AutoMax"]=prot.AutoMax;window["Asc"]["c_oAscTimePeriod"]=window["AscCommonExcel"].ST_TimePeriod=ST_TimePeriod;prot=ST_TimePeriod;prot["last7Days"]=prot.last7Days;prot["lastMonth"]=prot.lastMonth; prot["lastWeek"]=prot.lastWeek;prot["nextMonth"]=prot.nextMonth;prot["nextWeek"]=prot.nextWeek;prot["thisMonth"]=prot.thisMonth;prot["thisWeek"]=prot.thisWeek;prot["today"]=prot.today;prot["tomorrow"]=prot.tomorrow;prot["yesterday"]=prot.yesterday;window["Asc"]["c_oAscDataBarAxisPosition"]=window["AscCommonExcel"].EDataBarAxisPosition=EDataBarAxisPosition;prot=EDataBarAxisPosition;prot["automatic"]=prot.automatic;prot["middle"]=prot.middle;prot["none"]=prot.none;window["Asc"]["c_oAscDataBarDirection"]= window["AscCommonExcel"].EDataBarDirection=EDataBarDirection;prot=EDataBarDirection;prot["context"]=prot.context;prot["leftToRight"]=prot.leftToRight;prot["rightToLeft"]=prot.rightToLeft;window["AscCommonExcel"].XLSB=XLSB;window["Asc"].CSlicerStyles=CSlicerStyles;window["Asc"].CTableStyles=CTableStyles;window["Asc"].CTableStyle=CTableStyle;window["Asc"].CTableStyleElement=CTableStyleElement;window["Asc"].CTableStyleStripe=CTableStyleStripe;window["AscCommonExcel"].BinaryFileReader=BinaryFileReader; window["AscCommonExcel"].BinaryFileWriter=BinaryFileWriter;window["AscCommonExcel"].BinaryTableWriter=BinaryTableWriter;window["AscCommonExcel"].Binary_TableReader=Binary_TableReader;window["AscCommonExcel"].OpenFormula=OpenFormula;window["Asc"].getBinaryOtherTableGVar=getBinaryOtherTableGVar;window["Asc"].ReadDefTableStyles=ReadDefTableStyles;window["AscCommonExcel"].BinaryStylesTableWriter=BinaryStylesTableWriter;window["AscCommonExcel"].Binary_StylesTableReader=Binary_StylesTableReader;window["Asc"]["ETotalsRowFunction"]= window["AscCommonExcel"].ETotalsRowFunction=ETotalsRowFunction;prot=ETotalsRowFunction;prot["totalrowfunctionNone"]=prot.totalrowfunctionNone;prot["totalrowfunctionAverage"]=prot.totalrowfunctionAverage;prot["totalrowfunctionCount"]=prot.totalrowfunctionCount;prot["totalrowfunctionCountNums"]=prot.totalrowfunctionCountNums;prot["totalrowfunctionCustom"]=prot.totalrowfunctionCustom;prot["totalrowfunctionMax"]=prot.totalrowfunctionMax;prot["totalrowfunctionMin"]=prot.totalrowfunctionMin;prot["totalrowfunctionStdDev"]= prot.totalrowfunctionStdDev;prot["totalrowfunctionSum"]=prot.totalrowfunctionSum;prot["totalrowfunctionVar"]=prot.totalrowfunctionVar})(window);"use strict";(function(window,undefined){var FT_Common=AscFonts.FT_Common;var CellValueType=AscCommon.CellValueType;var EIconSetType=Asc.EIconSetType;function CConditionalFormatting(){this.pivot=false;this.ranges=null;this.aRules=[];return this}CConditionalFormatting.prototype.setSqRef=function(sqRef){this.ranges=AscCommonExcel.g_oRangeCache.getRangesFromSqRef(sqRef)}; CConditionalFormatting.prototype.isValid=function(){return this.ranges&&this.ranges.length>0};CConditionalFormatting.prototype.initRules=function(){for(var i=0;i<this.aRules.length;++i)this.aRules[i].updateConditionalFormatting(this)};function CConditionalFormattingFormulaParent(ws,rule,isDefName){this.ws=ws;this.rule=rule;this.isDefName=isDefName}CConditionalFormattingFormulaParent.prototype.onFormulaEvent=function(type,eventData){if(AscCommon.c_oNotifyParentType.IsDefName===type&&this.isDefName)return{bbox:this.rule.getBBox(), ranges:this.rule.ranges};else if(AscCommon.c_oNotifyParentType.Change===type)this.ws.setDirtyConditionalFormatting(new AscCommonExcel.MultiplyRange(this.rule.ranges))};CConditionalFormattingFormulaParent.prototype.clone=function(){return new CConditionalFormattingFormulaParent(this.ws,this.rule,this.isDefName)};function CConditionalFormattingRule(){this.aboveAverage=true;this.activePresent=false;this.bottom=false;this.dxf=null;this.equalAverage=false;this.id=null;this.operator=null;this.percent=false; this.priority=null;this.rank=null;this.stdDev=null;this.stopIfTrue=false;this.text=null;this.timePeriod=null;this.type=null;this.aRuleElements=[];this.pivot=false;this.ranges=null;return this}CConditionalFormattingRule.prototype.clone=function(){var i,res=new CConditionalFormattingRule;res.aboveAverage=this.aboveAverage;res.bottom=this.bottom;if(this.dxf)res.dxf=this.dxf.clone();res.equalAverage=this.equalAverage;res.operator=this.operator;res.percent=this.percent;res.priority=this.priority;res.rank= this.rank;res.stdDev=this.stdDev;res.stopIfTrue=this.stopIfTrue;res.text=this.text;res.timePeriod=this.timePeriod;res.type=this.type;res.updateConditionalFormatting(this);for(i=0;i<this.aRuleElements.length;++i)res.aRuleElements.push(this.aRuleElements[i].clone());return res};CConditionalFormattingRule.prototype.getTimePeriod=function(){var start,end;var now=new Asc.cDate;now.setUTCHours(0,0,0,0);switch(this.timePeriod){case AscCommonExcel.ST_TimePeriod.last7Days:now.setUTCDate(now.getUTCDate()+1); end=now.getExcelDate();now.setUTCDate(now.getUTCDate()-7);start=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.lastMonth:now.setUTCDate(1);end=now.getExcelDate();now.setUTCMonth(now.getUTCMonth()-1);start=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.thisMonth:now.setUTCDate(1);start=now.getExcelDate();now.setUTCMonth(now.getUTCMonth()+1);end=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.nextMonth:now.setUTCDate(1);now.setUTCMonth(now.getUTCMonth()+1);start=now.getExcelDate(); now.setUTCMonth(now.getUTCMonth()+1);end=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.lastWeek:now.setUTCDate(now.getUTCDate()-now.getUTCDay());end=now.getExcelDate();now.setUTCDate(now.getUTCDate()-7);start=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.thisWeek:now.setUTCDate(now.getUTCDate()-now.getUTCDay());start=now.getExcelDate();now.setUTCDate(now.getUTCDate()+7);end=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.nextWeek:now.setUTCDate(now.getUTCDate()- now.getUTCDay()+7);start=now.getExcelDate();now.setUTCDate(now.getUTCDate()+7);end=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.yesterday:end=now.getExcelDate();now.setUTCDate(now.getUTCDate()-1);start=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.today:start=now.getExcelDate();now.setUTCDate(now.getUTCDate()+1);end=now.getExcelDate();break;case AscCommonExcel.ST_TimePeriod.tomorrow:now.setUTCDate(now.getUTCDate()+1);start=now.getExcelDate();now.setUTCDate(now.getUTCDate()+ 1);end=now.getExcelDate();break}return{start:start,end:end}};CConditionalFormattingRule.prototype.getValueCellIs=function(ws,opt_parent,opt_bbox,opt_offset,opt_returnRaw){var res;if(null!==this.text)res=new AscCommonExcel.cString(this.text);else if(this.aRuleElements[1])res=this.aRuleElements[1].getValue(ws,opt_parent,opt_bbox,opt_offset,opt_returnRaw);return res};CConditionalFormattingRule.prototype.getFormulaCellIs=function(){return null===this.text&&this.aRuleElements[1]};CConditionalFormattingRule.prototype.cellIs= function(operator,cell,v1,v2){if(operator===AscCommonExcel.ECfOperator.Operator_beginsWith||operator===AscCommonExcel.ECfOperator.Operator_endsWith||operator===AscCommonExcel.ECfOperator.Operator_containsText||operator===AscCommonExcel.ECfOperator.Operator_notContains)return this._cellIsText(operator,cell,v1);else return this._cellIsNumber(operator,cell,v1,v2)};CConditionalFormattingRule.prototype._cellIsText=function(operator,cell,v1){if(!v1||AscCommonExcel.cElementType.empty===v1.type)v1=new AscCommonExcel.cString(""); if(AscCommonExcel.ECfOperator.Operator_notContains===operator)return!this._cellIsText(AscCommonExcel.ECfOperator.Operator_containsText,cell,v1);var cellType=cell?cell.type:null;if(cellType===CellValueType.Error||AscCommonExcel.cElementType.error===v1.type)return false;var res=false;var cellVal=cell?cell.getValueWithoutFormat().toLowerCase():"";var v1Val=v1.toLocaleString().toLowerCase();switch(operator){case AscCommonExcel.ECfOperator.Operator_beginsWith:case AscCommonExcel.ECfOperator.Operator_endsWith:if(AscCommonExcel.cElementType.string=== v1.type&&(cellType===CellValueType.String||""===v1Val))if(AscCommonExcel.ECfOperator.Operator_beginsWith===operator)res=cellVal.startsWith(v1Val);else res=cellVal.endsWith(v1Val);else res=false;break;case AscCommonExcel.ECfOperator.Operator_containsText:if(""===cellVal)res=false;else res=-1!==cellVal.indexOf(v1Val);break}return res};CConditionalFormattingRule.prototype._cellIsNumber=function(operator,cell,v1,v2){if(!v1||AscCommonExcel.cElementType.empty===v1.type)v1=new AscCommonExcel.cNumber(0); if(cell&&cell.type===CellValueType.Error||AscCommonExcel.cElementType.error===v1.type)return false;var cellVal;var res=false;switch(operator){case AscCommonExcel.ECfOperator.Operator_equal:if(AscCommonExcel.cElementType.number===v1.type)if(!cell||cell.isNullTextString())res=0===v1.getValue();else if(cell.type===CellValueType.Number)res=cell.getNumberValue()===v1.getValue();else res=false;else if(AscCommonExcel.cElementType.string===v1.type)if(!cell||cell.isNullTextString())res=""===v1.getValue().toLowerCase(); else if(cell.type===CellValueType.String){cellVal=cell.getValueWithoutFormat().toLowerCase();res=cellVal===v1.getValue().toLowerCase()}else res=false;else if(AscCommonExcel.cElementType.bool===v1.type)if(cell&&cell.type===CellValueType.Bool)res=cell.getBoolValue()===v1.toBool();else res=false;break;case AscCommonExcel.ECfOperator.Operator_notEqual:res=!this._cellIsNumber(AscCommonExcel.ECfOperator.Operator_equal,cell,v1);break;case AscCommonExcel.ECfOperator.Operator_greaterThan:if(AscCommonExcel.cElementType.number=== v1.type)if(!cell||cell.isNullTextString())res=0>v1.getValue();else if(cell.type===CellValueType.Number)res=cell.getNumberValue()>v1.getValue();else res=true;else if(AscCommonExcel.cElementType.string===v1.type)if(!cell||cell.isNullTextString())res="">v1.getValue().toLowerCase();else if(cell.type===CellValueType.Number)res=false;else if(cell.type===CellValueType.String){cellVal=cell.getValueWithoutFormat().toLowerCase();res=cellVal>v1.getValue().toLowerCase()}else{if(cell.type===CellValueType.Bool)res= true}else if(AscCommonExcel.cElementType.bool===v1.type)if(cell&&cell.type===CellValueType.Bool)res=cell.getBoolValue()>v1.toBool();else res=false;break;case AscCommonExcel.ECfOperator.Operator_greaterThanOrEqual:res=this._cellIsNumber(AscCommonExcel.ECfOperator.Operator_greaterThan,cell,v1)||this._cellIsNumber(AscCommonExcel.ECfOperator.Operator_equal,cell,v1);break;case AscCommonExcel.ECfOperator.Operator_lessThan:res=!this._cellIsNumber(AscCommonExcel.ECfOperator.Operator_greaterThanOrEqual,cell, v1);break;case AscCommonExcel.ECfOperator.Operator_lessThanOrEqual:res=!this._cellIsNumber(AscCommonExcel.ECfOperator.Operator_greaterThan,cell,v1);break;case AscCommonExcel.ECfOperator.Operator_between:res=this._cellIsNumber(AscCommonExcel.ECfOperator.Operator_greaterThanOrEqual,cell,v1)&&this._cellIsNumber(AscCommonExcel.ECfOperator.Operator_lessThanOrEqual,cell,v2);break;case AscCommonExcel.ECfOperator.Operator_notBetween:res=!this._cellIsNumber(AscCommonExcel.ECfOperator.Operator_between,cell, v1,v2);break}return res};CConditionalFormattingRule.prototype.getAverage=function(val,average,stdDev){var res=false;if(this.aboveAverage)res=val>average;else res=val<average;res=res||this.equalAverage&&val==average;return res};CConditionalFormattingRule.prototype.hasStdDev=function(){return null!==this.stdDev};CConditionalFormattingRule.prototype.updateConditionalFormatting=function(cf){var i;this.pivot=cf.pivot;if(cf.ranges){this.ranges=[];for(i=0;i<cf.ranges.length;++i)this.ranges.push(cf.ranges[i].clone())}}; CConditionalFormattingRule.prototype.getBBox=function(){var bbox=null;if(this.ranges&&this.ranges.length>0){bbox=this.ranges[0].clone();for(var i=1;i<this.ranges.length;++i)bbox.union2(this.ranges[i])}return bbox};CConditionalFormattingRule.prototype.getIndexRule=function(values,ws,value){var valueCFVO;var aCFVOs=this._getCFVOs();for(var i=aCFVOs.length-1;i>=0;--i){valueCFVO=this._getValue(values,aCFVOs[i],ws);if(value>valueCFVO||aCFVOs[i].Gte&&value===valueCFVO)return i}return 0};CConditionalFormattingRule.prototype.getMin= function(values,ws){var aCFVOs=this._getCFVOs();var oCFVO=aCFVOs&&0<aCFVOs.length?aCFVOs[0]:null;return this._getValue(values,oCFVO,ws)};CConditionalFormattingRule.prototype.getMid=function(values,ws){var aCFVOs=this._getCFVOs();var oCFVO=aCFVOs&&2<aCFVOs.length?aCFVOs[1]:null;return this._getValue(values,oCFVO,ws)};CConditionalFormattingRule.prototype.getMax=function(values,ws){var aCFVOs=this._getCFVOs();var oCFVO=aCFVOs&&2===aCFVOs.length?aCFVOs[1]:aCFVOs&&2<aCFVOs.length?aCFVOs[2]:null;return this._getValue(values, oCFVO,ws)};CConditionalFormattingRule.prototype._getCFVOs=function(){var oRuleElement=this.aRuleElements[0];return oRuleElement&&oRuleElement.aCFVOs};CConditionalFormattingRule.prototype._getValue=function(values,oCFVO,ws){var res,min;if(oCFVO){if(oCFVO.Val){res=0;if(null===oCFVO.formula){oCFVO.formulaParent=new CConditionalFormattingFormulaParent(ws,this,false);oCFVO.formula=new CFormulaCF;oCFVO.formula.Text=oCFVO.Val}var calcRes=oCFVO.formula.getValue(ws,oCFVO.formulaParent,null,null,true);if(calcRes&& calcRes.tocNumber){calcRes=calcRes.tocNumber();if(calcRes&&calcRes.toNumber)res=calcRes.toNumber()}}switch(oCFVO.Type){case AscCommonExcel.ECfvoType.Minimum:res=AscCommonExcel.getArrayMin(values);break;case AscCommonExcel.ECfvoType.Maximum:res=AscCommonExcel.getArrayMax(values);break;case AscCommonExcel.ECfvoType.Number:break;case AscCommonExcel.ECfvoType.Percent:min=AscCommonExcel.getArrayMin(values);res=min+(AscCommonExcel.getArrayMax(values)-min)*res/100;break;case AscCommonExcel.ECfvoType.Percentile:res= AscCommonExcel.getPercentile(values,res/100);if(AscCommonExcel.cElementType.number===res.type)res=res.getValue();else res=AscCommonExcel.getArrayMin(values);break;case AscCommonExcel.ECfvoType.Formula:break;case AscCommonExcel.ECfvoType.AutoMin:res=Math.min(0,AscCommonExcel.getArrayMin(values));break;case AscCommonExcel.ECfvoType.AutoMax:res=Math.max(0,AscCommonExcel.getArrayMax(values));break;default:res=-Number.MAX_VALUE;break}}return res};CConditionalFormattingRule.prototype.asc_getType=function(){return this.type}; CConditionalFormattingRule.prototype.asc_getDxf=function(){return this.dxf};CConditionalFormattingRule.prototype.asc_getLocation=function(){var arrResult=[];if(this.ranges)this.ranges.forEach(function(item){arrResult.push(item.getAbsName())});return arrResult.join(AscCommon.FormulaSeparators.functionArgumentSeparator)};CConditionalFormattingRule.prototype.asc_getContainsText=function(){if(null!==this.text)return this.text;var ruleElement=this.aRuleElements[1];return ruleElement&&ruleElement.getFormula? ruleElement.Text:null};CConditionalFormattingRule.prototype.asc_getTimePeriod=function(){return this.timePeriod};CConditionalFormattingRule.prototype.asc_getOperator=function(){return this.operator};CConditionalFormattingRule.prototype.asc_getRank=function(){return this.rank};CConditionalFormattingRule.prototype.asc_getBottom=function(){return this.bottom};CConditionalFormattingRule.prototype.asc_getPercent=function(){return this.percent};CConditionalFormattingRule.prototype.asc_getAboveAverage=function(){return this.aboveAverage}; CConditionalFormattingRule.prototype.asc_getEqualAverage=function(){return this.equalAverage};CConditionalFormattingRule.prototype.asc_getStdDev=function(){return this.stdDev};CConditionalFormattingRule.prototype.asc_getValue1=function(){var ruleElement=this.aRuleElements[0];return ruleElement&&ruleElement.getFormula?ruleElement.Text:null};CConditionalFormattingRule.prototype.asc_getValue2=function(){var ruleElement=this.aRuleElements[1];return ruleElement&&ruleElement.getFormula?ruleElement.Text: null};CConditionalFormattingRule.prototype.asc_getColorScaleOrDataBarOrIconSetRule=function(){if((Asc.ECfType.dataBar===this.type||Asc.ECfType.iconSet===this.type||Asc.ECfType.colorScale===this.type)&&1===this.aRuleElements.length){var res=this.aRuleElements[0];if(res&&this.type===res.type)return res}return null};function CColorScale(){this.aCFVOs=[];this.aColors=[];return this}CColorScale.prototype.type=Asc.ECfType.colorScale;CColorScale.prototype.clone=function(){var i,res=new CColorScale;for(i= 0;i<this.aCFVOs.length;++i)res.aCFVOs.push(this.aCFVOs[i].clone());for(i=0;i<this.aColors.length;++i)res.aColors.push(this.aColors[i].clone());return res};CColorScale.prototype.asc_getCFVOs=function(){return this.aCFVOs};CColorScale.prototype.asc_getColors=function(){var res=[];for(var i=0;i<this.aColors.length;++i)res.push(Asc.colorObjToAscColor(this.aColors[i]));return res};function CDataBar(){this.MaxLength=90;this.MinLength=10;this.ShowValue=true;this.AxisPosition=AscCommonExcel.EDataBarAxisPosition.automatic; this.Gradient=true;this.Direction=AscCommonExcel.EDataBarDirection.context;this.NegativeBarColorSameAsPositive=false;this.NegativeBarBorderColorSameAsPositive=true;this.aCFVOs=[];this.Color=null;this.NegativeColor=null;this.BorderColor=null;this.NegativeBorderColor=null;this.AxisColor=null;return this}CDataBar.prototype.type=Asc.ECfType.dataBar;CDataBar.prototype.clone=function(){var i,res=new CDataBar;res.MaxLength=this.MaxLength;res.MinLength=this.MinLength;res.ShowValue=this.ShowValue;res.AxisPosition= this.AxisPosition;res.Gradient=this.Gradient;res.Direction=this.Direction;res.NegativeBarColorSameAsPositive=this.NegativeBarColorSameAsPositive;res.NegativeBarBorderColorSameAsPositive=this.NegativeBarBorderColorSameAsPositive;for(i=0;i<this.aCFVOs.length;++i)res.aCFVOs.push(this.aCFVOs[i].clone());if(this.Color)res.Color=this.Color.clone();if(this.NegativeColor)res.NegativeColor=this.NegativeColor.clone();if(this.BorderColor)res.BorderColor=this.BorderColor.clone();if(this.NegativeBorderColor)res.NegativeBorderColor= this.NegativeBorderColor.clone();if(this.AxisColor)res.AxisColor=this.AxisColor.clone();return res};CDataBar.prototype.asc_getShowValue=function(){return this.ShowValue};CDataBar.prototype.asc_getAxisPosition=function(){return this.AxisPosition};CDataBar.prototype.asc_getGradient=function(){return this.Gradient};CDataBar.prototype.asc_getDirection=function(){return this.Direction};CDataBar.prototype.asc_getNegativeBarColorSameAsPositive=function(){return this.NegativeBarColorSameAsPositive};CDataBar.prototype.asc_getNegativeBarBorderColorSameAsPositive= function(){return this.NegativeBarBorderColorSameAsPositive};CDataBar.prototype.asc_getCFVOs=function(){return this.aCFVOs};CDataBar.prototype.asc_getColor=function(){return Asc.colorObjToAscColor(this.Color)};CDataBar.prototype.asc_getNegativeColor=function(){return Asc.colorObjToAscColor(this.NegativeColor)};CDataBar.prototype.asc_getBorderColor=function(){return Asc.colorObjToAscColor(this.BorderColor)};CDataBar.prototype.asc_getNegativeBorderColor=function(){return Asc.colorObjToAscColor(this.NegativeBorderColor)}; CDataBar.prototype.asc_getAxisColor=function(){return Asc.colorObjToAscColor(this.AxisColor)};function CFormulaCF(){this.Text=null;this._f=null;return this}CFormulaCF.prototype.clone=function(){var res=new CFormulaCF;res.Text=this.Text;return res};CFormulaCF.prototype.init=function(ws,opt_parent){if(!this._f){this._f=new AscCommonExcel.parserFormula(this.Text,opt_parent,ws);this._f.parse();if(opt_parent)this._f.buildDependencies()}};CFormulaCF.prototype.getFormula=function(ws,opt_parent){this.init(ws, opt_parent);return this._f};CFormulaCF.prototype.getValue=function(ws,opt_parent,opt_bbox,opt_offset,opt_returnRaw){this.init(ws,opt_parent);var res=this._f.calculate(null,opt_bbox,opt_offset);if(!opt_returnRaw)res=this._f.simplifyRefType(res);return res};function CIconSet(){this.IconSet=EIconSetType.Traffic3Lights1;this.Percent=true;this.Reverse=false;this.ShowValue=true;this.aCFVOs=[];this.aIconSets=[];return this}CIconSet.prototype.type=Asc.ECfType.iconSet;CIconSet.prototype.clone=function(){var i, res=new CIconSet;res.IconSet=this.IconSet;res.Percent=this.Percent;res.Reverse=this.Reverse;res.ShowValue=this.ShowValue;for(i=0;i<this.aCFVOs.length;++i)res.aCFVOs.push(this.aCFVOs[i].clone());for(i=0;i<this.aIconSets.length;++i)res.aIconSets.push(this.aIconSets[i].clone());return res};CIconSet.prototype.asc_getIconSet=function(){return this.IconSet};CIconSet.prototype.asc_getReverse=function(){return this.Reverse};CIconSet.prototype.asc_getShowValue=function(){return this.ShowValue};CIconSet.prototype.asc_getCFVOs= function(){return this.aCFVOs};CIconSet.prototype.asc_getIconSets=function(){return this.aIconSets};function CConditionalFormatValueObject(){this.Gte=true;this.Type=null;this.Val=null;this.formulaParent=null;this.formula=null;return this}CConditionalFormatValueObject.prototype.clone=function(){var res=new CConditionalFormatValueObject;res.Gte=this.Gte;res.Type=this.Type;res.Val=this.Val;res.formulaParent=this.formulaParent?this.formulaParent.clone():null;res.formula=this.formula?this.formula.clone(): null;return res};CConditionalFormatValueObject.prototype.asc_getGte=function(){return this.Gte};CConditionalFormatValueObject.prototype.asc_getType=function(){return this.Type};CConditionalFormatValueObject.prototype.asc_getVal=function(){return this.Val};function CConditionalFormatIconSet(){this.IconSet=null;this.IconId=null;return this}CConditionalFormatIconSet.prototype.clone=function(){var res=new CConditionalFormatIconSet;res.IconSet=this.IconSet;res.IconId=this.IconId;return res};function CGradient(c1, c2){this.MaxColorIndex=512;this.base_shift=8;this.c1=c1;this.c2=c2;this.min=this.max=0;this.koef=null;this.r1=this.r2=0;this.g1=this.g2=0;this.b1=this.b2=0;return this}CGradient.prototype.init=function(min,max){var distance=max-min;this.min=min;this.max=max;this.koef=distance?this.MaxColorIndex/(2*distance):0;this.r1=this.c1.getR();this.g1=this.c1.getG();this.b1=this.c1.getB();this.r2=this.c2.getR();this.g2=this.c2.getG();this.b2=this.c2.getB()};CGradient.prototype.calculateColor=function(indexColor){indexColor= (indexColor-this.min)*this.koef>>0;var r=this.r1+(FT_Common.IntToUInt(this.r2-this.r1)*indexColor>>this.base_shift)&255;var g=this.g1+(FT_Common.IntToUInt(this.g2-this.g1)*indexColor>>this.base_shift)&255;var b=this.b1+(FT_Common.IntToUInt(this.b2-this.b1)*indexColor>>this.base_shift)&255;return new AscCommonExcel.RgbColor((r<<16)+(g<<8)+b)};CGradient.prototype.getMinColor=function(){return new AscCommonExcel.RgbColor((this.r1<<16)+(this.g1<<8)+this.b1)};CGradient.prototype.getMaxColor=function(){return new AscCommonExcel.RgbColor((this.r2<< 16)+(this.g2<<8)+this.b2)};var cDefIconSize=16;var cDefIconFont=11;var iCheckGreen="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTUgOEMxNSAxMS44NjYgMTEuODY2IDE1IDggMTVDNC4xMzQwMSAxNSAxIDExLjg2NiAxIDhDMSA0LjEzNDAxIDQuMTM0MDEgMSA4IDFDMTEuODY2IDEgMTUgNC4xMzQwMSAxNSA4WiIgZmlsbD0iIzJFOTk1RiIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTIuODA1MSA1LjU5MzJMNy42MzkxOCAxMi42MDQxTDQuMjQxNyA4LjY1MTg5TDUuNzU4MzMgNy4zNDgxMUw3LjUxODc1IDkuMzk1OTRMMTEuMTk1IDQuNDA2OEwxMi44MDUxIDUuNTkzMloiIGZpbGw9IndoaXRlIi8+PC9zdmc+"; var iCheckSymbolGreen="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE0IDQuMjk1NzhMNi42ODIwMyAxNEwyIDguNjc4MjFMMy42MzQxNyA3LjI1NjA4TDYuNTUyMTggMTAuNTcyOEwxMi4yNjI4IDNMMTQgNC4yOTU3OFoiIGZpbGw9IiMyRTk5NUYiLz48L3N2Zz4=";var iCircleTwoWhiteQuarters="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNyIgZmlsbD0iIzUwNTA1MCIvPjxwYXRoIGQ9Ik04IDJDNi40MDg3IDIgNC44ODI1OCAyLjYzMjE0IDMuNzU3MzYgMy43NTczNkMyLjYzMjE0IDQuODgyNTggMiA2LjQwODcgMiA4QzIgOS41OTEzIDIuNjMyMTQgMTEuMTE3NCAzLjc1NzM2IDEyLjI0MjZDNC44ODI1OCAxMy4zNjc5IDYuNDA4NyAxNCA4IDE0TDggOEw4IDJaIiBmaWxsPSJ3aGl0ZSIvPjwvc3ZnPg=="; var iCircleBlack="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNyIgZmlsbD0iIzUwNTA1MCIvPjwvc3ZnPg==";var iCircleGray="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNyIgZmlsbD0iIzlCOUI5QiIvPjwvc3ZnPg==";var iCircleGreen="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTUgOEMxNSAxMS44NjYgMTEuODY2IDE1IDggMTVDNC4xMzQwMSAxNSAxIDExLjg2NiAxIDhDMSA0LjEzNDAxIDQuMTM0MDEgMSA4IDFDMTEuODY2IDEgMTUgNC4xMzQwMSAxNSA4WiIgZmlsbD0iIzJFOTk1RiIvPjwvc3ZnPg=="; var iCircleOneWhiteQuarter="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNyIgZmlsbD0iIzUwNTA1MCIvPjxwYXRoIGQ9Ik04IDJDNy4yMTIwNyAyIDYuNDMxODUgMi4xNTUxOSA1LjcwMzkgMi40NTY3MkM0Ljk3NTk1IDIuNzU4MjUgNC4zMTQ1MSAzLjIwMDIxIDMuNzU3MzYgMy43NTczNkMzLjIwMDIxIDQuMzE0NTEgMi43NTgyNSA0Ljk3NTk1IDIuNDU2NzIgNS43MDM5QzIuMTU1MTkgNi40MzE4NSAyIDcuMjEyMDcgMiA4TDggOEw4IDJaIiBmaWxsPSJ3aGl0ZSIvPjwvc3ZnPg=="; var iCircleLightRed="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZWxsaXBzZSBjeD0iOCIgY3k9IjgiIHJ4PSI3IiByeT0iNyIgdHJhbnNmb3JtPSJyb3RhdGUoLTE4MCA4IDgpIiBmaWxsPSIjRkY4MDgwIi8+PC9zdmc+";var iCircleRed="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTUgOEMxNSAxMS44NjYgMTEuODY2IDE1IDggMTVDNC4xMzQwMSAxNSAxIDExLjg2NiAxIDhDMSA0LjEzNDAxIDQuMTM0MDEgMSA4IDFDMTEuODY2IDEgMTUgNC4xMzQwMSAxNSA4WiIgZmlsbD0iI0ZGMTExMSIvPjwvc3ZnPg=="; var iCircleThreeWhiteQuarters="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNyIgZmlsbD0iIzUwNTA1MCIvPjxwYXRoIGQ9Ik04IDJDNi44MTMzMSAyIDUuNjUzMjggMi4zNTE4OSA0LjY2NjU4IDMuMDExMThDMy42Nzk4OSAzLjY3MDQ3IDIuOTEwODUgNC42MDc1NCAyLjQ1NjczIDUuNzAzOUMyLjAwMjYgNi44MDAyNSAxLjg4Mzc4IDguMDA2NjUgMi4xMTUyOSA5LjE3MDU0QzIuMzQ2OCAxMC4zMzQ0IDIuOTE4MjUgMTEuNDAzNSAzLjc1NzM2IDEyLjI0MjZDNC41OTY0OCAxMy4wODE4IDUuNjY1NTggMTMuNjUzMiA2LjgyOTQ2IDEzLjg4NDdDNy45OTMzNSAxNC4xMTYyIDkuMTk5NzUgMTMuOTk3NCAxMC4yOTYxIDEzLjU0MzNDMTEuMzkyNSAxMy4wODkxIDEyLjMyOTUgMTIuMzIwMSAxMi45ODg4IDExLjMzMzRDMTMuNjQ4MSAxMC4zNDY3IDE0IDkuMTg2NjggMTQgOEw4IDhMOCAyWiIgZmlsbD0id2hpdGUiLz48L3N2Zz4="; var iCircleWhite="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNyIgZmlsbD0iIzUwNTA1MCIvPjxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI2IiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgOCA4KSIgZmlsbD0id2hpdGUiLz48L3N2Zz4=";var iCircleYellow="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTUgOEMxNSAxMS44NjYgMTEuODY2IDE1IDggMTVDNC4xMzQwMSAxNSAxIDExLjg2NiAxIDhDMSA0LjEzNDAxIDQuMTM0MDEgMSA4IDFDMTEuODY2IDEgMTUgNC4xMzQwMSAxNSA4WiIgZmlsbD0iI0ZGQ0YzMyIvPjwvc3ZnPg=="; var iCrossRed="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuOTk5OSA3Ljk5OTk2QzE0Ljk5OTkgMTEuODY1OSAxMS44NjU5IDE0Ljk5OTkgNy45OTk5NiAxNC45OTk5QzQuMTMzOTkgMTQuOTk5OSAxIDExLjg2NTkgMSA3Ljk5OTk2QzEgNC4xMzM5OSA0LjEzMzk5IDEgNy45OTk5NiAxQzExLjg2NTkgMSAxNC45OTk5IDQuMTMzOTkgMTQuOTk5OSA3Ljk5OTk2WiIgZmlsbD0iI0ZGMTExMSIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNi41ODU4IDhMNC4yOTI5MSA1LjcwNzExTDUuNzA3MTIgNC4yOTI4OUw4LjAwMDAxIDYuNTg1NzlMMTAuMjkyOSA0LjI5Mjg5TDExLjcwNzEgNS43MDcxMUw5LjQxNDIzIDhMMTEuNzA3MSAxMC4yOTI5TDEwLjI5MjkgMTEuNzA3MUw4LjAwMDAxIDkuNDE0MjFMNS43MDcxMiAxMS43MDcxTDQuMjkyOTEgMTAuMjkyOUw2LjU4NTggOFoiIGZpbGw9IndoaXRlIi8+PC9zdmc+"; var iCrossSymbolRed="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMTk3MzUgOEwyIDMuODAyNjVMMy44MDI2NSAyTDggNi4xOTczNUwxMi4xOTczIDJMMTQgMy44MDI2NUw5LjgwMjY1IDhMMTQgMTIuMTk3M0wxMi4xOTczIDE0TDggOS44MDI2NUwzLjgwMjY1IDE0TDIgMTIuMTk3M0w2LjE5NzM1IDhaIiBmaWxsPSIjRkYxMTExIi8+PC9zdmc+";var iDashYellow="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMSA1SDE1VjExSDFWNVoiIGZpbGw9IiNGRkNGMzMiLz48L3N2Zz4="; var iDiamondRed="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSI4IiB5PSIxIiB3aWR0aD0iOS44OTk1IiBoZWlnaHQ9IjkuODk5NSIgcng9IjIiIHRyYW5zZm9ybT0icm90YXRlKDQ1IDggMSkiIGZpbGw9IiNGRjExMTEiLz48L3N2Zz4=";var iDown="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuNSAxNUwwLjUgOEg1VjFIMTBWOEgxNC41TDcuNSAxNVoiIGZpbGw9IiNGRjExMTEiLz48L3N2Zz4="; var iDownGray="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuNSAxNUwwLjUgOEg1VjFIMTBWOEgxNC41TDcuNSAxNVoiIGZpbGw9IiM1MDUwNTAiLz48L3N2Zz4=";var iDownIncline="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEzIDE1TDMuMTAwNTMgMTVMNi4yODI1MSAxMS44MThMMS4zMzI3NiA2Ljg2ODI3TDQuODY4MyAzLjMzMjczTDkuODE4MDUgOC4yODI0OEwxMyA1LjEwMDVMMTMgMTVaIiBmaWxsPSIjRkZDRjMzIi8+PC9zdmc+"; var iDownInclineGray="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDApIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE0IDE0TDQuMTAwNTEgMTRMNy4yODI0OSAxMC44MThMMi4zMzI3NCA1Ljg2ODI3TDUuODY4MjcgMi4zMzI3NEwxMC44MTggNy4yODI0OUwxNCA0LjEwMDUxTDE0IDE0WiIgZmlsbD0iIzUwNTA1MCIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwIj48cmVjdCB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9IndoaXRlIi8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+"; var iExclamationSymbolYellow="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNy40MDcyOCA4LjkxNTQ2TDcuMDg5NCA0LjQ4NjEzQzcuMDI5OCAzLjYyMzA3IDcgMy4wMDM1MiA3IDIuNjI3NDhDNyAyLjExNTgxIDcuMTQyMzggMS43MTgxOSA3LjQyNzE1IDEuNDM0NjFDNy43MTg1NCAxLjE0NDg3IDguMDk5MzQgMSA4LjU2OTU0IDFDOS4xMzkwNyAxIDkuNTE5ODcgMS4xODQ5NCA5LjcxMTkyIDEuNTU0ODJDOS45MDM5NyAxLjkxODU0IDEwIDIuNDQ1NjIgMTAgMy4xMzYwNkMxMCAzLjU0MjkzIDkuOTc2ODIgMy45NTU5NyA5LjkzMDQ2IDQuMzc1MTZMOS41MDMzMSA4LjkzMzk1QzkuNDU2OTUgOS40NzY0NCA5LjM1NzYyIDkuODkyNTYgOS4yMDUzIDEwLjE4MjNDOS4wNTI5OCAxMC40NzIgOC44MDEzMiAxMC42MTY5IDguNDUwMzMgMTAuNjE2OUM4LjA5MjcyIDEwLjYxNjkgNy44NDQzNyAxMC40NzgyIDcuNzA1MyAxMC4yMDA4QzcuNTY2MjMgOS45MTcyMiA3LjQ2Njg5IDkuNDg4NzcgNy40MDcyOCA4LjkxNTQ2Wk04LjUwOTkzIDE1QzguMTA1OTYgMTUgNy43NTE2NiAxNC44Nzk4IDcuNDQ3MDIgMTQuNjM5NEM3LjE0OTAxIDE0LjM5MjggNyAxNC4wNTA2IDcgMTMuNjEyOUM3IDEzLjIzMDcgNy4xNDIzOCAxMi45MDcxIDcuNDI3MTUgMTIuNjQyQzcuNzE4NTQgMTIuMzcwOCA4LjA3Mjg1IDEyLjIzNTEgOC40OTAwNyAxMi4yMzUxQzguOTA3MjggMTIuMjM1MSA5LjI2MTU5IDEyLjM3MDggOS41NTI5OCAxMi42NDJDOS44NTA5OSAxMi45MDcxIDEwIDEzLjIzMDcgMTAgMTMuNjEyOUMxMCAxNC4wNDQ1IDkuODUwOTkgMTQuMzgzNSA5LjU1Mjk4IDE0LjYzMDFDOS4yNTQ5NyAxNC44NzY3IDguOTA3MjggMTUgOC41MDk5MyAxNVoiIGZpbGw9IiNGRkNGMzMiLz48L3N2Zz4="; var iExclamationYellow="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTUgOEMxNSAxMS44NjYgMTEuODY2IDE1IDggMTVDNC4xMzQwMSAxNSAxIDExLjg2NiAxIDhDMSA0LjEzNDAxIDQuMTM0MDEgMSA4IDFDMTEuODY2IDEgMTUgNC4xMzQwMSAxNSA4WiIgZmlsbD0iI0ZGQ0YzMyIvPjxwYXRoIGQ9Ik03LjI3MTUyIDguNjUzOUw3LjA1OTYgNS40OTAwOUM3LjAxOTg3IDQuODczNjIgNyA0LjQzMTA5IDcgNC4xNjI0OEM3IDMuNzk3MDEgNy4wOTQ5MiAzLjUxMjk5IDcuMjg0NzcgMy4zMTA0NEM3LjQ3OTAzIDMuMTAzNDggNy43MzI4OSAzIDguMDQ2MzYgM0M4LjQyNjA1IDMgOC42Nzk5MSAzLjEzMjEgOC44MDc5NSAzLjM5NjNDOC45MzU5OCAzLjY1NjEgOSA0LjAzMjU4IDkgNC41MjU3NkM5IDQuODE2MzggOC45ODQ1NSA1LjExMTQgOC45NTM2NCA1LjQxMDgzTDguNjY4ODcgOC42NjcxMUM4LjYzNzk3IDkuMDU0NiA4LjU3MTc0IDkuMzUxODMgOC40NzAyIDkuNTU4NzhDOC4zNjg2NSA5Ljc2NTc0IDguMjAwODggOS44NjkyMiA3Ljk2Njg5IDkuODY5MjJDNy43Mjg0OCA5Ljg2OTIyIDcuNTYyOTEgOS43NzAxNSA3LjQ3MDIgOS41NzE5OUM3LjM3NzQ4IDkuMzY5NDQgNy4zMTEyNiA5LjA2MzQxIDcuMjcxNTIgOC42NTM5Wk04LjAwNjYyIDEzQzcuNzM3MzEgMTMgNy41MDExIDEyLjkxNDEgNy4yOTgwMSAxMi43NDI0QzcuMDk5MzQgMTIuNTY2MyA3IDEyLjMyMTkgNyAxMi4wMDkyQzcgMTEuNzM2MiA3LjA5NDkyIDExLjUwNTEgNy4yODQ3NyAxMS4zMTU3QzcuNDc5MDMgMTEuMTIyIDcuNzE1MjMgMTEuMDI1MSA3Ljk5MzM4IDExLjAyNTFDOC4yNzE1MiAxMS4wMjUxIDguNTA3NzMgMTEuMTIyIDguNzAxOTkgMTEuMzE1N0M4LjkwMDY2IDExLjUwNTEgOSAxMS43MzYyIDkgMTIuMDA5MkM5IDEyLjMxNzUgOC45MDA2NiAxMi41NTk3IDguNzAxOTkgMTIuNzM1OEM4LjUwMzMxIDEyLjkxMTkgOC4yNzE1MiAxMyA4LjAwNjYyIDEzWiIgZmlsbD0id2hpdGUiLz48L3N2Zz4="; var iFlagGreen="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNSAxTDUgMTBMMTQgNS41TDUgMVoiIGZpbGw9IiMyRTk5NUYiLz48cmVjdCB4PSIyIiB5PSIwLjk5OTk5NiIgd2lkdGg9IjIiIGhlaWdodD0iMTQiIGZpbGw9IiM3MjcyNzIiLz48L3N2Zz4=";var iFlagRed="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNSAxTDUgMTBMMTQgNS41TDUgMVoiIGZpbGw9IiNGRjExMTEiLz48cmVjdCB4PSIyIiB5PSIwLjk5OTk5NiIgd2lkdGg9IjIiIGhlaWdodD0iMTQiIGZpbGw9IiM3MjcyNzIiLz48L3N2Zz4="; var iFlagYellow="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNSAxTDUgMTBMMTQgNS41TDUgMVoiIGZpbGw9IiNGRkNGMzMiLz48cmVjdCB4PSIyIiB5PSIwLjk5OTk5NiIgd2lkdGg9IjIiIGhlaWdodD0iMTQiIGZpbGw9IiM3MjcyNzIiLz48L3N2Zz4=";var iFourFilledBars="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIxMCIgd2lkdGg9IjMiIGhlaWdodD0iNSIgZmlsbD0iIzIzNjFCRSIvPjxyZWN0IHg9IjUiIHk9IjciIHdpZHRoPSIzIiBoZWlnaHQ9IjgiIGZpbGw9IiMyMzYxQkUiLz48cmVjdCB4PSI5IiB5PSI0IiB3aWR0aD0iMyIgaGVpZ2h0PSIxMSIgZmlsbD0iIzIzNjFCRSIvPjxyZWN0IHg9IjEzIiB5PSIxIiB3aWR0aD0iMyIgaGVpZ2h0PSIxNCIgZmlsbD0iIzIzNjFCRSIvPjwvc3ZnPg=="; var iFourFilledBoxes="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMSAySDdWOEgxVjJaIiBmaWxsPSIjMjM2MUJFIi8+PHJlY3QgeD0iOCIgeT0iMiIgd2lkdGg9IjYiIGhlaWdodD0iNiIgZmlsbD0iIzIzNjFCRSIvPjxyZWN0IHg9IjgiIHk9IjkiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIGZpbGw9IiMyMzYxQkUiLz48cmVjdCB4PSIxIiB5PSI5IiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjMjM2MUJFIi8+PC9zdmc+";var iOneFilledBars="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIxMCIgd2lkdGg9IjMiIGhlaWdodD0iNSIgZmlsbD0iIzIzNjFCRSIvPjxyZWN0IHg9IjUiIHk9IjciIHdpZHRoPSIzIiBoZWlnaHQ9IjgiIGZpbGw9IiNDQ0NDQ0MiLz48cmVjdCB4PSI5IiB5PSI0IiB3aWR0aD0iMyIgaGVpZ2h0PSIxMSIgZmlsbD0iI0NDQ0NDQyIvPjxyZWN0IHg9IjEzIiB5PSIxIiB3aWR0aD0iMyIgaGVpZ2h0PSIxNCIgZmlsbD0iI0NDQ0NDQyIvPjwvc3ZnPg=="; var iOneFilledBoxes="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIyIiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjQ0NDQ0NDIi8+PHJlY3QgeD0iOCIgeT0iMiIgd2lkdGg9IjYiIGhlaWdodD0iNiIgZmlsbD0iI0NDQ0NDQyIvPjxyZWN0IHg9IjgiIHk9IjkiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIGZpbGw9IiNDQ0NDQ0MiLz48cmVjdCB4PSIxIiB5PSI5IiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjMjM2MUJFIi8+PC9zdmc+";var iSide="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1IDguNUw4IDE1LjVMOCAxMUwxIDExTDEgNkw4IDZMOCAxLjVMMTUgOC41WiIgZmlsbD0iI0ZGQ0YzMyIvPjwvc3ZnPg=="; var iSideGray="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1IDguNUw4IDE1LjVMOCAxMUwxIDExTDEgNkw4IDZMOCAxLjVMMTUgOC41WiIgZmlsbD0iIzUwNTA1MCIvPjwvc3ZnPg==";var iStarGold="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNy41IDIuMTI5NzhMOS4xMzk0OSA1LjQ1MTc1QzkuMjg1MTUgNS43NDY4OSA5LjU2NjcyIDUuOTUxNDYgOS44OTI0MyA1Ljk5ODc5TDEzLjU1ODQgNi41MzE0OUwxMC45MDU3IDkuMTE3MjlDMTAuNjcgOS4zNDcwMiAxMC41NjI1IDkuNjc4MDIgMTAuNjE4MSAxMC4wMDI0TDExLjI0NDMgMTMuNjUzNkw3Ljk2NTM0IDExLjkyOThDNy42NzQwMiAxMS43NzY2IDcuMzI1OTggMTEuNzc2NiA3LjAzNDY2IDExLjkyOThMMy43NTU2OCAxMy42NTM2TDQuMzgxOTEgMTAuMDAyNEM0LjQzNzU0IDkuNjc4MDMgNC4zMyA5LjM0NzAyIDQuMDk0MzEgOS4xMTcyOUwxLjQ0MTU2IDYuNTMxNDlMNS4xMDc1NyA1Ljk5ODc5QzUuNDMzMjggNS45NTE0NiA1LjcxNDg1IDUuNzQ2ODkgNS44NjA1MSA1LjQ1MTc1TDcuNSAyLjEyOTc4WiIgZmlsbD0iI0ZGQ0YzMyIgc3Ryb2tlPSIjRERBMTA5Ii8+PC9zdmc+"; var iStarHalf="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48bWFzayBpZD0ibWFzazAiIG1hc2stdHlwZT0iYWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjEiIHk9IjEiIHdpZHRoPSI3IiBoZWlnaHQ9IjE1Ij48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIxNSIgdHJhbnNmb3JtPSJtYXRyaXgoLTEgMCAwIDEgOCAxKSIgZmlsbD0iI0M0QzRDNCIvPjwvbWFzaz48ZyBtYXNrPSJ1cmwoI21hc2swKSI+PHBhdGggZD0iTTggMi4xMjk3OEw2LjM2MDUxIDUuNDUxNzVDNi4yMTQ4NSA1Ljc0Njg5IDUuOTMzMjggNS45NTE0NiA1LjYwNzU3IDUuOTk4NzlMMS45NDE1NiA2LjUzMTQ5TDQuNTk0MzEgOS4xMTcyOUM0LjgzIDkuMzQ3MDIgNC45Mzc1NCA5LjY3ODAyIDQuODgxOTEgMTAuMDAyNEw0LjI1NTY4IDEzLjY1MzZMNy41MzQ2NiAxMS45Mjk4QzcuODI1OTggMTEuNzc2NiA4LjE3NDAyIDExLjc3NjYgOC40NjUzNCAxMS45Mjk4TDExLjc0NDMgMTMuNjUzNkwxMS4xMTgxIDEwLjAwMjRDMTEuMDYyNSA5LjY3ODAzIDExLjE3IDkuMzQ3MDIgMTEuNDA1NyA5LjExNzI5TDE0LjA1ODQgNi41MzE0OUwxMC4zOTI0IDUuOTk4NzlDMTAuMDY2NyA1Ljk1MTQ2IDkuNzg1MTUgNS43NDY4OSA5LjYzOTQ5IDUuNDUxNzVMOCAyLjEyOTc4WiIgZmlsbD0iI0ZGQ0YzMyIgc3Ryb2tlPSIjRERBMTA5Ii8+PC9nPjxtYXNrIGlkPSJtYXNrMSIgbWFzay10eXBlPSJhbHBoYSIgbWFza1VuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeD0iOCIgeT0iMSIgd2lkdGg9IjciIGhlaWdodD0iMTUiPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjE1IiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSAxNSAxKSIgZmlsbD0iI0M0QzRDNCIvPjwvbWFzaz48ZyBtYXNrPSJ1cmwoI21hc2sxKSI+PHBhdGggZD0iTTggMi4xMjk3OEw2LjM2MDUxIDUuNDUxNzVDNi4yMTQ4NSA1Ljc0Njg5IDUuOTMzMjggNS45NTE0NiA1LjYwNzU3IDUuOTk4NzlMMS45NDE1NiA2LjUzMTQ5TDQuNTk0MzEgOS4xMTcyOUM0LjgzIDkuMzQ3MDIgNC45Mzc1NSA5LjY3ODAyIDQuODgxOTEgMTAuMDAyNEw0LjI1NTY4IDEzLjY1MzZMNy41MzQ2NiAxMS45Mjk4QzcuODI1OTggMTEuNzc2NiA4LjE3NDAyIDExLjc3NjYgOC40NjUzNCAxMS45Mjk4TDExLjc0NDMgMTMuNjUzNkwxMS4xMTgxIDEwLjAwMjRDMTEuMDYyNSA5LjY3ODAzIDExLjE3IDkuMzQ3MDIgMTEuNDA1NyA5LjExNzI5TDE0LjA1ODQgNi41MzE0OUwxMC4zOTI0IDUuOTk4NzlDMTAuMDY2NyA1Ljk1MTQ2IDkuNzg1MTUgNS43NDY4OSA5LjYzOTQ5IDUuNDUxNzVMOCAyLjEyOTc4WiIgZmlsbD0id2hpdGUiIHN0cm9rZT0iIzczNzM3MyIvPjwvZz48L3N2Zz4="; var iStarSilver="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNy41IDIuMTI5NzhMOS4xMzk0OSA1LjQ1MTc1QzkuMjg1MTUgNS43NDY4OSA5LjU2NjcyIDUuOTUxNDYgOS44OTI0MyA1Ljk5ODc5TDEzLjU1ODQgNi41MzE0OUwxMC45MDU3IDkuMTE3MjlDMTAuNjcgOS4zNDcwMiAxMC41NjI1IDkuNjc4MDIgMTAuNjE4MSAxMC4wMDI0TDExLjI0NDMgMTMuNjUzNkw3Ljk2NTM0IDExLjkyOThDNy42NzQwMiAxMS43NzY2IDcuMzI1OTggMTEuNzc2NiA3LjAzNDY2IDExLjkyOThMMy43NTU2OCAxMy42NTM2TDQuMzgxOTEgMTAuMDAyNEM0LjQzNzU0IDkuNjc4MDMgNC4zMyA5LjM0NzAyIDQuMDk0MzEgOS4xMTcyOUwxLjQ0MTU2IDYuNTMxNDlMNS4xMDc1NyA1Ljk5ODc5QzUuNDMzMjggNS45NTE0NiA1LjcxNDg1IDUuNzQ2ODkgNS44NjA1MSA1LjQ1MTc1TDcuNSAyLjEyOTc4WiIgZmlsbD0id2hpdGUiIHN0cm9rZT0iIzczNzM3MyIvPjwvc3ZnPg=="; var iThreeFilledBars="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIxMCIgd2lkdGg9IjMiIGhlaWdodD0iNSIgZmlsbD0iIzIzNjFCRSIvPjxyZWN0IHg9IjUiIHk9IjciIHdpZHRoPSIzIiBoZWlnaHQ9IjgiIGZpbGw9IiMyMzYxQkUiLz48cmVjdCB4PSI5IiB5PSI0IiB3aWR0aD0iMyIgaGVpZ2h0PSIxMSIgZmlsbD0iIzIzNjFCRSIvPjxyZWN0IHg9IjEzIiB5PSIxIiB3aWR0aD0iMyIgaGVpZ2h0PSIxNCIgZmlsbD0iI0NDQ0NDQyIvPjwvc3ZnPg==";var iThreeFilledBoxes= "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIyIiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjMjM2MUJFIi8+PHJlY3QgeD0iOCIgeT0iMiIgd2lkdGg9IjYiIGhlaWdodD0iNiIgZmlsbD0iI0NDQ0NDQyIvPjxyZWN0IHg9IjgiIHk9IjkiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIGZpbGw9IiMyMzYxQkUiLz48cmVjdCB4PSIxIiB5PSI5IiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjMjM2MUJFIi8+PC9zdmc+";var iTrafficLightGreen="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMSAzQzEgMS44OTU0MyAxLjg5NTQzIDEgMyAxSDEzQzE0LjEwNDYgMSAxNSAxLjg5NTQzIDE1IDNWMTNDMTUgMTQuMTA0NiAxNC4xMDQ2IDE1IDEzIDE1SDNDMS44OTU0MyAxNSAxIDE0LjEwNDYgMSAxM1YzWiIgZmlsbD0iIzUwNTA1MCIvPjxwYXRoIGQ9Ik0xNCA4QzE0IDQuNjg2MjkgMTEuMzEzNyAyIDggMkM0LjY4NjI5IDIgMiA0LjY4NjI5IDIgOEMyIDExLjMxMzcgNC42ODYyOSAxNCA4IDE0QzExLjMxMzcgMTQgMTQgMTEuMzEzNyAxNCA4WiIgZmlsbD0id2hpdGUiLz48cGF0aCBkPSJNMTMgOEMxMyA1LjIzODU4IDEwLjc2MTQgMyA4IDNDNS4yMzg1OCAzIDMgNS4yMzg1OCAzIDhDMyAxMC43NjE0IDUuMjM4NTggMTMgOCAxM0MxMC43NjE0IDEzIDEzIDEwLjc2MTQgMTMgOFoiIGZpbGw9IiMyRTk5NUYiLz48L3N2Zz4="; var iTrafficLightRed="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMSAzQzEgMS44OTU0MyAxLjg5NTQzIDEgMyAxSDEzQzE0LjEwNDYgMSAxNSAxLjg5NTQzIDE1IDNWMTNDMTUgMTQuMTA0NiAxNC4xMDQ2IDE1IDEzIDE1SDNDMS44OTU0MyAxNSAxIDE0LjEwNDYgMSAxM1YzWiIgZmlsbD0iIzUwNTA1MCIvPjxwYXRoIGQ9Ik0xNCA4QzE0IDQuNjg2MjkgMTEuMzEzNyAyIDggMkM0LjY4NjI5IDIgMiA0LjY4NjI5IDIgOEMyIDExLjMxMzcgNC42ODYyOSAxNCA4IDE0QzExLjMxMzcgMTQgMTQgMTEuMzEzNyAxNCA4WiIgZmlsbD0id2hpdGUiLz48cGF0aCBkPSJNMTMgOEMxMyA1LjIzODU4IDEwLjc2MTQgMyA4IDNDNS4yMzg1OCAzIDMgNS4yMzg1OCAzIDhDMyAxMC43NjE0IDUuMjM4NTggMTMgOCAxM0MxMC43NjE0IDEzIDEzIDEwLjc2MTQgMTMgOFoiIGZpbGw9IiNGRjExMTEiLz48L3N2Zz4="; var iTrafficLightYellow="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMSAzQzEgMS44OTU0MyAxLjg5NTQzIDEgMyAxSDEzQzE0LjEwNDYgMSAxNSAxLjg5NTQzIDE1IDNWMTNDMTUgMTQuMTA0NiAxNC4xMDQ2IDE1IDEzIDE1SDNDMS44OTU0MyAxNSAxIDE0LjEwNDYgMSAxM1YzWiIgZmlsbD0iIzUwNTA1MCIvPjxwYXRoIGQ9Ik0xNCA4QzE0IDQuNjg2MjkgMTEuMzEzNyAyIDggMkM0LjY4NjI5IDIgMiA0LjY4NjI5IDIgOEMyIDExLjMxMzcgNC42ODYyOSAxNCA4IDE0QzExLjMxMzcgMTQgMTQgMTEuMzEzNyAxNCA4WiIgZmlsbD0id2hpdGUiLz48cGF0aCBkPSJNMTMgOEMxMyA1LjIzODU4IDEwLjc2MTQgMyA4IDNDNS4yMzg1OCAzIDMgNS4yMzg1OCAzIDhDMyAxMC43NjE0IDUuMjM4NTggMTMgOCAxM0MxMC43NjE0IDEzIDEzIDEwLjc2MTQgMTMgOFoiIGZpbGw9IiNGRkNGMzMiLz48L3N2Zz4="; var iTriangleYellow="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMSAxNUgxNUw4IDFMMSAxNVoiIGZpbGw9IiNGRkNGMzMiLz48L3N2Zz4=";var iTriangleGreen="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMSAxMkgxNUw4IDNMMSAxMloiIGZpbGw9IiMyRTk5NUYiLz48L3N2Zz4=";var iTriangleRed= "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTUgNEwxIDRMOCAxM0wxNSA0WiIgZmlsbD0iI0ZGMTExMSIvPjwvc3ZnPg==";var iTwoFilledBars="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIxMCIgd2lkdGg9IjMiIGhlaWdodD0iNSIgZmlsbD0iIzIzNjFCRSIvPjxyZWN0IHg9IjUiIHk9IjciIHdpZHRoPSIzIiBoZWlnaHQ9IjgiIGZpbGw9IiMyMzYxQkUiLz48cmVjdCB4PSI5IiB5PSI0IiB3aWR0aD0iMyIgaGVpZ2h0PSIxMSIgZmlsbD0iI0NDQ0NDQyIvPjxyZWN0IHg9IjEzIiB5PSIxIiB3aWR0aD0iMyIgaGVpZ2h0PSIxNCIgZmlsbD0iI0NDQ0NDQyIvPjwvc3ZnPg=="; var iTwoFilledBoxes="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIyIiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjQ0NDQ0NDIi8+PHJlY3QgeD0iOCIgeT0iMiIgd2lkdGg9IjYiIGhlaWdodD0iNiIgZmlsbD0iI0NDQ0NDQyIvPjxyZWN0IHg9IjgiIHk9IjkiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIGZpbGw9IiMyMzYxQkUiLz48cmVjdCB4PSIxIiB5PSI5IiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjMjM2MUJFIi8+PC9zdmc+";var iUp="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuNSAxTDE0LjUgOEwxMCA4VjE1TDUgMTVMNSA4TDAuNSA4TDcuNSAxWiIgZmlsbD0iIzJFOTk1RiIvPjwvc3ZnPg=="; var iUpGray="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuNSAxTDE0LjUgOEwxMCA4VjE1TDUgMTVMNSA4TDAuNSA4TDcuNSAxWiIgZmlsbD0iIzUwNTA1MCIvPjwvc3ZnPg==";var iUpIncline="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEzIDNMMy4xMDA1MyAzTDYuMjgyNTEgNi4xODE5OEwxLjMzMjc2IDExLjEzMTdMNC44NjgzIDE0LjY2NzNMOS44MTgwNCA5LjcxNzUxTDEzIDEyLjg5OTVWM1oiIGZpbGw9IiNGRkNGMzMiLz48L3N2Zz4="; var iUpInclineGray="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDApIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE0IDJMNC4xMDA1MSAyTDcuMjgyNDkgNS4xODE5OEwyLjMzMjc0IDEwLjEzMTdMNS44NjgyNyAxMy42NjczTDEwLjgxOCA4LjcxNzUxTDE0IDExLjg5OTVMMTQgMloiIGZpbGw9IiM1MDUwNTAiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMCI+PHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg=="; var iZeroFilledBars="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIxMCIgd2lkdGg9IjMiIGhlaWdodD0iNSIgZmlsbD0iI0NDQ0NDQyIvPjxyZWN0IHg9IjUiIHk9IjciIHdpZHRoPSIzIiBoZWlnaHQ9IjgiIGZpbGw9IiNDQ0NDQ0MiLz48cmVjdCB4PSI5IiB5PSI0IiB3aWR0aD0iMyIgaGVpZ2h0PSIxMSIgZmlsbD0iI0NDQ0NDQyIvPjxyZWN0IHg9IjEzIiB5PSIxIiB3aWR0aD0iMyIgaGVpZ2h0PSIxNCIgZmlsbD0iI0NDQ0NDQyIvPjwvc3ZnPg==";var iZeroFilledBoxes= "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxIiB5PSIyIiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjQ0NDQ0NDIi8+PHJlY3QgeD0iOCIgeT0iMiIgd2lkdGg9IjYiIGhlaWdodD0iNiIgZmlsbD0iI0NDQ0NDQyIvPjxyZWN0IHg9IjgiIHk9IjkiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIGZpbGw9IiNDQ0NDQ0MiLz48cmVjdCB4PSIxIiB5PSI5IiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjQ0NDQ0NDIi8+PC9zdmc+";var c_arrIcons=[20];c_arrIcons[EIconSetType.Arrows3]= [iDown,iSide,iUp];c_arrIcons[EIconSetType.Arrows3Gray]=[iDownGray,iSideGray,iUpGray];c_arrIcons[EIconSetType.Flags3]=[iFlagRed,iFlagYellow,iFlagGreen];c_arrIcons[EIconSetType.Signs3]=[iDiamondRed,iTriangleYellow,iCircleGreen];c_arrIcons[EIconSetType.Symbols3]=[iCrossRed,iExclamationYellow,iCheckGreen];c_arrIcons[EIconSetType.Symbols3_2]=[iCrossSymbolRed,iExclamationSymbolYellow,iCheckSymbolGreen];c_arrIcons[EIconSetType.Traffic3Lights1]=[iCircleRed,iCircleYellow,iCircleGreen];c_arrIcons[EIconSetType.Traffic3Lights2]= [iTrafficLightRed,iTrafficLightYellow,iTrafficLightGreen];c_arrIcons[EIconSetType.Arrows4]=[iDown,iDownIncline,iUpIncline,iUp];c_arrIcons[EIconSetType.Arrows4Gray]=[iDownGray,iDownInclineGray,iUpInclineGray,iUpGray];c_arrIcons[EIconSetType.Rating4]=[iOneFilledBars,iTwoFilledBars,iThreeFilledBars,iFourFilledBars];c_arrIcons[EIconSetType.RedToBlack4]=[iCircleBlack,iCircleGray,iCircleLightRed,iCircleRed];c_arrIcons[EIconSetType.Traffic4Lights]=[iCircleBlack,iCircleRed,iCircleYellow,iCircleGreen];c_arrIcons[EIconSetType.Arrows5]= [iDown,iDownIncline,iSide,iUpIncline,iUp];c_arrIcons[EIconSetType.Arrows5Gray]=[iDownGray,iDownInclineGray,iSideGray,iUpInclineGray,iUpGray];c_arrIcons[EIconSetType.Quarters5]=[iCircleWhite,iCircleThreeWhiteQuarters,iCircleTwoWhiteQuarters,iCircleOneWhiteQuarter,iCircleBlack];c_arrIcons[EIconSetType.Rating5]=[iZeroFilledBars,iOneFilledBars,iTwoFilledBars,iThreeFilledBars,iFourFilledBars];c_arrIcons[EIconSetType.Triangles3]=[iTriangleRed,iDashYellow,iTriangleGreen];c_arrIcons[EIconSetType.Stars3]= [iStarSilver,iStarHalf,iStarGold];c_arrIcons[EIconSetType.Boxes5]=[iZeroFilledBoxes,iOneFilledBoxes,iTwoFilledBoxes,iThreeFilledBoxes,iFourFilledBoxes];function getCFIconsForLoad(){return[iCheckGreen,iCheckSymbolGreen,iCircleTwoWhiteQuarters,iCircleBlack,iCircleGray,iCircleGreen,iCircleLightRed,iCircleOneWhiteQuarter,iCircleRed,iCircleThreeWhiteQuarters,iCircleWhite,iCircleYellow,iCrossRed,iCrossSymbolRed,iDashYellow,iDiamondRed,iDown,iDownGray,iDownIncline,iDownInclineGray,iExclamationSymbolYellow, iExclamationYellow,iFlagGreen,iFlagRed,iFlagYellow,iFourFilledBars,iFourFilledBoxes,iOneFilledBars,iOneFilledBoxes,iSide,iSideGray,iStarGold,iStarHalf,iStarSilver,iThreeFilledBars,iThreeFilledBoxes,iTrafficLightGreen,iTrafficLightRed,iTrafficLightYellow,iTriangleYellow,iTriangleGreen,iTriangleRed,iTwoFilledBars,iTwoFilledBoxes,iUp,iUpGray,iUpIncline,iUpInclineGray,iZeroFilledBars,iZeroFilledBoxes]}function getCFIcon(oRuleElement,index){var oIconSet=oRuleElement.aIconSets[index];var iconSetType=oIconSet&& null!==oIconSet.IconSet?oIconSet.IconSet:oRuleElement.IconSet;if(EIconSetType.NoIcons===iconSetType)return null;var icons=c_arrIcons[iconSetType]||c_arrIcons[EIconSetType.Traffic3Lights1];return icons[oIconSet&&null!==oIconSet.IconId?oIconSet.IconId:index]||icons[icons.length-1]}function getDataBarGradientColor(color){if(!color)return null;var RGB={R:255,G:255,B:255};var bCoeff=.828;RGB.R=Math.min(255,color.getR()+bCoeff*(255-color.getR())+.5>>0);RGB.G=Math.min(255,color.getG()+bCoeff*(255-color.getG())+ .5>>0);RGB.B=Math.min(255,color.getB()+bCoeff*(255-color.getB())+.5>>0);return AscCommonExcel.createRgbColor(RGB.R,RGB.G,RGB.B)}var prot;window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].CConditionalFormatting=CConditionalFormatting;window["AscCommonExcel"].CConditionalFormattingFormulaParent=CConditionalFormattingFormulaParent;window["AscCommonExcel"].CConditionalFormattingRule=CConditionalFormattingRule;window["AscCommonExcel"].CColorScale=CColorScale;window["AscCommonExcel"].CDataBar= CDataBar;window["AscCommonExcel"].CFormulaCF=CFormulaCF;window["AscCommonExcel"].CIconSet=CIconSet;window["AscCommonExcel"].CConditionalFormatValueObject=CConditionalFormatValueObject;window["AscCommonExcel"].CConditionalFormatIconSet=CConditionalFormatIconSet;window["AscCommonExcel"].CGradient=CGradient;window["AscCommonExcel"].cDefIconSize=cDefIconSize;window["AscCommonExcel"].cDefIconFont=cDefIconFont;window["AscCommonExcel"].getCFIconsForLoad=getCFIconsForLoad;window["AscCommonExcel"].getCFIcon= getCFIcon;window["AscCommonExcel"].getDataBarGradientColor=getDataBarGradientColor;prot=CConditionalFormattingRule;prot["asc_getDxf"]=prot.asc_getDxf;prot["asc_getType"]=prot.asc_getType;prot["asc_getLocation"]=prot.asc_getLocation;prot["asc_getContainsText"]=prot.asc_getContainsText;prot["asc_getTimePeriod"]=prot.asc_getTimePeriod;prot["asc_getOperator"]=prot.asc_getOperator;prot["asc_getRank"]=prot.asc_getRank;prot["asc_getBottom"]=prot.asc_getBottom;prot["asc_getPercent"]=prot.asc_getPercent;prot["asc_getAboveAverage"]= prot.asc_getAboveAverage;prot["asc_getEqualAverage"]=prot.asc_getEqualAverage;prot["asc_getStdDev"]=prot.asc_getStdDev;prot["asc_getValue1"]=prot.asc_getValue1;prot["asc_getValue2"]=prot.asc_getValue2;prot["asc_getColorScaleOrDataBarOrIconSetRule"]=prot.asc_getColorScaleOrDataBarOrIconSetRule;prot=CColorScale;prot["asc_getCFVOs"]=prot.asc_getCFVOs;prot["asc_getColors"]=prot.asc_getColors;prot=CDataBar;prot["asc_getShowValue"]=prot.asc_getShowValue;prot["asc_getAxisPosition"]=prot.asc_getAxisPosition; prot["asc_getGradient"]=prot.asc_getGradient;prot["asc_getDirection"]=prot.asc_getDirection;prot["asc_getNegativeBarColorSameAsPositive"]=prot.asc_getNegativeBarColorSameAsPositive;prot["asc_getNegativeBarBorderColorSameAsPositive"]=prot.asc_getNegativeBarBorderColorSameAsPositive;prot["asc_getCFVOs"]=prot.asc_getCFVOs;prot["asc_getColor"]=prot.asc_getColor;prot["asc_getNegativeColor"]=prot.asc_getNegativeColor;prot["asc_getBorderColor"]=prot.asc_getBorderColor;prot["asc_getNegativeBorderColor"]= prot.asc_getNegativeBorderColor;prot["asc_getAxisColor"]=prot.asc_getAxisColor;prot=CIconSet;prot["asc_getIconSet"]=prot.asc_getIconSet;prot["asc_getReverse"]=prot.asc_getReverse;prot["asc_getShowValue"]=prot.asc_getShowValue;prot["asc_getCFVOs"]=prot.asc_getCFVOs;prot["asc_getIconSets"]=prot.asc_getIconSets;prot=CConditionalFormatValueObject;prot["asc_getGte"]=prot.asc_getGte;prot["asc_getType"]=prot.asc_getType;prot["asc_getVal"]=prot.asc_getVal})(window);"use strict";(function(window,undefined){var c_oAscInsertOptions= Asc.c_oAscInsertOptions;var c_oAscDeleteOptions=Asc.c_oAscDeleteOptions;var cElementType=AscCommonExcel.cElementType;var EDataValidationType={None:0,Custom:1,Date:2,Decimal:3,List:4,TextLength:5,Time:6,Whole:7};var EDataValidationErrorStyle={Stop:0,Warning:1,Information:2};var EDataValidationImeMode={NoControl:0,Off:1,On:2,Disabled:3,Hiragana:4,FullKatakana:5,HalfKatakana:6,FullAlpha:7,HalfAlpha:8,FullHangul:9,HalfHangul:10};var EDataValidationOperator={Between:0,NotBetween:1,Equal:2,NotEqual:3,LessThan:4, LessThanOrEqual:5,GreaterThan:6,GreaterThanOrEqual:7};function checkIntegerType(val){return val&&AscCommonExcel.cElementType.number===val.type}function isNum(value){return!isNaN(parseFloat(value))&&isFinite(value)}function CDataFormula(value){this.text=value;this._formula=null}CDataFormula.prototype._init=function(ws,locale,doNotBuildDependencies){if(this._formula||!this.text)return;var t=this;this._formula=new AscCommonExcel.parserFormula(this.text,this,ws);if(!locale)AscCommonExcel.executeInR1C1Mode(false, function(){t._formula.parse()});else this._formula.parse(locale);if(!doNotBuildDependencies)this._formula.buildDependencies()};CDataFormula.prototype.clone=function(){var res=new CDataFormula;res.text=this.text;return res};CDataFormula.prototype.onFormulaEvent=function(type,eventData){if(AscCommon.c_oNotifyParentType.ChangeFormula===type)this.text=eventData.assemble};CDataFormula.prototype.getValue=function(ws,returnRaw,local,offset){this._init(ws,local);if(offset)this._formula.changeOffset(offset); var activeCell=ws.getSelection().activeCell;var res=this._formula.calculate(null,new Asc.Range(activeCell.col,activeCell.row,activeCell.col,activeCell.row));return returnRaw?this._formula.simplifyRefType(res):res};CDataFormula.prototype.Write_ToBinary2=function(writer){if(null!==this.text){writer.WriteBool(true);writer.WriteString2(this.text)}else writer.WriteBool(false)};CDataFormula.prototype.Read_FromBinary2=function(reader){if(reader.GetBool())this.text=reader.GetString2()};CDataFormula.prototype.asc_getValue= function(){return this.text};CDataFormula.prototype.asc_setValue=function(val){this.text=val};CDataFormula.prototype.setOffset=function(offset){if(this._formula)this.text=this._formula.changeOffset(offset,null,true).assemble(true)};function CDataValidation(){this.ranges=null;this.allowBlank=false;this.showDropDown=false;this.showErrorMessage=false;this.showInputMessage=false;this.type=EDataValidationType.None;this.errorStyle=EDataValidationErrorStyle.Stop;this.imeMode=EDataValidationImeMode.NoControl; this.operator=EDataValidationOperator.Between;this.error=null;this.errorTitle=null;this.prompt=null;this.promptTitle=null;this.formula1=null;this.formula2=null;this.Id=AscCommon.g_oIdCounter.Get_NewId();this._tempSelection=null;return this}CDataValidation.prototype.Get_Id=function(){return this.Id};CDataValidation.prototype.getObjectType=function(){return AscDFH.historyitem_type_DataValidation};CDataValidation.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.DataValidationInner}; CDataValidation.prototype._init=function(ws,doNotBuildDependencies){if(this.formula1)this.formula1._init(ws,null,doNotBuildDependencies);if(this.formula2)this.formula2._init(ws,null,doNotBuildDependencies)};CDataValidation.prototype._buildDependencies=function(ws,doNotBuildDependencies){if(this.formula1&&this.formula1._formula)this.formula1._formula.buildDependencies();if(this.formula2&&this.formula2._formula)this.formula2._formula.buildDependencies()};CDataValidation.prototype.clone=function(needSaveId){var res= new CDataValidation;if(this.ranges){res.ranges=[];for(var i=0;i<this.ranges.length;++i)res.ranges.push(this.ranges[i].clone())}res.allowBlank=this.allowBlank;res.showDropDown=this.showDropDown;res.showErrorMessage=this.showErrorMessage;res.showInputMessage=this.showInputMessage;res.type=this.type;res.errorStyle=this.errorStyle;res.imeMode=this.imeMode;res.operator=this.operator;res.error=this.error;res.errorTitle=this.errorTitle;res.prompt=this.prompt;res.promptTitle=this.promptTitle;res.formula1= this.formula1?this.formula1.clone():null;res.formula2=this.formula2?this.formula2.clone():null;if(needSaveId)res.Id=this.Id;return res};CDataValidation.prototype.set=function(val,ws){this.allowBlank=this.checkProperty(this.allowBlank,val.allowBlank,AscCH.historyitem_DataValidation_AllowBlank,ws);this.showDropDown=this.checkProperty(this.showDropDown,val.showDropDown,AscCH.historyitem_DataValidation_ShowDropDown,ws);this.showErrorMessage=this.checkProperty(this.showErrorMessage,val.showErrorMessage, AscCH.historyitem_DataValidation_ShowErrorMessage,ws);this.showInputMessage=this.checkProperty(this.showInputMessage,val.showInputMessage,AscCH.historyitem_DataValidation_ShowInputMessage,ws);this.type=this.checkProperty(this.type,val.type,AscCH.historyitem_DataValidation_Type,ws);this.errorStyle=this.checkProperty(this.errorStyle,val.errorStyle,AscCH.historyitem_DataValidation_ErrorStyle,ws);this.imeMode=this.checkProperty(this.imeMode,val.imeMode,AscCH.historyitem_DataValidation_ImeMode,ws);this.operator= this.checkProperty(this.operator,val.operator,AscCH.historyitem_DataValidation_Operator,ws);this.error=this.checkProperty(this.error,val.error,AscCH.historyitem_DataValidation_Error,ws);this.errorTitle=this.checkProperty(this.errorTitle,val.errorTitle,AscCH.historyitem_DataValidation_ErrorTitle,ws);this.prompt=this.checkProperty(this.prompt,val.prompt,AscCH.historyitem_DataValidation_Prompt,ws);this.promptTitle=this.checkProperty(this.promptTitle,val.promptTitle,AscCH.historyitem_DataValidation_PromptTotle, ws);this.formula1=this.checkProperty(this.formula1,val.formula1,AscCH.historyitem_DataValidation_Formula1,ws);this.formula2=this.checkProperty(this.formula2,val.formula2,AscCH.historyitem_DataValidation_Formula2,ws)};CDataValidation.prototype.checkProperty=function(propOld,propNew,type,ws){var isFormulaType=type===AscCH.historyitem_DataValidation_Formula1||type===AscCH.historyitem_DataValidation_Formula12;var _propOld=isFormulaType?propOld&&propOld.text:propOld;var _propNew=isFormulaType?propNew&& propNew.text:propNew;if(_propOld!==_propNew&&undefined!==_propNew){History.Add(AscCommonExcel.g_oUndoRedoSlicer,type,ws.getId(),null,new AscCommonExcel.UndoRedoData_DataValidation(this.Id,_propOld,_propNew));return propNew}return propOld};CDataValidation.prototype.isEqual=function(obj){var errorEqual=obj.error===this.error&&this.errorStyle===obj.errorStyle&&this.showErrorMessage===obj.showErrorMessage;var compareFormulas=function(_f1,_f2){if(_f1===_f2)return true;else if(_f1&&_f2&&_f1.text===_f2.text)return true; return false};if(errorEqual)if(obj.allowBlank===this.allowBlank&&obj.showDropDown===this.showDropDown&&obj.showInputMessage===this.showInputMessage)if(obj.type===this.type&&obj.imeMode===this.imeMode&&obj.operator===this.operator&&obj.prompt===this.prompt)if(obj.promptTitle===this.promptTitle&&compareFormulas(obj.formula1,this.formula1)&&compareFormulas(obj.formula2,this.formula2))return true;return false};CDataValidation.prototype.setOffset=function(offset){if(this.formula1)this.formula1.setOffset(offset); if(this.formula2)this.formula2.setOffset(offset)};CDataValidation.prototype.Write_ToBinary2=function(writer){if(null!=this.ranges){writer.WriteBool(true);writer.WriteLong(this.ranges.length);for(var i=0;i<this.ranges.length;i++){writer.WriteLong(this.ranges[i].r1);writer.WriteLong(this.ranges[i].c1);writer.WriteLong(this.ranges[i].r2);writer.WriteLong(this.ranges[i].c2)}}else writer.WriteBool(false);writer.WriteBool(this.allowBlank);writer.WriteBool(this.showDropDown);writer.WriteBool(this.showErrorMessage); writer.WriteBool(this.showInputMessage);writer.WriteLong(this.type);writer.WriteLong(this.errorStyle);writer.WriteLong(this.imeMode);writer.WriteLong(this.operator);if(null!=this.error){writer.WriteBool(true);writer.WriteString2(this.error)}else writer.WriteBool(false);if(null!=this.errorTitle){writer.WriteBool(true);writer.WriteString2(this.errorTitle)}else writer.WriteBool(false);if(null!=this.prompt){writer.WriteBool(true);writer.WriteString2(this.prompt)}else writer.WriteBool(false);if(null!= this.promptTitle){writer.WriteBool(true);writer.WriteString2(this.promptTitle)}else writer.WriteBool(false);if(null!=this.formula1){writer.WriteBool(true);this.formula1.Write_ToBinary2(writer)}else writer.WriteBool(false);if(null!=this.formula2){writer.WriteBool(true);this.formula2.Write_ToBinary2(writer)}else writer.WriteBool(false)};CDataValidation.prototype.Read_FromBinary2=function(reader){if(reader.GetBool()){var length=reader.GetULong();for(var i=0;i<length;++i){if(!this.ranges)this.ranges= [];var r1=reader.GetLong();var c1=reader.GetLong();var r2=reader.GetLong();var c2=reader.GetLong();this.ranges.push(new Asc.Range(c1,r1,c2,r2))}}this.allowBlank=reader.GetBool();this.showDropDown=reader.GetBool();this.showErrorMessage=reader.GetBool();this.showInputMessage=reader.GetBool();this.type=reader.GetLong();this.errorStyle=reader.GetLong();this.imeMode=reader.GetLong();this.operator=reader.GetLong();if(reader.GetBool())this.error=reader.GetString2();if(reader.GetBool())this.errorTitle=reader.GetString2(); if(reader.GetBool())this.prompt=reader.GetString2();if(reader.GetBool())this.promptTitle=reader.GetString2();var obj;if(reader.GetBool()){obj=new CDataFormula;obj.Read_FromBinary2(reader);this.formula1=obj}if(reader.GetBool()){obj=new CDataFormula;obj.Read_FromBinary2(reader);this.formula2=obj}};CDataValidation.prototype.setSqRef=function(sqRef){this.ranges=AscCommonExcel.g_oRangeCache.getRangesFromSqRef(sqRef)};CDataValidation.prototype.contains=function(c,r){if(this.ranges)for(var i=0;i<this.ranges.length;++i)if(this.ranges[i].contains(c, r))return true;return false};CDataValidation.prototype.containsRange=function(range){if(this.ranges)for(var i=0;i<this.ranges.length;++i)if(this.ranges[i].containsRange(range))return true;return false};CDataValidation.prototype.intersection=function(range){if(this.ranges)for(var i=0;i<this.ranges.length;++i)if(this.ranges[i].intersection(range))return true;return false};CDataValidation.prototype.getIntersections=function(range,offset){var res=[];if(this.ranges)for(var i=0;i<this.ranges.length;++i){var intersection= this.ranges[i].intersection(range);if(intersection){if(offset)intersection.setOffset(offset);res.push(intersection)}}return res.length?res:null};CDataValidation.prototype.checkValue=function(cell,ws){if(!this.showErrorMessage||EDataValidationType.None===this.type)return true;var cellType=cell.getType();var val=cell.getValueWithoutFormat();if(EDataValidationType.List===this.type){var list=this._getListValues(ws);var aValue=list[0];if(!aValue)return false;var aData=list[1];if(aData)for(var i=0;i<aData.length;++i){if(aData[i].isEqualCell(cell))return true}else return-1!== aValue.indexOf(val)}else if(EDataValidationType.Custom===this.type){var v=this.formula1&&this.formula1.clone().getValue(ws,true,null,this.calculateOffset(ws));v=v&&v.tocBool();return!!(v&&AscCommonExcel.cElementType.bool===v.type&&v.toBool())}else{if(EDataValidationType.TextLength===this.type)val=val.length;else{if(AscCommon.CellValueType.Number!==cellType)return false;val=Number(val);if(isNaN(val)||EDataValidationType.Whole===this.type&&val>>0!==val)return false}var v1=this.formula1&&this.formula1.getValue(ws, true);var v2=this.formula2&&this.formula2.getValue(ws,true);if(!checkIntegerType(v1))return false;v1=v1.toNumber();var res=false;switch(this.operator){case EDataValidationOperator.Between:res=checkIntegerType(v2)&&v1<=val&&val<=v2.toNumber();break;case EDataValidationOperator.NotBetween:res=checkIntegerType(v2)&&!(v1<=val&&val<=v2.toNumber());break;case EDataValidationOperator.Equal:res=v1===val;break;case EDataValidationOperator.NotEqual:res=v1!==val;break;case EDataValidationOperator.LessThan:res= v1>val;break;case EDataValidationOperator.LessThanOrEqual:res=v1>=val;break;case EDataValidationOperator.GreaterThan:res=v1<val;break;case EDataValidationOperator.GreaterThanOrEqual:res=v1<=val;break}return res}return false};CDataValidation.prototype._getListValues=function(ws){var aValue,aData;var list=this.formula1&&this.formula1.getValue(ws,false);if(list&&AscCommonExcel.cElementType.error!==list.type)if(AscCommonExcel.cElementType.string===list.type)aValue=list.getValue().split(AscCommon.FormulaSeparators.functionArgumentSeparatorDef); else{list=list.getRange();if(list){aValue=[];aData=[];list._foreachNoEmpty(function(cell){if(!cell.isNullTextString()){aValue.push(cell.getValue());aData.push(new AscCommonExcel.CCellValue(cell))}})}}return[aValue,aData]};CDataValidation.prototype.isListValues=function(){return this.type===EDataValidationType.List&&!this.showDropDown};CDataValidation.prototype.getListValues=function(ws){return this.isListValues()?this._getListValues(ws):null};CDataValidation.prototype.asc_checkValid=function(){var res= Asc.c_oAscError.ID.No;var _getNumber=function(_text){var _val=null;if(!isNum(_text)){var date=AscCommon.g_oFormatParser.parseDate(_text,AscCommon.g_oDefaultCultureInfo);if(date)_val=date.value}else _val=parseFloat(_text);return _val};if(this.type!==EDataValidationType.Custom&&this.type!==EDataValidationType.List)if(this.operator===EDataValidationOperator.Between||this.operator===EDataValidationOperator.NotBetween)if(this.formula1&&this.formula2){var nFormula1=_getNumber(this.formula1.text);var nFormula2= _getNumber(this.formula2.text);if(nFormula1!==null&&nFormula2!==null&&nFormula2<nFormula1)return Asc.c_oAscError.ID.DataValidateMinGreaterMax}return res};CDataValidation.prototype.isValidDataRef=function(ws,_val,type){var _checkValidType=function(val){var _res=false;if(val.type===cElementType.cell||val.type===cElementType.cell3D)_res=true;else if(type===EDataValidationType.List){if(val.type===cElementType.cellsRange||val.type===cElementType.cellsRange3D)_res=true}else if(val.type===cElementType.number)_res= true;return _res};var checkDefNames=function(_f){var outStack=_f._formula.outStack;if(outStack&&outStack.length)for(var i=0;i<outStack.length;i++)if(outStack[i].type===cElementType.name&&outStack[i].Calculate().type===cElementType.error)return false;return true};var _checkFormulaOnError=function(fValue,_f){if(fValue.type===cElementType.error&&fValue.errorType===AscCommonExcel.cErrorType.wrong_name&&!checkDefNames(_f))return asc_error.NamedRangeNotFound;if(fValue.type===cElementType.cellsRange||fValue.type=== cElementType.cellsRange3D)if(type===EDataValidationType.List){var _bbox=fValue.getBBox0();if(_bbox.c1!==_bbox.c2&&_bbox.r1!==_bbox.r2)return asc_error.DataValidateInvalidList}else return asc_error.DataValidateInvalid;if(fValue.type===cElementType.array)return asc_error.DataValidateInvalid;if(type!==EDataValidationType.Custom&&!_checkValidType(fValue))return type===EDataValidationType.List?asc_error.DataValidateInvalidList:asc_error.DataValidateNotNumeric;if(fValue.type===cElementType.error)return asc_error.FormulaEvaluateError; return null};var asc_error=Asc.c_oAscError.ID;var formula,fResult,isNumeric,date;if(_val[0]==="="){formula=new CDataFormula(_val.slice(1));fResult=formula.getValue(ws,null,true);var formulaError=_checkFormulaOnError(fResult,formula);if(formulaError!==null)return formulaError}else{isNumeric=isNum(_val);if(!isNumeric)if(type!==EDataValidationType.List)date=AscCommon.g_oFormatParser.parseDate(_val,AscCommon.g_oDefaultCultureInfo)}var res=asc_error.No;switch(type){case EDataValidationType.Date:if(fResult); else{if(!isNumeric)if(date)_val=date.value;else return asc_error.DataValidateInvalid;var maxDate=2958465;if(isNumeric&&(_val<0||_val>maxDate))return asc_error.DataValidateInvalid}break;case EDataValidationType.Decimal:case EDataValidationType.Whole:if(fResult);else if(!isNumeric)if(date)_val=date.value;else return asc_error.DataValidateInvalid;break;case EDataValidationType.List:if(fResult);else;break;case EDataValidationType.TextLength:if(fResult);else{if(!isNumeric)if(date)_val=date.value;else return asc_error.DataValidateNotNumeric; if(_val>=1E10||_val<0)return asc_error.DataValidateNegativeTextLength}break;case EDataValidationType.Time:if(fResult);else{if(!isNumeric)if(date)_val=date.value;else return asc_error.DataValidateInvalid;if(_val<0||_val>=1)return asc_error.DataValidateInvalid}break}return res};CDataValidation.prototype.getError=function(){return this.error};CDataValidation.prototype.getErrorStyle=function(){return this.errorStyle};CDataValidation.prototype.getErrorTitle=function(){return this.errorTitle};CDataValidation.prototype.getAllowBlank= function(){return this.allowBlank};CDataValidation.prototype.getShowDropDown=function(){return this.showDropDown};CDataValidation.prototype.getShowErrorMessage=function(){return this.showErrorMessage};CDataValidation.prototype.getShowInputMessage=function(){return this.showInputMessage};CDataValidation.prototype.asc_getType=function(){return this.type};CDataValidation.prototype.getImeMode=function(){return this.imeMode};CDataValidation.prototype.getOperator=function(){return this.operator};CDataValidation.prototype.getPrompt= function(){return this.prompt};CDataValidation.prototype.getPromptTitle=function(){return this.promptTitle};CDataValidation.prototype.getFormula1=function(){return this.formula1};CDataValidation.prototype.getFormula2=function(){return this.formula2};CDataValidation.prototype.setAllowBlank=function(newVal,addToHistory){this.allowBlank=newVal};CDataValidation.prototype.setShowDropDown=function(newVal,addToHistory){this.showDropDown=newVal};CDataValidation.prototype.setShowErrorMessage=function(newVal, addToHistory){this.showErrorMessage=newVal};CDataValidation.prototype.setShowInputMessage=function(newVal,addToHistory){this.showInputMessage=newVal};CDataValidation.prototype.setType=function(newVal,addToHistory){this.type=newVal};CDataValidation.prototype.setErrorStyle=function(newVal,addToHistory){this.errorStyle=newVal};CDataValidation.prototype.setImeMode=function(newVal,addToHistory){this.imeMode=newVal};CDataValidation.prototype.setOperator=function(newVal,addToHistory){this.operator=newVal}; CDataValidation.prototype.setError=function(newVal,addToHistory){this.error=newVal};CDataValidation.prototype.setErrorTitle=function(newVal,addToHistory){this.errorTitle=newVal};CDataValidation.prototype.setPrompt=function(newVal,addToHistory){this.prompt=newVal};CDataValidation.prototype.setPromptTitle=function(newVal,addToHistory){this.promptTitle=newVal};CDataValidation.prototype.setFormula1=function(newVal,addToHistory){this.formula1=newVal};CDataValidation.prototype.setFormula2=function(newVal, addToHistory){this.formula2=newVal};CDataValidation.prototype.shift=function(bInsert,type,updateRange){var _setDiff=function(_range){var _newRanges,offset,tempRange,intersection,otherPart,diff;switch(type){case c_oAscInsertOptions.InsertCellsAndShiftDown:tempRange=new Asc.Range(updateRange.c1,updateRange.r1,updateRange.c2,AscCommon.gc_nMaxRow0);intersection=tempRange.intersection(_range);if(intersection){diff=updateRange.r2-updateRange.r1+1;_newRanges=[];_newRanges.push(intersection);offset=new AscCommon.CellBase(bInsert? diff:-diff,0);otherPart=_newRanges[0].difference(_range);_newRanges[0].setOffset(offset);_newRanges=_newRanges.concat(otherPart)}break;case c_oAscInsertOptions.InsertCellsAndShiftRight:tempRange=new Asc.Range(updateRange.c1,updateRange.r1,AscCommon.gc_nMaxCol0,updateRange.r2);intersection=tempRange.intersection(_range);if(intersection){diff=updateRange.c2-updateRange.c1+1;_newRanges=[];_newRanges.push(intersection);offset=new AscCommon.CellBase(0,bInsert?diff:-diff,0);otherPart=_newRanges[0].difference(_range); _newRanges[0].setOffset(offset);_newRanges=_newRanges.concat(otherPart)}break}return _newRanges};var _offset;if(type===c_oAscInsertOptions.InsertCellsAndShiftDown||type===c_oAscInsertOptions.InsertRows){_offset=new AscCommon.CellBase(updateRange.r2-updateRange.r1+1,0);if(!bInsert)_offset.row=-_offset.row}else{_offset=new AscCommon.CellBase(0,updateRange.c2-updateRange.c1+1);if(!bInsert)_offset.col=-_offset.col}var newRanges=[];var bDel,isChanged;for(var i=0;i<this.ranges.length;i++)if(!bInsert&&updateRange.containsRange(this.ranges[i]))bDel= true;else if(updateRange.isIntersectForShift(this.ranges[i],_offset)){var cloneRange=this.ranges[i].clone();cloneRange.forShift(updateRange,_offset);newRanges.push(cloneRange);isChanged=true}else{var changedRanges=_setDiff(this.ranges[i]);if(changedRanges){newRanges=newRanges.concat(changedRanges);isChanged=true}else newRanges=newRanges.concat(this.ranges[i].clone())}if(!newRanges.length&&bDel)return-1;else if(newRanges.length&&isChanged)return newRanges};CDataValidation.prototype.clear=function(ranges){var newRanges= [];var isChanged;for(var i=0;i<this.ranges.length;i++)for(var j=0;j<ranges.length;j++){var intersection=this.ranges[i].intersection(ranges[j]);if(intersection){isChanged=true;newRanges=newRanges.concat(intersection.difference(this.ranges[i]))}else newRanges.push(this.ranges[i])}return isChanged?newRanges:null};CDataValidation.prototype.move=function(oBBoxFrom,copyRange,offset){var newRanges=[];var isChanged;for(var i=0;i<this.ranges.length;i++){var intersection=this.ranges[i].intersection(oBBoxFrom); if(intersection){isChanged=true;if(!copyRange)newRanges=newRanges.concat(intersection.difference(this.ranges[i]));else newRanges.push(this.ranges[i]);intersection.setOffset(offset);newRanges.push(intersection)}else newRanges.push(this.ranges[i])}return isChanged?newRanges:null};CDataValidation.prototype.prepeareToPaste=function(range,offset){var newRanges=[];for(var j=0;j<this.ranges.length;j++){var intersection=range.intersection(this.ranges[j]);if(intersection){intersection.setOffset(offset);newRanges.push(intersection)}}if(newRanges.length){this.ranges= newRanges;return true}return false};CDataValidation.prototype.applyCollaborative=function(nSheetId,collaborativeEditing){};CDataValidation.prototype.correctToInterface=function(ws){var t=this;var doCorrect=function(_formula){var _val=_formula.text;var _isNum=isNum(_val);if(_val[0]==='"'||_isNum){if(!_isNum){_val=_formula.text=_val.slice(1,-1);_isNum=isNum(_val);if(!_isNum)_val=_formula.text=_val.replace(/""/g,'"')}if(_isNum){var _format;if(t.type===EDataValidationType.Date)_format=AscCommon.oNumFormatCache.get("m/d/yyyy"); else if(t.type===EDataValidationType.Time)_format=AscCommon.oNumFormatCache.get("h:mm:ss AM/PM");if(_format){var dateVal=_format.format(_val);if(dateVal&&dateVal[0]&&dateVal[0].text)_formula.text=dateVal[0].text}}}else if(_formula&&_formula._formula){var offset=t.calculateOffset(ws);if(offset)_formula._formula.changeOffset(offset);_formula.text="="+_formula._formula.assembleLocale(AscCommonExcel.cFormulaFunctionToLocale)}else _formula.text="="+_val};if(this.formula1)doCorrect(this.formula1);if(this.formula2)doCorrect(this.formula2)}; CDataValidation.prototype.correctFromInterface=function(ws){var t=this;var addQuotes=function(_val){var _res;if(_val[0]==='"'){_res=_val.replace(/"/g,'""');_res='"'+_res+'"'}else _res='"'+_val+'"';return _res};var doCorrect=function(_formula){var _val=_formula.text;var isNumeric=isNum(_val);if(isNumeric){if(t.type===EDataValidationType.List)_formula.text='"'+_formula.text+'"'}else{var isDate;var isFormula;if(!isNumeric)if(_val[0]==="="){_val=_val.slice(1);_formula.text=_val;if(isNum(_val)){if(t.type=== EDataValidationType.List)_val='"'+_val+'"';_formula.text=_val;return}var _tempFormula=new CDataFormula(_val);isFormula=_tempFormula.getValue(ws,null,true)}else if(t.type!==EDataValidationType.List)isDate=AscCommon.g_oFormatParser.parseDate(_val,AscCommon.g_oDefaultCultureInfo);if(isDate){_formula.text=isDate.value;return}if(!isFormula)_formula.text=addQuotes(_formula.text);else if(_tempFormula&&_tempFormula._formula)_formula.text=_tempFormula._formula.assemble()}};if(this.formula1)doCorrect(this.formula1); if(this.formula2)doCorrect(this.formula2)};CDataValidation.prototype.checkFormulaStackOnCell=function(row,col){var stack=this.formula1&&this.formula1._formula&&this.formula1._formula.outStack;if(stack&&stack.length)for(var i=0;i<stack.length;i++)if(stack[i])if(stack[i].type===AscCommonExcel.cElementType.cell||stack[i].type===AscCommonExcel.cElementType.cellsRange)if(stack[i].range&&stack[i].range.bbox&&stack[i].range.bbox.contains(col,row))return true;return false};CDataValidation.prototype.calculateOffset= function(ws){var res=null;var _row=null,_col=null;for(var i=0;i<this.ranges.length;i++)if(_row===null&&_col===null){_row=this.ranges[i].r1;_col=this.ranges[i].c1}else if(_row>this.ranges[i].r1)_row=this.ranges[i].r1;else if(_col>this.ranges[i].c1)_col=this.ranges[i].c1;if(_row!==null&&_col!==null){var selectionRange=ws.selectionRange;var activeCell=selectionRange.activeCell;res=new AscCommon.CellBase(activeCell.row-_row,activeCell.col-_col)}return res};function CDataValidations(){this.disablePrompts= false;this.xWindow=null;this.yWindow=null;this.elems=[];return this}CDataValidations.prototype.init=function(ws){for(var i=0;i<this.elems.length;++i)this.elems[i]._init(ws)};CDataValidations.prototype.clone=function(){var i,res=new CDataValidations;res.disablePrompts=this.disablePrompts;res.xWindow=this.xWindow;res.yWindow=this.yWindow;for(i=0;i<this.elems.length;++i)res.elems.push(this.elems[i].clone());return res};CDataValidations.prototype.shift=function(ws,bInsert,type,updateRange,addToHistory){for(var i= 0;i<this.elems.length;i++){var isUpdate=this.elems[i].shift(bInsert,type,updateRange);if(isUpdate===-1){if(this.delete(ws,this.elems[i].Id,addToHistory))i--}else if(isUpdate){var to=this.elems[i].clone();to.ranges=isUpdate;this.change(ws,this.elems[i],to,addToHistory)}}};CDataValidations.prototype.add=function(ws,val,addToHistory){this.elems.push(val);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_DataValidationAdd,ws.getId(),null,new AscCommonExcel.UndoRedoData_DataValidation(val.Id, null,val))};CDataValidations.prototype.change=function(ws,from,to,addToHistory){to.Id=from.Id;for(var i=0;i<this.elems.length;i++)if(this.elems[i].Id===to.Id)this.elems[i]=to;if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_DataValidationChange,ws.getId(),null,new AscCommonExcel.UndoRedoData_DataValidation(from.Id,from,to))};CDataValidations.prototype.delete=function(ws,id,addToHistory){var deleteElem;for(var i=0;i<this.elems.length;i++)if(this.elems[i].Id=== id){deleteElem=this.elems[i];this.elems.splice(i,1)}if(addToHistory&&deleteElem)History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_DataValidationDelete,ws.getId(),null,new AscCommonExcel.UndoRedoData_DataValidation(deleteElem.Id,deleteElem,null));return deleteElem};CDataValidations.prototype.getById=function(id){for(var i=0;i<this.elems.length;i++)if(this.elems[i].Id===id)return{data:this.elems[i],index:i}};CDataValidations.prototype.getIntersections=function(ranges){var checkAdd= function(arr,obj){for(var n=0;n<arr.length;n++)if(arr[n].isEqual(obj))return true;return false};var intersectionArr=[];var containArr=[];if(this.elems)for(var i=0;i<this.elems.length;i++){var dataValidation=this.elems[i];for(var j=0;j<ranges.length;j++)if(dataValidation.intersection(ranges[j]))if(dataValidation.containsRange(ranges[j])){if(!checkAdd(dataValidation,containArr))containArr.push(dataValidation)}else if(!checkAdd(dataValidation,intersectionArr))intersectionArr.push(dataValidation)}return{intersection:intersectionArr, contain:containArr}};CDataValidations.prototype.getProps=function(ranges,doExtend,ws){var _obj=this.getIntersections(ranges);var dataValidationIntersection=_obj.intersection;var dataValidationContain=_obj.contain;var needCheck=doExtend===undefined;if(needCheck){if(dataValidationIntersection.length>1||dataValidationContain.length>1)return c_oAscError.ID.MoreOneTypeDataValidate;if(dataValidationIntersection.length)return c_oAscError.ID.ContainsCellsWithoutDataValidate}var getNewObject=function(){var _res= new window["AscCommonExcel"].CDataValidation;_res.showErrorMessage=true;_res.showInputMessage=true;_res.allowBlank=true;return _res};var res;if(doExtend===null)res=getNewObject();else if(doExtend!==undefined)res=doExtend?dataValidationIntersection[0].clone(true):getNewObject();else if(dataValidationContain.length===1)res=dataValidationContain[0].clone(true);else res=getNewObject();res._init(ws);res.correctToInterface(ws);return res};CDataValidations.prototype.setProps=function(ws,ranges,props){var _obj= this.getIntersections(ranges);var instersection=_obj.intersection;var contain=_obj.contain;var prepeareAdd=function(_props,modelRanges){var _dataValidation=_props.clone();var _ranges=[];var needRanges=modelRanges?modelRanges:ranges;for(var i=0;i<needRanges.length;i++)_ranges.push(needRanges[i].clone());_dataValidation.ranges=_ranges;_dataValidation._init(ws);return _dataValidation};props.Id=AscCommon.g_oIdCounter.Get_NewId();props.correctFromInterface(ws);var equalRangeDataValidation;var equalDataValidation; var i;if(this.elems)for(i=0;i<this.elems.length;i++)if(this._containRanges(this.elems[i].ranges,ranges)){if(!equalRangeDataValidation)equalRangeDataValidation=[];equalRangeDataValidation.push(this.elems[i])}if(!instersection.length&&!contain.length)if(equalDataValidation);else this.add(ws,prepeareAdd(props),true);else if(equalRangeDataValidation)for(i=0;i<equalRangeDataValidation.length;i++)this.change(ws,equalRangeDataValidation[i],prepeareAdd(props,equalRangeDataValidation[i].ranges),true);else{var t= this;var _split=function(_dataValidation){var _newRanges=[];var dataValidationRanges=_dataValidation.ranges;for(var i=0;i<dataValidationRanges.length;i++){var tempRanges=[];for(var j=0;j<ranges.length;j++)if(tempRanges.length){var tempRanges2=[];for(var k=0;k<tempRanges.length;k++)tempRanges2=tempRanges2.concat(ranges[j].difference(tempRanges[k]));tempRanges=tempRanges2}else tempRanges=ranges[j].difference(dataValidationRanges[i]);_newRanges=_newRanges.concat(tempRanges)}if(!_newRanges.length)t.delete(ws, _dataValidation.Id,true);else{var newDataValidation=_dataValidation.clone();newDataValidation.ranges=_newRanges;t.change(ws,_dataValidation,prepeareAdd(newDataValidation,_newRanges),true)}};var k;for(k=0;k<instersection.length;k++)_split(instersection[k]);for(k=0;k<contain.length;k++)_split(contain[k]);this.add(ws,prepeareAdd(props),true)}};CDataValidations.prototype._containRanges=function(_ranges1,_ranges2){if(_ranges1.length<=_ranges2.length)for(var j=0;j<_ranges1.length;j++){var _equal=false; for(var n=0;n<_ranges2.length;n++)if(_ranges1[j].isEqual(_ranges2[n])){_equal=true;break}if(!_equal)return false}else return false;return true};CDataValidations.prototype.clear=function(ws,ranges,addToHistory){for(var i=0;i<this.elems.length;i++)if(this._containRanges(this.elems[i].ranges,ranges)){if(this.delete(ws,this.elems[i].Id,addToHistory))i--}else{var changedRanges=this.elems[i].clear(ranges);if(changedRanges){var newDataValidation=this.elems[i].clone();newDataValidation.ranges=changedRanges; this.change(ws,this.elems[i],newDataValidation,addToHistory)}}};CDataValidations.prototype.move=function(ws,oBBoxFrom,oBBoxTo,copyRange,offset){for(var i=0;i<this.elems.length;i++){var changedRanges=this.elems[i].move(oBBoxFrom,copyRange,offset);if(changedRanges){var newDataValidation=this.elems[i].clone();newDataValidation.ranges=changedRanges;this.change(ws,this.elems[i],newDataValidation,true)}}};CDataValidations.prototype.getCopyByRange=function(range,offset){var res=[];for(var i=0;i<this.elems.length;i++){var changedRanges= this.elems[i].getIntersections(range,offset);if(changedRanges){var newDataValidation=this.elems[i].clone();newDataValidation.ranges=changedRanges;res.push(newDataValidation)}}return res.length?res:null};CDataValidations.prototype.getIntersectionByRange=function(range){var res=[];for(var i=0;i<this.elems.length;i++){var changedRanges=this.elems[i].getIntersections(range);if(changedRanges)res.push({ranges:changedRanges,id:this.elems[i].Id})}return res.length?res:null};CDataValidations.prototype.expandRanges= function(ranges){var res=[];var _notExpandRanges=[];for(var k=0;k<ranges.length;k++){res[k]=ranges[k];for(var i=0;i<this.elems.length;i++){var _expandRange=res[k];var isIntersection=false;var tempArr=[];for(var j=0;j<this.elems[i].ranges.length;j++)if(this.elems[i].ranges[j].intersection(_expandRange)){isIntersection=true;_expandRange=_expandRange.union(this.elems[i].ranges[j])}else tempArr.push(this.elems[i].ranges[j]);if(isIntersection){_notExpandRanges=_notExpandRanges.concat(tempArr);res[k]=_expandRange}}}return res.concat(_notExpandRanges)}; CDataValidations.prototype.getSameSettingsElems=function(_elem){var res=null;if(!_elem)return res;for(var i=0;i<this.elems.length;i++)if(this.elems[i].isEqual(_elem)){if(!res)res=[];res.push(this.elems[i])}return res};var prot;window["Asc"]=window["Asc"]||{};window["Asc"]["c_oAscEDataValidationType"]=window["Asc"].EDataValidationType=EDataValidationType;prot=EDataValidationType;prot["None"]=prot.None;prot["Custom"]=prot.Custom;prot["Date"]=prot.Date;prot["Decimal"]=prot.Decimal;prot["List"]=prot.List; prot["TextLength"]=prot.TextLength;prot["Time"]=prot.Time;prot["Whole"]=prot.Whole;window["Asc"]["c_oAscEDataValidationErrorStyle"]=window["Asc"].EDataValidationErrorStyle=EDataValidationErrorStyle;prot=EDataValidationErrorStyle;prot["Stop"]=prot.Stop;prot["Warning"]=prot.Warning;prot["Information"]=prot.Information;window["Asc"].EDataValidationImeMode=EDataValidationImeMode;window["Asc"]["CDataFormula"]=window["Asc"].CDataFormula=CDataFormula;prot=CDataFormula.prototype;prot["asc_getValue"]=prot.asc_getValue; prot["asc_setValue"]=prot.asc_setValue;window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].CDataValidation=CDataValidation;prot=CDataValidation.prototype;prot["asc_getError"]=prot.getError;prot["asc_getErrorStyle"]=prot.getErrorStyle;prot["asc_getErrorTitle"]=prot.getErrorTitle;prot["asc_getErrorTitle"]=prot.getErrorTitle;prot["asc_getAllowBlank"]=prot.getAllowBlank;prot["asc_getShowDropDown"]=prot.getShowDropDown;prot["asc_getShowErrorMessage"]=prot.getShowErrorMessage; prot["asc_getShowInputMessage"]=prot.getShowInputMessage;prot["asc_getType"]=prot.asc_getType;prot["asc_getOperator"]=prot.getOperator;prot["asc_getPrompt"]=prot.getPrompt;prot["asc_getPromptTitle"]=prot.getPromptTitle;prot["asc_getFormula1"]=prot.getFormula1;prot["asc_getFormula2"]=prot.getFormula2;prot["asc_setError"]=prot.setError;prot["asc_setErrorStyle"]=prot.setErrorStyle;prot["asc_setErrorTitle"]=prot.setErrorTitle;prot["asc_setErrorTitle"]=prot.setErrorTitle;prot["asc_setAllowBlank"]=prot.setAllowBlank; prot["asc_setShowDropDown"]=prot.setShowDropDown;prot["asc_setShowErrorMessage"]=prot.setShowErrorMessage;prot["asc_setShowInputMessage"]=prot.setShowInputMessage;prot["asc_setType"]=prot.setType;prot["asc_setOperator"]=prot.setOperator;prot["asc_setPrompt"]=prot.setPrompt;prot["asc_setPromptTitle"]=prot.setPromptTitle;prot["asc_setFormula1"]=prot.setFormula1;prot["asc_setFormula2"]=prot.setFormula2;prot["asc_checkValid"]=prot.asc_checkValid;window["Asc"]["EDataValidationOperator"]=window["Asc"].EDataValidationOperator= EDataValidationOperator;prot=EDataValidationOperator;prot["Between"]=prot.Between;prot["NotBetween"]=prot.NotBetween;prot["Equal"]=prot.Equal;prot["NotEqual"]=prot.NotEqual;prot["LessThan"]=prot.LessThan;prot["LessThanOrEqual"]=prot.LessThanOrEqual;prot["GreaterThan"]=prot.GreaterThan;prot["GreaterThanOrEqual"]=prot.GreaterThanOrEqual;window["AscCommonExcel"].CDataValidations=CDataValidations})(window);"use strict";(function(window,undefined){var AscBrowser=AscCommon.AscBrowser;var History=AscCommon.History; var asc=window["Asc"];var asc_typeof=asc.typeOf;var c_oAscError=asc.c_oAscError;function HeaderFooterField(val){this.field=val}HeaderFooterField.prototype.getText=function(ws,indexPrintPage,countPrintPages){var res="";var api=window["Asc"]["editor"];switch(this.field){case asc.c_oAscHeaderFooterField.pageNumber:{res=indexPrintPage+1+"";break}case asc.c_oAscHeaderFooterField.pageCount:{res=countPrintPages+"";break}case asc.c_oAscHeaderFooterField.sheetName:{res=ws.model.sName;break}case asc.c_oAscHeaderFooterField.fileName:{res= api.DocInfo?api.DocInfo.Title:"";break}case asc.c_oAscHeaderFooterField.filePath:{break}case asc.c_oAscHeaderFooterField.date:{res=(new Asc.cDate).getDateString(api);break}case asc.c_oAscHeaderFooterField.time:{res=(new Asc.cDate).getTimeString(api);break}case asc.c_oAscHeaderFooterField.lineBreak:{res="\n";break}}return res};function HeaderFooterParser(){this.portions=[];this.currPortion=null;this.str=null;this.font=null;this.date=null;this.allFontsMap=[]}var c_oPortionPosition={left:0,center:1, right:2};var c_nPortionLeftHeader=0;var c_nPortionCenterHeader=1;var c_nPortionRightHeader=2;var c_nPortionLeftFooter=3;var c_nPortionCenterFooter=4;var c_nPortionRightFooter=5;HeaderFooterParser.prototype.parse=function(date){var c_nText=0,c_nToken=1,c_nFontName=2,c_nFontStyle=3,c_nFontHeight=4;this.date=date;this.font=new AscCommonExcel.Font;this.currPortion=c_oPortionPosition.center;this.str="";var nState=c_nText;var nFontHeight=0;var sFontName="";var sFontStyle="";for(var i=0;i<date.length;i++){var cChar= date[i];switch(nState){case c_nText:{switch(cChar){case "&":this.pushText();nState=c_nToken;break;case "\n":this.pushText();this.pushLineBreak();break;default:this.str+=cChar}break}case c_nToken:{nState=c_nText;switch(cChar){case "&":this.str.push(cChar);break;case "L":this.setPortion(c_oPortionPosition.left);this.font=new AscCommonExcel.Font;break;case "C":this.setPortion(c_oPortionPosition.center);this.font=new AscCommonExcel.Font;break;case "R":this.setPortion(c_oPortionPosition.right);this.font= new AscCommonExcel.Font;break;case "P":this.pushField(new HeaderFooterField(asc.c_oAscHeaderFooterField.pageNumber));break;case "N":this.pushField(new HeaderFooterField(asc.c_oAscHeaderFooterField.pageCount));break;case "A":this.pushField(new HeaderFooterField(asc.c_oAscHeaderFooterField.sheetName));break;case "F":{this.pushField(new HeaderFooterField(asc.c_oAscHeaderFooterField.fileName));break}case "Z":{this.pushField(new HeaderFooterField(asc.c_oAscHeaderFooterField.filePath));break}case "D":{this.pushField(new HeaderFooterField(asc.c_oAscHeaderFooterField.date)); break}case "T":{this.pushField(new HeaderFooterField(asc.c_oAscHeaderFooterField.time));break}case "B":this.font.b=!this.font.b;break;case "I":this.font.i=!this.font.i;break;case "U":this.font.u=Asc.EUnderline.underlineSingle;break;case "E":this.font.u=Asc.EUnderline.underlineDouble;break;case "S":this.font.s=!this.font.s;break;case "X":if(this.font.va===AscCommon.vertalign_SuperScript)this.font.va=AscCommon.vertalign_Baseline;else this.font.va=AscCommon.vertalign_SuperScript;break;case "Y":if(this.font.va=== AscCommon.vertalign_SubScript)this.font.va=AscCommon.vertalign_Baseline;else this.font.va=AscCommon.vertalign_SubScript;break;case "O":break;case "H":break;case "K":if(i+6<date.length){this.font.c=this.convertFontColor(date.substr(i+1,6));i+=6}break;case '"':sFontName="";sFontStyle="";nState=c_nFontName;break;default:if("0"<=cChar&&cChar<="9"){nFontHeight=cChar-"0";nState=c_nFontHeight}}break}case c_nFontName:{switch(cChar){case '"':this.convertFontName(sFontName);sFontName="";nState=c_nText;break; case ",":nState=c_nFontStyle;break;default:sFontName+=cChar}break}case c_nFontStyle:{switch(cChar){case '"':this.convertFontName(sFontName);sFontName="";this.convertFontStyle(sFontStyle);sFontStyle="";nState=c_nText;break;default:sFontStyle+=cChar}break}case c_nFontHeight:{if("0"<=cChar&&cChar<="9"){if(nFontHeight>=0){nFontHeight*=10;nFontHeight+=cChar-"0";if(nFontHeight>1E3)nFontHeight=-1}}else{if(nFontHeight>0)this.font.fs=nFontHeight;i--;nState=c_nText}break}}}this.endPortion()};HeaderFooterParser.prototype.convertFontColor= function(rColor){var color;if(rColor[2]=="+"||rColor[2]=="-"){var theme=rColor.substr(0,2)-0;var tint=rColor.substr(2)-0;color=AscCommonExcel.g_oColorManager.getThemeColor(theme,tint/100)}else color=new AscCommonExcel.RgbColor(AscCommonExcel.g_clipboardExcel.pasteProcessor._getBinaryColor(rColor));return color};HeaderFooterParser.prototype.convertFontColorFromObj=function(obj){var color=null;if(obj instanceof AscCommonExcel.ThemeColor){var theme=obj.theme.toString();if(theme.length===1)theme="0"+ theme;var tint=(obj.tint*100).toFixed(0);if(1===tint.length)tint="00"+tint;else if(2===tint.length)tint="0"+tint;color=theme+"+"+tint}else if(obj instanceof AscCommonExcel.RgbColor){var toHex=function componentToHex(c){var res=c.toString(16);return res.length==1?"0"+res:res};color=toHex(obj.getR())+toHex(obj.getG())+toHex(obj.getB())}else if(obj===null)color="01+000";return color};HeaderFooterParser.prototype.pushText=function(){if(0!==this.str.length){if(!this.portions[this.currPortion])this.portions[this.currPortion]= [{format:this.font.clone(),text:this.str}];else this.portions[this.currPortion].push({format:this.font.clone(),text:this.str});this.str=[]}};HeaderFooterParser.prototype.pushField=function(field){if(!this.portions[this.currPortion])this.portions[this.currPortion]=[{format:this.font.clone(),text:field}];else this.portions[this.currPortion].push({format:this.font.clone(),text:field})};HeaderFooterParser.prototype.pushLineBreak=function(){this.pushField(new HeaderFooterField(asc.c_oAscHeaderFooterField.lineBreak))}; HeaderFooterParser.prototype.convertFontName=function(rName){if(""!==rName)if(rName.length===1&&rName[0]==="-")this.font.fn=null;else{this.font.fn=rName;this.allFontsMap[rName]=1}};HeaderFooterParser.prototype.convertFontStyle=function(rStyle){this.font.b=this.font.i=false;var fontStyleArr=rStyle.split(" ");for(var i=0;i<fontStyleArr.length;i++)if("italic"===fontStyleArr[i].toLowerCase())this.font.i=true;else if("bold"===fontStyleArr[i].toLowerCase())this.font.b=true};HeaderFooterParser.prototype.endPortion= function(){this.pushText()};HeaderFooterParser.prototype.setPortion=function(val){if(val!=this.currPortion){this.endPortion();this.currPortion=val}};HeaderFooterParser.prototype.getAllFonts=function(oFontMap){for(var i in this.allFontsMap)if(!oFontMap[i])oFontMap[i]=1};HeaderFooterParser.prototype.assembleText=function(){var newStr="";var curPortionLeft=this.assemblePortionText(c_oPortionPosition.left);if(curPortionLeft)newStr+=curPortionLeft;var curPortionCenter=this.assemblePortionText(c_oPortionPosition.center); if(curPortionCenter)newStr+=curPortionCenter;var curPortionRight=this.assemblePortionText(c_oPortionPosition.right);if(curPortionRight)newStr+=curPortionRight;this.date=newStr;return{str:newStr,left:curPortionLeft,center:curPortionCenter,right:curPortionRight}};HeaderFooterParser.prototype.splitByParagraph=function(cPortionCode){var res=[];if(this.portions[cPortionCode]){var index=0;var curPortion=this.portions[cPortionCode];for(var i=0;i<curPortion.length;i++){if(!res[index])res[index]=[];res[index].push(curPortion[i])}}return res}; HeaderFooterParser.prototype.assemblePortionText=function(cPortion){var symbolPortion;switch(cPortion){case c_oPortionPosition.left:{symbolPortion="L";break}case c_oPortionPosition.center:{symbolPortion="C";break}case c_oPortionPosition.right:{symbolPortion="R";break}}var compareColors=function(color1,color2){var isEqual=true;if(color1!==color2||color1&&color2&&color1.rgb!==color2.rgb)isEqual=false;return isEqual};var res="";var fontList=true;var aText="";var prevFont=new AscCommonExcel.Font;var paragraphs= this.splitByParagraph(cPortion);for(var j=0;j<paragraphs.length;++j){var aParaText="";var aPosList=paragraphs[j];for(var i=0;i<aPosList.length;++i){var aFont=aPosList[i].format;var newFont=aPosList[i].format;var bNewFontName=!(prevFont.fn==newFont.fn);var bNewStyle=prevFont.b!=newFont.b||prevFont.i!=newFont.i;if(bNewFontName||bNewStyle&&fontList){if(null===newFont.fn)aParaText+='&"'+"-";else aParaText+='&"'+newFont.fn;var fontStyleStr="";if(prevFont.b!==newFont.b){fontStyleStr=",";if(newFont.b=== true)fontStyleStr+="Bold";else fontStyleStr+="Regular"}if(prevFont.i!==newFont.i){if(""===fontStyleStr)fontStyleStr=",";else fontStyleStr+=" ";if(newFont.i===true)fontStyleStr+="Italic";else if(-1===fontStyleStr.indexOf("Regular"))fontStyleStr+="Regular"}aParaText+=fontStyleStr;aParaText+='"'}newFont.fs=aFont.fs;var bFontHtChanged=prevFont.fs!=newFont.fs;if(bFontHtChanged)aParaText+="&"+newFont.fs;if(prevFont.u!=newFont.u){var underline=newFont.u==Asc.EUnderline.u?prevFont.u:newFont.u;underline== Asc.EUnderline.underlineSingle?aParaText+="&U":aParaText+="&E"}if(prevFont.s!=newFont.s)aParaText+="&S";if(prevFont.va!=newFont.va)switch(newFont.va){case AscCommon.vertalign_SuperScript:aParaText+="&X";break;case AscCommon.vertalign_SubScript:aParaText+="&Y";break;default:prevFont.va===AscCommon.vertalign_SuperScript?aParaText+="&X":aParaText+="&Y";break}if(!compareColors(prevFont.c,newFont.c)){var newColor=this.convertFontColorFromObj(newFont.c);if(null!==newColor){aParaText+="&K";aParaText+=newColor}}prevFont= newFont;if(aPosList[i].text instanceof HeaderFooterField){if(aPosList[i].text.field!==undefined)switch(aPosList[i].text.field){case asc.c_oAscHeaderFooterField.pageNumber:{aParaText+="&P";break}case asc.c_oAscHeaderFooterField.pageCount:{aParaText+="&N";break}case asc.c_oAscHeaderFooterField.date:{aParaText+="&D";break}case asc.c_oAscHeaderFooterField.time:{aParaText+="&T";break}case asc.c_oAscHeaderFooterField.sheetName:{aParaText+="&A";break}case asc.c_oAscHeaderFooterField.fileName:{aParaText+= "&F";break}case asc.c_oAscHeaderFooterField.filePath:{break}}}else{var aPortionText=aPosList[i].text;if(bFontHtChanged&&aParaText.length&&""!==aPortionText){var cLast=aParaText[aParaText.length-1];var cFirst=aPortionText[0];if("0"<=cLast&&cLast<="9"&&"0"<=cFirst&&cFirst<="9")aParaText+=" "}aParaText+=aPortionText}}if(j!==paragraphs.length-1)aParaText+="\n";aText+=aParaText}if(""!==aText)res+="&"+symbolPortion+aText;return res};function CHeaderFooterEditorSection(type,portion,canvasObj){this.type= type;this.portion=portion;this.canvasObj=canvasObj;this.fragments=null;this.changed=false}CHeaderFooterEditorSection.prototype.setFragments=function(val){this.fragments=this.isEmptyFragments(val)?null:val};CHeaderFooterEditorSection.prototype.isEmptyFragments=function(val){var res=false;if(val&&val.length===1&&val[0].text==="")res=true;return res};CHeaderFooterEditorSection.prototype.getFragments=function(){return this.fragments};CHeaderFooterEditorSection.prototype.drawText=function(){this.canvasObj.drawingCtx.clear(); if(!this.fragments)return;var canvas=this.canvasObj.canvas;var width=this.canvasObj.width;var drawingCtx=this.canvasObj.drawingCtx;var wb=window["Asc"]["editor"].wb;var ws=window["Asc"]["editor"].wb.getWorksheet();var cellFlags=new AscCommonExcel.CellFlags;cellFlags.wrapText=true;cellFlags.textAlign=this.getAlign();var cellEditorWidth=width-2*wb.defaults.worksheetView.cells.padding+1;ws.stringRender.setString(this.fragments,cellFlags);var textMetrics=ws.stringRender._measureChars(cellEditorWidth); var parentHeight=document.getElementById(this.canvasObj.idParent).clientHeight;canvas.height=textMetrics.height>parentHeight?textMetrics.height:parentHeight;ws.stringRender.render(drawingCtx,wb.defaults.worksheetView.cells.padding,0,cellEditorWidth,ws.settings.activeCellBorderColor)};CHeaderFooterEditorSection.prototype.getElem=function(){return document.getElementById(this.canvasObj.idParent)};CHeaderFooterEditorSection.prototype.appendEditor=function(editorElemId){var curElem=this.getElem();var editorElem= document.getElementById(editorElemId);curElem.appendChild(editorElem)};CHeaderFooterEditorSection.prototype.getAlign=function(portion){portion=undefined!==portion?portion:this.portion;var res=AscCommon.align_Left;if(portion===c_nPortionCenterHeader||portion===c_nPortionCenterFooter)res=AscCommon.align_Center;else if(portion===c_nPortionRightHeader||portion===c_nPortionRightFooter)res=AscCommon.align_Right;return res};function convertFieldToMenuText(val){var textField=null;var tM=AscCommon.translateManager; var pageTag="&["+tM.getValue("Page")+"]";var pagesTag="&["+tM.getValue("Pages")+"]";var tabTag="&["+tM.getValue("Tab")+"]";var dateTag="&["+tM.getValue("Date")+"]";var fileTag="&["+tM.getValue("File")+"]";var timeTag="&["+tM.getValue("Time")+"]";switch(val){case asc.c_oAscHeaderFooterField.pageNumber:{textField=pageTag;break}case asc.c_oAscHeaderFooterField.pageCount:{textField=pagesTag;break}case asc.c_oAscHeaderFooterField.date:{textField=dateTag;break}case asc.c_oAscHeaderFooterField.time:{textField= timeTag;break}case asc.c_oAscHeaderFooterField.sheetName:{textField=tabTag;break}case asc.c_oAscHeaderFooterField.fileName:{textField=fileTag;break}case asc.c_oAscHeaderFooterField.filePath:{break}case asc.c_oAscHeaderFooterField.lineBreak:{textField="\n";break}}return textField}window.Asc.g_header_footer_editor=null;function CHeaderFooterEditor(idArr,width,pageType){window.Asc.g_header_footer_editor=this;this.parentWidth=AscBrowser.isRetina?AscCommon.AscBrowser.convertToRetinaValue(width,true):width; this.parentHeight=90;this.pageType=undefined===pageType?asc.c_oAscHeaderFooterType.odd:pageType;this.canvas=[];this.sections=[];this.curParentFocusId=null;this.cellEditor=null;this.wbCellEditor=null;this.editorElemId="ce-canvas-outer-menu";this.api=window["Asc"]["editor"];this.wb=this.api.wb;this.presets=null;this.menuPresets=null;this.alignWithMargins=null;this.differentFirst=null;this.differentOddEven=null;this.scaleWithDoc=null;this.init(idArr)}CHeaderFooterEditor.prototype.init=function(idArr){var t= this;var createAndPushCanvasObj=function(id){var obj={};obj.idParent=id;obj.id=id+"-canvas";obj.width=t.parentWidth;obj.canvas=document.createElement("canvas");obj.canvas.id=obj.id;obj.canvas.width=t.parentWidth;obj.canvas.height=t.parentHeight;obj.canvas.style.width=AscBrowser.isRetina?AscCommon.AscBrowser.convertToRetinaValue(t.parentWidth)+"px":t.parentWidth+"px";var curElem=document.getElementById(id);curElem.appendChild(obj.canvas);obj.drawingCtx=new asc.DrawingContext({canvas:obj.canvas,units:0, fmgrGraphics:t.wb.fmgrGraphics,font:t.wb.m_oFont});return obj};this.parentHeight=document.getElementById(idArr[0]).clientHeight;this.canvas[c_nPortionLeftHeader]=createAndPushCanvasObj(idArr[0]);this.canvas[c_nPortionCenterHeader]=createAndPushCanvasObj(idArr[1]);this.canvas[c_nPortionRightHeader]=createAndPushCanvasObj(idArr[2]);this.canvas[c_nPortionLeftFooter]=createAndPushCanvasObj(idArr[3]);this.canvas[c_nPortionCenterFooter]=createAndPushCanvasObj(idArr[4]);this.canvas[c_nPortionRightFooter]= createAndPushCanvasObj(idArr[5]);var ws=this.wb.getWorksheet();this.alignWithMargins=ws.model.headerFooter.alignWithMargins;this.differentFirst=ws.model.headerFooter.differentFirst;this.differentOddEven=ws.model.headerFooter.differentOddEven;this.scaleWithDoc=ws.model.headerFooter.scaleWithDoc;this.wbCellEditor=this.wb.cellEditor;this._createAndDrawSections();this._generatePresetsArr();ws._isLockedHeaderFooter()};CHeaderFooterEditor.prototype.switchHeaderFooterType=function(type){if(type===this.pageType)return; var isError=this._checkSave();if(null!==isError)return isError;if(this.cellEditor){var prevField=this._getSectionById(this.curParentFocusId);var prevFragments=this.cellEditor.options.fragments;prevField.setFragments(prevFragments);prevField.drawText();prevField.canvasObj.canvas.style.display="block";this.cellEditor.close();document.getElementById(this.editorElemId).remove()}this.curParentFocusId=null;this.cellEditor=null;this.pageType=type;this._createAndDrawSections(type)};CHeaderFooterEditor.prototype.click= function(id,x,y){var api=this.api;var wb=this.wb;var t=this;var editLockCallback=function(){id=id.replace("#","");if(t.curParentFocusId===id){api.asc_enableKeyEvents(true);return}if(null!==t.curParentFocusId){var prevField=t._getSectionById(t.curParentFocusId);var prevFragments=t.cellEditor.options.fragments;prevField.setFragments(prevFragments);prevField.drawText();prevField.canvasObj.canvas.style.display="block"}t.curParentFocusId=id;var cSection=t._getSectionById(id);if(cSection){var sectionElem= cSection.getElem();var fragments=cSection.getFragments();var self=wb;if(!t.cellEditor){t.cellEditor=new AscCommonExcel.CellEditor(sectionElem,wb.input,wb.fmgrGraphics,wb.m_oFont,{"closed":function(){self.setCellEditMode(false)},"updated":function(){self.Api.checkLastWork();self._onUpdateCellEditor.apply(self,arguments)},"updateEditorState":function(state){self.handlers.trigger("asc_onEditCell",state)},"updateEditorSelectionInfo":function(xfs){self.handlers.trigger("asc_onEditorSelectionChanged",xfs)}, "onContextMenu":function(event){self.handlers.trigger("asc_onContextMenu",event)},"updateMenuEditorCursorPosition":function(pos,height){self.handlers.trigger("asc_updateEditorCursorPosition",pos,height)},"resizeEditorHeight":function(){self.handlers.trigger("asc_resizeEditorHeight")}},AscCommon.AscBrowser.isRetina?AscCommon.AscBrowser.convertToRetinaValue(2,true):2,true);wb.cellEditor=t.cellEditor;t.cellEditor.canvasOuter.style.zIndex="";t.cellEditor.canvas.style.zIndex="";t.cellEditor.canvasOverlay.style.zIndex= "";t.cellEditor.cursor.style.zIndex=""}else{t.cellEditor.close();cSection.appendEditor(t.editorElemId)}t._openCellEditor(t.cellEditor,fragments,x,y);t.cellEditor.canvasOuter.style.zIndex="";cSection.canvasObj.canvas.style.display="none";api.asc_enableKeyEvents(true)}};editLockCallback()};CHeaderFooterEditor.prototype._openCellEditor=function(editor,fragments,x,y){var t=this;var wb=this.wb;var ws=wb.getWorksheet();if(!fragments){fragments=[];var tempFragment=new AscCommonExcel.Fragment;tempFragment.text= "";tempFragment.format=new AscCommonExcel.Font;fragments.push(tempFragment)}var curSection=this._getSectionById(this.curParentFocusId);curSection.changed=true;var flags=new window["AscCommonExcel"].CellFlags;flags.wrapText=true;flags.textAlign=curSection.getAlign();var enterOptions=new AscCommonExcel.CEditorEnterOptions;enterOptions.focus=true;if(undefined!==x&&undefined!==y)enterOptions.eventPos={pageX:x,pageY:y};var options={enterOptions:enterOptions,fragments:fragments,flags:flags,font:window["AscCommonExcel"].g_oDefaultFormat.Font, background:ws.settings.cells.defaultState.background,textColor:new window["AscCommonExcel"].RgbColor(0),autoComplete:[],autoCompleteLC:[],saveValueCallback:function(val,flags){},getSides:function(){var bottomArr=[];for(var i=0;i<30;i++)bottomArr.push(t.parentHeight+i*19);return{l:[0],r:[t.parentWidth],b:bottomArr,cellX:0,cellY:0,ri:0,bi:0}},checkVisible:function(){return true},menuEditor:true};wb.setCellEditMode(true);editor.open(options);wb.input.disabled=false;return true};CHeaderFooterEditor.prototype.destroy= function(bSave){var t=this;var api=window["Asc"]["editor"];var wb=api.wb;var ws=wb.getWorksheet();if(bSave&&!ws.collaborativeEditing.getGlobalLock()&&wb.canEdit()){var checkError=this._checkSave();if(null===checkError){wb.cellEditor.close();wb.cellEditor=this.wbCellEditor;var saveCallback=function(isSuccess){if(false===isSuccess){ws.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedAllError,c_oAscError.Level.NoCritical);return}t._saveToModel()};ws._isLockedHeaderFooter(saveCallback)}else return checkError}else{wb.cellEditor.close(); wb.cellEditor=this.wbCellEditor}delete window.Asc.g_header_footer_editor;return null};CHeaderFooterEditor.prototype._checkSave=function(){var t=this;if(null!==this.curParentFocusId){var prevField=this._getSectionById(this.curParentFocusId);var prevFragments=this.cellEditor.options.fragments;prevField.setFragments(prevFragments);prevField.canvasObj.canvas.style.display="block"}var checkError=function(type){var prevHeaderFooter=t._getCurPageHF(type);var curHeaderFooter=new Asc.CHeaderFooterData;curHeaderFooter.parser= new window["AscCommonExcel"].HeaderFooterParser;if(prevHeaderFooter&&prevHeaderFooter.parser){var newPortions=[];for(var i in prevHeaderFooter.parser.portions)if(prevHeaderFooter.parser.portions[i]){newPortions[i]=[];for(var j in prevHeaderFooter.parser.portions[i]){var curPortion=prevHeaderFooter.parser.portions[i][j];if(curPortion)newPortions[i][j]={text:curPortion.text,format:curPortion.format.clone()}}}curHeaderFooter.parser.portions=newPortions}if(t.sections[type][c_oPortionPosition.left]&&t.sections[type][c_oPortionPosition.left].changed)curHeaderFooter.parser.portions[c_oPortionPosition.left]= t._convertFragments(t.sections[type][c_oPortionPosition.left].fragments);if(t.sections[type][c_oPortionPosition.center]&&t.sections[type][c_oPortionPosition.center].changed)curHeaderFooter.parser.portions[c_oPortionPosition.center]=t._convertFragments(t.sections[type][c_oPortionPosition.center].fragments);if(t.sections[type][c_oPortionPosition.right]&&t.sections[type][c_oPortionPosition.right].changed)curHeaderFooter.parser.portions[c_oPortionPosition.right]=t._convertFragments(t.sections[type][c_oPortionPosition.right].fragments); var oData=curHeaderFooter.parser.assembleText();if(oData.str&&oData.str.length>Asc.c_oAscMaxHeaderFooterLength){var maxLength=oData.left.length;var section=c_oPortionPosition.left;if(oData.right.length>oData.left.length&&oData.right.length>oData.center.length){section=c_oPortionPosition.right;maxLength=oData.right.length}else if(oData.center.length>oData.left.length&&oData.center.length>oData.right.length){section=c_oPortionPosition.center;maxLength=oData.center.length}if(t.sections[type]&&t.sections[type][section]&& t.sections[type][section].canvasObj)return{id:"#"+t.sections[type][section].canvasObj.idParent,max:maxLength}}return false};var pageHeaderType=this._getHeaderFooterType(this.pageType);var pageFooterType=this._getHeaderFooterType(this.pageType,true);var headerCheck=checkError(pageHeaderType);var footerCheck=checkError(pageFooterType);if(headerCheck&&footerCheck)return headerCheck.max>footerCheck.max?headerCheck.id:footerCheck.id;else if(headerCheck)return headerCheck.id;else if(footerCheck)return footerCheck.id; return null};CHeaderFooterEditor.prototype._saveToModel=function(){var ws=this.wb.getWorksheet();var isAddHistory=false;for(var i=0;i<this.sections.length;i++){if(!this.sections[i])continue;var curHeaderFooter=this._getCurPageHF(i);if(null===curHeaderFooter)curHeaderFooter=new Asc.CHeaderFooterData;if(!curHeaderFooter.parser)curHeaderFooter.parser=new window["AscCommonExcel"].HeaderFooterParser;var isChanged=false;if(this.sections[i][c_oPortionPosition.left]&&this.sections[i][c_oPortionPosition.left].changed){curHeaderFooter.parser.portions[c_oPortionPosition.left]= this._convertFragments(this.sections[i][c_oPortionPosition.left].fragments);isChanged=true}if(this.sections[i][c_oPortionPosition.center]&&this.sections[i][c_oPortionPosition.center].changed){curHeaderFooter.parser.portions[c_oPortionPosition.center]=this._convertFragments(this.sections[i][c_oPortionPosition.center].fragments);isChanged=true}if(this.sections[i][c_oPortionPosition.right]&&this.sections[i][c_oPortionPosition.right].changed){curHeaderFooter.parser.portions[c_oPortionPosition.right]= this._convertFragments(this.sections[i][c_oPortionPosition.right].fragments);isChanged=true}if(isChanged){if(!isAddHistory){History.Create_NewPoint();History.StartTransaction();isAddHistory=true}curHeaderFooter.parser.assembleText();ws.model.headerFooter.setHeaderFooterData(curHeaderFooter.parser.date,i)}}ws.model.headerFooter.setAlignWithMargins(this.alignWithMargins);ws.model.headerFooter.setDifferentFirst(this.differentFirst);ws.model.headerFooter.setDifferentOddEven(this.differentOddEven);ws.model.headerFooter.setScaleWithDoc(this.scaleWithDoc); if(isAddHistory)History.EndTransaction()};CHeaderFooterEditor.prototype.setFontName=function(fontName){if(null===this.cellEditor)return;var t=this,fonts={};fonts[fontName]=1;t.api._loadFonts(fonts,function(){t.cellEditor.setTextStyle("fn",fontName);t.wb.restoreFocus()})};CHeaderFooterEditor.prototype.setFontSize=function(fontSize){if(null===this.cellEditor)return;this.cellEditor.setTextStyle("fs",fontSize);this.wb.restoreFocus()};CHeaderFooterEditor.prototype.setBold=function(isBold){if(null===this.cellEditor)return; this.cellEditor.setTextStyle("b",isBold);this.wb.restoreFocus()};CHeaderFooterEditor.prototype.setItalic=function(isItalic){if(null===this.cellEditor)return;this.cellEditor.setTextStyle("i",isItalic);this.wb.restoreFocus()};CHeaderFooterEditor.prototype.setUnderline=function(isUnderline){if(null===this.cellEditor)return;this.cellEditor.setTextStyle("u",isUnderline?Asc.EUnderline.underlineSingle:Asc.EUnderline.underlineNone);this.wb.restoreFocus()};CHeaderFooterEditor.prototype.setStrikeout=function(isStrikeout){if(null=== this.cellEditor)return;this.cellEditor.setTextStyle("s",isStrikeout);this.wb.restoreFocus()};CHeaderFooterEditor.prototype.setSubscript=function(isSubscript){if(null===this.cellEditor)return;this.cellEditor.setTextStyle("fa",isSubscript?AscCommon.vertalign_SubScript:null);this.wb.restoreFocus()};CHeaderFooterEditor.prototype.setSuperscript=function(isSuperscript){if(null===this.cellEditor)return;this.cellEditor.setTextStyle("fa",isSuperscript?AscCommon.vertalign_SuperScript:null);this.wb.restoreFocus()}; CHeaderFooterEditor.prototype.setTextColor=function(color){if(null===this.cellEditor)return;if(color instanceof Asc.asc_CColor){color=AscCommonExcel.CorrectAscColor(color);this.cellEditor.setTextStyle("c",color);this.wb.restoreFocus()}};CHeaderFooterEditor.prototype.addField=function(val){if(null===this.cellEditor)return;var textField=convertFieldToMenuText(val);if(null!==textField)this.cellEditor.pasteText(textField)};CHeaderFooterEditor.prototype.getTextPresetsArr=function(){var wb=this.wb;var ws= wb.getWorksheet();var arrPresets=this.menuPresets;if(!arrPresets)return[];var getFragmentText=function(val){if(asc_typeof(val)==="string")return val;else return val.getText(ws,0,1)};var getFragmentsText=function(fragments){var res="";for(var n=0;n<fragments.length;n++)res+=getFragmentText(fragments[n].text);return res};var textPresetsArr=[];for(var i=0;i<arrPresets.length;i++){if(!arrPresets[i])continue;textPresetsArr[i]="";for(var j=0;j<arrPresets[i].length;j++)if(arrPresets[i][j]){var fragments= this._convertFragments([this._getFragments(arrPresets[i][j])]);if(""!==textPresetsArr[i])textPresetsArr[i]+=", ";textPresetsArr[i]+=getFragmentsText(fragments)}if(""===textPresetsArr[i])textPresetsArr[i]="None"}return textPresetsArr};CHeaderFooterEditor.prototype.applyPreset=function(type,bFooter){var curType=this._getHeaderFooterType(this.pageType,bFooter);var section=this.sections[curType];if(this.cellEditor)if(section[c_oPortionPosition.left]&§ion[c_oPortionPosition.left].canvasObj)this.click(section[c_oPortionPosition.left].canvasObj.idParent); this.curParentFocusId=null;var fragments;for(var i=0;i<section.length;i++){if(!this.presets[type][i])section[i].setFragments(null);else{fragments=[this._getFragments(this.presets[type][i],new AscCommonExcel.Font)];section[i].setFragments(fragments)}section[i].drawText();section[i].changed=true;section[i].canvasObj.canvas.style.display="block"}};CHeaderFooterEditor.prototype.getAppliedPreset=function(type,bFooter){var res=Asc.c_oAscHeaderFooterPresets.none;type=undefined!==type?type:this.pageType; var curType=this._getHeaderFooterType(type,bFooter);var section=this.sections[curType];for(var i=0;i<section.length;i++)if(null!==section[i].fragments){res=Asc.c_oAscHeaderFooterPresets.custom;break}return res};CHeaderFooterEditor.prototype.setAlignWithMargins=function(val){this.alignWithMargins=val};CHeaderFooterEditor.prototype.setDifferentFirst=function(val){var checkError;if(!val&&(checkError=this._checkSave())!==null)return checkError;this.differentFirst=val;return null};CHeaderFooterEditor.prototype.setDifferentOddEven= function(val){var checkError;if(!val&&(checkError=this._checkSave())!==null)return checkError;this.differentOddEven=val;return null};CHeaderFooterEditor.prototype.setScaleWithDoc=function(val){this.scaleWithDoc=val};CHeaderFooterEditor.prototype.getAlignWithMargins=function(){return true===this.alignWithMargins||null===this.alignWithMargins};CHeaderFooterEditor.prototype.getDifferentFirst=function(){return true===this.differentFirst};CHeaderFooterEditor.prototype.getDifferentOddEven=function(){return true=== this.differentOddEven};CHeaderFooterEditor.prototype.getScaleWithDoc=function(){return true===this.scaleWithDoc||null===this.scaleWithDoc};CHeaderFooterEditor.prototype._createAndDrawSections=function(pageCommonType){var pageHeaderType=this._getHeaderFooterType(pageCommonType);var pageFooterType=this._getHeaderFooterType(pageCommonType,true);var getFragments=function(textPropsArr){if(!textPropsArr)return null;var res=[];for(var i=0;i<textPropsArr.length;i++){var curProps=textPropsArr[i];var text= asc_typeof(curProps.text)==="string"?curProps.text:convertFieldToMenuText(curProps.text.field);if(null!==text){var tempFragment=new AscCommonExcel.Fragment;tempFragment.text=text;tempFragment.format=curProps.format;res.push(tempFragment)}}return res};var curPageHF,parser,leftFragments,centerFragments,rightFragments;if(!this.sections[pageHeaderType]){this.sections[pageHeaderType]=[];this.sections[pageHeaderType][c_oPortionPosition.left]=new CHeaderFooterEditorSection(pageHeaderType,c_nPortionLeftHeader, this.canvas[c_nPortionLeftHeader]);this.sections[pageHeaderType][c_oPortionPosition.center]=new CHeaderFooterEditorSection(pageHeaderType,c_nPortionCenterHeader,this.canvas[c_nPortionCenterHeader]);this.sections[pageHeaderType][c_oPortionPosition.right]=new CHeaderFooterEditorSection(pageHeaderType,c_nPortionRightHeader,this.canvas[c_nPortionRightHeader]);curPageHF=this._getCurPageHF(pageHeaderType);if(curPageHF&&curPageHF.str){if(!curPageHF.parser)curPageHF.parse();parser=curPageHF.parser.portions; leftFragments=getFragments(parser[0]);if(null!==leftFragments)this.sections[pageHeaderType][c_oPortionPosition.left].fragments=leftFragments;centerFragments=getFragments(parser[1]);if(null!==centerFragments)this.sections[pageHeaderType][c_oPortionPosition.center].fragments=centerFragments;rightFragments=getFragments(parser[2]);if(null!==rightFragments)this.sections[pageHeaderType][c_oPortionPosition.right].fragments=rightFragments}}if(!this.sections[pageFooterType]){this.sections[pageFooterType]= [];this.sections[pageFooterType][c_oPortionPosition.left]=new CHeaderFooterEditorSection(pageFooterType,c_nPortionLeftFooter,this.canvas[c_nPortionLeftFooter]);this.sections[pageFooterType][c_oPortionPosition.center]=new CHeaderFooterEditorSection(pageFooterType,c_nPortionCenterFooter,this.canvas[c_nPortionCenterFooter]);this.sections[pageFooterType][c_oPortionPosition.right]=new CHeaderFooterEditorSection(pageFooterType,c_nPortionRightFooter,this.canvas[c_nPortionRightFooter]);curPageHF=this._getCurPageHF(pageFooterType); if(curPageHF&&curPageHF.str){if(!curPageHF.parser)curPageHF.parse();parser=curPageHF.parser.portions;leftFragments=getFragments(parser[0]);if(null!==leftFragments)this.sections[pageFooterType][c_oPortionPosition.left].fragments=leftFragments;centerFragments=getFragments(parser[1]);if(null!==centerFragments)this.sections[pageFooterType][c_oPortionPosition.center].fragments=centerFragments;rightFragments=getFragments(parser[2]);if(null!==rightFragments)this.sections[pageFooterType][c_oPortionPosition.right].fragments= rightFragments}}this.sections[pageHeaderType][c_oPortionPosition.left].drawText();this.sections[pageHeaderType][c_oPortionPosition.center].drawText();this.sections[pageHeaderType][c_oPortionPosition.right].drawText();this.sections[pageFooterType][c_oPortionPosition.left].drawText();this.sections[pageFooterType][c_oPortionPosition.center].drawText();this.sections[pageFooterType][c_oPortionPosition.right].drawText()};CHeaderFooterEditor.prototype._getHeaderFooterType=function(type,bFooter){var res= bFooter?asc.c_oAscPageHFType.oddFooter:asc.c_oAscPageHFType.oddHeader;if(type===asc.c_oAscHeaderFooterType.first)res=bFooter?asc.c_oAscPageHFType.firstFooter:asc.c_oAscPageHFType.firstHeader;else if(type===asc.c_oAscHeaderFooterType.even)res=bFooter?asc.c_oAscPageHFType.evenFooter:asc.c_oAscPageHFType.evenHeader;return res};CHeaderFooterEditor.prototype._getCurPageHF=function(type){var res=null;var ws=this.wb.getWorksheet();if(ws.model.headerFooter)switch(type){case asc.c_oAscPageHFType.firstHeader:{res= ws.model.headerFooter.firstHeader;break}case asc.c_oAscPageHFType.oddHeader:{res=ws.model.headerFooter.oddHeader;break}case asc.c_oAscPageHFType.evenHeader:{res=ws.model.headerFooter.evenHeader;break}case asc.c_oAscPageHFType.firstFooter:{res=ws.model.headerFooter.firstFooter;break}case asc.c_oAscPageHFType.oddFooter:{res=ws.model.headerFooter.oddFooter;break}case asc.c_oAscPageHFType.evenFooter:{res=ws.model.headerFooter.evenFooter;break}}return res};CHeaderFooterEditor.prototype._getSectionById= function(id){var res=null;var type=this._getHeaderFooterType(this.pageType);var i;if(this.sections&&this.sections[type])for(i=0;i<this.sections[type].length;i++)if(id===this.sections[type][i].canvasObj.idParent)return this.sections[type][i];type=this._getHeaderFooterType(this.pageType,true);if(this.sections&&this.sections[type])for(i=0;i<this.sections[type].length;i++)if(id===this.sections[type][i].canvasObj.idParent)return this.sections[type][i];return res};CHeaderFooterEditor.prototype._convertFragments= function(fragments){if(!fragments)return null;var res=[];var tM=AscCommon.translateManager;var bToken,text,symbol,startToken,tokenText,tokenFormat;for(var j=0;j<fragments.length;j++){text="";for(var n=0;n<fragments[j].text.length;n++){symbol=fragments[j].text[n];if(symbol!=="&")text+=symbol;if(symbol==="&"){if(""!==text){res.push({text:text,format:fragments[j].format});text=""}bToken=true;tokenFormat=fragments[j].format}else if(startToken){if(symbol==="]"){switch(tokenText.toLowerCase()){case tM.getValue("Page").toLowerCase():{text= "";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.pageNumber),format:tokenFormat});break}case tM.getValue("Pages").toLowerCase():{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.pageCount),format:tokenFormat});break}case tM.getValue("Date").toLowerCase():{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.date),format:tokenFormat});break}case tM.getValue("Time").toLowerCase():{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.time), format:tokenFormat});break}case tM.getValue("Tab").toLowerCase():{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.sheetName),format:tokenFormat});break}case tM.getValue("File").toLowerCase():{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.fileName),format:tokenFormat});break}case "&[Path]&[File]":{text="";break}default:{if(""!==text&&j===fragments.length-1&&n===fragments[j].text.length-1){res.push({text:text,format:fragments[j].format});text=""}break}}bToken= false;startToken=false}else tokenText+=symbol;if(""!==text&&j===fragments.length-1&&n===fragments[j].text.length-1)res.push({text:text,format:fragments[j].format})}else if(bToken)if(symbol==="["){startToken=true;tokenText=""}else{switch(symbol){case "l":case "c":case "r":case "b":case "i":case "u":case "e":case "s":case "x":case "y":case "o":case "h":case "k":case '"':break;case "p":{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.pageNumber),format:tokenFormat});break}case "n":{text= "";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.pageCount),format:tokenFormat});break}case "a":{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.sheetName),format:tokenFormat});break}case "f":{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.fileName),format:tokenFormat});break}case "z":{text="";break}case "d":{text="";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.date),format:tokenFormat});break}case "t":{text= "";res.push({text:new HeaderFooterField(asc.c_oAscHeaderFooterField.time),format:tokenFormat});break}default:{if(""!==text&&j===fragments.length-1&&n===fragments[j].text.length-1){res.push({text:text,format:fragments[j].format});text=""}break}}bToken=false}else if(""!==text&&n===fragments[j].text.length-1)res.push({text:text,format:fragments[j].format})}}return res};CHeaderFooterEditor.prototype._getFragments=function(text,format){var tempFragment=new AscCommonExcel.Fragment;tempFragment.text=text; tempFragment.format=format;return tempFragment};CHeaderFooterEditor.prototype._generatePresetsArr=function(){var docInfo=window["Asc"]["editor"].DocInfo;var userInfo=docInfo?docInfo.get_UserInfo():null;var userName=userInfo?userInfo.get_FullName():"";var fileName=docInfo?docInfo.get_Title():"";var tM=AscCommon.translateManager;var confidential=tM.getValue("Confidential");var preparedBy=tM.getValue("Prepared by ");var page=tM.getValue("Page");var pageOf=tM.getValue("Page %1 of %2");var pageTag="&["+ page+"]";var pagesTag="&["+tM.getValue("Pages")+"]";var tabTag="&["+tM.getValue("Tab")+"]";var dateTag="&["+tM.getValue("Date")+"]";var fileTag="&["+tM.getValue("File")+"]";var arrPresets=[];var arrPresetsMenu=[];arrPresets[0]=arrPresetsMenu[0]=[null,null,null];arrPresets[1]=arrPresetsMenu[1]=[null,page+" "+pageTag,null];arrPresets[2]=[null,pageOf.replace("%1",pageTag).replace("%2",pagesTag),null];arrPresetsMenu[2]=[null,pageOf.replace("%1",pageTag).replace("%2","?"),null];arrPresets[3]=arrPresetsMenu[3]= [null,tabTag,null];arrPresets[4]=arrPresetsMenu[4]=[confidential,dateTag,page+" "+pageTag];arrPresets[5]=arrPresetsMenu[5]=[null,fileTag,null];arrPresets[6]=arrPresetsMenu[6]=[null,tabTag,page+" "+pageTag];arrPresets[7]=arrPresetsMenu[7]=[tabTag,confidential,page+" "+pageTag];arrPresets[8]=arrPresetsMenu[8]=[null,fileTag,page+" "+pageTag];arrPresets[9]=arrPresetsMenu[9]=[null,page+" "+pageTag,tabTag];arrPresets[10]=arrPresetsMenu[10]=[null,page+" "+pageTag,fileName];arrPresets[11]=arrPresetsMenu[11]= [null,page+" "+pageTag,fileTag];arrPresets[12]=arrPresetsMenu[12]=[userName,page+" "+pageTag,dateTag];arrPresets[13]=arrPresetsMenu[13]=[null,preparedBy+userName+" "+dateTag,page+" "+pageTag];this.presets=arrPresets;this.menuPresets=arrPresetsMenu};CHeaderFooterEditor.prototype.getPageType=function(){return this.pageType};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].HeaderFooterParser=HeaderFooterParser;window["AscCommonExcel"].CHeaderFooterEditorSection=CHeaderFooterEditorSection; window["AscCommonExcel"].CHeaderFooterEditor=window["AscCommonExcel"]["CHeaderFooterEditor"]=CHeaderFooterEditor;var prot=CHeaderFooterEditor.prototype;prot["click"]=prot.click;prot["destroy"]=prot.destroy;prot["setFontName"]=prot.setFontName;prot["setFontSize"]=prot.setFontSize;prot["setBold"]=prot.setBold;prot["setItalic"]=prot.setItalic;prot["setUnderline"]=prot.setUnderline;prot["setStrikeout"]=prot.setStrikeout;prot["setSubscript"]=prot.setSubscript;prot["setSuperscript"]=prot.setSuperscript; prot["setTextColor"]=prot.setTextColor;prot["addField"]=prot.addField;prot["switchHeaderFooterType"]=prot.switchHeaderFooterType;prot["getTextPresetsArr"]=prot.getTextPresetsArr;prot["applyPreset"]=prot.applyPreset;prot["getAppliedPreset"]=prot.getAppliedPreset;prot["setAlignWithMargins"]=prot.setAlignWithMargins;prot["setDifferentFirst"]=prot.setDifferentFirst;prot["setDifferentOddEven"]=prot.setDifferentOddEven;prot["setScaleWithDoc"]=prot.setScaleWithDoc;prot["getAlignWithMargins"]=prot.getAlignWithMargins; prot["getDifferentFirst"]=prot.getDifferentFirst;prot["getDifferentOddEven"]=prot.getDifferentOddEven;prot["getScaleWithDoc"]=prot.getScaleWithDoc;prot["getPageType"]=prot.getPageType;window["AscCommonExcel"].c_oPortionPosition=c_oPortionPosition})(window);"use strict";(function(window,undefined){var c_oAscBorderStyles=AscCommon.c_oAscBorderStyles;function asc_CBorder(style,color){this.style=style!==undefined?style:c_oAscBorderStyles.None;this.color=color!==undefined?color:null}asc_CBorder.prototype= {asc_getStyle:function(){return this.style},asc_getColor:function(){return this.color}};function asc_CBorders(){this.left=null;this.top=null;this.right=null;this.bottom=null;this.diagDown=null;this.diagUp=null}asc_CBorders.prototype={asc_getLeft:function(){return this.left},asc_getTop:function(){return this.top},asc_getRight:function(){return this.right},asc_getBottom:function(){return this.bottom},asc_getDiagDown:function(){return this.diagDown},asc_getDiagUp:function(){return this.diagUp}};function asc_CAutoFilterInfo(){this.tableStyleName= null;this.tableName=null;this.isApplyAutoFilter=false;this.isAutoFilter=false;this.isSlicerAdded=false}asc_CAutoFilterInfo.prototype={asc_getTableStyleName:function(){return this.tableStyleName},asc_getTableName:function(){return this.tableName},asc_getIsAutoFilter:function(){return this.isAutoFilter},asc_getIsApplyAutoFilter:function(){return this.isApplyAutoFilter},asc_getIsSlicerAdded:function(){return this.isSlicerAdded}};function asc_CFormatTableInfo(){this.tableStyleName=null;this.tableName= null;this.tableRange=null;this.firstRow=null;this.lastRow=null;this.bandHor=null;this.firstCol=null;this.lastCol=null;this.bandVer=null;this.filterButton=null;this.isInsertRowAbove=null;this.isInsertRowBelow=null;this.isInsertColumnLeft=null;this.isInsertColumnRight=null;this.isDeleteRow=null;this.isDeleteColumn=null;this.isDeleteTable=null;this.altText=null;this.altTextSummary=null}asc_CFormatTableInfo.prototype={asc_getTableStyleName:function(){return this.tableStyleName},asc_getTableName:function(){return this.tableName}, asc_getFirstRow:function(){return this.firstRow},asc_getLastRow:function(){return this.lastRow},asc_getBandHor:function(){return this.bandHor},asc_getFirstCol:function(){return this.firstCol},asc_getLastCol:function(){return this.lastCol},asc_getBandVer:function(){return this.bandVer},asc_getFilterButton:function(){return this.filterButton},asc_getTableRange:function(){return this.tableRange},asc_getIsInsertRowAbove:function(){return this.isInsertRowAbove},asc_getIsInsertRowBelow:function(){return this.isInsertRowBelow}, asc_getIsInsertColumnLeft:function(){return this.isInsertColumnLeft},asc_getIsInsertColumnRight:function(){return this.isInsertColumnRight},asc_getIsDeleteRow:function(){return this.isDeleteRow},asc_getIsDeleteColumn:function(){return this.isDeleteColumn},asc_getIsDeleteTable:function(){return this.isDeleteTable},asc_getTitle:function(){return this.altText},asc_getDescription:function(){return this.altTextSummary}};function asc_CCellInfo(){this.xfs=null;this.text="";this.merge=Asc.c_oAscMergeOptions.None; this.selectionType=null;this.multiselect=false;this.lockText=false;this.innertext=null;this.hyperlink=null;this.comment=null;this.isLocked=false;this.isLockedTable=false;this.isLockedSparkline=false;this.isLockedPivotTable=false;this.styleName=null;this.autoFilterInfo=null;this.formatTableInfo=null;this.sparklineInfo=null;this.pivotTableInfo=null;this.dataValidation=null;this.selectedColsCount=null;this.isLockedHeaderFooter=false;this.border=null}asc_CCellInfo.prototype.asc_getXfs=function(){return this.xfs}; asc_CCellInfo.prototype.asc_getText=function(){return this.text};asc_CCellInfo.prototype.asc_getMerge=function(){return this.merge};asc_CCellInfo.prototype.asc_getSelectionType=function(){return this.selectionType};asc_CCellInfo.prototype.asc_getMultiselect=function(){return this.multiselect};asc_CCellInfo.prototype.asc_getLockText=function(){return this.lockText};asc_CCellInfo.prototype.asc_getBorders=function(){return this.border};asc_CCellInfo.prototype.asc_getInnerText=function(){return this.innertext}; asc_CCellInfo.prototype.asc_getHyperlink=function(){return this.hyperlink};asc_CCellInfo.prototype.asc_getComments=function(){return this.comment?[this.comment]:[]};asc_CCellInfo.prototype.asc_getLocked=function(){return this.isLocked};asc_CCellInfo.prototype.asc_getLockedTable=function(){return this.isLockedTable};asc_CCellInfo.prototype.asc_getLockedSparkline=function(){return this.isLockedSparkline};asc_CCellInfo.prototype.asc_getLockedPivotTable=function(){return this.isLockedPivotTable};asc_CCellInfo.prototype.asc_getStyleName= function(){return this.styleName};asc_CCellInfo.prototype.asc_getAutoFilterInfo=function(){return this.autoFilterInfo};asc_CCellInfo.prototype.asc_getFormatTableInfo=function(){return this.formatTableInfo};asc_CCellInfo.prototype.asc_getSparklineInfo=function(){return this.sparklineInfo};asc_CCellInfo.prototype.asc_getPivotTableInfo=function(){return this.pivotTableInfo};asc_CCellInfo.prototype.asc_getDataValidation=function(){return this.dataValidation};asc_CCellInfo.prototype.asc_getSelectedColsCount= function(){return this.selectedColsCount};asc_CCellInfo.prototype.asc_getLockedHeaderFooter=function(){return this.isLockedHeaderFooter};function asc_CDefName(n,r,s,t,h,l,x,bLocale){this.Name=n;this.LocalSheetId=s;this.Ref=r;this.type=t;this.Hidden=h;this.isLock=l;this.isXLNM=x;if(bLocale)this._translate()}asc_CDefName.prototype={asc_getName:function(bLocale){return bLocale&&null!==this.LocalSheetId?AscCommon.translateManager.getValue(this.Name):this.Name},asc_getScope:function(){return this.LocalSheetId}, asc_getRef:function(){return this.Ref},asc_getType:function(){return this.type},asc_getIsHidden:function(){return this.Hidden},asc_getIsLock:function(){return this.isLock},asc_getIsXlnm:function(){return this.isXLNM},_translate:function(){if(null!==this.LocalSheetId){var translatePrintArea=AscCommonExcel.tryTranslateToPrintArea(this.Name);if(translatePrintArea){this.Name=translatePrintArea;this.isXLNM=true}}}};function asc_CCheckDefName(s,r){this.status=s;this.reason=r}asc_CCheckDefName.prototype.asc_getStatus= function(){return this.status};asc_CCheckDefName.prototype.asc_getReason=function(){return this.reason};var prot;window["Asc"]=window["Asc"]||{};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["Asc"].asc_CBorder=window["Asc"]["asc_CBorder"]=asc_CBorder;prot=asc_CBorder.prototype;prot["asc_getStyle"]=prot.asc_getStyle;prot["asc_getColor"]=prot.asc_getColor;window["AscCommonExcel"].asc_CBorders=asc_CBorders;prot=asc_CBorders.prototype;prot["asc_getLeft"]=prot.asc_getLeft;prot["asc_getTop"]= prot.asc_getTop;prot["asc_getRight"]=prot.asc_getRight;prot["asc_getBottom"]=prot.asc_getBottom;prot["asc_getDiagDown"]=prot.asc_getDiagDown;prot["asc_getDiagUp"]=prot.asc_getDiagUp;window["AscCommonExcel"].asc_CAutoFilterInfo=asc_CAutoFilterInfo;prot=asc_CAutoFilterInfo.prototype;prot["asc_getTableStyleName"]=prot.asc_getTableStyleName;prot["asc_getTableName"]=prot.asc_getTableName;prot["asc_getIsAutoFilter"]=prot.asc_getIsAutoFilter;prot["asc_getIsApplyAutoFilter"]=prot.asc_getIsApplyAutoFilter; prot["asc_getIsSlicerAdded"]=prot.asc_getIsSlicerAdded;window["AscCommonExcel"].asc_CFormatTableInfo=asc_CFormatTableInfo;prot=asc_CFormatTableInfo.prototype;prot["asc_getTableStyleName"]=prot.asc_getTableStyleName;prot["asc_getTableName"]=prot.asc_getTableName;prot["asc_getFirstRow"]=prot.asc_getFirstRow;prot["asc_getLastRow"]=prot.asc_getLastRow;prot["asc_getBandHor"]=prot.asc_getBandHor;prot["asc_getFirstCol"]=prot.asc_getFirstCol;prot["asc_getLastCol"]=prot.asc_getLastCol;prot["asc_getBandVer"]= prot.asc_getBandVer;prot["asc_getFilterButton"]=prot.asc_getFilterButton;prot["asc_getTableRange"]=prot.asc_getTableRange;prot["asc_getIsInsertRowAbove"]=prot.asc_getIsInsertRowAbove;prot["asc_getIsInsertRowBelow"]=prot.asc_getIsInsertRowBelow;prot["asc_getIsInsertColumnLeft"]=prot.asc_getIsInsertColumnLeft;prot["asc_getIsInsertColumnRight"]=prot.asc_getIsInsertColumnRight;prot["asc_getIsDeleteRow"]=prot.asc_getIsDeleteRow;prot["asc_getIsDeleteColumn"]=prot.asc_getIsDeleteColumn;prot["asc_getIsDeleteTable"]= prot.asc_getIsDeleteTable;prot["asc_getTitle"]=prot.asc_getTitle;prot["asc_getDescription"]=prot.asc_getDescription;window["AscCommonExcel"].asc_CCellInfo=asc_CCellInfo;prot=asc_CCellInfo.prototype;prot["asc_getXfs"]=prot.asc_getXfs;prot["asc_getText"]=prot.asc_getText;prot["asc_getMerge"]=prot.asc_getMerge;prot["asc_getSelectionType"]=prot.asc_getSelectionType;prot["asc_getMultiselect"]=prot.asc_getMultiselect;prot["asc_getLockText"]=prot.asc_getLockText;prot["asc_getBorders"]=prot.asc_getBorders; prot["asc_getInnerText"]=prot.asc_getInnerText;prot["asc_getHyperlink"]=prot.asc_getHyperlink;prot["asc_getComments"]=prot.asc_getComments;prot["asc_getLocked"]=prot.asc_getLocked;prot["asc_getLockedTable"]=prot.asc_getLockedTable;prot["asc_getLockedSparkline"]=prot.asc_getLockedSparkline;prot["asc_getLockedPivotTable"]=prot.asc_getLockedPivotTable;prot["asc_getStyleName"]=prot.asc_getStyleName;prot["asc_getAutoFilterInfo"]=prot.asc_getAutoFilterInfo;prot["asc_getFormatTableInfo"]=prot.asc_getFormatTableInfo; prot["asc_getSparklineInfo"]=prot.asc_getSparklineInfo;prot["asc_getPivotTableInfo"]=prot.asc_getPivotTableInfo;prot["asc_getDataValidation"]=prot.asc_getDataValidation;prot["asc_getSelectedColsCount"]=prot.asc_getSelectedColsCount;prot["asc_getLockedHeaderFooter"]=prot.asc_getLockedHeaderFooter;window["Asc"].asc_CDefName=window["Asc"]["asc_CDefName"]=asc_CDefName;prot=asc_CDefName.prototype;prot["asc_getName"]=prot.asc_getName;prot["asc_getScope"]=prot.asc_getScope;prot["asc_getRef"]=prot.asc_getRef; prot["asc_getType"]=prot.asc_getType;prot["asc_getIsHidden"]=prot.asc_getIsHidden;prot["asc_getIsLock"]=prot.asc_getIsLock;prot["asc_getIsXlnm"]=prot.asc_getIsXlnm;window["Asc"].asc_CCheckDefName=window["Asc"]["asc_CCheckDefName"]=asc_CCheckDefName;prot=asc_CCheckDefName.prototype;prot["asc_getStatus"]=prot.asc_getStatus;prot["asc_getReason"]=prot.asc_getReason})(window);"use strict";(function(window,undefined){var insertSlicerType={table:0,pivotTable:1};var ST_olapSlicerCacheSortOrder={Natural:0, Ascending:1,Descending:2};var ST_tabularSlicerCacheSortOrder={Ascending:0,Descending:1};var ST_slicerCacheCrossFilter={None:0,ShowItemsWithDataAtTop:1,ShowItemsWithNoData:2};var ST_slicerStyleType={unselectedItemWithData:0,selectedItemWithData:1,unselectedItemWithNoData:2,selectedItemWithNoData:3,hoveredUnselectedItemWithData:4,hoveredSelectedItemWithData:5,hoveredUnselectedItemWithNoData:6,hoveredSelectedItemWithNoData:7};function CT_slicerStyleElement(){this.type=null;this.dxfId=null;return this} CT_slicerStyleElement.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUChar2(0,this.type);s._WriteUInt2(1,this.dxfId);s.WriteUChar(AscCommon.g_nodeAttributeEnd)};CT_slicerStyleElement.prototype.fromStream=function(s){var _type;var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.type=s.GetUChar();break}case 1:{this.dxfId=s.GetULong(); break}default:s.Seek2(_end_pos);return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};function CT_slicerStyle(){this.name=null;this.slicerStyleElements=[];return this}CT_slicerStyle.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.name);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.slicerStyleElements)};CT_slicerStyle.prototype.fromStream=function(s){var _type; var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.name=s.GetString2();break}default:s.Seek2(_end_pos);return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_slicerStyleElement;tmp.fromStream(s);this.slicerStyleElements.push(tmp)}break}default:{s.SkipRecord(); break}}}s.Seek2(_end_pos)};function CT_slicerStyles(){this.defaultSlicerStyle=null;this.slicerStyle=[];return this}CT_slicerStyles.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.defaultSlicerStyle);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.slicerStyle)};CT_slicerStyles.prototype.fromStream=function(s){var _type;var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at= s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.defaultSlicerStyle=s.GetString2();break}default:s.Seek2(_end_pos);return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_slicerStyle;tmp.fromStream(s);this.slicerStyle.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};function CT_slicers(){this.slicer=[];return this}CT_slicers.prototype.toStream= function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.slicer)};CT_slicers.prototype.fromStream=function(s,ws,slicerCaches){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4); var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_slicer(ws);tmp.fromStream(s,slicerCaches);this.slicer.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};function CT_slicer(ws){this.name=null;this.uid=AscCommon.CreateGUID();this.cacheDefinition=null;this.caption=null;this.startItem=0;this.columnCount=1;this.showCaption=true;this.level=0;this.style=null;this.lockedPosition=false;this.rowHeight=null;this.ws=ws;this._writeBinaryForHistory=null;this._ascSourceName=null; this._ascNameInFormulas=null;this._ascSortOrder=null;this._ascCustomListSort=null;this._ascHideItemsWithNoData=null;this._ascIndicateItemsWithNoData=null;this._ascShowItemsWithNoDataLast=null;this._ascButtonWidth=null;return this}CT_slicer.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.Slicer};CT_slicer.prototype.clone=function(ws){var res=new CT_slicer(ws);res.name=this.name;res.caption=this.caption;res.startItem=this.startItem;res.columnCount=this.columnCount;res.showCaption= this.showCaption;res.level=this.level;res.style=this.style;res.lockedPosition=this.lockedPosition;res.rowHeight=this.rowHeight;if(ws){res.uid=AscCommon.CreateGUID();res.cacheDefinition=this.cacheDefinition.clone(ws.workbook);return res}this.initInterfaceOptions();res._ascSourceName=this._ascSourceName;res._ascNameInFormulas=this._ascNameInFormulas;res._ascSortOrder=this._ascSortOrder;res._ascCustomListSort=this._ascCustomListSort;res._ascHideItemsWithNoData=this._ascHideItemsWithNoData;res._ascIndicateItemsWithNoData= this._ascIndicateItemsWithNoData;res._ascShowItemsWithNoDataLast=this._ascShowItemsWithNoDataLast;res._ascButtonWidth=this._ascButtonWidth;return res};CT_slicer.prototype.merge=function(val){if(val.name!==this.name)this.name=undefined;if(val.caption!==this.caption)this.caption=undefined;if(val.startItem!==this.startItem)this.startItem=undefined;if(val.columnCount!==this.columnCount)this.columnCount=undefined;if(val.showCaption!==this.showCaption)this.showCaption=undefined;if(val.level!==this.level)this.level= undefined;if(val.style!==this.style)this.style=undefined;if(val.lockedPosition!==this.lockedPosition)this.lockedPosition=undefined;if(val.rowHeight!==this.rowHeight)this.rowHeight=undefined;if(val._ascSourceName!==this._ascSourceName)this._ascSourceName=undefined;if(val._ascNameInFormulas!==this._ascNameInFormulas)this._ascNameInFormulas=undefined;if(val._ascSortOrder!==this._ascSortOrder)this._ascSortOrder=undefined;if(val._ascCustomListSort!==this._ascCustomListSort)this._ascCustomListSort=undefined; if(val._ascHideItemsWithNoData!==this._ascHideItemsWithNoData)this._ascHideItemsWithNoData=undefined;if(val._ascIndicateItemsWithNoData!==this._ascIndicateItemsWithNoData)this._ascIndicateItemsWithNoData=undefined;if(val._ascShowItemsWithNoDataLast!==this._ascShowItemsWithNoDataLast)this._ascShowItemsWithNoDataLast=undefined;if(val._ascButtonWidth!==this._ascButtonWidth)this._ascButtonWidth=undefined};CT_slicer.prototype.init=function(name,obj_name,type,ws,pivotTable){var isNewCache=false;if(name){this.name= this.generateName(name);this.caption=name}if(!this.rowHeight)this.rowHeight=241300;if(!this.cacheDefinition){var cache;var caches=this.ws.getSlicerCachesBySourceName(name);if(caches)for(var i=0;i<caches.length;i++)if(caches[i].checkObjApply(name,obj_name,type,pivotTable)){cache=caches[i];break}if(!cache){cache=new CT_slicerCacheDefinition(this.ws.workbook);cache.init(name,obj_name,type,pivotTable);isNewCache=true}this.cacheDefinition=cache}if(ws&&!this.ws){this.ws=ws;if(!this.cacheDefinition.isInit())this.cacheDefinition.initAfterSerialize(ws.workbook)}return isNewCache}; CT_slicer.prototype.initPostOpen=function(tableIds,sheetIds){if(this.cacheDefinition){this.cacheDefinition.initAfterSerialize(this.ws.workbook);var tableCache=this.cacheDefinition.tableSlicerCache;if(tableCache){var _obj=tableCache.initPostOpen(tableIds,this.cacheDefinition.sourceName);if(_obj)this.cacheDefinition._type=insertSlicerType.table}var tabular=this.cacheDefinition.getTabular();if(tabular)this.cacheDefinition._type=insertSlicerType.pivotTable;for(var i=0;i<this.cacheDefinition.pivotTables.length;++i)this.cacheDefinition.pivotTables[i].initPostOpen(sheetIds)}}; CT_slicer.prototype.getIndexSheetCache=function(){if(this.cacheDefinition)return this.cacheDefinition.getIndexSheetCache();return null};CT_slicer.prototype.initPostOpenZip=function(pivotCaches){if(this.cacheDefinition)this.cacheDefinition.initAfterSerialize(this.ws.workbook,pivotCaches)};CT_slicer.prototype.initInterfaceOptions=function(){this._ascSourceName=this.getSourceName();this._ascNameInFormulas=this.getNameInFormulas();this._ascSortOrder=this.getSortOrder();this._ascCustomListSort=this.getCustomListSort(); this._ascHideItemsWithNoData=this.getHideItemsWithNoData();this._ascIndicateItemsWithNoData=this.getIndicateItemsWithNoData();this._ascShowItemsWithNoDataLast=this.getShowItemsWithNoDataLast()};CT_slicer.prototype.Write_ToBinary2=function(w){this._writeBinaryForHistory=true;var old=new AscCommon.CMemory(true);pptx_content_writer.BinaryFileWriter.ExportToMemory(old);pptx_content_writer.BinaryFileWriter.ImportFromMemory(w);pptx_content_writer.BinaryFileWriter.WriteRecord4(0,this);pptx_content_writer.BinaryFileWriter.ExportToMemory(w); pptx_content_writer.BinaryFileWriter.ImportFromMemory(old);this._writeBinaryForHistory=false};CT_slicer.prototype.Read_FromBinary2=function(r){var fileStream=r.ToFileStream();fileStream.GetUChar();this.fromStream(fileStream,null,true);r.FromFileStream(fileStream)};CT_slicer.prototype.toStream=function(s){var historySerialize=this._writeBinaryForHistory;s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.name);s._WriteString2(1,this.uid);if(this.cacheDefinition&&!historySerialize)s._WriteString2(2, this.cacheDefinition.name);s._WriteString2(3,this.caption);s._WriteUInt2(4,this.startItem);s._WriteUInt2(5,this.columnCount);s._WriteBool2(6,this.showCaption);s._WriteUInt2(7,this.level);s._WriteString2(8,this.style);s._WriteBool2(9,this.lockedPosition);s._WriteUInt2(10,this.rowHeight);s.WriteUChar(AscCommon.g_nodeAttributeEnd);if(null!=this.cacheDefinition&&historySerialize){s.StartRecord(0);this.cacheDefinition.toStream(s,null,null,true);s.EndRecord()}};CT_slicer.prototype.fromStream=function(s, slicerCaches,historySerialize){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.name=s.GetString2();break}case 1:{this.uid=s.GetString2();break}case 2:{var cache=s.GetString2();this.cacheDefinition=slicerCaches[cache]||null;break}case 3:{this.caption=s.GetString2();if(typeof this.caption==="string")if(AscFonts.IsCheckSymbols)AscFonts.FontPickerByCharacter.getFontsByString(this.caption); break}case 4:{this.startItem=s.GetULong();break}case 5:{this.columnCount=s.GetULong();break}case 6:{this.showCaption=s.GetBool();break}case 7:{this.level=s.GetULong();break}case 8:{this.style=s.GetString2();break}case 9:{this.lockedPosition=s.GetBool();break}case 10:{this.rowHeight=s.GetULong();break}default:s.Seek2(_end_pos);return}}while(true){if(s.cur>=_end_pos)break;_at=s.GetUChar();switch(_at){case 0:{this.cacheDefinition=new CT_slicerCacheDefinition;this.cacheDefinition.fromStream(s,historySerialize); break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CT_slicer.prototype.isExt=function(){return!!this.getTableSlicerCache()};CT_slicer.prototype.setName=function(val){var oldVal=this.name;this.name=val;History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetName,this.ws.getId(),null,new AscCommonExcel.UndoRedoData_Slicer(null,oldVal,val));this.ws.workbook.onSlicerChangeName(oldVal,val)};CT_slicer.prototype.setCaption=function(val){var oldVal=this.caption;this.caption=val;if(typeof this.caption=== "string")if(AscFonts.IsCheckSymbols)AscFonts.FontPickerByCharacter.getFontsByString(this.caption);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCaption,this.ws.getId(),null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val))};CT_slicer.prototype.getSlicerCache=function(){return this.cacheDefinition};CT_slicer.prototype.getTableSlicerCache=function(){return this.cacheDefinition&&this.cacheDefinition.getTableSlicerCache()};CT_slicer.prototype.getTabular=function(){return this.cacheDefinition&& this.cacheDefinition.getTabular()};CT_slicer.prototype.getCacheDefinition=function(){return this.cacheDefinition};CT_slicer.prototype.generateName=function(name){var wb=this.ws.workbook;var mapNames=[];var isContainName=false;for(var i=0;i<wb.aWorksheets.length;i++){if(!wb.aWorksheets[i].aSlicers)continue;for(var j=0;j<wb.aWorksheets[i].aSlicers.length;j++){if(name===wb.aWorksheets[i].aSlicers[j].name)isContainName=true;mapNames[wb.aWorksheets[i].aSlicers[j].name]=1}}if(isContainName){var baseName= name+" ";var counter=1;while(mapNames[baseName+counter])counter++;name=baseName+counter}return name};CT_slicer.prototype.setTableColName=function(oldVal,newVal){History.Create_NewPoint();History.StartTransaction();if(this.caption===oldVal)this.setCaption(newVal);this.setSourceName(newVal);this.setTableCacheColName(newVal);History.EndTransaction()};CT_slicer.prototype.setSourceName=function(val){if(this.cacheDefinition){var oldVal=this.cacheDefinition.sourceName;this.cacheDefinition.setSourceName(val); History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheSourceName,this.ws.getId(),null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val))}};CT_slicer.prototype.setTableCacheColName=function(val){if(!this.cacheDefinition)return;var _tableCache=this.cacheDefinition.getTableSlicerCache();if(_tableCache){var oldVal=_tableCache.column;_tableCache.setColName(val);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetTableColName,this.ws.getId(),null, new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val))}};CT_slicer.prototype.setTableName=function(val){if(!this.cacheDefinition)return;var _tableCache=this.cacheDefinition.getTableSlicerCache();if(_tableCache){var oldVal=_tableCache.tableId;_tableCache.setTableName(val);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetTableName,this.ws.getId(),null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val))}};CT_slicer.prototype.setCacheName=function(val){if(!this.cacheDefinition)return; var oldVal=this.cacheDefinition.name;this.cacheDefinition.setName(val);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheName,this.ws.getId(),null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val))};CT_slicer.prototype.set=function(val,opt_moveSheet){if(!opt_moveSheet&&this.name!==val.name&&val.name!==undefined)this.setName(val.name);this.caption=this.checkProperty(this.caption,val.caption,AscCH.historyitem_Slicer_SetCaption);this.startItem=this.checkProperty(this.startItem, val.startItem,AscCH.historyitem_Slicer_SetStartItem);this.columnCount=this.checkProperty(this.columnCount,val.columnCount,AscCH.historyitem_Slicer_SetColumnCount);this.showCaption=this.checkProperty(this.showCaption,val.showCaption,AscCH.historyitem_Slicer_SetShowCaption);this.level=this.checkProperty(this.level,val.level,AscCH.historyitem_Slicer_SetLevel);this.style=this.checkProperty(this.style,val.style,AscCH.historyitem_Slicer_SetStyle);this.lockedPosition=this.checkProperty(this.lockedPosition, val.lockedPosition,AscCH.historyitem_Slicer_SetLockedPosition);this.rowHeight=this.checkProperty(this.rowHeight,val.rowHeight,AscCH.historyitem_Slicer_SetRowHeight);var isChangedSortOrder=false;if(val._ascSortOrder!==undefined)isChangedSortOrder=this.setSortOrder(val._ascSortOrder);if(val._ascCustomListSort!==undefined)this.setCustomListSort(val._ascCustomListSort);var isChangedHideItemsWithNoData=false;if(val._ascHideItemsWithNoData!==undefined)isChangedHideItemsWithNoData=this.setHideItemsWithNoData(val._ascHideItemsWithNoData); var isChangedCrossFilter=false;var crossFilter=this._ascGenerateCrossFilter(val._ascHideItemsWithNoData,val._ascIndicateItemsWithNoData,val._ascShowItemsWithNoDataLast);if(crossFilter!==undefined)isChangedCrossFilter=this.setCrossFilter(crossFilter);if(isChangedSortOrder||isChangedHideItemsWithNoData||isChangedCrossFilter)this.updateItemsWithNoData();if(!opt_moveSheet){var slicers=this.ws.getSlicersByCacheName(this.cacheDefinition.name);if(slicers)for(var i=0;i<slicers.length;i++)this.ws.workbook.onSlicerUpdate(slicers[i].name)}}; CT_slicer.prototype.checkProperty=function(propOld,propNew,type){if(propOld!==propNew&&undefined!==propNew){History.Add(AscCommonExcel.g_oUndoRedoSlicer,type,this.ws.getId(),null,new AscCommonExcel.UndoRedoData_Slicer(this.name,propOld,propNew));return propNew}return propOld};CT_slicer.prototype.getSourceName=function(){return this.cacheDefinition.sourceName};CT_slicer.prototype.getNameInFormulas=function(){return this.cacheDefinition.name};CT_slicer.prototype.getSortOrder=function(){var table=this.cacheDefinition.getTableSlicerCache()|| this.cacheDefinition.getTabular();if(table)return table.sortOrder;return ST_tabularSlicerCacheSortOrder.Ascending};CT_slicer.prototype.getCustomListSort=function(){var table=this.cacheDefinition.getTableSlicerCache()||this.cacheDefinition.getTabular();if(table)return table.customListSort;return true};CT_slicer.prototype.getHideItemsWithNoData=function(){return this.cacheDefinition.getHideItemsWithNoData()};CT_slicer.prototype.getIndicateItemsWithNoData=function(){return this.cacheDefinition.getIndicateItemsWithNoData()}; CT_slicer.prototype.getShowItemsWithNoDataLast=function(){return this.cacheDefinition.getShowItemsWithNoDataLast()};CT_slicer.prototype.setSortOrder=function(val){return this.cacheDefinition.setSortOrder(val)};CT_slicer.prototype.setCustomListSort=function(val){this.cacheDefinition.setCustomListSort(val)};CT_slicer.prototype.setHideItemsWithNoData=function(val){return this.cacheDefinition.setHideItemsWithNoData(val)};CT_slicer.prototype.setCrossFilter=function(val){return this.cacheDefinition.setCrossFilter(val)}; CT_slicer.prototype.updateItemsWithNoData=function(){return this.cacheDefinition.updateItemsWithNoData()};CT_slicer.prototype._ascGenerateCrossFilter=function(_ascHideItemsWithNoData,_ascIndicateItemsWithNoData,_ascShowItemsWithNoDataLast){if(_ascHideItemsWithNoData||_ascIndicateItemsWithNoData&&_ascShowItemsWithNoDataLast)return ST_slicerCacheCrossFilter.ShowItemsWithDataAtTop;if(!_ascIndicateItemsWithNoData&&!_ascShowItemsWithNoDataLast)return ST_slicerCacheCrossFilter.None;if(_ascIndicateItemsWithNoData&& !_ascShowItemsWithNoDataLast)return ST_slicerCacheCrossFilter.ShowItemsWithNoData;return ST_slicerCacheCrossFilter.None};CT_slicer.prototype.asc_setName=function(val){this.name=val};CT_slicer.prototype.asc_setCaption=function(val){this.caption=val};CT_slicer.prototype.asc_setStartItem=function(val){this.startItem=val};CT_slicer.prototype.asc_setColumnCount=function(val){this.columnCount=val};CT_slicer.prototype.asc_setShowCaption=function(val){this.showCaption=val};CT_slicer.prototype.asc_setLevel= function(val){this.level=val};CT_slicer.prototype.asc_setStyle=function(val){this.style=val};CT_slicer.prototype.asc_setLockedPosition=function(val){this.lockedPosition=val};CT_slicer.prototype.asc_setRowHeight=function(val){this.rowHeight=val};CT_slicer.prototype.asc_setSortOrder=function(val){this._ascSortOrder=val};CT_slicer.prototype.asc_setHideItemsWithNoData=function(val){this._ascHideItemsWithNoData=val};CT_slicer.prototype.asc_setCustomListSort=function(val){this._ascCustomListSort=val};CT_slicer.prototype.asc_setIndicateItemsWithNoData= function(val){this._ascIndicateItemsWithNoData=val};CT_slicer.prototype.asc_setShowItemsWithNoDataLast=function(val){this._ascShowItemsWithNoDataLast=val};CT_slicer.prototype.asc_setButtonWidth=function(val){this._ascButtonWidth=val};CT_slicer.prototype.asc_getName=function(){return this.name};CT_slicer.prototype.asc_getCaption=function(){return this.caption};CT_slicer.prototype.asc_getStartItem=function(){return this.startItem};CT_slicer.prototype.asc_getColumnCount=function(){return this.columnCount}; CT_slicer.prototype.asc_getShowCaption=function(){return this.showCaption};CT_slicer.prototype.asc_getLevel=function(){return this.level};CT_slicer.prototype.asc_getStyle=function(){var sStyle=this.style;if(sStyle)return sStyle;var wb=Asc.editor.wbModel;if(wb)return wb.SlicerStyles.DefaultStyle;return null};CT_slicer.prototype.asc_getLockedPosition=function(){return this.lockedPosition};CT_slicer.prototype.asc_getRowHeight=function(){return this.rowHeight};CT_slicer.prototype.asc_getSourceName=function(){return this._ascSourceName}; CT_slicer.prototype.asc_getNameInFormulas=function(){return this._ascNameInFormulas};CT_slicer.prototype.asc_getSortOrder=function(){return this._ascSortOrder};CT_slicer.prototype.asc_getCrossFilter=function(){var table=this.cacheDefinition.getTableSlicerCache()||this.cacheDefinition.getTabular();if(table)return table.crossFilter;return ST_slicerCacheCrossFilter.ShowItemsWithDataAtTop};CT_slicer.prototype.asc_getCustomListSort=function(){return this._ascCustomListSort};CT_slicer.prototype.asc_getHideItemsWithNoData= function(){return this._ascHideItemsWithNoData};CT_slicer.prototype.asc_getIndicateItemsWithNoData=function(){return this._ascIndicateItemsWithNoData};CT_slicer.prototype.asc_getShowItemsWithNoDataLast=function(){return this._ascShowItemsWithNoDataLast};CT_slicer.prototype.asc_getButtonWidth=function(){return this._ascButtonWidth};CT_slicer.prototype.asc_getStylesPictures=function(){return Asc.editor.asc_getSlicerPictures()};CT_slicer.prototype.checkModelContent=function(model){return this.cacheDefinition.checkModelContent(model)}; CT_slicer.prototype.getPivotCache=function(){return this.cacheDefinition.getPivotCache()};function CT_slicerCacheDefinition(wb){this.pivotTables=[];this.data=null;this.name=null;this.uid=AscCommon.CreateGUID();this.sourceName=null;this.tableSlicerCache=null;this.slicerCacheHideItemsWithNoData=null;this.wb=wb;this._type=null;return this}CT_slicerCacheDefinition.prototype.isInit=function(){return!!this.wb&&(insertSlicerType.pivotTable!==this.getType()||!!this.getPivotCache())};CT_slicerCacheDefinition.prototype.init= function(name,obj_name,type,pivotTable){switch(type){case insertSlicerType.table:{this.sourceName=name;this.name=this.generateSlicerCacheName(name);this.tableSlicerCache=new CT_tableSlicerCache;this.tableSlicerCache.tableId=obj_name;this.tableSlicerCache.column=name;break}case insertSlicerType.pivotTable:{var cacheDefinition=pivotTable.cacheDefinition;var cacheFields=cacheDefinition.getFields();var fieldIndex=cacheDefinition.getFieldIndexByName(name);var cacheField=-1!==fieldIndex&&cacheFields[fieldIndex]; if(cacheField&&cacheField.sharedItems){this.sourceName=name;this.name=this.generateSlicerCacheName(name);this.data=new CT_slicerCacheData;this.data.tabular=new CT_tabularSlicerCache;pivotTable.checkPivotCacheId();this.setPivotCacheDefinition(cacheDefinition);var table=new CT_slicerCachePivotTable;table.name=pivotTable.asc_getName();table.sheetId=pivotTable.GetWS().getId();this.pivotTables.push(table)}break}}this._type=type};CT_slicerCacheDefinition.prototype.initAfterSerialize=function(wb,pivotCachesOpen){this.wb= wb;var tabular=this.getTabular();if(tabular)tabular.initAfterSerialize(this.wb,pivotCachesOpen);var olap=this.getOlap();if(olap)olap.initAfterSerialize(this.wb,pivotCachesOpen)};CT_slicerCacheDefinition.prototype.setPivotCacheDefinition=function(pivotCacheDefinition){var tabular=this.getTabular();if(tabular)tabular.setPivotCacheDefinition(pivotCacheDefinition);var olap=this.getOlap();if(olap)olap.setPivotCacheDefinition(pivotCacheDefinition)};CT_slicerCacheDefinition.prototype.moveToWb=function(wb){this.initAfterSerialize(wb); var realPivotTables=wb.getPivotTablesByCacheId(this.getPivotCacheId());var oldPivotTables=this.pivotTables;this.pivotTables=[];for(var i=0;i<oldPivotTables.length;++i)for(var j=0;j<realPivotTables.length;++j)if(oldPivotTables[i].name===realPivotTables[j].name)this.addPivotTable(realPivotTables[j]);return!this.getTabular()||-1!==this.getPivotFieldIndex()};CT_slicerCacheDefinition.prototype.addPivotTable=function(pivotTable){var table=new CT_slicerCachePivotTable;table.name=pivotTable.asc_getName(); table.sheetId=pivotTable.GetWS().getId();this.pivotTables.push(table)};CT_slicerCacheDefinition.prototype.clone=function(wb){var res=new CT_slicerCacheDefinition(wb);var i;for(i=0;i<this.pivotTables.length;i++)res.pivotTables[i]=this.pivotTables[i].clone();res.data=this.data?this.data.clone():null;res.name=this.name;res.uid=AscCommon.CreateGUID();res.sourceName=this.sourceName;res.tableSlicerCache=this.tableSlicerCache?this.tableSlicerCache.clone():null;if(this.slicerCacheHideItemsWithNoData)if(this.slicerCacheHideItemsWithNoData.length=== 0)res.slicerCacheHideItemsWithNoData=this.slicerCacheHideItemsWithNoData;else for(i=0;i<this.slicerCacheHideItemsWithNoData.length;i++){if(!res.slicerCacheHideItemsWithNoData)res.slicerCacheHideItemsWithNoData=[];res.slicerCacheHideItemsWithNoData[i]=this.slicerCacheHideItemsWithNoData[i]}return res};CT_slicerCacheDefinition.prototype.copyFrom=function(slicerCacheDefinition){this.pivotTables=slicerCacheDefinition.pivotTables;this.data=slicerCacheDefinition.data;this.name=slicerCacheDefinition.name; this.uid=slicerCacheDefinition.uid;this.sourceName=slicerCacheDefinition.sourceName;this.tableSlicerCache=slicerCacheDefinition.tableSlicerCache;this.slicerCacheHideItemsWithNoData=slicerCacheDefinition.slicerCacheHideItemsWithNoData};CT_slicerCacheDefinition.prototype.generateSlicerCacheName=function(name){var wb=this.wb;var checkAlreadyAdd=function(_name){var _res=false;if(wb.getSlicerCacheByCacheName(_name))_res=true;else if(wb.getDefinesNames(_name))_res=true;return _res};name=name.replace(/[-+*\/^&%<=>: ;//),]/g, "_");if(!AscCommon.rx_defName.test(name))name=name.replace(/[^a-zA-Z\u0410-\u042f\u0430-\u044f\u0401\u04510-9]/gi,"_");var index=1;name="Slicer_"+name;var newName=name;while(checkAlreadyAdd(newName)){newName=name+index;index++}return newName};CT_slicerCacheDefinition.prototype.Write_ToBinary2=function(w){var old=new AscCommon.CMemory(true);pptx_content_writer.BinaryFileWriter.ExportToMemory(old);pptx_content_writer.BinaryFileWriter.ImportFromMemory(w);pptx_content_writer.BinaryFileWriter.StartRecord(0); this.toStream(pptx_content_writer.BinaryFileWriter,null,null,true);pptx_content_writer.BinaryFileWriter.EndRecord();pptx_content_writer.BinaryFileWriter.ExportToMemory(w);pptx_content_writer.BinaryFileWriter.ImportFromMemory(old)};CT_slicerCacheDefinition.prototype.Read_FromBinary2=function(r){var fileStream=r.ToFileStream();fileStream.GetUChar();this.fromStream(fileStream,true,null);r.FromFileStream(fileStream)};CT_slicerCacheDefinition.prototype.toStream=function(s,tableIds,sheetIds,historySerialize){s.WriteUChar(AscCommon.g_nodeAttributeStart); s._WriteString2(0,this.name);s._WriteString2(1,this.uid);s._WriteString2(2,this.sourceName);s.WriteUChar(AscCommon.g_nodeAttributeEnd);if(this.pivotTables.length>0){s.StartRecord(0);s.WriteULong(this.pivotTables.length);for(var i=0;i<this.pivotTables.length;i++){s.StartRecord(0);this.pivotTables[i].toStream(s,sheetIds,historySerialize);s.EndRecord()}s.EndRecord()}s.WriteRecord4(1,this.data);if(null!=this.tableSlicerCache){s.StartRecord(3);this.tableSlicerCache.toStream(s,tableIds,historySerialize); s.EndRecord()}if(null!=this.slicerCacheHideItemsWithNoData){var hideNoData=new CT_slicerCacheHideNoData;hideNoData.slicerCacheOlapLevelName=this.slicerCacheHideItemsWithNoData;hideNoData.count=this.slicerCacheHideItemsWithNoData.length;s.WriteRecord4(4,hideNoData)}};CT_slicerCacheDefinition.prototype.fromStream=function(s,historySerialize){var _type;var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break; switch(_at){case 0:{this.name=s.GetString2();break}case 1:{this.uid=s.GetString2();break}case 2:{this.sourceName=s.GetString2();break}default:s.Seek2(_end_pos);return}}while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:case 2:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_slicerCachePivotTable;tmp.fromStream(s,historySerialize);this.pivotTables.push(tmp)}break}case 1:{this.data=new CT_slicerCacheData;this.data.fromStream(s);break}case 3:{this.tableSlicerCache= new CT_tableSlicerCache;this.tableSlicerCache.fromStream(s,historySerialize);break}case 4:{var hideNoData=new CT_slicerCacheHideNoData;hideNoData.fromStream(s);this.slicerCacheHideItemsWithNoData=hideNoData.slicerCacheOlapLevelName;break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CT_slicerCacheDefinition.prototype.getIndexSheetCache=function(){var res=null;var type=this.getType();var wb=this.wb;switch(type){case insertSlicerType.table:{var tableCache=this.tableSlicerCache;var tableObj=wb.getTableByName(tableCache.tableId, true);res=tableObj?tableObj.index:null;break}case insertSlicerType.pivotTable:{res=0;break}}return res};CT_slicerCacheDefinition.prototype.getFilterValues=function(){var res=null;var type=this.getType();var wb=this.wb;switch(type){case insertSlicerType.table:{var tableCache=this.tableSlicerCache;var tableObj=wb.getTableByName(tableCache.tableId,true);var table=tableObj?tableObj.table:null;if(table){var ws=wb.aWorksheets[tableObj.index];var colId=table.getColIdByName(tableCache.column);if(colId!== null){var sortObj={};sortObj.fullValues=true;sortObj.sortOrder=this.tableSlicerCache.sortOrder===ST_tabularSlicerCacheSortOrder.Ascending;sortObj.hideItemsWithNoData=this.getHideItemsWithNoData();sortObj.indicateItemsWithNoData=this.getIndicateItemsWithNoData();sortObj.showItemsWithNoDataLast=this.getShowItemsWithNoDataLast();res=ws.autoFilters.getOpenAndClosedValues(table,colId,null,sortObj)}}break}case insertSlicerType.pivotTable:{var tabular=this.data.tabular;var cacheDefinition=tabular.pivotCacheDefinition; if(cacheDefinition){var fieldIndex=cacheDefinition.getFieldIndexByName(this.sourceName);if(-1!==fieldIndex){var cacheField=cacheDefinition.getFields()[fieldIndex];res={values:tabular.getFilterObject(cacheField,this.slicerCacheHideItemsWithNoData),automaticRowCount:null,ignoreCustomFilter:null}}}break}}return res};CT_slicerCacheDefinition.prototype.getFilterObj=function(){var res=null;var type=this.getType();var wb=this.wb;switch(type){case insertSlicerType.table:{var tableCache=this.tableSlicerCache; var table=wb.getTableByName(tableCache.tableId);if(table){var colId=table.getColIdByName(tableCache.column);res={obj:table,colId:colId}}break}case insertSlicerType.pivotTable:{res=this;break}}return res};CT_slicerCacheDefinition.prototype.getLinkedPivotSlicers=function(){var res={};var wb=this.wb;var pivotTables=this.getPivotTables();pivotTables.forEach(function(pivotTable){var slicerCaches=wb.getSlicerCachesByPivotTable(pivotTable.GetWS().getId(),pivotTable.asc_getName());slicerCaches.forEach(function(slicerCache){var slicers= wb.getSlicersByCacheName(slicerCache.name);slicers.forEach(function(slicer){res[slicer.name]=slicer})})});return res};CT_slicerCacheDefinition.prototype.applyPivotFilterWithLock=function(api,values,slicerName,excludePivot,confirmation){var t=this;var fld=this.getPivotFieldIndex();var pivotTables=this.getPivotTables();if(-1!==fld&&pivotTables.length>0)api._isLockedPivotAndConnectedBySlicer(pivotTables[0],[fld],function(res){if(!res){api.wbModel.onSlicerUpdate(slicerName);return}History.Create_NewPoint(); History.StartTransaction();api.wbModel.dependencyFormulas.lockRecal();var changeRes=t.applyPivotFilter(api,values,excludePivot,confirmation);api.wbModel.dependencyFormulas.unlockRecal();History.EndTransaction();api._changePivotEndCheckError(pivotTables[0],changeRes,function(){t.applyPivotFilterWithLock(api,values,slicerName,excludePivot,true)})});else api.wbModel.onSlicerUpdate(slicerName)};CT_slicerCacheDefinition.prototype.applyPivotFilter=function(api,values,excludePivot,confirmation){var changeRes= {error:c_oAscError.ID.No,warning:c_oAscError.ID.No};var fld=this.getPivotFieldIndex();if(-1===fld)return;var pivotTables=this.getPivotTables();if(pivotTables.length===0)return;var wb=this.wb;for(var i=0;i<pivotTables.length;++i){var pivotTable=pivotTables[i];if(pivotTable===excludePivot)continue;var autoFilterObject=new Asc.AutoFiltersOptions;pivotTable.fillAutoFiltersOptions(autoFilterObject,fld);autoFilterObject.setVisibleFromValues(values);autoFilterObject.filter.type=Asc.c_oAscAutoFilterTypes.Filters; changeRes=api._changePivot(pivotTable,confirmation,false,function(ws){pivotTable.filterPivotItems(fld,autoFilterObject)});if(c_oAscError.ID.No!==changeRes.error||c_oAscError.ID.No!==changeRes.warning)return changeRes;if(changeRes.updateRes)pivotTable.syncSlicersWithPivot(changeRes.updateRes.cacheFieldsWithData)}var oldVal=new AscCommonExcel.UndoRedoData_BinaryWrapper2(this);this.data.tabular.fromAutoFiltersOptionsElements(values);var newVal=new AscCommonExcel.UndoRedoData_BinaryWrapper2(this);History.Add(AscCommonExcel.g_oUndoRedoSlicer, AscCH.historyitem_Slicer_SetCacheData,null,null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,newVal));var slicers=this.getLinkedPivotSlicers();for(var name in slicers)if(slicers.hasOwnProperty(name))wb.onSlicerUpdate(name);return changeRes};CT_slicerCacheDefinition.prototype.getSourceName=function(){return this.sourceName};CT_slicerCacheDefinition.prototype.setSourceName=function(val){this.sourceName=val};CT_slicerCacheDefinition.prototype.getTableSlicerCache=function(){return this.tableSlicerCache}; CT_slicerCacheDefinition.prototype.getTabular=function(){return this.data&&this.data.tabular};CT_slicerCacheDefinition.prototype.getOlap=function(){return this.data&&this.data.olap};CT_slicerCacheDefinition.prototype.checkObjApply=function(name,obj_name,type,pivotTable){var res=false;var _obj;switch(type){case window["AscCommonExcel"].insertSlicerType.table:{_obj=this.getTableSlicerCache();if(_obj&&_obj.tableId===obj_name&&_obj.column===name)res=true;break}case window["AscCommonExcel"].insertSlicerType.pivotTable:{res= this.indexOfPivotTable(pivotTable.GetWS().getId(),pivotTable.asc_getName())>=0;break}}return res};CT_slicerCacheDefinition.prototype.setName=function(val){this.name=val};CT_slicerCacheDefinition.prototype.getType=function(){if(this._type!==null)return this._type;var tableCache=this.getTableSlicerCache();if(tableCache)this._type=insertSlicerType.table;var tabular=this.getTabular();if(tabular)this._type=insertSlicerType.pivotTable;return this._type};CT_slicerCacheDefinition.prototype.getRange=function(){var res= null;var type=this.getType();var wb=this.wb;switch(type){case insertSlicerType.table:{var tableCache=this.tableSlicerCache;var table=wb.getTableByName(tableCache.tableId);if(table){var colId=table.getColIdByName(tableCache.column);res=new Asc.Range(table.Ref.c1+colId,table.Ref.r1,table.Ref.c1+colId,table.Ref.r2)}break}case insertSlicerType.pivotTable:{break}}return res};CT_slicerCacheDefinition.prototype.setSortOrder=function(val){var obj=this.getTableSlicerCache()||this.getTabular();if(obj&&obj.sortOrder!== val){var oldVal=obj.sortOrder;obj.setSortOrder(val);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheSortOrder,null,null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val));return true}return false};CT_slicerCacheDefinition.prototype.setCustomListSort=function(val){var obj=this.getTableSlicerCache()||this.getTabular();if(obj&&obj.customListSort!==val){var oldVal=obj.customListSort;obj.setCustomListSort(val);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheCustomListSort, null,null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val))}};CT_slicerCacheDefinition.prototype.setCrossFilter=function(val){var obj=this.getTableSlicerCache()||this.getTabular();if(obj&&obj.crossFilter!==val){var oldVal=obj.crossFilter;obj.setCrossFilter(val);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheCrossFilter,null,null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val));return true}return false};CT_slicerCacheDefinition.prototype.setHideItemsWithNoData= function(val){var oldVal=this.slicerCacheHideItemsWithNoData;var newVal=val?[]:null;if(oldVal!==newVal){this.slicerCacheHideItemsWithNoData=val?[]:null;History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheHideItemsWithNoData,null,null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,val));return true}return false};CT_slicerCacheDefinition.prototype.updateItemsWithNoData=function(){var tabular=this.getTabular();var pivotTables=this.getPivotTables();if(tabular&&pivotTables.length> 0){var pivotTable=pivotTables[pivotTables.length-1];var calculateRes=pivotTable.calculateDataRow();this.syncWithPivot(pivotTable,calculateRes.cacheFieldsWithData)}};CT_slicerCacheDefinition.prototype.getHideItemsWithNoData=function(){return null!==this.slicerCacheHideItemsWithNoData};CT_slicerCacheDefinition.prototype.getIndicateItemsWithNoData=function(){var hideItemsWithNoData=this.getHideItemsWithNoData();if(hideItemsWithNoData)return true;else{var table=this.getTableSlicerCache()||this.getTabular(); if(table)return table.crossFilter!==ST_slicerCacheCrossFilter.None;return true}};CT_slicerCacheDefinition.prototype.getShowItemsWithNoDataLast=function(){var hideItemsWithNoData=this.getHideItemsWithNoData();if(hideItemsWithNoData)return true;else{var table=this.getTableSlicerCache()||this.getTabular();if(table)return table.crossFilter===ST_slicerCacheCrossFilter.ShowItemsWithDataAtTop;return true}};CT_slicerCacheDefinition.prototype.checkModelContent=function(model){var res=null;var type=this.getType(); var wb=model.workbook;switch(type){case insertSlicerType.table:{var tableCache=this.tableSlicerCache;var table=wb.getTableByName(tableCache.tableId);if(table)if(null!==table.getColIdByName(tableCache.column))res=true;break}case insertSlicerType.pivotTable:{var tabular=this.getTabular();var olap=this.getOlap();if((!tabular||tabular.checkModelContent(wb))&&(!olap||olap.checkModelContent(wb)))res=true;break}}return res};CT_slicerCacheDefinition.prototype.getPivotCache=function(){var tabular=this.getTabular(); return tabular&&tabular.pivotCacheDefinition||null};CT_slicerCacheDefinition.prototype.getPivotCacheId=function(){var tabular=this.getTabular();return tabular&&tabular.pivotCacheDefinition&&tabular.pivotCacheDefinition.getPivotCacheId()||null};CT_slicerCacheDefinition.prototype.getPivotFieldIndex=function(){var tabular=this.getTabular();if(tabular&&tabular.pivotCacheDefinition){var fieldIndex=tabular.pivotCacheDefinition.getFieldIndexByName(this.sourceName);if(-1!==fieldIndex)return fieldIndex}return-1}; CT_slicerCacheDefinition.prototype.getPivotTables=function(){var res=[];var wb=this.wb;this.pivotTables.forEach(function(table){var pivotTable=table.getPivotTable(wb);if(pivotTable)res.push(pivotTable)});return res};CT_slicerCacheDefinition.prototype.indexOfPivotTable=function(sheetId,pivotName){return this.pivotTables.findIndex(function(elem){return elem.sheetId===sheetId&&elem.name===pivotName})};CT_slicerCacheDefinition.prototype.deletePivotTable=function(sheetId,pivotName){var oldVal=new AscCommonExcel.UndoRedoData_BinaryWrapper2(this); var index=this.indexOfPivotTable(sheetId,pivotName);if(index>=0)this.pivotTables.splice(index,1);var newVal=new AscCommonExcel.UndoRedoData_BinaryWrapper2(this);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheData,null,null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,newVal))};CT_slicerCacheDefinition.prototype.getPivotTablesCount=function(){return this.pivotTables.length};CT_slicerCacheDefinition.prototype.syncWithPivot=function(pivotTable,cacheFieldsWithData){var tabular= this.getTabular();if(!tabular)return;var cacheFields=pivotTable.cacheDefinition.getFields();var fieldIndex=pivotTable.cacheDefinition.getFieldIndexByName(this.sourceName);var cacheField=-1!==fieldIndex&&cacheFields[fieldIndex];if(cacheField&&cacheField.sharedItems){pivotTable.checkPivotFieldItems(fieldIndex);var pivotField=pivotTable.asc_getPivotFields()[fieldIndex];var oldVal=new AscCommonExcel.UndoRedoData_BinaryWrapper2(this);tabular.syncWithCache(cacheField,pivotField,cacheFieldsWithData[fieldIndex]); var newVal=new AscCommonExcel.UndoRedoData_BinaryWrapper2(this);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheData,null,null,new AscCommonExcel.UndoRedoData_Slicer(this.name,oldVal,newVal))}};CT_slicerCacheDefinition.prototype.movePivotTable=function(sheetIdFrom,nameFrom,sheetIdTo,nameTo){this.pivotTables.forEach(function(table){if(table.sheetId===sheetIdFrom&&table.name===nameFrom){table.sheetId=sheetIdTo;table.name=nameTo}});var from=new AscCommonExcel.UndoRedoData_CellData(sheetIdFrom, nameFrom);var to=new AscCommonExcel.UndoRedoData_CellData(sheetIdTo,nameTo);History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheMovePivot,null,null,new AscCommonExcel.UndoRedoData_Slicer(this.name,from,to))};CT_slicerCacheDefinition.prototype.forCopySheet=function(sheetIdFrom,sheetIdTo){this.pivotTables.forEach(function(table){if(table.sheetId===sheetIdFrom)table.sheetId=sheetIdTo});History.Add(AscCommonExcel.g_oUndoRedoSlicer,AscCH.historyitem_Slicer_SetCacheCopySheet,null, null,new AscCommonExcel.UndoRedoData_Slicer(this.name,sheetIdFrom,sheetIdTo))};function CT_slicerCacheData(){this.olap=null;this.tabular=null}CT_slicerCacheData.prototype.clone=function(){var res=new CT_slicerCacheData;if(this.olap)res.olap=this.olap.clone();if(this.tabular)res.tabular=this.tabular.clone();return res};CT_slicerCacheData.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecord4(0,this.olap);s.WriteRecord4(1, this.tabular)};CT_slicerCacheData.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{this.olap=new CT_olapSlicerCache;this.olap.fromStream(s);break}case 1:{this.tabular=new CT_tabularSlicerCache;this.tabular.fromStream(s); break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};function CT_slicerCachePivotTable(){this.sheetId=null;this.tabIdOpen=null;this.name=null}CT_slicerCachePivotTable.prototype.initPostOpen=function(sheetIds){var ws=null;if(null!=this.tabIdOpen){ws=sheetIds[this.tabIdOpen];if(ws)this.sheetId=ws.getId()}return ws};CT_slicerCachePivotTable.prototype.clone=function(){var res=new CT_slicerCachePivotTable;res.sheetId=this.sheetId;res.tabIdOpen=this.tabIdOpen;res.name=this.name;return res};CT_slicerCachePivotTable.prototype.toStream= function(s,sheetIds,historySerialize){s.WriteUChar(AscCommon.g_nodeAttributeStart);if(historySerialize)s._WriteString2(0,this.sheetId);else s._WriteUInt2(0,sheetIds[this.sheetId]||1);s._WriteString2(1,this.name);s.WriteUChar(AscCommon.g_nodeAttributeEnd)};CT_slicerCachePivotTable.prototype.fromStream=function(s,historySerialize){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{if(historySerialize)this.sheetId= s.GetString2();else this.tabIdOpen=s.GetULong();break}case 1:{this.name=s.GetString2();break}default:s.Seek2(_end_pos);return}}s.Seek2(_end_pos)};CT_slicerCachePivotTable.prototype.getPivotTable=function(wb){var ws=wb.getWorksheetById(this.sheetId);if(ws)return ws.getPivotTableByName(this.name);return null};function CT_olapSlicerCacheItem(){this.p=[];this.n=null;this.c=null;this.nd=false}CT_olapSlicerCacheItem.prototype.clone=function(){var res=new CT_olapSlicerCacheItem;res.n=this.n;res.c=this.c; res.nd=this.nd;return res};CT_olapSlicerCacheItem.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.n);s._WriteString2(1,this.c);s._WriteBool2(2,this.nd);s.WriteUChar(AscCommon.g_nodeAttributeEnd);if(this.p.length>0){var p=this.p.map(function(currentValue){var res=new CT_olapSlicerCacheItemParent;res.n=currentValue;return res});s.WriteRecordArray4(0,0,p)}};CT_olapSlicerCacheItem.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos= s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.n=s.GetString2();break}case 1:{this.c=s.GetString2();break}case 2:{this.nd=s.GetBool();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_olapSlicerCacheItemParent;tmp.fromStream(s);this.p.push(tmp.n)}break}default:{s.SkipRecord(); break}}}s.Seek2(_end_pos)};function CT_olapSlicerCacheRange(){this.i=[];this.startItem=null}CT_olapSlicerCacheRange.prototype.clone=function(){var res=new CT_olapSlicerCacheRange;for(var i=0;i<this.i.length;i++)res.i[i]=this.i[i].clone();return res};CT_olapSlicerCacheRange.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.startItem);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.i)};CT_olapSlicerCacheRange.prototype.fromStream= function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.startItem=s.GetULong();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_olapSlicerCacheItem;tmp.fromStream(s);this.i.push(tmp)}break}default:{s.SkipRecord(); break}}}s.Seek2(_end_pos)};function CT_olapSlicerCacheLevelData(){this.ranges=[];this.uniqueName=null;this.sourceCaption=null;this.count=null;this.sortOrder=ST_olapSlicerCacheSortOrder.Natural;this.crossFilter=ST_slicerCacheCrossFilter.ShowItemsWithDataAtTop}CT_olapSlicerCacheLevelData.prototype.clone=function(){var res=new CT_olapSlicerCacheLevelData;for(var i=0;i<this.ranges.length;i++)res.ranges[i]=this.ranges[i].clone();res.uniqueName=this.uniqueName;res.sourceCaption=this.sourceCaption;res.count= this.count;res.sortOrder=this.sortOrder;res.crossFilter=this.crossFilter;return res};CT_olapSlicerCacheLevelData.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.uniqueName);s._WriteString2(1,this.sourceCaption);s._WriteUInt2(2,this.count);s._WriteUChar2(3,this.sortOrder);s._WriteUChar2(4,this.crossFilter);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.ranges)};CT_olapSlicerCacheLevelData.prototype.fromStream=function(s){var _len= s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.uniqueName=s.GetString2();break}case 1:{this.sourceCaption=s.GetString2();break}case 2:{this.count=s.GetULong();break}case 3:{this.sortOrder=s.GetUChar();break}case 4:{this.crossFilter=s.GetUChar();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4); var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_olapSlicerCacheRange;tmp.fromStream(s);this.ranges.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};function CT_olapSlicerCache(){this.levels=[];this.selections=[];this.pivotCacheId=null;this.pivotCacheDefinition=null}CT_olapSlicerCache.prototype.initAfterSerialize=function(wb,pivotCachesOpen){if(null!==this.pivotCacheId){this.pivotCacheDefinition=wb.getPivotCacheById(this.pivotCacheId,pivotCachesOpen);this.pivotCacheId= null}};CT_olapSlicerCache.prototype.setPivotCacheDefinition=function(pivotCacheDefinition){this.pivotCacheDefinition=pivotCacheDefinition;this.pivotCacheId=null};CT_olapSlicerCache.prototype.checkModelContent=function(wb){return null!==this.pivotCacheId&&!!wb.getPivotCacheById(this.pivotCacheId)};CT_olapSlicerCache.prototype.clone=function(){var res=new CT_olapSlicerCache;var i;for(i=0;i<this.levels.length;i++)res.levels[i]=this.levels[i].clone();for(i=0;i<this.selections.length;i++)res.selections[i]= this.selections[i].clone();res.pivotCacheId=this.pivotCacheId;res.pivotCacheDefinition=this.pivotCacheDefinition;return res};CT_olapSlicerCache.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.getPivotCacheId());s.WriteUChar(AscCommon.g_nodeAttributeEnd);if(this.levels.length>0){var levelsData=new CT_olapSlicerCacheLevelsData;levelsData.level=this.levels;levelsData.count=this.levels.length;s.WriteRecord4(0,levelsData)}if(this.selections.length>0){var selections= new CT_olapSlicerCacheSelections;selections.selection=this.selections;selections.count=this.selections.length;s.WriteRecord4(1,selections)}};CT_olapSlicerCache.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.pivotCacheId=s.GetULong();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type= s.GetUChar();switch(_type){case 0:{var levelsData=new CT_olapSlicerCacheLevelsData;levelsData.fromStream(s);this.levels=levelsData.level;break}case 1:{var selections=new CT_olapSlicerCacheSelections;selections.fromStream(s);this.selections=selections.selection;break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CT_olapSlicerCache.prototype.getPivotCacheId=function(){return this.pivotCacheDefinition&&this.pivotCacheDefinition.getPivotCacheId()||0};function CT_olapSlicerCacheLevelsData(){this.count= null;this.level=[];return this}CT_olapSlicerCacheLevelsData.prototype.clone=function(){var res=new CT_olapSlicerCacheLevelsData;res.count=this.count;for(var i=0;i<this.level.length;i++)res.level[i]=this.level[i].clone();return res};CT_olapSlicerCacheLevelsData.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.count);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.level)};CT_olapSlicerCacheLevelsData.prototype.fromStream=function(s){var _len= s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.count=s.GetULong();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_olapSlicerCacheLevelData;tmp.fromStream(s);this.level.push(tmp)}break}default:{s.SkipRecord(); break}}}s.Seek2(_end_pos)};function CT_olapSlicerCacheSelections(){this.count=null;this.selection=[];return this}CT_olapSlicerCacheSelections.prototype.clone=function(){var res=new CT_olapSlicerCacheSelections;res.count=this.count;for(var i=0;i<this.selection.length;i++)res.selection[i]=this.selection[i].clone();return res};CT_olapSlicerCacheSelections.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.count);s.WriteUChar(AscCommon.g_nodeAttributeEnd); s.WriteRecordArray4(0,0,this.selection)};CT_olapSlicerCacheSelections.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.count=s.GetULong();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1); var tmp=new CT_olapSlicerCacheSelection;tmp.fromStream(s);this.selection.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};function CT_olapSlicerCacheSelection(){this.p=[];this.n=null}CT_olapSlicerCacheSelections.prototype.clone=function(){var res=new CT_olapSlicerCacheSelection;for(var i=0;i<this.p.length;i++)res.p[i]=this.p[i].clone();res.n=this.n;return res};CT_olapSlicerCacheSelection.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0, this.n);s.WriteUChar(AscCommon.g_nodeAttributeEnd);if(this.p.length>0){var p=this.p.map(function(currentValue){var res=new CT_olapSlicerCacheItemParent;res.n=currentValue;return res});s.WriteRecordArray4(0,0,p)}};CT_olapSlicerCacheSelection.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.n=s.GetString2();break}default:s.Seek2(_end_pos); return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_olapSlicerCacheItemParent;tmp.fromStream(s);this.p.push(tmp.n)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};function CT_olapSlicerCacheItemParent(){this.n=null;return this}CT_olapSlicerCacheItemParent.prototype.clone=function(){var res=new CT_olapSlicerCacheItemParent;res.n=this.n;return res};CT_olapSlicerCacheItemParent.prototype.toStream= function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.n);s.WriteUChar(AscCommon.g_nodeAttributeEnd)};CT_olapSlicerCacheItemParent.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.n=s.GetString2();break}default:s.Seek2(_end_pos);return}}s.Seek2(_end_pos)};function CT_tableSlicerCache(){this.tableId=null; this.tableIdOpen=null;this.column=null;this.columnOpen=null;this.sortOrder=ST_tabularSlicerCacheSortOrder.Ascending;this.customListSort=true;this.crossFilter=ST_slicerCacheCrossFilter.ShowItemsWithDataAtTop;return this}CT_tableSlicerCache.prototype.clone=function(){var res=new CT_tableSlicerCache;res.tableId=this.tableId;res.tableIdOpen=this.tableIdOpen;res.column=this.column;res.columnOpen=this.columnOpen;res.sortOrder=this.sortOrder;res.customListSort=this.customListSort;res.crossFilter=this.crossFilter; return res};CT_tableSlicerCache.prototype.initPostOpen=function(tableIds,sourceName){var table=null;if(null!=this.tableIdOpen&&null!=this.columnOpen){table=tableIds[this.tableIdOpen];if(table){this.tableId=table.DisplayName;if(sourceName&&null!==table.getIndexByColumnName(sourceName))this.column=sourceName;else this.column=table.getTableNameColumnByIndex(this.columnOpen-1)}}return table};CT_tableSlicerCache.prototype.toStream=function(s,tableIds,historySerialize){var tableIdOpen=null;var columnOpen= null;var elem=!historySerialize&&tableIds&&tableIds[this.tableId];if(elem){tableIdOpen=elem.id;columnOpen=elem.table.getTableIndexColumnByName(this.column)+1||null}else if(historySerialize){tableIdOpen=this.tableId;columnOpen=this.column}s.WriteUChar(AscCommon.g_nodeAttributeStart);if(historySerialize){s._WriteString2(0,tableIdOpen);s._WriteString2(1,columnOpen)}else{s._WriteUInt2(0,tableIdOpen);s._WriteUInt2(1,columnOpen)}s._WriteUChar2(2,this.sortOrder);s._WriteBool2(3,this.customListSort);s._WriteUChar2(4, this.crossFilter);s.WriteUChar(AscCommon.g_nodeAttributeEnd)};CT_tableSlicerCache.prototype.fromStream=function(s,historySerialize){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{if(historySerialize)this.tableId=s.GetString2();else this.tableIdOpen=s.GetULong();break}case 1:{if(historySerialize)this.column=s.GetString2();else this.columnOpen=s.GetULong();break}case 2:{this.sortOrder= s.GetUChar();break}case 3:{this.customListSort=s.GetBool();break}case 4:{this.crossFilter=s.GetUChar();break}default:s.Seek2(_end_pos);return}}s.Seek2(_end_pos)};CT_tableSlicerCache.prototype.setTableName=function(val){this.tableId=val};CT_tableSlicerCache.prototype.setColName=function(val){this.column=val};CT_tableSlicerCache.prototype.setSortOrder=function(val){this.sortOrder=val};CT_tableSlicerCache.prototype.setCustomListSort=function(val){this.customListSort=val};CT_tableSlicerCache.prototype.setCrossFilter= function(val){this.crossFilter=val};function CT_tabularSlicerCache(){this.items=[];this.pivotCacheId=null;this.pivotCacheDefinition=null;this.sortOrder=ST_tabularSlicerCacheSortOrder.Ascending;this.customListSort=true;this.showMissing=true;this.crossFilter=ST_slicerCacheCrossFilter.ShowItemsWithDataAtTop}CT_tabularSlicerCache.prototype.initAfterSerialize=function(wb,pivotCachesOpen){if(null!==this.pivotCacheId){this.pivotCacheDefinition=wb.getPivotCacheById(this.pivotCacheId,pivotCachesOpen);if(this.pivotCacheDefinition)this.pivotCacheId= null}};CT_tabularSlicerCache.prototype.setPivotCacheDefinition=function(pivotCacheDefinition){this.pivotCacheDefinition=pivotCacheDefinition;this.pivotCacheId=null};CT_tabularSlicerCache.prototype.checkModelContent=function(wb){return null!==this.pivotCacheId&&!!wb.getPivotCacheById(this.pivotCacheId)};CT_tabularSlicerCache.prototype.clone=function(){var res=new CT_tabularSlicerCache;for(var i=0;i<this.items.length;i++)res.items[i]=this.items[i].clone();res.pivotCacheId=this.pivotCacheId;res.pivotCacheDefinition= this.pivotCacheDefinition;res.sortOrder=this.sortOrder;res.customListSort=this.customListSort;res.showMissing=this.showMissing;res.crossFilter=this.crossFilter;return res};CT_tabularSlicerCache.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.getPivotCacheId());s._WriteUChar2(1,this.sortOrder);s._WriteBool2(2,this.customListSort);s._WriteBool2(3,this.showMissing);s._WriteUChar2(4,this.crossFilter);s.WriteUChar(AscCommon.g_nodeAttributeEnd);if(this.items.length> 0){var items=new CT_tabularSlicerCacheItems;items.i=this.items;items.count=this.items.length;s.WriteRecord4(0,items)}};CT_tabularSlicerCache.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.pivotCacheId=s.GetULong();break}case 1:{this.sortOrder=s.GetUChar();break}case 2:{this.customListSort=s.GetBool();break}case 3:{this.showMissing= s.GetBool();break}case 4:{this.crossFilter=s.GetUChar();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{var items=new CT_tabularSlicerCacheItems;items.fromStream(s);this.items=items.i;break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CT_tabularSlicerCache.prototype.syncWithCache=function(cacheField,pivotField,cacheFieldWithData){var pivotItems=pivotField.getItems();var count=Math.min(cacheField.getSharedSize(), pivotItems.length);if(cacheFieldWithData)count=Math.min(count,cacheFieldWithData.length);this.items=[];for(var i=0;i<count;++i){var pivotItem=pivotItems[i];if(Asc.c_oAscItemType.Data===pivotItem.t||Asc.c_oAscItemType.Blank===pivotItem.t){var item=new CT_tabularSlicerCacheItem;item.x=pivotItem.x;item.s=!pivotItem.h;if(this.crossFilter!==ST_slicerCacheCrossFilter.None)item.nd=!(!cacheFieldWithData||cacheFieldWithData[item.x]);this.items.push(item)}}this.sortItems(this.sortOrder,cacheField.sharedItems)}; CT_tabularSlicerCache.prototype.sortItems=function(type,sharedItems){var sign=ST_tabularSlicerCacheSortOrder.Ascending===type?1:-1;if(this.crossFilter===ST_slicerCacheCrossFilter.ShowItemsWithDataAtTop)this.items.sort(function(a,b){if(a.nd===b.nd)return sign*AscCommonExcel.cmpPivotItems(sharedItems,a,b);else return a.nd-b.nd});else this.items.sort(function(a,b){return sign*AscCommonExcel.cmpPivotItems(sharedItems,a,b)})};CT_tabularSlicerCache.prototype.getFilterObject=function(cacheField,slicerCacheHideItemsWithNoData){var values= [];for(var i=0;i<this.items.length;++i){var item=this.items[i];var elem=AscCommonExcel.AutoFiltersOptionsElements();var sharedItem=cacheField.getSharedItem(item.x);var num=sharedItem.isDateOrNum()&&cacheField.getNumFormat();var cellValue=sharedItem.getCellValue();elem.val=elem.text=cellValue.getTextValue(num);elem.visible=item.s;elem.hiddenByOtherColumns=item.nd||undefined;elem.isDateFormat=false;elem.repeats=undefined;if(!slicerCacheHideItemsWithNoData||!elem.hiddenByOtherColumns)values.push(elem)}return values}; CT_tabularSlicerCache.prototype.fromAutoFiltersOptionsElements=function(values){for(var i=0;i<this.items.length&&i<values.length;++i)this.items[i].s=values[i].visible};CT_tabularSlicerCache.prototype.setSortOrder=function(val){this.sortOrder=val};CT_tabularSlicerCache.prototype.setCustomListSort=function(val){this.customListSort=val};CT_tabularSlicerCache.prototype.setCrossFilter=function(val){this.crossFilter=val};CT_tabularSlicerCache.prototype.getPivotCacheId=function(){return this.pivotCacheDefinition&& this.pivotCacheDefinition.getPivotCacheId()||0};function CT_slicerCacheOlapLevelName(){this.uniqueName=null;this.count=null;return this}CT_slicerCacheOlapLevelName.prototype.clone=function(){var res=new CT_slicerCacheOlapLevelName;res.uniqueName=this.uniqueName;res.count=this.count;return res};CT_slicerCacheOlapLevelName.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.uniqueName);s._WriteUInt2(1,this.count);s.WriteUChar(AscCommon.g_nodeAttributeEnd)}; CT_slicerCacheOlapLevelName.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.uniqueName=s.GetString2();break}case 1:{this.count=s.GetULong();break}default:s.Seek2(_end_pos);return}}s.Seek2(_end_pos)};function CT_slicerCacheHideNoData(){this.count=0;this.slicerCacheOlapLevelName=[];return this}CT_slicerCacheHideNoData.prototype.clone= function(){var res=new CT_slicerCacheHideNoData;res.count=this.count;for(var i=0;i<this.slicerCacheOlapLevelName.length;i++)res.slicerCacheOlapLevelName[i]=this.slicerCacheOlapLevelName[i].clone();return res};CT_slicerCacheHideNoData.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.count);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.slicerCacheOlapLevelName)};CT_slicerCacheHideNoData.prototype.fromStream=function(s){var _len= s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.count=s.GetULong();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_slicerCacheOlapLevelName;tmp.fromStream(s);this.slicerCacheOlapLevelName.push(tmp)}break}default:{s.SkipRecord(); break}}}s.Seek2(_end_pos)};function CT_tabularSlicerCacheItems(){this.count=null;this.i=[];return this}CT_tabularSlicerCacheItems.prototype.clone=function(){var res=new CT_tabularSlicerCacheItems;res.count=this.count;for(var i=0;i<this.i.length;i++)res.i[i]=this.i[i].clone();return res};CT_tabularSlicerCacheItems.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.count);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.i)};CT_tabularSlicerCacheItems.prototype.fromStream= function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.count=s.GetULong();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_tabularSlicerCacheItem;tmp.fromStream(s);this.i.push(tmp)}break}default:{s.SkipRecord(); break}}}s.Seek2(_end_pos)};function CT_tabularSlicerCacheItem(){this.x=null;this.s=false;this.nd=false}CT_tabularSlicerCacheItem.prototype.clone=function(){var res=new CT_tabularSlicerCacheItem;res.x=this.x;res.s=this.s;res.nd=this.nd;return res};CT_tabularSlicerCacheItem.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.x);s._WriteBool2(1,this.s);s._WriteBool2(2,this.nd);s.WriteUChar(AscCommon.g_nodeAttributeEnd)};CT_tabularSlicerCacheItem.prototype.fromStream= function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.x=s.GetULong();break}case 1:{this.s=s.GetBool();break}case 2:{this.nd=s.GetBool();break}default:s.Seek2(_end_pos);return}}s.Seek2(_end_pos)};var prot;window["Asc"]=window["Asc"]||{};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["Asc"]["CT_slicer"]=window["Asc"].CT_slicer=CT_slicer;prot= CT_slicer.prototype;prot["asc_setName"]=prot.asc_setName;prot["asc_setCaption"]=prot.asc_setCaption;prot["asc_setStartItem"]=prot.asc_setStartItem;prot["asc_setColumnCount"]=prot.asc_setColumnCount;prot["asc_setShowCaption"]=prot.asc_setShowCaption;prot["asc_setStyle"]=prot.asc_setStyle;prot["asc_setLockedPosition"]=prot.asc_setLockedPosition;prot["asc_setRowHeight"]=prot.asc_setRowHeight;prot["asc_setLockedPosition"]=prot.asc_setLockedPosition;prot["asc_setSortOrder"]=prot.asc_setSortOrder;prot["asc_setHideItemsWithNoData"]= prot.asc_setHideItemsWithNoData;prot["asc_setCustomListSort"]=prot.asc_setCustomListSort;prot["asc_setIndicateItemsWithNoData"]=prot.asc_setIndicateItemsWithNoData;prot["asc_setShowItemsWithNoDataLast"]=prot.asc_setShowItemsWithNoDataLast;prot["asc_setButtonWidth"]=prot.asc_setButtonWidth;prot["asc_getName"]=prot.asc_getName;prot["asc_getCaption"]=prot.asc_getCaption;prot["asc_getStartItem"]=prot.asc_getStartItem;prot["asc_getColumnCount"]=prot.asc_getColumnCount;prot["asc_getShowCaption"]=prot.asc_getShowCaption; prot["asc_getStyle"]=prot.asc_getStyle;prot["asc_getLockedPosition"]=prot.asc_getLockedPosition;prot["asc_getRowHeight"]=prot.asc_getRowHeight;prot["asc_getSourceName"]=prot.asc_getSourceName;prot["asc_getNameInFormulas"]=prot.asc_getNameInFormulas;prot["asc_getSortOrder"]=prot.asc_getSortOrder;prot["asc_getCrossFilter"]=prot.asc_getCrossFilter;prot["asc_getHideItemsWithNoData"]=prot.asc_getHideItemsWithNoData;prot["asc_getCustomListSort"]=prot.asc_getCustomListSort;prot["asc_getIndicateItemsWithNoData"]= prot.asc_getIndicateItemsWithNoData;prot["asc_getShowItemsWithNoDataLast"]=prot.asc_getShowItemsWithNoDataLast;prot["asc_getButtonWidth"]=prot.asc_getButtonWidth;prot["asc_getStylesPictures"]=prot.asc_getStylesPictures;window["Asc"]["CT_slicers"]=window["Asc"].CT_slicers=CT_slicers;window["Asc"]["CT_slicerCacheDefinition"]=window["Asc"].CT_slicerCacheDefinition=CT_slicerCacheDefinition;window["Asc"]["CT_slicerCacheData"]=window["Asc"].CT_slicerCacheData=CT_slicerCacheData;window["Asc"]["CT_slicerCachePivotTable"]= window["Asc"].CT_slicerCachePivotTable=CT_slicerCachePivotTable;window["Asc"]["CT_olapSlicerCacheItem"]=window["Asc"].CT_olapSlicerCacheItem=CT_olapSlicerCacheItem;window["Asc"]["CT_olapSlicerCacheRange"]=window["Asc"].CT_olapSlicerCacheRange=CT_olapSlicerCacheRange;window["Asc"]["CT_olapSlicerCacheLevelData"]=window["Asc"].CT_olapSlicerCacheLevelData=CT_olapSlicerCacheLevelData;window["Asc"]["CT_olapSlicerCache"]=window["Asc"].CT_olapSlicerCache=CT_olapSlicerCache;window["Asc"]["CT_olapSlicerCacheSelection"]= window["Asc"].CT_olapSlicerCacheSelection=CT_olapSlicerCacheSelection;window["Asc"]["CT_tableSlicerCache"]=window["Asc"].CT_tableSlicerCache=CT_tableSlicerCache;window["Asc"]["CT_tabularSlicerCache"]=window["Asc"].CT_tabularSlicerCache=CT_tabularSlicerCache;window["Asc"]["CT_tabularSlicerCacheItem"]=window["Asc"].CT_tabularSlicerCacheItem=CT_tabularSlicerCacheItem;window["Asc"]["CT_slicerStyles"]=window["Asc"].CT_slicerStyles=CT_slicerStyles;window["Asc"]["CT_slicerStyle"]=window["Asc"].CT_slicerStyle= CT_slicerStyle;window["Asc"]["CT_slicerStyleElement"]=window["Asc"].CT_slicerStyleElement=CT_slicerStyleElement;window["Asc"]["ST_olapSlicerCacheSortOrder"]=window["AscCommonExcel"].ST_olapSlicerCacheSortOrder=ST_olapSlicerCacheSortOrder;prot=ST_olapSlicerCacheSortOrder;prot["Natural"]=prot.Natural;prot["Ascending"]=prot.Ascending;prot["Descending"]=prot.Descending;window["Asc"]["ST_tabularSlicerCacheSortOrder"]=window["Asc"].ST_tabularSlicerCacheSortOrder=ST_tabularSlicerCacheSortOrder;prot=ST_tabularSlicerCacheSortOrder; prot["Ascending"]=prot.Ascending;prot["Descending"]=prot.Descending;window["Asc"]["ST_slicerCacheCrossFilter"]=window["AscCommonExcel"].ST_slicerCacheCrossFilter=ST_slicerCacheCrossFilter;prot=ST_slicerCacheCrossFilter;prot["None"]=prot.None;prot["ShowItemsWithDataAtTop"]=prot.ShowItemsWithDataAtTop;prot["ShowItemsWithNoData"]=prot.ShowItemsWithNoData;window["Asc"]["ST_slicerStyleType"]=window["Asc"].ST_slicerStyleType=ST_slicerStyleType;prot=ST_slicerStyleType;prot["unselectedItemWithData"]=prot.unselectedItemWithData; prot["selectedItemWithData"]=prot.selectedItemWithData;prot["unselectedItemWithNoData"]=prot.unselectedItemWithNoData;prot["selectedItemWithNoData"]=prot.selectedItemWithNoData;prot["hoveredUnselectedItemWithData"]=prot.hoveredUnselectedItemWithData;prot["hoveredSelectedItemWithData"]=prot.hoveredSelectedItemWithData;prot["hoveredUnselectedItemWithNoData"]=prot.hoveredUnselectedItemWithNoData;prot["hoveredSelectedItemWithNoData"]=prot.hoveredSelectedItemWithNoData;window["AscCommonExcel"].insertSlicerType= insertSlicerType;prot=insertSlicerType;prot["table"]=prot.table;prot["pivotTable"]=prot.pivotTable})(window);"use strict";(function(undefined){function CT_NamedSheetViews(){this.namedSheetView=[];return this}CT_NamedSheetViews.prototype.toStream=function(s,tableIds){s.WriteUChar(AscCommon.g_nodeAttributeStart);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.StartRecord(0);var len=this.namedSheetView.length;s.WriteULong(len);for(var i=0;i<len;i++){s.StartRecord(0);this.namedSheetView[i].toStream(s,tableIds); s.EndRecord()}s.EndRecord()};CT_NamedSheetViews.prototype.fromStream=function(s,wb){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_NamedSheetView;tmp.fromStream(s,wb);this.namedSheetView.push(tmp)}break}default:{s.SkipRecord(); break}}}s.Seek2(_end_pos)};CT_NamedSheetViews.prototype.hasColorFilter=function(){return this.namedSheetView.some(function(namedSheetView){return namedSheetView.hasColorFilter()})};function CT_NamedSheetView(){this.nsvFilters=[];this.name=null;this.id=AscCommon.CreateGUID();this.ws=null;this.isLock=null;this._isActive=null;this.Id=AscCommon.g_oIdCounter.Get_NewId();return this}CT_NamedSheetView.prototype.Get_Id=function(){return this.Id};CT_NamedSheetView.prototype.getObjectType=function(){return AscDFH.historyitem_type_NamedSheetView}; CT_NamedSheetView.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.NamedSheetView};CT_NamedSheetView.prototype.toStream=function(s,tableIds){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.name);s._WriteString2(1,this.id);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.StartRecord(0);var len=this.nsvFilters.length;s.WriteULong(len);for(var i=0;i<len;i++){s.StartRecord(0);this.nsvFilters[i].toStream(s,tableIds);s.EndRecord()}s.EndRecord()};CT_NamedSheetView.prototype.fromStream= function(s,wb){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.name=s.GetString2();break}case 1:{this.id=s.GetString2();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_NsvFilter;tmp.fromStream(s,wb); this.nsvFilters.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CT_NamedSheetView.prototype.Read_FromBinary2=function(reader){var length=reader.GetLong();for(var i=0;i<length;++i){var _filter=new CT_NsvFilter;_filter.Read_FromBinary2(reader);this.nsvFilters.push(_filter)}this.name=reader.GetString2();this.id=reader.GetString2()};CT_NamedSheetView.prototype.initPostOpen=function(tableIds,ws){for(var i=0;i<this.nsvFilters.length;++i)this.nsvFilters[i].initPostOpen(tableIds);if(!this.ws)this.setWS(ws)}; CT_NamedSheetView.prototype.clone=function(tableNameMap){var res=new CT_NamedSheetView(true);for(var i=0;i<this.nsvFilters.length;++i)res.nsvFilters[i]=this.nsvFilters[i].clone(tableNameMap);res.name=this.name;res.ws=this.ws;return res};CT_NamedSheetView.prototype.setWS=function(ws){this.ws=ws};CT_NamedSheetView.prototype.hasColorFilter=function(){return this.nsvFilters.some(function(nsvFilter){return nsvFilter.hasColorFilter()})};function CT_NsvFilter(){this.columnsFilter=[];this.sortRules=null; this.filterId=AscCommon.CreateGUID();this.ref=null;this.tableId=null;this.tableIdOpen=null;return this}CT_NsvFilter.prototype.toStream=function(s,tableIds){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.filterId);if(null!==this.ref)s._WriteString2(1,this.ref.getName(AscCommonExcel.referenceType.R));if("0"===this.tableId)s._WriteUInt2(2,0);else{var elem=tableIds&&tableIds[this.tableId];if(elem)s._WriteUInt2(2,elem.id)}s._WriteUInt2(2,this.tableIdOpen);s.WriteUChar(AscCommon.g_nodeAttributeEnd); s.WriteRecordArray4(0,0,this.columnsFilter);if(null!==this.sortRules){var sortRules=new CT_SortRules;sortRules.sortRule=this.sortRules;s.WriteRecord4(1,sortRules)}};CT_NsvFilter.prototype.fromStream=function(s,wb){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.filterId=s.GetString2();break}case 1:{this.ref=AscCommonExcel.g_oRangeCache.getAscRange(s.GetString2()); break}case 2:{this.tableIdOpen=s.GetULong();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_ColumnFilter;tmp.fromStream(s,wb);this.columnsFilter.push(tmp)}break}case 1:{var sortRules=new CT_SortRules;sortRules.fromStream(s,wb);this.sortRules=sortRules.sortRule;break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CT_NsvFilter.prototype.Read_FromBinary2= function(reader){var i,obj;var length=reader.GetLong();for(i=0;i<length;++i){_obj=new CT_ColumnFilter;_obj.Read_FromBinary2(reader);this.columnsFilter.push(_obj)}length=reader.GetLong();for(i=0;i<length;++i){var _obj=new CT_SortRule;if(!this.sortRules)this.sortRules=[];_obj.Read_FromBinary2(reader);this.sortRules.push(_obj)}this.filterId=reader.GetString2();if(reader.GetBool()){var r1=reader.GetLong();var c1=reader.GetLong();var r2=reader.GetLong();var c2=reader.GetLong();this.ref=new Asc.Range(c1, r1,c2,r2)}if(reader.GetBool())this.tableId=reader.GetString2();if(reader.GetBool())this.tableIdOpen=reader.GetString2()};CT_NsvFilter.prototype.clone=function(tableNameMap){var res=new CT_NsvFilter;var i;if(this.columnsFilter)for(i=0;i<this.columnsFilter.length;++i)res.columnsFilter[i]=this.columnsFilter[i].clone();if(this.sortRules)for(i=0;i<this.sortRules.length;++i)res.sortRules[i]=this.sortRules[i].clone();res.ref=this.ref;res.tableId=tableNameMap&&tableNameMap[this.tableId]?tableNameMap[this.tableId]: this.tableId;res.tableIdOpen=this.tableIdOpen;return res};CT_NsvFilter.prototype.initPostOpen=function(tableIds){var table=null;if(null!=this.tableIdOpen){if(0!==this.tableIdOpen){table=tableIds[this.tableIdOpen];if(table)this.tableId=table.DisplayName}else this.tableId="0";this.tableIdOpen=null}return table};CT_NsvFilter.prototype.getColumnFilterByColId=function(id,isGetIndex){for(var i=0;i<this.columnsFilter.length;++i)if(this.columnsFilter[i].filter&&this.columnsFilter[i].filter.ColId===id)return!isGetIndex? this.columnsFilter[i].filter:{filter:this.columnsFilter[i].filter,index:i};return null};CT_NsvFilter.prototype.init=function(obj){if(obj){var af;if(!obj.isAutoFilter()){this.ref=obj.Ref;this.tableId=obj.DisplayName;af=obj.AutoFilter}else{this.ref=obj.Ref;this.tableId="0";af=obj}if(af&&af.FilterColumns)for(var i=0;i<af.FilterColumns.length;i++){var newColumnFilter=new CT_ColumnFilter;newColumnFilter.colId=af.FilterColumns[i].ColId;newColumnFilter.filter=af.FilterColumns[i].clone();this.columnsFilter.push(newColumnFilter)}}}; CT_NsvFilter.prototype.isApplyAutoFilter=function(obj){var res=null;if(this.columnsFilter&&this.columnsFilter.length)for(var i=0;i<this.columnsFilter.length;i++){var _filterColumn=this.columnsFilter[i]&&this.columnsFilter[i].filter;if(_filterColumn.isApplyAutoFilter()){res=true;break}}return res};CT_NsvFilter.prototype.getFilterColumnByIndex=function(index){return this.columnsFilter&&this.columnsFilter[index]&&this.columnsFilter[index].filter};CT_NsvFilter.prototype.getIndexByColId=function(colId){var res= null;if(!this.columnsFilter)return res;for(var i=0;i<this.columnsFilter.length;i++)if(this.columnsFilter[i].filter&&this.columnsFilter[i].filter.ColId===colId){res=i;break}return res};CT_NsvFilter.prototype.deleteFilterColumn=function(index){if(this.columnsFilter&&this.columnsFilter[index])this.columnsFilter.splice(index,1)};CT_NsvFilter.prototype.hasColorFilter=function(){return this.columnsFilter.some(function(columnsFilter){return columnsFilter.hasColorFilter()})};function CT_ColumnFilter(){this.filter= null;this.colId=null;this.id=AscCommon.CreateGUID();return this}CT_ColumnFilter.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.colId);s._WriteString2(1,this.id);s.WriteUChar(AscCommon.g_nodeAttributeEnd);var dxfs=[];if(null!==this.filter){s.StartRecord(1);s.WriteULong(1);s.StartRecord(0);var tmp=new AscCommon.CMemory(true);s.ExportToMemory(tmp);var btw=new AscCommonExcel.BinaryTableWriter(tmp,dxfs,false,{});btw.WriteFilterColumn(this.filter);s.ImportFromMemory(tmp); s.EndRecord();s.EndRecord()}if(dxfs.length>0){s.StartRecord(0);var tmp=new AscCommon.CMemory(true);s.ExportToMemory(tmp);var bstw=new AscCommonExcel.BinaryStylesTableWriter(tmp,null,null);bstw.WriteDxf(dxfs[0]);s.ImportFromMemory(tmp);s.EndRecord()}};CT_ColumnFilter.prototype.fromStream=function(s,wb){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.colId=s.GetULong(); break}case 1:{this.id=s.GetString2();break}default:s.Seek2(_end_pos);return}}var dxfs=[];var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{var _stream=new AscCommon.FT_Stream2;_stream.FromFileStream(s);var bsr=new AscCommonExcel.Binary_StylesTableReader(_stream,wb);dxfs.push(bsr.ReadDxfExternal());_stream.ToFileStream2(s);break}case 1:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var _stream=new AscCommon.FT_Stream2;_stream.FromFileStream(s); var oReadResult=new AscCommonWord.DocReadResult(null);var bwtr=new AscCommonExcel.Binary_TableReader(_stream,oReadResult,null,dxfs);this.filter=bwtr.ReadFilterColumnExternal();_stream.ToFileStream2(s)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CT_ColumnFilter.prototype.Read_FromBinary2=function(reader){if(reader.GetBool()){var api_sheet=Asc["editor"];var wb=api_sheet.wbModel;var bsr=new AscCommonExcel.Binary_StylesTableReader(reader,wb);var bcr=new AscCommon.Binary_CommonReader(reader); var oDxf=new AscCommonExcel.CellXfs;reader.GetUChar();var length=reader.GetULongLE();bcr.Read1(length,function(t,l){return bsr.ReadDxf(t,l,oDxf)});this.dxf=oDxf}if(reader.GetBool()){var obj=new window["AscCommonExcel"].FilterColumn;obj.Read_FromBinary2(reader);this.colId=obj?obj.ColId:null;this.filter=obj}};CT_ColumnFilter.prototype.clone=function(){var res=new CT_ColumnFilter;res.filter=this.filter?this.filter.clone():null;res.colId=this.colId;return res};CT_ColumnFilter.prototype.hasColorFilter= function(){return null!==this.filter&&this.filter.isColorFilter()};function CT_SortRules(){this.sortMethod=null;this.caseSensitive=null;this.sortRule=[];return this}CT_SortRules.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUChar2(0,this.sortMethod);s._WriteBool2(1,this.caseSensitive);s.WriteUChar(AscCommon.g_nodeAttributeEnd);s.WriteRecordArray4(0,0,this.sortRule)};CT_SortRules.prototype.fromStream=function(s,wb){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos= _len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.sortMethod=s.GetUChar();break}case 1:{this.caseSensitive=s.GetBool();break}default:s.Seek2(_end_pos);return}}var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{s.Skip2(4);var _c=s.GetULong();for(var i=0;i<_c;++i){s.Skip2(1);var tmp=new CT_SortRule;tmp.fromStream(s,wb);this.sortRule.push(tmp)}break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)}; function CT_SortRule(){this.sortCondition=null;this.richSortCondition=null;this.colId=null;this.id=AscCommon.CreateGUID();return this}CT_SortRule.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteUInt2(0,this.colId);s._WriteString2(1,this.id);s.WriteUChar(AscCommon.g_nodeAttributeEnd);var dxfs=[];if(null!==this.sortCondition){s.StartRecord(2);var tmp=new AscCommon.CMemory(true);s.ExportToMemory(tmp);var btw=new AscCommonExcel.BinaryTableWriter(tmp,dxfs,false,{}); if(this.sortCondition.dxf){dxfs.push(this.sortCondition.dxf);this.sortCondition.dxf=null}btw.WriteSortCondition(this.sortCondition);if(dxfs.length>0)this.sortCondition.dxf=dxfs[0];s.ImportFromMemory(tmp);s.EndRecord()}if(dxfs.length>0){s.StartRecord(0);var tmp=new AscCommon.CMemory(true);s.ExportToMemory(tmp);var bstw=new AscCommonExcel.BinaryStylesTableWriter(tmp,null,null);bstw.WriteDxf(dxfs[0]);s.ImportFromMemory(tmp);s.EndRecord()}};CT_SortRule.prototype.fromStream=function(s,wb){var _len=s.GetULong(); var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.colId=s.GetULong();break}case 1:{this.id=s.GetString2();break}default:s.Seek2(_end_pos);return}}var dxfs=[];var _type;while(true){if(s.cur>=_end_pos)break;_type=s.GetUChar();switch(_type){case 0:{var _stream=new AscCommon.FT_Stream2;_stream.FromFileStream(s);var bsr=new AscCommonExcel.Binary_StylesTableReader(_stream,wb);dxfs.push(bsr.ReadDxfExternal()); _stream.ToFileStream2(s);break}case 2:{var _stream=new AscCommon.FT_Stream2;_stream.FromFileStream(s);var oReadResult=new AscCommonWord.DocReadResult(null);var bwtr=new AscCommonExcel.Binary_TableReader(_stream,oReadResult,null,dxfs);this.sortCondition=bwtr.ReadSortConditionExternal();if((Asc.ESortBy.sortbyCellColor===this.sortCondition.ConditionSortBy||Asc.ESortBy.sortbyFontColor===this.sortCondition.ConditionSortBy)&&null===this.sortCondition.dxf&&dxfs.length>0)this.sortCondition.dxf=dxfs[0];_stream.ToFileStream2(s); break}default:{s.SkipRecord();break}}}s.Seek2(_end_pos)};CT_SortRule.prototype.Read_FromBinary2=function(reader){if(reader.GetBool()){var api_sheet=Asc["editor"];var wb=api_sheet.wbModel;var bsr=new AscCommonExcel.Binary_StylesTableReader(reader,wb);var bcr=new AscCommon.Binary_CommonReader(reader);var oDxf=new AscCommonExcel.CellXfs;reader.GetUChar();var length=reader.GetULongLE();bcr.Read1(length,function(t,l){return bsr.ReadDxf(t,l,oDxf)});this.dxf=oDxf}var obj;if(reader.GetBool()){obj=new AscCommonExcel.FilterColumn; obj.Read_FromBinary2(reader);this.sortCondition=obj}if(reader.GetBool()){obj=new AscCommonExcel.SortCondition;obj.Read_FromBinary2(reader);this.richSortCondition=obj}};CT_SortRule.prototype.clone=function(){var res=new CT_SortRule;res.sortCondition=this.sortCondition?this.sortCondition.clone():null;res.richSortCondition=this.richSortCondition?this.richSortCondition.clone():null;return res};window["Asc"]["CT_NamedSheetViews"]=window["Asc"].CT_NamedSheetViews=CT_NamedSheetViews;window["Asc"]["CT_NamedSheetView"]= window["Asc"].CT_NamedSheetView=CT_NamedSheetView;window["Asc"]["CT_NsvFilter"]=window["Asc"].CT_NsvFilter=CT_NsvFilter;window["Asc"]["CT_ColumnFilter"]=window["Asc"].CT_ColumnFilter=CT_ColumnFilter;window["Asc"]["CT_SortRule"]=window["Asc"].CT_SortRule=CT_SortRule})(window);"use strict";(function(window,undefined){var global_mouseEvent=AscCommon.global_mouseEvent;var AscBrowser=AscCommon.AscBrowser;function CMobileDelegateEditorCell(_manager){this.Name="cell";this.WB=_manager.Api.wb;this.DrawingDocument= this.WB.model.getDrawingDocument();this.Offset={X:0,Y:0};this.Size={W:0,H:0};AscCommon.CMobileDelegateSimple.call(this,_manager)}CMobileDelegateEditorCell.prototype=Object.create(AscCommon.CMobileDelegateSimple.prototype);CMobileDelegateEditorCell.prototype.constructor=CMobileDelegateEditorCell;CMobileDelegateEditorCell.prototype.Resize=function(){var _element=document.getElementById("editor_sdk");this.Offset.X=_element.offsetLeft;this.Offset.Y=_element.offsetTop;this.Size.W=_element.offsetWidth; this.Size.H=_element.offsetHeight};CMobileDelegateEditorCell.prototype.ConvertCoordsToCursor=function(x,y,page,isGlobal,isNoCell){var _res=this.WB.ConvertLogicToXY(x,y);var _point={X:_res.X,Y:_res.Y,Page:0,DrawPage:0};if(AscBrowser.isRetina)if(isNoCell===true){_point.X/=AscCommon.AscBrowser.retinaPixelRatio;_point.Y/=AscCommon.AscBrowser.retinaPixelRatio}else{_point.X/=AscCommon.AscBrowser.retinaPixelRatio;_point.Y/=AscCommon.AscBrowser.retinaPixelRatio;_point.X=_point.X>>0;_point.Y=_point.Y>>0}if(isGlobal!== false){_point.X+=this.Offset.X;_point.Y+=this.Offset.Y}return _point};CMobileDelegateEditorCell.prototype.ConvertCoordsFromCursor=function(x,y){var _x=x-this.Offset.X;var _y=y-this.Offset.Y;if(AscBrowser.isRetina){_x*=AscCommon.AscBrowser.retinaPixelRatio;_y*=AscCommon.AscBrowser.retinaPixelRatio}var _res=this.WB.ConvertXYToLogic(_x,_y);var _point={X:_res.X,Y:_res.Y,Page:0,DrawPage:0};return _point};CMobileDelegateEditorCell.prototype.GetZoomFit=function(){return 50};CMobileDelegateEditorCell.prototype.GetZoom= function(){return 100*this.Api.asc_getZoom()};CMobileDelegateEditorCell.prototype.SetZoom=function(_value){return this.Api.asc_setZoom(_value/100)};CMobileDelegateEditorCell.prototype.GetScrollerSize=function(){return{W:this.WB.element.clientWidth+this.WB.controller.hsbMax,H:this.WB.element.clientHeight+this.WB.controller.vsbMax}};CMobileDelegateEditorCell.prototype.GetSelectionTransform=function(){if(this.WB.getWorksheet().objectRender.controller.selectedObjects.length==0)return null;return this.WB.getWorksheet().objectRender.controller.drawingDocument.SelectionMatrix}; CMobileDelegateEditorCell.prototype.GetScrollerParent=function(){return this.WB.element};CMobileDelegateEditorCell.prototype.GetObjectTrack=function(x,y,page,bSelected,bText){if(this.WB.getCellEditMode()){var _coords=this.WB.ConvertLogicToXY(x,y);AscCommon.global_mouseEvent.KoefPixToMM=5;var _cursor=this.WB.getWorksheet().getCursorTypeFromXY(_coords.X,_coords.Y);AscCommon.global_mouseEvent.KoefPixToMM=1;if(_cursor.target==AscCommonExcel.c_oTargetType.MoveResizeRange)return true}return this.WB.getWorksheet().objectRender.controller.isPointInDrawingObjects3(x, y,page,bSelected,bText)};CMobileDelegateEditorCell.prototype.GetSelectionRectsBounds=function(){var _selection=this.WB.GetSelectionRectsBounds();if(_selection){var _obj={Start:{X:_selection.X,Y:_selection.Y,W:_selection.W,H:_selection.H,Page:0},End:{X:_selection.X,Y:_selection.Y,W:_selection.W,H:_selection.H,Page:0},Type:_selection.T};var _captionSize;switch(_selection.T){case Asc.c_oAscSelectionType.RangeCol:{_captionSize=this.WB.GetCaptionSize();_obj.Start.Y=_obj.End.Y=-_captionSize.H;_obj.Start.H= _obj.End.H=_captionSize.H;break}case Asc.c_oAscSelectionType.RangeRow:{_captionSize=this.WB.GetCaptionSize();_obj.Start.X=_obj.End.X=-_captionSize.W;_obj.Start.W=_obj.End.W=_captionSize.W;break}default:break}return _obj}return this.WB.getWorksheet().objectRender.controller.GetSelectionBounds()};CMobileDelegateEditorCell.prototype.ScrollTo=function(_scroll){var pos;var _api=this.WB;if("v"===_scroll.directionLocked){pos=-_scroll.y/_api.controller.settings.hscrollStep;if(-_scroll.y>=-_scroll.maxScrollY)pos+= 1;_api._onScrollY(pos)}else if("h"===_scroll.directionLocked){pos=-_scroll.x/_api.controller.settings.vscrollStep;if(-_scroll.x>=-_scroll.maxScrollX)pos+=1;_api._onScrollX(pos)}else if("n"===_scroll.directionLocked){pos=-_scroll.y/_api.controller.settings.hscrollStep;if(-_scroll.y>=-_scroll.maxScrollY)pos+=1;_api._onScrollY(pos);pos=-_scroll.x/_api.controller.settings.vscrollStep;if(-_scroll.x>=-_scroll.maxScrollX)pos+=1;_api._onScrollX(pos)}};CMobileDelegateEditorCell.prototype.GetContextMenuType= function(){var _mode=AscCommon.MobileTouchContextMenuType.None;var _controller=this.WB.getWorksheet().objectRender.controller;var _selection=this.WB.GetSelectionRectsBounds();if(!_controller.IsSelectionUse()&&!_selection)_mode=AscCommon.MobileTouchContextMenuType.Target;if(_controller.GetSelectionBounds()||_selection)_mode=AscCommon.MobileTouchContextMenuType.Select;if(_mode==0&&_controller.getSelectedObjectsBounds())_mode=AscCommon.MobileTouchContextMenuType.Object;return _mode};CMobileDelegateEditorCell.prototype.IsInObject= function(){var _controller=this.WB.getWorksheet().objectRender.controller;return null!=_controller.getSelectedObjectsBounds(true)};CMobileDelegateEditorCell.prototype.GetContextMenuInfo=function(info){info.Clear();var _info=null;var _transform=null;var _x=0;var _y=0;var _controller=this.WB.getWorksheet().objectRender.controller;var _target=_controller.IsSelectionUse();var _selection=this.WB.GetSelectionRectsBounds();if(!_target&&!_selection){_info={X:this.DrawingDocument.m_dTargetX,Y:this.DrawingDocument.m_dTargetY, Page:this.DrawingDocument.m_lTargetPage};_transform=this.DrawingDocument.TextMatrix;if(_transform){_x=_transform.TransformPointX(_info.X,_info.Y);_y=_transform.TransformPointY(_info.X,_info.Y);_info.X=_x;_info.Y=_y}info.targetPos=_info;return}var _select=_controller.GetSelectionBounds();if(_select){var _rect1=_select.Start;var _rect2=_select.End;_info={X1:_rect1.X,Y1:_rect1.Y,Page1:_rect1.Page,X2:_rect2.X+_rect2.W,Y2:_rect2.Y+_rect2.H,Page2:_rect2.Page};_transform=this.DrawingDocument.SelectionMatrix; if(_transform){_x=_transform.TransformPointX(_info.X1,_info.Y1);_y=_transform.TransformPointY(_info.X1,_info.Y1);_info.X1=_x;_info.Y1=_y;_x=_transform.TransformPointX(_info.X2,_info.Y2);_y=_transform.TransformPointY(_info.X2,_info.Y2);_info.X2=_x;_info.Y2=_y}info.selectText=_info;return}else if(_selection){info.selectCell={X:_selection.X,Y:_selection.Y,W:_selection.W,H:_selection.H};return}var _object_bounds=_controller.getSelectedObjectsBounds();if(_object_bounds)info.objectBounds={X:_object_bounds.minX, Y:_object_bounds.minY,R:_object_bounds.maxX,B:_object_bounds.maxY,Page:_object_bounds.pageIndex}};CMobileDelegateEditorCell.prototype.GetContextMenuPosition=function(){var _controller=this.WB.getWorksheet().objectRender.controller;var _posX=0;var _posY=0;var _page=0;var _transform=null;var tmpX,tmpY,tmpX2,tmpY2;var _pos=null;var _mode=0;var _target=_controller.IsSelectionUse();var _selection=this.WB.GetSelectionRectsBounds();if(!_target&&!_selection){_posX=this.DrawingDocument.m_dTargetX;_posY=this.DrawingDocument.m_dTargetY; _page=this.DrawingDocument.m_lTargetPage;_transform=this.DrawingDocument.TextMatrix;if(_transform){tmpX=_transform.TransformPointX(_posX,_posY);tmpY=_transform.TransformPointY(_posX,_posY)}else{tmpX=_posX;tmpY=_posY}_pos=this.ConvertCoordsToCursor(tmpX,tmpY,_page);_posX=_pos.X;_posY=_pos.Y;_mode=1}var _select=_controller.GetSelectionBounds();if(_select){var _rect1=_select.Start;var _rect2=_select.End;tmpX=_rect1.X;tmpY=_rect1.Y;tmpX2=_rect2.X+_rect2.W;tmpY2=_rect2.Y+_rect2.H;_transform=this.DrawingDocument.SelectionMatrix; if(_transform){_posX=_transform.TransformPointX(tmpX,tmpY);_posY=_transform.TransformPointY(tmpX,tmpY);tmpX=_posX;tmpY=_posY;_posX=_transform.TransformPointX(tmpX2,tmpY2);_posY=_transform.TransformPointY(tmpX2,tmpY2);tmpX2=_posX;tmpY2=_posY}_pos=this.ConvertCoordsToCursor(tmpX,tmpY,_rect1.Page);_posX=_pos.X;_posY=_pos.Y;_pos=this.ConvertCoordsToCursor(tmpX2,tmpY2,_rect2.Page);_posX+=_pos.X;_posX=_posX>>1;_mode=2}else if(_selection){tmpX=_selection.X;tmpY=_selection.Y;tmpX2=_selection.X+_selection.W; tmpY2=_selection.Y+_selection.H;_pos=this.ConvertCoordsToCursor(tmpX,tmpY,0);_posX=_pos.X;_posY=_pos.Y;_pos=this.ConvertCoordsToCursor(tmpX2,tmpY2,0);_posX+=_pos.X;_posX=_posX>>1;_mode=2}var _object_bounds=_controller.getSelectedObjectsBounds(true);if(_object_bounds){_pos=this.ConvertCoordsToCursor(_object_bounds.minX,_object_bounds.minY,_object_bounds.pageIndex);_posX=_pos.X;_posY=_pos.Y;_pos=this.ConvertCoordsToCursor(_object_bounds.maxX,_object_bounds.maxY,_object_bounds.pageIndex);_posX+=_pos.X; _posX=_posX>>1;_mode=3}_posX-=this.Offset.X;_posY-=this.Offset.Y;return{X:_posX,Y:_posY,Mode:_mode}};CMobileDelegateEditorCell.prototype._convertLogicToEvent=function(e,x,y,page){var _e={};var _pos=this.ConvertCoordsToCursor(x,y,0);_e.pageX=_pos.X/AscBrowser.zoom;_e.pageY=_pos.Y/AscBrowser.zoom;_e.altKey=global_mouseEvent.AltKey;_e.shiftKey=global_mouseEvent.ShiftKey;_e.ctrlKey=global_mouseEvent.CtrlKey;_e.button=global_mouseEvent.Button;return _e};CMobileDelegateEditorCell.prototype.Logic_OnMouseDown= function(e,x,y,page){return this.Api.controller._onMouseDown(this._convertLogicToEvent(e,x,y,page))};CMobileDelegateEditorCell.prototype.Logic_OnMouseMove=function(e,x,y,page){return this.Api.controller._onMouseMove(this._convertLogicToEvent(e,x,y,page))};CMobileDelegateEditorCell.prototype.Logic_OnMouseUp=function(e,x,y,page){return this.Api.controller._onMouseUp(this._convertLogicToEvent(e,x,y,page))};CMobileDelegateEditorCell.prototype.Drawing_OnMouseDown=function(e){return this.Api.controller._onMouseDown(e)}; CMobileDelegateEditorCell.prototype.Drawing_OnMouseMove=function(e){return this.Api.controller._onMouseMove(e)};CMobileDelegateEditorCell.prototype.Drawing_OnMouseUp=function(e){return this.Api.controller._onMouseUp(e)};function CMobileTouchManager(_config){AscCommon.CMobileTouchManagerBase.call(this,_config||{})}CMobileTouchManager.prototype=Object.create(AscCommon.CMobileTouchManagerBase.prototype);CMobileTouchManager.prototype.constructor=CMobileTouchManager;CMobileTouchManager.prototype.Init= function(_api){this.Api=_api;this.delegate=new CMobileDelegateEditorCell(this);var _element=this.delegate.GetScrollerParent();this.CreateScrollerDiv(_element);this.iScroll=new window.IScrollMobile(_element,{scrollbars:true,mouseWheel:true,interactiveScrollbars:true,shrinkScrollbars:"scale",fadeScrollbars:true,scrollX:true,scroller_id:this.iScrollElement,bounce:false,eventsElement:this.eventsElement,click:false});this.delegate.Init();this.TableTrackEnabled=false;this.CellEditorType=Asc.c_oAscCellEditorState.editEnd; var _that=this;this.Api.asc_registerCallback("asc_onEditCell",function(_state){_that.CellEditorType=_state})};CMobileTouchManager.prototype.MoveCursorToPoint=function(){};CMobileTouchManager.prototype.onTouchStart=function(e){var _e=e.touches?e.touches[0]:e;this.IsTouching=true;AscCommon.g_inputContext.enableVirtualKeyboard();this.checkPointerMultiTouchAdd(e);global_mouseEvent.KoefPixToMM=5;AscCommon.check_MouseDownEvent(_e,true);global_mouseEvent.KoefPixToMM=1;global_mouseEvent.LockMouse();this.ClearContextMenu(); this.MoveAfterDown=false;this.TimeDown=(new Date).getTime();var bIsKoefPixToMM=false;var _matrix=this.delegate.GetSelectionTransform();if(_matrix&&global_MatrixTransformer.IsIdentity(_matrix))_matrix=null;if(!this.CheckSelectTrack())bIsKoefPixToMM=this.CheckObjectTrack();if(e.touches&&2==e.touches.length||2==this.getPointerCount())this.Mode=AscCommon.MobileTouchMode.Zoom;if(this.Mode==AscCommon.MobileTouchMode.None)this.CheckSelectTrackObject();switch(this.Mode){case AscCommon.MobileTouchMode.None:case AscCommon.MobileTouchMode.Scroll:case AscCommon.MobileTouchMode.InlineObj:case AscCommon.MobileTouchMode.FlowObj:case AscCommon.MobileTouchMode.Zoom:case AscCommon.MobileTouchMode.Cursor:case AscCommon.MobileTouchMode.TableMove:case AscCommon.MobileTouchMode.SelectTrack:{if(global_mouseEvent.ClickCount> 0)global_mouseEvent.ClickCount--;break}default:break}var isPreventDefault=false;switch(this.Mode){case AscCommon.MobileTouchMode.Select:case AscCommon.MobileTouchMode.InlineObj:case AscCommon.MobileTouchMode.FlowObj:case AscCommon.MobileTouchMode.Zoom:case AscCommon.MobileTouchMode.TableMove:case AscCommon.MobileTouchMode.SelectTrack:{isPreventDefault=true;break}case AscCommon.MobileTouchMode.None:case AscCommon.MobileTouchMode.Scroll:{isPreventDefault=!this.CheckObjectText();break}default:{break}}switch(this.Mode){case AscCommon.MobileTouchMode.None:{this.Mode= AscCommon.MobileTouchMode.Scroll;this.DownPoint=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);this.DownPointOriginal.X=global_mouseEvent.X;this.DownPointOriginal.Y=global_mouseEvent.Y;this.iScroll._start(e);break}case AscCommon.MobileTouchMode.Scroll:{this.DownPoint=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);this.DownPointOriginal.X=global_mouseEvent.X;this.DownPointOriginal.Y=global_mouseEvent.Y;this.iScroll._start(e);break}case AscCommon.MobileTouchMode.Select:{var _x1= this.RectSelect1.x+.5;var _y1=this.RectSelect1.y+.5;var _x2=this.RectSelect2.x+this.RectSelect2.w-.5;var _y2=this.RectSelect2.y+this.RectSelect2.h-.5;if(this.RectSelectType===Asc.c_oAscSelectionType.RangeCol||this.RectSelectType===Asc.c_oAscSelectionType.RangeRow)AscCommon.global_mouseEvent.KoefPixToMM=-10;if(1==this.DragSelect){global_mouseEvent.Button=0;if(!_matrix)this.delegate.Logic_OnMouseDown(global_mouseEvent,_x2,_y2,this.PageSelect2);else{var __X=_matrix.TransformPointX(_x2,_y2);var __Y=_matrix.TransformPointY(_x2, _y2);this.delegate.Logic_OnMouseDown(global_mouseEvent,__X,__Y,this.PageSelect2)}this.delegate.Drawing_OnMouseMove(_e)}else if(2==this.DragSelect){global_mouseEvent.Button=0;if(!_matrix)this.delegate.Logic_OnMouseDown(global_mouseEvent,_x1,_y1,this.PageSelect1);else{var __X=_matrix.TransformPointX(_x1,_y1);var __Y=_matrix.TransformPointY(_x1,_y1);this.delegate.Logic_OnMouseDown(global_mouseEvent,__X,__Y,this.PageSelect1)}this.delegate.Drawing_OnMouseMove(_e)}break}case AscCommon.MobileTouchMode.InlineObj:{break}case AscCommon.MobileTouchMode.FlowObj:case AscCommon.MobileTouchMode.SelectTrack:{if(bIsKoefPixToMM|| this.Mode==AscCommon.MobileTouchMode.SelectTrack)global_mouseEvent.KoefPixToMM=5;if(this.Mode==AscCommon.MobileTouchMode.SelectTrack)this.delegate.Drawing_OnMouseMove(e.touches?e.touches[0]:e);this.delegate.Drawing_OnMouseDown(e.touches?e.touches[0]:e);global_mouseEvent.KoefPixToMM=1;break}case AscCommon.MobileTouchMode.Zoom:{this.Api.asc_closeCellEditor();this.ZoomDistance=this.getPointerDistance(e);this.ZoomValue=this.delegate.GetZoom();break}case AscCommon.MobileTouchMode.Cursor:{this.Mode=AscCommon.MobileTouchMode.Scroll; this.DownPoint=this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X,global_mouseEvent.Y);break}}if(AscCommon.AscBrowser.isAndroid)isPreventDefault=false;if(this.Api.isViewMode||isPreventDefault)AscCommon.stopEvent(e);return false};CMobileTouchManager.prototype.onTouchMove=function(e){this.checkPointerMultiTouchAdd(e);var _e=e.touches?e.touches[0]:e;if(this.Mode!=AscCommon.MobileTouchMode.FlowObj&&this.Mode!=AscCommon.MobileTouchMode.TableMove)AscCommon.check_MouseMoveEvent(e.touches?e.touches[0]: e);if(!this.MoveAfterDown)if(Math.abs(this.DownPointOriginal.X-global_mouseEvent.X)>this.MoveMinDist||Math.abs(this.DownPointOriginal.Y-global_mouseEvent.Y)>this.MoveMinDist)this.MoveAfterDown=true;switch(this.Mode){case AscCommon.MobileTouchMode.Cursor:{this.MoveCursorToPoint(true);break}case AscCommon.MobileTouchMode.Scroll:{var _newTime=(new Date).getTime();if(_newTime-this.TimeDown>this.ReadingGlassTime&&!this.MoveAfterDown){this.Mode=AscCommon.MobileTouchMode.Cursor;this.MoveCursorToPoint(false)}else{this.iScroll._move(e); AscCommon.stopEvent(e)}break}case AscCommon.MobileTouchMode.Zoom:{var isTouch2=e.touches&&2==e.touches.length||2==this.getPointerCount();if(!isTouch2){this.Mode=AscCommon.MobileTouchMode.None;return}var zoomCurrentDist=this.getPointerDistance(e);if(zoomCurrentDist==0)zoomCurrentDist=1;var _zoomFix=this.ZoomValue/100;var _zoomCur=_zoomFix*(zoomCurrentDist/this.ZoomDistance);_zoomCur=_zoomCur*100>>0;if(_zoomCur<this.ZoomValueMin)_zoomCur=this.ZoomValueMin;else if(_zoomCur>this.ZoomValueMax)_zoomCur= this.ZoomValueMax;this.delegate.SetZoom(_zoomCur);AscCommon.stopEvent(e);break}case AscCommon.MobileTouchMode.InlineObj:{break}case AscCommon.MobileTouchMode.FlowObj:case AscCommon.MobileTouchMode.SelectTrack:{this.delegate.Drawing_OnMouseMove(e.touches?e.touches[0]:e);AscCommon.stopEvent(e);break}case AscCommon.MobileTouchMode.Select:{global_mouseEvent.ClickCount=1;this.delegate.Drawing_OnMouseMove(_e);AscCommon.stopEvent(e);break}default:break}};CMobileTouchManager.prototype.onTouchEnd=function(e){this.IsTouching= false;var _e=e.changedTouches?e.changedTouches[0]:e;if(this.Mode!=AscCommon.MobileTouchMode.FlowObj&&this.Mode!=AscCommon.MobileTouchMode.TableMove)AscCommon.check_MouseUpEvent(_e);var isCheckContextMenuMode=true;var isCheckContextMenuSelect=false;var isCheckContextMenuCursor=this.Mode==AscCommon.MobileTouchMode.Cursor;var isPreventDefault=false;switch(this.Mode){case AscCommon.MobileTouchMode.Select:case AscCommon.MobileTouchMode.Scroll:case AscCommon.MobileTouchMode.InlineObj:case AscCommon.MobileTouchMode.FlowObj:case AscCommon.MobileTouchMode.Zoom:case AscCommon.MobileTouchMode.TableMove:case AscCommon.MobileTouchMode.SelectTrack:{isPreventDefault= true;break}default:{break}}switch(this.Mode){case AscCommon.MobileTouchMode.Cursor:{this.Mode=AscCommon.MobileTouchMode.None;break}case AscCommon.MobileTouchMode.Scroll:{if(!this.MoveAfterDown){global_mouseEvent.Button=0;global_mouseEvent.KoefPixToMM=5;this.delegate.Drawing_OnMouseDown(_e);this.delegate.Drawing_OnMouseUp(_e);global_mouseEvent.KoefPixToMM=1;this.Api.sendEvent("asc_onTapEvent",e);var typeMenu=this.delegate.GetContextMenuType();if(typeMenu==AscCommon.MobileTouchContextMenuType.Target|| typeMenu==AscCommon.MobileTouchContextMenuType.Select&&this.delegate.IsInObject())isPreventDefault=false}else{isCheckContextMenuMode=false;this.iScroll._end(e)}this.Mode=AscCommon.MobileTouchMode.None;break}case AscCommon.MobileTouchMode.Zoom:{this.Mode=AscCommon.MobileTouchMode.None;isCheckContextMenuMode=false;break}case AscCommon.MobileTouchMode.InlineObj:{break}case AscCommon.MobileTouchMode.FlowObj:case AscCommon.MobileTouchMode.SelectTrack:{this.delegate.Drawing_OnMouseUp(e.changedTouches?e.changedTouches[0]: e);this.Mode=AscCommon.MobileTouchMode.None;break}case AscCommon.MobileTouchMode.Select:{this.DragSelect=0;this.Mode=AscCommon.MobileTouchMode.None;this.delegate.Drawing_OnMouseUp(_e);isCheckContextMenuSelect=true;break}default:break}this.checkPointerMultiTouchRemove(e);if(true){var _e={};_e.pageX=-1E3;_e.pageY=-1E3;_e.altKey=false;_e.shiftKey=false;_e.ctrlKey=false;_e.button=0;this.delegate.Api.controller._onMouseMove(_e)}if(this.CellEditorType==Asc.c_oAscCellEditorState.editFormula)isPreventDefault= false;if(this.Api.isViewMode||isPreventDefault)if(!AscCommon.g_inputContext.isHardCheckKeyboard)AscCommon.g_inputContext.preventVirtualKeyboard(e);if(AscCommon.g_inputContext.isHardCheckKeyboard)isPreventDefault?AscCommon.g_inputContext.preventVirtualKeyboard_Hard():AscCommon.g_inputContext.enableVirtualKeyboard_Hard();if(true!==this.iScroll.isAnimating&&this.CellEditorType!=Asc.c_oAscCellEditorState.editFormula)this.CheckContextMenuTouchEnd(isCheckContextMenuMode,isCheckContextMenuSelect,isCheckContextMenuCursor); return false};CMobileTouchManager.prototype.mainOnTouchStart=function(e){if(AscCommon.g_inputContext&&AscCommon.g_inputContext.externalChangeFocus())return;return this.onTouchStart(e)};CMobileTouchManager.prototype.mainOnTouchMove=function(e){return this.onTouchMove(e)};CMobileTouchManager.prototype.mainOnTouchEnd=function(e){return this.onTouchEnd(e)};CMobileTouchManager.prototype.CheckSelect=function(overlay,color,drDocument){if(!this.SelectEnabled)return;if(!overlay)return;this.CheckSelectRects(); if(null==this.RectSelect1||null==this.RectSelect2)return;var _matrix=this.delegate.GetSelectionTransform();var ctx=overlay.m_oContext;ctx.lineWidth=2;if(undefined===color){ctx.strokeStyle="#146FE1";ctx.fillStyle="#146FE1"}else{ctx.strokeStyle="rgba("+color.r+","+color.g+","+color.b+","+color.a+")";ctx.fillStyle="rgba("+color.r+","+color.g+","+color.b+","+color.a+")"}var _koef=AscCommon.AscBrowser.isRetina?AscCommon.AscBrowser.retinaPixelRatio:1;var _oldGlobalAlpha=ctx.globalAlpha;ctx.globalAlpha= 1;if(!_matrix||global_MatrixTransformer.IsIdentity(_matrix)){var pos1=this.delegate.ConvertCoordsToCursor(this.RectSelect1.x,this.RectSelect1.y,this.PageSelect1,false,true);var pos2=this.delegate.ConvertCoordsToCursor(this.RectSelect1.x,this.RectSelect1.y+this.RectSelect1.h,this.PageSelect1,false,true);var pos3=this.delegate.ConvertCoordsToCursor(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y,this.PageSelect2,false,true);var pos4=this.delegate.ConvertCoordsToCursor(this.RectSelect2.x+this.RectSelect2.w, this.RectSelect2.y+this.RectSelect2.h,this.PageSelect2,false,true);if(undefined===color){ctx.beginPath();ctx.moveTo(_koef*pos1.X>>0,_koef*pos1.Y>>0);ctx.lineTo(_koef*pos2.X>>0,_koef*pos2.Y>>0);ctx.moveTo(_koef*pos3.X>>0,_koef*pos3.Y>>0);ctx.lineTo(_koef*pos4.X>>0,_koef*pos4.Y>>0);ctx.stroke()}ctx.beginPath();var _offset=undefined===color?5:0;if(this.RectSelectType===Asc.c_oAscSelectionType.RangeCol){pos2.Y=pos4.Y=pos2.Y-pos1.Y;pos1.Y=pos3.Y=0;ctx.beginPath();var _x1C=(_koef*pos1.X+.5>>0)-1;var _x2C= (_koef*pos3.X+1.5>>0)-1;ctx.moveTo(_x1C,_koef*pos1.Y>>0);ctx.lineTo(_x1C,_koef*pos2.Y>>0);ctx.moveTo(_x2C,_koef*pos3.Y>>0);ctx.lineTo(_x2C,_koef*pos4.Y>>0);ctx.stroke();ctx.beginPath();if(_x2C>_x1C+10*_koef){var _y1=(_koef*pos1.Y>>0)+2*_koef;var _y2=(_koef*pos2.Y>>0)-2*_koef;if(_y2>_y1){ctx.moveTo(_x2C-2*_koef,_y1);ctx.lineTo(_x2C-2*_koef,_y2);ctx.lineTo(_x2C-6*_koef,_y2);ctx.lineTo(_x2C-6*_koef,_y1);ctx.closePath()}}ctx.fill();ctx.beginPath();overlay.CheckPoint(_x1C,pos1.Y);overlay.CheckPoint(_x2C, pos4.Y);var _yC=_koef*(this.delegate.Size.H+pos4.Y)/2;overlay.AddEllipse(_x1C,_yC,_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2);overlay.AddEllipse(_x2C,_yC,_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2);ctx.fill()}else if(this.RectSelectType===Asc.c_oAscSelectionType.RangeRow){pos3.X=pos4.X=pos3.X-pos1.X;pos1.X=pos2.X=0;ctx.beginPath();var _y1C=(_koef*pos1.Y+.5>>0)-1;var _y2C=(_koef*pos2.Y+1.5>>0)-1;ctx.moveTo(_koef*pos1.X>>0,_y1C);ctx.lineTo(_koef*pos3.X>>0,_y1C);ctx.moveTo(_koef*pos2.X>>0,_y2C);ctx.lineTo(_koef* pos4.X>>0,_y2C);ctx.stroke();ctx.beginPath();if(_y2C>_y1C+10*_koef){var _x1=(_koef*pos1.X>>0)+2*_koef;var _x2=(_koef*pos3.X>>0)-2*_koef;if(_x2>_x1){ctx.moveTo(_x1,_y2C-2*_koef);ctx.lineTo(_x2,_y2C-2*_koef);ctx.lineTo(_x2,_y2C-6*_koef);ctx.lineTo(_x1,_y2C-6*_koef);ctx.closePath()}}ctx.fill();ctx.beginPath();overlay.CheckPoint(pos1.X,_y1C);overlay.CheckPoint(pos4.X,_y2C);var _xC=_koef*(this.delegate.Size.W+pos4.X)/2;overlay.AddEllipse(_xC,_y1C,_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2);overlay.AddEllipse(_xC, _y2C,_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2);ctx.fill()}else{overlay.AddEllipse(_koef*pos1.X,_koef*(pos1.Y-_offset),_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2);overlay.AddEllipse(_koef*pos4.X,_koef*(pos4.Y+_offset),_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2);ctx.fill()}ctx.beginPath()}else{var _xx11=_matrix.TransformPointX(this.RectSelect1.x,this.RectSelect1.y);var _yy11=_matrix.TransformPointY(this.RectSelect1.x,this.RectSelect1.y);var _xx12=_matrix.TransformPointX(this.RectSelect1.x,this.RectSelect1.y+ this.RectSelect1.h);var _yy12=_matrix.TransformPointY(this.RectSelect1.x,this.RectSelect1.y+this.RectSelect1.h);var _xx21=_matrix.TransformPointX(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y);var _yy21=_matrix.TransformPointY(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y);var _xx22=_matrix.TransformPointX(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+this.RectSelect2.h);var _yy22=_matrix.TransformPointY(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+this.RectSelect2.h); var pos1=this.delegate.ConvertCoordsToCursor(_xx11,_yy11,this.PageSelect1,false);var pos2=this.delegate.ConvertCoordsToCursor(_xx12,_yy12,this.PageSelect1,false);var pos3=this.delegate.ConvertCoordsToCursor(_xx21,_yy21,this.PageSelect2,false);var pos4=this.delegate.ConvertCoordsToCursor(_xx22,_yy22,this.PageSelect2,false);if(undefined===color){ctx.beginPath();ctx.moveTo(_koef*pos1.X,_koef*pos1.Y);ctx.lineTo(_koef*pos2.X,_koef*pos2.Y);ctx.moveTo(_koef*pos3.X,_koef*pos3.Y);ctx.lineTo(_koef*pos4.X,_koef* pos4.Y);ctx.lineWidth=2;ctx.stroke()}ctx.beginPath();if(undefined===color){var ex01=_matrix.TransformPointX(0,0);var ey01=_matrix.TransformPointY(0,0);var ex11=_matrix.TransformPointX(0,1);var ey11=_matrix.TransformPointY(0,1);var _len=Math.sqrt((ex11-ex01)*(ex11-ex01)+(ey11-ey01)*(ey11-ey01));if(_len==0)_len=.01;var ex=5*(ex11-ex01)/_len;var ey=5*(ey11-ey01)/_len;var _x1=pos1.X-ex>>0;var _y1=pos1.Y-ey>>0;var _x2=pos4.X+ex>>0;var _y2=pos4.Y+ey>>0;overlay.AddEllipse(_koef*_x1,_koef*_y1,_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/ 2);overlay.AddEllipse(_koef*_x2,_koef*_y2,_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2)}else{overlay.AddEllipse(_koef*pos1.X,_koef*pos1.Y,_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2);overlay.AddEllipse(_koef*pos4.X,_koef*pos4.Y,_koef*AscCommon.MOBILE_SELECT_TRACK_ROUND/2)}ctx.fill();ctx.beginPath()}ctx.globalAlpha=_oldGlobalAlpha};CMobileTouchManager.prototype.CheckSelectTrack=function(){if(this.RectSelectType!==Asc.c_oAscSelectionType.RangeRow&&this.RectSelectType!==Asc.c_oAscSelectionType.RangeCol)return AscCommon.CMobileTouchManagerBase.prototype.CheckSelectTrack.call(this); if(null!=this.RectSelect1&&null!=this.RectSelect2){var pos1=null;var pos4=null;var _pos=this.delegate.ConvertCoordsToCursor(0,0,0,false);if(this.RectSelectType===Asc.c_oAscSelectionType.RangeCol){var Y=this.delegate.ConvertCoordsFromCursor(0,this.delegate.Offset.Y+(this.delegate.Size.H+_pos.Y)/2).Y;pos1=this.delegate.ConvertCoordsToCursor(this.RectSelect1.x,Y,this.PageSelect1);pos4=this.delegate.ConvertCoordsToCursor(this.RectSelect2.x+this.RectSelect2.w,Y,this.PageSelect2)}else{var X=this.delegate.ConvertCoordsFromCursor(this.delegate.Offset.X+ (this.delegate.Size.W+_pos.X)/2,0).X;pos1=this.delegate.ConvertCoordsToCursor(X,this.RectSelect1.y,this.PageSelect1);pos4=this.delegate.ConvertCoordsToCursor(X,this.RectSelect2.y+this.RectSelect2.h,this.PageSelect2)}if(Math.abs(pos1.X-global_mouseEvent.X)<this.TrackTargetEps&&Math.abs(pos1.Y-global_mouseEvent.Y)<this.TrackTargetEps){this.Mode=AscCommon.MobileTouchMode.Select;this.DragSelect=1}else if(Math.abs(pos4.X-global_mouseEvent.X)<this.TrackTargetEps&&Math.abs(pos4.Y-global_mouseEvent.Y)<this.TrackTargetEps){this.Mode= AscCommon.MobileTouchMode.Select;this.DragSelect=2}}return this.Mode==AscCommon.MobileTouchMode.Select};CMobileTouchManager.prototype.CheckSelectTrackObject=function(){if(!this.delegate.WB.IsSelectionUse())return;if(null!=this.RectSelect1&&null!=this.RectSelect2){var pos1=this.delegate.ConvertCoordsToCursor(this.RectSelect1.x,this.RectSelect1.y,this.PageSelect1);var pos4=this.delegate.ConvertCoordsToCursor(this.RectSelect2.x+this.RectSelect2.w,this.RectSelect2.y+this.RectSelect2.h,this.PageSelect2); if(this.RectSelectType===Asc.c_oAscSelectionType.RangeCol){if(Math.abs(pos4.X-global_mouseEvent.X)<this.TrackTargetEps)if(pos4.X>global_mouseEvent.X)this.Mode=AscCommon.MobileTouchMode.SelectTrack}else if(this.RectSelectType===Asc.c_oAscSelectionType.RangeRow){if(Math.abs(pos4.Y-global_mouseEvent.Y)<this.TrackTargetEps)if(pos4.Y>global_mouseEvent.Y)this.Mode=AscCommon.MobileTouchMode.SelectTrack}else if(Math.abs(pos1.X-global_mouseEvent.X)<this.TrackTargetEps&&global_mouseEvent.Y>pos1.Y&&global_mouseEvent.Y< pos4.Y)this.Mode=AscCommon.MobileTouchMode.SelectTrack;else if(Math.abs(pos4.X-global_mouseEvent.X)<this.TrackTargetEps&&global_mouseEvent.Y>pos1.Y&&global_mouseEvent.Y<pos4.Y)this.Mode=AscCommon.MobileTouchMode.SelectTrack;else if(Math.abs(pos1.Y-global_mouseEvent.Y)<this.TrackTargetEps&&global_mouseEvent.X>pos1.X&&global_mouseEvent.X<pos4.X)this.Mode=AscCommon.MobileTouchMode.SelectTrack;else if(Math.abs(pos4.Y-global_mouseEvent.Y)<this.TrackTargetEps&&global_mouseEvent.X>pos1.X&&global_mouseEvent.X< pos4.X)this.Mode=AscCommon.MobileTouchMode.SelectTrack}return this.Mode==AscCommon.MobileTouchMode.SelectTrack};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].CMobileTouchManager=CMobileTouchManager})(window);"use strict";(function(window,undefined){var asc=window["Asc"];var asc_debug=asc.outputDebugStr;var asc_typeof=asc.typeOf;var asc_round=asc.round;function LineInfo(lm){this.tw=0;this.th=0;this.bl=0;this.a=0;this.d=0;this.beg=undefined;this.end=undefined;this.startX= undefined;this.assign(lm)}LineInfo.prototype.assign=function(lm){if(lm){this.th=lm.th;this.bl=lm.bl;this.a=lm.a;this.d=lm.d}};function lineMetrics(){this.th=0;this.bl=0;this.bl2=0;this.a=0;this.d=0}lineMetrics.prototype.clone=function(){var oRes=new lineMetrics;oRes.th=this.th;oRes.bl=this.bl;oRes.bl2=this.bl2;oRes.a=this.a;oRes.d=this.d;return oRes};function charProperties(){this.c=undefined;this.lm=undefined;this.fm=undefined;this.fsz=undefined;this.font=undefined;this.va=undefined;this.nl=undefined; this.hp=undefined;this.delta=undefined;this.skip=undefined;this.repeat=undefined;this.total=undefined;this.wrd=undefined}charProperties.prototype.clone=function(){var oRes=new charProperties;oRes.c=undefined!==this.c?this.c.clone():undefined;oRes.lm=undefined!==this.lm?this.lm.clone():undefined;oRes.fm=undefined!==this.fm?this.fm.clone():undefined;oRes.fsz=undefined!==this.fsz?this.fsz.clone():undefined;oRes.font=undefined!==this.font?this.font.clone():undefined;oRes.va=this.va;oRes.nl=this.nl;oRes.hp= this.hp;oRes.delta=this.delta;oRes.skip=this.skip;oRes.repeat=this.repeat;oRes.total=this.total;oRes.wrd=this.wrd;return oRes};function StringRender(drawingCtx){this.drawingCtx=drawingCtx;this.fragments=undefined;this.flags=undefined;this.chars="";this.charWidths=[];this.charProps=[];this.lines=[];this.angle=0;this.fontNeedUpdate=false;this.reNL=/[\r\n]/;this.reSpace=/[\n\r\u2028\u2029\t\v\f\u0020\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2008\u2009\u200A\u200B\u205F\u3000]/;this.reReplaceNL=/\r?\n|\r/g; this.reHypNL=/[\n\r\u2028\u2029]/;this.reHypSp=/[\t\v\f\u0020\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2008\u2009\u200A\u200B\u205F\u3000]/;this.reHyphen=/[\u002D\u00AD\u2010\u2012\u2013\u2014]/;return this}StringRender.prototype.setString=function(fragments,flags){this.fragments=[];if(asc_typeof(fragments)==="string"){var newFragment=new AscCommonExcel.Fragment;newFragment.text=fragments;newFragment.format=new AscCommonExcel.Font;this.fragments.push(newFragment)}else for(var i=0;i<fragments.length;++i)this.fragments.push(fragments[i].clone()); this.flags=flags;this._reset();this._setFont(this.drawingCtx,AscCommonExcel.g_oDefaultFormat.Font);return this};StringRender.prototype.rotateAtPoint=function(drawingCtx,angle,x,y,dx,dy){var m=new asc.Matrix;m.rotate(angle,0);var mbt=new asc.Matrix;if(null===drawingCtx){mbt.translate(x+dx,y+dy);this.drawingCtx.setTextTransform(m.sx,m.shy,m.shx,m.sy,m.tx,m.ty);this.drawingCtx.setTransform(mbt.sx,mbt.shy,mbt.shx,mbt.sy,mbt.tx,mbt.ty);this.drawingCtx.updateTransforms()}else{mbt.translate((x+dx)*AscCommonExcel.vector_koef, (y+dy)*AscCommonExcel.vector_koef);mbt.multiply(m,0);drawingCtx.setTransform(mbt.sx,mbt.shy,mbt.shx,mbt.sy,mbt.tx,mbt.ty)}return this};StringRender.prototype.resetTransform=function(drawingCtx){if(null===drawingCtx)this.drawingCtx.resetTransforms();else{var m=new asc.Matrix;drawingCtx.setTransform(m.sx,m.shy,m.shx,m.sy,m.tx,m.ty)}this.angle=0;this.fontNeedUpdate=true};StringRender.prototype.getTransformBound=function(angle,w,h,textW,alignHorizontal,alignVertical,maxWidth){var ctx=this.drawingCtx; this.angle=0;this.fontNeedUpdate=true;var dx=0,dy=0,offsetX=0,tm=this._doMeasure(maxWidth),mul=(90-Math.abs(angle))/90,angleSin=Math.sin(angle*Math.PI/180),angleCos=Math.cos(angle*Math.PI/180),posh=angle===90||angle===-90?textW:Math.abs(angleSin*textW),posv=angle===90||angle===-90?0:Math.abs(angleCos*textW),isHorzLeft=AscCommon.align_Left===alignHorizontal,isHorzCenter=AscCommon.align_Center===alignHorizontal,isHorzRight=AscCommon.align_Right===alignHorizontal,isVertBottom=Asc.c_oAscVAlign.Bottom=== alignVertical,isVertCenter=Asc.c_oAscVAlign.Center===alignVertical||Asc.c_oAscVAlign.Dist===alignVertical||Asc.c_oAscVAlign.Just===alignVertical,isVertTop=Asc.c_oAscVAlign.Top===alignVertical;if(isVertBottom){if(angle<0)if(isHorzLeft)dx=-(angleSin*tm.height);else if(isHorzCenter){dx=(w-angleSin*tm.height-posv)/2;offsetX=-(w-posv)/2-angleSin*tm.height/2}else{if(isHorzRight){dx=w-posv+2;offsetX=-(w-posv)-angleSin*tm.height-2}}else if(isHorzLeft);else if(isHorzCenter){dx=(w-angleSin*tm.height-posv)/ 2;offsetX=-(w-posv)/2+angleSin*tm.height/2}else if(isHorzRight){dx=w-posv+1+1-tm.height*angleSin;offsetX=-w-posv+1+1-tm.height*angleSin}if(posh<h)if(angle<0)dy=h-(posh+angleCos*tm.height);else dy=h-angleCos*tm.height;else if(angle>0)dy=h-angleCos*tm.height}else if(isVertCenter){if(angle<0)if(isHorzLeft)dx=-(angleSin*tm.height);else if(isHorzCenter){dx=(w-angleSin*tm.height-posv)/2;offsetX=-(w-posv)/2-angleSin*tm.height/2}else{if(isHorzRight){dx=w-posv+2;offsetX=-(w-posv)-angleSin*tm.height-2}}else if(isHorzLeft); else if(isHorzCenter){dx=(w-angleSin*tm.height-posv)/2;offsetX=-(w-posv)/2+angleSin*tm.height/2}else if(isHorzRight){dx=w-posv+1+1-tm.height*angleSin;offsetX=-w-posv+1+1-tm.height*angleSin}if(posh<h)if(angle<0)dy=(h-posh-angleCos*tm.height)*.5;else dy=(h+posh-angleCos*tm.height)*.5;else if(angle>0)dy=h-angleCos*tm.height}else if(isVertTop)if(angle<0)if(isHorzLeft)dx=-(angleSin*tm.height);else if(isHorzCenter){dx=(w-angleSin*tm.height-posv)/2;offsetX=-(w-posv)/2-angleSin*tm.height/2}else{if(isHorzRight){dx= w-posv+2;offsetX=-(w-posv)-angleSin*tm.height-2}}else{if(isHorzLeft);else if(isHorzCenter){dx=(w-angleSin*tm.height-posv)/2;offsetX=-(w-posv)/2+angleSin*tm.height/2}else if(isHorzRight){dx=w-posv+1+1-tm.height*angleSin;offsetX=-w-posv+1+1-tm.height*angleSin}dy=Math.min(h+tm.height*angleCos,posh)}var bound={dx:dx,dy:dy,height:0,width:0,offsetX:offsetX};if(angle===90||angle===-90){bound.width=tm.height;bound.height=textW}else{bound.height=Math.abs(angleSin*textW)+Math.abs(angleCos*tm.height);bound.width= Math.abs(angleCos*textW)+Math.abs(angleSin*tm.height)}return bound};StringRender.prototype.measure=function(maxWidth){return this._doMeasure(maxWidth)};StringRender.prototype.render=function(drawingCtx,x,y,maxWidth,textColor){this._doRender(drawingCtx,x,y,maxWidth,textColor);return this};StringRender.prototype.measureString=function(fragments,flags,maxWidth){if(fragments)this.setString(fragments,flags);return this._doMeasure(maxWidth)};StringRender.prototype.getWidestCharWidth=function(){return this.charWidths.reduce(function(p, c){return p<c?c:p},0)};StringRender.prototype._reset=function(){this.chars="";this.charWidths=[];this.charProps=[];this.lines=[]};StringRender.prototype._filterText=function(fragment,wrap){var s=fragment;if(s.search(this.reNL)>=0)s=s.replace(this.reReplaceNL,wrap?"\n":"");return s};StringRender.prototype._calcCharsWidth=function(startCh,endCh){for(var w=0,i=startCh;i<=endCh;++i)w+=this.charWidths[i];return w};StringRender.prototype._calcLineWidth=function(startPos,endPos){var wrap=this.flags&&(this.flags.wrapText|| this.flags.wrapOnlyNL||this.flags.wrapOnlyCE);var isAtEnd,j,chProp,tw;if(endPos===undefined||endPos<0){for(j=startPos+1;j<this.chars.length;++j){chProp=this.charProps[j];if(chProp&&(chProp.nl||chProp.hp))break}endPos=j-1}for(j=endPos,tw=0,isAtEnd=true;j>=startPos;--j){if(isAtEnd){if(wrap&&this.reSpace.test(this.chars[j]))continue;isAtEnd=false}tw+=this.charWidths[j]}return tw};StringRender.prototype._calcLineMetrics=function(f,va,fm){var l=new lineMetrics;if(!va){var _a=Math.max(0,asc.ceil(fm.nat_y1* f/fm.nat_scale));var _d=Math.max(0,asc.ceil(-fm.nat_y2*f/fm.nat_scale))+1;l.th=_a+_d;l.bl=_a;l.a=_a;l.d=_d}else{var ppi=96;var hpt=f*1.275;var fpx=f*ppi/72;var topt=72/ppi;var h;var a=asc_round(fpx)*topt;var d;var a_2=asc_round(fpx/2)*topt;var h_2_3;var a_2_3=asc_round(fpx*2/3)*topt;var d_2_3;var x=a_2+a_2_3;if(va===AscCommon.vertalign_SuperScript){h=hpt;d=h-a;l.th=x+d;l.bl=x;l.bl2=a_2_3;l.a=fm.ascender+a_2;l.d=fm.descender-a_2}else if(va===AscCommon.vertalign_SubScript){h_2_3=hpt*2/3;d_2_3=h_2_3- a_2_3;l.th=x+d_2_3;l.bl=a;l.bl2=x;l.a=fm.ascender+a-x;l.d=fm.descender+x-a}}return l};StringRender.prototype._calcLineMetrics2=function(f,va,fm){var l=new lineMetrics;var a=Math.max(0,asc.ceil(fm.nat_y1*f/fm.nat_scale));var d=Math.max(0,asc.ceil(-fm.nat_y2*f/fm.nat_scale))+1;l.th=a+d;l.bl=a;l.a=a;l.d=d;return l};StringRender.prototype.calcDelta=function(vnew,vold){return vnew>vold?vnew-vold:0};StringRender.prototype._calcTextMetrics=function(dontCalcRepeatChars){var self=this,i=0,p,p_,lm,beg=0;var l= new LineInfo,TW=0,TH=0,BL=0;function addLine(b,e){if(-1!==b)l.tw+=self._calcLineWidth(b,e);l.beg=b;l.end=e<b?b:e;self.lines.push(l);if(TW<l.tw)TW=l.tw;BL=TH+l.bl;TH+=l.th}if(0>=this.chars.length){p=this.charProps[0];if(p&&p.font){lm=this._calcLineMetrics(p.fsz!==undefined?p.fsz:p.font.getSize(),p.va,p.fm);l.assign(lm);addLine(-1,-1);l.beg=l.end=0}}else{for(;i<this.chars.length;++i){p=this.charProps[i];if(p&&p.font){lm=this._calcLineMetrics(p.fsz!==undefined?p.fsz:p.font.getSize(),p.va,p.fm);if(i=== 0)l.assign(lm);else{l.th+=this.calcDelta(lm.bl,l.bl)+this.calcDelta(lm.th-lm.bl,l.th-l.bl);l.bl+=this.calcDelta(lm.bl,l.bl);l.a+=this.calcDelta(lm.a,l.a);l.d+=this.calcDelta(lm.d,l.d)}p.lm=lm;p_=p}if(dontCalcRepeatChars&&p&&p.repeat)l.tw-=this._calcCharsWidth(i,i+p.total);if(p&&(p.nl||p.hp)){addLine(beg,i);beg=i+(p.nl?1:0);lm=this._calcLineMetrics(p_.fsz!==undefined?p_.fsz:p_.font.getSize(),p_.va,p_.fm);l=new LineInfo(lm)}}if(beg<=i)addLine(beg,i-1)}return new asc.TextMetrics(TW,TH,0,BL,0,0)};StringRender.prototype._getRepeatCharPos= function(){var charProp;for(var i=0;i<this.chars.length;++i){charProp=this.charProps[i];if(charProp&&charProp.repeat)return i}return-1};StringRender.prototype._insertRepeatChars=function(maxWidth){var self=this,width,w,pos,charProp;function shiftCharPropsLeft(fromPos,delta){var length=self.charProps.length;for(var i=fromPos;i<length;++i){var p=self.charProps[i];if(p){delete self.charProps[i];self.charProps[i+delta]=p}}}function shiftCharPropsRight(fromPos,delta){for(var i=self.charProps.length-1;i>= fromPos;--i){var p=self.charProps[i];if(p){delete self.charProps[i];self.charProps[i+delta]=p}}}function insertRepeatChars(){if(0===charProp.total)return;var repeatEnd=pos+charProp.total;self.chars=""+self.chars.slice(0,repeatEnd)+self.chars.slice(pos,pos+1)+self.chars.slice(repeatEnd);self.charWidths=[].concat(self.charWidths.slice(0,repeatEnd),self.charWidths.slice(pos,pos+1),self.charWidths.slice(repeatEnd));shiftCharPropsRight(pos+1,1)}function removeRepeatChar(){self.chars=""+self.chars.slice(0, pos)+self.chars.slice(pos+1);self.charWidths=[].concat(self.charWidths.slice(0,pos),self.charWidths.slice(pos+1));delete self.charProps[pos];shiftCharPropsLeft(pos+1,-1)}width=this._calcTextMetrics(true).width;pos=this._getRepeatCharPos();if(-1===pos)return;w=this._calcCharsWidth(pos,pos);charProp=this.charProps[pos];while(charProp.total*w+width+w<=maxWidth){insertRepeatChars();charProp.total+=1}if(0===charProp.total)removeRepeatChar();this.lines=[]};StringRender.prototype._getCharPropAt=function(index){var prop= this.charProps[index];if(!prop)prop=this.charProps[index]=new charProperties;return prop};StringRender.prototype._measureChars=function(maxWidth){var self=this;var ctx=this.drawingCtx;var font=ctx.font;var wrap=this.flags&&(this.flags.wrapText||this.flags.wrapOnlyCE)&&!this.flags.isNumberFormat;var wrapNL=this.flags&&this.flags.wrapOnlyNL;var verticalText=this.flags&&this.flags.verticalText;var hasRepeats=false;var i,j,fr,fmt,text,p,p_={},pIndex,startCh;var tw=0,nlPos=0,isEastAsian,hpPos=undefined, isSP_=true,delta=0;function measureFragment(s){var j,ch,chc,chw,chPos,isNL,isSP,isHP,tm;for(chPos=self.chars.length,j=0;j<s.length;++j,++chPos){ch=s.charAt(j);tm=ctx.measureChar(ch,0);chw=tm.width;isNL=self.reHypNL.test(ch);isSP=!isNL?self.reHypSp.test(ch):false;if(wrap||wrapNL||verticalText){isHP=!isSP&&!isNL?self.reHyphen.test(ch):false;chc=s.charCodeAt(j);isEastAsian=AscCommon.isEastAsianScript(chc);if(verticalText);else if(isNL){nlPos=chPos;self._getCharPropAt(nlPos).nl=true;self._getCharPropAt(nlPos).delta= delta;ch=" ";chw=0;tw=0;hpPos=undefined}else if(isSP||isHP)hpPos=chPos+1;else if(isEastAsian)if(0!==j&&!(AscCommon.g_aPunctuation[s.charCodeAt(j-1)]&AscCommon.PUNCTUATION_FLAG_CANT_BE_AT_END_E)&&!(AscCommon.g_aPunctuation[chc]&AscCommon.PUNCTUATION_FLAG_CANT_BE_AT_BEGIN_E))hpPos=chPos;if(chPos!==nlPos&&(wrap&&!isSP&&tw+chw>maxWidth||verticalText)){nlPos=hpPos!==undefined?hpPos:chPos;self._getCharPropAt(nlPos).hp=true;self._getCharPropAt(nlPos).delta=delta;tw=self._calcCharsWidth(nlPos,chPos-1);hpPos= undefined}if(isEastAsian)if(j!==s.length&&!(AscCommon.g_aPunctuation[s.charCodeAt(j+1)]&AscCommon.PUNCTUATION_FLAG_CANT_BE_AT_BEGIN_E)&&!(AscCommon.g_aPunctuation[chc]&AscCommon.PUNCTUATION_FLAG_CANT_BE_AT_END_E))hpPos=chPos+1}if(isSP_&&!isSP&&!isNL)self._getCharPropAt(chPos).wrd=true;tw+=chw;self.charWidths.push(chw);self.chars+=ch;isSP_=isSP||isNL;delta=tm.widthBB-tm.width}}this._reset();for(i=0;i<this.fragments.length;++i){startCh=this.charWidths.length;fr=this.fragments[i];fmt=fr.format.clone(); var va=fmt.getVerticalAlign();text=this._filterText(fr.text,wrap||wrapNL);pIndex=this.chars.length;p=this.charProps[pIndex];p=p?p.clone():new charProperties;if(va===AscCommon.vertalign_SuperScript||va===AscCommon.vertalign_SubScript){p.va=va;p.fsz=fmt.getSize();fmt.fs=p.fsz*2/3;p.font=fmt}if(this._setFont(ctx,fmt)||fmt.getUnderline()!==font.getUnderline()||fmt.getStrikeout()!==font.getStrikeout()||fmt.getColor()!==p_.c)p.font=fmt;if(i===0)p.font=fmt;if(p.font){p.fm=ctx.getFontMetrics();p.c=fmt.getColor(); this.charProps[pIndex]=p;p_=p}if(fmt.getSkip())this._getCharPropAt(pIndex).skip=text.length;if(fmt.getRepeat()){if(hasRepeats)throw"Repeat should occur no more than once";this._getCharPropAt(pIndex).repeat=true;this._getCharPropAt(pIndex).total=0;hasRepeats=true}if(text.length<1)continue;measureFragment(text);for(j=startCh;font.getItalic()&&j<this.charWidths.length;++j)if(this.charProps[j]&&this.charProps[j].delta&&j>0)if(this.charWidths[j-1]>0)this.charWidths[j-1]+=this.charProps[j].delta;else if(j> 1)this.charWidths[j-2]+=this.charProps[j].delta}if(0!==this.chars.length&&this.charProps[this.chars.length]!==undefined)delete this.charProps[this.chars.length];else if(font.getItalic())this.charWidths[this.charWidths.length-1]+=delta;if(hasRepeats){if(maxWidth===undefined)throw"Undefined width of cell width Numeric Format";this._insertRepeatChars(maxWidth)}return this._calcTextMetrics()};StringRender.prototype._doMeasure=function(maxWidth){var ratio,format,size,canReduce=true,minSize=2.5;var tm= this._measureChars(maxWidth);while(this.flags&&this.flags.shrinkToFit&&tm.width>maxWidth&&canReduce){canReduce=false;ratio=maxWidth/tm.width;for(var i=0;i<this.fragments.length;++i){format=this.fragments[i].format;size=Math.max(minSize,Math.floor(format.getSize()*ratio*2)/2);format.setSize(size);if(minSize<size)canReduce=true}tm=this._measureChars(maxWidth)}return tm};StringRender.prototype._doRender=function(drawingCtx,x,y,maxWidth,textColor){var self=this;var ctx=drawingCtx||this.drawingCtx;var zoom= ctx.getZoom();var ppiy=ctx.getPPIY();var align=this.flags?this.flags.textAlign:null;var i,j,p,p_,strBeg;var n=0,l=this.lines[0],x1=l?initX(0):0,y1=y,dx=l?computeWordDeltaX():0;function initX(startPos){var x_=x;if(align===AscCommon.align_Right)x_=x+maxWidth-self._calcLineWidth(startPos)-1;else if(align===AscCommon.align_Center)x_=x+.5*(maxWidth-self._calcLineWidth(startPos));l.startX=x_;return x_}function computeWordDeltaX(){if(align!==AscCommon.align_Justify||n===self.lines.length-1)return 0;for(var i= l.beg,c=0;i<=l.end;++i){var p=self.charProps[i];if(p&&p.wrd)++c}return c>1?(maxWidth-l.tw)/(c-1):0}function renderFragment(begin,end,prop,angle){var dh=prop&&prop.lm&&prop.lm.bl2>0?prop.lm.bl2-prop.lm.bl:0;var dw=self._calcCharsWidth(strBeg,end-1);var so=prop.font.getStrikeout();var ul=Asc.EUnderline.underlineNone!==prop.font.getUnderline();var isSO=so===true;var fsz,x2,y,lw,dy,i,b,x_,cp;var bl=asc_round(l.bl*zoom);y=y1+bl+dh;if(align!==AscCommon.align_Justify||dx<1E-6)ctx.fillText(self.chars.slice(begin, end),x1,y,undefined,self.charWidths.slice(begin,end),angle);else{for(i=b=begin,x_=x1;i<end;++i){cp=self.charProps[i];if(cp&&cp.wrd&&i>b){ctx.fillText(self.chars.slice(b,i),x_,y,undefined,self.charWidths.slice(b,i),angle);x_+=self._calcCharsWidth(b,i-1)+dx;dw+=dx;b=i}}if(i>b)ctx.fillText(self.chars.slice(b,i),x_,y,undefined,self.charWidths.slice(b,i),angle)}if(isSO||ul){x2=x1+dw;fsz=prop.font.getSize();lw=asc_round(fsz*ppiy/72/18)||1;ctx.setStrokeStyle(prop.c||textColor).setLineWidth(lw).beginPath(); dy=lw/2;dy=dy>>0;if(ul){y=asc_round(y1+bl+prop.lm.d*.4);ctx.lineHor(x1,y+dy,x2+1)}if(isSO){dy+=1;y=asc_round(y1+bl-prop.lm.a*.275);ctx.lineHor(x1,y-dy,x2+1)}ctx.stroke()}return dw}for(i=0,strBeg=0;i<this.chars.length;++i){p=this.charProps[i];if(p&&(p.font||p.nl||p.hp||p.skip>0)){if(strBeg<i){x1+=renderFragment(strBeg,i,p_,this.angle);strBeg=i}if(p.nl)strBeg+=1;if(p.font){this._setFont(ctx,p.font);ctx.setFillStyle(p.c||textColor);p_=p}if(p.skip>0){j=i+p.skip-1;x1+=this._calcCharsWidth(i,j);strBeg= j+1;i=j;continue}if(p.nl||p.hp){y1+=asc_round(l.th*zoom);l=self.lines[++n];x1=initX(i);dx=computeWordDeltaX()}}}if(strBeg<i)renderFragment(strBeg,i,p_,this.angle)};StringRender.prototype.getInternalState=function(){return{flags:this.flags,chars:this.chars,charWidths:this.charWidths,charProps:this.charProps,lines:this.lines}};StringRender.prototype.restoreInternalState=function(state){this.flags=state.flags;this.chars=state.chars;this.charWidths=state.charWidths;this.charProps=state.charProps;this.lines= state.lines;return this};StringRender.prototype._setFont=function(ctx,font){if(!font.isEqual(ctx.font)||this.fontNeedUpdate){ctx.setFont(font,this.angle);this.fontNeedUpdate=false;return true}return false};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].StringRender=StringRender})(window);"use strict";(function(window,undefined){var asc=window["Asc"];var asc_lastindexof=asc.lastIndexOf;function CharOffset(left,top,height,line){this.left=left;this.top=top;this.height= height;this.lineIndex=line}function CellTextRender(drawingCtx){AscCommonExcel.StringRender.apply(this,arguments);this.reWordBegining=new XRegExp("[^\\p{L}\\p{N}][\\p{L}\\p{N}]","i");return this}CellTextRender.prototype=Object.create(AscCommonExcel.StringRender.prototype);CellTextRender.prototype.constructor=CellTextRender;CellTextRender.prototype.getLinesCount=function(){return this.lines.length};CellTextRender.prototype.getLineInfo=function(index){return this.lines.length>0&&index>=0&&index<this.lines.length? this.lines[index]:null};CellTextRender.prototype.calcLineOffset=function(index){if(index<0)index=0;if(index>this.lines.length)index=this.lines.length;var zoom=this.drawingCtx.getZoom();for(var i=0,h=0,l=this.lines;i<index;++i)h+=Asc.round(l[i].th*zoom);return h};CellTextRender.prototype.getPrevChar=function(pos){return pos<=0?0:pos<=this.chars.length?pos-1:this.chars.length};CellTextRender.prototype.getNextChar=function(pos){return pos>=this.chars.length?this.chars.length:pos>=0?pos+1:0};CellTextRender.prototype.getPrevWord= function(pos){var i=asc_lastindexof(this.chars.slice(0,pos),this.reWordBegining);return i>=0?i+1:0};CellTextRender.prototype.getNextWord=function(pos){var i=this.chars.slice(pos).search(this.reWordBegining);return i>=0?pos+(i+1):this.getEndOfLine(pos)};CellTextRender.prototype.getBeginOfLine=function(pos){pos=pos<0?0:Math.min(pos,this.chars.length);for(var l=this.lines,i=0;i<l.length;++i)if(pos>=l[i].beg&&pos<=l[i].end)return l[i].beg;var lastLine=l.length-1;var lastChar=this.chars.length-1;return this.charWidths[lastChar]!== 0?l[lastLine].beg:pos};CellTextRender.prototype.getEndOfLine=function(pos){pos=pos<0?0:Math.min(pos,this.chars.length);var l=this.lines;var lastLine=l.length-1;for(var i=0;i<lastLine;++i)if(pos>=l[i].beg&&pos<=l[i].end)return l[i].end;var lastChar=this.chars.length-1;return pos>lastChar?pos:lastChar+(this.charWidths[lastChar]!==0?1:0)};CellTextRender.prototype.getBeginOfText=function(){return 0};CellTextRender.prototype.getEndOfText=function(){return this.chars.length};CellTextRender.prototype.getPrevLine= function(pos){pos=pos<0?0:Math.min(pos,this.chars.length);for(var l=this.lines,i=0;i<l.length;++i)if(pos>=l[i].beg&&pos<=l[i].end)return i<=0?0:Math.min(l[i-1].beg+pos-l[i].beg,l[i-1].end);var lastLine=l.length-1;var lastChar=this.chars.length-1;return this.charWidths[lastChar]===0||l.length<2?0>lastLine?0:l[lastLine].beg:lastChar>0?Math.min(l[lastLine-1].beg+pos-l[lastLine].beg,l[lastLine-1].end):0};CellTextRender.prototype.getNextLine=function(pos){pos=pos<0?0:Math.min(pos,this.chars.length);var l= this.lines;var lastLine=l.length-1;for(var i=0;i<lastLine;++i)if(pos>=l[i].beg&&pos<=l[i].end)return Math.min(l[i+1].beg+pos-l[i].beg,l[i+1].end);return this.chars.length};CellTextRender.prototype.getCharInfo=function(pos){for(var p=this.charProps[pos];(!p||!p.font)&&pos>0;--pos)p=this.charProps[pos-1];return{fsz:p.font.FontSize,dh:p&&p.lm&&p.lm.bl2>0?p.lm.bl2-p.lm.bl:0,h:p&&p.lm?p.lm.th:0}};CellTextRender.prototype.charOffset=function(pos,lineIndex,h){var zoom=this.drawingCtx.getZoom();var li=this.lines[lineIndex]; return new CharOffset(li.startX+(pos>0?this._calcCharsWidth(li.beg,pos-1):0),Asc.round(h*zoom),Asc.round(li.th*zoom),lineIndex)};CellTextRender.prototype.calcCharOffset=function(pos){var t=this,l=t.lines,i,h,co;if(l.length<1)return null;if(pos<0)pos=0;if(pos>t.chars.length)pos=t.chars.length;for(i=0,h=0;i<l.length;++i){if(pos>=l[i].beg&&pos<=l[i].end)return this.charOffset(pos,i,h);if(i!==l.length-1)h+=l[i].th}co=this.charOffset(pos,i-1,h);return co};CellTextRender.prototype.getCharsCount=function(){return this.chars.length}; CellTextRender.prototype.getChars=function(pos,len){return this.chars.slice(pos,pos+len)};CellTextRender.prototype.getCharWidth=function(pos){return this.charWidths[pos]};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].CellTextRender=CellTextRender})(window);"use strict";(function(window,undefined){var asc=window["Asc"];var AscBrowser=AscCommon.AscBrowser;var cElementType=AscCommonExcel.cElementType;var c_oAscCellEditorSelectState=AscCommonExcel.c_oAscCellEditorSelectState; var c_oAscCellEditorState=asc.c_oAscCellEditorState;var Fragment=AscCommonExcel.Fragment;var asc_getcvt=asc.getCvtRatio;var asc_round=asc.round;var asc_search=asc.search;var asc_lastidx=asc.lastIndexOf;var asc_HL=AscCommonExcel.HandlersList;var asc_incDecFonSize=asc.incDecFonSize;var kBeginOfLine=-1;var kBeginOfText=-2;var kEndOfLine=-3;var kEndOfText=-4;var kNextChar=-5;var kNextWord=-6;var kNextLine=-7;var kPrevChar=-8;var kPrevWord=-9;var kPrevLine=-10;var kPosition=-11;var kPositionLength=-12; var kNewLine="\n";function CellEditor(elem,input,fmgrGraphics,oFont,handlers,padding,menuEditor){this.element=elem;this.input=input;this.handlers=new asc_HL(handlers);this.options={};this.sides=undefined;this.menuEditor=menuEditor;this.canvasOuter=undefined;this.canvasOuterStyle=undefined;this.canvas=undefined;this.canvasOverlay=undefined;this.cursor=undefined;this.cursorStyle=undefined;this.cursorTID=undefined;this.cursorPos=0;this.beginCompositePos=-1;this.compositeLength=0;this.topLineIndex=0; this.m_oFont=oFont;this.fmgrGraphics=fmgrGraphics;this.drawingCtx=undefined;this.overlayCtx=undefined;this.textRender=undefined;this.textFlags=undefined;this.kx=1;this.ky=1;this.skipKeyPress=undefined;this.undoList=[];this.redoList=[];this.undoMode=false;this.noUpdateMode=false;this.selectionBegin=-1;this.selectionEnd=-1;this.isSelectMode=c_oAscCellEditorSelectState.no;this.hasCursor=false;this.hasFocus=false;this.newTextFormat=null;this.selectionTimer=undefined;this.enableKeyEvents=true;this.isTopLineActive= false;this.skipTLUpdate=true;this.loadFonts=false;this.isOpened=false;this.callTopLineMouseup=false;this.lastKeyCode=undefined;this.m_nEditorState=c_oAscCellEditorState.editEnd;this.fKeyMouseUp=null;this.fKeyMouseMove=null;this.objAutoComplete={};this.sAutoComplete=null;this.rangeChars=["=","-","+","*","/","(","{","<",">","^","!","&",":"," ","."];this.reNotFormula=new XRegExp("[^\\p{L}\\\\_\\]\\[\\p{N}\\.]","i");this.reFormula=new XRegExp("^([\\p{L}\\\\_\\]\\[][\\p{L}\\\\_\\]\\[\\p{N}\\.]*)","i"); this.defaults={padding:padding,selectColor:new AscCommon.CColor(190,190,255,.5),canvasZIndex:500,blinkInterval:500,cursorShape:"text"};this._formula=null;this._parseResult=null;this.needFindFirstFunction=null;this.lastRangePos=null;this.lastRangeLength=null;this.clickCounter=new AscFormat.ClickCounter;this._init();return this}CellEditor.prototype._init=function(){var t=this;var z=t.defaults.canvasZIndex;this.sAutoComplete=null;if(null!=this.element){var ceMenuEditor=this.getMenuEditorMode()?"-menu": "";var ceCanvasOuterId="ce-canvas-outer"+ceMenuEditor;var ceCanvasId="ce-canvas"+ceMenuEditor;var ceCanvasOverlay="ce-canvas-overlay"+ceMenuEditor;var ceCursor="ce-cursor"+ceMenuEditor;t.canvasOuter=document.createElement("div");t.canvasOuter.id=ceCanvasOuterId;t.canvasOuter.style.position="absolute";t.canvasOuter.style.display="none";t.canvasOuter.style.zIndex=z;var innerHTML="<canvas id="+ceCanvasId+' style="z-index: '+(z+1)+'"></canvas>';innerHTML+="<canvas id="+ceCanvasOverlay+' style="z-index: '+ (z+2)+"; cursor: "+t.defaults.cursorShape+'"></canvas>';innerHTML+="<div id="+ceCursor+' style="display: none; z-index: '+(z+3)+'"></div>';t.canvasOuter.innerHTML=innerHTML;this.element.appendChild(t.canvasOuter);t.canvasOuterStyle=t.canvasOuter.style;t.canvas=document.getElementById(ceCanvasId);t.canvasOverlay=document.getElementById(ceCanvasOverlay);t.cursor=document.getElementById(ceCursor);t.cursorStyle=t.cursor.style}t.drawingCtx=new asc.DrawingContext({canvas:t.canvas,units:0,fmgrGraphics:this.fmgrGraphics, font:this.m_oFont});t.overlayCtx=new asc.DrawingContext({canvas:t.canvasOverlay,units:0,fmgrGraphics:this.fmgrGraphics,font:this.m_oFont});t.textRender=new AscCommonExcel.CellTextRender(t.drawingCtx);if(t.canvasOuter&&t.canvasOuter.addEventListener){t.canvasOuter.addEventListener("mousedown",function(){return t._onMouseDown.apply(t,arguments)},false);t.canvasOuter.addEventListener("mouseup",function(){return t._onMouseUp.apply(t,arguments)},false);t.canvasOuter.addEventListener("mousemove",function(){return t._onMouseMove.apply(t, arguments)},false);t.canvasOuter.addEventListener("mouseleave",function(){return t._onMouseLeave.apply(t,arguments)},false)}if(t.input&&t.input.addEventListener){t.input.addEventListener("focus",function(){return t.isOpened?t._topLineGotFocus.apply(t,arguments):true},false);t.input.addEventListener("mousedown",function(){return t.isOpened?t.callTopLineMouseup=true:true},false);t.input.addEventListener("mouseup",function(){return t.isOpened?t._topLineMouseUp.apply(t,arguments):true},false);t.input.addEventListener("input", function(){return t._onInputTextArea.apply(t,arguments)},false);t.input.addEventListener("drop",function(e){e.preventDefault();return false},false)}this.fKeyMouseUp=function(){return t._onWindowMouseUp.apply(t,arguments)};this.fKeyMouseMove=function(){return t._onWindowMouseMove.apply(t,arguments)}};CellEditor.prototype.destroy=function(){};CellEditor.prototype.open=function(options){this._setEditorState(c_oAscCellEditorState.editStart);var b=this.input.selectionStart;this.isOpened=true;if(window.addEventListener){window.addEventListener("mouseup", this.fKeyMouseUp,false);window.addEventListener("mousemove",this.fKeyMouseMove,false)}this._setOptions(options);this._cleanLastRangeInfo();this._updateTopLineActive(true===this.input.isFocused);this._updateEditorState();this._draw();if(null!==options.enterOptions.newText){this._selectChars(kEndOfText);this._addChars(options.enterOptions.newText)}if(this.isTopLineActive&&typeof b!=="undefined"){if(this.cursorPos!==b)this._moveCursor(kPosition,b)}else if(options.enterOptions.cursorPos)this._moveCursor(kPosition, options.enterOptions.cursorPos);else if(options.enterOptions.eventPos){this._onMouseDown(options.enterOptions.eventPos);this._onMouseUp(options.enterOptions.eventPos)}else this._moveCursor(kEndOfText);this.setFocus(this.isTopLineActive?true:null===options.enterOptions.focus?this._haveTextInEdit():options.enterOptions.focus);this._updateUndoRedoChanged()};CellEditor.prototype.close=function(saveValue,callback){var opt=this.options;var t=this;var localSaveValueCallback=function(isSuccess){if(!isSuccess){t.setFocus(true); t.cleanSelectRange();if(callback)callback(false);return false}t.isOpened=false;t._formula=null;t._parseResult=null;if(!window["IS_NATIVE_EDITOR"]){if(window.removeEventListener){window.removeEventListener("mouseup",t.fKeyMouseUp,false);window.removeEventListener("mousemove",t.fKeyMouseMove,false)}t.input.blur();t._updateTopLineActive(false);t.input.isFocused=false;t._updateCursor();t._hideCanvas()}t.objAutoComplete={};t._setEditorState(c_oAscCellEditorState.editEnd);t.handlers.trigger("closed");if(callback)callback(true); else return true};if(saveValue)if(0<this.undoList.length||0<AscCommonExcel.getFragmentsLength(this.options.fragments)){var isFormula=this.isFormula();if(this.sAutoComplete&&!isFormula){this.selectionBegin=this.textRender.getBeginOfText();this.cursorPos=this.selectionEnd=this.textRender.getEndOfText();this.noUpdateMode=true;this._addChars(this.sAutoComplete);this.noUpdateMode=false}return opt.saveValueCallback(opt.fragments,this.textFlags,localSaveValueCallback)}this.isOpened=false;this._formula=null; this._parseResult=null;if(!window["IS_NATIVE_EDITOR"]){if(window.removeEventListener){window.removeEventListener("mouseup",this.fKeyMouseUp,false);window.removeEventListener("mousemove",this.fKeyMouseMove,false)}this.input.blur();this._updateTopLineActive(false);this.input.isFocused=false;this._updateCursor();this._hideCanvas()}this.objAutoComplete={};this._setEditorState(c_oAscCellEditorState.editEnd);this.handlers.trigger("closed");if(callback)callback(true);return true};CellEditor.prototype.setTextStyle= function(prop,val){if(this.isFormula())return;var t=this,opt=t.options,begin,end,i,first,last;if(t.selectionBegin!==t.selectionEnd){begin=Math.min(t.selectionBegin,t.selectionEnd);end=Math.max(t.selectionBegin,t.selectionEnd);if(end-begin<2)t.undoList.push({fn:t._addChars,args:[t.textRender.getChars(begin,1),begin]});else t.undoList.push({fn:t._addFragments,args:[t._getFragments(begin,end-begin),begin]});t._extractFragments(begin,end-begin);first=t._findFragment(begin);last=t._findFragment(end-1); if(first&&last){for(i=first.index;i<=last.index;++i){var valTmp=t._setFormatProperty(opt.fragments[i].format,prop,val);if(null===val)val=valTmp}t._mergeFragments();t._update();t._cleanSelection();t._drawSelection();t.undoList.push({fn:t._removeChars,args:[begin,end-begin]});t.redoList=[]}}else{first=t._findFragmentToInsertInto(t.cursorPos);if(first){if(!t.newTextFormat)t.newTextFormat=opt.fragments[first.index].format.clone();t._setFormatProperty(t.newTextFormat,prop,val);t._update()}}};CellEditor.prototype.empty= function(options){if(Asc.c_oAscCleanOptions.All!==options)return;this._removeChars()};CellEditor.prototype.undo=function(){this._performAction(this.undoList,this.redoList)};CellEditor.prototype.redo=function(){this._performAction(this.redoList,this.undoList)};CellEditor.prototype.getZoom=function(){return this.drawingCtx.getZoom()};CellEditor.prototype.changeZoom=function(factor){this.drawingCtx.changeZoom(factor);this.overlayCtx.changeZoom(factor)};CellEditor.prototype.canEnterCellRange=function(){if(this.lastRangePos!== null||this.handlers.trigger("getWizard"))return true;var res=false;var isSelection=this.selectionBegin!==this.selectionEnd;var curPos=isSelection?this.selectionBegin<this.selectionEnd?this.selectionBegin:this.selectionEnd:this.cursorPos;var prevChar=this.textRender.getChars(curPos-1,1);if(this.checkSymbolBeforeRange(prevChar)){this.lastRangePos=curPos;if(isSelection)this.lastRangeLength=Math.abs(this.selectionEnd-this.selectionBegin);res=true}return res};CellEditor.prototype.checkSymbolBeforeRange= function(char){return this.rangeChars.indexOf(char)>=0||char===AscCommon.FormulaSeparators.functionArgumentSeparator};CellEditor.prototype.changeCellRange=function(range,moveEndOfText){this.skipTLUpdate=false;this._moveCursor(kPosition,range.cursorePos);this._selectChars(kPositionLength,range.formulaRangeLength);this._addChars(range.getName(),undefined,true);if(moveEndOfText)this._moveCursor(kEndOfText);this.skipTLUpdate=true};CellEditor.prototype.changeCellText=function(str){this.skipTLUpdate=false; this._moveCursor(kPosition,this.lastRangePos);if(this.lastRangeLength)this._selectChars(kPositionLength,this.lastRangeLength);this._addChars(str,undefined,true);this.lastRangeLength=str.length;this.skipTLUpdate=true};CellEditor.prototype.insertFormula=function(functionName,isDefName){this.skipTLUpdate=false;if(this.selectionBegin!==this.selectionEnd)this._removeChars(undefined,undefined,true);var addText="";var text=AscCommonExcel.getFragmentsText(this.options.fragments);if(!this.isFormula()&&0=== this.cursorPos)addText="=";else if(functionName&&!this.checkSymbolBeforeRange(text[this.cursorPos-1]))addText="+";if(functionName){addText+=functionName;if(!isDefName)addText+="()"}if(addText){this._addChars(addText);if(functionName&&!isDefName){this._moveCursor(kPosition,this.cursorPos-1);this.lastRangePos=this.cursorPos;this.lastRangeLength=0}}this.skipTLUpdate=true};CellEditor.prototype.updateWizardMode=function(mode){this._updateCursorStyle(mode?AscCommonExcel.kCurCells:this.defaults.cursorShape)}; CellEditor.prototype.move=function(){if(!this.isOpened)return;if(this.handlers.trigger("isActive")&&this.options.checkVisible()){this.textFlags.wrapOnlyCE=false;this.sides=this.options.getSides();this.left=this.sides.cellX;this.top=this.sides.cellY;this.right=this.sides.r[this.sides.ri];this.bottom=this.sides.b[this.sides.bi];this._expand();this._adjustCanvas();this._showCanvas();this._renderText();this.topLineIndex=0;this._updateCursorPosition();this._updateCursor();this._drawSelection()}else this._hideCanvas()}; CellEditor.prototype.setFocus=function(hasFocus){this.hasFocus=!!hasFocus;this.handlers.trigger("gotFocus",this.hasFocus)};CellEditor.prototype.restoreFocus=function(){if(this.isTopLineActive)this.input.focus()};CellEditor.prototype.copySelection=function(){var t=this;var res=null;if(t.selectionBegin!==t.selectionEnd){var start=t.selectionBegin;var end=t.selectionEnd;if(start>end){var temp=start;start=end;end=temp}res=t._getFragments(start,end-start)}return res};CellEditor.prototype.cutSelection= function(){var t=this;var f=null;if(t.selectionBegin!==t.selectionEnd){var start=t.selectionBegin;var end=t.selectionEnd;if(start>end){var temp=start;start=end;end=temp}f=t._getFragments(start,end-start);t._removeChars()}return f};CellEditor.prototype.pasteText=function(text){text=text.replace(/\t/g," ");text=text.replace(/\r/g,"");text=text.replace(/^\n+|\n+$/g,"");if(0===text.length)return;this._addChars(text)};CellEditor.prototype.paste=function(fragments,cursorPos){if(!(fragments.length>0))return; var noUpdateMode=this.noUpdateMode;this.noUpdateMode=true;if(this.selectionBegin!==this.selectionEnd)this._removeChars();var length=AscCommonExcel.getFragmentsLength(fragments);var excess=this._checkMaxCellLength(length);if(excess){length-=excess;if(0===length){this.noUpdateMode=noUpdateMode;return false}this._extractFragments(0,length,fragments)}this._cleanFragments(fragments);this.undoList.push({fn:this._removeChars,args:[this.cursorPos,length]});this.redoList=[];this.noUpdateMode=noUpdateMode; this._addFragments(fragments,this.cursorPos);if(undefined!==cursorPos)this._moveCursor(kPosition,cursorPos)};CellEditor.prototype.enableKeyEventsHandler=function(flag){var oldValue=this.enableKeyEvents;this.enableKeyEvents=!!flag;if(this.isOpened&&oldValue!==this.enableKeyEvents)this._updateCursor()};CellEditor.prototype._isFormula=function(){var fragments=this.options.fragments;return fragments&&fragments.length>0&&fragments[0].text.length>0&&fragments[0].text.charAt(0)==="="};CellEditor.prototype.isFormula= function(){return c_oAscCellEditorState.editFormula===this.m_nEditorState};CellEditor.prototype._updateTextAlign=function(){this.textFlags.textAlign=this.options.flags.textAlign===AscCommon.align_Justify||this.isFormula()?AscCommon.align_Left:this.options.flags.textAlign};CellEditor.prototype.replaceText=function(pos,len,newText){this._moveCursor(kPosition,pos);this._selectChars(kPosition,pos+len);return this._addChars(newText)};CellEditor.prototype.setFontRenderingMode=function(){if(this.isOpened)this._draw()}; CellEditor.prototype.cleanSelectRange=function(){this._cleanLastRangeInfo();this.handlers.trigger("cleanSelectRange");this.handlers.trigger("onSelectionEnd")};CellEditor.prototype._setOptions=function(options){var opt=this.options=options;var ctx=this.drawingCtx;var u=ctx.getUnits();this.textFlags=opt.flags.clone();this._updateTextAlign();this.textFlags.shrinkToFit=false;this._cleanFragments(opt.fragments);this.textRender.setString(opt.fragments,this.textFlags);this.newTextFormat=null;if(opt.zoom> 0){this.overlayCtx.setFont(this.drawingCtx.getFont());this.changeZoom(opt.zoom)}this.kx=asc_getcvt(u,0,ctx.getPPIX());this.ky=asc_getcvt(u,0,ctx.getPPIY());this.sides=opt.getSides();this.left=this.sides.cellX;this.top=this.sides.cellY;this.right=this.sides.r[this.sides.ri];this.bottom=this.sides.b[this.sides.bi];this.cursorPos=0;this.topLineIndex=0;this.selectionBegin=-1;this.selectionEnd=-1;this.isSelectMode=c_oAscCellEditorSelectState.no;this.hasCursor=false;this.undoList=[];this.redoList=[];this.undoMode= false;this.skipKeyPress=false;this.updateWizardMode(false)};CellEditor.prototype._parseRangeStr=function(s){var range=AscCommonExcel.g_oRangeCache.getAscRange(s);return range?range.clone():null};CellEditor.prototype._parseFormulaRanges=function(){var s=AscCommonExcel.getFragmentsText(this.options.fragments);var ws=this.handlers.trigger("getActiveWS");var bbox=this.options.bbox;this._parseResult=new AscCommonExcel.ParseResult([],[]);this._parseResult.cursorPos=this.needFindFirstFunction?undefined: this.cursorPos-1;var cellWithFormula=new window["AscCommonExcel"].CCellWithFormula(ws,bbox.r1,bbox.c1);this._formula=new AscCommonExcel.parserFormula(s.substr(1),cellWithFormula,ws);this._formula.parse(true,true,this._parseResult,true);if(this.needFindFirstFunction){this.argPosArr=this._parseResult.argPosArr;this.needFindFirstFunction=null}var r,oper,wsName=null,bboxOper,range,isName=false;var oSelectionRange=new AscCommonExcel.SelectionRange(ws);oSelectionRange.ranges=[];if(this._parseResult.refPos&& this._parseResult.refPos.length>0)for(var index=0;index<this._parseResult.refPos.length;index++){wsName=null;isName=false;bboxOper=null;r=this._parseResult.refPos[index];oper=r.oper;if(cElementType.table===oper.type||cElementType.name===oper.type||cElementType.name3D===oper.type){oper=r.oper.toRef(bbox);if(oper instanceof AscCommonExcel.cError)continue;isName=true}if(cElementType.cell===oper.type||cElementType.cellsRange===oper.type||cElementType.cell3D===oper.type){wsName=oper.getWS().getName(); bboxOper=oper.getBBox0()}else if(cElementType.cellsRange3D===oper.type)if(oper.isSingleSheet()){wsName=oper.getWS().getName();bboxOper=oper.getBBox0NoCheck()}else if(oper.isBetweenSheet(ws)){wsName=ws.getName();bboxOper=oper.getBBox0NoCheck()}if(bboxOper){if(wsName&&ws&&ws.getName()!==wsName)continue;oSelectionRange.addRange();range=oSelectionRange.getLast();range.assign2(bboxOper);range.cursorePos=range.colorRangePos=r.start+1;range.formulaRangeLength=r.end-r.start;range.isName=isName}}this.handlers.trigger("newRanges", 0!==oSelectionRange.ranges.length?oSelectionRange:null)};CellEditor.prototype._findRangeUnderCursor=function(){var ranges,t=this,s=t.textRender.getChars(0,t.textRender.getCharsCount()),range,a;var arrFR=this.handlers.trigger("getFormulaRanges");if(arrFR){ranges=arrFR.ranges;for(var i=0,l=ranges.length;i<l;++i){a=ranges[i];if(t.cursorPos>=a.cursorePos&&t.cursorPos<=a.cursorePos+a.formulaRangeLength){range=a.clone(true);range.isName=a.isName;range.formulaRangeLength=a.formulaRangeLength;range.cursorePos= a.cursorePos;return{range:range}}}}var r,offset,_e,_s,wsName=null,ret=false,refStr,isName=false,_sColorPos,localStrObj;var ws=this.handlers.trigger("getActiveWS");var bbox=this.options.bbox;this._parseResult=new AscCommonExcel.ParseResult([],[]);var cellWithFormula=new window["AscCommonExcel"].CCellWithFormula(ws,bbox.r1,bbox.c1);this._formula=new AscCommonExcel.parserFormula(s.substr(1),cellWithFormula,ws);this._formula.parse(true,true,this._parseResult,bbox);if(this._parseResult.refPos&&this._parseResult.refPos.length> 0)for(var index=0;index<this._parseResult.refPos.length;index++){wsName=null;r=this._parseResult.refPos[index];offset=r.end;_e=r.end;_sColorPos=_s=r.start;switch(r.oper.type){case cElementType.cell:{wsName=ws.getName();refStr=r.oper.toLocaleString();ret=true;break}case cElementType.cell3D:{localStrObj=r.oper.toLocaleStringObj();refStr=localStrObj[1];ret=true;wsName=r.oper.getWS().getName();_s=_e-localStrObj[1].length+1;_sColorPos=_e-localStrObj[0].length;break}case cElementType.cellsRange:{wsName= ws.getName();refStr=r.oper.toLocaleString();ret=true;break}case cElementType.cellsRange3D:{if(!r.oper.isSingleSheet())continue;ret=true;localStrObj=r.oper.toLocaleStringObj();refStr=localStrObj[1];wsName=r.oper.getWS().getName();_s=_e-localStrObj[1].length+1;break}case cElementType.table:case cElementType.name:case cElementType.name3D:{var nameRef=r.oper.toRef(bbox);if(nameRef instanceof AscCommonExcel.cError)continue;switch(nameRef.type){case cElementType.cellsRange3D:{if(!nameRef.isSingleSheet())continue}case cElementType.cellsRange:case cElementType.cell3D:{ret= true;localStrObj=nameRef.toLocaleStringObj();refStr=localStrObj[1];wsName=nameRef.getWS().getName();_s=_e-localStrObj[1].length;break}}isName=true;break}default:continue}if(ret&&t.cursorPos>_s&&t.cursorPos<=_s+refStr.length){range=t._parseRangeStr(refStr);if(range){if(ws.getName()!==wsName)return{range:null};range.isName=isName;range.formulaRangeLength=refStr.length;range.cursorePos=_s;return{range:range,wsName:wsName}}}}range?range.isName=isName:null;range?range.formulaRangeLength=r.oper.value.length: null;range?range.cursorePos=_s:null;return!range?{range:null}:{range:range,wsName:wsName}};CellEditor.prototype._updateTopLineActive=function(state){if(state!==this.isTopLineActive){this.isTopLineActive=state;this.handlers.trigger("updateTopLine",this.isTopLineActive?c_oAscCellEditorState.editInFormulaBar:c_oAscCellEditorState.editInCell)}};CellEditor.prototype._updateEditorState=function(){if(this.getMenuEditorMode())return;var isFormula=this._isFormula();var editorState=isFormula?c_oAscCellEditorState.editFormula: ""===AscCommonExcel.getFragmentsText(this.options.fragments)?c_oAscCellEditorState.editEmptyCell:c_oAscCellEditorState.editText;this._setEditorState(editorState);this.handlers.trigger("updateFormulaEditMod",isFormula);if(isFormula)this._parseFormulaRanges()};CellEditor.prototype._cleanLastRangeInfo=function(){this.lastRangeLength=null;this.lastRangePos=null};CellEditor.prototype._updateUndoRedoChanged=function(){this.handlers.trigger("updateUndoRedoChanged",0<this.undoList.length,0<this.redoList.length)}; CellEditor.prototype._haveTextInEdit=function(){var fragments=this.options.fragments;return fragments.length>0&&fragments[0].text.length>0};CellEditor.prototype._setEditorState=function(editorState){if(this.m_nEditorState!==editorState){this.m_nEditorState=editorState;this.handlers.trigger("updateEditorState",this.m_nEditorState)}};CellEditor.prototype._getRenderFragments=function(){var opt=this.options,fragments=opt.fragments,i,k,l,first,last,val,lengthColors,tmpColors,colorIndex,uniqueColorIndex; if(this.isFormula()){var ranges=this.handlers.trigger("getFormulaRanges");if(ranges){fragments=[];for(i=0;i<opt.fragments.length;++i)fragments.push(opt.fragments[i].clone());lengthColors=AscCommonExcel.c_oAscFormulaRangeBorderColor.length;tmpColors=[];uniqueColorIndex=0;ranges=ranges.ranges;for(i=0,l=ranges.length;i<l;++i){val=ranges[i];colorIndex=asc.getUniqueRangeColor(ranges,i,tmpColors);if(null==colorIndex)colorIndex=uniqueColorIndex++;tmpColors.push(colorIndex);this._extractFragments(val.cursorePos, val.formulaRangeLength,fragments);first=this._findFragment(val.cursorePos,fragments);last=this._findFragment(val.cursorePos+val.formulaRangeLength-1,fragments);if(first&&last)for(k=first.index;k<=last.index;++k)fragments[k].format.setColor(AscCommonExcel.c_oAscFormulaRangeBorderColor[colorIndex%lengthColors])}}}return fragments};CellEditor.prototype._draw=function(){this._expand();this._cleanText();this._cleanSelection();this._adjustCanvas();this._showCanvas();this._renderText();if(!this.getMenuEditorMode())this.input.value= AscCommonExcel.getFragmentsText(this.options.fragments);this._updateCursorPosition();this._updateCursor()};CellEditor.prototype._update=function(){this._updateEditorState();if(this._expand())this._adjustCanvas();this._renderText();if(!this.getMenuEditorMode())this._fireUpdated();this._updateCursorPosition(true);this._updateCursor();this._updateUndoRedoChanged();if(window["IS_NATIVE_EDITOR"])window["native"]["onCellEditorChangeText"](AscCommonExcel.getFragmentsText(this.options.fragments))};CellEditor.prototype._fireUpdated= function(){var s=AscCommonExcel.getFragmentsText(this.options.fragments);var isFormula=-1===this.beginCompositePos&&s.charAt(0)==="=";var fPos,fName,match,fCurrent;if(!this.isTopLineActive||!this.skipTLUpdate||this.undoMode)this.input.value=s;if(isFormula){fPos=asc_lastidx(s,this.reNotFormula,this.cursorPos)+1;if(fPos>0)match=s.slice(fPos,this.cursorPos).match(this.reFormula);if(match)fName=match[1];else{fPos=undefined;fName=undefined}fCurrent=this._getEditableFunction(this._parseResult).func}this.handlers.trigger("updated", s,this.cursorPos,fPos,fName);this.handlers.trigger("updatedEditableFunction",fCurrent)};CellEditor.prototype._getEditableFunction=function(parseResult,bEndCurPos){var findOpenFunc=[],editableFunction=null,level=-1;if(!parseResult){var s=AscCommonExcel.getFragmentsText(this.options.fragments);var isFormula=-1===this.beginCompositePos&&s.charAt(0)==="=";if(isFormula){var pos=this.cursorPos;var ws=this.handlers.trigger("getActiveWS");var bbox=this.options.bbox;var endPos=pos;if(!bEndCurPos)for(var n= pos;n<s.length;n++)if("("===s[n])endPos=n;var formulaStr=s.substring(1,endPos);parseResult=new AscCommonExcel.ParseResult([],[]);var cellWithFormula=new window["AscCommonExcel"].CCellWithFormula(ws,bbox.r1,bbox.c1);var tempFormula=new AscCommonExcel.parserFormula(formulaStr,cellWithFormula,ws);tempFormula.parse(true,true,parseResult,true)}}var elements=parseResult?parseResult.elems:null;if(elements)for(var i=0;i<elements.length;i++){if(cElementType.func===elements[i].type&&elements[i+1]&&"("===elements[i+ 1].name){level++;findOpenFunc[level]={elem:elements[i],counter:1};i++}else if(-1!==level)if("("===elements[i].name)findOpenFunc[level].counter++;else if(")"===elements[i].name)findOpenFunc[level].counter--;if(level>-1&&findOpenFunc[level].counter===0){findOpenFunc.splice(level,1);level--}}if(findOpenFunc)for(var j=findOpenFunc.length-1;j>=0;j--)if(findOpenFunc[j].counter>0&&!(findOpenFunc[j].elem instanceof window["AscCommonExcel"].cUnknownFunction)){editableFunction=findOpenFunc[j].elem.name;break}return{func:editableFunction, argPos:parseResult?parseResult.argPos:null}};CellEditor.prototype._expand=function(){var bottom,tm;var doAdjust=false,fragments=this._getRenderFragments();if(0<fragments.length){bottom=this.bottom;this.bottom=this.sides.b[this.sides.bi];this._updateTextAlign();tm=this.textRender.measureString(fragments,this.textFlags,this._getContentWidth());if(!this.textFlags.wrapText&&!this.textFlags.wrapOnlyCE)while(tm.width>this._getContentWidth()){if(!this._expandWidth()){this.textFlags.wrapOnlyCE=true;tm=this.textRender.measureString(fragments, this.textFlags,this._getContentWidth());break}doAdjust=true}while(tm.height>this._getContentHeight()&&this._expandHeight());if(bottom!==this.bottom){if(bottom>this.bottom)this.topLineIndex=0;doAdjust=true;if(this.getMenuEditorMode)this.handlers.trigger("resizeEditorHeight")}}return doAdjust};CellEditor.prototype._expandWidth=function(){var i,l=-1,r=-1;if(AscCommon.align_Left===this.textFlags.textAlign||AscCommon.align_Center===this.textFlags.textAlign){var rightSide=this.sides.r;for(i=0;i<rightSide.length;++i)if(rightSide[i]> this.right){r=rightSide[i];break}}if(AscCommon.align_Right===this.textFlags.textAlign||AscCommon.align_Center===this.textFlags.textAlign){var leftSide=this.sides.l;for(i=0;i<leftSide.length;++i)if(leftSide[i]<this.left){l=leftSide[i];break}}if(AscCommon.align_Center===this.textFlags.textAlign){if(-1!==l&&-1!==r){var min=Math.min(this.left-l,r-this.right);this.left-=min;this.right+=min;return true}}else if(-1!==l){this.left=l;return true}else if(-1!==r){this.right=r;return true}return false};CellEditor.prototype._expandHeight= function(){var t=this,bottomSide=this.sides.b,i=asc_search(bottomSide,function(v){return v>t.bottom});if(i>=0){t.bottom=bottomSide[i];return true}var val=bottomSide[bottomSide.length-1];if(Math.abs(t.bottom-val)>1E-6)t.bottom=val;return false};CellEditor.prototype._cleanText=function(){this.drawingCtx.clear()};CellEditor.prototype._showCanvas=function(){this.canvasOuterStyle.display="block"};CellEditor.prototype._hideCanvas=function(){this.canvasOuterStyle.display="none"};CellEditor.prototype._adjustCanvas= function(){var isRetina=AscBrowser.isRetina;var z=this.defaults.canvasZIndex;var borderSize=1;var left=this.left*this.kx;var top=this.top*this.ky;var width,height,widthStyle,heightStyle;if(isRetina)borderSize=AscCommon.AscBrowser.convertToRetinaValue(borderSize,true);width=widthStyle=(this.right-this.left)*this.kx-borderSize;height=heightStyle=(this.bottom-this.top)*this.ky-borderSize;if(isRetina){left=AscCommon.AscBrowser.convertToRetinaValue(left);top=AscCommon.AscBrowser.convertToRetinaValue(top); widthStyle=AscCommon.AscBrowser.convertToRetinaValue(widthStyle);heightStyle=AscCommon.AscBrowser.convertToRetinaValue(heightStyle)}this.canvasOuterStyle.left=left+"px";this.canvasOuterStyle.top=top+"px";this.canvasOuterStyle.width=widthStyle+"px";this.canvasOuterStyle.height=heightStyle+"px";if(!this.getMenuEditorMode())this.canvasOuterStyle.zIndex=this.top<0?-1:z;this.canvas.width=this.canvasOverlay.width=width;this.canvas.height=this.canvasOverlay.height=height;this.canvas.style.width=this.canvasOverlay.style.width= widthStyle+"px";this.canvas.style.height=this.canvasOverlay.style.height=heightStyle+"px"};CellEditor.prototype._renderText=function(dy){var t=this,opt=t.options,ctx=t.drawingCtx;if(!window["IS_NATIVE_EDITOR"])ctx.setFillStyle(opt.background).fillRect(0,0,ctx.getWidth(),ctx.getHeight());if(opt.fragments.length>0)t.textRender.render(undefined,t._getContentLeft(),dy||0,t._getContentWidth(),opt.font.getColor())};CellEditor.prototype._cleanSelection=function(){this.overlayCtx.clear()};CellEditor.prototype._drawSelection= function(){var ctx=this.overlayCtx;var zoom=this.getZoom();var begPos,endPos,top,topLine,begInfo,endInfo,line,i,y,h,selection=[];function drawRect(x,y,w,h){if(window["IS_NATIVE_EDITOR"])selection.push([x,y,w,h]);else ctx.fillRect(x,y,w,h)}begPos=this.selectionBegin;endPos=this.selectionEnd;if(!window["IS_NATIVE_EDITOR"])ctx.setFillStyle(this.defaults.selectColor).clear();if(begPos!==endPos&&!this.isTopLineActive){top=this.textRender.calcLineOffset(this.topLineIndex);begInfo=this.textRender.calcCharOffset(Math.min(begPos, endPos));line=this.textRender.getLineInfo(begInfo.lineIndex);topLine=this.textRender.calcLineOffset(begInfo.lineIndex);endInfo=this.textRender.calcCharOffset(Math.max(begPos,endPos));h=asc_round(line.th*zoom);y=topLine-top;if(begInfo.lineIndex===endInfo.lineIndex)drawRect(begInfo.left,y,endInfo.left-begInfo.left,h);else{drawRect(begInfo.left,y,line.tw-begInfo.left+line.startX,h);for(i=begInfo.lineIndex+1,y+=h;i<endInfo.lineIndex;++i,y+=h){line=this.textRender.getLineInfo(i);h=asc_round(line.th*zoom); drawRect(line.startX,y,line.tw,h)}line=this.textRender.getLineInfo(endInfo.lineIndex);topLine=this.textRender.calcLineOffset(endInfo.lineIndex);if(line)drawRect(line.startX,topLine-top,endInfo.left-line.startX,asc_round(line.th*zoom))}}if(!this.isSelectMode)this.handlers.trigger("onSelectionEnd");return selection};CellEditor.prototype._updateCursorStyle=function(cursor){var newHtmlCursor=AscCommon.g_oHtmlCursor.value(cursor);if(this.canvasOverlay.style.cursor!==newHtmlCursor)this.canvasOverlay.style.cursor= newHtmlCursor};CellEditor.prototype._updateCursor=function(){if(window["IS_NATIVE_EDITOR"])return;if(!this.isOpened||this.options.enterOptions.hideCursor||this.isTopLineActive||!this.enableKeyEvents||this.handlers.trigger("getWizard"))this._hideCursor();else this._showCursor()};CellEditor.prototype.showCursor=function(){this.options.enterOptions.hideCursor=false;this._updateCursor()};CellEditor.prototype._showCursor=function(){var t=this;window.clearInterval(t.cursorTID);t.cursorStyle.display="block"; t.cursorTID=window.setInterval(function(){t.cursorStyle.display="none"===t.cursorStyle.display?"block":"none"},t.defaults.blinkInterval)};CellEditor.prototype._hideCursor=function(){window.clearInterval(this.cursorTID);this.cursorStyle.display="none"};CellEditor.prototype._updateCursorPosition=function(redrawText){var h=this.canvas.height;var y=-this.textRender.calcLineOffset(this.topLineIndex);var cur=this.textRender.calcCharOffset(this.cursorPos);var charsCount=this.textRender.getCharsCount();var curLeft= asc_round(((AscCommon.align_Right!==this.textFlags.textAlign||this.cursorPos!==charsCount)&&cur!==null&&cur.left!==null?cur.left:this._getContentPosition())*this.kx);var curTop=asc_round(((cur!==null?cur.top:0)+y)*this.ky);var curHeight=asc_round((cur!==null?cur.height:this._getContentHeight())*this.ky);var i,dy,nCount=this.textRender.getLinesCount();var zoom=this.getZoom();while(1<nCount){if(curTop+curHeight-1>h){i=i===undefined?0:i+1;if(i===nCount)break;dy=asc_round(this.textRender.getLineInfo(i).th* zoom);y-=dy;curTop-=asc_round(dy*this.ky);++this.topLineIndex;continue}if(curTop<0){--this.topLineIndex;if(this.textRender.lines&&this.textRender.lines.length&&this.topLineIndex>this.textRender.lines.length)this.topLineIndex=this.textRender.lines.length-1;dy=asc_round(this.textRender.getLineInfo(this.topLineIndex).th*zoom);y+=dy;curTop+=asc_round(dy*this.ky);continue}break}if(dy!==undefined||redrawText)this._renderText(y);if(AscBrowser.isRetina){curLeft=AscCommon.AscBrowser.convertToRetinaValue(curLeft); curTop=AscCommon.AscBrowser.convertToRetinaValue(curTop);curHeight=AscCommon.AscBrowser.convertToRetinaValue(curHeight)}this.curLeft=curLeft;this.curTop=curTop;this.curHeight=curHeight;if(!window["IS_NATIVE_EDITOR"]){this.cursorStyle.left=curLeft+"px";this.cursorStyle.top=curTop+"px";this.cursorStyle.height=curHeight+"px"}if(AscCommon.g_inputContext)AscCommon.g_inputContext.move(this.left*this.kx+curLeft,this.top*this.ky+curTop);if(cur)this.input.scrollTop=this.input.clientHeight*cur.lineIndex;if(this.isTopLineActive&& !this.skipTLUpdate)this._updateTopLineCurPos();if(this.getMenuEditorMode())this.handlers.trigger("updateMenuEditorCursorPosition",curTop,curHeight);this._updateSelectionInfo()};CellEditor.prototype._moveCursor=function(kind,pos){this.newTextFormat=null;var t=this;this.sAutoComplete=null;switch(kind){case kPrevChar:t.cursorPos=t.textRender.getPrevChar(t.cursorPos);break;case kNextChar:t.cursorPos=t.textRender.getNextChar(t.cursorPos);break;case kPrevWord:t.cursorPos=t.textRender.getPrevWord(t.cursorPos); break;case kNextWord:t.cursorPos=t.textRender.getNextWord(t.cursorPos);break;case kBeginOfLine:t.cursorPos=t.textRender.getBeginOfLine(t.cursorPos);break;case kEndOfLine:t.cursorPos=t.textRender.getEndOfLine(t.cursorPos);break;case kBeginOfText:t.cursorPos=t.textRender.getBeginOfText(t.cursorPos);break;case kEndOfText:t.cursorPos=t.textRender.getEndOfText(t.cursorPos);break;case kPrevLine:t.cursorPos=t.textRender.getPrevLine(t.cursorPos);break;case kNextLine:t.cursorPos=t.textRender.getNextLine(t.cursorPos); break;case kPosition:t.cursorPos=pos;break;case kPositionLength:t.cursorPos+=pos;break;default:return}if(t.selectionBegin!==t.selectionEnd){t.selectionBegin=t.selectionEnd=-1;t._cleanSelection()}t._updateCursorPosition();t._updateCursor()};CellEditor.prototype._findCursorPosition=function(coord){var t=this;var lc=t.textRender.getLinesCount();var i,h,w,li,chw;var zoom=this.getZoom();for(h=0,i=Math.max(t.topLineIndex,0);i<lc;++i){li=t.textRender.getLineInfo(i);h+=asc_round(li.th*zoom);if(coord.y<=h){for(w= li.startX,i=li.beg;i<=li.end;++i){chw=t.textRender.getCharWidth(i);if(coord.x<=w+chw)return coord.x<=w+chw/2?i:i+1>li.end?kEndOfLine:i+1;w+=chw}return i<t.textRender.getCharsCount()?i-1:kEndOfText}}return kNextLine};CellEditor.prototype._updateTopLineCurPos=function(){if(this.loadFonts)return;var isSelected=this.selectionBegin!==this.selectionEnd;var b=isSelected?this.selectionBegin:this.cursorPos;var e=isSelected?this.selectionEnd:this.cursorPos;if(this.input.setSelectionRange)this.input.setSelectionRange(Math.min(b, e),Math.max(b,e))};CellEditor.prototype._topLineGotFocus=function(){this._updateTopLineActive(true);this.input.isFocused=true;this.setFocus(true);this._updateCursor();this._cleanSelection()};CellEditor.prototype._topLineMouseUp=function(){this.callTopLineMouseup=false;this._delayedUpdateCursorByTopLine()};CellEditor.prototype._delayedUpdateCursorByTopLine=function(){var t=this;setTimeout(function(){t._updateCursorByTopLine()})};CellEditor.prototype._updateCursorByTopLine=function(){var b=this.input.selectionStart; var e=this.input.selectionEnd;if("backward"===this.input["selectionDirection"]){var tmp=b;b=e;e=tmp}if(typeof b!=="undefined"){if(this.cursorPos!==b||this.selectionBegin!==this.selectionEnd)this._moveCursor(kPosition,b);if(b!==e)this._selectChars(kPosition,e)}};CellEditor.prototype._syncEditors=function(){var t=this;var s1=AscCommonExcel.getFragmentsText(t.options.fragments);var s2=t.input.value;var l=Math.min(s1.length,s2.length);var i1=0,i2;while(i1<l&&s1.charAt(i1)===s2.charAt(i1))++i1;i2=i1+1; if(i2>=l)i2=Math.max(s1.length,s2.length);else while(i2<l&&s1.charAt(i1)!==s2.charAt(i2))++i2;t._addChars(s2.slice(i1,i2),i1)};CellEditor.prototype.getText=function(){return AscCommonExcel.getFragmentsText(this.options.fragments)};CellEditor.prototype._getContentLeft=function(){return this.defaults.padding};CellEditor.prototype._getContentWidth=function(){return this.right-this.left-2*this.defaults.padding+1};CellEditor.prototype._getContentHeight=function(){var t=this;return t.bottom-t.top};CellEditor.prototype._getContentPosition= function(){switch(this.textFlags.textAlign){case AscCommon.align_Right:return this.right-this.left-this.defaults.padding-1;case AscCommon.align_Center:return.5*(this.right-this.left)}return this.defaults.padding};CellEditor.prototype._wrapText=function(){this.textFlags.wrapOnlyNL=true};CellEditor.prototype._addCharCodes=function(arrCharCodes){return this._addChars(this.getTextFromCharCodes(arrCharCodes))};CellEditor.prototype._addChars=function(str,pos,isRange){if(!isRange)this.cleanSelectRange(); var opt=this.options,f,l,s;var noUpdateMode=this.noUpdateMode;this.noUpdateMode=true;this.sAutoComplete=null;if(this.selectionBegin!==this.selectionEnd){var copyFragment=this._findFragmentToInsertInto(Math.min(this.selectionBegin,this.selectionEnd)+1);if(copyFragment&&!this.newTextFormat)this.newTextFormat=opt.fragments[copyFragment.index].format.clone();this._removeChars(undefined,undefined,isRange)}var length=str.length;if(0!==length){var excess=this._checkMaxCellLength(length);if(excess){length-= excess;if(0===length){this.noUpdateMode=noUpdateMode;return length}str=str.slice(0,length)}if(pos===undefined)pos=this.cursorPos;if(!this.undoMode){this.undoList.push({fn:this._removeChars,args:[pos,length],isRange:isRange});this.redoList=[]}if(this.newTextFormat){var oNewObj=new Fragment({format:this.newTextFormat,text:str});this._addFragments([oNewObj],pos);this.newTextFormat=null}else{f=this._findFragmentToInsertInto(pos);if(f){l=pos-f.begin;s=opt.fragments[f.index].text;opt.fragments[f.index].text= s.slice(0,l)+str+s.slice(l)}}this.cursorPos=pos+str.length;if(-1!==str.indexOf(kNewLine))this._wrapText()}this.noUpdateMode=noUpdateMode;if(!this.noUpdateMode)this._update();return length};CellEditor.prototype._addNewLine=function(){this._wrapText();this._addChars(kNewLine)};CellEditor.prototype._removeChars=function(pos,length,isRange){var t=this,opt=t.options,b,e,l,first,last;if(!isRange)this.cleanSelectRange();this.sAutoComplete=null;if(t.selectionBegin!==t.selectionEnd){b=Math.min(t.selectionBegin, t.selectionEnd);e=Math.max(t.selectionBegin,t.selectionEnd);t.selectionBegin=t.selectionEnd=-1;t._cleanSelection()}else if(length===undefined)switch(pos){case kPrevChar:b=t.textRender.getPrevChar(t.cursorPos);e=t.cursorPos;break;case kNextChar:b=t.cursorPos;e=t.textRender.getNextChar(t.cursorPos);break;case kPrevWord:b=t.textRender.getPrevWord(t.cursorPos);e=t.cursorPos;break;case kNextWord:b=t.cursorPos;e=t.textRender.getNextWord(t.cursorPos);break;default:return}else{b=pos;e=pos+length}if(b===e)return; first=t._findFragment(b);last=t._findFragment(e-1);if(!t.undoMode){if(e-b<2&&opt.fragments[first.index].text.length>1)t.undoList.push({fn:t._addChars,args:[t.textRender.getChars(b,1),b],isRange:isRange});else t.undoList.push({fn:t._addFragments,args:[t._getFragments(b,e-b),b],isRange:isRange});t.redoList=[]}if(first&&last){if(first.index===last.index){l=opt.fragments[first.index].text;opt.fragments[first.index].text=l.slice(0,b-first.begin)+l.slice(e-first.begin)}else{opt.fragments[first.index].text= opt.fragments[first.index].text.slice(0,b-first.begin);opt.fragments[last.index].text=opt.fragments[last.index].text.slice(e-last.begin);l=last.index-first.index;if(l>1)opt.fragments.splice(first.index+1,l-1)}t._mergeFragments()}t.cursorPos=b;if(!t.noUpdateMode)t._update()};CellEditor.prototype._selectChars=function(kind,pos){var t=this;var begPos,endPos;this.sAutoComplete=null;begPos=t.selectionBegin===t.selectionEnd?t.cursorPos:t.selectionBegin;t._moveCursor(kind,pos);endPos=t.cursorPos;t.selectionBegin= begPos;t.selectionEnd=endPos;t._drawSelection();if(t.isTopLineActive&&!t.skipTLUpdate)t._updateTopLineCurPos()};CellEditor.prototype._changeSelection=function(coord){var t=this;function doChangeSelection(coordTmp){if(c_oAscCellEditorSelectState.word===t.isSelectMode)return;var pos=t._findCursorPosition(coordTmp);if(pos!==undefined)pos>=0?t._selectChars(kPosition,pos):t._selectChars(pos)}if(window["IS_NATIVE_EDITOR"])doChangeSelection(coord);else{window.clearTimeout(t.selectionTimer);t.selectionTimer= window.setTimeout(function(){doChangeSelection(coord)},0)}};CellEditor.prototype._findFragment=function(pos,fragments){var i,begin,end;if(!fragments)fragments=this.options.fragments;for(i=0,begin=0;i<fragments.length;++i){end=begin+fragments[i].text.length;if(pos>=begin&&pos<end)return{index:i,begin:begin,end:end};if(i<fragments.length-1)begin=end}return pos===end?{index:i-1,begin:begin,end:end}:undefined};CellEditor.prototype._findFragmentToInsertInto=function(pos){var opt=this.options,i,begin,end; for(i=0,begin=0;i<opt.fragments.length;++i){end=begin+opt.fragments[i].text.length;if(pos>=begin&&pos<=end)return{index:i,begin:begin,end:end};if(i<opt.fragments.length-1)begin=end}return undefined};CellEditor.prototype._isWholeFragment=function(pos,len){var fr=this._findFragment(pos);return fr&&pos===fr.begin&&len===fr.end-fr.begin};CellEditor.prototype._splitFragment=function(f,pos,fragments){var fr;if(!fragments)fragments=this.options.fragments;if(pos>f.begin&&pos<f.end){fr=fragments[f.index]; Array.prototype.splice.apply(fragments,[f.index,1].concat([new Fragment({format:fr.format.clone(),text:fr.text.slice(0,pos-f.begin)}),new Fragment({format:fr.format.clone(),text:fr.text.slice(pos-f.begin)})]))}};CellEditor.prototype._getFragments=function(startPos,length){var t=this,opt=t.options,endPos=startPos+length-1,res=[],fr,i;var first=t._findFragment(startPos);var last=t._findFragment(endPos);if(!first||!last)throw"Can not extract fragment of text";if(first.index===last.index){fr=opt.fragments[first.index].clone(); fr.text=fr.text.slice(startPos-first.begin,endPos-first.begin+1);res.push(fr)}else{fr=opt.fragments[first.index].clone();fr.text=fr.text.slice(startPos-first.begin);res.push(fr);for(i=first.index+1;i<last.index;++i){fr=opt.fragments[i].clone();res.push(fr)}fr=opt.fragments[last.index].clone();fr.text=fr.text.slice(0,endPos-last.begin+1);res.push(fr)}return res};CellEditor.prototype._extractFragments=function(startPos,length,fragments){var fr;fr=this._findFragment(startPos,fragments);if(!fr)throw"Can not extract fragment of text"; this._splitFragment(fr,startPos,fragments);fr=this._findFragment(startPos+length,fragments);if(!fr)throw"Can not extract fragment of text";this._splitFragment(fr,startPos+length,fragments)};CellEditor.prototype._addFragments=function(f,pos){var t=this,opt=t.options,fr;fr=t._findFragment(pos);if(fr&&pos<fr.end){t._splitFragment(fr,pos);fr=t._findFragment(pos);Array.prototype.splice.apply(opt.fragments,[fr.index,0].concat(f))}else opt.fragments=opt.fragments.concat(f);t._mergeFragments();t.cursorPos= pos+AscCommonExcel.getFragmentsLength(f);if(!t.noUpdateMode)t._update()};CellEditor.prototype._mergeFragments=function(){var t=this,opt=t.options,i;for(i=0;i<opt.fragments.length;){if(opt.fragments[i].text.length<1&&opt.fragments.length>1){opt.fragments.splice(i,1);continue}if(i<opt.fragments.length-1){var fr=opt.fragments[i];var nextFr=opt.fragments[i+1];if(fr.format.isEqual(nextFr.format)){opt.fragments.splice(i,2,new Fragment({format:fr.format,text:fr.text+nextFr.text}));continue}}++i}};CellEditor.prototype._cleanFragments= function(fr){var t=this,i,s,f,wrap=t.textFlags.wrapText||t.textFlags.wrapOnlyNL;for(i=0;i<fr.length;++i){s=fr[i].text;if(!wrap&&-1!==s.indexOf(kNewLine))this._wrapText();fr[i].text=s;f=fr[i].format;if(f.getName()==="")f.setName(t.options.font.getName());if(f.getSize()===0)f.setSize(t.options.font.getSize())}};CellEditor.prototype._setFormatProperty=function(format,prop,val){switch(prop){case "fn":format.setName(val);format.setScheme(null);break;case "fs":format.setSize(val);break;case "b":var bold= format.getBold();val=null===val?bold?!bold:true:val;format.setBold(val);break;case "i":var italic=format.getItalic();val=null===val?italic?!italic:true:val;format.setItalic(val);break;case "u":var underline=format.getUnderline();val=null===val?Asc.EUnderline.underlineNone===underline?Asc.EUnderline.underlineSingle:Asc.EUnderline.underlineNone:val;format.setUnderline(val);break;case "s":var strikeout=format.getStrikeout();val=null===val?strikeout?!strikeout:true:val;format.setStrikeout(val);break; case "fa":format.setVerticalAlign(val);break;case "c":format.setColor(val);break;case "changeFontSize":var newFontSize=asc_incDecFonSize(val,format.getSize());if(null!==newFontSize)format.setSize(newFontSize);break}return val};CellEditor.prototype._performAction=function(list1,list2){var t=this,action,str,pos,len;if(list1.length<1)return;action=list1.pop();if(action.fn===t._removeChars){pos=action.args[0];len=action.args[1];if(len<2&&!t._isWholeFragment(pos,len))list2.push({fn:t._addChars,args:[t.textRender.getChars(pos, len),pos],isRange:action.isRange});else list2.push({fn:t._addFragments,args:[t._getFragments(pos,len),pos],isRange:action.isRange})}else if(action.fn===t._addChars){str=action.args[0];pos=action.args[1];list2.push({fn:t._removeChars,args:[pos,str.length],isRange:action.isRange})}else if(action.fn===t._addFragments){pos=action.args[1];len=AscCommonExcel.getFragmentsLength(action.args[0]);list2.push({fn:t._removeChars,args:[pos,len],isRange:action.isRange})}else return;t.undoMode=true;if(t.selectionBegin!== t.selectionEnd){t.selectionBegin=t.selectionEnd=-1;t._cleanSelection()}action.fn.apply(t,action.args);t.undoMode=false};CellEditor.prototype._tryCloseEditor=function(event){var t=this;var callback=function(success){var applyByArray=t.textFlags&&t.textFlags.ctrlKey;if(!applyByArray&&success)t.handlers.trigger("applyCloseEvent",event)};this.close(true,callback)};CellEditor.prototype._getAutoComplete=function(str){var oLastResult=this.objAutoComplete[str];if(oLastResult)return oLastResult;var arrAutoComplete= this.options.autoComplete;var arrAutoCompleteLC=this.options.autoCompleteLC;var i,length,arrResult=[];for(i=0,length=arrAutoCompleteLC.length;i<length;++i)if(arrAutoCompleteLC[i].length!==str.length&&0===arrAutoCompleteLC[i].indexOf(str))arrResult.push(arrAutoComplete[i]);return this.objAutoComplete[str]=arrResult};CellEditor.prototype._updateSelectionInfo=function(){var f=this._findFragmentToInsertInto(this.cursorPos);if(!f)return;var xfs=new AscCommonExcel.CellXfs;xfs.setFont(this.newTextFormat|| this.options.fragments[f.index].format);this.handlers.trigger("updateEditorSelectionInfo",xfs)};CellEditor.prototype._checkMaxCellLength=function(length){var count=AscCommonExcel.getFragmentsLength(this.options.fragments)+length-Asc.c_oAscMaxCellOrCommentLength;return 0>count?0:count};CellEditor.prototype._onWindowKeyDown=function(event,isInput){var t=this,kind=undefined,hieroglyph=false;var ctrlKey=!AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);if(this.handlers.trigger("getWizard")|| !t.isOpened||!isInput&&!t.enableKeyEvents)return true;if(event.which===18)t.lastKeyCode=event.which;t.skipKeyPress=true;t.skipTLUpdate=false;if(t.isTopLineActive&&AscCommonExcel.getFragmentsLength(t.options.fragments)!==t.input.value.length)hieroglyph=true;switch(event.which){case 27:if(t.handlers.trigger("isGlobalLockEditCell")||this.getMenuEditorMode())return false;t.close();event.stopPropagation();event.preventDefault();return false;case 13:if(window["IS_NATIVE_EDITOR"])t._addNewLine();else if(!(event.altKey&& event.shiftKey))if(event.altKey)t._addNewLine();else if(this.getMenuEditorMode())t._addNewLine();else if(false===t.handlers.trigger("isGlobalLockEditCell")){if(t.textFlags){t.textFlags.ctrlKey=event.ctrlKey;t.textFlags.shiftKey=event.shiftKey}t._tryCloseEditor(event)}event.stopPropagation();event.preventDefault();return false;case 9:if(hieroglyph)t._syncEditors();if(false===t.handlers.trigger("isGlobalLockEditCell"))t._tryCloseEditor(event);return false;case 8:if(!this.enableKeyEvents)break;if(!window["IS_NATIVE_EDITOR"]){event.stopPropagation(); event.preventDefault();if(hieroglyph)t._syncEditors()}t._removeChars(ctrlKey?kPrevWord:kPrevChar);return false;case 46:if(!this.enableKeyEvents||event.shiftKey)break;if(hieroglyph)t._syncEditors();event.stopPropagation();event.preventDefault();t._removeChars(ctrlKey?kNextWord:kNextChar);return true;case 37:if(!this.enableKeyEvents){this._delayedUpdateCursorByTopLine();break}event.stopPropagation();event.preventDefault();if(!t.hasFocus)break;if(hieroglyph)t._syncEditors();kind=ctrlKey?kPrevWord:kPrevChar; event.shiftKey?t._selectChars(kind):t._moveCursor(kind);return false;case 39:if(!this.enableKeyEvents){this._delayedUpdateCursorByTopLine();break}event.stopPropagation();event.preventDefault();if(!t.hasFocus)break;if(hieroglyph)t._syncEditors();kind=ctrlKey?kNextWord:kNextChar;event.shiftKey?t._selectChars(kind):t._moveCursor(kind);return false;case 38:if(!this.enableKeyEvents){this._delayedUpdateCursorByTopLine();break}event.stopPropagation();event.preventDefault();if(!t.hasFocus)break;if(hieroglyph)t._syncEditors(); event.shiftKey?t._selectChars(kPrevLine):t._moveCursor(kPrevLine);return false;case 40:if(!this.enableKeyEvents){this._delayedUpdateCursorByTopLine();break}event.stopPropagation();event.preventDefault();if(!t.hasFocus)break;if(hieroglyph)t._syncEditors();event.shiftKey?t._selectChars(kNextLine):t._moveCursor(kNextLine);return false;case 35:if(!this.enableKeyEvents)break;event.stopPropagation();event.preventDefault();if(!t.hasFocus)break;if(hieroglyph)t._syncEditors();kind=ctrlKey?kEndOfText:kEndOfLine; event.shiftKey?t._selectChars(kind):t._moveCursor(kind);return false;case 36:if(!this.enableKeyEvents)break;event.stopPropagation();event.preventDefault();if(!t.hasFocus)break;if(hieroglyph)t._syncEditors();kind=ctrlKey?kBeginOfText:kBeginOfLine;event.shiftKey?t._selectChars(kind):t._moveCursor(kind);return false;case 53:if(ctrlKey){event.stopPropagation();event.preventDefault();if(hieroglyph)t._syncEditors();t.setTextStyle("s",null);return true}break;case 65:if(ctrlKey){if(!t.hasFocus)t.setFocus(true); if(!t.isTopLineActive){event.stopPropagation();event.preventDefault()}t._moveCursor(kBeginOfText);t._selectChars(kEndOfText);return true}break;case 66:if(ctrlKey){event.stopPropagation();event.preventDefault();if(hieroglyph)t._syncEditors();t.setTextStyle("b",null);return true}break;case 73:if(ctrlKey){event.stopPropagation();event.preventDefault();if(hieroglyph)t._syncEditors();t.setTextStyle("i",null);return true}break;case 85:if(ctrlKey){event.stopPropagation();event.preventDefault();if(hieroglyph)t._syncEditors(); t.setTextStyle("u",null);return true}break;case 144:case 145:if(AscBrowser.isOpera){event.stopPropagation();event.preventDefault()}return false;case 80:if(ctrlKey){event.stopPropagation();event.preventDefault();return false}break;case 89:case 90:if(ctrlKey){event.stopPropagation();event.preventDefault();event.which===90?t.undo():t.redo();return false}break;case 113:if(AscBrowser.isOpera){event.stopPropagation();event.preventDefault()}return false;case 115:var res=this._findRangeUnderCursor();if(res.range){res.range.switchReference(); this.changeCellRange(res.range)}event.stopPropagation();event.preventDefault();return false;case 186:if(ctrlKey){var api=window["Asc"]["editor"];var oDate=new Asc.cDate;t._addChars(event.shiftKey?oDate.getTimeString(api):oDate.getDateString(api));event.stopPropagation();event.preventDefault()}t.skipKeyPress=false;return false}t.skipKeyPress=false;t.skipTLUpdate=true;return true};CellEditor.prototype._onWindowKeyPress=function(event){var t=this;if(!window["IS_NATIVE_EDITOR"]){if(!t.isOpened||!t.enableKeyEvents|| this.handlers.trigger("getWizard"))return true;if(t.skipKeyPress||event.which<32){t.skipKeyPress=true;return true}if(t.isTopLineActive&&AscCommonExcel.getFragmentsLength(t.options.fragments)!==t.input.value.length)t._syncEditors()}var tmpCursorPos;var newChar=String.fromCharCode(event.which);t._addChars(newChar);if(t.options.isAddPersentFormat&&AscCommon.isNumber(newChar)){t.options.isAddPersentFormat=false;tmpCursorPos=t.cursorPos;t.undoMode=true;t._addChars("%");t.cursorPos=tmpCursorPos;t.undoMode= false;t._updateCursorPosition()}if(t.textRender.getEndOfText()===t.cursorPos&&!t.isFormula()){var s=AscCommonExcel.getFragmentsText(t.options.fragments);if(!AscCommon.isNumber(s)){var arrAutoComplete=t._getAutoComplete(s.toLowerCase());var lengthInput=s.length;if(1===arrAutoComplete.length){var newValue=arrAutoComplete[0];tmpCursorPos=t.cursorPos;t._addChars(newValue.substring(lengthInput));t.selectionBegin=tmpCursorPos;t._selectChars(kEndOfText);this.sAutoComplete=newValue}}}return t.isTopLineActive}; CellEditor.prototype._onWindowKeyUp=function(event){var t=this;if(t.lastKeyCode===18&&event.which===18)return false};CellEditor.prototype._onWindowMouseUp=function(event){AscCommon.global_mouseEvent.UnLockMouse();if(c_oAscCellEditorSelectState.no!==this.isSelectMode)this.cleanSelectRange();this.isSelectMode=c_oAscCellEditorSelectState.no;if(this.callTopLineMouseup)this._topLineMouseUp();return true};CellEditor.prototype._onWindowMouseMove=function(event){if(c_oAscCellEditorSelectState.no!==this.isSelectMode&& !this.hasCursor)this._changeSelection(this._getCoordinates(event));return true};CellEditor.prototype._onMouseDown=function(event){if(AscCommon.g_inputContext&&AscCommon.g_inputContext.externalChangeFocus())return;if(this.handlers.trigger("getWizard"))return this.handlers.trigger("onMouseDown",event);AscCommon.global_mouseEvent.LockMouse();var pos;var button=AscCommon.getMouseButton(event);var coord=this._getCoordinates(event);if(!window["IS_NATIVE_EDITOR"])this.clickCounter.mouseDownEvent(coord.x, coord.y,button);this.setFocus(true);this._updateTopLineActive(false);this.input.isFocused=false;if(0===button)if(1===this.clickCounter.getClickCount()%2){this.isSelectMode=c_oAscCellEditorSelectState.char;if(!event.shiftKey){this._updateCursor();pos=this._findCursorPosition(coord);if(pos!==undefined)pos>=0?this._moveCursor(kPosition,pos):this._moveCursor(pos)}else this._changeSelection(coord)}else{this.isSelectMode=c_oAscCellEditorSelectState.word;var endWord=this.textRender.getNextWord(this.cursorPos); var startWord=this.textRender.getPrevWord(endWord);this._moveCursor(kPosition,startWord);this._selectChars(kPosition,endWord)}else if(2===button)this.handlers.trigger("onContextMenu",event);return true};CellEditor.prototype._onMouseUp=function(event){var button=AscCommon.getMouseButton(event);AscCommon.global_mouseEvent.UnLockMouse();if(2===button)return true;if(c_oAscCellEditorSelectState.no!==this.isSelectMode)this.cleanSelectRange();this.isSelectMode=c_oAscCellEditorSelectState.no;return true}; CellEditor.prototype._onMouseMove=function(event){var coord=this._getCoordinates(event);this.clickCounter.mouseMoveEvent(coord.x,coord.y);this.hasCursor=true;if(c_oAscCellEditorSelectState.no!==this.isSelectMode)this._changeSelection(coord);return true};CellEditor.prototype._onMouseLeave=function(event){this.hasCursor=false;return true};CellEditor.prototype._onInputTextArea=function(event){var t=this;if(!this.handlers.trigger("canEdit")||this.loadFonts)return true;this.loadFonts=true;AscFonts.FontPickerByCharacter.checkText(this.input.value, this,function(){t.loadFonts=false;t.skipTLUpdate=true;var length=t.replaceText(0,t.textRender.getEndOfText(),t.input.value);t._updateCursorByTopLine();if(length!==t.input.value.length){t.input.value=AscCommonExcel.getFragmentsText(t.options.fragments);t._updateTopLineCurPos()}});return true};CellEditor.prototype._getCoordinates=function(event){if(window["IS_NATIVE_EDITOR"])return{x:event.pageX,y:event.pageY};var offs=this.canvasOverlay.getBoundingClientRect();var x=((event.pageX*AscBrowser.zoom>> 0)-offs.left)/this.kx;var y=((event.pageY*AscBrowser.zoom>>0)-offs.top)/this.ky;if(AscBrowser.isRetina){x*=AscCommon.AscBrowser.retinaPixelRatio;y*=AscCommon.AscBrowser.retinaPixelRatio}return{x:x,y:y}};CellEditor.prototype.getTextFromCharCodes=function(arrCharCodes){var code,codePt,newText="";for(var i=0;i<arrCharCodes.length;++i){code=arrCharCodes[i];if(code<65536)newText+=String.fromCharCode(code);else{codePt=code-65536;newText+=String.fromCharCode(55296+(codePt>>10),56320+(codePt&1023))}}return newText}; CellEditor.prototype.Begin_CompositeInput=function(){if(this.selectionBegin===this.selectionEnd){this.beginCompositePos=this.cursorPos;this.compositeLength=0}else{this.beginCompositePos=Math.min(this.selectionBegin,this.selectionEnd);this.compositeLength=Math.max(this.selectionBegin,this.selectionEnd)-this.beginCompositePos}this.setTextStyle("u",Asc.EUnderline.underlineSingle)};CellEditor.prototype.Replace_CompositeText=function(arrCharCodes){if(!this.isOpened)return;var newText=this.getTextFromCharCodes(arrCharCodes); this.compositeLength=this.replaceText(this.beginCompositePos,this.compositeLength,newText);var tmpBegin=this.selectionBegin,tmpEnd=this.selectionEnd;this.selectionBegin=this.beginCompositePos;this.selectionEnd=this.beginCompositePos+this.compositeLength;this.setTextStyle("u",Asc.EUnderline.underlineSingle);this.selectionBegin=tmpBegin;this.selectionEnd=tmpEnd;this._cleanSelection();this._drawSelection()};CellEditor.prototype.End_CompositeInput=function(){var tmpBegin=this.selectionBegin,tmpEnd=this.selectionEnd; this.selectionBegin=this.beginCompositePos;this.selectionEnd=this.beginCompositePos+this.compositeLength;this.setTextStyle("u",Asc.EUnderline.underlineNone);this.beginCompositePos=-1;this.compositeLength=0;this.selectionBegin=tmpBegin;this.selectionEnd=tmpEnd;this._cleanSelection();this._drawSelection()};CellEditor.prototype.Set_CursorPosInCompositeText=function(nPos){if(-1!==this.beginCompositePos){nPos=Math.min(nPos,this.compositeLength);this._moveCursor(kPosition,this.beginCompositePos+nPos)}}; CellEditor.prototype.Get_CursorPosInCompositeText=function(){return this.cursorPos-this.beginCompositePos};CellEditor.prototype.Get_MaxCursorPosInCompositeText=function(){return this.compositeLength};CellEditor.prototype.getMenuEditorMode=function(){return this.menuEditor};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].CellEditor=CellEditor})(window);"use strict";(function($,window,undefined){var AscBrowser=AscCommon.AscBrowser;var asc=window["Asc"]?window["Asc"]:window["Asc"]= {};var asc_applyFunction=AscCommonExcel.applyFunction;var c_oTargetType=AscCommonExcel.c_oTargetType;function asc_CEventsController(){this.settings={vscrollStep:10,hscrollStep:10,scrollTimeout:20,wheelScrollLinesV:3};this.view=undefined;this.widget=undefined;this.element=undefined;this.handlers=undefined;this.vsb=undefined;this.vsbApi=undefined;this.vsbMax=undefined;this.hsb=undefined;this.hsbApi=undefined;this.hsbMax=undefined;this.resizeTimerId=undefined;this.scrollTimerId=undefined;this.moveRangeTimerId= undefined;this.moveResizeRangeTimerId=undefined;this.fillHandleModeTimerId=undefined;this.enableKeyEvents=true;this.isSelectMode=false;this.hasCursor=false;this.hasFocus=false;this.skipKeyPress=undefined;this.lastKeyCode=undefined;this.targetInfo=undefined;this.isResizeMode=false;this.isResizeModeMove=false;this.isFillHandleMode=false;this.isMoveRangeMode=false;this.isMoveResizeRange=false;this.frozenAnchorMode=false;this.clickCounter=new AscFormat.ClickCounter;this.isMousePressed=false;this.isShapeAction= false;this.isUpOnCanvas=false;this.isDblClickInMouseDown=false;this.isDoBrowserDblClick=false;this.mouseDownLastCord=null;this.vsbApiLockMouse=false;this.hsbApiLockMouse=false;this.isRowGroup=false;this.smoothWheelCorrector=null;if(AscCommon.AscBrowser.isMacOs){this.smoothWheelCorrector=new AscCommon.CMouseSmoothWheelCorrector(this,function(deltaX,deltaY){if(deltaX){deltaX=Math.sign(deltaX)*Math.ceil(Math.abs(deltaX/3));this.scrollHorizontal(deltaX,null)}if(deltaY){deltaY=Math.sign(deltaY)*Math.ceil(Math.abs(deltaY* this.settings.wheelScrollLinesV/3));this.scrollVertical(deltaY,null)}});this.smoothWheelCorrector.setNormalDeltaActive(3)}return this}asc_CEventsController.prototype.init=function(view,widgetElem,canvasElem,handlers){var self=this;this.view=view;this.widget=widgetElem;this.element=canvasElem;this.handlers=new AscCommonExcel.asc_CHandlersList(handlers);this._createScrollBars();if(this.view.Api.isMobileVersion){window.addEventListener("resize",function(){self._onWindowResize.apply(self,arguments)}, false);return this}if(window.addEventListener){window.addEventListener("resize",function(){self._onWindowResize.apply(self,arguments)},false);window.addEventListener("mousemove",function(){return self._onWindowMouseMove.apply(self,arguments)},false);window.addEventListener("mouseup",function(){return self._onWindowMouseUp.apply(self,arguments)},false);window.addEventListener("mouseleave",function(){return self._onWindowMouseLeaveOut.apply(self,arguments)},false);window.addEventListener("mouseout", function(){return self._onWindowMouseLeaveOut.apply(self,arguments)},false)}if(this.element.onselectstart)this.element.onselectstart=function(){return false};if(this.element.addEventListener){this.element.addEventListener("mousedown",function(){return self._onMouseDown.apply(self,arguments)},false);this.element.addEventListener("mouseup",function(){return self._onMouseUp.apply(self,arguments)},false);this.element.addEventListener("mousemove",function(){return self._onMouseMove.apply(self,arguments)}, false);this.element.addEventListener("mouseleave",function(){return self._onMouseLeave.apply(self,arguments)},false);this.element.addEventListener("dblclick",function(){return self._onMouseDblClick.apply(self,arguments)},false)}if(this.widget.addEventListener){var nameWheelEvent="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==undefined?"mousewheel":"DOMMouseScroll";this.widget.addEventListener(nameWheelEvent,function(){return self._onMouseWheel.apply(self,arguments)},false); this.widget.addEventListener("contextmenu",function(e){e.stopPropagation();e.preventDefault();return false},false)}var oShapeCursor=document.getElementById("id_target_cursor");if(null!=oShapeCursor&&oShapeCursor.addEventListener){oShapeCursor.addEventListener("mousedown",function(){return self._onMouseDown.apply(self,arguments)},false);oShapeCursor.addEventListener("mouseup",function(){return self._onMouseUp.apply(self,arguments)},false);oShapeCursor.addEventListener("mousemove",function(){return self._onMouseMove.apply(self, arguments)},false);oShapeCursor.addEventListener("mouseleave",function(){return self._onMouseLeave.apply(self,arguments)},false)}return this};asc_CEventsController.prototype.destroy=function(){return this};asc_CEventsController.prototype.enableKeyEventsHandler=function(flag){this.enableKeyEvents=!!flag};asc_CEventsController.prototype.canEdit=function(){return this.view.canEdit()};asc_CEventsController.prototype.getCellEditMode=function(){return this.view.isCellEditMode};asc_CEventsController.prototype.setFocus= function(hasFocus){this.hasFocus=!!hasFocus};asc_CEventsController.prototype.gotFocus=function(hasFocus){this.setFocus(hasFocus);this.handlers.trigger("gotFocus",this.hasFocus)};asc_CEventsController.prototype.getFormulaEditMode=function(){return this.view.isFormulaEditMode};asc_CEventsController.prototype.getSelectionDialogMode=function(){return this.view.selectionDialogMode};asc_CEventsController.prototype.reinitScrollX=function(pos,max,max2){var step=this.settings.hscrollStep;this.hsbMax=Math.max(max* step,1);this.hsbApi.settings.contentW=this.hsbMax-1;this.hsbApi.Repos(this.hsbApi.settings,false,false,pos*step);this.hsbApi.maxScrollX2=Math.max(max2*step,1)};asc_CEventsController.prototype.reinitScrollY=function(pos,max,max2){var step=this.settings.vscrollStep;this.vsbMax=Math.max(max*step,1);this.vsbApi.settings.contentH=this.vsbMax-1;this.vsbApi.Repos(this.vsbApi.settings,false,false,pos*step);this.vsbApi.maxScrollY2=Math.max(max2*step,1)};asc_CEventsController.prototype.scroll=function(delta){if(delta){if(delta.col)this.scrollHorizontal(delta.col); if(delta.row)this.scrollVertical(delta.row)}};asc_CEventsController.prototype.scrollVertical=function(delta,event){if(window["NATIVE_EDITOR_ENJINE"])return;if(event&&event.preventDefault)event.preventDefault();this.vsbApi.scrollByY(this.settings.vscrollStep*delta);return true};asc_CEventsController.prototype.scrollHorizontal=function(delta,event){if(window["NATIVE_EDITOR_ENJINE"])return;if(event&&event.preventDefault)event.preventDefault();this.hsbApi.scrollByX(this.settings.hscrollStep*delta);return true}; asc_CEventsController.prototype.doMouseDblClick=function(event){var t=this;var ctrlKey=!AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);if(this.getFormulaEditMode()||this.getSelectionDialogMode())return true;if(this.targetInfo&&(this.targetInfo.target===AscCommonExcel.c_oTargetType.GroupRow||this.targetInfo.target===AscCommonExcel.c_oTargetType.GroupCol))return false;if(this.targetInfo&&(this.targetInfo.target===c_oTargetType.MoveResizeRange||this.targetInfo.target===c_oTargetType.MoveRange|| this.targetInfo.target===c_oTargetType.FillHandle||this.targetInfo.target===c_oTargetType.FilterObject||this.targetInfo.target===c_oTargetType.TableSelectionChange))return true;if(t.getCellEditMode())if(!t.handlers.trigger("stopCellEditing"))return true;var coord=t._getCoordinates(event);var graphicsInfo=t.handlers.trigger("getGraphicsInfo",coord.x,coord.y);if(graphicsInfo)return;setTimeout(function(){var coord=t._getCoordinates(event);t.handlers.trigger("mouseDblClick",coord.x,coord.y,event,function(){t.handlers.trigger("updateWorksheet", coord.x,coord.y,ctrlKey,function(info){t.targetInfo=info})})},100);return true};asc_CEventsController.prototype.showCellEditorCursor=function(){if(this.getCellEditMode())if(this.isDoBrowserDblClick){this.isDoBrowserDblClick=false;this.handlers.trigger("showCellEditorCursor")}};asc_CEventsController.prototype._createScrollBars=function(){var self=this,settings,opt=this.settings;this.vsb=document.createElement("div");this.vsb.id="ws-v-scrollbar";this.widget.appendChild(this.vsb);if(!this.vsbApi){settings= new AscCommon.ScrollSettings;settings.vscrollStep=opt.vscrollStep;settings.hscrollStep=opt.hscrollStep;settings.wheelScrollLines=opt.wheelScrollLinesV;settings.isVerticalScroll=true;settings.isHorizontalScroll=false;this.vsbApi=new AscCommon.ScrollObject(this.vsb.id,settings);this.vsbApi.bind("scrollvertical",function(evt){self.handlers.trigger("scrollY",evt.scrollPositionY/self.settings.vscrollStep,!self.vsbApi.scrollerMouseDown)});this.vsbApi.bind("mouseup",function(evt){if(self.vsbApi.scrollerMouseDown)self.handlers.trigger("initRowsCount")}); this.vsbApi.onLockMouse=function(evt){self.vsbApiLockMouse=true};this.vsbApi.offLockMouse=function(){self.vsbApiLockMouse=false}}this.hsb=document.createElement("div");this.hsb.id="ws-h-scrollbar";this.widget.appendChild(this.hsb);if(!this.hsbApi){settings=new AscCommon.ScrollSettings;settings.vscrollStep=opt.vscrollStep;settings.hscrollStep=opt.hscrollStep;settings.isVerticalScroll=false;settings.isHorizontalScroll=true;this.hsbApi=new AscCommon.ScrollObject(this.hsb.id,settings);this.hsbApi.bind("scrollhorizontal", function(evt){self.handlers.trigger("scrollX",evt.scrollPositionX/self.settings.hscrollStep,!self.hsbApi.scrollerMouseDown)});this.hsbApi.bind("mouseup",function(evt){if(self.hsbApi.scrollerMouseDown)self.handlers.trigger("initColsCount")});this.hsbApi.onLockMouse=function(){self.hsbApiLockMouse=true};this.hsbApi.offLockMouse=function(){self.hsbApiLockMouse=false}}if(!this.view.Api.isMobileVersion){var corner=document.createElement("div");corner.id="ws-scrollbar-corner";this.widget.appendChild(corner)}else{this.hsb.style.zIndex= -10;this.hsb.style.right=0;this.hsb.style.display="none";this.vsb.style.zIndex=-10;this.vsb.style.bottom=0;this.vsb.style.display="none"}};asc_CEventsController.prototype._changeSelection=function(event,callback){var t=this;var coord=this._getCoordinates(event);this.handlers.trigger("changeSelection",false,coord.x,coord.y,true,false,function(d){t.scroll(d);asc_applyFunction(callback)})};asc_CEventsController.prototype._changeSelection2=function(event){var t=this;var fn=function(){t._changeSelection2(event)}; var callback=function(){if(t.isSelectMode&&!t.hasCursor)t.scrollTimerId=window.setTimeout(fn,t.settings.scrollTimeout)};window.clearTimeout(t.scrollTimerId);t.scrollTimerId=window.setTimeout(function(){if(t.isSelectMode&&!t.hasCursor)t._changeSelection(event,callback)},0)};asc_CEventsController.prototype._moveRangeHandle2=function(event){var t=this;var fn=function(){t._moveRangeHandle2(event)};var callback=function(){if(t.isMoveRangeMode&&!t.hasCursor)t.moveRangeTimerId=window.setTimeout(fn,t.settings.scrollTimeout)}; window.clearTimeout(t.moveRangeTimerId);t.moveRangeTimerId=window.setTimeout(function(){if(t.isMoveRangeMode&&!t.hasCursor)t._moveRangeHandle(event,callback)},0)};asc_CEventsController.prototype._moveResizeRangeHandle2=function(event){var t=this;var fn=function(){t._moveResizeRangeHandle2(event)};var callback=function(){if(t.isMoveResizeRange&&!t.hasCursor)t.moveResizeRangeTimerId=window.setTimeout(fn,t.settings.scrollTimeout)};window.clearTimeout(t.moveResizeRangeTimerId);t.moveResizeRangeTimerId= window.setTimeout(function(){if(t.isMoveResizeRange&&!t.hasCursor)t._moveResizeRangeHandle(event,t.targetInfo,callback)},0)};asc_CEventsController.prototype._changeSelectionDone=function(event){var coord=this._getCoordinates(event);var ctrlKey=!AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);if(false!==ctrlKey){coord.x=-1;coord.y=-1}this.handlers.trigger("changeSelectionDone",coord.x,coord.y,event)};asc_CEventsController.prototype._resizeElement=function(event){var coord=this._getCoordinates(event); this.handlers.trigger("resizeElement",this.targetInfo,coord.x,coord.y)};asc_CEventsController.prototype._resizeElementDone=function(event){var coord=this._getCoordinates(event);this.handlers.trigger("resizeElementDone",this.targetInfo,coord.x,coord.y,this.isResizeModeMove);this.isResizeModeMove=false};asc_CEventsController.prototype._changeFillHandle=function(event,callback,tableIndex){var t=this;var coord=this._getCoordinates(event);this.handlers.trigger("changeFillHandle",coord.x,coord.y,function(d){if(!d)return; t.scroll(d);asc_applyFunction(callback)},tableIndex)};asc_CEventsController.prototype._changeFillHandle2=function(event){var t=this;var fn=function(){t._changeFillHandle2(event)};var callback=function(){if(t.isFillHandleMode&&!t.hasCursor)t.fillHandleModeTimerId=window.setTimeout(fn,t.settings.scrollTimeout)};window.clearTimeout(t.fillHandleModeTimerId);t.fillHandleModeTimerId=window.setTimeout(function(){if(t.isFillHandleMode&&!t.hasCursor)t._changeFillHandle(event,callback)},0)};asc_CEventsController.prototype._changeFillHandleDone= function(event){var coord=this._getCoordinates(event);var ctrlKey=!AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);this.handlers.trigger("changeFillHandleDone",coord.x,coord.y,ctrlKey)};asc_CEventsController.prototype._moveRangeHandle=function(event,callback){var t=this;var coord=this._getCoordinates(event);this.handlers.trigger("moveRangeHandle",coord.x,coord.y,function(d){if(!d)return;t.scroll(d);asc_applyFunction(callback)})};asc_CEventsController.prototype._moveFrozenAnchorHandle=function(event, target){var t=this;var coord=t._getCoordinates(event);t.handlers.trigger("moveFrozenAnchorHandle",coord.x,coord.y,target)};asc_CEventsController.prototype._moveFrozenAnchorHandleDone=function(event,target){var t=this;var coord=t._getCoordinates(event);t.handlers.trigger("moveFrozenAnchorHandleDone",coord.x,coord.y,target)};asc_CEventsController.prototype._moveResizeRangeHandle=function(event,target,callback){var t=this;var coord=this._getCoordinates(event);this.handlers.trigger("moveResizeRangeHandle", coord.x,coord.y,target,function(d){if(!d)return;t.scroll(d);asc_applyFunction(callback)})};asc_CEventsController.prototype._groupRowClick=function(event,target){var coord=this._getCoordinates(event);return this.handlers.trigger("groupRowClick",coord.x,coord.y,target,event.type)};asc_CEventsController.prototype._commentCellClick=function(event){var coord=this._getCoordinates(event);this.handlers.trigger("commentCellClick",coord.x,coord.y)};asc_CEventsController.prototype._moveRangeHandleDone=function(event){var ctrlKey= !AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);this.handlers.trigger("moveRangeHandleDone",ctrlKey)};asc_CEventsController.prototype._moveResizeRangeHandleDone=function(){this.handlers.trigger("moveResizeRangeHandleDone")};asc_CEventsController.prototype._onWindowResize=function(event){var self=this;window.clearTimeout(this.resizeTimerId);this.resizeTimerId=window.setTimeout(function(){self.handlers.trigger("resize",event)},150)};asc_CEventsController.prototype._onWindowKeyDown=function(event){var t= this,dc=0,dr=0,canEdit=this.canEdit(),action=false,enterOptions;var ctrlKey=!AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);var shiftKey=event.shiftKey;var selectionDialogMode=this.getSelectionDialogMode();var isFormulaEditMode=this.getFormulaEditMode();var result=true;function stop(immediate){event.stopPropagation();immediate?event.stopImmediatePropagation():true;event.preventDefault();result=false}if(event.which===18)t.lastKeyCode=event.which;if(!t.getCellEditMode()&&!t.isMousePressed&& t.enableKeyEvents&&t.handlers.trigger("graphicObjectWindowKeyDown",event))return result;var selectionActivePointChanged=false;this.showCellEditorCursor();while(t.getCellEditMode()&&!t.hasFocus||!t.enableKeyEvents||t.isSelectMode||t.isFillHandleMode||t.isMoveRangeMode||t.isMoveResizeRange){if(!t.enableKeyEvents&&ctrlKey&&80===event.which)break;return result}t.skipKeyPress=true;switch(event.which){case 82:if(ctrlKey&&shiftKey){stop();if(canEdit&&!t.getCellEditMode()&&!selectionDialogMode)t.handlers.trigger("changeFormatTableInfo"); return result}t.skipKeyPress=false;return true;case 120:var type;if(ctrlKey&&event.altKey&&shiftKey)type=Asc.c_oAscCalculateType.All;else if(ctrlKey&&event.altKey)type=Asc.c_oAscCalculateType.Workbook;else if(shiftKey)type=Asc.c_oAscCalculateType.ActiveSheet;else type=Asc.c_oAscCalculateType.WorkbookOnlyChanged;t.handlers.trigger("calculate",type);return result;case 113:if(!canEdit||t.getCellEditMode()||selectionDialogMode)return true;if(AscBrowser.isOpera)stop();enterOptions=new AscCommonExcel.CEditorEnterOptions; enterOptions.focus=true;t.handlers.trigger("editCell",enterOptions);return result;case 186:if(!canEdit||t.getCellEditMode()||selectionDialogMode)return true;if(ctrlKey){enterOptions=new AscCommonExcel.CEditorEnterOptions;enterOptions.newText="";enterOptions.quickInput=true;this.handlers.trigger("editCell",enterOptions);return result}t.skipKeyPress=false;return true;case 8:if(!canEdit||t.getCellEditMode()||selectionDialogMode)return true;stop();enterOptions=new AscCommonExcel.CEditorEnterOptions;enterOptions.newText= "";t.handlers.trigger("editCell",enterOptions);return true;case 46:if(!canEdit||this.getCellEditMode()||selectionDialogMode||shiftKey)return true;this.handlers.trigger("empty");return result;case 9:if(t.getCellEditMode()||selectionDialogMode)return true;stop();selectionActivePointChanged=true;if(shiftKey){dc=-1;shiftKey=false}else dc=+1;break;case 13:if(t.getCellEditMode()||selectionDialogMode)return true;selectionActivePointChanged=true;if(shiftKey){dr=-1;shiftKey=false}else dr=+1;break;case 27:t.handlers.trigger("stopFormatPainter"); t.handlers.trigger("stopAddShape");window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide();return result;case 144:case 145:if(AscBrowser.isOpera)stop();return result;case 32:if(t.getCellEditMode())return true;var isSelectColumns=!AscBrowser.isMacOs&&ctrlKey||AscBrowser.isMacOs&&event.altKey;if(!isSelectColumns&&!shiftKey){t.skipKeyPress=false;return true}stop();if(isSelectColumns)t.handlers.trigger("selectColumnsByRange");if(shiftKey)t.handlers.trigger("selectRowsByRange");return result; case 33:stop();if(ctrlKey||event.altKey){t.handlers.trigger("showNextPrevWorksheet",-1);return true}else dr=-.5;break;case 34:stop();if(ctrlKey||event.altKey){t.handlers.trigger("showNextPrevWorksheet",+1);return true}else dr=+.5;break;case 37:stop();dc=ctrlKey?-1.5:-1;break;case 38:stop();dr=ctrlKey?-1.5:-1;break;case 39:stop();dc=ctrlKey?+1.5:+1;break;case 40:stop();if(canEdit&&!t.getCellEditMode()&&!selectionDialogMode&&event.altKey){t.handlers.trigger("showAutoComplete");return result}dr=ctrlKey? +1.5:+1;break;case 36:stop();if(isFormulaEditMode)break;dc=-2.5;if(ctrlKey)dr=-2.5;break;case 35:stop();if(isFormulaEditMode)break;dc=2.5;if(ctrlKey)dr=2.5;break;case 49:case 50:case 51:case 52:case 53:case 54:case 66:case 73:case 85:case 192:if(!canEdit||selectionDialogMode)return true;case 89:case 90:if(!(canEdit||t.handlers.trigger("isRestrictionComments"))||selectionDialogMode)return true;case 65:case 80:if(t.getCellEditMode())return true;if(!ctrlKey){t.skipKeyPress=false;return true}switch(event.which){case 49:if(shiftKey){t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Number);action=true}break;case 50:if(shiftKey){t.handlers.trigger("setCellFormat",Asc.c_oAscNumFormatType.Time);action=true}break;case 51:if(shiftKey){t.handlers.trigger("setCellFormat",Asc.c_oAscNumFormatType.Date);action=true}break;case 52:if(shiftKey){t.handlers.trigger("setCellFormat",Asc.c_oAscNumFormatType.Currency);action=true}break;case 53:if(shiftKey)t.handlers.trigger("setCellFormat",Asc.c_oAscNumFormatType.Percent);else t.handlers.trigger("setFontAttributes","s"); action=true;break;case 54:if(shiftKey){t.handlers.trigger("setCellFormat",Asc.c_oAscNumFormatType.Scientific);action=true}break;case 65:t.handlers.trigger("selectColumnsByRange");t.handlers.trigger("selectRowsByRange");action=true;break;case 66:t.handlers.trigger("setFontAttributes","b");action=true;break;case 73:t.handlers.trigger("setFontAttributes","i");action=true;break;case 80:t.handlers.trigger("print");action=true;break;case 85:t.handlers.trigger("setFontAttributes","u");action=true;break; case 89:t.handlers.trigger("redo");action=true;break;case 90:t.handlers.trigger("undo");action=true;break;case 192:if(shiftKey){t.handlers.trigger("setCellFormat",Asc.c_oAscNumFormatType.General);action=true}break}if(!action){t.skipKeyPress=false;return true}stop();return result;case 61:case 187:if(!canEdit||t.getCellEditMode()||selectionDialogMode)return true;if(event.altKey){this.handlers.trigger("addFunction",AscCommonExcel.cFormulaFunctionToLocale?AscCommonExcel.cFormulaFunctionToLocale["SUM"]: "SUM",Asc.c_oAscPopUpSelectorType.Func,true);stop()}else this.skipKeyPress=false;return result;case 93:stop();this.handlers.trigger("onContextMenu",event);return result;default:this.skipKeyPress=false;return true}if((dc!==0||dr!==0)&&false===t.handlers.trigger("isGlobalLockEditCell"))if(selectionActivePointChanged)t.handlers.trigger("selectionActivePointChanged",dc,dr,function(d){t.scroll(d)});else t.handlers.trigger("changeSelection",!shiftKey,dc,dr,false,false,function(d){var wb=window["Asc"]["editor"].wb; if(t.targetInfo)wb._onUpdateWorksheet(t.targetInfo.coordX,t.targetInfo.coordY,false);t.scroll(d)});return result};asc_CEventsController.prototype._onWindowKeyPress=function(event){if(!this.enableKeyEvents)return true;if(!this.canEdit()||this.getSelectionDialogMode())return true;this.showCellEditorCursor();if(this.getCellEditMode()&&!this.hasFocus||this.isSelectMode||!this.handlers.trigger("canReceiveKeyPress"))return true;if(this.skipKeyPress||event.which<32){this.skipKeyPress=true;return true}if(!this.getCellEditMode()){if(this.handlers.trigger("graphicObjectWindowKeyPress", event))return true;var enterOptions=new AscCommonExcel.CEditorEnterOptions;enterOptions.newText="";enterOptions.quickInput=true;this.handlers.trigger("editCell",enterOptions)}return true};asc_CEventsController.prototype._onWindowKeyUp=function(event){var t=this;if(t.lastKeyCode===18&&event.which===18)return false;if(16===event.which)this.handlers.trigger("updateSelectionName");this.handlers.trigger("graphicObjectWindowKeyUp",event);return true};asc_CEventsController.prototype._onWindowMouseMove=function(event){var coord= this._getCoordinates(event);if(this.isSelectMode&&!this.hasCursor)this._changeSelection2(event);if(this.isResizeMode&&!this.hasCursor){this.isResizeModeMove=true;this._resizeElement(event)}if(this.hsbApiLockMouse)this.hsbApi.mouseDown?this.hsbApi.evt_mousemove.call(this.hsbApi,event):false;else if(this.vsbApiLockMouse)this.vsbApi.mouseDown?this.vsbApi.evt_mousemove.call(this.vsbApi,event):false;if(this.frozenAnchorMode){this._moveFrozenAnchorHandle(event,this.frozenAnchorMode);return true}if(this.isShapeAction){event.isLocked= this.isMousePressed;this.handlers.trigger("graphicObjectMouseMove",event,coord.x,coord.y)}if(this.isRowGroup)if(!this._groupRowClick(event,this.targetInfo))this.isRowGroup=false;return true};asc_CEventsController.prototype._onWindowMouseUp=function(event){AscCommon.global_mouseEvent.UnLockMouse();var coord=this._getCoordinates(event);if(this.hsbApiLockMouse)this.hsbApi.mouseDown?this.hsbApi.evt_mouseup.call(this.hsbApi,event):false;else if(this.vsbApiLockMouse)this.vsbApi.mouseDown?this.vsbApi.evt_mouseup.call(this.vsbApi, event):false;this.isMousePressed=false;if(this.isShapeAction){if(!this.isUpOnCanvas){event.isLocked=this.isMousePressed;event.ClickCount=this.clickCounter.clickCount;event.fromWindow=true;this.handlers.trigger("graphicObjectMouseUp",event,coord.x,coord.y);this._changeSelectionDone(event)}this.isUpOnCanvas=false;return true}if(this.isSelectMode){this.isSelectMode=false;this._changeSelectionDone(event)}if(this.isResizeMode){this.isResizeMode=false;this._resizeElementDone(event)}if(this.isFillHandleMode){this.isFillHandleMode= false;this._changeFillHandleDone(event)}if(this.isMoveRangeMode){this.isMoveRangeMode=false;this._moveRangeHandleDone(event)}if(this.isMoveResizeRange){this.isMoveResizeRange=false;this.handlers.trigger("moveResizeRangeHandleDone")}if(this.frozenAnchorMode){this._moveFrozenAnchorHandleDone(event,this.frozenAnchorMode);this.frozenAnchorMode=false}this.showCellEditorCursor();return true};asc_CEventsController.prototype._onWindowMouseUpExternal=function(event,x,y){if(null!=x&&null!=y)event.coord={x:x, y:y};this._onWindowMouseUp(event);if(window.g_asc_plugins)window.g_asc_plugins.onExternalMouseUp()};asc_CEventsController.prototype._onWindowMouseLeaveOut=function(event){if(!this.isDoBrowserDblClick)return true;var relatedTarget=event.relatedTarget||event.fromElement;if(relatedTarget&&("ce-canvas-outer"===relatedTarget.id||"ce-canvas"===relatedTarget.id||"ce-canvas-overlay"===relatedTarget.id||"ce-cursor"===relatedTarget.id||"ws-canvas-overlay"===relatedTarget.id))return true;this.showCellEditorCursor(); return true};asc_CEventsController.prototype._onMouseDown=function(event){var t=this;asc["editor"].checkInterfaceElementBlur();var ctrlKey=!AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);var coord=t._getCoordinates(event);event.isLocked=t.isMousePressed=true;var graphicsInfo=t.handlers.trigger("getGraphicsInfo",coord.x,coord.y);if(!graphicsInfo)this._onMouseMove(event);if(AscCommon.g_inputContext)AscCommon.g_inputContext.externalChangeFocus();AscCommon.global_mouseEvent.LockMouse();if(t.handlers.trigger("isGlobalLockEditCell"))return; if(!this.enableKeyEvents)t.handlers.trigger("canvasClick");var button=AscCommon.getMouseButton(event);if(asc["editor"].isStartAddShape||graphicsInfo){if(this.getSelectionDialogMode())return;if(this.getCellEditMode()&&!this.handlers.trigger("stopCellEditing"))return;t.isShapeAction=true;t.isUpOnCanvas=false;t.clickCounter.mouseDownEvent(coord.x,coord.y,button);event.ClickCount=t.clickCounter.clickCount;if(0===event.ClickCount%2)t.isDblClickInMouseDown=true;t.handlers.trigger("graphicObjectMouseDown", event,coord.x,coord.y);t.handlers.trigger("updateSelectionShape",true);return}this.isShapeAction=false;if(2===event.detail)if(this.mouseDownLastCord&&coord.x===this.mouseDownLastCord.x&&coord.y===this.mouseDownLastCord.y&&0===button&&!this.handlers.trigger("isFormatPainter")){this.isDblClickInMouseDown=true;this.isDoBrowserDblClick=true;this.doMouseDblClick(event);this.mouseDownLastCord=null;return}if(!(AscBrowser.isIE||AscBrowser.isOpera))if(event.preventDefault)event.preventDefault();else event.returnValue= false;this.mouseDownLastCord=coord;if(!t.getCellEditMode()&&!t.getSelectionDialogMode()){this.gotFocus(true);if(event.shiftKey){t.isSelectMode=true;t._changeSelection(event);return}if(t.targetInfo)if((t.targetInfo.target===c_oTargetType.ColumnResize||t.targetInfo.target===c_oTargetType.RowResize)&&0===button){t.isResizeMode=true;t._resizeElement(event);return}else if(t.targetInfo.target===c_oTargetType.FillHandle&&this.canEdit()){this.isFillHandleMode=true;t._changeFillHandle(event,null,t.targetInfo.tableIndex); return}else if(t.targetInfo.target===c_oTargetType.MoveRange&&this.canEdit()){this.isMoveRangeMode=true;t._moveRangeHandle(event);return}else if(t.targetInfo.target===c_oTargetType.FilterObject){if(0===button)if(t.targetInfo.isDataValidation)this.handlers.trigger("onDataValidation");else if(t.targetInfo.idPivot&&Asc.CT_pivotTableDefinition.prototype.asc_filterByCell)this.handlers.trigger("pivotFiltersClick",t.targetInfo.idPivot);else if(t.targetInfo.idTableTotal)this.handlers.trigger("tableTotalClick", t.targetInfo.idTableTotal);else this.handlers.trigger("autoFiltersClick",t.targetInfo.idFilter);event.preventDefault&&event.preventDefault();event.stopPropagation&&event.stopPropagation();return}else if(t.targetInfo.commentIndexes)t._commentCellClick(event);else if(t.targetInfo.target===c_oTargetType.MoveResizeRange&&this.canEdit()){this.isMoveResizeRange=true;t._moveResizeRangeHandle(event,t.targetInfo);return}else if((t.targetInfo.target===c_oTargetType.FrozenAnchorV||t.targetInfo.target===c_oTargetType.FrozenAnchorH)&& this.canEdit()){this.frozenAnchorMode=t.targetInfo.target;t._moveFrozenAnchorHandle(event,this.frozenAnchorMode);return}else if(t.targetInfo.target===c_oTargetType.GroupRow&&0===button){if(t._groupRowClick(event,t.targetInfo))t.isRowGroup=true;return}else if(t.targetInfo.target===c_oTargetType.GroupCol&&0===button){if(t._groupRowClick(event,t.targetInfo))t.isRowGroup=true;return}else if((t.targetInfo.target===c_oTargetType.GroupCol||t.targetInfo.target===c_oTargetType.GroupRow)&&2===button){this.handlers.trigger("onContextMenu", null);return}else if(t.targetInfo.target===c_oTargetType.TableSelectionChange){this.handlers.trigger("onChangeTableSelection",t.targetInfo);return}}else{if(this.getFormulaEditMode()){if(this.targetInfo&&this.targetInfo.target===c_oTargetType.MoveResizeRange){this.isMoveResizeRange=true;this._moveResizeRangeHandle(event,this.targetInfo);return}else if(this.targetInfo&&this.targetInfo.target===c_oTargetType.FillHandle)return;if(2===button)return}else if(!this.handlers.trigger("stopCellEditing"))return; this.gotFocus(true);if(event.shiftKey){this.isSelectMode=true;this._changeSelection(event);return}}if(2===button){this.handlers.trigger("changeSelectionRightClick",coord.x,coord.y,this.targetInfo&&this.targetInfo.target);this.handlers.trigger("onContextMenu",event)}else if(this.targetInfo&&this.targetInfo.target===c_oTargetType.FillHandle&&this.canEdit()){this.isFillHandleMode=true;this._changeFillHandle(event,null,t.targetInfo.tableIndex)}else{this.isSelectMode=true;this.handlers.trigger("changeSelection", true,coord.x,coord.y,true,ctrlKey)}};asc_CEventsController.prototype._onMouseUp=function(event){var button=AscCommon.getMouseButton(event);AscCommon.global_mouseEvent.UnLockMouse();if(2===button){if(this.isShapeAction)this.handlers.trigger("onContextMenu",event);return true}var coord=this._getCoordinates(event);event.isLocked=this.isMousePressed=false;if(this.isShapeAction){event.ClickCount=this.clickCounter.clickCount;this.handlers.trigger("graphicObjectMouseUp",event,coord.x,coord.y);this._changeSelectionDone(event); if(asc["editor"].isStartAddShape){event.preventDefault&&event.preventDefault();event.stopPropagation&&event.stopPropagation()}else this.isUpOnCanvas=true;return true}if(this.isSelectMode){this.isSelectMode=false;this._changeSelectionDone(event)}if(this.isResizeMode){this.isResizeMode=false;this._resizeElementDone(event)}if(this.isFillHandleMode){this.isFillHandleMode=false;this._changeFillHandleDone(event)}if(this.isMoveRangeMode){this.isMoveRangeMode=false;this._moveRangeHandleDone(event)}if(this.isMoveResizeRange){this.isMoveResizeRange= false;this._moveResizeRangeHandleDone();return true}if(this.frozenAnchorMode){this._moveFrozenAnchorHandleDone(event,this.frozenAnchorMode);this.frozenAnchorMode=false}if(this.isRowGroup){this._groupRowClick(event,this.targetInfo);this.isRowGroup=false;return}this.showCellEditorCursor()};asc_CEventsController.prototype._onMouseMove=function(event){var t=this;var ctrlKey=!AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);var coord=t._getCoordinates(event);t.hasCursor=true;var graphicsInfo= t.handlers.trigger("getGraphicsInfo",coord.x,coord.y);if(graphicsInfo)this.clickCounter.mouseMoveEvent(coord.x,coord.y);if(t.isSelectMode){t._changeSelection(event);return true}if(t.isResizeMode){t._resizeElement(event);this.isResizeModeMove=true;return true}if(t.isFillHandleMode){t._changeFillHandle(event);return true}if(t.isMoveRangeMode){t._moveRangeHandle(event);return true}if(t.isMoveResizeRange){t._moveResizeRangeHandle(event,t.targetInfo);return true}if(t.frozenAnchorMode){t._moveFrozenAnchorHandle(event, this.frozenAnchorMode);return true}if(t.isShapeAction||graphicsInfo){event.isLocked=t.isMousePressed;t.handlers.trigger("graphicObjectMouseMove",event,coord.x,coord.y);t.handlers.trigger("updateWorksheet",coord.x,coord.y,ctrlKey,function(info){t.targetInfo=info});return true}t.handlers.trigger("updateWorksheet",coord.x,coord.y,ctrlKey,function(info){t.targetInfo=info});return true};asc_CEventsController.prototype._onMouseLeave=function(event){var t=this;var coord=t._getCoordinates(event);this.hasCursor= false;if(!this.isSelectMode&&!this.isResizeMode&&!this.isMoveResizeRange){this.targetInfo=undefined;this.handlers.trigger("updateWorksheet",coord.x,coord.y)}if(this.isMoveRangeMode)t.moveRangeTimerId=window.setTimeout(function(){t._moveRangeHandle2(event)},0);if(this.isMoveResizeRange)t.moveResizeRangeTimerId=window.setTimeout(function(){t._moveResizeRangeHandle2(event)},0);if(this.isFillHandleMode)t.fillHandleModeTimerId=window.setTimeout(function(){t._changeFillHandle2(event)},0);return true};asc_CEventsController.prototype._onMouseWheel= function(event){var ctrlKey=!AscCommon.getAltGr(event)&&(event.metaKey||event.ctrlKey);if(ctrlKey){if(event.preventDefault)event.preventDefault();else event.returnValue=false;return false}if(this.isFillHandleMode||this.isMoveRangeMode||this.isMoveResizeRange)return true;if(undefined!==window["AscDesktopEditor"])if(false===window["AscDesktopEditor"]["CheckNeedWheel"]())return true;var self=this;var deltaX=0,deltaY=0;if(undefined!==event.wheelDelta&&0!==event.wheelDelta)deltaY=-1*event.wheelDelta/40; else if(undefined!==event.detail&&0!==event.detail)deltaY=event.detail;else if(undefined!==event.deltaY&&0!==event.deltaY)deltaY=event.deltaY;if(undefined!==event.deltaX&&0!==event.deltaX)deltaX=event.deltaX;if(event.axis!==undefined&&event.axis===event.HORIZONTAL_AXIS){deltaX=deltaY;deltaY=0}if(undefined!==event.wheelDeltaX&&0!==event.wheelDeltaX)deltaX=-1*event.wheelDeltaX/40;if(undefined!==event.wheelDeltaY&&0!==event.wheelDeltaY)deltaY=-1*event.wheelDeltaY/40;if(event.shiftKey){deltaX=deltaY; deltaY=0}if(this.smoothWheelCorrector){deltaX=this.smoothWheelCorrector.get_DeltaX(deltaX);deltaY=this.smoothWheelCorrector.get_DeltaY(deltaY)}if(this.handlers.trigger("graphicObjectMouseWheel",deltaX,deltaY)){self._onMouseMove(event);AscCommon.stopEvent(event);return true}this.handlers.trigger("updateWorksheet",undefined,undefined,undefined,function(){if(deltaX&&(!self.smoothWheelCorrector||!self.smoothWheelCorrector.isBreakX())){deltaX=Math.sign(deltaX)*Math.ceil(Math.abs(deltaX/3));self.scrollHorizontal(deltaX, event)}if(deltaY&&(!self.smoothWheelCorrector||!self.smoothWheelCorrector.isBreakY())){deltaY=Math.sign(deltaY)*Math.ceil(Math.abs(deltaY*self.settings.wheelScrollLinesV/3));self.scrollVertical(deltaY,event)}self._onMouseMove(event)});this.smoothWheelCorrector&&this.smoothWheelCorrector.checkBreak();AscCommon.stopEvent(event);return true};asc_CEventsController.prototype._onMouseDblClick=function(event){if(this.handlers.trigger("isGlobalLockEditCell")||this.handlers.trigger("isFormatPainter"))return false; if(false===this.isDblClickInMouseDown)return this.doMouseDblClick(event);this.isDblClickInMouseDown=false;this.showCellEditorCursor();return true};asc_CEventsController.prototype._getCoordinates=function(event){if(event.coord)return event.coord;var offs=this.element.getBoundingClientRect();var x=(event.pageX*AscBrowser.zoom>>0)-offs.left;var y=(event.pageY*AscBrowser.zoom>>0)-offs.top;if(AscBrowser.isRetina){x*=AscCommon.AscBrowser.retinaPixelRatio;y*=AscCommon.AscBrowser.retinaPixelRatio}return{x:x, y:y}};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].asc_CEventsController=asc_CEventsController})(jQuery,window);"use strict";(function(window,undefined){var c_oAscFormatPainterState=AscCommon.c_oAscFormatPainterState;var AscBrowser=AscCommon.AscBrowser;var CColor=AscCommon.CColor;var cBoolLocal=AscCommon.cBoolLocal;var History=AscCommon.History;var asc=window["Asc"];var asc_applyFunction=AscCommonExcel.applyFunction;var asc_round=asc.round;var asc_typeof=asc.typeOf; var asc_CMM=AscCommonExcel.asc_CMouseMoveData;var asc_CPrintPagesData=AscCommonExcel.CPrintPagesData;var c_oTargetType=AscCommonExcel.c_oTargetType;var c_oAscError=asc.c_oAscError;var c_oAscCleanOptions=asc.c_oAscCleanOptions;var c_oAscSelectionDialogType=asc.c_oAscSelectionDialogType;var c_oAscMouseMoveType=asc.c_oAscMouseMoveType;var c_oAscPopUpSelectorType=asc.c_oAscPopUpSelectorType;var c_oAscAsyncAction=asc.c_oAscAsyncAction;var c_oAscFontRenderingModeType=asc.c_oAscFontRenderingModeType;var c_oAscAsyncActionType= asc.c_oAscAsyncActionType;var g_clipboardExcel=AscCommonExcel.g_clipboardExcel;function WorkbookCommentsModel(handlers,aComments){this.workbook={handlers:handlers};this.aComments=aComments}WorkbookCommentsModel.prototype.getId=function(){return null};WorkbookCommentsModel.prototype.getMergedByCell=function(){return null};function WorksheetViewSettings(){this.header={style:[{background:new CColor(241,241,241),border:new CColor(213,213,213),color:new CColor(54,54,54),backgroundDark:new CColor(68,68, 68),colorDark:new CColor(255,255,255)},{background:new CColor(193,193,193),border:new CColor(146,146,146),color:new CColor(54,54,54),backgroundDark:new CColor(0,0,0),colorDark:new CColor(255,255,255)},{background:new CColor(223,223,223),border:new CColor(175,175,175),color:new CColor(101,106,112),backgroundDark:new CColor(102,102,102),colorDark:new CColor(255,255,255)}],cornerColor:new CColor(193,193,193)};this.cells={defaultState:{background:new CColor(255,255,255),border:new CColor(202,202,202)}, padding:-1};this.activeCellBorderColor=new CColor(72,121,92);this.activeCellBorderColor2=new CColor(255,255,255,1);this.findFillColor=new CColor(255,238,128,1);this.frozenColor=new CColor(105,119,62,1);this.mathMaxDigCount=9;var cnv=document.createElement("canvas");cnv.width=2;cnv.height=2;var ctx=cnv.getContext("2d");ctx.clearRect(0,0,2,2);ctx.fillStyle="#000";ctx.fillRect(0,0,1,1);ctx.fillRect(1,1,1,1);this.ptrnLineDotted1=ctx.createPattern(cnv,"repeat");this.halfSelection=false;return this}function WorkbookView(model, controller,handlers,elem,inputElem,Api,collaborativeEditing,fontRenderingMode){this.defaults={scroll:{widthPx:14,heightPx:14},worksheetView:new WorksheetViewSettings};this.model=model;this.enableKeyEvents=true;this.controller=controller;this.handlers=handlers;this.wsViewHandlers=null;this.element=elem;this.input=inputElem;this.Api=Api;this.collaborativeEditing=collaborativeEditing;this.lastSendInfoRange=null;this.oSelectionInfo=null;this.canUpdateAfterShiftUp=false;this.keepType=false;this.timerId= null;this.timerEnd=false;this.isInit=false;this.canvas=undefined;this.canvasOverlay=undefined;this.canvasGraphic=undefined;this.canvasGraphicOverlay=undefined;this.wsActive=-1;this.wsMustDraw=false;this.wsViews=[];this.cellEditor=undefined;this.fontRenderingMode=null;this.lockDraw=false;this.isCellEditMode=false;this.isFormulaEditMode=false;this.isWizardMode=false;this.isShowComments=true;this.isShowSolved=true;this.formulasList=[];this.lastFPos=-1;this.lastFNameLength="";this.skipHelpSelector=false; this.arrExcludeFormulas=[];this.fReplaceCallback=null;this.m_oFont=AscCommonExcel.g_oDefaultFormat.Font.clone();this.fmgrGraphics=[];this.fmgrGraphics.push(new AscFonts.CFontManager({mode:"cell"}));this.fmgrGraphics.push(new AscFonts.CFontManager({mode:"cell"}));this.fmgrGraphics.push(new AscFonts.CFontManager);this.fmgrGraphics.push(new AscFonts.CFontManager({mode:"cell"}));this.fmgrGraphics[0].Initialize(true);this.fmgrGraphics[1].Initialize(true);this.fmgrGraphics[2].Initialize(true);this.fmgrGraphics[3].Initialize(true); this.buffers={};this.drawingCtx=undefined;this.overlayCtx=undefined;this.drawingGraphicCtx=undefined;this.overlayGraphicCtx=undefined;this.shapeCtx=null;this.shapeOverlayCtx=null;this.mainGraphics=undefined;this.stringRender=undefined;this.trackOverlay=null;this.mainOverlay=null;this.autoShapeTrack=null;this.formatPainterState=c_oAscFormatPainterState.kOff;this.formatPainterRange=null;this.formatPainterSheet=null;this.selectionDialogMode=false;this.dialogAbsName=false;this.dialogSheetName=false;this.copyActiveSheet= -1;this.cellCommentator=null;this.isDocumentPlaceChangedEnabled=false;this.maxDigitWidth=0;this.MobileTouchManager=null;this.defNameAllowCreate=true;this._init(fontRenderingMode);this.autoCorrectStore=null;this.cutIdSheet=null;return this}WorkbookView.prototype._init=function(fontRenderingMode){var self=this;this.setFontRenderingMode(fontRenderingMode,true);var _head=document.getElementsByTagName("head")[0];var style0=document.createElement("style");style0.type="text/css";style0.innerHTML=".block_elem { position:absolute;padding:0;margin:0; }"; _head.appendChild(style0);if(null!=this.element){this.element.innerHTML='<div id="ws-canvas-outer">\t\t\t\t\t\t\t\t\t\t\t<canvas id="ws-canvas"></canvas>\t\t\t\t\t\t\t\t\t\t\t<canvas id="ws-canvas-overlay"></canvas>\t\t\t\t\t\t\t\t\t\t\t<canvas id="ws-canvas-graphic"></canvas>\t\t\t\t\t\t\t\t\t\t\t<canvas id="ws-canvas-graphic-overlay"></canvas>\t\t\t\t\t\t\t\t\t\t\t<canvas id="id_target_cursor" class="block_elem" width="1" height="1"\t\t\t\t\t\t\t\t\t\t\t\tstyle="width:2px;height:13px;display:none;z-index:9;"></canvas>\t\t\t\t\t\t\t\t\t\t</div>'; this.canvas=document.getElementById("ws-canvas");this.canvasOverlay=document.getElementById("ws-canvas-overlay");this.canvasGraphic=document.getElementById("ws-canvas-graphic");this.canvasGraphicOverlay=document.getElementById("ws-canvas-graphic-overlay")}this.buffers.main=new asc.DrawingContext({canvas:this.canvas,units:0,fmgrGraphics:this.fmgrGraphics,font:this.m_oFont});this.buffers.overlay=new asc.DrawingContext({canvas:this.canvasOverlay,units:0,fmgrGraphics:this.fmgrGraphics,font:this.m_oFont}); this.buffers.mainGraphic=new asc.DrawingContext({canvas:this.canvasGraphic,units:0,fmgrGraphics:this.fmgrGraphics,font:this.m_oFont});this.buffers.overlayGraphic=new asc.DrawingContext({canvas:this.canvasGraphicOverlay,units:0,fmgrGraphics:this.fmgrGraphics,font:this.m_oFont});this.drawingCtx=this.buffers.main;this.overlayCtx=this.buffers.overlay;this.drawingGraphicCtx=this.buffers.mainGraphic;this.overlayGraphicCtx=this.buffers.overlayGraphic;this.shapeCtx=new AscCommon.CGraphics;this.shapeOverlayCtx= new AscCommon.CGraphics;this.mainGraphics=new AscCommon.CGraphics;this.trackOverlay=new AscCommon.COverlay;this.trackOverlay.IsCellEditor=true;if(this.Api.isMobileVersion){this.mainOverlay=new AscCommon.COverlay;this.mainOverlay.IsCellEditor=true}this.autoShapeTrack=new AscCommon.CAutoshapeTrack;this.shapeCtx.m_oAutoShapesTrack=this.autoShapeTrack;this.shapeCtx.m_oFontManager=this.fmgrGraphics[2];this.shapeOverlayCtx.m_oFontManager=this.fmgrGraphics[2];this.mainGraphics.m_oFontManager=this.fmgrGraphics[0]; this._canResize();this.stringRender=new AscCommonExcel.StringRender(this.buffers.main);this._calcMaxDigitWidth();if(!window["NATIVE_EDITOR_ENJINE"]){this.controller.init(this,this.element,this.canvasGraphicOverlay,{"resize":function(){self.resize.apply(self,arguments)},"gotFocus":function(hasFocus){if(self.isCellEditMode)self.cellEditor.setFocus(!hasFocus)},"initRowsCount":function(){self._onInitRowsCount.apply(self,arguments)},"initColsCount":function(){self._onInitColsCount.apply(self,arguments)}, "scrollY":function(){self._onScrollY.apply(self,arguments)},"scrollX":function(){self._onScrollX.apply(self,arguments)},"changeSelection":function(){self._onChangeSelection.apply(self,arguments)},"changeSelectionDone":function(){self._onChangeSelectionDone.apply(self,arguments)},"changeSelectionRightClick":function(){self._onChangeSelectionRightClick.apply(self,arguments)},"selectionActivePointChanged":function(){self._onSelectionActivePointChanged.apply(self,arguments)},"updateWorksheet":function(){self._onUpdateWorksheet.apply(self, arguments)},"resizeElement":function(){self._onResizeElement.apply(self,arguments)},"resizeElementDone":function(){self._onResizeElementDone.apply(self,arguments)},"changeFillHandle":function(){self._onChangeFillHandle.apply(self,arguments)},"changeFillHandleDone":function(){self._onChangeFillHandleDone.apply(self,arguments)},"moveRangeHandle":function(){self._onMoveRangeHandle.apply(self,arguments)},"moveRangeHandleDone":function(){self._onMoveRangeHandleDone.apply(self,arguments)},"moveResizeRangeHandle":function(){self._onMoveResizeRangeHandle.apply(self, arguments)},"moveResizeRangeHandleDone":function(){self._onMoveResizeRangeHandleDone.apply(self,arguments)},"editCell":function(){self._onEditCell.apply(self,arguments)},"stopCellEditing":function(){return self.closeCellEditor.apply(self,arguments)},"isRestrictionComments":function(){return self.Api.isRestrictionComments()},"empty":function(){self._onEmpty.apply(self,arguments)},"undo":function(){self.undo.apply(self,arguments)},"redo":function(){self.redo.apply(self,arguments)},"mouseDblClick":function(){self._onMouseDblClick.apply(self, arguments)},"showNextPrevWorksheet":function(){self._onShowNextPrevWorksheet.apply(self,arguments)},"setFontAttributes":function(){self._onSetFontAttributes.apply(self,arguments)},"setCellFormat":function(){self._onSetCellFormat.apply(self,arguments)},"selectColumnsByRange":function(){self._onSelectColumnsByRange.apply(self,arguments)},"selectRowsByRange":function(){self._onSelectRowsByRange.apply(self,arguments)},"save":function(){self.Api.asc_Save()},"showCellEditorCursor":function(){self._onShowCellEditorCursor.apply(self, arguments)},"print":function(){self.Api.onPrint()},"addFunction":function(){self.insertInCellEditor.apply(self,arguments)},"canvasClick":function(){self.enableKeyEventsHandler(true)},"autoFiltersClick":function(){self._onAutoFiltersClick.apply(self,arguments)},"tableTotalClick":function(){self._onTableTotalClick.apply(self,arguments)},"pivotFiltersClick":function(){self._onPivotFiltersClick.apply(self,arguments)},"commentCellClick":function(){self._onCommentCellClick.apply(self,arguments)},"isGlobalLockEditCell":function(){return self.collaborativeEditing.getGlobalLockEditCell()}, "updateSelectionName":function(){self._onUpdateSelectionName.apply(self,arguments)},"stopFormatPainter":function(){self._onStopFormatPainter.apply(self,arguments)},"groupRowClick":function(){return self._onGroupRowClick.apply(self,arguments)},"onChangeTableSelection":function(){return self._onChangeTableSelection.apply(self,arguments)},"graphicObjectMouseDown":function(){self._onGraphicObjectMouseDown.apply(self,arguments)},"graphicObjectMouseMove":function(){self._onGraphicObjectMouseMove.apply(self, arguments)},"graphicObjectMouseUp":function(){self._onGraphicObjectMouseUp.apply(self,arguments)},"graphicObjectMouseUpEx":function(){self._onGraphicObjectMouseUpEx.apply(self,arguments)},"graphicObjectWindowKeyDown":function(){return self._onGraphicObjectWindowKeyDown.apply(self,arguments)},"graphicObjectWindowKeyUp":function(){return self._onGraphicObjectWindowKeyUp.apply(self,arguments)},"graphicObjectWindowKeyPress":function(){return self._onGraphicObjectWindowKeyPress.apply(self,arguments)}, "graphicObjectMouseWheel":function(){return self._onGraphicObjecMouseWheel.apply(self,arguments)},"getGraphicsInfo":function(){return self._onGetGraphicsInfo.apply(self,arguments)},"updateSelectionShape":function(){return self._onUpdateSelectionShape.apply(self,arguments)},"canReceiveKeyPress":function(){return self.getWorksheet().objectRender.controller.canReceiveKeyPress()},"stopAddShape":function(){self.getWorksheet().objectRender.controller.checkEndAddShape()},"moveFrozenAnchorHandle":function(){self._onMoveFrozenAnchorHandle.apply(self, arguments)},"moveFrozenAnchorHandleDone":function(){self._onMoveFrozenAnchorHandleDone.apply(self,arguments)},"showAutoComplete":function(){self.showAutoComplete.apply(self,arguments)},"onContextMenu":function(event){self.handlers.trigger("asc_onContextMenu",event)},"onDataValidation":function(){if(self.oSelectionInfo&&self.oSelectionInfo.dataValidation){var list=self.oSelectionInfo.dataValidation.getListValues(self.model.getActiveWs());self.handlers.trigger("asc_onValidationListMenu",list[0],list[1])}}, "isFormatPainter":function(){return self.formatPainterState},"calculate":function(){self.calculate.apply(self,arguments)},"changeFormatTableInfo":function(){var table=self.getSelectionInfo().formatTableInfo;return table&&self.changeFormatTableInfo(table.tableName,Asc.c_oAscChangeTableStyleInfo.rowTotal,!table.lastRow)},"hideSpecialPasteOptions":function(){self.handlers.trigger("hideSpecialPasteOptions")}});if(this.input&&this.input.addEventListener){this.input.addEventListener("focus",function(){self.input.isFocused= true;if(!self.canEdit())return;self._onStopFormatPainter();self.cellEditor.callTopLineMouseup=true;if(!self.getCellEditMode()&&!self.controller.isFillHandleMode){var enterOptions=new AscCommonExcel.CEditorEnterOptions;enterOptions.focus=true;self._onEditCell(enterOptions)}},false);this.input.addEventListener("keydown",function(event){if(self.isCellEditMode){self.handlers.trigger("asc_onInputKeyDown",event);if(!event.defaultPrevented)self.cellEditor._onWindowKeyDown(event,true)}},false)}this.Api.onKeyDown= function(event){self.controller._onWindowKeyDown(event);if(self.isCellEditMode)self.cellEditor._onWindowKeyDown(event,false)};this.Api.onKeyPress=function(event){self.controller._onWindowKeyPress(event);if(self.isCellEditMode)self.cellEditor._onWindowKeyPress(event)};this.Api.onKeyUp=function(event){self.controller._onWindowKeyUp(event);if(self.isCellEditMode)self.cellEditor._onWindowKeyUp(event)};this.Api.Begin_CompositeInput=function(){var oWSView=self.getWorksheet();if(oWSView&&oWSView.isSelectOnShape){if(oWSView.objectRender)oWSView.objectRender.Begin_CompositeInput(); return}if(!self.isCellEditMode){var enterOptions=new AscCommonExcel.CEditorEnterOptions;enterOptions.newText="";enterOptions.quickInput=true;self._onEditCell(enterOptions,function(){self.cellEditor.Begin_CompositeInput()})}else self.cellEditor.Begin_CompositeInput()};this.Api.Replace_CompositeText=function(arrCharCodes){var oWSView=self.getWorksheet();if(oWSView&&oWSView.isSelectOnShape){if(oWSView.objectRender)oWSView.objectRender.Replace_CompositeText(arrCharCodes);return}if(self.isCellEditMode)self.cellEditor.Replace_CompositeText(arrCharCodes)}; this.Api.End_CompositeInput=function(){var oWSView=self.getWorksheet();if(oWSView&&oWSView.isSelectOnShape){if(oWSView.objectRender)oWSView.objectRender.End_CompositeInput();return}if(self.isCellEditMode)self.cellEditor.End_CompositeInput()};this.Api.Set_CursorPosInCompositeText=function(nPos){var oWSView=self.getWorksheet();if(oWSView&&oWSView.isSelectOnShape){if(oWSView.objectRender)oWSView.objectRender.Set_CursorPosInCompositeText(nPos);return}if(self.isCellEditMode)self.cellEditor.Set_CursorPosInCompositeText(nPos)}; this.Api.Get_CursorPosInCompositeText=function(){var res=0;var oWSView=self.getWorksheet();if(oWSView&&oWSView.isSelectOnShape){if(oWSView.objectRender)res=oWSView.objectRender.Get_CursorPosInCompositeText()}else if(self.isCellEditMode)res=self.cellEditor.Get_CursorPosInCompositeText();return res};this.Api.Get_MaxCursorPosInCompositeText=function(){var res=0;var oWSView=self.getWorksheet();if(oWSView&&oWSView.isSelectOnShape){if(oWSView.objectRender)res=oWSView.objectRender.Get_CursorPosInCompositeText()}else if(self.isCellEditMode)res= self.cellEditor.Get_MaxCursorPosInCompositeText();return res};this.Api.AddTextWithPr=function(familyName,arrCharCodes){var ws=self.getWorksheet();if(ws&&ws.isSelectOnShape){var textPr=new CTextPr;textPr.RFonts=new CRFonts;textPr.RFonts.Set_All(familyName,-1);ws.objectRender.controller.addTextWithPr(new AscCommon.CUnicodeStringEmulator(arrCharCodes),textPr,true);return}if(!self.isCellEditMode)self._onEditCell(new AscCommonExcel.CEditorEnterOptions,function(){self.cellEditor.setTextStyle("fn",familyName); self.cellEditor._addCharCodes(arrCharCodes)});else{self.cellEditor.setTextStyle("fn",familyName);self.cellEditor._addCharCodes(arrCharCodes)}};this.Api.beginInlineDropTarget=function(event){if(!self.controller.isMoveRangeMode){self.controller.isMoveRangeMode=true;self.getWorksheet().dragAndDropRange=new Asc.Range(0,0,0,0)}self.controller._onMouseMove(event)};this.Api.endInlineDropTarget=function(event){self.controller.isMoveRangeMode=false;var ws=self.getWorksheet();var newSelection=ws.activeMoveRange.clone(); ws._cleanSelectionMoveRange();ws.dragAndDropRange=null;self._onSetSelection(newSelection)};this.Api.isEnabledDropTarget=function(){return!self.isCellEditMode};AscCommon.InitBrowserInputContext(this.Api,"id_target_cursor");AscCommonExcel.executeInR1C1Mode(false,function(){self.model.dependencyFormulas.calcTree()})}this.cellEditor=new AscCommonExcel.CellEditor(this.element,this.input,this.fmgrGraphics,this.m_oFont,{"closed":function(){self._onCloseCellEditor.apply(self,arguments)},"updated":function(){self.Api.checkLastWork(); self._onUpdateCellEditor.apply(self,arguments)},"gotFocus":function(hasFocus){self.controller.setFocus(!hasFocus)},"updateFormulaEditMod":function(val){self.setFormulaEditMode(val)},"updateEditorState":function(state){self.handlers.trigger("asc_onEditCell",state)},"updateTopLine":function(state){self.handlers.trigger("asc_onEditCell",state)},"isGlobalLockEditCell":function(){return self.collaborativeEditing.getGlobalLockEditCell()},"onMouseDown":function(event){return self.controller._onMouseDown(event)}, "newRanges":function(ranges){if(self.isActive()){var ws=self.getWorksheet();ws.cleanSelection();ws.oOtherRanges=ranges;ws._drawSelection()}},"cleanSelectRange":function(){self._onCleanSelectRange()},"updateUndoRedoChanged":function(bCanUndo,bCanRedo){self.handlers.trigger("asc_onCanUndoChanged",bCanUndo);self.handlers.trigger("asc_onCanRedoChanged",bCanRedo)},"applyCloseEvent":function(){self.controller._onWindowKeyDown.apply(self.controller,arguments)},"canEdit":function(){return self.canEdit()}, "getFormulaRanges":function(){return self.isActive()?self.getWorksheet().oOtherRanges:null},"isActive":function(){return self.isActive()},"getWizard":function(){return self.isWizardMode},"getActiveWS":function(){return self.getActiveWS()},"updateEditorSelectionInfo":function(xfs){self.handlers.trigger("asc_onEditorSelectionChanged",xfs)},"onContextMenu":function(event){self.handlers.trigger("asc_onContextMenu",event)},"updatedEditableFunction":function(fName){self.handlers.trigger("asc_onFormulaInfo", fName)},"onSelectionEnd":function(){self.handlers.trigger("asc_onSelectionEnd")}},this.defaults.worksheetView.cells.padding);this.wsViewHandlers=new AscCommonExcel.asc_CHandlersList({"getViewMode":function(){return self.Api.getViewMode()},"isRestrictionComments":function(){return self.Api.isRestrictionComments()},"reinitializeScroll":function(type){self._onScrollReinitialize(type)},"selectionChanged":function(){self._onWSSelectionChanged()},"selectionNameChanged":function(){self._onSelectionNameChanged.apply(self, arguments)},"selectionMathInfoChanged":function(){self._onSelectionMathInfoChanged.apply(self,arguments)},"onFilterInfo":function(countFilter,countRecords){self.handlers.trigger("asc_onFilterInfo",countFilter,countRecords)},"onErrorEvent":function(errorId,level){self.handlers.trigger("asc_onError",errorId,level)},"slowOperation":function(isStart){(isStart?self.Api.sync_StartAction:self.Api.sync_EndAction).call(self.Api,c_oAscAsyncActionType.BlockInteraction,c_oAscAsyncAction.SlowOperation)},"setAutoFiltersDialog":function(arrVal){self.handlers.trigger("asc_onSetAFDialog", arrVal)},"selectionRangeChanged":function(val){self._onSelectionRangeChanged(val)},"onRenameCellTextEnd":function(countFind,countReplace){self.handlers.trigger("asc_onRenameCellTextEnd",countFind,countReplace)},"onStopFormatPainter":function(){self._onStopFormatPainter.apply(self,arguments)},"onDocumentPlaceChanged":function(){self._onDocumentPlaceChanged()},"updateSheetViewSettings":function(){self.handlers.trigger("asc_onUpdateSheetViewSettings")},"onScroll":function(d){self.controller.scroll(d)}, "getLockDefNameManagerStatus":function(){return self.defNameAllowCreate},"isActive":function(){return self.isActive()},"drawMobileSelection":function(oOverlay,oColor){if(self.MobileTouchManager)self.MobileTouchManager.CheckSelect(oOverlay,oColor)},"showSpecialPasteOptions":function(val){self.handlers.trigger("asc_onShowSpecialPasteOptions",val);if(!window["AscCommon"].g_specialPasteHelper.showSpecialPasteButton)window["AscCommon"].g_specialPasteHelper.showSpecialPasteButton=true},"checkLastWork":function(){self.Api.checkLastWork()}, "toggleAutoCorrectOptions":function(bIsShow,val){self.toggleAutoCorrectOptions(bIsShow,val)},"selectSearchingResults":function(){return self.Api.selectSearchingResults},"getMainGraphics":function(){return self.mainGraphics},"cleanCutData":function(bDrawSelection,bCleanBuffer){self.cleanCutData(bDrawSelection,bCleanBuffer)}});this.model.handlers.add("changeSheetViewSettings",function(wsId,type){var ws=self.getWorksheetById(wsId,true);if(ws)ws._onChangeSheetViewSettings(type)});this.model.handlers.add("cleanCellCache", function(wsId,oRanges,skipHeight){var ws=self.getWorksheetById(wsId,true);if(ws)ws.updateRanges(oRanges,skipHeight)});this.model.handlers.add("changeWorksheetUpdate",function(wsId,val){var ws=self.getWorksheetById(wsId);if(ws)ws.changeWorksheet("update",val)});this.model.handlers.add("showWorksheet",function(wsId){var wsModel=self.model.getWorksheetById(wsId),index;if(wsModel){index=wsModel.getIndex();self.showWorksheet(index,true)}});this.model.handlers.add("setSelection",function(){self._onSetSelection.apply(self, arguments)});this.model.handlers.add("getSelectionState",function(){return self._onGetSelectionState.apply(self)});this.model.handlers.add("setSelectionState",function(){self._onSetSelectionState.apply(self,arguments)});this.model.handlers.add("drawWS",function(){self.drawWS.apply(self,arguments)});this.model.handlers.add("showDrawingObjects",function(){self.onShowDrawingObjects.apply(self,arguments)});this.model.handlers.add("setCanUndo",function(bCanUndo){self.handlers.trigger("asc_onCanUndoChanged", bCanUndo)});this.model.handlers.add("setCanRedo",function(bCanRedo){self.handlers.trigger("asc_onCanRedoChanged",bCanRedo)});this.model.handlers.add("setDocumentModified",function(bIsModified){self.Api.onUpdateDocumentModified(bIsModified)});this.model.handlers.add("updateWorksheetByModel",function(){self.updateWorksheetByModel.apply(self,arguments)});this.model.handlers.add("undoRedoAddRemoveRowCols",function(sheetId,type,range,bUndo){if(true===bUndo)if(AscCH.historyitem_Worksheet_AddRows===type){self.collaborativeEditing.removeRowsRange(sheetId, range.clone(true));self.collaborativeEditing.undoRows(sheetId,range.r2-range.r1+1)}else if(AscCH.historyitem_Worksheet_RemoveRows===type){self.collaborativeEditing.addRowsRange(sheetId,range.clone(true));self.collaborativeEditing.undoRows(sheetId,range.r2-range.r1+1)}else if(AscCH.historyitem_Worksheet_AddCols===type){self.collaborativeEditing.removeColsRange(sheetId,range.clone(true));self.collaborativeEditing.undoCols(sheetId,range.c2-range.c1+1)}else{if(AscCH.historyitem_Worksheet_RemoveCols=== type){self.collaborativeEditing.addColsRange(sheetId,range.clone(true));self.collaborativeEditing.undoCols(sheetId,range.c2-range.c1+1)}}else if(AscCH.historyitem_Worksheet_AddRows===type){self.collaborativeEditing.addRowsRange(sheetId,range.clone(true));self.collaborativeEditing.addRows(sheetId,range.r1,range.r2-range.r1+1)}else if(AscCH.historyitem_Worksheet_RemoveRows===type){self.collaborativeEditing.removeRowsRange(sheetId,range.clone(true));self.collaborativeEditing.removeRows(sheetId,range.r1, range.r2-range.r1+1)}else if(AscCH.historyitem_Worksheet_AddCols===type){self.collaborativeEditing.addColsRange(sheetId,range.clone(true));self.collaborativeEditing.addCols(sheetId,range.c1,range.c2-range.c1+1)}else if(AscCH.historyitem_Worksheet_RemoveCols===type){self.collaborativeEditing.removeColsRange(sheetId,range.clone(true));self.collaborativeEditing.removeCols(sheetId,range.c1,range.c2-range.c1+1)}});this.model.handlers.add("undoRedoHideSheet",function(sheetId){self.showWorksheet(sheetId); self.Api.sheetsChanged()});this.model.handlers.add("updateSelection",function(){if(!self.lockDraw)self.getWorksheet().updateSelection()});this.handlers.add("asc_onLockDefNameManager",function(reason){self.defNameAllowCreate=!(reason==Asc.c_oAscDefinedNameReason.LockDefNameManager)});this.handlers.add("addComment",function(id,data){self._onWSSelectionChanged();self.handlers.trigger("asc_onAddComment",id,data)});this.handlers.add("removeComment",function(id){self._onWSSelectionChanged();self.handlers.trigger("asc_onRemoveComment", id)});this.handlers.add("hiddenComments",function(){return!self.isShowComments});this.handlers.add("showSolved",function(){return self.isShowSolved});this.model.handlers.add("hideSpecialPasteOptions",function(){self.handlers.trigger("asc_onHideSpecialPasteOptions")});this.model.handlers.add("toggleAutoCorrectOptions",function(bIsShow,val){self.toggleAutoCorrectOptions(bIsShow,val)});this.model.handlers.add("cleanCutData",function(bDrawSelection,bCleanBuffer){self.cleanCutData(bDrawSelection,bCleanBuffer)}); this.model.handlers.add("updateGroupData",function(){self.updateGroupData()});this.cellCommentator=new AscCommonExcel.CCellCommentator({model:new WorkbookCommentsModel(this.handlers,this.model.aComments),collaborativeEditing:this.collaborativeEditing,draw:function(){},handlers:{trigger:function(){return false}}});if(0<this.model.aComments.length)this.handlers.trigger("asc_onAddComments",this.model.aComments);this.initFormulasList();this.fReplaceCallback=function(){self._replaceCellTextCallback.apply(self, arguments)};return this};WorkbookView.prototype.destroy=function(){this.controller.destroy();this.cellEditor.destroy();return this};WorkbookView.prototype._createWorksheetView=function(wsModel){return new AscCommonExcel.WorksheetView(this,wsModel,this.wsViewHandlers,this.buffers,this.stringRender,this.maxDigitWidth,this.collaborativeEditing,this.defaults.worksheetView)};WorkbookView.prototype._onSelectionNameChanged=function(name){this.handlers.trigger("asc_onSelectionNameChanged",name)};WorkbookView.prototype._onSelectionMathInfoChanged= function(info){this.handlers.trigger("asc_onSelectionMathChanged",info)};WorkbookView.prototype._onSelectionRangeChanged=function(val){if(this.isFormulaEditMode&&!this.isWizardMode){this.skipHelpSelector=true;this.cellEditor.changeCellText(val);this.skipHelpSelector=false}this.handlers.trigger("asc_onSelectionRangeChanged",val)};WorkbookView.prototype._onCleanSelectRange=function(force){if(this.selectionDialogMode){var ws=this.getWorksheet();if(ws.model.selectionRange||force){ws.cleanSelection(); ws.model.selectionRange=null;if(this.isActive())ws._drawSelection()}}};WorkbookView.prototype._isEqualRange=function(range,isSelectOnShape){if(null===this.lastSendInfoRange)return false;return this.lastSendInfoRange.isEqual(range)&&this.lastSendInfoRangeIsSelectOnShape===isSelectOnShape};WorkbookView.prototype._updateSelectionInfo=function(){if(this.selectionDialogMode)return false;var ws=this.getWorksheet();this.oSelectionInfo=ws.getSelectionInfo();this.lastSendInfoRange=ws.model.selectionRange.clone(); this.lastSendInfoRangeIsSelectOnShape=ws.getSelectionShape();return true};WorkbookView.prototype._onWSSelectionChanged=function(isSaving){if(!this._updateSelectionInfo())return;if(this.input&&!this.getCellEditMode())if(this.lastSendInfoRangeIsSelectOnShape){this.input.disabled=true;this.input.value=""}else{this.input.disabled=false;this.input.value=this.oSelectionInfo.text}this.handlers.trigger("asc_onSelectionChanged",this.oSelectionInfo);this.handlers.trigger("asc_onSelectionEnd");this._onInputMessage(); if(!isSaving)this.Api.cleanSpelling()};WorkbookView.prototype._onInputMessage=function(){var title=null,message=null;var dataValidation=this.oSelectionInfo&&this.oSelectionInfo.dataValidation;if(dataValidation&&dataValidation.showInputMessage&&!this.model.getActiveWs().getDisablePrompts()){title=dataValidation.promptTitle;message=dataValidation.prompt}this.handlers.trigger("asc_onInputMessage",title,message)};WorkbookView.prototype._onScrollReinitialize=function(type){if(window["NATIVE_EDITOR_ENJINE"]|| !type)return;var ws=this.getWorksheet();if(AscCommonExcel.c_oAscScrollType.ScrollHorizontal&type)this.controller.reinitScrollX(ws.getFirstVisibleCol(true),ws.getHorizontalScrollRange(),ws.getHorizontalScrollMax());if(AscCommonExcel.c_oAscScrollType.ScrollVertical&type)this.controller.reinitScrollY(ws.getFirstVisibleRow(true),ws.getVerticalScrollRange(),ws.getVerticalScrollMax());if(this.Api.isMobileVersion)this.MobileTouchManager.Resize()};WorkbookView.prototype._onInitRowsCount=function(){var ws= this.getWorksheet();if(ws._initRowsCount())this._onScrollReinitialize(AscCommonExcel.c_oAscScrollType.ScrollVertical)};WorkbookView.prototype._onInitColsCount=function(){var ws=this.getWorksheet();if(ws._initColsCount())this._onScrollReinitialize(AscCommonExcel.c_oAscScrollType.ScrollHorizontal)};WorkbookView.prototype._onScrollY=function(pos,initRowsCount){var ws=this.getWorksheet();var delta=asc_round(pos-ws.getFirstVisibleRow(true));if(delta!==0)ws.scrollVertical(delta,this.cellEditor,initRowsCount)}; WorkbookView.prototype._onScrollX=function(pos,initColsCount){var ws=this.getWorksheet();var delta=asc_round(pos-ws.getFirstVisibleCol(true));if(delta!==0)ws.scrollHorizontal(delta,this.cellEditor,initColsCount)};WorkbookView.prototype._onSetSelection=function(range){var ws=this.getWorksheet();ws._endSelectionShape();ws.setSelection(range)};WorkbookView.prototype._onGetSelectionState=function(){var res=null;var ws=this.getWorksheet(null,true);if(ws&&AscCommon.isRealObject(ws.objectRender)&&AscCommon.isRealObject(ws.objectRender.controller))res= ws.objectRender.controller.getSelectionState();return res&&res[0]&&res[0].focus?res:null};WorkbookView.prototype._onSetSelectionState=function(state){if(null!==state){var ws=this.getWorksheetById(state[0].worksheetId);if(ws&&ws.objectRender&&ws.objectRender.controller){ws.objectRender.controller.setSelectionState(state);ws.setSelectionShape(true);ws._scrollToRange(ws.objectRender.getSelectedDrawingsRange());ws.objectRender.showDrawingObjectsEx();ws.objectRender.controller.updateOverlay();ws.objectRender.controller.updateSelectionState()}}}; WorkbookView.prototype._onChangeSelection=function(isStartPoint,dc,dr,isCoord,isCtrl,callback){if(!this._checkStopCellEditorInFormulas())return;var ws=this.getWorksheet();if(this.selectionDialogMode&&!ws.model.selectionRange)if(isCoord){ws.model.selectionRange=new AscCommonExcel.SelectionRange(ws.model);isStartPoint=true}else ws.model.selectionRange=ws.model.copySelection.clone();var t=this;var d=isStartPoint?ws.changeSelectionStartPoint(dc,dr,isCoord,isCtrl):ws.changeSelectionEndPoint(dc,dr,isCoord, isCoord&&this.keepType);if(!isCoord&&!isStartPoint)this.canUpdateAfterShiftUp=true;this.keepType=isCoord;if(isCoord&&!this.timerEnd&&this.timerId===null)this.timerId=setTimeout(function(){var arrClose=[];arrClose.push(new asc_CMM({type:c_oAscMouseMoveType.None}));t.handlers.trigger("asc_onMouseMove",arrClose);t._onUpdateCursor(AscCommonExcel.kCurCells);t.timerId=null;t.timerEnd=true},1E3);asc_applyFunction(callback,d)};WorkbookView.prototype._onChangeSelectionDone=function(x,y,event){if(this.timerId!== null){clearTimeout(this.timerId);this.timerId=null}this.keepType=false;if(this.selectionDialogMode)return;var formatPainterState=this.formatPainterState;var ws=this.getWorksheet();ws.changeSelectionDone();this._onSelectionNameChanged(ws.getSelectionName(false));var ar=ws.model.selectionRange.getLast();var isSelectOnShape=ws.getSelectionShape();if(!this._isEqualRange(ws.model.selectionRange,isSelectOnShape)){this._onWSSelectionChanged();this._onSelectionMathInfoChanged(ws.getSelectionMathInfo())}this.model.cleanFindResults(); var ct=ws.getCursorTypeFromXY(x,y);if(c_oTargetType.Hyperlink===ct.target&&!this.isFormulaEditMode&&!formatPainterState){var isHyperlinkClick=false;if(isSelectOnShape){var button=0;if(event)button=AscCommon.getMouseButton(event);if(button===0)isHyperlinkClick=true}else if(ar.isOneCell())isHyperlinkClick=true;else{var mergedRange=ws.model.getMergedByCell(ar.r1,ar.c1);if(mergedRange&&ar.isEqual(mergedRange))isHyperlinkClick=true}if(isHyperlinkClick&&!this.timerEnd){if(false===ct.hyperlink.hyperlinkModel.getVisited()&& !isSelectOnShape){ct.hyperlink.hyperlinkModel.setVisited(true);if(ct.hyperlink.hyperlinkModel.Ref){ws._updateRange(ct.hyperlink.hyperlinkModel.Ref.getBBox0());ws.draw()}}switch(ct.hyperlink.asc_getType()){case Asc.c_oAscHyperlinkType.WebLink:this.handlers.trigger("asc_onHyperlinkClick",ct.hyperlink.asc_getHyperlinkUrl());break;case Asc.c_oAscHyperlinkType.RangeLink:this.handlers.trigger("asc_onHideComment");this.Api._asc_setWorksheetRange(ct.hyperlink);break}}}this.timerEnd=false};WorkbookView.prototype._onChangeSelectionRightClick= function(dc,dr,target){var ws=this.getWorksheet();ws.changeSelectionStartPointRightClick(dc,dr,target)};WorkbookView.prototype._onSelectionActivePointChanged=function(dc,dr,callback){var ws=this.getWorksheet();var d=ws.changeSelectionActivePoint(dc,dr);asc_applyFunction(callback,d)};WorkbookView.prototype._onUpdateWorksheet=function(x,y,ctrlKey,callback){var ws=this.getWorksheet(),ct=undefined;var arrMouseMoveObjects=[];var t=this;if(x===undefined&&y===undefined){ws.cleanHighlightedHeaders();if(this.timerId=== null)this.timerId=setTimeout(function(){var arrClose=[];arrClose.push(new asc_CMM({type:c_oAscMouseMoveType.None}));t.handlers.trigger("asc_onMouseMove",arrClose);t.timerId=null},1E3)}else{ct=ws.getCursorTypeFromXY(x,y);ct.coordX=x;ct.coordY=y;if(this.timerId!==null){clearTimeout(this.timerId);this.timerId=null}if(undefined!==ct.userIdAllSheet)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.LockedObject,x:AscCommon.AscBrowser.convertToRetinaValue(ct.lockAllPosLeft),y:AscCommon.AscBrowser.convertToRetinaValue(ct.lockAllPosTop), userId:ct.userIdAllSheet,lockedObjectType:Asc.c_oAscMouseMoveLockedObjectType.Sheet}));else if(undefined!==ct.userIdAllProps)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.LockedObject,x:AscCommon.AscBrowser.convertToRetinaValue(ct.lockAllPosLeft),y:AscCommon.AscBrowser.convertToRetinaValue(ct.lockAllPosTop),userId:ct.userIdAllProps,lockedObjectType:Asc.c_oAscMouseMoveLockedObjectType.TableProperties}));if(undefined!==ct.userId)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.LockedObject, x:AscCommon.AscBrowser.convertToRetinaValue(ct.lockRangePosLeft),y:AscCommon.AscBrowser.convertToRetinaValue(ct.lockRangePosTop),userId:ct.userId,lockedObjectType:Asc.c_oAscMouseMoveLockedObjectType.Range}));if(ct.commentIndexes)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.Comment,x:ct.commentCoords.dLeftPX,reverseX:ct.commentCoords.dReverseLeftPX,y:ct.commentCoords.dTopPX,aCommentIndexes:ct.commentIndexes}));if(ct.target===c_oTargetType.Hyperlink)if(!ctrlKey)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.Hyperlink, x:AscCommon.AscBrowser.convertToRetinaValue(x),y:AscCommon.AscBrowser.convertToRetinaValue(y),hyperlink:ct.hyperlink}));else ct.cursor=AscCommonExcel.kCurCells;if(ct.target===c_oTargetType.FilterObject){var filterObj;if(ct.idPivot)filterObj=ws.pivot_setDialogProp(ct.idPivot);else filterObj=ws.af_setDialogProp(ct.idFilter,true);if(filterObj)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.Filter,x:AscCommon.AscBrowser.convertToRetinaValue(x),y:AscCommon.AscBrowser.convertToRetinaValue(y), filter:filterObj}))}if(ct.target===c_oTargetType.Shape)if(typeof ct.tooltip==="string"&&ct.tooltip.length>0)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.Tooltip,x:AscCommon.AscBrowser.convertToRetinaValue(x),y:AscCommon.AscBrowser.convertToRetinaValue(y),tooltip:ct.tooltip}));if(0===arrMouseMoveObjects.length)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.None}));this.handlers.trigger("asc_onMouseMove",arrMouseMoveObjects);if(ct.target===c_oTargetType.MoveRange&& ctrlKey&&ct.cursor==="move")ct.cursor="copy";this._onUpdateCursor(ct.cursor);if(ct.target===c_oTargetType.ColumnHeader||ct.target===c_oTargetType.RowHeader)ws.drawHighlightedHeaders(ct.col,ct.row);else ws.cleanHighlightedHeaders()}asc_applyFunction(callback,ct)};WorkbookView.prototype._onUpdateCursor=function(cursor){var newHtmlCursor=AscCommon.g_oHtmlCursor.value(cursor);if(this.element.style.cursor!==newHtmlCursor)this.element.style.cursor=newHtmlCursor};WorkbookView.prototype._onResizeElement= function(target,x,y){var arrMouseMoveObjects=[];if(target.target===c_oTargetType.ColumnResize)arrMouseMoveObjects.push(this.getWorksheet().drawColumnGuides(target.col,x,y,target.mouseX));else if(target.target===c_oTargetType.RowResize)arrMouseMoveObjects.push(this.getWorksheet().drawRowGuides(target.row,x,y,target.mouseY));if(0===arrMouseMoveObjects.length)arrMouseMoveObjects.push(new asc_CMM({type:c_oAscMouseMoveType.None}));this.handlers.trigger("asc_onMouseMove",arrMouseMoveObjects)};WorkbookView.prototype._onResizeElementDone= function(target,x,y,isResizeModeMove){var ws=this.getWorksheet();if(isResizeModeMove){if(target.target===c_oTargetType.ColumnResize)ws.changeColumnWidth(target.col,x,target.mouseX);else if(target.target===c_oTargetType.RowResize)ws.changeRowHeight(target.row,y,target.mouseY);window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Update_Position();this._onDocumentPlaceChanged()}ws.draw();this.handlers.trigger("asc_onMouseMove",[new asc_CMM({type:c_oAscMouseMoveType.None})])};WorkbookView.prototype._onChangeFillHandle= function(x,y,callback,tableIndex){var ws=this.getWorksheet();var d=ws.changeSelectionFillHandle(x,y,tableIndex);asc_applyFunction(callback,d)};WorkbookView.prototype._onChangeFillHandleDone=function(x,y,ctrlPress){var ws=this.getWorksheet();ws.applyFillHandle(x,y,ctrlPress)};WorkbookView.prototype._onMoveRangeHandle=function(x,y,callback){var ws=this.getWorksheet();var d=ws.changeSelectionMoveRangeHandle(x,y);asc_applyFunction(callback,d)};WorkbookView.prototype._onMoveRangeHandleDone=function(ctrlKey){var ws= this.getWorksheet();ws.applyMoveRangeHandle(ctrlKey)};WorkbookView.prototype._onMoveResizeRangeHandle=function(x,y,target,callback){var ws=this.getWorksheet();var d=ws.changeSelectionMoveResizeRangeHandle(x,y,target,this.cellEditor);asc_applyFunction(callback,d)};WorkbookView.prototype._onMoveResizeRangeHandleDone=function(){var ws=this.getWorksheet();ws.applyMoveResizeRangeHandle()};WorkbookView.prototype._onMoveFrozenAnchorHandle=function(x,y,target){var ws=this.getWorksheet();ws.drawFrozenGuides(x, y,target)};WorkbookView.prototype._onMoveFrozenAnchorHandleDone=function(x,y,target){var ws=this.getWorksheet();ws.applyFrozenAnchor(x,y,target)};WorkbookView.prototype.showAutoComplete=function(){var ws=this.getWorksheet();var arrValues=ws.getCellAutoCompleteValues(ws.model.selectionRange.activeCell);this.handlers.trigger("asc_onEntriesListMenu",arrValues)};WorkbookView.prototype._onAutoFiltersClick=function(idFilter){this.getWorksheet().af_setDialogProp(idFilter)};WorkbookView.prototype._onTableTotalClick= function(idTableTotal){var ws=this.getWorksheet();if(idTableTotal){var _table=ws.model.TableParts?ws.model.TableParts[idTableTotal.id]:null;if(_table){var _tableColumn=_table.TableColumns[idTableTotal.colId];if(_tableColumn){var val=_tableColumn.TotalsRowFunction;if(null===val)val=Asc.ETotalsRowFunction.totalrowfunctionNone;this.handlers.trigger("asc_onTableTotalMenu",val)}}}};WorkbookView.prototype._onPivotFiltersClick=function(idPivot){var filterObj=this.getWorksheet().pivot_setDialogProp(idPivot); if(filterObj)this.handlers.trigger("asc_onSetAFDialog",filterObj)};WorkbookView.prototype._onGroupRowClick=function(x,y,target,type){return this.getWorksheet().groupRowClick(x,y,target,type)};WorkbookView.prototype._onChangeTableSelection=function(target){var ws=this.getWorksheet();if(ws&&ws.model&&target){var table=ws.model.TableParts[target.tableIndex];if(table)ws.changeTableSelection(table.DisplayName,target.type,target.row,target.col)}};WorkbookView.prototype._onCommentCellClick=function(x,y){this.getWorksheet().cellCommentator.showCommentByXY(x, y)};WorkbookView.prototype._onUpdateSelectionName=function(forcibly){if(this.canUpdateAfterShiftUp||forcibly){this.canUpdateAfterShiftUp=false;var ws=this.getWorksheet();this._onSelectionNameChanged(ws.getSelectionName(false))}};WorkbookView.prototype._onStopFormatPainter=function(bLockDraw){if(this.formatPainterState)this.formatPainter(c_oAscFormatPainterState.kOff,bLockDraw)};WorkbookView.prototype._onGraphicObjectMouseDown=function(e,x,y){var ws=this.getWorksheet();ws.objectRender.graphicObjectMouseDown(e, x,y)};WorkbookView.prototype._onGraphicObjectMouseMove=function(e,x,y){var ws=this.getWorksheet();ws.objectRender.graphicObjectMouseMove(e,x,y)};WorkbookView.prototype._onGraphicObjectMouseUp=function(e,x,y){var ws=this.getWorksheet();ws.objectRender.graphicObjectMouseUp(e,x,y)};WorkbookView.prototype._onGraphicObjectMouseUpEx=function(e,x,y){};WorkbookView.prototype._onGraphicObjectWindowKeyDown=function(e){var objectRender=this.getWorksheet().objectRender;return 0<objectRender.getSelectedGraphicObjects().length? objectRender.graphicObjectKeyDown(e):false};WorkbookView.prototype._onGraphicObjectWindowKeyUp=function(e){var oWS,bRet=false;for(var i in this.wsViews){oWS=this.wsViews[i];if(oWS&&oWS.objectRender)bRet|=oWS.objectRender.graphicObjectKeyUp(e)}return bRet};WorkbookView.prototype._onGraphicObjectWindowKeyPress=function(e){var objectRender=this.getWorksheet().objectRender;return 0<objectRender.getSelectedGraphicObjects().length?objectRender.graphicObjectKeyPress(e):false};WorkbookView.prototype._onGraphicObjecMouseWheel= function(deltaX,deltaY){var objectRender=this.getWorksheet().objectRender;if(objectRender&&objectRender.controller)return objectRender.controller.onMouseWheel(deltaX,deltaY);return false};WorkbookView.prototype._onGetGraphicsInfo=function(x,y){var ws=this.getWorksheet();return ws.objectRender.checkCursorDrawingObject(x,y)};WorkbookView.prototype._onUpdateSelectionShape=function(isSelectOnShape){var ws=this.getWorksheet();return ws.setSelectionShape(isSelectOnShape)};WorkbookView.prototype._onMouseDblClick= function(x,y,event,callback){var ws=this.getWorksheet();var ct=ws.getCursorTypeFromXY(x,y);if(ct.target===c_oTargetType.ColumnResize||ct.target===c_oTargetType.RowResize){if(ct.target===c_oTargetType.ColumnResize)ws.autoFitColumnsWidth(ct.col);else ws.autoFitRowHeight(ct.row,ct.row);asc_applyFunction(callback)}else{if(!this.canEdit()||c_oTargetType.ColumnHeader===ct.target||c_oTargetType.RowHeader===ct.target||c_oTargetType.Corner===ct.target||c_oTargetType.FrozenAnchorH===ct.target||c_oTargetType.FrozenAnchorV=== ct.target||ws.objectRender.checkCursorDrawingObject(x,y)){asc_applyFunction(callback);return}var enterOptions=new AscCommonExcel.CEditorEnterOptions;enterOptions.focus=null;enterOptions.eventPos=event;this._onEditCell(enterOptions)}};WorkbookView.prototype._onWindowMouseUpExternal=function(event,x,y){this.controller._onWindowMouseUpExternal(event,x,y);if(this.isCellEditMode)this.cellEditor._onWindowMouseUp(event,x,y)};WorkbookView.prototype._onEditCell=function(enterOptions,callback){var t=this;if(this.collaborativeEditing.getGlobalLock()|| this.controller.isResizeMode||!this.canEdit())return;var ws=t.getWorksheet();var activeCellRange=ws.getActiveCell(0,0,false);var selectionRange=ws.model.selectionRange.clone();var activeWsModel=this.model.getActiveWs();if(activeWsModel.inPivotTable(activeCellRange)){this.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}var editFunction=function(){t.setCellEditMode(true);t.hideSpecialPasteButton();ws.openCellEditor(t.cellEditor,enterOptions,selectionRange); t.input.disabled=false;t.Api.cleanSpelling(true);asc_applyFunction(callback,true)};var editLockCallback=function(res){if(!res){t.setCellEditMode(false);t.input.disabled=true;t.collaborativeEditing.onStopEditCell();t.cellEditor.close(false);t._onWSSelectionChanged()}};activeCellRange=ws.expandActiveCellByFormulaArray(activeCellRange);if(ws._isLockedCells(activeCellRange,null,editLockCallback))editFunction()};WorkbookView.prototype._checkStopCellEditorInFormulas=function(){if(this.isCellEditMode&&this.isFormulaEditMode&& this.cellEditor.canEnterCellRange())return true;return this.closeCellEditor()};WorkbookView.prototype._onCloseCellEditor=function(){var isCellEditMode=this.getCellEditMode();this.setCellEditMode(false);if(isCellEditMode)if(window["IS_NATIVE_EDITOR"])window["native"]["closeCellEditor"]();History._sendCanUndoRedo();var ws=this.getWorksheet();ws.cleanSelection();ws.updateSelectionWithSparklines();this._onWSSelectionChanged();if(-1!==this.lastFPos){this.handlers.trigger("asc_onFormulaCompleteMenu",null); this.lastFPos=-1;this.lastFNameLength=0}this.handlers.trigger("asc_onFormulaInfo",null)};WorkbookView.prototype._onEmpty=function(){this.getWorksheet().emptySelection(c_oAscCleanOptions.Text)};WorkbookView.prototype._onShowNextPrevWorksheet=function(direction){var countWorksheets=this.model.getWorksheetCount();var i=this.wsActive+direction,ws;while(i!==this.wsActive){if(0>i)i=countWorksheets-1;else if(i>=countWorksheets)i=0;ws=this.model.getWorksheet(i);if(!ws.getHidden()){this.showWorksheet(i);return true}i+= direction}return false};WorkbookView.prototype._onSetFontAttributes=function(prop){var val;var xfs=this.getSelectionInfo().asc_getXfs();switch(prop){case "b":val=!xfs.asc_getFontBold();break;case "i":val=!xfs.asc_getFontItalic();break;case "u":val=!xfs.asc_getFontUnderline();val=val?Asc.EUnderline.underlineSingle:Asc.EUnderline.underlineNone;break;case "s":val=!xfs.asc_getFontStrikeout();break}return this.setFontAttributes(prop,val)};WorkbookView.prototype._onSetCellFormat=function(prop){var info= new Asc.asc_CFormatCellsInfo;info.asc_setSymbol(AscCommon.g_oDefaultCultureInfo.LCID);info.asc_setType(Asc.c_oAscNumFormatType.None);var formats=AscCommon.getFormatCells(info);this.setCellFormat(formats[prop])};WorkbookView.prototype._onSelectColumnsByRange=function(){this.getWorksheet()._selectColumnsByRange()};WorkbookView.prototype._onSelectRowsByRange=function(){this.getWorksheet()._selectRowsByRange()};WorkbookView.prototype._onShowCellEditorCursor=function(){if(this.getCellEditMode())this.cellEditor.showCursor()}; WorkbookView.prototype._onDocumentPlaceChanged=function(){if(this.isDocumentPlaceChangedEnabled)this.handlers.trigger("asc_onDocumentPlaceChanged")};WorkbookView.prototype.getCellStyles=function(width,height){return AscCommonExcel.generateCellStyles(width,height,this)};WorkbookView.prototype.getSlicerStyles=function(){return AscCommonExcel.generateSlicerStyles(36,49,this)};WorkbookView.prototype.getWorksheetById=function(id,onlyExist){var wsModel=this.model.getWorksheetById(id);if(wsModel)return this.getWorksheet(wsModel.getIndex(), onlyExist);return null};WorkbookView.prototype.getActiveWS=function(){return this.model.getWorksheet(-1===this.copyActiveSheet?this.wsActive:this.copyActiveSheet)};WorkbookView.prototype.getWorksheet=function(index,onlyExist){var wb=this.model;var i=asc_typeof(index)==="number"&&index>=0?index:wb.getActive();var ws=this.wsViews[i];if(!ws&&!onlyExist){ws=this.wsViews[i]=this._createWorksheetView(wb.getWorksheet(i));ws._prepareComments();ws._prepareDrawingObjects()}return ws};WorkbookView.prototype.drawWorksheet= function(){if(-1===this.wsActive)return this.showWorksheet();var ws=this.getWorksheet();ws.draw();ws.objectRender.controller.updateSelectionState();ws.objectRender.controller.updateOverlay();this._onScrollReinitialize(AscCommonExcel.c_oAscScrollType.ScrollVertical|AscCommonExcel.c_oAscScrollType.ScrollHorizontal)};WorkbookView.prototype.showWorksheet=function(index,bLockDraw){if(AscCommon.isFileBuild())return this;var ws,wb=this.model;if(asc_typeof(index)!=="number"||0>index)index=wb.getActive(); if(index===this.wsActive){if(!bLockDraw)this.drawWorksheet();return this}var selectionRange=null;if(-1!==this.wsActive){ws=this.getWorksheet();if(!this._checkStopCellEditorInFormulas())index=this.copyActiveSheet;ws.cleanSelection();this.stopTarget(ws);if(this.selectionDialogMode){if(ws.model.selectionRange)selectionRange=ws.model.selectionRange.getLast().clone(true);ws.cloneSelection(false)}}if(index!==wb.getActive())wb.setActive(index);this.wsActive=index;this.wsMustDraw=bLockDraw;this.handlers.trigger("asc_onActiveSheetChanged", this.wsActive);this.handlers.trigger("asc_onHideComment");ws=this.getWorksheet(index);if(this.selectionDialogMode){ws.cloneSelection(true,selectionRange);this._onSelectionRangeChanged(ws.getSelectionRangeValue())}if(ws.updateResize&&ws.updateZoom)ws.changeZoomResize();else if(ws.updateResize)ws.resize(true,this.cellEditor);else if(ws.updateZoom)ws.changeZoom(true);this.updateGroupData();if(this.cellEditor&&this.isFormulaEditMode)if(this.isActive())this.cellEditor._showCanvas();else this.cellEditor._hideCanvas(); if(!bLockDraw){ws.draw();ws.objectRender.controller.updateSelectionState();ws.objectRender.controller.updateOverlay()}if(!window["NATIVE_EDITOR_ENJINE"]){this._onSelectionNameChanged(ws.getSelectionName(false));this._onWSSelectionChanged();this._onSelectionMathInfoChanged(ws.getSelectionMathInfo())}this._onScrollReinitialize(AscCommonExcel.c_oAscScrollType.ScrollVertical|AscCommonExcel.c_oAscScrollType.ScrollHorizontal);this.toggleAutoCorrectOptions(null,true);window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Hide(); return this};WorkbookView.prototype.stopTarget=function(ws){if(null===ws&&-1!==this.wsActive)ws=this.getWorksheet(this.wsActive);if(null!==ws&&ws.objectRender&&ws.objectRender.drawingDocument)ws.objectRender.drawingDocument.TargetEnd()};WorkbookView.prototype.updateWorksheetByModel=function(){var oldActiveWs;if(-1!==this.wsActive)oldActiveWs=this.wsViews[this.wsActive];var oNewWsViews=[];for(var i in this.wsViews){var item=this.wsViews[i];if(null!=item&&null!=this.model.getWorksheetById(item.model.getId()))oNewWsViews[item.model.getIndex()]= item}this.wsViews=oNewWsViews;var wsActive=this.model.getActive();var newActiveWs=this.wsViews[wsActive];if(undefined===newActiveWs||oldActiveWs!==newActiveWs){this.wsActive=-1;this.showWorksheet(wsActive,true)}else this.wsActive=wsActive};WorkbookView.prototype._canResize=function(){var isRetina=AscBrowser.isRetina;var oldWidth=this.canvas.width;var oldHeight=this.canvas.height;var width,height,styleWidth,styleHeight;width=styleWidth=this.element.offsetWidth-(this.Api.isMobileVersion?0:this.defaults.scroll.widthPx); height=styleHeight=this.element.offsetHeight-(this.Api.isMobileVersion?0:this.defaults.scroll.heightPx);if(isRetina){width=AscCommon.AscBrowser.convertToRetinaValue(width,true);height=AscCommon.AscBrowser.convertToRetinaValue(height,true)}if(oldWidth===width&&oldHeight===height&&this.isInit)return false;this.isInit=true;this.canvas.width=this.canvasOverlay.width=this.canvasGraphic.width=this.canvasGraphicOverlay.width=width;this.canvas.height=this.canvasOverlay.height=this.canvasGraphic.height=this.canvasGraphicOverlay.height= height;this.canvas.style.width=this.canvasOverlay.style.width=this.canvasGraphic.style.width=this.canvasGraphicOverlay.style.width=styleWidth+"px";this.canvas.style.height=this.canvasOverlay.style.height=this.canvasGraphic.style.height=this.canvasGraphicOverlay.style.height=styleHeight+"px";this._reInitGraphics();return true};WorkbookView.prototype._reInitGraphics=function(){var canvasWidth=this.canvasGraphic.width;var canvasHeight=this.canvasGraphic.height;this.shapeCtx.init(this.drawingGraphicCtx.ctx, canvasWidth,canvasHeight,canvasWidth*25.4/this.drawingGraphicCtx.ppiX,canvasHeight*25.4/this.drawingGraphicCtx.ppiY);this.shapeCtx.CalculateFullTransform();var overlayWidth=this.canvasGraphicOverlay.width;var overlayHeight=this.canvasGraphicOverlay.height;this.shapeOverlayCtx.init(this.overlayGraphicCtx.ctx,overlayWidth,overlayHeight,overlayWidth*25.4/this.overlayGraphicCtx.ppiX,overlayHeight*25.4/this.overlayGraphicCtx.ppiY);this.shapeOverlayCtx.CalculateFullTransform();this.mainGraphics.init(this.drawingCtx.ctx, canvasWidth,canvasHeight,canvasWidth*25.4/this.drawingCtx.ppiX,canvasHeight*25.4/this.drawingCtx.ppiY);this.trackOverlay.init(this.shapeOverlayCtx.m_oContext,"ws-canvas-graphic-overlay",0,0,overlayWidth,overlayHeight,overlayWidth*25.4/this.overlayGraphicCtx.ppiX,overlayHeight*25.4/this.overlayGraphicCtx.ppiY);this.autoShapeTrack.init(this.trackOverlay,0,0,overlayWidth,overlayHeight,overlayWidth*25.4/this.overlayGraphicCtx.ppiX,overlayHeight*25.4/this.overlayGraphicCtx.ppiY);this.autoShapeTrack.Graphics.CalculateFullTransform(); if(this.mainOverlay){overlayWidth=this.canvasOverlay.width;overlayHeight=this.canvasOverlay.height;this.mainOverlay.init(this.overlayCtx.ctx,"ws-canvas-overlay",0,0,overlayWidth,overlayHeight,overlayWidth*25.4/this.overlayCtx.ppiX,overlayHeight*25.4/this.overlayCtx.ppiY)}};WorkbookView.prototype.resize=function(event){if(this._canResize()){var item;var activeIndex=this.model.getActive();for(var i in this.wsViews){item=this.wsViews[i];item.resize(i==activeIndex,this.cellEditor)}this.drawWorksheet()}else if(-1=== this.wsActive||this.wsMustDraw)this.drawWorksheet();this.wsMustDraw=false};WorkbookView.prototype.getSelectionInfo=function(){if(!this.oSelectionInfo)this._updateSelectionInfo();return this.oSelectionInfo};WorkbookView.prototype.getCellEditMode=function(){return this.isCellEditMode};WorkbookView.prototype.canEdit=function(){return this.Api.canEdit()};WorkbookView.prototype.getDialogSheetName=function(){return this.dialogSheetName||!this.isActive()};WorkbookView.prototype.setCellEditMode=function(mode){this.isCellEditMode= !!mode;if(!this.isCellEditMode){this.setWizardMode(false);this.setFormulaEditMode(false)}};WorkbookView.prototype.setFormulaEditMode=function(mode){this.isFormulaEditMode=mode;this.setSelectionDialogMode(mode?c_oAscSelectionDialogType.Function:c_oAscSelectionDialogType.None,"")};WorkbookView.prototype.setWizardMode=function(mode){if(mode!==this.isWizardMode){this.isWizardMode=mode;if(this.isWizardMode){this.cellEditor.updateWizardMode(this.isWizardMode);this._onCleanSelectRange(true)}this.input.disabled= this.isWizardMode}};WorkbookView.prototype.isActive=function(){return-1===this.copyActiveSheet||this.wsActive===this.copyActiveSheet};WorkbookView.prototype.isDrawFormatPainter=function(){return this.formatPainterState&&this.formatPainterSheet===this.wsActive};WorkbookView.prototype.getFormatPainterSheet=function(){return this.formatPainterState&&this.model.getWorksheet(this.formatPainterSheet)};WorkbookView.prototype.getIsTrackShape=function(){var ws=this.getWorksheet();if(!ws)return false;if(ws.objectRender&& ws.objectRender.controller)return ws.objectRender.controller.checkTrackDrawings()};WorkbookView.prototype.getZoom=function(){return this.drawingCtx.getZoom()};WorkbookView.prototype.changeZoom=function(factor){if(factor===this.getZoom())return;this.buffers.main.changeZoom(factor);this.buffers.overlay.changeZoom(factor);this.buffers.mainGraphic.changeZoom(factor);this.buffers.overlayGraphic.changeZoom(factor);if(!factor)this.cellEditor.changeZoom(factor);var i,length;for(i=0,length=this.fmgrGraphics.length;i< length;++i)this.fmgrGraphics[i].ClearFontsRasterCache();if(AscCommon.g_fontManager){AscCommon.g_fontManager.ClearFontsRasterCache();AscCommon.g_fontManager.m_pFont=null}if(AscCommon.g_fontManager2){AscCommon.g_fontManager2.ClearFontsRasterCache();AscCommon.g_fontManager2.m_pFont=null}if(!factor){this.wsMustDraw=true;this._calcMaxDigitWidth()}var item;var activeIndex=this.model.getActive();for(i in this.wsViews){item=this.wsViews[i];if(!factor)item._initWorksheetDefaultWidth();item.changeZoom(i==activeIndex); this._reInitGraphics();item.objectRender.changeZoom(this.drawingCtx.scaleFactor);if(i==activeIndex&&factor)item.draw()}this._onScrollReinitialize(AscCommonExcel.c_oAscScrollType.ScrollVertical|AscCommonExcel.c_oAscScrollType.ScrollHorizontal);this.handlers.trigger("asc_onZoomChanged",this.getZoom())};WorkbookView.prototype.getEnableKeyEventsHandler=function(bIsNaturalFocus){var res=this.enableKeyEvents;if(res&&bIsNaturalFocus&&this.getCellEditMode()&&this.input.isFocused)res=false;return res};WorkbookView.prototype.enableKeyEventsHandler= function(f){this.enableKeyEvents=!!f;this.controller.enableKeyEventsHandler(this.enableKeyEvents);if(this.cellEditor)this.cellEditor.enableKeyEventsHandler(this.enableKeyEvents)};WorkbookView.prototype.closeCellEditor=function(cancel){return this.getCellEditMode()?this.cellEditor.close(!cancel):true};WorkbookView.prototype.restoreFocus=function(){if(window["NATIVE_EDITOR_ENJINE"])return;if(this.cellEditor.hasFocus)this.cellEditor.restoreFocus()};WorkbookView.prototype._onUpdateCellEditor=function(text, cursorPosition,fPos,fName){if(this.skipHelpSelector)return;var i,arrResult=[],defNamesList,defName,defNameStr;if(fName){fName=fName.toUpperCase();for(i=0;i<this.formulasList.length;++i)if(0===this.formulasList[i].indexOf(fName))arrResult.push(new AscCommonExcel.asc_CCompleteMenu(this.formulasList[i],c_oAscPopUpSelectorType.Func));defNamesList=this.getDefinedNames(Asc.c_oAscGetDefinedNamesList.WorksheetWorkbook);fName=fName.toLowerCase();for(i=0;i<defNamesList.length;++i){defName=defNamesList[i];defNameStr= defName.Name.toLowerCase();if(null!==defName.LocalSheetId&&defNameStr==="print_area")defNameStr=AscCommon.translateManager.getValue("Print_Area");if(0===defNameStr.toLowerCase().indexOf(fName)){var _type=c_oAscPopUpSelectorType.Range;if(defName.type===Asc.c_oAscDefNameType.slicer)_type=c_oAscPopUpSelectorType.Slicer;else if(defName.type===Asc.c_oAscDefNameType.table)_type=c_oAscPopUpSelectorType.Table;arrResult.push(new AscCommonExcel.asc_CCompleteMenu(defNameStr,_type))}}}if(0<arrResult.length){this.handlers.trigger("asc_onFormulaCompleteMenu", arrResult);this.lastFPos=fPos;this.lastFNameLength=fName.length}else{this.handlers.trigger("asc_onFormulaCompleteMenu",null);this.lastFPos=-1;this.lastFNameLength=0}};WorkbookView.prototype.insertInCellEditor=function(name,type,autoComplete){var t=this,ws=this.getWorksheet(),cursorPos,tmp;var isNotFunction=c_oAscPopUpSelectorType.Func!==type;if(this.getCellEditMode()){if(isNotFunction)this.skipHelpSelector=true;if(-1!==this.lastFPos){if(-1===this.arrExcludeFormulas.indexOf(name)&&!isNotFunction){if("("!== this.cellEditor.textRender.getChars(this.cellEditor.cursorPos,1))name+="("}else this.skipHelpSelector=true;tmp=this.cellEditor.skipTLUpdate;this.cellEditor.skipTLUpdate=false;this.cellEditor.replaceText(this.lastFPos,this.lastFNameLength,name);this.cellEditor.skipTLUpdate=tmp}else if(false===this.cellEditor.insertFormula(name,isNotFunction))this.cellEditor.close(true);this.skipHelpSelector=false}else{if(c_oAscPopUpSelectorType.None===type){ws.setSelectionInfo("value",name,true);return}else if(c_oAscPopUpSelectorType.TotalRowFunc=== type){ws.setSelectionInfo("totalRowFunc",name,true);return}var callback=function(success){if(isNotFunction)t.skipHelpSelector=false};var cellRange={};if(autoComplete)cellRange=ws.autoCompleteFormula(name);if(isNotFunction)name="="+name;else{if(cellRange.notEditCell)return;if(cellRange.text)name="="+name+"("+cellRange.text+")";else name="="+name+"()";cursorPos=name.length-1}if(isNotFunction)t.skipHelpSelector=true;var enterOptions=new AscCommonExcel.CEditorEnterOptions;enterOptions.newText=name;enterOptions.cursorPos= cursorPos;this._onEditCell(enterOptions,callback)}};WorkbookView.prototype.startWizard=function(name,doCleanCellContent){var t=this;var callback=function(success){if(success)addFunction(name)};var addFunction=function(name){t.setWizardMode(true);if(doCleanCellContent||!t.cellEditor.isFormula()){t.cellEditor.selectionBegin=0;t.cellEditor.selectionEnd=t.cellEditor.textRender.getEndOfText()}t.cellEditor.insertFormula(name);var res=name?new AscCommonExcel.CFunctionInfo(name):null;t.handlers.trigger("asc_onSendFunctionWizardInfo", res)};if(!this.getCellEditMode()){if(!name)this.cellEditor.needFindFirstFunction=true;this._onEditCell(new AscCommonExcel.CEditorEnterOptions,callback);return}addFunction(name)};WorkbookView.prototype.canEnterWizardRange=function(char){return this.getCellEditMode()&&this.cellEditor.checkSymbolBeforeRange(char)};WorkbookView.prototype.insertArgumentsInFormula=function(args,argNum,argType,name){if(this.getCellEditMode()){var sArguments=args.join(AscCommon.FormulaSeparators.functionArgumentSeparator); this.cellEditor.changeCellText(sArguments);if(name){var ws=this.getActiveWS();var res=new AscCommonExcel.CFunctionInfo(name);res.argumentsResult=[];var argCalc=ws.calculateWizardFormula(args[argNum],argType);res.argumentsResult[argNum]=argCalc.str;if(argCalc.obj&&argCalc.obj.type!==AscCommonExcel.cElementType.error){var funcCalc=ws.calculateWizardFormula(name+"("+sArguments+")");res.functionResult=funcCalc.str;if(funcCalc.obj&&funcCalc.obj.type!==AscCommonExcel.cElementType.error)res.formulaResult= ws.calculateWizardFormula(this.cellEditor.getText().substring(1)).str}return res}}return null};WorkbookView.prototype.bIsEmptyClipboard=function(){return g_clipboardExcel.bIsEmptyClipboard(this.getCellEditMode())};WorkbookView.prototype.checkCopyToClipboard=function(_clipboard,_formats){var t=this,ws;ws=t.getWorksheet();g_clipboardExcel.checkCopyToClipboard(ws,_clipboard,_formats)};WorkbookView.prototype.pasteData=function(_format,data1,data2,text_data,doNotShowButton){var t=this,ws;ws=t.getWorksheet(); g_clipboardExcel.pasteData(ws,_format,data1,data2,text_data,null,doNotShowButton)};WorkbookView.prototype.specialPasteData=function(props){if(!this.getCellEditMode())this.getWorksheet().specialPaste(props)};WorkbookView.prototype.showSpecialPasteButton=function(props){if(!this.getCellEditMode())this.getWorksheet().showSpecialPasteOptions(props)};WorkbookView.prototype.updateSpecialPasteButton=function(props){if(!this.getCellEditMode())this.getWorksheet().updateSpecialPasteButton(props)};WorkbookView.prototype.hideSpecialPasteButton= function(){this.handlers.trigger("hideSpecialPasteOptions")};WorkbookView.prototype.selectionCut=function(){if(this.getCellEditMode())this.cellEditor.cutSelection();else if(this.getWorksheet().isNeedSelectionCut())this.getWorksheet().emptySelection(c_oAscCleanOptions.All,true);else if(false===this.getWorksheet().isMultiSelect()){this.cutIdSheet=this.getWorksheet().model.Id;this.getWorksheet().cutRange=this.getWorksheet().model.selectionRange.getLast()}};WorkbookView.prototype.undo=function(){var oFormulaLocaleInfo= AscCommonExcel.oFormulaLocaleInfo;oFormulaLocaleInfo.Parse=false;oFormulaLocaleInfo.DigitSep=false;if(!this.getCellEditMode()){if(!History.Undo()&&this.collaborativeEditing.getFast()&&this.collaborativeEditing.getCollaborativeEditing())this.Api.sync_TryUndoInFastCollaborative()}else this.cellEditor.undo();oFormulaLocaleInfo.Parse=true;oFormulaLocaleInfo.DigitSep=true};WorkbookView.prototype.redo=function(){if(!this.getCellEditMode())History.Redo();else this.cellEditor.redo()};WorkbookView.prototype.setFontAttributes= function(prop,val){if(!this.getCellEditMode())this.getWorksheet().setSelectionInfo(prop,val);else this.cellEditor.setTextStyle(prop,val)};WorkbookView.prototype.changeFontSize=function(prop,val){if(!this.getCellEditMode())this.getWorksheet().setSelectionInfo(prop,val);else this.cellEditor.setTextStyle(prop,val)};WorkbookView.prototype.setCellFormat=function(format){this.getWorksheet().setSelectionInfo("format",format)};WorkbookView.prototype.emptyCells=function(options){if(!this.getCellEditMode()){if(Asc.c_oAscCleanOptions.Comments=== options)this.removeAllComments(false,true);else this.getWorksheet().emptySelection(options);this.restoreFocus()}else this.cellEditor.empty(options)};WorkbookView.prototype._setSelectionDialogType=function(selectionDialogType){this.dialogSheetName=c_oAscSelectionDialogType.Chart===selectionDialogType||c_oAscSelectionDialogType.PivotTableData===selectionDialogType||c_oAscSelectionDialogType.PivotTableReport===selectionDialogType;this.dialogAbsName=c_oAscSelectionDialogType.None!==selectionDialogType&& c_oAscSelectionDialogType.Function!==selectionDialogType};WorkbookView.prototype.setSelectionDialogMode=function(selectionDialogType,selectRange){var newSelectionDialogMode=c_oAscSelectionDialogType.None!==selectionDialogType;if(newSelectionDialogMode===this.selectionDialogMode)return;this._setSelectionDialogType(selectionDialogType);var drawSelection=false;if(newSelectionDialogMode){this.copyActiveSheet=this.wsActive;var tmpSelectRange;if(c_oAscSelectionDialogType.Chart===selectionDialogType)if(typeof selectRange=== "string"&&selectRange[0]==="=")tmpSelectRange=AscCommon.parserHelp.parse3DRef(selectRange.slice(1));else tmpSelectRange=AscCommon.parserHelp.parse3DRef(selectRange);else tmpSelectRange=AscCommon.parserHelp.parse3DRef(selectRange);if(tmpSelectRange){var ws=this.model.getWorksheetByName(tmpSelectRange.sheet);if(!ws||ws.getHidden())tmpSelectRange=null;else{var index=ws.getIndex();if(index!==this.wsActive)this.showWorksheet(index);tmpSelectRange=tmpSelectRange.range}}else tmpSelectRange=selectRange;this.getWorksheet().cloneSelection(true, tmpSelectRange&&AscCommonExcel.g_oRangeCache.getAscRange(tmpSelectRange));this.selectionDialogMode=newSelectionDialogMode;this.input.disabled=!this.isFormulaEditMode||this.isWizardMode;drawSelection=true}else{this.selectionDialogMode=newSelectionDialogMode;this.getWorksheet().cloneSelection(false);if(this.copyActiveSheet!==this.wsActive)this.showWorksheet(this.copyActiveSheet);else drawSelection=true;this.copyActiveSheet=-1;this.input.disabled=false}if(drawSelection)this.getWorksheet()._drawSelection()}; WorkbookView.prototype.formatPainter=function(formatPainterState,bLockDraw){var ws=this.getWorksheet();if(!bLockDraw)ws.cleanSelection();this.formatPainterState=null!=formatPainterState?formatPainterState:c_oAscFormatPainterState.kOff!==this.formatPainterState?c_oAscFormatPainterState.kOff:c_oAscFormatPainterState.kOn;if(this.formatPainterState){this.formatPainterSheet=this.wsActive;this.formatPainterRange=ws.model.selectionRange.clone()}else{this.formatPainterSheet=this.formatPainterRange=null;this.handlers.trigger("asc_onStopFormatPainter")}if(!bLockDraw)ws.updateSelectionWithSparklines()}; WorkbookView.prototype.findCellText=function(options){this.closeCellEditor();options.selectionRange=null;var result=this.model.findCellText(options);if(result){var ws=this.getWorksheet();var range=new Asc.Range(result.col,result.row,result.col,result.row);options.findInSelection?ws.setActiveCell(result):ws.setSelection(range);return true}return null};WorkbookView.prototype.replaceCellText=function(options){this.closeCellEditor();if(!options.isMatchCase)options.findWhat=options.findWhat.toLowerCase(); options.findRegExp=AscCommonExcel.getFindRegExp(options.findWhat,options);History.Create_NewPoint();History.StartTransaction();options.clearFindAll();if(options.isReplaceAll)this.Api.sync_StartAction(c_oAscAsyncActionType.BlockInteraction,c_oAscAsyncAction.SlowOperation);var ws=this.getWorksheet();ws.replaceCellText(options,false,this.fReplaceCallback)};WorkbookView.prototype._replaceCellTextCallback=function(options){if(!options.error){options.updateFindAll();if(!options.scanOnOnlySheet&&options.isReplaceAll){var i= ++options.sheetIndex;if(this.model.getActive()===i)i=++options.sheetIndex;if(i<this.model.getWorksheetCount()){var ws=this.getWorksheet(i);ws.replaceCellText(options,true,this.fReplaceCallback);return}options.sheetIndex=-1}this.handlers.trigger("asc_onRenameCellTextEnd",options.countFindAll,options.countReplaceAll)}History.EndTransaction();if(options.isReplaceAll)this.Api.sync_EndAction(c_oAscAsyncActionType.BlockInteraction,c_oAscAsyncAction.SlowOperation)};WorkbookView.prototype.getDefinedNames= function(defNameListId,excludeErrorRefNames){return this.model.getDefinedNamesWB(defNameListId,true,excludeErrorRefNames)};WorkbookView.prototype.setDefinedNames=function(defName){this.model.setDefinesNames(defName.Name,defName.Ref,defName.Scope);this.handlers.trigger("asc_onDefName")};WorkbookView.prototype.editDefinedNames=function(oldName,newName){if(this.collaborativeEditing.getGlobalLock()||!this.canEdit())return;var ws=this.getWorksheet(),t=this;var editDefinedNamesCallback=function(res){if(res){if(oldName&& oldName.asc_getType()===Asc.c_oAscDefNameType.table)ws.model.autoFilters.changeDisplayNameTable(oldName.asc_getName(),newName.asc_getName());else t.model.editDefinesNames(oldName,newName);if(oldName&&newName)ws.model.changeSlicerCacheName(oldName.asc_getName(),newName.asc_getName());t.handlers.trigger("asc_onEditDefName",oldName,newName);if(!(t.collaborativeEditing.getCollaborativeEditing()&&t.collaborativeEditing.getFast()))t.handlers.trigger("asc_onRefreshDefNameList")}else t.handlers.trigger("asc_onError", c_oAscError.ID.LockCreateDefName,c_oAscError.Level.NoCritical);t._onSelectionNameChanged(ws.getSelectionName(false));if(ws.viewPrintLines)ws.updateSelection()};var defNameId;if(oldName){defNameId=t.model.getDefinedName(oldName);defNameId=defNameId?defNameId.getNodeId():null}var callback=function(){ws._isLockedDefNames(editDefinedNamesCallback,defNameId)};var tableRange;if(oldName&&oldName.type===Asc.c_oAscDefNameType.table){var table=ws.model.autoFilters._getFilterByDisplayName(oldName.Name);if(table)tableRange= table.Ref}else if(oldName){var slicerCache=ws.model.getSlicerCacheByCacheName(oldName.Name);if(slicerCache)tableRange=slicerCache.getRange()}if(tableRange)ws._isLockedCells(tableRange,null,callback);else callback()};WorkbookView.prototype.delDefinedNames=function(oldName){if(this.collaborativeEditing.getGlobalLock()||!this.canEdit())return;var ws=this.getWorksheet(),t=this;if(oldName){var delDefinedNamesCallback=function(res){if(res){t.model.delDefinesNames(oldName);t.handlers.trigger("asc_onRefreshDefNameList")}else t.handlers.trigger("asc_onError", c_oAscError.ID.LockCreateDefName,c_oAscError.Level.NoCritical);t._onSelectionNameChanged(ws.getSelectionName(false));if(ws.viewPrintLines)ws.updateSelection()};var defNameId=t.model.getDefinedName(oldName).getNodeId();ws._isLockedDefNames(delDefinedNamesCallback,defNameId)}};WorkbookView.prototype.getDefaultDefinedName=function(){var val=this.getWorksheet().getDefaultDefinedNameText();return new Asc.asc_CDefName(val,this.getWorksheet().getSelectionRangeValue(true,true),null)};WorkbookView.prototype.getDefaultTableStyle= function(){return this.model.TableStyles.DefaultTableStyle};WorkbookView.prototype.unlockDefName=function(){this.model.unlockDefName();this.handlers.trigger("asc_onRefreshDefNameList");this.handlers.trigger("asc_onLockDefNameManager",Asc.c_oAscDefinedNameReason.OK)};WorkbookView.prototype.unlockCurrentDefName=function(name,sheetId){this.model.unlockCurrentDefName(name,sheetId)};WorkbookView.prototype._onCheckDefNameLock=function(){return this.model.checkDefNameLock()};WorkbookView.prototype.printSheets= function(printPagesData,pdfDocRenderer){var viewZoom=this.getZoom();this.changeZoom(1);var pdfPrinter=new AscCommonExcel.CPdfPrinter(this.fmgrGraphics[3],this.m_oFont);if(pdfDocRenderer)pdfPrinter.DocumentRenderer=pdfDocRenderer;var ws;if(0===printPagesData.arrPages.length){ws=this.getWorksheet();ws.drawForPrint(pdfPrinter,null)}else{var indexWorksheet=-1;var indexWorksheetTmp=-1;for(var i=0;i<printPagesData.arrPages.length;++i){indexWorksheetTmp=printPagesData.arrPages[i].indexWorksheet;if(indexWorksheetTmp!== indexWorksheet){ws=this.getWorksheet(indexWorksheetTmp);indexWorksheet=indexWorksheetTmp}ws.drawForPrint(pdfPrinter,printPagesData.arrPages[i],i,printPagesData.arrPages.length)}}this.changeZoom(viewZoom);return pdfPrinter};WorkbookView.prototype._calcPagesPrintSheet=function(index,printPagesData,onlySelection,adjustPrint){var ws=this.model.getWorksheet(index);var wsView=this.getWorksheet(index);if(!ws.getHidden()){var pageOptionsMap=adjustPrint?adjustPrint.asc_getPageOptionsMap():null;var pagePrintOptions= pageOptionsMap&&pageOptionsMap[index]?pageOptionsMap[index]:ws.PagePrintOptions;wsView.calcPagesPrint(pagePrintOptions,onlySelection,index,printPagesData.arrPages,null,adjustPrint)}};WorkbookView.prototype.calcPagesPrint=function(adjustPrint){if(!adjustPrint)adjustPrint=new Asc.asc_CAdjustPrint;var viewZoom=this.getZoom();this.changeZoom(1);var printPagesData=new asc_CPrintPagesData;var printType=adjustPrint.asc_getPrintType();if(printType===Asc.c_oAscPrintType.ActiveSheets)this._calcPagesPrintSheet(this.model.getActive(), printPagesData,false,adjustPrint);else if(printType===Asc.c_oAscPrintType.EntireWorkbook){var countWorksheets=this.model.getWorksheetCount();for(var i=0;i<countWorksheets;++i){if(adjustPrint.isOnlyFirstPage&&i!==0)break;this._calcPagesPrintSheet(i,printPagesData,false,adjustPrint)}}else if(printType===Asc.c_oAscPrintType.Selection)this._calcPagesPrintSheet(this.model.getActive(),printPagesData,true,adjustPrint);if(AscCommonExcel.c_kMaxPrintPages===printPagesData.arrPages.length)this.handlers.trigger("asc_onError", c_oAscError.ID.PrintMaxPagesCount,c_oAscError.Level.NoCritical);this.changeZoom(viewZoom);return printPagesData};WorkbookView.prototype._nativeCalculate=function(){var item;for(var i in this.wsViews){item=this.wsViews[i];item._cleanCellsTextMetricsCache();item._prepareDrawingObjects()}};WorkbookView.prototype.calculate=function(type){this.model.calculate(type);this.drawWS()};WorkbookView.prototype.drawWS=function(){this.getWorksheet().draw()};WorkbookView.prototype.onShowDrawingObjects=function(){var ws= this.getWorksheet();ws.objectRender.showDrawingObjects()};WorkbookView.prototype.insertHyperlink=function(options){var ws=this.getWorksheet();if(ws.objectRender.selectedGraphicObjectsExists()){if(ws.objectRender.controller.canAddHyperlink())ws.objectRender.controller.insertHyperlink(options)}else{ws.setSelectionInfo("hyperlink",options);this.restoreFocus()}};WorkbookView.prototype.removeHyperlink=function(){var ws=this.getWorksheet();if(ws.objectRender.selectedGraphicObjectsExists())ws.objectRender.controller.removeHyperlink(); else ws.setSelectionInfo("rh")};WorkbookView.prototype.setDocumentPlaceChangedEnabled=function(val){this.isDocumentPlaceChangedEnabled=val};WorkbookView.prototype.showComments=function(val,isShowSolved){if(this.isShowComments!==val||this.isShowSolved!==isShowSolved){this.isShowComments=val;this.isShowSolved=isShowSolved;this.drawWS()}};WorkbookView.prototype.removeComment=function(id){var ws=this.getWorksheet();ws.cellCommentator.removeComment(id);this.cellCommentator.removeComment(id)};WorkbookView.prototype.removeAllComments= function(isMine,isCurrent){var range;var ws=this.getWorksheet();isMine=isMine?this.Api.DocInfo&&this.Api.DocInfo.get_UserId():null;History.Create_NewPoint();History.StartTransaction();if(isCurrent)ws._getSelection().ranges.forEach(function(item){ws.cellCommentator.deleteCommentsRange(item,isMine)});else{range=new Asc.Range(0,0,AscCommon.gc_nMaxCol0,AscCommon.gc_nMaxRow0);this.cellCommentator.deleteCommentsRange(range,isMine);ws.cellCommentator.deleteCommentsRange(range,isMine)}History.EndTransaction()}; WorkbookView.prototype.setFontRenderingMode=function(mode,isInit){if(mode!==this.fontRenderingMode){this.fontRenderingMode=mode;if(c_oAscFontRenderingModeType.noHinting===mode)this._setHintsProps(false,false);else if(c_oAscFontRenderingModeType.hinting===mode)this._setHintsProps(true,false);else if(c_oAscFontRenderingModeType.hintingAndSubpixeling===mode)this._setHintsProps(true,true);if(!isInit){this.drawWS();this.cellEditor.setFontRenderingMode(mode)}}};WorkbookView.prototype.initFormulasList=function(){this.formulasList= [];var oFormulaList=AscCommonExcel.cFormulaFunctionLocalized?AscCommonExcel.cFormulaFunctionLocalized:AscCommonExcel.cFormulaFunction;for(var f in oFormulaList)this.formulasList.push(f);this.arrExcludeFormulas=[cBoolLocal.t,cBoolLocal.f]};WorkbookView.prototype._setHintsProps=function(bIsHinting,bIsSubpixHinting){var manager;for(var i=0,length=this.fmgrGraphics.length;i<length;++i){manager=this.fmgrGraphics[i];if(i===length-1)bIsHinting=bIsSubpixHinting=false;manager.SetHintsProps(bIsHinting,bIsSubpixHinting)}}; WorkbookView.prototype._calcMaxDigitWidth=function(){this.buffers.main.setFont(AscCommonExcel.g_oDefaultFormat.Font);this.stringRender.measureString("0123456789",new AscCommonExcel.CellFlags);this.model.maxDigitWidth=this.maxDigitWidth=this.stringRender.getWidestCharWidth();if(!this.maxDigitWidth)throw"Error: can't measure text string";this.defaults.worksheetView.cells.padding=Math.max(asc.ceil(this.maxDigitWidth/4),2);this.model.paddingPlusBorder=2*this.defaults.worksheetView.cells.padding+1};WorkbookView.prototype.getPivotMergeStyle= function(sheetMergedStyles,range,style,pivot){var styleInfo=pivot.asc_getStyleInfo();var i,r,dxf,stripe1,stripe2,emptyStripe=new Asc.CTableStyleElement;if(style){dxf=style.wholeTable&&style.wholeTable.dxf;if(dxf)sheetMergedStyles.setTablePivotStyle(range,dxf);if(styleInfo.showColStripes){stripe1=style.firstColumnStripe||emptyStripe;stripe2=style.secondColumnStripe||emptyStripe;if(stripe1.dxf)sheetMergedStyles.setTablePivotStyle(range,stripe1.dxf,new Asc.CTableStyleStripe(stripe1.size,stripe2.size)); if(stripe2.dxf&&range.c1+stripe1.size<=range.c2)sheetMergedStyles.setTablePivotStyle(new Asc.Range(range.c1+stripe1.size,range.r1,range.c2,range.r2),stripe2.dxf,new Asc.CTableStyleStripe(stripe2.size,stripe1.size))}if(styleInfo.showRowStripes){stripe1=style.firstRowStripe||emptyStripe;stripe2=style.secondRowStripe||emptyStripe;if(stripe1.dxf)sheetMergedStyles.setTablePivotStyle(range,stripe1.dxf,new Asc.CTableStyleStripe(stripe1.size,stripe2.size,true));if(stripe2.dxf&&range.r1+stripe1.size<=range.r2)sheetMergedStyles.setTablePivotStyle(new Asc.Range(range.c1, range.r1+stripe1.size,range.c2,range.r2),stripe2.dxf,new Asc.CTableStyleStripe(stripe2.size,stripe1.size,true))}dxf=style.firstColumn&&style.firstColumn.dxf;if(styleInfo.showRowHeaders&&dxf)sheetMergedStyles.setTablePivotStyle(new Asc.Range(range.c1,range.r1,range.c1,range.r2),dxf);dxf=style.headerRow&&style.headerRow.dxf;if(styleInfo.showColHeaders&&dxf)sheetMergedStyles.setTablePivotStyle(new Asc.Range(range.c1,range.r1,range.c2,range.r1),dxf);dxf=style.firstHeaderCell&&style.firstHeaderCell.dxf; if(styleInfo.showColHeaders&&styleInfo.showRowHeaders&&dxf)sheetMergedStyles.setTablePivotStyle(new Asc.Range(range.c1,range.r1,range.c1,range.r1),dxf);if(pivot.asc_getColGrandTotals()){dxf=style.lastColumn&&style.lastColumn.dxf;if(dxf)sheetMergedStyles.setTablePivotStyle(new Asc.Range(range.c2,range.r1,range.c2,range.r2),dxf)}if(styleInfo.showRowHeaders)for(i=range.r1+1;i<range.r2;++i){r=i-(range.r1+1);if(0===r%3)dxf=style.firstRowSubheading;if(dxf=dxf&&dxf.dxf)sheetMergedStyles.setTablePivotStyle(new Asc.Range(range.c1, i,range.c2,i),dxf)}if(pivot.asc_getRowGrandTotals()){dxf=style.totalRow&&style.totalRow.dxf;if(dxf)sheetMergedStyles.setTablePivotStyle(new Asc.Range(range.c1,range.r2,range.c2,range.r2),dxf)}}};WorkbookView.prototype.getTableStyles=function(props,bPivotTable){var wb=this.model;var t=this;var result=[];var canvas=document.createElement("canvas");var tableStyleInfo;var pivotStyleInfo;var defaultStyles,styleThumbnailHeight,row,col=5;var styleThumbnailWidth=window["IS_NATIVE_EDITOR"]?90:61;if(bPivotTable){styleThumbnailHeight= 49;row=8;defaultStyles=wb.TableStyles.DefaultStylesPivot;pivotStyleInfo=props}else{styleThumbnailHeight=window["IS_NATIVE_EDITOR"]?48:46;row=5;defaultStyles=wb.TableStyles.DefaultStyles;tableStyleInfo=new AscCommonExcel.TableStyleInfo;if(props){tableStyleInfo.ShowColumnStripes=props.asc_getBandVer();tableStyleInfo.ShowFirstColumn=props.asc_getFirstCol();tableStyleInfo.ShowLastColumn=props.asc_getLastCol();tableStyleInfo.ShowRowStripes=props.asc_getBandHor();tableStyleInfo.HeaderRowCount=props.asc_getFirstRow(); tableStyleInfo.TotalsRowCount=props.asc_getLastRow()}else{tableStyleInfo.ShowColumnStripes=false;tableStyleInfo.ShowFirstColumn=false;tableStyleInfo.ShowLastColumn=false;tableStyleInfo.ShowRowStripes=true;tableStyleInfo.HeaderRowCount=true;tableStyleInfo.TotalsRowCount=false}}if(AscBrowser.isRetina){styleThumbnailWidth=AscCommon.AscBrowser.convertToRetinaValue(styleThumbnailWidth,true);styleThumbnailHeight=AscCommon.AscBrowser.convertToRetinaValue(styleThumbnailHeight,true)}canvas.width=styleThumbnailWidth; canvas.height=styleThumbnailHeight;var sizeInfo={w:styleThumbnailWidth,h:styleThumbnailHeight,row:row,col:col};var ctx=new Asc.DrawingContext({canvas:canvas,units:0,fmgrGraphics:this.fmgrGraphics,font:this.m_oFont});var addStyles=function(styles,type,bEmptyStyle){var style;for(var i in styles)if(bPivotTable&&styles[i].pivot||!bPivotTable&&styles[i].table){if(window["IS_NATIVE_EDITOR"])window["native"]["BeginDrawStyle"](type,i);t._drawTableStyle(ctx,styles[i],tableStyleInfo,pivotStyleInfo,sizeInfo); if(window["IS_NATIVE_EDITOR"])window["native"]["EndDrawStyle"]();else{style=new AscCommon.CStyleImage;style.name=bEmptyStyle?null:i;style.displayName=styles[i].displayName;style.type=type;style.image=canvas.toDataURL("image/png");result.push(style)}}};addStyles(wb.TableStyles.CustomStyles,AscCommon.c_oAscStyleImage.Document);if(props){var emptyStyle=new Asc.CTableStyle;emptyStyle.displayName="None";emptyStyle.pivot=bPivotTable;addStyles({null:emptyStyle},AscCommon.c_oAscStyleImage.Default,true)}addStyles(defaultStyles, AscCommon.c_oAscStyleImage.Default);return result};WorkbookView.prototype._drawTableStyle=function(ctx,style,tableStyleInfo,pivotStyleInfo,size){ctx.clear();var w=size.w;var h=size.h;var row=size.row;var col=size.col;var startX=1;var startY=1;var ySize=h-1-2*startY;var xSize=w-2*startX;var stepY=ySize/row;var stepX=xSize/col;var lineStepX=(xSize-1)/5;var whiteColor=new CColor(255,255,255);var blackColor=new CColor(0,0,0);var defaultColor;if(!style||!style.wholeTable||!style.wholeTable.dxf.font)defaultColor= blackColor;else defaultColor=style.wholeTable.dxf.font.getColor();ctx.setFillStyle(whiteColor);ctx.fillRect(0,0,xSize+2*startX,ySize+2*startY);var calculateLineVer=function(color,x,y1,y2){ctx.beginPath();ctx.setStrokeStyle(color);ctx.lineVer(x+startX,y1+startY,y2+startY);ctx.stroke();ctx.closePath()};var calculateLineHor=function(color,x1,y,x2){ctx.beginPath();ctx.setStrokeStyle(color);ctx.lineHor(x1+startX,y+startY,x2+startX);ctx.stroke();ctx.closePath()};var calculateRect=function(color,x1,y1,w, h){ctx.beginPath();ctx.setFillStyle(color);ctx.fillRect(x1+startX,y1+startY,w,h);ctx.closePath()};var bbox=new Asc.Range(0,0,col-1,row-1);var sheetMergedStyles=new AscCommonExcel.SheetMergedStyles;var hiddenManager=new AscCommonExcel.HiddenManager(null);if(pivotStyleInfo)this.getPivotMergeStyle(sheetMergedStyles,bbox,style,pivotStyleInfo);else if(tableStyleInfo)style.initStyle(sheetMergedStyles,bbox,tableStyleInfo,null!==tableStyleInfo.HeaderRowCount?tableStyleInfo.HeaderRowCount:1,null!==tableStyleInfo.TotalsRowCount? tableStyleInfo.TotalsRowCount:0);var compiledStylesArr=[];for(var i=0;i<row;i++)for(var j=0;j<col;j++){var color=null,prevStyle;var curStyle=AscCommonExcel.getCompiledStyle(sheetMergedStyles,hiddenManager,i,j);if(!compiledStylesArr[i])compiledStylesArr[i]=[];compiledStylesArr[i][j]=curStyle;color=curStyle&&curStyle.fill&&curStyle.fill.bg();if(color)calculateRect(color,j*stepX,i*stepY,stepX,stepY);prevStyle=j-1>=0?compiledStylesArr[i][j-1]:null;color=AscCommonExcel.getMatchingBorder(prevStyle&&prevStyle.border&& prevStyle.border.r,curStyle&&curStyle.border&&curStyle.border.l);if(color&&color.w>0)calculateLineVer(color.c,j*lineStepX,i*stepY,(i+1)*stepY);color=curStyle&&curStyle.border&&curStyle.border.r;if(color&&color.w>0)calculateLineVer(color.c,(j+1)*lineStepX,i*stepY,(i+1)*stepY);prevStyle=i-1>=0?compiledStylesArr[i-1][j]:null;color=AscCommonExcel.getMatchingBorder(prevStyle&&prevStyle.border&&prevStyle.border.b,curStyle&&curStyle.border&&curStyle.border.t);if(color&&color.w>0)calculateLineHor(color.c, j*stepX,i*stepY,(j+1)*stepX);color=curStyle&&curStyle.border&&curStyle.border.b;if(color&&color.w>0)calculateLineHor(color.c,j*stepX,(i+1)*stepY,(j+1)*stepX);color=curStyle&&curStyle.font&&curStyle.font.c||defaultColor;calculateLineHor(color,j*lineStepX+3,(i+1)*stepY-stepY/2,(j+1)*lineStepX-2)}};WorkbookView.prototype.IsSelectionUse=function(){return!this.getWorksheet().getSelectionShape()};WorkbookView.prototype.GetSelectionRectsBounds=function(){var ws=this.getWorksheet();if(ws.getSelectionShape())return null; var range=ws.model.getSelection().getLast();var type=range.getType();var l=ws.getCellLeft(range.c1,3);var t=ws.getCellTop(range.r1,3);var offset=ws.getCellsOffset(3);return{X:asc.c_oAscSelectionType.RangeRow===type?-offset.left:l-offset.left,Y:asc.c_oAscSelectionType.RangeCol===type?-offset.top:t-offset.top,W:asc.c_oAscSelectionType.RangeRow===type?offset.left:ws.getCellLeft(range.c2,3)-l+ws.getColumnWidth(range.c2,3),H:asc.c_oAscSelectionType.RangeCol===type?offset.top:ws.getCellTop(range.r2,3)- t+ws.getRowHeight(range.r2,3),T:type}};WorkbookView.prototype.GetCaptionSize=function(){var offset=this.getWorksheet().getCellsOffset(3);return{W:offset.left,H:offset.top}};WorkbookView.prototype.ConvertXYToLogic=function(x,y){return this.getWorksheet().ConvertXYToLogic(x,y)};WorkbookView.prototype.ConvertLogicToXY=function(xL,yL){return this.getWorksheet().ConvertLogicToXY(xL,yL)};WorkbookView.prototype.changeFormatTableInfo=function(tableName,optionType,val){var ws=this.getWorksheet();return ws.af_changeFormatTableInfo(tableName, optionType,val)};WorkbookView.prototype.applyAutoCorrectOptions=function(val){var api=window["Asc"]["editor"];var prevProps;switch(val){case Asc.c_oAscAutoCorrectOptions.UndoTableAutoExpansion:{prevProps={props:this.autoCorrectStore.props,cell:this.autoCorrectStore.cell,wsId:this.autoCorrectStore.wsId};api.asc_Undo();this.autoCorrectStore=prevProps;this.autoCorrectStore.props[0]=Asc.c_oAscAutoCorrectOptions.RedoTableAutoExpansion;this.toggleAutoCorrectOptions(true);break}case Asc.c_oAscAutoCorrectOptions.RedoTableAutoExpansion:{prevProps= {props:this.autoCorrectStore.props,cell:this.autoCorrectStore.cell,wsId:this.autoCorrectStore.wsId};api.asc_Redo();this.autoCorrectStore=prevProps;this.autoCorrectStore.props[0]=Asc.c_oAscAutoCorrectOptions.UndoTableAutoExpansion;this.toggleAutoCorrectOptions(true);break}}return true};WorkbookView.prototype.toggleAutoCorrectOptions=function(isSwitch,val){if(isSwitch)if(val){this.autoCorrectStore=val;var options=new Asc.asc_CAutoCorrectOptions;options.asc_setOptions(this.autoCorrectStore.props);options.asc_setCellCoord(this.getWorksheet().getCellCoord(this.autoCorrectStore.cell.c1, this.autoCorrectStore.cell.r1));this.handlers.trigger("asc_onToggleAutoCorrectOptions",options)}else{if(this.autoCorrectStore)if(this.autoCorrectStore.wsId===this.model.getActiveWs().getId()){var options=new Asc.asc_CAutoCorrectOptions;options.asc_setOptions(this.autoCorrectStore.props);options.asc_setCellCoord(this.getWorksheet().getCellCoord(this.autoCorrectStore.cell.c1,this.autoCorrectStore.cell.r1));this.handlers.trigger("asc_onToggleAutoCorrectOptions",options)}else this.handlers.trigger("asc_onToggleAutoCorrectOptions")}else if(this.autoCorrectStore){if(val)this.autoCorrectStore= null;this.handlers.trigger("asc_onToggleAutoCorrectOptions")}};WorkbookView.prototype.savePagePrintOptions=function(arrPagesPrint){var t=this;var viewMode=!this.canEdit();if(!arrPagesPrint)return;var callback=function(isSuccess){if(false===isSuccess)return;for(var i in arrPagesPrint){var ws=t.getWorksheet(parseInt(i));ws.savePageOptions(arrPagesPrint[i],viewMode);window["Asc"]["editor"]._onUpdateLayoutMenu(ws.model.Id)}};var lockInfoArr=[];var lockInfo;for(var i in arrPagesPrint){lockInfo=this.getWorksheet(parseInt(i)).getLayoutLockInfo(); lockInfoArr.push(lockInfo)}if(viewMode)callback();else this.collaborativeEditing.lock(lockInfoArr,callback)};WorkbookView.prototype.cleanCutData=function(bDrawSelection,bCleanBuffer){if(this.cutIdSheet){var activeWs=this.wsViews[this.wsActive];var ws=this.getWorksheetById(this.cutIdSheet);if(bDrawSelection&&activeWs&&ws&&activeWs.model.Id===ws.model.Id)activeWs.cleanSelection();if(ws)ws.cutRange=null;this.cutIdSheet=null;if(bDrawSelection&&activeWs&&ws&&activeWs.model.Id===ws.model.Id)activeWs.updateSelection(); if(bCleanBuffer)AscCommon.g_clipboardBase.ClearBuffer()}};WorkbookView.prototype.updateGroupData=function(){this.getWorksheet()._updateGroups(true);this.getWorksheet()._updateGroups(null)};WorkbookView.prototype.pasteSheet=function(base64,insertBefore,name,callback){var t=this;var tempWorkbook=new AscCommonExcel.Workbook;tempWorkbook.DrawingDocument=Asc.editor.wbModel.DrawingDocument;tempWorkbook.setCommonIndexObjectsFrom(this.model);var pasteProcessor=AscCommonExcel.g_clipboardExcel.pasteProcessor; var aPastedImages=pasteProcessor._readExcelBinary(base64.split("xslData;")[1],tempWorkbook,true);var pastedWs=tempWorkbook.aWorksheets[0];var newFonts={};newFonts=tempWorkbook.generateFontMap2();newFonts=pasteProcessor._convertFonts(newFonts);for(var i=0;i<pastedWs.Drawings.length;i++)pastedWs.Drawings[i].graphicObject.getAllFonts(newFonts);var doCopy=function(){History.Create_NewPoint();var renameParams=t.model.copyWorksheet(0,insertBefore,name,undefined,undefined,undefined,pastedWs,base64);if(renameParams&& renameParams.copySlicerError)t.handlers.trigger("asc_onError",c_oAscError.ID.MoveSlicerError,c_oAscError.Level.NoCritical);callback(renameParams)};var api=window["Asc"]["editor"];api._loadFonts(newFonts,function(){if(aPastedImages&&aPastedImages.length)pasteProcessor._loadImagesOnServer(aPastedImages,function(){doCopy()});else doCopy()})};WorkbookView.prototype.beforeInsertSlicer=function(){return this.getWorksheet().beforeInsertSlicer()};WorkbookView.prototype.insertSlicers=function(arr){return this.getWorksheet().insertSlicers(arr)}; WorkbookView.prototype.setFilterValuesFromSlicer=function(name,val){var slicer=this.model.getSlicerByName(name);var sheetIndex=slicer.getIndexSheetCache();if(sheetIndex!==null){var ws=this.getWorksheet(sheetIndex);if(ws)ws.setFilterValuesFromSlicer(slicer,val)}};WorkbookView.prototype.deleteSlicer=function(name){for(var i in this.wsViews)this.wsViews[i].deleteSlicer(name)};WorkbookView.prototype.deleteSlicers=function(names){var slicers=[];for(var j=0;j<names.length;j++)for(var i in this.wsViews){var slicer= this.wsViews[i].model.getSlicerByName(names[j]);if(slicer){slicers.push({ws:this.wsViews[i],slicer:slicer});break}}var oThis=this;var callback=function(success){var oWSView=oThis.getWorksheet();if(!success){History.EndTransaction();oWSView.handlers.trigger("selectionChanged");return}History.StartTransaction();for(var i=0;i<slicers.length;i++)slicers[i].ws.model.deleteSlicer(slicers[i].slicer.name);History.EndTransaction();History.EndTransaction();oWSView.handlers.trigger("selectionChanged")};if(slicers&& slicers.length)this.checkLockSlicers(slicers,true,callback)};WorkbookView.prototype.setSlicer=function(name,obj){for(var i in this.wsViews){var slicer=this.wsViews[i].model.getSlicerByName(name);if(slicer){this.wsViews[i].setSlicer(slicer,obj);break}}};WorkbookView.prototype.setSlicers=function(names,obj){var slicers=[];for(var j=0;j<names.length;j++)for(var i in this.wsViews){var slicer=this.wsViews[i].model.getSlicerByName(names[j]);if(slicer){slicers.push({ws:this.wsViews[i],slicer:slicer});break}}var oThis= this;var callback=function(success){var oWSView=oThis.getWorksheet();if(!success){oWSView.handlers.trigger("selectionChanged");History.EndTransaction();return}History.StartTransaction();for(var i=0;i<slicers.length;i++)slicers[i].slicer.set(obj);History.EndTransaction();History.EndTransaction();oWSView.handlers.trigger("selectionChanged")};if(slicers&&slicers.length)this.checkLockSlicers(slicers,true,callback)};WorkbookView.prototype.checkLockSlicers=function(slicers,doLockRange,callback){var t=this; var _lockMap=[];var lockInfoArr=[];var lockRanges=[];var cache,defNameId,lockInfo,lockRange,sheetId;for(var i=0;i<slicers.length;i++){cache=slicers[i].slicer.getCacheDefinition();sheetId=slicers[i].ws.model.getId();if(!_lockMap[cache.name]){_lockMap[cache.name]=1;defNameId=this.model.dependencyFormulas.getDefNameByName(cache.name,sheetId);defNameId=defNameId?defNameId.getNodeId():null;lockInfo=this.collaborativeEditing.getLockInfo(AscCommonExcel.c_oAscLockTypeElem.Object,null,-1,defNameId);lockInfoArr.push(lockInfo); if(doLockRange){lockRange=cache.getRange();if(lockRange)lockRanges.push(this.collaborativeEditing.getLockInfo(AscCommonExcel.c_oAscLockTypeElem.Range,null,sheetId,new AscCommonExcel.asc_CCollaborativeRange(lockRange.c1,lockRange.r1,lockRange.c2,lockRange.r2)))}}}var _callback=function(success){if(!success&&callback)callback(false);if(lockRanges&&lockRanges.length)t.collaborativeEditing.lock(lockRanges,callback);else callback(true)};if(lockInfoArr&&lockInfoArr.length)this.collaborativeEditing.lock(lockInfoArr, _callback);else _callback(true)};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].WorkbookView=WorkbookView})(window);"use strict";(function(window,undefined){var CellValueType=AscCommon.CellValueType;var c_oAscBorderStyles=AscCommon.c_oAscBorderStyles;var c_oAscBorderType=AscCommon.c_oAscBorderType;var c_oAscLockTypes=AscCommon.c_oAscLockTypes;var c_oAscFormatPainterState=AscCommon.c_oAscFormatPainterState;var c_oAscPrintDefaultSettings=AscCommon.c_oAscPrintDefaultSettings; var AscBrowser=AscCommon.AscBrowser;var CColor=AscCommon.CColor;var fSortAscending=AscCommon.fSortAscending;var parserHelp=AscCommon.parserHelp;var gc_nMaxDigCountView=AscCommon.gc_nMaxDigCountView;var gc_nMaxRow0=AscCommon.gc_nMaxRow0;var gc_nMaxCol0=AscCommon.gc_nMaxCol0;var gc_nMaxRow=AscCommon.gc_nMaxRow;var gc_nMaxCol=AscCommon.gc_nMaxCol;var History=AscCommon.History;var asc=window["Asc"];var asc_applyFunction=AscCommonExcel.applyFunction;var asc_getcvt=asc.getCvtRatio;var asc_floor=asc.floor; var asc_ceil=asc.ceil;var asc_typeof=asc.typeOf;var asc_incDecFonSize=asc.incDecFonSize;var asc_debug=asc.outputDebugStr;var asc_Range=asc.Range;var asc_CMM=AscCommonExcel.asc_CMouseMoveData;var asc_VR=AscCommonExcel.VisibleRange;var asc_CCellInfo=AscCommonExcel.asc_CCellInfo;var asc_CHyperlink=asc.asc_CHyperlink;var asc_CPageSetup=asc.asc_CPageSetup;var asc_CPagePrint=AscCommonExcel.CPagePrint;var asc_CAutoFilterInfo=AscCommonExcel.asc_CAutoFilterInfo;var c_oTargetType=AscCommonExcel.c_oTargetType; var c_oAscCanChangeColWidth=AscCommonExcel.c_oAscCanChangeColWidth;var c_oAscMergeType=AscCommonExcel.c_oAscMergeType;var c_oAscLockTypeElemSubType=AscCommonExcel.c_oAscLockTypeElemSubType;var c_oAscLockTypeElem=AscCommonExcel.c_oAscLockTypeElem;var c_oAscError=asc.c_oAscError;var c_oAscMergeOptions=asc.c_oAscMergeOptions;var c_oAscInsertOptions=asc.c_oAscInsertOptions;var c_oAscDeleteOptions=asc.c_oAscDeleteOptions;var c_oAscBorderOptions=asc.c_oAscBorderOptions;var c_oAscCleanOptions=asc.c_oAscCleanOptions; var c_oAscSelectionType=asc.c_oAscSelectionType;var c_oAscAutoFilterTypes=asc.c_oAscAutoFilterTypes;var c_oAscChangeTableStyleInfo=asc.c_oAscChangeTableStyleInfo;var c_oAscChangeSelectionFormatTable=asc.c_oAscChangeSelectionFormatTable;var asc_CSelectionMathInfo=AscCommonExcel.asc_CSelectionMathInfo;var pageBreakPreviewMode=false;var pageBreakPreviewModeOverlay=false;var kHeaderDefault=0;var kHeaderActive=1;var kHeaderHighlighted=2;var kCurDefault="default";var kCurCorner="pointer";var kCurColSelect= "select-table-column";var kCurColResize="col-resize";var kCurRowSelect="select-table-row";var kCurRowResize="row-resize";var kCurFillHandle="crosshair";var kCurHyperlink="pointer";var kCurMove="move";var kCurSEResize="se-resize";var kCurNEResize="ne-resize";var kCurAutoFilter="pointer";var kCurFormatPainterExcel="se-formatpainter";AscCommon.g_oHtmlCursor.register(AscCommonExcel.kCurCells,"plus","6 6","cell");AscCommon.g_oHtmlCursor.register(kCurFormatPainterExcel,"plus_copy","6 12","pointer");var kNewLine= "\n";var kMaxAutoCompleteCellEdit=2E4;var kRowsCacheSize=64;var gridlineSize=1;var filterSizeButton=17;function getMergeType(merged){var res=c_oAscMergeType.none;if(null!==merged){if(merged.c1!==merged.c2)res|=c_oAscMergeType.cols;if(merged.r1!==merged.r2)res|=c_oAscMergeType.rows}return res}function getFontMetrics(format,stringRender){var res=AscCommonExcel.g_oCacheMeasureEmpty2.get(format);if(!res){if(!format.isEqual2(stringRender.drawingCtx.font))stringRender.drawingCtx.setFont(format);res=stringRender.drawingCtx.getFontMetrics(); AscCommonExcel.g_oCacheMeasureEmpty2.add(format,res)}return res}function getCFIconSize(fontSize){return AscCommonExcel.cDefIconSize*fontSize/AscCommonExcel.cDefIconFont}function CacheColumn(){this.left=0;this.width=0}function CacheRow(){this.top=0;this.height=0;this.descender=0}function CacheElement(){this.columnsWithText={};this.columns={};this.erased={};return this}function CacheElementText(){this.state=null;this.flags=null;this.metrics=null;this.cellW=null;this.cellHA=null;this.cellVA=null;this.sideL= null;this.sideR=null;this.cellType=null;this.isFormula=false;this.angle=null;this.textBound=null}function Cache(){this.rows={};this.sectors=[];this.reset=function(){this.rows={};this.sectors=[]}}function CellFlags(){this.wrapText=false;this.verticalText=false;this.shrinkToFit=false;this.merged=null;this.textAlign=null;this.ctrlKey=null;this.shiftKey=null}CellFlags.prototype.clone=function(){var oRes=new CellFlags;oRes.wrapText=this.wrapText;oRes.shrinkToFit=this.shrinkToFit;oRes.merged=this.merged? this.merged.clone():null;oRes.textAlign=this.textAlign;oRes.verticalText=this.verticalText;return oRes};CellFlags.prototype.isMerged=function(){return null!==this.merged};CellFlags.prototype.getMergeType=function(){return getMergeType(this.merged)};function CellBorderObject(borders,mergeInfo,col,row){this.borders=borders;this.mergeInfo=mergeInfo;this.col=col;this.row=row}CellBorderObject.prototype.isMerge=function(){return null!=this.mergeInfo};CellBorderObject.prototype.getLeftBorder=function(){if(!this.borders|| this.isMerge()&&(this.col!==this.mergeInfo.c1||this.col-1!==this.mergeInfo.c2))return null;return this.borders.l};CellBorderObject.prototype.getRightBorder=function(){if(!this.borders||this.isMerge()&&(this.col-1!==this.mergeInfo.c1||this.col!==this.mergeInfo.c2))return null;return this.borders.r};CellBorderObject.prototype.getTopBorder=function(){if(!this.borders||this.isMerge()&&(this.row!==this.mergeInfo.r1||this.row-1!==this.mergeInfo.r2))return null;return this.borders.t};CellBorderObject.prototype.getBottomBorder= function(){if(!this.borders||this.isMerge()&&(this.row-1!==this.mergeInfo.r1||this.row!==this.mergeInfo.r2))return null;return this.borders.b};function WorksheetView(workbook,model,handlers,buffers,stringRender,maxDigitWidth,collaborativeEditing,settings){this.settings=settings;this.workbook=workbook;this.handlers=handlers;this.model=model;this.buffers=buffers;this.drawingCtx=this.buffers.main;this.overlayCtx=this.buffers.overlay;this.drawingGraphicCtx=this.buffers.mainGraphic;this.overlayGraphicCtx= this.buffers.overlayGraphic;this.stringRender=stringRender;this.updateResize=false;this.updateZoom=false;this.isZooming=false;this.notUpdateRowHeight=false;this.cache=new Cache;this.maxDigitWidth=maxDigitWidth;this.defaultColWidthChars=0;this.defaultColWidthPx=0;this.defaultRowHeightPx=0;this.defaultRowDescender=0;this.headersLeft=0;this.headersTop=0;this.headersWidth=0;this.headersHeight=0;this.headersHeightByFont=0;this.groupWidth=0;this.groupHeight=0;this.cellsLeft=0;this.cellsTop=0;this.cols= [];this.rows=[];this.highlightedCol=-1;this.highlightedRow=-1;this.topLeftFrozenCell=null;this.visibleRange=new asc_Range(0,0,0,0);this.isChanged=false;this.isChartAreaEditMode=false;this.lockDraw=false;this.isSelectOnShape=false;this.startCellMoveResizeRange=null;this.startCellMoveResizeRange2=null;this.moveRangeDrawingObjectTo=null;this.startCellMoveRange=null;this.activeMoveRange=null;this.dragAndDropRange=null;this.activeFillHandle=null;this.resizeTableIndex=null;this.fillHandleDirection=-1;this.fillHandleArea= -1;this.nRowsCount=0;this.nColsCount=0;this.oOtherRanges=null;this.collaborativeEditing=collaborativeEditing;this.drawingArea=new AscFormat.DrawingArea(this);this.cellCommentator=new AscCommonExcel.CCellCommentator(this);this.objectRender=null;this.arrRecalcRanges=[];this.arrRecalcRangesWithHeight=[];this.arrRecalcRangesCanChangeColWidth=[];this.skipUpdateRowHeight=false;this.canChangeColWidth=c_oAscCanChangeColWidth.none;this.scrollType=0;this.updateRowHeightValuePx=null;this.updateColumnsStart= Number.MAX_VALUE;this.viewPrintLines=false;this.cutRange=null;this.usePrintScale=false;this.arrRowGroups=null;this.arrColGroups=null;this.clickedGroupButton=null;this.ignoreGroupSize=null;this._init();return this}WorksheetView.prototype._init=function(){this._initWorksheetDefaultWidth();this._initPane();this._updateGroups();this._updateGroups(true);this._initCellsArea(AscCommonExcel.recalcType.full);this.model.setTableStyleAfterOpen();this.model.setDirtyConditionalFormatting(null);this.model.initPivotTables(); this.model.updatePivotTablesStyle(null);this._cleanCellsTextMetricsCache();this._prepareCellTextMetricsCache();this.handlers.trigger("initialized")};WorksheetView.prototype._initWorksheetDefaultWidth=function(){this.defaultColWidthChars=this.model.charCountToModelColWidth(this.model.getBaseColWidth());this.defaultColWidthPx=this.model.modelColWidthToColWidth(this.defaultColWidthChars);this.defaultColWidthPx=asc_ceil(this.defaultColWidthPx/8)*8;this.defaultColWidthChars=this.model.colWidthToCharCount(this.defaultColWidthPx); AscCommonExcel.oDefaultMetrics.ColWidthChars=this.model.charCountToModelColWidth(this.defaultColWidthChars);var defaultColWidth=this.model.getDefaultWidth();if(null!==defaultColWidth)this.defaultColWidthPx=this.model.modelColWidthToColWidth(defaultColWidth);this._setDefaultFont(undefined);var tm=this._roundTextMetrics(this.stringRender.measureString("A"));this.headersHeightByFont=tm.height;this.maxRowHeightPx=AscCommonExcel.convertPtToPx(Asc.c_oAscMaxRowHeight);this.defaultRowDescender=this.stringRender.lines[0].d; AscCommonExcel.oDefaultMetrics.RowHeight=Math.min(Asc.c_oAscMaxRowHeight,this.model.getDefaultHeight()||AscCommonExcel.convertPxToPt(this.headersHeightByFont));this.defaultRowHeightPx=AscCommonExcel.convertPtToPx(AscCommonExcel.oDefaultMetrics.RowHeight);this.model.setDefaultHeight(AscCommonExcel.oDefaultMetrics.RowHeight);this._initRowsCount();this._initColsCount();this.model.initColumns()};WorksheetView.prototype._initRowsCount=function(){var old=this.nRowsCount;this.nRowsCount=Math.min(Math.max(this.model.getRowsCount(), this.visibleRange.r2)+1,gc_nMaxRow);return old!==this.nRowsCount};WorksheetView.prototype._initColsCount=function(){var old=this.nColsCount;this.nColsCount=Math.min(Math.max(this.model.getColsCount(),this.visibleRange.c2)+1,gc_nMaxCol);return old!==this.nColsCount};WorksheetView.prototype.getCellEditMode=function(){return this.workbook.isCellEditMode};WorksheetView.prototype.getFormulaEditMode=function(){return this.workbook.isFormulaEditMode};WorksheetView.prototype.getSelectionDialogMode=function(){return this.workbook.selectionDialogMode}; WorksheetView.prototype.getDialogOtherRanges=function(){return!this.workbook.isWizardMode};WorksheetView.prototype.getCellVisibleRange=function(col,row){var vr,offsetX=0,offsetY=0,cFrozen,rFrozen;if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0()-1;rFrozen=this.topLeftFrozenCell.getRow0()-1;if(col<=cFrozen&&row<=rFrozen)vr=new asc_Range(0,0,cFrozen,rFrozen);else if(col<=cFrozen){vr=new asc_Range(0,this.visibleRange.r1,cFrozen,this.visibleRange.r2);offsetY-=this._getRowTop(rFrozen+ 1)-this.cellsTop}else if(row<=rFrozen){vr=new asc_Range(this.visibleRange.c1,0,this.visibleRange.c2,rFrozen);offsetX-=this._getColLeft(cFrozen+1)-this.cellsLeft}else{vr=this.visibleRange;offsetX-=this._getColLeft(cFrozen+1)-this.cellsLeft;offsetY-=this._getRowTop(rFrozen+1)-this.cellsTop}}else vr=this.visibleRange;offsetX+=this._getColLeft(vr.c1)-this.cellsLeft;offsetY+=this._getRowTop(vr.r1)-this.cellsTop;return vr.contains(col,row)?new asc_VR(vr,offsetX,offsetY):null};WorksheetView.prototype.getCellMetrics= function(col,row){var vr;if(vr=this.getCellVisibleRange(col,row))return{left:this._getColLeft(col)-vr.offsetX,top:this._getRowTop(row)-vr.offsetY,width:this._getColumnWidth(col),height:this._getRowHeight(row)};return null};WorksheetView.prototype.getFrozenCell=function(){return this.topLeftFrozenCell};WorksheetView.prototype.getVisibleRange=function(){return this.visibleRange};WorksheetView.prototype.getFirstVisibleCol=function(allowPane){var tmp=0;if(allowPane&&this.topLeftFrozenCell)tmp=this.topLeftFrozenCell.getCol0(); return this.visibleRange.c1-tmp};WorksheetView.prototype.getLastVisibleCol=function(){return this.visibleRange.c2};WorksheetView.prototype.getFirstVisibleRow=function(allowPane){var tmp=0;if(allowPane&&this.topLeftFrozenCell)tmp=this.topLeftFrozenCell.getRow0();return this.visibleRange.r1-tmp};WorksheetView.prototype.getLastVisibleRow=function(){return this.visibleRange.r2};WorksheetView.prototype.getHorizontalScrollRange=function(){var offsetFrozen=this.getFrozenPaneOffset(false,true);var ctxW=this.drawingCtx.getWidth()- offsetFrozen.offsetX-this.cellsLeft;for(var w=0,i=this.nColsCount-1;i>=0;--i){w+=this._getColumnWidth(i);if(w>=ctxW)break}var tmp=0;if(this.topLeftFrozenCell)tmp=this.topLeftFrozenCell.getCol0();if(gc_nMaxCol===this.nColsCount||this.model.isDefaultWidthHidden())tmp-=1;return Math.max(0,i-tmp)};WorksheetView.prototype.getVerticalScrollRange=function(){var offsetFrozen=this.getFrozenPaneOffset(true,false);var ctxH=this.drawingCtx.getHeight()-offsetFrozen.offsetY-this.cellsTop;for(var h=0,i=this.nRowsCount- 1;i>=0;--i){h+=this._getRowHeight(i);if(h>=ctxH)break}var tmp=0;if(this.topLeftFrozenCell)tmp=this.topLeftFrozenCell.getRow0();if(gc_nMaxRow===this.nRowsCount||this.model.isDefaultHeightHidden())tmp-=1;return Math.max(0,i-tmp)};WorksheetView.prototype.getHorizontalScrollMax=function(){var tmp=0;if(this.topLeftFrozenCell)tmp=this.topLeftFrozenCell.getCol0();return(this.model.isDefaultWidthHidden()?this.nColsCount:gc_nMaxCol)-tmp-1};WorksheetView.prototype.getVerticalScrollMax=function(){var tmp=0; if(this.topLeftFrozenCell)tmp=this.topLeftFrozenCell.getRow0();return(this.model.isDefaultHeightHidden()?this.nRowsCount:gc_nMaxRow)-tmp-1};WorksheetView.prototype.getCellsOffset=function(units){var u=units>=0&&units<=3?units:0;return{left:this.cellsLeft*asc_getcvt(0,u,this._getPPIX()),top:this.cellsTop*asc_getcvt(0,u,this._getPPIY())}};WorksheetView.prototype._getColLeft=function(i){this._updateColumnPositions();var l=this.cols.length;return this.cellsLeft+(i<l?this.cols[i].left:(0===l?0:this.cols[l- 1].left+this.cols[l-1].width)+!this.model.isDefaultWidthHidden()*Asc.round(this.defaultColWidthPx*this.getZoom())*(i-l))};WorksheetView.prototype.getCellLeft=function(column,units){var u=units>=0&&units<=3?units:0;return this._getColLeft(column)*asc_getcvt(0,u,this._getPPIX())};WorksheetView.prototype._getRowHeightReal=function(i){var h=-1;this.model._getRowNoEmptyWithAll(i,function(row){if(row)if(row.getHidden())h=0;else if(row.h>0&&(row.getCustomHeight()||row.getCalcHeight()))h=row.h});return h< 0?AscCommonExcel.oDefaultMetrics.RowHeight:h};WorksheetView.prototype._getRowDescender=function(i){return i<this.rows.length?this.rows[i].descender:this.defaultRowDescender};WorksheetView.prototype._getRowTop=function(i){var l=this.rows.length;return i<l?this.rows[i].top:(0===l?this.cellsTop:this.rows[l-1].top+this.rows[l-1].height)+!this.model.isDefaultHeightHidden()*Asc.round(this.defaultRowHeightPx*this.getZoom())*(i-l)};WorksheetView.prototype.getCellTop=function(row,units){var u=units>=0&&units<= 3?units:0;return this._getRowTop(row)*asc_getcvt(0,u,this._getPPIY())};WorksheetView.prototype.getCellLeftRelative=function(col,units){if(col<0||col>=this.nColsCount)return null;var offsetX=0;if(this.topLeftFrozenCell){var cFrozen=this.topLeftFrozenCell.getCol0();offsetX=col<cFrozen?0:this._getColLeft(this.visibleRange.c1)-this._getColLeft(cFrozen)}else offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft;var u=units>=0&&units<=3?units:0;return(this._getColLeft(col)-offsetX)*asc_getcvt(0, u,this._getPPIX())};WorksheetView.prototype.getCellTopRelative=function(row,units){if(row<0||row>=this.nRowsCount)return null;var offsetY=0;if(this.topLeftFrozenCell){var rFrozen=this.topLeftFrozenCell.getRow0();offsetY=row<rFrozen?0:this._getRowTop(this.visibleRange.r1)-this._getRowTop(rFrozen)}else offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop;var u=units>=0&&units<=3?units:0;return(this._getRowTop(row)-offsetY)*asc_getcvt(0,u,this._getPPIY())};WorksheetView.prototype._getColumnWidthInner= function(i){return Math.max(this._getColumnWidth(i)-this.settings.cells.padding*2-gridlineSize,0)};WorksheetView.prototype._getColumnWidth=function(i){return i<this.cols.length?this.cols[i].width:!this.model.isDefaultWidthHidden()*Asc.round(this.defaultColWidthPx*this.getZoom())};WorksheetView.prototype.getColumnWidth=function(index,units){var u=units>=0&&units<=3?units:0;return this._getColumnWidth(index)*asc_getcvt(0,u,this._getPPIX())};WorksheetView.prototype.getColumnWidthInSymbols=function(index){var c= this.model._getColNoEmptyWithAll(index);return c&&c.charCount||this.defaultColWidthChars};WorksheetView.prototype.getSelectedColumnWidthInSymbols=function(){var i,charCount,res=null;var range=this.model.selectionRange.getLast();for(i=range.c1;i<=range.c2;++i){charCount=this.getColumnWidthInSymbols(i);if(null!==res&&res!==charCount)return null;res=charCount;if(i>=this.cols.length)break}return res};WorksheetView.prototype.getSelectedRowHeight=function(){var i,hR,res=null;var range=this.model.selectionRange.getLast(); for(i=range.r1;i<=range.r2;++i){hR=this._getRowHeightReal(i);if(null!==res&&res!==hR)return null;res=hR;if(i>=this.rows.length)break}return res};WorksheetView.prototype._getRowHeight=function(i){return i<this.rows.length?this.rows[i].height:!this.model.isDefaultHeightHidden()*Asc.round(this.defaultRowHeightPx*this.getZoom())};WorksheetView.prototype.getRowHeight=function(index,units){var u=units>=0&&units<=3?units:0;return this._getRowHeight(index)*asc_getcvt(0,u,this._getPPIY())};WorksheetView.prototype.getSelectedRange= function(){var lastRange=this.model.getSelection().getLast();return this._getRange(lastRange.c1,lastRange.r1,lastRange.c2,lastRange.r2)};WorksheetView.prototype.getSelectedRanges=function(){var ret=[];var aRanges=this.model.selectionRange.ranges;var oRange;for(var i=0;i<aRanges.length;++i){oRange=aRanges[i];ret.push(this._getRange(oRange.c1,oRange.r1,oRange.c2,oRange.r2))}return ret};WorksheetView.prototype.resize=function(isUpdate,editor){if(isUpdate){this._initCellsArea(AscCommonExcel.recalcType.newLines); this._normalizeViewRange();this._prepareCellTextMetricsCache();this.updateResize=false;this.objectRender.resizeCanvas();if(editor)editor.move()}else this.updateResize=true;return this};WorksheetView.prototype.getZoom=function(){return this.drawingCtx.getZoom()};WorksheetView.prototype.getPrintScale=function(){var res=1;if(this.usePrintScale){var printOptions=this.model.PagePrintOptions;res=printOptions&&printOptions.pageSetup?printOptions.pageSetup.scale:100;res=res/100}return res};WorksheetView.prototype.changeZoom= function(isUpdate){if(isUpdate){this.isZooming=true;this.notUpdateRowHeight=true;this.cleanSelection();this._updateGroupsWidth();this._initCellsArea(AscCommonExcel.recalcType.recalc);this._normalizeViewRange();this._cleanCellsTextMetricsCache();this._scrollToRange();this._prepareCellTextMetricsCache();this.cellCommentator.updateActiveComment();window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Update_Position();this.handlers.trigger("toggleAutoCorrectOptions",null,true);this.handlers.trigger("onDocumentPlaceChanged"); this._updateDrawingArea();this.updateZoom=false;this.isZooming=false;this.notUpdateRowHeight=false}else this.updateZoom=true;return this};WorksheetView.prototype.changeZoomResize=function(){this.cleanSelection();this._initCellsArea(AscCommonExcel.recalcType.full);this._normalizeViewRange();this._cleanCellsTextMetricsCache();this._scrollToRange();this._prepareCellTextMetricsCache();this.cellCommentator.updateActiveComment();window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Update_Position(); this.handlers.trigger("onDocumentPlaceChanged");this._updateDrawingArea();this.updateResize=false;this.updateZoom=false};WorksheetView.prototype.getSheetViewSettings=function(){return this.model.getSheetViewSettings()};WorksheetView.prototype.getFrozenPaneOffset=function(noX,noY){var offsetX=0,offsetY=0;if(this.topLeftFrozenCell){if(!noX){var cFrozen=this.topLeftFrozenCell.getCol0();offsetX=this._getColLeft(cFrozen)-this._getColLeft(0)}if(!noY){var rFrozen=this.topLeftFrozenCell.getRow0();offsetY= this._getRowTop(rFrozen)-this._getRowTop(0)}}return{offsetX:offsetX,offsetY:offsetY}};WorksheetView.prototype.changeColumnWidth=function(col,x2,mouseX){var viewMode=this.handlers.trigger("getViewMode");var t=this;x2+=mouseX;var offsetFrozenX=0;var c1=t.visibleRange.c1;if(this.topLeftFrozenCell){var cFrozen=this.topLeftFrozenCell.getCol0()-1;if(0<=cFrozen)if(col<c1)c1=0;else offsetFrozenX=t._getColLeft(cFrozen+1)-t._getColLeft(0)}var offsetX=t._getColLeft(c1)-t.cellsLeft;offsetX-=offsetFrozenX;var x1= t._getColLeft(col)-offsetX-gridlineSize;var w=Math.max(x2-x1,0);if(w===this._getColumnWidth(col))return;w=Asc.round(w/this.getZoom());var cc=Math.min(this.model.colWidthToCharCount(w),Asc.c_oAscMaxColumnWidth);var onChangeWidthCallback=function(isSuccess){if(false===isSuccess)return;if(viewMode)History.TurnOff();var bIsHidden=t.model.getColHidden(col);t.model.setColWidth(cc,col,col);t._cleanCache(new asc_Range(0,0,t.cols.length-1,t.rows.length-1));t.changeWorksheet("update",{reinitRanges:true});t._updateGroups(true, undefined,undefined,true);t._updateVisibleColsCount();t.cellCommentator.updateActiveComment();t.cellCommentator.updateAreaComments();if(t.objectRender){if(bIsHidden!==t.model.getColHidden(col))t.objectRender.rebuildChartGraphicObjects([new asc_Range(col,0,col,gc_nMaxRow0)]);t.objectRender.updateSizeDrawingObjects({target:AscCommonExcel.c_oTargetType.ColumnResize,col:col})}if(viewMode)History.TurnOn()};if(viewMode)onChangeWidthCallback(true);else this._isLockedAll(onChangeWidthCallback)};WorksheetView.prototype.changeRowHeight= function(row,y2,mouseY){var viewMode=this.handlers.trigger("getViewMode");var t=this;y2+=mouseY;var offsetFrozenY=0;var r1=this.visibleRange.r1;if(this.topLeftFrozenCell){var rFrozen=this.topLeftFrozenCell.getRow0()-1;if(0<=rFrozen)if(row<r1)r1=0;else offsetFrozenY=this._getRowTop(rFrozen+1)-this._getRowTop(0)}var offsetY=this._getRowTop(r1)-t.cellsTop;offsetY-=offsetFrozenY;var y1=this._getRowTop(row)-offsetY-gridlineSize;var newHeight=Math.max(y2-y1,0);if(newHeight===this._getRowHeight(row))return; newHeight=Math.min(this.maxRowHeightPx,Asc.round(newHeight/this.getZoom()));var onChangeHeightCallback=function(isSuccess){if(false===isSuccess)return;if(viewMode)History.TurnOff();t.model.setRowHeight(AscCommonExcel.convertPxToPt(newHeight),row,row,true);t.model.autoFilters.reDrawFilter(null,row);t._cleanCache(new asc_Range(0,row,t.cols.length-1,row));t.changeWorksheet("update",{reinitRanges:true});t._updateGroups(false,undefined,undefined,true);t._updateVisibleRowsCount();t.cellCommentator.updateActiveComment(); t.cellCommentator.updateAreaComments();if(t.objectRender){t.objectRender.rebuildChartGraphicObjects([new asc_Range(0,row,gc_nMaxCol0,row)]);t.objectRender.updateSizeDrawingObjects({target:AscCommonExcel.c_oTargetType.RowResize,row:row})}if(viewMode)History.TurnOn()};if(viewMode)onChangeHeightCallback(true);else this._isLockedAll(onChangeHeightCallback)};WorksheetView.prototype._hasNumberValueInActiveRange=function(){var cell,cellType,exist=false,setCols={},setRows={};var selectionRange=this.model.selectionRange.getLast(); if(selectionRange.isOneCell())return null;var mergedRange=this.model.getMergedByCell(selectionRange.r1,selectionRange.c1);if(mergedRange&&mergedRange.isEqual(selectionRange))return null;for(var c=selectionRange.c1;c<=selectionRange.c2;++c)for(var r=selectionRange.r1;r<=selectionRange.r2;++r){cell=this._getCellTextCache(c,r,true);if(cell){cellType=cell.cellType;if(null==cellType||CellValueType.Number===cellType)exist=setRows[r]=setCols[c]=true}}if(exist){var i,arrCols=[],arrRows=[];for(i in setCols)arrCols.push(+i); for(i in setRows)arrRows.push(+i);return{arrCols:arrCols.sort(fSortAscending),arrRows:arrRows.sort(fSortAscending)}}else return null};WorksheetView.prototype.autoCompleteFormula=function(functionName){var t=this;var activeCell=this.model.selectionRange.activeCell;var ar=this.model.selectionRange.getLast();var arCopy=null;var arHistorySelect=ar.clone(true);var vr=this.visibleRange;var topCell=null;var leftCell=null;var r=activeCell.row-1;var c=activeCell.col-1;var cell,cellType,isNumberFormat;var result= {};var hasNumber=this._hasNumberValueInActiveRange();var val,text;if(hasNumber){var i;var hasNumberInLastColumn=ar.c2===hasNumber.arrCols[hasNumber.arrCols.length-1];var hasNumberInLastRow=ar.r2===hasNumber.arrRows[hasNumber.arrRows.length-1];var startCol=hasNumber.arrCols[0];var startRow=hasNumber.arrRows[0];var startColOld=ar.c1;var startRowOld=ar.r1;var bIsUpdate=false;if(startColOld!==startCol||startRowOld!==startRow)bIsUpdate=true;if(true===hasNumberInLastRow&&true===hasNumberInLastColumn)bIsUpdate= true;if(bIsUpdate){this.cleanSelection();ar.c1=startCol;ar.r1=startRow;if(false===ar.contains(activeCell.col,activeCell.row)){activeCell.col=startCol;activeCell.row=startRow}if(true===hasNumberInLastRow&&true===hasNumberInLastColumn)if(1===hasNumber.arrRows.length)ar.c2+=1;else ar.r2+=1;this._drawSelection()}arCopy=ar.clone(true);var functionAction=null;var changedRange=null;if(false===hasNumberInLastColumn&&false===hasNumberInLastRow){changedRange=[new asc_Range(hasNumber.arrCols[0],arCopy.r2,hasNumber.arrCols[hasNumber.arrCols.length- 1],arCopy.r2),new asc_Range(arCopy.c2,hasNumber.arrRows[0],arCopy.c2,hasNumber.arrRows[hasNumber.arrRows.length-1])];functionAction=function(){for(i=0;i<hasNumber.arrCols.length;++i){c=hasNumber.arrCols[i];cell=t._getVisibleCell(c,arCopy.r2);text=(new asc_Range(c,arCopy.r1,c,arCopy.r2-1)).getName();val="="+functionName+"("+text+")";cell.setValue(val)}for(i=0;i<hasNumber.arrRows.length;++i){r=hasNumber.arrRows[i];cell=t._getVisibleCell(arCopy.c2,r);text=(new asc_Range(arCopy.c1,r,arCopy.c2-1,r)).getName(); val="="+functionName+"("+text+")";cell.setValue(val)}cell=t._getVisibleCell(arCopy.c2,arCopy.r2);text=(new asc_Range(arCopy.c1,arCopy.r2,arCopy.c2-1,arCopy.r2)).getName();val="="+functionName+"("+text+")";cell.setValue(val)}}else if(true===hasNumberInLastRow&&false===hasNumberInLastColumn){changedRange=new asc_Range(arCopy.c2,hasNumber.arrRows[0],arCopy.c2,hasNumber.arrRows[hasNumber.arrRows.length-1]);functionAction=function(){for(i=0;i<hasNumber.arrRows.length;++i){r=hasNumber.arrRows[i];cell=t._getVisibleCell(arCopy.c2, r);text=(new asc_Range(arCopy.c1,r,arCopy.c2-1,r)).getName();val="="+functionName+"("+text+")";cell.setValue(val)}}}else if(false===hasNumberInLastRow&&true===hasNumberInLastColumn){changedRange=new asc_Range(hasNumber.arrCols[0],arCopy.r2,hasNumber.arrCols[hasNumber.arrCols.length-1],arCopy.r2);functionAction=function(){for(i=0;i<hasNumber.arrCols.length;++i){c=hasNumber.arrCols[i];cell=t._getVisibleCell(c,arCopy.r2);text=(new asc_Range(c,arCopy.r1,c,arCopy.r2-1)).getName();val="="+functionName+ "("+text+")";cell.setValue(val)}}}else if(1===hasNumber.arrRows.length){changedRange=new asc_Range(arCopy.c2,arCopy.r2,arCopy.c2,arCopy.r2);functionAction=function(){cell=t._getVisibleCell(arCopy.c2,arCopy.r2);text=(new asc_Range(arCopy.c1,arCopy.r2,arCopy.c2-1,arCopy.r2)).getName();val="="+functionName+"("+text+")";cell.setValue(val)}}else{changedRange=new asc_Range(hasNumber.arrCols[0],arCopy.r2,hasNumber.arrCols[hasNumber.arrCols.length-1],arCopy.r2);functionAction=function(){for(i=0;i<hasNumber.arrCols.length;++i){c= hasNumber.arrCols[i];cell=t._getVisibleCell(c,arCopy.r2);text=(new asc_Range(c,arCopy.r1,c,arCopy.r2-1)).getName();val="="+functionName+"("+text+")";cell.setValue(val)}}}var onAutoCompleteFormula=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.SetSelection(arHistorySelect.clone());History.SetSelectionRedo(arCopy.clone());History.StartTransaction();asc_applyFunction(functionAction);History.EndTransaction();t.handlers.trigger("selectionMathInfoChanged",t.getSelectionMathInfo()); t.draw()};this._isLockedCells(changedRange,null,onAutoCompleteFormula);result.notEditCell=true;return result}for(;r>=vr.r1;--r){cell=this._getCellTextCache(activeCell.col,r);if(cell){cellType=cell.cellType;isNumberFormat=null===cellType||CellValueType.Number===cellType;var cellRange=this.model.getCell3(r,activeCell.col);var isDateFormat=cellRange.getNumFormat().isDateTimeFormat();if(isNumberFormat&&!isDateFormat){topCell={c:activeCell.col,r:r,isFormula:cell.isFormula};if(topCell.isFormula&&r-1>=vr.r1){cell= this._getCellTextCache(activeCell.col,r-1);if(cell&&cell.isFormula)topCell.isFormulaSeq=true}break}}}if(null===topCell||topCell.r!==activeCell.row-1||topCell.isFormula&&!topCell.isFormulaSeq)for(;c>=vr.c1;--c){cell=this._getCellTextCache(c,activeCell.row);if(cell){cellType=cell.cellType;isNumberFormat=null===cellType||CellValueType.Number===cellType;var cellRange=this.model.getCell3(activeCell.row,c);var isDateFormat=cellRange.getNumFormat().isDateTimeFormat();if(isNumberFormat&&!isDateFormat){leftCell= {r:activeCell.row,c:c};break}}if(null!==topCell)break}if(leftCell){--c;for(;c>=0;--c){cell=this._getCellTextCache(c,activeCell.row);if(!cell){this._addCellTextToCache(c,activeCell.row);cell=this._getCellTextCache(c,activeCell.row);if(!cell)break}cellType=cell.cellType;isNumberFormat=null===cellType||CellValueType.Number===cellType;if(!isNumberFormat)break}++c;if(activeCell.col-1!==c)result=new asc_Range(c,leftCell.r,activeCell.col-1,leftCell.r);else result=new asc_Range(c,leftCell.r,c,leftCell.r); this._fixSelectionOfMergedCells(result);result.text=result.getName()}if(topCell){--r;for(;r>=0;--r){cell=this._getCellTextCache(activeCell.col,r);if(!cell){this._addCellTextToCache(activeCell.col,r);cell=this._getCellTextCache(activeCell.col,r);if(!cell)break}cellType=cell.cellType;isNumberFormat=null===cellType||CellValueType.Number===cellType;if(!isNumberFormat)break}++r;if(activeCell.row-1!==r)result=new asc_Range(topCell.c,r,topCell.c,activeCell.row-1);else result=new asc_Range(topCell.c,r,topCell.c, r);this._fixSelectionOfMergedCells(result);result.text=result.getName()}return result};WorksheetView.prototype._prepareComments=function(){if(0<this.model.aComments.length)this.model.workbook.handlers.trigger("asc_onAddComments",this.model.aComments)};WorksheetView.prototype._prepareDrawingObjects=function(){this.objectRender=new AscFormat.DrawingObjects;if(!AscCommon.isFileBuild())this.objectRender.init(this)};WorksheetView.prototype._initCellsArea=function(type){this._calcHeaderRowHeight();this._calcHeightRows(type); this._updateVisibleRowsCount(true);this._calcWidthColumns(type);this._updateVisibleColsCount(true)};WorksheetView.prototype._initPane=function(){var pane=this.model.getSheetView().pane;if(null!==pane&&pane.isInit()&&!window["IS_NATIVE_EDITOR"]){this.topLeftFrozenCell=pane.topLeftFrozenCell;this.visibleRange.r1=this.topLeftFrozenCell.getRow0();this.visibleRange.c1=this.topLeftFrozenCell.getCol0()}};WorksheetView.prototype._getSelection=function(){return this.model.selectionRange};WorksheetView.prototype._fixVisibleRange= function(range){var tmp;if(null!==this.topLeftFrozenCell){tmp=this.topLeftFrozenCell.getRow0();if(range.r1<tmp){range.r1=tmp;tmp=this._findVisibleRow(range.r1,+1);if(0<tmp)range.r1=tmp}tmp=this.topLeftFrozenCell.getCol0();if(range.c1<tmp){range.c1=tmp;tmp=this._findVisibleCol(range.c1,+1);if(0<tmp)range.c1=tmp}}};WorksheetView.prototype._calcColWidth=function(i){if(i!==this.cols.length)this._calcWidthColumns(AscCommonExcel.recalcType.newLines);var w;var column=this.model._getColNoEmptyWithAll(i); if(!column)w=this.defaultColWidthPx;else if(column.getHidden())w=0;else w=null===column.widthPx?this.defaultColWidthPx:column.widthPx;this.cols[i]=new CacheColumn(w);this.cols[i].width=Asc.round(w*this.getZoom());this.updateColumnsStart=Math.min(i,this.updateColumnsStart)};WorksheetView.prototype._calcHeightRow=function(y,i){var r,hR;this.model._getRowNoEmptyWithAll(i,function(row){if(!row)hR=-1;else if(row.getHidden())hR=0;else if(row.h>0&&(row.getCustomHeight()||row.getCalcHeight()))hR=row.h;else hR= -1});if(hR<0)hR=AscCommonExcel.oDefaultMetrics.RowHeight;r=this.rows[i]=new CacheRow;r.top=y;r.height=Asc.round(AscCommonExcel.convertPtToPx(hR)*this.getZoom());r.descender=this.defaultRowDescender};WorksheetView.prototype._calcHeaderColumnWidth=function(){var old=this.cellsLeft;if(false===this.model.getSheetView().asc_getShowRowColHeaders())this.headersWidth=0;else{var numDigit=Math.max(AscCommonExcel.calcDecades(this.visibleRange.r2+1),3);var nCharCount=this.model.charCountToModelColWidth(numDigit); this.headersWidth=Asc.round(this.model.modelColWidthToColWidth(nCharCount)*this.getZoom())}this.headersLeft=this.ignoreGroupSize?0:this.groupWidth;this.cellsLeft=this.headersLeft+this.headersWidth;return old!==this.cellsLeft};WorksheetView.prototype._calcHeaderRowHeight=function(){this.headersHeight=false===this.model.getSheetView().asc_getShowRowColHeaders()?0:Asc.round(this.headersHeightByFont*this.getZoom());this.headersTop=this.ignoreGroupSize?0:this.groupHeight;this.cellsTop=this.headersTop+ this.headersHeight};WorksheetView.prototype._calcWidthColumns=function(type){var l=this.model.getColsCount();var i=0;if(AscCommonExcel.recalcType.full===type)this.cols=[];else if(AscCommonExcel.recalcType.newLines===type)i=this.cols.length;for(;i<l;++i)this._calcColWidth(i);this.nColsCount=Math.min(Math.max(this.nColsCount,i),gc_nMaxCol)};WorksheetView.prototype._calcHeightRows=function(type){var y=this.cellsTop;var l=this.model.getRowsCount();var i=0;if(AscCommonExcel.recalcType.full===type)this.rows= [];else if(AscCommonExcel.recalcType.newLines===type){i=this.rows.length;y=this._getRowTop(i)}for(;i<l;++i){this._calcHeightRow(y,i);y+=this._getRowHeight(i)}this.nRowsCount=Math.min(Math.max(this.nRowsCount,i),gc_nMaxRow)};WorksheetView.prototype._calcVisibleColumns=function(){var w=this.drawingCtx.getWidth();var sumW=this.topLeftFrozenCell?this._getColLeft(this.topLeftFrozenCell.getCol0()):this.cellsLeft;for(var i=this.visibleRange.c1,f=false;i<this.nColsCount&&sumW<w;++i){sumW+=this._getColumnWidth(i); f=true}this.visibleRange.c2=i-(f?1:0)};WorksheetView.prototype._calcVisibleRows=function(){var h=this.drawingCtx.getHeight();var sumH=this.topLeftFrozenCell?this._getRowTop(this.topLeftFrozenCell.getRow0()):this.cellsTop;for(var i=this.visibleRange.r1,f=false;i<this.nRowsCount&&sumH<h;++i){sumH+=this._getRowHeight(i);f=true}this.visibleRange.r2=i-(f?1:0);if(this._calcHeaderColumnWidth())this._updateVisibleColsCount(true)};WorksheetView.prototype._updateColumnPositions=function(){if(Number.MAX_VALUE=== this.updateColumnsStart)return;var i=this.updateColumnsStart;var l=this.cols.length;if(i<l){var x=0===i?0:this.cols[--i].left;for(;i<l;++i){this.cols[i].left=x;x+=this.cols[i].width}}var updateColumnsStart=this.updateColumnsStart;this.updateColumnsStart=Number.MAX_VALUE;this._updateVisibleColsCount(true);this._updateDrawingArea();if(this.objectRender)this.objectRender.updateDrawingsTransform({target:c_oTargetType.ColumnResize,col:updateColumnsStart})};WorksheetView.prototype._updateRowPositions=function(){var y= this.cellsTop;for(var l=this.rows.length,i=0;i<l;++i){this.rows[i].top=y;y+=this.rows[i].height}};WorksheetView.prototype._normalizeViewRange=function(){var t=this;var vr=t.visibleRange;var w=t.drawingCtx.getWidth()-t.cellsLeft;var h=t.drawingCtx.getHeight()-t.cellsTop;var vw=this._getColLeft(vr.c2+1)-this._getColLeft(vr.c1);var vh=this._getRowTop(vr.r2+1)-this._getRowTop(vr.r1);var i;var offsetFrozen=t.getFrozenPaneOffset();vw+=offsetFrozen.offsetX;vh+=offsetFrozen.offsetY;if(vw<w){for(i=vr.c1-1;i>= 0;--i){vw+=this._getColumnWidth(i);if(vw>w)break}vr.c1=i+1;if(vr.c1>=vr.c2)vr.c1=vr.c2-1;if(vr.c1<0)vr.c1=0}if(vh<h){for(i=vr.r1-1;i>=0;--i){vh+=this._getRowHeight(i);if(vh>h)break}vr.r1=i+1;if(vr.r1>=vr.r2)vr.r1=vr.r2-1;if(vr.r1<0)vr.r1=0}};WorksheetView.prototype._calcPagesPrint=function(range,pageOptions,indexWorksheet,arrPages,printScale,adjustPrint){if(0>range.r2||0>range.c2)return;var vector_koef=AscCommonExcel.vector_koef/this.getZoom();if(AscCommon.AscBrowser.isRetina)vector_koef/=AscCommon.AscBrowser.retinaPixelRatio; var isOnlyFirstPage=adjustPrint&&adjustPrint.isOnlyFirstPage;var bFitToWidth=false;var bFitToHeight=false;var pageMargins,pageSetup,pageGridLines,pageHeadings;if(pageOptions){pageMargins=pageOptions.asc_getPageMargins();pageSetup=pageOptions.asc_getPageSetup();pageGridLines=pageOptions.asc_getGridLines();pageHeadings=pageOptions.asc_getHeadings()}var pageWidth,pageHeight,pageOrientation,scale;if(pageSetup instanceof asc_CPageSetup){pageWidth=pageSetup.asc_getWidth();pageHeight=pageSetup.asc_getHeight(); pageOrientation=pageSetup.asc_getOrientation()}if(printScale)scale=printScale/100;else{var pageSetupModel=this.model.PagePrintOptions?this.model.PagePrintOptions.pageSetup:null;scale=pageSetupModel?pageSetupModel.asc_getScale()/100:1}var pageLeftField,pageRightField,pageTopField,pageBottomField;if(pageMargins){pageLeftField=Math.max(pageMargins.asc_getLeft(),c_oAscPrintDefaultSettings.MinPageLeftField);pageRightField=Math.max(pageMargins.asc_getRight(),c_oAscPrintDefaultSettings.MinPageRightField); pageTopField=Math.max(pageMargins.asc_getTop(),c_oAscPrintDefaultSettings.MinPageTopField);pageBottomField=Math.max(pageMargins.asc_getBottom(),c_oAscPrintDefaultSettings.MinPageBottomField)}if(null==pageGridLines)pageGridLines=c_oAscPrintDefaultSettings.PageGridLines;if(null==pageHeadings)pageHeadings=c_oAscPrintDefaultSettings.PageHeadings;if(null==pageWidth)pageWidth=c_oAscPrintDefaultSettings.PageWidth;if(null==pageHeight)pageHeight=c_oAscPrintDefaultSettings.PageHeight;if(null==pageOrientation)pageOrientation= c_oAscPrintDefaultSettings.PageOrientation;if(null==pageLeftField)pageLeftField=c_oAscPrintDefaultSettings.PageLeftField;if(null==pageRightField)pageRightField=c_oAscPrintDefaultSettings.PageRightField;if(null==pageTopField)pageTopField=c_oAscPrintDefaultSettings.PageTopField;if(null==pageBottomField)pageBottomField=c_oAscPrintDefaultSettings.PageBottomField;if(Asc.c_oAscPageOrientation.PageLandscape===pageOrientation){var tmp=pageWidth;pageWidth=pageHeight;pageHeight=tmp}var pageWidthWithFields= pageWidth-pageLeftField-pageRightField;var pageHeightWithFields=pageHeight-pageTopField-pageBottomField;var leftFieldInPx=pageLeftField/vector_koef+1;var topFieldInPx=pageTopField/vector_koef+1;if(pageHeadings){leftFieldInPx+=this.cellsLeft;topFieldInPx+=this.cellsTop}var pageWidthWithFieldsHeadings=(pageWidth-pageRightField)/vector_koef-leftFieldInPx;var pageHeightWithFieldsHeadings=(pageHeight-pageBottomField)/vector_koef-topFieldInPx;var t=this;var printTitles=this.model.workbook.getDefinesNames("Print_Titles", this.model.getId());var tCol1,tCol2,tRow1,tRow2;if(printTitles){var printTitleRefs;AscCommonExcel.executeInR1C1Mode(false,function(){printTitleRefs=AscCommonExcel.getRangeByRef(printTitles.ref,t.model,true,true)});if(printTitleRefs&&printTitleRefs.length)for(var i=0;i<printTitleRefs.length;i++){var bbox=printTitleRefs[i].bbox;if(bbox)if(c_oAscSelectionType.RangeCol===bbox.getType()){tCol1=bbox.c1;tCol2=bbox.c2}else if(c_oAscSelectionType.RangeRow===bbox.getType()){tRow1=bbox.r1;tRow2=bbox.r2}}}var currentColIndex= range.c1;var currentWidth=0;var currentRowIndex=range.r1;var currentHeight=0;var isCalcColumnsWidth=true;var bIsAddOffset=false;var nCountOffset=0;var nCountPages=0;var curTitleWidth=0,curTitleHeight=0;var addedTitleHeight=0,addedTitleWidth=0;var startTitleArrRow=[];var j;var baseTitleHeight=0;if(tRow1<currentRowIndex)for(j=tRow1;j<Math.min(currentRowIndex,tRow2+1);j++)baseTitleHeight+=this._getRowHeight(j)*scale;var baseTitleWidth=0;if(tCol1<currentColIndex)for(j=tCol1;j<Math.min(currentColIndex, tCol2+1);j++)baseTitleWidth+=this._getColumnWidth(j)*scale;while(AscCommonExcel.c_kMaxPrintPages>arrPages.length){if(isOnlyFirstPage&&nCountPages>0)break;var newPagePrint=new asc_CPagePrint;var colIndex=currentColIndex,rowIndex=currentRowIndex,pageRange;newPagePrint.indexWorksheet=indexWorksheet;newPagePrint.pageWidth=pageWidth;newPagePrint.pageHeight=pageHeight;newPagePrint.pageClipRectLeft=pageLeftField/vector_koef;newPagePrint.pageClipRectTop=pageTopField/vector_koef;newPagePrint.pageClipRectWidth= pageWidthWithFields/vector_koef;newPagePrint.pageClipRectHeight=pageHeightWithFields/vector_koef;newPagePrint.leftFieldInPx=leftFieldInPx;newPagePrint.topFieldInPx=topFieldInPx;if(range.r1===rowIndex){curTitleHeight=0;addedTitleHeight=0}else if(undefined!==startTitleArrRow[rowIndex-1]){curTitleHeight=startTitleArrRow[rowIndex-1];addedTitleHeight=startTitleArrRow[rowIndex-1]}if(baseTitleHeight)curTitleHeight+=baseTitleHeight;newPagePrint.titleHeight=curTitleHeight;for(rowIndex=currentRowIndex;rowIndex<= range.r2;++rowIndex){var currentRowHeight=this._getRowHeight(rowIndex)*scale;if(!bFitToHeight&¤tHeight+currentRowHeight+curTitleHeight>pageHeightWithFieldsHeadings&&rowIndex!==currentRowIndex){curTitleHeight=addedTitleHeight;rowIndex=rowIndex;break}if(isCalcColumnsWidth){if(range.c1===colIndex){curTitleWidth=0;addedTitleWidth=0}if(baseTitleWidth)curTitleWidth+=baseTitleWidth;newPagePrint.titleWidth=curTitleWidth;for(colIndex=currentColIndex;colIndex<=range.c2;++colIndex){var currentColWidth= this._getColumnWidth(colIndex)*scale;if(bIsAddOffset){newPagePrint.startOffset=++nCountOffset;newPagePrint.startOffsetPx=pageWidthWithFieldsHeadings*newPagePrint.startOffset;currentColWidth-=newPagePrint.startOffsetPx}if(!bFitToWidth&¤tWidth+currentColWidth+curTitleWidth>pageWidthWithFieldsHeadings&&colIndex!==currentColIndex){curTitleWidth=addedTitleWidth;colIndex=colIndex;break}currentWidth+=currentColWidth;if(tCol1!==undefined&&colIndex>=tCol1&&colIndex<=tCol2)addedTitleWidth+=currentColWidth; if(!bFitToWidth&¤tWidth>pageWidthWithFieldsHeadings&&colIndex===currentColIndex){bIsAddOffset=true;++colIndex;break}else bIsAddOffset=false}isCalcColumnsWidth=false;if(pageHeadings)currentWidth+=this.cellsLeft;if(bFitToWidth){newPagePrint.pageClipRectWidth=Math.max(currentWidth,newPagePrint.pageClipRectWidth);newPagePrint.pageWidth=newPagePrint.pageClipRectWidth*vector_koef+(pageLeftField+pageRightField)}else newPagePrint.pageClipRectWidth=Math.min(currentWidth,newPagePrint.pageClipRectWidth)}currentHeight+= currentRowHeight;if(tRow1!==undefined&&rowIndex>=tRow1&&rowIndex<=tRow2)addedTitleHeight+=currentRowHeight;currentWidth=0}if(pageHeadings)currentHeight+=this.cellsTop;if(bFitToHeight){newPagePrint.pageClipRectHeight=Math.max(currentHeight,newPagePrint.pageClipRectHeight);newPagePrint.pageHeight=newPagePrint.pageClipRectHeight*vector_koef+(pageTopField+pageBottomField)}else newPagePrint.pageClipRectHeight=Math.min(currentHeight,newPagePrint.pageClipRectHeight);isCalcColumnsWidth=true;if(pageGridLines)newPagePrint.pageGridLines= true;if(pageHeadings)newPagePrint.pageHeadings=true;startTitleArrRow[rowIndex-1]=curTitleHeight;pageRange=new asc_Range(currentColIndex,currentRowIndex,colIndex-1,rowIndex-1);newPagePrint.pageRange=pageRange;if(tRow1!==undefined&¤tRowIndex>tRow1)newPagePrint.titleRowRange=new asc_Range(pageRange.c1,tRow1,colIndex-1,Math.min(tRow2,currentRowIndex-1));if(tCol1!==undefined&¤tColIndex>tCol1)newPagePrint.titleColRange=new asc_Range(tCol1,pageRange.r1,Math.min(tCol2,currentColIndex-1),rowIndex- 1);if(printScale)newPagePrint.scale=printScale/100;else if(scale)newPagePrint.scale=scale;arrPages.push(newPagePrint);nCountPages++;if(bIsAddOffset)colIndex-=1;else nCountOffset=0;if(colIndex<=range.c2){currentColIndex=colIndex;currentHeight=0}else{currentColIndex=range.c1;currentRowIndex=rowIndex;currentHeight=0}if(rowIndex>range.r2)if(colIndex<=range.c2){currentColIndex=colIndex;currentHeight=0}else{currentColIndex=colIndex;currentRowIndex=rowIndex;break}}};WorksheetView.prototype._checkPrintRange= function(range,doNotRecalc){if(!doNotRecalc)this._prepareCellTextMetricsCache(range);var maxCol=-1;var maxRow=-1;var t=this;var rowCache,rightSide,curRow=-1,hiddenRow=false;this.model.getRange3(range.r1,range.c1,range.r2,range.c2)._foreachNoEmpty(function(cell){var c=cell.nCol;var r=cell.nRow;if(curRow!==r){curRow=r;hiddenRow=0===t._getRowHeight(r);rowCache=t._getRowCache(r)}if(!hiddenRow&&0<t._getColumnWidth(c)){var style=cell.getStyle();if(style&&(style.fill&&style.fill.notEmpty()||style.border&& style.border.notEmpty())){maxCol=Math.max(maxCol,c);maxRow=Math.max(maxRow,r)}var ct=t._getCellTextCache(c,r);if(ct!==undefined){rightSide=0;if(!ct.flags.isMerged()&&!ct.flags.wrapText)rightSide=ct.sideR;maxCol=Math.max(maxCol,c+rightSide);maxRow=Math.max(maxRow,r)}}});return new AscCommon.CellBase(maxRow,maxCol)};WorksheetView.prototype.calcPagesPrint=function(pageOptions,printOnlySelection,indexWorksheet,arrPages,arrRanges,adjustPrint,doNotRecalc){var range,maxCell,t=this;var _printArea=this.model.workbook.getDefinesNames("Print_Area", this.model.getId());var ignorePrintArea=adjustPrint?adjustPrint.asc_getIgnorePrintArea():null;var printArea=!ignorePrintArea&&_printArea;this.recalcPrintScale();var oldPagePrintOptions;if(this.model.PagePrintOptions){oldPagePrintOptions=this.model.PagePrintOptions;this.model.PagePrintOptions=pageOptions}var getPrintAreaRanges=function(){var res=false;AscCommonExcel.executeInR1C1Mode(false,function(){res=AscCommonExcel.getRangeByRef(printArea.ref,t.model,true,true,true)});return res&&res.length?res: null};if(this.groupWidth||this.groupHeight){this.ignoreGroupSize=true;this._calcHeaderColumnWidth();this._calcHeaderRowHeight()}var printAreaRanges=!printOnlySelection&&printArea?getPrintAreaRanges():null;var pageSetup=pageOptions.asc_getPageSetup();var fitToWidth=pageSetup.asc_getFitToWidth();var fitToHeight=pageSetup.asc_getFitToHeight();var _scale=pageSetup.asc_getScale();var checkCustomScaleProps=function(){var _res;var _pageOptions=t.model.PagePrintOptions;var _pageSetup=_pageOptions.asc_getPageSetup(); var modelScale=_pageSetup.asc_getScale();if(fitToWidth||fitToHeight)_res=t.calcPrintScale(fitToWidth,fitToHeight);if(_res!==null&&_res!==modelScale)return _res;return null};if(printOnlySelection){var tempPrintScale;if(fitToWidth||fitToHeight)tempPrintScale=this.calcPrintScale(fitToWidth,fitToHeight,true);for(var i=0;i<this.model.selectionRange.ranges.length;++i){range=this.model.selectionRange.ranges[i];if(c_oAscSelectionType.RangeCells===range.getType()){if(!doNotRecalc)this._prepareCellTextMetricsCache(range)}else{maxCell= this._checkPrintRange(range,doNotRecalc);range=new asc_Range(range.c1,range.r1,maxCell.col,maxCell.row)}this._calcPagesPrint(range,pageOptions,indexWorksheet,arrPages,tempPrintScale,adjustPrint)}}else if(printArea&&printAreaRanges){tempPrintScale=checkCustomScaleProps();for(var j=0;j<printAreaRanges.length;j++){range=printAreaRanges[j];if(range&&range.bbox)range=range.bbox;else continue;if(c_oAscSelectionType.RangeCells===range.getType()){if(!doNotRecalc)this._prepareCellTextMetricsCache(range)}else{maxCell= this._checkPrintRange(range,doNotRecalc);range=new asc_Range(range.c1,range.r1,maxCell.col,maxCell.row)}if(arrRanges)arrRanges.push(range);this._calcPagesPrint(range,pageOptions,indexWorksheet,arrPages,tempPrintScale,adjustPrint)}}else{range=new asc_Range(0,0,this.model.getColsCount()-1,this.model.getRowsCount()-1);maxCell=this._checkPrintRange(range,doNotRecalc);var maxCol=maxCell.col;var maxRow=maxCell.row;maxCell=this.model.autoFilters.getMaxColRow();maxCol=Math.max(maxCol,maxCell.col);maxRow= Math.max(maxRow,maxCell.row);maxCell=this.objectRender.getMaxColRow();maxCol=Math.max(maxCol,maxCell.col);maxRow=Math.max(maxRow,maxCell.row);range=new asc_Range(0,0,maxCol,maxRow);if(_printArea&&ignorePrintArea&&(fitToWidth||fitToHeight))tempPrintScale=this.calcPrintScale(fitToWidth,fitToHeight,null,ignorePrintArea);else tempPrintScale=checkCustomScaleProps();this._calcPagesPrint(range,pageOptions,indexWorksheet,arrPages,tempPrintScale,adjustPrint)}if(oldPagePrintOptions)this.model.PagePrintOptions= oldPagePrintOptions;if(this.groupWidth||this.groupHeight){this.ignoreGroupSize=false;this._calcHeaderColumnWidth();this._calcHeaderRowHeight()}};WorksheetView.prototype.drawForPrint=function(drawingCtx,printPagesData,indexPrintPage,countPrintPages){var t=this;this.stringRender.fontNeedUpdate=true;if(null===printPagesData){drawingCtx.BeginPage(c_oAscPrintDefaultSettings.PageWidth,c_oAscPrintDefaultSettings.PageHeight);this._drawHeaderFooter(drawingCtx,printPagesData,indexPrintPage,countPrintPages); if(window["Asc"]["editor"].watermarkDraw){window["Asc"]["editor"].watermarkDraw.zoom=1;window["Asc"]["editor"].watermarkDraw.Generate();window["Asc"]["editor"].watermarkDraw.StartRenderer();window["Asc"]["editor"].watermarkDraw.DrawOnRenderer(drawingCtx.DocumentRenderer,c_oAscPrintDefaultSettings.PageWidth,c_oAscPrintDefaultSettings.PageHeight);window["Asc"]["editor"].watermarkDraw.EndRenderer()}drawingCtx.EndPage()}else{drawingCtx.BeginPage(printPagesData.pageWidth,printPagesData.pageHeight);if(this.groupWidth|| this.groupHeight){this.ignoreGroupSize=true;this._calcHeaderColumnWidth();this._calcHeaderRowHeight()}this._drawHeaderFooter(drawingCtx,printPagesData,indexPrintPage,countPrintPages);var clipLeft,clipTop,clipWidth,clipHeight;var clipLeftShape,clipTopShape,clipWidthShape,clipHeightShape;var doDraw=function(range,titleWidth,titleHeight){drawingCtx.AddClipRect(clipLeft,clipTop,clipWidth,clipHeight);var transformMatrix;if(printScale!==1&&drawingCtx.Transform){var mmToPx=asc_getcvt(3,0,t._getPPIX());var leftDiff= printPagesData.pageClipRectLeft*(1-printScale);var topDiff=printPagesData.pageClipRectTop*(1-printScale);transformMatrix=drawingCtx.Transform.CreateDublicate();drawingCtx.setTransform(printScale,drawingCtx.Transform.shy,drawingCtx.Transform.shx,printScale,leftDiff/mmToPx,topDiff/mmToPx)}var offsetCols=printPagesData.startOffsetPx;var offsetX=t._getColLeft(range.c1)-printPagesData.leftFieldInPx+offsetCols-titleWidth;var offsetY=t._getRowTop(range.r1)-printPagesData.topFieldInPx-titleHeight;var tmpVisibleRange= t.visibleRange;t.visibleRange=range.clone();if(printPagesData.pageHeadings){t._drawColumnHeaders(drawingCtx,range.c1,range.c2,undefined,offsetX,printPagesData.topFieldInPx-t.cellsTop);t._drawRowHeaders(drawingCtx,range.r1,range.r2,undefined,printPagesData.leftFieldInPx-t.cellsLeft,offsetY)}if(printPagesData.pageGridLines){var vector_koef=AscCommonExcel.vector_koef/t.getZoom();if(AscCommon.AscBrowser.isRetina)vector_koef/=AscCommon.AscBrowser.retinaPixelRatio;t._drawGrid(drawingCtx,range,offsetX,offsetY, printPagesData.pageWidth/vector_koef,printPagesData.pageHeight/vector_koef,printPagesData.scale)}var _modelScale,_modelPagesOptions;if(t.model.PagePrintOptions&&t.model.PagePrintOptions.pageSetup){_modelScale=t.model.PagePrintOptions.pageSetup.scale;t.model.PagePrintOptions.pageSetup.scale=printPagesData.scale}else{_modelPagesOptions=t.model.PagePrintOptions;t.model.PagePrintOptions=new Asc.asc_CPageOptions(t.model);t.model.PagePrintOptions.pageSetup.scale=printPagesData.scale}t._drawCellsAndBorders(drawingCtx, range,offsetX,offsetY);if(_modelPagesOptions)t.model.PagePrintOptions=_modelPagesOptions;else t.model.PagePrintOptions.pageSetup.scale=_modelScale;drawingCtx.RemoveClipRect();if(transformMatrix)drawingCtx.setTransform(transformMatrix.sx,transformMatrix.shy,transformMatrix.shx,transformMatrix.sy,transformMatrix.tx,transformMatrix.ty);var drawingPrintOptions={ctx:drawingCtx,printPagesData:printPagesData,titleWidth:titleWidth,titleHeight:titleHeight};var oOldBaseTransform=drawingCtx.DocumentRenderer.m_oBaseTransform; var oBaseTransform=new AscCommon.CMatrix;oBaseTransform.sx=printScale;oBaseTransform.sy=printScale;oBaseTransform.tx=asc_getcvt(0,3,t._getPPIX())*(-offsetCols*printScale+printPagesData.pageClipRectLeft+(printPagesData.leftFieldInPx-printPagesData.pageClipRectLeft+titleWidth)*printScale)-(t.getCellLeft(range.c1,3)-t.getCellLeft(0,3))*printScale;oBaseTransform.ty=asc_getcvt(0,3,t._getPPIX())*(printPagesData.pageClipRectTop+(printPagesData.topFieldInPx-printPagesData.pageClipRectTop+titleHeight)*printScale)- (t.getCellTop(range.r1,3)-t.getCellTop(0,3))*printScale;drawingCtx.AddClipRect(clipLeftShape,clipTopShape,clipWidthShape,clipHeightShape);drawingCtx.DocumentRenderer.SetBaseTransform(oBaseTransform);t.objectRender.print(drawingPrintOptions);drawingCtx.DocumentRenderer.SetBaseTransform(oOldBaseTransform);t.visibleRange=tmpVisibleRange;drawingCtx.RemoveClipRect()};this.usePrintScale=true;var printScale=printPagesData.scale?printPagesData.scale:this.getPrintScale();var cellsLeft=printPagesData.pageHeadings? this.cellsLeft:0;var cellsTop=printPagesData.pageHeadings?this.cellsTop:0;var changedCellLeft=cellsLeft-cellsLeft*printScale;var changedCellTop=cellsTop-cellsTop*printScale;var pageWidth,pageHeight;if(printPagesData.titleRowRange||printPagesData.titleColRange){if(printPagesData.titleRowRange&&printPagesData.titleColRange){clipLeft=printPagesData.pageClipRectLeft;clipTop=printPagesData.pageClipRectTop;clipWidth=printPagesData.titleWidth+cellsLeft*printScale;clipHeight=printPagesData.titleHeight+cellsTop* printScale;clipLeftShape=printPagesData.pageClipRectLeft+cellsLeft*printScale;clipTopShape=printPagesData.pageClipRectTop+cellsTop*printScale;clipWidthShape=printPagesData.titleWidth;clipHeightShape=printPagesData.titleHeight;doDraw(new asc_Range(printPagesData.titleColRange.c1,printPagesData.titleRowRange.r1,printPagesData.titleColRange.c2,printPagesData.titleRowRange.r2),0,0)}if(printPagesData.titleRowRange){clipLeft=printPagesData.pageClipRectLeft+printPagesData.titleWidth+(printPagesData.titleWidth? cellsLeft*printScale:0);clipTop=printPagesData.pageClipRectTop;clipWidth=printPagesData.pageClipRectWidth+cellsLeft*printScale;clipHeight=printPagesData.titleHeight+cellsTop*printScale;pageWidth=(t.getCellLeft(printPagesData.titleRowRange.c2+1,0)-t.getCellLeft(printPagesData.titleRowRange.c1,0))*printScale;clipLeftShape=printPagesData.pageClipRectLeft+printPagesData.titleWidth+cellsLeft*printScale;clipTopShape=printPagesData.pageClipRectTop+cellsTop*printScale;clipWidthShape=pageWidth;clipHeightShape= printPagesData.titleHeight;doDraw(printPagesData.titleRowRange,printPagesData.titleWidth/printScale,0)}if(printPagesData.titleColRange){clipLeft=printPagesData.pageClipRectLeft;clipTop=printPagesData.pageClipRectTop+printPagesData.titleHeight+(printPagesData.titleHeight?cellsTop*printScale:0);clipWidth=printPagesData.titleWidth+cellsLeft*printScale;clipHeight=printPagesData.pageClipRectHeight+(printPagesData.titleHeight?cellsTop:0)-changedCellTop;pageHeight=(t.getCellTop(printPagesData.titleColRange.r2+ 1,0)-t.getCellTop(printPagesData.titleColRange.r1,0))*printScale;clipLeftShape=printPagesData.pageClipRectLeft+cellsLeft*printScale;clipTopShape=printPagesData.pageClipRectTop+printPagesData.titleHeight+cellsTop*printScale;clipWidthShape=printPagesData.titleWidth;clipHeightShape=pageHeight;doDraw(printPagesData.titleColRange,0,printPagesData.titleHeight/printScale)}pageWidth=(t.getCellLeft(printPagesData.pageRange.c2+1,0)-t.getCellLeft(printPagesData.pageRange.c1,0))*printScale;pageHeight=(t.getCellTop(printPagesData.pageRange.r2+ 1,0)-t.getCellTop(printPagesData.pageRange.r1,0))*printScale;clipLeft=printPagesData.pageClipRectLeft+printPagesData.titleWidth+(printPagesData.titleWidth?cellsLeft*printScale:0);clipTop=printPagesData.pageClipRectTop+printPagesData.titleHeight+(printPagesData.titleHeight?cellsTop*printScale:0);clipWidth=printPagesData.pageClipRectWidth+cellsLeft*printScale;clipHeight=printPagesData.pageClipRectHeight+(printPagesData.titleHeight?cellsTop:0)-changedCellTop;clipLeftShape=printPagesData.pageClipRectLeft+ printPagesData.titleWidth+cellsLeft*printScale;clipTopShape=printPagesData.pageClipRectTop+printPagesData.titleHeight+cellsTop*printScale;clipWidthShape=pageWidth;clipHeightShape=pageHeight;doDraw(printPagesData.pageRange,printPagesData.titleWidth/printScale,printPagesData.titleHeight/printScale)}else{clipLeft=printPagesData.pageClipRectLeft;clipTop=printPagesData.pageClipRectTop;clipWidth=printPagesData.pageClipRectWidth-changedCellLeft;clipHeight=printPagesData.pageClipRectHeight-changedCellTop; clipLeftShape=printPagesData.pageClipRectLeft+cellsLeft*printScale;clipTopShape=printPagesData.pageClipRectTop+cellsTop*printScale;clipWidthShape=printPagesData.pageClipRectWidth-cellsLeft;clipHeightShape=printPagesData.pageClipRectHeight-cellsTop;doDraw(printPagesData.pageRange,0,0)}this.usePrintScale=false;if(this.groupWidth||this.groupHeight){this.ignoreGroupSize=false;this._calcHeaderColumnWidth();this._calcHeaderRowHeight()}if(window["Asc"]["editor"].watermarkDraw){window["Asc"]["editor"].watermarkDraw.zoom= 1;window["Asc"]["editor"].watermarkDraw.Generate();window["Asc"]["editor"].watermarkDraw.StartRenderer();window["Asc"]["editor"].watermarkDraw.DrawOnRenderer(drawingCtx.DocumentRenderer,printPagesData.pageWidth,printPagesData.pageHeight);window["Asc"]["editor"].watermarkDraw.EndRenderer()}this.stringRender.resetTransform(drawingCtx);drawingCtx.EndPage()}};WorksheetView.prototype.fitOnOnePage=function(val){var width=undefined,height=undefined;if(val===0){width=1;height=1}else if(val===1)width=1;else height= 1;this.fitToPages(width,height)};WorksheetView.prototype.setPrintScale=function(width,height,scale){var t=this;this._isLockedLayoutOptions(function(success){if(!success)return;t.fitToWidthHeight(width,height,width===null&&height===null||width===0&&height===0?scale:undefined)})};WorksheetView.prototype.recalcPrintScale=function(){var pageOptions=this.model.PagePrintOptions;var pageSetup=pageOptions.asc_getPageSetup();var width=pageSetup.asc_getFitToWidth();var height=pageSetup.asc_getFitToHeight(); if(!height&&!width)return;var calcScale=this.calcPrintScale(width,height);if(!isNaN(calcScale))this._setPrintScale(calcScale)};WorksheetView.prototype.fitToPages=function(width,height){this._setPrintScale(this.calcPrintScale(width,height))};WorksheetView.prototype.fitToWidth=function(val){var t=this;var pageOptions=t.model.PagePrintOptions;if(val!==pageOptions.asc_getFitToWidth()){History.Create_NewPoint();History.StartTransaction();pageOptions.asc_setFitToWidth(val);this._setPrintScale(this.calcPrintScale(pageOptions.asc_getFitToWidth(), pageOptions.asc_getFitToHeight()));History.EndTransaction()}};WorksheetView.prototype.fitToHeight=function(val){var t=this;var pageOptions=t.model.PagePrintOptions;if(val!==pageOptions.asc_getFitToHeight()){History.Create_NewPoint();History.StartTransaction();pageOptions.asc_setFitToHeight(val);this._setPrintScale(this.calcPrintScale(pageOptions.asc_getFitToWidth(),pageOptions.asc_getFitToHeight()));History.EndTransaction()}};WorksheetView.prototype.fitToWidthHeight=function(width,height,scale){var t= this;var pageOptions=t.model.PagePrintOptions;var pageSetup=pageOptions.asc_getPageSetup();if(width===null)width=0;if(height===null)height=0;var fitToPageModel=this.model.sheetPr?this.model.sheetPr.FitToPage:null;var fitToHeightAuto=height===0||height===undefined;var fitToWidthAuto=width===0||width===undefined;var changedFitToPage=(!fitToHeightAuto||!fitToWidthAuto)!==fitToPageModel;var fitToWidthModel=pageSetup.fitToWidth;var changedWidth=width!==fitToWidthModel;var fitToHeightModel=pageSetup.fitToHeight; var changedHeight=height!==fitToHeightModel;var changedScale=scale&&scale!==pageSetup.asc_getScale();if(changedWidth||changedHeight||changedScale||changedFitToPage){History.Create_NewPoint();History.StartTransaction();t._changeFitToPage(width,height);if(changedWidth)pageSetup.asc_setFitToWidth(width);if(changedHeight)pageSetup.asc_setFitToHeight(height);if(undefined===scale&&(width!==0||height!==0))scale=t.calcPrintScale(pageSetup.asc_getFitToWidth(),pageSetup.asc_getFitToHeight());if(scale)t._setPrintScale(scale); t.changeViewPrintLines(true);if(t.viewPrintLines)t.updateSelection();History.EndTransaction()}};WorksheetView.prototype._setPrintScale=function(val){var pageOptions=this.model.PagePrintOptions;var pageSetup=pageOptions.asc_getPageSetup();var oldScale=pageSetup.asc_getScale()/100;if(val!==oldScale){History.Create_NewPoint();History.StartTransaction();pageSetup.asc_setScale(val);History.EndTransaction()}};WorksheetView.prototype._changeFitToPage=function(width,height){var fitToHeightAuto=height===0|| height===undefined;var fitToWidthAuto=width===0||width===undefined;this.model.setFitToPage(!fitToHeightAuto||!fitToWidthAuto)};WorksheetView.prototype.calcPrintScale=function(width,height,bSelection,ignorePrintArea){if(this.groupWidth||this.groupHeight){this.ignoreGroupSize=true;this._calcHeaderColumnWidth();this._calcHeaderRowHeight()}var pageOptions=this.model.PagePrintOptions;var pageMargins,pageSetup,pageGridLines,pageHeadings;if(pageOptions){pageMargins=pageOptions.asc_getPageMargins();pageSetup= pageOptions.asc_getPageSetup();pageGridLines=pageOptions.asc_getGridLines();pageHeadings=pageOptions.asc_getHeadings()}var pageWidth,pageHeight,pageOrientation;if(pageSetup instanceof asc_CPageSetup){pageWidth=pageSetup.asc_getWidth();pageHeight=pageSetup.asc_getHeight();pageOrientation=pageSetup.asc_getOrientation()}var pageLeftField,pageRightField,pageTopField,pageBottomField;if(pageMargins){pageLeftField=Math.max(pageMargins.asc_getLeft(),c_oAscPrintDefaultSettings.MinPageLeftField);pageRightField= Math.max(pageMargins.asc_getRight(),c_oAscPrintDefaultSettings.MinPageRightField);pageTopField=Math.max(pageMargins.asc_getTop(),c_oAscPrintDefaultSettings.MinPageTopField);pageBottomField=Math.max(pageMargins.asc_getBottom(),c_oAscPrintDefaultSettings.MinPageBottomField)}var vector_koef=AscCommonExcel.vector_koef/this.getZoom();if(AscCommon.AscBrowser.isRetina)vector_koef/=AscCommon.AscBrowser.retinaPixelRatio;if(null==pageGridLines)pageGridLines=c_oAscPrintDefaultSettings.PageGridLines;if(null== pageHeadings)pageHeadings=c_oAscPrintDefaultSettings.PageHeadings;if(null==pageWidth)pageWidth=c_oAscPrintDefaultSettings.PageWidth;if(null==pageHeight)pageHeight=c_oAscPrintDefaultSettings.PageHeight;if(null==pageOrientation)pageOrientation=c_oAscPrintDefaultSettings.PageOrientation;if(null==pageLeftField)pageLeftField=c_oAscPrintDefaultSettings.PageLeftField;if(null==pageRightField)pageRightField=c_oAscPrintDefaultSettings.PageRightField;if(null==pageTopField)pageTopField=c_oAscPrintDefaultSettings.PageTopField; if(null==pageBottomField)pageBottomField=c_oAscPrintDefaultSettings.PageBottomField;if(Asc.c_oAscPageOrientation.PageLandscape===pageOrientation){var tmp=pageWidth;pageWidth=pageHeight;pageHeight=tmp}var pageWidthWithFields=pageWidth-pageLeftField-pageRightField;var pageHeightWithFields=pageHeight-pageTopField-pageBottomField;var leftFieldInPx=pageLeftField/vector_koef+1;var topFieldInPx=pageTopField/vector_koef+1;leftFieldInPx+=this.cellsLeft;topFieldInPx+=this.cellsTop;var pageWidthWithFieldsHeadings= (pageWidth-pageRightField)/vector_koef-leftFieldInPx;var pageHeightWithFieldsHeadings=(pageHeight-pageBottomField)/vector_koef-topFieldInPx;var t=this;var doCalcScaleWidth=function(start,end){var res;if(width){var widthAllCols=pageHeadings?t.cellsLeft*width:0;for(var i=start;i<=end;i++)widthAllCols+=t._getColumnWidth(i);res=pageWidthWithFieldsHeadings*width/widthAllCols*100}return res};var doCalcScaleHeight=function(start,end){var res;if(height){var heightAllRows=pageHeadings?t.cellsTop*height:0; for(var i=start;i<=end;i++)heightAllRows+=t._getRowHeight(i);res=pageHeightWithFieldsHeadings*height/heightAllRows*100}return res};var wScale;var hScale;var calcScaleByRanges=function(ranges){var tempWScale=null,tempHScale=null;for(var i=0;i<ranges.length;i++){var range=ranges[i].bbox?ranges[i].bbox:ranges[i];tempWScale=doCalcScaleWidth(range.c1,range.c2);tempHScale=doCalcScaleHeight(range.r1,range.r2);if(!wScale||tempWScale&&wScale>tempWScale)wScale=tempWScale;if(!hScale||tempHScale&&hScale>tempHScale)hScale= tempHScale}};if(bSelection)calcScaleByRanges(this._getSelection().ranges);else{var printArea=!ignorePrintArea&&this.model.workbook.getDefinesNames("Print_Area",this.model.getId());var getPrintAreaRanges=function(){var res=false;AscCommonExcel.executeInR1C1Mode(false,function(){res=AscCommonExcel.getRangeByRef(printArea.ref,t.model,true,true)});return res&&res.length?res:null};var printAreaRanges=printArea?getPrintAreaRanges():null;if(printAreaRanges)calcScaleByRanges(printAreaRanges);else{var range= new asc_Range(0,0,this.model.getColsCount()-1,this.model.getRowsCount()-1);var maxCell=this._checkPrintRange(range);var maxCol=maxCell.col;var maxRow=maxCell.row;maxCell=this.model.autoFilters.getMaxColRow();maxCol=Math.max(maxCol,maxCell.col);maxRow=Math.max(maxRow,maxCell.row);maxCell=this.objectRender.getMaxColRow();maxCol=Math.max(maxCol,maxCell.col);maxRow=Math.max(maxRow,maxCell.row);wScale=doCalcScaleWidth(0,maxCol);hScale=doCalcScaleHeight(0,maxRow)}}var minScale;if(width&&height)minScale= Math.min(Math.round(wScale),Math.round(hScale));else if(width)minScale=Math.round(wScale);else minScale=Math.round(hScale);if(minScale<10)minScale=10;if(minScale>100)minScale=100;if(this.groupWidth||this.groupHeight){this.ignoreGroupSize=false;this._calcHeaderColumnWidth();this._calcHeaderRowHeight()}return minScale};WorksheetView.prototype.draw=function(lockDraw){if(lockDraw||this.model.workbook.bCollaborativeChanges||window["IS_NATIVE_EDITOR"])return this;this._recalculate();this.handlers.trigger("checkLastWork"); this._clean();this._drawCorner();this._drawColumnHeaders(null);this._drawRowHeaders(null);this._drawGrid(null);this._drawCellsAndBorders(null);this._drawGroupData(null);this._drawGroupData(null,null,undefined,undefined,true);this._drawFrozenPane();this._drawFrozenPaneLines();this._fixSelectionOfMergedCells();this._drawElements(this.af_drawButtons);this.cellCommentator.drawCommentCells();this.objectRender.showDrawingObjects();if(this.overlayCtx)this._drawSelection();return this};WorksheetView.prototype._clean= function(){this.drawingCtx.setFillStyle(this.settings.cells.defaultState.background).fillRect(0,0,this.drawingCtx.getWidth(),this.drawingCtx.getHeight());if(this.overlayCtx)this.overlayCtx.clear()};WorksheetView.prototype.drawHighlightedHeaders=function(col,row){this._activateOverlayCtx();if(col>=0&&col!==this.highlightedCol){this._doCleanHighlightedHeaders();this.highlightedCol=col;this._drawColumnHeaders(null,col,col,kHeaderHighlighted)}else if(row>=0&&row!==this.highlightedRow){this._doCleanHighlightedHeaders(); this.highlightedRow=row;this._drawRowHeaders(null,row,row,kHeaderHighlighted)}this._deactivateOverlayCtx();return this};WorksheetView.prototype.cleanHighlightedHeaders=function(){this._activateOverlayCtx();this._doCleanHighlightedHeaders();this._deactivateOverlayCtx();return this};WorksheetView.prototype._activateOverlayCtx=function(){this.drawingCtx=this.buffers.overlay};WorksheetView.prototype._deactivateOverlayCtx=function(){this.drawingCtx=this.buffers.main};WorksheetView.prototype._doCleanHighlightedHeaders= function(){var selectionRange=this.model.getSelection();var hlc=this.highlightedCol,hlr=this.highlightedRow;var bSelectionObject=this.objectRender.selectedGraphicObjectsExists();if(hlc>=0){if(bSelectionObject||!selectionRange.containsCol(hlc)){this._cleanColumnHeaders(hlc);if(!bSelectionObject){if(selectionRange.containsCol(hlc+1))this._drawColumnHeaders(null,hlc+1,hlc+1,kHeaderActive);if(selectionRange.containsCol(hlc-1))this._drawColumnHeaders(null,hlc-1,hlc-1,kHeaderActive)}}else this._drawColumnHeaders(null, hlc,hlc,kHeaderActive);this.highlightedCol=-1}if(hlr>=0){if(bSelectionObject||!selectionRange.containsRow(hlr)){this._cleanRowHeaders(hlr);if(!bSelectionObject){if(selectionRange.containsRow(hlr+1))this._drawRowHeaders(null,hlr+1,hlr+1,kHeaderActive);if(selectionRange.containsRow(hlr-1))this._drawRowHeaders(null,hlr-1,hlr-1,kHeaderActive)}}else this._drawRowHeaders(null,hlr,hlr,kHeaderActive);this.highlightedRow=-1}};WorksheetView.prototype._drawActiveHeaders=function(){var vr=this.visibleRange;var selectionRange= this.model.getSelection();var range,c1,c2,r1,r2;this._activateOverlayCtx();for(var i=0;i<selectionRange.ranges.length;++i){range=selectionRange.ranges[i];c1=Math.max(vr.c1,range.c1);c2=Math.min(vr.c2,range.c2);r1=Math.max(vr.r1,range.r1);r2=Math.min(vr.r2,range.r2);this._drawColumnHeaders(null,c1,c2,kHeaderActive);this._drawRowHeaders(null,r1,r2,kHeaderActive);if(this.topLeftFrozenCell){var cFrozen=this.topLeftFrozenCell.getCol0()-1;var rFrozen=this.topLeftFrozenCell.getRow0()-1;if(0<=cFrozen){c1= Math.max(0,range.c1);c2=Math.min(cFrozen,range.c2);this._drawColumnHeaders(null,c1,c2,kHeaderActive)}if(0<=rFrozen){r1=Math.max(0,range.r1);r2=Math.min(rFrozen,range.r2);this._drawRowHeaders(null,r1,r2,kHeaderActive)}}}this._deactivateOverlayCtx()};WorksheetView.prototype._drawCorner=function(){if(false===this.model.getSheetView().asc_getShowRowColHeaders())return;var x2=this.headersLeft+this.headersWidth;var x1=x2-this.headersHeight;var y2=this.headersTop+this.headersHeight;var y1=this.headersTop; var dx=4;var dy=4;this._drawHeader(null,this.headersLeft,this.headersTop,this.headersWidth,this.headersHeight,kHeaderDefault,true,-1);this.drawingCtx.beginPath().moveTo(x2-dx,y1+dy).lineTo(x2-dx,y2-dy).lineTo(x1+dx,y2-dy).lineTo(x2-dx,y1+dy).setFillStyle(this.settings.header.cornerColor).fill()};WorksheetView.prototype._drawColumnHeaders=function(drawingCtx,start,end,style,offsetXForDraw,offsetYForDraw){if(!drawingCtx&&false===this.model.getSheetView().asc_getShowRowColHeaders())return;if(window["IS_NATIVE_EDITOR"])this._prepareCellTextMetricsCache(new asc_Range(start, 0,end,1));var vr=this.visibleRange;var offsetX=undefined!==offsetXForDraw?offsetXForDraw:this._getColLeft(vr.c1)-this.cellsLeft;var offsetY=undefined!==offsetYForDraw?offsetYForDraw:this.headersTop;if(!drawingCtx&&this.topLeftFrozenCell&&undefined===offsetXForDraw){var cFrozen=this.topLeftFrozenCell.getCol0();if(start<vr.c1)offsetX=this._getColLeft(0)-this.cellsLeft;else offsetX-=this._getColLeft(cFrozen)-this._getColLeft(0)}if(asc_typeof(start)!=="number")start=vr.c1;if(asc_typeof(end)!=="number")end= vr.c2;if(style===undefined)style=kHeaderDefault;this._setDefaultFont(drawingCtx);var l=this._getColLeft(start)-offsetX,w;for(var i=start;i<=end;++i){w=this._getColumnWidth(i);this._drawHeader(drawingCtx,l,offsetY,w,this.headersHeight,style,true,i);l+=w}};WorksheetView.prototype._drawRowHeaders=function(drawingCtx,start,end,style,offsetXForDraw,offsetYForDraw){if(!drawingCtx&&false===this.model.getSheetView().asc_getShowRowColHeaders())return;var vr=this.visibleRange;var offsetX=undefined!==offsetXForDraw? offsetXForDraw:this.headersLeft;var offsetY=undefined!==offsetYForDraw?offsetYForDraw:this._getRowTop(vr.r1)-this.cellsTop;if(!drawingCtx&&this.topLeftFrozenCell&&undefined===offsetYForDraw){var rFrozen=this.topLeftFrozenCell.getRow0();if(start<vr.r1)offsetY=this._getRowTop(0)-this.cellsTop;else offsetY-=this._getRowTop(rFrozen)-this._getRowTop(0)}if(asc_typeof(start)!=="number")start=vr.r1;if(asc_typeof(end)!=="number")end=vr.r2;if(style===undefined)style=kHeaderDefault;this._setDefaultFont(drawingCtx); var t=this._getRowTop(start)-offsetY,h;for(var i=start;i<=end;++i){h=this._getRowHeight(i);this._drawHeader(drawingCtx,offsetX,t,this.headersWidth,h,style,false,i);t+=h}};WorksheetView.prototype._drawHeader=function(drawingCtx,x,y,w,h,style,isColHeader,index){var isZeroHeader=false;if(-1!==index)if(isColHeader)if(0===w){if(style!==kHeaderDefault)return;isZeroHeader=true;w=1;if(0<index&&0===this._getColumnWidth(index-1))return}else{if(0<index&&0===this._getColumnWidth(index-1)){w-=1;x+=1}}else if(0=== h){if(style!==kHeaderDefault)return;isZeroHeader=true;h=1;if(0<index&&0===this._getRowHeight(index-1))return}else if(0<index&&0===this._getRowHeight(index-1)){h-=1;y+=1}var activeNamedSheetView=this.model.getActiveNamedSheetViewId()!==null;var ctx=drawingCtx||this.drawingCtx;var st=this.settings.header.style[style];var x2=x+w;var y2=y+h;var x2WithoutBorder=x2-gridlineSize;if(!isZeroHeader)ctx.setFillStyle(activeNamedSheetView?st.backgroundDark:st.background).fillRect(x,y,w,h);ctx.setStrokeStyle(st.border).setLineWidth(1).beginPath(); if(style!==kHeaderDefault&&!isColHeader&&!window["IS_NATIVE_EDITOR"])ctx.lineHorPrevPx(x,y,x2);if(isColHeader||!window["IS_NATIVE_EDITOR"])ctx.lineVerPrevPx(x2,y,y2);if(!isColHeader||!window["IS_NATIVE_EDITOR"])ctx.lineHorPrevPx(x,y2,x2);if(style!==kHeaderDefault&&isColHeader)ctx.lineVerPrevPx(x,y,y2);ctx.stroke();if(isZeroHeader||-1===index)return;var text=isColHeader?this._getColumnTitle(index):this._getRowTitle(index);var sr=this.stringRender;var tm=this._roundTextMetrics(sr.measureString(text)); var bl=y2-Asc.round((isColHeader?this.defaultRowDescender:this._getRowDescender(index))*this.getZoom());var textX=this._calcTextHorizPos(x,x2WithoutBorder,tm,tm.width<w?AscCommon.align_Center:AscCommon.align_Left);var textY=this._calcTextVertPos(y,h,bl,tm,Asc.c_oAscVAlign.Bottom);ctx.AddClipRect(x,y,w,h);ctx.setFillStyle(activeNamedSheetView?st.colorDark:st.color).fillText(text,textX,textY+Asc.round(tm.baseline*this.getZoom()),undefined,sr.charWidths);ctx.RemoveClipRect()};WorksheetView.prototype._drawHeaderFooter= function(drawingCtx,printPagesData,indexPrintPage,countPrintPages){if(!printPagesData)return;var headerFooterModel=this.model.headerFooter;var curHeader;if(indexPrintPage===0&&headerFooterModel.differentFirst)curHeader=headerFooterModel.getFirstHeader();else if(headerFooterModel.differentOddEven)curHeader=0===(indexPrintPage+1)%2?headerFooterModel.getEvenHeader():headerFooterModel.getOddHeader();else curHeader=headerFooterModel.getOddHeader();if(curHeader){if(!curHeader.parser){curHeader.parser=new AscCommonExcel.HeaderFooterParser; curHeader.parser.parse(curHeader.str)}this._drawHeaderFooterText(drawingCtx,printPagesData,curHeader.parser,indexPrintPage,countPrintPages)}var curFooter;if(indexPrintPage===0&&headerFooterModel.differentFirst)curFooter=headerFooterModel.getFirstFooter();else if(headerFooterModel.differentOddEven)curFooter=0===(indexPrintPage+1)%2?headerFooterModel.getEvenFooter():headerFooterModel.getOddFooter();else curFooter=headerFooterModel.getOddFooter();if(curFooter){if(!curFooter.parser){curFooter.parser= new AscCommonExcel.HeaderFooterParser;curFooter.parser.parse(curFooter.str)}this._drawHeaderFooterText(drawingCtx,printPagesData,curFooter.parser,indexPrintPage,countPrintPages,true)}};WorksheetView.prototype._drawHeaderFooterText=function(drawingCtx,printPagesData,headerFooterParser,indexPrintPage,countPrintPages,bFooter){var t=this;var getFragmentText=function(val){if(asc_typeof(val)==="string")return val;else return val.getText(t,indexPrintPage,countPrintPages)};var getFragments=function(portion){var res= [];for(var i=0;i<portion.length;i++){var str=new AscCommonExcel.Fragment;str.text=getFragmentText(portion[i].text);str.format=portion[i].format.clone();var fSize=str.format.fs?str.format.fs:AscCommonExcel.g_oDefaultFormat.Font.fs;str.format.fs=fSize*printScale;res.push(str)}return res};var vector_koef=AscCommonExcel.vector_koef/this.getZoom();if(AscCommon.AscBrowser.isRetina)vector_koef/=AscCommon.AscBrowser.retinaPixelRatio;var scaleWithDoc=this.model.headerFooter.getScaleWithDoc();var printScale= scaleWithDoc===null||scaleWithDoc===true?this.getPrintScale():1;var margins=this.model.PagePrintOptions.asc_getPageMargins();var width=printPagesData.pageWidth/vector_koef;var height=printPagesData.pageHeight/vector_koef;var defaultMargin=17.8;var alignWithMargins=this.model.headerFooter.getAlignWithMargins();var left=alignWithMargins?margins.left/vector_koef:defaultMargin/vector_koef;var right=alignWithMargins?margins.right/vector_koef:defaultMargin/vector_koef;var top=margins.header/AscCommonExcel.vector_koef; var bottom=margins.footer/AscCommonExcel.vector_koef;var rowTop=this._getRowTop(0)-this.groupHeight;if(top<rowTop)top=rowTop;var footerStartPos=height-bottom;var drawPortion=function(index){var portion=headerFooterParser.portions[index];if(!portion)return;var cellFlags=new AscCommonExcel.CellFlags;cellFlags.wrapText=true;cellFlags.textAlign=window["AscCommonExcel"].CHeaderFooterEditorSection.prototype.getAlign.call(null,index);var fragments=getFragments(portion);t.stringRender.setString(fragments, cellFlags);var maxWidth=width-left-right;var textMetrics=t.stringRender._measureChars(maxWidth);var x,y;switch(index){case window["AscCommonExcel"].c_oPortionPosition.left:{x=left;y=!bFooter?top:footerStartPos-textMetrics.height;break}case window["AscCommonExcel"].c_oPortionPosition.center:{x=(width-left-right)/2+left-textMetrics.width/2;y=!bFooter?top:footerStartPos-textMetrics.height;break}case window["AscCommonExcel"].c_oPortionPosition.right:{x=width-right-textMetrics.width;y=!bFooter?top:footerStartPos- textMetrics.height;break}}t.stringRender.fontNeedUpdate=true;t.stringRender.render(drawingCtx,x,y,textMetrics.width,t.settings.activeCellBorderColor)};this._setDefaultFont(drawingCtx);for(var i=0;i<headerFooterParser.portions.length;i++)drawPortion(i)};WorksheetView.prototype._cleanColumnHeaders=function(colStart,colEnd){var offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft;var l,w,i,cFrozen=0;if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0();offsetX-=this._getColLeft(cFrozen)- this._getColLeft(0)}if(colEnd===undefined)colEnd=colStart;var colStartTmp=Math.max(this.visibleRange.c1,colStart);var colEndTmp=Math.min(this.visibleRange.c2,colEnd);l=this._getColLeft(colStartTmp)-offsetX;for(i=colStartTmp;i<=colEndTmp;++i){w=this._getColumnWidth(i);if(0!==w){this.drawingCtx.clearRectByX(l,this.headersTop,w,this.headersHeight);l+=w}}if(0!==cFrozen){offsetX=this._getColLeft(0)-this.cellsLeft;colStart=Math.max(0,colStart);colEnd=Math.min(cFrozen,colEnd);l=this._getColLeft(colStart)- offsetX;for(i=colStart;i<=colEnd;++i){w=this._getColumnWidth(i);if(0!==w){this.drawingCtx.clearRectByX(l,this.headersTop,w,this.headersHeight);l+=w}}}};WorksheetView.prototype._cleanRowHeaders=function(rowStart,rowEnd){var offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop;var t,h,i,rFrozen=0;if(this.topLeftFrozenCell){rFrozen=this.topLeftFrozenCell.getRow0();offsetY-=this._getRowTop(rFrozen)-this._getRowTop(0)}if(rowEnd===undefined)rowEnd=rowStart;var rowStartTmp=Math.max(this.visibleRange.r1, rowStart);var rowEndTmp=Math.min(this.visibleRange.r2,rowEnd);t=this._getRowTop(rowStartTmp)-offsetY;for(i=rowStartTmp;i<=rowEndTmp;++i){h=this._getRowHeight(i);if(0!==h){this.drawingCtx.clearRectByY(this.headersLeft,t,this.headersWidth,h);t+=h}}if(0!==rFrozen){offsetY=this._getRowTop(0)-this.cellsTop;rowStart=Math.max(0,rowStart);rowEnd=Math.min(rFrozen,rowEnd);t=this._getRowTop(rowStart)-offsetY;for(i=rowStart;i<=rowEnd;++i){h=this._getRowHeight(i);if(0!==h){this.drawingCtx.clearRectByY(this.headersLeft, t,this.headersWidth,h);t+=h}}}};WorksheetView.prototype._cleanColumnHeadersRect=function(){this.drawingCtx.clearRect(this.cellsLeft,this.headersTop,this.drawingCtx.getWidth()-this.cellsLeft,this.headersHeight)};WorksheetView.prototype._drawGrid=function(drawingCtx,range,leftFieldInPx,topFieldInPx,width,height,printScale){var visiblePrintPages=pageBreakPreviewMode?this._getVisiblePrintPages(range).printPages:null;if(!drawingCtx&&false===this.model.getSheetView().asc_getShowGridLines())return;if(range=== undefined)range=this.visibleRange;if(!printScale)printScale=this.getPrintScale();var ctx=drawingCtx||this.drawingCtx;var widthCtx=width?width/printScale:ctx.getWidth()/printScale;var heightCtx=height?height/printScale:ctx.getHeight()/printScale;var offsetX=undefined!==leftFieldInPx?leftFieldInPx:this._getColLeft(this.visibleRange.c1)-this.cellsLeft;var offsetY=undefined!==topFieldInPx?topFieldInPx:this._getRowTop(this.visibleRange.r1)-this.cellsTop;if(!drawingCtx&&this.topLeftFrozenCell){if(undefined=== leftFieldInPx){var cFrozen=this.topLeftFrozenCell.getCol0();offsetX-=this._getColLeft(cFrozen)-this._getColLeft(0)}if(undefined===topFieldInPx){var rFrozen=this.topLeftFrozenCell.getRow0();offsetY-=this._getRowTop(rFrozen)-this._getRowTop(0)}}var x1=this._getColLeft(range.c1)-offsetX;var y1=this._getRowTop(range.r1)-offsetY;var x2=Math.min(this._getColLeft(range.c2+1)-offsetX,widthCtx);var y2=Math.min(this._getRowTop(range.r2+1)-offsetY,heightCtx);ctx.setFillStyle(this.settings.cells.defaultState.background).fillRect(x1, y1,x2-x1,y2-y1);this._drawPageBreakPreviewText(drawingCtx,range,leftFieldInPx,topFieldInPx,width,height,visiblePrintPages);ctx.setStrokeStyle(this.settings.cells.defaultState.border).setLineWidth(1).beginPath();var i,d,l;for(i=range.c1,d=x1;i<=range.c2&&d<=x2;++i){l=this._getColumnWidth(i);d+=l;if(0<l)ctx.lineVerPrevPx(d,y1,y2)}for(i=range.r1,d=y1;i<=range.r2&&d<=y2;++i){l=this._getRowHeight(i);d+=l;if(0<l)ctx.lineHorPrevPx(x1,d,x2)}ctx.stroke();var clearRange,pivotRange,clearRanges=this.model.getPivotTablesClearRanges(range); ctx.setFillStyle(this.settings.cells.defaultState.background);for(i=0;i<clearRanges.length;i+=2){clearRange=clearRanges[i];pivotRange=clearRanges[i+1];x1=this._getColLeft(clearRange.c1)-offsetX+(clearRange.c1===pivotRange.c1?1:0);y1=this._getRowTop(clearRange.r1)-offsetY+(clearRange.r1===pivotRange.r1?1:0);x2=Math.min(this._getColLeft(clearRange.c2+1)-offsetX-(clearRange.c2===pivotRange.c2?1:0),widthCtx);y2=Math.min(this._getRowTop(clearRange.r2+1)-offsetY-(clearRange.r2===pivotRange.r2?1:0),heightCtx); ctx.fillRect(x1,y1,x2-x1,y2-y1)}this._drawPageBreakPreviewLines(drawingCtx,range,leftFieldInPx,topFieldInPx,width,height,visiblePrintPages)};WorksheetView.prototype._drawCellsAndBorders=function(drawingCtx,range,offsetXForDraw,offsetYForDraw){if(range===undefined)range=this.visibleRange;var left,top,cFrozen,rFrozen;var offsetX=undefined===offsetXForDraw?this._getColLeft(this.visibleRange.c1)-this.cellsLeft:offsetXForDraw;var offsetY=undefined===offsetYForDraw?this._getRowTop(this.visibleRange.r1)- this.cellsTop:offsetYForDraw;if(!drawingCtx&&this.topLeftFrozenCell){if(undefined===offsetXForDraw){cFrozen=this.topLeftFrozenCell.getCol0();offsetX-=this._getColLeft(cFrozen)-this.cellsLeft}if(undefined===offsetYForDraw){rFrozen=this.topLeftFrozenCell.getRow0();offsetY-=this._getRowTop(rFrozen)-this.cellsTop}}if(!drawingCtx&&!window["IS_NATIVE_EDITOR"]){left=this._getColLeft(range.c1);top=this._getRowTop(range.r1);this.drawingCtx.save().beginPath().rect(left-offsetX,top-offsetY,Math.min(this._getColLeft(range.c2+ 1)-left,this.drawingCtx.getWidth()-this.cellsLeft),Math.min(this._getRowTop(range.r2+1)-top,this.drawingCtx.getHeight()-this.cellsTop)).clip()}this._prepareCellTextMetricsCache(range);var mergedCells={},mc;for(var row=range.r1;row<=range.r2;++row)this._drawRowBG(drawingCtx,row,range.c1,range.c2,offsetX,offsetY,mergedCells);for(var i in mergedCells){mc=mergedCells[i];this._drawRowBG(drawingCtx,mc.r1,mc.c1,mc.c1,offsetX,offsetY,null,mc)}this._drawSparklines(drawingCtx,range,offsetX,offsetY);this._drawCellsBorders(drawingCtx, range,offsetX,offsetY,mergedCells);if(!drawingCtx&&!window["IS_NATIVE_EDITOR"])this.drawingCtx.restore()};WorksheetView.prototype._drawSparklines=function(drawingCtx,range,offsetX,offsetY){this.objectRender.drawSparkLineGroups(drawingCtx||this.drawingCtx,this.model.aSparklineGroups,range,offsetX*asc_getcvt(0,3,this._getPPIX()),offsetY*asc_getcvt(0,3,this._getPPIX()))};WorksheetView.prototype._drawRowBG=function(drawingCtx,row,colStart,colEnd,offsetX,offsetY,mergedCells,mc){var height=this._getRowHeight(row); if(0===height&&mergedCells)return;var drawCells={},i;var aRules=this.model.aConditionalFormattingRules.sort(function(v1,v2){return v2.priority-v1.priority});var top=this._getRowTop(row);var ctx=drawingCtx||this.drawingCtx;var graphics=drawingCtx?ctx.DocumentRenderer:this.handlers.trigger("getMainGraphics");for(var col=colStart;col<=colEnd;++col){var width=this._getColumnWidth(col);if(0===width&&mergedCells)continue;var c=this._getVisibleCell(col,row);var findFillColor=this.handlers.trigger("selectSearchingResults")&& this.model.inFindResults(row,col)?this.settings.findFillColor:null;var fill=c.getFill();var hasFill=fill.hasFill();var mwidth=0,mheight=0;if(mergedCells){mc=this.model.getMergedByCell(row,col);if(mc){mergedCells[AscCommonExcel.getCellIndex(mc.r1,mc.c1)]=mc;col=mc.c2;continue}}if(mc){if(col!==mc.c1||row!==mc.r1)continue;mwidth=this._getColLeft(mc.c2+1)-this._getColLeft(mc.c1+1);mheight=this._getRowTop(mc.r2+1)-this._getRowTop(mc.r1+1)}if(findFillColor||hasFill||mc){var fillGrid=findFillColor||hasFill; var x=this._getColLeft(col)-(fillGrid?1:0);var y=top-(fillGrid?1:0);var w=width+(fillGrid?+1:-1)+mwidth;var h=height+(fillGrid?+1:-1)+mheight;findFillColor=findFillColor||!hasFill&&mc&&this.settings.cells.defaultState.background;if(findFillColor){fill=new AscCommonExcel.Fill;fill.patternFill=new AscCommonExcel.PatternFill;fill.patternFill.fromColor(findFillColor)}AscCommonExcel.drawFillCell(ctx,graphics,fill,new AscCommon.asc_CRect(x-offsetX,y-offsetY,w,h))}var showValue=this._drawCellCF(ctx,aRules, c,row,col,top,width+mwidth,height+mheight,offsetX,offsetY);if(showValue)drawCells[col]=1}i=this._findOverlapCell(colStart,row);if(-1!==i)drawCells[i]=1;if(colStart!==colEnd){i=this._findOverlapCell(colEnd,row);if(-1!==i)drawCells[i]=1}for(i in drawCells)this._drawCellText(drawingCtx,aRules,i>>0,row,colStart,colEnd,offsetX,offsetY)};WorksheetView.prototype._getCellCF=function(aRules,c,row,col,type){var ct=this._getCellTextCache(col,row);if(!ct||!ct.flags.isNumberFormat||0===aRules.length)return null; var cellValue=c.getNumberValue();if(null===cellValue)return null;var oRule,oRuleElement,ranges,multiplyRange,values;for(var i=aRules.length-1;i>=0;--i){oRule=aRules[i];ranges=oRule.ranges;multiplyRange=new AscCommonExcel.MultiplyRange(ranges);if(multiplyRange.contains(col,row)){oRuleElement=oRule.asc_getColorScaleOrDataBarOrIconSetRule();if(!oRuleElement||Asc.ECfType.colorScale===oRuleElement.type)continue;if(type!==oRule.type)continue;if(Asc.ECfType.iconSet===oRule.type){if(ct.angle&&oRuleElement.ShowValue)continue; values=this.model._getValuesForConditionalFormatting(ranges,true);var img=AscCommonExcel.getCFIcon(oRuleElement,oRule.getIndexRule(values,this.model,cellValue));if(!img)continue}return oRule}}return null};WorksheetView.prototype._drawCellCFDataBar=function(ctx,graphics,oRule,cellValue,x,top,width,height){var tmp;var oRuleElement=oRule.asc_getColorScaleOrDataBarOrIconSetRule();var values=this.model._getValuesForConditionalFormatting(oRule.ranges,true);var min=oRule.getMin(values,this.model);var max= oRule.getMax(values,this.model);var isPositive=0<=cellValue;var isReverse=AscCommonExcel.EDataBarDirection.rightToLeft===oRuleElement.Direction;var isMiddle=AscCommonExcel.EDataBarAxisPosition.middle===oRuleElement.AxisPosition||AscCommonExcel.EDataBarAxisPosition.automatic===oRuleElement.AxisPosition&&0>min&&0<max;if(isMiddle)if(isPositive)min=Math.max(0,min);else max=Math.min(0,max);if(0>=max){tmp=-max;max=-min;min=tmp;cellValue=-cellValue;isReverse=!isReverse}if(cellValue<min)cellValue=min;else if(cellValue> max)cellValue=max;var minLength=Math.floor(width*oRuleElement.MinLength/100);var maxLength=Math.floor(width*oRuleElement.MaxLength/100);var k=max-min;k=k?(maxLength-minLength)/k:0;var dataBarLength=minLength+(cellValue-min)*k;color=isPositive||oRuleElement.NegativeBarColorSameAsPositive?oRuleElement.Color:oRuleElement.NegativeColor;if(0!==dataBarLength&&color){if(isMiddle){if(oRuleElement.AxisColor){ctx.setLineWidth(1).setLineDash([3,1]).setStrokeStyle(oRuleElement.AxisColor);ctx.beginPath().lineVer(x- 1+Asc.floor(width/2),top-1,top-1+height-1).stroke()}dataBarLength=Asc.floor(dataBarLength/2);x+=Asc.floor(width/2)*(isReverse?-1:1)}if(isReverse)x+=width-dataBarLength;var fill=new AscCommonExcel.Fill;if(oRuleElement.Gradient){var endColor=AscCommonExcel.getDataBarGradientColor(color);if(isReverse){tmp=color;color=endColor;endColor=tmp}fill.gradientFill=new AscCommonExcel.GradientFill;var stop0=new AscCommonExcel.GradientStop;stop0.position=0;stop0.color=color;var stop1=new AscCommonExcel.GradientStop; stop1.position=1;stop1.color=endColor;fill.gradientFill.asc_putGradientStops([stop0,stop1])}else{fill.patternFill=new AscCommonExcel.PatternFill;fill.patternFill.fromColor(color)}AscCommonExcel.drawFillCell(ctx,graphics,fill,new AscCommon.asc_CRect(x,top,dataBarLength,height-3));var color=isPositive||oRuleElement.NegativeBarBorderColorSameAsPositive?oRuleElement.BorderColor:oRuleElement.NegativeBorderColor;if(color)ctx.setLineWidth(1).setLineDash([]).setStrokeStyle(color).strokeRect(x,top,dataBarLength- 1,height-4)}};WorksheetView.prototype._drawCellCFIconSet=function(ctx,graphics,oRule,cellValue,fontSize,align,row,x,top,width,height){var oRuleElement=oRule.asc_getColorScaleOrDataBarOrIconSetRule();var values=this.model._getValuesForConditionalFormatting(oRule.ranges,true);var img=AscCommonExcel.getCFIcon(oRuleElement,oRule.getIndexRule(values,this.model,cellValue));if(!img)return;var iconSize=AscCommon.AscBrowser.convertToRetinaValue(getCFIconSize(fontSize),true);var rect=new AscCommon.asc_CRect(x, top,width,height);var bl=rect._y+rect._height-Asc.round(this._getRowDescender(row)*this.getZoom());var tm=new Asc.TextMetrics(iconSize,iconSize,0,iconSize-2*fontSize/AscCommonExcel.cDefIconFont,0,0,0);var cellHA=align.getAlignHorizontal();if(oRuleElement.ShowValue||AscCommon.align_Left!==cellHA&&AscCommon.align_Right!==cellHA&&AscCommon.align_Center!==cellHA)cellHA=AscCommon.align_Left;rect._x=this._calcTextHorizPos(rect._x,rect._x+rect._width,tm,cellHA);rect._y=this._calcTextVertPos(rect._y,rect._height, bl,tm,align.getAlignVertical());var dScale=asc_getcvt(0,3,this._getPPIX());rect._x*=dScale;rect._y*=dScale;rect._width*=dScale;rect._height*=dScale;AscFormat.ExecuteNoHistory(function(img,rect,imgSize){var geometry=new AscFormat.CreateGeometry("rect");geometry.Recalculate(imgSize,imgSize,true);var oUniFill=new AscFormat.builder_CreateBlipFill(img,"stretch");if(ctx instanceof AscCommonExcel.CPdfPrinter){graphics.SaveGrState();graphics.SetBaseTransform(ctx.Transform||new AscCommon.CMatrix)}graphics.save(); var oMatrix=new AscCommon.CMatrix;oMatrix.tx=rect._x;oMatrix.ty=rect._y;graphics.transform3(oMatrix);var shapeDrawer=new AscCommon.CShapeDrawer;shapeDrawer.Graphics=graphics;shapeDrawer.fromShape2(new AscFormat.CColorObj(null,oUniFill,geometry),graphics,geometry);shapeDrawer.draw(geometry);graphics.restore();if(ctx instanceof AscCommonExcel.CPdfPrinter){graphics.SetBaseTransform(null);graphics.RestoreGrState()}},this,[img,rect,iconSize*dScale*this.getZoom()])};WorksheetView.prototype._drawCellCF= function(ctx,aRules,c,row,col,top,width,height,offsetX,offsetY){var oDataBarRule=this._getCellCF(aRules,c,row,col,Asc.ECfType.dataBar);var oIconSetRule=this._getCellCF(aRules,c,row,col,Asc.ECfType.iconSet);if(!oDataBarRule&&!oIconSetRule)return true;var x=this._getColLeft(col)-offsetX+1;width-=3;top+=1-offsetY;var graphics=ctx&&ctx.DocumentRenderer||this.handlers.trigger("getMainGraphics");var cellValue=c.getNumberValue();if(oDataBarRule)this._drawCellCFDataBar(ctx,graphics,oDataBarRule,cellValue, x,top,width,height);if(oIconSetRule)this._drawCellCFIconSet(ctx,graphics,oIconSetRule,cellValue,c.getFont().getSize(),c.getAlign(),row,x,top,width,height);var res;if(oDataBarRule&&oIconSetRule)res=oDataBarRule.priority<oIconSetRule.priority?oDataBarRule:oIconSetRule;else res=oDataBarRule||oIconSetRule;var oRuleElement=res.asc_getColorScaleOrDataBarOrIconSetRule();return oRuleElement.ShowValue};WorksheetView.prototype._drawCellText=function(drawingCtx,aRules,col,row,colStart,colEnd,offsetX,offsetY){var ct= this._getCellTextCache(col,row);if(!ct)return null;var c=this._getVisibleCell(col,row);var font=c.getFont();var color=font.getColor();var isMerged=ct.flags.isMerged(),range,isWrapped=ct.flags.wrapText;var ctx=drawingCtx||this.drawingCtx;if(isMerged){range=ct.flags.merged;if(col!==range.c1||row!==range.r1)return null}var colL=isMerged?range.c1:Math.max(colStart,col-ct.sideL);var colR=isMerged?Math.min(range.c2,this.nColsCount-1):Math.min(colEnd,col+ct.sideR);var rowT=isMerged?range.r1:row;var rowB= isMerged?Math.min(range.r2,this.nRowsCount-1):row;var isTrimmedR=!isMerged&&colR!==col+ct.sideR;if(!ct.angle)if(!isMerged&&!isWrapped)this._eraseCellRightBorder(drawingCtx,colL,colR+(isTrimmedR?1:0),row,offsetX,offsetY);var x1=this._getColLeft(colL)-offsetX;var y1=this._getRowTop(rowT)-offsetY;var w=this._getColLeft(colR+1)-offsetX-x1;var h=this._getRowTop(rowB+1)-offsetY-y1;var x2=x1+w-(isTrimmedR?0:gridlineSize);var y2=y1+h;var bl=y2-Asc.round((isMerged?ct.metrics.height-ct.metrics.baseline:this._getRowDescender(rowB))* this.getZoom());var x1ct=isMerged?x1:this._getColLeft(col)-offsetX;var x2ct=isMerged?x2:x1ct+this._getColumnWidth(col)-gridlineSize;var textX=this._calcTextHorizPos(x1ct,x2ct,ct.metrics,ct.cellHA);var textY=this._calcTextVertPos(y1,h,bl,ct.metrics,ct.cellVA);var textW=this._calcTextWidth(x1ct,x2ct,ct.metrics,ct.cellHA);var xb1,yb1,wb,hb,colLeft,colRight;var txtRotX,txtRotW,clipUse=false;if(ct.angle){xb1=this._getColLeft(col)-offsetX;yb1=this._getRowTop(row)-offsetY;wb=this._getColumnWidth(col);hb= this._getRowHeight(row);txtRotX=xb1-ct.textBound.offsetX;txtRotW=ct.textBound.width+xb1-ct.textBound.offsetX;if(isMerged){wb=this._getColLeft(colR+1)-this._getColLeft(colL);hb=this._getRowTop(rowB+1)-this._getRowTop(rowT);ctx.AddClipRect(xb1,yb1,wb,hb);clipUse=true}this.stringRender.angle=ct.angle;this.stringRender.fontNeedUpdate=true;if(90===ct.angle||-90===ct.angle){if(!isMerged){ctx.AddClipRect(xb1,yb1,wb,hb);clipUse=true}}else{if(!isMerged){ctx.AddClipRect(0,y1,this.drawingCtx.getWidth(),h);clipUse= true}if(!isMerged&&!isWrapped){colLeft=col;if(0!==txtRotX)while(true){if(0==colLeft)break;if(txtRotX>=this._getColLeft(colLeft))break;--colLeft}colRight=Math.min(col,this.nColsCount-1);if(0!==txtRotW)while(true){++colRight;if(colRight>=this.nColsCount){--colRight;break}if(txtRotW<=this._getColLeft(colRight)){--colRight;break}}colLeft=isMerged?range.c1:colLeft;colRight=isMerged?Math.min(range.c2,this.nColsCount-1):colRight;this._eraseCellRightBorder(drawingCtx,colLeft,colRight+(isTrimmedR?1:0),row, offsetX,offsetY)}}var _printScale=this.getPrintScale();var transformMatrix;if(_printScale!==1&&drawingCtx)transformMatrix=drawingCtx.Transform.CreateDublicate();this.stringRender.rotateAtPoint(drawingCtx,ct.angle,xb1,yb1,ct.textBound.dx,ct.textBound.dy);if(transformMatrix){var tempMatrix=drawingCtx.Transform.CreateDublicate();var resMatrix=tempMatrix.Multiply(transformMatrix);drawingCtx.setTransform(resMatrix.sx,resMatrix.shy,resMatrix.shx,resMatrix.sy,resMatrix.tx,resMatrix.ty)}this.stringRender.restoreInternalState(ct.state); if(isWrapped)if(ct.angle<0)if(Asc.c_oAscVAlign.Top===ct.cellVA)this.stringRender.flags.textAlign=AscCommon.align_Left;else if(Asc.c_oAscVAlign.Center===ct.cellVA||Asc.c_oAscVAlign.Dist===ct.cellVA||Asc.c_oAscVAlign.Just===ct.cellVA)this.stringRender.flags.textAlign=AscCommon.align_Center;else{if(Asc.c_oAscVAlign.Bottom===ct.cellVA)this.stringRender.flags.textAlign=AscCommon.align_Right}else if(Asc.c_oAscVAlign.Top===ct.cellVA)this.stringRender.flags.textAlign=AscCommon.align_Right;else if(Asc.c_oAscVAlign.Center=== ct.cellVA||Asc.c_oAscVAlign.Dist===ct.cellVA||Asc.c_oAscVAlign.Just===ct.cellVA)this.stringRender.flags.textAlign=AscCommon.align_Center;else if(Asc.c_oAscVAlign.Bottom===ct.cellVA)this.stringRender.flags.textAlign=AscCommon.align_Left;this.stringRender.render(drawingCtx,0,0,textW,color);this.stringRender.resetTransform(drawingCtx);if(transformMatrix)drawingCtx.setTransform(transformMatrix.sx,transformMatrix.shy,transformMatrix.shx,transformMatrix.sy,transformMatrix.tx,transformMatrix.ty);if(clipUse)ctx.RemoveClipRect()}else{ctx.AddClipRect(x1, y1,w,h);if(this._getCellCF(aRules,c,row,col,Asc.ECfType.iconSet)&&AscCommon.align_Left===ct.cellHA)textX+=getCFIconSize(font.getSize());this.stringRender.restoreInternalState(ct.state).render(drawingCtx,textX,textY,textW,color);ctx.RemoveClipRect()}return null};WorksheetView.prototype._drawPageBreakPreviewLines=function(drawingCtx,range,leftFieldInPx,topFieldInPx,width,height,printPages){if(!pageBreakPreviewMode)return;if(range===undefined)range=this.visibleRange;var ctx=drawingCtx||this.drawingCtx; var offsetX=undefined!==leftFieldInPx?leftFieldInPx:this._getColLeft(this.visibleRange.c1)-this.cellsLeft;var offsetY=undefined!==topFieldInPx?topFieldInPx:this._getRowTop(this.visibleRange.r1)-this.cellsTop;var frozenX=0,frozenY=0,cFrozen,rFrozen;if(!drawingCtx&&this.topLeftFrozenCell){if(undefined===leftFieldInPx){cFrozen=this.topLeftFrozenCell.getCol0();offsetX-=frozenX=this._getColLeft(cFrozen)-this._getColLeft(0)}if(undefined===topFieldInPx){rFrozen=this.topLeftFrozenCell.getRow0();offsetY-= frozenY=this._getRowTop(rFrozen)-this._getRowTop(0)}}var i,d,d1;var x1,x2,y1,y2;var pageBreakPreview=true;if(pageBreakPreview){var startRange=printPages[0]?printPages[0].page.pageRange:null;var endRange=printPages[0]?printPages[printPages.length-1].page.pageRange:null;var unionRange=startRange?new Asc.Range(startRange.c1,startRange.r1,endRange.c2,endRange.r2):null;var fillRanges=[];var intersection=unionRange?range.intersection(unionRange):null;ctx.setFillStyle(this.settings.cells.defaultState.border); if(intersection)fillRanges=intersection.difference(range);else fillRanges.push(range);if(fillRanges){ctx.setFillStyle(this.settings.cells.defaultState.border);for(i=0;i<fillRanges.length;i++){x1=Math.max(this._getColLeft(fillRanges[i].c1),this._getColLeft(range.c1));y1=Math.max(this._getRowTop(fillRanges[i].r1),this._getRowTop(range.r1));x2=Math.min(this._getColLeft(fillRanges[i].c2+1)-this.cellsLeft,this._getColLeft(range.c2+1)-this.cellsLeft);y2=Math.min(this._getRowTop(fillRanges[i].r2+1)-this.cellsTop, this._getRowTop(range.r2+1)-this.cellsTop);ctx.fillRect(x1-offsetX,y1-offsetY,x2-offsetX,y2-offsetY)}}if(printPages[0]&&intersection){x1=this._getColLeft(intersection.c1)-offsetX;y1=this._getRowTop(intersection.r1)-offsetY;x2=this._getColLeft(intersection.c2+1)-offsetX;y2=this._getRowTop(intersection.r2+1)-offsetY;ctx.setStrokeStyle(this.settings.activeCellBorderColor);ctx.setLineWidth(3).beginPath();var pageRange;var pageIntersection;for(i=0,d=0,d1=0;i<printPages.length;++i){pageRange=printPages[i].page.pageRange; pageIntersection=pageRange.intersection(range);if(!pageIntersection)if(pageRange.r1>range.r2&&pageRange.c1>range.c2)break;else continue;d=this._getColLeft(pageRange.c2+1)-offsetX;d1=this._getRowTop(pageRange.r2+1)-offsetY;if(d>x1&&d1>0)ctx.lineVerPrevPx(d,y1-frozenY,y2);if(d1>y1&&d>0)ctx.lineHorPrevPx(x1-frozenX,d1,x2)}ctx.stroke()}}};WorksheetView.prototype._drawPageBreakPreviewLinesOverlay=function(){if(!pageBreakPreviewModeOverlay)return;var t=this;var printPagesObj=this._getVisiblePrintPages(); var printPages=printPagesObj.printPages;var printRanges=printPagesObj.printRanges;var drawCurArea=function(visibleRange,offsetX,offsetY,args){var range=args[0];var ctx=t.overlayCtx;var oIntersection=range.intersectionSimple(visibleRange);if(!oIntersection)return true;var x1=t._getColLeft(oIntersection.c1)-offsetX;var x2=t._getColLeft(oIntersection.c2+1)-offsetX;var y1=t._getRowTop(oIntersection.r1)-offsetY;var y2=t._getRowTop(oIntersection.r2+1)-offsetY;var fillColor=t.settings.cells.defaultState.border.Copy(); ctx.setFillStyle(fillColor).fillRect(x1,y1,x2-x1,y2-y1)};if(printPages&&printPages.length){if(printRanges&&printRanges.length){var rangesBackground;for(var i=0;i<printRanges.length;i++){if(i===0){rangesBackground=printRanges[i].difference(this.visibleRange);continue}var curRanges=[];for(var j=0;j<rangesBackground.length;j++)Array.prototype.push.apply(curRanges,printRanges[i].difference(rangesBackground[j]));rangesBackground=curRanges}if(rangesBackground)for(var i=0;i<rangesBackground.length;i++)this._drawElements(drawCurArea, rangesBackground[i])}else{var startRange=printPages[0].page.pageRange;var endRange=printPages[printPages.length-1].page.pageRange;var allPagesRange=new Asc.Range(startRange.c1,startRange.r1,endRange.c2,endRange.r2);var difference=allPagesRange.difference(this.visibleRange);if(difference&&difference.length)for(var i=0;i<difference.length;i++)this._drawElements(drawCurArea,difference[i])}for(var i=0,l=printPages.length;i<l;++i)this._drawElements(this._drawSelectionElement,printPages[i].page.pageRange, AscCommonExcel.selectionLineType.Dash,this.settings.activeCellBorderColor);if(printRanges&&printRanges.length)for(var i=0,l=printRanges.length;i<l;++i)this._drawElements(this._drawSelectionElement,printRanges[i],AscCommonExcel.selectionLineType.Select,this.settings.activeCellBorderColor);else this._drawElements(this._drawSelectionElement,allPagesRange,AscCommonExcel.selectionLineType.Select,this.settings.activeCellBorderColor)}else this._drawElements(drawCurArea,this.visibleRange)};WorksheetView.prototype._drawPrintArea= function(){var printOptions=this.model.PagePrintOptions;var printArea=this.model.workbook.getDefinesNames("Print_Area",this.model.getId());var printPages=[];if(printArea)this.calcPagesPrint(printOptions,null,null,printPages,null,null,true);else{var range=new asc_Range(0,0,this.visibleRange.c2,this.visibleRange.r2);this._calcPagesPrint(range,printOptions,null,printPages,null,null,true)}var pageSetupModel=printOptions.asc_getPageSetup();var fitToWidth=pageSetupModel.asc_getFitToWidth();var fitToHeight= pageSetupModel.asc_getFitToHeight();var drawProp;if(fitToWidth>=1&&fitToHeight>=1)return;else if(fitToWidth>=1)drawProp=1;else if(fitToHeight>=1)drawProp=2;for(var i=0,l=printPages.length;i<l;++i)this._drawElements(this._drawSelectionElement,printPages[i].pageRange,AscCommonExcel.selectionLineType.Dash,new CColor(0,0,0),undefined,drawProp)};WorksheetView.prototype._drawCutRange=function(){if(this.cutRange)this._drawElements(this._drawSelectionElement,this.cutRange,AscCommonExcel.selectionLineType.DashThick, this.settings.activeCellBorderColor)};WorksheetView.prototype._drawPageBreakPreviewText=function(drawingCtx,range,leftFieldInPx,topFieldInPx,width,height,printPages){if(!pageBreakPreviewMode)return;if(range===undefined)range=this.visibleRange;var t=this;var ctx=drawingCtx||this.drawingCtx;var offsetX=undefined!==leftFieldInPx?leftFieldInPx:this._getColLeft(this.visibleRange.c1)-this.cellsLeft;var offsetY=undefined!==topFieldInPx?topFieldInPx:this._getRowTop(this.visibleRange.r1)-this.cellsTop;var frozenX= 0,frozenY=0,cFrozen,rFrozen;if(!drawingCtx&&this.topLeftFrozenCell){if(undefined===leftFieldInPx){cFrozen=this.topLeftFrozenCell.getCol0();offsetX-=frozenX=this._getColLeft(cFrozen)-this._getColLeft(0)}if(undefined===topFieldInPx){rFrozen=this.topLeftFrozenCell.getRow0();offsetY-=frozenY=this._getRowTop(rFrozen)-this._getRowTop(0)}}var basePageString="Page ";var getOptimalFontSize=function(width,height){var needWidth=width/3;var needHeight=height/3;var font=new AscCommonExcel.Font;var str;var i=0, j=100,k,textMetrics;while(i<=j){k=Math.floor((i+j)/2);font.fs=k;str=new AscCommonExcel.Fragment;str.text=basePageString+(index+1);str.format=font;t.stringRender.setString([str]);textMetrics=t.stringRender._measureChars();if(textMetrics.width===needWidth&&textMetrics.height===needHeight)break;else if(textMetrics.width>needWidth||textMetrics.height>needHeight)j=k-1;else i=k+1}return k};var x1,x2,y1,y2;var pageBreakPreview=true;if(pageBreakPreview){var startRange=printPages[0]?printPages[0].page.pageRange: null;var endRange=printPages[0]?printPages[printPages.length-1].page.pageRange:null;var unionRange=startRange?new Asc.Range(startRange.c1,startRange.r1,endRange.c2,endRange.r2):null;var intersection=unionRange?range.intersection(unionRange):null;if(printPages[0]&&intersection){x1=this._getColLeft(range.c1)-offsetX;y1=this._getRowTop(range.r1)-offsetY;x2=this._getColLeft(range.c2+1)-offsetX;y2=this._getRowTop(range.r2+1)-offsetY;var pageRange;var tX1,tX2,tY1,tY2,pageIntersection,index;for(var i=0;i< printPages.length;++i){pageRange=printPages[i].page.pageRange;index=printPages[i].index;pageIntersection=pageRange.intersection(range);if(!pageIntersection)if(pageRange.r1>range.r2&&pageRange.c1>range.c2)break;else continue;var widthPage=this._getColLeft(pageRange.c2+1)-this._getColLeft(pageRange.c1);var heightPage=this._getRowTop(pageRange.r2+1)-this._getRowTop(pageRange.r1);var centerX=this._getColLeft(pageRange.c1)+widthPage/2-offsetX;var centerY=this._getRowTop(pageRange.r1)+heightPage/2-offsetY; var font=new AscCommonExcel.Font;font.fs=getOptimalFontSize(widthPage,heightPage);var str=new AscCommonExcel.Fragment;str.text=basePageString+(index+1);str.format=font;this.stringRender.setString([str]);var textMetrics=this.stringRender._measureChars();tX1=centerX-textMetrics.width/2;tX2=centerX+textMetrics.width/2;tY1=centerY-textMetrics.height/2;tY2=centerY+textMetrics.height/2;if(!(tX1>x2||tX2<x1||tY1>y2||tY2<y1)){ctx.AddClipRect(x1,y1,x2-x1,y2-y1);this.stringRender.render(undefined,tX1,tY1,100, this.settings.activeCellBorderColor);ctx.RemoveClipRect()}}}}};WorksheetView.prototype._getVisiblePrintPages=function(range){var printOptions=this.model.PagePrintOptions;var printPages=[];var printRanges=[];this.calcPagesPrint(printOptions,null,null,printPages,printRanges);var res=[];if(range===undefined)range=this.visibleRange;for(var i=0;i<printPages.length;++i)if(printPages[i].pageRange.intersection(range))res.push({index:i,page:printPages[i]});var visiblePrintRanges=[];for(var i=0;i<printRanges.length;++i)if(printRanges[i].intersection(range))visiblePrintRanges.push(printRanges[i]); return{printPages:res,printRanges:visiblePrintRanges}};WorksheetView.prototype._eraseCellRightBorder=function(drawingCtx,colBeg,colEnd,row,offsetX,offsetY){if(colBeg>=colEnd)return;var nextCell=-1;var ctx=drawingCtx||this.drawingCtx;ctx.setFillStyle(this.settings.cells.defaultState.background);for(var col=colBeg;col<colEnd;++col){var c=-1!==nextCell?nextCell:this._getCell(col,row);var bg=null!==c?c.getFillColor():null;if(bg!==null)continue;nextCell=this._getCell(col+1,row);bg=null!==nextCell?nextCell.getFillColor(): null;if(bg!==null)continue;ctx.fillRect(this._getColLeft(col+1)-offsetX-gridlineSize,this._getRowTop(row)-offsetY,gridlineSize,this._getRowHeight(row)-gridlineSize)}};WorksheetView.prototype._drawCellsBorders=function(drawingCtx,range,offsetX,offsetY,mergedCells){var t=this;var ctx=drawingCtx||this.drawingCtx;var objectMergedCells={};var h,w,i,mergeCellInfo,startCol,endRow,endCol,col,row;for(i in mergedCells){mergeCellInfo=mergedCells[i];startCol=Math.max(range.c1,mergeCellInfo.c1);endRow=Math.min(mergeCellInfo.r2, range.r2,this.nRowsCount);endCol=Math.min(mergeCellInfo.c2,range.c2,this.nColsCount);for(row=Math.max(range.r1,mergeCellInfo.r1);row<=endRow;++row){if(!objectMergedCells.hasOwnProperty(row))objectMergedCells[row]={};for(col=startCol;col<=endCol;++col)objectMergedCells[row][col]=mergeCellInfo}}var bc=null,bs=c_oAscBorderStyles.None,isNotFirst=false;function drawBorder(type,border,x1,y1,x2,y2){var isStroke=false,isNewColor=!AscCommonExcel.g_oColorManager.isEqual(bc,border.c),isNewStyle=bs!==border.s; if(isNotFirst&&(isNewColor||isNewStyle)){ctx.stroke();isStroke=true}if(isNewColor){bc=border.c;ctx.setStrokeStyle(bc)}if(isNewStyle){bs=border.s;ctx.setLineWidth(border.w);ctx.setLineDash(border.getDashSegments())}if(isStroke||false===isNotFirst){isNotFirst=true;ctx.beginPath()}switch(type){case c_oAscBorderType.Hor:ctx.lineHor(x1,y1,x2);break;case c_oAscBorderType.Ver:ctx.lineVer(x1,y1,y2);break;case c_oAscBorderType.Diag:ctx.lineDiag(x1,y1,x2,y2);break}}function drawVerticalBorder(borderLeftObject, borderRightObject,x,y1,y2){var borderLeft=borderLeftObject?borderLeftObject.borders:null,borderRight=borderRightObject?borderRightObject.borders:null;var border=AscCommonExcel.getMatchingBorder(borderLeft&&borderLeft.r,borderRight&&borderRight.l);if(!border||border.w<1)return;var tbw=t._calcMaxBorderWidth(borderLeftObject&&borderLeftObject.getTopBorder(),borderRightObject&&borderRightObject.getTopBorder());var bbw=t._calcMaxBorderWidth(borderLeftObject&&borderLeftObject.getBottomBorder(),borderRightObject&& borderRightObject.getBottomBorder());var dy1=tbw>border.w?tbw-1:tbw>1?-1:0;var dy2=bbw>border.w?-2:bbw>2?1:0;drawBorder(c_oAscBorderType.Ver,border,x,y1+(-1+dy1),x,y2+(1+dy2))}function drawHorizontalBorder(borderTopObject,borderBottomObject,x1,y,x2){var borderTop=borderTopObject?borderTopObject.borders:null,borderBottom=borderBottomObject?borderBottomObject.borders:null;var border=AscCommonExcel.getMatchingBorder(borderTop&&borderTop.b,borderBottom&&borderBottom.t);if(border&&border.w>0){var lbw= t._calcMaxBorderWidth(borderTopObject&&borderTopObject.getLeftBorder(),borderBottomObject&&borderBottomObject.getLeftBorder());var rbw=t._calcMaxBorderWidth(borderTopObject&&borderTopObject.getRightBorder(),borderTopObject&&borderTopObject.getRightBorder());var dx1=border.w>lbw?lbw>1?-1:0:lbw>2?2:1;var dx2=border.w>rbw?rbw>2?1:0:rbw>1?-2:-1;drawBorder(c_oAscBorderType.Hor,border,x1+(-1+dx1),y,x2+(1+dx2),y)}}var arrPrevRow=[],arrCurrRow=[],arrNextRow=[];var objMCPrevRow=null,objMCRow=null,objMCNextRow= null;var bCur,bPrev,bNext,bTopCur,bTopPrev,bTopNext,bBotCur,bBotPrev,bBotNext;bCur=bPrev=bNext=bTopCur=bTopNext=bBotCur=bBotNext=null;row=range.r1-1;var prevCol=range.c1-1;while(0<=prevCol&&0===this._getColumnWidth(prevCol))--prevCol;while(0<=row){if(this._getRowHeight(row)>0){objMCPrevRow=objectMergedCells[row];for(col=prevCol;col<=range.c2&&col<t.nColsCount;++col){if(0>col||this._getColumnWidth(col)<=0)continue;arrPrevRow[col]=new CellBorderObject(t._getVisibleCell(col,row).getBorder(),objMCPrevRow? objMCPrevRow[col]:null,col,row)}break}--row}var mc=null,nextRow,isFirstRow=true;var isPrevColExist=0<=prevCol;for(row=range.r1;row<=range.r2;row=nextRow){nextRow=row+1;h=this._getRowHeight(row);if(0===h)continue;for(;nextRow<=range.r2&&nextRow<t.nRowsCount;++nextRow)if(0<this._getRowHeight(nextRow))break;var isFirstRowTmp=isFirstRow,isLastRow=nextRow>range.r2||nextRow>=t.nRowsCount;isFirstRow=false;objMCRow=isFirstRowTmp?objectMergedCells[row]:objMCNextRow;objMCNextRow=objectMergedCells[nextRow]; var rowCache=t._getRowCache(row);var y1=this._getRowTop(row)-offsetY;var y2=y1+h-gridlineSize;var nextCol,isFirstCol=true;for(col=range.c1;col<=range.c2&&col<t.nColsCount;col=nextCol){nextCol=col+1;w=this._getColumnWidth(col);if(0===w)continue;for(;nextCol<=range.c2&&nextCol<t.nColsCount;++nextCol)if(0<this._getColumnWidth(nextCol))break;var isFirstColTmp=isFirstCol,isLastCol=nextCol>range.c2||nextCol>=t.nColsCount;isFirstCol=false;mc=objMCRow?objMCRow[col]:null;var x1=this._getColLeft(col)-offsetX; var x2=x1+w-gridlineSize;if(row===t.nRowsCount)bBotPrev=bBotCur=bBotNext=null;else if(isFirstColTmp){bBotPrev=arrNextRow[prevCol]=new CellBorderObject(isPrevColExist?t._getVisibleCell(prevCol,nextRow).getBorder():null,objMCNextRow?objMCNextRow[prevCol]:null,prevCol,nextRow);bBotCur=arrNextRow[col]=new CellBorderObject(t._getVisibleCell(col,nextRow).getBorder(),objMCNextRow?objMCNextRow[col]:null,col,nextRow)}else{bBotPrev=bBotCur;bBotCur=bBotNext}if(isFirstColTmp){bPrev=arrCurrRow[prevCol]=new CellBorderObject(isPrevColExist? t._getVisibleCell(prevCol,row).getBorder():null,objMCRow?objMCRow[prevCol]:null,prevCol,row);bCur=arrCurrRow[col]=new CellBorderObject(t._getVisibleCell(col,row).getBorder(),mc,col,row);bTopPrev=arrPrevRow[prevCol];bTopCur=arrPrevRow[col]}else{bPrev=bCur;bCur=bNext;bTopPrev=bTopCur;bTopCur=bTopNext}if(col===t.nColsCount){bNext=null;bTopNext=null}else{bNext=arrCurrRow[nextCol]=new CellBorderObject(t._getVisibleCell(nextCol,row).getBorder(),objMCRow?objMCRow[nextCol]:null,nextCol,row);bTopNext=arrPrevRow[nextCol]; if(row===t.nRowsCount)bBotNext=null;else bBotNext=arrNextRow[nextCol]=new CellBorderObject(t._getVisibleCell(nextCol,nextRow).getBorder(),objMCNextRow?objMCNextRow[nextCol]:null,nextCol,nextRow)}if(mc&&row!==mc.r1&&row!==mc.r2&&col!==mc.c1&&col!==mc.c2)continue;if((bCur.borders.dd||bCur.borders.du)&&(!mc||row===mc.r1&&col===mc.c1)){var x2Diagonal=x2;var y2Diagonal=y2;if(mc){x2Diagonal=this._getColLeft(mc.c2+1)-offsetX-1;y2Diagonal=this._getRowTop(mc.r2+1)-offsetY-1}if(bCur.borders.dd)drawBorder(c_oAscBorderType.Diag, bCur.borders.d,x1-1,y1-1,x2Diagonal,y2Diagonal);if(bCur.borders.du)drawBorder(c_oAscBorderType.Diag,bCur.borders.d,x1-1,y2Diagonal,x2Diagonal,y1-1)}if(isFirstColTmp&&!t._isLeftBorderErased(col,rowCache))drawVerticalBorder(bPrev,bCur,x1-gridlineSize,y1,y2);if((!mc||col===mc.c2)&&!t._isRightBorderErased(col,rowCache))drawVerticalBorder(bCur,bNext,x2,y1,y2);if(isFirstRowTmp)drawHorizontalBorder(bTopCur,bCur,x1,y1-gridlineSize,x2);if(!mc||row===mc.r2)drawHorizontalBorder(bCur,bBotCur,x1,y2,x2)}arrPrevRow= arrCurrRow;arrCurrRow=arrNextRow;arrNextRow=[]}if(isNotFirst)ctx.stroke()};WorksheetView.prototype._drawFrozenPane=function(noCells){if(this.topLeftFrozenCell){var row=this.topLeftFrozenCell.getRow0();var col=this.topLeftFrozenCell.getCol0();var tmpRange,offsetX,offsetY;if(0<row&&0<col){offsetX=this._getColLeft(0)-this.cellsLeft;offsetY=this._getRowTop(0)-this.cellsTop;tmpRange=new asc_Range(0,0,col-1,row-1);if(!noCells){this._drawGrid(null,tmpRange,offsetX,offsetY);this._drawGroupData(null,tmpRange, offsetX,offsetY);this._drawGroupData(null,tmpRange,offsetX,undefined,true);this._drawCellsAndBorders(null,tmpRange,offsetX,offsetY)}}if(0<row){row-=1;offsetX=undefined;offsetY=this._getRowTop(0)-this.cellsTop;tmpRange=new asc_Range(this.visibleRange.c1,0,this.visibleRange.c2,row);this._drawRowHeaders(null,0,row,kHeaderDefault,offsetX,offsetY);if(!noCells){this._drawGrid(null,tmpRange,offsetX,offsetY);this._drawGroupData(null,tmpRange,offsetX,offsetY);this._drawGroupData(null,tmpRange,offsetX,offsetY, true);this._drawCellsAndBorders(null,tmpRange,offsetX,offsetY)}}if(0<col){col-=1;offsetX=this._getColLeft(0)-this.cellsLeft;offsetY=undefined;tmpRange=new asc_Range(0,this.visibleRange.r1,col,this.visibleRange.r2);this._drawColumnHeaders(null,0,col,kHeaderDefault,offsetX,offsetY);if(!noCells){this._drawGrid(null,tmpRange,offsetX,offsetY);this._drawGroupData(null,tmpRange,offsetX,offsetY);this._drawGroupData(null,tmpRange,offsetX,offsetY,true);this._drawCellsAndBorders(null,tmpRange,offsetX,offsetY)}}}}; WorksheetView.prototype._drawFrozenPaneLines=function(drawingCtx){var ctx=drawingCtx||this.drawingCtx;var lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,this.model.getId(),AscCommonExcel.c_oAscLockNameFrozenPane);var isLocked=this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,false);var color=isLocked?AscCommonExcel.c_oAscCoAuthoringOtherBorderColor:this.settings.frozenColor;ctx.setLineWidth(1).setStrokeStyle(color).beginPath();var fHorLine, fVerLine;if(isLocked){fHorLine=ctx.dashLineCleverHor;fVerLine=ctx.dashLineCleverVer}else{fHorLine=ctx.lineHorPrevPx;fVerLine=ctx.lineVerPrevPx}if(this.topLeftFrozenCell){var row=this.topLeftFrozenCell.getRow0();var col=this.topLeftFrozenCell.getCol0();if(0<row)fHorLine.apply(ctx,[0,this._getRowTop(row),ctx.getWidth()]);else fHorLine.apply(ctx,[this.headersLeft,this.headersTop+this.headersHeight,this.headersLeft+this.headersWidth]);if(0<col)fVerLine.apply(ctx,[this._getColLeft(col),0,ctx.getHeight()]); else fVerLine.apply(ctx,[this.headersLeft+this.headersWidth,this.headersTop,this.headersTop+this.headersHeight]);ctx.stroke()}else if(this.model.getSheetView().asc_getShowRowColHeaders()){fHorLine.apply(ctx,[this.headersLeft,this.headersTop+this.headersHeight,this.headersLeft+this.headersWidth]);fVerLine.apply(ctx,[this.headersWidth+this.headersLeft,this.headersTop,this.headersTop+this.headersHeight]);ctx.stroke()}};WorksheetView.prototype.drawFrozenGuides=function(x,y,target){var data,offsetFrozen; var ctx=this.overlayCtx;ctx.clear();this._drawSelection();switch(target){case c_oTargetType.FrozenAnchorV:data=this._findColUnderCursor(x,true,true);if(data){data.col+=1;if(0<=data.col&&data.col<this.nColsCount){var h=ctx.getHeight();var offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft;offsetFrozen=this.getFrozenPaneOffset(false,true);offsetX-=offsetFrozen.offsetX;ctx.setFillPattern(this.settings.ptrnLineDotted1).fillRect(this._getColLeft(data.col)-offsetX-gridlineSize,0,1,h)}}break; case c_oTargetType.FrozenAnchorH:data=this._findRowUnderCursor(y,true,true);if(data){data.row+=1;if(0<=data.row&&data.row<this.nRowsCount){var w=ctx.getWidth();var offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop;offsetFrozen=this.getFrozenPaneOffset(true,false);offsetY-=offsetFrozen.offsetY;ctx.setFillPattern(this.settings.ptrnLineDotted1).fillRect(0,this._getRowTop(data.row)-offsetY-1,w,1)}}break}};WorksheetView.prototype._isFrozenAnchor=function(x,y){var result={result:false,cursor:"move", name:""};if(false===this.model.getSheetView().asc_getShowRowColHeaders())return result;var _this=this;var frozenCell=this.topLeftFrozenCell?this.topLeftFrozenCell:new AscCommon.CellAddress(0,0,0);function isPointInAnchor(x,y,rectX,rectY,rectW,rectH){var delta=2;return x>=rectX-delta&&x<=rectX+rectW+delta&&y>=rectY-delta&&y<=rectY+rectH+delta}var _x=this._getColLeft(frozenCell.getCol0())-.5;var _y=_this.headersTop;var w=0;var h=_this.headersHeight;if(isPointInAnchor(x,y,_x,_y,w,h)){result.result=true; result.name=c_oTargetType.FrozenAnchorV}_x=_this.headersLeft;_y=this._getRowTop(frozenCell.getRow0())-.5;w=_this.headersWidth-.5;h=0;if(isPointInAnchor(x,y,_x,_y,w,h)){result.result=true;result.name=c_oTargetType.FrozenAnchorH}return result};WorksheetView.prototype.applyFrozenAnchor=function(x,y,target){var t=this;var onChangeFrozenCallback=function(isSuccess){if(false===isSuccess){t.overlayCtx.clear();t._drawSelection();return}var lastCol=0,lastRow=0,data;if(t.topLeftFrozenCell){lastCol=t.topLeftFrozenCell.getCol0(); lastRow=t.topLeftFrozenCell.getRow0()}switch(target){case c_oTargetType.FrozenAnchorV:data=t._findColUnderCursor(x,true,true);if(data){data.col+=1;if(0<=data.col&&data.col<t.nColsCount)lastCol=data.col}break;case c_oTargetType.FrozenAnchorH:data=t._findRowUnderCursor(y,true,true);if(data){data.row+=1;if(0<=data.row&&data.row<t.nRowsCount)lastRow=data.row}break}t._updateFreezePane(lastCol,lastRow)};this._isLockedFrozenPane(onChangeFrozenCallback)};WorksheetView.prototype.freezePane=function(){var t= this;var activeCell=this.model.selectionRange.activeCell.clone();var onChangeFreezePane=function(isSuccess){if(false===isSuccess)return;var col,row,mc;if(null!==t.topLeftFrozenCell)col=row=0;else{col=activeCell.col;row=activeCell.row;if(0!==row||0!==col){mc=t.model.getMergedByCell(row,col);if(mc){col=mc.c1;row=mc.r1}}if(0===col&&0===row){col=(t.visibleRange.c2-t.visibleRange.c1)/2>>0;row=(t.visibleRange.r2-t.visibleRange.r1)/2>>0}}t._updateFreezePane(col,row)};return this._isLockedFrozenPane(onChangeFreezePane)}; WorksheetView.prototype._updateFreezePane=function(col,row,lockDraw){if(window["IS_NATIVE_EDITOR"])return;var lastCol=0,lastRow=0;if(this.topLeftFrozenCell){lastCol=this.topLeftFrozenCell.getCol0();lastRow=this.topLeftFrozenCell.getRow0()}History.Create_NewPoint();var oData=new AscCommonExcel.UndoRedoData_FromTo(new AscCommonExcel.UndoRedoData_BBox(new asc_Range(lastCol,lastRow,lastCol,lastRow)),new AscCommonExcel.UndoRedoData_BBox(new asc_Range(col,row,col,row)),null);History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_ChangeFrozenCell,this.model.getId(),null,oData);var isUpdate=false;if(0===col&&0===row){if(null!==this.topLeftFrozenCell)isUpdate=true;this.topLeftFrozenCell=this.model.getSheetView().pane=null}else{if(null===this.topLeftFrozenCell)isUpdate=true;var pane=this.model.getSheetView().pane=new AscCommonExcel.asc_CPane;this.topLeftFrozenCell=pane.topLeftFrozenCell=new AscCommon.CellAddress(row,col,0)}this.visibleRange.c1=col;this.visibleRange.r1=row;this._updateVisibleRowsCount(true); this._updateVisibleColsCount(true);this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollVertical|AscCommonExcel.c_oAscScrollType.ScrollHorizontal;if(this.objectRender&&this.objectRender.drawingArea)this.objectRender.drawingArea.init();if(!lockDraw)this.draw();if(isUpdate&&!this.model.workbook.bUndoChanges&&!this.model.workbook.bRedoChanges)this.handlers.trigger("updateSheetViewSettings")};WorksheetView.prototype._drawSelectionElement=function(visibleRange,offsetX,offsetY,args){var range=args[0]; var selectionLineType=args[1];var strokeColor=args[2];var isAllRange=args[3];var colorN=this.settings.activeCellBorderColor2;var ctx=this.overlayCtx;var oIntersection=range.intersectionSimple(visibleRange);if(!oIntersection)return true;var fHorLine,fVerLine;var canFill=AscCommonExcel.selectionLineType.Selection&selectionLineType;var isDashLine=AscCommonExcel.selectionLineType.Dash&selectionLineType;var dashThickLine=AscCommonExcel.selectionLineType.DashThick&selectionLineType;if(isDashLine||dashThickLine){fHorLine= ctx.dashLineCleverHor;fVerLine=ctx.dashLineCleverVer}else{fHorLine=ctx.lineHorPrevPx;fVerLine=ctx.lineVerPrevPx}var firstCol=oIntersection.c1===visibleRange.c1&&!isAllRange;var firstRow=oIntersection.r1===visibleRange.r1&&!isAllRange;var drawLeftSide=oIntersection.c1===range.c1;var drawRightSide=oIntersection.c2===range.c2;var drawTopSide=oIntersection.r1===range.r1;var drawBottomSide=oIntersection.r2===range.r2;if(args[4])if(args[4]===1){drawLeftSide=false;drawRightSide=false}else if(args[4]===2){drawTopSide= false;drawBottomSide=false}var x1=this._getColLeft(oIntersection.c1)-offsetX;var x2=this._getColLeft(oIntersection.c2+1)-offsetX;var y1=this._getRowTop(oIntersection.r1)-offsetY;var y2=this._getRowTop(oIntersection.r2+1)-offsetY;if(canFill){var fillColor=strokeColor.Copy();fillColor.a=.15;ctx.setFillStyle(fillColor).fillRect(x1,y1,x2-x1,y2-y1)}ctx.setLineWidth(isDashLine?1:2).setStrokeStyle(strokeColor);ctx.beginPath();if(drawTopSide&&!firstRow)fHorLine.apply(ctx,[x1-!isDashLine*2,y1,x2+!isDashLine* 1]);if(drawBottomSide)fHorLine.apply(ctx,[x1,y2+!isDashLine*1,x2]);if(drawLeftSide&&!firstCol)fVerLine.apply(ctx,[x1,y1,y2+!isDashLine*1]);if(drawRightSide)fVerLine.apply(ctx,[x2+!isDashLine*1,y1,y2+!isDashLine*1]);ctx.closePath().stroke();var isActive=AscCommonExcel.selectionLineType.ActiveCell&selectionLineType;if(isActive){var cell=this.model.getSelection().activeCell;var fs=this.model.getMergedByCell(cell.row,cell.col);fs=oIntersection.intersectionSimple(fs||new asc_Range(cell.col,cell.row,cell.col, cell.row));if(fs){var top=this._getRowTop(fs.r1);var left=this._getColLeft(fs.c1);var _x1=left-offsetX+1;var _y1=top-offsetY+1;var _w=this._getColLeft(fs.c2+1)-left-2;var _h=this._getRowTop(fs.r2+1)-top-2;if(0<_w&&0<_h)ctx.clearRect(_x1,_y1,_w,_h)}}if(canFill){ctx.setLineWidth(1);ctx.setStrokeStyle(colorN);ctx.beginPath();if(drawTopSide)fHorLine.apply(ctx,[x1,y1+1,x2-1]);if(drawBottomSide)fHorLine.apply(ctx,[x1,y2-1,x2-1]);if(drawLeftSide)fVerLine.apply(ctx,[x1+1,y1,y2-2]);if(drawRightSide)fVerLine.apply(ctx, [x2-1,y1,y2-2]);ctx.closePath().stroke()}var isResize=AscCommonExcel.selectionLineType.Resize&selectionLineType;var isPromote=AscCommonExcel.selectionLineType.Promote&selectionLineType;if(isResize||isPromote){ctx.setFillStyle(colorN);if(drawRightSide&&drawBottomSide)ctx.fillRect(x2-4,y2-4,7,7);ctx.setFillStyle(strokeColor);if(drawRightSide&&drawBottomSide)ctx.fillRect(x2-3,y2-3,5,5);if(isResize){ctx.setFillStyle(colorN);if(drawLeftSide&&drawTopSide)ctx.fillRect(x1-4,y1-4,7,7);if(drawRightSide&&drawTopSide)ctx.fillRect(x2- 4,y1-4,7,7);if(drawLeftSide&&drawBottomSide)ctx.fillRect(x1-4,y2-4,7,7);ctx.setFillStyle(strokeColor);if(drawLeftSide&&drawTopSide)ctx.fillRect(x1-3,y1-3,5,5);if(drawRightSide&&drawTopSide)ctx.fillRect(x2-3,y1-3,5,5);if(drawLeftSide&&drawBottomSide)ctx.fillRect(x1-3,y2-3,5,5)}}return true};WorksheetView.prototype._drawElements=function(drawFunction){var cFrozen=0,rFrozen=0,args=Array.prototype.slice.call(arguments,1),offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft,offsetY=this._getRowTop(this.visibleRange.r1)- this.cellsTop,res;if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0();rFrozen=this.topLeftFrozenCell.getRow0();offsetX-=this._getColLeft(cFrozen)-this._getColLeft(0);offsetY-=this._getRowTop(rFrozen)-this._getRowTop(0);var oFrozenRange;cFrozen-=1;rFrozen-=1;if(0<=cFrozen&&0<=rFrozen){oFrozenRange=new asc_Range(0,0,cFrozen,rFrozen);res=drawFunction.call(this,oFrozenRange,this._getColLeft(0)-this.cellsLeft,this._getRowTop(0)-this.cellsTop,args);if(!res)return}if(0<=cFrozen){oFrozenRange= new asc_Range(0,this.visibleRange.r1,cFrozen,this.visibleRange.r2);res=drawFunction.call(this,oFrozenRange,this._getColLeft(0)-this.cellsLeft,offsetY,args);if(!res)return}if(0<=rFrozen){oFrozenRange=new asc_Range(this.visibleRange.c1,0,this.visibleRange.c2,rFrozen);res=drawFunction.call(this,oFrozenRange,offsetX,this._getRowTop(0)-this.cellsTop,args);if(!res)return}}drawFunction.call(this,this.visibleRange,offsetX,offsetY,args)};WorksheetView.prototype._drawSelection=function(){var isShapeSelect= false;if(window["IS_NATIVE_EDITOR"])return;var selectionDialogMode=this.getSelectionDialogMode();var dialogOtherRanges=this.getDialogOtherRanges();this.handlers.trigger("checkLastWork");var ctx=this.overlayCtx;ctx.save().beginPath().rect(this.cellsLeft,this.cellsTop,ctx.getWidth()-this.cellsLeft,ctx.getHeight()-this.cellsTop).clip();if(this.viewPrintLines)this._drawPrintArea();this._drawCutRange();if(pageBreakPreviewModeOverlay)this._drawPageBreakPreviewLinesOverlay();if(dialogOtherRanges)this._drawCollaborativeElements(); var isOtherSelectionMode=selectionDialogMode&&!this.handlers.trigger("isActive");if(isOtherSelectionMode)this._drawSelectRange();else{isShapeSelect=asc["editor"].isStartAddShape||this.objectRender.selectedGraphicObjectsExists();if(isShapeSelect){if(this.isChartAreaEditMode)this._drawFormulaRanges(this.oOtherRanges)}else{if(dialogOtherRanges)this._drawFormulaRanges(this.oOtherRanges);this._drawSelectionRange();if(this.activeFillHandle)this._drawElements(this._drawSelectionElement,this.activeFillHandle.clone(true), AscCommonExcel.selectionLineType.None,this.settings.activeCellBorderColor);if(selectionDialogMode)this._drawSelectRange();if(this.workbook.isDrawFormatPainter())this._drawFormatPainterRange();if(null!==this.activeMoveRange)this._drawElements(this._drawSelectionElement,this.activeMoveRange,AscCommonExcel.selectionLineType.None,new CColor(0,0,0));this._drawElements(this.drawOverlayButtons)}}ctx.restore();if(!isOtherSelectionMode&&!isShapeSelect)this._drawActiveHeaders()};WorksheetView.prototype._drawSelectionRange= function(){var type,selection=this.model.getSelection(),ranges=selection.ranges;var range,selectionLineType;for(var i=0,l=ranges.length;i<l;++i){range=ranges[i].clone();type=range.getType();if(c_oAscSelectionType.RangeMax===type){range.c2=this.nColsCount-1;range.r2=this.nRowsCount-1}else if(c_oAscSelectionType.RangeCol===type)range.r2=this.nRowsCount-1;else if(c_oAscSelectionType.RangeRow===type)range.c2=this.nColsCount-1;selectionLineType=AscCommonExcel.selectionLineType.Selection;if(1===l)selectionLineType|= AscCommonExcel.selectionLineType.ActiveCell|AscCommonExcel.selectionLineType.Promote;else if(i===selection.activeCellId)selectionLineType|=AscCommonExcel.selectionLineType.ActiveCell;this._drawElements(this._drawSelectionElement,range,selectionLineType,this.settings.activeCellBorderColor)}this.handlers.trigger("drawMobileSelection",this.workbook.mainOverlay,this.settings.activeCellBorderColor)};WorksheetView.prototype._drawFormatPainterRange=function(){var t=this,color=new CColor(0,0,0);this.workbook.formatPainterRange.ranges.forEach(function(item){t._drawElements(t._drawSelectionElement, item,AscCommonExcel.selectionLineType.Dash,color)})};WorksheetView.prototype._drawFormulaRanges=function(ranges){if(!ranges)return;ranges=ranges.ranges;var length=AscCommonExcel.c_oAscFormulaRangeBorderColor.length;var strokeColor,colorIndex,uniqueColorIndex=0,tmpColors=[];for(var i=0,l=ranges.length;i<l;++i){if(ranges[i].noColor)colorIndex=0;else if(ranges[i].chartRangeIndex!==undefined)colorIndex=ranges[i].chartRangeIndex;else{colorIndex=asc.getUniqueRangeColor(ranges,i,tmpColors);if(null==colorIndex)colorIndex= uniqueColorIndex++;tmpColors.push(colorIndex)}strokeColor=AscCommonExcel.c_oAscFormulaRangeBorderColor[colorIndex%length];this._drawElements(this._drawSelectionElement,ranges[i],AscCommonExcel.selectionLineType.Selection|(ranges[i].isName?AscCommonExcel.selectionLineType.None:AscCommonExcel.selectionLineType.Resize),strokeColor)}};WorksheetView.prototype._drawSelectRange=function(){if(!this.model.selectionRange)return;var ranges=this.model.selectionRange.ranges;for(var i=0,l=ranges.length;i<l;++i)this._drawElements(this._drawSelectionElement, ranges[i],AscCommonExcel.selectionLineType.Dash,AscCommonExcel.c_oAscCoAuthoringOtherBorderColor)};WorksheetView.prototype._drawCollaborativeElements=function(){if(this.collaborativeEditing.getCollaborativeEditing()){this._drawCollaborativeElementsMeOther(c_oAscLockTypes.kLockTypeMine);this._drawCollaborativeElementsMeOther(c_oAscLockTypes.kLockTypeOther);this._drawCollaborativeElementsAllLock()}};WorksheetView.prototype._drawCollaborativeElementsAllLock=function(){var currentSheetId=this.model.getId(); var nLockAllType=this.collaborativeEditing.isLockAllOther(currentSheetId);if(Asc.c_oAscMouseMoveLockedObjectType.None!==nLockAllType){var isAllRange=true,strokeColor=Asc.c_oAscMouseMoveLockedObjectType.TableProperties===nLockAllType?AscCommonExcel.c_oAscCoAuthoringLockTablePropertiesBorderColor:AscCommonExcel.c_oAscCoAuthoringOtherBorderColor,oAllRange=new asc_Range(0,0,gc_nMaxCol0,gc_nMaxRow0);this._drawElements(this._drawSelectionElement,oAllRange,AscCommonExcel.selectionLineType.Dash,strokeColor, isAllRange)}};WorksheetView.prototype._drawCollaborativeElementsMeOther=function(type){var currentSheetId=this.model.getId(),i,strokeColor,arrayCells,oCellTmp;if(c_oAscLockTypes.kLockTypeMine===type){strokeColor=AscCommonExcel.c_oAscCoAuthoringMeBorderColor;arrayCells=this.collaborativeEditing.getLockCellsMe(currentSheetId);arrayCells=arrayCells.concat(this.collaborativeEditing.getArrayInsertColumnsBySheetId(currentSheetId));arrayCells=arrayCells.concat(this.collaborativeEditing.getArrayInsertRowsBySheetId(currentSheetId))}else{strokeColor= AscCommonExcel.c_oAscCoAuthoringOtherBorderColor;arrayCells=this.collaborativeEditing.getLockCellsOther(currentSheetId)}for(i=0;i<arrayCells.length;++i){oCellTmp=new asc_Range(arrayCells[i].c1,arrayCells[i].r1,arrayCells[i].c2,arrayCells[i].r2);this._drawElements(this._drawSelectionElement,oCellTmp,AscCommonExcel.selectionLineType.Dash,strokeColor)}};WorksheetView.prototype.cleanSelection=function(range,isFrozen){if(window["IS_NATIVE_EDITOR"])return;isFrozen=!!isFrozen;if(range===undefined)range= this.visibleRange;var ctx=this.overlayCtx;var width=ctx.getWidth();var height=ctx.getHeight();var offsetX,offsetY,diffWidth=0,diffHeight=0;var x1=Number.MAX_VALUE;var x2=-Number.MAX_VALUE;var y1=Number.MAX_VALUE;var y2=-Number.MAX_VALUE;var _x1,_x2,_y1,_y2;var i;if(this.topLeftFrozenCell){var cFrozen=this.topLeftFrozenCell.getCol0();var rFrozen=this.topLeftFrozenCell.getRow0();diffWidth=this._getColLeft(cFrozen)-this._getColLeft(0);diffHeight=this._getRowTop(rFrozen)-this._getRowTop(0);if(!isFrozen){var oFrozenRange; cFrozen-=1;rFrozen-=1;if(0<=cFrozen&&0<=rFrozen){oFrozenRange=new asc_Range(0,0,cFrozen,rFrozen);this.cleanSelection(oFrozenRange,true)}if(0<=cFrozen){oFrozenRange=new asc_Range(0,this.visibleRange.r1,cFrozen,this.visibleRange.r2);this.cleanSelection(oFrozenRange,true)}if(0<=rFrozen){oFrozenRange=new asc_Range(this.visibleRange.c1,0,this.visibleRange.c2,rFrozen);this.cleanSelection(oFrozenRange,true)}}}if(isFrozen){if(range.c1!==this.visibleRange.c1)diffWidth=0;if(range.r1!==this.visibleRange.r1)diffHeight= 0;offsetX=this._getColLeft(range.c1)-this.cellsLeft-diffWidth;offsetY=this._getRowTop(range.r1)-this.cellsTop-diffHeight}else{offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft-diffWidth;offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop-diffHeight}this._activateOverlayCtx();var t=this;var selectionRange=this.model.getSelection();selectionRange.ranges.forEach(function(item,index){var arnIntersection=item.intersectionSimple(range);if(arnIntersection){_x1=t._getColLeft(arnIntersection.c1)- offsetX-2;_x2=t._getColLeft(arnIntersection.c2+1)-offsetX+1+2;_y1=t._getRowTop(arnIntersection.r1)-offsetY-2;_y2=t._getRowTop(arnIntersection.r2+1)-offsetY+1+2;x1=Math.min(x1,_x1);x2=Math.max(x2,_x2);y1=Math.min(y1,_y1);y2=Math.max(y2,_y2);if(index===selectionRange.activeCellId){var size=t.getButtonSize(selectionRange.activeCell.row,selectionRange.activeCell.col,true);x2+=size.w;y2+=size.h}}if(!isFrozen){t._cleanColumnHeaders(item.c1,item.c2);t._cleanRowHeaders(item.r1,item.r2)}});this._deactivateOverlayCtx(); if(this.activeFillHandle!==null){var activeFillClone=this.activeFillHandle.clone(true);_x1=this._getColLeft(activeFillClone.c1)-offsetX-2;_x2=this._getColLeft(activeFillClone.c2+1)-offsetX+1+2;_y1=this._getRowTop(activeFillClone.r1)-offsetY-2;_y2=this._getRowTop(activeFillClone.r2+1)-offsetY+1+2;x1=Math.min(x1,_x1);x2=Math.max(x2,_x2);y1=Math.min(y1,_y1);y2=Math.max(y2,_y2)}if(this.collaborativeEditing.getCollaborativeEditing()){var currentSheetId=this.model.getId();var nLockAllType=this.collaborativeEditing.isLockAllOther(currentSheetId); if(Asc.c_oAscMouseMoveLockedObjectType.None!==nLockAllType)this.overlayCtx.clear();else{var arrayElementsMe=this.collaborativeEditing.getLockCellsMe(currentSheetId);var arrayElementsOther=this.collaborativeEditing.getLockCellsOther(currentSheetId);var arrayElements=arrayElementsMe.concat(arrayElementsOther);arrayElements=arrayElements.concat(this.collaborativeEditing.getArrayInsertColumnsBySheetId(currentSheetId));arrayElements=arrayElements.concat(this.collaborativeEditing.getArrayInsertRowsBySheetId(currentSheetId)); for(i=0;i<arrayElements.length;++i){var arFormulaTmp=new asc_Range(arrayElements[i].c1,arrayElements[i].r1,arrayElements[i].c2,arrayElements[i].r2);var aFormulaIntersection=arFormulaTmp.intersection(range);if(aFormulaIntersection){_x1=this._getColLeft(aFormulaIntersection.c1)-offsetX-2;_x2=this._getColLeft(aFormulaIntersection.c2+1)-offsetX+1+2;_y1=this._getRowTop(aFormulaIntersection.r1)-offsetY-2;_y2=this._getRowTop(aFormulaIntersection.r2+1)-offsetY+1+2;x1=Math.min(x1,_x1);x2=Math.max(x2,_x2); y1=Math.min(y1,_y1);y2=Math.max(y2,_y2)}}}}if(this.viewPrintLines||this.cutRange)this.overlayCtx.clear();if(pageBreakPreviewModeOverlay)this.overlayCtx.clear();if(this.oOtherRanges)this.oOtherRanges.ranges.forEach(function(item){var arnIntersection=item.intersectionSimple(range);if(arnIntersection){_x1=t._getColLeft(arnIntersection.c1)-offsetX-3;_x2=arnIntersection.c2>t.nColsCount?width:t._getColLeft(arnIntersection.c2+1)-offsetX+1+2;_y1=t._getRowTop(arnIntersection.r1)-offsetY-3;_y2=arnIntersection.r2> t.nRowsCount?height:t._getRowTop(arnIntersection.r2+1)-offsetY+1+2;x1=Math.min(x1,_x1);x2=Math.max(x2,_x2);y1=Math.min(y1,_y1);y2=Math.max(y2,_y2)}});if(null!==this.activeMoveRange){var arnIntersection=this.activeMoveRange.intersectionSimple(range);if(arnIntersection){_x1=this._getColLeft(arnIntersection.c1)-offsetX-2;_x2=this._getColLeft(arnIntersection.c2+1)-offsetX+1+2;_y1=this._getRowTop(arnIntersection.r1)-offsetY-2;_y2=this._getRowTop(arnIntersection.r2+1)-offsetY+1+2;x1=Math.min(x1,_x1);x2= Math.max(x2,_x2);y1=Math.min(y1,_y1);y2=Math.max(y2,_y2)}}if(this.model.copySelection)selectionRange=this.model.selectionRange;else if(this.workbook.isDrawFormatPainter())selectionRange=this.workbook.formatPainterRange;else selectionRange=null;if(selectionRange)selectionRange.ranges.forEach(function(item){var arnIntersection=item.intersectionSimple(range);if(arnIntersection){_x1=t._getColLeft(arnIntersection.c1)-offsetX-2;_x2=t._getColLeft(arnIntersection.c2+1)-offsetX+1+2;_y1=t._getRowTop(arnIntersection.r1)- offsetY-2;_y2=t._getRowTop(arnIntersection.r2+1)-offsetY+1+2;x1=Math.min(x1,_x1);x2=Math.max(x2,_x2);y1=Math.min(y1,_y1);y2=Math.max(y2,_y2)}});if(!(Number.MAX_VALUE===x1&&-Number.MAX_VALUE===x2&&Number.MAX_VALUE===y1&&-Number.MAX_VALUE===y2)){if(this.workbook.Api.isMobileVersion){var nRad=AscCommon.MOBILE_SELECT_TRACK_ROUND/2+.5>>0;if(AscCommon.AscBrowser.isRetina)nRad=AscCommon.AscBrowser.convertToRetinaValue(nRad,true);x1-=nRad;x2+=nRad;y1-=nRad;y2+=nRad}ctx.save().beginPath().rect(this.cellsLeft, this.cellsTop,ctx.getWidth()-this.cellsLeft,ctx.getHeight()-this.cellsTop).clip().clearRect(x1,y1,x2-x1,y2-y1).restore()}return this};WorksheetView.prototype.updateSelection=function(){this.cleanSelection();this._drawSelection()};WorksheetView.prototype.updateSelectionWithSparklines=function(){if(!this.checkSelectionSparkline())this._drawSelection()};WorksheetView.prototype.drawColumnGuides=function(col,x,y,mouseX){x+=mouseX;var ctx=this.overlayCtx;var offsetX=this._getColLeft(this.visibleRange.c1)- this.cellsLeft;var offsetFrozen=this.getFrozenPaneOffset(false,true);offsetX-=offsetFrozen.offsetX;var x1=this._getColLeft(col)-offsetX-gridlineSize;var h=ctx.getHeight();var width=Asc.round((x-x1)/this.getZoom());if(0>width)width=0;ctx.clear();this._drawSelection();ctx.setFillPattern(this.settings.ptrnLineDotted1).fillRect(x1,0,1,h).fillRect(x,0,1,h);return new asc_CMM({type:Asc.c_oAscMouseMoveType.ResizeColumn,sizeCCOrPt:this.model.colWidthToCharCount(width),sizePx:width,x:AscCommon.AscBrowser.convertToRetinaValue(x1+ this._getColumnWidth(col)),y:AscCommon.AscBrowser.convertToRetinaValue(this.cellsTop)})};WorksheetView.prototype.drawRowGuides=function(row,x,y,mouseY){y+=mouseY;var ctx=this.overlayCtx;var offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop;var offsetFrozen=this.getFrozenPaneOffset(true,false);offsetY-=offsetFrozen.offsetY;var y1=this._getRowTop(row)-offsetY-gridlineSize;var w=ctx.getWidth();var height=Asc.round((y-y1)/this.getZoom());if(0>height)height=0;ctx.clear();this._drawSelection(); ctx.setFillPattern(this.settings.ptrnLineDotted1).fillRect(0,y1,w,1).fillRect(0,y,w,1);return new asc_CMM({type:Asc.c_oAscMouseMoveType.ResizeRow,sizeCCOrPt:AscCommonExcel.convertPxToPt(height),sizePx:height,x:AscCommon.AscBrowser.convertToRetinaValue(this.cellsLeft),y:AscCommon.AscBrowser.convertToRetinaValue(y1+this._getRowHeight(row))})};WorksheetView.prototype._cleanCache=function(range){var s=this.cache.sectors;var rows=this.cache.rows;if(range===undefined)range=this.model.selectionRange.getLast(); for(var i=Asc.floor(range.r1/kRowsCacheSize),l=Asc.floor(range.r2/kRowsCacheSize);i<=l;++i)if(s[i]){for(var j=i*kRowsCacheSize,k=(i+1)*kRowsCacheSize;j<k;++j)delete rows[j];delete s[i]}};WorksheetView.prototype._cleanCellsTextMetricsCache=function(){this.cache.sectors=[]};WorksheetView.prototype._prepareCellTextMetricsCache=function(range){var firstUpdateRow=null;if(!range){range=this.visibleRange;if(this.topLeftFrozenCell){var row=this.topLeftFrozenCell.getRow0();if(0<row)firstUpdateRow=asc.getMinValueOrNull(firstUpdateRow, this._prepareCellTextMetricsCache2(0,row-1))}}firstUpdateRow=asc.getMinValueOrNull(firstUpdateRow,this._prepareCellTextMetricsCache2(range.r1,range.r2));if(null!==firstUpdateRow||this.isChanged){this._updateRowPositions();this._calcVisibleRows();if(this.objectRender)this.objectRender.updateDrawingsTransform({target:c_oTargetType.RowResize,row:firstUpdateRow})}};WorksheetView.prototype._prepareCellTextMetricsCache2=function(r1,r2){var firstUpdateRow=null;var s=this.cache.sectors;for(var i=Asc.floor(r1/ kRowsCacheSize),l=Asc.floor(r2/kRowsCacheSize);i<=l;++i)if(!s[i]){if(null===firstUpdateRow)firstUpdateRow=i*kRowsCacheSize;s[i]=true;this._calcCellsTextMetrics(i*kRowsCacheSize,(i+1)*kRowsCacheSize-1)}return firstUpdateRow};WorksheetView.prototype._calcCellsTextMetrics=function(r1,r2){var t=this;this.model.getRange3(r1,0,r2,this.cols.length-1)._foreachNoEmpty(function(cell,row,col){t._addCellTextToCache(col,row)},null,true);this.isChanged=false};WorksheetView.prototype._fetchRowCache=function(row){return this.cache.rows[row]= this.cache.rows[row]||new CacheElement};WorksheetView.prototype._fetchCellCache=function(col,row){var r=this._fetchRowCache(row);return r.columns[col]=r.columns[col]||new CacheElementText};WorksheetView.prototype._fetchCellCacheText=function(col,row){var r=this._fetchRowCache(row);return r.columnsWithText[col]=r.columnsWithText[col]||true};WorksheetView.prototype._getRowCache=function(row){return this.cache.rows[row]};WorksheetView.prototype._getCellCache=function(col,row){var r=this.cache.rows[row]; return r&&r.columnsWithText[col]&&r.columns[col]};WorksheetView.prototype._getCellTextCache=function(col,row,dontLookupMergedCells){var c=this._getCellCache(col,row);if(c)return c;else if(!dontLookupMergedCells){var range=this.model.getMergedByCell(row,col);return null!==range?this._getCellTextCache(range.c1,range.r1,true):undefined}return undefined};WorksheetView.prototype._changeColWidth=function(col,width){var oldColWidth=this.getColumnWidthInSymbols(col);var pad=this.settings.cells.padding*2+ 1;var cc=Math.min(this.model.colWidthToCharCount(width+pad),Asc.c_oAscMaxColumnWidth);if(cc>oldColWidth){History.Create_NewPoint();History.StartTransaction();this.model.setColBestFit(true,this.model.charCountToModelColWidth(cc),col,col);History.EndTransaction();this._calcColWidth(col)}};WorksheetView.prototype._addCellTextToCache=function(col,row){var self=this;function makeFnIsGoodNumFormat(flags,width){return function(str){return self.stringRender.measureString(str,flags,width).width<=width}}var c= this._getCell(col,row);if(null===c)return col;var str,tm,strCopy;var fl=this._getCellFlags(c);var mc=fl.merged;if(null!==mc)if(col!==mc.c1||row!==mc.r1){if(undefined===this._getCellTextCache(mc.c1,mc.r1,true))return this._addCellTextToCache(mc.c1,mc.r1);return mc.c2}var mergeType=fl.getMergeType();var align=c.getAlign();var va=align.getAlignVertical();var angle=align.getAngle();if(c.isEmptyTextString()){if(!angle&&c.isNotDefaultFont()&&!(mergeType&c_oAscMergeType.rows)){str=c.getValue2();if(0<str.length){strCopy= str[0];if(!(tm=AscCommonExcel.g_oCacheMeasureEmpty.get(strCopy.format))){strCopy=strCopy.clone();strCopy.text="A";tm=this._roundTextMetrics(this.stringRender.measureString([strCopy],fl));AscCommonExcel.g_oCacheMeasureEmpty.add(strCopy.format,tm)}cache=this._fetchCellCache(col,row);cache.metrics=tm;this._updateRowHeight(cache,row)}}return mc?mc.c2:col}var verticalText=fl.verticalText=angle===AscCommonExcel.g_nVerticalTextAngle;var dDigitsCount=0;var colWidth=0;var cellType=c.getType();fl.isNumberFormat= null===cellType||CellValueType.String!==cellType;var numFormatStr=c.getNumFormatStr();var pad=this.settings.cells.padding*2+1;var sstr,sfl,stm;var isCustomWidth=this.model.getColCustomWidth(col)||verticalText;var angleSin=Math.sin(angle*Math.PI/180);var angleCos=Math.cos(angle*Math.PI/180);if(!isCustomWidth&&fl.isNumberFormat&&!fl.shrinkToFit&&!(mergeType&c_oAscMergeType.cols)&&c_oAscCanChangeColWidth.none!==this.canChangeColWidth){colWidth=this._getColumnWidthInner(col);sstr=c.getValue2(gc_nMaxDigCountView, function(){return true});if("General"===numFormatStr&&c_oAscCanChangeColWidth.all!==this.canChangeColWidth)sstr=AscCommonExcel.dropDecimalAutofit(sstr);sfl=fl.clone();sfl.wrapText=false;stm=this._roundTextMetrics(this.stringRender.measureString(sstr,sfl,colWidth));var stmPrj=Math.abs(angleCos*stm.width)+Math.abs(angleSin*stm.height);if(stmPrj>colWidth)this._changeColWidth(col,stmPrj);dDigitsCount=this.getColumnWidthInSymbols(col);colWidth=this._getColumnWidthInner(col)}else if(null===mc){dDigitsCount= this.getColumnWidthInSymbols(col);colWidth=this._getColumnWidthInner(col);if(!isCustomWidth&&!fl.shrinkToFit&&!(mergeType&c_oAscMergeType.cols)&&!fl.wrapText&&c_oAscCanChangeColWidth.all===this.canChangeColWidth){sstr=c.getValue2(gc_nMaxDigCountView,function(){return true});stm=this._roundTextMetrics(this.stringRender.measureString(sstr,fl,colWidth));var stmPrj=Math.abs(angleCos*stm.width)+Math.abs(angleSin*stm.height);if(stmPrj>colWidth){this._changeColWidth(col,stmPrj);dDigitsCount=this.getColumnWidthInSymbols(col); colWidth=this._getColumnWidthInner(col)}}}else{for(var i=mc.c1;i<=mc.c2&&i<this.cols.length;++i){colWidth+=this._getColumnWidth(i);dDigitsCount+=this.getColumnWidthInSymbols(i)}colWidth-=pad}var rowHeight=this._getRowHeight(row);if(angle===0&&!fl.shrinkToFit)str=c.getValue2(dDigitsCount,makeFnIsGoodNumFormat(fl,colWidth));else str=c.getValue2();var alignH=align.getAlignHorizontal();var ha=c.getAlignHorizontalByValue(alignH);var maxW=fl.wrapText||fl.shrinkToFit||mergeType||asc.isFixedWidthCell(str)? this._calcMaxWidth(col,row,mc):undefined;if(verticalText){fl.textAlign=ha=alignH===null?AscCommon.align_Center:alignH;angle=0}tm=this._roundTextMetrics(this.stringRender.measureString(str,fl,maxW));var cto=mergeType||fl.wrapText||fl.shrinkToFit?{maxWidth:maxW-this._getColumnWidthInner(col)+this._getColumnWidth(col),leftSide:0,rightSide:0}:this._calcCellTextOffset(col,row,ha,tm.width);var textBound={};if(angle){if(mergeType&c_oAscMergeType.rows){rowHeight=0;for(var j=mc.r1;j<=mc.r2&&j<this.nRowsCount;++j)rowHeight+= this._getRowHeight(j)}var textW=tm.width;if(fl.wrapText)if(this.model.getRowCustomHeight(row)){tm=this._roundTextMetrics(this.stringRender.measureString(str,fl,rowHeight));textBound=this.stringRender.getTransformBound(angle,colWidth,rowHeight,tm.width,ha,va,rowHeight)}else{if(!(mergeType&c_oAscMergeType.rows))rowHeight=tm.height;tm=this._roundTextMetrics(this.stringRender.measureString(str,fl,rowHeight));textBound=this.stringRender.getTransformBound(angle,colWidth,rowHeight,tm.width,ha,va,tm.width)}else textBound= this.stringRender.getTransformBound(angle,colWidth,rowHeight,textW,ha,va,maxW);if(fl.isNumberFormat){var textMetricWidth=textW;if(textBound.width>textW)textMetricWidth=textBound.width;if(textBound.height>textW)textMetricWidth=textBound.height;var prj=Math.ceil(Math.abs(Math.sin(angle*Math.PI/180)*textMetricWidth));if(prj>=rowHeight){maxW=rowHeight;str=c.getValue2(dDigitsCount,makeFnIsGoodNumFormat(fl,rowHeight));tm=this._roundTextMetrics(this.stringRender.measureString(str,fl,maxW));if(str[0].format.repeat){var angleSin= Math.sin(angle*Math.PI/180);if(angle>0)textBound.dx=(colWidth-tm.height)/2;if(angle<0){textBound.dx=(colWidth-tm.height*angleSin)/2;textBound.dy=(rowHeight-tm.width)/2}ha=0}}}textBound.height+=3;textBound.dy-=1.5}var cache=this._fetchCellCache(col,row);cache.state=this.stringRender.getInternalState();cache.flags=fl;cache.metrics=tm;cache.cellW=cto.maxWidth;cache.cellHA=ha;cache.cellVA=va;cache.sideL=cto.leftSide;cache.sideR=cto.rightSide;cache.cellType=cellType;cache.isFormula=c.isFormula();cache.angle= angle;cache.textBound=textBound;this._fetchCellCacheText(col,row);if(!angle&&!verticalText&&(cto.leftSide!==0||cto.rightSide!==0))this._addErasedBordersToCache(col-cto.leftSide,col+cto.rightSide,row);this._updateRowHeight(cache,row,maxW,colWidth);return mc?mc.c2:col};WorksheetView.prototype._updateRowHeight2=function(cell){var fr,fm,lm,f;var align=cell.getAlign();var angle=align.getAngle();var va=align.getAlignVertical();var rowInfo=this.rows[cell.nRow];var updateDescender=va===Asc.c_oAscVAlign.Bottom&& !angle;var d=this._getRowDescender(cell.nRow);if(cell.getValueMultiText())fr=cell.getValue2();else{fr=[new AscCommonExcel.Fragment];fr[0].format=cell.getFont()}var th;var cellType=cell.getType();var isNumberFormat=!cell.isEmptyTextString()&&(null===cellType||CellValueType.String!==cellType);if(angle||isNumberFormat||align.getWrap()){this._addCellTextToCache(cell.nCol,cell.nRow);th=this.updateRowHeightValuePx||AscCommonExcel.convertPtToPx(this._getRowHeightReal(cell.nRow))}else{th=this.updateRowHeightValuePx|| AscCommonExcel.convertPtToPx(this._getRowHeightReal(cell.nRow));for(var i=0;i<fr.length;++i){f=fr[i].format;if(!f.isEqual2(AscCommonExcel.g_oDefaultFormat.Font)||f.va){fm=getFontMetrics(f,this.stringRender);lm=this.stringRender._calcLineMetrics2(f.getSize(),f.va,fm);th=Math.min(this.maxRowHeightPx,Math.max(th,lm.th));if(updateDescender&&!f.va)d=Math.max(d,lm.th-lm.bl)}}}rowInfo.height=Asc.round(th*this.getZoom());rowInfo.descender=d;return th};WorksheetView.prototype._updateRowHeight=function(cache, row,maxW,colWidth){if(this.skipUpdateRowHeight)return;var res=null;var mergeType=cache.flags&&cache.flags.getMergeType();var isMergedRows=mergeType&c_oAscMergeType.rows||mergeType&&cache.flags.wrapText;var tm=cache.metrics;var va=cache.cellVA;var textBound=cache.textBound;var rowInfo=this.rows[row];if(va!==Asc.c_oAscVAlign.Top&&va!==Asc.c_oAscVAlign.Center&&!mergeType&&!cache.angle){var newDescender=tm.height-tm.baseline;if(newDescender>this._getRowDescender(row))rowInfo.descender=newDescender}var isCustomHeight= this.model.getRowCustomHeight(row);if(!isCustomHeight&&!(window["NATIVE_EDITOR_ENJINE"]&&this.notUpdateRowHeight)&&!isMergedRows){var newHeight=tm.height;var oldHeight=this.updateRowHeightValuePx||AscCommonExcel.convertPtToPx(this._getRowHeightReal(row));if(cache.angle&&textBound)newHeight=Math.max(oldHeight,textBound.height/this.getZoom());newHeight=Math.min(this.maxRowHeightPx,Math.max(oldHeight,newHeight));if(newHeight!==oldHeight){if(this.updateRowHeightValuePx)this.updateRowHeightValuePx=newHeight; rowInfo.height=Asc.round(newHeight*this.getZoom());History.TurnOff();res=newHeight;var oldExcludeCollapsed=this.model.bExcludeCollapsed;this.model.bExcludeCollapsed=true;this.model.setRowHeight(AscCommonExcel.convertPxToPt(newHeight),row,row,false);this.model.bExcludeCollapsed=oldExcludeCollapsed;History.TurnOn();if(cache.angle){if(cache.flags.wrapText&&!isCustomHeight)maxW=tm.width;cache.textBound=this.stringRender.getTransformBound(cache.angle,colWidth,rowInfo.height,tm.width,cache.cellHA,va,maxW)}this.isChanged= true}}return res};WorksheetView.prototype._updateRowsHeight=function(){if(0===this.arrRecalcRangesWithHeight.length)return null;var canChangeColWidth=this.canChangeColWidth;var t=this;var duplicate={};var range,cache,row,minRow=gc_nMaxRow0;for(var i=0;i<this.arrRecalcRangesWithHeight.length;++i){range=this.arrRecalcRangesWithHeight[i];this.canChangeColWidth=this.arrRecalcRangesCanChangeColWidth[i];this.model.getRowIterator(range.r1,0,gc_nMaxCol0,function(itRow){for(var r=range.r1;r<=range.r2&&r<t.rows.length;duplicate[r++]= 1){if(duplicate[r])continue;if(t.model.getRowCustomHeight(r)){t._calcHeightRow(0,r);continue}t.updateRowHeightValuePx=t.defaultRowHeightPx;row=t.rows[r];row.height=Asc.round(t.defaultRowHeightPx*t.getZoom());row.descender=t.defaultRowDescender;cache=t._getRowCache(r);itRow.setRow(r);var cell;while(cell=itRow.next()){if(c_oAscMergeType.rows&getMergeType(t.model.getMergedByCell(cell.nRow,cell.nCol)))continue;t.updateRowHeightValuePx=(cache&&cache[cell.nCol]?t._updateRowHeight(cache[cell.nCol],r):t._updateRowHeight2(cell))|| t.updateRowHeightValuePx}if(t.updateRowHeightValuePx){History.TurnOff();var oldExcludeCollapsed=t.model.bExcludeCollapsed;t.model.bExcludeCollapsed=true;t.model.setRowHeight(AscCommonExcel.convertPxToPt(t.updateRowHeightValuePx),r,r,false);t.model.bExcludeCollapsed=oldExcludeCollapsed;History.TurnOn()}minRow=Math.min(minRow,range.r1)}})}this.updateRowHeightValuePx=null;this.arrRecalcRangesWithHeight=[];this.arrRecalcRangesCanChangeColWidth=[];this.canChangeColWidth=canChangeColWidth;this._updateRowPositions(); return minRow};WorksheetView.prototype._calcMaxWidth=function(col,row,mc){if(null===mc)return this._getColumnWidthInner(col);return this._getColumnWidthInner(mc.c1)+(this._getColLeft(mc.c2+1)-this._getColLeft(mc.c1+1))};WorksheetView.prototype._calcCellTextOffset=function(col,row,textAlign,textWidth){var ls=0,rs=0,i,size;var width=this._getColumnWidth(col);textWidth=textWidth+this.settings.cells.padding;if(textAlign===AscCommon.align_Center){textWidth/=2;width/=2}var maxWidth=0;if(textAlign!==AscCommon.align_Left){size= width;for(i=col-1;i>=0&&this._isCellEmptyOrMerged(i,row);--i){if(textWidth<=size)break;size+=this._getColumnWidth(i)}ls=Math.max(col-i-1,0);maxWidth+=size}if(textAlign!==AscCommon.align_Right){size=width;for(i=col+1;i<gc_nMaxCol&&this._isCellEmptyOrMerged(i,row);++i){if(textWidth<=size)break;size+=this._getColumnWidth(i)}rs=Math.max(i-col-1,0);maxWidth+=size}return{maxWidth:maxWidth,leftSide:ls,rightSide:rs}};WorksheetView.prototype._calcCellsWidth=function(colBeg,colEnd,row){var inc=colBeg<=colEnd? 1:-1,res=[];for(var i=colBeg;(colEnd-i)*inc>=0;i+=inc){if(i!==colBeg&&!this._isCellEmptyOrMerged(i,row))break;res.push(this._getColumnWidth(i));if(res.length>1)res[res.length-1]+=res[res.length-2]}return res};WorksheetView.prototype._findOverlapCell=function(col,row){var r=this._getRowCache(row);if(r)for(var i in r.columnsWithText){if(!r.columns[i]||0===this._getColumnWidth(i))continue;var ct=r.columns[i];if(!ct)continue;i>>=0;if(col===i)continue;var lc=i-ct.sideL,rc=i+ct.sideR;if(col>=lc&&col<=rc)return i}return-1}; WorksheetView.prototype._isMergedCells=function(range){return range.isEqual(this.model.getMergedByCell(range.r1,range.c1))};WorksheetView.prototype._addErasedBordersToCache=function(colBeg,colEnd,row){var rc=this._fetchRowCache(row);for(var col=colBeg;col<colEnd;++col)rc.erased[col]=true};WorksheetView.prototype._isLeftBorderErased=function(col,rowCache){return rowCache&&rowCache.erased[col-1]===true};WorksheetView.prototype._isRightBorderErased=function(col,rowCache){return rowCache&&rowCache.erased[col]=== true};WorksheetView.prototype._calcMaxBorderWidth=function(b1,b2){return Math.max(b1&&b1.w,b2&&b2.w)};WorksheetView.prototype._getColumnTitle=function(col){return AscCommonExcel.g_R1C1Mode?this._getRowTitle(col):AscCommon.g_oCellAddressUtils.colnumToColstrFromWsView(col+1)};WorksheetView.prototype._getRowTitle=function(row){return""+(row+1)};WorksheetView.prototype._getCell=function(col,row){if(col<0||col>gc_nMaxCol0||row<0||row>this.gc_nMaxRow0)return null;return this.model.getCell3(row,col)};WorksheetView.prototype._getVisibleCell= function(col,row){return this.model.getCell3(row,col)};WorksheetView.prototype._getCellFlags=function(col,row){var c=row!==undefined?this._getCell(col,row):col;var fl=new CellFlags;if(null!==c){var align=c.getAlign();fl.wrapText=align.getWrap();fl.shrinkToFit=fl.wrapText?false:align.getShrinkToFit();fl.merged=c.hasMerged();fl.textAlign=c.getAlignHorizontalByValue(align.getAlignHorizontal())}return fl};WorksheetView.prototype._isCellNullText=function(col,row){var c=row!==undefined?this._getCell(col, row):col;return null===c||c.isNullText()};WorksheetView.prototype._isCellEmptyOrMerged=function(col,row){var c=row!==undefined?this._getCell(col,row):col;return null===c||c.isNullText()&&null===c.hasMerged()};WorksheetView.prototype._getRange=function(c1,r1,c2,r2){return this.model.getRange3(r1,c1,r2,c2)};WorksheetView.prototype._selectColumnsByRange=function(){var ar=this.model.selectionRange.getLast();var type=ar.getType();if(c_oAscSelectionType.RangeMax!==type){this.cleanSelection();if(c_oAscSelectionType.RangeRow=== type)ar.assign(0,0,gc_nMaxCol0,gc_nMaxRow0);else ar.assign(ar.c1,0,ar.c2,gc_nMaxRow0);this._drawSelection();this._updateSelectionNameAndInfo()}};WorksheetView.prototype._selectRowsByRange=function(){var ar=this.model.selectionRange.getLast();var type=ar.getType();if(c_oAscSelectionType.RangeMax!==type){this.cleanSelection();if(c_oAscSelectionType.RangeCol===type)ar.assign(0,0,gc_nMaxCol0,gc_nMaxRow0);else ar.assign(0,ar.r1,gc_nMaxCol0,ar.r2);this._drawSelection();this._updateSelectionNameAndInfo()}}; WorksheetView.prototype._isLargeRange=function(range){var vr=this.visibleRange;return range.c2-range.c1+1>(vr.c2-vr.c1+1)*3||range.r2-range.r1+1>(vr.r2-vr.r1+1)*3};WorksheetView.prototype.drawDepCells=function(){var ctx=this.overlayCtx,_cc=this.cellCommentator,c,node,that=this;ctx.clear();this._drawSelection();var color=new CColor(0,0,255);function draw_arrow(context,fromx,fromy,tox,toy){var headlen=9,showArrow=tox>that._getColLeft(0)&&toy>that._getRowTop(0),dx=tox-fromx,dy=toy-fromy,tox=tox>that._getColLeft(0)? tox:that._getColLeft(0),toy=toy>that._getRowTop(0)?toy:that._getRowTop(0),angle=Math.atan2(dy,dx),_a=Math.PI/18;context.save().setLineWidth(1).beginPath().lineDiag.moveTo(fromx,fromy).lineTo(tox,toy);if(showArrow)context.moveTo(tox-headlen*Math.cos(angle-_a),toy-headlen*Math.sin(angle-_a)).lineTo(tox,toy).lineTo(tox-headlen*Math.cos(angle+_a),toy-headlen*Math.sin(angle+_a)).lineTo(tox-headlen*Math.cos(angle-_a),toy-headlen*Math.sin(angle-_a));context.setStrokeStyle(color).setFillStyle(color).stroke().fill().closePath().restore()} function gCM(_this,col,row){var metrics={top:0,left:0,width:0,height:0,result:false};var fvr=_this.getFirstVisibleRow();var fvc=_this.getFirstVisibleCol();var mergedRange=_this.model.getMergedByCell(row,col);if(mergedRange&&fvc<mergedRange.c2&&fvr<mergedRange.r2){var startCol=mergedRange.c1>fvc?mergedRange.c1:fvc;var startRow=mergedRange.r1>fvr?mergedRange.r1:fvr;metrics.top=_this._getRowTop(startRow)-_this._getRowTop(fvr)+_this._getRowTop(0);metrics.left=_this._getColLeft(startCol)-_this._getColLeft(fvc)+ _this._getColLeft(0);metrics.width=_this._getColLeft(mergedRange.c2+1)-_this._getColLeft(startCol);metrics.height=_this._getRowHeight(mergedRange.r2+1)-_this._getRowHeight(startRow)}else{metrics.top=_this._getRowTop(row)-_this._getRowTop(fvr)+_this._getRowTop(0);metrics.left=_this._getColLeft(col)-_this._getColLeft(fvc)+_this._getColLeft(0);metrics.width=_this._getColumnWidth(col);metrics.height=_this._getRowHeight(row)}metrics.result=true;return metrics}for(var id in this.depDrawCells){c=this.depDrawCells[id].from; node=this.depDrawCells[id].to;var mainCellMetrics=gCM(this,c.nCol,c.nRow),nodeCellMetrics,_t1,_t2;for(var id in node){if(!node[id].isArea){_t1=gCM(this,node[id].returnCell().nCol,node[id].returnCell().nRow);nodeCellMetrics={t:_t1.top,l:_t1.left,w:_t1.width,h:_t1.height,apt:_t1.top+_t1.height/2,apl:_t1.left+_t1.width/4}}else{var _t1=gCM(this,node[id].getBBox0().c1,node[id].getBBox0().r1),_t2=gCM(this,node[id].getBBox0().c2,node[id].getBBox0().r2);nodeCellMetrics={t:_t1.top,l:_t1.left,w:_t2.left+_t2.width- _t1.left,h:_t2.top+_t2.height-_t1.top,apt:_t1.top+_t1.height/2,apl:_t1.left+_t1.width/4}}var x1=Math.floor(nodeCellMetrics.apl),y1=Math.floor(nodeCellMetrics.apt),x2=Math.floor(mainCellMetrics.left+mainCellMetrics.width/4),y2=Math.floor(mainCellMetrics.top+mainCellMetrics.height/2);if(x1<0&&x2<0||y1<0&&y2<0)continue;if(y1<this._getRowTop(0))y1-=this._getRowTop(0);if(y1<0&&y2>0){var _x1=Math.floor(Math.sqrt((x1-x2)*(x1-x2)*y1*y1/((y2-y1)*(y2-y1))));if(x1>x2)x1-=_x1;else if(x1<x2)x1+=_x1}else if(y1> 0&&y2<0){var _x2=Math.floor(Math.sqrt((x1-x2)*(x1-x2)*y2*y2/((y2-y1)*(y2-y1))));if(x2>x1)x2-=_x2;else if(x2<x1)x2+=_x2}if(x1<0&&x2>0){var _y1=Math.floor(Math.sqrt((y1-y2)*(y1-y2)*x1*x1/((x2-x1)*(x2-x1))));if(y1>y2)y1-=_y1;else if(y1<y2)y1+=_y1}else if(x1>0&&x2<0){var _y2=Math.floor(Math.sqrt((y1-y2)*(y1-y2)*x2*x2/((x2-x1)*(x2-x1))));if(y2>y1)y2-=_y2;else if(y2<y1)y2+=_y2}draw_arrow(ctx,x1<this._getColLeft(0)?this._getColLeft(0):x1,y1<this._getRowTop(0)?this._getRowTop(0):y1,x2,y2);if(nodeCellMetrics.apl> this._getColLeft(0)&&nodeCellMetrics.apt>this._getRowTop(0))ctx.save().beginPath().arc(Math.floor(nodeCellMetrics.apl),Math.floor(nodeCellMetrics.apt),3,0,2*Math.PI,false,-.5,-.5).setFillStyle(color).fill().closePath().setLineWidth(1).setStrokeStyle(color).rect(nodeCellMetrics.l,nodeCellMetrics.t,nodeCellMetrics.w-1,nodeCellMetrics.h-1).stroke().restore()}}};WorksheetView.prototype.prepareDepCells=function(se){this.drawDepCells()};WorksheetView.prototype.cleanDepCells=function(){this.depDrawCells= null;this.drawDepCells()};WorksheetView.prototype._getPPIX=function(){return this.drawingCtx.getPPIX()};WorksheetView.prototype._getPPIY=function(){return this.drawingCtx.getPPIY()};WorksheetView.prototype._setDefaultFont=function(drawingCtx){var ctx=drawingCtx||this.drawingCtx;ctx.setFont(AscCommonExcel.g_oDefaultFormat.Font)};WorksheetView.prototype._roundTextMetrics=function(tm){tm.width=Asc.round(tm.width);tm.height=Asc.round(tm.height);tm.baseline=Asc.round(tm.baseline);return tm};WorksheetView.prototype._calcTextHorizPos= function(x1,x2,tm,align){switch(align){case AscCommon.align_Center:return Asc.round(.5*(x1+x2+1-tm.width));case AscCommon.align_Right:return x2+1-this.settings.cells.padding-tm.width;case AscCommon.align_Justify:default:return x1+this.settings.cells.padding}};WorksheetView.prototype._calcTextVertPos=function(y1,h,baseline,tm,align){switch(align){case Asc.c_oAscVAlign.Center:case Asc.c_oAscVAlign.Dist:case Asc.c_oAscVAlign.Just:return y1+Asc.round(.5*(h-tm.height*this.getZoom()));case Asc.c_oAscVAlign.Top:return y1; default:return baseline-Asc.round(tm.baseline*this.getZoom())}};WorksheetView.prototype._calcTextWidth=function(x1,x2,tm,halign){switch(halign){case AscCommon.align_Justify:return x2+1-this.settings.cells.padding*2-x1;default:return tm.width}};WorksheetView.prototype._calcCellPosition=function(c,r,dc,dr){var t=this;var vr=t.visibleRange;function findNextCell(col,row,dx,dy){var state=t._isCellNullText(col,row);var i=col+dx;var j=row+dy;while(i>=0&&i<t.nColsCount&&j>=0&&j<t.nRowsCount){var newState= t._isCellNullText(i,j);if(newState!==state){var ret={};ret.col=state?i:i-dx;ret.row=state?j:j-dy;if(ret.col!==col||ret.row!==row||state)return ret;state=newState}i+=dx;j+=dy}return{col:i-dx,row:j-dy}}function findEOT(){var obr=t.objectRender?t.objectRender.getMaxColRow():new AscCommon.CellBase(-1,-1);var maxCols=t.model.getColsCount();var maxRows=t.model.getRowsCount();var lastC=-1,lastR=-1;for(var col=0;col<maxCols;++col)for(var row=0;row<maxRows;++row)if(!t._isCellNullText(col,row)){lastC=Math.max(lastC, col);lastR=Math.max(lastR,row)}return{col:Math.max(lastC,obr.col),row:Math.max(lastR,obr.row)}}var eot=dc>+2.0001&&dc<+2.9999&&dr>+2.0001&&dr<+2.9999?findEOT():null;var newCol=function(){if(dc>+1E-4&&dc<+.9999)return c+(vr.c2-vr.c1+1);if(dc<-1E-4&&dc>-.9999)return c-(vr.c2-vr.c1+1);if(dc>+1.0001&&dc<+1.9999)return findNextCell(c,r,+1,0).col;if(dc<-1.0001&&dc>-1.9999)return findNextCell(c,r,-1,0).col;if(dc>+2.0001&&dc<+2.9999)return(eot||findNextCell(c,r,+1,0)).col;if(dc<-2.0001&&dc>-2.9999)return 0; return c+dc}();var newRow=function(){if(dr>+1E-4&&dr<+.9999)return r+(vr.r2-vr.r1+1);if(dr<-1E-4&&dr>-.9999)return r-(vr.r2-vr.r1+1);if(dr>+1.0001&&dr<+1.9999)return findNextCell(c,r,0,+1).row;if(dr<-1.0001&&dr>-1.9999)return findNextCell(c,r,0,-1).row;if(dr>+2.0001&&dr<+2.9999)return!eot?0:eot.row;if(dr<-2.0001&&dr>-2.9999)return 0;return r+dr}();if(newCol>=t.nColsCount&&newCol<=gc_nMaxCol0)t.nColsCount=newCol+1;if(newRow>=t.nRowsCount&&newRow<=gc_nMaxRow0)t.nRowsCount=newRow+1;return{col:newCol< 0?0:Math.min(newCol,t.nColsCount-1),row:newRow<0?0:Math.min(newRow,t.nRowsCount-1)}};WorksheetView.prototype._isColDrawnPartially=function(col,leftCol,diffWidth){if(col<=leftCol||col>gc_nMaxCol0)return false;return this._getColLeft(col+1)-this._getColLeft(leftCol)+this.cellsLeft+diffWidth>this.drawingCtx.getWidth()};WorksheetView.prototype._isRowDrawnPartially=function(row,topRow,diffHeight){if(row<=topRow||row>gc_nMaxRow0)return false;return this._getRowTop(row+1)-this._getRowTop(topRow)+this.cellsTop+ diffHeight>this.drawingCtx.getHeight()};WorksheetView.prototype._getMissingWidth=function(){var visibleWidth=this.cellsLeft+this._getColLeft(this.nColsCount)-this._getColLeft(this.visibleRange.c1);var offsetFrozen=this.getFrozenPaneOffset(false,true);visibleWidth+=offsetFrozen.offsetX;return this.drawingCtx.getWidth()-visibleWidth};WorksheetView.prototype._getMissingHeight=function(){var visibleHeight=this.cellsTop+this._getRowTop(this.nRowsCount)-this._getRowTop(this.visibleRange.r1);var offsetFrozen= this.getFrozenPaneOffset(true,false);visibleHeight+=offsetFrozen.offsetY;return this.drawingCtx.getHeight()-visibleHeight};WorksheetView.prototype._updateVisibleRowsCount=function(skipScrollReinit){this._calcVisibleRows();if(gc_nMaxRow!==this.nRowsCount&&!this.model.isDefaultHeightHidden()){var missingHeight=this._getMissingHeight();if(0<missingHeight){var rowHeight=Asc.round(this.defaultRowHeightPx*this.getZoom());this.nRowsCount=Math.min(this.nRowsCount+Asc.ceil(missingHeight/rowHeight),gc_nMaxRow); this._calcVisibleRows();if(!skipScrollReinit)this.handlers.trigger("reinitializeScroll",AscCommonExcel.c_oAscScrollType.ScrollVertical)}}this._updateDrawingArea()};WorksheetView.prototype._updateVisibleColsCount=function(skipScrollReinit){this._calcVisibleColumns();if(gc_nMaxCol!==this.nColsCount&&!this.model.isDefaultWidthHidden()){var missingWidth=this._getMissingWidth();if(0<missingWidth){var colWidth=Asc.round(this.defaultColWidthPx*this.getZoom());this.nColsCount=Math.min(this.nColsCount+Asc.ceil(missingWidth/ colWidth),gc_nMaxCol);this._calcVisibleColumns();if(!skipScrollReinit)this.handlers.trigger("reinitializeScroll",AscCommonExcel.c_oAscScrollType.ScrollHorizontal)}}};WorksheetView.prototype.scrollVertical=function(delta,editor,initRowsCount){var vr=this.visibleRange;var fixStartRow=new asc_Range(vr.c1,vr.r1,vr.c2,vr.r1);this._fixSelectionOfHiddenCells(0,delta>=0?+1:-1,fixStartRow);var start=this._calcCellPosition(vr.c1,fixStartRow.r1,0,delta).row;fixStartRow.assign(vr.c1,start,vr.c2,start);this._fixSelectionOfHiddenCells(0, delta>=0?+1:-1,fixStartRow);this._fixVisibleRange(fixStartRow);var reinitScrollY=start!==fixStartRow.r1;if(reinitScrollY&&0>delta)delta+=fixStartRow.r1-start;start=fixStartRow.r1;if(start===vr.r1){if(reinitScrollY){this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollVertical;this._reinitializeScroll()}return this}if(!this.notUpdateRowHeight){this.cleanSelection();this.cellCommentator.cleanSelectedComment()}var ctx=this.drawingCtx;var ctxW=ctx.getWidth();var ctxH=ctx.getHeight();var offsetX,offsetY, diffWidth=0,diffHeight=0,cFrozen=0,rFrozen=0;if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0();rFrozen=this.topLeftFrozenCell.getRow0();diffWidth=this._getColLeft(cFrozen)-this._getColLeft(0);diffHeight=this._getRowTop(rFrozen)-this._getRowTop(0)}var oldVRE_isPartial=this._isRowDrawnPartially(vr.r2,vr.r1,diffHeight);var oldVR=vr.clone();var oldStart=vr.r1;var oldEnd=vr.r2;var x=this.cellsLeft;vr.r1=start;this._updateVisibleRowsCount();if(!oldVR.intersectionSimple(vr))this._prepareCellTextMetricsCache(vr); else if(0>delta)this._prepareCellTextMetricsCache(new asc_Range(vr.c1,start,vr.c2,oldStart-1));else this._prepareCellTextMetricsCache(new asc_Range(vr.c1,oldEnd+1,vr.c2,vr.r2));if(this.notUpdateRowHeight)return this;var oldW,dx;var topOldStart=this._getRowTop(oldStart);var dy=this._getRowTop(start)-topOldStart;var oldH=ctxH-this.cellsTop-Math.abs(dy)-diffHeight;var scrollDown=dy>0&&oldH>0;var y=this.cellsTop+(scrollDown?dy:0)+diffHeight;var lastRowHeight=scrollDown&&oldVRE_isPartial?ctxH-(this._getRowTop(oldEnd)- topOldStart+this.cellsTop+diffHeight):0;if(x!==this.cellsLeft){this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollHorizontal;this._drawCorner();this._cleanColumnHeadersRect();this._drawColumnHeaders(null);dx=this.cellsLeft-x;oldW=ctxW-x-Math.abs(dx);if(rFrozen)ctx.drawImage(ctx.getCanvas(),x,this.cellsTop,oldW,diffHeight,x+dx,this.cellsTop,oldW,diffHeight);this._drawFrozenPane(true)}else{dx=0;x=this.headersLeft-this.groupWidth;oldW=ctxW}var moveHeight=oldH-lastRowHeight;if(moveHeight>0){ctx.drawImage(ctx.getCanvas(), x,y,oldW,moveHeight,x+dx,y-dy,oldW,moveHeight);if(AscBrowser.isSafari)this.drawingGraphicCtx.moveImageDataSafari(x,y,oldW,moveHeight,x+dx,y-dy);else this.drawingGraphicCtx.moveImageData(x,y,oldW,moveHeight,x+dx,y-dy)}var clearTop=this.cellsTop+diffHeight+(scrollDown&&moveHeight>0?moveHeight:0);var clearHeight=moveHeight>0?Math.abs(dy)+lastRowHeight:ctxH-(this.cellsTop+diffHeight);ctx.setFillStyle(this.settings.cells.defaultState.background).fillRect(this.headersLeft-this.groupWidth,clearTop,ctxW, clearHeight);this.drawingGraphicCtx.clearRect(this.headersLeft-this.groupWidth,clearTop,ctxW,clearHeight);this._updateDrawingArea();if(dy<0||vr.r2!==oldEnd||oldVRE_isPartial||dx!==0){var r1,r2;if(moveHeight>0)if(scrollDown){r1=oldEnd+(oldVRE_isPartial?0:1);r2=vr.r2}else{r1=vr.r1;r2=vr.r1-1-delta}else{r1=vr.r1;r2=vr.r2}var range=new asc_Range(vr.c1,r1,vr.c2,r2);if(dx===0)this._drawRowHeaders(null,r1,r2);else{this._drawRowHeaders(null);if(dx<0){var r_;var r1_=r2+1;var r2_=vr.r2;if(r2_>=r1_){r_=new asc_Range(vr.c2, r1_,vr.c2,r2_);this._drawGrid(null,r_);this._drawGroupData(null,r_);this._drawCellsAndBorders(null,r_)}if(0<rFrozen){r_=new asc_Range(vr.c2,0,vr.c2,rFrozen-1);offsetY=this._getRowTop(0)-this.cellsTop;this._drawGrid(null,r_,undefined,offsetY);this._drawGroupData(null,r_,undefined,offsetY);this._drawCellsAndBorders(null,r_,undefined,offsetY)}}}offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft-diffWidth;offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop-diffHeight;this._drawGrid(null, range);if(dx!==0)this._drawGroupData(null);else this._drawGroupData(null,range);this._drawCellsAndBorders(null,range);this.af_drawButtons(range,offsetX,offsetY);this.objectRender.updateRange(range);if(0<cFrozen){range.c1=0;range.c2=cFrozen-1;offsetX=this._getColLeft(0)-this.cellsLeft;this._drawGrid(null,range,offsetX);this._drawGroupData(null,range,offsetX);this._drawCellsAndBorders(null,range,offsetX);this.af_drawButtons(range,offsetX,offsetY);this.objectRender.updateRange(range)}}this._drawFrozenPaneLines(); this._fixSelectionOfMergedCells();this._drawSelection();if(reinitScrollY||0>delta&&initRowsCount&&this._initRowsCount())this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollVertical;this._reinitializeScroll();this.handlers.trigger("onDocumentPlaceChanged");if(editor&&this.model.getSelection().activeCell.row>=rFrozen)editor.move();this.cellCommentator.updateActiveComment();this.cellCommentator.drawCommentCells();window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Update_Position();this.handlers.trigger("toggleAutoCorrectOptions", true);return this};WorksheetView.prototype.scrollHorizontal=function(delta,editor,initColsCount){var vr=this.visibleRange;var fixStartCol=new asc_Range(vr.c1,vr.r1,vr.c1,vr.r2);this._fixSelectionOfHiddenCells(delta>=0?+1:-1,0,fixStartCol);var start=this._calcCellPosition(fixStartCol.c1,vr.r1,delta,0).col;fixStartCol.assign(start,vr.r1,start,vr.r2);this._fixSelectionOfHiddenCells(delta>=0?+1:-1,0,fixStartCol);this._fixVisibleRange(fixStartCol);var reinitScrollX=start!==fixStartCol.c1;if(reinitScrollX&& 0>delta)delta+=fixStartCol.c1-start;start=fixStartCol.c1;if(start===vr.c1){if(reinitScrollX){this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollHorizontal;this._reinitializeScroll()}return this}if(!this.notUpdateRowHeight){this.cleanSelection();this.cellCommentator.cleanSelectedComment()}var ctx=this.drawingCtx;var ctxW=ctx.getWidth();var ctxH=ctx.getHeight();var oldStart=vr.c1;var oldEnd=vr.c2;var leftOldStart=this._getColLeft(oldStart);var dx=this._getColLeft(start)-leftOldStart;var offsetX, offsetY,diffWidth=0,diffHeight=0;var oldW=ctxW-this.cellsLeft-Math.abs(dx);var scrollRight=dx>0&&oldW>0;var x=this.cellsLeft+(scrollRight?dx:0);var y=this.headersTop-this.groupHeight;var cFrozen=0,rFrozen=0;if(this.topLeftFrozenCell){rFrozen=this.topLeftFrozenCell.getRow0();cFrozen=this.topLeftFrozenCell.getCol0();diffWidth=this._getColLeft(cFrozen)-this._getColLeft(0);diffHeight=this._getRowTop(rFrozen)-this._getRowTop(0);x+=diffWidth;oldW-=diffWidth}var oldVCE_isPartial=this._isColDrawnPartially(vr.c2, vr.c1,diffWidth);var oldVR=vr.clone();vr.c1=start;this._updateVisibleColsCount();if(!oldVR.intersectionSimple(vr))this._prepareCellTextMetricsCache(vr);else if(0>delta)this._prepareCellTextMetricsCache(new asc_Range(start,vr.r1,oldStart-1,vr.r2));else this._prepareCellTextMetricsCache(new asc_Range(oldEnd+1,vr.r1,vr.c2,vr.r2));if(this.notUpdateRowHeight)return this;var lastColWidth=scrollRight&&oldVCE_isPartial?ctxW-(this._getColLeft(oldEnd)-leftOldStart+this.cellsLeft+diffWidth):0;var moveWidth= oldW-lastColWidth;if(moveWidth>0){ctx.drawImage(ctx.getCanvas(),x,y,moveWidth,ctxH,x-dx,y,moveWidth,ctxH);if(AscBrowser.isSafari)this.drawingGraphicCtx.moveImageDataSafari(x,y,moveWidth,ctxH,x-dx,y);else this.drawingGraphicCtx.moveImageData(x,y,moveWidth,ctxH,x-dx,y)}var clearLeft=this.cellsLeft+diffWidth+(scrollRight&&moveWidth>0?moveWidth:0);var clearWidth=moveWidth>0?Math.abs(dx)+lastColWidth:ctxW-(this.cellsLeft+diffWidth);ctx.setFillStyle(this.settings.cells.defaultState.background).fillRect(clearLeft, y,clearWidth,ctxH);this.drawingGraphicCtx.clearRect(clearLeft,y,clearWidth,ctxH);this._updateDrawingArea();if(dx<0||vr.c2!==oldEnd||oldVCE_isPartial){var c1,c2;if(moveWidth>0)if(scrollRight){c1=oldEnd+(oldVCE_isPartial?0:1);c2=vr.c2}else{c1=vr.c1;c2=vr.c1-1-delta}else{c1=vr.c1;c2=vr.c2}var range=new asc_Range(c1,vr.r1,c2,vr.r2);offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft-diffWidth;offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop-diffHeight;this._drawColumnHeaders(null, c1,c2);this._drawGrid(null,range);this._drawGroupData(null,range,undefined,undefined,true);this._drawCellsAndBorders(null,range);this.af_drawButtons(range,offsetX,offsetY);this.objectRender.updateRange(range);if(rFrozen){range.r1=0;range.r2=rFrozen-1;offsetY=this._getRowTop(0)-this.cellsTop;this._drawGrid(null,range,undefined,offsetY);this._drawGroupData(null,range,undefined,offsetY,true);this._drawCellsAndBorders(null,range,undefined,offsetY);this.af_drawButtons(range,offsetX,offsetY);this.objectRender.updateRange(range)}}this._drawFrozenPaneLines(); this._fixSelectionOfMergedCells();this._drawSelection();if(reinitScrollX||0>delta&&initColsCount&&this._initColsCount())this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollHorizontal;this._reinitializeScroll();this.handlers.trigger("onDocumentPlaceChanged");if(editor&&this.model.getSelection().activeCell.col>=cFrozen)editor.move();this.cellCommentator.updateActiveComment();this.cellCommentator.drawCommentCells();window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Update_Position();this.handlers.trigger("toggleAutoCorrectOptions", true);return this};WorksheetView.prototype.findCellByXY=function(x,y,canReturnNull,skipCol,skipRow){var i,sum,size,result=new AscFormat.CCellObjectInfo;if(canReturnNull)result.col=result.row=null;x+=this.cellsLeft;y+=this.cellsTop;if(!skipCol){sum=this._getColLeft(this.nColsCount);if(sum<x){result.col=this.nColsCount;if(!this.model.isDefaultWidthHidden()){result.col+=(x-sum)/(this.defaultColWidthPx*this.getZoom())|0;result.col=Math.min(result.col,gc_nMaxCol0);sum+=(result.col-this.nColsCount)*(this.defaultColWidthPx* this.getZoom())}}else{sum=this.cellsLeft;for(i=0;i<this.nColsCount;++i){size=this._getColumnWidth(i);if(sum+size>x)break;sum+=size}result.col=i}if(null!==result.col)result.colOff=x-sum}if(!skipRow){sum=this._getRowTop(this.nRowsCount);if(sum<y){result.row=this.nRowsCount;if(!this.model.isDefaultHeightHidden()){result.row+=(y-sum)/(this.defaultRowHeightPx*this.getZoom())|0;result.row=Math.min(result.row,gc_nMaxRow0);sum+=(result.row-this.nRowsCount)*(this.defaultRowHeightPx*this.getZoom())}}else{sum= this.cellsTop;for(i=0;i<this.nRowsCount;++i){size=this._getRowHeight(i);if(sum+size>y)break;sum+=size}result.row=i}if(null!==result.row)result.rowOff=y-sum}return result};WorksheetView.prototype._findColUnderCursor=function(x,canReturnNull,half){var activeCellCol=half?this._getSelection().activeCell.col:-1;var w,dx=0;var c=this.visibleRange.c1;var offset=this._getColLeft(c)-this.cellsLeft;var c2,x1,x2,cFrozen,widthDiff=0;if(x>=this.cellsLeft){if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0(); widthDiff=this._getColLeft(cFrozen)-this._getColLeft(0);if(x<this.cellsLeft+widthDiff&&0!==widthDiff){c=0;widthDiff=0}}for(x1=this.cellsLeft+widthDiff,c2=this.nColsCount-1;c<=c2;++c,x1=x2){w=this._getColumnWidth(c);x2=x1+w;dx=half?w/2*Math.sign(c-activeCellCol):0;if(x1+dx>x)if(c!==this.visibleRange.c1){if(dx){c-=1;x2=x1;x1-=w}return{col:c,left:x1,right:x2}}else{c=c2;break}else if(x<=x2+dx)return{col:c,left:x1,right:x2}}if(!canReturnNull){x1=this._getColLeft(c2)-offset;return{col:c2,left:x1,right:x1+ this._getColumnWidth(c2)}}}else{if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0();if(0!==cFrozen){c=0;offset=this._getColLeft(c)-this.cellsLeft}}for(x2=this.cellsLeft+this._getColumnWidth(c),c2=0;c>=c2;--c,x2=x1){x1=this._getColLeft(c)-offset;if(x1<=x&&x<x2)return{col:c,left:x1,right:x2}}if(!canReturnNull)return{col:c2,left:x1,right:x1+this._getColumnWidth(c2)}}return null};WorksheetView.prototype._findRowUnderCursor=function(y,canReturnNull,half){var activeCellRow=half?this._getSelection().activeCell.row: -1;var h,dy=0;var r=this.visibleRange.r1;var offset=this._getRowTop(r)-this.cellsTop;var r2,y1,y2,rFrozen,heightDiff=0;if(y>=this.cellsTop){if(this.topLeftFrozenCell){rFrozen=this.topLeftFrozenCell.getRow0();heightDiff=this._getRowTop(rFrozen)-this._getRowTop(0);if(y<this.cellsTop+heightDiff&&0!==heightDiff){r=0;heightDiff=0}}for(y1=this.cellsTop+heightDiff,r2=this.nRowsCount-1;r<=r2;++r,y1=y2){h=this._getRowHeight(r);y2=y1+h;dy=half?h/2*Math.sign(r-activeCellRow):0;if(y1+dy>y)if(r!==this.visibleRange.r1){if(dy){r-= 1;y2=y1;y1-=h}return{row:r,top:y1,bottom:y2}}else{r=r2;break}else if(y<=y2+dy)return{row:r,top:y1,bottom:y2}}if(!canReturnNull){y1=this._getRowTop(r2)-offset;return{row:r2,top:y1,bottom:y1+this._getRowHeight(r2)}}}else{if(this.topLeftFrozenCell){rFrozen=this.topLeftFrozenCell.getRow0();if(0!==rFrozen){r=0;offset=this._getRowTop(r)-this.cellsTop}}for(y2=this.cellsTop+this._getRowHeight(r),r2=0;r>=r2;--r,y2=y1){y1=this._getRowTop(r)-offset;if(y1<=y&&y<y2)return{row:r,top:y1,bottom:y2}}if(!canReturnNull)return{row:r2, top:y1,bottom:y1+this._getRowHeight(r2)}}return null};WorksheetView.prototype._hitResizeCorner=function(x1,y1,x2,y2){var wEps=AscCommon.global_mouseEvent.KoefPixToMM,hEps=AscCommon.global_mouseEvent.KoefPixToMM;return Math.abs(x2-x1)<=wEps+2&&Math.abs(y2-y1)<=hEps+2};WorksheetView.prototype._hitInRange=function(range,rangeType,vr,x,y,offsetX,offsetY){var wEps=2*AscCommon.global_mouseEvent.KoefPixToMM,hEps=2*AscCommon.global_mouseEvent.KoefPixToMM;var cursor,x1,x2,y1,y2,isResize;var col=-1,row=-1; var oFormulaRangeIn=range.intersectionSimple(vr);if(oFormulaRangeIn){x1=this._getColLeft(oFormulaRangeIn.c1)-offsetX;x2=this._getColLeft(oFormulaRangeIn.c2+1)-offsetX;y1=this._getRowTop(oFormulaRangeIn.r1)-offsetY;y2=this._getRowTop(oFormulaRangeIn.r2+1)-offsetY;isResize=AscCommonExcel.selectionLineType.Resize&rangeType;if(isResize&&this._hitResizeCorner(x1-1,y1-1,x,y)){cursor=kCurSEResize;col=range.c2;row=range.r2}else if(isResize&&this._hitResizeCorner(x2,y1-1,x,y)){cursor=kCurNEResize;col=range.c1; row=range.r2}else if(isResize&&this._hitResizeCorner(x1-1,y2,x,y)){cursor=kCurNEResize;col=range.c2;row=range.r1}else if(this._hitResizeCorner(x2,y2,x,y)){cursor=kCurSEResize;col=range.c1;row=range.r1}else if((range.c1===oFormulaRangeIn.c1&&Math.abs(x-x1)<=wEps||range.c2===oFormulaRangeIn.c2&&Math.abs(x-x2)<=wEps)&&hEps<=y-y1&&y-y2<=hEps||(range.r1===oFormulaRangeIn.r1&&Math.abs(y-y1)<=hEps||range.r2===oFormulaRangeIn.r2&&Math.abs(y-y2)<=hEps)&&wEps<=x-x1&&x-x2<=wEps)cursor=kCurMove}return cursor? {cursor:cursor,col:col,row:row}:null};WorksheetView.prototype._hitCursorSelectionRange=function(vr,x,y,offsetX,offsetY){var res=this._hitInRange(this.model.getSelection().getLast(),AscCommonExcel.selectionLineType.Selection|AscCommonExcel.selectionLineType.ActiveCell|AscCommonExcel.selectionLineType.Promote,vr,x,y,offsetX,offsetY);return res?{cursor:kCurMove===res.cursor?kCurMove:kCurFillHandle,target:kCurMove===res.cursor?c_oTargetType.MoveRange:c_oTargetType.FillHandle,col:-1,row:-1}:null};WorksheetView.prototype._hitCursorFormulaOrChart= function(vr,x,y,offsetX,offsetY){if(!this.oOtherRanges)return null;var i,l,res;var oFormulaRange;var arrRanges=this.oOtherRanges.ranges;for(i=0,l=arrRanges.length;i<l;++i){oFormulaRange=arrRanges[i];res=!oFormulaRange.isName&&this._hitInRange(oFormulaRange,AscCommonExcel.selectionLineType.Resize,vr,x,y,offsetX,offsetY);if(res)break}return res?{cursor:res.cursor,target:c_oTargetType.MoveResizeRange,col:res.col,row:res.row,indexFormulaRange:i}:null};WorksheetView.prototype._hitCursorTableRightCorner= function(vr,x,y,offsetX,offsetY){var i,l,res,range;var tables=this.model.TableParts;var row,col,baseLw,lnW,baseLnSize,lnSize,kF,x1,x2,y1,y2,rangeIn;var zoom=this.getZoom();for(i=0,l=tables.length;i<l;++i){range=new Asc.Range(tables[i].Ref.c2,tables[i].Ref.r2,tables[i].Ref.c2,tables[i].Ref.r2);rangeIn=range.intersectionSimple(vr);if(rangeIn){baseLw=2;lnW=Math.round(baseLw*zoom);kF=lnW/baseLw;baseLnSize=4;lnSize=kF*baseLnSize;row=range.r1;col=range.c1;x2=this._getColLeft(col+1)-offsetX;y2=this._getRowTop(row+ 1)-offsetY;x1=x2-lnSize;y1=y2-lnSize;if(x>=x1&&x<=x2&&y>=y1&&y<=y2){res=true;break}}}return res?{cursor:kCurSEResize,target:c_oTargetType.FillHandle,col:col,row:row,tableIndex:i}:null};WorksheetView.prototype._hitCursorTableSelectionChange=function(vr,x,y,row,col,offsetX,offsetY){var i,l,res,range,t=this;var tables=this.model.TableParts;var _checkPos=function(_r1,_c1,isRow,isCol){var x1=t._getColLeft(_c1)-offsetX;var y1=t._getRowTop(_r1)-offsetY;var x2=t._getColLeft(_c1+1)-offsetX;var y2=t._getRowTop(_r1+ 1)-offsetY;var height=y2-y1;var width=x2-x1;var _x2,_y2;var maxChangeSelectionHeight=27;var maxChangeSelectionWidth=24;var percentOfWidth=.25;var percentOfHeight=.3;if(isRow){var tableSelectionHeight=height*percentOfHeight;if(tableSelectionHeight>maxChangeSelectionHeight)tableSelectionHeight=maxChangeSelectionHeight;_y2=y1+tableSelectionHeight;if(y>=y1&&y<=_y2)return true}if(isCol){var tableSelectionWidth=width*percentOfWidth;if(tableSelectionWidth>maxChangeSelectionWidth)tableSelectionWidth=maxChangeSelectionWidth; _x2=x1+tableSelectionWidth;if(x>=x1&&x<=_x2)return true}return false};var type,cursor;for(i=0,l=tables.length;i<l;++i){var _ref=tables[i].Ref;var onRow=null,onCol=null;range=new Asc.Range(_ref.c1,_ref.r1,_ref.c1,_ref.r2);if(range.contains(col,row))if(_checkPos(row,col,null,true))onRow=true;range=new Asc.Range(_ref.c1,_ref.r1,_ref.c2,_ref.r1);if(range.contains(col,row))if(_checkPos(row,col,true))onCol=true;if(onCol&&onRow){res=true;type=c_oAscChangeSelectionFormatTable.data;cursor="select-table-content"; break}else if(onCol){res=true;type=c_oAscChangeSelectionFormatTable.dataColumn;cursor="select-table-column";break}else if(onRow){res=true;type=c_oAscChangeSelectionFormatTable.row;cursor="select-table-row";break}}return res?{cursor:cursor,target:c_oTargetType.TableSelectionChange,type:type,row:row,col:col,tableIndex:i}:null};WorksheetView.prototype.getCursorTypeFromXY=function(x,y){var canEdit=this.workbook.canEdit();var viewMode=this.handlers.trigger("getViewMode");this.handlers.trigger("checkLastWork"); var res,c,r,f,offsetX,offsetY,cellCursor;var sheetId=this.model.getId(),userId,lockRangePosLeft,lockRangePosTop,lockInfo,oHyperlink;var widthDiff=0,heightDiff=0,isLocked=false,target=c_oTargetType.Cells,row=-1,col=-1,isSelGraphicObject,isNotFirst;var dialogOtherRanges=this.getDialogOtherRanges();var readyMode=!(this.getSelectionDialogMode()||this.getCellEditMode());if(readyMode){var frozenCursor=this._isFrozenAnchor(x,y);if(canEdit&&frozenCursor.result){lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null,sheetId,AscCommonExcel.c_oAscLockNameFrozenPane);isLocked=this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,false);if(false!==isLocked){var frozenCell=this.topLeftFrozenCell?this.topLeftFrozenCell:new AscCommon.CellAddress(0,0,0);userId=isLocked.UserId;lockRangePosLeft=this._getColLeft(frozenCell.getCol0());lockRangePosTop=this._getRowTop(frozenCell.getRow0())}return{cursor:frozenCursor.cursor,target:frozenCursor.name,col:-1,row:-1,userId:userId,lockRangePosLeft:lockRangePosLeft, lockRangePosTop:lockRangePosTop}}var drawingInfo=this.objectRender.checkCursorDrawingObject(x,y);if(asc["editor"].isStartAddShape&&AscCommonExcel.CheckIdSatetShapeAdd(this.objectRender.controller.curState))return{cursor:kCurFillHandle,target:c_oTargetType.Shape,col:-1,row:-1};if(drawingInfo&&drawingInfo.id){lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,sheetId,drawingInfo.id);isLocked=this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther, false);if(false!==isLocked){userId=isLocked.UserId;lockRangePosLeft=drawingInfo.object.getVisibleLeftOffset(true);lockRangePosTop=drawingInfo.object.getVisibleTopOffset(true)}if(drawingInfo.hyperlink instanceof ParaHyperlink){oHyperlink=new AscCommonExcel.Hyperlink;oHyperlink.Tooltip=drawingInfo.hyperlink.ToolTip;var spl=drawingInfo.hyperlink.Value.split("!");if(spl.length===2)oHyperlink.setLocation(drawingInfo.hyperlink.Value);else oHyperlink.Hyperlink=drawingInfo.hyperlink.Value;cellCursor={cursor:drawingInfo.cursor, target:c_oTargetType.Cells,col:-1,row:-1,userId:userId};return{cursor:kCurHyperlink,target:c_oTargetType.Hyperlink,hyperlink:new asc_CHyperlink(oHyperlink),cellCursor:cellCursor,userId:userId}}return{cursor:drawingInfo.cursor,tooltip:drawingInfo.tooltip,target:c_oTargetType.Shape,drawingId:drawingInfo.id,col:-1,row:-1,userId:userId,lockRangePosLeft:lockRangePosLeft,lockRangePosTop:lockRangePosTop}}}var oResDefault={cursor:kCurDefault,target:c_oTargetType.None,col:-1,row:-1};if(x>=this.headersLeft&& x<this.cellsLeft&&y<this.cellsTop&&y>=this.headersTop)return{cursor:kCurCorner,target:c_oTargetType.Corner,col:-1,row:-1};var cFrozen=-1,rFrozen=-1;offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft;offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop;if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0();rFrozen=this.topLeftFrozenCell.getRow0();widthDiff=this._getColLeft(cFrozen)-this._getColLeft(0);heightDiff=this._getRowTop(rFrozen)-this._getRowTop(0);offsetX=x<this.cellsLeft+ widthDiff?0:offsetX-widthDiff;offsetY=y<this.cellsTop+heightDiff?0:offsetY-heightDiff}if(readyMode&&x<=this.cellsLeft&&this.groupWidth&&x<this.groupWidth){if(y>this.groupHeight+this.headersHeight)r=this._findRowUnderCursor(y,true);row=-1;if(r)row=r.row+(isNotFirst&&f&&y<r.top+3?-1:0);return{cursor:kCurDefault,target:c_oTargetType.GroupRow,col:-1,row:row,mouseY:r?(y<r.top+3?r.top:r.bottom)-y-1:null}}if(readyMode&&y<=this.cellsTop&&this.groupHeight&&y<this.groupHeight){c=null;if(x>this.groupWidth+this.headersWidth)c= this._findColUnderCursor(x,true);col=-1;if(c)col=c.col+(isNotFirst&&f&&x<c.left+3?-1:0);return{cursor:kCurDefault,target:c_oTargetType.GroupCol,col:col,row:-1,mouseX:c?(x<c.left+3?c.left:c.right)-x-1:null}}var epsChangeSize=3*AscCommon.global_mouseEvent.KoefPixToMM;if(x<=this.cellsLeft&&y>=this.cellsTop){r=this._findRowUnderCursor(y,true);if(r===null)return oResDefault;isNotFirst=r.row!==(-1!==rFrozen?0:this.visibleRange.r1);f=(canEdit||viewMode)&&(isNotFirst&&y<r.top+epsChangeSize||y>=r.bottom-epsChangeSize)&& readyMode;return{cursor:f?kCurRowResize:kCurRowSelect,target:f?c_oTargetType.RowResize:c_oTargetType.RowHeader,col:-1,row:r.row+(isNotFirst&&f&&y<r.top+3?-1:0),mouseY:f?(y<r.top+3?r.top:r.bottom)-y-1:null}}if(y<=this.cellsTop&&x>=this.cellsLeft){c=this._findColUnderCursor(x,true);if(c===null)return oResDefault;isNotFirst=c.col!==(-1!==cFrozen?0:this.visibleRange.c1);f=(canEdit||viewMode)&&(isNotFirst&&x<c.left+epsChangeSize||x>=c.right-epsChangeSize)&&readyMode;return{cursor:f?kCurColResize:kCurColSelect, target:f?c_oTargetType.ColumnResize:c_oTargetType.ColumnHeader,col:c.col+(isNotFirst&&f&&x<c.left+3?-1:0),row:-1,mouseX:f?(x<c.left+3?c.left:c.right)-x-1:null}}if(this.workbook.formatPainterState){if(x<=this.cellsLeft&&y>=this.cellsTop){r=this._findRowUnderCursor(y,true);if(r!==null){target=c_oTargetType.RowHeader;row=r.row}}if(y<=this.cellsTop&&x>=this.cellsLeft){c=this._findColUnderCursor(x,true);if(c!==null){target=c_oTargetType.ColumnHeader;col=c.col}}return{cursor:kCurFormatPainterExcel,target:target, col:col,row:row}}if(dialogOtherRanges&&(this.getFormulaEditMode()||this.isChartAreaEditMode)){this._drawElements(function(_vr,_offsetX,_offsetY){return null===(res=this._hitCursorFormulaOrChart(_vr,x,y,_offsetX,_offsetY))});if(res)return res}isSelGraphicObject=this.objectRender.selectedGraphicObjectsExists();if(dialogOtherRanges&&canEdit&&!isSelGraphicObject&&this.model.getSelection().isSingleRange()){this._drawElements(function(_vr,_offsetX,_offsetY){return null===(res=this._hitCursorSelectionRange(_vr, x,y,_offsetX,_offsetY))});if(res)return res}if(readyMode){this._drawElements(function(_vr,_offsetX,_offsetY){return null===(res=this._hitCursorTableRightCorner(_vr,x,y,_offsetX,_offsetY))});if(res)return res;this._drawElements(function(_vr,_offsetX,_offsetY){if(r===undefined)r=this._findRowUnderCursor(y,true);if(c===undefined)c=this._findColUnderCursor(x,true);if(r!=null&&c!=null)return null===(res=this._hitCursorTableSelectionChange(_vr,x,y,r.row,c.col,_offsetX,_offsetY))});if(res)return res}if(x> this.cellsLeft&&y>this.cellsTop){c=this._findColUnderCursor(x,true);r=this._findRowUnderCursor(y,true);if(c===null||r===null)return oResDefault;var lockRange=undefined;var lockAllPosLeft=undefined;var lockAllPosTop=undefined;var userIdAllProps=undefined;var userIdAllSheet=undefined;if(canEdit&&this.collaborativeEditing.getCollaborativeEditing()&&readyMode){var c1Recalc=null,r1Recalc=null;var selectRangeRecalc=new asc_Range(c.col,r.row,c.col,r.row);var isIntersection=this._recalcRangeByInsertRowsAndColumns(sheetId, selectRangeRecalc);if(false===isIntersection){lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Range,null,sheetId,new AscCommonExcel.asc_CCollaborativeRange(selectRangeRecalc.c1,selectRangeRecalc.r1,selectRangeRecalc.c2,selectRangeRecalc.r2));isLocked=this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,false);if(false!==isLocked){userId=isLocked.UserId;lockRange=isLocked.Element["rangeOrObjectId"];c1Recalc=this.collaborativeEditing.m_oRecalcIndexColumns[sheetId].getLockOther(lockRange["c1"], c_oAscLockTypes.kLockTypeOther);r1Recalc=this.collaborativeEditing.m_oRecalcIndexRows[sheetId].getLockOther(lockRange["r1"],c_oAscLockTypes.kLockTypeOther);if(null!==c1Recalc&&null!==r1Recalc){lockRangePosLeft=this._getColLeft(c1Recalc);lockRangePosTop=this._getRowTop(r1Recalc);lockRangePosLeft-=offsetX;lockRangePosTop-=offsetY;lockRangePosLeft=this.cellsLeft>lockRangePosLeft?this.cellsLeft:lockRangePosLeft;lockRangePosTop=this.cellsTop>lockRangePosTop?this.cellsTop:lockRangePosTop}}}else lockInfo= this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Range,null,sheetId,null);lockInfo["type"]=c_oAscLockTypeElem.Sheet;isLocked=this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,true);if(false!==isLocked)userIdAllSheet=isLocked.UserId;if(undefined===userIdAllSheet){lockInfo["type"]=c_oAscLockTypeElem.Range;lockInfo["subType"]=c_oAscLockTypeElemSubType.InsertRows;isLocked=this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther, true);if(false!==isLocked)userIdAllProps=isLocked.UserId}}if(canEdit&&readyMode){var pivotButtons=this.model.getPivotTableButtons(new asc_Range(c.col,r.row,c.col,r.row));var pivotButton=pivotButtons.find(function(element){return element.row===r.row&&element.col===c.col});var activeCell=this.model.getSelection().activeCell;var dataValidation=this.model.getDataValidation(activeCell.col,activeCell.row);var isDataValidation=dataValidation&&dataValidation.isListValues();var isTableTotal=this.model.isTableTotal(activeCell.col, activeCell.row);col=activeCell.col;row=activeCell.row;this._drawElements(function(_vr,_offsetX,_offsetY){res=null;var _isDataValidation=false;var _isPivot=false;var _isTableTotal=false;if(_vr.contains(c.col,r.row)){_offsetX+=x;_offsetY+=y;if(isDataValidation)_isDataValidation=this._hitCursorFilterButton(_offsetX,_offsetY,col,row,true);else if(pivotButton)_isPivot=this._hitCursorFilterButton(_offsetX,_offsetY,c.col,r.row);else if(isTableTotal)_isTableTotal=this._hitCursorFilterButton(_offsetX,_offsetY, col,row,true);if(_isDataValidation||_isPivot)res={cursor:kCurAutoFilter,target:c_oTargetType.FilterObject,col:c.col,row:r.row,idPivot:pivotButton&&pivotButton.idPivot,isDataValidation:_isDataValidation};else if(_isTableTotal)res={cursor:kCurAutoFilter,target:c_oTargetType.FilterObject,col:c.col,row:r.row,idTableTotal:{id:isTableTotal.index,colId:isTableTotal.colIndex}};else if(!pivotButton)res=this.af_checkCursor(_offsetX,_offsetY,r.row,c.col)}return null===res});if(res)return res}var comment=readyMode&& this.cellCommentator.getComment(c.col,r.row,true);var coords=null;var indexes=null;if(comment){indexes=[comment.asc_getId()];coords=this.cellCommentator.getCommentTooltipPosition(comment)}oHyperlink=readyMode&&this.model.getHyperlinkByCell(r.row,c.col);cellCursor={cursor:AscCommonExcel.kCurCells,target:c_oTargetType.Cells,col:c?c.col:-1,row:r?r.row:-1,userId:userId,lockRangePosLeft:lockRangePosLeft,lockRangePosTop:lockRangePosTop,userIdAllProps:userIdAllProps,lockAllPosLeft:lockAllPosLeft,lockAllPosTop:lockAllPosTop, userIdAllSheet:userIdAllSheet,commentIndexes:indexes,commentCoords:coords};if(!oHyperlink){var formulaParsed;this.model.getCell3(r.row,c.col)._foreachNoEmpty(function(cell){if(cell.isFormula())formulaParsed=cell.getFormulaParsed()});if(formulaParsed){var formulaHyperlink=formulaParsed.getFormulaHyperlink();if(formulaHyperlink){if(null===formulaParsed.value)formulaParsed.calculate();if(formulaParsed.value&&formulaParsed.value.hyperlink){oHyperlink=new AscCommonExcel.Hyperlink;oHyperlink.Hyperlink= formulaParsed.value.hyperlink}else if(formulaParsed.value&&AscCommonExcel.cElementType.array===formulaParsed.value.type){var firstArrayElem=formulaParsed.value.getElementRowCol(0,0);if(firstArrayElem&&firstArrayElem.hyperlink){oHyperlink=new AscCommonExcel.Hyperlink;oHyperlink.Hyperlink=firstArrayElem.hyperlink}}}}}if(oHyperlink)return{cursor:kCurHyperlink,target:c_oTargetType.Hyperlink,hyperlink:new asc_CHyperlink(oHyperlink),cellCursor:cellCursor,userId:userId,lockRangePosLeft:lockRangePosLeft, lockRangePosTop:lockRangePosTop,userIdAllProps:userIdAllProps,userIdAllSheet:userIdAllSheet,lockAllPosLeft:lockAllPosLeft,lockAllPosTop:lockAllPosTop,commentIndexes:indexes,commentCoords:coords};return cellCursor}return oResDefault};WorksheetView.prototype._fixSelectionOfMergedCells=function(fixedRange,onlyCells){var selection;var ar=fixedRange?fixedRange:(selection=this._getSelection())?selection.getLast():null;if(!ar||onlyCells&&c_oAscSelectionType.RangeCells!==ar.getType()&&!this.getFormulaEditMode())return; var res=this.model.expandRangeByMerged(ar.clone(true));if(ar.c1!==res.c1&&ar.c1!==res.c2)ar.c1=ar.c1<=ar.c2?res.c1:res.c2;ar.c2=ar.c1===res.c1?res.c2:res.c1;if(ar.r1!==res.r1&&ar.r1!==res.r2)ar.r1=ar.r1<=ar.r2?res.r1:res.r2;ar.r2=ar.r1===res.r1?res.r2:res.r1;ar.normalize();if(!fixedRange)selection.update()};WorksheetView.prototype._findVisibleCol=function(from,dc,flag){var to=dc<0?-1:this.nColsCount,c;for(c=from;c!==to;c+=dc)if(0<this._getColumnWidth(c))return c;return flag?-1:this._findVisibleCol(from, dc*-1,true)};WorksheetView.prototype._findVisibleRow=function(from,dr,flag){var to=dr<0?-1:this.nRowsCount,r;for(r=from;r!==to;r+=dr)if(0<this._getRowHeight(r))return r;return flag?-1:this._findVisibleRow(from,dr*-1,true)};WorksheetView.prototype._fixSelectionOfHiddenCells=function(dc,dr,range){var ar=range?range:this.model.selectionRange.getLast(),c1,c2,r1,r2,mc,i,arn=ar.clone(true);if(dc===undefined)dc=+1;if(dr===undefined)dr=+1;if(ar.c2===ar.c1){if(0===this._getColumnWidth(ar.c1))c1=c2=this._findVisibleCol(ar.c1, dc)}else if(0!==dc&&this.nColsCount>ar.c2&&0===this._getColumnWidth(ar.c2)){for(mc=null,i=arn.r1;i<=arn.r2;++i){mc=this.model.getMergedByCell(i,ar.c2);if(mc)break}if(!mc)c2=this._findVisibleCol(ar.c2,dc)}if(c1<0||c2<0)throw"Error: all columns are hidden";if(ar.r2===ar.r1){if(0===this._getRowHeight(ar.r1))r1=r2=this._findVisibleRow(ar.r1,dr)}else if(0!==dr&&this.nRowsCount>ar.r2&&0===this._getRowHeight(ar.r2)){for(mc=null,i=arn.c1;i<=arn.c2;++i){mc=this.model.getMergedByCell(ar.r2,i);if(mc)break}if(!mc)r2= this._findVisibleRow(ar.r2,dr)}if(r1<0||r2<0)throw"Error: all rows are hidden";ar.assign(c1!==undefined?c1:ar.c1,r1!==undefined?r1:ar.r1,c2!==undefined?c2:ar.c2,r2!==undefined?r2:ar.r2)};WorksheetView.prototype._getRangeByXY=function(x,y){var c1,r1,c2,r2;if(x<this.cellsLeft&&y<this.cellsTop){c1=r1=0;c2=gc_nMaxCol0;r2=gc_nMaxRow0}else if(x<this.cellsLeft){r1=r2=this._findRowUnderCursor(y).row;c1=0;c2=gc_nMaxCol0}else if(y<this.cellsTop){c1=c2=this._findColUnderCursor(x).col;r1=0;r2=gc_nMaxRow0}else{c1= c2=this._findColUnderCursor(x).col;r1=r2=this._findRowUnderCursor(y).row}return new asc_Range(c1,r1,c2,r2)};WorksheetView.prototype._moveActiveCellToXY=function(x,y){var selection=this._getSelection();var ar=selection.getLast();var range=this._getRangeByXY(x,y);ar.assign(range.c1,range.r1,range.c2,range.r2);var r=range.r1,c=range.c1;switch(ar.getType()){case c_oAscSelectionType.RangeCol:r=this.visibleRange.r1;break;case c_oAscSelectionType.RangeRow:c=this.visibleRange.c1;break;case c_oAscSelectionType.RangeMax:r= this.visibleRange.r1;c=this.visibleRange.c1;break}selection.setActiveCell(r,c);var valid=!this.getFormulaEditMode()&&selection.validActiveCell();this._fixSelectionOfMergedCells(null,valid)};WorksheetView.prototype._moveActiveCellToOffset=function(activeCell,dc,dr){var ar=this._getSelection().getLast();var mc=this.model.getMergedByCell(activeCell.row,activeCell.col);var c=mc?dc<0?mc.c1:dc>0?Math.min(mc.c2,this.nColsCount-1-dc):activeCell.col:activeCell.col;var r=mc?dr<0?mc.r1:dr>0?Math.min(mc.r2,this.nRowsCount- 1-dr):activeCell.row:activeCell.row;var p=this._calcCellPosition(c,r,dc,dr);ar.assign(p.col,p.row,p.col,p.row);this.model.selectionRange.setActiveCell(p.row,p.col);this._fixSelectionOfHiddenCells(dc>=0?+1:-1,dr>=0?+1:-1);this._fixSelectionOfMergedCells()};WorksheetView.prototype._moveActivePointInSelection=function(dc,dr){var t=this,cell=this.model.selectionRange.activeCell;if(0===this._getColumnWidth(cell.col)||0===this._getRowHeight(cell.row))return;return this.model.selectionRange.offsetCell(dr, dc,true,function(row,col){return 0===(0<=row?t._getRowHeight(row):t._getColumnWidth(col))})};WorksheetView.prototype._calcSelectionEndPointByXY=function(x,y,keepType){var activeCell=this._getSelection().activeCell;var range=this._getRangeByXY(x,y);var selection=this._getSelection().clone();var res=keepType?selection.getLast():range.clone();var type=res.getType();if(c_oAscSelectionType.RangeRow===type){res.r1=Math.min(range.r1,activeCell.row);res.r2=Math.max(range.r1,activeCell.row)}else if(c_oAscSelectionType.RangeCol=== type){res.c1=Math.min(range.c1,activeCell.col);res.c2=Math.max(range.c1,activeCell.col)}else if(c_oAscSelectionType.RangeCells===type)res.assign(activeCell.col,activeCell.row,range.c1,range.r1,true);selection.getLast().assign2(res);this._fixSelectionOfMergedCells(res,selection.validActiveCell());return res};WorksheetView.prototype._calcSelectionEndPointByOffset=function(dc,dr){var selection=this._getSelection();var ar=selection.getLast();var c1,r1,c2,r2,tmp;tmp=asc.getEndValueRange(dc,selection.activeCell.col, ar.c1,ar.c2);c1=tmp.x1;c2=tmp.x2;tmp=asc.getEndValueRange(dr,selection.activeCell.row,ar.r1,ar.r2);r1=tmp.x1;r2=tmp.x2;var p1=this._calcCellPosition(c2,r2,dc,dr),p2;var res=new asc_Range(c1,r1,c2=p1.col,r2=p1.row,true);dc=Math.sign(dc);dr=Math.sign(dr);this._fixSelectionOfMergedCells(res);while(ar.isEqual(res)){p2=this._calcCellPosition(c2,r2,dc,dr);res.assign(c1,r1,c2=p2.col,r2=p2.row,true);this._fixSelectionOfMergedCells(res);if(p1.c2===p2.c2&&p1.r2===p2.r2)break;p1=p2}var bIsHidden=false;if(0!== dc&&0===this._getColumnWidth(c2)){c2=this._findVisibleCol(c2,dc);bIsHidden=true}if(0!==dr&&0===this._getRowHeight(r2)){r2=this._findVisibleRow(r2,dr);bIsHidden=true}if(bIsHidden)res.assign(c1,r1,c2,r2,true);return res};WorksheetView.prototype._calcActiveRangeOffsetIsCoord=function(x,y){var ar=this._getSelection().getLast();if(this.getFormulaEditMode())if(ar.c2>=this.nColsCount||ar.r2>=this.nRowsCount){ar=ar.clone(true);ar.c2=ar.c2>=this.nColsCount?this.nColsCount-1:ar.c2;ar.r2=ar.r2>=this.nRowsCount? this.nRowsCount-1:ar.r2}var d=new AscCommon.CellBase(0,0);if(y<=this.cellsTop+2)d.row=-1;else if(y>=this.drawingCtx.getHeight()-2)d.row=1;if(x<=this.cellsLeft+2)d.col=-1;else if(x>=this.drawingCtx.getWidth()-2)d.col=1;var type=ar.getType();if(type===c_oAscSelectionType.RangeRow)d.col=0;else if(type===c_oAscSelectionType.RangeCol)d.row=0;else if(type===c_oAscSelectionType.RangeMax){d.col=0;d.row=0}return d};WorksheetView.prototype._calcRangeOffset=function(range){var vr=this.visibleRange;var ar=range|| this._getSelection().getLast();if(this.getFormulaEditMode())if(ar.c2>=this.nColsCount||ar.r2>=this.nRowsCount){ar=ar.clone(true);ar.c2=ar.c2>=this.nColsCount?this.nColsCount-1:ar.c2;ar.r2=ar.r2>=this.nRowsCount?this.nRowsCount-1:ar.r2}var arn=ar.clone(true);var isMC=this._isMergedCells(arn);var adjustRight=ar.c2>=vr.c2||ar.c1>=vr.c2&&isMC;var adjustBottom=ar.r2>=vr.r2||ar.r1>=vr.r2&&isMC;var incX=ar.c1<vr.c1&&isMC?arn.c1-vr.c1:ar.c2<vr.c1?ar.c2-vr.c1:0;var incY=ar.r1<vr.r1&&isMC?arn.r1-vr.r1:ar.r2< vr.r1?ar.r2-vr.r1:0;var type=ar.getType();var offsetFrozen=this.getFrozenPaneOffset();if(adjustRight)while(this._isColDrawnPartially(isMC?arn.c2:ar.c2,vr.c1+incX,offsetFrozen.offsetX))++incX;if(adjustBottom)while(this._isRowDrawnPartially(isMC?arn.r2:ar.r2,vr.r1+incY,offsetFrozen.offsetY))++incY;return new AscCommon.CellBase(type===c_oAscSelectionType.RangeRow||type===c_oAscSelectionType.RangeCells?incY:0,type===c_oAscSelectionType.RangeCol||type===c_oAscSelectionType.RangeCells?incX:0)};WorksheetView.prototype._scrollToRange= function(range){if(window["IS_NATIVE_EDITOR"])return null;var vr=this.visibleRange;var nRowsCount=this.nRowsCount;var nColsCount=this.nColsCount;var ar=range||this._getSelection().getLast();if(this.getFormulaEditMode())if(ar.c2>=this.nColsCount||ar.r2>=this.nRowsCount){ar=ar.clone(true);ar.c2=ar.c2>=this.nColsCount?this.nColsCount-1:ar.c2;ar.r2=ar.r2>=this.nRowsCount?this.nRowsCount-1:ar.r2}var arn=ar.clone(true);var scroll=0;if(arn.r1<vr.r1)scroll=arn.r1-vr.r1;else if(arn.r1>=vr.r2){this.nRowsCount= arn.r2+1+1;scroll=this.getVerticalScrollRange();if(scroll>arn.r1)scroll=arn.r1;scroll-=vr.r1-(this.topLeftFrozenCell?this.topLeftFrozenCell.getRow0():0);this.nRowsCount=nRowsCount}if(scroll){this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollVertical;this.scrollVertical(scroll,null,true)}scroll=0;if(arn.c1<vr.c1)scroll=arn.c1-vr.c1;else if(arn.c1>=vr.c2){this.nColsCount=arn.c2+1+1;scroll=this.getHorizontalScrollRange();if(scroll>arn.c1)scroll=arn.c1;scroll-=vr.c1-(this.topLeftFrozenCell?this.topLeftFrozenCell.getCol0(): 0);this.nColsCount=nColsCount}if(scroll){this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollHorizontal;this.scrollHorizontal(scroll,null,true)}return null};WorksheetView.prototype._calcActiveCellOffset=function(range){var vr=this.visibleRange;var activeCell=this.model.selectionRange.activeCell;var ar=range?range:this.model.selectionRange.getLast();var mc=this.model.getMergedByCell(activeCell.row,activeCell.col);var startCol=mc?mc.c1:activeCell.col;var startRow=mc?mc.r1:activeCell.row;var incX= startCol<vr.c1?startCol-vr.c1:0;var incY=startRow<vr.r1?startRow-vr.r1:0;var type=ar.getType();var offsetFrozen=this.getFrozenPaneOffset();if(startCol>=vr.c2)while(this._isColDrawnPartially(startCol,vr.c1+incX,offsetFrozen.offsetX))++incX;if(startRow>=vr.r2)while(this._isRowDrawnPartially(startRow,vr.r1+incY,offsetFrozen.offsetY))++incY;return new AscCommon.CellBase(type===c_oAscSelectionType.RangeRow||type===c_oAscSelectionType.RangeCells?incY:0,type===c_oAscSelectionType.RangeCol||type===c_oAscSelectionType.RangeCells? incX:0)};WorksheetView.prototype.getSelectionMergeInfo=function(options){var t=this;var arn=this.model.selectionRange.getLast().clone(true);var range=this.model.getRange3(arn.r1,arn.c1,arn.r2,arn.c2);var lastRow=-1,res;if(this.cellCommentator.isMissComments(arn))return true;switch(options){case c_oAscMergeOptions.Merge:case c_oAscMergeOptions.MergeCenter:res=range._foreachNoEmptyByCol(function(cell){if(false===t._isCellNullText(cell)){if(-1!==lastRow)return true;lastRow=cell.nRow}});break;case c_oAscMergeOptions.MergeAcross:res= range._foreachNoEmpty(function(cell){if(false===t._isCellNullText(cell)){if(lastRow===cell.nRow)return true;lastRow=cell.nRow}});break}return!!res};WorksheetView.prototype.getSelectionSortInfo=function(){var arn=this.model.selectionRange.getLast().clone(true);var bResult=false;if(this.model.autoFilters._isTablePartsContainsRange(arn)||this.model.inPivotTable(arn))bResult=null;else if(!arn.isOneCell()){var cell=this.model.getRange3(arn.r1,arn.c1,arn.r2,arn.c2);var isMerged=cell.hasMerged();if(isMerged&& isMerged.isEqual(arn))return false;var colCount=arn.c2-arn.c1+1;var rowCount=arn.r2-arn.r1+1;if(colCount>1&&rowCount>1)bResult=null;else{var activeCell=this.model.selectionRange.activeCell;var activeCellRange=new Asc.Range(activeCell.col,activeCell.row,activeCell.col,activeCell.row);var expandRange=this.model.autoFilters.expandRange(activeCellRange,true);expandRange=this.model.autoFilters.checkExpandRangeForSort(expandRange);if(arn.isEqual(expandRange)||activeCellRange.isEqual(expandRange))bResult= null;else if(arn.c1===expandRange.c1&&arn.c2===expandRange.c2)bResult=null;else bResult=true}}return bResult};WorksheetView.prototype.getSelectionMathInfo=function(){var oSelectionMathInfo=new asc_CSelectionMathInfo;var sum=0;var oExistCells={};if(window["NATIVE_EDITOR_ENJINE"]||this.getSelectionDialogMode())return oSelectionMathInfo;var t=this;this.model.selectionRange.ranges.forEach(function(item){var cellValue;var range=t.model.getRange3(item.r1,item.c1,item.r2,item.c2);range._setPropertyNoEmpty(null, null,function(cell,r){var idCell=cell.nCol+"-"+cell.nRow;if(!oExistCells[idCell]&&!cell.isNullTextString()&&0<t._getRowHeight(r)){oExistCells[idCell]=true;++oSelectionMathInfo.count;if(CellValueType.Number===cell.getType()){cellValue=cell.getNumberValue();if(0===oSelectionMathInfo.countNumbers)oSelectionMathInfo.min=oSelectionMathInfo.max=cellValue;else{oSelectionMathInfo.min=Math.min(oSelectionMathInfo.min,cellValue);oSelectionMathInfo.max=Math.max(oSelectionMathInfo.max,cellValue)}++oSelectionMathInfo.countNumbers; sum+=cellValue}}})});if(1<oSelectionMathInfo.count&&0<oSelectionMathInfo.countNumbers){var activeCell=this.model.selectionRange.activeCell;var numFormat=this.model.getRange3(activeCell.row,activeCell.col,activeCell.row,activeCell.col).getNumFormat();if(Asc.c_oAscNumFormatType.Time===numFormat.getType())numFormat=AscCommon.oNumFormatCache.get("[h]:mm:ss");oSelectionMathInfo.sum=numFormat.formatToMathInfo(sum,CellValueType.Number,this.settings.mathMaxDigCount);oSelectionMathInfo.average=numFormat.formatToMathInfo(sum/ oSelectionMathInfo.countNumbers,CellValueType.Number,this.settings.mathMaxDigCount);oSelectionMathInfo.min=numFormat.formatToMathInfo(oSelectionMathInfo.min,CellValueType.Number,this.settings.mathMaxDigCount);oSelectionMathInfo.max=numFormat.formatToMathInfo(oSelectionMathInfo.max,CellValueType.Number,this.settings.mathMaxDigCount)}return oSelectionMathInfo};WorksheetView.prototype.getSelectionName=function(bRangeText){if(this.isSelectOnShape)return" ";var selection=this.model.selectionRange||this.model.copySelection; var ar=selection.getLast();var cell=selection.activeCell;var mc=this.model.getMergedByCell(cell.row,cell.col);var c1=mc?mc.c1:cell.col,r1=mc?mc.r1:cell.row,ar_norm=ar.normalize(),mc_norm=mc?mc.normalize():null,c2=mc_norm?mc_norm.isEqual(ar_norm)?mc_norm.c1:ar_norm.c2:ar_norm.c2,r2=mc_norm?mc_norm.isEqual(ar_norm)?mc_norm.r1:ar_norm.r2:ar_norm.r2,selectionSize=!bRangeText?"":function(r){var rc=Math.abs(r.r2-r.r1)+1;var cc=Math.abs(r.c2-r.c1)+1;switch(r.getType()){case c_oAscSelectionType.RangeCells:return rc+ "R x "+cc+"C";case c_oAscSelectionType.RangeCol:return cc+"C";case c_oAscSelectionType.RangeRow:return rc+"R";case c_oAscSelectionType.RangeMax:return gc_nMaxRow+"R x "+gc_nMaxCol+"C"}return""}(ar);if(selectionSize)return selectionSize;var dN=new Asc.Range(ar_norm.c1,ar_norm.r1,c2,r2,true);var defName=parserHelp.get3DRef(this.model.getName(),dN.getAbsName());defName=this.model.workbook.findDefinesNames(defName,this.model.getId(),true);if(defName)return defName;return(new Asc.Range(c1,r1,c1,r1)).getName(AscCommonExcel.g_R1C1Mode? AscCommonExcel.referenceType.A:AscCommonExcel.referenceType.R)};WorksheetView.prototype.getSelectionRangeValue=function(absName,addSheet){return this.getSelectionRangeValues(absName,addSheet).join(AscCommon.FormulaSeparators.functionArgumentSeparator)};WorksheetView.prototype.getSelectionRangeValues=function(absName,addSheet){var name,res=[];absName=absName||this.workbook.dialogAbsName;addSheet=addSheet||this.workbook.getDialogSheetName();if(this.model.selectionRange){var ranges=this.model.selectionRange.ranges; for(var i=0;i<ranges.length;++i){name=ranges[i].getName(absName?AscCommonExcel.referenceType.A:AscCommonExcel.referenceType.R);if(addSheet)name=parserHelp.get3DRef(this.model.getName(),name);res.push(name)}}return res};WorksheetView.prototype.getSelectionInfo=function(){return this.objectRender.selectedGraphicObjectsExists()?this._getSelectionInfoObject():this._getSelectionInfoCell()};WorksheetView.prototype._getSelectionInfoCell=function(){var selectionRange=this.model.selectionRange;var cell=selectionRange.activeCell; var mc=this.model.getMergedByCell(cell.row,cell.col);var c1=mc?mc.c1:cell.col;var r1=mc?mc.r1:cell.row;var c=this._getVisibleCell(c1,r1);var cellType=c.getType();var isNumberFormat=!cellType||CellValueType.Number===cellType;var cell_info=new asc_CCellInfo;cell_info.xfs=c.getXfs(false);AscCommonExcel.g_ActiveCell=new Asc.Range(c1,r1,c1,r1);cell_info.text=c.getValueForEdit(true);var tablePartsOptions=selectionRange.isSingleRange()?this.model.autoFilters.searchRangeInTableParts(selectionRange.getLast()): -2;var curTablePart=tablePartsOptions>=0?this.model.TableParts[tablePartsOptions]:null;var tableStyleInfo=curTablePart&&curTablePart.TableStyleInfo?curTablePart.TableStyleInfo:null;cell_info.autoFilterInfo=new asc_CAutoFilterInfo;var pivotTable;if(-2===tablePartsOptions){cell_info.autoFilterInfo.isAutoFilter=null;cell_info.autoFilterInfo.isApplyAutoFilter=false}else if((pivotTable=this.model.inPivotTable(selectionRange.getLast()))&&Asc.CT_pivotTableDefinition.prototype.isClearFilterButtonEnabled){cell_info.autoFilterInfo.isAutoFilter= null;cell_info.autoFilterInfo.isApplyAutoFilter=pivotTable.isClearFilterButtonEnabled()}else{var checkApplyFilterOrSort=this.model.autoFilters.checkApplyFilterOrSort(tablePartsOptions);cell_info.autoFilterInfo.isAutoFilter=checkApplyFilterOrSort.isAutoFilter;cell_info.autoFilterInfo.isApplyAutoFilter=checkApplyFilterOrSort.isFilterColumns;cell_info.autoFilterInfo.isSlicerAdded=checkApplyFilterOrSort.isSlicerAdded}if(curTablePart!==null){cell_info.formatTableInfo=new AscCommonExcel.asc_CFormatTableInfo; cell_info.formatTableInfo.tableName=curTablePart.DisplayName;if(tableStyleInfo){cell_info.formatTableInfo.tableStyleName=tableStyleInfo.Name;cell_info.formatTableInfo.bandVer=tableStyleInfo.ShowColumnStripes;cell_info.formatTableInfo.firstCol=tableStyleInfo.ShowFirstColumn;cell_info.formatTableInfo.lastCol=tableStyleInfo.ShowLastColumn;cell_info.formatTableInfo.bandHor=tableStyleInfo.ShowRowStripes}cell_info.formatTableInfo.lastRow=curTablePart.TotalsRowCount!==null;cell_info.formatTableInfo.firstRow= curTablePart.HeaderRowCount===null;cell_info.formatTableInfo.tableRange=curTablePart.Ref.getAbsName();cell_info.formatTableInfo.filterButton=curTablePart.isShowButton();cell_info.formatTableInfo.altText=curTablePart.altText;cell_info.formatTableInfo.altTextSummary=curTablePart.altTextSummary;this.af_setDisableProps(curTablePart,cell_info.formatTableInfo)}cell_info.styleName=c.getStyleName();cell_info.selectionType=selectionRange.getLast().getType();cell_info.multiselect=!selectionRange.isSingleRange(); cell_info.lockText=""!==cell_info.text&&(isNumberFormat||c.isFormula());var ar=selectionRange.getLast().clone();var range=this.model.getRange3(ar.r1,ar.c1,ar.r2,ar.c2);var hyperlink=range.getHyperlink();var oHyperlink;if(null!==hyperlink){oHyperlink=new asc_CHyperlink(hyperlink);oHyperlink.asc_setText(cell_info.text);cell_info.hyperlink=oHyperlink}else cell_info.hyperlink=null;cell_info.comment=this.cellCommentator.getComment(c1,r1,false);cell_info.merge=range.isOneCell()?Asc.c_oAscMergeOptions.Disabled: null!==range.hasMerged()?Asc.c_oAscMergeOptions.Merge:Asc.c_oAscMergeOptions.None;var sheetId=this.model.getId();var lockInfo;var isIntersection=this._recalcRangeByInsertRowsAndColumns(sheetId,ar);if(false===isIntersection){lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Range,null,sheetId,new AscCommonExcel.asc_CCollaborativeRange(ar.c1,ar.r1,ar.c2,ar.r2));if(false!==this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,false))cell_info.isLocked= true}if(null!==curTablePart){var tableAr=curTablePart.Ref.clone();isIntersection=this._recalcRangeByInsertRowsAndColumns(sheetId,tableAr);if(false===isIntersection){lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Range,null,sheetId,new AscCommonExcel.asc_CCollaborativeRange(tableAr.c1,tableAr.r1,tableAr.c2,tableAr.r2));if(false!==this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,false))cell_info.isLockedTable=true}}cell_info.sparklineInfo=this.model.getSparklineGroup(c1, r1);if(cell_info.sparklineInfo){lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,sheetId,cell_info.sparklineInfo.Get_Id());if(false!==this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,false))cell_info.isLockedSparkline=true}cell_info.pivotTableInfo=this.model.getPivotTable(c1,r1);if(cell_info.pivotTableInfo){lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,sheetId,cell_info.pivotTableInfo.Get_Id());if(false!== this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,false))cell_info.isLockedPivotTable=true}cell_info.dataValidation=this.model.getDataValidation(c1,r1);lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,sheetId,AscCommonExcel.c_oAscHeaderFooterEdit);if(false!==this.collaborativeEditing.getLockIntersection(lockInfo,c_oAscLockTypes.kLockTypeOther,false))cell_info.isLockedHeaderFooter=true;cell_info.selectedColsCount=Math.abs(ar.c2-ar.c1)+ 1;return cell_info};WorksheetView.prototype._getSelectionInfoObject=function(){var objectInfo=new asc_CCellInfo;var xfs=new AscCommonExcel.CellXfs;var horAlign=null,vertAlign=null,angle=null;var graphicObjects=this.objectRender.getSelectedGraphicObjects();if(graphicObjects.length)objectInfo.selectionType=this.objectRender.getGraphicSelectionType(graphicObjects[0].Id);var textPr=this.objectRender.controller.getParagraphTextPr();var theme=this.objectRender.controller.getTheme();if(textPr&&theme&&theme.themeElements&& theme.themeElements.fontScheme)textPr.ReplaceThemeFonts(theme.themeElements.fontScheme);var paraPr=this.objectRender.controller.getParagraphParaPr();if(!paraPr&&textPr)paraPr=new CParaPr;if(textPr&¶Pr){objectInfo.text=this.objectRender.controller.GetSelectedText(true);horAlign=paraPr.Jc;vertAlign=Asc.c_oAscVAlign.Center;var shape_props=this.objectRender.controller.getDrawingProps().shapeProps;if(shape_props){switch(shape_props.verticalTextAlign){case AscFormat.VERTICAL_ANCHOR_TYPE_BOTTOM:vertAlign= Asc.c_oAscVAlign.Bottom;break;case AscFormat.VERTICAL_ANCHOR_TYPE_CENTER:vertAlign=Asc.c_oAscVAlign.Center;break;case AscFormat.VERTICAL_ANCHOR_TYPE_TOP:case AscFormat.VERTICAL_ANCHOR_TYPE_DISTRIBUTED:case AscFormat.VERTICAL_ANCHOR_TYPE_JUSTIFIED:vertAlign=Asc.c_oAscVAlign.Top;break}switch(shape_props.vert){case AscFormat.nVertTTvert:angle=-90;break;case AscFormat.nVertTTvert270:angle=90;break;default:angle=0;break}}if(textPr.Unifill&&theme)textPr.Unifill.check(theme,this.objectRender.controller.getColorMap()); var font=new AscCommonExcel.Font;font.assignFromTextPr(textPr);xfs.setFont(font);var shapeHyperlink=this.objectRender.controller.getHyperlinkInfo();if(shapeHyperlink&&shapeHyperlink instanceof ParaHyperlink){var hyperlink=new AscCommonExcel.Hyperlink;hyperlink.Tooltip=shapeHyperlink.ToolTip;var spl=shapeHyperlink.Value.split("!");if(spl.length===2)hyperlink.setLocation(shapeHyperlink.Value);else hyperlink.Hyperlink=shapeHyperlink.Value;objectInfo.hyperlink=new asc_CHyperlink(hyperlink);objectInfo.hyperlink.asc_setText(shapeHyperlink.GetSelectedText(true, true))}}var align=new AscCommonExcel.Align;align.setAlignHorizontal(horAlign);align.setAlignVertical(vertAlign);align.setAngle(angle);xfs.setAlign(align);objectInfo.xfs=xfs;return objectInfo};WorksheetView.prototype.getActiveCellCoord=function(){var selection=this.model.getSelection();return this.getCellCoord(selection.activeCell.col,selection.activeCell.row)};WorksheetView.prototype.getCellCoord=function(col,row){var offsetX=0,offsetY=0;var vrCol=this.visibleRange.c1,vrRow=this.visibleRange.r1;if(this.topLeftFrozenCell){var offsetFrozen= this.getFrozenPaneOffset();var cFrozen=this.topLeftFrozenCell.getCol0();var rFrozen=this.topLeftFrozenCell.getRow0();if(col>=cFrozen)offsetX=offsetFrozen.offsetX;else vrCol=0;if(row>=rFrozen)offsetY=offsetFrozen.offsetY;else vrRow=0}var xL=this._getColLeft(col);var yL=this._getRowTop(row);xL-=this._getColLeft(vrCol)-this.cellsLeft;yL-=this._getRowTop(vrRow)-this.cellsTop;xL+=offsetX;yL+=offsetY;var width=this._getColumnWidth(col);var height=this._getRowHeight(row);if(AscBrowser.isRetina){xL=AscCommon.AscBrowser.convertToRetinaValue(xL); yL=AscCommon.AscBrowser.convertToRetinaValue(yL);width=AscCommon.AscBrowser.convertToRetinaValue(width);height=AscCommon.AscBrowser.convertToRetinaValue(height)}return new AscCommon.asc_CRect(xL,yL,width,height)};WorksheetView.prototype._endSelectionShape=function(){var isSelectOnShape=this.isSelectOnShape;if(this.isSelectOnShape){this.isSelectOnShape=false;this.objectRender.unselectDrawingObjects();window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Update_Position()}return isSelectOnShape}; WorksheetView.prototype._updateSelectionNameAndInfo=function(){this.handlers.trigger("selectionNameChanged",this.getSelectionName(false));this.handlers.trigger("selectionChanged");this.handlers.trigger("selectionMathInfoChanged",this.getSelectionMathInfo())};WorksheetView.prototype.getSelectionShape=function(){return this.isSelectOnShape};WorksheetView.prototype.setSelectionShape=function(isSelectOnShape){this.isSelectOnShape=isSelectOnShape;this.model.workbook.handlers.trigger("asc_onHideComment"); this._updateSelectionNameAndInfo();window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Update_Position()};WorksheetView.prototype.setSelection=function(range){if(!Array.isArray(range))range=[AscCommonExcel.Range.prototype.createFromBBox(this.model,range)];this.cleanSelection();var bbox,bFirst=true;for(var i=0;i<range.length;++i){bbox=range[i].getBBox0();var type=bbox.getType();if(type===c_oAscSelectionType.RangeCells||type===c_oAscSelectionType.RangeCol||type===c_oAscSelectionType.RangeRow|| type===c_oAscSelectionType.RangeMax){if(bFirst){this.model.selectionRange.clean();bFirst=false}else this.model.selectionRange.addRange();this.model.selectionRange.getLast().assign2(bbox)}}if(!bFirst)this.model.selectionRange.update();this._fixSelectionOfMergedCells();this.updateSelectionWithSparklines();this._updateSelectionNameAndInfo();this._scrollToRange()};WorksheetView.prototype.setActiveCell=function(cell){this.cleanSelection();this.model.selectionRange.setActiveCell(cell.row,cell.col);var valid= !this.getFormulaEditMode()&&this._getSelection().validActiveCell();this._fixSelectionOfMergedCells(null,valid);this.updateSelectionWithSparklines();this._updateSelectionNameAndInfo();this._scrollToRange()};WorksheetView.prototype.changeSelectionStartPoint=function(x,y,isCoord,isCtrl){this.cleanSelection();this.endEditChart();var activeCell=this._getSelection().activeCell.clone();if(isCtrl)this.model.selectionRange.addRange();else this.model.selectionRange.clean();var ret={};var isChangeSelectionShape= false;var comment;if(isCoord){comment=this.cellCommentator.getCommentByXY(x,y,true);this._moveActiveCellToXY(x,y);isChangeSelectionShape=this._endSelectionShape()}else{comment=this.cellCommentator.getComment(x,y,true);this._moveActiveCellToOffset(activeCell,x,y);ret=this._calcRangeOffset()}if(!comment)this.cellCommentator.resetLastSelectedId();if(!isChangeSelectionShape)if(isCoord)this._drawSelection();else this.updateSelectionWithSparklines();if(this.getSelectionDialogMode())this.handlers.trigger("selectionRangeChanged", this.getSelectionRangeValue());else{this.handlers.trigger("selectionNameChanged",this.getSelectionName(false));if(!isCoord){this.handlers.trigger("selectionChanged");this.handlers.trigger("selectionMathInfoChanged",this.getSelectionMathInfo())}}return ret};WorksheetView.prototype.changeSelectionStartPointRightClick=function(x,y,target){var isSelectOnShape=this._endSelectionShape();this.model.workbook.handlers.trigger("asc_onHideComment");var val,c1,c2,r1,r2,range;val=this._findColUnderCursor(x,true); if(val){c1=c2=val.col;if(c_oTargetType.ColumnResize===target&&0<c1&&0===this._getColumnWidth(c1-1))c1=c2=c1-1}else{c1=0;c2=gc_nMaxCol0}val=this._findRowUnderCursor(y,true);if(val){r1=r2=val.row;if(c_oTargetType.RowResize===target&&0<r1&&0===this._getRowHeight(r1-1))r1=r2=r1-1}else{r1=0;r2=gc_nMaxRow0}range=new asc_Range(c1,r1,c2,r2);if(!this.model.selectionRange.containsRange(range)){this.cleanSelection();this.model.selectionRange.clean();this.setSelection(range);this._drawSelection();this._updateSelectionNameAndInfo()}else if(isSelectOnShape)this._updateSelectionNameAndInfo()}; WorksheetView.prototype.changeSelectionEndPoint=function(x,y,isCoord,keepType){var isChangeSelectionShape=isCoord?this._endSelectionShape():false;var ar=this._getSelection().getLast();var newRange=isCoord?this._calcSelectionEndPointByXY(x,y,keepType):this._calcSelectionEndPointByOffset(x,y);var isEqual=newRange.isEqual(ar);if(!isEqual||isChangeSelectionShape){this.cleanSelection();ar.assign2(newRange);this._drawSelection();if(this.getSelectionDialogMode())this.handlers.trigger("selectionRangeChanged", this.getSelectionRangeValue());else{this.handlers.trigger("selectionNameChanged",this.getSelectionName(true));if(!isCoord){this.handlers.trigger("selectionChanged");this.handlers.trigger("selectionMathInfoChanged",this.getSelectionMathInfo())}}}this.model.workbook.handlers.trigger("asc_onHideComment");return isCoord?this._calcActiveRangeOffsetIsCoord(x,y):this._calcRangeOffset()};WorksheetView.prototype.changeSelectionDone=function(){if(this.workbook.formatPainterState)this.applyFormatPainter();else this.checkSelectionSparkline()}; WorksheetView.prototype.changeSelectionActivePoint=function(dc,dr){var ret,res;if(0===dc&&0===dr)return this._calcActiveCellOffset();res=this._moveActivePointInSelection(dc,dr);if(0===res)return this.changeSelectionStartPoint(dc,dr,false,false);else if(-1===res)return null;this.cleanSelection();this.endEditChart();this.updateSelectionWithSparklines();ret=this._calcActiveCellOffset();this.handlers.trigger("selectionNameChanged",this.getSelectionName(false));this.handlers.trigger("selectionChanged"); return ret};WorksheetView.prototype.checkSelectionSparkline=function(){if(!this.getSelectionShape()&&!this.getCellEditMode()){var cell=this.model.selectionRange.activeCell;var mc=this.model.getMergedByCell(cell.row,cell.col);var c1=mc?mc.c1:cell.col;var r1=mc?mc.r1:cell.row;var oSparklineInfo=this.model.getSparklineGroup(c1,r1);if(oSparklineInfo){this.cleanSelection();this.endEditChart();var range=oSparklineInfo.getLocationRanges();range.ranges.forEach(function(item){item.isName=true;item.noColor= true});this.oOtherRanges=range;this._drawSelection();return true}}};WorksheetView.prototype.applyFormatPainter=function(){var t=this;var from=this.workbook.formatPainterRange.getLast(),to=this.model.selectionRange.getLast().clone();var onApplyFormatPainterCallback=function(isSuccess){t.cleanSelection();if(isSuccess)AscCommonExcel.promoteFromTo(from,t.workbook.getFormatPainterSheet(),to,t.model);if(c_oAscFormatPainterState.kMultiple!==t.workbook.formatPainterState)t.handlers.trigger("onStopFormatPainter", true);if(isSuccess)t._updateRange(to);t.draw()};var result=AscCommonExcel.preparePromoteFromTo(from,to);if(!result){onApplyFormatPainterCallback(false);return}this._isLockedCells(to,null,onApplyFormatPainterCallback)};WorksheetView.prototype.changeSelectionFillHandle=function(x,y,tableIndex){var ret=null;var t=this,table;var _checkTableRange=function(){var _range=t.activeFillHandle;if(table){var _tableRange=table.Ref;if(_range.c2<_tableRange.c1){_range.c2=_tableRange.c1;_range.c1=_tableRange.c1}var _r2= table.isHeaderRow()?_tableRange.r1+1:_tableRange.r1;if(_range.r2<_r2){_range.r2=_r2;_range.r1=_tableRange.r1}}};var _getTableByIndex=function(index){return t.model.TableParts&&t.model.TableParts[index]?t.model.TableParts[index]:null};if(null===this.activeFillHandle){if(undefined!==tableIndex){table=_getTableByIndex(tableIndex);this.activeFillHandle=table?table.Ref.clone():null;this.resizeTableIndex=tableIndex}else this.activeFillHandle=this.model.selectionRange.getLast().clone();this.activeFillHandle.normalize(); return ret}this.cleanSelection();table=undefined!==this.resizeTableIndex?_getTableByIndex(this.resizeTableIndex):null;var ar=table?table.Ref.clone():this.model.selectionRange.getLast().clone(true);var xL=this._getColLeft(ar.c1);var yL=this._getRowTop(ar.r1);var xR=this._getColLeft(ar.c2+1);var yR=this._getRowTop(ar.r2+1);var activeFillHandleCopy;var colByX=this._findColUnderCursor(x,false,true).col;var rowByY=this._findRowUnderCursor(y,false,true).row;var colByXNoDX=this._findColUnderCursor(x,false, false).col;var rowByYNoDY=this._findRowUnderCursor(y,false,false).row;var dCol;var dRow;x+=this._getColLeft(this.visibleRange.c1)-this.cellsLeft;y+=this._getRowTop(this.visibleRange.r1)-this.cellsTop;var dXL=x-xL;var dYL=y-yL;var dXR=x-xR;var dYR=y-yR;var dXRMod;var dYRMod;var _tmpArea=0;if(dXR<=0)if(dXL<=0)if(dYR<=0)if(dYL<=0)_tmpArea=1;else _tmpArea=4;else _tmpArea=7;else if(dYR<=0)if(dYL<=0)_tmpArea=2;else _tmpArea=5;else _tmpArea=8;else if(dYR<=0)if(dYL<=0)_tmpArea=3;else _tmpArea=6;else _tmpArea= 9;switch(_tmpArea){case 2:case 8:this.fillHandleDirection=1;break;case 4:case 6:this.fillHandleDirection=0;break;case 1:dXRMod=Math.abs(x-xL);dYRMod=Math.abs(y-yL);dCol=Math.abs(colByX-ar.c1);dRow=Math.abs(rowByY-ar.r1);this.fillHandleDirection=-1;break;case 3:dXRMod=Math.abs(x-xR);dYRMod=Math.abs(y-yL);dCol=Math.abs(colByX-ar.c2);dRow=Math.abs(rowByY-ar.r1);this.fillHandleDirection=-1;break;case 7:dXRMod=Math.abs(x-xL);dYRMod=Math.abs(y-yR);dCol=Math.abs(colByX-ar.c1);dRow=Math.abs(rowByY-ar.r2); this.fillHandleDirection=-1;break;case 5:case 9:dXRMod=Math.abs(dXR);dYRMod=Math.abs(dYR);dCol=Math.abs(colByX-ar.c2);dRow=Math.abs(rowByY-ar.r2);this.fillHandleDirection=-1;break}if(-1===this.fillHandleDirection)if(0===dCol&&0!==dRow)this.fillHandleDirection=1;else if(0!==dCol&&0===dRow)this.fillHandleDirection=0;else if(dXRMod>=dYRMod)this.fillHandleDirection=0;else this.fillHandleDirection=1;if(0===this.fillHandleDirection){if(table)this.fillHandleArea=3;else if(dXR<=0)if(dXL<=0)this.fillHandleArea= 1;else this.fillHandleArea=2;else this.fillHandleArea=3;this.activeFillHandle.c2=colByX;switch(this.fillHandleArea){case 1:this.activeFillHandle.c1=ar.c2;this.activeFillHandle.r1=ar.r2;this.activeFillHandle.r2=ar.r1;if(this.activeFillHandle.c2==ar.c1)this.fillHandleArea=2;break;case 2:this.activeFillHandle.c1=ar.c2;this.activeFillHandle.r1=ar.r2;this.activeFillHandle.r2=ar.r1;if(this.activeFillHandle.c2>this.activeFillHandle.c1){this.activeFillHandle.c1=ar.c1;this.activeFillHandle.r1=ar.r1;this.activeFillHandle.c2= ar.c1;this.activeFillHandle.r2=ar.r1}break;case 3:this.activeFillHandle.c1=ar.c1;this.activeFillHandle.r1=ar.r1;this.activeFillHandle.r2=ar.r2;break}if(table)_checkTableRange();activeFillHandleCopy=this.activeFillHandle.clone();activeFillHandleCopy.c2=colByXNoDX}else{if(table)this.fillHandleArea=3;else if(dYR<=0)if(dYL<=0)this.fillHandleArea=1;else this.fillHandleArea=2;else this.fillHandleArea=3;this.activeFillHandle.r2=rowByY;switch(this.fillHandleArea){case 1:this.activeFillHandle.c1=ar.c2;this.activeFillHandle.r1= ar.r2;this.activeFillHandle.c2=ar.c1;if(this.activeFillHandle.r2==ar.r1)this.fillHandleArea=2;break;case 2:this.activeFillHandle.c1=ar.c2;this.activeFillHandle.r1=ar.r2;this.activeFillHandle.c2=ar.c1;if(this.activeFillHandle.r2>this.activeFillHandle.r1){this.activeFillHandle.c1=ar.c1;this.activeFillHandle.r1=ar.r1;this.activeFillHandle.c2=ar.c1;this.activeFillHandle.r2=ar.r1}break;case 3:this.activeFillHandle.c1=ar.c1;this.activeFillHandle.r1=ar.r1;this.activeFillHandle.c2=ar.c2;break}if(table)_checkTableRange(); activeFillHandleCopy=this.activeFillHandle.clone();activeFillHandleCopy.r2=rowByYNoDY}this._drawSelection();ret=this._calcRangeOffset(activeFillHandleCopy);this.model.workbook.handlers.trigger("asc_onHideComment");return ret};WorksheetView.prototype.applyFillHandle=function(x,y,ctrlPress){var t=this;if(null!==this.resizeTableIndex){var table=t.model.TableParts&&t.model.TableParts[t.resizeTableIndex]?t.model.TableParts[t.resizeTableIndex]:null;if(table&&t.activeFillHandle){var isError=this.af_checkChangeRange(t.activeFillHandle); if(isError!==null)this.model.workbook.handlers.trigger("asc_onError",isError,c_oAscError.Level.NoCritical);else t.af_changeTableRange(table.DisplayName,t.activeFillHandle.clone())}this.cleanSelection();t.activeFillHandle=null;t.resizeTableIndex=null;t.fillHandleDirection=-1;t._drawSelection();return}var arn=t.model.selectionRange.getLast();var range=t.model.getRange3(arn.r1,arn.c1,arn.r2,arn.c2);var bIsHaveChanges=false;var nIndex=0;if(0===this.fillHandleDirection){nIndex=this.activeFillHandle.c2- arn.c1;if(2===this.fillHandleArea)bIsHaveChanges=arn.c2!==this.activeFillHandle.c2-1;else bIsHaveChanges=arn.c2!==this.activeFillHandle.c2}else{nIndex=this.activeFillHandle.r2-arn.r1;if(2===this.fillHandleArea)bIsHaveChanges=arn.r2!==this.activeFillHandle.r2-1;else bIsHaveChanges=arn.r2!==this.activeFillHandle.r2}if(bIsHaveChanges&&(this.activeFillHandle.r1!==this.activeFillHandle.r2||this.activeFillHandle.c1!==this.activeFillHandle.c2)){var changedRange=arn.clone();this.cleanSelection();if(2===this.fillHandleArea){if(arn.c1!== this.activeFillHandle.c2||arn.r1!==this.activeFillHandle.r2)if(0===this.fillHandleDirection){arn.c2=this.activeFillHandle.c2-1;changedRange.c1=changedRange.c2;changedRange.c2=this.activeFillHandle.c2}else{arn.r2=this.activeFillHandle.r2-1;changedRange.r1=changedRange.r2;changedRange.r2=this.activeFillHandle.r2}}else if(0===this.fillHandleDirection)if(1===this.fillHandleArea){arn.c1=this.activeFillHandle.c2;changedRange.c2=changedRange.c1-1;changedRange.c1=this.activeFillHandle.c2}else{arn.c2=this.activeFillHandle.c2; changedRange.c1=changedRange.c2+1;changedRange.c2=this.activeFillHandle.c2}else if(1===this.fillHandleArea){arn.r1=this.activeFillHandle.r2;changedRange.r2=changedRange.r1-1;changedRange.r1=this.activeFillHandle.r2}else{arn.r2=this.activeFillHandle.r2;changedRange.r1=changedRange.r2+1;changedRange.r2=this.activeFillHandle.r2}changedRange.normalize();var applyFillHandleCallback=function(res){if(res){var oCanPromote=range.canPromote(ctrlPress,1===t.fillHandleDirection,nIndex);if(null!=oCanPromote){History.Create_NewPoint(); History.StartTransaction();AscCommonExcel.executeInR1C1Mode(false,function(){range.promote(ctrlPress,1===t.fillHandleDirection,nIndex,oCanPromote);t.model.checkChangeTablesContent(arn);t.activeFillHandle=null;t.fillHandleDirection=-1;History.SetSelection(range.bbox.clone());History.SetSelectionRedo(oCanPromote.to.clone());History.EndTransaction()});t._updateRange(arn);t.draw()}else{t.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotFillRange,c_oAscError.Level.NoCritical);t.model.selectionRange.assign2(range.bbox); t.activeFillHandle=null;t.fillHandleDirection=-1;t.updateSelection()}}else{t.activeFillHandle=null;t.fillHandleDirection=-1;t._drawSelection()}};if(this.model.inPivotTable(changedRange)){this.activeFillHandle=null;this.fillHandleDirection=-1;this._drawSelection();this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(this.intersectionFormulaArray(changedRange)){this.activeFillHandle=null;this.fillHandleDirection=-1;this._drawSelection(); this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}this._isLockedCells(changedRange,null,applyFillHandleCallback)}else{this.cleanSelection();this.activeFillHandle=null;this.fillHandleDirection=-1;this._drawSelection()}};WorksheetView.prototype.changeSelectionMoveRangeHandle=function(x,y){var ret=null;var selectionRange=(this.dragAndDropRange||this.model.selectionRange.getLast()).clone();if(null===this.startCellMoveRange)this.af_changeSelectionTablePart(selectionRange); var colByX=this._findColUnderCursor(x,false,false).col;var rowByY=this._findRowUnderCursor(y,false,false).row;var type=selectionRange.getType();if(type===c_oAscSelectionType.RangeRow)colByX=0;else if(type===c_oAscSelectionType.RangeCol)rowByY=0;else if(type===c_oAscSelectionType.RangeMax){colByX=0;rowByY=0}if(null===this.startCellMoveRange){if(colByX<selectionRange.c1)colByX=selectionRange.c1;else if(colByX>selectionRange.c2)colByX=selectionRange.c2;if(rowByY<selectionRange.r1)rowByY=selectionRange.r1; else if(rowByY>selectionRange.r2)rowByY=selectionRange.r2;this.startCellMoveRange=new asc_Range(colByX,rowByY,colByX,rowByY);this.startCellMoveRange.isChanged=false;return ret}var colDelta=colByX-this.startCellMoveRange.c1;var rowDelta=rowByY-this.startCellMoveRange.r1;if(false===this.startCellMoveRange.isChanged&&0===colDelta&&0===rowDelta)return ret;this.startCellMoveRange.isChanged=true;this.cleanSelection();this.activeMoveRange=selectionRange;this.activeMoveRange.normalize();this.activeMoveRange.c1+= colDelta;if(0>this.activeMoveRange.c1){colDelta-=this.activeMoveRange.c1;this.activeMoveRange.c1=0}this.activeMoveRange.c2+=colDelta;this.activeMoveRange.r1+=rowDelta;if(0>this.activeMoveRange.r1){rowDelta-=this.activeMoveRange.r1;this.activeMoveRange.r1=0}this.activeMoveRange.r2+=rowDelta;this._drawSelection();var d=new AscCommon.CellBase(0,0);if(y<=this.cellsTop+2)d.row=-1;else if(y>=this.drawingCtx.getHeight()-2)d.row=1;if(x<=this.cellsLeft+2)d.col=-1;else if(x>=this.drawingCtx.getWidth()-2)d.col= 1;this.model.workbook.handlers.trigger("asc_onHideComment");type=this.activeMoveRange.getType();if(type===c_oAscSelectionType.RangeRow)d.col=0;else if(type===c_oAscSelectionType.RangeCol)d.row=0;else if(type===c_oAscSelectionType.RangeMax){d.col=0;d.row=0}return d};WorksheetView.prototype.changeChartSelectionMoveResizeRangeHandle=function(x,y,targetInfo){var colByX=this._findColUnderCursor(x,false,false).col;var rowByY=this._findRowUnderCursor(y,false,false).row;var i;var indexFormulaRange=targetInfo.indexFormulaRange; var otherRanges=this.oOtherRanges.ranges;var oActiveRange=otherRanges[indexFormulaRange],colDelta,rowDelta;var ar=oActiveRange.clone(),arTmp;var oTopActiveRange=null,oLeftActiveRange=null,oValActiveRange=null;var r1=null,r2=null,c1=null,c2=null,delta;if(oActiveRange.separated){switch(targetInfo.cursor){case kCurNEResize:case kCurSEResize:{if(colByX<this.startCellMoveResizeRange2.c1){c2=this.startCellMoveResizeRange2.c1;c1=colByX}else if(colByX>this.startCellMoveResizeRange2.c1){c1=this.startCellMoveResizeRange2.c1; c2=colByX}else{c1=this.startCellMoveResizeRange2.c1;c2=this.startCellMoveResizeRange2.c1}if(rowByY<this.startCellMoveResizeRange2.r1){r2=this.startCellMoveResizeRange2.r2;r1=rowByY}else if(rowByY>this.startCellMoveResizeRange2.r1){r1=this.startCellMoveResizeRange2.r1;r2=rowByY}else{r1=this.startCellMoveResizeRange2.r1;r2=this.startCellMoveResizeRange2.r1}if(oActiveRange.chartRangeIndex!==2)if(Math.abs(ar.c2-ar.c1)>Math.abs(ar.r2-ar.r1)){r1=Math.min(ar.r1,ar.r2);r2=r1}else if(Math.abs(ar.c2-ar.c1)< Math.abs(ar.r2-ar.r1)){c1=Math.min(ar.c1,ar.c2);c2=c1}else if(Math.abs(this.startCellMoveResizeRange2.c1-colByX)>Math.abs(this.startCellMoveResizeRange2.r1-rowByY)){r1=Math.min(ar.r1,ar.r2);r2=r1}else{c1=Math.min(ar.c1,ar.c2);c2=c1}break}case kCurMove:{colDelta=colByX-this.startCellMoveResizeRange2.c1;c1=this.startCellMoveResizeRange.c1+colDelta;c2=this.startCellMoveResizeRange.c2+colDelta;delta=Math.min(c1,c2);if(delta<0){c1-=delta;c2-=delta}rowDelta=rowByY-this.startCellMoveResizeRange2.r1;r1=this.startCellMoveResizeRange.r1+ rowDelta;r2=this.startCellMoveResizeRange.r2+rowDelta;delta=Math.min(r1,r2);if(delta<0){r1-=delta;r2-=delta}break}}arTmp=oActiveRange.clone();if(r1!==null&&r2!==null){arTmp.r1=r1;arTmp.r2=r2}if(c1!==null&&c2!==null){arTmp.c1=c1;arTmp.c2=c2}oActiveRange.assign2(arTmp)}else{for(i=0;i<otherRanges.length;++i)if(otherRanges[i].chartRangeIndex===0)oValActiveRange=otherRanges[i];else if(otherRanges[i].chartRangeIndex===1){if(oValActiveRange)if(oValActiveRange.vert)oLeftActiveRange=otherRanges[i];else oTopActiveRange= otherRanges[i]}else if(otherRanges[i].chartRangeIndex===2)if(oValActiveRange)if(oValActiveRange.vert)oTopActiveRange=otherRanges[i];else oLeftActiveRange=otherRanges[i];if(!oValActiveRange)return;switch(targetInfo.cursor){case kCurNEResize:case kCurSEResize:{if(oValActiveRange===oActiveRange||oTopActiveRange===oActiveRange)if(colByX<this.startCellMoveResizeRange2.c1){c2=this.startCellMoveResizeRange2.c1;c1=colByX}else if(colByX>this.startCellMoveResizeRange2.c1){c1=this.startCellMoveResizeRange2.c1; c2=colByX}else{c1=this.startCellMoveResizeRange2.c1;c2=this.startCellMoveResizeRange2.c1}if(oValActiveRange===oActiveRange||oLeftActiveRange===oActiveRange)if(rowByY<this.startCellMoveResizeRange2.r1){r2=this.startCellMoveResizeRange2.r2;r1=rowByY}else if(rowByY>this.startCellMoveResizeRange2.r1){r1=this.startCellMoveResizeRange2.r1;r2=rowByY}else{r1=this.startCellMoveResizeRange2.r1;r2=this.startCellMoveResizeRange2.r1}if(oLeftActiveRange&&oLeftActiveRange!==oActiveRange&&c1<=oLeftActiveRange.c2)c1= oLeftActiveRange.c2+1;if(oTopActiveRange&&oTopActiveRange!==oActiveRange&&r1<=oTopActiveRange.r2)r1=oTopActiveRange.r2+1;break}case kCurMove:{if(oActiveRange===oValActiveRange||oActiveRange===oTopActiveRange){colDelta=colByX-this.startCellMoveResizeRange2.c1;if(colDelta<0&&oLeftActiveRange&&this.startCellMoveResizeRange.c1+colDelta<=oLeftActiveRange.c2)colDelta+=oLeftActiveRange.c2-(this.startCellMoveResizeRange.c1+colDelta)+1;c1=this.startCellMoveResizeRange.c1+colDelta;c2=this.startCellMoveResizeRange.c2+ colDelta;delta=Math.min(c1,c2);if(delta<0){c1-=delta;c2-=delta}}if(oActiveRange===oValActiveRange||oActiveRange===oLeftActiveRange){rowDelta=rowByY-this.startCellMoveResizeRange2.r1;if(rowDelta<0&&oTopActiveRange&&this.startCellMoveResizeRange.r1+rowDelta<=oTopActiveRange.r2)rowDelta+=oTopActiveRange.r2-(this.startCellMoveResizeRange.r1+rowDelta)+1;r1=this.startCellMoveResizeRange.r1+rowDelta;r2=this.startCellMoveResizeRange.r2+rowDelta;delta=Math.min(r1,r2);if(delta<0){r1-=delta;r2-=delta}}break}}if(oValActiveRange){arTmp= oValActiveRange.clone();if(r1!==null&&r2!==null){arTmp.r1=r1;arTmp.r2=r2}if(c1!==null&&c2!==null){arTmp.c1=c1;arTmp.c2=c2}oValActiveRange.assign2(arTmp)}if(oLeftActiveRange){arTmp=oLeftActiveRange.clone();if(r1!==null&&r2!==null){arTmp.r1=r1;arTmp.r2=r2}oLeftActiveRange.assign2(arTmp)}if(oTopActiveRange){arTmp=oTopActiveRange.clone();if(c1!==null&&c2!==null){arTmp.c1=c1;arTmp.c2=c2}oTopActiveRange.assign2(arTmp)}}this._drawSelection()};WorksheetView.prototype.changeSelectionMoveResizeRangeHandle= function(x,y,targetInfo,editor){if(!targetInfo)return null;if(this.getFormulaEditMode())editor.cleanSelectRange();var type;var index=targetInfo.indexFormulaRange,d=new AscCommon.CellBase(0,0);var ar=this.oOtherRanges.ranges[index].clone();var colByX=this._findColUnderCursor(x,false,false).col;var rowByY=this._findRowUnderCursor(y,false,false).row;if(null===this.startCellMoveResizeRange){if(targetInfo.cursor==kCurNEResize||targetInfo.cursor==kCurSEResize){this.startCellMoveResizeRange=ar.clone(true); this.startCellMoveResizeRange2=new asc_Range(targetInfo.col,targetInfo.row,targetInfo.col,targetInfo.row,true)}else{this.startCellMoveResizeRange=ar.clone(true);if(colByX<ar.c1)colByX=ar.c1;else if(colByX>ar.c2)colByX=ar.c2;if(rowByY<ar.r1)rowByY=ar.r1;else if(rowByY>ar.r2)rowByY=ar.r2;this.startCellMoveResizeRange2=new asc_Range(colByX,rowByY,colByX,rowByY)}return null}this.overlayCtx.clear();if(!this.getFormulaEditMode())return this.changeChartSelectionMoveResizeRangeHandle(x,y,targetInfo);if(targetInfo.cursor== kCurNEResize||targetInfo.cursor==kCurSEResize){if(colByX<this.startCellMoveResizeRange2.c1){ar.c2=this.startCellMoveResizeRange2.c1;ar.c1=colByX}else if(colByX>this.startCellMoveResizeRange2.c1){ar.c1=this.startCellMoveResizeRange2.c1;ar.c2=colByX}else{ar.c1=this.startCellMoveResizeRange2.c1;ar.c2=this.startCellMoveResizeRange2.c1}if(rowByY<this.startCellMoveResizeRange2.r1){ar.r2=this.startCellMoveResizeRange2.r2;ar.r1=rowByY}else if(rowByY>this.startCellMoveResizeRange2.r1){ar.r1=this.startCellMoveResizeRange2.r1; ar.r2=rowByY}else{ar.r1=this.startCellMoveResizeRange2.r1;ar.r2=this.startCellMoveResizeRange2.r1}}else{this.startCellMoveResizeRange.normalize();type=this.startCellMoveResizeRange.getType();var colDelta=type!==c_oAscSelectionType.RangeRow&&type!==c_oAscSelectionType.RangeMax?colByX-this.startCellMoveResizeRange2.c1:0;var rowDelta=type!==c_oAscSelectionType.RangeCol&&type!==c_oAscSelectionType.RangeMax?rowByY-this.startCellMoveResizeRange2.r1:0;ar.c1=this.startCellMoveResizeRange.c1+colDelta;if(0> ar.c1){colDelta-=ar.c1;ar.c1=0}ar.c2=this.startCellMoveResizeRange.c2+colDelta;ar.r1=this.startCellMoveResizeRange.r1+rowDelta;if(0>ar.r1){rowDelta-=ar.r1;ar.r1=0}ar.r2=this.startCellMoveResizeRange.r2+rowDelta}if(y<=this.cellsTop+2)d.row=-1;else if(y>=this.drawingCtx.getHeight()-2)d.row=1;if(x<=this.cellsLeft+2)d.col=-1;else if(x>=this.drawingCtx.getWidth()-2)d.col=1;type=this.startCellMoveResizeRange.getType();if(type===c_oAscSelectionType.RangeRow)d.col=0;else if(type===c_oAscSelectionType.RangeCol)d.row= 0;else if(type===c_oAscSelectionType.RangeMax){d.col=0;d.row=0}ar=this.oOtherRanges.ranges[index].assign2(ar.clone(true));this._drawSelection();editor.changeCellRange(ar,true);return d};WorksheetView.prototype._cleanSelectionMoveRange=function(){this.cleanSelection();this.activeMoveRange=null;this.startCellMoveRange=null;this._drawSelection()};WorksheetView.prototype.applyMoveRangeHandle=function(ctrlKey){if(null===this.activeMoveRange){this.startCellMoveRange=null;return}this.model.workbook.handlers.trigger("cleanCutData", null,true);var arnFrom=this.model.selectionRange.getLast();var arnTo=this.activeMoveRange.clone(true);if(arnFrom.isEqual(arnTo)){this._cleanSelectionMoveRange();return}var errorPivot=this.model.checkMovePivotTable(arnFrom,arnTo,ctrlKey);if(c_oAscError.ID.No!==errorPivot){this._cleanSelectionMoveRange();this.model.workbook.handlers.trigger("asc_onError",errorPivot,c_oAscError.Level.NoCritical);return}if(!this.checkMoveFormulaArray(arnFrom,arnTo)){this._cleanSelectionMoveRange();this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}var resmove=this.model._prepareMoveRange(arnFrom,arnTo);if(resmove===-2){this.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotMoveRange,c_oAscError.Level.NoCritical);this._cleanSelectionMoveRange()}else if(resmove===-1){var t=this;this.model.workbook.handlers.trigger("asc_onConfirmAction",Asc.c_oAscConfirm.ConfirmReplaceRange,function(can){if(can)t.moveRangeHandle(arnFrom,arnTo,ctrlKey);else t._cleanSelectionMoveRange()})}else this.moveRangeHandle(arnFrom, arnTo,ctrlKey)};WorksheetView.prototype.applyCutRange=function(arnFrom,arnTo,opt_wsTo){var moveToOtherSheet=opt_wsTo&&opt_wsTo.model&&this.model!==opt_wsTo.model;if(!moveToOtherSheet&&arnFrom.isEqual(arnTo))return;var errorPivot=this.model.checkMovePivotTable(arnFrom,arnTo,false,opt_wsTo&&opt_wsTo.model);if(c_oAscError.ID.No!==errorPivot){this.model.workbook.handlers.trigger("asc_onError",errorPivot,c_oAscError.Level.NoCritical);return}if(!this.checkMoveFormulaArray(arnFrom,arnTo,null,opt_wsTo)){this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}var resmove=this.model._prepareMoveRange(arnFrom,arnTo,opt_wsTo&&opt_wsTo.model);if(resmove===-2)this.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotMoveRange,c_oAscError.Level.NoCritical);else if(resmove===-1){var t=this;this.model.workbook.handlers.trigger("asc_onConfirmAction",Asc.c_oAscConfirm.ConfirmReplaceRange,function(can){if(can)t.moveRangeHandle(arnFrom,arnTo,null,opt_wsTo)})}else this.moveRangeHandle(arnFrom, arnTo,null,opt_wsTo)};WorksheetView.prototype.applyMoveResizeRangeHandle=function(){if(!this.getFormulaEditMode()&&!this.startCellMoveResizeRange.isEqual(this.moveRangeDrawingObjectTo))this.objectRender.applyMoveResizeRange(this.oOtherRanges);this.startCellMoveResizeRange=null;this.startCellMoveResizeRange2=null;this.moveRangeDrawingObjectTo=null};WorksheetView.prototype.moveRangeHandle=function(arnFrom,arnTo,copyRange,opt_wsTo){var t=this;var wsTo=opt_wsTo?opt_wsTo:this;var onApplyMoveRangeHandleCallback= function(isSuccess){if(false===isSuccess){wsTo.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedAllError,c_oAscError.Level.NoCritical);wsTo._cleanSelectionMoveRange();return}var onApplyMoveAutoFiltersCallback=function(isSuccess){if(false===isSuccess){wsTo.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedAllError,c_oAscError.Level.NoCritical);wsTo._cleanSelectionMoveRange();return}var hasMerged=t.model.getRange3(arnFrom.r1,arnFrom.c1,arnFrom.r2,arnFrom.c2).hasMerged(); wsTo.cleanSelection();History.Create_NewPoint();if(opt_wsTo===undefined)History.SetSelection(arnFrom.clone());History.SetSelectionRedo(arnTo.clone());History.StartTransaction();t.model.autoFilters._preMoveAutoFilters(arnFrom,arnTo,copyRange,opt_wsTo);t.model._moveRange(arnFrom,arnTo,copyRange,opt_wsTo&&opt_wsTo.model);t.cellCommentator.moveRangeComments(arnFrom,arnTo,copyRange,opt_wsTo);t.objectRender.moveRangeDrawingObject(arnFrom,arnTo);t.model.checkChangeTablesContent(arnFrom);wsTo.model.checkChangeTablesContent(arnTo); t.model.autoFilters.reDrawFilter(arnFrom);t.model.autoFilters.afterMoveAutoFilters(arnFrom,arnTo,opt_wsTo);if(opt_wsTo)History.SetSheetUndo(wsTo.model.getId());History.EndTransaction();wsTo._updateRange(arnTo);t._updateRange(arnFrom);wsTo.model.selectionRange.assign2(arnTo);wsTo.activeMoveRange=null;wsTo.startCellMoveRange=null;wsTo.draw();wsTo._updateSelectionNameAndInfo();if(hasMerged&&false!==t.model.autoFilters._intersectionRangeWithTableParts(arnTo))wsTo.model.workbook.handlers.trigger("asc_onConfirmAction", Asc.c_oAscConfirm.ConfirmPutMergeRange,function(){})};if(t.model.autoFilters._searchFiltersInRange(arnFrom,true)){t._isLockedAll(onApplyMoveAutoFiltersCallback);if(copyRange)t._isLockedDefNames(null,null)}else onApplyMoveAutoFiltersCallback()};if(this.af_isCheckMoveRange(arnFrom,arnTo,opt_wsTo))if(opt_wsTo)this._isLockedCells([arnFrom],null,opt_wsTo._isLockedCells([arnTo],null,onApplyMoveRangeHandleCallback));else this._isLockedCells([arnFrom,arnTo],null,onApplyMoveRangeHandleCallback);else this._cleanSelectionMoveRange()}; WorksheetView.prototype.emptySelection=function(options,bIsCut){if(this.objectRender.selectedGraphicObjectsExists()){var isIntoShape=this.objectRender.controller.getTargetDocContent();if(bIsCut&&isIntoShape){if(isIntoShape.Selection&&isIntoShape.Selection.Use)this.objectRender.controller.remove(-1,undefined,undefined,undefined,undefined)}else this.objectRender.controller.deleteSelectedObjects()}else this.setSelectionInfo("empty",options)};WorksheetView.prototype.isNeedSelectionCut=function(){var res= true;if(AscCommon.g_clipboardBase.bCut&&!this.objectRender.selectedGraphicObjectsExists())res=false;return res};WorksheetView.prototype.isMultiSelect=function(){if(!this.objectRender.selectedGraphicObjectsExists())return!this.model.selectionRange.isSingleRange();return null};WorksheetView.prototype.setSelectionInfo=function(prop,val,onlyActive){if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;var t=this;var checkRange=[];var activeCell=this.model.selectionRange.activeCell.clone(); var arn=this.model.selectionRange.getLast().clone(true);var onSelectionCallback=function(isSuccess){if(false===isSuccess)return;var hasUpdates=false;var callTrigger=false;var res;var mc,r,cell;var expansionTableRange;function makeBorder(b){var border=new AscCommonExcel.BorderProp;if(b===false)border.setStyle(c_oAscBorderStyles.None);else if(b){if(b.style!==null&&b.style!==undefined)border.setStyle(b.style);if(b.color!==null&&b.color!==undefined)if(b.color instanceof Asc.asc_CColor)border.c=AscCommonExcel.CorrectAscColor(b.color)}return border} History.Create_NewPoint();History.StartTransaction();checkRange.forEach(function(item,i){var c;var bIsUpdate=true;var range=t.model.getRange3(item.r1,item.c1,item.r2,item.c2);var isLargeRange=t._isLargeRange(range.bbox);var canChangeColWidth=c_oAscCanChangeColWidth.none;if(prop!=="paste"&&t.model.autoFilters.bIsExcludeHiddenRows(range,activeCell))t.model.excludeHiddenRows(true);switch(prop){case "fn":range.setFontname(val);canChangeColWidth=c_oAscCanChangeColWidth.numbers;break;case "fs":range.setFontsize(val); canChangeColWidth=c_oAscCanChangeColWidth.numbers;break;case "b":range.setBold(val);break;case "i":range.setItalic(val);break;case "u":range.setUnderline(val);break;case "s":range.setStrikeout(val);break;case "fa":range.setFontAlign(val);break;case "a":range.setAlignHorizontal(val);break;case "va":range.setAlignVertical(val);break;case "c":range.setFontcolor(val);break;case "f":range.setFill(val||null);break;case "bc":range.setFillColor(val||null);break;case "wrap":range.setWrap(val);break;case "shrink":range.setShrinkToFit(val); break;case "value":if(val instanceof AscCommonExcel.CCellValue)range.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,val));else range.setValue(val);expansionTableRange=range.bbox;break;case "totalRowFunc":var _table=t.model.autoFilters.getTableByActiveCell();if(_table){var _tF=t.model.autoFilters._changeTotalsRowData(_table,range.bbox,{totalFunction:val});if(_tF)range.setValue(_tF[0])}break;case "format":range.setNumFormat(val);canChangeColWidth=c_oAscCanChangeColWidth.numbers;break; case "angle":range.setAngle(val);break;case "rh":range.removeHyperlink(null,true);break;case "border":if(isLargeRange&&!callTrigger){callTrigger=true;t.handlers.trigger("slowOperation",true)}if(val.length<1){range.setBorder(null);break}res=new AscCommonExcel.Border;res.d=makeBorder(val[c_oAscBorderOptions.DiagD]||val[c_oAscBorderOptions.DiagU]);res.dd=!!val[c_oAscBorderOptions.DiagD];res.du=!!val[c_oAscBorderOptions.DiagU];res.l=makeBorder(val[c_oAscBorderOptions.Left]);res.iv=makeBorder(val[c_oAscBorderOptions.InnerV]); res.r=makeBorder(val[c_oAscBorderOptions.Right]);res.t=makeBorder(val[c_oAscBorderOptions.Top]);res.ih=makeBorder(val[c_oAscBorderOptions.InnerH]);res.b=makeBorder(val[c_oAscBorderOptions.Bottom]);range.setBorder(res);break;case "merge":if(isLargeRange&&!callTrigger){callTrigger=true;t.handlers.trigger("slowOperation",true)}switch(val){case c_oAscMergeOptions.MergeCenter:case c_oAscMergeOptions.Merge:range.merge(val);t.cellCommentator.mergeComments(range.getBBox0());break;case c_oAscMergeOptions.None:range.unmerge(); break;case c_oAscMergeOptions.MergeAcross:for(res=range.bbox.r1;res<=range.bbox.r2;++res){t.model.getRange3(res,range.bbox.c1,res,range.bbox.c2).merge(val);cell=new asc_Range(range.bbox.c1,res,range.bbox.c2,res);t.cellCommentator.mergeComments(cell)}break}break;case "sort":if(isLargeRange&&!callTrigger){callTrigger=true;t.handlers.trigger("slowOperation",true)}var opt_by_rows=false;t.cellCommentator.sortComments(t._doSort(range,val.type,opt_by_rows?activeCell.row:activeCell.col,val.color,true,opt_by_rows)); t.setSortProps(t._generateSortProps(val.type,opt_by_rows?activeCell.row:activeCell.col,val.color,true,opt_by_rows,range.bbox),true);break;case "customSort":if(isLargeRange&&!callTrigger){callTrigger=true;t.handlers.trigger("slowOperation",true)}t.setSortProps(val);break;case "empty":if(isLargeRange&&!callTrigger){callTrigger=true;t.handlers.trigger("slowOperation",true)}t.model.workbook.dependencyFormulas.lockRecal();switch(val){case c_oAscCleanOptions.All:range.cleanAll();t.model.deletePivotTables(range.bbox); t.model.removeSparklines(range.bbox);t.model.clearDataValidation([range.bbox],true);t.cellCommentator.deleteCommentsRange(range.bbox);break;case c_oAscCleanOptions.Text:case c_oAscCleanOptions.Formula:range.cleanText();t.model.deletePivotTables(range.bbox);break;case c_oAscCleanOptions.Format:range.cleanFormat();break;case c_oAscCleanOptions.Hyperlinks:range.cleanHyperlinks();break;case c_oAscCleanOptions.Sparklines:t.model.removeSparklines(range.bbox);break;case c_oAscCleanOptions.SparklineGroups:t.model.removeSparklineGroups(range.bbox); break}t.model.excludeHiddenRows(false);if(window["AscCommonExcel"].filteringMode)if(val===c_oAscCleanOptions.All||val===c_oAscCleanOptions.Text)t.model.autoFilters.isEmptyAutoFilters(range.bbox);else if(val===c_oAscCleanOptions.Format)t.model.autoFilters.cleanFormat(range.bbox);if(val===c_oAscCleanOptions.All||val===c_oAscCleanOptions.Text)t.model.checkChangeTablesContent(range.bbox);t.model.workbook.dependencyFormulas.unlockRecal();break;case "changeDigNum":res=[];for(c=item.c1;c<=item.c2;++c)res.push(t.getColumnWidthInSymbols(c)); range.shiftNumFormat(val,res);canChangeColWidth=c_oAscCanChangeColWidth.numbers;break;case "changeFontSize":mc=t.model.getMergedByCell(activeCell.row,activeCell.col);c=mc?mc.c1:activeCell.col;r=mc?mc.r1:activeCell.row;cell=t._getVisibleCell(c,r);var oldFontSize=cell.getFont().getSize();var newFontSize=asc_incDecFonSize(val,oldFontSize);if(null!==newFontSize){range.setFontsize(newFontSize);canChangeColWidth=c_oAscCanChangeColWidth.numbers}break;case "style":range.setCellStyle(val);canChangeColWidth= c_oAscCanChangeColWidth.numbers;break;case "paste":var specialPasteHelper=window["AscCommon"].g_specialPasteHelper;specialPasteHelper.specialPasteProps=specialPasteHelper.specialPasteProps?specialPasteHelper.specialPasteProps:new Asc.SpecialPasteProps;if(val.pasteAllSheet)specialPasteHelper.specialPasteProps.asc_setProps(Asc.c_oSpecialPasteProps.formulaColumnWidth);t._loadDataBeforePaste(isLargeRange,val,bIsUpdate,canChangeColWidth,checkPasteRange);bIsUpdate=false;break;case "hyperlink":if(val&&val.hyperlinkModel){if(Asc.c_oAscHyperlinkType.RangeLink=== val.asc_getType()){val.hyperlinkModel._updateLocation();if(null===val.hyperlinkModel.LocationRangeBbox&&null!==val.hyperlinkModel.LocationSheet){bIsUpdate=false;break}}if(null!==val.asc_getText()){mc=t.model.getMergedByCell(activeCell.row,activeCell.col);c=mc?mc.c1:activeCell.col;r=mc?mc.r1:activeCell.row;t.model.getRange3(r,c,r,c).setValue(val.asc_getText());t.model.checkChangeTablesContent(range.bbox)}val.hyperlinkModel.Ref=range;range.setHyperlink(val.hyperlinkModel);break}else{bIsUpdate=false; break}default:bIsUpdate=false;break}t.model.excludeHiddenRows(false);if(bIsUpdate){t.canChangeColWidth=canChangeColWidth;t._updateRange(item);t.canChangeColWidth=c_oAscCanChangeColWidth.none;hasUpdates=true}});t.model.workbook.handlers.trigger("cleanCutData",true,true);if(prop!=="paste"){History.EndTransaction();if(expansionTableRange)t.applyTableAutoExpansion(expansionTableRange)}if(hasUpdates)t.draw();if(callTrigger)t.handlers.trigger("slowOperation",false);if(prop==="paste")if(val.needDraw)t.draw(); else val.needDraw=true};var checkPasteRange;if("paste"===prop)if(val.onlyImages){onSelectionCallback(true);return}else if(!val.fromBinary&&this.isMultiSelect()){t.handlers.trigger("onErrorEvent",c_oAscError.ID.PasteMultiSelectError,c_oAscError.Level.NoCritical);return false}else{var newRange=val.fromBinary?this.pasteFromBinary(val.data,true):this._pasteFromHTML(val.data,true);checkPasteRange=newRange&&newRange.length?newRange:[newRange];checkRange=[checkPasteRange[0]];if(!newRange)return false;for(var j= 0;j<checkPasteRange.length;j++){var _checkRange=checkPasteRange[j];if(this.intersectionFormulaArray(_checkRange)){t.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return false}if(val.data&&val.data.pivotTables&&val.data.pivotTables.length>0){var intersectionTableParts=this.model.autoFilters.getTablesIntersectionRange(_checkRange);for(var i=0;i<intersectionTableParts.length;i++)if(intersectionTableParts[i]&&intersectionTableParts[i].Ref&&!_checkRange.containsRange(intersectionTableParts[i].Ref)){t.handlers.trigger("onErrorEvent", c_oAscError.ID.PivotOverlap,c_oAscError.Level.NoCritical);return false}}if(this.model._isPivotsIntersectRangeButNotInIt(_checkRange)){t.handlers.trigger("onErrorEvent",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return false}}}else if(onlyActive)checkRange.push(new asc_Range(activeCell.col,activeCell.row,activeCell.col,activeCell.row));else this.model.selectionRange.ranges.forEach(function(item){checkRange.push(item.clone())});if(("merge"===prop||"sort"===prop||"hyperlink"===prop|| "rh"===prop||"customSort"===prop)&&this.model.inPivotTable(checkRange)){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if("empty"===prop&&!this.model.checkDeletePivotTables(checkRange)){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if("empty"===prop&&this.intersectionFormulaArray(arn)){t.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotChangeFormulaArray, c_oAscError.Level.NoCritical);return}if("sort"===prop){var aMerged=this.model.mergeManager.get(checkRange);if(aMerged.outer.length>0||aMerged.inner.length>0&&null==window["AscCommonExcel"]._isSameSizeMerged(checkRange,aMerged.inner,true)){t.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotFillRange,c_oAscError.Level.NoCritical);return}}if("paste"===prop){var _pasteCallback=function(_success){if(false===_success)return;var pasteContent=val.data;var fonts=pasteContent.props&&pasteContent.props.fontsNew? pasteContent.props.fontsNew:val.fontsNew;t._loadFonts(fonts,onSelectionCallback)};if(this._isNeedLockedAllOnPaste(val))this._isLockedAll(function(success){if(!success){t.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedAllError,c_oAscError.Level.NoCritical);return}t._isLockedCells(checkRange,null,_pasteCallback)});else _pasteCallback(true)}else this._isLockedCells(checkRange,null,onSelectionCallback)};WorksheetView.prototype._isNeedLockedAllOnPaste=function(val){if(!val)return false; var specialPasteHelper=window["AscCommon"].g_specialPasteHelper;var specialPasteProps=specialPasteHelper.specialPasteProps;var allowedPasteTables=!specialPasteProps||specialPasteProps.formatTable;var pasteContent=val.data;if(val.fromBinary&&pasteContent&&pasteContent.TableParts&&pasteContent.TableParts.length&&allowedPasteTables){var arnToRange=this.model.selectionRange.getLast();var range,tablePartRange,tables=pasteContent.TableParts,diffRow,diffCol,curTable,bIsAddTable;var activeRange=AscCommonExcel.g_clipboardExcel.pasteProcessor.activeRange; var refInsertBinary=AscCommonExcel.g_oRangeCache.getAscRange(activeRange);var pasteRange=AscCommonExcel.g_clipboardExcel.pasteProcessor.activeRange;var activeCellsPasteFragment=typeof pasteRange==="string"?AscCommonExcel.g_oRangeCache.getAscRange(pasteRange):pasteRange;for(var i=0;i<tables.length;i++){curTable=tables[i];tablePartRange=curTable.Ref;diffRow=tablePartRange.r1-refInsertBinary.r1+arnToRange.r1;diffCol=tablePartRange.c1-refInsertBinary.c1+arnToRange.c1;range=this.model.getRange3(diffRow, diffCol,diffRow+(tablePartRange.r2-tablePartRange.r1),diffCol+(tablePartRange.c2-tablePartRange.c1));if(activeCellsPasteFragment&&!activeCellsPasteFragment.containsRange(tablePartRange))continue;if(this.model.autoFilters._intersectionRangeWithTableParts(range.bbox))continue;return true}}return false};WorksheetView.prototype.specialPaste=function(props){var api=window["Asc"]["editor"];var t=this;var specialPasteHelper=window["AscCommon"].g_specialPasteHelper;var specialPasteData=specialPasteHelper.specialPasteData; if(!specialPasteData)return;var isIntoShape=t.objectRender.controller.getTargetDocContent();var onSelectionCallback=function(isSuccess){if(!isSuccess)return false;window["AscCommon"].g_specialPasteHelper.Paste_Process_Start();window["AscCommon"].g_specialPasteHelper.Special_Paste_Start();var doUndo=true;if(window["Asc"].c_oSpecialPasteOperation.none!==props.operation&&null!==props.operation){if(window["AscCommon"].g_specialPasteHelper.isAppliedOperation)doUndo=false;window["AscCommon"].g_specialPasteHelper.isAppliedOperation= true}else window["AscCommon"].g_specialPasteHelper.isAppliedOperation=false;if(doUndo)api.asc_Undo();if(specialPasteHelper.selectionRange)t.model.selectionRange=specialPasteHelper.selectionRange.clone();History.Create_NewPoint();History.StartTransaction();specialPasteHelper.specialPasteProps=props;window["AscCommon"].g_specialPasteHelper.bIsEndTransaction=true;AscCommonExcel.g_clipboardExcel.pasteData(t,specialPasteData._format,specialPasteData.data1,specialPasteData.data2,specialPasteData.text_data)}; if(specialPasteData.activeRange&&!isIntoShape)this._isLockedCells(specialPasteData.activeRange.ranges,null,props&&props.width?t._isLockedAll(onSelectionCallback):onSelectionCallback);else onSelectionCallback(true)};WorksheetView.prototype._pasteData=function(isLargeRange,fromBinary,val,bIsUpdate,pasteToRange,bText){var t=this;var specialPasteHelper=window["AscCommon"].g_specialPasteHelper;var specialPasteProps=specialPasteHelper.specialPasteProps;if(val.props&&val.props.onlyImages===true){if(!specialPasteHelper.specialPasteStart)this.handlers.trigger("showSpecialPasteOptions", [Asc.c_oSpecialPasteProps.picture]);return}if(!specialPasteHelper.specialPasteStart){specialPasteHelper.selectionRange=this.model.selectionRange?this.model.selectionRange.clone():null;window["AscCommon"].g_specialPasteHelper.isAppliedOperation=false}var callTrigger=false;if(isLargeRange){callTrigger=true;t.handlers.trigger("slowOperation",true)}var activeTable=t.model.autoFilters.getTableContainActiveCell(t.model.selectionRange.activeCell);var newRange;if(pasteToRange&&activeTable&&specialPasteProps.formatTable){var delta= pasteToRange.r2-activeTable.Ref.r2;if(delta>0){if(false&&!t.model.autoFilters._isPartTablePartsUnderRange(activeTable.Ref)){t.model.getRange3(activeTable.Ref.r2+1,activeTable.Ref.c1,activeTable.Ref.r2+delta,activeTable.Ref.c2).addCellsShiftBottom();newRange=new Asc.Range(activeTable.Ref.c1,activeTable.Ref.r1,activeTable.Ref.c2,activeTable.Ref.r2+delta)}else{var tempRange=new Asc.Range(activeTable.Ref.c1,activeTable.Ref.r2+1,activeTable.Ref.c2,activeTable.Ref.r2+delta);if(t.model.autoFilters._isEmptyRange(tempRange, 0))newRange=new Asc.Range(activeTable.Ref.c1,activeTable.Ref.r1,activeTable.Ref.c2,activeTable.Ref.r2+delta)}if(newRange)t.model.autoFilters.changeTableRange(activeTable.DisplayName,newRange)}}var pasteRange=AscCommonExcel.g_clipboardExcel.pasteProcessor.activeRange;var activeCellsPasteFragment=typeof pasteRange==="string"?AscCommonExcel.g_oRangeCache.getAscRange(pasteRange):pasteRange;if(specialPasteProps.formatTable&&window["AscCommonExcel"].g_IncludeNewRowColInTable){var tableIndexAboveRange=t.model.autoFilters.searchRangeInTableParts(new Asc.Range(pasteToRange.c1, pasteToRange.r1-1,pasteToRange.c1,pasteToRange.r1-1));var tableAboveRange=t.model.TableParts[tableIndexAboveRange];if(tableAboveRange&&tableAboveRange.Ref&&!tableAboveRange.isTotalsRow()&&tableAboveRange.Ref.c1===pasteToRange.c1&&tableAboveRange.Ref.c2===pasteToRange.c2)if(-1===t.model.autoFilters.searchRangeInTableParts(pasteToRange))if(activeCellsPasteFragment&&fromBinary&&!val.autoFilters._isEmptyRange(activeCellsPasteFragment,0)){newRange=new Asc.Range(tableAboveRange.Ref.c1,tableAboveRange.Ref.r1, pasteToRange.c2,pasteToRange.r2);t.model.autoFilters.changeTableRange(tableAboveRange.DisplayName,newRange)}}var i;var arnToRange=pasteToRange?pasteToRange:t.model.selectionRange.getLast();var tablesMap=null,intersectionRangeWithTableParts;var activeRange=fromBinary&&AscCommonExcel.g_clipboardExcel.pasteProcessor.activeRange;var refInsertBinary=activeRange&&AscCommonExcel.g_oRangeCache.getAscRange(activeRange);if(fromBinary&&val.TableParts&&val.TableParts.length&&specialPasteProps.formatTable){var range, tablePartRange,tables=val.TableParts,diffRow,diffCol,curTable,bIsAddTable;for(i=0;i<tables.length;i++){curTable=tables[i];tablePartRange=curTable.Ref;diffRow=tablePartRange.r1-refInsertBinary.r1+arnToRange.r1;diffCol=tablePartRange.c1-refInsertBinary.c1+arnToRange.c1;range=t.model.getRange3(diffRow,diffCol,diffRow+(tablePartRange.r2-tablePartRange.r1),diffCol+(tablePartRange.c2-tablePartRange.c1));if(activeCellsPasteFragment&&!activeCellsPasteFragment.containsRange(tablePartRange))continue;intersectionRangeWithTableParts= t.model.autoFilters._intersectionRangeWithTableParts(range.bbox);if(intersectionRangeWithTableParts)continue;if(curTable.style)range.cleanFormat();var bWithoutFilter=false;if(!curTable.AutoFilter)bWithoutFilter=true;var offset=new AscCommon.CellBase(range.bbox.r1-tablePartRange.r1,range.bbox.c1-tablePartRange.c1);var newDisplayName=this.model.workbook.dependencyFormulas.getNextTableName();var props={bWithoutFilter:bWithoutFilter,tablePart:curTable,offset:offset,displayName:newDisplayName};var tableStyleInfoName= curTable.TableStyleInfo?curTable.TableStyleInfo.Name:null;t.model.autoFilters.addAutoFilter(tableStyleInfoName,range.bbox,true,true,props);if(null===tablesMap)tablesMap={};tablesMap[curTable.DisplayName]=newDisplayName;bIsAddTable=true}if(bIsAddTable)t._isLockedDefNames(null,null)}if(specialPasteProps.formatTable)t.model.deletePivotTables(pasteToRange);if(fromBinary&&val.pivotTables&&val.pivotTables.length&&specialPasteProps.formatTable)for(i=0;i<val.pivotTables.length;i++){var pivot=val.pivotTables[i]; pivot.prepareToPaste(t.model,new AscCommon.CellBase(arnToRange.r1-refInsertBinary.r1,arnToRange.c1-refInsertBinary.c1),true);t.model.workbook.oApi._changePivotSimple(pivot,true,false,function(){t.model.insertPivotTable(pivot,true,true)})}if(specialPasteProps.val&&specialPasteProps.format)t.model.clearDataValidation([pasteToRange],true);if(fromBinary&&val.dataValidations&&val.dataValidations.elems.length&&specialPasteProps.val&&specialPasteProps.format){var aMultiples=AscCommonExcel.g_clipboardExcel.pasteProcessor.multipleSettings; var oMultiple;if(aMultiples)for(i=0;i<aMultiples.length;i++)if(aMultiples[i].pasteInRange&&aMultiples[i].pasteInRange.isEqual(pasteToRange)){oMultiple=aMultiples[i];break}var xW=oMultiple?oMultiple.w/oMultiple.pasteW:1;var xH=oMultiple?oMultiple.h/oMultiple.pasteH:1;var _pasteH=oMultiple?oMultiple.pasteH:0;var _pasteW=oMultiple?oMultiple.pasteW:0;for(i=0;i<xW;i++)for(var j=0;j<xH;j++){var _offset=new AscCommon.CellBase(arnToRange.r1-refInsertBinary.r1+j*_pasteH,arnToRange.c1-refInsertBinary.c1+i* _pasteW);for(var n=0;n<val.dataValidations.elems.length;n++){var dataValidation=val.dataValidations.elems[n].clone();if(dataValidation.prepeareToPaste(refInsertBinary,_offset)){if(refInsertBinary){var formulaOffset=new AscCommon.CellBase(pasteToRange.r1-refInsertBinary.r1,pasteToRange.c1-refInsertBinary.c1);dataValidation._init(this.model,true);dataValidation.setOffset(formulaOffset)}t.model.addDataValidation(dataValidation,true)}}}}intersectionRangeWithTableParts=t.model.autoFilters._intersectionRangeWithTableParts(arnToRange); if(intersectionRangeWithTableParts&&intersectionRangeWithTableParts.length){var tablePart;for(i=0;i<intersectionRangeWithTableParts.length;i++){tablePart=intersectionRangeWithTableParts[i];this.model.getRange3(tablePart.Ref.r1,tablePart.Ref.c1,tablePart.Ref.r2,tablePart.Ref.c2).unmerge()}}t.model.workbook.dependencyFormulas.lockRecal();var pastedData;if(fromBinary)pastedData=t.pasteFromBinary(val,null,tablesMap,pasteToRange);else{if(bText)specialPasteProps.font=false;pastedData=t._pasteFromHTML(val, null,specialPasteProps)}if(specialPasteHelper.specialPasteStart)if(window["Asc"].c_oSpecialPasteOperation.none!==specialPasteProps.operation&&null!==specialPasteProps.operation)specialPasteHelper.selectionRange=t.model.selectionRange?t.model.selectionRange.clone():null;t.model.checkChangeTablesContent(t.model.selectionRange.getLast());if(!pastedData){bIsUpdate=false;t.model.workbook.dependencyFormulas.unlockRecal();if(callTrigger)t.handlers.trigger("slowOperation",false);return}var arrFormula=pastedData[1]; var adjustFormatArr=[];for(i=0;i<arrFormula.length;++i){var rangeF=arrFormula[i].range;var valF=arrFormula[i].val;var arrayRef=arrFormula[i].arrayRef;if(arrayRef&&window["AscCommonExcel"].bIsSupportArrayFormula){var rangeFormulaArray=this.model.getRange3(arrayRef.r1,arrayRef.c1,arrayRef.r2,arrayRef.c2);rangeFormulaArray.setValue(valF,function(r){},true,arrayRef);History.Add(AscCommonExcel.g_oUndoRedoArrayFormula,AscCH.historyitem_ArrayFromula_AddFormula,this.model.getId(),new Asc.Range(arrayRef.c1, arrayRef.r1,arrayRef.c2,arrayRef.r2),new AscCommonExcel.UndoRedoData_ArrayFormula(arrayRef,valF))}else if(rangeF.isOneCell()){rangeF.setValue(valF,null,true);if(!fromBinary)adjustFormatArr.push(rangeF)}else{var oBBox=rangeF.getBBox0();t.model._getCell(oBBox.r1,oBBox.c1,function(cell){cell.setValue(valF,null,true)})}}t.model.workbook.dependencyFormulas.unlockRecal();if(arrFormula&&arrFormula.length)t.model.checkChangeTablesContent(t.model.selectionRange.getLast());if(!window["AscCommon"].g_specialPasteHelper.specialPasteStart){var checkTablesPaste= function(){var _res=false;if(val.TableParts&&val.TableParts.length&&activeCellsPasteFragment)for(var i=0;i<val.TableParts.length;i++)if(activeCellsPasteFragment.containsRange(val.TableParts[i].Ref)){_res=true;break}return _res};if(this.isMultiSelect()){window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.Special_Paste_Hide_Button()}else{var isTablePasted=checkTablesPaste();var allowedSpecialPasteProps;var sProps=Asc.c_oSpecialPasteProps;if(fromBinary){allowedSpecialPasteProps= [sProps.paste,sProps.pasteOnlyFormula,sProps.formulaNumberFormat,sProps.formulaAllFormatting,sProps.formulaWithoutBorders,sProps.formulaColumnWidth,sProps.pasteOnlyValues,sProps.valueNumberFormat,sProps.valueAllFormating,sProps.pasteOnlyFormating,sProps.comments,sProps.columnWidth];if(!isTablePasted)allowedSpecialPasteProps.push(sProps.transpose)}else if(bText)allowedSpecialPasteProps=[sProps.keepTextOnly,sProps.useTextImport];else allowedSpecialPasteProps=[sProps.sourceformatting,sProps.destinationFormatting]; window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.buttonInfo.asc_setOptions(allowedSpecialPasteProps);if(fromBinary)window["AscCommon"].g_specialPasteHelper.buttonInfo.asc_setShowPasteSpecial(true);if(isTablePasted)window["AscCommon"].g_specialPasteHelper.buttonInfo.asc_setContainTables(true);window["AscCommon"].g_specialPasteHelper.buttonInfo.setRange(pastedData[0])}}else{window["AscCommon"].g_specialPasteHelper.buttonInfo.setRange(pastedData[0]); window["AscCommon"].g_specialPasteHelper.SpecialPasteButton_Update_Position()}return{selectData:pastedData,adjustFormatArr:adjustFormatArr}};WorksheetView.prototype._loadDataBeforePaste=function(isLargeRange,val,bIsUpdate,canChangeColWidth,pasteToRange){var t=this;var specialPasteHelper=window["AscCommon"].g_specialPasteHelper;var specialPasteProps=specialPasteHelper.specialPasteProps;var selectData;var specialPasteChangeColWidth=specialPasteProps&&specialPasteProps.width;var fromBinaryExcel=val.fromBinary; var pasteContent=val.data;var pastedInfo=[];var callback=function(){for(var j=0;j<pasteToRange.length;j++){_doPaste(pasteToRange[j]);if(!selectData&&!fromBinaryExcel){History.EndTransaction();window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return}}var _selection;if(fromBinaryExcel)for(var n=0;n<pastedInfo.length;n++){if(pastedInfo){_selection=t.model.selectionRange.ranges[n];_selection.c2=pastedInfo[n].selectData[0].c2;_selection.r2=pastedInfo[n].selectData[0].r2}}else{_selection=t.model.selectionRange.getLast(); if(pastedInfo){_selection.c2=pastedInfo[0].selectData[0].c2;_selection.r2=pastedInfo[0].selectData[0].r2}}History.EndTransaction();selectData=selectData?selectData.selectData:null;if(!selectData){window["AscCommon"].g_specialPasteHelper.Paste_Process_End();return}var arn=selectData[0];if(bIsUpdate){if(isLargeRange)t.handlers.trigger("slowOperation",false);if(specialPasteChangeColWidth)t.changeWorksheet("update");else if(arn.length)for(var i=0;i<arn.length;i++)t._updateRange(arn[i]);else t._updateRange(arn)}window["AscCommon"].g_specialPasteHelper.Paste_Process_End(); if(val.needDraw)t.draw();else val.needDraw=true;var oSelection=History.GetSelection();if(null!=oSelection){oSelection=oSelection.clone();oSelection.assign(arn.c1,arn.r1,arn.c2,arn.r2);History.SetSelection(oSelection);History.SetSelectionRedo(oSelection)}if(val.pasteAllSheet)History.EndTransaction()};var _doPaste=function(_pasteToRange){if(fromBinaryExcel)AscCommonExcel.executeInR1C1Mode(false,function(){selectData=t._pasteData(isLargeRange,fromBinaryExcel,pasteContent,bIsUpdate,_pasteToRange)});else{var imagesFromWord= pasteContent.props.addImagesFromWord;if(imagesFromWord&&imagesFromWord.length!==0&&!(window["Asc"]["editor"]&&window["Asc"]["editor"].isChartEditor)&&specialPasteProps.images){var oObjectsForDownload=AscCommon.GetObjectsForImageDownload(pasteContent.props._aPastedImages);var oImageMap;if(AscCommonExcel.g_clipboardExcel.pasteProcessor.alreadyLoadImagesOnServer===true){oImageMap={};for(var i=0,length=oObjectsForDownload.aBuilderImagesByUrl.length;i<length;++i){var url=oObjectsForDownload.aUrls[i];var name= AscCommonExcel.g_clipboardExcel.pasteProcessor.oImages[url];var aImageElem=oObjectsForDownload.aBuilderImagesByUrl[i];if(name){if(Array.isArray(aImageElem))for(var j=0;j<aImageElem.length;++j){var imageElem=aImageElem[j];if(null!=imageElem)imageElem.SetUrl(name)}oImageMap[i]=name}else oImageMap[i]=url}selectData=t._pasteData(isLargeRange,fromBinaryExcel,pasteContent,bIsUpdate,_pasteToRange);AscCommonExcel.g_clipboardExcel.pasteProcessor._insertImagesFromBinaryWord(t,pasteContent,oImageMap)}else{oImageMap= pasteContent.props.oImageMap;if(window["NATIVE_EDITOR_ENJINE"]){AscCommon.ResetNewUrls(pasteContent.props.data,oObjectsForDownload.aUrls,oObjectsForDownload.aBuilderImagesByUrl,oImageMap);selectData=t._pasteData(isLargeRange,fromBinaryExcel,pasteContent,bIsUpdate,_pasteToRange);AscCommonExcel.g_clipboardExcel.pasteProcessor._insertImagesFromBinaryWord(t,pasteContent,oImageMap)}else{selectData=t._pasteData(isLargeRange,fromBinaryExcel,pasteContent,bIsUpdate,_pasteToRange);AscCommonExcel.g_clipboardExcel.pasteProcessor._insertImagesFromBinaryWord(t, pasteContent,oImageMap)}}}else selectData=t._pasteData(isLargeRange,fromBinaryExcel,pasteContent,bIsUpdate,_pasteToRange,val.bText);if(selectData&&selectData.adjustFormatArr&&selectData.adjustFormatArr.length)for(i=0;i<selectData.adjustFormatArr.length;i++)selectData.adjustFormatArr[i]._foreach(function(cell){cell._adjustCellFormat()})}pastedInfo.push(selectData)};var fonts=pasteContent.props&&pasteContent.props.fontsNew?pasteContent.props.fontsNew:val.fontsNew;callback()};WorksheetView.prototype._pasteFromHTML= function(pasteContent,isCheckSelection,specialPasteProps){var t=this;var lastSelection=this.model.selectionRange.getLast();var arn=AscCommonExcel.g_clipboardExcel.pasteProcessor&&AscCommonExcel.g_clipboardExcel.pasteProcessor.activeRange?AscCommonExcel.g_clipboardExcel.pasteProcessor.activeRange:lastSelection;var arrFormula=[];var numFor=0;var rMax=pasteContent.content.length+pasteContent.props.rowSpanSpCount+arn.r1;var cMax=pasteContent.props.cellCount+arn.c1;var isMultiple=false;var firstCell=t.model.getRange3(arn.r1, arn.c1,arn.r1,arn.c1);var isMergedFirstCell=firstCell.hasMerged();var rangeUnMerge=t.model.getRange3(arn.r1,arn.c1,rMax-1,cMax-1);var isOneMerge=false;var fPasteCell=pasteContent.content[0][0];var colSpanCompare=cMax-arn.c1===fPasteCell.colSpan;var rowSpanCompare=rMax-arn.r1===fPasteCell.rowSpan;if(arn.c2>=cMax-1&&arn.r2>=rMax-1&&isMergedFirstCell&&isMergedFirstCell.isEqual(arn)&&colSpanCompare&&rowSpanCompare){if(!isCheckSelection){pasteContent.content[0][0].colSpan=isMergedFirstCell.c2-isMergedFirstCell.c1+ 1;pasteContent.content[0][0].rowSpan=isMergedFirstCell.r2-isMergedFirstCell.r1+1}isOneMerge=true}else for(var rFirst=arn.r1;rFirst<rMax;++rFirst)for(var cFirst=arn.c1;cFirst<cMax;++cFirst){var range=t.model.getRange3(rFirst,cFirst,rFirst,cFirst);var merged=range.hasMerged();if(merged)if(merged.r1<arn.r1||merged.r2>rMax-1||merged.c1<arn.c1||merged.c2>cMax-1)if(isCheckSelection)return arn;else{this.handlers.trigger("onErrorEvent",c_oAscError.ID.PastInMergeAreaError,c_oAscError.Level.NoCritical);return}}var rMax2= rMax;var cMax2=cMax;rMax=pasteContent.content.length;if(isCheckSelection){var newArr=arn.clone(true);newArr.r2=rMax2-1;newArr.c2=cMax2-1;if(isMultiple||isOneMerge){newArr.r2=lastSelection.r2;newArr.c2=lastSelection.c2}return newArr}if(specialPasteProps.format)rangeUnMerge.unmerge();if(!isOneMerge){arn.r2=rMax2-1>0?rMax2-1:0;arn.c2=cMax2-1>0?cMax2-1:0}var maxARow=1,maxACol=1,plRow=0,plCol=0;var mergeArr=[];var putInsertedCellIntoRange=function(row,col,currentObj){var pastedRangeProps={};var contentCurrentObj= currentObj.content;var range=t.model.getRange3(row,col,row,col);if(contentCurrentObj.length===1){var onlyOneChild=contentCurrentObj[0];pastedRangeProps.val=onlyOneChild.text;pastedRangeProps.font=onlyOneChild.format}else{pastedRangeProps.value2=contentCurrentObj;pastedRangeProps.val=currentObj.textVal}pastedRangeProps.alignVertical=currentObj.alignVertical;if(contentCurrentObj.length===1&&contentCurrentObj[0].format){var fs=contentCurrentObj[0].format.getSize();if(fs!==""&&fs!==null&&fs!==undefined)pastedRangeProps.fontSize= fs}if(currentObj.props&¤tObj.props.fontName)pastedRangeProps.fontName=currentObj.props.fontName;if(!isOneMerge)pastedRangeProps.alignHorizontal=currentObj.alignHorizontal;var isMerged=false;for(var mergeCheck=0;mergeCheck<mergeArr.length;++mergeCheck)if(mergeArr[mergeCheck].contains(col,row))isMerged=true;if((currentObj.colSpan>1||currentObj.rowSpan>1)&&!isMerged){var offsetCol=currentObj.colSpan-1;var offsetRow=currentObj.rowSpan-1;pastedRangeProps.offsetLast=new AscCommon.CellBase(offsetRow, offsetCol);mergeArr.push(new Asc.Range(range.bbox.c1,range.bbox.r1,range.bbox.c2+offsetCol,range.bbox.r2+offsetRow));if(contentCurrentObj[0]==undefined)pastedRangeProps.val="";pastedRangeProps.merge=c_oAscMergeOptions.Merge}if(!isOneMerge)pastedRangeProps.borders=currentObj.borders;pastedRangeProps.wrap=currentObj.wrap;if(currentObj.bc&¤tObj.bc.rgb)pastedRangeProps.fillColor=currentObj.bc;if(currentObj.hyperLink||currentObj.location)pastedRangeProps.hyperLink=currentObj;t._setPastedDataByCurrentRange(range, pastedRangeProps,{arrFormula:arrFormula},specialPasteProps)};var oldDecimalSep,oldGroupSep;if(specialPasteProps.advancedOptions){var _numberDecimalSeparator=specialPasteProps.advancedOptions.numberDecimalSeparator;if(_numberDecimalSeparator&&isNaN(_numberDecimalSeparator)){oldDecimalSep=AscCommon.g_oDefaultCultureInfo.NumberDecimalSeparator;AscCommon.g_oDefaultCultureInfo.NumberDecimalSeparator=specialPasteProps.advancedOptions.numberDecimalSeparator}var _numberDecimalSeparator=specialPasteProps.advancedOptions.numberGroupSeparator; if(_numberDecimalSeparator&&isNaN(_numberDecimalSeparator)){oldGroupSep=AscCommon.g_oDefaultCultureInfo.NumberGroupSeparator;AscCommon.g_oDefaultCultureInfo.NumberGroupSeparator=specialPasteProps.advancedOptions.numberGroupSeparator}}for(var autoR=0;autoR<maxARow;++autoR)for(var autoC=0;autoC<maxACol;++autoC)for(var r=0;r<rMax;++r)for(var c=0;c<pasteContent.content[r].length;++c)if(undefined!==pasteContent.content[r][c]){var pasteIntoRow=r+autoR*plRow+arn.r1;var pasteIntoCol=c+autoC*plCol+arn.c1; var currentObj=pasteContent.content[r][c];putInsertedCellIntoRange(pasteIntoRow,pasteIntoCol,currentObj)}if(specialPasteProps.advancedOptions){if(oldDecimalSep)AscCommon.g_oDefaultCultureInfo.NumberDecimalSeparator=oldDecimalSep;if(oldGroupSep)AscCommon.g_oDefaultCultureInfo.NumberGroupSeparator=oldGroupSep}if(isMultiple){arn.r2=lastSelection.r2;arn.c2=lastSelection.c2}t.isChanged=true;return[arn,arrFormula]};WorksheetView.prototype.pasteFromBinary=function(val,isCheckSelection,tablesMap,pasteToRange){var pasteRange= AscCommonExcel.g_clipboardExcel.pasteProcessor.activeRange;if(typeof pasteRange==="string")AscCommonExcel.executeInR1C1Mode(false,function(){pasteRange=AscCommonExcel.g_oRangeCache.getAscRange(pasteRange)});var pastedCol=pasteRange.c2-pasteRange.c1+1;var pastedRow=pasteRange.r2-pasteRange.r1+1;var _checkSize=function(_range){var _col=_range.c2-_range.c1+1;var _row=_range.r2-_range.r1+1;if(_col%pastedCol===0&&_row%pastedRow===0)return true;if(_col%pastedCol===0&&pastedRow===1)return true;if(_row%pastedRow=== 0&&pastedCol===1)return true;return true;return false};var selectRanges=this.model.selectionRange.ranges;var i;if(selectRanges.length>1)for(i=0;i<selectRanges.length;i++)if(!_checkSize(selectRanges[i]))return;var res;if(isCheckSelection)for(i=0;i<selectRanges.length;i++){var _selection=this._pasteFromBinary(val,isCheckSelection,tablesMap,selectRanges[i]);if(!res)res=[];res.push(_selection)}else res=this._pasteFromBinary(val,isCheckSelection,tablesMap,pasteToRange);return res};WorksheetView.prototype._pasteFromBinary= function(val,isCheckSelection,tablesMap,pasteInRange){var t=this;var trueActiveRange=pasteInRange?pasteInRange.clone():t.model.selectionRange.getLast().clone();var arn=pasteInRange?pasteInRange.clone():t.model.selectionRange.getLast().clone();var arrFormula=[];var pasteRange=AscCommonExcel.g_clipboardExcel.pasteProcessor.activeRange;var activeCellsPasteFragment;if(typeof pasteRange==="string")AscCommonExcel.executeInR1C1Mode(false,function(){activeCellsPasteFragment=AscCommonExcel.g_oRangeCache.getAscRange(pasteRange)}); else activeCellsPasteFragment=pasteRange;var specialPasteHelper=window["AscCommon"].g_specialPasteHelper;var specialPasteProps=specialPasteHelper.specialPasteProps;var countPasteRow=activeCellsPasteFragment.r2-activeCellsPasteFragment.r1+1;var countPasteCol=activeCellsPasteFragment.c2-activeCellsPasteFragment.c1+1;if(specialPasteProps&&specialPasteProps.transpose){countPasteRow=activeCellsPasteFragment.c2-activeCellsPasteFragment.c1+1;countPasteCol=activeCellsPasteFragment.r2-activeCellsPasteFragment.r1+ 1}var rMax=countPasteRow+arn.r1;var cMax=countPasteCol+arn.c1;if(cMax>gc_nMaxCol0)cMax=gc_nMaxCol0;if(rMax>gc_nMaxRow0)rMax=gc_nMaxRow0;var isMultiple=false;var firstCell=t.model.getRange3(arn.r1,arn.c1,arn.r1,arn.c1);var isMergedFirstCell=firstCell.hasMerged();var isOneMerge=false;var startCell=val.getCell3(activeCellsPasteFragment.r1,activeCellsPasteFragment.c1);var isMergedStartCell=startCell.hasMerged();var firstValuesCol;var firstValuesRow;if(isMergedStartCell!=null){firstValuesCol=isMergedStartCell.c2- isMergedStartCell.c1;firstValuesRow=isMergedStartCell.r2-isMergedStartCell.r1}else{firstValuesCol=0;firstValuesRow=0}var excludeHiddenRows=t.model.autoFilters.bIsExcludeHiddenRows(pasteInRange?pasteInRange.clone():t.model.selectionRange.getLast(),t.model.selectionRange.activeCell);var hiddenRowsArray={};var getOpenRowsCount=function(oRange){var res=oRange.r2-oRange.r1+1;if(false&&excludeHiddenRows){var tempRange=t.model.getRange3(oRange.r1,0,oRange.r2,0);tempRange._foreachRowNoEmpty(function(row){if(row.getHidden()){res--; if(!isCheckSelection)hiddenRowsArray[row.index]=1}})}return res};if(!isMergedFirstCell)if(arn.c1===arn.c2&&arn.r2>arn.r1&&countPasteCol>1&&countPasteRow===1){arn.c2=arn.c1+countPasteCol-1;trueActiveRange.c2=arn.c2}else if(arn.r1===arn.r2&&arn.c2>arn.c1&&countPasteRow>1&&countPasteCol===1){arn.r2=arn.r1+countPasteRow-1;trueActiveRange.r2=arn.r2}var rowDiff=arn.r1-activeCellsPasteFragment.r1;var colDiff=arn.c1-activeCellsPasteFragment.c1;var newPasteRange=new Asc.Range(arn.c1-colDiff,arn.r1-rowDiff, arn.c2-colDiff,arn.r2-rowDiff);if(isMergedFirstCell&&isMergedFirstCell.isEqual(arn)&&cMax-arn.c1===firstValuesCol+1&&rMax-arn.r1===firstValuesRow+1&&!newPasteRange.isEqual(activeCellsPasteFragment)){isOneMerge=true;rMax=arn.r2+1;cMax=arn.c2+1}else if(arn.c2>=cMax-1&&arn.r2>=rMax-1){var widthArea=arn.c2-arn.c1+1;var heightArea=getOpenRowsCount(arn);var widthPasteFr=cMax-arn.c1;var heightPasteFr=rMax-arn.r1;if(widthArea%widthPasteFr===0&&heightArea%heightPasteFr===0){if(arn.getType()!==window["Asc"].c_oAscSelectionType.RangeMax&& arn.getType()!==window["Asc"].c_oAscSelectionType.RangeCol&&arn.getType()!==window["Asc"].c_oAscSelectionType.RangeRow){isMultiple=true;if(!AscCommonExcel.g_clipboardExcel.pasteProcessor.multipleSettings)AscCommonExcel.g_clipboardExcel.pasteProcessor.multipleSettings=[];AscCommonExcel.g_clipboardExcel.pasteProcessor.multipleSettings.push({w:widthArea,h:heightArea,pasteW:widthPasteFr,pasteH:heightPasteFr,pasteInRange:pasteInRange})}}else if(firstCell.hasMerged()!==null)if(isCheckSelection)return arn; else{this.handlers.trigger("onError",c_oAscError.ID.PastInMergeAreaError,c_oAscError.Level.NoCritical);return}}else for(var rFirst=arn.r1;rFirst<rMax;++rFirst)for(var cFirst=arn.c1;cFirst<cMax;++cFirst){var range=t.model.getRange3(rFirst,cFirst,rFirst,cFirst);var merged=range.hasMerged();if(merged)if(merged.r1<arn.r1||merged.r2>rMax-1||merged.c1<arn.c1||merged.c2>cMax-1)if(isCheckSelection)return arn;else{this.handlers.trigger("onErrorEvent",c_oAscError.ID.PastInMergeAreaError,c_oAscError.Level.NoCritical); return}}var rMax2=rMax;var cMax2=cMax;var getLockRange=function(){var newArr=arn.clone(true);newArr.r2=rMax2-1;newArr.c2=cMax2-1;if(isMultiple||isOneMerge){newArr.r2=arn.r2;newArr.c2=arn.c2}return newArr};if(isCheckSelection)return getLockRange();var bboxUnMerge=getLockRange();var rangeUnMerge=t.model.getRange3(bboxUnMerge.r1,bboxUnMerge.c1,bboxUnMerge.r2,bboxUnMerge.c2);if(specialPasteProps.format){rangeUnMerge.unmerge();this.cellCommentator.deleteCommentsRange(rangeUnMerge.bbox)}if(!isOneMerge){arn.r2= rMax2-1;arn.c2=cMax2-1}var maxARow=1,maxACol=1,plRow=0,plCol=0;if(isMultiple){if(specialPasteProps.format)t.model.getRange3(trueActiveRange.r1,trueActiveRange.c1,trueActiveRange.r2,trueActiveRange.c2).unmerge();maxARow=heightArea/heightPasteFr;maxACol=widthArea/widthPasteFr;plRow=rMax2-arn.r1;plCol=arn.c2-arn.c1+1}else{trueActiveRange.r2=arn.r2;trueActiveRange.c2=arn.c2}var intersectionAllRangeWithTables=t.model.autoFilters._intersectionRangeWithTableParts(trueActiveRange);var addComments=function(pasteRow, pasteCol,comments){var comment;var isMergedCell=val.getMergedByCell(pasteRow,pasteCol);for(var i=0;i<comments.length;i++){comment=comments[i];var _isMergedContain=isMergedCell&&isMergedCell.contains(comment.nCol,comment.nRow);if(_isMergedContain||comment.nCol===pasteCol&&comment.nRow===pasteRow){var commentData=comment.clone(true);commentData.asc_putCol(nCol);commentData.asc_putRow(nRow);t.cellCommentator.addComment(commentData,true)}}};var mergeArr=[];var checkMerge=function(range,curMerge,nRow, nCol,rowDiff,colDiff,pastedRangeProps){var isMerged=false;for(var mergeCheck=0;mergeCheck<mergeArr.length;++mergeCheck)if(mergeArr[mergeCheck].contains(nCol,nRow))isMerged=true;if(!isOneMerge){if(curMerge!=null&&!isMerged){var offsetCol=curMerge.c2-curMerge.c1;if(offsetCol+nCol>=gc_nMaxCol0)offsetCol=gc_nMaxCol0-nCol;var offsetRow=curMerge.r2-curMerge.r1;if(offsetRow+nRow>=gc_nMaxRow0)offsetRow=gc_nMaxRow0-nRow;pastedRangeProps.offsetLast=new AscCommon.CellBase(offsetRow,offsetCol);if(specialPasteProps.transpose)mergeArr.push(new Asc.Range(curMerge.c1+ arn.c1-activeCellsPasteFragment.r1+colDiff,curMerge.r1+arn.r1-activeCellsPasteFragment.c1+rowDiff,curMerge.c2+arn.c1-activeCellsPasteFragment.r1+colDiff,curMerge.r2+arn.r1-activeCellsPasteFragment.c1+rowDiff));else mergeArr.push(new Asc.Range(curMerge.c1+arn.c1-activeCellsPasteFragment.c1+colDiff,curMerge.r1+arn.r1-activeCellsPasteFragment.r1+rowDiff,curMerge.c2+arn.c1-activeCellsPasteFragment.c1+colDiff,curMerge.r2+arn.r1-activeCellsPasteFragment.r1+rowDiff))}}else if(!isMerged){pastedRangeProps.offsetLast= new AscCommon.CellBase(isMergedFirstCell.r2-isMergedFirstCell.r1,isMergedFirstCell.c2-isMergedFirstCell.c1);mergeArr.push(new Asc.Range(isMergedFirstCell.c1,isMergedFirstCell.r1,isMergedFirstCell.c2,isMergedFirstCell.r2))}};var getTableDxf=function(pasteRow,pasteCol,newVal){var dxf=null;if(false!==intersectionAllRangeWithTables)return{dxf:null};var tables=val.autoFilters._intersectionRangeWithTableParts(newVal.bbox);var blocalArea=true;if(tables&&tables[0]){var table=tables[0];var styleInfo=table.TableStyleInfo; var styleForCurTable=styleInfo?t.model.workbook.TableStyles.AllStyles[styleInfo.Name]:null;if(activeCellsPasteFragment.containsRange(table.Ref))blocalArea=false;if(!styleForCurTable)return null;var headerRowCount=1;var totalsRowCount=0;if(null!=table.HeaderRowCount)headerRowCount=table.HeaderRowCount;if(null!=table.TotalsRowCount)totalsRowCount=table.TotalsRowCount;var bbox=new Asc.Range(table.Ref.c1,table.Ref.r1,table.Ref.c2,table.Ref.r2);styleForCurTable.initStyle(val.sheetMergedStyles,bbox,styleInfo, headerRowCount,totalsRowCount);val._getCell(pasteRow,pasteCol,function(cell){if(cell)dxf=cell.getCompiledStyle();if(null===dxf){pasteRow=pasteRow-table.Ref.r1;pasteCol=pasteCol-table.Ref.c1;dxf=val.getCompiledStyle(pasteRow,pasteCol)}})}return{dxf:dxf,blocalArea:blocalArea}};var findFormulaArrayFirstCell=function(_arr,_cell){var res=null;if(_arr&&_cell)for(var n=0;n<_arr.length;n++)if(_arr[n].ref&&_arr[n].ref.contains(_cell.nCol,_cell.nRow)){res=_arr[n].newVal;break}return res};var colsWidth={};var pastedFormulaArray= [];var putInsertedCellIntoRange=function(nRow,nCol,pasteRow,pasteCol,rowDiff,colDiff,range,newVal,curMerge,transposeRange){var pastedRangeProps={};var firstRange=range.clone();if(specialPasteProps.comment&&val.aComments&&val.aComments.length)addComments(pasteRow,pasteCol,val.aComments);checkMerge(range,curMerge,nRow,nCol,rowDiff,colDiff,pastedRangeProps);if(!isOneMerge)pastedRangeProps.cellStyle=newVal.getStyleName();if(!isOneMerge){var numFormat=newVal.getNumFormat();var nameFormat;if(numFormat&& numFormat.sFormat)nameFormat=numFormat.sFormat;pastedRangeProps.numFormat=nameFormat}if(!isOneMerge){var align=newVal.getAlign();pastedRangeProps.alignVertical=align.getAlignVertical();pastedRangeProps.alignHorizontal=align.getAlignHorizontal();var fullBorders;if(specialPasteProps.transpose)fullBorders=newVal.getBorder(newVal.bbox.r1,newVal.bbox.c1).clone();else fullBorders=newVal.getBorderFull();if(pastedRangeProps.offsetLast&&pastedRangeProps.offsetLast.col>0&&curMerge&&fullBorders){var endMergeCell= val.getCell3(pasteRow,curMerge.c2);var fullBordersEndMergeCell=endMergeCell.getBorderFull();if(fullBordersEndMergeCell&&fullBordersEndMergeCell.r)fullBorders.r=fullBordersEndMergeCell.r}pastedRangeProps.bordersFull=fullBorders;pastedRangeProps.fill=newVal.getFill();pastedRangeProps.wrap=align.getWrap();pastedRangeProps.angle=align.getAngle();pastedRangeProps.hyperlinkObj=newVal.getHyperlink();pastedRangeProps.font=newVal.getFont();pastedRangeProps.shrinkToFit=align.getShrinkToFit()}var tableDxf=getTableDxf(pasteRow, pasteCol,newVal);if(tableDxf&&tableDxf.blocalArea)pastedRangeProps.tableDxfLocal=tableDxf.dxf;else if(tableDxf)pastedRangeProps.tableDxf=tableDxf.dxf;if(undefined===colsWidth[nCol])colsWidth[nCol]=val._getCol(pasteCol);pastedRangeProps.colsWidth=colsWidth;var fromCell;val._getCell(pasteRow,pasteCol,function(cell){fromCell=cell;var _formulaArrayRef=cell.formulaParsed&&cell.formulaParsed.getArrayFormulaRef();if(_formulaArrayRef)pastedFormulaArray.push({ref:_formulaArrayRef,newVal:newVal})});var formulaProps= {firstRange:firstRange,arrFormula:arrFormula,tablesMap:tablesMap,newVal:newVal,isOneMerge:isOneMerge,val:val,activeCellsPasteFragment:activeCellsPasteFragment,transposeRange:transposeRange,cell:fromCell,fromRange:activeCellsPasteFragment,fromBinary:true,formulaArrayFirstCell:findFormulaArrayFirstCell(pastedFormulaArray,fromCell)};t._setPastedDataByCurrentRange(range,pastedRangeProps,formulaProps,specialPasteProps)};var fromSelectionRange=val.selectionRange.getLast();var fromSelectionRangeType=fromSelectionRange.getType(); if(Asc.c_oAscSelectionType.RangeCol===fromSelectionRangeType||Asc.c_oAscSelectionType.RangeRow===fromSelectionRangeType||Asc.c_oAscSelectionType.RangeMax===fromSelectionRangeType){maxARow=1;maxACol=1}var getNextNoHiddenRow=function(index){var startIndex=index;while(hiddenRowsArray[index])index++;return index-startIndex};var hiddenRowCount={};for(var autoR=0;autoR<maxARow;++autoR)for(var autoC=0;autoC<maxACol;++autoC){if(!hiddenRowCount[autoC])hiddenRowCount[autoC]=0;for(var r=0;r<rMax-arn.r1;++r)for(var c= 0;c<cMax-arn.c1;++c){if(false&&isMultiple&&hiddenRowsArray[r+autoR*plRow+arn.r1+hiddenRowCount[autoC]])hiddenRowCount[autoC]+=getNextNoHiddenRow(r+autoR*plRow+arn.r1+hiddenRowCount[autoC]);var pasteRow=r+activeCellsPasteFragment.r1;var pasteCol=c+activeCellsPasteFragment.c1;if(specialPasteProps.transpose){pasteRow=c+activeCellsPasteFragment.r1;pasteCol=r+activeCellsPasteFragment.c1}var newVal=val.getCell3(pasteRow,pasteCol);if(undefined!==newVal){var nRow=r+autoR*plRow+arn.r1+hiddenRowCount[autoC]; var nCol=c+autoC*plCol+arn.c1;if(nRow>gc_nMaxRow0)nRow=gc_nMaxRow0;if(nCol>gc_nMaxCol0)nCol=gc_nMaxCol0;var curMerge=newVal.hasMerged();if(curMerge&&specialPasteProps.transpose){curMerge=curMerge.clone();var r1=curMerge.r1;var r2=curMerge.r2;var c1=curMerge.c1;var c2=curMerge.c2;curMerge.r1=c1;curMerge.r2=c2;curMerge.c1=r1;curMerge.c2=r2}range=t.model.getRange3(nRow,nCol,nRow,nCol);var transposeRange=null;if(specialPasteProps.transpose)transposeRange=t.model.getRange3(c+autoR*plRow+arn.r1,r+autoC* plCol+arn.c1,c+autoR*plRow+arn.r1,r+autoC*plCol+arn.c1);putInsertedCellIntoRange(nRow,nCol,pasteRow,pasteCol,autoR*plRow,autoC*plCol,range,newVal,curMerge,transposeRange);c=range.bbox.c2-autoC*plCol-arn.c1;if(c===cMax)r=range.bbox.r2-autoC*plCol-arn.r1}}}t.isChanged=true;return[trueActiveRange,arrFormula]};WorksheetView.prototype._setPastedDataByCurrentRange=function(range,rangeStyle,formulaProps,specialPasteProps){var t=this;var firstRange,arrFormula,tablesMap,newVal,isOneMerge,val,activeCellsPasteFragment, transposeRange;if(formulaProps){firstRange=formulaProps.firstRange;arrFormula=formulaProps.arrFormula;tablesMap=formulaProps.tablesMap;newVal=formulaProps.newVal;isOneMerge=formulaProps.isOneMerge;val=formulaProps.val;activeCellsPasteFragment=formulaProps.activeCellsPasteFragment;transposeRange=formulaProps.transposeRange}if(specialPasteProps&&specialPasteProps.skipBlanks&&newVal&&newVal.isNullText())return;var _calculateSpecialOperation=function(part1,part2,_operation,_isFormula){if(part1!==null&& part2!==null){var _res=null;switch(_operation){case window["Asc"].c_oSpecialPasteOperation.add:{if(_isFormula)_res=part1+"+"+part2;else _res=part1+part2;break}case window["Asc"].c_oSpecialPasteOperation.subtract:{if(_isFormula)_res=part1+"-"+part2;else _res=part1-part2;break}case window["Asc"].c_oSpecialPasteOperation.multiply:{if(_isFormula)_res=part1+"*"+part2;else _res=part1*part2;break}case window["Asc"].c_oSpecialPasteOperation.divide:{if(_isFormula)_res=part1+"/"+part2;else if(part2===0)_res= AscCommon.cErrorLocal["div"];else _res=part1/part2;break}}}return _res};var applySpecialOperation=function(_pastedVal,_modelVal,_operation,isEmptyPasted,isEmptyModel){if(_operation===null)return _pastedVal;var _typePasted=_pastedVal&&_pastedVal.value&&!isEmptyPasted?_pastedVal.value.type:null;var _typeModel=_modelVal&&_modelVal.value&&!isEmptyModel?_modelVal.value.type:null;var res=null;var _calculateRes=undefined;if(_typePasted===CellValueType.Number&&_typeModel===CellValueType.Number)_calculateRes= _calculateSpecialOperation(_modelVal.value.number,_pastedVal.value.number,_operation);else if(_typePasted===CellValueType.Number&&isEmptyModel)_calculateRes=_calculateSpecialOperation(0,_pastedVal.value.number,_operation);else if(_typeModel===CellValueType.Number&&isEmptyPasted)_calculateRes=_calculateSpecialOperation(_modelVal.value.number,0,_operation);else res=_modelVal;if(_calculateRes!==undefined){if(!isNaN(_calculateRes))_pastedVal.value.number=_calculateRes;else{_pastedVal.value.text=_calculateRes; _pastedVal.value.type=CellValueType.Error;_pastedVal.value.number=null}res=_pastedVal}return res};var applySpecialOperationFormula=function(_pastedVal,_modelVal,_pastedFormula,_modelFormula,_operation,isEmptyPasted,isEmptyModel){var res,part1,part2;var _typePasted=_pastedVal&&_pastedVal.value&&!isEmptyPasted?_pastedVal.value.type:null;var _typeModel=_modelVal&&_modelVal.value&&!isEmptyModel?_modelVal.value.type:null;if(_pastedFormula&&_modelFormula){part2="("+_pastedFormula+")";part1="("+_modelFormula+ ")";res=_calculateSpecialOperation(part1,part2,_operation,true)}else if(_pastedFormula&&_typeModel===CellValueType.Number){part2="("+_pastedFormula+")";part1=_modelVal.value.number;res=_calculateSpecialOperation(part1,part2,_operation,true)}else if(_modelFormula&&_typePasted===CellValueType.Number){part2=_pastedVal.value.number;part1="("+_modelFormula+")";res=_calculateSpecialOperation(part1,part2,_operation,true)}else if(_pastedFormula&&isEmptyModel){part2="("+_pastedFormula+")";part1=0;res=_calculateSpecialOperation(part1, part2,_operation,true)}else if(_modelFormula&&isEmptyPasted){part2=0;part1="("+_modelFormula+")";res=_calculateSpecialOperation(part1,part2,_operation,true)}else if(_pastedFormula)res=null;else res=_modelFormula;return res};var getModelData=function(){var val=firstRange?firstRange.getValueData():range.getValueData();var formula=firstRange?firstRange.getFormula():range.getFormula();return{val:val,formula:formula}};var calculateValueAndBinaryFormula=function(newVal,firstRange,range){var needOperation= specialPasteProps&&specialPasteProps.operation;if(needOperation===window["Asc"].c_oSpecialPasteOperation.none)needOperation=null;var modelVal,modelFormula;if(null!==needOperation){var _modelData=getModelData();modelVal=_modelData.val;modelFormula=_modelData.formula}var isEmptyModel=firstRange?firstRange.isNullText():range.isNullText();var isEmptyPasted=newVal.isNullText();var cellValueData=specialPasteProps.cellStyle?newVal.getValueData():null;if(cellValueData){var _setOperationVal=applySpecialOperation(cellValueData, modelVal,needOperation,isEmptyPasted,isEmptyModel);if(null!==_setOperationVal)cellValueData=_setOperationVal}var cellValueDataDup=newVal.getValueData();if(cellValueData&&cellValueData.value){if(!specialPasteProps.formula)cellValueData.formula=null;rangeStyle.cellValueData=cellValueData}else if(cellValueData&&cellValueData.formula&&!specialPasteProps.formula){cellValueData.formula=null;rangeStyle.cellValueData=cellValueData}else if(needOperation!==null){var _tempValRes=applySpecialOperation(cellValueDataDup, modelVal,needOperation,isEmptyPasted,isEmptyModel);if(null===_tempValRes)rangeStyle.val="";else if(null!==_tempValRes.value.number)rangeStyle.val=_tempValRes.value.number.toString();else if(null!==_tempValRes.value.multiText)rangeStyle.val=_tempValRes.value.multiText;else if(_tempValRes.value.text)rangeStyle.val=_tempValRes.value.text}else rangeStyle.val=newVal.getValue();var _newVal=newVal;if(null!==needOperation&&formulaProps.formulaArrayFirstCell)_newVal=formulaProps.formulaArrayFirstCell;var pastedFormula= _newVal.getFormula();var sId=_newVal.getName();if(pastedFormula||modelFormula)if(pastedFormula&&!isOneMerge){var offset,arrayOffset;var arrayFormulaRef=needOperation===null&&formulaProps.cell&&formulaProps.cell.formulaParsed?formulaProps.cell.formulaParsed.getArrayFormulaRef():null;var cellAddress=new AscCommon.CellAddress(sId);if(specialPasteProps.transpose&&transposeRange)if(arrayFormulaRef){offset=new AscCommon.CellBase(transposeRange.bbox.r1-cellAddress.row+1,transposeRange.bbox.c1-cellAddress.col+ 1);arrayOffset=new AscCommon.CellBase(transposeRange.bbox.r1-cellAddress.row+1,transposeRange.bbox.c1-cellAddress.col+1)}else offset=new AscCommon.CellBase(transposeRange.bbox.r1-cellAddress.row+1,transposeRange.bbox.c1-cellAddress.col+1);else if(arrayFormulaRef){offset=new AscCommon.CellBase(range.bbox.r1-arrayFormulaRef.r1,range.bbox.c1-arrayFormulaRef.c1);arrayOffset=new AscCommon.CellBase(range.bbox.r1-cellAddress.row+1,range.bbox.c1-cellAddress.col+1)}else offset=new AscCommon.CellBase(range.bbox.r1- cellAddress.row+1,range.bbox.c1-cellAddress.col+1);var assemb,_p_=new AscCommonExcel.parserFormula(pastedFormula,null,t.model);if(_p_.parse(null,null,null,null,null,tablesMap)){if(arrayFormulaRef){arrayFormulaRef=arrayFormulaRef.clone();if(!formulaProps.fromRange.containsRange(arrayFormulaRef))arrayFormulaRef=arrayFormulaRef.intersection(formulaProps.fromRange);if(arrayFormulaRef){if(specialPasteProps.transpose){var diffCol1=arrayFormulaRef.c1-activeCellsPasteFragment.c1;var diffRow1=arrayFormulaRef.r1- activeCellsPasteFragment.r1;var diffCol2=arrayFormulaRef.c2-activeCellsPasteFragment.c1;var diffRow2=arrayFormulaRef.r2-activeCellsPasteFragment.r1;arrayFormulaRef.c1=activeCellsPasteFragment.c1+diffRow1;arrayFormulaRef.r1=activeCellsPasteFragment.r1+diffCol1;arrayFormulaRef.c2=activeCellsPasteFragment.c1+diffRow2;arrayFormulaRef.r2=activeCellsPasteFragment.r1+diffCol2}arrayFormulaRef.setOffset(arrayOffset?arrayOffset:offset)}}if(specialPasteProps.transpose)_p_.transpose(activeCellsPasteFragment); if(null!==tablesMap){var renameParams={};renameParams.offset=offset;renameParams.tableNameMap=tablesMap;_p_.renameSheetCopy(renameParams);assemb=_p_.assemble(true)}else assemb=_p_.changeOffset(offset,null,true).assemble(true);if(needOperation!==null)assemb=applySpecialOperationFormula(cellValueDataDup,modelVal,assemb,modelFormula,needOperation,isEmptyPasted,isEmptyModel);if(assemb!==null)rangeStyle.formula={range:range,val:"="+assemb,arrayRef:arrayFormulaRef}}}else if(modelFormula&&needOperation!== null){assemb=applySpecialOperationFormula(cellValueDataDup,modelVal,null,modelFormula,needOperation,isEmptyPasted,isEmptyModel);if(assemb!==null)rangeStyle.formula={range:range,val:"="+assemb,arrayRef:arrayFormulaRef}}};var calculateFormulaFromHtml=function(sFormula){if(sFormula)if(sFormula&&!isOneMerge){sFormula=sFormula.substr(1);var offset=new AscCommon.CellBase(0,0);var assemb,_p_=new AscCommonExcel.parserFormula(sFormula,null,t.model);if(_p_.parse()){assemb=_p_.changeOffset(offset,null,true).assemble(true); rangeStyle.formula={range:range,val:"="+assemb}}}};var searchRangeIntoFormulaArrays=function(arr,curRange){var res=false;if(arr&&curRange&&curRange.bbox)for(var i=0;i<arr.length;i++){var refArray=arr[i].arrayRef;if(refArray&&refArray.intersection(curRange.bbox)){res=true;break}}return res};if(specialPasteProps.format&&range.getHyperlink())range.removeHyperlink();var col=range.bbox.c1;if(specialPasteProps.width&&rangeStyle.colsWidth[col]){var widthProp=rangeStyle.colsWidth[col];t.model.setColWidth(widthProp.width, col,col);t.model.setColHidden(widthProp.hd,col,col);t.model.setColBestFit(widthProp.BestFit,widthProp.width,col,col);rangeStyle.colsWidth[col]=null}if(rangeStyle.offsetLast&&specialPasteProps.merge){range.setOffsetLast(rangeStyle.offsetLast);range.merge(rangeStyle.merge)}if(formulaProps&&formulaProps.fromBinary)calculateValueAndBinaryFormula(newVal,firstRange,range);else if(!specialPasteProps.advancedOptions&&rangeStyle&&rangeStyle.val&&rangeStyle.val.charAt(0)==="=")calculateFormulaFromHtml(rangeStyle.val); if(rangeStyle.fontName&&specialPasteProps.fontName)range.setFontname(rangeStyle.fontName);if(rangeStyle.cellStyle&&specialPasteProps.cellStyle){var oldBorders=null;if(!specialPasteProps.borders){oldBorders=range.getBorderFull();if(oldBorders)oldBorders=oldBorders.clone()}range.setCellStyle(rangeStyle.cellStyle);if(oldBorders){range.setBorder(null);range.setBorder(oldBorders)}}if(specialPasteProps.format&&!specialPasteProps.formatTable&&rangeStyle.tableDxf)range.getLeftTopCell(function(firstCell){if(firstCell)firstCell.setStyle(rangeStyle.tableDxf)}); if(rangeStyle.numFormat&&specialPasteProps.numFormat)range.setNumFormat(rangeStyle.numFormat);if(rangeStyle.font&&specialPasteProps.font){var font=rangeStyle.font;if(specialPasteProps.format&&!specialPasteProps.formatTable&&rangeStyle.tableDxf&&rangeStyle.tableDxf.font)font=rangeStyle.tableDxf.font.merge(rangeStyle.font);range.setFont(font)}var propPaste=specialPasteProps.property;var pasteOnlyText=propPaste===Asc.c_oSpecialPasteProps.valueNumberFormat||propPaste===Asc.c_oSpecialPasteProps.pasteOnlyValues; if(rangeStyle.formula&&specialPasteProps.formula)arrFormula.push(rangeStyle.formula);else if(specialPasteProps.formula&&searchRangeIntoFormulaArrays(arrFormula,range));else if(rangeStyle.cellValueData2&&specialPasteProps.font&&specialPasteProps.val)t.model._getCell(rangeStyle.cellValueData2.row,rangeStyle.cellValueData2.col,function(cell){cell.setValueData(rangeStyle.cellValueData2.valueData)});else if(rangeStyle.value2&&specialPasteProps.font&&specialPasteProps.val)if(formulaProps&&firstRange)firstRange.setValue2(rangeStyle.value2); else range.setValue2(rangeStyle.value2);else if(rangeStyle.cellValueData&&specialPasteProps.val)if(formulaProps&&firstRange)firstRange.setValueData(rangeStyle.cellValueData);else range.setValueData(rangeStyle.cellValueData);else if(null!=rangeStyle.val&&specialPasteProps.val)if(rangeStyle.val[0]==="'")range.setValueData(new AscCommonExcel.UndoRedoData_CellValueData(null,new AscCommonExcel.CCellValue({text:rangeStyle.val,type:CellValueType.String})));else range.setValue(rangeStyle.val,null,null,undefined, pasteOnlyText);if(undefined!==rangeStyle.alignVertical&&specialPasteProps.alignVertical)range.setAlignVertical(rangeStyle.alignVertical);if(undefined!==rangeStyle.alignHorizontal&&specialPasteProps.alignHorizontal)range.setAlignHorizontal(rangeStyle.alignHorizontal);if(rangeStyle.fontSize&&specialPasteProps.fontSize)range.setFontsize(rangeStyle.fontSize);if(rangeStyle.borders&&specialPasteProps.borders)range.setBorderSrc(rangeStyle.borders);if(rangeStyle.bordersFull&&specialPasteProps.borders)range.setBorder(rangeStyle.bordersFull); if(rangeStyle.wrap&&specialPasteProps.wrap)range.setWrap(rangeStyle.wrap);if(specialPasteProps.fill&&undefined!==rangeStyle.fill)range.setFill(rangeStyle.fill);if(specialPasteProps.fill&&undefined!==rangeStyle.fillColor)range.setFillColor(rangeStyle.fillColor);if(undefined!==rangeStyle.angle&&specialPasteProps.angle)range.setAngle(rangeStyle.angle);if(rangeStyle.shrinkToFit&&specialPasteProps.fontSize)range.setShrinkToFit(rangeStyle.shrinkToFit);if(rangeStyle.tableDxfLocal&&specialPasteProps.format)range.getLeftTopCell(function(firstCell){if(firstCell)firstCell.setStyle(rangeStyle.tableDxfLocal)}); if(rangeStyle.hyperLink&&specialPasteProps.hyperlink){var _link=rangeStyle.hyperLink.hyperLink;var newHyperlink=new AscCommonExcel.Hyperlink;if(_link.search("#")===0)newHyperlink.setLocation(_link.replace("#",""));else newHyperlink.Hyperlink=_link;newHyperlink.Ref=range;newHyperlink.Tooltip=rangeStyle.hyperLink.toolTip;newHyperlink.Location=rangeStyle.hyperLink.location;range.setHyperlink(newHyperlink)}else if(rangeStyle.hyperlinkObj&&specialPasteProps.hyperlink){rangeStyle.hyperlinkObj.Ref=range; range.setHyperlink(rangeStyle.hyperlinkObj,true)}};WorksheetView.prototype.showSpecialPasteOptions=function(options){var specialPasteShowOptions=window["AscCommon"].g_specialPasteHelper.buttonInfo;var positionShapeContent=options.position;var range=options.range;var props=options.options;var showPasteSpecial=options.showPasteSpecial;var containTables=options.containTables;var cellCoord;if(!positionShapeContent){window["AscCommon"].g_specialPasteHelper.CleanButtonInfo();window["AscCommon"].g_specialPasteHelper.buttonInfo.setRange(range); var isVisible=null!==this.getCellVisibleRange(range.c2,range.r2);cellCoord=this.getSpecialPasteCoords(range,isVisible)}else cellCoord=[new AscCommon.asc_CRect(positionShapeContent.x,positionShapeContent.y,0,0)];specialPasteShowOptions.asc_setOptions(props);specialPasteShowOptions.asc_setCellCoord(cellCoord);specialPasteShowOptions.asc_setShowPasteSpecial(showPasteSpecial);specialPasteShowOptions.asc_setContainTables(containTables);this.handlers.trigger("showSpecialPasteOptions",specialPasteShowOptions)}; WorksheetView.prototype.updateSpecialPasteButton=function(){var specialPasteShowOptions,cellCoord;var isIntoShape=this.objectRender.controller.getTargetDocContent();if(window["AscCommon"].g_specialPasteHelper.showSpecialPasteButton&&isIntoShape){if(window["AscCommon"].g_specialPasteHelper.buttonInfo.shapeId===isIntoShape.Id){var curShape=isIntoShape.Parent.parent;var mmToPx=asc_getcvt(3,0,this._getPPIX());var cursorPos=window["AscCommon"].g_specialPasteHelper.buttonInfo.range;var offsetX=this._getColLeft(this.visibleRange.c1)- this.cellsLeft;var offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop;var posX=curShape.transformText.TransformPointX(cursorPos.X,cursorPos.Y)*mmToPx-offsetX+this.cellsLeft;var posY=curShape.transformText.TransformPointY(cursorPos.X,cursorPos.Y)*mmToPx-offsetY+this.cellsTop;if(AscCommon.AscBrowser.isRetina){posX=AscCommon.AscBrowser.convertToRetinaValue(posX);posY=AscCommon.AscBrowser.convertToRetinaValue(posY)}cellCoord=[new AscCommon.asc_CRect(posX,posY,0,0)]}}else if(window["AscCommon"].g_specialPasteHelper.showSpecialPasteButton){var range= window["AscCommon"].g_specialPasteHelper.buttonInfo.range;var isVisible=null!==this.getCellVisibleRange(range.c2,range.r2);cellCoord=this.getSpecialPasteCoords(range,isVisible)}if(cellCoord){specialPasteShowOptions=window["AscCommon"].g_specialPasteHelper.buttonInfo;specialPasteShowOptions.asc_setOptions(null);specialPasteShowOptions.asc_setCellCoord(cellCoord);this.handlers.trigger("showSpecialPasteOptions",specialPasteShowOptions)}};WorksheetView.prototype.getSpecialPasteCoords=function(range,isVisible){var disableCoords= function(){cellCoord._x=-1;cellCoord._y=-1};var cellCoord=this.getCellCoord(range.c2,range.r2);if(window["AscCommon"].g_specialPasteHelper.buttonInfo.shapeId){disableCoords();cellCoord=[cellCoord]}else{var visibleRange=this.getVisibleRange();var intersectionVisibleRange=visibleRange.intersection(range);if(intersectionVisibleRange){cellCoord=[];cellCoord[0]=this.getCellCoord(intersectionVisibleRange.c2,intersectionVisibleRange.r2);cellCoord[1]=this.getCellCoord(range.c1,range.r1)}else{disableCoords(); cellCoord=[cellCoord]}}return cellCoord};WorksheetView.prototype._isLockedHeaderFooter=function(callback){var lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,this.model.getId(),AscCommonExcel.c_oAscHeaderFooterEdit);this.collaborativeEditing.lock([lockInfo],callback)};WorksheetView.prototype._isLockedLayoutOptions=function(callback){var lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,this.model.getId(),AscCommonExcel.c_oAscLockLayoutOptions); this.collaborativeEditing.lock([lockInfo],callback)};WorksheetView.prototype.getLayoutLockInfo=function(){var lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,this.model.getId(),AscCommonExcel.c_oAscLockLayoutOptions);return lockInfo};WorksheetView.prototype._isLockedPrintScaleOptions=function(callback){var lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,this.model.getId(),AscCommonExcel.c_oAscLockPrintScaleOptions);this.collaborativeEditing.lock([lockInfo], callback)};WorksheetView.prototype._isLockedFrozenPane=function(callback){var lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,this.model.getId(),AscCommonExcel.c_oAscLockNameFrozenPane);this.collaborativeEditing.lock([lockInfo],callback)};WorksheetView.prototype._isLockedDefNames=function(callback,defNameId){var lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object,null,-1,defNameId);this.collaborativeEditing.lock([lockInfo],callback)};WorksheetView.prototype._isLockedAll= function(callback){var ar=this.model.getSelection().getLast();var lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Range,c_oAscLockTypeElemSubType.ChangeProperties,this.model.getId(),new AscCommonExcel.asc_CCollaborativeRange(ar.c1,ar.r1,ar.c2,ar.r2));this.collaborativeEditing.lock([lockInfo],callback)};WorksheetView.prototype._recalcRangeByInsertRowsAndColumns=function(sheetId,ar){var isIntersection=false,isIntersectionC1=true,isIntersectionC2=true,isIntersectionR1=true,isIntersectionR2= true;do{if(isIntersectionC1&&this.collaborativeEditing.isIntersectionInCols(sheetId,ar.c1))ar.c1+=1;else isIntersectionC1=false;if(isIntersectionR1&&this.collaborativeEditing.isIntersectionInRows(sheetId,ar.r1))ar.r1+=1;else isIntersectionR1=false;if(isIntersectionC2&&this.collaborativeEditing.isIntersectionInCols(sheetId,ar.c2))ar.c2-=1;else isIntersectionC2=false;if(isIntersectionR2&&this.collaborativeEditing.isIntersectionInRows(sheetId,ar.r2))ar.r2-=1;else isIntersectionR2=false;if(ar.c1>ar.c2|| ar.r1>ar.r2){isIntersection=true;break}}while(isIntersectionC1||isIntersectionC2||isIntersectionR1||isIntersectionR2);if(false===isIntersection){ar.c1=this.collaborativeEditing.getLockMeColumn(sheetId,ar.c1);ar.c2=this.collaborativeEditing.getLockMeColumn(sheetId,ar.c2);ar.r1=this.collaborativeEditing.getLockMeRow(sheetId,ar.r1);ar.r2=this.collaborativeEditing.getLockMeRow(sheetId,ar.r2)}return isIntersection};WorksheetView.prototype._isLockedCells=function(range,subType,callback){var sheetId=this.model.getId(); var isIntersection=false;var newCallback=callback;var t=this;this.collaborativeEditing.onStartCheckLock();var isArrayRange=Array.isArray(range);var nLength=isArrayRange?range.length:1;var nIndex=0;var ar=null;var arrLocks=[];for(;nIndex<nLength;++nIndex){ar=isArrayRange?range[nIndex].clone(true):range.clone(true);if(c_oAscLockTypeElemSubType.InsertColumns!==subType&&c_oAscLockTypeElemSubType.InsertRows!==subType)isIntersection=this._recalcRangeByInsertRowsAndColumns(sheetId,ar);if(false===isIntersection){arrLocks.push(this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Range, subType,sheetId,new AscCommonExcel.asc_CCollaborativeRange(ar.c1,ar.r1,ar.c2,ar.r2)));if(c_oAscLockTypeElemSubType.InsertColumns===subType)newCallback=function(isSuccess){if(isSuccess){t.collaborativeEditing.addColsRange(sheetId,range.clone(true));t.collaborativeEditing.addCols(sheetId,range.c1,range.c2-range.c1+1)}callback(isSuccess)};else if(c_oAscLockTypeElemSubType.InsertRows===subType)newCallback=function(isSuccess){if(isSuccess){t.collaborativeEditing.addRowsRange(sheetId,range.clone(true)); t.collaborativeEditing.addRows(sheetId,range.r1,range.r2-range.r1+1)}callback(isSuccess)};else if(c_oAscLockTypeElemSubType.DeleteColumns===subType)newCallback=function(isSuccess){if(isSuccess){t.collaborativeEditing.removeColsRange(sheetId,range.clone(true));t.collaborativeEditing.removeCols(sheetId,range.c1,range.c2-range.c1+1)}callback(isSuccess)};else if(c_oAscLockTypeElemSubType.DeleteRows===subType)newCallback=function(isSuccess){if(isSuccess){t.collaborativeEditing.removeRowsRange(sheetId, range.clone(true));t.collaborativeEditing.removeRows(sheetId,range.r1,range.r2-range.r1+1)}callback(isSuccess)}}else if(c_oAscLockTypeElemSubType.InsertColumns===subType){t.collaborativeEditing.addColsRange(sheetId,range.clone(true));t.collaborativeEditing.addCols(sheetId,range.c1,range.c2-range.c1+1)}else if(c_oAscLockTypeElemSubType.InsertRows===subType){t.collaborativeEditing.addRowsRange(sheetId,range.clone(true));t.collaborativeEditing.addRows(sheetId,range.r1,range.r2-range.r1+1)}else if(c_oAscLockTypeElemSubType.DeleteColumns=== subType){t.collaborativeEditing.removeColsRange(sheetId,range.clone(true));t.collaborativeEditing.removeCols(sheetId,range.c1,range.c2-range.c1+1)}else if(c_oAscLockTypeElemSubType.DeleteRows===subType){t.collaborativeEditing.removeRowsRange(sheetId,range.clone(true));t.collaborativeEditing.removeRows(sheetId,range.r1,range.r2-range.r1+1)}}return this.collaborativeEditing.lock(arrLocks,newCallback)};WorksheetView.prototype._onChangeSheetViewSettings=function(type){if(AscCH.historyitem_Worksheet_SetDisplayHeadings=== type){this._calcHeaderRowHeight();this._updateRowPositions();this._updateVisibleRowsCount(true)}};WorksheetView.prototype.changeSheetViewSettings=function(type,val){if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;var t=this;var onChangeSheetViewSettings=function(isSuccess){if(false===isSuccess)return;if(AscCH.historyitem_Worksheet_SetDisplayHeadings===type)t.model.setDisplayHeadings(val);else t.model.setDisplayGridlines(val);t.draw()};this._isLockedAll(onChangeSheetViewSettings)}; WorksheetView.prototype.changeWorksheet=function(prop,val){if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;var t=this;var arn=this.model.selectionRange.getLast().clone();var checkRange=arn.clone();var range,count;var oRecalcType=AscCommonExcel.recalcType.recalc;var reinitRanges=false;var updateDrawingObjectsInfo=null;var updateDrawingObjectsInfo2=null;var isUpdateCols=false,isUpdateRows=false;var isCheckChangeAutoFilter;var functionModelAction=null;var lockDraw= false;var lockRange,arrChangedRanges=[];var onChangeWorksheetCallback=function(isSuccess){if(false===isSuccess)return;asc_applyFunction(functionModelAction);t._initCellsArea(oRecalcType);if(oRecalcType)t.cache.reset();t._cleanCellsTextMetricsCache();t.objectRender.bUpdateMetrics=false;t._prepareCellTextMetricsCache();t.objectRender.bUpdateMetrics=true;arrChangedRanges=arrChangedRanges.concat(t.model.hiddenManager.getRecalcHidden());t.cellCommentator.updateAreaComments();if(t.objectRender){if(reinitRanges)t._updateDrawingArea(); if(null!==updateDrawingObjectsInfo)t.objectRender.updateSizeDrawingObjects(updateDrawingObjectsInfo);if(null!==updateDrawingObjectsInfo2)t.objectRender.updateDrawingObject(updateDrawingObjectsInfo2.bInsert,updateDrawingObjectsInfo2.operType,updateDrawingObjectsInfo2.updateRange);t.model.onUpdateRanges(arrChangedRanges);t.objectRender.rebuildChartGraphicObjects(arrChangedRanges)}t.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollVertical|AscCommonExcel.c_oAscScrollType.ScrollHorizontal;t.draw(lockDraw); if(isUpdateCols)t._updateVisibleColsCount();if(isUpdateRows)t._updateVisibleRowsCount();t.handlers.trigger("selectionChanged");t.handlers.trigger("selectionMathInfoChanged",t.getSelectionMathInfo())};var checkDeleteCellsFilteringMode=function(){if(!window["AscCommonExcel"].filteringMode)if(val===c_oAscDeleteOptions.DeleteCellsAndShiftLeft||val===c_oAscDeleteOptions.DeleteColumns)return false;else if(val===c_oAscDeleteOptions.DeleteCellsAndShiftTop||val===c_oAscDeleteOptions.DeleteRows){var tempRange= arn;if(val===c_oAscDeleteOptions.DeleteRows)tempRange=new asc_Range(0,checkRange.r1,gc_nMaxCol0,checkRange.r2);var autoFilter=t.model.AutoFilter;if(autoFilter&&autoFilter.Ref){var ref=autoFilter.Ref;if(tempRange.containsRange(ref))return false;else if(tempRange.containsRange(new asc_Range(ref.c1,ref.r1,ref.c2,ref.r1)))return false}var tableParts=t.model.TableParts;for(var i=0;i<tableParts.length;i++)if(tempRange.containsRange(tableParts[i].Ref))return false}return true};switch(prop){case "colWidth":functionModelAction= function(){t.model.setColWidth(val,checkRange.c1,checkRange.c2);isUpdateCols=true;oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;updateDrawingObjectsInfo={target:c_oTargetType.ColumnResize,col:checkRange.c1}};this._isLockedAll(onChangeWorksheetCallback);break;case "showCols":functionModelAction=function(){t.model.setColHidden(false,arn.c1,arn.c2);t._updateGroups(true);oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;updateDrawingObjectsInfo={target:c_oTargetType.ColumnResize, col:arn.c1}};this._isLockedAll(onChangeWorksheetCallback);break;case "hideCols":functionModelAction=function(){t.model.setColHidden(true,arn.c1,arn.c2);t._updateGroups(true);oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;updateDrawingObjectsInfo={target:c_oTargetType.ColumnResize,col:arn.c1}};this._isLockedAll(onChangeWorksheetCallback);break;case "rowHeight":functionModelAction=function(){val=val/AscCommonExcel.sizePxinPt;val=(val|val)*AscCommonExcel.sizePxinPt;t.model.setRowHeight(Math.min(val, Asc.c_oAscMaxRowHeight),checkRange.r1,checkRange.r2,true);isUpdateRows=true;oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;updateDrawingObjectsInfo={target:c_oTargetType.RowResize,row:checkRange.r1}};return this._isLockedAll(onChangeWorksheetCallback);case "showRows":functionModelAction=function(){t.model.setRowHidden(false,arn.r1,arn.r2);t._updateGroups();t.model.autoFilters.reDrawFilter(arn);oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;updateDrawingObjectsInfo={target:c_oTargetType.RowResize, row:arn.r1}};this._isLockedAll(onChangeWorksheetCallback);break;case "hideRows":functionModelAction=function(){t.model.setRowHidden(true,arn.r1,arn.r2);t._updateGroups();t.model.autoFilters.reDrawFilter(arn);oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;updateDrawingObjectsInfo={target:c_oTargetType.RowResize,row:arn.r1}};this._isLockedAll(onChangeWorksheetCallback);break;case "insCell":if(!window["AscCommonExcel"].filteringMode)if(val===c_oAscInsertOptions.InsertCellsAndShiftRight|| val===c_oAscInsertOptions.InsertColumns)return;t.model.workbook.handlers.trigger("cleanCutData",true,true);range=t.model.getRange3(arn.r1,arn.c1,arn.r2,arn.c2);switch(val){case c_oAscInsertOptions.InsertCellsAndShiftRight:isCheckChangeAutoFilter=t.af_checkInsDelCells(arn,c_oAscInsertOptions.InsertCellsAndShiftRight,prop);if(isCheckChangeAutoFilter===false)return;functionModelAction=function(){History.Create_NewPoint();History.StartTransaction();if(range.addCellsShiftRight()){oRecalcType=AscCommonExcel.recalcType.full; reinitRanges=true;t.cellCommentator.updateCommentsDependencies(true,val,arn);t.model.shiftDataValidation(true,val,arn,true);updateDrawingObjectsInfo2={bInsert:true,operType:val,updateRange:arn}}History.EndTransaction()};arrChangedRanges.push(lockRange=new asc_Range(arn.c1,arn.r1,gc_nMaxCol0,arn.r2));count=checkRange.c2-checkRange.c1+1;if(this.model.checkShiftPivotTable(arn,new AscCommon.CellBase(0,count))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical); return}if(!this.model.checkShiftArrayFormulas(arn,new AscCommon.CellBase(0,count))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}this._isLockedCells(lockRange,null,onChangeWorksheetCallback);break;case c_oAscInsertOptions.InsertCellsAndShiftDown:isCheckChangeAutoFilter=t.af_checkInsDelCells(arn,c_oAscInsertOptions.InsertCellsAndShiftDown,prop);if(isCheckChangeAutoFilter===false)return;functionModelAction=function(){History.Create_NewPoint(); History.StartTransaction();if(range.addCellsShiftBottom()){oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;t.cellCommentator.updateCommentsDependencies(true,val,arn);t.model.shiftDataValidation(true,val,arn,true);updateDrawingObjectsInfo2={bInsert:true,operType:val,updateRange:arn}}History.EndTransaction()};arrChangedRanges.push(lockRange=new asc_Range(arn.c1,arn.r1,arn.c2,gc_nMaxRow0));count=checkRange.c2-checkRange.c1+1;if(this.model.checkShiftPivotTable(arn,new AscCommon.CellBase(count, 0))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(!this.model.checkShiftArrayFormulas(arn,new AscCommon.CellBase(count,0))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}this._isLockedCells(lockRange,null,onChangeWorksheetCallback);break;case c_oAscInsertOptions.InsertColumns:isCheckChangeAutoFilter=t.model.autoFilters.isRangeIntersectionSeveralTableParts(arn); if(isCheckChangeAutoFilter===true){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return}lockRange=new asc_Range(arn.c1,0,arn.c2,gc_nMaxRow0);count=arn.c2-arn.c1+1;if(this.model.checkShiftPivotTable(lockRange,new AscCommon.CellBase(0,count))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(!this.model.checkShiftArrayFormulas(lockRange,new AscCommon.CellBase(0, count))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}functionModelAction=function(){History.Create_NewPoint();History.StartTransaction();oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;t.model.insertColsBefore(arn.c1,count);t._updateGroups(true);updateDrawingObjectsInfo2={bInsert:true,operType:val,updateRange:arn};t.cellCommentator.updateCommentsDependencies(true,val,arn);t.model.shiftDataValidation(true, val,arn,true);History.EndTransaction()};arrChangedRanges.push(lockRange);this._isLockedCells(lockRange,c_oAscLockTypeElemSubType.InsertColumns,onChangeWorksheetCallback);break;case c_oAscInsertOptions.InsertRows:lockRange=new asc_Range(0,arn.r1,gc_nMaxCol0,arn.r2);count=arn.r2-arn.r1+1;if(this.model.checkShiftPivotTable(lockRange,new AscCommon.CellBase(count,0))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(!this.model.checkShiftArrayFormulas(lockRange, new AscCommon.CellBase(count,0))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}functionModelAction=function(){oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;t.model.insertRowsBefore(arn.r1,count);t._updateGroups();updateDrawingObjectsInfo2={bInsert:true,operType:val,updateRange:arn};t.cellCommentator.updateCommentsDependencies(true,val,arn);t.model.shiftDataValidation(true,val,arn,true)};arrChangedRanges.push(lockRange); this._isLockedCells(lockRange,c_oAscLockTypeElemSubType.InsertRows,onChangeWorksheetCallback);break}break;case "delCell":if(!checkDeleteCellsFilteringMode())return;t.model.workbook.handlers.trigger("cleanCutData",true,true);range=t.model.getRange3(checkRange.r1,checkRange.c1,checkRange.r2,checkRange.c2);switch(val){case c_oAscDeleteOptions.DeleteCellsAndShiftLeft:isCheckChangeAutoFilter=t.af_checkInsDelCells(arn,c_oAscDeleteOptions.DeleteCellsAndShiftLeft,prop);if(isCheckChangeAutoFilter===false)return; functionModelAction=function(){History.Create_NewPoint();History.StartTransaction();if(isCheckChangeAutoFilter===true)t.model.autoFilters.isEmptyAutoFilters(arn,c_oAscDeleteOptions.DeleteCellsAndShiftLeft);if(range.deleteCellsShiftLeft(function(){t._cleanCache(lockRange);t.cellCommentator.updateCommentsDependencies(false,val,checkRange);t.model.shiftDataValidation(false,val,checkRange,true)}))updateDrawingObjectsInfo2={bInsert:false,operType:val,updateRange:arn};History.EndTransaction();reinitRanges= true};arrChangedRanges.push(lockRange=new asc_Range(checkRange.c1,checkRange.r1,gc_nMaxCol0,checkRange.r2));count=checkRange.c2-checkRange.c1+1;if(this.model.checkShiftPivotTable(arn,new AscCommon.CellBase(0,-count))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(!this.model.checkShiftArrayFormulas(arn,new AscCommon.CellBase(0,-count))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray, c_oAscError.Level.NoCritical);return}this._isLockedCells(lockRange,null,onChangeWorksheetCallback);break;case c_oAscDeleteOptions.DeleteCellsAndShiftTop:isCheckChangeAutoFilter=t.af_checkInsDelCells(arn,c_oAscDeleteOptions.DeleteCellsAndShiftTop,prop);if(isCheckChangeAutoFilter===false)return;functionModelAction=function(){History.Create_NewPoint();History.StartTransaction();if(isCheckChangeAutoFilter===true)t.model.autoFilters.isEmptyAutoFilters(arn,c_oAscDeleteOptions.DeleteCellsAndShiftTop);if(range.deleteCellsShiftUp(function(){t._cleanCache(lockRange); t.cellCommentator.updateCommentsDependencies(false,val,checkRange);t.model.shiftDataValidation(false,val,checkRange,true)}))updateDrawingObjectsInfo2={bInsert:false,operType:val,updateRange:arn};History.EndTransaction();reinitRanges=true};arrChangedRanges.push(lockRange=new asc_Range(checkRange.c1,checkRange.r1,checkRange.c2,gc_nMaxRow0));count=checkRange.c2-checkRange.c1+1;if(this.model.checkShiftPivotTable(arn,new AscCommon.CellBase(-count,0))){this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(!this.model.checkShiftArrayFormulas(arn,new AscCommon.CellBase(-count,0))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}this._isLockedCells(lockRange,null,onChangeWorksheetCallback);break;case c_oAscDeleteOptions.DeleteColumns:isCheckChangeAutoFilter=t.model.autoFilters.isActiveCellsCrossHalfFTable(checkRange,c_oAscDeleteOptions.DeleteColumns,prop); if(isCheckChangeAutoFilter===false)return;lockRange=new asc_Range(checkRange.c1,0,checkRange.c2,gc_nMaxRow0);count=checkRange.c2-checkRange.c1+1;if(this.model.checkShiftPivotTable(lockRange,new AscCommon.CellBase(0,-count))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(!this.model.checkShiftArrayFormulas(lockRange,new AscCommon.CellBase(0,-count))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray, c_oAscError.Level.NoCritical);return}functionModelAction=function(){oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;History.Create_NewPoint();History.StartTransaction();t.cellCommentator.updateCommentsDependencies(false,val,checkRange);t.model.shiftDataValidation(false,val,checkRange,true);t.model.autoFilters.isEmptyAutoFilters(arn,c_oAscDeleteOptions.DeleteColumns);t.model.removeCols(checkRange.c1,checkRange.c2);t._updateGroups(true);updateDrawingObjectsInfo2={bInsert:false,operType:val, updateRange:arn};History.EndTransaction()};arrChangedRanges.push(lockRange);this._isLockedCells(lockRange,c_oAscLockTypeElemSubType.DeleteColumns,onChangeWorksheetCallback);break;case c_oAscDeleteOptions.DeleteRows:isCheckChangeAutoFilter=t.model.autoFilters.isActiveCellsCrossHalfFTable(checkRange,c_oAscDeleteOptions.DeleteRows,prop);if(isCheckChangeAutoFilter===false)return;lockRange=new asc_Range(0,checkRange.r1,gc_nMaxCol0,checkRange.r2);count=checkRange.r2-checkRange.r1+1;if(this.model.checkShiftPivotTable(lockRange, new AscCommon.CellBase(-count,0))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(!this.model.checkShiftArrayFormulas(lockRange,new AscCommon.CellBase(-count,0))){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}functionModelAction=function(){oRecalcType=AscCommonExcel.recalcType.full;reinitRanges=true;History.Create_NewPoint();History.StartTransaction(); checkRange=t.model.autoFilters.checkDeleteAllRowsFormatTable(checkRange,true);t.cellCommentator.updateCommentsDependencies(false,val,checkRange);t.model.shiftDataValidation(false,val,checkRange,true);t.model.autoFilters.isEmptyAutoFilters(arn,c_oAscDeleteOptions.DeleteRows);var bExcludeHiddenRows=t.model.autoFilters.bIsExcludeHiddenRows(checkRange,t.model.selectionRange.activeCell);t.model.removeRows(checkRange.r1,checkRange.r2,bExcludeHiddenRows);t._updateSlicers(arn);t._updateGroups();updateDrawingObjectsInfo2= {bInsert:false,operType:val,updateRange:arn};History.EndTransaction()};arrChangedRanges.push(lockRange);this._isLockedCells(lockRange,c_oAscLockTypeElemSubType.DeleteRows,onChangeWorksheetCallback);break}this.handlers.trigger("selectionNameChanged",t.getSelectionName(false));break;case "groupRows":if(!val&&!this.checkSetGroup(arn))return;functionModelAction=function(){History.Create_NewPoint();History.StartTransaction();t.model.setGroupRow(val,arn.r1,arn.r2);t._updateGroups();History.EndTransaction()}; this._isLockedAll(onChangeWorksheetCallback);break;case "groupCols":if(!val&&!this.checkSetGroup(arn,true))return;functionModelAction=function(){History.Create_NewPoint();History.StartTransaction();t.model.setGroupCol(val,arn.c1,arn.c2);t._updateGroups(true);History.EndTransaction()};this._isLockedAll(onChangeWorksheetCallback);break;case "clearOutline":var groupArrCol=this.arrColGroups?this.arrColGroups.groupArr:null;var groupArrRow=this.arrRowGroups?this.arrRowGroups.groupArr:null;if(!groupArrCol&& !groupArrRow)return;functionModelAction=t.clearOutline();this._isLockedAll(onChangeWorksheetCallback);break;case "update":if(val!==undefined){lockDraw=true===val.lockDraw;reinitRanges=!!val.reinitRanges}onChangeWorksheetCallback(true);break}};WorksheetView.prototype._autoFitColumnWidth=function(col,r1,r2,onlyIfMore,pivotButtons){var width=null;var row,ct,c,fl,str,maxW,tm,mc,isMerged,oldWidth,oldColWidth;var lastHeight=null;var hasButton;if(null==r1)r1=0;if(null==r2)r2=this.model.getRowsCount()-1; oldColWidth=this.getColumnWidthInSymbols(col);this.canChangeColWidth=c_oAscCanChangeColWidth.all;for(row=r1;row<=r2;++row){this._addCellTextToCache(col,row);ct=this._getCellTextCache(col,row);if(ct===undefined)continue;fl=ct.flags;isMerged=fl.isMerged();if(isMerged){mc=fl.merged;if(mc.c1!==mc.c2)continue}var angleSin=Math.sin(ct.angle*Math.PI/180);var angleCos=Math.cos(ct.angle*Math.PI/180);var calcWidth;if(ct.metrics.height>this.maxRowHeightPx){if(isMerged)continue;oldWidth=ct.metrics.width;lastHeight= null;c=this._getCell(col,row);str=c.getValue2();maxW=ct.metrics.width+this.maxDigitWidth;while(1){tm=this._roundTextMetrics(this.stringRender.measureString(str,fl,maxW));if(tm.height<=this.maxRowHeightPx)break;if(lastHeight===tm.height){tm.width=oldWidth;break}lastHeight=tm.height;maxW+=this.maxDigitWidth}calcWidth=Math.abs(tm.width*angleCos)+Math.abs(ct.metrics.height*angleSin)}else{calcWidth=Math.abs(ct.metrics.width*angleCos)+Math.abs(ct.metrics.height*angleSin);hasButton=this._checkFilterButtonInRange(col, row)||pivotButtons.find(function(element){return element.row===row&&element.col===col});if(null!==hasButton&&CellValueType.String===ct.cellType)calcWidth+=this._getFilterButtonSize()}width=Math.max(width,calcWidth)}width=width/this.getZoom();this.canChangeColWidth=c_oAscCanChangeColWidth.none;var pad,cc,cw;if(width>0){pad=this.settings.cells.padding*2+1;cc=Math.min(this.model.colWidthToCharCount(width+pad),Asc.c_oAscMaxColumnWidth)}else cc=this.defaultColWidthChars;if(cc===oldColWidth||onlyIfMore&& cc<oldColWidth)return false;History.Create_NewPoint();History.StartTransaction();cw=this.model.charCountToModelColWidth(cc);this.model.setColBestFit(true,cw,col,col);History.EndTransaction();this._calcColWidth(col);return true};WorksheetView.prototype._autoFitColumnsWidth=function(ranges,onlyIfMore){var c1,c2,range;var max=this.model.getColsCount();for(var i=0;i<ranges.length;++i){range=ranges[i];c1=range.c1;c2=Math.min(range.c2,max);var pivotButtons=this.model.getPivotTableButtons(range);for(;c1<= c2;++c1)this._autoFitColumnWidth(c1,range.r1,range.r2,onlyIfMore,pivotButtons)}};WorksheetView.prototype.autoFitColumnsWidth=function(col){var viewMode=this.handlers.trigger("getViewMode");var t=this;var r1=0,r2=this.model.getRowsCount()-1;var ranges=[];if(null!==col)ranges.push(new Asc.Range(col,r1,col,r2));else{var selectionRanges=this.model.selectionRange.ranges;for(var i=0;i<selectionRanges.length;++i)ranges.push(new Asc.Range(selectionRanges[i].c1,r1,selectionRanges[i].c2,r2))}var onChangeCallback= function(isSuccess){if(false===isSuccess)return;if(viewMode)History.TurnOff();History.Create_NewPoint();History.StartTransaction();var oSelection=ranges[0].clone();oSelection.r1=0;oSelection.r2=gc_nMaxRow0;History.SetSelection(oSelection);History.SetSelectionRedo(oSelection);t._autoFitColumnsWidth(ranges);t.draw();History.EndTransaction();if(viewMode)History.TurnOn()};if(viewMode)onChangeCallback(true);else this._isLockedAll(onChangeCallback)};WorksheetView.prototype.autoFitRowHeight=function(r1, r2){var viewMode=this.handlers.trigger("getViewMode");var t=this;if(null===r1){var lastSelection=this.model.selectionRange.getLast();r1=lastSelection.r1;r2=lastSelection.r2}var onChangeCallback=function(isSuccess){if(false===isSuccess)return;var r;for(r=r1;r<=r2;++r)if(t.model.getRowCustomHeight(r))break;if(r2<r)return;if(viewMode)History.TurnOff();History.Create_NewPoint();var oSelection=History.GetSelection();if(null!=oSelection){oSelection=oSelection.clone();oSelection.assign(0,r1,gc_nMaxCol0, r2);History.SetSelection(oSelection);History.SetSelectionRedo(oSelection)}History.StartTransaction();t.model.setRowBestFit(true,AscCommonExcel.oDefaultMetrics.RowHeight,r1,r2);t._updateRange(new Asc.Range(0,r1,gc_nMaxCol0,r2));t.draw();History.EndTransaction();if(viewMode)History.TurnOn()};if(viewMode)onChangeCallback(true);else this._isLockedAll(onChangeCallback)};WorksheetView.prototype._isCellEqual=function(c,r,options){var cell,cellText;var mc=this.model.getMergedByCell(r,c);cell=mc?this._getVisibleCell(mc.c1, mc.r1):this._getVisibleCell(c,r);cellText=options.lookIn===Asc.c_oAscFindLookIn.Formulas?cell.getValueForEdit():cell.getValue();if(true!==options.isMatchCase)cellText=cellText.toLowerCase();if(cellText.indexOf(options.findWhat)>=0&&(true!==options.isWholeCell||options.findWhat.length===cellText.length))return mc?new asc_Range(mc.c1,mc.r1,mc.c1,mc.r1):new asc_Range(c,r,c,r);return null};WorksheetView.prototype.findCellText=function(options){var self=this;if(true!==options.isMatchCase)options.findWhat= options.findWhat.toLowerCase();var selectionRange=options.selectionRange||this.model.selectionRange;var lastRange=selectionRange.getLast();var ar=selectionRange.activeCell;var c=ar.col;var r=ar.row;var merge=this.model.getMergedByCell(r,c);options.findInSelection=options.scanOnOnlySheet&&!(selectionRange.isSingleRange()&&(lastRange.isOneCell()||lastRange.isEqual(merge)));var minC,minR,maxC,maxR;if(options.findInSelection){minC=lastRange.c1;minR=lastRange.r1;maxC=lastRange.c2;maxR=lastRange.r2}else{minC= 0;minR=0;maxC=this.cols.length-1;maxR=this.rows.length-1}var inc=options.scanForward?+1:-1;var isEqual;function findNextCell(){var ct=undefined;do{if(options.scanByRows){c+=inc;if(c<minC||c>maxC){c=options.scanForward?minC:maxC;r+=inc}}else{r+=inc;if(r<minR||r>maxR){r=options.scanForward?minR:maxR;c+=inc}}if(c<minC||c>maxC||r<minR||r>maxR)return undefined;self.model._getCellNoEmpty(r,c,function(cell){if(cell&&!cell.isNullTextString())ct=true})}while(!ct);return ct}while(findNextCell()){isEqual=this._isCellEqual(c, r,options);if(null!==isEqual)return isEqual}if(options.scanForward)if(options.scanByRows){c=minC-1;r=minR;maxR=ar.row}else{c=minC;r=minR-1;maxC=ar.col}else{c=maxC;r=maxR;if(options.scanByRows){c=maxC+1;r=maxR;minR=ar.row}else{c=maxC;r=maxR+1;minC=ar.col}}while(findNextCell()){isEqual=this._isCellEqual(c,r,options);if(null!==isEqual)return isEqual}return null};WorksheetView.prototype.replaceCellText=function(options,lockDraw,callback){options.countFind=0;options.countReplace=0;var cell,tmp;var aReplaceCells= [];if(options.isReplaceAll){this.model._findAllCells(options);var findResult=this.model.lastFindOptions.findResults.values;for(var row in findResult)for(var col in findResult[row]){var r=row;var c=col;if(!this.model.lastFindOptions.scanByRows){tmp=c;c=r;r=tmp}c|=0;r|=0;aReplaceCells.push(new Asc.Range(c,r,c,r))}}else{cell=this.model.selectionRange.activeCell;var isEqual=this._isCellEqual(cell.col,cell.row,options);if(isEqual)aReplaceCells.push(isEqual)}if(0===aReplaceCells.length)return callback(options); this.model.clearFindResults();return this._replaceCellsText(aReplaceCells,options,lockDraw,callback)};WorksheetView.prototype._replaceCellsText=function(aReplaceCells,options,lockDraw,callback){var t=this;if(this.model.inPivotTable(aReplaceCells)){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);options.error=true;this.draw(lockDraw);return callback(options)}options.indexInArray=0;options.countFind=aReplaceCells.length;options.countReplace= 0;if(options.isReplaceAll&&false===this.collaborativeEditing.getCollaborativeEditing())this._isLockedCells(aReplaceCells,null,function(){t._replaceCellText(aReplaceCells,options,lockDraw,callback,true)});else this._replaceCellText(aReplaceCells,options,lockDraw,callback,false)};WorksheetView.prototype._replaceCellText=function(aReplaceCells,options,lockDraw,callback,oneUser){var t=this;var needLockCell=!oneUser;var isSC=options.isSpellCheck;if(options.indexInArray>=aReplaceCells.length){this.draw(lockDraw); return callback(options)}if(!oneUser&&isSC){needLockCell=false;var cell=aReplaceCells[options.indexInArray];++options.indexInArray;var cellValue=t._getVisibleCell(cell.c1,cell.r1).getValueForEdit();var newCellValue=AscCommonExcel.replaceSpellCheckWords(cellValue,options);if(cellValue!==newCellValue)needLockCell=true;--options.indexInArray}var onReplaceCallback=function(isSuccess){var cell=aReplaceCells[options.indexInArray];++options.indexInArray;if(false!==isSuccess){var c=t._getVisibleCell(cell.c1, cell.r1);var cellValue=c.getValueForEdit();var v,newValue,oldCellValue=cellValue;if(!isSC)cellValue=cellValue.replace(options.findRegExp,function(){++options.countReplace;return options.replaceWith});else cellValue=AscCommonExcel.replaceSpellCheckWords(cellValue,options);var isNeedToSave=oldCellValue===cellValue?false:true;v=c.getValueForEdit2().slice(0,1);newValue=[];newValue[0]=new AscCommonExcel.Fragment({text:cellValue,format:v[0].format.clone()});if(isNeedToSave&&!t._saveCellValueAfterEdit(c, newValue,undefined,true,true)){options.error=true;t.draw(lockDraw);return callback(options)}}window.setTimeout(function(){t._replaceCellText(aReplaceCells,options,lockDraw,callback,oneUser)},1)};return!needLockCell?onReplaceCallback(true):this._isLockedCells(aReplaceCells[options.indexInArray],null,onReplaceCallback)};WorksheetView.prototype.findCell=function(reference){var mc;var translatePrintArea=AscCommonExcel.tryTranslateToPrintArea(reference);var ranges;if(translatePrintArea)ranges=AscCommonExcel.getRangeByRef(translatePrintArea, this.model,true,true);if(!ranges||0===ranges.length)ranges=AscCommonExcel.getRangeByRef(reference,this.model,true,true);if(this.workbook.model.getSlicerCacheByCacheName(reference))return[];var t=this;if(0===ranges.length&&this.workbook.canEdit()){var changeModeRanges;AscCommonExcel.executeInR1C1Mode(!AscCommonExcel.g_R1C1Mode,function(){changeModeRanges=AscCommonExcel.getRangeByRef(reference,t.model,true,true)});if(changeModeRanges&&changeModeRanges.length){this.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.InvalidReferenceOrName,c_oAscError.Level.NoCritical);return ranges}if(this.collaborativeEditing.getGlobalLock()||!this.handlers.trigger("getLockDefNameManagerStatus")){this.handlers.trigger("onErrorEvent",c_oAscError.ID.LockCreateDefName,c_oAscError.Level.NoCritical);this._updateSelectionNameAndInfo()}else{var selectionLast=this.model.selectionRange.getLast();mc=selectionLast.isOneCell()?this.model.getMergedByCell(selectionLast.r1,selectionLast.c1):null;var defName;AscCommonExcel.executeInR1C1Mode(false, function(){defName=t.model.workbook.editDefinesNames(null,new Asc.asc_CDefName(reference,parserHelp.get3DRef(t.model.getName(),(mc||selectionLast).getAbsName())))});if(defName)this._isLockedDefNames(null,defName.getNodeId());else this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.InvalidReferenceOrName,c_oAscError.Level.NoCritical)}}return ranges};WorksheetView.prototype.getCellAutoCompleteValues=function(cell,maxCount){var merged=this._getVisibleCell(cell.col,cell.row).hasMerged(); if(merged)cell=new AscCommon.CellBase(merged.r1,merged.c1);var arrValues=[],objValues={};var range=this.findCellAutoComplete(cell,1,maxCount);this.getColValues(range,cell.col,arrValues,objValues);range=this.findCellAutoComplete(cell,-1,maxCount);this.getColValues(range,cell.col,arrValues,objValues);arrValues.sort();return arrValues};WorksheetView.prototype.findCellAutoComplete=function(cellActive,step,maxCount){var col=cellActive.col,row=cellActive.row;row+=step;if(!maxCount)maxCount=Number.MAX_VALUE; var count=0,isBreak=false,end=0<step?this.model.getRowsCount()-1:0,isEnd=true,colsCount=this.model.getColsCount(),range=new asc_Range(col,row,col,row);for(;row*step<=end&&count<maxCount;row+=step,isEnd=true,++count){for(col=range.c1;col<=range.c2;++col){this.model._getCellNoEmpty(row,col,function(cell){if(cell&&false===cell.isNullText()){isEnd=false;isBreak=true}});if(isBreak){isBreak=false;break}}for(col=range.c1-1;col>=0;--col){this.model._getCellNoEmpty(row,col,function(cell){isBreak=null===cell|| cell.isNullText()});if(isBreak){isBreak=false;break}isEnd=false}range.c1=col+1;for(col=range.c2+1;col<colsCount;++col){this.model._getCellNoEmpty(row,col,function(cell){isBreak=null===cell||cell.isNullText()});if(isBreak){isBreak=false;break}isEnd=false}range.c2=col-1;if(isEnd)break}if(0<step)range.r2=row-1;else range.r1=row+1;return range.r1<=range.r2?range:null};WorksheetView.prototype.getColValues=function(range,col,arrValues,objValues){if(null===range)return;var row,value,valueLowCase;for(row= range.r1;row<=range.r2;++row)this.model._getCellNoEmpty(row,col,function(cell){if(cell&&CellValueType.String===cell.getType()){value=cell.getValue();valueLowCase=value.toLowerCase();if(!objValues.hasOwnProperty(valueLowCase)){arrValues.push(value);objValues[valueLowCase]=1}}})};WorksheetView.prototype.cloneSelection=function(start,selectRange){this.cleanSelection();this.model.cloneSelection(start,selectRange);if(start){if(this.isSelectOnShape)this.objectRender.controller.checkChartForProps(true)}else{this.endEditChart(); this.objectRender.controller.checkChartForProps(false)}};WorksheetView.prototype._isFormula=function(val){return 0<val.length&&1<val[0].text.length&&"="===val[0].text.charAt(0)};WorksheetView.prototype.getActiveCell=function(x,y,isCoord){var col,row;if(isCoord){col=this._findColUnderCursor(x,true);row=this._findRowUnderCursor(y,true);if(!col||!row)return false;col=col.col;row=row.row}else{var activeCell=this.model.getSelection().activeCell;col=activeCell.col;row=activeCell.row}var mergedRange=this.model.getMergedByCell(row, col);return mergedRange?mergedRange:new asc_Range(col,row,col,row)};WorksheetView.prototype._saveCellValueAfterEdit=function(c,val,flags,isNotHistory,lockDraw){var bbox=c.bbox;var t=this;var ctrlKey=flags&&flags.ctrlKey;var shiftKey=flags&&flags.shiftKey;var applyByArray=ctrlKey&&shiftKey;if(!isNotHistory){History.Create_NewPoint();History.StartTransaction()}var changeRangesIfArrayFormula=function(){if(ctrlKey){c=t.getSelectedRange();if(c.bbox.isOneCell())t.model._getCell(c.bbox.r1,c.bbox.c1,function(cell){var formulaRef= cell&&cell.formulaParsed&&cell.formulaParsed.ref?cell.formulaParsed.ref:null;if(formulaRef)c=t.model.getRange3(formulaRef.r1,formulaRef.c1,formulaRef.r2,formulaRef.c2)});bbox=c.bbox}};var isFormula=this._isFormula(val);if(isFormula){var ret=true;changeRangesIfArrayFormula();if(ctrlKey)this.model.workbook.dependencyFormulas.lockRecal();c.setValue(AscCommonExcel.getFragmentsText(val),function(r){ret=r},null,applyByArray?bbox:!applyByArray&&ctrlKey?null:undefined);if(ctrlKey)this.model.workbook.dependencyFormulas.unlockRecal(); if(!ret){History.EndTransaction();return false}if(applyByArray)History.Add(AscCommonExcel.g_oUndoRedoArrayFormula,AscCH.historyitem_ArrayFromula_AddFormula,this.model.getId(),new Asc.Range(c.bbox.c1,c.bbox.r1,c.bbox.c2,c.bbox.r2),new AscCommonExcel.UndoRedoData_ArrayFormula(c.bbox,"="+c.getFormula()));isFormula=c.isFormula();this.model.checkChangeTablesContent(bbox)}else{changeRangesIfArrayFormula();c.setValue2(val);this.model.checkChangeTablesContent(bbox)}if(!isFormula)if(-1!==AscCommonExcel.getFragmentsText(val).indexOf(kNewLine))c.setWrap(true); if(!isNotHistory)History.EndTransaction();if(isFormula&&!applyByArray)c._foreach(function(cell){cell._adjustCellFormat()});var emptyValue=val&&val.length===1&&val[0]&&val[0].text==="";if(!emptyValue)t.applyTableAutoExpansion(bbox,applyByArray);this.canChangeColWidth=isNotHistory?c_oAscCanChangeColWidth.none:c_oAscCanChangeColWidth.numbers;this._updateRange(bbox);this.canChangeColWidth=c_oAscCanChangeColWidth.none;this.draw(lockDraw);return true};WorksheetView.prototype.openCellEditor=function(editor, enterOptions,selectionRange){var t=this,col,row,c,fl,mc,bg,isMerged;if(selectionRange)this.model.selectionRange=selectionRange;if(this.oOtherRanges){this.cleanSelection();this.endEditChart();this._drawSelection()}var cell=this.model.selectionRange.activeCell;function getVisibleRangeObject(){var vr=t.visibleRange.clone(),offsetX=0,offsetY=0;if(t.topLeftFrozenCell){var cFrozen=t.topLeftFrozenCell.getCol0();var rFrozen=t.topLeftFrozenCell.getRow0();if(0<cFrozen)if(col>=cFrozen)offsetX=t._getColLeft(cFrozen)- t._getColLeft(0);else{vr.c1=0;vr.c2=cFrozen-1}if(0<rFrozen)if(row>=rFrozen)offsetY=t._getRowTop(rFrozen)-t._getRowTop(0);else{vr.r1=0;vr.r2=rFrozen-1}}return{vr:vr,offsetX:offsetX,offsetY:offsetY}}col=cell.col;row=cell.row;c=this._getVisibleCell(col,row);fl=this._getCellFlags(c);isMerged=fl.isMerged();if(isMerged){mc=fl.merged;c=this._getVisibleCell(mc.c1,mc.r1);fl=this._getCellFlags(c)}this.handlers.trigger("onScroll",this._calcActiveCellOffset());bg=c.getFillColor();var font=c.getFont();this.model.workbook.handlers.trigger("asc_onHideComment"); var _fragmentsTmp=c.getValueForEdit2();var fragments=[];for(var i=0;i<_fragmentsTmp.length;++i)fragments.push(_fragmentsTmp[i].clone());var arrAutoComplete=this.getCellAutoCompleteValues(cell,kMaxAutoCompleteCellEdit);var arrAutoCompleteLC=asc.arrayToLowerCase(arrAutoComplete);this.model.workbook.handlers.trigger("cleanCutData",true,true);editor.open({enterOptions:enterOptions,fragments:fragments,flags:fl,font:font,background:bg||this.settings.cells.defaultState.background,zoom:this.getZoom(),isAddPersentFormat:enterOptions.quickInput&& Asc.c_oAscNumFormatType.Percent===c.getNumFormatType(),autoComplete:arrAutoComplete,autoCompleteLC:arrAutoCompleteLC,bbox:c.bbox,cellNumFormat:c.getNumFormatType(),saveValueCallback:function(val,flags,callback){var saveCellValueCallback=function(success){if(!success)if(callback)return callback(false);else return false;var bRes=t._saveCellValueAfterEdit(c,val,flags,false,false);if(callback)return callback(bRes);else return bRes};var text=AscCommonExcel.getFragmentsText(val);var dataValidation=t.model.getDataValidation(col, row);if(dataValidation&&dataValidation.allowBlank&&0===text.length)dataValidation=null;if(dataValidation){var checkCell,setValueError;checkCell=t.model.getCellForValidation(row,col,val,t._isFormula(val)?text:null,function(_res){setValueError=!_res});if(setValueError)return false;var oldValueData;var isNeedChange=Asc.EDataValidationType.Custom===dataValidation.type;var temporarySetValue=function(_val){if(isNeedChange)c._foreach(function(cell){if(cell.nCol===col&&cell.nRow===row)if(_val){oldValueData= cell.getValueData();cell._setValueData(_val.value)}else cell._setValueData(oldValueData.value)})};temporarySetValue(checkCell.getValueData());if(!dataValidation.checkValue(checkCell,t.model)){t.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.DataValidate,c_oAscError.Level.NoCritical,dataValidation);editor.setFocus(true);temporarySetValue();return false}else temporarySetValue()}var ref=null;if(flags.ctrlKey&&flags.shiftKey){var activeRange=t.getSelectedRange();var doNotApply=false;var formulaRef; if(!activeRange.bbox.isOneCell())if(t.model.autoFilters.isIntersectionTable(activeRange.bbox)){t.handlers.trigger("onErrorEvent",c_oAscError.ID.MultiCellsInTablesFormulaArray,c_oAscError.Level.NoCritical);return false}else if(t.model.inPivotTable(activeRange.bbox)){t.handlers.trigger("onErrorEvent",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return false}else activeRange._foreachNoEmpty(function(cell){ref=cell.formulaParsed&&cell.formulaParsed.ref?cell.formulaParsed.ref:null;if(ref&& !activeRange.bbox.containsRange(ref)){doNotApply=true;return false}});else activeRange._foreachNoEmpty(function(cell){formulaRef=cell.formulaParsed&&cell.formulaParsed.ref?cell.formulaParsed.ref:null});if(doNotApply){t.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return false}else{var lockedRange=formulaRef?formulaRef:activeRange.bbox;t._isLockedCells(lockedRange,null,saveCellValueCallback)}}else{c._foreachNoEmpty(function(cell){ref=cell.formulaParsed&& cell.formulaParsed.ref?cell.formulaParsed.ref:null});if(ref&&!ref.isOneCell()){t.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return false}else return saveCellValueCallback(true)}},getSides:function(){var _c1,_r1,_c2,_r2,ri=0,bi=0;if(isMerged){_c1=mc.c1;_c2=mc.c2;_r1=mc.r1;_r2=mc.r2}else{_c1=_c2=col;_r1=_r2=row}var vro=getVisibleRangeObject();var i,w,h,arrLeftS=[],arrRightS=[],arrBottomS=[];var offsX=t._getColLeft(vro.vr.c1)-t._getColLeft(0)- vro.offsetX;var offsY=t._getRowTop(vro.vr.r1)-t._getRowTop(0)-vro.offsetY;var cellX=t._getColLeft(_c1)-offsX,cellY=t._getRowTop(_r1)-offsY;var _left=cellX;for(i=_c1;i>=vro.vr.c1;--i){w=t._getColumnWidth(i);if(0<w)arrLeftS.push(_left);_left-=w}if(_c2>vro.vr.c2)_c2=vro.vr.c2;_left=cellX;for(i=_c1;i<=vro.vr.c2;++i){w=t._getColumnWidth(i);_left+=w;if(0<w)arrRightS.push(_left);if(_c2===i)ri=arrRightS.length-1}w=t.drawingCtx.getWidth();if(arrRightS[arrRightS.length-1]>w)arrRightS[arrRightS.length-1]=w; if(_r2>vro.vr.r2)_r2=vro.vr.r2;var _top=cellY;for(i=_r1;i<=vro.vr.r2;++i){h=t._getRowHeight(i);_top+=h;if(0<h)arrBottomS.push(_top);if(_r2===i)bi=arrBottomS.length-1}h=t.drawingCtx.getHeight();if(arrBottomS[arrBottomS.length-1]>h)arrBottomS[arrBottomS.length-1]=h;return{l:arrLeftS,r:arrRightS,b:arrBottomS,cellX:cellX,cellY:cellY,ri:ri,bi:bi}},checkVisible:function(){return null!==t.getCellVisibleRange(c.bbox.c1,c.bbox.r1)}})};WorksheetView.prototype.updateRanges=function(ranges,skipHeight){if(0<ranges.length)for(var i= 0;i<ranges.length;++i)this._updateRange(ranges[i],skipHeight)};WorksheetView.prototype._updateRange=function(range,skipHeight){this._cleanCache(range);if(c_oAscSelectionType.RangeMax===range.getType()){this.rows=[];this.cols=[]}if(skipHeight)this.arrRecalcRanges.push(range);else{this.arrRecalcRangesWithHeight.push(range);this.arrRecalcRangesCanChangeColWidth.push(this.canChangeColWidth)}};WorksheetView.prototype._reinitializeScroll=function(){this.handlers.trigger("reinitializeScroll",this.scrollType); this.scrollType=0};WorksheetView.prototype._recalculate=function(){var ranges=this.arrRecalcRangesWithHeight.concat(this.arrRecalcRanges,this.model.hiddenManager.getRecalcHidden());if(0<ranges.length){this.arrRecalcRanges=[];this._calcHeightRows(AscCommonExcel.recalcType.newLines);this._calcWidthColumns(AscCommonExcel.recalcType.newLines);var minRow=this._updateRowsHeight();this._updateVisibleRowsCount(true);this._updateSelectionNameAndInfo();if(null!==minRow)if(this.objectRender)this.objectRender.updateDrawingsTransform({target:c_oTargetType.RowResize, row:minRow});this.model.onUpdateRanges(ranges);this.objectRender.rebuildChartGraphicObjects(ranges);this.cellCommentator.updateActiveComment();if(this._initRowsCount())this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollVertical;if(this._initColsCount())this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollHorizontal;this.handlers.trigger("onDocumentPlaceChanged")}this._updateColumnPositions();this._reinitializeScroll()};WorksheetView.prototype._updateDrawingArea=function(){if(this.objectRender&& this.objectRender.drawingArea)this.objectRender.drawingArea.reinitRanges()};WorksheetView.prototype.endEditChart=function(){if(this.isChartAreaEditMode)this.isChartAreaEditMode=false;this.oOtherRanges=null};WorksheetView.prototype.addAutoFilter=function(styleName,addFormatTableOptionsObj){if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;if(!this.handlers.trigger("getLockDefNameManagerStatus")){this.handlers.trigger("onErrorEvent",c_oAscError.ID.LockCreateDefName, c_oAscError.Level.NoCritical);return}if(!window["AscCommonExcel"].filteringMode)return;this.model.workbook.handlers.trigger("cleanCutData",true,true);var t=this;var ar=this.model.selectionRange.getLast().clone();var isChangeAutoFilterToTablePart=function(addFormatTableOptionsObj){var res=false;var worksheet=t.model;var activeRange=AscCommonExcel.g_oRangeCache.getAscRange(addFormatTableOptionsObj.asc_getRange());if(activeRange&&worksheet.AutoFilter&&activeRange.containsRange(worksheet.AutoFilter.Ref)&& activeRange.r1===worksheet.AutoFilter.Ref.r1)res=true;return res};var filterRange,bIsChangeFilterToTable,addNameColumn;var onChangeAutoFilterCallback=function(isSuccess){if(false===isSuccess){t.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedAllError,c_oAscError.Level.NoCritical);t.handlers.trigger("selectionChanged");return}var addFilterCallBack;if(bIsChangeFilterToTable){addFilterCallBack=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction(); t.model.autoFilters.changeAutoFilterToTablePart(styleName,ar,addFormatTableOptionsObj);t._updateRange(filterRange);t._autoFitColumnsWidth([new Asc.Range(filterRange.c1,filterRange.r1,filterRange.c2,filterRange.r1)]);t.draw();History.EndTransaction()};if(ar.containsRange(filterRange))filterRange=ar.clone();if(addNameColumn)filterRange.r2=filterRange.r2+1;t._isLockedCells(filterRange,null,addFilterCallBack)}else{addFilterCallBack=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint(); History.StartTransaction();var type=ar.getType();var isSlowOperation=false;if(c_oAscSelectionType.RangeMax===type||c_oAscSelectionType.RangeRow===type||c_oAscSelectionType.RangeCol===type)isSlowOperation=null!=styleName;if(isSlowOperation)t.handlers.trigger("slowOperation",true);var slowOperationCallback=function(){t.model.autoFilters.addAutoFilter(styleName,ar,addFormatTableOptionsObj,null,null,filterInfo);if(styleName&&addNameColumn)t.setSelection(filterRange);t.model.workbook.dependencyFormulas.unlockRecal(); if(styleName){t._updateRange(filterRange);t._autoFitColumnsWidth([new Asc.Range(filterRange.c1,filterRange.r1,filterRange.c2,filterRange.r1)])}t.draw();t.handlers.trigger("selectionChanged");History.EndTransaction();if(isSlowOperation)t.handlers.trigger("slowOperation",false)};if(isSlowOperation)window.setTimeout(function(){slowOperationCallback()},0);else slowOperationCallback()};if(styleName==null)addFilterCallBack(true);else t._isLockedCells(filterRange,null,addFilterCallBack)}};var filterInfo; if(addFormatTableOptionsObj&&isChangeAutoFilterToTablePart(addFormatTableOptionsObj)===true){filterRange=t.model.AutoFilter.Ref.clone();addNameColumn=false;if(addFormatTableOptionsObj===false)addNameColumn=true;else if(typeof addFormatTableOptionsObj=="object")addNameColumn=!addFormatTableOptionsObj.asc_getIsTitle();bIsChangeFilterToTable=true}else if(styleName==null){filterRange=ar&&ar.isOneCell()?ar.clone():t.model.autoFilters.cutRangeByDefinedCells(ar);ar=filterRange}else{filterInfo=t.model.autoFilters._getFilterInfoByAddTableProps(ar, addFormatTableOptionsObj,true);filterRange=filterInfo.filterRange;addNameColumn=filterInfo.addNameColumn}var checkFilterRange=filterInfo?filterInfo.rangeWithoutDiff:filterRange;if(t._checkAddAutoFilter(checkFilterRange,styleName,addFormatTableOptionsObj)===true){this._isLockedAll(onChangeAutoFilterCallback);this._isLockedDefNames(null,null)}else t.handlers.trigger("selectionChanged")};WorksheetView.prototype.changeAutoFilter=function(tableName,optionType,val,opt_callback){if(this.collaborativeEditing.getGlobalLock()|| !window["Asc"]["editor"].canEdit()){if(opt_callback)opt_callback(false);return}if(!window["AscCommonExcel"].filteringMode){if(opt_callback)opt_callback(false);return}this.model.workbook.handlers.trigger("cleanCutData",true,true);var t=this;var ar=this.model.selectionRange.getLast().clone();var onChangeAutoFilterCallback=function(isSuccess){if(false===isSuccess){if(opt_callback)opt_callback(false);t.handlers.trigger("selectionChanged");return}switch(optionType){case Asc.c_oAscChangeFilterOptions.filter:{if(!val){var filterRange= null;var tablePartsContainsRange=t.model.autoFilters._isTablePartsContainsRange(ar);if(tablePartsContainsRange&&tablePartsContainsRange.Ref)filterRange=tablePartsContainsRange.Ref.clone();else if(t.model.AutoFilter)filterRange=t.model.AutoFilter.Ref;if(null===filterRange)return;var deleteFilterCallBack=function(_success){if(!_success)return;t.model.autoFilters.deleteAutoFilter(ar,tableName);t.af_drawButtons(filterRange);t._onUpdateFormatTable(filterRange)};t._isLockedCells(filterRange,null,deleteFilterCallBack)}else{var addFilterCallBack= function(_success){if(!_success){if(opt_callback)opt_callback(false);return}History.Create_NewPoint();History.StartTransaction();t.model.autoFilters.addAutoFilter(null,ar);History.EndTransaction();t._onUpdateFormatTable(filterRange);if(opt_callback)opt_callback(true)};var filterInfo=t.model.autoFilters._getFilterInfoByAddTableProps(ar);filterRange=filterInfo.filterRange;t._isLockedCells(filterRange,null,addFilterCallBack)}break}case Asc.c_oAscChangeFilterOptions.style:{var changeStyleFilterCallBack= function(_success){if(!_success)return;History.Create_NewPoint();History.StartTransaction();t.model.autoFilters.changeTableStyleInfo(val,ar,tableName);History.EndTransaction();t._updateRange(filterRange);t.draw()};var filterRange;var isTablePartsContainsRange=t.model.autoFilters._isTablePartsContainsRange(ar);if(isTablePartsContainsRange!==null)filterRange=isTablePartsContainsRange.Ref.clone();t._isLockedCells(filterRange,null,changeStyleFilterCallBack);break}}};if(Asc.c_oAscChangeFilterOptions.style=== optionType)onChangeAutoFilterCallback(true);else this._isLockedAll(onChangeAutoFilterCallback)};WorksheetView.prototype.applyAutoFilter=function(autoFilterObject){var t=this;var ar=this.model.selectionRange.getLast().clone();if(Asc.CT_pivotTableDefinition.prototype.asc_filterByCell){var cellId=autoFilterObject.asc_getCellId();if(cellId){var cellRange=AscCommonExcel.g_oRangeCache.getAscRange(cellId);var pivotTable=this.model.inPivotTable(cellRange);if(pivotTable){pivotTable.asc_filterByCell(this.model.workbook.oApi, autoFilterObject,cellRange.r1,cellRange.c1);return}}}var nActive=t.model.getActiveNamedSheetViewId();var onChangeAutoFilterCallback=function(isSuccess){if(false===isSuccess&&nActive===null){t.model.workbook.slicersUpdateAfterChangeTable(autoFilterObject.displayName);return}var applyFilterProps=t.model.autoFilters.applyAutoFilter(autoFilterObject,ar);if(!applyFilterProps)return false;var minChangeRow=applyFilterProps.minChangeRow;var rangeOldFilter=applyFilterProps.rangeOldFilter;var differentSheetApply= t.model.index!==t.workbook.model.nActive;if(null!==rangeOldFilter&&!t.model.workbook.bUndoChanges&&!t.model.workbook.bRedoChanges){t.objectRender.bUpdateMetrics=false;t._onUpdateFormatTable(rangeOldFilter,differentSheetApply);t.objectRender.bUpdateMetrics=true;if(applyFilterProps.nOpenRowsCount!==applyFilterProps.nAllRowsCount)t.handlers.trigger("onFilterInfo",applyFilterProps.nOpenRowsCount,applyFilterProps.nAllRowsCount)}if(null!==minChangeRow)t.objectRender.updateSizeDrawingObjects({target:c_oTargetType.RowResize, row:minChangeRow})};var api=window["Asc"]["editor"];if(!window["AscCommonExcel"].filteringMode){History.LocalChange=true;onChangeAutoFilterCallback();History.LocalChange=false}else this._isLockedAll(onChangeAutoFilterCallback)};WorksheetView.prototype.reapplyAutoFilter=function(tableName){var t=this;var ar=this.model.selectionRange.getLast().clone();var onChangeAutoFilterCallback=function(isSuccess){if(false===isSuccess)return;var applyFilterProps=t.model.autoFilters.reapplyAutoFilter(tableName,ar); var filter=applyFilterProps.filter;if(filter&&filter.SortState&&filter.SortState.SortConditions&&filter.SortState.SortConditions[0]){var sortState=filter.SortState;var rangeWithoutHeaderFooter=filter.getRangeWithoutHeaderFooter();var sortRange=t.model.getRange3(rangeWithoutHeaderFooter.r1,rangeWithoutHeaderFooter.c1,rangeWithoutHeaderFooter.r2,rangeWithoutHeaderFooter.c2);var startCol=sortState.SortConditions[0].Ref.c1;var type;var rgbColor=null;switch(sortState.SortConditions[0].ConditionSortBy){case Asc.ESortBy.sortbyCellColor:{type= Asc.c_oAscSortOptions.ByColorFill;rgbColor=sortState.SortConditions[0].dxf.fill.bg();break}case Asc.ESortBy.sortbyFontColor:{type=Asc.c_oAscSortOptions.ByColorFont;rgbColor=sortState.SortConditions[0].dxf.font.getColor();break}default:{type=Asc.c_oAscSortOptions.ByColorFont;if(sortState.SortConditions[0].ConditionDescending)type=Asc.c_oAscSortOptions.Descending;else type=Asc.c_oAscSortOptions.Ascending}}var sort=t._doSort(sortRange,type,startCol,rgbColor,null,null,null,sortState);t.cellCommentator.sortComments(sort)}t.model.autoFilters._resetTablePartStyle(); var minChangeRow=applyFilterProps.minChangeRow;var updateRange=applyFilterProps.updateRange;if(updateRange&&!t.model.workbook.bUndoChanges&&!t.model.workbook.bRedoChanges){t.objectRender.bUpdateMetrics=false;t._onUpdateFormatTable(updateRange);t.objectRender.bUpdateMetrics=true}if(null!==minChangeRow)t.objectRender.updateSizeDrawingObjects({target:c_oTargetType.RowResize,row:minChangeRow})};if(!window["AscCommonExcel"].filteringMode){History.LocalChange=true;onChangeAutoFilterCallback();History.LocalChange= false}else this._isLockedAll(onChangeAutoFilterCallback)};WorksheetView.prototype.applyAutoFilterByType=function(autoFilterObject){var t=this;var activeCell=this.model.selectionRange.activeCell.clone();var ar=this.model.selectionRange.getLast().clone();if(!this.model.getColDataNoEmpty(activeCell.col)){t.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);return}var isStartRangeIntoFilterOrTable=t.model.autoFilters.isStartRangeContainIntoTableOrFilter(activeCell); var isApplyAutoFilter=null,isAddAutoFilter=null,cellId=null,isFromatTable=null;if(null!==isStartRangeIntoFilterOrTable){isFromatTable=!(-1===isStartRangeIntoFilterOrTable);var filterRef=isFromatTable?t.model.TableParts[isStartRangeIntoFilterOrTable].Ref:t.model.AutoFilter.Ref;cellId=t.model.autoFilters._rangeToId(new Asc.Range(ar.c1,filterRef.r1,ar.c1,filterRef.r1));isApplyAutoFilter=true;if(isFromatTable&&!t.model.TableParts[isStartRangeIntoFilterOrTable].AutoFilter)isAddAutoFilter=true}else{isAddAutoFilter= true;isApplyAutoFilter=true}var onChangeAutoFilterCallback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();if(null!==isAddAutoFilter){if(!isFromatTable&&t.model.AutoFilter&&t.model.AutoFilter.Ref)t.model.autoFilters.isEmptyAutoFilters(t.model.AutoFilter.Ref);t.model.autoFilters.addAutoFilter(null,ar,null);if(null===cellId)cellId=t.model.autoFilters._rangeToId(new Asc.Range(activeCell.col,t.model.AutoFilter.Ref.r1,activeCell.col,t.model.AutoFilter.Ref.r1))}if(null!== isApplyAutoFilter){autoFilterObject.asc_setCellId(cellId);var filter=autoFilterObject.filter;if(c_oAscAutoFilterTypes.CustomFilters===filter.type)t.model._getCell(activeCell.row,activeCell.col,function(cell){filter.filter.CustomFilters[0].Val=cell.getValueWithoutFormat()});else if(c_oAscAutoFilterTypes.ColorFilter===filter.type)t.model._getCell(activeCell.row,activeCell.col,function(cell){if(filter.filter&&filter.filter.dxf&&filter.filter.dxf.fill){var xfs=cell.getCompiledStyleCustom(false,true,true); if(false===filter.filter.CellColor){var fontColor=xfs&&xfs.font?xfs.font.getColor():null;if(null!==fontColor)filter.filter.dxf.fill.fromColor(fontColor)}else{var cellColor=null!==xfs&&xfs.fill&&xfs.fill.bg()?xfs.fill.bg():null;filter.filter.dxf.fill.fromColor(null!==cellColor?new AscCommonExcel.RgbColor(cellColor.getRgb()):null)}}});var applyFilterProps=t.model.autoFilters.applyAutoFilter(autoFilterObject,ar,true);if(!applyFilterProps){History.EndTransaction();return false}var minChangeRow=applyFilterProps.minChangeRow; var rangeOldFilter=applyFilterProps.rangeOldFilter;History.EndTransaction();if(null!==rangeOldFilter&&!t.model.workbook.bUndoChanges&&!t.model.workbook.bRedoChanges){t.objectRender.bUpdateMetrics=false;t._onUpdateFormatTable(rangeOldFilter);t.objectRender.bUpdateMetrics=true}if(null!==minChangeRow)t.objectRender.updateSizeDrawingObjects({target:c_oTargetType.RowResize,row:minChangeRow})}else History.EndTransaction()};if(null===isAddAutoFilter){var api=window["Asc"]["editor"];if(!window["AscCommonExcel"].filteringMode){History.LocalChange= true;onChangeAutoFilterCallback();History.LocalChange=false}else{var activeId=t.model.getActiveNamedSheetViewId();if(null!==activeId)onChangeAutoFilterCallback(true);else this._isLockedAll(onChangeAutoFilterCallback)}}else{if(!window["AscCommonExcel"].filteringMode)return;if(t._checkAddAutoFilter(ar,null,autoFilterObject,true)===true){this._isLockedAll(onChangeAutoFilterCallback);this._isLockedDefNames(null,null)}}};WorksheetView.prototype.sortRange=function(type,cellId,displayName,color,bIsExpandRange){var t= this;var ar=this.model.selectionRange.getLast().clone();if(!window["AscCommonExcel"].filteringMode)return;if(Asc.CT_pivotTableDefinition.prototype.asc_sortByCell){var activeRangeOrCellId=ar;var activeCellOrCellId=this.model.selectionRange.activeCell;if(cellId&&typeof cellId=="string"){activeRangeOrCellId=AscCommonExcel.g_oRangeCache.getAscRange(cellId);activeCellOrCellId=new AscCommon.CellBase(activeRangeOrCellId.r1,activeRangeOrCellId.c1)}var pivotTable=this.model.inPivotTable(activeRangeOrCellId); if(pivotTable){pivotTable.asc_sortByCell(t.model.workbook.oApi,type,activeCellOrCellId.row,activeCellOrCellId.col);return}}var sortProps=t.model.autoFilters.getPropForSort(cellId,ar,displayName);var cloneSortProps=sortProps;var isFilter=sortProps&&sortProps.curFilter&&sortProps.curFilter.isAutoFilter();var filterRef;if(bIsExpandRange&&isFilter){filterRef=sortProps.curFilter.Ref;sortProps=null}var expandRange;var selectionRange=t.model.selectionRange;var activeCell=selectionRange.activeCell.clone(); var activeRange=selectionRange.getLast();if(null===sortProps)if(bIsExpandRange){expandRange=t.model.autoFilters.expandRange(activeRange);expandRange=t.model.autoFilters.checkExpandRangeForSort(expandRange);var bIgnoreFirstRow=window["AscCommonExcel"].ignoreFirstRowSort(t.model,expandRange);if(bIgnoreFirstRow)expandRange.r1++;else if(expandRange&&filterRef&&filterRef.containsRange(expandRange)&&expandRange.r1===filterRef.r1)sortProps=cloneSortProps}var onChangeAutoFilterCallback=function(isSuccess){if(false=== isSuccess)return;var onSortAutoFilterCallBack=function(success){if(false===success)return;History.Create_NewPoint();History.StartTransaction();var rgbColor=color?new AscCommonExcel.RgbColor((color.asc_getR()<<16)+(color.asc_getG()<<8)+color.asc_getB()):null;var sort=t._doSort(sortProps.sortRange,type,sortProps.startCol,rgbColor);t.cellCommentator.sortComments(sort);t.model.autoFilters.sortColFilter(type,cellId,ar,sortProps,displayName,rgbColor);History.EndTransaction();t._onUpdateFormatTable(sortProps.sortRange.bbox); t.objectRender.updateSizeDrawingObjects({target:c_oTargetType.RowResize,row:sortProps.sortRange.bbox.r1})};if(null===sortProps){var rgbColor=color?new AscCommonExcel.RgbColor((color.asc_getR()<<16)+(color.asc_getG()<<8)+color.asc_getB()):null;if(bIsExpandRange&&expandRange){t.setSelection(expandRange);selectionRange.activeCell=activeCell}t.setSelectionInfo("sort",{type:type,color:rgbColor})}else if(false!==sortProps)t._isLockedCells(sortProps.sortRange.bbox,null,onSortAutoFilterCallBack)};var doSortRange= sortProps?sortProps.sortRange.bbox:expandRange;if(!doSortRange)doSortRange=activeRange;if(t.model.inPivotTable(doSortRange)){t.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical);return}if(!this.intersectionFormulaArray(doSortRange,true))this._isLockedAll(onChangeAutoFilterCallback);else this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical)};WorksheetView.prototype.getAddFormatTableOptions= function(range,isPivot){var selectionRange=this.model.selectionRange.getLast();return this.model.autoFilters.getAddFormatTableOptions(selectionRange,range,isPivot)};WorksheetView.prototype.clearFilter=function(){var t=this;var ar=this.model.selectionRange.getLast().clone();if(Asc.CT_pivotTableDefinition.prototype.asc_removeFilters){var pivotTable=this.model.inPivotTable(ar);if(pivotTable){pivotTable.asc_removeFilters(this.model.workbook.oApi);return}}var nActive=t.model.getActiveNamedSheetViewId(); var onChangeAutoFilterCallback=function(isSuccess){if(false===isSuccess&&null===nActive)return;AscCommonExcel.checkFilteringMode(function(){var updateRange=t.model.autoFilters.isApplyAutoFilterInCell(ar,true);if(false!==updateRange){t._onUpdateFormatTable(updateRange);t.objectRender.updateSizeDrawingObjects({target:c_oTargetType.RowResize,row:updateRange.r1});t._updateSlicers(updateRange)}})};this._isLockedAll(onChangeAutoFilterCallback)};WorksheetView.prototype.clearFilterColumn=function(cellId, displayName){var t=this;if(Asc.CT_pivotTableDefinition.prototype.asc_removeFilterByCell)if(cellId){var cellRange=AscCommonExcel.g_oRangeCache.getAscRange(cellId);var pivotTable=this.model.inPivotTable(cellRange);if(pivotTable){pivotTable.asc_removeFilterByCell(this.model.workbook.oApi,cellRange.r1,cellRange.c1);return}}var nActive=t.model.getActiveNamedSheetViewId();var onChangeAutoFilterCallback=function(isSuccess){if(false===isSuccess&&nActive===null)return;AscCommonExcel.checkFilteringMode(function(){var updateRange= t.model.autoFilters.clearFilterColumn(cellId,displayName);if(false!==updateRange){t._onUpdateFormatTable(updateRange);t.objectRender.updateSizeDrawingObjects({target:c_oTargetType.RowResize,row:updateRange.r1});t._updateSlicers(updateRange)}})};this._isLockedAll(onChangeAutoFilterCallback)};WorksheetView.prototype._onUpdateFormatTable=function(range,lockDraw){this._initCellsArea(AscCommonExcel.recalcType.full);this.cache.reset();this._cleanCellsTextMetricsCache();this._prepareCellTextMetricsCache(); this._updateDrawingArea();var arrChanged=[new asc_Range(range.c1,0,range.c2,gc_nMaxRow0)];this.model.onUpdateRanges(arrChanged);this.objectRender.rebuildChartGraphicObjects(arrChanged);this.scrollType|=AscCommonExcel.c_oAscScrollType.ScrollVertical|AscCommonExcel.c_oAscScrollType.ScrollHorizontal;this.draw(lockDraw);this._updateSelectionNameAndInfo()};WorksheetView.prototype._loadFonts=function(fonts,callback){var api=window["Asc"]["editor"];api._loadFonts(fonts,callback)};WorksheetView.prototype.setData= function(oData){History.Clear();History.TurnOff();var oAllRange=this.model.getRange3(0,0,this.model.getRowsCount(),this.model.getColsCount());oAllRange.cleanAll();var row,oCell;for(var r=0;r<oData.length;++r){row=oData[r];for(var c=0;c<row.length;++c)if(row[c]){oCell=this._getVisibleCell(c,r);oCell.setValue(row[c])}}History.TurnOn();this._updateRange(oAllRange.bbox);this.draw()};WorksheetView.prototype.getData=function(){var arrResult,arrCells=[],c,r,row,lastC=-1,lastR=-1,val;var maxCols=Math.min(this.model.getColsCount(), gc_nMaxCol);var maxRows=Math.min(this.model.getRowsCount(),gc_nMaxRow);for(r=0;r<maxRows;++r){row=[];for(c=0;c<maxCols;++c){this.model._getCellNoEmpty(r,c,function(cell){if(cell&&""!==(val=cell.getValue())){lastC=Math.max(lastC,c);lastR=Math.max(lastR,r)}else val=""});row.push(val)}arrCells.push(row)}arrResult=arrCells.slice(0,lastR+1);++lastC;if(lastC<maxCols)for(r=0;r<arrResult.length;++r)arrResult[r]=arrResult[r].slice(0,lastC);return arrResult};WorksheetView.prototype._getFilterButtonSize=function(){return AscBrowser.isRetina? AscCommon.AscBrowser.convertToRetinaValue(filterSizeButton,true):filterSizeButton};WorksheetView.prototype.getButtonSize=function(row,col,isDataValidation){var colWidth=this._getColumnWidth(col);var rowHeight=this._getRowHeight(row);var _notChangeScaleWidth=isDataValidation&&col!==AscCommon.gc_nMaxCol0;var width,height,index;width=height=this._getFilterButtonSize();if(colWidth<width&&rowHeight<height&&!_notChangeScaleWidth)if(rowHeight<colWidth){index=rowHeight/height;width=width*index;height=rowHeight}else{index= colWidth/width;width=colWidth;height=height*index}else if(colWidth<width&&!_notChangeScaleWidth){index=colWidth/width;width=colWidth;height=height*index}else if(rowHeight<height){index=rowHeight/height;width=width*index;height=rowHeight}return{w:width,h:height}};WorksheetView.prototype.af_drawButtons=function(updatedRange,offsetX,offsetY){var i,ws=this.model;var t=this;if(ws.workbook.bUndoChanges||ws.workbook.bRedoChanges)return false;var drawCurrentFilterButtons=function(filter){var autoFilter=filter.isAutoFilter()? filter:filter.AutoFilter;if(!filter.Ref)return;var range=new Asc.Range(filter.Ref.c1,filter.Ref.r1,filter.Ref.c2,filter.Ref.r1);if(range.isIntersect(updatedRange)){var row=range.r1;var sortConditions=filter.isApplySortConditions()?filter.SortState.SortConditions:null;for(var col=range.c1;col<=range.c2;col++)if(col>=updatedRange.c1&&col<=updatedRange.c2){var isSetFilter=false;var isShowButton=true;var isSortState=null;var i;var colId=filter.isAutoFilter()?t.model.autoFilters._getTrueColId(autoFilter, col-range.c1,true):col-range.c1;var filterColumns=t.model.getNamedSheetViewFilterColumns(filter.DisplayName);var viewSheetMode=false;if(!filterColumns)filterColumns=autoFilter.FilterColumns;else viewSheetMode=true;if(filterColumns&&filterColumns.length){var filterColumn=null,filterColumnWithMerge=null;for(i=0;i<filterColumns.length;i++){var _filterColumn=viewSheetMode?filterColumns[i].filter:filterColumns[i];if(_filterColumn.ColId===col-range.c1)filterColumn=_filterColumn;if(colId===col-range.c1&& filterColumn!==null){filterColumnWithMerge=filterColumn;break}else if(_filterColumn.ColId===colId)filterColumnWithMerge=_filterColumn}if(filterColumnWithMerge&&filterColumnWithMerge.isApplyAutoFilter())isSetFilter=true;if(filterColumn&&filterColumn.ShowButton===false)isShowButton=false}if(sortConditions&&sortConditions.length)for(i=0;i<sortConditions.length;i++){var sortCondition=sortConditions[i];if(colId===sortCondition.Ref.c1-range.c1)isSortState=!!sortCondition.ConditionDescending}if(isShowButton=== false)continue;t.af_drawCurrentButton(offsetX,offsetY,{isSortState:isSortState,isSetFilter:isSetFilter,row:row,col:col})}}};if(ws.AutoFilter)drawCurrentFilterButtons(ws.AutoFilter);if(ws.TableParts&&ws.TableParts.length)for(i=0;i<ws.TableParts.length;i++){if(ws.TableParts[i].AutoFilter&&ws.TableParts[i].HeaderRowCount!==0)drawCurrentFilterButtons(ws.TableParts[i],true);this._drawRightDownTableCorner(ws.TableParts[i],updatedRange,offsetX,offsetY)}var pivotButtons=this.model.getPivotTableButtons(updatedRange); for(i=0;i<pivotButtons.length;++i)this.af_drawCurrentButton(offsetX,offsetY,pivotButtons[i]);return true};WorksheetView.prototype.drawOverlayButtons=function(visibleRange,offsetX,offsetY){var activeCell=this.model.getSelection().activeCell;if(visibleRange.contains2(activeCell)){var dataValidation=this.model.getDataValidation(activeCell.col,activeCell.row);if(dataValidation&&dataValidation.isListValues()||this.model.isTableTotal(activeCell.col,activeCell.row))this.af_drawCurrentButton(offsetX,offsetY, {isOverlay:true,isSortState:null,isSetFilter:false,row:activeCell.row,col:activeCell.col});return false}return true};WorksheetView.prototype.af_drawCurrentButton=function(offsetX,offsetY,props){var t=this;var ctx=props.isOverlay?this.overlayCtx:this.drawingCtx;var isDataValidation=props.isOverlay;var isMobileRetina=false;var isApplyAutoFilter=props.isSetFilter;var isApplySortState=props.isSortState;var row=props.row;var col=props.col;var widthButtonPx,heightButtonPx;widthButtonPx=heightButtonPx=this._getFilterButtonSize(); var widthBorder=1;var scaleIndex=1;var m_oColor=new CColor(120,120,120);var widthWithBorders=widthButtonPx;var heightWithBorders=heightButtonPx;var width=widthButtonPx-widthBorder*2;var height=heightButtonPx-widthBorder*2;var colWidth=t._getColumnWidth(col);var rowHeight=t._getRowHeight(row);if(rowHeight<heightWithBorders){widthWithBorders=widthWithBorders*(rowHeight/heightWithBorders);heightWithBorders=rowHeight}var x1;if(isDataValidation){var _maxColDiff=col===AscCommon.gc_nMaxCol0?widthWithBorders- widthBorder:0;x1=t._getColLeft(col+1)-_maxColDiff-.5-offsetX}else x1=t._getColLeft(col+1)-widthWithBorders-.5-offsetX;var y1=t._getRowTop(row+1)-heightWithBorders-.5-offsetY-1;var _drawButtonFrame=function(startX,startY,width,height){ctx.setFillStyle(t.settings.cells.defaultState.background);ctx.setLineWidth(1);ctx.setStrokeStyle(t.settings.cells.defaultState.border);ctx.fillRect(startX,startY,width,height);ctx.strokeRect(startX,startY,width,height)};var _drawSortArrow=function(startX,startY,isDescending, heightArrow){ctx.beginPath();ctx.lineVer(startX,startY,startY+heightArrow*scaleIndex);var tmp;var x=startX;var y=startY;var heightArrow1=heightArrow*scaleIndex;var height=3*scaleIndex;var x1,x2,y1,i;if(isDescending)for(i=0;i<height;i++){tmp=i;x1=x-tmp;x2=x-tmp+1;y1=y-tmp+heightArrow1-1;ctx.lineHor(x1,y1,x2);x1=x+tmp;x2=x+tmp+1;y1=y-tmp+heightArrow1-1;ctx.lineHor(x1,y1,x2)}else for(i=0;i<height;i++){tmp=i;x1=x-tmp;x2=x-tmp+1;y1=y+tmp;ctx.lineHor(x1,y1,x2);x1=x+tmp;x2=x+tmp+1;y1=y+tmp;ctx.lineHor(x1, y1,x2)}if(isMobileRetina)ctx.setLineWidth(AscBrowser.retinaPixelRatio*2);else ctx.setLineWidth(AscBrowser.retinaPixelRatio);ctx.setStrokeStyle(m_oColor);ctx.stroke()};var _drawFilterMark=function(x,y,height){var heightLine=Math.round(height);var heightCleanLine=heightLine-2;ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo(x,y-heightCleanLine);ctx.setLineWidth(2*AscBrowser.retinaPixelRatio*(isMobileRetina?2:1));ctx.setStrokeStyle(m_oColor);ctx.stroke();var heightTriangle=4;y=y-heightLine+1;_drawFilterDreieck(x, y,heightTriangle,2)};var _drawFilterDreieck=function(x,y,height,base){ctx.beginPath();if(isMobileRetina)ctx.setLineWidth(AscBrowser.retinaPixelRatio*2);else ctx.setLineWidth(AscBrowser.retinaPixelRatio);x=x+1;var diffY=height/2;height=height*scaleIndex;for(var i=0;i<height;i++)ctx.lineHor(x-(i+base),y+(height-i)-diffY,x+i);ctx.setStrokeStyle(m_oColor);ctx.stroke()};var _drawButton=function(upLeftXButton,upLeftYButton){_drawButtonFrame(upLeftXButton,upLeftYButton,width,height);var centerX=upLeftXButton+ width/2;var centerY=upLeftYButton+height/2;var heigthObj,marginTop;if(null!==isApplySortState&&isApplyAutoFilter){heigthObj=Math.ceil(height/2)+2;marginTop=Math.floor((height-heigthObj)/2);centerY=upLeftYButton+heigthObj+marginTop;_drawSortArrow(upLeftXButton+4*scaleIndex,upLeftYButton+5*scaleIndex,isApplySortState,8);_drawFilterMark(centerX+3,centerY,heigthObj)}else if(null!==isApplySortState){_drawSortArrow(upLeftXButton+width-5*scaleIndex,upLeftYButton+3*scaleIndex,isApplySortState,10);_drawFilterDreieck(centerX- 3,centerY+1,3,1)}else if(isApplyAutoFilter){heigthObj=Math.ceil(height/2)+2;marginTop=Math.floor((height-heigthObj)/2);centerY=upLeftYButton+heigthObj+marginTop;_drawFilterMark(centerX+1,centerY,heigthObj)}else _drawFilterDreieck(centerX,centerY,4,1)};var _notChangeScaleWidth=isDataValidation&&col!==AscCommon.gc_nMaxCol0;var diffX=0;var diffY=0;if(colWidth-2<width&&rowHeight<height+2&&!_notChangeScaleWidth)if(rowHeight<colWidth){scaleIndex=rowHeight/height;width=width*scaleIndex;height=rowHeight}else{scaleIndex= colWidth/width;diffY=width-colWidth;diffX=width-colWidth;width=colWidth;height=height*scaleIndex}else if(colWidth-2<width&&!_notChangeScaleWidth){scaleIndex=colWidth/width;diffY=width-colWidth;diffX=width-colWidth+2;width=colWidth;height=height*scaleIndex}else if(rowHeight-widthBorder*2<height){scaleIndex=rowHeight/(height+widthBorder*2);width=width*scaleIndex;height=rowHeight-widthBorder*2}if(window["IS_NATIVE_EDITOR"])isMobileRetina=true;if(AscBrowser.isRetina)scaleIndex*=2;_drawButton(x1+diffX, y1+diffY)};WorksheetView.prototype._drawRightDownTableCorner=function(table,updatedRange,offsetX,offsetY){var t=this;var ctx=t.drawingCtx;var isMobileRetina=window["IS_NATIVE_EDITOR"];var retinaKoef=isMobileRetina||AscBrowser.isRetina?2:1;var row=table.Ref.r2;var col=table.Ref.c2;if(!updatedRange.contains(col,row))return;var m_oColor=new CColor(72,93,177);var zoom=t.getZoom();var baseLw=2;var baseLnSize=4;var lnW=Math.round(baseLw*zoom);var kF=lnW/baseLw;var lnSize=baseLnSize*kF;lnW=lnW*retinaKoef; var x1=t._getColLeft(col)+t._getColumnWidth(col)-offsetX-2;var y1=t._getRowTop(row)+t._getRowHeight(row)-offsetY-2;ctx.setLineWidth(AscBrowser.retinaPixelRatio*lnW);var diff=Math.floor((lnW-1)/(2/retinaKoef));ctx.beginPath();ctx.lineVer(x1-diff,y1+1,y1-lnSize+1);ctx.lineHor(x1+1,y1-diff,x1-lnSize+1);ctx.setStrokeStyle(m_oColor);ctx.stroke()};WorksheetView.prototype.af_checkCursor=function(x,y,r,c){var aWs=this.model;var t=this;var result=null;var _isShowButtonInFilter=function(col,filter){var result= true;var autoFilter=filter.isAutoFilter()?filter:filter.AutoFilter;if(filter.HeaderRowCount===0)result=null;else if(autoFilter&&autoFilter.FilterColumns){var colId=col-autoFilter.Ref.c1;for(var i=0;i<autoFilter.FilterColumns.length;i++)if(autoFilter.FilterColumns[i].ColId===colId){if(autoFilter.FilterColumns[i].ShowButton===false)result=null;break}}else if(!filter.isAutoFilter()&&autoFilter===null)result=null;return result};var checkCurrentFilter=function(filter,num){var range=new Asc.Range(filter.Ref.c1, filter.Ref.r1,filter.Ref.c2,filter.Ref.r1);if(range.contains(c,r)&&_isShowButtonInFilter(c,filter)){var row=range.r1;for(var col=range.c1;col<=range.c2;col++)if(col===c)if(t._hitCursorFilterButton(x,y,col,row)){result={cursor:kCurAutoFilter,target:c_oTargetType.FilterObject,col:-1,row:-1,idFilter:{id:num,colId:col-range.c1}};break}}else if(!filter.isAutoFilter()&&filter.isTotalsRow()&&filter.Ref.r2===r&&c>=filter.Ref.c1+1&&c<=filter.Ref.c2+1)if(t._hitCursorFilterButton(x,y,c,r,true))result={cursor:kCurAutoFilter, target:c_oTargetType.FilterObject,col:-1,row:-1,idFilter:{id:num,colId:col-range.c1}}};if(aWs.AutoFilter&&aWs.AutoFilter.Ref)checkCurrentFilter(aWs.AutoFilter,null);if(aWs.TableParts&&aWs.TableParts.length&&!result)for(var i=0;i<aWs.TableParts.length;i++)if(aWs.TableParts[i].AutoFilter)checkCurrentFilter(aWs.TableParts[i],i);return result};WorksheetView.prototype._hitCursorFilterButton=function(x,y,col,row,isDataValidation){var buttonSize=this.getButtonSize(row,col,isDataValidation);var width=buttonSize.w, height=buttonSize.h;var top,left,x1,y1,x2,y2;top=this._getRowTop(row+1);left=this._getColLeft(col+1);y1=top-height-.5;y2=top-.5;if(isDataValidation&&col!==AscCommon.gc_nMaxCol0){x1=left+.5;x2=left+width+.5}else{x1=left-width-.5;x2=left-.5}return x>=x1&&x<=x2&&y>=y1&&y<=y2};WorksheetView.prototype._checkAddAutoFilter=function(activeRange,styleName,oTableProps,filterByCellContextMenu){var result=true;var worksheet=this.model;var filter=worksheet.AutoFilter;var _isOneCell=function(_range){var res=null; if(_range.isOneCell())res=true;else{var merged=worksheet.getMergedByCell(_range.r1,_range.c1);if(merged&&merged.isEqual(_range))res=true}return res};var fullRange=activeRange;if(styleName&&oTableProps&&(!oTableProps.isTitle||activeRange.r1===activeRange.r2))fullRange=new Asc.Range(activeRange.c1,activeRange.r1,activeRange.c2,activeRange.r2+1);if(filter&&styleName&&filter.Ref.isIntersect(activeRange)&&!(filter.Ref.containsRange(activeRange)&&(activeRange.isOneCell()||filter.Ref.isEqual(activeRange))|| filter.Ref.r1===activeRange.r1&&activeRange.containsRange(filter.Ref))){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);result=false}else if(filter&&styleName&&filter.Ref.r1===activeRange.r2+1&&oTableProps.isTitle===false){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);result=false}else if(!styleName&&activeRange.isOneCell()&&worksheet.autoFilters._isEmptyRange(activeRange, 1)){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);result=false}else if(!styleName&&!_isOneCell(activeRange)&&worksheet.autoFilters._isEmptyRange(activeRange,0)){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);result=false}else if(!styleName&&filterByCellContextMenu&&false===worksheet.autoFilters._getAdjacentCellsAF(activeRange,this).isIntersect(activeRange)){worksheet.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);result=false}else if(styleName&&oTableProps&&oTableProps.isTitle===false&&worksheet.autoFilters._isEmptyCellsUnderRange(activeRange)==false&&worksheet.autoFilters._isPartTablePartsUnderRange(activeRange)){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);result=false}else if(this.model.inPivotTable(fullRange))result=false;else if(styleName&&this.intersectionFormulaArray(activeRange, true,true)){worksheet.workbook.handlers.trigger("asc_onError",c_oAscError.ID.MultiCellsInTablesFormulaArray,c_oAscError.Level.NoCritical);result=false}return result};WorksheetView.prototype.pivot_setDialogProp=function(idPivot){if(!idPivot)return;var pivotTable=this.model.getPivotTableById(idPivot.id);if(!pivotTable)return;var autoFilterObject=new Asc.AutoFiltersOptions;autoFilterObject.asc_setCellCoord(this.getCellCoord(idPivot.col,idPivot.row));autoFilterObject.asc_setCellId((new AscCommon.CellBase(idPivot.row, idPivot.col)).getName());pivotTable.fillAutoFiltersOptions(autoFilterObject,idPivot.fld);return autoFilterObject};WorksheetView.prototype._checkFilterButtonInRange=function(c,r){if(this.model.TableParts){var tablePart;for(var i=0;i<this.model.TableParts.length;i++){tablePart=this.model.TableParts[i];if(tablePart.Ref.contains(c,r)&&tablePart.Ref.r1===r)return true}}return this.model.AutoFilter&&this.model.AutoFilter.Ref.contains(c,r)&&this.model.AutoFilter.Ref.r1===r};WorksheetView.prototype.af_setDialogProp= function(filterProp,isReturnProps){var ws=this.model;if(!filterProp)return;var filter,autoFilter,displayName=null;if(filterProp.id===null){autoFilter=ws.AutoFilter;filter=ws.AutoFilter}else{autoFilter=ws.TableParts[filterProp.id].AutoFilter;filter=ws.TableParts[filterProp.id];displayName=filter.DisplayName}var colId=filterProp.colId;if(filterProp.id===null)colId=this.model.autoFilters._getTrueColId(filter,colId,true);var openAndClosedValues=ws.autoFilters.getOpenAndClosedValues(filter,colId);var values= openAndClosedValues.values;var automaticRowCount=openAndClosedValues.automaticRowCount;var ignoreCustomFilter=openAndClosedValues.ignoreCustomFilter;var activeNamedSheetView=ws.getActiveNamedSheetViewId();var nsvFilter;var filters;if(activeNamedSheetView!==null){nsvFilter=ws.getNvsFilterByTableName(filter.DisplayName);if(nsvFilter)filters=nsvFilter.getColumnFilterByColId(colId)}else filters=autoFilter.getFilterColumn(colId,true);var rangeButton=new Asc.Range(autoFilter.Ref.c1+colId,autoFilter.Ref.r1, autoFilter.Ref.c1+colId,autoFilter.Ref.r1);var cellId=ws.autoFilters._rangeToId(rangeButton);var cell=this.model.getRange3(rangeButton.r1,rangeButton.c1,rangeButton.r2,rangeButton.c2);var columnName=cell.getValue();var cellCoord=this.getCellCoord(autoFilter.Ref.c1+colId,autoFilter.Ref.r1);var filterObj=new Asc.AutoFilterObj;filterObj.convertFromFilterColumn(filters,ignoreCustomFilter);var sortVal=null;var sortColor=null;if(filter&&filter.SortState&&filter.SortState.SortConditions&&filter.SortState.SortConditions[0]){var SortConditions= filter.SortState.SortConditions;for(var i=0;i<SortConditions.length;i++){var sortCondition=SortConditions[i];if(rangeButton.c1===sortCondition.Ref.c1){var conditionSortBy=SortConditions.ConditionSortBy;switch(conditionSortBy){case Asc.ESortBy.sortbyCellColor:{sortVal=Asc.c_oAscSortOptions.ByColorFill;sortColor=sortCondition.dxf&&sortCondition.dxf.fill?sortCondition.dxf.fill.bg():null;break}case Asc.ESortBy.sortbyFontColor:{sortVal=Asc.c_oAscSortOptions.ByColorFont;sortColor=sortCondition.dxf&&sortCondition.dxf.font? sortCondition.dxf.font.getColor():null;break}default:{if(sortCondition.ConditionDescending)sortVal=Asc.c_oAscSortOptions.Descending;else sortVal=Asc.c_oAscSortOptions.Ascending;break}}}}}var ascColor=null;if(null!==sortColor){ascColor=new Asc.asc_CColor;ascColor.asc_putR(sortColor.getR());ascColor.asc_putG(sortColor.getG());ascColor.asc_putB(sortColor.getB());ascColor.asc_putA(sortColor.getA())}var autoFilterObject=new Asc.AutoFiltersOptions;autoFilterObject.asc_setSortState(sortVal);autoFilterObject.asc_setCellCoord(cellCoord); autoFilterObject.asc_setCellId(cellId);autoFilterObject.asc_setValues(values);autoFilterObject.asc_setFilterObj(filterObj);autoFilterObject.asc_setAutomaticRowCount(automaticRowCount);autoFilterObject.asc_setDiplayName(displayName);autoFilterObject.asc_setSortColor(ascColor);autoFilterObject.asc_setColumnName(columnName);autoFilterObject.asc_setSheetColumnName(AscCommon.g_oCellAddressUtils.colnumToColstr(rangeButton.c1+1));var columnRange=new Asc.Range(colId+autoFilter.Ref.c1,autoFilter.Ref.r1+1, colId+autoFilter.Ref.c1,autoFilter.Ref.r2);var filterTypes=this.model.getRowColColors(columnRange);autoFilterObject.asc_setIsTextFilter(filterTypes.text);autoFilterObject.asc_setColorsFill(filterTypes.colors);autoFilterObject.asc_setColorsFont(filterTypes.fontColors);if(isReturnProps)return autoFilterObject;else this.handlers.trigger("setAutoFiltersDialog",autoFilterObject)};WorksheetView.prototype.af_changeSelectionTablePart=function(activeRange){var t=this;var tableParts=t.model.TableParts;var _changeSelectionToAllTablePart= function(){var tablePart;for(var i=0;i<tableParts.length;i++){tablePart=tableParts[i];if(tablePart.Ref.intersection(activeRange)){if(t.model.autoFilters._activeRangeContainsTablePart(activeRange,tablePart.Ref)){var newActiveRange=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r1,tablePart.Ref.c2,tablePart.Ref.r2);t.setSelection(newActiveRange)}break}}};var _changeSelectionFromCellToColumn=function(){if(tableParts&&tableParts.length&&activeRange.isOneCell())for(var i=0;i<tableParts.length;i++)if(tableParts[i].HeaderRowCount!== 0&&tableParts[i].Ref.containsRange(activeRange)&&tableParts[i].Ref.r1===activeRange.r1){var newActiveRange=new Asc.Range(activeRange.c1,activeRange.r1,activeRange.c1,tableParts[i].Ref.r2);if(!activeRange.isEqual(newActiveRange))t.setSelection(newActiveRange);break}};if(activeRange.isOneCell())_changeSelectionFromCellToColumn(activeRange);else _changeSelectionToAllTablePart(activeRange)};WorksheetView.prototype.af_isCheckMoveRange=function(arnFrom,arnTo,opt_wsTo){var ws=this.model;var tableParts=ws.TableParts; var tablePart;var checkMoveRangeIntoApplyAutoFilter=function(arnTo){if(ws.AutoFilter&&ws.AutoFilter.Ref&&arnTo.intersection(ws.AutoFilter.Ref)&&!arnFrom.isEqual(ws.AutoFilter.Ref))if(ws.autoFilters._searchHiddenRowsByFilter(ws.AutoFilter,arnTo))return false;return true};var counterIntersection=0;var counterContains=0;for(var i=0;i<tableParts.length;i++){tablePart=tableParts[i];if(tablePart.Ref.intersection(arnFrom))if(arnFrom.containsRange(tablePart.Ref))counterContains++;else counterIntersection++}if(counterIntersection> 0&&counterContains>0||counterIntersection>1){ws.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);return false}if(!opt_wsTo&&!checkMoveRangeIntoApplyAutoFilter(arnTo)){ws.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterMoveToHiddenRangeError,c_oAscError.Level.NoCritical);return false}return true};WorksheetView.prototype.changeTableSelection=function(tableName,optionType,opt_row,opt_col){var t=this;var ws=this.model;var tablePart= ws.autoFilters._getFilterByDisplayName(tableName);if(!tablePart||tablePart&&!tablePart.Ref)return false;var refTablePart=tablePart.Ref;var lastSelection=this.model.selectionRange.getLast();var startCol=undefined!==opt_col?opt_col:lastSelection.c1;var endCol=undefined!==opt_col?opt_col:lastSelection.c2;var startRow=undefined!==opt_row?opt_row:lastSelection.r1;var endRow=undefined!==opt_row?opt_row:lastSelection.r2;var rangeWithoutHeaderFooter;switch(optionType){case c_oAscChangeSelectionFormatTable.all:{startCol= refTablePart.c1;endCol=refTablePart.c2;startRow=refTablePart.r1;endRow=refTablePart.r2;break}case c_oAscChangeSelectionFormatTable.data:{rangeWithoutHeaderFooter=tablePart.getRangeWithoutHeaderFooter();if(undefined===opt_row){startCol=lastSelection.c1<refTablePart.c1?refTablePart.c1:lastSelection.c1;endCol=lastSelection.c2>refTablePart.c2?refTablePart.c2:lastSelection.c2}else{startCol=rangeWithoutHeaderFooter.c1;endCol=rangeWithoutHeaderFooter.c2}startRow=rangeWithoutHeaderFooter.r1;endRow=rangeWithoutHeaderFooter.r2; if(undefined!==opt_row)if(lastSelection.isEqual(rangeWithoutHeaderFooter)){startRow=refTablePart.r1;endRow=refTablePart.r2}else if(lastSelection.isEqual(refTablePart))startRow=rangeWithoutHeaderFooter.r1;break}case c_oAscChangeSelectionFormatTable.row:{startCol=refTablePart.c1;endCol=refTablePart.c2;if(undefined===opt_row){startRow=lastSelection.r1<refTablePart.r1?refTablePart.r1:lastSelection.r1;endRow=lastSelection.r2>refTablePart.r2?refTablePart.r2:lastSelection.r2}break}case c_oAscChangeSelectionFormatTable.column:{if(undefined=== opt_col){startCol=lastSelection.c1<refTablePart.c1?refTablePart.c1:lastSelection.c1;endCol=lastSelection.c2>refTablePart.c2?refTablePart.c2:lastSelection.c2}startRow=refTablePart.r1;endRow=refTablePart.r2;break}case c_oAscChangeSelectionFormatTable.dataColumn:{rangeWithoutHeaderFooter=tablePart.getRangeWithoutHeaderFooter();startRow=rangeWithoutHeaderFooter.r1;endRow=rangeWithoutHeaderFooter.r2;if(undefined!==opt_row)if(lastSelection.c1===startCol&&lastSelection.c2===endCol)if(lastSelection.r1=== rangeWithoutHeaderFooter.r1&&lastSelection.r2===rangeWithoutHeaderFooter.r2){startRow=refTablePart.r1;endRow=refTablePart.r2}else{if(lastSelection.r1===refTablePart.r1&&lastSelection.r2===refTablePart.r2)startRow=rangeWithoutHeaderFooter.r1}else if(lastSelection.isEqual(refTablePart))startRow=rangeWithoutHeaderFooter.r1;break}}t._endSelectionShape();t.setSelection(new Asc.Range(startCol,startRow,endCol,endRow))};WorksheetView.prototype.af_changeFormatTableInfo=function(tableName,optionType,val){var tablePart= this.model.autoFilters._getFilterByDisplayName(tableName);var t=this;var ar=this.model.selectionRange.getLast();if(!tablePart||tablePart&&!tablePart.TableStyleInfo)return false;if(!window["AscCommonExcel"].filteringMode)return false;var isChangeTableInfo=this.af_checkChangeTableInfo(tablePart,optionType);if(isChangeTableInfo!==false){var lockRange=isChangeTableInfo.lockRange?isChangeTableInfo.lockRange:null;var updateRange=isChangeTableInfo.updateRange;var callback=function(isSuccess){if(false=== isSuccess){t.handlers.trigger("selectionChanged");return}History.Create_NewPoint();History.StartTransaction();var newTableRef=t.model.autoFilters.changeFormatTableInfo(tableName,optionType,val);if(newTableRef.r1>ar.r1||newTableRef.r2<ar.r2){var startRow=newTableRef.r1>ar.r1?newTableRef.r1:ar.r1;var endRow=newTableRef.r2<ar.r2?newTableRef.r2:ar.r2;var newActiveRange=new Asc.Range(ar.c1,startRow,ar.c2,endRow);t.setSelection(newActiveRange);History.SetSelectionRedo(newActiveRange)}History.EndTransaction(); t._onUpdateFormatTable(updateRange)};lockRange=lockRange?lockRange:t.af_getLockRangeTableInfo(tablePart,optionType,val);if(lockRange)t._isLockedCells(lockRange,null,callback);else callback()}};WorksheetView.prototype.af_checkChangeTableInfo=function(table,optionType){var res=table.Ref;var t=this;var ws=this.model,range;var lockRange=null;var sendError=function(){ws.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);t.handlers.trigger("selectionChanged")}; var checkShift=function(range){var result=false;if(!t.model.autoFilters._isPartTablePartsUnderRange(range)&&!t.model.autoFilters.isPartFilterUnderRange(range)){result=true;var downRange=Asc.Range(range.c1,range.r2+1,range.c2,gc_nMaxRow0);var mergedRange=ws.getMergedByRange(downRange);if(mergedRange&&mergedRange.all)for(var i=0;i<mergedRange.all.length;i++)if(mergedRange.all[i]&&mergedRange.all[i].bbox)if(mergedRange.all[i].bbox.intersection(mergedRange)&&!mergedRange.all[i].bbox.containsRange(mergedRange)){result= false;break}}return result};switch(optionType){case c_oAscChangeTableStyleInfo.rowHeader:{if(!table.isHeaderRow()){range=Asc.Range(table.Ref.c1,table.Ref.r1-1,table.Ref.c2,table.Ref.r1-1);if(!this.model.autoFilters._isEmptyRange(range,0))if(!checkShift(table.Ref)){sendError();res=false}else{lockRange=Asc.Range(table.Ref.c1,table.Ref.r1-1,table.Ref.c2,gc_nMaxRow0);res=table.Ref}}break}case c_oAscChangeTableStyleInfo.rowTotal:{range=new Asc.Range(table.Ref.c1,table.Ref.r2+1,table.Ref.c2,table.Ref.r2+ 1);if(table.isTotalsRow()){if(checkShift(table.Ref)){lockRange=Asc.Range(table.Ref.c1,table.Ref.r2-1,table.Ref.c2,gc_nMaxRow0);res=table.Ref}}else if(checkShift(table.Ref)){lockRange=Asc.Range(table.Ref.c1,table.Ref.r2+1,table.Ref.c2,gc_nMaxRow0);res=Asc.Range(table.Ref.c1,table.Ref.r1,table.Ref.c2,table.Ref.r2+1)}else if(!this.model.autoFilters._isEmptyRange(range,0)){sendError();res=false}break}}return res?{updateRange:res,lockRange:lockRange}:res};WorksheetView.prototype.af_getLockRangeTableInfo= function(tablePart,optionType,val){var res=null;switch(optionType){case c_oAscChangeTableStyleInfo.columnBanded:case c_oAscChangeTableStyleInfo.columnFirst:case c_oAscChangeTableStyleInfo.columnLast:case c_oAscChangeTableStyleInfo.rowBanded:case c_oAscChangeTableStyleInfo.filterButton:{res=tablePart.Ref;break}case c_oAscChangeTableStyleInfo.rowTotal:{if(val===false)res=tablePart.Ref;else{var rangeUpTable=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r2+1,tablePart.Ref.c2,tablePart.Ref.r2+1);if(this.model.autoFilters._isEmptyRange(rangeUpTable, 0)&&this.model.autoFilters.searchRangeInTableParts(rangeUpTable)===-1)res=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r1,tablePart.Ref.c2,tablePart.Ref.r2+1);else res=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r2+1,tablePart.Ref.c2,gc_nMaxRow0)}break}case c_oAscChangeTableStyleInfo.rowHeader:{if(val===false)res=tablePart.Ref;else{var rangeUpTable=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r1-1,tablePart.Ref.c2,tablePart.Ref.r1-1);if(this.model.autoFilters._isEmptyRange(rangeUpTable,0)&&this.model.autoFilters.searchRangeInTableParts(rangeUpTable)=== -1)res=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r1-1,tablePart.Ref.c2,tablePart.Ref.r2);else res=new Asc.Range(tablePart.Ref.c1,tablePart.Ref.r1-1,tablePart.Ref.c2,gc_nMaxRow0)}break}}return res};WorksheetView.prototype.af_insertCellsInTable=function(tableName,optionType){var t=this;var ws=this.model;var tablePart=ws.autoFilters._getFilterByDisplayName(tableName);if(!tablePart||tablePart&&!tablePart.Ref)return false;var insertCellsAndShiftDownRight=function(arn,displayName,type){var range=t.model.getRange3(arn.r1, arn.c1,arn.r2,arn.c2);var isCheckChangeAutoFilter=t.af_checkInsDelCells(arn,type,"insCell",true);if(isCheckChangeAutoFilter===false)return;var callback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();var shiftCells=type===c_oAscInsertOptions.InsertCellsAndShiftRight?range.addCellsShiftRight(displayName):range.addCellsShiftBottom(displayName);var deferredHistoryAction=t.model.autoFilters.deferredHistoryAction;if(deferredHistoryAction){History.Add(AscCommonExcel.g_oUndoRedoAutoFilters, deferredHistoryAction._type,t.model.getId(),t.model.selectionRange.getLast().clone(),deferredHistoryAction);t.model.autoFilters.deferredHistoryAction=null}History.EndTransaction();if(shiftCells){t.cellCommentator.updateCommentsDependencies(true,type,arn);t.model.shiftDataValidation(true,type,arn,true);t.objectRender.updateDrawingObject(true,type,arn);t._onUpdateFormatTable(range)}};var r2=type===c_oAscInsertOptions.InsertCellsAndShiftRight?tablePart.Ref.r2:gc_nMaxRow0;var c2=type!==c_oAscInsertOptions.InsertCellsAndShiftRight? tablePart.Ref.c2:gc_nMaxCol0;var changedRange=new asc_Range(tablePart.Ref.c1,tablePart.Ref.r1,c2,r2);t._isLockedCells(changedRange,null,callback)};var newActiveRange=this.model.selectionRange.getLast().clone();var displayName=undefined;var type=null;var totalRow=tablePart.isTotalsRow();switch(optionType){case c_oAscInsertOptions.InsertTableRowAbove:{newActiveRange.c1=tablePart.Ref.c1;newActiveRange.c2=tablePart.Ref.c2;type=c_oAscInsertOptions.InsertCellsAndShiftDown;break}case c_oAscInsertOptions.InsertTableRowBelow:{newActiveRange.c1= tablePart.Ref.c1;newActiveRange.c2=tablePart.Ref.c2;newActiveRange.r1=totalRow?tablePart.Ref.r2:tablePart.Ref.r2+1;newActiveRange.r2=totalRow?tablePart.Ref.r2:tablePart.Ref.r2+1;if(!totalRow)displayName=tableName;type=c_oAscInsertOptions.InsertCellsAndShiftDown;break}case c_oAscInsertOptions.InsertTableColLeft:{newActiveRange.r1=tablePart.Ref.r1;newActiveRange.r2=tablePart.Ref.r2;type=c_oAscInsertOptions.InsertCellsAndShiftRight;break}case c_oAscInsertOptions.InsertTableColRight:{newActiveRange.c1= tablePart.Ref.c2+1;newActiveRange.c2=tablePart.Ref.c2+1;newActiveRange.r1=tablePart.Ref.r1;newActiveRange.r2=tablePart.Ref.r2;displayName=tableName;type=c_oAscInsertOptions.InsertCellsAndShiftRight;break}}insertCellsAndShiftDownRight(newActiveRange,displayName,type)};WorksheetView.prototype.af_deleteCellsInTable=function(tableName,optionType){var t=this;var ws=this.model;var tablePart=ws.autoFilters._getFilterByDisplayName(tableName);if(!tablePart||tablePart&&!tablePart.Ref)return false;var deleteCellsAndShiftLeftTop= function(arn,type){var isCheckChangeAutoFilter=t.af_checkInsDelCells(arn,type,"delCell",true);if(isCheckChangeAutoFilter===false)return;var callback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();if(isCheckChangeAutoFilter===true)t.model.autoFilters.isEmptyAutoFilters(arn,type);var preDeleteAction=function(){t.cellCommentator.updateCommentsDependencies(false,type,arn);t.model.shiftDataValidation(false,type,arn,true)};var res;var range;if(type=== c_oAscDeleteOptions.DeleteCellsAndShiftLeft){range=t.model.getRange3(arn.r1,arn.c1,arn.r2,arn.c2);res=range.deleteCellsShiftLeft(preDeleteAction)}else{arn=t.model.autoFilters.checkDeleteAllRowsFormatTable(arn,true);range=t.model.getRange3(arn.r1,arn.c1,arn.r2,arn.c2);res=range.deleteCellsShiftUp(preDeleteAction)}History.EndTransaction();if(res){t.objectRender.updateDrawingObject(true,type,arn);t._onUpdateFormatTable(range);t._updateSlicers(arn)}};var r2=type===c_oAscDeleteOptions.DeleteCellsAndShiftLeft? tablePart.Ref.r2:gc_nMaxRow0;var c2=type!==c_oAscDeleteOptions.DeleteCellsAndShiftLeft?tablePart.Ref.c2:gc_nMaxCol0;var changedRange=new asc_Range(tablePart.Ref.c1,tablePart.Ref.r1,c2,r2);t._isLockedCells(changedRange,null,callback)};var deleteTableCallback=function(ref){if(!window["AscCommonExcel"].filteringMode)return false;var callback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();t.model.autoFilters.isEmptyAutoFilters(ref);var cleanRange= t.model.getRange3(ref.r1,ref.c1,ref.r2,ref.c2);cleanRange.cleanAll();t.cellCommentator.deleteCommentsRange(cleanRange.bbox);History.EndTransaction();t._onUpdateFormatTable(ref)};t._isLockedCells(ref,null,callback)};var newActiveRange=this.model.selectionRange.getLast().clone();var val=null;switch(optionType){case c_oAscDeleteOptions.DeleteColumns:{newActiveRange.r1=tablePart.Ref.r1;newActiveRange.r2=tablePart.Ref.r2;val=c_oAscDeleteOptions.DeleteCellsAndShiftLeft;break}case c_oAscDeleteOptions.DeleteRows:{newActiveRange.c1= tablePart.Ref.c1;newActiveRange.c2=tablePart.Ref.c2;val=c_oAscDeleteOptions.DeleteCellsAndShiftTop;break}case c_oAscDeleteOptions.DeleteTable:{deleteTableCallback(tablePart.Ref.clone());break}}if(val!==null)deleteCellsAndShiftLeftTop(newActiveRange,val)};WorksheetView.prototype.af_changeDisplayNameTable=function(tableName,newName){this.model.autoFilters.changeDisplayNameTable(tableName,newName)};WorksheetView.prototype.af_checkInsDelCells=function(activeRange,val,prop,isFromFormatTable){var ws=this.model; var res=true;var filterError;if(!window["AscCommonExcel"].filteringMode)if(val===c_oAscInsertOptions.InsertCellsAndShiftRight||val===c_oAscInsertOptions.InsertColumns)return false;else if(val===c_oAscDeleteOptions.DeleteCellsAndShiftLeft||val===c_oAscDeleteOptions.DeleteColumns)return false;var intersectionTableParts=ws.autoFilters.getTablesIntersectionRange(activeRange);var isPartTablePartsUnderRange=ws.autoFilters._isPartTablePartsUnderRange(activeRange);var isPartTablePartsRightRange=ws.autoFilters.isPartTablePartsRightRange(activeRange); var isOneTableIntersection=intersectionTableParts&&intersectionTableParts.length===1?intersectionTableParts[0]:null;var isPartFilterUnderRange=ws.autoFilters.isPartFilterUnderRange(activeRange,true);var isPartFilterRightRange=ws.autoFilters.isPartFilterRightRange(activeRange,true);var isPartTablePartsByRowCol=ws.autoFilters._isPartTablePartsByRowCol(activeRange);var allTablesInside=true;if(intersectionTableParts&&intersectionTableParts.length)for(var i=0;i<intersectionTableParts.length;i++)if(intersectionTableParts[i]&& intersectionTableParts[i].Ref&&!activeRange.containsRange(intersectionTableParts[i].Ref)){allTablesInside=false;break}var checkInsCells=function(){switch(val){case c_oAscInsertOptions.InsertCellsAndShiftDown:{if(isFromFormatTable)if(isPartTablePartsUnderRange)res=false;else{if(isOneTableIntersection!==null&&!(isOneTableIntersection.Ref.c1===activeRange.c1&&isOneTableIntersection.Ref.c2===activeRange.c2))res=false}else if(isPartTablePartsUnderRange)res=false;else if(isPartTablePartsByRowCol&&isPartTablePartsByRowCol.cols)res= false;if(res&&isPartFilterUnderRange){res=false;filterError=true}break}case c_oAscInsertOptions.InsertCellsAndShiftRight:{if(isFromFormatTable){if(isPartTablePartsRightRange)res=false}else if(isPartTablePartsRightRange)res=false;else if(isPartTablePartsByRowCol&&isPartTablePartsByRowCol.rows)res=false;if(res&&isPartFilterRightRange){res=false;filterError=true}break}case c_oAscInsertOptions.InsertColumns:{break}case c_oAscInsertOptions.InsertRows:{break}}};var checkDelCells=function(){switch(val){case c_oAscDeleteOptions.DeleteCellsAndShiftTop:{if(isFromFormatTable){if(isPartTablePartsUnderRange)res= false}else if(isPartTablePartsUnderRange)res=false;else if(!allTablesInside)res=false;if(res&&isPartFilterUnderRange){res=false;filterError=true}break}case c_oAscDeleteOptions.DeleteCellsAndShiftLeft:{if(isFromFormatTable){if(isPartTablePartsRightRange)res=false}else if(isPartTablePartsRightRange)res=false;else if(!allTablesInside)res=false;if(res&&isPartFilterRightRange){res=false;filterError=true}break}case c_oAscDeleteOptions.DeleteColumns:{break}case c_oAscDeleteOptions.DeleteRows:{break}}};prop=== "insCell"?checkInsCells():checkDelCells();if(res===false)if(filterError)ws.workbook.handlers.trigger("asc_onError",c_oAscError.ID.ChangeFilteredRangeError,c_oAscError.Level.NoCritical);else ws.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterChangeFormatTableError,c_oAscError.Level.NoCritical);return res};WorksheetView.prototype.af_setDisableProps=function(tablePart,formatTableInfo){var selectionRange=this.model.selectionRange;var lastRange=selectionRange.getLast();var activeCell= selectionRange.activeCell;if(!tablePart)return false;var refTable=tablePart.Ref;var refTableContainsActiveRange=selectionRange.isSingleRange()&&refTable.containsRange(lastRange);formatTableInfo.isInsertRowBelow=refTableContainsActiveRange&&(tablePart.TotalsRowCount===null&&activeCell.row===refTable.r2||tablePart.TotalsRowCount!==null&&activeCell.row===refTable.r2-1);formatTableInfo.isInsertColumnRight=refTableContainsActiveRange&&activeCell.col===refTable.c2;formatTableInfo.isInsertColumnLeft=refTableContainsActiveRange; formatTableInfo.isInsertRowAbove=refTableContainsActiveRange&&(lastRange.r1>refTable.r1&&tablePart.HeaderRowCount===null||lastRange.r1>=refTable.r1&&tablePart.HeaderRowCount!==null);var dataRange=tablePart.getRangeWithoutHeaderFooter();if(refTable.r1===lastRange.r1&&refTable.r2===lastRange.r2)formatTableInfo.isDeleteRow=true;else if((tablePart.isHeaderRow()||tablePart.isTotalsRow())&&dataRange.r1===dataRange.r2&&lastRange.r1===lastRange.r2&&dataRange.r1===lastRange.r1)formatTableInfo.isDeleteRow= false;else formatTableInfo.isDeleteRow=refTableContainsActiveRange&&!(lastRange.r1<=refTable.r1&&lastRange.r2>=refTable.r1&&null===tablePart.HeaderRowCount);formatTableInfo.isDeleteColumn=true;formatTableInfo.isDeleteTable=true;if(!window["AscCommonExcel"].filteringMode){formatTableInfo.isDeleteColumn=false;formatTableInfo.isInsertColumnRight=false;formatTableInfo.isInsertColumnLeft=false}};WorksheetView.prototype.af_convertTableToRange=function(tableName){var t=this;if(!window["AscCommonExcel"].filteringMode)return; var callback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();t.model.autoFilters.convertTableToRange(tableName);History.EndTransaction();t._onUpdateFormatTable(lockRange)};var table=t.model.autoFilters._getFilterByDisplayName(tableName);var lockRange=null!==table?table.Ref:null;var callBackLockedDefNames=function(isSuccess){if(false===isSuccess)return;t._isLockedCells(lockRange,null,callback)};var defNameId=t.model.workbook.dependencyFormulas.getDefNameByName(tableName, t.model.getId());defNameId=defNameId?defNameId.getNodeId():null;t._isLockedDefNames(callBackLockedDefNames,defNameId)};WorksheetView.prototype.af_changeTableRange=function(tableName,range,callbackAfterChange,doNotUpdate){var t=this;if(typeof range==="string")range=AscCommonExcel.g_oRangeCache.getAscRange(range);if(!window["AscCommonExcel"].filteringMode)return;var callback=function(isSuccess){if(false===isSuccess){if(callbackAfterChange)callbackAfterChange(isSuccess);return}History.Create_NewPoint(); History.StartTransaction();t.model.autoFilters.changeTableRange(tableName,range);History.EndTransaction();if(!doNotUpdate)t._onUpdateFormatTable(range);if(callbackAfterChange)callbackAfterChange(true)};var table=t.model.autoFilters._getFilterByDisplayName(tableName);var tableRange=null!==table?table.Ref:null;var lockRange=range;if(null!==tableRange){var r1=tableRange.r1<range.r1?tableRange.r1:range.r1;var r2=tableRange.r2>range.r2?tableRange.r2:range.r2;var c1=tableRange.c1<range.c1?tableRange.c1: range.c1;var c2=tableRange.c2>range.c2?tableRange.c2:range.c2;lockRange=new Asc.Range(c1,r1,c2,r2)}var callBackLockedDefNames=function(isSuccess){if(false===isSuccess){if(callbackAfterChange)callbackAfterChange(isSuccess);return}var callbackLockAll=function(_success){if(false===_success){if(callbackAfterChange)callbackAfterChange(_success);return}t._isLockedCells(lockRange,null,callback)};t._isLockedAll(callbackLockAll)};var defNameId=t.model.workbook.dependencyFormulas.getDefNameByName(tableName, t.model.getId());defNameId=defNameId?defNameId.getNodeId():null;t._isLockedDefNames(callBackLockedDefNames,defNameId)};WorksheetView.prototype.af_checkChangeRange=function(range){var res=null;var intersectionTables=this.model.autoFilters.getTablesIntersectionRange(range);var merged;if(intersectionTables.length>0){var tablePart=intersectionTables[0];if(range.r1===range.r2)res=c_oAscError.ID.FTChangeTableRangeError;else if(range.r1!==tablePart.Ref.r1)res=c_oAscError.ID.FTChangeTableRangeError;else if(intersectionTables.length!== 1)res=c_oAscError.ID.FTRangeIncludedOtherTables;else if(this.model.AutoFilter&&this.model.AutoFilter.Ref&&this.model.AutoFilter.Ref.isIntersect(range))res=c_oAscError.ID.FTChangeTableRangeError;else if((merged=this.model.getMergedByRange(range))&&merged.all&&merged.all.length!==0)res=c_oAscError.ID.FTChangeTableRangeError;else if(this.intersectionFormulaArray(range,true,true))res=c_oAscError.ID.MultiCellsInTablesFormulaArray}else res=c_oAscError.ID.FTChangeTableRangeError;return res};WorksheetView.prototype.checkMoveFormulaArray= function(from,to,ctrlKey,opt_wsTo){var res=true;if(!ctrlKey)res=!this.intersectionFormulaArray(from);var ws=opt_wsTo?opt_wsTo:this;if(res&&to)res=!ws.intersectionFormulaArray(to);return res};WorksheetView.prototype.intersectionFormulaArray=function(range,notCheckContains,checkOneCellArray){var res=false;this.model.getRange3(range.r1,range.c1,range.r2,range.c2)._foreachNoEmpty(function(cell){if(cell.isFormula()){var formulaParsed=cell.getFormulaParsed();var arrayFormulaRef=formulaParsed.getArrayFormulaRef(); if(arrayFormulaRef&&(!checkOneCellArray||checkOneCellArray&&!arrayFormulaRef.isOneCell()))if(notCheckContains)res=true;else if(!notCheckContains&&!range.containsRange(arrayFormulaRef))res=true}});return res};WorksheetView.prototype.ConvertXYToLogic=function(x,y){var c=this.visibleRange.c1,cFrozen,widthDiff;var r=this.visibleRange.r1,rFrozen,heightDiff;if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0();widthDiff=this._getColLeft(cFrozen)-this._getColLeft(0);if(x<this.cellsLeft+widthDiff&& 0!==widthDiff)c=0;rFrozen=this.topLeftFrozenCell.getRow0();heightDiff=this._getRowTop(rFrozen)-this._getRowTop(0);if(y<this.cellsTop+heightDiff&&0!==heightDiff)r=0}x+=this._getColLeft(c)-this.cellsLeft-this.cellsLeft;y+=this._getRowTop(r)-this.cellsTop-this.cellsTop;x*=asc_getcvt(0,3,this._getPPIX());y*=asc_getcvt(0,3,this._getPPIY());return{X:x,Y:y}};WorksheetView.prototype.ConvertLogicToXY=function(xL,yL){xL*=asc_getcvt(3,0,this._getPPIX());yL*=asc_getcvt(3,0,this._getPPIY());var c=this.visibleRange.c1, cFrozen,widthDiff=0;var r=this.visibleRange.r1,rFrozen,heightDiff=0;if(this.topLeftFrozenCell){cFrozen=this.topLeftFrozenCell.getCol0();widthDiff=this._getColLeft(cFrozen)-this._getColLeft(0);if(xL<widthDiff&&0!==widthDiff){c=0;widthDiff=0}rFrozen=this.topLeftFrozenCell.getRow0();heightDiff=this._getRowTop(rFrozen)-this._getRowTop(0);if(yL<heightDiff&&0!==heightDiff){r=0;heightDiff=0}}xL-=this._getColLeft(c)-widthDiff-this.cellsLeft-this.cellsLeft;yL-=this._getRowTop(r)-heightDiff-this.cellsTop-this.cellsTop; return{X:xL,Y:yL}};WorksheetView.prototype.changeDocSize=function(width,height){var t=this;var pageOptions=t.model.PagePrintOptions;var onChangeDocSize=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();pageOptions.pageSetup.asc_setWidth(width);pageOptions.pageSetup.asc_setHeight(height);History.EndTransaction();t.recalcPrintScale();t.changeViewPrintLines(true);if(t.viewPrintLines)t.updateSelection();window["Asc"]["editor"]._onUpdateLayoutMenu(t.model.Id)}; return this._isLockedLayoutOptions(onChangeDocSize)};WorksheetView.prototype.changePageOrient=function(orientation){var pageOptions=this.model.PagePrintOptions;var t=this;var callback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();pageOptions.pageSetup.asc_setOrientation(orientation);History.EndTransaction();t.recalcPrintScale();t.changeViewPrintLines(true);if(t.viewPrintLines)t.updateSelection();window["Asc"]["editor"]._onUpdateLayoutMenu(t.model.Id)}; return this._isLockedLayoutOptions(callback)};WorksheetView.prototype.changePageMargins=function(left,right,top,bottom){var t=this;var pageOptions=t.model.PagePrintOptions;var pageMargins=pageOptions.asc_getPageMargins();var callback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();pageMargins.asc_setLeft(left);pageMargins.asc_setRight(right);pageMargins.asc_setTop(top);pageMargins.asc_setBottom(bottom);History.EndTransaction();t.recalcPrintScale(); t.changeViewPrintLines(true);if(t.viewPrintLines)t.updateSelection();window["Asc"]["editor"]._onUpdateLayoutMenu(t.model.Id)};return this._isLockedLayoutOptions(callback)};WorksheetView.prototype.setPageOption=function(callback,val){var t=this;var onChangeDocSize=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();callback(val);t.recalcPrintScale();t.changeViewPrintLines(true);History.EndTransaction();if(t.viewPrintLines)t.updateSelection()};return this._isLockedLayoutOptions(onChangeDocSize)}; WorksheetView.prototype.setPageOptions=function(obj){var t=this;var viewMode=!this.workbook.canEdit();if(!obj)return;var onChangeDocSize=function(isSuccess){if(false===isSuccess)return;t.savePageOptions(obj,viewMode);t.recalcPrintScale();t.changeViewPrintLines(true);if(t.viewPrintLines)t.updateSelection()};return viewMode?onChangeDocSize(true):this._isLockedLayoutOptions(onChangeDocSize)};WorksheetView.prototype.savePageOptions=function(obj,viewMode){var pageOptions=this.model.PagePrintOptions;if(viewMode)History.TurnOff(); History.Create_NewPoint();History.StartTransaction();var pageSetupModel=pageOptions.asc_getPageSetup();var oldFitToWidth=pageSetupModel.asc_getFitToWidth();var oldFitToHeight=pageSetupModel.asc_getFitToHeight();var pageSetupObj=obj.asc_getPageSetup();var newFitToWidth=pageSetupObj.asc_getFitToWidth();var newFitToHeight=pageSetupObj.asc_getFitToHeight();if(oldFitToWidth!=newFitToWidth||oldFitToHeight!=newFitToHeight)this.fitToWidthHeight(newFitToWidth,newFitToHeight);if(newFitToWidth===0&&newFitToHeight=== 0)pageOptions.asc_getPageSetup().asc_setScale(pageSetupObj.asc_getScale());pageOptions.asc_setOptions(obj);this._changePrintTitles(obj.printTitlesWidth,obj.printTitlesHeight);this.recalcPrintScale();this.changeViewPrintLines(true);History.EndTransaction();if(viewMode)History.TurnOn();if(this.viewPrintLines)this.updateSelection()};WorksheetView.prototype.changePrintArea=function(type){var t=this;var wb=window["Asc"]["editor"].wb;var callback=function(isSuccess){if(false===isSuccess)return;var getRangesStr= function(ranges,oldStr){var str=oldStr?oldStr:"";var selectionLast=t.model.selectionRange.getLast();var mc=selectionLast.isOneCell()?t.model.getMergedByCell(selectionLast.r1,selectionLast.c1):null;for(var i=0;i<ranges.length;i++){if(i===0&&str!=="")str+=",";AscCommonExcel.executeInR1C1Mode(false,function(){str+=parserHelp.get3DRef(t.model.getName(),(mc||ranges[i]).getAbsName())});if(i!==ranges.length-1)str+=","}return str};var printArea=t.model.workbook.getDefinesNames("Print_Area",t.model.getId()); if(printArea&&printArea.sheetId!==t.model.getId())printArea=null;var oldDefName,oldScope,newRef,newDefName,oldRef;switch(type){case Asc.c_oAscChangePrintAreaType.set:{oldDefName=printArea?printArea.getAscCDefName():null;oldScope=oldDefName?oldDefName.asc_getScope():t.model.index;newRef=getRangesStr(t.model.selectionRange.ranges);newDefName=new Asc.asc_CDefName("Print_Area",newRef,oldScope,null,null,null,true);t.changeViewPrintLines(true);wb.editDefinedNames(oldDefName,newDefName);break}case Asc.c_oAscChangePrintAreaType.clear:{if(printArea)wb.delDefinedNames(printArea.getAscCDefName()); break}case Asc.c_oAscChangePrintAreaType.add:{oldDefName=printArea?printArea.getAscCDefName():null;if(oldDefName){oldScope=oldDefName?oldDefName.asc_getScope():t.model.index;oldRef=oldDefName.asc_getRef();newRef=getRangesStr(t.model.selectionRange.ranges,oldRef);newDefName=new Asc.asc_CDefName("Print_Area",newRef,oldScope,null,null,null,true);t.recalcPrintScale();t.changeViewPrintLines(true);wb.editDefinedNames(oldDefName,newDefName)}break}}};return callback()};WorksheetView.prototype.canAddPrintArea= function(){var res=false,t=this;var printArea=this.model.workbook.getDefinesNames("Print_Area",this.model.getId());if(printArea&&printArea.sheetId===this.model.getId()){var selection=this.model.selectionRange.ranges;var areaRefsArr;AscCommonExcel.executeInR1C1Mode(false,function(){areaRefsArr=AscCommonExcel.getRangeByRef(printArea.ref,t.model,true,true,true)});if(areaRefsArr&&areaRefsArr.length){res=true;for(var i=0;i<areaRefsArr.length;i++){var range=areaRefsArr[i];if(range&&range.bbox)range=range.bbox; else return false;for(var j=0;j<selection.length;j++)if(selection[j].intersection(range))return false}}}return res};WorksheetView.prototype.changePrintTitles=function(cols,rows){var t=this;var onChangePrintTitles=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();t._changePrintTitles(cols,rows);t.changeViewPrintLines(true);if(t.viewPrintLines)t.updateSelection();window["Asc"]["editor"]._onUpdateLayoutMenu(t.model.Id);History.EndTransaction()};this._isLockedLayoutOptions(onChangePrintTitles)}; WorksheetView.prototype.getPrintTitlesRange=function(prop,byCol){var res=null;var t=this;switch(prop){case Asc.c_oAscPrintTitlesRangeType.first:{if(byCol)res=new Asc.Range(0,0,0,gc_nMaxRow0);else res=new Asc.Range(0,0,gc_nMaxCol0,0);break}case Asc.c_oAscPrintTitlesRangeType.frozen:{if(this.topLeftFrozenCell)if(byCol){var cFrozen=this.topLeftFrozenCell.getCol0();res=new Asc.Range(0,0,cFrozen,gc_nMaxRow0)}else{var rFrozen=this.topLeftFrozenCell.getRow0();res=new Asc.Range(0,0,gc_nMaxCol0,rFrozen)}break}case Asc.c_oAscPrintTitlesRangeType.current:{var printTitles= this.model.workbook.getDefinesNames("Print_Titles",this.model.getId());var c1,c2,r1,r2;if(printTitles){var printTitleRefs;AscCommonExcel.executeInR1C1Mode(false,function(){printTitleRefs=AscCommonExcel.getRangeByRef(printTitles.ref,t.model,true,true)});if(printTitleRefs&&printTitleRefs.length)for(var i=0;i<printTitleRefs.length;i++){var bbox=printTitleRefs[i].bbox;if(bbox)if(c_oAscSelectionType.RangeCol===bbox.getType()){c1=bbox.c1;c2=bbox.c2}else if(c_oAscSelectionType.RangeRow===bbox.getType()){r1= bbox.r1;r2=bbox.r2}}}if(byCol&&c1!==undefined)res=new Asc.Range(c1,0,c2,gc_nMaxRow0);else if(r1!==undefined&&!byCol)res=new Asc.Range(0,r1,gc_nMaxCol0,r2);break}}return res?res.getAbsName():null};WorksheetView.prototype._changePrintTitles=function(cols,rows){var t=this;var _convertRangeStr=function(_val,_byCols){var _res;AscCommonExcel.executeInR1C1Mode(AscCommonExcel.g_R1C1Mode,function(){_res=AscCommonExcel.g_oRangeCache.getAscRange(_val)});_res=_byCols?new Asc.Range(_res.c1,0,_res.c2,gc_nMaxRow0): new Asc.Range(0,_res.r1,gc_nMaxCol0,_res.r2);AscCommonExcel.executeInR1C1Mode(false,function(){_res=parserHelp.get3DRef(t.model.getName(),_res.getAbsName())});return _res};History.Create_NewPoint();History.StartTransaction();var printTitles=this.model.workbook.getDefinesNames("Print_Titles",this.model.getId());var oldDefName=printTitles?printTitles.getAscCDefName():null;var oldScope=oldDefName?oldDefName.asc_getScope():this.model.index;var newRef;if(cols)newRef=_convertRangeStr(cols,true);if(rows)newRef= (newRef?newRef+",":"")+_convertRangeStr(rows);if(!newRef){if(printTitles)this.workbook.delDefinedNames(printTitles.getAscCDefName())}else{var newDefName=new Asc.asc_CDefName("Print_Titles",newRef,oldScope,null,null,null,true);this.workbook.editDefinedNames(oldDefName,newDefName)}History.EndTransaction()};WorksheetView.prototype.changeViewPrintLines=function(val){this.viewPrintLines=val};WorksheetView.prototype.getRangeText=function(range,delimiter){var t=this;if(range===undefined)range=this.model.selectionRange.getLast(); if(delimiter===undefined)delimiter="\n";var firstDefCell;var res="";var bImptyText=true;var maxRow=Math.min(range.r2,t.rows.length-1);this.model.getRange3(range.r1,range.c1,maxRow,range.c2)._foreach2(function(cell,r,c){if(cell!==null){var text=cell.getValueForEdit();text=text.split(/\r?\n/)[0];if(text!==""){res+=text;bImptyText=false}firstDefCell=true}if(r!==maxRow&&firstDefCell)res+=delimiter});return bImptyText?"":res};WorksheetView.prototype._updateGroups=function(bCol,start,end,bUpdateOnlyRowLevelMap, bUpdateOnlyRange){if(bCol)if(bUpdateOnlyRowLevelMap);else{this.arrColGroups=this.getGroupDataArray(bCol,start,end);var oldGroupHeight=this.groupHeight;this.groupHeight=this.getGroupCommonWidth(this.getGroupCommonLevel(bCol),bCol);if(oldGroupHeight!==this.groupHeight)this._calcHeaderRowHeight()}else if(bUpdateOnlyRowLevelMap);else{this.arrRowGroups=this.getGroupDataArray(bCol,start,end);this.groupWidth=this.getGroupCommonWidth(this.getGroupCommonLevel())}};WorksheetView.prototype._updateGroupsWidth= function(){this.groupHeight=this.getGroupCommonWidth(this.getGroupCommonLevel(true),true);this.groupWidth=this.getGroupCommonWidth(this.getGroupCommonLevel())};WorksheetView.prototype.getGroupDataArray=function(bCol,start,end,bUpdateOnlyRowLevelMap,bUpdateOnlyRange){if(start===undefined){start=0;end=bCol?gc_nMaxCol:gc_nMaxRow}var res=null;var up=true,down=true;var fProcess=function(val){var outLineLevel=val?val.getOutlineLevel():null;if(bUpdateOnlyRowLevelMap)return;var continueRange=function(level, index){var tempNeedPush=true;if(!res[level]||undefined===res[level][index])return true;if(val.index===res[level][index].start-1){res[level][index].start--;tempNeedPush=false}else if(val.index===res[level][index].end+1){res[level][index].end++;tempNeedPush=false}else if(val.index>=res[level][index].start&&val.index<=res[level][index].end)tempNeedPush=false;return tempNeedPush};if(!outLineLevel)if(start===val.index)up=false;else{if(end===val.index)down=false}else{if(!res)res=[];if(!res[outLineLevel])res[outLineLevel]= [];var needPush=true;for(var j=0;j<res[outLineLevel].length;j++)if(!continueRange(outLineLevel,j)){needPush=false;break}if(needPush)res[outLineLevel].push({start:val.index,end:val.index});for(var n=1;n<outLineLevel;n++){var bAdd=false;if(!res[n]){bAdd=true;if(res[outLineLevel])res[n]=[{start:res[outLineLevel][res[outLineLevel].length-1].start,end:res[outLineLevel][res[outLineLevel].length-1].end}];else res[n]=[]}var bContinue=false;for(var m=0;m<res[n].length;m++)if(!continueRange(n,m))bContinue= true;if(!bContinue&&!bAdd)res[n].push({start:res[outLineLevel][res[outLineLevel].length-1].start,end:res[outLineLevel][res[outLineLevel].length-1].end})}}};var _allProps=bCol?this.model.oAllCol:null;var allOutLineLevel=_allProps?_allProps.getOutlineLevel():0;if(!allOutLineLevel);if(allOutLineLevel){if(!res)res=[];if(!res[allOutLineLevel])res[allOutLineLevel]=[];res[allOutLineLevel].push({start:0,end:bCol?gc_nMaxCol0:gc_nMaxRow0})}if(bCol)this.model.getRange3(0,start,0,end)._foreachColNoEmpty(fProcess); else this.model.getRange3(start,0,end,0)._foreachRowNoEmpty(fProcess);if(!bUpdateOnlyRange){while(up){start--;if(start<0)break;bCol?fProcess(this.model._getColNoEmptyWithAll(start)):this.model._getRowNoEmptyWithAll(start,fProcess)}var maxCount=bCol?this.model.getColsCount():this.model.getRowsCount();var cMaxCount=bCol?gc_nMaxCol0:gc_nMaxRow0;while(down){end++;if(end>maxCount||end>cMaxCount)break;bCol?fProcess(this.model._getColNoEmptyWithAll(start)):this.model._getRowNoEmptyWithAll(start,fProcess)}}var groupArr, index,i,j;if(res){groupArr=bCol?this.arrColGroups:this.arrRowGroups;groupArr=groupArr?groupArr.groupArr:null;if(groupArr)for(i=0;i<groupArr.length;i++)if(groupArr[i])for(j=0;j<groupArr[i].length;j++)index=groupArr[i][j].end}groupArr=res;if(!groupArr){groupArr=bCol?this.arrColGroups:this.arrRowGroups;groupArr=groupArr?groupArr.groupArr:null}return{groupArr:res}};WorksheetView.prototype._drawGroupData=function(drawingCtx,range,leftFieldInPx,topFieldInPx,bCol){var t=this;if(!range)range=this.visibleRange; this._drawGroupDataMenu(drawingCtx,bCol);var ctx=drawingCtx||this.drawingCtx;var offsetX=undefined!==leftFieldInPx?leftFieldInPx:this._getColLeft(this.visibleRange.c1)-this.cellsLeft;var offsetY=undefined!==topFieldInPx?topFieldInPx:this._getRowTop(this.visibleRange.r1)-this.cellsTop;if(!drawingCtx&&this.topLeftFrozenCell){if(undefined===leftFieldInPx){var cFrozen=this.topLeftFrozenCell.getCol0();offsetX-=this._getColLeft(cFrozen)-this._getColLeft(0)}if(undefined===topFieldInPx){var rFrozen=this.topLeftFrozenCell.getRow0(); offsetY-=this._getRowTop(rFrozen)-this._getRowTop(0)}}var zoom=this.getZoom();if(zoom>1)zoom=1;var st=this.settings.header.style[kHeaderDefault];var x1,y1,x2,y2,arrayLines,groupData;var lineWidth=AscCommon.AscBrowser.convertToRetinaValue(2,true);var thickLineDiff=AscCommon.AscBrowser.isRetina?.5:0;var tempButtonMap=[];var bFirstLine=true;var _buttonSize=this._getGroupButtonSize();var buttonSize=AscCommon.AscBrowser.convertToRetinaValue(_buttonSize,true);var padding=AscCommon.AscBrowser.convertToRetinaValue(1, true);var buttons=[];var endPosArr={};var i,j,l,index,diff,startPos,endPos,paddingTop,pointLevel;if(bCol){y1=0;x1=this._getColLeft(range.c1)-offsetX;x2=this._getColLeft(range.c2+1)-offsetX;y2=this.groupHeight;ctx.setFillStyle(st.background).fillRect(x1,y1,x2-x1,y2-y1);ctx.setStrokeStyle(this.settings.cells.defaultState.border).setLineWidth(1).beginPath();ctx.lineHorPrevPx(x1,y2,x2);ctx.stroke();groupData=this.arrColGroups?this.arrColGroups:this.getGroupDataArray(true,range.r1,range.r2);if(!groupData|| !groupData.groupArr)return;arrayLines=groupData.groupArr;ctx.setStrokeStyle(new CColor(0,0,0)).setLineWidth(lineWidth).beginPath();var _summaryRight=this.model.sheetPr?this.model.sheetPr.SummaryRight:true;var minCol;var maxCol;var startX,endX,widthNextRow,collasedEndRow;for(i=0;i<arrayLines.length;i++)if(arrayLines[i]){index=bFirstLine?1:i;var posY=padding*2+buttonSize/2-padding+(index-1)*buttonSize;for(j=0;j<arrayLines[i].length;j++)if(_summaryRight){if(endPosArr[arrayLines[i][j].end])continue;endPosArr[arrayLines[i][j].end]= 1;startX=Math.max(arrayLines[i][j].start,range.c1);endX=Math.min(arrayLines[i][j].end+1,range.c2+1);minCol=minCol===undefined||minCol>startX?startX:minCol;maxCol=maxCol===undefined||maxCol<endX?endX:maxCol;diff=startX===arrayLines[i][j].start?AscCommon.AscBrowser.convertToRetinaValue(3,true):0;startPos=this._getColLeft(startX)+diff-offsetX;endPos=this._getColLeft(endX)-offsetX;widthNextRow=this._getColLeft(endX+1)-this._getColLeft(endX);paddingTop=(widthNextRow-buttonSize)/2;if(paddingTop<0)paddingTop= 0;if(endX===arrayLines[i][j].end+1)if(widthNextRow&&endX>=startX){if(!tempButtonMap[i])tempButtonMap[i]=[];tempButtonMap[i][endX]=1;buttons.push({r:endX,level:i})}if(startPos>endPos)continue;collasedEndRow=this._getGroupCollapsed(arrayLines[i][j].end+1,bCol);if(!collasedEndRow)ctx.lineHorPrevPx(startPos,posY,endPos+paddingTop);if(!collasedEndRow&&startX===arrayLines[i][j].start)ctx.lineVerPrevPx(startPos,posY-2*padding+thickLineDiff,posY+4*padding)}else{if(endPosArr[arrayLines[i][j].start])continue; endPosArr[arrayLines[i][j].start]=1;startX=Math.max(arrayLines[i][j].start-1,range.c1);endX=Math.min(arrayLines[i][j].end+1,range.c2+1);minCol=minCol===undefined||minCol>startX?startX:minCol;maxCol=maxCol===undefined||maxCol<endX?endX:maxCol;diff=0;startPos=this._getColLeft(startX)+diff-offsetX;endPos=this._getColLeft(endX)-offsetX;widthNextRow=this._getColLeft(startX+1)-this._getColLeft(startX);paddingTop=startX===arrayLines[i][j].start-1?(widthNextRow+buttonSize)/2:0;if(paddingTop<0)paddingTop= 0;if(startX===arrayLines[i][j].start-1)if(widthNextRow&&endX>=startX){if(!tempButtonMap[i])tempButtonMap[i]=[];tempButtonMap[i][startX]=1;buttons.push({r:startX,level:i})}if(startPos>endPos)continue;collasedEndRow=this._getGroupCollapsed(arrayLines[i][j].start-1,bCol);if(endPos>startPos+paddingTop-1*padding){if(!collasedEndRow&&endPos>startPos+paddingTop-1*padding)ctx.lineHorPrevPx(startPos+paddingTop-1*padding,posY,endPos);if(!collasedEndRow&&endX===arrayLines[i][j].end+1&&endPos>startPos+paddingTop- 1*padding)ctx.lineVerPrevPx(endPos,posY-2*padding+thickLineDiff,posY+4*padding)}}bFirstLine=false}for(l=minCol;l<maxCol;l++){pointLevel=this._getGroupLevel(l,bCol);var colWidth=this._getColLeft(l+1)-this._getColLeft(l);if(pointLevel===0||tempButtonMap[pointLevel+1]&&tempButtonMap[pointLevel+1][l]||colWidth===0)continue;ctx.lineVerPrevPx(this._getColLeft(l)-offsetX+colWidth/2,7*padding+pointLevel*buttonSize,7*padding+pointLevel*buttonSize+2*padding)}ctx.stroke();ctx.closePath()}else{x1=0;y1=this._getRowTop(range.r1)- offsetY;x2=this.groupWidth;y2=this._getRowTop(range.r2+1)-offsetY;ctx.setFillStyle(st.background).fillRect(x1,y1,x2-x1,y2-y1);ctx.setStrokeStyle(this.settings.cells.defaultState.border).setLineWidth(1).beginPath();ctx.lineVerPrevPx(x2,y1,y2);ctx.stroke();groupData=this.arrRowGroups?this.arrRowGroups:this.getGroupDataArray(null,range.r1,range.r2);if(!groupData||!groupData.groupArr)return;arrayLines=groupData.groupArr;ctx.setStrokeStyle(new CColor(0,0,0)).setLineWidth(lineWidth).beginPath();var checkPrevHideLevel= function(level,row){var res=false;for(var n=level-1;n>=0;n--)if(arrayLines[n])for(var m=0;m<arrayLines[n].length;m++)if(row>=arrayLines[n][m].start&&row<=arrayLines[n][m].end&&t._getGroupCollapsed(arrayLines[n][m].start-1)){res=true;break}return res};var _summaryBelow=this.model.sheetPr?this.model.sheetPr.SummaryBelow:true;var minRow;var maxRow;var startY,endY,heightNextRow;for(i=0;i<arrayLines.length;i++)if(arrayLines[i]){index=bFirstLine?1:i;var posX=padding*2+buttonSize/2-padding+(index-1)*buttonSize; for(j=0;j<arrayLines[i].length;j++)if(_summaryBelow){if(endPosArr[arrayLines[i][j].end])continue;endPosArr[arrayLines[i][j].end]=1;startY=Math.max(arrayLines[i][j].start,range.r1);endY=Math.min(arrayLines[i][j].end+1,range.r2+1);minRow=minRow===undefined||minRow>startY?startY:minRow;maxRow=maxRow===undefined||maxRow<endY?endY:maxRow;diff=startY===arrayLines[i][j].start?3*padding:0;startPos=this._getRowTop(startY)+diff-offsetY;endPos=this._getRowTop(endY)-offsetY;heightNextRow=this._getRowHeight(endY); paddingTop=(heightNextRow-buttonSize)/2;if(paddingTop<0)paddingTop=0;if(endY===arrayLines[i][j].end+1)if(heightNextRow&&endY>=startY){if(!tempButtonMap[i])tempButtonMap[i]=[];tempButtonMap[i][endY]=1;buttons.push({r:endY,level:i})}if(startPos>endPos)continue;var collasedEndCol=this._getGroupCollapsed(arrayLines[i][j].end+1);if(!collasedEndCol)ctx.lineVerPrevPx(posX,startPos,endPos+paddingTop);if(!collasedEndCol&&startY===arrayLines[i][j].start)ctx.lineHorPrevPx(posX-lineWidth+thickLineDiff,startPos, posX+4*padding)}else{if(endPosArr[arrayLines[i][j].start])continue;endPosArr[arrayLines[i][j].start]=1;startY=Math.max(arrayLines[i][j].start-1,range.r1);endY=Math.min(arrayLines[i][j].end+1,range.r2+1);minRow=minRow===undefined||minRow>startY?startY:minRow;maxRow=maxRow===undefined||maxRow<endY?endY:maxRow;diff=0;startPos=(startY===arrayLines[i][j].start-1?this._getRowTop(startY+1):this._getRowTop(startY))+diff-offsetY;endPos=this._getRowTop(endY)-offsetY;heightNextRow=this._getRowHeight(startY); paddingTop=startY===arrayLines[i][j].start-1?(heightNextRow-buttonSize)/2:0;if(paddingTop<0)paddingTop=0;if(startY===arrayLines[i][j].start-1)if(heightNextRow&&endY>=startY){if(!tempButtonMap[i])tempButtonMap[i]=[];tempButtonMap[i][startY]=1;buttons.push({r:startY,level:i})}if(startPos>endPos)continue;if(endPos>startPos-paddingTop-1*padding){var collapsedStartRow=this._getGroupCollapsed(arrayLines[i][j].start-1);var hiddenStartRow=this._getHidden(arrayLines[i][j].start);if(!collapsedStartRow&&!hiddenStartRow)ctx.lineVerPrevPx(posX, startPos-paddingTop-1*padding,endPos);if(!collapsedStartRow&&!hiddenStartRow&&endY===arrayLines[i][j].end+1&&!checkPrevHideLevel(i,arrayLines[i][j].start))ctx.lineHorPrevPx(posX-lineWidth+thickLineDiff,endPos,posX+4*padding)}}bFirstLine=false}for(l=minRow;l<maxRow;l++){pointLevel=this._getGroupLevel(l,bCol);var rowHeight=this._getRowHeight(l);if(pointLevel===0||tempButtonMap[pointLevel+1]&&tempButtonMap[pointLevel+1][l]||rowHeight===0)continue;ctx.lineHorPrevPx(padding*7+pointLevel*buttonSize,this._getRowTop(l)- offsetY+rowHeight/2,padding*7+pointLevel*buttonSize+padding*2)}ctx.stroke();ctx.closePath()}this._drawGroupDataButtons(drawingCtx,buttons,leftFieldInPx,topFieldInPx,bCol)};WorksheetView.prototype._drawGroupDataButtons=function(drawingCtx,buttons,leftFieldInPx,topFieldInPx,bCol){if(!buttons)return;var groupData=bCol?this.arrColGroups:this.arrRowGroups;if(!groupData||!groupData.groupArr)return;var ctx=drawingCtx||this.drawingCtx;var offsetX=0,offsetY=0;if(bCol){offsetX=undefined!==leftFieldInPx?leftFieldInPx: this._getColLeft(this.visibleRange.c1)-this.cellsLeft;if(!drawingCtx&&this.topLeftFrozenCell)if(undefined===leftFieldInPx){var cFrozen=this.topLeftFrozenCell.getCol0();offsetX-=this._getColLeft(cFrozen)-this._getColLeft(0)}}else{offsetY=undefined!==topFieldInPx?topFieldInPx:this._getRowTop(this.visibleRange.r1)-this.cellsTop;if(!drawingCtx&&this.topLeftFrozenCell)if(undefined===topFieldInPx){var rFrozen=this.topLeftFrozenCell.getRow0();offsetY-=this._getRowTop(rFrozen)-this._getRowTop(0)}}var i,val, level,diff,pos,x,y,w,h,active;var borderSize=AscCommon.AscBrowser.convertToRetinaValue(1,true);ctx.setStrokeStyle(new CColor(0,0,0)).setLineWidth(borderSize).beginPath();for(i=0;i<buttons.length;i++){val=buttons[i].r;level=buttons[i].level;pos=this._getGroupDataButtonPos(val,level,bCol);x=pos.x;y=pos.y;w=pos.w;h=pos.h;x=x-offsetX;y=y-offsetY;ctx.AddClipRect(bCol?pos.pos-borderSize-offsetX:x-borderSize,bCol?y-borderSize:pos.pos-borderSize-offsetY,bCol?pos.size+borderSize:w+borderSize,bCol?h+borderSize: pos.size+borderSize);ctx.beginPath();if(buttons[i].clean)ctx.clearRect(x,y,w,h);ctx.lineHorPrevPx(x,y,x+w);ctx.lineHorPrevPx(x+w,y+h,x);ctx.lineVerPrevPx(x+w,y,y+h);ctx.lineVerPrevPx(x,y+h,y-borderSize);ctx.stroke();ctx.RemoveClipRect()}ctx.closePath();ctx.setStrokeStyle(new CColor(0,0,0)).setLineWidth(AscCommon.AscBrowser.convertToRetinaValue(2,true)).beginPath();var sizeLine=AscCommon.AscBrowser.convertToRetinaValue(8,true);diff=AscCommon.AscBrowser.convertToRetinaValue(1,true);for(i=0;i<buttons.length;i++){val= buttons[i].r;level=buttons[i].level;active=buttons[i].active;diff=active?1:0;pos=this._getGroupDataButtonPos(val,level,bCol);x=pos.x;y=pos.y;w=pos.w;h=pos.h;x=x-offsetX;y=y-offsetY;ctx.AddClipRect(bCol?pos.pos-offsetX:x,bCol?y:pos.pos-offsetY,bCol?pos.size:w,bCol?h:pos.size);ctx.beginPath();var paddingLine=Math.floor((w-sizeLine)/2);if(w>sizeLine+2)if(this._getGroupCollapsed(val,bCol)){ctx.lineHorPrevPx(x+paddingLine,y+h/2+1,x+sizeLine+paddingLine);ctx.lineVerPrevPx(x+paddingLine+sizeLine/2+1,y+h/ 2-sizeLine/2,y+h/2+sizeLine/2)}else ctx.lineHorPrevPx(x+paddingLine,y+h/2+diff,x+sizeLine+paddingLine);ctx.stroke();ctx.RemoveClipRect()}ctx.closePath()};WorksheetView.prototype._getGroupDataButtonPos=function(val,level,bCol){var zoom=this.getZoom();if(zoom>1)zoom=1;var _buttonSize=this._getGroupButtonSize();var buttonSize=AscCommon.AscBrowser.convertToRetinaValue(_buttonSize,true);var padding=AscCommon.AscBrowser.convertToRetinaValue(1,true);if(bCol){var endPosX=this._getColLeft(val);var colW=this._getColLeft(val+ 1)-this._getColLeft(val);var posY=padding*2+buttonSize/2-padding+(level-1)*buttonSize;x=endPosX+colW/2-buttonSize/2;y=posY-Math.floor(6*zoom)*padding}else{var endPosY=this._getRowTop(val);var rowH=this._getRowHeight(val);var posX=padding*2+buttonSize/2-padding+(level-1)*buttonSize;var x=posX-Math.floor(6*zoom)*padding;var y=endPosY+rowH/2-buttonSize/2}var w=buttonSize-1;var h=buttonSize-1;return{x:x,y:y,w:w,h:h,size:bCol?colW:rowH,pos:bCol?endPosX:endPosY}};WorksheetView.prototype._getGroupLevel= function(index,bCol){var res;var fProcess=function(val){res=val?val.getOutlineLevel():0};bCol?fProcess(this.model._getColNoEmptyWithAll(index)):this.model._getRowNoEmptyWithAll(index,fProcess);return res};WorksheetView.prototype._getGroupCollapsed=function(index,bCol){var res;var getCollapsed=function(val){res=val?val.getCollapsed():false};bCol?getCollapsed(this.model._getColNoEmptyWithAll(index)):this.model._getRowNoEmptyWithAll(index,getCollapsed);return res};WorksheetView.prototype._getHidden= function(index,bCol){var res;var callback=function(val){res=val?val.getHidden():false};bCol?callback(this.model._getColNoEmptyWithAll(index)):this.model._getRowNoEmptyWithAll(index,callback);return res};WorksheetView.prototype._drawGroupDataMenu=function(drawingCtx,bCol){var ctx=drawingCtx||this.drawingCtx;var groupData;if(bCol)groupData=this.arrColGroups?this.arrColGroups:null;else groupData=this.arrRowGroups?this.arrRowGroups:null;if(!groupData||!groupData.groupArr)return;var st=this.settings.header.style[kHeaderDefault]; var x1,y1,x2,y2;if(bCol){x1=this.headersLeft;y1=0;x2=this.headersLeft+this.headersWidth;y2=this.groupHeight}else{x1=0;y1=this.headersTop;x2=this.groupWidth;y2=this.headersTop+this.headersHeight}ctx.setFillStyle(st.background).fillRect(x1,y1,x2-x1,y2-y1);ctx.setFillStyle(st.background).fillRect(0,0,this.headersLeft,this.headersTop);ctx.setStrokeStyle(this.settings.cells.defaultState.border).setLineWidth(1).beginPath();ctx.lineHorPrevPx(x1,y2,x2);ctx.lineVerPrevPx(x2,y1,y2);ctx.lineHorPrevPx(0,this.headersTop, this.headersLeft);ctx.lineVerPrevPx(this.headersLeft,0,this.headersTop);ctx.stroke();ctx.closePath();if(false===this.model.getSheetView().asc_getShowRowColHeaders())return;if(groupData.groupArr.length){for(var i=0;i<groupData.groupArr.length;i++)this._drawGroupDataMenuButton(ctx,i,null,null,bCol);ctx.stroke();ctx.closePath()}};WorksheetView.prototype._drawGroupDataMenuButton=function(drawingCtx,level,bActive,bClean,bCol){var ctx=drawingCtx||this.drawingCtx;var st=this.settings.header.style[kHeaderDefault]; var props=this.getGroupDataMenuButPos(level,bCol);var x=props.x;var y=props.y;var w=props.w;var h=props.h;if(bClean)this.drawingCtx.clearRect(x,y,w,h);ctx.beginPath();ctx.setStrokeStyle(this.settings.cells.defaultState.border).setLineWidth(AscCommon.AscBrowser.convertToRetinaValue(1,true)).beginPath();ctx.lineHorPrevPx(x,y,x+w);ctx.lineVerPrevPx(x+w,y,y+h);ctx.lineHorPrevPx(x+w,y+h,x);ctx.lineVerPrevPx(x,y+h,y-AscCommon.AscBrowser.convertToRetinaValue(1,true));var text=level+1+"";var sr=this.stringRender; var zoom=1;var factor=asc.round(zoom*1E3)/1E3;var dc=sr.drawingCtx;var oldPpiX=dc.ppiX;var oldPpiY=dc.ppiY;var oldScaleFactor=dc.scaleFactor;dc.ppiX=asc.round(dc.ppiX/dc.scaleFactor*factor*1E3)/1E3;dc.ppiY=asc.round(dc.ppiY/dc.scaleFactor*factor*1E3)/1E3;dc.scaleFactor=factor;var tm=this._roundTextMetrics(sr.measureString(text));dc.ppiX=oldPpiX;dc.ppiY=oldPpiY;dc.scaleFactor=oldScaleFactor;if(w>tm.width+3){var diff=bActive?1:0;ctx.setFillStyle(st.color).fillText(text,x+w/2-tm.width/2+diff,y+Asc.round(tm.baseline)+ h/2-tm.height/2+diff,undefined,sr.charWidths)}ctx.stroke();ctx.closePath()};WorksheetView.prototype.getGroupDataMenuButPos=function(level,bCol){var zoom=this.getZoom();if(zoom>1)zoom=1;var _buttonSize=this._getGroupButtonSize();var padding=AscCommon.AscBrowser.convertToRetinaValue(1,true);var buttonSize=AscCommon.AscBrowser.convertToRetinaValue(_buttonSize,true)-padding;var x,y;if(bCol){x=this.headersLeft+this.headersWidth/2-buttonSize/2;y=padding*2+level*(buttonSize+padding)}else{x=padding*2+level* (buttonSize+padding);y=this.headersTop+this.headersHeight/2-buttonSize/2}return{x:x,y:y,w:buttonSize,h:buttonSize}};WorksheetView.prototype.getGroupCommonLevel=function(bCol){var res=0;var func=function(elem){var outLineLevel=elem.getOutlineLevel();if(outLineLevel&&outLineLevel>res)res=outLineLevel};if(bCol)this.model.getRange3(0,0,0,gc_nMaxCol0)._foreachColNoEmpty(func);else this.model.getRange3(0,0,gc_nMaxRow0,0)._foreachRowNoEmpty(func);return res};WorksheetView.prototype.getGroupCommonWidth=function(level, bCol){var zoom=this.getZoom();if(zoom>1)zoom=1;var res=0;if(level>0){var padding=2;var _buttonSize=this._getGroupButtonSize();res=padding*2+_buttonSize+_buttonSize*level}return AscCommon.AscBrowser.convertToRetinaValue(res,true)};WorksheetView.prototype._getGroupButtonSize=function(){var zoom=this.getZoom();if(zoom>1)zoom=1;var numDigit=Math.max(AscCommonExcel.calcDecades(this.visibleRange.r2+1),3);var nCharCount=this.model.charCountToModelColWidth(numDigit);var headersWidth=Asc.round(this.model.modelColWidthToColWidth(nCharCount)* zoom);var headersHeight=Asc.round(this.headersHeightByFont*zoom);return Math.min(Math.floor(16*zoom),headersWidth-1,headersHeight-1)};WorksheetView.prototype.groupRowClick=function(x,y,target,type){if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;var currentSheetId=this.model.getId();var nLockAllType=this.collaborativeEditing.isLockAllOther(currentSheetId);if(Asc.c_oAscMouseMoveLockedObjectType.Sheet===nLockAllType||Asc.c_oAscMouseMoveLockedObjectType.TableProperties=== nLockAllType)return;var t=this;var bCol=c_oTargetType.GroupCol===target.target;var offsetX=this._getColLeft(this.visibleRange.c1)-this.cellsLeft;if(this.topLeftFrozenCell){var cFrozen=this.topLeftFrozenCell.getCol0();offsetX-=this._getColLeft(cFrozen)-this._getColLeft(0)}var offsetY=this._getRowTop(this.visibleRange.r1)-this.cellsTop;if(this.topLeftFrozenCell){var rFrozen=this.topLeftFrozenCell.getRow0();offsetY-=this._getRowTop(rFrozen)-this._getRowTop(0)}if("mousemove"===type)if(t.clickedGroupButton){var props; bCol=t.clickedGroupButton.bCol;if(bCol)offsetY=0;else offsetX=0;if(undefined!==t.clickedGroupButton.r){props=t._getGroupDataButtonPos(t.clickedGroupButton.r,t.clickedGroupButton.level,bCol);if(props)if(x>=props.x-offsetX&&x<=props.x+props.w-offsetX&&y>=props.y-offsetY&&y<=props.y-offsetY+props.h)return true;else{t._drawGroupDataButtons(null,[{r:t.clickedGroupButton.r,level:t.clickedGroupButton.level,active:false,clean:true}],undefined,undefined,bCol);t.clickedGroupButton=null;return false}}else{props= this.getGroupDataMenuButPos(t.clickedGroupButton.level,bCol);if(x>=props.x&&y>=props.y&&x<=props.x+props.w&&y<=props.y+props.h)return true;else{this._drawGroupDataMenuButton(null,t.clickedGroupButton.level,false,true,bCol);t.clickedGroupButton=null;return false}}}if(target.row<0&&!bCol||target.col<0&&bCol)return this._groupRowMenuClick(x,y,target,type,bCol);if(bCol)offsetY=0;else offsetX=0;var _summaryRight=this.model.sheetPr?this.model.sheetPr.SummaryRight:true;var _summaryBelow=this.model.sheetPr? this.model.sheetPr.SummaryBelow:true;var mouseDownClick;var doClick=function(){var arrayLines=bCol?t.arrColGroups.groupArr:t.arrRowGroups.groupArr;var endPosArr={};for(var i=0;i<arrayLines.length;i++){var props,collapsed;if(arrayLines[i])for(var j=0;j<arrayLines[i].length;j++)if(!bCol&&!_summaryBelow||bCol&&!_summaryRight){if(endPosArr[arrayLines[i][j].start])continue;endPosArr[arrayLines[i][j].start]=1;if(arrayLines[i][j].start-1===target.row&&!bCol||arrayLines[i][j].start-1===target.col&&bCol){props= t._getGroupDataButtonPos(arrayLines[i][j].start-1,i,bCol);collapsed=t._getGroupCollapsed(arrayLines[i][j].start-1,bCol);if(props)if(x>=props.x-offsetX&&x<=props.x+props.w-offsetX&&y>=props.y-offsetY&&y<=props.y-offsetY+props.h){if("mouseup"===type){t._tryChangeGroup(arrayLines[i][j],collapsed,i,bCol);t.clickedGroupButton=null}else if("mousedown"===type){t._drawGroupDataButtons(null,[{r:arrayLines[i][j].start-1,level:i,active:true,clean:true}],undefined,undefined,bCol);t.clickedGroupButton={level:i, r:arrayLines[i][j].start-1,bCol:bCol};mouseDownClick=true}return}}}else{if(endPosArr[arrayLines[i][j].end])continue;endPosArr[arrayLines[i][j].end]=1;if(arrayLines[i][j].end+1===target.row&&!bCol||arrayLines[i][j].end+1===target.col&&bCol){props=t._getGroupDataButtonPos(arrayLines[i][j].end+1,i,bCol);collapsed=t._getGroupCollapsed(arrayLines[i][j].end+1,bCol);if(props)if(x>=props.x-offsetX&&x<=props.x+props.w-offsetX&&y>=props.y-offsetY&&y<=props.y-offsetY+props.h){if("mouseup"===type){t._tryChangeGroup(arrayLines[i][j], collapsed,i,bCol);t.clickedGroupButton=null}else if("mousedown"===type){t._drawGroupDataButtons(null,[{r:arrayLines[i][j].end+1,level:i,active:true,clean:true}],undefined,undefined,bCol);t.clickedGroupButton={level:i,r:arrayLines[i][j].end+1,bCol:bCol};mouseDownClick=true}return}}}}};var prevOutlineLevel=null;var outLineLevel;var func=function(val){if(prevOutlineLevel===null)prevOutlineLevel=val.getOutlineLevel();else outLineLevel=val.getOutlineLevel()};if(bCol)if(_summaryRight)this.model.getRange3(0, target.col-1,0,target.col)._foreachColNoEmpty(func);else this.model.getRange3(0,target.col,0,target.col+1)._foreachColNoEmpty(func);else if(_summaryBelow)this.model.getRange3(target.row-1,0,target.row,0)._foreachRowNoEmpty(func);else this.model.getRange3(target.row,0,target.row+1,0)._foreachRowNoEmpty(func);if(outLineLevel!==prevOutlineLevel)doClick();if(mouseDownClick)return true};WorksheetView.prototype._groupRowMenuClick=function(x,y,target,type,bCol){if(this.collaborativeEditing.getGlobalLock()|| !window["Asc"]["editor"].canEdit())return;var currentSheetId=this.model.getId();var nLockAllType=this.collaborativeEditing.isLockAllOther(currentSheetId);if(Asc.c_oAscMouseMoveLockedObjectType.Sheet===nLockAllType||Asc.c_oAscMouseMoveLockedObjectType.TableProperties===nLockAllType)return;var bButtonClick=!bCol&&x<=this.cellsLeft&&this.groupWidth&&x<this.groupWidth&&y<this.cellsTop;if(!bButtonClick)bButtonClick=bCol&&y<=this.cellsTop&&this.groupHeight&&y<this.groupHeight&&x<this.cellsLeft;if(bButtonClick){var groupArr; if(bCol)groupArr=this.arrColGroups?this.arrColGroups.groupArr:null;else groupArr=this.arrRowGroups?this.arrRowGroups.groupArr:null;if(!groupArr)return;var props;for(var i=0;i<=groupArr.length;i++){props=this.getGroupDataMenuButPos(i,bCol);if(x>=props.x&&y>=props.y&&x<=props.x+props.w&&y<=props.y+props.h){if("mouseup"===type){this.hideGroupLevel(i+1,bCol);this.clickedGroupButton=null}else if("mousedown"===type){this._drawGroupDataMenuButton(null,i,true,true,bCol);this.clickedGroupButton={level:i,bCol:bCol}; return true}break}}}};WorksheetView.prototype._tryChangeGroup=function(pos,collapsed,level,bCol){if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;var viewMode=this.handlers.trigger("getViewMode");var start=pos.start;var end=pos.end;var t=this;var functionModelAction=null;var onChangeWorksheetCallback=function(isSuccess){if(false===isSuccess)return;if(viewMode)History.TurnOff();asc_applyFunction(functionModelAction);if(viewMode)History.TurnOn();if(bCol)t._updateAfterChangeGroup(undefined, null,true);else t._updateAfterChangeGroup(null,null,true)};functionModelAction=function(){var _summaryBelow=t.model.sheetPr?t.model.sheetPr.SummaryBelow:true;var _summaryRight=t.model.sheetPr?t.model.sheetPr.SummaryRight:true;var isNeedRecal=!bCol?t.model.needRecalFormulas(start,end):null;if(isNeedRecal)t.model.workbook.dependencyFormulas.lockRecal();History.Create_NewPoint();History.StartTransaction();var oldExcludeCollapsed=t.model.bExcludeCollapsed;t.model.bExcludeCollapsed=true;var changeModelFunc= bCol?t.model.setColHidden:t.model.setRowHidden;var collapsedFunction=bCol?t.model.setCollapsedCol:t.model.setCollapsedRow;if(!collapsed){changeModelFunc.call(t.model,true,start,end);if(!_summaryBelow&&!bCol||!_summaryRight&&bCol)collapsedFunction.call(t.model,!collapsed,start-1);else collapsedFunction.call(t.model,!collapsed,end+1)}else{changeModelFunc.call(t.model,false,start,end);if(!_summaryBelow&&!bCol||!_summaryRight&&bCol)collapsedFunction.call(t.model,!collapsed,start-1);else collapsedFunction.call(t.model, !collapsed,end+1);var groupArr;if(bCol)groupArr=t.arrColGroups?t.arrColGroups.groupArr:null;else groupArr=t.arrRowGroups?t.arrRowGroups.groupArr:null;if(groupArr)for(var i=level+1;i<=groupArr.length;i++){if(!groupArr[i])continue;for(var j=0;j<groupArr[i].length;j++)if(!_summaryBelow&&!bCol||!_summaryRight&&bCol){if(groupArr[i][j]&&groupArr[i][j].start>start&&groupArr[i][j].end<=end)if(t._getGroupCollapsed(groupArr[i][j].start-1,bCol))changeModelFunc.call(t.model,true,groupArr[i][j].start,groupArr[i][j].end)}else if(groupArr[i][j]&& groupArr[i][j].start>=start&&groupArr[i][j].end<end)if(t._getGroupCollapsed(groupArr[i][j].end+1,bCol))changeModelFunc.call(t.model,true,groupArr[i][j].start,groupArr[i][j].end)}}t.model.bExcludeCollapsed=oldExcludeCollapsed;History.EndTransaction();if(isNeedRecal)t.model.workbook.dependencyFormulas.unlockRecal()};if(viewMode)onChangeWorksheetCallback();else this._isLockedAll(onChangeWorksheetCallback)};WorksheetView.prototype.hideGroupLevel=function(level,bCol){var viewMode=this.handlers.trigger("getViewMode"); var t=this,groupArr;if(bCol)groupArr=this.arrColGroups?this.arrColGroups.groupArr:null;else groupArr=this.arrRowGroups?this.arrRowGroups.groupArr:null;if(!groupArr)return;if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;var onChangeWorksheetCallback=function(isSuccess){if(false===isSuccess)return;if(viewMode)History.TurnOff();asc_applyFunction(callback);if(viewMode)History.TurnOn();if(bCol)t._updateAfterChangeGroup(undefined,null,true);else t._updateAfterChangeGroup(null, undefined,true)};var callback=function(){History.Create_NewPoint();History.StartTransaction();var isNeedRecal=false;if(!bCol)for(var i=0;i<=level;i++){if(!groupArr[i])continue;for(var j=0;j<groupArr[i].length;j++){isNeedRecal=t.model.needRecalFormulas(groupArr[i][j].start,groupArr[i][j].end);if(isNeedRecal)break}}if(isNeedRecal)t.model.workbook.dependencyFormulas.lockRecal();var oldExcludeCollapsed=t.model.bExcludeCollapsed;var _summaryBelow=t.model.sheetPr?t.model.sheetPr.SummaryBelow:true;var _summaryRight= t.model.sheetPr?t.model.sheetPr.SummaryRight:true;t.model.bExcludeCollapsed=true;for(i=0;i<=level;i++){if(!groupArr[i])continue;for(j=0;j<groupArr[i].length;j++)if(bCol){t.model.setColHidden(i>=level,groupArr[i][j].start,groupArr[i][j].end);if(_summaryRight)t.model.setCollapsedCol(i>=level,groupArr[i][j].end+1);else t.model.setCollapsedCol(i>=level,groupArr[i][j].start-1)}else{t.model.setRowHidden(i>=level,groupArr[i][j].start,groupArr[i][j].end);if(_summaryBelow)t.model.setCollapsedRow(i>=level, groupArr[i][j].end+1);else t.model.setCollapsedRow(i>=level,groupArr[i][j].start-1)}}t.model.bExcludeCollapsed=oldExcludeCollapsed;History.EndTransaction();if(isNeedRecal)t.model.workbook.dependencyFormulas.unlockRecal()};if(viewMode)onChangeWorksheetCallback();else this._isLockedAll(onChangeWorksheetCallback)};WorksheetView.prototype.changeGroupDetails=function(bExpand){if(this.model.selectionRange.ranges.length>1)return;var ar=this.model.selectionRange.getLast().clone();var t=this;var getNeedGroups= function(groupArr,bCol){var maxGroupIndexMap={},deleteIndexes={};var selectPartGroup,curLevel=0;var container=[];if(groupArr)for(var i=0;i<groupArr.length;i++)if(groupArr[i])for(var j=0;j<groupArr[i].length;j++){var collapsed=t._getGroupCollapsed(groupArr[i][j].end+1,bCol);if(groupArr[i][j].end+1>=ar.r1&&groupArr[i][j].end+1<=ar.r2&&undefined===maxGroupIndexMap[groupArr[i][j].end]){if(!deleteIndexes[groupArr[i][j].end]&&undefined!==maxGroupIndexMap[groupArr[i][j].end+1]&&!collapsed){delete container[maxGroupIndexMap[groupArr[i][j].end+ 1]];deleteIndexes[maxGroupIndexMap[groupArr[i][j].end+1]]=1}else maxGroupIndexMap[groupArr[i][j].end]=container.length;if(!bExpand&&!collapsed)container.push(groupArr[i][j])}else{var outLineGroupRange;if(bCol)outLineGroupRange=Asc.Range(groupArr[i][j].start,0,groupArr[i][j].end,gc_nMaxRow);else outLineGroupRange=Asc.Range(0,groupArr[i][j].start,gc_nMaxCol,groupArr[i][j].end);if(!collapsed&&i>curLevel&&outLineGroupRange.intersection(ar)){selectPartGroup=groupArr[i][j];curLevel=i}}}return{container:container, selectPartGroup:selectPartGroup}};var needGroups=getNeedGroups(t.arrRowGroups.groupArr);var allGroupSelectedRow=needGroups.container;var selectPartRowGroup=needGroups.selectPartGroup;if(allGroupSelectedRow.length)selectPartRowGroup=null;needGroups=getNeedGroups(t.arrColGroups.groupArr,true);var allGroupSelectedCol=needGroups.container;var selectPartColGroup=needGroups.selectPartGroup;if(allGroupSelectedCol.length)selectPartColGroup=null;var onChangeWorksheetCallback=function(isSuccess){if(false=== isSuccess)return;asc_applyFunction(callback);t._updateAfterChangeGroup(null,null)};var callback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();var i;if(allGroupSelectedRow.length)for(i=0;i<allGroupSelectedRow.length;i++){if(!allGroupSelectedRow[i])continue;t.model.setRowHidden(!bExpand,allGroupSelectedRow[i].start,allGroupSelectedRow[i].end)}if(selectPartRowGroup)t.model.setRowHidden(!bExpand,selectPartRowGroup.start,selectPartRowGroup.end);if(allGroupSelectedCol.length)for(i= 0;i<allGroupSelectedCol.length;i++){if(!allGroupSelectedCol[i])continue;t.model.setColHidden(!bExpand,allGroupSelectedCol[i].start,allGroupSelectedCol[i].end)}if(selectPartColGroup)t.model.setColHidden(!bExpand,selectPartColGroup.start,selectPartColGroup.end);History.EndTransaction()};if(selectPartRowGroup||selectPartColGroup||allGroupSelectedRow.length||allGroupSelectedCol.length)this._isLockedAll(onChangeWorksheetCallback)};WorksheetView.prototype.changeGroupDetailsSimple=function(bExpand){if(this.model.selectionRange.ranges.length> 1)return;var ar=this.model.selectionRange.getLast().clone();var t=this;var getNeedGroups=function(groupArr,bCol){var res;if(groupArr)for(var i=0;i<groupArr.length;i++)if(groupArr[i])for(var j=0;j<groupArr[i].length;j++)if(!bCol&&groupArr[i][j].start<=ar.r1&&groupArr[i][j].end+1>=ar.r1)res=groupArr[i][j];else if(groupArr[i][j].start<=ar.c1&&groupArr[i][j].end+1>=ar.c1)res=groupArr[i][j];return res};var needGroups=getNeedGroups(t.arrRowGroups.groupArr);var allGroupSelectedRow=needGroups;needGroups= getNeedGroups(t.arrColGroups.groupArr,true);var allGroupSelectedCol=needGroups;var onChangeWorksheetCallback=function(isSuccess){if(false===isSuccess)return;asc_applyFunction(callback);t._updateAfterChangeGroup(null,null)};var callback=function(isSuccess){if(false===isSuccess)return;History.Create_NewPoint();History.StartTransaction();var i;if(allGroupSelectedRow)t.model.setRowHidden(!bExpand,allGroupSelectedRow.start,allGroupSelectedRow.end);if(allGroupSelectedCol)t.model.setColHidden(!bExpand,allGroupSelectedCol.start, allGroupSelectedCol.end);History.EndTransaction()};if(allGroupSelectedRow||allGroupSelectedCol)this._isLockedAll(onChangeWorksheetCallback)};WorksheetView.prototype._updateAfterChangeGroup=function(updateRow,updateCol,changeRowCol){var t=this;var oRecalcType=AscCommonExcel.recalcType.recalc;var lockDraw=false;var arrChangedRanges=[];t._initCellsArea(oRecalcType);if(changeRowCol)t.cache.reset();t._cleanCellsTextMetricsCache();t._prepareCellTextMetricsCache();arrChangedRanges=arrChangedRanges.concat(t.model.hiddenManager.getRecalcHidden()); t.cellCommentator.updateAreaComments();if(t.objectRender){t._updateDrawingArea();t.model.onUpdateRanges(arrChangedRanges);t.objectRender.rebuildChartGraphicObjects(arrChangedRanges)}if(updateRow)t._updateGroups(null);else if(updateRow===null)t._updateGroups(false,undefined,undefined,true);if(updateCol)t._updateGroups(true);else if(updateCol===null)t._updateGroups(true,undefined,undefined,true);t.draw(lockDraw);t.handlers.trigger("reinitializeScroll",AscCommonExcel.c_oAscScrollType.ScrollVertical| AscCommonExcel.c_oAscScrollType.ScrollHorizontal);t.handlers.trigger("selectionChanged");t.handlers.trigger("selectionMathInfoChanged",t.getSelectionMathInfo())};WorksheetView.prototype.clearOutline=function(){var t=this;var ar=t.model.selectionRange;var isOneCell=1===ar.ranges.length&&ar.ranges[0].isOneCell();var groupArrCol=t.arrColGroups?t.arrColGroups.groupArr:null;var groupArrRow=t.arrRowGroups?t.arrRowGroups.groupArr:null;var doChangeRowArr=[],doChangeColArr=[];var range,intersection;for(var n= 0;n<ar.ranges.length;n++){if(groupArrRow)for(var i=0;i<=groupArrRow.length;i++){if(!groupArrRow[i])continue;for(var j=0;j<groupArrRow[i].length;j++){range=Asc.Range(0,groupArrRow[i][j].start,gc_nMaxCol,groupArrRow[i][j].end);if(isOneCell)intersection=range;else intersection=ar.ranges[n].intersection(range);if(intersection)doChangeRowArr.push(intersection)}}if(groupArrCol)for(i=0;i<=groupArrCol.length;i++){if(!groupArrCol[i])continue;for(j=0;j<groupArrCol[i].length;j++){range=Asc.Range(groupArrCol[i][j].start, 0,groupArrCol[i][j].end,gc_nMaxRow);if(isOneCell)intersection=range;else intersection=ar.ranges[n].intersection(range);if(intersection)doChangeColArr.push(intersection)}}}var callback=function(isSuccess){if(!isSuccess)return;History.Create_NewPoint();History.StartTransaction();var ar=t.model.selectionRange.getLast();var _type=ar.getType();if(_type===c_oAscSelectionType.RangeMax||_type===c_oAscSelectionType.RangeRow)if(t.model.oAllCol)t.model.oAllCol.setOutlineLevel(0);if(_type===c_oAscSelectionType.RangeMax|| _type===c_oAscSelectionType.RangeCol)if(t.model.oSheetFormatPr&&t.model.oSheetFormatPr.oAllRow)t.model.oSheetFormatPr.oAllRow.setOutlineLevel(0);for(var j in doChangeRowArr){t.model.setRowHidden(false,doChangeRowArr[j].r1,doChangeRowArr[j].r2);t.model.setOutlineRow(0,doChangeRowArr[j].r1,doChangeRowArr[j].r2)}for(j in doChangeColArr){t.model.setColHidden(false,doChangeColArr[j].c1,doChangeColArr[j].c2);t.model.setOutlineCol(0,doChangeColArr[j].c1,doChangeColArr[j].c2)}History.EndTransaction();t._updateGroups(null); t._updateGroups(true)};if(doChangeRowArr.length||doChangeColArr.length)this._isLockedAll(callback)};WorksheetView.prototype.checkAddGroup=function(bUngroup){if(this.model.selectionRange.ranges.length>1){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CopyMultiselectAreaError,c_oAscError.Level.NoCritical);return}if(bUngroup&&!this._isGroupSheet()){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotUngroupError,c_oAscError.Level.NoCritical);return}var res=null; var ar=this.model.selectionRange.getLast().clone();var type=ar.getType();if(c_oAscSelectionType.RangeCol===type)res=false;else if(c_oAscSelectionType.RangeRow===type)res=true;return res};WorksheetView.prototype._isGroupSheet=function(){var res=false;if(this.arrRowGroups&&this.arrRowGroups.groupArr||this.arrColGroups&&this.arrColGroups.groupArr)res=true;return res};WorksheetView.prototype.checkSetGroup=function(range,bCol){var res=true;var c_maxLevel=window["AscCommonExcel"].c_maxOutlineLevel;var maxLevel, i;if(!bCol&&this.arrRowGroups&&this.arrRowGroups.groupArr){if(this.arrRowGroups.groupArr[c_maxLevel]){maxLevel=this.arrRowGroups.groupArr[c_maxLevel];for(i=0;i<maxLevel.length;i++)if(range.r1>=maxLevel[i].start&&range.r2<=maxLevel[i].end){res=false;break}}}else if(bCol&&(this.arrColGroups&&this.arrColGroups.groupArr))if(this.arrColGroups.groupArr[c_maxLevel]){maxLevel=this.arrColGroups.groupArr[c_maxLevel];for(i=0;i<maxLevel.length;i++)if(range.c1>=maxLevel[i].start&&range.c2<=maxLevel[i].end){res= false;break}}return res};WorksheetView.prototype.asc_setGroupSummary=function(val,bCol){var t=this;var groupArr=bCol?this.arrColGroups:this.arrRowGroups;groupArr=groupArr?groupArr.groupArr:null;var collapsedIndexes=[];if(groupArr)for(var i=0;i<groupArr.length;i++)if(groupArr[i])for(var j=0;j<groupArr[i].length;j++){var collapsedFrom,collapsedTo;if(val===false){collapsedFrom=groupArr[i][j].end+1;collapsedTo=groupArr[i][j].start-1}else{collapsedFrom=groupArr[i][j].start-1;collapsedTo=groupArr[i][j].end+ 1}var fromCollapsed=this._getGroupCollapsed(collapsedFrom,bCol);if(fromCollapsed!==this._getGroupCollapsed(collapsedTo,bCol)&&collapsedTo>0&&collapsedFrom>0)collapsedIndexes[collapsedTo]=fromCollapsed}var callback=function(success){if(!success)return;History.Create_NewPoint();History.StartTransaction();bCol?t.model.setSummaryRight(val):t.model.setSummaryBelow(val);for(var n in collapsedIndexes)bCol?t.model.setCollapsedCol(collapsedIndexes[n],n):t.model.setCollapsedRow(collapsedIndexes[n],n);History.EndTransaction(); if(bCol)t._updateAfterChangeGroup(undefined,null);else t._updateAfterChangeGroup(null)};this._isLockedAll(callback)};WorksheetView.prototype.expandActiveCellByFormulaArray=function(activeCellRange){var formulaRef;if(!activeCellRange)return activeCellRange;this.model.getRange3(activeCellRange.r1,activeCellRange.c1,activeCellRange.r1,activeCellRange.c1)._foreachNoEmpty(function(cell){formulaRef=cell.formulaParsed&&cell.formulaParsed.ref?cell.formulaParsed.ref:null});return formulaRef?formulaRef:activeCellRange}; WorksheetView.prototype.getSortProps=function(bExpand){var sortSettings=null;var t=this;var selection=t.model.selectionRange.getLast();var activeCell=t.model.selectionRange.activeCell.clone();var oldSelection=selection.clone();var autoFilter=t.model.AutoFilter;var modelSort,dataHasHeaders,columnSort;var tables=t.model.autoFilters.getTablesIntersectionRange(selection);var lockChangeHeaders,lockChangeOrientation,caseSensitive;var tryExpandRange=t.model.autoFilters.expandRange(selection,true);if(tables&& tables.length)if(tables&&tables&&tables.length===1&&tables[0].Ref.containsRange(selection)){selection=tables[0].getRangeWithoutHeaderFooter();columnSort=true;dataHasHeaders=true;modelSort=tables[0].SortState;lockChangeHeaders=true;lockChangeOrientation=true}else{t.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);return false}else if(autoFilter&&autoFilter.Ref&&(autoFilter.Ref.isEqual(selection)||selection.isOneCell()&&(autoFilter.Ref.containsRange(selection)|| autoFilter.Ref.containsRange(tryExpandRange)))){selection=autoFilter.getRangeWithoutHeaderFooter();columnSort=true;dataHasHeaders=true;modelSort=autoFilter.SortState;lockChangeHeaders=true;lockChangeOrientation=true}else{if(bExpand)selection=tryExpandRange?tryExpandRange:t.model.autoFilters.expandRange(selection,true);selection=t.model.autoFilters.cutRangeByDefinedCells(selection);if(bExpand)selection=t.model.autoFilters.checkExpandRangeForSort(selection);modelSort=this.model.sortState;columnSort= modelSort?!modelSort.ColumnSort:true;caseSensitive=modelSort?modelSort.CaseSensitive:false;var isOneRow=selection.r1===selection.r2;if(isOneRow||!columnSort){if(isOneRow)lockChangeHeaders=true;dataHasHeaders=false}if(columnSort)if(modelSort)dataHasHeaders=modelSort._hasHeaders;else dataHasHeaders=window["AscCommonExcel"].ignoreFirstRowSort(t.model,selection);if(dataHasHeaders)selection.r1++;if(t.model.autoFilters._isEmptyRange(selection,0)){t.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError, c_oAscError.Level.NoCritical);return false}}t.cleanSelection();t.model.selectionRange.getLast().assign2(selection);if(!selection.contains(activeCell.col,activeCell.row))t.model.selectionRange.activeCell=new AscCommon.CellBase(selection.r1,selection.c1);t._drawSelection();sortSettings=new Asc.CSortProperties(this);sortSettings.selection=oldSelection;sortSettings.hasHeaders=dataHasHeaders;sortSettings.columnSort=columnSort;sortSettings.caseSensitive=caseSensitive;sortSettings.lockChangeHeaders=lockChangeHeaders; sortSettings.lockChangeOrientation=lockChangeOrientation;var getSortLevel=function(sortCondition){var level=new Asc.CSortPropertiesLevel;var index=columnSort?sortCondition.Ref.c1-selection.c1:sortCondition.Ref.r1-selection.r1;var name=sortSettings.getNameColumnByIndex(index,selection);level.index=index;level.name=name;level.descending=sortCondition.ConditionDescending?Asc.c_oAscSortOptions.Descending:Asc.c_oAscSortOptions.Ascending;level.sortBy=sortCondition.ConditionSortBy;var conditionSortBy=sortCondition.ConditionSortBy; var sortColor=null;switch(conditionSortBy){case Asc.ESortBy.sortbyCellColor:{level.sortBy=Asc.c_oAscSortOptions.ByColorFill;if(sortCondition.dxf&&sortCondition.dxf.fill)if(sortCondition.dxf.fill&&sortCondition.dxf.fill.patternFill)if(sortCondition.dxf.fill.patternFill.bgColor)sortColor=sortCondition.dxf.fill.patternFill.bgColor;else if(sortCondition.dxf.fill.patternFill.fgColor)sortColor=sortCondition.dxf.fill.patternFill.fgColor;break}case Asc.ESortBy.sortbyFontColor:{level.sortBy=Asc.c_oAscSortOptions.ByColorFont; sortColor=sortCondition.dxf&&sortCondition.dxf.font&&sortCondition.dxf.font.c?sortCondition.dxf.font.getColor():null;break}case Asc.ESortBy.sortbyIcon:{level.sortBy=Asc.c_oAscSortOptions.ByIcon;break}default:{level.sortBy=Asc.c_oAscSortOptions.ByValue;break}}var ascColor=null;if(null!==sortColor){ascColor=new Asc.asc_CColor;ascColor.asc_putR(sortColor.getR());ascColor.asc_putG(sortColor.getG());ascColor.asc_putB(sortColor.getB());ascColor.asc_putA(sortColor.getA());level.color=ascColor}return level}; if(modelSort)if(selection.intersection(modelSort.Ref))for(var i=0;i<modelSort.SortConditions.length;i++)if(modelSort.SortConditions[i].Ref.intersection(selection)){if(!sortSettings.levels)sortSettings.levels=[];sortSettings.levels.push(getSortLevel(modelSort.SortConditions[i]))}sortSettings._newSelection=selection;sortSettings.generateSortList();return sortSettings};WorksheetView.prototype.setSortProps=function(props,doNotSortRange,bCancel){var t=this;var selection=t.model.selectionRange.getLast(); var activeCell=t.model.selectionRange.activeCell.clone();var revertSelection=function(){t.cleanSelection();t.model.selectionRange.getLast().assign2(props.selection.clone());if(!selection.contains(activeCell.col,activeCell.row))t.model.selectionRange.activeCell=new AscCommon.CellBase(selection.r1,selection.c1);t._drawSelection()};if(bCancel&&props&&props.selection){revertSelection();return}if(!props||!props.levels||!props.levels.length)return false;var aMerged=this.model.mergeManager.get(selection); if(aMerged.outer.length>0||aMerged.inner.length>0&&null==window["AscCommonExcel"]._isSameSizeMerged(selection,aMerged.inner,true)){t.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotFillRange,c_oAscError.Level.NoCritical);return}var callback=function(obj){var sortState=new AscCommonExcel.SortState;sortState.Ref=new Asc.Range(selection.c1,selection.r1,selection.c2,selection.r2);History.Create_NewPoint();History.StartTransaction();var columnSort=props.columnSort;sortState.ColumnSort=!columnSort; sortState.CaseSensitive=props.caseSensitive;for(var i=0;i<props.levels.length;i++){var sortCondition=new AscCommonExcel.SortCondition;var level=props.levels[i];var r1=columnSort?selection.r1:level.index+selection.r1;var c1=columnSort?selection.c1+level.index:selection.c1;var r2=columnSort?selection.r2:level.index+selection.r1;var c2=columnSort?selection.c1+level.index:selection.c2;sortCondition.Ref=new Asc.Range(c1,r1,c2,r2);sortCondition.ConditionSortBy=null;sortCondition.ConditionDescending=Asc.c_oAscSortOptions.Descending=== level.descending;var conditionSortBy=level.sortBy;var sortColor=null,newDxf,isRgbColor;switch(conditionSortBy){case Asc.c_oAscSortOptions.ByColorFill:{sortCondition.ConditionSortBy=Asc.ESortBy.sortbyCellColor;sortColor=level.color;isRgbColor=sortColor&&sortColor.getType&&sortColor.getType()===AscCommonExcel.UndoRedoDataTypes.RgbColor;sortColor=sortColor&&!isRgbColor?new AscCommonExcel.RgbColor((sortColor.asc_getR()<<16)+(sortColor.asc_getG()<<8)+sortColor.asc_getB()):null;newDxf=new AscCommonExcel.CellXfs; newDxf.fill=new AscCommonExcel.Fill;newDxf.fill.fromColor(sortColor);break}case Asc.c_oAscSortOptions.ByColorFont:{sortCondition.ConditionSortBy=Asc.ESortBy.sortbyFontColor;sortColor=level.color;isRgbColor=sortColor&&sortColor.getType&&sortColor.getType()===AscCommonExcel.UndoRedoDataTypes.RgbColor;sortColor=sortColor&&!isRgbColor?new AscCommonExcel.RgbColor((sortColor.asc_getR()<<16)+(sortColor.asc_getG()<<8)+sortColor.asc_getB()):null;newDxf=new AscCommonExcel.CellXfs;newDxf.font=new AscCommonExcel.Font; newDxf.font.setColor(sortColor);break}case Asc.c_oAscSortOptions.ByIcon:{sortCondition.ConditionSortBy=Asc.ESortBy.sortbyIcon;break}default:{sortCondition.ConditionSortBy=Asc.ESortBy.sortbyValue;break}}if(newDxf)sortCondition.dxf=AscCommonExcel.g_StyleCache.addXf(newDxf);if(!sortState.SortConditions)sortState.SortConditions=[];sortState.SortConditions.push(sortCondition)}if(obj){History.Add(AscCommonExcel.g_oUndoRedoSortState,AscCH.historyitem_SortState_Add,t.model.getId(),null,new AscCommonExcel.UndoRedoData_SortState(obj.sortState? obj.sortState.clone():null,sortState?sortState.clone():null,true,obj.DisplayName));obj.SortState=sortState;if(!obj.isAutoFilter())t._onUpdateFormatTable(selection)}else{History.Add(AscCommonExcel.g_oUndoRedoSortState,AscCH.historyitem_SortState_Add,t.model.getId(),null,new AscCommonExcel.UndoRedoData_SortState(t.model.sortState?t.model.sortState.clone():null,sortState?sortState.clone():null));sortState._hasHeaders=props.hasHeaders;t.model.sortState=sortState}if(!doNotSortRange){var range=t.model.getRange3(selection.r1, selection.c1,selection.r2,selection.c2);t.cellCommentator.sortComments(t._doSort(range,null,null,null,null,!columnSort,sortState))}if(props&&props.selection)revertSelection();History.EndTransaction()};var tables=t.model.autoFilters.getTablesIntersectionRange(selection);var obj;if(tables&&tables.length)obj=tables[0];else if(t.model.AutoFilter&&t.model.AutoFilter.Ref&&t.model.AutoFilter.Ref.intersection(selection))obj=t.model.AutoFilter;this._isLockedAll(callback(obj))};WorksheetView.prototype._generateSortProps= function(nOption,nStartRowCol,sortColor,opt_guessHeader,opt_by_row,range){var sortSettings=new Asc.CSortProperties(this);var columnSort=sortSettings.columnSort=opt_by_row!==true;var getSortLevel=function(){var level=new Asc.CSortPropertiesLevel;level.index=columnSort?nStartRowCol-range.c1:nStartRowCol-range.r1;level.descending=nOption!=Asc.c_oAscSortOptions.Ascending;level.sortBy=nOption;level.color=sortColor;return level};sortSettings.levels=[];sortSettings.levels.push(getSortLevel());sortSettings._newSelection= range;return sortSettings};WorksheetView.prototype.checkCustomSortRange=function(range,bRow){var res=null;var ar=this.model.copySelection.getLast();if(bRow&&range.r1!==range.r2||!bRow&&range.c1!==range.c2)res=c_oAscError.ID.CustomSortMoreOneSelectedError;else if(bRow&&(range.r1<ar.r1||range.r1>ar.r2)||!bRow&&(range.c1<ar.c1||range.c1>ar.c2))res=c_oAscError.ID.CustomSortNotOriginalSelectError;return res};WorksheetView.prototype._doSort=function(range,nOption,nStartRowCol,sortColor,opt_guessHeader, opt_by_row,opt_custom_sort){var res;var bordersArr=[];range._foreachNoEmpty(function(cell,row,col){var style=cell?cell.getStyle():null;if(style&&style.border){if(!bordersArr[row])bordersArr[row]=[];bordersArr[row][col]=style.border;cell.setBorder(null)}});res=range.sort(nOption,nStartRowCol,sortColor,opt_guessHeader,opt_by_row,opt_custom_sort);for(var i=0;i<bordersArr.length;i++)if(bordersArr[i])for(var j=0;j<bordersArr[i].length;j++)if(bordersArr[i][j]){var curBorder=bordersArr[i][j];this.model._getCell(i, j,function(cell){cell.setBorder(curBorder)})}return res};WorksheetView.prototype.applyTableAutoExpansion=function(bbox,applyByArray){if(!window["AscCommonExcel"].g_IncludeNewRowColInTable)return;var t=this;var api=window["Asc"]["editor"];var bFast=api.collaborativeEditing.m_bFast;var bIsSingleUser=!api.collaborativeEditing.getCollaborativeEditing();var oAutoExpansionTable=t.model.autoFilters.checkTableAutoExpansion(bbox);if(oAutoExpansionTable&&!applyByArray){var callback=function(success){if(!success)return; if(bFast&&!bIsSingleUser){t.handlers.trigger("toggleAutoCorrectOptions");return}var options={props:[Asc.c_oAscAutoCorrectOptions.UndoTableAutoExpansion],cell:bbox,wsId:t.model.getId()};t.handlers.trigger("toggleAutoCorrectOptions",true,options)};t.af_changeTableRange(oAutoExpansionTable.name,oAutoExpansionTable.range,callback)}else t.handlers.trigger("toggleAutoCorrectOptions")};WorksheetView.prototype.getRemoveDuplicates=function(bExpand){var settings=null;var t=this;var selection=t.model.selectionRange.getLast(); var activeCell=t.model.selectionRange.activeCell.clone();var oldSelection=selection.clone();var autoFilter=t.model.AutoFilter;var dataHasHeaders;var tables=t.model.autoFilters.getTablesIntersectionRange(selection);var lockChangeHeaders,lockChangeOrientation,caseSensitive;var tryExpandRange=t.model.autoFilters.expandRange(selection,true);if(tables&&tables.length)if(tables&&tables&&tables.length===1&&tables[0].Ref.containsRange(selection)){selection=tables[0].getRangeWithoutHeaderFooter();dataHasHeaders= true}else{t.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);return false}else if(autoFilter&&autoFilter.Ref&&(autoFilter.Ref.isEqual(selection)||selection.isOneCell()&&(autoFilter.Ref.containsRange(selection)||autoFilter.Ref.containsRange(tryExpandRange)))){selection=autoFilter.getRangeWithoutHeaderFooter();dataHasHeaders=true}else{if(bExpand)selection=tryExpandRange?tryExpandRange:t.model.autoFilters.expandRange(selection,true);selection= t.model.autoFilters.cutRangeByDefinedCells(selection);if(bExpand)selection=t.model.autoFilters.checkExpandRangeForSort(selection);dataHasHeaders=window["AscCommonExcel"].ignoreFirstRowSort(t.model,selection);if(dataHasHeaders)selection.r1++;if(t.model.autoFilters._isEmptyRange(selection,0)||selection.r1===selection.r2){t.workbook.handlers.trigger("asc_onError",c_oAscError.ID.AutoFilterDataRangeError,c_oAscError.Level.NoCritical);return false}}t.cleanSelection();t.model.selectionRange.getLast().assign2(selection); if(!selection.contains(activeCell.col,activeCell.row))t.model.selectionRange.activeCell=new AscCommon.CellBase(selection.r1,selection.c1);t._drawSelection();settings=new Asc.CRemoveDuplicatesProps(this);settings.selection=oldSelection;settings.hasHeaders=dataHasHeaders;settings._newSelection=selection;settings.generateColumnList();return settings};WorksheetView.prototype.setRemoveDuplicates=function(props,bCancel){var t=this;var selection=t.model.selectionRange.getLast();var activeCell=t.model.selectionRange.activeCell.clone(); var revertSelection=function(){t.cleanSelection();t.model.selectionRange.getLast().assign2(props.selection.clone());if(!selection.contains(activeCell.col,activeCell.row))t.model.selectionRange.activeCell=new AscCommon.CellBase(selection.r1,selection.c1);t._drawSelection()};if(bCancel||!props||!props.columnList){revertSelection();return}var aMerged=this.model.mergeManager.get(selection);if(aMerged.outer.length>0||aMerged.inner.length>0&&null==window["AscCommonExcel"]._isSameSizeMerged(selection,aMerged.inner, true)){revertSelection();t.handlers.trigger("onErrorEvent",c_oAscError.ID.CannotFillRange,c_oAscError.Level.NoCritical);return}var i,startSortCol,colMap=[];for(i=0;i<props.columnList.length;i++)if(props.columnList[i].asc_getVisible()){var _colIndex=i+selection.c1;colMap[_colIndex]=1;if(undefined===startSortCol)startSortCol=_colIndex}if(undefined===startSortCol){revertSelection();return}var firstLockRow;var deleteIndexes=[];var deleteIndexesMap=[];var repeatArr=[];var aSortElems=[];for(i=selection.r1;i<= selection.r2;i++){var cell=t.model.getCell3(i,startSortCol);var value=cell.getValueWithFormat();aSortElems.push({index:i});if(repeatArr.hasOwnProperty(value)){for(var n=0;n<repeatArr[value].length;n++){var _notEqual=false;for(var j=startSortCol+1;j<=selection.c2;j++){if(!colMap[j])continue;var cell1=t.model.getCell3(i,j);var cell2=t.model.getCell3(repeatArr[value][n],j);var val1=cell1.getValueWithFormat();var val2=cell2.getValueWithFormat();if(val1!==val2){_notEqual=true;break}}if(!_notEqual){deleteIndexes.push(i); deleteIndexesMap[i]=1;if(undefined===firstLockRow)firstLockRow=i;break}}if(_notEqual)repeatArr[value].push(i)}else{if(!repeatArr[value])repeatArr[value]=[];repeatArr[value].push(i)}}var _removeDuplicates=function(success){if(!success){if(isStartTransaction)History.EndTransaction();return}if(!isStartTransaction){History.Create_NewPoint();History.StartTransaction()}var tableIntersection;var filterIntersection=t.model.AutoFilter&&t.model.AutoFilter.Ref.intersection(selection);if(filterIntersection)t.model.setRowHidden(false, filterIntersection.r1,filterIntersection.r2);else if(t.model.TableParts)for(var i=0;i<t.model.TableParts.length;i++){var _intersection=selection.intersection(t.model.TableParts[i].Ref);if(_intersection){tableIntersection=t.model.TableParts[i];t.model.setRowHidden(false,_intersection.r1,_intersection.r2);break}}aSortElems.sort(function(a,b){if(deleteIndexesMap[a.index]&&deleteIndexesMap[b.index]||!deleteIndexesMap[a.index]&&!deleteIndexesMap[b.index])return 0;else if(!deleteIndexesMap[a.index]&&deleteIndexesMap[b.index])return-1; else return 1});var aSortData=[];for(var i=0;i<aSortElems.length;i++){var oldIndex=aSortElems[i].index;var newIndex=i+selection.r1;if(oldIndex!==newIndex)aSortData.push(new AscCommonExcel.UndoRedoData_FromToRowCol(true,oldIndex,newIndex))}if(deleteIndexes.length){for(var j=0;j<deleteIndexes.length;j++){var deleteRange=t.model.getRange3(deleteIndexes[j],selection.c1,deleteIndexes[j],selection.c2);deleteRange.cleanAll();t.model.deletePivotTables(deleteRange.bbox);t.model.removeSparklines(deleteRange.bbox); t.cellCommentator.deleteCommentsRange(deleteRange.bbox)}if(aSortData.length){var sortRange=t.model.getRange3(selection.r1,selection.c1,selection.r2,selection.c2);var oUndoRedoBBox=new AscCommonExcel.UndoRedoData_BBox({r1:selection.r1,c1:selection.c1,r2:selection.r2,c2:selection.c2});var _historyElem=new AscCommonExcel.UndoRedoData_SortData(oUndoRedoBBox,aSortData);sortRange._sortByArray(oUndoRedoBBox,aSortData);var range=new Asc.Range(selection.r1,selection.c1,selection.r2,selection.c2);History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_Sort,t.model.getId(),range,_historyElem)}}if(filterIntersection)t.model.autoFilters.reapplyAutoFilter(null);else if(tableIntersection){t.model.autoFilters.reapplyAutoFilter(tableIntersection.DisplayName);t.model.autoFilters._setColorStyleTable(tableIntersection.Ref,tableIntersection,null,true)}History.EndTransaction();t._updateRange(selection);t._updateSlicers(selection);t.draw();if(deleteIndexes.length){props.setDuplicateValues(deleteIndexes.length);props.setUniqueValues(selection.r2- selection.r1-deleteIndexes.length+1)}t.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.RemoveDuplicates,c_oAscError.Level.NoCritical,props)};if(undefined!==firstLockRow){var lockRange=new Asc.Range(selection.c1,firstLockRow,selection.c2,selection.r2);if(this.intersectionFormulaArray(lockRange)){this.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.CannotChangeFormulaArray,c_oAscError.Level.NoCritical);return}var tableContains=this.model.autoFilters.getTablesIntersectionRange(selection); var isStartTransaction=false;if(tableContains&&tableContains.length){if(tableContains.length===1){var name=tableContains[0].DisplayName;var ref=tableContains[0].Ref;var newRef=new Asc.Range(ref.c1,ref.r1,ref.c2,ref.r2-deleteIndexes.length);History.Create_NewPoint();History.StartTransaction();isStartTransaction=true;this.af_changeTableRange(name,newRef,_removeDuplicates,true)}}else this._isLockedCells(lockRange,null,_removeDuplicates)}else t.model.workbook.handlers.trigger("asc_onError",c_oAscError.ID.RemoveDuplicates, c_oAscError.Level.NoCritical,props)};WorksheetView.prototype.getDrawingDocument=function(){if(this.model)return this.model.getDrawingDocument();return null};WorksheetView.prototype.rangeToRectAbs=function(oRange,units){var left=this.getCellLeft(0,units);var top=this.getCellTop(0,units);var l=this.getCellLeft(oRange.c1,units)-left;var t=this.getCellTop(oRange.r1,units)-top;var r=this.getCellLeft(oRange.c2,units)+this.getColumnWidth(oRange.c2,units)-left;var b=this.getCellTop(oRange.r2,units)+this.getRowHeight(oRange.r2, units)-top;return new AscFormat.CGraphicBounds(l,t,r,b)};WorksheetView.prototype.rangeToRectRel=function(oRange,units){var l=this.getCellLeftRelative(oRange.c1,units);var t=this.getCellTopRelative(oRange.r1,units);var r=this.getCellLeftRelative(oRange.c2,units)+this.getColumnWidth(oRange.c2,units);var b=this.getCellTopRelative(oRange.r2,units)+this.getRowHeight(oRange.r2,units);return new AscFormat.CGraphicBounds(l,t,r,b)};WorksheetView.prototype.beforeInsertSlicer=function(){var table=this.model.autoFilters.getTableByActiveCell(); if(table){var res=[];for(var j=0;j<table.TableColumns.length;j++)res.push(table.TableColumns[j].Name);return res}var ar=this.model.selectionRange.getLast().clone();if(Asc.CT_pivotTableDefinition.prototype.asc_filterByCell){var pivotTable=this.model.inPivotTable(ar);if(pivotTable){var pivotFields=pivotTable.asc_getPivotFields();if(pivotFields){var res=[];for(var j=0;j<pivotFields.length;j++)res.push(pivotTable.getCacheFieldName(j));return res}}}return null};WorksheetView.prototype.insertSlicers=function(arr){if(this.collaborativeEditing.getGlobalLock()|| !window["Asc"]["editor"].canEdit())return;var t=this;var type,name,pivotTable;var callback=function(success){if(!success){History.EndTransaction();return}for(var i=0;i<arr.length;i++){var slicer=t.model.insertSlicer(arr[i],name,type,pivotTable);arr[i]=slicer.name}t.objectRender.addSlicers(arr);History.EndTransaction()};History.Create_NewPoint();History.StartTransaction();var obj=this.model.autoFilters.getTableByActiveCell();var lockRanges=[],colRange,needAddFilter,pivotLockInfos=[];if(obj){type=window["AscCommonExcel"].insertSlicerType.table; name=obj.DisplayName;if(!obj.AutoFilter)needAddFilter=true;for(var k=0;k<arr.length;k++){colRange=this.model.getTableRangeColumnByName(name,arr[k]);if(colRange)lockRanges.push(colRange)}}else{var ar=this.model.selectionRange.getLast().clone();if(Asc.CT_pivotTableDefinition.prototype.asc_filterByCell){pivotTable=this.model.inPivotTable(ar);if(pivotTable){type=window["AscCommonExcel"].insertSlicerType.pivotTable;pivotTable.fillLockInfo(pivotLockInfos,t.collaborativeEditing)}}}if(needAddFilter)this.changeAutoFilter(name, Asc.c_oAscChangeFilterOptions.filter,true,function(success){if(!success){History.EndTransaction();return}t._isLockedDefNames(callback)});else{var callbackLockCell=function(success){if(!success){History.EndTransaction();return}if(pivotLockInfos.length>0)t.collaborativeEditing.lock(pivotLockInfos,function(success){if(!success){History.EndTransaction();return}t._isLockedDefNames(callback)});else t._isLockedDefNames(callback)};if(lockRanges.length>0)this._isLockedCells(lockRanges,null,callbackLockCell); else callbackLockCell(true)}};WorksheetView.prototype.deleteSlicer=function(name){var t=this;var callback=function(success){if(!success)return;t.model.deleteSlicer(name)};var slicer=this.model.getSlicerByName(name);if(slicer)this.checkLockSlicers([slicer],true,callback)};WorksheetView.prototype.setSlicer=function(slicer,obj){if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;var callback=function(success){if(!success)return;History.Create_NewPoint();History.StartTransaction(); slicer.set(obj);History.EndTransaction()};if(slicer)this.checkLockSlicers([slicer],true,callback)};WorksheetView.prototype.setFilterValuesFromSlicer=function(slicer,val){if(this.collaborativeEditing.getGlobalLock()||!window["Asc"]["editor"].canEdit())return;var ws=this.model;var obj;if(slicer&&slicer.cacheDefinition){var slicerCache=slicer.cacheDefinition;obj=slicerCache.getFilterObj()}var checkFilterItems=function(_elems,_setItemsVisible){if(_elems){for(var i=0;i<_elems.length;i++){if(!_setItemsVisible&& _elems[i].visible===true)return true;if(_setItemsVisible)_elems[i].visible=true}return false}return true};var createSimpleFilterOptions=function(){var colId=obj.colId;var table=obj.obj;var displayName=table.DisplayName;var rangeButton=new Asc.Range(table.Ref.c1+colId,table.Ref.r1,table.Ref.c1+colId,table.Ref.r1);var cellId=ws.autoFilters._rangeToId(rangeButton);var filterObj=new Asc.AutoFilterObj;filterObj.type=c_oAscAutoFilterTypes.Filters;var autoFilterObject=new Asc.AutoFiltersOptions;autoFilterObject.asc_setCellId(cellId); autoFilterObject.asc_setValues(val);autoFilterObject.asc_setFilterObj(filterObj);autoFilterObject.asc_setDiplayName(displayName);return autoFilterObject};if(obj){var type=slicerCache.getType();switch(type){case window["AscCommonExcel"].insertSlicerType.table:{if(!checkFilterItems(val))checkFilterItems(val,true);this.applyAutoFilter(createSimpleFilterOptions());break}case window["AscCommonExcel"].insertSlicerType.pivotTable:{if(!checkFilterItems(val))checkFilterItems(val,true);slicerCache.applyPivotFilterWithLock(this.model.workbook.oApi, val,slicer.name,null,false);break}}}};WorksheetView.prototype.getFilterValuesBySlicerName=function(name){var slicerCache=this.model.getSlicerCachesBySourceName(name);return slicerCache?slicerCache.getFilterValues():null};WorksheetView.prototype.updateSlicerViewAfterTableChange=function(tableName){var slicers=this.model.getSlicersByTableName(tableName);for(var i=0;i<slicers.length;i++)var filterValues=this.getFilterValuesBySlicerName(slicers[i].Name)};WorksheetView.prototype.updateSlicerAfterChangeTable= function(type,tableName,val){};WorksheetView.prototype.checkLockSlicers=function(slicers,doLockRange,callback){var t=this;var _lockMap=[];var lockInfoArr=[];var lockRanges=[];var cache,defNameId,lockInfo,lockRange;for(var i=0;i<slicers.length;i++){cache=slicers[i].getCacheDefinition();if(!_lockMap[cache.name]){_lockMap[cache.name]=1;defNameId=this.model.workbook.dependencyFormulas.getDefNameByName(cache.name,this.model.getId());defNameId=defNameId?defNameId.getNodeId():null;lockInfo=this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null,-1,defNameId);lockInfoArr.push(lockInfo);if(doLockRange){lockRange=cache.getRange();if(lockRange)lockRanges.push(lockRange)}}}var _callback=function(success){if(!success&&callback)callback(false);if(lockRanges&&lockRanges.length)t._isLockedCells(lockRanges,null,callback);else callback(true)};if(lockInfoArr&&lockInfoArr.length)this.collaborativeEditing.lock(lockInfoArr,_callback);else _callback(true)};WorksheetView.prototype.tryPasteSlicers=function(arr,callback){var t=this;var _callback=function(success){if(!success){callback(false); return}var newNames=[];for(var i=0;i<arr.length;i++){var slicer=arr[i].clone(t.model);slicer.name=slicer.generateName(slicer.name);if(modelCaches[i])slicer.cacheDefinition=modelCaches[i];else{var _type=slicer.cacheDefinition.getType();if(_type===window["AscCommonExcel"].insertSlicerType.table){var table=slicer.cacheDefinition.getTableSlicerCache();if(!table||!t.model.workbook.getTableIndexColumnByName(table.tableId,table.column))continue}else if(_type===window["AscCommonExcel"].insertSlicerType.pivotTable)if(!slicer.cacheDefinition.moveToWb(t.model.workbook))continue; slicer.cacheDefinition.name=slicer.cacheDefinition.generateSlicerCacheName(slicer.name);var newDefName=new Asc.asc_CDefName(slicer.cacheDefinition.name,"#N/A",null,Asc.c_oAscDefNameType.slicer);t.model.workbook.editDefinesNames(null,newDefName)}History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_SlicerAdd,t.model.getId(),null,new AscCommonExcel.UndoRedoData_FromTo(null,slicer));t.model.aSlicers.push(slicer);newNames[i]=slicer.name}callback(true,newNames)};var lockRanges=[], isLockDefNames,slicerPasted,cachePasted,modelCache,_range,pivotLockInfos=[];var modelCaches=[];for(var i=0;i<arr.length;i++){slicerPasted=arr[i];cachePasted=slicerPasted.getCacheDefinition();modelCache=this.model.workbook.getSlicerCacheByCacheName(cachePasted.name);if(modelCache){var _type=modelCache.getType();if(_type===window["AscCommonExcel"].insertSlicerType.table){_range=modelCache.getRange();if(_range)lockRanges.push(_range)}else if(_type===window["AscCommonExcel"].insertSlicerType.pivotTable)modelCache.getPivotTables().map(function(pivotTable){pivotTable.fillLockInfo(pivotLockInfos, t.collaborativeEditing)});modelCaches[i]=modelCache}else{_range=cachePasted.getRange();if(_range)lockRanges.push(_range);isLockDefNames=true}}this._isLockedCells(lockRanges,null,function(success){if(success)if(isLockDefNames)t._isLockedDefNames(function(isLockedDefNames){if(isLockedDefNames)if(pivotLockInfos.length>0)t.collaborativeEditing.lock(pivotLockInfos,_callback);else _callback(true);else _callback(false)});else if(pivotLockInfos.length>0)t.collaborativeEditing.lock(pivotLockInfos,_callback); else _callback(true);else callback(false)})};WorksheetView.prototype._updateSlicers=function(range){var tables=this.model.autoFilters.getTablesIntersectionRange(range);if(tables)for(var i=0;i<tables.length;i++)this.model.autoFilters.updateSlicer(tables[i].DisplayName)};WorksheetView.prototype.getDefaultDefinedNameText=function(){var selectionRange=this.model.selectionRange;var cell=selectionRange.activeCell;var mc=this.model.getMergedByCell(cell.row,cell.col);var c1=mc?mc.c1:cell.col;var r1=mc?mc.r1: cell.row;var c=this._getVisibleCell(c1,r1);var text=null;if(!c.isFormula()){text=c.getValueForEdit(true);if(text&&text.length>window["AscCommonExcel"].g_nDefNameMaxLength)text=null;else if(text)if(!isNaN(text))text=null;else if(text[0]&&!isNaN(text[0]))text="_"+text}return!text?"":text};WorksheetView.prototype.setDataValidationProps=function(props){var t=this;var _selection=this.model.getSelection().ranges;var callback=function(success){if(!success)return;History.Create_NewPoint();History.StartTransaction(); t.model.setDataValidationProps(props);t.handlers.trigger("selectionChanged");t.draw();History.EndTransaction()};var lockRanges=this.model.dataValidations?this.model.dataValidations.expandRanges(_selection):_selection;this._isLockedCells(lockRanges,null,callback)};WorksheetView.prototype.setDataValidationSameSettings=function(props,val){var _selection=this.model.getSelection().ranges;var t=this;var getRangeSelection=function(oldRanges){var _ranges=[];for(var i=0;i<oldRanges.length;i++)_ranges.push(AscCommonExcel.Range.prototype.createFromBBox(t, oldRanges[i].clone()));return _ranges};if(val){var modelDataValidation=this.model.dataValidations.getById(props.Id);if(modelDataValidation&&modelDataValidation.data)modelDataValidation=modelDataValidation.data;else return;var elems=this.model.dataValidations.getSameSettingsElems(modelDataValidation);if(elems){props._tempSelection=_selection;var newSelection=[];for(var i=0;i<elems.length;i++)newSelection=newSelection.concat(elems[i].ranges);this.setSelection(getRangeSelection(newSelection))}}else if(props._tempSelection)this.setSelection(getRangeSelection(props._tempSelection))}; window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].CellFlags=CellFlags;window["AscCommonExcel"].WorksheetView=WorksheetView})(window);"use strict";(function(window,undefined){var DrawingObjectsController=AscFormat.DrawingObjectsController;var History=AscCommon.History;if(window.editor==="undefined"&&window["Asc"]["editor"]){window.editor=window["Asc"]["editor"];window.editor}AscCommon.CContentChangesElement.prototype.Refresh_BinaryData=function(){if(this.m_aPositions.length> 0)this.m_pData.Pos=this.m_aPositions[0];this.m_pData.UseArray=true;this.m_pData.PosArray=this.m_aPositions;if(editor&&editor.isPresentationEditor){var Binary_Writer=History.BinaryWriter;var Binary_Pos=Binary_Writer.GetCurPosition();this.m_pData.Data.UseArray=true;this.m_pData.Data.PosArray=this.m_aPositions;Binary_Writer.WriteString2(this.m_pData.Class.Get_Id());Binary_Writer.WriteLong(this.m_pData.Data.Type);this.m_pData.Data.WriteToBinary(Binary_Writer);var Binary_Len=Binary_Writer.GetCurPosition()- Binary_Pos;this.m_pData.Binary.Pos=Binary_Pos;this.m_pData.Binary.Len=Binary_Len}};function CheckIdSatetShapeAdd(state){return!(state instanceof AscFormat.NullState)}DrawingObjectsController.prototype.getTheme=function(){return window["Asc"]["editor"].wbModel.theme};DrawingObjectsController.prototype.getDrawingArray=function(){var ret=[];var drawing_bases=this.drawingObjects.getDrawingObjects();for(var i=0;i<drawing_bases.length;++i)ret.push(drawing_bases[i].graphicObject);return ret};DrawingObjectsController.prototype.setTableProps= function(props){var by_type=this.getSelectedObjectsByTypes();if(by_type.tables.length===1){var sCaption=props.TableCaption;var sDescription=props.TableDescription;var dRowHeight=props.RowHeight;by_type.tables[0].setTitle(sCaption);by_type.tables[0].setDescription(sDescription);props.TableCaption=undefined;props.TableDescription=undefined;var bIgnoreHeight=false;if(AscFormat.isRealNumber(props.RowHeight)){if(AscFormat.fApproxEqual(props.RowHeight,0))props.RowHeight=1;bIgnoreHeight=false}var target_text_object= AscFormat.getTargetTextObject(this);if(target_text_object===by_type.tables[0])by_type.tables[0].graphicObject.Set_Props(props);else{by_type.tables[0].graphicObject.SelectAll();by_type.tables[0].graphicObject.Set_Props(props);by_type.tables[0].graphicObject.RemoveSelection()}props.TableCaption=sCaption;props.TableDescription=sDescription;props.RowHeight=dRowHeight;editor.WordControl.m_oLogicDocument.Check_GraphicFrameRowHeight(by_type.tables[0],bIgnoreHeight)}};DrawingObjectsController.prototype.RefreshAfterChangeColorScheme= function(){var drawings=this.getDrawingArray();for(var i=0;i<drawings.length;++i)if(drawings[i]){drawings[i].handleUpdateFill();drawings[i].handleUpdateLn();drawings[i].addToRecalculate()}};DrawingObjectsController.prototype.updateOverlay=function(){this.drawingObjects.OnUpdateOverlay()};DrawingObjectsController.prototype.recalculate=function(bAll,Point,bCheckPoint){if(bCheckPoint!==false)History.Get_RecalcData(Point);if(bAll){var drawings=this.getDrawingObjects();for(var i=0;i<drawings.length;++i){if(drawings[i].recalcText)drawings[i].recalcText(); drawings[i].recalculate()}}else for(var key in this.objectsForRecalculate)this.objectsForRecalculate[key].recalculate();this.objectsForRecalculate={}};DrawingObjectsController.prototype.recalculate2=function(bAll){if(bAll){var drawings=this.getDrawingObjects();for(var i=0;i<drawings.length;++i){if(drawings[i].recalcText)drawings[i].recalcText();drawings[i].recalculate()}}else for(var key in this.objectsForRecalculate)this.objectsForRecalculate[key].recalculate();this.objectsForRecalculate={}};DrawingObjectsController.prototype.updateRecalcObjects= function(){};DrawingObjectsController.prototype.getTheme=function(){return window["Asc"]["editor"].wbModel.theme};DrawingObjectsController.prototype.startRecalculate=function(bCheckPoint){this.recalculate(undefined,undefined,bCheckPoint);this.drawingObjects.showDrawingObjects()};DrawingObjectsController.prototype.getDrawingObjects=function(){var ret=[];var drawing_bases=this.drawingObjects.getDrawingObjects();for(var i=0;i<drawing_bases.length;++i)ret.push(drawing_bases[i].graphicObject);return ret}; DrawingObjectsController.prototype.checkSelectedObjectsForMove=function(group){var selected_object=group?group.selectedObjects:this.selectedObjects;for(var i=0;i<selected_object.length;++i)if(selected_object[i].canMove())this.arrPreTrackObjects.push(selected_object[i].createMoveTrack())};DrawingObjectsController.prototype.checkSelectedObjectsAndFireCallback=function(callback,args){if(!this.canEdit())return;var oApi=Asc.editor;if(oApi&&oApi.collaborativeEditing&&oApi.collaborativeEditing.getGlobalLock())return; var selection_state=this.getSelectionState();this.drawingObjects.objectLocker.reset();for(var i=0;i<this.selectedObjects.length;++i)this.drawingObjects.objectLocker.addObjectId(this.selectedObjects[i].Get_Id());var _this=this;var callback2=function(bLock,bSync){if(bLock){if(bSync!==true)_this.setSelectionState(selection_state);callback.apply(_this,args)}};this.drawingObjects.objectLocker.checkObjects(callback2)};DrawingObjectsController.prototype.onMouseDown=function(e,x,y){e.ShiftKey=e.shiftKey; e.CtrlKey=e.metaKey||e.ctrlKey;e.Button=e.button;e.Type=AscCommon.g_mouse_event_type_down;var ret=this.curState.onMouseDown(e,x,y,0);if(e.ClickCount<2){if(this.drawingObjects&&this.drawingObjects.getWorksheet){var ws=this.drawingObjects.getWorksheet();if(Asc.editor.wb.getWorksheet()!==ws)return ret}this.updateOverlay();this.updateSelectionState()}return ret};DrawingObjectsController.prototype.OnMouseDown=DrawingObjectsController.prototype.onMouseDown;DrawingObjectsController.prototype.onMouseMove= function(e,x,y){e.ShiftKey=e.shiftKey;e.CtrlKey=e.metaKey||e.ctrlKey;e.Button=e.button;e.Type=AscCommon.g_mouse_event_type_move;this.curState.onMouseMove(e,x,y,0)};DrawingObjectsController.prototype.OnMouseMove=DrawingObjectsController.prototype.onMouseMove;DrawingObjectsController.prototype.onMouseUp=function(e,x,y){e.ShiftKey=e.shiftKey;e.CtrlKey=e.metaKey||e.ctrlKey;e.Button=e.button;e.Type=AscCommon.g_mouse_event_type_up;this.curState.onMouseUp(e,x,y,0)};DrawingObjectsController.prototype.OnMouseUp= DrawingObjectsController.prototype.onMouseUp;DrawingObjectsController.prototype.createGroup=function(){var group=this.getGroup();if(group){var group_array=this.getArrayForGrouping();for(var i=group_array.length-1;i>-1;--i)group_array[i].deleteDrawingBase();this.resetSelection();this.drawingObjects.getWorksheetModel&&group.setWorksheet(this.drawingObjects.getWorksheetModel());group.setDrawingObjects(this.drawingObjects);if(this.drawingObjects&&this.drawingObjects.cSld)group.setParent(this.drawingObjects); group.addToDrawingObjects();group.checkDrawingBaseCoords();this.selectObject(group,0);group.addToRecalculate();this.startRecalculate()}};DrawingObjectsController.prototype.handleChartDoubleClick=function(){var drawingObjects=this.drawingObjects;var oThis=this;this.checkSelectedObjectsAndFireCallback(function(){oThis.clearTrackObjects();oThis.clearPreTrackObjects();oThis.changeCurrentState(new AscFormat.NullState(this));drawingObjects.showChartSettings()},[])};DrawingObjectsController.prototype.handleOleObjectDoubleClick= function(drawing,oleObject,e,x,y,pageIndex){var drawingObjects=this.drawingObjects;var oThis=this;var fCallback=function(){var pluginData=new Asc.CPluginData;pluginData.setAttribute("data",oleObject.m_sData);pluginData.setAttribute("guid",oleObject.m_sApplicationId);pluginData.setAttribute("width",oleObject.extX);pluginData.setAttribute("height",oleObject.extY);pluginData.setAttribute("widthPix",oleObject.m_nPixWidth);pluginData.setAttribute("heightPix",oleObject.m_nPixHeight);pluginData.setAttribute("objectId", oleObject.Id);window["Asc"]["editor"].asc_pluginRun(oleObject.m_sApplicationId,0,pluginData);oThis.clearTrackObjects();oThis.clearPreTrackObjects();oThis.changeCurrentState(new AscFormat.NullState(oThis));oThis.onMouseUp(e,x,y)};if(!this.canEdit()){fCallback();return}this.checkSelectedObjectsAndFireCallback(fCallback,[])};DrawingObjectsController.prototype.addChartDrawingObject=function(options){History.Create_NewPoint();var chart=this.getChartSpace(this.drawingObjects.getWorksheetModel(),options, true);if(chart){chart.setWorksheet(this.drawingObjects.getWorksheetModel());chart.setStyle(2);chart.setBDeleted(false);this.resetSelection();var w,h;if(AscCommon.isRealObject(options)&&AscFormat.isRealNumber(options.width)&&AscFormat.isRealNumber(options.height)){w=this.drawingObjects.convertMetric(options.width,0,3);h=this.drawingObjects.convertMetric(options.height,0,3)}else{w=this.drawingObjects.convertMetric(AscCommon.AscBrowser.convertToRetinaValue(AscCommon.c_oAscChartDefines.defaultChartWidth, true),0,3);h=this.drawingObjects.convertMetric(AscCommon.AscBrowser.convertToRetinaValue(AscCommon.c_oAscChartDefines.defaultChartHeight,true),0,3)}var chartLeft,chartTop;if(options&&AscFormat.isRealNumber(options.left)&&options.left>=0&&AscFormat.isRealNumber(options.top)&&options.top>=0){chartLeft=this.drawingObjects.convertMetric(options.left,0,3);chartTop=this.drawingObjects.convertMetric(options.top,0,3)}else{chartLeft=-this.drawingObjects.convertMetric(this.drawingObjects.getScrollOffset().getX(), 0,3)+(this.drawingObjects.convertMetric(this.drawingObjects.getContextWidth(),0,3)-w)/2;if(chartLeft<0)chartLeft=0;chartTop=-this.drawingObjects.convertMetric(this.drawingObjects.getScrollOffset().getY(),0,3)+(this.drawingObjects.convertMetric(this.drawingObjects.getContextHeight(),0,3)-h)/2;if(chartTop<0)chartTop=0}chart.setSpPr(new AscFormat.CSpPr);chart.spPr.setParent(chart);chart.spPr.setXfrm(new AscFormat.CXfrm);chart.spPr.xfrm.setParent(chart.spPr);chart.spPr.xfrm.setOffX(chartLeft);chart.spPr.xfrm.setOffY(chartTop); chart.spPr.xfrm.setExtX(w);chart.spPr.xfrm.setExtY(h);chart.setDrawingObjects(this.drawingObjects);chart.setWorksheet(this.drawingObjects.getWorksheetModel());chart.addToDrawingObjects();this.resetSelection();this.selectObject(chart,0);if(options){var old_range=options.getRange();options.putRange(null);options.style=null;options.horAxisProps=null;options.vertAxisProps=null;options.showMarker=null;this.editChartCallback(options);options.style=1;this.editChartCallback(options);options.putRange(old_range)}chart.addToRecalculate(); chart.checkDrawingBaseCoords();this.startRecalculate();this.drawingObjects.sendGraphicObjectProps()}};DrawingObjectsController.prototype.isPointInDrawingObjects=function(x,y,e){this.handleEventMode=AscFormat.HANDLE_EVENT_MODE_CURSOR;var ret=this.curState.onMouseDown(e||{},x,y,0);this.handleEventMode=AscFormat.HANDLE_EVENT_MODE_HANDLE;return ret};DrawingObjectsController.prototype.handleDoubleClickOnChart=function(chart){this.changeCurrentState(new AscFormat.NullState)};DrawingObjectsController.prototype.addImageFromParams= function(rasterImageId,x,y,extX,extY){var image=this.createImage(rasterImageId,x,y,extX,extY);image.setWorksheet(this.drawingObjects.getWorksheetModel());image.setDrawingObjects(this.drawingObjects);image.addToDrawingObjects(undefined,AscCommon.c_oAscCellAnchorType.cellanchorOneCell);image.checkDrawingBaseCoords();this.selectObject(image,0);image.addToRecalculate()};DrawingObjectsController.prototype.addOleObjectFromParams=function(fPosX,fPosY,fWidth,fHeight,nWidthPix,nHeightPix,sLocalUrl,sData,sApplicationId){var oOleObject= this.createOleObject(sData,sApplicationId,sLocalUrl,fPosX,fPosY,fWidth,fHeight,nWidthPix,nHeightPix);this.resetSelection();oOleObject.setWorksheet(this.drawingObjects.getWorksheetModel());oOleObject.setDrawingObjects(this.drawingObjects);oOleObject.addToDrawingObjects();oOleObject.checkDrawingBaseCoords();this.selectObject(oOleObject,0);oOleObject.addToRecalculate();this.startRecalculate()};DrawingObjectsController.prototype.editOleObjectFromParams=function(oOleObject,sData,sImageUrl,nPixWidth,nPixHeight, bResize){oOleObject.setData(sData);var _blipFill=new AscFormat.CBlipFill;_blipFill.RasterImageId=sImageUrl;oOleObject.setBlipFill(_blipFill);oOleObject.setPixSizes(nPixWidth,nPixHeight);this.startRecalculate()};DrawingObjectsController.prototype.addTextArtFromParams=function(nStyle,dRectX,dRectY,dRectW,dRectH,wsmodel){History.Create_NewPoint();var oTextArt=this.createTextArt(nStyle,false,wsmodel);this.resetSelection();oTextArt.setWorksheet(this.drawingObjects.getWorksheetModel());oTextArt.setDrawingObjects(this.drawingObjects); oTextArt.addToDrawingObjects();oTextArt.checkExtentsByDocContent();var dNewPoX=dRectX+(dRectW-oTextArt.spPr.xfrm.extX)/2;if(dNewPoX<0)dNewPoX=0;var dNewPoY=dRectY+(dRectH-oTextArt.spPr.xfrm.extY)/2;if(dNewPoY<0)dNewPoY=0;oTextArt.spPr.xfrm.setOffX(dNewPoX);oTextArt.spPr.xfrm.setOffY(dNewPoY);oTextArt.checkDrawingBaseCoords();this.selectObject(oTextArt,0);var oContent=oTextArt.getDocContent();this.selection.textSelection=oTextArt;oContent.SelectAll();oTextArt.addToRecalculate();this.startRecalculate()}; DrawingObjectsController.prototype.getDrawingDocument=function(){return this.drawingObjects.drawingDocument};DrawingObjectsController.prototype.convertPixToMM=function(pix){var _ret=this.drawingObjects?this.drawingObjects.convertMetric(pix,0,3):0;if(AscCommon.AscBrowser.isRetina)_ret*=2;return _ret};DrawingObjectsController.prototype.setParagraphNumbering=function(Bullet){this.applyDocContentFunction(CDocumentContent.prototype.Set_ParagraphPresentationNumbering,[Bullet],CTable.prototype.Set_ParagraphPresentationNumbering)}; DrawingObjectsController.prototype.setParagraphIndent=function(Indent){if(AscCommon.isRealObject(Indent)&&AscFormat.isRealNumber(Indent.Left)&&Indent.Left<0)Indent.Left=0;this.applyDocContentFunction(CDocumentContent.prototype.SetParagraphIndent,[Indent],CTable.prototype.SetParagraphIndent)};DrawingObjectsController.prototype.paragraphIncDecIndent=function(bIncrease){this.applyDocContentFunction(CDocumentContent.prototype.Increase_ParagraphLevel,[bIncrease],CTable.prototype.Increase_ParagraphLevel)}; DrawingObjectsController.prototype.canIncreaseParagraphLevel=function(bIncrease){var content=this.getTargetDocContent();if(content){var target_text_object=AscFormat.getTargetTextObject(this);if(target_text_object&&target_text_object.getObjectType()===AscDFH.historyitem_type_Shape){if(target_text_object.isPlaceholder()&&(target_text_object.getPhType()===AscFormat.phType_title||target_text_object.getPhType()===AscFormat.phType_ctrTitle))return false;return content.Can_IncreaseParagraphLevel(bIncrease)}}return false}; DrawingObjectsController.prototype.checkMobileCursorPosition=function(){if(!this.drawingObjects)return;var oWorksheet=this.drawingObjects.getWorksheet();if(!oWorksheet)return;if(window["Asc"]["editor"].isMobileVersion){var oTargetDocContent=this.getTargetDocContent(false,false);if(oTargetDocContent){var oPos=oTargetDocContent.GetCursorPosXY();var oParentTextTransform=oTargetDocContent.Get_ParentTextTransform();var _x,_y;if(oParentTextTransform){_x=oParentTextTransform.TransformPointX(oPos.X,oPos.Y); _y=oParentTextTransform.TransformPointY(oPos.X,oPos.Y)}else{_x=oPos.X;_y=oPos.Y}_x=this.drawingObjects.convertMetric(_x,3,0);_y=this.drawingObjects.convertMetric(_y,3,0);var oCell=oWorksheet.findCellByXY(_x,_y,true,false,false);if(oCell&&oCell.col!==null&&oCell.row!==null){var oRange=new Asc.Range(oCell.col,oCell.row,oCell.col,oCell.row,false);var oVisibleRange=oWorksheet.getVisibleRange();if(!oRange.isIntersect(oVisibleRange))oWorksheet._scrollToRange(oRange)}}}};DrawingObjectsController.prototype.onKeyPress= function(e){if(!this.canEdit())return false;if(e.CtrlKey||e.AltKey)return false;var Code;if(null!=e.Which)Code=e.Which;else if(e.KeyCode)Code=e.KeyCode;else Code=0;var bRetValue=false;if(Code>32){var oApi=window["Asc"]&&window["Asc"]["editor"];var fCallback=function(){this.paragraphAdd(new ParaText(Code),false);this.checkMobileCursorPosition();this.recalculateCurPos(true,true)};this.checkSelectedObjectsAndCallback(fCallback,[],false,AscDFH.historydescription_Spreadsheet_ParagraphAdd,undefined,window["Asc"]["editor"].collaborativeEditing.getFast()); bRetValue=true}else if(Code==32){var oApi=window["Asc"]&&window["Asc"]["editor"];var fCallback=function(){this.paragraphAdd(new ParaSpace);this.checkMobileCursorPosition();this.recalculateCurPos(true,true)};this.checkSelectedObjectsAndCallback(fCallback,[],false,AscDFH.historydescription_Spreadsheet_AddSpace,undefined,window["Asc"]["editor"].collaborativeEditing.getFast());bRetValue=true}return bRetValue};DrawingObjectsController.prototype.checkSlicerCopies=function(aCopies){var i;var aSlicers=[]; var aSlicerViewNames=[];var oDrawing,oSlicer,sSlicerViewName;var oWSView;var oWB=Asc["editor"]&&Asc["editor"].wbModel;var oControllerParent=this.drawingObjects;var oThis=this;if(oControllerParent&&oControllerParent.getWorksheet)oWSView=oControllerParent.getWorksheet();if(!oWB||!oWSView)return;var aSlicerView=[];for(i=0;i<aCopies.length;++i)aCopies[i].getAllSlicerViews(aSlicerView);for(i=0;i<aSlicerView.length;++i){oDrawing=aSlicerView[i];sSlicerViewName=oDrawing.getName();oSlicer=oWB.getSlicerByName(sSlicerViewName); if(oSlicer){aSlicers.push(oSlicer);aSlicerViewNames.push(sSlicerViewName)}}if(aSlicers.length>0){History.StartTransaction();oWSView.tryPasteSlicers(aSlicers,function(bSuccess,aSlicerNames){if(!bSuccess||aSlicerNames.length!==aSlicerViewNames.length){History.EndTransaction();History.Undo();return}History.EndTransaction();var i,j;var oDrawing;var sOldSlicerName,sNewSlicerName;for(i=0;i<aSlicerNames.length;++i){sOldSlicerName=aSlicerViewNames[i];sNewSlicerName=aSlicerNames[i];for(j=0;j<aSlicerView.length;++j){oDrawing= aSlicerView[j];if(oDrawing.getName()===sOldSlicerName){oDrawing.setName(sNewSlicerName);oDrawing.onDataUpdate();break}}}oThis.startRecalculate();oThis.drawingObjects.sendGraphicObjectProps()})}};window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].CheckIdSatetShapeAdd=CheckIdSatetShapeAdd})(window);"use strict";(function(window,undefined){var FontStyle=AscFonts.FontStyle;var g_fontApplication=AscFonts.g_fontApplication;var c_oAscLockTypes=AscCommon.c_oAscLockTypes;var CMatrixL= AscCommon.CMatrixL;var global_MatrixTransformer=AscCommon.global_MatrixTransformer;function CGraphics(){this.m_oContext=null;this.m_dWidthMM=0;this.m_dHeightMM=0;this.m_lWidthPix=0;this.m_lHeightPix=0;this.m_dDpiX=96;this.m_dDpiY=96;this.m_bIsBreak=false;this.m_oPen=new AscCommon.CPen;this.m_oBrush=new AscCommon.CBrush;this.m_oAutoShapesTrack=null;this.m_oFontManager=null;this.m_oCoordTransform=new CMatrixL;this.m_oBaseTransform=new CMatrixL;this.m_oTransform=new CMatrixL;this.m_oFullTransform=new CMatrixL; this.m_oInvertFullTransform=new CMatrixL;this.ArrayPoints=null;this.m_oCurFont={Name:"",FontSize:10,Bold:false,Italic:false};this.m_oTextPr=null;this.m_oGrFonts=new AscCommon.CGrRFonts;this.m_oLastFont=new AscCommon.CFontSetup;this.LastFontOriginInfo={Name:"",Replace:null};this.m_bIntegerGrid=true;this.ClipManager=new AscCommon.CClipManager;this.ClipManager.BaseObject=this;this.TextureFillTransformScaleX=1;this.TextureFillTransformScaleY=1;this.IsThumbnail=false;this.GrState=new AscCommon.CGrState; this.GrState.Parent=this;this.globalAlpha=1;this.TextClipRect=null;this.IsClipContext=false;this.IsUseFonts2=false;this.m_oFontManager2=null;this.m_oLastFont2=null;this.ClearMode=false;this.IsRetina=false;this.dash_no_smart=null}CGraphics.prototype={init:function(context,width_px,height_px,width_mm,height_mm){this.m_oContext=context;this.m_lHeightPix=height_px;this.m_lWidthPix=width_px;this.m_dWidthMM=width_mm;this.m_dHeightMM=height_mm;this.m_dDpiX=25.4*this.m_lWidthPix/this.m_dWidthMM;this.m_dDpiY= 25.4*this.m_lHeightPix/this.m_dHeightMM;this.m_oCoordTransform.sx=this.m_dDpiX/25.4;this.m_oCoordTransform.sy=this.m_dDpiY/25.4;this.TextureFillTransformScaleX=1/this.m_oCoordTransform.sx;this.TextureFillTransformScaleY=1/this.m_oCoordTransform.sy;this.m_oLastFont.Clear();this.m_oContext.save()},EndDraw:function(){},put_GlobalAlpha:function(enable,alpha){if(false===enable){this.globalAlpha=1;this.m_oContext.globalAlpha=1}else{this.globalAlpha=alpha;this.m_oContext.globalAlpha=alpha}},p_color:function(r, g,b,a){var _c=this.m_oPen.Color;_c.R=r;_c.G=g;_c.B=b;_c.A=a;this.m_oContext.strokeStyle="rgba("+_c.R+","+_c.G+","+_c.B+","+_c.A/255+")"},p_width:function(w){this.m_oPen.LineWidth=w/1E3;if(!this.m_bIntegerGrid)if(0!=this.m_oPen.LineWidth)this.m_oContext.lineWidth=this.m_oPen.LineWidth;else{var _x1=this.m_oFullTransform.TransformPointX(0,0);var _y1=this.m_oFullTransform.TransformPointY(0,0);var _x2=this.m_oFullTransform.TransformPointX(1,1);var _y2=this.m_oFullTransform.TransformPointY(1,1);var _koef= Math.sqrt(((_x2-_x1)*(_x2-_x1)+(_y2-_y1)*(_y2-_y1))/2);this.m_oContext.lineWidth=1/_koef}else if(0!=this.m_oPen.LineWidth){var _m=this.m_oFullTransform;var x=_m.sx+_m.shx;var y=_m.sy+_m.shy;var koef=Math.sqrt((x*x+y*y)/2);this.m_oContext.lineWidth=this.m_oPen.LineWidth*koef}else this.m_oContext.lineWidth=1},p_dash:function(params){if(!this.m_oContext.setLineDash)return;this.dash_no_smart=params?params.slice():null;this.m_oContext.setLineDash(params?params:[])},b_color1:function(r,g,b,a){var _c=this.m_oBrush.Color1; _c.R=r;_c.G=g;_c.B=b;_c.A=a;this.m_oContext.fillStyle="rgba("+_c.R+","+_c.G+","+_c.B+","+_c.A/255+")"},b_color2:function(r,g,b,a){var _c=this.m_oBrush.Color2;_c.R=r;_c.G=g;_c.B=b;_c.A=a},transform:function(sx,shy,shx,sy,tx,ty){var _t=this.m_oTransform;_t.sx=sx;_t.shx=shx;_t.shy=shy;_t.sy=sy;_t.tx=tx;_t.ty=ty;this.CalculateFullTransform();if(false===this.m_bIntegerGrid){var _ft=this.m_oFullTransform;this.m_oContext.setTransform(_ft.sx,_ft.shy,_ft.shx,_ft.sy,_ft.tx,_ft.ty)}if(null!=this.m_oFontManager)this.m_oFontManager.SetTextMatrix(_t.sx, _t.shy,_t.shx,_t.sy,_t.tx,_t.ty)},CalculateFullTransform:function(isInvertNeed){var _ft=this.m_oFullTransform;var _t=this.m_oTransform;_ft.sx=_t.sx;_ft.shx=_t.shx;_ft.shy=_t.shy;_ft.sy=_t.sy;_ft.tx=_t.tx;_ft.ty=_t.ty;global_MatrixTransformer.MultiplyAppend(_ft,this.m_oCoordTransform);var _it=this.m_oInvertFullTransform;_it.sx=_ft.sx;_it.shx=_ft.shx;_it.shy=_ft.shy;_it.sy=_ft.sy;_it.tx=_ft.tx;_it.ty=_ft.ty;if(false!==isInvertNeed)global_MatrixTransformer.MultiplyAppendInvert(_it,_t)},_s:function(){this.m_oContext.beginPath()}, _e:function(){this.m_oContext.beginPath()},_z:function(){this.m_oContext.closePath()},_m:function(x,y){if(false===this.m_bIntegerGrid){this.m_oContext.moveTo(x,y);if(this.ArrayPoints!=null)this.ArrayPoints[this.ArrayPoints.length]={x:x,y:y}}else{var _x=this.m_oFullTransform.TransformPointX(x,y)>>0;var _y=this.m_oFullTransform.TransformPointY(x,y)>>0;this.m_oContext.moveTo(_x+.5,_y+.5)}},_l:function(x,y){if(false===this.m_bIntegerGrid){this.m_oContext.lineTo(x,y);if(this.ArrayPoints!=null)this.ArrayPoints[this.ArrayPoints.length]= {x:x,y:y}}else{var _x=this.m_oFullTransform.TransformPointX(x,y)>>0;var _y=this.m_oFullTransform.TransformPointY(x,y)>>0;this.m_oContext.lineTo(_x+.5,_y+.5)}},_c:function(x1,y1,x2,y2,x3,y3){if(false===this.m_bIntegerGrid){this.m_oContext.bezierCurveTo(x1,y1,x2,y2,x3,y3);if(this.ArrayPoints!=null){this.ArrayPoints[this.ArrayPoints.length]={x:x1,y:y1};this.ArrayPoints[this.ArrayPoints.length]={x:x2,y:y2};this.ArrayPoints[this.ArrayPoints.length]={x:x3,y:y3}}}else{var _x1=this.m_oFullTransform.TransformPointX(x1, y1)>>0;var _y1=this.m_oFullTransform.TransformPointY(x1,y1)>>0;var _x2=this.m_oFullTransform.TransformPointX(x2,y2)>>0;var _y2=this.m_oFullTransform.TransformPointY(x2,y2)>>0;var _x3=this.m_oFullTransform.TransformPointX(x3,y3)>>0;var _y3=this.m_oFullTransform.TransformPointY(x3,y3)>>0;this.m_oContext.bezierCurveTo(_x1+.5,_y1+.5,_x2+.5,_y2+.5,_x3+.5,_y3+.5)}},_c2:function(x1,y1,x2,y2){if(false===this.m_bIntegerGrid){this.m_oContext.quadraticCurveTo(x1,y1,x2,y2);if(this.ArrayPoints!=null){this.ArrayPoints[this.ArrayPoints.length]= {x:x1,y:y1};this.ArrayPoints[this.ArrayPoints.length]={x:x2,y:y2}}}else{var _x1=this.m_oFullTransform.TransformPointX(x1,y1)>>0;var _y1=this.m_oFullTransform.TransformPointY(x1,y1)>>0;var _x2=this.m_oFullTransform.TransformPointX(x2,y2)>>0;var _y2=this.m_oFullTransform.TransformPointY(x2,y2)>>0;this.m_oContext.quadraticCurveTo(_x1+.5,_y1+.5,_x2+.5,_y2+.5)}},ds:function(){this.m_oContext.stroke()},df:function(){this.m_oContext.fill()},save:function(){this.m_oContext.save()},restore:function(){this.m_oContext.restore()}, clip:function(){this.m_oContext.clip()},reset:function(){this.m_oTransform.Reset();this.CalculateFullTransform(false);if(!this.m_bIntegerGrid)this.m_oContext.setTransform(this.m_oCoordTransform.sx,0,0,this.m_oCoordTransform.sy,0,0)},transform3:function(m,isNeedInvert){var _t=this.m_oTransform;_t.sx=m.sx;_t.shx=m.shx;_t.shy=m.shy;_t.sy=m.sy;_t.tx=m.tx;_t.ty=m.ty;this.CalculateFullTransform(isNeedInvert);if(!this.m_bIntegerGrid){var _ft=this.m_oFullTransform;this.m_oContext.setTransform(_ft.sx,_ft.shy, _ft.shx,_ft.sy,_ft.tx,_ft.ty)}else this.SetIntegerGrid(false)},CheckUseFonts2:function(_transform){if(!global_MatrixTransformer.IsIdentity2(_transform)){if(!AscCommon.g_fontManager2){AscCommon.g_fontManager2=new AscFonts.CFontManager;AscCommon.g_fontManager2.Initialize(true)}this.m_oFontManager2=AscCommon.g_fontManager2;if(null==this.m_oLastFont2)this.m_oLastFont2=new AscCommon.CFontSetup;this.IsUseFonts2=true}},UncheckUseFonts2:function(){this.IsUseFonts2=false},FreeFont:function(){this.m_oFontManager.m_pFont= null},ClearLastFont:function(){this.m_oLastFont=new AscCommon.CFontSetup;this.m_oLastFont2=null},drawImage2:function(img,x,y,w,h,alpha,srcRect){var isA=undefined!==alpha&&null!=alpha&&255!=alpha;var _oldGA=0;if(isA){_oldGA=this.m_oContext.globalAlpha;this.m_oContext.globalAlpha=alpha/255}if(false===this.m_bIntegerGrid)if(!srcRect)if(!global_MatrixTransformer.IsIdentity2(this.m_oTransform))this.m_oContext.drawImage(img,x,y,w,h);else{var xx=this.m_oFullTransform.TransformPointX(x,y);var yy=this.m_oFullTransform.TransformPointY(x, y);var rr=this.m_oFullTransform.TransformPointX(x+w,y+h);var bb=this.m_oFullTransform.TransformPointY(x+w,y+h);var ww=rr-xx;var hh=bb-yy;if(Math.abs(img.width-ww)<2&&Math.abs(img.height-hh)<2){this.m_oContext.setTransform(1,0,0,1,0,0);this.m_oContext.drawImage(img,xx>>0,yy>>0);var _ft=this.m_oFullTransform;this.m_oContext.setTransform(_ft.sx,_ft.shy,_ft.shx,_ft.sy,_ft.tx,_ft.ty)}else this.m_oContext.drawImage(img,x,y,w,h)}else{var _w=img.width;var _h=img.height;if(_w>0&&_h>0){var _sx=0;var _sy=0; var _sr=_w;var _sb=_h;var _l=srcRect.l;var _t=srcRect.t;var _r=100-srcRect.r;var _b=100-srcRect.b;_sx+=_l*_w/100;_sr-=_r*_w/100;_sy+=_t*_h/100;_sb-=_b*_h/100;var naturalW=_w;naturalW-=_sx;naturalW+=_sr-_w;var naturalH=_h;naturalH-=_sy;naturalH+=_sb-_h;var tmpW=w;var tmpH=h;if(_sx<0){x+=-_sx*tmpW/naturalW;w-=-_sx*tmpW/naturalW;_sx=0}if(_sy<0){y+=-_sy*tmpH/naturalH;h-=-_sy*tmpH/naturalH;_sy=0}if(_sr>_w){w-=(_sr-_w)*tmpW/naturalW;_sr=_w}if(_sb>_h){h-=(_sb-_h)*tmpH/naturalH;_sb=_h}if(_sx>=_sr||_sx>=_w|| _sr<=0||w<=0)return;if(_sy>=_sb||_sy>=_h||_sb<=0||h<=0)return;this.m_oContext.drawImage(img,_sx,_sy,_sr-_sx,_sb-_sy,x,y,w,h)}else this.m_oContext.drawImage(img,x,y,w,h)}else{var _x1=this.m_oFullTransform.TransformPointX(x,y)>>0;var _y1=this.m_oFullTransform.TransformPointY(x,y)>>0;var _x2=this.m_oFullTransform.TransformPointX(x+w,y+h)>>0;var _y2=this.m_oFullTransform.TransformPointY(x+w,y+h)>>0;x=_x1;y=_y1;w=_x2-_x1;h=_y2-_y1;if(!srcRect)if(!global_MatrixTransformer.IsIdentity2(this.m_oTransform))this.m_oContext.drawImage(img, _x1,_y1,w,h);else if(Math.abs(img.width-w)<2&&Math.abs(img.height-h)<2)this.m_oContext.drawImage(img,x,y);else this.m_oContext.drawImage(img,_x1,_y1,w,h);else{var _w=img.width;var _h=img.height;if(_w>0&&_h>0){var __w=w;var __h=h;var _delW=Math.max(0,-srcRect.l)+Math.max(0,srcRect.r-100)+100;var _delH=Math.max(0,-srcRect.t)+Math.max(0,srcRect.b-100)+100;var _sx=0;if(srcRect.l>0&&srcRect.l<100)_sx=Math.min(_w*srcRect.l/100>>0,_w-1);else if(srcRect.l<0){var _off=-srcRect.l/_delW*__w;x+=_off;w-=_off}var _sy= 0;if(srcRect.t>0&&srcRect.t<100)_sy=Math.min(_h*srcRect.t/100>>0,_h-1);else if(srcRect.t<0){var _off=-srcRect.t/_delH*__h;y+=_off;h-=_off}var _sr=_w;if(srcRect.r>0&&srcRect.r<100)_sr=Math.max(Math.min(_w*srcRect.r/100>>0,_w-1),_sx);else if(srcRect.r>100){var _off=(srcRect.r-100)/_delW*__w;w-=_off}var _sb=_h;if(srcRect.b>0&&srcRect.b<100)_sb=Math.max(Math.min(_h*srcRect.b/100>>0,_h-1),_sy);else if(srcRect.b>100){var _off=(srcRect.b-100)/_delH*__h;h-=_off}if(_sr-_sx>0&&_sb-_sy>0&&w>0&&h>0)this.m_oContext.drawImage(img, _sx,_sy,_sr-_sx,_sb-_sy,x,y,w,h)}else this.m_oContext.drawImage(img,x,y,w,h)}}if(isA)this.m_oContext.globalAlpha=_oldGA},drawImage:function(img,x,y,w,h,alpha,srcRect,nativeImage){if(nativeImage){this.drawImage2(nativeImage,x,y,w,h,alpha,srcRect);return}var editor=window["Asc"]["editor"];var _img=editor.ImageLoader.map_image_index[img];if(_img!=undefined&&_img.Status==AscFonts.ImageLoadStatus.Loading||AscCommon.CollaborativeEditing.WaitImages&&AscCommon.CollaborativeEditing.WaitImages[img]);else if(_img!= undefined&&_img.Image!=null)this.drawImage2(_img.Image,x,y,w,h,alpha,srcRect);else{var _x=x;var _y=y;var _r=x+w;var _b=y+h;if(this.m_bIntegerGrid){_x=this.m_oFullTransform.TransformPointX(x,y);_y=this.m_oFullTransform.TransformPointY(x,y);_r=this.m_oFullTransform.TransformPointX(x+w,y+h);_b=this.m_oFullTransform.TransformPointY(x+w,y+h)}var ctx=this.m_oContext;var old_p=ctx.lineWidth;ctx.beginPath();ctx.moveTo(_x,_y);ctx.lineTo(_r,_b);ctx.moveTo(_r,_y);ctx.lineTo(_x,_b);ctx.strokeStyle="#FF0000"; ctx.stroke();ctx.beginPath();ctx.moveTo(_x,_y);ctx.lineTo(_r,_y);ctx.lineTo(_r,_b);ctx.lineTo(_x,_b);ctx.closePath();ctx.lineWidth=1;ctx.strokeStyle="#000000";ctx.stroke();ctx.beginPath();ctx.lineWidth=old_p;ctx.strokeStyle="rgba("+this.m_oPen.Color.R+","+this.m_oPen.Color.G+","+this.m_oPen.Color.B+","+this.m_oPen.Color.A/255+")"}},GetFont:function(){return this.m_oCurFont},font:function(font_id,font_size,matrix){AscFonts.g_font_infos[AscFonts.g_map_font_index[font_id]].LoadFont(editor.FontLoader, this.m_oFontManager,font_size,0,this.m_dDpiX,this.m_dDpiY,undefined)},SetFont:function(font){if(null==font)return;this.m_oCurFont.Name=font.FontFamily.Name;this.m_oCurFont.FontSize=font.FontSize;this.m_oCurFont.Bold=font.Bold;this.m_oCurFont.Italic=font.Italic;var bItalic=true===font.Italic;var bBold=true===font.Bold;var oFontStyle=FontStyle.FontStyleRegular;if(!bItalic&&bBold)oFontStyle=FontStyle.FontStyleBold;else if(bItalic&&!bBold)oFontStyle=FontStyle.FontStyleItalic;else if(bItalic&&bBold)oFontStyle= FontStyle.FontStyleBoldItalic;var _last_font=this.IsUseFonts2?this.m_oLastFont2:this.m_oLastFont;var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;_last_font.SetUpName=font.FontFamily.Name;_last_font.SetUpSize=font.FontSize;_last_font.SetUpStyle=oFontStyle;g_fontApplication.LoadFont(_last_font.SetUpName,AscCommon.g_font_loader,_font_manager,font.FontSize,oFontStyle,this.m_dDpiX,this.m_dDpiY,this.m_oTransform,this.LastFontOriginInfo);var _mD=_last_font.SetUpMatrix;var _mS= this.m_oTransform;_mD.sx=_mS.sx;_mD.sy=_mS.sy;_mD.shx=_mS.shx;_mD.shy=_mS.shy;_mD.tx=_mS.tx;_mD.ty=_mS.ty},SetTextPr:function(textPr,theme){this.m_oTextPr=textPr.Copy();this.theme=theme;this.m_oTextPr.ReplaceThemeFonts(theme.themeElements.fontScheme)},SetFontSlot:function(slot,fontSizeKoef){var _rfonts=this.m_oTextPr.RFonts;var _lastFont=this.IsUseFonts2?this.m_oLastFont2:this.m_oLastFont;switch(slot){case fontslot_ASCII:{_lastFont.Name=_rfonts.Ascii.Name;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold= this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}case fontslot_CS:{_lastFont.Name=_rfonts.CS.Name;_lastFont.Size=this.m_oTextPr.FontSizeCS;_lastFont.Bold=this.m_oTextPr.BoldCS;_lastFont.Italic=this.m_oTextPr.ItalicCS;break}case fontslot_EastAsia:{_lastFont.Name=_rfonts.EastAsia.Name;_lastFont.Size=this.m_oTextPr.FontSize;_lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}case fontslot_HAnsi:default:{_lastFont.Name=_rfonts.HAnsi.Name;_lastFont.Size=this.m_oTextPr.FontSize; _lastFont.Bold=this.m_oTextPr.Bold;_lastFont.Italic=this.m_oTextPr.Italic;break}}if(undefined!==fontSizeKoef)_lastFont.Size*=fontSizeKoef;var _style=0;if(_lastFont.Italic)_style+=2;if(_lastFont.Bold)_style+=1;var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;if(_lastFont.Name!=_lastFont.SetUpName||_lastFont.Size!=_lastFont.SetUpSize||_style!=_lastFont.SetUpStyle||!_font_manager.m_pFont){_lastFont.SetUpName=_lastFont.Name;_lastFont.SetUpSize=_lastFont.Size;_lastFont.SetUpStyle= _style;g_fontApplication.LoadFont(_lastFont.SetUpName,AscCommon.g_font_loader,_font_manager,_lastFont.SetUpSize,_lastFont.SetUpStyle,this.m_dDpiX,this.m_dDpiY,this.m_oTransform,this.LastFontOriginInfo);var _mD=_lastFont.SetUpMatrix;var _mS=this.m_oTransform;_mD.sx=_mS.sx;_mD.sy=_mS.sy;_mD.shx=_mS.shx;_mD.shy=_mS.shy;_mD.tx=_mS.tx;_mD.ty=_mS.ty}else{var _mD=_lastFont.SetUpMatrix;var _mS=this.m_oTransform;if(_mD.sx!=_mS.sx||_mD.sy!=_mS.sy||_mD.shx!=_mS.shx||_mD.shy!=_mS.shy||_mD.tx!=_mS.tx||_mD.ty!= _mS.ty){_mD.sx=_mS.sx;_mD.sy=_mS.sy;_mD.shx=_mS.shx;_mD.shy=_mS.shy;_mD.tx=_mS.tx;_mD.ty=_mS.ty;_font_manager.SetTextMatrix(_mD.sx,_mD.shy,_mD.shx,_mD.sy,_mD.tx,_mD.ty)}}},GetTextPr:function(){return this.m_oTextPr},FillText:function(x,y,text){if(this.m_bIsBreak)return;var _x=this.m_oInvertFullTransform.TransformPointX(x,y);var _y=this.m_oInvertFullTransform.TransformPointY(x,y);var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;try{var _code=text.charCodeAt(0);if(null!=this.LastFontOriginInfo.Replace)_code= g_fontApplication.GetReplaceGlyph(_code,this.LastFontOriginInfo.Replace);_font_manager.LoadString4C(_code,_x,_y)}catch(err){}if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(1,0,0,1,0,0);var pGlyph=_font_manager.m_oGlyphString.m_pGlyphsBuffer[0];if(null==pGlyph)return;if(null!=pGlyph.oBitmap)this.private_FillGlyph(pGlyph);if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(this.m_oFullTransform.sx,this.m_oFullTransform.shy,this.m_oFullTransform.shx,this.m_oFullTransform.sy,this.m_oFullTransform.tx, this.m_oFullTransform.ty)},t:function(text,x,y){if(this.m_bIsBreak)return;var _x=this.m_oInvertFullTransform.TransformPointX(x,y);var _y=this.m_oInvertFullTransform.TransformPointY(x,y);var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;try{_font_manager.LoadString2(text,_x,_y)}catch(err){}this.m_oContext.setTransform(1,0,0,1,0,0);while(true){var pGlyph=_font_manager.GetNextChar2();if(null==pGlyph)break;if(null!=pGlyph.oBitmap)this.private_FillGlyph(pGlyph)}if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(this.m_oFullTransform.sx, this.m_oFullTransform.shy,this.m_oFullTransform.shx,this.m_oFullTransform.sy,this.m_oFullTransform.tx,this.m_oFullTransform.ty)},FillText2:function(x,y,text,cropX,cropW){if(this.m_bIsBreak)return;var _x=this.m_oInvertFullTransform.TransformPointX(x,y);var _y=this.m_oInvertFullTransform.TransformPointY(x,y);var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;try{var _code=text.charCodeAt(0);if(null!=this.LastFontOriginInfo.Replace)_code=g_fontApplication.GetReplaceGlyph(_code, this.LastFontOriginInfo.Replace);_font_manager.LoadString4C(_code,_x,_y)}catch(err){}this.m_oContext.setTransform(1,0,0,1,0,0);var pGlyph=_font_manager.m_oGlyphString.m_pGlyphsBuffer[0];if(null==pGlyph)return;if(null!=pGlyph.oBitmap)this.private_FillGlyphC(pGlyph,cropX,cropW);if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(this.m_oFullTransform.sx,this.m_oFullTransform.shy,this.m_oFullTransform.shx,this.m_oFullTransform.sy,this.m_oFullTransform.tx,this.m_oFullTransform.ty)},t2:function(text, x,y,cropX,cropW){if(this.m_bIsBreak)return;var _x=this.m_oInvertFullTransform.TransformPointX(x,y);var _y=this.m_oInvertFullTransform.TransformPointY(x,y);var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;try{_font_manager.LoadString2(text,_x,_y)}catch(err){}this.m_oContext.setTransform(1,0,0,1,0,0);while(true){var pGlyph=_font_manager.GetNextChar2();if(null==pGlyph)break;if(null!=pGlyph.oBitmap)this.private_FillGlyphC(pGlyph,cropX,cropW)}if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(this.m_oFullTransform.sx, this.m_oFullTransform.shy,this.m_oFullTransform.shx,this.m_oFullTransform.sy,this.m_oFullTransform.tx,this.m_oFullTransform.ty)},FillTextCode:function(x,y,lUnicode){if(this.m_bIsBreak)return;var _x=this.m_oInvertFullTransform.TransformPointX(x,y);var _y=this.m_oInvertFullTransform.TransformPointY(x,y);var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;try{if(null!=this.LastFontOriginInfo.Replace)lUnicode=g_fontApplication.GetReplaceGlyph(lUnicode,this.LastFontOriginInfo.Replace); _font_manager.LoadString4C(lUnicode,_x,_y)}catch(err){}if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(1,0,0,1,0,0);var pGlyph=_font_manager.m_oGlyphString.m_pGlyphsBuffer[0];if(null==pGlyph)return;if(null!=pGlyph.oBitmap)this.private_FillGlyph(pGlyph);if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(this.m_oFullTransform.sx,this.m_oFullTransform.shy,this.m_oFullTransform.shx,this.m_oFullTransform.sy,this.m_oFullTransform.tx,this.m_oFullTransform.ty)},tg:function(text,x,y){if(this.m_bIsBreak)return; var _x=this.m_oInvertFullTransform.TransformPointX(x,y);var _y=this.m_oInvertFullTransform.TransformPointY(x,y);var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;try{_font_manager.LoadString3C(text,_x,_y)}catch(err){}if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(1,0,0,1,0,0);var pGlyph=_font_manager.m_oGlyphString.m_pGlyphsBuffer[0];if(null==pGlyph)return;if(null!=pGlyph.oBitmap){var _a=this.m_oBrush.Color1.A;if(255!=_a)this.m_oContext.globalAlpha=_a/255;this.private_FillGlyph(pGlyph); if(255!=_a)this.m_oContext.globalAlpha=1}if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(this.m_oFullTransform.sx,this.m_oFullTransform.shy,this.m_oFullTransform.shx,this.m_oFullTransform.sy,this.m_oFullTransform.tx,this.m_oFullTransform.ty)},charspace:function(space){},private_FillGlyph:function(pGlyph){var nW=pGlyph.oBitmap.nWidth;var nH=pGlyph.oBitmap.nHeight;if(0==nW||0==nH)return;var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;var nX=_font_manager.m_oGlyphString.m_fX+ pGlyph.fX+pGlyph.oBitmap.nX>>0;var nY=_font_manager.m_oGlyphString.m_fY+pGlyph.fY-pGlyph.oBitmap.nY>>0;pGlyph.oBitmap.oGlyphData.checkColor(this.m_oBrush.Color1.R,this.m_oBrush.Color1.G,this.m_oBrush.Color1.B,nW,nH);if(null==this.TextClipRect)pGlyph.oBitmap.draw(this.m_oContext,nX,nY,this.TextClipRect);else pGlyph.oBitmap.drawCropInRect(this.m_oContext,nX,nY,this.TextClipRect)},private_FillGlyphC:function(pGlyph,cropX,cropW){var nW=pGlyph.oBitmap.nWidth;var nH=pGlyph.oBitmap.nHeight;if(0==nW||0== nH)return;var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;var nX=_font_manager.m_oGlyphString.m_fX+pGlyph.fX+pGlyph.oBitmap.nX>>0;var nY=_font_manager.m_oGlyphString.m_fY+pGlyph.fY-pGlyph.oBitmap.nY>>0;var d_koef=this.m_dDpiX/25.4;var cX=Math.max(cropX*d_koef>>0,0);var cW=Math.min(cropW*d_koef>>0,nW);if(cW<=0)cW=1;pGlyph.oBitmap.oGlyphData.checkColor(this.m_oBrush.Color1.R,this.m_oBrush.Color1.G,this.m_oBrush.Color1.B,nW,nH);pGlyph.oBitmap.drawCrop(this.m_oContext,nX,nY, cW,nH,cX)},private_FillGlyph2:function(pGlyph){var i=0;var j=0;var nW=pGlyph.oBitmap.nWidth;var nH=pGlyph.oBitmap.nHeight;if(0==nW||0==nH)return;var _font_manager=this.IsUseFonts2?this.m_oFontManager2:this.m_oFontManager;var nX=_font_manager.m_oGlyphString.m_fX+pGlyph.fX+pGlyph.oBitmap.nX>>0;var nY=_font_manager.m_oGlyphString.m_fY+pGlyph.fY-pGlyph.oBitmap.nY>>0;var imageData=this.m_oContext.getImageData(nX,nY,nW,nH);var pPixels=imageData.data;var _r=this.m_oBrush.Color1.R;var _g=this.m_oBrush.Color1.G; var _b=this.m_oBrush.Color1.B;for(;j<nH;++j){var indx=4*j*nW;for(i=0;i<nW;++i){var weight=pGlyph.oBitmap.pData[j*pGlyph.oBitmap.nWidth+i];if(255==weight){pPixels[indx]=_r;pPixels[indx+1]=_g;pPixels[indx+2]=_b;pPixels[indx+3]=255}else{var r=pPixels[indx];var g=pPixels[indx+1];var b=pPixels[indx+2];var a=pPixels[indx+3];pPixels[indx]=(_r-r)*weight+(r<<8)>>>8;pPixels[indx+1]=(_g-g)*weight+(g<<8)>>>8;pPixels[indx+2]=(_b-b)*weight+(b<<8)>>>8;pPixels[indx+3]=weight+a-(weight*a+256>>>8)}indx+=4}}this.m_oContext.putImageData(imageData, nX,nY)},SetIntegerGrid:function(param){if(true==param){this.m_bIntegerGrid=true;this.m_oContext.setTransform(1,0,0,1,0,0)}else{this.m_bIntegerGrid=false;this.m_oContext.setTransform(this.m_oFullTransform.sx,this.m_oFullTransform.shy,this.m_oFullTransform.shx,this.m_oFullTransform.sy,this.m_oFullTransform.tx,this.m_oFullTransform.ty)}},GetIntegerGrid:function(){return this.m_bIntegerGrid},DrawHeaderEdit:function(yPos,lock_type){var _y=this.m_oFullTransform.TransformPointY(0,yPos);_y=(_y>>0)+.5;var _x= 0;var _wmax=this.m_lWidthPix;var _w1=6;var _w2=3;var ctx=this.m_oContext;switch(lock_type){case AscCommon.locktype_None:case AscCommon.locktype_Mine:{this.p_color(155,187,277,255);ctx.lineWidth=2;break}case AscCommon.locktype_Other:case AscCommon.locktype_Other2:{this.p_color(238,53,37,255);ctx.lineWidth=1;_w1=2;_w2=1;break}default:{this.p_color(155,187,277,255);ctx.lineWidth=2;_w1=2;_w2=1}}if(true===this.m_bIntegerGrid){this._s();while(true){if(_x>_wmax)break;ctx.moveTo(_x,_y);_x+=_w1;ctx.lineTo(_x, _y);_x+=_w2}this.ds()}else{this.SetIntegerGrid(true);this._s();while(true){if(_x>_wmax)break;ctx.moveTo(_x,_y);_x+=_w1;ctx.lineTo(_x,_y);_x+=_w2}this.ds();this.SetIntegerGrid(false)}},DrawFooterEdit:function(yPos,lock_type){var _y=this.m_oFullTransform.TransformPointY(0,yPos);_y=(_y>>0)+.5;var _x=0;var _w1=6;var _w2=3;var ctx=this.m_oContext;switch(lock_type){case AscCommon.locktype_None:case AscCommon.locktype_Mine:{this.p_color(155,187,277,255);ctx.lineWidth=2;break}case AscCommon.locktype_Other:case AscCommon.locktype_Other2:{this.p_color(238, 53,37,255);ctx.lineWidth=1;_w1=2;_w2=1;break}default:{this.p_color(155,187,277,255);ctx.lineWidth=2;_w1=2;_w2=1}}var _wmax=this.m_lWidthPix;if(true===this.m_bIntegerGrid){this._s();while(true){if(_x>_wmax)break;ctx.moveTo(_x,_y);_x+=_w1;ctx.lineTo(_x,_y);_x+=_w2}this.ds()}else{this.SetIntegerGrid(true);this._s();while(true){if(_x>_wmax)break;ctx.moveTo(_x,_y);_x+=_w1;ctx.lineTo(_x,_y);_x+=_w2}this.ds();this.SetIntegerGrid(false)}},DrawLockParagraph:function(lock_type,x,y1,y2){if(lock_type==c_oAscLockTypes.kLockTypeNone|| editor.WordControl.m_oDrawingDocument.IsLockObjectsEnable===false||editor.isViewMode)return;if(lock_type==c_oAscLockTypes.kLockTypeMine)this.p_color(22,156,0,255);else this.p_color(238,53,37,255);var _x=this.m_oFullTransform.TransformPointX(x,y1)>>0;var _xT=this.m_oFullTransform.TransformPointX(x,y2)>>0;var _y1=(this.m_oFullTransform.TransformPointY(x,y1)>>0)+.5;var _y2=(this.m_oFullTransform.TransformPointY(x,y2)>>0)-1.5;var ctx=this.m_oContext;if(_x!=_xT){var dKoefMMToPx=1/Math.max(this.m_oCoordTransform.sx, .001);this.p_width(1E3*dKoefMMToPx);var w_dot=2*dKoefMMToPx;var w_dist=1*dKoefMMToPx;var w_len_indent=3;var _interf=editor.WordControl.m_oDrawingDocument.AutoShapesTrack;this._s();_interf.AddLineDash(ctx,x,y1,x,y2,w_dot,w_dist);_interf.AddLineDash(ctx,x,y1,x+w_len_indent,y1,w_dot,w_dist);_interf.AddLineDash(ctx,x,y2,x+w_len_indent,y2,w_dot,w_dist);this.ds();return}var bIsInt=this.m_bIntegerGrid;if(!bIsInt)this.SetIntegerGrid(true);ctx.lineWidth=1;var w_dot=2;var w_dist=1;var w_len_indent=3*this.m_oCoordTransform.sx>> 0;this._s();var y_mem=_y1-.5;while(true){if(y_mem+w_dot>_y2)break;ctx.moveTo(_x+.5,y_mem);y_mem+=w_dot;ctx.lineTo(_x+.5,y_mem);y_mem+=w_dist}var x_max=_x+w_len_indent;var x_mem=_x;while(true){if(x_mem>x_max)break;ctx.moveTo(x_mem,_y1);x_mem+=w_dot;ctx.lineTo(x_mem,_y1);x_mem+=w_dist}x_mem=_x;while(true){if(x_mem>x_max)break;ctx.moveTo(x_mem,_y2);x_mem+=w_dot;ctx.lineTo(x_mem,_y2);x_mem+=w_dist}this.ds();if(!bIsInt)this.SetIntegerGrid(false)},DrawLockObjectRect:function(lock_type,x,y,w,h){if(lock_type== c_oAscLockTypes.kLockTypeNone)return;if(lock_type==c_oAscLockTypes.kLockTypeMine)this.p_color(22,156,0,255);else this.p_color(238,53,37,255);var ctx=this.m_oContext;var _m=this.m_oTransform;if(_m.sx!=1||_m.shx!=0||_m.shy!=0||_m.sy!=1){var dKoefMMToPx=1/Math.max(this.m_oCoordTransform.sx,.001);this.p_width(1E3*dKoefMMToPx);var w_dot=2*dKoefMMToPx;var w_dist=1*dKoefMMToPx;var _interf=this.m_oAutoShapesTrack;var eps=5*dKoefMMToPx;var _x=x-eps;var _y=y-eps;var _r=x+w+eps;var _b=y+h+eps;this._s();_interf.AddRectDash(ctx, _x,_y,_r,_y,_x,_b,_r,_b,w_dot,w_dist,true);this._s();return}var bIsInt=this.m_bIntegerGrid;if(!bIsInt)this.SetIntegerGrid(true);ctx.lineWidth=1;var w_dot=2;var w_dist=2;var eps=5;var _x=(this.m_oFullTransform.TransformPointX(x,y)>>0)-eps+.5;var _y=(this.m_oFullTransform.TransformPointY(x,y)>>0)-eps+.5;var _r=(this.m_oFullTransform.TransformPointX(x+w,y+h)>>0)+eps+.5;var _b=(this.m_oFullTransform.TransformPointY(x+w,y+h)>>0)+eps+.5;this._s();for(var i=_x;i<_r;i+=w_dist){ctx.moveTo(i,_y);i+=w_dot;if(i> _r)i=_r;ctx.lineTo(i,_y)}for(var i=_y;i<_b;i+=w_dist){ctx.moveTo(_r,i);i+=w_dot;if(i>_b)i=_b;ctx.lineTo(_r,i)}for(var i=_r;i>_x;i-=w_dist){ctx.moveTo(i,_b);i-=w_dot;if(i<_x)i=_x;ctx.lineTo(i,_b)}for(var i=_b;i>_y;i-=w_dist){ctx.moveTo(_x,i);i-=w_dot;if(i<_y)i=_y;ctx.lineTo(_x,i)}this.ds();if(!bIsInt)this.SetIntegerGrid(false)},DrawEmptyTableLine:function(x1,y1,x2,y2){if(!editor.isShowTableEmptyLine)return;var _x1=this.m_oFullTransform.TransformPointX(x1,y1);var _y1=this.m_oFullTransform.TransformPointY(x1, y1);var _x2=this.m_oFullTransform.TransformPointX(x2,y2);var _y2=this.m_oFullTransform.TransformPointY(x2,y2);_x1=(_x1>>0)+.5;_y1=(_y1>>0)+.5;_x2=(_x2>>0)+.5;_y2=(_y2>>0)+.5;this.p_color(138,162,191,255);var ctx=this.m_oContext;if(_x1!=_x2&&_y1!=_y2){var dKoefMMToPx=1/Math.max(this.m_oCoordTransform.sx,.001);this.p_width(1E3*dKoefMMToPx);this._s();editor.WordControl.m_oDrawingDocument.AutoShapesTrack.AddLineDash(ctx,x1,y1,x2,y2,2*dKoefMMToPx,2*dKoefMMToPx);this.ds();return}ctx.lineWidth=1;var bIsInt= this.m_bIntegerGrid;if(!bIsInt)this.SetIntegerGrid(true);if(_x1==_x2){var _y=Math.min(_y1,_y2)+.5;var _w1=2;var _w2=2;var _wmax=Math.max(_y1,_y2)-.5;this._s();while(true){if(_y>_wmax)break;ctx.moveTo(_x1,_y);_y+=_w1;if(_y>_wmax)ctx.lineTo(_x1,_y-_w1+1);else ctx.lineTo(_x1,_y);_y+=_w2}this.ds()}else if(_y1==_y2){var _x=Math.min(_x1,_x2)+.5;var _w1=2;var _w2=2;var _wmax=Math.max(_x1,_x2)-.5;this._s();while(true){if(_x>_wmax)break;ctx.moveTo(_x,_y1);_x+=_w1;if(_x>_wmax)ctx.lineTo(_x-_w2+1,_y1);else ctx.lineTo(_x, _y1);_x+=_w2}this.ds()}else{this._s();editor.WordControl.m_oDrawingDocument.AutoShapesTrack.AddLineDash(ctx,_x1,_y1,_x2,_y2,2,2);this.ds()}if(!bIsInt)this.SetIntegerGrid(false)},drawHorLine:function(align,y,x,r,penW){var _check_transform=global_MatrixTransformer.IsIdentity2(this.m_oTransform);if(!this.m_bIntegerGrid||!_check_transform){if(_check_transform){this.SetIntegerGrid(true);this.drawHorLine(align,y,x,r,penW);this.SetIntegerGrid(false);return}this.p_width(penW*1E3);this._s();this._m(x,y);this._l(r, y);this.ds();return}var pen_w=this.m_dDpiX*penW/g_dKoef_in_to_mm+.5>>0;if(0==pen_w)pen_w=1;var _x=(this.m_oFullTransform.TransformPointX(x,y)>>0)+.5-.5;var _r=(this.m_oFullTransform.TransformPointX(r,y)>>0)+.5+.5;var ctx=this.m_oContext;ctx.setTransform(1,0,0,1,0,0);ctx.lineWidth=pen_w;switch(align){case 0:{var _top=(this.m_oFullTransform.TransformPointY(x,y)>>0)+.5;ctx.beginPath();ctx.moveTo(_x,_top+pen_w/2-.5);ctx.lineTo(_r,_top+pen_w/2-.5);ctx.stroke();break}case 1:{var _center=(this.m_oFullTransform.TransformPointY(x, y)>>0)+.5;ctx.beginPath();if(0==pen_w%2){ctx.moveTo(_x,_center-.5);ctx.lineTo(_r,_center-.5)}else{ctx.moveTo(_x,_center);ctx.lineTo(_r,_center)}ctx.stroke();break}case 2:{var _bottom=(this.m_oFullTransform.TransformPointY(x,y)>>0)+.5;ctx.beginPath();ctx.moveTo(_x,_bottom-pen_w/2+.5);ctx.lineTo(_r,_bottom-pen_w/2+.5);ctx.stroke();break}}},drawHorLine2:function(align,y,x,r,penW){var _check_transform=global_MatrixTransformer.IsIdentity2(this.m_oTransform);if(!this.m_bIntegerGrid||!_check_transform){if(_check_transform){this.SetIntegerGrid(true); this.drawHorLine2(align,y,x,r,penW);this.SetIntegerGrid(false);return}var _y1=y-penW/2;var _y2=_y1+2*penW;this.p_width(penW*1E3);this._s();this._m(x,_y1);this._l(r,_y1);this.ds();this._s();this._m(x,_y2);this._l(r,_y2);this.ds();return}var pen_w=this.m_dDpiX*penW/g_dKoef_in_to_mm+.5>>0;if(0==pen_w)pen_w=1;var _x=(this.m_oFullTransform.TransformPointX(x,y)>>0)+.5-.5;var _r=(this.m_oFullTransform.TransformPointX(r,y)>>0)+.5+.5;var ctx=this.m_oContext;ctx.lineWidth=pen_w;switch(align){case 0:{var _top= (this.m_oFullTransform.TransformPointY(x,y)>>0)+.5;var _pos1=_top+pen_w/2-.5-pen_w;var _pos2=_pos1+pen_w*2;ctx.beginPath();ctx.moveTo(_x,_pos1);ctx.lineTo(_r,_pos1);ctx.stroke();ctx.beginPath();ctx.moveTo(_x,_pos2);ctx.lineTo(_r,_pos2);ctx.stroke();break}case 1:{break}case 2:{break}}},drawVerLine:function(align,x,y,b,penW){var _check_transform=global_MatrixTransformer.IsIdentity2(this.m_oTransform);if(!this.m_bIntegerGrid||!_check_transform){if(_check_transform){this.SetIntegerGrid(true);this.drawVerLine(align, x,y,b,penW);this.SetIntegerGrid(false);return}this.p_width(penW*1E3);this._s();this._m(x,y);this._l(x,b);this.ds();return}var pen_w=this.m_dDpiX*penW/g_dKoef_in_to_mm+.5>>0;if(0==pen_w)pen_w=1;var _y=(this.m_oFullTransform.TransformPointY(x,y)>>0)+.5-.5;var _b=(this.m_oFullTransform.TransformPointY(x,b)>>0)+.5+.5;var ctx=this.m_oContext;ctx.lineWidth=pen_w;switch(align){case 0:{var _left=(this.m_oFullTransform.TransformPointX(x,y)>>0)+.5;ctx.beginPath();ctx.moveTo(_left+pen_w/2-.5,_y);ctx.lineTo(_left+ pen_w/2-.5,_b);ctx.stroke();break}case 1:{var _center=(this.m_oFullTransform.TransformPointX(x,y)>>0)+.5;ctx.beginPath();if(0==pen_w%2){ctx.moveTo(_center-.5,_y);ctx.lineTo(_center-.5,_b)}else{ctx.moveTo(_center,_y);ctx.lineTo(_center,_b)}ctx.stroke();break}case 2:{var _right=(this.m_oFullTransform.TransformPointX(x,y)>>0)+.5;ctx.beginPath();ctx.moveTo(_right-pen_w/2+.5,_y);ctx.lineTo(_right-pen_w/2+.5,_b);ctx.stroke();break}}},drawHorLineExt:function(align,y,x,r,penW,leftMW,rightMW){if(!this.m_bIntegerGrid){this.p_width(penW* 1E3);this._s();this._m(x,y);this._l(r,y);this.ds();return}var pen_w=Math.max(this.m_dDpiX*penW/g_dKoef_in_to_mm+.5>>0,1);var _x=(this.m_oFullTransform.TransformPointX(x,y)>>0)+.5;var _r=(this.m_oFullTransform.TransformPointX(r,y)>>0)+.5;if(leftMW!=0){var _center=_x;var pen_mw=Math.max(this.m_dDpiX*Math.abs(leftMW)*2/g_dKoef_in_to_mm+.5>>0,1);if(leftMW<0)if(pen_mw%2==0)_x=_center-pen_mw/2;else _x=_center-(pen_mw/2>>0);else if(pen_mw%2==0)_x=_center+(pen_mw/2-1);else _x=_center+(pen_mw/2>>0)}if(rightMW!= 0){var _center=_r;var pen_mw=Math.max(this.m_dDpiX*Math.abs(rightMW)*2/g_dKoef_in_to_mm+.5>>0,1);if(rightMW<0)if(pen_mw%2==0)_r=_center-pen_mw/2;else _r=_center-(pen_mw/2>>0);else if(pen_mw%2==0)_r=_center+pen_mw/2-1;else _r=_center+(pen_mw/2>>0)}var ctx=this.m_oContext;ctx.lineWidth=pen_w;_x-=.5;_r+=.5;switch(align){case 0:{var _top=(this.m_oFullTransform.TransformPointY(x,y)>>0)+.5;ctx.beginPath();ctx.moveTo(_x,_top+pen_w/2-.5);ctx.lineTo(_r,_top+pen_w/2-.5);ctx.stroke();break}case 1:{var _center= (this.m_oFullTransform.TransformPointY(x,y)>>0)+.5;ctx.beginPath();if(0==pen_w%2){ctx.moveTo(_x,_center-.5);ctx.lineTo(_r,_center-.5)}else{ctx.moveTo(_x,_center);ctx.lineTo(_r,_center)}ctx.stroke();break}case 2:{var _bottom=(this.m_oFullTransform.TransformPointY(x,y)>>0)+.5;ctx.beginPath();ctx.moveTo(_x,_bottom-pen_w/2+.5);ctx.lineTo(_r,_bottom-pen_w/2+.5);ctx.stroke();break}}},rect:function(x,y,w,h){var ctx=this.m_oContext;ctx.beginPath();if(this.m_bIntegerGrid){var _x=this.m_oFullTransform.TransformPointX(x, y)+.5>>0;var _y=this.m_oFullTransform.TransformPointY(x,y)+.5>>0;var _r=this.m_oFullTransform.TransformPointX(x+w,y)+.5>>0;var _b=this.m_oFullTransform.TransformPointY(x,y+h)+.5>>0;ctx.rect(_x,_y,_r-_x,_b-_y)}else ctx.rect(x,y,w,h)},TableRect:function(x,y,w,h){var ctx=this.m_oContext;if(this.m_bIntegerGrid){var _x=(this.m_oFullTransform.TransformPointX(x,y)>>0)+.5;var _y=(this.m_oFullTransform.TransformPointY(x,y)>>0)+.5;var _r=(this.m_oFullTransform.TransformPointX(x+w,y)>>0)+.5;var _b=(this.m_oFullTransform.TransformPointY(x, y+h)>>0)+.5;ctx.fillRect(_x-.5,_y-.5,_r-_x+1,_b-_y+1)}else ctx.fillRect(x,y,w,h)},AddClipRect:function(x,y,w,h){var __rect=new AscCommon._rect;__rect.x=x;__rect.y=y;__rect.w=w;__rect.h=h;this.GrState.AddClipRect(__rect)},RemoveClipRect:function(){},AddSmartRect:function(x,y,w,h,pen_w){if(!global_MatrixTransformer.IsIdentity2(this.m_oTransform)){var r=x+w;var b=y+h;var dx1=this.m_oFullTransform.TransformPointX(x,y);var dy1=this.m_oFullTransform.TransformPointY(x,y);var dx2=this.m_oFullTransform.TransformPointX(r, y);var dy2=this.m_oFullTransform.TransformPointY(r,y);var dx3=this.m_oFullTransform.TransformPointX(x,b);var dy3=this.m_oFullTransform.TransformPointY(x,b);var dx4=this.m_oFullTransform.TransformPointX(r,b);var dy4=this.m_oFullTransform.TransformPointY(r,b);var _eps=.001;var bIsClever=false;var _type=1;if(Math.abs(dx1-dx3)<_eps&&Math.abs(dx2-dx4)<_eps&&Math.abs(dy1-dy2)<_eps&&Math.abs(dy3-dy4)<_eps){bIsClever=true;_type=1}if(!bIsClever&&Math.abs(dx1-dx2)<_eps&&Math.abs(dx3-dx4)<_eps&&Math.abs(dy1- dy3)<_eps&&Math.abs(dy2-dy4)<_eps){_type=2;bIsClever=true}if(!bIsClever){this.ds();return}var _xI=_type==1?Math.min(dx1,dx2):Math.min(dx1,dx3);var _rI=_type==1?Math.max(dx1,dx2):Math.max(dx1,dx3);var _yI=_type==1?Math.min(dy1,dy3):Math.min(dy1,dy2);var _bI=_type==1?Math.max(dy1,dy3):Math.max(dy1,dy2);var bIsSmartAttack=false;if(!this.m_bIntegerGrid){this.SetIntegerGrid(true);bIsSmartAttack=true;if(this.dash_no_smart){for(var index=0;index<this.dash_no_smart.length;index++)this.dash_no_smart[index]= this.m_oCoordTransform.sx*this.dash_no_smart[index]+.5>>0;this.m_oContext.setLineDash(this.dash_no_smart);this.dash_no_smart=null}}var _pen_w=pen_w*this.m_oCoordTransform.sx+.5>>0;if(0>=_pen_w)_pen_w=1;this._s();if((_pen_w&1)==1){var _x=(_xI>>0)+.5;var _y=(_yI>>0)+.5;var _r=(_rI>>0)+.5;var _b=(_bI>>0)+.5;this.m_oContext.rect(_x,_y,_r-_x,_b-_y)}else{var _x=_xI+.5>>0;var _y=_yI+.5>>0;var _r=_rI+.5>>0;var _b=_bI+.5>>0;this.m_oContext.rect(_x,_y,_r-_x,_b-_y)}this.m_oContext.lineWidth=_pen_w;this.ds(); if(bIsSmartAttack)this.SetIntegerGrid(false);return}var bIsSmartAttack=false;if(!this.m_bIntegerGrid){this.SetIntegerGrid(true);bIsSmartAttack=true;if(this.dash_no_smart){for(var index=0;index<this.dash_no_smart.length;index++)this.dash_no_smart[index]=this.m_oCoordTransform.sx*this.dash_no_smart[index]+.5>>0;this.m_oContext.setLineDash(this.dash_no_smart);this.dash_no_smart=null}}var _pen_w=pen_w*this.m_oCoordTransform.sx+.5>>0;if(0>=_pen_w)_pen_w=1;this._s();if((_pen_w&1)==1){var _x=(this.m_oFullTransform.TransformPointX(x, y)>>0)+.5;var _y=(this.m_oFullTransform.TransformPointY(x,y)>>0)+.5;var _r=(this.m_oFullTransform.TransformPointX(x+w,y+h)>>0)+.5;var _b=(this.m_oFullTransform.TransformPointY(x+w,y+h)>>0)+.5;this.m_oContext.rect(_x,_y,_r-_x,_b-_y)}else{var _x=this.m_oFullTransform.TransformPointX(x,y)+.5>>0;var _y=this.m_oFullTransform.TransformPointY(x,y)+.5>>0;var _r=this.m_oFullTransform.TransformPointX(x+w,y+h)+.5>>0;var _b=this.m_oFullTransform.TransformPointY(x+w,y+h)+.5>>0;this.m_oContext.rect(_x,_y,_r-_x, _b-_y)}this.m_oContext.lineWidth=_pen_w;this.ds();if(bIsSmartAttack)this.SetIntegerGrid(false)},SetClip:function(r){var ctx=this.m_oContext;ctx.save();ctx.beginPath();if(!global_MatrixTransformer.IsIdentity(this.m_oTransform))ctx.rect(r.x,r.y,r.w,r.h);else{var _x=this.m_oFullTransform.TransformPointX(r.x,r.y)+1>>0;var _y=this.m_oFullTransform.TransformPointY(r.x,r.y)+1>>0;var _r=this.m_oFullTransform.TransformPointX(r.x+r.w,r.y)-1>>0;var _b=this.m_oFullTransform.TransformPointY(r.x,r.y+r.h)-1>>0; ctx.rect(_x,_y,_r-_x+1,_b-_y+1)}this.clip();ctx.beginPath()},RemoveClip:function(){this.m_oContext.restore();this.m_oContext.save();if(this.m_oContext.globalAlpha!=this.globalAlpha)this.m_oContext.globalAlpha=this.globalAlpha},drawCollaborativeChanges:function(x,y,w,h){this.b_color1(0,255,0,64);this.rect(x,y,w,h);this.df()},drawSearchResult:function(x,y,w,h){this.b_color1(255,220,0,200);this.rect(x,y,w,h);this.df()},drawFlowAnchor:function(x,y){if(!AscCommon.g_flow_anchor||!AscCommon.g_flow_anchor.asc_complete|| (!editor||!editor.ShowParaMarks))return;if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(1,0,0,1,0,0);var _x=this.m_oFullTransform.TransformPointX(x,y)>>0;var _y=this.m_oFullTransform.TransformPointY(x,y)>>0;this.m_oContext.drawImage(AscCommon.g_flow_anchor,_x,_y);if(false===this.m_bIntegerGrid)this.m_oContext.setTransform(this.m_oFullTransform.sx,this.m_oFullTransform.shy,this.m_oFullTransform.shx,this.m_oFullTransform.sy,this.m_oFullTransform.tx,this.m_oFullTransform.ty)},SavePen:function(){this.GrState.SavePen()}, RestorePen:function(){this.GrState.RestorePen()},SaveBrush:function(){this.GrState.SaveBrush()},RestoreBrush:function(){this.GrState.RestoreBrush()},SavePenBrush:function(){this.GrState.SavePenBrush()},RestorePenBrush:function(){this.GrState.RestorePenBrush()},SaveGrState:function(){this.GrState.SaveGrState()},RestoreGrState:function(){this.GrState.RestoreGrState()},StartClipPath:function(){},EndClipPath:function(){this.m_oContext.clip()},StartCheckTableDraw:function(){if(!this.m_bIntegerGrid&&global_MatrixTransformer.IsIdentity2(this.m_oTransform)){this.SaveGrState(); this.SetIntegerGrid(true);return true}return false},EndCheckTableDraw:function(bIsRestore){if(bIsRestore)this.RestoreGrState()},SetTextClipRect:function(_l,_t,_r,_b){this.TextClipRect={l:_l*this.m_oCoordTransform.sx>>0,t:_t*this.m_oCoordTransform.sy>>0,r:_r*this.m_oCoordTransform.sx>>0,b:_b*this.m_oCoordTransform.sy>>0}}};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CGraphics=CGraphics})(window);"use strict";(function(window,undefined){var getFullImageSrc2=AscCommon.getFullImageSrc2; var CShapeColor=AscFormat.CShapeColor;var c_oAscFill=Asc.c_oAscFill;function DrawLineEnd(xEnd,yEnd,xPrev,yPrev,type,w,len,drawer,trans){switch(type){case AscFormat.LineEndType.None:break;case AscFormat.LineEndType.Arrow:{var _ex=xPrev-xEnd;var _ey=yPrev-yEnd;var _elen=Math.sqrt(_ex*_ex+_ey*_ey);_ex/=_elen;_ey/=_elen;var _vx=_ey;var _vy=-_ex;var tmpx=xEnd+len*_ex;var tmpy=yEnd+len*_ey;var x1=tmpx+_vx*w/2;var y1=tmpy+_vy*w/2;var x3=tmpx-_vx*w/2;var y3=tmpy-_vy*w/2;drawer._s();drawer._m(trans.TransformPointX(x1, y1),trans.TransformPointY(x1,y1));drawer._l(trans.TransformPointX(xEnd,yEnd),trans.TransformPointY(xEnd,yEnd));drawer._l(trans.TransformPointX(x3,y3),trans.TransformPointY(x3,y3));drawer.ds();drawer._e();break}case AscFormat.LineEndType.Diamond:{var _ex=xPrev-xEnd;var _ey=yPrev-yEnd;var _elen=Math.sqrt(_ex*_ex+_ey*_ey);_ex/=_elen;_ey/=_elen;var _vx=_ey;var _vy=-_ex;var tmpx=xEnd+len/2*_ex;var tmpy=yEnd+len/2*_ey;var x1=xEnd+_vx*w/2;var y1=yEnd+_vy*w/2;var x3=xEnd-_vx*w/2;var y3=yEnd-_vy*w/2;var tmpx2= xEnd-len/2*_ex;var tmpy2=yEnd-len/2*_ey;drawer._s();drawer._m(trans.TransformPointX(tmpx,tmpy),trans.TransformPointY(tmpx,tmpy));drawer._l(trans.TransformPointX(x1,y1),trans.TransformPointY(x1,y1));drawer._l(trans.TransformPointX(tmpx2,tmpy2),trans.TransformPointY(tmpx2,tmpy2));drawer._l(trans.TransformPointX(x3,y3),trans.TransformPointY(x3,y3));drawer._z();drawer.drawStrokeFillStyle();drawer._e();drawer._s();drawer._m(trans.TransformPointX(tmpx,tmpy),trans.TransformPointY(tmpx,tmpy));drawer._l(trans.TransformPointX(x1, y1),trans.TransformPointY(x1,y1));drawer._l(trans.TransformPointX(tmpx2,tmpy2),trans.TransformPointY(tmpx2,tmpy2));drawer._l(trans.TransformPointX(x3,y3),trans.TransformPointY(x3,y3));drawer._z();drawer.ds();drawer._e();break}case AscFormat.LineEndType.Oval:{var _ex=xPrev-xEnd;var _ey=yPrev-yEnd;var _elen=Math.sqrt(_ex*_ex+_ey*_ey);_ex/=_elen;_ey/=_elen;var _vx=_ey;var _vy=-_ex;var tmpx=xEnd+len/2*_ex;var tmpy=yEnd+len/2*_ey;var tmpx2=xEnd-len/2*_ex;var tmpy2=yEnd-len/2*_ey;var cx1=tmpx+_vx*3*w/4; var cy1=tmpy+_vy*3*w/4;var cx2=tmpx2+_vx*3*w/4;var cy2=tmpy2+_vy*3*w/4;var cx3=tmpx-_vx*3*w/4;var cy3=tmpy-_vy*3*w/4;var cx4=tmpx2-_vx*3*w/4;var cy4=tmpy2-_vy*3*w/4;drawer._s();drawer._m(trans.TransformPointX(tmpx,tmpy),trans.TransformPointY(tmpx,tmpy));drawer._c(trans.TransformPointX(cx1,cy1),trans.TransformPointY(cx1,cy1),trans.TransformPointX(cx2,cy2),trans.TransformPointY(cx2,cy2),trans.TransformPointX(tmpx2,tmpy2),trans.TransformPointY(tmpx2,tmpy2));drawer._c(trans.TransformPointX(cx4,cy4),trans.TransformPointY(cx4, cy4),trans.TransformPointX(cx3,cy3),trans.TransformPointY(cx3,cy3),trans.TransformPointX(tmpx,tmpy),trans.TransformPointY(tmpx,tmpy));drawer.drawStrokeFillStyle();drawer._e();drawer._s();drawer._m(trans.TransformPointX(tmpx,tmpy),trans.TransformPointY(tmpx,tmpy));drawer._c(trans.TransformPointX(cx1,cy1),trans.TransformPointY(cx1,cy1),trans.TransformPointX(cx2,cy2),trans.TransformPointY(cx2,cy2),trans.TransformPointX(tmpx2,tmpy2),trans.TransformPointY(tmpx2,tmpy2));drawer._c(trans.TransformPointX(cx4, cy4),trans.TransformPointY(cx4,cy4),trans.TransformPointX(cx3,cy3),trans.TransformPointY(cx3,cy3),trans.TransformPointX(tmpx,tmpy),trans.TransformPointY(tmpx,tmpy));drawer.ds();drawer._e();break}case AscFormat.LineEndType.Stealth:{var _ex=xPrev-xEnd;var _ey=yPrev-yEnd;var _elen=Math.sqrt(_ex*_ex+_ey*_ey);_ex/=_elen;_ey/=_elen;var _vx=_ey;var _vy=-_ex;var tmpx=xEnd+len*_ex;var tmpy=yEnd+len*_ey;var x1=tmpx+_vx*w/2;var y1=tmpy+_vy*w/2;var x3=tmpx-_vx*w/2;var y3=tmpy-_vy*w/2;var x4=xEnd+(len-w/2)*_ex; var y4=yEnd+(len-w/2)*_ey;drawer._s();drawer._m(trans.TransformPointX(x1,y1),trans.TransformPointY(x1,y1));drawer._l(trans.TransformPointX(xEnd,yEnd),trans.TransformPointY(xEnd,yEnd));drawer._l(trans.TransformPointX(x3,y3),trans.TransformPointY(x3,y3));drawer._l(trans.TransformPointX(x4,y4),trans.TransformPointY(x4,y4));drawer._z();drawer.drawStrokeFillStyle();drawer._e();drawer._s();drawer._m(trans.TransformPointX(x1,y1),trans.TransformPointY(x1,y1));drawer._l(trans.TransformPointX(xEnd,yEnd),trans.TransformPointY(xEnd, yEnd));drawer._l(trans.TransformPointX(x3,y3),trans.TransformPointY(x3,y3));drawer._l(trans.TransformPointX(x4,y4),trans.TransformPointY(x4,y4));drawer._z();drawer.ds();drawer._e();break}case AscFormat.LineEndType.Triangle:{var _ex=xPrev-xEnd;var _ey=yPrev-yEnd;var _elen=Math.sqrt(_ex*_ex+_ey*_ey);_ex/=_elen;_ey/=_elen;var _vx=_ey;var _vy=-_ex;var tmpx=xEnd+len*_ex;var tmpy=yEnd+len*_ey;var x1=tmpx+_vx*w/2;var y1=tmpy+_vy*w/2;var x3=tmpx-_vx*w/2;var y3=tmpy-_vy*w/2;drawer._s();drawer._m(trans.TransformPointX(x1, y1),trans.TransformPointY(x1,y1));drawer._l(trans.TransformPointX(xEnd,yEnd),trans.TransformPointY(xEnd,yEnd));drawer._l(trans.TransformPointX(x3,y3),trans.TransformPointY(x3,y3));drawer._z();drawer.drawStrokeFillStyle();drawer._e();drawer._s();drawer._m(trans.TransformPointX(x1,y1),trans.TransformPointY(x1,y1));drawer._l(trans.TransformPointX(xEnd,yEnd),trans.TransformPointY(xEnd,yEnd));drawer._l(trans.TransformPointX(x3,y3),trans.TransformPointY(x3,y3));drawer._z();drawer.ds();drawer._e();break}}} function CShapeDrawer(){this.Shape=null;this.Graphics=null;this.UniFill=null;this.Ln=null;this.Transform=null;this.bIsTexture=false;this.bIsNoFillAttack=false;this.bIsNoStrokeAttack=false;this.bDrawSmartAttack=false;this.FillUniColor=null;this.StrokeUniColor=null;this.StrokeWidth=0;this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535;this.OldLineJoin=null;this.IsArrowsDrawing=false;this.IsCurrentPathCanArrows=true;this.bIsCheckBounds=false;this.IsRectShape=false}CShapeDrawer.prototype= {Clear:function(){this.UniFill=null;this.Ln=null;this.Transform=null;this.bIsTexture=false;this.bIsNoFillAttack=false;this.bIsNoStrokeAttack=false;this.FillUniColor=null;this.StrokeUniColor=null;this.StrokeWidth=0;this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535;this.OldLineJoin=null;this.IsArrowsDrawing=false;this.IsCurrentPathCanArrows=true;this.bIsCheckBounds=false;this.IsRectShape=false},CheckPoint:function(_x,_y){var x=_x;var y=_y;if(false&&this.Graphics.MaxEpsLine!==undefined){x= this.Graphics.Graphics.m_oFullTransform.TransformPointX(_x,_y);y=this.Graphics.Graphics.m_oFullTransform.TransformPointY(_x,_y)}if(x<this.min_x)this.min_x=x;if(y<this.min_y)this.min_y=y;if(x>this.max_x)this.max_x=x;if(y>this.max_y)this.max_y=y},CheckDash:function(){if(this.Ln.prstDash!=null&&AscCommon.DashPatternPresets[this.Ln.prstDash]){var _arr=AscCommon.DashPatternPresets[this.Ln.prstDash].slice();for(var indexD=0;indexD<_arr.length;indexD++)_arr[indexD]*=this.StrokeWidth;this.Graphics.p_dash(_arr)}}, fromShape2:function(shape,graphics,geom){this.fromShape(shape,graphics);if(!geom)this.IsRectShape=true;else if(geom.preset=="rect")this.IsRectShape=true},fromShape:function(shape,graphics){this.IsRectShape=false;this.Shape=shape;this.Graphics=graphics;this.UniFill=shape.brush;this.Ln=shape.pen;this.Transform=shape.TransformMatrix;this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535;var bIsCheckBounds=false;if(this.UniFill==null||this.UniFill.fill==null)this.bIsNoFillAttack=true;else{var _fill= this.UniFill.fill;switch(_fill.type){case c_oAscFill.FILL_TYPE_BLIP:{this.bIsTexture=true;break}case c_oAscFill.FILL_TYPE_SOLID:{if(_fill.color)this.FillUniColor=_fill.color.RGBA;else this.FillUniColor=(new AscFormat.CUniColor).RGBA;break}case c_oAscFill.FILL_TYPE_GRAD:{var _c=_fill.colors;if(_c.length==0)this.FillUniColor=(new AscFormat.CUniColor).RGBA;else if(_fill.colors[0].color)this.FillUniColor=_fill.colors[0].color.RGBA;else this.FillUniColor=(new AscFormat.CUniColor).RGBA;bIsCheckBounds=true; break}case c_oAscFill.FILL_TYPE_PATT:{bIsCheckBounds=true;break}case c_oAscFill.FILL_TYPE_NOFILL:{this.bIsNoFillAttack=true;break}default:{this.bIsNoFillAttack=true;break}}}if(this.Ln==null||this.Ln.Fill==null||this.Ln.Fill.fill==null){this.bIsNoStrokeAttack=true;if(true===graphics.IsTrack)graphics.Graphics.ArrayPoints=null;else graphics.ArrayPoints=null}else{var _fill=this.Ln.Fill.fill;switch(_fill.type){case c_oAscFill.FILL_TYPE_BLIP:{this.StrokeUniColor=(new AscFormat.CUniColor).RGBA;break}case c_oAscFill.FILL_TYPE_SOLID:{if(_fill.color)this.StrokeUniColor= _fill.color.RGBA;else this.StrokeUniColor=(new AscFormat.CUniColor).RGBA;break}case c_oAscFill.FILL_TYPE_GRAD:{var _c=_fill.colors;if(_c==0)this.StrokeUniColor=(new AscFormat.CUniColor).RGBA;else if(_fill.colors[0].color)this.StrokeUniColor=_fill.colors[0].color.RGBA;else this.StrokeUniColor=(new AscFormat.CUniColor).RGBA;break}case c_oAscFill.FILL_TYPE_PATT:{if(_fill.fgClr)this.StrokeUniColor=_fill.fgClr.RGBA;else this.StrokeUniColor=(new AscFormat.CUniColor).RGBA;break}case c_oAscFill.FILL_TYPE_NOFILL:{this.bIsNoStrokeAttack= true;break}default:{this.bIsNoStrokeAttack=true;break}}this.StrokeWidth=this.Ln.w==null?12700:parseInt(this.Ln.w);this.StrokeWidth/=36E3;this.p_width(1E3*this.StrokeWidth);this.CheckDash();if(graphics.IsSlideBoundsCheckerType&&!this.bIsNoStrokeAttack)graphics.LineWidth=this.StrokeWidth;var isUseArrayPoints=false;if(this.Ln.headEnd!=null&&this.Ln.headEnd.type!=null||this.Ln.tailEnd!=null&&this.Ln.tailEnd.type!=null)isUseArrayPoints=true;if(true===graphics.IsTrack&&graphics.Graphics!=undefined&&graphics.Graphics!= null)graphics.Graphics.ArrayPoints=isUseArrayPoints?[]:null;else graphics.ArrayPoints=isUseArrayPoints?[]:null;if(this.Graphics.m_oContext!=null&&this.Ln.Join!=null&&this.Ln.Join.type!=null)this.OldLineJoin=this.Graphics.m_oContext.lineJoin}if(this.bIsTexture||bIsCheckBounds){this.bIsCheckBounds=true;this.check_bounds();this.bIsCheckBounds=false}},draw:function(geom){if(this.bIsNoStrokeAttack&&this.bIsNoFillAttack)return;var bIsPatt=false;if(this.UniFill!=null&&this.UniFill.fill!=null&&(this.UniFill.fill.type== c_oAscFill.FILL_TYPE_PATT||this.UniFill.fill.type==c_oAscFill.FILL_TYPE_GRAD))bIsPatt=true;if(this.Graphics.RENDERER_PDF_FLAG&&(this.bIsTexture||bIsPatt)){this.Graphics.put_TextureBoundsEnabled(true);this.Graphics.put_TextureBounds(this.min_x,this.min_y,this.max_x-this.min_x,this.max_y-this.min_y)}var _old_composite=null;if(this.Graphics.ClearMode===true){_old_composite=this.Graphics.m_oContext.globalCompositeOperation;this.Graphics.m_oContext.globalCompositeOperation="destination-out"}if(geom)geom.draw(this); else{this._s();this._m(0,0);this._l(this.Shape.extX,0);this._l(this.Shape.extX,this.Shape.extY);this._l(0,this.Shape.extY);this._z();this.drawFillStroke(true,"norm",true&&!this.bIsNoStrokeAttack);this._e()}this.Graphics.ArrayPoints=null;if(this.Graphics.RENDERER_PDF_FLAG&&(this.bIsTexture||bIsPatt))this.Graphics.put_TextureBoundsEnabled(false);if(this.Graphics.IsSlideBoundsCheckerType&&this.Graphics.AutoCheckLineWidth)this.Graphics.CorrectBounds2();if(this.Graphics.ClearMode===true)this.Graphics.m_oContext.globalCompositeOperation= _old_composite;this.Graphics.p_dash(null)},p_width:function(w){this.Graphics.p_width(w)},_m:function(x,y){if(this.bIsCheckBounds){this.CheckPoint(x,y);return}this.Graphics._m(x,y)},_l:function(x,y){if(this.bIsCheckBounds){this.CheckPoint(x,y);return}this.Graphics._l(x,y)},_c:function(x1,y1,x2,y2,x3,y3){if(this.bIsCheckBounds){this.CheckPoint(x1,y1);this.CheckPoint(x2,y2);this.CheckPoint(x3,y3);return}this.Graphics._c(x1,y1,x2,y2,x3,y3)},_c2:function(x1,y1,x2,y2){if(this.bIsCheckBounds){this.CheckPoint(x1, y1);this.CheckPoint(x2,y2);return}this.Graphics._c2(x1,y1,x2,y2)},_z:function(){this.IsCurrentPathCanArrows=false;if(this.bIsCheckBounds)return;this.Graphics._z()},_s:function(){this.IsCurrentPathCanArrows=true;this.Graphics._s();if(this.Graphics.ArrayPoints!=null)this.Graphics.ArrayPoints=[]},_e:function(){this.IsCurrentPathCanArrows=true;this.Graphics._e();if(this.Graphics.ArrayPoints!=null)this.Graphics.ArrayPoints=[]},df:function(mode){if(mode=="none"||this.bIsNoFillAttack)return;if(this.Graphics.IsTrack)this.Graphics.m_oOverlay.ClearAll= true;if(this.Graphics.IsSlideBoundsCheckerType===true)return;var editorInfo=this.getEditorInfo();var bIsIntegerGridTRUE=false;if(this.bIsTexture){if(this.Graphics.m_bIntegerGrid===true){this.Graphics.SetIntegerGrid(false);bIsIntegerGridTRUE=true}if(this.Graphics.RENDERER_PDF_FLAG){if(null==this.UniFill.fill.tile||this.Graphics.m_oContext===undefined)this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId),0);else this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId), 1);if(bIsIntegerGridTRUE)this.Graphics.SetIntegerGrid(true);return}var bIsUnusePattern=false;if(AscCommon.AscBrowser.isIE)if(this.UniFill.fill.RasterImageId)if(this.UniFill.fill.RasterImageId.lastIndexOf(".svg")==this.UniFill.fill.RasterImageId.length-4)bIsUnusePattern=true;if(bIsUnusePattern||null==this.UniFill.fill.tile||this.Graphics.m_oContext===undefined)if(this.IsRectShape)if(null==this.UniFill.transparent||this.UniFill.transparent==255)this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x,this.min_y,this.max_x-this.min_x,this.max_y-this.min_y,undefined,this.UniFill.fill.srcRect,this.UniFill.fill.canvas);else{var _old_global_alpha=this.Graphics.m_oContext.globalAlpha;this.Graphics.m_oContext.globalAlpha=this.UniFill.transparent/255;this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId),this.min_x,this.min_y,this.max_x-this.min_x,this.max_y-this.min_y,undefined,this.UniFill.fill.srcRect,this.UniFill.fill.canvas);this.Graphics.m_oContext.globalAlpha=_old_global_alpha}else{this.Graphics.save(); this.Graphics.clip();if(this.Graphics.IsNoSupportTextDraw==true||true==this.Graphics.IsTrack||null==this.UniFill.transparent||this.UniFill.transparent==255)this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId),this.min_x,this.min_y,this.max_x-this.min_x,this.max_y-this.min_y,undefined,this.UniFill.fill.srcRect,this.UniFill.fill.canvas);else{var _old_global_alpha=this.Graphics.m_oContext.globalAlpha;this.Graphics.m_oContext.globalAlpha=this.UniFill.transparent/255;this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x,this.min_y,this.max_x-this.min_x,this.max_y-this.min_y,undefined,this.UniFill.fill.srcRect,this.UniFill.fill.canvas);this.Graphics.m_oContext.globalAlpha=_old_global_alpha}this.Graphics.restore()}else{var _img=editorInfo.editor.ImageLoader.map_image_index[getFullImageSrc2(this.UniFill.fill.RasterImageId)];var _img_native=this.UniFill.fill.canvas;if(!_img_native&&(_img==undefined||_img.Image==null||_img.Status==AscFonts.ImageLoadStatus.Loading)){this.Graphics.save();this.Graphics.clip(); if(this.Graphics.IsNoSupportTextDraw===true||true==this.Graphics.IsTrack||null==this.UniFill.transparent||this.UniFill.transparent==255)this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId),this.min_x,this.min_y,this.max_x-this.min_x,this.max_y-this.min_y);else{var _old_global_alpha=this.Graphics.m_oContext.globalAlpha;this.Graphics.m_oContext.globalAlpha=this.UniFill.transparent/255;this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId),this.min_x,this.min_y, this.max_x-this.min_x,this.max_y-this.min_y);this.Graphics.m_oContext.globalAlpha=_old_global_alpha}this.Graphics.restore()}else{var _is_ctx=false;if(this.Graphics.IsNoSupportTextDraw===true||undefined===this.Graphics.m_oContext||null==this.UniFill.transparent||this.UniFill.transparent==255)_is_ctx=false;else _is_ctx=true;var _gr=this.Graphics.IsTrack===true?this.Graphics.Graphics:this.Graphics;var _ctx=_gr.m_oContext;var patt=!_img_native?_ctx.createPattern(_img.Image,"repeat"):_ctx.createPattern(_img_native, "repeat");_ctx.save();var __graphics=this.Graphics.MaxEpsLine===undefined?this.Graphics:this.Graphics.Graphics;var bIsThumbnail=__graphics.IsThumbnail===true?true:false;var koefX=editorInfo.scale;var koefY=editorInfo.scale;if(bIsThumbnail){koefX=__graphics.m_dDpiX/AscCommon.g_dDpiX;koefY=__graphics.m_dDpiY/AscCommon.g_dDpiX;koefX/=AscCommon.AscBrowser.retinaPixelRatio;koefY/=AscCommon.AscBrowser.retinaPixelRatio}_ctx.translate(this.min_x,this.min_y);_ctx.scale(koefX*__graphics.TextureFillTransformScaleX, koefY*__graphics.TextureFillTransformScaleY);if(_is_ctx===true){var _old_global_alpha=_ctx.globalAlpha;_ctx.globalAlpha=this.UniFill.transparent/255;_ctx.fillStyle=patt;_ctx.fill();_ctx.globalAlpha=_old_global_alpha}else{_ctx.fillStyle=patt;_ctx.fill()}_ctx.restore();_gr.m_bPenColorInit=false;_gr.m_bBrushColorInit=false}}if(bIsIntegerGridTRUE)this.Graphics.SetIntegerGrid(true);return}if(this.UniFill!=null&&this.UniFill.fill!=null){var _fill=this.UniFill.fill;if(_fill.type==c_oAscFill.FILL_TYPE_PATT){if(this.Graphics.m_bIntegerGrid=== true){this.Graphics.SetIntegerGrid(false);bIsIntegerGridTRUE=true}var _is_ctx=false;if(this.Graphics.IsNoSupportTextDraw===true||undefined===this.Graphics.m_oContext||null==this.UniFill.transparent||this.UniFill.transparent==255)_is_ctx=false;else _is_ctx=true;var _gr=this.Graphics.IsTrack===true?this.Graphics.Graphics:this.Graphics;var _ctx=_gr.m_oContext;var _patt_name=AscCommon.global_hatch_names[_fill.ftype];if(undefined==_patt_name)_patt_name="cross";var _fc=_fill.fgClr&&_fill.fgClr.RGBA||{R:0, G:0,B:0,A:255};var _bc=_fill.bgClr&&_fill.bgClr.RGBA||{R:255,G:255,B:255,A:255};var __fa=null===this.UniFill.transparent?_fc.A:255;var __ba=null===this.UniFill.transparent?_bc.A:255;var _test_pattern=AscCommon.GetHatchBrush(_patt_name,_fc.R,_fc.G,_fc.B,__fa,_bc.R,_bc.G,_bc.B,__ba);var patt=_ctx.createPattern(_test_pattern.Canvas,"repeat");_ctx.save();var koefX=editorInfo.scale;var koefY=editorInfo.scale;if(this.Graphics.IsThumbnail){koefX=1;koefY=1}_ctx.translate(this.min_x,this.min_y);if(this.Graphics.MaxEpsLine=== undefined)_ctx.scale(koefX*this.Graphics.TextureFillTransformScaleX,koefY*this.Graphics.TextureFillTransformScaleY);else _ctx.scale(koefX*this.Graphics.Graphics.TextureFillTransformScaleX,koefY*this.Graphics.Graphics.TextureFillTransformScaleY);if(_is_ctx===true){var _old_global_alpha=_ctx.globalAlpha;if(null!=this.UniFill.transparent)_ctx.globalAlpha=this.UniFill.transparent/255;_ctx.fillStyle=patt;_ctx.fill();_ctx.globalAlpha=_old_global_alpha}else{_ctx.fillStyle=patt;_ctx.fill()}_ctx.restore(); _gr.m_bPenColorInit=false;_gr.m_bBrushColorInit=false;if(bIsIntegerGridTRUE)this.Graphics.SetIntegerGrid(true);return}else if(_fill.type==c_oAscFill.FILL_TYPE_GRAD){if(this.Graphics.m_bIntegerGrid===true){this.Graphics.SetIntegerGrid(false);bIsIntegerGridTRUE=true}var _is_ctx=false;if(this.Graphics.IsNoSupportTextDraw===true||undefined===this.Graphics.m_oContext||null==this.UniFill.transparent||this.UniFill.transparent==255)_is_ctx=false;else _is_ctx=true;var _gr=this.Graphics.IsTrack===true?this.Graphics.Graphics: this.Graphics;var _ctx=_gr.m_oContext;var gradObj=null;if(_fill.lin){var _angle=_fill.lin.angle;if(_fill.rotateWithShape===false){var matrix_transform=this.Graphics.IsTrack===true?this.Graphics.Graphics.m_oTransform:this.Graphics.m_oTransform;if(matrix_transform)_angle=AscCommon.GradientGetAngleNoRotate(_angle,matrix_transform)}var points=this.getGradientPoints(this.min_x,this.min_y,this.max_x,this.max_y,_angle,_fill.lin.scale);gradObj=_ctx.createLinearGradient(points.x0,points.y0,points.x1,points.y1)}else if(_fill.path){var _cx= (this.min_x+this.max_x)/2;var _cy=(this.min_y+this.max_y)/2;var _r=Math.max(this.max_x-this.min_x,this.max_y-this.min_y)/2;gradObj=_ctx.createRadialGradient(_cx,_cy,1,_cx,_cy,_r)}else{var points=this.getGradientPoints(this.min_x,this.min_y,this.max_x,this.max_y,0,false);gradObj=_ctx.createLinearGradient(points.x0,points.y0,points.x1,points.y1)}for(var i=0;i<_fill.colors.length;i++)gradObj.addColorStop(_fill.colors[i].pos/1E5,_fill.colors[i].color.getCSSColor(this.UniFill.transparent));_ctx.fillStyle= gradObj;if(null!==this.UniFill.transparent&&undefined!==this.UniFill.transparent){var _old_global_alpha=this.Graphics.m_oContext.globalAlpha;_ctx.globalAlpha=this.UniFill.transparent/255;_ctx.fill();_ctx.globalAlpha=_old_global_alpha}else _ctx.fill();_gr.m_bPenColorInit=false;_gr.m_bBrushColorInit=false;if(bIsIntegerGridTRUE)this.Graphics.SetIntegerGrid(true);return}}var rgba=this.FillUniColor;if(mode=="darken"){var _color1=new CShapeColor(rgba.R,rgba.G,rgba.B);var rgb=_color1.darken();rgba={R:rgb.r, G:rgb.g,B:rgb.b,A:rgba.A}}else if(mode=="darkenLess"){var _color1=new CShapeColor(rgba.R,rgba.G,rgba.B);var rgb=_color1.darkenLess();rgba={R:rgb.r,G:rgb.g,B:rgb.b,A:rgba.A}}else if(mode=="lighten"){var _color1=new CShapeColor(rgba.R,rgba.G,rgba.B);var rgb=_color1.lighten();rgba={R:rgb.r,G:rgb.g,B:rgb.b,A:rgba.A}}else if(mode=="lightenLess"){var _color1=new CShapeColor(rgba.R,rgba.G,rgba.B);var rgb=_color1.lightenLess();rgba={R:rgb.r,G:rgb.g,B:rgb.b,A:rgba.A}}if(rgba){if(this.UniFill!=null&&this.UniFill.transparent!= null&&this.Graphics.ClearMode!==true)rgba.A=this.UniFill.transparent;this.Graphics.b_color1(rgba.R,rgba.G,rgba.B,rgba.A)}this.Graphics.df()},ds:function(){if(this.bIsNoStrokeAttack)return;if(this.Graphics.IsTrack)this.Graphics.m_oOverlay.ClearAll=true;if(null!=this.OldLineJoin&&!this.IsArrowsDrawing)switch(this.Ln.Join.type){case AscFormat.LineJoinType.Round:{this.Graphics.m_oContext.lineJoin="round";break}case AscFormat.LineJoinType.Bevel:{this.Graphics.m_oContext.lineJoin="bevel";break}case AscFormat.LineJoinType.Empty:{this.Graphics.m_oContext.lineJoin= "miter";break}case AscFormat.LineJoinType.Miter:{this.Graphics.m_oContext.lineJoin="miter";break}}var arr=this.Graphics.IsTrack===true?this.Graphics.Graphics.ArrayPoints:this.Graphics.ArrayPoints;var isArrowsPresent=arr!=null&&arr.length>1&&this.IsCurrentPathCanArrows===true?true:false;var rgba=this.StrokeUniColor;if(this.Ln&&this.Ln.Fill!=null&&this.Ln.Fill.transparent!=null&&!isArrowsPresent)rgba.A=this.Ln.Fill.transparent;this.Graphics.p_color(rgba.R,rgba.G,rgba.B,rgba.A);if(this.IsRectShape&& this.Graphics.AddSmartRect!==undefined)if(undefined!==this.Shape.extX)this.Graphics.AddSmartRect(0,0,this.Shape.extX,this.Shape.extY,this.StrokeWidth);else this.Graphics.ds();else this.Graphics.ds();if(null!=this.OldLineJoin&&!this.IsArrowsDrawing)this.Graphics.m_oContext.lineJoin=this.OldLineJoin;if(isArrowsPresent){this.IsArrowsDrawing=true;this.Graphics.p_dash(null);var _graphicsCtx=this.Graphics.IsTrack===true?this.Graphics.Graphics:this.Graphics;var trans=_graphicsCtx.m_oFullTransform;var trans1= AscCommon.global_MatrixTransformer.Invert(trans);var x1=trans.TransformPointX(0,0);var y1=trans.TransformPointY(0,0);var x2=trans.TransformPointX(1,1);var y2=trans.TransformPointY(1,1);var dKoef=Math.sqrt(((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))/2);var _pen_w=this.Graphics.IsTrack===true?this.Graphics.Graphics.m_oContext.lineWidth*dKoef:this.Graphics.m_oContext.lineWidth*dKoef;var _max_w=undefined;if(_graphicsCtx.IsThumbnail===true)_max_w=2;var _max_delta_eps2=.001;var arrKoef=this.isArrPix?1/AscCommon.g_dKoef_mm_to_pix: 1;if(this.Ln.headEnd!=null){var _x1=trans.TransformPointX(arr[0].x,arr[0].y);var _y1=trans.TransformPointY(arr[0].x,arr[0].y);var _x2=trans.TransformPointX(arr[1].x,arr[1].y);var _y2=trans.TransformPointY(arr[1].x,arr[1].y);var _max_delta_eps=Math.max(this.Ln.headEnd.GetLen(_pen_w),5);var _max_delta=Math.max(Math.abs(_x1-_x2),Math.abs(_y1-_y2));var cur_point=2;while(_max_delta<_max_delta_eps&&cur_point<arr.length){_x2=trans.TransformPointX(arr[cur_point].x,arr[cur_point].y);_y2=trans.TransformPointY(arr[cur_point].x, arr[cur_point].y);_max_delta=Math.max(Math.abs(_x1-_x2),Math.abs(_y1-_y2));cur_point++}if(_max_delta>_max_delta_eps2){_graphicsCtx.ArrayPoints=null;DrawLineEnd(_x1,_y1,_x2,_y2,this.Ln.headEnd.type,arrKoef*this.Ln.headEnd.GetWidth(_pen_w,_max_w),arrKoef*this.Ln.headEnd.GetLen(_pen_w,_max_w),this,trans1);_graphicsCtx.ArrayPoints=arr}}if(this.Ln.tailEnd!=null){var _1=arr.length-1;var _2=arr.length-2;var _x1=trans.TransformPointX(arr[_1].x,arr[_1].y);var _y1=trans.TransformPointY(arr[_1].x,arr[_1].y); var _x2=trans.TransformPointX(arr[_2].x,arr[_2].y);var _y2=trans.TransformPointY(arr[_2].x,arr[_2].y);var _max_delta_eps=Math.max(this.Ln.tailEnd.GetLen(_pen_w),5);var _max_delta=Math.max(Math.abs(_x1-_x2),Math.abs(_y1-_y2));var cur_point=_2-1;while(_max_delta<_max_delta_eps&&cur_point>=0){_x2=trans.TransformPointX(arr[cur_point].x,arr[cur_point].y);_y2=trans.TransformPointY(arr[cur_point].x,arr[cur_point].y);_max_delta=Math.max(Math.abs(_x1-_x2),Math.abs(_y1-_y2));cur_point--}if(_max_delta>_max_delta_eps2){_graphicsCtx.ArrayPoints= null;DrawLineEnd(_x1,_y1,_x2,_y2,this.Ln.tailEnd.type,arrKoef*this.Ln.tailEnd.GetWidth(_pen_w,_max_w),arrKoef*this.Ln.tailEnd.GetLen(_pen_w,_max_w),this,trans1);_graphicsCtx.ArrayPoints=arr}}this.IsArrowsDrawing=false;this.CheckDash()}},drawFillStroke:function(bIsFill,fill_mode,bIsStroke){if(this.Graphics.IsTrack)this.Graphics.m_oOverlay.ClearAll=true;if(this.Graphics.IsSlideBoundsCheckerType)return;if(this.Graphics.RENDERER_PDF_FLAG===undefined){if(bIsFill)this.df(fill_mode);if(bIsStroke)this.ds()}else{if(this.bIsNoStrokeAttack)bIsStroke= false;var arr=this.Graphics.ArrayPoints;var isArrowsPresent=arr!=null&&arr.length>1&&this.IsCurrentPathCanArrows===true?true:false;if(bIsStroke){if(null!=this.OldLineJoin&&!this.IsArrowsDrawing)this.Graphics.put_PenLineJoin(AscFormat.ConvertJoinAggType(this.Ln.Join.type));var rgba=this.StrokeUniColor;if(this.Ln&&this.Ln.Fill!=null&&this.Ln.Fill.transparent!=null&&!isArrowsPresent)rgba.A=this.Ln.Fill.transparent;this.Graphics.p_color(rgba.R,rgba.G,rgba.B,rgba.A)}if(fill_mode=="none"||this.bIsNoFillAttack)bIsFill= false;var bIsPattern=false;if(bIsFill)if(this.bIsTexture){if(null==this.UniFill.fill.tile)if(null==this.UniFill.fill.srcRect)if(this.UniFill.fill.RasterImageId&&this.UniFill.fill.RasterImageId.indexOf(".svg")!=0)this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId),0);else if(this.UniFill.fill.canvas)this.Graphics.put_brushTexture(this.UniFill.fill.canvas.toDataURL("image/png"),0);else this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId),0);else if(this.IsRectShape){this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x,this.min_y,this.max_x-this.min_x,this.max_y-this.min_y,undefined,this.UniFill.fill.srcRect);bIsFill=false}else this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId),0);else if(this.UniFill.fill.canvas)this.Graphics.put_brushTexture(this.UniFill.fill.canvas.toDataURL("image/png"),1);else this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId),1);this.Graphics.put_BrushTextureAlpha(this.UniFill.transparent)}else{var _fill=this.UniFill.fill; if(_fill.type==c_oAscFill.FILL_TYPE_PATT){var _patt_name=AscCommon.global_hatch_names[_fill.ftype];if(undefined==_patt_name)_patt_name="cross";var _fc=_fill.fgClr&&_fill.fgClr.RGBA||{R:0,G:0,B:0,A:255};var _bc=_fill.bgClr&&_fill.bgClr.RGBA||{R:255,G:255,B:255,A:255};var __fa=null===this.UniFill.transparent?_fc.A:255;var __ba=null===this.UniFill.transparent?_bc.A:255;var _pattern=AscCommon.GetHatchBrush(_patt_name,_fc.R,_fc.G,_fc.B,__fa,_bc.R,_bc.G,_bc.B,__ba);var _url64="";try{_url64=_pattern.toDataURL()}catch(err){_url64= ""}this.Graphics.put_brushTexture(_url64,1);if(null!=this.UniFill.transparent)this.Graphics.put_BrushTextureAlpha(this.UniFill.transparent);else this.Graphics.put_BrushTextureAlpha(255);bIsPattern=true}else if(_fill.type==c_oAscFill.FILL_TYPE_GRAD){var points=null;if(_fill.lin){var _angle=_fill.lin.angle;if(_fill.rotateWithShape===false&&this.Graphics.m_oTransform)_angle=AscCommon.GradientGetAngleNoRotate(_angle,this.Graphics.m_oTransform);points=this.getGradientPoints(this.min_x,this.min_y,this.max_x, this.max_y,_angle,_fill.lin.scale)}else if(_fill.path){var _cx=(this.min_x+this.max_x)/2;var _cy=(this.min_y+this.max_y)/2;var _r=Math.max(this.max_x-this.min_x,this.max_y-this.min_y)/2;points={x0:_cx,y0:_cy,x1:_cx,y1:_cy,r0:1,r1:_r}}else points=this.getGradientPoints(this.min_x,this.min_y,this.max_x,this.max_y,0,false);this.Graphics.put_BrushGradient(_fill,points,this.UniFill.transparent)}else{var rgba=this.FillUniColor;if(fill_mode=="darken"){var _color1=new CShapeColor(rgba.R,rgba.G,rgba.B);var rgb= _color1.darken();rgba={R:rgb.r,G:rgb.g,B:rgb.b,A:rgba.A}}else if(fill_mode=="darkenLess"){var _color1=new CShapeColor(rgba.R,rgba.G,rgba.B);var rgb=_color1.darkenLess();rgba={R:rgb.r,G:rgb.g,B:rgb.b,A:rgba.A}}else if(fill_mode=="lighten"){var _color1=new CShapeColor(rgba.R,rgba.G,rgba.B);var rgb=_color1.lighten();rgba={R:rgb.r,G:rgb.g,B:rgb.b,A:rgba.A}}else if(fill_mode=="lightenLess"){var _color1=new CShapeColor(rgba.R,rgba.G,rgba.B);var rgb=_color1.lightenLess();rgba={R:rgb.r,G:rgb.g,B:rgb.b,A:rgba.A}}if(rgba){if(this.UniFill!= null&&this.UniFill.transparent!=null&&this.Graphics.ClearMode!==true)rgba.A=this.UniFill.transparent;this.Graphics.b_color1(rgba.R,rgba.G,rgba.B,rgba.A)}}}if(bIsFill&&bIsStroke)if(this.bIsTexture||bIsPattern){this.Graphics.drawpath(256);this.Graphics.drawpath(1)}else this.Graphics.drawpath(256+1);else if(bIsFill)this.Graphics.drawpath(256);else if(bIsStroke)this.Graphics.drawpath(1);else if(false){this.Graphics.b_color1(0,0,0,0);this.Graphics.drawpath(256)}if(isArrowsPresent){this.IsArrowsDrawing= true;this.Graphics.p_dash(null);var trans=this.Graphics.RENDERER_PDF_FLAG===undefined?this.Graphics.m_oFullTransform:this.Graphics.GetTransform();var trans1=AscCommon.global_MatrixTransformer.Invert(trans);var lineSize=this.Graphics.RENDERER_PDF_FLAG===undefined?this.Graphics.m_oContext.lineWidth:this.Graphics.GetLineWidth();var x1=trans.TransformPointX(0,0);var y1=trans.TransformPointY(0,0);var x2=trans.TransformPointX(1,1);var y2=trans.TransformPointY(1,1);var dKoef=Math.sqrt(((x2-x1)*(x2-x1)+(y2- y1)*(y2-y1))/2);var _pen_w=lineSize*dKoef;var _pen_w_max=2.5/AscCommon.g_dKoef_mm_to_pix;if(this.Ln.headEnd!=null){var _x1=trans.TransformPointX(arr[0].x,arr[0].y);var _y1=trans.TransformPointY(arr[0].x,arr[0].y);var _x2=trans.TransformPointX(arr[1].x,arr[1].y);var _y2=trans.TransformPointY(arr[1].x,arr[1].y);var _max_delta=Math.max(Math.abs(_x1-_x2),Math.abs(_y1-_y2));var cur_point=2;while(_max_delta<.001&&cur_point<arr.length){_x2=trans.TransformPointX(arr[cur_point].x,arr[cur_point].y);_y2=trans.TransformPointY(arr[cur_point].x, arr[cur_point].y);_max_delta=Math.max(Math.abs(_x1-_x2),Math.abs(_y1-_y2));cur_point++}if(_max_delta>.001){this.Graphics.ArrayPoints=null;DrawLineEnd(_x1,_y1,_x2,_y2,this.Ln.headEnd.type,this.Ln.headEnd.GetWidth(_pen_w,_pen_w_max),this.Ln.headEnd.GetLen(_pen_w,_pen_w_max),this,trans1);this.Graphics.ArrayPoints=arr}}if(this.Ln.tailEnd!=null){var _1=arr.length-1;var _2=arr.length-2;var _x1=trans.TransformPointX(arr[_1].x,arr[_1].y);var _y1=trans.TransformPointY(arr[_1].x,arr[_1].y);var _x2=trans.TransformPointX(arr[_2].x, arr[_2].y);var _y2=trans.TransformPointY(arr[_2].x,arr[_2].y);var _max_delta=Math.max(Math.abs(_x1-_x2),Math.abs(_y1-_y2));var cur_point=_2-1;while(_max_delta<.001&&cur_point>=0){_x2=trans.TransformPointX(arr[cur_point].x,arr[cur_point].y);_y2=trans.TransformPointY(arr[cur_point].x,arr[cur_point].y);_max_delta=Math.max(Math.abs(_x1-_x2),Math.abs(_y1-_y2));cur_point--}if(_max_delta>.001){this.Graphics.ArrayPoints=null;DrawLineEnd(_x1,_y1,_x2,_y2,this.Ln.tailEnd.type,this.Ln.tailEnd.GetWidth(_pen_w, _pen_w_max),this.Ln.tailEnd.GetLen(_pen_w,_pen_w_max),this,trans1);this.Graphics.ArrayPoints=arr}}this.IsArrowsDrawing=false;this.CheckDash()}}},drawStrokeFillStyle:function(){if(this.Graphics.RENDERER_PDF_FLAG===undefined){var gr=this.Graphics.IsTrack==true?this.Graphics.Graphics:this.Graphics;var tmp=gr.m_oBrush.Color1;var p_c=gr.m_oPen.Color;gr.b_color1(p_c.R,p_c.G,p_c.B,p_c.A);gr.df();gr.b_color1(tmp.R,tmp.G,tmp.B,tmp.A)}else{var tmp=this.Graphics.GetBrush().Color1;var p_c=this.Graphics.GetPen().Color; this.Graphics.b_color1(p_c.R,p_c.G,p_c.B,p_c.A);this.Graphics.df();this.Graphics.b_color1(tmp.R,tmp.G,tmp.B,tmp.A)}},check_bounds:function(){this.Shape.check_bounds(this)},getNormalPoint:function(x0,y0,angle,x1,y1){var ex1=Math.cos(angle);var ey1=Math.sin(angle);var ex2=-ey1;var ey2=ex1;var a=ex1/ey1;var b=ex2/ey2;var x=(a*b*y1-a*b*y0-(a*x1-b*x0))/(b-a);var y=(x-x0)/a+y0;return{X:x,Y:y}},getGradientPoints:function(min_x,min_y,max_x,max_y,_angle,scale){var points={x0:0,y0:0,x1:0,y1:0};var angle=_angle/ 6E4;while(angle<0)angle+=360;while(angle>=360)angle-=360;if(Math.abs(angle)<1){points.x0=min_x;points.y0=min_y;points.x1=max_x;points.y1=min_y;return points}else if(Math.abs(angle-90)<1){points.x0=min_x;points.y0=min_y;points.x1=min_x;points.y1=max_y;return points}else if(Math.abs(angle-180)<1){points.x0=max_x;points.y0=min_y;points.x1=min_x;points.y1=min_y;return points}else if(Math.abs(angle-270)<1){points.x0=min_x;points.y0=max_y;points.x1=min_x;points.y1=min_y;return points}var grad_a=AscCommon.deg2rad(angle); if(!scale){if(angle>0&&angle<90){var p=this.getNormalPoint(min_x,min_y,grad_a,max_x,max_y);points.x0=min_x;points.y0=min_y;points.x1=p.X;points.y1=p.Y;return points}if(angle>90&&angle<180){var p=this.getNormalPoint(max_x,min_y,grad_a,min_x,max_y);points.x0=max_x;points.y0=min_y;points.x1=p.X;points.y1=p.Y;return points}if(angle>180&&angle<270){var p=this.getNormalPoint(max_x,max_y,grad_a,min_x,min_y);points.x0=max_x;points.y0=max_y;points.x1=p.X;points.y1=p.Y;return points}if(angle>270&&angle<360){var p= this.getNormalPoint(min_x,max_y,grad_a,max_x,min_y);points.x0=min_x;points.y0=max_y;points.x1=p.X;points.y1=p.Y;return points}return points}var _grad_45=Math.PI/2-Math.atan2(max_y-min_y,max_x-min_x);var _grad_90_45=Math.PI/2-_grad_45;if(angle>0&&angle<90){if(angle<=45)grad_a=_grad_45*angle/45;else grad_a=_grad_45+_grad_90_45*(angle-45)/45;var p=this.getNormalPoint(min_x,min_y,grad_a,max_x,max_y);points.x0=min_x;points.y0=min_y;points.x1=p.X;points.y1=p.Y;return points}if(angle>90&&angle<180){if(angle<= 135)grad_a=Math.PI/2+_grad_90_45*(angle-90)/45;else grad_a=Math.PI-_grad_45*(angle-135)/45;var p=this.getNormalPoint(max_x,min_y,grad_a,min_x,max_y);points.x0=max_x;points.y0=min_y;points.x1=p.X;points.y1=p.Y;return points}if(angle>180&&angle<270){if(angle<=225)grad_a=Math.PI+_grad_45*(angle-180)/45;else grad_a=3*Math.PI/2-_grad_90_45*(angle-225)/45;var p=this.getNormalPoint(max_x,max_y,grad_a,min_x,min_y);points.x0=max_x;points.y0=max_y;points.x1=p.X;points.y1=p.Y;return points}if(angle>270&&angle< 360){if(angle<=315)grad_a=3*Math.PI/2+_grad_90_45*(angle-270)/45;else grad_a=2*Math.PI-_grad_45*(angle-315)/45;var p=this.getNormalPoint(min_x,max_y,grad_a,max_x,min_y);points.x0=min_x;points.y0=max_y;points.x1=p.X;points.y1=p.Y;return points}return points},DrawPresentationComment:function(type,x,y,w,h){},getEditorInfo:function(){var _ret={};_ret.editor=Asc.editor||window.editor;switch(_ret.editor.editorId){case AscCommon.c_oEditorId.Word:case AscCommon.c_oEditorId.Presentation:{_ret.scale=_ret.editor.WordControl.m_nZoomValue/ 100;break}case AscCommon.c_oEditorId.Spreadsheet:{_ret.scale=_ret.editor.asc_getZoom();break}default:break}return _ret}};function ShapeToImageConverter(shape,pageIndex){AscCommon.IsShapeToImageConverter=true;var _bounds_cheker=new AscFormat.CSlideBoundsChecker;var dKoef=AscCommon.g_dKoef_mm_to_pix;var w_mm=210;var h_mm=297;var w_px=w_mm*dKoef>>0;var h_px=h_mm*dKoef>>0;_bounds_cheker.init(w_px,h_px,w_mm,h_mm);_bounds_cheker.transform(1,0,0,1,0,0);_bounds_cheker.AutoCheckLineWidth=true;_bounds_cheker.CheckLineWidth(shape); shape.draw(_bounds_cheker,0);_bounds_cheker.CorrectBounds2();var _need_pix_width=_bounds_cheker.Bounds.max_x-_bounds_cheker.Bounds.min_x+1;var _need_pix_height=_bounds_cheker.Bounds.max_y-_bounds_cheker.Bounds.min_y+1;if(_need_pix_width<=0||_need_pix_height<=0)return null;var _canvas=document.createElement("canvas");_canvas.width=_need_pix_width>>0;_canvas.height=_need_pix_height>>0;var _ctx=_canvas.getContext("2d");var g=new AscCommon.CGraphics;g.init(_ctx,w_px,h_px,w_mm,h_mm);g.m_oFontManager=AscCommon.g_fontManager; g.m_oCoordTransform.tx=-_bounds_cheker.Bounds.min_x;g.m_oCoordTransform.ty=-_bounds_cheker.Bounds.min_y;g.transform(1,0,0,1,0,0);shape.draw(g,0);AscCommon.IsShapeToImageConverter=false;var _ret={ImageNative:_canvas,ImageUrl:""};try{_ret.ImageUrl=_canvas.toDataURL("image/png")}catch(err){if(shape.brush!=null&&shape.brush.fill&&shape.brush.fill.RasterImageId)_ret.ImageUrl=getFullImageSrc2(shape.brush.fill.RasterImageId);else _ret.ImageUrl=""}return _ret}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CShapeDrawer= CShapeDrawer;window["AscCommon"].ShapeToImageConverter=ShapeToImageConverter;window["AscCommon"].IsShapeToImageConverter=false})(window);"use strict";(function(window,undefined){var CColor=AscCommon.CColor;var g_oTextMeasurer=AscCommon.g_oTextMeasurer;var History=AscCommon.History;var global_MatrixTransformer=AscCommon.global_MatrixTransformer;var g_dKoef_pix_to_mm=AscCommon.g_dKoef_pix_to_mm;var g_dKoef_mm_to_pix=AscCommon.g_dKoef_mm_to_pix;function CDrawingPage(){this.left=0;this.top=0;this.right= 0;this.bottom=0;this.cachedImage=null}function CDrawingDocument(){this.IsLockObjectsEnable=false;AscCommon.g_oHtmlCursor.register("de-markerformat","marker_format","14 8","pointer");AscCommon.g_oHtmlCursor.register("select-table-row","select_row","10 5","default");AscCommon.g_oHtmlCursor.register("select-table-column","select_column","5 10","default");AscCommon.g_oHtmlCursor.register("select-table-content","select_table","10 10","default");this.m_oWordControl=null;this.m_oLogicDocument=null;this.m_oDocumentRenderer= null;this.m_arrPages=[];this.m_lPagesCount=0;this.m_lDrawingFirst=-1;this.m_lDrawingEnd=-1;this.m_lCurrentPage=-1;this.m_lCountCalculatePages=0;this.m_lTimerTargetId=-1;this.m_dTargetX=-1;this.m_dTargetY=-1;this.m_lTargetPage=-1;this.m_dTargetSize=1;this.NeedScrollToTarget=true;this.NeedScrollToTargetFlag=false;this.TargetHtmlElement=null;this.TargetHtmlElementLeft=0;this.TargetHtmlElementTop=0;this.m_bIsBreakRecalculate=false;this.m_bIsSelection=false;this.m_bIsSearching=false;this.m_lCountRect= 0;this.MathTrack=new AscCommon.CMathTrack;this.CurrentSearchNavi=null;this.SearchTransform=null;this.m_lTimerUpdateTargetID=-1;this.m_tempX=0;this.m_tempY=0;this.m_tempPageIndex=0;var oThis=this;this.m_sLockedCursorType="";this.m_lCurrentRendererPage=-1;this.m_oDocRenderer=null;this.m_bOldShowMarks=false;this.UpdateTargetFromPaint=false;this.UpdateTargetCheck=false;this.NeedTarget=true;this.TextMatrix=null;this.TargetShowFlag=false;this.TargetShowNeedFlag=false;this.CanvasHit=document.createElement("canvas"); this.CanvasHit.width=10;this.CanvasHit.height=10;this.CanvasHitContext=this.CanvasHit.getContext("2d");this.TargetCursorColor={R:0,G:0,B:0};this.GuiControlColorsMap=null;this.IsSendStandartColors=false;this.GuiCanvasFillTextureParentId="";this.GuiCanvasFillTexture=null;this.GuiCanvasFillTextureCtx=null;this.LastDrawingUrl="";this.GuiCanvasFillTextureParentIdTextArt="";this.GuiCanvasFillTextureTextArt=null;this.GuiCanvasFillTextureCtxTextArt=null;this.LastDrawingUrlTextArt="";this.SelectionMatrix= null;this.GuiCanvasTextProps=null;this.GuiCanvasTextPropsId="gui_textprops_canvas_id";this.GuiLastTextProps=null;this.TableStylesLastLook=null;this.LastParagraphMargins=null;this.AutoShapesTrack=null;this.AutoShapesTrackLockPageNum=-1;this.Overlay=null;this.IsTextMatrixUse=false;this.getDrawingObjects=function(){var oWs=Asc.editor.wb.getWorksheet();if(oWs)return oWs.objectRender;return null};this.Start_CollaborationEditing=function(){};this.SetCursorType=function(sType,Data){};this.LockCursorType= function(sType){};this.LockCursorTypeCur=function(){};this.UnlockCursorType=function(){};this.OnStartRecalculate=function(pageCount){};this.OnRepaintPage=function(index){};this.OnRecalculatePage=function(index,pageObject){};this.OnEndRecalculate=function(isFull,isBreak){};this.ChangePageAttack=function(pageIndex){};this.StartRenderingPage=function(pageIndex){};this.IsFreezePage=function(pageIndex){return true};this.RenderDocument=function(Renderer){};this.ToRenderer=function(){return""};this.ToRenderer2= function(){var ret="";return ret};this.ToRendererPart=function(){};this.StopRenderingPage=function(pageIndex){};this.ClearCachePages=function(){};this.CheckRasterImageOnScreen=function(src){};this.FirePaint=function(){};this.ConvertCoordsFromCursor=function(x,y,bIsRul){return{X:0,Y:0,Page:-1,DrawPage:-1}};this.ConvertCoordsFromCursorPage=function(x,y,page,bIsRul){return{X:0,Y:0,Page:-1,DrawPage:-1}};this.ConvertCoordsToAnotherPage=function(x,y,pageCoord,pageNeed){return{X:0,Y:0,Error:true}};this.ConvertCoordsFromCursor2= function(x,y,bIsRul,bIsNoNormalize,_zoomVal){return{X:0,Y:0,Page:-1,DrawPage:-1}};this.ConvetToPageCoords=function(x,y,pageIndex){return{X:0,Y:0,Page:pageIndex,Error:true}};this.IsCursorInTableCur=function(x,y,page){return false};this.ConvertCoordsToCursorWR=function(x,y,pageIndex,transform){return{X:0,Y:0,Error:true}};this.ConvertCoordsToCursor=function(x,y,pageIndex,bIsRul){return{X:0,Y:0,Error:true}};this.ConvertCoordsToCursor2=function(x,y,pageIndex,bIsRul){return{X:0,Y:0,Error:true}};this.ConvertCoordsToCursor3= function(x,y,pageIndex){return{X:0,Y:0,Error:true}};this.InitViewer=function(){};this.TargetStart=function(){if(this.m_lTimerTargetId!=-1)clearInterval(this.m_lTimerTargetId);this.m_lTimerTargetId=setInterval(oThis.DrawTarget,500)};this.TargetEnd=function(){this.TargetShowFlag=false;this.TargetShowNeedFlag=false;if(this.m_lTimerTargetId!=-1){clearInterval(this.m_lTimerTargetId);this.m_lTimerTargetId=-1}this.TargetHtmlElement.style.display="none"};this.UpdateTargetNoAttack=function(){};this.GetTargetStyle= function(){return"rgb("+this.TargetCursorColor.R+","+this.TargetCursorColor.G+","+this.TargetCursorColor.B+")"};this.SetTargetColor=function(r,g,b){this.TargetCursorColor.R=r;this.TargetCursorColor.G=g;this.TargetCursorColor.B=b};this.CheckTargetDraw=function(x,y){var drawingObjects=this.getDrawingObjects();if(!drawingObjects)return;var _oldW=this.TargetHtmlElement.width;var _oldH=this.TargetHtmlElement.height;var dKoef=drawingObjects.convertMetric(1,3,0);var _newW=2;var _newH=this.m_dTargetSize* dKoef;var _offX=0;var _offY=0;if(this.AutoShapesTrack&&this.AutoShapesTrack.Graphics&&this.AutoShapesTrack.Graphics.m_oCoordTransform){_offX=this.AutoShapesTrack.Graphics.m_oCoordTransform.tx;_offY=this.AutoShapesTrack.Graphics.m_oCoordTransform.ty}var targetPosX=0;var targetPosY=0;if(null!=this.TextMatrix&&!global_MatrixTransformer.IsIdentity2(this.TextMatrix)){var _x1=this.TextMatrix.TransformPointX(x,y);var _y1=this.TextMatrix.TransformPointY(x,y);var _x2=this.TextMatrix.TransformPointX(x,y+this.m_dTargetSize); var _y2=this.TextMatrix.TransformPointY(x,y+this.m_dTargetSize);var pos1={X:_offX+dKoef*_x1,Y:_offY+dKoef*_y1};var pos2={X:_offX+dKoef*_x2,Y:_offY+dKoef*_y2};_newW=(Math.abs(pos1.X-pos2.X)>>0)+1>>1<<1;_newH=(Math.abs(pos1.Y-pos2.Y)>>0)+1>>1<<1;if(2>_newW)_newW=2;if(2>_newH)_newH=2;if(_oldW==_newW&&_oldH==_newH)this.TargetHtmlElement.width=_newW;else{this.TargetHtmlElement.style.width=AscCommon.AscBrowser.convertToRetinaValue(_newW,false)+"px";this.TargetHtmlElement.style.height=AscCommon.AscBrowser.convertToRetinaValue(_newH, false)+"px";this.TargetHtmlElement.width=_newW;this.TargetHtmlElement.height=_newH}var ctx=this.TargetHtmlElement.getContext("2d");if(_newW==2||_newH==2){ctx.fillStyle=this.GetTargetStyle();ctx.fillRect(0,0,_newW,_newH)}else{ctx.beginPath();ctx.strokeStyle=this.GetTargetStyle();ctx.lineWidth=2;if((pos1.X-pos2.X)*(pos1.Y-pos2.Y)>=0){ctx.moveTo(0,0);ctx.lineTo(_newW,_newH)}else{ctx.moveTo(0,_newH);ctx.lineTo(_newW,0)}ctx.stroke()}targetPosX=AscCommon.AscBrowser.convertToRetinaValue(Math.min(pos1.X, pos2.X),false);targetPosY=AscCommon.AscBrowser.convertToRetinaValue(Math.min(pos1.Y,pos2.Y),false);this.TargetHtmlElementLeft=targetPosX;this.TargetHtmlElementTop=targetPosY;this.TargetHtmlElement.style.left=targetPosX+"px";this.TargetHtmlElement.style.top=targetPosY+"px"}else{if(_oldW==_newW&&_oldH==_newH)this.TargetHtmlElement.width=_newW;else{this.TargetHtmlElement.style.width=AscCommon.AscBrowser.convertToRetinaValue(_newW,false)+"px";this.TargetHtmlElement.style.height=AscCommon.AscBrowser.convertToRetinaValue(_newH, false)+"px";this.TargetHtmlElement.width=_newW;this.TargetHtmlElement.height=_newH}var ctx=this.TargetHtmlElement.getContext("2d");ctx.fillStyle=this.GetTargetStyle();ctx.fillRect(0,0,_newW,_newH);if(null!=this.TextMatrix){x+=this.TextMatrix.tx;y+=this.TextMatrix.ty}var pos={X:_offX+dKoef*x,Y:_offY+dKoef*y};targetPosX=AscCommon.AscBrowser.convertToRetinaValue(pos.X,false);targetPosY=AscCommon.AscBrowser.convertToRetinaValue(pos.Y,false);this.TargetHtmlElementLeft=targetPosX;this.TargetHtmlElementTop= targetPosY;this.TargetHtmlElement.style.left=targetPosX+"px";this.TargetHtmlElement.style.top=targetPosY+"px"}if(AscCommon.g_inputContext)AscCommon.g_inputContext.move(targetPosX,targetPosY)};this.UpdateTargetTransform=function(matrix){this.TextMatrix=matrix};this.UpdateTarget=function(x,y,pageIndex){if(-1!=this.m_lTimerUpdateTargetID){clearTimeout(this.m_lTimerUpdateTargetID);this.m_lTimerUpdateTargetID=-1}this.m_dTargetX=x;this.m_dTargetY=y;this.m_lTargetPage=pageIndex;this.CheckTargetDraw(x,y)}; this.UpdateTarget2=function(x,y,pageIndex){};this.UpdateTargetTimer=function(){};this.SetTargetSize=function(size){this.m_dTargetSize=size};this.DrawTarget=function(){if("block"!=oThis.TargetHtmlElement.style.display&&oThis.NeedTarget)oThis.TargetHtmlElement.style.display="block";else oThis.TargetHtmlElement.style.display="none"};this.TargetShow=function(){this.TargetShowNeedFlag=true};this.CheckTargetShow=function(){if(this.TargetShowFlag&&this.TargetShowNeedFlag){this.TargetHtmlElement.style.display= "block";this.TargetShowNeedFlag=false;return}if(!this.TargetShowNeedFlag)return;this.TargetShowNeedFlag=false;if(-1==this.m_lTimerTargetId)this.TargetStart();if(oThis.NeedTarget)this.TargetHtmlElement.style.display="block";this.TargetShowFlag=true};this.StartTrackImage=function(obj,x,y,w,h,type,pagenum){};this.StartTrackTable=function(obj,transform){};this.EndTrackTable=function(pointer,bIsAttack){};this.CheckTrackTable=function(){};this.DrawTableTrack=function(overlay){};this.DrawMathTrack=function(overlay){if(!this.MathTrack.IsActive())return; var drawingObjects=this.getDrawingObjects();if(!drawingObjects)return;if(!this.TextMatrix)return;overlay.Show();var nIndex,nCount;var oPath;var dKoefX,dKoefY;var PathLng=this.MathTrack.GetPolygonsCount();dKoefX=drawingObjects.convertMetric(1,3,0);dKoefY=dKoefX;var _offX=0;var _offY=0;if(this.AutoShapesTrack&&this.AutoShapesTrack.Graphics&&this.AutoShapesTrack.Graphics.m_oCoordTransform){_offX=this.AutoShapesTrack.Graphics.m_oCoordTransform.tx;_offY=this.AutoShapesTrack.Graphics.m_oCoordTransform.ty}var oTextMatrix= this.TextMatrix||AscCommon.CMatrix();var _1px_mm_x=1/Math.max(dKoefX,.001);var _1px_mm_y=1/Math.max(dKoefY,.001);for(nIndex=0;nIndex<PathLng;nIndex++){oPath=this.MathTrack.GetPolygon(nIndex);this.MathTrack.DrawWithMatrix(overlay,oPath,0,0,"#939393",dKoefX,dKoefY,_offX,_offY,oTextMatrix);this.MathTrack.DrawWithMatrix(overlay,oPath,_1px_mm_x,_1px_mm_y,"#FFFFFF",dKoefX,dKoefY,_offX,_offY,oTextMatrix)}for(nIndex=0,nCount=this.MathTrack.GetSelectPathsCount();nIndex<nCount;nIndex++){oPath=this.MathTrack.GetSelectPath(nIndex); this.MathTrack.DrawSelectPolygon(overlay,oPath,dKoefX,dKoefY,_offX,_offY,oTextMatrix)}};this.SetCurrentPage=function(PageIndex){};this.SelectEnabled=function(bIsEnabled){var drawingObjects=this.getDrawingObjects();if(!drawingObjects)return;this.m_bIsSelection=bIsEnabled;if(false===this.m_bIsSelection){this.SelectClear();drawingObjects.getOverlay().m_oContext.globalAlpha=1}};this.SelectClear=function(){};this.SearchClear=function(){};this.AddPageSearch=function(findText,rects,type){};this.StartSearchTransform= function(transform){};this.EndSearchTransform=function(){};this.StartSearch=function(){};this.EndSearch=function(bIsChange){};this.private_StartDrawSelection=function(overlay){this.Overlay=overlay;this.IsTextMatrixUse=null!=this.TextMatrix&&!global_MatrixTransformer.IsIdentity(this.TextMatrix);this.Overlay.m_oContext.fillStyle="rgba(51,102,204,255)";this.Overlay.m_oContext.beginPath();if(this.IsTextMatrixUse)this.Overlay.m_oContext.strokeStyle="#9ADBFE"};this.private_EndDrawSelection=function(){var ctx= this.Overlay.m_oContext;ctx.globalAlpha=.2;ctx.fill();if(this.IsTextMatrixUse){ctx.globalAlpha=1;ctx.stroke()}ctx.beginPath();ctx.globalAlpha=1;this.IsTextMatrixUse=false;this.Overlay=null};this.AddPageSelection=function(pageIndex,x,y,w,h){var drawingObjects=this.getDrawingObjects();if(!drawingObjects)return;if(null==this.SelectionMatrix)this.SelectionMatrix=this.TextMatrix;var dKoefX=drawingObjects.convertMetric(1,3,0);var dKoefY=dKoefX;var _offX=0;var _offY=0;if(this.AutoShapesTrack&&this.AutoShapesTrack.Graphics&& this.AutoShapesTrack.Graphics.m_oCoordTransform){_offX=this.AutoShapesTrack.Graphics.m_oCoordTransform.tx;_offY=this.AutoShapesTrack.Graphics.m_oCoordTransform.ty}if(!this.IsTextMatrixUse){var _x=(_offX+dKoefX*x>>0)-.5;var _y=(_offY+dKoefY*y>>0)-.5;var _w=dKoefX*w+1>>0;var _h=dKoefY*h+1>>0;this.Overlay.CheckRect(_x,_y,_w,_h);this.Overlay.m_oContext.rect(_x,_y,_w,_h)}else{var _x1=this.TextMatrix.TransformPointX(x,y);var _y1=this.TextMatrix.TransformPointY(x,y);var _x2=this.TextMatrix.TransformPointX(x+ w,y);var _y2=this.TextMatrix.TransformPointY(x+w,y);var _x3=this.TextMatrix.TransformPointX(x+w,y+h);var _y3=this.TextMatrix.TransformPointY(x+w,y+h);var _x4=this.TextMatrix.TransformPointX(x,y+h);var _y4=this.TextMatrix.TransformPointY(x,y+h);var x1=_offX+dKoefX*_x1;var y1=_offY+dKoefY*_y1;var x2=_offX+dKoefX*_x2;var y2=_offY+dKoefY*_y2;var x3=_offX+dKoefX*_x3;var y3=_offY+dKoefY*_y3;var x4=_offX+dKoefX*_x4;var y4=_offY+dKoefY*_y4;this.Overlay.CheckPoint(x1,y1);this.Overlay.CheckPoint(x2,y2);this.Overlay.CheckPoint(x3, y3);this.Overlay.CheckPoint(x4,y4);var ctx=this.Overlay.m_oContext;ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.lineTo(x3,y3);ctx.lineTo(x4,y4);ctx.closePath()}};this.SelectShow=function(){var drawingObjects=this.getDrawingObjects();if(!drawingObjects)return;drawingObjects.OnUpdateOverlay()};this.Set_RulerState_Table=function(markup,transform){};this.Set_RulerState_Paragraph=function(margins){};this.Set_RulerState_HdrFtr=function(bHeader,Y0,Y1){};this.Update_MathTrack=function(IsActive,IsContentActive, oMath){var PixelError=this.GetMMPerDot(1)*3;this.MathTrack.Update(IsActive,IsContentActive,oMath,PixelError)};this.Update_ParaTab=function(Default_Tab,ParaTabs){};this.UpdateTableRuler=function(isCols,index,position){};this.GetDotsPerMM=function(value){return value*Asc.editor.wb.getZoom()*g_dKoef_mm_to_pix};this.GetMMPerDot=function(value){return value/this.GetDotsPerMM(1)};this.GetVisibleMMHeight=function(){return 0};this.CheckFontCache=function(){};this.CheckFontNeeds=function(){};this.OpenDocument= function(){};this.DrawTrack=function(type,matrix,left,top,width,height,isLine,canRotate,isNoMove){this.AutoShapesTrack.DrawTrack(type,matrix,left,top,width,height,isLine,canRotate,isNoMove)};this.DrawTrackSelectShapes=function(x,y,w,h){this.AutoShapesTrack.DrawTrackSelectShapes(x,y,w,h)};this.DrawAdjustment=function(matrix,x,y,bTextWarp){this.AutoShapesTrack.DrawAdjustment(matrix,x,y,bTextWarp)};this.LockTrackPageNum=function(nPageNum){this.AutoShapesTrackLockPageNum=nPageNum};this.UnlockTrackPageNum= function(){this.AutoShapesTrackLockPageNum=-1};this.CheckGuiControlColors=function(){};this.SendControlColors=function(){};this.DrawImageTextureFillShape=function(url){if(this.GuiCanvasFillTexture==null)this.InitGuiCanvasShape(this.GuiCanvasFillTextureParentId);if(this.GuiCanvasFillTexture==null||this.GuiCanvasFillTextureCtx==null||url==this.LastDrawingUrl)return;this.LastDrawingUrl=url;var _width=this.GuiCanvasFillTexture.width;var _height=this.GuiCanvasFillTexture.height;this.GuiCanvasFillTextureCtx.clearRect(0, 0,_width,_height);if(null==this.LastDrawingUrl)return;var api=window["Asc"]["editor"];var _img=api.ImageLoader.map_image_index[AscCommon.getFullImageSrc2(this.LastDrawingUrl)];if(_img!=undefined&&_img.Image!=null&&_img.Status!=AscFonts.ImageLoadStatus.Loading){var _x=0;var _y=0;var _w=Math.max(_img.Image.width,1);var _h=Math.max(_img.Image.height,1);var dAspect1=_width/_height;var dAspect2=_w/_h;_w=_width;_h=_height;if(dAspect1>=dAspect2){_w=dAspect2*_height;_x=(_width-_w)/2}else{_h=_w/dAspect2;_y= (_height-_h)/2}this.GuiCanvasFillTextureCtx.drawImage(_img.Image,_x,_y,_w,_h)}else{this.GuiCanvasFillTextureCtx.lineWidth=1;this.GuiCanvasFillTextureCtx.beginPath();this.GuiCanvasFillTextureCtx.moveTo(0,0);this.GuiCanvasFillTextureCtx.lineTo(_width,_height);this.GuiCanvasFillTextureCtx.moveTo(_width,0);this.GuiCanvasFillTextureCtx.lineTo(0,_height);this.GuiCanvasFillTextureCtx.strokeStyle="#FF0000";this.GuiCanvasFillTextureCtx.stroke();this.GuiCanvasFillTextureCtx.beginPath();this.GuiCanvasFillTextureCtx.moveTo(0, 0);this.GuiCanvasFillTextureCtx.lineTo(_width,0);this.GuiCanvasFillTextureCtx.lineTo(_width,_height);this.GuiCanvasFillTextureCtx.lineTo(0,_height);this.GuiCanvasFillTextureCtx.closePath();this.GuiCanvasFillTextureCtx.strokeStyle="#000000";this.GuiCanvasFillTextureCtx.stroke();this.GuiCanvasFillTextureCtx.beginPath()}};this.DrawImageTextureFillTextArt=function(url){if(this.GuiCanvasFillTextureTextArt==null)this.InitGuiCanvasTextArt(this.GuiCanvasFillTextureParentIdTextArt);if(this.GuiCanvasFillTextureTextArt== null||this.GuiCanvasFillTextureCtxTextArt==null||url==this.LastDrawingUrlTextArt)return;this.LastDrawingUrlTextArt=url;var _width=this.GuiCanvasFillTextureTextArt.width;var _height=this.GuiCanvasFillTextureTextArt.height;this.GuiCanvasFillTextureCtxTextArt.clearRect(0,0,_width,_height);if(null==this.LastDrawingUrlTextArt)return;var api=window["Asc"]["editor"];var _img=api.ImageLoader.map_image_index[AscCommon.getFullImageSrc2(this.LastDrawingUrlTextArt)];if(_img!=undefined&&_img.Image!=null&&_img.Status!= AscFonts.ImageLoadStatus.Loading){var _x=0;var _y=0;var _w=Math.max(_img.Image.width,1);var _h=Math.max(_img.Image.height,1);var dAspect1=_width/_height;var dAspect2=_w/_h;_w=_width;_h=_height;if(dAspect1>=dAspect2){_w=dAspect2*_height;_x=(_width-_w)/2}else{_h=_w/dAspect2;_y=(_height-_h)/2}this.GuiCanvasFillTextureCtxTextArt.drawImage(_img.Image,_x,_y,_w,_h)}else{this.GuiCanvasFillTextureCtxTextArt.lineWidth=1;this.GuiCanvasFillTextureCtxTextArt.beginPath();this.GuiCanvasFillTextureCtxTextArt.moveTo(0, 0);this.GuiCanvasFillTextureCtxTextArt.lineTo(_width,_height);this.GuiCanvasFillTextureCtxTextArt.moveTo(_width,0);this.GuiCanvasFillTextureCtxTextArt.lineTo(0,_height);this.GuiCanvasFillTextureCtxTextArt.strokeStyle="#FF0000";this.GuiCanvasFillTextureCtxTextArt.stroke();this.GuiCanvasFillTextureCtxTextArt.beginPath();this.GuiCanvasFillTextureCtxTextArt.moveTo(0,0);this.GuiCanvasFillTextureCtxTextArt.lineTo(_width,0);this.GuiCanvasFillTextureCtxTextArt.lineTo(_width,_height);this.GuiCanvasFillTextureCtxTextArt.lineTo(0, _height);this.GuiCanvasFillTextureCtxTextArt.closePath();this.GuiCanvasFillTextureCtxTextArt.strokeStyle="#000000";this.GuiCanvasFillTextureCtxTextArt.stroke();this.GuiCanvasFillTextureCtxTextArt.beginPath()}};this.InitGuiCanvasShape=function(div_id){if(this.GuiCanvasFillTextureParentId==div_id&&null!=this.GuiCanvasFillTexture)return;if(null!=this.GuiCanvasFillTexture){var _div_elem=document.getElementById(this.GuiCanvasFillTextureParentId);if(_div_elem)_div_elem.removeChild(this.GuiCanvasFillTexture); this.GuiCanvasFillTexture=null;this.GuiCanvasFillTextureCtx=null}this.GuiCanvasFillTextureParentId=div_id;var _div_elem=document.getElementById(this.GuiCanvasFillTextureParentId);if(!_div_elem)return;var bIsAppend=true;if(_div_elem.childNodes&&_div_elem.childNodes.length==1){this.GuiCanvasFillTexture=_div_elem.childNodes[0];bIsAppend=false}else this.GuiCanvasFillTexture=document.createElement("canvas");this.GuiCanvasFillTexture.width=parseInt(_div_elem.style.width);this.GuiCanvasFillTexture.height= parseInt(_div_elem.style.height);this.LastDrawingUrl="";this.GuiCanvasFillTextureCtx=this.GuiCanvasFillTexture.getContext("2d");if(bIsAppend)_div_elem.appendChild(this.GuiCanvasFillTexture)};this.InitGuiCanvasTextProps=function(div_id){var _div_elem=document.getElementById(div_id);if(null!=this.GuiCanvasTextProps){var elem=_div_elem.getElementsByTagName("canvas");if(elem.length==0)_div_elem.appendChild(this.GuiCanvasTextProps);else{var _width=parseInt(_div_elem.offsetWidth);var _height=parseInt(_div_elem.offsetHeight); if(0==_width)_width=300;if(0==_height)_height=80;if(this.GuiCanvasTextProps.width!=_width||this.GuiCanvasTextProps.height!=_height){this.GuiCanvasTextProps.width=_width;this.GuiCanvasTextProps.height=_height}}}else{this.GuiCanvasTextProps=document.createElement("canvas");this.GuiCanvasTextProps.style.position="absolute";this.GuiCanvasTextProps.style.left="0px";this.GuiCanvasTextProps.style.top="0px";this.GuiCanvasTextProps.id=this.GuiCanvasTextPropsId;var _width=parseInt(_div_elem.offsetWidth);var _height= parseInt(_div_elem.offsetHeight);if(0==_width)_width=300;if(0==_height)_height=80;this.GuiCanvasTextProps.width=_width;this.GuiCanvasTextProps.height=_height;_div_elem.appendChild(this.GuiCanvasTextProps)}};this.InitGuiCanvasTextArt=function(div_id){if(null!=this.GuiCanvasFillTextureTextArt){var _div_elem=document.getElementById(this.GuiCanvasFillTextureParentIdTextArt);if(!_div_elem)_div_elem.removeChild(this.GuiCanvasFillTextureTextArt);this.GuiCanvasFillTextureTextArt=null;this.GuiCanvasFillTextureCtxTextArt= null}this.GuiCanvasFillTextureParentIdTextArt=div_id;var _div_elem=document.getElementById(this.GuiCanvasFillTextureParentIdTextArt);if(!_div_elem)return;var bIsAppend=true;if(_div_elem.childNodes&&_div_elem.childNodes.length==1){this.GuiCanvasFillTextureTextArt=_div_elem.childNodes[0];bIsAppend=false}else this.GuiCanvasFillTextureTextArt=document.createElement("canvas");this.GuiCanvasFillTextureTextArt.width=parseInt(_div_elem.style.width);this.GuiCanvasFillTextureTextArt.height=parseInt(_div_elem.style.height); this.LastDrawingUrlTextArt="";this.GuiCanvasFillTextureCtxTextArt=this.GuiCanvasFillTextureTextArt.getContext("2d");if(bIsAppend)_div_elem.appendChild(this.GuiCanvasFillTextureTextArt)};this.DrawGuiCanvasTextProps=function(props){var bIsChange=false;if(null==this.GuiLastTextProps){bIsChange=true;this.GuiLastTextProps=new Asc.asc_CParagraphProperty;this.GuiLastTextProps.Subscript=props.Subscript;this.GuiLastTextProps.Superscript=props.Superscript;this.GuiLastTextProps.SmallCaps=props.SmallCaps;this.GuiLastTextProps.AllCaps= props.AllCaps;this.GuiLastTextProps.Strikeout=props.Strikeout;this.GuiLastTextProps.DStrikeout=props.DStrikeout;this.GuiLastTextProps.TextSpacing=props.TextSpacing;this.GuiLastTextProps.Position=props.Position}else{if(this.GuiLastTextProps.Subscript!=props.Subscript){this.GuiLastTextProps.Subscript=props.Subscript;bIsChange=true}if(this.GuiLastTextProps.Superscript!=props.Superscript){this.GuiLastTextProps.Superscript=props.Superscript;bIsChange=true}if(this.GuiLastTextProps.SmallCaps!=props.SmallCaps){this.GuiLastTextProps.SmallCaps= props.SmallCaps;bIsChange=true}if(this.GuiLastTextProps.AllCaps!=props.AllCaps){this.GuiLastTextProps.AllCaps=props.AllCaps;bIsChange=true}if(this.GuiLastTextProps.Strikeout!=props.Strikeout){this.GuiLastTextProps.Strikeout=props.Strikeout;bIsChange=true}if(this.GuiLastTextProps.DStrikeout!=props.DStrikeout){this.GuiLastTextProps.DStrikeout=props.DStrikeout;bIsChange=true}if(this.GuiLastTextProps.TextSpacing!=props.TextSpacing){this.GuiLastTextProps.TextSpacing=props.TextSpacing;bIsChange=true}if(this.GuiLastTextProps.Position!= props.Position){this.GuiLastTextProps.Position=props.Position;bIsChange=true}}if(undefined!==this.GuiLastTextProps.Position&&isNaN(this.GuiLastTextProps.Position))this.GuiLastTextProps.Position=undefined;if(undefined!==this.GuiLastTextProps.TextSpacing&&isNaN(this.GuiLastTextProps.TextSpacing))this.GuiLastTextProps.TextSpacing=undefined;if(!bIsChange)return;AscFormat.ExecuteNoHistory(function(){var shape=new AscFormat.CShape;shape.setTxBody(AscFormat.CreateTextBodyFromString("",this,shape));var par= shape.txBody.content.Content[0];par.Reset(0,0,1E3,1E3,0);par.MoveCursorToStartPos();var _paraPr=new CParaPr;par.Pr=_paraPr;var _textPr=new CTextPr;_textPr.FontFamily={Name:"Arial",Index:-1};_textPr.Strikeout=this.GuiLastTextProps.Strikeout;if(true===this.GuiLastTextProps.Subscript)_textPr.VertAlign=AscCommon.vertalign_SubScript;else if(true===this.GuiLastTextProps.Superscript)_textPr.VertAlign=AscCommon.vertalign_SuperScript;else _textPr.VertAlign=AscCommon.vertalign_Baseline;_textPr.DStrikeout=this.GuiLastTextProps.DStrikeout; _textPr.Caps=this.GuiLastTextProps.AllCaps;_textPr.SmallCaps=this.GuiLastTextProps.SmallCaps;_textPr.Spacing=this.GuiLastTextProps.TextSpacing;_textPr.Position=this.GuiLastTextProps.Position;var parRun=new ParaRun(par);parRun.Set_Pr(_textPr);parRun.AddText("Hello World");par.Add_ToContent(0,parRun);par.Recalculate_Page(0);par.Recalculate_Page(0);var baseLineOffset=par.Lines[0].Y;var _bounds=par.Get_PageBounds(0);var ctx=this.GuiCanvasTextProps.getContext("2d");var _wPx=this.GuiCanvasTextProps.width; var _hPx=this.GuiCanvasTextProps.height;var _wMm=_wPx*g_dKoef_pix_to_mm;var _hMm=_hPx*g_dKoef_pix_to_mm;ctx.fillStyle="#FFFFFF";ctx.fillRect(0,0,_wPx,_hPx);var _pxBoundsW=par.Lines[0].Ranges[0].W*g_dKoef_mm_to_pix;var _pxBoundsH=(_bounds.Bottom-_bounds.Top)*g_dKoef_mm_to_pix;if(this.GuiLastTextProps.Position!==undefined&&this.GuiLastTextProps.Position!=null&&this.GuiLastTextProps.Position!=0);if(_pxBoundsH<_hPx&&_pxBoundsW<_wPx){var _lineY=((_hPx+_pxBoundsH)/2>>0)+.5;var _lineW=(_wPx-_pxBoundsW)/ 4>>0;ctx.strokeStyle="#000000";ctx.lineWidth=1;ctx.beginPath();ctx.moveTo(0,_lineY);ctx.lineTo(_lineW,_lineY);ctx.moveTo(_wPx-_lineW,_lineY);ctx.lineTo(_wPx,_lineY);ctx.stroke();ctx.beginPath()}var _yOffset=(_hPx+_pxBoundsH)/2-baseLineOffset*g_dKoef_mm_to_pix>>0;var _xOffset=(_wPx-_pxBoundsW)/2>>0;var graphics=new AscCommon.CGraphics;graphics.init(ctx,_wPx,_hPx,_wMm,_hMm);graphics.m_oFontManager=AscCommon.g_fontManager;graphics.m_oCoordTransform.tx=_xOffset;graphics.m_oCoordTransform.ty=_yOffset; graphics.transform(1,0,0,1,0,0);par.Draw(0,graphics)},this,[])};this.CheckTableStyles=function(tableLook){};this.IsMobileVersion=function(){return false};this.OnSelectEnd=function(){}}function CHtmlPage(){this.drawingPage={top:0,left:0,right:0,bottom:0};this.width_mm=0;this.height_mm=0}CHtmlPage.prototype.init=function(x,y,w_pix,h_pix,w_mm,h_mm){this.drawingPage.top=y;this.drawingPage.left=x;this.drawingPage.right=w_pix;this.drawingPage.bottom=h_pix;this.width_mm=w_mm;this.height_mm=h_mm};CHtmlPage.prototype.GetDrawingPageInfo= function(){return{drawingPage:this.drawingPage,width_mm:this.width_mm,height_mm:this.height_mm}};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDrawingDocument=CDrawingDocument;window["AscCommon"].CHtmlPage=CHtmlPage})(window);"use strict";(function(window,undefined){function CCollaborativeEditing(){this.WaitImages={};AscCommon.CCollaborativeEditingBase.call(this)}CCollaborativeEditing.prototype=Object.create(AscCommon.CCollaborativeEditingBase.prototype);CCollaborativeEditing.prototype.constructor= CCollaborativeEditing;CCollaborativeEditing.prototype.Have_OtherChanges=function(){return false};CCollaborativeEditing.prototype.Start_CollaborationEditing=function(){};CCollaborativeEditing.prototype.Add_User=function(UserId){};CCollaborativeEditing.prototype.Find_User=function(UserId){};CCollaborativeEditing.prototype.Remove_User=function(UserId){};CCollaborativeEditing.prototype.Add_Changes=function(Changes){};CCollaborativeEditing.prototype.Add_Unlock=function(LockClass){};CCollaborativeEditing.prototype.Add_Unlock2= function(Lock){};CCollaborativeEditing.prototype.Apply_OtherChanges=function(){};CCollaborativeEditing.prototype.Apply_Changes=function(){};CCollaborativeEditing.prototype.Send_Changes=function(){};CCollaborativeEditing.prototype.Release_Locks=function(){};CCollaborativeEditing.prototype.OnStart_Load_Objects=function(){};CCollaborativeEditing.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditing.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditing.prototype.Add_LinkData= function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};CCollaborativeEditing.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aLinkData[Index];Item.Class.Load_LinkData(Item.LinkData)}this.Clear_LinkData();this.Load_Images()};CCollaborativeEditing.prototype.CheckWaitingImages=function(aImages){this.WaitImages={};for(var i=0;i<aImages.length;++i)this.WaitImages[aImages]=1};CCollaborativeEditing.prototype.SendImagesCallback= function(aImages){var oApi=Asc["editor"],bOldVal;if(aImages.length>0){bOldVal=oApi.ImageLoader.bIsAsyncLoadDocumentImages;oApi.ImageLoader.bIsAsyncLoadDocumentImages=true;oApi.ImageLoader.LoadDocumentImages(aImages);oApi.ImageLoader.bIsAsyncLoadDocumentImages=bOldVal;this.WaitImages={}}};CCollaborativeEditing.prototype.Load_Images=function(){var aImages=this.CollectImagesFromChanges();if(aImages.length>0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages)); this.m_aNewImages.length=0}};CCollaborativeEditing.prototype.Check_MergeData=function(){};CCollaborativeEditing.prototype.Get_GlobalLock=function(){return false};CCollaborativeEditing.prototype.Set_GlobalLock=function(isLock){};CCollaborativeEditing.prototype.Get_GlobalLockSelection=function(){return false};CCollaborativeEditing.prototype.Set_GlobalLockSelection=function(isLock){};CCollaborativeEditing.prototype.OnStart_CheckLock=function(){};CCollaborativeEditing.prototype.Add_CheckLock=function(oItem){}; CCollaborativeEditing.prototype.OnEnd_CheckLock=function(){};CCollaborativeEditing.prototype.OnCallback_AskLock=function(result){};CCollaborativeEditing.prototype.Reset_NeedLock=function(){};CCollaborativeEditing.prototype.Add_NeedLock=function(Id,sUser){};CCollaborativeEditing.prototype.Remove_NeedLock=function(Id){};CCollaborativeEditing.prototype.Lock_NeedLock=function(){};CCollaborativeEditing.prototype.Clear_NewObjects=function(){};CCollaborativeEditing.prototype.Add_NewObject=function(Class){}; CCollaborativeEditing.prototype.OnEnd_ReadForeignChanges=function(){};CCollaborativeEditing.prototype.Clear_CollaborativeMarks=function(){for(var Id in this.m_aChangedClasses)this.m_aChangedClasses[Id].Clear_CollaborativeMarks();this.m_aChangedClasses={}};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CollaborativeEditing=new CCollaborativeEditing})(window);"use strict";(function(window,undefined){var CShape=AscFormat.CShape;var History=AscCommon.History;var G_O_DEFAULT_COLOR_MAP= AscFormat.GenerateDefaultColorMap();CShape.prototype.setDrawingObjects=function(drawingObjects){};CShape.prototype.getEditorType=function(){return 0};CShape.prototype.setDrawingBase=function(drawingBase){this.drawingBase=drawingBase;if(Array.isArray(this.spTree))for(var i=0;i<this.spTree.length;++i)this.spTree[i].setDrawingBase(drawingBase)};CShape.prototype.Get_Numbering=function(){return new CNumbering};CShape.prototype.Is_UseInDocument=function(){if(this.group){var aSpTree=this.group.spTree;for(var i= 0;i<aSpTree.length;++i)if(aSpTree[i]===this)return this.group.Is_UseInDocument();return false}if(this.drawingBase)return this.drawingBase.isUseInDocument();return false};CShape.prototype.getTextArtPreviewManager=function(){return Asc["editor"].textArtPreviewManager};CShape.prototype.getDrawingObjectsController=function(){var wsViews=Asc["editor"]&&Asc["editor"].wb&&Asc["editor"].wb.wsViews;if(wsViews)for(var i=0;i<wsViews.length;++i)if(wsViews[i]&&wsViews[i].model===this.worksheet&&wsViews[i].objectRender)return wsViews[i].objectRender.controller; return null};CShape.prototype.hitInTextRect=function(x,y){var oController=this.getDrawingObjectsController&&this.getDrawingObjectsController();if(oController&&(AscFormat.getTargetTextObject(oController)===this||oController.curState.startTargetTextObject===this)){var content=this.getDocContent&&this.getDocContent();if(content&&this.invertTransformText){var t_x,t_y;t_x=this.invertTransformText.TransformPointX(x,y);t_y=this.invertTransformText.TransformPointY(x,y);return t_x>0&&t_x<this.contentWidth&& t_y>0&&t_y<this.contentHeight}}else{if(window.AscDisableTextSelection)return;return this.hitInTextRectWord(x,y)}return false};function addToDrawings(worksheet,graphic,position,lockByDefault,anchor){var drawingObjects;var wsViews=Asc["editor"].wb.wsViews;for(var i=0;i<wsViews.length;++i)if(wsViews[i]&&wsViews[i].model===worksheet){drawingObjects=wsViews[i].objectRender;break}if(!drawingObjects)drawingObjects=new AscFormat.DrawingObjects;var oldDrawingBase=graphic.drawingBase;var drawingObject=drawingObjects.createDrawingObject(anchor); drawingObject.graphicObject=graphic;graphic.setDrawingBase(drawingObject);if(!worksheet)return;var ret,aObjects=worksheet.Drawings;if(AscFormat.isRealNumber(position)&&position>-1&&position<=aObjects.length){aObjects.splice(position,0,drawingObject);ret=position}else{ret=aObjects.length;aObjects.push(drawingObject)}if(oldDrawingBase){graphic.setDrawingBaseType(oldDrawingBase.Type);graphic.setDrawingBaseEditAs(oldDrawingBase.editAs);drawingObject.from.col=oldDrawingBase.from.col;drawingObject.from.colOff= oldDrawingBase.from.colOff;drawingObject.from.row=oldDrawingBase.from.row;drawingObject.from.rowOff=oldDrawingBase.from.rowOff;drawingObject.to.col=oldDrawingBase.to.col;drawingObject.to.colOff=oldDrawingBase.to.colOff;drawingObject.to.row=oldDrawingBase.to.row;drawingObject.to.rowOff=oldDrawingBase.to.rowOff;drawingObject.Pos.X=oldDrawingBase.Pos.X;drawingObject.Pos.Y=oldDrawingBase.Pos.Y;drawingObject.ext.cx=oldDrawingBase.ext.cx;drawingObject.ext.cy=oldDrawingBase.ext.cy}if(graphic.recalcTransform){graphic.recalcTransform(); if(graphic.recalcBounds)graphic.recalcBounds();graphic.addToRecalculate()}return ret}function CChangesDrawingObjectsAddToDrawingObjects(Class,Pos){this.Pos=Pos;this.Type=AscDFH.historyitem_AutoShapes_AddToDrawingObjects;AscDFH.CChangesBase.call(this,Class)}CChangesDrawingObjectsAddToDrawingObjects.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesDrawingObjectsAddToDrawingObjects.prototype.constructor=CChangesDrawingObjectsAddToDrawingObjects;CChangesDrawingObjectsAddToDrawingObjects.prototype.Undo= function(){AscFormat.deleteDrawingBase(this.Class.worksheet.Drawings,this.Class.Get_Id())};CChangesDrawingObjectsAddToDrawingObjects.prototype.Redo=function(){AscFormat.addToDrawings(this.Class.worksheet,this.Class,this.Pos)};CChangesDrawingObjectsAddToDrawingObjects.prototype.WriteToBinary=function(Writer){var nPos=this.Pos;if(this.UseArray===true&&Array.isArray(this.PosArray)&&AscFormat.isRealNumber(this.PosArray[0]))nPos=this.PosArray[0];Writer.WriteLong(nPos)};CChangesDrawingObjectsAddToDrawingObjects.prototype.ReadFromBinary= function(Reader){this.UseArray=true;this.Items=[];this.PosArray=[];this.PosArray[0]=Reader.GetLong();this.Pos=this.PosArray[0]};CChangesDrawingObjectsAddToDrawingObjects.prototype.Load=function(Color){if(this.Class.worksheet&&this.Class.worksheet.contentChanges){var Pos=this.Class.worksheet.contentChanges.Check(AscCommon.contentchanges_Add,true===this.UseArray&&AscFormat.isRealNumber(this.PosArray[0])?this.PosArray[0]:this.Pos);if(Pos===false)return;AscFormat.addToDrawings(this.Class.worksheet,this.Class, Pos)}};CChangesDrawingObjectsAddToDrawingObjects.prototype.CreateReverseChange=function(){return new CChangesDrawingObjectsRemoveFromDrawingObjects(this.Class,this.Pos)};CChangesDrawingObjectsAddToDrawingObjects.prototype.IsContentChange=function(){return true};CChangesDrawingObjectsAddToDrawingObjects.prototype.IsAdd=function(){return true};CChangesDrawingObjectsAddToDrawingObjects.prototype.Copy=function(){return new CChangesDrawingObjectsAddToDrawingObjects(this.Class,this.Pos)};CChangesDrawingObjectsAddToDrawingObjects.prototype.GetItemsCount= function(){return 1};CChangesDrawingObjectsAddToDrawingObjects.prototype.ConvertToSimpleActions=function(){var arrActions=[];return arrActions};CChangesDrawingObjectsAddToDrawingObjects.prototype.ConvertFromSimpleActions=function(arrActions){};CChangesDrawingObjectsAddToDrawingObjects.prototype.IsRelated=function(oChanges){if(this.Class!==oChanges.GetClass()||this.Type!==oChanges.Type)return false;return true};CChangesDrawingObjectsAddToDrawingObjects.prototype.private_CreateReverseChange=function(fConstructor){var oChange= this.Copy();return oChange};CChangesDrawingObjectsAddToDrawingObjects.prototype.Merge=function(oChange){return true};CChangesDrawingObjectsAddToDrawingObjects.prototype.GetMinPos=function(){var nPos=null;nPos=this.Pos;return nPos};AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_AddToDrawingObjects]=CChangesDrawingObjectsAddToDrawingObjects;function CChangesDrawingObjectsRemoveFromDrawingObjects(Class,Pos){this.Type=AscDFH.historyitem_AutoShapes_RemoveFromDrawingObjects;this.Pos=Pos;AscDFH.CChangesBase.call(this, Class)}CChangesDrawingObjectsRemoveFromDrawingObjects.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.constructor=CChangesDrawingObjectsRemoveFromDrawingObjects;CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.Undo=function(){AscFormat.addToDrawings(this.Class.worksheet,this.Class,this.Pos)};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.Redo=function(){AscFormat.deleteDrawingBase(this.Class.worksheet.Drawings,this.Class.Get_Id())}; CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.Load=function(Color){if(this.Class.worksheet&&this.Class.worksheet.contentChanges){var Pos=this.Class.worksheet.contentChanges.Check(AscCommon.contentchanges_Remove,true===this.UseArray&&AscFormat.isRealNumber(this.PosArray[0])?this.PosArray[0]:this.Pos);if(Pos===false)return;AscFormat.deleteDrawingBase(this.Class.worksheet.Drawings,this.Class.Get_Id())}};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.CreateReverseChange=function(){return new CChangesDrawingObjectsAddToDrawingObjects(this.Class, this.Pos)};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.IsContentChange=function(){return true};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.IsAdd=function(){return false};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.Copy=function(){return new CChangesDrawingObjectsRemoveFromDrawingObjects(this.Class,this.Pos)};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.GetItemsCount=function(){return 1};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.WriteToBinary= function(Writer){var bArray=this.UseArray;if(true===bArray)Writer.WriteLong(this.PosArray[0]);else Writer.WriteLong(this.Pos)};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.ReadFromBinary=function(Reader){this.UseArray=true;this.Items=[];this.PosArray=[];this.PosArray[0]=Reader.GetLong();this.Pos=this.PosArray[0]};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.private_WriteItem=function(Writer,Item){};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.private_ReadItem=function(Reader){return null}; CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.ConvertToSimpleActions=function(){var arrActions=[];return arrActions};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.ConvertFromSimpleActions=function(arrActions){this.UseArray=true;this.Pos=0;this.Items=[];this.PosArray=[]};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.IsRelated=function(oChanges){if(this.Class!==oChanges.GetClass()||this.Type!==oChanges.Type)return false;return true};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.private_CreateReverseChange= function(fConstructor){return this.Copy()};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.Merge=function(oChange){return true};CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.GetMinPos=function(){return this.Pos};AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_RemoveFromDrawingObjects]=CChangesDrawingObjectsRemoveFromDrawingObjects;CShape.prototype.Clear_ContentChanges=function(){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Clear()};CShape.prototype.Add_ContentChanges= function(Changes){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Add(Changes)};CShape.prototype.Refresh_ContentChanges=function(){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Refresh()};CShape.prototype.addToDrawingObjects=function(pos,type){var position=addToDrawings(this.worksheet,this,pos,undefined,type);History.Add(new CChangesDrawingObjectsAddToDrawingObjects(this,position));if(this.setDrawingBaseType){if(this.drawingBase){this.setDrawingBaseType&& this.setDrawingBaseType(this.drawingBase.Type);this.setDrawingBaseEditAs&&this.setDrawingBaseEditAs(this.drawingBase.editAs)}if(AscFormat.isRealNumber(type)){this.setDrawingBaseType(type);if(type===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)this.setDrawingBaseEditAs(AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)}}var nv_sp_pr,bNeedSet=false;switch(this.getObjectType()){case AscDFH.historyitem_type_Shape:{if(!this.nvSpPr)bNeedSet=true;break}case AscDFH.historyitem_type_ChartSpace:{if(!this.nvGraphicFramePr)bNeedSet= true;break}case AscDFH.historyitem_type_ImageShape:{if(!this.nvPicPr)bNeedSet=true;break}case AscDFH.historyitem_type_GroupShape:{if(!this.nvGrpSpPr)bNeedSet=true;break}}if(bNeedSet){nv_sp_pr=new AscFormat.UniNvPr;nv_sp_pr.cNvPr.setId(++AscFormat.Ax_Counter.GLOBAL_AX_ID_COUNTER);this.setNvSpPr(nv_sp_pr)}if(this.signatureLine)this.setSignature(this.signatureLine);var oApi=Asc.editor;if(oApi&&this.signatureLine)oApi.sendEvent("asc_onAddSignature",this.signatureLine.id)};CShape.prototype.deleteDrawingBase= function(){if(this.drawingBase){var oFrom=this.drawingBase.from;var oTo=this.drawingBase.to;var oPos=this.drawingBase.Pos;var oExt=this.drawingBase.ext;if(oFrom&&oTo&&oPos&&oExt&&this.setDrawingBaseType&&this.setDrawingBaseCoords){if(this.drawingBase.Type===AscCommon.c_oAscCellAnchorType.cellanchorTwoCell)this.setDrawingBaseEditAs(AscCommon.c_oAscCellAnchorType.cellanchorTwoCell);this.setDrawingBaseType(this.drawingBase.Type);this.setDrawingBaseCoords(oFrom.col,oFrom.colOff,oFrom.row,oFrom.rowOff, oTo.col,oTo.colOff,oTo.row,oTo.rowOff,oPos.X,oPos.Y,oExt.cx,oExt.cy)}}if(this.signatureLine&&this.setSignature)this.setSignature(this.signatureLine);var position=AscFormat.deleteDrawingBase(this.worksheet.Drawings,this.Get_Id());if(AscFormat.isRealNumber(position))History.Add(new CChangesDrawingObjectsRemoveFromDrawingObjects(this,position));if(this.signatureLine&&this.setSignature){var oApi=Asc.editor;if(oApi)oApi.sendEvent("asc_onAddSignature",this.signatureLine.id);this.setSignature(this.signatureLine)}return position}; function getDrawingObjects_Sp(sp){var controller=sp.getDrawingObjectsController();return controller&&controller.drawingObjects}CShape.prototype.setRecalculateInfo=function(){this.recalcInfo={recalculateContent:true,recalculateBrush:true,recalculatePen:true,recalculateTransform:true,recalculateTransformText:true,recalculateBounds:true,recalculateGeometry:true,recalculateStyle:true,recalculateFill:true,recalculateLine:true,recalculateTransparent:true,recalculateTextStyles:[true,true,true,true,true, true,true,true,true],oContentMetrics:null};this.compiledStyles=[];this.lockType=AscCommon.c_oAscLockTypes.kLockTypeNone};CShape.prototype.checkNeedRecalculate=function(){return this.recalcInfo.recalculateTransform===true||this.recalcInfo.recalculateContent===true};CShape.prototype.recalcContent=function(){this.recalcInfo.recalculateContent=true};CShape.prototype.getDrawingDocument=function(){if(this.worksheet)return this.worksheet.getDrawingDocument();var drawingObjects=getDrawingObjects_Sp(this); return drawingObjects&&drawingObjects.drawingDocument};CShape.prototype.recalcBrush=function(){this.recalcInfo.recalculateBrush=true};CShape.prototype.recalcPen=function(){this.recalcInfo.recalculatePen=true};CShape.prototype.recalcTransform=function(){this.recalcInfo.recalculateTransform=true};CShape.prototype.recalcTransformText=function(){this.recalcInfo.recalculateTransformText=true};CShape.prototype.recalcBounds=function(){this.recalcInfo.recalculateBounds=true};CShape.prototype.recalcGeometry= function(){this.recalcInfo.recalculateGeometry=true};CShape.prototype.recalcStyle=function(){this.recalcInfo.recalculateStyle=true};CShape.prototype.recalcFill=function(){this.recalcInfo.recalculateFill=true};CShape.prototype.recalcLine=function(){this.recalcInfo.recalculateLine=true};CShape.prototype.recalcTransparent=function(){this.recalcInfo.recalculateTransparent=true};CShape.prototype.recalcTextStyles=function(){this.recalcInfo.recalculateTextStyles=[true,true,true,true,true,true,true,true, true]};CShape.prototype.addToRecalculate=function(){var controller=this.getDrawingObjectsController&&this.getDrawingObjectsController();if(controller)controller.objectsForRecalculate[this.Id]=this};CShape.prototype.handleUpdatePosition=function(){this.recalcTransform();this.recalcBounds();this.recalcTransformText();this.addToRecalculate()};CShape.prototype.handleUpdateExtents=function(){this.recalcContent();this.recalcGeometry();this.recalcBounds();this.recalcTransform();this.recalcTransformText(); this.recalcContent();this.addToRecalculate()};CShape.prototype.handleUpdateRot=function(){this.recalcTransform();if(this.txBody&&this.txBody.bodyPr&&this.txBody.bodyPr.upright)this.recalcContent();this.recalcTransformText();this.recalcBounds();this.addToRecalculate()};CShape.prototype.handleUpdateFlip=function(){this.recalcTransform();this.recalcTransformText();this.recalcContent();this.addToRecalculate()};CShape.prototype.handleUpdateFill=function(){this.recalcBrush();this.recalcFill();this.recalcTransparent(); this.addToRecalculate()};CShape.prototype.handleUpdateLn=function(){this.recalcPen();this.recalcLine();this.addToRecalculate()};CShape.prototype.handleUpdateGeometry=function(){this.recalcGeometry();this.recalcBounds();this.recalcContent();this.recalcTransformText();this.addToRecalculate()};CShape.prototype.convertPixToMM=function(pix){var drawingObjects=getDrawingObjects_Sp(this);var _ret=drawingObjects?drawingObjects.convertMetric(AscCommon.AscBrowser.convertToRetinaValue(pix,true),0,3):0;return _ret}; CShape.prototype.getCanvasContext=function(){var drawingObjects=getDrawingObjects_Sp(this);return drawingObjects?drawingObjects.getCanvasContext():null};CShape.prototype.getCompiledStyle=function(){return this.style};CShape.prototype.getHierarchy=function(){return[]};CShape.prototype.getParentObjects=function(){return{slide:null,layout:null,master:null,theme:window["Asc"]["editor"].wbModel.theme}};CShape.prototype.recalcText=function(){this.recalcInfo.recalculateContent=true;this.recalcInfo.recalculateTransformText= true};CShape.prototype.recalculate=function(){if(this.bDeleted)return;AscFormat.ExecuteNoHistory(function(){var bRecalcShadow=this.recalcInfo.recalculateBrush||this.recalcInfo.recalculatePen||this.recalcInfo.recalculateTransform||this.recalcInfo.recalculateGeometry||this.recalcInfo.recalculateBounds;if(this.recalcInfo.recalculateBrush){this.recalculateBrush();this.recalcInfo.recalculateBrush=false}if(this.recalcInfo.recalculatePen){this.recalculatePen();this.recalcInfo.recalculatePen=false}if(this.recalcInfo.recalculateTransform){this.recalculateTransform(); this.recalculateSnapArrays();this.recalcInfo.recalculateTransform=false}if(this.recalcInfo.recalculateGeometry){this.recalculateGeometry();this.recalcInfo.recalculateGeometry=false}if(this.recalcInfo.recalculateContent){this.recalcInfo.oContentMetrics=this.recalculateContent();this.recalcInfo.recalculateContent=false}if(this.recalcInfo.recalculateTransformText){this.recalculateTransformText();this.recalcInfo.recalculateTransformText=false}if(this.recalcInfo.recalculateBounds){this.recalculateBounds(); this.recalcInfo.recalculateBounds=false}if(bRecalcShadow)this.recalculateShdw();this.clearCropObject()},this,[])};CShape.prototype.recalculateBounds=function(){var boundsChecker=new AscFormat.CSlideBoundsChecker;this.draw(boundsChecker);boundsChecker.CorrectBounds();this.bounds.x=boundsChecker.Bounds.min_x;this.bounds.y=boundsChecker.Bounds.min_y;this.bounds.l=boundsChecker.Bounds.min_x;this.bounds.t=boundsChecker.Bounds.min_y;this.bounds.r=boundsChecker.Bounds.max_x;this.bounds.b=boundsChecker.Bounds.max_y; this.bounds.w=boundsChecker.Bounds.max_x-boundsChecker.Bounds.min_x;this.bounds.h=boundsChecker.Bounds.max_y-boundsChecker.Bounds.min_y;if(this.drawingBase&&!this.group)this.drawingBase.checkBoundsFromTo()};CShape.prototype.recalculateContent=function(){var content=this.getDocContent();if(content){var body_pr=this.getBodyPr();var oRecalcObj=this.recalculateDocContent(content,body_pr);this.contentWidth=oRecalcObj.w;this.contentHeight=oRecalcObj.contentH;if(this.txBody){this.txBody.contentWidth=this.contentWidth; this.txBody.contentHeight=this.contentHeight}this.recalcInfo.oContentMetrics=oRecalcObj;if(this.recalcInfo.recalcTitle){this.recalcInfo.bRecalculatedTitle=true;this.recalcInfo.recalcTitle=null;var oTextWarpContent=this.checkTextWarp(content,body_pr,oRecalcObj.textRectW+oRecalcObj.correctW,oRecalcObj.textRectH+oRecalcObj.correctH,true,false);this.txWarpStructParamarks=oTextWarpContent.oTxWarpStructParamarksNoTransform;this.txWarpStruct=oTextWarpContent.oTxWarpStructNoTransform;this.txWarpStructParamarksNoTransform= oTextWarpContent.oTxWarpStructParamarksNoTransform;this.txWarpStructNoTransform=oTextWarpContent.oTxWarpStructNoTransform}else{var oTextWarpContent=this.checkTextWarp(content,body_pr,oRecalcObj.textRectW+oRecalcObj.correctW,oRecalcObj.textRectH+oRecalcObj.correctH,true,true);this.txWarpStructParamarks=oTextWarpContent.oTxWarpStructParamarks;this.txWarpStruct=oTextWarpContent.oTxWarpStruct;this.txWarpStructParamarksNoTransform=oTextWarpContent.oTxWarpStructParamarksNoTransform;this.txWarpStructNoTransform= oTextWarpContent.oTxWarpStructNoTransform}return oRecalcObj}else{this.txWarpStructParamarks=null;this.txWarpStruct=null;this.txWarpStructParamarksNoTransform=null;this.txWarpStructNoTransform=null;this.recalcInfo.warpGeometry=null}return null};CShape.prototype.Get_ColorMap=function(){return G_O_DEFAULT_COLOR_MAP};CShape.prototype.getStyles=function(index){return this.Get_Styles(index)};CShape.prototype.Get_Worksheet=function(){return this.worksheet};CShape.prototype.Set_CurrentElement=function(){var drawing_objects= this.getDrawingObjectsController();if(drawing_objects){drawing_objects.resetSelection(true);if(this.group){var main_group=this.group.getMainGroup();drawing_objects.selectObject(main_group,0);main_group.selectObject(this,0);main_group.selection.textSelection=this;drawing_objects.selection.groupSelection=main_group}else{drawing_objects.selectObject(this,0);drawing_objects.selection.textSelection=this}}};AscFormat.CTextBody.prototype.Get_Worksheet=function(){return this.parent&&this.parent.Get_Worksheet&& this.parent.Get_Worksheet()};AscFormat.CTextBody.prototype.getDrawingDocument=function(){var oCellApi=window["Asc"]&&window["Asc"]["editor"];if(oCellApi&&oCellApi.wbModel)return oCellApi.wbModel.DrawingDocument;return null};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].G_O_DEFAULT_COLOR_MAP=G_O_DEFAULT_COLOR_MAP;window["AscFormat"].addToDrawings=addToDrawings})(window);"use strict";(function(window,undefined){var CShape=AscFormat.CShape;var CImageShape=AscFormat.CImageShape;CImageShape.prototype.addToDrawingObjects= CShape.prototype.addToDrawingObjects;CImageShape.prototype.setDrawingObjects=CShape.prototype.setDrawingObjects;CImageShape.prototype.setDrawingBase=CShape.prototype.setDrawingBase;CImageShape.prototype.deleteDrawingBase=CShape.prototype.deleteDrawingBase;CImageShape.prototype.addToRecalculate=CShape.prototype.addToRecalculate;CImageShape.prototype.convertPixToMM=CShape.prototype.convertPixToMM;CImageShape.prototype.getCanvasContext=CShape.prototype.getCanvasContext;CImageShape.prototype.getHierarchy= CShape.prototype.getHierarchy;CImageShape.prototype.getParentObjects=CShape.prototype.getParentObjects;CImageShape.prototype.recalculateTransform=CShape.prototype.recalculateTransform;CImageShape.prototype.recalculateBounds=CShape.prototype.recalculateBounds;CImageShape.prototype.deselect=CShape.prototype.deselect;CImageShape.prototype.hitInBoundingRect=CShape.prototype.hitInBoundingRect;CImageShape.prototype.getRotateAngle=CShape.prototype.getRotateAngle;CImageShape.prototype.setWorksheet=CShape.prototype.setWorksheet; CImageShape.prototype.getDrawingObjectsController=CShape.prototype.getDrawingObjectsController;CImageShape.prototype.Is_UseInDocument=CShape.prototype.Is_UseInDocument;CImageShape.prototype.getEditorType=function(){return 0};CImageShape.prototype.setRecalculateInfo=function(){this.recalcInfo={recalculateBrush:true,recalculatePen:true,recalculateTransform:true,recalculateBounds:true,recalculateGeometry:true,recalculateStyle:true,recalculateFill:true,recalculateLine:true,recalculateTransparent:true}; this.lockType=AscCommon.c_oAscLockTypes.kLockTypeNone};CImageShape.prototype.checkNeedRecalculate=function(){return this.recalcInfo.recalculateTransform===true};CImageShape.prototype.recalcBrush=function(){this.recalcInfo.recalculateBrush=true};CImageShape.prototype.recalcPen=function(){this.recalcInfo.recalculatePen=true};CImageShape.prototype.recalcTransform=function(){this.recalcInfo.recalculateTransform=true};CImageShape.prototype.recalcBounds=function(){this.recalcInfo.recalculateBounds=true}; CImageShape.prototype.recalcGeometry=function(){this.recalcInfo.recalculateGeometry=true};CImageShape.prototype.recalcStyle=function(){this.recalcInfo.recalculateStyle=true};CImageShape.prototype.recalcFill=function(){this.recalcInfo.recalculateFill=true};CImageShape.prototype.recalcLine=function(){this.recalcInfo.recalculateLine=true};CImageShape.prototype.recalcTransparent=function(){this.recalcInfo.recalculateTransparent=true};CImageShape.prototype.handleUpdatePosition=function(){this.recalcTransform(); this.recalcBounds();this.addToRecalculate()};CImageShape.prototype.handleUpdateExtents=function(){this.recalcGeometry();this.recalcBounds();this.recalcTransform();this.addToRecalculate()};CImageShape.prototype.handleUpdateRot=function(){this.recalcTransform();this.recalcBounds();this.addToRecalculate()};CImageShape.prototype.handleUpdateFlip=function(){this.recalcTransform();this.addToRecalculate()};CImageShape.prototype.handleUpdateFill=function(){this.recalcBrush();this.addToRecalculate()};CImageShape.prototype.handleUpdateGeometry= function(){this.recalcBounds();this.recalcGeometry();this.addToRecalculate()};CImageShape.prototype.convertPixToMM=CShape.prototype.convertPixToMM;CImageShape.prototype.getCanvasContext=CShape.prototype.getCanvasContext;CImageShape.prototype.getCompiledStyle=CShape.prototype.getCompiledStyle;CImageShape.prototype.getHierarchy=CShape.prototype.getHierarchy;CImageShape.prototype.getParentObjects=CShape.prototype.getParentObjects;CImageShape.prototype.recalculate=function(){if(this.bDeleted)return;AscFormat.ExecuteNoHistory(function(){var bRecalcShadow= this.recalcInfo.recalculateBrush||this.recalcInfo.recalculatePen||this.recalcInfo.recalculateTransform||this.recalcInfo.recalculateGeometry||this.recalcInfo.recalculateBounds;if(this.recalcInfo.recalculateBrush){this.recalculateBrush();this.recalcInfo.recalculateBrush=false}if(this.recalcInfo.recalculatePen){this.recalculatePen();this.recalcInfo.recalculatePen=false}if(this.recalcInfo.recalculateTransform){this.recalculateTransform();this.recalculateSnapArrays();this.recalcInfo.recalculateTransform= false}if(this.recalcInfo.recalculateGeometry){this.recalculateGeometry();this.recalcInfo.recalculateGeometry=false}if(this.recalcInfo.recalculateBounds){this.recalculateBounds();this.recalcInfo.recalculateBounds=false}if(bRecalcShadow)this.recalculateShdw();this.clearCropObject()},this,[])};CImageShape.prototype.recalculateBounds=CShape.prototype.recalculateBounds;CImageShape.prototype.hitInInnerArea=CShape.prototype.hitInInnerArea;CImageShape.prototype.hitInPath=CShape.prototype.hitInPath;CImageShape.prototype.hitInBoundingRect= CShape.prototype.hitInBoundingRect;CImageShape.prototype.check_bounds=CShape.prototype.check_bounds;CImageShape.prototype.Clear_ContentChanges=function(){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Clear()};CImageShape.prototype.Add_ContentChanges=function(Changes){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Add(Changes)};CImageShape.prototype.Refresh_ContentChanges=function(){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Refresh()}})(window); "use strict";(function(window,undefined){var CShape=AscFormat.CShape;var CGroupShape=AscFormat.CGroupShape;CGroupShape.prototype.addToRecalculate=function(){if(this.drawingObjects&&this.drawingObjects.controller)this.drawingObjects.controller.objectsForRecalculate[this.Id]=this};CGroupShape.prototype.getEditorType=function(){return 0};CGroupShape.prototype.handleUpdateFill=function(){for(var i=0;i<this.spTree.length;++i)this.spTree[i].handleUpdateFill();this.addToRecalculate()};CGroupShape.prototype.handleUpdateLn= function(){for(var i=0;i<this.spTree.length;++i)this.spTree[i].handleUpdateLn();this.addToRecalculate()};CGroupShape.prototype.recalcText=function(){if(this.spTree)for(var i=0;i<this.spTree.length;++i)if(this.spTree[i].recalcText)this.spTree[i].recalcText()};CGroupShape.prototype.setRecalculateInfo=function(){this.recalcInfo={recalculateBrush:true,recalculatePen:true,recalculateTransform:true,recalculateArrGraphicObjects:true,recalculateBounds:true,recalculateScaleCoefficients:true};this.localTransform= new AscCommon.CMatrix;this.lockType=AscCommon.c_oAscLockTypes.kLockTypeNone};CGroupShape.prototype.recalcTransform=function(){this.recalcInfo.recalculateScaleCoefficients=true;this.recalcInfo.recalculateTransform=true;for(var i=0;i<this.spTree.length;++i)this.spTree[i].recalcTransform()};CGroupShape.prototype.recalcBounds=function(){this.recalcInfo.recalculateBounds=true};CGroupShape.prototype.addToDrawingObjects=CShape.prototype.addToDrawingObjects;CGroupShape.prototype.getDrawingObjectsController= CShape.prototype.getDrawingObjectsController;CGroupShape.prototype.Is_UseInDocument=CShape.prototype.Is_UseInDocument;CGroupShape.prototype.setDrawingObjects=function(drawingObjects){this.drawingObjects=drawingObjects;for(var i=0;i<this.spTree.length;++i)this.spTree[i].setDrawingObjects(drawingObjects)};CGroupShape.prototype.setDrawingBase=CShape.prototype.setDrawingBase;CGroupShape.prototype.deleteDrawingBase=CShape.prototype.deleteDrawingBase;CGroupShape.prototype.addToRecalculate=CShape.prototype.addToRecalculate; CGroupShape.prototype.convertPixToMM=CShape.prototype.convertPixToMM;CGroupShape.prototype.getCanvasContext=CShape.prototype.getCanvasContext;CGroupShape.prototype.getHierarchy=CShape.prototype.getHierarchy;CGroupShape.prototype.getParentObjects=CShape.prototype.getParentObjects;CGroupShape.prototype.recalculateTransform=CShape.prototype.recalculateTransform;CGroupShape.prototype.recalculateBounds=function(){var sp_tree=this.spTree;var x_arr_max=[],y_arr_max=[],x_arr_min=[],y_arr_min=[];for(var i= 0;i<sp_tree.length;++i){sp_tree[i].recalculate();var bounds=sp_tree[i].bounds;var l=bounds.l;var r=bounds.r;var t=bounds.t;var b=bounds.b;x_arr_max.push(r);x_arr_min.push(l);y_arr_max.push(b);y_arr_min.push(t)}if(!this.group){var tr=this.localTransform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0,0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.extX,0));arr_p_y.push(tr.TransformPointY(this.extX,0));arr_p_x.push(tr.TransformPointX(this.extX,this.extY)); arr_p_y.push(tr.TransformPointY(this.extX,this.extY));arr_p_x.push(tr.TransformPointX(0,this.extY));arr_p_y.push(tr.TransformPointY(0,this.extY));x_arr_max=x_arr_max.concat(arr_p_x);x_arr_min=x_arr_min.concat(arr_p_x);y_arr_max=y_arr_max.concat(arr_p_y);y_arr_min=y_arr_min.concat(arr_p_y)}this.bounds.x=Math.min.apply(Math,x_arr_min);this.bounds.y=Math.min.apply(Math,y_arr_min);this.bounds.l=this.bounds.x;this.bounds.t=this.bounds.y;this.bounds.r=Math.max.apply(Math,x_arr_max);this.bounds.b=Math.max.apply(Math, y_arr_max);this.bounds.w=this.bounds.r-this.bounds.l;this.bounds.h=this.bounds.b-this.bounds.t;if(this.drawingBase&&!this.group)this.drawingBase.checkBoundsFromTo()};CGroupShape.prototype.deselect=CShape.prototype.deselect;CGroupShape.prototype.hitInBoundingRect=CShape.prototype.hitInBoundingRect;CGroupShape.prototype.getRotateAngle=CShape.prototype.getRotateAngle;CGroupShape.prototype.handleUpdatePosition=function(){this.handleUpdateExtents(true)};CGroupShape.prototype.handleUpdateExtents=function(bExt){this.recalcTransform(); this.recalcBounds();this.addToRecalculate();if(this.spTree)for(var i=0;i<this.spTree.length;++i)this.spTree[i].handleUpdateExtents(bExt)};CGroupShape.prototype.handleUpdateRot=function(){this.handleUpdateExtents(true)};CGroupShape.prototype.handleUpdateFlip=CGroupShape.prototype.handleUpdatePosition;CGroupShape.prototype.handleUpdateChildOffset=CGroupShape.prototype.handleUpdatePosition;CGroupShape.prototype.handleUpdateChildExtents=CGroupShape.prototype.handleUpdatePosition;CGroupShape.prototype.updatePosition= CShape.prototype.updatePosition;CGroupShape.prototype.recalculate=function(){if(this.bDeleted)return;AscFormat.ExecuteNoHistory(function(){if(this.recalcInfo.recalculateBrush){this.recalculateBrush();this.recalcInfo.recalculateBrush=false}if(this.recalcInfo.recalculatePen){this.recalculatePen();this.recalcInfo.recalculatePen=false}if(this.recalcInfo.recalculateArrGraphicObjects){this.recalculateArrGraphicObjects();this.recalcInfo.recalculateArrGraphicObjects=false}if(this.recalcInfo.recalculateTransform){this.recalculateTransform(); this.recalculateSnapArrays();this.recalcInfo.recalculateTransform=false}for(var i=0;i<this.spTree.length;++i)this.spTree[i].recalculate();if(this.recalcInfo.recalculateBounds){this.recalculateBounds();this.recalcInfo.recalculateBounds=false}},this,[])};CGroupShape.prototype.Clear_ContentChanges=function(){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Clear()};CGroupShape.prototype.Add_ContentChanges=function(Changes){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Add(Changes)}; CGroupShape.prototype.Refresh_ContentChanges=function(){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Refresh()}})(window);"use strict";(function(window,undefined){var CShape=AscFormat.CShape;var CChartSpace=AscFormat.CChartSpace;CChartSpace.prototype.addToDrawingObjects=CShape.prototype.addToDrawingObjects;CChartSpace.prototype.setDrawingObjects=CShape.prototype.setDrawingObjects;CChartSpace.prototype.setDrawingBase=CShape.prototype.setDrawingBase;CChartSpace.prototype.deleteDrawingBase= CShape.prototype.deleteDrawingBase;CChartSpace.prototype.getDrawingObjectsController=CShape.prototype.getDrawingObjectsController;CChartSpace.prototype.Is_UseInDocument=CShape.prototype.Is_UseInDocument;CChartSpace.prototype.getEditorType=function(){return 0};CChartSpace.prototype.recalculateTransform=function(){CShape.prototype.recalculateTransform.call(this);this.localTransform.Reset()};CChartSpace.prototype.recalcText=function(){this.recalcInfo.recalculateAxisLabels=true;this.recalcTitles2();this.handleUpdateInternalChart(false)}; CChartSpace.prototype.recalculateBounds=CShape.prototype.recalculateBounds;CChartSpace.prototype.deselect=CShape.prototype.deselect;CChartSpace.prototype.hitInBoundingRect=CShape.prototype.hitInBoundingRect;CChartSpace.prototype.getRotateAngle=CShape.prototype.getRotateAngle;CChartSpace.prototype.getInvertTransform=CShape.prototype.getInvertTransform;CChartSpace.prototype.hit=CShape.prototype.hit;CChartSpace.prototype.hitInInnerArea=CShape.prototype.hitInInnerArea;CChartSpace.prototype.hitInPath= CShape.prototype.hitInPath;CChartSpace.prototype.check_bounds=CShape.prototype.check_bounds;CChartSpace.prototype.setWorksheet=CShape.prototype.setWorksheet;CChartSpace.prototype.handleUpdateLn=function(){this.recalcInfo.recalculatePenBrush=true;this.recalcInfo.recalculatePlotAreaPen=true;this.addToRecalculate()};CChartSpace.prototype.setRecalculateInfo=function(){this.recalcInfo={recalcTitle:null,bRecalculatedTitle:false,recalculateTransform:true,recalculateBounds:true,recalculateChart:true,recalculateSeriesColors:true, recalculateMarkers:true,recalculateGridLines:true,recalculateDLbls:true,recalculateAxisLabels:true,dataLbls:[],axisLabels:[],recalculateAxisVal:true,recalculateAxisTickMark:true,recalculateBrush:true,recalculatePen:true,recalculatePlotAreaBrush:true,recalculatePlotAreaPen:true,recalculateHiLowLines:true,recalculateUpDownBars:true,recalculateLegend:true,recalculateReferences:true,recalculateBBox:true,recalculateFormulas:true,recalculatePenBrush:true,recalculateTextPr:true,recalculateBBoxRange:true}; this.chartObj=null;this.rectGeometry=AscFormat.ExecuteNoHistory(function(){return AscFormat.CreateGeometry("rect")},this,[]);this.lockType=AscCommon.c_oAscLockTypes.kLockTypeNone};CChartSpace.prototype.checkNeedRecalculate=function(){return this.recalcInfo.recalculateChart===true};CChartSpace.prototype.recalcTransform=function(){this.recalcInfo.recalculateTransform=true};CChartSpace.prototype.recalcBounds=function(){this.recalcInfo.recalculateBounds=true};CChartSpace.prototype.recalcChart=function(){this.recalcInfo.recalculateChart= true};CChartSpace.prototype.recalcSeriesColors=function(){this.recalcInfo.recalculateSeriesColors=true;this.recalcInfo.recalculatePenBrush=true;this.recalcInfo.recalculatePlotAreaBrush=true};CChartSpace.prototype.recalcDLbls=function(){this.recalcInfo.recalculateDLbls=true};CChartSpace.prototype.addToRecalculate=CShape.prototype.addToRecalculate;CChartSpace.prototype.handleUpdatePosition=function(){this.recalcTransform();this.recalcBounds();for(var i=0;i<this.userShapes.length;++i)if(this.userShapes[i].object)this.userShapes[i].object.handleUpdateExtents(); this.addToRecalculate()};CChartSpace.prototype.handleUpdateFlip=function(){this.recalcTransform();this.addToRecalculate()};CChartSpace.prototype.handleUpdateChart=function(){this.recalcChart();this.setRecalculateInfo();this.addToRecalculate()};CChartSpace.prototype.handleUpdateStyle=function(){this.recalcInfo.recalculateSeriesColors=true;this.recalcInfo.recalculatePenBrush=true;this.recalcInfo.recalculateLegend=true;this.recalcInfo.recalculatePlotAreaBrush=true;this.recalcInfo.recalculatePlotAreaPen= true;this.recalcInfo.recalculateBrush=true;this.recalcInfo.recalculatePen=true;this.recalcInfo.recalculateHiLowLines=true;this.recalcInfo.recalculateUpDownBars=true;this.handleTitlesAfterChangeTheme();this.recalcInfo.recalculateAxisLabels=true;this.recalcInfo.recalculateAxisVal=true;this.addToRecalculate()};CChartSpace.prototype.handleUpdateFill=function(){this.recalcInfo.recalculatePenBrush=true;this.recalcInfo.recalculatePlotAreaBrush=true;this.recalcInfo.recalculateBrush=true;this.recalcInfo.recalculateChart= true;this.recalcInfo.recalculateSeriesColors=true;this.recalcInfo.recalculateMarkers=true;this.addToRecalculate()};CChartSpace.prototype.handleUpdateLn=function(){this.recalcInfo.recalculatePenBrush=true;this.recalcInfo.recalculatePlotAreaPen=true;this.recalcInfo.recalculatePen=true;this.recalcInfo.recalculateChart=true;this.recalcInfo.recalculateSeriesColors=true;this.recalcInfo.recalculateMarkers=true;this.addToRecalculate()};CChartSpace.prototype.convertPixToMM=CShape.prototype.convertPixToMM; CChartSpace.prototype.getCanvasContext=CShape.prototype.getCanvasContext;CChartSpace.prototype.getHierarchy=CShape.prototype.getHierarchy;CChartSpace.prototype.getParentObjects=function(){var parents={slide:null,layout:null,master:null,theme:this.themeOverride?this.themeOverride:window["Asc"]["editor"].wbModel.theme};if(this.clrMapOvr)parents.slide={clrMap:this.clrMapOvr};return parents};CChartSpace.prototype.recalculateTransform=CShape.prototype.recalculateTransform;CChartSpace.prototype.createResizeTrack= CShape.prototype.createResizeTrack;CChartSpace.prototype.createMoveTrack=CShape.prototype.createMoveTrack;CChartSpace.prototype.getRectBounds=CShape.prototype.getRectBounds;CChartSpace.prototype.recalculateBounds=function(){var transform=this.transform;var a_x=[];var a_y=[];a_x.push(transform.TransformPointX(0,0));a_y.push(transform.TransformPointY(0,0));a_x.push(transform.TransformPointX(this.extX,0));a_y.push(transform.TransformPointY(this.extX,0));a_x.push(transform.TransformPointX(this.extX,this.extY)); a_y.push(transform.TransformPointY(this.extX,this.extY));a_x.push(transform.TransformPointX(0,this.extY));a_y.push(transform.TransformPointY(0,this.extY));this.bounds.l=Math.min.apply(Math,a_x);this.bounds.t=Math.min.apply(Math,a_y);this.bounds.r=Math.max.apply(Math,a_x);this.bounds.b=Math.max.apply(Math,a_y);this.bounds.w=this.bounds.r-this.bounds.l;this.bounds.h=this.bounds.b-this.bounds.t;this.bounds.x=this.bounds.l;this.bounds.y=this.bounds.t;if(this.drawingBase&&!this.group)this.drawingBase.checkBoundsFromTo()}; CChartSpace.prototype.recalculate=function(){if(this.bDeleted)return;AscFormat.ExecuteNoHistory(function(){this.updateLinks();if(this.recalcInfo.recalcTitle){this.recalculateChartTitleEditMode();this.recalcInfo.recalcTitle.updatePosition(this.transform.tx,this.transform.ty);this.recalcInfo.recalcTitle=null;this.recalcInfo.bRecalculatedTitle=true}var b_transform=false;var bCheckLabels=false;if(this.recalcInfo.recalculateTransform){this.recalculateTransform();this.recalculateSnapArrays();this.rectGeometry.Recalculate(this.extX, this.extY);this.recalcInfo.recalculateTransform=false;b_transform=true}if(this.recalcInfo.recalculateReferences){this.recalculateReferences();this.recalcInfo.recalculateReferences=false}if(this.recalcInfo.recalculateBBox){this.recalculateBBox();this.recalcInfo.recalculateBBox=false}if(this.recalcInfo.recalculateMarkers){this.recalculateMarkers();this.recalcInfo.recalculateMarkers=false}if(this.recalcInfo.recalculateSeriesColors){this.recalculateSeriesColors();this.recalcInfo.recalculateSeriesColors= false;this.recalcInfo.recalculatePenBrush=true}if(this.recalcInfo.recalculateGridLines){this.recalculateGridLines();this.recalcInfo.recalculateGridLines=false}if(this.recalcInfo.recalculateAxisTickMark){this.recalculateAxisTickMark();this.recalcInfo.recalculateAxisTickMark=false}if(this.recalcInfo.recalculateDLbls){this.recalculateDLbls();this.recalcInfo.recalculateDLbls=false}if(this.recalcInfo.recalculateBrush){this.recalculateChartBrush();this.recalcInfo.recalculateBrush=false}if(this.recalcInfo.recalculatePen){this.recalculateChartPen(); this.recalcInfo.recalculatePen=false}if(this.recalcInfo.recalculateHiLowLines){this.recalculateHiLowLines();this.recalcInfo.recalculateHiLowLines=false}if(this.recalcInfo.recalculatePlotAreaBrush){this.recalculatePlotAreaChartBrush();this.recalculateWalls();this.recalcInfo.recalculatePlotAreaBrush=false}if(this.recalcInfo.recalculatePlotAreaPen){this.recalculatePlotAreaChartPen();this.recalcInfo.recalculatePlotAreaPen=false}if(this.recalcInfo.recalculateUpDownBars){this.recalculateUpDownBars();this.recalcInfo.recalculateUpDownBars= false}var b_recalc_labels=false;if(this.recalcInfo.recalculateAxisLabels){this.recalculateAxisLabels();this.recalcInfo.recalculateAxisLabels=false;b_recalc_labels=true}var b_recalc_legend=false;if(this.recalcInfo.recalculateLegend){this.recalculateLegend();this.recalcInfo.recalculateLegend=false;b_recalc_legend=true}if(this.recalcInfo.recalculateAxisVal){if(AscFormat.CChartsDrawer.prototype._isSwitchCurrent3DChart(this))this.recalculateAxis();else this.recalculateAxes();this.recalcInfo.recalculateAxisVal= false;bCheckLabels=true}if(this.recalcInfo.recalculatePenBrush){this.recalculatePenBrush();this.recalcInfo.recalculatePenBrush=false}if(this.recalcInfo.recalculateChart){this.recalculateChart();this.recalcInfo.recalculateChart=false;if(bCheckLabels&&this.chartObj.nDimensionCount===3)this.checkAxisLabelsTransform()}this.calculateLabelsPositions(b_recalc_labels,b_recalc_legend);if(this.recalcInfo.recalculateBounds){this.recalculateBounds();this.recalcInfo.recalculateBounds=false}if(this.recalcInfo.recalculateTextPr){this.recalculateTextPr(); this.recalcInfo.recalculateTextPr=false}this.recalculateUserShapes();{this.updateChildLabelsTransform(this.transform.tx,this.transform.ty)}this.recalcInfo.dataLbls.length=0;this.recalcInfo.axisLabels.length=0;this.bNeedUpdatePosition=true},this,[])};CChartSpace.prototype.deselect=CShape.prototype.deselect;CChartSpace.prototype.getDrawingDocument=CShape.prototype.getDrawingDocument;CChartSpace.prototype.recalculateLocalTransform=CShape.prototype.recalculateLocalTransform;CChartSpace.prototype.Get_Theme= CShape.prototype.Get_Theme;CChartSpace.prototype.Get_ColorMap=CShape.prototype.Get_ColorMap;CChartSpace.prototype.Clear_ContentChanges=function(){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Clear()};CChartSpace.prototype.Add_ContentChanges=function(Changes){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Add(Changes)};CChartSpace.prototype.Refresh_ContentChanges=function(){if(this.worksheet&&this.worksheet.contentChanges)this.worksheet.contentChanges.Refresh()}})(window); "use strict";(function(undefined){function CLockedCanvas(){AscFormat.CGroupShape.call(this)}CLockedCanvas.prototype=Object.create(AscFormat.CGroupShape.prototype);CLockedCanvas.prototype.constructor=CLockedCanvas;CLockedCanvas.prototype.getObjectType=function(){return AscDFH.historyitem_type_LockedCanvas};CLockedCanvas.prototype.canRotate=function(){return false};CLockedCanvas.prototype.recalculateBounds=function(){var tr=this.localTransform;var arr_p_x=[];var arr_p_y=[];arr_p_x.push(tr.TransformPointX(0, 0));arr_p_y.push(tr.TransformPointY(0,0));arr_p_x.push(tr.TransformPointX(this.extX,0));arr_p_y.push(tr.TransformPointY(this.extX,0));arr_p_x.push(tr.TransformPointX(this.extX,this.extY));arr_p_y.push(tr.TransformPointY(this.extX,this.extY));arr_p_x.push(tr.TransformPointX(0,this.extY));arr_p_y.push(tr.TransformPointY(0,this.extY));this.bounds.x=Math.min.apply(Math,arr_p_x);this.bounds.y=Math.min.apply(Math,arr_p_y);this.bounds.l=this.bounds.x;this.bounds.t=this.bounds.y;this.bounds.r=Math.max.apply(Math, arr_p_x);this.bounds.b=Math.max.apply(Math,arr_p_y);this.bounds.w=this.bounds.r-this.bounds.l;this.bounds.h=this.bounds.b-this.bounds.t};CLockedCanvas.prototype.draw=function(graphics){AscFormat.CGroupShape.prototype.draw.call(this,graphics)};CLockedCanvas.prototype.hitInPath=function(){return false};CLockedCanvas.prototype.copy=function(oPr){var copy=new CLockedCanvas;return this.copy2(copy,oPr)};CLockedCanvas.prototype.hitInInnerArea=function(x,y){var invert_transform=this.getInvertTransform(); if(!invert_transform)return false;var x_t=invert_transform.TransformPointX(x,y);var y_t=invert_transform.TransformPointY(x,y);return x_t>0&&x_t<this.extX&&y_t>0&&y_t<this.extY};CLockedCanvas.prototype.hit=function(x,y){return this.hitInInnerArea(x,y)};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CLockedCanvas=CLockedCanvas})();"use strict";(function(){AscDFH.drawingsChangesMap[AscDFH.historyitem_SlicerViewName]=function(oClass,value){oClass.name=value;oClass.data.clear();oClass.removeAllButtonsTmpState(); oClass.handleUpdateExtents()};AscDFH.changesFactory[AscDFH.historyitem_SlicerViewName]=window["AscDFH"].CChangesDrawingsString;var LEFT_PADDING=2.54;var RIGHT_PADDING=LEFT_PADDING;var BOTTOM_PADDING=LEFT_PADDING;var TOP_PADDING=LEFT_PADDING/2;var SPACE_BETWEEN=LEFT_PADDING*14/37;var HEADER_BUTTON_WIDTH=20*AscCommon.g_dKoef_pix_to_mm;var HEADER_TOP_PADDING=LEFT_PADDING/4;var HEADER_BOTTOM_PADDING=HEADER_TOP_PADDING;var HEADER_LEFT_PADDING=LEFT_PADDING;var HEADER_RIGHT_PADDING=HEADER_TOP_PADDING+RIGHT_PADDING+ 2*HEADER_BUTTON_WIDTH;var SCROLL_WIDTH=15*25.4/96;var SCROLLER_WIDTH=13*25.4/96;var STATE_FLAG_WHOLE=1;var STATE_FLAG_HEADER=2;var STATE_FLAG_SELECTED=4;var STATE_FLAG_DATA=8;var STATE_FLAG_HOVERED=16;var SCROLL_TIMER_INTERVAL=200;var LOCKED_ALPHA=51;var STYLE_TYPE={};STYLE_TYPE.WHOLE=STATE_FLAG_WHOLE;STYLE_TYPE.HEADER=STATE_FLAG_HEADER;STYLE_TYPE.SELECTED_DATA=STATE_FLAG_SELECTED|STATE_FLAG_DATA|0;STYLE_TYPE.SELECTED_NO_DATA=STATE_FLAG_SELECTED|0|0;STYLE_TYPE.UNSELECTED_DATA=0|STATE_FLAG_DATA|0; STYLE_TYPE.UNSELECTED_NO_DATA=0|0|0;STYLE_TYPE.HOVERED_SELECTED_DATA=STATE_FLAG_SELECTED|STATE_FLAG_DATA|STATE_FLAG_HOVERED;STYLE_TYPE.HOVERED_SELECTED_NO_DATA=STATE_FLAG_SELECTED|0|STATE_FLAG_HOVERED;STYLE_TYPE.HOVERED_UNSELECTED_DATA=0|STATE_FLAG_DATA|STATE_FLAG_HOVERED;STYLE_TYPE.HOVERED_UNSELECTED_NO_DATA=0|0|STATE_FLAG_HOVERED;var SCROLL_COLORS={};SCROLL_COLORS[STYLE_TYPE.WHOLE]=15856113;SCROLL_COLORS[STYLE_TYPE.HEADER]=15856113;SCROLL_COLORS[STYLE_TYPE.SELECTED_DATA]=11382189;SCROLL_COLORS[STYLE_TYPE.SELECTED_NO_DATA]= 11382189;SCROLL_COLORS[STYLE_TYPE.UNSELECTED_DATA]=15856113;SCROLL_COLORS[STYLE_TYPE.UNSELECTED_NO_DATA]=15856113;SCROLL_COLORS[STYLE_TYPE.HOVERED_SELECTED_DATA]=11382189;SCROLL_COLORS[STYLE_TYPE.HOVERED_SELECTED_NO_DATA]=11382189;SCROLL_COLORS[STYLE_TYPE.HOVERED_UNSELECTED_DATA]=13619151;SCROLL_COLORS[STYLE_TYPE.HOVERED_UNSELECTED_NO_DATA]=13619151;var SCROLL_BUTTON_TYPE_LEFT=0;var SCROLL_BUTTON_TYPE_TOP=1;var SCROLL_BUTTON_TYPE_RIGHT=2;var SCROLL_BUTTON_TYPE_BOTTOM=3;var SCROLL_ARROW_COLORS={}; SCROLL_ARROW_COLORS[STYLE_TYPE.WHOLE]=15856113;SCROLL_ARROW_COLORS[STYLE_TYPE.HEADER]=15856113;SCROLL_ARROW_COLORS[STYLE_TYPE.SELECTED_DATA]=16777215;SCROLL_ARROW_COLORS[STYLE_TYPE.SELECTED_NO_DATA]=16777215;SCROLL_ARROW_COLORS[STYLE_TYPE.UNSELECTED_DATA]=11382189;SCROLL_ARROW_COLORS[STYLE_TYPE.UNSELECTED_NO_DATA]=11382189;SCROLL_ARROW_COLORS[STYLE_TYPE.HOVERED_SELECTED_DATA]=16777215;SCROLL_ARROW_COLORS[STYLE_TYPE.HOVERED_SELECTED_NO_DATA]=16777215;SCROLL_ARROW_COLORS[STYLE_TYPE.HOVERED_UNSELECTED_DATA]= 16777215;SCROLL_ARROW_COLORS[STYLE_TYPE.HOVERED_UNSELECTED_NO_DATA]=16777215;var HEADER_BUTTON_COLORS={};HEADER_BUTTON_COLORS[STYLE_TYPE.WHOLE]=null;HEADER_BUTTON_COLORS[STYLE_TYPE.HEADER]=null;HEADER_BUTTON_COLORS[STYLE_TYPE.SELECTED_DATA]=8226188;HEADER_BUTTON_COLORS[STYLE_TYPE.SELECTED_NO_DATA]=8226188;HEADER_BUTTON_COLORS[STYLE_TYPE.UNSELECTED_DATA]=null;HEADER_BUTTON_COLORS[STYLE_TYPE.UNSELECTED_NO_DATA]=null;HEADER_BUTTON_COLORS[STYLE_TYPE.HOVERED_SELECTED_DATA]=8226188;HEADER_BUTTON_COLORS[STYLE_TYPE.HOVERED_SELECTED_NO_DATA]= 8226188;HEADER_BUTTON_COLORS[STYLE_TYPE.HOVERED_UNSELECTED_DATA]=14211804;HEADER_BUTTON_COLORS[STYLE_TYPE.HOVERED_UNSELECTED_NO_DATA]=14211804;var ICON_MULTISELECT="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNCA1QzQgNC40NDc3MiA0LjQ0NzcyIDQgNSA0SDE1QzE1LjU1MjMgNCAxNiA0LjQ0NzcyIDE2IDVWNkMxNiA2LjU1MjI4IDE1LjU1MjMgNyAxNSA3SDVDNC40NDc3MiA3IDQgNi41NTIyOCA0IDZWNVpNMTUgMTNINUw1IDE0SDE1VjEzWk01IDEyQzQuNDQ3NzIgMTIgNCAxMi40NDc3IDQgMTNWMTRDNCAxNC41NTIzIDQuNDQ3NzIgMTUgNSAxNUgxNUMxNS41NTIzIDE1IDE2IDE0LjU1MjMgMTYgMTRWMTNDMTYgMTIuNDQ3NyAxNS41NTIzIDEyIDE1IDEySDVaTTUgOEM0LjQ0NzcyIDggNCA4LjQ0NzcyIDQgOVYxMEM0IDEwLjU1MjMgNC40NDc3MiAxMSA1IDExSDE1QzE1LjU1MjMgMTEgMTYgMTAuNTUyMyAxNiAxMFY5QzE2IDguNDQ3NzIgMTUuNTUyMyA4IDE1IDhINVoiIGZpbGw9IiM0NDQ0NDQiLz4NCjwvc3ZnPg0K"; var ICON_MULTISELECT_INVERTED="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNCA1QzQgNC40NDc3MiA0LjQ0NzcyIDQgNSA0SDE1QzE1LjU1MjMgNCAxNiA0LjQ0NzcyIDE2IDVWNkMxNiA2LjU1MjI4IDE1LjU1MjMgNyAxNSA3SDVDNC40NDc3MiA3IDQgNi41NTIyOCA0IDZWNVpNMTUgMTNINUw1IDE0SDE1VjEzWk01IDEyQzQuNDQ3NzIgMTIgNCAxMi40NDc3IDQgMTNWMTRDNCAxNC41NTIzIDQuNDQ3NzIgMTUgNSAxNUgxNUMxNS41NTIzIDE1IDE2IDE0LjU1MjMgMTYgMTRWMTNDMTYgMTIuNDQ3NyAxNS41NTIzIDEyIDE1IDEySDVaTTUgOEM0LjQ0NzcyIDggNCA4LjQ0NzcyIDQgOVYxMEM0IDEwLjU1MjMgNC40NDc3MiAxMSA1IDExSDE1QzE1LjU1MjMgMTEgMTYgMTAuNTUyMyAxNiAxMFY5QzE2IDguNDQ3NzIgMTUuNTUyMyA4IDE1IDhINVoiIGZpbGw9IndoaXRlIi8+DQo8L3N2Zz4NCg=="; var ICON_CLEAR_FILTER="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTAgMTZMOCAxNFYxMEwzIDVIMTVMMTAgMTBWMTZaTTE2LjE0NjQgMTYuODUzNkwxNC41IDE1LjIwNzFMMTIuODUzNiAxNi44NTM2TDEyLjE0NjQgMTYuMTQ2NUwxMy43OTI5IDE0LjVMMTIuMTQ2NCAxMi44NTM2TDEyLjg1MzYgMTIuMTQ2NUwxNC41IDEzLjc5MjlMMTYuMTQ2NCAxMi4xNDY1TDE2Ljg1MzYgMTIuODUzNkwxNS4yMDcxIDE0LjVMMTYuODUzNiAxNi4xNDY1TDE2LjE0NjQgMTYuODUzNloiIGZpbGw9IiM0NDQ0NDQiLz4NCjwvc3ZnPg0K"; var ICON_CLEAR_FILTER_DISABLED="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxnIG9wYWNpdHk9IjAuNCI+DQo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwIDE2TDggMTRWMTBMMyA1SDE1TDEwIDEwVjE2Wk0xNi4xNDY0IDE2Ljg1MzZMMTQuNSAxNS4yMDcxTDEyLjg1MzYgMTYuODUzNkwxMi4xNDY0IDE2LjE0NjVMMTMuNzkyOSAxNC41TDEyLjE0NjQgMTIuODUzNkwxMi44NTM2IDEyLjE0NjVMMTQuNSAxMy43OTI5TDE2LjE0NjQgMTIuMTQ2NUwxNi44NTM2IDEyLjg1MzZMMTUuMjA3MSAxNC41TDE2Ljg1MzYgMTYuMTQ2NUwxNi4xNDY0IDE2Ljg1MzZaIiBmaWxsPSIjNDQ0NDQ0Ii8+DQo8L2c+DQo8L3N2Zz4NCg=="; var oDefaultWrapObject={oTxWarpStruct:null,oTxWarpStructParamarks:null,oTxWarpStructNoTransform:null,oTxWarpStructParamarksNoTransform:null};function getSlicerIconsForLoad(){return[ICON_MULTISELECT,ICON_MULTISELECT_INVERTED,ICON_CLEAR_FILTER,ICON_CLEAR_FILTER_DISABLED]}function getGraphicsScale(graphics){var vector_koef;if(graphics.m_oCoordTransform)vector_koef=1/graphics.m_oCoordTransform.sx;else{var zoom=1,ppiX=96;if(window.Asc&&window.Asc.editor)zoom=window.Asc.editor.asc_getZoom();vector_koef= 25.4/(ppiX*zoom);if(AscCommon.AscBrowser.isRetina)vector_koef/=AscCommon.AscBrowser.retinaPixelRatio}return vector_koef}function setGraphicsSettings(graphics,oBorderPr,oLastBorderPr){var oColor=oBorderPr.c||new AscCommonExcel.RgbColor(0);var oLastColor=null;if(oLastBorderPr)oLastColor=oLastBorderPr.c||new AscCommonExcel.RgbColor(0);if(!oColor.isEqual(oLastColor))graphics.p_color(oColor.getR(),oColor.getG(),oColor.getB(),255);var nW=oBorderPr.w,dW;if(!AscFormat.isRealNumber(nW))nW=1;var vector_koef; vector_koef=getGraphicsScale(graphics);dW=nW*vector_koef;if(!oLastBorderPr||oBorderPr.s!==oLastBorderPr.s){var aDash=oBorderPr.getDashSegments();if(!graphics.m_oCoordTransform){if(!AscFormat.isRealNumber(vector_koef))vector_koef=getGraphicsScale(graphics);for(var nSegment=0;nSegment<aDash.length;++nSegment)aDash[nSegment]*=vector_koef}graphics.p_dash(aDash)}return dW}function drawHorBorder(graphics,oBorderPr,oPrevBorderPr,align,y,x,r){var oLastBorderPr=null;if(oBorderPr&&oBorderPr.s!==AscCommon.c_oAscBorderStyles.None){graphics.drawHorLine(align, y,x,r,setGraphicsSettings(graphics,oBorderPr,oPrevBorderPr));oLastBorderPr=oBorderPr}return oLastBorderPr}function drawVerBorder(graphics,oBorderPr,oPrevBorderPr,align,x,y,b){var oLastBorderPr=null;if(oBorderPr&&oBorderPr.s!==AscCommon.c_oAscBorderStyles.None){graphics.drawVerLine(align,x,y,b,setGraphicsSettings(graphics,oBorderPr,oPrevBorderPr));oLastBorderPr=oBorderPr}return oLastBorderPr}function CSlicerCache(){this.view=null;this.values=null;this.locked=false;this.styleName=null}CSlicerCache.prototype.setView= function(oView){this.view=oView};CSlicerCache.prototype.setValues=function(oValues){this.values=oValues};CSlicerCache.prototype.setLocked=function(bVal){this.locked=bVal};CSlicerCache.prototype.setStyleName=function(sVal){this.styleName=sVal};CSlicerCache.prototype.getView=function(){return this.view};CSlicerCache.prototype.getValues=function(){if(Array.isArray(this.values))return this.values;return[]};CSlicerCache.prototype.getLocked=function(){return this.locked};CSlicerCache.prototype.getStyleName= function(){return this.styleName};CSlicerCache.prototype.clear=function(){this.values=null;this.view=null;this.styleName=null};CSlicerCache.prototype.hasData=function(){return this.values!==null&&this.view!==null};CSlicerCache.prototype.save=function(){var oRet=new CSlicerCache;if(this.values)oRet.values=this.values;if(this.view)oRet.view=this.view;if(this.styleName)oRet.styleName=this.styleName;return oRet};CSlicerCache.prototype.getValues=function(){if(Array.isArray(this.values))return this.values; return[]};CSlicerCache.prototype.getValuesCount=function(){return this.getValues().length};CSlicerCache.prototype.getCaption=function(){if(this.view&&typeof this.view.caption==="string")return this.view.caption;return""};CSlicerCache.prototype.getShowCaption=function(){if(this.view)return this.view.showCaption!==false;return false};CSlicerCache.prototype.getColumnsCount=function(){if(this.view&&AscFormat.isRealNumber(this.view.columnCount))return this.view.columnCount;return 1};CSlicerCache.prototype.getButtonHeight= function(){if(this.view&&AscFormat.isRealNumber(this.view.rowHeight))return this.view.rowHeight*g_dKoef_emu_to_mm;return.26*25.4};CSlicerCache.prototype.getValue=function(nIndex){if(nIndex>-1&&nIndex<this.getValuesCount())return this.getValues()[nIndex];return null};CSlicerCache.prototype.getVal=function(oValue){if(!oValue)return null;return oValue.val};CSlicerCache.prototype.getHiddenByOther=function(oValue){if(!oValue)return false;return oValue.hiddenByOtherColumns===true};CSlicerCache.prototype.getVisible= function(oValue){if(!oValue)return null;return oValue.visible!==false};CSlicerCache.prototype.getString=function(nIndex){var oValue=this.getValue(nIndex);if(oValue&&typeof oValue.text==="string"&&oValue.text.length>0)return oValue.text;return AscCommon.translateManager.getValue("(blank)")};function CSlicerData(slicer){CSlicerCache.call(this);this.slicer=slicer}CSlicerData.prototype=Object.create(CSlicerCache.prototype);CSlicerData.prototype.constructor=CSlicerData;CSlicerData.prototype.updateData= function(){this.clear();var oData=this.retrieveData();this.values=oData.getValues();this.view=oData.getView();this.styleName=oData.getStyleName()};CSlicerData.prototype.retrieveData=function(){var oData=new CSlicerCache;var oWorkbook=this.slicer.getWorkbook();if(!oWorkbook)return oData;var sName=this.slicer.getName();var oView=oWorkbook.getSlicerByName(sName);if(!oView)return oData;var oCache=oView.getCacheDefinition();if(!oCache)return oData;var oValues=oCache.getFilterValues();if(!oValues||!Array.isArray(oValues.values))return oData; oData.setValues(oValues.values);oData.setView(oView.clone());oData.setStyleName(this.slicer.getStyleName());return oData};CSlicerData.prototype.checkData=function(){if(!this.hasData())this.updateData()};CSlicerData.prototype.getValues=function(){this.checkData();return CSlicerCache.prototype.getValues.call(this)};CSlicerData.prototype.getCaption=function(){this.checkData();return CSlicerCache.prototype.getCaption.call(this)};CSlicerData.prototype.getShowCaption=function(){this.checkData();return CSlicerCache.prototype.getShowCaption.call(this)}; CSlicerData.prototype.getColumnsCount=function(){this.checkData();return CSlicerCache.prototype.getColumnsCount.call(this)};CSlicerData.prototype.getButtonHeight=function(){this.checkData();return CSlicerCache.prototype.getButtonHeight.call(this)};CSlicerData.prototype.getButtonState=function(nIndex){var oValue=this.getValue(nIndex);if(oValue){var nState=0;if(this.getHiddenByOther(oValue)===false)nState|=STATE_FLAG_DATA;if(this.getVisible(oValue)!==false)nState|=STATE_FLAG_SELECTED;return nState}return STYLE_TYPE.WHOLE}; CSlicerData.prototype.isAllValuesSelected=function(){var nCount=this.getValuesCount();for(var nValue=0;nValue<nCount;++nValue){var oValue=this.getValue(nValue);if(oValue&&oValue.visible===false)return false}return true};CSlicerData.prototype.onViewUpdate=function(){var oWorksheet=this.slicer.getWorksheet();if(!oWorksheet){this.slicer.removeAllButtonsTmpState();return}if(this.slicer.getLocked()){this.slicer.removeAllButtonsTmpState();return}var oData=this.retrieveData();var aValues=oData.getValues(); var nValuesCount=aValues.length,nValue,oValue,oApplyValue,nButtonState;var aValuesToApply=[];var bNeedUpdate=false,bVisible;for(nValue=0;nValue<nValuesCount;++nValue){oValue=aValues[nValue];if(!oValue)break;nButtonState=this.slicer.getViewButtonState(nValue);if(nButtonState===null)break;oApplyValue=oValue.clone();bVisible=(nButtonState&STATE_FLAG_SELECTED)!==0;if(this.getVisible(oValue)!==bVisible){oApplyValue.asc_setVisible(bVisible);bNeedUpdate=true}aValuesToApply.push(oApplyValue)}if(bNeedUpdate)if(this.slicer.isSubscribed())this.values= aValuesToApply;else Asc.editor.wb.setFilterValuesFromSlicer(this.slicer.getName(),aValuesToApply);else this.slicer.removeAllButtonsTmpState()};CSlicerData.prototype.onDataUpdate=function(){if(AscCommon.isFileBuild())return;var oOldCache=this.save();this.clear();if(this.needUpdateValues(oOldCache)){this.slicer.handleUpdateExtents();this.slicer.handleUpdateFill();this.slicer.handleUpdateLn();this.slicer.recalculate()}else this.slicer.removeAllButtonsTmpState();this.slicer.unsubscribeFromEvents();this.slicer.onUpdate(this.slicer.bounds)}; CSlicerData.prototype.needUpdateValues=function(oOldCache){var nCount=this.getValuesCount();if(nCount!==oOldCache.getValuesCount())return true;for(var nValue=0;nValue<nCount;++nValue)if(this.getString(nValue)!==oOldCache.getString(nValue))return true;if(!AscFormat.fApproxEqual(this.getButtonHeight(),oOldCache.getButtonHeight()))return true;if(this.getColumnsCount()!==oOldCache.getColumnsCount())return true;if(this.getShowCaption()!==oOldCache.getShowCaption())return true;if(this.getCaption()!==oOldCache.getCaption())return true; if(this.getStyleName()!==oOldCache.getStyleName())return true;return false};function CSlicer(){AscFormat.CShape.call(this);this.name=null;this.recalcInfo.recalculateHeader=true;this.recalcInfo.recalculateButtons=true;this.header=null;this.data=new CSlicerData(this);AscFormat.ExecuteNoHistory(function(){this.txStyles=new CStyles(false)},this,[]);this.buttonsContainer=null;this.eventListener=null}CSlicer.prototype=Object.create(AscFormat.CShape.prototype);CSlicer.prototype.constructor=CSlicer;CSlicer.prototype.getObjectType= function(){return AscDFH.historyitem_type_SlicerView};CSlicer.prototype.toStream=function(s){s.WriteUChar(AscCommon.g_nodeAttributeStart);s._WriteString2(0,this.name);s.WriteUChar(AscCommon.g_nodeAttributeEnd)};CSlicer.prototype.fromStream=function(s){var _len=s.GetULong();var _start_pos=s.cur;var _end_pos=_len+_start_pos;var _at;s.GetUChar();while(true){_at=s.GetUChar();if(_at===AscCommon.g_nodeAttributeEnd)break;switch(_at){case 0:{this.setName(s.GetString2());break}default:{s.Seek2(_end_pos);return}}}s.Seek2(_end_pos)}; CSlicer.prototype.setName=function(val){History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_SlicerViewName,this.name,val));this.name=val};CSlicer.prototype.getName=function(){return this.name};CSlicer.prototype.getViewButtonsCount=function(){if(!this.buttonsContainer)return 0;return this.buttonsContainer.getViewButtonsCount()};CSlicer.prototype.getViewButtonState=function(nIndex){if(!this.buttonsContainer)return null;return this.buttonsContainer.getViewButtonState(nIndex)};CSlicer.prototype.getStyleName= function(){var oWorkbook=this.getWorkbook();if(!oWorkbook)return null;var oSlicerStyles=oWorkbook.SlicerStyles;var sStyleName=oWorkbook.getSlicerStyle(this.name);if(!sStyleName)sStyleName=oSlicerStyles.DefaultStyle;return sStyleName};CSlicer.prototype.getDXF=function(nType){var oWorkbook=this.getWorkbook();if(!oWorkbook)return null;var sStyleName=this.getStyleName();if(!sStyleName)return null;var oSlicerStyles=oWorkbook.SlicerStyles;var oTableStyles=oWorkbook.TableStyles;var oStyle;var oDXF=null; if(nType===STYLE_TYPE.WHOLE||nType===STYLE_TYPE.HEADER){oStyle=oTableStyles.AllStyles[sStyleName];if(!oStyle)oStyle=oTableStyles.AllStyles[oTableStyles.DefaultTableStyle];if(oStyle)if(nType===STYLE_TYPE.WHOLE){if(oStyle.wholeTable)oDXF=oStyle.wholeTable.dxf}else if(oStyle.headerRow)oDXF=oStyle.headerRow.dxf}else{oStyle=oSlicerStyles.AllStyles[sStyleName];if(!oStyle)oStyle=oSlicerStyles.AllStyles[oSlicerStyles.DefaultStyle];if(oStyle)switch(nType){case STYLE_TYPE.HOVERED_SELECTED_NO_DATA:{oDXF=oStyle[Asc.ST_slicerStyleType.hoveredSelectedItemWithNoData]; break}case STYLE_TYPE.HOVERED_UNSELECTED_NO_DATA:{oDXF=oStyle[Asc.ST_slicerStyleType.hoveredUnselectedItemWithNoData];break}case STYLE_TYPE.HOVERED_SELECTED_DATA:{oDXF=oStyle[Asc.ST_slicerStyleType.hoveredSelectedItemWithData];break}case STYLE_TYPE.HOVERED_UNSELECTED_DATA:{oDXF=oStyle[Asc.ST_slicerStyleType.hoveredUnselectedItemWithData];break}case STYLE_TYPE.SELECTED_NO_DATA:{oDXF=oStyle[Asc.ST_slicerStyleType.selectedItemWithNoData];break}case STYLE_TYPE.SELECTED_DATA:{oDXF=oStyle[Asc.ST_slicerStyleType.selectedItemWithData]; break}case STYLE_TYPE.UNSELECTED_NO_DATA:{oDXF=oStyle[Asc.ST_slicerStyleType.unselectedItemWithNoData];break}case STYLE_TYPE.UNSELECTED_DATA:{oDXF=oStyle[Asc.ST_slicerStyleType.unselectedItemWithData];break}}}return oDXF};CSlicer.prototype.getFont=function(nType){var oFont=null;var oDXF=this.getDXF(nType);if(oDXF){oFont=oDXF.getFont();if(oFont)return oFont}oDXF=this.getDXF(STYLE_TYPE.WHOLE);if(oDXF)return oDXF.getFont2();return AscCommonExcel.g_oDefaultFormat.Font};CSlicer.prototype.getFill=function(nType){var oFill; var oDXF=this.getDXF(nType);if(oDXF){oFill=oDXF.getFill();if(oFill)return oFill}if(nType!==STYLE_TYPE.WHOLE)return null;oFill=new AscCommonExcel.Fill;oFill.fromColor(new AscCommonExcel.RgbColor(16777215));return oFill};CSlicer.prototype.getBorder=function(nType){var oBorder;var oDXF=this.getDXF(nType);if(oDXF)return oDXF.getBorder();oDXF=this.getDXF(STYLE_TYPE.WHOLE);if(oDXF)return oDXF.getBorder();var r=91,g=155,b=213;if(nType!==STYLE_TYPE.HEADER&&nType!==STYLE_TYPE.WHOLE){r=204;g=204;b=204}oBorder= new AscCommonExcel.Border(null);if(nType!==STYLE_TYPE.HEADER){oBorder.l=new AscCommonExcel.BorderProp;oBorder.l.setStyle(AscCommon.c_oAscBorderStyles.Thin);oBorder.l.c=AscCommonExcel.createRgbColor(r,g,b);oBorder.t=new AscCommonExcel.BorderProp;oBorder.t.setStyle(AscCommon.c_oAscBorderStyles.Thin);oBorder.t.c=AscCommonExcel.createRgbColor(r,g,b);oBorder.r=new AscCommonExcel.BorderProp;oBorder.r.setStyle(AscCommon.c_oAscBorderStyles.Thin);oBorder.r.c=AscCommonExcel.createRgbColor(r,g,b)}oBorder.b= new AscCommonExcel.BorderProp;oBorder.b.setStyle(AscCommon.c_oAscBorderStyles.Thin);oBorder.b.c=AscCommonExcel.createRgbColor(r,g,b);return oBorder};CSlicer.prototype.recalculateBrush=function(){var oFill=this.getFill(STYLE_TYPE.WHOLE);var oParents=this.getParentObjects();this.brush=AscCommonExcel.convertFillToUnifill(oFill);this.brush.calculate(oParents.theme,oParents.slide,oParents.layout,oParents.master,{R:0,G:0,B:0,A:255})};CSlicer.prototype.recalculatePen=function(){this.pen=null};CSlicer.prototype.recalculateGeometry= function(){this.calcGeometry=AscFormat.CreateGeometry("rect");this.calcGeometry.Recalculate(this.extX,this.extY)};CSlicer.prototype.canRotate=function(){return false};CSlicer.prototype.recalculate=function(){if(AscCommon.isFileBuild())return;var bCollaborativeChanges=false;var oWorkbook=this.getWorkbook();if(oWorkbook)bCollaborativeChanges=oWorkbook.bCollaborativeChanges;if(AscFonts.IsCheckSymbols&&bCollaborativeChanges)return;AscFormat.ExecuteNoHistory(function(){AscFormat.CShape.prototype.recalculate.call(this); if(this.recalcInfo.recalculateHeader){this.recalculateHeader();this.recalcInfo.recalculateHeader=false}if(this.recalcInfo.recalculateButtons){this.recalculateButtons();this.recalcInfo.recalculateButtons=false}},this,[])};CSlicer.prototype.recalculateHeader=function(){var bShowHeader=this.getShowCaption();if(!bShowHeader){this.header=null;return}if(!this.header)this.header=new CHeader(this);this.header.worksheet=this.worksheet;this.header.setRecalculateInfo();this.header.recalculate()};CSlicer.prototype.getButtonsContainerWidth= function(){return Math.max(this.extX-LEFT_PADDING-RIGHT_PADDING,0)};CSlicer.prototype.getButtonsContainerHeight=function(){var nHeight=this.extY;if(this.header)nHeight-=this.header.extY;return Math.max(nHeight-TOP_PADDING-BOTTOM_PADDING,0)};CSlicer.prototype.getWidthByButton=function(dBWidth){if(this.buttonsContainer){var dBContainerW=this.buttonsContainer.getWidthByButton(dBWidth);return dBContainerW+LEFT_PADDING+RIGHT_PADDING}else return this.extX};CSlicer.prototype.recalculateButtons=function(){if(!this.buttonsContainer)this.buttonsContainer= new CButtonsContainer(this);this.buttonsContainer.clear();var nValuesCount=this.getValuesCount();for(var nValue=0;nValue<nValuesCount;++nValue)this.buttonsContainer.addButton(new CButton(this.buttonsContainer));this.buttonsContainer.x=LEFT_PADDING;this.buttonsContainer.y=TOP_PADDING;if(this.header)this.buttonsContainer.y+=this.header.extY;this.buttonsContainer.extX=this.getButtonsContainerWidth();this.buttonsContainer.extY=this.getButtonsContainerHeight();this.buttonsContainer.recalculate()};CSlicer.prototype.getColumnsCount= function(){return this.data.getColumnsCount()};CSlicer.prototype.getCaption=function(){return this.data.getCaption()};CSlicer.prototype.getButtonHeight=function(){return this.data.getButtonHeight()};CSlicer.prototype.getShowCaption=function(){return this.data.getShowCaption()};CSlicer.prototype.getTxStyles=function(nType){var oFont=this.getFont(nType);if(!oFont)oFont=this.getFont(STYLE_TYPE.WHOLE);var oTextPr=this.txStyles.Default.TextPr;oTextPr.InitDefault();oTextPr.FillFromExcelFont(oFont);var oParaPr= this.txStyles.Default.ParaPr;oParaPr.SetSpacing(1,undefined,0,0,undefined,undefined);return{styles:this.txStyles,lastId:undefined}};CSlicer.prototype.isMultiSelect=function(){if(this.header)return this.header.isMultiSelect();return false};CSlicer.prototype.internalDraw=function(graphics,transform,transformText,pageIndex){var oUR=graphics.updatedRect;if(oUR&&this.bounds)if(!oUR.isIntersectOther(this.bounds))return;AscFormat.CShape.prototype.draw.call(this,graphics,transform,transformText,pageIndex); if(graphics.IsSlideBoundsCheckerType)return;graphics.SaveGrState();graphics.transform3(this.transform,false);if(this.header)this.header.draw(graphics,transform,transformText,pageIndex);if(this.buttonsContainer)this.buttonsContainer.draw(graphics,transform,transformText,pageIndex);graphics.RestoreGrState();var oBorder=this.getBorder(STYLE_TYPE.WHOLE);if(oBorder){var oTransform=transform||this.transform;graphics.transform3(oTransform);var oSide,oLastDrawn;oSide=oBorder.l;oLastDrawn=drawVerBorder(graphics, oSide,oLastDrawn,1,0,0,this.extY)||oLastDrawn;oSide=oBorder.t;oLastDrawn=drawHorBorder(graphics,oSide,oLastDrawn,1,0,0,this.extX)||oLastDrawn;oSide=oBorder.r;oLastDrawn=drawVerBorder(graphics,oSide,oLastDrawn,1,this.extX,0,this.extY)||oLastDrawn;oSide=oBorder.b;oLastDrawn=drawHorBorder(graphics,oSide,oLastDrawn,1,this.extY,0,this.extX)||oLastDrawn;graphics.reset()}if(!AscCommon.IsShapeToImageConverter&&!graphics.RENDERER_PDF_FLAG)if(this.getLocked()){var oOldBrush=this.brush;this.brush=AscFormat.CreateSolidFillRGBA(0, 0,0,LOCKED_ALPHA);AscFormat.CShape.prototype.draw.call(this,graphics);this.brush=oOldBrush}};CSlicer.prototype.draw=function(graphics,transform,transformText,pageIndex){AscFormat.ExecuteNoHistory(this.internalDraw,this,[graphics,transform,transformText,pageIndex])};CSlicer.prototype.handleUpdateExtents=function(){this.recalcInfo.recalculateHeader=true;this.recalcInfo.recalculateButtons=true;AscFormat.CShape.prototype.handleUpdateExtents.call(this)};CSlicer.prototype.isEventListener=function(child){return this.eventListener=== child};CSlicer.prototype.setEventListener=function(child){this.eventListener=child};CSlicer.prototype.handleClearButtonClick=function(){if(!this.buttonsContainer)return;this.buttonsContainer.selectAllButtons();this.onViewUpdate()};CSlicer.prototype.onDataUpdate=function(){this.data.onDataUpdate()};CSlicer.prototype.removeAllButtonsTmpState=function(){if(this.buttonsContainer)this.buttonsContainer.removeAllButtonsTmpState()};CSlicer.prototype.onViewUpdate=function(){this.data.onViewUpdate()};CSlicer.prototype.onMouseMove= function(e,x,y){var bRet=false;if(this.eventListener){if(!e.IsLocked)return this.onMouseUp(e,x,y);if(this.getLocked())return this.onMouseUp(e,x,y);if(e.CtrlKey){if(!this.isSubscribed())this.subscribeToEvents()}else if(this.isSubscribed())this.unsubscribeFromEvents();this.eventListener.onMouseMove(e,x,y);return true}if(this.getLocked())return false;if(!this.data.hasData())return false;if(this.header)bRet=bRet||this.header.onMouseMove(e,x,y);if(this.buttonsContainer)bRet=bRet||this.buttonsContainer.onMouseMove(e, x,y);if(this.hitInInnerArea(x,y))bRet=true;return bRet};CSlicer.prototype.onMouseDown=function(e,x,y){if(this.getLocked())return false;if(!this.data.hasData())return false;if(e.button!==0)return false;var bRet=false,bRes;e.IsLocked=true;if(this.eventListener)this.eventListener.onMouseUp(e,x,y);if(this.header){bRes=this.header.onMouseDown(e,x,y);bRet=bRet||bRes}if(this.buttonsContainer){bRes=this.buttonsContainer.onMouseDown(e,x,y);bRet=bRet||bRes;if(bRes&&e.CtrlKey)this.subscribeToEvents()}return bRet}; CSlicer.prototype.getCursorInfo=function(e,x,y){if(this.getLocked()||!this.hit(x,y)||!this.data.hasData())return null;var oRet=this.header&&this.header.getCursorInfo(e,x,y)||this.buttonsContainer&&this.buttonsContainer.getCursorInfo(e,x,y);if(oRet){oRet.objectId=this.Get_Id();oRet.bMarker=false;return oRet}return oRet};CSlicer.prototype.onMouseUp=function(e,x,y){var bRet=false;if(this.eventListener){bRet=this.eventListener.onMouseUp(e,x,y);this.setEventListener(null);this.onUpdate(this.bounds);this.onViewUpdate(); return bRet}return bRet};CSlicer.prototype.getValues=function(){return this.data.getValues()};CSlicer.prototype.getButtonState=function(nIndex){return this.data.getButtonState(nIndex)};CSlicer.prototype.getValuesCount=function(){return this.data.getValuesCount()};CSlicer.prototype.getString=function(nIndex){return this.data.getString(nIndex)};CSlicer.prototype.isAllValuesSelected=function(){return this.data.isAllValuesSelected()};CSlicer.prototype.getInvFullTransformMatrix=function(){return this.invertTransform}; CSlicer.prototype.onWheel=function(deltaX,deltaY){if(this.getLocked()||!this.data.hasData())return false;return this.buttonsContainer.onWheel(deltaX,deltaY)};CSlicer.prototype.onSlicerUpdate=function(sName){if(AscCommon.isFileBuild())return;if(this.name===sName)this.onDataUpdate()};CSlicer.prototype.onSlicerLock=function(sName,bLock){if(AscCommon.isFileBuild())return;if(this.name===sName){this.data.setLocked(bLock);this.onUpdate(this.bounds);this.unsubscribeFromEvents()}};CSlicer.prototype.onSlicerChangeName= function(sName,sNewName){if(AscCommon.isFileBuild())return;if(this.name===sName){this.setName(sNewName);this.onDataUpdate()}};CSlicer.prototype.onSlicerDelete=function(sName){if(AscCommon.isFileBuild())return false;var bRet=false;var oMainGroup,oCurGroup;if(this.name===sName)if(this.group){this.group.removeFromSpTree(this.Id);oCurGroup=this.group;while(oCurGroup.spTree.length===0&&oCurGroup.group){oCurGroup.group.removeFromSpTree(oCurGroup.Get_Id());oCurGroup=oCurGroup.group}if(oCurGroup.spTree.length=== 0){if(oCurGroup.drawingBase)oCurGroup.deleteDrawingBase()}else{oMainGroup=this.group.getMainGroup();if(oMainGroup)oMainGroup.updateCoordinatesAfterInternalResize()}bRet=true}else if(this.drawingBase){this.deleteDrawingBase();bRet=true}if(bRet){this.onUpdate(this.bounds);var oController=this.getDrawingObjectsController();if(oController)this.deselect(oController)}return bRet};CSlicer.prototype.deleteSlicer=function(){Asc.editor.wb.deleteSlicer(this.name)};CSlicer.prototype.subscribeToEvents=function(){var drawingObjects= this.getDrawingObjectsController();if(drawingObjects)drawingObjects.addEventListener(this)};CSlicer.prototype.unsubscribeFromEvents=function(){var drawingObjects=this.getDrawingObjectsController();if(drawingObjects)drawingObjects.removeEventListener(this)};CSlicer.prototype.isSubscribed=function(){var drawingObjects=this.getDrawingObjectsController();if(drawingObjects)return drawingObjects.isEventListener(this);return false};CSlicer.prototype.onKeyUp=function(e){if(e.keyCode===91||e.keyCode===17)if(this.isSubscribed()){this.unsubscribeFromEvents(); if(!this.eventListener)this.onViewUpdate()}};CSlicer.prototype.getLocked=function(){return this.data.getLocked()||this.lockType!==AscCommon.c_oAscLockTypes.kLockTypeNone&&this.lockType!==AscCommon.c_oAscLockTypes.kLockTypeMine};CSlicer.prototype.copy=function(oPr){var copy=new CSlicer;this.fillObject(copy,oPr);if(this.name!==null)copy.setName(this.name);return copy};CSlicer.prototype.invertMultiSelect=function(){if(this.header)return this.header.invertMultiSelect();return false};CSlicer.prototype.getSlicer= function(){var oWorkbook=this.getWorkbook();if(!oWorkbook)return oWorkbook;return oWorkbook.getSlicerByName(this.name)};CSlicer.prototype.getButtonWidth=function(){if(!this.buttonsContainer)return 0;return this.buttonsContainer.getButtonWidth()*g_dKoef_mm_to_emu+.5>>0};CSlicer.prototype.setButtonWidth=function(dWidth){var bChange=false;if(AscFormat.isRealNumber(dWidth)&&dWidth>0){var dCurWidth=this.getButtonWidth();if(!AscFormat.fApproxEqual(dCurWidth,dWidth)){var mmWidth=dWidth*g_dKoef_emu_to_mm; var dNewWidth=this.getWidthByButton(mmWidth);if(!AscFormat.fApproxEqual(dNewWidth,this.extX)){AscFormat.CheckSpPrXfrm(this);this.spPr.xfrm.setExtX(dNewWidth);this.checkDrawingBaseCoords();bChange=true}}}return bChange};CSlicer.prototype.checkAutofit=function(bIgnoreWordShape){return false};CSlicer.prototype.checkTextWarp=function(oContent,oBodyPr,dWidth,dHeight,bNeedNoTransform,bNeedWarp){return oDefaultWrapObject};CSlicer.prototype.getSlicerViewByName=function(name){if(this.name===name)return this; return null};CSlicer.prototype.getAllSlicerViews=function(aSlicerView){aSlicerView.push(this)};function CHeader(slicer){AscFormat.CShape.call(this);this.slicer=slicer;this.worksheet=slicer.worksheet;this.txBody=null;this.buttons=[];this.buttons.push(new CInterfaceButton(this));this.buttons.push(new CInterfaceButton(this));this.buttons[1].removeTmpState();this.setBDeleted(false);this.setTransformParams(0,0,0,0,0,false,false);this.createTextBody();this.bodyPr=new AscFormat.CBodyPr;this.bodyPr.setDefault(); this.bodyPr.anchor=1;this.bodyPr.lIns=HEADER_LEFT_PADDING;this.bodyPr.rIns=HEADER_RIGHT_PADDING;this.bodyPr.tIns=HEADER_TOP_PADDING;this.bodyPr.bIns=HEADER_BOTTOM_PADDING;this.bodyPr.horzOverflow=AscFormat.nOTClip;this.bodyPr.vertOverflow=AscFormat.nOTClip;this.eventListener=null;this.startButton=null}CHeader.prototype=Object.create(AscFormat.CShape.prototype);CHeader.prototype.getString=function(){return this.slicer.getCaption()};CHeader.prototype.Get_Styles=function(){return this.slicer.getTxStyles(STYLE_TYPE.HEADER)}; CHeader.prototype.getParentObjects=function(){return this.slicer.getParentObjects()};CHeader.prototype.isMultiSelect=function(){return this.buttons[0].isSelected()};CHeader.prototype.invertMultiSelect=function(){this.buttons[0].setInvertSelectTmpState();return true};CHeader.prototype.recalculateBrush=function(){var oFill=this.slicer.getFill(STYLE_TYPE.HEADER);var oParents=this.slicer.getParentObjects();this.brush=AscCommonExcel.convertFillToUnifill(oFill);this.brush.calculate(oParents.theme,oParents.slide, oParents.layout,oParents.master,{R:0,G:0,B:0,A:255})};CHeader.prototype.recalculatePen=function(){this.pen=null};CHeader.prototype.recalculateContent=function(){if(this.bRecalcContent)return;this.setTransformParams(0,0,this.slicer.extX,HEADER_BUTTON_WIDTH,0,false,false);this.recalculateGeometry();this.recalculateTransform();this.txBody.content.Recalc_AllParagraphs_CompiledPr();this.txBody.recalculateOneString(this.getString());var dHeight=this.contentHeight+HEADER_TOP_PADDING+HEADER_BOTTOM_PADDING; dHeight=Math.max(dHeight,HEADER_BUTTON_WIDTH+1);this.setTransformParams(0,0,this.slicer.extX,dHeight,0,false,false);this.recalcInfo.recalculateContent=false;this.bRecalcContent=true;this.recalculate();this.recalculateButtons();this.bRecalcContent=false};CHeader.prototype.getBodyPr=function(){return this.bodyPr};CHeader.prototype.recalculateGeometry=function(){this.calcGeometry=AscFormat.CreateGeometry("rect");this.calcGeometry.Recalculate(this.extX,this.extY)};CHeader.prototype.recalculateButtons= function(){var oButton=this.buttons[1];var x,y;x=this.extX-RIGHT_PADDING-HEADER_BUTTON_WIDTH;y=this.extY/2-HEADER_BUTTON_WIDTH/2;oButton.setTransformParams(x,y,HEADER_BUTTON_WIDTH,HEADER_BUTTON_WIDTH,0,false,false);oButton.recalculate();oButton=this.buttons[0];x=this.extX-HEADER_RIGHT_PADDING;oButton.setTransformParams(x,y,HEADER_BUTTON_WIDTH,HEADER_BUTTON_WIDTH,0,false,false);oButton.recalculate()};CHeader.prototype.draw=function(graphics){var oUR=graphics.updatedRect;if(oUR&&this.bounds)if(!oUR.isIntersectOther(this.bounds))return; AscFormat.CShape.prototype.draw.call(this,graphics);if(graphics.IsSlideBoundsCheckerType)return;graphics.SaveGrState();graphics.transform3(this.transform);graphics.SaveGrState();graphics.AddClipRect(0,0,this.extX,this.extY);this.buttons[0].draw(graphics);this.buttons[1].draw(graphics);graphics.RestoreGrState();var oLastDrawn;var oDXF=this.slicer.getDXF(STYLE_TYPE.HEADER);var oBorder=oDXF&&oDXF.getBorder();if(oBorder){oLastDrawn=drawVerBorder(graphics,oBorder.l,oLastDrawn,1,0,0,this.extY)||oLastDrawn; oLastDrawn=drawHorBorder(graphics,oBorder.t,oLastDrawn,1,0,0,this.extX)||oLastDrawn;oLastDrawn=drawVerBorder(graphics,oBorder.r,oLastDrawn,1,this.extX,0,this.extY)||oLastDrawn;var bFull=false;if(oLastDrawn)bFull=true;else{var oFill=this.slicer.getFill(STYLE_TYPE.HEADER);if(oFill){var oWholeFill=this.slicer.getFill(STYLE_TYPE.WHOLE);if(!oWholeFill||!oFill.isEqual(oWholeFill))bFull=true}}if(bFull)oLastDrawn=drawHorBorder(graphics,oBorder.b,oLastDrawn,1,this.extY,0,this.extX)||oLastDrawn;else oLastDrawn= drawHorBorder(graphics,oBorder.b,oLastDrawn,1,this.extY,LEFT_PADDING,this.slicer.extX-RIGHT_PADDING)||oLastDrawn}else{oBorder=this.slicer.getBorder(STYLE_TYPE.HEADER);if(oBorder)oLastDrawn=drawHorBorder(graphics,oBorder.b,oLastDrawn,1,this.extY,LEFT_PADDING,this.slicer.extX-RIGHT_PADDING)||oLastDrawn}graphics.RestoreGrState()};CHeader.prototype.getTxStyles=function(nType){return this.slicer.getTxStyles(nType)};CHeader.prototype.getBorder=function(nType){return null};CHeader.prototype.getFill=function(nType){var nColor= HEADER_BUTTON_COLORS[nType];var oFill=null;if(nColor!==null){oFill=new AscCommonExcel.Fill;oFill.fromColor(new AscCommonExcel.RgbColor(nColor))}return oFill};CHeader.prototype.getIcon=function(nIndex,nType){var sRet;if(nIndex===0)if(nType&STATE_FLAG_SELECTED)sRet=ICON_MULTISELECT_INVERTED;else sRet=ICON_MULTISELECT;else if(nType&STATE_FLAG_WHOLE)sRet=ICON_CLEAR_FILTER_DISABLED;else sRet=ICON_CLEAR_FILTER;return sRet};CHeader.prototype.getFullTransformMatrix=function(){return this.transform};CHeader.prototype.getInvFullTransformMatrix= function(){return this.invertTransform};CHeader.prototype.recalculateTransform=function(){AscFormat.CShape.prototype.recalculateTransform.call(this);var oMT=AscCommon.global_MatrixTransformer;this.transform=this.getFullTransform();this.invertTransform=oMT.Invert(this.transform)};CHeader.prototype.recalculateTransformText=function(){AscFormat.CShape.prototype.recalculateTransformText.call(this);var oMT=AscCommon.global_MatrixTransformer;this.transformText=this.getFullTextTransform();this.invertTransformText= oMT.Invert(this.transformText)};CHeader.prototype.recalculateSnapArrays=function(){};CHeader.prototype.getFullTransform=function(){var oMT=AscCommon.global_MatrixTransformer;var oTransform=oMT.CreateDublicateM(this.localTransform);var oParentTransform=this.slicer.transform;oParentTransform&&oMT.MultiplyAppend(oTransform,oParentTransform);return oTransform};CHeader.prototype.getFullTextTransform=function(){var oMT=AscCommon.global_MatrixTransformer;var oParentTransform=this.slicer.transform;var oTransformText= oMT.CreateDublicateM(this.localTransformText);oParentTransform&&oMT.MultiplyAppend(oTransformText,oParentTransform);return oTransformText};CHeader.prototype.getInvFullTransformMatrix=function(){var oMT=AscCommon.global_MatrixTransformer;return oMT.Invert(this.getFullTransform())};CHeader.prototype.isEventListener=function(child){return this.eventListener===child};CHeader.prototype.onMouseMove=function(e,x,y){if(this.eventListener)return this.eventListener.onMouseMove(e,x,y);var bRet=false;bRet|=this.buttons[0].onMouseMove(e, x,y);bRet|=this.buttons[1].onMouseMove(e,x,y);return bRet};CHeader.prototype.onMouseDown=function(e,x,y){var bRet=false;bRet|=this.buttons[0].onMouseDown(e,x,y);bRet|=this.buttons[1].onMouseDown(e,x,y);return bRet};CHeader.prototype.getCursorInfo=function(e,x,y){if(!this.hit(x,y))return null;var oRet=this.buttons[0].getCursorInfo(e,x,y);if(oRet)return oRet;oRet=this.buttons[1].getCursorInfo(e,x,y);if(!oRet)oRet={cursorType:"move",tooltip:!this.txBody.bFit?this.getString():null};return oRet};CHeader.prototype.onMouseUp= function(e,x,y){var bRet=false;if(this.eventListener){bRet=this.eventListener.onMouseUp(e,x,y);this.eventListener=null;return bRet}bRet|=this.buttons[0].onMouseUp(e,x,y);bRet|=this.buttons[1].onMouseUp(e,x,y);this.setEventListener(null);return bRet};CHeader.prototype.getButtonIndex=function(oButton){for(var nButton=0;nButton<this.buttons.length;++nButton)if(this.buttons[nButton]===oButton)return nButton;return-1};CHeader.prototype.setEventListener=function(child){this.eventListener=child;if(child)this.slicer.setEventListener(this); else if(this.slicer.isEventListener(this))this.slicer.setEventListener(null)};CHeader.prototype.handleMouseUp=function(nIndex){var oButton=this.buttons[nIndex];if(!oButton)return;if(nIndex===1)this.slicer.handleClearButtonClick()};CHeader.prototype.handleMouseDown=function(nIndex){var oButton=this.buttons[nIndex];if(!oButton)return;if(nIndex===0){oButton.setInvertSelectTmpState();this.slicer.onUpdate(oButton.bounds)}};CHeader.prototype.isButtonDisabled=function(nIndex){if(nIndex===1)return this.slicer.isAllValuesSelected(); else return false};CHeader.prototype.getButtonState=function(nIndex){var oButton=this.buttons[nIndex];var nRet=STYLE_TYPE.WHOLE;if(!oButton)return nRet;if(nIndex===0)if(oButton.haveTmpState())nRet=oButton.tmpState;else nRet=STYLE_TYPE.WHOLE;else if(this.slicer.isAllValuesSelected())nRet=STYLE_TYPE.WHOLE;else nRet=STYLE_TYPE.UNSELECTED_DATA;return nRet};CHeader.prototype.getParentObjects=function(){return this.slicer.getParentObjects()};CHeader.prototype.getScrollOffsetX=function(){return 0};CHeader.prototype.getScrollOffsetY= function(){return 0};CHeader.prototype.clipTextRect=function(graphics,transform,transformText,pageIndex){};CHeader.prototype.onUpdate=function(oBounds){var oClipBounds=oBounds;if(!oClipBounds)oClipBounds=this.bounds;this.slicer.onUpdate(oClipBounds)};CHeader.prototype.getTooltipText=function(nIndex){var sText=null;if(nIndex===0)sText=AscCommon.translateManager.getValue("Multi-Select (Alt+S)");else if(nIndex===1)sText=AscCommon.translateManager.getValue("Clear Filter (Alt+C)");return sText};CHeader.prototype.checkAutofit= function(bIgnoreWordShape){return false};CHeader.prototype.checkTextWarp=function(oContent,oBodyPr,dWidth,dHeight,bNeedNoTransform,bNeedWarp){return oDefaultWrapObject};function CButtonBase(parent){AscFormat.CShape.call(this);this.parent=parent;this.tmpState=null;this.worksheet=parent.worksheet;this.setBDeleted(false);AscFormat.CheckSpPrXfrm3(this);this.isHovered=false}CButtonBase.prototype=Object.create(AscFormat.CShape.prototype);CButtonBase.prototype.getTxBodyType=function(){var nRet=null;return nRet}; CButtonBase.prototype.getString=function(){return""};CButtonBase.prototype.haveTmpState=function(){return this.tmpState!==null};CButtonBase.prototype.Get_Styles=function(){return this.parent.getTxStyles(this.getTxBodyType())};CButtonBase.prototype.getBodyPr=function(){return this.bodyPr};CButtonBase.prototype.getFullTransform=function(){var oMT=AscCommon.global_MatrixTransformer;var oTransform=oMT.CreateDublicateM(this.localTransform);var oScrollMatrix=new AscCommon.CMatrix;oScrollMatrix.tx=this.parent.getScrollOffsetX(); oScrollMatrix.ty=this.parent.getScrollOffsetY();oMT.MultiplyAppend(oTransform,oScrollMatrix);var oParentTransform=this.parent.getFullTransformMatrix();oParentTransform&&oMT.MultiplyAppend(oTransform,oParentTransform);return oTransform};CButtonBase.prototype.getFullTextTransform=function(){var oMT=AscCommon.global_MatrixTransformer;var oParentTransform=this.parent.getFullTransformMatrix();var oTransformText=oMT.CreateDublicateM(this.localTransformText);var oScrollMatrix=new AscCommon.CMatrix;oScrollMatrix.tx= this.parent.getScrollOffsetX();oScrollMatrix.ty=this.parent.getScrollOffsetY();oMT.MultiplyAppend(oTransformText,oScrollMatrix);oParentTransform&&oMT.MultiplyAppend(oTransformText,oParentTransform);return oTransformText};CButtonBase.prototype.getInvFullTransformMatrix=function(){var oMT=AscCommon.global_MatrixTransformer;return oMT.Invert(this.getFullTransform())};CButtonBase.prototype.getOwnState=function(){return this.parent.getButtonState(this.parent.getButtonIndex(this))};CButtonBase.prototype.getState= function(){var nState=0;if(this.haveTmpState())nState=this.tmpState;else nState=this.getOwnState();if(nState!==STYLE_TYPE.WHOLE&&nState!==STYLE_TYPE.HEADER)if(this.isHovered)nState|=STATE_FLAG_HOVERED;else nState&=~STATE_FLAG_HOVERED;return nState};CButtonBase.prototype.setUnselectTmpState=function(){this.setTmpState(this.getOwnState()&~STATE_FLAG_SELECTED)};CButtonBase.prototype.setSelectTmpState=function(){this.setTmpState(this.getOwnState()|STATE_FLAG_SELECTED)};CButtonBase.prototype.setHoverState= function(){var bOld=this.isHovered;this.isHovered=true;if(bOld!==this.isHovered)this.onUpdate(this.bounds)};CButtonBase.prototype.getTooltipText=function(){return null};CButtonBase.prototype.setNotHoverState=function(){var bOld=this.isHovered;this.isHovered=false;if(bOld!==this.isHovered)this.onUpdate(this.bounds)};CButtonBase.prototype.setInvertSelectTmpState=function(){var nOwnState=this.getOwnState();if(nOwnState&STATE_FLAG_SELECTED)this.setTmpState(nOwnState&~STATE_FLAG_SELECTED);else this.setTmpState(nOwnState| STATE_FLAG_SELECTED)};CButtonBase.prototype.setTmpState=function(state){var nOld=this.tmpState;this.tmpState=state;if(nOld!==this.tmpState)this.onUpdate(this.bounds)};CButtonBase.prototype.removeTmpState=function(){this.setTmpState(null)};CButtonBase.prototype.isSelected=function(){return(this.getState()&STATE_FLAG_SELECTED)!==0};CButtonBase.prototype.recalculate=function(){AscFormat.CShape.prototype.recalculate.call(this)};CButtonBase.prototype.recalculateBrush=function(){};CButtonBase.prototype.recalculatePen= function(){this.pen=null};CButtonBase.prototype.recalculateContent=function(){};CButtonBase.prototype.recalculateGeometry=function(){this.calcGeometry=AscFormat.CreateGeometry("rect");this.calcGeometry.Recalculate(this.extX,this.extY)};CButtonBase.prototype.recalculateTransform=function(){AscFormat.CShape.prototype.recalculateTransform.call(this);var oMT=AscCommon.global_MatrixTransformer;this.transform=this.getFullTransform();this.invertTransform=oMT.Invert(this.transform)};CButtonBase.prototype.recalculateTransformText= function(){AscFormat.CShape.prototype.recalculateTransformText.call(this);var oMT=AscCommon.global_MatrixTransformer;this.transformText=this.getFullTextTransform();this.invertTransformText=oMT.Invert(this.transformText)};CButtonBase.prototype.recalculateBounds=function(){this.bounds.x=this.transform.tx;this.bounds.y=this.transform.ty;this.bounds.l=this.bounds.x;this.bounds.t=this.bounds.y;this.bounds.r=this.bounds.x+this.extX;this.bounds.b=this.bounds.y+this.extY;this.bounds.w=this.bounds.r-this.bounds.l; this.bounds.h=this.bounds.b-this.bounds.t};CButtonBase.prototype.recalculateSnapArrays=function(){};CButtonBase.prototype.checkAutofit=function(bIgnoreWordShape){return false};CButtonBase.prototype.checkTextWarp=function(oContent,oBodyPr,dWidth,dHeight,bNeedNoTransform,bNeedWarp){return oDefaultWrapObject};CButtonBase.prototype.addToRecalculate=function(){};CButtonBase.prototype.draw=function(graphics){var oUR=graphics.updatedRect;if(oUR&&this.bounds)if(!oUR.isIntersectOther(this.bounds))return;var parents= this.getParentObjects();this.brush=AscCommonExcel.convertFillToUnifill(this.parent.getFill(this.getState()));this.brush.calculate(parents.theme,parents.slide,parents.layout,parents.master,{R:0,G:0,B:0,A:255});this.recalculateTransform();this.recalculateTransformText();if(!graphics.IsSlideBoundsCheckerType)this.recalculateBounds();AscFormat.CShape.prototype.draw.call(this,graphics);if(graphics.IsSlideBoundsCheckerType)return;var oBorder=this.parent.getBorder(this.getState());if(oBorder){graphics.transform3(this.transform); var oLastDrawn=null;oLastDrawn=drawVerBorder(graphics,oBorder.l,oLastDrawn,0,0,0,this.extY)||oLastDrawn;oLastDrawn=drawHorBorder(graphics,oBorder.t,oLastDrawn,0,0,0,this.extX)||oLastDrawn;oLastDrawn=drawVerBorder(graphics,oBorder.r,oLastDrawn,2,this.extX,0,this.extY)||oLastDrawn;oLastDrawn=drawHorBorder(graphics,oBorder.b,oLastDrawn,2,this.extY,0,this.extX)||oLastDrawn}};CButtonBase.prototype.hit=function(x,y){if(!this.parent.hit(x,y))return false;var oInv=this.invertTransform;var tx=oInv.TransformPointX(x, y);var ty=oInv.TransformPointY(x,y);return tx>=0&&tx<=this.extX&&ty>=0&&ty<=this.extY};CButtonBase.prototype.onMouseMove=function(e,x,y){if(e.IsLocked)return false;var bHover=this.hit(x,y);var bRet=bHover!==this.isHovered;if(bHover)this.setHoverState();else this.setNotHoverState();return bRet};CButtonBase.prototype.onMouseDown=function(e,x,y){if(this.hit(x,y)){this.parent.setEventListener(this);return true}return false};CButtonBase.prototype.onMouseUp=function(e,x,y){this.parent.setEventListener(null); return false};CButtonBase.prototype.onUpdate=function(oBounds){this.parent.onUpdate(oBounds)};CButtonBase.prototype.getCursorInfo=function(e,x,y){if(!this.hit(x,y))return null;else return{cursorType:"default",tooltip:this.getTooltipText()}};function CButton(parent){CButtonBase.call(this,parent);this.textBoxes={};this.bodyPr=new AscFormat.CBodyPr;this.bodyPr.setDefault();this.bodyPr.anchor=1;this.bodyPr.lIns=LEFT_PADDING;this.bodyPr.rIns=RIGHT_PADDING;this.bodyPr.tIns=0;this.bodyPr.bIns=0;this.bodyPr.bIns= 0;this.bodyPr.horzOverflow=AscFormat.nOTClip;this.bodyPr.vertOverflow=AscFormat.nOTClip}CButton.prototype=Object.create(CButtonBase.prototype);CButton.prototype.getTxBodyType=function(){var nRet=null;for(var key in this.textBoxes)if(this.textBoxes.hasOwnProperty(key))if(this.textBoxes[key]===this.txBody){nRet=parseInt(key);break}return nRet};CButton.prototype.getString=function(){return this.parent.getString(this.parent.getButtonIndex(this))};CButton.prototype.recalculateContent=function(){var sText= this.getString();var oFontMap={};var oFont,oFoundFont,oMapFont;var oFirstButton=this.parent.buttons[0];var bUseFirstButton=oFirstButton!==this;var nType;for(var key in STYLE_TYPE)if(STYLE_TYPE.hasOwnProperty(key)){nType=STYLE_TYPE[key];if(nType!==STYLE_TYPE.WHOLE&&nType!==STYLE_TYPE.HEADER){oFont=this.parent.getFont(nType);oFoundFont=null;if(oFont)for(var fontKey in oFontMap)if(oFontMap.hasOwnProperty(fontKey)){oMapFont=oFontMap[fontKey];if(oMapFont&&oMapFont.isEqual(oFont)){oFoundFont=oMapFont;break}}if(!oFoundFont){this.createTextBody(); this.textBoxes[nType]=this.txBody;if(bUseFirstButton)this.txBody.content.Content[0].CompiledPr=oFirstButton.textBoxes[nType].content.Content[0].CompiledPr;this.txBody.recalculateOneString(sText);oFontMap[key]=oFont}else this.textBoxes[nType]=this.textBoxes[STYLE_TYPE[fontKey]]}}};CButton.prototype.clipTextRect=function(graphics,transform,transformText,pageIndex){};CButton.prototype.draw=function(graphics){this.txBody=this.textBoxes[this.getState()];if(!this.txBody)this.txBody=null;CButtonBase.prototype.draw.call(this, graphics)};CButton.prototype.getTooltipText=function(){if(!this.txBody||this.txBody.bFit)return null;return this.getString()};function CInterfaceButton(parent){CButtonBase.call(this,parent);this.setTmpState(STYLE_TYPE.UNSELECTED_DATA)}CInterfaceButton.prototype=Object.create(CButtonBase.prototype);CInterfaceButton.prototype.isDisabled=function(){return this.parent.isButtonDisabled(this.parent.getButtonIndex(this))};CInterfaceButton.prototype.hit=function(x,y){if(this.isDisabled())return false;return CButtonBase.prototype.hit.call(this, x,y)};CInterfaceButton.prototype.onMouseDown=function(e,x,y){if(this.isDisabled())return false;var bRet=CButtonBase.prototype.onMouseDown.call(this,e,x,y);if(bRet)this.parent.handleMouseDown(this.parent.getButtonIndex(this));return bRet};CInterfaceButton.prototype.onMouseUp=function(e,x,y){var bEventListener=this.parent.isEventListener(this);var bRet=CButtonBase.prototype.onMouseUp.call(this,e,x,y);if(bEventListener)this.parent.handleMouseUp(this.parent.getButtonIndex(this));return bRet};CInterfaceButton.prototype.draw= function(graphics){var oUR=graphics.updatedRect;if(oUR&&this.bounds)if(!oUR.isIntersectOther(this.bounds))return;CButtonBase.prototype.draw.call(this,graphics);if(graphics.IsSlideBoundsCheckerType)return;var sIcon=this.parent.getIcon(this.parent.getButtonIndex(this),this.getState());if(null!==sIcon){graphics.SaveGrState();graphics.transform3(this.transform);graphics.SetIntegerGrid(true);graphics.drawImage(sIcon,0,0,this.extX,this.extY,255,null,null);graphics.RestoreGrState()}};CInterfaceButton.prototype.getTooltipText= function(){return this.parent.getTooltipText(this.parent.getButtonIndex(this))};function CButtonsContainer(slicer){this.slicer=slicer;this.worksheet=slicer.worksheet;this.buttons=[];this.x=0;this.y=0;this.extX=0;this.extY=0;this.contentW=0;this.contentH=0;this.scrollTop=0;this.scrollLeft=0;this.scroll=new CScroll(this);this.eventListener=null;this.startX=0;this.startY=0;this.startButton=-1}CButtonsContainer.prototype.getParentObjects=function(){return this.slicer.getParentObjects()};CButtonsContainer.prototype.clear= function(){this.buttons.length=0};CButtonsContainer.prototype.addButton=function(oButton){this.buttons.push(oButton)};CButtonsContainer.prototype.getButtonIndex=function(oButton){for(var nButton=0;nButton<this.buttons.length;++nButton)if(this.buttons[nButton]===oButton)return nButton;return-1};CButtonsContainer.prototype.getViewButtonsCount=function(){return this.buttons.length};CButtonsContainer.prototype.getViewButtonState=function(nIndex){var oButton=this.getButton(nIndex);if(!oButton)return null; return oButton.getState()};CButtonsContainer.prototype.getButton=function(nIndex){if(nIndex>-1&&nIndex<this.buttons.length)return this.buttons[nIndex];return null};CButtonsContainer.prototype.findButtonIndex=function(x,y){var oInv=this.getInvFullTransformMatrix();var tx=oInv.TransformPointX(x,y);var ty=oInv.TransformPointY(x,y);ty-=this.getScrollOffsetY();var nRow,nRowsCount=this.getRowsCount();for(nRow=0;nRow<nRowsCount;++nRow)if(ty<this.getRowStart(nRow))break;--nRow;if(nRow===-1)return-1;var nCol, nColsCount=this.getColumnsCount();for(nCol=0;nCol<nColsCount;++nCol)if(tx<this.getColumnStart(nCol))break;--nCol;if(nCol===-1){--nRow;if(nRow===-1)return-1;nCol=nColsCount-1}var nIndex=nRow*nColsCount;if(nRow<nRowsCount-1)nIndex+=nCol;else nIndex+=Math.min(nCol,this.buttons.length-(nRowsCount-1)*nColsCount);return nIndex};CButtonsContainer.prototype.getTxStyles=function(nType){return this.slicer.getTxStyles(nType)};CButtonsContainer.prototype.getBorder=function(nType){return this.slicer.getBorder(nType)}; CButtonsContainer.prototype.getFill=function(nType){return this.slicer.getFill(nType)};CButtonsContainer.prototype.getFont=function(nType){return this.slicer.getFont(nType)};CButtonsContainer.prototype.getButtonHeight=function(){return this.slicer.getButtonHeight()};CButtonsContainer.prototype.getButtonWidth=function(){var nColumnCount=this.getColumnsCount();var nSpaceCount=nColumnCount-1;var dTotalHeight=this.getTotalHeight();var dButtonWidth;if(dTotalHeight<=this.extY)dButtonWidth=Math.max(0,this.slicer.getButtonsContainerWidth()- nSpaceCount*SPACE_BETWEEN)/nColumnCount;else dButtonWidth=Math.max(0,this.slicer.getButtonsContainerWidth()-this.scroll.getWidth()-SPACE_BETWEEN-nSpaceCount*SPACE_BETWEEN)/nColumnCount;return dButtonWidth};CButtonsContainer.prototype.getWidthByButton=function(dBWidth){var nColumnCount=this.getColumnsCount();var nSpaceCount=nColumnCount-1;var dTotalHeight=this.getTotalHeight();var dWidth;if(dTotalHeight<=this.extY)dWidth=dBWidth*nColumnCount+nSpaceCount*SPACE_BETWEEN;else dWidth=dBWidth*nColumnCount+ this.scroll.getWidth()+SPACE_BETWEEN+nSpaceCount*SPACE_BETWEEN;return dWidth};CButtonsContainer.prototype.getColumnsCount=function(){return this.slicer.getColumnsCount()};CButtonsContainer.prototype.getRowsCount=function(){return((this.buttons.length-1)/this.getColumnsCount()>>0)+1};CButtonsContainer.prototype.getRowsInFrame=function(){if(this.buttons.length===0)return 0;var dCount=this.extY/(this.getButtonHeight()+SPACE_BETWEEN);var nCeil=dCount>>0;if(dCount-nCeil>0)++nCeil;return Math.min(this.buttons.length, nCeil)};CButtonsContainer.prototype.getRowsInFrameFull=function(){if(this.buttons.length===0)return 0;var dCount=(this.extY+SPACE_BETWEEN)/(this.getButtonHeight()+SPACE_BETWEEN);if(dCount<=0)return 0;return dCount>>0};CButtonsContainer.prototype.getScrolledRows=function(){return this.getRowsCount()-this.getRowsInFrameFull()};CButtonsContainer.prototype.getTotalHeight=function(){var nRowsCount=this.getRowsCount();return this.getButtonHeight()*nRowsCount+SPACE_BETWEEN*(nRowsCount-1)};CButtonsContainer.prototype.getColumnStart= function(nColumn){return this.x+(this.getButtonWidth()+SPACE_BETWEEN)*nColumn};CButtonsContainer.prototype.getRowStart=function(nRow){return this.y+(this.getButtonHeight()+SPACE_BETWEEN)*nRow};CButtonsContainer.prototype.checkScrollTop=function(){this.scrollTop=Math.max(0,Math.min(this.scrollTop,this.getScrolledRows()))};CButtonsContainer.prototype.recalculate=function(){var nColumnCount=this.getColumnsCount();var dButtonWidth,dButtonHeight;dButtonHeight=this.getButtonHeight();dButtonWidth=this.getButtonWidth(); this.checkScrollTop();var nColumn,nRow,nButtonIndex,oButton,x,y;for(nButtonIndex=0;nButtonIndex<this.buttons.length;++nButtonIndex){nColumn=nButtonIndex%nColumnCount;nRow=nButtonIndex/nColumnCount>>0;oButton=this.buttons[nButtonIndex];x=this.getColumnStart(nColumn);y=this.getRowStart(nRow);oButton.setTransformParams(x,y,dButtonWidth,dButtonHeight,0,false,false);oButton.recalculate()}this.scroll.bVisible=this.getTotalHeight()>this.extY;this.scroll.recalculate()};CButtonsContainer.prototype.draw=function(graphics){if(this.buttons.length> 0){graphics.SaveGrState();graphics.transform3(this.slicer.transform);graphics.AddClipRect(0,this.y-SPACE_BETWEEN/2,this.slicer.extX,this.extY+SPACE_BETWEEN/2);this.checkScrollTop();var nColumns=this.getColumnsCount();var nStart=this.scrollTop*nColumns;var nEnd=Math.min(this.buttons.length-1,nStart+this.getRowsInFrame()*nColumns-1);for(var nButton=nStart;nButton<=nEnd;++nButton)this.buttons[nButton].draw(graphics);graphics.RestoreGrState();this.scroll.draw(graphics)}};CButtonsContainer.prototype.getFullTransformMatrix= function(){return AscCommon.global_MatrixTransformer.CreateDublicateM(this.slicer.transform)};CButtonsContainer.prototype.getInvFullTransformMatrix=function(){var oM=this.getFullTransformMatrix();return AscCommon.global_MatrixTransformer.Invert(oM)};CButtonsContainer.prototype.hit=function(x,y){var oInv=this.getInvFullTransformMatrix();var tx=oInv.TransformPointX(x,y);var ty=oInv.TransformPointY(x,y);var bottom=Math.min(this.y+this.extY,this.getRowStart(this.getRowsCount()-1)+this.getButtonHeight()); return tx>=this.x&&ty>=this.y&&tx<=this.x+this.extX&&ty<=bottom};CButtonsContainer.prototype.isEventListener=function(child){return this.eventListener===child};CButtonsContainer.prototype.onScroll=function(){var nOldScroll=this.scrollTop;this.scrollTop=Math.max(0,Math.min(this.scroll.getScrollTop(),this.getScrolledRows()));this.checkScrollTop();if(this.scrollTop!==nOldScroll){for(var nButton=0;nButton<this.buttons.length;++nButton){var oButton=this.buttons[nButton];oButton.recalculateTransform(); oButton.recalculateTransformText();oButton.recalculateBounds()}this.onUpdate(this.getBounds())}};CButtonsContainer.prototype.getBounds=function(){var l,t,r,b;var oTransform=this.slicer.transform;l=oTransform.TransformPointX(this.x,this.y)-.5;t=oTransform.TransformPointY(this.x,this.y)-.5;r=oTransform.TransformPointX(this.x+this.extX,this.y+this.extY)+.5;b=oTransform.TransformPointY(this.x+this.extX,this.y+this.extY)+.5;return new AscFormat.CGraphicBounds(l,t,r,b)};CButtonsContainer.prototype.onUpdate= function(oBounds){this.slicer.onUpdate(oBounds)};CButtonsContainer.prototype.onMouseMove=function(e,x,y){if(this.eventListener)return this.eventListener.onMouseMove(e,x,y);var bRet=false,nButton,nFindButton,nLast;if(e.IsLocked)if(this.slicer.isEventListener(this)){bRet=true;if(this.startButton>-1){var oButton=this.getButton(this.startButton);if(oButton){nFindButton=this.findButtonIndex(x,y);if(this.slicer.isMultiSelect()||e.CtrlKey){this.removeAllButtonsTmpState();oButton.setHoverState();if(nFindButton< this.startButton)for(nButton=Math.max(0,nFindButton);nButton<=this.startButton;++nButton)this.buttons[nButton].setInvertSelectTmpState();else{nLast=Math.min(nFindButton,this.buttons.length-1);for(nButton=this.startButton;nButton<=nLast;++nButton)this.buttons[nButton].setInvertSelectTmpState()}}else{for(nButton=0;nButton<this.buttons.length;++nButton)this.buttons[nButton].setUnselectTmpState();oButton.setHoverState();if(nFindButton<this.startButton)for(nButton=Math.max(0,nFindButton);nButton<=this.startButton;++nButton)this.buttons[nButton].setSelectTmpState(); else{nLast=Math.min(nFindButton,this.buttons.length-1);for(nButton=this.startButton;nButton<=nLast;++nButton)this.buttons[nButton].setSelectTmpState()}}}}}else bRet=false;else if(this.slicer.isEventListener(this))bRet=this.slicer.onMouseUp(e,x,y);else{for(nButton=0;nButton<this.buttons.length;++nButton)bRet|=this.buttons[nButton].onMouseMove(e,x,y);bRet|=this.scroll.onMouseMove(e,x,y)}return bRet};CButtonsContainer.prototype.onMouseDown=function(e,x,y){if(this.eventListener){this.onMouseUp(e,x,y); if(!this.eventListener)return this.onMouseDown(e,x,y)}if(this.scroll.onMouseDown(e,x,y))return true;if(this.hit(x,y)){this.slicer.setEventListener(this);var oInv=this.getInvFullTransformMatrix();this.startX=oInv.TransformPointX(x,y);this.startY=oInv.TransformPointY(x,y);this.startButton=-1;for(var nButton=0;nButton<this.buttons.length;++nButton)if(this.buttons[nButton].hit(x,y)){this.startButton=nButton;break}this.onMouseMove(e,x,y);return true}return false};CButtonsContainer.prototype.onMouseUp= function(e,x,y){var bRet=false;if(this.eventListener){bRet=this.eventListener.onMouseUp(e,x,y);this.setEventListener(null);return bRet}if(!this.slicer.isEventListener(this)){for(var nButton=0;nButton<this.buttons.length;++nButton)bRet|=this.buttons[nButton].onMouseUp(e,x,y);bRet|=this.scroll.onMouseUp(e,x,y);this.setEventListener(null)}return bRet};CButtonsContainer.prototype.onWheel=function(deltaX,deltaY){return this.scroll.onWheel(deltaX,deltaY)};CButtonsContainer.prototype.setEventListener=function(child){this.eventListener= child;if(child)this.slicer.setEventListener(this);else if(this.slicer.isEventListener(this)){this.slicer.setEventListener(null);this.removeAllButtonsTmpState()}};CButtonsContainer.prototype.getButtonState=function(nIndex){return this.slicer.getButtonState(nIndex)};CButtonsContainer.prototype.getString=function(nIndex){return this.slicer.getString(nIndex)};CButtonsContainer.prototype.getScrollOffsetX=function(){return 0};CButtonsContainer.prototype.getScrollOffsetY=function(){return-(this.getRowStart(this.scrollTop)- this.y)};CButtonsContainer.prototype.selectAllButtons=function(){for(var nButton=0;nButton<this.buttons.length;++nButton)this.buttons[nButton].setSelectTmpState()};CButtonsContainer.prototype.removeAllButtonsTmpState=function(){for(var nButton=0;nButton<this.buttons.length;++nButton)this.buttons[nButton].removeTmpState()};CButtonsContainer.prototype.getIcon=function(nIndex,nType){return null};CButtonsContainer.prototype.getCursorInfo=function(e,x,y){if(!this.hit(x,y))return null;var oRet;for(var i= 0;i<this.buttons.length;++i){oRet=this.buttons[i].getCursorInfo(e,x,y);if(oRet)return oRet}return{cursorType:"default",tooltip:null}};CButtonsContainer.prototype.getTooltipText=function(nIndex){return this.getString(nIndex)};function CScrollButton(parent,type){CInterfaceButton.call(this,parent);this.type=type}CScrollButton.prototype=Object.create(CInterfaceButton.prototype);CScrollButton.prototype.draw=function(graphics){CInterfaceButton.prototype.draw.call(this,graphics);var dInd=this.extX/4;var dMid= this.extX/2;var nColor=SCROLL_ARROW_COLORS[this.getState()];graphics.b_color1(nColor>>16&255,nColor>>8&255,nColor&255,255);if(this.type===SCROLL_BUTTON_TYPE_TOP){graphics.SaveGrState();graphics.transform3(this.transform);graphics._s();graphics._m(dInd,dMid);graphics._l(dMid,dInd);graphics._l(this.extX-dInd,dMid);graphics._z();graphics.df();graphics.RestoreGrState()}else if(this.type===SCROLL_BUTTON_TYPE_BOTTOM){graphics.SaveGrState();graphics.transform3(this.transform);graphics._s();graphics._m(dInd, dMid);graphics._l(dMid,this.extY-dInd);graphics._l(this.extX-dInd,dMid);graphics._z();graphics.df();graphics.RestoreGrState()}};function CScroll(parent){this.parent=parent;this.extX=0;this.extY=0;this.bVisible=false;this.buttons=[];this.buttons[0]=new CScrollButton(this,SCROLL_BUTTON_TYPE_TOP);this.buttons[1]=new CScrollButton(this,SCROLL_BUTTON_TYPE_BOTTOM);this.state=STYLE_TYPE.UNSELECTED_DATA;this.timerId=null;this.tmpScrollerPos=null;this.startScrollerPos=null;this.startScrollTop=null}CScroll.prototype.getBounds= function(){var oTransform=this.getFullTransformMatrix();var x=this.getPosX();var y=this.getPosY();var extX=this.getWidth();var extY=this.getHeight();var l=oTransform.TransformPointX(x,y);var t=oTransform.TransformPointY(x,y);var r=oTransform.TransformPointX(x+extX,y+extY);var b=oTransform.TransformPointY(x+extX,y+extY);return new AscFormat.CGraphicBounds(l,t,r,b)};CScroll.prototype.getTxStyles=function(){return this.parent.getTxStyles()};CScroll.prototype.getFullTransformMatrix=function(){return this.parent.getFullTransformMatrix()}; CScroll.prototype.getInvFullTransformMatrix=function(){return this.parent.getInvFullTransformMatrix()};CScroll.prototype.getFill=function(nType){var oFill=new AscCommonExcel.Fill;oFill.fromColor(new AscCommonExcel.RgbColor(SCROLL_COLORS[nType]));return oFill};CScroll.prototype.getBorder=function(nType){var r,g,b;r=206;g=206;b=206;var oBorder=new AscCommonExcel.Border(null);oBorder.l=new AscCommonExcel.BorderProp;oBorder.l.setStyle(AscCommon.c_oAscBorderStyles.Thin);oBorder.l.c=AscCommonExcel.createRgbColor(r, g,b);oBorder.t=new AscCommonExcel.BorderProp;oBorder.t.setStyle(AscCommon.c_oAscBorderStyles.Thin);oBorder.t.c=AscCommonExcel.createRgbColor(r,g,b);oBorder.r=new AscCommonExcel.BorderProp;oBorder.r.setStyle(AscCommon.c_oAscBorderStyles.Thin);oBorder.r.c=AscCommonExcel.createRgbColor(r,g,b);oBorder.b=new AscCommonExcel.BorderProp;oBorder.b.setStyle(AscCommon.c_oAscBorderStyles.Thin);oBorder.b.c=AscCommonExcel.createRgbColor(r,g,b);return oBorder};CScroll.prototype.getPosX=function(){return this.parent.x+ this.parent.extX-this.getWidth()};CScroll.prototype.getPosY=function(){return this.parent.y};CScroll.prototype.getHeight=function(){return this.parent.extY};CScroll.prototype.getWidth=function(){return SCROLL_WIDTH};CScroll.prototype.getButtonContainerPosX=function(nIndex){return this.getPosX()};CScroll.prototype.getButtonContainerPosY=function(nIndex){var dRet=0;if(nIndex===0)dRet=this.getPosY();else dRet=this.getPosY()+this.getHeight()-this.getButtonContainerSize();return dRet};CScroll.prototype.getButtonContainerSize= function(){return this.getWidth()};CScroll.prototype.getButtonPosX=function(nIndex){return this.getButtonContainerPosX(nIndex)+this.getButtonContainerSize()/2-this.getButtonSize()/2};CScroll.prototype.getButtonPosY=function(nIndex){return this.getButtonContainerPosY(nIndex)+this.getButtonContainerSize()/2-this.getButtonSize()/2};CScroll.prototype.getButtonSize=function(){return this.getScrollerWidth()};CScroll.prototype.getRailPosX=function(){return this.getPosX()+this.getWidth()/2-this.getRailWidth()/ 2};CScroll.prototype.getRailPosY=function(){return this.getPosY()+this.getButtonContainerSize()};CScroll.prototype.getRailHeight=function(){return this.getHeight()-2*this.getButtonContainerSize()};CScroll.prototype.getRailWidth=function(){return SCROLLER_WIDTH};CScroll.prototype.getScrollerX=function(){return this.getRailPosX()+this.getRailWidth()/2-this.getScrollerWidth()/2};CScroll.prototype.internalGetRelScrollerY=function(nPos){return(this.getRailHeight()-this.getScrollerHeight())*(nPos/this.parent.getScrolledRows())}; CScroll.prototype.getRelScrollerY=function(){if(this.tmpScrollerPos!==null)return this.tmpScrollerPos;return this.internalGetRelScrollerY(this.parent.scrollTop)};CScroll.prototype.getMaxRelScrollerY=function(){return this.internalGetRelScrollerY(this.parent.getScrolledRows())};CScroll.prototype.getScrollerY=function(){return this.getRailPosY()+this.getRelScrollerY()};CScroll.prototype.getScrollerWidth=function(){return this.getRailWidth()};CScroll.prototype.getScrollTop=function(){return this.parent.getScrolledRows()* (this.getScrollerY()-this.getRailPosY())/(this.getRailHeight()-this.getScrollerHeight())+.5>>0};CScroll.prototype.getScrollerHeight=function(){var dRailH=this.getRailHeight();var dMinRailH=dRailH/4;return Math.max(dMinRailH,dRailH*(dRailH/this.parent.getTotalHeight()))};CScroll.prototype.getState=function(){return this.state};CScroll.prototype.getString=function(){return""};CScroll.prototype.getButtonState=function(nIndex){return this.state};CScroll.prototype.hit=function(x,y){if(!this.bVisible)return false; var oInv=this.parent.getInvFullTransformMatrix();var tx=oInv.TransformPointX(x,y);var ty=oInv.TransformPointY(x,y);var l=this.getPosX();var t=this.getPosY();var r=l+this.getWidth();var b=t+this.getHeight();return tx>=l&&tx<=r&&ty>=t&&ty<=b};CScroll.prototype.hitInScroller=function(x,y){if(!this.bVisible)return false;var oInv=this.parent.getInvFullTransformMatrix();var tx=oInv.TransformPointX(x,y);var ty=oInv.TransformPointY(x,y);var l=this.getScrollerX();var t=this.getScrollerY();var r=l+this.getScrollerWidth(); var b=t+this.getScrollerHeight();return tx>=l&&tx<=r&&ty>=t&&ty<=b};CScroll.prototype.draw=function(graphics){if(!this.bVisible)return;var oUR=graphics.updatedRect;if(oUR)if(!oUR.isIntersectOther(this.getBounds()))return;var x,y,extX,extY,oButton;oButton=this.buttons[0];x=this.getButtonPosX(0);y=this.getButtonPosY(0);extX=this.getButtonSize();extY=this.getButtonSize();oButton.setTransformParams(x,y,extX,extY,0,false,false);oButton.recalculate();oButton.draw(graphics);oButton=this.buttons[1];x=this.getButtonPosX(1); y=this.getButtonPosY(1);oButton.setTransformParams(x,y,extX,extY,0,false,false);oButton.recalculate();oButton.draw(graphics);x=this.getScrollerX();y=this.getScrollerY();extX=this.getScrollerWidth();extY=this.getScrollerHeight();var nColor=SCROLL_COLORS[this.getState()];graphics.SaveGrState();graphics.transform3(this.parent.getFullTransformMatrix());graphics.p_color(206,206,206,255);graphics.b_color1(nColor>>16&255,nColor>>8&255,nColor&255,255);graphics.rect(x,y,extX,extY);graphics.df();graphics.p_width(0); graphics.drawHorLine(0,y,x,x+extX,0);graphics.drawHorLine(0,y+extY,x,x+extX,0);graphics.drawVerLine(2,x,y,y+extY,0);graphics.drawVerLine(2,x+extX,y,y+extY,0);graphics.RestoreGrState()};CScroll.prototype.onMouseMove=function(e,x,y){if(!this.bVisible)return false;var bRet=false;if(this.eventListener){this.eventListener.onMouseMove(e,x,y);return true}if(this.parent.isEventListener(this)){if(this.startScrollerPos===null)this.startScrollerPos=y;if(this.startScrollTop===null)this.startScrollTop=this.parent.scrollTop; var dy=y-this.startScrollerPos;this.setTmpScroll(dy+this.internalGetRelScrollerY(this.startScrollTop));return true}bRet|=this.buttons[0].onMouseMove(e,x,y);bRet|=this.buttons[1].onMouseMove(e,x,y);var bHit=this.hitInScroller(x,y);var nState=this.getState();if(nState&STATE_FLAG_HOVERED){if(!bHit){this.setState(nState&~STATE_FLAG_HOVERED);bRet=true}}else if(bHit){this.setState(nState|STATE_FLAG_HOVERED);bRet=true}return bRet};CScroll.prototype.onMouseDown=function(e,x,y){var bRet=false;if(this.hit(x, y)){bRet|=this.buttons[0].onMouseDown(e,x,y);bRet|=this.buttons[1].onMouseDown(e,x,y);if(!bRet){if(this.hitInScroller(x,y)){this.startScrollerPos=y;this.startScrollTop=this.parent.scrollTop;this.setState(this.state|STATE_FLAG_SELECTED);this.parent.setEventListener(this);this.parent.onScroll()}else{this.parent.setEventListener(this);var oInv=this.parent.getInvFullTransformMatrix();var ty=oInv.TransformPointY(x,y);if(ty<this.getScrollerY())this.startScroll(-this.internalGetRelScrollerY(3));else this.startScroll(this.internalGetRelScrollerY(3))}return true}}return bRet}; CScroll.prototype.onMouseUp=function(e,x,y){this.endScroll();var bRet=false;if(this.eventListener){bRet=this.eventListener.onMouseUp(e,x,y);this.eventListener=null;return bRet}bRet|=this.buttons[0].onMouseUp(e,x,y);bRet|=this.buttons[1].onMouseUp(e,x,y);this.setEventListener(null);return bRet};CScroll.prototype.isButtonDisabled=function(nIndex){return!this.bVisible};CScroll.prototype.isEventListener=function(child){return this.eventListener===child};CScroll.prototype.getButtonIndex=function(oButton){for(var nButton= 0;nButton<this.buttons.length;++nButton)if(this.buttons[nButton]===oButton)return nButton;return-1};CScroll.prototype.setEventListener=function(child){this.eventListener=child;if(child)this.parent.setEventListener(this);else if(this.parent.isEventListener(this))this.parent.setEventListener(null)};CScroll.prototype.getParentObjects=function(){return this.parent.getParentObjects()};CScroll.prototype.handleMouseUp=function(nIndex){var oButton=this.buttons[nIndex];if(!oButton)return;oButton.setUnselectTmpState()}; CScroll.prototype.handleMouseDown=function(nIndex){var oButton=this.buttons[nIndex];if(!oButton)return;oButton.setSelectTmpState();if(nIndex===0)this.startScroll(-this.internalGetRelScrollerY(1));else this.startScroll(this.internalGetRelScrollerY(1))};CScroll.prototype.startScroll=function(step){this.endScroll();var oScroll=this;oScroll.addScroll(step);this.timerId=setInterval(function(){oScroll.addScroll(step)},SCROLL_TIMER_INTERVAL)};CScroll.prototype.addScroll=function(step){this.setTmpScroll(this.getRelScrollerY()+ step);this.parent.onScroll()};CScroll.prototype.setTmpScroll=function(val){this.tmpScrollerPos=Math.max(0,Math.min(this.getMaxRelScrollerY(),val));this.parent.onScroll();this.onUpdate(this.getBounds())};CScroll.prototype.clearTmpScroll=function(){if(this.tmpScrollerPos!==null){this.tmpScrollerPos=null;this.parent.onScroll();this.onUpdate(this.getBounds())}};CScroll.prototype.endScroll=function(){if(this.timerId!==null){clearInterval(this.timerId);this.timerId=null}this.clearTmpScroll();this.setState(this.state& ~STATE_FLAG_SELECTED);this.startScrollerPos=null;this.startScrollTop=null};CScroll.prototype.getScrollOffsetX=function(){return 0};CScroll.prototype.getScrollOffsetY=function(){return 0};CScroll.prototype.recalculate=function(){this.buttons[0].recalculate();this.buttons[1].recalculate()};CScroll.prototype.onWheel=function(deltaX,deltaY){if(!this.bVisible)return false;var delta=deltaY;if(Math.abs(deltaX)>Math.abs(deltaY))delta=deltaX;if(delta>0)this.addScroll(this.internalGetRelScrollerY(3));else if(delta< 0)this.addScroll(-this.internalGetRelScrollerY(3));this.endScroll();return true};CScroll.prototype.getIcon=function(nIndex,nType){return null};CScroll.prototype.onUpdate=function(oBounds){this.parent.onUpdate(oBounds)};CScroll.prototype.setState=function(nState){var nOld=this.state;this.state=nState;if(this.state!==nOld)this.onUpdate(this.getBounds())};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].CSlicer=CSlicer;window["AscCommonExcel"]=window["AscCommonExcel"]||{};window["AscCommonExcel"].getSlicerIconsForLoad= getSlicerIconsForLoad})();"use strict";var c_oAscSourceType={Worksheet:0,External:1,Consolidation:2,Scenario:3};var c_oAscAxis={AxisRow:0,AxisCol:1,AxisPage:2,AxisValues:3};var c_oAscFieldSortType={Manual:0,Ascending:1,Descending:2};var c_oAscDataConsolidateFunction={Average:1,CountNums:2,Count:3,Max:4,Min:5,Product:6,StdDev:7,StdDevp:8,Sum:9,Var:10,Varp:11};var c_oAscShowDataAs={Normal:0,Difference:1,Percent:2,PercentDiff:3,RunTotal:4,PercentOfRow:5,PercentOfCol:6,PercentOfTotal:7,Index:8};var c_oAscFormatAction= {Blank:0,Formatting:1,Drill:2,Formula:3};var c_oAscScope={Selection:0,Data:1,Field:2};var c_oAscType={None:0,All:1,Row:2,Column:3};var c_oAscPivotFilterType={LastMonth:3,LastQuarter:4,LastWeek:5,LastYear:6,M1:7,M10:8,M11:9,M12:10,M2:11,M3:12,M4:13,M5:14,M6:15,M7:16,M8:17,M9:18,NextMonth:19,NextQuarter:20,NextWeek:21,NextYear:22,Unknown:23,Q1:24,Q2:25,Q3:26,Q4:27,ThisMonth:28,ThisQuarter:29,ThisWeek:30,ThisYear:31,Today:32,Tomorrow:33,YearToDate:34,Yesterday:35,CaptionEqual:36,CaptionGreaterThan:37, CaptionGreaterThanOrEqual:38,CaptionLessThan:39,CaptionLessThanOrEqual:40,CaptionNotEqual:41,CaptionBeginsWith:42,CaptionNotBeginsWith:43,CaptionEndsWith:44,CaptionNotEndsWith:45,CaptionContains:46,CaptionNotContains:47,CaptionBetween:48,CaptionNotBetween:49,ValueEqual:50,ValueGreaterThan:51,ValueGreaterThanOrEqual:52,ValueLessThan:53,ValueLessThanOrEqual:54,ValueNotEqual:55,ValueBetween:56,ValueNotBetween:57,DateEqual:58,DateOlderThan:59,DateOlderThanOrEqual:60,DateNewerThan:61,DateNewerThanOrEqual:62, DateNotEqual:63,DateBetween:64,DateNotBetween:65,Count:66,Percent:67,Sum:68};var c_oAscSortType={None:0,Ascending:1,Descending:2,AscendingAlpha:3,DescendingAlpha:4,AscendingNatural:5,DescendingNatural:6};var c_oAscPivotAreaType={None:0,Normal:1,Data:2,All:3,Origin:4,Button:5,TopEnd:6};var c_oAscGroupBy={Range:0,Seconds:1,Minutes:2,Hours:3,Days:4,Months:5,Quarters:6,Years:7};var c_oAscCalendarType={Gregorian:0,GregorianUs:1,GregorianMeFrench:2,GregorianArabic:3,Hijri:4,Hebrew:5,Taiwan:6,Japan:7,Thai:8, Korea:9,Saka:10,GregorianXlitEnglish:11,GregorianXlitFrench:12,None:13};var c_oAscIconSetType={ThreeArrows:0,ThreeArrowsGray:1,ThreeFlags:2,ThreeTrafficLights1:3,ThreeTrafficLights2:4,ThreeSigns:5,ThreeSymbols:6,ThreeSymbols2:7,FourArrows:8,FourArrowsGray:9,FourRedToBlack:10,FourRating:11,FourTrafficLights:12,FiveArrows:13,FiveArrowsGray:14,FiveRating:15,FiveQuarters:16};var c_oAscAllocationMethod={EqualAllocation:0,EqualIncrement:1,WeightedAllocation:2,WeightedIncrement:3};var st_VALUES=-2;var DATA_CAPTION= "Values";var BLANK_CAPTION="(blank)";var GRAND_TOTAL_CAPTION="Grand Total";var ROW_HEADER_CAPTION="Row Labels";var COL_HEADER_CAPTION="Column Labels";var PAGE_ALL_CAPTION="(All)";var PAGE_MULTIPLE_CAPTION="(Multiple Items)";var FIELD_CAPTION="%1 of %2";var NEW_PIVOT_LAST_COL_OFFSET=2;var NEW_PIVOT_LAST_ROW_OFFSET=17;var NEW_PIVOT_LAST_COL_OFFSET_GRID_DROP_ZONES=6;var NEW_PIVOT_LAST_ROW_OFFSET_GRID_DROP_ZONES=13;var NEW_PIVOT_ROW=2;var NEW_PIVOT_COL=0;var cDate=Asc.cDate;var c_oAscError=window["Asc"].c_oAscError; var History=AscCommon.History;var c_oAscAutoFilterTypes=Asc.c_oAscAutoFilterTypes;var c_oAscCustomAutoFilter=Asc.c_oAscCustomAutoFilter;function cmpPivotItems(sharedItems,a,b){var sharedItem=sharedItems.Items.get(a.x);var aType=sharedItem.type;var aVal=sharedItem.val;sharedItem=sharedItems.Items.get(b.x);var bType=sharedItem.type;var bVal=sharedItem.val;if(aType===bType)if(c_oAscPivotRecType.String===aType){if(aVal>bVal)return 1;if(aVal<bVal)return-1}else{if(c_oAscPivotRecType.Missing!==aType)return aVal- bVal}else return aType-bType;return 0}function PivotDataElem(dataLength){this.subtotal=this.vals={};this.total=new Array(dataLength);for(var i=0;i<dataLength;++i)this.total[i]=new AscCommonExcel.StatisticOnlineAlgorithm}PivotDataElem.prototype.unionTotal=function(val){for(var i=0;i<this.total.length;++i)this.total[i].union(val.total[i])};PivotDataElem.prototype.getTotalCount=function(val){return this.total.length};PivotDataElem.prototype.resetTotal=function(dataLength){for(var i=0;i<this.total.length;++i)this.total[i].reset()}; function setTableProperty(pivot,oldVal,newVal,addToHistory,historyType,changeData){if(oldVal===newVal)return;if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,historyType,pivot.worksheet.getId(),null,new AscCommonExcel.UndoRedoData_PivotTable(pivot.Get_Id(),oldVal,newVal));if(pivot&&changeData)pivot.setChanged(true)}function setFieldProperty(pivot,index,oldVal,newVal,addToHistory,historyType,changeData){if(oldVal===newVal)return;if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotFields, historyType,pivot.worksheet.getId(),null,new AscCommonExcel.UndoRedoData_PivotField(pivot.Get_Id(),index,oldVal,newVal));if(pivot&&changeData)pivot.setChanged(true)}function toXmlWithLength(w,elem,name,val1){var StartPos=w.GetCurPosition();w.WriteLong(0);elem.toXml(w,name,val1);var EndPos=w.GetCurPosition();w.Seek(StartPos);w.WriteLong(EndPos-StartPos-4);w.Seek(EndPos)}function XmlReaderWrapper(name,elem){this.name=name;this.elem=elem}XmlReaderWrapper.prototype.onStartNode=function(elem,attr,uq){var newContext= this;if(this.name===elem){newContext=this.elem;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else newContext=null;return newContext};function ReadNumXml(vals,uq,elem){var val;var formatId=null;var formatCode=null;val=vals["formatId"];if(undefined!==val)formatId=val-0;val=vals["formatCode"];if(undefined!==val)formatCode=AscCommon.unleakString(uq(val));if(null!==formatId||null!==formatCode)elem.num=AscCommonExcel.Num.prototype.initFromParams(formatId,formatCode,null);else{val=vals["numFmtId"]; if(undefined!==val)elem.numFmtId=val-0}}function WriteNumXml(writer,num,stylesForWrite){if(null!==num)if(stylesForWrite){var numFmtId=stylesForWrite.getNumIdByFormat(num);writer.WriteXmlAttributeNumber("numFmtId",numFmtId)}else{if(null!=num.id)writer.WriteXmlAttributeNumber("formatId",num.id);var format=num.getFormat();if(null!=format)writer.WriteXmlAttributeStringEncode("formatCode",format)}}function FromXml_ST_SourceType(val){var res=-1;if("worksheet"===val)res=c_oAscSourceType.Worksheet;else if("external"=== val)res=c_oAscSourceType.External;else if("consolidation"===val)res=c_oAscSourceType.Consolidation;else if("scenario"===val)res=c_oAscSourceType.Scenario;return res}function ToXml_ST_SourceType(val){var res="";if(c_oAscSourceType.Worksheet===val)res="worksheet";else if(c_oAscSourceType.External===val)res="external";else if(c_oAscSourceType.Consolidation===val)res="consolidation";else if(c_oAscSourceType.Scenario===val)res="scenario";return res}function FromXml_ST_Axis(val){var res=-1;if("axisRow"=== val)res=c_oAscAxis.AxisRow;else if("axisCol"===val)res=c_oAscAxis.AxisCol;else if("axisPage"===val)res=c_oAscAxis.AxisPage;else if("axisValues"===val)res=c_oAscAxis.AxisValues;return res}function ToXml_ST_Axis(val){var res="";if(c_oAscAxis.AxisRow===val)res="axisRow";else if(c_oAscAxis.AxisCol===val)res="axisCol";else if(c_oAscAxis.AxisPage===val)res="axisPage";else if(c_oAscAxis.AxisValues===val)res="axisValues";return res}function FromXml_ST_FieldSortType(val){var res=-1;if("manual"===val)res=c_oAscFieldSortType.Manual; else if("ascending"===val)res=c_oAscFieldSortType.Ascending;else if("descending"===val)res=c_oAscFieldSortType.Descending;return res}function ToXml_ST_FieldSortType(val){var res="";if(c_oAscFieldSortType.Manual===val)res="manual";else if(c_oAscFieldSortType.Ascending===val)res="ascending";else if(c_oAscFieldSortType.Descending===val)res="descending";return res}function FromXml_ST_ItemType(val){var res=-1;if("data"===val)res=Asc.c_oAscItemType.Data;else if("default"===val)res=Asc.c_oAscItemType.Default; else if("sum"===val)res=Asc.c_oAscItemType.Sum;else if("countA"===val)res=Asc.c_oAscItemType.CountA;else if("avg"===val)res=Asc.c_oAscItemType.Avg;else if("max"===val)res=Asc.c_oAscItemType.Max;else if("min"===val)res=Asc.c_oAscItemType.Min;else if("product"===val)res=Asc.c_oAscItemType.Product;else if("count"===val)res=Asc.c_oAscItemType.Count;else if("stdDev"===val)res=Asc.c_oAscItemType.StdDev;else if("stdDevP"===val)res=Asc.c_oAscItemType.StdDevP;else if("var"===val)res=Asc.c_oAscItemType.Var; else if("varP"===val)res=Asc.c_oAscItemType.VarP;else if("grand"===val)res=Asc.c_oAscItemType.Grand;else if("blank"===val)res=Asc.c_oAscItemType.Blank;return res}function ToXml_ST_ItemType(val){var res="";if(Asc.c_oAscItemType.Data===val)res="data";else if(Asc.c_oAscItemType.Default===val)res="default";else if(Asc.c_oAscItemType.Sum===val)res="sum";else if(Asc.c_oAscItemType.CountA===val)res="countA";else if(Asc.c_oAscItemType.Avg===val)res="avg";else if(Asc.c_oAscItemType.Max===val)res="max";else if(Asc.c_oAscItemType.Min=== val)res="min";else if(Asc.c_oAscItemType.Product===val)res="product";else if(Asc.c_oAscItemType.Count===val)res="count";else if(Asc.c_oAscItemType.StdDev===val)res="stdDev";else if(Asc.c_oAscItemType.StdDevP===val)res="stdDevP";else if(Asc.c_oAscItemType.Var===val)res="var";else if(Asc.c_oAscItemType.VarP===val)res="varP";else if(Asc.c_oAscItemType.Grand===val)res="grand";else if(Asc.c_oAscItemType.Blank===val)res="blank";return res}function ToName_ST_ItemType(val){var res="";if(Asc.c_oAscItemType.Default=== val)res+="Total";else if(Asc.c_oAscItemType.Avg===val)res+="Average";else if(Asc.c_oAscItemType.Count===val)res+="Count";else if(Asc.c_oAscItemType.CountA===val)res+="Count";else if(Asc.c_oAscItemType.Max===val)res+="Max";else if(Asc.c_oAscItemType.Min===val)res+="Min";else if(Asc.c_oAscItemType.Product===val)res+="Product";else if(Asc.c_oAscItemType.StdDev===val)res+="StdDev";else if(Asc.c_oAscItemType.StdDevP===val)res+="StdDevp";else if(Asc.c_oAscItemType.Sum===val)res+="Sum";else if(Asc.c_oAscItemType.Var=== val)res+="Var";else if(Asc.c_oAscItemType.VarP===val)res+="Varp";else if(Asc.c_oAscItemType.Data===val)res+="Data";else if(Asc.c_oAscItemType.Grand===val)res+="Total";else if(Asc.c_oAscItemType.Blank===val)res+="Blank";return res}function FromXml_ST_DataConsolidateFunction(val){var res=-1;if("average"===val)res=c_oAscDataConsolidateFunction.Average;else if("count"===val)res=c_oAscDataConsolidateFunction.Count;else if("countNums"===val)res=c_oAscDataConsolidateFunction.CountNums;else if("max"===val)res= c_oAscDataConsolidateFunction.Max;else if("min"===val)res=c_oAscDataConsolidateFunction.Min;else if("product"===val)res=c_oAscDataConsolidateFunction.Product;else if("stdDev"===val)res=c_oAscDataConsolidateFunction.StdDev;else if("stdDevp"===val)res=c_oAscDataConsolidateFunction.StdDevp;else if("sum"===val)res=c_oAscDataConsolidateFunction.Sum;else if("var"===val)res=c_oAscDataConsolidateFunction.Var;else if("varp"===val)res=c_oAscDataConsolidateFunction.Varp;return res}function ToXml_ST_DataConsolidateFunction(val){var res= "";if(c_oAscDataConsolidateFunction.Average===val)res="average";else if(c_oAscDataConsolidateFunction.Count===val)res="count";else if(c_oAscDataConsolidateFunction.CountNums===val)res="countNums";else if(c_oAscDataConsolidateFunction.Max===val)res="max";else if(c_oAscDataConsolidateFunction.Min===val)res="min";else if(c_oAscDataConsolidateFunction.Product===val)res="product";else if(c_oAscDataConsolidateFunction.StdDev===val)res="stdDev";else if(c_oAscDataConsolidateFunction.StdDevp===val)res="stdDevp"; else if(c_oAscDataConsolidateFunction.Sum===val)res="sum";else if(c_oAscDataConsolidateFunction.Var===val)res="var";else if(c_oAscDataConsolidateFunction.Varp===val)res="varp";return res}function ToName_ST_DataConsolidateFunction(val){var res="";if(c_oAscDataConsolidateFunction.Average===val)res="Average";else if(c_oAscDataConsolidateFunction.Count===val)res="Count";else if(c_oAscDataConsolidateFunction.CountNums===val)res="Count";else if(c_oAscDataConsolidateFunction.Max===val)res="Max";else if(c_oAscDataConsolidateFunction.Min=== val)res="Min";else if(c_oAscDataConsolidateFunction.Product===val)res="Product";else if(c_oAscDataConsolidateFunction.StdDev===val)res="StdDev";else if(c_oAscDataConsolidateFunction.StdDevp===val)res="StdDevp";else if(c_oAscDataConsolidateFunction.Sum===val)res="Sum";else if(c_oAscDataConsolidateFunction.Var===val)res="Var";else if(c_oAscDataConsolidateFunction.Varp===val)res="Varp";return res}function FromXml_ST_ShowDataAs(val){var res=-1;if("normal"===val)res=c_oAscShowDataAs.Normal;else if("difference"=== val)res=c_oAscShowDataAs.Difference;else if("percent"===val)res=c_oAscShowDataAs.Percent;else if("percentDiff"===val)res=c_oAscShowDataAs.PercentDiff;else if("runTotal"===val)res=c_oAscShowDataAs.RunTotal;else if("percentOfRow"===val)res=c_oAscShowDataAs.PercentOfRow;else if("percentOfCol"===val)res=c_oAscShowDataAs.PercentOfCol;else if("percentOfTotal"===val)res=c_oAscShowDataAs.PercentOfTotal;else if("index"===val)res=c_oAscShowDataAs.Index;return res}function ToXml_ST_ShowDataAs(val){var res=""; if(c_oAscShowDataAs.Normal===val)res="normal";else if(c_oAscShowDataAs.Difference===val)res="difference";else if(c_oAscShowDataAs.Percent===val)res="percent";else if(c_oAscShowDataAs.PercentDiff===val)res="percentDiff";else if(c_oAscShowDataAs.RunTotal===val)res="runTotal";else if(c_oAscShowDataAs.PercentOfRow===val)res="percentOfRow";else if(c_oAscShowDataAs.PercentOfCol===val)res="percentOfCol";else if(c_oAscShowDataAs.PercentOfTotal===val)res="percentOfTotal";else if(c_oAscShowDataAs.Index===val)res= "index";return res}function FromXml_ST_FormatAction(val){var res=-1;if("blank"===val)res=c_oAscFormatAction.Blank;else if("formatting"===val)res=c_oAscFormatAction.Formatting;else if("drill"===val)res=c_oAscFormatAction.Drill;else if("formula"===val)res=c_oAscFormatAction.Formula;return res}function ToXml_ST_FormatAction(val){var res="";if(c_oAscFormatAction.Blank===val)res="blank";else if(c_oAscFormatAction.Formatting===val)res="formatting";else if(c_oAscFormatAction.Drill===val)res="drill";else if(c_oAscFormatAction.Formula=== val)res="formula";return res}function FromXml_ST_Scope(val){var res=-1;if("selection"===val)res=c_oAscScope.Selection;else if("data"===val)res=c_oAscScope.Data;else if("field"===val)res=c_oAscScope.Field;return res}function ToXml_ST_Scope(val){var res="";if(c_oAscScope.Selection===val)res="selection";else if(c_oAscScope.Data===val)res="data";else if(c_oAscScope.Field===val)res="field";return res}function FromXml_ST_Type(val){var res=-1;if("none"===val)res=c_oAscType.None;else if("all"===val)res=c_oAscType.All; else if("row"===val)res=c_oAscType.Row;else if("column"===val)res=c_oAscType.Column;return res}function ToXml_ST_Type(val){var res="";if(c_oAscType.None===val)res="none";else if(c_oAscType.All===val)res="all";else if(c_oAscType.Row===val)res="row";else if(c_oAscType.Column===val)res="column";return res}function FromXml_ST_PivotFilterType(val){var res=-1;if("unknown"===val)res=c_oAscPivotFilterType.Unknown;else if("count"===val)res=c_oAscPivotFilterType.Count;else if("percent"===val)res=c_oAscPivotFilterType.Percent; else if("sum"===val)res=c_oAscPivotFilterType.Sum;else if("captionEqual"===val)res=c_oAscPivotFilterType.CaptionEqual;else if("captionNotEqual"===val)res=c_oAscPivotFilterType.CaptionNotEqual;else if("captionBeginsWith"===val)res=c_oAscPivotFilterType.CaptionBeginsWith;else if("captionNotBeginsWith"===val)res=c_oAscPivotFilterType.CaptionNotBeginsWith;else if("captionEndsWith"===val)res=c_oAscPivotFilterType.CaptionEndsWith;else if("captionNotEndsWith"===val)res=c_oAscPivotFilterType.CaptionNotEndsWith; else if("captionContains"===val)res=c_oAscPivotFilterType.CaptionContains;else if("captionNotContains"===val)res=c_oAscPivotFilterType.CaptionNotContains;else if("captionGreaterThan"===val)res=c_oAscPivotFilterType.CaptionGreaterThan;else if("captionGreaterThanOrEqual"===val)res=c_oAscPivotFilterType.CaptionGreaterThanOrEqual;else if("captionLessThan"===val)res=c_oAscPivotFilterType.CaptionLessThan;else if("captionLessThanOrEqual"===val)res=c_oAscPivotFilterType.CaptionLessThanOrEqual;else if("captionBetween"=== val)res=c_oAscPivotFilterType.CaptionBetween;else if("captionNotBetween"===val)res=c_oAscPivotFilterType.CaptionNotBetween;else if("valueEqual"===val)res=c_oAscPivotFilterType.ValueEqual;else if("valueNotEqual"===val)res=c_oAscPivotFilterType.ValueNotEqual;else if("valueGreaterThan"===val)res=c_oAscPivotFilterType.ValueGreaterThan;else if("valueGreaterThanOrEqual"===val)res=c_oAscPivotFilterType.ValueGreaterThanOrEqual;else if("valueLessThan"===val)res=c_oAscPivotFilterType.ValueLessThan;else if("valueLessThanOrEqual"=== val)res=c_oAscPivotFilterType.ValueLessThanOrEqual;else if("valueBetween"===val)res=c_oAscPivotFilterType.ValueBetween;else if("valueNotBetween"===val)res=c_oAscPivotFilterType.ValueNotBetween;else if("dateEqual"===val)res=c_oAscPivotFilterType.DateEqual;else if("dateNotEqual"===val)res=c_oAscPivotFilterType.DateNotEqual;else if("dateOlderThan"===val)res=c_oAscPivotFilterType.DateOlderThan;else if("dateOlderThanOrEqual"===val)res=c_oAscPivotFilterType.DateOlderThanOrEqual;else if("dateNewerThan"=== val)res=c_oAscPivotFilterType.DateNewerThan;else if("dateNewerThanOrEqual"===val)res=c_oAscPivotFilterType.DateNewerThanOrEqual;else if("dateBetween"===val)res=c_oAscPivotFilterType.DateBetween;else if("dateNotBetween"===val)res=c_oAscPivotFilterType.DateNotBetween;else if("tomorrow"===val)res=c_oAscPivotFilterType.Tomorrow;else if("today"===val)res=c_oAscPivotFilterType.Today;else if("yesterday"===val)res=c_oAscPivotFilterType.Yesterday;else if("nextWeek"===val)res=c_oAscPivotFilterType.NextWeek; else if("thisWeek"===val)res=c_oAscPivotFilterType.ThisWeek;else if("lastWeek"===val)res=c_oAscPivotFilterType.LastWeek;else if("nextMonth"===val)res=c_oAscPivotFilterType.NextMonth;else if("thisMonth"===val)res=c_oAscPivotFilterType.ThisMonth;else if("lastMonth"===val)res=c_oAscPivotFilterType.LastMonth;else if("nextQuarter"===val)res=c_oAscPivotFilterType.NextQuarter;else if("thisQuarter"===val)res=c_oAscPivotFilterType.ThisQuarter;else if("lastQuarter"===val)res=c_oAscPivotFilterType.LastQuarter; else if("nextYear"===val)res=c_oAscPivotFilterType.NextYear;else if("thisYear"===val)res=c_oAscPivotFilterType.ThisYear;else if("lastYear"===val)res=c_oAscPivotFilterType.LastYear;else if("yearToDate"===val)res=c_oAscPivotFilterType.YearToDate;else if("Q1"===val)res=c_oAscPivotFilterType.Q1;else if("Q2"===val)res=c_oAscPivotFilterType.Q2;else if("Q3"===val)res=c_oAscPivotFilterType.Q3;else if("Q4"===val)res=c_oAscPivotFilterType.Q4;else if("M1"===val)res=c_oAscPivotFilterType.M1;else if("M2"===val)res= c_oAscPivotFilterType.M2;else if("M3"===val)res=c_oAscPivotFilterType.M3;else if("M4"===val)res=c_oAscPivotFilterType.M4;else if("M5"===val)res=c_oAscPivotFilterType.M5;else if("M6"===val)res=c_oAscPivotFilterType.M6;else if("M7"===val)res=c_oAscPivotFilterType.M7;else if("M8"===val)res=c_oAscPivotFilterType.M8;else if("M9"===val)res=c_oAscPivotFilterType.M9;else if("M10"===val)res=c_oAscPivotFilterType.M10;else if("M11"===val)res=c_oAscPivotFilterType.M11;else if("M12"===val)res=c_oAscPivotFilterType.M12; return res}function ToXml_ST_PivotFilterType(val){var res="";if(c_oAscPivotFilterType.Unknown===val)res="unknown";else if(c_oAscPivotFilterType.Count===val)res="count";else if(c_oAscPivotFilterType.Percent===val)res="percent";else if(c_oAscPivotFilterType.Sum===val)res="sum";else if(c_oAscPivotFilterType.CaptionEqual===val)res="captionEqual";else if(c_oAscPivotFilterType.CaptionNotEqual===val)res="captionNotEqual";else if(c_oAscPivotFilterType.CaptionBeginsWith===val)res="captionBeginsWith";else if(c_oAscPivotFilterType.CaptionNotBeginsWith=== val)res="captionNotBeginsWith";else if(c_oAscPivotFilterType.CaptionEndsWith===val)res="captionEndsWith";else if(c_oAscPivotFilterType.CaptionNotEndsWith===val)res="captionNotEndsWith";else if(c_oAscPivotFilterType.CaptionContains===val)res="captionContains";else if(c_oAscPivotFilterType.CaptionNotContains===val)res="captionNotContains";else if(c_oAscPivotFilterType.CaptionGreaterThan===val)res="captionGreaterThan";else if(c_oAscPivotFilterType.CaptionGreaterThanOrEqual===val)res="captionGreaterThanOrEqual"; else if(c_oAscPivotFilterType.CaptionLessThan===val)res="captionLessThan";else if(c_oAscPivotFilterType.CaptionLessThanOrEqual===val)res="captionLessThanOrEqual";else if(c_oAscPivotFilterType.CaptionBetween===val)res="captionBetween";else if(c_oAscPivotFilterType.CaptionNotBetween===val)res="captionNotBetween";else if(c_oAscPivotFilterType.ValueEqual===val)res="valueEqual";else if(c_oAscPivotFilterType.ValueNotEqual===val)res="valueNotEqual";else if(c_oAscPivotFilterType.ValueGreaterThan===val)res= "valueGreaterThan";else if(c_oAscPivotFilterType.ValueGreaterThanOrEqual===val)res="valueGreaterThanOrEqual";else if(c_oAscPivotFilterType.ValueLessThan===val)res="valueLessThan";else if(c_oAscPivotFilterType.ValueLessThanOrEqual===val)res="valueLessThanOrEqual";else if(c_oAscPivotFilterType.ValueBetween===val)res="valueBetween";else if(c_oAscPivotFilterType.ValueNotBetween===val)res="valueNotBetween";else if(c_oAscPivotFilterType.DateEqual===val)res="dateEqual";else if(c_oAscPivotFilterType.DateNotEqual=== val)res="dateNotEqual";else if(c_oAscPivotFilterType.DateOlderThan===val)res="dateOlderThan";else if(c_oAscPivotFilterType.DateOlderThanOrEqual===val)res="dateOlderThanOrEqual";else if(c_oAscPivotFilterType.DateNewerThan===val)res="dateNewerThan";else if(c_oAscPivotFilterType.DateNewerThanOrEqual===val)res="dateNewerThanOrEqual";else if(c_oAscPivotFilterType.DateBetween===val)res="dateBetween";else if(c_oAscPivotFilterType.DateNotBetween===val)res="dateNotBetween";else if(c_oAscPivotFilterType.Tomorrow=== val)res="tomorrow";else if(c_oAscPivotFilterType.Today===val)res="today";else if(c_oAscPivotFilterType.Yesterday===val)res="yesterday";else if(c_oAscPivotFilterType.NextWeek===val)res="nextWeek";else if(c_oAscPivotFilterType.ThisWeek===val)res="thisWeek";else if(c_oAscPivotFilterType.LastWeek===val)res="lastWeek";else if(c_oAscPivotFilterType.NextMonth===val)res="nextMonth";else if(c_oAscPivotFilterType.ThisMonth===val)res="thisMonth";else if(c_oAscPivotFilterType.LastMonth===val)res="lastMonth"; else if(c_oAscPivotFilterType.NextQuarter===val)res="nextQuarter";else if(c_oAscPivotFilterType.ThisQuarter===val)res="thisQuarter";else if(c_oAscPivotFilterType.LastQuarter===val)res="lastQuarter";else if(c_oAscPivotFilterType.NextYear===val)res="nextYear";else if(c_oAscPivotFilterType.ThisYear===val)res="thisYear";else if(c_oAscPivotFilterType.LastYear===val)res="lastYear";else if(c_oAscPivotFilterType.YearToDate===val)res="yearToDate";else if(c_oAscPivotFilterType.Q1===val)res="Q1";else if(c_oAscPivotFilterType.Q2=== val)res="Q2";else if(c_oAscPivotFilterType.Q3===val)res="Q3";else if(c_oAscPivotFilterType.Q4===val)res="Q4";else if(c_oAscPivotFilterType.M1===val)res="M1";else if(c_oAscPivotFilterType.M2===val)res="M2";else if(c_oAscPivotFilterType.M3===val)res="M3";else if(c_oAscPivotFilterType.M4===val)res="M4";else if(c_oAscPivotFilterType.M5===val)res="M5";else if(c_oAscPivotFilterType.M6===val)res="M6";else if(c_oAscPivotFilterType.M7===val)res="M7";else if(c_oAscPivotFilterType.M8===val)res="M8";else if(c_oAscPivotFilterType.M9=== val)res="M9";else if(c_oAscPivotFilterType.M10===val)res="M10";else if(c_oAscPivotFilterType.M11===val)res="M11";else if(c_oAscPivotFilterType.M12===val)res="M12";return res}function FromXml_ST_SortType(val){var res=-1;if("none"===val)res=c_oAscSortType.None;else if("ascending"===val)res=c_oAscSortType.Ascending;else if("descending"===val)res=c_oAscSortType.Descending;else if("ascendingAlpha"===val)res=c_oAscSortType.AscendingAlpha;else if("descendingAlpha"===val)res=c_oAscSortType.DescendingAlpha; else if("ascendingNatural"===val)res=c_oAscSortType.AscendingNatural;else if("descendingNatural"===val)res=c_oAscSortType.DescendingNatural;return res}function ToXml_ST_SortType(val){var res="";if(c_oAscSortType.None===val)res="none";else if(c_oAscSortType.Ascending===val)res="ascending";else if(c_oAscSortType.Descending===val)res="descending";else if(c_oAscSortType.AscendingAlpha===val)res="ascendingAlpha";else if(c_oAscSortType.DescendingAlpha===val)res="descendingAlpha";else if(c_oAscSortType.AscendingNatural=== val)res="ascendingNatural";else if(c_oAscSortType.DescendingNatural===val)res="descendingNatural";return res}function FromXml_ST_PivotAreaType(val){var res=-1;if("none"===val)res=c_oAscPivotAreaType.None;else if("normal"===val)res=c_oAscPivotAreaType.Normal;else if("data"===val)res=c_oAscPivotAreaType.Data;else if("all"===val)res=c_oAscPivotAreaType.All;else if("origin"===val)res=c_oAscPivotAreaType.Origin;else if("button"===val)res=c_oAscPivotAreaType.Button;else if("topEnd"===val)res=c_oAscPivotAreaType.TopEnd; return res}function ToXml_ST_PivotAreaType(val){var res="";if(c_oAscPivotAreaType.None===val)res="none";else if(c_oAscPivotAreaType.Normal===val)res="normal";else if(c_oAscPivotAreaType.Data===val)res="data";else if(c_oAscPivotAreaType.All===val)res="all";else if(c_oAscPivotAreaType.Origin===val)res="origin";else if(c_oAscPivotAreaType.Button===val)res="button";else if(c_oAscPivotAreaType.TopEnd===val)res="topEnd";return res}function FromXml_ST_GroupBy(val){var res=-1;if("range"===val)res=c_oAscGroupBy.Range; else if("seconds"===val)res=c_oAscGroupBy.Seconds;else if("minutes"===val)res=c_oAscGroupBy.Minutes;else if("hours"===val)res=c_oAscGroupBy.Hours;else if("days"===val)res=c_oAscGroupBy.Days;else if("months"===val)res=c_oAscGroupBy.Months;else if("quarters"===val)res=c_oAscGroupBy.Quarters;else if("years"===val)res=c_oAscGroupBy.Years;return res}function ToXml_ST_GroupBy(val){var res="";if(c_oAscGroupBy.Range===val)res="range";else if(c_oAscGroupBy.Seconds===val)res="seconds";else if(c_oAscGroupBy.Minutes=== val)res="minutes";else if(c_oAscGroupBy.Hours===val)res="hours";else if(c_oAscGroupBy.Days===val)res="days";else if(c_oAscGroupBy.Months===val)res="months";else if(c_oAscGroupBy.Quarters===val)res="quarters";else if(c_oAscGroupBy.Years===val)res="years";return res}function FromXml_ST_CalendarType(val){var res=-1;if("gregorian"===val)res=c_oAscCalendarType.Gregorian;else if("gregorianUs"===val)res=c_oAscCalendarType.GregorianUs;else if("gregorianMeFrench"===val)res=c_oAscCalendarType.GregorianMeFrench; else if("gregorianArabic"===val)res=c_oAscCalendarType.GregorianArabic;else if("hijri"===val)res=c_oAscCalendarType.Hijri;else if("hebrew"===val)res=c_oAscCalendarType.Hebrew;else if("taiwan"===val)res=c_oAscCalendarType.Taiwan;else if("japan"===val)res=c_oAscCalendarType.Japan;else if("thai"===val)res=c_oAscCalendarType.Thai;else if("korea"===val)res=c_oAscCalendarType.Korea;else if("saka"===val)res=c_oAscCalendarType.Saka;else if("gregorianXlitEnglish"===val)res=c_oAscCalendarType.GregorianXlitEnglish; else if("gregorianXlitFrench"===val)res=c_oAscCalendarType.GregorianXlitFrench;else if("none"===val)res=c_oAscCalendarType.None;return res}function ToXml_ST_CalendarType(val){var res="";if(c_oAscCalendarType.Gregorian===val)res="gregorian";else if(c_oAscCalendarType.GregorianUs===val)res="gregorianUs";else if(c_oAscCalendarType.GregorianMeFrench===val)res="gregorianMeFrench";else if(c_oAscCalendarType.GregorianArabic===val)res="gregorianArabic";else if(c_oAscCalendarType.Hijri===val)res="hijri";else if(c_oAscCalendarType.Hebrew=== val)res="hebrew";else if(c_oAscCalendarType.Taiwan===val)res="taiwan";else if(c_oAscCalendarType.Japan===val)res="japan";else if(c_oAscCalendarType.Thai===val)res="thai";else if(c_oAscCalendarType.Korea===val)res="korea";else if(c_oAscCalendarType.Saka===val)res="saka";else if(c_oAscCalendarType.GregorianXlitEnglish===val)res="gregorianXlitEnglish";else if(c_oAscCalendarType.GregorianXlitFrench===val)res="gregorianXlitFrench";else if(c_oAscCalendarType.None===val)res="none";return res}function FromXml_ST_IconSetType(val){var res= -1;if("3Arrows"===val)res=c_oAscIconSetType.ThreeArrows;else if("3ArrowsGray"===val)res=c_oAscIconSetType.ThreeArrowsGray;else if("3Flags"===val)res=c_oAscIconSetType.ThreeFlags;else if("3TrafficLights1"===val)res=c_oAscIconSetType.ThreeTrafficLights1;else if("3TrafficLights2"===val)res=c_oAscIconSetType.ThreeTrafficLights2;else if("3Signs"===val)res=c_oAscIconSetType.ThreeSigns;else if("3Symbols"===val)res=c_oAscIconSetType.ThreeSymbols;else if("3Symbols2"===val)res=c_oAscIconSetType.ThreeSymbols2; else if("4Arrows"===val)res=c_oAscIconSetType.FourArrows;else if("4ArrowsGray"===val)res=c_oAscIconSetType.FourArrowsGray;else if("4RedToBlack"===val)res=c_oAscIconSetType.FourRedToBlack;else if("4Rating"===val)res=c_oAscIconSetType.FourRating;else if("4TrafficLights"===val)res=c_oAscIconSetType.FourTrafficLights;else if("5Arrows"===val)res=c_oAscIconSetType.FiveArrows;else if("5ArrowsGray"===val)res=c_oAscIconSetType.FiveArrowsGray;else if("5Rating"===val)res=c_oAscIconSetType.FiveRating;else if("5Quarters"=== val)res=c_oAscIconSetType.FiveQuarters;return res}function ToXml_ST_IconSetType(val){var res="";if(c_oAscIconSetType.ThreeArrows===val)res="3Arrows";else if(c_oAscIconSetType.ThreeArrowsGray===val)res="3ArrowsGray";else if(c_oAscIconSetType.ThreeFlags===val)res="3Flags";else if(c_oAscIconSetType.ThreeTrafficLights1===val)res="3TrafficLights1";else if(c_oAscIconSetType.ThreeTrafficLights2===val)res="3TrafficLights2";else if(c_oAscIconSetType.ThreeSigns===val)res="3Signs";else if(c_oAscIconSetType.ThreeSymbols=== val)res="3Symbols";else if(c_oAscIconSetType.ThreeSymbols2===val)res="3Symbols2";else if(c_oAscIconSetType.FourArrows===val)res="4Arrows";else if(c_oAscIconSetType.FourArrowsGray===val)res="4ArrowsGray";else if(c_oAscIconSetType.FourRedToBlack===val)res="4RedToBlack";else if(c_oAscIconSetType.FourRating===val)res="4Rating";else if(c_oAscIconSetType.FourTrafficLights===val)res="4TrafficLights";else if(c_oAscIconSetType.FiveArrows===val)res="5Arrows";else if(c_oAscIconSetType.FiveArrowsGray===val)res= "5ArrowsGray";else if(c_oAscIconSetType.FiveRating===val)res="5Rating";else if(c_oAscIconSetType.FiveQuarters===val)res="5Quarters";return res}function FromXml_ST_AllocationMethod(val){var res=-1;if("equalAllocation"===val)res=c_oAscAllocationMethod.EqualAllocation;else if("equalIncrement"===val)res=c_oAscAllocationMethod.EqualIncrement;else if("weightedAllocation"===val)res=c_oAscAllocationMethod.WeightedAllocation;else if("weightedIncrement"===val)res=c_oAscAllocationMethod.WeightedIncrement;return res} function ToXml_ST_AllocationMethod(val){var res="";if(c_oAscAllocationMethod.EqualAllocation===val)res="equalAllocation";else if(c_oAscAllocationMethod.EqualIncrement===val)res="equalIncrement";else if(c_oAscAllocationMethod.WeightedAllocation===val)res="weightedAllocation";else if(c_oAscAllocationMethod.WeightedIncrement===val)res="weightedIncrement";return res}function CT_PivotCacheDefinition(){this.id=null;this.invalid=false;this.saveData=true;this.refreshOnLoad=false;this.optimizeMemory=false; this.enableRefresh=true;this.refreshedBy=null;this.refreshedDate=null;this.backgroundQuery=false;this.missingItemsLimit=null;this.createdVersion=0;this.refreshedVersion=0;this.minRefreshableVersion=0;this.upgradeOnRefresh=false;this.hasTupleCache=false;this.supportSubquery=false;this.supportAdvancedDrill=false;this.cacheSource=null;this.cacheFields=null;this.cacheHierarchies=null;this.kpis=null;this.tupleCache=null;this.calculatedItems=null;this.calculatedMembers=null;this.dimensions=null;this.measureGroups= null;this.maps=null;this.pivotCacheDefinitionX14=null;this.cacheRecords=null;this.Id=AscCommon.g_oIdCounter.Get_NewId()}CT_PivotCacheDefinition.prototype.initPostOpenZip=function(oNumFmts){var cacheFields=this.getFields();if(cacheFields)cacheFields.forEach(function(cacheField){cacheField.initPostOpenZip(oNumFmts)})};CT_PivotCacheDefinition.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.PivotCacheDefinition};CT_PivotCacheDefinition.prototype.Get_Id=function(){return this.Id}; CT_PivotCacheDefinition.prototype.Write_ToBinary2=function(w){var t=this;AscCommonExcel.executeInR1C1Mode(false,function(){toXmlWithLength(w,t)});if(this.cacheRecords){w.WriteBool(true);this.cacheRecords.Write_ToBinary2(w)}else w.WriteBool(false)};CT_PivotCacheDefinition.prototype.Read_FromBinary2=function(r){var t=this;var len=r.GetLong();AscCommonExcel.executeInR1C1Mode(false,function(){(new AscCommon.openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(r,len),t)});if(r.GetBool()){this.cacheRecords= new CT_PivotCacheRecords;this.cacheRecords.Read_FromBinary2(r)}};CT_PivotCacheDefinition.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["r:id"];if(undefined!==val)this.id=AscCommon.unleakString(uq(val));val=vals["invalid"];if(undefined!==val)this.invalid=AscCommon.getBoolFromXml(val);val=vals["saveData"];if(undefined!==val)this.saveData=AscCommon.getBoolFromXml(val);val=vals["refreshOnLoad"];if(undefined!==val)this.refreshOnLoad=AscCommon.getBoolFromXml(val); val=vals["optimizeMemory"];if(undefined!==val)this.optimizeMemory=AscCommon.getBoolFromXml(val);val=vals["enableRefresh"];if(undefined!==val)this.enableRefresh=AscCommon.getBoolFromXml(val);val=vals["refreshedBy"];if(undefined!==val)this.refreshedBy=AscCommon.unleakString(uq(val));val=vals["refreshedDate"];if(undefined!==val)this.refreshedDate=val-0;val=vals["backgroundQuery"];if(undefined!==val)this.backgroundQuery=AscCommon.getBoolFromXml(val);val=vals["missingItemsLimit"];if(undefined!==val)this.missingItemsLimit= val-0;val=vals["createdVersion"];if(undefined!==val)this.createdVersion=val-0;val=vals["refreshedVersion"];if(undefined!==val)this.refreshedVersion=val-0;val=vals["minRefreshableVersion"];if(undefined!==val)this.minRefreshableVersion=val-0;val=vals["upgradeOnRefresh"];if(undefined!==val)this.upgradeOnRefresh=AscCommon.getBoolFromXml(val);val=vals["tupleCache"];if(undefined!==val)this.hasTupleCache=AscCommon.getBoolFromXml(val);val=vals["supportSubquery"];if(undefined!==val)this.supportSubquery=AscCommon.getBoolFromXml(val); val=vals["supportAdvancedDrill"];if(undefined!==val)this.supportAdvancedDrill=AscCommon.getBoolFromXml(val)}};CT_PivotCacheDefinition.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotCacheDefinition"===elem){if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("cacheSource"===elem){newContext=new CT_CacheSource;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.cacheSource=newContext}else if("cacheFields"===elem){newContext=new CT_CacheFields; if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.cacheFields=newContext}else if("cacheHierarchies"===elem){newContext=new CT_CacheHierarchies;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.cacheHierarchies=newContext}else if("kpis"===elem){newContext=new CT_PCDKPIs;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.kpis=newContext}else if("tupleCache"===elem){newContext=new CT_TupleCache;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.tupleCache=newContext}else if("calculatedItems"===elem){newContext=new CT_CalculatedItems;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.calculatedItems=newContext}else if("calculatedMembers"===elem){newContext=new CT_CalculatedMembers;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.calculatedMembers=newContext}else if("dimensions"===elem){newContext=new CT_Dimensions;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.dimensions= newContext}else if("measureGroups"===elem){newContext=new CT_MeasureGroups;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.measureGroups=newContext}else if("maps"===elem){newContext=new CT_MeasureDimensionMaps;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.maps=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else newContext=null;return newContext};CT_PivotCacheDefinition.prototype.onEndNode= function(prevContext,elem){if("extLst"===elem)for(var i=0;i<prevContext.ext.length;++i){var ext=prevContext.ext[i];if("{725AE2AE-9491-48be-B2B4-4EB974FC3084}"===ext.uri)this.pivotCacheDefinitionX14=ext.elem}};CT_PivotCacheDefinition.prototype.toXml=function(writer,stylesForWrite){writer.WriteXmlString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');writer.WriteXmlNodeStart("pivotCacheDefinition");writer.WriteXmlString(' xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"'); if(false!==this.invalid)writer.WriteXmlAttributeBool("invalid",this.invalid);if(true!==this.saveData)writer.WriteXmlAttributeBool("saveData",this.saveData);if(false!==this.refreshOnLoad)writer.WriteXmlAttributeBool("refreshOnLoad",this.refreshOnLoad);if(false!==this.optimizeMemory)writer.WriteXmlAttributeBool("optimizeMemory",this.optimizeMemory);if(true!==this.enableRefresh)writer.WriteXmlAttributeBool("enableRefresh",this.enableRefresh);if(null!==this.refreshedBy)writer.WriteXmlAttributeStringEncode("refreshedBy", this.refreshedBy);if(null!==this.refreshedDate)writer.WriteXmlAttributeNumber("refreshedDate",this.refreshedDate);if(false!==this.backgroundQuery)writer.WriteXmlAttributeBool("backgroundQuery",this.backgroundQuery);if(null!==this.missingItemsLimit)writer.WriteXmlAttributeNumber("missingItemsLimit",this.missingItemsLimit);if(0!==this.createdVersion)writer.WriteXmlAttributeNumber("createdVersion",this.createdVersion);if(0!==this.refreshedVersion)writer.WriteXmlAttributeNumber("refreshedVersion",this.refreshedVersion); if(0!==this.minRefreshableVersion)writer.WriteXmlAttributeNumber("minRefreshableVersion",this.minRefreshableVersion);if(null!==this.cacheRecords)writer.WriteXmlAttributeNumber("recordCount",this.cacheRecords.getRowsCount());if(false!==this.upgradeOnRefresh)writer.WriteXmlAttributeBool("upgradeOnRefresh",this.upgradeOnRefresh);if(false!==this.hasTupleCache)writer.WriteXmlAttributeBool("tupleCache",this.hasTupleCache);if(false!==this.supportSubquery)writer.WriteXmlAttributeBool("supportSubquery",this.supportSubquery); if(false!==this.supportAdvancedDrill)writer.WriteXmlAttributeBool("supportAdvancedDrill",this.supportAdvancedDrill);writer.WriteXmlNodeEnd("pivotCacheDefinition",true);if(null!==this.cacheSource)this.cacheSource.toXml(writer,"cacheSource");if(null!==this.cacheFields)this.cacheFields.toXml(writer,"cacheFields",stylesForWrite);if(null!==this.cacheHierarchies)this.cacheHierarchies.toXml(writer,"cacheHierarchies");if(null!==this.kpis)this.kpis.toXml(writer,"kpis");if(null!==this.tupleCache)this.tupleCache.toXml(writer, "tupleCache");if(null!==this.calculatedItems)this.calculatedItems.toXml(writer,"calculatedItems");if(null!==this.calculatedMembers)this.calculatedMembers.toXml(writer,"calculatedMembers");if(null!==this.dimensions)this.dimensions.toXml(writer,"dimensions");if(null!==this.measureGroups)this.measureGroups.toXml(writer,"measureGroups");if(null!==this.maps)this.maps.toXml(writer,"maps");if(null!==this.pivotCacheDefinitionX14){var ext=new CT_Extension;ext.uri="{725AE2AE-9491-48be-B2B4-4EB974FC3084}";ext.elem= this.pivotCacheDefinitionX14;var extList=new CT_ExtensionList;extList.ext.push(ext);extList.toXml(writer,"extLst")}writer.WriteXmlNodeEnd("pivotCacheDefinition")};CT_PivotCacheDefinition.prototype.getFields=function(){return this.cacheFields&&this.cacheFields.cacheField};CT_PivotCacheDefinition.prototype.getFieldIndexByName=function(name){var cacheFields=this.getFields();if(cacheFields)return cacheFields.findIndex(function(elem){return elem.name===name});return-1};CT_PivotCacheDefinition.prototype.getRecords= function(){return this.cacheRecords};CT_PivotCacheDefinition.prototype.isValidCacheSource=function(){return this.cacheSource&&this.cacheSource.type===c_oAscSourceType.Worksheet};CT_PivotCacheDefinition.prototype.getWorksheetSource=function(){return this.cacheSource&&this.cacheSource.worksheetSource};CT_PivotCacheDefinition.prototype.getDataRef=function(){return this.getWorksheetSource()&&this.getWorksheetSource().getDataRef()||""};CT_PivotCacheDefinition.prototype.fromDataRef=function(dataRef){this.cacheSource= new CT_CacheSource;this.cacheSource.type=c_oAscSourceType.Worksheet;this.cacheSource.worksheetSource=new CT_WorksheetSource;this.cacheSource.worksheetSource.fromDataRef(dataRef);this.cacheRecords=new CT_PivotCacheRecords;var location=this.cacheSource.worksheetSource.getDataLocation();if(location){this.cacheFields=new CT_CacheFields;this.cacheRecords.fromWorksheetRange(location,this.cacheFields)}};CT_PivotCacheDefinition.prototype.asc_create=function(){this.createdVersion=4;this.refreshedVersion=4; this.minRefreshableVersion=3};CT_PivotCacheDefinition.prototype.getPivotCacheId=function(){return this.pivotCacheDefinitionX14&&this.pivotCacheDefinitionX14.pivotCacheId||null};CT_PivotCacheDefinition.prototype.setPivotCacheId=function(val){if(null===val)return;if(!this.pivotCacheDefinitionX14)this.pivotCacheDefinitionX14=new CT_PivotCacheDefinitionX14;this.pivotCacheDefinitionX14.pivotCacheId=val};CT_PivotCacheDefinition.prototype.createNewPivotCacheId=function(){this.setPivotCacheId(AscCommon.CreateUInt32())}; function CT_PivotCacheDefinitionX14(){this.slicerData=false;this.pivotCacheId=null;this.supportSubqueryNonVisual=false;this.supportSubqueryCalcMem=false;this.supportAddCalcMems=false}CT_PivotCacheDefinitionX14.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["slicerData"];if(undefined!==val)this.slicerData=AscCommon.getBoolFromXml(val);val=vals["pivotCacheId"];if(undefined!==val)this.pivotCacheId=AscCommon.getNumFromXml(val);val=vals["supportSubqueryNonVisual"]; if(undefined!==val)this.supportSubqueryNonVisual=AscCommon.getBoolFromXml(val);val=vals["supportSubqueryCalcMem"];if(undefined!==val)this.supportSubqueryCalcMem=AscCommon.getBoolFromXml(val);val=vals["supportAddCalcMems"];if(undefined!==val)this.supportAddCalcMems=AscCommon.getBoolFromXml(val)}};CT_PivotCacheDefinitionX14.prototype.toXml=function(writer){writer.WriteXmlNodeStart("x14:pivotCacheDefinition");if(false!==this.slicerData)writer.WriteXmlAttributeBool("slicerData",this.slicerData);if(null!== this.pivotCacheId)writer.WriteXmlAttributeNumber("pivotCacheId",this.pivotCacheId);if(false!==this.supportSubqueryNonVisual)writer.WriteXmlAttributeBool("supportSubqueryNonVisual",this.supportSubqueryNonVisual);if(false!==this.supportSubqueryCalcMem)writer.WriteXmlAttributeBool("supportSubqueryCalcMem",this.supportSubqueryCalcMem);if(false!==this.supportAddCalcMems)writer.WriteXmlAttributeBool("supportAddCalcMems",this.supportAddCalcMems);writer.WriteXmlNodeEnd("pivotCacheDefinition",true,true)}; function CT_PivotCacheRecords(){this.extLst=null;this.startCount=0;this._cols=[];this._curColIndex=0}CT_PivotCacheRecords.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["count"];if(undefined!==val)this.startCount=val-0}};CT_PivotCacheRecords.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotCacheRecords"===elem){if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("r"===elem)this._curColIndex=0;else{var newContextCandidate= this._getCol(this._curColIndex).onStartNode(elem,attr,uq);if(newContextCandidate)newContext=newContextCandidate;else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null}return newContext};CT_PivotCacheRecords.prototype.onEndNode=function(prevContext,elem){if("r"===elem)return;if(this._getCol(this._curColIndex).onEndNode(prevContext,elem))this._curColIndex++};CT_PivotCacheRecords.prototype.toXml= function(writer){writer.WriteXmlString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');writer.WriteXmlNodeStart("pivotCacheRecords");writer.WriteXmlString(' xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"');var count=this.getRowsCount();if(count>0)writer.WriteXmlAttributeNumber("count",count);writer.WriteXmlNodeEnd("pivotCacheRecords",true);for(var i=0;i<count;++i){writer.WriteXmlNodeStart("r", true);for(var j=0;j<this.getColsCount();++j)this._cols[j].toXml(writer,i);writer.WriteXmlNodeEnd("r")}if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd("pivotCacheRecords")};CT_PivotCacheRecords.prototype.getColsCount=function(){return this._cols&&this._cols.length||0};CT_PivotCacheRecords.prototype.getRowsCount=function(){return this._cols&&this._cols[0]&&this._cols[0].getSize()||0};CT_PivotCacheRecords.prototype.get=function(row,col){var col=this._cols[col];if(col)return col.get(row)}; CT_PivotCacheRecords.prototype._getCol=function(index){var col=this._cols[index];if(!col){col=new PivotRecords;col.setStartCount(this.startCount);this._cols[index]=col}return col};CT_PivotCacheRecords.prototype._getDataMapFromFields=function(indexes,length,row,dataMap){var i,val;for(i=0;i<length;++i)if(indexes[i]<this.getColsCount()){val=this._cols[indexes[i]].get(row);dataMap=this._getDataMapAddElem(dataMap,val.val,dataMap.total.length)}return dataMap};CT_PivotCacheRecords.prototype._getDataMapAddElem= function(dataMap,val,dataLen){var elem=dataMap.vals[val];if(!elem){elem=new PivotDataElem(dataLen);dataMap.vals[val]=elem}return elem};CT_PivotCacheRecords.prototype._getDataMapMergeSubtotal=function(rowMapFrom,rowMapTo,skipUnion){for(var i in rowMapFrom.subtotal)if(rowMapFrom.subtotal.hasOwnProperty(i)){var subTo=rowMapTo.subtotal[i];if(!subTo){subTo=new PivotDataElem(rowMapTo.total.length);rowMapTo.subtotal[i]=subTo}var subFrom=rowMapFrom.subtotal[i];if(!skipUnion)subTo.unionTotal(subFrom);this._getDataMapMergeSubtotal(subFrom, subTo,skipUnion)}};CT_PivotCacheRecords.prototype._getDataMapTrimBySubtotal=function(rowMapFrom,rowMapTo){for(var i in rowMapFrom.subtotal)if(rowMapFrom.subtotal.hasOwnProperty(i))if(rowMapTo.subtotal.hasOwnProperty(i))this._getDataMapTrimBySubtotal(rowMapFrom.subtotal[i],rowMapTo.subtotal[i]);else delete rowMapFrom.subtotal[i]};CT_PivotCacheRecords.prototype._getDataMapSubtotal=function(rowMap,rowIndex,rowIndexes){var i;if(rowIndex+1<rowIndexes.length)for(i in rowMap.vals)if(rowMap.vals.hasOwnProperty(i))this._getDataMapSubtotal(rowMap.vals[i], rowIndex+1,rowIndexes);if(rowIndex<rowIndexes.length){rowMap.subtotal={};for(i in rowMap.vals)if(rowMap.vals.hasOwnProperty(i))this._getDataMapMergeSubtotal(rowMap.vals[i],rowMap)}};CT_PivotCacheRecords.prototype._getDataMapTotal=function(rowMap,index,length){var i;if(index!==length)rowMap.resetTotal(rowMap.getTotalCount());for(i in rowMap.vals)if(rowMap.vals.hasOwnProperty(i)){this._getDataMapTotal(rowMap.vals[i],index+1,length);rowMap.unionTotal(rowMap.vals[i])}};CT_PivotCacheRecords.prototype._getDataMapRowToTotal= function(cacheFields,row,rowMapCur,dataFields){var i,val,total;for(i=0;i<rowMapCur.total.length;++i){total=rowMapCur.total[i];var dataIndex=dataFields[i].fld;if(dataIndex<this.getColsCount()){val=this._cols[dataIndex].get(row);if(c_oAscPivotRecType.Index===val.type&&cacheFields){var cacheField=cacheFields[dataIndex];val=cacheField&&cacheField.sharedItems&&cacheField.sharedItems.Items&&cacheField.sharedItems.Items.get(val.val)||val}if(c_oAscPivotRecType.Number===val.type||c_oAscPivotRecType.DateTime=== val.type)total.add(val.val);else if(c_oAscPivotRecType.Error===val.type)total.addError(val.val);else if(c_oAscPivotRecType.Missing!==val.type)total.addCount(val.val)}}};CT_PivotCacheRecords.prototype.getDataMap=function(cacheFields,filterMaps,cacheFieldsWithData,rowIndexes,colIndexes,dataFields){var row,rowMapCur;var res=new PivotDataElem(dataFields.length);for(row=0;row<this.getRowsCount();++row){if(this.getDataMapLabelFilters(row,filterMaps,cacheFieldsWithData))continue;this.fillVisibleFields(row, cacheFieldsWithData);rowMapCur=res;if(rowIndexes.length>0)rowMapCur=this._getDataMapFromFields(rowIndexes,rowIndexes.length,row,rowMapCur);if(colIndexes.length>0)rowMapCur=this._getDataMapFromFields(colIndexes,colIndexes.length,row,rowMapCur);this._getDataMapRowToTotal(cacheFields,row,rowMapCur,dataFields)}this._getDataMapTotal(res,0,rowIndexes.length+colIndexes.length);this._getDataMapSubtotal(res,0,rowIndexes);this._getDataMapApplyValueFilters(res,rowIndexes,colIndexes,filterMaps,dataFields);return res}; CT_PivotCacheRecords.prototype._getDataMapApplyValueFilters=function(rowMap,rowIndexes,colIndexes,filterMaps,dataFields){var tmp;var firstSubtotal=new PivotDataElem(dataFields.length);firstSubtotal.subtotal=rowMap.subtotal;while(filterMaps.valueFilters.length>0){var valueFilter=filterMaps.valueFilters.shift();var isHide=false;if(c_oAscAxis.AxisRow===valueFilter.pivotField.axis)isHide=this._getDataMapConvertValueFiltersIsHide(rowMap,true,0,rowIndexes,valueFilter,dataFields);else if(c_oAscAxis.AxisCol=== valueFilter.pivotField.axis){isHide=this._getDataMapConvertValueFiltersIsHide(rowMap,false,0,colIndexes,valueFilter,dataFields);if(isHide){tmp=new PivotDataElem(dataFields.length);tmp.subtotal=rowMap.subtotal;this._getDataMapConvertFilterBySubtotal(rowMap,0,rowIndexes,tmp);this._getDataMapTrimBySubtotal(firstSubtotal,tmp)}}if(isHide){this._getDataMapTotal(rowMap,0,rowIndexes.length+colIndexes.length);this._getDataMapSubtotal(rowMap,0,rowIndexes)}}if(firstSubtotal.subtotal!==rowMap.subtotal)this._getDataMapMergeSubtotal(firstSubtotal, rowMap,true)};CT_PivotCacheRecords.prototype._getDataMapConvertValueFiltersIsHide=function(rowMap,isRow,index,indexes,valueFilter,dataFields){var res=false;var i;if(index<indexes.length){var elems=isRow?rowMap.vals:rowMap.subtotal;if(valueFilter.index===indexes[index]){var pivotFilter=this._getDataMapInitFilter(elems,valueFilter,dataFields);for(i in elems)if(elems.hasOwnProperty(i)){var isHide=this.getDataMapValueFilters(pivotFilter,elems[i],dataFields);if(isHide)delete elems[i];res=res||isHide}}else for(i in elems)if(elems.hasOwnProperty(i)){res= this._getDataMapConvertValueFiltersIsHide(elems[i],isRow,index+1,indexes,valueFilter,dataFields)||res;var subElems=isRow?elems[i].vals:elems[i].subtotal;if(AscCommon.isEmptyObject(subElems))delete elems[i]}}return res};CT_PivotCacheRecords.prototype._getDataMapConvertFilterBySubtotal=function(rowMap,rowIndex,rowIndexes,subtotal){var i;if(rowIndex<rowIndexes.length)for(i in rowMap.vals){if(rowMap.vals.hasOwnProperty(i))this._getDataMapConvertFilterBySubtotal(rowMap.vals[i],rowIndex+1,rowIndexes,subtotal)}else this._getDataMapTrimBySubtotal(rowMap, subtotal)};CT_PivotCacheRecords.prototype.getDataMapLabelFilters=function(row,filterMaps,cacheFieldsWithData){for(var i=0;i<filterMaps.labelFilters.length;++i){var filter=filterMaps.labelFilters[i];var val=this._cols[filter.index].get(row);if(c_oAscPivotRecType.Index===val.type&&!filter.map.has(val.val)){if(cacheFieldsWithData[filter.index]){for(var j=i+1;j<filterMaps.labelFilters.length;++j){var subFilter=filterMaps.labelFilters[j];var subVal=this._cols[subFilter.index].get(row);if(c_oAscPivotRecType.Index=== subVal.type&&!subFilter.map.has(subVal.val))return true}cacheFieldsWithData[filter.index][val.val]=1}return true}}return false};CT_PivotCacheRecords.prototype.fillVisibleFields=function(row,cacheFieldsWithData){for(var index in cacheFieldsWithData)if(cacheFieldsWithData.hasOwnProperty(index)){var visible=cacheFieldsWithData[index];var val=this._cols[index].get(row);if(c_oAscPivotRecType.Index===val.type&&val.val<visible.length)visible[val.val]=1}};CT_PivotCacheRecords.prototype._getDataMapInitFilter= function(elems,valueFilter,dataFields){var pivotFilter=valueFilter.pivotFilter;var filterColumn=pivotFilter&&pivotFilter.getFilterColumn();if(filterColumn&&filterColumn.hasInitByArray()){var dataIndex=pivotFilter.iMeasureFld;var dataType=dataFields[dataIndex].subtotal;var arr=[];for(var i in elems)if(elems.hasOwnProperty(i)){var cellValue=elems[i].total[dataIndex].getCellValue(dataType,Asc.c_oAscItemType.Default,Asc.c_oAscItemType.Default,Asc.c_oAscItemType.Default);if(!cellValue)arr.push(0);else if(AscCommon.CellValueType.Number=== cellValue.type)arr.push(cellValue.number)}filterColumn.initByArray(arr,Asc.c_oAscPivotFilterType.Sum===pivotFilter.type)}return pivotFilter};CT_PivotCacheRecords.prototype.getDataMapValueFilters=function(pivotFilter,dataElem,dataFields){if(pivotFilter){var dataIndex=pivotFilter.iMeasureFld;var dataType=dataFields[dataIndex].subtotal;var filterColumn=pivotFilter.getFilterColumn();var cellValue=dataElem.total[dataIndex].getCellValue(dataType,Asc.c_oAscItemType.Default,Asc.c_oAscItemType.Default,Asc.c_oAscItemType.Default); if(!cellValue)return filterColumn.isHideValue("0");else if(AscCommon.CellValueType.Number===cellValue.type)return filterColumn.isHideValue(cellValue.number.toString())}return false};CT_PivotCacheRecords.prototype.convertToSharedItems=function(index,si){var col=this._cols[index];if(col)col.convertToSharedItems(si)};CT_PivotCacheRecords.prototype.fromWorksheetRange=function(location,cacheFields){var i;var ws=location.ws;if(!ws)return;var bbox=location.bbox;var headings=location.headings;if(!headings){headings= [];ws.getRange3(bbox.r1,bbox.c1,bbox.r1,bbox.c2)._foreachNoEmpty(function(cell){if(!cell.isNullTextString())headings.push(cell.getValue())})}if(bbox.getWidth()!==headings.length)return;var nameDuplicateMap=new Map;for(i=0;i<headings.length;++i){var text=headings[i];var index=1;while(nameDuplicateMap.has(text)){index++;text=headings[i]+index}nameDuplicateMap.set(text,1);var cacheField=new CT_CacheField;cacheField.name=text;cacheField.sharedItems=new CT_SharedItems;cacheFields.cacheField.push(cacheField)}this._cols= [];var lastRowMax=0,firstRow=location.headings?bbox.r1:bbox.r1+1;for(i=0;i<cacheFields.cacheField.length;++i){var cacheField=cacheFields.cacheField[i];var cacheFieldNum=undefined;var si=cacheField.sharedItems;si.containsSemiMixedTypes=false;si.containsNonDate=false;si.containsString=false;si.containsInteger=true;si.maxValue=si.maxDate=Number.NEGATIVE_INFINITY;si.minValue=si.minDate=Number.POSITIVE_INFINITY;var records=new PivotRecords;var lastRow,lastRowWithText;lastRow=lastRowWithText=firstRow-1; ws.getRange3(lastRow+1,bbox.c1+i,bbox.r2,bbox.c1+i)._foreachNoEmptyByCol(function(cell){if(undefined===cacheFieldNum)cacheFieldNum=cell.xfs&&cell.xfs.num||null;if(!(cacheFieldNum&&cell.xfs&&cell.xfs.num&&cacheFieldNum.isEqual(cell.xfs.num)&&lastRow+1===cell.nRow))cacheFieldNum=null;if(!cell.isNullTextString()){if(lastRowWithText+1<cell.nRow){records.addMissing(cell.nRow-lastRowWithText-1);si.containsBlank=true}lastRowWithText=cell.nRow;switch(cell.getType()){case AscCommon.CellValueType.Number:var num= cell.getNumberValue();if(!cell.getNumFormat().isDateTimeFormat()){records.addNumber(num);si.containsNumber=true;si.containsNonDate=true;si.minValue=Math.min(si.minValue,num);si.maxValue=Math.max(si.maxValue,num);if(si.containsInteger&&!Number.isInteger(num))si.containsInteger=false}else{records.addDate(num);si.containsDate=true;si.minDate=Math.min(si.minDate,num);si.maxDate=Math.max(si.maxDate,num)}break;case AscCommon.CellValueType.String:var text=cell.getValueWithoutFormat();records.addString(text); if(text.length>255)si.longText=true;si.containsString=true;si.containsNonDate=true;break;case AscCommon.CellValueType.Bool:records.addBool(cell.getBoolValue());si.containsString=true;si.containsNonDate=true;break;case AscCommon.CellValueType.Error:records.addError(cell.getErrorValue());si.containsString=true;si.containsNonDate=true;break}}lastRow=cell.nRow});lastRowMax=Math.max(lastRowMax,lastRow);if(lastRowWithText<bbox.r2)si.containsBlank=true;if(lastRow<bbox.r2)cacheFieldNum=null;this._cols.push(records); if(si.containsString||si.containsBlank)si.containsSemiMixedTypes=true;if(si.containsDate+si.containsNumber+si.containsString>1)si.containsMixedTypes=true;if(si.containsDate&&si.containsNumber)si.containsNumber=false;if(!si.containsDate){si.minDate=null;si.maxDate=null}if(!si.containsNumber){si.containsInteger=false;si.minValue=null;si.maxValue=null}if(cacheFieldNum)cacheField.num=cacheFieldNum}var expectedSize=lastRowMax-firstRow+1;if(lastRowMax<bbox.r2)expectedSize+=1;for(i=0;i<this._cols.length;++i)if(this._cols[i].size< expectedSize)this._cols[i].addMissing(expectedSize-this._cols[i].size)};CT_PivotCacheRecords.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.PivotCacheRecords};CT_PivotCacheRecords.prototype.Write_ToBinary2=function(w){var t=this;AscCommonExcel.executeInR1C1Mode(false,function(){toXmlWithLength(w,t)})};CT_PivotCacheRecords.prototype.Read_FromBinary2=function(r){var t=this;var len=r.GetLong();AscCommonExcel.executeInR1C1Mode(false,function(){(new AscCommon.openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(r, len),t)})};CT_PivotCacheRecords.prototype.updateCacheData=function(){this.cacheRecords.updateCacheData()};function PivotTableChanged(){this.oldRanges=null;this.style=false;this.data=false}function CT_pivotTableDefinition(setDefaults){this.name=null;this.cacheId=null;this.dataOnRows=null;this.dataPosition=null;this.autoFormatId=null;this.applyNumberFormats=null;this.applyBorderFormats=null;this.applyFontFormats=null;this.applyPatternFormats=null;this.applyAlignmentFormats=null;this.applyWidthHeightFormats= null;this.dataCaption=null;this.grandTotalCaption=null;this.errorCaption=null;this.showError=null;this.missingCaption=null;this.showMissing=null;this.pageStyle=null;this.pivotTableStyle=null;this.vacatedStyle=null;this.tag=null;this.updatedVersion=null;this.minRefreshableVersion=null;this.asteriskTotals=null;this.showItems=null;this.editData=null;this.disableFieldList=null;this.showCalcMbrs=null;this.visualTotals=null;this.showMultipleLabel=null;this.showDataDropDown=null;this.showDrill=null;this.printDrill= null;this.showMemberPropertyTips=null;this.showDataTips=null;this.enableWizard=null;this.enableDrill=null;this.enableFieldProperties=null;this.preserveFormatting=null;this.useAutoFormatting=null;this.pageWrap=null;this.pageOverThenDown=null;this.subtotalHiddenItems=null;this.rowGrandTotals=null;this.colGrandTotals=null;this.fieldPrintTitles=null;this.itemPrintTitles=null;this.mergeItem=null;this.showDropZones=null;this.createdVersion=null;this.indent=null;this.showEmptyRow=null;this.showEmptyCol= null;this.showHeaders=null;this.compact=null;this.outline=null;this.outlineData=null;this.compactData=null;this.published=null;this.gridDropZones=null;this.immersive=null;this.multipleFieldFilters=null;this.chartFormat=null;this.rowHeaderCaption=null;this.colHeaderCaption=null;this.fieldListSortAscending=null;this.mdxSubqueries=null;this.customListSort=null;this.location=null;this.pivotFields=null;this.rowFields=null;this.rowItems=null;this.colFields=null;this.colItems=null;this.pageFields=null;this.dataFields= null;this.formats=null;this.conditionalFormats=null;this.chartFormats=null;this.pivotHierarchies=null;this.pivotTableStyleInfo=new CT_PivotTableStyle;this.pivotTableStyleInfo.showRowHeaders=true;this.pivotTableStyleInfo.showColHeaders=true;this.filters=null;this.rowHierarchiesUsage=null;this.colHierarchiesUsage=null;this.pivotTableDefinitionX14=null;this.cacheDefinition=null;this.isInit=false;this.changed=new PivotTableChanged;this.pageFieldsPositions=null;this.clearGrid=false;this.hasCompactField= true;this.ascInsertBlankRow=null;this.ascDefaultSubtotal=null;this.ascSubtotalTop=null;this.ascFillDownLabels=null;this.ascDataRef=null;this.ascAltText=null;this.ascAltTextSummary=null;if(setDefaults)this.setDefaults();this.worksheet=null;this.Id=AscCommon.g_oIdCounter.Get_NewId()}CT_pivotTableDefinition.prototype.setDefaults=function(){this.dataOnRows=false;this.showError=false;this.showMissing=true;this.updatedVersion=0;this.minRefreshableVersion=0;this.asteriskTotals=false;this.showItems=true; this.editData=false;this.disableFieldList=false;this.showCalcMbrs=true;this.visualTotals=true;this.showMultipleLabel=true;this.showDataDropDown=true;this.showDrill=true;this.printDrill=false;this.showMemberPropertyTips=true;this.showDataTips=true;this.enableWizard=true;this.enableDrill=true;this.enableFieldProperties=true;this.preserveFormatting=true;this.useAutoFormatting=false;this.pageWrap=0;this.pageOverThenDown=false;this.subtotalHiddenItems=false;this.rowGrandTotals=true;this.colGrandTotals= true;this.fieldPrintTitles=false;this.itemPrintTitles=false;this.mergeItem=false;this.showDropZones=true;this.createdVersion=0;this.indent=1;this.showEmptyRow=false;this.showEmptyCol=false;this.showHeaders=true;this.compact=true;this.outline=false;this.outlineData=false;this.compactData=true;this.published=false;this.gridDropZones=false;this.immersive=true;this.multipleFieldFilters=true;this.chartFormat=0;this.fieldListSortAscending=false;this.mdxSubqueries=false;this.customListSort=true};CT_pivotTableDefinition.prototype.initPostOpenZip= function(oNumFmts){if(this.cacheDefinition)this.cacheDefinition.initPostOpenZip(oNumFmts);var pivotFields=this.asc_getPivotFields();if(pivotFields)pivotFields.forEach(function(pivotField){pivotField.initPostOpenZip(oNumFmts)});var dataFields=this.asc_getDataFields();if(dataFields)dataFields.forEach(function(dataField){dataField.initPostOpenZip(oNumFmts)})};CT_pivotTableDefinition.prototype.getObjectType=function(){return AscDFH.historyitem_type_PivotTableDefinition};CT_pivotTableDefinition.prototype.Get_Id= function(){return this.Id};CT_pivotTableDefinition.prototype.GetWS=function(){return this.worksheet};CT_pivotTableDefinition.prototype.setWS=function(ws){this.worksheet=ws};CT_pivotTableDefinition.prototype.clone=function(){var data=new AscCommonExcel.UndoRedoData_BinaryWrapper(this);var pivot=data.getData();pivot.createNewIds();pivot.init();return pivot};CT_pivotTableDefinition.prototype.cloneShallow=function(){var oldCacheDefinition=this.cacheDefinition;this.cacheDefinition=null;var newPivot=this.clone(); this.cacheDefinition=newPivot.cacheDefinition=oldCacheDefinition;return newPivot};CT_pivotTableDefinition.prototype.prepareToPaste=function(ws,offset,changeName){this.setWS(ws);if(changeName)this.name=this.GetWS().workbook.dependencyFormulas.getNextPivotName();this.setOffset(offset,false)};CT_pivotTableDefinition.prototype.stashCurReportRange=function(){var t=this;if(!this.changed.oldRanges){this.changed.oldRanges=this.getReportRanges();this.changed.oldRanges.forEach(function(range){t.GetWS().getRange3(range.r1, range.c1,range.r2,range.c2).clearTableStyle()});this.setChanged(false,true)}};CT_pivotTableDefinition.prototype.stashEmptyReportRange=function(){if(!this.changed.oldRanges)this.changed.oldRanges=[]};CT_pivotTableDefinition.prototype.setChanged=function(data,style){this.changed.data=data||this.changed.data;this.changed.style=style||this.changed.style};CT_pivotTableDefinition.prototype.getAndCleanChanged=function(){var res=this.changed;this.changed=new PivotTableChanged;return res};CT_pivotTableDefinition.prototype.Write_ToBinary2= function(w){var t=this;w.WriteLong(this.getObjectType());w.WriteString2(this.worksheet?this.worksheet.getId():"-1");AscCommonExcel.executeInR1C1Mode(false,function(){toXmlWithLength(w,t)});if(this.cacheDefinition){w.WriteBool(true);this.cacheDefinition.Write_ToBinary2(w)}else w.WriteBool(false)};CT_pivotTableDefinition.prototype.Read_FromBinary2=function(r){var t=this;this.setDefaults();var api_sheet=Asc["editor"];this.worksheet=api_sheet.wbModel.getWorksheetById(r.GetString2());var len=r.GetLong(); AscCommonExcel.executeInR1C1Mode(false,function(){(new AscCommon.openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(r,len),t)});if(r.GetBool()){this.cacheDefinition=new CT_PivotCacheDefinition;this.cacheDefinition.Read_FromBinary2(r)}};CT_pivotTableDefinition.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["cacheId"];if(undefined!==val)this.cacheId=val-0;val=vals["dataOnRows"];if(undefined!== val)this.dataOnRows=AscCommon.getBoolFromXml(val);val=vals["dataPosition"];if(undefined!==val)this.dataPosition=val-0;val=vals["autoFormatId"];if(undefined!==val)this.autoFormatId=val-0;val=vals["applyNumberFormats"];if(undefined!==val)this.applyNumberFormats=AscCommon.getBoolFromXml(val);val=vals["applyBorderFormats"];if(undefined!==val)this.applyBorderFormats=AscCommon.getBoolFromXml(val);val=vals["applyFontFormats"];if(undefined!==val)this.applyFontFormats=AscCommon.getBoolFromXml(val);val=vals["applyPatternFormats"]; if(undefined!==val)this.applyPatternFormats=AscCommon.getBoolFromXml(val);val=vals["applyAlignmentFormats"];if(undefined!==val)this.applyAlignmentFormats=AscCommon.getBoolFromXml(val);val=vals["applyWidthHeightFormats"];if(undefined!==val)this.applyWidthHeightFormats=AscCommon.getBoolFromXml(val);val=vals["dataCaption"];if(undefined!==val)this.dataCaption=AscCommon.unleakString(uq(val));val=vals["grandTotalCaption"];if(undefined!==val)this.grandTotalCaption=AscCommon.unleakString(uq(val));val=vals["errorCaption"]; if(undefined!==val)this.errorCaption=AscCommon.unleakString(uq(val));val=vals["showError"];if(undefined!==val)this.showError=AscCommon.getBoolFromXml(val);val=vals["missingCaption"];if(undefined!==val)this.missingCaption=AscCommon.unleakString(uq(val));val=vals["showMissing"];if(undefined!==val)this.showMissing=AscCommon.getBoolFromXml(val);val=vals["pageStyle"];if(undefined!==val)this.pageStyle=AscCommon.unleakString(uq(val));val=vals["pivotTableStyle"];if(undefined!==val)this.pivotTableStyle=AscCommon.unleakString(uq(val)); val=vals["vacatedStyle"];if(undefined!==val)this.vacatedStyle=AscCommon.unleakString(uq(val));val=vals["tag"];if(undefined!==val)this.tag=AscCommon.unleakString(uq(val));val=vals["updatedVersion"];if(undefined!==val)this.updatedVersion=val-0;val=vals["minRefreshableVersion"];if(undefined!==val)this.minRefreshableVersion=val-0;val=vals["asteriskTotals"];if(undefined!==val)this.asteriskTotals=AscCommon.getBoolFromXml(val);val=vals["showItems"];if(undefined!==val)this.showItems=AscCommon.getBoolFromXml(val); val=vals["editData"];if(undefined!==val)this.editData=AscCommon.getBoolFromXml(val);val=vals["disableFieldList"];if(undefined!==val)this.disableFieldList=AscCommon.getBoolFromXml(val);val=vals["showCalcMbrs"];if(undefined!==val)this.showCalcMbrs=AscCommon.getBoolFromXml(val);val=vals["visualTotals"];if(undefined!==val)this.visualTotals=AscCommon.getBoolFromXml(val);val=vals["showMultipleLabel"];if(undefined!==val)this.showMultipleLabel=AscCommon.getBoolFromXml(val);val=vals["showDataDropDown"];if(undefined!== val)this.showDataDropDown=AscCommon.getBoolFromXml(val);val=vals["showDrill"];if(undefined!==val)this.showDrill=AscCommon.getBoolFromXml(val);val=vals["printDrill"];if(undefined!==val)this.printDrill=AscCommon.getBoolFromXml(val);val=vals["showMemberPropertyTips"];if(undefined!==val)this.showMemberPropertyTips=AscCommon.getBoolFromXml(val);val=vals["showDataTips"];if(undefined!==val)this.showDataTips=AscCommon.getBoolFromXml(val);val=vals["enableWizard"];if(undefined!==val)this.enableWizard=AscCommon.getBoolFromXml(val); val=vals["enableDrill"];if(undefined!==val)this.enableDrill=AscCommon.getBoolFromXml(val);val=vals["enableFieldProperties"];if(undefined!==val)this.enableFieldProperties=AscCommon.getBoolFromXml(val);val=vals["preserveFormatting"];if(undefined!==val)this.preserveFormatting=AscCommon.getBoolFromXml(val);val=vals["useAutoFormatting"];if(undefined!==val)this.useAutoFormatting=AscCommon.getBoolFromXml(val);val=vals["pageWrap"];if(undefined!==val)this.pageWrap=val-0;val=vals["pageOverThenDown"];if(undefined!== val)this.pageOverThenDown=AscCommon.getBoolFromXml(val);val=vals["subtotalHiddenItems"];if(undefined!==val)this.subtotalHiddenItems=AscCommon.getBoolFromXml(val);val=vals["rowGrandTotals"];if(undefined!==val)this.rowGrandTotals=AscCommon.getBoolFromXml(val);val=vals["colGrandTotals"];if(undefined!==val)this.colGrandTotals=AscCommon.getBoolFromXml(val);val=vals["fieldPrintTitles"];if(undefined!==val)this.fieldPrintTitles=AscCommon.getBoolFromXml(val);val=vals["itemPrintTitles"];if(undefined!==val)this.itemPrintTitles= AscCommon.getBoolFromXml(val);val=vals["mergeItem"];if(undefined!==val)this.mergeItem=AscCommon.getBoolFromXml(val);val=vals["showDropZones"];if(undefined!==val)this.showDropZones=AscCommon.getBoolFromXml(val);val=vals["createdVersion"];if(undefined!==val)this.createdVersion=val-0;val=vals["indent"];if(undefined!==val)this.indent=val-0;val=vals["showEmptyRow"];if(undefined!==val)this.showEmptyRow=AscCommon.getBoolFromXml(val);val=vals["showEmptyCol"];if(undefined!==val)this.showEmptyCol=AscCommon.getBoolFromXml(val); val=vals["showHeaders"];if(undefined!==val)this.showHeaders=AscCommon.getBoolFromXml(val);val=vals["compact"];if(undefined!==val)this.compact=AscCommon.getBoolFromXml(val);val=vals["outline"];if(undefined!==val)this.outline=AscCommon.getBoolFromXml(val);val=vals["outlineData"];if(undefined!==val)this.outlineData=AscCommon.getBoolFromXml(val);val=vals["compactData"];if(undefined!==val)this.compactData=AscCommon.getBoolFromXml(val);val=vals["published"];if(undefined!==val)this.published=AscCommon.getBoolFromXml(val); val=vals["gridDropZones"];if(undefined!==val)this.gridDropZones=AscCommon.getBoolFromXml(val);val=vals["immersive"];if(undefined!==val)this.immersive=AscCommon.getBoolFromXml(val);val=vals["multipleFieldFilters"];if(undefined!==val)this.multipleFieldFilters=AscCommon.getBoolFromXml(val);val=vals["chartFormat"];if(undefined!==val)this.chartFormat=val-0;val=vals["rowHeaderCaption"];if(undefined!==val)this.rowHeaderCaption=AscCommon.unleakString(uq(val));val=vals["colHeaderCaption"];if(undefined!==val)this.colHeaderCaption= AscCommon.unleakString(uq(val));val=vals["fieldListSortAscending"];if(undefined!==val)this.fieldListSortAscending=AscCommon.getBoolFromXml(val);val=vals["mdxSubqueries"];if(undefined!==val)this.mdxSubqueries=AscCommon.getBoolFromXml(val);val=vals["customListSort"];if(undefined!==val)this.customListSort=AscCommon.getBoolFromXml(val)}};CT_pivotTableDefinition.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotTableDefinition"===elem){if(newContext.readAttributes)newContext.readAttributes(attr, uq)}else if("location"===elem){newContext=new CT_Location;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.location=newContext}else if("pivotFields"===elem){newContext=new CT_PivotFields;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotFields=newContext}else if("rowFields"===elem){newContext=new CT_RowFields;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.rowFields=newContext}else if("rowItems"===elem){newContext=new CT_rowItems;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.rowItems=newContext}else if("colFields"===elem){newContext=new CT_ColFields;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.colFields=newContext}else if("colItems"===elem){newContext=new CT_colItems;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.colItems=newContext}else if("pageFields"===elem){newContext=new CT_PageFields;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pageFields=newContext}else if("dataFields"===elem){newContext= new CT_DataFields;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.dataFields=newContext}else if("formats"===elem){newContext=new CT_Formats;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.formats=newContext}else if("conditionalFormats"===elem){newContext=new CT_ConditionalFormats;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.conditionalFormats=newContext}else if("chartFormats"===elem){newContext=new CT_ChartFormats;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.chartFormats=newContext}else if("pivotHierarchies"===elem){newContext=new CT_PivotHierarchies;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotHierarchies=newContext}else if("pivotTableStyleInfo"===elem){newContext=new CT_PivotTableStyle;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotTableStyleInfo=newContext}else if("filters"===elem){newContext=new CT_PivotFilters;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.filters= newContext}else if("rowHierarchiesUsage"===elem){newContext=new CT_RowHierarchiesUsage;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.rowHierarchiesUsage=newContext}else if("colHierarchiesUsage"===elem){newContext=new CT_ColHierarchiesUsage;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.colHierarchiesUsage=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else newContext=null; return newContext};CT_pivotTableDefinition.prototype.onEndNode=function(prevContext,elem){if("extLst"===elem)for(var i=0;i<prevContext.ext.length;++i){var ext=prevContext.ext[i];if("{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}"===ext.uri)this.pivotTableDefinitionX14=ext.elem}};CT_pivotTableDefinition.prototype.toXml=function(writer,stylesForWrite){writer.WriteXmlString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');writer.WriteXmlNodeStart("pivotTableDefinition");writer.WriteXmlString(' xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"'); if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.cacheId)writer.WriteXmlAttributeNumber("cacheId",this.cacheId);if(false!==this.dataOnRows)writer.WriteXmlAttributeBool("dataOnRows",this.dataOnRows);if(null!==this.dataPosition)writer.WriteXmlAttributeNumber("dataPosition",this.dataPosition);if(null!==this.autoFormatId)writer.WriteXmlAttributeNumber("autoFormatId",this.autoFormatId);if(null!==this.applyNumberFormats)writer.WriteXmlAttributeBool("applyNumberFormats", this.applyNumberFormats);if(null!==this.applyBorderFormats)writer.WriteXmlAttributeBool("applyBorderFormats",this.applyBorderFormats);if(null!==this.applyFontFormats)writer.WriteXmlAttributeBool("applyFontFormats",this.applyFontFormats);if(null!==this.applyPatternFormats)writer.WriteXmlAttributeBool("applyPatternFormats",this.applyPatternFormats);if(null!==this.applyAlignmentFormats)writer.WriteXmlAttributeBool("applyAlignmentFormats",this.applyAlignmentFormats);if(null!==this.applyWidthHeightFormats)writer.WriteXmlAttributeBool("applyWidthHeightFormats", this.applyWidthHeightFormats);if(null!==this.dataCaption)writer.WriteXmlAttributeStringEncode("dataCaption",this.dataCaption);if(null!==this.grandTotalCaption)writer.WriteXmlAttributeStringEncode("grandTotalCaption",this.grandTotalCaption);if(null!==this.errorCaption)writer.WriteXmlAttributeStringEncode("errorCaption",this.errorCaption);if(false!==this.showError)writer.WriteXmlAttributeBool("showError",this.showError);if(null!==this.missingCaption)writer.WriteXmlAttributeStringEncode("missingCaption", this.missingCaption);if(true!==this.showMissing)writer.WriteXmlAttributeBool("showMissing",this.showMissing);if(null!==this.pageStyle)writer.WriteXmlAttributeStringEncode("pageStyle",this.pageStyle);if(null!==this.pivotTableStyle)writer.WriteXmlAttributeStringEncode("pivotTableStyle",this.pivotTableStyle);if(null!==this.vacatedStyle)writer.WriteXmlAttributeStringEncode("vacatedStyle",this.vacatedStyle);if(null!==this.tag)writer.WriteXmlAttributeStringEncode("tag",this.tag);if(0!==this.updatedVersion)writer.WriteXmlAttributeNumber("updatedVersion", this.updatedVersion);if(0!==this.minRefreshableVersion)writer.WriteXmlAttributeNumber("minRefreshableVersion",this.minRefreshableVersion);if(false!==this.asteriskTotals)writer.WriteXmlAttributeBool("asteriskTotals",this.asteriskTotals);if(true!==this.showItems)writer.WriteXmlAttributeBool("showItems",this.showItems);if(false!==this.editData)writer.WriteXmlAttributeBool("editData",this.editData);if(false!==this.disableFieldList)writer.WriteXmlAttributeBool("disableFieldList",this.disableFieldList); if(true!==this.showCalcMbrs)writer.WriteXmlAttributeBool("showCalcMbrs",this.showCalcMbrs);if(true!==this.visualTotals)writer.WriteXmlAttributeBool("visualTotals",this.visualTotals);if(true!==this.showMultipleLabel)writer.WriteXmlAttributeBool("showMultipleLabel",this.showMultipleLabel);if(true!==this.showDataDropDown)writer.WriteXmlAttributeBool("showDataDropDown",this.showDataDropDown);if(true!==this.showDrill)writer.WriteXmlAttributeBool("showDrill",this.showDrill);if(false!==this.printDrill)writer.WriteXmlAttributeBool("printDrill", this.printDrill);if(true!==this.showMemberPropertyTips)writer.WriteXmlAttributeBool("showMemberPropertyTips",this.showMemberPropertyTips);if(true!==this.showDataTips)writer.WriteXmlAttributeBool("showDataTips",this.showDataTips);if(true!==this.enableWizard)writer.WriteXmlAttributeBool("enableWizard",this.enableWizard);if(true!==this.enableDrill)writer.WriteXmlAttributeBool("enableDrill",this.enableDrill);if(true!==this.enableFieldProperties)writer.WriteXmlAttributeBool("enableFieldProperties",this.enableFieldProperties); if(true!==this.preserveFormatting)writer.WriteXmlAttributeBool("preserveFormatting",this.preserveFormatting);if(false!==this.useAutoFormatting)writer.WriteXmlAttributeBool("useAutoFormatting",this.useAutoFormatting);if(0!==this.pageWrap)writer.WriteXmlAttributeNumber("pageWrap",this.pageWrap);if(false!==this.pageOverThenDown)writer.WriteXmlAttributeBool("pageOverThenDown",this.pageOverThenDown);if(false!==this.subtotalHiddenItems)writer.WriteXmlAttributeBool("subtotalHiddenItems",this.subtotalHiddenItems); if(true!==this.rowGrandTotals)writer.WriteXmlAttributeBool("rowGrandTotals",this.rowGrandTotals);if(true!==this.colGrandTotals)writer.WriteXmlAttributeBool("colGrandTotals",this.colGrandTotals);if(false!==this.fieldPrintTitles)writer.WriteXmlAttributeBool("fieldPrintTitles",this.fieldPrintTitles);if(false!==this.itemPrintTitles)writer.WriteXmlAttributeBool("itemPrintTitles",this.itemPrintTitles);if(false!==this.mergeItem)writer.WriteXmlAttributeBool("mergeItem",this.mergeItem);if(true!==this.showDropZones)writer.WriteXmlAttributeBool("showDropZones", this.showDropZones);if(0!==this.createdVersion)writer.WriteXmlAttributeNumber("createdVersion",this.createdVersion);if(1!==this.indent)writer.WriteXmlAttributeNumber("indent",this.indent);if(false!==this.showEmptyRow)writer.WriteXmlAttributeBool("showEmptyRow",this.showEmptyRow);if(false!==this.showEmptyCol)writer.WriteXmlAttributeBool("showEmptyCol",this.showEmptyCol);if(true!==this.showHeaders)writer.WriteXmlAttributeBool("showHeaders",this.showHeaders);if(true!==this.compact)writer.WriteXmlAttributeBool("compact", this.compact);if(false!==this.outline)writer.WriteXmlAttributeBool("outline",this.outline);if(false!==this.outlineData)writer.WriteXmlAttributeBool("outlineData",this.outlineData);if(true!==this.compactData)writer.WriteXmlAttributeBool("compactData",this.compactData);if(false!==this.published)writer.WriteXmlAttributeBool("published",this.published);if(false!==this.gridDropZones)writer.WriteXmlAttributeBool("gridDropZones",this.gridDropZones);if(true!==this.immersive)writer.WriteXmlAttributeBool("immersive", this.immersive);if(true!==this.multipleFieldFilters)writer.WriteXmlAttributeBool("multipleFieldFilters",this.multipleFieldFilters);if(0!==this.chartFormat)writer.WriteXmlAttributeNumber("chartFormat",this.chartFormat);if(null!==this.rowHeaderCaption)writer.WriteXmlAttributeStringEncode("rowHeaderCaption",this.rowHeaderCaption);if(null!==this.colHeaderCaption)writer.WriteXmlAttributeStringEncode("colHeaderCaption",this.colHeaderCaption);if(false!==this.fieldListSortAscending)writer.WriteXmlAttributeBool("fieldListSortAscending", this.fieldListSortAscending);if(false!==this.mdxSubqueries)writer.WriteXmlAttributeBool("mdxSubqueries",this.mdxSubqueries);if(true!==this.customListSort)writer.WriteXmlAttributeBool("customListSort",this.customListSort);writer.WriteXmlNodeEnd("pivotTableDefinition",true);if(null!==this.location)this.location.toXml(writer,"location");if(null!==this.pivotFields)this.pivotFields.toXml(writer,"pivotFields",stylesForWrite);if(null!==this.rowFields&&this.rowFields.getCount()>0)this.rowFields.toXml(writer, "rowFields");if(null!==this.rowItems)this.rowItems.toXml(writer,"rowItems");if(null!==this.colFields&&this.colFields.getCount()>0)this.colFields.toXml(writer,"colFields");if(null!==this.colItems)this.colItems.toXml(writer,"colItems");if(null!==this.pageFields&&this.pageFields.getCount()>0)this.pageFields.toXml(writer,"pageFields");if(null!==this.dataFields)this.dataFields.toXml(writer,"dataFields",stylesForWrite);if(null!==this.formats)this.formats.toXml(writer,"formats");if(null!==this.conditionalFormats)this.conditionalFormats.toXml(writer, "conditionalFormats");if(null!==this.chartFormats)this.chartFormats.toXml(writer,"chartFormats");if(null!==this.pivotHierarchies)this.pivotHierarchies.toXml(writer,"pivotHierarchies");if(null!==this.pivotTableStyleInfo)this.pivotTableStyleInfo.toXml(writer,"pivotTableStyleInfo");if(null!==this.filters)this.filters.toXml(writer,"filters");if(null!==this.rowHierarchiesUsage)this.rowHierarchiesUsage.toXml(writer,"rowHierarchiesUsage");if(null!==this.colHierarchiesUsage)this.colHierarchiesUsage.toXml(writer, "colHierarchiesUsage");if(null!==this.pivotTableDefinitionX14){var ext=new CT_Extension;ext.uri="{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}";ext.elem=this.pivotTableDefinitionX14;var extList=new CT_ExtensionList;extList.ext.push(ext);extList.toXml(writer,"extLst")}writer.WriteXmlNodeEnd("pivotTableDefinition")};CT_pivotTableDefinition.prototype.init=function(){this.isInit=true;this.pageFieldsPositions=[];var pageFields=this.asc_getPageFields();var rowPageCount=0,colPageCount=0,r,c;if(pageFields){var pageFieldSize= this.getPageFieldSize();rowPageCount=pageFieldSize.row;colPageCount=pageFieldSize.col;var range=this.getRange();var baseCol=range.c1;var baseRow=range.r1-pageFieldSize.row-1;var pageWrap=this.pageWrap||Number.MAX_VALUE;for(var i=0;i<pageFields.length;++i){if(this.pageOverThenDown){r=Math.floor(i/pageWrap);c=3*(i%pageWrap)}else{r=i%pageWrap;c=3*Math.floor(i/pageWrap)}this.pageFieldsPositions.push({row:Math.max(0,baseRow+r),col:Math.max(0,baseCol+c),pageField:pageFields[i]})}}if(this.location)this.location.setPageCount(rowPageCount, colPageCount);this.updatePivotType()};CT_pivotTableDefinition.prototype.createNewIds=function(){this.Id=AscCommon.g_oIdCounter.Get_NewId();if(this.cacheDefinition&&null!==this.cacheDefinition.getPivotCacheId())this.cacheDefinition.createNewPivotCacheId()};CT_pivotTableDefinition.prototype.updatePivotType=function(){this.clearGrid=false;this.hasCompactField=false;var pivotFields=this.asc_getPivotFields();var rowFields=this.asc_getRowFields();if(rowFields){var i,index;for(i=0;i<rowFields.length;++i){index= rowFields[i].asc_getIndex();if(st_VALUES!==index&&false!==pivotFields[index].outline){this.clearGrid=true;break}}for(i=0;i<pivotFields.length;++i)if(false!==pivotFields[i].compact){this.hasCompactField=true;break}}};CT_pivotTableDefinition.prototype.hasCompact=function(){return false!==this.compactData||this.hasCompactField};CT_pivotTableDefinition.prototype.intersection=function(range){return this.location&&this.location.intersection(range)||this.pageFieldsIntersection(range)};CT_pivotTableDefinition.prototype.isInRange= function(bbox){var ranges=this.getReportRanges();return ranges.every(function(range){return bbox.containsRange(range)})};CT_pivotTableDefinition.prototype.pageFieldsIntersection=function(range){return this.pageFieldsPositions&&this.pageFieldsPositions.some(function(element){return Array.isArray(range)?range.some(function(elementRange){return elementRange.contains(element.col,element.row)||elementRange.contains(element.col+1,element.row)}):range.contains(element.col,element.row)||range.contains(element.col+ 1,element.row)})};CT_pivotTableDefinition.prototype.contains=function(col,row){return this.location&&this.location.contains(col,row)||this.pageFieldsIntersection(new Asc.Range(col,row,col,row))};CT_pivotTableDefinition.prototype.getRange=function(){return this.location&&this.location.ref};CT_pivotTableDefinition.prototype.getReportRanges=function(){var res=[],pos;if(this.pageFieldsPositions)for(var i=0;i<this.pageFieldsPositions.length;++i){pos=this.pageFieldsPositions[i];res.push(new Asc.Range(pos.col, pos.row,pos.col+1,pos.row))}var pivotRange=this.getRange();res.push(new Asc.Range(pivotRange.c1,pivotRange.r1,pivotRange.c2,pivotRange.r2));return res};CT_pivotTableDefinition.prototype.getFirstHeaderRow0=function(){return this.location&&this.location.firstHeaderRow+this.getColumnFieldsCount()-1};CT_pivotTableDefinition.prototype.getFirstDataCol=function(){return this.location&&this.location.firstDataCol};CT_pivotTableDefinition.prototype.getColumnFieldsCount=function(withoutValues){var res=0;var colFields= this.asc_getColumnFields();if(colFields){res=colFields.length;if(1===res&&withoutValues&&st_VALUES===colFields[0].x)res=0}return res};CT_pivotTableDefinition.prototype.fillAutoFiltersOptions=function(autoFilterObject,index){var pivotField=this.asc_getPivotFields()[index];var cacheField=this.asc_getCacheFields()[index];var dataFields=this.asc_getDataFields();var sortVal=pivotField.getSortVal();var pageFieldItem=null;if(c_oAscAxis.AxisPage===pivotField.axis&&!pivotField.multipleItemSelectionAllowed){var pageFilter= this.getPageFieldByFieldIndex(index);if(pageFilter)pageFieldItem=pageFilter.item}var values=pivotField.getFilterObject(cacheField,pageFieldItem,this.getPivotFieldNum(index));var filterObj=new Asc.AutoFilterObj;filterObj.type=Asc.c_oAscAutoFilterTypes.None;var pivotFilter=this.getPivotFilter(index);if(pivotFilter)filterObj.convertFromFilterColumn(pivotFilter.autoFilter.FilterColumns[0],false);else if(values.some(function(elem){return!elem.visible}))filterObj.type=Asc.c_oAscAutoFilterTypes.Filters; var pivotDataFields=[this.getPivotFieldName(index)];if(dataFields)dataFields.forEach(function(item){pivotDataFields.push(item.asc_getName())});var iMeasureFld=pivotFilter&&null!==pivotFilter.iMeasureFld?pivotFilter.iMeasureFld+1:0;var sortDataIndex=pivotField.getSortDataIndex();var indexSorting=0;if(dataFields&&0<=sortDataIndex&&sortDataIndex<dataFields.length)indexSorting=sortDataIndex+1;var pivotFilterObj=new Asc.PivotFilterObj;pivotFilterObj.asc_setDataFields(pivotDataFields);pivotFilterObj.asc_setDataFieldIndexSorting(indexSorting); pivotFilterObj.asc_setDataFieldIndexFilter(iMeasureFld);pivotFilterObj.asc_setIsPageFilter(pivotField.axis===c_oAscAxis.AxisPage);pivotFilterObj.asc_setIsMultipleItemSelectionAllowed(pivotField.multipleItemSelectionAllowed);pivotFilterObj.asc_setIsTop10Sum(pivotFilter?pivotFilter.type===c_oAscPivotFilterType.Sum:false);autoFilterObject.asc_setSortState(sortVal);autoFilterObject.asc_setValues(values);autoFilterObject.asc_setFilterObj(filterObj);autoFilterObject.asc_setPivotObj(pivotFilterObj)};CT_pivotTableDefinition.prototype.getPivotTableButtons= function(range,buttons){if(!this.intersection(range))return;var i,index,pivotField;var pivotRange=this.getRange();var location=this.location;var pivotFields=this.asc_getPivotFields();var rowFields=this.asc_getRowFields();var colFields=this.asc_getColumnFields();if(this.pageFieldsPositions)for(i=0;i<this.pageFieldsPositions.length;++i){var pos=this.pageFieldsPositions[i];if(range.contains(pos.col+1,pos.row)){var pageField=pos.pageField;pivotField=pivotFields[pageField.fld];var isSetFilter=null!=pageField.item|| !pivotField.isAllVisible();buttons.push({isSortState:null,isSetFilter:isSetFilter,row:pos.row,col:pos.col+1,idPivot:{id:this.Get_Id(),fld:pageField.fld,row:pos.row,col:pos.col+1}})}}if(this.showHeaders){if(colFields){var baseCol=pivotRange.c1+location.firstDataCol;if(this.compact)this.getPivotFieldButtonCompact(range,buttons,colFields,pivotRange.r1,baseCol);else for(i=0;i<colFields.length;++i){index=colFields[i].asc_getIndex();this.getPivotFieldButton(range,buttons,index,pivotRange.r1,baseCol+i)}}if(rowFields){var baseRow= pivotRange.r1+location.firstDataRow-1;if(this.compact||location.firstDataCol!==rowFields.length){if(!(1===rowFields.length&&AscCommonExcel.st_VALUES===rowFields[0].asc_getIndex()))this.getPivotFieldButtonCompact(range,buttons,rowFields,baseRow,pivotRange.c1)}else{var c1=pivotRange.c1;index=rowFields[0].asc_getIndex();this.getPivotFieldButton(range,buttons,index,baseRow,c1);for(i=1;i<rowFields.length;++i){index=rowFields[i-1].asc_getIndex();var isTabular;if(AscCommonExcel.st_VALUES!==index){pivotField= pivotFields[index];isTabular=pivotField&&!(pivotField.compact&&pivotField.outline)}else isTabular=!(this.compact&&this.outline);if(isTabular){index=rowFields[i].asc_getIndex();this.getPivotFieldButton(range,buttons,index,baseRow,++c1)}}}}}};CT_pivotTableDefinition.prototype.getPivotFieldButtonCompact=function(range,buttons,rowColFields,row,col){if(!range.contains(col,row))return;var isSortState=null;var isSetFilter=false;var res=null;var i=0;while(i<rowColFields.length&&(null===isSortState||false=== isSetFilter)){var index=rowColFields[i].asc_getIndex();var button=this._getPivotFieldButton(range,index,row,col);if(button){res=res||button;if(null===isSortState)isSortState=button.isSortState;isSetFilter=isSetFilter||button.isSetFilter}i++}if(res){res.isSortState=isSortState;res.isSetFilter=isSetFilter;buttons.push(res)}};CT_pivotTableDefinition.prototype.getPivotFieldCompact=function(range,buttons,rowColFields,row,col){if(!range.contains(col,row))return;var isSortState=null;var isSetFilter=false; var res=null;var i=0;while(i<rowColFields.length&&(null===isSortState||false===isSetFilter)){var index=rowColFields[i].asc_getIndex();var button=this._getPivotFieldButton(range,index,row,col);if(button){res=res||button;if(null===isSortState)isSortState=button.isSortState;isSetFilter=isSetFilter||button.isSetFilter}i++}if(res){res.isSortState=isSortState;res.isSetFilter=isSetFilter;buttons.push(res)}};CT_pivotTableDefinition.prototype._getPivotFieldButton=function(range,index,row,col){if(AscCommonExcel.st_VALUES=== index||!range.contains(col,row))return;var autoFilterObject=new Asc.AutoFiltersOptions;this.fillAutoFiltersOptions(autoFilterObject,index);var isSortState=null!==autoFilterObject.sortVal?Asc.c_oAscSortOptions.Descending===autoFilterObject.sortVal:null;var isSetFilter=autoFilterObject.filter.type!==Asc.c_oAscAutoFilterTypes.None;return{isSortState:isSortState,isSetFilter:isSetFilter,row:row,col:col,idPivot:{id:this.Get_Id(),fld:index,row:row,col:col}}};CT_pivotTableDefinition.prototype.getPivotFieldButton= function(range,buttons,index,row,col){var button=this._getPivotFieldButton(range,index,row,col);if(button)buttons.push(button)};CT_pivotTableDefinition.prototype.getColumnFieldsValuesIndex=function(){var colFields=this.asc_getColumnFields();if(colFields)return colFields&&colFields.findIndex(function(element){return element.asc_getIndex()===st_VALUES});return-1};CT_pivotTableDefinition.prototype.getRowFieldsCount=function(compact){var t=this,res=0,l;var rowFields=this.asc_getRowFields();if(rowFields){l= res=rowFields.length;if(compact)this.getField(rowFields,function(element,i){if(i!==l-1){var field=t.pivotFields.pivotField[element.asc_getIndex()];res-=field&&false!==field.outline&&false!==field.compact?1:0}})}return res};CT_pivotTableDefinition.prototype.getRowFieldPos=function(index){var res=0;var rowFields=this.asc_getRowFields();if(rowFields){var field;for(var i=0;i<index&&i<rowFields.length;++i){field=this.pivotFields.pivotField[rowFields[i].asc_getIndex()];res+=field&&(false===field.outline|| false===field.compact)&&1}}return res};CT_pivotTableDefinition.prototype.getRowFieldsValuesIndex=function(){var rowFields=this.asc_getRowFields();if(rowFields)return rowFields.findIndex(function(element){return element.asc_getIndex()===st_VALUES});return-1};CT_pivotTableDefinition.prototype.getDataFieldsCount=function(){return this.dataFields&&this.dataFields.dataField.length||0};CT_pivotTableDefinition.prototype.getField=function(arrFields,callback){return arrFields&&arrFields.map(callback,this)}; CT_pivotTableDefinition.prototype.getRowItems=function(){return this.rowItems&&this.rowItems.i};CT_pivotTableDefinition.prototype.getColItems=function(){return this.colItems&&this.colItems.i};CT_pivotTableDefinition.prototype.getRecords=function(){return this.cacheDefinition.getRecords()};CT_pivotTableDefinition.prototype.getAllRange=function(ws){var newSelection=new AscCommonExcel.SelectionRange(ws);newSelection.assign2(this.getRange());if(this.pageFieldsPositions&&0<this.pageFieldsPositions.length){this.pageFieldsPositions.forEach(function(element){newSelection.addRange(); newSelection.getLast().assign2(new Asc.Range(element.col,element.row,element.col+1,element.row))});newSelection=newSelection.getUnion()}return newSelection};CT_pivotTableDefinition.prototype.asc_getName=function(){return this.name};CT_pivotTableDefinition.prototype.asc_getPageWrap=function(){return this.pageWrap||0};CT_pivotTableDefinition.prototype.asc_getPageOverThenDown=function(){return!!this.pageOverThenDown};CT_pivotTableDefinition.prototype.asc_getRowGrandTotals=function(){return this.rowGrandTotals}; CT_pivotTableDefinition.prototype.asc_getColGrandTotals=function(){return this.colGrandTotals};CT_pivotTableDefinition.prototype.asc_getShowHeaders=function(){return this.showHeaders};CT_pivotTableDefinition.prototype.asc_getTitle=function(){return this.pivotTableDefinitionX14&&this.pivotTableDefinitionX14.altText};CT_pivotTableDefinition.prototype.asc_getDescription=function(){return this.pivotTableDefinitionX14&&this.pivotTableDefinitionX14.altTextSummary};CT_pivotTableDefinition.prototype.asc_getStyleInfo= function(){return this.pivotTableStyleInfo};CT_pivotTableDefinition.prototype.asc_getCacheFields=function(){return this.cacheDefinition.getFields()};CT_pivotTableDefinition.prototype.asc_getPivotFields=function(){return this.pivotFields&&this.pivotFields.pivotField};CT_pivotTableDefinition.prototype.asc_getPageFields=function(){return this.pageFields&&this.pageFields.pageField.length>0&&this.pageFields.pageField};CT_pivotTableDefinition.prototype.asc_getColumnFields=function(){return this.colFields&& this.colFields.field.length>0&&this.colFields.field};CT_pivotTableDefinition.prototype.asc_getRowFields=function(){return this.rowFields&&this.rowFields.field.length>0&&this.rowFields.field};CT_pivotTableDefinition.prototype.asc_getDataFields=function(){return this.dataFields&&this.dataFields.dataField.length>0&&this.dataFields.dataField};CT_pivotTableDefinition.prototype.asc_getPivotFilters=function(){return this.filters&&this.filters.filter};CT_pivotTableDefinition.prototype.getPivotFilter=function(index){return this.filters&& this.filters.getFilterByFieldIndex(index)};CT_pivotTableDefinition.prototype.asc_select=function(api){this.getAllRange(api.wbModel.getActiveWs()).Select()};CT_pivotTableDefinition.prototype.asc_getDataRef=function(){return this.cacheDefinition&&this.cacheDefinition.getDataRef()||""};CT_pivotTableDefinition.prototype.asc_getFillDownLabelsDefault=function(){return!!(this.pivotTableDefinitionX14&&this.pivotTableDefinitionX14.fillDownLabelsDefault)};CT_pivotTableDefinition.prototype.setCacheDefinition= function(newCacheDefinition){this.cacheDefinition=newCacheDefinition};CT_pivotTableDefinition.prototype.getPivotCacheId=function(){return this.cacheDefinition&&this.cacheDefinition.getPivotCacheId()};CT_pivotTableDefinition.prototype.setPivotCacheId=function(val){return this.cacheDefinition&&this.cacheDefinition.setPivotCacheId(val)};CT_pivotTableDefinition.prototype.checkPivotCacheId=function(){if(this.cacheDefinition)if(null===this.cacheDefinition.getPivotCacheId()){this.cacheDefinition.createNewPivotCacheId(); History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotCacheId,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),null,this.cacheDefinition.getPivotCacheId()))}};CT_pivotTableDefinition.prototype.checkPivotFieldItems=function(index){var pivotField=this.asc_getPivotFields()[index];var cacheField,cacheRecords,i;if(pivotField&&!pivotField.items){cacheField=this.asc_getCacheFields()[index];cacheRecords=this.getRecords(); if(cacheField&&cacheRecords)this.checkPivotFieldItem(index,pivotField,cacheRecords,cacheField)}};CT_pivotTableDefinition.prototype.checkPivotFieldItem=function(index,pivotField,cacheRecords,cacheField,oldCacheField){var item,i,j,newItem,equalMap={};var pivotFieldOld=pivotField.clone();var newItems=new CT_Items;cacheField.checkSharedItems(this,index,cacheRecords);if(pivotField.items&&oldCacheField)for(i=0;i<pivotField.items.item.length;++i){item=pivotField.items.item[i];if(Asc.c_oAscItemType.Data=== item.t&&!item.m){var oldSharedItem=oldCacheField.getSharedItem(item.x);if(oldSharedItem)for(j=0;j<cacheField.getSharedSize();++j)if(oldSharedItem.shallowEqual(cacheField.getSharedItem(j))){newItem=item.clone();newItem.x=j;newItems.item.push(newItem);equalMap[newItem.x]=1;break}}}for(i=0;i<cacheField.sharedItems.Items.getSize();++i)if(!equalMap[i]){newItem=new CT_Item;newItem.x=i;newItems.item.push(newItem)}pivotField.items=newItems;if(!oldCacheField)pivotField.sortItems(Asc.c_oAscSortOptions.Ascending, cacheField.sharedItems);pivotField.checkSubtotal();History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),index,pivotFieldOld,pivotField.clone()))};CT_pivotTableDefinition.prototype.getFilterMaps=function(cacheFieldsWithData){var t=this;var labelFilters=[];var valueFilters=[];var i,map,pageField,pivotField,cacheField,pivotFilter,item;var pageFields=this.asc_getPageFields(); var pivotFields=this.asc_getPivotFields();var cacheFields=this.asc_getCacheFields();var pivotFilters=this.asc_getPivotFilters();if(pageFields)for(i=0;i<pageFields.length;++i){pageField=pageFields[i];if(AscCommonExcel.st_VALUES!==pageField.fld&&null!==pageField.fld){this.checkPivotFieldItems(pageField.fld);pivotField=pivotFields[pageField.fld];if(pivotField){item=pivotField.getItem(pageField.item);if(item){map=new Map;map.set(item.x,1);labelFilters.push({index:pageField.fld,map:map})}}}}if(pivotFields)for(i= 0;i<pivotFields.length;++i){pivotField=pivotFields[i];if((c_oAscAxis.AxisRow===pivotField.axis||c_oAscAxis.AxisCol===pivotField.axis||c_oAscAxis.AxisPage===pivotField.axis&&pivotField.multipleItemSelectionAllowed)&&!pivotField.isAllVisible())labelFilters.push({index:i,map:pivotField.getFilterMap()})}if(pivotFilters)for(i=0;i<pivotFilters.length;++i){pivotFilter=pivotFilters[i];pivotField=pivotFields[pivotFilter.fld];cacheField=cacheFields[pivotFilter.fld];var filterColumn=pivotField&&pivotFilter.getFilterColumn(); if(filterColumn){this.checkPivotFieldItems(pivotFilter.fld);if(pivotFilter.isLabelFilter())labelFilters.push({index:pivotFilter.fld,map:pivotField.getFilterMapFilterColumn(cacheField,filterColumn,this.getPivotFieldNum(pivotFilter.fld))});else valueFilters.push({index:pivotFilter.fld,pivotField:pivotField,pivotFilter:pivotFilter})}}var ws=this.worksheet;if(this.cacheDefinition&&pivotFields){var slicerCaches=ws.workbook.getSlicerCachesByPivotTable(ws.getId(),this.name);slicerCaches.forEach(function(slicerCache){var fieldIndex= t.cacheDefinition.getFieldIndexByName(slicerCache.sourceName);pivotField=pivotFields[fieldIndex];if(pivotField){t.checkPivotFieldItems(fieldIndex);if(slicerCache.getIndicateItemsWithNoData())cacheFieldsWithData[fieldIndex]=new Uint8Array(pivotField.getItemsCount());if((null===pivotField.axis||c_oAscAxis.AxisValues===pivotField.axis)&&!pivotField.isAllVisible())labelFilters.push({index:fieldIndex,map:pivotField.getFilterMap()})}})}return{labelFilters:labelFilters,valueFilters:valueFilters}};CT_pivotTableDefinition.prototype.getRowColIndexes= function(fields,withoutValue){var indexes=[];var i;if(fields)for(i=0;i<fields.length;++i){var index=fields[i].x;if(st_VALUES!==index||!withoutValue){this.checkPivotFieldItems(index);indexes.push(index)}}return indexes};CT_pivotTableDefinition.prototype.getCacheFieldName=function(index){return this.asc_getCacheFields()[index].name||""};CT_pivotTableDefinition.prototype.getPivotFieldName=function(index){return this.asc_getPivotFields()[index].name||this.getCacheFieldName(index)};CT_pivotTableDefinition.prototype.getDataFieldName= function(index){var dataField=this.asc_getDataFields()[index];return dataField.name||this.getPivotFieldName(dataField.asc_getIndex())};CT_pivotTableDefinition.prototype.getPageFieldName=function(index){var pageField=this.asc_getPageFields()[index];return this.getPivotFieldName(pageField.asc_getIndex())};CT_pivotTableDefinition.prototype.getPageFieldByFieldIndex=function(fld){var pageFields=this.asc_getPageFields();if(pageFields)for(var i=0;i<pageFields.length;++i)if(fld===pageFields[i].fld)return pageFields[i]; return null};CT_pivotTableDefinition.prototype.getPivotFieldCellValue=function(fieldIndex,valueIndex){var pivotFields=this.asc_getPivotFields();var cacheFields=this.asc_getCacheFields();var pivotField=pivotFields[fieldIndex];var pivotFieldItem=pivotField.getItem(valueIndex);var sharedItem=cacheFields[fieldIndex].getSharedItem(pivotFieldItem.x);if(sharedItem)return sharedItem.getCellValue();return new AscCommonExcel.CCellValue};CT_pivotTableDefinition.prototype.getPivotFieldNum=function(fieldIndex){if(st_VALUES!== fieldIndex){var pivotField=this.asc_getPivotFields()[fieldIndex];var cacheField=this.asc_getCacheFields()[fieldIndex];if(pivotField&&pivotField.num)return pivotField.num;else if(cacheField&&cacheField.sharedItems&&cacheField.sharedItems.containsDate)return AscCommonExcel.Num.prototype.initFromParams(14,AscCommon.getFormatByStandardId(14))}return null};CT_pivotTableDefinition.prototype.getPageFieldCellValue=function(index){var pageField=this.asc_getPageFields()[index];if(AscCommonExcel.st_VALUES=== pageField.fld)return;var oCellValue;if(null!==pageField.item)oCellValue=this.getPivotFieldCellValue(pageField.fld,pageField.item);else{var pivotField=this.asc_getPivotFields()[pageField.fld];oCellValue=new AscCommonExcel.CCellValue;oCellValue.type=AscCommon.CellValueType.String;if(pivotField.multipleItemSelectionAllowed){var visibleIndexes=pivotField.getVisibleIndexes();if(1===visibleIndexes.length)oCellValue=this.getPivotFieldCellValue(pageField.fld,visibleIndexes[0]);else if(pivotField.isAllVisible())oCellValue.text= AscCommon.translateManager.getValue(AscCommonExcel.PAGE_ALL_CAPTION);else oCellValue.text=AscCommon.translateManager.getValue(AscCommonExcel.PAGE_MULTIPLE_CAPTION)}else oCellValue.text=AscCommon.translateManager.getValue(AscCommonExcel.PAGE_ALL_CAPTION)}return oCellValue};CT_pivotTableDefinition.prototype.calculateDataRow=function(){var dataRow=new PivotDataElem(this.getDataFieldsCount());var res={dataRow:dataRow,cacheFieldsWithData:{}};var cacheRecords=this.getRecords();if(cacheRecords){var rowIndexes= this.getRowColIndexes(this.asc_getRowFields(),true);var colIndexes=this.getRowColIndexes(this.asc_getColumnFields(),true);var filterMaps=this.getFilterMaps(res.cacheFieldsWithData);res.dataRow=cacheRecords.getDataMap(this.asc_getCacheFields(),filterMaps,res.cacheFieldsWithData,rowIndexes,colIndexes,this.asc_getDataFields()||[])}return res};CT_pivotTableDefinition.prototype.updateRowColItems=function(){var res=this.calculateDataRow();var dataRow=res.dataRow;var pivotFields,rowFields,colFields,dataFields, cacheRecords,indexValues,cacheFieldsWithData={};pivotFields=this.asc_getPivotFields();rowFields=this.asc_getRowFields();colFields=this.asc_getColumnFields();dataFields=this.asc_getDataFields();var rowItems=null;var colItems=null;if(rowFields){rowItems=new CT_rowItems;indexValues=this.getRowFieldsValuesIndex();this._updateRowColItemsRecursively(0,dataRow,undefined,rowItems.i,rowFields,false,pivotFields,0,dataFields,indexValues,false);this._updateRowColItemsGrandTotal(this.rowGrandTotals,indexValues, rowItems.i,rowFields,dataFields)}if(colFields){colItems=new CT_colItems;indexValues=this.getColumnFieldsValuesIndex();this._updateRowColItemsRecursively(0,{vals:dataRow.subtotal},undefined,colItems.i,colFields,true,pivotFields,0,dataFields,indexValues,false);this._updateRowColItemsGrandTotal(this.colGrandTotals,indexValues,colItems.i,colFields,dataFields)}if(rowFields||colFields||dataFields){if(!(rowItems&&rowItems.i.length>0)){rowItems=new CT_rowItems;rowItems.i.push(new CT_I)}if(!(colItems&&colItems.i.length> 0)){colItems=new CT_colItems;colItems.i.push(new CT_I)}}this.setRowItems(rowItems,true);this.setColItems(colItems,true);return res};CT_pivotTableDefinition.prototype._updateRowColItemsRecursively=function(index,dataMap,parentI,items,fields,isCol,pivotFields,dataIndex,dataFields,indexValues,showAll){if(index>=fields.length)return;var pivotField,indexItem,item,subDataMap,dataField;var x=fields[index].x;if(st_VALUES===x){if(dataFields)for(indexItem=0;indexItem<dataFields.length;++indexItem){dataField= dataFields[indexItem];if(dataField){pivotField=pivotFields[dataField.asc_getIndex()];if(pivotField){this._updateRowColItemsRecursivelyElem(index,dataMap,items,fields,isCol,pivotField,pivotFields,indexItem,dataFields,indexItem,parentI,indexValues,showAll);parentI=null}}}}else{pivotField=pivotFields[x];if(pivotField&&pivotField.items){var sortDataIndex=pivotField.getSortDataIndex();if(c_oAscFieldSortType.Manual!==pivotField.sortType&&0<=sortDataIndex&&sortDataIndex<dataFields.length){pivotField=pivotField.clone(); dataField=dataFields[sortDataIndex];var sortedPivotItems=pivotField.items.item.map(function(currentValue,index){return{item:currentValue,index:index}});var sign=Asc.c_oAscSortOptions.Ascending==pivotField.sortType?1:-1;sortedPivotItems.sort(function(a,b){var aDataMap=dataMap.vals[a.item.x];aDataMap=aDataMap&&aDataMap.total[sortDataIndex].getCellValue(dataField.subtotal,Asc.c_oAscItemType.Default,Asc.c_oAscItemType.Default,Asc.c_oAscItemType.Default);var bDataMap=dataMap.vals[b.item.x];bDataMap=bDataMap&& bDataMap.total[sortDataIndex].getCellValue(dataField.subtotal,Asc.c_oAscItemType.Default,Asc.c_oAscItemType.Default,Asc.c_oAscItemType.Default);var res=0;if(aDataMap&&aDataMap.type===AscCommon.CellValueType.Number&&bDataMap&&bDataMap.type===AscCommon.CellValueType.Number)res=aDataMap.number-bDataMap.number;else if(aDataMap&&aDataMap.type===AscCommon.CellValueType.Number)res=1;else if(bDataMap&&bDataMap.type===AscCommon.CellValueType.Number)res=-1;return sign*res});for(indexItem=0;indexItem<sortedPivotItems.length;++indexItem){var sortedPivotItem= sortedPivotItems[indexItem];item=sortedPivotItem.item;var itemIndex=sortedPivotItem.index;if(Asc.c_oAscItemType.Data===item.t){subDataMap=dataMap.vals[item.x];if(!subDataMap&&(showAll||pivotField.showAll)){showAll=showAll||pivotField.showAll;subDataMap=new PivotDataElem(dataFields.length)}else showAll=false;if(subDataMap){this._updateRowColItemsRecursivelyElem(index,subDataMap,items,fields,isCol,pivotField,pivotFields,dataIndex,dataFields,itemIndex,parentI,indexValues,showAll);parentI=null}}}}else for(indexItem= 0;indexItem<pivotField.items.item.length;++indexItem){item=pivotField.items.item[indexItem];if(Asc.c_oAscItemType.Data===item.t){subDataMap=dataMap.vals[item.x];if(!subDataMap&&(showAll||pivotField.showAll)){showAll=showAll||pivotField.showAll;subDataMap=new PivotDataElem(dataFields.length)}else showAll=false;if(subDataMap){this._updateRowColItemsRecursivelyElem(index,subDataMap,items,fields,isCol,pivotField,pivotFields,dataIndex,dataFields,indexItem,parentI,indexValues,showAll);parentI=null}}}}}}; CT_pivotTableDefinition.prototype._updateRowColItemsRecursivelyElem=function(index,dataMap,items,fields,isCol,parentPivotField,pivotFields,dataIndex,dataFields,indexItem,parentI,indexValues,showAll){var newI,newParentI,i,j;var newX=new CT_X;newX.v=indexItem;var isTabular=isCol||!parentPivotField.outline;if(parentI){parentI.x.push(newX);newParentI=isTabular?parentI:undefined}else{newI=new CT_I;newI.i=dataIndex;newI.r=index;newI.x.push(newX);items.push(newI);newParentI=isTabular?newI:undefined}this._updateRowColItemsRecursively(index+ 1,dataMap,newParentI,items,fields,isCol,pivotFields,dataIndex,dataFields,indexValues,showAll);var subtotals;var subtotalTop=true;var x=fields[index].x;if(st_VALUES!==x){subtotals=pivotFields[x]&&pivotFields[x].asc_getSubtotals(true);subtotalTop=pivotFields[x]&&pivotFields[x].subtotalTop}if(subtotals&&subtotals.length>0&&index!==indexValues&&(index<fields.length-2||index===fields.length-2&&index+1!==indexValues)){var from=dataIndex;var to=dataIndex;if(index<indexValues&&dataFields){from=0;to=dataFields.length- 1}if(subtotals.length+to-from+1>2||isTabular||!subtotalTop)for(i=0;i<subtotals.length;++i)for(j=from;j<=to;++j){newX=new CT_X;newX.v=indexItem;newI=new CT_I;newI.i=j;newI.t=subtotals[i];newI.r=index;newI.x.push(newX);items.push(newI)}}if(!isCol&&parentPivotField.insertBlankRow&&index!==indexValues&&index<fields.length-1){newX=new CT_X;newX.v=indexItem;newI=new CT_I;newI.t=Asc.c_oAscItemType.Blank;newI.r=index;newI.x.push(newX);items.push(newI)}};CT_pivotTableDefinition.prototype._updateRowColItemsGrandTotal= function(grandTotals,indexValues,items,fields,dataFields){if(grandTotals&&!(indexValues>=0&&1===fields.length)){var grandTotalsCount=indexValues>=0&&dataFields?dataFields.length:1;for(var i=0;i<grandTotalsCount;++i){var newI=new CT_I;newI.i=i;newI.t=Asc.c_oAscItemType.Grand;newI.x.push(new CT_X);items.push(newI)}}};CT_pivotTableDefinition.prototype.updateAfterEdit=function(){var res=this.updateRowColItems();this.updateLocation();return res};CT_pivotTableDefinition.prototype.setLocation=function(location, addToHistory){if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_Location,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),this.location,location));this.location=location;this.setChanged(false,true)};CT_pivotTableDefinition.prototype.setOffset=function(offset,addToHistory){var location=this.location.clone();location.ref.setOffset(offset);this.setLocation(location,addToHistory)};CT_pivotTableDefinition.prototype.getPageFieldSize= function(){var res=new AscCommon.CellBase(0,0);var pageField=this.asc_getPageFields();if(pageField){var len=pageField.length;if(this.pageWrap){res.row=this.pageOverThenDown?Math.ceil(len/this.pageWrap):Math.min(this.pageWrap,len);res.col=this.pageOverThenDown?Math.min(this.pageWrap,len):Math.ceil(len/this.pageWrap)}else{res.row=this.pageOverThenDown?1:len;res.col=this.pageOverThenDown?len:1}}return res};CT_pivotTableDefinition.prototype.updateLocation=function(){var i;var location=this.location.clone(); var pivotFields=this.asc_getPivotFields();var rowFields=this.asc_getRowFields();var colFields=this.asc_getColumnFields();var dataFields=this.asc_getDataFields();var pageFields=this.asc_getPageFields();if(rowFields||colFields||dataFields){var colFieldsCount=colFields?colFields.length:0;var colFieldsCountWithoutValues=colFieldsCount;var rowFieldsCount=rowFields?rowFields.length:0;var dataFieldsCount=dataFields?dataFields.length:0;location.firstDataCol=0;location.firstHeaderRow=1;if(1===colFieldsCount&& st_VALUES===colFields[0].asc_getIndex()){location.firstHeaderRow=0;colFieldsCountWithoutValues=0}if(this.gridDropZones&&(0===colFieldsCountWithoutValues||0===rowFieldsCount)){location.firstHeaderRow=1;if(0<rowFieldsCount&&0===colFieldsCountWithoutValues&&dataFieldsCount<2)location.firstHeaderRow=2;location.firstDataCol=1}if(false===this.showHeaders&&false===this.gridDropZones&&(1!==dataFieldsCount||0<colFieldsCountWithoutValues&&0===rowFieldsCount))location.firstHeaderRow=0;location.firstDataRow= location.firstHeaderRow+colFieldsCount;if(rowFields){location.firstDataCol=1;for(i=0;i<rowFields.length-1;++i){var index=rowFields[i].asc_getIndex();if(st_VALUES!==index){var field=pivotFields[index];if(field&&!(field.compact&&field.outline))location.firstDataCol++}else if(!(this.compact&&this.outline))location.firstDataCol++}}else if(colFields&&1===dataFieldsCount)location.firstDataCol=1;var rowItemsCount=rowFields||dataFields?this.rowItems.i.length:0;var colItemsCount=colFields||dataFields?this.colItems.i.length: 0;if(!this.compact)colItemsCount=Math.max(colItemsCount,colFieldsCount);if(this.gridDropZones&&0<colFieldsCount&&0===rowFieldsCount&&0===dataFieldsCount)location.ref.r2=location.ref.r1+location.firstDataRow+NEW_PIVOT_LAST_ROW_OFFSET_GRID_DROP_ZONES-1;else location.ref.r2=location.ref.r1+location.firstDataRow+rowItemsCount-1;if(this.gridDropZones&&0<rowFieldsCount&&0===colFieldsCount&&0===dataFieldsCount)location.ref.c2=location.ref.c1+location.firstDataCol+NEW_PIVOT_LAST_COL_OFFSET_GRID_DROP_ZONES- 1;else location.ref.c2=location.ref.c1+location.firstDataCol+colItemsCount-1}else if(this.asc_getPageFields()){location.ref.r2=location.ref.r1;location.ref.c2=location.ref.c1;location.firstHeaderRow=0;location.firstDataRow=0;location.firstDataCol=0}else{if(this.gridDropZones){location.ref.r2=location.ref.r1+NEW_PIVOT_LAST_ROW_OFFSET_GRID_DROP_ZONES;location.ref.c2=location.ref.c1+NEW_PIVOT_LAST_COL_OFFSET_GRID_DROP_ZONES}else{location.ref.r2=location.ref.r1+NEW_PIVOT_LAST_ROW_OFFSET;location.ref.c2= location.ref.c1+NEW_PIVOT_LAST_COL_OFFSET}location.firstHeaderRow=1;location.firstDataRow=1;location.firstDataCol=0}if(pageFields){var pageFieldOffset=this.getPageFieldSize();if(location.ref.r1-pageFieldOffset.row-1<0)location.ref.setOffset(new AscCommon.CellBase(-location.ref.r1+pageFieldOffset.row+1,0))}this.setLocation(location,true)};CT_pivotTableDefinition.prototype.parseDataRef=function(dataRef){var worksheetSource=new CT_WorksheetSource;worksheetSource.fromDataRef(dataRef);return worksheetSource.getDataLocation()}; CT_pivotTableDefinition.prototype.isValidDataRef=function(dataRef){return AscFormat.ExecuteNoHistory(function(){var location=this.parseDataRef(dataRef);if(location&&location.ws&&location.bbox.getHeight()>0)if(location.headings)return location.headings.length===location.bbox.getWidth();else if(location.bbox.getHeight()>1){var header=this._prepareDataRange(location.ws,location.bbox.r1,location.bbox.c1,location.bbox.c2);return header.countCol===location.bbox.getWidth()}return false},this,[])};CT_pivotTableDefinition.prototype.prepareDataRange= function(ws,range){var header=this._prepareDataRange(ws,range.r1,range.c1,range.c2);if(header.minCol<=header.maxCol&&header.countCol===header.maxCol-header.minCol+1){range.c1=header.minCol;range.c2=header.maxCol}else if(range.r2-range.r1>1){header=this._prepareDataRange(ws,range.r1+1,range.c1,range.c2);if(header.countCol===range.getWidth())range.r1=range.r1+1}};CT_pivotTableDefinition.prototype._prepareDataRange=function(ws,row,c1,c2){var res={minCol:c2,maxCol:c1,countCol:0};ws.getRange3(row,c1,row, c2)._foreachNoEmptyByCol(function(cell){if(!cell.isNullTextString()){res.minCol=Math.min(res.minCol,cell.nCol);res.maxCol=Math.max(res.maxCol,cell.nCol);res.countCol++}});return res};CT_pivotTableDefinition.prototype.syncSlicersWithPivot=function(cacheFieldsWithData){var t=this;var ws=this.worksheet;var slicerCaches=ws.workbook.getSlicerCachesByPivotTable(ws.getId(),this.name);slicerCaches.forEach(function(slicerCache){slicerCache.syncWithPivot(t,cacheFieldsWithData)})};CT_pivotTableDefinition.prototype.isEmptyReport= function(){return 0===this.getColumnFieldsCount()+this.getRowFieldsCount()+this.getDataFieldsCount()};CT_pivotTableDefinition.prototype.asc_set=function(api,newVal){var t=this;if(null!==newVal.ascDataRef&&newVal.ascDataRef!==t.asc_getDataRef()&&!this.isValidDataRef(newVal.ascDataRef)){api.sendEvent("asc_onError",c_oAscError.ID.PivotLabledColumns,c_oAscError.Level.NoCritical);return}api._changePivotWithLock(this,function(ws){var oldName=t.name;if(null!==newVal.name)t.asc_setName(newVal.name,true); var newName=t.name;if(null!==newVal.rowGrandTotals)t.asc_setRowGrandTotals(newVal.rowGrandTotals,true);if(null!==newVal.colGrandTotals)t.asc_setColGrandTotals(newVal.colGrandTotals,true);if(null!==newVal.pageOverThenDown)t.asc_setPageOverThenDown(newVal.pageOverThenDown,true);if(null!==newVal.pageWrap)t.asc_setPageWrap(newVal.pageWrap,true);if(null!==newVal.showHeaders)t.asc_setShowHeaders(newVal.showHeaders,true);if(null!==newVal.compact)t.setCompact(newVal.compact,true);if(null!==newVal.outline)t.setOutline(newVal.outline, true);if(null!==newVal.gridDropZones)t.asc_setGridDropZones(newVal.gridDropZones,true);if(null!=newVal.ascFillDownLabels)t.setFillDownLabelsDefault(newVal.ascFillDownLabels,true);if(null!==newVal.ascDataRef&&newVal.ascDataRef!==t.asc_getDataRef())t.updateCacheData(newVal.ascDataRef);if(null!=newVal.ascAltText)t.setTitle(newVal.ascAltText,true);if(null!=newVal.ascAltTextSummary)t.setDescription(newVal.ascAltTextSummary,true);if(null!==newVal.ascInsertBlankRow)t.setInsertBlankRow(newVal.ascInsertBlankRow, true);if(null!==newVal.ascDefaultSubtotal)t.setDefaultSubtotal(newVal.ascDefaultSubtotal,true);if(null!==newVal.ascSubtotalTop)t.setSubtotalTop(newVal.ascSubtotalTop,true);if(oldName!==newName){var slicerCaches=ws.workbook.getSlicerCachesByPivotTable(ws.getId(),oldName);slicerCaches.forEach(function(slicerCache){slicerCache.movePivotTable(ws.getId(),oldName,ws.getId(),newName)})}})};CT_pivotTableDefinition.prototype.asc_setName=function(newVal,addToHistory){setTableProperty(this,this.name,newVal, addToHistory,AscCH.historyitem_PivotTable_SetName);this.name=newVal};CT_pivotTableDefinition.prototype.asc_setRowGrandTotals=function(newVal,addToHistory){setTableProperty(this,this.rowGrandTotals,newVal,addToHistory,AscCH.historyitem_PivotTable_SetRowGrandTotals,true);this.rowGrandTotals=newVal};CT_pivotTableDefinition.prototype.asc_setColGrandTotals=function(newVal,addToHistory){setTableProperty(this,this.colGrandTotals,newVal,addToHistory,AscCH.historyitem_PivotTable_SetColGrandTotals,true);this.colGrandTotals= newVal};CT_pivotTableDefinition.prototype.asc_setPageOverThenDown=function(newVal,addToHistory){setTableProperty(this,this.pageOverThenDown,newVal,addToHistory,AscCH.historyitem_PivotTable_SetPageOverThenDown,true);this.pageOverThenDown=newVal};CT_pivotTableDefinition.prototype.asc_setPageWrap=function(newVal,addToHistory){setTableProperty(this,this.pageWrap,newVal,addToHistory,AscCH.historyitem_PivotTable_SetPageWrap,true);this.pageWrap=newVal};CT_pivotTableDefinition.prototype.asc_setShowHeaders= function(newVal,addToHistory){setTableProperty(this,this.showHeaders,newVal,addToHistory,AscCH.historyitem_PivotTable_SetShowHeaders,true);this.showHeaders=newVal};CT_pivotTableDefinition.prototype.asc_setCompact=function(newVal,addToHistory){setTableProperty(this,this.compact,newVal,addToHistory,AscCH.historyitem_PivotTable_SetCompact,true);this.compact=newVal;this.compactData=this.compact};CT_pivotTableDefinition.prototype.setCompact=function(newVal,addToHistory){this.asc_setCompact(newVal,addToHistory); var pivotFields=this.asc_getPivotFields();if(addToHistory&&pivotFields)for(var i=0;i<pivotFields.length;++i)pivotFields[i].asc_setCompact(newVal,this,i,addToHistory)};CT_pivotTableDefinition.prototype.asc_setOutline=function(newVal,addToHistory){setTableProperty(this,this.outline,newVal,addToHistory,AscCH.historyitem_PivotTable_SetOutline,true);this.outline=newVal;this.outlineData=this.outline};CT_pivotTableDefinition.prototype.setOutline=function(newVal,addToHistory){this.asc_setOutline(newVal,addToHistory); var pivotFields=this.asc_getPivotFields();if(addToHistory&&pivotFields)for(var i=0;i<pivotFields.length;++i)pivotFields[i].asc_setOutline(newVal,this,i,addToHistory)};CT_pivotTableDefinition.prototype.asc_setGridDropZones=function(newVal,addToHistory){setTableProperty(this,this.gridDropZones,newVal,addToHistory,AscCH.historyitem_PivotTable_SetGridDropZones,true);this.gridDropZones=newVal};CT_pivotTableDefinition.prototype.asc_setFillDownLabelsDefault=function(newVal){this.ascFillDownLabels=newVal}; CT_pivotTableDefinition.prototype.setFillDownLabelsDefault=function(newVal,addToHistory){if(!this.pivotTableDefinitionX14)this.pivotTableDefinitionX14=new CT_pivotTableDefinitionX14;var oldVal=this.pivotTableDefinitionX14.fillDownLabelsDefault;setTableProperty(this,oldVal,newVal,addToHistory,AscCH.historyitem_PivotTable_SetFillDownLabelsDefault,true);this.pivotTableDefinitionX14.fillDownLabelsDefault=newVal;var pivotFields=this.asc_getPivotFields();if(addToHistory&&pivotFields)for(var i=0;i<pivotFields.length;++i)pivotFields[i].setFillDownLabelsDefault(newVal, this,i,addToHistory)};CT_pivotTableDefinition.prototype.asc_setDataRef=function(newVal){this.ascDataRef=newVal};CT_pivotTableDefinition.prototype.asc_setTitle=function(newVal){this.ascAltText=newVal};CT_pivotTableDefinition.prototype.setTitle=function(newVal,addToHistory){if(!this.pivotTableDefinitionX14)this.pivotTableDefinitionX14=new CT_pivotTableDefinitionX14;var oldVal=this.pivotTableDefinitionX14.altText;setTableProperty(this,oldVal,newVal,addToHistory,AscCH.historyitem_PivotTable_SetAltText, true);this.pivotTableDefinitionX14.altText=newVal};CT_pivotTableDefinition.prototype.asc_setDescription=function(newVal,addToHistory){this.ascAltTextSummary=newVal};CT_pivotTableDefinition.prototype.setDescription=function(newVal,addToHistory){if(!this.pivotTableDefinitionX14)this.pivotTableDefinitionX14=new CT_pivotTableDefinitionX14;var oldVal=this.pivotTableDefinitionX14.altTextSummary;setTableProperty(this,oldVal,newVal,addToHistory,AscCH.historyitem_PivotTable_SetAltTextSummary,true);this.pivotTableDefinitionX14.altTextSummary= newVal};CT_pivotTableDefinition.prototype.asc_setInsertBlankRow=function(newVal){this.ascInsertBlankRow=newVal};CT_pivotTableDefinition.prototype.setInsertBlankRow=function(newVal,addToHistory){var pivotFields=this.asc_getPivotFields();if(pivotFields)for(var i=0;i<pivotFields.length;++i)pivotFields[i].asc_setInsertBlankRow(newVal,this,i,addToHistory)};CT_pivotTableDefinition.prototype.asc_setDefaultSubtotal=function(newVal){this.ascDefaultSubtotal=newVal};CT_pivotTableDefinition.prototype.setDefaultSubtotal= function(newVal,addToHistory){var pivotFields=this.asc_getPivotFields();if(pivotFields)for(var i=0;i<pivotFields.length;++i){pivotFields[i].asc_setDefaultSubtotal(newVal,this,i,addToHistory);pivotFields[i].checkSubtotal()}};CT_pivotTableDefinition.prototype.asc_setSubtotalTop=function(newVal){this.ascSubtotalTop=newVal};CT_pivotTableDefinition.prototype.setSubtotalTop=function(newVal,addToHistory){var pivotFields=this.asc_getPivotFields();if(pivotFields)for(var i=0;i<pivotFields.length;++i)pivotFields[i].asc_setSubtotalTop(newVal, this,i,addToHistory)};CT_pivotTableDefinition.prototype.asc_addDataField=function(api,pivotIndex,insertIndex){var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField&&!pivotField.dragToData)return;var t=this;api._changePivotWithLock(this,function(){t.addDataFieldAndReIndex(pivotIndex,insertIndex,true);t.addValuesField(true)})};CT_pivotTableDefinition.prototype.addDataFieldAndReIndex=function(pivotIndex,insertIndex,addToHistory){insertIndex=this.addDataField(pivotIndex,insertIndex,true); var reindex=AscCommon.getRangeArray(0,this.getDataFieldsCount());AscCommon.arrayMove(reindex,insertIndex,this.getDataFieldsCount()-1);reindex[this.getDataFieldsCount()-1]=undefined;this.reIndexDataFields(reindex)};CT_pivotTableDefinition.prototype.addDataField=function(pivotIndex,insertIndex,addToHistory){var pivotField=this.asc_getPivotFields()[pivotIndex];pivotField.dataField=true;var newField=new CT_DataField(true);newField.fld=pivotIndex;var cacheField=this.asc_getCacheFields()[pivotIndex];if(cacheField&& cacheField.isSumSubtotal())newField.subtotal=c_oAscDataConsolidateFunction.Sum;else newField.subtotal=c_oAscDataConsolidateFunction.Count;if(!this.dataFields)this.dataFields=new CT_DataFields;var newName=AscCommon.translateManager.getValue(FIELD_CAPTION);newName=newName.replace("%1",ToName_ST_DataConsolidateFunction(newField.subtotal)).replace("%2",this.getPivotFieldName(pivotIndex));if(this.dataFields.checkDuplicateName(newName)){var lastChar=newName.slice(-1);var delimiter="";if("0"<=lastChar&& lastChar<="9")delimiter="_";var index=2;while(this.dataFields.checkDuplicateName(newName+delimiter+index))index++;newName=newName+delimiter+index}newField.name=newName;newField.baseField=0;newField.baseItem=0;insertIndex=this.dataFields.add(newField,insertIndex);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_AddDataField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),pivotIndex,insertIndex)); this.setChanged(true);return insertIndex};CT_pivotTableDefinition.prototype.asc_addRowField=function(api,pivotIndex,insertIndex){var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField&&!pivotField.dragToRow)return;var t=this;api._changePivotWithLock(this,function(){var deleteIndex=t.removeNoDataField(pivotIndex,true);insertIndex=t.checkInsertIndex(insertIndex,deleteIndex);t.addRowField(pivotIndex,insertIndex,true)})};CT_pivotTableDefinition.prototype.addRowField=function(pivotIndex,insertIndex, addToHistory){var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField)pivotField.axis=c_oAscAxis.AxisRow;var newField=new CT_Field;newField.x=pivotIndex;if(!this.rowFields)this.rowFields=new CT_RowFields;insertIndex=this.rowFields.add(newField,insertIndex);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_AddRowField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),pivotIndex,insertIndex)); this.setChanged(true)};CT_pivotTableDefinition.prototype.asc_addColField=function(api,pivotIndex,insertIndex){var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField&&!pivotField.dragToCol)return;var t=this;api._changePivotWithLock(this,function(){var deleteIndex=t.removeNoDataField(pivotIndex,true);insertIndex=t.checkInsertIndex(insertIndex,deleteIndex);t.addColField(pivotIndex,insertIndex,true)})};CT_pivotTableDefinition.prototype.addColField=function(pivotIndex,insertIndex,addToHistory){var pivotField= this.asc_getPivotFields()[pivotIndex];if(pivotField)pivotField.axis=c_oAscAxis.AxisCol;var newField=new CT_Field;newField.x=pivotIndex;if(!this.colFields)this.colFields=new CT_ColFields;insertIndex=this.colFields.add(newField,insertIndex);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_AddColField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),pivotIndex,insertIndex));this.setChanged(true)};CT_pivotTableDefinition.prototype.asc_addPageField= function(api,pivotIndex,insertIndex){var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField&&!pivotField.dragToPage)return;var t=this;api._changePivotWithLock(this,function(){var deleteIndex=t.removeNoDataField(pivotIndex,true);insertIndex=t.checkInsertIndex(insertIndex,deleteIndex);t.addPageField(pivotIndex,insertIndex,true)})};CT_pivotTableDefinition.prototype.addPageField=function(pivotIndex,insertIndex,addToHistory){var pivotField=this.asc_getPivotFields()[pivotIndex];pivotField.axis= c_oAscAxis.AxisPage;var newField=new CT_PageField;newField.fld=pivotIndex;newField.hier=-1;if(!this.pageFields)this.pageFields=new CT_PageFields;insertIndex=this.pageFields.add(newField,insertIndex);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_AddPageField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),pivotIndex,insertIndex));this.setChanged(true)};CT_pivotTableDefinition.prototype.addValuesField= function(addToHistory){var dataPosition;if(this.getDataFieldsCount()>1)if(this.dataOnRows){if(-1===this.getRowFieldsValuesIndex()){this.removeValuesField(addToHistory);if(null!==this.dataPosition&&this.rowFields)if(this.dataPosition<this.rowFields.getCount())dataPosition=this.dataPosition;else this.setDataPosition(null,addToHistory);this.addRowField(st_VALUES,dataPosition,addToHistory)}}else if(-1===this.getColumnFieldsValuesIndex()){this.removeValuesField(addToHistory);if(null!==this.dataPosition&& this.colFields)if(this.dataPosition<this.colFields.getCount())dataPosition=this.dataPosition;else this.setDataPosition(null,addToHistory);this.addColField(st_VALUES,dataPosition,addToHistory)}};CT_pivotTableDefinition.prototype.asc_addField=function(api,index){var cacheField=this.asc_getCacheFields()[index];if(cacheField&&cacheField.isSumSubtotal())this.asc_addDataField(api,index);else this.asc_addRowField(api,index)};CT_pivotTableDefinition.prototype.asc_removeField=function(api,pivotIndex){if(st_VALUES=== pivotIndex)return;var t=this;api._changePivotWithLock(this,function(ws){t.removeNoDataField(pivotIndex,true);t.removeDataFieldAndReIndex(pivotIndex,undefined,true)})};CT_pivotTableDefinition.prototype.asc_removeNoDataField=function(api,pivotIndex){var t=this;api._changePivotWithLock(this,function(ws){if(st_VALUES===pivotIndex){var dataFields=t.asc_getDataFields();if(dataFields)for(var i=dataFields.length-1;i>=0;--i){var dataField=dataFields[i];t.removeDataFieldAndReIndex(dataField.asc_getIndex(), i,true)}}else t.removeNoDataField(pivotIndex,true)})};CT_pivotTableDefinition.prototype.asc_removeDataField=function(api,pivotIndex,dataIndex){if(st_VALUES===pivotIndex)return;var t=this;api._changePivotWithLock(this,function(ws){t.removeDataFieldAndReIndex(pivotIndex,dataIndex,true)})};CT_pivotTableDefinition.prototype.asc_moveToPageField=function(api,pivotIndex,dataIndex){if(st_VALUES===pivotIndex)return;var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField&&!pivotField.dragToPage)return; var t=this;api._changePivotWithLock(this,function(ws){var deleteIndex=t.removeNoDataField(pivotIndex,true);if(undefined===deleteIndex&&undefined!==dataIndex)t.removeDataFieldAndReIndex(pivotIndex,dataIndex,true);t.addPageField(pivotIndex,undefined,true)})};CT_pivotTableDefinition.prototype.asc_moveToRowField=function(api,pivotIndex,dataIndex){var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField&&!pivotField.dragToRow)return;var t=this;api._changePivotWithLock(this,function(ws){if(st_VALUES=== pivotIndex){t.removeValuesField(true);if(t.dataOnRows!==true)t.setDataPosition(null,true);t.setDataOnRows(true,true);t.addValuesField(true)}else{var deleteIndex=t.removeNoDataField(pivotIndex,true);if(undefined===deleteIndex&&undefined!==dataIndex)t.removeDataFieldAndReIndex(pivotIndex,dataIndex,true);t.addRowField(pivotIndex,undefined,true)}})};CT_pivotTableDefinition.prototype.asc_moveToColField=function(api,pivotIndex,dataIndex){var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField&& !pivotField.dragToCol)return;var t=this;api._changePivotWithLock(this,function(ws){if(st_VALUES===pivotIndex){t.removeValuesField(true);if(t.dataOnRows!==false)t.setDataPosition(null,true);t.setDataOnRows(false,true);t.addValuesField(true)}else{var deleteIndex=t.removeNoDataField(pivotIndex,true);if(undefined===deleteIndex&&undefined!==dataIndex)t.removeDataFieldAndReIndex(pivotIndex,dataIndex,true);t.addColField(pivotIndex,undefined,true)}})};CT_pivotTableDefinition.prototype.asc_moveToDataField= function(api,pivotIndex,dataIndex){if(st_VALUES===pivotIndex)return;var pivotField=this.asc_getPivotFields()[pivotIndex];if(pivotField&&!pivotField.dragToData)return;var t=this;api._changePivotWithLock(this,function(ws){var deleteIndex=t.removeNoDataField(pivotIndex,true);if(undefined===deleteIndex&&undefined!==dataIndex)t.removeDataFieldAndReIndex(pivotIndex,dataIndex,true);t.addDataFieldAndReIndex(pivotIndex,undefined,true);t.addValuesField(true)})};CT_pivotTableDefinition.prototype.setDataOnRows= function(newVal,addToHistory){setTableProperty(this,this.dataOnRows,newVal,addToHistory,AscCH.historyitem_PivotTable_SetDataOnRows,true);this.dataOnRows=newVal};CT_pivotTableDefinition.prototype.setDataPosition=function(newVal,addToHistory){setTableProperty(this,this.dataPosition,newVal,addToHistory,AscCH.historyitem_PivotTable_SetDataPosition,true);this.dataPosition=newVal};CT_pivotTableDefinition.prototype.asc_movePageField=function(api,from,to){var t=this;api._changePivotWithLock(this,function(ws){t.moveField(t.asc_getPageFields(), from,to,true,AscCH.historyitem_PivotTable_MovePageField)})};CT_pivotTableDefinition.prototype.asc_moveRowField=function(api,from,to){var t=this;api._changePivotWithLock(this,function(ws){t.moveDataPosition(t.asc_getRowFields(),from,to,true);t.moveField(t.asc_getRowFields(),from,to,true,AscCH.historyitem_PivotTable_MoveRowField)})};CT_pivotTableDefinition.prototype.asc_moveColField=function(api,from,to){var t=this;api._changePivotWithLock(this,function(ws){t.moveDataPosition(t.asc_getColumnFields(), from,to,true);t.moveField(t.asc_getColumnFields(),from,to,true,AscCH.historyitem_PivotTable_MoveColField)})};CT_pivotTableDefinition.prototype.asc_moveDataField=function(api,from,to){var t=this;api._changePivotWithLock(this,function(ws){var dataFields=t.asc_getDataFields();var isMoved=t.moveField(dataFields,from,to,true,AscCH.historyitem_PivotTable_MoveDataField);if(isMoved){var reindex=AscCommon.getRangeArray(0,dataFields.length);AscCommon.arrayMove(reindex,to,from);t.reIndexDataFields(reindex)}})}; CT_pivotTableDefinition.prototype.reIndexDataFields=function(reindex){var i,newIndex;var pivotFields=this.asc_getPivotFields();if(pivotFields)for(i=0;i<pivotFields.length;++i){var pivotField=pivotFields[i];var sortDataIndex=pivotField.getSortDataIndex();if(-1!==sortDataIndex){newIndex=reindex[sortDataIndex];if(newIndex!==sortDataIndex)if(undefined!==newIndex)this.sortPivotItems(i,pivotField.getSortVal(),newIndex);else{this.sortPivotItems(i,c_oAscFieldSortType.Ascending,-1);this.sortPivotItems(i,null, -1)}}}var pivotFilters=this.asc_getPivotFilters();if(pivotFilters)for(i=pivotFilters.length-1;i>=0;--i){var pivotFilter=pivotFilters[i];if(null!==pivotFilter.iMeasureFld){newIndex=reindex[pivotFilter.iMeasureFld];if(newIndex!==pivotFilter.iMeasureFld)if(undefined!==newIndex){var oldVal=pivotFilter.iMeasureFld;pivotFilter.setMeasureFld(newIndex);History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotFilterMeasureFld,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(), i,oldVal,newIndex))}else{pivotFilters.splice(i,1);History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotFilter,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),i,pivotFilter,null))}}}};CT_pivotTableDefinition.prototype.moveDataPosition=function(arr,from,to,addToHistory){if(st_VALUES===arr[from].x)if(to+1<arr.length)this.setDataPosition(to,addToHistory);else this.setDataPosition(null,addToHistory)};CT_pivotTableDefinition.prototype.moveField= function(arr,from,to,addToHistory,historyType){if(arr&&0<=from&&from<arr.length&&0<=to&&to<arr.length){AscCommon.arrayMove(arr,from,to);if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,historyType,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),from,to));this.setChanged(true);return true}return false};CT_pivotTableDefinition.prototype.asc_refresh=function(api){var t=this;var dataRef=t.asc_getDataRef();if(Asc.CT_pivotTableDefinition.prototype.isValidDataRef(dataRef))api._changePivotWithLock(t, function(ws){t.updateCacheData(dataRef)});else api.sendEvent("asc_onError",c_oAscError.ID.PivotLabledColumns,c_oAscError.Level.NoCritical)};CT_pivotTableDefinition.prototype.updateCacheData=function(dataRef){var oldPivot=new AscCommonExcel.UndoRedoData_BinaryWrapper(this);var newCacheDefinition=new CT_PivotCacheDefinition;newCacheDefinition.asc_create();newCacheDefinition.fromDataRef(dataRef);newCacheDefinition.setPivotCacheId(this.cacheDefinition.getPivotCacheId());var pivotFieldsMap=new Map;var newCTPivotFields= new CT_PivotFields;this._updateCacheDataUpdatePivotFieldsIndexes(newCacheDefinition,newCTPivotFields,pivotFieldsMap);var newCTPageFields=null;if(this.asc_getPageFields()){newCTPageFields=new CT_PageFields;this._updateCacheDataUpdatePageDataFieldsIndexes(this.asc_getPageFields(),newCTPageFields.pageField,pivotFieldsMap)}var newCTDataFields=null;if(this.asc_getDataFields()){newCTDataFields=new CT_DataFields;this._updateCacheDataUpdatePageDataFieldsIndexes(this.asc_getDataFields(),newCTDataFields.dataField, pivotFieldsMap)}var newCTPivotFilters=null;if(this.asc_getPivotFilters()){newCTPivotFilters=new CT_PivotFilters;this._updateCacheDataUpdatePageDataFieldsIndexes(this.asc_getPivotFilters(),newCTPivotFilters.filter,pivotFieldsMap)}var newCTRowFields=this._updateCacheDataUpdateRowColFieldsIndexes(this.asc_getRowFields(),new CT_RowFields,newCTDataFields,pivotFieldsMap);var newCTColFields=this._updateCacheDataUpdateRowColFieldsIndexes(this.asc_getColumnFields(),new CT_ColFields,newCTDataFields,pivotFieldsMap); this._updateCacheDataUpdateSlicers(newCacheDefinition,pivotFieldsMap);this.cacheDefinition=newCacheDefinition;this.pivotFields=newCTPivotFields;this.pageFields=newCTPageFields;this.dataFields=newCTDataFields;this.filters=newCTPivotFilters;this.rowFields=newCTRowFields;this.colFields=newCTColFields;this.setChanged(true);var newPivot=new AscCommonExcel.UndoRedoData_BinaryWrapper(this);History.Add(AscCommonExcel.g_oUndoRedoWorksheet,AscCH.historyitem_Worksheet_PivotReplace,this.worksheet.getId(),null, new AscCommonExcel.UndoRedoData_PivotTableRedo(this.Get_Id(),oldPivot,newPivot));this._updateCacheDataUpdateSlicersPost()};CT_pivotTableDefinition.prototype._updateCacheDataUpdatePivotFieldsIndexes=function(newCacheDefinition,newCTPivotFields,pivotFieldsMap){var i;var cacheDefinitionMap=new Map;var newCacheFields=newCacheDefinition.getFields();for(i=0;i<newCacheFields.length;++i)cacheDefinitionMap.set(newCacheFields[i].asc_getName(),i);newCTPivotFields.fillWithEmpty(newCacheFields);var newPivotFields= newCTPivotFields.pivotField;var oldPivotFields=this.asc_getPivotFields();var oldCacheFields=this.cacheDefinition.getFields();for(i=0;i<oldCacheFields.length;++i){var oldPivotField=oldPivotFields[i];var oldCacheField=oldCacheFields[i];var newIndex=cacheDefinitionMap.get(oldCacheField.asc_getName());if(undefined!==newIndex&&oldPivotField){this._updateCacheDataUpdatePivotFieldsIndexesItems(oldCacheField,oldPivotField,newIndex,newCacheDefinition);newPivotFields[newIndex]=oldPivotField;pivotFieldsMap.set(i, newIndex)}}};CT_pivotTableDefinition.prototype._updateCacheDataUpdatePivotFieldsIndexesItems=function(oldCacheField,oldPivotField,newIndex,newCacheDefinition){var newCacheFields=newCacheDefinition.getFields();if(null!==oldPivotField.items&&newCacheFields&&newCacheFields[newIndex])this.checkPivotFieldItem(newIndex,oldPivotField,newCacheDefinition.cacheRecords,newCacheFields[newIndex],oldCacheField)};CT_pivotTableDefinition.prototype._updateCacheDataUpdatePageDataFieldsIndexes=function(oldFields,newFields, pivotFieldsMap){for(var i=0;i<oldFields.length;++i){var oldDataField=oldFields[i];var newIndex=pivotFieldsMap.get(oldDataField.fld);if(undefined!==newIndex){oldDataField.fld=newIndex;newFields.push(oldDataField)}}};CT_pivotTableDefinition.prototype._updateCacheDataUpdateRowColFieldsIndexes=function(oldFields,newCTFields,newCTDataFields,pivotFieldsMap){if(!oldFields)return null;for(var i=0;i<oldFields.length;++i){var oldField=oldFields[i];if(st_VALUES===oldField.x){if(newCTDataFields.getCount()>1)newCTFields.field.push(oldField)}else{var newIndex= pivotFieldsMap.get(oldField.x);if(undefined!==newIndex){oldField.x=newIndex;newCTFields.field.push(oldField)}}}return newCTFields};CT_pivotTableDefinition.prototype._updateCacheDataUpdateSlicers=function(pivotCacheDefinition,pivotFieldsMap){var wb=this.worksheet.workbook;var sheetId=this.worksheet.getId();var pivotName=this.name;var cacheFieldsToDelete={};var oldCacheFields=this.cacheDefinition.getFields();for(var i=0;i<oldCacheFields.length;++i)if(!pivotFieldsMap.has(i))cacheFieldsToDelete[oldCacheFields[i].asc_getName()]= 1;wb.deleteSlicersByPivotTableAndFields(sheetId,pivotName,cacheFieldsToDelete);this.replaceSlicersPivotCacheDefinition(this.cacheDefinition,pivotCacheDefinition)};CT_pivotTableDefinition.prototype._updateCacheDataUpdateSlicersPost=function(){var wb=this.worksheet.workbook;var sheetId=this.worksheet.getId();var pivotName=this.name;this.syncSlicersWithPivot({});wb.slicersUpdateAfterChangePivotTable(sheetId,pivotName)};CT_pivotTableDefinition.prototype.replaceSlicersPivotCacheDefinition=function(oldCacheDefinition, newCacheDefinition){var wb=this.worksheet.workbook;var sheetId=this.worksheet.getId();var pivotName=this.name;var slicerCaches=this.worksheet.workbook.getSlicerCachesByPivotCacheId(oldCacheDefinition.getPivotCacheId());slicerCaches.forEach(function(slicerCache){slicerCache.setPivotCacheDefinition(newCacheDefinition)});wb.slicersUpdateAfterChangePivotTable(sheetId,pivotName)};CT_pivotTableDefinition.prototype.asc_create=function(ws,name,cacheDefinition,bbox){this.worksheet=ws;this.cacheDefinition= cacheDefinition;this.cacheId=null;this.name=name;this.applyNumberFormats=false;this.applyBorderFormats=false;this.applyFontFormats=false;this.applyPatternFormats=false;this.applyAlignmentFormats=false;this.applyWidthHeightFormats=true;this.dataCaption=AscCommon.translateManager.getValue(DATA_CAPTION);this.useAutoFormatting=true;this.itemPrintTitles=true;this.createdVersion=4;this.updatedVersion=4;this.minRefreshableVersion=3;this.indent=0;this.outline=true;this.outlineData=true;this.multipleFieldFilters= false;this.pivotFields=new CT_PivotFields;this.pivotFields.fillWithEmpty(this.cacheDefinition.getFields());this.pivotTableStyleInfo=new CT_PivotTableStyle;this.pivotTableStyleInfo.name=this.worksheet.workbook.TableStyles.DefaultPivotStyle;this.pivotTableStyleInfo.showRowHeaders=true;this.pivotTableStyleInfo.showColHeaders=true;this.pivotTableStyleInfo.showRowStripes=false;this.pivotTableStyleInfo.showColStripes=false;this.pivotTableStyleInfo.showLastColumn=true;this.location=new CT_Location;this.location.ref= bbox;this.updateLocation();this.init()};CT_pivotTableDefinition.prototype.setRowItems=function(rowItems,addToHistory){if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_RowItems,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),this.rowItems,rowItems));this.rowItems=rowItems};CT_pivotTableDefinition.prototype.setColItems=function(colItems,addToHistory){if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables, AscCH.historyitem_PivotTable_ColItems,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),this.colItems,colItems));this.colItems=colItems};CT_pivotTableDefinition.prototype.checkInsertIndex=function(insertIndex,deleteIndex){if(undefined!==insertIndex&&insertIndex>=deleteIndex)insertIndex--;return insertIndex};CT_pivotTableDefinition.prototype.removeValuesField=function(addToHistory){var deleteIndex=this._removeRowField(st_VALUES);if(undefined!== deleteIndex){if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_RemoveRowField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),st_VALUES,deleteIndex));this.setChanged(true)}deleteIndex=this._removeColField(st_VALUES);if(undefined!==deleteIndex){if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_RemoveColField,this.worksheet?this.worksheet.getId():null,null, new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),st_VALUES,deleteIndex));this.setChanged(true)}};CT_pivotTableDefinition.prototype.removeNoDataField=function(pivotIndex,addToHistory){if(st_VALUES===pivotIndex)return this.removeValuesField(addToHistory);var deleteIndex,t=this;var pivotField=this.asc_getPivotFields()[pivotIndex];var historyType;switch(pivotField.axis){case c_oAscAxis.AxisRow:deleteIndex=this._removeRowField(pivotIndex);historyType=AscCH.historyitem_PivotTable_RemoveRowField; break;case c_oAscAxis.AxisCol:deleteIndex=this._removeColField(pivotIndex);historyType=AscCH.historyitem_PivotTable_RemoveColField;break;case c_oAscAxis.AxisPage:deleteIndex=this._removePageField(pivotIndex);historyType=AscCH.historyitem_PivotTable_RemovePageField;break}if(undefined!==deleteIndex){if(addToHistory)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,historyType,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),pivotIndex,deleteIndex)); pivotField.axis=null;this.setChanged(true)}return deleteIndex};CT_pivotTableDefinition.prototype.removeDataFieldAndReIndex=function(pivotIndex,dataIndex,addToHistory){var removed=this.removeDataField(pivotIndex,dataIndex,addToHistory);if(undefined!==removed){var reindex=AscCommon.getRangeArray(0,this.getDataFieldsCount()+removed.length);for(var i=0;i<removed.length;++i){AscCommon.arrayMove(reindex,reindex.length-1,removed[i]+i);reindex[removed[i]+i]=undefined}this.reIndexDataFields(reindex)}};CT_pivotTableDefinition.prototype.removeDataField= function(pivotIndex,dataIndex,addToHistory){var pivotField=this.asc_getPivotFields()[pivotIndex];var removed;if(this.dataFields){removed=this.dataFields.remove(pivotIndex,dataIndex);var dataFieldOldVal=pivotField.dataField;pivotField.dataField=this.dataFields.hasField(pivotIndex);History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotFilterDataField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),pivotIndex,dataFieldOldVal, pivotField.dataField));if(this.dataFields.getCount()<2)this.removeValuesField(addToHistory);if(0===this.dataFields.getCount())this.dataFields=null}if(addToHistory&&undefined!==removed)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_RemoveDataField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),pivotIndex,removed));this.setChanged(true);return removed};CT_pivotTableDefinition.prototype._removeColField=function(fld){if(this.colFields){var deleteIndex= this.colFields.remove(fld);if(this.colFields&&0===this.colFields.getCount())this.colFields=null;return deleteIndex}};CT_pivotTableDefinition.prototype._removeRowField=function(fld){if(this.rowFields){var deleteIndex=this.rowFields.remove(fld);if(this.rowFields&&0===this.rowFields.getCount())this.rowFields=null;return deleteIndex}};CT_pivotTableDefinition.prototype._removePageField=function(fld){if(this.pageFields){var deleteIndex=this.pageFields.remove(fld);if(0===this.pageFields.getCount())this.pageFields= null;return deleteIndex}};CT_pivotTableDefinition.prototype.asc_sortByCell=function(api,type,row,col){if(this.contains(col,row)){var t=this;var layout=t.getLayoutByCell(row,col);if(layout){var fld=layout.getFieldIndex(this);if(null!==fld)this.sortByFieldIndex(api,fld,type,-1)}}else api.sendEvent("asc_onError",c_oAscError.ID.LockedCellPivot,c_oAscError.Level.NoCritical)};CT_pivotTableDefinition.prototype.fillLockInfo=function(lockInfos,collaborativeEditing){var sheetId=this.worksheet.getId();lockInfos.push(collaborativeEditing.getLockInfo(AscCommonExcel.c_oAscLockTypeElem.Sheet, null,sheetId,sheetId))};CT_pivotTableDefinition.prototype.sortByFieldIndex=function(api,fld,type,sortDataIndex){var t=this;api._changePivotWithLock(this,function(ws){t.sortPivotItems(fld,type,sortDataIndex)})};CT_pivotTableDefinition.prototype.sortPivotItems=function(index,type,sortDataIndex){var pivotField=this.asc_getPivotFields()[index];if(!pivotField)return;var pivotFieldOld=pivotField.clone();this._sortPivotItems(index,type,sortDataIndex);History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotField, this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),index,pivotFieldOld,pivotField.clone()));this.setChanged(true)};CT_pivotTableDefinition.prototype._sortPivotItems=function(index,type,sortDataIndex){var pivotField=this.asc_getPivotFields()[index];var cacheField=this.asc_getCacheFields()[index];if(!pivotField||!cacheField)return;pivotField.setSortType(type,sortDataIndex);if(pivotField.sortType!==c_oAscFieldSortType.Manual&&-1===pivotField.getSortDataIndex()){pivotField.removeSubtotal(); pivotField.sortItems(type,cacheField.sharedItems);pivotField.checkSubtotal()}};CT_pivotTableDefinition.prototype.asc_filterByCell=function(api,autoFilterObject,row,col){var t=this;var layout=t.getLayoutByCell(row,col);if(layout){var fld=layout.getFieldIndex(this);if(null!==fld)this.filterByFieldIndex(api,autoFilterObject,fld,false)}};CT_pivotTableDefinition.prototype.filterByFieldIndex=function(api,autoFilterObject,fld,confirmation){var t=this;api._changePivotAndConnectedBySlicerWithLock(this,[fld], function(){History.Create_NewPoint();History.StartTransaction();api.wbModel.dependencyFormulas.lockRecal();var changeRes=api._changePivot(t,confirmation,true,function(ws){t.filterPivotItems(fld,autoFilterObject)});if(c_oAscError.ID.No===changeRes.error&&c_oAscError.ID.No===changeRes.warning){if(changeRes.updateRes)t.syncSlicersWithPivot(changeRes.updateRes.cacheFieldsWithData);changeRes=t.filterPivotSlicers(api,fld,confirmation,changeRes)}api.wbModel.dependencyFormulas.unlockRecal();History.EndTransaction(); api._changePivotEndCheckError(t,changeRes,function(){t.filterByFieldIndex(api,autoFilterObject,fld,true)})})};CT_pivotTableDefinition.prototype.filterPivotSlicers=function(api,fld,confirmation,changeRes){var ws=this.worksheet;var slicerCache=ws.workbook.getSlicerCacheByPivotTableFld(ws.getId(),this.name,fld);if(slicerCache){var pivotField=this.asc_getPivotFields()[fld];var cacheField=this.asc_getCacheFields()[fld];var values=pivotField.getFilterObject(cacheField,null,this.getPivotFieldNum(fld));changeRes= slicerCache.applyPivotFilter(api,values,this,confirmation)}return changeRes};CT_pivotTableDefinition.prototype.filterPivotItems=function(index,autoFilterObject){var filter=autoFilterObject.filter;var pivotObj=autoFilterObject.asc_getPivotObj();var pivotField=this.asc_getPivotFields()[index];var pivotFieldOld=pivotField.clone();if(c_oAscAxis.AxisPage===pivotField.axis&&c_oAscAutoFilterTypes.Filters===filter.type){pivotField.multipleItemSelectionAllowed=pivotObj.isMultipleItemSelectionAllowed;this.filterPivotItemsFilters(index, autoFilterObject.values);var pageFieldItem=null;if(!pivotField.multipleItemSelectionAllowed){var visible=[];autoFilterObject.values.forEach(function(value,index){if(value.visible)visible.push(index)});if(1===visible.length){pageFieldItem=visible[0];pivotField.removeFilter()}else if(visible.length>1)pivotField.multipleItemSelectionAllowed=true}var pageField=this.getPageFieldByFieldIndex(index);if(pageField){var pageFieldItemOld=pageField.item;pageField.item=pageFieldItem;History.Add(AscCommonExcel.g_oUndoRedoPivotTables, AscCH.historyitem_PivotTable_PageFilter,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),index,pageFieldItemOld,pageFieldItem))}}else{var sortDataIndex=-1;if(0<pivotObj.dataFieldIndexSorting&&pivotObj.dataFieldIndexSorting<=this.getDataFieldsCount())sortDataIndex=pivotObj.dataFieldIndexSorting-1;this._sortPivotItems(index,autoFilterObject.sortVal,sortDataIndex);this.removeFilter(index);var iMeasureFld=pivotObj.dataFieldIndexFilter;var pivotFilter= new CT_PivotFilter;switch(filter.type){case c_oAscAutoFilterTypes.Filters:this.filterPivotItemsFilters(index,autoFilterObject.values);break;case c_oAscAutoFilterTypes.CustomFilters:if(0<iMeasureFld&&iMeasureFld<=this.getDataFieldsCount())pivotFilter.initFromCustom(index,filter.filter,iMeasureFld-1);else pivotFilter.initFromCustom(index,filter.filter,null);break;case c_oAscAutoFilterTypes.DynamicFilter:pivotFilter.initFromDynamic(index,filter.filter);break;case c_oAscAutoFilterTypes.Top10:if(0<iMeasureFld&& iMeasureFld<=this.getDataFieldsCount())pivotFilter.initFromTop10(index,filter.filter,pivotObj.isTop10Sum,iMeasureFld-1);break}this.addFilter(pivotFilter)}History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),index,pivotFieldOld,pivotField.clone()));this.setChanged(true)};CT_pivotTableDefinition.prototype.addFilter=function(pivotFilter){if(null!==pivotFilter.type&& Asc.c_oAscPivotFilterType.Unknown!==pivotFilter.type){if(!this.filters)this.filters=new CT_PivotFilters;var insertIndex;if(pivotFilter.isValueFilter()){insertIndex=this.filters.filter.length;this.filters.filter.push(pivotFilter)}else{this.filters.filter.unshift(pivotFilter);insertIndex=0}History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotFilter,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),insertIndex,null, pivotFilter))}};CT_pivotTableDefinition.prototype.asc_removeFilters=function(api){var t=this,i,changeRes;var pivotFields=this.asc_getPivotFields();if(pivotFields){var flds=[];for(i=0;i<pivotFields.length;++i)flds.push(i);this.removeFiltersWithLock(api,flds,false)}};CT_pivotTableDefinition.prototype.removeFiltersWithLock=function(api,flds,confirmation){var t=this,changeRes;api._changePivotAndConnectedBySlicerWithLock(this,flds,function(){History.Create_NewPoint();History.StartTransaction();api.wbModel.dependencyFormulas.lockRecal(); for(var i=0;i<flds.length;++i)if(t.hasFilter(flds[i])){changeRes=t.removeFilterWithSlicer(api,flds[i],confirmation,false);if(c_oAscError.ID.No!==changeRes.error||c_oAscError.ID.No!==changeRes.warning)break}api.wbModel.dependencyFormulas.unlockRecal();History.EndTransaction();api._changePivotEndCheckError(t,changeRes,function(){t.removeFiltersWithLock(api,flds,true)})})};CT_pivotTableDefinition.prototype.asc_removeFilterByCell=function(api,row,col){var t=this;var layout=t.getLayoutByCell(row,col); if(layout){var fld=layout.getFieldIndex(this);if(null!==fld)this.removeFiltersWithLock(api,[fld],false)}};CT_pivotTableDefinition.prototype.removeFilter=function(index,isRemovePageFilter){if(this.filters){var filters=this.filters.filter;for(var i=filters.length-1;i>=0;--i)if(index===filters[i].fld){var pivotFilter=filters[i];filters.splice(i,1);History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotFilter,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(), i,pivotFilter,null))}if(0===filters.length)this.filters=null}var pageField=this.getPageFieldByFieldIndex(index);if(pageField){var pageFieldItemOld=pageField.item;pageField.item=null;History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PageFilter,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),index,pageFieldItemOld,null))}var pivotField=this.asc_getPivotFields()[index];if(pivotField){var pivotFieldOld=pivotField.clone(); pivotField.removeFilter();History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_PivotField,this.worksheet?this.worksheet.getId():null,null,new AscCommonExcel.UndoRedoData_PivotField(this.Get_Id(),index,pivotFieldOld,pivotField.clone()))}this.setChanged(true)};CT_pivotTableDefinition.prototype.removeFilterWithSlicer=function(api,fld,confirmation,updateSelection){var t=this;var changeRes=api._changePivot(this,confirmation,updateSelection,function(){t.removeFilter(fld)});if(c_oAscError.ID.No=== changeRes.error&&c_oAscError.ID.No===changeRes.warning){if(changeRes.updateRes)this.syncSlicersWithPivot(changeRes.updateRes.cacheFieldsWithData);changeRes=this.filterPivotSlicers(api,fld,confirmation,changeRes)}return changeRes};CT_pivotTableDefinition.prototype.removeValueFilters=function(){if(this.filters){var filters=this.filters.filter;for(var i=filters.length-1;i>=0;--i)if(filters[i].isValueFilter())filters.splice(i,1);if(0===filters.length)this.filters=null}};CT_pivotTableDefinition.prototype.hasFilter= function(fld){var autoFilterObject=new Asc.AutoFiltersOptions;this.fillAutoFiltersOptions(autoFilterObject,fld);return autoFilterObject.filter.type!==Asc.c_oAscAutoFilterTypes.None};CT_pivotTableDefinition.prototype.isClearFilterButtonEnabled=function(){var pageFields=this.asc_getPageFields();if(pageFields&&pageFields.length>0)return true;var pivotFilters=this.asc_getPivotFilters();if(pivotFilters&&pivotFilters.length>0)return true;var pivotFields=this.asc_getPivotFields();if(pivotFields)for(var i= 0;i<pivotFields.length;++i)if(!pivotFields[i].isAllVisible())return true;return false};CT_pivotTableDefinition.prototype.filterPivotItemsFilters=function(index,values){var pivotField=this.asc_getPivotFields()[index];pivotField.applyFilterObject(values);this.setChanged(true)};CT_pivotTableDefinition.prototype.getLayoutByCell=function(row,col){var rowFieldsOffset=[];return this.getLayoutByCellPage(row,col)||this.getLayoutByCellHeaderCol(row,col)||this.getLayoutByCellHeaderRow(row,col,rowFieldsOffset)|| this.getLayoutByCellData(row,col,rowFieldsOffset)};CT_pivotTableDefinition.prototype.getLayoutByCellPage=function(row,col){if(this.pageFieldsPositions)for(var i=0;i<this.pageFieldsPositions.length;++i){var pos=this.pageFieldsPositions[i];if(pos.row===row&&(pos.col===col||pos.col+1===col))return PivotLayout.prototype.createPage(pos.pageField.fld)}};CT_pivotTableDefinition.prototype.getLayoutByCellHeaderCol=function(row,col){var location=this.location;if(0===location.firstHeaderRow)return;var pivotRange= this.getRange();var r1=pivotRange.r1;var c1=pivotRange.c1;var rowFields=this.asc_getRowFields();var colFields=this.asc_getColumnFields();var dataFields=this.asc_getDataFields();if(dataFields&&1===dataFields.length){if(rowFields&&!colFields)c1=pivotRange.c1+location.firstDataCol;else if(!rowFields&&colFields)r1=pivotRange.r1+location.firstDataRow;if(r1===row&&c1===col)return PivotLayout.prototype.createHeaderData(0)}if(this.showHeaders&&colFields){r1=pivotRange.r1;c1=pivotRange.c1+location.firstDataCol; if(this.compact){if(r1===row&&c1===col)return PivotLayout.prototype.createHeaderCompact(PivotLayoutType.headerCompactCol)}else for(var i=0;i<colFields.length;++i){var index=colFields[i].asc_getIndex();if(r1===row&&c1===col)return PivotLayout.prototype.createHeaderRowCol(PivotLayoutType.headerCol,index);c1++}}};CT_pivotTableDefinition.prototype.getLayoutByCellHeaderRow=function(row,col,rowFieldsOffset){rowFieldsOffset.push(0);var rowFields=this.asc_getRowFields();if(!rowFields)return;var index,field; var pivotFields=this.asc_getPivotFields();var pivotRange=this.getRange();var location=this.location;var c1=pivotRange.c1;var r1=pivotRange.r1+location.firstDataRow-1;if(this.showHeaders&&r1===row&&c1===col)if(this.compact||location.firstDataCol!==rowFields.length)if(1===rowFields.length&&AscCommonExcel.st_VALUES===rowFields[0].asc_getIndex())return PivotLayout.prototype.createHeaderData();else return PivotLayout.prototype.createHeaderCompact(PivotLayoutType.headerCompactRow,index);else{index=rowFields[0].asc_getIndex(); return PivotLayout.prototype.createHeaderRowCol(PivotLayoutType.headerRow,index)}for(var i=1;i<rowFields.length;++i){index=rowFields[i-1].asc_getIndex();var isTabular;if(AscCommonExcel.st_VALUES!==index){field=pivotFields[index];isTabular=field&&!(field.compact&&field.outline)}else isTabular=!(this.compact&&this.outline);if(isTabular){index=rowFields[i].asc_getIndex();++c1;if(this.showHeaders&&r1===row&&c1===col)return PivotLayout.prototype.createHeaderRowCol(PivotLayoutType.headerRow,index)}rowFieldsOffset[c1- pivotRange.c1]=i}};CT_pivotTableDefinition.prototype.getLayoutByCellData=function(row,col,rowFieldsOffset){var pivotRange=this.getRange();var location=this.location;var rowHeader=pivotRange.r1+location.firstHeaderRow;var rowDataStart=pivotRange.r1+location.firstDataRow;var rowDataEnd=pivotRange.r2;var rowFields=this.asc_getRowFields();var rowItems=this.getRowItems();var rows=this._getLayoutByCellItems(row,rowHeader,rowDataStart,rowDataEnd,rowFields,rowItems);var colHeader=pivotRange.c1;var colDataStart= pivotRange.c1+location.firstDataCol;var colDataEnd=pivotRange.c2;var colFields=this.asc_getColumnFields();var colItems=this.getColItems();var cols=this._getLayoutByCellItems(col,colHeader,colDataStart,colDataEnd,colFields,colItems);return PivotLayout.prototype.createCell(rows,cols,row-rowHeader+1,rowFieldsOffset&&rowFieldsOffset[col-colHeader]+1)};CT_pivotTableDefinition.prototype._getLayoutByCellItems=function(index,indexHeader,indexDataStart,indexDataEnd,fields,items){if(index<indexDataStart||index> indexDataEnd||!fields||!items)return;var res=null;if(index>=indexDataStart){res=[];var itemIndex=index-indexDataStart;var item=items[itemIndex];if(item){var r=item.r;this._getLayoutByCellItem(r,item.x.length,item,fields,res);while(r>0&&--itemIndex>=0){var prevItem=items[itemIndex];var prevR=prevItem.r;this._getLayoutByCellItem(prevR,r-prevR,prevItem,fields,res);r=Math.min(r,prevR)}}}return res};CT_pivotTableDefinition.prototype._getLayoutByCellItem=function(r,len,item,fields,res){for(var i=0;i<Math.min(item.x.length, len);++i){var fieldIndex=fields[r+i].asc_getIndex();res[r+i]=new PivotLayoutCell(item.t,fieldIndex,item.x[i].getV(),item.i)}};CT_pivotTableDefinition.prototype.updateSelection=function(wsView){var ws=this.worksheet;var activeCell=ws.selectionRange.activeCell;if(!this.contains(activeCell.col,activeCell.row)){var pivotRange=this.getRange();var selection=new Asc.Range(pivotRange.c1,pivotRange.r1,pivotRange.c1,pivotRange.r1);wsView.setSelection(selection);wsView.workbook._onWSSelectionChanged();History.SetSelectionRedo(selection)}}; CT_pivotTableDefinition.prototype.hasLeftAlignInRowLables=function(){var i,index;var rowFields=this.asc_getRowFields();var pivotFields=this.asc_getPivotFields();if(rowFields&&pivotFields)if(this.compact)return!rowFields.every(function(rowField){index=rowField.asc_getIndex();return st_VALUES===index||false===pivotFields[index].outline});else return rowFields.some(function(rowField){index=rowField.asc_getIndex();return st_VALUES!==index&&true===pivotFields[index].compact});return false};CT_pivotTableDefinition.prototype.getPivotTablesConnectedBySlicer= function(fld){var res=[];var ws=this.worksheet;var slicerCache=ws.workbook.getSlicerCacheByPivotTableFld(ws.getId(),this.name,fld);if(slicerCache)res=res.concat(slicerCache.getPivotTables());return res};function CT_pivotTableDefinitionX14(){this.fillDownLabelsDefault=false;this.visualTotalsForSets=false;this.calculatedMembersInFilters=false;this.altText=null;this.altTextSummary=null;this.enableEdit=false;this.autoApply=false;this.allocationMethod=c_oAscAllocationMethod.EqualAllocation;this.weightExpression= null;this.hideValuesRow=false}CT_pivotTableDefinitionX14.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["fillDownLabelsDefault"];if(undefined!==val)this.fillDownLabelsDefault=AscCommon.getBoolFromXml(val);val=vals["visualTotalsForSets"];if(undefined!==val)this.visualTotalsForSets=AscCommon.getBoolFromXml(val);val=vals["calculatedMembersInFilters"];if(undefined!==val)this.calculatedMembersInFilters=AscCommon.getBoolFromXml(val);val=vals["altText"];if(undefined!== val)this.altText=AscCommon.unleakString(uq(val));val=vals["altTextSummary"];if(undefined!==val)this.altTextSummary=AscCommon.unleakString(uq(val));val=vals["enableEdit"];if(undefined!==val)this.enableEdit=AscCommon.getBoolFromXml(val);val=vals["autoApply"];if(undefined!==val)this.autoApply=AscCommon.getBoolFromXml(val);val=vals["allocationMethod"];if(undefined!==val){val=FromXml_ST_AllocationMethod(val);if(-1!==val)this.allocationMethod=val}val=vals["weightExpression"];if(undefined!==val)this.weightExpression= AscCommon.unleakString(uq(val));val=vals["hideValuesRow"];if(undefined!==val)this.hideValuesRow=AscCommon.getBoolFromXml(val)}};CT_pivotTableDefinitionX14.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotTableDefinition"===elem){if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else newContext=null;return newContext};CT_pivotTableDefinitionX14.prototype.toXml=function(writer){writer.WriteXmlNodeStart("x14:pivotTableDefinition");writer.WriteXmlString(' xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"'); if(false!==this.fillDownLabelsDefault)writer.WriteXmlAttributeBool("fillDownLabelsDefault",this.fillDownLabelsDefault);if(false!==this.visualTotalsForSets)writer.WriteXmlAttributeBool("visualTotalsForSets",this.visualTotalsForSets);if(false!==this.calculatedMembersInFilters)writer.WriteXmlAttributeBool("calculatedMembersInFilters",this.calculatedMembersInFilters);if(null!==this.altText)writer.WriteXmlAttributeStringEncode("altText",this.altText);if(null!==this.altTextSummary)writer.WriteXmlAttributeStringEncode("altTextSummary", this.altTextSummary);if(false!==this.enableEdit)writer.WriteXmlAttributeBool("enableEdit",this.enableEdit);if(false!==this.autoApply)writer.WriteXmlAttributeBool("autoApply",this.autoApply);if(c_oAscAllocationMethod.EqualAllocation!==this.allocationMethod)writer.WriteXmlAttributeStringEncode("allocationMethod",ToXml_ST_AllocationMethod(this.allocationMethod));if(null!==this.weightExpression)writer.WriteXmlAttributeStringEncode("weightExpression",this.weightExpression);if(false!==this.hideValuesRow)writer.WriteXmlAttributeBool("hideValuesRow", this.hideValuesRow);writer.WriteXmlNodeEnd("x14:pivotTableDefinition",true,true)};function CT_CacheSource(){this.type=null;this.connectionId=0;this.consolidation=null;this.extLst=null;this.worksheetSource=null}CT_CacheSource.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["type"];if(undefined!==val){val=FromXml_ST_SourceType(val);if(-1!==val)this.type=val}val=vals["connectionId"];if(undefined!==val)this.connectionId=val-0}};CT_CacheSource.prototype.onStartNode= function(elem,attr,uq){var newContext=this;if("consolidation"===elem){newContext=new CT_Consolidation;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.consolidation=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else if("worksheetSource"===elem){newContext=new CT_WorksheetSource;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.worksheetSource=newContext}else newContext= null;return newContext};CT_CacheSource.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.type)writer.WriteXmlAttributeStringEncode("type",ToXml_ST_SourceType(this.type));if(0!==this.connectionId)writer.WriteXmlAttributeNumber("connectionId",this.connectionId);writer.WriteXmlNodeEnd(name,true);if(null!==this.consolidation)this.consolidation.toXml(writer,"consolidation");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");if(null!==this.worksheetSource)this.worksheetSource.toXml(writer, "worksheetSource");writer.WriteXmlNodeEnd(name)};function CT_CacheFields(){this.cacheField=[]}CT_CacheFields.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("cacheField"===elem){newContext=new CT_CacheField;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.cacheField.push(newContext)}else newContext=null;return newContext};CT_CacheFields.prototype.toXml=function(writer,name,stylesForWrite){writer.WriteXmlNodeStart(name);if(this.cacheField.length>0)writer.WriteXmlAttributeNumber("count", this.cacheField.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.cacheField.length;++i){var elem=this.cacheField[i];elem.toXml(writer,"cacheField",stylesForWrite)}writer.WriteXmlNodeEnd(name)};function CT_CacheHierarchies(){this.cacheHierarchy=[]}CT_CacheHierarchies.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("cacheHierarchy"===elem){newContext=new CT_CacheHierarchy;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.cacheHierarchy.push(newContext)}else newContext= null;return newContext};CT_CacheHierarchies.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.cacheHierarchy.length>0)writer.WriteXmlAttributeNumber("count",this.cacheHierarchy.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.cacheHierarchy.length;++i){var elem=this.cacheHierarchy[i];elem.toXml(writer,"cacheHierarchy")}writer.WriteXmlNodeEnd(name)};function CT_PCDKPIs(){this.kpi=[]}CT_PCDKPIs.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("kpi"=== elem){newContext=new CT_PCDKPI;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.kpi.push(newContext)}else newContext=null;return newContext};CT_PCDKPIs.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.kpi.length>0)writer.WriteXmlAttributeNumber("count",this.kpi.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.kpi.length;++i){var elem=this.kpi[i];elem.toXml(writer,"kpi")}writer.WriteXmlNodeEnd(name)};function CT_TupleCache(){this.entries= null;this.sets=null;this.queryCache=null;this.serverFormats=null;this.extLst=null}CT_TupleCache.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("entries"===elem){newContext=new CT_PCDSDTCEntries;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.entries=newContext}else if("sets"===elem){newContext=new CT_Sets;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.sets=newContext}else if("queryCache"===elem){newContext=new CT_QueryCache;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.queryCache=newContext}else if("serverFormats"===elem){newContext=new CT_ServerFormats;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.serverFormats=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_TupleCache.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);writer.WriteXmlNodeEnd(name,true);if(null!==this.entries)this.entries.toXml(writer, "entries");if(null!==this.sets)this.sets.toXml(writer,"sets");if(null!==this.queryCache)this.queryCache.toXml(writer,"queryCache");if(null!==this.serverFormats)this.serverFormats.toXml(writer,"serverFormats");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_CalculatedItems(){this.calculatedItem=[]}CT_CalculatedItems.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("calculatedItem"===elem){newContext=new CT_CalculatedItem;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.calculatedItem.push(newContext)}else newContext=null;return newContext};CT_CalculatedItems.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.calculatedItem.length>0)writer.WriteXmlAttributeNumber("count",this.calculatedItem.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.calculatedItem.length;++i){var elem=this.calculatedItem[i];elem.toXml(writer,"calculatedItem")}writer.WriteXmlNodeEnd(name)};function CT_CalculatedMembers(){this.calculatedMember=[]} CT_CalculatedMembers.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("calculatedMember"===elem){newContext=new CT_CalculatedMember;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.calculatedMember.push(newContext)}else newContext=null;return newContext};CT_CalculatedMembers.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.calculatedMember.length>0)writer.WriteXmlAttributeNumber("count",this.calculatedMember.length>0);writer.WriteXmlNodeEnd(name, true);for(var i=0;i<this.calculatedMember.length;++i){var elem=this.calculatedMember[i];elem.toXml(writer,"calculatedMember")}writer.WriteXmlNodeEnd(name)};function CT_Dimensions(){this.dimension=[]}CT_Dimensions.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("dimension"===elem){newContext=new CT_PivotDimension;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.dimension.push(newContext)}else newContext=null;return newContext};CT_Dimensions.prototype.toXml=function(writer, name){writer.WriteXmlNodeStart(name);if(this.dimension.length>0)writer.WriteXmlAttributeNumber("count",this.dimension.length>0);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.dimension.length;++i){var elem=this.dimension[i];elem.toXml(writer,"dimension")}writer.WriteXmlNodeEnd(name)};function CT_MeasureGroups(){this.measureGroup=[]}CT_MeasureGroups.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("measureGroup"===elem){newContext=new CT_MeasureGroup;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.measureGroup.push(newContext)}else newContext=null;return newContext};CT_MeasureGroups.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.measureGroup.length>0)writer.WriteXmlAttributeNumber("count",this.measureGroup.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.measureGroup.length;++i){var elem=this.measureGroup[i];elem.toXml(writer,"measureGroup")}writer.WriteXmlNodeEnd(name)};function CT_MeasureDimensionMaps(){this.map=[]}CT_MeasureDimensionMaps.prototype.onStartNode= function(elem,attr,uq){var newContext=this;if("map"===elem){newContext=new CT_MeasureDimensionMap;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.map.push(newContext)}else newContext=null;return newContext};CT_MeasureDimensionMaps.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.map.length>0)writer.WriteXmlAttributeNumber("count",this.map.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.map.length;++i){var elem=this.map[i];elem.toXml(writer, "map")}writer.WriteXmlNodeEnd(name)};function CT_ExtensionList(){this.ext=[]}CT_ExtensionList.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("ext"===elem){newContext=new CT_Extension;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.ext.push(newContext)}else newContext=null;return newContext};CT_ExtensionList.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.ext.length;++i){var elem=this.ext[i]; elem.toXml(writer,"ext")}writer.WriteXmlNodeEnd(name)};function CT_Boolean(){this.v=null;this.u=null;this.f=null;this.c=null;this.cp=null;this.x=[]}CT_Boolean.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["v"];if(undefined!==val)this.v=AscCommon.getBoolFromXml(val);val=vals["u"];if(undefined!==val)this.u=AscCommon.getBoolFromXml(val);val=vals["f"];if(undefined!==val)this.f=AscCommon.getBoolFromXml(val);val=vals["c"];if(undefined!==val)this.c=AscCommon.unleakString(uq(val)); val=vals["cp"];if(undefined!==val)this.cp=val-0}};CT_Boolean.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("x"===elem){newContext=new CT_X;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else newContext=null;return newContext};CT_Boolean.prototype.toXml=function(writer,name){this.toXml2(writer,name,this.v,this)};CT_Boolean.prototype.toXml2=function(writer,name,val,obj){writer.WriteXmlNodeStart(name);if(null!==val)writer.WriteXmlAttributeBool("v", val);if(obj){if(null!==obj.u)writer.WriteXmlAttributeBool("u",obj.u);if(null!==obj.f)writer.WriteXmlAttributeBool("f",obj.f);if(null!==obj.c)writer.WriteXmlAttributeStringEncode("c",obj.c);if(null!==obj.cp)writer.WriteXmlAttributeNumber("cp",obj.cp);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<obj.x.length;++i){var elem=obj.x[i];elem.toXml(writer,"x")}}else writer.WriteXmlNodeEnd(name,true);writer.WriteXmlNodeEnd(name)};CT_Boolean.prototype.isSimpleValue=function(){return null===this.u&&null=== this.f&&null===this.c&&null===this.cp&&0===this.x.length};CT_Boolean.prototype.clean=function(){this.v=null;this.u=null;this.f=null;this.c=null;this.cp=null;this.x=[]};function CT_DateTime(){this.v=null;this.u=null;this.f=null;this.c=null;this.cp=null;this.x=[]}CT_DateTime.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["v"];if(undefined!==val){var d=new Asc.cDate(uq(val));this.v=(new Asc.cDate(Date.UTC(d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(), d.getSeconds(),d.getMilliseconds()))).getExcelDateWithTime()}val=vals["u"];if(undefined!==val)this.u=AscCommon.getBoolFromXml(val);val=vals["f"];if(undefined!==val)this.f=AscCommon.getBoolFromXml(val);val=vals["c"];if(undefined!==val)this.c=AscCommon.unleakString(uq(val));val=vals["cp"];if(undefined!==val)this.cp=val-0}};CT_DateTime.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("x"===elem){newContext=new CT_X;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else newContext= null;return newContext};CT_DateTime.prototype.toXml=function(writer,name){this.toXml2(writer,name,this.v,this)};CT_DateTime.prototype.toXml2=function(writer,name,val,obj){writer.WriteXmlNodeStart(name);if(null!==val)writer.WriteXmlAttributeStringEncode("v",Asc.cDate.prototype.getDateFromExcelWithTime(val).toISOString().slice(0,19));if(obj){if(null!==obj.u)writer.WriteXmlAttributeBool("u",obj.u);if(null!==obj.f)writer.WriteXmlAttributeBool("f",obj.f);if(null!==obj.c)writer.WriteXmlAttributeStringEncode("c", obj.c);if(null!==obj.cp)writer.WriteXmlAttributeNumber("cp",obj.cp);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<obj.x.length;++i){var elem=obj.x[i];elem.toXml(writer,"x")}}else writer.WriteXmlNodeEnd(name,true);writer.WriteXmlNodeEnd(name)};CT_DateTime.prototype.isSimpleValue=function(){return null===this.u&&null===this.f&&null===this.c&&null===this.cp&&0===this.x.length};CT_DateTime.prototype.clean=function(){this.v=null;this.u=null;this.f=null;this.c=null;this.cp=null;this.x=[]};function CT_Error(){this.v= null;this.u=null;this.f=null;this.c=null;this.cp=null;this.in=null;this.bc=null;this.fc=null;this.i=false;this.un=false;this.st=false;this.b=false;this.tpls=[];this.x=[]}CT_Error.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["v"];if(undefined!==val)this.v=AscCommonExcel.cError.prototype.getErrorTypeFromString(uq(val));val=vals["u"];if(undefined!==val)this.u=AscCommon.getBoolFromXml(val);val=vals["f"];if(undefined!==val)this.f=AscCommon.getBoolFromXml(val); val=vals["c"];if(undefined!==val)this.c=AscCommon.unleakString(uq(val));val=vals["cp"];if(undefined!==val)this.cp=val-0;val=vals["in"];if(undefined!==val)this.in=val-0;val=vals["bc"];if(undefined!==val)this.bc=val-0;val=vals["fc"];if(undefined!==val)this.fc=val-0;val=vals["i"];if(undefined!==val)this.i=AscCommon.getBoolFromXml(val);val=vals["un"];if(undefined!==val)this.un=AscCommon.getBoolFromXml(val);val=vals["st"];if(undefined!==val)this.st=AscCommon.getBoolFromXml(val);val=vals["b"];if(undefined!== val)this.b=AscCommon.getBoolFromXml(val)}};CT_Error.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("tpls"===elem){newContext=new CT_Tuples;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.tpls.push(newContext)}else if("x"===elem){newContext=new CT_X;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else newContext=null;return newContext};CT_Error.prototype.toXml=function(writer,name){this.toXml2(writer,name,this.v,this)}; CT_Error.prototype.toXml2=function(writer,name,val,obj){writer.WriteXmlNodeStart(name);if(null!==val)writer.WriteXmlAttributeStringEncode("v",AscCommonExcel.cError.prototype.getStringFromErrorType(val));if(obj){if(null!==obj.u)writer.WriteXmlAttributeBool("u",obj.u);if(null!==obj.f)writer.WriteXmlAttributeBool("f",obj.f);if(null!==obj.c)writer.WriteXmlAttributeStringEncode("c",obj.c);if(null!==obj.cp)writer.WriteXmlAttributeNumber("cp",obj.cp);if(null!==obj.in)writer.WriteXmlAttributeNumber("in", obj.in);if(null!==obj.bc)writer.WriteXmlAttributeNumber("bc",obj.bc);if(null!==obj.fc)writer.WriteXmlAttributeNumber("fc",obj.fc);if(false!==obj.i)writer.WriteXmlAttributeBool("i",obj.i);if(false!==obj.un)writer.WriteXmlAttributeBool("un",obj.un);if(false!==obj.st)writer.WriteXmlAttributeBool("st",obj.st);if(false!==obj.b)writer.WriteXmlAttributeBool("b",obj.b);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<obj.tpls.length;++i){var elem=obj.tpls[i];elem.toXml(writer,"tpls")}for(var i=0;i<obj.x.length;++i){var elem= obj.x[i];elem.toXml(writer,"x")}}else writer.WriteXmlNodeEnd(name,true);writer.WriteXmlNodeEnd(name)};CT_Error.prototype.isSimpleValue=function(){return null===this.u&&null===this.f&&null===this.c&&null===this.cp&&null===this.in&&null===this.bc&&null===this.fc&&null===this.i&&null===this.un&&null===this.st&&null===this.b&&null===0===this.tpls.length&&0===this.x.length};CT_Error.prototype.clean=function(){this.v=null;this.u=null;this.f=null;this.c=null;this.cp=null;this.in=null;this.bc=null;this.fc= null;this.i=false;this.un=false;this.st=false;this.b=false;this.tpls=[];this.x=[]};function CT_Missing(){this.u=null;this.f=null;this.c=null;this.cp=null;this.in=null;this.bc=null;this.fc=null;this.i=false;this.un=false;this.st=false;this.b=false;this.tpls=[];this.x=[]}CT_Missing.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["u"];if(undefined!==val)this.u=AscCommon.getBoolFromXml(val);val=vals["f"];if(undefined!==val)this.f=AscCommon.getBoolFromXml(val);val= vals["c"];if(undefined!==val)this.c=AscCommon.unleakString(uq(val));val=vals["cp"];if(undefined!==val)this.cp=val-0;val=vals["in"];if(undefined!==val)this.in=val-0;val=vals["bc"];if(undefined!==val)this.bc=val-0;val=vals["fc"];if(undefined!==val)this.fc=val-0;val=vals["i"];if(undefined!==val)this.i=AscCommon.getBoolFromXml(val);val=vals["un"];if(undefined!==val)this.un=AscCommon.getBoolFromXml(val);val=vals["st"];if(undefined!==val)this.st=AscCommon.getBoolFromXml(val);val=vals["b"];if(undefined!== val)this.b=AscCommon.getBoolFromXml(val)}};CT_Missing.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("tpls"===elem){newContext=new CT_Tuples;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.tpls.push(newContext)}else if("x"===elem){newContext=new CT_X;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else newContext=null;return newContext};CT_Missing.prototype.toXml=function(writer,name){this.toXml2(writer,name,this)}; CT_Missing.prototype.toXml2=function(writer,name,obj){writer.WriteXmlNodeStart(name);if(obj){if(null!==obj.u)writer.WriteXmlAttributeBool("u",obj.u);if(null!==obj.f)writer.WriteXmlAttributeBool("f",obj.f);if(null!==obj.c)writer.WriteXmlAttributeStringEncode("c",obj.c);if(null!==obj.cp)writer.WriteXmlAttributeNumber("cp",obj.cp);if(null!==obj.in)writer.WriteXmlAttributeNumber("in",obj.in);if(null!==obj.bc)writer.WriteXmlAttributeNumber("bc",obj.bc);if(null!==obj.fc)writer.WriteXmlAttributeNumber("fc", obj.fc);if(false!==obj.i)writer.WriteXmlAttributeBool("i",obj.i);if(false!==obj.un)writer.WriteXmlAttributeBool("un",obj.un);if(false!==obj.st)writer.WriteXmlAttributeBool("st",obj.st);if(false!==obj.b)writer.WriteXmlAttributeBool("b",obj.b);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<obj.tpls.length;++i){var elem=obj.tpls[i];elem.toXml(writer,"tpls")}for(var i=0;i<obj.x.length;++i){var elem=obj.x[i];elem.toXml(writer,"x")}}else writer.WriteXmlNodeEnd(name,true);writer.WriteXmlNodeEnd(name)}; CT_Missing.prototype.isSimpleValue=function(){return null===this.u&&null===this.f&&null===this.c&&null===this.cp&&null===this.in&&null===this.bc&&null===this.fc&&null===this.i&&null===this.un&&null===this.st&&null===this.b&&0===this.tpls.length&&0===this.x.length};CT_Missing.prototype.clean=function(){this.v=null;this.u=null;this.f=null;this.c=null;this.cp=null;this.in=null;this.bc=null;this.fc=null;this.i=false;this.un=false;this.st=false;this.b=false;this.tpls=[];this.x=[]};function CT_Number(){this.v= null;this.u=null;this.f=null;this.c=null;this.cp=null;this.in=null;this.bc=null;this.fc=null;this.i=false;this.un=false;this.st=false;this.b=false;this.tpls=[];this.x=[];this.realNumber=null}CT_Number.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["v"];if(undefined!==val)this.v=val-0;val=vals["u"];if(undefined!==val)this.u=AscCommon.getBoolFromXml(val);val=vals["f"];if(undefined!==val)this.f=AscCommon.getBoolFromXml(val);val=vals["c"];if(undefined!==val)this.c= AscCommon.unleakString(uq(val));val=vals["cp"];if(undefined!==val)this.cp=val-0;val=vals["in"];if(undefined!==val)this.in=val-0;val=vals["bc"];if(undefined!==val)this.bc=val-0;val=vals["fc"];if(undefined!==val)this.fc=val-0;val=vals["i"];if(undefined!==val)this.i=AscCommon.getBoolFromXml(val);val=vals["un"];if(undefined!==val)this.un=AscCommon.getBoolFromXml(val);val=vals["st"];if(undefined!==val)this.st=AscCommon.getBoolFromXml(val);val=vals["b"];if(undefined!==val)this.b=AscCommon.getBoolFromXml(val)}}; CT_Number.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("tpls"===elem){newContext=new CT_Tuples;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.tpls.push(newContext)}else if("x"===elem){newContext=new CT_X;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else newContext=null;return newContext};CT_Number.prototype.toXml=function(writer,name){this.toXml2(writer,name,this.v,this)};CT_Number.prototype.toXml2=function(writer, name,val,obj){writer.WriteXmlNodeStart(name);if(null!==val)writer.WriteXmlAttributeNumber("v",val);if(obj){if(null!==obj.u)writer.WriteXmlAttributeBool("u",obj.u);if(null!==obj.f)writer.WriteXmlAttributeBool("f",obj.f);if(null!==obj.c)writer.WriteXmlAttributeStringEncode("c",obj.c);if(null!==obj.cp)writer.WriteXmlAttributeNumber("cp",obj.cp);if(null!==obj.in)writer.WriteXmlAttributeNumber("in",obj.in);if(null!==obj.bc)writer.WriteXmlAttributeNumber("bc",obj.bc);if(null!==obj.fc)writer.WriteXmlAttributeNumber("fc", obj.fc);if(false!==obj.i)writer.WriteXmlAttributeBool("i",obj.i);if(false!==obj.un)writer.WriteXmlAttributeBool("un",obj.un);if(false!==obj.st)writer.WriteXmlAttributeBool("st",obj.st);if(false!==obj.b)writer.WriteXmlAttributeBool("b",obj.b);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<obj.tpls.length;++i){var elem=obj.tpls[i];elem.toXml(writer,"tpls")}for(var i=0;i<obj.x.length;++i){var elem=obj.x[i];elem.toXml(writer,"x")}}else writer.WriteXmlNodeEnd(name,true);writer.WriteXmlNodeEnd(name)}; CT_Number.prototype.isSimpleValue=function(){return null===this.u&&null===this.f&&null===this.c&&null===this.cp&&null===this.in&&null===this.bc&&null===this.fc&&null===this.i&&null===this.un&&null===this.st&&null===this.b&&0===this.tpls.length&&0===this.x.length};CT_Number.prototype.clean=function(){this.v=null;this.u=null;this.f=null;this.c=null;this.cp=null;this.in=null;this.bc=null;this.fc=null;this.i=false;this.un=false;this.st=false;this.b=false;this.tpls=[];this.x=[]};function CT_String(){this.v= null;this.u=null;this.f=null;this.c=null;this.cp=null;this.in=null;this.bc=null;this.fc=null;this.i=false;this.un=false;this.st=false;this.b=false;this.tpls=[];this.x=[]}CT_String.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["v"];if(undefined!==val)this.v=AscCommon.unleakString(uq(val));val=vals["u"];if(undefined!==val)this.u=AscCommon.getBoolFromXml(val);val=vals["f"];if(undefined!==val)this.f=AscCommon.getBoolFromXml(val);val=vals["c"];if(undefined!==val)this.c= AscCommon.unleakString(uq(val));val=vals["cp"];if(undefined!==val)this.cp=val-0;val=vals["in"];if(undefined!==val)this.in=val-0;val=vals["bc"];if(undefined!==val)this.bc=val-0;val=vals["fc"];if(undefined!==val)this.fc=val-0;val=vals["i"];if(undefined!==val)this.i=AscCommon.getBoolFromXml(val);val=vals["un"];if(undefined!==val)this.un=AscCommon.getBoolFromXml(val);val=vals["st"];if(undefined!==val)this.st=AscCommon.getBoolFromXml(val);val=vals["b"];if(undefined!==val)this.b=AscCommon.getBoolFromXml(val)}}; CT_String.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("tpls"===elem){newContext=new CT_Tuples;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.tpls.push(newContext)}else if("x"===elem){newContext=new CT_X;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else newContext=null;return newContext};CT_String.prototype.toXml=function(writer,name){this.toXml2(writer,name,this.v,this)};CT_String.prototype.toXml2=function(writer, name,val,obj){writer.WriteXmlNodeStart(name);if(null!==val)writer.WriteXmlAttributeStringEncode("v",val);if(obj){if(null!==obj.u)writer.WriteXmlAttributeBool("u",obj.u);if(null!==obj.f)writer.WriteXmlAttributeBool("f",obj.f);if(null!==obj.c)writer.WriteXmlAttributeStringEncode("c",obj.c);if(null!==obj.cp)writer.WriteXmlAttributeNumber("cp",obj.cp);if(null!==obj.in)writer.WriteXmlAttributeNumber("in",obj.in);if(null!==obj.bc)writer.WriteXmlAttributeNumber("bc",obj.bc);if(null!==obj.fc)writer.WriteXmlAttributeNumber("fc", obj.fc);if(false!==obj.i)writer.WriteXmlAttributeBool("i",obj.i);if(false!==obj.un)writer.WriteXmlAttributeBool("un",obj.un);if(false!==obj.st)writer.WriteXmlAttributeBool("st",obj.st);if(false!==obj.b)writer.WriteXmlAttributeBool("b",obj.b);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<obj.tpls.length;++i){var elem=obj.tpls[i];elem.toXml(writer,"tpls")}for(var i=0;i<obj.x.length;++i){var elem=obj.x[i];elem.toXml(writer,"x")}}else writer.WriteXmlNodeEnd(name,true);writer.WriteXmlNodeEnd(name)}; CT_String.prototype.isSimpleValue=function(){return null===this.u&&null===this.f&&null===this.c&&null===this.cp&&null===this.in&&null===this.bc&&null===this.fc&&null===this.i&&null===this.un&&null===this.st&&null===this.b&&0===this.tpls.length&&0===this.x.length};CT_String.prototype.clean=function(){this.v=null;this.u=null;this.f=null;this.c=null;this.cp=null;this.in=null;this.bc=null;this.fc=null;this.i=false;this.un=false;this.st=false;this.b=false;this.tpls=[];this.x=[]};function CT_Index(){this.v= null}CT_Index.prototype.clone=function(){var res=new CT_Index;res.v=this.v;return res};CT_Index.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["v"];if(undefined!==val)this.v=val-0}};CT_Index.prototype.toXml=function(writer,name){this.toXml2(writer,name,this.v)};CT_Index.prototype.toXml2=function(writer,name,val){writer.WriteXmlNodeStart(name);if(null!==val)writer.WriteXmlAttributeNumber("v",val);writer.WriteXmlNodeEnd(name,true,true)};CT_Index.prototype.isSimpleValue= function(){return true};CT_Index.prototype.clean=function(){this.v=null};function CT_Location(){this.ref=null;this.firstHeaderRow=null;this.firstDataRow=null;this.firstDataCol=null;this.rowPageCount=0;this.colPageCount=0}CT_Location.prototype.clone=function(){var res=new CT_Location;res.ref=this.ref?this.ref.clone():this.ref;res.firstHeaderRow=this.firstHeaderRow;res.firstDataRow=this.firstDataRow;res.firstDataCol=this.firstDataCol;res.rowPageCount=this.rowPageCount;res.colPageCount=this.colPageCount; return res};CT_Location.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["ref"];if(undefined!==val)this.ref=AscCommonExcel.g_oRangeCache.getAscRange(uq(val));val=vals["firstHeaderRow"];if(undefined!==val)this.firstHeaderRow=val-0;val=vals["firstDataRow"];if(undefined!==val)this.firstDataRow=val-0;val=vals["firstDataCol"];if(undefined!==val)this.firstDataCol=val-0;val=vals["rowPageCount"];if(undefined!==val)this.rowPageCount=val-0;val=vals["colPageCount"];if(undefined!== val)this.colPageCount=val-0}};CT_Location.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.ref)writer.WriteXmlAttributeStringEncode("ref",this.ref.getName(AscCommonExcel.referenceType.R));if(null!==this.firstHeaderRow)writer.WriteXmlAttributeNumber("firstHeaderRow",this.firstHeaderRow);if(null!==this.firstDataRow)writer.WriteXmlAttributeNumber("firstDataRow",this.firstDataRow);if(null!==this.firstDataCol)writer.WriteXmlAttributeNumber("firstDataCol",this.firstDataCol); if(0!==this.rowPageCount)writer.WriteXmlAttributeNumber("rowPageCount",this.rowPageCount);if(0!==this.colPageCount)writer.WriteXmlAttributeNumber("colPageCount",this.colPageCount);writer.WriteXmlNodeEnd(name,true,true)};CT_Location.prototype.intersection=function(range){var t=this;return this.ref&&(Array.isArray(range)?range.some(function(element){return t.ref.intersectionSimple(element)}):this.ref.intersectionSimple(range))};CT_Location.prototype.contains=function(col,row){return this.ref&&this.ref.contains(col, row)};CT_Location.prototype.setPageCount=function(row,col){this.rowPageCount=row;this.colPageCount=col};CT_Location.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.PivotLocation};CT_Location.prototype.Write_ToBinary2=function(writer){if(this.ref){writer.WriteBool(true);writer.WriteLong(this.ref.c1);writer.WriteLong(this.ref.r1);writer.WriteLong(this.ref.c2);writer.WriteLong(this.ref.r2)}else writer.WriteBool(false);if(null!==this.firstHeaderRow){writer.WriteBool(true);writer.WriteLong(this.firstHeaderRow)}else writer.WriteBool(false); if(null!==this.firstDataRow){writer.WriteBool(true);writer.WriteLong(this.firstDataRow)}else writer.WriteBool(false);if(null!==this.firstDataCol){writer.WriteBool(true);writer.WriteLong(this.firstDataCol)}else writer.WriteBool(false);writer.WriteLong(this.rowPageCount);writer.WriteLong(this.colPageCount)};CT_Location.prototype.Read_FromBinary2=function(reader){if(reader.GetBool())this.ref=new Asc.Range(reader.GetLong(),reader.GetLong(),reader.GetLong(),reader.GetLong());if(reader.GetBool())this.firstHeaderRow= reader.GetLong();if(reader.GetBool())this.firstDataRow=reader.GetLong();if(reader.GetBool())this.firstDataCol=reader.GetLong();this.rowPageCount=reader.GetLong();this.colPageCount=reader.GetLong()};function CT_PivotFields(){this.pivotField=[]}CT_PivotFields.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotField"===elem){newContext=new CT_PivotField(true);if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotField.push(newContext)}else newContext=null;return newContext}; CT_PivotFields.prototype.toXml=function(writer,name,stylesForWrite){writer.WriteXmlNodeStart(name);if(this.pivotField.length>0)writer.WriteXmlAttributeNumber("count",this.pivotField.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.pivotField.length;++i){var elem=this.pivotField[i];elem.toXml(writer,"pivotField",stylesForWrite)}writer.WriteXmlNodeEnd(name)};CT_PivotFields.prototype.fillWithEmpty=function(cacheFields){for(var i=0;i<cacheFields.length;++i){var pivotField=new CT_PivotField(true); pivotField.showAll=false;if(cacheFields[i].IsNumType())pivotField.num=cacheFields[i].num;this.pivotField.push(pivotField)}};function findFieldBase(index,array){return array.findIndex(function(element){return element.asc_getIndex()===index})}function addFieldBase(index,array,val){if(0<=index&&index<=array.length)array.splice(index,0,val);else{index=array.length;array.push(val)}return index}function removeFieldBase(index,array){var deleteIndex=findFieldBase(index,array);if(-1!==deleteIndex){array.splice(deleteIndex, 1);return deleteIndex}return undefined}function CT_RowFields(){this.field=[]}CT_RowFields.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("field"===elem){newContext=new CT_Field;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.field.push(newContext)}else newContext=null;return newContext};CT_RowFields.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.field.length>0)writer.WriteXmlAttributeNumber("count",this.field.length);writer.WriteXmlNodeEnd(name, true);for(var i=0;i<this.field.length;++i){var elem=this.field[i];elem.toXml(writer,"field")}writer.WriteXmlNodeEnd(name)};CT_RowFields.prototype.add=function(newContext,index){return addFieldBase(index,this.field,newContext)};CT_RowFields.prototype.remove=function(index){return removeFieldBase(index,this.field)};CT_RowFields.prototype.find=function(index){return findFieldBase(index,this.field)};CT_RowFields.prototype.getCount=function(){return this.field.length};CT_RowFields.prototype.getFirstIndexExceptValue= function(){var fld=null;if(this.field.length>0&&AscCommonExcel.st_VALUES!==this.field[0].asc_getIndex())fld=this.field[0].asc_getIndex();else if(this.field.length>1&&AscCommonExcel.st_VALUES!==this.field[1].asc_getIndex())fld=this.field[1].asc_getIndex();return fld};function CT_rowItems(){this.i=[]}CT_rowItems.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("i"===elem){newContext=new CT_I;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.i.push(newContext)}else newContext= null;return newContext};CT_rowItems.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.i.length>0)writer.WriteXmlAttributeNumber("count",this.i.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.i.length;++i){var elem=this.i[i];elem.toXml(writer,"i")}writer.WriteXmlNodeEnd(name)};CT_rowItems.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.PivotRowItems};CT_rowItems.prototype.Write_ToBinary2=function(writer){writer.WriteLong(this.i.length);for(var i= 0;i<this.i.length;++i){var item=this.i[i];writer.WriteByte(item.t);writer.WriteLong(item.r);writer.WriteLong(item.i);writer.WriteLong(item.x.length);for(var j=0;j<item.x.length;++j)writer.WriteLong(item.x[j].v)}};CT_rowItems.prototype.Read_FromBinary2=function(reader){var len=reader.GetLong();while(--len>=0){var newI=new CT_I;newI.t=reader.GetByte();newI.r=reader.GetLong();newI.i=reader.GetLong();var len2=reader.GetLong();while(--len2>=0){var newX=new CT_X;newX.v=reader.GetLong();newI.x.push(newX)}this.i.push(newI)}}; function CT_ColFields(){this.field=[]}CT_ColFields.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("field"===elem){newContext=new CT_Field;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.field.push(newContext)}else newContext=null;return newContext};CT_ColFields.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.field.length>0)writer.WriteXmlAttributeNumber("count",this.field.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i< this.field.length;++i){var elem=this.field[i];elem.toXml(writer,"field")}writer.WriteXmlNodeEnd(name)};CT_ColFields.prototype.add=function(newContext,index){return addFieldBase(index,this.field,newContext)};CT_ColFields.prototype.remove=function(index){return removeFieldBase(index,this.field)};CT_ColFields.prototype.find=function(index){return findFieldBase(index,this.field)};CT_ColFields.prototype.getCount=function(){return this.field.length};CT_ColFields.prototype.getFirstIndexExceptValue=CT_RowFields.prototype.getFirstIndexExceptValue; function CT_colItems(){this.i=[]}CT_colItems.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("i"===elem){newContext=new CT_I;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.i.push(newContext)}else newContext=null;return newContext};CT_colItems.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.i.length>0)writer.WriteXmlAttributeNumber("count",this.i.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.i.length;++i){var elem= this.i[i];elem.toXml(writer,"i")}writer.WriteXmlNodeEnd(name)};CT_colItems.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.PivotColItems};CT_colItems.prototype.Write_ToBinary2=CT_rowItems.prototype.Write_ToBinary2;CT_colItems.prototype.Read_FromBinary2=CT_rowItems.prototype.Read_FromBinary2;function CT_PageFields(){this.pageField=[]}CT_PageFields.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pageField"===elem){newContext=new CT_PageField;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.pageField.push(newContext)}else newContext=null;return newContext};CT_PageFields.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.pageField.length>0)writer.WriteXmlAttributeNumber("count",this.pageField.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.pageField.length;++i){var elem=this.pageField[i];elem.toXml(writer,"pageField")}writer.WriteXmlNodeEnd(name)};CT_PageFields.prototype.add=function(newContext,index){return addFieldBase(index,this.pageField, newContext)};CT_PageFields.prototype.remove=function(index){return removeFieldBase(index,this.pageField)};CT_PageFields.prototype.getCount=function(){return this.pageField.length};function CT_DataFields(){this.dataField=[]}CT_DataFields.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("dataField"===elem){newContext=new CT_DataField(true);if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.dataField.push(newContext)}else newContext=null;return newContext};CT_DataFields.prototype.toXml= function(writer,name,stylesForWrite){writer.WriteXmlNodeStart(name);if(this.dataField.length>0)writer.WriteXmlAttributeNumber("count",this.dataField.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.dataField.length;++i){var elem=this.dataField[i];elem.toXml(writer,"dataField",stylesForWrite)}writer.WriteXmlNodeEnd(name)};CT_DataFields.prototype.add=function(newContext,index){return addFieldBase(index,this.dataField,newContext)};CT_DataFields.prototype.remove=function(index,dataIndex){if(0<= dataIndex&&dataIndex<this.dataField.length){this.dataField.splice(dataIndex,1);return[dataIndex]}else{var res=[];var deleteIndex=removeFieldBase(index,this.dataField);while(undefined!==deleteIndex){res.push(deleteIndex);deleteIndex=removeFieldBase(index,this.dataField)}return res}};CT_DataFields.prototype.getCount=function(){return this.dataField.length};CT_DataFields.prototype.checkDuplicateName=function(name){for(var i=0;i<this.dataField.length;++i)if(name===this.dataField[i].name)return true;return false}; CT_DataFields.prototype.hasField=function(fld){for(var i=0;i<this.dataField.length;++i)if(fld===this.dataField[i].fld)return true;return false};function CT_Formats(){this.format=[]}CT_Formats.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("format"===elem){newContext=new CT_Format;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.format.push(newContext)}else newContext=null;return newContext};CT_Formats.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(this.format.length>0)writer.WriteXmlAttributeNumber("count",this.format.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.format.length;++i){var elem=this.format[i];elem.toXml(writer,"format")}writer.WriteXmlNodeEnd(name)};function CT_ConditionalFormats(){this.conditionalFormat=[]}CT_ConditionalFormats.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("conditionalFormat"===elem){newContext=new CT_ConditionalFormat;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.conditionalFormat.push(newContext)}else newContext=null;return newContext};CT_ConditionalFormats.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.conditionalFormat.length>0)writer.WriteXmlAttributeNumber("count",this.conditionalFormat.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.conditionalFormat.length;++i){var elem=this.conditionalFormat[i];elem.toXml(writer,"conditionalFormat")}writer.WriteXmlNodeEnd(name)};function CT_ChartFormats(){this.chartFormat= []}CT_ChartFormats.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("chartFormat"===elem){newContext=new CT_ChartFormat;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.chartFormat.push(newContext)}else newContext=null;return newContext};CT_ChartFormats.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.chartFormat.length>0)writer.WriteXmlAttributeNumber("count",this.chartFormat.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i< this.chartFormat.length;++i){var elem=this.chartFormat[i];elem.toXml(writer,"chartFormat")}writer.WriteXmlNodeEnd(name)};function CT_PivotHierarchies(){this.pivotHierarchy=[]}CT_PivotHierarchies.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotHierarchy"===elem){newContext=new CT_PivotHierarchy;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotHierarchy.push(newContext)}else newContext=null;return newContext};CT_PivotHierarchies.prototype.toXml=function(writer, name){writer.WriteXmlNodeStart(name);if(this.pivotHierarchy.length>0)writer.WriteXmlAttributeNumber("count",this.pivotHierarchy.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.pivotHierarchy.length;++i){var elem=this.pivotHierarchy[i];elem.toXml(writer,"pivotHierarchy")}writer.WriteXmlNodeEnd(name)};function CT_PivotTableStyle(){this.name=null;this.showRowHeaders=null;this.showColHeaders=null;this.showRowStripes=null;this.showColStripes=null;this.showLastColumn=null}CT_PivotTableStyle.prototype.readAttributes= function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["showRowHeaders"];if(undefined!==val)this.showRowHeaders=AscCommon.getBoolFromXml(val);val=vals["showColHeaders"];if(undefined!==val)this.showColHeaders=AscCommon.getBoolFromXml(val);val=vals["showRowStripes"];if(undefined!==val)this.showRowStripes=AscCommon.getBoolFromXml(val);val=vals["showColStripes"];if(undefined!==val)this.showColStripes=AscCommon.getBoolFromXml(val); val=vals["showLastColumn"];if(undefined!==val)this.showLastColumn=AscCommon.getBoolFromXml(val)}};CT_PivotTableStyle.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.showRowHeaders)writer.WriteXmlAttributeBool("showRowHeaders",this.showRowHeaders);if(null!==this.showColHeaders)writer.WriteXmlAttributeBool("showColHeaders",this.showColHeaders);if(null!==this.showRowStripes)writer.WriteXmlAttributeBool("showRowStripes", this.showRowStripes);if(null!==this.showColStripes)writer.WriteXmlAttributeBool("showColStripes",this.showColStripes);if(null!==this.showLastColumn)writer.WriteXmlAttributeBool("showLastColumn",this.showLastColumn);writer.WriteXmlNodeEnd(name,true,true)};CT_PivotTableStyle.prototype.set=function(){};CT_PivotTableStyle.prototype.asc_getName=function(){return this.name};CT_PivotTableStyle.prototype.asc_getShowRowHeaders=function(){return this.showRowHeaders};CT_PivotTableStyle.prototype.asc_getShowColHeaders= function(){return this.showColHeaders};CT_PivotTableStyle.prototype.asc_getShowRowStripes=function(){return this.showRowStripes};CT_PivotTableStyle.prototype.asc_getShowColStripes=function(){return this.showColStripes};CT_PivotTableStyle.prototype.asc_setName=function(api,pivot,newVal){if(newVal!==this.name){var t=this;api._changePivotWithLock(pivot,function(ws){t._setName(newVal,pivot,ws)})}};CT_PivotTableStyle.prototype.asc_setShowRowHeaders=function(api,pivot,newVal){if(newVal!==this.showRowHeaders){var t= this;api._changePivotWithLock(pivot,function(ws){t._setShowRowHeaders(newVal,pivot,ws)})}};CT_PivotTableStyle.prototype.asc_setShowColHeaders=function(api,pivot,newVal){if(newVal!==this.showColHeaders){var t=this;api._changePivotWithLock(pivot,function(ws){t._setShowColHeaders(newVal,pivot,ws)})}};CT_PivotTableStyle.prototype.asc_setShowRowStripes=function(api,pivot,newVal){if(newVal!==this.showRowStripes){var t=this;api._changePivotWithLock(pivot,function(ws){t._setShowRowStripes(newVal,pivot,ws)})}}; CT_PivotTableStyle.prototype.asc_setShowColStripes=function(api,pivot,newVal){if(newVal!==this.showColStripes){var t=this;api._changePivotWithLock(pivot,function(ws){t._setShowColStripes(newVal,pivot,ws)})}};CT_PivotTableStyle.prototype._setName=function(newVal,pivot,ws){if(History.Is_On()&&this.name!==newVal)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_StyleName,ws?ws.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(pivot&&pivot.Get_Id(),this.name,newVal)); this.name=newVal;pivot.setChanged(false,true)};CT_PivotTableStyle.prototype._setShowRowHeaders=function(newVal,pivot,ws){if(History.Is_On()&&this.showRowHeaders!==newVal)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_StyleShowRowHeaders,ws?ws.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(pivot&&pivot.Get_Id(),this.showRowHeaders,newVal));this.showRowHeaders=newVal;pivot.setChanged(false,true)};CT_PivotTableStyle.prototype._setShowColHeaders=function(newVal, pivot,ws){if(History.Is_On()&&this.showColHeaders!==newVal)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_StyleShowColHeaders,ws?ws.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(pivot&&pivot.Get_Id(),this.showColHeaders,newVal));this.showColHeaders=newVal;pivot.setChanged(false,true)};CT_PivotTableStyle.prototype._setShowRowStripes=function(newVal,pivot,ws){if(History.Is_On()&&this.showRowStripes!==newVal)History.Add(AscCommonExcel.g_oUndoRedoPivotTables, AscCH.historyitem_PivotTable_StyleShowRowStripes,ws?ws.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(pivot&&pivot.Get_Id(),this.showRowStripes,newVal));this.showRowStripes=newVal;pivot.setChanged(false,true)};CT_PivotTableStyle.prototype._setShowColStripes=function(newVal,pivot,ws){if(History.Is_On()&&this.showColStripes!==newVal)History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_StyleShowColStripes,ws?ws.getId():null,null,new AscCommonExcel.UndoRedoData_PivotTable(pivot&& pivot.Get_Id(),this.showColStripes,newVal));this.showColStripes=newVal;pivot.setChanged(false,true)};function CT_PivotFilters(){this.filter=[]}CT_PivotFilters.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("filter"===elem){newContext=new CT_PivotFilter;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.filter.push(newContext)}else newContext=null;return newContext};CT_PivotFilters.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.filter.length> 0)writer.WriteXmlAttributeNumber("count",this.filter.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.filter.length;++i){var elem=this.filter[i];elem.toXml(writer,"filter",i+1)}writer.WriteXmlNodeEnd(name)};CT_PivotFilters.prototype.getFilterByFieldIndex=function(index){var res;for(var i=0;i<this.filter.length;++i)if(index===this.filter[i].fld)res=this.filter[i];return res};function CT_RowHierarchiesUsage(){this.rowHierarchyUsage=[]}CT_RowHierarchiesUsage.prototype.onStartNode=function(elem, attr,uq){var newContext=this;if("rowHierarchyUsage"===elem){newContext=new CT_HierarchyUsage;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.rowHierarchyUsage.push(newContext)}else newContext=null;return newContext};CT_RowHierarchiesUsage.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.rowHierarchyUsage.length>0)writer.WriteXmlAttributeNumber("count",this.rowHierarchyUsage.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.rowHierarchyUsage.length;++i){var elem= this.rowHierarchyUsage[i];elem.toXml(writer,"rowHierarchyUsage")}writer.WriteXmlNodeEnd(name)};function CT_ColHierarchiesUsage(){this.colHierarchyUsage=[]}CT_ColHierarchiesUsage.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("colHierarchyUsage"===elem){newContext=new CT_HierarchyUsage;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.colHierarchyUsage.push(newContext)}else newContext=null;return newContext};CT_ColHierarchiesUsage.prototype.toXml=function(writer, name){writer.WriteXmlNodeStart(name);if(this.colHierarchyUsage.length>0)writer.WriteXmlAttributeNumber("count",this.colHierarchyUsage.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.colHierarchyUsage.length;++i){var elem=this.colHierarchyUsage[i];elem.toXml(writer,"colHierarchyUsage")}writer.WriteXmlNodeEnd(name)};function CT_Consolidation(){this.autoPage=true;this.pages=null;this.rangeSets=null}CT_Consolidation.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val; val=vals["autoPage"];if(undefined!==val)this.autoPage=AscCommon.getBoolFromXml(val)}};CT_Consolidation.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pages"===elem){newContext=new CT_Pages;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pages=newContext}else if("rangeSets"===elem){newContext=new CT_RangeSets;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.rangeSets=newContext}else newContext=null;return newContext};CT_Consolidation.prototype.toXml= function(writer,name){writer.WriteXmlNodeStart(name);if(true!==this.autoPage)writer.WriteXmlAttributeBool("autoPage",this.autoPage);writer.WriteXmlNodeEnd(name,true);if(null!==this.pages)this.pages.toXml(writer,"pages");if(null!==this.rangeSets)this.rangeSets.toXml(writer,"rangeSets");writer.WriteXmlNodeEnd(name)};function CT_WorksheetSource(){this.ref=null;this.name=null;this.sheet=null;this.id=null;this.formula=null;this.Id=AscCommon.g_oIdCounter.Get_NewId();AscCommon.g_oTableId.Add(this,this.Id)} CT_WorksheetSource.prototype.getObjectType=function(){return AscDFH.historyitem_type_PivotWorksheetSource};CT_WorksheetSource.prototype.Get_Id=function(){return this.Id};CT_WorksheetSource.prototype.onFormulaEvent=function(type,eventData){if(AscCommon.c_oNotifyParentType.ChangeFormula===type){var oldVal=new AscCommonExcel.UndoRedoData_BinaryWrapper(this);this._updateAttributes();var newVal=new AscCommonExcel.UndoRedoData_BinaryWrapper(this);History.Add(AscCommonExcel.g_oUndoRedoWorkbook,AscCH.historyitem_Workbook_PivotWorksheetSource, null,null,new AscCommonExcel.UndoRedoData_PivotTable(this.Get_Id(),oldVal,newVal))}else if(AscCommon.c_oNotifyParentType.ProcessNotify===type){var data=eventData.notifyData;if(AscCommon.c_oNotifyType.ChangeDefName===data.type&&!data.to){if(this.formula&&1===this.formula.getOutStackSize()){var elem=this.formula.getOutStackElem(0);if(elem.type===AscCommonExcel.cElementType.table){var table=elem.getTable();if(table.isHeaderRow()){var dataLocation=this.getDataLocation();if(dataLocation&&dataLocation.ws){eventData.formula.removeTableName(data.from, true);var bbox=dataLocation.bbox.clone();bbox.r1--;bbox.r2=bbox.r1;var offset=new AscCommon.CellBase(-1,0);eventData.formula.shiftCells(AscCommon.c_oNotifyType.Shift,dataLocation.ws.getId(),bbox,offset);bbox.r1++;bbox.r2=bbox.r1;offset=new AscCommon.CellBase(1,0);eventData.formula.shiftCells(AscCommon.c_oNotifyType.Shift,dataLocation.ws.getId(),bbox,offset)}}return true}}}else if(AscCommon.c_oNotifyType.Shift===data.type){eventData.formula.shiftCells(data.type,data.sheetId,data.bbox,data.offset,data.sheetIdTo, true);return true}}};CT_WorksheetSource.prototype.Write_ToBinary2=function(writer){writer.WriteString2(this.ref?this.ref:"");writer.WriteString2(this.name?this.name:"");writer.WriteString2(this.sheet?this.sheet:"")};CT_WorksheetSource.prototype.Read_FromBinary2=function(reader){var ref=reader.GetString2();var name=reader.GetString2();var sheet=reader.GetString2();this.ref=""!==ref?ref:null;this.name=""!==name?name:null;this.sheet=""!==sheet?sheet:null};CT_WorksheetSource.prototype.readAttributes= function(attr,uq){if(attr()){var vals=attr();var val;val=vals["ref"];if(undefined!==val)this.ref=AscCommon.unleakString(uq(val));val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["sheet"];if(undefined!==val)this.sheet=AscCommon.unleakString(uq(val));val=vals["r:id"];if(undefined!==val)this.id=AscCommon.unleakString(uq(val));this.fromWorksheetSource(this)}};CT_WorksheetSource.prototype.toXml=function(writer,name){this._updateAttributes();writer.WriteXmlNodeStart(name); if(null!==this.ref)writer.WriteXmlAttributeStringEncode("ref",this.ref);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.sheet)writer.WriteXmlAttributeStringEncode("sheet",this.sheet);writer.WriteXmlNodeEnd(name,true,true)};CT_WorksheetSource.prototype.getDataLocation=function(){if(this.formula&&1===this.formula.getOutStackSize()){var elem=this.formula.getOutStackElem(0);var headings;if(elem.type===AscCommonExcel.cElementType.table)headings=elem.geColumnHeadings(); var val=this.formula.calculate();if(val)switch(val.type){case AscCommonExcel.cElementType.cell:case AscCommonExcel.cElementType.cellsRange:case AscCommonExcel.cElementType.cell3D:case AscCommonExcel.cElementType.cellsRange3D:var ws=val.getWS()!==AscCommonExcel.g_DefNameWorksheet?val.getWS():null;return{ws:ws,bbox:val.getBBox0(),headings:headings};break}}};CT_WorksheetSource.prototype.getDataRef=function(){if(this.formula)return this.formula.assembleLocale(AscCommonExcel.cFormulaFunctionToLocale,true)}; CT_WorksheetSource.prototype.fromDataRef=function(dataRef){if(dataRef){this.formula=new AscCommonExcel.parserFormula(dataRef,this,AscCommonExcel.g_DefNameWorksheet);this.formula.parse();this.formula.buildDependencies()}};CT_WorksheetSource.prototype.fromWorksheetSource=function(worksheetSource,addToBuildDependencyPivot){if(this.formula){this.formula.removeDependencies();this.formula=null}var text;if(worksheetSource.name)if(worksheetSource.sheet)text=AscCommon.parserHelp.getEscapeSheetName(worksheetSource.sheet)+ "!"+worksheetSource.name;else text=worksheetSource.name;else if(worksheetSource.ref&&worksheetSource.sheet)text=AscCommon.parserHelp.get3DRef(worksheetSource.sheet,worksheetSource.ref);if(text){this.formula=new AscCommonExcel.parserFormula(text,this,AscCommonExcel.g_DefNameWorksheet);this.formula.parse();if(addToBuildDependencyPivot){var ws=this.formula.getWs();if(ws&&ws.workbook)ws.workbook.dependencyFormulas.addToBuildDependencyPivot(this.formula)}else this.formula.buildDependencies()}};CT_WorksheetSource.prototype._updateAttributes= function(){if(this.formula&&1===this.formula.getOutStackSize()){var elem=this.formula.getOutStackElem(0);if(elem)switch(elem.type){case AscCommonExcel.cElementType.cell:case AscCommonExcel.cElementType.cellsRange:case AscCommonExcel.cElementType.cell3D:case AscCommonExcel.cElementType.cellsRange3D:this.sheet=elem.getWS().getName();this.ref=elem.getBBox0().getName(AscCommonExcel.referenceType.R);this.name=null;break;case AscCommonExcel.cElementType.name:this.sheet=null;this.ref=null;this.name=elem.toString(); break;case AscCommonExcel.cElementType.name3D:this.sheet=elem.getWS().getName();this.ref=null;this.name=AscCommonExcel.cName.prototype.toString.call(elem);break;case AscCommonExcel.cElementType.table:this.sheet=null;this.ref=null;this.name=elem.toString();break}}};function CT_CacheField(){this.name=null;this.caption=null;this.propertyName=null;this.serverField=false;this.uniqueList=true;this.numFmtId=null;this.num=null;this.formula=null;this.sqlType=0;this.hierarchy=0;this.level=0;this.databaseField= true;this.mappingCount=null;this.memberPropertyField=false;this.sharedItems=null;this.fieldGroup=null;this.mpMap=[];this.extLst=null}CT_CacheField.prototype.initPostOpenZip=function(oNumFmts){if(null!==this.numFmtId){this.num=AscCommonExcel.Num.prototype.initFromParams(this.numFmtId,null,oNumFmts);this.numFmtId=null}};CT_CacheField.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["caption"]; if(undefined!==val)this.caption=AscCommon.unleakString(uq(val));val=vals["propertyName"];if(undefined!==val)this.propertyName=AscCommon.unleakString(uq(val));val=vals["serverField"];if(undefined!==val)this.serverField=AscCommon.getBoolFromXml(val);val=vals["uniqueList"];if(undefined!==val)this.uniqueList=AscCommon.getBoolFromXml(val);ReadNumXml(vals,uq,this);val=vals["formula"];if(undefined!==val)this.formula=AscCommon.unleakString(uq(val));val=vals["sqlType"];if(undefined!==val)this.sqlType=val- 0;val=vals["hierarchy"];if(undefined!==val)this.hierarchy=val-0;val=vals["level"];if(undefined!==val)this.level=val-0;val=vals["databaseField"];if(undefined!==val)this.databaseField=AscCommon.getBoolFromXml(val);val=vals["mappingCount"];if(undefined!==val)this.mappingCount=val-0;val=vals["memberPropertyField"];if(undefined!==val)this.memberPropertyField=AscCommon.getBoolFromXml(val)}};CT_CacheField.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("sharedItems"===elem){newContext= new CT_SharedItems;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.sharedItems=newContext}else if("fieldGroup"===elem){newContext=new CT_FieldGroup;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.fieldGroup=newContext}else if("mpMap"===elem){newContext=new CT_X;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.mpMap.push(newContext)}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.extLst=newContext}else newContext=null;return newContext};CT_CacheField.prototype.toXml=function(writer,name,stylesForWrite){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.caption)writer.WriteXmlAttributeStringEncode("caption",this.caption);if(null!==this.propertyName)writer.WriteXmlAttributeStringEncode("propertyName",this.propertyName);if(false!==this.serverField)writer.WriteXmlAttributeBool("serverField",this.serverField); if(true!==this.uniqueList)writer.WriteXmlAttributeBool("uniqueList",this.uniqueList);WriteNumXml(writer,this.num,stylesForWrite);if(null!==this.formula)writer.WriteXmlAttributeStringEncode("formula",this.formula);if(0!==this.sqlType)writer.WriteXmlAttributeNumber("sqlType",this.sqlType);if(0!==this.hierarchy)writer.WriteXmlAttributeNumber("hierarchy",this.hierarchy);if(0!==this.level)writer.WriteXmlAttributeNumber("level",this.level);if(true!==this.databaseField)writer.WriteXmlAttributeBool("databaseField", this.databaseField);if(null!==this.mappingCount)writer.WriteXmlAttributeNumber("mappingCount",this.mappingCount);if(false!==this.memberPropertyField)writer.WriteXmlAttributeBool("memberPropertyField",this.memberPropertyField);writer.WriteXmlNodeEnd(name,true);if(null!==this.sharedItems)this.sharedItems.toXml(writer,"sharedItems");if(null!==this.fieldGroup)this.fieldGroup.toXml(writer,"fieldGroup");for(var i=0;i<this.mpMap.length;++i){var elem=this.mpMap[i];elem.toXml(writer,"mpMap")}if(null!==this.extLst)this.extLst.toXml(writer, "extLst");writer.WriteXmlNodeEnd(name)};CT_CacheField.prototype.Write_ToBinary2=function(writer){var t=this;AscCommonExcel.executeInR1C1Mode(false,function(){toXmlWithLength(writer,t,"cacheField")})};CT_CacheField.prototype.Read_FromBinary2=function(reader){var tmp=new XmlReaderWrapper("cacheField",this);var len=reader.GetLong();AscCommonExcel.executeInR1C1Mode(false,function(){(new AscCommon.openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(reader,len),tmp)})};CT_CacheField.prototype.asc_getName= function(){return this.name};CT_CacheField.prototype.getSharedItem=function(index){return this.sharedItems&&this.sharedItems.Items.get(index)};CT_CacheField.prototype.getSharedSize=function(){return this.sharedItems&&this.sharedItems.Items.getSize()||0};CT_CacheField.prototype.isSumSubtotal=function(){return this.sharedItems&&false===this.sharedItems.containsSemiMixedTypes&&true===this.sharedItems.containsNumber};CT_CacheField.prototype.IsNumType=function(){return this.sharedItems&&false===this.sharedItems.containsSemiMixedTypes&& (true===this.sharedItems.containsNumber||true===this.sharedItems.containsDate)};CT_CacheField.prototype.getNumFormat=function(){if(this.num)return this.num;else if(this.sharedItems&&this.sharedItems.containsDate)return AscCommonExcel.Num.prototype.initFromParams(14,AscCommon.getFormatByStandardId(14))};CT_CacheField.prototype.checkSharedItems=function(pivot,index,cacheRecords){if(this.sharedItems&&this.sharedItems.Items.getSize()>0)return;if(!this.sharedItems)this.sharedItems=new CT_SharedItems;cacheRecords.convertToSharedItems(index, this.sharedItems);History.Add(AscCommonExcel.g_oUndoRedoPivotTables,AscCH.historyitem_PivotTable_CacheField,pivot.GetWS().getId(),null,new AscCommonExcel.UndoRedoData_PivotField(pivot.Get_Id(),index,null,null))};function CT_CacheHierarchy(){this.uniqueName=null;this.caption=null;this.measure=false;this.set=false;this.parentSet=null;this.iconSet=0;this.attribute=false;this.time=false;this.keyAttribute=false;this.defaultMemberUniqueName=null;this.allUniqueName=null;this.allCaption=null;this.dimensionUniqueName= null;this.displayFolder=null;this.measureGroup=null;this.measures=false;this.count=null;this.oneField=false;this.memberValueDatatype=null;this.unbalanced=null;this.unbalancedGroup=null;this.hidden=false;this.fieldsUsage=null;this.groupLevels=null;this.extLst=null}CT_CacheHierarchy.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["uniqueName"];if(undefined!==val)this.uniqueName=AscCommon.unleakString(uq(val));val=vals["caption"];if(undefined!==val)this.caption= AscCommon.unleakString(uq(val));val=vals["measure"];if(undefined!==val)this.measure=AscCommon.getBoolFromXml(val);val=vals["set"];if(undefined!==val)this.set=AscCommon.getBoolFromXml(val);val=vals["parentSet"];if(undefined!==val)this.parentSet=val-0;val=vals["iconSet"];if(undefined!==val)this.iconSet=val-0;val=vals["attribute"];if(undefined!==val)this.attribute=AscCommon.getBoolFromXml(val);val=vals["time"];if(undefined!==val)this.time=AscCommon.getBoolFromXml(val);val=vals["keyAttribute"];if(undefined!== val)this.keyAttribute=AscCommon.getBoolFromXml(val);val=vals["defaultMemberUniqueName"];if(undefined!==val)this.defaultMemberUniqueName=AscCommon.unleakString(uq(val));val=vals["allUniqueName"];if(undefined!==val)this.allUniqueName=AscCommon.unleakString(uq(val));val=vals["allCaption"];if(undefined!==val)this.allCaption=AscCommon.unleakString(uq(val));val=vals["dimensionUniqueName"];if(undefined!==val)this.dimensionUniqueName=AscCommon.unleakString(uq(val));val=vals["displayFolder"];if(undefined!== val)this.displayFolder=AscCommon.unleakString(uq(val));val=vals["measureGroup"];if(undefined!==val)this.measureGroup=AscCommon.unleakString(uq(val));val=vals["measures"];if(undefined!==val)this.measures=AscCommon.getBoolFromXml(val);val=vals["count"];if(undefined!==val)this.count=val-0;val=vals["oneField"];if(undefined!==val)this.oneField=AscCommon.getBoolFromXml(val);val=vals["memberValueDatatype"];if(undefined!==val)this.memberValueDatatype=val-0;val=vals["unbalanced"];if(undefined!==val)this.unbalanced= AscCommon.getBoolFromXml(val);val=vals["unbalancedGroup"];if(undefined!==val)this.unbalancedGroup=AscCommon.getBoolFromXml(val);val=vals["hidden"];if(undefined!==val)this.hidden=AscCommon.getBoolFromXml(val)}};CT_CacheHierarchy.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("fieldsUsage"===elem){newContext=new CT_FieldsUsage;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.fieldsUsage=newContext}else if("groupLevels"===elem){newContext=new CT_GroupLevels;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.groupLevels=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_CacheHierarchy.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.uniqueName)writer.WriteXmlAttributeStringEncode("uniqueName",this.uniqueName);if(null!==this.caption)writer.WriteXmlAttributeStringEncode("caption",this.caption);if(false!==this.measure)writer.WriteXmlAttributeBool("measure", this.measure);if(false!==this.set)writer.WriteXmlAttributeBool("set",this.set);if(null!==this.parentSet)writer.WriteXmlAttributeNumber("parentSet",this.parentSet);if(0!==this.iconSet)writer.WriteXmlAttributeNumber("iconSet",this.iconSet);if(false!==this.attribute)writer.WriteXmlAttributeBool("attribute",this.attribute);if(false!==this.time)writer.WriteXmlAttributeBool("time",this.time);if(false!==this.keyAttribute)writer.WriteXmlAttributeBool("keyAttribute",this.keyAttribute);if(null!==this.defaultMemberUniqueName)writer.WriteXmlAttributeStringEncode("defaultMemberUniqueName", this.defaultMemberUniqueName);if(null!==this.allUniqueName)writer.WriteXmlAttributeStringEncode("allUniqueName",this.allUniqueName);if(null!==this.allCaption)writer.WriteXmlAttributeStringEncode("allCaption",this.allCaption);if(null!==this.dimensionUniqueName)writer.WriteXmlAttributeStringEncode("dimensionUniqueName",this.dimensionUniqueName);if(null!==this.displayFolder)writer.WriteXmlAttributeStringEncode("displayFolder",this.displayFolder);if(null!==this.measureGroup)writer.WriteXmlAttributeStringEncode("measureGroup", this.measureGroup);if(false!==this.measures)writer.WriteXmlAttributeBool("measures",this.measures);if(null!==this.count)writer.WriteXmlAttributeNumber("count",this.count);if(false!==this.oneField)writer.WriteXmlAttributeBool("oneField",this.oneField);if(null!==this.memberValueDatatype)writer.WriteXmlAttributeNumber("memberValueDatatype",this.memberValueDatatype);if(null!==this.unbalanced)writer.WriteXmlAttributeBool("unbalanced",this.unbalanced);if(null!==this.unbalancedGroup)writer.WriteXmlAttributeBool("unbalancedGroup", this.unbalancedGroup);if(false!==this.hidden)writer.WriteXmlAttributeBool("hidden",this.hidden);writer.WriteXmlNodeEnd(name,true);if(null!==this.fieldsUsage)this.fieldsUsage.toXml(writer,"fieldsUsage");if(null!==this.groupLevels)this.groupLevels.toXml(writer,"groupLevels");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_PCDKPI(){this.uniqueName=null;this.caption=null;this.displayFolder=null;this.measureGroup=null;this.parent=null;this.value=null; this.goal=null;this.status=null;this.trend=null;this.weight=null;this.time=null}CT_PCDKPI.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["uniqueName"];if(undefined!==val)this.uniqueName=AscCommon.unleakString(uq(val));val=vals["caption"];if(undefined!==val)this.caption=AscCommon.unleakString(uq(val));val=vals["displayFolder"];if(undefined!==val)this.displayFolder=AscCommon.unleakString(uq(val));val=vals["measureGroup"];if(undefined!==val)this.measureGroup=AscCommon.unleakString(uq(val)); val=vals["parent"];if(undefined!==val)this.parent=AscCommon.unleakString(uq(val));val=vals["value"];if(undefined!==val)this.value=AscCommon.unleakString(uq(val));val=vals["goal"];if(undefined!==val)this.goal=AscCommon.unleakString(uq(val));val=vals["status"];if(undefined!==val)this.status=AscCommon.unleakString(uq(val));val=vals["trend"];if(undefined!==val)this.trend=AscCommon.unleakString(uq(val));val=vals["weight"];if(undefined!==val)this.weight=AscCommon.unleakString(uq(val));val=vals["time"]; if(undefined!==val)this.time=AscCommon.unleakString(uq(val))}};CT_PCDKPI.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.uniqueName)writer.WriteXmlAttributeStringEncode("uniqueName",this.uniqueName);if(null!==this.caption)writer.WriteXmlAttributeStringEncode("caption",this.caption);if(null!==this.displayFolder)writer.WriteXmlAttributeStringEncode("displayFolder",this.displayFolder);if(null!==this.measureGroup)writer.WriteXmlAttributeStringEncode("measureGroup", this.measureGroup);if(null!==this.parent)writer.WriteXmlAttributeStringEncode("parent",this.parent);if(null!==this.value)writer.WriteXmlAttributeStringEncode("value",this.value);if(null!==this.goal)writer.WriteXmlAttributeStringEncode("goal",this.goal);if(null!==this.status)writer.WriteXmlAttributeStringEncode("status",this.status);if(null!==this.trend)writer.WriteXmlAttributeStringEncode("trend",this.trend);if(null!==this.weight)writer.WriteXmlAttributeStringEncode("weight",this.weight);if(null!== this.time)writer.WriteXmlAttributeStringEncode("time",this.time);writer.WriteXmlNodeEnd(name,true,true)};function CT_PCDSDTCEntries(){this.Items=[]}CT_PCDSDTCEntries.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("e"===elem){newContext=new CT_Error;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.Items.push(newContext)}else if("m"===elem){newContext=new CT_Missing;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.Items.push(newContext)}else if("n"=== elem){newContext=new CT_Number;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.Items.push(newContext)}else if("s"===elem){newContext=new CT_String;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.Items.push(newContext)}else newContext=null;return newContext};CT_PCDSDTCEntries.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.Items.length>0)writer.WriteXmlAttributeNumber("count",this.Items.length);writer.WriteXmlNodeEnd(name,true); for(var i=0;i<this.Items.length;++i){var elem=this.Items[i];if(elem instanceof CT_Error)elem.toXml(writer,"e");else if(elem instanceof CT_Missing)elem.toXml(writer,"m");else if(elem instanceof CT_Number)elem.toXml(writer,"n");else if(elem instanceof CT_String)elem.toXml(writer,"s")}writer.WriteXmlNodeEnd(name)};function CT_Sets(){this.set=[]}CT_Sets.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("set"===elem){newContext=new CT_Set;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.set.push(newContext)}else newContext=null;return newContext};CT_Sets.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.set.length>0)writer.WriteXmlAttributeNumber("count",this.set.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.set.length;++i){var elem=this.set[i];elem.toXml(writer,"set")}writer.WriteXmlNodeEnd(name)};function CT_QueryCache(){this.query=[]}CT_QueryCache.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("query"===elem){newContext= new CT_Query;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.query.push(newContext)}else newContext=null;return newContext};CT_QueryCache.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.query.length>0)writer.WriteXmlAttributeNumber("count",this.query.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.query.length;++i){var elem=this.query[i];elem.toXml(writer,"query")}writer.WriteXmlNodeEnd(name)};function CT_ServerFormats(){this.serverFormat= []}CT_ServerFormats.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("serverFormat"===elem){newContext=new CT_ServerFormat;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.serverFormat.push(newContext)}else newContext=null;return newContext};CT_ServerFormats.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.serverFormat.length>0)writer.WriteXmlAttributeNumber("count",this.serverFormat.length);writer.WriteXmlNodeEnd(name,true);for(var i= 0;i<this.serverFormat.length;++i){var elem=this.serverFormat[i];elem.toXml(writer,"serverFormat")}writer.WriteXmlNodeEnd(name)};function CT_CalculatedItem(){this.field=null;this.formula=null;this.pivotArea=null;this.extLst=null}CT_CalculatedItem.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["field"];if(undefined!==val)this.field=val-0;val=vals["formula"];if(undefined!==val)this.formula=AscCommon.unleakString(uq(val))}};CT_CalculatedItem.prototype.onStartNode= function(elem,attr,uq){var newContext=this;if("pivotArea"===elem){newContext=new CT_PivotArea;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotArea=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_CalculatedItem.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.field)writer.WriteXmlAttributeNumber("field", this.field);if(null!==this.formula)writer.WriteXmlAttributeStringEncode("formula",this.formula);writer.WriteXmlNodeEnd(name,true);if(null!==this.pivotArea)this.pivotArea.toXml(writer,"pivotArea");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_CalculatedMember(){this.name=null;this.mdx=null;this.memberName=null;this.hierarchy=null;this.parent=null;this.solveOrder=0;this.set=false;this.extLst=null}CT_CalculatedMember.prototype.readAttributes=function(attr, uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["mdx"];if(undefined!==val)this.mdx=AscCommon.unleakString(uq(val));val=vals["memberName"];if(undefined!==val)this.memberName=AscCommon.unleakString(uq(val));val=vals["hierarchy"];if(undefined!==val)this.hierarchy=AscCommon.unleakString(uq(val));val=vals["parent"];if(undefined!==val)this.parent=AscCommon.unleakString(uq(val));val=vals["solveOrder"];if(undefined!==val)this.solveOrder= val-0;val=vals["set"];if(undefined!==val)this.set=AscCommon.getBoolFromXml(val)}};CT_CalculatedMember.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_CalculatedMember.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name); if(null!==this.mdx)writer.WriteXmlAttributeStringEncode("mdx",this.mdx);if(null!==this.memberName)writer.WriteXmlAttributeStringEncode("memberName",this.memberName);if(null!==this.hierarchy)writer.WriteXmlAttributeStringEncode("hierarchy",this.hierarchy);if(null!==this.parent)writer.WriteXmlAttributeStringEncode("parent",this.parent);if(0!==this.solveOrder)writer.WriteXmlAttributeNumber("solveOrder",this.solveOrder);if(false!==this.set)writer.WriteXmlAttributeBool("set",this.set);writer.WriteXmlNodeEnd(name, true);if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_PivotDimension(){this.measure=false;this.name=null;this.uniqueName=null;this.caption=null}CT_PivotDimension.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["measure"];if(undefined!==val)this.measure=AscCommon.getBoolFromXml(val);val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["uniqueName"];if(undefined!==val)this.uniqueName= AscCommon.unleakString(uq(val));val=vals["caption"];if(undefined!==val)this.caption=AscCommon.unleakString(uq(val))}};CT_PivotDimension.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(false!==this.measure)writer.WriteXmlAttributeBool("measure",this.measure);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.uniqueName)writer.WriteXmlAttributeStringEncode("uniqueName",this.uniqueName);if(null!==this.caption)writer.WriteXmlAttributeStringEncode("caption", this.caption);writer.WriteXmlNodeEnd(name,true,true)};function CT_MeasureGroup(){this.name=null;this.caption=null}CT_MeasureGroup.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["caption"];if(undefined!==val)this.caption=AscCommon.unleakString(uq(val))}};CT_MeasureGroup.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name", this.name);if(null!==this.caption)writer.WriteXmlAttributeStringEncode("caption",this.caption);writer.WriteXmlNodeEnd(name,true,true)};function CT_MeasureDimensionMap(){this.measureGroup=null;this.dimension=null}CT_MeasureDimensionMap.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["measureGroup"];if(undefined!==val)this.measureGroup=val-0;val=vals["dimension"];if(undefined!==val)this.dimension=val-0}};CT_MeasureDimensionMap.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(null!==this.measureGroup)writer.WriteXmlAttributeNumber("measureGroup",this.measureGroup);if(null!==this.dimension)writer.WriteXmlAttributeNumber("dimension",this.dimension);writer.WriteXmlNodeEnd(name,true,true)};function CT_Extension(){this.uri=null;this.elem=null}CT_Extension.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["uri"];if(undefined!==val)this.uri=AscCommon.unleakString(uq(val))}};CT_Extension.prototype.onStartNode=function(elem,attr,uq){var newContext= this;if("x14:pivotTableDefinition"===elem){newContext=new CT_pivotTableDefinitionX14;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.elem=newContext}else if("x14:pivotCacheDefinition"===elem){newContext=new CT_PivotCacheDefinitionX14;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.elem=newContext}else if("x14:pivotField"===elem){newContext=new CT_PivotFieldX14;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.elem=newContext}else newContext= null;return newContext};CT_Extension.prototype.toXml=function(writer,name){if(!this.elem)return;writer.WriteXmlNodeStart(name);if(null!==this.uri)writer.WriteXmlAttributeStringEncode("uri",this.uri);writer.WriteXmlString(' xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"');writer.WriteXmlNodeEnd(name,true);if("{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}"===this.uri)this.elem.toXml(writer,"x14:pivotTableDefinition");else if("{725AE2AE-9491-48be-B2B4-4EB974FC3084}"===this.uri)this.elem.toXml(writer, "x14:pivotCacheDefinition");else if("{2946ED86-A175-432a-8AC1-64E0C546D7DE}"===this.uri)this.elem.toXml(writer,"x14:pivotField");writer.WriteXmlNodeEnd(name)};function CT_X(){this.v=0}CT_X.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["v"];if(undefined!==val)this.v=val-0}};CT_X.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(0!==this.v)writer.WriteXmlAttributeNumber("v",this.v);writer.WriteXmlNodeEnd(name,true,true)};CT_X.prototype.getV= function(){return this.v};function CT_Tuples(){this.c=null;this.tpl=[]}CT_Tuples.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["c"];if(undefined!==val)this.c=val-0}};CT_Tuples.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("tpl"===elem){newContext=new CT_Tuple;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.tpl.push(newContext)}else newContext=null;return newContext};CT_Tuples.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(null!==this.c)writer.WriteXmlAttributeNumber("c",this.c);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.tpl.length;++i){var elem=this.tpl[i];elem.toXml(writer,"tpl")}writer.WriteXmlNodeEnd(name)};function CT_PivotField(setDefaults){this.name=null;this.axis=null;this.dataField=null;this.subtotalCaption=null;this.showDropDowns=null;this.hiddenLevel=null;this.uniqueMemberProperty=null;this.compact=null;this.allDrilled=null;this.numFmtId=null;this.num=null;this.outline=null;this.subtotalTop= null;this.dragToRow=null;this.dragToCol=null;this.multipleItemSelectionAllowed=null;this.dragToPage=null;this.dragToData=null;this.dragOff=null;this.showAll=null;this.insertBlankRow=null;this.serverField=null;this.insertPageBreak=null;this.autoShow=null;this.topAutoShow=null;this.hideNewItems=null;this.measureFilter=null;this.includeNewItemsInFilter=null;this.itemPageCount=null;this.sortType=null;this.dataSourceSort=null;this.nonAutoSortDefault=null;this.rankBy=null;this.defaultSubtotal=null;this.sumSubtotal= null;this.countASubtotal=null;this.avgSubtotal=null;this.maxSubtotal=null;this.minSubtotal=null;this.productSubtotal=null;this.countSubtotal=null;this.stdDevSubtotal=null;this.stdDevPSubtotal=null;this.varSubtotal=null;this.varPSubtotal=null;this.showPropCell=null;this.showPropTip=null;this.showPropAsCaption=null;this.defaultAttributeDrillState=null;this.items=null;this.autoSortScope=null;this.pivotFieldX14=null;this.ascSubtotals=null;this.ascFillDownLabels=null;if(setDefaults)this.setDefaults()} CT_PivotField.prototype.initPostOpenZip=function(oNumFmts){if(null!==this.numFmtId){this.num=AscCommonExcel.Num.prototype.initFromParams(this.numFmtId,null,oNumFmts);this.numFmtId=null}};CT_PivotField.prototype.setDefaults=function(){this.dataField=false;this.showDropDowns=true;this.hiddenLevel=false;this.compact=true;this.allDrilled=false;this.outline=true;this.subtotalTop=true;this.dragToRow=true;this.dragToCol=true;this.multipleItemSelectionAllowed=false;this.dragToPage=true;this.dragToData=true; this.dragOff=true;this.showAll=true;this.insertBlankRow=false;this.serverField=false;this.insertPageBreak=false;this.autoShow=false;this.topAutoShow=true;this.hideNewItems=false;this.measureFilter=false;this.includeNewItemsInFilter=false;this.itemPageCount=10;this.sortType=c_oAscFieldSortType.Manual;this.nonAutoSortDefault=false;this.defaultSubtotal=true;this.sumSubtotal=false;this.countASubtotal=false;this.avgSubtotal=false;this.maxSubtotal=false;this.minSubtotal=false;this.productSubtotal=false; this.countSubtotal=false;this.stdDevSubtotal=false;this.stdDevPSubtotal=false;this.varSubtotal=false;this.varPSubtotal=false;this.showPropCell=false;this.showPropTip=false;this.showPropAsCaption=false;this.defaultAttributeDrillState=false};CT_PivotField.prototype.clone=function(){var res=new CT_PivotField(true);res.name=this.name;res.axis=this.axis;res.dataField=this.dataField;res.subtotalCaption=this.subtotalCaption;res.showDropDowns=this.showDropDowns;res.hiddenLevel=this.hiddenLevel;res.uniqueMemberProperty= this.uniqueMemberProperty;res.compact=this.compact;res.allDrilled=this.allDrilled;res.numFmtId=this.numFmtId;res.num=this.num;res.outline=this.outline;res.subtotalTop=this.subtotalTop;res.dragToRow=this.dragToRow;res.dragToCol=this.dragToCol;res.multipleItemSelectionAllowed=this.multipleItemSelectionAllowed;res.dragToPage=this.dragToPage;res.dragToData=this.dragToData;res.dragOff=this.dragOff;res.showAll=this.showAll;res.insertBlankRow=this.insertBlankRow;res.serverField=this.serverField;res.insertPageBreak= this.insertPageBreak;res.autoShow=this.autoShow;res.topAutoShow=this.topAutoShow;res.hideNewItems=this.hideNewItems;res.measureFilter=this.measureFilter;res.includeNewItemsInFilter=this.includeNewItemsInFilter;res.itemPageCount=this.itemPageCount;res.sortType=this.sortType;res.dataSourceSort=this.dataSourceSort;res.nonAutoSortDefault=this.nonAutoSortDefault;res.rankBy=this.rankBy;res.defaultSubtotal=this.defaultSubtotal;res.sumSubtotal=this.sumSubtotal;res.countASubtotal=this.countASubtotal;res.avgSubtotal= this.avgSubtotal;res.maxSubtotal=this.maxSubtotal;res.minSubtotal=this.minSubtotal;res.productSubtotal=this.productSubtotal;res.countSubtotal=this.countSubtotal;res.stdDevSubtotal=this.stdDevSubtotal;res.stdDevPSubtotal=this.stdDevPSubtotal;res.varSubtotal=this.varSubtotal;res.varPSubtotal=this.varPSubtotal;res.showPropCell=this.showPropCell;res.showPropTip=this.showPropTip;res.showPropAsCaption=this.showPropAsCaption;res.defaultAttributeDrillState=this.defaultAttributeDrillState;if(this.items)res.items= this.items.clone();if(this.autoSortScope)res.autoSortScope=this.autoSortScope.clone();return res};CT_PivotField.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["axis"];if(undefined!==val){val=FromXml_ST_Axis(val);if(-1!==val)this.axis=val}val=vals["dataField"];if(undefined!==val)this.dataField=AscCommon.getBoolFromXml(val);val=vals["subtotalCaption"];if(undefined!==val)this.subtotalCaption= AscCommon.unleakString(uq(val));val=vals["showDropDowns"];if(undefined!==val)this.showDropDowns=AscCommon.getBoolFromXml(val);val=vals["hiddenLevel"];if(undefined!==val)this.hiddenLevel=AscCommon.getBoolFromXml(val);val=vals["uniqueMemberProperty"];if(undefined!==val)this.uniqueMemberProperty=AscCommon.unleakString(uq(val));val=vals["compact"];if(undefined!==val)this.compact=AscCommon.getBoolFromXml(val);val=vals["allDrilled"];if(undefined!==val)this.allDrilled=AscCommon.getBoolFromXml(val);ReadNumXml(vals, uq,this);val=vals["outline"];if(undefined!==val)this.outline=AscCommon.getBoolFromXml(val);val=vals["subtotalTop"];if(undefined!==val)this.subtotalTop=AscCommon.getBoolFromXml(val);val=vals["dragToRow"];if(undefined!==val)this.dragToRow=AscCommon.getBoolFromXml(val);val=vals["dragToCol"];if(undefined!==val)this.dragToCol=AscCommon.getBoolFromXml(val);val=vals["multipleItemSelectionAllowed"];if(undefined!==val)this.multipleItemSelectionAllowed=AscCommon.getBoolFromXml(val);val=vals["dragToPage"];if(undefined!== val)this.dragToPage=AscCommon.getBoolFromXml(val);val=vals["dragToData"];if(undefined!==val)this.dragToData=AscCommon.getBoolFromXml(val);val=vals["dragOff"];if(undefined!==val)this.dragOff=AscCommon.getBoolFromXml(val);val=vals["showAll"];if(undefined!==val)this.showAll=AscCommon.getBoolFromXml(val);val=vals["insertBlankRow"];if(undefined!==val)this.insertBlankRow=AscCommon.getBoolFromXml(val);val=vals["serverField"];if(undefined!==val)this.serverField=AscCommon.getBoolFromXml(val);val=vals["insertPageBreak"]; if(undefined!==val)this.insertPageBreak=AscCommon.getBoolFromXml(val);val=vals["autoShow"];if(undefined!==val)this.autoShow=AscCommon.getBoolFromXml(val);val=vals["topAutoShow"];if(undefined!==val)this.topAutoShow=AscCommon.getBoolFromXml(val);val=vals["hideNewItems"];if(undefined!==val)this.hideNewItems=AscCommon.getBoolFromXml(val);val=vals["measureFilter"];if(undefined!==val)this.measureFilter=AscCommon.getBoolFromXml(val);val=vals["includeNewItemsInFilter"];if(undefined!==val)this.includeNewItemsInFilter= AscCommon.getBoolFromXml(val);val=vals["itemPageCount"];if(undefined!==val)this.itemPageCount=val-0;val=vals["sortType"];if(undefined!==val){val=FromXml_ST_FieldSortType(val);if(-1!==val)this.sortType=val}val=vals["dataSourceSort"];if(undefined!==val)this.dataSourceSort=AscCommon.getBoolFromXml(val);val=vals["nonAutoSortDefault"];if(undefined!==val)this.nonAutoSortDefault=AscCommon.getBoolFromXml(val);val=vals["rankBy"];if(undefined!==val)this.rankBy=val-0;val=vals["defaultSubtotal"];if(undefined!== val)this.defaultSubtotal=AscCommon.getBoolFromXml(val);val=vals["sumSubtotal"];if(undefined!==val)this.sumSubtotal=AscCommon.getBoolFromXml(val);val=vals["countASubtotal"];if(undefined!==val)this.countASubtotal=AscCommon.getBoolFromXml(val);val=vals["avgSubtotal"];if(undefined!==val)this.avgSubtotal=AscCommon.getBoolFromXml(val);val=vals["maxSubtotal"];if(undefined!==val)this.maxSubtotal=AscCommon.getBoolFromXml(val);val=vals["minSubtotal"];if(undefined!==val)this.minSubtotal=AscCommon.getBoolFromXml(val); val=vals["productSubtotal"];if(undefined!==val)this.productSubtotal=AscCommon.getBoolFromXml(val);val=vals["countSubtotal"];if(undefined!==val)this.countSubtotal=AscCommon.getBoolFromXml(val);val=vals["stdDevSubtotal"];if(undefined!==val)this.stdDevSubtotal=AscCommon.getBoolFromXml(val);val=vals["stdDevPSubtotal"];if(undefined!==val)this.stdDevPSubtotal=AscCommon.getBoolFromXml(val);val=vals["varSubtotal"];if(undefined!==val)this.varSubtotal=AscCommon.getBoolFromXml(val);val=vals["varPSubtotal"]; if(undefined!==val)this.varPSubtotal=AscCommon.getBoolFromXml(val);val=vals["showPropCell"];if(undefined!==val)this.showPropCell=AscCommon.getBoolFromXml(val);val=vals["showPropTip"];if(undefined!==val)this.showPropTip=AscCommon.getBoolFromXml(val);val=vals["showPropAsCaption"];if(undefined!==val)this.showPropAsCaption=AscCommon.getBoolFromXml(val);val=vals["defaultAttributeDrillState"];if(undefined!==val)this.defaultAttributeDrillState=AscCommon.getBoolFromXml(val)}};CT_PivotField.prototype.onStartNode= function(elem,attr,uq){var newContext=this;if("items"===elem){newContext=new CT_Items;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.items=newContext}else if("autoSortScope"===elem){newContext=new CT_AutoSortScope;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.autoSortScope=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else newContext=null;return newContext};CT_PivotField.prototype.onEndNode= function(prevContext,elem){if("extLst"===elem)for(var i=0;i<prevContext.ext.length;++i){var ext=prevContext.ext[i];if("{2946ED86-A175-432a-8AC1-64E0C546D7DE}"===ext.uri)this.pivotFieldX14=ext.elem}};CT_PivotField.prototype.toXml=function(writer,name,stylesForWrite){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.axis)writer.WriteXmlAttributeStringEncode("axis",ToXml_ST_Axis(this.axis));if(false!==this.dataField)writer.WriteXmlAttributeBool("dataField", this.dataField);if(null!==this.subtotalCaption)writer.WriteXmlAttributeStringEncode("subtotalCaption",this.subtotalCaption);if(true!==this.showDropDowns)writer.WriteXmlAttributeBool("showDropDowns",this.showDropDowns);if(false!==this.hiddenLevel)writer.WriteXmlAttributeBool("hiddenLevel",this.hiddenLevel);if(null!==this.uniqueMemberProperty)writer.WriteXmlAttributeStringEncode("uniqueMemberProperty",this.uniqueMemberProperty);if(true!==this.compact)writer.WriteXmlAttributeBool("compact",this.compact); if(false!==this.allDrilled)writer.WriteXmlAttributeBool("allDrilled",this.allDrilled);WriteNumXml(writer,this.num,stylesForWrite);if(true!==this.outline)writer.WriteXmlAttributeBool("outline",this.outline);if(true!==this.subtotalTop)writer.WriteXmlAttributeBool("subtotalTop",this.subtotalTop);if(true!==this.dragToRow)writer.WriteXmlAttributeBool("dragToRow",this.dragToRow);if(true!==this.dragToCol)writer.WriteXmlAttributeBool("dragToCol",this.dragToCol);if(false!==this.multipleItemSelectionAllowed)writer.WriteXmlAttributeBool("multipleItemSelectionAllowed", this.multipleItemSelectionAllowed);if(true!==this.dragToPage)writer.WriteXmlAttributeBool("dragToPage",this.dragToPage);if(true!==this.dragToData)writer.WriteXmlAttributeBool("dragToData",this.dragToData);if(true!==this.dragOff)writer.WriteXmlAttributeBool("dragOff",this.dragOff);if(true!==this.showAll)writer.WriteXmlAttributeBool("showAll",this.showAll);if(false!==this.insertBlankRow)writer.WriteXmlAttributeBool("insertBlankRow",this.insertBlankRow);if(false!==this.serverField)writer.WriteXmlAttributeBool("serverField", this.serverField);if(false!==this.insertPageBreak)writer.WriteXmlAttributeBool("insertPageBreak",this.insertPageBreak);if(false!==this.autoShow)writer.WriteXmlAttributeBool("autoShow",this.autoShow);if(true!==this.topAutoShow)writer.WriteXmlAttributeBool("topAutoShow",this.topAutoShow);if(false!==this.hideNewItems)writer.WriteXmlAttributeBool("hideNewItems",this.hideNewItems);if(false!==this.measureFilter)writer.WriteXmlAttributeBool("measureFilter",this.measureFilter);if(false!==this.includeNewItemsInFilter)writer.WriteXmlAttributeBool("includeNewItemsInFilter", this.includeNewItemsInFilter);if(10!==this.itemPageCount)writer.WriteXmlAttributeNumber("itemPageCount",this.itemPageCount);if(c_oAscFieldSortType.Manual!==this.sortType)writer.WriteXmlAttributeStringEncode("sortType",ToXml_ST_FieldSortType(this.sortType));if(null!==this.dataSourceSort)writer.WriteXmlAttributeBool("dataSourceSort",this.dataSourceSort);if(false!==this.nonAutoSortDefault)writer.WriteXmlAttributeBool("nonAutoSortDefault",this.nonAutoSortDefault);if(null!==this.rankBy)writer.WriteXmlAttributeNumber("rankBy", this.rankBy);if(true!==this.defaultSubtotal)writer.WriteXmlAttributeBool("defaultSubtotal",this.defaultSubtotal);if(false!==this.sumSubtotal)writer.WriteXmlAttributeBool("sumSubtotal",this.sumSubtotal);if(false!==this.countASubtotal)writer.WriteXmlAttributeBool("countASubtotal",this.countASubtotal);if(false!==this.avgSubtotal)writer.WriteXmlAttributeBool("avgSubtotal",this.avgSubtotal);if(false!==this.maxSubtotal)writer.WriteXmlAttributeBool("maxSubtotal",this.maxSubtotal);if(false!==this.minSubtotal)writer.WriteXmlAttributeBool("minSubtotal", this.minSubtotal);if(false!==this.productSubtotal)writer.WriteXmlAttributeBool("productSubtotal",this.productSubtotal);if(false!==this.countSubtotal)writer.WriteXmlAttributeBool("countSubtotal",this.countSubtotal);if(false!==this.stdDevSubtotal)writer.WriteXmlAttributeBool("stdDevSubtotal",this.stdDevSubtotal);if(false!==this.stdDevPSubtotal)writer.WriteXmlAttributeBool("stdDevPSubtotal",this.stdDevPSubtotal);if(false!==this.varSubtotal)writer.WriteXmlAttributeBool("varSubtotal",this.varSubtotal); if(false!==this.varPSubtotal)writer.WriteXmlAttributeBool("varPSubtotal",this.varPSubtotal);if(false!==this.showPropCell)writer.WriteXmlAttributeBool("showPropCell",this.showPropCell);if(false!==this.showPropTip)writer.WriteXmlAttributeBool("showPropTip",this.showPropTip);if(false!==this.showPropAsCaption)writer.WriteXmlAttributeBool("showPropAsCaption",this.showPropAsCaption);if(false!==this.defaultAttributeDrillState)writer.WriteXmlAttributeBool("defaultAttributeDrillState",this.defaultAttributeDrillState); writer.WriteXmlNodeEnd(name,true);if(null!==this.items)this.items.toXml(writer,"items");if(null!==this.autoSortScope)this.autoSortScope.toXml(writer,"autoSortScope");if(null!==this.pivotFieldX14){var ext=new CT_Extension;ext.uri="{2946ED86-A175-432a-8AC1-64E0C546D7DE}";ext.elem=this.pivotFieldX14;var extList=new CT_ExtensionList;extList.ext.push(ext);extList.toXml(writer,"extLst")}writer.WriteXmlNodeEnd(name)};CT_PivotField.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.PivotFieldElem}; CT_PivotField.prototype.Write_ToBinary2=function(writer){var t=this;AscCommonExcel.executeInR1C1Mode(false,function(){toXmlWithLength(writer,t,"pivotField")})};CT_PivotField.prototype.Read_FromBinary2=function(reader){var tmp=new XmlReaderWrapper("pivotField",this);var len=reader.GetLong();AscCommonExcel.executeInR1C1Mode(false,function(){(new AscCommon.openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(reader,len),tmp)})};CT_PivotField.prototype.asc_getName=function(){return this.name};CT_PivotField.prototype.asc_getOutline= function(){return this.outline};CT_PivotField.prototype.asc_getCompact=function(){return this.compact};CT_PivotField.prototype.asc_getFillDownLabelsDefault=function(){return!!(this.pivotFieldX14&&this.pivotFieldX14.fillDownLabels)};CT_PivotField.prototype.asc_getInsertBlankRow=function(){return this.insertBlankRow};CT_PivotField.prototype.asc_getDefaultSubtotal=function(){return this.defaultSubtotal};CT_PivotField.prototype.asc_getSubtotalTop=function(){return this.subtotalTop};CT_PivotField.prototype.asc_getShowAll= function(){return this.showAll};CT_PivotField.prototype.asc_getSubtotals=function(withDefault){var res=[];if(this.defaultSubtotal){if(this.sumSubtotal)res.push(Asc.c_oAscItemType.Sum);if(this.countASubtotal)res.push(Asc.c_oAscItemType.CountA);if(this.avgSubtotal)res.push(Asc.c_oAscItemType.Avg);if(this.maxSubtotal)res.push(Asc.c_oAscItemType.Max);if(this.minSubtotal)res.push(Asc.c_oAscItemType.Min);if(this.productSubtotal)res.push(Asc.c_oAscItemType.Product);if(this.countSubtotal)res.push(Asc.c_oAscItemType.Count); if(this.stdDevSubtotal)res.push(Asc.c_oAscItemType.StdDev);if(this.stdDevPSubtotal)res.push(Asc.c_oAscItemType.StdDevP);if(this.varSubtotal)res.push(Asc.c_oAscItemType.Var);if(this.varPSubtotal)res.push(Asc.c_oAscItemType.VarP);if(withDefault&&0===res.length)res.push(Asc.c_oAscItemType.Default)}return res};CT_PivotField.prototype.getItemsCount=function(){return this.items&&this.items.item.length||0};CT_PivotField.prototype.getItems=function(){return this.items&&this.items.item};CT_PivotField.prototype.getItem= function(index){return this.items&&this.items.item[index]};CT_PivotField.prototype.checkSubtotal=function(){if(!this.items)return;this.removeSubtotal();var newItem,i;var subtotals=this.asc_getSubtotals(true);for(i=0;i<subtotals.length;++i){newItem=new CT_Item;newItem.t=subtotals[i];this.items.item.push(newItem)}};CT_PivotField.prototype.removeSubtotal=function(){if(!this.items)return;var i,items=this.items.item;for(i=items.length-1;i>=0;--i){var item=items[i];if(!(Asc.c_oAscItemType.Data===item.t|| Asc.c_oAscItemType.Blank===item.t))items.splice(i,1)}};CT_PivotField.prototype.checkSubtotalTop=function(){return this.asc_getSubtotalTop()&&1===this.asc_getSubtotals(true).length};CT_PivotField.prototype.getSubtotalType=function(){var subtotals=this.asc_getSubtotals(true);return 1===subtotals.length?subtotals[0]:Asc.c_oAscItemType.Default};CT_PivotField.prototype.getVisibleIndexes=function(){var res=[];var items=this.getItems();if(items)for(var i=0;i<items.length;++i){var item=items[i];if((Asc.c_oAscItemType.Data=== item.t||Asc.c_oAscItemType.Blank===item.t)&&false===item.h)res.push(i)}return res};CT_PivotField.prototype.isAllVisible=function(){var items=this.getItems();if(items)for(var i=0;i<items.length;++i){var item=items[i];if((Asc.c_oAscItemType.Data===item.t||Asc.c_oAscItemType.Blank===item.t)&&true===item.h)return false}return true};CT_PivotField.prototype.getFilterObject=function(cacheField,pageFilterItem,num){var values=[];var items=this.getItems();if(items)for(var i=0;i<items.length;++i){var item=items[i]; if(Asc.c_oAscItemType.Data===item.t||Asc.c_oAscItemType.Blank===item.t){var elem=AscCommonExcel.AutoFiltersOptionsElements();elem.val=elem.text="";if(Asc.c_oAscItemType.Data===item.t){var sharedItem=cacheField.getSharedItem(item.x);if(sharedItem)elem.val=elem.text=sharedItem.getCellValue().getTextValue(num)}elem.visible=!item.h&&(null==pageFilterItem||i===pageFilterItem);elem.isDateFormat=false;elem.repeats=undefined;values.push(elem)}}return values};CT_PivotField.prototype.getFilterMapFilterColumn= function(cacheField,filterColumn,num){var map=new Map;var items=this.getItems();if(items)for(var i=0;i<items.length;++i){var item=items[i];if(Asc.c_oAscItemType.Data===item.t||Asc.c_oAscItemType.Blank===item.t){var val="";if(Asc.c_oAscItemType.Data===item.t){var sharedItem=cacheField.getSharedItem(item.x);if(sharedItem)val=sharedItem.getCellValue().getTextValue(num)}if(!filterColumn.isHideValue(val,null,null,null,true))map.set(item.x,1)}}return map};CT_PivotField.prototype.getFilterMap=function(){var map= new Map;var items=this.getItems();if(items)for(var i=0;i<items.length;++i){var item=items[i];if((Asc.c_oAscItemType.Data===item.t||Asc.c_oAscItemType.Blank===item.t)&&false===item.h)map.set(item.x,1)}return map};CT_PivotField.prototype.applyFilterObject=function(values){var items=this.getItems();if(items)for(var i=0;i<values.length&&i<items.length;++i)items[i].h=!values[i].visible};CT_PivotField.prototype.removeFilter=function(){var items=this.getItems();if(items)for(var i=0;i<items.length;++i)items[i].h= false};CT_PivotField.prototype.sortItems=function(type,sharedItems){if(this.items&&this.items.item){var sign=Asc.c_oAscSortOptions.Ascending==type?1:-1;this.items.item.sort(function(a,b){return sign*cmpPivotItems(sharedItems,a,b)})}};CT_PivotField.prototype.getSortVal=function(){var sortVal=null;if(c_oAscFieldSortType.Ascending===this.sortType)sortVal=Asc.c_oAscSortOptions.Ascending;else if(c_oAscFieldSortType.Descending===this.sortType)sortVal=Asc.c_oAscSortOptions.Descending;return sortVal};CT_PivotField.prototype.getSortDataIndex= function(){if(this.autoSortScope&&this.autoSortScope.pivotArea&&this.autoSortScope.pivotArea.references){var reference=this.autoSortScope.pivotArea.references.reference[0];if(reference&&reference.x[0])return reference.x[0].v}return-1};CT_PivotField.prototype.asc_set=function(api,pivot,index,newVal){var pivotFields=pivot.asc_getPivotFields();if(pivotFields&&index<pivotFields.length){var field=pivotFields[index];api._changePivotWithLock(pivot,function(ws){if(null!==newVal.name)field.asc_setName(newVal.name, pivot,index,true);if(null!==newVal.outline)field.asc_setOutline(newVal.outline,pivot,index,true);if(null!==newVal.compact)field.asc_setCompact(newVal.compact,pivot,index,true);if(null!==newVal.ascFillDownLabels)field.setFillDownLabelsDefault(newVal.ascFillDownLabels,pivot,index,true);if(null!==newVal.insertBlankRow)field.asc_setInsertBlankRow(newVal.insertBlankRow,pivot,index,true);if(null!==newVal.defaultSubtotal)field.asc_setDefaultSubtotal(newVal.defaultSubtotal,pivot,index,true);if(null!==newVal.subtotalTop)field.asc_setSubtotalTop(newVal.subtotalTop, pivot,index,true);if(null!==newVal.showAll)field.asc_setShowAll(newVal.showAll,pivot,index,true);if(null!==newVal.ascSubtotals)field.setSubtotals(newVal.ascSubtotals,pivot,index,true);field.checkSubtotal()})}};CT_PivotField.prototype.asc_setName=function(newVal,pivot,index,addToHistory){setFieldProperty(pivot,index,this.name,newVal,addToHistory,AscCH.historyitem_PivotTable_PivotFieldSetName,true);this.name=newVal};CT_PivotField.prototype.asc_setOutline=function(newVal,pivot,index,addToHistory){setFieldProperty(pivot, index,this.outline,newVal,addToHistory,AscCH.historyitem_PivotTable_PivotFieldSetOutline,true);this.outline=newVal};CT_PivotField.prototype.asc_setCompact=function(newVal,pivot,index,addToHistory){setFieldProperty(pivot,index,this.compact,newVal,addToHistory,AscCH.historyitem_PivotTable_PivotFieldSetCompact,true);this.compact=newVal};CT_PivotField.prototype.asc_setFillDownLabelsDefault=function(newVal){this.ascFillDownLabels=newVal};CT_PivotField.prototype.setFillDownLabelsDefault=function(newVal, pivot,index,addToHistory){if(!this.pivotFieldX14)this.pivotFieldX14=new CT_PivotFieldX14;var oldVal=this.pivotFieldX14.fillDownLabels;setFieldProperty(pivot,index,oldVal,newVal,addToHistory,AscCH.historyitem_PivotTable_PivotFieldFillDownLabelsDefault,true);this.pivotFieldX14.fillDownLabels=newVal};CT_PivotField.prototype.asc_setInsertBlankRow=function(newVal,pivot,index,addToHistory){setFieldProperty(pivot,index,this.insertBlankRow,newVal,addToHistory,AscCH.historyitem_PivotTable_PivotFieldSetInsertBlankRow, true);this.insertBlankRow=newVal};CT_PivotField.prototype.asc_setDefaultSubtotal=function(newVal,pivot,index,addToHistory){setFieldProperty(pivot,index,this.defaultSubtotal,newVal,addToHistory,AscCH.historyitem_PivotTable_PivotFieldSetDefaultSubtotal,true);this.defaultSubtotal=newVal};CT_PivotField.prototype.asc_setSubtotalTop=function(newVal,pivot,index,addToHistory){setFieldProperty(pivot,index,this.subtotalTop,newVal,addToHistory,AscCH.historyitem_PivotTable_PivotFieldSetSubtotalTop,true);this.subtotalTop= newVal};CT_PivotField.prototype.asc_setShowAll=function(newVal,pivot,index,addToHistory){setFieldProperty(pivot,index,this.showAll,newVal,addToHistory,AscCH.historyitem_PivotTable_PivotFieldSetShowAll,true);this.showAll=newVal};CT_PivotField.prototype.asc_setSubtotals=function(newVals){this.ascSubtotals=newVals};CT_PivotField.prototype.setSubtotals=function(newVals,pivot,index,addToHistory){var oldVals=this.asc_getSubtotals();setFieldProperty(pivot,index,oldVals,newVals,addToHistory,AscCH.historyitem_PivotTable_PivotFieldSetSubtotals, true);this.sumSubtotal=this.countASubtotal=this.avgSubtotal=this.maxSubtotal=this.minSubtotal=false;this.productSubtotal=this.countSubtotal=this.stdDevSubtotal=this.stdDevPSubtotal=this.varSubtotal=false;this.varPSubtotal=false;for(var i=0;i<newVals.length;++i){var type=newVals[i];switch(type){case Asc.c_oAscItemType.Sum:this.sumSubtotal=true;break;case Asc.c_oAscItemType.CountA:this.countASubtotal=true;break;case Asc.c_oAscItemType.Avg:this.avgSubtotal=true;break;case Asc.c_oAscItemType.Max:this.maxSubtotal= true;break;case Asc.c_oAscItemType.Min:this.minSubtotal=true;break;case Asc.c_oAscItemType.Product:this.productSubtotal=true;break;case Asc.c_oAscItemType.Count:this.countSubtotal=true;break;case Asc.c_oAscItemType.StdDev:this.stdDevSubtotal=true;break;case Asc.c_oAscItemType.StdDevP:this.stdDevPSubtotal=true;break;case Asc.c_oAscItemType.Var:this.varSubtotal=true;break;case Asc.c_oAscItemType.VarP:this.varPSubtotal=true;break}}};CT_PivotField.prototype.setSortType=function(sortVal,sortDataIndex){this.sortType= c_oAscFieldSortType.Manual;if(Asc.c_oAscSortOptions.Ascending===sortVal)this.sortType=c_oAscFieldSortType.Ascending;else if(Asc.c_oAscSortOptions.Descending===sortVal)this.sortType=c_oAscFieldSortType.Descending;if(this.sortType!==c_oAscFieldSortType.Manual&&sortDataIndex>=0){var x=new CT_Index;x.v=sortDataIndex;var reference=new CT_PivotAreaReference;reference.field=4294967294;reference.selected=false;reference.x.push(x);var references=new CT_PivotAreaReferences;references.reference.push(reference); var pivotArea=new CT_PivotArea;pivotArea.dataOnly=false;pivotArea.outline=false;pivotArea.fieldPosition=0;pivotArea.references=references;var autoSortScope=new CT_AutoSortScope;autoSortScope.pivotArea=pivotArea;this.autoSortScope=autoSortScope}else this.autoSortScope=null};function CT_PivotFieldX14(){this.fillDownLabels=false;this.ignore=false}CT_PivotFieldX14.prototype.clone=function(){var res=new CT_PivotFieldX14(true);res.fillDownLabels=this.fillDownLabels;res.ignore=this.ignore;return res};CT_PivotFieldX14.prototype.readAttributes= function(attr,uq){if(attr()){var vals=attr();var val;val=vals["fillDownLabels"];if(undefined!==val)this.fillDownLabels=AscCommon.getBoolFromXml(val);val=vals["ignore"];if(undefined!==val)this.ignore=AscCommon.getBoolFromXml(val)}};CT_PivotFieldX14.prototype.toXml=function(writer){writer.WriteXmlNodeStart("x14:pivotField");if(false!==this.fillDownLabels)writer.WriteXmlAttributeBool("fillDownLabels",this.fillDownLabels);if(false!==this.ignore)writer.WriteXmlAttributeBool("ignore",this.ignore);writer.WriteXmlNodeEnd("x14:pivotField", true,true)};function CT_Field(){this.x=null}CT_Field.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["x"];if(undefined!==val)this.x=val-0}};CT_Field.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.x)writer.WriteXmlAttributeNumber("x",this.x);writer.WriteXmlNodeEnd(name,true,true)};CT_Field.prototype.asc_getIndex=function(){return this.x||0};function CT_I(){this.t=Asc.c_oAscItemType.Data;this.r=0;this.i=0;this.x=[]}CT_I.prototype.readAttributes= function(attr,uq){if(attr()){var vals=attr();var val;val=vals["t"];if(undefined!==val){val=FromXml_ST_ItemType(val);if(-1!==val)this.t=val}val=vals["r"];if(undefined!==val)this.r=val-0;val=vals["i"];if(undefined!==val)this.i=val-0}};CT_I.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("x"===elem){newContext=new CT_X;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else newContext=null;return newContext};CT_I.prototype.toXml=function(writer, name){writer.WriteXmlNodeStart(name);if(Asc.c_oAscItemType.Data!==this.t)writer.WriteXmlAttributeStringEncode("t",ToXml_ST_ItemType(this.t));if(0!==this.r)writer.WriteXmlAttributeNumber("r",this.r);if(0!==this.i)writer.WriteXmlAttributeNumber("i",this.i);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.x.length;++i){var elem=this.x[i];elem.toXml(writer,"x")}writer.WriteXmlNodeEnd(name)};CT_I.prototype.getR=function(){return this.r};function CT_PageField(){this.fld=null;this.item=null;this.hier= null;this.name=null;this.cap=null;this.extLst=null}CT_PageField.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["fld"];if(undefined!==val)this.fld=val-0;val=vals["item"];if(undefined!==val)this.item=val-0;val=vals["hier"];if(undefined!==val)this.hier=val-0;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["cap"];if(undefined!==val)this.cap=AscCommon.unleakString(uq(val))}};CT_PageField.prototype.onStartNode=function(elem, attr,uq){var newContext=this;if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_PageField.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.fld)writer.WriteXmlAttributeNumber("fld",this.fld);if(null!==this.item)writer.WriteXmlAttributeNumber("item",this.item);if(null!==this.hier)writer.WriteXmlAttributeNumber("hier",this.hier);if(null!== this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.cap)writer.WriteXmlAttributeStringEncode("cap",this.cap);writer.WriteXmlNodeEnd(name,true);if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};CT_PageField.prototype.asc_getName=function(){return this.name};CT_PageField.prototype.asc_getIndex=function(){return this.fld||0};function CT_DataField(setDefaults){this.name=null;this.fld=null;this.subtotal=null;this.showDataAs=null;this.baseField= null;this.baseItem=null;this.numFmtId=null;this.num=null;this.extLst=null;if(setDefaults)this.setDefaults()}CT_DataField.prototype.initPostOpenZip=function(oNumFmts){if(null!==this.numFmtId){this.num=AscCommonExcel.Num.prototype.initFromParams(this.numFmtId,null,oNumFmts);this.numFmtId=null}};CT_DataField.prototype.setDefaults=function(){this.subtotal=c_oAscDataConsolidateFunction.Sum;this.showDataAs=c_oAscShowDataAs.Normal;this.baseField=-1;this.baseItem=1048832};CT_DataField.prototype.readAttributes= function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["fld"];if(undefined!==val)this.fld=val-0;val=vals["subtotal"];if(undefined!==val){val=FromXml_ST_DataConsolidateFunction(val);if(-1!==val)this.subtotal=val}val=vals["showDataAs"];if(undefined!==val){val=FromXml_ST_ShowDataAs(val);if(-1!==val)this.showDataAs=val}val=vals["baseField"];if(undefined!==val)this.baseField=val-0;val=vals["baseItem"];if(undefined!==val)this.baseItem= val-0;ReadNumXml(vals,uq,this)}};CT_DataField.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_DataField.prototype.toXml=function(writer,name,stylesForWrite){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.fld)writer.WriteXmlAttributeNumber("fld", this.fld);if(c_oAscDataConsolidateFunction.Sum!==this.subtotal)writer.WriteXmlAttributeStringEncode("subtotal",ToXml_ST_DataConsolidateFunction(this.subtotal));if(c_oAscShowDataAs.Normal!==this.showDataAs)writer.WriteXmlAttributeStringEncode("showDataAs",ToXml_ST_ShowDataAs(this.showDataAs));if(null!==this.baseField)writer.WriteXmlAttributeNumber("baseField",this.baseField);if(null!==this.baseItem)writer.WriteXmlAttributeNumber("baseItem",this.baseItem);WriteNumXml(writer,this.num,stylesForWrite); writer.WriteXmlNodeEnd(name,true);if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};CT_DataField.prototype.asc_getName=function(){return this.name};CT_DataField.prototype.asc_getIndex=function(){return this.fld||0};CT_DataField.prototype.asc_getSubtotal=function(){return this.subtotal};CT_DataField.prototype.asc_getShowDataAs=function(){return this.showDataAs};CT_DataField.prototype.asc_set=function(api,pivot,index,newVal){var dataFields=pivot.asc_getDataFields(); if(dataFields&&index<dataFields.length){var field=dataFields[index];api._changePivotWithLock(pivot,function(ws){if(null!==newVal.name)field.asc_setName(newVal.name,pivot,index,true);if(null!==newVal.subtotal)field.asc_setSubtotal(newVal.subtotal,pivot,index,true)})}};CT_DataField.prototype.asc_setName=function(newVal,pivot,index,addToHistory){setFieldProperty(pivot,index,this.name,newVal,addToHistory,AscCH.historyitem_PivotTable_DataFieldSetName,true);this.name=newVal};CT_DataField.prototype.asc_setSubtotal= function(newVal,pivot,index,addToHistory){setFieldProperty(pivot,index,this.subtotal,newVal,addToHistory,AscCH.historyitem_PivotTable_DataFieldSetSubtotal,true);this.subtotal=newVal};function CT_Format(){this.action=c_oAscFormatAction.Formatting;this.dxfId=null;this.pivotArea=null;this.extLst=null}CT_Format.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["action"];if(undefined!==val){val=FromXml_ST_FormatAction(val);if(-1!==val)this.action=val}val=vals["dxfId"]; if(undefined!==val)this.dxfId=val-0}};CT_Format.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotArea"===elem){newContext=new CT_PivotArea;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotArea=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_Format.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(c_oAscFormatAction.Formatting!==this.action)writer.WriteXmlAttributeStringEncode("action",ToXml_ST_FormatAction(this.action));writer.WriteXmlNodeEnd(name,true);if(null!==this.pivotArea)this.pivotArea.toXml(writer,"pivotArea");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_ConditionalFormat(){this.scope=c_oAscScope.Selection;this.type=c_oAscType.None;this.priority=null;this.pivotAreas=null;this.extLst=null}CT_ConditionalFormat.prototype.readAttributes= function(attr,uq){if(attr()){var vals=attr();var val;val=vals["scope"];if(undefined!==val){val=FromXml_ST_Scope(val);if(-1!==val)this.scope=val}val=vals["type"];if(undefined!==val){val=FromXml_ST_Type(val);if(-1!==val)this.type=val}val=vals["priority"];if(undefined!==val)this.priority=val-0}};CT_ConditionalFormat.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotAreas"===elem){newContext=new CT_PivotAreas;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotAreas= newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_ConditionalFormat.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(c_oAscScope.Selection!==this.scope)writer.WriteXmlAttributeStringEncode("scope",ToXml_ST_Scope(this.scope));if(c_oAscType.None!==this.type)writer.WriteXmlAttributeStringEncode("type",ToXml_ST_Type(this.type));if(null!== this.priority)writer.WriteXmlAttributeNumber("priority",this.priority);writer.WriteXmlNodeEnd(name,true);if(null!==this.pivotAreas)this.pivotAreas.toXml(writer,"pivotAreas");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_ChartFormat(){this.chart=null;this.format=null;this.series=false;this.pivotArea=null}CT_ChartFormat.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["chart"];if(undefined!==val)this.chart=val- 0;val=vals["format"];if(undefined!==val)this.format=val-0;val=vals["series"];if(undefined!==val)this.series=AscCommon.getBoolFromXml(val)}};CT_ChartFormat.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotArea"===elem){newContext=new CT_PivotArea;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.pivotArea=newContext}else newContext=null;return newContext};CT_ChartFormat.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.chart)writer.WriteXmlAttributeNumber("chart", this.chart);if(null!==this.format)writer.WriteXmlAttributeNumber("format",this.format);if(false!==this.series)writer.WriteXmlAttributeBool("series",this.series);writer.WriteXmlNodeEnd(name,true);if(null!==this.pivotArea)this.pivotArea.toXml(writer,"pivotArea");writer.WriteXmlNodeEnd(name)};function CT_PivotHierarchy(){this.outline=false;this.multipleItemSelectionAllowed=false;this.subtotalTop=false;this.showInFieldList=true;this.dragToRow=true;this.dragToCol=true;this.dragToPage=true;this.dragToData= false;this.dragOff=true;this.includeNewItemsInFilter=false;this.caption=null;this.mps=null;this.members=[];this.extLst=null}CT_PivotHierarchy.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["outline"];if(undefined!==val)this.outline=AscCommon.getBoolFromXml(val);val=vals["multipleItemSelectionAllowed"];if(undefined!==val)this.multipleItemSelectionAllowed=AscCommon.getBoolFromXml(val);val=vals["subtotalTop"];if(undefined!==val)this.subtotalTop=AscCommon.getBoolFromXml(val); val=vals["showInFieldList"];if(undefined!==val)this.showInFieldList=AscCommon.getBoolFromXml(val);val=vals["dragToRow"];if(undefined!==val)this.dragToRow=AscCommon.getBoolFromXml(val);val=vals["dragToCol"];if(undefined!==val)this.dragToCol=AscCommon.getBoolFromXml(val);val=vals["dragToPage"];if(undefined!==val)this.dragToPage=AscCommon.getBoolFromXml(val);val=vals["dragToData"];if(undefined!==val)this.dragToData=AscCommon.getBoolFromXml(val);val=vals["dragOff"];if(undefined!==val)this.dragOff=AscCommon.getBoolFromXml(val); val=vals["includeNewItemsInFilter"];if(undefined!==val)this.includeNewItemsInFilter=AscCommon.getBoolFromXml(val);val=vals["caption"];if(undefined!==val)this.caption=AscCommon.unleakString(uq(val))}};CT_PivotHierarchy.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("mps"===elem){newContext=new CT_MemberProperties;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.mps=newContext}else if("members"===elem){newContext=new CT_Members;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.members.push(newContext)}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_PivotHierarchy.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(false!==this.outline)writer.WriteXmlAttributeBool("outline",this.outline);if(false!==this.multipleItemSelectionAllowed)writer.WriteXmlAttributeBool("multipleItemSelectionAllowed",this.multipleItemSelectionAllowed); if(false!==this.subtotalTop)writer.WriteXmlAttributeBool("subtotalTop",this.subtotalTop);if(true!==this.showInFieldList)writer.WriteXmlAttributeBool("showInFieldList",this.showInFieldList);if(true!==this.dragToRow)writer.WriteXmlAttributeBool("dragToRow",this.dragToRow);if(true!==this.dragToCol)writer.WriteXmlAttributeBool("dragToCol",this.dragToCol);if(true!==this.dragToPage)writer.WriteXmlAttributeBool("dragToPage",this.dragToPage);if(false!==this.dragToData)writer.WriteXmlAttributeBool("dragToData", this.dragToData);if(true!==this.dragOff)writer.WriteXmlAttributeBool("dragOff",this.dragOff);if(false!==this.includeNewItemsInFilter)writer.WriteXmlAttributeBool("includeNewItemsInFilter",this.includeNewItemsInFilter);if(null!==this.caption)writer.WriteXmlAttributeStringEncode("caption",this.caption);writer.WriteXmlNodeEnd(name,true);if(null!==this.mps)this.mps.toXml(writer,"mps");for(var i=0;i<this.members.length;++i){var elem=this.members[i];elem.toXml(writer,"members")}if(null!==this.extLst)this.extLst.toXml(writer, "extLst");writer.WriteXmlNodeEnd(name)};function CT_PivotFilter(){this.fld=null;this.mpFld=null;this.type=null;this.evalOrder=0;this.iMeasureHier=null;this.iMeasureFld=null;this.name=null;this.description=null;this.stringValue1=null;this.stringValue2=null;this.autoFilter=null;this.extLst=null}CT_PivotFilter.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["fld"];if(undefined!==val)this.fld=val-0;val=vals["mpFld"];if(undefined!==val)this.mpFld=val-0;val=vals["type"]; if(undefined!==val){val=FromXml_ST_PivotFilterType(val);if(-1!==val)this.type=val}val=vals["evalOrder"];if(undefined!==val)this.evalOrder=val-0;val=vals["iMeasureHier"];if(undefined!==val)this.iMeasureHier=val-0;val=vals["iMeasureFld"];if(undefined!==val)this.iMeasureFld=val-0;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["description"];if(undefined!==val)this.description=AscCommon.unleakString(uq(val));val=vals["stringValue1"];if(undefined!==val)this.stringValue1= AscCommon.unleakString(uq(val));val=vals["stringValue2"];if(undefined!==val)this.stringValue2=AscCommon.unleakString(uq(val))}};CT_PivotFilter.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("autoFilter"===elem){newContext=new AscCommonExcel.AutoFilter;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.autoFilter=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext= null;return newContext};CT_PivotFilter.prototype.toXml=function(writer,name,id){writer.WriteXmlNodeStart(name);if(null!==this.fld)writer.WriteXmlAttributeNumber("fld",this.fld);if(null!==this.mpFld)writer.WriteXmlAttributeNumber("mpFld",this.mpFld);if(null!==this.type)writer.WriteXmlAttributeStringEncode("type",ToXml_ST_PivotFilterType(this.type));if(0!==this.evalOrder)writer.WriteXmlAttributeNumber("evalOrder",this.evalOrder);if(null!==id)writer.WriteXmlAttributeNumber("id",id);if(null!==this.iMeasureHier)writer.WriteXmlAttributeNumber("iMeasureHier", this.iMeasureHier);if(null!==this.iMeasureFld)writer.WriteXmlAttributeNumber("iMeasureFld",this.iMeasureFld);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.description)writer.WriteXmlAttributeStringEncode("description",this.description);if(null!==this.stringValue1)writer.WriteXmlAttributeStringEncode("stringValue1",this.stringValue1);if(null!==this.stringValue2)writer.WriteXmlAttributeStringEncode("stringValue2",this.stringValue2);writer.WriteXmlNodeEnd(name, true);if(null!==this.autoFilter)this.autoFilter.toXml(writer,"autoFilter");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};CT_PivotFilter.prototype.getType=function(){return AscCommonExcel.UndoRedoDataTypes.PivotFilter};CT_PivotFilter.prototype.Write_ToBinary2=function(writer){var t=this;AscCommonExcel.executeInR1C1Mode(false,function(){toXmlWithLength(writer,t,"pivotFilter",null)})};CT_PivotFilter.prototype.Read_FromBinary2=function(reader){var tmp=new XmlReaderWrapper("pivotFilter", this);var len=reader.GetLong();AscCommonExcel.executeInR1C1Mode(false,function(){(new AscCommon.openXml.SaxParserBase).parse(AscCommon.GetStringUtf8(reader,len),tmp)})};CT_PivotFilter.prototype.isLabelFilter=function(){return!this.isValueFilter()};CT_PivotFilter.prototype.isValueFilter=function(){return c_oAscPivotFilterType.ValueEqual<=this.type&&this.type<=c_oAscPivotFilterType.ValueNotBetween||c_oAscPivotFilterType.Count<=this.type&&this.type<=c_oAscPivotFilterType.Sum};CT_PivotFilter.prototype.getFilterColumn= function(){return this.autoFilter&&this.autoFilter.FilterColumns&&this.autoFilter.FilterColumns[0]};CT_PivotFilter.prototype.initTemplate=function(fld){var filterColumn=new AscCommonExcel.FilterColumn;filterColumn.ColId=0;var autoFilter=new AscCommonExcel.AutoFilter;autoFilter.Ref=new Asc.Range(0,0,0,0);autoFilter.FilterColumns=[filterColumn];this.fld=fld;this.evalOrder=-1;this.autoFilter=autoFilter;this.type=Asc.c_oAscPivotFilterType.Unknown};CT_PivotFilter.prototype.initFromCustom=function(index, filter,iMeasureFld){this.initTemplate(index);this.fld=index;this.iMeasureFld=iMeasureFld;var isCaption=null===iMeasureFld;var isDate=false;var baseEqual;var baseBetween;if(isCaption){baseEqual=Asc.c_oAscPivotFilterType.CaptionEqual;baseBetween=Asc.c_oAscPivotFilterType.CaptionBetween}else if(isDate){baseEqual=Asc.c_oAscPivotFilterType.DateEqual;baseBetween=Asc.c_oAscPivotFilterType.DateBetween}else{baseEqual=Asc.c_oAscPivotFilterType.ValueEqual;baseBetween=Asc.c_oAscPivotFilterType.ValueBetween}if(filter.CustomFilters)if(1=== filter.CustomFilters.length){filter.asc_setAnd(false);this.type=baseEqual+filter.CustomFilters[0].Operator-c_oAscCustomAutoFilter.equals;if(this.type!==Asc.c_oAscPivotFilterType.Unknown&&isCaption)this.stringValue1=filter.CustomFilters[0].Val}else if(2===filter.CustomFilters.length){if(filter.CustomFilters[0].Operator===c_oAscCustomAutoFilter.isGreaterThanOrEqualTo&&filter.CustomFilters[1].Operator===c_oAscCustomAutoFilter.isLessThanOrEqualTo&&true===filter.And)this.type=baseBetween;else if(filter.CustomFilters[0].Operator=== c_oAscCustomAutoFilter.isLessThan&&filter.CustomFilters[1].Operator===c_oAscCustomAutoFilter.isGreaterThan&&false===filter.And)this.type=baseBetween+Asc.c_oAscPivotFilterType.CaptionNotBetween-Asc.c_oAscPivotFilterType.CaptionBetween;if(this.type!==Asc.c_oAscPivotFilterType.Unknown&&isCaption){this.stringValue1=filter.CustomFilters[0].Val;this.stringValue2=filter.CustomFilters[1].Val}}this.autoFilter.FilterColumns[0].CustomFiltersObj=filter};CT_PivotFilter.prototype.initFromDynamic=function(index, filter){this.initTemplate(index);if(Asc.c_oAscDynamicAutoFilter.aboveAverage!==filter.asc_getType()&&Asc.c_oAscDynamicAutoFilter.belowAverage!==filter.asc_getType())this.type=filter.asc_getType();else this.type=Asc.c_oAscPivotFilterType.Unknown;this.autoFilter.FilterColumns[0].DynamicFilter=filter};CT_PivotFilter.prototype.initFromTop10=function(index,filter,isSum,iMeasureFld){this.initTemplate(index);if(filter.asc_getPercent())this.type=Asc.c_oAscPivotFilterType.Percent;else if(isSum)this.type=Asc.c_oAscPivotFilterType.Sum; else this.type=Asc.c_oAscPivotFilterType.Count;this.iMeasureFld=iMeasureFld;this.autoFilter.FilterColumns[0].Top10=filter};CT_PivotFilter.prototype.setMeasureFld=function(val){this.iMeasureFld=val};function CT_HierarchyUsage(){this.hierarchyUsage=null}CT_HierarchyUsage.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["hierarchyUsage"];if(undefined!==val)this.hierarchyUsage=val-0}};CT_HierarchyUsage.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(null!==this.hierarchyUsage)writer.WriteXmlAttributeNumber("hierarchyUsage",this.hierarchyUsage);writer.WriteXmlNodeEnd(name,true,true)};function CT_Pages(){this.page=[]}CT_Pages.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("page"===elem){newContext=new CT_PCDSCPage;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.page.push(newContext)}else newContext=null;return newContext};CT_Pages.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(this.page.length>0)writer.WriteXmlAttributeNumber("count",this.page.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.page.length;++i){var elem=this.page[i];elem.toXml(writer,"page")}writer.WriteXmlNodeEnd(name)};function CT_RangeSets(){this.rangeSet=[]}CT_RangeSets.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("rangeSet"===elem){newContext=new CT_RangeSet;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.rangeSet.push(newContext)}else newContext= null;return newContext};CT_RangeSets.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.rangeSet.length>0)writer.WriteXmlAttributeNumber("count",this.rangeSet.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.rangeSet.length;++i){var elem=this.rangeSet[i];elem.toXml(writer,"rangeSet")}writer.WriteXmlNodeEnd(name)};function CT_SharedItems(){this.containsSemiMixedTypes=true;this.containsNonDate=true;this.containsDate=false;this.containsString=true;this.containsBlank= false;this.containsMixedTypes=false;this.containsNumber=false;this.containsInteger=false;this.minValue=null;this.maxValue=null;this.minDate=null;this.maxDate=null;this.longText=false;this.Items=new PivotRecords}CT_SharedItems.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["containsSemiMixedTypes"];if(undefined!==val)this.containsSemiMixedTypes=AscCommon.getBoolFromXml(val);val=vals["containsNonDate"];if(undefined!==val)this.containsNonDate=AscCommon.getBoolFromXml(val); val=vals["containsDate"];if(undefined!==val)this.containsDate=AscCommon.getBoolFromXml(val);val=vals["containsString"];if(undefined!==val)this.containsString=AscCommon.getBoolFromXml(val);val=vals["containsBlank"];if(undefined!==val)this.containsBlank=AscCommon.getBoolFromXml(val);val=vals["containsMixedTypes"];if(undefined!==val)this.containsMixedTypes=AscCommon.getBoolFromXml(val);val=vals["containsNumber"];if(undefined!==val)this.containsNumber=AscCommon.getBoolFromXml(val);val=vals["containsInteger"]; if(undefined!==val)this.containsInteger=AscCommon.getBoolFromXml(val);val=vals["minValue"];if(undefined!==val)this.minValue=val-0;val=vals["maxValue"];if(undefined!==val)this.maxValue=val-0;val=vals["minDate"];if(undefined!==val)this.minDate=AscCommon.unleakString(uq(val));val=vals["maxDate"];if(undefined!==val)this.maxDate=AscCommon.unleakString(uq(val));val=vals["longText"];if(undefined!==val)this.longText=AscCommon.getBoolFromXml(val)}};CT_SharedItems.prototype.onStartNode=function(elem,attr,uq){var newContext= this;var newContextCandidate=this.Items.onStartNode(elem,attr,uq);if(newContextCandidate)newContext=newContextCandidate;else newContext=null;return newContext};CT_SharedItems.prototype.onEndNode=function(prevContext,elem){this.Items.onEndNode(prevContext,elem)};CT_SharedItems.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(true!==this.containsSemiMixedTypes)writer.WriteXmlAttributeBool("containsSemiMixedTypes",this.containsSemiMixedTypes);if(true!==this.containsNonDate)writer.WriteXmlAttributeBool("containsNonDate", this.containsNonDate);if(false!==this.containsDate)writer.WriteXmlAttributeBool("containsDate",this.containsDate);if(true!==this.containsString)writer.WriteXmlAttributeBool("containsString",this.containsString);if(false!==this.containsBlank)writer.WriteXmlAttributeBool("containsBlank",this.containsBlank);if(false!==this.containsMixedTypes)writer.WriteXmlAttributeBool("containsMixedTypes",this.containsMixedTypes);if(false!==this.containsNumber)writer.WriteXmlAttributeBool("containsNumber",this.containsNumber); if(false!==this.containsInteger)writer.WriteXmlAttributeBool("containsInteger",this.containsInteger);if(null!==this.minValue)writer.WriteXmlAttributeNumber("minValue",this.minValue);if(null!==this.maxValue)writer.WriteXmlAttributeNumber("maxValue",this.maxValue);if(null!==this.minDate)writer.WriteXmlAttributeStringEncode("minDate",this.minDate);if(null!==this.maxDate)writer.WriteXmlAttributeStringEncode("maxDate",this.maxDate);var count=this.Items.getSize();if(count>0)writer.WriteXmlAttributeNumber("count", count);if(false!==this.longText)writer.WriteXmlAttributeBool("longText",this.longText);writer.WriteXmlNodeEnd(name,true);this.Items.toXml(writer);writer.WriteXmlNodeEnd(name)};function CT_FieldGroup(){this.par=null;this.base=null;this.rangePr=null;this.discretePr=null;this.groupItems=null}CT_FieldGroup.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["par"];if(undefined!==val)this.par=val-0;val=vals["base"];if(undefined!==val)this.base=val-0}};CT_FieldGroup.prototype.onStartNode= function(elem,attr,uq){var newContext=this;if("rangePr"===elem){newContext=new CT_RangePr;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.rangePr=newContext}else if("discretePr"===elem){newContext=new CT_DiscretePr;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.discretePr=newContext}else if("groupItems"===elem){newContext=new CT_GroupItems;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.groupItems=newContext}else newContext=null;return newContext}; CT_FieldGroup.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.par)writer.WriteXmlAttributeNumber("par",this.par);if(null!==this.base)writer.WriteXmlAttributeNumber("base",this.base);writer.WriteXmlNodeEnd(name,true);if(null!==this.rangePr)this.rangePr.toXml(writer,"rangePr");if(null!==this.discretePr)this.discretePr.toXml(writer,"discretePr");if(null!==this.groupItems)this.groupItems.toXml(writer,"groupItems");writer.WriteXmlNodeEnd(name)};function CT_FieldsUsage(){this.fieldUsage= []}CT_FieldsUsage.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("fieldUsage"===elem){newContext=new CT_FieldUsage;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.fieldUsage.push(newContext)}else newContext=null;return newContext};CT_FieldsUsage.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.fieldUsage.length>0)writer.WriteXmlAttributeNumber("count",this.fieldUsage.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.fieldUsage.length;++i){var elem= this.fieldUsage[i];elem.toXml(writer,"fieldUsage")}writer.WriteXmlNodeEnd(name)};function CT_GroupLevels(){this.groupLevel=[]}CT_GroupLevels.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("groupLevel"===elem){newContext=new CT_GroupLevel;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.groupLevel.push(newContext)}else newContext=null;return newContext};CT_GroupLevels.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.groupLevel.length> 0)writer.WriteXmlAttributeNumber("count",this.groupLevel.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.groupLevel.length;++i){var elem=this.groupLevel[i];elem.toXml(writer,"groupLevel")}writer.WriteXmlNodeEnd(name)};function CT_Set(){this.maxRank=null;this.setDefinition=null;this.sortType=c_oAscSortType.None;this.queryFailed=false;this.tpls=[];this.sortByTuple=null}CT_Set.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["maxRank"];if(undefined!== val)this.maxRank=val-0;val=vals["setDefinition"];if(undefined!==val)this.setDefinition=AscCommon.unleakString(uq(val));val=vals["sortType"];if(undefined!==val){val=FromXml_ST_SortType(val);if(-1!==val)this.sortType=val}val=vals["queryFailed"];if(undefined!==val)this.queryFailed=AscCommon.getBoolFromXml(val)}};CT_Set.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("tpls"===elem){newContext=new CT_Tuples;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.tpls.push(newContext)}else if("sortByTuple"=== elem){newContext=new CT_Tuples;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.sortByTuple=newContext}else newContext=null;return newContext};CT_Set.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.tpls.length>0)writer.WriteXmlAttributeNumber("count",this.tpls.length);if(null!==this.maxRank)writer.WriteXmlAttributeNumber("maxRank",this.maxRank);if(null!==this.setDefinition)writer.WriteXmlAttributeStringEncode("setDefinition",this.setDefinition);if(c_oAscSortType.None!== this.sortType)writer.WriteXmlAttributeStringEncode("sortType",ToXml_ST_SortType(this.sortType));if(false!==this.queryFailed)writer.WriteXmlAttributeBool("queryFailed",this.queryFailed);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.tpls.length;++i){var elem=this.tpls[i];elem.toXml(writer,"tpls")}if(null!==this.sortByTuple)this.sortByTuple.toXml(writer,"sortByTuple");writer.WriteXmlNodeEnd(name)};function CT_Query(){this.mdx=null;this.tpls=null}CT_Query.prototype.readAttributes=function(attr, uq){if(attr()){var vals=attr();var val;val=vals["mdx"];if(undefined!==val)this.mdx=AscCommon.unleakString(uq(val))}};CT_Query.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("tpls"===elem){newContext=new CT_Tuples;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.tpls=newContext}else newContext=null;return newContext};CT_Query.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.mdx)writer.WriteXmlAttributeStringEncode("mdx",this.mdx); writer.WriteXmlNodeEnd(name,true);if(null!==this.tpls)this.tpls.toXml(writer,"tpls");writer.WriteXmlNodeEnd(name)};function CT_ServerFormat(){this.culture=null;this.format=null}CT_ServerFormat.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["culture"];if(undefined!==val)this.culture=AscCommon.unleakString(uq(val));val=vals["format"];if(undefined!==val)this.format=AscCommon.unleakString(uq(val))}};CT_ServerFormat.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(null!==this.culture)writer.WriteXmlAttributeStringEncode("culture",this.culture);if(null!==this.format)writer.WriteXmlAttributeStringEncode("format",this.format);writer.WriteXmlNodeEnd(name,true,true)};function CT_PivotArea(){this.field=null;this.type=c_oAscPivotAreaType.None;this.dataOnly=true;this.labelOnly=false;this.grandRow=false;this.grandCol=false;this.cacheIndex=false;this.outline=true;this.offset=null;this.collapsedLevelsAreSubtotals=false;this.axis=null;this.fieldPosition=null;this.references= null;this.extLst=null}CT_PivotArea.prototype.clone=function(){var res=new CT_PivotArea;res.field=this.field;res.type=this.type;res.dataOnly=this.dataOnly;res.labelOnly=this.labelOnly;res.grandRow=this.grandRow;res.grandCol=this.grandCol;res.cacheIndex=this.cacheIndex;res.outline=this.outline;res.offset=this.offset;res.collapsedLevelsAreSubtotals=this.collapsedLevelsAreSubtotals;res.axis=this.axis;res.fieldPosition=this.fieldPosition;if(this.references)res.references=this.references.clone();return res}; CT_PivotArea.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["field"];if(undefined!==val)this.field=val-0;val=vals["type"];if(undefined!==val){val=FromXml_ST_PivotAreaType(val);if(-1!==val)this.type=val}val=vals["dataOnly"];if(undefined!==val)this.dataOnly=AscCommon.getBoolFromXml(val);val=vals["labelOnly"];if(undefined!==val)this.labelOnly=AscCommon.getBoolFromXml(val);val=vals["grandRow"];if(undefined!==val)this.grandRow=AscCommon.getBoolFromXml(val);val=vals["grandCol"]; if(undefined!==val)this.grandCol=AscCommon.getBoolFromXml(val);val=vals["cacheIndex"];if(undefined!==val)this.cacheIndex=AscCommon.getBoolFromXml(val);val=vals["outline"];if(undefined!==val)this.outline=AscCommon.getBoolFromXml(val);val=vals["offset"];if(undefined!==val)this.offset=AscCommon.unleakString(uq(val));val=vals["collapsedLevelsAreSubtotals"];if(undefined!==val)this.collapsedLevelsAreSubtotals=AscCommon.getBoolFromXml(val);val=vals["axis"];if(undefined!==val){val=FromXml_ST_Axis(val);if(-1!== val)this.axis=val}val=vals["fieldPosition"];if(undefined!==val)this.fieldPosition=val-0}};CT_PivotArea.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("references"===elem){newContext=new CT_PivotAreaReferences;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.references=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext}; CT_PivotArea.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.field)writer.WriteXmlAttributeNumber("field",this.field);if(c_oAscPivotAreaType.None!==this.type)writer.WriteXmlAttributeStringEncode("type",ToXml_ST_PivotAreaType(this.type));if(true!==this.dataOnly)writer.WriteXmlAttributeBool("dataOnly",this.dataOnly);if(false!==this.labelOnly)writer.WriteXmlAttributeBool("labelOnly",this.labelOnly);if(false!==this.grandRow)writer.WriteXmlAttributeBool("grandRow",this.grandRow); if(false!==this.grandCol)writer.WriteXmlAttributeBool("grandCol",this.grandCol);if(false!==this.cacheIndex)writer.WriteXmlAttributeBool("cacheIndex",this.cacheIndex);if(true!==this.outline)writer.WriteXmlAttributeBool("outline",this.outline);if(null!==this.offset)writer.WriteXmlAttributeStringEncode("offset",this.offset);if(false!==this.collapsedLevelsAreSubtotals)writer.WriteXmlAttributeBool("collapsedLevelsAreSubtotals",this.collapsedLevelsAreSubtotals);if(null!==this.axis)writer.WriteXmlAttributeStringEncode("axis", ToXml_ST_Axis(this.axis));if(null!==this.fieldPosition)writer.WriteXmlAttributeNumber("fieldPosition",this.fieldPosition);writer.WriteXmlNodeEnd(name,true);if(null!==this.references)this.references.toXml(writer,"references");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_Tuple(){this.fld=null;this.hier=null;this.item=null}CT_Tuple.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["fld"];if(undefined!==val)this.fld= val-0;val=vals["hier"];if(undefined!==val)this.hier=val-0;val=vals["item"];if(undefined!==val)this.item=val-0}};CT_Tuple.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.fld)writer.WriteXmlAttributeNumber("fld",this.fld);if(null!==this.hier)writer.WriteXmlAttributeNumber("hier",this.hier);if(null!==this.item)writer.WriteXmlAttributeNumber("item",this.item);writer.WriteXmlNodeEnd(name,true,true)};function CT_Items(){this.item=[]}CT_Items.prototype.clone=function(){var res= new CT_Items;for(var i=0;i<this.item.length;++i)res.item.push(this.item[i].clone());return res};CT_Items.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("item"===elem){newContext=new CT_Item;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.item.push(newContext)}else newContext=null;return newContext};CT_Items.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.item.length>0)writer.WriteXmlAttributeNumber("count",this.item.length);writer.WriteXmlNodeEnd(name, true);for(var i=0;i<this.item.length;++i){var elem=this.item[i];elem.toXml(writer,"item")}writer.WriteXmlNodeEnd(name)};function CT_AutoSortScope(){this.pivotArea=null}CT_AutoSortScope.prototype.clone=function(){var res=new CT_AutoSortScope;if(this.pivotArea)res.pivotArea=this.pivotArea.clone();return res};CT_AutoSortScope.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotArea"===elem){newContext=new CT_PivotArea;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.pivotArea=newContext}else newContext=null;return newContext};CT_AutoSortScope.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);writer.WriteXmlNodeEnd(name,true);if(null!==this.pivotArea)this.pivotArea.toXml(writer,"pivotArea");writer.WriteXmlNodeEnd(name)};function CT_PivotAreas(){this.pivotArea=[]}CT_PivotAreas.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pivotArea"===elem){newContext=new CT_PivotArea;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.pivotArea.push(newContext)}else newContext=null;return newContext};CT_PivotAreas.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.pivotArea.length>0)writer.WriteXmlAttributeNumber("count",this.pivotArea.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.pivotArea.length;++i){var elem=this.pivotArea[i];elem.toXml(writer,"pivotArea")}writer.WriteXmlNodeEnd(name)};function CT_MemberProperties(){this.mp=[]}CT_MemberProperties.prototype.onStartNode=function(elem, attr,uq){var newContext=this;if("mp"===elem){newContext=new CT_MemberProperty;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.mp.push(newContext)}else newContext=null;return newContext};CT_MemberProperties.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.mp.length>0)writer.WriteXmlAttributeNumber("count",this.mp.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.mp.length;++i){var elem=this.mp[i];elem.toXml(writer,"mp")}writer.WriteXmlNodeEnd(name)}; function CT_Members(){this.level=null;this.member=[]}CT_Members.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["level"];if(undefined!==val)this.level=val-0}};CT_Members.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("member"===elem){newContext=new CT_Member;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.member.push(newContext)}else newContext=null;return newContext};CT_Members.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(this.member.length>0)writer.WriteXmlAttributeNumber("count",this.member.length);if(null!==this.level)writer.WriteXmlAttributeNumber("level",this.level);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.member.length;++i){var elem=this.member[i];elem.toXml(writer,"member")}writer.WriteXmlNodeEnd(name)};function CT_PCDSCPage(){this.pageItem=[]}CT_PCDSCPage.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("pageItem"===elem){newContext=new CT_PageItem;if(newContext.readAttributes)newContext.readAttributes(attr, uq);this.pageItem.push(newContext)}else newContext=null;return newContext};CT_PCDSCPage.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.pageItem.length>0)writer.WriteXmlAttributeNumber("count",this.pageItem.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.pageItem.length;++i){var elem=this.pageItem[i];elem.toXml(writer,"pageItem")}writer.WriteXmlNodeEnd(name)};function CT_RangeSet(){this.i1=null;this.i2=null;this.i3=null;this.i4=null;this.ref=null;this.name= null;this.sheet=null;this.id=null}CT_RangeSet.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["i1"];if(undefined!==val)this.i1=val-0;val=vals["i2"];if(undefined!==val)this.i2=val-0;val=vals["i3"];if(undefined!==val)this.i3=val-0;val=vals["i4"];if(undefined!==val)this.i4=val-0;val=vals["ref"];if(undefined!==val)this.ref=AscCommon.unleakString(uq(val));val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["sheet"];if(undefined!== val)this.sheet=AscCommon.unleakString(uq(val));val=vals["r:id"];if(undefined!==val)this.id=AscCommon.unleakString(uq(val))}};CT_RangeSet.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.i1)writer.WriteXmlAttributeNumber("i1",this.i1);if(null!==this.i2)writer.WriteXmlAttributeNumber("i2",this.i2);if(null!==this.i3)writer.WriteXmlAttributeNumber("i3",this.i3);if(null!==this.i4)writer.WriteXmlAttributeNumber("i4",this.i4);if(null!==this.ref)writer.WriteXmlAttributeStringEncode("ref", this.ref);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(null!==this.sheet)writer.WriteXmlAttributeStringEncode("sheet",this.sheet);writer.WriteXmlNodeEnd(name,true,true)};function CT_RangePr(){this.autoStart=true;this.autoEnd=true;this.groupBy=c_oAscGroupBy.Range;this.startNum=null;this.endNum=null;this.startDate=null;this.endDate=null;this.groupInterval=1}CT_RangePr.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["autoStart"]; if(undefined!==val)this.autoStart=AscCommon.getBoolFromXml(val);val=vals["autoEnd"];if(undefined!==val)this.autoEnd=AscCommon.getBoolFromXml(val);val=vals["groupBy"];if(undefined!==val){val=FromXml_ST_GroupBy(val);if(-1!==val)this.groupBy=val}val=vals["startNum"];if(undefined!==val)this.startNum=val-0;val=vals["endNum"];if(undefined!==val)this.endNum=val-0;val=vals["startDate"];if(undefined!==val)this.startDate=AscCommon.unleakString(uq(val));val=vals["endDate"];if(undefined!==val)this.endDate=AscCommon.unleakString(uq(val)); val=vals["groupInterval"];if(undefined!==val)this.groupInterval=val-0}};CT_RangePr.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(true!==this.autoStart)writer.WriteXmlAttributeBool("autoStart",this.autoStart);if(true!==this.autoEnd)writer.WriteXmlAttributeBool("autoEnd",this.autoEnd);if(c_oAscGroupBy.Range!==this.groupBy)writer.WriteXmlAttributeStringEncode("groupBy",ToXml_ST_GroupBy(this.groupBy));if(null!==this.startNum)writer.WriteXmlAttributeNumber("startNum",this.startNum); if(null!==this.endNum)writer.WriteXmlAttributeNumber("endNum",this.endNum);if(null!==this.startDate)writer.WriteXmlAttributeStringEncode("startDate",this.startDate);if(null!==this.endDate)writer.WriteXmlAttributeStringEncode("endDate",this.endDate);if(1!==this.groupInterval)writer.WriteXmlAttributeNumber("groupInterval",this.groupInterval);writer.WriteXmlNodeEnd(name,true,true)};function CT_DiscretePr(){this.x=[]}CT_DiscretePr.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("x"=== elem){newContext=new CT_Index;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else newContext=null;return newContext};CT_DiscretePr.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.x.length>0)writer.WriteXmlAttributeNumber("count",this.x.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.x.length;++i){var elem=this.x[i];elem.toXml(writer,"x")}writer.WriteXmlNodeEnd(name)};function CT_GroupItems(){this.Items=new PivotRecords} CT_GroupItems.prototype.onStartNode=function(elem,attr,uq){var newContext=this;var newContextCandidate=this.Items.onStartNode(elem,attr,uq);if(newContextCandidate)newContext=newContextCandidate;else newContext=null;return newContext};CT_GroupItems.prototype.onEndNode=function(prevContext,elem){this.Items.onEndNode(prevContext,elem)};CT_GroupItems.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);var count=this.Items.getSize();if(count>0)writer.WriteXmlAttributeNumber("count",count); writer.WriteXmlNodeEnd(name,true);this.Items.toXml(writer);writer.WriteXmlNodeEnd(name)};function CT_FieldUsage(){this.x=null}CT_FieldUsage.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["x"];if(undefined!==val)this.x=val-0}};CT_FieldUsage.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.x)writer.WriteXmlAttributeNumber("x",this.x);writer.WriteXmlNodeEnd(name,true,true)};function CT_GroupLevel(){this.uniqueName=null;this.caption= null;this.user=false;this.customRollUp=false;this.groups=null;this.extLst=null}CT_GroupLevel.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["uniqueName"];if(undefined!==val)this.uniqueName=AscCommon.unleakString(uq(val));val=vals["caption"];if(undefined!==val)this.caption=AscCommon.unleakString(uq(val));val=vals["user"];if(undefined!==val)this.user=AscCommon.getBoolFromXml(val);val=vals["customRollUp"];if(undefined!==val)this.customRollUp=AscCommon.getBoolFromXml(val)}}; CT_GroupLevel.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("groups"===elem){newContext=new CT_Groups;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.groups=newContext}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_GroupLevel.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.uniqueName)writer.WriteXmlAttributeStringEncode("uniqueName", this.uniqueName);if(null!==this.caption)writer.WriteXmlAttributeStringEncode("caption",this.caption);if(false!==this.user)writer.WriteXmlAttributeBool("user",this.user);if(false!==this.customRollUp)writer.WriteXmlAttributeBool("customRollUp",this.customRollUp);writer.WriteXmlNodeEnd(name,true);if(null!==this.groups)this.groups.toXml(writer,"groups");if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_PivotAreaReferences(){this.reference=[]}CT_PivotAreaReferences.prototype.clone= function(){var res=new CT_PivotAreaReferences;for(var i=0;i<this.reference.length;++i)res.reference.push(this.reference[i].clone());return res};CT_PivotAreaReferences.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("reference"===elem){newContext=new CT_PivotAreaReference;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.reference.push(newContext)}else newContext=null;return newContext};CT_PivotAreaReferences.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(this.reference.length>0)writer.WriteXmlAttributeNumber("count",this.reference.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.reference.length;++i){var elem=this.reference[i];elem.toXml(writer,"reference")}writer.WriteXmlNodeEnd(name)};function CT_Item(){this.n=null;this.t=Asc.c_oAscItemType.Data;this.h=false;this.s=false;this.sd=true;this.f=false;this.m=false;this.c=false;this.x=null;this.d=false;this.e=true}CT_Item.prototype.clone=function(){var res=new CT_Item;res.n=this.n;res.t= this.t;res.h=this.h;res.s=this.s;res.sd=this.sd;res.f=this.f;res.m=this.m;res.c=this.c;res.x=this.x;res.d=this.d;res.e=this.e;return res};CT_Item.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["n"];if(undefined!==val)this.n=AscCommon.unleakString(uq(val));val=vals["t"];if(undefined!==val){val=FromXml_ST_ItemType(val);if(-1!==val)this.t=val}val=vals["h"];if(undefined!==val)this.h=AscCommon.getBoolFromXml(val);val=vals["s"];if(undefined!==val)this.s=AscCommon.getBoolFromXml(val); val=vals["sd"];if(undefined!==val)this.sd=AscCommon.getBoolFromXml(val);val=vals["f"];if(undefined!==val)this.f=AscCommon.getBoolFromXml(val);val=vals["m"];if(undefined!==val)this.m=AscCommon.getBoolFromXml(val);val=vals["c"];if(undefined!==val)this.c=AscCommon.getBoolFromXml(val);val=vals["x"];if(undefined!==val)this.x=val-0;val=vals["d"];if(undefined!==val)this.d=AscCommon.getBoolFromXml(val);val=vals["e"];if(undefined!==val)this.e=AscCommon.getBoolFromXml(val)}};CT_Item.prototype.toXml=function(writer, name){writer.WriteXmlNodeStart(name);if(null!==this.n)writer.WriteXmlAttributeStringEncode("n",this.n);if(Asc.c_oAscItemType.Data!==this.t)writer.WriteXmlAttributeStringEncode("t",ToXml_ST_ItemType(this.t));if(false!==this.h)writer.WriteXmlAttributeBool("h",this.h);if(false!==this.s)writer.WriteXmlAttributeBool("s",this.s);if(true!==this.sd)writer.WriteXmlAttributeBool("sd",this.sd);if(false!==this.f)writer.WriteXmlAttributeBool("f",this.f);if(false!==this.m)writer.WriteXmlAttributeBool("m",this.m); if(false!==this.c)writer.WriteXmlAttributeBool("c",this.c);if(null!==this.x)writer.WriteXmlAttributeNumber("x",this.x);if(false!==this.d)writer.WriteXmlAttributeBool("d",this.d);if(true!==this.e)writer.WriteXmlAttributeBool("e",this.e);writer.WriteXmlNodeEnd(name,true,true)};function CT_MemberProperty(){this.name=null;this.showCell=false;this.showTip=false;this.showAsCaption=false;this.nameLen=null;this.pPos=null;this.pLen=null;this.level=null;this.field=null}CT_MemberProperty.prototype.readAttributes= function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["showCell"];if(undefined!==val)this.showCell=AscCommon.getBoolFromXml(val);val=vals["showTip"];if(undefined!==val)this.showTip=AscCommon.getBoolFromXml(val);val=vals["showAsCaption"];if(undefined!==val)this.showAsCaption=AscCommon.getBoolFromXml(val);val=vals["nameLen"];if(undefined!==val)this.nameLen=val-0;val=vals["pPos"];if(undefined!==val)this.pPos=val-0; val=vals["pLen"];if(undefined!==val)this.pLen=val-0;val=vals["level"];if(undefined!==val)this.level=val-0;val=vals["field"];if(undefined!==val)this.field=val-0}};CT_MemberProperty.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);if(false!==this.showCell)writer.WriteXmlAttributeBool("showCell",this.showCell);if(false!==this.showTip)writer.WriteXmlAttributeBool("showTip",this.showTip);if(false!==this.showAsCaption)writer.WriteXmlAttributeBool("showAsCaption", this.showAsCaption);if(null!==this.nameLen)writer.WriteXmlAttributeNumber("nameLen",this.nameLen);if(null!==this.pPos)writer.WriteXmlAttributeNumber("pPos",this.pPos);if(null!==this.pLen)writer.WriteXmlAttributeNumber("pLen",this.pLen);if(null!==this.level)writer.WriteXmlAttributeNumber("level",this.level);if(null!==this.field)writer.WriteXmlAttributeNumber("field",this.field);writer.WriteXmlNodeEnd(name,true,true)};function CT_Member(){this.name=null}CT_Member.prototype.readAttributes=function(attr, uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val))}};CT_Member.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);writer.WriteXmlNodeEnd(name,true,true)};function CT_PageItem(){this.name=null}CT_PageItem.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val))}}; CT_PageItem.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name);writer.WriteXmlNodeEnd(name,true,true)};function CT_Groups(){this.group=[]}CT_Groups.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("group"===elem){newContext=new CT_LevelGroup;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.group.push(newContext)}else newContext=null;return newContext};CT_Groups.prototype.toXml= function(writer,name){writer.WriteXmlNodeStart(name);if(this.group.length>0)writer.WriteXmlAttributeNumber("count",this.group.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.group.length;++i){var elem=this.group[i];elem.toXml(writer,"group")}writer.WriteXmlNodeEnd(name)};function CT_PivotAreaReference(){this.field=null;this.selected=true;this.byPosition=false;this.relative=false;this.defaultSubtotal=false;this.sumSubtotal=false;this.countASubtotal=false;this.avgSubtotal=false;this.maxSubtotal= false;this.minSubtotal=false;this.productSubtotal=false;this.countSubtotal=false;this.stdDevSubtotal=false;this.stdDevPSubtotal=false;this.varSubtotal=false;this.varPSubtotal=false;this.x=[];this.extLst=null}CT_PivotAreaReference.prototype.clone=function(){var res=new CT_PivotAreaReference;res.field=this.field;res.selected=this.selected;res.byPosition=this.byPosition;res.relative=this.relative;res.defaultSubtotal=this.defaultSubtotal;res.sumSubtotal=this.sumSubtotal;res.countASubtotal=this.countASubtotal; res.avgSubtotal=this.avgSubtotal;res.maxSubtotal=this.maxSubtotal;res.minSubtotal=this.minSubtotal;res.productSubtotal=this.productSubtotal;res.countSubtotal=this.countSubtotal;res.stdDevSubtotal=this.stdDevSubtotal;res.stdDevPSubtotal=this.stdDevPSubtotal;res.varSubtotal=this.varSubtotal;res.varPSubtotal=this.varPSubtotal;for(var i=0;i<this.x.length;++i)res.x.push(this.x[i].clone());return res};CT_PivotAreaReference.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val= vals["field"];if(undefined!==val)this.field=val-0;val=vals["selected"];if(undefined!==val)this.selected=AscCommon.getBoolFromXml(val);val=vals["byPosition"];if(undefined!==val)this.byPosition=AscCommon.getBoolFromXml(val);val=vals["relative"];if(undefined!==val)this.relative=AscCommon.getBoolFromXml(val);val=vals["defaultSubtotal"];if(undefined!==val)this.defaultSubtotal=AscCommon.getBoolFromXml(val);val=vals["sumSubtotal"];if(undefined!==val)this.sumSubtotal=AscCommon.getBoolFromXml(val);val=vals["countASubtotal"]; if(undefined!==val)this.countASubtotal=AscCommon.getBoolFromXml(val);val=vals["avgSubtotal"];if(undefined!==val)this.avgSubtotal=AscCommon.getBoolFromXml(val);val=vals["maxSubtotal"];if(undefined!==val)this.maxSubtotal=AscCommon.getBoolFromXml(val);val=vals["minSubtotal"];if(undefined!==val)this.minSubtotal=AscCommon.getBoolFromXml(val);val=vals["productSubtotal"];if(undefined!==val)this.productSubtotal=AscCommon.getBoolFromXml(val);val=vals["countSubtotal"];if(undefined!==val)this.countSubtotal= AscCommon.getBoolFromXml(val);val=vals["stdDevSubtotal"];if(undefined!==val)this.stdDevSubtotal=AscCommon.getBoolFromXml(val);val=vals["stdDevPSubtotal"];if(undefined!==val)this.stdDevPSubtotal=AscCommon.getBoolFromXml(val);val=vals["varSubtotal"];if(undefined!==val)this.varSubtotal=AscCommon.getBoolFromXml(val);val=vals["varPSubtotal"];if(undefined!==val)this.varPSubtotal=AscCommon.getBoolFromXml(val)}};CT_PivotAreaReference.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("x"=== elem){newContext=new CT_Index;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.x.push(newContext)}else if("extLst"===elem){newContext=new CT_ExtensionList;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.extLst=newContext}else newContext=null;return newContext};CT_PivotAreaReference.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.field)writer.WriteXmlAttributeNumber("field",this.field);if(this.x.length>0)writer.WriteXmlAttributeNumber("count", this.x.length);if(true!==this.selected)writer.WriteXmlAttributeBool("selected",this.selected);if(false!==this.byPosition)writer.WriteXmlAttributeBool("byPosition",this.byPosition);if(false!==this.relative)writer.WriteXmlAttributeBool("relative",this.relative);if(false!==this.defaultSubtotal)writer.WriteXmlAttributeBool("defaultSubtotal",this.defaultSubtotal);if(false!==this.sumSubtotal)writer.WriteXmlAttributeBool("sumSubtotal",this.sumSubtotal);if(false!==this.countASubtotal)writer.WriteXmlAttributeBool("countASubtotal", this.countASubtotal);if(false!==this.avgSubtotal)writer.WriteXmlAttributeBool("avgSubtotal",this.avgSubtotal);if(false!==this.maxSubtotal)writer.WriteXmlAttributeBool("maxSubtotal",this.maxSubtotal);if(false!==this.minSubtotal)writer.WriteXmlAttributeBool("minSubtotal",this.minSubtotal);if(false!==this.productSubtotal)writer.WriteXmlAttributeBool("productSubtotal",this.productSubtotal);if(false!==this.countSubtotal)writer.WriteXmlAttributeBool("countSubtotal",this.countSubtotal);if(false!==this.stdDevSubtotal)writer.WriteXmlAttributeBool("stdDevSubtotal", this.stdDevSubtotal);if(false!==this.stdDevPSubtotal)writer.WriteXmlAttributeBool("stdDevPSubtotal",this.stdDevPSubtotal);if(false!==this.varSubtotal)writer.WriteXmlAttributeBool("varSubtotal",this.varSubtotal);if(false!==this.varPSubtotal)writer.WriteXmlAttributeBool("varPSubtotal",this.varPSubtotal);writer.WriteXmlNodeEnd(name,true);for(var i=0;i<this.x.length;++i){var elem=this.x[i];elem.toXml(writer,"x")}if(null!==this.extLst)this.extLst.toXml(writer,"extLst");writer.WriteXmlNodeEnd(name)};function CT_LevelGroup(){this.name= null;this.uniqueName=null;this.caption=null;this.uniqueParent=null;this.id=null;this.groupMembers=null}CT_LevelGroup.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["name"];if(undefined!==val)this.name=AscCommon.unleakString(uq(val));val=vals["uniqueName"];if(undefined!==val)this.uniqueName=AscCommon.unleakString(uq(val));val=vals["caption"];if(undefined!==val)this.caption=AscCommon.unleakString(uq(val));val=vals["uniqueParent"];if(undefined!==val)this.uniqueParent= AscCommon.unleakString(uq(val));val=vals["id"];if(undefined!==val)this.id=val-0}};CT_LevelGroup.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("groupMembers"===elem){newContext=new CT_GroupMembers;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.groupMembers=newContext}else newContext=null;return newContext};CT_LevelGroup.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(null!==this.name)writer.WriteXmlAttributeStringEncode("name",this.name); if(null!==this.uniqueName)writer.WriteXmlAttributeStringEncode("uniqueName",this.uniqueName);if(null!==this.caption)writer.WriteXmlAttributeStringEncode("caption",this.caption);if(null!==this.uniqueParent)writer.WriteXmlAttributeStringEncode("uniqueParent",this.uniqueParent);if(null!==this.id)writer.WriteXmlAttributeNumber("id",this.id);writer.WriteXmlNodeEnd(name,true);if(null!==this.groupMembers)this.groupMembers.toXml(writer,"groupMembers");writer.WriteXmlNodeEnd(name)};function CT_GroupMembers(){this.groupMember= []}CT_GroupMembers.prototype.onStartNode=function(elem,attr,uq){var newContext=this;if("groupMember"===elem){newContext=new CT_GroupMember;if(newContext.readAttributes)newContext.readAttributes(attr,uq);this.groupMember.push(newContext)}else newContext=null;return newContext};CT_GroupMembers.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name);if(this.groupMember.length>0)writer.WriteXmlAttributeNumber("count",this.groupMember.length);writer.WriteXmlNodeEnd(name,true);for(var i=0;i< this.groupMember.length;++i){var elem=this.groupMember[i];elem.toXml(writer,"groupMember")}writer.WriteXmlNodeEnd(name)};function CT_GroupMember(){this.uniqueName=null;this.group=false}CT_GroupMember.prototype.readAttributes=function(attr,uq){if(attr()){var vals=attr();var val;val=vals["uniqueName"];if(undefined!==val)this.uniqueName=AscCommon.unleakString(uq(val));val=vals["group"];if(undefined!==val)this.group=AscCommon.getBoolFromXml(val)}};CT_GroupMember.prototype.toXml=function(writer,name){writer.WriteXmlNodeStart(name); if(null!==this.uniqueName)writer.WriteXmlAttributeStringEncode("uniqueName",this.uniqueName);if(false!==this.group)writer.WriteXmlAttributeBool("group",this.group);writer.WriteXmlNodeEnd(name,true,true)};var c_oAscPivotRecType={Number:1,String:2,Boolean:3,Error:4,DateTime:5,Missing:6,Index:7};var c_nNumberMissingValue=2147483647;function PivotRecordValue(){this.clean()}PivotRecordValue.prototype.clean=function(){this.type=undefined;this.val=undefined;this.addition=undefined};PivotRecordValue.prototype.getCellValue= function(){var res=new AscCommonExcel.CCellValue;switch(this.type){case c_oAscPivotRecType.Boolean:res.type=AscCommon.CellValueType.Bool;res.number=this.val?1:0;break;case c_oAscPivotRecType.DateTime:res.type=AscCommon.CellValueType.Number;res.number=this.val;break;case c_oAscPivotRecType.Error:res.type=AscCommon.CellValueType.String;res.text=AscCommonExcel.cError.prototype.getStringFromErrorType(this.val);break;case c_oAscPivotRecType.Number:res.type=AscCommon.CellValueType.Number;res.number=this.val; break;case c_oAscPivotRecType.String:res.type=AscCommon.CellValueType.String;res.text=this.val;break;case c_oAscPivotRecType.Missing:res.type=AscCommon.CellValueType.String;res.text=AscCommon.translateManager.getValue(AscCommonExcel.BLANK_CAPTION);break;default:var i=0;break}return res};PivotRecordValue.prototype.isBlank=function(){return c_oAscPivotRecType.Missing===this.type};PivotRecordValue.prototype.isDateOrNum=function(){return c_oAscPivotRecType.DateTime===this.type||c_oAscPivotRecType.Number=== this.type};PivotRecordValue.prototype.shallowEqual=function(elem){return this.type===elem.type&&this.val===elem.val};function PivotRecords(){this.chunks=[];this.addition={};this.size=0;this.startCount=0;this._curBoolean=new CT_Boolean;this._curDateTime=new CT_DateTime;this._curError=new CT_Error;this._curMissing=new CT_Missing;this._curNumber=new CT_Number;this._curString=new CT_String;this._curIndex=new CT_Index;this.output=new PivotRecordValue}PivotRecords.prototype.onStartNode=function(elem,attr, uq){var newContext=null;if("b"===elem){this._curBoolean.clean();newContext=this._curBoolean;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("d"===elem){this._curDateTime.clean();newContext=this._curDateTime;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("e"===elem){this._curError.clean();newContext=this._curError;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("m"===elem){this._curMissing.clean();newContext=this._curMissing; if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("n"===elem){this._curNumber.clean();newContext=this._curNumber;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("s"===elem){this._curString.clean();newContext=this._curString;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}else if("x"===elem){this._curIndex.clean();newContext=this._curIndex;if(newContext.readAttributes)newContext.readAttributes(attr,uq)}return newContext};PivotRecords.prototype.onEndNode= function(prevContext,elem){var res=true;if("b"===elem)if(this._curBoolean.isSimpleValue())this.addBool(this._curBoolean.v);else{this.addBool(this._curBoolean.v,this._curBoolean);this._curBoolean=new CT_Boolean}else if("d"===elem)if(this._curDateTime.isSimpleValue())this.addDate(this._curDateTime.v);else{this.addDate(this._curDateTime.v,this._curDateTime);this._curDateTime=new CT_DateTime}else if("e"===elem)if(this._curError.isSimpleValue())this.addError(this._curError.v);else{this.addError(this._curError.v, this._curError);this._curError=new CT_Error}else if("m"===elem)if(this._curMissing.isSimpleValue())this.addMissing(1);else{this.addMissing(1,this._curMissing);this._curMissing=new CT_Missing}else if("n"===elem)if(this._curNumber.isSimpleValue())this.addNumber(this._curNumber.v);else{this.addNumber(this._curNumber.v,this._curNumber);this._curNumber=new CT_Number}else if("s"===elem)if(this._curString.isSimpleValue())this.addString(this._curString.v);else{this.addString(this._curString.v,this._curString); this._curString=new CT_String}else if("x"===elem)this.addIndex(this._curIndex.v);else res=false;return res};PivotRecords.prototype.toXml=function(writer,opt_index){if(undefined!==opt_index)this._toXml(writer,this.get(opt_index));else for(var i=0;i<this.size;++i)this._toXml(writer,this.get(i))};PivotRecords.prototype.setStartCount=function(val){this.startCount=val};PivotRecords.prototype.getSize=function(){return this.size};PivotRecords.prototype.addBool=function(val,addition){this._add(c_oAscPivotRecType.Boolean, val,addition)};PivotRecords.prototype.addDate=function(val,addition){this._add(c_oAscPivotRecType.DateTime,val,addition)};PivotRecords.prototype.addError=function(val,addition){this._add(c_oAscPivotRecType.Error,val,addition)};PivotRecords.prototype.addMissing=function(count,addition){for(var i=0;i<count;++i)this._add(c_oAscPivotRecType.Missing,undefined,addition)};PivotRecords.prototype.addNumber=function(val,addition){this._add(c_oAscPivotRecType.Number,val,addition)};PivotRecords.prototype.addString= function(val,addition){val=window["Asc"]["editor"].wbModel.sharedStrings.addText(val);this._add(c_oAscPivotRecType.String,val,addition)};PivotRecords.prototype.addIndex=function(val){val++;this._add(c_oAscPivotRecType.Index,val)};PivotRecords.prototype.get=function(index){this.output.clean();for(var i=0;i<this.chunks.length;++i){var chunk=this.chunks[i];if(chunk.from<=index&&index<chunk.to){this.output.type=chunk.type;this.output.addition=this.addition[index];if(chunk.data){this.output.val=chunk.data[index- chunk.from];this._replaceMissingInOutput(chunk.type,this.output)}break}}return this.output};PivotRecords.prototype.convertToSharedItems=function(si){var i,j,chunk,uniqueMap,index,val;var uniqueMaps={missing:undefined,types:{}};var newChunk={type:c_oAscPivotRecType.Index,data:new Uint32Array(this.size),capacity:this.size,from:0,to:this.size};var newChunkIndex=0;for(i=0;i<this.chunks.length;++i){chunk=this.chunks[i];if(c_oAscPivotRecType.Missing!==chunk.type){uniqueMap=uniqueMaps.types[chunk.type]; if(!uniqueMap){uniqueMap=new Map;uniqueMaps.types[chunk.type]=uniqueMap}for(j=0;j<chunk.to-chunk.from;++j){index=0;if(chunk.data){val=chunk.data[j];if(!this._isMissingValue(chunk.type,val)||this.addition&&this.addition[j]&&this.addition[j].realNumber){index=uniqueMap.get(val);if(undefined===index){index=si.Items.getSize()+1;uniqueMap.set(val,index);si.Items._add(chunk.type,val)}}else{if(undefined===uniqueMaps.missing){uniqueMaps.missing=si.Items.getSize()+1;si.Items._add(c_oAscPivotRecType.Missing, val)}index=uniqueMaps.missing}}newChunk.data[newChunkIndex++]=index}}else{if(undefined===uniqueMaps.missing){uniqueMaps.missing=si.Items.getSize()+1;si.Items._add(c_oAscPivotRecType.Missing)}for(j=0;j<chunk.to-chunk.from;++j)newChunk.data[newChunkIndex++]=uniqueMaps.missing}}this.chunks=[newChunk]};PivotRecords.prototype._add=function(type,val,addition){var index=this.size;var prevChunk=this.chunks.length>0?this.chunks[this.chunks.length-1]:null;var chunk;var chunkIndex;if(prevChunk&&(prevChunk.type=== type||c_oAscPivotRecType.Missing===type)){chunk=prevChunk;if(c_oAscPivotRecType.Missing===type)val=this._getMissingFakeVal(chunk.type);else if(c_oAscPivotRecType.Number===type&&c_nNumberMissingValue===val){if(!addition)addition=new CT_Number;addition.realNumber=true}}else if(prevChunk&&prevChunk.type===c_oAscPivotRecType.Missing){chunk=prevChunk;chunk.type=type;chunkIndex=index-chunk.from;this._checkChunkSize(chunk,chunkIndex);var missingVal=this._getMissingFakeVal(chunk.type);chunk.data.fill(missingVal, 0,chunkIndex)}else{var from=prevChunk?prevChunk.to:0;chunk={type:type,data:null,capacity:0,from:from,to:from+1};this.chunks.push(chunk)}chunkIndex=index-chunk.from;if(c_oAscPivotRecType.Missing!==chunk.type)this._checkChunkSize(chunk,chunkIndex);if(chunk.data)chunk.data[chunkIndex]=val;if(addition)this.addition[index]=addition;this.size++;chunk.to=this.size};PivotRecords.prototype._checkChunkSize=function(chunk,chunkIndex){if(chunkIndex>=chunk.capacity){var oldData=chunk.data;var chunkStartCount= 0===this.size&&this.startCount?this.startCount-chunk.from:0;var maxSize=Math.max(1.1*chunk.capacity>>0,chunkIndex+1,chunkStartCount);chunk.capacity=Math.min(maxSize,AscCommon.gc_nMaxRow0+1);switch(chunk.type){case c_oAscPivotRecType.Boolean:chunk.data=new Uint8Array(chunk.capacity);break;case c_oAscPivotRecType.DateTime:chunk.data=new Float64Array(chunk.capacity);break;case c_oAscPivotRecType.Error:chunk.data=new Uint8Array(chunk.capacity);break;case c_oAscPivotRecType.Missing:break;case c_oAscPivotRecType.Number:chunk.data= new Float64Array(chunk.capacity);break;case c_oAscPivotRecType.String:chunk.data=new Uint32Array(chunk.capacity);break;case c_oAscPivotRecType.Index:chunk.data=new Uint32Array(chunk.capacity);break}if(oldData)chunk.data.set(oldData)}};PivotRecords.prototype._getMissingFakeVal=function(type){var res;switch(type){case c_oAscPivotRecType.Boolean:res=255;break;case c_oAscPivotRecType.DateTime:res=-1;break;case c_oAscPivotRecType.Error:res=255;break;case c_oAscPivotRecType.Number:res=c_nNumberMissingValue; break;case c_oAscPivotRecType.String:res=0;break;case c_oAscPivotRecType.Index:res=0;break}return res};PivotRecords.prototype._replaceMissingInOutput=function(type,output){switch(type){case c_oAscPivotRecType.Boolean:if(255===output.val)output.type=c_oAscPivotRecType.Missing;else output.val=!!output.val;break;case c_oAscPivotRecType.DateTime:if(-1===output.val)output.type=c_oAscPivotRecType.Missing;break;case c_oAscPivotRecType.Error:if(255===output.val)output.type=c_oAscPivotRecType.Missing;break; case c_oAscPivotRecType.Number:if(c_nNumberMissingValue===output.val&&!(output.addition&&output.addition.realNumber))output.type=c_oAscPivotRecType.Missing;break;case c_oAscPivotRecType.String:if(0===output.val)output.type=c_oAscPivotRecType.Missing;else output.val=window["Asc"]["editor"].wbModel.sharedStrings.get(output.val);break;case c_oAscPivotRecType.Index:if(0===output.val)output.type=c_oAscPivotRecType.Missing;else--output.val;break}};PivotRecords.prototype._isMissingValue=function(type,val){switch(type){case c_oAscPivotRecType.Boolean:return 255=== val;case c_oAscPivotRecType.DateTime:return-1===val;case c_oAscPivotRecType.Error:return 255===val;case c_oAscPivotRecType.Number:return c_nNumberMissingValue===val;case c_oAscPivotRecType.String:return 0===val;case c_oAscPivotRecType.Index:return 0===val}return false};PivotRecords.prototype._toXml=function(writer,elem){switch(elem.type){case c_oAscPivotRecType.Boolean:CT_Boolean.prototype.toXml2(writer,"b",elem.val,elem.addition);break;case c_oAscPivotRecType.DateTime:CT_DateTime.prototype.toXml2(writer, "d",elem.val,elem.addition);break;case c_oAscPivotRecType.Error:CT_Error.prototype.toXml2(writer,"e",elem.val,elem.addition);break;case c_oAscPivotRecType.Missing:CT_Missing.prototype.toXml2(writer,"m",elem.addition);break;case c_oAscPivotRecType.Number:CT_Number.prototype.toXml2(writer,"n",elem.val,elem.addition);break;case c_oAscPivotRecType.String:CT_String.prototype.toXml2(writer,"s",elem.val,elem.addition);break;case c_oAscPivotRecType.Index:CT_Index.prototype.toXml2(writer,"x",elem.val);break}}; function PivotLayoutCell(t,fld,v,i){this.t=t;this.fld=fld;this.v=v;this.i=i}var PivotLayoutType={none:0,page:1,headerData:2,headerRow:3,headerCol:4,headerCompactRow:5,headerCompactCol:6,rowField:7,colField:8,cell:9};function PivotLayout(){this.type=PivotLayoutType.none;this.fld=null;this.rows=null;this.cols=null}PivotLayout.prototype.createPage=function(fld){var res=new PivotLayout;res.type=PivotLayoutType.page;res.fld=fld;return res};PivotLayout.prototype.createHeaderData=function(fld){var res=new PivotLayout; res.type=PivotLayoutType.headerData;res.fld=AscCommonExcel.st_VALUES;return res};PivotLayout.prototype.createHeaderRowCol=function(type,fld){var res=new PivotLayout;res.type=type;res.fld=fld;return res};PivotLayout.prototype.createHeaderCompact=function(type){var res=new PivotLayout;res.type=type;return res};PivotLayout.prototype.createCell=function(rows,cols,rowOffset,colOffset){var res=new PivotLayout;res.rows=rows;res.cols=cols;if(res.rows&&res.cols)res.type=PivotLayoutType.cell;else if(res.cols){res.type= PivotLayoutType.colField;res.cols=res.cols.slice(0,rowOffset)}else if(res.rows&&undefined!==colOffset){res.type=PivotLayoutType.rowField;res.rows=res.rows.slice(0,colOffset)}else res=undefined;return res};PivotLayout.prototype.getFieldIndex=function(pivotTable){var fld=this.fld;if((PivotLayoutType.rowField===this.type||PivotLayoutType.cell===this.type)&&this.rows&&this.rows.length>0)fld=this.rows[this.rows.length-1].fld;else if(PivotLayoutType.colField===this.type&&this.cols&&this.cols.length>0)fld= this.cols[this.cols.length-1].fld;else if(PivotLayoutType.headerCompactRow===this.type&&pivotTable.rowFields)fld=pivotTable.rowFields.getFirstIndexExceptValue();else if(PivotLayoutType.headerCompactCol===this.type&&pivotTable.colFields)fld=pivotTable.colFields.getFirstIndexExceptValue();return fld};PivotLayout.prototype.getMeasureFld=function(){var iMeasureFld=0;if(this.rows)for(var i=0;i<this.rows.length;++i)if(st_VALUES===this.rows[i].fld)return this.rows[i].i;if(this.cols)for(var i=0;i<this.cols.length;++i)if(st_VALUES=== this.cols[i].fld)return this.cols[i].i;return iMeasureFld};var prot;window["Asc"]["c_oAscSourceType"]=window["Asc"].c_oAscSourceType=c_oAscSourceType;prot=c_oAscSourceType;prot["Worksheet"]=prot.Worksheet;prot["External"]=prot.External;prot["Consolidation"]=prot.Consolidation;prot["Scenario"]=prot.Scenario;window["Asc"]["c_oAscAxis"]=window["Asc"].c_oAscAxis=c_oAscAxis;prot=c_oAscAxis;prot["AxisRow"]=prot.AxisRow;prot["AxisCol"]=prot.AxisCol;prot["AxisPage"]=prot.AxisPage;prot["AxisValues"]=prot.AxisValues; window["Asc"]["c_oAscFieldSortType"]=window["Asc"].c_oAscFieldSortType=c_oAscFieldSortType;prot=c_oAscFieldSortType;prot["Manual"]=prot.Manual;prot["Ascending"]=prot.Ascending;prot["Descending"]=prot.Descending;window["Asc"]["c_oAscDataConsolidateFunction"]=window["Asc"].c_oAscDataConsolidateFunction=c_oAscDataConsolidateFunction;prot=c_oAscDataConsolidateFunction;prot["Average"]=prot.Average;prot["Count"]=prot.Count;prot["CountNums"]=prot.CountNums;prot["Max"]=prot.Max;prot["Min"]=prot.Min;prot["Product"]= prot.Product;prot["StdDev"]=prot.StdDev;prot["StdDevp"]=prot.StdDevp;prot["Sum"]=prot.Sum;prot["Var"]=prot.Var;prot["Varp"]=prot.Varp;window["Asc"]["c_oAscShowDataAs"]=window["Asc"].c_oAscShowDataAs=c_oAscShowDataAs;prot=c_oAscShowDataAs;prot["Normal"]=prot.Normal;prot["Difference"]=prot.Difference;prot["Percent"]=prot.Percent;prot["PercentDiff"]=prot.PercentDiff;prot["RunTotal"]=prot.RunTotal;prot["PercentOfRow"]=prot.PercentOfRow;prot["PercentOfCol"]=prot.PercentOfCol;prot["PercentOfTotal"]=prot.PercentOfTotal; prot["Index"]=prot.Index;window["Asc"]["c_oAscFormatAction"]=window["Asc"].c_oAscFormatAction=c_oAscFormatAction;prot=c_oAscFormatAction;prot["Blank"]=prot.Blank;prot["Formatting"]=prot.Formatting;prot["Drill"]=prot.Drill;prot["Formula"]=prot.Formula;window["Asc"]["c_oAscScope"]=window["Asc"].c_oAscScope=c_oAscScope;prot=c_oAscScope;prot["Selection"]=prot.Selection;prot["Data"]=prot.Data;prot["Field"]=prot.Field;window["Asc"]["c_oAscType"]=window["Asc"].c_oAscType=c_oAscType;prot=c_oAscType;prot["None"]= prot.None;prot["All"]=prot.All;prot["Row"]=prot.Row;prot["Column"]=prot.Column;window["Asc"]["c_oAscPivotFilterType"]=window["Asc"].c_oAscPivotFilterType=c_oAscPivotFilterType;prot=c_oAscPivotFilterType;prot["Unknown"]=prot.Unknown;prot["Count"]=prot.Count;prot["Percent"]=prot.Percent;prot["Sum"]=prot.Sum;prot["CaptionEqual"]=prot.CaptionEqual;prot["CaptionNotEqual"]=prot.CaptionNotEqual;prot["CaptionBeginsWith"]=prot.CaptionBeginsWith;prot["CaptionNotBeginsWith"]=prot.CaptionNotBeginsWith;prot["CaptionEndsWith"]= prot.CaptionEndsWith;prot["CaptionNotEndsWith"]=prot.CaptionNotEndsWith;prot["CaptionContains"]=prot.CaptionContains;prot["CaptionNotContains"]=prot.CaptionNotContains;prot["CaptionGreaterThan"]=prot.CaptionGreaterThan;prot["CaptionGreaterThanOrEqual"]=prot.CaptionGreaterThanOrEqual;prot["CaptionLessThan"]=prot.CaptionLessThan;prot["CaptionLessThanOrEqual"]=prot.CaptionLessThanOrEqual;prot["CaptionBetween"]=prot.CaptionBetween;prot["CaptionNotBetween"]=prot.CaptionNotBetween;prot["ValueEqual"]=prot.ValueEqual; prot["ValueNotEqual"]=prot.ValueNotEqual;prot["ValueGreaterThan"]=prot.ValueGreaterThan;prot["ValueGreaterThanOrEqual"]=prot.ValueGreaterThanOrEqual;prot["ValueLessThan"]=prot.ValueLessThan;prot["ValueLessThanOrEqual"]=prot.ValueLessThanOrEqual;prot["ValueBetween"]=prot.ValueBetween;prot["ValueNotBetween"]=prot.ValueNotBetween;prot["DateEqual"]=prot.DateEqual;prot["DateNotEqual"]=prot.DateNotEqual;prot["DateOlderThan"]=prot.DateOlderThan;prot["DateOlderThanOrEqual"]=prot.DateOlderThanOrEqual;prot["DateNewerThan"]= prot.DateNewerThan;prot["DateNewerThanOrEqual"]=prot.DateNewerThanOrEqual;prot["DateBetween"]=prot.DateBetween;prot["DateNotBetween"]=prot.DateNotBetween;prot["Tomorrow"]=prot.Tomorrow;prot["Today"]=prot.Today;prot["Yesterday"]=prot.Yesterday;prot["NextWeek"]=prot.NextWeek;prot["ThisWeek"]=prot.ThisWeek;prot["LastWeek"]=prot.LastWeek;prot["NextMonth"]=prot.NextMonth;prot["ThisMonth"]=prot.ThisMonth;prot["LastMonth"]=prot.LastMonth;prot["NextQuarter"]=prot.NextQuarter;prot["ThisQuarter"]=prot.ThisQuarter; prot["LastQuarter"]=prot.LastQuarter;prot["NextYear"]=prot.NextYear;prot["ThisYear"]=prot.ThisYear;prot["LastYear"]=prot.LastYear;prot["YearToDate"]=prot.YearToDate;prot["Q1"]=prot.Q1;prot["Q2"]=prot.Q2;prot["Q3"]=prot.Q3;prot["Q4"]=prot.Q4;prot["M1"]=prot.M1;prot["M2"]=prot.M2;prot["M3"]=prot.M3;prot["M4"]=prot.M4;prot["M5"]=prot.M5;prot["M6"]=prot.M6;prot["M7"]=prot.M7;prot["M8"]=prot.M8;prot["M9"]=prot.M9;prot["M10"]=prot.M10;prot["M11"]=prot.M11;prot["M12"]=prot.M12;window["Asc"]["c_oAscSortType"]= window["Asc"].c_oAscSortType=c_oAscSortType;prot=c_oAscSortType;prot["None"]=prot.None;prot["Ascending"]=prot.Ascending;prot["Descending"]=prot.Descending;prot["AscendingAlpha"]=prot.AscendingAlpha;prot["DescendingAlpha"]=prot.DescendingAlpha;prot["AscendingNatural"]=prot.AscendingNatural;prot["DescendingNatural"]=prot.DescendingNatural;window["Asc"]["c_oAscPivotAreaType"]=window["Asc"].c_oAscPivotAreaType=c_oAscPivotAreaType;prot=c_oAscPivotAreaType;prot["None"]=prot.None;prot["Normal"]=prot.Normal; prot["Data"]=prot.Data;prot["All"]=prot.All;prot["Origin"]=prot.Origin;prot["Button"]=prot.Button;prot["TopEnd"]=prot.TopEnd;window["Asc"]["c_oAscGroupBy"]=window["Asc"].c_oAscGroupBy=c_oAscGroupBy;prot=c_oAscGroupBy;prot["Range"]=prot.Range;prot["Seconds"]=prot.Seconds;prot["Minutes"]=prot.Minutes;prot["Hours"]=prot.Hours;prot["Days"]=prot.Days;prot["Months"]=prot.Months;prot["Quarters"]=prot.Quarters;prot["Years"]=prot.Years;window["Asc"]["c_oAscCalendarType"]=window["Asc"].c_oAscCalendarType=c_oAscCalendarType; prot=c_oAscCalendarType;prot["Gregorian"]=prot.Gregorian;prot["GregorianUs"]=prot.GregorianUs;prot["GregorianMeFrench"]=prot.GregorianMeFrench;prot["GregorianArabic"]=prot.GregorianArabic;prot["Hijri"]=prot.Hijri;prot["Hebrew"]=prot.Hebrew;prot["Taiwan"]=prot.Taiwan;prot["Japan"]=prot.Japan;prot["Thai"]=prot.Thai;prot["Korea"]=prot.Korea;prot["Saka"]=prot.Saka;prot["GregorianXlitEnglish"]=prot.GregorianXlitEnglish;prot["GregorianXlitFrench"]=prot.GregorianXlitFrench;prot["None"]=prot.None;window["Asc"]["c_oAscIconSetType"]= window["Asc"].c_oAscIconSetType=c_oAscIconSetType;prot=c_oAscIconSetType;prot["ThreeArrows"]=prot.ThreeArrows;prot["ThreeArrowsGray"]=prot.ThreeArrowsGray;prot["ThreeFlags"]=prot.ThreeFlags;prot["ThreeTrafficLights1"]=prot.ThreeTrafficLights1;prot["ThreeTrafficLights2"]=prot.ThreeTrafficLights2;prot["ThreeSigns"]=prot.ThreeSigns;prot["ThreeSymbols"]=prot.ThreeSymbols;prot["ThreeSymbols2"]=prot.ThreeSymbols2;prot["FourArrows"]=prot.FourArrows;prot["FourArrowsGray"]=prot.FourArrowsGray;prot["FourRedToBlack"]= prot.FourRedToBlack;prot["FourRating"]=prot.FourRating;prot["FourTrafficLights"]=prot.FourTrafficLights;prot["FiveArrows"]=prot.FiveArrows;prot["FiveArrowsGray"]=prot.FiveArrowsGray;prot["FiveRating"]=prot.FiveRating;prot["FiveQuarters"]=prot.FiveQuarters;window["Asc"]["st_VALUES"]=window["AscCommonExcel"].st_VALUES=st_VALUES;window["AscCommonExcel"].DATA_CAPTION=DATA_CAPTION;window["AscCommonExcel"].BLANK_CAPTION=BLANK_CAPTION;window["AscCommonExcel"].GRAND_TOTAL_CAPTION=GRAND_TOTAL_CAPTION;window["AscCommonExcel"].ROW_HEADER_CAPTION= ROW_HEADER_CAPTION;window["AscCommonExcel"].COL_HEADER_CAPTION=COL_HEADER_CAPTION;window["AscCommonExcel"].PAGE_ALL_CAPTION=PAGE_ALL_CAPTION;window["AscCommonExcel"].PAGE_MULTIPLE_CAPTION=PAGE_MULTIPLE_CAPTION;window["AscCommonExcel"].FIELD_CAPTION=FIELD_CAPTION;window["AscCommonExcel"].NEW_PIVOT_LAST_COL_OFFSET=NEW_PIVOT_LAST_COL_OFFSET;window["AscCommonExcel"].NEW_PIVOT_LAST_ROW_OFFSET=NEW_PIVOT_LAST_ROW_OFFSET;window["AscCommonExcel"].NEW_PIVOT_LAST_COL_OFFSET_GRID_DROP_ZONES=NEW_PIVOT_LAST_COL_OFFSET_GRID_DROP_ZONES; window["AscCommonExcel"].NEW_PIVOT_LAST_ROW_OFFSET_GRID_DROP_ZONES=NEW_PIVOT_LAST_ROW_OFFSET_GRID_DROP_ZONES;window["AscCommonExcel"].NEW_PIVOT_ROW=NEW_PIVOT_ROW;window["AscCommonExcel"].NEW_PIVOT_COL=NEW_PIVOT_COL;window["AscCommonExcel"].ToName_ST_ItemType=ToName_ST_ItemType;window["AscCommonExcel"].ToName_ST_DataConsolidateFunction=ToName_ST_DataConsolidateFunction;window["AscCommonExcel"].cmpPivotItems=cmpPivotItems;window["Asc"]["CT_PivotCacheDefinition"]=window["Asc"].CT_PivotCacheDefinition= CT_PivotCacheDefinition;window["Asc"]["CT_pivotTableDefinitionX14"]=window["Asc"].CT_pivotTableDefinitionX14=CT_pivotTableDefinitionX14;window["Asc"]["CT_PivotCacheRecords"]=window["Asc"].CT_PivotCacheRecords=CT_PivotCacheRecords;window["Asc"]["CT_pivotTableDefinition"]=window["Asc"].CT_pivotTableDefinition=CT_pivotTableDefinition;prot=CT_pivotTableDefinition.prototype;prot["asc_getName"]=prot.asc_getName;prot["asc_getPageWrap"]=prot.asc_getPageWrap;prot["asc_getPageOverThenDown"]=prot.asc_getPageOverThenDown; prot["asc_getRowGrandTotals"]=prot.asc_getRowGrandTotals;prot["asc_getColGrandTotals"]=prot.asc_getColGrandTotals;prot["asc_getShowHeaders"]=prot.asc_getShowHeaders;prot["asc_getDataRef"]=prot.asc_getDataRef;prot["asc_getTitle"]=prot.asc_getTitle;prot["asc_getDescription"]=prot.asc_getDescription;prot["asc_getStyleInfo"]=prot.asc_getStyleInfo;prot["asc_getCacheFields"]=prot.asc_getCacheFields;prot["asc_getPivotFields"]=prot.asc_getPivotFields;prot["asc_getPageFields"]=prot.asc_getPageFields;prot["asc_getColumnFields"]= prot.asc_getColumnFields;prot["asc_getRowFields"]=prot.asc_getRowFields;prot["asc_getDataFields"]=prot.asc_getDataFields;prot["asc_select"]=prot.asc_select;prot["getCacheFieldName"]=prot.getCacheFieldName;prot["getPivotFieldName"]=prot.getPivotFieldName;prot["asc_set"]=prot.asc_set;prot["asc_setName"]=prot.asc_setName;prot["asc_setRowGrandTotals"]=prot.asc_setRowGrandTotals;prot["asc_setColGrandTotals"]=prot.asc_setColGrandTotals;prot["asc_setPageOverThenDown"]=prot.asc_setPageOverThenDown;prot["asc_setPageWrap"]= prot.asc_setPageWrap;prot["asc_setShowHeaders"]=prot.asc_setShowHeaders;prot["asc_setCompact"]=prot.asc_setCompact;prot["asc_setOutline"]=prot.asc_setOutline;prot["asc_setGridDropZones"]=prot.asc_setGridDropZones;prot["asc_setFillDownLabelsDefault"]=prot.asc_setFillDownLabelsDefault;prot["asc_getFillDownLabelsDefault"]=prot.asc_getFillDownLabelsDefault;prot["asc_setDataRef"]=prot.asc_setDataRef;prot["asc_setTitle"]=prot.asc_setTitle;prot["asc_setDescription"]=prot.asc_setDescription;prot["asc_setInsertBlankRow"]= prot.asc_setInsertBlankRow;prot["asc_setDefaultSubtotal"]=prot.asc_setDefaultSubtotal;prot["asc_setSubtotalTop"]=prot.asc_setSubtotalTop;prot["asc_addPageField"]=prot.asc_addPageField;prot["asc_addRowField"]=prot.asc_addRowField;prot["asc_addColField"]=prot.asc_addColField;prot["asc_addDataField"]=prot.asc_addDataField;prot["asc_addField"]=prot.asc_addField;prot["asc_removeField"]=prot.asc_removeField;prot["asc_removeNoDataField"]=prot.asc_removeNoDataField;prot["asc_removeDataField"]=prot.asc_removeDataField; prot["asc_moveToPageField"]=prot.asc_moveToPageField;prot["asc_moveToRowField"]=prot.asc_moveToRowField;prot["asc_moveToColField"]=prot.asc_moveToColField;prot["asc_moveToDataField"]=prot.asc_moveToDataField;prot["asc_movePageField"]=prot.asc_movePageField;prot["asc_moveRowField"]=prot.asc_moveRowField;prot["asc_moveColField"]=prot.asc_moveColField;prot["asc_moveDataField"]=prot.asc_moveDataField;prot["asc_refresh"]=prot.asc_refresh;window["Asc"]["CT_PivotTableStyle"]=window["Asc"].CT_PivotTableStyle= CT_PivotTableStyle;prot=CT_PivotTableStyle.prototype;prot["asc_getName"]=prot.asc_getName;prot["asc_getShowRowHeaders"]=prot.asc_getShowRowHeaders;prot["asc_getShowColHeaders"]=prot.asc_getShowColHeaders;prot["asc_getShowRowStripes"]=prot.asc_getShowRowStripes;prot["asc_getShowColStripes"]=prot.asc_getShowColStripes;prot["asc_setName"]=prot.asc_setName;prot["asc_setShowRowHeaders"]=prot.asc_setShowRowHeaders;prot["asc_setShowColHeaders"]=prot.asc_setShowColHeaders;prot["asc_setShowRowStripes"]=prot.asc_setShowRowStripes; prot["asc_setShowColStripes"]=prot.asc_setShowColStripes;window["Asc"]["CT_CacheField"]=window["Asc"].CT_CacheField=CT_CacheField;prot=CT_CacheField.prototype;prot["asc_getName"]=prot.asc_getName;window["Asc"]["CT_PivotField"]=window["Asc"].CT_PivotField=CT_PivotField;prot=CT_PivotField.prototype;prot["asc_getName"]=prot.asc_getName;prot["asc_getOutline"]=prot.asc_getOutline;prot["asc_getCompact"]=prot.asc_getCompact;prot["asc_getFillDownLabelsDefault"]=prot.asc_getFillDownLabelsDefault;prot["asc_getInsertBlankRow"]= prot.asc_getInsertBlankRow;prot["asc_getDefaultSubtotal"]=prot.asc_getDefaultSubtotal;prot["asc_getSubtotalTop"]=prot.asc_getSubtotalTop;prot["asc_getShowAll"]=prot.asc_getShowAll;prot["asc_getSubtotals"]=prot.asc_getSubtotals;prot["asc_set"]=prot.asc_set;prot["asc_setName"]=prot.asc_setName;prot["asc_setOutline"]=prot.asc_setOutline;prot["asc_setCompact"]=prot.asc_setCompact;prot["asc_setFillDownLabelsDefault"]=prot.asc_setFillDownLabelsDefault;prot["asc_setInsertBlankRow"]=prot.asc_setInsertBlankRow; prot["asc_setDefaultSubtotal"]=prot.asc_setDefaultSubtotal;prot["asc_setSubtotalTop"]=prot.asc_setSubtotalTop;prot["asc_setShowAll"]=prot.asc_setShowAll;prot["asc_setSubtotals"]=prot.asc_setSubtotals;prot=CT_Field.prototype;prot["asc_getIndex"]=prot.asc_getIndex;prot=CT_PageField.prototype;prot["asc_getName"]=prot.asc_getName;prot["asc_getIndex"]=prot.asc_getIndex;window["Asc"]["CT_DataField"]=window["Asc"].CT_DataField=CT_DataField;prot=CT_DataField.prototype;prot["asc_getName"]=prot.asc_getName; prot["asc_getIndex"]=prot.asc_getIndex;prot["asc_getSubtotal"]=prot.asc_getSubtotal;prot["asc_getShowDataAs"]=prot.asc_getShowDataAs;prot["asc_set"]=prot.asc_set;prot["asc_setName"]=prot.asc_setName;prot["asc_setSubtotal"]=prot.asc_setSubtotal;window["Asc"]["CT_PivotFilter"]=window["Asc"].CT_PivotFilter=CT_PivotFilter;window["Asc"]["CT_WorksheetSource"]=window["Asc"].CT_WorksheetSource=CT_WorksheetSource;"use strict";var type_Unknown=0;function CDocumentContentElementBase(oParent){this.Id=AscCommon.g_oIdCounter.Get_NewId(); this.Parent=oParent;this.Prev=null;this.Next=null;this.Index=-1;this.Recalculated=false;this.X=0;this.Y=0;this.XLimit=0;this.YLimit=0;this.PageNum=0;this.ColumnNum=0;this.ColumnsCount=0}CDocumentContentElementBase.prototype.Get_Type=function(){return this.GetType()};CDocumentContentElementBase.prototype.GetType=function(){return type_Unknown};CDocumentContentElementBase.prototype.IsParagraph=function(){return this.GetType()===type_Paragraph};CDocumentContentElementBase.prototype.IsTable=function(){return this.GetType()=== type_Table};CDocumentContentElementBase.prototype.IsBlockLevelSdt=function(){return this.GetType()===type_BlockLevelSdt};CDocumentContentElementBase.prototype.Is_Inline=function(){return true};CDocumentContentElementBase.prototype.Set_DocumentIndex=function(nIndex){this.Index=nIndex};CDocumentContentElementBase.prototype.Set_DocumentNext=function(oElement){this.Next=oElement};CDocumentContentElementBase.prototype.Set_DocumentPrev=function(oElement){this.Prev=oElement};CDocumentContentElementBase.prototype.Get_DocumentNext= function(){return this.Next};CDocumentContentElementBase.prototype.Get_DocumentPrev=function(){return this.Prev};CDocumentContentElementBase.prototype.GetParent=function(){return this.Parent};CDocumentContentElementBase.prototype.SetParent=function(oParent){this.Parent=oParent};CDocumentContentElementBase.prototype.Set_Parent=function(oParent){this.Parent=oParent};CDocumentContentElementBase.prototype.Get_Parent=function(){return this.Parent};CDocumentContentElementBase.prototype.GetId=function(){return this.Id}; CDocumentContentElementBase.prototype.Get_Id=function(){return this.GetId()};CDocumentContentElementBase.prototype.Reset=function(X,Y,XLimit,YLimit,PageAbs,ColumnAbs,ColumnsCount){this.X=X;this.Y=Y;this.XLimit=XLimit;this.YLimit=YLimit;this.PageNum=PageAbs;this.ColumnNum=ColumnAbs?ColumnAbs:0;this.ColumnsCount=ColumnsCount?ColumnsCount:1};CDocumentContentElementBase.prototype.Recalculate_Page=function(CurPage){return recalcresult_NextElement};CDocumentContentElementBase.prototype.Get_PageBounds=function(CurPage){return new CDocumentBounds(this.X, this.Y,this.XLimit,this.YLimit)};CDocumentContentElementBase.prototype.GetContentBounds=function(CurPage){return new CDocumentBounds(this.X,this.Y,this.XLimit,this.YLimit)};CDocumentContentElementBase.prototype.IsEmptyPage=function(nCurPage){return false};CDocumentContentElementBase.prototype.Reset_RecalculateCache=function(){};CDocumentContentElementBase.prototype.Write_ToBinary2=function(Writer){Writer.WriteLong(AscDFH.historyitem_type_Unknown)};CDocumentContentElementBase.prototype.Read_FromBinary2= function(Reader){};CDocumentContentElementBase.prototype.Get_PagesCount=function(){return 0};CDocumentContentElementBase.prototype.Document_CreateFontMap=function(FontMap){};CDocumentContentElementBase.prototype.Document_CreateFontCharMap=function(FontCharMap){};CDocumentContentElementBase.prototype.Document_Get_AllFontNames=function(AllFonts){};CDocumentContentElementBase.prototype.IsInText=function(X,Y,CurPage){return null};CDocumentContentElementBase.prototype.IsInDrawing=function(X,Y,CurPage){return false}; CDocumentContentElementBase.prototype.IsTableBorder=function(X,Y,CurPage){return null};CDocumentContentElementBase.prototype.UpdateCursorType=function(X,Y,CurPage){};CDocumentContentElementBase.prototype.Selection_SetStart=function(X,Y,CurPage,MouseEvent,isTableBorder){};CDocumentContentElementBase.prototype.Selection_SetEnd=function(X,Y,CurPage,MouseEvent,isTableBorder){};CDocumentContentElementBase.prototype.IsSelectionEmpty=function(isCheckHidden){return true};CDocumentContentElementBase.prototype.GetSelectedElementsInfo= function(oInfo){};CDocumentContentElementBase.prototype.Document_UpdateRulersState=function(CurPage){this.Content.Document_UpdateRulersState(CurPage)};CDocumentContentElementBase.prototype.IsSelectionUse=function(){return false};CDocumentContentElementBase.prototype.IsSelectionToEnd=function(){return false};CDocumentContentElementBase.prototype.RemoveSelection=function(){};CDocumentContentElementBase.prototype.SetSelectionUse=function(isUse){};CDocumentContentElementBase.prototype.SetSelectionToBeginEnd= function(isSelectionStart,isElementStart){};CDocumentContentElementBase.prototype.SelectAll=function(nDirection){};CDocumentContentElementBase.prototype.GetCalculatedTextPr=function(){var oTextPr=new CTextPr;oTextPr.InitDefault();return oTextPr};CDocumentContentElementBase.prototype.GetCalculatedParaPr=function(){var oParaPr=new CParaPr;oParaPr.InitDefault();return oParaPr};CDocumentContentElementBase.prototype.GetDirectParaPr=function(){return new CParaPr};CDocumentContentElementBase.prototype.GetDirectTextPr= function(){return new CTextPr};CDocumentContentElementBase.prototype.DrawSelectionOnPage=function(CurPage){};CDocumentContentElementBase.prototype.StopSelection=function(){};CDocumentContentElementBase.prototype.GetSelectionBounds=function(){return{Start:null,End:null,Direction:0}};CDocumentContentElementBase.prototype.RecalculateCurPos=function(bUpdateX,bUpdateY,isUpdateTarget){return null};CDocumentContentElementBase.prototype.Can_CopyCut=function(){return false};CDocumentContentElementBase.prototype.CanCopyCut= function(){return this.Can_CopyCut()};CDocumentContentElementBase.prototype.CheckPosInSelection=function(X,Y,CurPage,NearPos){return false};CDocumentContentElementBase.prototype.Get_NearestPos=function(CurPage,X,Y,bAnchor,Drawing){return{X:0,Y:0,Height:0,PageNum:0,Internal:{Line:0,Page:0,Range:0},Transform:null,Paragraph:null,ContentPos:null,SearchPos:null}};CDocumentContentElementBase.prototype.GetNearestPos=function(CurPage,X,Y,bAnchor,Drawing){return this.Get_NearestPos(CurPage,X,Y,bAnchor,Drawing)}; CDocumentContentElementBase.prototype.CanUpdateTarget=function(CurPage){return false};CDocumentContentElementBase.prototype.MoveCursorLeftWithSelectionFromEnd=function(Word){};CDocumentContentElementBase.prototype.MoveCursorLeft=function(AddToSelect,Word){return false};CDocumentContentElementBase.prototype.MoveCursorRight=function(AddToSelect,Word){return false};CDocumentContentElementBase.prototype.MoveCursorRightWithSelectionFromStart=function(Word){};CDocumentContentElementBase.prototype.MoveCursorToStartPos= function(AddToSelect){};CDocumentContentElementBase.prototype.MoveCursorToEndPos=function(AddToSelect,StartSelectFromEnd){};CDocumentContentElementBase.prototype.MoveCursorUp=function(AddToSelect){return false};CDocumentContentElementBase.prototype.MoveCursorUpToLastRow=function(X,Y,AddToSelect){return false};CDocumentContentElementBase.prototype.MoveCursorDown=function(AddToSelect){return false};CDocumentContentElementBase.prototype.MoveCursorDownToFirstRow=function(X,Y,AddToSelect){return false}; CDocumentContentElementBase.prototype.MoveCursorToEndOfLine=function(AddToSelect){return false};CDocumentContentElementBase.prototype.MoveCursorToStartOfLine=function(AddToSelect){return false};CDocumentContentElementBase.prototype.MoveCursorToXY=function(X,Y,bLine,bDontChangeRealPos,CurPage){return false};CDocumentContentElementBase.prototype.MoveCursorToCell=function(bNext){return false};CDocumentContentElementBase.prototype.IsCursorAtBegin=function(){return true};CDocumentContentElementBase.prototype.IsCursorAtEnd= function(){return true};CDocumentContentElementBase.prototype.GetSelectionState=function(){return[]};CDocumentContentElementBase.prototype.SetSelectionState=function(State,StateIndex){};CDocumentContentElementBase.prototype.AddNewParagraph=function(){};CDocumentContentElementBase.prototype.Get_SelectionState2=function(){return null};CDocumentContentElementBase.prototype.Set_SelectionState2=function(State){};CDocumentContentElementBase.prototype.IsStartFromNewPage=function(){return false};CDocumentContentElementBase.prototype.GetAllParagraphs= function(Props,ParaArray){return[]};CDocumentContentElementBase.prototype.GetAllTables=function(oProps,arrTables){return[]};CDocumentContentElementBase.prototype.SetContentSelection=function(StartDocPos,EndDocPos,Depth,StartFlag,EndFlag){};CDocumentContentElementBase.prototype.GetContentPosition=function(bSelection,bStart,PosArray){};CDocumentContentElementBase.prototype.SetContentPosition=function(DocPos,Depth,Flag){};CDocumentContentElementBase.prototype.GetNumberingInfo=function(oNumberingEngine){}; CDocumentContentElementBase.prototype.AddInlineImage=function(W,H,Img,Chart,bFlow){};CDocumentContentElementBase.prototype.AddImages=function(aImages){};CDocumentContentElementBase.prototype.AddOleObject=function(W,H,nWidthPix,nHeightPix,Img,Data,sApplicationId){};CDocumentContentElementBase.prototype.AddSignatureLine=function(oSignatureDrawing){};CDocumentContentElementBase.prototype.AddTextArt=function(nStyle){};CDocumentContentElementBase.prototype.AddInlineTable=function(nCols,nRows,nMode){return null}; CDocumentContentElementBase.prototype.Remove=function(nCount,bOnlyText,bRemoveOnlySelection,bOnAddText,isWord){};CDocumentContentElementBase.prototype.SetReviewType=function(ReviewType){};CDocumentContentElementBase.prototype.GetReviewType=function(){return reviewtype_Common};CDocumentContentElementBase.prototype.Is_Empty=function(){return true};CDocumentContentElementBase.prototype.Add=function(oParaItem){};CDocumentContentElementBase.prototype.PreDelete=function(){};CDocumentContentElementBase.prototype.ClearParagraphFormatting= function(isClearParaPr,isClearTextPr){};CDocumentContentElementBase.prototype.GetCursorPosXY=function(){return{X:0,Y:0}};CDocumentContentElementBase.prototype.StartSelectionFromCurPos=function(){};CDocumentContentElementBase.prototype.SetParagraphPr=function(oParaPr){};CDocumentContentElementBase.prototype.SetParagraphAlign=function(Align){};CDocumentContentElementBase.prototype.SetParagraphDefaultTabSize=function(TabSize){};CDocumentContentElementBase.prototype.SetParagraphSpacing=function(Spacing){}; CDocumentContentElementBase.prototype.SetParagraphTabs=function(Tabs){};CDocumentContentElementBase.prototype.SetParagraphIndent=function(Ind){};CDocumentContentElementBase.prototype.SetParagraphShd=function(Shd){};CDocumentContentElementBase.prototype.SetParagraphStyle=function(Name){};CDocumentContentElementBase.prototype.SetParagraphContextualSpacing=function(Value){};CDocumentContentElementBase.prototype.SetParagraphPageBreakBefore=function(Value){};CDocumentContentElementBase.prototype.SetParagraphKeepLines= function(Value){};CDocumentContentElementBase.prototype.SetParagraphKeepNext=function(Value){};CDocumentContentElementBase.prototype.SetParagraphWidowControl=function(Value){};CDocumentContentElementBase.prototype.SetParagraphBorders=function(Borders){};CDocumentContentElementBase.prototype.SetParagraphFramePr=function(FramePr,bDelete){};CDocumentContentElementBase.prototype.IncreaseDecreaseFontSize=function(bIncrease){};CDocumentContentElementBase.prototype.IncreaseDecreaseIndent=function(bIncrease){}; CDocumentContentElementBase.prototype.SetImageProps=function(oProps){};CDocumentContentElementBase.prototype.SetTableProps=function(oProps){};CDocumentContentElementBase.prototype.GetSelectedContent=function(oSelectedContent){};CDocumentContentElementBase.prototype.PasteFormatting=function(TextPr,ParaPr,ApplyPara){};CDocumentContentElementBase.prototype.GetCurPosXY=function(){return{X:0,Y:0}};CDocumentContentElementBase.prototype.GetSelectedText=function(bClearText,oPr){return null};CDocumentContentElementBase.prototype.GetCurrentParagraph= function(bIgnoreSelection,arrSelectedParagraphs){return null};CDocumentContentElementBase.prototype.AddTableRow=function(bBefore,nCount){return false};CDocumentContentElementBase.prototype.AddTableColumn=function(bBefore,nCount){return false};CDocumentContentElementBase.prototype.RemoveTableRow=function(nRowIndex){return false};CDocumentContentElementBase.prototype.RemoveTableColumn=function(){return false};CDocumentContentElementBase.prototype.MergeTableCells=function(){return false};CDocumentContentElementBase.prototype.SplitTableCells= function(nColsCount,nRowsCount){return false};CDocumentContentElementBase.prototype.RemoveTableCells=function(){return false};CDocumentContentElementBase.prototype.RemoveTable=function(){return false};CDocumentContentElementBase.prototype.SelectTable=function(Type){};CDocumentContentElementBase.prototype.DistributeTableCells=function(isHorizontally){return false};CDocumentContentElementBase.prototype.CanMergeTableCells=function(){return false};CDocumentContentElementBase.prototype.CanSplitTableCells= function(){return false};CDocumentContentElementBase.prototype.Document_UpdateInterfaceState=function(){};CDocumentContentElementBase.prototype.Document_UpdateRulersState=function(){};CDocumentContentElementBase.prototype.GetTableProps=function(){return null};CDocumentContentElementBase.prototype.AddHyperlink=function(Props){};CDocumentContentElementBase.prototype.ModifyHyperlink=function(Props){};CDocumentContentElementBase.prototype.RemoveHyperlink=function(){};CDocumentContentElementBase.prototype.CanAddHyperlink= function(bCheckInHyperlink){return false};CDocumentContentElementBase.prototype.IsCursorInHyperlink=function(bCheckEnd){return null};CDocumentContentElementBase.prototype.AddComment=function(Comment,bStart,bEnd){};CDocumentContentElementBase.prototype.CanAddComment=function(){return false};CDocumentContentElementBase.prototype.GetSelectionAnchorPos=function(){return null};CDocumentContentElementBase.prototype.AddContentControl=function(nContentControlType){return null};CDocumentContentElementBase.prototype.RecalculateMinMaxContentWidth= function(isRotated){return{Min:0,Max:0}};CDocumentContentElementBase.prototype.Shift=function(CurPage,dX,dY){};CDocumentContentElementBase.prototype.UpdateEndInfo=function(){};CDocumentContentElementBase.prototype.PrepareRecalculateObject=function(){};CDocumentContentElementBase.prototype.SaveRecalculateObject=function(){return null};CDocumentContentElementBase.prototype.LoadRecalculateObject=function(RecalcObj){};CDocumentContentElementBase.prototype.Set_ApplyToAll=function(bValue){this.SetApplyToAll(bValue)}; CDocumentContentElementBase.prototype.Get_ApplyToAll=function(){return this.IsApplyToAll()};CDocumentContentElementBase.prototype.SetApplyToAll=function(isApplyAll){this.ApplyToAll=isApplyAll};CDocumentContentElementBase.prototype.IsApplyToAll=function(){return this.ApplyToAll};CDocumentContentElementBase.prototype.RecalculateAllTables=function(){};CDocumentContentElementBase.prototype.GetAllFloatElements=function(FloatObjects){if(!FloatObjects)return[];return FloatObjects};CDocumentContentElementBase.prototype.Get_FirstParagraph= function(){return null};CDocumentContentElementBase.prototype.StartFromNewPage=function(){};CDocumentContentElementBase.prototype.CollectDocumentStatistics=function(Stats){};CDocumentContentElementBase.prototype.CompareDrawingsLogicPositions=function(CompareObject){return 0};CDocumentContentElementBase.prototype.GetStyleFromFormatting=function(){return null};CDocumentContentElementBase.prototype.GetAllContentControls=function(arrContentControls){};CDocumentContentElementBase.prototype.IsSelectedAll= function(){return false};CDocumentContentElementBase.prototype.GetLastRangeVisibleBounds=function(){return{X:0,Y:0,W:0,H:0,BaseLine:0,XLimit:0}};CDocumentContentElementBase.prototype.FindNextFillingForm=function(isNext,isCurrent,isStart){return null};CDocumentContentElementBase.prototype.GetRevisionsChangeElement=function(SearchEngine){return null};CDocumentContentElementBase.prototype.AcceptRevisionChanges=function(Type,bAll){};CDocumentContentElementBase.prototype.RejectRevisionChanges=function(Type, bAll){};CDocumentContentElementBase.prototype.GetDocumentPositionFromObject=function(arrPos){if(!arrPos)arrPos=[];var oParent=this.GetParent();if(oParent)if(arrPos.length>0){arrPos.splice(0,0,{Class:oParent,Position:this.GetIndex()});arrPos=oParent.GetDocumentPositionFromObject(arrPos)}else{arrPos=oParent.GetDocumentPositionFromObject(arrPos);arrPos.push({Class:oParent,Position:this.GetIndex()})}return arrPos};CDocumentContentElementBase.prototype.Get_Index=function(){return this.GetIndex()};CDocumentContentElementBase.prototype.GetOutlineParagraphs= function(arrOutline,oPr){};CDocumentContentElementBase.prototype.Get_StartPage_Absolute=function(){return this.Get_AbsolutePage(0)};CDocumentContentElementBase.prototype.Get_StartPage_Relative=function(){return this.PageNum};CDocumentContentElementBase.prototype.Get_StartColumn=function(){return this.ColumnNum};CDocumentContentElementBase.prototype.Get_ColumnsCount=function(){return this.ColumnsCount};CDocumentContentElementBase.prototype.GetStartColumn=function(){return this.ColumnNum};CDocumentContentElementBase.prototype.GetColumnsCount= function(){return this.ColumnsCount};CDocumentContentElementBase.prototype.private_GetRelativePageIndex=function(CurPage){if(!this.ColumnsCount||0===this.ColumnsCount)return this.PageNum+CurPage;return this.PageNum+((this.ColumnNum+CurPage)/this.ColumnsCount|0)};CDocumentContentElementBase.prototype.private_GetAbsolutePageIndex=function(CurPage){return this.Parent.Get_AbsolutePage(this.private_GetRelativePageIndex(CurPage))};CDocumentContentElementBase.prototype.Get_AbsolutePage=function(CurPage){return this.private_GetAbsolutePageIndex(CurPage)}; CDocumentContentElementBase.prototype.Get_AbsoluteColumn=function(CurPage){if(this.Parent instanceof CDocument)return this.private_GetColumnIndex(CurPage);return this.Parent.Get_AbsoluteColumn(this.private_GetRelativePageIndex(CurPage))};CDocumentContentElementBase.prototype.private_GetColumnIndex=function(CurPage){return this.ColumnNum+CurPage-((this.ColumnNum+CurPage)/this.ColumnsCount|0)*this.ColumnsCount};CDocumentContentElementBase.prototype.Get_CurrentPage_Absolute=function(){return this.private_GetAbsolutePageIndex(0)}; CDocumentContentElementBase.prototype.Get_CurrentPage_Relative=function(){return this.private_GetRelativePageIndex(0)};CDocumentContentElementBase.prototype.GetCurrentPageAbsolute=function(){return this.Get_CurrentPage_Absolute()};CDocumentContentElementBase.prototype.GetAbsolutePage=function(CurPage){return this.private_GetAbsolutePageIndex(CurPage)};CDocumentContentElementBase.prototype.GetAbsoluteColumn=function(CurPage){return this.Get_AbsoluteColumn(CurPage)};CDocumentContentElementBase.prototype.GetStartPageRelative= function(){return this.PageNum};CDocumentContentElementBase.prototype.GetRelativePage=function(nCurPage){return this.private_GetRelativePageIndex(nCurPage)};CDocumentContentElementBase.prototype.GetStartPageAbsolute=function(){return this.private_GetAbsolutePageIndex(0)};CDocumentContentElementBase.prototype.GetPagesCount=function(){return this.Get_PagesCount()};CDocumentContentElementBase.prototype.GetIndex=function(){if(!this.Parent)return-1;this.Parent.Update_ContentIndexing();if(this!==this.Parent.GetElement(this.Index))this.Index= -1;return this.Index};CDocumentContentElementBase.prototype.GetPageBounds=function(CurPage){return this.Get_PageBounds(CurPage)};CDocumentContentElementBase.prototype.GetNearestPos=function(CurPage,X,Y,bAnchor,Drawing){return this.Get_NearestPos(CurPage,X,Y,bAnchor,Drawing)};CDocumentContentElementBase.prototype.CreateFontMap=function(oFontMap){return this.Document_CreateFontMap(oFontMap)};CDocumentContentElementBase.prototype.CreateFontCharMap=function(oFontCharMap){return this.Document_CreateFontCharMap(oFontCharMap)}; CDocumentContentElementBase.prototype.GetAllFontNames=function(FontNames){return this.Document_Get_AllFontNames(FontNames)};CDocumentContentElementBase.prototype.GetSelectionState2=function(){return this.Get_SelectionState2()};CDocumentContentElementBase.prototype.SetSelectionState2=function(State){return this.Set_SelectionState2(State)};CDocumentContentElementBase.prototype.GetReviewInfo=function(){return new CReviewInfo};CDocumentContentElementBase.prototype.SetReviewTypeWithInfo=function(nType, oInfo){};CDocumentContentElementBase.prototype.IsEmpty=function(oProps){return this.Is_Empty(oProps)};CDocumentContentElementBase.prototype.AddToParagraph=function(oItem){return this.Add(oItem)};CDocumentContentElementBase.prototype.GetAllDrawingObjects=function(AllDrawingObjects){};CDocumentContentElementBase.prototype.GetAllComments=function(AllComments){};CDocumentContentElementBase.prototype.GetAllMaths=function(AllMaths){};CDocumentContentElementBase.prototype.GetAllSeqFieldsByType=function(sType, aFields){};CDocumentContentElementBase.prototype.UpdateBookmarks=function(oManager){};CDocumentContentElementBase.prototype.GetTableOfContents=function(isUnique,isCheckFields){return null};CDocumentContentElementBase.prototype.GetTablesOfFigures=function(arrComplexFields){};CDocumentContentElementBase.prototype.IsSelectedSingleElement=function(){if(this.Parent)return this.Parent.IsSelectedSingleElement();return false};CDocumentContentElementBase.prototype.GetLastParagraph=function(){return null}; CDocumentContentElementBase.prototype.GetFirstParagraph=function(){return this.Get_FirstParagraph()};CDocumentContentElementBase.prototype.GetNextParagraph=function(){var oNextElement=this.Get_DocumentNext();if(oNextElement)if(type_Paragraph===oNextElement.GetType())return oNextElement;else return oNextElement.GetFirstParagraph();if(this.Parent&&this.Parent.GetNextParagraph)return this.Parent.GetNextParagraph();return null};CDocumentContentElementBase.prototype.GetPrevParagraph=function(){var oPrevElement= this.Get_DocumentPrev();if(oPrevElement)if(type_Paragraph===oPrevElement.GetType())return oPrevElement;else return oPrevElement.GetLastParagraph();if(this.Parent&&this.Parent.GetPrevParagraph)return this.Parent.GetPrevParagraph();return null};CDocumentContentElementBase.prototype.GetOutlineParagraphs=function(arrOutline,oPr){};CDocumentContentElementBase.prototype.GetSimilarNumbering=function(oContinueEngine){return null};CDocumentContentElementBase.prototype.GotoFootnoteRef=function(isNext,isCurrent, isStepFootnote,isStepEndnote){return false};CDocumentContentElementBase.prototype.SetIsRecalculated=function(isRecalculated){this.Recalculated=isRecalculated};CDocumentContentElementBase.prototype.IsRecalculated=function(){return this.Recalculated};CDocumentContentElementBase.prototype.GetPlaceHolderObject=function(){return null};CDocumentContentElementBase.prototype.GetAllFields=function(isUseSelection,arrFields){return arrFields?arrFields:[]};CDocumentContentElementBase.prototype.GetTopElement= function(){if(!this.Parent)return null;if(this.Parent===this.Parent.Is_TopDocument(true))return this;return this.Parent.GetTopElement()};CDocumentContentElementBase.prototype.GetLock=function(){return this.Lock};CDocumentContentElementBase.prototype.GetHdrFtr=function(){if(this.Parent)return this.Parent.IsHdrFtr(true);return null};CDocumentContentElementBase.prototype.IsUseInDocument=function(sId){return this.Is_UseInDocument(sId)};CDocumentContentElementBase.prototype.Is_UseInDocument=function(sId){return false}; CDocumentContentElementBase.prototype.CheckRunContent=function(fCheck){return false};CDocumentContentElementBase.prototype.GetStartPageForRecalculate=function(nPageAbs){return nPageAbs};CDocumentContentElementBase.prototype.GetPresentationField=function(){return null};CDocumentContentElementBase.prototype.GetAllTablesOnPage=function(nPageAbs,arrTables){return arrTables?arrTables:[]};CDocumentContentElementBase.prototype.ProcessComplexFields=function(){};CDocumentContentElementBase.prototype.RecalculateEndInfo= function(){};CDocumentContentElementBase.prototype.GetLogicDocument=function(){return this.LogicDocument};CDocumentContentElementBase.prototype.GetFramePr=function(){return null};CDocumentContentElementBase.prototype.GetMaxTableGridWidth=function(){return{GapLeft:0,GapRight:0,GridWidth:-1}};CDocumentContentElementBase.prototype.UpdateLineNumbersInfo=function(){};window["AscCommonWord"]=window["AscCommonWord"]||{};window["AscCommonWord"].CDocumentContentElementBase=CDocumentContentElementBase;window["AscCommonWord"].type_Unknown= type_Unknown;"use strict";var c_oAscRevisionsChangeType=Asc.c_oAscRevisionsChangeType;function CParagraphContentBase(){this.Type=para_Unknown;this.Paragraph=null;this.Parent=null;this.StartLine=-1;this.StartRange=-1;this.Lines=[];this.LinesLength=0}CParagraphContentBase.prototype.GetType=function(){return this.Type};CParagraphContentBase.prototype.Get_Type=function(){return this.Type};CParagraphContentBase.prototype.CanSplit=function(){return false};CParagraphContentBase.prototype.IsParagraphContentElement= function(){return true};CParagraphContentBase.prototype.IsStopCursorOnEntryExit=function(){return false};CParagraphContentBase.prototype.PreDelete=function(){};CParagraphContentBase.prototype.SetParagraph=function(oParagraph){this.Paragraph=oParagraph};CParagraphContentBase.prototype.SetParent=function(oParent){this.Parent=oParent};CParagraphContentBase.prototype.GetParagraph=function(){return this.Paragraph};CParagraphContentBase.prototype.Is_Empty=function(){return true};CParagraphContentBase.prototype.IsEmpty= function(){return this.Is_Empty()};CParagraphContentBase.prototype.Is_CheckingNearestPos=function(){return false};CParagraphContentBase.prototype.Get_CompiledTextPr=function(){return null};CParagraphContentBase.prototype.Clear_TextPr=function(){};CParagraphContentBase.prototype.Remove=function(){return false};CParagraphContentBase.prototype.Get_DrawingObjectRun=function(Id){return null};CParagraphContentBase.prototype.Get_DrawingObjectContentPos=function(Id,ContentPos,Depth){return false};CParagraphContentBase.prototype.GetRunByElement= function(oRunElement){return null};CParagraphContentBase.prototype.Get_Layout=function(DrawingLayout,UseContentPos,ContentPos,Depth){};CParagraphContentBase.prototype.GetNextRunElements=function(oRunElements,isUseContentPos,nDepth){};CParagraphContentBase.prototype.GetPrevRunElements=function(oRunElements,isUseContentPos,nDepth){};CParagraphContentBase.prototype.CollectDocumentStatistics=function(ParaStats){};CParagraphContentBase.prototype.Create_FontMap=function(Map){};CParagraphContentBase.prototype.Get_AllFontNames= function(AllFonts){};CParagraphContentBase.prototype.GetSelectedText=function(bAll,bClearText,oPr){return""};CParagraphContentBase.prototype.GetSelectDirection=function(){return 1};CParagraphContentBase.prototype.Clear_TextFormatting=function(DefHyper){};CParagraphContentBase.prototype.CanAddDropCap=function(){return null};CParagraphContentBase.prototype.CheckSelectionForDropCap=function(isUsePos,oEndPos,nDepth){return true};CParagraphContentBase.prototype.Get_TextForDropCap=function(DropCapText, UseContentPos,ContentPos,Depth){};CParagraphContentBase.prototype.Get_StartTabsCount=function(TabsCounter){return true};CParagraphContentBase.prototype.Remove_StartTabs=function(TabsCounter){return true};CParagraphContentBase.prototype.Copy=function(Selected,oPr,isCopyReviewPr){return new this.constructor};CParagraphContentBase.prototype.GetSelectedContent=function(oSelectedContent){return this.Copy()};CParagraphContentBase.prototype.CopyContent=function(Selected){return[]};CParagraphContentBase.prototype.Split= function(){return new ParaRun};CParagraphContentBase.prototype.Get_Text=function(Text){};CParagraphContentBase.prototype.Apply_TextPr=function(oTextPr,isIncFontSize,isApplyToAll){};CParagraphContentBase.prototype.Get_ParaPosByContentPos=function(ContentPos,Depth){return new CParaPos(this.StartRange,this.StartLine,0,0)};CParagraphContentBase.prototype.UpdateBookmarks=function(oManager){};CParagraphContentBase.prototype.CheckSpelling=function(oSpellCheckerEngine,nDepth){};CParagraphContentBase.prototype.GetParent= function(){if(this.Parent)return this.Parent;if(!this.Paragraph)return null;var oContentPos=this.Paragraph.Get_PosByElement(this);if(!oContentPos||oContentPos.Get_Depth()<0)return null;oContentPos.Decrease_Depth(1);return this.Paragraph.Get_ElementByPos(oContentPos)};CParagraphContentBase.prototype.GetPosInParent=function(_oParent){var oParent=_oParent?_oParent:this.GetParent();if(!oParent||!oParent.Content)return-1;for(var nPos=0,nCount=oParent.Content.length;nPos<nCount;++nPos)if(this===oParent.Content[nPos])return nPos; return-1};CParagraphContentBase.prototype.RemoveTabsForTOC=function(isTab){return isTab};CParagraphContentBase.prototype.GetComplexField=function(nType){return null};CParagraphContentBase.prototype.GetComplexFieldsArray=function(nType,arrComplexFields){};CParagraphContentBase.prototype.Recalculate_Reset=function(StartRange,StartLine){this.StartLine=StartLine;this.StartRange=StartRange};CParagraphContentBase.prototype.Recalculate_Range=function(PRS,ParaPr){};CParagraphContentBase.prototype.Recalculate_Set_RangeEndPos= function(PRS,PRP,Depth){};CParagraphContentBase.prototype.Recalculate_LineMetrics=function(PRS,ParaPr,_CurLine,_CurRange){};CParagraphContentBase.prototype.Recalculate_Range_Width=function(PRSC,_CurLine,_CurRange){};CParagraphContentBase.prototype.Recalculate_Range_Spaces=function(PRSA,CurLine,CurRange,CurPage){};CParagraphContentBase.prototype.Recalculate_PageEndInfo=function(PRSI,_CurLine,_CurRange){};CParagraphContentBase.prototype.RecalculateEndInfo=function(oPRSI){};CParagraphContentBase.prototype.SaveRecalculateObject= function(Copy){var RecalcObj=new CRunRecalculateObject(this.StartLine,this.StartRange);return RecalcObj};CParagraphContentBase.prototype.LoadRecalculateObject=function(RecalcObj,Parent){this.StartLine=RecalcObj.StartLine;this.StartRange=RecalcObj.StartRange};CParagraphContentBase.prototype.PrepareRecalculateObject=function(){};CParagraphContentBase.prototype.IsEmptyRange=function(nCurLine,nCurRange){return true};CParagraphContentBase.prototype.Check_Range_OnlyMath=function(Checker,CurRange,CurLine){}; CParagraphContentBase.prototype.CheckMathPara=function(nMathPos){return false};CParagraphContentBase.prototype.ProcessNotInlineObjectCheck=function(oChecker){};CParagraphContentBase.prototype.CheckNotInlineObject=function(nMathPos,nDirection){return false};CParagraphContentBase.prototype.Check_PageBreak=function(){return false};CParagraphContentBase.prototype.CheckSplitPageOnPageBreak=function(oPBChecker){return false};CParagraphContentBase.prototype.Recalculate_CurPos=function(X,Y,CurrentRun,_CurRange, _CurLine,CurPage,UpdateCurPos,UpdateTarget,ReturnTarget){return{X:X}};CParagraphContentBase.prototype.RecalculateMinMaxContentWidth=function(MinMax){};CParagraphContentBase.prototype.Get_Range_VisibleWidth=function(RangeW,_CurLine,_CurRange){};CParagraphContentBase.prototype.Shift_Range=function(Dx,Dy,_CurLine,_CurRange){};CParagraphContentBase.prototype.Draw_HighLights=function(PDSH){};CParagraphContentBase.prototype.Draw_Elements=function(PDSE){};CParagraphContentBase.prototype.Draw_Lines=function(PDSL){}; CParagraphContentBase.prototype.IsCursorPlaceable=function(){return false};CParagraphContentBase.prototype.Cursor_Is_Start=function(){return true};CParagraphContentBase.prototype.Cursor_Is_NeededCorrectPos=function(){return true};CParagraphContentBase.prototype.Cursor_Is_End=function(){return true};CParagraphContentBase.prototype.MoveCursorToStartPos=function(){};CParagraphContentBase.prototype.MoveCursorToEndPos=function(SelectFromEnd){};CParagraphContentBase.prototype.Get_ParaContentPosByXY=function(SearchPos, Depth,_CurLine,_CurRange,StepEnd){return false};CParagraphContentBase.prototype.Get_ParaContentPos=function(bSelection,bStart,ContentPos,bUseCorrection){};CParagraphContentBase.prototype.Set_ParaContentPos=function(ContentPos,Depth){};CParagraphContentBase.prototype.Get_PosByElement=function(Class,ContentPos,Depth,UseRange,Range,Line){if(this===Class)return true;return false};CParagraphContentBase.prototype.Get_ElementByPos=function(ContentPos,Depth){return this};CParagraphContentBase.prototype.Get_ClassesByPos= function(Classes,ContentPos,Depth){Classes.push(this)};CParagraphContentBase.prototype.Get_PosByDrawing=function(Id,ContentPos,Depth){return false};CParagraphContentBase.prototype.Get_RunElementByPos=function(ContentPos,Depth){return null};CParagraphContentBase.prototype.Get_LastRunInRange=function(_CurLine,_CurRange){return null};CParagraphContentBase.prototype.Get_LeftPos=function(SearchPos,ContentPos,Depth,UseContentPos){};CParagraphContentBase.prototype.Get_RightPos=function(SearchPos,ContentPos, Depth,UseContentPos,StepEnd){};CParagraphContentBase.prototype.Get_WordStartPos=function(SearchPos,ContentPos,Depth,UseContentPos){};CParagraphContentBase.prototype.Get_WordEndPos=function(SearchPos,ContentPos,Depth,UseContentPos,StepEnd){};CParagraphContentBase.prototype.Get_EndRangePos=function(_CurLine,_CurRange,SearchPos,Depth){return false};CParagraphContentBase.prototype.Get_StartRangePos=function(_CurLine,_CurRange,SearchPos,Depth){return false};CParagraphContentBase.prototype.Get_StartRangePos2= function(_CurLine,_CurRange,ContentPos,Depth){};CParagraphContentBase.prototype.Get_EndRangePos2=function(_CurLine,_CurRange,ContentPos,Depth){};CParagraphContentBase.prototype.Get_StartPos=function(ContentPos,Depth){};CParagraphContentBase.prototype.Get_EndPos=function(BehindEnd,ContentPos,Depth){};CParagraphContentBase.prototype.MoveCursorOutsideElement=function(isBefore){var oParent=this.GetParent();if(!oParent)return;var nPosInParent=this.GetPosInParent(oParent);if(isBefore)if(nPosInParent<=0){if(this.SetThisElementCurrent)this.SetThisElementCurrent(); this.MoveCursorToStartPos()}else{var oElement=oParent.GetElement(nPosInParent-1);if(oElement.IsCursorPlaceable()){if(oElement.SetThisElementCurrent)oElement.SetThisElementCurrent();oElement.MoveCursorToEndPos()}else{if(this.SetThisElementCurrent)this.SetThisElementCurrent();this.MoveCursorToStartPos()}}else if(nPosInParent>=oParent.GetElementsCount()-1){if(this.SetThisElementCurrent)this.SetThisElementCurrent();this.MoveCursorToEndPos()}else{var oElement=oParent.GetElement(nPosInParent+1);if(oElement.IsCursorPlaceable()){if(oElement.SetThisElementCurrent)oElement.SetThisElementCurrent(); oElement.MoveCursorToStartPos()}else{if(this.SetThisElementCurrent)this.SetThisElementCurrent();this.MoveCursorToEndPos()}}};CParagraphContentBase.prototype.Set_SelectionContentPos=function(StartContentPos,EndContentPos,Depth,StartFlag,EndFlag){};CParagraphContentBase.prototype.RemoveSelection=function(){};CParagraphContentBase.prototype.SelectAll=function(Direction){};CParagraphContentBase.prototype.Selection_DrawRange=function(_CurLine,_CurRange,SelectionDraw){};CParagraphContentBase.prototype.IsSelectionEmpty= function(CheckEnd){return true};CParagraphContentBase.prototype.Selection_CheckParaEnd=function(){return false};CParagraphContentBase.prototype.IsSelectedAll=function(Props){return true};CParagraphContentBase.prototype.IsSelectedFromStart=function(){return true};CParagraphContentBase.prototype.IsSelectedToEnd=function(){return true};CParagraphContentBase.prototype.SkipAnchorsAtSelectionStart=function(nDirection){return true};CParagraphContentBase.prototype.Selection_CheckParaContentPos=function(ContentPos){return true}; CParagraphContentBase.prototype.GetCurrentParaPos=function(){return new CParaPos(this.StartRange,this.StartLine,0,0)};CParagraphContentBase.prototype.Get_TextPr=function(ContentPos,Depth){return new CTextPr};CParagraphContentBase.prototype.Get_FirstTextPr=function(bByPos){return new CTextPr};CParagraphContentBase.prototype.SetReviewType=function(ReviewType,RemovePrChange){};CParagraphContentBase.prototype.SetReviewTypeWithInfo=function(ReviewType,ReviewInfo){};CParagraphContentBase.prototype.CheckRevisionsChanges= function(Checker,ContentPos,Depth){};CParagraphContentBase.prototype.AcceptRevisionChanges=function(Type,bAll){};CParagraphContentBase.prototype.RejectRevisionChanges=function(Type,bAll){};CParagraphContentBase.prototype.GetTextPr=function(ContentPos,Depth){return this.Get_TextPr(ContentPos,Depth)};CParagraphContentBase.prototype.ApplyTextPr=function(oTextPr,isIncFontSize,isApplyToAll){return this.Apply_TextPr(oTextPr,isIncFontSize,isApplyToAll)};CParagraphContentBase.prototype.Search=function(oParaSearch){}; CParagraphContentBase.prototype.AddSearchResult=function(oSearchResult,isStart,oContentPos,nDepth){};CParagraphContentBase.prototype.ClearSearchResults=function(){};CParagraphContentBase.prototype.RemoveSearchResult=function(oSearchResult){};CParagraphContentBase.prototype.GetSearchElementId=function(bNext,bUseContentPos,ContentPos,Depth){return null};CParagraphContentBase.prototype.Check_NearestPos=function(ParaNearPos,Depth){};CParagraphContentBase.prototype.Restart_CheckSpelling=function(){};CParagraphContentBase.prototype.GetDirectTextPr= function(){return null};CParagraphContentBase.prototype.GetAllFields=function(isUseSelection,arrFields){return arrFields?arrFields:[]};CParagraphContentBase.prototype.GetAllSeqFieldsByType=function(sType,aFields){};CParagraphContentBase.prototype.CanAddComment=function(){return true};CParagraphContentBase.prototype.GetDocumentPositionFromObject=function(arrPos){if(!arrPos)arrPos=[];var oParagraph=this.GetParagraph();if(oParagraph)if(arrPos.length>0){var oParaContentPos=oParagraph.Get_PosByElement(this); if(oParaContentPos){var nDepth=oParaContentPos.GetDepth();while(nDepth>0){var Pos=oParaContentPos.Get(nDepth);oParaContentPos.SetDepth(nDepth-1);var Class=oParagraph.Get_ElementByPos(oParaContentPos);nDepth--;arrPos.splice(0,0,{Class:Class,Position:Pos})}arrPos.splice(0,0,{Class:this.Paragraph,Position:oParaContentPos.Get(0)})}this.Paragraph.GetDocumentPositionFromObject(arrPos)}else{this.Paragraph.GetDocumentPositionFromObject(arrPos);var oParaContentPos=this.Paragraph.Get_PosByElement(this);if(oParaContentPos){arrPos.push({Class:this.Paragraph, Position:oParaContentPos.Get(0)});var nDepth=oParaContentPos.GetDepth();var nCurDepth=1;while(nCurDepth<=nDepth){var Pos=oParaContentPos.Get(nCurDepth);oParaContentPos.SetDepth(nCurDepth-1);var Class=this.Paragraph.Get_ElementByPos(oParaContentPos);++nCurDepth;arrPos.push({Class:Class,Position:Pos})}}}return arrPos};CParagraphContentBase.prototype.GetParentContentControls=function(){var oDocPos=this.GetDocumentPositionFromObject();oDocPos.push({Class:this,Pos:0});var arrContentControls=[];for(var nIndex= 0,nCount=oDocPos.length;nIndex<nCount;++nIndex)if(oDocPos[nIndex].Class instanceof CInlineLevelSdt)arrContentControls.push(oDocPos[nIndex].Class);else if(oDocPos[nIndex].Class instanceof CDocumentContent&&oDocPos[nIndex].Class.Parent instanceof CBlockLevelSdt)arrContentControls.push(oDocPos[nIndex].Class.Parent);return arrContentControls};CParagraphContentBase.prototype.IsSelectionUse=function(){return false};CParagraphContentBase.prototype.IsStartFromNewLine=function(){return false};CParagraphContentBase.prototype.CheckRunContent= function(fCheck){return false};CParagraphContentBase.prototype.ProcessComplexFields=function(oComplexFields){};CParagraphContentBase.prototype.GetSelectedElementsInfo=function(oInfo,oContentPos,nDepth){};CParagraphContentBase.prototype.IsSolid=function(){return true};CParagraphContentBase.prototype.CorrectContentPos=function(){};CParagraphContentBase.prototype.GetFirstRun=function(){return null};CParagraphContentBase.prototype.MakeSingleRunElement=function(){return null};CParagraphContentBase.prototype.ClearContent= function(){};CParagraphContentBase.prototype.GetFirstRunElementPos=function(nType,oStartPos,oEndPos,nDepth){return false};CParagraphContentBase.prototype.SetThisElementCurrentInParagraph=function(){var oParagraph=this.GetParagraph();if(!this.IsCursorPlaceable()||!oParagraph)return;var oContentPos=this.Paragraph.Get_PosByElement(this);if(!oContentPos)return;this.Paragraph.Set_ParaContentPos(oContentPos,true,-1,-1,false)};function CParagraphContentWithContentBase(){CParagraphContentBase.call(this); this.Lines=[0];this.StartLine=-1;this.StartRange=-1}CParagraphContentWithContentBase.prototype=Object.create(CParagraphContentBase.prototype);CParagraphContentWithContentBase.prototype.constructor=CParagraphContentWithContentBase;CParagraphContentWithContentBase.prototype.Recalculate_Reset=function(StartRange,StartLine){this.StartLine=StartLine;this.StartRange=StartRange;this.protected_ClearLines()};CParagraphContentWithContentBase.prototype.protected_ClearLines=function(){this.Lines=[0]};CParagraphContentWithContentBase.prototype.protected_GetRangeOffset= function(LineIndex,RangeIndex){return 1+this.Lines[0]+this.Lines[1+LineIndex]+RangeIndex*2};CParagraphContentWithContentBase.prototype.protected_GetRangeStartPos=function(LineIndex,RangeIndex){return this.Lines[this.protected_GetRangeOffset(LineIndex,RangeIndex)]};CParagraphContentWithContentBase.prototype.protected_GetRangeEndPos=function(LineIndex,RangeIndex){return this.Lines[this.protected_GetRangeOffset(LineIndex,RangeIndex)+1]};CParagraphContentWithContentBase.prototype.protected_GetLinesCount= function(){return this.Lines[0]};CParagraphContentWithContentBase.prototype.protected_GetRangesCount=function(LineIndex){if(LineIndex===this.Lines[0]-1)return(this.Lines.length-this.Lines[1+LineIndex]-(this.Lines[0]+1))/2;else return(this.Lines[1+LineIndex+1]-this.Lines[1+LineIndex])/2};CParagraphContentWithContentBase.prototype.protected_AddRange=function(LineIndex,RangeIndex){if(this.Lines[0]>=LineIndex+1){var RangeOffset=this.protected_GetRangeOffset(LineIndex,0)+RangeIndex*2;this.Lines.splice(RangeOffset, this.Lines.length-RangeOffset);if(this.Lines[0]!==LineIndex+1&&0===RangeIndex)this.Lines.splice(LineIndex+1,this.Lines[0]-LineIndex);else if(this.Lines[0]!==LineIndex+1&&0!==RangeIndex){this.Lines.splice(LineIndex+2,this.Lines[0]-LineIndex-1);this.Lines[0]=LineIndex+1}}if(0===RangeIndex)if(this.Lines[0]!==LineIndex+1){var OffsetValue=this.Lines.length-LineIndex-1;this.Lines.splice(LineIndex+1,0,OffsetValue);this.Lines[0]=LineIndex+1}var RangeOffset=1+this.Lines[0]+this.Lines[LineIndex+1]+RangeIndex* 2;this.Lines[RangeOffset+0]=0;this.Lines[RangeOffset+1]=0;if(0!==LineIndex||0!==RangeIndex)return this.Lines[RangeOffset-1];else return 0};CParagraphContentWithContentBase.prototype.protected_FillRange=function(LineIndex,RangeIndex,StartPos,EndPos){var RangeOffset=this.protected_GetRangeOffset(LineIndex,RangeIndex);this.Lines[RangeOffset+0]=StartPos;this.Lines[RangeOffset+1]=EndPos};CParagraphContentWithContentBase.prototype.protected_FillRangeEndPos=function(LineIndex,RangeIndex,EndPos){var RangeOffset= this.protected_GetRangeOffset(LineIndex,RangeIndex);this.Lines[RangeOffset+1]=EndPos};CParagraphContentWithContentBase.prototype.private_UpdateSpellChecking=function(){if(this.Paragraph&&this.Paragraph.SpellChecker){this.Paragraph.SpellChecker.ClearPausedEngine();this.Paragraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All)}};CParagraphContentWithContentBase.prototype.Is_UseInDocument=function(Id){if(this.Paragraph){for(var i=0;i<this.Content.length;++i)if(this.Content[i].Get_Id&&this.Content[i].Get_Id()=== Id)break;if(i<this.Content.length)return this.Paragraph.Is_UseInDocument(this.Get_Id())}return false};CParagraphContentWithContentBase.prototype.IsUseInDocument=function(sId){return this.Is_UseInDocument(sId)};CParagraphContentWithContentBase.prototype.protected_GetPrevRangeEndPos=function(LineIndex,RangeIndex){var RangeCount=this.protected_GetRangesCount(LineIndex-1);var RangeOffset=this.protected_GetRangeOffset(LineIndex-1,RangeCount-1);return LineIndex==0&&RangeIndex==0?0:this.Lines[RangeOffset+ 1]};CParagraphContentWithContentBase.prototype.private_UpdateTrackRevisions=function(){if(this.Paragraph&&this.Paragraph.LogicDocument&&this.Paragraph.LogicDocument.GetTrackRevisionsManager){var RevisionsManager=this.Paragraph.LogicDocument.GetTrackRevisionsManager();RevisionsManager.CheckElement(this.Paragraph)}};CParagraphContentWithContentBase.prototype.CanSplit=function(){return true};CParagraphContentWithContentBase.prototype.PreDelete=function(){};CParagraphContentWithContentBase.prototype.private_UpdateDocumentOutline= function(){if(this.Paragraph&&this.Paragraph.UpdateDocumentOutline)this.Paragraph.UpdateDocumentOutline()};CParagraphContentWithContentBase.prototype.IsSolid=function(){return false};CParagraphContentWithContentBase.prototype.ConvertParaContentPosToRangePos=function(oContentPos,nDepth){return 0};CParagraphContentWithContentBase.prototype.ProcessNotInlineObjectCheck=function(oChecker){oChecker.Result=false;oChecker.Found=true};function CParagraphContentWithParagraphLikeContent(){CParagraphContentWithContentBase.call(this); this.Type=undefined;this.Paragraph=null;this.m_oContentChanges=new AscCommon.CContentChanges;this.Content=[];this.State=new CParaRunState;this.Selection=this.State.Selection;this.NearPosArray=[];this.SearchMarks=[]}CParagraphContentWithParagraphLikeContent.prototype=Object.create(CParagraphContentWithContentBase.prototype);CParagraphContentWithParagraphLikeContent.prototype.constructor=CParagraphContentWithParagraphLikeContent;CParagraphContentWithParagraphLikeContent.prototype.Get_Type=function(){return this.Type}; CParagraphContentWithParagraphLikeContent.prototype.Copy=function(Selected,oPr){var NewElement=new this.constructor;var StartPos=0;var EndPos=this.Content.length-1;if(true===Selected&&true===this.State.Selection.Use){StartPos=this.State.Selection.StartPos;EndPos=this.State.Selection.EndPos;if(StartPos>EndPos){StartPos=this.State.Selection.EndPos;EndPos=this.State.Selection.StartPos}}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Item=this.Content[CurPos];if(StartPos===CurPos||EndPos===CurPos)NewElement.Add_ToContent(CurPos- StartPos,Item.Copy(Selected,oPr));else NewElement.Add_ToContent(CurPos-StartPos,Item.Copy(false,oPr))}return NewElement};CParagraphContentWithParagraphLikeContent.prototype.GetSelectedContent=function(oSelectedContent){var oNewElement=new this.constructor;var nStartPos=this.State.Selection.StartPos;var nEndPos=this.State.Selection.EndPos;if(nStartPos>nEndPos){nStartPos=this.State.Selection.EndPos;nEndPos=this.State.Selection.StartPos}var nItemPos=0;for(var nPos=nStartPos,nItemPos=0;nPos<=nEndPos;++nPos){var oNewItem= this.Content[nPos].GetSelectedContent(oSelectedContent);if(oNewItem){oNewElement.AddToContent(nItemPos,oNewItem);nItemPos++}}if(0===nItemPos)return null;return oNewElement};CParagraphContentWithParagraphLikeContent.prototype.CopyContent=function(Selected){var CopyContent=[];var StartPos=0;var EndPos=this.Content.length-1;if(true===Selected&&true===this.State.Selection.Use){StartPos=this.State.Selection.StartPos;EndPos=this.State.Selection.EndPos;if(StartPos>EndPos){StartPos=this.State.Selection.EndPos; EndPos=this.State.Selection.StartPos}}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Item=this.Content[CurPos];if((StartPos===CurPos||EndPos===CurPos)&&true!==Item.IsSelectedAll()){var Content=Item.CopyContent(Selected);for(var ContentPos=0,ContentLen=Content.length;ContentPos<ContentLen;ContentPos++)CopyContent.push(Content[ContentPos])}else CopyContent.push(Item.Copy(false,{CopyReviewPr:true}))}return CopyContent};CParagraphContentWithParagraphLikeContent.prototype.Clear_ContentChanges=function(){this.m_oContentChanges.Clear()}; CParagraphContentWithParagraphLikeContent.prototype.Add_ContentChanges=function(Changes){this.m_oContentChanges.Add(Changes)};CParagraphContentWithParagraphLikeContent.prototype.Refresh_ContentChanges=function(){this.m_oContentChanges.Refresh()};CParagraphContentWithParagraphLikeContent.prototype.Recalc_RunsCompiledPr=function(){var Count=this.Content.length;for(var Pos=0;Pos<Count;Pos++){var Item=this.Content[Pos];if(Item.Recalc_RunsCompiledPr)Item.Recalc_RunsCompiledPr()}};CParagraphContentWithParagraphLikeContent.prototype.GetAllDrawingObjects= function(arrDrawingObjects){if(!arrDrawingObjects)arrDrawingObjects=[];for(var nPos=0,nCount=this.Content.length;nPos<nCount;++nPos){var oItem=this.Content[nPos];if(oItem.GetAllDrawingObjects)oItem.GetAllDrawingObjects(arrDrawingObjects)}return arrDrawingObjects};CParagraphContentWithParagraphLikeContent.prototype.SetParagraph=function(Paragraph){this.Paragraph=Paragraph;var ContentLen=this.Content.length;for(var CurPos=0;CurPos<ContentLen;CurPos++)this.Content[CurPos].SetParagraph(Paragraph)};CParagraphContentWithParagraphLikeContent.prototype.Is_Empty= function(oPr){for(var Index=0,ContentLen=this.Content.length;Index<ContentLen;Index++)if(false===this.Content[Index].Is_Empty(oPr))return false;return true};CParagraphContentWithParagraphLikeContent.prototype.Is_CheckingNearestPos=function(){return this.NearPosArray.length>0};CParagraphContentWithParagraphLikeContent.prototype.IsStartFromNewLine=function(){if(this.Content.length<0)return false;return this.Content[0].IsStartFromNewLine()};CParagraphContentWithParagraphLikeContent.prototype.GetSelectedElementsInfo= function(oInfo,oContentPos,nDepth){if(oContentPos){var nPos=oContentPos.Get(nDepth);if(this.Content[nPos].GetSelectedElementsInfo)this.Content[nPos].GetSelectedElementsInfo(oInfo,oContentPos,nDepth+1)}else if(true===this.Selection.Use&&(oInfo.IsCheckAllSelection()||this.Selection.StartPos===this.Selection.EndPos)){var nStartPos=this.Selection.StartPos<this.Selection.EndPos?this.Selection.StartPos:this.Selection.EndPos;var nEndPos=this.Selection.StartPos<this.Selection.EndPos?this.Selection.EndPos: this.Selection.StartPos;for(var nPos=nStartPos;nPos<=nEndPos;++nPos)this.Content[nPos].GetSelectedElementsInfo(oInfo)}else if(false===this.Selection.Use)this.Content[this.State.ContentPos].GetSelectedElementsInfo(oInfo)};CParagraphContentWithParagraphLikeContent.prototype.GetSelectedText=function(bAll,bClearText,oPr){var Str="";for(var Pos=0,Count=this.Content.length;Pos<Count;Pos++){var _Str=this.Content[Pos].GetSelectedText(bAll,bClearText,oPr);if(null===_Str)return null;Str+=_Str}return Str};CParagraphContentWithParagraphLikeContent.prototype.GetSelectDirection= function(){if(true!==this.Selection.Use)return 0;if(this.Selection.StartPos<this.Selection.EndPos)return 1;else if(this.Selection.StartPos>this.Selection.EndPos)return-1;return this.Content[this.Selection.StartPos].GetSelectDirection()};CParagraphContentWithParagraphLikeContent.prototype.Get_TextPr=function(_ContentPos,Depth){if(undefined===_ContentPos)return this.Content[0].Get_TextPr();else return this.Content[_ContentPos.Get(Depth)].Get_TextPr(_ContentPos,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.Get_FirstTextPr= function(bByPos){var oElement=null;if(this.Content.length>0)if(true===bByPos)if(true===this.Selection.Use)if(this.Selection.StartPos>this.Selection.EndPos)oElement=this.Content[this.Selection.EndPos];else oElement=this.Content[this.Selection.StartPos];else oElement=this.Content[this.State.ContentPos];else for(var nPos=0,nCount=this.Content.length;nPos<nCount;++nPos)if(this.Content[nPos].IsCursorPlaceable()){oElement=this.Content[nPos];break}if(null!==oElement&&undefined!==oElement)if(para_Run===oElement.Type)return oElement.Get_TextPr(); else return oElement.Get_FirstTextPr();return new CTextPr};CParagraphContentWithParagraphLikeContent.prototype.Get_CompiledTextPr=function(Copy){var TextPr=null;if(true===this.State.Selection){var StartPos=this.State.Selection.StartPos;var EndPos=this.State.Selection.EndPos;if(StartPos>EndPos){StartPos=this.State.Selection.EndPos;EndPos=this.State.Selection.StartPos}TextPr=this.Content[StartPos].Get_CompiledTextPr(Copy);while(null===TextPr&&StartPos<EndPos){StartPos++;TextPr=this.Content[StartPos].Get_CompiledTextPr(Copy)}for(var CurPos= StartPos+1;CurPos<=EndPos;CurPos++){var CurTextPr=this.Content[CurPos].Get_CompiledPr(false);if(null!==CurTextPr)TextPr=TextPr.Compare(CurTextPr)}}else{var CurPos=this.State.ContentPos;if(CurPos>=0&&CurPos<this.Content.length)TextPr=this.Content[CurPos].Get_CompiledTextPr(Copy)}return TextPr};CParagraphContentWithParagraphLikeContent.prototype.Check_Content=function(){if(this.Content.length<=0)this.Add_ToContent(0,new ParaRun,false)};CParagraphContentWithParagraphLikeContent.prototype.Add_ToContent= function(Pos,Item,UpdatePosition){this.Content.splice(Pos,0,Item);this.private_UpdateTrackRevisions();this.private_UpdateDocumentOutline();this.private_CheckUpdateBookmarks([Item]);if(false!==UpdatePosition){if(this.State.ContentPos>=Pos)this.State.ContentPos++;if(this.State.Selection.StartPos>=Pos)this.State.Selection.StartPos++;if(this.State.Selection.EndPos>=Pos)this.State.Selection.EndPos++;this.State.Selection.StartPos=Math.max(0,Math.min(this.Content.length-1,this.State.Selection.StartPos)); this.State.Selection.EndPos=Math.max(0,Math.min(this.Content.length-1,this.State.Selection.EndPos));this.State.ContentPos=Math.max(0,Math.min(this.Content.length-1,this.State.ContentPos));var LinesCount=this.protected_GetLinesCount();for(var CurLine=0;CurLine<LinesCount;CurLine++){var RangesCount=this.protected_GetRangesCount(CurLine);for(var CurRange=0;CurRange<RangesCount;CurRange++){var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine, CurRange);if(StartPos>Pos)StartPos++;if(EndPos>Pos)EndPos++;this.protected_FillRange(CurLine,CurRange,StartPos,EndPos)}if(Pos===this.Content.length-1&&LinesCount-1===CurLine)this.protected_FillRangeEndPos(CurLine,RangesCount-1,this.protected_GetRangeEndPos(CurLine,RangesCount-1)+1)}}var NearPosLen=this.NearPosArray.length;for(var Index=0;Index<NearPosLen;Index++){var HyperNearPos=this.NearPosArray[Index];var ContentPos=HyperNearPos.NearPos.ContentPos;var Depth=HyperNearPos.Depth;if(ContentPos.Data[Depth]>= Pos)ContentPos.Data[Depth]++}var SearchMarksCount=this.SearchMarks.length;for(var Index=0;Index<SearchMarksCount;Index++){var Mark=this.SearchMarks[Index];var ContentPos=true===Mark.Start?Mark.SearchResult.StartPos:Mark.SearchResult.EndPos;var Depth=Mark.Depth;if(ContentPos.Data[Depth]>=Pos)ContentPos.Data[Depth]++}if(Item.SetParent)Item.SetParent(this);if(Item.SetParagraph)Item.SetParagraph(this.GetParagraph())};CParagraphContentWithParagraphLikeContent.prototype.Remove_FromContent=function(Pos, Count,UpdatePosition){for(var nIndex=Pos;nIndex<Pos+Count;++nIndex)this.Content[nIndex].PreDelete();var DeletedItems=this.Content.slice(Pos,Pos+Count);this.Content.splice(Pos,Count);this.private_UpdateTrackRevisions();this.private_UpdateDocumentOutline();this.private_CheckUpdateBookmarks(DeletedItems);if(false!==UpdatePosition){if(this.State.ContentPos>Pos+Count)this.State.ContentPos-=Count;else if(this.State.ContentPos>Pos)this.State.ContentPos=Pos;if(this.State.Selection.StartPos<=this.State.Selection.EndPos){if(this.State.Selection.StartPos> Pos+Count)this.State.Selection.StartPos-=Count;else if(this.State.Selection.StartPos>Pos)this.State.Selection.StartPos=Pos;if(this.State.Selection.EndPos>=Pos+Count)this.State.Selection.EndPos-=Count;else if(this.State.Selection.EndPos>=Pos)this.State.Selection.EndPos=Math.max(0,Pos-1)}else{if(this.State.Selection.StartPos>=Pos+Count)this.State.Selection.StartPos-=Count;else if(this.State.Selection.StartPos>=Pos)this.State.Selection.StartPos=Math.max(0,Pos-1);if(this.State.Selection.EndPos>Pos+Count)this.State.Selection.EndPos-= Count;else if(this.State.Selection.EndPos>Pos)this.State.Selection.EndPos=Pos}this.Selection.StartPos=Math.max(0,Math.min(this.Content.length-1,this.Selection.StartPos));this.Selection.EndPos=Math.max(0,Math.min(this.Content.length-1,this.Selection.EndPos));this.State.ContentPos=Math.max(0,Math.min(this.Content.length-1,this.State.ContentPos));var LinesCount=this.protected_GetLinesCount();for(var CurLine=0;CurLine<LinesCount;CurLine++){var RangesCount=this.protected_GetRangesCount(CurLine);for(var CurRange= 0;CurRange<RangesCount;CurRange++){var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);if(StartPos>Pos+Count)StartPos-=Count;else if(StartPos>Pos)StartPos=Math.max(0,Pos);if(EndPos>=Pos+Count)EndPos-=Count;else if(EndPos>=Pos)EndPos=Math.max(0,Pos);this.protected_FillRange(CurLine,CurRange,StartPos,EndPos)}}}var NearPosLen=this.NearPosArray.length;for(var Index=0;Index<NearPosLen;Index++){var HyperNearPos=this.NearPosArray[Index]; var ContentPos=HyperNearPos.NearPos.ContentPos;var Depth=HyperNearPos.Depth;if(ContentPos.Data[Depth]>Pos+Count)ContentPos.Data[Depth]-=Count;else if(ContentPos.Data[Depth]>Pos)ContentPos.Data[Depth]=Math.max(0,Pos)}var SearchMarksCount=this.SearchMarks.length;for(var Index=0;Index<SearchMarksCount;Index++){var Mark=this.SearchMarks[Index];var ContentPos=true===Mark.Start?Mark.SearchResult.StartPos:Mark.SearchResult.EndPos;var Depth=Mark.Depth;if(ContentPos.Data[Depth]>Pos+Count)ContentPos.Data[Depth]-= Count;else if(ContentPos.Data[Depth]>Pos)ContentPos.Data[Depth]=Math.max(0,Pos)}};CParagraphContentWithParagraphLikeContent.prototype.Remove=function(Direction,bOnAddText){var Selection=this.State.Selection;if(true===Selection.Use){var StartPos=Selection.StartPos;var EndPos=Selection.EndPos;if(StartPos>EndPos){StartPos=Selection.EndPos;EndPos=Selection.StartPos}var oTextPr=this.IsSelectedAll()?this.GetDirectTextPr():null;if(StartPos===EndPos)if(this.Content[StartPos].IsSolid())this.RemoveFromContent(StartPos, 1,true);else{this.Content[StartPos].Remove(Direction,bOnAddText);if(StartPos!==this.Content.length-1&&true===this.Content[StartPos].Is_Empty()&&true!==bOnAddText)this.Remove_FromContent(StartPos,1,true)}else{if(this.Content[EndPos].IsSolid())this.RemoveFromContent(EndPos,1,true);else{this.Content[EndPos].Remove(Direction,bOnAddText);if(EndPos!==this.Content.length-1&&true===this.Content[EndPos].Is_Empty()&&true!==bOnAddText)this.Remove_FromContent(EndPos,1,true)}if(this.Paragraph&&this.Paragraph.LogicDocument&& true===this.Paragraph.LogicDocument.IsTrackRevisions())for(var nCurPos=EndPos-1;nCurPos>StartPos;--nCurPos)if(para_Run===this.Content[nCurPos].Type)if(para_Run==this.Content[nCurPos].Type&&this.Content[nCurPos].CanDeleteInReviewMode())this.RemoveFromContent(nCurPos,1);else this.Content[nCurPos].SetReviewType(reviewtype_Remove,true);else{this.Content[nCurPos].Remove(Direction,bOnAddText);if(this.Content[nCurPos].IsEmpty())this.RemoveFromContent(nCurPos,1)}else for(var CurPos=EndPos-1;CurPos>StartPos;CurPos--)this.Remove_FromContent(CurPos, 1,true);if(this.Content[StartPos].IsSolid())this.RemoveFromContent(StartPos,1,true);else{this.Content[StartPos].Remove(Direction,bOnAddText);if(true===this.Content[StartPos].Is_Empty())this.Remove_FromContent(StartPos,1,true)}}this.RemoveSelection();if(this.Content.length<=0){this.AddToContent(0,new ParaRun(this.GetParagraph(),false));this.State.ContentPos=0;if(oTextPr)this.Content[0].SetPr(oTextPr)}else this.State.ContentPos=StartPos}else{var ContentPos=this.State.ContentPos;if((true===this.Cursor_Is_Start()|| true===this.Cursor_Is_End())&&(!(this instanceof CInlineLevelSdt)||!(this.IsTextForm()||this.IsComboBox()))){this.SelectAll();this.SelectThisElement(1)}else{while(false===this.Content[ContentPos].Remove(Direction,bOnAddText)){if(Direction<0)ContentPos--;else ContentPos++;if(ContentPos<0||ContentPos>=this.Content.length)break;if(Direction<0)this.Content[ContentPos].MoveCursorToEndPos(false);else this.Content[ContentPos].MoveCursorToStartPos()}if(ContentPos<0||ContentPos>=this.Content.length)return false; else{if(ContentPos!==this.Content.length-1&&true===this.Content[ContentPos].Is_Empty()&&true!==bOnAddText)this.Remove_FromContent(ContentPos,1,true);this.State.ContentPos=ContentPos}}}return true};CParagraphContentWithParagraphLikeContent.prototype.GetCurrentParaPos=function(){var CurPos=this.State.ContentPos;if(CurPos>=0&&CurPos<this.Content.length)return this.Content[CurPos].GetCurrentParaPos();return new CParaPos(this.StartRange,this.StartLine,0,0)};CParagraphContentWithParagraphLikeContent.prototype.Apply_TextPr= function(TextPr,IncFontSize,ApplyToAll){if(true===ApplyToAll){var ContentLen=this.Content.length;for(var CurPos=0;CurPos<ContentLen;CurPos++)this.Content[CurPos].Apply_TextPr(TextPr,IncFontSize,true)}else{var Selection=this.State.Selection;if(true===Selection.Use){var StartPos=Selection.StartPos;var EndPos=Selection.EndPos;if(StartPos===EndPos){var NewElements=this.Content[EndPos].Apply_TextPr(TextPr,IncFontSize,false);if(para_Run===this.Content[EndPos].Type){var CenterRunPos=this.private_ReplaceRun(EndPos, NewElements);if(StartPos===this.State.ContentPos)this.State.ContentPos=CenterRunPos;Selection.StartPos=CenterRunPos;Selection.EndPos=CenterRunPos}}else{var Direction=1;if(StartPos>EndPos){var Temp=StartPos;StartPos=EndPos;EndPos=Temp;Direction=-1}for(var CurPos=StartPos+1;CurPos<EndPos;CurPos++)this.Content[CurPos].Apply_TextPr(TextPr,IncFontSize,false);var NewElements=this.Content[EndPos].Apply_TextPr(TextPr,IncFontSize,false);if(para_Run===this.Content[EndPos].Type)this.private_ReplaceRun(EndPos, NewElements);var NewElements=this.Content[StartPos].Apply_TextPr(TextPr,IncFontSize,false);if(para_Run===this.Content[StartPos].Type)this.private_ReplaceRun(StartPos,NewElements);if(Selection.StartPos<Selection.EndPos&&true===this.Content[Selection.StartPos].IsSelectionEmpty())Selection.StartPos++;else if(Selection.EndPos<Selection.StartPos&&true===this.Content[Selection.EndPos].IsSelectionEmpty())Selection.EndPos++;if(Selection.StartPos<Selection.EndPos&&true===this.Content[Selection.EndPos].IsSelectionEmpty())Selection.EndPos--; else if(Selection.EndPos<Selection.StartPos&&true===this.Content[Selection.StartPos].IsSelectionEmpty())Selection.StartPos--}}else{var Pos=this.State.ContentPos;var Element=this.Content[Pos];var NewElements=Element.Apply_TextPr(TextPr,IncFontSize,false);if(para_Run===Element.Type){var CenterRunPos=this.private_ReplaceRun(Pos,NewElements);this.State.ContentPos=CenterRunPos}}}};CParagraphContentWithParagraphLikeContent.prototype.private_ReplaceRun=function(Pos,NewRuns){var LRun=NewRuns[0];var CRun= NewRuns[1];var RRun=NewRuns[2];var CenterRunPos=Pos;if(null!==LRun){this.Add_ToContent(Pos+1,CRun,true);CenterRunPos=Pos+1}else;if(null!==RRun)this.Add_ToContent(CenterRunPos+1,RRun,true);return CenterRunPos};CParagraphContentWithParagraphLikeContent.prototype.Clear_TextPr=function(){var Count=this.Content.length;for(var Index=0;Index<Count;Index++){var Item=this.Content[Index];Item.Clear_TextPr()}};CParagraphContentWithParagraphLikeContent.prototype.Check_NearestPos=function(ParaNearPos,Depth){var HyperNearPos= new CParagraphElementNearPos;HyperNearPos.NearPos=ParaNearPos.NearPos;HyperNearPos.Depth=Depth;this.NearPosArray.push(HyperNearPos);ParaNearPos.Classes.push(this);var CurPos=ParaNearPos.NearPos.ContentPos.Get(Depth);this.Content[CurPos].Check_NearestPos(ParaNearPos,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.Get_DrawingObjectRun=function(Id){var Run=null;var ContentLen=this.Content.length;for(var CurPos=0;CurPos<ContentLen;CurPos++){var Element=this.Content[CurPos];Run=Element.Get_DrawingObjectRun(Id); if(null!==Run)return Run}return Run};CParagraphContentWithParagraphLikeContent.prototype.Get_DrawingObjectContentPos=function(Id,ContentPos,Depth){for(var Index=0,ContentLen=this.Content.length;Index<ContentLen;Index++){var Element=this.Content[Index];if(true===Element.Get_DrawingObjectContentPos(Id,ContentPos,Depth+1)){ContentPos.Update2(Index,Depth);return true}}return false};CParagraphContentWithParagraphLikeContent.prototype.GetRunByElement=function(oRunElement){for(var nPos=0,nCount=this.Content.length;nPos< nCount;++nPos){var oResult=this.Content[nPos].GetRunByElement(oRunElement);if(oResult)return oResult}return null};CParagraphContentWithParagraphLikeContent.prototype.Get_Layout=function(DrawingLayout,UseContentPos,ContentPos,Depth){var CurLine=DrawingLayout.Line-this.StartLine;var CurRange=0===CurLine?DrawingLayout.Range-this.StartRange:DrawingLayout.Range;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);var CurContentPos=true=== UseContentPos?ContentPos.Get(Depth):-1;for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){this.Content[CurPos].Get_Layout(DrawingLayout,CurPos===CurContentPos?true:false,ContentPos,Depth+1);if(true===DrawingLayout.Layout)return}};CParagraphContentWithParagraphLikeContent.prototype.GetNextRunElements=function(oRunElements,isUseContentPos,nDepth){if(oRunElements.IsEnoughElements())return;var nCurPos=true===isUseContentPos?oRunElements.ContentPos.Get(nDepth):0;var nContentLen=this.Content.length;oRunElements.UpdatePos(nCurPos, nDepth);this.Content[nCurPos].GetNextRunElements(oRunElements,isUseContentPos,nDepth+1);nCurPos++;while(nCurPos<nContentLen){if(oRunElements.IsEnoughElements())return;oRunElements.UpdatePos(nCurPos,nDepth);this.Content[nCurPos].GetNextRunElements(oRunElements,false,nDepth+1);nCurPos++}};CParagraphContentWithParagraphLikeContent.prototype.GetPrevRunElements=function(oRunElements,isUseContentPos,nDepth){if(oRunElements.IsEnoughElements())return;var nCurPos=true===isUseContentPos?oRunElements.ContentPos.Get(nDepth): this.Content.length-1;oRunElements.UpdatePos(nCurPos,nDepth);this.Content[nCurPos].GetPrevRunElements(oRunElements,isUseContentPos,nDepth+1);nCurPos--;while(nCurPos>=0){if(oRunElements.IsEnoughElements())return;oRunElements.UpdatePos(nCurPos,nDepth);this.Content[nCurPos].GetPrevRunElements(oRunElements,false,nDepth+1);nCurPos--}};CParagraphContentWithParagraphLikeContent.prototype.CollectDocumentStatistics=function(ParaStats){var Count=this.Content.length;for(var Index=0;Index<Count;Index++)this.Content[Index].CollectDocumentStatistics(ParaStats)}; CParagraphContentWithParagraphLikeContent.prototype.Create_FontMap=function(Map){var Count=this.Content.length;for(var Index=0;Index<Count;Index++)this.Content[Index].Create_FontMap(Map)};CParagraphContentWithParagraphLikeContent.prototype.Get_AllFontNames=function(AllFonts){var Count=this.Content.length;for(var Index=0;Index<Count;Index++)this.Content[Index].Get_AllFontNames(AllFonts)};CParagraphContentWithParagraphLikeContent.prototype.Clear_TextFormatting=function(){for(var Pos=0,Count=this.Content.length;Pos< Count;Pos++){var Item=this.Content[Pos];Item.Clear_TextFormatting()}};CParagraphContentWithParagraphLikeContent.prototype.CanAddDropCap=function(){for(var nPos=0,nCount=this.Content.length;nPos<nCount;++nPos){var bResult=this.Content[nPos].CanAddDropCap();if(null!==bResult)return bResult}return null};CParagraphContentWithParagraphLikeContent.prototype.CheckSelectionForDropCap=function(isUsePos,oEndPos,nDepth){var nEndPos=isUsePos?oEndPos.Get(nDepth):this.Content.length-1;for(var nPos=0;nPos<=nEndPos;++nPos)if(!this.Content[nPos].CheckSelectionForDropCap(nPos=== nEndPos&&isUsePos,oEndPos,nDepth+1))return false;return true};CParagraphContentWithParagraphLikeContent.prototype.Get_TextForDropCap=function(DropCapText,UseContentPos,ContentPos,Depth){var EndPos=true===UseContentPos?ContentPos.Get(Depth):this.Content.length-1;for(var Pos=0;Pos<=EndPos;Pos++){this.Content[Pos].Get_TextForDropCap(DropCapText,true===UseContentPos&&Pos===EndPos?true:false,ContentPos,Depth+1);if(true===DropCapText.Mixed&&(true===DropCapText.Check||DropCapText.Runs.length>0))return}}; CParagraphContentWithParagraphLikeContent.prototype.Get_StartTabsCount=function(TabsCounter){var ContentLen=this.Content.length;for(var Pos=0;Pos<ContentLen;Pos++){var Element=this.Content[Pos];if(false===Element.Get_StartTabsCount(TabsCounter))return false}return true};CParagraphContentWithParagraphLikeContent.prototype.Remove_StartTabs=function(TabsCounter){var ContentLen=this.Content.length;for(var Pos=0;Pos<ContentLen;Pos++){var Element=this.Content[Pos];if(false===Element.Remove_StartTabs(TabsCounter))return false}return true}; CParagraphContentWithParagraphLikeContent.prototype.Document_UpdateInterfaceState=function(){if(true===this.Selection.Use){var StartPos=this.Selection.StartPos;var EndPos=this.Selection.EndPos;if(StartPos>EndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Element=this.Content[CurPos];if(true!==Element.IsSelectionEmpty()&&Element.Document_UpdateInterfaceState)Element.Document_UpdateInterfaceState()}}else{var Element=this.Content[this.State.ContentPos]; if(Element.Document_UpdateInterfaceState)Element.Document_UpdateInterfaceState()}};CParagraphContentWithParagraphLikeContent.prototype.Split=function(ContentPos,Depth){var Element=new this.constructor;var CurPos=ContentPos.Get(Depth);var TextPr=this.Get_TextPr(ContentPos,Depth);var NewElement=this.Content[CurPos].Split(ContentPos,Depth+1);if(null===NewElement){NewElement=new ParaRun;NewElement.Set_Pr(TextPr.Copy())}var NewContent=this.Content.slice(CurPos+1);this.Remove_FromContent(CurPos+1,this.Content.length- CurPos-1,false);var Count=NewContent.length;for(var Pos=0;Pos<Count;Pos++)Element.Add_ToContent(Pos,NewContent[Pos],false);Element.Add_ToContent(0,NewElement,false);return Element};CParagraphContentWithParagraphLikeContent.prototype.Get_Text=function(Text){var ContentLen=this.Content.length;for(var CurPos=0;CurPos<ContentLen;CurPos++)this.Content[CurPos].Get_Text(Text)};CParagraphContentWithParagraphLikeContent.prototype.GetAllParagraphs=function(Props,ParaArray){var ContentLen=this.Content.length; for(var CurPos=0;CurPos<ContentLen;CurPos++)if(this.Content[CurPos].GetAllParagraphs)this.Content[CurPos].GetAllParagraphs(Props,ParaArray)};CParagraphContentWithParagraphLikeContent.prototype.GetAllTables=function(oProps,arrTables){if(!arrTables)arrTables=[];for(var nCurPos=0,nLen=this.Content.length;nCurPos<nLen;++nCurPos)if(this.Content[nCurPos].GetAllTables)this.Content[nCurPos].GetAllTables(oProps,arrTables);return arrTables};CParagraphContentWithParagraphLikeContent.prototype.Get_ClassesByPos= function(Classes,ContentPos,Depth){Classes.push(this);var CurPos=ContentPos.Get(Depth);if(0<=CurPos&&CurPos<=this.Content.length-1)this.Content[CurPos].Get_ClassesByPos(Classes,ContentPos,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.GetContentLength=function(){return this.Content.length};CParagraphContentWithParagraphLikeContent.prototype.Get_Parent=function(){if(!this.Paragraph)return null;var ContentPos=this.Paragraph.Get_PosByElement(this);if(null==ContentPos||undefined==ContentPos|| ContentPos.Get_Depth()<0)return null;ContentPos.Decrease_Depth(1);return this.Paragraph.Get_ElementByPos(ContentPos)};CParagraphContentWithParagraphLikeContent.prototype.Get_PosInParent=function(Parent){var _Parent=_Parent?Parent:this.Get_Parent();if(!_Parent)return-1;for(var Pos=0,Count=_Parent.Content.length;Pos<Count;++Pos)if(this===_Parent.Content[Pos])return Pos;return-1};CParagraphContentWithParagraphLikeContent.prototype.Correct_Content=function(){if(this.Content.length<0)this.Add_ToContent(0, new ParaRun(this.GetParagraph(),false))};CParagraphContentWithParagraphLikeContent.prototype.CorrectContent=function(){this.Correct_Content()};CParagraphContentWithParagraphLikeContent.prototype.UpdateBookmarks=function(oManager){for(var nIndex=0,nCount=this.Content.length;nIndex<nCount;++nIndex)this.Content[nIndex].UpdateBookmarks(oManager)};CParagraphContentWithParagraphLikeContent.prototype.RemoveTabsForTOC=function(_isTab){var isTab=_isTab;for(var nIndex=0,nCount=this.Content.length;nIndex<nCount;++nIndex)if(this.Content[nIndex].RemoveTabsForTOC(isTab))isTab= true;return isTab};CParagraphContentWithParagraphLikeContent.prototype.RemoveAll=function(){this.Remove_FromContent(0,this.Content.length)};CParagraphContentWithParagraphLikeContent.prototype.AddToContent=function(nPos,oItem,isUpdatePositions){return this.Add_ToContent(nPos,oItem,isUpdatePositions)};CParagraphContentWithParagraphLikeContent.prototype.RemoveFromContent=function(nPos,nCount,isUpdatePositions){return this.Remove_FromContent(nPos,nCount,isUpdatePositions)};CParagraphContentWithParagraphLikeContent.prototype.GetComplexField= function(nType){for(var nIndex=0,nCount=this.Content.length;nIndex<nCount;++nIndex){var oResult=this.Content[nIndex].GetComplexField(nType);if(oResult)return oResult}return null};CParagraphContentWithParagraphLikeContent.prototype.GetComplexFieldsArray=function(nType,arrComplexFields){for(var nIndex=0,nCount=this.Content.length;nIndex<nCount;++nIndex)this.Content[nIndex].GetComplexFieldsArray(nType,arrComplexFields)};CParagraphContentWithParagraphLikeContent.prototype.Recalculate_Range=function(PRS, ParaPr,Depth){if(this.Paragraph!==PRS.Paragraph){this.Paragraph=PRS.Paragraph;this.private_UpdateSpellChecking()}var CurLine=PRS.Line-this.StartLine;var CurRange=0===CurLine?PRS.Range-this.StartRange:PRS.Range;var RangeStartPos=this.protected_AddRange(CurLine,CurRange);var RangeEndPos=0;var ContentLen=this.Content.length;var Pos=RangeStartPos;for(;Pos<ContentLen;Pos++){var Item=this.Content[Pos];if(para_Math===Item.Type)Item.Set_Inline(!this.CheckMathPara(Pos));if(0===Pos&&0===CurLine&&0===CurRange|| Pos!==RangeStartPos)Item.Recalculate_Reset(PRS.Range,PRS.Line);PRS.Update_CurPos(Pos,Depth);Item.Recalculate_Range(PRS,ParaPr,Depth+1);if(true===PRS.NewRange){RangeEndPos=Pos;break}}if(Pos>=ContentLen)RangeEndPos=Pos-1;this.protected_FillRange(CurLine,CurRange,RangeStartPos,RangeEndPos)};CParagraphContentWithParagraphLikeContent.prototype.Recalculate_Set_RangeEndPos=function(PRS,PRP,Depth){var CurLine=PRS.Line-this.StartLine;var CurRange=0===CurLine?PRS.Range-this.StartRange:PRS.Range;var CurPos= PRP.Get(Depth);this.protected_FillRangeEndPos(CurLine,CurRange,CurPos);this.Content[CurPos].Recalculate_Set_RangeEndPos(PRS,PRP,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.Recalculate_LineMetrics=function(PRS,ParaPr,_CurLine,_CurRange){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<= EndPos;CurPos++)this.Content[CurPos].Recalculate_LineMetrics(PRS,ParaPr,_CurLine,_CurRange)};CParagraphContentWithParagraphLikeContent.prototype.Recalculate_Range_Width=function(PRSC,_CurLine,_CurRange){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)this.Content[CurPos].Recalculate_Range_Width(PRSC, _CurLine,_CurRange)};CParagraphContentWithParagraphLikeContent.prototype.Recalculate_Range_Spaces=function(PRSA,_CurLine,_CurRange,_CurPage){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)this.Content[CurPos].Recalculate_Range_Spaces(PRSA,_CurLine,_CurRange,_CurPage)};CParagraphContentWithParagraphLikeContent.prototype.Recalculate_PageEndInfo= function(PRSI,_CurLine,_CurRange){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)this.Content[CurPos].Recalculate_PageEndInfo(PRSI,_CurLine,_CurRange)};CParagraphContentWithParagraphLikeContent.prototype.RecalculateEndInfo=function(oPRSI){for(var nCurPos=0,nCount=this.Content.length;nCurPos< nCount;++nCurPos)this.Content[nCurPos].RecalculateEndInfo(oPRSI)};CParagraphContentWithParagraphLikeContent.prototype.SaveRecalculateObject=function(Copy){var RecalcObj=new CRunRecalculateObject(this.StartLine,this.StartRange);RecalcObj.Save_Lines(this,Copy);RecalcObj.Save_Content(this,Copy);return RecalcObj};CParagraphContentWithParagraphLikeContent.prototype.LoadRecalculateObject=function(RecalcObj){RecalcObj.Load_Lines(this);RecalcObj.Load_Content(this)};CParagraphContentWithParagraphLikeContent.prototype.PrepareRecalculateObject= function(){this.protected_ClearLines();var Count=this.Content.length;for(var Index=0;Index<Count;Index++)this.Content[Index].PrepareRecalculateObject()};CParagraphContentWithParagraphLikeContent.prototype.IsEmptyRange=function(_CurLine,_CurRange){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)if(false=== this.Content[CurPos].IsEmptyRange(_CurLine,_CurRange))return false;return true};CParagraphContentWithParagraphLikeContent.prototype.Check_Range_OnlyMath=function(Checker,_CurRange,_CurLine){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){this.Content[CurPos].Check_Range_OnlyMath(Checker, _CurRange,_CurLine);if(false===Checker.Result)break}};CParagraphContentWithParagraphLikeContent.prototype.CheckMathPara=function(nMathPos){if(!this.Content[nMathPos]||para_Math!==this.Content[nMathPos].Type)return false;return this.CheckNotInlineObject(nMathPos)};CParagraphContentWithParagraphLikeContent.prototype.CheckNotInlineObject=function(nMathPos,nDirection){var oParent=this.GetParent();var oChecker=new CParagraphMathParaChecker;if(undefined===nDirection||-1===nDirection){oChecker.SetDirection(-1); for(var nCurPos=nMathPos-1;nCurPos>=0;--nCurPos){this.Content[nCurPos].ProcessNotInlineObjectCheck(oChecker);if(oChecker.IsStop())break}if(!oChecker.GetResult())return false;if(!oChecker.IsStop()&&oParent&&!oParent.CheckNotInlineObject(this.GetPosInParent(oParent),-1))return false}if(undefined===nDirection||1===nDirection){oChecker.SetDirection(1);for(var nCurPos=nMathPos+1,nCount=this.Content.length;nCurPos<nCount;++nCurPos){this.Content[nCurPos].ProcessNotInlineObjectCheck(oChecker);if(oChecker.IsStop())break}if(!oChecker.GetResult())return false; if(!oChecker.IsStop()&&oParent&&!oParent.CheckNotInlineObject(this.GetPosInParent(oParent),1))return false}return true};CParagraphContentWithParagraphLikeContent.prototype.Check_PageBreak=function(){var Count=this.Content.length;for(var Pos=0;Pos<Count;Pos++)if(true===this.Content[Pos].Check_PageBreak())return true;return false};CParagraphContentWithParagraphLikeContent.prototype.CheckSplitPageOnPageBreak=function(oPBChecker){for(var nPos=0,nCount=this.Content.length;nPos<nCount;++nPos)if(this.Content[nPos].CheckSplitPageOnPageBreak(oPBChecker))return true; return false};CParagraphContentWithParagraphLikeContent.prototype.Get_ParaPosByContentPos=function(ContentPos,Depth){var Pos=ContentPos.Get(Depth);return this.Content[Pos].Get_ParaPosByContentPos(ContentPos,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.Recalculate_CurPos=function(_X,Y,CurrentRun,_CurRange,_CurLine,_CurPage,UpdateCurPos,UpdateTarget,ReturnTarget){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var X=_X;var StartPos=this.protected_GetRangeStartPos(CurLine, CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Item=this.Content[CurPos];var Res=Item.Recalculate_CurPos(X,Y,true===CurrentRun&&CurPos===this.State.ContentPos?true:false,_CurRange,_CurLine,_CurPage,UpdateCurPos,UpdateTarget,ReturnTarget);if(true===CurrentRun&&CurPos===this.State.ContentPos)return Res;else X=Res.X}return{X:X}};CParagraphContentWithParagraphLikeContent.prototype.Refresh_RecalcData=function(Data){if(undefined!== this.Paragraph&&null!==this.Paragraph)this.Paragraph.Refresh_RecalcData2(0)};CParagraphContentWithParagraphLikeContent.prototype.RecalculateMinMaxContentWidth=function(MinMax){var Count=this.Content.length;for(var Pos=0;Pos<Count;Pos++)this.Content[Pos].RecalculateMinMaxContentWidth(MinMax)};CParagraphContentWithParagraphLikeContent.prototype.Get_Range_VisibleWidth=function(RangeW,_CurLine,_CurRange){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange; var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)this.Content[CurPos].Get_Range_VisibleWidth(RangeW,_CurLine,_CurRange)};CParagraphContentWithParagraphLikeContent.prototype.Shift_Range=function(Dx,Dy,_CurLine,_CurRange){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange); var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)this.Content[CurPos].Shift_Range(Dx,Dy,_CurLine,_CurRange)};CParagraphContentWithParagraphLikeContent.prototype.Draw_HighLights=function(PDSH){var CurLine=PDSH.Line-this.StartLine;var CurRange=0===CurLine?PDSH.Range-this.StartRange:PDSH.Range;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<= EndPos;CurPos++)this.Content[CurPos].Draw_HighLights(PDSH)};CParagraphContentWithParagraphLikeContent.prototype.Draw_Elements=function(PDSE){var isPlaceHolder=false;var nTextAlpha;if(this.IsPlaceHolder&&this.IsPlaceHolder()&&PDSE.Graphics.setTextGlobalAlpha){isPlaceHolder=true;nTextAlpha=PDSE.Graphics.getTextGlobalAlpha();PDSE.Graphics.setTextGlobalAlpha(.5)}var CurLine=PDSE.Line-this.StartLine;var CurRange=0===CurLine?PDSE.Range-this.StartRange:PDSE.Range;var StartPos=this.protected_GetRangeStartPos(CurLine, CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)this.Content[CurPos].Draw_Elements(PDSE);if(isPlaceHolder)PDSE.Graphics.setTextGlobalAlpha(nTextAlpha)};CParagraphContentWithParagraphLikeContent.prototype.Draw_Lines=function(PDSL){var CurLine=PDSL.Line-this.StartLine;var CurRange=0===CurLine?PDSL.Range-this.StartRange:PDSL.Range;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine, CurRange);var nCurDepth=PDSL.CurDepth;for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){PDSL.CurPos.Update(CurPos,nCurDepth);PDSL.CurDepth=nCurDepth+1;this.Content[CurPos].Draw_Lines(PDSL)}};CParagraphContentWithParagraphLikeContent.prototype.IsCursorPlaceable=function(){return true};CParagraphContentWithParagraphLikeContent.prototype.Cursor_Is_Start=function(){var CurPos=0;while(CurPos<this.State.ContentPos&&CurPos<this.Content.length-1)if(true===this.Content[CurPos].Is_Empty())CurPos++;else return false; return this.Content[CurPos].Cursor_Is_Start()};CParagraphContentWithParagraphLikeContent.prototype.Cursor_Is_NeededCorrectPos=function(){return false};CParagraphContentWithParagraphLikeContent.prototype.Cursor_Is_End=function(){var CurPos=this.Content.length-1;while(CurPos>this.State.ContentPos&&CurPos>0)if(true===this.Content[CurPos].Is_Empty())CurPos--;else return false;return this.Content[CurPos].Cursor_Is_End()};CParagraphContentWithParagraphLikeContent.prototype.MoveCursorToStartPos=function(){this.State.ContentPos= 0;if(this.Content.length>0)this.Content[0].MoveCursorToStartPos()};CParagraphContentWithParagraphLikeContent.prototype.MoveCursorToEndPos=function(SelectFromEnd){var ContentLen=this.Content.length;if(ContentLen>0){this.State.ContentPos=ContentLen-1;this.Content[ContentLen-1].MoveCursorToEndPos(SelectFromEnd)}};CParagraphContentWithParagraphLikeContent.prototype.Get_ParaContentPosByXY=function(SearchPos,Depth,_CurLine,_CurRange,StepEnd){var Result=false;var CurLine=_CurLine-this.StartLine;var CurRange= 0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Item=this.Content[CurPos];if(false===SearchPos.InText)SearchPos.InTextPos.Update2(CurPos,Depth);if(true===Item.Get_ParaContentPosByXY(SearchPos,Depth+1,_CurLine,_CurRange,StepEnd)){SearchPos.Pos.Update2(CurPos,Depth);Result=true}}return Result};CParagraphContentWithParagraphLikeContent.prototype.Get_ParaContentPos= function(bSelection,bStart,ContentPos,bUseCorrection){var Pos=true===bSelection?true===bStart?this.State.Selection.StartPos:this.State.Selection.EndPos:this.State.ContentPos;ContentPos.Add(Pos);if(Pos<0||Pos>=this.Content.length)return;this.Content[Pos].Get_ParaContentPos(bSelection,bStart,ContentPos,bUseCorrection)};CParagraphContentWithParagraphLikeContent.prototype.Set_ParaContentPos=function(ContentPos,Depth){var Pos=ContentPos.Get(Depth);if(Pos>=this.Content.length)Pos=this.Content.length-1; if(Pos<0)Pos=0;this.State.ContentPos=Pos;this.Content[Pos].Set_ParaContentPos(ContentPos,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.Get_PosByElement=function(Class,ContentPos,Depth,UseRange,Range,Line){if(this===Class)return true;if(this.Content.length<=0)return false;var StartPos=0;var EndPos=this.Content.length-1;if(true===UseRange){var CurLine=Line-this.StartLine;var CurRange=0===CurLine?Range-this.StartRange:Range;if(CurLine>=0&&CurLine<this.protected_GetLinesCount()&&CurRange>= 0&&CurRange<this.protected_GetRangesCount(CurLine)){StartPos=Math.min(this.Content.length-1,Math.max(0,this.protected_GetRangeStartPos(CurLine,CurRange)));EndPos=Math.min(this.Content.length-1,Math.max(0,this.protected_GetRangeEndPos(CurLine,CurRange)))}}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Element=this.Content[CurPos];ContentPos.Update(CurPos,Depth);if(true===Element.Get_PosByElement(Class,ContentPos,Depth+1,true,CurRange,CurLine))return true}return false};CParagraphContentWithParagraphLikeContent.prototype.Get_ElementByPos= function(ContentPos,Depth){if(Depth>=ContentPos.Depth)return this;var CurPos=ContentPos.Get(Depth);if(!this.Content[CurPos])return null;return this.Content[CurPos].Get_ElementByPos(ContentPos,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.ConvertParaContentPosToRangePos=function(oContentPos,nDepth){var nRangePos=0;var nCurPos=oContentPos?Math.max(0,Math.min(this.Content.length-1,oContentPos.Get(nDepth))):this.Content.length-1;for(var nPos=0;nPos<nCurPos;++nPos)nRangePos+=this.Content[nPos].ConvertParaContentPosToRangePos(null); if(this.Content[nCurPos])nRangePos+=this.Content[nCurPos].ConvertParaContentPosToRangePos(oContentPos,nDepth+1);return nRangePos};CParagraphContentWithParagraphLikeContent.prototype.Get_PosByDrawing=function(Id,ContentPos,Depth){var Count=this.Content.length;for(var CurPos=0;CurPos<Count;CurPos++){var Element=this.Content[CurPos];ContentPos.Update(CurPos,Depth);if(true===Element.Get_PosByDrawing(Id,ContentPos,Depth+1))return true}return false};CParagraphContentWithParagraphLikeContent.prototype.Get_RunElementByPos= function(ContentPos,Depth){if(undefined!==ContentPos){var Pos=ContentPos.Get(Depth);return this.Content[Pos].Get_RunElementByPos(ContentPos,Depth+1)}else{var Count=this.Content.length;if(Count<=0)return null;var Pos=0;var Element=this.Content[Pos];while(null===Element&&Pos<Count-1)Element=this.Content[++Pos];return Element}};CParagraphContentWithParagraphLikeContent.prototype.Get_LastRunInRange=function(_CurLine,_CurRange){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange: _CurRange;if(CurLine<this.protected_GetLinesCount()&&CurRange<this.protected_GetRangesCount(CurLine)){var LastItem=this.Content[this.protected_GetRangeEndPos(CurLine,CurRange)];if(undefined!==LastItem)return LastItem.Get_LastRunInRange(_CurLine,_CurRange)}return null};CParagraphContentWithParagraphLikeContent.prototype.Get_LeftPos=function(SearchPos,ContentPos,Depth,UseContentPos){if(this.Content.length<=0)return false;var CurPos=true===UseContentPos?ContentPos.Get(Depth):this.Content.length-1;this.Content[CurPos].Get_LeftPos(SearchPos, ContentPos,Depth+1,UseContentPos);SearchPos.Pos.Update(CurPos,Depth);if(true===SearchPos.Found)return true;CurPos--;if(CurPos>=0&&this.Content[CurPos+1].IsStopCursorOnEntryExit()){this.Content[CurPos].Get_EndPos(false,SearchPos.Pos,Depth+1);SearchPos.Pos.Update(CurPos,Depth);SearchPos.Found=true;return true}while(CurPos>=0){this.Content[CurPos].Get_LeftPos(SearchPos,ContentPos,Depth+1,false);SearchPos.Pos.Update(CurPos,Depth);if(true===SearchPos.Found)return true;CurPos--}return false};CParagraphContentWithParagraphLikeContent.prototype.Get_RightPos= function(SearchPos,ContentPos,Depth,UseContentPos,StepEnd){if(this.Content.length<=0)return false;var CurPos=true===UseContentPos?ContentPos.Get(Depth):0;this.Content[CurPos].Get_RightPos(SearchPos,ContentPos,Depth+1,UseContentPos,StepEnd);SearchPos.Pos.Update(CurPos,Depth);if(true===SearchPos.Found)return true;CurPos++;var Count=this.Content.length;if(CurPos<Count&&this.Content[CurPos-1].IsStopCursorOnEntryExit()){this.Content[CurPos].Get_StartPos(SearchPos.Pos,Depth+1);SearchPos.Pos.Update(CurPos, Depth);SearchPos.Found=true;return true}while(CurPos<this.Content.length){this.Content[CurPos].Get_RightPos(SearchPos,ContentPos,Depth+1,false,StepEnd);SearchPos.Pos.Update(CurPos,Depth);if(true===SearchPos.Found)return true;CurPos++}return false};CParagraphContentWithParagraphLikeContent.prototype.Get_WordStartPos=function(SearchPos,ContentPos,Depth,UseContentPos){var CurPos=true===UseContentPos?ContentPos.Get(Depth):this.Content.length-1;this.Content[CurPos].Get_WordStartPos(SearchPos,ContentPos, Depth+1,UseContentPos);if(true===SearchPos.UpdatePos)SearchPos.Pos.Update(CurPos,Depth);if(true===SearchPos.Found)return;CurPos--;if(SearchPos.Shift&&CurPos>=0&&this.Content[CurPos].IsStopCursorOnEntryExit()){SearchPos.Found=true;return}if(CurPos>=0&&this.Content[CurPos+1].IsStopCursorOnEntryExit()){this.Content[CurPos].Get_EndPos(false,SearchPos.Pos,Depth+1);SearchPos.Pos.Update(CurPos,Depth);SearchPos.Found=true;return}while(CurPos>=0){var OldUpdatePos=SearchPos.UpdatePos;this.Content[CurPos].Get_WordStartPos(SearchPos, ContentPos,Depth+1,false);if(true===SearchPos.UpdatePos)SearchPos.Pos.Update(CurPos,Depth);else SearchPos.UpdatePos=OldUpdatePos;if(true===SearchPos.Found)return;CurPos--;if(SearchPos.Shift&&CurPos>=0&&this.Content[CurPos].IsStopCursorOnEntryExit()){SearchPos.Found=true;return}if(CurPos>=0&&this.Content[CurPos+1].IsStopCursorOnEntryExit()){this.Content[CurPos].Get_EndPos(false,SearchPos.Pos,Depth+1);SearchPos.Pos.Update(CurPos,Depth);SearchPos.Found=true;return}}};CParagraphContentWithParagraphLikeContent.prototype.Get_WordEndPos= function(SearchPos,ContentPos,Depth,UseContentPos,StepEnd){var CurPos=true===UseContentPos?ContentPos.Get(Depth):0;this.Content[CurPos].Get_WordEndPos(SearchPos,ContentPos,Depth+1,UseContentPos,StepEnd);if(true===SearchPos.UpdatePos)SearchPos.Pos.Update(CurPos,Depth);if(true===SearchPos.Found)return;CurPos++;var Count=this.Content.length;if(SearchPos.Shift&&CurPos<Count&&this.Content[CurPos].IsStopCursorOnEntryExit()){SearchPos.Found=true;return}if(CurPos<Count&&this.Content[CurPos-1].IsStopCursorOnEntryExit()){this.Content[CurPos].Get_StartPos(SearchPos.Pos, Depth+1);SearchPos.Pos.Update(CurPos,Depth);SearchPos.Found=true;SearchPos.UpdatePos=true;return}while(CurPos<Count){var OldUpdatePos=SearchPos.UpdatePos;this.Content[CurPos].Get_WordEndPos(SearchPos,ContentPos,Depth+1,false,StepEnd);if(true===SearchPos.UpdatePos)SearchPos.Pos.Update(CurPos,Depth);else SearchPos.UpdatePos=OldUpdatePos;if(true===SearchPos.Found)return;CurPos++;if(SearchPos.Shift&&CurPos<Count&&this.Content[CurPos].IsStopCursorOnEntryExit()){SearchPos.Found=true;return}if(CurPos<Count&& this.Content[CurPos-1].IsStopCursorOnEntryExit()){this.Content[CurPos].Get_StartPos(SearchPos.Pos,Depth+1);SearchPos.Pos.Update(CurPos,Depth);SearchPos.Found=true;SearchPos.UpdatePos=true;return}}};CParagraphContentWithParagraphLikeContent.prototype.Get_EndRangePos=function(nCurLine,nCurRange,oSearchPos,nDepth){var _nCurLine=nCurLine-this.StartLine;var _nCurRange=0===_nCurLine?nCurRange-this.StartRange:nCurRange;var nStartPos=Math.max(0,Math.min(this.Content.length-1,this.protected_GetRangeStartPos(_nCurLine, _nCurRange)));var nEndPos=Math.min(this.Content.length-1,Math.max(0,this.protected_GetRangeEndPos(_nCurLine,_nCurRange)));var bResult=false;for(var nPos=nEndPos;nPos>=nStartPos;--nPos)if(this.Content[nPos].Get_EndRangePos(nCurLine,nCurRange,oSearchPos,nDepth+1)){oSearchPos.Pos.Update(nPos,nDepth);bResult=true;break}return bResult};CParagraphContentWithParagraphLikeContent.prototype.Get_StartRangePos=function(nCurLine,nCurRange,oSearchPos,nDepth){var _nCurLine=nCurLine-this.StartLine;var _nCurRange= 0===_nCurLine?nCurRange-this.StartRange:nCurRange;var nStartPos=Math.max(0,Math.min(this.Content.length-1,this.protected_GetRangeStartPos(_nCurLine,_nCurRange)));var nEndPos=Math.min(this.Content.length-1,Math.max(0,this.protected_GetRangeEndPos(_nCurLine,_nCurRange)));var bResult=false;for(var nPos=nStartPos;nPos<=nEndPos;++nPos)if(this.Content[nPos].Get_StartRangePos(nCurLine,nCurRange,oSearchPos,nDepth+1)){oSearchPos.Pos.Update(nPos,nDepth);bResult=true;break}return bResult};CParagraphContentWithParagraphLikeContent.prototype.Get_StartRangePos2= function(_CurLine,_CurRange,ContentPos,Depth){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var Pos=this.protected_GetRangeStartPos(CurLine,CurRange);ContentPos.Update(Pos,Depth);this.Content[Pos].Get_StartRangePos2(_CurLine,_CurRange,ContentPos,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.Get_EndRangePos2=function(_CurLine,_CurRange,ContentPos,Depth){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange: _CurRange;var Pos=this.protected_GetRangeEndPos(CurLine,CurRange);ContentPos.Update(Pos,Depth);this.Content[Pos].Get_EndRangePos2(_CurLine,_CurRange,ContentPos,Depth+1)};CParagraphContentWithParagraphLikeContent.prototype.Get_StartPos=function(ContentPos,Depth){if(this.Content.length>0){ContentPos.Update(0,Depth);this.Content[0].Get_StartPos(ContentPos,Depth+1)}};CParagraphContentWithParagraphLikeContent.prototype.Get_EndPos=function(BehindEnd,ContentPos,Depth){var ContentLen=this.Content.length; if(ContentLen>0){ContentPos.Update(ContentLen-1,Depth);this.Content[ContentLen-1].Get_EndPos(BehindEnd,ContentPos,Depth+1)}};CParagraphContentWithParagraphLikeContent.prototype.Set_SelectionContentPos=function(StartContentPos,EndContentPos,Depth,StartFlag,EndFlag){if(this.Content.length<=0)return;var Selection=this.Selection;var OldStartPos=Selection.StartPos;var OldEndPos=Selection.EndPos;if(OldStartPos>OldEndPos){OldStartPos=Selection.EndPos;OldEndPos=Selection.StartPos}var StartPos=0;switch(StartFlag){case 1:StartPos= 0;break;case -1:StartPos=this.Content.length-1;break;case 0:StartPos=StartContentPos.Get(Depth);break}var EndPos=0;switch(EndFlag){case 1:EndPos=0;break;case -1:EndPos=this.Content.length-1;break;case 0:EndPos=EndContentPos.Get(Depth);break}if(OldStartPos<StartPos&&OldStartPos<EndPos){var TempBegin=Math.max(0,OldStartPos);var TempEnd=Math.min(this.Content.length-1,Math.min(StartPos,EndPos)-1);for(var CurPos=TempBegin;CurPos<=TempEnd;++CurPos)this.Content[CurPos].RemoveSelection()}if(OldEndPos>StartPos&& OldEndPos>EndPos){var TempBegin=Math.max(0,Math.max(StartPos,EndPos)+1);var TempEnd=Math.min(OldEndPos,this.Content.length-1);for(var CurPos=TempBegin;CurPos<=TempEnd;++CurPos)this.Content[CurPos].RemoveSelection()}Selection.Use=true;Selection.StartPos=StartPos;Selection.EndPos=EndPos;if(StartPos!=EndPos){this.Content[StartPos].Set_SelectionContentPos(StartContentPos,null,Depth+1,StartFlag,StartPos>EndPos?1:-1);this.Content[EndPos].Set_SelectionContentPos(null,EndContentPos,Depth+1,StartPos>EndPos? -1:1,EndFlag);var _StartPos=StartPos;var _EndPos=EndPos;var Direction=1;if(_StartPos>_EndPos){_StartPos=EndPos;_EndPos=StartPos;Direction=-1}for(var CurPos=_StartPos+1;CurPos<_EndPos;CurPos++)this.Content[CurPos].SelectAll(Direction)}else this.Content[StartPos].Set_SelectionContentPos(StartContentPos,EndContentPos,Depth+1,StartFlag,EndFlag)};CParagraphContentWithParagraphLikeContent.prototype.SetContentSelection=function(StartDocPos,EndDocPos,Depth,StartFlag,EndFlag){if(this.Content.length<=0)return; if(0===StartFlag&&(!StartDocPos[Depth]||this!==StartDocPos[Depth].Class)||0===EndFlag&&(!EndDocPos[Depth]||this!==EndDocPos[Depth].Class))return;var StartPos=0,EndPos=0;switch(StartFlag){case 0:StartPos=StartDocPos[Depth].Position;break;case 1:StartPos=0;break;case -1:StartPos=this.Content.length-1;break}switch(EndFlag){case 0:EndPos=EndDocPos[Depth].Position;break;case 1:EndPos=0;break;case -1:EndPos=this.Content.length-1;break}var _StartDocPos=StartDocPos,_StartFlag=StartFlag;if(null!==StartDocPos&& true===StartDocPos[Depth].Deleted)if(StartPos<this.Content.length){_StartDocPos=null;_StartFlag=1}else if(StartPos>0){StartPos--;_StartDocPos=null;_StartFlag=-1}else return;var _EndDocPos=EndDocPos,_EndFlag=EndFlag;if(null!==EndDocPos&&true===EndDocPos[Depth].Deleted)if(EndPos<this.Content.length){_EndDocPos=null;_EndFlag=1}else if(EndPos>0){EndPos--;_EndDocPos=null;_EndFlag=-1}else return;this.Selection.Use=true;this.Selection.StartPos=Math.max(0,Math.min(this.Content.length-1,StartPos));this.Selection.EndPos= Math.max(0,Math.min(this.Content.length-1,EndPos));if(StartPos!==EndPos){if(this.Content[StartPos]&&this.Content[StartPos].SetContentSelection)this.Content[StartPos].SetContentSelection(_StartDocPos,null,Depth+1,_StartFlag,StartPos>EndPos?1:-1);if(this.Content[EndPos]&&this.Content[EndPos].SetContentSelection)this.Content[EndPos].SetContentSelection(null,_EndDocPos,Depth+1,StartPos>EndPos?-1:1,_EndFlag);var _StartPos=StartPos;var _EndPos=EndPos;var Direction=1;if(_StartPos>_EndPos){_StartPos=EndPos; _EndPos=StartPos;Direction=-1}for(var CurPos=_StartPos+1;CurPos<_EndPos;CurPos++)this.Content[CurPos].SelectAll(Direction)}else if(this.Content[StartPos]&&this.Content[StartPos].SetContentSelection)this.Content[StartPos].SetContentSelection(_StartDocPos,_EndDocPos,Depth+1,_StartFlag,_EndFlag)};CParagraphContentWithParagraphLikeContent.prototype.SetContentPosition=function(DocPos,Depth,Flag){if(this.Content.length<=0)return;if(0===Flag&&(!DocPos[Depth]||this!==DocPos[Depth].Class))return;var Pos=0; switch(Flag){case 0:Pos=DocPos[Depth].Position;break;case 1:Pos=0;break;case -1:Pos=this.Content.length-1;break}var _DocPos=DocPos,_Flag=Flag;if(null!==DocPos&&true===DocPos[Depth].Deleted)if(Pos<this.Content.length){_DocPos=null;_Flag=1}else if(Pos>0){Pos--;_DocPos=null;_Flag=-1}else return;this.State.ContentPos=Math.max(0,Math.min(this.Content.length-1,Pos));if(this.CurPos)this.CurPos=this.State.ContentPos;if(this.Content[Pos]&&this.Content[Pos].SetContentPosition)this.Content[Pos].SetContentPosition(_DocPos, Depth+1,_Flag);else this.Content[Pos].MoveCursorToStartPos()};CParagraphContentWithParagraphLikeContent.prototype.RemoveSelection=function(){var Selection=this.Selection;if(true===Selection.Use){var StartPos=Selection.StartPos;var EndPos=Selection.EndPos;if(StartPos>EndPos){StartPos=Selection.EndPos;EndPos=Selection.StartPos}StartPos=Math.max(0,StartPos);EndPos=Math.min(this.Content.length-1,EndPos);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)this.Content[CurPos].RemoveSelection()}Selection.Use= false;Selection.StartPos=0;Selection.EndPos=0};CParagraphContentWithParagraphLikeContent.prototype.SelectAll=function(Direction){var ContentLen=this.Content.length;var Selection=this.Selection;Selection.Use=true;if(-1===Direction){Selection.StartPos=ContentLen-1;Selection.EndPos=0}else{Selection.StartPos=0;Selection.EndPos=ContentLen-1}for(var CurPos=0;CurPos<ContentLen;CurPos++)this.Content[CurPos].SelectAll(Direction)};CParagraphContentWithParagraphLikeContent.prototype.Selection_DrawRange=function(_CurLine, _CurRange,SelectionDraw){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)this.Content[CurPos].Selection_DrawRange(_CurLine,_CurRange,SelectionDraw)};CParagraphContentWithParagraphLikeContent.prototype.IsSelectionEmpty=function(CheckEnd){if(this.Content.length<=0)return true;var StartPos= this.State.Selection.StartPos;var EndPos=this.State.Selection.EndPos;if(StartPos>EndPos){StartPos=this.State.Selection.EndPos;EndPos=this.State.Selection.StartPos}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)if(false===this.Content[CurPos].IsSelectionEmpty(CheckEnd))return false;return true};CParagraphContentWithParagraphLikeContent.prototype.Selection_CheckParaEnd=function(){return false};CParagraphContentWithParagraphLikeContent.prototype.Selection_CheckParaContentPos=function(ContentPos,Depth, bStart,bEnd){var CurPos=ContentPos.Get(Depth);if(this.Selection.StartPos<=CurPos&&CurPos<=this.Selection.EndPos)return this.Content[CurPos].Selection_CheckParaContentPos(ContentPos,Depth+1,bStart&&this.Selection.StartPos===CurPos,bEnd&&CurPos===this.Selection.EndPos);else if(this.Selection.EndPos<=CurPos&&CurPos<=this.Selection.StartPos)return this.Content[CurPos].Selection_CheckParaContentPos(ContentPos,Depth+1,bStart&&this.Selection.EndPos===CurPos,bEnd&&CurPos===this.Selection.StartPos);return false}; CParagraphContentWithParagraphLikeContent.prototype.IsSelectedAll=function(Props){var Selection=this.State.Selection;if(false===Selection.Use&&true!==this.Is_Empty(Props))return false;var StartPos=Selection.StartPos;var EndPos=Selection.EndPos;if(EndPos<StartPos){StartPos=Selection.EndPos;EndPos=Selection.StartPos}for(var Pos=0;Pos<=StartPos;Pos++)if(false===this.Content[Pos].IsSelectedAll(Props))return false;var Count=this.Content.length;for(var Pos=EndPos;Pos<Count;Pos++)if(false===this.Content[Pos].IsSelectedAll(Props))return false; return true};CParagraphContentWithParagraphLikeContent.prototype.IsSelectedFromStart=function(){if(!this.Selection.Use&&!this.IsEmpty())return false;var nStartPos=this.Selection.StartPos<this.Selection.EndPos?this.Selection.StartPos:this.Selection.EndPos;return this.Content[nStartPos].IsSelectedFromStart()};CParagraphContentWithParagraphLikeContent.prototype.IsSelectedToEnd=function(){if(!this.Selection.Use&&!this.IsEmpty())return false;var nEndPos=this.Selection.StartPos<this.Selection.EndPos?this.Selection.EndPos: this.Selection.StartPos;return this.Content[nEndPos].IsSelectedToEnd()};CParagraphContentWithParagraphLikeContent.prototype.SkipAnchorsAtSelectionStart=function(nDirection){if(false===this.Selection.Use||true===this.IsEmpty({SkipAnchor:true}))return true;var oSelection=this.State.Selection;var nStartPos=Math.min(oSelection.StartPos,oSelection.EndPos);var nEndPos=Math.max(oSelection.StartPos,oSelection.EndPos);for(var nPos=0;nPos<nStartPos;++nPos)if(true!==this.Content[nPos].IsEmpty({SkipAnchor:true}))return false; for(var nPos=nStartPos;nPos<=nEndPos;++nPos)if(true===this.Content[nPos].SkipAnchorsAtSelectionStart(nDirection)){if(1===nDirection)this.Selection.StartPos=nPos+1;else this.Selection.EndPos=nPos+1;this.Content[nPos].RemoveSelection()}else return false;if(nEndPos<this.Content.length-1)return false;return true};CParagraphContentWithParagraphLikeContent.prototype.IsSelectionUse=function(){return this.State.Selection.Use};CParagraphContentWithParagraphLikeContent.prototype.Restart_CheckSpelling=function(){for(var nIndex= 0,nCount=this.Content.length;nIndex<nCount;nIndex++)this.Content[nIndex].Restart_CheckSpelling()};CParagraphContentWithParagraphLikeContent.prototype.CheckSpelling=function(oSpellCheckerEngine,nDepth){if(oSpellCheckerEngine.IsExceedLimit())return;var nStartPos=0;if(oSpellCheckerEngine.IsFindStart())nStartPos=oSpellCheckerEngine.GetPos(nDepth);else this.SpellingMarks=[];for(var nPos=nStartPos,nCount=this.Content.length;nPos<nCount;++nPos){var oItem=this.Content[nPos];oSpellCheckerEngine.UpdatePos(nPos, nDepth);oItem.CheckSpelling(oSpellCheckerEngine,nDepth+1);if(oSpellCheckerEngine.IsExceedLimit())return}};CParagraphContentWithParagraphLikeContent.prototype.Add_SpellCheckerElement=function(Element,Start,Depth){if(true===Start)this.Content[Element.StartPos.Get(Depth)].Add_SpellCheckerElement(Element,Start,Depth+1);else this.Content[Element.EndPos.Get(Depth)].Add_SpellCheckerElement(Element,Start,Depth+1);this.SpellingMarks.push(new CParagraphSpellingMark(Element,Start,Depth))};CParagraphContentWithParagraphLikeContent.prototype.Remove_SpellCheckerElement= function(Element){var Count=this.SpellingMarks.length;for(var Pos=0;Pos<Count;Pos++){var SpellingMark=this.SpellingMarks[Pos];if(Element===SpellingMark.Element){this.SpellingMarks.splice(Pos,1);break}}};CParagraphContentWithParagraphLikeContent.prototype.Clear_SpellingMarks=function(){this.SpellingMarks=[]};CParagraphContentWithParagraphLikeContent.prototype.Search=function(oParaSearch){this.SearchMarks=[];for(var nPos=0,nContentLen=this.Content.length;nPos<nContentLen;++nPos)this.Content[nPos].Search(oParaSearch)}; CParagraphContentWithParagraphLikeContent.prototype.AddSearchResult=function(oSearchResult,isStart,oContentPos,nDepth){oSearchResult.RegisterClass(isStart,this);this.SearchMarks.push(new CParagraphSearchMark(oSearchResult,isStart,nDepth));this.Content[oContentPos.Get(nDepth)].AddSearchResult(oSearchResult,isStart,oContentPos,nDepth+1)};CParagraphContentWithParagraphLikeContent.prototype.ClearSearchResults=function(){this.SearchMarks=[]};CParagraphContentWithParagraphLikeContent.prototype.RemoveSearchResult= function(oSearchResult){for(var nIndex=0,nMarksCount=this.SearchMarks.length;nIndex<nMarksCount;++nIndex){var oMark=this.SearchMarks[nIndex];if(oSearchResult===oMark.SearchResult){this.SearchMarks.splice(nIndex,1);nIndex--;nMarksCount--}}};CParagraphContentWithParagraphLikeContent.prototype.GetSearchElementId=function(bNext,bUseContentPos,ContentPos,Depth){var StartPos=0;if(true===bUseContentPos)StartPos=ContentPos.Get(Depth);else if(true===bNext)StartPos=0;else StartPos=this.Content.length-1;if(true=== bNext){var ContentLen=this.Content.length;for(var CurPos=StartPos;CurPos<ContentLen;CurPos++){var ElementId=this.Content[CurPos].GetSearchElementId(true,bUseContentPos&&CurPos===StartPos?true:false,ContentPos,Depth+1);if(null!==ElementId)return ElementId}}else{var ContentLen=this.Content.length;for(var CurPos=StartPos;CurPos>=0;CurPos--){var ElementId=this.Content[CurPos].GetSearchElementId(false,bUseContentPos&&CurPos===StartPos?true:false,ContentPos,Depth+1);if(null!==ElementId)return ElementId}}return null}; CParagraphContentWithParagraphLikeContent.prototype.SetReviewType=function(ReviewType,RemovePrChange){for(var Index=0,Count=this.Content.length;Index<Count;Index++){var Element=this.Content[Index];if(para_Run===Element.Type){Element.SetReviewType(ReviewType);if(true===RemovePrChange)Element.RemovePrChange()}else if(Element.SetReviewType)Element.SetReviewType(ReviewType)}};CParagraphContentWithParagraphLikeContent.prototype.SetReviewTypeWithInfo=function(ReviewType,ReviewInfo){for(var Index=0,Count= this.Content.length;Index<Count;Index++){var Element=this.Content[Index];if(Element&&Element.SetReviewTypeWithInfo)Element.SetReviewTypeWithInfo(ReviewType,ReviewInfo)}};CParagraphContentWithParagraphLikeContent.prototype.CheckRevisionsChanges=function(Checker,ContentPos,Depth){for(var CurPos=0,Count=this.Content.length;CurPos<Count;CurPos++){ContentPos.Update(CurPos,Depth);this.Content[CurPos].CheckRevisionsChanges(Checker,ContentPos,Depth+1)}};CParagraphContentWithParagraphLikeContent.prototype.AcceptRevisionChanges= function(Type,bAll){if(true===this.Selection.Use||true===bAll){var StartPos=this.Selection.StartPos;var EndPos=this.Selection.EndPos;if(StartPos>EndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}if(true===bAll){StartPos=0;EndPos=this.Content.length-1}if(this.Content[EndPos].AcceptRevisionChanges)this.Content[EndPos].AcceptRevisionChanges(Type,bAll);if(StartPos<EndPos){for(var CurPos=EndPos-1;CurPos>StartPos;CurPos--){var Element=this.Content[CurPos];var ReviewType=Element.GetReviewType? Element.GetReviewType():reviewtype_Common;var isGoInside=false;if(reviewtype_Add===ReviewType){if(undefined===Type||c_oAscRevisionsChangeType.TextAdd===Type)Element.SetReviewType(reviewtype_Common);isGoInside=true}else if(reviewtype_Remove===ReviewType){if(undefined===Type||c_oAscRevisionsChangeType.TextRem===Type)this.Remove_FromContent(CurPos,1,true)}else if(reviewtype_Common===ReviewType)isGoInside=true;if(true===isGoInside&&Element.AcceptRevisionChanges)Element.AcceptRevisionChanges(Type,true)}if(this.Content[StartPos].AcceptRevisionChanges)this.Content[StartPos].AcceptRevisionChanges(Type, bAll)}this.Correct_Content()}};CParagraphContentWithParagraphLikeContent.prototype.RejectRevisionChanges=function(Type,bAll){if(true===this.Selection.Use||true===bAll){var StartPos=this.Selection.StartPos;var EndPos=this.Selection.EndPos;if(StartPos>EndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}if(true===bAll){StartPos=0;EndPos=this.Content.length-1}if(this.Content[EndPos].RejectRevisionChanges)this.Content[EndPos].RejectRevisionChanges(Type,bAll);if(StartPos<EndPos){for(var CurPos= EndPos-1;CurPos>StartPos;CurPos--){var Element=this.Content[CurPos];var ReviewType=Element.GetReviewType?Element.GetReviewType():reviewtype_Common;var isGoInside=false;if(reviewtype_Remove===ReviewType){if(undefined===Type||c_oAscRevisionsChangeType.TextRem===Type)Element.SetReviewType(reviewtype_Common);isGoInside=true}else if(reviewtype_Add===ReviewType){if(undefined===Type||c_oAscRevisionsChangeType.TextAdd===Type)this.Remove_FromContent(CurPos,1,true)}else if(reviewtype_Common===ReviewType)isGoInside= true;if(true===isGoInside&&Element.RejectRevisionChanges)Element.RejectRevisionChanges(Type,true)}if(this.Content[StartPos].RejectRevisionChanges)this.Content[StartPos].RejectRevisionChanges(Type,bAll)}this.Correct_Content()}};CParagraphContentWithParagraphLikeContent.prototype.private_UpdateTrackRevisions=function(){if(this.Paragraph&&this.Paragraph.LogicDocument&&this.Paragraph.LogicDocument.GetTrackRevisionsManager){var RevisionsManager=this.Paragraph.LogicDocument.GetTrackRevisionsManager();RevisionsManager.CheckElement(this.Paragraph)}}; CParagraphContentWithParagraphLikeContent.prototype.private_CheckUpdateBookmarks=function(Items){if(!Items)return;for(var nIndex=0,nCount=Items.length;nIndex<nCount;++nIndex){var oItem=Items[nIndex];if(oItem&¶_Bookmark===oItem.Type){var oLogicDocument=this.Paragraph&&this.Paragraph.LogicDocument?this.Paragraph.LogicDocument:editor.WordControl.m_oLogicDocument;oLogicDocument.GetBookmarksManager().SetNeedUpdate(true);return}}};CParagraphContentWithParagraphLikeContent.prototype.GetFootnotesList= function(oEngine){for(var nIndex=0,nCount=this.Content.length;nIndex<nCount;++nIndex){if(this.Content[nIndex].GetFootnotesList)this.Content[nIndex].GetFootnotesList(oEngine);if(oEngine.IsRangeFull())return}};CParagraphContentWithParagraphLikeContent.prototype.GotoFootnoteRef=function(isNext,isCurrent,isStepOver,isStepFootnote,isStepEndnote){var nPos=0;if(true===isCurrent)if(true===this.Selection.Use)nPos=Math.min(this.Selection.StartPos,this.Selection.EndPos);else nPos=this.State.ContentPos;else if(true=== isNext)nPos=0;else nPos=this.Content.length-1;if(true===isNext)for(var nIndex=nPos,nCount=this.Content.length-1;nIndex<nCount;++nIndex){var nRes=this.Content[nIndex].GotoFootnoteRef?this.Content[nIndex].GotoFootnoteRef(true,true===isCurrent&&nPos===nIndex,isStepOver,isStepFootnote,isStepEndnote):0;if(nRes>0)isStepOver=true;else if(-1===nRes)return true}else for(var nIndex=nPos;nIndex>=0;--nIndex){var nRes=this.Content[nIndex].GotoFootnoteRef?this.Content[nIndex].GotoFootnoteRef(true,true===isCurrent&& nPos===nIndex,isStepOver,isStepFootnote,isStepEndnote):0;if(nRes>0)isStepOver=true;else if(-1===nRes)return true}return false};CParagraphContentWithParagraphLikeContent.prototype.GetFootnoteRefsInRange=function(arrFootnotes,_CurLine,_CurRange){var CurLine=_CurLine-this.StartLine;var CurRange=0===CurLine?_CurRange-this.StartRange:_CurRange;var StartPos=this.protected_GetRangeStartPos(CurLine,CurRange);var EndPos=this.protected_GetRangeEndPos(CurLine,CurRange);for(var CurPos=StartPos;CurPos<=EndPos;CurPos++)if(this.Content[CurPos].GetFootnoteRefsInRange)this.Content[CurPos].GetFootnoteRefsInRange(arrFootnotes, _CurLine,_CurRange)};CParagraphContentWithParagraphLikeContent.prototype.GetAllContentControls=function(arrContentControls){if(!arrContentControls)arrContentControls=[];for(var nIndex=0,nCount=this.Content.length;nIndex<nCount;++nIndex)if(this.Content[nIndex].GetAllContentControls)this.Content[nIndex].GetAllContentControls(arrContentControls);return arrContentControls};CParagraphContentWithParagraphLikeContent.prototype.Is_UseInDocument=function(){return this.Paragraph&&true===this.Paragraph.Is_UseInDocument()&& true===this.Is_UseInParagraph()?true:false};CParagraphContentWithParagraphLikeContent.prototype.Is_UseInParagraph=function(){if(!this.Paragraph)return false;var ContentPos=this.Paragraph.Get_PosByElement(this);if(!ContentPos)return false;return true};CParagraphContentWithParagraphLikeContent.prototype.SelectThisElement=function(nDirection){if(!this.Paragraph)return false;var ContentPos=this.Paragraph.Get_PosByElement(this);if(!ContentPos)return false;var StartPos=ContentPos.Copy();var EndPos=ContentPos.Copy(); if(nDirection>0){this.Get_StartPos(StartPos,StartPos.Get_Depth()+1);this.Get_EndPos(true,EndPos,EndPos.Get_Depth()+1)}else{this.Get_StartPos(EndPos,EndPos.Get_Depth()+1);this.Get_EndPos(true,StartPos,StartPos.Get_Depth()+1)}this.Paragraph.Selection.Use=true;this.Paragraph.Selection.Start=false;this.Paragraph.Set_ParaContentPos(StartPos,true,-1,-1);this.Paragraph.Set_SelectionContentPos(StartPos,EndPos,false);this.Paragraph.Document_SetThisElementCurrent(false);return true};CParagraphContentWithParagraphLikeContent.prototype.SetThisElementCurrent= function(){var ContentPos=this.Paragraph.Get_PosByElement(this);if(!ContentPos)return;var StartPos=ContentPos.Copy();this.Get_StartPos(StartPos,StartPos.Get_Depth()+1);this.Paragraph.Set_ParaContentPos(StartPos,true,-1,-1,false);this.Paragraph.Document_SetThisElementCurrent(false)};CParagraphContentWithParagraphLikeContent.prototype.GetSelectedContentControls=function(arrContentControls){if(true===this.Selection.Use){var StartPos=this.Selection.StartPos;var EndPos=this.Selection.EndPos;if(StartPos> EndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}for(var Index=StartPos;Index<=EndPos;++Index)if(this.Content[Index].GetSelectedContentControls)this.Content[Index].GetSelectedContentControls(arrContentControls)}else if(this.Content[this.State.ContentPos].GetSelectedContentControls)this.Content[this.State.ContentPos].GetSelectedContentControls(arrContentControls)};CParagraphContentWithParagraphLikeContent.prototype.CreateRunWithText=function(sValue){var oRun=new ParaRun;oRun.AddText(sValue); oRun.Set_Pr(this.Get_FirstTextPr());return oRun};CParagraphContentWithParagraphLikeContent.prototype.ReplaceAllWithText=function(sValue){var oRun=this.CreateRunWithText(sValue);oRun.Apply_TextPr(this.Get_TextPr(),undefined,true);this.Remove_FromContent(0,this.Content.length);this.Add_ToContent(0,oRun);this.MoveCursorToStartPos()};CParagraphContentWithParagraphLikeContent.prototype.FindNextFillingForm=function(isNext,isCurrent,isStart){var nCurPos=this.Selection.Use===true?this.Selection.EndPos:this.State.ContentPos; var nStartPos=0,nEndPos=0;if(isCurrent)if(isStart){nStartPos=nCurPos;nEndPos=isNext?this.Content.length-1:0}else{nStartPos=isNext?0:this.Content.length-1;nEndPos=nCurPos}else if(isNext){nStartPos=0;nEndPos=this.Content.length-1}else{nStartPos=this.Content.length-1;nEndPos=0}if(isNext)for(var nIndex=nStartPos;nIndex<=nEndPos;++nIndex){if(this.Content[nIndex].FindNextFillingForm){var oRes=this.Content[nIndex].FindNextFillingForm(true,isCurrent&&nIndex===nCurPos?true:false,isStart);if(oRes)return oRes}}else for(var nIndex= nStartPos;nIndex>=nEndPos;--nIndex)if(this.Content[nIndex].FindNextFillingForm){var oRes=this.Content[nIndex].FindNextFillingForm(false,isCurrent&&nIndex===nCurPos?true:false,isStart);if(oRes)return oRes}return null};CParagraphContentWithParagraphLikeContent.prototype.IsEmpty=function(oPr){return this.Is_Empty(oPr)};CParagraphContentWithParagraphLikeContent.prototype.AddContentControl=function(){if(true===this.IsSelectionUse())if(this.Selection.StartPos===this.Selection.EndPos&¶_Run!==this.Content[this.Selection.StartPos].Type){if(this.Content[this.Selection.StartPos].AddContentControl)return this.Content[this.Selection.StartPos].AddContentControl(); return null}else{var nStartPos=this.Selection.StartPos;var nEndPos=this.Selection.EndPos;if(nEndPos<nStartPos){nStartPos=this.Selection.EndPos;nEndPos=this.Selection.StartPos}for(var nIndex=nStartPos;nIndex<=nEndPos;++nIndex)if(para_Run!==this.Content[nIndex].Type)return null;var oContentControl=new CInlineLevelSdt;oContentControl.SetPlaceholder(c_oAscDefaultPlaceholderName.Text);oContentControl.SetDefaultTextPr(this.GetDirectTextPr());var oNewRun=this.Content[nEndPos].Split_Run(Math.max(this.Content[nEndPos].Selection.StartPos, this.Content[nEndPos].Selection.EndPos));this.Add_ToContent(nEndPos+1,oNewRun);oNewRun=this.Content[nStartPos].Split_Run(Math.min(this.Content[nStartPos].Selection.StartPos,this.Content[nStartPos].Selection.EndPos));this.Add_ToContent(nStartPos+1,oNewRun);oContentControl.ReplacePlaceHolderWithContent();for(var nIndex=nEndPos+1;nIndex>=nStartPos+1;--nIndex){oContentControl.Add_ToContent(0,this.Content[nIndex]);this.Remove_FromContent(nIndex,1)}if(oContentControl.IsEmpty())oContentControl.ReplaceContentWithPlaceHolder(); this.Add_ToContent(nStartPos+1,oContentControl);this.Selection.StartPos=nStartPos+1;this.Selection.EndPos=nStartPos+1;oContentControl.SelectAll(1);return oContentControl}else{var oContentControl=new CInlineLevelSdt;oContentControl.SetDefaultTextPr(this.GetDirectTextPr());oContentControl.SetPlaceholder(c_oAscDefaultPlaceholderName.Text);oContentControl.ReplaceContentWithPlaceHolder(false);this.Add(oContentControl);return oContentControl}};CParagraphContentWithParagraphLikeContent.prototype.GetElement= function(nPos){if(nPos<0||nPos>=this.Content.length)return null;return this.Content[nPos]};CParagraphContentWithParagraphLikeContent.prototype.GetElementsCount=function(){return this.Content.length};CParagraphContentWithParagraphLikeContent.prototype.PreDelete=function(){for(var nIndex=0,nCount=this.Content.length;nIndex<nCount;++nIndex)if(this.Content[nIndex]&&this.Content[nIndex].PreDelete)this.Content[nIndex].PreDelete();this.RemoveSelection()};CParagraphContentWithParagraphLikeContent.prototype.GetCurrentComplexFields= function(arrComplexFields,isCurrent,isFieldPos){var nEndPos=isCurrent?this.State.ContentPos:this.Content.length-1;for(var nIndex=0;nIndex<=nEndPos;++nIndex)if(this.Content[nIndex]&&this.Content[nIndex].GetCurrentComplexFields)this.Content[nIndex].GetCurrentComplexFields(arrComplexFields,isCurrent&&nIndex===nEndPos,isFieldPos)};CParagraphContentWithParagraphLikeContent.prototype.GetDirectTextPr=function(){if(true===this.Selection.Use){var StartPos=this.Selection.StartPos;var EndPos=this.Selection.EndPos; if(StartPos>EndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}while(true===this.Content[StartPos].IsSelectionEmpty()&&StartPos<EndPos)StartPos++;return this.Content[StartPos].GetDirectTextPr()}else return this.Content[this.State.ContentPos].GetDirectTextPr()};CParagraphContentWithParagraphLikeContent.prototype.GetAllFields=function(isUseSelection,arrFields){if(!arrFields)arrFields=[];var nStartPos=isUseSelection?this.Selection.StartPos<this.Selection.EndPos?this.Selection.StartPos: this.Selection.EndPos:0;var nEndPos=isUseSelection?this.Selection.StartPos<this.Selection.EndPos?this.Selection.EndPos:this.Selection.StartPos:this.Content.length-1;for(var nIndex=nStartPos;nIndex<=nEndPos;++nIndex)this.Content[nIndex].GetAllFields(isUseSelection,arrFields);return arrFields};CParagraphContentWithParagraphLikeContent.prototype.CanAddComment=function(){if(!this.Selection.Use)return true;var nStartPos=this.Selection.StartPos<=this.Selection.EndPos?this.Selection.StartPos:this.Selection.EndPos; var nEndPos=this.Selection.StartPos<=this.Selection.EndPos?this.Selection.EndPos:this.Selection.StartPos;for(var nPos=nStartPos;nPos<=nEndPos;++nPos)if(this.Content[nPos].CanAddComment&&!this.Content[nPos].CanAddComment())return false;return true};CParagraphContentWithParagraphLikeContent.prototype.CheckRunContent=function(fCheck){for(var nPos=0,nCount=this.Content.length;nPos<nCount;++nPos)if(this.Content[nPos].CheckRunContent(fCheck))return true;return false};CParagraphContentWithParagraphLikeContent.prototype.ProcessComplexFields= function(oComplexFields){for(var nPos=0,nCount=this.Content.length;nPos<nCount;++nPos)this.Content[nPos].ProcessComplexFields(oComplexFields)};CParagraphContentWithParagraphLikeContent.prototype.CorrectContentPos=function(){if(this.IsSelectionUse())return;var nCount=this.Content.length;var nCurPos=Math.min(Math.max(0,this.State.ContentPos),nCount-1);while(nCurPos>0&&!this.Content[nCurPos].IsCursorPlaceable()){nCurPos--;this.Content[nCurPos].MoveCursorToEndPos()}while(nCurPos<nCount&&!this.Content[nCurPos].IsCursorPlaceable()){nCurPos++; this.Content[nCurPos].MoveCursorToStartPos(false)}while(nCurPos>0&¶_Run!==this.Content[nCurPos].Type&¶_Math!==this.Content[nCurPos].Type&¶_Field!==this.Content[nCurPos].Type&¶_InlineLevelSdt!==this.Content[nCurPos].Type&&true===this.Content[nCurPos].Cursor_Is_Start()){if(!this.Content[nCurPos-1].IsCursorPlaceable())break;nCurPos--;this.Content[nCurPos].MoveCursorToEndPos()}while(nCurPos<nCount&¶_Run!==this.Content[nCurPos].Type&¶_Math!==this.Content[nCurPos].Type&¶_Field!== this.Content[nCurPos].Type&¶_InlineLevelSdt!==this.Content[nCurPos].Type&&true===this.Content[nCurPos].Cursor_Is_End()){if(!this.Content[nCurPos+1].IsCursorPlaceable())break;nCurPos++;this.Content[nCurPos].MoveCursorToStartPos(false)}this.State.ContentPos=nCurPos;this.Content[this.State.ContentPos].CorrectContentPos()};CParagraphContentWithParagraphLikeContent.prototype.GetFirstRun=function(){for(var nIndex=0,nCount=this.Content.length;nIndex<nCount;++nIndex){var oRun=this.Content[nIndex].GetFirstRun(); if(oRun)return oRun}return null};CParagraphContentWithParagraphLikeContent.prototype.MakeSingleRunElement=function(isClearRun){if(this.Content.length!==1||para_Run!==this.Content[0].Type){var oRun=new ParaRun(this.GetParagraph(),false);if(true!==isClearRun){var oParagraph=this.GetParagraph();var oCurrentRun=null;if(oParagraph){var oCurPos=oParagraph.Get_ParaContentPos(false,false,false);oCurPos.DecreaseDepth(1);oCurrentRun=oParagraph.GetClassByPos(oCurPos);if(!oCurrentRun||!(oCurrentRun instanceof ParaRun))oCurrentRun=null}var nNewCurPos=0;var isFirst=true;this.CheckRunContent(function(_oRun){if(_oRun===oCurrentRun)nNewCurPos=_oRun.State.ContentPos+oRun.Content.length;var arrContentToInsert=[];for(var nPos=0,nCount=_oRun.Content.length;nPos<nCount;++nPos)arrContentToInsert.push(_oRun.Content[nPos].Copy());oRun.ConcatToContent(arrContentToInsert);if(isFirst&&arrContentToInsert.length>0){oRun.SetPr(_oRun.GetDirectTextPr().Copy());isFirst=false}});oRun.State.ContentPos=nNewCurPos}if(this.Content.length> 0)this.RemoveFromContent(0,this.Content.length,true);this.AddToContent(0,oRun,true)}var oRun=this.Content[0];if(false!==isClearRun)oRun.ClearContent();return oRun};CParagraphContentWithParagraphLikeContent.prototype.ClearContent=function(){if(this.Content.length<=0)return;this.RemoveFromContent(0,this.Content.length,true)};CParagraphContentWithParagraphLikeContent.prototype.GetFirstRunElementPos=function(nType,oStartPos,oEndPos,nDepth){for(var nPos=0,nCount=this.Content.length;nPos<nCount;++nPos){oStartPos.Update(nPos, nDepth);oEndPos.Update(nPos,nDepth);if(this.Content[nPos].GetFirstRunElementPos(nType,oStartPos,oEndPos,nDepth+1))return true}return false};CParagraphContentWithParagraphLikeContent.prototype.SetIsRecalculated=function(isRecalculated){if(!isRecalculated&&this.GetParagraph())this.GetParagraph().SetIsRecalculated(false)};CParagraphContentWithParagraphLikeContent.prototype.Add=function(Item){if(undefined!==Item.Parent)Item.Parent=this;switch(Item.Type){case para_Run:case para_Hyperlink:case para_InlineLevelSdt:case para_Field:{var TextPr= this.Get_FirstTextPr();Item.SelectAll();Item.Apply_TextPr(TextPr);Item.RemoveSelection();var CurPos=this.State.ContentPos;var CurItem=this.Content[CurPos];if(para_Run===CurItem.Type){var NewRun=CurItem.Split2(CurItem.State.ContentPos);this.Add_ToContent(CurPos+1,Item);this.Add_ToContent(CurPos+2,NewRun);this.State.ContentPos=CurPos+2;this.Content[this.State.ContentPos].MoveCursorToStartPos()}else CurItem.Add(Item);break}case para_Math:{var ContentPos=new CParagraphContentPos;this.Get_ParaContentPos(false, false,ContentPos);var CurPos=ContentPos.Get(0);if(para_Run===this.Content[CurPos].Type){var NewElement=this.Content[CurPos].Split(ContentPos,1);if(null!==NewElement)this.Add_ToContent(CurPos+1,NewElement,true);var Elem=new ParaMath;Elem.Root.Load_FromMenu(Item.Menu,this.GetParagraph());Elem.Root.Correct_Content(true);this.Add_ToContent(CurPos+1,Elem,true);this.State.ContentPos=CurPos+1;this.Content[this.State.ContentPos].MoveCursorToEndPos(false)}else this.Content[CurPos].Add(Item);break}default:{this.Content[this.State.ContentPos].Add(Item); break}}};CParagraphContentWithParagraphLikeContent.prototype.Undo=function(Data){};CParagraphContentWithParagraphLikeContent.prototype.Redo=function(Data){};CParagraphContentWithParagraphLikeContent.prototype.Save_Changes=function(Data,Writer){};CParagraphContentWithParagraphLikeContent.prototype.Load_Changes=function(Reader){};CParagraphContentWithParagraphLikeContent.prototype.Write_ToBinary2=function(Writer){};CParagraphContentWithParagraphLikeContent.prototype.Read_FromBinary2=function(Reader){}; "use strict";function CParagraphBookmark(isStart,sBookmarkId,sBookmarkName){CParagraphContentBase.call(this);this.Id=AscCommon.g_oIdCounter.Get_NewId();this.Type=para_Bookmark;this.Start=isStart?true:false;this.BookmarkId=sBookmarkId;this.BookmarkName=sBookmarkName;this.Use=true;this.PageAbs=1;this.X=0;this.Y=0;AscCommon.g_oTableId.Add(this,this.Id)}CParagraphBookmark.prototype=Object.create(CParagraphContentBase.prototype);CParagraphBookmark.prototype.constructor=CParagraphBookmark;CParagraphBookmark.prototype.Get_Id= function(){return this.Id};CParagraphBookmark.prototype.GetId=function(){return this.Id};CParagraphBookmark.prototype.Copy=function(){return new CParagraphBookmark(this.Start,this.BookmarkId,this.BookmarkName)};CParagraphBookmark.prototype.GetBookmarkId=function(){return this.BookmarkId};CParagraphBookmark.prototype.GetBookmarkName=function(){return this.BookmarkName};CParagraphBookmark.prototype.IsUse=function(){return this.Use};CParagraphBookmark.prototype.SetUse=function(isUse){this.Use=isUse}; CParagraphBookmark.prototype.UpdateBookmarks=function(oManager){oManager.ProcessBookmarkChar(this)};CParagraphBookmark.prototype.IsStart=function(){return this.Start};CParagraphBookmark.prototype.Recalculate_Range=function(PRS,ParaPr){this.PageAbs=PRS.Paragraph.Get_AbsolutePage(PRS.Page);this.X=PRS.X;this.Y=PRS.Y};CParagraphBookmark.prototype.GetPage=function(){return this.PageAbs};CParagraphBookmark.prototype.GetXY=function(){return{X:this.X,Y:this.Y}};CParagraphBookmark.prototype.GoToBookmark=function(){var oParagraph= this.Paragraph;if(!oParagraph)return;var oLogicDocument=oParagraph.LogicDocument;if(!oLogicDocument)return;var oCurPos=oParagraph.Get_PosByElement(this);if(!oCurPos)return;oLogicDocument.RemoveSelection();oParagraph.Set_ParaContentPos(oCurPos,false,-1,-1,true);oParagraph.Document_SetThisElementCurrent(true)};CParagraphBookmark.prototype.GetDestinationXY=function(){var oParagraph=this.Paragraph;if(!oParagraph)return null;var oLogicDocument=oParagraph.LogicDocument;if(!oLogicDocument)return null;var oCurPos= oParagraph.Get_PosByElement(this);if(!oCurPos)return null;var oState=oParagraph.SaveSelectionState();oParagraph.Set_ParaContentPos(oCurPos,false,-1,-1,true);var oResult=oParagraph.GetCalculatedCurPosXY();oParagraph.LoadSelectionState(oState);return oResult};CParagraphBookmark.prototype.RemoveBookmark=function(){var oParagraph=this.Paragraph;if(!oParagraph)return;var oCurPos=oParagraph.Get_PosByElement(this);if(!oCurPos)return;var oParent=this.GetParent();var nPosInParent=this.GetPosInParent(oParent); if(!oParent||-1===nPosInParent)return;oParent.RemoveFromContent(nPosInParent,1)};CParagraphBookmark.prototype.ChangeBookmarkName=function(sNewName){var oParagraph=this.Paragraph;if(!oParagraph)return;var oCurPos=oParagraph.Get_PosByElement(this);if(!oCurPos)return;var oParent=this.GetParent();var nPosInParent=this.GetPosInParent(oParent);if(!oParent||-1===nPosInParent)return;var oNewMark=new CParagraphBookmark(this.IsStart(),this.GetBookmarkId(),sNewName);oParent.RemoveFromContent(nPosInParent,1); oParent.AddToContent(nPosInParent,oNewMark);return oNewMark};CParagraphBookmark.prototype.Refresh_RecalcData=function(){};CParagraphBookmark.prototype.Write_ToBinary2=function(Writer){Writer.WriteLong(AscDFH.historyitem_type_ParaBookmark);Writer.WriteString2(""+this.Id);Writer.WriteString2(""+this.BookmarkId);Writer.WriteString2(this.BookmarkName);Writer.WriteBool(this.Start)};CParagraphBookmark.prototype.Read_FromBinary2=function(Reader){this.Id=Reader.GetString2();this.BookmarkId=Reader.GetString2(); this.BookmarkName=Reader.GetString2();this.Start=Reader.GetBool()};function CBookmarksManager(oLogicDocument){this.LogicDocument=oLogicDocument;this.Bookmarks=[];this.BookmarksChars={};this.NeedUpdate=true;this.IdCounter=0;this.IdCounterTOC=0;this.IdCounterRef=0}CBookmarksManager.prototype.SetNeedUpdate=function(isNeed){this.NeedUpdate=isNeed};CBookmarksManager.prototype.IsNeedUpdate=function(){return this.NeedUpdate};CBookmarksManager.prototype.BeginCollectingProcess=function(){this.Bookmarks=[]; this.BookmarksChars={};this.IdCounter=0;this.IdCounterTOC=0;this.IdCounterRef=0};CBookmarksManager.prototype.ProcessBookmarkChar=function(oParaBookmark){if(!(oParaBookmark instanceof CParagraphBookmark))return;var sBookmarkId=oParaBookmark.GetBookmarkId();if(undefined!==this.BookmarksChars[sBookmarkId])if(oParaBookmark.IsStart())oParaBookmark.SetUse(false);else{this.BookmarksChars[sBookmarkId].SetUse(true);oParaBookmark.SetUse(true);this.Bookmarks.push([this.BookmarksChars[sBookmarkId],oParaBookmark]); delete this.BookmarksChars[sBookmarkId]}else if(!oParaBookmark.IsStart())oParaBookmark.SetUse(false);else this.BookmarksChars[sBookmarkId]=oParaBookmark;if(oParaBookmark.IsStart()){var sBookmarkName=oParaBookmark.GetBookmarkName();var nId;if(typeof sBookmarkName==="string")if(0===sBookmarkName.indexOf("_Toc")){nId=parseInt(sBookmarkName.substring(4));if(!isNaN(nId))this.IdCounterTOC=Math.max(this.IdCounterTOC,nId)}else if(0===sBookmarkName.indexOf("_Ref")){nId=parseInt(sBookmarkName.substring(4)); if(!isNaN(nId))this.IdCounterRef=Math.max(this.IdCounterRef,nId)}var nId=parseInt(sBookmarkId);if(!isNaN(nId))this.IdCounter=Math.max(this.IdCounter,nId)}};CBookmarksManager.prototype.EndCollectingProcess=function(){for(var sId in this.BookmarksChars)this.BookmarksChars[sId].SetUse(false);this.BookmarksChars={};this.NeedUpdate=false};CBookmarksManager.prototype.GetBookmarkById=function(Id){this.Update();for(var nIndex=0,nCount=this.Bookmarks.length;nIndex<nCount;++nIndex)if(this.Bookmarks[nIndex].GetBookmarkId()=== Id)return this.Bookmarks[nIndex];return null};CBookmarksManager.prototype.GetBookmarkByName=function(sName){var _sName=sName.toLowerCase();this.Update();for(var nIndex=0,nCount=this.Bookmarks.length;nIndex<nCount;++nIndex){var oStart=this.Bookmarks[nIndex][0];if(oStart.GetBookmarkName().toLowerCase()===_sName)return this.Bookmarks[nIndex]}return null};CBookmarksManager.prototype.HaveBookmark=function(sName){var _sName=sName.toLowerCase();this.Update();for(var nIndex=0,nCount=this.Bookmarks.length;nIndex< nCount;++nIndex){var oStart=this.Bookmarks[nIndex][0];if(oStart.GetBookmarkName().toLowerCase()===sName)return true}return false};CBookmarksManager.prototype.Update=function(){if(this.NeedUpdate)this.LogicDocument.UpdateBookmarks()};CBookmarksManager.prototype.GetNewBookmarkId=function(){this.Update();return""+ ++this.IdCounter};CBookmarksManager.prototype.GetNewBookmarkNameTOC=function(){this.Update();return"_Toc"+ ++this.IdCounterTOC};CBookmarksManager.prototype.GetNewBookmarkNameRef=function(){this.Update(); return"_Ref"+ ++this.IdCounterRef};CBookmarksManager.prototype.RemoveTOCBookmarks=function(){this.Update();for(var nIndex=0,nCount=this.Bookmarks.length;nIndex<nCount;++nIndex){var oStart=this.Bookmarks[nIndex][0];var oEnd=this.Bookmarks[nIndex][1];if(0===oStart.GetBookmarkName().toLowerCase().indexOf("_toc")){oStart.RemoveBookmark();oEnd.RemoveBookmark()}}};CBookmarksManager.prototype.GetCount=function(){this.Update();return this.Bookmarks.length};CBookmarksManager.prototype.GetName=function(nIndex){this.Update(); if(nIndex<0||this.Index>=this.Bookmarks.length)return"";return this.Bookmarks[nIndex][0].GetBookmarkName()};CBookmarksManager.prototype.GetId=function(nIndex){this.Update();if(nIndex<0||this.Index>=this.Bookmarks.length)return"";return this.Bookmarks[nIndex][0].GetBookmarkId()};CBookmarksManager.prototype.RemoveBookmark=function(sName){this.Update();if(!this.GetBookmarkByName(sName))return;this.LogicDocument.RemoveBookmark(sName)};CBookmarksManager.prototype.AddBookmark=function(sName){this.Update(); if(this.GetBookmarkByName(sName)){if(this.IsHiddenBookmark(sName))return;var sTempName="_temp_"+sName;this.LogicDocument.AddBookmark(sTempName);this.LogicDocument.RemoveBookmark(sName);this.NeedUpdate=true;var oBookmark=this.GetBookmarkByName(sTempName);if(oBookmark){this.NeedUpdate=true;oBookmark[0].ChangeBookmarkName(sName);oBookmark[1].ChangeBookmarkName(sName)}}else this.LogicDocument.AddBookmark(sName)};CBookmarksManager.prototype.GoToBookmark=function(sName){this.Update();var oBookmark=this.GetBookmarkByName(sName); if(oBookmark)oBookmark[0].GoToBookmark()};CBookmarksManager.prototype.IsHiddenBookmark=function(sName){return sName&&"_"===sName.charAt(0)};CBookmarksManager.prototype.IsInternalUseBookmark=function(sName){return sName==="_GoBack"};CBookmarksManager.prototype.CheckNewBookmarkName=function(sName){if(!sName)return false;return sName===XRegExp.match(sName,new XRegExp("(\\pL)(\\pL|_|\\pN){0,39}"))};CBookmarksManager.prototype.GetNameForHeadingBookmark=function(oParagraph){if(!oParagraph)return"";var sText= oParagraph.GetText();var nStartPos=0;while(nStartPos<sText.length){var nChar=sText.charCodeAt(nStartPos);if(32!==nChar&&9!==nChar)break;nStartPos++}var sName="";for(var nIndex=nStartPos,nLen=Math.min(sText.length,nStartPos+10);nIndex<nLen;++nIndex){var nChar=sText.charCodeAt(nIndex);if(32===nChar||9===nChar)sName+="_";else sName+=sText.charAt(nIndex)}if(!sName)return"";return"_"+sName};CBookmarksManager.prototype.SelectBookmark=function(sName){this.Update();var oBookmark=this.GetBookmarkByName(sName); if(oBookmark){if(!oBookmark[0].GetParagraph()||!oBookmark[1].GetParagraph()||!oBookmark[0].GetParagraph().Parent||!oBookmark[1].GetParagraph().Parent||oBookmark[0].GetParagraph().Parent.GetTopDocumentContent()!==oBookmark[1].GetParagraph().Parent.GetTopDocumentContent()){oBookmark[0].GoToBookmark();return false}var oTopDocument=oBookmark[0].GetParagraph().Parent.GetTopDocumentContent();var oLogicDocument=this.LogicDocument;oLogicDocument.RemoveSelection();oBookmark[0].GoToBookmark();var oStartPos= oTopDocument.GetContentPosition(false);oBookmark[1].GoToBookmark();var oEndPos=oTopDocument.GetContentPosition(false);oTopDocument.SetSelectionByContentPositions(oStartPos,oEndPos);oLogicDocument.UpdateSelection();oLogicDocument.UpdateInterface();return true}return false};window["AscCommonWord"]=window["AscCommonWord"]||{};window["AscCommonWord"].CParagraphBookmark=CParagraphBookmark;CBookmarksManager.prototype["asc_GetCount"]=CBookmarksManager.prototype.GetCount;CBookmarksManager.prototype["asc_GetName"]= CBookmarksManager.prototype.GetName;CBookmarksManager.prototype["asc_GetId"]=CBookmarksManager.prototype.GetId;CBookmarksManager.prototype["asc_AddBookmark"]=CBookmarksManager.prototype.AddBookmark;CBookmarksManager.prototype["asc_RemoveBookmark"]=CBookmarksManager.prototype.RemoveBookmark;CBookmarksManager.prototype["asc_GoToBookmark"]=CBookmarksManager.prototype.GoToBookmark;CBookmarksManager.prototype["asc_HaveBookmark"]=CBookmarksManager.prototype.HaveBookmark;CBookmarksManager.prototype["asc_IsHiddenBookmark"]= CBookmarksManager.prototype.IsHiddenBookmark;CBookmarksManager.prototype["asc_IsInternalUseBookmark"]=CBookmarksManager.prototype.IsInternalUseBookmark;CBookmarksManager.prototype["asc_CheckNewBookmarkName"]=CBookmarksManager.prototype.CheckNewBookmarkName;CBookmarksManager.prototype["asc_SelectBookmark"]=CBookmarksManager.prototype.SelectBookmark;"use strict";(function(window,undefined){var g_oTableId=AscCommon.g_oTableId;var History=AscCommon.History;function CCommentData(){this.m_sText="";this.m_sTime= "";this.m_sOOTime="";this.m_sUserId="";this.m_sProviderId="";this.m_sUserName="";this.m_sInitials="";this.m_sQuoteText=null;this.m_bSolved=false;this.m_nDurableId=null;this.m_aReplies=[];this.m_sUserData="";this.Copy=function(){var NewData=new CCommentData;NewData.m_sText=this.m_sText;NewData.m_sTime=this.m_sTime;NewData.m_sOOTime=this.m_sOOTime;NewData.m_sUserId=this.m_sUserId;NewData.m_sProviderId=this.m_sProviderId;NewData.m_sUserName=this.m_sUserName;NewData.m_sInitials=this.m_sInitials;NewData.m_sQuoteText= this.m_sQuoteText;NewData.m_bSolved=this.m_bSolved;NewData.m_nDurableId=this.m_nDurableId;NewData.m_sUserData=this.m_sUserData;var Count=this.m_aReplies.length;for(var Pos=0;Pos<Count;Pos++)NewData.m_aReplies.push(this.m_aReplies[Pos].Copy());return NewData};this.Add_Reply=function(CommentData){this.m_aReplies.push(CommentData)};this.Set_Text=function(Text){this.m_sText=Text};this.Get_Text=function(){return this.m_sText};this.Get_QuoteText=function(){return this.m_sQuoteText};this.Set_QuoteText=function(Quote){this.m_sQuoteText= Quote};this.Get_Solved=function(){return this.m_bSolved};this.Set_Solved=function(Solved){this.m_bSolved=Solved};this.Set_Name=function(Name){this.m_sUserName=Name};this.Get_Name=function(){return this.m_sUserName};this.Get_RepliesCount=function(){return this.m_aReplies.length};this.Get_Reply=function(Index){if(Index<0||Index>=this.m_aReplies.length)return null;return this.m_aReplies[Index]};this.Read_FromAscCommentData=function(AscCommentData){this.m_sText=AscCommentData.asc_getText();this.m_sTime= AscCommentData.asc_getTime();this.m_sOOTime=AscCommentData.asc_getOnlyOfficeTime();this.m_sUserId=AscCommentData.asc_getUserId();this.m_sProviderId=AscCommentData.asc_getProviderId();this.m_sQuoteText=AscCommentData.asc_getQuoteText();this.m_bSolved=AscCommentData.asc_getSolved();this.m_sUserName=AscCommentData.asc_getUserName();this.m_sInitials=AscCommentData.asc_getInitials();this.m_nDurableId=AscCommentData.asc_getDurableId();this.m_sUserData=AscCommentData.asc_getUserData();var RepliesCount=AscCommentData.asc_getRepliesCount(); for(var Index=0;Index<RepliesCount;Index++){var Reply=new CCommentData;Reply.Read_FromAscCommentData(AscCommentData.asc_getReply(Index));this.m_aReplies.push(Reply)}};this.Write_ToBinary2=function(Writer){var Count=this.m_aReplies.length;Writer.WriteString2(this.m_sText);Writer.WriteString2(this.m_sTime);Writer.WriteString2(this.m_sOOTime);Writer.WriteString2(this.m_sUserId);Writer.WriteString2(this.m_sProviderId);Writer.WriteString2(this.m_sUserName);Writer.WriteString2(this.m_sInitials);if(null=== this.m_nDurableId)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteULong(this.m_nDurableId)}if(null===this.m_sQuoteText)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteString2(this.m_sQuoteText)}Writer.WriteBool(this.m_bSolved);Writer.WriteString2(this.m_sUserData);Writer.WriteLong(Count);for(var Index=0;Index<Count;Index++)this.m_aReplies[Index].Write_ToBinary2(Writer)};this.Read_FromBinary2=function(Reader){this.m_sText=Reader.GetString2();this.m_sTime=Reader.GetString2(); this.m_sOOTime=Reader.GetString2();this.m_sUserId=Reader.GetString2();this.m_sProviderId=Reader.GetString2();this.m_sUserName=Reader.GetString2();this.m_sInitials=Reader.GetString2();if(true!=Reader.GetBool())this.m_nDurableId=Reader.GetULong();else this.m_nDurableId=null;var bNullQuote=Reader.GetBool();if(true!=bNullQuote)this.m_sQuoteText=Reader.GetString2();else this.m_sQuoteText=null;this.m_bSolved=Reader.GetBool();this.m_sUserData=Reader.GetString2();var Count=Reader.GetLong();this.m_aReplies.length= 0;for(var Index=0;Index<Count;Index++){var oReply=new CCommentData;oReply.Read_FromBinary2(Reader);this.m_aReplies.push(oReply)}}}CCommentData.prototype.GetUserName=function(){return this.m_sUserName};CCommentData.prototype.SetUserName=function(sUserName){this.m_sUserName=sUserName};CCommentData.prototype.GetDateTime=function(){var nTime=parseInt(this.m_sTime);if(isNaN(nTime))nTime=0;return nTime};CCommentData.prototype.GetRepliesCount=function(){return this.Get_RepliesCount()};CCommentData.prototype.GetReply= function(nIndex){return this.Get_Reply(nIndex)};CCommentData.prototype.GetText=function(){return this.Get_Text()};CCommentData.prototype.SetText=function(sText){this.m_sText=sText};CCommentData.prototype.GetQuoteText=function(){return this.Get_QuoteText()};CCommentData.prototype.SetQuoteText=function(sText){this.Set_QuoteText(sText)};CCommentData.prototype.IsSolved=function(){return this.m_bSolved};CCommentData.prototype.CreateNewCommentsGuid=function(){this.m_nDurableId=AscCommon.CreateDurableId(); for(var Pos=0;Pos<this.m_aReplies.length;Pos++)this.m_aReplies[Pos].CreateNewCommentsGuid()};CCommentData.prototype.GetUserData=function(){return this.m_sUserData};CCommentData.prototype.SetUserData=function(sData){this.m_sUserData=sData};CCommentData.prototype.ConvertToSimpleObject=function(){var obj={};obj["Text"]=this.m_sText;obj["Time"]=this.m_sTime;obj["UserName"]=this.m_sUserName;obj["QuoteText"]=this.m_sQuoteText;obj["Solved"]=this.m_bSolved;obj["UserData"]=this.m_sUserData;obj["Replies"]= [];for(var nIndex=0,nCount=this.m_aReplies.length;nIndex<nCount;++nIndex)obj["Replies"].push(this.m_aReplies[nIndex].ConvertToSimpleObject());return obj};CCommentData.prototype.ReadFromSimpleObject=function(oData){if(!oData)return;if(oData["Text"])this.m_sText=oData["Text"];if(oData["Time"])this.m_sTime=oData["Time"];if(oData["UserName"])this.m_sUserName=oData["UserName"];if(oData["Solved"])this.m_bSolved=oData["Solved"];if(oData["UserData"])this.m_sUserData=oData["UserData"];if(oData["Replies"]&& oData["Replies"].length)for(var nIndex=0,nCount=oData["Replies"].length;nIndex<nCount;++nIndex){var oCD=new CCommentData;oCD.ReadFromSimpleObject(oData["Replies"][nIndex]);this.m_aReplies.push(oCD)}};function CCommentDrawingRect(X,Y,W,H,CommentId,InvertTransform){this.X=X;this.Y=Y;this.H=H;this.W=W;this.CommentId=CommentId;this.InvertTransform=InvertTransform}var comment_type_Common=1;var comment_type_HdrFtr=2;function CComment(Parent,Data){this.Id=AscCommon.g_oIdCounter.Get_NewId();this.Parent=Parent; this.Data=Data;this.m_oTypeInfo={Type:comment_type_Common,Data:null};this.StartId=null;this.EndId=null;this.m_oStartInfo={X:0,Y:0,H:0,PageNum:0};this.Lock=new AscCommon.CLock;if(false===AscCommon.g_oIdCounter.m_bLoad){this.Lock.Set_Type(AscCommon.locktype_Mine,false);AscCommon.CollaborativeEditing.Add_Unlock2(this)}this.Copy=function(){return new CComment(this.Parent,this.Data.Copy())};this.Set_StartId=function(ObjId){this.StartId=ObjId};this.Set_EndId=function(ObjId){this.EndId=ObjId};this.Set_StartInfo= function(PageNum,X,Y,H){this.m_oStartInfo.X=X;this.m_oStartInfo.Y=Y;this.m_oStartInfo.H=H;this.m_oStartInfo.PageNum=PageNum};this.Set_Data=function(Data){History.Add(new CChangesCommentChange(this,this.Data,Data));this.Data=Data};this.Remove_Marks=function(){var ObjStart=g_oTableId.Get_ById(this.StartId);var ObjEnd=g_oTableId.Get_ById(this.EndId);if(ObjStart===ObjEnd){if(null!=ObjStart)ObjStart.RemoveCommentMarks(this.Id)}else{if(null!=ObjStart)ObjStart.RemoveCommentMarks(this.Id);if(null!=ObjEnd)ObjEnd.RemoveCommentMarks(this.Id)}}; this.Set_TypeInfo=function(Type,Data){var New={Type:Type,Data:Data};History.Add(new CChangesCommentTypeInfo(this,this.m_oTypeInfo,New));this.m_oTypeInfo=New;if(comment_type_HdrFtr===Type){var PageNum=Data.Content.Get_StartPage_Absolute();this.m_oStartInfo.PageNum=PageNum}};this.Get_TypeInfo=function(){return this.m_oTypeInfo};this.Refresh_RecalcData=function(Data){};this.Get_Id=function(){return this.Id};this.Write_ToBinary2=function(Writer){Writer.WriteLong(AscDFH.historyitem_type_Comment);Writer.WriteString2(this.Id); this.Data.Write_ToBinary2(Writer);Writer.WriteLong(this.m_oTypeInfo.Type);if(comment_type_HdrFtr===this.m_oTypeInfo.Type)Writer.WriteString2(this.m_oTypeInfo.Data.Get_Id())};this.Read_FromBinary2=function(Reader){this.Id=Reader.GetString2();this.Data=new CCommentData;this.Data.Read_FromBinary2(Reader);this.m_oTypeInfo.Type=Reader.GetLong();if(comment_type_HdrFtr===this.m_oTypeInfo.Type)this.m_oTypeInfo.Data=g_oTableId.Get_ById(Reader.GetString2())};this.Check_MergeData=function(arrAllParagraphs){this.Set_StartId(null); this.Set_EndId(null);var bStartSet=false,bEndSet=false;for(var nIndex=0,nCount=arrAllParagraphs.length;nIndex<nCount;++nIndex){var oPara=arrAllParagraphs[nIndex];var oResult=oPara.CheckCommentStartEnd(this.Id);if(true===oResult.Start){this.Set_StartId(oPara.Get_Id());bStartSet=true}if(true===oResult.End){this.Set_EndId(oPara.Get_Id());bEndSet=true}if(bStartSet&&bEndSet)break}var bUse=true;if(null!=this.StartId){var ObjStart=g_oTableId.Get_ById(this.StartId);if(true!=ObjStart.Is_UseInDocument())bUse= false}if(true===bUse&&null!=this.EndId){var ObjEnd=g_oTableId.Get_ById(this.EndId);if(true!=ObjEnd.Is_UseInDocument())bUse=false}if(false===bUse)editor.WordControl.m_oLogicDocument.RemoveComment(this.Id,true,false)};g_oTableId.Add(this,this.Id)}CComment.prototype.GetId=function(){return this.Id};CComment.prototype.GetData=function(){return this.Data};CComment.prototype.IsSolved=function(){if(this.Data)return this.Data.IsSolved();return false};CComment.prototype.IsGlobalComment=function(){return!this.Data|| null===this.Data.GetQuoteText()};CComment.prototype.GetDurableId=function(){if(this.Data)return this.Data.m_nDurableId;return-1};CComment.prototype.CreateNewCommentsGuid=function(){this.Data&&this.Data.CreateNewCommentsGuid()};CComment.prototype.IsCurrentUser=function(){var oEditor=editor;if(oEditor&&oEditor.DocInfo&&this.Data){var sUserId=oEditor.DocInfo.get_UserId();return sUserId===this.Data.m_sUserId}return true};CComment.prototype.MoveCursorToStart=function(){var oStartPara=g_oTableId.Get_ById(this.StartId); if(oStartPara&&oStartPara instanceof Paragraph)oStartPara.MoveCursorToCommentMark(this.Id)};var comments_NoComment=0;var comments_NonActiveComment=1;var comments_ActiveComment=2;function CComments(){this.Id=AscCommon.g_oIdCounter.Get_NewId();this.m_bUse=false;this.m_bUseSolved=false;this.m_aComments={};this.m_sCurrent=null;this.Pages=[];this.Get_Id=function(){return this.Id};this.Set_Use=function(Use){this.m_bUse=Use};this.Is_Use=function(){return this.m_bUse};this.Add=function(Comment){var Id=Comment.Get_Id(); History.Add(new CChangesCommentsAdd(this,Id,Comment));this.m_aComments[Id]=Comment};this.Get_ById=function(Id){if("undefined"!=typeof this.m_aComments[Id])return this.m_aComments[Id];return null};this.Remove_ById=function(Id){if("undefined"!=typeof this.m_aComments[Id]){History.Add(new CChangesCommentsRemove(this,Id,this.m_aComments[Id]));var Comment=this.m_aComments[Id];delete this.m_aComments[Id];Comment.Remove_Marks();return true}return false};this.Reset_Drawing=function(PageNum){this.Pages[PageNum]= []};this.Add_DrawingRect=function(X,Y,W,H,PageNum,arrCommentId,InvertTransform){this.Pages[PageNum].push(new CCommentDrawingRect(X,Y,W,H,arrCommentId,InvertTransform))};this.Set_Current=function(Id){this.m_sCurrent=Id};this.Get_ByXY=function(PageNum,X,Y){var Page=this.Pages[PageNum],_X,_Y;if(undefined!==Page){var Count=Page.length;for(var Pos=0;Pos<Count;Pos++){var DrawingRect=Page[Pos];if(!DrawingRect.InvertTransform){_X=X;_Y=Y}else{_X=DrawingRect.InvertTransform.TransformPointX(X,Y);_Y=DrawingRect.InvertTransform.TransformPointY(X, Y)}if(_X>=DrawingRect.X&&_X<=DrawingRect.X+DrawingRect.W&&_Y>=DrawingRect.Y&&_Y<=DrawingRect.Y+DrawingRect.H){var arrComments=[];for(var nCommentIndex=0,nCommentsCount=DrawingRect.CommentId.length;nCommentIndex<nCommentsCount;++nCommentIndex){var oComment=this.Get_ById(DrawingRect.CommentId[nCommentIndex]);if(oComment)arrComments.push(oComment)}return arrComments}}}return[]};this.Get_Current=function(){if(null!=this.m_sCurrent){var Comment=this.Get_ById(this.m_sCurrent);if(null!=Comment)return Comment}return null}; this.Get_CurrentId=function(){return this.m_sCurrent};this.Set_CommentData=function(Id,CommentData){var Comment=this.Get_ById(Id);if(null!=Comment)Comment.Set_Data(CommentData)};this.Check_MergeData=function(){var arrAllParagraphs=null;for(var Id in this.m_aComments){if(!arrAllParagraphs&&editor&&editor.WordControl.m_oLogicDocument)arrAllParagraphs=editor.WordControl.m_oLogicDocument.GetAllParagraphs({All:true});this.m_aComments[Id].Check_MergeData(arrAllParagraphs)}};this.Refresh_RecalcData=function(Data){}; g_oTableId.Add(this,this.Id)}CComments.prototype.GetAllComments=function(){return this.m_aComments};CComments.prototype.SetUseSolved=function(isUse){this.m_bUseSolved=isUse};CComments.prototype.IsUseSolved=function(){return this.m_bUseSolved};CComments.prototype.GetCommentIdByGuid=function(sGuid){var nDurableId=parseInt(sGuid,16);for(var sId in this.m_aComments)if(this.m_aComments[sId].GetDurableId()===nDurableId)return sId;return""};CComments.prototype.Document_Is_SelectionLocked=function(Id){if(Id instanceof Array)for(var nIndex=0,nCount=Id.length;nIndex<nCount;++nIndex){var sId=Id[nIndex];var oComment=this.Get_ById(sId);if(oComment)oComment.Lock.Check(oComment.GetId())}else{var oComment=this.Get_ById(Id);if(oComment)oComment.Lock.Check(oComment.GetId())}};CComments.prototype.GetById=function(sId){if(this.m_aComments[sId])return this.m_aComments[sId];return null};function ParaComment(Start,Id){CParagraphContentBase.call(this);this.Id=AscCommon.g_oIdCounter.Get_NewId();this.Paragraph=null;this.Start=Start; this.CommentId=Id;this.Type=para_Comment;this.StartLine=0;this.StartRange=0;this.Lines=[];this.LinesLength=0;g_oTableId.Add(this,this.Id)}ParaComment.prototype=Object.create(CParagraphContentBase.prototype);ParaComment.prototype.constructor=ParaComment;ParaComment.prototype.Get_Id=function(){return this.Id};ParaComment.prototype.GetId=function(){return this.Get_Id()};ParaComment.prototype.Copy=function(Selected){return new ParaComment(this.Start,this.CommentId)};ParaComment.prototype.Recalculate_Range_Spaces= function(PRSA,CurLine,CurRange,CurPage){var Para=PRSA.Paragraph;var DocumentComments=Para.LogicDocument.Comments;var Comment=DocumentComments.Get_ById(this.CommentId);if(null===Comment)return;var X=PRSA.X;var Y=Para.Pages[CurPage].Y+Para.Lines[CurLine].Y-Para.Lines[CurLine].Metrics.Ascent;var H=Para.Lines[CurLine].Metrics.Ascent+Para.Lines[CurLine].Metrics.Descent;var Page=Para.GetAbsolutePage(CurPage);if(comment_type_HdrFtr===Comment.m_oTypeInfo.Type){var HdrFtr=Comment.m_oTypeInfo.Data;if(-1!== HdrFtr.RecalcInfo.CurPage)Page=HdrFtr.RecalcInfo.CurPage}if(Para&&Para===AscCommon.g_oTableId.Get_ById(Para.Get_Id()))if(true===this.Start){Comment.Set_StartId(Para.Get_Id());Comment.Set_StartInfo(Page,X,Y,H)}else Comment.Set_EndId(Para.Get_Id())};ParaComment.prototype.Recalculate_PageEndInfo=function(PRSI,_CurLine,_CurRange){if(true===this.Start)PRSI.AddComment(this.CommentId);else PRSI.RemoveComment(this.CommentId)};ParaComment.prototype.RecalculateEndInfo=function(oPRSI){if(this.Start)oPRSI.AddComment(this.CommentId); else oPRSI.RemoveComment(this.CommentId)};ParaComment.prototype.SaveRecalculateObject=function(Copy){var RecalcObj=new CRunRecalculateObject(this.StartLine,this.StartRange);return RecalcObj};ParaComment.prototype.LoadRecalculateObject=function(RecalcObj,Parent){this.StartLine=RecalcObj.StartLine;this.StartRange=RecalcObj.StartRange;var PageNum=Parent.Get_StartPage_Absolute();var DocumentComments=editor.WordControl.m_oLogicDocument.Comments;var Comment=DocumentComments.Get_ById(this.CommentId);Comment.m_oStartInfo.PageNum= PageNum};ParaComment.prototype.PrepareRecalculateObject=function(){};ParaComment.prototype.Shift_Range=function(Dx,Dy,_CurLine,_CurRange){var DocumentComments=editor.WordControl.m_oLogicDocument.Comments;var Comment=DocumentComments.Get_ById(this.CommentId);if(null===Comment)return;if(true===this.Start){Comment.m_oStartInfo.X+=Dx;Comment.m_oStartInfo.Y+=Dy}};ParaComment.prototype.Draw_HighLights=function(PDSH){if(true===this.Start)PDSH.AddComment(this.CommentId);else PDSH.RemoveComment(this.CommentId)}; ParaComment.prototype.Refresh_RecalcData=function(){};ParaComment.prototype.Write_ToBinary2=function(Writer){Writer.WriteLong(AscDFH.historyitem_type_CommentMark);Writer.WriteString2(""+this.Id);Writer.WriteString2(""+this.CommentId);Writer.WriteBool(this.Start)};ParaComment.prototype.Read_FromBinary2=function(Reader){this.Id=Reader.GetString2();this.CommentId=Reader.GetString2();this.Start=Reader.GetBool()};ParaComment.prototype.SetCommentId=function(sCommentId){if(this.CommentId!==sCommentId){History.Add(new CChangesParaCommentCommentId(this, this.CommentId,sCommentId));this.CommentId=sCommentId}};ParaComment.prototype.GetCommentId=function(){return this.CommentId};ParaComment.prototype.IsCommentStart=function(){return this.Start};ParaComment.prototype.CheckRunContent=function(fCheck){return fCheck(this)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].comments_NoComment=comments_NoComment;window["AscCommon"].comments_NonActiveComment=comments_NonActiveComment;window["AscCommon"].comments_ActiveComment=comments_ActiveComment; window["AscCommon"].comment_type_Common=comment_type_Common;window["AscCommon"].comment_type_HdrFtr=comment_type_HdrFtr;window["AscCommon"].CCommentData=CCommentData;window["AscCommon"].CComments=CComments;window["AscCommon"].CComment=CComment;window["AscCommon"].ParaComment=ParaComment})(window);"use strict";AscDFH.changesFactory[AscDFH.historyitem_Comment_Change]=CChangesCommentChange;AscDFH.changesFactory[AscDFH.historyitem_Comment_TypeInfo]=CChangesCommentTypeInfo;AscDFH.changesFactory[AscDFH.historyitem_Comments_Add]= CChangesCommentsAdd;AscDFH.changesFactory[AscDFH.historyitem_Comments_Remove]=CChangesCommentsRemove;AscDFH.changesFactory[AscDFH.historyitem_ParaComment_CommentId]=CChangesParaCommentCommentId;AscDFH.changesRelationMap[AscDFH.historyitem_Comment_Change]=[AscDFH.historyitem_Comment_Change];AscDFH.changesRelationMap[AscDFH.historyitem_Comment_TypeInfo]=[AscDFH.historyitem_Comment_TypeInfo];AscDFH.changesRelationMap[AscDFH.historyitem_Comments_Add]=[AscDFH.historyitem_Comments_Add,AscDFH.historyitem_Comments_Remove]; AscDFH.changesRelationMap[AscDFH.historyitem_Comments_Remove]=[AscDFH.historyitem_Comments_Add,AscDFH.historyitem_Comments_Remove];AscDFH.changesRelationMap[AscDFH.historyitem_ParaComment_CommentId]=[AscDFH.historyitem_ParaComment_CommentId];function CChangesCommentChange(Class,Old,New){AscDFH.CChangesBaseProperty.call(this,Class,Old,New)}CChangesCommentChange.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesCommentChange.prototype.constructor=CChangesCommentChange;CChangesCommentChange.prototype.Type= AscDFH.historyitem_Comment_Change;CChangesCommentChange.prototype.WriteToBinary=function(Writer){this.New.Write_ToBinary2(Writer);this.Old.Write_ToBinary2(Writer)};CChangesCommentChange.prototype.ReadFromBinary=function(Reader){this.New=new AscCommon.CCommentData;this.Old=new AscCommon.CCommentData;this.New.Read_FromBinary2(Reader);this.Old.Read_FromBinary2(Reader)};CChangesCommentChange.prototype.private_SetValue=function(Value){this.Class.Data=Value;editor.sync_ChangeCommentData(this.Class.Id,Value)}; function CChangesCommentTypeInfo(Class,Old,New){AscDFH.CChangesBaseProperty.call(this,Class,Old,New)}CChangesCommentTypeInfo.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesCommentTypeInfo.prototype.constructor=CChangesCommentTypeInfo;CChangesCommentTypeInfo.prototype.Type=AscDFH.historyitem_Comment_TypeInfo;CChangesCommentTypeInfo.prototype.WriteToBinary=function(Writer){Writer.WriteLong(this.New.Type);if(AscCommon.comment_type_HdrFtr===this.New.Type)Writer.WriteString2(this.New.Data.Get_Id()); Writer.WriteLong(this.Old.Type);if(AscCommon.comment_type_HdrFtr===this.Old.Type)Writer.WriteString2(this.Old.Data.Get_Id())};CChangesCommentTypeInfo.prototype.ReadFromBinary=function(Reader){this.New={Type:0,Data:null};this.Old={Type:0,Data:null};this.New.Type=Reader.GetLong();if(AscCommon.comment_type_HdrFtr===this.New.Type)this.New.Data=AscCommon.g_oTableId.Get_ById(Reader.GetString2());this.Old.Type=Reader.GetLong();if(AscCommon.comment_type_HdrFtr===this.Old.Type)this.Old.Data=AscCommon.g_oTableId.Get_ById(Reader.GetString2())}; CChangesCommentTypeInfo.prototype.private_SetValue=function(Value){this.Class.m_oTypeInfo=Value};function CChangesCommentsAdd(Class,Id,Comment){AscDFH.CChangesBase.call(this,Class);this.Id=Id;this.Comment=Comment}CChangesCommentsAdd.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesCommentsAdd.prototype.constructor=CChangesCommentsAdd;CChangesCommentsAdd.prototype.Type=AscDFH.historyitem_Comments_Add;CChangesCommentsAdd.prototype.Undo=function(){var oComments=this.Class;delete oComments.m_aComments[this.Id]; editor.sync_RemoveComment(this.Id)};CChangesCommentsAdd.prototype.Redo=function(){this.Class.m_aComments[this.Id]=this.Comment;editor.sync_AddComment(this.Id,this.Comment.Data)};CChangesCommentsAdd.prototype.WriteToBinary=function(Writer){Writer.WriteString2(this.Id)};CChangesCommentsAdd.prototype.ReadFromBinary=function(Reader){this.Id=Reader.GetString2();this.Comment=AscCommon.g_oTableId.Get_ById(this.Id)};CChangesCommentsAdd.prototype.CreateReverseChange=function(){return new CChangesCommentsRemove(this.Class, this.Id,this.Comment)};CChangesCommentsAdd.prototype.Merge=function(oChange){if(this.Class!==oChange.Class)return true;if((AscDFH.historyitem_Comments_Add===oChange.Type||AscDFH.historyitem_Comments_Remove===oChange.Type)&&this.Id===oChange.Id)return false;return true};function CChangesCommentsRemove(Class,Id,Comment){AscDFH.CChangesBase.call(this,Class);this.Id=Id;this.Comment=Comment}CChangesCommentsRemove.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesCommentsRemove.prototype.constructor= CChangesCommentsRemove;CChangesCommentsRemove.prototype.Type=AscDFH.historyitem_Comments_Remove;CChangesCommentsRemove.prototype.Undo=function(){this.Class.m_aComments[this.Id]=this.Comment;editor.sync_AddComment(this.Id,this.Comment.Data)};CChangesCommentsRemove.prototype.Redo=function(){delete this.Class.m_aComments[this.Id];editor.sync_RemoveComment(this.Id)};CChangesCommentsRemove.prototype.WriteToBinary=function(Writer){Writer.WriteString2(this.Id)};CChangesCommentsRemove.prototype.ReadFromBinary= function(Reader){this.Id=Reader.GetString2();this.Comment=AscCommon.g_oTableId.Get_ById(this.Id)};CChangesCommentsRemove.prototype.CreateReverseChange=function(){return new CChangesCommentsAdd(this.Class,this.Id,this.Comment)};CChangesCommentsRemove.prototype.Merge=function(oChange){if(this.Class!==oChange.Class)return true;if((AscDFH.historyitem_Comments_Add===oChange.Type||AscDFH.historyitem_Comments_Remove===oChange.Type)&&this.Id===oChange.Id)return false;return true};function CChangesParaCommentCommentId(Class, Old,New){AscDFH.CChangesBaseProperty.call(this,Class,Old,New)}CChangesParaCommentCommentId.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaCommentCommentId.prototype.constructor=CChangesParaCommentCommentId;CChangesParaCommentCommentId.prototype.Type=AscDFH.historyitem_ParaComment_CommentId;CChangesParaCommentCommentId.prototype.WriteToBinary=function(Writer){Writer.WriteString2(this.New);Writer.WriteString2(this.Old)};CChangesParaCommentCommentId.prototype.ReadFromBinary= function(Reader){this.New=Reader.GetString2();this.Old=Reader.GetString2()};CChangesParaCommentCommentId.prototype.private_SetValue=function(Value){this.Class.CommentId=Value};CChangesParaCommentCommentId.prototype.Load=function(){this.Redo();var Comment=AscCommon.g_oTableId.Get_ById(this.New);if(null!==this.Class.Paragraph&&null!==Comment&&Comment instanceof AscCommon.CComment)if(true===this.Class.Start)Comment.Set_StartId(this.Class.Paragraph.Get_Id());else Comment.Set_EndId(this.Class.Paragraph.Get_Id())}; "use strict";var align_Left=AscCommon.align_Left;var align_Right=AscCommon.align_Right;var g_oTableId=AscCommon.g_oTableId;var History=AscCommon.History;var linerule_Auto=Asc.linerule_Auto;var c_oAscShdClear=Asc.c_oAscShdClear;var c_oAscShdNil=Asc.c_oAscShdNil;var c_oAscDropCap=Asc.c_oAscDropCap;var EvenAndOddHeaders=false;var Default_Tab_Stop=12.5;var Default_Heading_Font="Arial";var Default_Font="Arial";var highlight_None=-1;var smallcaps_Koef=.8;var smallcaps_and_script_koef=AscCommon.vaKSize* smallcaps_Koef;var g_dKoef_pt_to_mm=25.4/72;var g_dKoef_pc_to_mm=g_dKoef_pt_to_mm/12;var g_dKoef_in_to_mm=25.4;var g_dKoef_twips_to_mm=g_dKoef_pt_to_mm/20;var g_dKoef_emu_to_mm=1/36E3;var g_dKoef_mm_to_pt=1/g_dKoef_pt_to_mm;var g_dKoef_mm_to_twips=1/g_dKoef_twips_to_mm;var g_dKoef_mm_to_emu=36E3;var tblwidth_Auto=0;var tblwidth_Mm=1;var tblwidth_Nil=2;var tblwidth_Pct=3;var tbllayout_Fixed=0;var tbllayout_AutoFit=1;var border_None=0;var border_Single=1;var vertalignjc_Top=0;var vertalignjc_Center= 1;var vertalignjc_Bottom=2;var vmerge_Restart=1;var vmerge_Continue=2;var spacing_Auto=-1;var styletype_Paragraph=1;var styletype_Numbering=2;var styletype_Table=3;var styletype_Character=4;var textdirection_LRTB=0;var textdirection_TBRL=1;var textdirection_BTLR=2;var textdirection_LRTBV=3;var textdirection_TBRLV=4;var textdirection_TBLRV=5;function IsEqualStyleObjects(Object1,Object2){if(undefined===Object1&&undefined===Object2)return true;if(undefined===Object1||undefined===Object2)return false; return Object1.Is_Equal(Object2)}function IsEqualNullableFloatNumbers(nNum1,nNum2){if(undefined===nNum1&&undefined===nNum2)return true;if(undefined===nNum1||undefined===nNum2)return false;return Math.abs(nNum1-nNum2)<.001}function CheckUndefinedToNull(isConvert,Value){return true===isConvert&&undefined===Value?null:Value}function CTableStylePr(){this.TextPr=new CTextPr;this.ParaPr=new CParaPr;this.TablePr=new CTablePr;this.TableRowPr=new CTableRowPr;this.TableCellPr=new CTableCellPr}CTableStylePr.prototype= {Merge:function(TableStylePr){this.TextPr.Merge(TableStylePr.TextPr);this.ParaPr.Merge(TableStylePr.ParaPr);this.TablePr.Merge(TableStylePr.TablePr);this.TableRowPr.Merge(TableStylePr.TableRowPr);this.TableCellPr.Merge(TableStylePr.TableCellPr)},Copy:function(oPr){var TableStylePr=new CTableStylePr;TableStylePr.TextPr=this.TextPr.Copy(undefined,oPr);TableStylePr.ParaPr=this.ParaPr.Copy(undefined,oPr);TableStylePr.TablePr=this.TablePr.Copy();TableStylePr.TableRowPr=this.TableRowPr.Copy();TableStylePr.TableCellPr= this.TableCellPr.Copy();return TableStylePr},Is_Equal:function(TableStylePr){if(true!==this.TextPr.Is_Equal(TableStylePr.TextPr)||true!==this.ParaPr.Is_Equal(TableStylePr.ParaPr)||true!==this.TablePr.Is_Equal(TableStylePr.TablePr)||true!==this.TableRowPr.Is_Equal(TableStylePr.TableRowPr)||true!==this.TableCellPr.Is_Equal(TableStylePr.TableCellPr))return false;return false},Check_PresentationPr:function(Theme){this.TextPr.Check_PresentationPr();this.TableCellPr.Check_PresentationPr(Theme)},Set_FromObject:function(Obj){if(undefined!= Obj.TextPr)this.TextPr.Set_FromObject(Obj.TextPr);if(undefined!=Obj.ParaPr)this.ParaPr.Set_FromObject(Obj.ParaPr);if(undefined!=Obj.TablePr)this.TablePr.Set_FromObject(Obj.TablePr);if(undefined!=Obj.TableRowPr)this.TableRowPr.Set_FromObject(Obj.TableRowPr);if(undefined!=Obj.TableCellPr)this.TableCellPr.Set_FromObject(Obj.TableCellPr)},Write_ToBinary:function(Writer){this.TextPr.Write_ToBinary(Writer);this.ParaPr.Write_ToBinary(Writer);this.TablePr.Write_ToBinary(Writer);this.TableRowPr.Write_ToBinary(Writer); this.TableCellPr.Write_ToBinary(Writer)},Read_FromBinary:function(Reader){this.TextPr.Read_FromBinary(Reader);this.ParaPr.Read_FromBinary(Reader);this.TablePr.Read_FromBinary(Reader);this.TableRowPr.Read_FromBinary(Reader);this.TableCellPr.Read_FromBinary(Reader)},InitDefault:function(){this.TextPr.InitDefault();this.ParaPr.InitDefault();this.TablePr.InitDefault();this.TableRowPr.InitDefault();this.TableCellPr.InitDefault()}};function CStyle(Name,BasedOnId,NextId,type,bNoCreateTablePr){this.Id=AscCommon.g_oIdCounter.Get_NewId(); this.Name=Name;this.BasedOn=BasedOnId;this.Next=NextId;this.Type=null!=type?type:styletype_Paragraph;this.Link=null;this.Custom=false;this.qFormat=null;this.uiPriority=null;this.hidden=null;this.semiHidden=null;this.unhideWhenUsed=null;this.TextPr=new CTextPr;this.ParaPr=new CParaPr;this.TablePr=new CTablePr;this.TableRowPr=new CTableRowPr;this.TableCellPr=new CTableCellPr;if(bNoCreateTablePr!==true){this.TableBand1Horz=new CTableStylePr;this.TableBand1Vert=new CTableStylePr;this.TableBand2Horz=new CTableStylePr; this.TableBand2Vert=new CTableStylePr;this.TableFirstCol=new CTableStylePr;this.TableFirstRow=new CTableStylePr;this.TableLastCol=new CTableStylePr;this.TableLastRow=new CTableStylePr;this.TableTLCell=new CTableStylePr;this.TableTRCell=new CTableStylePr;this.TableBLCell=new CTableStylePr;this.TableBRCell=new CTableStylePr;this.TableWholeTable=new CTableStylePr}g_oTableId.Add(this,this.Id)}CStyle.prototype={GetId:function(){return this.Id},Get_Id:function(){return this.GetId()},Copy:function(){var Style= new CStyle;Style.Name=this.Name;Style.BasedOn=this.BasedOn;Style.Next=this.Next;Style.Type=this.Type;Style.qFormat=this.qFormat;Style.uiPriority=this.uiPriority;Style.hidden=this.hidden;Style.semiHidden=this.semiHidden;Style.unhideWhenUsed=this.unhideWhenUsed;Style.TextPr=this.TextPr.Copy();Style.ParaPr=this.ParaPr.Copy();Style.TablePr=this.TablePr.Copy();Style.TablePr=this.TablePr.Copy();Style.TableRowPr=this.TableRowPr.Copy();Style.TableCellPr=this.TableCellPr.Copy();if(undefined!==this.TableBand1Horz){Style.TableBand1Horz= this.TableBand1Horz.Copy();Style.TableBand1Vert=this.TableBand1Vert.Copy();Style.TableBand2Horz=this.TableBand2Horz.Copy();Style.TableBand2Vert=this.TableBand2Vert.Copy();Style.TableFirstCol=this.TableFirstCol.Copy();Style.TableFirstRow=this.TableFirstRow.Copy();Style.TableLastCol=this.TableLastCol.Copy();Style.TableLastRow=this.TableLastRow.Copy();Style.TableTLCell=this.TableTLCell.Copy();Style.TableTRCell=this.TableTRCell.Copy();Style.TableBLCell=this.TableBLCell.Copy();Style.TableBRCell=this.TableBRCell.Copy(); Style.TableWholeTable=this.TableWholeTable.Copy()}return Style},RemapIdReferences:function(OldId,NewId){if(OldId===this.BasedOn)this.Set_BasedOn(NewId);if(OldId===this.Link)this.Set_Link(NewId);if(OldId===this.Next)this.Set_Next(NewId)},Set_TextPr:function(Value){var Old=this.TextPr;var New=new CTextPr;New.Set_FromObject(Value);this.TextPr=New;History.Add(new CChangesStyleTextPr(this,Old,New))},Set_ParaPr:function(Value,isHandleNumbering){var Old=this.ParaPr;var New=new CParaPr;New.Set_FromObject(Value); if(isHandleNumbering&&Value.NumPr instanceof CNumPr&&Value.NumPr.IsValid()){var oLogicDocument=editor.WordControl.m_oLogicDocument;if(oLogicDocument){var oNumbering=oLogicDocument.GetNumbering();var oNum=oNumbering.GetNum(Value.NumPr.NumId);if(oNum){var oNumLvl=oNum.GetLvl(Value.NumPr.Lvl).Copy();oNumLvl.SetPStyle(this.GetId());oNum.SetLvl(oNumLvl,Value.NumPr.Lvl);New.NumPr=new CNumPr(Value.NumPr.NumId)}}}this.ParaPr=New;History.Add(new CChangesStyleParaPr(this,Old,New))},Set_TablePr:function(Value){var Old= this.TablePr;var New=new CTablePr;New.Set_FromObject(Value);this.TablePr=New;History.Add(new CChangesStyleTablePr(this,Old,New))},Set_TableRowPr:function(Value){var Old=this.TableRowPr;var New=new CTableRowPr;New.Set_FromObject(Value);this.TableRowPr=New;History.Add(new CChangesStyleTableRowPr(this,Old,New))},Set_TableCellPr:function(Value){var Old=this.TableCellPr;var New=new CTableCellPr;New.Set_FromObject(Value);this.TableCellPr=New;History.Add(new CChangesStyleTableCellPr(this,Old,New))},Set_TableBand1Horz:function(Value){var Old= this.TableBand1Horz;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableBand1Horz=New;History.Add(new CChangesStyleTableBand1Horz(this,Old,New))},Set_TableBand1Vert:function(Value){var Old=this.TableBand1Vert;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableBand1Vert=New;History.Add(new CChangesStyleTableBand1Vert(this,Old,New))},Set_TableBand2Horz:function(Value){var Old=this.TableBand2Horz;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableBand2Horz=New;History.Add(new CChangesStyleTableBand2Horz(this, Old,New))},Set_TableBand2Vert:function(Value){var Old=this.TableBand2Vert;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableBand2Vert=New;History.Add(new CChangesStyleTableBand2Vert(this,Old,New))},Set_TableFirstCol:function(Value){var Old=this.TableFirstCol;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableFirstCol=New;History.Add(new CChangesStyleTableFirstCol(this,Old,New))},Set_TableFirstRow:function(Value){var Old=this.TableFirstRow;var New=new CTableStylePr;New.Set_FromObject(Value); this.TableFirstRow=New;History.Add(new CChangesStyleTableFirstRow(this,Old,New))},Set_TableLastCol:function(Value){var Old=this.TableLastCol;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableLastCol=New;History.Add(new CChangesStyleTableLastCol(this,Old,New))},Set_TableLastRow:function(Value){var Old=this.TableLastRow;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableLastRow=New;History.Add(new CChangesStyleTableLastRow(this,Old,New))},Set_TableTLCell:function(Value){var Old= this.TableTLCell;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableTLCell=New;History.Add(new CChangesStyleTableTLCell(this,Old,New))},Set_TableTRCell:function(Value){var Old=this.TableTRCell;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableTRCell=New;History.Add(new CChangesStyleTableTRCell(this,Old,New))},Set_TableBLCell:function(Value){var Old=this.TableBLCell;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableBLCell=New;History.Add(new CChangesStyleTableBLCell(this, Old,New))},Set_TableBRCell:function(Value){var Old=this.TableBRCell;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableBRCell=New;History.Add(new CChangesStyleTableBRCell(this,Old,New))},Set_TableWholeTable:function(Value){var Old=this.TableWholeTable;var New=new CTableStylePr;New.Set_FromObject(Value);this.TableWholeTable=New;History.Add(new CChangesStyleTableWholeTable(this,Old,New))},Set_Name:function(Value){History.Add(new CChangesStyleName(this,this.Name,Value));this.Name=Value},Get_Name:function(){return this.Name}, Set_BasedOn:function(Value){History.Add(new CChangesStyleBasedOn(this,this.BasedOn,Value));this.BasedOn=Value},Get_BasedOn:function(){return this.BasedOn},Set_Next:function(Value){History.Add(new CChangesStyleNext(this,this.Next,Value));this.Next=Value},Get_Next:function(){return this.Next},Set_Link:function(Value){History.Add(new CChangesStyleLink(this,this.Link,Value));this.Link=Value},Get_Link:function(){return this.Link},Set_Type:function(Value){History.Add(new CChangesStyleType(this,this.Type, Value));this.Type=Value},Get_Type:function(){return this.Type},Set_QFormat:function(Value){History.Add(new CChangesStyleQFormat(this,this.qFormat,Value));this.qFormat=Value},Set_UiPriority:function(Value){History.Add(new CChangesStyleUiPriority(this,this.uiPriority,Value));this.uiPriority=Value},Set_Hidden:function(Value){History.Add(new CChangesStyleHidden(this,this.hidden,Value));this.hidden=Value},Set_SemiHidden:function(Value){History.Add(new CChangesStyleSemiHidden(this,this.semiHidden,Value)); this.semiHidden=Value},Set_UnhideWhenUsed:function(Value){History.Add(new CChangesStyleUnhideWhenUsed(this,this.unhideWhenUsed,Value));this.unhideWhenUsed=Value},Clear:function(Name,BasedOnId,NextId,Type){this.Set_Name(Name);this.Set_BasedOn(BasedOnId);this.Set_Next(NextId);this.Set_Type(Type);if(undefined!=this.Link&&null!=this.Link)this.Set_Link(null);if(undefined!=this.qFormat&&null!=this.qFormat)this.Set_QFormat(null);if(undefined!=this.uiPriority&&null!=this.uiPriority)this.Set_UiPriority(null); if(undefined!=this.hidden&&null!=this.hidden)this.Set_Hidden(null);if(undefined!=this.semiHidden&&null!=this.semiHidden)this.Set_SemiHidden(null);if(undefined!=this.unhideWhenUsed&&null!=this.unhideWhenUsed)this.Set_UnhideWhenUsed(null);this.Set_TextPr(new CTextPr);this.Set_ParaPr(new CParaPr);this.Set_TablePr(new CTablePr);this.Set_TableRowPr(new CTableRowPr);this.Set_TableCellPr(new CTableCellPr);if(undefined!=this.TableBand1Horz)this.Set_TableBand1Horz(new CTableStylePr);if(undefined!=this.TableBand1Vert)this.Set_TableBand1Vert(new CTableStylePr); if(undefined!=this.TableBand2Horz)this.Set_TableBand2Horz(new CTableStylePr);if(undefined!=this.TableBand2Vert)this.Set_TableBand2Vert(new CTableStylePr);if(undefined!=this.TableFirstCol)this.Set_TableFirstCol(new CTableStylePr);if(undefined!=this.TableFirstRow)this.Set_TableFirstRow(new CTableStylePr);if(undefined!=this.TableLastCol)this.Set_TableLastCol(new CTableStylePr);if(undefined!=this.TableLastRow)this.Set_TableLastRow(new CTableStylePr);if(undefined!=this.TableTLCell)this.Set_TableTLCell(new CTableStylePr); if(undefined!=this.TableTRCell)this.Set_TableTRCell(new CTableStylePr);if(undefined!=this.TableBLCell)this.Set_TableBLCell(new CTableStylePr);if(undefined!=this.TableBRCell)this.Set_TableBRCell(new CTableStylePr);if(undefined!=this.TableWholeTable)this.Set_TableWholeTable(new CTableStylePr)},Document_Get_AllFontNames:function(AllFonts){if(undefined!=this.TextPr)this.TextPr.Document_Get_AllFontNames(AllFonts)},private_CreateDefaultUnifillColor:function(){var Unifill=new AscFormat.CUniFill;Unifill.fill= new AscFormat.CSolidFill;Unifill.fill.color=AscFormat.builder_CreateSchemeColor("tx1");return Unifill},Create_NormalTable:function(){var TablePr={TableInd:0,TableCellMar:{Top:{W:0,Type:tblwidth_Mm},Left:{W:1.9,Type:tblwidth_Mm},Bottom:{W:0,Type:tblwidth_Mm},Right:{W:1.9,Type:tblwidth_Mm}}};this.Set_UiPriority(99);this.Set_SemiHidden(true);this.Set_UnhideWhenUsed(true);this.Set_TablePr(TablePr)},Create_TableGrid:function(){var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto}};var TablePr={TableInd:0, TableBorders:{Top:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single},Left:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single},Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single},Right:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single},InsideH:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single},InsideV:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single}}, TableCellMar:{Top:{W:0,Type:tblwidth_Mm},Left:{W:1.9,Type:tblwidth_Mm},Bottom:{W:0,Type:tblwidth_Mm},Right:{W:1.9,Type:tblwidth_Mm}}};this.Set_UiPriority(59);this.Set_TablePr(TablePr);this.Set_ParaPr(ParaPr)},Create_Table_LightShading:function(){this.uiPriority=60;var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto}};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Top:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single},Bottom:{Color:{r:0, g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single}},TableCellMar:{Top:{W:0,Type:tblwidth_Mm},Left:{W:5.75*g_dKoef_pt_to_mm,Type:tblwidth_Mm},Bottom:{W:0,Type:tblwidth_Mm},Right:{W:5.75*g_dKoef_pt_to_mm,Type:tblwidth_Mm}}};var TableFirstRow={TextPr:{Bold:true,Color:{r:255,g:255,b:255}},ParaPr:{Spacing:{After:0,Before:0,Line:1,LineRule:linerule_Auto}},TableCellPr:{TableCellBorders:{Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single},Left:{Value:border_None}, Right:{Value:border_None},Top:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single}},Shd:{Value:c_oAscShdClear,Color:{r:79,g:129,b:189}}}};var TableLastRow={TextPr:{Color:{r:0,g:0,b:0}},TableCellPr:{TableCellBorders:{Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single},Left:{Value:border_None},Right:{Value:border_None},Top:{Color:{r:0,g:0,b:0},Space:0,Size:12/8*g_dKoef_pt_to_mm,Value:border_Single}},Shd:{Value:c_oAscShdClear,Color:{r:255,g:255, b:255}}}};var TableFirstCol={TextPr:{Bold:true,Color:{r:255,g:255,b:255}},ParaPr:{Spacing:{After:0,Before:0,Line:1,LineRule:linerule_Auto}},TableCellPr:{TableCellBorder:{Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single},Left:{Value:border_None},Right:{Value:border_None},Top:{Value:border_None}},Shd:{Value:c_oAscShdClear,Color:{r:79,g:129,b:189}}}};var TableLastCol={TextPr:{Bold:true,Color:{r:255,g:255,b:255}},TableCellPr:{TableCellBorders:{Left:{Value:border_None}, Right:{Value:border_None}},Shd:{Value:c_oAscShdClear,Color:{r:79,g:129,b:189}}}};var TableBand1Vert={TableCellPr:{TableCellBorders:{Left:{Value:border_None},Right:{Value:border_None}},Shd:{Value:c_oAscShdClear,Color:{r:216,g:216,b:216}}}};var TableBand1Horz={TableCellPr:{Shd:{Value:c_oAscShdClear,Color:{r:216,g:216,b:216}}}};var TableTRCell={TableCellPr:{TableCellBorders:{Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single},Left:{Value:border_None},Right:{Value:border_None}, Top:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single}},Shd:{Value:c_oAscShdClear,Color:{r:0,g:255,b:0}}}};var TableTLCell={TextPr:{Color:{r:255,g:255,b:255}},TableCellPr:{TableCellBorders:{Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single},Left:{Value:border_None},Right:{Value:border_None},Top:{Color:{r:0,g:0,b:0},Space:0,Size:18/8*g_dKoef_pt_to_mm,Value:border_Single}},Shd:{Value:c_oAscShdClear,Color:{r:255,g:0,b:0}}}};this.Set_UiPriority(60); this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand1Vert(TableBand1Vert);this.Set_TableTRCell(TableTRCell);this.Set_TableTLCell(TableTLCell)},Create_Table_ColorfulListAccent6:function(){this.uiPriority=72;var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto}};var TextPr={Color:{r:0,g:0,b:0}}; var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableCellMar:{TableCellMar:{Top:{W:0,Type:tblwidth_Mm},Left:{W:5.75*g_dKoef_pt_to_mm,Type:tblwidth_Mm},Bottom:{W:0,Type:tblwidth_Mm},Right:{W:5.75*g_dKoef_pt_to_mm,Type:tblwidth_Mm}}}};var TableCellPr={Shd:{Value:c_oAscShdClear,Color:{r:254,g:244,b:236}}};var TableFirstRow={TextPr:{Bold:true,Color:{r:255,g:255,b:255}},TableCellPr:{TableCellBorders:{Bottom:{Color:{r:255,g:255,b:255},Space:0,Size:12/8*g_dKoef_pt_to_mm,Value:border_Single}}, Shd:{Value:c_oAscShdClear,Color:{r:52,g:141,b:165}}}};var TableLastRow={TextPr:{Bold:true,Color:{r:52,g:141,b:165}},TableCellPr:{TableCellBorders:{Top:{Color:{r:0,g:0,b:0},Space:0,Size:12/8*g_dKoef_pt_to_mm,Value:border_Single}},Shd:{Value:c_oAscShdClear,Color:{r:255,g:255,b:255}}}};var TableFirstCol={TextPr:{Bold:true}};var TableLastCol={TextPr:{Bold:true}};var TableBand1Vert={TableCellPr:{TableCellBorders:{Top:{Value:border_None},Left:{Value:border_None},Bottom:{Value:border_None},Right:{Value:border_None}, InsideH:{Value:border_None},InsideV:{Value:border_None}},Shd:{Value:c_oAscShdClear,Color:{r:253,g:228,b:208}}}};var TableBand1Horz={TableCellPr:{TableCellBorders:{Top:{Value:border_None},Left:{Value:border_None},Bottom:{Value:border_None},Right:{Value:border_None},InsideH:{Value:border_None},InsideV:{Value:border_None}},Shd:{Value:c_oAscShdClear,Color:{r:253,g:233,b:217}}}};this.Set_UiPriority(72);this.Set_ParaPr(ParaPr);this.Set_TextPr(TextPr);this.Set_TablePr(TablePr);this.Set_TableCellPr(TableCellPr); this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand1Vert(TableBand1Vert)},Create_Table_Lined:function(unifill1,unifill2){var TextColor1=new CDocumentColor(242,242,242,false);var TextFont1={Name:"Arial",Index:-1};var TextSize1=11;var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=unifill1;var CellShd2=new CDocumentShd;CellShd2.Value= c_oAscShdClear;CellShd2.Unifill=unifill2;var TableStylePrBoundary={TextPr:{RFonts:{Ascii:TextFont1,HAnsi:TextFont1},Color:TextColor1,FontSize:TextSize1},TableCellPr:{Shd:CellShd1}};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0, Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TextPr={Color:{r:64,g:64,b:64}};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0};var TableStylePrBand1={TextPr:{RFonts:{Ascii:TextFont1,HAnsi:TextFont1},Color:{r:64,g:64,b:64},FontSize:TextSize1}};var TableStylePrBand2={TextPr:{RFonts:{Ascii:TextFont1,HAnsi:TextFont1},Color:{r:64,g:64,b:64},FontSize:TextSize1},TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr); this.Set_TextPr(TextPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableStylePrBoundary);this.Set_TableLastRow(TableStylePrBoundary);this.Set_TableFirstCol(TableStylePrBoundary);this.Set_TableLastCol(TableStylePrBoundary);this.Set_TableBand1Horz(TableStylePrBand1);this.Set_TableBand1Vert(TableStylePrBand1);this.Set_TableBand2Horz(TableStylePrBand2);this.Set_TableBand2Vert(TableStylePrBand2)},Create_TableGrid_Light:function(oBorderUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear; CellShd1.Unifill=oBorderUnifill;var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto}};var TablePr={TableInd:0,TableBorders:{Top:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},Left:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},Right:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm, Value:border_Single,Unifill:CellShd1.Unifill},InsideH:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},InsideV:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill}},TableCellMar:{Top:{W:0,Type:tblwidth_Mm},Left:{W:1.9,Type:tblwidth_Mm},Bottom:{W:0,Type:tblwidth_Mm},Right:{W:1.9,Type:tblwidth_Mm}}};this.Set_UiPriority(59);this.Set_TablePr(TablePr);this.Set_ParaPr(ParaPr)},Create_Table_Plain_1:function(oBorderUnifill, oBandUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto}};var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11,Bold:true};var TablePr={TableInd:0,TableBorders:{Top:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single, Unifill:CellShd1.Unifill},Left:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},Right:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},InsideH:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},InsideV:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm, Value:border_Single,Unifill:CellShd1.Unifill}},TableCellMar:{Top:{W:0,Type:tblwidth_Mm},Left:{W:1.9,Type:tblwidth_Mm},Bottom:{W:0,Type:tblwidth_Mm},Right:{W:1.9,Type:tblwidth_Mm}}};var TableBand1={TableCellPr:{Shd:CellShd2}};var TableText={TextPr:TableTextPr};this.Set_UiPriority(59);this.Set_TablePr(TablePr);this.Set_ParaPr(ParaPr);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1);this.Set_TableFirstRow(TableText);this.Set_TableLastRow(TableText);this.Set_TableFirstCol(TableText); this.Set_TableLastCol(TableText)},Create_Table_Plain_2:function(oBorderUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill;var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11,Bold:true};var TablePr={TableInd:0, TableBorders:{Top:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},Left:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_None,Unifill:CellShd1.Unifill},Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_Single,Unifill:CellShd1.Unifill},Right:{Color:{r:0,g:0,b:0},Space:0,Size:.5*g_dKoef_pt_to_mm,Value:border_None,Unifill:CellShd1.Unifill}},TableCellMar:{Top:{W:0,Type:tblwidth_Mm},Left:{W:1.9,Type:tblwidth_Mm}, Bottom:{W:0,Type:tblwidth_Mm},Right:{W:1.9,Type:tblwidth_Mm}}};var TableBand1Horz={TableCellPr:{TableCellBorders:{Top:TableBorder1,Bottom:TableBorder1}}};var TableBand1Vert={TableCellPr:{TableCellBorders:{Left:TableBorder1,Right:TableBorder1}}};var TableCol={TextPr:TableTextPr};var TableFirstRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder1,Bottom:TableBorder1}}};var TableLastRow={TextPr:TableTextPr,TableCellBorders:{Top:TableBorder1}};this.Set_UiPriority(59);this.Set_TablePr(TablePr); this.Set_ParaPr(ParaPr);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand1Vert(TableBand1Vert);this.Set_TableBand2Vert(TableBand1Vert);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol)},Create_Table_Plain_3:function(oBorderUnifill,oBandUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill= oBandUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true,Caps:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0, Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:64,g:64,b:64},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_None,Size:.5*g_dKoef_pt_to_mm,Space:0};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder1, Left:TableBorder2}}};var TableLastRow={TextPr:TableTextPr1,TableCellPr:{}};var TableFirstCol={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Left:TableBorder2,Right:TableBorder1,Top:TableBorder2,Bottom:TableBorder2}}};var TableLastCol={TextPr:TableTextPr1,TableCellPr:{}};var TableBand1={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol); this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_Plain_4:function(oBandUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBandUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0, g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0};var TableStyle={TextPr:TableTextPr1};var TableBand1={TextPr:TableTextPr,TableCellPr:{Shd:CellShd1}}; this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableStyle);this.Set_TableLastRow(TableStyle);this.Set_TableFirstCol(TableStyle);this.Set_TableLastCol(TableStyle);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_Plain_5:function(oTableCellUnifill,oBandUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oTableCellUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear; CellShd2.Unifill=oBandUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Italic:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0, g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:64,g:64,b:64},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_None,Size:.5*g_dKoef_pt_to_mm,Space:0};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder2,Bottom:TableBorder1,Left:TableBorder2}, Shd:CellShd1}};var TableLastRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Top:TableBorder1,Right:TableBorder2,Left:TableBorder2},Shd:CellShd1}};var TableFirstCol={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder1},Shd:CellShd1},ParaPr:{Jc:align_Right}};var TableLastCol={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Left:TableBorder1},Shd:CellShd1}};var TableBand1={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr); this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_Grid_1:function(oFirstRowBottomBorderUnifill,oBorderUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oFirstRowBottomBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBorderUnifill;var TableTextPr= {RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}, Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:1.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd2.Unifill};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Top:TableBorder2,Left:TableBorder2,Bottom:TableBorder2,Right:TableBorder2,InsideH:TableBorder2,InsideV:TableBorder2}}; var TableLastRow={TextPr:TableTextPr1};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Bottom:TableBorder1}}};var TableStyle={TextPr:TableTextPr1};var TableBand1Horz={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder2,Left:TableBorder2,Bottom:TableBorder2,Right:TableBorder2,InsideH:TableBorder2,InsideV:TableBorder2}}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow); this.Set_TableFirstCol(TableStyle);this.Set_TableLastCol(TableStyle);this.Set_TableBand1Horz(TableBand1Horz)},Create_Table_Grid_2:function(oBorderUnifill,oBandUniFill,oTableCellUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUniFill;var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oTableCellUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial", Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0, b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_Single,Size:1.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder3={Color:{r:0,g:0,b:0},Value:border_None,Size:.5*g_dKoef_pt_to_mm,Space:0};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Bottom:TableBorder1,InsideH:TableBorder1, InsideV:TableBorder1}};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder3,Top:TableBorder3,Bottom:TableBorder2,Left:TableBorder3},Shd:CellShd3}};var TableLastRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder3,Top:TableBorder1,Bottom:TableBorder3,Left:TableBorder3},Shd:CellShd3}};var TableCol={TextPr:TableTextPr1};var TableBand1={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr); this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_Grid_3:function(oBorderUnifill,oBandUnifill,oTableCellUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var CellShd3=new CDocumentShd;CellShd3.Value= c_oAscShdClear;CellShd3.Unifill=oTableCellUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}, Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TextColumnPr={Color:{r:64,g:64,b:64},Italic:true};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_None,Size:.5*g_dKoef_pt_to_mm,Space:0};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Bottom:TableBorder1, InsideH:TableBorder1,InsideV:TableBorder1}};var TableRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder2,Left:TableBorder2},Shd:CellShd3}};var TableFirstCol={TextPr:TextColumnPr,TableCellPr:{Shd:{Color:{r:255,g:255,b:255}},TableCellBorders:{Left:TableBorder2,Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder2}},ParaPr:{Jc:align_Right}};var TableLastCol={TextPr:TextColumnPr,TableCellPr:{Shd:{Color:{r:255,g:255,b:255}},TableCellBorders:{Left:TableBorder2, Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder2}}};var TableBand1={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableRow);this.Set_TableLastRow(TableRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_Grid_4:function(oHeaderUnifill,oBandUnifill,oBorderUnifill){var CellShd1=new CDocumentShd; CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oHeaderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oBorderUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true};var TableTextPr2={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}}, Color:{r:255,g:255,b:255},FontSize:11,Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0, g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd3.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder3={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5001*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Left:TableBorder1,Right:TableBorder1,Top:TableBorder1,Bottom:TableBorder1,InsideH:TableBorder1, InsideV:TableBorder1}};var TableFirstRow={TextPr:TableTextPr2,TableCellPr:{Shd:CellShd1,TableCellBorders:{Right:TableBorder2,Left:TableBorder2,Bottom:TableBorder2,Top:TableBorder2}}};var TableLastRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Top:TableBorder3}}};var TableCol={TextPr:TableTextPr1};var TableBand1={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(59);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow); this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_Grid_5:function(oHeaderUnifill,oTableCellUnifill,oBorderUnifill,oBandUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oHeaderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oTableCellUnifill;var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oBorderUnifill; var CellShd4=new CDocumentShd;CellShd4.Value=c_oAscShdClear;CellShd4.Unifill=oBandUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:255,g:255,b:255},Bold:true,FontSize:11};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0, g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd3.Unifill};var TablePr={TextPr:TableTextPr,TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,Shd:CellShd2,TableBorders:{Left:TableBorder1, Right:TableBorder1,Top:TableBorder1,Bottom:TableBorder1,InsideH:TableBorder1,InsideV:TableBorder1}};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{Shd:CellShd1}};var TableCol={TextPr:TableTextPr1,TableCellPr:{Shd:CellShd1}};var TableLastRow={TextPr:TableTextPr1,TableCellPr:{Shd:CellShd1,TableCellBorders:{Top:TableBorder1}}};var TableBand1Horz={TableCellPr:{Shd:CellShd4}};var TableBand1Vert={TableCellPr:{Shd:CellShd4}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr); this.Set_TableFirstRow(TableFirstRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastRow(TableLastRow);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand1Vert(TableBand1Vert)},Create_Table_Grid_6:function(oBorderUnifill,oBandUnifill,oTextUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var CellShd3=new CDocumentShd; CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oTextUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11,Unifill:CellShd3.Unifill};var TableTextPr1={Unifill:CellShd3.Unifill,Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true}, Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_Single,Size:1.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Bottom:TableBorder1, InsideH:TableBorder1,InsideV:TableBorder1,Top:TableBorder1,Left:TableBorder1,Right:TableBorder1}};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Bottom:TableBorder2}}};var TableLastRow={TextPr:TableTextPr1};var TableCol={TextPr:TableTextPr1};var TableBand1Horz={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};var TableBand1Vert={TableCellPr:{Shd:CellShd2}};var TableBand2Horz={TextPr:TableTextPr};var TableWholeTable={TextPr:TableTextPr};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr); this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand2Horz(TableBand2Horz);this.Set_TableBand1Vert(TableBand1Vert);this.Set_TableWholeTable(TableWholeTable)},Create_Table_Grid_7:function(oBorderUnifill,oBandUnifill,oTableCellUnifill,oTextUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill; var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oTableCellUnifill;var CellShd4=new CDocumentShd;CellShd4.Value=c_oAscShdClear;CellShd4.Unifill=oTextUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Unifill:CellShd4.Unifill,Bold:true,FontSize:11};var TableTextPr1={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Unifill:CellShd4.Unifill, Italic:true,FontSize:11};var TableTextPr2={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Unifill:CellShd4.Unifill,FontSize:11};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}, Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Value:border_None};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Bottom:TableBorder1,InsideH:TableBorder1,InsideV:TableBorder1,Right:TableBorder1}};var TableFirstRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Right:TableBorder2,Top:TableBorder2, Bottom:TableBorder1,Left:TableBorder2},Shd:CellShd3}};var TableLastRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder1,Bottom:TableBorder2,Right:TableBorder2,Left:TableBorder2},Shd:CellShd3}};var TableFirstCol={TextPr:TableTextPr1,TableCellPr:{Shd:{Color:{r:255,g:255,b:255}},TableCellBorders:{Left:TableBorder2,Right:TableBorder1,Top:TableBorder2,Bottom:TableBorder2}},ParaPr:{Jc:align_Right}};var TableLastCol={TextPr:TableTextPr1,TableCellPr:{Shd:{Color:{r:255,g:255,b:255}},TableCellBorders:{Left:TableBorder1, Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder2}}};var TableBand1Horz={TextPr:TableTextPr2,TableCellPr:{Shd:CellShd2}};var TableBand2Horz={TextPr:TableTextPr2};var TableBand1Vert={TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand2Horz(TableBand2Horz); this.Set_TableBand1Vert(TableBand1Vert)},Create_Table_List_1:function(oBorderUnifill,oBandUnifill,oTableCellUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oTableCellUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64}, FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1= {Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_None,Size:.5*g_dKoef_pt_to_mm,Space:0};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder1,Left:TableBorder2}}};var TableLastRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder2,Top:TableBorder1, Bottom:TableBorder2,Left:TableBorder2}}};var TableCol={TextPr:TableTextPr1};var TableBand1={TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_List_2:function(unifill1,oBandUnifill){var CellShd1=new CDocumentShd;CellShd1.Value= c_oAscShdClear;CellShd1.Unifill=unifill1;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11,Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0, Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_None,Size:.5*g_dKoef_pt_to_mm, Space:0};var TablePr={TextPr:TableTextPr,TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{InsideH:TableBorder1,Bottom:TableBorder1,Top:TableBorder1}};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder2,Top:TableBorder1,Bottom:TableBorder1,Left:TableBorder2}}};var TableLastRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder2,Bottom:TableBorder1,Top:TableBorder1,Left:TableBorder2}}};var TableCol={TextPr:TableTextPr1}; var TableBand1={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_List_3:function(oHeaderUnifill,oBorderUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oHeaderUnifill; var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBorderUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true};var TextFirstRowPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:255,g:255,b:255},FontSize:11,Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true}, Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0, TableBorders:{Left:TableBorder1,Right:TableBorder1,Top:TableBorder1,Bottom:TableBorder1}};var TableFirstRow={TextPr:TextFirstRowPr,TableCellPr:{Shd:CellShd1}};var TableLastRow={TextPr:TableTextPr1};var TableCol={TextPr:TableTextPr1};var TableBand1Vert={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Left:TableBorder1,Right:TableBorder1}}};var TableBand1Horz={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder1,Bottom:TableBorder1}}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr); this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand1Vert(TableBand1Vert)},Create_Table_List_4:function(oHeaderUnifill,oBandUnifill,oBorderUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oHeaderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill; var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oBorderUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableTextPr1={Color:{r:64,g:64,b:64},Bold:true};var TextFirstRowPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:255,g:255,b:255},FontSize:11,Bold:true};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true}, Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5* g_dKoef_pt_to_mm,Space:0,Unifill:CellShd3.Unifill};var TablePr={TextPr:TableTextPr,TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Left:TableBorder2,Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder2,InsideH:TableBorder2}};var TableFirstRow={TextPr:TextFirstRowPr,TableCellPr:{Shd:CellShd1}};var TableLastRow={TextPr:TableTextPr1};var TableCol={TextPr:TableTextPr1};var TableBand1={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr); this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1);this.Set_TableBand1Vert(TableBand1)},Create_Table_List_5:function(oTableCellUnifill,oBorderUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oTableCellUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBorderUnifill;var TableTextPr= {RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Unifill:CellShd2.Unifill,FontSize:11};var TableTextPr1={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},FontSize:11,Bold:true,Unifill:CellShd2.Unifill};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Unifill:CellShd1.Unifill,Space:0,Size:0,Value:border_Single},Bottom:{Color:{r:0,g:0, b:0,Auto:true},Unifill:CellShd1.Unifill,Space:0,Size:0,Value:border_Single},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_Single},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:4*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_Single,Size:1.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd2.Unifill};var TableBorder3={Color:{r:0,g:0,b:0},Value:border_Single, Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd2.Unifill};var TablePr={TextPr:TableTextPr,Shd:CellShd1,TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Left:TableBorder1,Right:TableBorder1,Top:TableBorder1,Bottom:TableBorder1}};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{Shd:CellShd1,TableCellBorders:{Bottom:TableBorder2,Top:TableBorder1}}};var TableLastRow={TextPr:TableTextPr1};var TableFirstCol={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Right:TableBorder3, Left:TableBorder1}}};var TableLastCol={TableCellPr:{TableCellBorders:{Left:TableBorder3,Right:TableBorder1}}};var TableBand1Horz={TableCellPr:{Shd:CellShd1,TableCellBorders:{Top:TableBorder3,Bottom:TableBorder3}}};var TableBand2Horz={TableCellPr:{Shd:CellShd1,TableCellBorders:{Top:TableBorder3,Bottom:TableBorder3}}};var TableBand1Vert={TableCellPr:{Shd:CellShd1,TableCellBorders:{Left:TableBorder3,Right:TableBorder3}}};var TableBand2Vert={Shd:CellShd1,TableCellPr:{TableCellBorders:{Left:TableBorder3, Right:TableBorder3}}};var TableWholeTable={TextPr:TableTextPr};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand2Horz(TableBand2Horz);this.Set_TableBand1Vert(TableBand1Vert);this.Set_TableBand2Vert(TableBand2Vert);this.Set_TableWholeTable(TableWholeTable)},Create_Table_List_6:function(oBorderUnifill, oBandUnifill,oTextUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oTextUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11,Unifill:CellShd3.Unifill};var TableTextPr1={Unifill:CellShd3.Unifill,Bold:true};var ParaPr= {Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0, Unifill:CellShd1.Unifill};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Bottom:TableBorder1,Top:TableBorder1}};var TableFirstRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Bottom:TableBorder1}}};var TableLastRow={TextPr:TableTextPr1,TableCellPr:{TableCellBorders:{Top:TableBorder1}}};var TableCol={TextPr:TableTextPr1};var TableBand1Horz={TextPr:TableTextPr,TableCellPr:{Shd:CellShd2}};var TableBand1Vert={TableCellPr:{Shd:CellShd2}};var TableBand2Horz= {TextPr:TableTextPr};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableCol);this.Set_TableLastCol(TableCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand2Horz(TableBand2Horz);this.Set_TableBand1Vert(TableBand1Vert)},Create_Table_List_7:function(oBorderUnifill,oBandUnifill,oTableTextUnifill,oTextUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear; CellShd1.Unifill=oBorderUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oBandUnifill;var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oTableTextUnifill;var CellShd4=new CDocumentShd;CellShd4.Value=c_oAscShdClear;CellShd4.Unifill=oTextUnifill;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Unifill:CellShd4.Unifill,Italic:true,FontSize:11};var TableTextPr1={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial", Index:-1}},Unifill:CellShd4.Unifill,FontSize:11};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TableBorder1={Color:{r:0, g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TableBorder2={Value:border_None};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Right:TableBorder1}};var TableFirstRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder1,Left:TableBorder2},Shd:CellShd3}};var TableLastRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder1,Bottom:TableBorder2,Right:TableBorder2, Left:TableBorder2},Shd:CellShd3}};var TableFirstCol={TextPr:TableTextPr,TableCellPr:{Shd:{Color:{r:255,g:255,b:255}},TableCellBorders:{Left:TableBorder2,Right:TableBorder1,Top:TableBorder2,Bottom:TableBorder2}},ParaPr:{Jc:align_Right}};var TableLastCol={TextPr:TableTextPr,TableCellPr:{Shd:{Color:{r:255,g:255,b:255}},TableCellBorders:{Left:TableBorder1,Right:TableBorder2,Top:TableBorder2,Bottom:TableBorder2}}};var TableBand1Horz={TextPr:TableTextPr1,TableCellPr:{Shd:CellShd2}};var TableBand1Vert={TableCellPr:{Shd:CellShd2}}; var TableBand2Horz={TextPr:TableTextPr1};var TableWholeTable={TextPr:TableTextPr1};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand2Horz(TableBand2Horz);this.Set_TableBand1Vert(TableBand1Vert);this.Set_TableWholeTable(TableWholeTable)},Create_Table_BorderedAndLined:function(oBorderFillUnifill, oHorBandUniFill,oVertBandUnifill,oBorderUnifill){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=oBorderFillUnifill;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=oHorBandUniFill;var CellShd3=new CDocumentShd;CellShd3.Value=c_oAscShdClear;CellShd3.Unifill=oVertBandUnifill;var TextPr1={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:242,g:242,b:242},FontSize:11};var TextPr2={RFonts:{Ascii:{Name:"Arial",Index:-1}, HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var TableCellPr1={Shd:CellShd1};var TableCellPrVert={Shd:CellShd2};var TableCellPrHorz={Shd:CellShd2};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0, Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TextPr={Color:{r:64,g:64,b:64}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:oBorderUnifill};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Top:TableBorder1,Left:TableBorder1,Bottom:TableBorder1,Right:TableBorder1,InsideH:TableBorder1,InsideV:TableBorder1}};var TableFirstRow={TextPr:TextPr1,TableCellPr:TableCellPr1}; var TableLastRow={TextPr:TextPr1,TableCellPr:TableCellPr1};var TableFirstCol={TextPr:TextPr1,TableCellPr:TableCellPr1};var TableLastCol={TextPr:TextPr1,TableCellPr:TableCellPr1};var TableBand1Vert={TextPr:TextPr2};var TableBand2Vert={TextPr:TextPr2,TableCellPr:TableCellPrVert};var TableBand1Horz={TextPr:TextPr2};var TableBand2Horz={TextPr:TextPr2,TableCellPr:TableCellPrHorz};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TextPr(TextPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow); this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1Horz);this.Set_TableBand1Vert(TableBand1Vert);this.Set_TableBand2Horz(TableBand2Horz);this.Set_TableBand2Vert(TableBand2Vert)},Create_Grid_Table_Light:function(unifill1,unifill2){var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=unifill1;var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=unifill2;var TableTextPr= {RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0, Size:0,Value:border_None}}};var TextPr={Color:{r:64,g:64,b:64}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd2.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_Single,Size:1.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{Top:TableBorder1,Left:TableBorder1,Bottom:TableBorder1,Right:TableBorder1,InsideH:TableBorder1,InsideV:TableBorder1}}; var TableFirstRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Bottom:TableBorder2}}};var TableLastRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder2}}};var TableFirstCol={TextPr:TableTextPr,TableCellPr:{}};var TableLastCol={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Left:TableBorder2}}};var TableBand1Horz={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder1,Left:TableBorder1,Bottom:TableBorder1,Right:TableBorder1,InsideH:TableBorder1,InsideV:TableBorder1}}}; this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1Horz)},Create_Grid_Table:function(unifill1,unifill2){var TextColor1=new CDocumentColor(242,242,242,false);var TextFont1={Name:"Arial",Index:-1};var TextSize1=11;var CellShd1=new CDocumentShd;CellShd1.Value=c_oAscShdClear;CellShd1.Unifill=unifill1; var CellShd2=new CDocumentShd;CellShd2.Value=c_oAscShdClear;CellShd2.Unifill=unifill2;var TableTextPr={RFonts:{Ascii:{Name:"Arial",Index:-1},HAnsi:{Name:"Arial",Index:-1}},Color:{r:64,g:64,b:64},FontSize:11};var ParaPr={Spacing:{After:0,Line:1,LineRule:linerule_Auto},Borders:{Top:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Left:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Bottom:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Right:{Color:{r:0, g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None},Between:{Color:{r:0,g:0,b:0,Auto:true},Space:0,Size:0,Value:border_None}}};var TextPr={Color:{r:64,g:64,b:64}};var TableBorder1={Color:{r:0,g:0,b:0},Value:border_Single,Size:.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd2.Unifill};var TableBorder2={Color:{r:0,g:0,b:0},Value:border_Single,Size:1.5*g_dKoef_pt_to_mm,Space:0,Unifill:CellShd1.Unifill};var TablePr={TableStyleColBandSize:1,TableStyleRowBandSize:1,TableInd:0,TableBorders:{},TableCellMar:{Top:new CTableMeasurement(tblwidth_Mm, 4.8*g_dKoef_pt_to_mm),Left:new CTableMeasurement(tblwidth_Mm,8.5*g_dKoef_pt_to_mm),Bottom:new CTableMeasurement(tblwidth_Mm,4.8*g_dKoef_pt_to_mm),Right:new CTableMeasurement(tblwidth_Mm,8.5*g_dKoef_pt_to_mm)}};var TableFirstRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Bottom:TableBorder2}}};var TableLastRow={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder2}}};var TableFirstCol={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Right:TableBorder2}}};var TableLastCol={TextPr:TableTextPr, TableCellPr:{TableCellBorders:{Left:TableBorder2}}};var TableBand1Horz={TextPr:TableTextPr,TableCellPr:{TableCellBorders:{Top:TableBorder1,Left:TableBorder1,Bottom:TableBorder1,Right:TableBorder1,InsideH:TableBorder1,InsideV:TableBorder1}}};this.Set_UiPriority(99);this.Set_ParaPr(ParaPr);this.Set_TablePr(TablePr);this.Set_TableFirstRow(TableFirstRow);this.Set_TableLastRow(TableLastRow);this.Set_TableFirstCol(TableFirstCol);this.Set_TableLastCol(TableLastCol);this.Set_TableBand1Horz(TableBand1Horz)}, isEqual:function(cStyles){var result=false;if(this.BasedOn==cStyles.BasedOn&&this.Name==cStyles.Name&&this.Next==cStyles.Next&&this.Type==cStyles.Type&&this.hidden==cStyles.hidden)if(this.qFormat==cStyles.qFormat&&this.semiHidden==cStyles.semiHidden&&this.uiPriority==cStyles.uiPriority&&this.unhideWhenUsed==cStyles.unhideWhenUsed){var isEqualParaPr=this.ParaPr.isEqual(this.ParaPr,cStyles.ParaPr);var isEqualTextPr=this.TextPr.isEqual(this.TextPr,cStyles.TextPr);if(isEqualParaPr&&isEqualTextPr)result= true}return result},Is_Equal:function(oStyle){if(oStyle.Name!=this.Name||this.BasedOn!==oStyle.BasedOn||this.Next!==oStyle.Next||this.Type!==oStyle.Type||this.Link!==oStyle.Link||this.qFormat!==oStyle.qFormat||this.uiPriority!==oStyle.uiPriority||this.hidden!==oStyle.hidden||this.semiHidden!==oStyle.semiHidden||this.unhideWhenUsed!==oStyle.unhideWhenUsed||true!==this.TextPr.Is_Equal(oStyle.TextPr)||true!==this.ParaPr.Is_Equal(oStyle.ParaPr)||styletype_Table===this.Type&&(true!==this.TablePr.Is_Equal(oStyle.TablePr)|| true!==this.TableRowPr.Is_Equal(oStyle.TableRowPr)||true!==this.TableCellPr.Is_Equal(oStyle.TableCellPr)||true!==IsEqualStyleObjects(this.TableBand1Horz,oStyle.TableBand1Horz)||true!==IsEqualStyleObjects(this.TableBand1Vert,oStyle.TableBand1Vert)||true!==IsEqualStyleObjects(this.TableBand2Horz,oStyle.TableBand2Horz)||true!==IsEqualStyleObjects(this.TableBand2Vert,oStyle.TableBand2Vert)||true!==IsEqualStyleObjects(this.TableFirstCol,oStyle.TableFirstCol)||true!==IsEqualStyleObjects(this.TableFirstRow, oStyle.TableFirstRow)||true!==IsEqualStyleObjects(this.TableLastCol,oStyle.TableLastCol)||true!==IsEqualStyleObjects(this.TableLastRow,oStyle.TableLastRow)||true!==IsEqualStyleObjects(this.TableTLCell,oStyle.TableTLCell)||true!==IsEqualStyleObjects(this.TableTRCell,oStyle.TableTRCell)||true!==IsEqualStyleObjects(this.TableBLCell,oStyle.TableBLCell)||true!==IsEqualStyleObjects(this.TableBRCell,oStyle.TableBRCell)||true!==IsEqualStyleObjects(this.TableWholeTable,oStyle.TableWholeTable)))return false; return true},GetSelectionState:function(){},SetSelectionState:function(State,StateIndex){},Get_ParentObject_or_DocumentPos:function(){return{Type:AscDFH.historyitem_recalctype_Inline,Data:0}},Refresh_RecalcData:function(Data){var Type=Data.Type;var bNeedRecalc=false;switch(Type){case AscDFH.historyitem_Style_TextPr:case AscDFH.historyitem_Style_ParaPr:case AscDFH.historyitem_Style_TablePr:case AscDFH.historyitem_Style_TableRowPr:case AscDFH.historyitem_Style_TableCellPr:case AscDFH.historyitem_Style_TableBand1Horz:case AscDFH.historyitem_Style_TableBand1Vert:case AscDFH.historyitem_Style_TableBand2Horz:case AscDFH.historyitem_Style_TableBand2Vert:case AscDFH.historyitem_Style_TableFirstCol:case AscDFH.historyitem_Style_TableFirstRow:case AscDFH.historyitem_Style_TableLastCol:case AscDFH.historyitem_Style_TableLastRow:case AscDFH.historyitem_Style_TableTLCell:case AscDFH.historyitem_Style_TableTRCell:case AscDFH.historyitem_Style_TableBLCell:case AscDFH.historyitem_Style_TableBRCell:case AscDFH.historyitem_Style_TableWholeTable:case AscDFH.historyitem_Style_Name:case AscDFH.historyitem_Style_BasedOn:case AscDFH.historyitem_Style_Next:case AscDFH.historyitem_Style_Type:case AscDFH.historyitem_Style_QFormat:case AscDFH.historyitem_Style_UiPriority:case AscDFH.historyitem_Style_Hidden:case AscDFH.historyitem_Style_SemiHidden:case AscDFH.historyitem_Style_UnhideWhenUsed:case AscDFH.historyitem_Style_Link:{bNeedRecalc= true;break}}if(true===bNeedRecalc)return this.Refresh_RecalcData2()},Refresh_RecalcData2:function(){var oHistory=History;if(!oHistory)return;if(!oHistory.AddChangedStyleToRecalculateData(this.Get_Id(),this))return},RecalculateRelatedParagraphs:function(){var oHistory=History;if(!oHistory)return;var LogicDocument=editor.WordControl.m_oLogicDocument;var Styles=LogicDocument.Get_Styles();var AllParagraphs=[];if(this.Id!=Styles.Default.Paragraph){var AllStylesId=Styles.private_GetAllBasedStylesId(this.Id); AllParagraphs=oHistory.GetAllParagraphsForRecalcData({Style:true,StylesId:AllStylesId});LogicDocument.Add_ChangedStyle(AllStylesId)}else{AllParagraphs=oHistory.GetAllParagraphsForRecalcData({All:true});LogicDocument.Add_ChangedStyle([this.Id])}var Count=AllParagraphs.length;for(var Index=0;Index<Count;Index++){var Para=AllParagraphs[Index];Para.Refresh_RecalcData({Type:AscDFH.historyitem_Paragraph_PStyle})}},Write_ToBinary2:function(Writer){Writer.WriteLong(AscDFH.historyitem_type_Style);Writer.WriteString2(this.Id); this.private_WriteUndefinedNullString(Writer,this.Name);this.private_WriteUndefinedNullString(Writer,this.BasedOn);this.private_WriteUndefinedNullString(Writer,this.Next);Writer.WriteLong(this.Type);this.private_WriterUndefinedNullLong(Writer,this.uiPriority);this.private_WriterUndefinedNullBool(Writer,this.qFormat);this.private_WriterUndefinedNullBool(Writer,this.hidden);this.private_WriterUndefinedNullBool(Writer,this.semiHidden);this.private_WriterUndefinedNullBool(Writer,this.unhideWhenUsed); this.TextPr.Write_ToBinary(Writer);this.ParaPr.Write_ToBinary(Writer);this.TablePr.Write_ToBinary(Writer);this.TableRowPr.Write_ToBinary(Writer);this.TableCellPr.Write_ToBinary(Writer);this.TableBand1Horz.Write_ToBinary(Writer);this.TableBand1Vert.Write_ToBinary(Writer);this.TableBand2Horz.Write_ToBinary(Writer);this.TableBand2Vert.Write_ToBinary(Writer);this.TableFirstCol.Write_ToBinary(Writer);this.TableFirstRow.Write_ToBinary(Writer);this.TableLastCol.Write_ToBinary(Writer);this.TableLastRow.Write_ToBinary(Writer); this.TableTLCell.Write_ToBinary(Writer);this.TableTRCell.Write_ToBinary(Writer);this.TableBLCell.Write_ToBinary(Writer);this.TableBRCell.Write_ToBinary(Writer);this.TableWholeTable.Write_ToBinary(Writer)},private_WriteUndefinedNullString:function(Writer,Value){if(undefined===Value)Writer.WriteBool(true);else{Writer.WriteBool(false);if(null===Value)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteString2(Value)}}},private_WriterUndefinedNullLong:function(Writer,Value){if(undefined=== Value)Writer.WriteBool(true);else{Writer.WriteBool(false);if(null===Value)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteLong(Value)}}},private_WriterUndefinedNullBool:function(Writer,Value){if(undefined===Value)Writer.WriteBool(true);else{Writer.WriteBool(false);if(null===Value)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteBool(Value)}}},private_ReadUndefinedNullString:function(Reader){if(true===Reader.GetBool())return undefined;else if(true===Reader.GetBool())return null; else return Reader.GetString2()},private_ReadUndefinedNullLong:function(Reader){if(true===Reader.GetBool())return undefined;else if(true===Reader.GetBool())return null;else return Reader.GetLong()},private_ReadUndefinedNullBool:function(Reader){if(true===Reader.GetBool())return undefined;else if(true===Reader.GetBool())return null;else return Reader.GetBool()},Read_FromBinary2:function(Reader){this.Id=Reader.GetString2();this.Name=this.private_ReadUndefinedNullString(Reader);this.BasedOn=this.private_ReadUndefinedNullString(Reader); this.Next=this.private_ReadUndefinedNullString(Reader);this.Type=Reader.GetLong();this.uiPriority=this.private_ReadUndefinedNullLong(Reader);this.qFormat=this.private_ReadUndefinedNullBool(Reader);this.hidden=this.private_ReadUndefinedNullBool(Reader);this.semiHidden=this.private_ReadUndefinedNullBool(Reader);this.unhideWhenUsed=this.private_ReadUndefinedNullBool(Reader);this.TextPr.Read_FromBinary(Reader);this.ParaPr.Read_FromBinary(Reader);this.TablePr.Read_FromBinary(Reader);this.TableRowPr.Read_FromBinary(Reader); this.TableCellPr.Read_FromBinary(Reader);this.TableBand1Horz.Read_FromBinary(Reader);this.TableBand1Vert.Read_FromBinary(Reader);this.TableBand2Horz.Read_FromBinary(Reader);this.TableBand2Vert.Read_FromBinary(Reader);this.TableFirstCol.Read_FromBinary(Reader);this.TableFirstRow.Read_FromBinary(Reader);this.TableLastCol.Read_FromBinary(Reader);this.TableLastRow.Read_FromBinary(Reader);this.TableTLCell.Read_FromBinary(Reader);this.TableTRCell.Read_FromBinary(Reader);this.TableBLCell.Read_FromBinary(Reader); this.TableBRCell.Read_FromBinary(Reader);this.TableWholeTable.Read_FromBinary(Reader)},Load_LinkData:function(LinkData){if(true===LinkData.StyleUpdate){var LogicDocument=editor.WordControl.m_oLogicDocument;if(!LogicDocument)return;var Styles=LogicDocument.Get_Styles();if(!Styles)return;var AllParagraphs=[];if(this.Id!=Styles.Default.Paragraph){var AllStylesId=Styles.private_GetAllBasedStylesId(this.Id);AllParagraphs=LogicDocument.GetAllParagraphsByStyle(AllStylesId);LogicDocument.Add_ChangedStyle(AllStylesId)}else{AllParagraphs= LogicDocument.GetAllParagraphs({All:true});LogicDocument.Add_ChangedStyle([this.Id])}var Count=AllParagraphs.length;for(var Index=0;Index<Count;Index++){var Para=AllParagraphs[Index];Para.Recalc_CompiledPr();Para.Recalc_RunsCompiledPr()}}}};CStyle.prototype.SetTextPr=function(oTextPr){this.Set_TextPr(oTextPr)};CStyle.prototype.GetTextPr=function(){return this.TextPr};CStyle.prototype.SetParaPr=function(oParaPr){this.Set_ParaPr(oParaPr)};CStyle.prototype.GetParaPr=function(){return this.ParaPr};CStyle.prototype.SetUiPriority= function(nUiPriority){this.Set_UiPriority(nUiPriority)};CStyle.prototype.GetUiPriority=function(){return this.uiPriority};CStyle.prototype.SetQFormat=function(isQFormat){this.Set_QFormat(isQFormat)};CStyle.prototype.GetQFormat=function(){return this.qFormat};CStyle.prototype.SetHidden=function(isHidden){this.Set_Hidden(isHidden)};CStyle.prototype.GetHidden=function(){return this.hidden};CStyle.prototype.SetSemiHidden=function(isSemiHidden){this.Set_SemiHidden(isSemiHidden)};CStyle.prototype.GetSemiHidden= function(){return this.semiHidden};CStyle.prototype.SetUnhideWhenUsed=function(isUnhide){this.Set_UnhideWhenUsed(isUnhide)};CStyle.prototype.GetUnhideWhenUsed=function(){return this.unhideWhenUsed};CStyle.prototype.GetName=function(){return this.Get_Name()};CStyle.prototype.GetBasedOn=function(){return this.Get_BasedOn()};CStyle.prototype.GetNext=function(){return this.Get_Next()};CStyle.prototype.GetType=function(){return this.Get_Type()};CStyle.prototype.SetLink=function(sLink){this.Set_Link(sLink)}; CStyle.prototype.GetLink=function(){return this.Link};CStyle.prototype.IsEqual=function(oOtherStyle){return this.Is_Equal(oOtherStyle)};CStyle.prototype.CreateLinkedCharacterStyle=function(sStyleName,sBasedOn){var oStyle=new CStyle(sStyleName,sBasedOn,null,styletype_Character,true);oStyle.SetTextPr(this.GetTextPr());oStyle.SetUiPriority(this.GetUiPriority());oStyle.SetLink(this.GetId());this.SetLink(oStyle.GetId());return oStyle};CStyle.prototype.CreateNormal=function(){this.SetQFormat(true)};CStyle.prototype.CreateDefaultParagraphFont= function(){this.SetUiPriority(1);this.SetSemiHidden(true);this.SetUnhideWhenUsed(true)};CStyle.prototype.CreateNoList=function(){this.SetUiPriority(99);this.SetSemiHidden(true);this.SetUnhideWhenUsed(true)};CStyle.prototype.CreateHyperlink=function(){this.SetUiPriority(99);this.SetUnhideWhenUsed(true);this.SetTextPr({Color:{r:0,g:0,b:255},Underline:true,Unifill:AscFormat.CreateUniFillSchemeColorWidthTint(11,0)})};CStyle.prototype.CreateNoSpacing=function(){this.SetUiPriority(1);this.SetQFormat(true); this.SetParaPr({Spacing:{Line:1,LineRule:linerule_Auto,After:0,Before:0}})};CStyle.prototype.CreateHeader=function(){this.SetUiPriority(99);this.SetUnhideWhenUsed(true);var RPos=297-30-15;var CPos=RPos/2;this.SetParaPr({Spacing:{After:0,Line:1,LineRule:linerule_Auto},Tabs:{Tabs:[{Value:tab_Center,Pos:CPos},{Value:tab_Right,Pos:RPos}]}})};CStyle.prototype.CreateFooter=function(){this.SetUiPriority(99);this.SetUnhideWhenUsed(true);var RPos=297-30-15;var CPos=RPos/2;this.SetParaPr({Spacing:{After:0, Line:1,LineRule:linerule_Auto},Tabs:{Tabs:[{Value:tab_Center,Pos:CPos},{Value:tab_Right,Pos:RPos}]}})};CStyle.prototype.CreateFootnoteText=function(){this.SetUiPriority(99);this.SetSemiHidden(true);this.SetUnhideWhenUsed(true);this.SetParaPr({Spacing:{After:40*g_dKoef_twips_to_mm,Line:1,LineRule:linerule_Auto}});this.SetTextPr({FontSize:9})};CStyle.prototype.CreateFootnoteReference=function(){this.SetUiPriority(99);this.SetUnhideWhenUsed(true);this.SetTextPr({VertAlign:AscCommon.vertalign_SuperScript})}; CStyle.prototype.CreateEndnoteText=function(){this.SetUiPriority(99);this.SetSemiHidden(true);this.SetUnhideWhenUsed(true);this.SetParaPr({Spacing:{After:0,Line:1,LineRule:linerule_Auto}});this.SetTextPr({FontSize:10})};CStyle.prototype.CreateEndnoteReference=function(){this.SetUiPriority(99);this.SetSemiHidden(true);this.SetUnhideWhenUsed(true);this.SetTextPr({VertAlign:AscCommon.vertalign_SuperScript})};CStyle.prototype.CreateTOC=function(nLvl,nType){var ParaPr={},TextPr={};if(undefined===nType|| null===nType||Asc.c_oAscTOCStylesType.Simple===nType){ParaPr={Spacing:{After:57/20*g_dKoef_pt_to_mm},Ind:{Left:0,Right:0,FirstLine:0}};if(1===nLvl)ParaPr.Ind.Left=283/20*g_dKoef_pt_to_mm;else if(2===nLvl)ParaPr.Ind.Left=567/20*g_dKoef_pt_to_mm;else if(3===nLvl)ParaPr.Ind.Left=850/20*g_dKoef_pt_to_mm;else if(4===nLvl)ParaPr.Ind.Left=1134/20*g_dKoef_pt_to_mm;else if(5===nLvl)ParaPr.Ind.Left=1417/20*g_dKoef_pt_to_mm;else if(6===nLvl)ParaPr.Ind.Left=1701/20*g_dKoef_pt_to_mm;else if(7===nLvl)ParaPr.Ind.Left= 1984/20*g_dKoef_pt_to_mm;else if(8===nLvl)ParaPr.Ind.Left=2268/20*g_dKoef_pt_to_mm}else if(Asc.c_oAscTOCStylesType.Standard===nType){ParaPr={Spacing:{After:57/20*g_dKoef_pt_to_mm},Ind:{Left:0,Right:0,FirstLine:0}};if(0===nLvl){TextPr.Bold=true;TextPr.FontSize=14}else if(1===nLvl){ParaPr.Ind.Left=283/20*g_dKoef_pt_to_mm;TextPr.Bold=true;TextPr.FontSize=13}else if(2===nLvl){ParaPr.Ind.Left=567/20*g_dKoef_pt_to_mm;TextPr.FontSize=13}else if(3===nLvl){ParaPr.Ind.Left=850/20*g_dKoef_pt_to_mm;TextPr.FontSize= 11}else if(4===nLvl){ParaPr.Ind.Left=1134/20*g_dKoef_pt_to_mm;TextPr.FontSize=11}else if(5===nLvl){ParaPr.Ind.Left=1417/20*g_dKoef_pt_to_mm;TextPr.FontSize=11}else if(6===nLvl){ParaPr.Ind.Left=1701/20*g_dKoef_pt_to_mm;TextPr.FontSize=11}else if(7===nLvl){ParaPr.Ind.Left=1984/20*g_dKoef_pt_to_mm;TextPr.FontSize=11}else if(8===nLvl){ParaPr.Ind.Left=2268/20*g_dKoef_pt_to_mm;TextPr.FontSize=11}}else if(Asc.c_oAscTOCStylesType.Modern===nType){ParaPr={Ind:{Left:0,Right:0,FirstLine:0}};if(0===nLvl){ParaPr.Spacing= {After:170/20*g_dKoef_pt_to_mm};ParaPr.Brd={Bottom:{Color:{r:0,g:0,b:0},Space:0,Size:1*g_dKoef_pt_to_mm,Value:border_Single}};TextPr.Bold=true;TextPr.FontSize=14}else if(1===nLvl){ParaPr.Spacing={After:57/20*g_dKoef_pt_to_mm};TextPr.Bold=true;TextPr.FontSize=13}else if(2===nLvl){ParaPr.Spacing={After:57/20*g_dKoef_pt_to_mm};TextPr.FontSize=13}else{ParaPr.Spacing={After:57/20*g_dKoef_pt_to_mm};TextPr.FontSize=11}}else if(Asc.c_oAscTOCStylesType.Classic===nType){ParaPr.Spacing={After:57/20*g_dKoef_pt_to_mm}; ParaPr.Ind={Left:0,Right:0,FirstLine:0};TextPr.FontSize=11;if(0===nLvl){ParaPr.Spacing.After=170/20*g_dKoef_pt_to_mm;TextPr.Bold=true;TextPr.FontSize=14}else if(1===nLvl){TextPr.Bold=true;TextPr.FontSize=13}else if(2===nLvl){ParaPr.Ind.FirstLine=283/20*g_dKoef_pt_to_mm;TextPr.FontSize=13}else if(3===nLvl)ParaPr.Ind.FirstLine=567/20*g_dKoef_pt_to_mm;else if(4===nLvl)ParaPr.Ind.FirstLine=850/20*g_dKoef_pt_to_mm;else if(5===nLvl)ParaPr.Ind.FirstLine=1134/20*g_dKoef_pt_to_mm;else if(6===nLvl)ParaPr.Ind.FirstLine= 1417/20*g_dKoef_pt_to_mm;else if(7===nLvl)ParaPr.Ind.FirstLine=1701/20*g_dKoef_pt_to_mm;else if(8===nLvl)ParaPr.Ind.FirstLine=1984/20*g_dKoef_pt_to_mm}else if(Asc.c_oAscTOCStylesType.Web===nType){ParaPr.Spacing={After:57/20*g_dKoef_pt_to_mm};ParaPr.Ind={};TextPr.Underline=true;TextPr.Color={r:0,g:200,b:195};TextPr.Unifill=AscCommonWord.CreateThemeUnifill(EThemeColor.themecolorHyperlink,null,null);if(0===nLvl)ParaPr.Spacing.After=100/20*g_dKoef_pt_to_mm;else if(1===nLvl){ParaPr.Spacing.After=100/20* g_dKoef_pt_to_mm;ParaPr.Ind.Left=220/20*g_dKoef_pt_to_mm}else if(2===nLvl){ParaPr.Spacing.After=100/20*g_dKoef_pt_to_mm;ParaPr.Ind.Left=440/20*g_dKoef_pt_to_mm}else if(3===nLvl)ParaPr.Ind.Left=850/20*g_dKoef_pt_to_mm;else if(4===nLvl)ParaPr.Ind.Left=1134/20*g_dKoef_pt_to_mm;else if(5===nLvl)ParaPr.Ind.Left=1417/20*g_dKoef_pt_to_mm;else if(6===nLvl)ParaPr.Ind.Left=1701/20*g_dKoef_pt_to_mm;else if(7===nLvl)ParaPr.Ind.Left=1984/20*g_dKoef_pt_to_mm;else if(8===nLvl)ParaPr.Ind.Left=2268/20*g_dKoef_pt_to_mm}this.Set_UiPriority(39); this.Set_UnhideWhenUsed(true);this.Set_ParaPr(ParaPr);this.Set_TextPr(TextPr)};CStyle.prototype.CreateTOCHeading=function(){var ParaPr={};this.Set_UiPriority(39);this.Set_UnhideWhenUsed(true);this.Set_ParaPr(ParaPr)};CStyle.prototype.CreateTOF=function(nType){var nType_;var oParaPr=new CParaPr,oTextPr=new CTextPr;oParaPr.Spacing.Set_FromObject({After:0,AfterAutoSpacing:0});if(Asc.c_oAscTOFStylesType){if(nType===undefined||nType===null)nType_=Asc.c_oAscTOFStylesType.Formal;else nType_=nType;switch(nType_){case Asc.c_oAscTOFStylesType.Classic:{oTextPr.SetCaps(true); break}case Asc.c_oAscTOFStylesType.Distinctive:{oTextPr.SetItalic(true);break}case Asc.c_oAscTOFStylesType.Centered:{oTextPr.SetBold(true);oTextPr.SetItalic(true);oParaPr.SetJc(AscCommon.align_Center);break}case Asc.c_oAscTOFStylesType.Formal:{break}case Asc.c_oAscTOFStylesType.Simple:{oTextPr.SetBold(true);break}case Asc.c_oAscTOFStylesType.Web:{oTextPr.SetUnderline(true);oTextPr.SetUnifill(AscCommonWord.CreateThemeUnifill(EThemeColor.themecolorHyperlink,null,null));break}}}this.Set_UiPriority(99); this.Set_UnhideWhenUsed(true);this.Set_ParaPr(oParaPr);this.Set_TextPr(oTextPr)};CStyle.prototype.CreateListParagraph=function(){this.SetQFormat(true);this.SetUiPriority(34);this.SetParaPr({Ind:{Left:720*g_dKoef_twips_to_mm},ContextualSpacing:true})};CStyle.prototype.CreateHeading=function(nLvl){if(0===nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:480*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:0});this.SetTextPr({FontSize:20,FontSizeCS:20,RFonts:{Ascii:{Name:Default_Heading_Font, Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font,Index:-1}}})}else if(1===nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:360*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:1});this.SetTextPr({FontSize:17,RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font,Index:-1}}})}else if(2=== nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:320*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:2});this.SetTextPr({FontSize:15,FontSizeCS:15,RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font,Index:-1}}})}else if(3===nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:320*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:3}); this.SetTextPr({FontSize:13,FontSizeCS:13,RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font,Index:-1}},Bold:true,BoldCS:true})}else if(4===nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:320*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:4});this.SetTextPr({FontSize:12,FontSizeCS:12,RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font, Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font,Index:-1}},Bold:true,BoldCS:true})}else if(5===nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:320*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:5});this.SetTextPr({FontSize:11,FontSizeCS:11,Bold:true,BoldCS:true,RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font, Index:-1}}})}else if(6===nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:320*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:6});this.SetTextPr({FontSize:11,FontSizeCS:11,RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font,Index:-1}},Bold:true,BoldCS:true,Italic:true,ItalicCS:true})}else if(7===nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:320* g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:7});this.SetTextPr({FontSize:11,FontSizeCS:11,RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font,Index:-1}},Italic:true,ItalicCS:true})}else if(8===nLvl){this.SetParaPr({KeepNext:true,KeepLines:true,Spacing:{Before:320*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},OutlineLvl:8});this.SetTextPr({FontSize:10.5,FontSizeCS:10.5, RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1},CS:{Name:Default_Heading_Font,Index:-1}},Italic:true,ItalicCS:true})}this.SetQFormat(true);this.SetUiPriority(9);if(0!==nLvl)this.SetUnhideWhenUsed(true)};CStyle.prototype.CreateHeadingLinkStyle=function(nLvl){var TextPr={RFonts:{Ascii:{Name:Default_Heading_Font,Index:-1},EastAsia:{Name:Default_Heading_Font,Index:-1},HAnsi:{Name:Default_Heading_Font,Index:-1}, CS:{Name:Default_Heading_Font,Index:-1}}};if(0===nLvl){TextPr.FontSize=20;TextPr.FontSizeCS=20}else if(1===nLvl){TextPr.FontSize=17;TextPr.FontSizeCS=17}else if(2===nLvl){TextPr.FontSize=15;TextPr.FontSizeCS=15}else if(3===nLvl){TextPr.FontSize=13;TextPr.FontSizeCS=13;TextPr.Bold=true;TextPr.BoldCd=true}else if(4===nLvl){TextPr.FontSize=12;TextPr.FontSizeCS=12;TextPr.Bold=true;TextPr.BoldCS=true}else if(5===nLvl){TextPr.FontSize=11;TextPr.FontSizeCS=11;TextPr.Bold=true;TextPr.BoldCS=true}else if(6=== nLvl){TextPr.FontSize=11;TextPr.FontSizeCS=11;TextPr.Bold=true;TextPr.BoldCS=true}else if(7===nLvl){TextPr.FontSize=11;TextPr.FontSizeCS=11}else if(8===nLvl){TextPr.FontSize=10.5;TextPr.FontSizeCS=10.5}this.Set_UiPriority(9);this.Set_TextPr(TextPr)};CStyle.prototype.CreateTitle=function(){this.SetQFormat(true);this.SetUiPriority(10);this.SetTextPr({FontSize:24,FontSizeCS:24});this.SetParaPr({Spacing:{Before:300*g_dKoef_twips_to_mm,After:200*g_dKoef_twips_to_mm},ContextualSpacing:true})};CStyle.prototype.CreateSubtitle= function(){this.SetQFormat(true);this.SetUiPriority(11);this.SetTextPr({FontSize:12,FontSizeCS:12});this.SetParaPr({Spacing:{After:200*g_dKoef_twips_to_mm,Before:200*g_dKoef_twips_to_mm}})};CStyle.prototype.CreateQuote=function(){this.SetQFormat(true);this.SetUiPriority(29);this.SetTextPr({Italic:true});this.SetParaPr({Ind:{Left:720*g_dKoef_twips_to_mm,Right:720*g_dKoef_twips_to_mm}})};CStyle.prototype.CreateIntenseQuote=function(){this.SetQFormat(true);this.SetUiPriority(30);this.SetTextPr({Italic:true}); this.SetParaPr({ContextualSpacing:false,Ind:{Left:720*g_dKoef_twips_to_mm,Right:720*g_dKoef_twips_to_mm},Shd:{Value:c_oAscShdClear,Color:{r:242,g:242,b:242}},Brd:{Left:{Color:{r:255,g:255,b:255},Space:10*g_dKoef_pt_to_mm,Size:.5*g_dKoef_pt_to_mm,Value:border_Single},Top:{Color:{r:255,g:255,b:255},Space:5*g_dKoef_pt_to_mm,Size:.5*g_dKoef_pt_to_mm,Value:border_Single},Right:{Color:{r:255,g:255,b:255},Space:10*g_dKoef_pt_to_mm,Size:.5*g_dKoef_pt_to_mm,Value:border_Single},Bottom:{Color:{r:255,g:255, b:255},Space:5*g_dKoef_pt_to_mm,Size:.5*g_dKoef_pt_to_mm,Value:border_Single}}})};CStyle.prototype.CreateCaption=function(){this.SetUiPriority(35);this.SetSemiHidden(true);this.SetUnhideWhenUsed(true);this.SetQFormat(true);this.SetParaPr({Spacing:{Line:1.15,LineRule:linerule_Auto}});this.SetTextPr({Bold:true,BoldCS:true,Color:{r:79,g:129,b:189},Unifill:AscCommonWord.CreateThemeUnifill(EThemeColor.themecolorAccent1,null,null),FontSize:9,FontSizeCS:9})};CStyle.prototype.ToAscStyle=function(){var oAscStyle= new Asc.CAscStyle;oAscStyle.StyleId=this.Id;oAscStyle.Name=this.Name;oAscStyle.Type=this.Type;oAscStyle.qFormat=null===this.qFormat||undefined===this.qFormat?false:this.qFormat;oAscStyle.uiPriority=null===this.qFormat||undefined===this.qFormat?-1:this.uiPriority;return oAscStyle};CStyle.prototype.GetTextPr=function(){return this.TextPr};CStyle.prototype.GetParaPr=function(){return this.ParaPr};CStyle.prototype.IsExpressStyle=function(oStyles){if(true===this.qFormat)return true;if(oStyles&&oStyles.Default&& (oStyles.Default.Header===this.Id||oStyles.Default.Footer===this.Id||oStyles.Default.FootnoteText===this.Id||oStyles.Default.EndnoteText===this.Id))return true;return false};CStyle.prototype.SetCustom=function(isCustom){History.Add(new CChangesStyleCustom(this,this.Name,isCustom));this.Custom=isCustom};CStyle.prototype.IsCustom=function(){return this.Custom};CStyle.prototype.IsParagraphStyle=function(){return this.Type===styletype_Paragraph};CStyle.prototype.Document_Is_SelectionLocked=function(CheckType){switch(CheckType){case AscCommon.changestype_Paragraph_Content:case AscCommon.changestype_Paragraph_Properties:case AscCommon.changestype_Paragraph_AddText:case AscCommon.changestype_Paragraph_TextProperties:case AscCommon.changestype_ContentControl_Add:case AscCommon.changestype_Document_Content:case AscCommon.changestype_Document_Content_Add:case AscCommon.changestype_Image_Properties:case AscCommon.changestype_Remove:case AscCommon.changestype_Delete:case AscCommon.changestype_Document_SectPr:case AscCommon.changestype_Table_Properties:case AscCommon.changestype_Table_RemoveCells:case AscCommon.changestype_HdrFtr:{AscCommon.CollaborativeEditing.Add_CheckLock(true); break}}};function CStyles(bCreateDefault){if(bCreateDefault!==false){this.Id=AscCommon.g_oIdCounter.Get_NewId();this.Lock=new AscCommon.CLock;this.Default={ParaPr:new CParaPr,TextPr:new CTextPr,TablePr:new CTablePr,TableRowPr:new CTableRowPr,TableCellPr:new CTableCellPr,Paragraph:null,Character:null,Numbering:null,Table:null,TableGrid:null,Headings:[],ParaList:null,Header:null,Footer:null,Hyperlink:null,FootnoteText:null,FootnoteTextChar:null,FootnoteReference:null,NoSpacing:null,Title:null,Subtitle:null, Quote:null,IntenseQuote:null,TOC:[],TOCHeading:null,TOF:null,Caption:null,EndnoteText:null,EndnoteTextChar:null,EndnoteReference:null};this.Default.ParaPr.InitDefault();this.Default.TextPr.InitDefault();this.Default.TablePr.InitDefault();this.Default.TableRowPr.InitDefault();this.Default.TableCellPr.InitDefault();this.Style=[];var oNormal=new CStyle("Normal",null,null,styletype_Paragraph);oNormal.CreateNormal();this.Default.Paragraph=this.Add(oNormal);var oDefaultParagraphFont=new CStyle("Default Paragraph Font", null,null,styletype_Character);oDefaultParagraphFont.CreateDefaultParagraphFont();this.Default.Character=this.Add(oDefaultParagraphFont);var oNoList=new CStyle("No List",null,null,styletype_Numbering);oNoList.CreateNoList();this.Default.Numbering=this.Add(oNoList);for(var nLvl=0;nLvl<=8;++nLvl){var oHeadingStyle=new CStyle("Heading "+(nLvl+1),this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);oHeadingStyle.CreateHeading(nLvl);this.Default.Headings[nLvl]=this.Add(oHeadingStyle);this.Add(oHeadingStyle.CreateLinkedCharacterStyle("Heading "+ (nLvl+1)+" Char",this.Default.Character))}var oListParagraph=new CStyle("List Paragraph",this.Default.Paragraph,null,styletype_Paragraph);oListParagraph.CreateListParagraph();this.Default.ParaList=this.Add(oListParagraph);var Style_Table=new CStyle("Normal Table",null,null,styletype_Table);Style_Table.Create_NormalTable();this.Default.Table=this.Add(Style_Table);var oNoSpacing=new CStyle("No Spacing",null,null,styletype_Paragraph);oNoSpacing.CreateNoSpacing();this.Default.NoSpacing=this.Add(oNoSpacing); var oTitle=new CStyle("Title",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);oTitle.CreateTitle();this.Default.Title=this.Add(oTitle);this.Add(oTitle.CreateLinkedCharacterStyle("Title Char",this.Default.Character));var oSubtitle=new CStyle("Subtitle",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);oSubtitle.CreateSubtitle();this.Default.Subtitle=this.Add(oSubtitle);this.Add(oSubtitle.CreateLinkedCharacterStyle("Subtitle Char",this.Default.Character));var oQuote= new CStyle("Quote",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);oQuote.CreateQuote();this.Default.Quote=this.Add(oQuote);this.Add(oQuote.CreateLinkedCharacterStyle("Quote Char"),this.Default.Character);var oIntenseQuote=new CStyle("Intense Quote",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);oIntenseQuote.CreateIntenseQuote();this.Default.IntenseQuote=this.Add(oIntenseQuote);this.Add(oIntenseQuote.CreateLinkedCharacterStyle("Intense Quote Char"),this.Default.Character); var oHeader=new CStyle("Header",this.Default.Paragraph,null,styletype_Paragraph);oHeader.CreateHeader();this.Default.Header=this.Add(oHeader);this.Add(oHeader.CreateLinkedCharacterStyle("Header Char",this.Default.Character));var oFooter=new CStyle("Footer",this.Default.Paragraph,null,styletype_Paragraph);oFooter.CreateFooter();this.Default.Footer=this.Add(oFooter);this.Add(oFooter.CreateLinkedCharacterStyle("Footer Char",this.Default.Character));var oCaption=new CStyle("Caption",this.Default.Paragraph, this.Default.Paragraph,styletype_Paragraph);oCaption.CreateCaption();this.Default.Caption=this.Add(oCaption);this.Add(oFooter.CreateLinkedCharacterStyle("Caption Char",this.Default.Caption));var fUF=AscCommonWord.CreateThemeUnifill;var Style_TableGrid=new CStyle("Table Grid",this.Default.Table,null,styletype_Table);Style_TableGrid.Create_TableGrid();this.Default.TableGrid=this.Add(Style_TableGrid);var Style_TableGridLight=new CStyle("Table Grid Light",this.Default.Table,null,styletype_Table);Style_TableGridLight.Create_TableGrid_Light(fUF(EThemeColor.themecolorText1, 80,null));this.Add(Style_TableGridLight);var Style_Plain_Table_1=new CStyle("Plain Table 1",this.Default.Table,null,styletype_Table);Style_Plain_Table_1.Create_Table_Plain_1(fUF(EThemeColor.themecolorText1,80,null),fUF(EThemeColor.themecolorText1,13,null));this.Add(Style_Plain_Table_1);var Style_Plain_Table_2=new CStyle("Plain Table 2",this.Default.Table,null,styletype_Table);Style_Plain_Table_2.Create_Table_Plain_2(fUF(EThemeColor.themecolorText1,null,null));this.Add(Style_Plain_Table_2);var Style_Plain_Table_3= new CStyle("Plain Table 3",this.Default.Table,null,styletype_Table);Style_Plain_Table_3.Create_Table_Plain_3(fUF(EThemeColor.themecolorText1,null,null),fUF(EThemeColor.themecolorText1,13,null));this.Add(Style_Plain_Table_3);var Style_Plain_Table_4=new CStyle("Plain Table 4",this.Default.Table,null,styletype_Table);Style_Plain_Table_4.Create_Table_Plain_4(fUF(EThemeColor.themecolorText1,13,null));this.Add(Style_Plain_Table_4);var Style_Plain_Table_5=new CStyle("Plain Table 5",this.Default.Table,null, styletype_Table);Style_Plain_Table_5.Create_Table_Plain_5(fUF(EThemeColor.themecolorNone,null,null),fUF(EThemeColor.themecolorText1,13,null));this.Add(Style_Plain_Table_5);var Style_Table_Grid_1_Accent=new CStyle("Grid Table 1 Light",this.Default.Table,null,styletype_Table);Style_Table_Grid_1_Accent.Create_Table_Grid_1(fUF(EThemeColor.themecolorText1,149,null),fUF(EThemeColor.themecolorText1,103,null));this.Add(Style_Table_Grid_1_Accent);var Style_Table_Grid_1_Accent_1=new CStyle("Grid Table 1 Light - Accent 1", this.Default.Table,null,styletype_Table);Style_Table_Grid_1_Accent_1.Create_Table_Grid_1(fUF(EThemeColor.themecolorAccent1,149,null),fUF(EThemeColor.themecolorAccent1,103,null));this.Add(Style_Table_Grid_1_Accent_1);var Style_Table_Grid_1_Accent_2=new CStyle("Grid Table 1 Light - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_Grid_1_Accent_2.Create_Table_Grid_1(fUF(EThemeColor.themecolorAccent2,149,null),fUF(EThemeColor.themecolorAccent2,103,null));this.Add(Style_Table_Grid_1_Accent_2); var Style_Table_Grid_1_Accent_3=new CStyle("Grid Table 1 Light - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_Grid_1_Accent_3.Create_Table_Grid_1(fUF(EThemeColor.themecolorAccent3,149,null),fUF(EThemeColor.themecolorAccent3,103,null));this.Add(Style_Table_Grid_1_Accent_3);var Style_Table_Grid_1_Accent_4=new CStyle("Grid Table 1 Light - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_Grid_1_Accent_4.Create_Table_Grid_1(fUF(EThemeColor.themecolorAccent4,149,null),fUF(EThemeColor.themecolorAccent4, 103,null));this.Add(Style_Table_Grid_1_Accent_4);var Style_Table_Grid_1_Accent_5=new CStyle("Grid Table 1 Light - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_Grid_1_Accent_5.Create_Table_Grid_1(fUF(EThemeColor.themecolorAccent5,149,null),fUF(EThemeColor.themecolorAccent5,103,null));this.Add(Style_Table_Grid_1_Accent_5);var Style_Table_Grid_1_Accent_6=new CStyle("Grid Table 1 Light - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_Grid_1_Accent_6.Create_Table_Grid_1(fUF(EThemeColor.themecolorAccent6, 149,null),fUF(EThemeColor.themecolorAccent6,103,null));this.Add(Style_Table_Grid_1_Accent_6);var Style_Table_Grid_Accent=new CStyle("Grid Table 2",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent.Create_Table_Grid_2(fUF(EThemeColor.themecolorText1,149,null),fUF(EThemeColor.themecolorText1,52,null));this.Add(Style_Table_Grid_Accent);var Style_Table_Grid_Accent_1=new CStyle("Grid Table 2 - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_1.Create_Table_Grid_2(fUF(EThemeColor.themecolorAccent1, 234,null),fUF(EThemeColor.themecolorAccent1,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_1);var Style_Table_Grid_Accent_2=new CStyle("Grid Table 2 - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_2.Create_Table_Grid_2(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorAccent2,50,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_2);var Style_Table_Grid_Accent_3=new CStyle("Grid Table 2 - Accent 3", this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_3.Create_Table_Grid_2(fUF(EThemeColor.themecolorAccent3,254,null),fUF(EThemeColor.themecolorAccent3,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_3);var Style_Table_Grid_Accent_4=new CStyle("Grid Table 2 - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_4.Create_Table_Grid_2(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,52,null),fUF(EThemeColor.themecolorNone, null,null));this.Add(Style_Table_Grid_Accent_4);var Style_Table_Grid_Accent_5=new CStyle("Grid Table 2 - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_5.Create_Table_Grid_2(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_5);var Style_Table_Grid_Accent_6=new CStyle("Grid Table 2 - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_6.Create_Table_Grid_2(fUF(EThemeColor.themecolorAccent6, null,null),fUF(EThemeColor.themecolorAccent6,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_6);var Style_Table_Grid_Accent=new CStyle("Grid Table 3",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent.Create_Table_Grid_3(fUF(EThemeColor.themecolorText1,149,null),fUF(EThemeColor.themecolorText1,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent);var Style_Table_Grid_Accent_1=new CStyle("Grid Table 3 - Accent 1",this.Default.Table, null,styletype_Table);Style_Table_Grid_Accent_1.Create_Table_Grid_3(fUF(EThemeColor.themecolorAccent1,234,null),fUF(EThemeColor.themecolorAccent1,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_1);var Style_Table_Grid_Accent_2=new CStyle("Grid Table 3 - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_2.Create_Table_Grid_3(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorAccent2,50,null),fUF(EThemeColor.themecolorNone, null,null));this.Add(Style_Table_Grid_Accent_2);var Style_Table_Grid_Accent_3=new CStyle("Grid Table 3 - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_3.Create_Table_Grid_3(fUF(EThemeColor.themecolorAccent3,254,null),fUF(EThemeColor.themecolorAccent3,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_3);var Style_Table_Grid_Accent_4=new CStyle("Grid Table 3 - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_4.Create_Table_Grid_3(fUF(EThemeColor.themecolorAccent4, 154,null),fUF(EThemeColor.themecolorAccent4,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_4);var Style_Table_Grid_Accent_5=new CStyle("Grid Table 3 - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_5.Create_Table_Grid_3(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_5);var Style_Table_Grid_Accent_6=new CStyle("Grid Table 3 - Accent 6", this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_6.Create_Table_Grid_3(fUF(EThemeColor.themecolorAccent6,null,null),fUF(EThemeColor.themecolorAccent6,52,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_Grid_Accent_6);var Style_Table_Grid_Accent=new CStyle("Grid Table 4",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent.Create_Table_Grid_4(fUF(EThemeColor.themecolorText1,null,null),fUF(EThemeColor.themecolorText1,52,null),fUF(EThemeColor.themecolorText1, 144,null));this.Add(Style_Table_Grid_Accent);var Style_Table_Grid_Accent_1=new CStyle("Grid Table 4 - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_1.Create_Table_Grid_4(fUF(EThemeColor.themecolorAccent1,234,null),fUF(EThemeColor.themecolorAccent1,50,null),fUF(EThemeColor.themecolorAccent1,144,null));this.Add(Style_Table_Grid_Accent_1);var Style_Table_Grid_Accent_2=new CStyle("Grid Table 4 - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_2.Create_Table_Grid_4(fUF(EThemeColor.themecolorAccent2, 151,null),fUF(EThemeColor.themecolorAccent2,50,null),fUF(EThemeColor.themecolorAccent2,144,null));this.Add(Style_Table_Grid_Accent_2);var Style_Table_Grid_Accent_3=new CStyle("Grid Table 4 - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_3.Create_Table_Grid_4(fUF(EThemeColor.themecolorAccent3,254,null),fUF(EThemeColor.themecolorAccent3,52,null),fUF(EThemeColor.themecolorAccent3,144,null));this.Add(Style_Table_Grid_Accent_3);var Style_Table_Grid_Accent_4=new CStyle("Grid Table 4 - Accent 4", this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_4.Create_Table_Grid_4(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,52,null),fUF(EThemeColor.themecolorAccent4,144,null));this.Add(Style_Table_Grid_Accent_4);var Style_Table_Grid_Accent_5=new CStyle("Grid Table 4 - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_5.Create_Table_Grid_4(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,52,null),fUF(EThemeColor.themecolorAccent5, 144,null));this.Add(Style_Table_Grid_Accent_5);var Style_Table_Grid_Accent_6=new CStyle("Grid Table 4 - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_6.Create_Table_Grid_4(fUF(EThemeColor.themecolorAccent6,null,null),fUF(EThemeColor.themecolorAccent6,52,null),fUF(EThemeColor.themecolorAccent6,144,null));this.Add(Style_Table_Grid_Accent_6);var Style_Table_Grid_Accent=new CStyle("Grid Table 5 Dark",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent.Create_Table_Grid_5(fUF(EThemeColor.themecolorText1, null,null),fUF(EThemeColor.themecolorText1,64,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorText1,117,null));this.Add(Style_Table_Grid_Accent);var Style_Table_Grid_Accent_1=new CStyle("Grid Table 5 Dark- Accent 1",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_1.Create_Table_Grid_5(fUF(EThemeColor.themecolorAccent1,null,null),fUF(EThemeColor.themecolorAccent1,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent1,117, null));this.Add(Style_Table_Grid_Accent_1);var Style_Table_Grid_Accent_2=new CStyle("Grid Table 5 Dark - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_2.Create_Table_Grid_5(fUF(EThemeColor.themecolorAccent2,null,null),fUF(EThemeColor.themecolorAccent2,50,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent2,117,null));this.Add(Style_Table_Grid_Accent_2);var Style_Table_Grid_Accent_3=new CStyle("Grid Table 5 Dark - Accent 3",this.Default.Table, null,styletype_Table);Style_Table_Grid_Accent_3.Create_Table_Grid_5(fUF(EThemeColor.themecolorAccent3,null,null),fUF(EThemeColor.themecolorAccent3,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent3,117,null));this.Add(Style_Table_Grid_Accent_3);var Style_Table_Grid_Accent_4=new CStyle("Grid Table 5 Dark- Accent 4",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_4.Create_Table_Grid_5(fUF(EThemeColor.themecolorAccent4,null,null),fUF(EThemeColor.themecolorAccent4, 52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent4,117,null));this.Add(Style_Table_Grid_Accent_4);var Style_Table_Grid_Accent_5=new CStyle("Grid Table 5 Dark - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_5.Create_Table_Grid_5(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent5,117,null));this.Add(Style_Table_Grid_Accent_5); var Style_Table_Grid_Accent_6=new CStyle("Grid Table 5 Dark - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_6.Create_Table_Grid_5(fUF(EThemeColor.themecolorAccent6,null,null),fUF(EThemeColor.themecolorAccent6,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent6,117,null));this.Add(Style_Table_Grid_Accent_6);var Style_Table_Grid_Accent=new CStyle("Grid Table 6 Colorful",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent.Create_Table_Grid_6(fUF(EThemeColor.themecolorText1, 128,null),fUF(EThemeColor.themecolorText1,52,null),fUF(EThemeColor.themecolorText1,128,149));this.Add(Style_Table_Grid_Accent);var Style_Table_Grid_Accent_1=new CStyle("Grid Table 6 Colorful - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_1.Create_Table_Grid_6(fUF(EThemeColor.themecolorAccent1,128,null),fUF(EThemeColor.themecolorAccent1,52,null),fUF(EThemeColor.themecolorAccent1,128,149));this.Add(Style_Table_Grid_Accent_1);var Style_Table_Grid_Accent_2=new CStyle("Grid Table 6 Colorful - Accent 2", this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_2.Create_Table_Grid_6(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorAccent2,50,null),fUF(EThemeColor.themecolorAccent2,151,149));this.Add(Style_Table_Grid_Accent_2);var Style_Table_Grid_Accent_3=new CStyle("Grid Table 6 Colorful - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_3.Create_Table_Grid_6(fUF(EThemeColor.themecolorAccent3,254,null),fUF(EThemeColor.themecolorAccent3,52,null), fUF(EThemeColor.themecolorAccent3,254,149));this.Add(Style_Table_Grid_Accent_3);var Style_Table_Grid_Accent_4=new CStyle("Grid Table 6 Colorful - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_4.Create_Table_Grid_6(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,52,null),fUF(EThemeColor.themecolorAccent4,154,149));this.Add(Style_Table_Grid_Accent_4);var Style_Table_Grid_Accent_5=new CStyle("Grid Table 6 Colorful - Accent 5",this.Default.Table, null,styletype_Table);Style_Table_Grid_Accent_5.Create_Table_Grid_6(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,52,null),fUF(EThemeColor.themecolorAccent5,null,149));this.Add(Style_Table_Grid_Accent_5);var Style_Table_Grid_Accent_6=new CStyle("Grid Table 6 Colorful - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_6.Create_Table_Grid_6(fUF(EThemeColor.themecolorAccent6,null,null),fUF(EThemeColor.themecolorAccent6,52,null),fUF(EThemeColor.themecolorAccent5, null,149));this.Add(Style_Table_Grid_Accent_6);var Style_Table_Grid_Accent=new CStyle("Grid Table 7 Colorful",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent.Create_Table_Grid_7(fUF(EThemeColor.themecolorText1,128,null),fUF(EThemeColor.themecolorText1,13,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorText1,128,149));this.Add(Style_Table_Grid_Accent);var Style_Table_Grid_Accent_1=new CStyle("Grid Table 7 Colorful - Accent 1",this.Default.Table,null,styletype_Table); Style_Table_Grid_Accent_1.Create_Table_Grid_7(fUF(EThemeColor.themecolorAccent1,128,null),fUF(EThemeColor.themecolorAccent1,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent1,128,149));this.Add(Style_Table_Grid_Accent_1);var Style_Table_Grid_Accent_2=new CStyle("Grid Table 7 Colorful - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_2.Create_Table_Grid_7(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorAccent2,50, null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent2,151,149));this.Add(Style_Table_Grid_Accent_2);var Style_Table_Grid_Accent_3=new CStyle("Grid Table 7 Colorful - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_3.Create_Table_Grid_7(fUF(EThemeColor.themecolorAccent3,254,null),fUF(EThemeColor.themecolorAccent3,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent3,254,149));this.Add(Style_Table_Grid_Accent_3); var Style_Table_Grid_Accent_4=new CStyle("Grid Table 7 Colorful - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_4.Create_Table_Grid_7(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent4,154,149));this.Add(Style_Table_Grid_Accent_4);var Style_Table_Grid_Accent_5=new CStyle("Grid Table 7 Colorful - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_5.Create_Table_Grid_7(fUF(EThemeColor.themecolorAccent5, 144,null),fUF(EThemeColor.themecolorAccent5,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent5,null,149));this.Add(Style_Table_Grid_Accent_5);var Style_Table_Grid_Accent_6=new CStyle("Grid Table 7 Colorful - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_Grid_Accent_6.Create_Table_Grid_7(fUF(EThemeColor.themecolorAccent6,144,null),fUF(EThemeColor.themecolorAccent6,52,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent6, null,149));this.Add(Style_Table_Grid_Accent_6);var Style_Table_List_1_Accent=new CStyle("List Table 1 Light",this.Default.Table,null,styletype_Table);Style_Table_List_1_Accent.Create_Table_List_1(fUF(EThemeColor.themecolorText1,null,null),fUF(EThemeColor.themecolorText1,64,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_List_1_Accent);var Style_Table_List_1_Accent_1=new CStyle("List Table 1 Light - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_List_1_Accent_1.Create_Table_List_1(fUF(EThemeColor.themecolorAccent1, null,null),fUF(EThemeColor.themecolorAccent1,64,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_List_1_Accent_1);var Style_Table_List_1_Accent_2=new CStyle("List Table 1 Light - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_List_1_Accent_2.Create_Table_List_1(fUF(EThemeColor.themecolorAccent2,null,null),fUF(EThemeColor.themecolorAccent2,64,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_List_1_Accent_2);var Style_Table_List_1_Accent_3=new CStyle("List Table 1 Light - Accent 3", this.Default.Table,null,styletype_Table);Style_Table_List_1_Accent_3.Create_Table_List_1(fUF(EThemeColor.themecolorAccent3,null,null),fUF(EThemeColor.themecolorAccent3,64,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_List_1_Accent_3);var Style_Table_List_1_Accent_4=new CStyle("List Table 1 Light - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_List_1_Accent_4.Create_Table_List_1(fUF(EThemeColor.themecolorAccent4,null,null),fUF(EThemeColor.themecolorAccent4, 64,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_List_1_Accent_4);var Style_Table_List_1_Accent_5=new CStyle("List Table 1 Light - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_List_1_Accent_5.Create_Table_List_1(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,64,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_List_1_Accent_5);var Style_Table_List_1_Accent_6=new CStyle("List Table 1 Light - Accent 6",this.Default.Table, null,styletype_Table);Style_Table_List_1_Accent_6.Create_Table_List_1(fUF(EThemeColor.themecolorAccent6,null,null),fUF(EThemeColor.themecolorAccent6,64,null),fUF(EThemeColor.themecolorNone,null,null));this.Add(Style_Table_List_1_Accent_6);var Style_Table_List_2_Accent=new CStyle("List Table 2",this.Default.Table,null,styletype_Table);Style_Table_List_2_Accent.Create_Table_List_2(fUF(EThemeColor.themecolorText1,144,null),fUF(EThemeColor.themecolorText1,64,null));this.Add(Style_Table_List_2_Accent); var Style_Table_List_2_Accent_1=new CStyle("List Table 2 - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_List_2_Accent_1.Create_Table_List_2(fUF(EThemeColor.themecolorAccent1,144,null),fUF(EThemeColor.themecolorAccent1,64,null));this.Add(Style_Table_List_2_Accent_1);var Style_Table_List_2_Accent_2=new CStyle("List Table 2 - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_List_2_Accent_2.Create_Table_List_2(fUF(EThemeColor.themecolorAccent2,144,null),fUF(EThemeColor.themecolorAccent2, 64,null));this.Add(Style_Table_List_2_Accent_2);var Style_Table_List_2_Accent_3=new CStyle("List Table 2 - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_List_2_Accent_3.Create_Table_List_2(fUF(EThemeColor.themecolorAccent3,144,null),fUF(EThemeColor.themecolorAccent3,64,null));this.Add(Style_Table_List_2_Accent_3);var Style_Table_List_2_Accent_4=new CStyle("List Table 2 - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_List_2_Accent_4.Create_Table_List_2(fUF(EThemeColor.themecolorAccent4, 144,null),fUF(EThemeColor.themecolorAccent4,64,null));this.Add(Style_Table_List_2_Accent_4);var Style_Table_List_2_Accent_5=new CStyle("List Table 2 - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_List_2_Accent_5.Create_Table_List_2(fUF(EThemeColor.themecolorAccent5,144,null),fUF(EThemeColor.themecolorAccent5,64,null));this.Add(Style_Table_List_2_Accent_5);var Style_Table_List_2_Accent_6=new CStyle("List Table 2 - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_List_2_Accent_6.Create_Table_List_2(fUF(EThemeColor.themecolorAccent6, 144,null),fUF(EThemeColor.themecolorAccent6,64,null));this.Add(Style_Table_List_2_Accent_6);var Style_Table_List_3_Accent=new CStyle("List Table 3",this.Default.Table,null,styletype_Table);Style_Table_List_3_Accent.Create_Table_List_3(fUF(EThemeColor.themecolorText1,null,null),fUF(EThemeColor.themecolorText1,38,null));this.Add(Style_Table_List_3_Accent);var Style_Table_List_3_Accent_1=new CStyle("List Table 3 - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_List_3_Accent_1.Create_Table_List_3(fUF(EThemeColor.themecolorAccent1, null,null),fUF(EThemeColor.themecolorAccent1,103,null));this.Add(Style_Table_List_3_Accent_1);var Style_Table_List_3_Accent_2=new CStyle("List Table 3 - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_List_3_Accent_2.Create_Table_List_3(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorAccent2,103,null));this.Add(Style_Table_List_3_Accent_2);var Style_Table_List_3_Accent_3=new CStyle("List Table 3 - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_List_3_Accent_3.Create_Table_List_3(fUF(EThemeColor.themecolorAccent3, 152,null),fUF(EThemeColor.themecolorAccent3,103,null));this.Add(Style_Table_List_3_Accent_3);var Style_Table_List_3_Accent_4=new CStyle("List Table 3 - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_List_3_Accent_4.Create_Table_List_3(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,103,null));this.Add(Style_Table_List_3_Accent_4);var Style_Table_List_3_Accent_5=new CStyle("List Table 3 - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_List_3_Accent_5.Create_Table_List_3(fUF(EThemeColor.themecolorAccent5, 154,null),fUF(EThemeColor.themecolorAccent5,103,null));this.Add(Style_Table_List_3_Accent_5);var Style_Table_List_3_Accent_6=new CStyle("List Table 3 - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_List_3_Accent_6.Create_Table_List_3(fUF(EThemeColor.themecolorAccent6,152,null),fUF(EThemeColor.themecolorAccent6,103,null));this.Add(Style_Table_List_3_Accent_6);var Style_Table_List_4_Accent=new CStyle("List Table 4",this.Default.Table,null,styletype_Table);Style_Table_List_4_Accent.Create_Table_List_4(fUF(EThemeColor.themecolorText1, null,null),fUF(EThemeColor.themecolorText1,64,null),fUF(EThemeColor.themecolorText1,null,null));this.Add(Style_Table_List_4_Accent);var Style_Table_List_4_Accent_1=new CStyle("List Table 4 - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_List_4_Accent_1.Create_Table_List_4(fUF(EThemeColor.themecolorAccent1,null,null),fUF(EThemeColor.themecolorAccent1,64,null),fUF(EThemeColor.themecolorAccent1,144,null));this.Add(Style_Table_List_4_Accent_1);var Style_Table_List_4_Accent_2=new CStyle("List Table 4 - Accent 2", this.Default.Table,null,styletype_Table);Style_Table_List_4_Accent_2.Create_Table_List_4(fUF(EThemeColor.themecolorAccent2,null,null),fUF(EThemeColor.themecolorAccent2,64,null),fUF(EThemeColor.themecolorAccent2,144,null));this.Add(Style_Table_List_4_Accent_2);var Style_Table_List_4_Accent_3=new CStyle("List Table 4 - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_List_4_Accent_3.Create_Table_List_4(fUF(EThemeColor.themecolorAccent3,null,null),fUF(EThemeColor.themecolorAccent3,64,null), fUF(EThemeColor.themecolorAccent3,144,null));this.Add(Style_Table_List_4_Accent_3);var Style_Table_List_4_Accent_4=new CStyle("List Table 4 - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_List_4_Accent_4.Create_Table_List_4(fUF(EThemeColor.themecolorAccent4,null,null),fUF(EThemeColor.themecolorAccent4,64,null),fUF(EThemeColor.themecolorAccent4,144,null));this.Add(Style_Table_List_4_Accent_4);var Style_Table_List_4_Accent_5=new CStyle("List Table 4 - Accent 5",this.Default.Table,null, styletype_Table);Style_Table_List_4_Accent_5.Create_Table_List_4(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,64,null),fUF(EThemeColor.themecolorAccent5,144,null));this.Add(Style_Table_List_4_Accent_5);var Style_Table_List_4_Accent_6=new CStyle("List Table 4 - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_List_4_Accent_6.Create_Table_List_4(fUF(EThemeColor.themecolorAccent6,null,null),fUF(EThemeColor.themecolorAccent6,64,null),fUF(EThemeColor.themecolorAccent6, 144,null));this.Add(Style_Table_List_4_Accent_6);var Style_Table_List_5_Accent=new CStyle("List Table 5 Dark",this.Default.Table,null,styletype_Table);Style_Table_List_5_Accent.Create_Table_List_5(fUF(EThemeColor.themecolorText1,128,null),fUF(EThemeColor.themecolorLight1,null,null));this.Add(Style_Table_List_5_Accent);var Style_Table_List_5_Accent_1=new CStyle("List Table 5 Dark - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_List_5_Accent_1.Create_Table_List_5(fUF(EThemeColor.themecolorAccent1, null,null),fUF(EThemeColor.themecolorLight1,null,null));this.Add(Style_Table_List_5_Accent_1);var Style_Table_List_5_Accent_2=new CStyle("List Table 5 Dark - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_List_5_Accent_2.Create_Table_List_5(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorLight1,null,null));this.Add(Style_Table_List_5_Accent_2);var Style_Table_List_5_Accent_3=new CStyle("List Table 5 Dark - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_List_5_Accent_3.Create_Table_List_5(fUF(EThemeColor.themecolorAccent3, 152,null),fUF(EThemeColor.themecolorLight1,null,null));this.Add(Style_Table_List_5_Accent_3);var Style_Table_List_5_Accent_4=new CStyle("List Table 5 Dark - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_List_5_Accent_4.Create_Table_List_5(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorLight1,null,null));this.Add(Style_Table_List_5_Accent_4);var Style_Table_List_5_Accent_5=new CStyle("List Table 5 Dark - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_List_5_Accent_5.Create_Table_List_5(fUF(EThemeColor.themecolorAccent5, 154,null),fUF(EThemeColor.themecolorLight1,null,null));this.Add(Style_Table_List_5_Accent_5);var Style_Table_List_5_Accent_6=new CStyle("List Table 5 Dark - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_List_5_Accent_6.Create_Table_List_5(fUF(EThemeColor.themecolorAccent6,152,null),fUF(EThemeColor.themecolorLight1,null,null));this.Add(Style_Table_List_5_Accent_6);var Style_Table_List_6_Accent=new CStyle("List Table 6 Colorful",this.Default.Table,null,styletype_Table);Style_Table_List_6_Accent.Create_Table_List_6(fUF(EThemeColor.themecolorText1, 128,null),fUF(EThemeColor.themecolorText1,64,null),fUF(EThemeColor.themecolorText1,null,null));this.Add(Style_Table_List_6_Accent);var Style_Table_List_6_Accent_1=new CStyle("List Table 6 Colorful - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_List_6_Accent_1.Create_Table_List_6(fUF(EThemeColor.themecolorAccent1,null,null),fUF(EThemeColor.themecolorAccent1,64,null),fUF(EThemeColor.themecolorAccent1,null,149));this.Add(Style_Table_List_6_Accent_1);var Style_Table_List_6_Accent_2= new CStyle("List Table 6 Colorful - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_List_6_Accent_2.Create_Table_List_6(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorAccent2,64,null),fUF(EThemeColor.themecolorAccent2,151,149));this.Add(Style_Table_List_6_Accent_2);var Style_Table_List_6_Accent_3=new CStyle("List Table 6 Colorful - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_List_6_Accent_3.Create_Table_List_6(fUF(EThemeColor.themecolorAccent3, 152,null),fUF(EThemeColor.themecolorAccent3,64,null),fUF(EThemeColor.themecolorAccent3,152,149));this.Add(Style_Table_List_6_Accent_3);var Style_Table_List_6_Accent_4=new CStyle("List Table 6 Colorful - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_List_6_Accent_4.Create_Table_List_6(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,64,null),fUF(EThemeColor.themecolorAccent4,154,149));this.Add(Style_Table_List_6_Accent_4);var Style_Table_List_6_Accent_5= new CStyle("List Table 6 Colorful - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_List_6_Accent_5.Create_Table_List_6(fUF(EThemeColor.themecolorAccent5,154,null),fUF(EThemeColor.themecolorAccent5,64,null),fUF(EThemeColor.themecolorAccent5,154,149));this.Add(Style_Table_List_6_Accent_5);var Style_Table_List_6_Accent_6=new CStyle("List Table 6 Colorful - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_List_6_Accent_6.Create_Table_List_6(fUF(EThemeColor.themecolorAccent6, 152,null),fUF(EThemeColor.themecolorAccent6,64,null),fUF(EThemeColor.themecolorAccent6,152,149));this.Add(Style_Table_List_6_Accent_6);var Style_Table_List_7_Accent=new CStyle("List Table 7 Colorful",this.Default.Table,null,styletype_Table);Style_Table_List_7_Accent.Create_Table_List_7(fUF(EThemeColor.themecolorText1,128,null),fUF(EThemeColor.themecolorText1,64,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorText1,128,149));this.Add(Style_Table_List_7_Accent);var Style_Table_List_7_Accent_1= new CStyle("List Table 7 Colorful - Accent 1",this.Default.Table,null,styletype_Table);Style_Table_List_7_Accent_1.Create_Table_List_7(fUF(EThemeColor.themecolorAccent1,null,null),fUF(EThemeColor.themecolorAccent1,64,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent1,null,149));this.Add(Style_Table_List_7_Accent_1);var Style_Table_List_7_Accent_2=new CStyle("List Table 7 Colorful - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_List_7_Accent_2.Create_Table_List_7(fUF(EThemeColor.themecolorAccent2, 151,null),fUF(EThemeColor.themecolorAccent2,64,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent2,151,149));this.Add(Style_Table_List_7_Accent_2);var Style_Table_List_7_Accent_3=new CStyle("List Table 7 Colorful - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_List_7_Accent_3.Create_Table_List_7(fUF(EThemeColor.themecolorAccent3,152,null),fUF(EThemeColor.themecolorAccent3,64,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent3, 152,149));this.Add(Style_Table_List_7_Accent_3);var Style_Table_List_7_Accent_4=new CStyle("List Table 7 Colorful - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_List_7_Accent_4.Create_Table_List_7(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,64,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent4,154,149));this.Add(Style_Table_List_7_Accent_4);var Style_Table_List_7_Accent_5=new CStyle("List Table 7 Colorful - Accent 5", this.Default.Table,null,styletype_Table);Style_Table_List_7_Accent_5.Create_Table_List_7(fUF(EThemeColor.themecolorAccent5,154,null),fUF(EThemeColor.themecolorAccent5,64,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent5,154,149));this.Add(Style_Table_List_7_Accent_5);var Style_Table_List_7_Accent_6=new CStyle("List Table 7 Colorful - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_List_7_Accent_6.Create_Table_List_7(fUF(EThemeColor.themecolorAccent6, 152,null),fUF(EThemeColor.themecolorAccent6,64,null),fUF(EThemeColor.themecolorLight1,null,null),fUF(EThemeColor.themecolorAccent6,152,149));this.Add(Style_Table_List_7_Accent_6);var Style_Table_Lined_Accent=new CStyle("Lined - Accent",this.Default.Table,null,styletype_Table);Style_Table_Lined_Accent.Create_Table_Lined(fUF(EThemeColor.themecolorText1,128,null),fUF(EThemeColor.themecolorText1,13,null));this.Add(Style_Table_Lined_Accent);var Style_Table_Lined_Accent1=new CStyle("Lined - Accent 1",this.Default.Table, null,styletype_Table);Style_Table_Lined_Accent1.Create_Table_Lined(fUF(EThemeColor.themecolorAccent1,234,null),fUF(EThemeColor.themecolorAccent1,80,null));this.Add(Style_Table_Lined_Accent1);var Style_Table_Lined_Accent2=new CStyle("Lined - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_Lined_Accent2.Create_Table_Lined(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorAccent2,50,null));this.Add(Style_Table_Lined_Accent2);var Style_Table_Lined_Accent3=new CStyle("Lined - Accent 3", this.Default.Table,null,styletype_Table);Style_Table_Lined_Accent3.Create_Table_Lined(fUF(EThemeColor.themecolorAccent3,254,null),fUF(EThemeColor.themecolorAccent3,52,null));this.Add(Style_Table_Lined_Accent3);var Style_Table_Lined_Accent4=new CStyle("Lined - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_Lined_Accent4.Create_Table_Lined(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,52,null));this.Add(Style_Table_Lined_Accent4);var Style_Table_Lined_Accent5= new CStyle("Lined - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_Lined_Accent5.Create_Table_Lined(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,52,null));this.Add(Style_Table_Lined_Accent5);var Style_Table_Lined_Accent6=new CStyle("Lined - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_Lined_Accent6.Create_Table_Lined(fUF(EThemeColor.themecolorAccent6,null,null),fUF(EThemeColor.themecolorAccent6,52,null));this.Add(Style_Table_Lined_Accent6); var Style_Table_BorderedLined_Accent0=new CStyle("Bordered & Lined - Accent",this.Default.Table,null,styletype_Table);Style_Table_BorderedLined_Accent0.Create_Table_BorderedAndLined(fUF(EThemeColor.themecolorText1,128,null),fUF(EThemeColor.themecolorText1,13,null),fUF(EThemeColor.themecolorText1,13,null),fUF(EThemeColor.themecolorText1,166,null));this.Add(Style_Table_BorderedLined_Accent0);var Style_Table_BorderedLined_Accent1=new CStyle("Bordered & Lined - Accent 1",this.Default.Table,null,styletype_Table); Style_Table_BorderedLined_Accent1.Create_Table_BorderedAndLined(fUF(EThemeColor.themecolorAccent1,234,null),fUF(EThemeColor.themecolorAccent1,80,null),fUF(EThemeColor.themecolorAccent1,80,null),fUF(EThemeColor.themecolorAccent1,null,149));this.Add(Style_Table_BorderedLined_Accent1);var Style_Table_BorderedLined_Accent2=new CStyle("Bordered & Lined - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_BorderedLined_Accent2.Create_Table_BorderedAndLined(fUF(EThemeColor.themecolorAccent2, 151,null),fUF(EThemeColor.themecolorAccent2,50,null),fUF(EThemeColor.themecolorAccent2,50,null),fUF(EThemeColor.themecolorAccent2,null,149));this.Add(Style_Table_BorderedLined_Accent2);var Style_Table_BorderedLined_Accent3=new CStyle("Bordered & Lined - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_BorderedLined_Accent3.Create_Table_BorderedAndLined(fUF(EThemeColor.themecolorAccent3,254,null),fUF(EThemeColor.themecolorAccent3,52,null),fUF(EThemeColor.themecolorAccent3,52,null),fUF(EThemeColor.themecolorAccent3, null,149));this.Add(Style_Table_BorderedLined_Accent3);var Style_Table_BorderedLined_Accent4=new CStyle("Bordered & Lined - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_BorderedLined_Accent4.Create_Table_BorderedAndLined(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4,52,null),fUF(EThemeColor.themecolorAccent4,52,null),fUF(EThemeColor.themecolorAccent4,null,149));this.Add(Style_Table_BorderedLined_Accent4);var Style_Table_BorderedLined_Accent5=new CStyle("Bordered & Lined - Accent 5", this.Default.Table,null,styletype_Table);Style_Table_BorderedLined_Accent5.Create_Table_BorderedAndLined(fUF(EThemeColor.themecolorAccent5,null,null),fUF(EThemeColor.themecolorAccent5,52,null),fUF(EThemeColor.themecolorAccent5,52,null),fUF(EThemeColor.themecolorAccent5,null,149));this.Add(Style_Table_BorderedLined_Accent5);var Style_Table_BorderedLined_Accent6=new CStyle("Bordered & Lined - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_BorderedLined_Accent6.Create_Table_BorderedAndLined(fUF(EThemeColor.themecolorAccent6, null,null),fUF(EThemeColor.themecolorAccent6,52,null),fUF(EThemeColor.themecolorAccent6,52,null),fUF(EThemeColor.themecolorAccent6,null,149));this.Add(Style_Table_BorderedLined_Accent6);var Style_Table_Bordered_Accent=new CStyle("Bordered",this.Default.Table,null,styletype_Table);Style_Table_Bordered_Accent.Create_Grid_Table_Light(fUF(EThemeColor.themecolorText1,128,null),fUF(EThemeColor.themecolorText1,38,null));this.Add(Style_Table_Bordered_Accent);var Style_Table_Bordered_Accent_1=new CStyle("Bordered - Accent 1", this.Default.Table,null,styletype_Table);Style_Table_Bordered_Accent_1.Create_Grid_Table_Light(fUF(EThemeColor.themecolorAccent1,null,null),fUF(EThemeColor.themecolorAccent1,103,null));this.Add(Style_Table_Bordered_Accent_1);var Style_Table_Bordered_Accent_2=new CStyle("Bordered - Accent 2",this.Default.Table,null,styletype_Table);Style_Table_Bordered_Accent_2.Create_Grid_Table_Light(fUF(EThemeColor.themecolorAccent2,151,null),fUF(EThemeColor.themecolorAccent2,103,null));this.Add(Style_Table_Bordered_Accent_2); var Style_Table_Bordered_Accent_3=new CStyle("Bordered - Accent 3",this.Default.Table,null,styletype_Table);Style_Table_Bordered_Accent_3.Create_Grid_Table_Light(fUF(EThemeColor.themecolorAccent3,152,null),fUF(EThemeColor.themecolorAccent3,103,null));this.Add(Style_Table_Bordered_Accent_3);var Style_Table_Bordered_Accent_4=new CStyle("Bordered - Accent 4",this.Default.Table,null,styletype_Table);Style_Table_Bordered_Accent_4.Create_Grid_Table_Light(fUF(EThemeColor.themecolorAccent4,154,null),fUF(EThemeColor.themecolorAccent4, 103,null));this.Add(Style_Table_Bordered_Accent_4);var Style_Table_Bordered_Accent_5=new CStyle("Bordered - Accent 5",this.Default.Table,null,styletype_Table);Style_Table_Bordered_Accent_5.Create_Grid_Table_Light(fUF(EThemeColor.themecolorAccent5,154,null),fUF(EThemeColor.themecolorAccent5,103,null));this.Add(Style_Table_Bordered_Accent_5);var Style_Table_Bordered_Accent_6=new CStyle("Bordered - Accent 6",this.Default.Table,null,styletype_Table);Style_Table_Bordered_Accent_6.Create_Grid_Table_Light(fUF(EThemeColor.themecolorAccent6, 152,null),fUF(EThemeColor.themecolorAccent6,103,null));this.Add(Style_Table_Bordered_Accent_6);var oHyperlink=new CStyle("Hyperlink",null,null,styletype_Character);oHyperlink.CreateHyperlink();this.Default.Hyperlink=this.Add(oHyperlink);var oFootnoteText=new CStyle("footnote text",this.Default.Paragraph,null,styletype_Paragraph);oFootnoteText.CreateFootnoteText();this.Default.FootnoteText=this.Add(oFootnoteText);this.Default.FootnoteTextChar=this.Add(oFootnoteText.CreateLinkedCharacterStyle("Footnote Text Char"), this.Default.Character);var oFootnoteReference=new CStyle("footnote reference",this.Default.Character,null,styletype_Character);oFootnoteReference.CreateFootnoteReference();this.Default.FootnoteReference=this.Add(oFootnoteReference);var oEndnoteText=new CStyle("endnote text",this.Default.Paragraph,null,styletype_Paragraph);oEndnoteText.CreateEndnoteText();this.Default.EndnoteText=this.Add(oEndnoteText);this.Default.EndnoteTextChar=this.Add(oEndnoteText.CreateLinkedCharacterStyle("Endnote Text Char"), this.Default.Character);var oEndnoteReference=new CStyle("endnote reference",this.Default.Character,null,styletype_Character);oEndnoteReference.CreateEndnoteReference();this.Default.EndnoteReference=this.Add(oEndnoteReference);for(var nLvl=0;nLvl<=8;++nLvl){var oStyleTOC=new CStyle("toc "+(nLvl+1),this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);oStyleTOC.CreateTOC(nLvl);this.Default.TOC[nLvl]=this.Add(oStyleTOC)}var oStyleTOCHeading=new CStyle("TOC Heading",this.Default.TOCHeading); oStyleTOCHeading.CreateTOCHeading();this.Default.TOCHeading=this.Add(oStyleTOCHeading);var oStyleTOF=new CStyle("table of figures",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);oStyleTOF.CreateTOF();this.Default.TOF=this.Add(oStyleTOF);g_oTableId.Add(this,this.Id)}else{this.Default={ParaPr:new CParaPr,TextPr:new CTextPr,TablePr:new CTablePr,TableRowPr:new CTableRowPr,TableCellPr:new CTableCellPr,Paragraph:null,Character:null,Numbering:null,Table:null,TableGrid:null,Headings:[], ParaList:null,Header:null,Footer:null,Hyperlink:null,FootnoteText:null,FootnoteTextChar:null,FootnoteReference:null,TOC:[],TOCHeading:null,TOF:null,Caption:null,EndnoteText:null,EndnoteTextChar:null,EndnoteReference:null};this.Default.ParaPr.InitDefault();this.Default.TextPr.InitDefault();this.Default.TablePr.InitDefault();this.Default.TableRowPr.InitDefault();this.Default.TableCellPr.InitDefault();this.Style=[]}this.LogicDocument=null}CStyles.prototype={GetId:function(){return this.Id},Get_Id:function(){return this.GetId()}, Add:function(Style){var Id=Style.Get_Id();History.Add(new CChangesStylesAdd(this,Id,Style));this.Style[Id]=Style;this.Update_Interface(Id);return Id},Remove:function(Id){History.Add(new CChangesStylesRemove(this,Id,this.Style[Id]));delete this.Style[Id];this.Update_Interface(Id)},SetDefaultParagraph:function(Id){if(Id!==this.Default.Paragraph){History.Add(new CChangesStylesChangeDefaultParagraphId(this,this.Default.Paragraph,Id));this.Default.Paragraph=Id}},SetDefaultCharacter:function(Id){if(Id!== this.Default.Character){History.Add(new CChangesStylesChangeDefaultCharacterId(this,this.Default.Character,Id));this.Default.Character=Id}},SetDefaultNumbering:function(Id){if(Id!==this.Default.Numbering){History.Add(new CChangesStylesChangeDefaultNumberingId(this,this.Default.Numbering,Id));this.Default.Numbering=Id}},SetDefaultTable:function(Id){if(Id!==this.Default.Table){History.Add(new CChangesStylesChangeDefaultTableId(this,this.Default.Table,Id));this.Default.Table=Id}},SetDefaultTableGrid:function(Id){if(Id!== this.Default.TableGrid){History.Add(new CChangesStylesChangeDefaultTableGridId(this,this.Default.TableGrid,Id));this.Default.TableGrid=Id}},SetDefaultParaList:function(Id){if(Id!==this.Default.ParaList){History.Add(new CChangesStylesChangeDefaultParaListId(this,this.Default.ParaList,Id));this.Default.ParaList=Id}},SetDefaultHeader:function(Id){if(Id!==this.Default.Header){History.Add(new CChangesStylesChangeDefaultHeaderId(this,this.Default.Header,Id));this.Default.Header=Id}},SetDefaultFooter:function(Id){if(Id!== this.Default.Footer){History.Add(new CChangesStylesChangeDefaultFooterId(this,this.Default.Footer,Id));this.Default.Footer=Id}},SetDefaultHyperlink:function(Id){if(Id!==this.Default.Hyperlink){History.Add(new CChangesStylesChangeDefaultHyperlinkId(this,this.Default.Hyperlink,Id));this.Default.Hyperlink=Id}},SetDefaultFootnoteText:function(Id){if(Id!==this.Default.FootnoteText){History.Add(new CChangesStylesChangeDefaultFootnoteTextId(this,this.Default.FootnoteText,Id));this.Default.FootnoteText=Id}}, SetDefaultFootnoteTextChar:function(Id){if(Id!==this.Default.FootnoteTextChar){History.Add(new CChangesStylesChangeDefaultFootnoteTextCharId(this,this.Default.FootnoteTextChar,Id));this.Default.FootnoteTextChar=Id}},SetDefaultFootnoteReference:function(Id){if(Id!==this.Default.FootnoteReference){History.Add(new CChangesStylesChangeDefaultFootnoteReferenceId(this,this.Default.FootnoteReference,Id));this.Default.FootnoteReference=Id}},SetDefaultHeading:function(Id,Lvl){if(Id!==this.Default.Headings[Lvl]){History.Add(new CChangesStylesChangeDefaultHeadingsId(this, this.Default.Headings[Lvl],Id,Lvl));this.Default.Headings[Lvl]=Id}},SetDefaultNoSpacing:function(Id){if(Id!==this.Default.NoSpacing){History.Add(new CChangesStylesChangeDefaultNoSpacingId(this,this.Default.NoSpacing,Id));this.Default.NoSpacing=Id}},SetDefaultTitle:function(Id){if(Id!==this.Default.Title){History.Add(new CChangesStylesChangeDefaultTitleId(this,this.Default.Title,Id));this.Default.Title=Id}},SetDefaultSubtitle:function(Id){if(Id!==this.Default.Subtitle){History.Add(new CChangesStylesChangeDefaultSubtitleId(this, this.Default.Subtitle,Id));this.Default.Subtitle=Id}},SetDefaultQuote:function(Id){if(Id!==this.Default.Quote){History.Add(new CChangesStylesChangeDefaultQuoteId(this,this.Default.Quote,Id));this.Default.Quote=Id}},SetDefaultIntenseQuote:function(Id){if(Id!==this.Default.IntenseQuote){History.Add(new CChangesStylesChangeDefaultIntenseQuoteId(this,this.Default.IntenseQuote,Id));this.Default.IntenseQuote=Id}},SetDefaultCaption:function(Id){if(Id!==this.Default.Caption){History.Add(new CChangesStylesChangeDefaultCaption(this, this.Default.Caption,Id));this.Default.Caption=Id}},SetDefaultEndnoteText:function(Id){if(Id!==this.Default.EndnoteText){History.Add(new CChangesStylesChangeDefaultEndnoteTextId(this,this.Default.EndnoteText,Id));this.Default.EndnoteText=Id}},SetDefaultEndnoteTextChar:function(Id){if(Id!==this.Default.EndnoteTextChar){History.Add(new CChangesStylesChangeDefaultEndnoteTextCharId(this,this.Default.EndnoteTextChar,Id));this.Default.EndnoteTextChar=Id}},SetDefaultEndnoteReference:function(Id){if(Id!== this.Default.EndnoteReference){History.Add(new CChangesStylesChangeDefaultEndnoteReferenceId(this,this.Default.EndnoteReference,Id));this.Default.EndnoteReference=Id}},RemapIdReferences:function(OldId,NewId){if(OldId===this.Default.Paragraph)this.SetDefaultParagraph(NewId);if(OldId===this.Default.Character)this.SetDefaultCharacter(NewId);if(OldId===this.Default.Numbering)this.SetDefaultNumbering(NewId);if(OldId===this.Default.Table)this.SetDefaultTable(NewId);if(OldId===this.Default.TableGrid)this.SetDefaultTableGrid(NewId); if(OldId===this.Default.ParaList)this.SetDefaultParaList(NewId);if(OldId===this.Default.Header)this.SetDefaultHeader(NewId);if(OldId===this.Default.Footer)this.SetDefaultFooter(NewId);if(OldId===this.Default.Hyperlink)this.SetDefaultHyperlink(NewId);if(OldId===this.Default.FootnoteText)this.SetDefaultFootnoteText(NewId);if(OldId===this.Default.FootnoteTextChar)this.SetDefaultFootnoteTextChar(NewId);if(OldId===this.Default.FootnoteReference)this.SetDefaultFootnoteReference(NewId);if(OldId===this.Default.EndnoteText)this.SetDefaultEndnoteText(NewId); if(OldId===this.Default.EndnoteTextChar)this.SetDefaultEndnoteTextChar(NewId);if(OldId===this.Default.EndnoteReference)this.SetDefaultEndnoteReference(NewId);for(var nIndex=0,nCount=this.Default.Headings.length;nIndex<nCount;++nIndex)if(OldId===this.Default.Headings[nIndex])this.SetDefaultHeading(NewId,nIndex);if(OldId===this.Default.NoSpacing)this.SetDefaultNoSpacing(NewId);if(OldId===this.Default.Title)this.SetDefaultTitle(NewId);if(OldId===this.Default.Subtitle)this.SetDefaultSubtitle(NewId);if(OldId=== this.Default.Quote)this.SetDefaultQuote(NewId);if(OldId===this.Default.IntenseQuote)this.SetDefaultIntenseQuote(NewId);if(OldId===this.Default.Caption)this.SetDefaultCaption(NewId);for(var Id in this.Style)this.Style[Id].RemapIdReferences(OldId,NewId)},Copy:function(){var Styles=new CStyles;Styles.Default.ParaPr=this.Default.ParaPr.Copy();Styles.Default.TextPr=this.Default.TextPr.Copy();Styles.Default.TablePr=this.Default.TablePr.Copy();Styles.Default.TableRowPr=this.Default.TableRowPr.Copy();Styles.Default.TableCellPr= this.Default.TableCellPr.Copy();Styles.Default.Paragraph=this.Default.Paragraph;Styles.Default.Character=this.Default.Character;Styles.Default.Numbering=this.Default.Numbering;Styles.Default.Table=this.Default.Table;Styles.Default.TableGrid=this.Default.TableGrid;Styles.Default.ParaList=this.Default.ParaList;Styles.Default.Header=this.Default.Header;Styles.Default.Footer=this.Default.Footer;Styles.Default.Hyperlink=this.Default.Hyperlink;Styles.Default.NoSpacing=this.Default.NoSpacing;Styles.Default.Title= this.Default.Title;Styles.Default.Subtitle=this.Default.Subtitle;Styles.Default.Quote=this.Default.Quote;Styles.Default.IntenseQuote=this.Default.IntenseQuote;Styles.Default.Caption=this.Default.Caption;for(var Index=0,Count=this.Default.Headings.length;Index<Count;Index++)Styles.Default.Headings[Index]=this.Default.Headings[Index];for(var StyleId in this.Style)Styles.Style[StyleId]=this.Style[StyleId].Copy();return Styles},CopyStyle:function(){var res=[];for(var StyleId in this.Style)res[StyleId]= this.Style[StyleId].Copy();return res},Get_DefaultParaPr:function(){return this.Default.ParaPr},Set_DefaultParaPr:function(ParaPr){History.Add(new CChangesStylesChangeDefaultParaPr(this,this.Default.ParaPr,ParaPr));this.Default.ParaPr.InitDefault();this.Default.ParaPr.Merge(ParaPr)},Get_DefaultTextPr:function(){return this.Default.TextPr},Set_DefaultTextPr:function(TextPr){History.Add(new CChangesStylesChangeDefaultTextPr(this,this.Default.TextPr,TextPr));this.Default.TextPr.InitDefault();this.Default.TextPr.Merge(TextPr)}, Set_LogicDocument:function(LogicDocument){this.LogicDocument=LogicDocument},Get_Pr:function(StyleId,Type,TableStyle,ShapeStyle){var Pr={TextPr:new CTextPr,ParaPr:new CParaPr};switch(Type){case styletype_Paragraph:{if(undefined===StyleId||null===StyleId)StyleId=this.Default.Paragraph;if(TableStyle!=null||ShapeStyle!=null){if(ShapeStyle!=null){Pr.TextPr.Merge(ShapeStyle.TextPr);if(!TableStyle)Pr.ParaPr.Merge(ShapeStyle.ParaPr)}if(TableStyle!=null){Pr.TextPr.Merge(TableStyle.TextPr);Pr.ParaPr.Merge(TableStyle.ParaPr)}}else{Pr.TextPr.Merge(this.Default.TextPr); Pr.ParaPr.Merge(this.Default.ParaPr)}break}case styletype_Table:{if(undefined===StyleId||null===StyleId)StyleId=this.Default.Table;Pr.TextPr=this.Default.TextPr.Copy();Pr.ParaPr=this.Default.ParaPr.Copy();Pr.TablePr=this.Default.TablePr.Copy();Pr.TableRowPr=this.Default.TableRowPr.Copy();Pr.TableCellPr=this.Default.TableCellPr.Copy();Pr.TableFirstCol=new CTableStylePr;Pr.TableFirstRow=new CTableStylePr;Pr.TableLastCol=new CTableStylePr;Pr.TableLastRow=new CTableStylePr;Pr.TableBand1Horz=new CTableStylePr; Pr.TableBand1Vert=new CTableStylePr;Pr.TableBand2Horz=new CTableStylePr;Pr.TableBand2Vert=new CTableStylePr;Pr.TableTLCell=new CTableStylePr;Pr.TableTRCell=new CTableStylePr;Pr.TableBLCell=new CTableStylePr;Pr.TableBRCell=new CTableStylePr;Pr.TableWholeTable=new CTableStylePr;break}case styletype_Character:{if(undefined===StyleId||null===StyleId)StyleId=this.Default.Character;Pr.TextPr=new CTextPr;break}}this.Internal_Get_Pr(Pr,StyleId,Type,null===TableStyle&&null==ShapeStyle?true:false,[],StyleId); if(styletype_Table===Type){Pr.ParaPr.Merge(Pr.TableWholeTable.ParaPr);Pr.TextPr.Merge(Pr.TableWholeTable.TextPr);Pr.TablePr.Merge(Pr.TableWholeTable.TablePr);Pr.TableRowPr.Merge(Pr.TableWholeTable.TableRowPr);Pr.TableCellPr.Merge(Pr.TableWholeTable.TableCellPr)}return Pr},Get_Next:function(StyleId){var NextId=this.Style[StyleId].Next;if(null!==NextId&&undefined!==this.Style[NextId])return NextId;return null},Get_Name:function(StyleId){if(undefined!=this.Style[StyleId])return this.Style[StyleId].Name; return""},Get_Default_Paragraph:function(){return this.Default.Paragraph},Get_Default_Character:function(){return this.Default.Character},Get_Default_Numbering:function(){return this.Default.Numbering},Get_Default_Table:function(){return this.Default.Table},Get_Default_TableGrid:function(){return this.Default.TableGrid},Get_Default_Heading:function(Lvl){Lvl=Math.max(Math.min(Lvl,8),0);return this.Default.Headings[Lvl]},Get_Default_ParaList:function(){return this.Default.ParaList},Get_Default_Header:function(){return this.Default.Header}, Get_Default_Footer:function(){return this.Default.Footer},Internal_Get_Pr:function(Pr,StyleId,Type,bUseDefault,PassedStyles,StartStyleId){for(var nIndex=0,nCount=PassedStyles.length;nIndex<nCount;nIndex++)if(PassedStyles[nIndex]==StyleId)return;PassedStyles.push(StyleId);var Style=this.Style[StyleId];if(undefined==StyleId||undefined===Style){if(true===bUseDefault)switch(Type){case styletype_Paragraph:{var DefId=this.Default.Paragraph;if(undefined!=this.Style[DefId]){Pr.ParaPr.Merge(this.Style[DefId].ParaPr); Pr.TextPr.Merge(this.Style[DefId].TextPr)}break}case styletype_Numbering:{var DefId=this.Default.Numbering;break}case styletype_Table:{var DefId=this.Default.Table;if(undefined!=this.Style[DefId]){Pr.ParaPr.Merge(this.Style[DefId].ParaPr);Pr.TextPr.Merge(this.Style[DefId].TextPr);Pr.TablePr.Merge(this.Styles[DefId].TablePr);Pr.TableRowPr.Merge(this.Styles[DefId].TableRowPr);Pr.TableCellPr.Merge(this.Styles[DefId].TableCellPr)}break}case styletype_Character:{var DefId=this.Default.Character;if(undefined!= this.Style[DefId])Pr.TextPr.Merge(this.Style[DefId].TextPr);break}}return}if(null===Style.BasedOn){if(true===bUseDefault)switch(Type){case styletype_Paragraph:{break}case styletype_Numbering:{var DefId=this.Default.Numbering;break}case styletype_Table:{var DefId=this.Default.Table;break}case styletype_Character:{var DefId=this.Default.Character;if(undefined!=this.Style[DefId])Pr.TextPr.Merge(this.Style[DefId].TextPr);break}}}else this.Internal_Get_Pr(Pr,Style.BasedOn,Type,false,PassedStyles,StartStyleId); var oLogicDocument=this.private_GetLogicDocument();if((styletype_Paragraph===Type||styletype_Table===Type)&&undefined!=Style.ParaPr.NumPr&&oLogicDocument){var oNumbering=oLogicDocument.GetNumbering();if(0!==Style.ParaPr.NumPr.NumId){var sNumId=Style.ParaPr.NumPr.NumId;if(undefined===sNumId&&Pr.ParaPr.NumPr)sNumId=Pr.ParaPr.NumPr.NumId;var oNum=oNumbering.GetNum(sNumId);if(oNum){var nLvl=oNum.GetLvlByStyle(StyleId);if(-1!=nLvl)Pr.ParaPr.Merge(oNumbering.GetParaPr(sNumId,nLvl));else if(undefined!== Style.ParaPr.NumPr.Lvl)Pr.ParaPr.Merge(oNumbering.GetParaPr(sNumId,Style.ParaPr.NumPr.Lvl));else Pr.ParaPr.NumPr=undefined}}else{Pr.ParaPr.NumPr=undefined;Pr.ParaPr.Ind.Left=0;Pr.ParaPr.Ind.FirstLine=0}}switch(Type){case styletype_Paragraph:{Pr.ParaPr.Merge(Style.ParaPr);Pr.TextPr.Merge(Style.TextPr);break}case styletype_Numbering:{break}case styletype_Table:{Pr.ParaPr.Merge(Style.ParaPr);Pr.TextPr.Merge(Style.TextPr);if(undefined!==Style.TablePr){Pr.TablePr.Merge(Style.TablePr);Pr.TableRowPr.Merge(Style.TableRowPr); Pr.TableCellPr.Merge(Style.TableCellPr);Pr.TableBand1Horz.Merge(Style.TableBand1Horz);Pr.TableBand1Vert.Merge(Style.TableBand1Vert);Pr.TableBand2Horz.Merge(Style.TableBand2Horz);Pr.TableBand2Vert.Merge(Style.TableBand2Vert);Pr.TableFirstCol.Merge(Style.TableFirstCol);Pr.TableFirstRow.Merge(Style.TableFirstRow);Pr.TableLastCol.Merge(Style.TableLastCol);Pr.TableLastRow.Merge(Style.TableLastRow);Pr.TableTLCell.Merge(Style.TableTLCell);Pr.TableTRCell.Merge(Style.TableTRCell);Pr.TableBLCell.Merge(Style.TableBLCell); Pr.TableBRCell.Merge(Style.TableBRCell);Pr.TableWholeTable.Merge(Style.TableWholeTable)}break}case styletype_Character:{Pr.TextPr.Merge(Style.TextPr);break}}},Document_Get_AllFontNames:function(AllFonts){for(var Id in this.Style){var Style=this.Style[Id];Style.Document_Get_AllFontNames(AllFonts)}this.Default.TextPr.Document_Get_AllFontNames(AllFonts)},Get_AllTableStyles:function(){var TableStyles=[];for(var Id in this.Style){var Style=this.Style[Id];if(styletype_Table===Style.Type)TableStyles.push(Id)}return TableStyles}, Update_Interface:function(StyleId){if(null!=this.LogicDocument&&undefined!==this.LogicDocument)this.LogicDocument.Add_ChangedStyle(this.private_GetAllBasedStylesId(StyleId))},private_GetAllBasedStylesId:function(StyleId){var arrStyles=[];arrStyles.push(StyleId);for(var CurStyleId in this.Style){if(CurStyleId==StyleId)arrStyles.push(StyleId);var oStyle=this.Style[CurStyleId];var BaseId=oStyle.Get_BasedOn();var PassedStyles=[];while(null!=BaseId&&undefined!=BaseId){var bBreak=false;for(var nIndex=0, nCount=PassedStyles.length;nIndex<nCount;nIndex++)if(PassedStyles[nIndex]==BaseId){bBreak=true;break}if(true===bBreak)break;PassedStyles.push(BaseId);if(BaseId==StyleId){arrStyles.push(CurStyleId);break}var BaseStyle=this.Style[BaseId];if(!BaseStyle)break;BaseId=BaseStyle.Get_BasedOn()}}return arrStyles},Check_StyleNumberingOnLoad:function(Numbering){for(var StyleId in this.Style){var Style=this.Style[StyleId];var oNumPr=Style.ParaPr.NumPr;if(!oNumPr||!oNumPr.NumId)continue;var oNum=Numbering.GetNum(oNumPr.NumId); if(!oNum)continue;var nLvl=oNumPr.Lvl?oNumPr.Lvl:0;var oLvl=oNum.GetLvl(nLvl);if(!oLvl||oLvl.GetPStyle())continue;var oNewLvl=oLvl.Copy();oNewLvl.PStyle=StyleId;oNum.SetLvl(oNewLvl,nLvl)}},GetSelectionState:function(){},SetSelectionState:function(State,StateIndex){},Get_ParentObject_or_DocumentPos:function(){return{Type:AscDFH.historyitem_recalctype_Inline,Data:0}},Refresh_RecalcData:function(Data){var Type=Data.Type;var bNeedRecalc=false;switch(Type){case AscDFH.historyitem_Styles_Add:case AscDFH.historyitem_Styles_Remove:{bNeedRecalc= true;break}}if(true===bNeedRecalc)return this.Refresh_RecalcData2(Data.Id)},Refresh_RecalcData2:function(StyleId){if(undefined!=StyleId){var LogicDocument=editor.WordControl.m_oLogicDocument;var AllParagraphs=[];if(StyleId!=this.Default.Paragraph){var AllStylesId=this.private_GetAllBasedStylesId(StyleId);AllParagraphs=LogicDocument.GetAllParagraphsByStyle(AllStylesId)}else AllParagraphs=LogicDocument.GetAllParagraphs({All:true});var Count=AllParagraphs.length;for(var Index=0;Index<Count;Index++){var Para= AllParagraphs[Index];Para.Refresh_RecalcData({Type:AscDFH.historyitem_Paragraph_PStyle})}}},Load_LinkData:function(LinkData){if(undefined!==LinkData.UpdateStyleId){var StyleId=LinkData.UpdateStyleId;var LogicDocument=editor.WordControl.m_oLogicDocument;if(!LogicDocument)return;var AllParagraphs=[];if(StyleId!=this.Default.Paragraph){var AllStylesId=this.private_GetAllBasedStylesId(StyleId);AllParagraphs=LogicDocument.GetAllParagraphsByStyle(AllStylesId)}else AllParagraphs=LogicDocument.GetAllParagraphs({All:true}); var Count=AllParagraphs.length;for(var Index=0;Index<Count;Index++){var Para=AllParagraphs[Index];Para.Recalc_CompiledPr();Para.Recalc_RunsCompiledPr()}}}};CStyles.prototype.Get=function(sStyleId){return this.Style[sStyleId]?this.Style[sStyleId]:null};CStyles.prototype.GetStyleIdByName=function(sName,isReturnParaDefault){for(var sId in this.Style){var oStyle=this.Style[sId];if(sName===oStyle.GetName())return sId}if(isReturnParaDefault)return this.Default.Paragraph;return null};CStyles.prototype.Create_StyleFromInterface= function(oAscStyle,bCheckLink){var sStyleName=oAscStyle.get_Name();var sStyleId=this.GetStyleIdByName(sStyleName);if(null!==sStyleId){var oStyle=this.Style[sStyleId];var NewStyleParaPr=oAscStyle.get_ParaPr();var NewStyleTextPr=oAscStyle.get_TextPr();var BasedOnId=this.GetStyleIdByName(oAscStyle.get_BasedOn());var NextId=this.GetStyleIdByName(oAscStyle.get_Next());oStyle.Set_Type(oAscStyle.get_Type());if(BasedOnId===sStyleId||sStyleId===this.Default.Paragraph){if(sStyleId!==this.Default.Paragraph){var oBaseStyle= this.Get(BasedOnId);var oBasedBasesOnId=this.Get_Default_Paragraph();if(oBaseStyle){oBasedBasesOnId=oBaseStyle.Get_BasedOn();if(oBaseStyle.Get_BasedOn()!==sStyleId)oBasedBasesOnId=oBaseStyle.Get_BasedOn()}oStyle.Set_BasedOn(oBasedBasesOnId)}else oStyle.Set_BasedOn(null);var OldStyleParaPr=oStyle.ParaPr.Copy();var OldStyleTextPr=oStyle.TextPr.Copy();OldStyleParaPr.Merge(NewStyleParaPr);OldStyleTextPr.Merge(NewStyleTextPr);NewStyleParaPr=OldStyleParaPr;NewStyleTextPr=OldStyleTextPr}else oStyle.Set_BasedOn(BasedOnId); if(null===oStyle.Get_Next()||null!==NextId&&NextId!==sStyleId)if(NextId===sStyleId)oStyle.Set_Next(null);else oStyle.Set_Next(NextId);var oAscLink=oAscStyle.get_Link();var sOldLinkId=oStyle.Get_Link();if(sOldLinkId&&this.Style[sOldLinkId])oAscLink.put_Name(this.Style[sOldLinkId].GetName());else bCheckLink=false;if(false!=bCheckLink&&null!=oAscLink&&undefined!==oAscLink){var oLinkedStyle=this.Create_StyleFromInterface(oAscLink,false);oStyle.Set_Link(oLinkedStyle.Get_Id());oLinkedStyle.Set_Link(oStyle.Get_Id())}oStyle.Set_TextPr(NewStyleTextPr); oStyle.Set_ParaPr(NewStyleParaPr,true);return oStyle}else{var oStyle=new CStyle;var BasedOnId=this.GetStyleIdByName(oAscStyle.get_BasedOn());oStyle.Set_BasedOn(BasedOnId);oStyle.Set_Next(this.GetStyleIdByName(oAscStyle.get_Next()));oStyle.Set_Type(oAscStyle.get_Type());oStyle.Set_TextPr(oAscStyle.get_TextPr());oStyle.Set_ParaPr(oAscStyle.get_ParaPr(),true);oStyle.Set_Name(sStyleName);oStyle.SetCustom(true);if(styletype_Paragraph===oStyle.Get_Type())oStyle.Set_QFormat(true);var oAscLink=oAscStyle.get_Link(); if(false!=bCheckLink&&null!=oAscLink&&undefined!==oAscLink){var oLinkedStyle=this.Create_StyleFromInterface(oAscLink,false);oStyle.Set_Link(oLinkedStyle.Get_Id());oLinkedStyle.Set_Link(oStyle.Get_Id())}this.Add(oStyle);return oStyle}};CStyles.prototype.Remove_StyleFromInterface=function(StyleId){var Style=this.Style[StyleId];if(StyleId==this.Default.Paragraph){Style.Clear("Normal",null,null,styletype_Paragraph);Style.CreateNormal()}else if(StyleId==this.Default.Character){Style.Clear("Default Paragraph Font", null,null,styletype_Character);Style.CreateDefaultParagraphFont()}else if(StyleId==this.Default.Numbering){Style.Clear("No List",null,null,styletype_Numbering);Style.CreateNoList()}else if(StyleId==this.Default.Table){Style.Clear("Normal Table",null,null,styletype_Table);Style.Create_NormalTable()}else if(StyleId==this.Default.TableGrid){Style.Clear("Table Grid",this.Default.Table,null,styletype_Table);Style.Create_TableGrid()}else if(StyleId==this.Default.Headings[0]){Style.Clear("Heading 1",this.Default.Paragraph, this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(0)}else if(StyleId==this.Default.Headings[1]){Style.Clear("Heading 2",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(1)}else if(StyleId==this.Default.Headings[2]){Style.Clear("Heading 3",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(2)}else if(StyleId==this.Default.Headings[3]){Style.Clear("Heading 4",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph); Style.CreateHeading(3)}else if(StyleId==this.Default.Headings[4]){Style.Clear("Heading 5",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(4)}else if(StyleId==this.Default.Headings[5]){Style.Clear("Heading 6",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(5)}else if(StyleId==this.Default.Headings[6]){Style.Clear("Heading 7",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(6)}else if(StyleId== this.Default.Headings[7]){Style.Clear("Heading 8",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(7)}else if(StyleId==this.Default.Headings[8]){Style.Clear("Heading 9",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(8)}else if(StyleId==this.Default.ParaList){Style.Clear("List Paragraph",this.Default.Paragraph,null,styletype_Paragraph);Style.CreateListParagraph()}else if(StyleId==this.Default.Header){Style.Clear("Header", this.Default.Paragraph,null,styletype_Paragraph);Style.CreateHeader()}else if(StyleId==this.Default.Footer){Style.Clear("Footer",this.Default.Paragraph,null,styletype_Paragraph);Style.CreateFooter()}else if(StyleId==this.Default.Hyperlink){Style.Clear("Hyperlink",null,null,styletype_Character);Style.CreateHyperlink()}else if(StyleId==this.Default.NoSpacing){Style.Clear("No Spacing",this.Default.Paragraph,null,styletype_Paragraph);Style.CreateNoSpacing()}else if(StyleId===this.Default.Title){Style.Clear("Title", this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateTitle()}else if(StyleId===this.Default.Subtitle){Style.Clear("Subtitle",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateSubtitle()}else if(StyleId===this.Default.Quote){Style.Clear("Quote",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateQuote()}else if(StyleId===this.Default.IntenseQuote){Style.Clear("Intense Quote",this.Default.Paragraph,this.Default.Paragraph, styletype_Paragraph);Style.CreateIntenseQuote()}else{this.Remove(StyleId);if(this.LogicDocument){var AllParagraphs=this.LogicDocument.GetAllParagraphsByStyle([StyleId]);var Count=AllParagraphs.length;for(var Index=0;Index<Count;Index++){var Para=AllParagraphs[Index];Para.Style_Remove()}}}this.Update_Interface(StyleId)};CStyles.prototype.Remove_AllCustomStylesFromInterface=function(){for(var StyleId in this.Style){var Style=this.Style[StyleId];if((styletype_Paragraph===Style.GetType()||styletype_Character=== Style.GetType())&&true===Style.GetQFormat())this.Remove_StyleFromInterface(StyleId)}};CStyles.prototype.Is_StyleDefault=function(sStyleName){var StyleId=this.GetStyleIdByName(sStyleName);if(null===StyleId)return false;if(StyleId==this.Default.Paragraph||StyleId==this.Default.Character||StyleId==this.Default.Numbering||StyleId==this.Default.Table||StyleId==this.Default.TableGrid||StyleId==this.Default.Headings[0]||StyleId==this.Default.Headings[1]||StyleId==this.Default.Headings[2]||StyleId==this.Default.Headings[3]|| StyleId==this.Default.Headings[4]||StyleId==this.Default.Headings[5]||StyleId==this.Default.Headings[6]||StyleId==this.Default.Headings[7]||StyleId==this.Default.Headings[8]||StyleId==this.Default.ParaList||StyleId==this.Default.Header||StyleId==this.Default.Footer||StyleId==this.Default.Hyperlink||StyleId==this.Default.FootnoteText||StyleId==this.Default.FootnoteTextChar||StyleId==this.Default.FootnoteReference||StyleId==this.Default.NoSpacing||StyleId==this.Default.Title||StyleId==this.Default.Subtitle|| StyleId==this.Default.Quote||StyleId==this.Default.IntenseQuote||StyleId==this.Default.Caption||StyleId==this.Default.EndnoteText||StyleId==this.Default.EndnoteTextChar||StyleId==this.Default.EndnoteReference)return true;return false};CStyles.prototype.Is_DefaultStyleChanged=function(sStyleName){if(true!=this.Is_StyleDefault(sStyleName))return false;var StyleId=this.GetStyleIdByName(sStyleName);if(null===StyleId)return false;var CurrentStyle=this.Style[StyleId];this.LogicDocument.TurnOffHistory(); var Style=new CStyle;if(StyleId==this.Default.Paragraph){Style.Clear("Normal",null,null,styletype_Paragraph);Style.CreateNormal()}else if(StyleId==this.Default.Character){Style.Clear("Default Paragraph Font",null,null,styletype_Character);Style.CreateDefaultParagraphFont()}else if(StyleId==this.Default.Numbering){Style.Clear("No List",null,null,styletype_Numbering);Style.CreateNoList()}else if(StyleId==this.Default.Table){Style.Clear("Normal Table",null,null,styletype_Table);Style.Create_NormalTable()}else if(StyleId== this.Default.TableGrid){Style.Clear("Table Grid",this.Default.Table,null,styletype_Table);Style.Create_TableGrid()}else if(StyleId==this.Default.Headings[0]){Style.Clear("Heading 1",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(0)}else if(StyleId==this.Default.Headings[1]){Style.Clear("Heading 2",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(1)}else if(StyleId==this.Default.Headings[2]){Style.Clear("Heading 3",this.Default.Paragraph, this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(2)}else if(StyleId==this.Default.Headings[3]){Style.Clear("Heading 4",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(3)}else if(StyleId==this.Default.Headings[4]){Style.Clear("Heading 5",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(4)}else if(StyleId==this.Default.Headings[5]){Style.Clear("Heading 6",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph); Style.CreateHeading(5)}else if(StyleId==this.Default.Headings[6]){Style.Clear("Heading 7",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(6)}else if(StyleId==this.Default.Headings[7]){Style.Clear("Heading 8",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(7)}else if(StyleId==this.Default.Headings[8]){Style.Clear("Heading 9",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateHeading(8)}else if(StyleId== this.Default.ParaList){Style.Clear("List Paragraph",this.Default.Paragraph,null,styletype_Paragraph);Style.CreateListParagraph()}else if(StyleId==this.Default.Header){Style.Clear("Header",this.Default.Paragraph,null,styletype_Paragraph);Style.CreateHeader()}else if(StyleId==this.Default.Footer){Style.Clear("Footer",this.Default.Paragraph,null,styletype_Paragraph);Style.CreateFooter()}else if(StyleId==this.Default.Hyperlink){Style.Clear("Hyperlink",null,null,styletype_Character);Style.CreateHyperlink()}else if(StyleId== this.Default.NoSpacing){Style.Clear("No Spacing",this.Default.Paragraph,null,styletype_Paragraph);Style.CreateNoSpacing()}else if(StyleId===this.Default.Title){Style.Clear("Title",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateTitle()}else if(StyleId===this.Default.Subtitle){Style.Clear("Subtitle",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateSubtitle()}else if(StyleId===this.Default.Quote){Style.Clear("Quote",this.Default.Paragraph, this.Default.Paragraph,styletype_Paragraph);Style.CreateQuote()}else if(StyleId===this.Default.IntenseQuote){Style.Clear("Intense Quote",this.Default.Paragraph,this.Default.Paragraph,styletype_Paragraph);Style.CreateIntenseQuote()}this.LogicDocument.TurnOnHistory();return true===Style.Is_Equal(CurrentStyle)?false:true};CStyles.prototype.GetDefaultParagraph=function(){return this.Default.Paragraph};CStyles.prototype.GetDefaultFootnoteText=function(){return this.Default.FootnoteText};CStyles.prototype.GetDefaultFootnoteTextChar= function(){return this.Default.FootnoteTextChar};CStyles.prototype.GetDefaultFootnoteReference=function(){return this.Default.FootnoteReference};CStyles.prototype.GetDefaultEndnoteText=function(){return this.Default.EndnoteText};CStyles.prototype.GetDefaultEndnoteTextChar=function(){return this.Default.EndnoteTextChar};CStyles.prototype.GetDefaultEndnoteReference=function(){return this.Default.EndnoteReference};CStyles.prototype.GetDefaultTOC=function(nLvl){nLvl=Math.max(Math.min(nLvl,8),0);return this.Default.TOC[nLvl]}; CStyles.prototype.GetDefaultTOCHeading=function(){return this.Default.TOCHeading};CStyles.prototype.GetDefaultTOF=function(){return this.Default.TOF};CStyles.prototype.GetDefaultHyperlink=function(){return this.Default.Hyperlink};CStyles.prototype.GetDefaultHeading=function(nLvl){return this.Default.Headings[Math.max(Math.min(nLvl,8),0)]};CStyles.prototype.GetHeadingLevelByName=function(sStyleName){var sId=this.GetStyleIdByName(sStyleName);if(!sId)return-1;for(var nIndex=0;nIndex<=8;++nIndex)if(sId=== this.Default.Headings[nIndex])return nIndex;return-1};CStyles.prototype.GetTOCStylesType=function(){if(this.private_CheckTOCStyles(Asc.c_oAscTOCStylesType.Simple))return Asc.c_oAscTOCStylesType.Simple;else if(this.private_CheckTOCStyles(Asc.c_oAscTOCStylesType.Standard))return Asc.c_oAscTOCStylesType.Standard;else if(this.private_CheckTOCStyles(Asc.c_oAscTOCStylesType.Modern))return Asc.c_oAscTOCStylesType.Modern;else if(this.private_CheckTOCStyles(Asc.c_oAscTOCStylesType.Classic))return Asc.c_oAscTOCStylesType.Classic; else if(this.private_CheckTOCStyles(Asc.c_oAscTOCStylesType.Web))return Asc.c_oAscTOCStylesType.Web;return Asc.c_oAscTOCStylesType.Current};CStyles.prototype.private_CheckTOCStyles=function(nType){for(var nLvl=0;nLvl<=8;++nLvl)if(!this.private_CheckTOCStyle(nLvl,nType))return false;return true};CStyles.prototype.private_CheckTOCStyle=function(nLvl,nType){var oTOCStyle=this.Get(this.GetDefaultTOC(nLvl));if(!this.LogicDocument||!oTOCStyle)return false;this.LogicDocument.TurnOffHistory();var oCheckStyle= new CStyle;oCheckStyle.Clear(oTOCStyle.GetName(),oTOCStyle.GetBasedOn(),oTOCStyle.GetNext(),oTOCStyle.GetType());oCheckStyle.CreateTOC(nLvl,nType);this.LogicDocument.TurnOnHistory();return!!oCheckStyle.IsEqual(oTOCStyle)};CStyles.prototype.GetTOFStyleType=function(){if(this.private_CheckTOFStyle(Asc.c_oAscTOFStylesType.Classic))return Asc.c_oAscTOFStylesType.Classic;else if(this.private_CheckTOFStyle(Asc.c_oAscTOFStylesType.Distinctive))return Asc.c_oAscTOFStylesType.Distinctive;else if(this.private_CheckTOFStyle(Asc.c_oAscTOFStylesType.Centered))return Asc.c_oAscTOFStylesType.Centered; else if(this.private_CheckTOFStyle(Asc.c_oAscTOFStylesType.Formal))return Asc.c_oAscTOFStylesType.Formal;else if(this.private_CheckTOFStyle(Asc.c_oAscTOFStylesType.Simple))return Asc.c_oAscTOFStylesType.Simple;else if(this.private_CheckTOFStyle(Asc.c_oAscTOFStylesType.Web))return Asc.c_oAscTOFStylesType.Web;return Asc.c_oAscTOFStylesType.Current};CStyles.prototype.private_CheckTOFStyle=function(nType){var oTOCStyle=this.Get(this.GetDefaultTOF());if(!this.LogicDocument||!oTOCStyle)return false;this.LogicDocument.TurnOffHistory(); var oCheckStyle=new CStyle;oCheckStyle.Clear(oTOCStyle.GetName(),oTOCStyle.GetBasedOn(),oTOCStyle.GetNext(),oTOCStyle.GetType());oCheckStyle.CreateTOF(nType);this.LogicDocument.TurnOnHistory();return!!oCheckStyle.IsEqual(oTOCStyle)};CStyles.prototype.SetTOCStylesType=function(nType){if(Asc.c_oAscTOCStylesType.Current===nType)return;for(var nLvl=0;nLvl<=8;++nLvl){var oStyle=this.Get(this.GetDefaultTOC(nLvl));if(!oStyle)continue;oStyle.Clear(oStyle.GetName(),oStyle.GetBasedOn(),oStyle.GetNext(),oStyle.GetType()); oStyle.CreateTOC(nLvl,nType)}};CStyles.prototype.SetTOFStyleType=function(nType){if(Asc.c_oAscTOCStylesType.Current===nType)return;var oStyle=this.Get(this.GetDefaultTOF());if(!oStyle)return;oStyle.Clear(oStyle.GetName(),oStyle.GetBasedOn(),oStyle.GetNext(),oStyle.GetType());oStyle.CreateTOF(nType)};CStyles.prototype.GetAscStylesArray=function(){var arrStyles=[];for(var sId in this.Style)arrStyles.push(this.Style[sId].ToAscStyle());return arrStyles};CStyles.prototype.private_GetLogicDocument=function(){return editor&& editor.WordControl&&editor.WordControl.m_oLogicDocument?editor.WordControl.m_oLogicDocument:null};CStyles.prototype.Document_Is_SelectionLocked=function(CheckType){switch(CheckType){case AscCommon.changestype_Paragraph_Content:case AscCommon.changestype_Paragraph_Properties:case AscCommon.changestype_Paragraph_AddText:case AscCommon.changestype_Paragraph_TextProperties:case AscCommon.changestype_ContentControl_Add:case AscCommon.changestype_Document_Content:case AscCommon.changestype_Document_Content_Add:case AscCommon.changestype_Image_Properties:case AscCommon.changestype_Remove:case AscCommon.changestype_Delete:case AscCommon.changestype_Document_SectPr:case AscCommon.changestype_Table_Properties:case AscCommon.changestype_Table_RemoveCells:case AscCommon.changestype_HdrFtr:{AscCommon.CollaborativeEditing.Add_CheckLock(true); break}}};CStyles.prototype.UpdateDefaultsDependingOnCompatibility=function(nCompatibilityMode){this.Default.ParaPr.InitDefault(nCompatibilityMode);this.Default.TextPr.InitDefault(nCompatibilityMode);this.Default.TablePr.InitDefault(nCompatibilityMode);this.Default.TableRowPr.InitDefault(nCompatibilityMode);this.Default.TableCellPr.InitDefault(nCompatibilityMode);g_oDocumentDefaultTextPr.InitDefault(nCompatibilityMode);g_oDocumentDefaultParaPr.InitDefault(nCompatibilityMode);g_oDocumentDefaultTablePr.InitDefault(nCompatibilityMode); g_oDocumentDefaultTableCellPr.InitDefault(nCompatibilityMode);g_oDocumentDefaultTableRowPr.InitDefault(nCompatibilityMode);g_oDocumentDefaultTableStylePr.InitDefault(nCompatibilityMode)};CStyles.prototype.GetDefaultParaPrForWrite=function(){var oParaPr=new CParaPr;oParaPr.InitDefault();return this.Default.ParaPr.GetDiff(oParaPr)};CStyles.prototype.GetDefaultTextPrForWrite=function(){var oTextPr=new CTextPr;oTextPr.InitDefault();return this.Default.TextPr.GetDiff(oTextPr)};function CDocumentColor(r, g,b,Auto){this.r=r;this.g=g;this.b=b;this.Auto=Auto===undefined?false:Auto}CDocumentColor.prototype={Copy:function(){return new CDocumentColor(this.r,this.g,this.b,this.Auto)},Write_ToBinary:function(Writer){Writer.WriteByte(this.r);Writer.WriteByte(this.g);Writer.WriteByte(this.b);Writer.WriteBool(this.Auto)},Read_FromBinary:function(Reader){this.r=Reader.GetByte();this.g=Reader.GetByte();this.b=Reader.GetByte();this.Auto=Reader.GetBool()},Set:function(r,g,b,Auto){this.r=r;this.g=g;this.b=b;this.Auto= Auto===undefined?false:Auto},Check_BlackAutoColor:function(){if(.5*this.r+this.g+.195*this.b<103)return false;return true}};CDocumentColor.prototype.WriteToBinary=function(oWriter){this.Write_ToBinary(oWriter)};CDocumentColor.prototype.ReadFromBinary=function(oReader){this.Read_FromBinary(oReader)};CDocumentColor.prototype.IsEqual=function(oColor){if(!oColor||this.Auto!==oColor.Auto)return false;if(true===this.Auto)return true;return this.r===oColor.r&&this.g===oColor.g&&this.b===oColor.b};CDocumentColor.prototype.Compare= function(Color){return this.IsEqual(Color)};CDocumentColor.prototype.Is_Equal=function(Color){return this.IsEqual(Color)};function CDocumentShd(){this.Value=Asc.c_oAscShd.Nil;this.Color=new CDocumentColor(255,255,255);this.Unifill=undefined;this.FillRef=undefined}CDocumentShd.prototype={Copy:function(){var Shd=new CDocumentShd;Shd.Value=this.Value;if(undefined!==this.Color)Shd.Color.Set(this.Color.r,this.Color.g,this.Color.b,this.Color.Auto);if(undefined!==this.Unifill)Shd.Unifill=this.Unifill.createDuplicate(); if(undefined!==this.FillRef)Shd.FillRef=this.FillRef.createDuplicate();return Shd},Compare:function(Shd){if(undefined===Shd)return false;if(this.Value===Shd.Value)switch(this.Value){case c_oAscShdNil:return true;case c_oAscShdClear:{return this.Color.Compare(Shd.Color)&&AscFormat.CompareUnifillBool(this.Unifill,Shd.Unifill)}}return false},Is_Equal:function(Shd){return this.IsEqual(Shd)},Get_Color:function(Paragraph){if(undefined!==this.Unifill){this.Unifill.check(Paragraph.Get_Theme(),Paragraph.Get_ColorMap()); var RGBA=this.Unifill.getRGBAColor();return new CDocumentColor(RGBA.R,RGBA.G,RGBA.B,false)}else return this.Color},Get_Color2:function(Theme,ColorMap){if(undefined!==this.Unifill){this.Unifill.check(Theme,ColorMap);var RGBA=this.Unifill.getRGBAColor();return new CDocumentColor(RGBA.R,RGBA.G,RGBA.B,false)}else return this.Color},Get_Color3:function(Theme,ColorMap){if(undefined!==this.Unifill){this.Unifill.check(Theme,ColorMap);return this.Unifill.getRGBAColor()}else return{R:255,G:255,B:255,A:255}}, InitDefault:function(){this.Value=c_oAscShdNil;this.Color.Set(0,0,0,false);this.Unifill=undefined;this.FillRef=undefined},Set_FromObject:function(Shd){if(undefined===Shd){this.Value=c_oAscShdNil;return}this.Value=Shd.Value;if(c_oAscShdNil!=Shd.Value){if(undefined!=Shd.Color)this.Color.Set(Shd.Color.r,Shd.Color.g,Shd.Color.b,Shd.Color.Auto);if(undefined!=Shd.Unifill)this.Unifill=Shd.Unifill.createDuplicate();if(undefined!=Shd.FillRef)this.FillRef=Shd.FillRef.createDuplicate()}else if(undefined===Shd.Color)this.Color= undefined},Check_PresentationPr:function(Theme){if(this.FillRef&&Theme){this.Unifill=Theme.getFillStyle(this.FillRef.idx,this.FillRef.Color);this.FillRef=undefined}},Write_ToBinary:function(Writer){Writer.WriteByte(this.Value);if(c_oAscShdClear===this.Value){this.Color.Write_ToBinary(Writer);if(this.Unifill){Writer.WriteBool(true);this.Unifill.Write_ToBinary(Writer)}else Writer.WriteBool(false);if(this.FillRef){Writer.WriteBool(true);this.FillRef.Write_ToBinary(Writer)}else Writer.WriteBool(false)}}, Read_FromBinary:function(Reader){this.Value=Reader.GetByte();if(c_oAscShdClear===this.Value){this.Color.Read_FromBinary(Reader);if(Reader.GetBool()){this.Unifill=new AscFormat.CUniFill;this.Unifill.Read_FromBinary(Reader)}if(Reader.GetBool()){this.FillRef=new AscFormat.StyleRef;this.FillRef.Read_FromBinary(Reader)}}else this.Color.Set(0,0,0)}};CDocumentShd.prototype.IsEqual=function(oShd){if(!oShd||this.Value!==oShd.Value)return false;if(Asc.c_oAscShd.Nil===this.Value)return true;return IsEqualStyleObjects(this.Color, oShd.Color)&&IsEqualStyleObjects(this.Unifill,oShd.Unifill)};CDocumentShd.prototype.IsNil=function(){return Asc.c_oAscShd.Nil===this.Value};function CDocumentBorder(){this.Color=new CDocumentColor(0,0,0);this.Unifill=undefined;this.LineRef=undefined;this.Space=0;this.Size=.5*g_dKoef_pt_to_mm;this.Value=border_None}CDocumentBorder.prototype={Copy:function(){var Border=new CDocumentBorder;if(undefined===this.Color)Border.Color=undefined;else Border.Color.Set(this.Color.r,this.Color.g,this.Color.b); if(undefined===this.Unifill)Border.Unifill=undefined;else Border.Unifill=this.Unifill.createDuplicate();if(undefined===this.LineRef)Border.LineRef=undefined;else Border.LineRef=this.LineRef.createDuplicate();if(undefined===this.Space)Border.Space=undefined;else Border.Space=this.Space;if(undefined===this.Size)Border.Size=undefined;else Border.Size=this.Size;if(undefined===this.Value)Border.Value=undefined;else Border.Value=this.Value;return Border},Compare:function(Border){if(false===this.Color.Compare(Border.Color))return false; if(AscFormat.CompareUnifillBool(this.Unifill,Border.Unifill)===false)return false;if(this.LineRef!==undefined&&Border.LineRef===undefined||Border.LineRef!==undefined&&this.LineRef===undefined)return false;if(this.LineRef!==undefined&&!this.LineRef.compare(Border.LineRef))return false;if(Math.abs(this.Size-Border.Size)>.001)return false;if(Math.abs(this.Space-Border.Space)>.001)return false;if(this.Value!=Border.Value)return false;return true},Is_Equal:function(Border){return this.IsEqual(Border)}, Get_Color:function(Paragraph){if(undefined!==this.Unifill){this.Unifill.check(Paragraph.Get_Theme(),Paragraph.Get_ColorMap());var RGBA=this.Unifill.getRGBAColor();return new CDocumentColor(RGBA.R,RGBA.G,RGBA.B,false)}else return this.Color},Get_Color2:function(Theme,ColorMap){if(undefined!==this.Unifill){this.Unifill.check(Theme,ColorMap);var RGBA=this.Unifill.getRGBAColor();return new CDocumentColor(RGBA.R,RGBA.G,RGBA.B,false)}else return this.Color},Check_PresentationPr:function(Theme){if(this.LineRef&& Theme){var pen=Theme.getLnStyle(this.LineRef.idx,this.LineRef.Color);this.Unifill=pen.Fill;this.LineRef=undefined;this.Size=AscFormat.isRealNumber(pen.w)?pen.w/36E3:12700/36E3}if(!this.Unifill||!this.Unifill.fill||this.Unifill.fill.type===Asc.c_oAscFill.FILL_TYPE_NOFILL)this.Value=border_None},Set_FromObject:function(Border){this.Space=Border.Space;this.Size=Border.Size;this.Value=Border.Value;if(undefined!=Border.Color)this.Color=new CDocumentColor(Border.Color.r,Border.Color.g,Border.Color.b);else this.Color= undefined;if(undefined!=Border.Unifill)this.Unifill=Border.Unifill.createDuplicate();if(undefined!=Border.LineRef)this.LineRef=Border.LineRef.createDuplicate()},Check_Null:function(){if(undefined===this.Space||undefined===this.Size||undefined===this.Value||undefined===this.Color||undefined===this.Unifill||undefined===this.LineRef)return false;return true},Write_ToBinary:function(Writer){Writer.WriteDouble(this.Size);Writer.WriteLong(this.Space);Writer.WriteByte(this.Value);this.Color.Write_ToBinary(Writer); if(this.Unifill){Writer.WriteBool(true);this.Unifill.Write_ToBinary(Writer)}else Writer.WriteBool(false);if(this.LineRef){Writer.WriteBool(true);this.LineRef.Write_ToBinary(Writer)}else Writer.WriteBool(false)},Read_FromBinary:function(Reader){this.Size=Reader.GetDouble();this.Space=Reader.GetLong();this.Value=Reader.GetByte();this.Color.Read_FromBinary(Reader);if(Reader.GetBool()){this.Unifill=new AscFormat.CUniFill;this.Unifill.Read_FromBinary(Reader)}if(Reader.GetBool()){this.LineRef=new AscFormat.StyleRef; this.LineRef.Read_FromBinary(Reader)}}};CDocumentBorder.prototype.IsNone=function(){return this.Value===border_None};CDocumentBorder.prototype.GetWidth=function(){if(border_None===this.Value)return 0;return this.Size};CDocumentBorder.prototype.GetColor=function(oParagraph){return this.Get_Color(oParagraph)};CDocumentBorder.prototype.IsEqual=function(oBorder){if(!oBorder||this.Value!==oBorder.Value)return false;if(this.IsNone())return true;return IsEqualStyleObjects(this.Color,oBorder.Color)&&IsEqualStyleObjects(this.Unifill, oBorder.Unifill)&&this.Space!==oBorder.Space&&this.Size!==oBorder.Size};CDocumentBorder.prototype.WriteToBinary=function(oWriter){return this.Write_ToBinary(oWriter)};CDocumentBorder.prototype.ReadFromBinary=function(oReader){return this.Read_FromBinary(oReader)};function CTableMeasurement(Type,W){this.Type=Type;this.W=W}CTableMeasurement.prototype={Copy:function(){return new CTableMeasurement(this.Type,this.W)},Is_Equal:function(Other){if(this.Type!==Other.Type||this.W!==Other.W)return false;return true}, Write_ToBinary:function(Writer){this.WriteToBinary(Writer)},Read_FromBinary:function(Reader){return this.ReadFromBinary(Reader)},Set_FromObject:function(Obj){this.W=Obj.W;this.Type=Obj.Type}};CTableMeasurement.prototype.IsMM=function(){return tblwidth_Mm===this.Type};CTableMeasurement.prototype.IsPercent=function(){return tblwidth_Pct===this.Type};CTableMeasurement.prototype.IsAuto=function(){return tblwidth_Auto===this.Type};CTableMeasurement.prototype.GetValue=function(){return this.W};CTableMeasurement.prototype.GetCalculatedValue= function(nFullWidth){if(this.IsMM())return this.W;else if(this.IsPercent())return this.W*nFullWidth/100;return 0};CTableMeasurement.prototype.ReadFromBinary=function(oReader){this.W=oReader.GetDouble();this.Type=oReader.GetLong()};CTableMeasurement.prototype.WriteToBinary=function(oWriter){oWriter.WriteDouble(this.W);oWriter.WriteLong(this.Type)};function CTablePr(){this.TableStyleColBandSize=undefined;this.TableStyleRowBandSize=undefined;this.Jc=undefined;this.Shd=undefined;this.TableBorders={Bottom:undefined, Left:undefined,Right:undefined,Top:undefined,InsideH:undefined,InsideV:undefined};this.TableCellMar={Bottom:undefined,Left:undefined,Right:undefined,Top:undefined};this.TableCellSpacing=undefined;this.TableInd=undefined;this.TableW=undefined;this.TableLayout=undefined;this.TableDescription=undefined;this.TableCaption=undefined;this.PrChange=undefined;this.ReviewInfo=undefined}CTablePr.prototype.Copy=function(bCopyPrChange){var TablePr=new CTablePr;TablePr.TableStyleColBandSize=this.TableStyleColBandSize; TablePr.TableStyleRowBandSize=this.TableStyleRowBandSize;TablePr.Jc=this.Jc;if(undefined!=this.Shd)TablePr.Shd=this.Shd.Copy();if(undefined!=this.TableBorders.Bottom)TablePr.TableBorders.Bottom=this.TableBorders.Bottom.Copy();if(undefined!=this.TableBorders.Left)TablePr.TableBorders.Left=this.TableBorders.Left.Copy();if(undefined!=this.TableBorders.Right)TablePr.TableBorders.Right=this.TableBorders.Right.Copy();if(undefined!=this.TableBorders.Top)TablePr.TableBorders.Top=this.TableBorders.Top.Copy(); if(undefined!=this.TableBorders.InsideH)TablePr.TableBorders.InsideH=this.TableBorders.InsideH.Copy();if(undefined!=this.TableBorders.InsideV)TablePr.TableBorders.InsideV=this.TableBorders.InsideV.Copy();if(undefined!=this.TableCellMar.Bottom)TablePr.TableCellMar.Bottom=this.TableCellMar.Bottom.Copy();if(undefined!=this.TableCellMar.Left)TablePr.TableCellMar.Left=this.TableCellMar.Left.Copy();if(undefined!=this.TableCellMar.Right)TablePr.TableCellMar.Right=this.TableCellMar.Right.Copy();if(undefined!= this.TableCellMar.Top)TablePr.TableCellMar.Top=this.TableCellMar.Top.Copy();TablePr.TableCellSpacing=this.TableCellSpacing;TablePr.TableInd=this.TableInd;if(undefined!=this.TableW)TablePr.TableW=this.TableW.Copy();TablePr.TableLayout=this.TableLayout;TablePr.TableDescription=this.TableDescription;TablePr.TableCaption=this.TableCaption;if(true===bCopyPrChange&&undefined!==this.PrChange){TablePr.PrChange=this.PrChange.Copy();TablePr.ReviewInfo=this.ReviewInfo.Copy()}return TablePr};CTablePr.prototype.Merge= function(TablePr){if(undefined!=TablePr.TableStyleColBandSize)this.TableStyleColBandSize=TablePr.TableStyleColBandSize;if(undefined!=TablePr.TableStyleRowBandSize)this.TableStyleRowBandSize=TablePr.TableStyleRowBandSize;if(undefined!=TablePr.Jc)this.Jc=TablePr.Jc;if(undefined!=TablePr.Shd)this.Shd=TablePr.Shd.Copy();if(undefined!=TablePr.TableBorders.Bottom)this.TableBorders.Bottom=TablePr.TableBorders.Bottom.Copy();if(undefined!=TablePr.TableBorders.Left)this.TableBorders.Left=TablePr.TableBorders.Left.Copy(); if(undefined!=TablePr.TableBorders.Right)this.TableBorders.Right=TablePr.TableBorders.Right.Copy();if(undefined!=TablePr.TableBorders.Top)this.TableBorders.Top=TablePr.TableBorders.Top.Copy();if(undefined!=TablePr.TableBorders.InsideH)this.TableBorders.InsideH=TablePr.TableBorders.InsideH.Copy();if(undefined!=TablePr.TableBorders.InsideV)this.TableBorders.InsideV=TablePr.TableBorders.InsideV.Copy();if(undefined!=TablePr.TableCellMar.Bottom)this.TableCellMar.Bottom=TablePr.TableCellMar.Bottom.Copy(); if(undefined!=TablePr.TableCellMar.Left)this.TableCellMar.Left=TablePr.TableCellMar.Left.Copy();if(undefined!=TablePr.TableCellMar.Right)this.TableCellMar.Right=TablePr.TableCellMar.Right.Copy();if(undefined!=TablePr.TableCellMar.Top)this.TableCellMar.Top=TablePr.TableCellMar.Top.Copy();if(undefined!=TablePr.TableCellSpacing)this.TableCellSpacing=TablePr.TableCellSpacing;if(undefined!=TablePr.TableInd)this.TableInd=TablePr.TableInd;if(undefined!=TablePr.TableW)this.TableW=TablePr.TableW.Copy();if(undefined!= TablePr.TableLayout)this.TableLayout=TablePr.TableLayout;if(undefined!==TablePr.TableDescription)this.TableDescription=TablePr.TableDescription;if(undefined!==TablePr.TableCaption)this.TableCaption=TablePr.TableCaption};CTablePr.prototype.Is_Equal=function(TablePr){if(this.TableStyleColBandSize!==TablePr.TableStyleColBandSize||this.TableStyleRowBandSize!==TablePr.TableStyleRowBandSize||this.Jc!==TablePr.Jc||true!==IsEqualStyleObjects(this.TableBorders.Bottom,TablePr.TableBorders.Bottom)||true!==IsEqualStyleObjects(this.TableBorders.Left, TablePr.TableBorders.Left)||true!==IsEqualStyleObjects(this.TableBorders.Right,TablePr.TableBorders.Right)||true!==IsEqualStyleObjects(this.TableBorders.Top,TablePr.TableBorders.Top)||true!==IsEqualStyleObjects(this.TableBorders.InsideH,TablePr.TableBorders.InsideH)||true!==IsEqualStyleObjects(this.TableBorders.InsideV,TablePr.TableBorders.InsideV)||true!==IsEqualStyleObjects(this.TableCellMar.Bottom,TablePr.TableCellMar.Bottom)||true!==IsEqualStyleObjects(this.TableCellMar.Left,TablePr.TableCellMar.Left)|| true!==IsEqualStyleObjects(this.TableCellMar.Right,TablePr.TableCellMar.Right)||true!==IsEqualStyleObjects(this.TableCellMar.Top,TablePr.TableCellMar.Top)||this.TableCellSpacing!==TablePr.TableCellSpacing||this.TableInd!==TablePr.TableInd||true!==IsEqualStyleObjects(this.TableW,TablePr.TableW)||this.TableLayout!==TablePr.TableLayout)return false;return true};CTablePr.prototype.InitDefault=function(nCompatibilityMode){if(undefined===nCompatibilityMode)nCompatibilityMode=AscCommon.document_compatibility_mode_Word12; this.TableStyleColBandSize=1;this.TableStyleRowBandSize=1;this.Jc=align_Left;this.Shd=new CDocumentShd;this.TableBorders.Bottom=new CDocumentBorder;this.TableBorders.Left=new CDocumentBorder;this.TableBorders.Right=new CDocumentBorder;this.TableBorders.Top=new CDocumentBorder;this.TableBorders.InsideH=new CDocumentBorder;this.TableBorders.InsideV=new CDocumentBorder;this.TableCellMar.Bottom=new CTableMeasurement(tblwidth_Mm,0);this.TableCellMar.Left=nCompatibilityMode<=AscCommon.document_compatibility_mode_Word12? new CTableMeasurement(tblwidth_Mm,.5*g_dKoef_pt_to_mm):new CTableMeasurement(tblwidth_Mm,1.9);this.TableCellMar.Right=nCompatibilityMode<=AscCommon.document_compatibility_mode_Word12?new CTableMeasurement(tblwidth_Mm,.5*g_dKoef_pt_to_mm):new CTableMeasurement(tblwidth_Mm,1.9);this.TableCellMar.Top=new CTableMeasurement(tblwidth_Mm,0);this.TableCellSpacing=null;this.TableInd=0;this.TableW=new CTableMeasurement(tblwidth_Auto,0);this.TableLayout=tbllayout_AutoFit;this.TableDescription="";this.TableCaption= "";this.PrChange=undefined;this.ReviewInfo=undefined};CTablePr.prototype.Set_FromObject=function(TablePr){this.TableStyleColBandSize=TablePr.TableStyleColBandSize;this.TableStyleRowBandSize=TablePr.TableStyleRowBandSize;this.Jc=TablePr.Jc;if(undefined!=TablePr.Shd){this.Shd=new CDocumentShd;this.Shd.Set_FromObject(TablePr.Shd)}else this.Shd=undefined;if(undefined!=TablePr.TableBorders){if(undefined!=TablePr.TableBorders.Bottom){this.TableBorders.Bottom=new CDocumentBorder;this.TableBorders.Bottom.Set_FromObject(TablePr.TableBorders.Bottom)}else this.TableBorders.Bottom= undefined;if(undefined!=TablePr.TableBorders.Left){this.TableBorders.Left=new CDocumentBorder;this.TableBorders.Left.Set_FromObject(TablePr.TableBorders.Left)}else this.TableBorders.Left=undefined;if(undefined!=TablePr.TableBorders.Right){this.TableBorders.Right=new CDocumentBorder;this.TableBorders.Right.Set_FromObject(TablePr.TableBorders.Right)}else this.TableBorders.Right=undefined;if(undefined!=TablePr.TableBorders.Top){this.TableBorders.Top=new CDocumentBorder;this.TableBorders.Top.Set_FromObject(TablePr.TableBorders.Top)}else this.TableBorders.Top= undefined;if(undefined!=TablePr.TableBorders.InsideH){this.TableBorders.InsideH=new CDocumentBorder;this.TableBorders.InsideH.Set_FromObject(TablePr.TableBorders.InsideH)}else this.TableBorders.InsideH=undefined;if(undefined!=TablePr.TableBorders.InsideV){this.TableBorders.InsideV=new CDocumentBorder;this.TableBorders.InsideV.Set_FromObject(TablePr.TableBorders.InsideV)}else this.TableBorders.InsideV=undefined}else{this.TableBorders.Bottom=undefined;this.TableBorders.Left=undefined;this.TableBorders.Right= undefined;this.TableBorders.Top=undefined;this.TableBorders.InsideH=undefined;this.TableBorders.InsideV=undefined}if(undefined!=TablePr.TableCellMar){if(undefined!=TablePr.TableCellMar.Bottom)this.TableCellMar.Bottom=new CTableMeasurement(TablePr.TableCellMar.Bottom.Type,TablePr.TableCellMar.Bottom.W);else this.TableCellMar.Bottom=undefined;if(undefined!=TablePr.TableCellMar.Left)this.TableCellMar.Left=new CTableMeasurement(TablePr.TableCellMar.Left.Type,TablePr.TableCellMar.Left.W);else this.TableCellMar.Left= undefined;if(undefined!=TablePr.TableCellMar.Right)this.TableCellMar.Right=new CTableMeasurement(TablePr.TableCellMar.Right.Type,TablePr.TableCellMar.Right.W);else this.TableCellMar.Right=undefined;if(undefined!=TablePr.TableCellMar.Top)this.TableCellMar.Top=new CTableMeasurement(TablePr.TableCellMar.Top.Type,TablePr.TableCellMar.Top.W);else this.TableCellMar.Top=undefined}else{this.TableCellMar.Bottom=undefined;this.TableCellMar.Left=undefined;this.TableCellMar.Right=undefined;this.TableCellMar.Top= undefined}this.TableCellSpacing=TablePr.TableCellSpacing;this.TableInd=TablePr.TableInd;if(undefined!=TablePr.TableW)this.TableW=new CTableMeasurement(TablePr.TableW.Type,TablePr.TableW.W);else this.TableW=undefined;this.TableLayout=TablePr.TableLayout;this.TableDescription=TablePr.TableDescription;this.TableCaption=TablePr.TableCaption};CTablePr.prototype.Check_PresentationPr=function(Theme){if(this.Shd)this.Shd.Check_PresentationPr(Theme);if(this.TableBorders.Bottom)this.TableBorders.Bottom.Check_PresentationPr(Theme); if(this.TableBorders.Left)this.TableBorders.Left.Check_PresentationPr(Theme);if(this.TableBorders.Right)this.TableBorders.Right.Check_PresentationPr(Theme);if(this.TableBorders.Top)this.TableBorders.Top.Check_PresentationPr(Theme);if(this.TableBorders.InsideH)this.TableBorders.InsideH.Check_PresentationPr(Theme);if(this.TableBorders.InsideV)this.TableBorders.InsideV.Check_PresentationPr(Theme)};CTablePr.prototype.Write_ToBinary=function(Writer){var StartPos=Writer.GetCurPosition();Writer.Skip(4); var Flags=0;if(undefined!=this.TableStyleColBandSize){Writer.WriteLong(this.TableStyleColBandSize);Flags|=1}if(undefined!=this.TableStyleRowBandSize){Writer.WriteLong(this.TableStyleRowBandSize);Flags|=2}if(undefined!=this.Jc){Writer.WriteLong(this.Jc);Flags|=4}if(undefined!=this.Shd){this.Shd.Write_ToBinary(Writer);Flags|=8}if(undefined!=this.TableBorders.Bottom){this.TableBorders.Bottom.Write_ToBinary(Writer);Flags|=16}if(undefined!=this.TableBorders.Left){this.TableBorders.Left.Write_ToBinary(Writer); Flags|=32}if(undefined!=this.TableBorders.Right){this.TableBorders.Right.Write_ToBinary(Writer);Flags|=64}if(undefined!=this.TableBorders.Top){this.TableBorders.Top.Write_ToBinary(Writer);Flags|=128}if(undefined!=this.TableBorders.InsideH){this.TableBorders.InsideH.Write_ToBinary(Writer);Flags|=256}if(undefined!=this.TableBorders.InsideV){this.TableBorders.InsideV.Write_ToBinary(Writer);Flags|=512}if(undefined!=this.TableCellMar.Bottom){this.TableCellMar.Bottom.Write_ToBinary(Writer);Flags|=1024}if(undefined!= this.TableCellMar.Left){this.TableCellMar.Left.Write_ToBinary(Writer);Flags|=2048}if(undefined!=this.TableCellMar.Right){this.TableCellMar.Right.Write_ToBinary(Writer);Flags|=4096}if(undefined!=this.TableCellMar.Top){this.TableCellMar.Top.Write_ToBinary(Writer);Flags|=8192}if(undefined!=this.TableCellSpacing){if(null===this.TableCellSpacing)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteDouble(this.TableCellSpacing)}Flags|=16384}if(undefined!=this.TableInd){Writer.WriteDouble(this.TableInd); Flags|=32768}if(undefined!=this.TableW){this.TableW.Write_ToBinary(Writer);Flags|=65536}if(undefined!=this.TableLayout){Writer.WriteLong(this.TableLayout);Flags|=131072}if(undefined!==this.TableDescription){Writer.WriteString2(this.TableDescription);Flags|=262144}if(undefined!==this.TableCaption){Writer.WriteString2(this.TableCaption);Flags|=524288}if(undefined!==this.PrChange&&undefined!==this.ReviewInfo){this.PrChange.WriteToBinary(Writer);this.ReviewInfo.WriteToBinary(Writer);Flags|=1048576}var EndPos= Writer.GetCurPosition();Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)};CTablePr.prototype.Read_FromBinary=function(Reader){var Flags=Reader.GetLong();if(1&Flags)this.TableStyleColBandSize=Reader.GetLong();if(2&Flags)this.TableStyleRowBandSize=Reader.GetLong();if(4&Flags)this.Jc=Reader.GetLong();if(8&Flags){this.Shd=new CDocumentShd;this.Shd.Read_FromBinary(Reader)}if(16&Flags){this.TableBorders.Bottom=new CDocumentBorder;this.TableBorders.Bottom.Read_FromBinary(Reader)}if(32&Flags){this.TableBorders.Left= new CDocumentBorder;this.TableBorders.Left.Read_FromBinary(Reader)}if(64&Flags){this.TableBorders.Right=new CDocumentBorder;this.TableBorders.Right.Read_FromBinary(Reader)}if(128&Flags){this.TableBorders.Top=new CDocumentBorder;this.TableBorders.Top.Read_FromBinary(Reader)}if(256&Flags){this.TableBorders.InsideH=new CDocumentBorder;this.TableBorders.InsideH.Read_FromBinary(Reader)}if(512&Flags){this.TableBorders.InsideV=new CDocumentBorder;this.TableBorders.InsideV.Read_FromBinary(Reader)}if(1024& Flags){this.TableCellMar.Bottom=new CTableMeasurement(tblwidth_Auto,0);this.TableCellMar.Bottom.Read_FromBinary(Reader)}if(2048&Flags){this.TableCellMar.Left=new CTableMeasurement(tblwidth_Auto,0);this.TableCellMar.Left.Read_FromBinary(Reader)}if(4096&Flags){this.TableCellMar.Right=new CTableMeasurement(tblwidth_Auto,0);this.TableCellMar.Right.Read_FromBinary(Reader)}if(8192&Flags){this.TableCellMar.Top=new CTableMeasurement(tblwidth_Auto,0);this.TableCellMar.Top.Read_FromBinary(Reader)}if(16384& Flags)if(true===Reader.GetBool())this.TableCellSpacing=null;else this.TableCellSpacing=Reader.GetDouble();if(32768&Flags)this.TableInd=Reader.GetDouble();if(65536&Flags){this.TableW=new CTableMeasurement(tblwidth_Auto,0);this.TableW.Read_FromBinary(Reader)}if(131072&Flags)this.TableLayout=Reader.GetLong();if(262144&Flags)this.TableDescription=Reader.GetString2();if(524288&Flags)this.TableCaption=Reader.GetString2();if(1048576&Flags){this.PrChange=new CTablePr;this.ReviewInfo=new CReviewInfo;this.PrChange.ReadFromBinary(Reader); this.ReviewInfo.ReadFromBinary(Reader)}};CTablePr.prototype.WriteToBinary=function(oWriter){this.Write_ToBinary(oWriter)};CTablePr.prototype.ReadFromBinary=function(oReader){this.Read_FromBinary(oReader)};CTablePr.prototype.HavePrChange=function(){if(undefined===this.PrChange||null===this.PrChange)return false;return true};CTablePr.prototype.AddPrChange=function(){this.PrChange=this.Copy(false);this.ReviewInfo=new CReviewInfo;this.ReviewInfo.Update()};CTablePr.prototype.SetPrChange=function(oPrChange, oReviewInfo){this.PrChange=oPrChange;this.ReviewInfo=oReviewInfo};CTablePr.prototype.RemovePrChange=function(){delete this.PrChange;delete this.ReviewInfo};function CTableRowHeight(Value,HRule){this.Value=Value;this.HRule=HRule}CTableRowHeight.prototype={Copy:function(){return new CTableRowHeight(this.Value,this.HRule)},Is_Equal:function(Other){if(this.Value!==Other.Value||this.HRule!==Other.HRule)return false;return true},Write_ToBinary:function(Writer){Writer.WriteDouble(this.Value);Writer.WriteLong(this.HRule)}, Read_FromBinary:function(Reader){this.Value=Reader.GetDouble();this.HRule=Reader.GetLong()}};CTableRowHeight.prototype.IsAuto=function(){return this.HRule===Asc.linerule_Auto?true:false};CTableRowHeight.prototype.GetValue=function(){return this.Value};CTableRowHeight.prototype.GetRule=function(){return this.HRule};function CTableRowPr(){this.CantSplit=undefined;this.GridAfter=undefined;this.GridBefore=undefined;this.Jc=undefined;this.TableCellSpacing=undefined;this.Height=undefined;this.WAfter=undefined; this.WBefore=undefined;this.TableHeader=undefined;this.PrChange=undefined;this.ReviewInfo=undefined}CTableRowPr.prototype.Copy=function(bCopyPrChange){var RowPr=new CTableRowPr;RowPr.CantSplit=this.CantSplit;RowPr.GridAfter=this.GridAfter;RowPr.GridBefore=this.GridBefore;RowPr.Jc=this.Jc;RowPr.TableCellSpacing=this.TableCellSpacing;if(undefined!=this.Height)RowPr.Height=this.Height.Copy();if(undefined!=this.WAfter)RowPr.WAfter=this.WAfter.Copy();if(undefined!=this.WBefore)RowPr.WBefore=this.WBefore.Copy(); RowPr.TableHeader=this.TableHeader;if(true===bCopyPrChange&&undefined!==this.PrChange){RowPr.PrChange=this.PrChange.Copy();RowPr.ReviewInfo=this.ReviewInfo.Copy()}return RowPr};CTableRowPr.prototype.Merge=function(RowPr){if(undefined!==RowPr.CantSplit)this.CantSplit=RowPr.CantSplit;if(undefined!==RowPr.GridAfter)this.GridAfter=RowPr.GridAfter;if(undefined!==RowPr.GridBefore)this.GridBefore=RowPr.GridBefore;if(undefined!==RowPr.Jc)this.Jc=RowPr.Jc;if(undefined!==RowPr.TableCellSpacing)this.TableCellSpacing= RowPr.TableCellSpacing;if(undefined!==RowPr.Height)this.Height=RowPr.Height.Copy();if(undefined!==RowPr.WAfter)this.WAfter=RowPr.WAfter.Copy();if(undefined!==RowPr.WBefore)this.WBefore=RowPr.WBefore.Copy();if(undefined!==RowPr.TableHeader)this.TableHeader=RowPr.TableHeader};CTableRowPr.prototype.Is_Equal=function(RowPr){if(this.CantSplit!==RowPr.CantSplit||this.GridAfter!==RowPr.GridAfter||this.GridBefore!==RowPr.GridBefore||this.Jc!==RowPr.Jc||this.TableCellSpacing!==RowPr.TableCellSpacing||true!== IsEqualStyleObjects(this.Height,RowPr.Height)||true!==IsEqualStyleObjects(this.WAfter,RowPr.WAfter)||true!==IsEqualStyleObjects(this.WBefore,RowPr.WBefore)||this.TableHeader!==RowPr.TableHeader)return false;return true};CTableRowPr.prototype.InitDefault=function(nCompatibilityMode){this.CantSplit=false;this.GridAfter=0;this.GridBefore=0;this.Jc=align_Left;this.TableCellSpacing=null;this.Height=new CTableRowHeight(0,Asc.linerule_Auto);this.WAfter=new CTableMeasurement(tblwidth_Auto,0);this.WBefore= new CTableMeasurement(tblwidth_Auto,0);this.TableHeader=false;this.PrChange=undefined;this.ReviewInfo=undefined};CTableRowPr.prototype.Set_FromObject=function(RowPr){this.CantSplit=RowPr.CantSplit;this.GridAfter=RowPr.GridAfter;this.GridBefore=RowPr.GridBefore;this.Jc=RowPr.Jc;this.TableCellSpacing=RowPr.TableCellSpacing;if(undefined!=RowPr.Height)this.Height=new CTableRowHeight(RowPr.Height.Value,RowPr.Height.HRule);else this.Height=undefined;if(undefined!=RowPr.WAfter)this.WAfter=new CTableMeasurement(RowPr.WAfter.Type, RowPr.WAfter.W);else this.WAfter=undefined;if(undefined!=RowPr.WBefore)this.WBefore=new CTableMeasurement(RowPr.WBefore.Type,RowPr.WBefore.W);else this.WBefore=undefined;this.TableHeader=RowPr.TableHeader};CTableRowPr.prototype.Write_ToBinary=function(Writer){var StartPos=Writer.GetCurPosition();Writer.Skip(4);var Flags=0;if(undefined!=this.CantSplit){Writer.WriteBool(this.CantSplit);Flags|=1}if(undefined!=this.GridAfter){Writer.WriteLong(this.GridAfter);Flags|=2}if(undefined!=this.GridBefore){Writer.WriteLong(this.GridBefore); Flags|=4}if(undefined!=this.Jc){Writer.WriteLong(this.Jc);Flags|=8}if(undefined!=this.TableCellSpacing){if(null===this.TableCellSpacing)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteDouble(this.TableCellSpacing)}Flags|=16}if(undefined!=this.Height){this.Height.Write_ToBinary(Writer);Flags|=32}if(undefined!=this.WAfter){this.WAfter.Write_ToBinary(Writer);Flags|=64}if(undefined!=this.WBefore){this.WBefore.Write_ToBinary(Writer);Flags|=128}if(undefined!=this.TableHeader){Writer.WriteBool(this.TableHeader); Flags|=256}if(undefined!==this.PrChange&&undefined!==this.ReviewInfo){this.PrChange.WriteToBinary(Writer);this.ReviewInfo.WriteToBinary(Writer);Flags|=512}var EndPos=Writer.GetCurPosition();Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)};CTableRowPr.prototype.Read_FromBinary=function(Reader){var Flags=Reader.GetLong();if(1&Flags)this.CantSplit=Reader.GetBool();if(2&Flags)this.GridAfter=Reader.GetLong();if(4&Flags)this.GridBefore=Reader.GetLong();if(8&Flags)this.Jc=Reader.GetLong(); if(16&Flags)if(true===Reader.GetBool())this.TableCellSpacing=Reader.GetLong();else this.TableCellSpacing=Reader.GetDouble();if(32&Flags){this.Height=new CTableRowHeight(0,Asc.linerule_Auto);this.Height.Read_FromBinary(Reader)}if(64&Flags){this.WAfter=new CTableMeasurement(tblwidth_Auto,0);this.WAfter.Read_FromBinary(Reader)}if(128&Flags){this.WBefore=new CTableMeasurement(tblwidth_Auto,0);this.WBefore.Read_FromBinary(Reader)}if(256&Flags)this.TableHeader=Reader.GetBool();if(512&Flags){this.PrChange= new CTableRowPr;this.ReviewInfo=new CReviewInfo;this.PrChange.ReadFromBinary(Reader);this.ReviewInfo.ReadFromBinary(Reader)}};CTableRowPr.prototype.WriteToBinary=function(oWriter){this.Write_ToBinary(oWriter)};CTableRowPr.prototype.ReadFromBinary=function(oReader){this.Read_FromBinary(oReader)};CTableRowPr.prototype.HavePrChange=function(){if(undefined===this.PrChange||null===this.PrChange)return false;return true};CTableRowPr.prototype.AddPrChange=function(){this.PrChange=this.Copy(false);this.ReviewInfo= new CReviewInfo;this.ReviewInfo.Update()};CTableRowPr.prototype.SetPrChange=function(oPrChange,oReviewInfo){this.PrChange=oPrChange;this.ReviewInfo=oReviewInfo};CTableRowPr.prototype.RemovePrChange=function(){delete this.PrChange;delete this.ReviewInfo};function CTableCellPr(){this.GridSpan=undefined;this.Shd=undefined;this.TableCellMar=undefined;this.TableCellBorders={Bottom:undefined,Left:undefined,Right:undefined,Top:undefined};this.TableCellW=undefined;this.VAlign=undefined;this.VMerge=undefined; this.TextDirection=undefined;this.NoWrap=undefined;this.HMerge=undefined;this.PrChange=undefined;this.ReviewInfo=undefined}CTableCellPr.prototype.Copy=function(bCopyPrChange){var CellPr=new CTableCellPr;CellPr.GridSpan=this.GridSpan;if(undefined!=this.Shd)CellPr.Shd=this.Shd.Copy();if(undefined===this.TableCellMar)CellPr.TableCellMar=undefined;else if(null===this.TableCellMar)CellPr.TableCellMar=null;else{CellPr.TableCellMar={};CellPr.TableCellMar.Bottom=undefined!=this.TableCellMar.Bottom?this.TableCellMar.Bottom.Copy(): undefined;CellPr.TableCellMar.Left=undefined!=this.TableCellMar.Left?this.TableCellMar.Left.Copy():undefined;CellPr.TableCellMar.Right=undefined!=this.TableCellMar.Right?this.TableCellMar.Right.Copy():undefined;CellPr.TableCellMar.Top=undefined!=this.TableCellMar.Top?this.TableCellMar.Top.Copy():undefined}if(undefined!=this.TableCellBorders.Bottom)CellPr.TableCellBorders.Bottom=this.TableCellBorders.Bottom.Copy();if(undefined!=this.TableCellBorders.Left)CellPr.TableCellBorders.Left=this.TableCellBorders.Left.Copy(); if(undefined!=this.TableCellBorders.Right)CellPr.TableCellBorders.Right=this.TableCellBorders.Right.Copy();if(undefined!=this.TableCellBorders.Top)CellPr.TableCellBorders.Top=this.TableCellBorders.Top.Copy();if(undefined!=this.TableCellW)CellPr.TableCellW=this.TableCellW.Copy();CellPr.VAlign=this.VAlign;CellPr.VMerge=this.VMerge;CellPr.TextDirection=this.TextDirection;CellPr.NoWrap=this.NoWrap;CellPr.HMerge=this.HMerge;if(true===bCopyPrChange&&undefined!==this.PrChange){CellPr.PrChange=this.PrChange.Copy(); CellPr.ReviewInfo=this.ReviewInfo.Copy()}return CellPr};CTableCellPr.prototype.Merge=function(CellPr){if(undefined!=CellPr.GridSpan)this.GridSpan=CellPr.GridSpan;if(undefined!=CellPr.Shd)this.Shd=CellPr.Shd.Copy();if(undefined===CellPr.TableCellMar);else if(null===CellPr.TableCellMar)this.TableCellMar=null;else{this.TableCellMar={};this.TableCellMar.Bottom=undefined!=CellPr.TableCellMar.Bottom?CellPr.TableCellMar.Bottom.Copy():undefined;this.TableCellMar.Left=undefined!=CellPr.TableCellMar.Left?CellPr.TableCellMar.Left.Copy(): undefined;this.TableCellMar.Right=undefined!=CellPr.TableCellMar.Right?CellPr.TableCellMar.Right.Copy():undefined;this.TableCellMar.Top=undefined!=CellPr.TableCellMar.Top?CellPr.TableCellMar.Top.Copy():undefined}if(undefined!=CellPr.TableCellBorders.Bottom)this.TableCellBorders.Bottom=CellPr.TableCellBorders.Bottom.Copy();if(undefined!=CellPr.TableCellBorders.Left)this.TableCellBorders.Left=CellPr.TableCellBorders.Left.Copy();if(undefined!=CellPr.TableCellBorders.Right)this.TableCellBorders.Right= CellPr.TableCellBorders.Right.Copy();if(undefined!=CellPr.TableCellBorders.Top)this.TableCellBorders.Top=CellPr.TableCellBorders.Top.Copy();if(undefined!=CellPr.TableCellW)this.TableCellW=CellPr.TableCellW.Copy();if(undefined!=CellPr.VAlign)this.VAlign=CellPr.VAlign;if(undefined!=CellPr.VMerge)this.VMerge=CellPr.VMerge;if(undefined!=CellPr.TextDirection)this.TextDirection=CellPr.TextDirection;if(undefined!==CellPr.NoWrap)this.NoWrap=CellPr.NoWrap;if(undefined!=CellPr.HMerge)this.HMerge=CellPr.HMerge}; CTableCellPr.prototype.Is_Equal=function(CellPr){if(this.GridSpan!==CellPr.GridSpan||true!==IsEqualStyleObjects(this.Shd,CellPr.Shd)||this.TableCellMar!==undefined&&CellPr.TableCellMar===undefined||CellPr.TableCellMar!==undefined&&this.TableCellMar===undefined||this.TableCellMar!==null&&CellPr.TableCellMar===null||CellPr.TableCellMar!==null&&this.TableCellMar===null||this.TableCellMar!==undefined&&this.TableCellMar!==null&&(true!==IsEqualStyleObjects(this.TableCellMar.Top,CellPr.TableCellMar.Top)|| true!==IsEqualStyleObjects(this.TableCellMar.Left,CellPr.TableCellMar.Left)||true!==IsEqualStyleObjects(this.TableCellMar.Right,CellPr.TableCellMar.Right)||true!==IsEqualStyleObjects(this.TableCellMar.Bottom,CellPr.TableCellMar.Bottom))||true!==IsEqualStyleObjects(this.TableCellBorders.Bottom,CellPr.TableCellBorders.Bottom)||true!==IsEqualStyleObjects(this.TableCellBorders.Left,CellPr.TableCellBorders.Left)||true!==IsEqualStyleObjects(this.TableCellBorders.Right,CellPr.TableCellBorders.Right)||true!== IsEqualStyleObjects(this.TableCellBorders.Top,CellPr.TableCellBorders.Top)||true!==IsEqualStyleObjects(this.TableCellW,CellPr.TableCellW)||this.VAlign!==CellPr.VAlign||this.VMerge!==CellPr.VMerge||this.TextDirection!==CellPr.TextDirection||this.NoWrap!==CellPr.NoWrap||this.HMerge!==CellPr.HMerge)return false;return true};CTableCellPr.prototype.InitDefault=function(nCompatibilityMode){this.GridSpan=1;this.Shd=new CDocumentShd;this.TableCellMar=null;this.TableCellBorders.Bottom=undefined;this.TableCellBorders.Left= undefined;this.TableCellBorders.Right=undefined;this.TableCellBorders.Top=undefined;this.TableCellW=new CTableMeasurement(tblwidth_Auto,0);this.VAlign=vertalignjc_Top;this.VMerge=vmerge_Restart;this.TextDirection=textdirection_LRTB;this.NoWrap=false;this.HMerge=vmerge_Restart;this.PrChange=undefined;this.ReviewInfo=undefined};CTableCellPr.prototype.Set_FromObject=function(CellPr){this.GridSpan=CellPr.GridSpan;if(undefined!=CellPr.Shd){this.Shd=new CDocumentShd;this.Shd.Set_FromObject(CellPr.Shd)}else this.Shd= undefined;if(undefined===CellPr.TableCellMar)this.TableCellMar=undefined;else if(null===CellPr.TableCellMar)this.TableCellMar=null;else{this.TableCellMar={};if(undefined!=CellPr.TableCellMar.Bottom)this.TableCellMar.Bottom=new CTableMeasurement(CellPr.TableCellMar.Bottom.Type,CellPr.TableCellMar.Bottom.W);else this.TableCellMar.Bottom=undefined;if(undefined!=CellPr.TableCellMar.Left)this.TableCellMar.Left=new CTableMeasurement(CellPr.TableCellMar.Left.Type,CellPr.TableCellMar.Left.W);else this.TableCellMar.Left= undefined;if(undefined!=CellPr.TableCellMar.Right)this.TableCellMar.Right=new CTableMeasurement(CellPr.TableCellMar.Right.Type,CellPr.TableCellMar.Right.W);else this.TableCellMar.Right=undefined;if(undefined!=CellPr.TableCellMar.Top)this.TableCellMar.Top=new CTableMeasurement(CellPr.TableCellMar.Top.Type,CellPr.TableCellMar.Top.W);else this.TableCellMar.Top=undefined}if(undefined!=CellPr.TableCellBorders){if(undefined!=CellPr.TableCellBorders.Bottom){this.TableCellBorders.Bottom=new CDocumentBorder; this.TableCellBorders.Bottom.Set_FromObject(CellPr.TableCellBorders.Bottom)}else this.TableCellBorders.Bottom=undefined;if(undefined!=CellPr.TableCellBorders.Left){this.TableCellBorders.Left=new CDocumentBorder;this.TableCellBorders.Left.Set_FromObject(CellPr.TableCellBorders.Left)}else this.TableCellBorders.Left=undefined;if(undefined!=CellPr.TableCellBorders.Right){this.TableCellBorders.Right=new CDocumentBorder;this.TableCellBorders.Right.Set_FromObject(CellPr.TableCellBorders.Right)}else this.TableCellBorders.Right= undefined;if(undefined!=CellPr.TableCellBorders.Top){this.TableCellBorders.Top=new CDocumentBorder;this.TableCellBorders.Top.Set_FromObject(CellPr.TableCellBorders.Top)}else this.TableCellBorders.Top=undefined}else{this.TableCellBorders.Bottom=undefined;this.TableCellBorders.Left=undefined;this.TableCellBorders.Right=undefined;this.TableCellBorders.Top=undefined}if(undefined!=CellPr.TableCellW)this.TableCellW=new CTableMeasurement(CellPr.TableCellW.Type,CellPr.TableCellW.W);else this.TableCellW=undefined; this.VAlign=CellPr.VAlign;this.VMerge=CellPr.VMerge;this.TextDirection=CellPr.TextDirection;this.NoWrap=CellPr.NoWrap;this.HMerge=CellPr.HMerge};CTableCellPr.prototype.Check_PresentationPr=function(Theme){if(this.Shd)this.Shd.Check_PresentationPr(Theme);if(this.TableCellBorders.Bottom)this.TableCellBorders.Bottom.Check_PresentationPr(Theme);if(this.TableCellBorders.Left)this.TableCellBorders.Left.Check_PresentationPr(Theme);if(this.TableCellBorders.Right)this.TableCellBorders.Right.Check_PresentationPr(Theme); if(this.TableCellBorders.Top)this.TableCellBorders.Top.Check_PresentationPr(Theme)};CTableCellPr.prototype.Write_ToBinary=function(Writer){var StartPos=Writer.GetCurPosition();Writer.Skip(4);var Flags=0;if(undefined!=this.GridSpan){Writer.WriteLong(this.GridSpan);Flags|=1}if(undefined!=this.Shd){this.Shd.Write_ToBinary(Writer);Flags|=2}if(undefined!=this.TableCellMar)if(null===this.TableCellMar)Flags|=4;else{if(undefined!=this.TableCellMar.Bottom){this.TableCellMar.Bottom.Write_ToBinary(Writer);Flags|= 8}if(undefined!=this.TableCellMar.Left){this.TableCellMar.Left.Write_ToBinary(Writer);Flags|=16}if(undefined!=this.TableCellMar.Right){this.TableCellMar.Right.Write_ToBinary(Writer);Flags|=32}if(undefined!=this.TableCellMar.Top){this.TableCellMar.Top.Write_ToBinary(Writer);Flags|=64}Flags|=128}if(undefined!=this.TableCellBorders.Bottom){this.TableCellBorders.Bottom.Write_ToBinary(Writer);Flags|=256}if(undefined!=this.TableCellBorders.Left){this.TableCellBorders.Left.Write_ToBinary(Writer);Flags|= 512}if(undefined!=this.TableCellBorders.Right){this.TableCellBorders.Right.Write_ToBinary(Writer);Flags|=1024}if(undefined!=this.TableCellBorders.Top){this.TableCellBorders.Top.Write_ToBinary(Writer);Flags|=2048}if(undefined!=this.TableCellW){this.TableCellW.Write_ToBinary(Writer);Flags|=4096}if(undefined!=this.VAlign){Writer.WriteLong(this.VAlign);Flags|=8192}if(undefined!=this.VMerge){Writer.WriteLong(this.VMerge);Flags|=16384}if(undefined!==this.TextDirection){Writer.WriteLong(this.TextDirection); Flags|=32768}if(undefined!==this.NoWrap){Writer.WriteBool(this.NoWrap);Flags|=65536}if(undefined!==this.HMerge){Writer.WriteLong(this.HMerge);Flags|=131072}if(undefined!==this.PrChange&&undefined!==this.ReviewInfo){this.PrChange.WriteToBinary(Writer);this.ReviewInfo.WriteToBinary(Writer);Flags|=262144}var EndPos=Writer.GetCurPosition();Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)};CTableCellPr.prototype.Read_FromBinary=function(Reader){var Flags=Reader.GetLong();if(1&Flags)this.GridSpan= Reader.GetLong();if(2&Flags){this.Shd=new CDocumentShd;this.Shd.Read_FromBinary(Reader)}if(4&Flags)this.TableCellMar=null;else if(128&Flags){this.TableCellMar={};if(8&Flags){this.TableCellMar.Bottom=new CTableMeasurement(tblwidth_Auto,0);this.TableCellMar.Bottom.Read_FromBinary(Reader)}if(16&Flags){this.TableCellMar.Left=new CTableMeasurement(tblwidth_Auto,0);this.TableCellMar.Left.Read_FromBinary(Reader)}if(32&Flags){this.TableCellMar.Right=new CTableMeasurement(tblwidth_Auto,0);this.TableCellMar.Right.Read_FromBinary(Reader)}if(64& Flags){this.TableCellMar.Top=new CTableMeasurement(tblwidth_Auto,0);this.TableCellMar.Top.Read_FromBinary(Reader)}}if(256&Flags){this.TableCellBorders.Bottom=new CDocumentBorder;this.TableCellBorders.Bottom.Read_FromBinary(Reader)}if(512&Flags){this.TableCellBorders.Left=new CDocumentBorder;this.TableCellBorders.Left.Read_FromBinary(Reader)}if(1024&Flags){this.TableCellBorders.Right=new CDocumentBorder;this.TableCellBorders.Right.Read_FromBinary(Reader)}if(2048&Flags){this.TableCellBorders.Top=new CDocumentBorder; this.TableCellBorders.Top.Read_FromBinary(Reader)}if(4096&Flags){this.TableCellW=new CTableMeasurement(tblwidth_Auto,0);this.TableCellW.Read_FromBinary(Reader)}if(8192&Flags)this.VAlign=Reader.GetLong();if(16384&Flags)this.VMerge=Reader.GetLong();if(32768&Flags)this.TextDirection=Reader.GetLong();if(65536&Flags)this.NoWrap=Reader.GetBool();if(131072&Flags)this.HMerge=Reader.GetLong();if(262144&Flags){this.PrChange=new CTableCellPr;this.ReviewInfo=new CReviewInfo;this.PrChange.ReadFromBinary(Reader); this.ReviewInfo.ReadFromBinary(Reader)}};CTableCellPr.prototype.WriteToBinary=function(oWriter){this.Write_ToBinary(oWriter)};CTableCellPr.prototype.ReadFromBinary=function(oReader){this.Read_FromBinary(oReader)};CTableCellPr.prototype.Is_Empty=function(){if(undefined!==this.GridSpan||undefined!==this.Shd||undefined!==this.TableCellMar||undefined!==this.TableCellBorders.Bottom||undefined!==this.TableCellBorders.Left||undefined!==this.TableCellBorders.Right||undefined!==this.TableCellBorders.Top|| undefined!==this.TableCellW||undefined!==this.VAlign||undefined!==this.VMerge||undefined!==this.TextDirection||undefined!==this.NoWrap||undefined!==this.HMerge)return false;return true};CTableCellPr.prototype.HavePrChange=function(){if(undefined===this.PrChange||null===this.PrChange)return false;return true};CTableCellPr.prototype.AddPrChange=function(){this.PrChange=this.Copy(false);this.ReviewInfo=new CReviewInfo;this.ReviewInfo.Update()};CTableCellPr.prototype.SetPrChange=function(oPrChange,oReviewInfo){this.PrChange= oPrChange;this.ReviewInfo=oReviewInfo};CTableCellPr.prototype.RemovePrChange=function(){delete this.PrChange;delete this.ReviewInfo};function CRFonts(){this.Ascii=undefined;this.EastAsia=undefined;this.HAnsi=undefined;this.CS=undefined;this.Hint=undefined}CRFonts.prototype={Set_All:function(FontName,FontIndex){this.Ascii={Name:FontName,Index:FontIndex};this.EastAsia={Name:FontName,Index:FontIndex};this.HAnsi={Name:FontName,Index:FontIndex};this.CS={Name:FontName,Index:FontIndex};this.Hint=fonthint_Default}, Copy:function(){var RFonts=new CRFonts;if(undefined!==this.Ascii)RFonts.Ascii={Name:this.Ascii.Name,Index:this.Ascii.Index};if(undefined!==this.EastAsia)RFonts.EastAsia={Name:this.EastAsia.Name,Index:this.EastAsia.Index};if(undefined!==this.HAnsi)RFonts.HAnsi={Name:this.HAnsi.Name,Index:this.HAnsi.Index};if(undefined!==this.CS)RFonts.CS={Name:this.CS.Name,Index:this.CS.Index};if(undefined!=this.Hint)this.Hint=RFonts.Hint;return RFonts},Merge:function(RFonts){if(RFonts.Ascii)this.Ascii=RFonts.Ascii; if(RFonts.EastAsia)this.EastAsia=RFonts.EastAsia;if(RFonts.HAnsi)this.HAnsi=RFonts.HAnsi;if(RFonts.CS)this.CS=RFonts.CS;if(RFonts.Hint)this.Hint=RFonts.Hint},InitDefault:function(){this.Ascii={Name:"Times New Roman",Index:-1};this.EastAsia={Name:"Times New Roman",Index:-1};this.HAnsi={Name:"Times New Roman",Index:-1};this.CS={Name:"Times New Roman",Index:-1};this.Hint=fonthint_Default},Set_FromObject:function(RFonts,isUndefinedToNull){if(undefined!=RFonts.Ascii)this.Ascii={Name:RFonts.Ascii.Name, Index:RFonts.Ascii.Index};else this.Ascii=isUndefinedToNull?null:undefined;if(undefined!=RFonts.EastAsia)this.EastAsia={Name:RFonts.EastAsia.Name,Index:RFonts.EastAsia.Index};else this.EastAsia=isUndefinedToNull?null:undefined;if(undefined!=RFonts.HAnsi)this.HAnsi={Name:RFonts.HAnsi.Name,Index:RFonts.HAnsi.Index};else this.HAnsi=isUndefinedToNull?null:undefined;if(undefined!=RFonts.CS)this.CS={Name:RFonts.CS.Name,Index:RFonts.CS.Index};else this.CS=isUndefinedToNull?null:undefined;this.Hint=CheckUndefinedToNull(isUndefinedToNull, RFonts.Hint)},Write_ToBinary:function(Writer){var StartPos=Writer.GetCurPosition();Writer.Skip(4);var Flags=0;if(undefined!=this.Ascii){Writer.WriteString2(this.Ascii.Name);Flags|=1}if(undefined!=this.EastAsia){Writer.WriteString2(this.EastAsia.Name);Flags|=2}if(undefined!=this.HAnsi){Writer.WriteString2(this.HAnsi.Name);Flags|=4}if(undefined!=this.CS){Writer.WriteString2(this.CS.Name);Flags|=8}if(undefined!=this.Hint){Writer.WriteLong(this.Hint);Flags|=16}var EndPos=Writer.GetCurPosition();Writer.Seek(StartPos); Writer.WriteLong(Flags);Writer.Seek(EndPos)},Read_FromBinary:function(Reader){var Flags=Reader.GetLong();if(Flags&1)this.Ascii={Name:Reader.GetString2(),Index:-1};if(Flags&2)this.EastAsia={Name:Reader.GetString2(),Index:-1};if(Flags&4)this.HAnsi={Name:Reader.GetString2(),Index:-1};if(Flags&8)this.CS={Name:Reader.GetString2(),Index:-1};if(Flags&16)this.Hint=Reader.GetLong()}};CRFonts.prototype.Is_Empty=function(){if(undefined!==this.Ascii||undefined!==this.EastAsia||undefined!==this.HAnsi||undefined!== this.CS||undefined!==this.Hint)return false;return true};CRFonts.prototype.SetAll=function(sFontName,nFontIndex){if(undefined===nFontIndex)nFontIndex=-1;this.Set_All(sFontName,nFontIndex)};CRFonts.prototype.IsEqual=function(oRFonts){return this.private_IsEqual(this.Ascii,oRFonts.Ascii)&&this.private_IsEqual(this.EastAsia,oRFonts.EastAsia)&&this.private_IsEqual(this.HAnsi,oRFonts.HAnsi)&&this.private_IsEqual(this.CS,oRFonts.CS)&&this.Hint===oRFonts.Hint};CRFonts.prototype.private_IsEqual=function(oFont1, oFont2){return undefined===oFont1&&undefined===oFont2||undefined!==oFont1&&undefined!==oFont2&&oFont1.Name===oFont2.Name};CRFonts.prototype.Is_Equal=function(RFonts){return this.IsEqual(RFonts)};CRFonts.prototype.Compare=function(RFonts){return this.IsEqual(RFonts)};function CLang(){this.Bidi=undefined;this.EastAsia=undefined;this.Val=undefined}CLang.prototype={Copy:function(){var Lang=new CLang;Lang.Bidi=this.Bidi;Lang.EastAsia=this.EastAsia;Lang.Val=this.Val;return Lang},Merge:function(Lang){if(undefined!== Lang.Bidi)this.Bidi=Lang.Bidi;if(undefined!==Lang.EastAsia)this.EastAsia=Lang.EastAsia;if(undefined!==Lang.Val)this.Val=Lang.Val},InitDefault:function(){this.Bidi=lcid_arSA;this.EastAsia=lcid_zhCN;this.Val=lcid_enUS},Set_FromObject:function(Lang,isUndefinedToNull){this.Bidi=CheckUndefinedToNull(isUndefinedToNull,Lang.Bidi);this.EastAsia=CheckUndefinedToNull(isUndefinedToNull,Lang.EastAsia);this.Val=CheckUndefinedToNull(isUndefinedToNull,Lang.Val)},Compare:function(Lang){if(undefined!==this.Bidi&& this.Bidi!==Lang.Bidi)this.Bidi=undefined;if(undefined!==this.EastAsia&&this.EastAsia!==Lang.EastAsia)this.EastAsia=undefined;if(undefined!==this.Val&&this.Val!==Lang.Val)this.Val=undefined},Write_ToBinary:function(Writer){var StartPos=Writer.GetCurPosition();Writer.Skip(4);var Flags=0;if(undefined!=this.Bidi){Writer.WriteLong(this.Bidi);Flags|=1}if(undefined!=this.EastAsia){Writer.WriteLong(this.EastAsia);Flags|=2}if(undefined!=this.Val){Writer.WriteLong(this.Val);Flags|=4}var EndPos=Writer.GetCurPosition(); Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)},Read_FromBinary:function(Reader){var Flags=Reader.GetLong();if(Flags&1)this.Bidi=Reader.GetLong();if(Flags&2)this.EastAsia=Reader.GetLong();if(Flags&4)this.Val=Reader.GetLong()}};CLang.prototype.Is_Empty=function(){if(undefined!==this.Bidi||undefined!==this.EastAsia||undefined!==this.Val)return false;return true};CLang.prototype.IsEqual=function(oLang){return this.Bidi===oLang.Bidi&&this.EastAsia===oLang.EastAsia&&this.Val===oLang.Val}; CLang.prototype.Is_Equal=function(Lang){return this.IsEqual(Lang)};function CTextPr(){this.Bold=undefined;this.Italic=undefined;this.Strikeout=undefined;this.Underline=undefined;this.FontFamily=undefined;this.FontSize=undefined;this.Color=undefined;this.VertAlign=undefined;this.HighLight=undefined;this.RStyle=undefined;this.Spacing=undefined;this.DStrikeout=undefined;this.Caps=undefined;this.SmallCaps=undefined;this.Position=undefined;this.RFonts=new CRFonts;this.BoldCS=undefined;this.ItalicCS=undefined; this.FontSizeCS=undefined;this.CS=undefined;this.RTL=undefined;this.Lang=new CLang;this.Unifill=undefined;this.FontRef=undefined;this.Shd=undefined;this.Vanish=undefined;this.TextOutline=undefined;this.TextFill=undefined;this.HighlightColor=undefined;this.FontScale=undefined;this.FontSizeOrig=undefined;this.FontSizeCSOrig=undefined;this.PrChange=undefined;this.ReviewInfo=undefined}CTextPr.prototype.Clear=function(){this.Bold=undefined;this.Italic=undefined;this.Strikeout=undefined;this.Underline= undefined;this.FontFamily=undefined;this.FontSize=undefined;this.Color=undefined;this.VertAlign=undefined;this.HighLight=undefined;this.RStyle=undefined;this.Spacing=undefined;this.DStrikeout=undefined;this.Caps=undefined;this.SmallCaps=undefined;this.Position=undefined;this.RFonts=new CRFonts;this.BoldCS=undefined;this.ItalicCS=undefined;this.FontSizeCS=undefined;this.CS=undefined;this.RTL=undefined;this.Lang=new CLang;this.Unifill=undefined;this.FontRef=undefined;this.Shd=undefined;this.Vanish= undefined;this.TextOutline=undefined;this.TextFill=undefined;this.HighlightColor=undefined;this.AscFill=undefined;this.AscUnifill=undefined;this.AscLine=undefined;this.FontScale=undefined;this.FontSizeOrig=undefined;this.FontSizeCSOrig=undefined;this.PrChange=undefined;this.ReviewInfo=undefined};CTextPr.prototype.Copy=function(bCopyPrChange,oPr){var TextPr=new CTextPr;TextPr.Bold=this.Bold;TextPr.Italic=this.Italic;TextPr.Strikeout=this.Strikeout;TextPr.Underline=this.Underline;if(undefined!=this.FontFamily){TextPr.FontFamily= {};TextPr.FontFamily.Name=this.FontFamily.Name;TextPr.FontFamily.Index=this.FontFamily.Index}TextPr.FontSize=this.FontSize;if(undefined!=this.Color)TextPr.Color=new CDocumentColor(this.Color.r,this.Color.g,this.Color.b,this.Color.Auto);TextPr.VertAlign=this.VertAlign;TextPr.HighLight=this.Copy_HighLight();TextPr.RStyle=this.RStyle;if(oPr&&oPr.Comparison&&TextPr.RStyle)TextPr.RStyle=oPr.Comparison.copyStyleById(TextPr.RStyle);TextPr.Spacing=this.Spacing;TextPr.DStrikeout=this.DStrikeout;TextPr.Caps= this.Caps;TextPr.SmallCaps=this.SmallCaps;TextPr.Position=this.Position;TextPr.RFonts=this.RFonts.Copy();TextPr.BoldCS=this.BoldCS;TextPr.ItalicCS=this.ItalicCS;TextPr.FontSizeCS=this.FontSizeCS;TextPr.CS=this.CS;TextPr.RTL=this.RTL;TextPr.Lang=this.Lang.Copy();if(undefined!=this.Unifill)TextPr.Unifill=this.Unifill.createDuplicate();if(undefined!=this.FontRef)TextPr.FontRef=this.FontRef.createDuplicate();if(undefined!==this.Shd)TextPr.Shd=this.Shd.Copy();if(undefined!==this.FontScale)TextPr.FontScale= this.FontScale;TextPr.Vanish=this.Vanish;if(true===bCopyPrChange&&undefined!==this.PrChange){TextPr.PrChange=this.PrChange.Copy();TextPr.ReviewInfo=this.ReviewInfo.Copy()}if(undefined!=this.TextOutline)TextPr.TextOutline=this.TextOutline.createDuplicate();if(undefined!=this.TextFill)TextPr.TextFill=this.TextFill.createDuplicate();if(undefined!==this.HighlightColor)TextPr.HighlightColor=this.HighlightColor.createDuplicate();return TextPr};CTextPr.prototype.Copy_HighLight=function(){if(undefined=== this.HighLight)return undefined;else if(highlight_None===this.HighLight)return highlight_None;else return this.HighLight.Copy();return undefined};CTextPr.prototype.Merge=function(TextPr){if(undefined!=TextPr.Bold)this.Bold=TextPr.Bold;if(undefined!=TextPr.Italic)this.Italic=TextPr.Italic;if(undefined!=TextPr.Strikeout)this.Strikeout=TextPr.Strikeout;if(undefined!=TextPr.Underline)this.Underline=TextPr.Underline;if(undefined!=TextPr.FontFamily){this.FontFamily={};this.FontFamily.Name=TextPr.FontFamily.Name; this.FontFamily.Index=TextPr.FontFamily.Index}if(undefined!=TextPr.FontSize)this.FontSize=TextPr.FontSize;if(undefined!=TextPr.Color)this.Color=TextPr.Color.Copy();if(undefined!=TextPr.VertAlign)this.VertAlign=TextPr.VertAlign;if(undefined===TextPr.HighLight||null===TextPr.HighLight);else if(highlight_None===TextPr.HighLight)this.HighLight=highlight_None;else this.HighLight=TextPr.HighLight.Copy();if(undefined!=TextPr.RStyle)this.RStyle=TextPr.RStyle;if(undefined!=TextPr.Spacing)this.Spacing=TextPr.Spacing; if(undefined!=TextPr.DStrikeout)this.DStrikeout=TextPr.DStrikeout;if(undefined!=TextPr.SmallCaps)this.SmallCaps=TextPr.SmallCaps;if(undefined!=TextPr.Caps)this.Caps=TextPr.Caps;if(undefined!=TextPr.Position)this.Position=TextPr.Position;this.RFonts.Merge(TextPr.RFonts);if(undefined!=TextPr.BoldCS)this.BoldCS=TextPr.BoldCS;if(undefined!=TextPr.ItalicCS)this.ItalicCS=TextPr.ItalicCS;if(undefined!=TextPr.FontSizeCS)this.FontSizeCS=TextPr.FontSizeCS;if(undefined!=TextPr.CS)this.CS=TextPr.CS;if(undefined!= TextPr.RTL)this.RTL=TextPr.RTL;if(TextPr.Lang)this.Lang.Merge(TextPr.Lang);if(TextPr.Unifill){this.Unifill=TextPr.Unifill.createDuplicate();this.TextFill=undefined}else if(undefined!=TextPr.Color)this.Unifill=undefined;if(undefined!=TextPr.FontRef)this.FontRef=TextPr.FontRef.createDuplicate();if(TextPr.Shd)this.Shd=TextPr.Shd.Copy();if(undefined!==TextPr.Vanish)this.Vanish=TextPr.Vanish;if(TextPr.TextOutline)this.TextOutline=TextPr.TextOutline.createDuplicate();if(TextPr.TextFill){this.TextFill=TextPr.TextFill.createDuplicate(); this.Unifill=undefined}if(TextPr.HighlightColor)this.HighlightColor=TextPr.HighlightColor.createDuplicate();if(undefined!==TextPr.FontScale)this.FontScale=TextPr.FontScale};CTextPr.prototype.InitDefault=function(nCompatibilityMode){this.Bold=false;this.Italic=false;this.Underline=false;this.Strikeout=false;this.FontFamily={Name:"Times New Roman",Index:-1};this.FontSize=10;this.Color=new CDocumentColor(0,0,0,true);this.VertAlign=AscCommon.vertalign_Baseline;this.HighLight=highlight_None;this.RStyle= undefined;this.Spacing=0;this.DStrikeout=false;this.SmallCaps=false;this.Caps=false;this.Position=0;this.RFonts.InitDefault();this.BoldCS=false;this.ItalicCS=false;this.FontSizeCS=10;this.CS=false;this.RTL=false;this.Lang.InitDefault();this.Unifill=undefined;this.FontRef=undefined;this.Shd=undefined;this.Vanish=false;this.TextOutline=undefined;this.TextFill=undefined;this.HighlightColor=undefined;this.FontScale=undefined;this.FontSizeOrig=undefined;this.FontSizeCSOrig=undefined;this.PrChange=undefined; this.ReviewInfo=undefined};CTextPr.prototype.Set_FromObject=function(TextPr,isUndefinedToNull){this.Bold=CheckUndefinedToNull(isUndefinedToNull,TextPr.Bold);this.Italic=CheckUndefinedToNull(isUndefinedToNull,TextPr.Italic);this.Strikeout=CheckUndefinedToNull(isUndefinedToNull,TextPr.Strikeout);this.Underline=CheckUndefinedToNull(isUndefinedToNull,TextPr.Underline);if(undefined!==TextPr.FontFamily){this.FontFamily={};this.FontFamily.Name=TextPr.FontFamily.Name;this.FontFamily.Index=TextPr.FontFamily.Index}else if(isUndefinedToNull)this.FontFamily= null;else this.FontFamily=undefined;this.FontSize=CheckUndefinedToNull(isUndefinedToNull,TextPr.FontSize);if(null===TextPr.Color||undefined===TextPr.Color)this.Color=CheckUndefinedToNull(isUndefinedToNull,TextPr.Color);else this.Color=new CDocumentColor(TextPr.Color.r,TextPr.Color.g,TextPr.Color.b,TextPr.Color.Auto);this.VertAlign=CheckUndefinedToNull(isUndefinedToNull,TextPr.VertAlign);if(undefined===TextPr.HighLight||null===TextPr.HighLight)this.HighLight=CheckUndefinedToNull(isUndefinedToNull, undefined);else if(highlight_None===TextPr.HighLight)this.HighLight=highlight_None;else this.HighLight=new CDocumentColor(TextPr.HighLight.r,TextPr.HighLight.g,TextPr.HighLight.b);this.RStyle=CheckUndefinedToNull(isUndefinedToNull,TextPr.RStyle);this.Spacing=CheckUndefinedToNull(isUndefinedToNull,TextPr.Spacing);this.DStrikeout=CheckUndefinedToNull(isUndefinedToNull,TextPr.DStrikeout);this.Caps=CheckUndefinedToNull(isUndefinedToNull,TextPr.Caps);this.SmallCaps=CheckUndefinedToNull(isUndefinedToNull, TextPr.SmallCaps);this.Position=CheckUndefinedToNull(isUndefinedToNull,TextPr.Position);if(undefined!==TextPr.RFonts)this.RFonts.Set_FromObject(TextPr.RFonts,isUndefinedToNull);this.BoldCS=CheckUndefinedToNull(isUndefinedToNull,TextPr.BoldCS);this.ItalicCS=CheckUndefinedToNull(isUndefinedToNull,TextPr.ItalicCS);this.FontSizeCS=CheckUndefinedToNull(isUndefinedToNull,TextPr.FontSizeCS);this.CS=CheckUndefinedToNull(isUndefinedToNull,TextPr.CS);this.RTL=CheckUndefinedToNull(isUndefinedToNull,TextPr.RTL); if(undefined!==TextPr.Lang)this.Lang.Set_FromObject(TextPr.Lang,isUndefinedToNull);if(undefined!==TextPr.Shd){this.Shd=new CDocumentShd;this.Shd.Set_FromObject(TextPr.Shd)}else this.Shd=isUndefinedToNull?null:undefined;this.Vanish=CheckUndefinedToNull(isUndefinedToNull,TextPr.Vanish);this.Unifill=CheckUndefinedToNull(isUndefinedToNull,TextPr.Unifill);this.FontRef=CheckUndefinedToNull(isUndefinedToNull,TextPr.FontRef);this.TextFill=CheckUndefinedToNull(isUndefinedToNull,TextPr.TextFill);this.HighlightColor= CheckUndefinedToNull(isUndefinedToNull,TextPr.HighlightColor);this.TextOutline=CheckUndefinedToNull(isUndefinedToNull,TextPr.TextOutline);this.AscFill=CheckUndefinedToNull(isUndefinedToNull,TextPr.AscFill);this.AscUnifill=CheckUndefinedToNull(isUndefinedToNull,TextPr.AscUnifill);this.AscLine=CheckUndefinedToNull(isUndefinedToNull,TextPr.AscLine);this.FontScale=CheckUndefinedToNull(isUndefinedToNull,TextPr.FontScale)};CTextPr.prototype.Check_PresentationPr=function(){if(this.FontRef&&!this.Unifill){var prefix; if(this.FontRef.idx===AscFormat.fntStyleInd_minor)prefix="+mn-";else prefix="+mj-";this.RFonts.Set_FromObject({Ascii:{Name:prefix+"lt",Index:-1},EastAsia:{Name:prefix+"ea",Index:-1},HAnsi:{Name:prefix+"lt",Index:-1},CS:{Name:prefix+"lt",Index:-1}});if(this.FontRef.Color&&!this.Unifill)this.Unifill=AscFormat.CreateUniFillByUniColorCopy(this.FontRef.Color)}};CTextPr.prototype.Compare=function(TextPr){if(undefined!==this.Bold&&this.Bold!==TextPr.Bold)this.Bold=undefined;if(undefined!==this.Italic&&this.Italic!== TextPr.Italic)this.Italic=undefined;if(undefined!==this.Strikeout&&this.Strikeout!==TextPr.Strikeout)this.Strikeout=undefined;if(undefined!==this.Underline&&this.Underline!==TextPr.Underline)this.Underline=undefined;if(undefined!==this.FontFamily&&(undefined===TextPr.FontFamily||this.FontFamily.Name!==TextPr.FontFamily.Name))this.FontFamily=undefined;if(undefined!==this.FontSize&&(undefined===TextPr.FontSize||Math.abs(this.FontSize-TextPr.FontSize)>=.001))this.FontSize=undefined;if(undefined!==this.Color&& (undefined===TextPr.Color||true!==this.Color.Compare(TextPr.Color)))this.Color=undefined;if(undefined!==this.VertAlign&&this.VertAlign!==TextPr.VertAlign)this.VertAlign=undefined;if(undefined!==this.HighLight&&(undefined===TextPr.HighLight||highlight_None===this.HighLight&&highlight_None!==TextPr.HighLight||highlight_None!==this.HighLight&&highlight_None===TextPr.HighLight||highlight_None!==this.HighLight&&highlight_None!==TextPr.HighLight&&true!==this.HighLight.Compare(TextPr.HighLight)))this.HighLight= undefined;if(undefined!==this.RStyle&&(undefined===TextPr.RStyle||this.RStyle!==TextPr.RStyle))this.RStyle=undefined;if(undefined!==this.Spacing&&(undefined===TextPr.Spacing||Math.abs(this.Spacing-TextPr.Spacing)>=.001))this.Spacing=undefined;if(undefined!==this.DStrikeout&&(undefined===TextPr.DStrikeout||this.DStrikeout!==TextPr.DStrikeout))this.DStrikeout=undefined;if(undefined!==this.Caps&&(undefined===TextPr.Caps||this.Caps!==TextPr.Caps))this.Caps=undefined;if(undefined!==this.SmallCaps&&(undefined=== TextPr.SmallCaps||this.SmallCaps!==TextPr.SmallCaps))this.SmallCaps=undefined;if(undefined!==this.Position&&(undefined===TextPr.Position||Math.abs(this.Position-TextPr.Position)>=.001))this.Position=undefined;this.RFonts.Compare(TextPr.RFonts);if(undefined!==this.BoldCS&&this.BoldCS!==TextPr.BoldCS)this.BoldCS=undefined;if(undefined!==this.ItalicCS&&this.ItalicCS!==TextPr.ItalicCS)this.ItalicCS=undefined;if(undefined!==this.FontSizeCS&&(undefined===TextPr.FontSizeCS||Math.abs(this.FontSizeCS-TextPr.FontSizeCS)>= .001))this.FontSizeCS=undefined;if(undefined!==this.CS&&this.CS!==TextPr.CS)this.CS=undefined;if(undefined!==this.RTL&&this.RTL!==TextPr.RTL)this.RTL=undefined;this.Lang.Compare(TextPr.Lang);if(undefined!==this.Vanish&&this.Vanish!==TextPr.Vanish)this.Vanish=undefined;if(undefined!==this.FontScale&&this.FontScale!==TextPr.FontScale)this.FontScale=undefined;if(undefined!==this.Unifill&&!this.Unifill.IsIdentical(TextPr.Unifill)){this.Unifill=AscFormat.CompareUniFill(this.Unifill,TextPr.Unifill);if(null=== this.Unifill)this.Unifill=undefined;this.Color=undefined;this.TextFill=undefined}if(undefined!==this.TextFill&&!this.TextFill.IsIdentical(TextPr.TextFill)){this.Unifill=undefined;this.Color=undefined;this.TextFill=AscFormat.CompareUniFill(this.TextFill,TextPr.TextFill);if(null===this.TextFill)this.TextFill=undefined}if(undefined!==this.HighlightColor&&!this.HighlightColor.IsIdentical(TextPr.HighlightColor)){this.HighlightColor=this.HighlightColor.compare(TextPr.HighlightColor);if(null===this.HighlightColor)this.HighlightColor= undefined}if(undefined!==this.TextOutline&&!this.TextOutline.IsIdentical(TextPr.TextOutline))if(TextPr.TextOutline!==undefined)this.TextOutline=this.TextOutline.compare(TextPr.TextOutline);else this.TextOutline=undefined;return this};CTextPr.prototype.ReplaceThemeFonts=function(oFontScheme){if(this.RFonts&&oFontScheme){if(this.RFonts.Ascii){this.RFonts.Ascii.Name=oFontScheme.checkFont(this.RFonts.Ascii.Name);this.RFonts.Ascii.Index=-1}if(this.RFonts.EastAsia){this.RFonts.EastAsia.Name=oFontScheme.checkFont(this.RFonts.EastAsia.Name); this.RFonts.EastAsia.Index=-1}if(this.RFonts.HAnsi){this.RFonts.HAnsi.Name=oFontScheme.checkFont(this.RFonts.HAnsi.Name);this.RFonts.HAnsi.Index=-1}if(this.RFonts.CS){this.RFonts.CS.Name=oFontScheme.checkFont(this.RFonts.CS.Name);this.RFonts.CS.Index=-1}}if(this.FontFamily){this.FontFamily.Name=oFontScheme.checkFont(this.FontFamily.Name);this.FontFamily.Index=-1}};CTextPr.prototype.GetIncDecFontSize=function(IncFontSize){var FontSize=this.FontSize;if(this.FontScale!==null&&this.FontScale!==undefined&& this.FontSizeOrig!==null&&this.FontSizeOrig!==undefined)FontSize=this.FontSizeOrig;return FontSize_IncreaseDecreaseValue(IncFontSize,FontSize)};CTextPr.prototype.GetIncDecFontSizeCS=function(IncFontSize){var FontSize=this.FontSizeCS;if(this.FontScale!==null&&this.FontScale!==undefined&&this.FontSizeCSOrig!==null&&this.FontSizeCSOrig!==undefined)FontSize=this.FontSizeCSOrig;return FontSize_IncreaseDecreaseValue(IncFontSize,FontSize)};CTextPr.prototype.CheckFontScale=function(){if(this.FontScale!== null&&this.FontScale!==undefined){this.FontSizeOrig=this.FontSize;this.FontSizeCSOrig=this.FontSizeCS;this.FontSize*=this.FontScale;this.FontSize=this.FontSize+.5>>0;this.FontSize=Math.max(1,this.FontSize);this.FontSizeCS*=this.FontScale;this.FontSizeCS=this.FontSizeCS+.5>>0;this.FontSizeCS=Math.max(1,this.FontSizeCS)}};CTextPr.prototype.Write_ToBinary=function(Writer){var StartPos=Writer.GetCurPosition();Writer.Skip(4);var Flags=0;if(undefined!=this.Bold){Writer.WriteBool(this.Bold);Flags|=1}if(undefined!= this.Italic){Writer.WriteBool(this.Italic);Flags|=2}if(undefined!=this.Underline){Writer.WriteBool(this.Underline);Flags|=4}if(undefined!=this.Strikeout){Writer.WriteBool(this.Strikeout);Flags|=8}if(undefined!=this.FontFamily){Writer.WriteString2(this.FontFamily.Name);Flags|=16}if(undefined!=this.FontSize){Writer.WriteDouble(this.FontSize);Flags|=32}if(undefined!=this.Color){this.Color.Write_ToBinary(Writer);Flags|=64}if(undefined!=this.VertAlign){Writer.WriteLong(this.VertAlign);Flags|=128}if(undefined!= this.HighLight){if(highlight_None===this.HighLight)Writer.WriteLong(highlight_None);else{Writer.WriteLong(0);this.HighLight.Write_ToBinary(Writer)}Flags|=256}if(undefined!=this.RStyle){Writer.WriteString2(this.RStyle);Flags|=512}if(undefined!=this.Spacing){Writer.WriteDouble(this.Spacing);Flags|=1024}if(undefined!=this.DStrikeout){Writer.WriteBool(this.DStrikeout);Flags|=2048}if(undefined!=this.Caps){Writer.WriteBool(this.Caps);Flags|=4096}if(undefined!=this.SmallCaps){Writer.WriteBool(this.SmallCaps); Flags|=8192}if(undefined!=this.Position){Writer.WriteDouble(this.Position);Flags|=16384}if(undefined!=this.RFonts){this.RFonts.Write_ToBinary(Writer);Flags|=32768}if(undefined!=this.BoldCS){Writer.WriteBool(this.BoldCS);Flags|=65536}if(undefined!=this.ItalicCS){Writer.WriteBool(this.ItalicCS);Flags|=131072}if(undefined!=this.FontSizeCS){Writer.WriteDouble(this.FontSizeCS);Flags|=262144}if(undefined!=this.CS){Writer.WriteBool(this.CS);Flags|=524288}if(undefined!=this.RTL){Writer.WriteBool(this.RTL); Flags|=1048576}if(undefined!=this.Lang){this.Lang.Write_ToBinary(Writer);Flags|=2097152}if(undefined!=this.Unifill){this.Unifill.Write_ToBinary(Writer);Flags|=4194304}if(undefined!==this.Shd){this.Shd.Write_ToBinary(Writer);Flags|=8388608}if(undefined!==this.Vanish){Writer.WriteBool(this.Vanish);Flags|=16777216}if(undefined!==this.FontRef){this.FontRef.Write_ToBinary(Writer);Flags|=33554432}if(undefined!==this.PrChange){this.PrChange.Write_ToBinary(Writer);Flags|=67108864}if(undefined!==this.TextOutline){this.TextOutline.Write_ToBinary(Writer); Flags|=134217728}if(undefined!==this.TextFill){this.TextFill.Write_ToBinary(Writer);Flags|=268435456}if(undefined!==this.PrChange){this.PrChange.WriteToBinary(Writer);this.ReviewInfo.WriteToBinary(Writer);Flags|=536870912}if(undefined!=this.HighlightColor){this.HighlightColor.Write_ToBinary(Writer);Flags|=1073741824}var EndPos=Writer.GetCurPosition();Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)};CTextPr.prototype.Read_FromBinary=function(Reader){var Flags=Reader.GetLong();if(Flags& 1)this.Bold=Reader.GetBool();if(Flags&2)this.Italic=Reader.GetBool();if(Flags&4)this.Underline=Reader.GetBool();if(Flags&8)this.Strikeout=Reader.GetBool();if(Flags&16)this.FontFamily={Name:Reader.GetString2(),Index:-1};if(Flags&32)this.FontSize=Reader.GetDouble();if(Flags&64){this.Color=new CDocumentColor(0,0,0);this.Color.Read_FromBinary(Reader)}if(Flags&128)this.VertAlign=Reader.GetLong();if(Flags&256){var HL_type=Reader.GetLong();if(highlight_None==HL_type)this.HighLight=highlight_None;else{this.HighLight= new CDocumentColor(0,0,0);this.HighLight.Read_FromBinary(Reader)}}if(Flags&512)this.RStyle=Reader.GetString2();if(Flags&1024)this.Spacing=Reader.GetDouble();if(Flags&2048)this.DStrikeout=Reader.GetBool();if(Flags&4096)this.Caps=Reader.GetBool();if(Flags&8192)this.SmallCaps=Reader.GetBool();if(Flags&16384)this.Position=Reader.GetDouble();if(Flags&32768)this.RFonts.Read_FromBinary(Reader);if(Flags&65536)this.BoldCS=Reader.GetBool();if(Flags&131072)this.ItalicCS=Reader.GetBool();if(Flags&262144)this.FontSizeCS= Reader.GetDouble();if(Flags&524288)this.CS=Reader.GetBool();if(Flags&1048576)this.RTL=Reader.GetBool();if(Flags&2097152)this.Lang.Read_FromBinary(Reader);if(Flags&4194304){this.Unifill=new AscFormat.CUniFill;this.Unifill.Read_FromBinary(Reader)}if(Flags&8388608){this.Shd=new CDocumentShd;this.Shd.Read_FromBinary(Reader)}if(Flags&16777216)this.Vanish=Reader.GetBool();if(Flags&33554432){this.FontRef=new AscFormat.FontRef;this.FontRef.Read_FromBinary(Reader)}if(Flags&67108864){this.PrChange=new CTextPr; this.PrChange.Read_FromBinary(Reader)}if(Flags&134217728){this.TextOutline=new AscFormat.CLn;this.TextOutline.Read_FromBinary(Reader)}if(Flags&268435456){this.TextFill=new AscFormat.CUniFill;this.TextFill.Read_FromBinary(Reader)}if(Flags&536870912){this.PrChange=new CTextPr;this.ReviewInfo=new CReviewInfo;this.PrChange.ReadFromBinary(Reader);this.ReviewInfo.ReadFromBinary(Reader)}if(Flags&1073741824){this.HighlightColor=new AscFormat.CUniColor;this.HighlightColor.Read_FromBinary(Reader)}};CTextPr.prototype.Check_NeedRecalc= function(){return true;if(undefined!=this.Bold)return true;if(undefined!=this.Italic)return true;if(undefined!=this.FontFamily)return true;if(undefined!=this.FontSize)return true;if(undefined!=this.VertAlign)return true;if(undefined!=this.Spacing)return true;if(undefined!=this.Caps)return true;if(undefined!=this.SmallCaps)return true;if(undefined!=this.Position)return true;if(undefined!=this.RFonts.Ascii)return true;if(undefined!=this.RFonts.EastAsia)return true;if(undefined!=this.RFonts.HAnsi)return true; if(undefined!=this.RFonts.CS)return true;if(undefined!=this.RTL||undefined!=this.CS||undefined!=this.BoldCS||undefined!=this.ItalicCS||undefined!=this.FontSizeCS)return true;if(undefined!=this.Lang.Val)return true;if(undefined!=this.Color)return true;if(undefined!=this.HighLight)return true;if(undefined!=this.Shd)return true;return false};CTextPr.prototype.Get_FontKoef=function(){var dFontKoef=1;switch(this.VertAlign){case AscCommon.vertalign_Baseline:{dFontKoef=1;break}case AscCommon.vertalign_SubScript:case AscCommon.vertalign_SuperScript:{dFontKoef= AscCommon.vaKSize;break}}return dFontKoef};CTextPr.prototype.Document_Get_AllFontNames=function(AllFonts){if(undefined!=this.RFonts.Ascii)AllFonts[this.RFonts.Ascii.Name]=true;if(undefined!=this.RFonts.HAnsi)AllFonts[this.RFonts.HAnsi.Name]=true;if(undefined!=this.RFonts.EastAsia)AllFonts[this.RFonts.EastAsia.Name]=true;if(undefined!=this.RFonts.CS)AllFonts[this.RFonts.CS.Name]=true};CTextPr.prototype.Document_CreateFontMap=function(FontMap,FontScheme){var Style=(true===this.Bold?1:0)+(true===this.Italic? 2:0);var StyleCS=(true===this.BoldCS?1:0)+(true===this.ItalicCS?2:0);var Size=this.FontSize;var SizeCS=this.FontSizeCS;var RFonts=this.RFonts;var CheckedName;if(undefined!=RFonts.Ascii){CheckedName=FontScheme.checkFont(RFonts.Ascii.Name);var Key=""+CheckedName+"_"+Style+"_"+Size;FontMap[Key]={Name:CheckedName,Style:Style,Size:Size}}if(undefined!=RFonts.EastAsia){CheckedName=FontScheme.checkFont(RFonts.EastAsia.Name);var Key=""+CheckedName+"_"+Style+"_"+Size;FontMap[Key]={Name:CheckedName,Style:Style, Size:Size}}if(undefined!=RFonts.HAnsi){CheckedName=FontScheme.checkFont(RFonts.HAnsi.Name);var Key=""+CheckedName+"_"+Style+"_"+Size;FontMap[Key]={Name:CheckedName,Style:Style,Size:Size}}if(undefined!=RFonts.CS){CheckedName=FontScheme.checkFont(RFonts.CS.Name);var Key=""+CheckedName+"_"+StyleCS+"_"+SizeCS;FontMap[Key]={Name:CheckedName,Style:StyleCS,Size:SizeCS}}};CTextPr.prototype.isEqual=function(TextPrOld,TextPrNew){if(TextPrOld==undefined||TextPrNew==undefined)return false;for(var TextPr in TextPrOld)if(typeof TextPrOld[TextPr]== "object")this.isEqual(TextPrOld[TextPr],TextPrNew[TextPr]);else if(typeof TextPrOld[TextPr]=="number"&&typeof TextPrNew[TextPr]=="number"){if(Math.abs(TextPrOld[TextPr]-TextPrNew[TextPr])>.001)return false}else if(TextPrOld[TextPr]!=TextPrNew[TextPr])return false;return true};CTextPr.prototype.Is_Equal=function(TextPr){if(!TextPr)return false;if(this.Bold!==TextPr.Bold)return false;if(this.Italic!==TextPr.Italic)return false;if(this.Strikeout!==TextPr.Strikeout)return false;if(this.Underline!==TextPr.Underline)return false; if(undefined===this.FontFamily&&undefined!==TextPr.FontFamily||undefined!==this.FontFamily&&(undefined===TextPr.FontFamily||this.FontFamily.Name!==TextPr.FontFamily.Name))return false;if(undefined===this.FontSize&&undefined!==TextPr.FontSize||undefined!==this.FontSize&&(undefined===TextPr.FontSize||Math.abs(this.FontSize-TextPr.FontSize)>=.001))return false;if(undefined===this.Color&&undefined!==TextPr.Color||undefined!==this.Color&&(undefined===TextPr.Color||true!==this.Color.Compare(TextPr.Color)))return false; if(this.VertAlign!==TextPr.VertAlign)return false;if(undefined===this.HighLight&&undefined!==TextPr.HighLight||undefined!==this.HighLight&&(undefined===TextPr.HighLight||highlight_None===this.HighLight&&highlight_None!==TextPr.HighLight||highlight_None!==this.HighLight&&highlight_None===TextPr.HighLight||highlight_None!==this.HighLight&&highlight_None!==TextPr.HighLight&&true!==this.HighLight.Compare(TextPr.HighLight)))return false;if(this.RStyle!==TextPr.RStyle)return false;if(undefined===this.Spacing&& undefined!==TextPr.Spacing||undefined!==this.Spacing&&(undefined===TextPr.Spacing||Math.abs(this.Spacing-TextPr.Spacing)>=.001))return false;if(this.DStrikeout!==TextPr.DStrikeout)return false;if(this.Caps!==TextPr.Caps)return false;if(this.SmallCaps!==TextPr.SmallCaps)return false;if(undefined===this.Position&&undefined!==TextPr.Position||undefined!==this.Position&&(undefined===TextPr.Position||Math.abs(this.Position-TextPr.Position)>=.001))return false;if(true!==this.RFonts.Is_Equal(TextPr.RFonts))return false; if(this.BoldCS!==TextPr.BoldCS)return false;if(this.ItalicCS!==TextPr.ItalicCS)return false;if(undefined===this.FontSizeCS&&undefined!==TextPr.FontSizeCS||undefined!==this.FontSizeCS&&(undefined===TextPr.FontSizeCS||Math.abs(this.FontSizeCS-TextPr.FontSizeCS)>=.001))return false;if(this.CS!==TextPr.CS)return false;if(this.RTL!==TextPr.RTL)return false;if(true!==this.Lang.Is_Equal(TextPr.Lang))return false;if(undefined===this.Unifill&&undefined!==TextPr.Unifill||undefined!==this.Unifill&&(undefined=== TextPr.Unifill||true!==this.Unifill.IsIdentical(TextPr.Unifill)))return false;if(undefined===this.TextOutline&&undefined!==TextPr.TextOutline||undefined!==this.TextOutline&&(undefined===TextPr.TextOutline||true!==this.TextOutline.IsIdentical(TextPr.TextOutline)))return false;if(undefined===this.TextFill&&undefined!==TextPr.TextFill||undefined!==this.TextFill&&(undefined===TextPr.TextFill||true!==this.TextFill.IsIdentical(TextPr.TextFill)))return false;if(undefined===this.HighlightColor&&undefined!== TextPr.HighlightColor||undefined!==this.HighlightColor&&(undefined===TextPr.HighlightColor||true!==this.HighlightColor.IsIdentical(TextPr.HighlightColor)))return false;if(this.Vanish!==TextPr.Vanish)return false;if(!IsEqualStyleObjects(this.Shd,TextPr.Shd))return false;if(undefined!=TextPr.AscLine)return false;if(undefined!=TextPr.AscUnifill)return false;if(undefined!=TextPr.AscFill)return false;return true};CTextPr.prototype.IsEqual=function(oTextPr){return this.Is_Equal(oTextPr)};CTextPr.prototype.Is_Empty= function(){if(undefined!==this.Bold||undefined!==this.Italic||undefined!==this.Strikeout||undefined!==this.Underline||undefined!==this.FontFamily||undefined!==this.FontSize||undefined!==this.Color||undefined!==this.VertAlign||undefined!==this.HighLight||undefined!==this.RStyle||undefined!==this.Spacing||undefined!==this.DStrikeout||undefined!==this.Caps||undefined!==this.SmallCaps||undefined!==this.Position||true!==this.RFonts.Is_Empty()||undefined!==this.BoldCS||undefined!==this.ItalicCS||undefined!== this.FontSizeCS||undefined!==this.CS||undefined!==this.RTL||true!==this.Lang.Is_Empty()||undefined!==this.Unifill||undefined!==this.FontRef||undefined!==this.Shd||undefined!==this.Vanish||undefined!==this.TextOutline||undefined!==this.TextFill||undefined!==this.HighlightColor)return false;return true};CTextPr.prototype.GetDiff=function(oTextPr){var oResultTextPr=new CTextPr;if(this.Bold!==oTextPr.Bold)oResultTextPr.Bold=this.Bold;if(this.Italic!==oTextPr.Italic)oResultTextPr.Italic=this.Italic;if(this.Strikeout!== oTextPr.Strikeout)oResultTextPr.Strikeout=this.Strikeout;if(this.Underline!==oTextPr.Underline)oResultTextPr.Underline=this.Underline;if(undefined!==this.FontSize&&!IsEqualNullableFloatNumbers(this.FontSize,oTextPr.FontSize))oResultTextPr.FontSize=this.FontSize;if(undefined!==this.Color&&!this.Color.IsEqual(oTextPr.Color))oResultTextPr.Color=this.Color.Copy();if(this.VertAlign!==oTextPr.VertAlign)oResultTextPr.VertAlign=this.VertAlign;if(undefined===this.HighLight)oResultTextPr.HighLight=undefined; else if(highlight_None===this.HighLight){if(highlight_None!==oTextPr.HighLight)oResultTextPr.HighLight=highlight_None}else if(!this.HighLight.IsEqual(oTextPr.HighLight))oResultTextPr.HighLight=this.HighLight.Copy();if(this.RStyle!==oTextPr.RStyle)oResultTextPr.RStyle=this.RStyle;if(undefined!==this.Spacing&&!IsEqualNullableFloatNumbers(this.Spacing,oTextPr.Spacing))oResultTextPr.Spacing=this.Spacing;if(this.DStrikeout!==oTextPr.DStrikeout)oResultTextPr.DStrikeout=this.DStrikeout;if(this.Caps!==oTextPr.Caps)oResultTextPr.Caps= this.Caps;if(this.SmallCaps!==oTextPr.SmallCaps)oResultTextPr.SmallCaps=this.SmallCaps;if(undefined!==this.Position&&!IsEqualNullableFloatNumbers(this.Position,oTextPr.Position))oResultTextPr.Position=this.Position;if(!this.RFonts.IsEqual(oTextPr.RFonts))oResultTextPr.RFonts=this.RFonts.Copy();if(this.BoldCS!==oTextPr.BoldCS)oResultTextPr.BoldCS=this.BoldCS;if(this.ItalicCS!==oTextPr.ItalicCS)oResultTextPr.ItalicCS=this.ItalicCS;if(undefined!==this.FontSizeCS&&!IsEqualNullableFloatNumbers(this.FontSizeCS, oTextPr.FontSizeCS))oResultTextPr.FontSizeCS=this.FontSizeCS;if(this.CS!==oTextPr.CS)oResultTextPr.CS=this.CS;if(this.RTL!==oTextPr.RTL)oResultTextPr.RTL=this.RTL;if(!this.Lang.IsEqual(oTextPr.Lang))oResultTextPr.Lang=this.Lang.Copy();if(this.Unifill&&!this.Unifill.IsIdentical(oTextPr.Unifill))oResultTextPr.Unifill=this.Unifill.createDuplicate();if(this.TextOutline&&!this.TextOutline.IsIdentical(oTextPr.TextOutline))oResultTextPr.TextOutline=this.TextOutline.createDuplicate();if(this.TextFill&&!this.TextFill.IsIdentical(oTextPr.TextFill))oResultTextPr.TextFill= this.TextFill.createDuplicate();if(this.HighlightColor&&!this.HighlightColor.IsIdentical(oTextPr.HighlightColor))oResultTextPr.HighlightColor=this.HighlightColor.createDuplicate();if(this.Vanish!==oTextPr.Vanish)oResultTextPr.Vanish=this.Vanish;if(this.Shd&&!this.Shd.IsEqual(oTextPr.Shd))oResultTextPr.Shd=this.Shd.Copy();return oResultTextPr};CTextPr.prototype.GetBold=function(){return this.Bold};CTextPr.prototype.SetBold=function(isBold){this.Bold=isBold};CTextPr.prototype.GetItalic=function(){return this.Italic}; CTextPr.prototype.SetItalic=function(isItalic){this.Italic=isItalic};CTextPr.prototype.GetStrikeout=function(){return this.Strikeout};CTextPr.prototype.SetStrikeout=function(isStrikeout){this.Strikeout=isStrikeout};CTextPr.prototype.GetUnderline=function(){return this.Underline};CTextPr.prototype.SetUnderline=function(isUnderling){this.Underline=isUnderling};CTextPr.prototype.GetColor=function(){return this.Color};CTextPr.prototype.SetColor=function(nR,nG,nB,isAuto){if(undefined===nR)this.Color=undefined; else this.Color=new CDocumentColor(nR,nG,nB,isAuto)};CTextPr.prototype.GetAscColor=function(){if(this.Unifill&&this.Unifill.fill&&this.Unifill.fill.type===Asc.c_oAscFill.FILL_TYPE_SOLID&&this.Unifill.fill.color)return AscCommon.CreateAscColor(this.Unifill.fill.color);else if(this.Color)return AscCommon.CreateAscColorCustom(this.Color.r,this.Color.g,this.Color.b,this.Color.Auto);return undefined};CTextPr.prototype.SetAscColor=function(oAscColor){if(!oAscColor){this.Color=undefined;this.Unifill=undefined}else if(true=== oAscColor.Auto){this.Color=new CDocumentColor(0,0,0,true);this.Unifill=undefined}else{this.Color=undefined;this.Unifill=new AscFormat.CUniFill;this.Unifill.fill=new AscFormat.CSolidFill;this.Unifill.fill.color=AscFormat.CorrectUniColor(oAscColor,this.Unifill.fill.color,1);var oLogicDocument=editor&&editor.private_GetLogicDocument()?editor.private_GetLogicDocument():null;if(oLogicDocument)this.Unifill.check(oLogicDocument.GetTheme(),oLogicDocument.GetColorMap())}};CTextPr.prototype.SetUnifill=function(oUnifill){this.Unifill= oUnifill};CTextPr.prototype.FillFromExcelFont=function(oFont){if(!oFont)return;var nSchemeFont=oFont.getScheme();switch(nSchemeFont){case Asc.EFontScheme.fontschemeMajor:{this.RFonts.Merge({Ascii:{Name:"+mj-lt",Index:-1},EastAsia:{Name:"+mj-ea",Index:-1},CS:{Name:"+mj-cs",Index:-1}});break}case Asc.EFontScheme.fontschemeMinor:{this.RFonts.Merge({Ascii:{Name:"+mn-lt",Index:-1},EastAsia:{Name:"+mn-ea",Index:-1},CS:{Name:"+mn-cs",Index:-1}});break}case Asc.EFontScheme.fontschemeNone:{this.RFonts.Set_All(oFont.getName(), -1);break}}this.SetFontSize(oFont.getSize());this.SetBold(oFont.getBold());this.SetItalic(oFont.getItalic());this.SetUnderline(oFont.getUnderline());var oColor=oFont.getColor();this.SetUnifill(AscFormat.CreateSolidFillRGBA(oColor.getR(),oColor.getG(),oColor.getB(),255))};CTextPr.prototype.GetVertAlign=function(){return this.VertAlign};CTextPr.prototype.SetVertAlign=function(nVertAlign){this.VertAlign=nVertAlign};CTextPr.prototype.GetHighlight=function(){return this.HighLight};CTextPr.prototype.SetHighlight= function(nHighlight){this.HighLight=nHighlight};CTextPr.prototype.GetSpacing=function(){return this.Spacing};CTextPr.prototype.SetSpacing=function(nSpacing){this.Spacing=nSpacing};CTextPr.prototype.GetDStrikeout=function(){return this.DStrikeout};CTextPr.prototype.SetDStrikeout=function(isDStrikeout){this.DStrikeout=isDStrikeout};CTextPr.prototype.GetCaps=function(){return this.Caps};CTextPr.prototype.SetCaps=function(isCaps){this.Caps=isCaps};CTextPr.prototype.GetSmallCaps=function(){return this.SmallCaps}; CTextPr.prototype.SetSmallCaps=function(isSmallCaps){this.SmallCaps=isSmallCaps};CTextPr.prototype.GetPosition=function(){return this.Position};CTextPr.prototype.SetPosition=function(nPosition){this.Position=nPosition};CTextPr.prototype.GetFontFamily=function(){if(this.RFonts&&this.RFonts.Ascii&&this.RFonts.Ascii.Name)return this.RFonts.Ascii.Name;return undefined};CTextPr.prototype.SetFontFamily=function(sFontName){if(!this.RFonts)this.RFonts=new CRFonts;this.RFonts.SetAll(sFontName)};CTextPr.prototype.GetFontSize= function(){return this.FontSize};CTextPr.prototype.SetFontSize=function(nFontSize){this.FontSize=nFontSize};CTextPr.prototype.GetLang=function(){if(this.Lang)return this.Lang.Val;return undefined};CTextPr.prototype.SetLang=function(nLang){if(!this.Lang)this.Lang=new CLang;this.Lang.Val=nLang};CTextPr.prototype.GetShd=function(){return this.Shd};CTextPr.prototype.SetShd=function(nType,nR,nG,nB){if(!this.Shd)this.Shd=new CDocumentShd;this.Shd.Value=nType;if(Asc.c_oAscShdNil===nType)return;this.Shd.Color.Set(nR, nG,nB)};CTextPr.prototype.WriteToBinary=function(oWriter){return this.Write_ToBinary(oWriter)};CTextPr.prototype.ReadFromBinary=function(oReader){return this.Read_FromBinary(oReader)};CTextPr.prototype.GetAllFontNames=function(arrAllFonts){return this.Document_Get_AllFontNames(arrAllFonts)};CTextPr.prototype.HavePrChange=function(){if(undefined===this.PrChange||null===this.PrChange)return false;return true};CTextPr.prototype.AddPrChange=function(){this.PrChange=this.Copy();this.ReviewInfo=new CReviewInfo; this.ReviewInfo.Update()};CTextPr.prototype.SetPrChange=function(PrChange,ReviewInfo){this.PrChange=PrChange;this.ReviewInfo=ReviewInfo};CTextPr.prototype.RemovePrChange=function(){delete this.PrChange;delete this.ReviewInfo};CTextPr.prototype.GetDiffPrChange=function(){var TextPr=new CTextPr;if(false===this.HavePrChange())return TextPr;var PrChange=this.PrChange;if(this.Bold!==PrChange.Bold)TextPr.Bold=this.Bold;if(this.Italic!==PrChange.Italic)TextPr.Italic=this.Italic;if(this.Strikeout!==PrChange.Strikeout)TextPr.Strikeout= this.Strikeout;if(this.Underline!==PrChange.Underline)TextPr.Underline=this.Underline;if(undefined!==this.FontFamily&&(undefined===PrChange.FontFamily||this.FontFamily.Name!==PrChange.FontFamily.Name))TextPr.FontFamily={Name:this.FontFamily.Name,Index:-1};if(undefined!==this.FontSize&&(undefined===PrChange.FontSize||Math.abs(this.FontSize-PrChange.FontSize)>=.001))TextPr.FontSize=this.FontSize;if(undefined!==this.Color&&(undefined===PrChange.Color||true!==this.Color.Compare(PrChange.Color)))TextPr.Color= this.Color.Copy();if(this.VertAlign!==PrChange.VertAlign)TextPr.VertAlign=this.VertAlign;if(highlight_None===this.HighLight){if(highlight_None!==PrChange.HighLight)TextPr.HighLight=highlight_None}else if(undefined!==this.HighLight)if(undefined===PrChange.HighLight||highlight_None===PrChange.HighLight||true!==this.HighLight.Compare(PrChange.HighLight))TextPr.HighLight=this.HighLight.Copy();if(this.RStyle!==PrChange.RStyle)TextPr.RStyle=this.RStyle;if(undefined!==this.Spacing&&(undefined===PrChange.Spacing|| Math.abs(this.Spacing-PrChange.Spacing)>=.001))TextPr.Spacing=this.Spacing;if(this.DStrikeout!==PrChange.DStrikeout)TextPr.DStrikeout=this.DStrikeout;if(this.Caps!==PrChange.Caps)TextPr.Caps=this.Caps;if(this.SmallCaps!==PrChange.SmallCaps)TextPr.SmallCaps=this.SmallCaps;if(undefined!==this.Position&&(undefined===PrChange.Position||Math.abs(this.Position-PrChange.Position)>=.001))TextPr.Position=this.Position;if(undefined!==this.RFonts&&(undefined===PrChange.RFonts||true!==this.RFonts.Is_Equal(TextPr.RFonts)))TextPr.RFonts= this.RFonts.Copy();if(this.BoldCS!==PrChange.BoldCS)TextPr.BoldCS=this.BoldCS;if(this.ItalicCS!==PrChange.ItalicCS)TextPr.ItalicCS=this.ItalicCS;if(undefined!==this.FontSizeCS&&(undefined===PrChange.FontSizeCS||Math.abs(this.FontSizeCS-PrChange.FontSizeCS)>=.001))TextPr.FontSizeCS=this.FontSizeCS;if(this.CS!==PrChange.CS)TextPr.CS=this.CS;if(this.RTL!==PrChange.RTL)TextPr.RTL=this.RTL;if(undefined!==this.Lang&&(undefined===PrChange.Lang||true!==this.Lang.Is_Equal(PrChange.Lang)))TextPr.Lang=this.Lang.Copy(); if(undefined!==this.Unifill&&(undefined===PrChange.Unifill||true!==this.Unifill.IsIdentical(PrChange.Unifill)))TextPr.Unifill=this.Unifill.createDuplicate();if(undefined!==this.TextOutline&&(undefined===PrChange.TextOutline||true!==this.TextOutline.IsIdentical(PrChange.TextOutline)))TextPr.TextOutline=this.TextOutline.createDuplicate();if(undefined!==this.TextFill&&(undefined===PrChange.TextFill||true!==this.TextFill.IsIdentical(PrChange.TextFill)))TextPr.TextFill=this.TextFill.createDuplicate(); if(undefined!==this.HighlightColor&&(undefined===PrChange.HighlightColor||true!==this.HighlightColor.IsIdentical(PrChange.HighlightColor)))TextPr.HighlightColor=this.HighlightColor.createDuplicate();if(this.Vanish!==PrChange.Vanish)TextPr.Vanish=this.Vanish;return TextPr};CTextPr.prototype.GetDescription=function(){var Description="Text formatting: ";if(undefined!==this.Bold)Description+=this.Bold?"Bold; ":"No Bold; ";if(undefined!==this.Italic)Description+=this.Italic?"Italic; ":"No Italic; ";if(undefined!== this.Strikeout)Description+=this.Strikeout?"Strikeout; ":"No Strikeout; ";if(undefined!==this.DStrikeout)Description+=this.DStrikeout?"Double Strikeout; ":"No Double Strikeout; ";if(undefined!==this.FontSize)Description+=this.FontSize+"FontSize; ";return Description};CTextPr.prototype["get_Bold"]=CTextPr.prototype.get_Bold=CTextPr.prototype["Get_Bold"]=CTextPr.prototype.GetBold;CTextPr.prototype["put_Bold"]=CTextPr.prototype.put_Bold=CTextPr.prototype.SetBold;CTextPr.prototype["get_Italic"]=CTextPr.prototype.get_Italic= CTextPr.prototype["Get_Italic"]=CTextPr.prototype.GetItalic;CTextPr.prototype["put_Italic"]=CTextPr.prototype.put_Italic=CTextPr.prototype.SetItalic;CTextPr.prototype["get_Strikeout"]=CTextPr.prototype.get_Strikeout=CTextPr.prototype["Get_Strikeout"]=CTextPr.prototype.GetStrikeout;CTextPr.prototype["put_Strikeout"]=CTextPr.prototype.put_Strikeout=CTextPr.prototype.SetStrikeout;CTextPr.prototype["get_Underline"]=CTextPr.prototype.get_Underline=CTextPr.prototype["Get_Underline"]=CTextPr.prototype.GetUnderline; CTextPr.prototype["put_Underline"]=CTextPr.prototype.put_Underline=CTextPr.prototype.SetUnderline;CTextPr.prototype["get_Color"]=CTextPr.prototype.get_Color=CTextPr.prototype["Get_Color"]=CTextPr.prototype.GetAscColor;CTextPr.prototype["put_Color"]=CTextPr.prototype.put_Color=CTextPr.prototype.SetAscColor;CTextPr.prototype["get_VertAlign"]=CTextPr.prototype.get_VertAlign=CTextPr.prototype["Get_VertAlign"]=CTextPr.prototype.GetVertAlign;CTextPr.prototype["put_VertAlign"]=CTextPr.prototype.put_VertAlign= CTextPr.prototype.SetVertAlign;CTextPr.prototype["get_Highlight"]=CTextPr.prototype.get_Highlight=CTextPr.prototype["Get_Highlight"]=CTextPr.prototype.GetHighlight;CTextPr.prototype["put_Highlight"]=CTextPr.prototype.put_Highlight=CTextPr.prototype.SetHighlight;CTextPr.prototype["get_Spacing"]=CTextPr.prototype.get_Spacing=CTextPr.prototype["Get_Spacing"]=CTextPr.prototype.GetSpacing;CTextPr.prototype["put_Spacing"]=CTextPr.prototype.put_Spacing=CTextPr.prototype.SetSpacing;CTextPr.prototype["get_DStrikeout"]= CTextPr.prototype.get_DStrikeout=CTextPr.prototype["Get_DStrikeout"]=CTextPr.prototype.GetDStrikeout;CTextPr.prototype["put_DStrikeout"]=CTextPr.prototype.put_DStrikeout=CTextPr.prototype.SetDStrikeout;CTextPr.prototype["get_Caps"]=CTextPr.prototype.get_Caps=CTextPr.prototype["Get_Caps"]=CTextPr.prototype.GetCaps;CTextPr.prototype["put_Caps"]=CTextPr.prototype.put_Caps=CTextPr.prototype.SetCaps;CTextPr.prototype["get_SmallCaps"]=CTextPr.prototype.get_SmallCaps=CTextPr.prototype["Get_SmallCaps"]=CTextPr.prototype.GetSmallCaps; CTextPr.prototype["put_SmallCaps"]=CTextPr.prototype.put_SmallCaps=CTextPr.prototype.SetSmallCaps;CTextPr.prototype["get_Position"]=CTextPr.prototype.get_Position=CTextPr.prototype["Get_Position"]=CTextPr.prototype.GetPosition;CTextPr.prototype["put_Position"]=CTextPr.prototype.put_Position=CTextPr.prototype.SetPosition;CTextPr.prototype["get_FontFamily"]=CTextPr.prototype.get_FontFamily=CTextPr.prototype["Get_FontFamily"]=CTextPr.prototype.GetFontFamily;CTextPr.prototype["put_FontFamily"]=CTextPr.prototype.put_FontFamily= CTextPr.prototype.SetFontFamily;CTextPr.prototype["get_FontSize"]=CTextPr.prototype.get_FontSize=CTextPr.prototype["Get_FontSize"]=CTextPr.prototype.GetFontSize;CTextPr.prototype["put_FontSize"]=CTextPr.prototype.put_FontSize=CTextPr.prototype.SetFontSize;CTextPr.prototype["get_Lang"]=CTextPr.prototype.get_Lang=CTextPr.prototype["Get_Lang"]=CTextPr.prototype.GetLang;CTextPr.prototype["put_Lang"]=CTextPr.prototype.put_Lang=CTextPr.prototype.SetLang;CTextPr.prototype["get_Shd"]=CTextPr.prototype.get_Shd= CTextPr.prototype["Get_Shd"]=CTextPr.prototype.GetShd;CTextPr.prototype["put_Shd"]=CTextPr.prototype.put_Shd=CTextPr.prototype.SetShd;function CParaTab(Value,Pos,Leader){this.Value=Value;this.Pos=Pos;this.Leader=undefined!==Leader?Leader:Asc.c_oAscTabLeader.None}CParaTab.prototype.Copy=function(){return new CParaTab(this.Value,this.Pos,this.Leader)};CParaTab.prototype.Is_Equal=function(Tab){return this.IsEqual(Tab)};CParaTab.prototype.IsEqual=function(Tab){if(this.Value!==Tab.Value||this.Pos!==Tab.Pos)return false; return true};CParaTab.prototype.IsRightTab=function(){return this.Value===tab_Right};CParaTab.prototype.IsLeftTab=function(){return this.Value===tab_Left};CParaTab.prototype.IsCenterTab=function(){return this.Value===tab_Center};CParaTab.prototype.GetLeader=function(){return this.Leader};function CParaTabs(){this.Tabs=[]}CParaTabs.prototype.Add=function(_Tab){var Index=0;for(Index=0;Index<this.Tabs.length;Index++){var Tab=this.Tabs[Index];if(Math.abs(Tab.Pos-_Tab.Pos)<.001){this.Tabs.splice(Index, 1,_Tab);break}if(Tab.Pos>_Tab.Pos)break}if(-1!=Index)this.Tabs.splice(Index,0,_Tab)};CParaTabs.prototype.Merge=function(Tabs){var _Tabs=Tabs.Tabs;for(var Index=0;Index<_Tabs.length;Index++){var _Tab=_Tabs[Index];var Index2=0;var Flag=0;for(Index2=0;Index2<this.Tabs.length;Index2++){var Tab=this.Tabs[Index2];if(Math.abs(Tab.Pos-_Tab.Pos)<.001){if(tab_Clear===_Tab.Value)Flag=-2;else if(Tab.Value!==_Tab.Value||Tab.Leader!==_Tab.Leader)Flag=-3;else Flag=-1;break}if(Tab.Pos>_Tab.Pos)break}if(-2===Flag)this.Tabs.splice(Index2, 1);else if(-3===Flag)this.Tabs.splice(Index2,1,_Tab);else if(-1!=Flag)this.Tabs.splice(Index2,0,_Tab)}};CParaTabs.prototype.IsEqual=function(Tabs){if(this.Tabs.length!==Tabs.Tabs.length)return false;for(var CurTab=0,TabsCount=this.Tabs.length;CurTab<TabsCount;CurTab++)if(true!==this.Tabs[CurTab].IsEqual(Tabs.Tabs[CurTab]))return false;return true};CParaTabs.prototype.Is_Equal=function(Tabs){return this.IsEqual(Tabs)};CParaTabs.prototype.Copy=function(){var Tabs=new CParaTabs;var Count=this.Tabs.length; for(var Index=0;Index<Count;Index++)Tabs.Add(this.Tabs[Index].Copy());return Tabs};CParaTabs.prototype.Set_FromObject=function(Tabs){if(Tabs instanceof Array)for(var nIndex=0,nCount=Tabs.length;nIndex<nCount;++nIndex)this.Add(new CParaTab(Tabs[nIndex].Value,Tabs[nIndex].Pos,Tabs[nIndex].Leader))};CParaTabs.prototype.GetCount=function(){return this.Tabs.length};CParaTabs.prototype.Get_Count=function(){return this.GetCount()};CParaTabs.prototype.Get=function(Index){return this.Tabs[Index]};CParaTabs.prototype.Get_Value= function(Pos){var Count=this.Tabs.length;for(var Index=0;Index<Count;Index++){var Tab=this.Tabs[Index];if(Math.abs(Tab.Pos-Pos)<.001)return Tab.Value}return-1};CParaTabs.prototype.Write_ToBinary=function(Writer){var Count=this.Tabs.length;Writer.WriteLong(Count);for(var Index=0;Index<Count;Index++){Writer.WriteByte(this.Tabs[Index].Value);Writer.WriteDouble(this.Tabs[Index].Pos);Writer.WriteLong(this.Tabs[Index].Leader)}};CParaTabs.prototype.Read_FromBinary=function(Reader){var Count=Reader.GetLong(); this.Tabs=[];for(var Index=0;Index<Count;Index++){var Value=Reader.GetByte();var Pos=Reader.GetDouble();var Leader=Reader.GetLong();this.Add(new CParaTab(Value,Pos,Leader))}};function CParaInd(){this.Left=undefined;this.Right=undefined;this.FirstLine=undefined}CParaInd.prototype={Copy:function(){var Ind=new CParaInd;Ind.Left=this.Left;Ind.Right=this.Right;Ind.FirstLine=this.FirstLine;return Ind},Merge:function(Ind){if(undefined!=Ind.Left)this.Left=Ind.Left;if(undefined!=Ind.Right)this.Right=Ind.Right; if(undefined!=Ind.FirstLine)this.FirstLine=Ind.FirstLine},Is_Equal:function(Ind){return this.IsEqual(Ind)},Set_FromObject:function(Ind){if(undefined!=Ind.Left)this.Left=Ind.Left;else this.Left=undefined;if(undefined!=Ind.Right)this.Right=Ind.Right;else this.Right=undefined;if(undefined!=Ind.FirstLine)this.FirstLine=Ind.FirstLine;else this.FirstLine=undefined},Write_ToBinary:function(Writer){var StartPos=Writer.GetCurPosition();Writer.Skip(4);var Flags=0;if(undefined!=this.Left){Writer.WriteDouble(this.Left); Flags|=1}if(undefined!=this.Right){Writer.WriteDouble(this.Right);Flags|=2}if(undefined!=this.FirstLine){Writer.WriteDouble(this.FirstLine);Flags|=4}var EndPos=Writer.GetCurPosition();Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)},Read_FromBinary:function(Reader){var Flags=Reader.GetLong();if(Flags&1)this.Left=Reader.GetDouble();if(Flags&2)this.Right=Reader.GetDouble();if(Flags&4)this.FirstLine=Reader.GetDouble()}};CParaInd.prototype.Is_Empty=function(){if(undefined!==this.Left|| undefined!==this.Right||undefined!==this.FirstLine)return false;return true};CParaInd.prototype.Get_Diff=function(Ind){var DiffInd=new CParaInd;if(this.Left!==Ind.Left)DiffInd.Left=this.Left;if(this.Left!==Ind.Right)DiffInd.Right=this.Right;if(this.FirstLine!==Ind.FirstLine)DiffInd.FirstLine=this.FirstLine;return DiffInd};CParaInd.prototype.IsEqual=function(oInd){return IsEqualNullableFloatNumbers(this.Left,oInd.Left)&&IsEqualNullableFloatNumbers(this.Right,oInd.Right)&&IsEqualNullableFloatNumbers(this.FirstLine, oInd.FirstLine)};function CParaSpacing(){this.Line=undefined;this.LineRule=undefined;this.Before=undefined;this.BeforePct=undefined;this.BeforeAutoSpacing=undefined;this.After=undefined;this.AfterPct=undefined;this.AfterAutoSpacing=undefined}CParaSpacing.prototype={Copy:function(){var Spacing=new CParaSpacing;Spacing.Line=this.Line;Spacing.LineRule=this.LineRule;Spacing.Before=this.Before;Spacing.BeforeAutoSpacing=this.BeforeAutoSpacing;Spacing.After=this.After;Spacing.AfterAutoSpacing=this.AfterAutoSpacing; Spacing.BeforePct=this.BeforePct;Spacing.AfterPct=this.AfterPct;return Spacing},Merge:function(Spacing){if(undefined!=Spacing.Line)this.Line=Spacing.Line;if(undefined!=Spacing.LineRule)this.LineRule=Spacing.LineRule;if(undefined!=Spacing.Before)this.Before=Spacing.Before;if(undefined!=Spacing.BeforeAutoSpacing)this.BeforeAutoSpacing=Spacing.BeforeAutoSpacing;if(undefined!=Spacing.After)this.After=Spacing.After;if(undefined!=Spacing.AfterAutoSpacing)this.AfterAutoSpacing=Spacing.AfterAutoSpacing;if(undefined!= Spacing.BeforePct)this.BeforePct=Spacing.BeforePct;if(undefined!=Spacing.AfterPct)this.AfterPct=Spacing.AfterPct},Is_Equal:function(Spacing){return this.IsEqual(Spacing)},Set_FromObject:function(Spacing){this.Line=Spacing.Line;this.LineRule=Spacing.LineRule;this.Before=Spacing.Before;this.BeforeAutoSpacing=Spacing.BeforeAutoSpacing;this.After=Spacing.After;this.AfterAutoSpacing=Spacing.AfterAutoSpacing;this.BeforePct=Spacing.BeforePct;this.AfterPct=Spacing.AfterPct},Write_ToBinary:function(Writer){var StartPos= Writer.GetCurPosition();Writer.Skip(4);var Flags=0;if(undefined!=this.Line){Writer.WriteDouble(this.Line);Flags|=1}if(undefined!=this.LineRule){Writer.WriteByte(this.LineRule);Flags|=2}if(undefined!=this.Before){Writer.WriteDouble(this.Before);Flags|=4}if(undefined!=this.After){Writer.WriteDouble(this.After);Flags|=8}if(undefined!=this.AfterAutoSpacing){Writer.WriteBool(this.AfterAutoSpacing);Flags|=16}if(undefined!=this.BeforeAutoSpacing){Writer.WriteBool(this.BeforeAutoSpacing);Flags|=32}if(undefined!= this.BeforePct){Writer.WriteLong(this.BeforePct);Flags|=64}if(undefined!=this.AfterPct){Writer.WriteLong(this.AfterPct);Flags|=128}var EndPos=Writer.GetCurPosition();Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)},Read_FromBinary:function(Reader){var Flags=Reader.GetLong();if(Flags&1)this.Line=Reader.GetDouble();if(Flags&2)this.LineRule=Reader.GetByte();if(Flags&4)this.Before=Reader.GetDouble();if(Flags&8)this.After=Reader.GetDouble();if(Flags&16)this.AfterAutoSpacing=Reader.GetBool(); if(Flags&32)this.BeforeAutoSpacing=Reader.GetBool();if(Flags&64)this.BeforePct=Reader.GetLong();if(Flags&128)this.AfterPct=Reader.GetLong()}};CParaSpacing.prototype.Get_Diff=function(Spacing){var DiffSpacing=new CParaSpacing;if(this.Line!==Spacing.Line)DiffSpacing.Line=this.Line;if(this.LineRule!==Spacing.LineRule)DiffSpacing.LineRule=this.LineRule;if(this.Before!==Spacing.Before)DiffSpacing.Before=this.Before;if(this.BeforeAutoSpacing!==Spacing.BeforeAutoSpacing)DiffSpacing.BeforeAutoSpacing=this.BeforeAutoSpacing; if(this.After!==Spacing.After)DiffSpacing.After=this.After;if(this.AfterAutoSpacing!==Spacing.AfterAutoSpacing)DiffSpacing.AfterAutoSpacing=this.AfterAutoSpacing;if(this.BeforePct!==Spacing.BeforePct)DiffSpacing.BeforePct=this.BeforePct;if(this.AfterPct!==Spacing.AfterPct)DiffSpacing.AfterPct=this.AfterPct;return DiffSpacing};CParaSpacing.prototype.Is_Empty=function(){if(undefined!==this.Line||undefined!==this.LineRule||undefined!==this.Before||undefined!==this.BeforeAutoSpacing||undefined!==this.After|| undefined!==this.AfterAutoSpacing||undefined!==this.BeforePct||undefined!==this.AfterPct)return false;return true};CParaSpacing.prototype.IsEqual=function(oSpacing){return this.Line===oSpacing.Line&&this.LineRule===oSpacing.LineRule&&IsEqualNullableFloatNumbers(this.Before,oSpacing.Before)&&IsEqualNullableFloatNumbers(this.After,oSpacing.After)&&IsEqualNullableFloatNumbers(this.AfterPct,oSpacing.AfterPct)&&IsEqualNullableFloatNumbers(this.BeforePct,oSpacing.BeforePct)&&this.BeforeAutoSpacing===oSpacing.BeforeAutoSpacing&& this.AfterAutoSpacing===oSpacing.AfterAutoSpacing};function CNumPr(sNumId,nLvl){this.NumId=undefined!==sNumId?sNumId:"-1";this.Lvl=undefined!==nLvl?nLvl:0}CNumPr.prototype={Merge:function(NumPr){if(undefined!=NumPr.NumId)this.NumId=NumPr.NumId;if(undefined!=NumPr.Lvl)this.Lvl=NumPr.Lvl},Is_Equal:function(NumPr){return this.IsEqual(NumPr)},Set:function(NumId,Lvl){this.NumId=NumId;this.Lvl=Lvl},Set_FromObject:function(NumPr){this.NumId=NumPr.NumId;this.Lvl=NumPr.Lvl},Write_ToBinary:function(Writer){if(undefined=== this.NumId)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteString2(this.NumId)}if(undefined===this.Lvl)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteByte(this.Lvl)}},Read_FromBinary:function(Reader){if(true===Reader.GetBool())this.NumId=undefined;else this.NumId=Reader.GetString2();if(true===Reader.GetBool())this.Lvl=undefined;else this.Lvl=Reader.GetByte()}};CNumPr.prototype.Copy=function(){var oNumPr=new CNumPr;oNumPr.NumId=this.NumId;oNumPr.Lvl=this.Lvl;return oNumPr}; CNumPr.prototype.IsValid=function(){if(undefined===this.NumId||null===this.NumId||0===this.NumId||"0"===this.NumId)return false;return true};CNumPr.prototype.IsEqual=function(oNumPr){if(!oNumPr||this.NumId!==oNumPr.NumId)return false;if(0===this.NumId)return true;return this.NumId===oNumPr.NumId&&this.Lvl===oNumPr.Lvl};var wrap_Around=1;var wrap_Auto=2;var wrap_None=3;var wrap_NotBeside=4;var wrap_Through=5;var wrap_Tight=6;function CFramePr(){this.DropCap=undefined;this.H=undefined;this.HAnchor= undefined;this.HRule=undefined;this.HSpace=undefined;this.Lines=undefined;this.VAnchor=undefined;this.VSpace=undefined;this.W=undefined;this.Wrap=undefined;this.X=undefined;this.XAlign=undefined;this.Y=undefined;this.YAlign=undefined}CFramePr.prototype={Copy:function(){var FramePr=new CFramePr;FramePr.DropCap=this.DropCap;FramePr.H=this.H;FramePr.HAnchor=this.HAnchor;FramePr.HRule=this.HRule;FramePr.HSpace=this.HSpace;FramePr.Lines=this.Lines;FramePr.VAnchor=this.VAnchor;FramePr.VSpace=this.VSpace; FramePr.W=this.W;FramePr.Wrap=this.Wrap;FramePr.X=this.X;FramePr.XAlign=this.XAlign;FramePr.Y=this.Y;FramePr.YAlign=this.YAlign;return FramePr},Set_FromObject:function(FramePr){this.DropCap=FramePr.DropCap;this.H=FramePr.H;this.HAnchor=FramePr.HAnchor;this.HRule=FramePr.HRule;this.HSpace=FramePr.HSpace;this.Lines=FramePr.Lines;this.VAnchor=FramePr.VAnchor;this.VSpace=FramePr.VSpace;this.W=FramePr.W;this.Wrap=FramePr.Wrap;this.X=FramePr.X;this.XAlign=FramePr.XAlign;this.Y=FramePr.Y;this.YAlign=FramePr.YAlign}, Write_ToBinary:function(Writer){var StartPos=Writer.GetCurPosition();Writer.Skip(4);var Flags=0;if(undefined!=this.DropCap){Writer.WriteLong(this.DropCap);Flags|=1}if(undefined!=this.H){Writer.WriteDouble(this.H);Flags|=2}if(undefined!=this.HAnchor){Writer.WriteLong(this.HAnchor);Flags|=4}if(undefined!=this.HRule){Writer.WriteLong(this.HRule);Flags|=8}if(undefined!=this.HSpace){Writer.WriteDouble(this.HSpace);Flags|=16}if(undefined!=this.Lines){Writer.WriteLong(this.Lines);Flags|=32}if(undefined!= this.VAnchor){Writer.WriteLong(this.VAnchor);Flags|=64}if(undefined!=this.VSpace){Writer.WriteDouble(this.VSpace);Flags|=128}if(undefined!=this.W){Writer.WriteDouble(this.W);Flags|=256}if(undefined!=this.X){Writer.WriteDouble(this.X);Flags|=512}if(undefined!=this.XAlign){Writer.WriteLong(this.XAlign);Flags|=1024}if(undefined!=this.Y){Writer.WriteDouble(this.Y);Flags|=2048}if(undefined!=this.YAlign){Writer.WriteLong(this.YAlign);Flags|=4096}if(undefined!==this.Wrap){Writer.WriteLong(this.Wrap);Flags|= 8192}var EndPos=Writer.GetCurPosition();Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)},Read_FromBinary:function(Reader){var Flags=Reader.GetLong();if(Flags&1)this.DropCap=Reader.GetLong();if(Flags&2)this.H=Reader.GetDouble();if(Flags&4)this.HAnchor=Reader.GetLong();if(Flags&8)this.HRule=Reader.GetLong();if(Flags&16)this.HSpace=Reader.GetDouble();if(Flags&32)this.Lines=Reader.GetLong();if(Flags&64)this.VAnchor=Reader.GetLong();if(Flags&128)this.VSpace=Reader.GetDouble();if(Flags& 256)this.W=Reader.GetDouble();if(Flags&512)this.X=Reader.GetDouble();if(Flags&1024)this.XAlign=Reader.GetLong();if(Flags&2048)this.Y=Reader.GetDouble();if(Flags&4096)this.YAlign=Reader.GetLong();if(Flags&8192)this.Wrap=Reader.GetLong()},Init_Default_DropCap:function(bInside){this.DropCap=true===bInside?c_oAscDropCap.Drop:c_oAscDropCap.Margin;this.Lines=3;this.Wrap=wrap_Around;this.VAnchor=Asc.c_oAscVAnchor.Text;this.HAnchor=true===bInside?Asc.c_oAscHAnchor.Text:Asc.c_oAscHAnchor.Page;this.X=undefined; this.XAlign=undefined;this.Y=undefined;this.YAlign=undefined;this.H=undefined;this.W=undefined;this.HRule=undefined},Get_W:function(){return this.W},Get_H:function(){return this.H},Is_DropCap:function(){if(c_oAscDropCap.Margin===this.DropCap||c_oAscDropCap.Drop===this.DropCap)return true;return false}};CFramePr.prototype.GetW=function(){return this.W};CFramePr.prototype.IsEqual=function(oFramePr){if(!oFramePr)return false;return this.DropCap===oFramePr.DropCap&&IsEqualNullableFloatNumbers(this.H, oFramePr.H)&&this.HAnchor===oFramePr.HAnchor&&this.HRule===oFramePr.HRule&&this.HSpace===oFramePr.HSpace&&this.Lines===oFramePr.Lines&&this.VAnchor===oFramePr.VAnchor&&this.VSpace===oFramePr.VSpace&&IsEqualNullableFloatNumbers(this.W,oFramePr.W)&&this.Wrap===oFramePr.Wrap&&IsEqualNullableFloatNumbers(this.X,oFramePr.X)&&this.XAlign===oFramePr.XAlign&&IsEqualNullableFloatNumbers(this.Y,oFramePr.Y)&&this.YAlign===oFramePr.YAlign};CFramePr.prototype.Compare=function(FramePr){return this.IsEqual(FramePr)}; CFramePr.prototype.Is_Equal=function(FramePr){return this.IsEqual(FramePr)};CFramePr.prototype.Merge=function(oFramePr){if(null!==oFramePr.DropCap&&undefined!==oFramePr.DropCap)this.DropCap=oFramePr.DropCap;if(null!==oFramePr.H&&undefined!==oFramePr.H){if(null===oFramePr.HRule||undefined===oFramePr.HRule)this.HRule=undefined;this.H=oFramePr.H}if(null!==oFramePr.HAnchor&&undefined!==oFramePr.HAnchor)this.HAnchor=oFramePr.HAnchor;if(null!==oFramePr.HRule&&undefined!==oFramePr.HRule){if(null===oFramePr.H|| undefined===oFramePr.H)this.H=undefined;this.HRule=oFramePr.HRule}if(null!==oFramePr.HSpace&&undefined!==oFramePr.HSpace)this.HSpace=oFramePr.HSpace;if(null!==oFramePr.Lines&&undefined!==oFramePr.Lines)this.Lines=oFramePr.Lines;if(null!==oFramePr.VAnchor&&undefined!==oFramePr.VAnchor)this.VAnchor=oFramePr.VAnchor;if(null!==oFramePr.VSpace&&undefined!==oFramePr.VSpace)this.VSpace=oFramePr.VSpace;if(null!==oFramePr.W&&undefined!==oFramePr.W)this.W=oFramePr.W;if(null!==oFramePr.Wrap&&undefined!==oFramePr.Wrap)this.Wrap= oFramePr.Wrap;if(null!==oFramePr.X&&undefined!==oFramePr.X){if(null===oFramePr.XAlign||undefined===oFramePr.XAlign)this.XAlign=undefined;this.X=oFramePr.X}if(null!==oFramePr.XAlign&&undefined!==oFramePr.XAlign){if(null===oFramePr.X||undefined===oFramePr.X)this.X=undefined;this.XAlign=oFramePr.XAlign}if(null!==oFramePr.Y&&undefined!==oFramePr.Y){if(null===oFramePr.YAlign||undefined===oFramePr.YAlign)this.YAlign=undefined;this.Y=oFramePr.Y}if(null!==oFramePr.YAlign&&undefined!==oFramePr.YAlign){if(null=== oFramePr.Y||undefined===oFramePr.Y)this.Y=undefined;this.YAlign=oFramePr.YAlign}};function CCalculatedFrame(FramePr,L,T,W,H,L2,T2,W2,H2,PageIndex,Index,FlowCount){this.FramePr=FramePr;this.L=undefined!==L?L:0;this.T=undefined!==T?T:0;this.W=undefined!==W?W:0;this.H=undefined!==H?H:0;this.L2=undefined!==L2?L2:0;this.T2=undefined!==T2?T2:0;this.W2=undefined!==W2?W2:0;this.H2=undefined!==H2?H2:0;this.PageIndex=undefined!==PageIndex?PageIndex:0;this.StartIndex=undefined!==Index?Index:0;this.FlowCount= undefined!==FlowCount?FlowCount:0;this.Paragraphs=[]}CCalculatedFrame.prototype.AddParagraph=function(oPara){this.Paragraphs.push(oPara)};CCalculatedFrame.prototype.GetParagraphs=function(){return this.Paragraphs};CCalculatedFrame.prototype.GetFramePr=function(){return this.FramePr};function CParaPr(){this.ContextualSpacing=undefined;this.Ind=new CParaInd;this.Jc=undefined;this.KeepLines=undefined;this.KeepNext=undefined;this.PageBreakBefore=undefined;this.Spacing=new CParaSpacing;this.Shd=undefined; this.Brd={First:undefined,Last:undefined,Between:undefined,Bottom:undefined,Left:undefined,Right:undefined,Top:undefined};this.WidowControl=undefined;this.Tabs=undefined;this.NumPr=undefined;this.PStyle=undefined;this.FramePr=undefined;this.OutlineLvl=undefined;this.DefaultRunPr=undefined;this.Bullet=undefined;this.Lvl=undefined;this.DefaultTab=undefined;this.LnSpcReduction=undefined;this.PrChange=undefined;this.ReviewInfo=undefined;this.SuppressLineNumbers=undefined}CParaPr.prototype.Copy=function(bCopyPrChange, oPr){var ParaPr=new CParaPr;ParaPr.ContextualSpacing=this.ContextualSpacing;if(undefined!=this.Ind)ParaPr.Ind=this.Ind.Copy();ParaPr.Jc=this.Jc;ParaPr.KeepLines=this.KeepLines;ParaPr.KeepNext=this.KeepNext;ParaPr.PageBreakBefore=this.PageBreakBefore;if(undefined!=this.Spacing)ParaPr.Spacing=this.Spacing.Copy();if(undefined!=this.Shd)ParaPr.Shd=this.Shd.Copy();ParaPr.Brd.First=this.Brd.First;ParaPr.Brd.Last=this.Brd.Last;if(undefined!=this.Brd.Between)ParaPr.Brd.Between=this.Brd.Between.Copy();if(undefined!= this.Brd.Bottom)ParaPr.Brd.Bottom=this.Brd.Bottom.Copy();if(undefined!=this.Brd.Left)ParaPr.Brd.Left=this.Brd.Left.Copy();if(undefined!=this.Brd.Right)ParaPr.Brd.Right=this.Brd.Right.Copy();if(undefined!=this.Brd.Top)ParaPr.Brd.Top=this.Brd.Top.Copy();ParaPr.WidowControl=this.WidowControl;if(undefined!=this.Tabs)ParaPr.Tabs=this.Tabs.Copy();if(undefined!=this.NumPr){ParaPr.NumPr=this.NumPr.Copy();if(oPr&&oPr.Comparison)ParaPr.NumPr.NumId=oPr.Comparison.getCopyNumId(ParaPr.NumPr.NumId)}if(undefined!= this.PStyle){ParaPr.PStyle=this.PStyle;if(oPr&&oPr.Comparison)ParaPr.PStyle=oPr.Comparison.copyStyleById(ParaPr.PStyle)}if(undefined!=this.FramePr)ParaPr.FramePr=this.FramePr.Copy();else ParaPr.FramePr=undefined;if(undefined!=this.DefaultRunPr)ParaPr.DefaultRunPr=this.DefaultRunPr.Copy();if(undefined!=this.Bullet)ParaPr.Bullet=this.Bullet.createDuplicate();if(undefined!=this.Lvl)ParaPr.Lvl=this.Lvl;if(undefined!=this.DefaultTab)ParaPr.DefaultTab=this.DefaultTab;if(undefined!=this.LnSpcReduction)ParaPr.LnSpcReduction= this.LnSpcReduction;if(true===bCopyPrChange&&undefined!==this.PrChange){ParaPr.PrChange=this.PrChange.Copy();ParaPr.ReviewInfo=this.ReviewInfo.Copy()}if(undefined!==this.OutlineLvl)ParaPr.OutlineLvl=this.OutlineLvl;if(undefined!==this.OutlineLvlStyle)ParaPr.OutlineLvlStyle=this.OutlineLvlStyle;if(undefined!==this.Locked)ParaPr.Locked=this.Locked;if(undefined!==this.SuppressLineNumbers)ParaPr.SuppressLineNumbers=this.SuppressLineNumbers;return ParaPr};CParaPr.prototype.Merge=function(ParaPr){if(undefined!= ParaPr.ContextualSpacing)this.ContextualSpacing=ParaPr.ContextualSpacing;if(undefined!=ParaPr.Ind)this.Ind.Merge(ParaPr.Ind);if(undefined!=ParaPr.Jc)this.Jc=ParaPr.Jc;if(undefined!=ParaPr.KeepLines)this.KeepLines=ParaPr.KeepLines;if(undefined!=ParaPr.KeepNext)this.KeepNext=ParaPr.KeepNext;if(undefined!=ParaPr.PageBreakBefore)this.PageBreakBefore=ParaPr.PageBreakBefore;if(undefined!=ParaPr.Spacing)this.Spacing.Merge(ParaPr.Spacing);if(undefined!=ParaPr.Shd&&(!this.Shd||!ParaPr.Shd.IsNil()))this.Shd= ParaPr.Shd.Copy();if(undefined!=ParaPr.Brd.First)this.Brd.First=ParaPr.Brd.First;if(undefined!=ParaPr.Brd.Last)this.Brd.Last=ParaPr.Brd.Last;if(undefined!=ParaPr.Brd.Between)this.Brd.Between=ParaPr.Brd.Between.Copy();if(undefined!=ParaPr.Brd.Bottom)this.Brd.Bottom=ParaPr.Brd.Bottom.Copy();if(undefined!=ParaPr.Brd.Left)this.Brd.Left=ParaPr.Brd.Left.Copy();if(undefined!=ParaPr.Brd.Right)this.Brd.Right=ParaPr.Brd.Right.Copy();if(undefined!=ParaPr.Brd.Top)this.Brd.Top=ParaPr.Brd.Top.Copy();if(undefined!= ParaPr.WidowControl)this.WidowControl=ParaPr.WidowControl;if(undefined!=ParaPr.Tabs)if(undefined===this.Tabs)this.Tabs=ParaPr.Tabs.Copy();else this.Tabs.Merge(ParaPr.Tabs);if(undefined!=ParaPr.NumPr){if(undefined===this.NumPr)this.NumPr=ParaPr.NumPr.Copy();else this.NumPr.Merge(ParaPr.NumPr);if(undefined!=this.NumPr&&this.NumPr.Lvl>8)this.NumPr=undefined}if(undefined!=ParaPr.PStyle)this.PStyle=ParaPr.PStyle;if(null!==ParaPr.FramePr&&undefined!==ParaPr.FramePr)if(!this.FramePr)this.FramePr=ParaPr.FramePr.Copy(); else this.FramePr.Merge(ParaPr.FramePr);if(undefined!=ParaPr.DefaultRunPr){if(undefined==this.DefaultRunPr)this.DefaultRunPr=new CTextPr;this.DefaultRunPr.Merge(ParaPr.DefaultRunPr)}if(undefined!=ParaPr.Bullet)if(ParaPr.Bullet.isBullet()){if(!this.Bullet)this.Bullet=new AscFormat.CBullet;var PrBullet=ParaPr.Bullet;if(PrBullet.bulletColor)this.Bullet.bulletColor=PrBullet.bulletColor.createDuplicate();if(PrBullet.bulletSize)this.Bullet.bulletSize=PrBullet.bulletSize.createDuplicate();if(PrBullet.bulletTypeface)this.Bullet.bulletTypeface= PrBullet.bulletTypeface.createDuplicate();if(PrBullet.bulletType)this.Bullet.bulletType=PrBullet.bulletType.createDuplicate();this.Bullet.Bullet=PrBullet.Bullet}else if(this.Bullet&&this.Bullet.isBullet()){if(ParaPr.Bullet.bulletColor)this.Bullet.bulletColor=ParaPr.Bullet.bulletColor.createDuplicate();if(ParaPr.Bullet.bulletSize)this.Bullet.bulletSize=ParaPr.Bullet.bulletSize.createDuplicate();if(ParaPr.Bullet.bulletTypeface)this.Bullet.bulletTypeface=ParaPr.Bullet.bulletTypeface.createDuplicate()}if(undefined!= ParaPr.Lvl)this.Lvl=ParaPr.Lvl;if(undefined!=ParaPr.DefaultTab)this.DefaultTab=ParaPr.DefaultTab;if(undefined!=ParaPr.LnSpcReduction)this.LnSpcReduction=ParaPr.LnSpcReduction;if(undefined!==ParaPr.OutlineLvl)this.OutlineLvl=ParaPr.OutlineLvl;if(undefined!==ParaPr.SuppressLineNumbers)this.SuppressLineNumbers=ParaPr.SuppressLineNumbers};CParaPr.prototype.InitDefault=function(nCompatibilityMode){this.ContextualSpacing=false;this.Ind=new CParaInd;this.Ind.Left=0;this.Ind.Right=0;this.Ind.FirstLine=0; this.Jc=align_Left;this.KeepLines=false;this.KeepNext=false;this.PageBreakBefore=false;this.Spacing=new CParaSpacing;this.Spacing.Line=1;this.Spacing.LineRule=linerule_Auto;this.Spacing.Before=0;this.Spacing.BeforeAutoSpacing=false;this.Spacing.After=0;this.Spacing.AfterAutoSpacing=false;this.Shd=new CDocumentShd;this.Brd.First=true;this.Brd.Last=true;this.Brd.Between=new CDocumentBorder;this.Brd.Bottom=new CDocumentBorder;this.Brd.Left=new CDocumentBorder;this.Brd.Right=new CDocumentBorder;this.Brd.Top= new CDocumentBorder;this.WidowControl=true;this.Tabs=new CParaTabs;this.NumPr=undefined;this.PStyle=undefined;this.FramePr=undefined;this.OutlineLvl=undefined;this.SuppressLineNumbers=false;this.DefaultRunPr=undefined;this.Bullet=undefined;this.DefaultTab=undefined;this.LnSpcReduction=undefined;this.PrChange=undefined;this.ReviewInfo=undefined};CParaPr.prototype.Set_FromObject=function(ParaPr){this.ContextualSpacing=ParaPr.ContextualSpacing;this.Ind=new CParaInd;if(undefined!=ParaPr.Ind)this.Ind.Set_FromObject(ParaPr.Ind); this.Jc=ParaPr.Jc;this.KeepLines=ParaPr.KeepLines;this.KeepNext=ParaPr.KeepNext;this.PageBreakBefore=ParaPr.PageBreakBefore;this.Spacing=new CParaSpacing;if(undefined!=ParaPr.Spacing)this.Spacing.Set_FromObject(ParaPr.Spacing);if(undefined!=ParaPr.Shd){this.Shd=new CDocumentShd;this.Shd.Set_FromObject(ParaPr.Shd)}else this.Shd=undefined;if(undefined!=ParaPr.Brd){if(undefined!=ParaPr.Brd.Between){this.Brd.Between=new CDocumentBorder;this.Brd.Between.Set_FromObject(ParaPr.Brd.Between)}else this.Brd.Between= undefined;if(undefined!=ParaPr.Brd.Bottom){this.Brd.Bottom=new CDocumentBorder;this.Brd.Bottom.Set_FromObject(ParaPr.Brd.Bottom)}else this.Brd.Bottom=undefined;if(undefined!=ParaPr.Brd.Left){this.Brd.Left=new CDocumentBorder;this.Brd.Left.Set_FromObject(ParaPr.Brd.Left)}else this.Brd.Left=undefined;if(undefined!=ParaPr.Brd.Right){this.Brd.Right=new CDocumentBorder;this.Brd.Right.Set_FromObject(ParaPr.Brd.Right)}else this.Brd.Right=undefined;if(undefined!=ParaPr.Brd.Top){this.Brd.Top=new CDocumentBorder; this.Brd.Top.Set_FromObject(ParaPr.Brd.Top)}else this.Brd.Top=undefined}else{this.Brd.Between=undefined;this.Brd.Bottom=undefined;this.Brd.Left=undefined;this.Brd.Right=undefined;this.Brd.Top=undefined}this.WidowControl=ParaPr.WidowControl;if(undefined!=ParaPr.Tabs){this.Tabs=new CParaTabs;this.Tabs.Set_FromObject(ParaPr.Tabs.Tabs)}else this.Tabs=undefined;if(undefined!=ParaPr.NumPr){this.NumPr=new CNumPr;this.NumPr.Set_FromObject(ParaPr.NumPr)}else this.NumPr=undefined;if(undefined!=ParaPr.FramePr){this.FramePr= new CFramePr;this.FramePr.Set_FromObject(ParaPr.FramePr)}else this.FramePr=undefined;if(undefined!=ParaPr.DefaultRunPr){this.DefaultRunPr=new CTextPr;this.DefaultRunPr.Set_FromObject(ParaPr.DefaultRunPr)}if(undefined!=ParaPr.Bullet){this.Bullet=new AscFormat.CBullet;this.Bullet.Set_FromObject(ParaPr.Bullet)}if(undefined!=ParaPr.DefaultTab)this.DefaultTab=ParaPr.DefaultTab;if(undefined!==ParaPr.OutlineLvl)this.OutlineLvl=ParaPr.OutlineLvl;if(undefined!==ParaPr.SuppressLineNumbers)this.SuppressLineNumbers= ParaPr.SuppressLineNumbers};CParaPr.prototype.Compare=function(ParaPr){var Result_ParaPr=new CParaPr;Result_ParaPr.Locked=false;if(ParaPr.ContextualSpacing===this.ContextualSpacing)Result_ParaPr.ContextualSpacing=ParaPr.ContextualSpacing;Result_ParaPr.Ind=new CParaInd;if(undefined!=ParaPr.Ind&&undefined!=this.Ind){if(undefined!=ParaPr.Ind.Left&&undefined!=this.Ind.Left&&Math.abs(ParaPr.Ind.Left-this.Ind.Left)<.001)Result_ParaPr.Ind.Left=ParaPr.Ind.Left;if(undefined!=ParaPr.Ind.Right&&undefined!=this.Ind.Right&& Math.abs(ParaPr.Ind.Right-this.Ind.Right)<.001)Result_ParaPr.Ind.Right=ParaPr.Ind.Right;if(undefined!=ParaPr.Ind.FirstLine&&undefined!=this.Ind.FirstLine&&Math.abs(ParaPr.Ind.FirstLine-this.Ind.FirstLine)<.001)Result_ParaPr.Ind.FirstLine=ParaPr.Ind.FirstLine}if(ParaPr.Jc===this.Jc)Result_ParaPr.Jc=ParaPr.Jc;if(ParaPr.KeepLines===this.KeepLines)Result_ParaPr.KeepLines=ParaPr.KeepLines;if(ParaPr.KeepNext===this.KeepNext)Result_ParaPr.KeepNext=ParaPr.KeepNext;if(ParaPr.PageBreakBefore===this.PageBreakBefore)Result_ParaPr.PageBreakBefore= ParaPr.PageBreakBefore;Result_ParaPr.Spacing=new CParaSpacing;if(undefined!=this.Spacing&&undefined!=ParaPr.Spacing){if(undefined!=this.Spacing.After&&undefined!=ParaPr.Spacing.After&&Math.abs(this.Spacing.After-ParaPr.Spacing.After)<.001)Result_ParaPr.Spacing.After=ParaPr.Spacing.After;if(this.Spacing.AfterAutoSpacing===ParaPr.Spacing.AfterAutoSpacing)Result_ParaPr.Spacing.AfterAutoSpacing=ParaPr.Spacing.AfterAutoSpacing;if(undefined!=this.Spacing.Before&&undefined!=ParaPr.Spacing.Before&&Math.abs(this.Spacing.Before- ParaPr.Spacing.Before)<.001)Result_ParaPr.Spacing.Before=ParaPr.Spacing.Before;if(this.Spacing.BeforeAutoSpacing===ParaPr.Spacing.BeforeAutoSpacing)Result_ParaPr.Spacing.BeforeAutoSpacing=ParaPr.Spacing.BeforeAutoSpacing;if(undefined!=this.Spacing.Line&&undefined!=ParaPr.Spacing.Line&&Math.abs(this.Spacing.Line-ParaPr.Spacing.Line)<.001)Result_ParaPr.Spacing.Line=ParaPr.Spacing.Line;if(this.Spacing.LineRule===ParaPr.Spacing.LineRule)Result_ParaPr.Spacing.LineRule=ParaPr.Spacing.LineRule}if(undefined!= this.Shd&&undefined!=ParaPr.Shd&&true===this.Shd.Compare(ParaPr.Shd))Result_ParaPr.Shd=ParaPr.Shd.Copy();if(undefined!=this.Brd.Between&&undefined!=ParaPr.Brd.Between&&true===this.Brd.Between.Compare(ParaPr.Brd.Between))Result_ParaPr.Brd.Between=ParaPr.Brd.Between.Copy();if(undefined!=this.Brd.Bottom&&undefined!=ParaPr.Brd.Bottom&&true===this.Brd.Bottom.Compare(ParaPr.Brd.Bottom))Result_ParaPr.Brd.Bottom=ParaPr.Brd.Bottom.Copy();if(undefined!=this.Brd.Left&&undefined!=ParaPr.Brd.Left&&true===this.Brd.Left.Compare(ParaPr.Brd.Left))Result_ParaPr.Brd.Left= ParaPr.Brd.Left.Copy();if(undefined!=this.Brd.Right&&undefined!=ParaPr.Brd.Right&&true===this.Brd.Right.Compare(ParaPr.Brd.Right))Result_ParaPr.Brd.Right=ParaPr.Brd.Right.Copy();if(undefined!=this.Brd.Top&&undefined!=ParaPr.Brd.Top&&true===this.Brd.Top.Compare(ParaPr.Brd.Top))Result_ParaPr.Brd.Top=ParaPr.Brd.Top.Copy();if(ParaPr.WidowControl===this.WidowControl)Result_ParaPr.WidowControl=ParaPr.WidowControl;if(undefined!=this.PStyle&&undefined!=ParaPr.PStyle&&this.PStyle===ParaPr.PStyle)Result_ParaPr.PStyle= ParaPr.PStyle;if(undefined!=this.NumPr&&undefined!=ParaPr.NumPr&&this.NumPr.NumId===ParaPr.NumPr.NumId){Result_ParaPr.NumPr=new CParaPr;Result_ParaPr.NumPr.NumId=ParaPr.NumPr.NumId;Result_ParaPr.NumPr.Lvl=Math.max(this.NumPr.Lvl,ParaPr.NumPr.Lvl)}if(undefined!=this.Locked&&undefined!=ParaPr.Locked)if(this.Locked!=ParaPr.Locked)Result_ParaPr.Locked=true;else Result_ParaPr.Locked=ParaPr.Locked;if(undefined!=this.FramePr&&undefined!=ParaPr.FramePr&&true===this.FramePr.Compare(ParaPr.FramePr))Result_ParaPr.FramePr= this.FramePr;if(undefined!=this.Bullet&&undefined!=ParaPr.Bullet)Result_ParaPr.Bullet=AscFormat.CompareBullets(ParaPr.Bullet,this.Bullet);if(undefined!=this.DefaultRunPr&&undefined!=ParaPr.DefaultRunPr)Result_ParaPr.DefaultRunPr=this.DefaultRunPr.Compare(ParaPr.DefaultRunPr);if(undefined!=this.Lvl&&undefined!=ParaPr.Lvl&&ParaPr.Lvl===this.Lvl)Result_ParaPr.Lvl=this.Lvl;if(undefined!=this.DefaultTab&&undefined!=ParaPr.DefaultTab&&ParaPr.DefaultTab===this.DefaultTab)Result_ParaPr.DefaultTab=this.DefaultTab; if(undefined!==this.Tabs&&undefined!==ParaPr.Tabs&&this.Tabs.Is_Equal(ParaPr.Tabs))Result_ParaPr.Tabs=this.Tabs.Copy();if(this.OutlineLvl===ParaPr.OutlineLvl)Result_ParaPr.OutlineLvl=this.OutlineLvl;if(this.OutlineLvlStyle||ParaPr.OutlineLvlStyle)Result_ParaPr.OutlineLvlStyle=true;if(this.SuppressLineNumbers===ParaPr.SuppressLineNumbers)Result_ParaPr.SuppressLineNumbers=this.SuppressLineNumbers;return Result_ParaPr};CParaPr.prototype.Write_ToBinary=function(Writer){var StartPos=Writer.GetCurPosition(); Writer.Skip(4);var Flags=0;if(undefined!=this.ContextualSpacing){Writer.WriteBool(this.ContextualSpacing);Flags|=1}if(undefined!=this.Ind){this.Ind.Write_ToBinary(Writer);Flags|=2}if(undefined!=this.Jc){Writer.WriteByte(this.Jc);Flags|=4}if(undefined!=this.KeepLines){Writer.WriteBool(this.KeepLines);Flags|=8}if(undefined!=this.KeepNext){Writer.WriteBool(this.KeepNext);Flags|=16}if(undefined!=this.PageBreakBefore){Writer.WriteBool(this.PageBreakBefore);Flags|=32}if(undefined!=this.Spacing){this.Spacing.Write_ToBinary(Writer); Flags|=64}if(undefined!=this.Shd){this.Shd.Write_ToBinary(Writer);Flags|=128}if(undefined!=this.Brd.Between){this.Brd.Between.Write_ToBinary(Writer);Flags|=256}if(undefined!=this.Brd.Bottom){this.Brd.Bottom.Write_ToBinary(Writer);Flags|=512}if(undefined!=this.Brd.Left){this.Brd.Left.Write_ToBinary(Writer);Flags|=1024}if(undefined!=this.Brd.Right){this.Brd.Right.Write_ToBinary(Writer);Flags|=2048}if(undefined!=this.Brd.Top){this.Brd.Top.Write_ToBinary(Writer);Flags|=4096}if(undefined!=this.WidowControl){Writer.WriteBool(this.WidowControl); Flags|=8192}if(undefined!=this.Tabs){this.Tabs.Write_ToBinary(Writer);Flags|=16384}if(undefined!=this.NumPr){this.NumPr.Write_ToBinary(Writer);Flags|=32768}if(undefined!=this.PStyle){Writer.WriteString2(this.PStyle);Flags|=65536}if(undefined!=this.FramePr){this.FramePr.Write_ToBinary(Writer);Flags|=131072}if(undefined!=this.DefaultRunPr){this.DefaultRunPr.Write_ToBinary(Writer);Flags|=262144}if(undefined!=this.Bullet){this.Bullet.Write_ToBinary(Writer);Flags|=524288}if(undefined!=this.Lvl){Writer.WriteByte(this.Lvl); Flags|=1048576}if(undefined!=this.DefaultTab){Writer.WriteDouble(this.DefaultTab);Flags|=2097152}if(undefined!==this.OutlineLvl){Writer.WriteByte(this.OutlineLvl);Flags|=4194304}if(undefined!==this.PrChange){this.PrChange.WriteToBinary(Writer);this.ReviewInfo.WriteToBinary(Writer);Flags|=8388608}if(undefined!==this.SuppressLineNumbers){Writer.WriteBool(this.SuppressLineNumbers);Flags|=16777216}var EndPos=Writer.GetCurPosition();Writer.Seek(StartPos);Writer.WriteLong(Flags);Writer.Seek(EndPos)};CParaPr.prototype.Read_FromBinary= function(Reader){var Flags=Reader.GetLong();if(Flags&1)this.ContextualSpacing=Reader.GetBool();if(Flags&2){this.Ind=new CParaInd;this.Ind.Read_FromBinary(Reader)}if(Flags&4)this.Jc=Reader.GetByte();if(Flags&8)this.KeepLines=Reader.GetBool();if(Flags&16)this.KeepNext=Reader.GetBool();if(Flags&32)this.PageBreakBefore=Reader.GetBool();if(Flags&64){this.Spacing=new CParaSpacing;this.Spacing.Read_FromBinary(Reader)}if(Flags&128){this.Shd=new CDocumentShd;this.Shd.Read_FromBinary(Reader)}if(Flags&256){this.Brd.Between= new CDocumentBorder;this.Brd.Between.Read_FromBinary(Reader)}if(Flags&512){this.Brd.Bottom=new CDocumentBorder;this.Brd.Bottom.Read_FromBinary(Reader)}if(Flags&1024){this.Brd.Left=new CDocumentBorder;this.Brd.Left.Read_FromBinary(Reader)}if(Flags&2048){this.Brd.Right=new CDocumentBorder;this.Brd.Right.Read_FromBinary(Reader)}if(Flags&4096){this.Brd.Top=new CDocumentBorder;this.Brd.Top.Read_FromBinary(Reader)}if(Flags&8192)this.WidowControl=Reader.GetBool();if(Flags&16384){this.Tabs=new CParaTabs; this.Tabs.Read_FromBinary(Reader)}if(Flags&32768){this.NumPr=new CNumPr;this.NumPr.Read_FromBinary(Reader)}if(Flags&65536)this.PStyle=Reader.GetString2();if(Flags&131072){this.FramePr=new CFramePr;this.FramePr.Read_FromBinary(Reader)}if(Flags&262144){this.DefaultRunPr=new CTextPr;this.DefaultRunPr.Read_FromBinary(Reader)}if(Flags&524288){this.Bullet=new AscFormat.CBullet;this.Bullet.Read_FromBinary(Reader)}if(Flags&1048576)this.Lvl=Reader.GetByte();if(Flags&2097152)this.DefaultTab=Reader.GetDouble(); if(Flags&4194304)this.OutlineLvl=Reader.GetByte();if(Flags&8388608){this.PrChange=new CParaPr;this.ReviewInfo=new CReviewInfo;this.PrChange.ReadFromBinary(Reader);this.ReviewInfo.ReadFromBinary(Reader)}if(Flags&16777216)this.SuppressLineNumbers=Reader.GetBool()};CParaPr.prototype.isEqual=function(ParaPrUOld,ParaPrNew){if(ParaPrUOld==undefined||ParaPrNew==undefined)return false;for(var pPr in ParaPrUOld)if(typeof ParaPrUOld[pPr]=="object"){if(!this.isEqual(ParaPrUOld[pPr],ParaPrNew[pPr]))return false}else if(typeof ParaPrUOld[pPr]== "number"&&typeof ParaPrNew[pPr]=="number"){if(Math.abs(ParaPrUOld[pPr]-ParaPrNew[pPr])>.001)return false}else if(ParaPrUOld[pPr]!=ParaPrNew[pPr])return false;return true};CParaPr.prototype.Is_Equal=function(ParaPr){return!(this.ContextualSpacing!==ParaPr.ContextualSpacing||true!==IsEqualStyleObjects(this.Ind,ParaPr.Ind)||this.Jc!==ParaPr.Jc||this.KeepLines!==ParaPr.KeepLines||this.KeepNext!==ParaPr.KeepNext||this.PageBreakBefore!==ParaPr.PageBreakBefore||true!==IsEqualStyleObjects(this.Spacing,ParaPr.Spacing)|| true!==IsEqualStyleObjects(this.Shd,ParaPr.Shd)||true!==IsEqualStyleObjects(this.Brd.Between,ParaPr.Brd.Between)||true!==IsEqualStyleObjects(this.Brd.Bottom,ParaPr.Brd.Bottom)||true!==IsEqualStyleObjects(this.Brd.Left,ParaPr.Brd.Left)||true!==IsEqualStyleObjects(this.Brd.Right,ParaPr.Brd.Right)||true!==IsEqualStyleObjects(this.Brd.Top,ParaPr.Brd.Top)||this.WidowControl!==ParaPr.WidowControl||true!==IsEqualStyleObjects(this.Tabs,ParaPr.Tabs)||true!==IsEqualStyleObjects(this.NumPr,ParaPr.NumPr)||this.PStyle!== ParaPr.PStyle||true!==IsEqualStyleObjects(this.FramePr,ParaPr.FramePr)||this.OutlineLvl!==ParaPr.OutlineLvl||this.SuppressLineNumbers!==ParaPr.SuppressLineNumbers)};CParaPr.prototype.GetDiff=function(oParaPr){var oResultParaPr=new CParaPr;if(this.ContextualSpacing!==oParaPr.ContextualSpacing)oResultParaPr.ContextualSpacing=this.ContextualSpacing;if(!this.Ind.IsEqual(oParaPr.Ind))oResultParaPr.Ind=this.Ind.Copy();if(this.Jc!==oParaPr.Jc)oResultParaPr.Jc=this.Jc;if(this.KeepLines!==oParaPr.KeepLines)oResultParaPr.KeepLines= this.KeepLines;if(this.KeepNext!==oParaPr.KeepNext)oResultParaPr.KeepNext=this.KeepNext;if(this.PageBreakBefore!==oParaPr.PageBreakBefore)oResultParaPr.PageBreakBefore=this.PageBreakBefore;if(!this.Spacing.IsEqual(oParaPr.Spacing))oResultParaPr.Spacing=this.Spacing.Copy();if(this.Shd&&!this.Shd.IsEqual(oParaPr.Shd))oResultParaPr.Shd=this.Shd.Copy();if(this.Brd.Between&&!this.Brd.Between.IsEqual(oParaPr.Brd.Between))oResultParaPr.Brd.Between=this.Brd.Between.Copy();if(this.Brd.Bottom&&!this.Brd.Between.IsEqual(oParaPr.Brd.Bottom))oResultParaPr.Brd.Bottom= this.Brd.Bottom.Copy();if(this.Brd.Left&&!this.Brd.Between.IsEqual(oParaPr.Brd.Left))oResultParaPr.Brd.Left=this.Brd.Left.Copy();if(this.Brd.Right&&!this.Brd.Between.IsEqual(oParaPr.Brd.Right))oResultParaPr.Brd.Right=this.Brd.Right.Copy();if(this.Brd.Top&&!this.Brd.Between.IsEqual(oParaPr.Brd.Top))oResultParaPr.Brd.Top=this.Brd.Top.Copy();if(this.WidowControl!==oParaPr.WidowControl)oResultParaPr.WidowControl=this.WidowControl;if(this.Tabs&&!this.Tabs.IsEqual(oParaPr.Tabs))oResultParaPr.Tabs=this.Tabs.Copy(); if(this.NumPr&&!this.NumPr.IsEqual(oParaPr.NumPr))oResultParaPr.NumPr=this.NumPr.Copy();if(this.PStyle!==oParaPr.PStyle)oResultParaPr.PStyle=this.PStyle;if(this.FramePr&&!this.FramePr.IsEqual(oParaPr.FramePr))oResultParaPr.FramePr=this.FramePr.Copy();if(this.OutlineLvl!==oParaPr.OutlineLvl)oResultParaPr.OutlineLvl=this.OutlineLvl;if(this.DefaultRunPr&&!this.DefaultRunPr.IsEqual(oParaPr.DefaultRunPr))oResultParaPr.DefaultRunPr=this.DefaultRunPr.Copy();if(this.SuppressLineNumbers!==oParaPr.SuppressLineNumbers)oResultParaPr.SuppressLineNumbers= this.SuppressLineNumbers;return oResultParaPr};CParaPr.prototype.Get_PresentationBullet=function(theme,colorMap){var Bullet=new CPresentationBullet;if(this.Bullet&&this.Bullet.isBullet()){switch(this.Bullet.bulletType.type){case AscFormat.BULLET_TYPE_BULLET_CHAR:{Bullet.m_nType=numbering_presentationnumfrmt_Char;if(typeof this.Bullet.bulletType.Char==="string"&&this.Bullet.bulletType.Char.length>0)Bullet.m_sChar=this.Bullet.bulletType.Char.substring(0,1);else Bullet.m_sChar="\u2022";break}case AscFormat.BULLET_TYPE_BULLET_AUTONUM:{Bullet.m_nType= this.Bullet.bulletType.AutoNumType;if(this.Bullet.bulletType.startAt===null)Bullet.m_nStartAt=1;else Bullet.m_nStartAt=this.Bullet.bulletType.startAt;break}case AscFormat.BULLET_TYPE_BULLET_NONE:{break}case AscFormat.BULLET_TYPE_BULLET_BLIP:{Bullet.m_nType=numbering_presentationnumfrmt_Char;Bullet.m_sChar="\u2022";break}}if(this.Bullet.bulletColor){if(this.Bullet.bulletColor.type===AscFormat.BULLET_TYPE_COLOR_NONE){Bullet.m_bColorTx=false;Bullet.m_oColor.a=0}if(this.Bullet.bulletColor.type===AscFormat.BULLET_TYPE_COLOR_CLR)if(this.Bullet.bulletColor.UniColor&& this.Bullet.bulletColor.UniColor.color&&theme&&colorMap){Bullet.m_bColorTx=false;Bullet.Unifill=AscFormat.CreateUniFillByUniColor(this.Bullet.bulletColor.UniColor)}}if(this.Bullet.bulletTypeface)if(this.Bullet.bulletTypeface.type===AscFormat.BULLET_TYPE_TYPEFACE_BUFONT&&this.Bullet.bulletType.type===AscFormat.BULLET_TYPE_BULLET_CHAR){Bullet.m_bFontTx=false;Bullet.m_sFont=this.Bullet.bulletTypeface.typeface}if(this.Bullet.bulletSize)switch(this.Bullet.bulletSize.type){case AscFormat.BULLET_TYPE_SIZE_TX:{Bullet.m_bSizeTx= true;break}case AscFormat.BULLET_TYPE_SIZE_PCT:{Bullet.m_bSizeTx=false;Bullet.m_bSizePct=true;Bullet.m_dSize=this.Bullet.bulletSize.val/1E5;break}case AscFormat.BULLET_TYPE_SIZE_PTS:{Bullet.m_bSizeTx=false;Bullet.m_bSizePct=false;Bullet.m_dSize=this.Bullet.bulletSize.val/100;break}}}return Bullet};CParaPr.prototype.Is_Empty=function(){return!(undefined!==this.ContextualSpacing||true!==this.Ind.Is_Empty()||undefined!==this.Jc||undefined!==this.KeepLines||undefined!==this.KeepNext||undefined!==this.PageBreakBefore|| true!==this.Spacing.Is_Empty()||undefined!==this.Shd||undefined!==this.Brd.First||undefined!==this.Brd.Last||undefined!==this.Brd.Between||undefined!==this.Brd.Bottom||undefined!==this.Brd.Left||undefined!==this.Brd.Right||undefined!==this.Brd.Top||undefined!==this.WidowControl||undefined!==this.Tabs||undefined!==this.NumPr||undefined!==this.PStyle||undefined!==this.OutlineLvl||undefined!==this.SuppressLineNumbers)};CParaPr.prototype.GetDiffPrChange=function(){var ParaPr=new CParaPr;if(false===this.HavePrChange())return ParaPr; var PrChange=this.PrChange;if(this.ContextualSpacing!==PrChange.ContextualSpacing)ParaPr.ContextualSpacing=this.ContextualSpacing;ParaPr.Ind=this.Ind.Get_Diff(PrChange.Ind);if(this.Jc!==PrChange.Jc)ParaPr.Jc=this.Jc;if(this.KeepLines!==PrChange.KeepLines)ParaPr.KeepLines=this.KeepLines;if(this.KeepNext!==PrChange.KeepNext)ParaPr.KeepNext=this.KeepNext;if(this.PageBreakBefore!==PrChange.PageBreakBefore)ParaPr.PageBreakBefore=this.PageBreakBefore;ParaPr.Spacing=this.Spacing.Get_Diff(PrChange.Spacing); if(this.WidowControl!==PrChange.WidowControl)ParaPr.WidowControl=this.WidowControl;if(this.Tabs!==PrChange.Tabs)ParaPr.Tabs=this.Tabs;if(this.NumPr!==PrChange.NumPr)ParaPr.NumPr=this.NumPr;if(this.PStyle!==PrChange.PStyle)ParaPr.PStyle=this.PStyle;return ParaPr};CParaPr.prototype.HavePrChange=function(){if(undefined===this.PrChange||null===this.PrChange)return false;return true};CParaPr.prototype.GetPrChangeNumPr=function(){if(!this.HavePrChange()||!this.PrChange.NumPr)return null;return this.PrChange.NumPr}; CParaPr.prototype.AddPrChange=function(){this.PrChange=this.Copy();this.ReviewInfo=new CReviewInfo;this.ReviewInfo.Update()};CParaPr.prototype.SetPrChange=function(PrChange,ReviewInfo){this.PrChange=PrChange;this.ReviewInfo=ReviewInfo};CParaPr.prototype.RemovePrChange=function(){delete this.PrChange;delete this.ReviewInfo};CParaPr.prototype.GetContextualSpacing=function(){return this.ContextualSpacing};CParaPr.prototype.SetContextualSpacing=function(isContextualSpacing){this.ContextualSpacing=isContextualSpacing}; CParaPr.prototype.GetIndLeft=function(){return this.Ind.Left};CParaPr.prototype.GetIndRight=function(){return this.Ind.Right};CParaPr.prototype.GetIndFirstLine=function(){return this.Ind.FirstLine};CParaPr.prototype.SetInd=function(nFirst,nLeft,nRight){if(undefined!==nFirst)this.Ind.FirstLine=nFirst;if(undefined!==nLeft)this.Ind.Left=nLeft;if(undefined!==nRight)this.Ind.Right=nRight};CParaPr.prototype.GetJc=function(){return this.Jc};CParaPr.prototype.SetJc=function(nAlign){this.Jc=nAlign};CParaPr.prototype.GetKeepLines= function(){return this.KeepLines};CParaPr.prototype.SetKeepLines=function(isKeepLines){this.KeepLines=isKeepLines};CParaPr.prototype.GetKeepNext=function(){return this.KeepNext};CParaPr.prototype.SetKeepNext=function(isKeepNext){this.KeepNext=isKeepNext};CParaPr.prototype.GetPageBreakBefore=function(){return this.PageBreakBefore};CParaPr.prototype.SetPageBreakBefore=function(isPageBreakBefore){this.PageBreakBefore=isPageBreakBefore};CParaPr.prototype.GetSpacingLine=function(){return this.Spacing.Line}; CParaPr.prototype.GetSpacingLineRule=function(){return this.Spacing.LineRule};CParaPr.prototype.GetSpacingBefore=function(){return this.Spacing.Before};CParaPr.prototype.GetSpacingBeforeAutoSpacing=function(){return this.Spacing.BeforeAutoSpacing};CParaPr.prototype.GetSpacingAfter=function(){return this.Spacing.After};CParaPr.prototype.GetSpacingAfterAutoSpacing=function(){return this.Spacing.AfterAutoSpacing};CParaPr.prototype.SetSpacing=function(nLine,nLineRule,nBefore,nAfter,isBeforeAuto,isAfterAuto){if(undefined!== nLine)this.Spacing.Line=nLine;if(undefined!==nLineRule)this.Spacing.LineRule=nLineRule;if(undefined!==nBefore)this.Spacing.Before=nBefore;if(undefined!==nAfter)this.Spacing.After=nAfter;if(undefined!==isBeforeAuto)this.Spacing.BeforeAutoSpacing=isBeforeAuto;if(undefined!==isAfterAuto)this.Spacing.AfterAutoSpacing=isAfterAuto};CParaPr.prototype.GetWidowControl=function(){return this.WidowControl};CParaPr.prototype.SetWidowControl=function(isWidowControl){this.WidowControl=isWidowControl};CParaPr.prototype.GetTabs= function(){return this.Tabs};CParaPr.prototype.GetNumPr=function(){return this.NumPr};CParaPr.prototype.SetNumPr=function(sNumId,nLvl){if(undefined===sNumId)this.NumPr=undefined;else this.NumPr=new CNumPr(sNumId,nLvl)};CParaPr.prototype.GetPStyle=function(){return this.PStyle};CParaPr.prototype.SetPStyle=function(sPStyle){this.PStyle=sPStyle};CParaPr.prototype.GetOutlineLvl=function(){return this.OutlineLvl};CParaPr.prototype.SetOutlineLvl=function(nOutlineLvl){this.OutlineLvl=nOutlineLvl};CParaPr.prototype.GetSuppressLineNumbers= function(){return this.SuppressLineNumbers};CParaPr.prototype.SetSuppressLineNumbers=function(isSuppress){this.SuppressLineNumbers=isSuppress};CParaPr.prototype.WriteToBinary=function(oWriter){return this.Write_ToBinary(oWriter)};CParaPr.prototype.ReadFromBinary=function(oReader){return this.Read_FromBinary(oReader)};CParaPr.prototype.private_CorrectBorderSpace=function(nValue){var dKoef=32*25.4/72;return nValue-Math.floor(nValue/dKoef)*dKoef};CParaPr.prototype.CheckBorderSpaces=function(){if(this.Brd.Top)this.Brd.Top.Space= this.private_CorrectBorderSpace(this.Brd.Top.Space);if(this.Brd.Bottom)this.Brd.Bottom.Space=this.private_CorrectBorderSpace(this.Brd.Bottom.Space);if(this.Brd.Left)this.Brd.Left.Space=this.private_CorrectBorderSpace(this.Brd.Left.Space);if(this.Brd.Right)this.Brd.Right.Space=this.private_CorrectBorderSpace(this.Brd.Right.Space);if(this.Brd.Between)this.Brd.Between.Space=this.private_CorrectBorderSpace(this.Brd.Between.Space)};CParaPr.prototype["get_ContextualSpacing"]=CParaPr.prototype.get_ContextualSpacing= CParaPr.prototype["Get_ContextualSpacing"]=CParaPr.prototype.GetContextualSpacing;CParaPr.prototype["put_ContextualSpacing"]=CParaPr.prototype.put_ContextualSpacing=CParaPr.prototype.SetContextualSpacing;CParaPr.prototype["get_IndLeft"]=CParaPr.prototype.get_IndLeft=CParaPr.prototype["Get_IndLeft"]=CParaPr.prototype.GetIndLeft;CParaPr.prototype["get_IndRight"]=CParaPr.prototype.get_IndRight=CParaPr.prototype["Get_IndRight"]=CParaPr.prototype.GetIndRight;CParaPr.prototype["get_IndFirstLine"]=CParaPr.prototype.get_IndFirstLine= CParaPr.prototype["Get_IndFirstLine"]=CParaPr.prototype.GetIndFirstLine;CParaPr.prototype["put_Ind"]=CParaPr.prototype.put_Ind=CParaPr.prototype.SetInd;CParaPr.prototype["get_Jc"]=CParaPr.prototype.get_Jc=CParaPr.prototype["Get_Jc"]=CParaPr.prototype.GetJc;CParaPr.prototype["put_Jc"]=CParaPr.prototype.put_Jc=CParaPr.prototype.SetJc;CParaPr.prototype["get_KeepLines"]=CParaPr.prototype.get_KeepLines=CParaPr.prototype["Get_KeepLines"]=CParaPr.prototype.GetKeepLines;CParaPr.prototype["put_KeepLines"]= CParaPr.prototype.put_KeepLines=CParaPr.prototype.SetKeepLines;CParaPr.prototype["get_KeepNext"]=CParaPr.prototype.get_KeepNext=CParaPr.prototype["Get_KeepNext"]=CParaPr.prototype.GetKeepNext;CParaPr.prototype["put_KeepNext"]=CParaPr.prototype.put_KeepNext=CParaPr.prototype.SetKeepNext;CParaPr.prototype["get_PageBreakBefore"]=CParaPr.prototype.get_PageBreakBefore=CParaPr.prototype["Get_PageBreakBefore"]=CParaPr.prototype.GetPageBreakBefore;CParaPr.prototype["put_PageBreakBefore"]=CParaPr.prototype.put_PageBreakBefore= CParaPr.prototype.SetPageBreakBefore;CParaPr.prototype["get_SpacingLine"]=CParaPr.prototype.get_SpacingLine=CParaPr.prototype["Get_SpacingLine"]=CParaPr.prototype.GetSpacingLine;CParaPr.prototype["get_SpacingLineRule"]=CParaPr.prototype.get_SpacingLineRule=CParaPr.prototype["Get_SpacingLineRule"]=CParaPr.prototype.GetSpacingLineRule;CParaPr.prototype["get_SpacingBefore"]=CParaPr.prototype.get_SpacingBefore=CParaPr.prototype["Get_SpacingBefore"]=CParaPr.prototype.GetSpacingBefore;CParaPr.prototype["get_SpacingBeforeAutoSpacing"]= CParaPr.prototype.get_SpacingBeforeAutoSpacing=CParaPr.prototype["Get_SpacingBeforeAutoSpacing"]=CParaPr.prototype.GetSpacingBeforeAutoSpacing;CParaPr.prototype["get_SpacingAfter"]=CParaPr.prototype.get_SpacingAfter=CParaPr.prototype["Get_SpacingAfter"]=CParaPr.prototype.GetSpacingAfter;CParaPr.prototype["get_SpacingAfterAutoSpacing"]=CParaPr.prototype.get_SpacingAfterAutoSpacing=CParaPr.prototype["Get_SpacingAfterAutoSpacing"]=CParaPr.prototype.GetSpacingAfterAutoSpacing;CParaPr.prototype["put_Spacing"]= CParaPr.prototype.put_Spacing=CParaPr.prototype.SetSpacing;CParaPr.prototype["get_WidowControl"]=CParaPr.prototype.get_WidowControl=CParaPr.prototype["Get_WidowControl"]=CParaPr.prototype.GetWidowControl;CParaPr.prototype["put_WidowControl"]=CParaPr.prototype.put_WidowControl=CParaPr.prototype.SetWidowControl;CParaPr.prototype["get_Tabs"]=CParaPr.prototype.get_Tabs=CParaPr.prototype["Get_Tabs"]=CParaPr.prototype.GetTabs;CParaPr.prototype["get_NumPr"]=CParaPr.prototype.get_NumPr=CParaPr.prototype["Get_NumPr"]= CParaPr.prototype.GetNumPr;CParaPr.prototype["put_NumPr"]=CParaPr.prototype.put_NumPr=CParaPr.prototype.SetNumPr;CParaPr.prototype["get_PStyle"]=CParaPr.prototype.get_PStyle=CParaPr.prototype["Get_PStyle"]=CParaPr.prototype.GetPStyle;CParaPr.prototype["put_PStyle"]=CParaPr.prototype.put_PStyle=CParaPr.prototype.SetPStyle;CParaPr.prototype["get_OutlineLvl"]=CParaPr.prototype.get_OutlineLvl=CParaPr.prototype["Get_OutlineLvl"]=CParaPr.prototype.GetOutlineLvl;CParaPr.prototype["put_OutlineLvl"]=CParaPr.prototype.put_OutlineLvl= CParaPr.prototype.SetOutlineLvl;CParaPr.prototype["get_SuppressLineNumbers"]=CParaPr.prototype.get_SuppressLineNumbers=CParaPr.prototype["Get_SuppressLineNumbers"]=CParaPr.prototype.GetSuppressLineNumbers;CParaPr.prototype["pet_SuppressLineNumbers"]=CParaPr.prototype.put_SuppressLineNumbers=CParaPr.prototype.SetSuppressLineNumbers;function Copy_Bounds(Bounds){if(undefined===Bounds)return{};var Bounds_new={};Bounds_new.Bottom=Bounds.Bottom;Bounds_new.Left=Bounds.Left;Bounds_new.Right=Bounds.Right; Bounds_new.Top=Bounds.Top;return Bounds_new}function asc_CStyle(){this.Name="";this.BasedOn="";this.Next="";this.Link="";this.Type=styletype_Paragraph;this.TextPr=new CTextPr;this.ParaPr=new CParaPr}asc_CStyle.prototype.get_Name=function(){return this.Name};asc_CStyle.prototype.put_Name=function(sName){this.Name=sName};asc_CStyle.prototype.put_BasedOn=function(Name){this.BasedOn=Name};asc_CStyle.prototype.get_BasedOn=function(){return this.BasedOn};asc_CStyle.prototype.put_Next=function(Name){this.Next= Name};asc_CStyle.prototype.get_Next=function(){return this.Next};asc_CStyle.prototype.put_Type=function(Type){this.Type=Type};asc_CStyle.prototype.get_Type=function(){return this.Type};asc_CStyle.prototype.put_Link=function(LinkStyle){this.Link=LinkStyle};asc_CStyle.prototype.get_Link=function(){return this.Link};asc_CStyle.prototype.fill_ParaPr=function(oPr){this.ParaPr=oPr.Copy()};asc_CStyle.prototype.get_ParaPr=function(){return this.ParaPr};asc_CStyle.prototype.fill_TextPr=function(oPr){this.TextPr= oPr.Copy()};asc_CStyle.prototype.get_TextPr=function(){return this.TextPr};window["Asc"]=window["Asc"]||{};window["AscCommonWord"]=window["AscCommonWord"]||{};window["Asc"]["asc_CStyle"]=window["Asc"].asc_CStyle=asc_CStyle;asc_CStyle.prototype["get_Name"]=asc_CStyle.prototype.get_Name;asc_CStyle.prototype["put_Name"]=asc_CStyle.prototype.put_Name;asc_CStyle.prototype["get_BasedOn"]=asc_CStyle.prototype.get_BasedOn;asc_CStyle.prototype["put_BasedOn"]=asc_CStyle.prototype.put_BasedOn;asc_CStyle.prototype["get_Next"]= asc_CStyle.prototype.get_Next;asc_CStyle.prototype["put_Next"]=asc_CStyle.prototype.put_Next;asc_CStyle.prototype["get_Type"]=asc_CStyle.prototype.get_Type;asc_CStyle.prototype["put_Type"]=asc_CStyle.prototype.put_Type;asc_CStyle.prototype["get_Link"]=asc_CStyle.prototype.get_Link;asc_CStyle.prototype["put_Link"]=asc_CStyle.prototype.put_Link;window["AscCommonWord"].CDocumentColor=CDocumentColor;window["AscCommonWord"].CStyle=CStyle;window["AscCommonWord"].CTextPr=CTextPr;window["AscCommonWord"].CParaPr= CParaPr;window["AscCommonWord"].CParaTabs=CParaTabs;window["AscCommonWord"].CDocumentShd=CDocumentShd;window["AscCommonWord"].g_dKoef_pt_to_mm=g_dKoef_pt_to_mm;window["AscCommonWord"].g_dKoef_pc_to_mm=g_dKoef_pc_to_mm;window["AscCommonWord"].g_dKoef_in_to_mm=g_dKoef_in_to_mm;window["AscCommonWord"].g_dKoef_mm_to_twips=g_dKoef_mm_to_twips;window["AscCommonWord"].g_dKoef_mm_to_pt=g_dKoef_mm_to_pt;window["AscCommonWord"].g_dKoef_mm_to_emu=g_dKoef_mm_to_emu;window["AscCommonWord"].border_Single=border_Single; window["AscCommonWord"].Default_Tab_Stop=Default_Tab_Stop;window["AscCommonWord"].highlight_None=highlight_None;window["AscCommonWord"].spacing_Auto=spacing_Auto;window["AscCommonWord"].wrap_NotBeside=wrap_NotBeside;window["AscCommonWord"].wrap_Around=wrap_Around;var g_oDocumentDefaultTextPr=new CTextPr;var g_oDocumentDefaultParaPr=new CParaPr;var g_oDocumentDefaultTablePr=new CTablePr;var g_oDocumentDefaultTableCellPr=new CTableCellPr;var g_oDocumentDefaultTableRowPr=new CTableRowPr;var g_oDocumentDefaultTableStylePr= new CTableStylePr;g_oDocumentDefaultTextPr.InitDefault();g_oDocumentDefaultParaPr.InitDefault();g_oDocumentDefaultTablePr.InitDefault();g_oDocumentDefaultTableCellPr.InitDefault();g_oDocumentDefaultTableRowPr.InitDefault();g_oDocumentDefaultTableStylePr.InitDefault();"use strict";AscDFH.changesFactory[AscDFH.historyitem_Style_TextPr]=CChangesStyleTextPr;AscDFH.changesFactory[AscDFH.historyitem_Style_ParaPr]=CChangesStyleParaPr;AscDFH.changesFactory[AscDFH.historyitem_Style_TablePr]=CChangesStyleTablePr; AscDFH.changesFactory[AscDFH.historyitem_Style_TableRowPr]=CChangesStyleTableRowPr;AscDFH.changesFactory[AscDFH.historyitem_Style_TableCellPr]=CChangesStyleTableCellPr;AscDFH.changesFactory[AscDFH.historyitem_Style_TableBand1Horz]=CChangesStyleTableBand1Horz;AscDFH.changesFactory[AscDFH.historyitem_Style_TableBand1Vert]=CChangesStyleTableBand1Vert;AscDFH.changesFactory[AscDFH.historyitem_Style_TableBand2Horz]=CChangesStyleTableBand2Horz;AscDFH.changesFactory[AscDFH.historyitem_Style_TableBand2Vert]= CChangesStyleTableBand2Vert;AscDFH.changesFactory[AscDFH.historyitem_Style_TableFirstCol]=CChangesStyleTableFirstCol;AscDFH.changesFactory[AscDFH.historyitem_Style_TableFirstRow]=CChangesStyleTableFirstRow;AscDFH.changesFactory[AscDFH.historyitem_Style_TableLastCol]=CChangesStyleTableLastCol;AscDFH.changesFactory[AscDFH.historyitem_Style_TableLastRow]=CChangesStyleTableLastRow;AscDFH.changesFactory[AscDFH.historyitem_Style_TableTLCell]=CChangesStyleTableTLCell;AscDFH.changesFactory[AscDFH.historyitem_Style_TableTRCell]= CChangesStyleTableTRCell;AscDFH.changesFactory[AscDFH.historyitem_Style_TableBLCell]=CChangesStyleTableBLCell;AscDFH.changesFactory[AscDFH.historyitem_Style_TableBRCell]=CChangesStyleTableBRCell;AscDFH.changesFactory[AscDFH.historyitem_Style_TableWholeTable]=CChangesStyleTableWholeTable;AscDFH.changesFactory[AscDFH.historyitem_Style_Name]=CChangesStyleName;AscDFH.changesFactory[AscDFH.historyitem_Style_BasedOn]=CChangesStyleBasedOn;AscDFH.changesFactory[AscDFH.historyitem_Style_Next]=CChangesStyleNext; AscDFH.changesFactory[AscDFH.historyitem_Style_Type]=CChangesStyleType;AscDFH.changesFactory[AscDFH.historyitem_Style_QFormat]=CChangesStyleQFormat;AscDFH.changesFactory[AscDFH.historyitem_Style_UiPriority]=CChangesStyleUiPriority;AscDFH.changesFactory[AscDFH.historyitem_Style_Hidden]=CChangesStyleHidden;AscDFH.changesFactory[AscDFH.historyitem_Style_SemiHidden]=CChangesStyleSemiHidden;AscDFH.changesFactory[AscDFH.historyitem_Style_UnhideWhenUsed]=CChangesStyleUnhideWhenUsed;AscDFH.changesFactory[AscDFH.historyitem_Style_Link]= CChangesStyleLink;AscDFH.changesFactory[AscDFH.historyitem_Style_Custom]=CChangesStyleCustom;AscDFH.changesFactory[AscDFH.historyitem_Styles_Add]=CChangesStylesAdd;AscDFH.changesFactory[AscDFH.historyitem_Styles_Remove]=CChangesStylesRemove;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultTextPr]=CChangesStylesChangeDefaultTextPr;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultParaPr]=CChangesStylesChangeDefaultParaPr;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultParagraphId]= CChangesStylesChangeDefaultParagraphId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultCharacterId]=CChangesStylesChangeDefaultCharacterId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultNumberingId]=CChangesStylesChangeDefaultNumberingId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultTableId]=CChangesStylesChangeDefaultTableId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultTableGridId]=CChangesStylesChangeDefaultTableGridId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultHeadingsId]= CChangesStylesChangeDefaultHeadingsId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultParaListId]=CChangesStylesChangeDefaultParaListId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultHeaderId]=CChangesStylesChangeDefaultHeaderId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultFooterId]=CChangesStylesChangeDefaultFooterId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultHyperlinkId]=CChangesStylesChangeDefaultHyperlinkId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultFootnoteTextId]= CChangesStylesChangeDefaultFootnoteTextId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultFootnoteTextCharId]=CChangesStylesChangeDefaultFootnoteTextCharId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultFootnoteReferenceId]=CChangesStylesChangeDefaultFootnoteReferenceId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultNoSpacingId]=CChangesStylesChangeDefaultNoSpacingId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultTitleId]=CChangesStylesChangeDefaultTitleId; AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultSubtitleId]=CChangesStylesChangeDefaultSubtitleId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultQuoteId]=CChangesStylesChangeDefaultQuoteId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultIntenseQuoteId]=CChangesStylesChangeDefaultIntenseQuoteId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultCaption]=CChangesStylesChangeDefaultCaption;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultEndnoteTextId]= CChangesStylesChangeDefaultEndnoteTextId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultEndnoteTextCharId]=CChangesStylesChangeDefaultEndnoteTextCharId;AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultEndnoteReferenceId]=CChangesStylesChangeDefaultEndnoteReferenceId;AscDFH.changesRelationMap[AscDFH.historyitem_Style_TextPr]=[AscDFH.historyitem_Style_TextPr];AscDFH.changesRelationMap[AscDFH.historyitem_Style_ParaPr]=[AscDFH.historyitem_Style_ParaPr];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TablePr]= [AscDFH.historyitem_Style_TablePr];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableRowPr]=[AscDFH.historyitem_Style_TableRowPr];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableCellPr]=[AscDFH.historyitem_Style_TableCellPr];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableBand1Horz]=[AscDFH.historyitem_Style_TableBand1Horz];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableBand1Vert]=[AscDFH.historyitem_Style_TableBand1Vert];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableBand2Horz]= [AscDFH.historyitem_Style_TableBand2Horz];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableBand2Vert]=[AscDFH.historyitem_Style_TableBand2Vert];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableFirstCol]=[AscDFH.historyitem_Style_TableFirstCol];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableFirstRow]=[AscDFH.historyitem_Style_TableFirstRow];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableLastCol]=[AscDFH.historyitem_Style_TableLastCol];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableLastRow]= [AscDFH.historyitem_Style_TableLastRow];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableTLCell]=[AscDFH.historyitem_Style_TableTLCell];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableTRCell]=[AscDFH.historyitem_Style_TableTRCell];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableBLCell]=[AscDFH.historyitem_Style_TableBLCell];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableBRCell]=[AscDFH.historyitem_Style_TableBRCell];AscDFH.changesRelationMap[AscDFH.historyitem_Style_TableWholeTable]= [AscDFH.historyitem_Style_TableWholeTable];AscDFH.changesRelationMap[AscDFH.historyitem_Style_Name]=[AscDFH.historyitem_Style_Name];AscDFH.changesRelationMap[AscDFH.historyitem_Style_BasedOn]=[AscDFH.historyitem_Style_BasedOn];AscDFH.changesRelationMap[AscDFH.historyitem_Style_Next]=[AscDFH.historyitem_Style_Next];AscDFH.changesRelationMap[AscDFH.historyitem_Style_Type]=[AscDFH.historyitem_Style_Type];AscDFH.changesRelationMap[AscDFH.historyitem_Style_QFormat]=[AscDFH.historyitem_Style_QFormat];AscDFH.changesRelationMap[AscDFH.historyitem_Style_UiPriority]= [AscDFH.historyitem_Style_UiPriority];AscDFH.changesRelationMap[AscDFH.historyitem_Style_Hidden]=[AscDFH.historyitem_Style_Hidden];AscDFH.changesRelationMap[AscDFH.historyitem_Style_SemiHidden]=[AscDFH.historyitem_Style_SemiHidden];AscDFH.changesRelationMap[AscDFH.historyitem_Style_UnhideWhenUsed]=[AscDFH.historyitem_Style_UnhideWhenUsed];AscDFH.changesRelationMap[AscDFH.historyitem_Style_Link]=[AscDFH.historyitem_Style_Link];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_Add]=[AscDFH.historyitem_Styles_Add, AscDFH.historyitem_Styles_Remove];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_Remove]=[AscDFH.historyitem_Styles_Add,AscDFH.historyitem_Styles_Remove];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultTextPr]=[AscDFH.historyitem_Styles_ChangeDefaultTextPr];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultParaPr]=[AscDFH.historyitem_Styles_ChangeDefaultParaPr];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultParagraphId]=[AscDFH.historyitem_Styles_ChangeDefaultParagraphId]; AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultCharacterId]=[AscDFH.historyitem_Styles_ChangeDefaultCharacterId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultNumberingId]=[AscDFH.historyitem_Styles_ChangeDefaultNumberingId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultTableId]=[AscDFH.historyitem_Styles_ChangeDefaultTableId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultTableGridId]=[AscDFH.historyitem_Styles_ChangeDefaultTableGridId]; AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultHeadingsId]=[AscDFH.historyitem_Styles_ChangeDefaultHeadingsId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultParaListId]=[AscDFH.historyitem_Styles_ChangeDefaultParaListId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultHeaderId]=[AscDFH.historyitem_Styles_ChangeDefaultHeaderId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultFooterId]=[AscDFH.historyitem_Styles_ChangeDefaultFooterId]; AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultHyperlinkId]=[AscDFH.historyitem_Styles_ChangeDefaultHyperlinkId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultFootnoteTextId]=[AscDFH.historyitem_Styles_ChangeDefaultFootnoteTextId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultFootnoteTextCharId]=[AscDFH.historyitem_Styles_ChangeDefaultFootnoteTextCharId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultFootnoteReferenceId]=[AscDFH.historyitem_Styles_ChangeDefaultFootnoteReferenceId]; AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultNoSpacingId]=[AscDFH.historyitem_Styles_ChangeDefaultNoSpacingId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultTitleId]=[AscDFH.historyitem_Styles_ChangeDefaultTitleId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultSubtitleId]=[AscDFH.historyitem_Styles_ChangeDefaultSubtitleId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultQuoteId]=[AscDFH.historyitem_Styles_ChangeDefaultQuoteId]; AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultIntenseQuoteId]=[AscDFH.historyitem_Styles_ChangeDefaultIntenseQuoteId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultCaption]=[AscDFH.historyitem_Styles_ChangeDefaultCaption];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultEndnoteTextId]=[AscDFH.historyitem_Styles_ChangeDefaultEndnoteTextId];AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultEndnoteTextCharId]=[AscDFH.historyitem_Styles_ChangeDefaultEndnoteTextCharId]; AscDFH.changesRelationMap[AscDFH.historyitem_Styles_ChangeDefaultEndnoteReferenceId]=[AscDFH.historyitem_Styles_ChangeDefaultEndnoteReferenceId];function CChangesStyleBaseObjectProperty(Class,Old,New){AscDFH.CChangesBaseObjectValue.call(this,Class,Old,New)}CChangesStyleBaseObjectProperty.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleBaseObjectProperty.prototype.constructor=CChangesStyleBaseObjectProperty;CChangesStyleBaseObjectProperty.prototype.Load=function(){this.Redo(); AscCommon.CollaborativeEditing.Add_LinkData(this.Class,{StyleUpdate:true})};function CChangesStyleBaseStringProperty(Class,Old,New){AscDFH.CChangesBaseProperty.call(this,Class,Old,New)}CChangesStyleBaseStringProperty.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesStyleBaseStringProperty.prototype.constructor=CChangesStyleBaseStringProperty;CChangesStyleBaseStringProperty.prototype.WriteToBinary=function(Writer){var nFlags=0;if(undefined===this.New)nFlags|=1;else if(null=== this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;else if(null===this.Old)nFlags|=8;Writer.WriteLong(nFlags);if(undefined!==this.New&&null!==this.New)Writer.WriteString2(this.New);if(undefined!==this.Old&&null!==this.Old)Writer.WriteString2(this.Old)};CChangesStyleBaseStringProperty.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.New=undefined;else if(nFlags&2)this.New=null;else this.New=Reader.GetString2();if(nFlags&4)this.Old=undefined;else if(nFlags&8)this.Old= null;else this.Old=Reader.GetString2()};CChangesStyleBaseStringProperty.prototype.Load=function(){this.Redo();AscCommon.CollaborativeEditing.Add_LinkData(this.Class,{StyleUpdate:true})};function CChangesStyleBaseBoolProperty(Class,Old,New){AscDFH.CChangesBaseProperty.call(this,Class,Old,New)}CChangesStyleBaseBoolProperty.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesStyleBaseBoolProperty.prototype.constructor=CChangesStyleBaseBoolProperty;CChangesStyleBaseBoolProperty.prototype.WriteToBinary= function(Writer){var nFlags=0;if(undefined===this.New)nFlags|=1;else if(null===this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;else if(null===this.Old)nFlags|=8;Writer.WriteLong(nFlags);if(undefined!==this.New&&null!==this.New)Writer.WriteBool(this.New);if(undefined!==this.Old&&null!==this.Old)Writer.WriteBool(this.Old)};CChangesStyleBaseBoolProperty.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.New=undefined;else if(nFlags&2)this.New=null;else this.New= Reader.GetBool();if(nFlags&4)this.Old=undefined;else if(nFlags&8)this.Old=null;else this.Old=Reader.GetBool()};CChangesStyleBaseBoolProperty.prototype.Load=function(){this.Redo();AscCommon.CollaborativeEditing.Add_LinkData(this.Class,{StyleUpdate:true})};function CChangesStyleBaseLongProperty(Class,Old,New){AscDFH.CChangesBaseProperty.call(this,Class,Old,New)}CChangesStyleBaseLongProperty.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesStyleBaseLongProperty.prototype.constructor= CChangesStyleBaseLongProperty;CChangesStyleBaseLongProperty.prototype.WriteToBinary=function(Writer){var nFlags=0;if(undefined===this.New)nFlags|=1;else if(null===this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;else if(null===this.Old)nFlags|=8;Writer.WriteLong(nFlags);if(undefined!==this.New&&null!==this.New)Writer.WriteLong(this.New);if(undefined!==this.Old&&null!==this.Old)Writer.WriteLong(this.Old)};CChangesStyleBaseLongProperty.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong(); if(nFlags&1)this.New=undefined;else if(nFlags&2)this.New=null;else this.New=Reader.GetLong();if(nFlags&4)this.Old=undefined;else if(nFlags&8)this.Old=null;else this.Old=Reader.GetLong()};CChangesStyleBaseLongProperty.prototype.Load=function(){this.Redo();AscCommon.CollaborativeEditing.Add_LinkData(this.Class,{StyleUpdate:true})};function CChangesStyleTextPr(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTextPr.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype); CChangesStyleTextPr.prototype.constructor=CChangesStyleTextPr;CChangesStyleTextPr.prototype.Type=AscDFH.historyitem_Style_TextPr;CChangesStyleTextPr.prototype.private_CreateObject=function(){return new CTextPr};CChangesStyleTextPr.prototype.private_SetValue=function(Value){this.Class.TextPr=Value};function CChangesStyleParaPr(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleParaPr.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleParaPr.prototype.constructor= CChangesStyleParaPr;CChangesStyleParaPr.prototype.Type=AscDFH.historyitem_Style_ParaPr;CChangesStyleParaPr.prototype.private_CreateObject=function(){return new CParaPr};CChangesStyleParaPr.prototype.private_SetValue=function(Value){this.Class.ParaPr=Value};function CChangesStyleTablePr(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTablePr.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTablePr.prototype.constructor= CChangesStyleTablePr;CChangesStyleTablePr.prototype.Type=AscDFH.historyitem_Style_TablePr;CChangesStyleTablePr.prototype.private_CreateObject=function(){return new CTablePr};CChangesStyleTablePr.prototype.private_SetValue=function(Value){this.Class.TablePr=Value};function CChangesStyleTableRowPr(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableRowPr.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableRowPr.prototype.constructor= CChangesStyleTableRowPr;CChangesStyleTableRowPr.prototype.Type=AscDFH.historyitem_Style_TableRowPr;CChangesStyleTableRowPr.prototype.private_CreateObject=function(){return new CTableRowPr};CChangesStyleTableRowPr.prototype.private_SetValue=function(Value){this.Class.TableRowPr=Value};function CChangesStyleTableCellPr(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableCellPr.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableCellPr.prototype.constructor= CChangesStyleTableCellPr;CChangesStyleTableCellPr.prototype.Type=AscDFH.historyitem_Style_TableCellPr;CChangesStyleTableCellPr.prototype.private_CreateObject=function(){return new CTableCellPr};CChangesStyleTableCellPr.prototype.private_SetValue=function(Value){this.Class.TableCellPr=Value};function CChangesStyleTableBand1Horz(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableBand1Horz.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype); CChangesStyleTableBand1Horz.prototype.constructor=CChangesStyleTableBand1Horz;CChangesStyleTableBand1Horz.prototype.Type=AscDFH.historyitem_Style_TableBand1Horz;CChangesStyleTableBand1Horz.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableBand1Horz.prototype.private_SetValue=function(Value){this.Class.TableBand1Horz=Value};function CChangesStyleTableBand1Vert(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableBand1Vert.prototype= Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableBand1Vert.prototype.constructor=CChangesStyleTableBand1Vert;CChangesStyleTableBand1Vert.prototype.Type=AscDFH.historyitem_Style_TableBand1Vert;CChangesStyleTableBand1Vert.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableBand1Vert.prototype.private_SetValue=function(Value){this.Class.TableBand1Vert=Value};function CChangesStyleTableBand2Horz(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this, Class,Old,New,Color)}CChangesStyleTableBand2Horz.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableBand2Horz.prototype.constructor=CChangesStyleTableBand2Horz;CChangesStyleTableBand2Horz.prototype.Type=AscDFH.historyitem_Style_TableBand2Horz;CChangesStyleTableBand2Horz.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableBand2Horz.prototype.private_SetValue=function(Value){this.Class.TableBand2Horz=Value};function CChangesStyleTableBand2Vert(Class, Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableBand2Vert.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableBand2Vert.prototype.constructor=CChangesStyleTableBand2Vert;CChangesStyleTableBand2Vert.prototype.Type=AscDFH.historyitem_Style_TableBand2Vert;CChangesStyleTableBand2Vert.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableBand2Vert.prototype.private_SetValue=function(Value){this.Class.TableBand2Vert= Value};function CChangesStyleTableFirstCol(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableFirstCol.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableFirstCol.prototype.constructor=CChangesStyleTableFirstCol;CChangesStyleTableFirstCol.prototype.Type=AscDFH.historyitem_Style_TableFirstCol;CChangesStyleTableFirstCol.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableFirstCol.prototype.private_SetValue= function(Value){this.Class.TableFirstCol=Value};function CChangesStyleTableFirstRow(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableFirstRow.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableFirstRow.prototype.constructor=CChangesStyleTableFirstRow;CChangesStyleTableFirstRow.prototype.Type=AscDFH.historyitem_Style_TableFirstRow;CChangesStyleTableFirstRow.prototype.private_CreateObject=function(){return new CTableStylePr}; CChangesStyleTableFirstRow.prototype.private_SetValue=function(Value){this.Class.TableFirstRow=Value};function CChangesStyleTableLastCol(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableLastCol.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableLastCol.prototype.constructor=CChangesStyleTableLastCol;CChangesStyleTableLastCol.prototype.Type=AscDFH.historyitem_Style_TableLastCol;CChangesStyleTableLastCol.prototype.private_CreateObject= function(){return new CTableStylePr};CChangesStyleTableLastCol.prototype.private_SetValue=function(Value){this.Class.TableLastCol=Value};function CChangesStyleTableLastRow(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableLastRow.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableLastRow.prototype.constructor=CChangesStyleTableLastRow;CChangesStyleTableLastRow.prototype.Type=AscDFH.historyitem_Style_TableLastRow; CChangesStyleTableLastRow.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableLastRow.prototype.private_SetValue=function(Value){this.Class.TableLastRow=Value};function CChangesStyleTableTLCell(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableTLCell.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableTLCell.prototype.constructor=CChangesStyleTableTLCell;CChangesStyleTableTLCell.prototype.Type= AscDFH.historyitem_Style_TableTLCell;CChangesStyleTableTLCell.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableTLCell.prototype.private_SetValue=function(Value){this.Class.TableTLCell=Value};function CChangesStyleTableTRCell(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableTRCell.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableTRCell.prototype.constructor=CChangesStyleTableTRCell; CChangesStyleTableTRCell.prototype.Type=AscDFH.historyitem_Style_TableTRCell;CChangesStyleTableTRCell.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableTRCell.prototype.private_SetValue=function(Value){this.Class.TableTRCell=Value};function CChangesStyleTableBLCell(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableBLCell.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableBLCell.prototype.constructor= CChangesStyleTableBLCell;CChangesStyleTableBLCell.prototype.Type=AscDFH.historyitem_Style_TableBLCell;CChangesStyleTableBLCell.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableBLCell.prototype.private_SetValue=function(Value){this.Class.TableBLCell=Value};function CChangesStyleTableBRCell(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableBRCell.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype); CChangesStyleTableBRCell.prototype.constructor=CChangesStyleTableBRCell;CChangesStyleTableBRCell.prototype.Type=AscDFH.historyitem_Style_TableBRCell;CChangesStyleTableBRCell.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableBRCell.prototype.private_SetValue=function(Value){this.Class.TableBRCell=Value};function CChangesStyleTableWholeTable(Class,Old,New,Color){CChangesStyleBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesStyleTableWholeTable.prototype= Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStyleTableWholeTable.prototype.constructor=CChangesStyleTableWholeTable;CChangesStyleTableWholeTable.prototype.Type=AscDFH.historyitem_Style_TableWholeTable;CChangesStyleTableWholeTable.prototype.private_CreateObject=function(){return new CTableStylePr};CChangesStyleTableWholeTable.prototype.private_SetValue=function(Value){this.Class.TableWholeTable=Value};function CChangesStyleName(Class,Old,New){CChangesStyleBaseStringProperty.call(this, Class,Old,New)}CChangesStyleName.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStyleName.prototype.constructor=CChangesStyleName;CChangesStyleName.prototype.Type=AscDFH.historyitem_Style_Name;CChangesStyleName.prototype.private_SetValue=function(Value){this.Class.Name=Value};function CChangesStyleBasedOn(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStyleBasedOn.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStyleBasedOn.prototype.constructor= CChangesStyleBasedOn;CChangesStyleBasedOn.prototype.Type=AscDFH.historyitem_Style_BasedOn;CChangesStyleBasedOn.prototype.private_SetValue=function(Value){this.Class.BasedOn=Value};function CChangesStyleNext(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStyleNext.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStyleNext.prototype.constructor=CChangesStyleNext;CChangesStyleNext.prototype.Type=AscDFH.historyitem_Style_Next;CChangesStyleNext.prototype.private_SetValue= function(Value){this.Class.Next=Value};function CChangesStyleType(Class,Old,New){AscDFH.CChangesBaseLongValue.call(this,Class,Old,New)}CChangesStyleType.prototype=Object.create(AscDFH.CChangesBaseLongValue.prototype);CChangesStyleType.prototype.constructor=CChangesStyleType;CChangesStyleType.prototype.Type=AscDFH.historyitem_Style_Type;CChangesStyleType.prototype.private_SetValue=function(Value){this.Class.Type=Value};CChangesStyleType.prototype.Load=function(){this.Redo();AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {StyleUpdate:true})};function CChangesStyleQFormat(Class,Old,New){CChangesStyleBaseBoolProperty.call(this,Class,Old,New)}CChangesStyleQFormat.prototype=Object.create(CChangesStyleBaseBoolProperty.prototype);CChangesStyleQFormat.prototype.constructor=CChangesStyleQFormat;CChangesStyleQFormat.prototype.Type=AscDFH.historyitem_Style_QFormat;CChangesStyleQFormat.prototype.private_SetValue=function(Value){this.Class.qFormat=Value};function CChangesStyleUiPriority(Class,Old,New){CChangesStyleBaseLongProperty.call(this, Class,Old,New)}CChangesStyleUiPriority.prototype=Object.create(CChangesStyleBaseLongProperty.prototype);CChangesStyleUiPriority.prototype.constructor=CChangesStyleUiPriority;CChangesStyleUiPriority.prototype.Type=AscDFH.historyitem_Style_UiPriority;CChangesStyleUiPriority.prototype.private_SetValue=function(Value){this.Class.uiPriority=Value};function CChangesStyleHidden(Class,Old,New){CChangesStyleBaseBoolProperty.call(this,Class,Old,New)}CChangesStyleHidden.prototype=Object.create(CChangesStyleBaseBoolProperty.prototype); CChangesStyleHidden.prototype.constructor=CChangesStyleHidden;CChangesStyleHidden.prototype.Type=AscDFH.historyitem_Style_Hidden;CChangesStyleHidden.prototype.private_SetValue=function(Value){this.Class.hidden=Value};function CChangesStyleSemiHidden(Class,Old,New){CChangesStyleBaseBoolProperty.call(this,Class,Old,New)}CChangesStyleSemiHidden.prototype=Object.create(CChangesStyleBaseBoolProperty.prototype);CChangesStyleSemiHidden.prototype.constructor=CChangesStyleSemiHidden;CChangesStyleSemiHidden.prototype.Type= AscDFH.historyitem_Style_SemiHidden;CChangesStyleSemiHidden.prototype.private_SetValue=function(Value){this.Class.semiHidden=Value};function CChangesStyleUnhideWhenUsed(Class,Old,New){CChangesStyleBaseBoolProperty.call(this,Class,Old,New)}CChangesStyleUnhideWhenUsed.prototype=Object.create(CChangesStyleBaseBoolProperty.prototype);CChangesStyleUnhideWhenUsed.prototype.constructor=CChangesStyleUnhideWhenUsed;CChangesStyleUnhideWhenUsed.prototype.Type=AscDFH.historyitem_Style_UnhideWhenUsed;CChangesStyleUnhideWhenUsed.prototype.private_SetValue= function(Value){this.Class.unhideWhenUsed=Value};function CChangesStyleLink(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStyleLink.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStyleLink.prototype.constructor=CChangesStyleLink;CChangesStyleLink.prototype.Type=AscDFH.historyitem_Style_Link;CChangesStyleLink.prototype.private_SetValue=function(Value){this.Class.Link=Value};function CChangesStyleCustom(Class,Old,New){CChangesStyleBaseBoolProperty.call(this, Class,Old,New)}CChangesStyleCustom.prototype=Object.create(CChangesStyleBaseBoolProperty.prototype);CChangesStyleCustom.prototype.constructor=CChangesStyleCustom;CChangesStyleCustom.prototype.Type=AscDFH.historyitem_Style_Custom;CChangesStyleCustom.prototype.private_SetValue=function(Value){this.Class.Custom=Value};function CChangesStylesAdd(Class,Id,Style){AscDFH.CChangesBase.call(this,Class);this.Id=Id;this.Style=Style}CChangesStylesAdd.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesStylesAdd.prototype.constructor= CChangesStylesAdd;CChangesStylesAdd.prototype.Type=AscDFH.historyitem_Styles_Add;CChangesStylesAdd.prototype.Undo=function(){delete this.Class.Style[this.Id];this.Class.Update_Interface(this.Id)};CChangesStylesAdd.prototype.Redo=function(){this.Class.Style[this.Id]=this.Style;this.Class.Update_Interface(this.Id)};CChangesStylesAdd.prototype.WriteToBinary=function(Writer){Writer.WriteString2(this.Id)};CChangesStylesAdd.prototype.ReadFromBinary=function(Reader){this.Id=Reader.GetString2();this.Style= AscCommon.g_oTableId.Get_ById(this.Id)};CChangesStylesAdd.prototype.Load=function(){this.Redo();AscCommon.CollaborativeEditing.Add_LinkData(this.Class,{UpdateStyleId:this.Id})};CChangesStylesAdd.prototype.CreateReverseChange=function(){return new CChangesStylesRemove(this.Class,this.Id,this.Style)};CChangesStylesAdd.prototype.Merge=function(oChange){if(this.Class!==oChange.Class)return true;if((AscDFH.historyitem_Styles_Add===oChange.Type||AscDFH.historyitem_Styles_Remove===oChange.Type)&&this.Id=== oChange.Id)return false;return true};function CChangesStylesRemove(Class,Id,Style){AscDFH.CChangesBase.call(this,Class);this.Id=Id;this.Style=Style}CChangesStylesRemove.prototype=Object.create(AscDFH.CChangesBase.prototype);CChangesStylesRemove.prototype.constructor=CChangesStylesRemove;CChangesStylesRemove.prototype.Type=AscDFH.historyitem_Styles_Remove;CChangesStylesRemove.prototype.Undo=function(){this.Class.Style[this.Id]=this.Style;this.Class.Update_Interface(this.Id)};CChangesStylesRemove.prototype.Redo= function(){delete this.Class.Style[this.Id];this.Class.Update_Interface(this.Id)};CChangesStylesRemove.prototype.WriteToBinary=function(Writer){Writer.WriteString2(this.Id)};CChangesStylesRemove.prototype.ReadFromBinary=function(Reader){this.Id=Reader.GetString2();this.Style=AscCommon.g_oTableId.Get_ById(this.Id)};CChangesStylesRemove.prototype.Load=function(){this.Redo();AscCommon.CollaborativeEditing.Add_LinkData(this.Class,{UpdateStyleId:this.Id})};CChangesStylesRemove.prototype.CreateReverseChange= function(){return new CChangesStylesAdd(this.Class,this.Id,this.Style)};CChangesStylesRemove.prototype.Merge=function(oChange){if(this.Class!==oChange.Class)return true;if((AscDFH.historyitem_Styles_Add===oChange.Type||AscDFH.historyitem_Styles_Remove===oChange.Type)&&this.Id===oChange.Id)return false;return true};function CChangesStylesChangeDefaultTextPr(Class,Old,New){AscDFH.CChangesBaseObjectValue.call(this,Class,Old,New)}CChangesStylesChangeDefaultTextPr.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype); CChangesStylesChangeDefaultTextPr.prototype.constructor=CChangesStylesChangeDefaultTextPr;CChangesStylesChangeDefaultTextPr.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultTextPr;CChangesStylesChangeDefaultTextPr.prototype.private_CreateObject=function(){return new CTextPr};CChangesStylesChangeDefaultTextPr.prototype.private_SetValue=function(Value){this.Class.Default.TextPr=Value};function CChangesStylesChangeDefaultParaPr(Class,Old,New){AscDFH.CChangesBaseObjectValue.call(this,Class,Old,New)} CChangesStylesChangeDefaultParaPr.prototype=Object.create(AscDFH.CChangesBaseObjectValue.prototype);CChangesStylesChangeDefaultParaPr.prototype.constructor=CChangesStylesChangeDefaultParaPr;CChangesStylesChangeDefaultParaPr.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultParaPr;CChangesStylesChangeDefaultParaPr.prototype.private_CreateObject=function(){return new CParaPr};CChangesStylesChangeDefaultParaPr.prototype.private_SetValue=function(Value){this.Class.Default.ParaPr=Value};function CChangesStylesChangeDefaultParagraphId(Class, Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultParagraphId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultParagraphId.prototype.constructor=CChangesStylesChangeDefaultParagraphId;CChangesStylesChangeDefaultParagraphId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultParagraphId;CChangesStylesChangeDefaultParagraphId.prototype.private_SetValue=function(Value){this.Class.Default.Paragraph=Value};function CChangesStylesChangeDefaultCharacterId(Class, Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultCharacterId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultCharacterId.prototype.constructor=CChangesStylesChangeDefaultCharacterId;CChangesStylesChangeDefaultCharacterId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultCharacterId;CChangesStylesChangeDefaultCharacterId.prototype.private_SetValue=function(Value){this.Class.Default.Character=Value};function CChangesStylesChangeDefaultNumberingId(Class, Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultNumberingId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultNumberingId.prototype.constructor=CChangesStylesChangeDefaultNumberingId;CChangesStylesChangeDefaultNumberingId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultNumberingId;CChangesStylesChangeDefaultNumberingId.prototype.private_SetValue=function(Value){this.Class.Default.Numbering=Value};function CChangesStylesChangeDefaultTableId(Class, Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultTableId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultTableId.prototype.constructor=CChangesStylesChangeDefaultTableId;CChangesStylesChangeDefaultTableId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultTableId;CChangesStylesChangeDefaultTableId.prototype.private_SetValue=function(Value){this.Class.Default.Table=Value};function CChangesStylesChangeDefaultTableGridId(Class, Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultTableGridId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultTableGridId.prototype.constructor=CChangesStylesChangeDefaultTableGridId;CChangesStylesChangeDefaultTableGridId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultTableGridId;CChangesStylesChangeDefaultTableGridId.prototype.private_SetValue=function(Value){this.Class.Default.TableGrid=Value};function CChangesStylesChangeDefaultHeadingsId(Class, Old,New,Lvl){AscDFH.CChangesBaseProperty.call(this,Class,Old,New);this.Lvl=Lvl}CChangesStylesChangeDefaultHeadingsId.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesStylesChangeDefaultHeadingsId.prototype.constructor=CChangesStylesChangeDefaultHeadingsId;CChangesStylesChangeDefaultHeadingsId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultHeadingsId;CChangesStylesChangeDefaultHeadingsId.prototype.private_SetValue=function(Value){this.Class.Default.Headings[this.Lvl]=Value}; CChangesStylesChangeDefaultHeadingsId.prototype.WriteToBinary=function(Writer){Writer.WriteLong(this.Lvl);var nFlags=0;if(undefined===this.New)nFlags|=1;else if(null===this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;else if(null===this.Old)nFlags|=8;Writer.WriteLong(nFlags);if(undefined!==this.New&&null!==this.New)Writer.WriteString2(this.New);if(undefined!==this.Old&&null!==this.Old)Writer.WriteString2(this.Old)};CChangesStylesChangeDefaultHeadingsId.prototype.ReadFromBinary=function(Reader){this.Lvl= Reader.GetLong();var nFlags=Reader.GetLong();if(nFlags&1)this.New=undefined;else if(nFlags&2)this.New=null;else this.New=Reader.GetString2();if(nFlags&4)this.Old=undefined;else if(nFlags&8)this.Old=null;else this.Old=Reader.GetString2()};function CChangesStylesChangeDefaultParaListId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultParaListId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultParaListId.prototype.constructor= CChangesStylesChangeDefaultParaListId;CChangesStylesChangeDefaultParaListId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultParaListId;CChangesStylesChangeDefaultParaListId.prototype.private_SetValue=function(Value){this.Class.Default.ParaList=Value};function CChangesStylesChangeDefaultHeaderId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultHeaderId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultHeaderId.prototype.constructor= CChangesStylesChangeDefaultHeaderId;CChangesStylesChangeDefaultHeaderId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultHeaderId;CChangesStylesChangeDefaultHeaderId.prototype.private_SetValue=function(Value){this.Class.Default.Header=Value};function CChangesStylesChangeDefaultFooterId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultFooterId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultFooterId.prototype.constructor= CChangesStylesChangeDefaultFooterId;CChangesStylesChangeDefaultFooterId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultFooterId;CChangesStylesChangeDefaultFooterId.prototype.private_SetValue=function(Value){this.Class.Default.Footer=Value};function CChangesStylesChangeDefaultHyperlinkId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultHyperlinkId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultHyperlinkId.prototype.constructor= CChangesStylesChangeDefaultHyperlinkId;CChangesStylesChangeDefaultHyperlinkId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultHyperlinkId;CChangesStylesChangeDefaultHyperlinkId.prototype.private_SetValue=function(Value){this.Class.Default.Header=Value};function CChangesStylesChangeDefaultFootnoteTextId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultFootnoteTextId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultFootnoteTextId.prototype.constructor= CChangesStylesChangeDefaultFootnoteTextId;CChangesStylesChangeDefaultFootnoteTextId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultFootnoteTextId;CChangesStylesChangeDefaultFootnoteTextId.prototype.private_SetValue=function(Value){this.Class.Default.FootnoteText=Value};function CChangesStylesChangeDefaultFootnoteTextCharId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultFootnoteTextCharId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype); CChangesStylesChangeDefaultFootnoteTextCharId.prototype.constructor=CChangesStylesChangeDefaultFootnoteTextCharId;CChangesStylesChangeDefaultFootnoteTextCharId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultFootnoteTextCharId;CChangesStylesChangeDefaultFootnoteTextCharId.prototype.private_SetValue=function(Value){this.Class.Default.FootnoteTextChar=Value};function CChangesStylesChangeDefaultFootnoteReferenceId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultFootnoteReferenceId.prototype= Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultFootnoteReferenceId.prototype.constructor=CChangesStylesChangeDefaultFootnoteReferenceId;CChangesStylesChangeDefaultFootnoteReferenceId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultFootnoteReferenceId;CChangesStylesChangeDefaultFootnoteReferenceId.prototype.private_SetValue=function(Value){this.Class.Default.FootnoteReference=Value};function CChangesStylesChangeDefaultNoSpacingId(Class,Old,New){CChangesStyleBaseStringProperty.call(this, Class,Old,New)}CChangesStylesChangeDefaultNoSpacingId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultNoSpacingId.prototype.constructor=CChangesStylesChangeDefaultNoSpacingId;CChangesStylesChangeDefaultNoSpacingId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultNoSpacingId;CChangesStylesChangeDefaultNoSpacingId.prototype.private_SetValue=function(Value){this.Class.Default.NoSpacing=Value};function CChangesStylesChangeDefaultTitleId(Class,Old,New){CChangesStyleBaseStringProperty.call(this, Class,Old,New)}CChangesStylesChangeDefaultTitleId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultTitleId.prototype.constructor=CChangesStylesChangeDefaultTitleId;CChangesStylesChangeDefaultTitleId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultTitleId;CChangesStylesChangeDefaultTitleId.prototype.private_SetValue=function(Value){this.Class.Default.Title=Value};function CChangesStylesChangeDefaultSubtitleId(Class,Old,New){CChangesStyleBaseStringProperty.call(this, Class,Old,New)}CChangesStylesChangeDefaultSubtitleId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultSubtitleId.prototype.constructor=CChangesStylesChangeDefaultSubtitleId;CChangesStylesChangeDefaultSubtitleId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultSubtitleId;CChangesStylesChangeDefaultSubtitleId.prototype.private_SetValue=function(Value){this.Class.Default.Subtitle=Value};function CChangesStylesChangeDefaultQuoteId(Class,Old,New){CChangesStyleBaseStringProperty.call(this, Class,Old,New)}CChangesStylesChangeDefaultQuoteId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultQuoteId.prototype.constructor=CChangesStylesChangeDefaultQuoteId;CChangesStylesChangeDefaultQuoteId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultQuoteId;CChangesStylesChangeDefaultQuoteId.prototype.private_SetValue=function(Value){this.Class.Default.Quote=Value};function CChangesStylesChangeDefaultIntenseQuoteId(Class,Old,New){CChangesStyleBaseStringProperty.call(this, Class,Old,New)}CChangesStylesChangeDefaultIntenseQuoteId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultIntenseQuoteId.prototype.constructor=CChangesStylesChangeDefaultIntenseQuoteId;CChangesStylesChangeDefaultIntenseQuoteId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultIntenseQuoteId;CChangesStylesChangeDefaultIntenseQuoteId.prototype.private_SetValue=function(Value){this.Class.Default.IntenseQuote=Value};function CChangesStylesChangeDefaultCaption(Class, Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultCaption.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultCaption.prototype.constructor=CChangesStylesChangeDefaultIntenseQuoteId;CChangesStylesChangeDefaultCaption.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultCaption;CChangesStylesChangeDefaultCaption.prototype.private_SetValue=function(Value){this.Class.Default.Caption=Value};function CChangesStylesChangeDefaultEndnoteTextId(Class, Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultEndnoteTextId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultEndnoteTextId.prototype.constructor=CChangesStylesChangeDefaultEndnoteTextId;CChangesStylesChangeDefaultEndnoteTextId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultEndnoteTextId;CChangesStylesChangeDefaultEndnoteTextId.prototype.private_SetValue=function(Value){this.Class.Default.EndnoteText= Value};function CChangesStylesChangeDefaultEndnoteTextCharId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultEndnoteTextCharId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultEndnoteTextCharId.prototype.constructor=CChangesStylesChangeDefaultEndnoteTextCharId;CChangesStylesChangeDefaultEndnoteTextCharId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultEndnoteTextCharId;CChangesStylesChangeDefaultEndnoteTextCharId.prototype.private_SetValue= function(Value){this.Class.Default.EndnoteTextChar=Value};function CChangesStylesChangeDefaultEndnoteReferenceId(Class,Old,New){CChangesStyleBaseStringProperty.call(this,Class,Old,New)}CChangesStylesChangeDefaultEndnoteReferenceId.prototype=Object.create(CChangesStyleBaseStringProperty.prototype);CChangesStylesChangeDefaultEndnoteReferenceId.prototype.constructor=CChangesStylesChangeDefaultEndnoteReferenceId;CChangesStylesChangeDefaultEndnoteReferenceId.prototype.Type=AscDFH.historyitem_Styles_ChangeDefaultEndnoteReferenceId; CChangesStylesChangeDefaultEndnoteReferenceId.prototype.private_SetValue=function(Value){this.Class.Default.EndnoteReference=Value};"use strict";var c_oAscRevisionsChangeType=Asc.c_oAscRevisionsChangeType;function CRevisionsChange(){this.Type=c_oAscRevisionsChangeType.Unknown;this.X=0;this.Y=0;this.Value="";this.MoveType=Asc.c_oAscRevisionsMove.NoMove;this.MoveId="";this.MoveDown=false;this.UserName="";this.UserId="";this.DateTime="";this.UserColor=new AscCommon.CColor(0,0,0,255);this.Element=null; this.StartPos=null;this.EndPos=null;this._X=0;this._Y=0;this._PageNum=0;this._PosChanged=false;this.SimpleChanges=[]}CRevisionsChange.prototype.get_UserId=function(){return this.UserId};CRevisionsChange.prototype.put_UserId=function(UserId){this.UserId=UserId;this.private_UpdateUserColor()};CRevisionsChange.prototype.get_UserName=function(){return this.UserName};CRevisionsChange.prototype.put_UserName=function(UserName){this.UserName=UserName;this.private_UpdateUserColor()};CRevisionsChange.prototype.get_DateTime= function(){return this.DateTime};CRevisionsChange.prototype.put_DateTime=function(DateTime){this.DateTime=DateTime};CRevisionsChange.prototype.get_UserColor=function(){return this.UserColor};CRevisionsChange.prototype.get_StartPos=function(){return this.StartPos};CRevisionsChange.prototype.put_StartPos=function(StartPos){this.StartPos=StartPos};CRevisionsChange.prototype.get_EndPos=function(){return this.EndPos};CRevisionsChange.prototype.put_EndPos=function(EndPos){this.EndPos=EndPos};CRevisionsChange.prototype.get_Type= function(){return this.Type};CRevisionsChange.prototype.get_X=function(){return this.X};CRevisionsChange.prototype.get_Y=function(){return this.Y};CRevisionsChange.prototype.get_Value=function(){return this.Value};CRevisionsChange.prototype.put_Type=function(Type){this.Type=Type};CRevisionsChange.prototype.put_XY=function(X,Y){this.X=X;this.Y=Y};CRevisionsChange.prototype.put_Value=function(Value){this.Value=Value};CRevisionsChange.prototype.put_Paragraph=function(Para){this.Element=Para};CRevisionsChange.prototype.get_Paragraph= function(){return this.Element};CRevisionsChange.prototype.get_LockUserId=function(){if(this.Paragraph){var Lock=this.Paragraph.GetLock();var LockType=Lock.Get_Type();if(AscCommon.locktype_Mine!==LockType&&AscCommon.locktype_None!==LockType)return Lock.Get_UserId()}return null};CRevisionsChange.prototype.put_InternalPos=function(x,y,pageNum){if(this._PageNum!==pageNum||Math.abs(this._X-x)>.001||Math.abs(this._Y-y)>.001){this._X=x;this._Y=y;this._PageNum=pageNum;this._PosChanged=true}else this._PosChanged= false};CRevisionsChange.prototype.get_InternalPosX=function(){return this._X};CRevisionsChange.prototype.get_InternalPosY=function(){return this._Y};CRevisionsChange.prototype.get_InternalPosPageNum=function(){return this._PageNum};CRevisionsChange.prototype.ComparePrevPosition=function(){if(true===this._PosChanged)return false;return true};CRevisionsChange.prototype.private_UpdateUserColor=function(){this.UserColor=AscCommon.getUserColorById(this.UserId,this.UserName,true,false)};CRevisionsChange.prototype.IsMove= function(){return(c_oAscRevisionsChangeType.TextAdd===this.Type||c_oAscRevisionsChangeType.TextRem===this.Type||c_oAscRevisionsChangeType.ParaAdd===this.Type||c_oAscRevisionsChangeType.ParaRem===this.Type)&&Asc.c_oAscRevisionsMove.NoMove!==this.MoveType||Asc.c_oAscRevisionsChangeType.MoveMark===this.Type};CRevisionsChange.prototype.IsMoveFrom=function(){return this.MoveType===Asc.c_oAscRevisionsMove.MoveFrom};CRevisionsChange.prototype.SetType=function(nType){this.Type=nType};CRevisionsChange.prototype.GetType= function(){return this.Type};CRevisionsChange.prototype.SetElement=function(oElement){this.Element=oElement};CRevisionsChange.prototype.GetElement=function(){return this.Element};CRevisionsChange.prototype.SetValue=function(oValue){this.Value=oValue};CRevisionsChange.prototype.GetValue=function(){return this.Value};CRevisionsChange.prototype.SetUserId=function(sUserId){this.UserId=sUserId;this.private_UpdateUserColor()};CRevisionsChange.prototype.GetUserId=function(){return this.UserId};CRevisionsChange.prototype.SetUserName= function(sUserName){this.UserName=sUserName;this.private_UpdateUserColor()};CRevisionsChange.prototype.GetUserName=function(){return this.UserName};CRevisionsChange.prototype.SetDateTime=function(sDateTime){this.DateTime=sDateTime};CRevisionsChange.prototype.GetDateTime=function(){return this.DateTime};CRevisionsChange.prototype.SetMoveType=function(nMoveType){this.MoveType=nMoveType};CRevisionsChange.prototype.GetMoveType=function(){return this.MoveType};CRevisionsChange.prototype.IsComplexChange= function(){return this.SimpleChanges.length!==0};CRevisionsChange.prototype.SetSimpleChanges=function(arrChanges){this.SimpleChanges=arrChanges};CRevisionsChange.prototype.GetSimpleChanges=function(){return this.SimpleChanges};CRevisionsChange.prototype.SetMoveId=function(sMoveId){this.MoveId=sMoveId};CRevisionsChange.prototype.GetMoveId=function(){return this.MoveId};CRevisionsChange.prototype.IsMovedDown=function(){return this.MoveDown};CRevisionsChange.prototype.SetMovedDown=function(isMovedDown){this.MoveDown= isMovedDown};CRevisionsChange.prototype.GetX=function(){return this.X};CRevisionsChange.prototype.GetY=function(){return this.Y};CRevisionsChange.prototype.SetXY=function(X,Y){this.X=X;this.Y=Y};CRevisionsChange.prototype.SetInternalPos=function(dX,dY,nPageNum){if(this._PageNum!==nPageNum||Math.abs(this._X-dX)>.001||Math.abs(this._Y-dY)>.001){this._X=dX;this._Y=dY;this._PageNum=nPageNum;this._PosChanged=true}else this._PosChanged=false};CRevisionsChange.prototype.GetInternalPosX=function(){return this._X}; CRevisionsChange.prototype.GetInternalPosY=function(){return this._Y};CRevisionsChange.prototype.GetInternalPosPageNum=function(){return this._PageNum};CRevisionsChange.prototype.GetStartPos=function(){return this.StartPos};CRevisionsChange.prototype.SetStartPos=function(oStartPos){this.StartPos=oStartPos};CRevisionsChange.prototype.GetEndPos=function(){return this.EndPos};CRevisionsChange.prototype.SetEndPos=function(oEndPos){this.EndPos=oEndPos};CRevisionsChange.prototype["get_UserId"]=CRevisionsChange.prototype.GetUserId; CRevisionsChange.prototype["put_UserId"]=CRevisionsChange.prototype.SetUserId;CRevisionsChange.prototype["get_UserName"]=CRevisionsChange.prototype.GetUserName;CRevisionsChange.prototype["put_UserName"]=CRevisionsChange.prototype.SetUserName;CRevisionsChange.prototype["get_DateTime"]=CRevisionsChange.prototype.GetDateTime;CRevisionsChange.prototype["put_DateTime"]=CRevisionsChange.prototype.SetDateTime;CRevisionsChange.prototype["get_UserColor"]=CRevisionsChange.prototype.get_UserColor;CRevisionsChange.prototype["get_StartPos"]= CRevisionsChange.prototype.GetStartPos;CRevisionsChange.prototype["put_StartPos"]=CRevisionsChange.prototype.SetStartPos;CRevisionsChange.prototype["get_EndPos"]=CRevisionsChange.prototype.GetEndPos;CRevisionsChange.prototype["put_EndPos"]=CRevisionsChange.prototype.SetEndPos;CRevisionsChange.prototype["get_Type"]=CRevisionsChange.prototype.GetType;CRevisionsChange.prototype["get_X"]=CRevisionsChange.prototype.GetX;CRevisionsChange.prototype["get_Y"]=CRevisionsChange.prototype.GetY;CRevisionsChange.prototype["get_Value"]= CRevisionsChange.prototype.GetValue;CRevisionsChange.prototype["put_Type"]=CRevisionsChange.prototype.SetType;CRevisionsChange.prototype["put_XY"]=CRevisionsChange.prototype.SetXY;CRevisionsChange.prototype["put_Value"]=CRevisionsChange.prototype.SetValue;CRevisionsChange.prototype["get_LockUserId"]=CRevisionsChange.prototype.get_LockUserId;CRevisionsChange.prototype["put_MoveType"]=CRevisionsChange.prototype.SetMoveType;CRevisionsChange.prototype["get_MoveType"]=CRevisionsChange.prototype.GetMoveType; CRevisionsChange.prototype["get_MoveId"]=CRevisionsChange.prototype.GetMoveId;CRevisionsChange.prototype["is_MovedDown"]=CRevisionsChange.prototype.IsMovedDown;"use strict";function Sort_Ranges_X0(A,B){if(!A.X0||!B.X0)return 0;if(A.X0<B.X0)return-1;else if(A.X0>B.X0)return 1;return 0}function FlowObjects_CheckInjection(Range1,Range2){for(var Index=0;Index<Range1.length;Index++){var R1=Range1[Index];var bInject=false;for(var Index2=0;Index2<Range2.length;Index2++){var R2=Range2[Index2];if(R1.X0>=R2.X0&& R1.X0<=R2.X1&&R1.X1>=R2.X0&&R1.X1<=R2.X1)bInject=true}if(!bInject)return false}return true}function FlowObjects_CompareRanges(Range1,Range2){if(Range1.length<Range2.length)return-1;else if(Range1.length>Range2.length)return-1;for(var Index=0;Index<Range1.length;Index++)if(Math.abs(Range1[Index].X0-Range2[Index].X0)>.001||Math.abs(Range1[Index].X1-Range2[Index].X1))return-1;return 0}function CFlowBase(){}CFlowBase.prototype.IsPointIn=function(X,Y){return X<=this.X+this.W&&X>=this.X&&Y>=this.Y&&Y<= this.Y+this.H};CFlowBase.prototype.UpdateCursorType=function(X,Y,PageIndex){};CFlowBase.prototype.Get_Distance=function(){var oDist=this.Distance;return new AscFormat.CDistance(AscFormat.getValOrDefault(oDist.L,AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT),AscFormat.getValOrDefault(oDist.T,0),AscFormat.getValOrDefault(oDist.R,AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT),AscFormat.getValOrDefault(oDist.B,0))};CFlowBase.prototype.getArrayWrapIntervals=function(x0,y0,x1,y1,Y0Sp,Y1Sp,LeftField,RightField,ret,bMathWrap){if(this.WrappingType=== WRAPPING_TYPE_THROUGH||this.WrappingType===WRAPPING_TYPE_TIGHT){y0=Y0Sp;y1=Y1Sp}var top=this.Y-AscFormat.getValOrDefault(this.Distance.T,0);var bottom=this.Y+this.H+AscFormat.getValOrDefault(this.Distance.B,0);if(y1<top||y0>bottom)return ret;var b_check=false,X0,X1,Y1,WrapType=bMathWrap===true?WRAPPING_TYPE_SQUARE:this.WrappingType;switch(WrapType){case WRAPPING_TYPE_NONE:{return ret}case WRAPPING_TYPE_SQUARE:case WRAPPING_TYPE_THROUGH:case WRAPPING_TYPE_TIGHT:{X0=this.X-AscFormat.getValOrDefault(this.Distance.L, AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT);X1=this.X+this.W+AscFormat.getValOrDefault(this.Distance.R,AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT);Y1=bottom;b_check=true;break}case WRAPPING_TYPE_TOP_AND_BOTTOM:{var L=this.X-AscFormat.getValOrDefault(this.Distance.L,AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT);var R=this.X+this.W+AscFormat.getValOrDefault(this.Distance.R,AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT);if(R<LeftField||L>RightField)return ret;X0=x0;X1=x1;Y1=bottom;break}}if(b_check){var dx=this.WrappingType===WRAPPING_TYPE_SQUARE? 6.35:3.175;if(X0<LeftField+dx)X0=x0;if(X1>RightField-dx)X1=x1}ret.push({X0:X0,X1:X1,Y1:Y1,typeLeft:this.WrappingType,typeRight:this.WrappingType,bFlowObject:true});return ret};CFlowBase.prototype.GetElement=function(){return this.Table};CFlowBase.prototype.GetPage=function(){return this.PageNum};CFlowBase.prototype.IsFlowTable=function(){return false};CFlowBase.prototype.CheckDocumentContent=function(oDocContent){if(!this.Table.Parent)return false;return oDocContent===this.Table.Parent||oDocContent.GetDocumentContentForRecalcInfo()=== this.Table.Parent.GetDocumentContentForRecalcInfo()};function CFlowTable(Table,PageIndex){CFlowBase.call(this);this.Table=Table;this.Id=Table.Get_Id();this.PageNum=Table.Get_StartPage_Absolute();this.PageController=PageIndex-Table.PageNum;this.Distance=Table.Distance;this.WrappingType=WRAPPING_TYPE_SQUARE;var oBounds=this.Table.GetPageBounds(this.PageController);this.X=oBounds.Left;this.Y=AscCommon.CorrectMMToTwips(oBounds.Top)+AscCommon.TwipsToMM(1);this.W=oBounds.Right-oBounds.Left;this.H=AscCommon.CorrectMMToTwips(oBounds.Bottom- oBounds.Top)}CFlowTable.prototype=Object.create(CFlowBase.prototype);CFlowTable.prototype.constructor=CFlowTable;CFlowTable.prototype.IsFlowTable=function(){return true};function CFlowParagraph(Paragraph,X,Y,W,H,Dx,Dy,StartIndex,FlowCount,Wrap){CFlowBase.call(this);this.Table=Paragraph;this.Paragraph=Paragraph;this.Id=Paragraph.Get_Id();this.PageNum=Paragraph.PageNum+Paragraph.GetPagesCount()-1;this.PageController=0;this.StartIndex=StartIndex;this.FlowCount=FlowCount;this.Distance={T:Dy,B:Dy,L:Dx, R:Dx};this.X=X;this.Y=Y;this.W=W;this.H=H;this.WrappingType=WRAPPING_TYPE_SQUARE;switch(Wrap){case undefined:case wrap_Around:case wrap_Auto:this.WrappingType=WRAPPING_TYPE_SQUARE;break;case wrap_None:this.WrappingType=WRAPPING_TYPE_NONE;break;case wrap_NotBeside:this.WrappingType=WRAPPING_TYPE_TOP_AND_BOTTOM;break;case wrap_Through:this.WrappingType=WRAPPING_TYPE_THROUGH;break;case wrap_Tight:this.WrappingType=WRAPPING_TYPE_TIGHT;break}}CFlowParagraph.prototype=Object.create(CFlowBase.prototype); CFlowParagraph.prototype.constructor=CFlowParagraph;"use strict";var g_fontApplication=AscFonts.g_fontApplication;var g_oTableId=AscCommon.g_oTableId;var g_oTextMeasurer=AscCommon.g_oTextMeasurer;var isRealObject=AscCommon.isRealObject;var History=AscCommon.History;var HitInLine=AscFormat.HitInLine;var MOVE_DELTA=AscFormat.MOVE_DELTA;var c_oAscRelativeFromH=Asc.c_oAscRelativeFromH;var c_oAscRelativeFromV=Asc.c_oAscRelativeFromV;var c_oAscSectionBreakType=Asc.c_oAscSectionBreakType;var para_Unknown= -1;var para_RunBase=0;var para_Text=1;var para_Space=2;var para_TextPr=3;var para_End=4;var para_NewLine=16;var para_NewLineRendered=17;var para_InlineBreak=18;var para_PageBreakRendered=19;var para_Numbering=20;var para_Tab=21;var para_Drawing=22;var para_PageNum=23;var para_FlowObjectAnchor=24;var para_HyperlinkStart=25;var para_HyperlinkEnd=32;var para_CollaborativeChangesStart=33;var para_CollaborativeChangesEnd=34;var para_CommentStart=35;var para_CommentEnd=36;var para_PresentationNumbering= 37;var para_Math=38;var para_Run=39;var para_Sym=40;var para_Comment=41;var para_Hyperlink=48;var para_Math_Run=49;var para_Math_Placeholder=50;var para_Math_Composition=51;var para_Math_Text=52;var para_Math_Ampersand=53;var para_Field=54;var para_Math_BreakOperator=55;var para_Math_Content=56;var para_FootnoteReference=57;var para_FootnoteRef=64;var para_Separator=65;var para_ContinuationSeparator=66;var para_PageCount=67;var para_InlineLevelSdt=68;var para_FieldChar=69;var para_InstrText=70;var para_Bookmark= 71;var para_RevisionMove=72;var para_EndnoteReference=73;var para_EndnoteRef=74;var break_Line=1;var break_Page=2;var break_Column=3;var nbsp_charcode=160;var nbsp_string=String.fromCharCode(160);var sp_string=String.fromCharCode(50);var g_aNumber=[];g_aNumber[48]=1;g_aNumber[49]=1;g_aNumber[50]=1;g_aNumber[51]=1;g_aNumber[52]=1;g_aNumber[53]=1;g_aNumber[54]=1;g_aNumber[55]=1;g_aNumber[56]=1;g_aNumber[57]=1;var g_oSRCFPSC=[];g_oSRCFPSC[para_Text]=1;g_oSRCFPSC[para_Space]=1;g_oSRCFPSC[para_End]=1; g_oSRCFPSC[para_Tab]=1;g_oSRCFPSC[para_Sym]=1;g_oSRCFPSC[para_PageCount]=1;g_oSRCFPSC[para_FieldChar]=1;g_oSRCFPSC[para_InstrText]=1;g_oSRCFPSC[para_Bookmark]=1;var g_aSpecialSymbols=[];g_aSpecialSymbols[174]=1;var g_aCCNBAEL=[];var PARATEXT_FLAGS_MASK=4294967295;var PARATEXT_FLAGS_FONTKOEF_SCRIPT=1;var PARATEXT_FLAGS_FONTKOEF_SMALLCAPS=2;var PARATEXT_FLAGS_SPACEAFTER=65536;var PARATEXT_FLAGS_CAPITALS=131072;var PARATEXT_FLAGS_NON_FONTKOEF_SCRIPT=PARATEXT_FLAGS_MASK^PARATEXT_FLAGS_FONTKOEF_SCRIPT; var PARATEXT_FLAGS_NON_FONTKOEF_SMALLCAPS=PARATEXT_FLAGS_MASK^PARATEXT_FLAGS_FONTKOEF_SMALLCAPS;var PARATEXT_FLAGS_NON_SPACEAFTER=PARATEXT_FLAGS_MASK^PARATEXT_FLAGS_SPACEAFTER;var PARATEXT_FLAGS_NON_CAPITALS=PARATEXT_FLAGS_MASK^PARATEXT_FLAGS_CAPITALS;var TEXTWIDTH_DIVIDER=16384;function CRunElementBase(){this.Width=0|0;this.WidthVisible=0|0}CRunElementBase.prototype.Type=para_RunBase;CRunElementBase.prototype.Get_Type=function(){return this.Type};CRunElementBase.prototype.Draw=function(X,Y,Context, PDSE){};CRunElementBase.prototype.Measure=function(Context,TextPr){this.Width=0|0;this.WidthVisible=0|0};CRunElementBase.prototype.Get_Width=function(){return this.Width/TEXTWIDTH_DIVIDER};CRunElementBase.prototype.Get_WidthVisible=function(){return this.WidthVisible/TEXTWIDTH_DIVIDER};CRunElementBase.prototype.Set_WidthVisible=function(WidthVisible){this.WidthVisible=WidthVisible*TEXTWIDTH_DIVIDER|0};CRunElementBase.prototype.Set_Width=function(Width){this.Width=Width*TEXTWIDTH_DIVIDER|0};CRunElementBase.prototype.Is_RealContent= function(){return true};CRunElementBase.prototype.Can_AddNumbering=function(){return true};CRunElementBase.prototype.Copy=function(){return new CRunElementBase};CRunElementBase.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type)};CRunElementBase.prototype.Read_FromBinary=function(Reader){};CRunElementBase.prototype.GetType=function(){return this.Type};CRunElementBase.prototype.IsDiacriticalSymbol=function(){return false};CRunElementBase.prototype.CanStartAutoCorrect=function(){return false}; CRunElementBase.prototype.IsPunctuation=function(){return false};CRunElementBase.prototype.IsDot=function(){return false};CRunElementBase.prototype.IsHyphen=function(){return false};CRunElementBase.prototype.IsEqual=function(oElement){return this.Type===oElement.Type};function ParaText(nCharCode){CRunElementBase.call(this);this.Value=undefined!==nCharCode?nCharCode:0;this.Width=0|0;this.WidthVisible=0|0;this.Flags=0|0;this.Set_SpaceAfter(this.private_IsSpaceAfter());if(AscFonts.IsCheckSymbols)AscFonts.FontPickerByCharacter.getFontBySymbol(this.Value)} ParaText.prototype=Object.create(CRunElementBase.prototype);ParaText.prototype.constructor=ParaText;ParaText.prototype.Type=para_Text;ParaText.prototype.Set_CharCode=function(CharCode){this.Value=CharCode;this.Set_SpaceAfter(this.private_IsSpaceAfter());if(AscFonts.IsCheckSymbols)AscFonts.FontPickerByCharacter.getFontBySymbol(this.Value)};ParaText.prototype.GetCharCode=function(){return this.Value};ParaText.prototype.Draw=function(X,Y,Context,PDSE,oTextPr){if(undefined!==this.LGap){this.private_DrawGapsBackground(X, Y,Context,PDSE,oTextPr);X+=this.LGap}var CharCode=this.Value;var FontKoef=1;if(this.Flags&PARATEXT_FLAGS_FONTKOEF_SCRIPT&&this.Flags&PARATEXT_FLAGS_FONTKOEF_SMALLCAPS)FontKoef=smallcaps_and_script_koef;else if(this.Flags&PARATEXT_FLAGS_FONTKOEF_SCRIPT)FontKoef=AscCommon.vaKSize;else if(this.Flags&PARATEXT_FLAGS_FONTKOEF_SMALLCAPS)FontKoef=smallcaps_Koef;Context.SetFontSlot(this.Flags>>8&255,FontKoef);var ResultCharCode=this.Flags&PARATEXT_FLAGS_CAPITALS?String.fromCharCode(CharCode).toUpperCase().charCodeAt(0): CharCode;if(true!==this.Is_NBSP())Context.FillTextCode(X,Y,ResultCharCode);else if(editor&&editor.ShowParaMarks)Context.FillText(X,Y,String.fromCharCode(176))};ParaText.prototype.Measure=function(Context,TextPr){var bCapitals=false;var CharCode=this.Value;var ResultCharCode=CharCode;if(true===TextPr.Caps||true===TextPr.SmallCaps){this.Flags|=PARATEXT_FLAGS_CAPITALS;ResultCharCode=String.fromCharCode(CharCode).toUpperCase().charCodeAt(0);bCapitals=ResultCharCode===CharCode?true:false}else{this.Flags&= PARATEXT_FLAGS_NON_CAPITALS;bCapitals=false}if(TextPr.VertAlign!==AscCommon.vertalign_Baseline)this.Flags|=PARATEXT_FLAGS_FONTKOEF_SCRIPT;else this.Flags&=PARATEXT_FLAGS_NON_FONTKOEF_SCRIPT;if(true!=TextPr.Caps&&true===TextPr.SmallCaps&&false===bCapitals)this.Flags|=PARATEXT_FLAGS_FONTKOEF_SMALLCAPS;else this.Flags&=PARATEXT_FLAGS_NON_FONTKOEF_SMALLCAPS;var Hint=TextPr.RFonts.Hint;var bCS=TextPr.CS;var bRTL=TextPr.RTL;var lcid=TextPr.Lang.EastAsia;var FontSlot=g_font_detector.Get_FontClass(ResultCharCode, Hint,lcid,bCS,bRTL);var Flags_0Byte=this.Flags>>0&255;var Flags_2Byte=this.Flags>>16&255;this.Flags=Flags_0Byte|(FontSlot&255)<<8|Flags_2Byte<<16;var FontKoef=1;if(this.Flags&PARATEXT_FLAGS_FONTKOEF_SCRIPT&&this.Flags&PARATEXT_FLAGS_FONTKOEF_SMALLCAPS)FontKoef=smallcaps_and_script_koef;else if(this.Flags&PARATEXT_FLAGS_FONTKOEF_SCRIPT)FontKoef=AscCommon.vaKSize;else if(this.Flags&PARATEXT_FLAGS_FONTKOEF_SMALLCAPS)FontKoef=smallcaps_Koef;var FontSize=TextPr.FontSize;if(1!==FontKoef)FontKoef=(FontSize* FontKoef*2+.5|0)/2/FontSize;Context.SetFontSlot(FontSlot,FontKoef);var Temp=Context.MeasureCode(ResultCharCode);var ResultWidth=Math.max(Temp.Width+TextPr.Spacing,0)*TEXTWIDTH_DIVIDER|0;this.Width=ResultWidth;this.WidthVisible=ResultWidth;if(this.LGap||this.RGap){delete this.LGap;delete this.RGap}};ParaText.prototype.Is_RealContent=function(){return true};ParaText.prototype.Can_AddNumbering=function(){return true};ParaText.prototype.Copy=function(){return new ParaText(this.Value)};ParaText.prototype.IsEqual= function(oElement){return oElement.Type===this.Type&&this.Value===oElement.Value};ParaText.prototype.Is_NBSP=function(){return this.Value===nbsp_charcode};ParaText.prototype.IsNBSP=function(){return this.Value===nbsp_charcode};ParaText.prototype.IsPunctuation=function(){return!!(undefined!==AscCommon.g_aPunctuation[this.Value])};ParaText.prototype.Is_Number=function(){if(1===g_aNumber[this.Value])return true;return false};ParaText.prototype.Is_SpecialSymbol=function(){if(1===g_aSpecialSymbols[this.Value])return true; return false};ParaText.prototype.IsSpaceAfter=function(){return this.Flags&PARATEXT_FLAGS_SPACEAFTER?true:false};ParaText.prototype.GetCharForSpellCheck=function(bCaps){if(8217===this.Value)return String.fromCharCode(39);else if(true===bCaps)return String.fromCharCode(this.Value).toUpperCase();else return String.fromCharCode(this.Value)};ParaText.prototype.Set_SpaceAfter=function(bSpaceAfter){if(bSpaceAfter)this.Flags|=PARATEXT_FLAGS_SPACEAFTER;else this.Flags&=PARATEXT_FLAGS_NON_SPACEAFTER};ParaText.prototype.IsNoBreakHyphen= function(){return false===this.IsSpaceAfter()&&this.Value===45};ParaText.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(para_Text);Writer.WriteLong(this.Value)};ParaText.prototype.Read_FromBinary=function(Reader){this.Set_CharCode(Reader.GetLong())};ParaText.prototype.private_IsSpaceAfter=function(){if(45===this.Value||8212===this.Value)return true;if(AscCommon.isEastAsianScript(this.Value)&&this.CanBeAtEndOfLine())return true;return false};ParaText.prototype.CanBeAtBeginOfLine=function(){if(this.Is_NBSP())return false; return!(AscCommon.g_aPunctuation[this.Value]&AscCommon.PUNCTUATION_FLAG_CANT_BE_AT_BEGIN)};ParaText.prototype.CanBeAtEndOfLine=function(){if(this.Is_NBSP())return false;return!(AscCommon.g_aPunctuation[this.Value]&AscCommon.PUNCTUATION_FLAG_CANT_BE_AT_END)};ParaText.prototype.CanStartAutoCorrect=function(){return 33===this.Value||34===this.Value||39===this.Value||45===this.Value||58===this.Value||59===this.Value||63===this.Value};ParaText.prototype.IsDiacriticalSymbol=function(){return!!(768<=this.Value&& this.Value<=879)};ParaText.prototype.IsDot=function(){return this.Value===46};ParaText.prototype.IsHyphen=function(){return this.Value===45};ParaText.prototype.SetGaps=function(nLeftGap,nRightGap){this.LGap=nLeftGap;this.RGap=nRightGap;this.Width+=(nLeftGap+nRightGap)*TEXTWIDTH_DIVIDER|0;this.WidthVisible+=(nLeftGap+nRightGap)*TEXTWIDTH_DIVIDER|0};ParaText.prototype.ResetGapBackground=function(){this.RGapCount=undefined;this.RGapCharCode=undefined;this.RGapCharWidth=undefined;this.RGapShift=undefined; this.RGapFontSlot=undefined;this.RGapFont=undefined};ParaText.prototype.SetGapBackground=function(nCount,nCharCode,nCombWidth,oContext,sFont,oTextPr,oTheme,nCombBorderW){this.RGapCount=nCount;this.RGapCharCode=nCharCode;this.RGapFontSlot=g_font_detector.Get_FontClass(nCharCode,oTextPr.RFonts.Hint,oTextPr.Lang.EastAsia,oTextPr.CS,oTextPr.RTL);if(sFont){this.RGapFont=sFont;var oCurTextPr=oTextPr.Copy();oCurTextPr.SetFontFamily(sFont);oContext.SetTextPr(oCurTextPr,oTheme);oContext.SetFontSlot(this.RGapFontSlot, oTextPr.Get_FontKoef())}this.RGapCharWidth=!nCharCode?nCombBorderW:Math.max(oContext.MeasureCode(nCharCode).Width+oTextPr.Spacing+nCombBorderW,nCombBorderW);this.RGapShift=Math.max(nCombWidth,this.RGapCharWidth);if(sFont)oContext.SetTextPr(oTextPr,oTheme)};ParaText.prototype.private_DrawGapsBackground=function(X,Y,oContext,PDSE,oTextPr){if(!this.RGapCharCode)return;if(this.RGapFont){var oCurTextPr=oTextPr.Copy();oCurTextPr.SetFontFamily(this.RGapFont);oContext.SetTextPr(oCurTextPr,PDSE.Theme);oContext.SetFontSlot(this.RGapFontSlot, oTextPr.Get_FontKoef())}if(this.RGap&&this.RGapCount){X+=this.Width/TEXTWIDTH_DIVIDER;var nShift=(this.RGapShift-this.RGapCharWidth)/2;for(var nIndex=0;nIndex<this.RGapCount;++nIndex){X-=nShift+this.RGapCharWidth;oContext.FillTextCode(X,Y,this.RGapCharCode);X-=nShift}}if(this.RGapFont)oContext.SetTextPr(oTextPr,PDSE.Theme)};function ParaSpace(nCharCode){CRunElementBase.call(this);this.Value=undefined!==nCharCode?nCharCode:32;this.Flags=0|0;this.Width=0|0;this.WidthVisible=0|0;this.WidthOrigin=0|0} ParaSpace.prototype=Object.create(CRunElementBase.prototype);ParaSpace.prototype.constructor=ParaSpace;ParaSpace.prototype.Type=para_Space;ParaSpace.prototype.Draw=function(X,Y,Context,PDSE,oTextPr){if(undefined!==editor&&editor.ShowParaMarks){if(undefined!==this.LGap){this.private_DrawGapsBackground(X,Y,Context,PDSE,oTextPr);X+=this.LGap}Context.SetFontSlot(fontslot_ASCII,this.Get_FontKoef());if(this.SpaceGap)X+=this.SpaceGap;if(8195===this.Value||8194===this.Value)Context.FillText(X,Y,String.fromCharCode(176)); else if(8197===this.Value)Context.FillText(X,Y,String.fromCharCode(124));else Context.FillText(X,Y,String.fromCharCode(183))}};ParaSpace.prototype.Measure=function(Context,TextPr){this.Set_FontKoef_Script(TextPr.VertAlign!==AscCommon.vertalign_Baseline);this.Set_FontKoef_SmallCaps(true!==TextPr.Caps&&true===TextPr.SmallCaps);var FontKoef=this.Get_FontKoef();var FontSize=TextPr.FontSize;if(1!==FontKoef)FontKoef=(FontSize*FontKoef*2+.5|0)/2/FontSize;Context.SetFontSlot(fontslot_ASCII,FontKoef);var Temp= Context.MeasureCode(this.Value).Width;var ResultWidth=Math.max(Temp+TextPr.Spacing,0)*16384|0;this.Width=ResultWidth;this.WidthOrigin=ResultWidth;if(8195===this.Value||8194===this.Value)this.SpaceGap=Math.max((Temp-Context.MeasureCode(176).Width)/2,0);else if(8197===this.Value)this.SpaceGap=(Temp-Context.MeasureCode(124).Width)/2;else if(undefined!==this.SpaceGap)this.SpaceGap=0;if(this.LGap||this.RGap){delete this.LGap;delete this.RGap}};ParaSpace.prototype.Get_FontKoef=function(){if(this.Flags& PARATEXT_FLAGS_FONTKOEF_SCRIPT&&this.Flags&PARATEXT_FLAGS_FONTKOEF_SMALLCAPS)return smallcaps_and_script_koef;else if(this.Flags&PARATEXT_FLAGS_FONTKOEF_SCRIPT)return AscCommon.vaKSize;else if(this.Flags&PARATEXT_FLAGS_FONTKOEF_SMALLCAPS)return smallcaps_Koef;else return 1};ParaSpace.prototype.Set_FontKoef_Script=function(bScript){if(bScript)this.Flags|=PARATEXT_FLAGS_FONTKOEF_SCRIPT;else this.Flags&=PARATEXT_FLAGS_NON_FONTKOEF_SCRIPT};ParaSpace.prototype.Set_FontKoef_SmallCaps=function(bSmallCaps){if(bSmallCaps)this.Flags|= PARATEXT_FLAGS_FONTKOEF_SMALLCAPS;else this.Flags&=PARATEXT_FLAGS_NON_FONTKOEF_SMALLCAPS};ParaSpace.prototype.Is_RealContent=function(){return true};ParaSpace.prototype.Can_AddNumbering=function(){return true};ParaSpace.prototype.Copy=function(){return new ParaSpace(this.Value)};ParaSpace.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(para_Space);Writer.WriteLong(this.Value)};ParaSpace.prototype.Read_FromBinary=function(Reader){this.Value=Reader.GetLong()};ParaSpace.prototype.CanStartAutoCorrect= function(){return true};ParaSpace.prototype.SetCondensedWidth=function(nKoef){this.Width=this.WidthOrigin*nKoef};ParaSpace.prototype.ResetCondensedWidth=function(){this.Width=this.WidthOrigin};ParaSpace.prototype.SetGaps=function(nLeftGap,nRightGap){this.LGap=nLeftGap;this.RGap=nRightGap;this.Width+=(nLeftGap+nRightGap)*TEXTWIDTH_DIVIDER|0;this.WidthOrigin+=(nLeftGap+nRightGap)*TEXTWIDTH_DIVIDER|0};ParaSpace.prototype.ResetGapBackground=ParaText.prototype.ResetGapBackground;ParaSpace.prototype.SetGapBackground= ParaText.prototype.SetGapBackground;ParaSpace.prototype.private_DrawGapsBackground=ParaText.prototype.private_DrawGapsBackground;function ParaSym(Char,FontFamily){CRunElementBase.call(this);this.FontFamily=FontFamily;this.Char=Char;this.FontSlot=fontslot_ASCII;this.FontKoef=1;this.Width=0;this.Height=0;this.WidthVisible=0}ParaSym.prototype=Object.create(CRunElementBase.prototype);ParaSym.prototype.constructor=ParaSym;ParaSym.prototype.Type=para_Sym;ParaSym.prototype.Draw=function(X,Y,Context,TextPr){var CurTextPr= TextPr.Copy();switch(this.FontSlot){case fontslot_ASCII:CurTextPr.RFonts.Ascii={Name:this.FontFamily,Index:-1};break;case fontslot_CS:CurTextPr.RFonts.CS={Name:this.FontFamily,Index:-1};break;case fontslot_EastAsia:CurTextPr.RFonts.EastAsia={Name:this.FontFamily,Index:-1};break;case fontslot_HAnsi:CurTextPr.RFonts.HAnsi={Name:this.FontFamily,Index:-1};break}Context.SetTextPr(CurTextPr);Context.SetFontSlot(this.FontSlot,this.FontKoef);Context.FillText(X,Y,String.fromCharCode(this.Char));Context.SetTextPr(TextPr)}; ParaSym.prototype.Measure=function(Context,TextPr){this.FontKoef=TextPr.Get_FontKoef();var Hint=TextPr.RFonts.Hint;var bCS=TextPr.CS;var bRTL=TextPr.RTL;var lcid=TextPr.Lang.EastAsia;this.FontSlot=g_font_detector.Get_FontClass(this.CalcValue.charCodeAt(0),Hint,lcid,bCS,bRTL);var CurTextPr=TextPr.Copy();switch(this.FontSlot){case fontslot_ASCII:CurTextPr.RFonts.Ascii={Name:this.FontFamily,Index:-1};break;case fontslot_CS:CurTextPr.RFonts.CS={Name:this.FontFamily,Index:-1};break;case fontslot_EastAsia:CurTextPr.RFonts.EastAsia= {Name:this.FontFamily,Index:-1};break;case fontslot_HAnsi:CurTextPr.RFonts.HAnsi={Name:this.FontFamily,Index:-1};break}Context.SetTextPr(CurTextPr);Context.SetFontSlot(this.FontSlot,this.FontKoef);var Temp=Context.Measure(this.CalcValue);Context.SetTextPr(TextPr);Temp.Width=Math.max(Temp.Width+TextPr.Spacing,0);this.Width=Temp.Width;this.Height=Temp.Height;this.WidthVisible=Temp.Width};ParaSym.prototype.Is_RealContent=function(){return true};ParaSym.prototype.Can_AddNumbering=function(){return true}; ParaSym.prototype.Copy=function(){return new ParaSym(this.Char,this.FontFamily)};ParaSym.prototype.IsEqual=function(oElement){return this.Type===oElement.Type&&this.Char===oElement.Char&&this.FontFamily===oElement.FontFamily};ParaSym.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type);Writer.WriteString2(this.FontFamily);Writer.WriteLong(this.Char)};ParaSym.prototype.Read_FromBinary=function(Reader){this.FontFamily=Reader.GetString2();this.Char=Reader.GetLong()};function ParaEnd(){CRunElementBase.call(this); this.SectionEnd=null;this.WidthVisible=0|0;this.Flags=0|0}ParaEnd.prototype=Object.create(CRunElementBase.prototype);ParaEnd.prototype.constructor=ParaEnd;ParaEnd.prototype.Type=para_End;ParaEnd.prototype.Draw=function(X,Y,Context,bEndCell,bForceDraw){if(undefined!==editor&&editor.ShowParaMarks||true===bForceDraw){var FontKoef=this.Flags&PARATEXT_FLAGS_FONTKOEF_SCRIPT?AscCommon.vaKSize:1;Context.SetFontSlot(fontslot_ASCII,FontKoef);if(this.SectionEnd)this.private_DrawSectionEnd(X,Y,Context);else if(true=== bEndCell)Context.FillText(X,Y,String.fromCharCode(164));else Context.FillText(X,Y,String.fromCharCode(182))}};ParaEnd.prototype.Measure=function(Context,oTextPr,bEndCell){var dFontKoef=1;if(oTextPr.VertAlign!==AscCommon.vertalign_Baseline){this.Flags|=PARATEXT_FLAGS_FONTKOEF_SCRIPT;dFontKoef=AscCommon.vaKSize}else this.Flags&=PARATEXT_FLAGS_NON_FONTKOEF_SCRIPT;Context.SetFontSlot(fontslot_ASCII,dFontKoef);if(true===bEndCell)this.WidthVisible=Context.Measure(String.fromCharCode(164)).Width*TEXTWIDTH_DIVIDER| 0;else this.WidthVisible=Context.Measure(String.fromCharCode(182)).Width*TEXTWIDTH_DIVIDER|0};ParaEnd.prototype.Get_Width=function(){return 0};ParaEnd.prototype.UpdateSectionEnd=function(nSectionType,nWidth,oLogicDocument){if(!oLogicDocument)return;var oPr=oLogicDocument.GetSectionEndMarkPr(nSectionType);var nStrWidth=oPr.StringWidth;var nSymWidth=oPr.ColonWidth;this.SectionEnd={String:null,ColonsCount:0,ColonWidth:nSymWidth,ColonSymbol:oPr.ColonSymbol,Widths:[]};if(nWidth-6*nSymWidth>=nStrWidth){this.SectionEnd.ColonsCount= parseInt((nWidth-nStrWidth)/(2*nSymWidth));this.SectionEnd.String=oPr.String;var nAdd=0;var nResultWidth=2*nSymWidth*this.SectionEnd.ColonsCount+nStrWidth;if(nResultWidth<nWidth){nAdd=(nWidth-nResultWidth)/(2*this.SectionEnd.ColonsCount+this.SectionEnd.Widths.length);this.SectionEnd.ColonWidth+=nAdd}for(var nPos=0,nLen=oPr.Widths.length;nPos<nLen;++nPos)this.SectionEnd.Widths[nPos]=oPr.Widths[nPos]+nAdd}else{this.SectionEnd.ColonsCount=parseInt(nWidth/nSymWidth);var nResultWidth=nSymWidth*this.SectionEnd.ColonsCount; if(nResultWidth<nWidth&&this.SectionEnd.ColonsCount>0)this.SectionEnd.ColonWidth+=(nWidth-nResultWidth)/this.SectionEnd.ColonsCount}this.WidthVisible=nWidth*TEXTWIDTH_DIVIDER|0};ParaEnd.prototype.ClearSectionEnd=function(){this.SectionEnd=null};ParaEnd.prototype.private_DrawSectionEnd=function(X,Y,Context){Context.b_color1(0,0,0,255);Context.p_color(0,0,0,255);Context.SetFont({FontFamily:{Name:"Courier New",Index:-1},FontSize:8,Italic:false,Bold:false});for(var nPos=0,nCount=this.SectionEnd.ColonsCount;nPos< nCount;++nPos){Context.FillTextCode(X,Y,this.SectionEnd.ColonSymbol);X+=this.SectionEnd.ColonWidth}if(this.SectionEnd.String){for(var nPos=0,nCount=this.SectionEnd.String.length;nPos<nCount;++nPos){Context.FillText(X,Y,this.SectionEnd.String[nPos]);X+=this.SectionEnd.Widths[nPos]}for(var nPos=0,nCount=this.SectionEnd.ColonsCount;nPos<nCount;++nPos){Context.FillTextCode(X,Y,this.SectionEnd.ColonSymbol);X+=this.SectionEnd.ColonWidth}}};ParaEnd.prototype.Is_RealContent=function(){return true};ParaEnd.prototype.Can_AddNumbering= function(){return true};ParaEnd.prototype.Copy=function(){return new ParaEnd};ParaEnd.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(para_End)};ParaEnd.prototype.Read_FromBinary=function(Reader){};function ParaNewLine(BreakType){CRunElementBase.call(this);this.BreakType=BreakType;this.Flags={};this.Flags.Use=true;if(break_Page===this.BreakType||break_Column===this.BreakType)this.Flags.NewLine=true;this.Height=0;this.Width=0;this.WidthVisible=0}ParaNewLine.prototype=Object.create(CRunElementBase.prototype); ParaNewLine.prototype.constructor=ParaNewLine;ParaNewLine.prototype.Type=para_NewLine;ParaNewLine.prototype.Draw=function(X,Y,Context){if(false===this.Flags.Use)return;if(undefined!==editor&&editor.ShowParaMarks)switch(this.BreakType){case break_Line:{Context.b_color1(0,0,0,255);Context.SetFont({FontFamily:{Name:"ASCW3",Index:-1},FontSize:10,Italic:false,Bold:false});Context.FillText(X,Y,String.fromCharCode(56));break}case break_Page:case break_Column:{var strPageBreak=this.Flags.BreakPageInfo.Str; var Widths=this.Flags.BreakPageInfo.Widths;Context.b_color1(0,0,0,255);Context.SetFont({FontFamily:{Name:"Courier New",Index:-1},FontSize:8,Italic:false,Bold:false});var Len=strPageBreak.length;for(var Index=0;Index<Len;Index++){Context.FillText(X,Y,strPageBreak[Index]);X+=Widths[Index]}break}}};ParaNewLine.prototype.Measure=function(Context){if(false===this.Flags.Use){this.Width=0;this.WidthVisible=0;this.Height=0;return}switch(this.BreakType){case break_Line:{this.Width=0;this.Height=0;Context.SetFont({FontFamily:{Name:"ASCW3", Index:-1},FontSize:10,Italic:false,Bold:false});var Temp=Context.Measure(String.fromCharCode(56));this.WidthVisible=Temp.Width*1.7;break}case break_Page:case break_Column:{this.Width=0;this.Height=0;break}}};ParaNewLine.prototype.Get_Width=function(){return this.Width};ParaNewLine.prototype.Get_WidthVisible=function(){return this.WidthVisible};ParaNewLine.prototype.Set_WidthVisible=function(WidthVisible){this.WidthVisible=WidthVisible};ParaNewLine.prototype.Update_String=function(_W){if(false===this.Flags.Use){this.Width= 0;this.WidthVisible=0;this.Height=0;return}if(break_Page===this.BreakType||break_Column===this.BreakType){var W=false===this.Flags.NewLine?50:Math.max(_W,50);g_oTextMeasurer.SetFont({FontFamily:{Name:"Courier New",Index:-1},FontSize:8,Italic:false,Bold:false});var Widths=[];var nStrWidth=0;var strBreakPage=break_Page===this.BreakType?" Page Break ":" Column Break ";var Len=strBreakPage.length;for(var Index=0;Index<Len;Index++){var Val=g_oTextMeasurer.Measure(strBreakPage[Index]).Width;nStrWidth+= Val;Widths[Index]=Val}var strSymbol=String.fromCharCode("0x00B7");var nSymWidth=g_oTextMeasurer.Measure(strSymbol).Width*2/3;var strResult="";if(W-6*nSymWidth>=nStrWidth){var Count=parseInt((W-nStrWidth)/(2*nSymWidth));var strResult=strBreakPage;for(var Index=0;Index<Count;Index++){strResult=strSymbol+strResult+strSymbol;Widths.splice(0,0,nSymWidth);Widths.splice(Widths.length,0,nSymWidth)}}else{var Count=parseInt(W/nSymWidth);for(var Index=0;Index<Count;Index++){strResult+=strSymbol;Widths[Index]= nSymWidth}}var ResultW=0;var Count=Widths.length;for(var Index=0;Index<Count;Index++)ResultW+=Widths[Index];var AddW=0;if(ResultW<W&&Count>1)AddW=(W-ResultW)/(Count-1);for(var Index=0;Index<Count-1;Index++)Widths[Index]+=AddW;this.Flags.BreakPageInfo={};this.Flags.BreakPageInfo.Str=strResult;this.Flags.BreakPageInfo.Widths=Widths;this.Width=W;this.WidthVisible=W}};ParaNewLine.prototype.Is_RealContent=function(){return true};ParaNewLine.prototype.Can_AddNumbering=function(){if(break_Line===this.BreakType)return true; return false};ParaNewLine.prototype.Copy=function(){return new ParaNewLine(this.BreakType)};ParaNewLine.prototype.IsEqual=function(oElement){return oElement.Type===this.Type&&this.BreakType===oElement.BreakType};ParaNewLine.prototype.Is_NewLine=function(){if(break_Line===this.BreakType||(break_Page===this.BreakType||break_Column===this.BreakType)&&true===this.Flags.NewLine)return true;return false};ParaNewLine.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(para_NewLine);Writer.WriteLong(this.BreakType); if(break_Page===this.BreakType||break_Column===this.BreakType)Writer.WriteBool(this.Flags.NewLine)};ParaNewLine.prototype.Read_FromBinary=function(Reader){this.BreakType=Reader.GetLong();if(break_Page===this.BreakType||break_Column===this.BreakType)this.Flags={NewLine:Reader.GetBool()}};ParaNewLine.prototype.IsPageOrColumnBreak=function(){return break_Page===this.BreakType||break_Column===this.BreakType};ParaNewLine.prototype.IsPageBreak=function(){return break_Page===this.BreakType};ParaNewLine.prototype.IsColumnBreak= function(){return break_Column===this.BreakType};ParaNewLine.prototype.IsLineBreak=function(){return break_Line===this.BreakType};function ParaNumbering(){CRunElementBase.call(this);this.Item=null;this.Run=null;this.Line=0;this.Range=0;this.Page=0;this.Internal={FinalNumInfo:undefined,FinalCalcValue:-1,FinalNumId:null,FinalNumLvl:-1,SourceNumInfo:undefined,SourceCalcValue:-1,SourceNumId:null,SourceNumLvl:-1,SourceWidth:0,Reset:function(){this.FinalNumInfo=undefined;this.FinalCalcValue=-1;this.FinalNumId= null;this.FinalNumLvl=-1;this.SourceNumInfo=undefined;this.SourceCalcValue=-1;this.SourceNumId=null;this.SourceNumLvl=-1;this.SourceWidth=0}}}ParaNumbering.prototype=Object.create(CRunElementBase.prototype);ParaNumbering.prototype.constructor=ParaNumbering;ParaNumbering.prototype.Type=para_Numbering;ParaNumbering.prototype.Draw=function(X,Y,oContext,oNumbering,oTextPr,oTheme,oPrevNumTextPr){var _X=X;if(this.Internal.SourceNumInfo){oNumbering.Draw(this.Internal.SourceNumId,this.Internal.SourceNumLvl, _X,Y,oContext,this.Internal.SourceNumInfo,oPrevNumTextPr?oPrevNumTextPr:oTextPr,oTheme);_X+=this.Internal.SourceWidth}if(this.Internal.FinalNumInfo)oNumbering.Draw(this.Internal.FinalNumId,this.Internal.FinalNumLvl,_X,Y,oContext,this.Internal.FinalNumInfo,oTextPr,oTheme)};ParaNumbering.prototype.Measure=function(oContext,oNumbering,oTextPr,oTheme,oFinalNumInfo,oFinalNumPr,oSourceNumInfo,oSourceNumPr){this.Width=0;this.Height=0;this.WidthVisible=0;this.WidthNum=0;this.WidthSuff=0;this.Internal.Reset(); if(!oNumbering)return{Width:this.Width,Height:this.Height,WidthVisible:this.WidthVisible};var nWidth=0,nAscent=0;if(oFinalNumInfo&&oFinalNumPr&&undefined!==oFinalNumInfo[oFinalNumPr.Lvl]){var oTemp=oNumbering.Measure(oFinalNumPr.NumId,oFinalNumPr.Lvl,oContext,oFinalNumInfo,oTextPr,oTheme);this.Internal.FinalNumInfo=oFinalNumInfo;this.Internal.FinalCalcValue=oFinalNumInfo[oFinalNumPr.Lvl];this.Internal.FinalNumId=oFinalNumPr.NumId;this.Internal.FinalNumLvl=oFinalNumPr.Lvl;nWidth=oTemp.Width;nAscent= oTemp.Ascent}if(oSourceNumInfo&&oSourceNumPr&&undefined!==oSourceNumInfo[oSourceNumPr.Lvl]){var oTemp=oNumbering.Measure(oSourceNumPr.NumId,oSourceNumPr.Lvl,oContext,oSourceNumInfo,oTextPr,oTheme);this.Internal.SourceNumInfo=oSourceNumInfo;this.Internal.SourceCalcValue=oSourceNumInfo[oSourceNumPr.Lvl];this.Internal.SourceNumId=oSourceNumPr.NumId;this.Internal.SourceNumLvl=oSourceNumPr.Lvl;this.Internal.SourceWidth=oTemp.Width;nWidth+=this.Internal.SourceWidth;if(nAscent<oTemp.Ascent)nAscent=oTemp.Ascent}this.Width= nWidth;this.WidthVisible=nWidth;this.WidthNum=nWidth;this.WidthSuff=0;this.Height=nAscent};ParaNumbering.prototype.Check_Range=function(Range,Line){if(null!==this.Item&&null!==this.Run&&Range===this.Range&&Line===this.Line)return true;return false};ParaNumbering.prototype.Is_RealContent=function(){return true};ParaNumbering.prototype.Can_AddNumbering=function(){return false};ParaNumbering.prototype.Copy=function(){return new ParaNumbering};ParaNumbering.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type)}; ParaNumbering.prototype.Read_FromBinary=function(Reader){};ParaNumbering.prototype.GetCalculatedValue=function(){return this.Internal.FinalCalcValue};ParaNumbering.prototype.HaveSourceNumbering=function(){return!!this.Internal.SourceNumInfo};ParaNumbering.prototype.HaveFinalNumbering=function(){return!!this.Internal.FinalNumInfo};ParaNumbering.prototype.GetSourceWidth=function(){return this.Internal.SourceWidth};var tab_Bar=Asc.c_oAscTabType.Bar;var tab_Center=Asc.c_oAscTabType.Center;var tab_Clear= Asc.c_oAscTabType.Clear;var tab_Decimal=Asc.c_oAscTabType.Decimail;var tab_Num=Asc.c_oAscTabType.Num;var tab_Right=Asc.c_oAscTabType.Right;var tab_Left=Asc.c_oAscTabType.Left;var tab_Symbol=34;function ParaTab(){CRunElementBase.call(this);this.Width=0;this.WidthVisible=0;this.RealWidth=0;this.DotWidth=0;this.UnderscoreWidth=0;this.HyphenWidth=0;this.Leader=Asc.c_oAscTabLeader.None}ParaTab.prototype=Object.create(CRunElementBase.prototype);ParaTab.prototype.constructor=ParaTab;ParaTab.prototype.Type= para_Tab;ParaTab.prototype.Draw=function(X,Y,Context){if(this.WidthVisible>.01){var sChar=null,nCharWidth=0;switch(this.Leader){case Asc.c_oAscTabLeader.Dot:sChar=".";nCharWidth=this.DotWidth;break;case Asc.c_oAscTabLeader.Heavy:case Asc.c_oAscTabLeader.Underscore:sChar="_";nCharWidth=this.UnderscoreWidth;break;case Asc.c_oAscTabLeader.Hyphen:sChar="-";nCharWidth=this.HyphenWidth;break;case Asc.c_oAscTabLeader.MiddleDot:sChar="\u00b7";nCharWidth=this.MiddleDotWidth;break}if(null!==sChar&&nCharWidth> .001){Context.SetFontSlot(fontslot_ASCII,1);var nCharsCount=Math.floor(this.WidthVisible/nCharWidth);var _X=X+(this.WidthVisible-nCharsCount*nCharWidth)/2;for(var nIndex=0;nIndex<nCharsCount;++nIndex,_X+=nCharWidth)Context.FillText(_X,Y,sChar)}}if(editor&&editor.ShowParaMarks){Context.p_color(0,0,0,255);Context.b_color1(0,0,0,255);var X0=this.Width/2-this.RealWidth/2;Context.SetFont({FontFamily:{Name:"ASCW3",Index:-1},FontSize:10,Italic:false,Bold:false});if(X0>0)Context.FillText2(X+X0,Y,String.fromCharCode(tab_Symbol), 0,this.Width);else Context.FillText2(X,Y,String.fromCharCode(tab_Symbol),this.RealWidth-this.Width,this.Width)}};ParaTab.prototype.Measure=function(Context){this.DotWidth=Context.Measure(".").Width;this.UnderscoreWidth=Context.Measure("_").Width;this.HyphenWidth=Context.Measure("-").Width*1.5;this.MiddleDotWidth=Context.Measure("\u00b7").Width;Context.SetFont({FontFamily:{Name:"ASCW3",Index:-1},FontSize:10,Italic:false,Bold:false});this.RealWidth=Context.Measure(String.fromCharCode(tab_Symbol)).Width}; ParaTab.prototype.SetLeader=function(nLeaderType){this.Leader=nLeaderType};ParaTab.prototype.Get_Width=function(){return this.Width};ParaTab.prototype.Get_WidthVisible=function(){return this.WidthVisible};ParaTab.prototype.Set_WidthVisible=function(WidthVisible){this.WidthVisible=WidthVisible};ParaTab.prototype.Copy=function(){return new ParaTab};function ParaPageNum(){CRunElementBase.call(this);this.FontKoef=1;this.NumWidths=[];this.Widths=[];this.String=[];this.Width=0;this.WidthVisible=0;this.Parent= null}ParaPageNum.prototype=Object.create(CRunElementBase.prototype);ParaPageNum.prototype.constructor=ParaPageNum;ParaPageNum.prototype.Type=para_PageNum;ParaPageNum.prototype.Draw=function(X,Y,Context){var Len=this.String.length;var _X=X;var _Y=Y;Context.SetFontSlot(fontslot_ASCII,this.FontKoef);for(var Index=0;Index<Len;Index++){var Char=this.String.charAt(Index);Context.FillText(_X,_Y,Char);_X+=this.Widths[Index]}};ParaPageNum.prototype.Measure=function(Context,TextPr){this.FontKoef=TextPr.Get_FontKoef(); Context.SetFontSlot(fontslot_ASCII,this.FontKoef);for(var Index=0;Index<10;Index++)this.NumWidths[Index]=Context.Measure(""+Index).Width;this.Width=0;this.Height=0;this.WidthVisible=0};ParaPageNum.prototype.Get_Width=function(){return this.Width};ParaPageNum.prototype.Get_WidthVisible=function(){return this.WidthVisible};ParaPageNum.prototype.Set_WidthVisible=function(WidthVisible){this.WidthVisible=WidthVisible};ParaPageNum.prototype.Set_Page=function(PageNum){this.String=""+PageNum;var Len=this.String.length; var RealWidth=0;for(var Index=0;Index<Len;Index++){var Char=parseInt(this.String.charAt(Index));this.Widths[Index]=this.NumWidths[Char];RealWidth+=this.NumWidths[Char]}this.Width=RealWidth;this.WidthVisible=RealWidth};ParaPageNum.prototype.SaveRecalculateObject=function(Copy){return new CPageNumRecalculateObject(this.Type,this.Widths,this.String,this.Width,Copy)};ParaPageNum.prototype.LoadRecalculateObject=function(RecalcObj){this.Widths=RecalcObj.Widths;this.String=RecalcObj.String;this.Width=RecalcObj.Width; this.WidthVisible=this.Width};ParaPageNum.prototype.PrepareRecalculateObject=function(){this.Widths=[];this.String=""};ParaPageNum.prototype.Document_CreateFontCharMap=function(FontCharMap){var sValue="1234567890";for(var Index=0;Index<sValue.length;Index++){var Char=sValue.charAt(Index);FontCharMap.AddChar(Char)}};ParaPageNum.prototype.Is_RealContent=function(){return true};ParaPageNum.prototype.Can_AddNumbering=function(){return true};ParaPageNum.prototype.Copy=function(){return new ParaPageNum}; ParaPageNum.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(para_PageNum)};ParaPageNum.prototype.Read_FromBinary=function(Reader){};ParaPageNum.prototype.GetPageNumValue=function(){var nPageNum=parseInt(this.String);if(isNaN(nPageNum))return 1;return nPageNum};ParaPageNum.prototype.GetType=function(){return this.Type};ParaPageNum.prototype.SetParent=function(oParent){this.Parent=oParent};ParaPageNum.prototype.GetParent=function(){return this.Parent};function CPageNumRecalculateObject(Type, Widths,String,Width,Copy){this.Type=Type;this.Widths=Widths;this.String=String;this.Width=Width;if(true===Copy){this.Widths=[];var Len=Widths.length;for(var Index=0;Index<Len;Index++)this.Widths[Index]=Widths[Index]}}function ParaPresentationNumbering(){CRunElementBase.call(this);this.Bullet=null;this.BulletNum=null}ParaPresentationNumbering.prototype=Object.create(CRunElementBase.prototype);ParaPresentationNumbering.prototype.constructor=ParaPresentationNumbering;ParaPresentationNumbering.prototype.Type= para_PresentationNumbering;ParaPresentationNumbering.prototype.Draw=function(X,Y,Context,PDSE){this.Bullet.Draw(X,Y,Context,PDSE)};ParaPresentationNumbering.prototype.Measure=function(Context,FirstTextPr,Theme){this.Width=0;this.Height=0;this.WidthVisible=0;var Temp=this.Bullet.Measure(Context,FirstTextPr,this.BulletNum,Theme);this.Width=Temp.Width;this.WidthVisible=Temp.Width};ParaPresentationNumbering.prototype.Is_RealContent=function(){return true};ParaPresentationNumbering.prototype.Can_AddNumbering= function(){return false};ParaPresentationNumbering.prototype.Copy=function(){return new ParaPresentationNumbering};ParaPresentationNumbering.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type)};ParaPresentationNumbering.prototype.Read_FromBinary=function(Reader){};ParaPresentationNumbering.prototype.Check_Range=function(Range,Line){if(null!==this.Item&&null!==this.Run&&Range===this.Range&&Line===this.Line)return true;return false};function ParaFootnoteReference(Footnote,CustomMark){this.Footnote= Footnote instanceof AscCommonWord.CFootEndnote?Footnote:null;this.CustomMark=CustomMark?CustomMark:undefined;this.Width=0;this.WidthVisible=0;this.Number=1;this.NumFormat=Asc.c_oAscNumberingFormat.Decimal;this.Run=null;this.Widths=[];if(this.Footnote)this.Footnote.SetRef(this)}ParaFootnoteReference.prototype=Object.create(CRunElementBase.prototype);ParaFootnoteReference.prototype.constructor=ParaFootnoteReference;ParaFootnoteReference.prototype.Type=para_FootnoteReference;ParaFootnoteReference.prototype.Get_Type= function(){return para_FootnoteReference};ParaFootnoteReference.prototype.Draw=function(X,Y,Context,PDSE){if(true===this.IsCustomMarkFollows())return;var TextPr=this.Run.Get_CompiledPr(false);var FontKoef=1;if(TextPr.VertAlign!==AscCommon.vertalign_Baseline)FontKoef=AscCommon.vaKSize;Context.SetFontSlot(fontslot_ASCII,FontKoef);var _X=X;var T=this.private_GetString();if(this.Widths.length!==T.length)return;for(var nPos=0;nPos<T.length;++nPos){var Char=T.charAt(nPos);Context.FillText(_X,Y,Char);_X+= this.Widths[nPos]}if(editor&&editor.ShowParaMarks&&Context.DrawFootnoteRect&&this.Run){var TextAscent=this.Run.TextAscent;Context.p_color(0,0,0,255);Context.DrawFootnoteRect(X,PDSE.BaseLine-TextAscent,this.Get_Width(),TextAscent)}};ParaFootnoteReference.prototype.Measure=function(Context,TextPr,MathInfo,Run){this.Run=Run;this.private_Measure()};ParaFootnoteReference.prototype.Copy=function(oPr){if(this.Footnote){var oFootnote;if(oPr&&oPr.Comparison)oFootnote=oPr.Comparison.createFootNote();else oFootnote= this.Footnote.Parent.CreateFootnote();oFootnote.Copy2(this.Footnote,oPr)}var oRef=new ParaFootnoteReference(oFootnote);oRef.Number=this.Number;oRef.NumFormat=this.NumFormat;return oRef};ParaFootnoteReference.prototype.IsEqual=function(oElement){return oElement.Type===this.Type&&this.Footnote===oElement.Footnote&&oElement.CustomMark===this.CustomMark};ParaFootnoteReference.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type);Writer.WriteString2(this.Footnote?this.Footnote.GetId(): "");if(undefined===this.CustomMark)Writer.WriteBool(true);else{Writer.WriteBool(false);Writer.WriteString2(this.CustomMark)}};ParaFootnoteReference.prototype.Read_FromBinary=function(Reader){this.Footnote=g_oTableId.Get_ById(Reader.GetString2());if(false===Reader.GetBool())this.CustomMark=Reader.GetString2()};ParaFootnoteReference.prototype.GetFootnote=function(){return this.Footnote};ParaFootnoteReference.prototype.UpdateNumber=function(PRS,isKeepNumber){if(this.Footnote&&true!==PRS.IsFastRecalculate()&& PRS.TopDocument instanceof CDocument){var nPageAbs=PRS.GetPageAbs();var nColumnAbs=PRS.GetColumnAbs();var nAdditional=PRS.GetFootnoteReferencesCount(this);var oSectPr=PRS.GetSectPr();var nNumFormat=oSectPr.GetFootnoteNumFormat();var oLogicDocument=this.Footnote.Get_LogicDocument();var oFootnotesController=oLogicDocument.GetFootnotesController();if(!isKeepNumber){this.NumFormat=nNumFormat;this.Number=oFootnotesController.GetFootnoteNumberOnPage(nPageAbs,nColumnAbs,oSectPr)+nAdditional;if(this.IsCustomMarkFollows())this.Number--}this.private_Measure(); this.Footnote.SetNumber(this.Number,oSectPr,this.IsCustomMarkFollows())}else{this.Number=1;this.NumFormat=Asc.c_oAscNumberingFormat.Decimal;this.private_Measure()}};ParaFootnoteReference.prototype.private_Measure=function(){if(!this.Run)return;if(this.IsCustomMarkFollows()){this.Width=0;this.WidthVisible=0;return}var oMeasurer=g_oTextMeasurer;var TextPr=this.Run.Get_CompiledPr(false);var Theme=this.Run.GetParagraph().Get_Theme();var FontKoef=1;if(TextPr.VertAlign!==AscCommon.vertalign_Baseline)FontKoef= AscCommon.vaKSize;oMeasurer.SetTextPr(TextPr,Theme);oMeasurer.SetFontSlot(fontslot_ASCII,FontKoef);var X=0;var T=this.private_GetString();this.Widths=[];for(var nPos=0;nPos<T.length;++nPos){var Char=T.charAt(nPos);var CharW=oMeasurer.Measure(Char).Width;this.Widths.push(CharW);X+=CharW}var ResultWidth=Math.max(X+TextPr.Spacing,0)*TEXTWIDTH_DIVIDER|0;this.Width=ResultWidth;this.WidthVisible=ResultWidth};ParaFootnoteReference.prototype.private_GetString=function(){if(Asc.c_oAscNumberingFormat.Decimal=== this.NumFormat)return Numbering_Number_To_String(this.Number);if(Asc.c_oAscNumberingFormat.LowerRoman===this.NumFormat)return Numbering_Number_To_Roman(this.Number,true);else if(Asc.c_oAscNumberingFormat.UpperRoman===this.NumFormat)return Numbering_Number_To_Roman(this.Number,false);else if(Asc.c_oAscNumberingFormat.LowerLetter===this.NumFormat)return Numbering_Number_To_Alpha(this.Number,true);else if(Asc.c_oAscNumberingFormat.UpperLetter===this.NumFormat)return Numbering_Number_To_Alpha(this.Number, false);else return Numbering_Number_To_String(this.Number)};ParaFootnoteReference.prototype.IsCustomMarkFollows=function(){return undefined!==this.CustomMark?true:false};ParaFootnoteReference.prototype.GetCustomText=function(){return this.CustomMark};ParaFootnoteReference.prototype.CreateDocumentFontMap=function(FontMap){if(this.Footnote)this.Footnote.Document_CreateFontMap(FontMap)};ParaFootnoteReference.prototype.GetAllContentControls=function(arrContentControls){if(this.Footnote)this.Footnote.GetAllContentControls(arrContentControls)}; ParaFootnoteReference.prototype.GetAllFontNames=function(arrAllFonts){if(this.Footnote)this.Footnote.Document_Get_AllFontNames(arrAllFonts)};ParaFootnoteReference.prototype.SetParent=function(oRun){this.Run=oRun};ParaFootnoteReference.prototype.GetRun=function(){return this.Run};function ParaFootnoteRef(Footnote){ParaFootnoteReference.call(this,Footnote)}ParaFootnoteRef.prototype=Object.create(ParaFootnoteReference.prototype);ParaFootnoteRef.prototype.constructor=ParaFootnoteRef;ParaFootnoteRef.prototype.Type= para_FootnoteRef;ParaFootnoteRef.prototype.Get_Type=function(){return para_FootnoteRef};ParaFootnoteRef.prototype.Copy=function(oPr){var oFootnote=this.GetFootnote();var oParagraph,oParent,oTopDocument;if(oPr&&oPr.Paragraph){oParagraph=oPr.Paragraph;oParent=oParagraph.GetParent();if(oParent){oTopDocument=oParent.GetTopDocumentContent();if(oTopDocument&&oTopDocument instanceof CFootEndnote)oFootnote=oTopDocument}}return new ParaFootnoteRef(oFootnote)};ParaFootnoteRef.prototype.UpdateNumber=function(oFootnote){this.Footnote= oFootnote;if(this.Footnote&&this.Footnote instanceof CFootEndnote){this.Number=this.Footnote.GetNumber();this.NumFormat=this.Footnote.GetReferenceSectPr().GetFootnoteNumFormat();this.private_Measure()}else{this.Number=1;this.NumFormat=Asc.c_oAscNumberingFormat.Decimal;this.private_Measure()}};function ParaSeparator(){CRunElementBase.call(this);this.LineW=0}ParaSeparator.prototype=Object.create(CRunElementBase.prototype);ParaSeparator.prototype.constructor=ParaSeparator;ParaSeparator.prototype.Type= para_Separator;ParaSeparator.prototype.Get_Type=function(){return para_Separator};ParaSeparator.prototype.Draw=function(X,Y,Context,PDSE){var l=X,t=PDSE.LineTop,r=X+this.Get_Width(),b=PDSE.BaseLine;Context.p_color(0,0,0,255);Context.drawHorLineExt(c_oAscLineDrawingRule.Center,(t+b)/2,l,r,this.LineW,0,0);if(editor&&editor.ShowParaMarks&&Context.DrawFootnoteRect)Context.DrawFootnoteRect(X,PDSE.LineTop,this.Get_Width(),PDSE.BaseLine-PDSE.LineTop)};ParaSeparator.prototype.Measure=function(Context,TextPr){this.Width= 50*TEXTWIDTH_DIVIDER|0;this.WidthVisible=50*TEXTWIDTH_DIVIDER|0;this.LineW=TextPr.FontSize/18*g_dKoef_pt_to_mm};ParaSeparator.prototype.Copy=function(){return new ParaSeparator};ParaSeparator.prototype.UpdateWidth=function(PRS){var oPara=PRS.Paragraph;var nCurPage=PRS.Page;oPara.Parent.Update_ContentIndexing();var oLimits=oPara.Parent.Get_PageContentStartPos2(oPara.PageNum,oPara.ColumnNum,nCurPage,oPara.Index);var nWidth=Math.min(50,oLimits.XLimit-oLimits.X)*TEXTWIDTH_DIVIDER|0;this.Width=nWidth; this.WidthVisible=nWidth};ParaSeparator.prototype.SaveRecalculateObject=function(isCopy){return{Width:this.Width}};ParaSeparator.prototype.LoadRecalculateObject=function(oRecalcObj){this.Width=oRecalcObj.Width;this.WidthVisible=oRecalcObj.Width};ParaSeparator.PrepareRecalculateObject=function(){};function ParaContinuationSeparator(){CRunElementBase.call(this);this.LineW=0}ParaContinuationSeparator.prototype=Object.create(CRunElementBase.prototype);ParaContinuationSeparator.prototype.constructor=ParaContinuationSeparator; ParaContinuationSeparator.prototype.Type=para_ContinuationSeparator;ParaContinuationSeparator.prototype.Get_Type=function(){return para_ContinuationSeparator};ParaContinuationSeparator.prototype.Draw=function(X,Y,Context,PDSE){var l=X,t=PDSE.LineTop,r=X+this.Get_Width(),b=PDSE.BaseLine;Context.p_color(0,0,0,255);Context.drawHorLineExt(c_oAscLineDrawingRule.Center,(t+b)/2,l,r,this.LineW,0,0);if(editor&&editor.ShowParaMarks&&Context.DrawFootnoteRect)Context.DrawFootnoteRect(X,PDSE.LineTop,this.Get_Width(), PDSE.BaseLine-PDSE.LineTop)};ParaContinuationSeparator.prototype.Measure=function(Context,TextPr){this.Width=50*TEXTWIDTH_DIVIDER|0;this.WidthVisible=50*TEXTWIDTH_DIVIDER|0;this.LineW=TextPr.FontSize/18*g_dKoef_pt_to_mm};ParaContinuationSeparator.prototype.Copy=function(){return new ParaContinuationSeparator};ParaContinuationSeparator.prototype.UpdateWidth=function(PRS){var oPara=PRS.Paragraph;var nCurPage=PRS.Page;oPara.Parent.Update_ContentIndexing();var oLimits=oPara.Parent.Get_PageContentStartPos2(oPara.PageNum, oPara.ColumnNum,nCurPage,oPara.Index);var nWidth=Math.max(oLimits.XLimit-PRS.X,50)*TEXTWIDTH_DIVIDER|0;this.Width=nWidth;this.WidthVisible=nWidth};ParaContinuationSeparator.prototype.SaveRecalculateObject=function(isCopy){return{Width:this.Width}};ParaContinuationSeparator.prototype.LoadRecalculateObject=function(oRecalcObj){this.Width=oRecalcObj.Width;this.WidthVisible=oRecalcObj.Width};ParaContinuationSeparator.PrepareRecalculateObject=function(){};function ParaPageCount(PageCount){CRunElementBase.call(this); this.FontKoef=1;this.NumWidths=[];this.Widths=[];this.String="";this.PageCount=undefined!==PageCount?PageCount:1;this.Parent=null}ParaPageCount.prototype=Object.create(CRunElementBase.prototype);ParaPageCount.prototype.constructor=ParaPageCount;ParaPageCount.prototype.Type=para_PageCount;ParaPageCount.prototype.Copy=function(){return new ParaPageCount};ParaPageCount.prototype.Is_RealContent=function(){return true};ParaPageCount.prototype.Can_AddNumbering=function(){return true};ParaPageCount.prototype.Measure= function(Context,TextPr){this.FontKoef=TextPr.Get_FontKoef();Context.SetFontSlot(fontslot_ASCII,this.FontKoef);for(var Index=0;Index<10;Index++)this.NumWidths[Index]=Context.Measure(""+Index).Width;this.private_UpdateWidth()};ParaPageCount.prototype.Draw=function(X,Y,Context){var Len=this.String.length;var _X=X;var _Y=Y;Context.SetFontSlot(fontslot_ASCII,this.FontKoef);for(var Index=0;Index<Len;Index++){var Char=this.String.charAt(Index);Context.FillText(_X,_Y,Char);_X+=this.Widths[Index]}};ParaPageCount.prototype.Document_CreateFontCharMap= function(FontCharMap){var sValue="1234567890";for(var Index=0;Index<sValue.length;Index++){var Char=sValue.charAt(Index);FontCharMap.AddChar(Char)}};ParaPageCount.prototype.Update_PageCount=function(nPageCount){this.PageCount=nPageCount;this.private_UpdateWidth()};ParaPageCount.prototype.SetNumValue=function(nValue){this.Update_PageCount(nValue)};ParaPageCount.prototype.private_UpdateWidth=function(){this.String=""+this.PageCount;var RealWidth=0;for(var Index=0,Len=this.String.length;Index<Len;Index++){var Char= parseInt(this.String.charAt(Index));this.Widths[Index]=this.NumWidths[Char];RealWidth+=this.NumWidths[Char]}RealWidth=RealWidth*TEXTWIDTH_DIVIDER|0;this.Width=RealWidth;this.WidthVisible=RealWidth};ParaPageCount.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type);Writer.WriteLong(this.PageCount)};ParaPageCount.prototype.Read_FromBinary=function(Reader){this.PageCount=Reader.GetLong()};ParaPageCount.prototype.GetPageCountValue=function(){return this.PageCount};ParaPageCount.prototype.SetParent= function(oParent){this.Parent=oParent};ParaPageCount.prototype.GetParent=function(){return this.Parent};function ParaEndnoteReference(oEndnote,sCustomMark){ParaFootnoteReference.call(this,oEndnote,sCustomMark)}ParaEndnoteReference.prototype=Object.create(ParaFootnoteReference.prototype);ParaEndnoteReference.prototype.constructor=ParaEndnoteReference;ParaEndnoteReference.prototype.Type=para_EndnoteReference;ParaEndnoteReference.prototype.Get_Type=function(){return para_EndnoteReference};ParaEndnoteReference.prototype.Copy= function(oPr){if(this.Footnote){var oEndnote;if(oPr&&oPr.Comparison)oEndnote=oPr.Comparison.createEndNote();else oEndnote=this.Footnote.Parent.CreateEndnote();oEndnote.Copy2(this.Footnote,oPr)}var oRef=new ParaEndnoteReference(oEndnote);oRef.Number=this.Number;oRef.NumFormat=this.NumFormat;return oRef};ParaEndnoteReference.prototype.UpdateNumber=function(PRS,isKeepNumber){if(this.Footnote&&true!==PRS.IsFastRecalculate()&&PRS.TopDocument instanceof CDocument){var nPageAbs=PRS.GetPageAbs();var nColumnAbs= PRS.GetColumnAbs();var nNumber=PRS.GetEndnoteReferenceNumber(this);var oSectPr=PRS.GetSectPr();var nNumFormat=oSectPr.GetEndnoteNumFormat();var oLogicDocument=this.Footnote.GetLogicDocument();var oEndnotesController=oLogicDocument.GetEndnotesController();if(!isKeepNumber){this.NumFormat=nNumFormat;this.Number=-1===nNumber?oEndnotesController.GetEndnoteNumberOnPage(nPageAbs,nColumnAbs,oSectPr,this.Footnote):nNumber;if(this.IsCustomMarkFollows())this.Number--}this.private_Measure();this.Footnote.SetNumber(this.Number, oSectPr,this.IsCustomMarkFollows())}else{this.Number=1;this.NumFormat=Asc.c_oAscNumberingFormat.Decimal;this.private_Measure()}};function ParaEndnoteRef(oEndnote){ParaEndnoteReference.call(this,oEndnote)}ParaEndnoteRef.prototype=Object.create(ParaEndnoteReference.prototype);ParaEndnoteRef.prototype.constructor=ParaEndnoteRef;ParaEndnoteRef.prototype.Type=para_EndnoteRef;ParaEndnoteRef.prototype.Get_Type=function(){return para_EndnoteRef};ParaEndnoteRef.prototype.Copy=function(oPr){var oEndNote=this.GetFootnote(); var oParagraph,oParent,oTopDocument;if(oPr&&oPr.Paragraph){oParagraph=oPr.Paragraph;oParent=oParagraph.GetParent();if(oParent){oTopDocument=oParent.GetTopDocumentContent();if(oTopDocument&&oTopDocument instanceof CFootEndnote)oEndNote=oTopDocument}}return new ParaEndnoteRef(oEndNote)};ParaEndnoteRef.prototype.UpdateNumber=function(oEndnote){this.Footnote=oEndnote;if(this.Footnote&&this.Footnote instanceof CFootEndnote){this.Number=this.Footnote.GetNumber();this.NumFormat=this.Footnote.GetReferenceSectPr().GetEndnoteNumFormat(); this.private_Measure()}else{this.Number=1;this.NumFormat=Asc.c_oAscNumberingFormat.Decimal;this.private_Measure()}};function ParagraphContent_Read_FromBinary(Reader){var ElementType=Reader.GetLong();var Element=null;switch(ElementType){case para_TextPr:case para_Drawing:case para_HyperlinkStart:case para_InlineLevelSdt:case para_Bookmark:{var ElementId=Reader.GetString2();Element=g_oTableId.Get_ById(ElementId);return Element}case para_RunBase:Element=new CRunElementBase;break;case para_Text:Element= new ParaText;break;case para_Space:Element=new ParaSpace;break;case para_End:Element=new ParaEnd;break;case para_NewLine:Element=new ParaNewLine;break;case para_Numbering:Element=new ParaNumbering;break;case para_Tab:Element=new ParaTab;break;case para_PageNum:Element=new ParaPageNum;break;case para_Math_Placeholder:Element=new CMathText;break;case para_Math_Text:Element=new CMathText;break;case para_Math_BreakOperator:Element=new CMathText;break;case para_Math_Ampersand:Element=new CMathAmp;break; case para_PresentationNumbering:Element=new ParaPresentationNumbering;break;case para_FootnoteReference:Element=new ParaFootnoteReference;break;case para_FootnoteRef:Element=new ParaFootnoteRef;break;case para_Separator:Element=new ParaSeparator;break;case para_ContinuationSeparator:Element=new ParaContinuationSeparator;break;case para_PageCount:Element=new ParaPageCount;break;case para_FieldChar:Element=new ParaFieldChar;break;case para_InstrText:Element=new ParaInstrText;break;case para_RevisionMove:Element= new CRunRevisionMove;break;case para_EndnoteReference:Element=new ParaEndnoteReference;break;case para_EndnoteRef:Element=new ParaEndnoteRef;break}if(null!=Element)Element.Read_FromBinary(Reader);return Element}window["AscCommonWord"]=window["AscCommonWord"]||{};window["AscCommonWord"].ParaNewLine=ParaNewLine;window["AscCommonWord"].ParaText=ParaText;window["AscCommonWord"].ParaSpace=ParaSpace;window["AscCommonWord"].ParaPageNum=ParaPageNum;window["AscCommonWord"].ParaPageCount=ParaPageCount;window["AscCommonWord"].break_Line= break_Line;window["AscCommonWord"].break_Page=break_Page;window["AscCommonWord"].break_Column=break_Column;"use strict";function ParaTextPr(oProps){CRunElementBase.call(this);this.Id=AscCommon.g_oIdCounter.Get_NewId();this.Type=para_TextPr;this.Value=new CTextPr;this.Parent=null;this.CalcValue=this.Value;this.Width=0;this.Height=0;this.WidthVisible=0;if(oProps)this.Value.Set_FromObject(oProps);g_oTableId.Add(this,this.Id)}ParaTextPr.prototype=Object.create(CRunElementBase.prototype);ParaTextPr.prototype.constructor= ParaTextPr;ParaTextPr.prototype.Type=para_TextPr;ParaTextPr.prototype.Get_Type=function(){return this.Type};ParaTextPr.prototype.Copy=function(){var ParaTextPr_new=new ParaTextPr;ParaTextPr_new.Set_Value(this.Value);return ParaTextPr_new};ParaTextPr.prototype.Is_RealContent=function(){return true};ParaTextPr.prototype.Can_AddNumbering=function(){return false};ParaTextPr.prototype.Get_Id=function(){return this.Id};ParaTextPr.prototype.GetParagraph=function(){if(this.Parent instanceof Paragraph)return this.Parent; return null};ParaTextPr.prototype.IsParagraphSimpleChanges=function(){return true};ParaTextPr.prototype.Apply_TextPr=function(TextPr){if(undefined!==TextPr.Bold)this.Set_Bold(TextPr.Bold);if(undefined!==TextPr.Italic)this.Set_Italic(TextPr.Italic);if(undefined!==TextPr.Strikeout)this.Set_Strikeout(TextPr.Strikeout);if(undefined!==TextPr.Underline)this.Set_Underline(TextPr.Underline);if(undefined!==TextPr.FontSize)this.Set_FontSize(TextPr.FontSize);if(undefined!==TextPr.FontSizeCS)this.Set_FontSizeCS(TextPr.FontSizeCS); if(undefined!==TextPr.Color){this.Set_Color(TextPr.Color);if(undefined!==this.Value.Unifill)this.Set_Unifill(undefined);if(undefined!==this.Value.TextFill)this.Set_TextFill(undefined)}if(undefined!==TextPr.VertAlign)this.Set_VertAlign(TextPr.VertAlign);if(undefined!==TextPr.HighLight)this.Set_HighLight(TextPr.HighLight);if(undefined!==TextPr.RStyle)this.Set_RStyle(TextPr.RStyle);if(undefined!==TextPr.Spacing)this.Set_Spacing(TextPr.Spacing);if(undefined!==TextPr.DStrikeout)this.Set_DStrikeout(TextPr.DStrikeout); if(undefined!==TextPr.Caps)this.Set_Caps(TextPr.Caps);if(undefined!==TextPr.SmallCaps)this.Set_SmallCaps(TextPr.SmallCaps);if(undefined!==TextPr.Position)this.Set_Position(TextPr.Position);if(undefined!=TextPr.RFonts)this.Set_RFonts2(TextPr.RFonts);if(undefined!=TextPr.Lang)this.Set_Lang(TextPr.Lang);if(undefined!=TextPr.Unifill){this.Set_Unifill(TextPr.Unifill.createDuplicate());if(undefined!=this.Value.Color)this.Set_Color(undefined);if(undefined!=this.Value.TextFill)this.Set_TextFill(undefined)}if(undefined!= TextPr.TextOutline)this.Set_TextOutline(TextPr.TextOutline);if(undefined!=TextPr.TextFill){this.Set_TextFill(TextPr.TextFill);if(undefined!=this.Value.Color)this.Set_Color(undefined);if(undefined!=this.Value.Unifill)this.Set_Unifill(undefined)}};ParaTextPr.prototype.Clear_Style=function(){if(undefined!=this.Value.Bold)this.Set_Bold(undefined);if(undefined!=this.Value.Italic)this.Set_Italic(undefined);if(undefined!=this.Value.Strikeout)this.Set_Strikeout(undefined);if(undefined!=this.Value.Underline)this.Set_Underline(undefined); if(undefined!=this.Value.FontSize)this.Set_FontSize(undefined);if(undefined!=this.Value.Color)this.Set_Color(undefined);if(undefined!=this.Value.Unifill)this.Set_Unifill(undefined);if(undefined!=this.Value.VertAlign)this.Set_VertAlign(undefined);if(undefined!=this.Value.HighLight)this.Set_HighLight(undefined);if(undefined!=this.Value.RStyle)this.Set_RStyle(undefined);if(undefined!=this.Value.Spacing)this.Set_Spacing(undefined);if(undefined!=this.Value.DStrikeout)this.Set_DStrikeout(undefined);if(undefined!= this.Value.Caps)this.Set_Caps(undefined);if(undefined!=this.Value.SmallCaps)this.Set_SmallCaps(undefined);if(undefined!=this.Value.Position)this.Set_Position(undefined);if(undefined!=this.Value.RFonts.Ascii)this.Set_RFonts_Ascii(undefined);if(undefined!=this.Value.RFonts.HAnsi)this.Set_RFonts_HAnsi(undefined);if(undefined!=this.Value.RFonts.CS)this.Set_RFonts_CS(undefined);if(undefined!=this.Value.RFonts.EastAsia)this.Set_RFonts_EastAsia(undefined);if(undefined!=this.Value.RFonts.Hint)this.Set_RFonts_Hint(undefined); if(undefined!=this.Value.TextFill)this.Set_TextFill(undefined);if(undefined!=this.Value.TextOutline)this.Set_TextOutline(undefined)};ParaTextPr.prototype.Set_Bold=function(Value){if(null===Value)Value=undefined;if(this.Value.Bold===Value)return;History.Add(new CChangesParaTextPrBold(this,this.Value.Bold,Value));this.Value.Bold=Value};ParaTextPr.prototype.Set_Italic=function(Value){if(null===Value)Value=undefined;if(this.Value.Italic===Value)return;History.Add(new CChangesParaTextPrItalic(this,this.Value.Italic, Value));this.Value.Italic=Value};ParaTextPr.prototype.Set_Strikeout=function(Value){if(null===Value)Value=undefined;if(this.Value.Strikeout===Value)return;History.Add(new CChangesParaTextPrStrikeout(this,this.Value.Strikeout,Value));this.Value.Strikeout=Value};ParaTextPr.prototype.Set_Underline=function(Value){if(null===Value)Value=undefined;if(this.Value.Underline===Value)return;History.Add(new CChangesParaTextPrUnderline(this,this.Value.Underline,Value));this.Value.Underline=Value};ParaTextPr.prototype.Set_FontSize= function(Value){if(null===Value)Value=undefined;if(this.Value.FontSize===Value)return;History.Add(new CChangesParaTextPrFontSize(this,this.Value.FontSize,Value));this.Value.FontSize=Value};ParaTextPr.prototype.Set_Color=function(Value){if(null===Value)Value=undefined;History.Add(new CChangesParaTextPrColor(this,this.Value.Color,Value));this.Value.Color=Value};ParaTextPr.prototype.Set_VertAlign=function(Value){if(null===Value)Value=undefined;if(this.Value.VertAlign===Value)return;History.Add(new CChangesParaTextPrVertAlign(this, this.Value.VertAlign,Value));this.Value.VertAlign=Value};ParaTextPr.prototype.Set_HighLight=function(Value){if(null===Value)Value=undefined;History.Add(new CChangesParaTextPrHighLight(this,this.Value.HighLight,Value));this.Value.HighLight=Value};ParaTextPr.prototype.Set_RStyle=function(Value){if(null===Value)Value=undefined;if(this.Value.RStyle===Value)return;History.Add(new CChangesParaTextPrRStyle(this,this.Value.RStyle,Value));this.Value.RStyle=Value};ParaTextPr.prototype.Set_Spacing=function(Value){if(null=== Value)Value=undefined;if(this.Value.Spacing===Value)return;History.Add(new CChangesParaTextPrSpacing(this,this.Value.Spacing,Value));this.Value.Spacing=Value};ParaTextPr.prototype.Set_DStrikeout=function(Value){if(null===Value)Value=undefined;if(this.Value.DStrikeout===Value)return;History.Add(new CChangesParaTextPrDStrikeout(this,this.Value.DStrikeout,Value));this.Value.DStrikeout=Value};ParaTextPr.prototype.Set_Caps=function(Value){if(null===Value)Value=undefined;if(this.Value.Caps===Value)return; History.Add(new CChangesParaTextPrCaps(this,this.Value.Caps,Value));this.Value.Caps=Value};ParaTextPr.prototype.Set_SmallCaps=function(Value){if(null===Value)Value=undefined;if(this.Value.SmallCaps===Value)return;History.Add(new CChangesParaTextPrSmallCaps(this,this.Value.SmallCaps,Value));this.Value.SmallCaps=Value};ParaTextPr.prototype.Set_Position=function(Value){if(null===Value)Value=undefined;if(this.Value.Position===Value)return;History.Add(new CChangesParaTextPrPosition(this,this.Value.Position, Value));this.Value.Position=Value};ParaTextPr.prototype.Set_Value=function(Value){if(!Value||!(Value instanceof CTextPr)||true===this.Value.Is_Equal(Value))return;History.Add(new CChangesParaTextPrValue(this,this.Value,Value));this.Value=Value};ParaTextPr.prototype.Set_RFonts=function(Value){var _Value=Value?Value:new CRFonts;History.Add(new CChangesParaTextPrRFonts(this,this.Value.RFonts,_Value));this.Value.RFonts=_Value};ParaTextPr.prototype.Set_RFonts2=function(RFonts){if(undefined!=RFonts){if(undefined!== RFonts.Ascii)this.Set_RFonts_Ascii(RFonts.Ascii);if(undefined!==RFonts.HAnsi)this.Set_RFonts_HAnsi(RFonts.HAnsi);if(undefined!==RFonts.CS)this.Set_RFonts_CS(RFonts.CS);if(undefined!==RFonts.EastAsia)this.Set_RFonts_EastAsia(RFonts.EastAsia);if(undefined!==RFonts.Hint)this.Set_RFonts_Hint(RFonts.Hint)}};ParaTextPr.prototype.Set_RFonts_Ascii=function(Value){if(null===Value)Value=undefined;History.Add(new CChangesParaTextPrRFontsAscii(this,this.Value.RFonts.Ascii,Value));this.Value.RFonts.Ascii=Value}; ParaTextPr.prototype.Set_RFonts_HAnsi=function(Value){if(null===Value)Value=undefined;History.Add(new CChangesParaTextPrRFontsHAnsi(this,this.Value.RFonts.HAnsi,Value));this.Value.RFonts.HAnsi=Value};ParaTextPr.prototype.Set_RFonts_CS=function(Value){if(null===Value)Value=undefined;History.Add(new CChangesParaTextPrRFontsCS(this,this.Value.RFonts.CS,Value));this.Value.RFonts.CS=Value};ParaTextPr.prototype.Set_RFonts_EastAsia=function(Value){if(null===Value)Value=undefined;History.Add(new CChangesParaTextPrRFontsEastAsia(this, this.Value.RFonts.EastAsia,Value));this.Value.RFonts.EastAsia=Value};ParaTextPr.prototype.Set_RFonts_Hint=function(Value){if(null===Value)Value=undefined;History.Add(new CChangesParaTextPrRFontsHint(this,this.Value.RFonts.Hint,Value));this.Value.RFonts.Hint=Value};ParaTextPr.prototype.Set_Lang=function(Value){var _Value=new CLang;if(Value)_Value.Set_FromObject(Value);History.Add(new CChangesParaTextPrLang(this,this.Value.Lang,Value));this.Value.Lang=_Value};ParaTextPr.prototype.Set_Lang_Bidi=function(Value){History.Add(new CChangesParaTextPrLangBidi(this, this.Value.Lang.Bidi,Value));this.Value.Lang.Bidi=Value};ParaTextPr.prototype.Set_Lang_EastAsia=function(Value){History.Add(new CChangesParaTextPrLangEastAsia(this,this.Value.Lang.EastAsia,Value));this.Value.Lang.EastAsia=Value};ParaTextPr.prototype.Set_Lang_Val=function(Value){History.Add(new CChangesParaTextPrLangVal(this,this.Value.Lang.Val,Value));this.Value.Lang.Val=Value};ParaTextPr.prototype.Set_Unifill=function(Value){History.Add(new CChangesParaTextPrUnifill(this,this.Value.Unifill,Value)); this.Value.Unifill=Value};ParaTextPr.prototype.Set_FontSizeCS=function(Value){if(null===Value)Value=undefined;if(this.Value.FontSizeCS===Value)return;History.Add(new CChangesParaTextPrFontSizeCS(this,this.Value.FontSizeCS,Value));this.Value.FontSizeCS=Value};ParaTextPr.prototype.Set_TextOutline=function(Value){History.Add(new CChangesParaTextPrTextOutline(this,this.Value.TextOutline,Value));this.Value.TextOutline=Value};ParaTextPr.prototype.Set_TextFill=function(Value){History.Add(new CChangesParaTextPrTextFill(this, this.Value.TextFill,Value));this.Value.TextFill=Value};ParaTextPr.prototype.SetPr=function(oTextPr){if(!oTextPr)oTextPr=new CTextPr;this.Set_Value(oTextPr)};ParaTextPr.prototype.Get_ParentObject_or_DocumentPos=function(){if(null!=this.Parent)return this.Parent.Get_ParentObject_or_DocumentPos()};ParaTextPr.prototype.Refresh_RecalcData=function(Data){if(undefined!==this.Parent&&null!==this.Parent)this.Parent.Refresh_RecalcData2()};ParaTextPr.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type); Writer.WriteString2(this.Id)};ParaTextPr.prototype.Write_ToBinary2=function(Writer){Writer.WriteLong(AscDFH.historyitem_type_TextPr);Writer.WriteLong(this.Type);Writer.WriteString2(this.Id);this.Value.Write_ToBinary(Writer)};ParaTextPr.prototype.Read_FromBinary2=function(Reader){this.Type=Reader.GetLong();this.Id=Reader.GetString2();this.Value.Clear();this.Value.Read_FromBinary(Reader)};window["AscCommonWord"]=window["AscCommonWord"]||{};window["AscCommonWord"].ParaTextPr=ParaTextPr;"use strict"; AscDFH.changesFactory[AscDFH.historyitem_TextPr_Bold]=CChangesParaTextPrBold;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Italic]=CChangesParaTextPrItalic;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Strikeout]=CChangesParaTextPrStrikeout;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Underline]=CChangesParaTextPrUnderline;AscDFH.changesFactory[AscDFH.historyitem_TextPr_FontSize]=CChangesParaTextPrFontSize;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Color]=CChangesParaTextPrColor;AscDFH.changesFactory[AscDFH.historyitem_TextPr_VertAlign]= CChangesParaTextPrVertAlign;AscDFH.changesFactory[AscDFH.historyitem_TextPr_HighLight]=CChangesParaTextPrHighLight;AscDFH.changesFactory[AscDFH.historyitem_TextPr_RStyle]=CChangesParaTextPrRStyle;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Spacing]=CChangesParaTextPrSpacing;AscDFH.changesFactory[AscDFH.historyitem_TextPr_DStrikeout]=CChangesParaTextPrDStrikeout;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Caps]=CChangesParaTextPrCaps;AscDFH.changesFactory[AscDFH.historyitem_TextPr_SmallCaps]= CChangesParaTextPrSmallCaps;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Position]=CChangesParaTextPrPosition;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Value]=CChangesParaTextPrValue;AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts]=CChangesParaTextPrRFonts;AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_Ascii]=CChangesParaTextPrRFontsAscii;AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_HAnsi]=CChangesParaTextPrRFontsHAnsi;AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_CS]= CChangesParaTextPrRFontsCS;AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_EastAsia]=CChangesParaTextPrRFontsEastAsia;AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_Hint]=CChangesParaTextPrRFontsHint;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Lang]=CChangesParaTextPrLang;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Lang_Bidi]=CChangesParaTextPrLangBidi;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Lang_EastAsia]=CChangesParaTextPrLangEastAsia;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Lang_Val]= CChangesParaTextPrLangVal;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Unifill]=CChangesParaTextPrUnifill;AscDFH.changesFactory[AscDFH.historyitem_TextPr_FontSizeCS]=CChangesParaTextPrFontSizeCS;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Outline]=CChangesParaTextPrTextOutline;AscDFH.changesFactory[AscDFH.historyitem_TextPr_Fill]=CChangesParaTextPrTextFill;AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Bold]=[AscDFH.historyitem_TextPr_Bold,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Italic]= [AscDFH.historyitem_TextPr_Italic,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Strikeout]=[AscDFH.historyitem_TextPr_Strikeout,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Underline]=[AscDFH.historyitem_TextPr_Underline,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_FontSize]=[AscDFH.historyitem_TextPr_FontSize,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Color]= [AscDFH.historyitem_TextPr_Color,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_VertAlign]=[AscDFH.historyitem_TextPr_VertAlign,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_HighLight]=[AscDFH.historyitem_TextPr_HighLight,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_RStyle]=[AscDFH.historyitem_TextPr_RStyle,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Spacing]= [AscDFH.historyitem_TextPr_Spacing,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_DStrikeout]=[AscDFH.historyitem_TextPr_DStrikeout,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Caps]=[AscDFH.historyitem_TextPr_Caps,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_SmallCaps]=[AscDFH.historyitem_TextPr_SmallCaps,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Position]= [AscDFH.historyitem_TextPr_Position,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Value]=[AscDFH.historyitem_TextPr_Bold,AscDFH.historyitem_TextPr_Italic,AscDFH.historyitem_TextPr_Strikeout,AscDFH.historyitem_TextPr_Underline,AscDFH.historyitem_TextPr_FontSize,AscDFH.historyitem_TextPr_Color,AscDFH.historyitem_TextPr_VertAlign,AscDFH.historyitem_TextPr_HighLight,AscDFH.historyitem_TextPr_RStyle,AscDFH.historyitem_TextPr_Spacing,AscDFH.historyitem_TextPr_DStrikeout, AscDFH.historyitem_TextPr_Caps,AscDFH.historyitem_TextPr_SmallCaps,AscDFH.historyitem_TextPr_Position,AscDFH.historyitem_TextPr_Value,AscDFH.historyitem_TextPr_RFonts,AscDFH.historyitem_TextPr_RFonts_Ascii,AscDFH.historyitem_TextPr_RFonts_HAnsi,AscDFH.historyitem_TextPr_RFonts_CS,AscDFH.historyitem_TextPr_RFonts_EastAsia,AscDFH.historyitem_TextPr_RFonts_Hint,AscDFH.historyitem_TextPr_Lang,AscDFH.historyitem_TextPr_Lang_Bidi,AscDFH.historyitem_TextPr_Lang_EastAsia,AscDFH.historyitem_TextPr_Lang_Val, AscDFH.historyitem_TextPr_Unifill,AscDFH.historyitem_TextPr_FontSizeCS,AscDFH.historyitem_TextPr_Outline,AscDFH.historyitem_TextPr_Fill];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_RFonts]=[AscDFH.historyitem_TextPr_RFonts,AscDFH.historyitem_TextPr_RFonts_Ascii,AscDFH.historyitem_TextPr_RFonts_HAnsi,AscDFH.historyitem_TextPr_RFonts_CS,AscDFH.historyitem_TextPr_RFonts_EastAsia,AscDFH.historyitem_TextPr_RFonts_Hint,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_RFonts_Ascii]= [AscDFH.historyitem_TextPr_RFonts_Ascii,AscDFH.historyitem_TextPr_RFonts,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_RFonts_HAnsi]=[AscDFH.historyitem_TextPr_RFonts_HAnsi,AscDFH.historyitem_TextPr_RFonts,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_RFonts_CS]=[AscDFH.historyitem_TextPr_RFonts_CS,AscDFH.historyitem_TextPr_RFonts,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_RFonts_EastAsia]= [AscDFH.historyitem_TextPr_RFonts_EastAsia,AscDFH.historyitem_TextPr_RFonts,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_RFonts_Hint]=[AscDFH.historyitem_TextPr_RFonts_Hint,AscDFH.historyitem_TextPr_RFonts,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Lang]=[AscDFH.historyitem_TextPr_Lang,AscDFH.historyitem_TextPr_Lang_Bidi,AscDFH.historyitem_TextPr_Lang_EastAsia,AscDFH.historyitem_TextPr_Lang_Val,AscDFH.historyitem_TextPr_Value]; AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Lang_Bidi]=[AscDFH.historyitem_TextPr_Lang_Bidi,AscDFH.historyitem_TextPr_Lang,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Lang_EastAsia]=[AscDFH.historyitem_TextPr_Lang_EastAsia,AscDFH.historyitem_TextPr_Lang,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Lang_Val]=[AscDFH.historyitem_TextPr_Lang_Val,AscDFH.historyitem_TextPr_Lang,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Unifill]= [AscDFH.historyitem_TextPr_Unifill,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_FontSizeCS]=[AscDFH.historyitem_TextPr_FontSizeCS,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Outline]=[AscDFH.historyitem_TextPr_Outline,AscDFH.historyitem_TextPr_Value];AscDFH.changesRelationMap[AscDFH.historyitem_TextPr_Fill]=[AscDFH.historyitem_TextPr_Fill,AscDFH.historyitem_TextPr_Value];function private_ParaTextPrChangesOnMergeValue(oChange){if(oChange.Class!== this.Class)return true;if(oChange.Type===this.Type||oChange.Type===AscDFH.historyitem_TextPr_Value)return false;return true}function private_ParaTextPrChangesOnMergeLangValue(oChange){if(oChange.Class!==this.Class)return true;if(oChange.Type===this.Type||oChange.Type===AscDFH.historyitem_TextPr_Value||oChange.Type===AscDFH.historyitem_TextPr_Lang)return false;return true}function private_ParaTextPrChangesOnMergeRFontsValue(oChange){if(oChange.Class!==this.Class)return true;if(oChange.Type===this.Type|| oChange.Type===AscDFH.historyitem_TextPr_Value||oChange.Type===AscDFH.historyitem_TextPr_RFonts)return false;return true}function CChangesParaTextPrBold(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrBold.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesParaTextPrBold.prototype.constructor=CChangesParaTextPrBold;CChangesParaTextPrBold.prototype.Type=AscDFH.historyitem_TextPr_Bold;CChangesParaTextPrBold.prototype.private_SetValue= function(Value){this.Class.Value.Bold=Value};CChangesParaTextPrBold.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrItalic(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrItalic.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesParaTextPrItalic.prototype.constructor=CChangesParaTextPrItalic;CChangesParaTextPrItalic.prototype.Type=AscDFH.historyitem_TextPr_Italic;CChangesParaTextPrItalic.prototype.private_SetValue= function(Value){this.Class.Value.Italic=Value};CChangesParaTextPrItalic.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrStrikeout(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrStrikeout.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesParaTextPrStrikeout.prototype.constructor=CChangesParaTextPrStrikeout;CChangesParaTextPrStrikeout.prototype.Type=AscDFH.historyitem_TextPr_Strikeout;CChangesParaTextPrStrikeout.prototype.private_SetValue= function(Value){this.Class.Value.Strikeout=Value};CChangesParaTextPrStrikeout.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrUnderline(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrUnderline.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesParaTextPrUnderline.prototype.constructor=CChangesParaTextPrUnderline;CChangesParaTextPrUnderline.prototype.Type=AscDFH.historyitem_TextPr_Underline; CChangesParaTextPrUnderline.prototype.private_SetValue=function(Value){this.Class.Value.Underline=Value};CChangesParaTextPrUnderline.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrFontSize(Class,Old,New,Color){AscDFH.CChangesBaseDoubleProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrFontSize.prototype=Object.create(AscDFH.CChangesBaseDoubleProperty.prototype);CChangesParaTextPrFontSize.prototype.constructor=CChangesParaTextPrFontSize;CChangesParaTextPrFontSize.prototype.Type= AscDFH.historyitem_TextPr_FontSize;CChangesParaTextPrFontSize.prototype.private_SetValue=function(Value){this.Class.Value.FontSize=Value};CChangesParaTextPrFontSize.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrColor(Class,Old,New,Color){AscDFH.CChangesBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrColor.prototype=Object.create(AscDFH.CChangesBaseObjectProperty.prototype);CChangesParaTextPrColor.prototype.constructor=CChangesParaTextPrColor; CChangesParaTextPrColor.prototype.Type=AscDFH.historyitem_TextPr_Color;CChangesParaTextPrColor.prototype.private_SetValue=function(Value){this.Class.Value.Color=Value};CChangesParaTextPrColor.prototype.private_CreateObject=function(){return new CDocumentColor(0,0,0,false)};CChangesParaTextPrColor.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrVertAlign(Class,Old,New,Color){AscDFH.CChangesBaseLongProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrVertAlign.prototype= Object.create(AscDFH.CChangesBaseLongProperty.prototype);CChangesParaTextPrVertAlign.prototype.constructor=CChangesParaTextPrVertAlign;CChangesParaTextPrVertAlign.prototype.Type=AscDFH.historyitem_TextPr_VertAlign;CChangesParaTextPrVertAlign.prototype.private_SetValue=function(Value){this.Class.Value.VertAlign=Value};CChangesParaTextPrVertAlign.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrHighLight(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class, Old,New,Color)}CChangesParaTextPrHighLight.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaTextPrHighLight.prototype.constructor=CChangesParaTextPrHighLight;CChangesParaTextPrHighLight.prototype.Type=AscDFH.historyitem_TextPr_HighLight;CChangesParaTextPrHighLight.prototype.private_SetValue=function(Value){if(this.Class.Value)this.Class.Value.HighLight=Value};CChangesParaTextPrHighLight.prototype.WriteToBinary=function(Writer){var nFlags=0;if(false!==this.Color)nFlags|=1; if(undefined===this.New)nFlags|=2;else if(highlight_None===this.New)nFlags|=4;if(undefined===this.Old)nFlags|=8;else if(highlight_None===this.Old)nFlags|=16;Writer.WriteLong(nFlags);if(undefined!==this.New&&highlight_None!==this.New)this.New.Write_ToBinary(Writer);if(undefined!==this.Old&&highlight_None!==this.Old)this.Old.Write_ToBinary(Writer)};CChangesParaTextPrHighLight.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.Color=true;else this.Color=false;if(nFlags& 2)this.New=undefined;else if(nFlags&4)this.New=highlight_None;else{this.New=new CDocumentColor(0,0,0);this.New.Read_FromBinary(Reader)}if(nFlags&8)this.Old=undefined;else if(nFlags&16)this.Old=highlight_None;else{this.Old=new CDocumentColor(0,0,0);this.Old.Read_FromBinary(Reader)}};CChangesParaTextPrHighLight.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrRStyle(Class,Old,New,Color){AscDFH.CChangesBaseStringProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrRStyle.prototype= Object.create(AscDFH.CChangesBaseStringProperty.prototype);CChangesParaTextPrRStyle.prototype.constructor=CChangesParaTextPrRStyle;CChangesParaTextPrRStyle.prototype.Type=AscDFH.historyitem_TextPr_RStyle;CChangesParaTextPrRStyle.prototype.private_SetValue=function(Value){this.Class.Value.RStyle=Value};CChangesParaTextPrRStyle.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrSpacing(Class,Old,New,Color){AscDFH.CChangesBaseDoubleProperty.call(this,Class,Old,New,Color)} CChangesParaTextPrSpacing.prototype=Object.create(AscDFH.CChangesBaseDoubleProperty.prototype);CChangesParaTextPrSpacing.prototype.constructor=CChangesParaTextPrSpacing;CChangesParaTextPrSpacing.prototype.Type=AscDFH.historyitem_TextPr_Spacing;CChangesParaTextPrSpacing.prototype.private_SetValue=function(Value){this.Class.Value.Spacing=Value};CChangesParaTextPrSpacing.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrDStrikeout(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this, Class,Old,New,Color)}CChangesParaTextPrDStrikeout.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesParaTextPrDStrikeout.prototype.constructor=CChangesParaTextPrDStrikeout;CChangesParaTextPrDStrikeout.prototype.Type=AscDFH.historyitem_TextPr_DStrikeout;CChangesParaTextPrDStrikeout.prototype.private_SetValue=function(Value){this.Class.Value.DStrikeout=Value};CChangesParaTextPrDStrikeout.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrCaps(Class, Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrCaps.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesParaTextPrCaps.prototype.constructor=CChangesParaTextPrCaps;CChangesParaTextPrCaps.prototype.Type=AscDFH.historyitem_TextPr_Caps;CChangesParaTextPrCaps.prototype.private_SetValue=function(Value){this.Class.Value.Caps=Value};CChangesParaTextPrCaps.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrSmallCaps(Class, Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrSmallCaps.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesParaTextPrSmallCaps.prototype.constructor=CChangesParaTextPrSmallCaps;CChangesParaTextPrSmallCaps.prototype.Type=AscDFH.historyitem_TextPr_SmallCaps;CChangesParaTextPrSmallCaps.prototype.private_SetValue=function(Value){this.Class.Value.SmallCaps=Value};CChangesParaTextPrSmallCaps.prototype.Merge=private_ParaTextPrChangesOnMergeValue; function CChangesParaTextPrPosition(Class,Old,New,Color){AscDFH.CChangesBaseDoubleProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrPosition.prototype=Object.create(AscDFH.CChangesBaseDoubleProperty.prototype);CChangesParaTextPrPosition.prototype.constructor=CChangesParaTextPrPosition;CChangesParaTextPrPosition.prototype.Type=AscDFH.historyitem_TextPr_Position;CChangesParaTextPrPosition.prototype.private_SetValue=function(Value){this.Class.Value.Position=Value};CChangesParaTextPrPosition.prototype.Merge= private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrValue(Class,Old,New,Color){AscDFH.CChangesBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrValue.prototype=Object.create(AscDFH.CChangesBaseObjectProperty.prototype);CChangesParaTextPrValue.prototype.constructor=CChangesParaTextPrValue;CChangesParaTextPrValue.prototype.Type=AscDFH.historyitem_TextPr_Value;CChangesParaTextPrValue.prototype.private_SetValue=function(Value){this.Class.Value=Value};CChangesParaTextPrValue.prototype.private_CreateObject= function(){return new CTextPr};CChangesParaTextPrValue.prototype.private_IsCreateEmptyObject=function(){return true};CChangesParaTextPrValue.prototype.Merge=function(oChange){if(oChange.Class!==this.Class)return true;if(oChange.Type===this.Type)return false;if(!this.New)this.New=new CTextPr;switch(oChange.Type){case AscDFH.historyitem_TextPr_Bold:{this.New.Bold=oChange.New;break}case AscDFH.historyitem_TextPr_Italic:{this.New.Italic=oChange.New;break}case AscDFH.historyitem_TextPr_Strikeout:{this.New.Strikeout= oChange.New;break}case AscDFH.historyitem_TextPr_Underline:{this.New.Underline=oChange.New;break}case AscDFH.historyitem_TextPr_FontSize:{this.New.FontSize=oChange.New;break}case AscDFH.historyitem_TextPr_Color:{this.New.Color=oChange.New;break}case AscDFH.historyitem_TextPr_VertAlign:{this.New.VertAlign=oChange.New;break}case AscDFH.historyitem_TextPr_HighLight:{this.New.HighLight=oChange.New;break}case AscDFH.historyitem_TextPr_RStyle:{this.New.RStyle=oChange.New;break}case AscDFH.historyitem_TextPr_Spacing:{this.New.Spacing= oChange.New;break}case AscDFH.historyitem_TextPr_DStrikeout:{this.New.DStrikeout=oChange.New;break}case AscDFH.historyitem_TextPr_Caps:{this.New.Caps=oChange.New;break}case AscDFH.historyitem_TextPr_SmallCaps:{this.New.SmallCaps=oChange.New;break}case AscDFH.historyitem_TextPr_Position:{this.New.Position=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts:{this.New.RFonts=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_Ascii:{if(!this.New.RFonts)this.New.RFonts=new CRFonts;this.New.RFonts.Ascii= oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_HAnsi:{if(!this.New.RFonts)this.New.RFonts=new CRFonts;this.New.RFonts.HAnsi=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_CS:{if(!this.New.RFonts)this.New.RFonts=new CRFonts;this.New.RFonts.CS=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_EastAsia:{if(!this.New.RFonts)this.New.RFonts=new CRFonts;this.New.RFonts.EastAsia=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_Hint:{if(!this.New.RFonts)this.New.RFonts=new CRFonts; this.New.RFonts.Hint=oChange.New;break}case AscDFH.historyitem_TextPr_Lang:{this.New.Lang=oChange.New;break}case AscDFH.historyitem_TextPr_Lang_Bidi:{if(!this.New.Lang)this.New.Lang=new CLang;this.New.Lang.Bidi=oChange.New;break}case AscDFH.historyitem_TextPr_Lang_EastAsia:{if(!this.New.Lang)this.New.Lang=new CLang;this.New.Lang.EastAsia=oChange.New;break}case AscDFH.historyitem_TextPr_Lang_Val:{if(!this.New.Lang)this.New.Lang=new CLang;this.New.Lang.Val=oChange.New;break}case AscDFH.historyitem_TextPr_Unifill:{this.New.Unifill= oChange.New;break}case AscDFH.historyitem_TextPr_FontSizeCS:{this.New.FontSizeCS=oChange.New;break}case AscDFH.historyitem_TextPr_Outline:{this.New.TextOutline=oChange.New;break}case AscDFH.historyitem_TextPr_Fill:{this.New.TextFill=oChange.New;break}}return true};function CChangesParaTextPrRFonts(Class,Old,New,Color){AscDFH.CChangesBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrRFonts.prototype=Object.create(AscDFH.CChangesBaseObjectProperty.prototype);CChangesParaTextPrRFonts.prototype.constructor= CChangesParaTextPrRFonts;CChangesParaTextPrRFonts.prototype.Type=AscDFH.historyitem_TextPr_RFonts;CChangesParaTextPrRFonts.prototype.private_SetValue=function(Value){this.Class.Value.RFonts=Value};CChangesParaTextPrRFonts.prototype.private_CreateObject=function(){return new CRFonts};CChangesParaTextPrRFonts.prototype.private_IsCreateEmptyObject=function(){return true};CChangesParaTextPrRFonts.prototype.Merge=function(oChange){if(this.Class!==oChange.Class)return true;if(this.Type===oChange.Type|| oChange.Type===AscDFH.historyitem_TextPr_Value)return false;if(!this.New)this.New=new CRFonts;switch(oChange.Type){case AscDFH.historyitem_TextPr_RFonts_Ascii:{this.New.Ascii=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_HAnsi:{this.New.HAnsi=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_CS:{this.New.CS=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_EastAsia:{this.New.EastAsia=oChange.New;break}case AscDFH.historyitem_TextPr_RFonts_Hint:{this.New.Hint=oChange.New;break}}return true}; function CChangesParaTextPrRFontsAscii(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrRFontsAscii.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaTextPrRFontsAscii.prototype.constructor=CChangesParaTextPrRFontsAscii;CChangesParaTextPrRFontsAscii.prototype.Type=AscDFH.historyitem_TextPr_RFonts_Ascii;CChangesParaTextPrRFontsAscii.prototype.WriteToBinary=function(Writer){var nFlags=0;if(false!==this.Color)nFlags|=1;if(undefined=== this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;Writer.WriteLong(nFlags);if(undefined!==this.New)Writer.WriteString2(this.New.Name);if(undefined!==this.Old)Writer.WriteString2(this.Old.Name)};CChangesParaTextPrRFontsAscii.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.Color=true;else this.Color=false;if(nFlags&2)this.New=undefined;else this.New={Name:Reader.GetString2(),Index:-1};if(nFlags&4)this.Old=undefined;else this.Old={Name:Reader.GetString2(),Index:-1}}; CChangesParaTextPrRFontsAscii.prototype.private_SetValue=function(Value){this.Class.Value.RFonts.Ascii=Value};CChangesParaTextPrRFontsAscii.prototype.Merge=private_ParaTextPrChangesOnMergeRFontsValue;function CChangesParaTextPrRFontsHAnsi(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrRFontsHAnsi.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaTextPrRFontsHAnsi.prototype.constructor=CChangesParaTextPrRFontsHAnsi;CChangesParaTextPrRFontsHAnsi.prototype.Type= AscDFH.historyitem_TextPr_RFonts_HAnsi;CChangesParaTextPrRFontsHAnsi.prototype.WriteToBinary=function(Writer){var nFlags=0;if(false!==this.Color)nFlags|=1;if(undefined===this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;Writer.WriteLong(nFlags);if(undefined!==this.New)Writer.WriteString2(this.New.Name);if(undefined!==this.Old)Writer.WriteString2(this.Old.Name)};CChangesParaTextPrRFontsHAnsi.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.Color=true;else this.Color= false;if(nFlags&2)this.New=undefined;else this.New={Name:Reader.GetString2(),Index:-1};if(nFlags&4)this.Old=undefined;else this.Old={Name:Reader.GetString2(),Index:-1}};CChangesParaTextPrRFontsHAnsi.prototype.private_SetValue=function(Value){this.Class.Value.RFonts.HAnsi=Value};CChangesParaTextPrRFontsHAnsi.prototype.Merge=private_ParaTextPrChangesOnMergeRFontsValue;function CChangesParaTextPrRFontsCS(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrRFontsCS.prototype= Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaTextPrRFontsCS.prototype.constructor=CChangesParaTextPrRFontsCS;CChangesParaTextPrRFontsCS.prototype.Type=AscDFH.historyitem_TextPr_RFonts_CS;CChangesParaTextPrRFontsCS.prototype.WriteToBinary=function(Writer){var nFlags=0;if(false!==this.Color)nFlags|=1;if(undefined===this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;Writer.WriteLong(nFlags);if(undefined!==this.New)Writer.WriteString2(this.New.Name);if(undefined!==this.Old)Writer.WriteString2(this.Old.Name)}; CChangesParaTextPrRFontsCS.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.Color=true;else this.Color=false;if(nFlags&2)this.New=undefined;else this.New={Name:Reader.GetString2(),Index:-1};if(nFlags&4)this.Old=undefined;else this.Old={Name:Reader.GetString2(),Index:-1}};CChangesParaTextPrRFontsCS.prototype.private_SetValue=function(Value){this.Class.Value.RFonts.CS=Value};CChangesParaTextPrRFontsCS.prototype.Merge=private_ParaTextPrChangesOnMergeRFontsValue; function CChangesParaTextPrRFontsEastAsia(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrRFontsEastAsia.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaTextPrRFontsEastAsia.prototype.constructor=CChangesParaTextPrRFontsEastAsia;CChangesParaTextPrRFontsEastAsia.prototype.Type=AscDFH.historyitem_TextPr_RFonts_EastAsia;CChangesParaTextPrRFontsEastAsia.prototype.WriteToBinary=function(Writer){var nFlags=0;if(false!==this.Color)nFlags|= 1;if(undefined===this.New)nFlags|=2;if(undefined===this.Old)nFlags|=4;Writer.WriteLong(nFlags);if(undefined!==this.New)Writer.WriteString2(this.New.Name);if(undefined!==this.Old)Writer.WriteString2(this.Old.Name)};CChangesParaTextPrRFontsEastAsia.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.Color=true;else this.Color=false;if(nFlags&2)this.New=undefined;else this.New={Name:Reader.GetString2(),Index:-1};if(nFlags&4)this.Old=undefined;else this.Old={Name:Reader.GetString2(), Index:-1}};CChangesParaTextPrRFontsEastAsia.prototype.private_SetValue=function(Value){this.Class.Value.RFonts.EastAsia=Value};CChangesParaTextPrRFontsEastAsia.prototype.Merge=private_ParaTextPrChangesOnMergeRFontsValue;function CChangesParaTextPrRFontsHint(Class,Old,New,Color){AscDFH.CChangesBaseLongProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrRFontsHint.prototype=Object.create(AscDFH.CChangesBaseLongProperty.prototype);CChangesParaTextPrRFontsHint.prototype.constructor=CChangesParaTextPrRFontsHint; CChangesParaTextPrRFontsHint.prototype.Type=AscDFH.historyitem_TextPr_RFonts_Hint;CChangesParaTextPrRFontsHint.prototype.private_SetValue=function(Value){this.Class.Value.RFonts.Hint=Value};CChangesParaTextPrRFontsHint.prototype.Merge=private_ParaTextPrChangesOnMergeRFontsValue;function CChangesParaTextPrLang(Class,Old,New,Color){AscDFH.CChangesBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrLang.prototype=Object.create(AscDFH.CChangesBaseObjectProperty.prototype);CChangesParaTextPrLang.prototype.constructor= CChangesParaTextPrLang;CChangesParaTextPrLang.prototype.Type=AscDFH.historyitem_TextPr_Lang;CChangesParaTextPrLang.prototype.private_SetValue=function(Value){this.Class.Value.Lang=Value};CChangesParaTextPrLang.prototype.private_CreateObject=function(){return new CLang};CChangesParaTextPrLang.prototype.private_IsCreateEmptyObject=function(){return true};CChangesParaTextPrLang.prototype.Merge=function(oChange){if(this.Class!==oChange.Class)return true;if(AscDFH.historyitem_TextPr_Lang===oChange.Type|| AscDFH.historyitem_TextPr_Value===oChange.Type)return false;if(!this.New)this.New=new CLang;switch(oChange.Type){case AscDFH.historyitem_TextPr_Lang_Bidi:{this.New.Bidi=oChange.New;break}case AscDFH.historyitem_TextPr_Lang_EastAsia:{this.New.EastAsia=oChange.New;break}case AscDFH.historyitem_TextPr_Lang_Val:{this.New.Val=oChange.New;break}}return true};function CChangesParaTextPrLangBidi(Class,Old,New,Color){AscDFH.CChangesBaseLongProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrLangBidi.prototype= Object.create(AscDFH.CChangesBaseLongProperty.prototype);CChangesParaTextPrLangBidi.prototype.constructor=CChangesParaTextPrLangBidi;CChangesParaTextPrLangBidi.prototype.Type=AscDFH.historyitem_TextPr_Lang_Bidi;CChangesParaTextPrLangBidi.prototype.private_SetValue=function(Value){this.Class.Value.Lang.Bidi=Value};CChangesParaTextPrLangBidi.prototype.Merge=private_ParaTextPrChangesOnMergeLangValue;function CChangesParaTextPrLangEastAsia(Class,Old,New,Color){AscDFH.CChangesBaseLongProperty.call(this, Class,Old,New,Color)}CChangesParaTextPrLangEastAsia.prototype=Object.create(AscDFH.CChangesBaseLongProperty.prototype);CChangesParaTextPrLangEastAsia.prototype.constructor=CChangesParaTextPrLangEastAsia;CChangesParaTextPrLangEastAsia.prototype.Type=AscDFH.historyitem_TextPr_Lang_EastAsia;CChangesParaTextPrLangEastAsia.prototype.private_SetValue=function(Value){this.Class.Value.Lang.EastAsia=Value};CChangesParaTextPrLangEastAsia.prototype.Merge=private_ParaTextPrChangesOnMergeLangValue;function CChangesParaTextPrLangVal(Class, Old,New,Color){AscDFH.CChangesBaseLongProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrLangVal.prototype=Object.create(AscDFH.CChangesBaseLongProperty.prototype);CChangesParaTextPrLangVal.prototype.constructor=CChangesParaTextPrLangVal;CChangesParaTextPrLangVal.prototype.Type=AscDFH.historyitem_TextPr_Lang_Val;CChangesParaTextPrLangVal.prototype.private_SetValue=function(Value){this.Class.Value.Lang.Val=Value};CChangesParaTextPrLangVal.prototype.Merge=private_ParaTextPrChangesOnMergeLangValue; function CChangesParaTextPrUnifill(Class,Old,New,Color){AscDFH.CChangesBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrUnifill.prototype=Object.create(AscDFH.CChangesBaseObjectProperty.prototype);CChangesParaTextPrUnifill.prototype.constructor=CChangesParaTextPrUnifill;CChangesParaTextPrUnifill.prototype.Type=AscDFH.historyitem_TextPr_Unifill;CChangesParaTextPrUnifill.prototype.private_SetValue=function(Value){this.Class.Value.Unifill=Value};CChangesParaTextPrUnifill.prototype.private_CreateObject= function(){return new AscFormat.CUniFill};CChangesParaTextPrUnifill.prototype.Load=function(Color){this.Redo();var Unifill=this.Class.Value.Unifill;if(AscCommon.CollaborativeEditing&&Unifill&&Unifill.fill&&Unifill.fill.type===Asc.c_oAscFill.FILL_TYPE_BLIP&&typeof Unifill.fill.RasterImageId==="string"&&Unifill.fill.RasterImageId.length>0)AscCommon.CollaborativeEditing.Add_NewImage(Unifill.fill.RasterImageId)};CChangesParaTextPrUnifill.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrFontSizeCS(Class, Old,New,Color){AscDFH.CChangesBaseDoubleProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrFontSizeCS.prototype=Object.create(AscDFH.CChangesBaseDoubleProperty.prototype);CChangesParaTextPrFontSizeCS.prototype.constructor=CChangesParaTextPrFontSizeCS;CChangesParaTextPrFontSizeCS.prototype.Type=AscDFH.historyitem_TextPr_FontSizeCS;CChangesParaTextPrFontSizeCS.prototype.private_SetValue=function(Value){this.Class.Value.FontSizeCS=Value};CChangesParaTextPrFontSizeCS.prototype.Merge=private_ParaTextPrChangesOnMergeValue; function CChangesParaTextPrTextOutline(Class,Old,New,Color){AscDFH.CChangesBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrTextOutline.prototype=Object.create(AscDFH.CChangesBaseObjectProperty.prototype);CChangesParaTextPrTextOutline.prototype.constructor=CChangesParaTextPrTextOutline;CChangesParaTextPrTextOutline.prototype.Type=AscDFH.historyitem_TextPr_Outline;CChangesParaTextPrTextOutline.prototype.private_SetValue=function(Value){this.Class.Value.TextOutline=Value};CChangesParaTextPrTextOutline.prototype.private_CreateObject= function(){return new AscFormat.CLn};CChangesParaTextPrTextOutline.prototype.Merge=private_ParaTextPrChangesOnMergeValue;function CChangesParaTextPrTextFill(Class,Old,New,Color){AscDFH.CChangesBaseObjectProperty.call(this,Class,Old,New,Color)}CChangesParaTextPrTextFill.prototype=Object.create(AscDFH.CChangesBaseObjectProperty.prototype);CChangesParaTextPrTextFill.prototype.constructor=CChangesParaTextPrTextFill;CChangesParaTextPrTextFill.prototype.Type=AscDFH.historyitem_TextPr_Fill;CChangesParaTextPrTextFill.prototype.private_SetValue= function(Value){this.Class.Value.TextFill=Value};CChangesParaTextPrTextFill.prototype.private_CreateObject=function(){return new AscFormat.CUniFill};CChangesParaTextPrTextFill.prototype.Merge=private_ParaTextPrChangesOnMergeValue;"use strict";var drawing_Inline=1;var drawing_Anchor=2;var WRAPPING_TYPE_NONE=0;var WRAPPING_TYPE_SQUARE=1;var WRAPPING_TYPE_THROUGH=2;var WRAPPING_TYPE_TIGHT=3;var WRAPPING_TYPE_TOP_AND_BOTTOM=4;var WRAP_HIT_TYPE_POINT=0;var WRAP_HIT_TYPE_SECTION=1;var c_oAscAlignH=Asc.c_oAscAlignH; var c_oAscAlignV=Asc.c_oAscAlignV;function ParaDrawing(W,H,GraphicObj,DrawingDocument,DocumentContent,Parent){CRunElementBase.call(this);this.Id=AscCommon.g_oIdCounter.Get_NewId();this.DrawingType=drawing_Inline;this.GraphicObj=GraphicObj;this.X=0;this.Y=0;this.Width=0;this.Height=0;this.OrigX=0;this.OrigY=0;this.ShiftX=0;this.ShiftY=0;this.PageNum=0;this.LineNum=0;this.YOffset=0;this.DocumentContent=DocumentContent;this.DrawingDocument=DrawingDocument;this.Parent=Parent;this.LogicDocument=DrawingDocument? DrawingDocument.m_oLogicDocument:null;this.Distance={T:0,B:0,L:0,R:0};this.LayoutInCell=true;this.RelativeHeight=undefined;this.SimplePos={Use:false,X:0,Y:0};this.Extent={W:W,H:H};this.EffectExtent={L:0,T:0,R:0,B:0};this.docPr=new AscFormat.CNvPr;this.SizeRelH=undefined;this.SizeRelV=undefined;this.AllowOverlap=true;this.Locked=null;this.Hidden=null;this.PositionH={RelativeFrom:c_oAscRelativeFromH.Column,Align:false,Value:0,Percent:false};this.PositionV={RelativeFrom:c_oAscRelativeFromV.Paragraph, Align:false,Value:0,Percent:false};this.PositionH_Old=undefined;this.PositionV_Old=undefined;this.Internal_Position=new CAnchorPosition;this.wrappingType=WRAPPING_TYPE_THROUGH;this.useWrap=true;if(typeof CWrapPolygon!=="undefined")this.wrappingPolygon=new CWrapPolygon(this);this.document=editor.WordControl.m_oLogicDocument;this.drawingDocument=DrawingDocument;this.graphicObjects=editor.WordControl.m_oLogicDocument.DrawingObjects;this.selected=false;this.behindDoc=false;this.bNoNeedToAdd=false;this.pageIndex= -1;this.Lock=new AscCommon.CLock;this.ParaMath=null;this.SkipOnRecalculate=false;this.LineTop=null;this.LineBottom=null;g_oTableId.Add(this,this.Id);if(this.graphicObjects){this.Set_RelativeHeight(this.graphicObjects.getZIndex());if(History.Is_On()&&!g_oTableId.m_bTurnOff)this.graphicObjects.addGraphicObject(this)}}ParaDrawing.prototype=Object.create(CRunElementBase.prototype);ParaDrawing.prototype.constructor=ParaDrawing;ParaDrawing.prototype.Type=para_Drawing;ParaDrawing.prototype.Get_Type=function(){return this.Type}; ParaDrawing.prototype.Get_Width=function(){return this.Width};ParaDrawing.prototype.Get_WidthVisible=function(){return this.WidthVisible};ParaDrawing.prototype.Set_WidthVisible=function(WidthVisible){this.WidthVisible=WidthVisible};ParaDrawing.prototype.GetSelectedContent=function(SelectedContent){if(this.GraphicObj&&this.GraphicObj.GetSelectedContent)this.GraphicObj.GetSelectedContent(SelectedContent)};ParaDrawing.prototype.GetSearchElementId=function(bNext,bCurrent){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.GetSearchElementId==="function")return this.GraphicObj.GetSearchElementId(bNext,bCurrent);return null};ParaDrawing.prototype.CheckCorrect=function(){if(!this.GraphicObj)return false;if(this.GraphicObj&&this.GraphicObj.checkCorrect)return this.GraphicObj.checkCorrect();return true};ParaDrawing.prototype.GetAllDrawingObjects=function(DrawingObjects){if(null==DrawingObjects)DrawingObjects=[];if(this.GraphicObj.GetAllDrawingObjects)this.GraphicObj.GetAllDrawingObjects(DrawingObjects)}; ParaDrawing.prototype.canRotate=function(){return AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.canRotate=="function"&&this.GraphicObj.canRotate()};ParaDrawing.prototype.GetParagraph=function(){return this.Get_ParentParagraph()};ParaDrawing.prototype.GetRun=function(){return this.Get_Run()};ParaDrawing.prototype.Get_Run=function(){var oParagraph=this.Get_ParentParagraph();if(oParagraph)return oParagraph.Get_DrawingObjectRun(this.Id);return null};ParaDrawing.prototype.Get_Props=function(OtherProps){var Props= {};Props.Width=this.GraphicObj.extX;Props.Height=this.GraphicObj.extY;if(drawing_Inline===this.DrawingType)Props.WrappingStyle=c_oAscWrapStyle2.Inline;else if(WRAPPING_TYPE_NONE===this.wrappingType)Props.WrappingStyle=this.behindDoc===true?c_oAscWrapStyle2.Behind:c_oAscWrapStyle2.InFront;else switch(this.wrappingType){case WRAPPING_TYPE_SQUARE:Props.WrappingStyle=c_oAscWrapStyle2.Square;break;case WRAPPING_TYPE_TIGHT:Props.WrappingStyle=c_oAscWrapStyle2.Tight;break;case WRAPPING_TYPE_THROUGH:Props.WrappingStyle= c_oAscWrapStyle2.Through;break;case WRAPPING_TYPE_TOP_AND_BOTTOM:Props.WrappingStyle=c_oAscWrapStyle2.TopAndBottom;break;default:Props.WrappingStyle=c_oAscWrapStyle2.Inline;break}if(drawing_Inline===this.DrawingType)Props.Paddings={Left:AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT,Right:AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT,Top:0,Bottom:0};else{var oDistance=this.Get_Distance();Props.Paddings={Left:oDistance.L,Right:oDistance.R,Top:oDistance.T,Bottom:oDistance.B}}Props.AllowOverlap=this.AllowOverlap;Props.Position= {X:this.X,Y:this.Y};Props.PositionH={RelativeFrom:this.PositionH.RelativeFrom,UseAlign:this.PositionH.Align,Align:true===this.PositionH.Align?this.PositionH.Value:undefined,Value:true===this.PositionH.Align?0:this.PositionH.Value,Percent:this.PositionH.Percent};Props.PositionV={RelativeFrom:this.PositionV.RelativeFrom,UseAlign:this.PositionV.Align,Align:true===this.PositionV.Align?this.PositionV.Value:undefined,Value:true===this.PositionV.Align?0:this.PositionV.Value,Percent:this.PositionV.Percent}; if(this.SizeRelH&&this.SizeRelH.Percent>0)Props.SizeRelH={RelativeFrom:AscFormat.ConvertRelSizeHToRelPosition(this.SizeRelH.RelativeFrom),Value:this.SizeRelH.Percent*100>>0};if(this.SizeRelV&&this.SizeRelV.Percent>0)Props.SizeRelV={RelativeFrom:AscFormat.ConvertRelSizeVToRelPosition(this.SizeRelV.RelativeFrom),Value:this.SizeRelV.Percent*100>>0};Props.Internal_Position=this.Internal_Position;Props.Locked=this.Lock.Is_Locked();var ParentParagraph=this.Get_ParentParagraph();if(ParentParagraph&&undefined!== ParentParagraph.Parent){var DocContent=ParentParagraph.Parent;if(true===DocContent.Is_DrawingShape()||DocContent.GetTopDocumentContent()instanceof CFootEndnote)Props.CanBeFlow=false}Props.title=this.docPr.title!==null?this.docPr.title:undefined;Props.description=this.docPr.descr!==null?this.docPr.descr:undefined;if(null!=OtherProps&&undefined!=OtherProps){if(undefined===OtherProps.Width||.001>Math.abs(Props.Width-OtherProps.Width))Props.Width=undefined;if(undefined===OtherProps.Height||.001>Math.abs(Props.Height- OtherProps.Height))Props.Height=undefined;if(undefined===OtherProps.WrappingStyle||Props.WrappingStyle!=OtherProps.WrappingStyle)Props.WrappingStyle=undefined;if(undefined===OtherProps.ImageUrl||Props.ImageUrl!=OtherProps.ImageUrl)Props.ImageUrl=undefined;if(undefined===OtherProps.Paddings.Left||.001>Math.abs(Props.Paddings.Left-OtherProps.Paddings.Left))Props.Paddings.Left=undefined;if(undefined===OtherProps.Paddings.Right||.001>Math.abs(Props.Paddings.Right-OtherProps.Paddings.Right))Props.Paddings.Right= undefined;if(undefined===OtherProps.Paddings.Top||.001>Math.abs(Props.Paddings.Top-OtherProps.Paddings.Top))Props.Paddings.Top=undefined;if(undefined===OtherProps.Paddings.Bottom||.001>Math.abs(Props.Paddings.Bottom-OtherProps.Paddings.Bottom))Props.Paddings.Bottom=undefined;if(undefined===OtherProps.AllowOverlap||Props.AllowOverlap!=OtherProps.AllowOverlap)Props.AllowOverlap=undefined;if(undefined===OtherProps.Position.X||.001>Math.abs(Props.Position.X-OtherProps.Position.X))Props.Position.X=undefined; if(undefined===OtherProps.Position.Y||.001>Math.abs(Props.Position.Y-OtherProps.Position.Y))Props.Position.Y=undefined;if(undefined===OtherProps.PositionH.RelativeFrom||Props.PositionH.RelativeFrom!=OtherProps.PositionH.RelativeFrom)Props.PositionH.RelativeFrom=undefined;if(undefined===OtherProps.PositionH.UseAlign||Props.PositionH.UseAlign!=OtherProps.PositionH.UseAlign)Props.PositionH.UseAlign=undefined;if(Props.PositionH.RelativeFrom===OtherProps.PositionH.RelativeFrom&&Props.PositionH.UseAlign=== OtherProps.PositionH.UseAlign){if(true!=Props.PositionH.UseAlign&&.001>Math.abs(Props.PositionH.Value-OtherProps.PositionH.Value))Props.PositionH.Value=undefined;if(true===Props.PositionH.UseAlign&&Props.PositionH.Align!=OtherProps.PositionH.Align)Props.PositionH.Align=undefined}if(undefined===OtherProps.PositionV.RelativeFrom||Props.PositionV.RelativeFrom!=OtherProps.PositionV.RelativeFrom)Props.PositionV.RelativeFrom=undefined;if(undefined===OtherProps.PositionV.UseAlign||Props.PositionV.UseAlign!= OtherProps.PositionV.UseAlign)Props.PositionV.UseAlign=undefined;if(Props.PositionV.RelativeFrom===OtherProps.PositionV.RelativeFrom&&Props.PositionV.UseAlign===OtherProps.PositionV.UseAlign){if(true!=Props.PositionV.UseAlign&&.001>Math.abs(Props.PositionV.Value-OtherProps.PositionV.Value))Props.PositionV.Value=undefined;if(true===Props.PositionV.UseAlign&&Props.PositionV.Align!=OtherProps.PositionV.Align)Props.PositionV.Align=undefined}if(false===OtherProps.Locked)Props.Locked=false;if(false===OtherProps.CanBeFlow|| false===Props.CanBeFlow)Props.CanBeFlow=false;else Props.CanBeFlow=true;if(undefined===OtherProps.title||Props.title!==OtherProps.title)Props.title=undefined;if(undefined===OtherProps.description||Props.description!==OtherProps.description)Props.description=undefined}return Props};ParaDrawing.prototype.Is_UseInDocument=function(){if(this.Parent){var Run=this.Parent.Get_DrawingObjectRun(this.Id);if(Run)return Run.Is_UseInDocument(this.Get_Id())}return false};ParaDrawing.prototype.IsUseInDocument=function(){return this.Is_UseInDocument()}; ParaDrawing.prototype.CheckGroupSizes=function(){if(this.GraphicObj&&this.GraphicObj.CheckGroupSizes)this.GraphicObj.CheckGroupSizes()};ParaDrawing.prototype.Set_DrawingType=function(DrawingType){History.Add(new CChangesParaDrawingDrawingType(this,this.DrawingType,DrawingType));this.DrawingType=DrawingType};ParaDrawing.prototype.Set_WrappingType=function(WrapType){History.Add(new CChangesParaDrawingWrappingType(this,this.wrappingType,WrapType));this.wrappingType=WrapType};ParaDrawing.prototype.Set_Distance= function(L,T,R,B){var oDistance=this.Get_Distance();if(!AscFormat.isRealNumber(L))L=oDistance.L;if(!AscFormat.isRealNumber(T))T=oDistance.T;if(!AscFormat.isRealNumber(R))R=oDistance.R;if(!AscFormat.isRealNumber(B))B=oDistance.B;History.Add(new CChangesParaDrawingDistance(this,{Left:this.Distance.L,Top:this.Distance.T,Right:this.Distance.R,Bottom:this.Distance.B},{Left:L,Top:T,Right:R,Bottom:B}));this.Distance.L=L;this.Distance.R=R;this.Distance.T=T;this.Distance.B=B};ParaDrawing.prototype.Set_AllowOverlap= function(AllowOverlap){History.Add(new CChangesParaDrawingAllowOverlap(this,this.AllowOverlap,AllowOverlap));this.AllowOverlap=AllowOverlap};ParaDrawing.prototype.Set_PositionH=function(RelativeFrom,Align,Value,Percent){var _Value,_Percent;if(AscFormat.isRealNumber(Value)&&AscFormat.fApproxEqual(Value,0)&&true===Percent){_Value=0;_Percent=false}else{_Value=Value;_Percent=Percent}History.Add(new CChangesParaDrawingPositionH(this,{RelativeFrom:this.PositionH.RelativeFrom,Align:this.PositionH.Align, Value:this.PositionH.Value,Percent:this.PositionH.Percent},{RelativeFrom:RelativeFrom,Align:Align,Value:_Value,Percent:_Percent}));this.PositionH.RelativeFrom=RelativeFrom;this.PositionH.Align=Align;this.PositionH.Value=_Value;this.PositionH.Percent=_Percent};ParaDrawing.prototype.Set_PositionV=function(RelativeFrom,Align,Value,Percent){var _Value,_Percent;if(AscFormat.isRealNumber(Value)&&AscFormat.fApproxEqual(Value,0)&&true===Percent){_Value=0;_Percent=false}else{_Value=Value;_Percent=Percent}History.Add(new CChangesParaDrawingPositionV(this, {RelativeFrom:this.PositionV.RelativeFrom,Align:this.PositionV.Align,Value:this.PositionV.Value,Percent:this.PositionV.Percent},{RelativeFrom:RelativeFrom,Align:Align,Value:_Value,Percent:_Percent}));this.PositionV.RelativeFrom=RelativeFrom;this.PositionV.Align=Align;this.PositionV.Value=_Value;this.PositionV.Percent=_Percent};ParaDrawing.prototype.GetPositionH=function(){return{RelativeFrom:this.PositionH.RelativeFrom,Align:this.PositionH.Align,Value:this.PositionH.Value,Percent:this.PositionH.Percent}}; ParaDrawing.prototype.GetPositionV=function(){return{RelativeFrom:this.PositionV.RelativeFrom,Align:this.PositionV.Align,Value:this.PositionV.Value,Percent:this.PositionV.Percent}};ParaDrawing.prototype.Set_BehindDoc=function(BehindDoc){History.Add(new CChangesParaDrawingBehindDoc(this,this.behindDoc,BehindDoc));this.behindDoc=BehindDoc};ParaDrawing.prototype.Set_GraphicObject=function(graphicObject){var oldId=AscCommon.isRealObject(this.GraphicObj)?this.GraphicObj.Get_Id():null;var newId=AscCommon.isRealObject(graphicObject)? graphicObject.Get_Id():null;History.Add(new CChangesParaDrawingGraphicObject(this,oldId,newId));if(graphicObject)graphicObject.handleUpdateExtents();this.GraphicObj=graphicObject};ParaDrawing.prototype.setSimplePos=function(use,x,y){History.Add(new CChangesParaDrawingSimplePos(this,{Use:this.SimplePos.Use,X:this.SimplePos.X,Y:this.SimplePos.Y},{Use:use,X:x,Y:y}));this.SimplePos.Use=use;this.SimplePos.X=x;this.SimplePos.Y=y};ParaDrawing.prototype.setExtent=function(extX,extY){History.Add(new CChangesParaDrawingExtent(this, {W:this.Extent.W,H:this.Extent.H},{W:extX,H:extY}));this.Extent.W=extX;this.Extent.H=extY};ParaDrawing.prototype.addWrapPolygon=function(wrapPolygon){History.Add(new CChangesParaDrawingWrapPolygon(this,this.wrappingPolygon,wrapPolygon));this.wrappingPolygon=wrapPolygon};ParaDrawing.prototype.Set_Locked=function(bLocked){History.Add(new CChangesParaDrawingLocked(this,this.Locked,bLocked));this.Locked=bLocked};ParaDrawing.prototype.Set_RelativeHeight=function(nRelativeHeight){History.Add(new CChangesParaDrawingRelativeHeight(this, this.RelativeHeight,nRelativeHeight));this.Set_RelativeHeight2(nRelativeHeight)};ParaDrawing.prototype.Set_RelativeHeight2=function(nRelativeHeight){this.RelativeHeight=nRelativeHeight;if(this.graphicObjects&&AscFormat.isRealNumber(nRelativeHeight)&&nRelativeHeight>this.graphicObjects.maximalGraphicObjectZIndex)this.graphicObjects.maximalGraphicObjectZIndex=nRelativeHeight};ParaDrawing.prototype.setEffectExtent=function(L,T,R,B){var oEE=this.EffectExtent;History.Add(new CChangesParaDrawingEffectExtent(this, {L:oEE.L,T:oEE.T,R:oEE.R,B:oEE.B},{L:L,T:T,R:R,B:B}));this.EffectExtent.L=L;this.EffectExtent.T=T;this.EffectExtent.R=R;this.EffectExtent.B=B};ParaDrawing.prototype.Set_Parent=function(oParent){History.Add(new CChangesParaDrawingParent(this,this.Parent,oParent));this.Parent=oParent};ParaDrawing.prototype.IsWatermark=function(){if(!this.GraphicObj)return false;if(this.GraphicObj.getObjectType()!==AscDFH.historyitem_type_Shape&&this.GraphicObj.getObjectType()!==AscDFH.historyitem_type_ImageShape)return false; if(this.Is_Inline())return false;var oParagraph=this.GetParagraph();if(!(oParagraph instanceof Paragraph))return false;var oContent=oParagraph.Parent;if(!oContent||oContent.Is_DrawingShape(false))return false;var oHdrFtr=oContent.IsHdrFtr(true);if(!oHdrFtr)return false;var oRun=this.Get_Run();if(!oRun)return false;var arrDocPos=oRun.GetDocumentPositionFromObject();for(var nIndex=0,nCount=arrDocPos.length;nIndex<nCount;++nIndex){var oClass=arrDocPos[nIndex].Class;var oSdt=null;if(oClass instanceof CDocumentContent&&oClass.Parent instanceof CBlockLevelSdt)oSdt=oClass.Parent;else if(oClass instanceof CInlineLevelSdt)oSdt=oClass;if(oSdt){var oPr=oSdt.Pr;if(AscCommon.isRealObject(oPr)&&AscCommon.isRealObject(oPr.DocPartObj)&&oPr.DocPartObj.Gallery==="Watermarks")return true}}return false};ParaDrawing.prototype.Set_ParaMath=function(ParaMath){History.Add(new CChangesParaDrawingParaMath(this,this.ParaMath,ParaMath));this.ParaMath=ParaMath};ParaDrawing.prototype.Set_LayoutInCell=function(LayoutInCell){if(this.LayoutInCell=== LayoutInCell)return;History.Add(new CChangesParaDrawingLayoutInCell(this,this.LayoutInCell,LayoutInCell));this.LayoutInCell=LayoutInCell};ParaDrawing.prototype.SetSizeRelH=function(oSize){History.Add(new CChangesParaDrawingSizeRelH(this,this.SizeRelH,oSize));this.SizeRelH=oSize};ParaDrawing.prototype.SetSizeRelV=function(oSize){History.Add(new CChangesParaDrawingSizeRelV(this,this.SizeRelV,oSize));this.SizeRelV=oSize};ParaDrawing.prototype.getXfrmExtX=function(){if(AscCommon.isRealObject(this.GraphicObj)&& AscCommon.isRealObject(this.GraphicObj.spPr)&&AscCommon.isRealObject(this.GraphicObj.spPr.xfrm)&&AscFormat.isRealNumber(this.GraphicObj.spPr.xfrm.extX))return this.GraphicObj.spPr.xfrm.extX;if(AscFormat.isRealNumber(this.Extent.W))return this.Extent.W;return 0};ParaDrawing.prototype.getXfrmExtY=function(){if(AscCommon.isRealObject(this.GraphicObj)&&AscCommon.isRealObject(this.GraphicObj.spPr)&&AscCommon.isRealObject(this.GraphicObj.spPr.xfrm)&&AscFormat.isRealNumber(this.GraphicObj.spPr.xfrm.extY))return this.GraphicObj.spPr.xfrm.extY; if(AscFormat.isRealNumber(this.Extent.H))return this.Extent.H;return 0};ParaDrawing.prototype.getXfrmRot=function(){if(AscCommon.isRealObject(this.GraphicObj)&&AscCommon.isRealObject(this.GraphicObj.spPr)&&AscCommon.isRealObject(this.GraphicObj.spPr.xfrm)&&AscFormat.isRealNumber(this.GraphicObj.spPr.xfrm.rot))return this.GraphicObj.spPr.xfrm.rot;return 0};ParaDrawing.prototype.Get_Bounds=function(){var InsL,InsT,InsR,InsB;InsL=0;InsT=0;InsR=0;InsB=0;if(!this.Is_Inline()){var oDistance=this.Get_Distance(); if(oDistance){InsL=oDistance.L;InsT=oDistance.T;InsR=oDistance.R;InsB=oDistance.B}}var ExtX=this.getXfrmExtX();var ExtY=this.getXfrmExtY();var Rot=this.getXfrmRot();var X,Y,W,H;if(AscFormat.checkNormalRotate(Rot)){X=this.X;Y=this.Y;W=ExtX;H=ExtY}else{X=this.X+ExtX/2-ExtY/2;Y=this.Y+ExtY/2-ExtX/2;W=ExtY;H=ExtX}return{Left:X-this.EffectExtent.L-InsL,Top:Y-this.EffectExtent.T-InsT,Bottom:Y+H+this.EffectExtent.B+InsB,Right:X+W+this.EffectExtent.R+InsR}};ParaDrawing.prototype.Search=function(Str,Props, SearchEngine,Type){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.Search==="function")this.GraphicObj.Search(Str,Props,SearchEngine,Type)};ParaDrawing.prototype.Set_Props=function(Props){var bCheckWrapPolygon=false;var isPictureCC=false;var oRun=this.GetRun();if(oRun){var arrContentControls=oRun.GetParentContentControls();for(var nIndex=0,nCount=arrContentControls.length;nIndex<nCount;++nIndex)if(arrContentControls[nIndex].IsPicture()){isPictureCC=true;break}}if(undefined!=Props.WrappingStyle&& !isPictureCC){if(drawing_Inline===this.DrawingType&&c_oAscWrapStyle2.Inline!=Props.WrappingStyle&&undefined===Props.Paddings)this.Set_Distance(3.2,0,3.2,0);this.Set_DrawingType(c_oAscWrapStyle2.Inline===Props.WrappingStyle?drawing_Inline:drawing_Anchor);if(c_oAscWrapStyle2.Inline===Props.WrappingStyle)if(AscCommon.isRealObject(this.GraphicObj.bounds)&&AscFormat.isRealNumber(this.GraphicObj.bounds.w)&&AscFormat.isRealNumber(this.GraphicObj.bounds.h))this.CheckWH();if(c_oAscWrapStyle2.Behind===Props.WrappingStyle|| c_oAscWrapStyle2.InFront===Props.WrappingStyle){this.Set_WrappingType(WRAPPING_TYPE_NONE);this.Set_BehindDoc(c_oAscWrapStyle2.Behind===Props.WrappingStyle?true:false)}else{switch(Props.WrappingStyle){case c_oAscWrapStyle2.Square:this.Set_WrappingType(WRAPPING_TYPE_SQUARE);break;case c_oAscWrapStyle2.Tight:{bCheckWrapPolygon=true;this.Set_WrappingType(WRAPPING_TYPE_TIGHT);break}case c_oAscWrapStyle2.Through:{this.Set_WrappingType(WRAPPING_TYPE_THROUGH);bCheckWrapPolygon=true;break}case c_oAscWrapStyle2.TopAndBottom:this.Set_WrappingType(WRAPPING_TYPE_TOP_AND_BOTTOM); break;default:this.Set_WrappingType(WRAPPING_TYPE_SQUARE);break}this.Set_BehindDoc(false)}}if(undefined!=Props.Paddings)this.Set_Distance(Props.Paddings.Left,Props.Paddings.Top,Props.Paddings.Right,Props.Paddings.Bottom);if(undefined!=Props.AllowOverlap)this.Set_AllowOverlap(Props.AllowOverlap);if(undefined!=Props.PositionH)this.Set_PositionH(Props.PositionH.RelativeFrom,Props.PositionH.UseAlign,true===Props.PositionH.UseAlign?Props.PositionH.Align:Props.PositionH.Value,Props.PositionH.Percent);if(undefined!= Props.PositionV)this.Set_PositionV(Props.PositionV.RelativeFrom,Props.PositionV.UseAlign,true===Props.PositionV.UseAlign?Props.PositionV.Align:Props.PositionV.Value,Props.PositionV.Percent);if(undefined!=Props.SizeRelH)this.SetSizeRelH({RelativeFrom:AscFormat.ConvertRelPositionHToRelSize(Props.SizeRelH.RelativeFrom),Percent:Props.SizeRelH.Value/100});if(undefined!=Props.SizeRelV)this.SetSizeRelV({RelativeFrom:AscFormat.ConvertRelPositionVToRelSize(Props.SizeRelV.RelativeFrom),Percent:Props.SizeRelV.Value/ 100});if(this.SizeRelH&&!this.SizeRelV)this.SetSizeRelV({RelativeFrom:AscCommon.c_oAscSizeRelFromV.sizerelfromvPage,Percent:0});if(this.SizeRelV&&!this.SizeRelH)this.SetSizeRelH({RelativeFrom:AscCommon.c_oAscSizeRelFromH.sizerelfromhPage,Percent:0});if(bCheckWrapPolygon)this.Check_WrapPolygon();if(undefined!=Props.description)this.docPr.setDescr(Props.description);if(undefined!=Props.title)this.docPr.setTitle(Props.title)};ParaDrawing.prototype.CheckWH=function(){if(!this.GraphicObj)return;var oldExtW= this.Extent.W;var oldExtH=this.Extent.H;if(this.GraphicObj.spPr&&this.GraphicObj.spPr.xfrm&&AscFormat.isRealNumber(this.GraphicObj.spPr.xfrm.extX)&&AscFormat.isRealNumber(this.GraphicObj.spPr.xfrm.extY)){this.Extent.W=this.GraphicObj.spPr.xfrm.extX;this.Extent.H=this.GraphicObj.spPr.xfrm.extY}this.GraphicObj.recalculate();this.Extent.W=oldExtW;this.Extent.H=oldExtH;var extX,extY,rot;if(this.GraphicObj.spPr&&this.GraphicObj.spPr.xfrm){if(AscFormat.isRealNumber(this.GraphicObj.spPr.xfrm.extX)&&AscFormat.isRealNumber(this.GraphicObj.spPr.xfrm.extY)){extX= this.GraphicObj.spPr.xfrm.extX;extY=this.GraphicObj.spPr.xfrm.extY}else{extX=5;extY=5}if(AscFormat.isRealNumber(this.GraphicObj.spPr.xfrm.rot))rot=this.GraphicObj.spPr.xfrm.rot;else rot=0}else{extX=5;extY=5;rot=0}this.setExtent(extX,extY);var EEL=0,EET=0,EER=0,EEB=0;{var xc=this.GraphicObj.localTransform.TransformPointX(this.GraphicObj.extX/2,this.GraphicObj.extY/2);var yc=this.GraphicObj.localTransform.TransformPointY(this.GraphicObj.extX/2,this.GraphicObj.extY/2);var oBounds=this.GraphicObj.bounds; var LineCorrect=0;if(this.GraphicObj.pen&&this.GraphicObj.pen.Fill&&this.GraphicObj.pen.Fill.fill){LineCorrect=this.GraphicObj.pen.w==null?12700:parseInt(this.GraphicObj.pen.w);LineCorrect/=72E3}var l=oBounds.x;var r=l+oBounds.w;var t=oBounds.y;var b=t+oBounds.h;var startX,startY;if(!AscFormat.checkNormalRotate(rot)){var temp=extX;extX=extY;extY=temp}startX=xc-extX/2;startY=yc-extY/2;if(l>startX)l=startX;if(r<startX+extX)r=startX+extX;if(t>startY)t=startY;if(b<startY+extY)b=startY+extY;EEL=xc-extX/ 2-l+LineCorrect;EET=yc-extY/2-t+LineCorrect;EER=r+LineCorrect-(xc+extX/2);EEB=b+LineCorrect-(yc+extY/2)}this.setEffectExtent(EEL,EET,EER,EEB);this.Check_WrapPolygon()};ParaDrawing.prototype.Check_WrapPolygon=function(){if((this.wrappingType===WRAPPING_TYPE_TIGHT||this.wrappingType===WRAPPING_TYPE_THROUGH)&&this.wrappingPolygon&&!this.wrappingPolygon.edited){this.GraphicObj.recalculate();this.wrappingPolygon.setArrRelPoints(this.wrappingPolygon.calculate(this.GraphicObj))}};ParaDrawing.prototype.Draw= function(X,Y,pGraphics,PDSE){var nPageIndex=null;if(AscCommon.isRealObject(PDSE))nPageIndex=PDSE.Page;if(pGraphics.Start_Command){pGraphics.m_aDrawings.push(new AscFormat.ParaDrawingStruct(undefined,this));return}if(this.Is_Inline()){pGraphics.shapePageIndex=nPageIndex;this.draw(pGraphics,PDSE);pGraphics.shapePageIndex=null}if(pGraphics.End_Command)pGraphics.End_Command()};ParaDrawing.prototype.Measure=function(){if(!this.GraphicObj){this.Width=0;this.Height=0;return}if(AscFormat.isRealNumber(this.Extent.W)&& AscFormat.isRealNumber(this.Extent.H)&&(!this.GraphicObj.checkAutofit||!this.GraphicObj.checkAutofit())&&!this.SizeRelH&&!this.SizeRelV){var oEffectExtent=this.EffectExtent;var W,H;if(AscFormat.isRealNumber(this.GraphicObj.rot))if(AscFormat.checkNormalRotate(this.GraphicObj.rot)){W=this.Extent.W;H=this.Extent.H}else{W=this.Extent.H;H=this.Extent.W}else{W=this.Extent.W;H=this.Extent.H}this.Width=W+AscFormat.getValOrDefault(oEffectExtent.L,0)+AscFormat.getValOrDefault(oEffectExtent.R,0);this.Height= H+AscFormat.getValOrDefault(oEffectExtent.T,0)+AscFormat.getValOrDefault(oEffectExtent.B,0);this.WidthVisible=this.Width}else{this.GraphicObj.recalculate();if(this.GraphicObj.recalculateText)this.GraphicObj.recalculateText();if(this.PositionH.UseAlign||this.Is_Inline())this.Width=this.GraphicObj.bounds.w;else this.Width=this.GraphicObj.extX;this.WidthVisible=this.Width;if(this.PositionV.UseAlign||this.Is_Inline())this.Height=this.GraphicObj.bounds.h;else this.Height=this.GraphicObj.extY}};ParaDrawing.prototype.SaveRecalculateObject= function(Copy){var DrawingObj={};DrawingObj.Type=this.Type;DrawingObj.DrawingType=this.DrawingType;DrawingObj.WrappingType=this.wrappingType;if(drawing_Anchor===this.Get_DrawingType()&&true===this.Use_TextWrap()){var oDistance=this.Get_Distance();DrawingObj.FlowPos={X:this.X-oDistance.L,Y:this.Y-oDistance.T,W:this.Width+oDistance.R,H:this.Height+oDistance.B}}DrawingObj.PageNum=this.PageNum;DrawingObj.X=this.X;DrawingObj.Y=this.Y;DrawingObj.spRecaclcObject=this.GraphicObj.getRecalcObject();return DrawingObj}; ParaDrawing.prototype.LoadRecalculateObject=function(RecalcObj){this.updatePosition3(RecalcObj.PageNum,RecalcObj.X,RecalcObj.Y);this.GraphicObj.setRecalcObject(RecalcObj.spRecaclcObject)};ParaDrawing.prototype.Reassign_ImageUrls=function(mapUrls){if(this.GraphicObj)this.GraphicObj.Reassign_ImageUrls(mapUrls)};ParaDrawing.prototype.PrepareRecalculateObject=function(){};ParaDrawing.prototype.Is_RealContent=function(){return true};ParaDrawing.prototype.Can_AddNumbering=function(){if(drawing_Inline=== this.DrawingType)return true;return false};ParaDrawing.prototype.Copy=function(oPr){var c=new ParaDrawing(this.Extent.W,this.Extent.H,null,editor.WordControl.m_oLogicDocument.DrawingDocument,null,null);c.Set_DrawingType(this.DrawingType);if(AscCommon.isRealObject(this.GraphicObj)){var oCopyPr=new AscFormat.CCopyObjectProperties;oCopyPr.contentCopyPr=oPr;c.Set_GraphicObject(this.GraphicObj.copy(oCopyPr));c.GraphicObj.setParent(c)}var d=this.Distance;c.Set_PositionH(this.PositionH.RelativeFrom,this.PositionH.Align, this.PositionH.Value,this.PositionH.Percent);c.Set_PositionV(this.PositionV.RelativeFrom,this.PositionV.Align,this.PositionV.Value,this.PositionV.Percent);c.Set_Distance(d.L,d.T,d.R,d.B);c.Set_AllowOverlap(this.AllowOverlap);c.Set_WrappingType(this.wrappingType);if(this.wrappingPolygon)c.wrappingPolygon.fromOther(this.wrappingPolygon);c.Set_BehindDoc(this.behindDoc);c.Set_RelativeHeight(this.RelativeHeight);if(this.SizeRelH)c.SetSizeRelH({RelativeFrom:this.SizeRelH.RelativeFrom,Percent:this.SizeRelH.Percent}); if(this.SizeRelV)c.SetSizeRelV({RelativeFrom:this.SizeRelV.RelativeFrom,Percent:this.SizeRelV.Percent});if(AscFormat.isRealNumber(this.Extent.W)&&AscFormat.isRealNumber(this.Extent.H))c.setExtent(this.Extent.W,this.Extent.H);var EE=this.EffectExtent;if(EE.L>0||EE.T>0||EE.R>0||EE.B>0)c.setEffectExtent(EE.L,EE.T,EE.R,EE.B);c.docPr.setFromOther(this.docPr);if(this.ParaMath)c.Set_ParaMath(this.ParaMath.Copy());return c};ParaDrawing.prototype.IsEqual=function(oElement){return false};ParaDrawing.prototype.Get_Id= function(){return this.Id};ParaDrawing.prototype.GetId=function(){return this.Id};ParaDrawing.prototype.setParagraphTabs=function(tabs){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphTabs==="function")this.GraphicObj.setParagraphTabs(tabs)};ParaDrawing.prototype.IsMovingTableBorder=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.IsMovingTableBorder==="function")return this.GraphicObj.IsMovingTableBorder();return false};ParaDrawing.prototype.SetVerticalClip= function(Top,Bottom){this.LineTop=Top;this.LineBottom=Bottom};ParaDrawing.prototype.Update_Position=function(Paragraph,ParaLayout,PageLimits,PageLimitsOrigin,LineNum){if(undefined!=this.PositionH_Old){this.PositionH.RelativeFrom=this.PositionH_Old.RelativeFrom2;this.PositionH.Align=this.PositionH_Old.Align2;this.PositionH.Value=this.PositionH_Old.Value2;this.PositionH.Percent=this.PositionH_Old.Percent2}if(undefined!=this.PositionV_Old){this.PositionV.RelativeFrom=this.PositionV_Old.RelativeFrom2; this.PositionV.Align=this.PositionV_Old.Align2;this.PositionV.Value=this.PositionV_Old.Value2;this.PositionV.Percent=this.PositionV_Old.Percent2}var oDocumentContent=this.Parent&&this.Parent.Parent;if(oDocumentContent&&oDocumentContent.IsBlockLevelSdtContent())oDocumentContent=oDocumentContent.Parent.Parent;this.Parent=Paragraph;this.DocumentContent=oDocumentContent;var PageNum=ParaLayout.PageNum;var OtherFlowObjects=editor.WordControl.m_oLogicDocument.DrawingObjects.getAllFloatObjectsOnPage(PageNum, this.Parent.Parent);var bInline=this.Is_Inline();this.Internal_Position.Set(this.GraphicObj.extX,this.GraphicObj.extY,this.getXfrmRot(),this.EffectExtent,this.YOffset,ParaLayout,PageLimits);this.Internal_Position.Calculate_X(bInline,this.PositionH.RelativeFrom,this.PositionH.Align,this.PositionH.Value,this.PositionH.Percent);this.Internal_Position.Calculate_Y(bInline,this.PositionV.RelativeFrom,this.PositionV.Align,this.PositionV.Value,this.PositionV.Percent);var bCorrect=false;if(oDocumentContent&& oDocumentContent.IsTableCellContent&&oDocumentContent.IsTableCellContent(false))bCorrect=true;if(this.PositionH.RelativeFrom!==c_oAscRelativeFromH.Page||this.PositionV.RelativeFrom!==c_oAscRelativeFromV.Page)bCorrect=true;this.Internal_Position.Correct_Values(bInline,PageLimits,this.AllowOverlap,this.Use_TextWrap(),OtherFlowObjects,bCorrect);this.GraphicObj.bounds.l=this.GraphicObj.bounds.x+this.Internal_Position.CalcX;this.GraphicObj.bounds.r=this.GraphicObj.bounds.x+this.GraphicObj.bounds.w+this.Internal_Position.CalcX; this.GraphicObj.bounds.t=this.GraphicObj.bounds.y+this.Internal_Position.CalcY;this.GraphicObj.bounds.b=this.GraphicObj.bounds.y+this.GraphicObj.bounds.h+this.Internal_Position.CalcY;var OldPageNum=this.PageNum;this.PageNum=PageNum;this.LineNum=LineNum;this.X=this.Internal_Position.CalcX;this.Y=this.Internal_Position.CalcY;if(undefined!=this.PositionH_Old){this.PositionH.RelativeFrom=this.PositionH_Old.RelativeFrom;this.PositionH.Align=this.PositionH_Old.Align;this.PositionH.Value=this.PositionH_Old.Value; this.PositionH.Percent=this.PositionH_Old.Percent;var Value=this.Internal_Position.Calculate_X_Value(this.PositionH_Old.RelativeFrom);this.Set_PositionH(this.PositionH_Old.RelativeFrom,false,Value,false);this.X=this.Internal_Position.Calculate_X(bInline,this.PositionH.RelativeFrom,this.PositionH.Align,this.PositionH.Value,this.PositionH.Percent)}if(undefined!=this.PositionV_Old){this.PositionV.RelativeFrom=this.PositionV_Old.RelativeFrom;this.PositionV.Align=this.PositionV_Old.Align;this.PositionV.Value= this.PositionV_Old.Value;this.PositionV.Percent=this.PositionV_Old.Percent;var Value=this.Internal_Position.Calculate_Y_Value(this.PositionV_Old.RelativeFrom);this.Set_PositionV(this.PositionV_Old.RelativeFrom,false,Value,false);this.Y=this.Internal_Position.Calculate_Y(bInline,this.PositionV.RelativeFrom,this.PositionV.Align,this.PositionV.Value,this.PositionV.Percent)}this.OrigX=this.X;this.OrigY=this.Y;this.ShiftX=0;this.ShiftY=0;this.updatePosition3(this.PageNum,this.X,this.Y,OldPageNum);this.useWrap= this.Use_TextWrap()};ParaDrawing.prototype.GetClipRect=function(){if(this.Is_Inline()||this.Use_TextWrap()){var oCell;if(this.DocumentContent&&(oCell=this.DocumentContent.IsTableCellContent(true))){var arrPages=oCell.GetCurPageByAbsolutePage(this.PageNum);for(var nIndex=0,nCount=arrPages.length;nIndex<nCount;++nIndex){var oPageBounds=oCell.GetPageBounds(arrPages[nIndex]);if(this.GraphicObj.bounds.isIntersect(oPageBounds.Left,oPageBounds.Top,oPageBounds.Right,oPageBounds.Bottom))return new AscFormat.CGraphicBounds(oPageBounds.Left, oPageBounds.Top,oPageBounds.Right,oPageBounds.Bottom)}}}return null};ParaDrawing.prototype.Update_PositionYHeaderFooter=function(TopMarginY,BottomMarginY){this.Internal_Position.Update_PositionYHeaderFooter(TopMarginY,BottomMarginY);this.Internal_Position.Calculate_Y(this.Is_Inline(),this.PositionV.RelativeFrom,this.PositionV.Align,this.PositionV.Value,this.PositionV.Percent);this.OrigY=this.Internal_Position.CalcY;this.Y=this.OrigY+this.ShiftY;this.updatePosition3(this.PageNum,this.X,this.Y,this.PageNum)}; ParaDrawing.prototype.Reset_SavedPosition=function(){this.PositionV_Old=undefined;this.PositionH_Old=undefined};ParaDrawing.prototype.setParagraphBorders=function(val){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphBorders==="function")this.GraphicObj.setParagraphBorders(val)};ParaDrawing.prototype.deselect=function(){this.selected=false;if(this.GraphicObj&&this.GraphicObj.deselect)this.GraphicObj.deselect()};ParaDrawing.prototype.updatePosition3=function(pageIndex, x,y,oldPageNum){var _x=x,_y=y;this.graphicObjects.removeById(pageIndex,this.Get_Id());if(AscFormat.isRealNumber(oldPageNum))this.graphicObjects.removeById(oldPageNum,this.Get_Id());var bChangePageIndex=this.pageIndex!==pageIndex;this.setPageIndex(pageIndex);if(typeof this.GraphicObj.setStartPage==="function"){var bIsHfdFtr=this.DocumentContent&&this.DocumentContent.IsHdrFtr();this.GraphicObj.setStartPage(pageIndex,bIsHfdFtr,bIsHfdFtr||bChangePageIndex)}if(!(this.DocumentContent&&this.DocumentContent.IsHdrFtr()&& this.DocumentContent.Get_StartPage_Absolute()!==pageIndex)){this.graphicObjects.addObjectOnPage(pageIndex,this.GraphicObj);this.bNoNeedToAdd=false}else this.bNoNeedToAdd=true;if(this.GraphicObj.bNeedUpdatePosition||!(AscFormat.isRealNumber(this.GraphicObj.posX)&&AscFormat.isRealNumber(this.GraphicObj.posY))||!(Math.abs(this.GraphicObj.posX-_x)<MOVE_DELTA&&Math.abs(this.GraphicObj.posY-_y)<MOVE_DELTA))this.GraphicObj.updatePosition(_x,_y);if(this.GraphicObj.bNeedUpdatePosition||!(AscFormat.isRealNumber(this.wrappingPolygon.posX)&& AscFormat.isRealNumber(this.wrappingPolygon.posY))||!(Math.abs(this.wrappingPolygon.posX-_x)<MOVE_DELTA&&Math.abs(this.wrappingPolygon.posY-_y)<MOVE_DELTA))this.wrappingPolygon.updatePosition(_x,_y);this.calculateSnapArrays()};ParaDrawing.prototype.calculateAfterChangeTheme=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.calculateAfterChangeTheme==="function")this.GraphicObj.calculateAfterChangeTheme()};ParaDrawing.prototype.selectionIsEmpty=function(){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.selectionIsEmpty==="function")return this.GraphicObj.selectionIsEmpty();return false};ParaDrawing.prototype.recalculateDocContent=function(){};ParaDrawing.prototype.Shift=function(Dx,Dy){this.ShiftX=Dx;this.ShiftY=Dy;this.X=this.OrigX+Dx;this.Y=this.OrigY+Dy;this.updatePosition3(this.PageNum,this.X,this.Y)};ParaDrawing.prototype.IsLayoutInCell=function(){if(this.LogicDocument&&this.LogicDocument.GetCompatibilityMode()>=AscCommon.document_compatibility_mode_Word15)return true; return this.LayoutInCell};ParaDrawing.prototype.Get_Distance=function(){var oDist=this.Distance;return new AscFormat.CDistance(AscFormat.getValOrDefault(oDist.L,AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT),AscFormat.getValOrDefault(oDist.T,0),AscFormat.getValOrDefault(oDist.R,AscFormat.DISTANCE_TO_TEXT_LEFTRIGHT),AscFormat.getValOrDefault(oDist.B,0))};ParaDrawing.prototype.Set_XYForAdd=function(X,Y,NearPos,PageNum){if(null!==NearPos){var Layout=NearPos.Paragraph.Get_Layout(NearPos.ContentPos,this);this.private_SetXYByLayout(X, Y,PageNum,Layout,true,true);var nRecalcIndex=null;var oLogicDocument=this.document;if(oLogicDocument){nRecalcIndex=oLogicDocument.Get_History().GetRecalculateIndex();this.SetSkipOnRecalculate(true);oLogicDocument.TurnOff_InterfaceEvents();oLogicDocument.Recalculate();oLogicDocument.TurnOn_InterfaceEvents(false);this.SetSkipOnRecalculate(false)}if(null!==nRecalcIndex)oLogicDocument.Get_History().SetRecalculateIndex(nRecalcIndex);Layout=NearPos.Paragraph.Get_Layout(NearPos.ContentPos,this);this.private_SetXYByLayout(X, Y,PageNum,Layout,true,true)}};ParaDrawing.prototype.SetSkipOnRecalculate=function(isSkip){this.SkipOnRecalculate=isSkip};ParaDrawing.prototype.IsSkipOnRecalculate=function(){return this.SkipOnRecalculate};ParaDrawing.prototype.Set_XY=function(X,Y,Paragraph,PageNum,bResetAlign){if(Paragraph){var PageNumOld=this.PageNum;var ContentPos=Paragraph.Get_DrawingObjectContentPos(this.Get_Id());if(null===ContentPos)return;var Layout=Paragraph.Get_Layout(ContentPos,this);this.private_SetXYByLayout(X,Y,PageNum, Layout,bResetAlign||true!==this.PositionH.Align?true:false,bResetAlign||true!==this.PositionV.Align?true:false);var nRecalcIndex=null;var oLogicDocument=this.document;if(oLogicDocument){nRecalcIndex=oLogicDocument.Get_History().GetRecalculateIndex();this.SetSkipOnRecalculate(true);oLogicDocument.Recalculate();this.SetSkipOnRecalculate(false)}if(null!==nRecalcIndex)oLogicDocument.Get_History().SetRecalculateIndex(nRecalcIndex);if(!this.LogicDocument||null===this.LogicDocument.FullRecalc.Id||PageNum< this.LogicDocument.FullRecalc.PageIndex&&PageNumOld<this.LogicDocument.FullRecalc.PageIndex)Layout=Paragraph.Get_Layout(ContentPos,this);this.private_SetXYByLayout(X,Y,PageNum,Layout,bResetAlign||true!==this.PositionH.Align?true:false,bResetAlign||true!==this.PositionV.Align?true:false)}};ParaDrawing.prototype.private_SetXYByLayout=function(X,Y,PageNum,Layout,bChangeX,bChangeY){if(!Layout)return;this.PageNum=PageNum;this.Internal_Position.Set(this.GraphicObj.extX,this.GraphicObj.extY,this.getXfrmRot(), this.EffectExtent,this.YOffset,Layout.ParagraphLayout,Layout.PageLimitsOrigin);this.Internal_Position.Calculate_X(false,c_oAscRelativeFromH.Page,false,X-Layout.PageLimitsOrigin.X,false);this.Internal_Position.Calculate_Y(false,c_oAscRelativeFromV.Page,false,Y-Layout.PageLimitsOrigin.Y,false);var bCorrect=false;if(this.DocumentContent&&this.DocumentContent.IsTableCellContent&&this.DocumentContent.IsTableCellContent(false))bCorrect=true;if(this.PositionH.RelativeFrom!==c_oAscRelativeFromH.Page||this.PositionV.RelativeFrom!== c_oAscRelativeFromV.Page)bCorrect=true;this.Internal_Position.Correct_Values(false,Layout.PageLimits,this.AllowOverlap,this.Use_TextWrap(),[],bCorrect);if(true===bChangeX){this.X=this.Internal_Position.CalcX;var ValueX=this.Internal_Position.Calculate_X_Value(this.PositionH.RelativeFrom);this.Set_PositionH(this.PositionH.RelativeFrom,false,ValueX,false);this.X=this.Internal_Position.Calculate_X(false,this.PositionH.RelativeFrom,this.PositionH.Align,this.PositionH.Value,this.PositionH.Percent)}if(true=== bChangeY){this.Y=this.Internal_Position.CalcY;var ValueY=this.Internal_Position.Calculate_Y_Value(this.PositionV.RelativeFrom);this.Set_PositionV(this.PositionV.RelativeFrom,false,ValueY,false);this.Y=this.Internal_Position.Calculate_Y(false,this.PositionV.RelativeFrom,this.PositionV.Align,this.PositionV.Value,this.PositionV.Percent)}};ParaDrawing.prototype.Get_DrawingType=function(){return this.DrawingType};ParaDrawing.prototype.Is_Inline=function(){if(this.Parent&&this.Parent.Get_ParentTextTransform&& this.Parent.Get_ParentTextTransform())return true;return drawing_Inline===this.DrawingType?true:false};ParaDrawing.prototype.IsInline=function(){return this.Is_Inline()};ParaDrawing.prototype.Use_TextWrap=function(){if(!this.Parent||!this.Parent.Get_FramePr||null!==this.Parent.Get_FramePr()&&undefined!==this.Parent.Get_FramePr())return false;return drawing_Anchor===this.DrawingType&&!(this.wrappingType===WRAPPING_TYPE_NONE)};ParaDrawing.prototype.IsUseTextWrap=function(){return this.Use_TextWrap()}; ParaDrawing.prototype.Draw_Selection=function(){var Padding=this.DrawingDocument.GetMMPerDot(6);var extX,extY;if(this.GraphicObj){extX=this.GraphicObj.extX;extY=this.GraphicObj.extY}else{extX=this.getXfrmExtX();extY=this.getXfrmExtY()}var rot=this.getXfrmRot();if(AscFormat.checkNormalRotate(rot))this.DrawingDocument.AddPageSelection(this.PageNum,this.X-this.EffectExtent.L-Padding,this.Y-this.EffectExtent.T-Padding,this.EffectExtent.L+extX+this.EffectExtent.R+2*Padding,this.EffectExtent.T+extY+this.EffectExtent.B+ 2*Padding);else this.DrawingDocument.AddPageSelection(this.PageNum,this.X+extX/2-extY/2-this.EffectExtent.L-Padding,this.Y+extY/2-extX/2-this.EffectExtent.T-Padding,this.EffectExtent.L+extY+this.EffectExtent.R+2*Padding,this.EffectExtent.T+extX+this.EffectExtent.B+2*Padding)};ParaDrawing.prototype.CanInsertToPos=function(oAnchorPos){if(!oAnchorPos||!oAnchorPos.Paragraph||!oAnchorPos.Paragraph.Parent)return false;return!((this.IsShape()||this.IsGroup())&&(true===oAnchorPos.Paragraph.Parent.Is_DrawingShape()|| true===oAnchorPos.Paragraph.Parent.IsFootnote()))};ParaDrawing.prototype.OnEnd_MoveInline=function(NearPos){if(!this.Parent)return;NearPos.Paragraph.Check_NearestPos(NearPos);var oRun=this.GetRun();var oPictureCC=false;if(oRun){var arrContentControls=oRun.GetParentContentControls();for(var nIndex=arrContentControls.length-1;nIndex>=0;--nIndex)if(arrContentControls[nIndex].IsPicture()){oPictureCC=arrContentControls[nIndex];break}}var oDstRun=null;var arrClasses=NearPos.Paragraph.GetClassesByPos(NearPos.ContentPos); for(var nIndex=arrClasses.length-1;nIndex>=0;--nIndex)if(arrClasses[nIndex]instanceof ParaRun){oDstRun=arrClasses[nIndex];break}if(!oDstRun||oPictureCC&&oDstRun===oRun||oDstRun.GetParentForm()){NearPos.Paragraph.Clear_NearestPosArray();return}var NewParaDrawing=this.Copy();var RunPr=this.Remove_FromDocument(false);this.DocumentContent.Select_DrawingObject(NewParaDrawing.GetId());NewParaDrawing.Add_ToDocument(NearPos,true,RunPr,undefined,oPictureCC)};ParaDrawing.prototype.Get_ParentTextTransform=function(){if(this.Parent)return this.Parent.Get_ParentTextTransform(); return null};ParaDrawing.prototype.GoTo_Text=function(bBefore,bUpdateStates){var Paragraph=this.Get_ParentParagraph();if(Paragraph){Paragraph.MoveCursorToDrawing(this.Id,bBefore);Paragraph.Document_SetThisElementCurrent(undefined===bUpdateStates?true:bUpdateStates)}};ParaDrawing.prototype.Remove_FromDocument=function(bRecalculate){var oResult=null;if(!this.Parent)return oResult;var oRun=this.Parent.Get_DrawingObjectRun(this.Id);if(oRun){var oGrObject=this.GraphicObj;if(oGrObject&&oGrObject.getObjectType()=== AscDFH.historyitem_type_Shape)if(oGrObject.signatureLine)oGrObject.setSignature(oGrObject.signatureLine);var oPictureCC=null;var arrContentControls=oRun.GetParentContentControls();for(var nIndex=arrContentControls.length-1;nIndex>=0;--nIndex)if(arrContentControls[nIndex].IsPicture()){oPictureCC=arrContentControls[nIndex];break}if(oPictureCC)oPictureCC.RemoveContentControlWrapper();oRun.Remove_DrawingObject(this.Id);if(oRun.IsInHyperlink())oResult=new CTextPr;else oResult=oRun.GetTextPr();if(oGrObject&& oGrObject.getObjectType()===AscDFH.historyitem_type_Shape)if(oGrObject.signatureLine){editor.sendEvent("asc_onRemoveSignature",oGrObject.signatureLine.id);oGrObject.setSignature(oGrObject.signatureLine)}}if(false!=bRecalculate)editor.WordControl.m_oLogicDocument.Recalculate();return oResult};ParaDrawing.prototype.Get_ParentParagraph=function(){if(this.Parent instanceof Paragraph)return this.Parent;if(this.Parent instanceof ParaRun)return this.Parent.Paragraph;if(this.Parent&&this.Parent.GetParagraph())return this.Parent.GetParagraph(); return null};ParaDrawing.prototype.SelectAsText=function(){var oParagraph=this.GetParagraph();var oRun=this.GetRun();if(!oParagraph||!oRun)return;var oDocument=oParagraph.GetLogicDocument();if(!oDocument)return;oDocument.RemoveSelection();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this));var oStartPos=oDocument.GetContentPosition(false);oRun.SetCursorPosition(oRun.GetElementPosition(this)+1);var oEndPos=oDocument.GetContentPosition(false);oDocument.RemoveSelection(); oDocument.SetSelectionByContentPositions(oStartPos,oEndPos)};ParaDrawing.prototype.Add_ToDocument=function(NearPos,bRecalculate,RunPr,Run,oPictureCC){NearPos.Paragraph.Check_NearestPos(NearPos);var LogicDocument=this.DrawingDocument.m_oLogicDocument;var Para=new Paragraph(this.DrawingDocument,LogicDocument);var DrawingRun=new ParaRun(Para);DrawingRun.Add_ToContent(0,this);if(RunPr)DrawingRun.Set_Pr(RunPr.Copy());if(Run)DrawingRun.SetReviewTypeWithInfo(Run.GetReviewType(),Run.GetReviewInfo());if(oPictureCC){var oSdt= new CInlineLevelSdt;oSdt.SetPicturePr(true);oSdt.ReplacePlaceHolderWithContent();oSdt.AddToContent(0,DrawingRun);Para.Add_ToContent(0,oSdt);var oFormPr=oPictureCC.GetFormPr();if(oFormPr)oSdt.SetFormPr(oFormPr.Copy())}else Para.Add_ToContent(0,DrawingRun);var SelectedElement=new CSelectedElement(Para,false);var SelectedContent=new CSelectedContent;SelectedContent.Add(SelectedElement);SelectedContent.SetMoveDrawing(true);SelectedContent.DrawingObjects.push(this);NearPos.Paragraph.Parent.InsertContent(SelectedContent, NearPos);NearPos.Paragraph.Clear_NearestPosArray();NearPos.Paragraph.Correct_Content();this.Set_Parent(NearPos.Paragraph);if(false!=bRecalculate)LogicDocument.Recalculate()};ParaDrawing.prototype.Add_ToDocument2=function(Paragraph){var DrawingRun=new ParaRun(Paragraph);DrawingRun.Add_ToContent(0,this);Paragraph.Add_ToContent(0,DrawingRun);this.Set_Parent(Paragraph)};ParaDrawing.prototype.UpdateCursorType=function(X,Y,PageIndex){this.DrawingDocument.SetCursorType("move",new AscCommon.CMouseMoveData); if(null!=this.Parent){var Lock=this.Parent.Lock;if(true===Lock.Is_Locked()){var PNum=Math.max(0,Math.min(PageIndex-this.Parent.PageNum,this.Parent.Pages.length-1));var _X=this.Parent.Pages[PNum].X;var _Y=this.Parent.Pages[PNum].Y;var MMData=new AscCommon.CMouseMoveData;var Coords=this.DrawingDocument.ConvertCoordsToCursorWR(_X,_Y,this.Parent.Get_StartPage_Absolute()+(PageIndex-this.Parent.PageNum));MMData.X_abs=Coords.X-5;MMData.Y_abs=Coords.Y;MMData.Type=Asc.c_oAscMouseMoveDataTypes.LockedObject; MMData.UserId=Lock.Get_UserId();MMData.HaveChanges=Lock.Have_Changes();MMData.LockedObjectType=c_oAscMouseMoveLockedObjectType.Common;editor.sync_MouseMoveCallback(MMData)}}};ParaDrawing.prototype.Get_AnchorPos=function(){if(!this.Parent)return null;return this.Parent.Get_AnchorPos(this)};ParaDrawing.prototype.CheckRecalcAutoFit=function(oSectPr){if(this.GraphicObj&&this.GraphicObj.CheckNeedRecalcAutoFit)if(this.GraphicObj.CheckNeedRecalcAutoFit(oSectPr)){if(this.GraphicObj)this.GraphicObj.recalcWrapPolygon&& this.GraphicObj.recalcWrapPolygon();this.Measure()}};ParaDrawing.prototype.Get_ParentObject_or_DocumentPos=function(){if(this.Parent!=null)return this.Parent.Get_ParentObject_or_DocumentPos()};ParaDrawing.prototype.Refresh_RecalcData=function(Data){var oRun=this.GetRun();if(oRun){if(AscCommon.isRealObject(Data))switch(Data.Type){case AscDFH.historyitem_Drawing_Distance:{if(this.GraphicObj){this.GraphicObj.recalcWrapPolygon&&this.GraphicObj.recalcWrapPolygon();this.GraphicObj.addToRecalculate()}break}case AscDFH.historyitem_Drawing_SetExtent:{oRun.RecalcInfo.Measure= true;break}case AscDFH.historyitem_Drawing_SetSizeRelH:case AscDFH.historyitem_Drawing_SetSizeRelV:case AscDFH.historyitem_Drawing_SetGraphicObject:{if(this.GraphicObj){this.GraphicObj.handleUpdateExtents&&this.GraphicObj.handleUpdateExtents();this.GraphicObj.addToRecalculate()}oRun.RecalcInfo.Measure=true;break}case AscDFH.historyitem_Drawing_WrappingType:{if(this.GraphicObj){this.GraphicObj.recalcWrapPolygon&&this.GraphicObj.recalcWrapPolygon();this.GraphicObj.addToRecalculate()}break}}return oRun.Refresh_RecalcData2()}}; ParaDrawing.prototype.Refresh_RecalcData2=function(Data){var oRun=this.GetRun();if(oRun)return oRun.Refresh_RecalcData2()};ParaDrawing.prototype.hyperlinkCheck=function(bCheck){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.hyperlinkCheck==="function")return this.GraphicObj.hyperlinkCheck(bCheck);return null};ParaDrawing.prototype.hyperlinkCanAdd=function(bCheckInHyperlink){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.hyperlinkCanAdd==="function")return this.GraphicObj.hyperlinkCanAdd(bCheckInHyperlink); return false};ParaDrawing.prototype.hyperlinkRemove=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.hyperlinkCanAdd==="function")return this.GraphicObj.hyperlinkRemove();return false};ParaDrawing.prototype.hyperlinkModify=function(HyperProps){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.hyperlinkModify==="function")return this.GraphicObj.hyperlinkModify(HyperProps)};ParaDrawing.prototype.hyperlinkAdd=function(HyperProps){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.hyperlinkAdd==="function")return this.GraphicObj.hyperlinkAdd(HyperProps)};ParaDrawing.prototype.documentStatistics=function(stat){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.documentStatistics==="function")this.GraphicObj.documentStatistics(stat)};ParaDrawing.prototype.documentCreateFontCharMap=function(fontMap){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.documentCreateFontCharMap==="function")this.GraphicObj.documentCreateFontCharMap(fontMap)}; ParaDrawing.prototype.documentCreateFontMap=function(fontMap){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.documentCreateFontMap==="function")this.GraphicObj.documentCreateFontMap(fontMap)};ParaDrawing.prototype.tableCheckSplit=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.tableCheckSplit==="function")return this.GraphicObj.tableCheckSplit();return false};ParaDrawing.prototype.tableCheckMerge=function(){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.tableCheckMerge==="function")return this.GraphicObj.tableCheckMerge();return false};ParaDrawing.prototype.tableSelect=function(Type){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.tableSelect==="function")return this.GraphicObj.tableSelect(Type)};ParaDrawing.prototype.tableRemoveTable=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.tableRemoveTable==="function")return this.GraphicObj.tableRemoveTable()};ParaDrawing.prototype.tableSplitCell= function(Cols,Rows){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.tableSplitCell==="function")return this.GraphicObj.tableSplitCell(Cols,Rows)};ParaDrawing.prototype.tableMergeCells=function(Cols,Rows){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.tableMergeCells==="function")return this.GraphicObj.tableMergeCells(Cols,Rows)};ParaDrawing.prototype.tableRemoveCol=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.tableRemoveCol=== "function")return this.GraphicObj.tableRemoveCol()};ParaDrawing.prototype.tableAddCol=function(bBefore,nCount){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.tableAddCol==="function")return this.GraphicObj.tableAddCol(bBefore,nCount)};ParaDrawing.prototype.tableRemoveRow=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.tableRemoveRow==="function")return this.GraphicObj.tableRemoveRow()};ParaDrawing.prototype.tableAddRow=function(bBefore,nCount){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.tableAddRow==="function")return this.GraphicObj.tableAddRow(bBefore,nCount)};ParaDrawing.prototype.getCurrentParagraph=function(bIgnoreSelection,arrSelectedParagraphs){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getCurrentParagraph==="function")return this.GraphicObj.getCurrentParagraph(bIgnoreSelection,arrSelectedParagraphs);if(this.Parent instanceof Paragraph)return this.Parent};ParaDrawing.prototype.GetSelectedText=function(bClearText,oPr){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.GetSelectedText==="function")return this.GraphicObj.GetSelectedText(bClearText,oPr);return""};ParaDrawing.prototype.getCurPosXY=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getCurPosXY==="function")return this.GraphicObj.getCurPosXY();return{X:0,Y:0}};ParaDrawing.prototype.setParagraphKeepLines=function(Value){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphKeepLines==="function")return this.GraphicObj.setParagraphKeepLines(Value)}; ParaDrawing.prototype.setParagraphKeepNext=function(Value){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphKeepNext==="function")return this.GraphicObj.setParagraphKeepNext(Value)};ParaDrawing.prototype.setParagraphWidowControl=function(Value){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphWidowControl==="function")return this.GraphicObj.setParagraphWidowControl(Value)};ParaDrawing.prototype.setParagraphPageBreakBefore=function(Value){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.setParagraphPageBreakBefore==="function")return this.GraphicObj.setParagraphPageBreakBefore(Value)};ParaDrawing.prototype.isTextSelectionUse=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.isTextSelectionUse==="function")return this.GraphicObj.isTextSelectionUse();return false};ParaDrawing.prototype.paragraphFormatPaste=function(CopyTextPr,CopyParaPr,Bool){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.isTextSelectionUse==="function")return this.GraphicObj.paragraphFormatPaste(CopyTextPr, CopyParaPr,Bool)};ParaDrawing.prototype.getNearestPos=function(x,y,pageIndex){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getNearestPos==="function")return this.GraphicObj.getNearestPos(x,y,pageIndex);return null};ParaDrawing.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type);Writer.WriteString2(this.Id)};ParaDrawing.prototype.Write_ToBinary2=function(Writer){Writer.WriteLong(AscDFH.historyitem_type_Drawing);Writer.WriteString2(this.Id);AscFormat.writeDouble(Writer, this.Extent.W);AscFormat.writeDouble(Writer,this.Extent.H);AscFormat.writeObject(Writer,this.GraphicObj);AscFormat.writeObject(Writer,this.DocumentContent);AscFormat.writeObject(Writer,this.Parent);AscFormat.writeObject(Writer,this.wrappingPolygon);AscFormat.writeLong(Writer,this.RelativeHeight);AscFormat.writeObject(Writer,this.docPr)};ParaDrawing.prototype.Read_FromBinary2=function(Reader){this.Id=Reader.GetString2();this.DrawingDocument=editor.WordControl.m_oLogicDocument.DrawingDocument;this.LogicDocument= this.DrawingDocument?this.DrawingDocument.m_oLogicDocument:null;this.Extent.W=AscFormat.readDouble(Reader);this.Extent.H=AscFormat.readDouble(Reader);this.GraphicObj=AscFormat.readObject(Reader);this.DocumentContent=AscFormat.readObject(Reader);this.Parent=AscFormat.readObject(Reader);this.wrappingPolygon=AscFormat.readObject(Reader);this.RelativeHeight=AscFormat.readLong(Reader);this.docPr=AscFormat.readObject(Reader);if(this.wrappingPolygon)this.wrappingPolygon.wordGraphicObject=this;this.drawingDocument= editor.WordControl.m_oLogicDocument.DrawingDocument;this.document=editor.WordControl.m_oLogicDocument;this.graphicObjects=editor.WordControl.m_oLogicDocument.DrawingObjects;this.graphicObjects.addGraphicObject(this);g_oTableId.Add(this,this.Id)};ParaDrawing.prototype.Load_LinkData=function(){};ParaDrawing.prototype.draw=function(graphics,PDSE){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.draw==="function"){graphics.SaveGrState();var bInline=this.Is_Inline();if(bInline&&AscCommon.isRealObject(PDSE)&& AscFormat.isRealNumber(this.LineTop)&&AscFormat.isRealNumber(this.LineBottom)&&AscCommon.isRealObject(this.GraphicObj.bounds)){var x,y,w,h;var oEffectExtent=this.EffectExtent;x=PDSE.X;y=this.LineTop;w=this.GraphicObj.bounds.r-this.GraphicObj.bounds.l+AscFormat.getValOrDefault(oEffectExtent.R,0)+AscFormat.getValOrDefault(oEffectExtent.L,0);h=this.LineBottom-this.LineTop;graphics.AddClipRect(x,y,w,h)}this.GraphicObj.draw(graphics);graphics.RestoreGrState()}};ParaDrawing.prototype.drawAdjustments=function(){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.drawAdjustments==="function")this.GraphicObj.drawAdjustments()};ParaDrawing.prototype.getTransformMatrix=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getTransformMatrix==="function")return this.GraphicObj.getTransformMatrix();return null};ParaDrawing.prototype.getExtensions=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getExtensions==="function")return this.GraphicObj.getExtensions();return null};ParaDrawing.prototype.isGroup= function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.isGroup==="function")return this.GraphicObj.isGroup();return false};ParaDrawing.prototype.isShapeChild=function(bRetShape){if(!this.Is_Inline()||!this.DocumentContent)return bRetShape?null:false;var cur_doc_content=this.DocumentContent;var oCell;while(oCell=cur_doc_content.IsTableCellContent(true))cur_doc_content=oCell.Row.Table.Parent;if(AscCommon.isRealObject(cur_doc_content.Parent)&&typeof cur_doc_content.Parent.getObjectType=== "function"&&cur_doc_content.Parent.getObjectType()===AscDFH.historyitem_type_Shape)return bRetShape?cur_doc_content.Parent:true;return bRetShape?null:false};ParaDrawing.prototype.checkShapeChildAndGetTopParagraph=function(paragraph){var parent_paragraph=!paragraph?this.Get_ParentParagraph():paragraph;var parent_doc_content=parent_paragraph.Parent;if(parent_doc_content.Parent instanceof AscFormat.CShape)if(!parent_doc_content.Parent.group)return parent_doc_content.Parent.parent.Get_ParentParagraph(); else{var top_group=parent_doc_content.Parent.group;while(top_group.group)top_group=top_group.group;return top_group.parent.Get_ParentParagraph()}else if(parent_doc_content.IsTableCellContent()){var top_doc_content=parent_doc_content;var oCell;while(oCell=top_doc_content.IsTableCellContent(true))top_doc_content=oCell.Row.Table.Parent;if(top_doc_content.Parent instanceof AscFormat.CShape)if(!top_doc_content.Parent.group)return top_doc_content.Parent.parent.Get_ParentParagraph();else{var top_group=top_doc_content.Parent.group; while(top_group.group)top_group=top_group.group;return top_group.parent.Get_ParentParagraph()}else return parent_paragraph}return parent_paragraph};ParaDrawing.prototype.hit=function(x,y){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.hit==="function")return this.GraphicObj.hit(x,y);return false};ParaDrawing.prototype.hitToTextRect=function(x,y){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.hitToTextRect==="function")return this.GraphicObj.hitToTextRect(x, y);return false};ParaDrawing.prototype.cursorGetPos=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.cursorGetPos==="function")return this.GraphicObj.cursorGetPos();return{X:0,Y:0}};ParaDrawing.prototype.getResizeCoefficients=function(handleNum,x,y){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getResizeCoefficients==="function")return this.GraphicObj.getResizeCoefficients(handleNum,x,y);return{kd1:1,kd2:1}};ParaDrawing.prototype.getParagraphParaPr= function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getParagraphParaPr==="function")return this.GraphicObj.getParagraphParaPr();return null};ParaDrawing.prototype.getParagraphTextPr=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getParagraphTextPr==="function")return this.GraphicObj.getParagraphTextPr();return null};ParaDrawing.prototype.getAngle=function(x,y){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getAngle==="function")return this.GraphicObj.getAngle(x, y);return 0};ParaDrawing.prototype.calculateSnapArrays=function(){this.GraphicObj.snapArrayX.length=0;this.GraphicObj.snapArrayY.length=0;if(this.GraphicObj)this.GraphicObj.recalculateSnapArrays()};ParaDrawing.prototype.recalculateCurPos=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.recalculateCurPos==="function")this.GraphicObj.recalculateCurPos()};ParaDrawing.prototype.setPageIndex=function(newPageIndex){this.pageIndex=newPageIndex;this.PageNum=newPageIndex};ParaDrawing.prototype.Get_PageNum= function(){return this.PageNum};ParaDrawing.prototype.GetAllParagraphs=function(Props,ParaArray){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.GetAllParagraphs==="function")this.GraphicObj.GetAllParagraphs(Props,ParaArray)};ParaDrawing.prototype.GetAllTables=function(oProps,arrTables){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.GetAllTables==="function")this.GraphicObj.GetAllTables(oProps,arrTables)};ParaDrawing.prototype.GetAllDocContents=function(aDocContents){var _ret= Array.isArray(aDocContents)?aDocContents:[];if(this.GraphicObj)this.GraphicObj.getAllDocContents(_ret);return _ret};ParaDrawing.prototype.getTableProps=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getTableProps==="function")return this.GraphicObj.getTableProps();return null};ParaDrawing.prototype.canGroup=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.canGroup==="function")return this.GraphicObj.canGroup();return false};ParaDrawing.prototype.canUnGroup= function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.canGroup==="function")return this.GraphicObj.canUnGroup();return false};ParaDrawing.prototype.select=function(pageIndex){this.selected=true;if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.select==="function")this.GraphicObj.select(pageIndex)};ParaDrawing.prototype.paragraphClearFormatting=function(isClearParaPr,isClearTextPr){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.paragraphAdd=== "function")this.GraphicObj.paragraphClearFormatting(isClearParaPr,isClearTextPr)};ParaDrawing.prototype.paragraphAdd=function(paraItem,bRecalculate){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.paragraphAdd==="function")this.GraphicObj.paragraphAdd(paraItem,bRecalculate)};ParaDrawing.prototype.setParagraphShd=function(Shd){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphShd==="function")this.GraphicObj.setParagraphShd(Shd)};ParaDrawing.prototype.getArrayWrapPolygons= function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getArrayWrapPolygons==="function")return this.GraphicObj.getArrayWrapPolygons();return[]};ParaDrawing.prototype.getArrayWrapIntervals=function(x0,y0,x1,y1,Y0Sp,Y1Sp,LeftField,RightField,arr_intervals,bMathWrap){if(this.wrappingType===WRAPPING_TYPE_THROUGH||this.wrappingType===WRAPPING_TYPE_TIGHT){y0=Y0Sp;y1=Y1Sp}this.wrappingPolygon.wordGraphicObject=this;return this.wrappingPolygon.getArrayWrapIntervals(x0,y0,x1,y1,LeftField, RightField,arr_intervals,bMathWrap)};ParaDrawing.prototype.setAllParagraphNumbering=function(numInfo){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setAllParagraphNumbering==="function")this.GraphicObj.setAllParagraphNumbering(numInfo)};ParaDrawing.prototype.addNewParagraph=function(bRecalculate){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.addNewParagraph==="function")this.GraphicObj.addNewParagraph(bRecalculate)};ParaDrawing.prototype.addInlineTable=function(nCols, nRows,nMode){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.addInlineTable==="function")return this.GraphicObj.addInlineTable(nCols,nRows,nMode);return null};ParaDrawing.prototype.applyTextPr=function(paraItem,bRecalculate){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.applyTextPr==="function")this.GraphicObj.applyTextPr(paraItem,bRecalculate)};ParaDrawing.prototype.allIncreaseDecFontSize=function(bIncrease){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.allIncreaseDecFontSize=== "function")this.GraphicObj.allIncreaseDecFontSize(bIncrease)};ParaDrawing.prototype.setParagraphNumbering=function(NumInfo){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphNumbering==="function")this.GraphicObj.setParagraphNumbering(NumInfo)};ParaDrawing.prototype.allIncreaseDecIndent=function(bIncrease){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.allIncreaseDecIndent==="function")this.GraphicObj.allIncreaseDecIndent(bIncrease)};ParaDrawing.prototype.allSetParagraphAlign= function(align){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.allSetParagraphAlign==="function")this.GraphicObj.allSetParagraphAlign(align)};ParaDrawing.prototype.paragraphIncreaseDecFontSize=function(bIncrease){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.paragraphIncreaseDecFontSize==="function")this.GraphicObj.paragraphIncreaseDecFontSize(bIncrease)};ParaDrawing.prototype.paragraphIncreaseDecIndent=function(bIncrease){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.paragraphIncreaseDecIndent==="function")this.GraphicObj.paragraphIncreaseDecIndent(bIncrease)};ParaDrawing.prototype.setParagraphAlign=function(align){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphAlign==="function")this.GraphicObj.setParagraphAlign(align)};ParaDrawing.prototype.setParagraphSpacing=function(Spacing){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphSpacing==="function")this.GraphicObj.setParagraphSpacing(Spacing)}; ParaDrawing.prototype.updatePosition=function(x,y){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.updatePosition==="function")this.GraphicObj.updatePosition(x,y)};ParaDrawing.prototype.updatePosition2=function(x,y){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.updatePosition==="function")this.GraphicObj.updatePosition2(x,y)};ParaDrawing.prototype.addInlineImage=function(W,H,Img,chart,bFlow){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.addInlineImage=== "function")this.GraphicObj.addInlineImage(W,H,Img,chart,bFlow)};ParaDrawing.prototype.addSignatureLine=function(oSignatureDrawing){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.addSignatureLine==="function")this.GraphicObj.addSignatureLine(oSignatureDrawing)};ParaDrawing.prototype.canAddComment=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.canAddComment==="function")return this.GraphicObj.canAddComment();return false};ParaDrawing.prototype.addComment= function(commentData){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.addComment==="function")return this.GraphicObj.addComment(commentData)};ParaDrawing.prototype.selectionSetStart=function(x,y,event,pageIndex){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.selectionSetStart==="function")this.GraphicObj.selectionSetStart(x,y,event,pageIndex)};ParaDrawing.prototype.selectionSetEnd=function(x,y,event,pageIndex){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.selectionSetEnd=== "function")this.GraphicObj.selectionSetEnd(x,y,event,pageIndex)};ParaDrawing.prototype.selectionRemove=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.selectionRemove==="function")this.GraphicObj.selectionRemove()};ParaDrawing.prototype.updateSelectionState=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.updateSelectionState==="function")this.GraphicObj.updateSelectionState()};ParaDrawing.prototype.cursorMoveLeft=function(AddToSelect,Word){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.cursorMoveLeft==="function")this.GraphicObj.cursorMoveLeft(AddToSelect,Word)};ParaDrawing.prototype.cursorMoveRight=function(AddToSelect,Word){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.cursorMoveRight==="function")this.GraphicObj.cursorMoveRight(AddToSelect,Word)};ParaDrawing.prototype.cursorMoveUp=function(AddToSelect){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.cursorMoveUp==="function")this.GraphicObj.cursorMoveUp(AddToSelect)}; ParaDrawing.prototype.cursorMoveDown=function(AddToSelect){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.cursorMoveDown==="function")this.GraphicObj.cursorMoveDown(AddToSelect)};ParaDrawing.prototype.cursorMoveEndOfLine=function(AddToSelect){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.cursorMoveEndOfLine==="function")this.GraphicObj.cursorMoveEndOfLine(AddToSelect)};ParaDrawing.prototype.cursorMoveStartOfLine=function(AddToSelect){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.cursorMoveStartOfLine==="function")this.GraphicObj.cursorMoveStartOfLine(AddToSelect)};ParaDrawing.prototype.remove=function(Count,isRemoveWholeElement,bRemoveOnlySelection,bOnTextAdd){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.remove==="function")this.GraphicObj.remove(Count,isRemoveWholeElement,bRemoveOnlySelection,bOnTextAdd)};ParaDrawing.prototype.hitToWrapPolygonPoint=function(x,y){if(this.wrappingPolygon&&this.wrappingPolygon.arrPoints.length>0){var radius= this.drawingDocument.GetMMPerDot(AscCommon.TRACK_CIRCLE_RADIUS);var arr_point=this.wrappingPolygon.calculatedPoints;var point_count=arr_point.length;var dx,dy;var previous_point;for(var i=0;i<arr_point.length;++i){var cur_point=arr_point[i];dx=x-cur_point.x;dy=y-cur_point.y;if(Math.sqrt(dx*dx+dy*dy)<radius)return{hit:true,hitType:WRAP_HIT_TYPE_POINT,pointNum:i}}cur_point=arr_point[0];previous_point=arr_point[arr_point.length-1];var vx,vy;vx=cur_point.x-previous_point.x;vy=cur_point.y-previous_point.y; if(Math.abs(vx)>0||Math.abs(vy)>0)if(HitInLine(this.drawingDocument.CanvasHitContext,x,y,previous_point.x,previous_point.y,cur_point.x,cur_point.y))return{hit:true,hitType:WRAP_HIT_TYPE_SECTION,pointNum1:arr_point.length-1,pointNum2:0};for(var point_index=1;point_index<point_count;++point_index){cur_point=arr_point[point_index];previous_point=arr_point[point_index-1];vx=cur_point.x-previous_point.x;vy=cur_point.y-previous_point.y;if(Math.abs(vx)>0||Math.abs(vy)>0)if(HitInLine(this.drawingDocument.CanvasHitContext, x,y,previous_point.x,previous_point.y,cur_point.x,cur_point.y))return{hit:true,hitType:WRAP_HIT_TYPE_SECTION,pointNum1:point_index-1,pointNum2:point_index}}}return{hit:false}};ParaDrawing.prototype.documentGetAllFontNames=function(AllFonts){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.documentGetAllFontNames==="function")this.GraphicObj.documentGetAllFontNames(AllFonts)};ParaDrawing.prototype.isCurrentElementParagraph=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.isCurrentElementParagraph=== "function")return this.GraphicObj.isCurrentElementParagraph();return false};ParaDrawing.prototype.isCurrentElementTable=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.isCurrentElementTable==="function")return this.GraphicObj.isCurrentElementTable();return false};ParaDrawing.prototype.canChangeWrapPolygon=function(){if(this.Is_Inline())return false;if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.canChangeWrapPolygon==="function")return this.GraphicObj.canChangeWrapPolygon(); return false};ParaDrawing.prototype.init=function(){};ParaDrawing.prototype.calculateAfterOpen=function(){};ParaDrawing.prototype.getBounds=function(){return this.GraphicObj.bounds};ParaDrawing.prototype.getWrapContour=function(){if(AscCommon.isRealObject(this.wrappingPolygon)){var kw=1/36E3;var kh=1/36E3;var rel_points=this.wrappingPolygon.relativeArrPoints;var ret=[];for(var i=0;i<rel_points.length;++i)ret[i]={x:rel_points[i].x*kw,y:rel_points[i].y*kh};return ret}return[]};ParaDrawing.prototype.getDrawingArrayType= function(){if(this.Is_Inline())return DRAWING_ARRAY_TYPE_INLINE;if(this.behindDoc===true)if(this.wrappingType===WRAPPING_TYPE_NONE||this.document&&this.document.GetCompatibilityMode&&this.document.GetCompatibilityMode()<AscCommon.document_compatibility_mode_Word15)return DRAWING_ARRAY_TYPE_BEHIND;return DRAWING_ARRAY_TYPE_BEFORE};ParaDrawing.prototype.GetWatermarkProps=function(){return this.GraphicObj.getWatermarkProps()};ParaDrawing.prototype.documentSearch=function(String,search_Common){if(AscCommon.isRealObject(this.GraphicObj)&& typeof this.GraphicObj.documentSearch==="function")this.GraphicObj.documentSearch(String,search_Common)};ParaDrawing.prototype.setParagraphContextualSpacing=function(Value){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphContextualSpacing==="function")this.GraphicObj.setParagraphContextualSpacing(Value)};ParaDrawing.prototype.setParagraphStyle=function(style){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.setParagraphStyle==="function")this.GraphicObj.setParagraphStyle(style)}; ParaDrawing.prototype.CopyComments=function(){if(!this.GraphicObj)return;this.GraphicObj.copyComments(this.LogicDocument)};ParaDrawing.prototype.copy=function(){var c=new ParaDrawing(this.Extent.W,this.Extent.H,null,editor.WordControl.m_oLogicDocument.DrawingDocument,null,null);c.Set_DrawingType(this.DrawingType);if(AscCommon.isRealObject(this.GraphicObj)){var g=this.GraphicObj.copy(undefined);c.Set_GraphicObject(g);g.setParent(c)}var d=this.Distance;c.Set_PositionH(this.PositionH.RelativeFrom,this.PositionH.Align, this.PositionH.Value,this.PositionH.Percent);c.Set_PositionV(this.PositionV.RelativeFrom,this.PositionV.Align,this.PositionV.Value,this.PositionV.Percent);c.Set_Distance(d.L,d.T,d.R,d.B);c.Set_AllowOverlap(this.AllowOverlap);c.Set_WrappingType(this.wrappingType);c.Set_BehindDoc(this.behindDoc);var EE=this.EffectExtent;c.setEffectExtent(EE.L,EE.T,EE.R,EE.B);return c};ParaDrawing.prototype.OnContentReDraw=function(){if(this.Parent&&this.Parent.Parent)this.Parent.Parent.OnContentReDraw(this.PageNum, this.PageNum)};ParaDrawing.prototype.getBase64Img=function(){if(AscCommon.isRealObject(this.GraphicObj)&&typeof this.GraphicObj.getBase64Img==="function")return this.GraphicObj.getBase64Img();return null};ParaDrawing.prototype.isPointInObject=function(x,y,pageIndex){if(this.pageIndex===pageIndex)if(AscCommon.isRealObject(this.GraphicObj)){var hit=typeof this.GraphicObj.hit==="function"?this.GraphicObj.hit(x,y):false;var hit_to_text=typeof this.GraphicObj.hitToTextRect==="function"?this.GraphicObj.hitToTextRect(x, y):false;return hit||hit_to_text}return false};ParaDrawing.prototype.Restart_CheckSpelling=function(){this.GraphicObj&&this.GraphicObj.Restart_CheckSpelling&&this.GraphicObj.Restart_CheckSpelling()};ParaDrawing.prototype.IsMathEquation=function(){if(undefined!==this.ParaMath&&null!==this.ParaMath)return true;return false};ParaDrawing.prototype.ConvertToMath=function(isUpdatePos){if(!this.IsMathEquation())return;var oParagraph=this.GetParagraph();if(!oParagraph)return;var oLogicDocument=oParagraph.GetLogicDocument(); if(!oLogicDocument)return;var oParaContentPos=oParagraph.Get_PosByDrawing(this.GetId());if(!oParaContentPos)return;var nDepth=oParaContentPos.GetDepth();var nTopElementPos=oParaContentPos.Get(0);var nBotElementPos=oParaContentPos.Get(nDepth);var oTopElement=oParagraph.Content[nTopElementPos];var oRunPos=oParaContentPos.Copy();oRunPos.DecreaseDepth(1);var oRun=oParagraph.Get_ElementByPos(oRunPos);if(!oTopElement||!oTopElement.Content||!(oRun instanceof ParaRun))return;this.ParaMath.Correct_AfterConvertFromEquation(); oRun.RemoveFromContent(nBotElementPos,1);if(true===oRun.IsEmpty())oRun.Set_Position(undefined);var oRightElement=oTopElement.Split(oParaContentPos,1);oParagraph.AddToContent(nTopElementPos+1,oRightElement);oParagraph.AddToContent(nTopElementPos+1,this.ParaMath);oParagraph.Correct_Content(nTopElementPos,nTopElementPos+2);if(isUpdatePos){oRightElement.MoveCursorToStartPos();oParagraph.CurPos.ContentPos=nTopElementPos+2;oParagraph.Document_SetThisElementCurrent(false)}};ParaDrawing.prototype.GetRevisionsChangeElement= function(SearchEngine){if(this.GraphicObj&&this.GraphicObj.GetRevisionsChangeElement)this.GraphicObj.GetRevisionsChangeElement(SearchEngine)};ParaDrawing.prototype.Get_ObjectType=function(){if(this.GraphicObj)return this.GraphicObj.getObjectType();return AscDFH.historyitem_type_Drawing};ParaDrawing.prototype.GetAllContentControls=function(arrContentControls){if(this.GraphicObj)this.GraphicObj.GetAllContentControls(arrContentControls)};ParaDrawing.prototype.UpdateBookmarks=function(oManager){var arrDocContents= this.GetAllDocContents();for(var nIndex=0,nCount=arrDocContents.length;nIndex<nCount;++nIndex)arrDocContents[nIndex].UpdateBookmarks(oManager)};ParaDrawing.prototype.PreDelete=function(){if(this.bNotPreDelete===true)return;var arrDocContents=this.GetAllDocContents();for(var nIndex=0,nCount=arrDocContents.length;nIndex<nCount;++nIndex)arrDocContents[nIndex].PreDelete();var oGrObject=this.GraphicObj;if(oGrObject&&oGrObject.signatureLine){var sId=oGrObject.signatureLine.id;oGrObject.setSignature(null); editor&&editor.sendEvent("asc_onRemoveSignature",sId)}};ParaDrawing.prototype.CheckContentControlEditingLock=function(){if(this.DocumentContent&&this.DocumentContent.CheckContentControlEditingLock)this.DocumentContent.CheckContentControlEditingLock()};ParaDrawing.prototype.Document_Is_SelectionLocked=function(CheckType){if(CheckType===AscCommon.changestype_Drawing_Props)this.Lock.Check(this.Get_Id())};ParaDrawing.prototype.CheckDeletingLock=function(){var arrDocContents=this.GetAllDocContents();for(var nIndex= 0,nCount=arrDocContents.length;nIndex<nCount;++nIndex){arrDocContents[nIndex].Set_ApplyToAll(true);arrDocContents[nIndex].Document_Is_SelectionLocked(AscCommon.changestype_Remove);arrDocContents[nIndex].Set_ApplyToAll(false)}};ParaDrawing.prototype.GetAllFields=function(isUseSelection,arrFields){if(this.GraphicObj)return this.GraphicObj.GetAllFields(isUseSelection,arrFields);return arrFields?arrFields:[]};ParaDrawing.prototype.GetAllSeqFieldsByType=function(sType,aFields){if(this.GraphicObj)return this.GraphicObj.GetAllSeqFieldsByType(sType, aFields)};ParaDrawing.prototype.IsPicture=function(){return this.GraphicObj.getObjectType()===AscDFH.historyitem_type_ImageShape};ParaDrawing.prototype.GetPicture=function(){return this.GraphicObj.getObjectType()===AscDFH.historyitem_type_ImageShape?this.GraphicObj:null};ParaDrawing.prototype.IsShape=function(){return this.GraphicObj.getObjectType()===AscDFH.historyitem_type_Shape};ParaDrawing.prototype.IsGroup=function(){return this.GraphicObj.getObjectType()===AscDFH.historyitem_type_GroupShape}; function CParagraphLayout(X,Y,PageNum,LastItemW,ColumnStartX,ColumnEndX,Left_Margin,Right_Margin,Page_W,Top_Margin,Bottom_Margin,Page_H,MarginH,MarginV,LineTop,ParagraphTop){this.X=X;this.Y=Y;this.PageNum=PageNum;this.LastItemW=LastItemW;this.ColumnStartX=ColumnStartX;this.ColumnEndX=ColumnEndX;this.Left_Margin=Left_Margin;this.Right_Margin=Right_Margin;this.Page_W=Page_W;this.Top_Margin=Top_Margin;this.Bottom_Margin=Bottom_Margin;this.Page_H=Page_H;this.Margin_H=MarginH;this.Margin_V=MarginV;this.LineTop= LineTop;this.ParagraphTop=ParagraphTop}function CAnchorPosition(){this.CalcX=0;this.CalcY=0;this.YOffset=0;this.W=0;this.H=0;this.X=0;this.Y=0;this.PageNum=0;this.LastItemW=0;this.ColumnStartX=0;this.ColumnEndX=0;this.Left_Margin=0;this.Right_Margin=0;this.Page_W=0;this.Top_Margin=0;this.Bottom_Margin=0;this.Page_H=0;this.Margin_H=0;this.Margin_V=0;this.LineTop=0;this.ParagraphTop=0;this.Page_X=0;this.Page_Y=0}CAnchorPosition.prototype.Set=function(W,H,Rot,EffectExtent,YOffset,ParaLayout,PageLimits){this.W= W;this.H=H;this.Rot=Rot;this.EffectExtentL=EffectExtent.L;this.EffectExtentT=EffectExtent.T;this.EffectExtentR=EffectExtent.R;this.EffectExtentB=EffectExtent.B;this.YOffset=YOffset;this.X=ParaLayout.X;this.Y=ParaLayout.Y;this.PageNum=ParaLayout.PageNum;this.LastItemW=ParaLayout.LastItemW;this.ColumnStartX=ParaLayout.ColumnStartX;this.ColumnEndX=ParaLayout.ColumnEndX;this.Left_Margin=ParaLayout.Left_Margin;this.Right_Margin=ParaLayout.Right_Margin;this.Page_W=PageLimits.XLimit-PageLimits.X;this.Top_Margin= ParaLayout.Top_Margin;this.Bottom_Margin=ParaLayout.Bottom_Margin;this.Page_H=PageLimits.YLimit-PageLimits.Y;this.Margin_H=ParaLayout.Margin_H;this.Margin_V=ParaLayout.Margin_V;this.LineTop=ParaLayout.LineTop;this.ParagraphTop=ParaLayout.ParagraphTop;this.Page_X=PageLimits.X;this.Page_Y=PageLimits.Y};CAnchorPosition.prototype.Calculate_X=function(bInline,RelativeFrom,bAlign,Value,bPercent){var _W;if(AscFormat.checkNormalRotate(this.Rot))_W=this.W;else _W=this.H;var Width=_W+this.EffectExtentL+this.EffectExtentR; var Shift=this.EffectExtentL+_W/2-this.W/2;if(true===bInline)this.CalcX=this.X+Shift;else{var _RelativeFrom=RelativeFrom;if(_RelativeFrom===c_oAscRelativeFromH.InsideMargin)if(0===this.PageNum%2)_RelativeFrom=c_oAscRelativeFromH.LeftMargin;else _RelativeFrom=c_oAscRelativeFromH.RightMargin;else if(_RelativeFrom===c_oAscRelativeFromH.OutsideMargin)if(0===this.PageNum%2)_RelativeFrom=c_oAscRelativeFromH.RightMargin;else _RelativeFrom=c_oAscRelativeFromH.LeftMargin;switch(_RelativeFrom){case c_oAscRelativeFromH.Character:{var _X= this.X-this.LastItemW;if(true===bAlign)switch(Value){case c_oAscAlignH.Center:{this.CalcX=_X-this.W/2;break}case c_oAscAlignH.Inside:case c_oAscAlignH.Outside:case c_oAscAlignH.Left:{this.CalcX=_X+Shift;break}case c_oAscAlignH.Right:{this.CalcX=_X-this.EffectExtentR-_W/2-this.W/2;break}}else this.CalcX=_X+Value;break}case c_oAscRelativeFromH.Column:{if(true===bAlign)switch(Value){case c_oAscAlignH.Center:{this.CalcX=(this.ColumnEndX+this.ColumnStartX-Width)/2+this.EffectExtentL+_W/2-this.W/2;break}case c_oAscAlignH.Inside:case c_oAscAlignH.Outside:case c_oAscAlignH.Left:{this.CalcX= this.ColumnStartX+Shift;break}case c_oAscAlignH.Right:{this.CalcX=this.ColumnEndX-this.EffectExtentR-_W/2-this.W/2;break}}else this.CalcX=this.ColumnStartX+Value;break}case c_oAscRelativeFromH.LeftMargin:{if(true===bAlign)switch(Value){case c_oAscAlignH.Center:{this.CalcX=(this.Left_Margin-Width)/2+Shift;break}case c_oAscAlignH.Inside:case c_oAscAlignH.Outside:case c_oAscAlignH.Left:{this.CalcX=Shift;break}case c_oAscAlignH.Right:{this.CalcX=this.Left_Margin-(_W/2+this.EffectExtentR)-this.W/2;break}}else if(true=== bPercent)this.CalcX=this.Page_X+this.Left_Margin*Value/100+Shift;else this.CalcX=Value;break}case c_oAscRelativeFromH.Margin:{var X_s=this.Page_X+this.Left_Margin;var X_e=this.Page_X+this.Page_W-this.Right_Margin;if(true===bAlign)switch(Value){case c_oAscAlignH.Center:{this.CalcX=(X_e+X_s-Width)/2+Shift;break}case c_oAscAlignH.Inside:case c_oAscAlignH.Outside:case c_oAscAlignH.Left:{this.CalcX=X_s+Shift;break}case c_oAscAlignH.Right:{this.CalcX=X_e-(_W/2+this.EffectExtentR)-this.W/2;break}}else if(true=== bPercent)this.CalcX=X_s+(X_e-X_s)*Value/100+Shift;else this.CalcX=this.Margin_H+Value;break}case c_oAscRelativeFromH.Page:{if(true===bAlign)switch(Value){case c_oAscAlignH.Center:{this.CalcX=(this.Page_W-Width)/2+Shift;break}case c_oAscAlignH.Inside:case c_oAscAlignH.Outside:case c_oAscAlignH.Left:{this.CalcX=Shift;break}case c_oAscAlignH.Right:{this.CalcX=this.Page_W-Width+Shift;break}}else if(true===bPercent)this.CalcX=this.Page_X+this.Page_W*Value/100+Shift;else this.CalcX=Value+this.Page_X;break}case c_oAscRelativeFromH.RightMargin:{var X_s= this.Page_X+this.Page_W-this.Right_Margin;var X_e=this.Page_X+this.Page_W;if(true===bAlign)switch(Value){case c_oAscAlignH.Center:{this.CalcX=(X_e+X_s-Width)/2+Shift;break}case c_oAscAlignH.Inside:case c_oAscAlignH.Outside:case c_oAscAlignH.Left:{this.CalcX=X_s+Shift;break}case c_oAscAlignH.Right:{this.CalcX=X_e-Width+Shift;break}}else if(true===bPercent)this.CalcX=X_s+(X_e-X_s)*Value/100+Shift;else this.CalcX=X_s+Value;break}}}return this.CalcX};CAnchorPosition.prototype.Calculate_Y=function(bInline, RelativeFrom,bAlign,Value,bPercent){var _H;if(AscFormat.checkNormalRotate(this.Rot))_H=this.H;else _H=this.W;var Height=this.EffectExtentB+_H+this.EffectExtentT;var Shift=this.EffectExtentT+_H/2-this.H/2;if(true===bInline)this.CalcY=this.Y-this.YOffset-Height+Shift;else switch(RelativeFrom){case c_oAscRelativeFromV.BottomMargin:case c_oAscRelativeFromV.InsideMargin:case c_oAscRelativeFromV.OutsideMargin:{var _Y=this.Page_H-this.Bottom_Margin;if(true===bAlign)switch(Value){case c_oAscAlignV.Bottom:case c_oAscAlignV.Outside:{this.CalcY= this.Page_H-Height+Shift;break}case c_oAscAlignV.Center:{this.CalcY=(_Y+this.Page_H-Height)/2+Shift;break}case c_oAscAlignV.Inside:case c_oAscAlignV.Top:{this.CalcY=_Y+Shift;break}}else if(true===bPercent)if(Math.abs(this.Page_Y)>.001)this.CalcY=this.Margin_V+Shift;else this.CalcY=_Y+this.Bottom_Margin*Value/100+Shift;else this.CalcY=_Y+Value;break}case c_oAscRelativeFromV.Line:{var _Y=this.LineTop;if(true===bAlign)switch(Value){case c_oAscAlignV.Bottom:case c_oAscAlignV.Outside:{this.CalcY=_Y-this.EffectExtentB- Height+Shift;break}case c_oAscAlignV.Center:{this.CalcY=_Y-Height/2+Shift;break}case c_oAscAlignV.Inside:case c_oAscAlignV.Top:{this.CalcY=_Y+Shift;break}}else this.CalcY=_Y+Value;break}case c_oAscRelativeFromV.Margin:{var Y_s=this.Top_Margin;var Y_e=this.Page_H-this.Bottom_Margin;if(true===bAlign)switch(Value){case c_oAscAlignV.Bottom:case c_oAscAlignV.Outside:{this.CalcY=Y_e-Height+Shift;break}case c_oAscAlignV.Center:{this.CalcY=(Y_s+Y_e-Height)/2+Shift;break}case c_oAscAlignV.Inside:case c_oAscAlignV.Top:{this.CalcY= Y_s+Shift;break}}else if(true===bPercent)if(Math.abs(this.Page_Y)>.001)this.CalcY=this.Margin_V+Shift;else this.CalcY=Y_s+(Y_e-Y_s)*Value/100+Shift;else this.CalcY=this.Margin_V+Value;break}case c_oAscRelativeFromV.Page:{if(true===bAlign)switch(Value){case c_oAscAlignV.Bottom:case c_oAscAlignV.Outside:{this.CalcY=this.Page_H-Height+Shift;break}case c_oAscAlignV.Center:{this.CalcY=(this.Page_H-Height)/2+Shift;break}case c_oAscAlignV.Inside:case c_oAscAlignV.Top:{this.CalcY=Shift;break}}else if(true=== bPercent)if(Math.abs(this.Page_Y)>.001)this.CalcY=this.Margin_V+Shift;else this.CalcY=this.Page_H*Value/100+Shift;else this.CalcY=Value+this.Page_Y;break}case c_oAscRelativeFromV.Paragraph:{var _Y=this.ParagraphTop;if(true===bAlign)this.CalcY=_Y+Shift;else this.CalcY=_Y+Value;break}case c_oAscRelativeFromV.TopMargin:{var Y_s=0;var Y_e=this.Top_Margin;if(true===bAlign)switch(Value){case c_oAscAlignV.Bottom:case c_oAscAlignV.Outside:{this.CalcY=Y_e-Height+Shift;break}case c_oAscAlignV.Center:{this.CalcY= (Y_s+Y_e-Height)/2+Shift;break}case c_oAscAlignV.Inside:case c_oAscAlignV.Top:{this.CalcY=Y_s+Shift;break}}else if(true===bPercent)if(Math.abs(this.Page_Y)>.001)this.CalcY=this.Margin_V+Shift;else this.CalcY=this.Top_Margin*Value/100+Shift;else this.CalcY=Y_s+Value;break}}return this.CalcY};CAnchorPosition.prototype.Update_PositionYHeaderFooter=function(TopMarginY,BottomMarginY){var TopY=Math.max(this.Page_Y,Math.min(TopMarginY,this.Page_H));var BottomY=Math.max(this.Page_Y,Math.min(BottomMarginY, this.Page_H));this.Margin_V=TopY;this.Top_Margin=TopY;this.Bottom_Margin=this.Page_H-BottomY};CAnchorPosition.prototype.Correct_Values=function(bInline,PageLimits,AllowOverlap,UseTextWrap,OtherFlowObjects,bCorrect){if(true!=bInline){var X_min=PageLimits.X;var Y_min=PageLimits.Y;var X_max=PageLimits.XLimit;var Y_max=PageLimits.YLimit;var W=this.W;var H=this.H;var CurX=this.CalcX;var CurY=this.CalcY;var bBreak=false;while(true!=bBreak){bBreak=true;for(var Index=0;Index<OtherFlowObjects.length;Index++){var Drawing= OtherFlowObjects[Index];if((false===AllowOverlap||false===Drawing.AllowOverlap)&&true===Drawing.Use_TextWrap()&&true===UseTextWrap&&(CurX<=Drawing.X+Drawing.W&&CurX+W>=Drawing.X&&CurY<=Drawing.Y+Drawing.H&&CurY+H>=Drawing.Y)){if(Drawing.X+Drawing.W<X_max-W-.001)CurX=Drawing.X+Drawing.W+.001;else{CurX=this.CalcX;CurY=Drawing.Y+Drawing.H+.001}bBreak=false}}}if(true===UseTextWrap&&true===bCorrect){var _W,_H;if(AscFormat.checkNormalRotate(this.Rot)){_W=this.W;_H=this.H}else{_W=this.H;_H=this.W}var Right= CurX+this.W/2+_W/2+this.EffectExtentR;if(Right>X_max)CurX-=Right-X_max;var Left=CurX+this.W/2-_W/2-this.EffectExtentR;if(Left<X_min)CurX+=X_min-Left;var Bottom=CurY+this.H/2+_H/2+this.EffectExtentB;if(Bottom>Y_max)CurY-=Bottom-Y_max;var Top=CurY+this.H/2-_H/2-this.EffectExtentT;if(Top<Y_min)CurY+=Y_min-Top}this.CalcX=CurX;this.CalcY=CurY}};CAnchorPosition.prototype.Calculate_X_Value=function(RelativeFrom){var Value=0;switch(RelativeFrom){case c_oAscRelativeFromH.Character:{Value=this.CalcX-this.X+ this.LastItemW;break}case c_oAscRelativeFromH.Column:{Value=this.CalcX-this.ColumnStartX;break}case c_oAscRelativeFromH.InsideMargin:case c_oAscRelativeFromH.LeftMargin:case c_oAscRelativeFromH.OutsideMargin:{Value=this.CalcX;break}case c_oAscRelativeFromH.Margin:{Value=this.CalcX-this.Margin_H;break}case c_oAscRelativeFromH.Page:{Value=this.CalcX-this.Page_X;break}case c_oAscRelativeFromH.RightMargin:{Value=this.CalcX-this.Page_W+this.Right_Margin;break}}return Value};CAnchorPosition.prototype.Calculate_Y_Value= function(RelativeFrom){var Value=0;switch(RelativeFrom){case c_oAscRelativeFromV.BottomMargin:case c_oAscRelativeFromV.InsideMargin:case c_oAscRelativeFromV.OutsideMargin:{Value=this.CalcY-this.Page_H+this.Bottom_Margin;break}case c_oAscRelativeFromV.Line:{Value=this.CalcY-this.LineTop;break}case c_oAscRelativeFromV.Margin:{Value=this.CalcY-this.Margin_V;break}case c_oAscRelativeFromV.Page:{Value=this.CalcY-this.Page_Y;break}case c_oAscRelativeFromV.Paragraph:{Value=this.CalcY-this.ParagraphTop;break}case c_oAscRelativeFromV.TopMargin:{Value= this.CalcY;break}}return Value};window["AscCommonWord"]=window["AscCommonWord"]||{};window["AscCommonWord"].ParaDrawing=ParaDrawing;"use strict";AscDFH.changesFactory[AscDFH.historyitem_Drawing_DrawingType]=CChangesParaDrawingDrawingType;AscDFH.changesFactory[AscDFH.historyitem_Drawing_WrappingType]=CChangesParaDrawingWrappingType;AscDFH.changesFactory[AscDFH.historyitem_Drawing_Distance]=CChangesParaDrawingDistance;AscDFH.changesFactory[AscDFH.historyitem_Drawing_AllowOverlap]=CChangesParaDrawingAllowOverlap; AscDFH.changesFactory[AscDFH.historyitem_Drawing_PositionH]=CChangesParaDrawingPositionH;AscDFH.changesFactory[AscDFH.historyitem_Drawing_PositionV]=CChangesParaDrawingPositionV;AscDFH.changesFactory[AscDFH.historyitem_Drawing_BehindDoc]=CChangesParaDrawingBehindDoc;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetGraphicObject]=CChangesParaDrawingGraphicObject;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetSimplePos]=CChangesParaDrawingSimplePos;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetExtent]= CChangesParaDrawingExtent;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetWrapPolygon]=CChangesParaDrawingWrapPolygon;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetLocked]=CChangesParaDrawingLocked;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetRelativeHeight]=CChangesParaDrawingRelativeHeight;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetEffectExtent]=CChangesParaDrawingEffectExtent;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetParent]=CChangesParaDrawingParent;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetParaMath]= CChangesParaDrawingParaMath;AscDFH.changesFactory[AscDFH.historyitem_Drawing_LayoutInCell]=CChangesParaDrawingLayoutInCell;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetSizeRelH]=CChangesParaDrawingSizeRelH;AscDFH.changesFactory[AscDFH.historyitem_Drawing_SetSizeRelV]=CChangesParaDrawingSizeRelV;AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_DrawingType]=[AscDFH.historyitem_Drawing_DrawingType];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_WrappingType]=[AscDFH.historyitem_Drawing_WrappingType]; AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_Distance]=[AscDFH.historyitem_Drawing_Distance];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_AllowOverlap]=[AscDFH.historyitem_Drawing_AllowOverlap];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_PositionH]=[AscDFH.historyitem_Drawing_PositionH];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_PositionV]=[AscDFH.historyitem_Drawing_PositionV];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_BehindDoc]=[AscDFH.historyitem_Drawing_BehindDoc]; AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetGraphicObject]=[AscDFH.historyitem_Drawing_SetGraphicObject];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetSimplePos]=[AscDFH.historyitem_Drawing_SetSimplePos];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetExtent]=[AscDFH.historyitem_Drawing_SetExtent];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetWrapPolygon]=[AscDFH.historyitem_Drawing_SetWrapPolygon];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetLocked]= [AscDFH.historyitem_Drawing_SetLocked];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetRelativeHeight]=[AscDFH.historyitem_Drawing_SetRelativeHeight];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetEffectExtent]=[AscDFH.historyitem_Drawing_SetEffectExtent];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetParent]=[AscDFH.historyitem_Drawing_SetParent];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetParaMath]=[AscDFH.historyitem_Drawing_SetParaMath];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_LayoutInCell]= [AscDFH.historyitem_Drawing_LayoutInCell];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetSizeRelH]=[AscDFH.historyitem_Drawing_SetSizeRelH];AscDFH.changesRelationMap[AscDFH.historyitem_Drawing_SetSizeRelV]=[AscDFH.historyitem_Drawing_SetSizeRelV];function CChangesParaDrawingDrawingType(Class,Old,New,Color){AscDFH.CChangesBaseLongValue.call(this,Class,Old,New,Color)}CChangesParaDrawingDrawingType.prototype=Object.create(AscDFH.CChangesBaseLongValue.prototype);CChangesParaDrawingDrawingType.prototype.constructor= CChangesParaDrawingDrawingType;CChangesParaDrawingDrawingType.prototype.Type=AscDFH.historyitem_Drawing_DrawingType;CChangesParaDrawingDrawingType.prototype.private_SetValue=function(Value){this.Class.DrawingType=Value};function CChangesParaDrawingWrappingType(Class,Old,New,Color){AscDFH.CChangesBaseLongValue.call(this,Class,Old,New,Color)}CChangesParaDrawingWrappingType.prototype=Object.create(AscDFH.CChangesBaseLongValue.prototype);CChangesParaDrawingWrappingType.prototype.constructor=CChangesParaDrawingWrappingType; CChangesParaDrawingWrappingType.prototype.Type=AscDFH.historyitem_Drawing_WrappingType;CChangesParaDrawingWrappingType.prototype.private_SetValue=function(Value){this.Class.wrappingType=Value};function CChangesParaDrawingDistance(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingDistance.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingDistance.prototype.constructor=CChangesParaDrawingDistance;CChangesParaDrawingDistance.prototype.Type= AscDFH.historyitem_Drawing_Distance;CChangesParaDrawingDistance.prototype.private_SetValue=function(Value){var oDrawing=this.Class;oDrawing.Distance.L=Value.Left;oDrawing.Distance.T=Value.Top;oDrawing.Distance.R=Value.Right;oDrawing.Distance.B=Value.Bottom;if(oDrawing.GraphicObj&&oDrawing.GraphicObj.recalcWrapPolygon)oDrawing.GraphicObj.recalcWrapPolygon()};CChangesParaDrawingDistance.prototype.WriteToBinary=function(Writer){Writer.WriteDouble(this.New.Left);Writer.WriteDouble(this.New.Top);Writer.WriteDouble(this.New.Right); Writer.WriteDouble(this.New.Bottom);Writer.WriteDouble(this.Old.Left);Writer.WriteDouble(this.Old.Top);Writer.WriteDouble(this.Old.Right);Writer.WriteDouble(this.Old.Bottom)};CChangesParaDrawingDistance.prototype.ReadFromBinary=function(Reader){this.New={Left:0,Top:0,Right:0,Bottom:0};this.Old={Left:0,Top:0,Right:0,Bottom:0};this.New.Left=Reader.GetDouble();this.New.Top=Reader.GetDouble();this.New.Right=Reader.GetDouble();this.New.Bottom=Reader.GetDouble();this.Old.Left=Reader.GetDouble();this.Old.Top= Reader.GetDouble();this.Old.Right=Reader.GetDouble();this.Old.Bottom=Reader.GetDouble()};function CChangesParaDrawingAllowOverlap(Class,Old,New,Color){AscDFH.CChangesBaseBoolValue.call(this,Class,Old,New,Color)}CChangesParaDrawingAllowOverlap.prototype=Object.create(AscDFH.CChangesBaseBoolValue.prototype);CChangesParaDrawingAllowOverlap.prototype.constructor=CChangesParaDrawingAllowOverlap;CChangesParaDrawingAllowOverlap.prototype.Type=AscDFH.historyitem_Drawing_AllowOverlap;CChangesParaDrawingAllowOverlap.prototype.private_SetValue= function(Value){this.Class.AllowOverlap=Value};function CChangesParaDrawingPositionH(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingPositionH.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingPositionH.prototype.constructor=CChangesParaDrawingPositionH;CChangesParaDrawingPositionH.prototype.Type=AscDFH.historyitem_Drawing_PositionH;CChangesParaDrawingPositionH.prototype.private_SetValue=function(Value){var oDrawing= this.Class;oDrawing.PositionH.RelativeFrom=Value.RelativeFrom;oDrawing.PositionH.Align=Value.Align;oDrawing.PositionH.Value=Value.Value;oDrawing.PositionH.Percent=Value.Percent};CChangesParaDrawingPositionH.prototype.WriteToBinary=function(Writer){Writer.WriteLong(this.New.RelativeFrom);Writer.WriteBool(this.New.Align);if(true===this.New.Align)Writer.WriteLong(this.New.Value);else Writer.WriteDouble(this.New.Value);Writer.WriteBool(this.New.Percent===true);Writer.WriteLong(this.Old.RelativeFrom); Writer.WriteBool(this.Old.Align);if(true===this.Old.Align)Writer.WriteLong(this.Old.Value);else Writer.WriteDouble(this.Old.Value);Writer.WriteBool(this.Old.Percent===true)};CChangesParaDrawingPositionH.prototype.ReadFromBinary=function(Reader){this.New={};this.Old={};this.New.RelativeFrom=Reader.GetLong();this.New.Align=Reader.GetBool();if(true===this.New.Align)this.New.Value=Reader.GetLong();else this.New.Value=Reader.GetDouble();this.New.Percent=Reader.GetBool();this.Old.RelativeFrom=Reader.GetLong(); this.Old.Align=Reader.GetBool();if(true===this.Old.Align)this.Old.Value=Reader.GetLong();else this.Old.Value=Reader.GetDouble();this.Old.Percent=Reader.GetBool()};function CChangesParaDrawingPositionV(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingPositionV.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingPositionV.prototype.constructor=CChangesParaDrawingPositionV;CChangesParaDrawingPositionV.prototype.Type=AscDFH.historyitem_Drawing_PositionV; CChangesParaDrawingPositionV.prototype.private_SetValue=function(Value){var oDrawing=this.Class;oDrawing.PositionV.RelativeFrom=Value.RelativeFrom;oDrawing.PositionV.Align=Value.Align;oDrawing.PositionV.Value=Value.Value;oDrawing.PositionV.Percent=Value.Percent};CChangesParaDrawingPositionV.prototype.WriteToBinary=function(Writer){Writer.WriteLong(this.New.RelativeFrom);Writer.WriteBool(this.New.Align);if(true===this.New.Align)Writer.WriteLong(this.New.Value);else Writer.WriteDouble(this.New.Value); Writer.WriteBool(this.New.Percent===true);Writer.WriteLong(this.Old.RelativeFrom);Writer.WriteBool(this.Old.Align);if(true===this.Old.Align)Writer.WriteLong(this.Old.Value);else Writer.WriteDouble(this.Old.Value);Writer.WriteBool(this.Old.Percent===true)};CChangesParaDrawingPositionV.prototype.ReadFromBinary=function(Reader){this.New={};this.Old={};this.New.RelativeFrom=Reader.GetLong();this.New.Align=Reader.GetBool();if(true===this.New.Align)this.New.Value=Reader.GetLong();else this.New.Value=Reader.GetDouble(); this.New.Percent=Reader.GetBool();this.Old.RelativeFrom=Reader.GetLong();this.Old.Align=Reader.GetBool();if(true===this.Old.Align)this.Old.Value=Reader.GetLong();else this.Old.Value=Reader.GetDouble();this.Old.Percent=Reader.GetBool()};function CChangesParaDrawingBehindDoc(Class,Old,New,Color){AscDFH.CChangesBaseBoolValue.call(this,Class,Old,New,Color)}CChangesParaDrawingBehindDoc.prototype=Object.create(AscDFH.CChangesBaseBoolValue.prototype);CChangesParaDrawingBehindDoc.prototype.constructor=CChangesParaDrawingBehindDoc; CChangesParaDrawingBehindDoc.prototype.Type=AscDFH.historyitem_Drawing_BehindDoc;CChangesParaDrawingBehindDoc.prototype.private_SetValue=function(Value){this.Class.behindDoc=Value};function CChangesParaDrawingGraphicObject(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingGraphicObject.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingGraphicObject.prototype.constructor=CChangesParaDrawingGraphicObject;CChangesParaDrawingGraphicObject.prototype.Type= AscDFH.historyitem_Drawing_SetGraphicObject;CChangesParaDrawingGraphicObject.prototype.private_SetValue=function(Value){var oDrawing=this.Class;if(Value)oDrawing.GraphicObj=g_oTableId.Get_ById(Value);else oDrawing.GraphicObj=null;if(isRealObject(oDrawing.GraphicObj))oDrawing.GraphicObj.handleUpdateExtents()};CChangesParaDrawingGraphicObject.prototype.WriteToBinary=function(Writer){var nFlags=0;if(!this.New)nFlags|=1;if(!this.Old)nFlags|=2;Writer.WriteLong(nFlags);if(this.New)Writer.WriteString2(this.New); if(this.Old)Writer.WriteString2(this.Old)};CChangesParaDrawingGraphicObject.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.New=null;else this.New=Reader.GetString2();if(nFlags&2)this.Old=null;else this.Old=Reader.GetString2()};function CChangesParaDrawingSimplePos(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingSimplePos.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingSimplePos.prototype.constructor= CChangesParaDrawingSimplePos;CChangesParaDrawingSimplePos.prototype.Type=AscDFH.historyitem_Drawing_SetSimplePos;CChangesParaDrawingSimplePos.prototype.private_SetValue=function(Value){var oDrawing=this.Class;oDrawing.SimplePos.Use=Value.Use;oDrawing.SimplePos.X=Value.X;oDrawing.SimplePos.Y=Value.Y};CChangesParaDrawingSimplePos.prototype.WriteToBinary=function(Writer){Writer.WriteBool(this.New.Use);Writer.WriteDouble(this.New.X);Writer.WriteDouble(this.New.Y);Writer.WriteBool(this.Old.Use);Writer.WriteDouble(this.Old.X); Writer.WriteDouble(this.Old.Y)};CChangesParaDrawingSimplePos.prototype.ReadFromBinary=function(Reader){this.New={};this.Old={};this.New.Use=Reader.GetBool();this.New.X=Reader.GetDouble();this.New.Y=Reader.GetDouble();this.Old.Use=Reader.GetBool();this.Old.X=Reader.GetDouble();this.Old.Y=Reader.GetDouble()};function CChangesParaDrawingExtent(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingExtent.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype); CChangesParaDrawingExtent.prototype.constructor=CChangesParaDrawingExtent;CChangesParaDrawingExtent.prototype.Type=AscDFH.historyitem_Drawing_SetExtent;CChangesParaDrawingExtent.prototype.private_SetValue=function(Value){var oDrawing=this.Class;oDrawing.Extent.W=Value.W;oDrawing.Extent.H=Value.H};CChangesParaDrawingExtent.prototype.WriteToBinary=function(Writer){Writer.WriteDouble(this.New.W);Writer.WriteDouble(this.New.H);Writer.WriteDouble(this.Old.W);Writer.WriteDouble(this.Old.H)};CChangesParaDrawingExtent.prototype.ReadFromBinary= function(Reader){this.New={};this.Old={};this.New.W=Reader.GetDouble();this.New.H=Reader.GetDouble();this.Old.W=Reader.GetDouble();this.Old.H=Reader.GetDouble()};CChangesParaDrawingExtent.prototype.Load=function(){this.Redo();var oDrawing=this.Class;if(oDrawing.Parent){var oRun=oDrawing.Parent.Get_DrawingObjectRun(oDrawing.Get_Id());if(oRun)oRun.RecalcInfo.Measure=true}};function CChangesParaDrawingWrapPolygon(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingWrapPolygon.prototype= Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingWrapPolygon.prototype.constructor=CChangesParaDrawingWrapPolygon;CChangesParaDrawingWrapPolygon.prototype.Type=AscDFH.historyitem_Drawing_SetWrapPolygon;CChangesParaDrawingWrapPolygon.prototype.private_SetValue=function(Value){var oDrawing=this.Class;oDrawing.wrappingPolygon=Value};CChangesParaDrawingWrapPolygon.prototype.WriteToBinary=function(Writer){AscFormat.writeObject(Writer,this.New);AscFormat.writeObject(Writer,this.Old)}; CChangesParaDrawingWrapPolygon.prototype.ReadFromBinary=function(Reader){this.New=AscFormat.readObject(Reader);this.Old=AscFormat.readObject(Reader)};function CChangesParaDrawingLocked(Class,Old,New,Color){AscDFH.CChangesBaseBoolValue.call(this,Class,Old,New,Color)}CChangesParaDrawingLocked.prototype=Object.create(AscDFH.CChangesBaseBoolValue.prototype);CChangesParaDrawingLocked.prototype.constructor=CChangesParaDrawingLocked;CChangesParaDrawingLocked.prototype.Type=AscDFH.historyitem_Drawing_SetLocked; CChangesParaDrawingLocked.prototype.private_SetValue=function(Value){this.Class.Locked=Value};function CChangesParaDrawingRelativeHeight(Class,Old,New,Color){AscDFH.CChangesBaseLongValue.call(this,Class,Old,New,Color)}CChangesParaDrawingRelativeHeight.prototype=Object.create(AscDFH.CChangesBaseLongValue.prototype);CChangesParaDrawingRelativeHeight.prototype.constructor=CChangesParaDrawingRelativeHeight;CChangesParaDrawingRelativeHeight.prototype.Type=AscDFH.historyitem_Drawing_SetRelativeHeight;CChangesParaDrawingRelativeHeight.prototype.private_SetValue= function(Value){this.Class.Set_RelativeHeight2(Value)};function CChangesParaDrawingEffectExtent(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingEffectExtent.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingEffectExtent.prototype.constructor=CChangesParaDrawingEffectExtent;CChangesParaDrawingEffectExtent.prototype.Type=AscDFH.historyitem_Drawing_SetEffectExtent;CChangesParaDrawingEffectExtent.prototype.private_SetValue= function(Value){var oDrawing=this.Class;oDrawing.EffectExtent.L=Value.L;oDrawing.EffectExtent.T=Value.T;oDrawing.EffectExtent.R=Value.R;oDrawing.EffectExtent.B=Value.B};CChangesParaDrawingEffectExtent.prototype.WriteToBinary=function(Writer){Writer.WriteDouble(this.New.L);Writer.WriteDouble(this.New.T);Writer.WriteDouble(this.New.R);Writer.WriteDouble(this.New.B);Writer.WriteDouble(this.Old.L);Writer.WriteDouble(this.Old.T);Writer.WriteDouble(this.Old.R);Writer.WriteDouble(this.Old.B)};CChangesParaDrawingEffectExtent.prototype.ReadFromBinary= function(Reader){this.New={};this.Old={};this.New.L=Reader.GetDouble();this.New.T=Reader.GetDouble();this.New.R=Reader.GetDouble();this.New.B=Reader.GetDouble();this.Old.L=Reader.GetDouble();this.Old.T=Reader.GetDouble();this.Old.R=Reader.GetDouble();this.Old.B=Reader.GetDouble()};function CChangesParaDrawingParent(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingParent.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingParent.prototype.constructor= CChangesParaDrawingParent;CChangesParaDrawingParent.prototype.Type=AscDFH.historyitem_Drawing_SetParent;CChangesParaDrawingParent.prototype.private_SetValue=function(Value){var oDrawing=this.Class;oDrawing.Parent=Value};CChangesParaDrawingParent.prototype.WriteToBinary=function(Writer){AscFormat.writeObject(Writer,this.New);AscFormat.writeObject(Writer,this.Old)};CChangesParaDrawingParent.prototype.ReadFromBinary=function(Reader){this.New=AscFormat.readObject(Reader);this.Old=AscFormat.readObject(Reader)}; function CChangesParaDrawingParaMath(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingParaMath.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingParaMath.prototype.constructor=CChangesParaDrawingParaMath;CChangesParaDrawingParaMath.prototype.Type=AscDFH.historyitem_Drawing_SetParaMath;CChangesParaDrawingParaMath.prototype.private_SetValue=function(Value){this.Class.ParaMath=Value};CChangesParaDrawingParaMath.prototype.WriteToBinary= function(Writer){var nFlags=0;if(!(this.New instanceof ParaMath))nFlags|=1;if(!(this.Old instanceof ParaMath))nFlags|=2;Writer.WriteLong(nFlags);if(this.New instanceof ParaMath)Writer.WriteString2(this.New.Get_Id());if(this.Old instanceof ParaMath)Writer.WriteString2(this.Old.Get_Id())};CChangesParaDrawingParaMath.prototype.ReadFromBinary=function(Reader){var nFlags=Reader.GetLong();if(nFlags&1)this.New=null;else this.New=g_oTableId.Get_ById(Reader.GetString2());if(nFlags&2)this.Old=null;else this.Old= g_oTableId.Get_ById(Reader.GetString2())};function CChangesParaDrawingLayoutInCell(Class,Old,New,Color){AscDFH.CChangesBaseBoolValue.call(this,Class,Old,New,Color)}CChangesParaDrawingLayoutInCell.prototype=Object.create(AscDFH.CChangesBaseBoolValue.prototype);CChangesParaDrawingLayoutInCell.prototype.constructor=CChangesParaDrawingLayoutInCell;CChangesParaDrawingLayoutInCell.prototype.Type=AscDFH.historyitem_Drawing_LayoutInCell;CChangesParaDrawingLayoutInCell.prototype.private_SetValue=function(Value){this.Class.LayoutInCell= Value};function CChangesParaDrawingSizeRelH(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingSizeRelH.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingSizeRelH.prototype.constructor=CChangesParaDrawingSizeRelH;CChangesParaDrawingSizeRelH.prototype.Type=AscDFH.historyitem_Drawing_SetSizeRelH;CChangesParaDrawingSizeRelH.prototype.private_SetValue=function(Value){this.Class.SizeRelH=Value};CChangesParaDrawingSizeRelH.prototype.WriteToBinary= function(Writer){if(this.New){Writer.WriteBool(false);Writer.WriteLong(this.New.RelativeFrom);Writer.WriteDouble(this.New.Percent)}else Writer.WriteBool(true);if(this.Old){Writer.WriteBool(false);Writer.WriteLong(this.Old.RelativeFrom);Writer.WriteDouble(this.Old.Percent)}else Writer.WriteBool(true)};CChangesParaDrawingSizeRelH.prototype.ReadFromBinary=function(Reader){if(true===Reader.GetBool())this.New=undefined;else{this.New={};this.New.RelativeFrom=Reader.GetLong();this.New.Percent=Reader.GetDouble()}if(true=== Reader.GetBool())this.Old=undefined;else{this.Old={};this.Old.RelativeFrom=Reader.GetLong();this.Old.Percent=Reader.GetDouble()}};function CChangesParaDrawingSizeRelV(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesParaDrawingSizeRelV.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesParaDrawingSizeRelV.prototype.constructor=CChangesParaDrawingSizeRelV;CChangesParaDrawingSizeRelV.prototype.Type=AscDFH.historyitem_Drawing_SetSizeRelV;CChangesParaDrawingSizeRelV.prototype.private_SetValue= function(Value){this.Class.SizeRelV=Value};CChangesParaDrawingSizeRelV.prototype.WriteToBinary=function(Writer){if(this.New){Writer.WriteBool(false);Writer.WriteLong(this.New.RelativeFrom);Writer.WriteDouble(this.New.Percent)}else Writer.WriteBool(true);if(this.Old){Writer.WriteBool(false);Writer.WriteLong(this.Old.RelativeFrom);Writer.WriteDouble(this.Old.Percent)}else Writer.WriteBool(true)};CChangesParaDrawingSizeRelV.prototype.ReadFromBinary=function(Reader){if(true===Reader.GetBool())this.New= undefined;else{this.New={};this.New.RelativeFrom=Reader.GetLong();this.New.Percent=Reader.GetDouble()}if(true===Reader.GetBool())this.Old=undefined;else{this.Old={};this.Old.RelativeFrom=Reader.GetLong();this.Old.Percent=Reader.GetDouble()}};"use strict";var fieldtype_UNKNOWN=0;var fieldtype_MERGEFIELD=1;var fieldtype_PAGENUM=2;var fieldtype_PAGECOUNT=3;var fieldtype_FORMTEXT=4;var fieldtype_TOC=5;var fieldtype_PAGEREF=6;var fieldtype_PAGE=fieldtype_PAGENUM;var fieldtype_NUMPAGES=fieldtype_PAGECOUNT; var fieldtype_ASK=7;var fieldtype_REF=8;var fieldtype_HYPERLINK=9;var fieldtype_TIME=10;var fieldtype_DATE=11;var fieldtype_FORMULA=16;var fieldtype_SEQ=17;var fieldtype_STYLEREF=18;var fieldtype_NOTEREF=19;window["AscCommonWord"]=window["AscCommonWord"]||{};window["AscCommonWord"].fieldtype_UNKNOWN=fieldtype_UNKNOWN;window["AscCommonWord"].fieldtype_MERGEFIELD=fieldtype_MERGEFIELD;window["AscCommonWord"].fieldtype_PAGENUM=fieldtype_PAGENUM;window["AscCommonWord"].fieldtype_PAGECOUNT=fieldtype_PAGECOUNT; window["AscCommonWord"].fieldtype_FORMTEXT=fieldtype_FORMTEXT;window["AscCommonWord"].fieldtype_TOC=fieldtype_TOC;window["AscCommonWord"].fieldtype_PAGEREF=fieldtype_PAGEREF;window["AscCommonWord"].fieldtype_PAGE=fieldtype_PAGE;window["AscCommonWord"].fieldtype_NUMPAGES=fieldtype_NUMPAGES;window["AscCommonWord"].fieldtype_ASK=fieldtype_ASK;window["AscCommonWord"].fieldtype_REF=fieldtype_REF;window["AscCommonWord"].fieldtype_HYPERLINK=fieldtype_HYPERLINK;window["AscCommonWord"].fieldtype_TIME=fieldtype_TIME; window["AscCommonWord"].fieldtype_DATE=fieldtype_DATE;window["AscCommonWord"].fieldtype_FORMULA=fieldtype_FORMULA;window["AscCommonWord"].fieldtype_SEQ=fieldtype_SEQ;window["AscCommonWord"].fieldtype_STYLEREF=fieldtype_STYLEREF;window["AscCommonWord"].fieldtype_NOTEREF=fieldtype_NOTEREF;function CFieldInstructionBase(){this.ComplexField=null;this.InstructionLine=""}CFieldInstructionBase.prototype.Type=fieldtype_UNKNOWN;CFieldInstructionBase.prototype.GetType=function(){return this.Type};CFieldInstructionBase.prototype.SetComplexField= function(oComplexField){this.ComplexField=oComplexField};CFieldInstructionBase.prototype.GetComplexField=function(){return this.ComplexField};CFieldInstructionBase.prototype.ToString=function(){return""};CFieldInstructionBase.prototype.SetPr=function(){};CFieldInstructionBase.prototype.SetInstructionLine=function(sLine){this.InstructionLine=sLine};CFieldInstructionBase.prototype.CheckInstructionLine=function(sLine){return this.InstructionLine===sLine};function CFieldInstructionFORMULA(){CFieldInstructionBase.call(this); this.ParseQueue=null;this.Error=null;this.ErrStr=null;this.ResultStr=null;this.Format=null;this.ParentContent=null}CFieldInstructionFORMULA.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionFORMULA.prototype.constructor=CFieldInstructionFORMULA;CFieldInstructionFORMULA.prototype.Type=fieldtype_FORMULA;CFieldInstructionFORMULA.prototype.SetFormat=function(oFormat){this.Format=oFormat};CFieldInstructionFORMULA.prototype.SetParseQueue=function(oParseQueue){this.ParseQueue=oParseQueue}; CFieldInstructionFORMULA.prototype.SetError=function(oError){this.Error=oError};CFieldInstructionFORMULA.prototype.SetFormula=function(sFormula){this.Formula=sFormula};CFieldInstructionFORMULA.prototype.GetErrorStr=function(oErr){var ret="!";if(oErr){if(typeof oErr.Type==="string")ret+=AscCommon.translateManager.getValue(oErr.Type);if(typeof oErr.Data==="string")ret+=", "+oErr.Data}return ret};CFieldInstructionFORMULA.prototype.Calculate=function(oLogicDocument){this.ErrStr=null;this.ResultStr=null; this.private_Calculate(oLogicDocument);if(this.Error){this.ErrStr=this.GetErrorStr(this.Error);return}if(this.ParseQueue){var oCalcError=this.ParseQueue.calculate(oLogicDocument);if(oCalcError){this.ErrStr=this.GetErrorStr(oCalcError);return}if(typeof this.ParseQueue.resultS==="string")this.ResultStr=this.ParseQueue.resultS;else this.ResultStr=""}else this.ResultStr=""};CFieldInstructionFORMULA.prototype.private_Calculate=function(oLogicDocument){var sListSeparator=",";var sDigitSeparator=".";if(oLogicDocument&& oLogicDocument.GetDecimalSymbol&&oLogicDocument.GetListSeparator&&oLogicDocument.GetDecimalSymbol()!==oLogicDocument.GetListSeparator()){sListSeparator=oLogicDocument.GetListSeparator();sDigitSeparator=oLogicDocument.GetDecimalSymbol()}var oParser=new AscCommonWord.CFormulaParser(sListSeparator,sDigitSeparator);oParser.parse(this.Formula,this.ParentContent);this.SetParseQueue(oParser.parseQueue);if(oParser.parseQueue)oParser.parseQueue.format=this.Format;this.SetError(oParser.error)};CFieldInstructionFORMULA.prototype.SetComplexField= function(oComplexField){CFieldInstructionBase.prototype.SetComplexField.call(this,oComplexField);this.ParentContent=null;var oBeginChar=oComplexField.BeginChar;if(oBeginChar){var oRun=oBeginChar.Run;if(oRun){var oParagraph=oRun.Paragraph;if(oParagraph)this.ParentContent=oParagraph.Parent}}};function CFieldInstructionPAGE(){CFieldInstructionBase.call(this)}CFieldInstructionPAGE.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionPAGE.prototype.constructor=CFieldInstructionPAGE; CFieldInstructionPAGE.prototype.Type=fieldtype_PAGE;function CFieldInstructionPAGEREF(sBookmarkName,isHyperlink,isPositionRelative){CFieldInstructionBase.call(this);this.BookmarkName=sBookmarkName?sBookmarkName:"";this.Hyperlink=isHyperlink?true:false;this.PosRelative=isPositionRelative?true:false}CFieldInstructionPAGEREF.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionPAGEREF.prototype.constructor=CFieldInstructionPAGEREF;CFieldInstructionPAGEREF.prototype.Type=fieldtype_PAGEREF; CFieldInstructionPAGEREF.prototype.SetHyperlink=function(isHyperlink){this.Hyperlink=isHyperlink?true:false};CFieldInstructionPAGEREF.prototype.SetPositionRelative=function(isPosRel){this.PosRelative=isPosRel?true:false};CFieldInstructionPAGEREF.prototype.IsHyperlink=function(){return this.Hyperlink};CFieldInstructionPAGEREF.prototype.IsPositionRelative=function(){return this.PosRelative};CFieldInstructionPAGEREF.prototype.GetBookmarkName=function(){return this.BookmarkName};function CFieldInstructionTOC(){CFieldInstructionBase.call(this); this.PreserveTabs=false;this.RemoveBreaks=true;this.Hyperlinks=false;this.Separator="";this.HeadingS=-1;this.HeadingE=-1;this.Styles=[];this.SkipPageRef=false;this.SkipPageRefStart=-1;this.SkipPageRefEnd=-1;this.ForceTabLeader=undefined;this.Caption=undefined;this.CaptionOnlyText=undefined}CFieldInstructionTOC.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionTOC.prototype.constructor=CFieldInstructionTOC;CFieldInstructionTOC.prototype.Type=fieldtype_TOC;CFieldInstructionTOC.prototype.IsPreserveTabs= function(){return this.PreserveTabs};CFieldInstructionTOC.prototype.SetPreserveTabs=function(isPreserve){this.PreserveTabs=isPreserve};CFieldInstructionTOC.prototype.IsRemoveBreaks=function(){return this.RemoveBreaks};CFieldInstructionTOC.prototype.SetRemoveBreaks=function(isRemove){this.RemoveBreaks=isRemove};CFieldInstructionTOC.prototype.IsHyperlinks=function(){return this.Hyperlinks};CFieldInstructionTOC.prototype.SetHyperlinks=function(isHyperlinks){this.Hyperlinks=isHyperlinks};CFieldInstructionTOC.prototype.SetSeparator= function(sSeparator){this.Separator=sSeparator};CFieldInstructionTOC.prototype.GetSeparator=function(){return this.Separator};CFieldInstructionTOC.prototype.SetHeadingRange=function(nStart,nEnd){this.HeadingS=nStart;this.HeadingE=nEnd};CFieldInstructionTOC.prototype.GetHeadingRangeStart=function(){return this.HeadingS};CFieldInstructionTOC.prototype.GetHeadingRangeEnd=function(){return this.HeadingE};CFieldInstructionTOC.prototype.SetStylesArrayRaw=function(sString){var oLogicDocument=editor.WordControl.m_oLogicDocument; var sListSeparator=oLogicDocument.GetListSeparator();var arrValues=sString.split(sListSeparator);var arrStyles=[];for(var nIndex=0,nCount=arrValues.length;nIndex<nCount;++nIndex){var sName=arrValues[nIndex];var nLvl=nIndex+1>=nCount?1:parseInt(arrValues[nIndex+1]);if(isNaN(nLvl))nLvl=undefined;else nIndex++;arrStyles.push({Name:sName,Lvl:nLvl})}this.SetStylesArray(arrStyles)};CFieldInstructionTOC.prototype.SetStylesArray=function(arrStyles){this.Styles=arrStyles};CFieldInstructionTOC.prototype.GetStylesArray= function(){return this.Styles};CFieldInstructionTOC.prototype.SetPageRefSkippedLvls=function(isSkip,nSkipStart,nSkipEnd){this.SkipPageRef=isSkip;if(true===isSkip&&null!==nSkipStart&&undefined!==nSkipStart&&null!==nSkipEnd&&undefined!==nSkipEnd){this.SkipPageRefStart=nSkipStart;this.SkipPageRefEnd=nSkipEnd}else{this.SkipPageRefStart=-1;this.SkipPageRefEnd=-1}};CFieldInstructionTOC.prototype.IsSkipPageRefLvl=function(nLvl){if(undefined===nLvl)return this.SkipPageRef;if(false===this.SkipPageRef)return false; if(-1===this.SkipPageRefStart||-1===this.SkipPageRefEnd)return true;return nLvl>=this.SkipPageRefStart-1&&nLvl<=this.SkipPageRefEnd-1};CFieldInstructionTOC.prototype.SetCaption=function(sCaption){this.Caption=sCaption};CFieldInstructionTOC.prototype.GetCaption=function(){return this.Caption};CFieldInstructionTOC.prototype.SetCaptionOnlyText=function(sVal){this.CaptionOnlyText=sVal};CFieldInstructionTOC.prototype.GetCaptionOnlyText=function(){return this.CaptionOnlyText};CFieldInstructionTOC.prototype.SetPr= function(oPr){if(!(oPr instanceof Asc.CTableOfContentsPr))return;this.SetStylesArray(oPr.get_Styles());this.SetHeadingRange(oPr.get_OutlineStart(),oPr.get_OutlineEnd());this.SetHyperlinks(oPr.get_Hyperlink());if(oPr.PageNumbers)this.SetPageRefSkippedLvls(false);else this.SetPageRefSkippedLvls(true);if(oPr.RightTab)this.SetSeparator("");else this.SetSeparator(" ");this.ForceTabLeader=oPr.TabLeader;var sCaption=oPr.get_CaptionForInstruction();if(sCaption!==undefined)if(sCaption||this.Styles.length> 0){if(oPr.IsIncludeLabelAndNumber){this.SetCaption(sCaption);this.SetCaptionOnlyText(undefined)}else{this.SetCaptionOnlyText(sCaption);this.SetCaption(undefined)}this.SetHeadingRange(-1,-1)}};CFieldInstructionTOC.prototype.GetForceTabLeader=function(){var nTabLeader=this.ForceTabLeader;this.ForceTabLeader=undefined;return nTabLeader};CFieldInstructionTOC.prototype.ToString=function(){var oLogicDocument=editor.WordControl.m_oLogicDocument;var sListSeparator=oLogicDocument.GetListSeparator();var sInstr= "TOC ";if(this.HeadingS>=1&&this.HeadingS<=9&&this.HeadingE>=this.HeadingS&&this.HeadingE<=9)sInstr+="\\o "+'"'+this.HeadingS+"-"+this.HeadingE+'" ';if(this.SkipPageRef){sInstr+="\\n ";if(this.SkipPageRefStart>=1&&this.SkipPageRefStart<=9&&this.SkipPageRefEnd>=this.SkipPageRefStart&&this.SkipPageRefEnd<=9)sInstr+='"'+this.SkipPageRefStart+"-"+this.SkipPageRefEnd+'" '}if(this.Hyperlinks)sInstr+="\\h ";if(!this.RemoveBreaks)sInstr+="\\x ";if(this.PreserveTabs)sInstr+="\\w ";if(this.Separator)sInstr+= '\\p "'+this.Separator+'"';if(this.Styles.length>0){sInstr+='\\t "';for(var nIndex=0,nCount=this.Styles.length;nIndex<nCount;++nIndex){if(0===nIndex)sInstr+=this.Styles[nIndex].Name;else sInstr+=sListSeparator+this.Styles[nIndex].Name;if(undefined!==this.Styles[nIndex].Lvl&&null!==this.Styles[nIndex].Lvl)sInstr+=sListSeparator+this.Styles[nIndex].Lvl}sInstr+='" '}if(this.Caption!==undefined){sInstr+="\\c ";if(typeof this.Caption==="string"&&this.Caption.length>0)sInstr+='"'+this.Caption+'"'}if(this.CaptionOnlyText!== undefined){sInstr+="\\a ";if(typeof this.CaptionOnlyText==="string"&&this.CaptionOnlyText.length>0)sInstr+='"'+this.CaptionOnlyText+'"'}return sInstr};CFieldInstructionTOC.prototype.IsTableOfFigures=function(){if(this.Caption!==undefined||this.CaptionOnlyText!==undefined)return true;return false};CFieldInstructionTOC.prototype.IsTableOfContents=function(){return!this.IsTableOfFigures()};function CFieldInstructionASK(){CFieldInstructionBase.call(this);this.BookmarkName="";this.PromptText=""}CFieldInstructionASK.prototype= Object.create(CFieldInstructionBase.prototype);CFieldInstructionASK.prototype.constructor=CFieldInstructionASK;CFieldInstructionASK.prototype.Type=fieldtype_ASK;CFieldInstructionASK.prototype.SetBookmarkName=function(sBookmarkName){this.BookmarkName=sBookmarkName};CFieldInstructionASK.prototype.GetBookmarkName=function(){return this.BookmarkName};CFieldInstructionASK.prototype.SetPromptText=function(sText){this.PromptText=sText};CFieldInstructionASK.prototype.GetPromptText=function(){if(!this.PromptText)return this.BookmarkName; return this.PromptText};function CFieldInstructionREF(){CFieldInstructionBase.call(this);this.GeneralSwitches=[];this.BookmarkName="";this.Hyperlink=false;this.bIsNumberNoContext=false;this.bIsNumberFullContext=false;this.bIsNumber=false;this.bIsPosition=false;this.Delimiter=null}CFieldInstructionREF.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionREF.prototype.constructor=CFieldInstructionREF;CFieldInstructionREF.prototype.Type=fieldtype_REF;CFieldInstructionREF.prototype.SetGeneralSwitches= function(aSwitches){this.GeneralSwitches=aSwitches};CFieldInstructionREF.prototype.SetBookmarkName=function(sBookmarkName){this.BookmarkName=sBookmarkName};CFieldInstructionREF.prototype.GetBookmarkName=function(){return this.BookmarkName};CFieldInstructionREF.prototype.SetHyperlink=function(bIsHyperlink){this.Hyperlink=bIsHyperlink};CFieldInstructionREF.prototype.GetHyperlink=function(){return this.Hyperlink};CFieldInstructionREF.prototype.SetIsNumberNoContext=function(bVal){this.bIsNumberNoContext= bVal};CFieldInstructionREF.prototype.IsNumberNoContext=function(){return this.bIsNumberNoContext};CFieldInstructionREF.prototype.SetIsNumberFullContext=function(bVal){this.bIsNumberFullContext=bVal};CFieldInstructionREF.prototype.IsNumberFullContext=function(){return this.bIsNumberFullContext};CFieldInstructionREF.prototype.HaveNumberFlag=function(){return this.IsNumber()||this.IsNumberFullContext()||this.IsNumberNoContext()};CFieldInstructionREF.prototype.SetIsNumber=function(bVal){this.bIsNumber= bVal};CFieldInstructionREF.prototype.IsNumber=function(){return this.bIsNumber};CFieldInstructionREF.prototype.SetIsPosition=function(bVal){this.bIsPosition=bVal};CFieldInstructionREF.prototype.IsPosition=function(){return this.bIsPosition};CFieldInstructionREF.prototype.SetDelimiter=function(bVal){this.Delimiter=bVal};CFieldInstructionREF.prototype.GetDelimiter=function(){return this.Delimiter};CFieldInstructionREF.prototype.ToString=function(){var sInstruction=" REF ";sInstruction+=this.BookmarkName; for(var nSwitch=0;i<this.GeneralSwitches.length;++nSwitch)sInstruction+=" \\* "+this.GeneralSwitches[nSwitch];if(this.GetHyperlink())sInstruction+=" \\h";if(this.IsNumberNoContext())sInstruction+=" \\n";if(this.IsNumberFullContext())sInstruction+=" \\w";if(this.IsNumber())sInstruction+=" \\r";if(this.IsPosition())sInstruction+=" \\p";if(typeof this.Delimiter==="string"&&this.Delimiter.length>0)sInstruction+=" \\d "+this.Delimiter;return sInstruction};CFieldInstructionREF.prototype.GetAnchor=function(){var sBookmarkName= this.GetBookmarkName();var sAnchor=sBookmarkName;if(this.ComplexField){var oLogicDoc=this.ComplexField.LogicDocument;if(oLogicDoc){var oBookmarksManager=oLogicDoc.GetBookmarksManager();if(oBookmarksManager){var oBookmark=oBookmarksManager.GetBookmarkByName(sBookmarkName);if(!oBookmark)sAnchor="_top"}}}return sAnchor};CFieldInstructionREF.prototype.GetValue=function(){return""};CFieldInstructionREF.prototype.SetVisited=function(isVisited){};CFieldInstructionREF.prototype.IsTopOfDocument=function(){return this.GetAnchor()=== "_top"};CFieldInstructionREF.prototype.SetToolTip=function(sToolTip){};CFieldInstructionREF.prototype.GetToolTip=function(){var sTooltip=this.BookmarkName;if(!sTooltip||"_"===sTooltip.charAt(0))sTooltip=AscCommon.translateManager.getValue("Current Document");return sTooltip};function CFieldInstructionNUMPAGES(){CFieldInstructionBase.call(this)}CFieldInstructionNUMPAGES.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionNUMPAGES.prototype.constructor=CFieldInstructionNUMPAGES; CFieldInstructionNUMPAGES.prototype.Type=fieldtype_NUMPAGES;function CFieldInstructionHYPERLINK(){CFieldInstructionBase.call(this);this.ToolTip="";this.Link="";this.BookmarkName=""}CFieldInstructionHYPERLINK.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionHYPERLINK.prototype.constructor=CFieldInstructionHYPERLINK;CFieldInstructionHYPERLINK.prototype.Type=fieldtype_HYPERLINK;CFieldInstructionHYPERLINK.prototype.SetToolTip=function(sToolTip){this.ToolTip=sToolTip};CFieldInstructionHYPERLINK.prototype.GetToolTip= function(){if(""===this.ToolTip){if(this.Link)return this.BookmarkName?this.Link+"#"+this.BookmarkName:this.Link;else if(this.BookmarkName)return AscCommon.translateManager.getValue("Current Document");return""}return this.ToolTip};CFieldInstructionHYPERLINK.prototype.SetLink=function(sLink){this.Link=sLink};CFieldInstructionHYPERLINK.prototype.GetLink=function(){return this.Link};CFieldInstructionHYPERLINK.prototype.SetBookmarkName=function(sBookmarkName){this.BookmarkName=sBookmarkName};CFieldInstructionHYPERLINK.prototype.GetBookmarkName= function(){return this.BookmarkName};CFieldInstructionHYPERLINK.prototype.ToString=function(){var sInstr="HYPERLINK ";if(this.Link)sInstr+='"'+this.Link+'"';if(this.ToolTip)sInstr+='\\o "'+this.ToolTip+'"';if(this.BookmarkName)sInstr+="\\l "+this.BookmarkName;return sInstr};CFieldInstructionHYPERLINK.prototype.GetAnchor=function(){return this.GetBookmarkName()};CFieldInstructionHYPERLINK.prototype.GetValue=function(){return this.GetLink()};CFieldInstructionHYPERLINK.prototype.SetVisited=function(isVisited){}; CFieldInstructionHYPERLINK.prototype.IsTopOfDocument=function(){return this.GetBookmarkName()==="_top"};function CFieldInstructionTIME(){CFieldInstructionBase.call(this);this.Format=""}CFieldInstructionTIME.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionTIME.prototype.constructor=CFieldInstructionTIME;CFieldInstructionTIME.prototype.Type=fieldtype_TIME;CFieldInstructionTIME.prototype.ToString=function(){return'TIME \\@ "'+this.sFormat+'"'};CFieldInstructionTIME.prototype.SetFormat= function(sFormat){this.Format=sFormat};CFieldInstructionTIME.prototype.GetFormat=function(){return this.Format};function CFieldInstructionDATE(){CFieldInstructionBase.call(this);this.Format=""}CFieldInstructionDATE.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionDATE.prototype.constructor=CFieldInstructionDATE;CFieldInstructionDATE.prototype.Type=fieldtype_DATE;CFieldInstructionDATE.prototype.ToString=function(){return'TIME \\@ "'+this.sFormat+'"'};CFieldInstructionDATE.prototype.SetFormat= function(sFormat){this.Format=sFormat};CFieldInstructionDATE.prototype.GetFormat=function(){return this.Format};function CFieldInstructionSEQ(){CFieldInstructionBase.call(this);this.Id=null;this.C=false;this.H=false;this.N=false;this.R=null;this.S=null;this.NumFormat=Asc.c_oAscNumberingFormat.Decimal;this.GeneralSwitches=[];this.ParentContent=null}CFieldInstructionSEQ.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionSEQ.prototype.constructor=CFieldInstructionSEQ;CFieldInstructionSEQ.prototype.Type= fieldtype_SEQ;CFieldInstructionSEQ.prototype.ToString=function(){var sInstruction=" SEQ ";if(this.Id)sInstruction+=this.Id;for(var i=0;i<this.GeneralSwitches.length;++i)sInstruction+=" \\* "+this.GeneralSwitches[i];if(this.C)sInstruction+=" \\c";if(this.H)sInstruction+=" \\h";if(this.R)sInstruction+=" \\r "+this.R;if(this.S)sInstruction+=" \\s "+this.S;return sInstruction};CFieldInstructionSEQ.prototype.SetComplexField=function(oComplexField){CFieldInstructionBase.prototype.SetComplexField.call(this, oComplexField);this.ParentContent=null;var oBeginChar=oComplexField.BeginChar;if(oBeginChar){var oRun=oBeginChar.Run;if(oRun){var oParagraph=oRun.Paragraph;if(oParagraph)this.ParentContent=oParagraph.Parent}}};CFieldInstructionSEQ.prototype.GetRestartNum=function(){if(typeof this.R==="string"&&this.R.length>0){var aTest=/[0-9]+/.exec(this.R);var nResult;if(Array.isArray(aTest)&&aTest.length>0){nResult=parseInt(aTest[0]);if(!isNaN(nResult))return nResult}}return null};CFieldInstructionSEQ.prototype.GetText= function(){if(!this.ParentContent)return"";var oTopDocument=this.ParentContent.Is_TopDocument(true);var aFields,oField,i,nIndex,nLvl,nCounter;if(!oTopDocument)return"";if(oTopDocument.IsHdrFtr(false)||oTopDocument.IsFootnote(false))return AscCommon.translateManager.getValue("Error! Main Document Only.");if(this.H)if(this.GeneralSwitches.length===0)return"";nIndex=this.GetRestartNum();if(nIndex===null){aFields=[];oTopDocument.GetAllSeqFieldsByType(this.Id,aFields);nIndex=-1;if(this.S){nLvl=parseInt(this.S); if(!isNaN(nLvl)){--nLvl;for(i=aFields.length-1;i>-1;--i){oField=aFields[i];if(AscCommon.isRealObject(oField)&&this.ComplexField===oField)break}if(i>-1){nCounter=i;for(i=i-1;i>-1;--i){oField=aFields[i];if(AscFormat.isRealNumber(oField)&&oField>=nLvl){aFields=aFields.splice(i+1,nCounter-i);break}}}}}nCounter=1;for(i=0;i<aFields.length;++i){oField=aFields[i];if(AscCommon.isRealObject(oField)){if(this.ComplexField===oField){nIndex=nCounter;break}if(!(oField.Instruction&&oField.Instruction.C))++nCounter}}}if(nIndex> -1)return AscCommon.IntToNumberFormat(nIndex,this.NumFormat);return AscCommon.translateManager.getValue("Error! Main Document Only.")};CFieldInstructionSEQ.prototype.SetId=function(sVal){this.Id=sVal};CFieldInstructionSEQ.prototype.SetC=function(sVal){this.C=sVal};CFieldInstructionSEQ.prototype.SetH=function(sVal){this.H=sVal};CFieldInstructionSEQ.prototype.SetN=function(sVal){this.N=sVal};CFieldInstructionSEQ.prototype.SetR=function(sVal){this.R=sVal};CFieldInstructionSEQ.prototype.SetS=function(sVal){this.S= sVal};CFieldInstructionSEQ.prototype.SetGeneralSwitches=function(aSwitches){this.GeneralSwitches=aSwitches;for(var i=0;i<aSwitches.length;++i)this.NumFormat=GeneralToNumFormat(aSwitches[i])};function GeneralToNumFormat(sFormat){if(typeof sFormat==="string")if(sFormat.toLowerCase()==="arabic")return Asc.c_oAscNumberingFormat.Decimal;else if(sFormat.toLowerCase()==="alphabetic")if(sFormat[0]==="A")return Asc.c_oAscNumberingFormat.UpperLetter;else return Asc.c_oAscNumberingFormat.LowerLetter;else if(sFormat.toLowerCase()=== "roman")if(sFormat[0]==="r")return Asc.c_oAscNumberingFormat.LowerRoman;else return Asc.c_oAscNumberingFormat.UpperRoman;return Asc.c_oAscNumberingFormat.Decimal}function CFieldInstructionSTYLEREF(){CFieldInstructionBase.call(this);this.StyleName=null;this.L=null;this.N=null;this.P=null;this.R=null;this.T=null;this.W=null;this.S=null;this.GeneralSwitches=[];this.ParentContent=null;this.ParentParagraph=null}CFieldInstructionSTYLEREF.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionSTYLEREF.prototype.constructor= CFieldInstructionSTYLEREF;CFieldInstructionSTYLEREF.prototype.Type=fieldtype_STYLEREF;CFieldInstructionSTYLEREF.prototype.SetL=function(v){this.L=v};CFieldInstructionSTYLEREF.prototype.SetN=function(v){this.N=v};CFieldInstructionSTYLEREF.prototype.SetP=function(v){this.P=v};CFieldInstructionSTYLEREF.prototype.SetR=function(v){this.R=v};CFieldInstructionSTYLEREF.prototype.SetT=function(v){this.T=v};CFieldInstructionSTYLEREF.prototype.SetW=function(v){this.W=v};CFieldInstructionSTYLEREF.prototype.SetS= function(v){this.S=v};CFieldInstructionSTYLEREF.prototype.SetGeneralSwitches=function(v){this.GeneralSwitches=v};CFieldInstructionSTYLEREF.prototype.GetText=function(){var sDefaultMessage="Error! No text of specified style in document.";if(this.ParentContent){var oHdrFtr=this.ParentContent.IsHdrFtr(true);if(oHdrFtr);else{var oFootNote=this.ParentContent.IsFootnote(true);if(oFootNote);else if(this.ParentParagraph){var oParagraph=null;var sRet="";var bAbove=true;var oStyles=this.ParentContent.Styles; var sId=oStyles.GetStyleIdByName(this.StyleName);var nStartIndex,oTmpContent;var oShape,oMainGroup,oDrawing,oCell,oRow,oTable,oBLSdt;var oParentParagraph,oParentContent,nParentIdx;if(sId){oParentParagraph=this.ParentParagraph;oParentContent=this.ParentContent;nParentIdx=this.ParentParagraph.GetIndex();oShape=this.ParentContent.Is_DrawingShape(true);if(oShape){if(oShape.group){oMainGroup=oShape.getMainGroup();oDrawing=oMainGroup.parent}else oDrawing=oShape.parent;if(!oDrawing)return AscCommon.translateManager.getValue(sDefaultMessage); oParentParagraph=oDrawing.GetParagraph();oParentContent=oParentParagraph.GetParent();nParentIdx=oParentParagraph.GetIndex()}if(oParentParagraph.GetParagraphStyle()===sId)oParagraph=oParentParagraph;oTmpContent=oParentContent;nStartIndex=nParentIdx;while(oTmpContent&&!oParagraph){oParagraph=oTmpContent.FindParaWithStyle(sId,true,nStartIndex);if(oParagraph)break;oCell=oTmpContent.IsTableCellContent(true);if(oCell){oRow=oCell.GetRow();oTable=oRow.GetTable();if(!oRow||!oTable)return AscCommon.translateManager.getValue(sDefaultMessage); oParagraph=oRow.FindParaWithStyle(sId,true,oCell.GetIndex()-1);if(!oParagraph)oParagraph=oTable.FindParaWithStyle(sId,true,oRow.GetIndex()-1);oTmpContent=oTable.Parent;nStartIndex=oTable.GetIndex()-1}else if(oTmpContent.IsBlockLevelSdtContent()){oBLSdt=oTmpContent.GetParent();oTmpContent=oBLSdt.Parent;nStartIndex=oBLSdt.GetIndex()-1}else break}if(!oParagraph){oTmpContent=oParentContent;nStartIndex=nParentIdx+1;while(oTmpContent&&!oParagraph){oParagraph=oTmpContent.FindParaWithStyle(sId,false,nStartIndex); if(oParagraph)break;oCell=oTmpContent.IsTableCellContent(true);if(oCell){oRow=oCell.GetRow();oTable=oRow.GetTable();if(!oRow||!oTable)return AscCommon.translateManager.getValue(sDefaultMessage);oParagraph=oRow.FindParaWithStyle(sId,false,oCell.GetIndex()+1);if(!oParagraph)oParagraph=oTable.FindParaWithStyle(sId,false,oRow.GetIndex()+1);oTmpContent=oTable.Parent;nStartIndex=oTable.GetIndex()+1}else if(oTmpContent.IsBlockLevelSdtContent()){oBLSdt=oTmpContent.GetParent();oTmpContent=oBLSdt.Parent;nStartIndex= oBLSdt.GetIndex()+1}else break}}if(oParagraph){if(this.N||this.R||this.W||this.S)if(oParagraph.IsNumberedNumbering())sRet+=oParagraph.GetNumberingText(true);else sRet+="0";else{oParagraph.ApplyToAll=true;sRet=oParagraph.GetSelectedText(true,{});oParagraph.ApplyToAll=false}if(this.P)sRet+=" "+AscCommon.translateManager.getValue(bAbove?"above":"below");return sRet}}return AscCommon.translateManager.getValue(sDefaultMessage)}}}return AscCommon.translateManager.getValue(sDefaultMessage)};CFieldInstructionSTYLEREF.prototype.SetStyleName= function(v){this.StyleName=v};CFieldInstructionSTYLEREF.prototype.ToString=function(){var sRet=" STYLEREF ";if(this.S)sRet+=" \\s";if(this.StyleName)sRet+=this.StyleName;if(this.L)sRet+=" \\l";if(this.N)sRet+=" \\n";if(this.P)sRet+=" \\p";if(this.R)sRet+=" \\r";if(this.T)sRet+=" \\t";if(this.W)sRet+=" \\w";return sRet};CFieldInstructionSTYLEREF.prototype.SetComplexField=function(oComplexField){CFieldInstructionBase.prototype.SetComplexField.call(this,oComplexField);this.ParentContent=null;var oBeginChar= oComplexField.BeginChar;if(oBeginChar){var oRun=oBeginChar.Run;if(oRun){var oParagraph=oRun.Paragraph;if(oParagraph){this.ParentParagraph=oParagraph;this.ParentContent=oParagraph.Parent}}}};function CFieldInstructionNOTEREF(){CFieldInstructionBase.call(this);this.GeneralSwitches=[];this.BookmarkName="";this.Hyperlink=false;this.bIsPosition=false;this.bFormatting=false}CFieldInstructionNOTEREF.prototype=Object.create(CFieldInstructionBase.prototype);CFieldInstructionNOTEREF.prototype.constructor=CFieldInstructionNOTEREF; CFieldInstructionNOTEREF.prototype.Type=fieldtype_NOTEREF;CFieldInstructionNOTEREF.prototype.SetGeneralSwitches=function(aSwitches){this.GeneralSwitches=aSwitches};CFieldInstructionNOTEREF.prototype.SetBookmarkName=function(sBookmarkName){this.BookmarkName=sBookmarkName};CFieldInstructionNOTEREF.prototype.GetBookmarkName=function(){return this.BookmarkName};CFieldInstructionNOTEREF.prototype.SetHyperlink=function(bIsHyperlink){this.Hyperlink=bIsHyperlink};CFieldInstructionNOTEREF.prototype.GetHyperlink= function(){return this.Hyperlink};CFieldInstructionNOTEREF.prototype.SetIsPosition=function(bVal){this.bIsPosition=bVal};CFieldInstructionNOTEREF.prototype.IsPosition=function(){return this.bIsPosition};CFieldInstructionNOTEREF.prototype.SetIsFormatting=function(bVal){this.bFormatting=bVal};CFieldInstructionNOTEREF.prototype.IsFormatting=function(){return this.bFormatting};CFieldInstructionNOTEREF.prototype.ToString=function(){var sInstruction=" NOTEREF ";sInstruction+=this.BookmarkName;for(var nSwitch= 0;i<this.GeneralSwitches.length;++nSwitch)sInstruction+=" \\* "+this.GeneralSwitches[nSwitch];if(this.GetHyperlink())sInstruction+=" \\h";if(this.IsPosition())sInstruction+=" \\p";if(this.IsFormatting())sInstruction+=" \\f";return sInstruction};CFieldInstructionNOTEREF.prototype.IsTopOfDocument=function(){return this.GetAnchor()==="_top"};CFieldInstructionNOTEREF.prototype.GetAnchor=function(){var sBookmarkName=this.GetBookmarkName();var sAnchor=sBookmarkName;if(this.ComplexField){var oLogicDoc=this.ComplexField.LogicDocument; if(oLogicDoc){var oBookmarksManager=oLogicDoc.GetBookmarksManager();if(oBookmarksManager){var oBookmark=oBookmarksManager.GetBookmarkByName(sBookmarkName);if(!oBookmark)sAnchor="_top"}}}return sAnchor};CFieldInstructionNOTEREF.prototype.GetValue=function(){return""};CFieldInstructionNOTEREF.prototype.SetVisited=function(isVisited){};CFieldInstructionREF.prototype.SetToolTip=function(sToolTip){};CFieldInstructionNOTEREF.prototype.GetToolTip=function(){return AscCommon.translateManager.getValue("Current Document")}; function CFieldInstructionParser(){this.Line="";this.Pos=0;this.Buffer="";this.Result=null;this.SavedStates=[]}CFieldInstructionParser.prototype.GetInstructionClass=function(sLine){this.Line=sLine;this.Pos=0;this.Buffer="";this.Result=null;this.private_Parse();return this.Result};CFieldInstructionParser.prototype.private_Parse=function(){if(!this.private_ReadNext())return this.private_ReadREF("");var sBuffer=this.Buffer.toUpperCase();if("PAGE"===sBuffer)this.private_ReadPAGE();else if("PAGEREF"=== sBuffer)this.private_ReadPAGEREF();else if("TOC"===sBuffer)this.private_ReadTOC();else if("ASC"===sBuffer)this.private_ReadASK();else if("REF"===sBuffer)this.private_ReadREF();else if("NOTEREF"===sBuffer)this.private_ReadNOTEREF();else if("NUMPAGES"===sBuffer)this.private_ReadNUMPAGES();else if("HYPERLINK"===sBuffer)this.private_ReadHYPERLINK();else if("SEQ"===sBuffer)this.private_ParseSEQ();else if("STYLEREF"===sBuffer)this.private_ParseSTYLEREF();else if("TIME"===sBuffer)this.private_ReadTIME(); else if("DATE"===sBuffer)this.private_ReadDATE();else if(sBuffer.indexOf("=")===0)this.private_ReadFORMULA();else this.private_ReadREF()};CFieldInstructionParser.prototype.private_ReadNext=function(){var nLen=this.Line.length,bWord=false;this.Buffer="";while(this.Pos<nLen){var nCharCode=this.Line.charCodeAt(this.Pos);if(32===nCharCode||9===nCharCode){if(bWord)return true}else if(34===nCharCode&&(0===this.Pos||92!==this.Line.charCodeAt(this.Pos-1))){this.Pos++;while(this.Pos<nLen){nCharCode=this.Line.charCodeAt(this.Pos); if(34===nCharCode&&92!==this.Line.charCodeAt(this.Pos-1)){this.Pos++;break}bWord=true;if(34===nCharCode&&92===this.Line.charCodeAt(this.Pos-1)&&this.Buffer.length>0)this.Buffer=this.Buffer.substring(0,this.Buffer.length-1);this.Buffer+=this.Line.charAt(this.Pos);this.Pos++}return bWord}else{this.Buffer+=this.Line.charAt(this.Pos);bWord=true}this.Pos++}if(bWord)return true;return false};CFieldInstructionParser.prototype.private_ReadArguments=function(){var arrArguments=[];var sArgument=this.private_ReadArgument(); while(null!==sArgument){arrArguments.push(sArgument);sArgument=this.private_ReadArgument()}return arrArguments};CFieldInstructionParser.prototype.private_ReadArgument=function(){this.private_SaveState();if(!this.private_ReadNext())return null;if(this.private_IsSwitch()){this.private_RestoreState();return null}this.private_RemoveLastState();return this.Buffer};CFieldInstructionParser.prototype.private_IsSwitch=function(){return this.Buffer.charAt(0)==="\\"};CFieldInstructionParser.prototype.private_GetSwitchLetter= function(){return this.Buffer.charAt(1)};CFieldInstructionParser.prototype.private_SaveState=function(){this.SavedStates.push(this.Pos)};CFieldInstructionParser.prototype.private_RestoreState=function(){if(this.SavedStates.length>0)this.Pos=this.SavedStates[this.SavedStates.length-1];this.private_RemoveLastState()};CFieldInstructionParser.prototype.private_RemoveLastState=function(){if(this.SavedStates.length>0)this.SavedStates.splice(this.SavedStates.length-1,1)};CFieldInstructionParser.prototype.private_ReadGeneralFormatSwitch= function(){if(!this.private_IsSwitch()||this.Buffer.charAt(1)!=="*")return;if(!this.private_ReadNext()||this.private_IsSwitch())return};CFieldInstructionParser.prototype.private_ReadPAGE=function(){this.Result=new CFieldInstructionPAGE;while(this.private_ReadNext())if(this.private_IsSwitch())this.private_ReadGeneralFormatSwitch()};CFieldInstructionParser.prototype.private_ReadFORMULA=function(){this.Result=new CFieldInstructionFORMULA;var sFormula=this.Buffer.slice(1,this.Buffer.length);var sFormat= null;var bFormat=false;var bNumFormat=false;while(this.private_ReadNext())if(this.private_IsSwitch()){bFormat=true;if("#"===this.Buffer.charAt(1))bNumFormat=true}else{if(bFormat){if(bNumFormat)sFormat=this.Buffer}else sFormula+=this.Buffer;bFormat=false;bNumFormat=false}sFormula=sFormula.toUpperCase();var oFormat;if(null!==sFormat){oFormat=AscCommon.oNumFormatCache.get(sFormat,AscCommon.NumFormatType.WordFieldNumeric);this.Result.SetFormat(oFormat)}this.Result.SetFormula(sFormula)};CFieldInstructionParser.prototype.private_ReadPAGEREF= function(){var sBookmarkName=null;var isHyperlink=false,isPageRel=false;var isSwitch=false,isBookmark=false;while(this.private_ReadNext())if(this.private_IsSwitch()){isSwitch=true;if("p"===this.Buffer.charAt(1))isPageRel=true;else if("h"===this.Buffer.charAt(1))isHyperlink=true}else if(!isSwitch&&!isBookmark){sBookmarkName=this.Buffer;isBookmark=true}this.Result=new CFieldInstructionPAGEREF(sBookmarkName,isHyperlink,isPageRel)};CFieldInstructionParser.prototype.private_ReadTOC=function(){this.Result= new CFieldInstructionTOC;var arrArguments;while(this.private_ReadNext())if(this.private_IsSwitch()){var sType=this.private_GetSwitchLetter();if("w"===sType)this.Result.SetPreserveTabs(true);else if("x"===sType)this.Result.SetRemoveBreaks(false);else if("h"===sType)this.Result.SetHyperlinks(true);else if("p"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetSeparator(arrArguments[0])}else if("o"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length> 0){var arrRange=this.private_ParseIntegerRange(arrArguments[0]);if(null!==arrRange)this.Result.SetHeadingRange(arrRange[0],arrRange[1])}else this.Result.SetHeadingRange(1,9)}else if("t"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetStylesArrayRaw(arrArguments[0])}else if("n"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0){var arrRange=this.private_ParseIntegerRange(arrArguments[0]);if(null!==arrRange)this.Result.SetPageRefSkippedLvls(true, arrRange[0],arrRange[1]);else this.Result.SetPageRefSkippedLvls(true,-1,-1)}else this.Result.SetPageRefSkippedLvls(true,-1,-1)}else if("c"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0){var sCaption=arrArguments[0];if(typeof sCaption==="string"&&sCaption.length>0)this.Result.SetCaption(sCaption);else this.Result.SetCaption(null)}else this.Result.SetCaption(null)}else if("a"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0){var sCaptionOnlyText= arrArguments[0];if(typeof sCaptionOnlyText==="string"&&sCaptionOnlyText.length>0)this.Result.SetCaptionOnlyText(sCaptionOnlyText);else this.Result.SetCaptionOnlyText(null)}else this.Result.SetCaptionOnlyText(null)}}};CFieldInstructionParser.prototype.private_ReadASK=function(){this.Result=new CFieldInstructionASK;var arrArguments=this.private_ReadArguments();if(arrArguments.length>=2)this.Result.SetPromptText(arrArguments[1]);if(arrArguments.length>=1)this.Result.SetBookmarkName(arrArguments[0])}; CFieldInstructionParser.prototype.private_ReadREF=function(sBookmarkName){this.Result=new CFieldInstructionREF;if(undefined!==sBookmarkName)this.Result.SetBookmarkName(sBookmarkName);else{var arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetBookmarkName(arrArguments[0])}while(this.private_ReadNext())if(this.private_IsSwitch()){var sType=this.private_GetSwitchLetter();if("*"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetGeneralSwitches(arrArguments)}else if("d"=== sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)if(typeof arrArguments[0]==="string"&&arrArguments[0].length>0)this.Result.SetDelimiter(arrArguments[0])}else if("h"===sType)this.Result.SetHyperlink(true);else if("n"===sType)this.Result.SetIsNumberNoContext(true);else if("w"===sType)this.Result.SetIsNumberFullContext(true);else if("r"===sType)this.Result.SetIsNumber(true);else if("p"===sType)this.Result.SetIsPosition(true)}};CFieldInstructionParser.prototype.private_ReadNOTEREF= function(){this.Result=new CFieldInstructionNOTEREF;var arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetBookmarkName(arrArguments[0]);while(this.private_ReadNext())if(this.private_IsSwitch()){var sType=this.private_GetSwitchLetter();if("*"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetGeneralSwitches(arrArguments)}else if("h"===sType)this.Result.SetHyperlink(true);else if("f"===sType)this.Result.SetIsFormatting(true);else if("p"=== sType)this.Result.SetIsPosition(true)}};CFieldInstructionParser.prototype.private_ReadNUMPAGES=function(){this.Result=new CFieldInstructionNUMPAGES};CFieldInstructionParser.prototype.private_ReadHYPERLINK=function(){this.Result=new CFieldInstructionHYPERLINK;var arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetLink(arrArguments[0]);while(this.private_ReadNext())if(this.private_IsSwitch()){var sType=this.private_GetSwitchLetter();if("o"===sType){arrArguments=this.private_ReadArguments(); if(arrArguments.length>0)this.Result.SetToolTip(arrArguments[0])}else if("l"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetBookmarkName(arrArguments[0])}}};CFieldInstructionParser.prototype.private_ParseIntegerRange=function(sValue){var nSepPos=sValue.indexOf("-");if(-1===nSepPos)return null;var nValue1=parseInt(sValue.substr(0,nSepPos));var nValue2=parseInt(sValue.substr(nSepPos+1));if(isNaN(nValue1)||isNaN(nValue2))return null;return[nValue1,nValue2]}; CFieldInstructionParser.prototype.private_ParseSEQ=function(){this.Result=new CFieldInstructionSEQ;var arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetId(arrArguments[0]);while(this.private_ReadNext())if(this.private_IsSwitch()){var sType=this.private_GetSwitchLetter();if("*"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetGeneralSwitches(arrArguments)}else if("c"===sType)this.Result.SetC(true);else if("h"===sType)this.Result.SetH(true); else if("n"===sType)this.Result.SetN(true);else if("r"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetR(arrArguments[0])}else if("s"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetS(arrArguments[0])}}};CFieldInstructionParser.prototype.private_ParseSTYLEREF=function(){this.Result=new CFieldInstructionSTYLEREF;var arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetStyleName(arrArguments[0]); while(this.private_ReadNext())if(this.private_IsSwitch()){var sType=this.private_GetSwitchLetter();if("*"===sType){arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetGeneralSwitches(arrArguments)}else if("l"===sType)this.Result.SetL(true);else if("n"===sType)this.Result.SetN(true);else if("p"===sType)this.Result.SetP(true);else if("r"===sType)this.Result.SetR(true);else if("t"===sType)this.Result.SetT(true);else if("w"===sType)this.Result.SetW(true);else if("s"===sType)this.Result.SetS(true)}}; CFieldInstructionParser.prototype.private_ReadTIME=function(){this.Result=new CFieldInstructionTIME;while(this.private_ReadNext())if(this.private_IsSwitch())if("@"===this.Buffer.charAt(1)){var arrArguments=this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetFormat(arrArguments[0])}};CFieldInstructionParser.prototype.private_ReadDATE=function(){this.Result=new CFieldInstructionDATE;while(this.private_ReadNext())if(this.private_IsSwitch())if("@"===this.Buffer.charAt(1)){var arrArguments= this.private_ReadArguments();if(arrArguments.length>0)this.Result.SetFormat(arrArguments[0])}};"use strict";var fldchartype_Begin=0;var fldchartype_Separate=1;var fldchartype_End=2;function ParaFieldChar(Type,LogicDocument){CRunElementBase.call(this);this.LogicDocument=LogicDocument;this.Use=true;this.CharType=undefined===Type?fldchartype_Begin:Type;this.ComplexField=this.CharType===fldchartype_Begin?new CComplexField(LogicDocument):null;this.Run=null;this.X=0;this.Y=0;this.PageAbs=0;this.FontKoef= 1;this.NumWidths=[];this.Widths=[];this.String="";this.NumValue=null}ParaFieldChar.prototype=Object.create(CRunElementBase.prototype);ParaFieldChar.prototype.constructor=ParaFieldChar;ParaFieldChar.prototype.Type=para_FieldChar;ParaFieldChar.prototype.Copy=function(){return new ParaFieldChar(this.CharType,this.LogicDocument)};ParaFieldChar.prototype.Measure=function(Context,TextPr){if(this.IsSeparate()){this.FontKoef=TextPr.Get_FontKoef();Context.SetFontSlot(fontslot_ASCII,this.FontKoef);for(var Index= 0;Index<10;Index++)this.NumWidths[Index]=Context.Measure(""+Index).Width;this.private_UpdateWidth()}};ParaFieldChar.prototype.Draw=function(X,Y,Context){if(this.IsSeparate()&&null!==this.NumValue){var Len=this.String.length;var _X=X;var _Y=Y;Context.SetFontSlot(fontslot_ASCII,this.FontKoef);for(var Index=0;Index<Len;Index++){var Char=this.String.charAt(Index);Context.FillText(_X,_Y,Char);_X+=this.Widths[Index]}}};ParaFieldChar.prototype.IsBegin=function(){return this.CharType===fldchartype_Begin? true:false};ParaFieldChar.prototype.IsEnd=function(){return this.CharType===fldchartype_End?true:false};ParaFieldChar.prototype.IsSeparate=function(){return this.CharType===fldchartype_Separate?true:false};ParaFieldChar.prototype.IsUse=function(){return this.Use};ParaFieldChar.prototype.SetUse=function(isUse){this.Use=isUse};ParaFieldChar.prototype.GetComplexField=function(){return this.ComplexField};ParaFieldChar.prototype.SetComplexField=function(oComplexField){this.ComplexField=oComplexField}; ParaFieldChar.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.Type);Writer.WriteLong(this.CharType)};ParaFieldChar.prototype.Read_FromBinary=function(Reader){this.CharType=Reader.GetLong();this.LogicDocument=editor.WordControl.m_oLogicDocument;this.ComplexField=this.CharType===fldchartype_Begin?new CComplexField(this.LogicDocument):null};ParaFieldChar.prototype.SetParent=function(oParent){this.Run=oParent};ParaFieldChar.prototype.SetRun=function(oRun){this.Run=oRun};ParaFieldChar.prototype.GetRun= function(){return this.Run};ParaFieldChar.prototype.SetXY=function(X,Y){this.X=X;this.Y=Y};ParaFieldChar.prototype.GetXY=function(){return{X:this.X,Y:this.Y}};ParaFieldChar.prototype.SetPage=function(nPage){this.PageAbs=nPage};ParaFieldChar.prototype.GetPage=function(){return this.PageAbs};ParaFieldChar.prototype.GetTopDocumentContent=function(){if(!this.Run)return null;var oParagraph=this.Run.GetParagraph();if(!oParagraph)return null;return oParagraph.Parent.GetTopDocumentContent()};ParaFieldChar.prototype.SetNumValue= function(nValue){this.NumValue=nValue;this.private_UpdateWidth()};ParaFieldChar.prototype.private_UpdateWidth=function(){if(null===this.NumValue)return;this.String=""+this.NumValue;var RealWidth=0;for(var Index=0,Len=this.String.length;Index<Len;Index++){var Char=parseInt(this.String.charAt(Index));this.Widths[Index]=this.NumWidths[Char];RealWidth+=this.NumWidths[Char]}RealWidth=RealWidth*TEXTWIDTH_DIVIDER|0;this.Width=RealWidth;this.WidthVisible=RealWidth};ParaFieldChar.prototype.IsNumValue=function(){return this.IsSeparate()&& null!==this.NumValue?true:false};ParaFieldChar.prototype.SaveRecalculateObject=function(Copy){return new CPageNumRecalculateObject(this.Type,this.Widths,this.String,this.Width,Copy)};ParaFieldChar.prototype.LoadRecalculateObject=function(RecalcObj){this.Widths=RecalcObj.Widths;this.String=RecalcObj.String;this.Width=RecalcObj.Width;this.WidthVisible=this.Width};ParaFieldChar.prototype.PrepareRecalculateObject=function(){this.Widths=[];this.String=""};function ParaInstrText(nCharCode){CRunElementBase.call(this); this.Value=undefined!==nCharCode?nCharCode:0;this.Width=0|0;this.WidthVisible=0|0;this.Run=null;this.Replacement=null}ParaInstrText.prototype=Object.create(CRunElementBase.prototype);ParaInstrText.prototype.constructor=ParaInstrText;ParaInstrText.prototype.Type=para_InstrText;ParaInstrText.prototype.Copy=function(){return new ParaInstrText(this.Value)};ParaInstrText.prototype.Measure=function(Context,TextPr){};ParaInstrText.prototype.Draw=function(X,Y,Context){};ParaInstrText.prototype.Write_ToBinary= function(Writer){Writer.WriteLong(this.Type);Writer.WriteLong(this.Value)};ParaInstrText.prototype.Read_FromBinary=function(Reader){this.Value=Reader.GetLong()};ParaInstrText.prototype.SetParent=function(oParent){this.Run=oParent};ParaInstrText.prototype.SetRun=function(oRun){this.Run=oRun};ParaInstrText.prototype.GetRun=function(){return this.Run};ParaInstrText.prototype.GetValue=function(){return String.fromCharCode(this.Value)};ParaInstrText.prototype.Set_CharCode=function(CharCode){this.Value= CharCode};ParaInstrText.prototype.SetReplacementItem=function(oItem){this.Replacement=oItem};ParaInstrText.prototype.GetReplacementItem=function(){return this.Replacement};function CComplexField(oLogicDocument){this.LogicDocument=oLogicDocument;this.Current=false;this.BeginChar=null;this.EndChar=null;this.SeparateChar=null;this.InstructionLine="";this.Instruction=null;this.Id=null;this.InstructionLineSrc="";this.InstructionCF=[]}CComplexField.prototype.SetCurrent=function(isCurrent){this.Current= isCurrent};CComplexField.prototype.IsCurrent=function(){return this.Current};CComplexField.prototype.SetInstruction=function(oParaInstr){this.InstructionLine+=oParaInstr.GetValue();this.InstructionLineSrc+=oParaInstr.GetValue()};CComplexField.prototype.SetInstructionCF=function(oCF){this.InstructionLine+=" \\& ";this.InstructionLineSrc+=" \\& ";this.InstructionCF.push(oCF)};CComplexField.prototype.SetInstructionLine=function(sLine){this.InstructionLine=sLine};CComplexField.prototype.GetBeginChar= function(){return this.BeginChar};CComplexField.prototype.GetEndChar=function(){return this.EndChar};CComplexField.prototype.GetSeparateChar=function(){return this.SeparateChar};CComplexField.prototype.SetBeginChar=function(oChar){oChar.SetComplexField(this);this.BeginChar=oChar;this.SeparateChar=null;this.EndChar=null;this.InstructionLine="";this.InstructionLineSrc="";this.InstructionCF=[]};CComplexField.prototype.SetEndChar=function(oChar){oChar.SetComplexField(this);this.EndChar=oChar};CComplexField.prototype.SetSeparateChar= function(oChar){oChar.SetComplexField(this);this.SeparateChar=oChar;this.EndChar=null};CComplexField.prototype.Update=function(isCreateHistoryPoint,isNeedRecalculate){this.private_CheckNestedComplexFields();this.private_UpdateInstruction();if(!this.Instruction||!this.BeginChar||!this.EndChar||!this.SeparateChar)return;this.SelectFieldValue();if(true===isCreateHistoryPoint){if(true===this.LogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content))return;this.LogicDocument.StartAction()}switch(this.Instruction.GetType()){case fieldtype_PAGE:case fieldtype_PAGENUM:this.private_UpdatePAGE(); break;case fieldtype_TOC:this.private_UpdateTOC();break;case fieldtype_PAGEREF:this.private_UpdatePAGEREF();break;case fieldtype_NUMPAGES:case fieldtype_PAGECOUNT:this.private_UpdateNUMPAGES();break;case fieldtype_FORMULA:this.private_UpdateFORMULA();break;case fieldtype_SEQ:this.private_UpdateSEQ();break;case fieldtype_STYLEREF:this.private_UpdateSTYLEREF();break;case fieldtype_TIME:case fieldtype_DATE:this.private_UpdateTIME();break;case fieldtype_REF:this.private_UpdateREF();break;case fieldtype_NOTEREF:this.private_UpdateNOTEREF(); break}if(false!==isNeedRecalculate)this.LogicDocument.Recalculate();if(isCreateHistoryPoint)this.LogicDocument.FinalizeAction()};CComplexField.prototype.CalculateValue=function(){this.private_CheckNestedComplexFields();this.private_UpdateInstruction();if(!this.Instruction||!this.BeginChar||!this.EndChar||!this.SeparateChar)return;var sResult="";switch(this.Instruction.GetType()){case fieldtype_PAGE:case fieldtype_PAGENUM:sResult=this.private_CalculatePAGE();break;case fieldtype_TOC:sResult="";break; case fieldtype_PAGEREF:sResult=this.private_CalculatePAGEREF();break;case fieldtype_NUMPAGES:case fieldtype_PAGECOUNT:sResult=this.private_CalculateNUMPAGES();break;case fieldtype_FORMULA:sResult=this.private_CalculateFORMULA();break;case fieldtype_SEQ:sResult=this.private_CalculateSEQ();break;case fieldtype_STYLEREF:sResult=this.private_CalculateSTYLEREF();break;case fieldtype_TIME:case fieldtype_DATE:sResult=this.private_CalculateTIME();break;case fieldtype_REF:sResult=this.private_CalculateREF(); break;case fieldtype_NOTEREF:sResult=this.private_CalculateNOTEREF();break}return sResult};CComplexField.prototype.private_UpdateSEQ=function(){this.LogicDocument.AddText(this.private_CalculateSEQ())};CComplexField.prototype.private_CalculateSEQ=function(){return this.Instruction.GetText()};CComplexField.prototype.private_UpdateSTYLEREF=function(){this.LogicDocument.AddText(this.private_CalculateSTYLEREF())};CComplexField.prototype.private_CalculateSTYLEREF=function(){return this.Instruction.GetText()}; CComplexField.prototype.private_InsertMessage=function(sMessage,oTextPr){var oSelectedContent=new CSelectedContent;var oPara=new Paragraph(this.LogicDocument.GetDrawingDocument(),this.LogicDocument,false);var oRun=new ParaRun(oPara,false);if(oTextPr)oRun.Apply_Pr(oTextPr);oRun.AddText(sMessage);oPara.AddToContent(0,oRun);oSelectedContent.Add(new CSelectedElement(oPara,false));this.private_InsertContent(oSelectedContent)};CComplexField.prototype.private_InsertContent=function(oSelectedContent){var oRun= this.BeginChar.GetRun();var oParagraph=oRun.GetParagraph();if(oParagraph){this.SelectFieldValue();var oNearPos=oParagraph.GetCurrentAnchorPosition();this.LogicDocument.TurnOff_Recalculate();this.LogicDocument.TurnOff_InterfaceEvents();this.LogicDocument.Remove(1,false,false,true);this.LogicDocument.TurnOn_Recalculate(false);this.LogicDocument.TurnOn_InterfaceEvents(false);if(oNearPos)if(this.LogicDocument.Can_InsertContent(oSelectedContent,oNearPos)){var aElements=oSelectedContent.Elements;var bOneEmptyPara= false;if(aElements.length===1&&aElements[0].Element.GetType()===AscCommonWord.type_Paragraph&&aElements[0].Element.Is_Empty())bOneEmptyPara=true;if(!bOneEmptyPara){oParagraph.Check_NearestPos(oNearPos);oParagraph.Parent.InsertContent(oSelectedContent,oNearPos);this.LogicDocument.MoveCursorRight(false,false,false)}}}};CComplexField.prototype.private_UpdateFORMULA=function(){this.Instruction.Calculate(this.LogicDocument);if(this.Instruction.ErrStr!==null){var oTextPr=new CTextPr;oTextPr.Set_FromObject({Bold:true}); this.private_InsertMessage(this.Instruction.ErrStr,oTextPr)}else if(this.Instruction.ResultStr!==null)this.private_InsertMessage(this.Instruction.ResultStr,null)};CComplexField.prototype.private_CalculateFORMULA=function(){this.Instruction.Calculate(this.LogicDocument);if(null!==this.Instruction.ErrStr)return this.Instruction.ErrStr;return this.Instruction.ResultStr};CComplexField.prototype.private_UpdatePAGE=function(){this.LogicDocument.AddText(""+this.private_CalculatePAGE())};CComplexField.prototype.private_CalculatePAGE= function(){var oRun=this.BeginChar.GetRun();var oParagraph=oRun.GetParagraph();var nInRunPos=oRun.GetElementPosition(this.BeginChar);var nLine=oRun.GetLineByPosition(nInRunPos);var nPage=oParagraph.GetPageByLine(nLine);var oLogicDocument=oParagraph.LogicDocument;return oLogicDocument.Get_SectionPageNumInfo2(oParagraph.Get_AbsolutePage(nPage)).CurPage};CComplexField.prototype.private_UpdateTOC=function(){this.LogicDocument.GetBookmarksManager().RemoveTOCBookmarks();var nTabPos=9345/20/72*25.4;var oSectPr= this.LogicDocument.GetCurrentSectionPr();if(oSectPr)if(oSectPr.Get_ColumnsCount()>1)nTabPos=Math.max(0,Math.min(oSectPr.GetColumnWidth(0),oSectPr.GetPageWidth(),oSectPr.GetContentFrameWidth()));else nTabPos=Math.max(0,Math.min(oSectPr.GetPageWidth(),oSectPr.GetContentFrameWidth()));var oStyles=this.LogicDocument.Get_Styles();var arrOutline;var sCaption=this.Instruction.GetCaption();var sCaptionOnlyText=this.Instruction.GetCaptionOnlyText();var sResultCaption=sCaption;var oBookmarksManager=this.LogicDocument.GetBookmarksManager(); if(typeof sCaptionOnlyText==="string"&&sCaptionOnlyText.length>0)sResultCaption=sCaptionOnlyText;var oOutlinePr={OutlineStart:this.Instruction.GetHeadingRangeStart(),OutlineEnd:this.Instruction.GetHeadingRangeEnd(),Styles:this.Instruction.GetStylesArray()};var bTOF=false;var bSkipCaptionLbl=false;if(sCaption!==undefined||sCaptionOnlyText!==undefined){bTOF=true;var aStyles=this.Instruction.GetStylesArray();if(aStyles.length>0)arrOutline=this.LogicDocument.GetOutlineParagraphs(null,oOutlinePr);else{arrOutline= [];if(sCaptionOnlyText!==undefined)bSkipCaptionLbl=true;if(typeof sResultCaption==="string"&&sResultCaption.length>0){var aParagraphs=this.LogicDocument.GetAllCaptionParagraphs(sResultCaption);var oCurPara;for(var nParagraph=0;nParagraph<aParagraphs.length;++nParagraph){oCurPara=aParagraphs[nParagraph];if(!bSkipCaptionLbl||oCurPara.CanAddRefAfterSEQ(sResultCaption))arrOutline.push({Paragraph:oCurPara,Lvl:0})}}}}else arrOutline=this.LogicDocument.GetOutlineParagraphs(null,oOutlinePr);var oSelectedContent= new CSelectedContent;var isPreserveTabs=this.Instruction.IsPreserveTabs();var sSeparator=this.Instruction.GetSeparator();var nForceTabLeader=this.Instruction.GetForceTabLeader();var oTab=new CParaTab(tab_Right,nTabPos,Asc.c_oAscTabLeader.Dot);var oPara,oTabs,oRun;if(undefined!==nForceTabLeader)oTab=new CParaTab(tab_Right,nTabPos,nForceTabLeader);else if((!sSeparator||""===sSeparator)&&arrOutline.length>0){var arrSelectedParagraphs=this.LogicDocument.GetCurrentParagraph(false,true);if(arrSelectedParagraphs.length> 0){oPara=arrSelectedParagraphs[0];oTabs=oPara.GetParagraphTabs();if(oTabs.Tabs.length>0)oTab=oTabs.Tabs[oTabs.Tabs.length-1]}}if(arrOutline.length>0)for(var nIndex=0,nCount=arrOutline.length;nIndex<nCount;++nIndex){var oSrcParagraph=arrOutline[nIndex].Paragraph;var sBookmarkName;var oParaForCopy=oSrcParagraph;if(bSkipCaptionLbl){sBookmarkName=oSrcParagraph.AddBookmarkForCaption(sResultCaption,true,true);if(!sBookmarkName)sBookmarkName=oSrcParagraph.AddBookmarkForTOC();oBookmarksManager.SelectBookmark(sBookmarkName); var oParaSelectedContent=this.LogicDocument.GetSelectedContent(false);var oElement=oParaSelectedContent.Elements[0];if(oElement&&oElement.Element.GetType()===type_Paragraph)oParaForCopy=oElement.Element}else sBookmarkName=oSrcParagraph.AddBookmarkForTOC();oPara=oParaForCopy.Copy(null,null,{SkipPageBreak:true,SkipLineBreak:this.Instruction.IsRemoveBreaks(),SkipColumnBreak:true,SkipAnchors:true,SkipFootnoteReference:true,SkipComplexFields:true,SkipComments:true,SkipBookmarks:true,CopyReviewPr:false}); oPara.RemovePrChange();if(bTOF)oPara.Style_Add(oStyles.GetDefaultTOF(),false);else oPara.Style_Add(oStyles.GetDefaultTOC(arrOutline[nIndex].Lvl),false);oPara.SetOutlineLvl(undefined);var oClearTextPr=new CTextPr;oClearTextPr.Set_FromObject({FontSize:null,Unifill:null,Underline:null,Color:null});var oSrcPStylePr=oStyles.Get_Pr(oSrcParagraph.Style_Get(),styletype_Paragraph,oSrcParagraph.Parent.Get_TableStyleForPara(),oSrcParagraph.Parent.Get_ShapeStyleForPara()).TextPr;var oDefaultPr=oStyles.Get_Pr(oStyles.GetDefaultParagraph(), styletype_Paragraph,null,null).TextPr;if(oSrcPStylePr.Bold!==oDefaultPr.Bold){oClearTextPr.Bold=null;oClearTextPr.BoldCS=null}if(oSrcPStylePr.Italic!==oDefaultPr.Italic){oClearTextPr.Italic=null;oClearTextPr.ItalicCS=null}oPara.SelectAll();oPara.ApplyTextPr(oClearTextPr);oPara.RemoveSelection();var oContainer=oPara,nContainerPos=0;if(this.Instruction.IsHyperlinks()){var sHyperlinkStyleId=oStyles.GetDefaultHyperlink();var oHyperlink=new ParaHyperlink;for(var nParaPos=0,nParaCount=oPara.Content.length- 1;nParaPos<nParaCount;++nParaPos){if(oPara.Content[0]instanceof ParaRun)oPara.Content[0].Set_RStyle(sHyperlinkStyleId);oHyperlink.Add_ToContent(nParaPos,oPara.Content[0]);oPara.Remove_FromContent(0,1)}oHyperlink.SetAnchor(sBookmarkName);oPara.Add_ToContent(0,oHyperlink);oContainer=oHyperlink;nContainerPos=oHyperlink.Content.length}else{oContainer=oPara;nContainerPos=oPara.Content.length-1}var isAddTabForNumbering=false;if(oSrcParagraph.HaveNumbering()&&oSrcParagraph.GetParent()){var oNumPr=oSrcParagraph.GetNumPr(); var oNumbering=this.LogicDocument.GetNumbering();var oNumInfo=oSrcParagraph.GetParent().CalculateNumberingValues(oSrcParagraph,oNumPr);var sText=oNumbering.GetText(oNumPr.NumId,oNumPr.Lvl,oNumInfo);var oNumTextPr=oSrcParagraph.GetNumberingCompiledPr();var oNumberingRun=new ParaRun(oPara,false);oNumberingRun.AddText(sText);if(oNumTextPr)oNumberingRun.Set_RFonts(oNumTextPr.RFonts);oContainer.Add_ToContent(0,oNumberingRun);nContainerPos++;var oNumTabRun=new ParaRun(oPara,false);var oNumLvl=oNumbering.GetNum(oNumPr.NumId).GetLvl(oNumPr.Lvl); var nNumSuff=oNumLvl.GetSuff();if(Asc.c_oAscNumberingSuff.Space===nNumSuff){oNumTabRun.Add_ToContent(0,new ParaSpace);oContainer.Add_ToContent(1,oNumTabRun);nContainerPos++}else if(Asc.c_oAscNumberingSuff.Tab===nNumSuff){oNumTabRun.Add_ToContent(0,new ParaTab);isAddTabForNumbering=true;oContainer.Add_ToContent(1,oNumTabRun);nContainerPos++}}oTabs=new CParaTabs;oTabs.Add(oTab);if(!isPreserveTabs&&oPara.RemoveTabsForTOC()||isAddTabForNumbering){var nFirstTabPos=11.6;var sTOCStyleId=this.LogicDocument.GetStyles().GetDefaultTOC(arrOutline[nIndex].Lvl); if(sTOCStyleId){var oParaPr=this.LogicDocument.GetStyles().Get_Pr(sTOCStyleId,styletype_Paragraph,null,null).ParaPr;nFirstTabPos=11.6+(oParaPr.Ind.Left+oParaPr.Ind.FirstLine)}oTabs.Add(new CParaTab(tab_Left,nFirstTabPos,Asc.c_oAscTabLeader.None))}oPara.Set_Tabs(oTabs);if(!this.Instruction.IsSkipPageRefLvl(arrOutline[nIndex].Lvl)){var oSeparatorRun=new ParaRun(oPara,false);if(!sSeparator||""===sSeparator)oSeparatorRun.AddToContent(0,new ParaTab);else oSeparatorRun.AddText(sSeparator.charAt(0));oContainer.Add_ToContent(nContainerPos, oSeparatorRun);var oPageRefRun=new ParaRun(oPara,false);oPageRefRun.AddToContent(-1,new ParaFieldChar(fldchartype_Begin,this.LogicDocument));oPageRefRun.AddInstrText("PAGEREF "+sBookmarkName+" \\h");oPageRefRun.AddToContent(-1,new ParaFieldChar(fldchartype_Separate,this.LogicDocument));oPageRefRun.AddText(""+this.LogicDocument.Get_SectionPageNumInfo2(oSrcParagraph.GetFirstNonEmptyPageAbsolute()).CurPage);oPageRefRun.AddToContent(-1,new ParaFieldChar(fldchartype_End,this.LogicDocument));oContainer.Add_ToContent(nContainerPos+ 1,oPageRefRun)}oSelectedContent.Add(new CSelectedElement(oPara,true))}else{var sReplacementText;if(bTOF)sReplacementText=AscCommon.translateManager.getValue("No table of figures entries found.");else sReplacementText=AscCommon.translateManager.getValue("No table of contents entries found.");oPara=new Paragraph(this.LogicDocument.GetDrawingDocument(),this.LogicDocument,false);oRun=new ParaRun(oPara,false);oRun.Set_Bold(true);oRun.AddText(sReplacementText);oPara.AddToContent(0,oRun);oSelectedContent.Add(new CSelectedElement(oPara, true))}this.SelectFieldValue();this.LogicDocument.TurnOff_Recalculate();this.LogicDocument.TurnOff_InterfaceEvents();this.LogicDocument.Remove(1,false,false,true);this.LogicDocument.TurnOn_Recalculate(false);this.LogicDocument.TurnOn_InterfaceEvents(false);oRun=this.BeginChar.GetRun();var oParagraph=oRun.GetParagraph();var oNearPos={Paragraph:oParagraph,ContentPos:oParagraph.Get_ParaContentPos(false,false)};oParagraph.Check_NearestPos(oNearPos);oSelectedContent.DoNotAddEmptyPara=true;oParagraph.Parent.InsertContent(oSelectedContent, oNearPos)};CComplexField.prototype.private_UpdatePAGEREF=function(){var oBookmarksManager=this.LogicDocument.GetBookmarksManager();var oBookmark=oBookmarksManager.GetBookmarkByName(this.Instruction.GetBookmarkName());if(!oBookmark){var sValue=AscCommon.translateManager.getValue("Error! Bookmark not defined.");this.private_InsertError(sValue);return}this.LogicDocument.AddText(this.private_CalculatePAGEREF())};CComplexField.prototype.private_CalculatePAGEREF=function(){var oBookmarksManager=this.LogicDocument.GetBookmarksManager(); var oBookmark=oBookmarksManager.GetBookmarkByName(this.Instruction.GetBookmarkName());var sValue=AscCommon.translateManager.getValue("Error! Bookmark not defined.");if(oBookmark){var oStartBookmark=oBookmark[0];var nBookmarkPage=oStartBookmark.GetPage()+1;if(this.Instruction.IsPositionRelative())if(oStartBookmark.GetPage()===this.SeparateChar.GetPage()){var oBookmarkXY=oStartBookmark.GetXY();var oFieldXY=this.SeparateChar.GetXY();if(Math.abs(oBookmarkXY.Y-oFieldXY.Y)<.001)sValue=oBookmarkXY.X<oFieldXY.X? AscCommon.translateManager.getValue("above"):AscCommon.translateManager.getValue("below");else if(oBookmarkXY.Y<oFieldXY.Y)sValue=AscCommon.translateManager.getValue("above");else sValue=AscCommon.translateManager.getValue("below")}else sValue=AscCommon.translateManager.getValue("on page ")+nBookmarkPage;else sValue=this.LogicDocument.Get_SectionPageNumInfo2(oStartBookmark.GetPage()).CurPage+""}return sValue};CComplexField.prototype.private_UpdateNUMPAGES=function(){this.LogicDocument.AddText(""+ this.private_CalculateNUMPAGES())};CComplexField.prototype.private_CalculateNUMPAGES=function(){return this.LogicDocument.GetPagesCount()};CComplexField.prototype.private_UpdateTIME=function(){var sDate=this.private_CalculateTIME();if(sDate)this.LogicDocument.AddText(sDate)};CComplexField.prototype.private_CalculateTIME=function(){var nLangId=1033;var oSepChar=this.GetSeparateChar();if(oSepChar&&oSepChar.GetRun()){var oCompiledTextPr=oSepChar.GetRun().Get_CompiledPr(false);nLangId=oCompiledTextPr.Lang.Val}var sFormat= this.Instruction.GetFormat();var oFormat=AscCommon.oNumFormatCache.get(sFormat,AscCommon.NumFormatType.WordFieldDate);var sDate="";if(oFormat){var oCultureInfo=AscCommon.g_aCultureInfos[nLangId];var oDateTime=new Asc.cDate;sDate=oFormat.formatToWord(oDateTime.getExcelDate()+(oDateTime.getHours()*60*60+oDateTime.getMinutes()*60+oDateTime.getSeconds())/AscCommonExcel.c_sPerDay,15,oCultureInfo)}return sDate};CComplexField.prototype.private_InsertError=function(sText){var oTextPr=new CTextPr;oTextPr.Set_FromObject({Bold:true}); this.private_InsertMessage(sText,oTextPr)};CComplexField.prototype.private_GetREFPosValue=function(){var oBookmarksManager=this.LogicDocument.GetBookmarksManager();var sBookmarkName=this.Instruction.GetBookmarkName();var oBookmark=oBookmarksManager.GetBookmarkByName(sBookmarkName);if(!oBookmark)return"";var oStartBookmark=oBookmark[0];var oSrcParagraph=oStartBookmark.Paragraph;var oRun=this.BeginChar.GetRun();var oParagraph=oRun.GetParagraph();if(!oSrcParagraph||!oParagraph)return"";var oParent=oParagraph.GetParent(); var oSrcParent=oSrcParagraph.GetParent();if(!oParent||!oSrcParent)return"";var oTopDoc=oParent.Is_TopDocument(true);if(oTopDoc!==oSrcParent.Is_TopDocument(true))return"";var sPosition=AscCommon.translateManager.getValue("above");oRun.Make_ThisElementCurrent(false);var aFieldPos=oTopDoc.GetContentPosition();this.LogicDocument.TurnOff_InterfaceEvents();oBookmarksManager.SelectBookmark(sBookmarkName);this.LogicDocument.TurnOn_InterfaceEvents(false);var aBookmarkPos=oTopDoc.GetContentPosition(true,false); var nIdx,nEnd,oBookmarkPos,oFieldPos;for(nIdx=0,nEnd=Math.min(aFieldPos.length,aBookmarkPos.length);nIdx<nEnd;++nIdx){oBookmarkPos=aBookmarkPos[nIdx];oFieldPos=aFieldPos[nIdx];if(oBookmarkPos&&oFieldPos&&oBookmarkPos.Position!==oFieldPos.Position){if(oBookmarkPos.Position<oFieldPos.Position)sPosition=AscCommon.translateManager.getValue("above");else sPosition=AscCommon.translateManager.getValue("below");break}}return sPosition};CComplexField.prototype.private_UpdateREF=function(){this.private_InsertContent(this.private_GetREFContent())}; CComplexField.prototype.private_CalculateREF=function(){var oSelectedContent=this.private_GetREFContent();return oSelectedContent.GetText(null)};CComplexField.prototype.private_GetMessageContent=function(sMessage,oTextPr){var oSelectedContent=new CSelectedContent;var oPara=new Paragraph(this.LogicDocument.GetDrawingDocument(),this.LogicDocument,false);var oRun=new ParaRun(oPara,false);if(oTextPr)oRun.Apply_Pr(oTextPr);oRun.AddText(sMessage);oPara.AddToContent(0,oRun);oSelectedContent.Add(new CSelectedElement(oPara, false));oSelectedContent.DoNotAddEmptyPara=true;return oSelectedContent};CComplexField.prototype.private_GetErrorContent=function(sMessage){var oTextPr=new CTextPr;oTextPr.Set_FromObject({Bold:true});return this.private_GetMessageContent(sMessage,oTextPr)};CComplexField.prototype.private_GetBookmarkContent=function(sBookmarkName){var oBookmarksManager=this.LogicDocument.GetBookmarksManager();this.LogicDocument.TurnOff_InterfaceEvents();oBookmarksManager.SelectBookmark(sBookmarkName);this.LogicDocument.TurnOn_InterfaceEvents(false); var oSelectedContent=this.LogicDocument.GetSelectedContent(false);var aElements=oSelectedContent.Elements;var oElement;for(var nIndex=0;nIndex<aElements.length;++nIndex){oElement=aElements[nIndex];oElement.Element=oElement.Element.Copy(null,null,{SkipPageBreak:true,SkipColumnBreak:true,SkipAnchors:true,SkipFootnoteReference:true,SkipComplexFields:true,SkipComments:true,SkipBookmarks:true})}oSelectedContent.DoNotAddEmptyPara=true;return oSelectedContent};CComplexField.prototype.private_GetREFContent= function(){var sValue=AscCommon.translateManager.getValue("Error! Reference source not found.");if(!this.Instruction||this.Instruction.Type!==fieldtype_REF)return this.private_GetErrorContent(sValue);var oBookmarksManager=this.LogicDocument.GetBookmarksManager();var sBookmarkName=this.Instruction.GetBookmarkName();var oBookmark=oBookmarksManager.GetBookmarkByName(sBookmarkName);if(!oBookmark)return this.private_GetErrorContent(sValue);var oStartBookmark=oBookmark[0];var oSrcParagraph=oStartBookmark.Paragraph; var oRun=this.BeginChar.GetRun();var oParagraph=oRun.GetParagraph();if(!oSrcParagraph||!oParagraph)return this.private_GetErrorContent(sValue);var oParent=oParagraph.GetParent();var oSrcParent=oSrcParagraph.GetParent();if(!oParent||!oSrcParent)return this.private_GetErrorContent(sValue);var sPosition="";if(this.Instruction.IsPosition())sPosition=this.private_GetREFPosValue();if(this.Instruction.HaveNumberFlag()){if(!oSrcParagraph.IsNumberedNumbering())return this.private_GetMessageContent("0",null); var oNumPr=oSrcParagraph.GetNumPr();var oNumbering=this.LogicDocument.GetNumbering();var oNumInfo=oSrcParagraph.GetParent().CalculateNumberingValues(oSrcParagraph,oNumPr);var nLvl,oParaNumInfo;if(this.Instruction.IsNumber()){var oParaNumPr=oParagraph.GetNumPr();if(oParaNumPr&&oParaNumPr.NumId===oNumPr.NumId){oParaNumInfo=oParagraph.GetParent().CalculateNumberingValues(oParagraph,oParaNumPr);for(nLvl=0;nLvl<=oNumPr.Lvl&&nLvl<=oParaNumPr.Lvl;++nLvl)if(oParaNumInfo[nLvl]!==oNumInfo[nLvl])break;sValue= "";for(;nLvl<=oNumPr.Lvl;++nLvl)sValue+=oNumbering.GetText(oNumPr.NumId,nLvl,oNumInfo,nLvl===oNumPr.Lvl)}else sValue=oNumbering.GetText(oNumPr.NumId,oNumPr.Lvl,oNumInfo,true)}else if(this.Instruction.IsNumberFullContext()){sValue="";var sDelimiter=this.Instruction.GetDelimiter();for(nLvl=0;nLvl<=oNumPr.Lvl;++nLvl){sValue+=oNumbering.GetText(oNumPr.NumId,nLvl,oNumInfo,nLvl===oNumPr.Lvl);if(nLvl!==oNumPr.Lvl&&typeof sDelimiter==="string"&&sDelimiter.length>0)sValue+=sDelimiter}}else if(this.Instruction.IsNumberNoContext())sValue= oNumbering.GetText(oNumPr.NumId,oNumPr.Lvl,oNumInfo,true);if(sPosition.length>0){sValue+=" ";sValue+=sPosition}return this.private_GetMessageContent(sValue,null)}else if(this.Instruction.IsPosition()&&sPosition.length>0)return this.private_GetMessageContent(sPosition,null);else return this.private_GetBookmarkContent(sBookmarkName)};CComplexField.prototype.private_GetNOTEREFContent=function(){var sValue=AscCommon.translateManager.getValue("Error! Bookmark not defined.");if(!this.Instruction||this.Instruction.Type!== fieldtype_NOTEREF)return this.private_GetErrorContent(sValue);var oBookmarksManager=this.LogicDocument.GetBookmarksManager();var sBookmarkName=this.Instruction.GetBookmarkName();var oBookmark=oBookmarksManager.GetBookmarkByName(sBookmarkName);if(!oBookmark)return this.private_GetErrorContent(sValue);this.LogicDocument.TurnOff_InterfaceEvents();oBookmarksManager.SelectBookmark(sBookmarkName);this.LogicDocument.TurnOn_InterfaceEvents(false);var oSelectionInfo=this.LogicDocument.GetSelectedElementsInfo({CheckAllSelection:true}); var aFootEndNotes=oSelectionInfo.GetFootEndNoteRefs();if(aFootEndNotes.length===0)return this.private_GetErrorContent(sValue);var oFootEndNote=aFootEndNotes[0];var oStartBookmark=oBookmark[0];var oSrcParagraph=oStartBookmark.Paragraph;var oRun=this.BeginChar.GetRun();var oParagraph=oRun.GetParagraph();if(!oSrcParagraph||!oParagraph)return this.private_GetErrorContent(sValue);var oSelectedContent=new CSelectedContent;var oTextPr;var oPara=new Paragraph(this.LogicDocument.GetDrawingDocument(),this.LogicDocument, false);var oParent=oParagraph.GetParent();var oSrcParent=oSrcParagraph.GetParent();if(!oParent||!oSrcParent)return this.private_GetErrorContent(sValue);if(this.Instruction.IsPosition()&&oParent.IsHdrFtr()===oSrcParent.IsHdrFtr()){sValue=this.private_GetREFPosValue();if(typeof sValue==="string"&&sValue.length>0){oRun=new ParaRun(oPara,false);oRun.AddText(sValue);oPara.AddToContent(0,oRun)}}else{oRun=new ParaRun(oPara,false);if(this.Instruction.IsFormatting()){oTextPr=new CTextPr;oTextPr.Set_FromObject({VertAlign:AscCommon.vertalign_SuperScript}); oRun.Apply_Pr(oTextPr)}oRun.AddText(oFootEndNote.private_GetString());oPara.AddToContent(0,oRun)}oSelectedContent.Add(new CSelectedElement(oPara,false));oSelectedContent.DoNotAddEmptyPara=true;return oSelectedContent};CComplexField.prototype.private_UpdateNOTEREF=function(){this.private_InsertContent(this.private_GetNOTEREFContent())};CComplexField.prototype.private_CalculateNOTEREF=function(){var oSelectedContent=this.private_GetNOTEREFContent();return oSelectedContent.GetText(null)};CComplexField.prototype.SelectFieldValue= function(){var oDocument=this.GetTopDocumentContent();if(!oDocument)return;oDocument.RemoveSelection();var oRun=this.SeparateChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.SeparateChar)+1);var oStartPos=oDocument.GetContentPosition(false);oRun=this.EndChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.EndChar));var oEndPos=oDocument.GetContentPosition(false);oDocument.SetSelectionByContentPositions(oStartPos, oEndPos)};CComplexField.prototype.SelectFieldCode=function(){var oDocument=this.GetTopDocumentContent();if(!oDocument)return;oDocument.RemoveSelection();var oRun=this.BeginChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.BeginChar)+1);var oStartPos=oDocument.GetContentPosition(false);oRun=this.SeparateChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.SeparateChar));var oEndPos=oDocument.GetContentPosition(false); oDocument.SetSelectionByContentPositions(oStartPos,oEndPos)};CComplexField.prototype.SelectField=function(){var oDocument=this.GetTopDocumentContent();if(!oDocument)return;oDocument.RemoveSelection();var oRun=this.BeginChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.BeginChar));var oStartPos=oDocument.GetContentPosition(false);oRun=this.EndChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.EndChar)+ 1);var oEndPos=oDocument.GetContentPosition(false);oDocument.RemoveSelection();oDocument.SetSelectionByContentPositions(oStartPos,oEndPos)};CComplexField.prototype.GetFieldValueText=function(){var oDocument=this.GetTopDocumentContent();if(!oDocument)return;oDocument.RemoveSelection();var oRun=this.SeparateChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.SeparateChar)+1);var oStartPos=oDocument.GetContentPosition(false);oRun=this.EndChar.GetRun(); oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.EndChar));var oEndPos=oDocument.GetContentPosition(false);oDocument.SetSelectionByContentPositions(oStartPos,oEndPos);return oDocument.GetSelectedText()};CComplexField.prototype.GetTopDocumentContent=function(){if(!this.BeginChar||!this.SeparateChar||!this.EndChar)return null;var oTopDocument=this.BeginChar.GetTopDocumentContent();if(oTopDocument!==this.EndChar.GetTopDocumentContent()||oTopDocument!==this.SeparateChar.GetTopDocumentContent())return null; return oTopDocument};CComplexField.prototype.IsUse=function(){if(!this.BeginChar)return false;return this.BeginChar.IsUse()};CComplexField.prototype.GetStartDocumentPosition=function(){if(!this.BeginChar)return null;var oDocument=this.LogicDocument;var oState=oDocument.SaveDocumentState();var oRun=this.BeginChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.BeginChar));var oDocPos=oDocument.GetContentPosition(false);oDocument.LoadDocumentState(oState); return oDocPos};CComplexField.prototype.GetEndDocumentPosition=function(){if(!this.EndChar)return null;var oDocument=this.LogicDocument;var oState=oDocument.SaveDocumentState();var oRun=this.EndChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.EndChar)+1);var oDocPos=oDocument.GetContentPosition(false);oDocument.LoadDocumentState(oState);return oDocPos};CComplexField.prototype.IsValid=function(){return this.IsUse()&&this.BeginChar&&this.SeparateChar&& this.EndChar};CComplexField.prototype.GetInstruction=function(){this.private_UpdateInstruction();return this.Instruction};CComplexField.prototype.private_UpdateInstruction=function(){if(this.InstructionLine&&(!this.Instruction||!this.Instruction.CheckInstructionLine(this.InstructionLine))){var oParser=new CFieldInstructionParser;this.Instruction=oParser.GetInstructionClass(this.InstructionLine);this.Instruction.SetComplexField(this);this.Instruction.SetInstructionLine(this.InstructionLine)}};CComplexField.prototype.private_CheckNestedComplexFields= function(){var nCount=this.InstructionCF.length;if(nCount>0){this.Instruction=null;this.InstructionLine=this.InstructionLineSrc;for(var nIndex=0;nIndex<nCount;++nIndex){var sValue=this.InstructionCF[nIndex].CalculateValue();this.InstructionLine=this.InstructionLine.replace("\\&",sValue)}}};CComplexField.prototype.IsHidden=function(){if(!this.BeginChar||!this.SeparateChar)return false;var oInstruction=this.GetInstruction();return oInstruction&&(fieldtype_ASK===oInstruction.GetType()||this.SeparateChar.IsNumValue()&& (fieldtype_NUMPAGES===oInstruction.GetType()||fieldtype_PAGE===oInstruction.GetType()||fieldtype_FORMULA===oInstruction.GetType()))};CComplexField.prototype.RemoveFieldWrap=function(){if(!this.IsValid())return;var oRun=this.EndChar.GetRun();var nInRunPos=oRun.GetElementPosition(this.EndChar);if(-1!==nInRunPos)oRun.RemoveFromContent(nInRunPos,1);var oDocument=this.GetTopDocumentContent();if(!oDocument)return;var oRun=this.BeginChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.BeginChar)); var oStartPos=oDocument.GetContentPosition(false);oRun=this.SeparateChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.SeparateChar)+1);var oEndPos=oDocument.GetContentPosition(false);oDocument.SetSelectionByContentPositions(oStartPos,oEndPos);oDocument.Remove()};CComplexField.prototype.MoveCursorOutsideElement=function(isBefore){var oDocument=this.GetTopDocumentContent();if(!oDocument)return;oDocument.RemoveSelection();if(isBefore){var oRun=this.BeginChar.GetRun(); oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.BeginChar));if(oRun.IsCursorAtBegin())oRun.MoveCursorOutsideElement(true)}else{var oRun=this.EndChar.GetRun();oRun.Make_ThisElementCurrent(false);oRun.SetCursorPosition(oRun.GetElementPosition(this.EndChar)+1);if(oRun.IsCursorAtEnd())oRun.MoveCursorOutsideElement(false)}};CComplexField.prototype.RemoveField=function(){if(!this.IsValid())return;var oDocument=this.GetTopDocumentContent();if(!oDocument)return;this.SelectField(); oDocument.Remove()};CComplexField.prototype.SetPr=function(oPr){if(!this.IsValid())return;var oInstruction=this.GetInstruction();if(!oInstruction)return;var oDocument=this.GetTopDocumentContent();if(!oDocument)return;oInstruction.SetPr(oPr);var sNewInstruction=oInstruction.ToString();this.SelectFieldCode();oDocument.Remove();var oRun=this.BeginChar.GetRun();var nInRunPos=oRun.GetElementPosition(this.BeginChar)+1;oRun.AddInstrText(sNewInstruction,nInRunPos)};CComplexField.prototype.ChangeInstruction= function(sNewInstruction){if(!this.IsValid())return;var oDocument=this.GetTopDocumentContent();if(!oDocument)return;this.SelectFieldCode();oDocument.Remove();var oRun=this.BeginChar.GetRun();var nInRunPos=oRun.GetElementPosition(this.BeginChar)+1;oRun.AddInstrText(sNewInstruction,nInRunPos);this.Instruction=null;this.InstructionLine=sNewInstruction;this.InstructionLineSrc=sNewInstruction;this.InstructionCF=[];this.private_UpdateInstruction()};window["AscCommonWord"]=window["AscCommonWord"]||{};window["AscCommonWord"].CComplexField= CComplexField;"use strict";function CParaRevisionMove(isStart,isFrom,sName,oInfo){CParagraphContentBase.call(this);this.Id=AscCommon.g_oIdCounter.Get_NewId();this.Start=isStart;this.From=isFrom;this.Name=sName;this.Type=para_RevisionMove;this.ReviewInfo=null;if(oInfo)this.ReviewInfo=oInfo;else{this.ReviewInfo=new CReviewInfo;this.ReviewInfo.Update()}g_oTableId.Add(this